[
  {
    "path": ".devcontainer/devcontainer.json",
    "content": "{\n  \"name\": \"DevPod Development\",\n  \"image\": \"ghcr.io/loft-sh/devpod:dev-6b64450abdb0ebc2ce7f663f9ff935c56679f8b6\",\n  \"remoteUser\": \"devpod\",\n  \"postCreateCommand\": \"bash ./.devcontainer/post_create.sh\",\n  // Required for DinD\n  \"privileged\": true\n}\n"
  },
  {
    "path": ".devcontainer/post_create.sh",
    "content": "\n#!/usr/bin/env bash\n\nset -euo pipefail\n\nlog() {\n  echo \"[POST_CREATE] $*\"\n}\n\n# Start docker daemon. The script should've been put here by the DinD devcontainer feature\nlog \"Starting Docker Daemon\"\nsudo /usr/local/share/docker-init.sh\n#\n# Add our user to docker group \nsudo usermod -aG docker $USER\n\nlog \"Installing docker provider with default options\"\ndevpod provider add docker\n\nlog \"Done\"\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug-report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us reproduce and fix a bug\nlabels:\n- kind/bug\n---\n\n<!-- Please use this template for reporting bugs and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!-->\n\n**What happened?**  \n\n\n**What did you expect to happen instead?**  \n\n\n**How can we reproduce the bug?** (as minimally and precisely as possible)  \n\nMy *`devcontainer.json`*:\n```\n{\n    \"name\": \"...\",\n    ...\n}\n```\n\n**Local Environment:**  \n- DevPod Version: [use `devpod version`]\n- Operating System: windows | linux | mac\n- ARCH of the OS: AMD64 | ARM64 | i386 \n\n**DevPod Provider:**  \n- Cloud Provider: google | aws | azure | digitalOcean\n- Kubernetes Provider: [use `kubectl version`]\n- Local/remote provider: docker | ssh\n- Custom provider: provide imported `provider.yaml` config file\n\n\n**Anything else we need to know?**  \n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature-request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\nlabels:\n- kind/feature\n---\n\n**Is your feature request related to a problem?**  \n\n\n**Which solution do you suggest?**  \n\n\n**Which alternative solutions exist?**  \n\n\n**Additional context**  "
  },
  {
    "path": ".github/devcontainer/Dockerfile",
    "content": "FROM mcr.microsoft.com/devcontainers/go:1.23-bullseye\n\nARG TARGETOS\nARG TARGETARCH\n\n# We want to setup our own user later, this removes the built-in VSCode user \n# that comes with the base image\nRUN sudo userdel -r vscode -f || true && rm -rf /home/vscode\n\n# Install Node.js\nRUN apt-get update \\\n    && apt-get install -y --no-install-recommends curl ca-certificates gnupg \\\n    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Install Protobuf compiler\nRUN apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Install kind \nRUN curl -L -o kind \"https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-${TARGETARCH}\" && install -c -m 0755 kind /usr/local/bin && rm kind\n\n# Install alacritty terminfo\nRUN wget https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info \\\n    && sudo tic -xe alacritty,alacritty-direct alacritty.info \\\n    && rm alacritty.info\n"
  },
  {
    "path": ".github/devcontainer/devcontainer.json",
    "content": "{\n  \"name\": \"DevPod Development Image\",\n  \"build\": {\n    \"dockerfile\": \"Dockerfile\",\n    \"context\": \".\"\n  },\n  \"features\": {\n    \"ghcr.io/devcontainers/features/common-utils:2\": {\n      \"installZsh\": true,\n      \"configureZshAsDefaultShell\": true,\n      \"installOhMyZsh\": true,\n      \"installOhMyZshConfig\": true,\n      \"upgradePackages\": true,\n      \"username\": \"devpod\"\n    },\n    \"ghcr.io/devcontainers/features/github-cli:1\": {},\n    \"ghcr.io/devcontainers/features/docker-in-docker:2\": {\n      \"version\": \"latest\"\n    },\n    \"ghcr.io/devcontainers/features/kubectl-helm-minikube:1\": {\n      \"version\": \"latest\"\n    },\n    \"ghcr.io/dhoeric/features/k9s:1\": {\n      \"version\": \"latest\"\n    }\n  }\n}\n"
  },
  {
    "path": ".github/licenses.tmpl",
    "content": "---\ntitle: Open Source Licenses\nsidebar_label: OSS Licenses\n---\n\n# Devpod dependencies\n\nThe following open source dependencies are used to build the [DevPod][] CLI.\n\n[DevPod]: https://devpod.sh\n\n## Go Packages\n\nSome packages may only be included on certain architectures or operating systems.\n\n{{ range . }}\n - [{{.Name}}](https://pkg.go.dev/{{.Name}}) ([{{.LicenseName}}]({{.LicenseURL}}))\n{{- end }}\n\n"
  },
  {
    "path": ".github/workflows/build-devcontainer-image.yaml",
    "content": "name: Build Dev Container\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - \"main\"\n    paths:\n      - \".github/devcontainer/**\"\n\njobs:\n  build-and-push:\n    runs-on: ubuntu-latest\n    permissions:\n      packages: \"write\"\n      contents: \"write\"\n      pull-requests: \"write\"\n    steps:\n      - name: Checkout\n        id: checkout\n        uses: actions/checkout@v1\n\n      - name: Log in to GitHub Container Registry\n        uses: docker/login-action@v2\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v1\n\n      - name: Set up Docker Buildx\n        id: buildx\n        uses: docker/setup-buildx-action@v1\n\n      - name: Prepare DevPod\n        run: |\n          curl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64\" \\\n            && sudo install -c -m 0755 devpod /usr/local/bin \\\n            && rm -f devpod\n          devpod provider add docker\n\n      - name: \"Build and push image\"\n        run: |\n          for ARCH in amd64 arm64; do\n            # Build for $ARCH\n            devpod build . --devcontainer-path .github/devcontainer/devcontainer.json --platform linux/$ARCH --skip-push\n            ID=$(docker images --format \"{{.ID}} {{.CreatedAt}} {{.Tag}}\" | sort -rk 2 | grep \"devpod\" | awk 'NR==1{print $1}')\n            echo \"found image: $ID\"\n            if [ -z \"${ID}\" ]; then\n              echo \"Image ID empty, exiting\"\n              exit 0 \n            fi \n            docker image ls\n            docker tag $ID ghcr.io/loft-sh/devpod:dev-$ARCH\n            docker push ghcr.io/loft-sh/devpod:dev-$ARCH\n          done\n          SUFFIX=\"${{github.sha}}\"\n          IMAGE_NAME=\"devpod:dev-$SUFFIX\"\n          echo \"IMAGE_NAME=$IMAGE_NAME\" >> $GITHUB_ENV\n          # Combine into multi-arch image\n          docker manifest create ghcr.io/loft-sh/$IMAGE_NAME \\\n                 --amend ghcr.io/loft-sh/devpod:dev-amd64 \\\n                 --amend ghcr.io/loft-sh/devpod:dev-arm64\n\n          docker manifest push ghcr.io/loft-sh/$IMAGE_NAME\n\n      - name: Update devcontainer.json\n        if: ${{ success() }}\n        run: |\n          sed -i \"s|\\(\\\"image\\\": \\\"\\).*|\\1ghcr.io/loft-sh/${IMAGE_NAME}\\\",|\" .devcontainer/devcontainer.json\n\n      - name: Create Pull Request\n        if: ${{ success() }}\n        uses: peter-evans/create-pull-request@v4\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          commit-message: \"Update devcontainer image to ghcr.io/loft-sh/${{ env.IMAGE_NAME }}\"\n          title: \"Update devcontainer image\"\n          body: \"This PR updates the devcontainer image to ghcr.io/loft-sh/${{ env.IMAGE_NAME }}\"\n          branch: \"update-devcontainer-${{ github.sha }}\"\n          base: \"main\"\n"
  },
  {
    "path": ".github/workflows/e2e-tests.yaml",
    "content": "name: E2E tests\n\non:\n  release:\n    types: [prereleased]\n  workflow_dispatch: {}\n  pull_request:\n    branches:\n      - main\n    paths:\n      - \"**.go\"\n      - \"pkg/**.sh\"\n      - \"providers/**\"\n      - \"!**_test.go\" # exclude test files to ignore unit test changes\n      - \"e2e/**_test.go\" # include test files in e2e again\n      - \".github/workflows/e2e-tests.yaml\"\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\n  cancel-in-progress: true\n\nenv:\n  GO111MODULE: on\n  GOFLAGS: -mod=vendor\n\njobs:\n  test-e2e:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: true\n      max-parallel: 16\n      matrix:\n        label:\n          - \"build\"\n          - \"ide\"\n          - \"integration\"\n          - \"machine\"\n          - \"machineprovider\"\n          - \"provider\"\n          - \"ssh\"\n          - \"up\"\n          - \"up-docker\"\n          - \"up-podman\"\n          - \"up-docker-compose\"\n          - \"up-docker-build\"\n          - \"up-docker-compose-build\"\n          - \"context\"\n\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v2\n\n      - name: Set up Go\n        uses: actions/setup-go@v2\n        with:\n          go-version: 1.21.8\n\n      - name: Set up kind k8s cluster\n        uses: engineerd/setup-kind@v0.5.0\n        with:\n          version: \"v0.20.0\"\n          image: kindest/node:v1.27.3\n\n      - name: Testing kind cluster set-up\n        run: |\n          set -x\n          kubectl cluster-info\n          kubectl get pods -n kube-system -v 10\n          echo \"kubectl config current-context:\" $(kubectl config current-context)\n          echo \"KUBECONFIG env var:\" ${KUBECONFIG}\n\n      - name: Build binary and copy to the E2E directory\n        working-directory: ./e2e\n        run: |\n          chmod +x ../hack/build-e2e.sh\n          BUILDDIR=bin SRCDIR=\"..\" ../hack/build-e2e.sh\n\n      - name: E2E test\n        working-directory: ./e2e\n        run: |\n          sudo KUBECONFIG=/home/runner/.kube/config \\\n            GH_USERNAME=${GH_USERNAME} \\\n            GH_ACCESS_TOKEN=${GH_ACCESS_TOKEN} \\\n            go test -v -ginkgo.v -timeout 3600s --ginkgo.label-filter=${{ matrix.label }}\n        env:\n          GH_USERNAME: ${{ secrets.GH_PRIVATE_REPO_USER_TEST }}\n          GH_ACCESS_TOKEN: ${{ secrets.GH_PRIVATE_REPO_TOKEN_TEST }}\n\n  test-e2e-windows:\n    runs-on: self-hosted-windows\n    # We run this only on PRs, for pre-releases we run the full separate workflow\n    if: ${{ github.event_name == 'pull_request' }}\n    strategy:\n      fail-fast: true\n      max-parallel: 1\n      matrix:\n        label:\n          - \"build\"\n          - \"ide\"\n          - \"ssh\"\n          - \"up-docker\"\n          - \"up-docker-build\"\n          - \"up-docker-compose\"\n          # - \"up-docker-wsl\"\n\n    steps:\n      - name: Git set line ending\n        run: |\n          git config --global core.autocrlf false\n\n      - name: Checkout repo\n        uses: actions/checkout@v2\n\n      - name: Set up Go\n        uses: actions/setup-go@v2\n        with:\n          go-version: 1.21.8\n\n      - name: Build binary and copy to the E2E directory\n        run: |\n          mkdir e2e\\bin\n          go build -ldflags \"-s -w\" -o e2e\\bin\\devpod-windows-amd64.exe\n          $Env:GOOS = \"linux\"; $Env:GOARCH = \"amd64\"; go build -ldflags \"-s -w\" -o e2e\\bin\\devpod-linux-amd64\n\n      - name: E2E test\n        working-directory: .\\e2e\n        run: |\n          go run github.com/onsi/ginkgo/v2/ginkgo -r --timeout=3600s --label-filter=${{ matrix.label }}\n\n      - name: Container cleanup\n        if: ${{ always() }}\n        run: |\n          if (Test-Path C:\\Users\\loft-user\\.devpod\\) {\n            Remove-Item -Recurse C:\\Users\\loft-user\\.devpod\\\n          }\n          sh -c \"docker ps -q -a | xargs docker rm -f || :\"\n          sh -c \"docker images --format '{{.Repository}}:{{.Tag}},{{.ID}}' | grep -E 'devpod|none|temp|^test' | cut -d',' -f2 | xargs docker rmi -f || :\"\n          sh -c \"docker images --format '{{.Tag}}|{{.Digest}}' | grep none | cut -d'|' -f1 | xargs docker rmi -f || :\"\n"
  },
  {
    "path": ".github/workflows/e2e-win-full-tests.yaml",
    "content": "name: E2E Win full tests\n\non:\n  release:\n    types: [prereleased]\n  workflow_dispatch: {}\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\n  cancel-in-progress: true\n\nenv:\n  GO111MODULE: on\n  GOFLAGS: -mod=vendor\n\njobs:\n  test-e2e-windows:\n    runs-on: self-hosted-windows\n    strategy:\n      fail-fast: true\n      max-parallel: 1\n      matrix:\n        label:\n          - \"build\"\n          - \"ide\"\n          - \"ssh\"\n          - \"up-docker\"\n          - \"up-docker-build\"\n          - \"up-docker-compose\"\n          # - \"up-docker-wsl\"\n\n    steps:\n      - name: Git set line ending\n        run: |\n          git config --global core.autocrlf false\n\n      - name: Checkout repo\n        uses: actions/checkout@v2\n\n      - name: Set up Go\n        uses: actions/setup-go@v2\n        with:\n          go-version: 1.21.8\n\n      - name: Build binary and copy to the E2E directory\n        run: |\n          mkdir e2e\\bin\n          go build -ldflags \"-s -w\" -o e2e\\bin\\devpod-windows-amd64.exe\n          $Env:GOOS = \"linux\"; $Env:GOARCH = \"amd64\"; go build -ldflags \"-s -w\" -o e2e\\bin\\devpod-linux-amd64\n\n      - name: E2E test\n        working-directory: .\\e2e\n        run: |\n          go run github.com/onsi/ginkgo/v2/ginkgo -r --timeout=3600s --label-filter=${{ matrix.label }}\n\n      - name: Container cleanup\n        if: ${{ always() }}\n        run: |\n          if (Test-Path C:\\Users\\loft-user\\.devpod\\) {\n            Remove-Item -Recurse C:\\Users\\loft-user\\.devpod\\\n          }\n          sh -c \"docker ps -q -a | xargs docker rm -f || :\"\n          sh -c \"docker images --format '{{.Repository}}:{{.Tag}},{{.ID}}' | grep -E 'devpod|none|temp|^test' | cut -d',' -f2 | xargs docker rmi -f || :\"\n          sh -c \"docker images --format '{{.ID}}|{{.Digest}}' | grep none | cut -d'|' -f1 | xargs docker rmi -f || :\"\n"
  },
  {
    "path": ".github/workflows/go-licenses-check.yaml",
    "content": "name: go-licenses-check\n\non:\n  pull_request:\n    branches:\n      - main\n    paths:\n      - .github/workflows/go-licenses-check.yaml\n      - go.mod\n  workflow_dispatch: {}\n\nconcurrency:\n  group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  check-licenses:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v4\n        with:\n          go-version-file: go.mod\n\n      - name: Install go-licenses\n        run: |\n          go install github.com/google/go-licenses@v1.6.0\n\n      - name: Run go-licenses check\n        run: go-licenses check ./... --ignore github.com/loft-sh\n        env:\n          GOPRIVATE: \"github.com/loft-sh/*\"\n"
  },
  {
    "path": ".github/workflows/go-licenses.yaml",
    "content": "name: go-licenses\n\non:\n  push:\n    branches:\n      - main\n    paths:\n      - .github/licenses.tmpl\n      - .github/workflows/go-licenses.yaml\n      - go.mod\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  update-licenses:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v4\n        with:\n          go-version-file: go.mod\n\n      - name: Install go-licenses\n        run: |\n          go install github.com/google/go-licenses@v1.6.0\n\n      - name: Run go-licenses\n        run: go-licenses report ./... > docs/pages/licenses/devpod.mdx --template .github/licenses.tmpl --ignore github.com/loft-sh\n\n      - name: Create pull request\n        uses: peter-evans/create-pull-request@v5\n        with:\n          token: ${{ secrets.GH_ACCESS_TOKEN }}\n          committer: Loft Bot <loft-bot@users.noreply.github.com>\n          branch: licenses/devpod\n          commit-message: \"license(DevPod): Updated OSS licenses\"\n          title: \"license(DevPod): Updated OSS licenses\"\n          body: Triggered by ${{ github.repository }}@${{ github.sha }}\n          signoff: true\n          delete-branch: true\n"
  },
  {
    "path": ".github/workflows/golangci-lint.yaml",
    "content": "name: golangci-lint\n\non:\n  push:\n    tags:\n      - v*\n    branches:\n      - master\n      - main\n  pull_request:\n\npermissions:\n  contents: read\n  # Optional: allow read access to pull request. Use with `only-new-issues` option.\n  pull-requests: read\n\nenv:\n  GO111MODULE: on\n  GOFLAGS: -mod=vendor\n\njobs:\n  golangci:\n    name: lint\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/setup-go@v4\n        with:\n          go-version: \"1.21.8\"\n      - uses: actions/checkout@v3\n      - name: golangci-lint\n        uses: golangci/golangci-lint-action@v6\n        with:\n          version: v1.60.1\n          args: --timeout 30m\n"
  },
  {
    "path": ".github/workflows/release.yaml",
    "content": "name: Publish release\non:\n  release:\n    types: [prereleased]\n\njobs:\n  create-release:\n    if: startsWith(github.ref, 'refs/tags/v') == true\n    permissions:\n      contents: write\n    runs-on: ubuntu-22.04\n    outputs:\n      package_version: ${{ steps.get-version.outputs.package_version }}\n      original_package_version: ${{ steps.get-version.outputs.original_package_version }}\n      release_id: ${{ steps.get-release.outputs.id }}\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v3\n\n      - name: Setup Node\n        uses: actions/setup-node@v3\n        with:\n          node-version: 16\n\n      - run: npm install semver\n\n      - name: Get Version\n        uses: actions/github-script@v6\n        id: get-version\n        with:\n          script: |\n            const semver = require(\"semver\")\n            const refName = `${process.env.GITHUB_REF_NAME}`\n            let version = refName.split(\"v\")[1]\n\n            core.info(`Original Version: ${version}`)\n            core.setOutput(\"original_package_version\", version)\n\n            const parsed = semver.parse(version);\n            const supportedPreleases = [\n              { tag: \"alpha\", number: 1 },\n              { tag: \"beta\", number: 2 },\n              { tag: \"rc\", number: 3 },\n            ];\n            const maybePrelease = semver.prerelease(version);\n            const maybeSupported = supportedPreleases.find(\n              (p) => p.tag === maybePrelease?.[0]\n            );\n\n            // If we have a prelease and it is in the supported range, then we can use it\n            if (maybePrelease && maybeSupported) {\n              version = `${parsed.major}.${parsed.minor}.${parsed.patch}-${\n                maybeSupported.number\n              }${maybePrelease[1] ?? 0}`;\n            }\n\n            if(maybePrelease && !maybeSupported) {\n              core.setFailed(`Unsupported prerelease: ${version}`)\n            }\n\n            core.info(`Version: ${version}`)\n            core.setOutput(\"package_version\", version)\n\n      - name: Get Release\n        uses: actions/github-script@v6\n        id: get-release\n        with:\n          script: |\n            // Find the prerelease release in our repo that triggered this workflow\n            const refName = `${process.env.GITHUB_REF_NAME}`\n\n            const res = await github.rest.repos.listReleases({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              per_page: 10,\n            })\n            const release = res.data.find((r) => r.tag_name === refName && r.prerelease)\n            if(!release) { core.setFailed(\"Unable to find prerelease for this workflow\") }\n\n            core.setOutput(\"id\", release.id)\n\n  build-app:\n    needs: create-release\n    if: startsWith(github.ref, 'refs/tags/v') == true\n    permissions:\n      contents: write\n    strategy:\n      fail-fast: false\n      matrix:\n        settings:\n          - host: macos-latest\n            target: x86_64-apple-darwin\n            os: darwin\n            arch: amd64\n            cli_only: false\n          - host: macos-latest\n            target: aarch64-apple-darwin\n            os: darwin\n            arch: arm64\n            cli_only: false\n          # The WIX version we use for the installer (latest 3.something) doesn't support arm builds - if we need to support arm windows,\n          # we'd need to switch the installer toolchain to WIX 4.xx, not sure how that works out with tauri\n          # - host: windows-latest\n          #   target: aarch64-pc-windows-msvc\n          #   arch: arm64\n          #   cli-only: false\n          - host: windows-latest\n            target: x86_64-pc-windows-msvc\n            arch: amd64\n            cli_only: false\n          - host: ubuntu-22.04\n            target: x86_64-unknown-linux-gnu\n            os: linux\n            arch: amd64\n            cli_only: false\n          - host: ubuntu-22.04\n            target: aarch64-unknown-linux-gnu\n            os: linux\n            arch: arm64\n            cli_only: true\n    name: ${{ matrix.settings.target }}\n    runs-on: ${{ matrix.settings.host }}\n    env:\n      GO111MODULE: on\n      GOFLAGS: -mod=vendor\n\n    steps:\n      - name: Set git to use LF\n        run: |\n          git config --global core.autocrlf false\n          git config --global core.eol lf\n\n      - name: Checkout repository\n        uses: actions/checkout@v3\n\n      - name: Apply Version\n        if: matrix.settings.cli_only == false\n        run: yarn version --new-version ${{ needs.create-release.outputs.package_version }} --no-git-tag-version\n        working-directory: \"./desktop\"\n\n      - name: Setup System Dependencies\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        run: |\n          sudo apt-get update\n          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev\n\n      - name: Rust setup\n        uses: dtolnay/rust-toolchain@stable\n        if: matrix.settings.cli_only == false\n        with:\n          targets: ${{ matrix.settings.target }}\n\n      - name: Rust cache\n        uses: swatinem/rust-cache@v2\n        if: matrix.settings.cli_only == false\n        with:\n          workspaces: \"./desktop/src-tauri -> target\"\n\n      - name: Go setup\n        uses: actions/setup-go@v2\n        with:\n          go-version: 1.21.8\n\n      - name: Build Sidecar CLI\n        if: matrix.settings.host != 'windows-latest'\n        run: |\n          BIN_NAME=devpod-cli-${{ matrix.settings.target }}\n          GOOS=${{ matrix.settings.os }} GOARCH=${{ matrix.settings.arch }} CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/loft-sh/devpod/pkg/version.version=\"v${{ needs.create-release.outputs.original_package_version }}\" -X github.com/loft-sh/devpod/pkg/telemetry.telemetryPrivateKey=${{ secrets.DEVPOD_TELEMETRY_PRIVATE_KEY }} -X github.com/loft-sh/devpod/pkg/devcontainer/crane.craneSigningKey=\"${{ secrets.CRANE_PRIVATE_KEY }}\"\" -o \"test/$BIN_NAME\"\n          cp \"test/$BIN_NAME\" \"desktop/src-tauri/bin/$BIN_NAME\"\n          ls desktop/src-tauri/bin\n\n      - name: Build Sidecar CLI\n        if: matrix.settings.host == 'windows-latest'\n        shell: cmd\n        run: |\n          set GOOS=windows\n          set GOARCH=${{ matrix.settings.arch }}\n          set BIN_NAME=devpod-cli-${{ matrix.settings.target }}.exe\n\n          go build -ldflags \"-s -w -X github.com/loft-sh/devpod/pkg/version.version=\"v${{ needs.create-release.outputs.original_package_version }}\" -X github.com/loft-sh/devpod/pkg/telemetry.telemetryPrivateKey=${{ secrets.DEVPOD_TELEMETRY_PRIVATE_KEY }}\" -o \"test\\%BIN_NAME%\"\n\n          xcopy /F /Y \"test\\%BIN_NAME%\" desktop\\src-tauri\\bin\\*\n\n      - name: Sync node version and setup cache\n        uses: actions/setup-node@v3\n        if: matrix.settings.cli_only == false\n        with:\n          node-version: \"lts/*\"\n          cache: \"yarn\"\n          cache-dependency-path: \"./desktop/yarn.lock\"\n\n      - name: Install frontend dependencies\n        if: matrix.settings.cli_only == false\n        run: yarn install\n        working-directory: \"./desktop\"\n\n      - name: Install additional ubuntu dependencies\n        if: matrix.settings.host == 'ubuntu-22.04'\n        run: |\n          sudo apt-get update\n          sudo apt-get install -y libwebkit2gtk-4.1-dev librsvg2-dev patchelf\n\n      - name: Build Desktop App\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        uses: tauri-apps/tauri-action@v0.5.15\n        with:\n          releaseId: ${{ needs.create-release.outputs.release_id }}\n          projectPath: \"./desktop\"\n          args: \"--config src-tauri/tauri-flatpak.conf.json --target ${{ matrix.settings.target }} --bundles appimage,deb,updater\"\n          includeUpdaterJson: true\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          # AppImage Signing:\n          SIGN: ${{ secrets.APP_IMAGE_SIGN }}\n          SIGN_KEY: ${{ secrets.APP_IMAGE_SIGN_KEY }}\n          APPIMAGETOOL_SIGN_PASSPHRASE: ${{ secrets.APP_IMAGE_SIGN_PASSPHRASE }}\n\n      - name: Build Desktop App\n        if: matrix.settings.host == 'macos-latest' && matrix.settings.cli_only == false\n        uses: tauri-apps/tauri-action@v0.5.15\n        with:\n          releaseId: ${{ needs.create-release.outputs.release_id }}\n          projectPath: \"./desktop\"\n          args: \"--target ${{ matrix.settings.target }}\"\n          includeUpdaterJson: true\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          # MacOS Signing:\n          ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}\n          APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}\n          APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}\n          APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}\n          APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}\n          APPLE_ID: ${{ secrets.APPLE_ID }}\n          APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}\n          CI: false # https://github.com/tauri-apps/tauri-action/issues/740\n\n      - name: Build linux tar.gz\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        id: build-desktop-targz\n        run: |\n          cd ./desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/appimage/DevPod.AppDir || exit 1\n          tar --exclude=usr/bin/xdg-open --exclude=usr/lib --exclude=usr/share/doc --exclude=usr/share/glib-2.0 -zcvf DevPod-desktop.tar.gz usr\n\n          mv DevPod-desktop.tar.gz ../../DevPod-${{needs.create-release.outputs.package_version}}.tar.gz\n\n      - name: Prepare Windows Signing Tool\n        if: matrix.settings.host == 'windows-latest' && matrix.settings.cli_only == false\n        run: |\n          $destination_path = \"$Env:USERPROFILE\\code-signing\"\n          $download_url = \"$Env:CODESIGNTOOL_DOWNLOAD_URL\"\n\n          # Create the directory if it doesn't exist\n          New-Item -ItemType Directory -Force -Path $destination_path | Out-Null\n          Write-Output \"Starting to download CodeSignTool from $download_url\"\n\n          Invoke-WebRequest -Uri $download_url -OutFile codesigntool.zip\n\n          Write-Output \"Unzipping codesigntool.zip to $destination_path\"\n          Expand-Archive \"codesigntool.zip\" -DestinationPath $destination_path\n\n          Add-Content -Path $env:GITHUB_PATH -Value $destination_path\n          # This is requried in addition to setting the PATH because of how CodeSignTool wrote their batch script\n          \"CODE_SIGN_TOOL_PATH=$destination_path\" | Out-File -FilePath $env:GITHUB_ENV -Append\n        env:\n          CODESIGNTOOL_DOWNLOAD_URL: ${{ vars.CODESIGNTOOL_DOWNLOAD_URL }}\n\n      - name: Print Signing Tool Version\n        if: matrix.settings.host == 'windows-latest' && matrix.settings.cli_only == false\n        run: |\n          Write-Output \"Attempting to get CodeSignTool version\"\n          CodeSignTool.bat --version\n\n      - name: Build Desktop App\n        if: matrix.settings.host == 'windows-latest' && matrix.settings.cli_only == false\n        id: build-desktop-app\n        uses: tauri-apps/tauri-action@v0.5.15\n        with:\n          projectPath: \"./desktop\"\n          args: \" --target ${{ matrix.settings.target }}\"\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}\n          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}\n          CODESIGNTOOL_USERNAME: ${{ secrets.CODESIGNTOOL_USERNAME }}\n          CODESIGNTOOL_PASSWORD: ${{ secrets.CODESIGNTOOL_PASSWORD }}\n          CODESIGNTOOL_TOTP_SECRET: ${{ secrets.CODESIGNTOOL_TOTP_SECRET }}\n          CODESIGNTOOL_CREDENTIAL_ID: ${{ secrets.CODESIGNTOOL_CREDENTIAL_ID }}\n\n      - name: Sign Windows Sidecar Binary\n        if: matrix.settings.host == 'windows-latest'\n        shell: powershell\n        env:\n          CODESIGNTOOL_USERNAME: ${{ secrets.CODESIGNTOOL_USERNAME }}\n          CODESIGNTOOL_PASSWORD: ${{ secrets.CODESIGNTOOL_PASSWORD }}\n          CODESIGNTOOL_TOTP_SECRET: ${{ secrets.CODESIGNTOOL_TOTP_SECRET }}\n          CODESIGNTOOL_CREDENTIAL_ID: ${{ secrets.CODESIGNTOOL_CREDENTIAL_ID }}\n        run: |\n          $username = \"$Env:CODESIGNTOOL_USERNAME\"\n          $password = \"$Env:CODESIGNTOOL_PASSWORD\"\n          $totp_secret = \"$Env:CODESIGNTOOL_TOTP_SECRET\"\n          $credential_id = \"$Env:CODESIGNTOOL_CREDENTIAL_ID\"\n\n          $cli_input_file_path = \"desktop\\src-tauri\\bin\\devpod-cli-${{ matrix.settings.target }}.exe\"\n\n          Write-Output \"Signing files\"\n          $cli_input_file_path = Resolve-Path  \"$cli_input_file_path\" | select -ExpandProperty Path\n          CodeSignTool.bat sign -username=\"$username\" -password=\"$password\" -totp_secret=\"$totp_secret\" -credential_id=\"$credential_id\" -input_file_path=\"$cli_input_file_path\" -override\n\n      - name: Upload Release Asset\n        if: matrix.settings.host == 'windows-latest'\n        uses: actions/github-script@v6\n        with:\n          script: |\n            const fs = require(\"fs\")\n\n            const version = \"${{ needs.create-release.outputs.package_version }}\"\n\n            // prepare MSI vars\n            const msiName = `DevPod_${version}_x64_en-US.msi`\n            const msiPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/msi/${msiName}`\n            const msiZipName = `${msiName}.zip`\n            const msiZipPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/msi/${msiZipName}`\n            const msiZipSigName = `${msiName}.zip.sig`\n            const msiZipSigPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/msi/${msiZipSigName}`\n\n            // prepare NSIS vars\n            // the installer itself is suffixed with `.exe` but updater artifacts end with `.nsis.*`\n            const nsisName = `DevPod_${version}_x64-setup`\n            const nsisPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/nsis/${nsisName}.exe`\n\n            // Let's skip uploading the updater artifacts until we've figured out auto updating for both nsis and msi\n            // const nsisZipName = `${nsisName}.nsis.zip`\n            // const nsisZipPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/nsis/${nsisZipName}`\n            // const nsisZipSigName = `${nsisName}.nsis.zip.sig`\n            // const nsisZipSigPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/nsis/${nsisZipSigName}`\n\n            const cliName = \"devpod-windows-${{ matrix.settings.arch }}.exe\"\n            const cliPath = \"desktop/src-tauri/bin/devpod-cli-${{ matrix.settings.target }}.exe\"\n\n            const releaseId = \"${{ needs.create-release.outputs.release_id }}\"\n\n            const releaseAssets = [\n              { name: cliName, path: cliPath },\n\n              { name: msiName, path: msiPath },\n              { name: msiZipName, path: msiZipPath }, \n              { name: msiZipSigName, path: msiZipSigPath },\n\n              { name: `${nsisName}.exe`, path: nsisPath },\n              // { name: nsisZipName, path: nsisZipPath }, \n              // { name: nsisZipSigName, path: nsisZipSigPath },\n            ]\n            for (const asset of releaseAssets) {\n              console.log(\"Attempting to upload release asset: \", asset)\n              await github.rest.repos.uploadReleaseAsset({\n                headers: {\n                  \"content-type\": \"application/zip\",\n                  \"content-length\": fs.statSync(asset.path).size\n                },\n                name: asset.name,\n                data: fs.readFileSync(asset.path),\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                release_id: releaseId\n              })\n            }\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Upload CLI Asset\n        if: matrix.settings.host != 'windows-latest'\n        uses: actions/github-script@v6\n        with:\n          script: |\n            const fs = require(\"fs\")\n\n            const releaseId = \"${{ needs.create-release.outputs.release_id }}\"\n            const assetName = \"devpod-${{ matrix.settings.os }}-${{ matrix.settings.arch }}\"\n            const assetPath = \"desktop/src-tauri/bin/devpod-cli-${{ matrix.settings.target }}\"\n\n            console.log(\"Attempting to upload release asset: \", assetName)\n\n            await github.rest.repos.uploadReleaseAsset({\n              headers: {\n                \"content-type\": \"application/zip\",\n                \"content-length\": fs.statSync(assetPath).size\n              },\n              name: assetName,\n              data: fs.readFileSync(assetPath),\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              release_id: releaseId\n            })\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Upload Tar.gz Asset\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        uses: actions/github-script@v6\n        with:\n          script: |\n            const fs = require(\"fs\")\n\n            const releaseId = \"${{ needs.create-release.outputs.release_id }}\"\n            const assetName = \"DevPod-${{needs.create-release.outputs.package_version}}.tar.gz\"\n            const assetPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/${assetName}`\n\n            console.log(\"Attempting to upload release asset: \", assetName)\n\n            await github.rest.repos.uploadReleaseAsset({\n              headers: {\n                \"content-type\": \"application/zip\",\n                \"content-length\": fs.statSync(assetPath).size\n              },\n              name: assetName,\n              data: fs.readFileSync(assetPath),\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              release_id: releaseId\n            })\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Upload flatpak assets\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        uses: actions/github-script@v6\n        with:\n          script: |\n            const fs = require(\"fs\")\n\n            const releaseId = \"${{ needs.create-release.outputs.release_id }}\"\n            const assetName = \"DevPod.desktop\"\n            const assetPath = `desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/deb/DevPod_${{needs.create-release.outputs.package_version}}_amd64/data/usr/share/applications/${assetName}`\n\n            console.log(\"Attempting to upload release asset: \", assetName)\n\n            await github.rest.repos.uploadReleaseAsset({\n              headers: {\n                \"content-type\": \"application/zip\",\n                \"content-length\": fs.statSync(assetPath).size\n              },\n              name: assetName,\n              data: fs.readFileSync(assetPath),\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              release_id: releaseId\n            })\n\n            const mdAssetName = \"DevPod.metainfo.xml\"\n            const mdAssetPath = `desktop/flatpak/${mdAssetName}`\n\n            console.log(\"Attempting to upload release asset: \", mdAssetName)\n\n            await github.rest.repos.uploadReleaseAsset({\n              headers: {\n                \"content-type\": \"application/zip\",\n                \"content-length\": fs.statSync(mdAssetPath).size\n              },\n              name: mdAssetName,\n              data: fs.readFileSync(mdAssetPath),\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              release_id: releaseId\n            })\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Generate updated flatpak manifest\n        if: matrix.settings.host == 'ubuntu-22.04' && matrix.settings.cli_only == false\n        run: |\n          export VERSION=\"${{needs.create-release.outputs.package_version}}\"\n          export debPath=\"desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/deb/DevPod_${{needs.create-release.outputs.package_version}}_amd64.deb\"\n          export desktopPath=\"desktop/src-tauri/target/${{ matrix.settings.target }}/release/bundle/deb/DevPod_${{needs.create-release.outputs.package_version}}_amd64/data/usr/share/applications/${assetName}/DevPod.desktop\"\n          export metaPath=\"desktop/flatpak/DevPod.metainfo.xml\"\n          export SHA256=$(sha256sum \"${debPath}\" | cut -f1 -d ' ')\n          export DESKTOP_SHA256=$(sha256sum \"${desktopPath}\" | cut -f1 -d ' ')\n          export META_SHA256=$(sha256sum \"${metaPath}\" | cut -f1 -d ' ')\n          envsubst < desktop/flatpak/sh.loft.devpod.tmpl > desktop/flatpak/sh.loft.devpod.yaml\n\n      # - name: Updates flatpak manifest in flathub\n      #   uses: dmnemec/copy_file_to_another_repo_action@master\n      #   env:\n      #     API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}\n      #   with:\n      #     source_file: 'desktop/flatpak/sh.loft.DevPod.yaml'\n      #     destination_repo: 'flathub/sh.loft.DevPod'\n      #     destination_folder: ''\n      #     user_email: 'bot@loft.sh'\n      #     user_name: 'loftbot'\n      #     commit_message: 'Update flatpak manifest with latest release'\n\n  publish-updates:\n    needs: [build-app, create-release]\n    if: startsWith(github.ref, 'refs/tags/v') == true\n    permissions:\n      contents: write\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v3\n\n      - name: Release pro provider\n        run: |\n          set -e\n\n          VERSION=\"v${{ needs.create-release.outputs.original_package_version }}\"\n          OUT_DIR=\"release\"\n          ASSETS=\"devpod-darwin-amd64 devpod-darwin-arm64 devpod-linux-amd64 devpod-linux-arm64 devpod-windows-amd64.exe\"\n\n          echo \"Prepare output directory $OUT_DIR...\"\n          if [ ! -d \"$OUT_DIR\" ]; then\n            mkdir \"$OUT_DIR\"\n          else\n            rm -rf $OUT_DIR\n          fi\n          printf \"Done\\n\\n\"\n\n          echo \"Download release assets into $OUT_DIR...\"\n          for asset in $ASSETS; do\n                printf \"\\t$asset\\n\"\n                gh release download $VERSION --pattern=\"$asset\" --dir=\"$OUT_DIR\"\n                printf \"\\tDone\\n\"\n          done\n          printf \"Done\\n\\n\"\n\n          echo \"Generate provider.yaml...\"\n          go run ./hack/pro/main.go $VERSION > ./release/provider.yaml\n          printf \"Done\\n\\n\"\n\n          echo \"Upload provider.yaml...\"\n          gh release upload $VERSION ./release/provider.yaml --clobber\n          printf \"Done\\n\\n\"\n        env:\n          GH_TOKEN: ${{ github.token }}\n\n      - name: Update `latest.json`\n        uses: actions/github-script@v6\n        with:\n          retries: 2\n          retry-exempt-status-codes: 400,401,403\n          script: |\n            // At this point, we should have `linux-x86_64`, `darwin-aarch64` and `darwin-x86_64`.\n            // We need to add the missing platform/arch combinations by hand\n            const fs = require(\"fs\")\n\n            async function fetchAsset(assetID) {\n              const releaseAsset = await github.rest.repos.getReleaseAsset({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                asset_id: assetID,\n                headers: { accept: \"application/octet-stream\" }\n              })\n              const res = await fetch(releaseAsset.url, { headers: { accept: \"application/octet-stream\" } })\n              if (!res.ok) { core.setFailed(`${await res.text()}`) }\n\n              return res\n            }\n\n            const releaseId = \"${{ needs.create-release.outputs.release_id }}\"\n            const releaseArgs = { owner: context.repo.owner, repo: context.repo.repo, release_id: releaseId }\n            const release = await github.rest.repos.getRelease({ ...releaseArgs })\n\n            const latestAsset = release.data.assets.find(a => a.name === \"latest.json\")\n            core.info(`Downloading ${latestAsset.name} (ID: ${latestAsset.id})`)\n            const latestRes = await fetchAsset(latestAsset.id)\n            const latest = await latestRes.json()\n            const version = latest.version\n\n            const infos = [\n              { target: \"linux-x86_64\", sigFile: \".AppImage.tar.gz.sig\", packageType: \".tar.gz\", originalAssetName: `DevPod_${version}_amd64.AppImage`, desiredAssetName: \"DevPod_linux_amd64.AppImage\" },\n              { target: \"darwin-aarch64\", sigFile: \"aarch64.app.tar.gz.sig\", packageType: \".tar.gz\", originalAssetName: `DevPod_${version}_aarch64.dmg`, desiredAssetName: \"DevPod_macos_aarch64.dmg\", originalUpdaterAssetName: \"DevPod_aarch64.app.tar.gz\", desiredUpdaterAssetName: \"DevPod_macos_aarch64.app.tar.gz\" },\n              { target: \"darwin-x86_64\", sigFile: \"x64.app.tar.gz.sig\", packageType: \".tar.gz\", originalAssetName: `DevPod_${version}_x64.dmg`, desiredAssetName: \"DevPod_macos_x64.dmg\", originalUpdaterAssetName: \"DevPod_x64.app.tar.gz\", desiredUpdaterAssetName: \"DevPod_macos_x64.app.tar.gz\" },\n              { target: \"windows-x86_64\", sigFile: \".msi.zip.sig\", packageType: \".zip\", originalAssetName: `DevPod_${version}_x64_en-US.msi`, desiredAssetName: \"DevPod_windows_x64_en-US.msi\" },\n              { originalAssetName: `DevPod-${version}.tar.gz`, desiredAssetName: \"DevPod_linux_x86_64.tar.gz\" },\n            ]\n\n            for (const info of infos) {\n              // Update latest.json for platform\n              if (info.target) {\n                core.info(`Generating update info for ${info.desiredAssetName}`)\n                const sigAsset = release.data.assets.find(a => a.name.endsWith(info.sigFile))\n                if (!sigAsset) {\n                  core.warning(`Unable to find sig asset: ${info.sigFile}`)\n                  continue\n                }\n                core.info(`Downloading ${sigAsset.name} (ID: ${sigAsset.id})`)\n                const sig = await fetchAsset(sigAsset.id)\n\n                let assetName = `${info.desiredAssetName}${info.packageType}`\n                if (info.desiredUpdaterAssetName) {\n                  assetName = info.desiredUpdaterAssetName\n                }\n\n                latest.platforms[info.target] = {\n                  signature: await sig.text(),\n                  url: `https://github.com/loft-sh/devpod/releases/download/${process.env.GITHUB_REF_NAME}/${assetName}`,\n                }\n\n                // once we're done with the sig file, delete it\n                await github.rest.repos.deleteReleaseAsset({\n                  ...releaseArgs,\n                  asset_id: sigAsset.id\n                })\n              }\n\n              const a = release.data.assets.find(a => a.name === info.originalAssetName)\n              if (!a) {\n                core.warning(`Unable to find asset: ${info.originalAssetName}`)\n                continue\n              }\n\n              const assetID = a.id\n              // Update the asset name\n              await github.rest.repos.updateReleaseAsset({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                asset_id: assetID,\n                name: info.desiredAssetName\n              })\n\n              if (info.packageType) {\n                let name = `${info.originalAssetName}${info.packageType}`\n                if (info.originalUpdaterAssetName) {\n                  name = info.originalUpdaterAssetName\n                }\n                const b = release.data.assets.find(a => a.name === name)\n                if (!b) {\n                  core.warning(`Unable to find update asset: ${name}`)\n                  continue\n                }\n                let desiredName = `${info.desiredAssetName}${info.packageType}`\n                if (info.desiredUpdaterAssetName) {\n                  desiredName = info.desiredUpdaterAssetName\n                }\n                const assetID = b.id\n                // Update the asset name\n                await github.rest.repos.updateReleaseAsset({\n                  owner: context.repo.owner,\n                  repo: context.repo.repo,\n                  asset_id: assetID,\n                  name: desiredName\n                })\n              }\n            }\n\n            const latestJSON = JSON.stringify(latest)\n            const latestDestPath = \"desktop/latest.json\"\n            core.info(`Writing latest.json to disk (${latestDestPath}): ${latestJSON}`)\n\n            fs.writeFileSync(latestDestPath, latestJSON)\n\n            // Attempting to upload a previously released asset results in an error so we need to clean up before\n            if (latestAsset) {\n              await github.rest.repos.deleteReleaseAsset({\n                ...releaseArgs,\n                asset_id: latestAsset.id\n              })\n            }\n\n            await github.rest.repos.uploadReleaseAsset({\n              ...releaseArgs,\n              headers: {\n                \"content-type\": \"application/zip\",\n                \"content-length\": fs.statSync(latestDestPath).size\n              },\n              name: \"latest.json\",\n              data: fs.readFileSync(latestDestPath),\n            })\n"
  },
  {
    "path": ".github/workflows/stale.yaml",
    "content": "name: Close inactive issues\non:\n  schedule:\n    - cron: \"30 1 * * *\"\n\njobs:\n  close-issues:\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n      pull-requests: write\n    steps:\n      - uses: actions/stale@v5\n        with:\n          operations-per-run: 60\n          days-before-issue-stale: 60\n          days-before-issue-close: 30\n          stale-issue-label: stale\n          stale-issue-message: |\n            This issue is stale because it has been open for 60 days with no activity.\n            It will be closed in 30 days on inactivity.\n          close-issue-message: |\n            This issue was closed because it has been inactive for 30 days since being marked as stale.\n          days-before-pr-stale: -1\n          days-before-pr-close: -1\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          exempt-all-assignees: true\n          exempt-issue-labels: >-\n            in-progress,\n            assigned,\n            kind/bug,\n            kind/enhancement\n"
  },
  {
    "path": ".github/workflows/ui-ci.yaml",
    "content": "name: UI CI\n\non:\n  workflow_dispatch: {}\n  pull_request:\n    branches:\n      - main\n      - release-*\n    paths:\n      - desktop/\n\njobs:\n  check:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        working-directory: ./desktop\n    steps:\n      - name: checkout\n        uses: actions/checkout@v4\n\n      - name: setup node\n        uses: actions/setup-node@v4\n        with:\n          node-version: \"20\"\n\n      - name: install dependencies\n        run: yarn install --frozen-lockfile\n\n      - name: lint\n        run: yarn lint:ci\n\n      - name: check format\n        run: yarn format:check\n\n      - name: check types\n        run: yarn types:check\n\n        # This only builds the frontend assets, not the full DevPod Desktop app to make it quicker\n      - name: build\n        run: yarn build\n"
  },
  {
    "path": ".github/workflows/unit-tests.yaml",
    "content": "name: Unit tests\n\non:\n  workflow_dispatch: {}\n  pull_request:\n    types:\n      - opened\n      - reopened\n      - synchronize\n      - edited\n    branches:\n      - main\n    paths:\n      - \"**.go\"\n      - \"hack/unit-tests.sh\"\n      - \".github/workflows/unit-tests.yaml\"\n      - \"!/docs/**\"\n\n# make sure the pipeline is only running once\nconcurrency:\n  group: unit-${{ github.head_ref || github.ref_name }}\n  cancel-in-progress: true\n\njobs:\n  unit-tests:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Set up Go\n        uses: actions/setup-go@v3\n        with:\n          go-version: 1.21.8\n\n      - name: Test\n        run: ./hack/unit-tests.sh\n"
  },
  {
    "path": ".gitignore",
    "content": "/.idea\n.DS_Store\n/test\n/e2e/bin\n/devpod\n/devpod.exe\n/devpod-cli\n# Unit test targets\n/main\n/profile.out\n/package-lock.json\n/tags"
  },
  {
    "path": ".golangci.yaml",
    "content": "linters:\n  # We want to gradually introduce new linters to the project\n  disable-all: true\n  enable:\n    - asasalint\n    - asciicheck\n    - bidichk\n    - decorder\n    - durationcheck\n    - errcheck\n    - errname\n    - errorlint\n    - exhaustive\n    - exportloopref\n    - ginkgolinter\n    - gocheckcompilerdirectives\n    - goimports\n    - gosimple\n    - govet\n    - grouper\n    - importas\n    - ineffassign\n    - makezero\n    - misspell\n    - nakedret\n    - promlinter\n    - staticcheck\n    - stylecheck\n    - typecheck\n    - tagalign\n    - unconvert\n    - unused\n    - whitespace\n\n    # - dupl\n    # - cyclop\n    # - funlen\n\nlinters-settings:\n  stylecheck:\n    checks: [\"*\", \"-ST1003\"]\n  exhaustive:\n    check:\n      - switch\n      - map\n    ignore-enum-types: \"ResourceName|FileMode|ProgrammingLanguage\"\n    # - cyclop\n    # - funlen\nissues:\n  # Maximum issues count per one linter. Set to 0 to disable. Default is 50.\n  max-issues-per-linter: 0\n  # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.\n  max-same-issues: 0\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Launch Package\",\n            \"type\": \"go\",\n            \"request\": \"launch\",\n            \"mode\": \"auto\",\n            \"program\": \"${workspaceRoot}\",\n            \"args\": \"up examples/simple\",\n        }\n    ]\n}"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n\t\"cSpell.words\": [\n\t\t\"devpod\",\n\t\t\"perrors\"\n\t],\n\t\"[mdx]\": {\n\t\t\"editor.wordWrap\": \"on\"\n\t},\n\t\"rust-analyzer.linkedProjects\": [\"./desktop/src-tauri/Cargo.toml\"],\n}"
  },
  {
    "path": "COMMUNITY.md",
    "content": "# Community Calls \n\nThis repository contains the maintainer community calls from the DevPod Community. Join us on [Slack](https://slack.loft.sh/) if you have feedback, want to ask questions, or see something covered in the maintainers meeting. The complete Playlist is on [YouTube](https://youtube.com/playlist?list=PL8MSvTvMDqe5hZFjZX9lw1Ecq2xwWivp7&feature=shared).\n\n- [DevPod Maintainers Meeting : 03/07/2024](https://www.youtube.com/live/pYtQtQh6Zp4?si=DPqTYE1JfewMCBdm)\n- [DevPod Maintainers Meeting : 02/29/2024](https://www.youtube.com/live/btYC7VpJZws?si=nDBcMk2GDnI5Xtyo)\n- [DevPod Maintainers Meeting : 02/22/2024](https://youtu.be/2NmGUsj7LFw?feature=shared)\n- [DevPod Maintainers Meeting : 02/19/2024](https://youtu.be/-1EqOf8A-7c?feature=shared)\n\nFeel free to explore past discussions and catch up on what you might have missed. \n\n## Reporting An Incident\n\nPlease email hrittik@loft.sh to initiate an incident report. **Please do not make reports via our public slack channel.**\n\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Development\n\n## Development Setup\n\n1. Clone the repository locally\n2. If you want to change something in DevPod agent code:\n   1. Exchange the URL in [DefaultAgentDownloadURL](./pkg/agent/agent.go) with a\n      custom public repository release you have created.\n   2. Build devpod via: `./hack/rebuild.sh`\n   3. Upload `test/devpod-linux-amd64` and `test/devpod-linux-arm64` to the public\n      repository release assets.\n3. Build devpod via: `./hack/rebuild.sh` (asking for sudo password)\n4. Add docker provider via `devpod provider add docker`\n5. Configure docker provider via `devpod use provider docker`\n6. Start devpod in vscode with `devpod up examples/simple`\n\n## Build from source\n\nPrerequisites CLI:\n\n- [Go 1.20](https://go.dev/doc/install)\n\nOnce installed, run\n`CGO_ENABLED=0 go build -ldflags \"-s -w\" -o devpod-cli`\n\nPrerequisites GUI:\n\n- [NodeJS + yarn](https://nodejs.org/en/)\n- [Rust](https://www.rust-lang.org/tools/install)\n- [Go](https://go.dev/doc/install)\n\nTo build the app on Linux, you will need the following dependencies:\n\n```bash\nsudo apt-get install libappindicator3-1 libgdk-pixbuf2.0-0 libbsd0 libxdmcp6 \\\n  libwmf-0.2-7 libwmf-0.2-7-gtk libgtk-3-0 libwmf-dev libwebkit2gtk-4.0-37 \\\n  librust-openssl-sys-dev librust-glib-sys-dev\nsudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev \\\n  libayatana-appindicator3-dev librsvg2-dev\n```\n\nOnce installed, run\n\n- `cd desktop`\n- `yarn tauri build --config src-tauri/tauri-dev.conf.json`\n\nThe application should be in `desktop/src-tauri/target/release`\n\n## Provider\n\nHead over to [the docs](https://devpod.sh/docs/developing-providers/quickstart)\nfor an introduction into developing your own providers\n\n### Publish your provider\n\nOnce you're provider is ready, update\n\n- `community.yaml`\n- `docs/pages/managing-providers/add-provider.mdx`\n\nto get your provider featured both in the documentation and the UI\n\n## Deeplinks\n\nDevPod Desktop can handle deep links to perform various actions, like opening or\nimporting workspaces.\nThe scheme is:\n\nprotocol: `devpod://`\nhost: `command`\nsearchParams: `foo=bar&fizz=buzz`\n\nresulting in a full url string of `devpod://command?foo=bar&fizz=buzz`. For more\ninformation, take a look at the indvidual command sections below.\n\n### Open Workspace\n\nOpen a workspace based on a workspace source. Similar to `devpod up`, but shareable\n\nhost: `open`\nsearchParams: `source` (required), `workspace`, `provider`, `ide`\n\n`devpod://open?source=your-url-encoded-source&workspace=my-workspace&provider=docker&ide=vscode`\n\n### Import Workspace\n\nImport a remote DevPod.Pro workspace into your local client\n\nhost: `import`\nsearchParams: `workspace_id` (required), `workspace_uid` (required),\n`devpod_pro_host` (required), `options`\n"
  },
  {
    "path": "LICENSE",
    "content": "Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n    means each individual or legal entity that creates, contributes to\n    the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n    means the combination of the Contributions of others (if any) used\n    by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n    means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n    means Source Code Form to which the initial Contributor has attached\n    the notice in Exhibit A, the Executable Form of such Source Code\n    Form, and Modifications of such Source Code Form, in each case\n    including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n    means\n\n    (a) that the initial Contributor has attached the notice described\n        in Exhibit B to the Covered Software; or\n\n    (b) that the Covered Software was made available under the terms of\n        version 1.1 or earlier of the License, but not also under the\n        terms of a Secondary License.\n\n1.6. \"Executable Form\"\n    means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n    means a work that combines Covered Software with other material, in\n    a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n    means this document.\n\n1.9. \"Licensable\"\n    means having the right to grant, to the maximum extent possible,\n    whether at the time of the initial grant or subsequently, any and\n    all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n    means any of the following:\n\n    (a) any file in Source Code Form that results from an addition to,\n        deletion from, or modification of the contents of Covered\n        Software; or\n\n    (b) any new file in Source Code Form that contains any Covered\n        Software.\n\n1.11. \"Patent Claims\" of a Contributor\n    means any patent claim(s), including without limitation, method,\n    process, and apparatus claims, in any patent Licensable by such\n    Contributor that would be infringed, but for the grant of the\n    License, by the making, using, selling, offering for sale, having\n    made, import, or transfer of either its Contributions or its\n    Contributor Version.\n\n1.12. \"Secondary License\"\n    means either the GNU General Public License, Version 2.0, the GNU\n    Lesser General Public License, Version 2.1, the GNU Affero General\n    Public License, Version 3.0, or any later versions of those\n    licenses.\n\n1.13. \"Source Code Form\"\n    means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n    means an individual or a legal entity exercising rights under this\n    License. For legal entities, \"You\" includes any entity that\n    controls, is controlled by, or is under common control with You. For\n    purposes of this definition, \"control\" means (a) the power, direct\n    or indirect, to cause the direction or management of such entity,\n    whether by contract or otherwise, or (b) ownership of more than\n    fifty percent (50%) of the outstanding shares or beneficial\n    ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n    Licensable by such Contributor to use, reproduce, make available,\n    modify, display, perform, distribute, and otherwise exploit its\n    Contributions, either on an unmodified basis, with Modifications, or\n    as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n    for sale, have made, import, and otherwise transfer either its\n    Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n    or\n\n(b) for infringements caused by: (i) Your and any other third party's\n    modifications of Covered Software, or (ii) the combination of its\n    Contributions with other software (except as part of its Contributor\n    Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n    its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n    Form, as described in Section 3.1, and You must inform recipients of\n    the Executable Form how they can obtain a copy of such Source Code\n    Form by reasonable means in a timely manner, at a charge no more\n    than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n    License, or sublicense it under different terms, provided that the\n    license for the Executable Form does not attempt to limit or alter\n    the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n*                                                                      *\n*  6. Disclaimer of Warranty                                           *\n*  -------------------------                                           *\n*                                                                      *\n*  Covered Software is provided under this License on an \"as is\"       *\n*  basis, without warranty of any kind, either expressed, implied, or  *\n*  statutory, including, without limitation, warranties that the       *\n*  Covered Software is free of defects, merchantable, fit for a        *\n*  particular purpose or non-infringing. The entire risk as to the     *\n*  quality and performance of the Covered Software is with You.        *\n*  Should any Covered Software prove defective in any respect, You     *\n*  (not any Contributor) assume the cost of any necessary servicing,   *\n*  repair, or correction. This disclaimer of warranty constitutes an   *\n*  essential part of this License. No use of any Covered Software is   *\n*  authorized under this License except under this disclaimer.         *\n*                                                                      *\n************************************************************************\n\n************************************************************************\n*                                                                      *\n*  7. Limitation of Liability                                          *\n*  --------------------------                                          *\n*                                                                      *\n*  Under no circumstances and under no legal theory, whether tort      *\n*  (including negligence), contract, or otherwise, shall any           *\n*  Contributor, or anyone who distributes Covered Software as          *\n*  permitted above, be liable to You for any direct, indirect,         *\n*  special, incidental, or consequential damages of any character      *\n*  including, without limitation, damages for lost profits, loss of    *\n*  goodwill, work stoppage, computer failure or malfunction, or any    *\n*  and all other commercial damages or losses, even if such party      *\n*  shall have been informed of the possibility of such damages. This   *\n*  limitation of liability shall not apply to liability for death or   *\n*  personal injury resulting from such party's negligence to the       *\n*  extent applicable law prohibits such limitation. Some               *\n*  jurisdictions do not allow the exclusion or limitation of           *\n*  incidental or consequential damages, so this exclusion and          *\n*  limitation may not apply to You.                                    *\n*                                                                      *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n  This Source Code Form is subject to the terms of the Mozilla Public\n  License, v. 2.0. If a copy of the MPL was not distributed with this\n  file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n  This Source Code Form is \"Incompatible With Secondary Licenses\", as\n  defined by the Mozilla Public License, v. 2.0.\n"
  },
  {
    "path": "Makefile",
    "content": "GOOS := $(shell go env GOOS)\nGOARCH := $(shell go env GOARCH)\nSKIP_INSTALL := false\n\n# Platform host\nPLATFORM_HOST := localhost:8080\n\n# Build the CLI and Desktop\n.PHONY: build\nbuild:\n\tSKIP_INSTALL=$(SKIP_INSTALL) BUILD_PLATFORMS=$(GOOS) BUILD_ARCHS=$(GOARCH) ./hack/rebuild.sh\n\n# Run the desktop app\n.PHONY: run-desktop\nrun-desktop: build\n\tcd desktop && yarn desktop:dev:debug\n\n# Run the daemon against loft host\n.PHONY: run-daemon\nrun-daemon: build\n\tdevpod pro daemon start --host $(PLATFORM_HOST)\n\n# Namespace to use for the platform\nNAMESPACE := loft\n\n# Copy the devpod binary to the platform pod\n.PHONY: cp-to-platform\ncp-to-platform:\n\tSKIP_INSTALL=true BUILD_PLATFORMS=linux BUILD_ARCHS=$(GOARCH) ./hack/rebuild.sh\n\tPOD=$$(kubectl get pod -n $(NAMESPACE) -l app=loft,release=loft -o jsonpath='{.items[0].metadata.name}'); \\\n\techo \"Copying ./test/devpod-linux-$(GOARCH) to pod $$POD\"; \\\n\tkubectl cp -n $(NAMESPACE) ./test/devpod-linux-$(GOARCH) $$POD:/usr/local/bin/devpod \n"
  },
  {
    "path": "README.md",
    "content": "<br>\n<a href=\"https://www.devpod.sh\">\n  <picture width=\"500\">\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/static/media/devpod_dark.png\">\n    <img alt=\"DevPod wordmark\" width=\"500\" src=\"docs/static/media/devpod.png\">\n  </picture>\n</a>\n\n### **[Website](https://www.devpod.sh)** • **[Quickstart](https://www.devpod.sh/docs/getting-started/install)** • **[Documentation](https://www.devpod.sh/docs/what-is-devpod)** • **[Blog](https://loft.sh/blog)** • **[𝕏 (Twitter)](https://x.com/loft_sh)** • **[Slack](https://slack.loft.sh/)**\n\n[![Join us on Slack!](docs/static/media/slack.svg)](https://slack.loft.sh/) [![Open in DevPod!](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com/loft-sh/devpod)\n\n**[We are hiring!](https://www.loft.sh/careers) Come build the future of remote development environments with us.**\n\nDevPod is a client-only tool to create reproducible developer environments based on a [devcontainer.json](https://containers.dev/) on any backend. Each developer environment runs in a container and is specified through a [devcontainer.json](https://containers.dev/). Through DevPod providers, these environments can be created on any backend, such as the local computer, a Kubernetes cluster, any reachable remote machine, or in a VM in the cloud.\n\n![Codespaces](docs/static/media/codespaces-but.png)\n\nYou can think of DevPod as the glue that connects your local IDE to a machine where you want to develop. So depending on the requirements of your project, you can either create a workspace locally on the computer, on a beefy cloud machine with many GPUs, or a spare remote computer. Within DevPod, every workspace is managed the same way, which also makes it easy to switch between workspaces that might be hosted somewhere else.\n\n![DevPod Flow](docs/static/media/devpod-flow.gif)\n\n## Quickstart\n\nDownload DevPod Desktop:\n- [MacOS Silicon/ARM](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_macos_aarch64.dmg)\n- [MacOS Intel/AMD](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_macos_x64.dmg)\n- [Windows](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_windows_x64_en-US.msi)\n- [Linux AppImage](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_linux_amd64.AppImage)\n\nTake a look at the [DevPod Docs](https://devpod.sh/docs/getting-started/install) for more information.\n\n## Why DevPod?\n\nDevPod reuses the open [DevContainer standard](https://containers.dev/) (used by GitHub Codespaces and VSCode DevContainers) to create a consistent developer experience no matter what backend you want to use.\n\nCompared to hosted services such as Github Codespaces, JetBrains Spaces, or Google Cloud Workstations, DevPod has the following advantages:\n* **Cost savings**: DevPod is usually around 5-10 times cheaper than existing services with comparable feature sets because it uses bare virtual machines in any cloud and shuts down unused virtual machines automatically.\n* **No vendor lock-in**: Choose whatever cloud provider suits you best, be it the cheapest one or the most powerful, DevPod supports all cloud providers. If you are tired of using a provider, change it with a single command.\n* **Local development**: You get the same developer experience also locally, so you don't need to rely on a cloud provider at all.\n* **Cross IDE support**: VSCode and the full JetBrains suite is supported, all others can be connected through simple ssh.\n* **Client-only**: No need to install a server backend, DevPod runs only on your computer.\n* **Open-Source**: DevPod is 100% open-source and extensible. A provider doesn't exist? Just create your own.\n* **Rich feature set**: DevPod already supports prebuilds, auto inactivity shutdown, git & docker credentials sync, and many more features to come.\n* **Desktop App**: DevPod comes with an easy-to-use desktop application that abstracts all the complexity away. If you want to build your own integration, DevPod offers a feature-rich CLI as well.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\nWe will disclose fixes for vulnerabilities in the release notes and urge you to upgrade once a new release is published. \nFor upgrading guidelines, see [our official Upgrading Guideline](https://devpod.sh/docs/getting-started/update).\n\n**To receive update warnings in the CLI (as part of the terminal output whenever you run a command), you must use an official release binary as published on the [GitHub releases page](https://github.com/loft-sh/devpod/releases) of this project.**\n\nSee the [install instructions for DevPod](https://devpod.sh/docs/getting-started/install) for the recommended methods of downloading an official release binary for your platform. Community maintained release binaries may **not** contain the version number and will therefore not be able to perform a version check.\n\n\n## Reporting a Vulnerability\nPlease report vulnerabilities to: [security@loft.sh](mailto:security@loft.sh) \n"
  },
  {
    "path": "cmd/agent/agent.go",
    "content": "package agent\n\nimport (\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent/container\"\n\t\"github.com/loft-sh/devpod/cmd/agent/workspace\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/envfile\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar AgentExecutedAnnotation = \"loft.sh/agent-executed\"\n\n// NewAgentCmd returns a new root command\nfunc NewAgentCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tagentCmd := &cobra.Command{\n\t\tUse:   \"agent\",\n\t\tShort: \"DevPod Agent\",\n\t\tPersistentPreRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn AgentPersistentPreRunE(cobraCmd, args, globalFlags)\n\t\t},\n\t\tHidden: true,\n\t}\n\n\tagentCmd.AddCommand(workspace.NewWorkspaceCmd(globalFlags))\n\tagentCmd.AddCommand(container.NewContainerCmd(globalFlags))\n\tagentCmd.AddCommand(NewDaemonCmd(globalFlags))\n\tagentCmd.AddCommand(NewContainerTunnelCmd(globalFlags))\n\tagentCmd.AddCommand(NewGitCredentialsCmd(globalFlags))\n\tagentCmd.AddCommand(NewGitSSHSignatureCmd(globalFlags))\n\tagentCmd.AddCommand(NewGitSSHSignatureHelperCmd(globalFlags))\n\tagentCmd.AddCommand(NewDockerCredentialsCmd(globalFlags))\n\treturn agentCmd\n}\n\nfunc AgentPersistentPreRunE(cobraCmd *cobra.Command, args []string, globalFlags *flags.GlobalFlags) error {\n\t// get top level parent\n\tparent := cobraCmd\n\tfor parent.Parent() != nil {\n\t\tparent = parent.Parent()\n\t}\n\tif parent.Annotations == nil {\n\t\tparent.Annotations = map[string]string{}\n\t}\n\tparent.Annotations[AgentExecutedAnnotation] = \"true\"\n\n\tif globalFlags.LogOutput == \"json\" {\n\t\tlog.Default.SetFormat(log.JSONFormat)\n\t} else {\n\t\tlog.Default.MakeRaw()\n\t}\n\n\tif globalFlags.Silent {\n\t\tlog.Default.SetLevel(logrus.FatalLevel)\n\t} else if globalFlags.Debug {\n\t\tlog.Default.SetLevel(logrus.DebugLevel)\n\t} else if os.Getenv(clientimplementation.DevPodDebug) == \"true\" {\n\t\tlog.Default.SetLevel(logrus.DebugLevel)\n\t}\n\n\tif globalFlags.DevPodHome != \"\" {\n\t\t_ = os.Setenv(config.DEVPOD_HOME, globalFlags.DevPodHome)\n\t}\n\n\t// apply environment\n\tenvfile.Apply(log.Default.ErrorStreamOnly())\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/container/container.go",
    "content": "package container\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewContainerCmd returns a new command\nfunc NewContainerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcontainerCmd := &cobra.Command{\n\t\tUse:   \"container\",\n\t\tShort: \"Container commands\",\n\t}\n\n\tcontainerCmd.AddCommand(NewSetupContainerCmd(flags))\n\tcontainerCmd.AddCommand(NewDaemonCmd())\n\tcontainerCmd.AddCommand(NewVSCodeAsyncCmd())\n\tcontainerCmd.AddCommand(NewOpenVSCodeAsyncCmd())\n\tcontainerCmd.AddCommand(NewCredentialsServerCmd(flags))\n\tcontainerCmd.AddCommand(NewSetupLoftPlatformAccessCmd(flags))\n\tcontainerCmd.AddCommand(NewSSHServerCmd(flags))\n\treturn containerCmd\n}\n"
  },
  {
    "path": "cmd/agent/container/credentials_server.go",
    "content": "package container\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\t\"github.com/loft-sh/devpod/pkg/gitsshsigning\"\n\t\"github.com/loft-sh/devpod/pkg/netstat\"\n\tportpkg \"github.com/loft-sh/devpod/pkg/port\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst ExitCodeIO int = 64\n\n// CredentialsServerCmd holds the cmd flags\ntype CredentialsServerCmd struct {\n\t*flags.GlobalFlags\n\n\tUser string\n\n\tConfigureGitHelper    bool\n\tConfigureDockerHelper bool\n\n\tForwardPorts      bool\n\tGitUserSigningKey string\n}\n\n// NewCredentialsServerCmd creates a new command\nfunc NewCredentialsServerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CredentialsServerCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tcredentialsServerCmd := &cobra.Command{\n\t\tUse:   \"credentials-server\",\n\t\tShort: \"Starts a credentials server\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tport, err := credentials.GetPort()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(c.Context(), port)\n\t\t},\n\t}\n\tcredentialsServerCmd.Flags().BoolVar(&cmd.ConfigureGitHelper, \"configure-git-helper\", false, \"If true will configure git helper\")\n\tcredentialsServerCmd.Flags().BoolVar(&cmd.ConfigureDockerHelper, \"configure-docker-helper\", false, \"If true will configure docker helper\")\n\tcredentialsServerCmd.Flags().BoolVar(&cmd.ForwardPorts, \"forward-ports\", false, \"If true will automatically try to forward open ports within the container\")\n\tcredentialsServerCmd.Flags().StringVar(&cmd.GitUserSigningKey, \"git-user-signing-key\", \"\", \"\")\n\tcredentialsServerCmd.Flags().StringVar(&cmd.User, \"user\", \"\", \"The user to use\")\n\t_ = credentialsServerCmd.MarkFlagRequired(\"user\")\n\n\treturn credentialsServerCmd\n}\n\n// Run runs the command logic\nfunc (cmd *CredentialsServerCmd) Run(ctx context.Context, port int) error {\n\t// create a grpc client\n\ttunnelClient, err := tunnelserver.NewTunnelClient(os.Stdin, os.Stdout, true, ExitCodeIO)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating tunnel client: %w\", err)\n\t}\n\n\t// this message serves as a ping to the client\n\t_, err = tunnelClient.Ping(ctx, &tunnel.Empty{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"ping client: %w\", err)\n\t}\n\n\t// create debug logger\n\tlog := tunnelserver.NewTunnelLogger(ctx, tunnelClient, cmd.Debug)\n\n\t// forward ports\n\tif cmd.ForwardPorts {\n\t\tgo func() {\n\t\t\tlog.Debugf(\"Start watching & forwarding open ports\")\n\t\t\terr = forwardPorts(ctx, tunnelClient, log)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"error forwarding ports: %v\", err)\n\t\t\t}\n\t\t}()\n\t}\n\n\taddr := net.JoinHostPort(\"localhost\", strconv.Itoa(port))\n\tif ok, err := portpkg.IsAvailable(addr); !ok || err != nil {\n\t\tlog.Debugf(\"Port %d not available, exiting\", port)\n\t\treturn nil\n\t}\n\n\t// configure docker credential helper\n\tif cmd.ConfigureDockerHelper {\n\t\terr = dockercredentials.ConfigureCredentialsContainer(cmd.User, port, log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// configure git user\n\terr = configureGitUserLocally(ctx, cmd.User, tunnelClient)\n\tif err != nil {\n\t\tlog.Debugf(\"Error configuring git user: %v\", err)\n\t\treturn err\n\t}\n\n\t// configure git credential helper\n\tif cmd.ConfigureGitHelper {\n\t\tbinaryPath, err := os.Executable()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = gitcredentials.ConfigureHelper(binaryPath, cmd.User, port)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"configure git helper: %w\", err)\n\t\t}\n\n\t\t// cleanup when we are done\n\t\tdefer func(userName string) {\n\t\t\t_ = gitcredentials.RemoveHelper(userName)\n\t\t}(cmd.User)\n\t}\n\n\t// configure git ssh signature helper\n\tif cmd.GitUserSigningKey != \"\" {\n\t\tdecodedKey, err := base64.StdEncoding.DecodeString(cmd.GitUserSigningKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"decode git ssh signature key: %w\", err)\n\t\t}\n\t\terr = gitsshsigning.ConfigureHelper(cmd.User, string(decodedKey), log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"configure git ssh signature helper: %w\", err)\n\t\t}\n\n\t\t// cleanup when we are done\n\t\tdefer func(userName string) {\n\t\t\t_ = gitsshsigning.RemoveHelper(userName)\n\t\t}(cmd.User)\n\t}\n\n\treturn credentials.RunCredentialsServer(ctx, port, tunnelClient, log)\n}\n\nfunc configureGitUserLocally(ctx context.Context, userName string, client tunnel.TunnelClient) error {\n\t// get local credentials\n\tlocalGitUser, err := gitcredentials.GetUser(userName)\n\tif err != nil {\n\t\treturn err\n\t} else if localGitUser.Name != \"\" && localGitUser.Email != \"\" {\n\t\treturn nil\n\t}\n\n\t// set user & email if not found\n\tresponse, err := client.GitUser(ctx, &tunnel.Empty{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"retrieve git user: %w\", err)\n\t}\n\n\t// parse git user from response\n\tgitUser := &gitcredentials.GitUser{}\n\terr = json.Unmarshal([]byte(response.Message), gitUser)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode git user: %w\", err)\n\t}\n\n\t// don't override what is already there\n\tif localGitUser.Name != \"\" {\n\t\tgitUser.Name = \"\"\n\t}\n\tif localGitUser.Email != \"\" {\n\t\tgitUser.Email = \"\"\n\t}\n\n\t// set git user\n\terr = gitcredentials.SetUser(userName, gitUser)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"set git user & email: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc forwardPorts(ctx context.Context, client tunnel.TunnelClient, log log.Logger) error {\n\treturn netstat.NewWatcher(&forwarder{ctx: ctx, client: client}, log).Run(ctx)\n}\n\ntype forwarder struct {\n\tctx context.Context\n\n\tclient tunnel.TunnelClient\n}\n\nfunc (f *forwarder) Forward(port string) error {\n\t_, err := f.client.ForwardPort(f.ctx, &tunnel.ForwardPortRequest{Port: port})\n\treturn err\n}\n\nfunc (f *forwarder) StopForward(port string) error {\n\t_, err := f.client.StopForwardPort(f.ctx, &tunnel.StopForwardPortRequest{Port: port})\n\treturn err\n}\n"
  },
  {
    "path": "cmd/agent/container/daemon.go",
    "content": "package container\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tagentd \"github.com/loft-sh/devpod/pkg/daemon/agent\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst (\n\tRootDir          = \"/var/devpod\"\n\tDaemonConfigPath = \"/var/run/secrets/devpod/daemon_config\"\n)\n\ntype DaemonCmd struct {\n\tConfig *agentd.DaemonConfig\n\tLog    log.Logger\n}\n\n// NewDaemonCmd creates the merged daemon command.\nfunc NewDaemonCmd() *cobra.Command {\n\tcmd := &DaemonCmd{\n\t\tConfig: &agentd.DaemonConfig{},\n\t\tLog:    log.NewStreamLogger(os.Stdout, os.Stderr, logrus.InfoLevel),\n\t}\n\tdaemonCmd := &cobra.Command{\n\t\tUse:   \"daemon\",\n\t\tShort: \"Starts the DevPod network daemon, SSH server and monitors container activity if timeout is set\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\tdaemonCmd.Flags().StringVar(&cmd.Config.Timeout, \"timeout\", \"\", \"The timeout to stop the container after\")\n\treturn daemonCmd\n}\n\nfunc (cmd *DaemonCmd) Run(c *cobra.Command, args []string) error {\n\tctx := c.Context()\n\terrChan := make(chan error, 4)\n\tvar wg sync.WaitGroup\n\n\tif err := cmd.loadConfig(); err != nil {\n\t\treturn err\n\t}\n\n\t// Prepare timeout if specified.\n\tvar timeoutDuration time.Duration\n\tif cmd.Config.Timeout != \"\" {\n\t\tvar err error\n\t\ttimeoutDuration, err = time.ParseDuration(cmd.Config.Timeout)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to parse timeout duration\")\n\t\t}\n\t\tif timeoutDuration > 0 {\n\t\t\tif err := setupActivityFile(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tvar tasksStarted bool\n\n\t// Start process reaper.\n\tif os.Getpid() == 1 {\n\t\twg.Add(1)\n\t\tgo runReaper(ctx, errChan, &wg)\n\t}\n\n\t// Start Tailscale networking server.\n\tif cmd.shouldRunNetworkServer() {\n\t\ttasksStarted = true\n\t\twg.Add(1)\n\t\tgo runNetworkServer(ctx, cmd, errChan, &wg)\n\t}\n\n\t// Start timeout monitor.\n\tif timeoutDuration > 0 {\n\t\ttasksStarted = true\n\t\twg.Add(1)\n\t\tgo runTimeoutMonitor(ctx, timeoutDuration, errChan, &wg)\n\t}\n\n\t// Start ssh server.\n\tif cmd.shouldRunSsh() {\n\t\ttasksStarted = true\n\t\twg.Add(1)\n\t\tgo runSshServer(ctx, cmd, errChan, &wg)\n\t}\n\n\t// In case no task is configured, just wait indefinitely.\n\tif !tasksStarted {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\t<-ctx.Done()\n\t\t}()\n\t}\n\n\t// Listen for OS termination signals.\n\tgo handleSignals(ctx, errChan)\n\n\t// Wait until an error (or termination signal) occurs.\n\terr := <-errChan\n\tcancel()\n\twg.Wait()\n\n\tif err != nil {\n\t\tcmd.Log.Errorf(\"Daemon error: %v\", err)\n\t\tos.Exit(1)\n\t}\n\tos.Exit(0)\n\treturn nil // Unreachable but needed.\n}\n\n// loadConfig loads the daemon configuration from base64-encoded JSON.\n// If a CLI-provided timeout exists, it will override the timeout in the config.\nfunc (cmd *DaemonCmd) loadConfig() error {\n\t// check local file\n\tencodedCfg := \"\"\n\tconfigBytes, err := os.ReadFile(DaemonConfigPath)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t// check environment variable\n\t\t\tencodedCfg = os.Getenv(config.WorkspaceDaemonConfigExtraEnvVar)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"get daemon config file %s: %w\", DaemonConfigPath, err)\n\t\t}\n\t} else {\n\t\tencodedCfg = string(configBytes)\n\t}\n\n\tif strings.TrimSpace(encodedCfg) != \"\" {\n\t\tdecoded, err := base64.StdEncoding.DecodeString(encodedCfg)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error decoding daemon config: %w\", err)\n\t\t}\n\t\tvar cfg agentd.DaemonConfig\n\t\tif err = json.Unmarshal(decoded, &cfg); err != nil {\n\t\t\treturn fmt.Errorf(\"error unmarshalling daemon config: %w\", err)\n\t\t}\n\t\tif cmd.Config.Timeout != \"\" {\n\t\t\tcfg.Timeout = cmd.Config.Timeout\n\t\t}\n\t\tcmd.Config = &cfg\n\t}\n\n\treturn nil\n}\n\n// shouldRunNetworkServer returns true if the required platform parameters are present.\nfunc (cmd *DaemonCmd) shouldRunNetworkServer() bool {\n\treturn cmd.Config.Platform.AccessKey != \"\" &&\n\t\tcmd.Config.Platform.PlatformHost != \"\" &&\n\t\tcmd.Config.Platform.WorkspaceHost != \"\"\n}\n\n// shouldRunSsh returns true if at least one SSH configuration value is provided.\nfunc (cmd *DaemonCmd) shouldRunSsh() bool {\n\treturn cmd.Config.Ssh.Workdir != \"\" || cmd.Config.Ssh.User != \"\"\n}\n\n// setupActivityFile creates and sets permissions on the container activity file.\nfunc setupActivityFile() error {\n\tif err := os.WriteFile(agent.ContainerActivityFile, nil, 0777); err != nil {\n\t\treturn err\n\t}\n\treturn os.Chmod(agent.ContainerActivityFile, 0777)\n}\n\n// runReaper starts the process reaper and waits for context cancellation.\nfunc runReaper(ctx context.Context, errChan chan<- error, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tagentd.RunProcessReaper()\n\t<-ctx.Done()\n}\n\n// runTimeoutMonitor monitors the activity file and signals an error if the timeout is exceeded.\nfunc runTimeoutMonitor(ctx context.Context, duration time.Duration, errChan chan<- error, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tticker := time.NewTicker(10 * time.Second)\n\tdefer ticker.Stop()\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\tstat, err := os.Stat(agent.ContainerActivityFile)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !stat.ModTime().Add(duration).After(time.Now()) {\n\t\t\t\terrChan <- errors.New(\"timeout reached, terminating daemon\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// runNetworkServer starts the network server.\nfunc runNetworkServer(ctx context.Context, cmd *DaemonCmd, errChan chan<- error, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tif err := os.MkdirAll(RootDir, os.ModePerm); err != nil {\n\t\terrChan <- err\n\t\treturn\n\t}\n\tlogger := initLogging()\n\tconfig := client.NewConfig()\n\tconfig.AccessKey = cmd.Config.Platform.AccessKey\n\tconfig.Host = \"https://\" + cmd.Config.Platform.PlatformHost\n\tconfig.Insecure = true\n\tbaseClient := client.NewClientFromConfig(config)\n\tif err := baseClient.RefreshSelf(ctx); err != nil {\n\t\terrChan <- fmt.Errorf(\"failed to refresh client: %w\", err)\n\t\treturn\n\t}\n\ttsServer := ts.NewWorkspaceServer(&ts.WorkspaceServerConfig{\n\t\tAccessKey:     cmd.Config.Platform.AccessKey,\n\t\tPlatformHost:  ts.RemoveProtocol(cmd.Config.Platform.PlatformHost),\n\t\tWorkspaceHost: cmd.Config.Platform.WorkspaceHost,\n\t\tClient:        baseClient,\n\t\tRootDir:       RootDir,\n\t\tLogF: func(format string, args ...interface{}) {\n\t\t\tlogger.Infof(format, args...)\n\t\t},\n\t}, logger)\n\tif err := tsServer.Start(ctx); err != nil {\n\t\terrChan <- fmt.Errorf(\"network server: %w\", err)\n\t}\n}\n\n// runSshServer starts the SSH server.\nfunc runSshServer(ctx context.Context, cmd *DaemonCmd, errChan chan<- error, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\terrChan <- err\n\t\treturn\n\t}\n\n\targs := []string{\"agent\", \"container\", \"ssh-server\"}\n\tif cmd.Config.Ssh.Workdir != \"\" {\n\t\targs = append(args, \"--workdir\", cmd.Config.Ssh.Workdir)\n\t}\n\tif cmd.Config.Ssh.User != \"\" {\n\t\targs = append(args, \"--remote-user\", cmd.Config.Ssh.User)\n\t}\n\n\tsshCmd := exec.Command(binaryPath, args...)\n\tsshCmd.Stdout = os.Stdout\n\tsshCmd.Stderr = os.Stderr\n\n\tif err := sshCmd.Start(); err != nil {\n\t\terrChan <- fmt.Errorf(\"failed to start SSH server: %w\", err)\n\t\treturn\n\t}\n\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tif sshCmd.Process != nil {\n\t\t\t\tif err := sshCmd.Process.Signal(syscall.SIGTERM); err != nil {\n\t\t\t\t\terrChan <- fmt.Errorf(\"failed to send SIGTERM to SSH server: %w\", err)\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-done:\n\t\t}\n\t}()\n\n\tif err := sshCmd.Wait(); err != nil {\n\t\terrChan <- fmt.Errorf(\"SSH server exited abnormally: %w\", err)\n\t\tclose(done)\n\t\treturn\n\t}\n\tclose(done)\n}\n\n// handleSignals listens for OS termination signals and sends an error through errChan.\nfunc handleSignals(ctx context.Context, errChan chan<- error) {\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)\n\tselect {\n\tcase sig := <-sigChan:\n\t\terrChan <- fmt.Errorf(\"received signal: %v\", sig)\n\tcase <-ctx.Done():\n\t}\n}\n\n// initLogging initializes logging and returns a combined logger.\nfunc initLogging() log.Logger {\n\treturn log.NewStdoutLogger(nil, os.Stdout, os.Stderr, logrus.InfoLevel)\n}\n"
  },
  {
    "path": "cmd/agent/container/openvscode_async.go",
    "content": "package container\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide/openvscode\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// OpenVSCodeAsyncCmd holds the cmd flags\ntype OpenVSCodeAsyncCmd struct {\n\t*flags.GlobalFlags\n\n\tSetupInfo string\n}\n\n// NewOpenVSCodeAsyncCmd creates a new command\nfunc NewOpenVSCodeAsyncCmd() *cobra.Command {\n\tcmd := &OpenVSCodeAsyncCmd{}\n\tvsCodeAsyncCmd := &cobra.Command{\n\t\tUse:   \"openvscode-async\",\n\t\tShort: \"Starts openvscode\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\tvsCodeAsyncCmd.Flags().StringVar(&cmd.SetupInfo, \"setup-info\", \"\", \"The container setup info\")\n\t_ = vsCodeAsyncCmd.MarkFlagRequired(\"setup-info\")\n\treturn vsCodeAsyncCmd\n}\n\n// Run runs the command logic\nfunc (cmd *OpenVSCodeAsyncCmd) Run(_ *cobra.Command, _ []string) error {\n\tlog.Default.Debugf(\"Start setting up container...\")\n\tdecompressed, err := compress.Decompress(cmd.SetupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsetupInfo := &config.Result{}\n\terr = json.Unmarshal([]byte(decompressed), setupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// install IDE\n\terr = setupOpenVSCodeExtensions(setupInfo, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc setupOpenVSCodeExtensions(setupInfo *config.Result, log log.Logger) error {\n\tvsCodeConfiguration := config.GetVSCodeConfiguration(setupInfo.MergedConfig)\n\tuser := config.GetRemoteUser(setupInfo)\n\treturn openvscode.NewOpenVSCodeServer(vsCodeConfiguration.Extensions, \"\", user, \"\", \"\", nil, log).InstallExtensions()\n}\n"
  },
  {
    "path": "cmd/agent/container/setup.go",
    "content": "//go:build !windows\n\npackage container\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/setup\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/devpod/pkg/envfile\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/devpod/pkg/ide/fleet\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jetbrains\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jupyter\"\n\t\"github.com/loft-sh/devpod/pkg/ide/openvscode\"\n\t\"github.com/loft-sh/devpod/pkg/ide/rstudio\"\n\t\"github.com/loft-sh/devpod/pkg/ide/vscode\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar DockerlessImageConfigOutput = \"/.dockerless/image.json\"\n\n// SetupContainerCmd holds the cmd flags\ntype SetupContainerCmd struct {\n\t*flags.GlobalFlags\n\n\tChownWorkspace         bool\n\tStreamMounts           bool\n\tInjectGitCredentials   bool\n\tContainerWorkspaceInfo string\n\tSetupInfo              string\n\tAccessKey              string\n\tPlatformHost           string\n\tWorkspaceHost          string\n}\n\n// NewSetupContainerCmd creates a new command\nfunc NewSetupContainerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetupContainerCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tsetupContainerCmd := &cobra.Command{\n\t\tUse:   \"setup\",\n\t\tShort: \"Sets up a container\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tsetupContainerCmd.Flags().BoolVar(&cmd.StreamMounts, \"stream-mounts\", false, \"If true, will try to stream the bind mounts from the host\")\n\tsetupContainerCmd.Flags().BoolVar(&cmd.ChownWorkspace, \"chown-workspace\", false, \"If DevPod should chown the workspace to the remote user\")\n\tsetupContainerCmd.Flags().BoolVar(&cmd.InjectGitCredentials, \"inject-git-credentials\", false, \"If DevPod should inject git credentials during setup\")\n\tsetupContainerCmd.Flags().StringVar(&cmd.ContainerWorkspaceInfo, \"container-workspace-info\", \"\", \"The container workspace info\")\n\tsetupContainerCmd.Flags().StringVar(&cmd.SetupInfo, \"setup-info\", \"\", \"The container setup info\")\n\tsetupContainerCmd.Flags().StringVar(&cmd.AccessKey, \"access-key\", \"\", \"Access Key to use\")\n\tsetupContainerCmd.Flags().StringVar(&cmd.WorkspaceHost, \"workspace-host\", \"\", \"Workspace hostname to use\")\n\tsetupContainerCmd.Flags().StringVar(&cmd.PlatformHost, \"platform-host\", \"\", \"Platform host\")\n\t_ = setupContainerCmd.MarkFlagRequired(\"setup-info\")\n\treturn setupContainerCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SetupContainerCmd) Run(ctx context.Context) error {\n\t// create a grpc client\n\ttunnelClient, err := tunnelserver.NewTunnelClient(os.Stdin, os.Stdout, true, 0)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating tunnel client: %w\", err)\n\t}\n\n\t// create debug logger\n\tlogger := tunnelserver.NewTunnelLogger(ctx, tunnelClient, cmd.Debug)\n\tlogger.Debugf(\"Created logger\")\n\n\t// this message serves as a ping to the client\n\t_, err = tunnelClient.Ping(ctx, &tunnel.Empty{})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"ping client\")\n\t}\n\n\t// start setting up container\n\tlogger.Debugf(\"Start setting up container...\")\n\tworkspaceInfo, _, err := agent.DecodeContainerWorkspaceInfo(cmd.ContainerWorkspaceInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdecompressed, err := compress.Decompress(cmd.SetupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsetupInfo := &config.Result{}\n\terr = json.Unmarshal([]byte(decompressed), setupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// sync mounts\n\tif cmd.StreamMounts {\n\t\tmounts := config.GetMounts(setupInfo)\n\t\tlogger.Debug(\"Syncing mounts... \", mounts)\n\t\tfor _, m := range mounts {\n\t\t\t// If we are resetting the workspace and it's sources, always re stream the mounts\n\t\t\tif !workspaceInfo.CLIOptions.Reset {\n\t\t\t\tfiles, err := os.ReadDir(m.Target)\n\t\t\t\tif err == nil && len(files) > 0 {\n\t\t\t\t\tlogger.Debug(\"Skip stream mount \", m.Target, \" because it's not empty\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// stream mount\n\t\t\terr = streamMount(ctx, workspaceInfo, m, tunnelClient, logger)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// do dockerless build\n\terr = dockerlessBuild(ctx, setupInfo, &workspaceInfo.Dockerless, tunnelClient, cmd.Debug, logger)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"dockerless build: %w\", err)\n\t}\n\n\t// fill container env\n\terr = fillContainerEnv(setupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.InjectGitCredentials {\n\t\t// configure git credentials\n\t\tcancelCtx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tcleanupFunc, err := configureSystemGitCredentials(cancelCtx, cancel, tunnelClient, logger)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Error configuring git credentials: %v\", err)\n\t\t} else {\n\t\t\tdefer cleanupFunc()\n\t\t}\n\t}\n\n\tif b, err := workspaceInfo.PullFromInsideContainer.Bool(); err == nil && b {\n\t\t// check if workspace folder exists and is a git repository.\n\t\t// skip cloning if it does\n\t\t_, err := os.Stat(filepath.Join(setupInfo.SubstitutionContext.ContainerWorkspaceFolder, \".git\"))\n\t\tif err == nil && !workspaceInfo.CLIOptions.Recreate {\n\t\t\tlogger.Debugf(\"Workspace repository already checked out %s, skipping clone\", setupInfo.SubstitutionContext.ContainerWorkspaceFolder)\n\t\t} else {\n\t\t\tif err := agent.CloneRepositoryForWorkspace(ctx,\n\t\t\t\t&workspaceInfo.Source,\n\t\t\t\t&workspaceInfo.Agent,\n\t\t\t\tsetupInfo.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\t\"\",\n\t\t\t\tworkspaceInfo.CLIOptions,\n\t\t\t\ttrue,\n\t\t\t\tlogger,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// setup container\n\terr = setup.SetupContainer(ctx, setupInfo, workspaceInfo.CLIOptions.WorkspaceEnv, cmd.ChownWorkspace, &workspaceInfo.CLIOptions.Platform, tunnelClient, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// install IDE\n\terr = cmd.installIDE(setupInfo, &workspaceInfo.IDE, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// start container daemon if necessary\n\tif !workspaceInfo.CLIOptions.Platform.Enabled && !workspaceInfo.CLIOptions.DisableDaemon && workspaceInfo.ContainerTimeout != \"\" {\n\t\terr = single.Single(\"devpod.daemon.pid\", func() (*exec.Cmd, error) {\n\t\t\tlogger.Debugf(\"Start DevPod Container Daemon with Inactivity Timeout %s\", workspaceInfo.ContainerTimeout)\n\t\t\tbinaryPath, err := os.Executable()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn exec.Command(binaryPath, \"agent\", \"container\", \"daemon\", \"--timeout\", workspaceInfo.ContainerTimeout), nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tout, err := json.Marshal(setupInfo)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal setup info: %w\", err)\n\t}\n\n\t_, err = tunnelClient.SendResult(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"send result: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc fillContainerEnv(setupInfo *config.Result) error {\n\t// set remote-env\n\tif setupInfo.MergedConfig.RemoteEnv == nil {\n\t\tsetupInfo.MergedConfig.RemoteEnv = make(map[string]string)\n\t}\n\n\tif _, ok := setupInfo.MergedConfig.RemoteEnv[\"PATH\"]; !ok {\n\t\tsetupInfo.MergedConfig.RemoteEnv[\"PATH\"] = \"${containerEnv:PATH}\"\n\t}\n\n\t// merge config\n\tnewMergedConfig := &config.MergedDevContainerConfig{}\n\terr := config.SubstituteContainerEnv(config.ListToObject(os.Environ()), setupInfo.MergedConfig, newMergedConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"substitute container env\")\n\t}\n\tsetupInfo.MergedConfig = newMergedConfig\n\treturn nil\n}\n\nfunc dockerlessBuild(\n\tctx context.Context,\n\tsetupInfo *config.Result,\n\tdockerlessOptions *provider2.ProviderDockerlessOptions,\n\tclient tunnel.TunnelClient,\n\tdebug bool,\n\tlog log.Logger,\n) error {\n\tif os.Getenv(\"DOCKERLESS\") != \"true\" {\n\t\treturn nil\n\t}\n\n\t_, err := os.Stat(DockerlessImageConfigOutput)\n\tif err == nil {\n\t\tlog.Debugf(\"Skip dockerless build, because container was built already\")\n\t\treturn nil\n\t}\n\n\tbuildContext := os.Getenv(\"DOCKERLESS_CONTEXT\")\n\tif buildContext == \"\" {\n\t\tlog.Debugf(\"Build context is missing for dockerless build\")\n\t\treturn nil\n\t}\n\n\t// check if build info is there\n\tfallbackDir := filepath.Join(config.DevPodDockerlessBuildInfoFolder, config.DevPodContextFeatureFolder)\n\tbuildInfoDir := filepath.Join(buildContext, config.DevPodContextFeatureFolder)\n\t_, err = os.Stat(buildInfoDir)\n\tif err != nil {\n\t\t// try to rename from fallback dir\n\t\terr = copy.RenameDirectory(fallbackDir, buildInfoDir)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"rename dir: %w\", err)\n\t\t}\n\n\t\t_, err = os.Stat(buildInfoDir)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't find build dir %s: %w\", buildInfoDir, err)\n\t\t}\n\t}\n\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// configure credentials\n\tif dockerlessOptions.DisableDockerCredentials != \"true\" {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithCancel(ctx)\n\t\tdefer cancel()\n\n\t\t// configure the docker credentials\n\t\tdockerCredentialsDir, err := configureDockerCredentials(ctx, cancel, client, log)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error configuring docker credentials: %v\", err)\n\t\t} else {\n\t\t\tdefer func() {\n\t\t\t\t_ = os.Unsetenv(\"DOCKER_CONFIG\")\n\t\t\t\t_ = os.RemoveAll(dockerCredentialsDir)\n\t\t\t}()\n\t\t}\n\t}\n\n\t// build args\n\targs := []string{\"build\", \"--ignore-path\", binaryPath}\n\targs = append(args, parseIgnorePaths(dockerlessOptions.IgnorePaths)...)\n\targs = append(args, \"--build-arg\", \"TARGETOS=\"+runtime.GOOS)\n\targs = append(args, \"--build-arg\", \"TARGETARCH=\"+runtime.GOARCH)\n\tif dockerlessOptions.RegistryCache != \"\" {\n\t\tlog.Debug(\"Appending registry cache to dockerless build arguments \", dockerlessOptions.RegistryCache)\n\t\targs = append(args, \"--registry-cache\", dockerlessOptions.RegistryCache)\n\t}\n\n\t// ignore mounts\n\targs = append(args, \"--ignore-path\", setupInfo.SubstitutionContext.ContainerWorkspaceFolder)\n\tfor _, m := range setupInfo.MergedConfig.Mounts {\n\t\t// check if there already, then we don't touch it\n\t\tfiles, err := os.ReadDir(m.Target)\n\t\tif err == nil && len(files) > 0 {\n\t\t\targs = append(args, \"--ignore-path\", m.Target)\n\t\t}\n\t}\n\n\t// write output to log\n\terrWriter := log.Writer(logrus.InfoLevel, false)\n\tdefer errWriter.Close()\n\n\t// start building\n\tlog.Infof(\"Start dockerless building %s %s\", \"/.dockerless/dockerless\", strings.Join(args, \" \"))\n\tcmd := exec.CommandContext(ctx, \"/.dockerless/dockerless\", args...)\n\n\tif debug {\n\t\tdebugWriter := log.Writer(logrus.DebugLevel, false)\n\t\tdefer debugWriter.Close()\n\t\tcmd.Stdout = debugWriter\n\t}\n\tcmd.Stderr = errWriter\n\tcmd.Env = os.Environ()\n\terr = cmd.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// add container env to envfile.json\n\trawConfig, err := os.ReadFile(DockerlessImageConfigOutput)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// parse config file\n\tconfigFile := &v1.ConfigFile{}\n\terr = json.Unmarshal(rawConfig, configFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse container config: %w\", err)\n\t}\n\n\t// apply env\n\tenvfile.MergeAndApply(config.ListToObject(configFile.Config.Env), log)\n\n\t// rename build path\n\t_ = os.RemoveAll(fallbackDir)\n\terr = copy.RenameDirectory(buildInfoDir, fallbackDir)\n\tif err != nil {\n\t\tlog.Debugf(\"Error renaming dir %s: %v\", buildInfoDir, err)\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n\nfunc parseIgnorePaths(ignorePaths string) []string {\n\tif strings.TrimSpace(ignorePaths) == \"\" {\n\t\treturn nil\n\t}\n\n\tretPaths := []string{}\n\tsplitted := strings.Split(ignorePaths, \",\")\n\tfor _, s := range splitted {\n\t\tretPaths = append(retPaths, \"--ignore-path\", strings.TrimSpace(s))\n\t}\n\n\treturn retPaths\n}\n\nfunc configureDockerCredentials(\n\tctx context.Context,\n\tcancel context.CancelFunc,\n\tclient tunnel.TunnelClient,\n\tlog log.Logger,\n) (string, error) {\n\tserverPort, err := credentials.StartCredentialsServer(ctx, cancel, client, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdockerCredentials, err := dockercredentials.ConfigureCredentialsDockerless(\"/.dockerless/.docker\", serverPort, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn dockerCredentials, nil\n}\n\nfunc (cmd *SetupContainerCmd) installIDE(setupInfo *config.Result, ide *provider2.WorkspaceIDEConfig, log log.Logger) error {\n\tswitch ide.Name {\n\tcase string(config2.IDENone):\n\t\treturn nil\n\tcase string(config2.IDEVSCode):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorStable, log)\n\tcase string(config2.IDEVSCodeInsiders):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorInsiders, log)\n\tcase string(config2.IDECursor):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorCursor, log)\n\tcase string(config2.IDEPositron):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorPositron, log)\n\tcase string(config2.IDECodium):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorCodium, log)\n\tcase string(config2.IDEWindsurf):\n\t\treturn cmd.setupVSCode(setupInfo, ide.Options, vscode.FlavorWindsurf, log)\n\tcase string(config2.IDEOpenVSCode):\n\t\treturn cmd.setupOpenVSCode(setupInfo, ide.Options, log)\n\tcase string(config2.IDEGoland):\n\t\treturn jetbrains.NewGolandServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDERustRover):\n\t\treturn jetbrains.NewRustRoverServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEPyCharm):\n\t\treturn jetbrains.NewPyCharmServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEPhpStorm):\n\t\treturn jetbrains.NewPhpStorm(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEIntellij):\n\t\treturn jetbrains.NewIntellij(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDECLion):\n\t\treturn jetbrains.NewCLionServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDERider):\n\t\treturn jetbrains.NewRiderServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDERubyMine):\n\t\treturn jetbrains.NewRubyMineServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEWebStorm):\n\t\treturn jetbrains.NewWebStormServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEDataSpell):\n\t\treturn jetbrains.NewDataSpellServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDEFleet):\n\t\treturn fleet.NewFleetServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install(setupInfo.SubstitutionContext.ContainerWorkspaceFolder)\n\tcase string(config2.IDEJupyterNotebook):\n\t\treturn jupyter.NewJupyterNotebookServer(setupInfo.SubstitutionContext.ContainerWorkspaceFolder, config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\tcase string(config2.IDERStudio):\n\t\terr := rstudio.NewRStudioServer(setupInfo.SubstitutionContext.ContainerWorkspaceFolder, config.GetRemoteUser(setupInfo), ide.Options, log).Install()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"could not install rstudio with error: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *SetupContainerCmd) setupVSCode(setupInfo *config.Result, ideOptions map[string]config2.OptionValue, flavor vscode.Flavor, log log.Logger) error {\n\tlog.Debugf(\"Setup %s...\", flavor.DisplayName())\n\tvsCodeConfiguration := config.GetVSCodeConfiguration(setupInfo.MergedConfig)\n\tsettings := \"\"\n\tif len(vsCodeConfiguration.Settings) > 0 {\n\t\tout, err := json.Marshal(vsCodeConfiguration.Settings)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsettings = string(out)\n\t}\n\n\tuser := config.GetRemoteUser(setupInfo)\n\terr := vscode.NewVSCodeServer(vsCodeConfiguration.Extensions, settings, user, ideOptions, flavor, log).Install()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// don't install code-server if we don't have settings or extensions\n\tif len(vsCodeConfiguration.Settings) == 0 && len(vsCodeConfiguration.Extensions) == 0 {\n\t\treturn nil\n\t}\n\n\tif len(vsCodeConfiguration.Extensions) == 0 {\n\t\treturn nil\n\t}\n\n\treturn single.Single(fmt.Sprintf(\"%s-async.pid\", flavor), func() (*exec.Cmd, error) {\n\t\tlog.Infof(\"Install extensions '%s' in the background\", strings.Join(vsCodeConfiguration.Extensions, \",\"))\n\t\tbinaryPath, err := os.Executable()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\targs := []string{\n\t\t\t\"agent\", \"container\", \"vscode-async\",\n\t\t\t\"--setup-info\", cmd.SetupInfo,\n\t\t\t\"--release-channel\", string(flavor),\n\t\t}\n\n\t\treturn exec.Command(binaryPath, args...), nil\n\t})\n}\n\nfunc (cmd *SetupContainerCmd) setupOpenVSCode(setupInfo *config.Result, ideOptions map[string]config2.OptionValue, log log.Logger) error {\n\tlog.Debugf(\"Setup openvscode...\")\n\tvsCodeConfiguration := config.GetVSCodeConfiguration(setupInfo.MergedConfig)\n\tsettings := \"\"\n\tif len(vsCodeConfiguration.Settings) > 0 {\n\t\tout, err := json.Marshal(vsCodeConfiguration.Settings)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsettings = string(out)\n\t}\n\n\tuser := config.GetRemoteUser(setupInfo)\n\topenVSCode := openvscode.NewOpenVSCodeServer(vsCodeConfiguration.Extensions, settings, user, \"0.0.0.0\", strconv.Itoa(openvscode.DefaultVSCodePort), ideOptions, log)\n\n\t// install open vscode\n\terr := openVSCode.Install()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// install extensions in background\n\tif len(vsCodeConfiguration.Extensions) > 0 {\n\t\terr = single.Single(\"openvscode-async.pid\", func() (*exec.Cmd, error) {\n\t\t\tlog.Infof(\"Install extensions '%s' in the background\", strings.Join(vsCodeConfiguration.Extensions, \",\"))\n\t\t\tbinaryPath, err := os.Executable()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn exec.Command(binaryPath, \"agent\", \"container\", \"openvscode-async\", \"--setup-info\", cmd.SetupInfo), nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"install extensions\")\n\t\t}\n\t}\n\n\t// start the server in the background\n\treturn openVSCode.Start()\n}\n\nfunc configureSystemGitCredentials(ctx context.Context, cancel context.CancelFunc, client tunnel.TunnelClient, log log.Logger) (func(), error) {\n\tif !command.Exists(\"git\") {\n\t\treturn nil, errors.New(\"git not found\")\n\t}\n\n\tserverPort, err := credentials.StartCredentialsServer(ctx, cancel, client, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgitCredentials := fmt.Sprintf(\"!'%s' agent git-credentials --port %d\", binaryPath, serverPort)\n\t_ = os.Setenv(\"DEVPOD_GIT_HELPER_PORT\", strconv.Itoa(serverPort))\n\n\terr = git.CommandContext(ctx, git.GetDefaultExtraEnv(false), \"config\", \"--system\", \"--add\", \"credential.helper\", gitCredentials).Run()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"add git credential helper: %w\", err)\n\t}\n\n\tcleanup := func() {\n\t\tlog.Debug(\"Unset setup system credential helper\")\n\t\terr = git.CommandContext(ctx, git.GetDefaultExtraEnv(false), \"config\", \"--system\", \"--unset\", \"credential.helper\").Run()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"unset system credential helper %v\", err)\n\t\t}\n\t}\n\n\treturn cleanup, nil\n}\n\nfunc streamMount(ctx context.Context, workspaceInfo *provider2.ContainerWorkspaceInfo, m *config.Mount, tunnelClient tunnel.TunnelClient, logger log.Logger) error {\n\t// if we have a platform workspace socket we connect directly to it\n\tif workspaceInfo.CLIOptions.Platform.Enabled {\n\t\t// check if the runner proxy socket exists\n\t\thttpClient := &http.Client{\n\t\t\tTransport: &http.Transport{\n\t\t\t\tTLSClientConfig: &tls.Config{\n\t\t\t\t\tInsecureSkipVerify: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\t// build the url\n\t\tlogger.Infof(\"Download %s into DevContainer %s\", m.Source, m.Target)\n\t\turl := fmt.Sprintf(\n\t\t\t\"https://%s/kubernetes/management/apis/management.loft.sh/v1/namespaces/%s/devpodworkspaceinstances/%s/download?path=%s\",\n\t\t\tts.RemoveProtocol(workspaceInfo.CLIOptions.Platform.PlatformHost),\n\t\t\tworkspaceInfo.CLIOptions.Platform.InstanceNamespace,\n\t\t\tworkspaceInfo.CLIOptions.Platform.InstanceName,\n\t\t\turl.QueryEscape(m.Source),\n\t\t)\n\t\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create request: %w\", err)\n\t\t}\n\t\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", workspaceInfo.CLIOptions.Platform.AccessKey))\n\n\t\t// send the request\n\t\tresp, err := httpClient.Do(req)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"download workspace: %w\", err)\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\t// check if the response is ok\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\tbody, _ := io.ReadAll(resp.Body)\n\t\t\treturn fmt.Errorf(\"download workspace: body = %s, status = %s\", string(body), resp.Status)\n\t\t}\n\n\t\t// create progress reader\n\t\tprogressReader := &progressReader{\n\t\t\tReader: resp.Body,\n\t\t\tLog:    logger,\n\t\t}\n\n\t\t// target folder\n\t\terr = extract.Extract(progressReader, m.Target)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"stream mount %s: %w\", m.String(), err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// stream mount\n\tlogger.Infof(\"Copy %s into DevContainer %s\", m.Source, m.Target)\n\tstream, err := tunnelClient.StreamMount(ctx, &tunnel.StreamMountRequest{Mount: m.String()})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"init stream mount %s: %w\", m.String(), err)\n\t}\n\n\t// target folder\n\terr = extract.Extract(tunnelserver.NewStreamReader(stream, logger), m.Target)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"stream mount %s: %w\", m.String(), err)\n\t}\n\n\treturn nil\n}\n\ntype progressReader struct {\n\tReader io.Reader\n\tLog    log.Logger\n\n\tlastMessage time.Time\n\tbytesRead   int64\n}\n\nfunc (p *progressReader) Read(b []byte) (n int, err error) {\n\tn, err = p.Reader.Read(b)\n\tp.bytesRead += int64(n)\n\tif time.Since(p.lastMessage) > time.Second*4 {\n\t\tp.Log.Infof(\"Downloaded %.2f MB\", float64(p.bytesRead)/1024/1024)\n\t\tp.lastMessage = time.Now()\n\t}\n\n\treturn n, err\n}\n"
  },
  {
    "path": "cmd/agent/container/setup_loft_platform_access.go",
    "content": "package container\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/loftconfig\"\n\t\"github.com/loft-sh/log\"\n\n\t\"github.com/spf13/cobra\"\n)\n\ntype SetupLoftPlatformAccessCmd struct {\n\t*flags.GlobalFlags\n\n\tContext  string\n\tProvider string\n\tPort     int\n}\n\n// NewSetupLoftPlatformAccessCmd creates a new setup-loft-platform-access command\n// This agent command can be used to inject loft platform configuration from local machine to workspace.\nfunc NewSetupLoftPlatformAccessCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetupLoftPlatformAccessCmd{\n\t\tGlobalFlags: flags,\n\t}\n\n\tsetupLoftPlatformAccessCmd := &cobra.Command{\n\t\tUse:   \"setup-loft-platform-access\",\n\t\tShort: \"used to setup Loft Platform access\",\n\t\tRunE:  cmd.Run,\n\t}\n\n\tsetupLoftPlatformAccessCmd.Flags().StringVar(&cmd.Context, \"context\", \"\", \"context to use\")\n\t_ = setupLoftPlatformAccessCmd.Flags().MarkDeprecated(\"context\", \"Information should be provided by services server, don't use this flag anymore\")\n\n\tsetupLoftPlatformAccessCmd.Flags().StringVar(&cmd.Provider, \"provider\", \"\", \"provider to use\")\n\t_ = setupLoftPlatformAccessCmd.Flags().MarkDeprecated(\"provider\", \"Information should be provided by services server, don't use this flag anymore\")\n\n\tsetupLoftPlatformAccessCmd.Flags().IntVar(&cmd.Port, \"port\", 0, \"If specified, will use the given port\")\n\t_ = setupLoftPlatformAccessCmd.Flags().MarkDeprecated(\"port\", \"\")\n\n\treturn setupLoftPlatformAccessCmd\n}\n\n// Run executes main command logic.\n// It fetches Loft Platform credentials from credentials server and sets it up inside the workspace.\nfunc (c *SetupLoftPlatformAccessCmd) Run(_ *cobra.Command, args []string) error {\n\tlogger := log.Default.ErrorStreamOnly()\n\n\tport, err := credentials.GetPort()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get port: %w\", err)\n\t}\n\t// backwards compatibility, remove in future release\n\tif c.Port > 0 {\n\t\tport = c.Port\n\t}\n\n\tloftConfig, err := loftconfig.GetLoftConfig(c.Context, c.Provider, port, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif loftConfig == nil {\n\t\tlogger.Debug(\"Got empty loft config response, Loft Platform access won't be set up.\")\n\t\treturn nil\n\t}\n\n\terr = loftconfig.AuthDevpodCliToPlatform(loftConfig, logger)\n\tif err != nil {\n\t\t// log error but don't return to allow other CLIs to install as well\n\t\tlogger.Warnf(\"unable to authenticate devpod cli: %w\", err)\n\t}\n\n\terr = loftconfig.AuthVClusterCliToPlatform(loftConfig, logger)\n\tif err != nil {\n\t\t// log error but don't return to allow other CLIs to install as well\n\t\tlogger.Warnf(\"unable to authenticate vcluster cli: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/container/setup_windows.go",
    "content": "//go:build windows\n\npackage container\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc NewSetupContainerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse:   \"setup\",\n\t\tShort: \"Sets up a container\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tpanic(\"Windows Containers are not supported\")\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "cmd/agent/container/ssh_server.go",
    "content": "package container\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\thelperssh \"github.com/loft-sh/devpod/pkg/ssh/server\"\n\t\"github.com/loft-sh/devpod/pkg/ssh/server/port\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst BaseLogDir = \"/var/devpod\"\n\n// SSHServerCmd holds the ssh server cmd flags\ntype SSHServerCmd struct {\n\t*flags.GlobalFlags\n\n\tAddress    string\n\tWorkdir    string\n\tRemoteUser string\n}\n\n// NewSSHServerCmd creates a new ssh command\nfunc NewSSHServerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SSHServerCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh-server\",\n\t\tShort: \"Starts the container ssh server\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\tsshCmd.Flags().StringVar(&cmd.Address, \"address\", fmt.Sprintf(\"127.0.0.1:%d\", helperssh.DefaultUserPort), \"Address to listen to\")\n\tsshCmd.Flags().StringVar(&cmd.RemoteUser, \"remote-user\", \"\", \"The remote user for this workspace\")\n\tsshCmd.Flags().StringVar(&cmd.Workdir, \"workdir\", \"\", \"Directory where commands will run on the host\")\n\treturn sshCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SSHServerCmd) Run(_ *cobra.Command, _ []string) error {\n\tlogger := getFileLogger(cmd.RemoteUser, cmd.Debug)\n\tserver, err := helperssh.NewContainerServer(cmd.Address, cmd.Workdir, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if ssh is already running at that port\n\tavailable, err := port.IsAvailable(cmd.Address)\n\tif !available {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"address %s already in use: %w\", cmd.Address, err)\n\t\t}\n\n\t\tlog.Default.ErrorStreamOnly().Info(\"address %s already in use\", cmd.Address)\n\t\treturn nil\n\t}\n\n\treturn server.ListenAndServe()\n}\n\nfunc getFileLogger(remoteUser string, debug bool) log.Logger {\n\tlogLevel := logrus.InfoLevel\n\tif debug {\n\t\tlogLevel = logrus.DebugLevel\n\t}\n\tfallback := log.NewDiscardLogger(logLevel)\n\n\ttargetFolder := filepath.Join(os.TempDir(), \".devpod\")\n\tif remoteUser != \"\" {\n\t\ttargetFolder = filepath.Join(BaseLogDir, remoteUser)\n\t}\n\terr := os.MkdirAll(targetFolder, 0o755)\n\tif err != nil {\n\t\treturn fallback\n\t}\n\n\treturn log.NewFileLogger(filepath.Join(targetFolder, \"ssh.log\"), logLevel)\n}\n"
  },
  {
    "path": "cmd/agent/container/vscode_async.go",
    "content": "package container\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide/vscode\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n)\n\n// VSCodeAsyncCmd holds the cmd flags\ntype VSCodeAsyncCmd struct {\n\t*flags.GlobalFlags\n\n\tSetupInfo string\n\tFlavor    string\n}\n\n// NewVSCodeAsyncCmd creates a new command\nfunc NewVSCodeAsyncCmd() *cobra.Command {\n\tcmd := &VSCodeAsyncCmd{}\n\tvsCodeAsyncCmd := &cobra.Command{\n\t\tUse:   \"vscode-async\",\n\t\tShort: \"Starts vscode\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\tvsCodeAsyncCmd.Flags().StringVar(&cmd.SetupInfo, \"setup-info\", \"\", \"The container setup info\")\n\t_ = vsCodeAsyncCmd.MarkFlagRequired(\"setup-info\")\n\n\tvsCodeAsyncCmd.Flags().StringVar(&cmd.Flavor, \"flavor\", string(vscode.FlavorStable), \"The flavor of the VSCode distribution\")\n\tvsCodeAsyncCmd.Flags().StringVar(&cmd.Flavor, \"release-channel\", string(vscode.FlavorStable), \"The release channel to use for vscode\")\n\t_ = vsCodeAsyncCmd.Flags().MarkDeprecated(\"release-channel\", \"prefer the --flavor flag\")\n\t// gracefully migrate --release-channel to --flavor\n\tvsCodeAsyncCmd.Flags().SetNormalizeFunc(migrateReleaseChannel)\n\treturn vsCodeAsyncCmd\n}\n\nfunc migrateReleaseChannel(f *pflag.FlagSet, name string) pflag.NormalizedName {\n\tif name == \"release-channel\" {\n\t\tname = \"flavor\"\n\t}\n\n\treturn pflag.NormalizedName(name)\n}\n\n// Run runs the command logic\nfunc (cmd *VSCodeAsyncCmd) Run(_ *cobra.Command, _ []string) error {\n\tlog.Default.Debugf(\"Start setting up container...\")\n\tdecompressed, err := compress.Decompress(cmd.SetupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsetupInfo := &config.Result{}\n\terr = json.Unmarshal([]byte(decompressed), setupInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// install IDE\n\terr = setupVSCodeExtensions(setupInfo, vscode.Flavor(cmd.Flavor), log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc setupVSCodeExtensions(setupInfo *config.Result, flavor vscode.Flavor, log log.Logger) error {\n\tvsCodeConfiguration := config.GetVSCodeConfiguration(setupInfo.MergedConfig)\n\tuser := config.GetRemoteUser(setupInfo)\n\treturn vscode.NewVSCodeServer(vsCodeConfiguration.Extensions, \"\", user, nil, flavor, log).InstallExtensions()\n}\n"
  },
  {
    "path": "cmd/agent/container_tunnel.go",
    "content": "package agent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent/workspace\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/setup\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ContainerTunnelCmd holds the ws-tunnel cmd flags\ntype ContainerTunnelCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n\tUser          string\n}\n\n// NewContainerTunnelCmd creates a new command\nfunc NewContainerTunnelCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ContainerTunnelCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tcontainerTunnelCmd := &cobra.Command{\n\t\tUse:   \"container-tunnel\",\n\t\tShort: \"Starts a new container ssh tunnel\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.TODO(), log.Default.ErrorStreamOnly())\n\t\t},\n\t}\n\n\tcontainerTunnelCmd.Flags().StringVar(&cmd.User, \"user\", \"\", \"The user to create the tunnel with\")\n\tcontainerTunnelCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = containerTunnelCmd.MarkFlagRequired(\"workspace-info\")\n\treturn containerTunnelCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ContainerTunnelCmd) Run(ctx context.Context, log log.Logger) error {\n\t// write workspace info\n\tshouldExit, workspaceInfo, err := agent.WriteWorkspaceInfo(cmd.WorkspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// make sure content folder exists\n\t_, err = workspace.InitContentFolder(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create runner\n\trunner, err := workspace.CreateRunner(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait until devcontainer is started\n\terr = startDevContainer(ctx, workspaceInfo, runner, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// handle SIGHUP\n\tsigs := make(chan os.Signal, 1)\n\tsignal.Notify(sigs, syscall.SIGHUP)\n\tgo func() {\n\t\t<-sigs\n\t\tos.Exit(0)\n\t}()\n\n\t// create tunnel into container.\n\terr = agent.Tunnel(\n\t\tctx,\n\t\tfunc(ctx context.Context, user string, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\treturn runner.Command(ctx, user, command, stdin, stdout, stderr)\n\t\t},\n\t\tcmd.User,\n\t\tos.Stdin,\n\t\tos.Stdout,\n\t\tos.Stderr,\n\t\tlog,\n\t\tworkspaceInfo.InjectTimeout,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc startDevContainer(ctx context.Context, workspaceConfig *provider2.AgentWorkspaceInfo, runner devcontainer.Runner, log log.Logger) error {\n\tcontainerDetails, err := runner.Find(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// start container if necessary\n\tif containerDetails == nil || containerDetails.State.Status != \"running\" {\n\t\t// start container\n\t\t_, err = StartContainer(ctx, runner, log, workspaceConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if encoding.IsLegacyUID(workspaceConfig.Workspace.UID) {\n\t\t// make sure workspace result is in devcontainer\n\t\tbuf := &bytes.Buffer{}\n\t\terr = runner.Command(ctx, \"root\", \"cat \"+setup.ResultLocation, nil, buf, buf)\n\t\tif err != nil {\n\t\t\t// start container\n\t\t\t_, err = StartContainer(ctx, runner, log, workspaceConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc StartContainer(ctx context.Context, runner devcontainer.Runner, log log.Logger, workspaceConfig *provider2.AgentWorkspaceInfo) (*config.Result, error) {\n\tlog.Debugf(\"Starting DevPod container...\")\n\tresult, err := runner.Up(ctx, devcontainer.UpOptions{NoBuild: true}, workspaceConfig.InjectTimeout)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\tlog.Debugf(\"Successfully started DevPod container\")\n\treturn result, err\n}\n"
  },
  {
    "path": "cmd/agent/daemon.go",
    "content": "package agent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/driver/custom\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DaemonCmd holds the cmd flags\ntype DaemonCmd struct {\n\t*flags.GlobalFlags\n\n\tInterval string\n}\n\n// NewDaemonCmd creates a new command\nfunc NewDaemonCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DaemonCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdaemonCmd := &cobra.Command{\n\t\tUse:   \"daemon\",\n\t\tShort: \"Watches for activity and stops the server due to inactivity\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tdaemonCmd.Flags().StringVar(&cmd.Interval, \"interval\", \"\", \"The interval how to poll workspaces\")\n\treturn daemonCmd\n}\n\nfunc (cmd *DaemonCmd) Run(ctx context.Context) error {\n\tlogFolder, err := agent.GetAgentDaemonLogFolder(cmd.AgentDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger := log.NewFileLogger(filepath.Join(logFolder, \"agent-daemon.log\"), logrus.InfoLevel)\n\tlogger.Infof(\"Starting DevPod Daemon patrol at %s...\", logFolder)\n\n\t// start patrolling\n\tcmd.patrol(logger)\n\n\t// should never reach this\n\treturn nil\n}\n\nfunc (cmd *DaemonCmd) patrol(log log.Logger) {\n\t// make sure we don't immediately resleep on startup\n\tcmd.initialTouch(log)\n\n\t// parse the daemon interval\n\tinterval := time.Second * 60\n\tif cmd.Interval != \"\" {\n\t\tparsed, err := time.ParseDuration(cmd.Interval)\n\t\tif err == nil {\n\t\t\tinterval = parsed\n\t\t}\n\t}\n\n\t// loop over workspace configs and check their last ModTime\n\tfor {\n\t\ttime.Sleep(interval)\n\t\tcmd.doOnce(log)\n\t}\n}\n\nfunc (cmd *DaemonCmd) doOnce(log log.Logger) {\n\tvar latestActivity *time.Time\n\tvar workspace *provider2.AgentWorkspaceInfo\n\n\t// get base folder\n\tbaseFolder, err := agent.FindAgentHomeFolder(cmd.AgentDir)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// get all workspace configs\n\tpattern := baseFolder + \"/contexts/*/workspaces/*/\" + provider2.WorkspaceConfigFile\n\tmatches, err := filepath.Glob(pattern)\n\tif err != nil {\n\t\tlog.Errorf(\"Error globing pattern %s: %v\", pattern, err)\n\t\treturn\n\t}\n\n\t// check when the last touch was\n\tfor _, match := range matches {\n\t\tactivity, activityWorkspace, err := getActivity(match, log)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error checking for inactivity: %v\", err)\n\t\t\tcontinue\n\t\t} else if activity == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif latestActivity == nil || activity.After(*latestActivity) {\n\t\t\tlatestActivity = activity\n\t\t\tworkspace = activityWorkspace\n\t\t}\n\t}\n\n\t// should we run shutdown command?\n\tif latestActivity == nil {\n\t\tif len(matches) == 0 {\n\t\t\tlog.Infof(\"No workspaces found in path '%s'\", baseFolder)\n\t\t} else {\n\t\t\tlog.Infof(\"%d workspaces found in path '%s', but none of them had any auto-stop configured or were still running / never completed successfully\", len(matches), baseFolder)\n\t\t}\n\t\treturn\n\t}\n\n\t// check timeout\n\ttimeout := agent.DefaultInactivityTimeout\n\tif workspace.Agent.Timeout != \"\" {\n\t\tvar err error\n\t\ttimeout, err = time.ParseDuration(workspace.Agent.Timeout)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error parsing inactivity timeout: %v\", err)\n\t\t\ttimeout = agent.DefaultInactivityTimeout\n\t\t}\n\t}\n\tif latestActivity.Add(timeout).After(time.Now()) {\n\t\tlog.Infof(\"Workspace '%s' has latest activity at '%s', will auto-stop machine in %s\", workspace.Workspace.ID, latestActivity.String(), time.Until(latestActivity.Add(timeout)).String())\n\t\treturn\n\t}\n\n\t// run shutdown command\n\tcmd.runShutdownCommand(workspace, log)\n}\n\nfunc (cmd *DaemonCmd) runShutdownCommand(workspace *provider2.AgentWorkspaceInfo, log log.Logger) {\n\t// get environ\n\tenviron, err := custom.ToEnvironWithBinaries(workspace, log)\n\tif err != nil {\n\t\tlog.Errorf(\"%v\", err)\n\t\treturn\n\t}\n\n\t// we run the timeout command now\n\tbuf := &bytes.Buffer{}\n\tlog.Infof(\"Run shutdown command for workspace %s: %s\", workspace.Workspace.ID, strings.Join(workspace.Agent.Exec.Shutdown, \" \"))\n\terr = clientimplementation.RunCommand(\n\t\tcontext.Background(),\n\t\tworkspace.Agent.Exec.Shutdown,\n\t\tenviron,\n\t\tnil,\n\t\tbuf,\n\t\tbuf,\n\t)\n\tif err != nil {\n\t\tlog.Errorf(\"Error running %s: %s%w\", strings.Join(workspace.Agent.Exec.Shutdown, \" \"), buf.String(), err)\n\t\treturn\n\t}\n\n\tlog.Infof(\"Successful ran command: %s\", buf.String())\n}\n\nfunc (cmd *DaemonCmd) initialTouch(log log.Logger) {\n\t// get base folder\n\tbaseFolder, err := agent.FindAgentHomeFolder(cmd.AgentDir)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// get workspace configs\n\tpattern := baseFolder + \"/contexts/*/workspaces/*/\" + provider2.WorkspaceConfigFile\n\tmatches, err := filepath.Glob(pattern)\n\tif err != nil {\n\t\tlog.Errorf(\"Error globing pattern %s: %v\", pattern, err)\n\t\treturn\n\t}\n\n\t// check when the last touch was\n\tnow := time.Now()\n\tfor _, match := range matches {\n\t\terr := os.Chtimes(match, now, now)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error touching workspace config %s: %v\", pattern, err)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc getActivity(workspaceConfig string, log log.Logger) (*time.Time, *provider2.AgentWorkspaceInfo, error) {\n\tworkspace, err := agent.ParseAgentWorkspaceInfo(workspaceConfig)\n\tif err != nil {\n\t\tlog.Errorf(\"Error reading %s: %v\", workspaceConfig, err)\n\t\treturn nil, nil, nil\n\t}\n\n\t// check if shutdown is configured\n\tif len(workspace.Agent.Exec.Shutdown) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\t// check last access time\n\tstat, err := os.Stat(workspaceConfig)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// check if workspace is locked\n\tt := stat.ModTime()\n\tif agent.HasWorkspaceBusyFile(filepath.Dir(workspaceConfig)) {\n\t\tt = t.Add(time.Minute * 20)\n\t}\n\n\t// check if timeout\n\treturn &t, workspace, nil\n}\n"
  },
  {
    "path": "cmd/agent/docker_credentials.go",
    "content": "package agent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent/container\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DockerCredentialsCmd holds the cmd flags\ntype DockerCredentialsCmd struct {\n\t*flags.GlobalFlags\n\n\tPort int\n}\n\n// NewDockerCredentialsCmd creates a new command\nfunc NewDockerCredentialsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DockerCredentialsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdockerCredentialsCmd := &cobra.Command{\n\t\tUse:   \"docker-credentials\",\n\t\tShort: \"Retrieves docker-credentials from the local machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args, log.Default.ErrorStreamOnly())\n\t\t},\n\t}\n\tdockerCredentialsCmd.Flags().IntVar(&cmd.Port, \"port\", 0, \"If specified, will use the given port\")\n\t_ = dockerCredentialsCmd.MarkFlagRequired(\"port\")\n\treturn dockerCredentialsCmd\n}\n\nfunc (cmd *DockerCredentialsCmd) Run(ctx context.Context, args []string, log log.Logger) error {\n\tif len(args) == 0 {\n\t\treturn nil\n\t}\n\n\t// we only handle get and list\n\tif args[0] == \"get\" {\n\t\treturn cmd.handleGet(log)\n\t} else if args[0] == \"list\" {\n\t\treturn cmd.handleList(log)\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *DockerCredentialsCmd) handleList(log log.Logger) error {\n\trawJSON, err := json.Marshal(&dockercredentials.Request{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresponse, err := devpodhttp.GetHTTPClient().Post(\"http://localhost:\"+strconv.Itoa(cmd.Port)+\"/docker-credentials\", \"application/json\", bytes.NewReader(rawJSON))\n\tif err != nil {\n\t\tlog.Errorf(\"Error retrieving list credentials: %v\", err)\n\t\treturn nil\n\t}\n\tdefer response.Body.Close()\n\n\traw, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\tlog.Errorf(\"Error reading list credentials: %v\", err)\n\t\treturn nil\n\t}\n\n\t// has the request succeeded?\n\tif response.StatusCode != http.StatusOK {\n\t\tlog.Errorf(\"Error reading list credentials (%d): %v\", response.StatusCode, string(raw))\n\t\treturn nil\n\t}\n\n\tlistResponse := &dockercredentials.ListResponse{}\n\terr = json.Unmarshal(raw, listResponse)\n\tif err != nil {\n\t\tlog.Errorf(\"Error decoding list credentials: %s%v\", string(raw), err)\n\t\treturn nil\n\t}\n\n\tif listResponse.Registries == nil {\n\t\tlistResponse.Registries = map[string]string{}\n\t}\n\traw, err = json.Marshal(listResponse.Registries)\n\tif err != nil {\n\t\tlog.Errorf(\"Error encoding list credentials: %v\", err)\n\t\treturn nil\n\t}\n\n\t// print response to stdout\n\tfmt.Print(string(raw))\n\treturn nil\n}\n\nfunc (cmd *DockerCredentialsCmd) handleGet(log log.Logger) error {\n\turl, err := io.ReadAll(os.Stdin)\n\tif err != nil {\n\t\treturn err\n\t} else if len(strings.TrimSpace(string(url))) == 0 {\n\t\treturn fmt.Errorf(\"no credentials server URL\")\n\t}\n\n\tcredentials := getDockerCredentialsFromWorkspaceServer(&dockercredentials.Credentials{ServerURL: strings.TrimSpace(string(url))})\n\tif credentials != nil {\n\t\traw, err := json.Marshal(credentials)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error encoding credentials: %v\", err)\n\t\t\treturn nil\n\t\t}\n\t\tfmt.Print(string(raw))\n\t\treturn nil\n\t}\n\n\trawJSON, err := json.Marshal(&dockercredentials.Request{ServerURL: strings.TrimSpace(string(url))})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresponse, err := devpodhttp.GetHTTPClient().Post(\"http://localhost:\"+strconv.Itoa(cmd.Port)+\"/docker-credentials\", \"application/json\", bytes.NewReader(rawJSON))\n\tif err != nil {\n\t\tlog.Errorf(\"Error retrieving credentials: %v\", err)\n\t\treturn nil\n\t}\n\tdefer response.Body.Close()\n\n\traw, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\tlog.Errorf(\"Error reading credentials: %v\", err)\n\t\treturn nil\n\t}\n\n\t// has the request succeeded?\n\tif response.StatusCode != http.StatusOK {\n\t\tlog.Errorf(\"Error reading credentials (%d): %v\", response.StatusCode, string(raw))\n\t\treturn nil\n\t}\n\n\t// try to unmarshal\n\terr = json.Unmarshal(raw, &dockercredentials.Credentials{})\n\tif err != nil {\n\t\tlog.Errorf(\"Error parsing credentials: %v\", err)\n\t\treturn nil\n\t}\n\n\t// print response to stdout\n\tfmt.Print(string(raw))\n\treturn nil\n}\n\nfunc getDockerCredentialsFromWorkspaceServer(credentials *dockercredentials.Credentials) *dockercredentials.Credentials {\n\tif _, err := os.Stat(filepath.Join(container.RootDir, ts.RunnerProxySocket)); err != nil {\n\t\t// workspace server is not running\n\t\treturn nil\n\t}\n\n\thttpClient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tDialContext: func(_ context.Context, _, _ string) (net.Conn, error) {\n\t\t\t\treturn net.Dial(\"unix\", filepath.Join(container.RootDir, ts.RunnerProxySocket))\n\t\t\t},\n\t\t},\n\t\tTimeout: 15 * time.Second,\n\t}\n\n\tcredentials, credentialsErr := requestDockerCredentials(httpClient, credentials, \"http://runner-proxy/docker-credentials\")\n\tif credentialsErr != nil {\n\t\t// append error to /var/devpod/docker-credentials.log\n\t\tfile, err := os.OpenFile(\"/var/devpod/docker-credentials-error.log\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tdefer file.Close()\n\n\t\t_, _ = file.WriteString(fmt.Sprintf(\"get credentials from workspace server: %v\\n\", credentialsErr))\n\t\treturn nil\n\t}\n\n\treturn credentials\n}\n\nfunc requestDockerCredentials(httpClient *http.Client, credentials *dockercredentials.Credentials, url string) (*dockercredentials.Credentials, error) {\n\trawJSON, err := json.Marshal(credentials)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error marshalling credentials: %w\", err)\n\t}\n\n\tresponse, err := httpClient.Post(url, \"application/json\", bytes.NewReader(rawJSON))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error retrieving credentials from credentials server: %w\", err)\n\t}\n\tdefer response.Body.Close()\n\n\traw, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading credentials: %w\", err)\n\t}\n\n\t// has the request succeeded?\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"error reading credentials (%d): %s\", response.StatusCode, string(raw))\n\t}\n\n\tcredentials = &dockercredentials.Credentials{}\n\terr = json.Unmarshal(raw, credentials)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error decoding credentials: %w\", err)\n\t}\n\n\treturn credentials, nil\n}\n"
  },
  {
    "path": "cmd/agent/git_credentials.go",
    "content": "package agent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent/container\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// GitCredentialsCmd holds the cmd flags\ntype GitCredentialsCmd struct {\n\t*flags.GlobalFlags\n\n\tPort int\n}\n\n// NewGitCredentialsCmd creates a new command\nfunc NewGitCredentialsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GitCredentialsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tgitCredentialsCmd := &cobra.Command{\n\t\tUse:   \"git-credentials\",\n\t\tShort: \"Retrieves git-credentials from the local machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args, log.Default.ErrorStreamOnly())\n\t\t},\n\t}\n\tgitCredentialsCmd.Flags().IntVar(&cmd.Port, \"port\", 0, \"If specified, will use the given port\")\n\treturn gitCredentialsCmd\n}\n\nfunc (cmd *GitCredentialsCmd) Run(ctx context.Context, args []string, log log.Logger) error {\n\tif len(args) == 0 {\n\t\treturn nil\n\t} else if args[0] != \"get\" {\n\t\treturn nil\n\t}\n\n\traw, err := io.ReadAll(os.Stdin)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcredentialsReq, err := gitcredentials.Parse(string(raw))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// try to get the credentials from the workspace server first\n\tcredentials := getCredentialsFromWorkspaceServer(credentialsReq)\n\tif credentials == nil && cmd.Port != 0 {\n\t\t// try to get the credentials from the local machine\n\t\tcredentials = getCredentialsFromLocalMachine(credentialsReq, cmd.Port)\n\t}\n\n\t// if we still don't have credentials, just return nothing\n\tif credentials == nil {\n\t\treturn nil\n\t}\n\n\t// print response to stdout\n\tfmt.Print(gitcredentials.ToString(credentials))\n\treturn nil\n}\n\nfunc getCredentialsFromWorkspaceServer(credentials *gitcredentials.GitCredentials) *gitcredentials.GitCredentials {\n\tif _, err := os.Stat(filepath.Join(container.RootDir, ts.RunnerProxySocket)); err != nil {\n\t\t// workspace server is not running\n\t\treturn nil\n\t}\n\n\thttpClient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tDialContext: func(_ context.Context, _, _ string) (net.Conn, error) {\n\t\t\t\treturn net.Dial(\"unix\", filepath.Join(container.RootDir, ts.RunnerProxySocket))\n\t\t\t},\n\t\t},\n\t}\n\n\tcredentials, credentialsErr := doRequest(httpClient, credentials, \"http://runner-proxy/git-credentials\")\n\tif credentialsErr != nil {\n\t\t// append error to /tmp/git-credentials.log\n\t\tfile, err := os.OpenFile(\"/tmp/git-credentials-error.log\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tdefer file.Close()\n\n\t\t_, _ = file.WriteString(fmt.Sprintf(\"get credentials from workspace server: %v\\n\", credentialsErr))\n\t\treturn nil\n\t}\n\n\treturn credentials\n}\n\nfunc getCredentialsFromLocalMachine(credentials *gitcredentials.GitCredentials, port int) *gitcredentials.GitCredentials {\n\tcredentials, credentialsErr := doRequest(devpodhttp.GetHTTPClient(), credentials, \"http://localhost:\"+strconv.Itoa(port)+\"/git-credentials\")\n\tif credentialsErr != nil {\n\t\t// append error to /tmp/git-credentials.log\n\t\tfile, err := os.OpenFile(\"/tmp/git-credentials-error.log\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tdefer file.Close()\n\n\t\t_, _ = file.WriteString(fmt.Sprintf(\"get credentials from local machine: %v\\n\", credentialsErr))\n\t\treturn nil\n\t}\n\n\treturn credentials\n}\n\nfunc doRequest(httpClient *http.Client, credentials *gitcredentials.GitCredentials, url string) (*gitcredentials.GitCredentials, error) {\n\trawJSON, err := json.Marshal(credentials)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error marshalling credentials: %w\", err)\n\t}\n\n\tresponse, err := httpClient.Post(url, \"application/json\", bytes.NewReader(rawJSON))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error retrieving credentials from credentials server: %w\", err)\n\t}\n\tdefer response.Body.Close()\n\n\traw, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading credentials: %w\", err)\n\t}\n\n\t// has the request succeeded?\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"error reading credentials (%d): %s\", response.StatusCode, string(raw))\n\t}\n\n\tcredentials = &gitcredentials.GitCredentials{}\n\terr = json.Unmarshal(raw, credentials)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error decoding credentials: %w\", err)\n\t}\n\n\treturn credentials, nil\n}\n"
  },
  {
    "path": "cmd/agent/git_ssh_signature.go",
    "content": "package agent\n\nimport (\n\t\"errors\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/gitsshsigning\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GitSSHSignatureCmd struct {\n\t*flags.GlobalFlags\n\n\tCertPath   string\n\tNamespace  string\n\tBufferFile string\n\tCommand    string\n}\n\n// NewGitSSHSignatureCmd creates new git-ssh-signature command\n// This agent command can be used as git ssh program by setting\n//\n//\t> git config --global gpg.ssh.program \"devpod agent git-ssh-signature\"\n//\n// Git by default uses ssh-keygen for signing commits with ssh. This CLI command is a drop-in\n// replacement for ssh-keygen and hence needs to support ssh-keygen interface that git uses.\n//\n//\tcustom-ssh-signature-handler -Y sign -n git -f /Users/johndoe/.ssh/my-key.pub /tmp/.git_signing_buffer_tmp4Euk6d\nfunc NewGitSSHSignatureCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GitSSHSignatureCmd{\n\t\tGlobalFlags: flags,\n\t}\n\n\tgitSshSignatureCmd := &cobra.Command{\n\t\tUse: \"git-ssh-signature\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tlogger := log.GetInstance()\n\n\t\t\tif len(args) < 1 {\n\t\t\t\tlogger.Fatalf(\"Buffer file is required\")\n\t\t\t}\n\n\t\t\t// Check if the required -Y sign flags are present\n\t\t\tif cmd.Command != \"sign\" {\n\t\t\t\treturn errors.New(\"must include '-Y sign' arguments\")\n\t\t\t}\n\n\t\t\t// The last argument is the buffer file\n\t\t\tcmd.BufferFile = args[len(args)-1]\n\n\t\t\treturn gitsshsigning.HandleGitSSHProgramCall(\n\t\t\t\tcmd.CertPath, cmd.Namespace, cmd.BufferFile, logger)\n\t\t},\n\t}\n\n\tgitSshSignatureCmd.Flags().StringVarP(&cmd.CertPath, \"file\", \"f\", \"\", \"Path to the private key\")\n\tgitSshSignatureCmd.Flags().StringVarP(&cmd.Namespace, \"namespace\", \"n\", \"\", \"Namespace\")\n\tgitSshSignatureCmd.Flags().StringVarP(&cmd.Command, \"command\", \"Y\", \"sign\", \"Command - should be 'sign'\")\n\n\treturn gitSshSignatureCmd\n}\n"
  },
  {
    "path": "cmd/agent/git_ssh_signature_helper.go",
    "content": "package agent\n\nimport (\n\t\"fmt\"\n\t\"os/user\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/gitsshsigning\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GitSSHSignatureHelperCmd struct {\n\t*flags.GlobalFlags\n\n\tCertPath string\n}\n\n// NewGitSSHSignatureHelperCmd creates a new git-ssh-signature-helper command\n// This agent command can be used to inject the Git SSH signature helper.\n//\n// This command is used to set up the environment for Git SSH signature verification by configuring\n// the necessary helper using a provided signing key path.\n//\n// Example usage:\n//\n//\tgit-ssh-signature-helper [signing-key-path]\n//\n// The signing key path is a required argument for this command. It should be what equal to what you would have set as user.signingkey git config.\nfunc NewGitSSHSignatureHelperCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GitSSHSignatureCmd{\n\t\tGlobalFlags: flags,\n\t}\n\n\tgitSshSignatureHelperCmd := &cobra.Command{\n\t\tUse:   \"git-ssh-signature-helper [signing-key-path]\",\n\t\tShort: \"used to inject git ssh signature helper\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tusr, err := user.Current()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif len(args) < 1 {\n\t\t\t\treturn fmt.Errorf(\"gitSigningKey argument is required\")\n\t\t\t}\n\t\t\tcmd.CertPath = args[0]\n\n\t\t\tlog := log.GetInstance()\n\t\t\terr = gitsshsigning.ConfigureHelper(usr.Username, cmd.CertPath, log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn gitSshSignatureHelperCmd\n}\n"
  },
  {
    "path": "cmd/agent/workspace/build.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// BuildCmd holds the cmd flags\ntype BuildCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n}\n\n// NewBuildCmd creates a new command\nfunc NewBuildCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &BuildCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tbuildCmd := &cobra.Command{\n\t\tUse:   \"build\",\n\t\tShort: \"Builds a devcontainer\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tbuildCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = buildCmd.MarkFlagRequired(\"workspace-info\")\n\treturn buildCmd\n}\n\n// Run runs the command logic\nfunc (cmd *BuildCmd) Run(ctx context.Context) error {\n\t// write workspace info\n\tshouldExit, workspaceInfo, err := agent.WriteWorkspaceInfoAndDeleteOld(cmd.WorkspaceInfo, func(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\t\treturn deleteWorkspace(ctx, workspaceInfo, log)\n\t}, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// make sure daemon does shut us down while we are doing things\n\tagent.CreateWorkspaceBusyFile(workspaceInfo.Origin)\n\tdefer agent.DeleteWorkspaceBusyFile(workspaceInfo.Origin)\n\n\t// initialize the workspace\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\t_, logger, credentialsDir, err := initWorkspace(cancelCtx, cancel, workspaceInfo, cmd.Debug, false)\n\tif err != nil {\n\t\treturn err\n\t} else if credentialsDir != \"\" {\n\t\tdefer func() {\n\t\t\t_ = os.RemoveAll(credentialsDir)\n\t\t}()\n\t}\n\n\trunner, err := CreateRunner(workspaceInfo, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if there is no platform specified, we use empty to let\n\t// the builder find out itself.\n\tplatforms := workspaceInfo.CLIOptions.Platforms\n\tif len(platforms) == 0 {\n\t\tplatforms = []string{\"\"}\n\t}\n\n\t// build and push images\n\tfor _, platform := range platforms {\n\t\t// build the image\n\t\timageName, err := runner.Build(ctx, provider2.BuildOptions{\n\t\t\tCLIOptions:    workspaceInfo.CLIOptions,\n\t\t\tRegistryCache: workspaceInfo.RegistryCache,\n\t\t\tPlatform:      platform,\n\t\t\tExportCache:   true,\n\t\t})\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Error building image: %v\", err)\n\t\t\treturn errors.Wrap(err, \"build\")\n\t\t}\n\n\t\tif workspaceInfo.CLIOptions.SkipPush {\n\t\t\tlogger.Donef(\"Successfully build image %s\", imageName)\n\t\t} else {\n\t\t\tlogger.Donef(\"Successfully build and pushed image %s\", imageName)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc deleteWorkspace(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\terr := removeContainer(ctx, workspaceInfo, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Removing container: %v\", err)\n\t}\n\n\t_ = os.RemoveAll(workspaceInfo.Origin)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/delete.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tagentdaemon \"github.com/loft-sh/devpod/pkg/daemon/agent\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DeleteCmd holds the cmd flags\ntype DeleteCmd struct {\n\t*flags.GlobalFlags\n\n\tContainer bool\n\tDaemon    bool\n\n\tWorkspaceInfo string\n}\n\n// NewDeleteCmd creates a new command\nfunc NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete\",\n\t\tShort: \"Cleans up a workspace on the remote server\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tdeleteCmd.Flags().BoolVar(&cmd.Container, \"container\", true, \"If enabled, cleans up the DevPod container\")\n\tdeleteCmd.Flags().BoolVar(&cmd.Daemon, \"daemon\", false, \"If enabled, cleans up the DevPod daemon\")\n\n\tdeleteCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = deleteCmd.MarkFlagRequired(\"workspace-info\")\n\treturn deleteCmd\n}\n\nfunc (cmd *DeleteCmd) Run(ctx context.Context) error {\n\t// get workspace\n\tshouldExit, workspaceInfo, err := agent.WorkspaceInfo(cmd.WorkspaceInfo, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing workspace info: %w\", err)\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// remove daemon\n\tif cmd.Daemon {\n\t\terr = removeDaemon(workspaceInfo, log.Default)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"remove daemon\")\n\t\t}\n\t}\n\n\t// cleanup docker container\n\tif cmd.Container {\n\t\terr = removeContainer(ctx, workspaceInfo, log.Default)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"remove container\")\n\t\t}\n\t}\n\n\t// delete workspace folder\n\t_ = os.RemoveAll(workspaceInfo.Origin)\n\treturn nil\n}\n\nfunc removeContainer(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\tlog.Debugf(\"Removing DevPod container from server...\")\n\trunner, err := CreateRunner(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif workspaceInfo.Workspace.Source.Container != \"\" {\n\t\tlog.Infof(\"Skipping container deletion, since it was not created by DevPod\")\n\t} else {\n\t\terr = runner.Delete(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Debugf(\"Successfully removed DevPod container from server\")\n\t}\n\n\treturn nil\n}\n\nfunc removeDaemon(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\tif len(workspaceInfo.Agent.Exec.Shutdown) == 0 {\n\t\treturn nil\n\t}\n\n\tlog.Debugf(\"Removing DevPod daemon from server...\")\n\terr := agentdaemon.RemoveDaemon()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"remove daemon\")\n\t}\n\tlog.Debugf(\"Successfully removed DevPod daemon from server\")\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/install_dotfiles.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// InstallDotfilesCmd holds the installDotfiles cmd flags\ntype InstallDotfilesCmd struct {\n\t*flags.GlobalFlags\n\n\tRepository            string\n\tInstallScript         string\n\tStrictHostKeyChecking bool\n}\n\n// NewInstallDotfilesCmd creates a new command\nfunc NewInstallDotfilesCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &InstallDotfilesCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tinstallDotfilesCmd := &cobra.Command{\n\t\tUse:   \"install-dotfiles\",\n\t\tShort: \"installs input dotfiles in the container\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tinstallDotfilesCmd.Flags().StringVar(&cmd.Repository, \"repository\", \"\", \"The dotfiles repository\")\n\tinstallDotfilesCmd.Flags().StringVar(&cmd.InstallScript, \"install-script\", \"\", \"The dotfiles install command to execute\")\n\tinstallDotfilesCmd.Flags().BoolVar(&cmd.StrictHostKeyChecking, \"strict-host-key-checking\", false, \"Set to enable strict host key checking for git cloning via SSH\")\n\treturn installDotfilesCmd\n}\n\n// Run runs the command logic\nfunc (cmd *InstallDotfilesCmd) Run(ctx context.Context) error {\n\tlogger := log.Default.ErrorStreamOnly()\n\ttargetDir := filepath.Join(os.Getenv(\"HOME\"), \"dotfiles\")\n\n\t_, err := os.Stat(targetDir)\n\tif err != nil {\n\t\tlogger.Infof(\"Cloning dotfiles %s\", cmd.Repository)\n\n\t\tgitInfo := git.NormalizeRepositoryGitInfo(cmd.Repository)\n\t\tif err := git.CloneRepository(ctx, gitInfo, targetDir, \"\", cmd.StrictHostKeyChecking, logger); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tlogger.Info(\"dotfiles already set up, skipping cloning\")\n\t}\n\n\tlogger.Debugf(\"Entering dotfiles directory\")\n\n\terr = os.Chdir(targetDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.InstallScript != \"\" {\n\t\tlogger.Infof(\"Executing install script %s\", cmd.InstallScript)\n\t\tcommand := \"./\" + strings.TrimPrefix(cmd.InstallScript, \"./\")\n\n\t\terr := ensureExecutable(command)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"failed to make install script %s executable\", command)\n\t\t}\n\n\t\tscriptCmd := exec.Command(command)\n\t\twriter := logger.Writer(logrus.InfoLevel, false)\n\t\tscriptCmd.Stdout = writer\n\t\tscriptCmd.Stderr = writer\n\n\t\treturn scriptCmd.Run()\n\t}\n\n\tlogger.Debugf(\"Install script not specified, trying known locations\")\n\n\treturn setupDotfiles(logger)\n}\n\nvar scriptLocations = []string{\n\t\"./install.sh\",\n\t\"./install\",\n\t\"./bootstrap.sh\",\n\t\"./bootstrap\",\n\t\"./script/bootstrap\",\n\t\"./setup.sh\",\n\t\"./setup\",\n\t\"./setup/setup\",\n}\n\nfunc setupDotfiles(logger log.Logger) error {\n\tfor _, command := range scriptLocations {\n\t\tlogger.Debugf(\"Trying executing %s\", command)\n\t\twriter := logger.Writer(logrus.InfoLevel, false)\n\n\t\terr := ensureExecutable(command)\n\t\tif err != nil {\n\t\t\tlogger.Infof(\"Failed to make install script %s executable: %v\", command, err)\n\t\t\tlogger.Debug(\"Trying next location\")\n\t\t\tcontinue\n\t\t}\n\n\t\tscriptCmd := exec.Command(command)\n\t\tscriptCmd.Stdout = writer\n\t\tscriptCmd.Stderr = writer\n\t\terr = scriptCmd.Run()\n\t\tif err != nil {\n\t\t\tlogger.Infof(\"Execution of %s was unsuccessful: %v\", command, err)\n\t\t\tlogger.Debug(\"Trying next location\")\n\n\t\t\tcontinue\n\t\t}\n\n\t\t// we successfully executed one of the commands, let's exit\n\t\treturn nil\n\t}\n\n\tlogger.Info(\"Finished script locations, trying to link the files\")\n\n\tfiles, err := os.ReadDir(\".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// link dotfiles in directory to home\n\tfor _, file := range files {\n\t\tif strings.HasPrefix(file.Name(), \".\") && !file.IsDir() {\n\t\t\tlogger.Debugf(\"linking %s in home\", file.Name())\n\n\t\t\t// remove existing symlink and relink\n\t\t\tif _, err := os.Lstat(filepath.Join(os.Getenv(\"HOME\"), file.Name())); err == nil {\n\t\t\t\tos.Remove(filepath.Join(os.Getenv(\"HOME\"), file.Name()))\n\t\t\t}\n\t\t\terr = os.Symlink(filepath.Join(pwd, file.Name()), filepath.Join(os.Getenv(\"HOME\"), file.Name()))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc ensureExecutable(path string) error {\n\tcheckCmd := exec.Command(\"test\", \"-f\", path)\n\terr := checkCmd.Run()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"install script %s not found\", path)\n\t}\n\n\tchmodCmd := exec.Command(\"chmod\", \"+x\", path)\n\terr = chmodCmd.Run()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to make install script %s executable\", path)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/logs.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// LogsCmd holds the cmd flags\ntype LogsCmd struct {\n\t*flags.GlobalFlags\n\n\tID string\n}\n\n// NewLogsCmd creates a new command\nfunc NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &LogsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"logs\",\n\t\tShort: \"Returns the workspace container logs\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tc.Flags().StringVar(&cmd.ID, \"id\", \"\", \"The workspace id\")\n\t_ = c.MarkFlagRequired(\"id\")\n\n\treturn c\n}\n\nfunc (cmd *LogsCmd) Run(ctx context.Context) error {\n\t// get workspace info\n\tshouldExit, workspaceInfo, err := agent.ReadAgentWorkspaceInfo(cmd.AgentDir, cmd.Context, cmd.ID, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\tlogger := log.Default.ErrorStreamOnly()\n\n\t// create new runner\n\trunner, err := devcontainer.NewRunner(agent.ContainerDevPodHelperLocation, agent.DefaultAgentDownloadURL(), workspaceInfo, logger)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create runner: %w\", err)\n\t}\n\n\t// write devcontainer logs to stdout\n\treturn runner.Logs(ctx, os.Stdout)\n}\n"
  },
  {
    "path": "cmd/agent/workspace/logs_daemon.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// LogsDaemonCmd holds the cmd flags\ntype LogsDaemonCmd struct {\n\t*flags.GlobalFlags\n\n\tID string\n}\n\n// NewLogsDaemonCmd creates a new command\nfunc NewLogsDaemonCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &LogsDaemonCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tlogsDaemonCmd := &cobra.Command{\n\t\tUse:   \"logs-daemon\",\n\t\tShort: \"Returns the daemon logs\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tlogsDaemonCmd.Flags().StringVar(&cmd.ID, \"id\", \"\", \"The workspace id\")\n\t_ = logsDaemonCmd.MarkFlagRequired(\"id\")\n\treturn logsDaemonCmd\n}\n\nfunc (cmd *LogsDaemonCmd) Run(ctx context.Context) error {\n\t// get workspace\n\tshouldExit, _, err := agent.ReadAgentWorkspaceInfo(cmd.AgentDir, cmd.Context, cmd.ID, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\tlogFolder, err := agent.GetAgentDaemonLogFolder(cmd.AgentDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.Open(filepath.Join(logFolder, \"agent-daemon.log\"))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"open agent-daemon.log\")\n\t}\n\tdefer f.Close()\n\n\t_, err = io.Copy(os.Stdout, f)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/agent/workspace/setup_gpg.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\t\"github.com/loft-sh/devpod/pkg/gpg\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SetupGPGCmd holds the setupGPG cmd flags\ntype SetupGPGCmd struct {\n\t*flags.GlobalFlags\n\n\tOwnerTrust string\n\tSocketPath string\n\tGitKey     string\n}\n\n// NewSetupGPGCmd creates a new command\nfunc NewSetupGPGCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetupGPGCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tsetupGPGCmd := &cobra.Command{\n\t\tUse:   \"setup-gpg\",\n\t\tShort: \"setups gpg-agent forwarding in the container\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), log.Default.ErrorStreamOnly())\n\t\t},\n\t}\n\tsetupGPGCmd.Flags().StringVar(&cmd.OwnerTrust, \"ownertrust\", \"\", \"GPG Owner trust to import in armor form\")\n\tsetupGPGCmd.Flags().StringVar(&cmd.SocketPath, \"socketpath\", \"\", \"path to the gpg socket forwarded\")\n\tsetupGPGCmd.Flags().StringVar(&cmd.GitKey, \"gitkey\", \"\", \"gpg key to use for git commit signing\")\n\treturn setupGPGCmd\n}\n\n// will forward a local gpg-agent into the remote container\n// this works by\n//\n// - stopping remote gpg-agent and removing the sockets\n// - exporting local public keys and owner trust\n// - importing those into the container\n// - ensuring the gpg-agent is stopped in the container\n// - starting a reverse-tunnel of the local unix socket to remote\n// - ensuring paths and permissions are correctly set in the remote\nfunc (cmd *SetupGPGCmd) Run(ctx context.Context, log log.Logger) error {\n\tlog.Debugf(\"Initializing gpg-agent forwarding\")\n\n\tlog.Debugf(\"Fetching public key\")\n\trawPublicKeys, err := getPublicKeys(log)\n\tif err != nil {\n\t\tlog.Errorf(\"Fetch public key: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Decoding public key\")\n\tpublicKey, err := base64.StdEncoding.DecodeString(rawPublicKeys)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Decoding input owner trust\")\n\townerTrust, err := base64.StdEncoding.DecodeString(cmd.OwnerTrust)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgpgConf := gpg.GPGConf{\n\t\tPublicKey:  publicKey,\n\t\tOwnerTrust: ownerTrust,\n\t\tSocketPath: cmd.SocketPath,\n\t\tGitKey:     cmd.GitKey,\n\t}\n\n\tlog.Debugf(\"Stopping container gpg-agent\")\n\terr = gpgConf.StopGpgAgent()\n\tif err != nil {\n\t\tlog.Errorf(\"stop container gpg-agent: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Importing gpg public key in container\")\n\terr = gpgConf.ImportGpgKey()\n\tif err != nil {\n\t\tlog.Errorf(\"Import gpg public key in container: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Importing gpg owner trust in container\")\n\terr = gpgConf.ImportOwnerTrust()\n\tif err != nil {\n\t\tlog.Errorf(\"Import gpg owner trust in container: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Ensuring paths existence and permissions\")\n\terr = gpgConf.SetupRemoteSocketDirTree()\n\tif err != nil {\n\t\tlog.Errorf(\"Ensure paths existence and permissions: %v\", err)\n\t\treturn err\n\t}\n\n\t// Now we again kill the agent and remove the socket to really be sure every\n\t// thing is clean\n\tlog.Debugf(\"Ensure stopping container gpg-agent\")\n\terr = gpgConf.StopGpgAgent()\n\tif err != nil {\n\t\tlog.Errorf(\"Ensure stopping container gpg-agent: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Setup local gnupg socket links\")\n\terr = gpgConf.SetupRemoteSocketLink()\n\tif err != nil {\n\t\tlog.Errorf(\"Setup local gnupg socket links: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Setup gpg.conf\")\n\terr = gpgConf.SetupGpgConf()\n\tif err != nil {\n\t\tlog.Errorf(\"Setup gpg.conf: %v\", err)\n\t\treturn err\n\t}\n\n\tif gpgConf.GitKey != \"\" {\n\t\tlog.Debugf(\"Setup git signing key\")\n\t\terr = gitcredentials.SetupGpgGitKey(gpgConf.GitKey)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Setup git signing key: %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getPublicKeys(log log.Logger) (string, error) {\n\tport, err := credentials.GetPort()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get port: %w\", err)\n\t}\n\n\tout, err := credentials.PostWithRetry(port, \"gpg-public-keys\", nil, log)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get public gpg keys: %w\", err)\n\t}\n\n\treturn string(out), nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/status.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StatusCmd holds the cmd flags\ntype StatusCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n}\n\n// NewStatusCmd creates a new command\nfunc NewStatusCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StatusCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstatusCmd := &cobra.Command{\n\t\tUse:   \"status\",\n\t\tShort: \"Print the status of a remote container\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background(), log.Default.ErrorStreamOnly())\n\t\t},\n\t}\n\tstatusCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = statusCmd.MarkFlagRequired(\"workspace-info\")\n\treturn statusCmd\n}\n\nfunc (cmd *StatusCmd) Run(ctx context.Context, log log.Logger) error {\n\t// get workspace\n\tshouldExit, workspaceInfo, err := agent.WorkspaceInfo(cmd.WorkspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// create runner\n\trunner, err := CreateRunner(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// find dev container\n\tcontainerDetails, err := runner.Find(ctx)\n\tif err != nil {\n\t\treturn err\n\t} else if containerDetails == nil {\n\t\tfmt.Print(client.StatusNotFound)\n\t\treturn nil\n\t}\n\n\t// is running?\n\tif strings.ToLower(containerDetails.State.Status) == \"running\" {\n\t\tfmt.Print(client.StatusRunning)\n\t\treturn nil\n\t} else if strings.ToLower(containerDetails.State.Status) == \"exited\" {\n\t\tfmt.Print(client.StatusStopped)\n\t\treturn nil\n\t}\n\n\tfmt.Print(client.StatusBusy)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/stop.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StopCmd holds the cmd flags\ntype StopCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n}\n\n// NewStopCmd creates a new command\nfunc NewStopCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StopCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstopCmd := &cobra.Command{\n\t\tUse:   \"stop\",\n\t\tShort: \"Stops a workspace on the remote server\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tstopCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = stopCmd.MarkFlagRequired(\"workspace-info\")\n\treturn stopCmd\n}\n\nfunc (cmd *StopCmd) Run(ctx context.Context) error {\n\t// get workspace\n\tshouldExit, workspaceInfo, err := agent.WriteWorkspaceInfo(cmd.WorkspaceInfo, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing workspace info: %w\", err)\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// stop docker container\n\terr = stopContainer(ctx, workspaceInfo, log.Default)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stop container\")\n\t}\n\n\treturn nil\n}\n\nfunc stopContainer(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\tlog.Debugf(\"Stopping DevPod container...\")\n\trunner, err := CreateRunner(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = runner.Stop(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Debugf(\"Successfully stopped DevPod container\")\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/up.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/binaries\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\tagentdaemon \"github.com/loft-sh/devpod/pkg/daemon/agent\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/crane\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/devpod/scripts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpCmd holds the up cmd flags\ntype UpCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n}\n\n// NewUpCmd creates a new command\nfunc NewUpCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tupCmd := &cobra.Command{\n\t\tUse:   \"up\",\n\t\tShort: \"Starts a new devcontainer\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tupCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = upCmd.MarkFlagRequired(\"workspace-info\")\n\treturn upCmd\n}\n\n// Run runs the command logic\nfunc (cmd *UpCmd) Run(ctx context.Context) error {\n\t// get workspace\n\tshouldExit, workspaceInfo, err := agent.WriteWorkspaceInfoAndDeleteOld(cmd.WorkspaceInfo, func(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\t\treturn deleteWorkspace(ctx, workspaceInfo, log)\n\t}, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing workspace info: %w\", err)\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\t// make sure daemon doesn't shut us down while we are doing things\n\tif !workspaceInfo.CLIOptions.Platform.Enabled {\n\t\tagent.CreateWorkspaceBusyFile(workspaceInfo.Origin)\n\t\tdefer agent.DeleteWorkspaceBusyFile(workspaceInfo.Origin)\n\t}\n\n\t// initialize the workspace\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\ttunnelClient, logger, credentialsDir, err := initWorkspace(cancelCtx, cancel, workspaceInfo, cmd.Debug, !workspaceInfo.CLIOptions.Platform.Enabled && !workspaceInfo.CLIOptions.DisableDaemon)\n\tif err != nil {\n\t\terr1 := clientimplementation.DeleteWorkspaceFolder(workspaceInfo.Workspace.Context, workspaceInfo.Workspace.ID, workspaceInfo.Workspace.SSHConfigPath, logger)\n\t\tif err1 != nil {\n\t\t\treturn errors.Wrap(err, err1.Error())\n\t\t}\n\t\treturn err\n\t} else if credentialsDir != \"\" {\n\t\tdefer func() {\n\t\t\t_ = os.RemoveAll(credentialsDir)\n\t\t}()\n\t}\n\n\t// start up\n\terr = cmd.up(ctx, workspaceInfo, tunnelClient, logger)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"devcontainer up\")\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *UpCmd) up(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, tunnelClient tunnel.TunnelClient, logger log.Logger) error {\n\t// create devcontainer\n\tresult, err := cmd.devPodUp(ctx, workspaceInfo, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// send result\n\tout, err := json.Marshal(result)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = tunnelClient.SendResult(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"send result\")\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *UpCmd) devPodUp(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (*config2.Result, error) {\n\trunner, err := CreateRunner(workspaceInfo, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// start the devcontainer\n\tresult, err := runner.Up(ctx, devcontainer.UpOptions{\n\t\tCLIOptions:    workspaceInfo.CLIOptions,\n\t\tRegistryCache: workspaceInfo.RegistryCache,\n\t}, workspaceInfo.InjectTimeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}\n\nfunc CreateRunner(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (devcontainer.Runner, error) {\n\treturn devcontainer.NewRunner(agent.ContainerDevPodHelperLocation, agent.DefaultAgentDownloadURL(), workspaceInfo, log)\n}\n\nfunc InitContentFolder(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (bool, error) {\n\t// check if workspace content folder exists\n\t_, err := os.Stat(workspaceInfo.ContentFolder)\n\tif err == nil {\n\t\tlog.Debugf(\"Workspace Folder already exists %s\", workspaceInfo.ContentFolder)\n\t\treturn true, nil\n\t}\n\n\t// make content dir\n\tlog.Debugf(\"Create content folder %s\", workspaceInfo.ContentFolder)\n\terr = os.MkdirAll(workspaceInfo.ContentFolder, 0o777)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"make workspace folder\")\n\t}\n\n\t// download provider\n\tbinariesDir, err := agent.GetAgentBinariesDir(workspaceInfo.Agent.DataPath, workspaceInfo.Workspace.Context, workspaceInfo.Workspace.ID)\n\tif err != nil {\n\t\t_ = os.RemoveAll(workspaceInfo.ContentFolder)\n\t\treturn false, fmt.Errorf(\"error getting workspace %s binaries dir: %w\", workspaceInfo.Workspace.ID, err)\n\t}\n\n\t// download binaries\n\t_, err = binaries.DownloadBinaries(workspaceInfo.Agent.Binaries, binariesDir, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(workspaceInfo.ContentFolder)\n\t\treturn false, fmt.Errorf(\"error downloading workspace %s binaries: %w\", workspaceInfo.Workspace.ID, err)\n\t}\n\n\t// if workspace was already executed, we skip this part\n\tif workspaceInfo.LastDevContainerConfig != nil {\n\t\t// make sure the devcontainer.json exists\n\t\terr = ensureLastDevContainerJson(workspaceInfo)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Ensure devcontainer.json: %v\", err)\n\t\t}\n\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}\n\nfunc initWorkspace(ctx context.Context, cancel context.CancelFunc, workspaceInfo *provider2.AgentWorkspaceInfo, debug, shouldInstallDaemon bool) (tunnel.TunnelClient, log.Logger, string, error) {\n\t// create a grpc client\n\ttunnelClient, err := tunnelserver.NewTunnelClient(os.Stdin, os.Stdout, true, 0)\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"error creating tunnel client: %w\", err)\n\t}\n\n\t// create debug logger\n\tlogger := tunnelserver.NewTunnelLogger(ctx, tunnelClient, debug)\n\tlogger.Debugf(\"Created logger\")\n\n\t// this message serves as a ping to the client\n\t_, err = tunnelClient.Ping(ctx, &tunnel.Empty{})\n\tif err != nil {\n\t\treturn nil, nil, \"\", errors.Wrap(err, \"ping client\")\n\t}\n\n\t// get docker credentials\n\tdockerCredentialsDir, gitCredentialsHelper, err := configureCredentials(ctx, cancel, workspaceInfo, tunnelClient, logger)\n\tif err != nil {\n\t\tlogger.Errorf(\"Error retrieving docker / git credentials: %v\", err)\n\t}\n\n\t// install docker in background\n\terrChan := make(chan error, 2)\n\tgo func() {\n\t\tif !workspaceInfo.Agent.IsDockerDriver() || workspaceInfo.Agent.Docker.Install == \"false\" {\n\t\t\terrChan <- nil\n\t\t} else {\n\t\t\terrChan <- installDocker(logger)\n\t\t}\n\t}()\n\n\t// prepare workspace\n\terr = prepareWorkspace(ctx, workspaceInfo, tunnelClient, gitCredentialsHelper, logger)\n\tif err != nil {\n\t\treturn nil, logger, \"\", err\n\t}\n\n\t// install daemon\n\tif shouldInstallDaemon {\n\t\terr = installDaemon(workspaceInfo, logger)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Install DevPod Daemon: %v\", err)\n\t\t}\n\t}\n\n\t// wait until docker is installed before configuring docker daemon\n\terr = <-errChan\n\tif err != nil {\n\t\treturn nil, nil, \"\", errors.Wrap(err, \"install docker\")\n\t}\n\n\t// If we are provisioning the machine, ensure the daemon has required options\n\tlocal, err := workspaceInfo.Agent.Local.Bool()\n\tif workspaceInfo.Agent.IsDockerDriver() && err != nil && !local {\n\t\terrChan <- configureDockerDaemon(ctx, logger)\n\t} else {\n\t\tlogger.Debug(\"Skipping configuring docker daemon\")\n\t\terrChan <- nil\n\t}\n\n\t// wait until docker daemon is configured\n\terr = <-errChan\n\tif err != nil {\n\t\tlogger.Warn(\"Could not find docker daemon config file, if using the registry cache, please ensure the daemon is configured with containerd-snapshotter=true\")\n\t\tlogger.Warn(\"More info at https://docs.docker.com/engine/storage/containerd/\")\n\t}\n\n\treturn tunnelClient, logger, dockerCredentialsDir, nil\n}\n\nfunc prepareWorkspace(ctx context.Context, workspaceInfo *provider2.AgentWorkspaceInfo, client tunnel.TunnelClient, helper string, log log.Logger) error {\n\t// change content folder if source is local folder in proxy mode\n\t// to a folder that's known ahead of time inside of DEVPOD_HOME\n\tif workspaceInfo.CLIOptions.Platform.Enabled && workspaceInfo.Workspace.Source.LocalFolder != \"\" {\n\t\tworkspaceInfo.ContentFolder = agent.GetAgentWorkspaceContentDir(workspaceInfo.Origin)\n\t}\n\n\t// make sure content folder exists\n\texists, err := InitContentFolder(workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t} else if exists && !workspaceInfo.CLIOptions.Recreate {\n\t\tlog.Debugf(\"Workspace exists, skip downloading\")\n\t\treturn nil\n\t}\n\n\t// check what type of workspace this is\n\tif workspaceInfo.Workspace.Source.GitRepository != \"\" {\n\t\tif workspaceInfo.CLIOptions.Reset {\n\t\t\tlog.Info(\"Resetting git based workspace, removing old content folder\")\n\t\t\terr = os.RemoveAll(workspaceInfo.ContentFolder)\n\t\t\tif err != nil {\n\t\t\t\tlog.Warnf(\"Failed to remove workspace folder, still proceeding: %v\", err)\n\t\t\t}\n\t\t}\n\n\t\tif workspaceInfo.CLIOptions.Recreate && !workspaceInfo.CLIOptions.Reset && exists {\n\t\t\tlog.Info(\"Rebuilding without resetting a git based workspace, keeping old content folder\")\n\t\t\treturn nil\n\t\t}\n\n\t\tif crane.ShouldUse(&workspaceInfo.CLIOptions) {\n\t\t\tlog.Infof(\"Pulling devcontainer spec from %v\", workspaceInfo.CLIOptions.Platform.EnvironmentTemplate)\n\t\t\treturn nil\n\t\t}\n\n\t\treturn agent.CloneRepositoryForWorkspace(ctx,\n\t\t\t&workspaceInfo.Workspace.Source,\n\t\t\t&workspaceInfo.Agent,\n\t\t\tworkspaceInfo.ContentFolder,\n\t\t\thelper,\n\t\t\tworkspaceInfo.CLIOptions,\n\t\t\tfalse,\n\t\t\tlog,\n\t\t)\n\t}\n\n\tif workspaceInfo.Workspace.Source.LocalFolder != \"\" {\n\t\t// if we're not sending this to a remote machine, we're already done\n\t\tif workspaceInfo.ContentFolder == workspaceInfo.Workspace.Source.LocalFolder {\n\t\t\tlog.Debugf(\"Local folder %s with local provider; skip downloading\", workspaceInfo.ContentFolder)\n\t\t\treturn nil\n\t\t}\n\n\t\tlog.Debugf(\"Download Local Folder %s\", workspaceInfo.ContentFolder)\n\t\treturn downloadLocalFolder(ctx, workspaceInfo.ContentFolder, client, log)\n\t}\n\n\tif workspaceInfo.Workspace.Source.Image != \"\" {\n\t\tlog.Debugf(\"Prepare Image\")\n\t\treturn prepareImage(workspaceInfo.ContentFolder, workspaceInfo.Workspace.Source.Image)\n\t}\n\n\tif workspaceInfo.Workspace.Source.Container != \"\" {\n\t\tlog.Debugf(\"Workspace is a container, nothing to do\")\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"either workspace repository, image, container or local-folder is required\")\n}\n\nfunc ensureLastDevContainerJson(workspaceInfo *provider2.AgentWorkspaceInfo) error {\n\tfilePath := filepath.Join(workspaceInfo.ContentFolder, filepath.FromSlash(workspaceInfo.LastDevContainerConfig.Path))\n\t_, err := os.Stat(filePath)\n\tif os.IsNotExist(err) {\n\t\terr = os.MkdirAll(filepath.Dir(filePath), 0o755)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create %s: %w\", filepath.Dir(filePath), err)\n\t\t}\n\n\t\traw, err := json.Marshal(workspaceInfo.LastDevContainerConfig.Config)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"marshal devcontainer.json: %w\", err)\n\t\t}\n\n\t\terr = os.WriteFile(filePath, raw, 0o600)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"write %s: %w\", filePath, err)\n\t\t}\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"error stating %s: %w\", filePath, err)\n\t}\n\n\treturn nil\n}\n\nfunc configureCredentials(ctx context.Context, cancel context.CancelFunc, workspaceInfo *provider2.AgentWorkspaceInfo, client tunnel.TunnelClient, log log.Logger) (string, string, error) {\n\tif workspaceInfo.Agent.InjectDockerCredentials != \"true\" && workspaceInfo.Agent.InjectGitCredentials != \"true\" {\n\t\treturn \"\", \"\", nil\n\t}\n\n\tserverPort, err := credentials.StartCredentialsServer(ctx, cancel, client, log)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tif workspaceInfo.Origin == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"workspace folder is not set\")\n\t}\n\n\tdockerCredentials := \"\"\n\tif workspaceInfo.Agent.InjectDockerCredentials == \"true\" {\n\t\tdockerCredentials, err = dockercredentials.ConfigureCredentialsMachine(workspaceInfo.Origin, serverPort, log)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t}\n\n\tgitCredentials := \"\"\n\tif workspaceInfo.Agent.InjectGitCredentials == \"true\" {\n\t\tgitCredentials = fmt.Sprintf(\"!'%s' agent git-credentials --port %d\", binaryPath, serverPort)\n\t\t_ = os.Setenv(\"DEVPOD_GIT_HELPER_PORT\", strconv.Itoa(serverPort))\n\t}\n\n\treturn dockerCredentials, gitCredentials, nil\n}\n\nfunc installDaemon(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error {\n\tif len(workspaceInfo.Agent.Exec.Shutdown) == 0 {\n\t\treturn nil\n\t}\n\n\tlog.Debugf(\"Installing DevPod daemon into server...\")\n\terr := agentdaemon.InstallDaemon(workspaceInfo.Agent.DataPath, workspaceInfo.CLIOptions.DaemonInterval, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"install daemon\")\n\t}\n\n\treturn nil\n}\n\nfunc downloadLocalFolder(ctx context.Context, workspaceDir string, client tunnel.TunnelClient, log log.Logger) error {\n\tlog.Infof(\"Upload folder to server\")\n\tstream, err := client.StreamWorkspace(ctx, &tunnel.Empty{})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read workspace\")\n\t}\n\n\terr = extract.Extract(tunnelserver.NewStreamReader(stream, log), workspaceDir)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"extract local folder\")\n\t}\n\n\treturn nil\n}\n\nfunc prepareImage(workspaceDir, image string) error {\n\t// create a .devcontainer.json with the image\n\terr := os.WriteFile(filepath.Join(workspaceDir, \".devcontainer.json\"), []byte(`{\n  \"image\": \"`+image+`\"\n}`), 0o600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc installDocker(log log.Logger) (err error) {\n\tif !command.Exists(\"docker\") {\n\t\twriter := log.Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\n\t\tlog.Debug(\"Installing Docker...\")\n\n\t\tshellCommand := exec.Command(\"sh\", \"-c\", scripts.InstallDocker)\n\t\tshellCommand.Stdout = writer\n\t\tshellCommand.Stderr = writer\n\t\terr = shellCommand.Run()\n\t}\n\treturn err\n}\n\nfunc configureDockerDaemon(ctx context.Context, log log.Logger) (err error) {\n\tlog.Info(\"Configuring docker daemon ...\")\n\t// Enable image snapshotter in the dameon\n\tvar daemonConfig = []byte(`{\n\t\t\"features\": {\n\t\t\t\"containerd-snapshotter\": true\n\t\t}\n\t}`)\n\t// Check rootless docker\n\thomeDir, err := util.UserHomeDir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err = os.Stat(fmt.Sprintf(\"%s/.config/docker\", homeDir)); !errors.Is(err, os.ErrNotExist) {\n\t\terr = os.WriteFile(fmt.Sprintf(\"%s/.config/docker/daemon.json\", homeDir), daemonConfig, 0644)\n\t}\n\t// otherwise assume default\n\tif err != nil {\n\t\tif err = os.WriteFile(\"/etc/docker/daemon.json\", daemonConfig, 0644); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// reload docker daemon\n\treturn exec.CommandContext(ctx, \"pkill\", \"-HUP\", \"dockerd\").Run()\n}\n"
  },
  {
    "path": "cmd/agent/workspace/update_config.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpdateConfigCmd holds the cmd flags\ntype UpdateConfigCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceInfo string\n}\n\n// NewUpdateConfigCmd creates a new command\nfunc NewUpdateConfigCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpdateConfigCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tupdateConfigCmd := &cobra.Command{\n\t\tUse:   \"update-config\",\n\t\tShort: \"Updates the workspace config\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\tupdateConfigCmd.Flags().StringVar(&cmd.WorkspaceInfo, \"workspace-info\", \"\", \"The workspace info\")\n\t_ = updateConfigCmd.MarkFlagRequired(\"workspace-info\")\n\treturn updateConfigCmd\n}\n\nfunc (cmd *UpdateConfigCmd) Run(ctx context.Context) error {\n\t// write workspace info\n\tshouldExit, _, err := agent.WriteWorkspaceInfo(cmd.WorkspaceInfo, log.Default)\n\tif err != nil {\n\t\treturn err\n\t} else if shouldExit {\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/agent/workspace/workspace.go",
    "content": "package workspace\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewWorkspaceCmd returns a new command\nfunc NewWorkspaceCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tworkspaceCmd := &cobra.Command{\n\t\tUse:   \"workspace\",\n\t\tShort: \"Workspace commands\",\n\t}\n\n\tworkspaceCmd.AddCommand(NewUpCmd(flags))\n\tworkspaceCmd.AddCommand(NewDeleteCmd(flags))\n\tworkspaceCmd.AddCommand(NewStopCmd(flags))\n\tworkspaceCmd.AddCommand(NewStatusCmd(flags))\n\tworkspaceCmd.AddCommand(NewUpdateConfigCmd(flags))\n\tworkspaceCmd.AddCommand(NewBuildCmd(flags))\n\tworkspaceCmd.AddCommand(NewLogsDaemonCmd(flags))\n\tworkspaceCmd.AddCommand(NewInstallDotfilesCmd(flags))\n\tworkspaceCmd.AddCommand(NewSetupGPGCmd(flags))\n\tworkspaceCmd.AddCommand(NewLogsCmd(flags))\n\treturn workspaceCmd\n}\n"
  },
  {
    "path": "cmd/build.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// BuildCmd holds the cmd flags\ntype BuildCmd struct {\n\t*flags.GlobalFlags\n\tprovider.CLIOptions\n\n\tProviderOptions []string\n\n\tSkipDelete bool\n\tMachine    string\n}\n\n// NewBuildCmd creates a new command\nfunc NewBuildCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &BuildCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tbuildCmd := &cobra.Command{\n\t\tUse:   \"build [flags] [workspace-path|workspace-name]\",\n\t\tShort: \"Builds a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tctx := cobraCmd.Context()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// check permissions\n\t\t\tif !cmd.SkipPush && cmd.Repository != \"\" {\n\t\t\t\terr = image.CheckPushPermissions(cmd.Repository)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"cannot push to %s, please make sure you have push permissions to repository %s\", cmd.Repository, cmd.Repository)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// validate tags\n\t\t\tif len(cmd.Tag) > 0 {\n\t\t\t\tif err := image.ValidateTags(cmd.Tag); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"cannot build image, %w\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif devPodConfig.ContextOption(config.ContextOptionSSHStrictHostKeyChecking) == \"true\" {\n\t\t\t\tcmd.StrictHostKeyChecking = true\n\t\t\t}\n\n\t\t\t// create a temporary workspace\n\t\t\texists := workspace2.Exists(ctx, devPodConfig, args, \"\", cmd.Owner, log.Default)\n\t\t\tsshConfigFile, err := os.CreateTemp(\"\", \"devpodssh.config\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tsshConfigPath := sshConfigFile.Name()\n\t\t\t// defer removal of temporary ssh config file\n\t\t\tdefer os.Remove(sshConfigPath)\n\n\t\t\tbaseWorkspaceClient, err := workspace2.Resolve(\n\t\t\t\tctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\t\"\",\n\t\t\t\tnil,\n\t\t\t\targs,\n\t\t\t\t\"\",\n\t\t\t\tcmd.Machine,\n\t\t\t\tcmd.ProviderOptions,\n\t\t\t\tfalse,\n\t\t\t\tcmd.DevContainerImage,\n\t\t\t\tcmd.DevContainerPath,\n\t\t\t\tsshConfigPath,\n\t\t\t\tnil,\n\t\t\t\tcmd.UID,\n\t\t\t\tfalse,\n\t\t\t\tcmd.Owner,\n\t\t\t\tlog.Default,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// delete workspace if we have created it\n\t\t\tif exists == \"\" && !cmd.SkipDelete {\n\t\t\t\tdefer func() {\n\t\t\t\t\terr = baseWorkspaceClient.Delete(ctx, client.DeleteOptions{Force: true})\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Default.Errorf(\"Error deleting workspace: %v\", err)\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t}\n\n\t\t\t// check if regular workspace client\n\t\t\tworkspaceClient, ok := baseWorkspaceClient.(client.WorkspaceClient)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"building is currently not supported for proxy providers\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, workspaceClient)\n\t\t},\n\t}\n\n\tbuildCmd.Flags().StringVar(&cmd.DevContainerImage, \"devcontainer-image\", \"\", \"The container image to use, this will override the devcontainer.json value in the project\")\n\tbuildCmd.Flags().StringVar(&cmd.DevContainerPath, \"devcontainer-path\", \"\", \"The path to the devcontainer.json relative to the project\")\n\tbuildCmd.Flags().StringSliceVar(&cmd.ProviderOptions, \"provider-option\", []string{}, \"Provider option in the form KEY=VALUE\")\n\tbuildCmd.Flags().BoolVar(&cmd.SkipDelete, \"skip-delete\", false, \"If true will not delete the workspace after building it\")\n\tbuildCmd.Flags().StringVar(&cmd.Machine, \"machine\", \"\", \"The machine to use for this workspace. The machine needs to exist beforehand or the command will fail. If the workspace already exists, this option has no effect\")\n\tbuildCmd.Flags().StringVar(&cmd.Repository, \"repository\", \"\", \"The repository to push to\")\n\tbuildCmd.Flags().StringSliceVar(&cmd.Tag, \"tag\", []string{}, \"Image Tag(s) in the form of a comma separated list --tag latest,arm64 or multiple flags --tag latest --tag arm64\")\n\tbuildCmd.Flags().StringSliceVar(&cmd.Platforms, \"platform\", []string{}, \"Set target platform for build\")\n\tbuildCmd.Flags().BoolVar(&cmd.SkipPush, \"skip-push\", false, \"If true will not push the image to the repository, useful for testing\")\n\tbuildCmd.Flags().Var(&cmd.GitCloneStrategy, \"git-clone-strategy\", \"The git clone strategy DevPod uses to checkout git based workspaces. Can be full (default), blobless, treeless or shallow\")\n\tbuildCmd.Flags().BoolVar(&cmd.GitCloneRecursiveSubmodules, \"git-clone-recursive-submodules\", false, \"If true will clone git submodule repositories recursively\")\n\n\t// TESTING\n\tbuildCmd.Flags().BoolVar(&cmd.ForceBuild, \"force-build\", false, \"TESTING ONLY\")\n\tbuildCmd.Flags().BoolVar(&cmd.ForceInternalBuildKit, \"force-internal-buildkit\", false, \"TESTING ONLY\")\n\t_ = buildCmd.Flags().MarkHidden(\"force-build\")\n\t_ = buildCmd.Flags().MarkHidden(\"force-internal-buildkit\")\n\treturn buildCmd\n}\n\nfunc (cmd *BuildCmd) Run(ctx context.Context, client client.WorkspaceClient) error {\n\t// build workspace\n\terr := cmd.build(ctx, client, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *BuildCmd) build(ctx context.Context, workspaceClient client.WorkspaceClient, log log.Logger) error {\n\terr := workspaceClient.Lock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer workspaceClient.Unlock()\n\n\terr = startWait(ctx, workspaceClient, true, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Infof(\"Building devcontainer...\")\n\tdefer log.Debugf(\"Done building devcontainer\")\n\t_, err = buildAgentClient(ctx, workspaceClient, cmd.CLIOptions, \"build\", log)\n\treturn err\n}\n\nfunc buildAgentClient(ctx context.Context, workspaceClient client.WorkspaceClient, cliOptions provider.CLIOptions, agentCommand string, log log.Logger, options ...tunnelserver.Option) (*config2.Result, error) {\n\t// compress info\n\tworkspaceInfo, wInfo, err := workspaceClient.AgentInfo(cliOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create container etc.\n\tcommand := fmt.Sprintf(\"'%s' agent workspace %s --workspace-info '%s'\", workspaceClient.AgentPath(), agentCommand, workspaceInfo)\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tcommand += \" --debug\"\n\t}\n\n\t// create pipes\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\n\t// start machine on stdio\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tdefer log.Debugf(\"Done executing up command\")\n\t\tdefer cancel()\n\n\t\twriter := log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\n\t\terrChan <- agent.InjectAgentAndExecute(\n\t\t\tcancelCtx,\n\t\t\tfunc(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\t\treturn workspaceClient.Command(ctx, client.CommandOptions{\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tStdin:   stdin,\n\t\t\t\t\tStdout:  stdout,\n\t\t\t\t\tStderr:  stderr,\n\t\t\t\t})\n\t\t\t},\n\t\t\tworkspaceClient.AgentLocal(),\n\t\t\tworkspaceClient.AgentPath(),\n\t\t\tworkspaceClient.AgentURL(),\n\t\t\ttrue,\n\t\t\tcommand,\n\t\t\tstdinReader,\n\t\t\tstdoutWriter,\n\t\t\twriter,\n\t\t\tlog.ErrorStreamOnly(),\n\t\t\twInfo.InjectTimeout)\n\t}()\n\n\t// create container etc.\n\tresult, err := tunnelserver.RunUpServer(\n\t\tcancelCtx,\n\t\tstdoutReader,\n\t\tstdinWriter,\n\t\tworkspaceClient.AgentInjectGitCredentials(cliOptions),\n\t\tworkspaceClient.AgentInjectDockerCredentials(cliOptions),\n\t\tworkspaceClient.WorkspaceConfig(),\n\t\tlog,\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"run tunnel machine\")\n\t}\n\n\t// wait until command finished\n\treturn result, <-errChan\n}\n"
  },
  {
    "path": "cmd/completion/suggestions.go",
    "content": "package completion\n\nimport (\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc RegisterFlagCompletionFuns(rootCmd *cobra.Command, globalFlags *flags.GlobalFlags) error {\n\tif err := rootCmd.RegisterFlagCompletionFunc(\"provider\", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn GetProviderSuggestions(rootCmd, globalFlags.Context, globalFlags.Provider, args, toComplete, globalFlags.Owner, log.Default)\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\tif err := rootCmd.RegisterFlagCompletionFunc(\"context\", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn GetContextSuggestions(rootCmd, globalFlags.Context, globalFlags.Provider, args, toComplete, globalFlags.Owner, log.Default)\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc GetWorkspaceSuggestions(rootCmd *cobra.Command, context, provider string, args []string, toComplete string, owner platform.OwnerFilter, logger log.Logger) ([]string, cobra.ShellCompDirective) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tworkspaces, err := workspace.List(rootCmd.Context(), devPodConfig, false, owner, logger)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tvar suggestions []string\n\tfor _, ws := range workspaces {\n\t\tif strings.HasPrefix(ws.ID, toComplete) {\n\t\t\tsuggestions = append(suggestions, ws.ID)\n\t\t}\n\t}\n\treturn suggestions, cobra.ShellCompDirectiveNoFileComp\n}\n\nfunc GetProviderSuggestions(rootCmd *cobra.Command, context, provider string, args []string, toComplete string, owner platform.OwnerFilter, logger log.Logger) ([]string, cobra.ShellCompDirective) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tproviders, err := workspace.LoadAllProviders(devPodConfig, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tvar suggestions []string\n\tfor _, provider := range providers {\n\t\tif strings.HasPrefix(provider.Config.Name, toComplete) {\n\t\t\tsuggestions = append(suggestions, provider.Config.Name)\n\t\t}\n\t}\n\treturn suggestions, cobra.ShellCompDirectiveNoFileComp\n}\n\nfunc GetContextSuggestions(rootCmd *cobra.Command, context, provider string, args []string, toComplete string, owner platform.OwnerFilter, logger log.Logger) ([]string, cobra.ShellCompDirective) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tvar suggestions []string\n\tfor contextName, _ := range devPodConfig.Contexts {\n\t\tif strings.HasPrefix(contextName, toComplete) {\n\t\t\tsuggestions = append(suggestions, contextName)\n\t\t}\n\t}\n\n\treturn suggestions, cobra.ShellCompDirectiveNoFileComp\n}\n"
  },
  {
    "path": "cmd/context/context.go",
    "content": "package context\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewContextCmd returns a new command\nfunc NewContextCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcontextCmd := &cobra.Command{\n\t\tUse:   \"context\",\n\t\tShort: \"DevPod Context commands\",\n\t}\n\n\tcontextCmd.AddCommand(NewCreateCmd(flags))\n\tcontextCmd.AddCommand(NewDeleteCmd(flags))\n\tcontextCmd.AddCommand(NewUseCmd(flags))\n\tcontextCmd.AddCommand(NewOptionsCmd(flags))\n\tcontextCmd.AddCommand(NewSetOptionsCmd(flags))\n\tcontextCmd.AddCommand(NewListCmd(flags))\n\treturn contextCmd\n}\n"
  },
  {
    "path": "cmd/context/create.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// CreateCmd holds the create cmd flags\ntype CreateCmd struct {\n\tflags.GlobalFlags\n\n\tOptions []string\n}\n\n// NewCreateCmd creates a new command\nfunc NewCreateCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tcreateCmd := &cobra.Command{\n\t\tUse:   \"create\",\n\t\tShort: \"Create a new DevPod context\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the context to create\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t}\n\n\tcreateCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"context option in the form KEY=VALUE\")\n\treturn createCmd\n}\n\n// Run runs the command logic\nfunc (cmd *CreateCmd) Run(ctx context.Context, context string) error {\n\tdevPodConfig, err := config.LoadConfig(\"\", cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t} else if devPodConfig.Contexts[context] != nil {\n\t\treturn fmt.Errorf(\"context '%s' already exists\", context)\n\t}\n\n\t// verify name\n\tif provider2.ProviderNameRegEx.MatchString(context) {\n\t\treturn fmt.Errorf(\"context name can only include smaller case letters, numbers or dashes\")\n\t} else if len(context) > 48 {\n\t\treturn fmt.Errorf(\"context name cannot be longer than 48 characters\")\n\t}\n\tdevPodConfig.Contexts[context] = &config.ContextConfig{}\n\n\t// check if there are create options set\n\tif len(cmd.Options) > 0 {\n\t\terr = setOptions(devPodConfig, context, cmd.Options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdevPodConfig.DefaultContext = context\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n\nfunc setOptions(devPodConfig *config.Config, context string, options []string) error {\n\toptionValues, err := parseOptions(options)\n\tif err != nil {\n\t\treturn err\n\t} else if devPodConfig.Contexts[context] == nil {\n\t\treturn fmt.Errorf(\"context '%s' doesn't exist\", context)\n\t}\n\n\tnewValues := map[string]config.OptionValue{}\n\tif devPodConfig.Contexts[context].Options != nil {\n\t\tfor k, v := range devPodConfig.Contexts[context].Options {\n\t\t\tnewValues[k] = v\n\t\t}\n\t}\n\tfor k, v := range optionValues {\n\t\tnewValues[k] = v\n\t}\n\n\tdevPodConfig.Contexts[context].Options = newValues\n\treturn nil\n}\n\nfunc parseOptions(options []string) (map[string]config.OptionValue, error) {\n\tallowedOptions := []string{}\n\tcontextOptions := map[string]config.ContextOption{}\n\tfor _, option := range config.ContextOptions {\n\t\tallowedOptions = append(allowedOptions, option.Name)\n\t\tcontextOptions[option.Name] = option\n\t}\n\n\tretMap := map[string]config.OptionValue{}\n\tfor _, option := range options {\n\t\tsplitted := strings.Split(option, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\treturn nil, fmt.Errorf(\"invalid option '%s', expected format KEY=VALUE\", option)\n\t\t}\n\n\t\tkey := strings.ToUpper(strings.TrimSpace(splitted[0]))\n\t\tvalue := strings.Join(splitted[1:], \"=\")\n\t\tcontextOption, ok := contextOptions[key]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid option '%s', allowed options are: %v\", key, allowedOptions)\n\t\t}\n\n\t\tif len(contextOption.Enum) > 0 {\n\t\t\tfound := false\n\t\t\tfor _, e := range contextOption.Enum {\n\t\t\t\tif value == e {\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid value '%s' for option '%s', has to match one of the following values: %v\", value, key, contextOption.Enum)\n\t\t\t}\n\t\t}\n\n\t\tretMap[key] = config.OptionValue{\n\t\t\tValue:        value,\n\t\t\tUserProvided: true,\n\t\t}\n\t}\n\n\treturn retMap, nil\n}\n"
  },
  {
    "path": "cmd/context/delete.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DeleteCmd holds the delete cmd flags\ntype DeleteCmd struct {\n\tflags.GlobalFlags\n}\n\n// NewDeleteCmd deletes a new command\nfunc NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete\",\n\t\tShort: \"Delete a DevPod context\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) > 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the context to delete\")\n\t\t\t}\n\n\t\t\tdevPodContext := \"\"\n\t\t\tif len(args) == 1 {\n\t\t\t\tdevPodContext = args[0]\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), devPodContext)\n\t\t},\n\t}\n\n\treturn deleteCmd\n}\n\n// Run runs the command logic\nfunc (cmd *DeleteCmd) Run(ctx context.Context, context string) error {\n\tdevPodConfig, err := config.LoadConfig(context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check for context\n\tif context == \"\" {\n\t\tcontext = devPodConfig.DefaultContext\n\t} else if devPodConfig.Contexts[context] == nil {\n\t\treturn fmt.Errorf(\"context '%s' doesn't exist\", context)\n\t}\n\n\t// check for default context\n\tif context == \"default\" {\n\t\treturn fmt.Errorf(\"cannot delete 'default' context\")\n\t}\n\n\tdelete(devPodConfig.Contexts, context)\n\tif devPodConfig.DefaultContext == context {\n\t\tdevPodConfig.DefaultContext = \"default\"\n\t}\n\tif devPodConfig.OriginalContext == context {\n\t\tdevPodConfig.OriginalContext = \"default\"\n\t}\n\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/context/list.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the list cmd flags\ntype ListCmd struct {\n\tflags.GlobalFlags\n\n\tOutput string\n}\n\n// NewListCmd creates a new command\nfunc NewListCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"List DevPod contexts\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn listCmd\n}\n\ntype ContextWithDefault struct {\n\tName string `json:\"name,omitempty\"`\n\n\tDefault bool `json:\"default,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor contextName := range devPodConfig.Contexts {\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tcontextName,\n\t\t\t\tstrconv.FormatBool(devPodConfig.DefaultContext == contextName),\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Default\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\tides := []ContextWithDefault{}\n\t\tfor contextName := range devPodConfig.Contexts {\n\t\t\tides = append(ides, ContextWithDefault{\n\t\t\t\tName:    contextName,\n\t\t\t\tDefault: devPodConfig.DefaultContext == contextName,\n\t\t\t})\n\t\t}\n\n\t\tout, err := json.MarshalIndent(ides, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/context/options.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// OptionsCmd holds the options cmd flags\ntype OptionsCmd struct {\n\t*flags.GlobalFlags\n\n\tOutput string\n}\n\n// NewOptionsCmd creates a new command\nfunc NewOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &OptionsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\toptionsCmd := &cobra.Command{\n\t\tUse:   \"options\",\n\t\tShort: \"Show options of a context\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\toptionsCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn optionsCmd\n}\n\ntype optionWithValue struct {\n\tconfig.ContextOption `json:\",inline\"`\n\n\tValue string `json:\"value,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *OptionsCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tentryOptions := devPodConfig.Current().Options\n\tif entryOptions == nil {\n\t\tentryOptions = map[string]config.OptionValue{}\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor _, entry := range config.ContextOptions {\n\t\t\tvalue := entryOptions[entry.Name].Value\n\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tentry.Name,\n\t\t\t\tentry.Description,\n\t\t\t\tentry.Default,\n\t\t\t\tvalue,\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Description\",\n\t\t\t\"Default\",\n\t\t\t\"Value\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\toptions := map[string]optionWithValue{}\n\t\tfor _, entry := range config.ContextOptions {\n\t\t\toptions[entry.Name] = optionWithValue{\n\t\t\t\tContextOption: entry,\n\t\t\t\tValue:         entryOptions[entry.Name].Value,\n\t\t\t}\n\t\t}\n\n\t\tout, err := json.MarshalIndent(options, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/context/set_options.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SetOptionsCmd holds the setOptions cmd flags\ntype SetOptionsCmd struct {\n\tflags.GlobalFlags\n\n\tOptions []string\n}\n\n// NewSetOptionsCmd setOptionss a new command\nfunc NewSetOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetOptionsCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tsetOptionsCmd := &cobra.Command{\n\t\tUse:   \"set-options\",\n\t\tShort: \"Set options for a DevPod context\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) > 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the context\")\n\t\t\t}\n\n\t\t\tdevPodContext := \"\"\n\t\t\tif len(args) == 1 {\n\t\t\t\tdevPodContext = args[0]\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), devPodContext)\n\t\t},\n\t}\n\n\tsetOptionsCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"context option in the form KEY=VALUE\")\n\treturn setOptionsCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SetOptionsCmd) Run(ctx context.Context, context string) error {\n\tdevPodConfig, err := config.LoadConfig(\"\", cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check for context\n\tif context == \"\" {\n\t\tcontext = devPodConfig.DefaultContext\n\t} else if devPodConfig.Contexts[context] == nil {\n\t\treturn fmt.Errorf(\"context '%s' doesn't exist\", context)\n\t}\n\n\t// check if there are setOptions options set\n\tif len(cmd.Options) > 0 {\n\t\terr = setOptions(devPodConfig, context, cmd.Options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/context/use.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UseCmd holds the use cmd flags\ntype UseCmd struct {\n\tflags.GlobalFlags\n\n\tOptions []string\n}\n\n// NewUseCmd uses a new command\nfunc NewUseCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UseCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tuseCmd := &cobra.Command{\n\t\tUse:   \"use\",\n\t\tShort: \"Set a DevPod context as the default\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the context to use\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t}\n\n\tuseCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"context option in the form KEY=VALUE\")\n\treturn useCmd\n}\n\n// Run runs the command logic\nfunc (cmd *UseCmd) Run(ctx context.Context, context string) error {\n\tdevPodConfig, err := config.LoadConfig(\"\", cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t} else if devPodConfig.Contexts[context] == nil {\n\t\treturn fmt.Errorf(\"context '%s' doesn't exist\", context)\n\t}\n\n\t// check if there are use options set\n\tif len(cmd.Options) > 0 {\n\t\terr = setOptions(devPodConfig, context, cmd.Options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdevPodConfig.DefaultContext = context\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/delete.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DeleteCmd holds the delete cmd flags\ntype DeleteCmd struct {\n\t*flags.GlobalFlags\n\tclient2.DeleteOptions\n}\n\n// NewDeleteCmd creates a new command\nfunc NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete [flags] [workspace-path|workspace-name]\",\n\t\tShort: \"Deletes an existing workspace\",\n\t\tLong: `Deletes an existing workspace. You can specify the workspace by its path or name.\nIf the workspace is not found, you can use the --ignore-not-found flag to treat it as a successful delete.`,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\t_, err := clientimplementation.DecodeOptionsFromEnv(clientimplementation.DevPodFlagsDelete, &cmd.DeleteOptions)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"decode up options: %w\", err)\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = clientimplementation.DecodePlatformOptionsFromEnv(&cmd.Platform)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"decode platform options: %w\", err)\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\tdeleteCmd.Flags().BoolVar(&cmd.IgnoreNotFound, \"ignore-not-found\", false, \"Treat \\\"workspace not found\\\" as a successful delete\")\n\tdeleteCmd.Flags().StringVar(&cmd.GracePeriod, \"grace-period\", \"\", \"The amount of time to give the command to delete the workspace\")\n\tdeleteCmd.Flags().BoolVar(&cmd.Force, \"force\", false, \"Delete workspace even if it is not found remotely anymore\")\n\treturn deleteCmd\n}\n\n// Run runs the command logic\nfunc (cmd *DeleteCmd) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\tif len(args) == 0 {\n\t\tworkspaceName, err := workspace.Delete(ctx, devPodConfig, args, cmd.IgnoreNotFound, cmd.Force, cmd.DeleteOptions, cmd.Owner, log.Default)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Default.Donef(\"Successfully deleted workspace '%s'\", workspaceName)\n\t\treturn nil\n\t}\n\n\tfor _, arg := range args {\n\t\tworkspaceName, err := workspace.Delete(ctx, devPodConfig, []string{arg}, cmd.IgnoreNotFound, cmd.Force, cmd.DeleteOptions, cmd.Owner, log.Default)\n\t\tif err != nil {\n\t\t\tlog.Default.Errorf(\"Failed to delete workspace '%s': %v\", arg, err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Default.Donef(\"Successfully deleted workspace '%s'\", workspaceName)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/export.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ExportCmd holds the export cmd flags\ntype ExportCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewExportCmd creates a new command\nfunc NewExportCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ExportCmd{\n\t\tGlobalFlags: flags,\n\t}\n\texportCmd := &cobra.Command{\n\t\tUse:    \"export [flags] [workspace-path|workspace-name]\",\n\t\tShort:  \"Exports a workspace configuration\",\n\t\tHidden: true,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tctx := context.Background()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\treturn exportCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ExportCmd) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\t// try to load workspace\n\tlogger := log.Default.ErrorStreamOnly()\n\tclient, err := workspace2.Get(ctx, devPodConfig, args, false, cmd.Owner, false, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// export workspace\n\texportConfig, err := exportWorkspace(devPodConfig, client.WorkspaceConfig())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// marshal config\n\tout, err := json.Marshal(exportConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(out))\n\treturn nil\n}\n\nfunc exportWorkspace(devPodConfig *config.Config, workspaceConfig *provider.Workspace) (*provider.ExportConfig, error) {\n\tvar err error\n\n\t// create return config\n\tretConfig := &provider.ExportConfig{}\n\n\t// export workspace\n\tretConfig.Workspace, err = provider.ExportWorkspace(workspaceConfig.Context, workspaceConfig.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"export workspace config: %w\", err)\n\t}\n\n\t// has machine?\n\tif workspaceConfig.Machine.ID != \"\" {\n\t\tretConfig.Machine, err = provider.ExportMachine(workspaceConfig.Context, workspaceConfig.Machine.ID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"export machine config: %w\", err)\n\t\t}\n\t}\n\n\t// export provider\n\tretConfig.Provider, err = provider.ExportProvider(devPodConfig, workspaceConfig.Context, workspaceConfig.Provider.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"export provider config: %w\", err)\n\t}\n\n\treturn retConfig, nil\n}\n"
  },
  {
    "path": "cmd/flags/flags.go",
    "content": "package flags\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tflag \"github.com/spf13/pflag\"\n)\n\ntype GlobalFlags struct {\n\tContext    string\n\tProvider   string\n\tAgentDir   string\n\tDevPodHome string\n\tUID        string\n\tOwner      platform.OwnerFilter\n\n\tLogOutput string\n\tDebug     bool\n\tSilent    bool\n}\n\n// SetGlobalFlags applies the global flags\nfunc SetGlobalFlags(flags *flag.FlagSet) *GlobalFlags {\n\tglobalFlags := &GlobalFlags{}\n\n\tflags.StringVar(&globalFlags.DevPodHome, \"devpod-home\", \"\", \"If defined will override the default devpod home. You can also use DEVPOD_HOME to set this\")\n\tflags.StringVar(&globalFlags.LogOutput, \"log-output\", \"plain\", \"The log format to use. Can be either plain, raw or json\")\n\tflags.StringVar(&globalFlags.Context, \"context\", \"\", \"The context to use\")\n\tflags.StringVar(&globalFlags.Provider, \"provider\", \"\", \"The provider to use. Needs to be configured for the selected context.\")\n\tflags.BoolVar(&globalFlags.Debug, \"debug\", false, \"Prints the stack trace if an error occurs\")\n\tflags.BoolVar(&globalFlags.Silent, \"silent\", false, \"Run in silent mode and prevents any devpod log output except panics & fatals\")\n\n\tflags.Var(&globalFlags.Owner, \"owner\", \"Show pro workspaces for owner\")\n\t_ = flags.MarkHidden(\"owner\")\n\tflags.StringVar(&globalFlags.UID, \"uid\", \"\", \"Set UID for workspace\")\n\t_ = flags.MarkHidden(\"uid\")\n\tflags.StringVar(&globalFlags.AgentDir, \"agent-dir\", \"\", \"The data folder where agent data is stored.\")\n\t_ = flags.MarkHidden(\"agent-dir\")\n\treturn globalFlags\n}\n"
  },
  {
    "path": "cmd/helper/check_provider_update.go",
    "content": "package helper\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/blang/semver\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar (\n\terrProviderNotFound = errors.New(\"provider not found\")\n)\n\ntype CheckProviderUpdateCmd struct {\n\t*flags.GlobalFlags\n\tlog log.Logger\n}\n\ntype providerVersionCheck struct {\n\tUpdateAvailable bool   `json:\"updateAvailable\"`\n\tLatestVersion   string `json:\"latestVersion,omitempty\"`\n}\n\n// NewCheckProviderUpdateCmd creates a new command\nfunc NewCheckProviderUpdateCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CheckProviderUpdateCmd{\n\t\tGlobalFlags: flags,\n\t\tlog:         log.Default,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"check-provider-update\",\n\t\tShort: \"Check if a provider update is available\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn cmd.Run(context.Background(), devPodConfig, args)\n\t\t},\n\t}\n\n\treturn shellCmd\n}\n\nfunc (cmd *CheckProviderUpdateCmd) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"provider is missing\")\n\t}\n\tproviderName := args[0]\n\n\tproviderSourceRaw, err := workspace.ResolveProviderSource(devPodConfig, providerName, cmd.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"provider %s doesn't exist\", providerName)\n\t}\n\n\t// retrieve current config for provider\n\tallProviders, err := workspace.LoadAllProviders(devPodConfig, cmd.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcurrentProvider, ok := allProviders[providerName]\n\tif !ok {\n\t\treturn errProviderNotFound\n\t}\n\n\tlatestProviderConfig, err := loadLatestProvider(providerSourceRaw, cmd.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcurrentProviderVersion, err := semver.Parse(strings.TrimPrefix(currentProvider.Config.Version, \"v\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tlatestProviderVersion, err := semver.Parse(strings.TrimPrefix(latestProviderConfig.Version, \"v\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tversionCheck := providerVersionCheck{UpdateAvailable: false}\n\t// check if new version is newer\n\tif latestProviderVersion.GT(currentProviderVersion) {\n\t\tversionCheck.UpdateAvailable = true\n\t\tversionCheck.LatestVersion = latestProviderConfig.Version\n\t}\n\tout, err := json.Marshal(versionCheck)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n\nfunc loadLatestProvider(providerSourceRaw string, log log.Logger) (*provider.ProviderConfig, error) {\n\tproviderRaw, _, err := workspace.ResolveProvider(providerSourceRaw, log)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"resolve provider\")\n\t}\n\tproviderConfig, err := provider.ParseProvider(bytes.NewReader(providerRaw))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse provider\")\n\t}\n\n\treturn providerConfig, nil\n}\n"
  },
  {
    "path": "cmd/helper/docker_credentials.go",
    "content": "package helper\n\nimport (\n\t\"fmt\"\n\t\"os/user\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype DockerCredentialsHelperCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceID string\n}\n\nfunc NewDockerCredentialsHelperCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DockerCredentialsHelperCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tfleetCmd := &cobra.Command{\n\t\tUse:   \"setup-docker-credentials-helper\",\n\t\tShort: \"Setup the docker credentials helper manually\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\treturn fleetCmd\n}\n\nfunc (c *DockerCredentialsHelperCmd) Run(cmd *cobra.Command, _ []string) error {\n\tu, err := user.Current()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get current user: %w\", err)\n\t}\n\n\tport, err := credentials.GetPort()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get port: %w\", err)\n\t}\n\n\treturn dockercredentials.ConfigureCredentialsContainer(u.Name, port, log.Default)\n}\n"
  },
  {
    "path": "cmd/helper/fleet_helper.go",
    "content": "package helper\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/spf13/cobra\"\n)\n\n// FleetServerCmd holds the fleet server cmd flags\ntype FleetServerCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceID string\n}\n\n// NewFleetServerCmd creates a new fleet command\nfunc NewFleetServerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &FleetServerCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tfleetCmd := &cobra.Command{\n\t\tUse:   \"fleet-server\",\n\t\tShort: \"Monitor fleet server activity\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\tfleetCmd.Flags().StringVar(&cmd.WorkspaceID, \"workspaceid\", \"\", \"Fleet WorkspaceID to monitor\")\n\treturn fleetCmd\n}\n\n// Run runs the command logic\nfunc (c *FleetServerCmd) Run(cmd *cobra.Command, _ []string) error {\n\tlogFile := filepath.Join(os.Getenv(\"HOME\"), \".cache/JetBrains/Fleet/log/fleet.log\")\n\tfirstConnection := regexp.MustCompile(`.*Received authorization request.*`)\n\tconnStatus := regexp.MustCompile(`.*Notify.*`)\n\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(time.Second * 10):\n\n\t\t\tlog, err := os.ReadFile(logFile)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// check if we had at least one fleet client connection, before\n\t\t\t// this point, we don't check for connected/disconnected strings\n\t\t\tinitialized := firstConnection.FindStringSubmatch(string(log))\n\t\t\tif len(initialized) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconnString := connStatus.FindAllStringSubmatch(string(log), -1)\n\n\t\t\t// if ouf last occurrence of notify if \"Notify ID connected\"\n\t\t\t// we have an active session, so let's keep alive\n\t\t\tif strings.Contains(connString[len(connString)-1][0], \"is connected\") {\n\t\t\t\tfile, _ := os.Create(agent.ContainerActivityFile)\n\t\t\t\tfile.Close()\n\t\t\t}\n\t\tcase <-cmd.Context().Done():\n\t\t\t//context is done - either canceled or time is up for timeout\n\t\t\treturn nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/helper/get_image.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetImageCommand struct {\n\t*flags.GlobalFlags\n}\n\n// NewGetImageCmd creates a new command\nfunc NewGetImageCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GetImageCommand{\n\t\tGlobalFlags: flags,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"get-image [image-name]\",\n\t\tShort: \"Retrieve details about an image\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\treturn shellCmd\n}\n\nfunc (cmd *GetImageCommand) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"image name is missing\")\n\t}\n\n\timg, err := image.GetImage(ctx, args[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\tout, err := json.MarshalIndent(img, \"\", \"  \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/get_provider_name.go",
    "content": "package helper\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetProviderNameCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewGetProviderNameCmd creates a new command\nfunc NewGetProviderNameCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GetProviderNameCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"get-provider-name\",\n\t\tShort: \"Retrieves a provider name\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn shellCmd\n}\n\nfunc (cmd *GetProviderNameCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"provider is missing\")\n\t}\n\n\tproviderRaw, _, err := workspace.ResolveProvider(args[0], log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"resolve provider\")\n\t}\n\n\tproviderConfig, err := provider.ParseProvider(bytes.NewReader(providerRaw))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"parse provider\")\n\t}\n\n\tfmt.Print(providerConfig.Name)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/get_workspace_config.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetWorkspaceConfigCommand struct {\n\t*flags.GlobalFlags\n\n\ttimeout  time.Duration\n\tmaxDepth int\n}\ntype GetWorkspaceConfigCommandResult struct {\n\tIsImage         bool     `json:\"isImage\"`\n\tIsGitRepository bool     `json:\"isGitRepository\"`\n\tIsLocal         bool     `json:\"isLocal\"`\n\tConfigPaths     []string `json:\"configPaths\"`\n}\n\n// NewGetWorkspaceConfigCommand creates a new command\nfunc NewGetWorkspaceConfigCommand(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GetWorkspaceConfigCommand{\n\t\tGlobalFlags: flags,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"get-workspace-config\",\n\t\tShort: \"Retrieves a workspace config\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif cmd.maxDepth < 0 {\n\t\t\t\tlog.Default.Debugf(\"--max-depth was %d, setting to 0\", cmd.maxDepth)\n\t\t\t\tcmd.maxDepth = 0\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, args)\n\t\t},\n\t}\n\n\tshellCmd.Flags().DurationVar(&cmd.timeout, \"timeout\", 10*time.Second, \"Timeout for the command, 10 seconds by default\")\n\tshellCmd.Flags().IntVar(&cmd.maxDepth, \"max-depth\", 3, \"Maximum depth to search for devcontainer files\")\n\n\treturn shellCmd\n}\n\nfunc (cmd *GetWorkspaceConfigCommand) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"workspace source is missing\")\n\t}\n\trawSource := args[0]\n\n\tlevel := log.Default.GetLevel()\n\tif cmd.GlobalFlags.Debug {\n\t\tlevel = logrus.DebugLevel\n\t}\n\tvar logger log.Logger = log.NewStdoutLogger(os.Stdin, os.Stdout, os.Stderr, level)\n\tif os.Getenv(\"DEVPOD_UI\") == \"true\" {\n\t\tlogger = log.Discard\n\t}\n\tlogger.Debugf(\"Resolving devcontainer config for source: %s\", rawSource)\n\n\tctx, cancel := context.WithTimeout(context.Background(), cmd.timeout)\n\tdefer cancel()\n\n\tdone := make(chan *devcontainer.GetWorkspaceConfigResult, 1)\n\terrChan := make(chan error, 1)\n\n\ttmpDir, err := os.MkdirTemp(\"\", \"devpod\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\t_ = os.RemoveAll(tmpDir)\n\t}()\n\tgo func() {\n\t\tresult, err := devcontainer.FindDevcontainerFiles(ctx, rawSource, tmpDir, cmd.maxDepth, devPodConfig.ContextOption(config.ContextOptionSSHStrictHostKeyChecking) == \"true\", logger)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\t\tdone <- result\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\treturn fmt.Errorf(\"unable to find devcontainer files: %w\", err)\n\tcase <-ctx.Done():\n\t\treturn fmt.Errorf(\"timeout while searching for devcontainer files\")\n\tcase result := <-done:\n\t\tout, err := json.Marshal(result)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(string(out))\n\t}\n\tdefer close(done)\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/get_workspace_name.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetWorkspaceNameCommand struct {\n\t*flags.GlobalFlags\n}\n\n// NewGetWorkspaceNameCmd creates a new command\nfunc NewGetWorkspaceNameCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GetWorkspaceNameCommand{\n\t\tGlobalFlags: flags,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"get-workspace-name\",\n\t\tShort: \"Retrieves a workspace name\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn shellCmd\n}\n\nfunc (cmd *GetWorkspaceNameCommand) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"workspace is missing\")\n\t}\n\n\t_, name := file.IsLocalDir(args[0])\n\tworkspaceID := workspace.ToID(name)\n\tfmt.Print(workspaceID)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/get_workspace_uid.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetWorkspaceUIDCommand struct {\n\t*flags.GlobalFlags\n}\n\n// NewGetWorkspaceUIDCmd creates a new command\nfunc NewGetWorkspaceUIDCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &GetWorkspaceUIDCommand{\n\t\tGlobalFlags: flags,\n\t}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"get-workspace-uid\",\n\t\tShort: \"Retrieves a workspace uid\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn shellCmd\n}\n\nfunc (cmd *GetWorkspaceUIDCommand) Run(ctx context.Context, args []string) error {\n\tfmt.Print(encoding.CreateNewUID(\"\", \"\"))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/helper.go",
    "content": "package helper\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/helper/http\"\n\t\"github.com/loft-sh/devpod/cmd/helper/json\"\n\t\"github.com/loft-sh/devpod/cmd/helper/strings\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewHelperCmd returns a new command\nfunc NewHelperCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\thelperCmd := &cobra.Command{\n\t\tUse:   \"helper\",\n\t\tShort: \"DevPod Utility Commands\",\n\t\tPersistentPreRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn agent.AgentPersistentPreRunE(cobraCmd, args, globalFlags)\n\t\t},\n\t\tHidden: true,\n\t}\n\n\thelperCmd.AddCommand(http.NewHTTPCmd(globalFlags))\n\thelperCmd.AddCommand(json.NewJSONCmd(globalFlags))\n\thelperCmd.AddCommand(strings.NewStringsCmd(globalFlags))\n\thelperCmd.AddCommand(NewSSHServerCmd(globalFlags))\n\thelperCmd.AddCommand(NewGetWorkspaceNameCmd(globalFlags))\n\thelperCmd.AddCommand(NewGetWorkspaceUIDCmd(globalFlags))\n\thelperCmd.AddCommand(NewGetWorkspaceConfigCommand(globalFlags))\n\thelperCmd.AddCommand(NewGetProviderNameCmd(globalFlags))\n\thelperCmd.AddCommand(NewCheckProviderUpdateCmd(globalFlags))\n\thelperCmd.AddCommand(NewSSHClientCmd())\n\thelperCmd.AddCommand(NewShellCmd())\n\thelperCmd.AddCommand(NewSSHGitCloneCmd())\n\thelperCmd.AddCommand(NewFleetServerCmd(globalFlags))\n\thelperCmd.AddCommand(NewDockerCredentialsHelperCmd(globalFlags))\n\thelperCmd.AddCommand(NewGetImageCmd(globalFlags))\n\treturn helperCmd\n}\n"
  },
  {
    "path": "cmd/helper/http/http.go",
    "content": "package http\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewHTTPCmd returns a new command\nfunc NewHTTPCmd(flags *flags.GlobalFlags) *cobra.Command {\n\thttpCmd := &cobra.Command{\n\t\tUse:    \"http\",\n\t\tShort:  \"DevPod HTTP Utility Commands\",\n\t\tHidden: true,\n\t}\n\n\thttpCmd.AddCommand(NewRequestCmd())\n\treturn httpCmd\n}\n"
  },
  {
    "path": "cmd/helper/http/request.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype RequestCmd struct {\n\tMethod  string\n\tData    string\n\tHeaders []string\n\n\tFailOnErrorCode bool\n}\n\n// NewRequestCmd creates a new ssh command\nfunc NewRequestCmd() *cobra.Command {\n\tcmd := &RequestCmd{}\n\trequestCmd := &cobra.Command{\n\t\tUse:   \"request\",\n\t\tShort: \"Executes a http(s) request\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\trequestCmd.Flags().StringVarP(&cmd.Data, \"data\", \"d\", \"\", \"Request Data\")\n\trequestCmd.Flags().StringVarP(&cmd.Method, \"request\", \"X\", \"GET\", \"Request Type\")\n\trequestCmd.Flags().StringSliceVarP(&cmd.Headers, \"header\", \"H\", []string{}, \"Extra Headers\")\n\trequestCmd.Flags().BoolVar(&cmd.FailOnErrorCode, \"fail-on-error-code\", true, \"Let this command fail if the remote is returning an error code\")\n\treturn requestCmd\n}\n\nfunc (cmd *RequestCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"expected request url as argument\")\n\t}\n\n\tcmd.Method = strings.ToUpper(cmd.Method)\n\thttpHeader := http.Header{}\n\tfor _, header := range cmd.Headers {\n\t\tsplitted := strings.Split(header, \":\")\n\t\tif len(splitted) == 1 {\n\t\t\treturn fmt.Errorf(\"unexpected header '%s', expected form 'HEADER: VALUE'\", header)\n\t\t}\n\n\t\thttpHeader.Add(strings.TrimSpace(splitted[0]), strings.TrimSpace(strings.Join(splitted[1:], \":\")))\n\t}\n\n\trequest, err := http.NewRequest(cmd.Method, args[0], strings.NewReader(cmd.Data))\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.Header = httpHeader\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode >= 300 {\n\t\tout, _ := io.ReadAll(resp.Body)\n\t\t_, _ = fmt.Fprint(os.Stderr, string(out))\n\t\treturn fmt.Errorf(\"unexpected response code %d\", resp.StatusCode)\n\t}\n\n\t_, err = io.Copy(os.Stdout, resp.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read response\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/json/get.go",
    "content": "package json\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/PaesslerAG/jsonpath\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype GetCmd struct {\n\tFile string\n\tFail bool\n}\n\n// NewGetCmd creates a new ssh command\nfunc NewGetCmd() *cobra.Command {\n\tcmd := &GetCmd{}\n\tgetCmd := &cobra.Command{\n\t\tUse:   \"get\",\n\t\tShort: \"Retrieves a JSON value by JSONPath\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tgetCmd.Flags().StringVarP(&cmd.File, \"file\", \"f\", \"\", \"Parse this json file instead of STDIN\")\n\tgetCmd.Flags().BoolVar(&cmd.Fail, \"fail\", false, \"Fail if value is not found\")\n\treturn getCmd\n}\n\nfunc (cmd *GetCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"jsonpath expected\")\n\t}\n\n\tif !strings.HasPrefix(args[0], \"$\") {\n\t\tif !strings.HasPrefix(args[0], \"[\") && !strings.HasPrefix(args[0], \".\") {\n\t\t\targs[0] = \".\" + args[0]\n\t\t}\n\n\t\targs[0] = \"$\" + args[0]\n\t}\n\n\tvar jsonBytes []byte\n\tif cmd.File != \"\" {\n\t\tvar err error\n\t\tjsonBytes, err = os.ReadFile(cmd.File)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tvar err error\n\t\tjsonBytes, err = io.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tv := interface{}(nil)\n\terr := json.Unmarshal(jsonBytes, &v)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse json\")\n\t}\n\n\tval, err := jsonpath.Get(args[0], v)\n\tif err != nil {\n\t\tif cmd.Fail {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\tswitch t := val.(type) {\n\tcase string:\n\t\tfmt.Print(strings.TrimSpace(t))\n\t\treturn nil\n\tcase bool, int, int64, rune:\n\t\tfmt.Print(t)\n\t\treturn nil\n\t}\n\n\tout, err := json.MarshalIndent(val, \"\", \"  \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Print(string(out))\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/helper/json/json.go",
    "content": "package json\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewJSONCmd returns a new command\nfunc NewJSONCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tjsonCmd := &cobra.Command{\n\t\tUse:    \"json\",\n\t\tShort:  \"DevPod JSON Utility Commands\",\n\t\tHidden: true,\n\t}\n\n\tjsonCmd.AddCommand(NewGetCmd())\n\treturn jsonCmd\n}\n"
  },
  {
    "path": "cmd/helper/sh.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype ShellCommand struct {\n\tCommand string\n\tLogin   bool\n}\n\n// NewShellCmd creates a new command\nfunc NewShellCmd() *cobra.Command {\n\tcmd := &ShellCommand{}\n\tshellCmd := &cobra.Command{\n\t\tUse:   \"sh\",\n\t\tShort: \"Executes a command in a shell\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tshellCmd.Flags().BoolVarP(&cmd.Login, \"login\", \"l\", false, \"If login shell should be used\")\n\tshellCmd.Flags().StringVarP(&cmd.Command, \"command\", \"c\", \"\", \"Command to execute\")\n\treturn shellCmd\n}\n\nfunc (cmd *ShellCommand) Run(ctx context.Context, args []string) error {\n\tif cmd.Command == \"\" && len(args) == 0 {\n\t\treturn nil\n\t} else if cmd.Command != \"\" && len(args) > 0 {\n\t\treturn fmt.Errorf(\"either use -c or provide a script file\")\n\t} else if len(args) > 1 {\n\t\treturn fmt.Errorf(\"only a single script file can be used\")\n\t}\n\n\t// load command from file\n\tif len(args) > 0 {\n\t\tcontent, err := os.ReadFile(args[0])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcmd.Command = string(content)\n\t}\n\n\treturn shell.RunEmulatedShell(ctx, cmd.Command, os.Stdin, os.Stdout, os.Stderr, os.Environ())\n}\n"
  },
  {
    "path": "cmd/helper/ssh_client.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\tcommand2 \"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype SSHClient struct {\n\tAddress string\n\tKeyFile string\n\tUser    string\n}\n\n// NewSSHClientCmd creates a new ssh command\nfunc NewSSHClientCmd() *cobra.Command {\n\tcmd := &SSHClient{}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh-client\",\n\t\tShort: \"Starts a new ssh client session\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tsshCmd.Flags().StringVar(&cmd.KeyFile, \"key-file\", \"\", \"SSH Key file to use\")\n\tsshCmd.Flags().StringVar(&cmd.Address, \"address\", \"\", \"Address to connect to\")\n\tsshCmd.Flags().StringVar(&cmd.User, \"user\", \"root\", \"User to connect as\")\n\t_ = sshCmd.MarkFlagRequired(\"address\")\n\treturn sshCmd\n}\n\nfunc (cmd *SSHClient) Run(ctx context.Context, args []string) error {\n\tsshConfig, err := cmd.getConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsshClient, err := ssh.Dial(\"tcp\", cmd.Address, sshConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sshClient.Close()\n\n\tsess, err := sshClient.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sess.Close()\n\n\tsess.Stdin = os.Stdin\n\tsess.Stdout = os.Stdout\n\tsess.Stderr = os.Stderr\n\terr = sess.Run(command2.Quote(args))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *SSHClient) getConfig() (*ssh.ClientConfig, error) {\n\tclientConfig := &ssh.ClientConfig{\n\t\tUser:            cmd.User,\n\t\tAuth:            []ssh.AuthMethod{},\n\t\tHostKeyCallback: ssh.InsecureIgnoreHostKey(),\n\t}\n\n\t// key file authentication?\n\tif cmd.KeyFile != \"\" {\n\t\tout, err := os.ReadFile(cmd.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"read private ssh key\")\n\t\t}\n\n\t\tsigner, err := ssh.ParsePrivateKey(out)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"parse private key\")\n\t\t}\n\n\t\tclientConfig.Auth = append(clientConfig.Auth, ssh.PublicKeys(signer))\n\t}\n\n\treturn clientConfig, nil\n}\n"
  },
  {
    "path": "cmd/helper/ssh_git_clone.go",
    "content": "package helper\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strings\"\n\n\tcommand2 \"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype SSHGitClone struct {\n\tKeyFiles []string\n\tPort     string\n}\n\nfunc NewSSHGitCloneCmd() *cobra.Command {\n\tcmd := &SSHGitClone{}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh-git-clone\",\n\t\tShort: \"Drop-in ssh replacement in GIT_SSH_COMMAND\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tsshCmd.Flags().StringArrayVar(&cmd.KeyFiles, \"key-file\", []string{}, \"SSH Key file to use\")\n\tsshCmd.Flags().StringVar(&cmd.Port, \"port\", \"22\", \"SSH port to use, defaults to 22\")\n\t_ = sshCmd.MarkFlagRequired(\"key-file\")\n\treturn sshCmd\n}\n\nfunc (cmd *SSHGitClone) Run(ctx context.Context, args []string) error {\n\tif len(args) < 2 {\n\t\treturn fmt.Errorf(\"expected args in format: {user}@{host} {commands...}, received \\\"%s\\\"\", strings.Join(args, \" \"))\n\t}\n\thost := args[0]\n\tsshCmdArgs := args[1:]\n\tif len(host) == 0 || len(sshCmdArgs) == 0 {\n\t\treturn fmt.Errorf(\"unexpected input: host: %s, args: %s\", host, strings.Join(sshCmdArgs, \" \"))\n\t}\n\n\tuser, addr, err := parseSSHHost(host)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsshConfig, err := getConfig(user, cmd.KeyFiles)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsshClient, err := ssh.Dial(\"tcp\", net.JoinHostPort(addr, cmd.Port), sshConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sshClient.Close()\n\n\tsess, err := sshClient.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sess.Close()\n\n\tsess.Stdin = os.Stdin\n\tsess.Stdout = os.Stdout\n\tsess.Stderr = os.Stderr\n\terr = sess.Run(command2.Quote(sshCmdArgs))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc getConfig(userName string, keyFilePaths []string) (*ssh.ClientConfig, error) {\n\tsigners := []ssh.Signer{}\n\tfor _, keyFilePath := range keyFilePaths {\n\t\tout, err := os.ReadFile(keyFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read private ssh key: %w\", err)\n\t\t}\n\n\t\tsigner, err := ssh.ParsePrivateKey(out)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parse private key: %w\", err)\n\t\t}\n\n\t\tsigners = append(signers, signer)\n\t}\n\n\treturn &ssh.ClientConfig{\n\t\tUser:            userName,\n\t\tAuth:            []ssh.AuthMethod{ssh.PublicKeys(signers...)},\n\t\tHostKeyCallback: ssh.InsecureIgnoreHostKey(),\n\t}, nil\n}\n\nfunc parseSSHHost(host string) (string, string, error) {\n\ts := strings.SplitN(host, \"@\", 2)\n\tif len(s) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"split host: %s\", host)\n\t}\n\n\treturn s[0], s[1], nil\n}\n"
  },
  {
    "path": "cmd/helper/ssh_server.go",
    "content": "package helper\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\thelperssh \"github.com/loft-sh/devpod/pkg/ssh/server\"\n\t\"github.com/loft-sh/devpod/pkg/ssh/server/port\"\n\t\"github.com/loft-sh/devpod/pkg/stdio\"\n\t\"github.com/loft-sh/devpod/pkg/token\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SSHServerCmd holds the ssh server cmd flags\ntype SSHServerCmd struct {\n\t*flags.GlobalFlags\n\n\tToken            string\n\tAddress          string\n\tStdio            bool\n\tTrackActivity    bool\n\tReuseSSHAuthSock string\n\tWorkdir          string\n}\n\n// NewSSHServerCmd creates a new ssh command\nfunc NewSSHServerCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SSHServerCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh-server\",\n\t\tShort: \"Starts a new ssh server\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\tsshCmd.Flags().StringVar(&cmd.Address, \"address\", fmt.Sprintf(\"0.0.0.0:%d\", helperssh.DefaultPort), \"Address to listen to\")\n\tsshCmd.Flags().BoolVar(&cmd.Stdio, \"stdio\", false, \"Will listen on stdout and stdin instead of an address\")\n\tsshCmd.Flags().BoolVar(&cmd.TrackActivity, \"track-activity\", false, \"If enabled will write the last activity time to a file\")\n\tsshCmd.Flags().StringVar(&cmd.ReuseSSHAuthSock, \"reuse-ssh-auth-sock\", \"\", \"If set, the SSH_AUTH_SOCK is expected to already be available in the workspace (under /tmp using the key provided) and the connection reuses this instead of creating a new one\")\n\t_ = sshCmd.Flags().MarkHidden(\"reuse-ssh-auth-sock\")\n\tsshCmd.Flags().StringVar(&cmd.Token, \"token\", \"\", \"Base64 encoded token to use\")\n\tsshCmd.Flags().StringVar(&cmd.Workdir, \"workdir\", \"\", \"Directory where commands will run on the host\")\n\treturn sshCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SSHServerCmd) Run(_ *cobra.Command, _ []string) error {\n\tvar (\n\t\tkeys    []ssh.PublicKey\n\t\thostKey []byte\n\t\terr     error\n\t)\n\tif cmd.Token != \"\" {\n\t\t// parse token\n\t\tt, err := token.ParseToken(cmd.Token)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"parse token\")\n\t\t}\n\n\t\tif t.AuthorizedKeys != \"\" {\n\t\t\tkeyBytes, err := base64.StdEncoding.DecodeString(t.AuthorizedKeys)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"seems like the provided encoded string is not base64 encoded\")\n\t\t\t}\n\n\t\t\tfor len(keyBytes) > 0 {\n\t\t\t\tkey, _, _, rest, err := ssh.ParseAuthorizedKey(keyBytes)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"parse authorized key\")\n\t\t\t\t}\n\n\t\t\t\tkeys = append(keys, key)\n\t\t\t\tkeyBytes = rest\n\t\t\t}\n\t\t}\n\n\t\tif len(t.HostKey) > 0 {\n\t\t\thostKey, err = base64.StdEncoding.DecodeString(t.HostKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"decode host key\")\n\t\t\t}\n\t\t}\n\t}\n\n\t// start the server\n\tserver, err := helperssh.NewServer(cmd.Address, hostKey, keys, cmd.Workdir, cmd.ReuseSSHAuthSock, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// should we listen on stdout & stdin?\n\tif cmd.Stdio {\n\t\tif cmd.TrackActivity {\n\t\t\tgo func() {\n\t\t\t\t_, err = os.Stat(agent.ContainerActivityFile)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = os.WriteFile(agent.ContainerActivityFile, nil, 0o777)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfmt.Fprintf(os.Stderr, \"Error writing file: %v\\n\", err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t_ = os.Chmod(agent.ContainerActivityFile, 0o777)\n\t\t\t\t}\n\n\t\t\t\tfor {\n\t\t\t\t\ttime.Sleep(time.Second * 10)\n\t\t\t\t\tfile, _ := os.Create(agent.ContainerActivityFile)\n\t\t\t\t\tfile.Close()\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\n\t\tlis := stdio.NewStdioListener(os.Stdin, os.Stdout, true)\n\t\treturn server.Serve(lis)\n\t}\n\n\t// check if ssh is already running at that port\n\tavailable, err := port.IsAvailable(cmd.Address)\n\tif !available {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"address %s already in use: %w\", cmd.Address, err)\n\t\t}\n\n\t\tlog.Default.ErrorStreamOnly().Infof(\"address %s already in use\", cmd.Address)\n\t\treturn nil\n\t}\n\n\treturn server.ListenAndServe()\n}\n"
  },
  {
    "path": "cmd/helper/strings/strings.go",
    "content": "package strings\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewStringsCmd returns a new command\nfunc NewStringsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tstringsCmd := &cobra.Command{\n\t\tUse:    \"strings\",\n\t\tShort:  \"DevPod String Utility Commands\",\n\t\tHidden: true,\n\t}\n\n\treturn stringsCmd\n}\n"
  },
  {
    "path": "cmd/ide/ide.go",
    "content": "package ide\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewIDECmd returns a new command\nfunc NewIDECmd(flags *flags.GlobalFlags) *cobra.Command {\n\tideCmd := &cobra.Command{\n\t\tUse:   \"ide\",\n\t\tShort: \"DevPod IDE commands\",\n\t}\n\n\tideCmd.AddCommand(NewUseCmd(flags))\n\tideCmd.AddCommand(NewSetOptionsCmd(flags))\n\tideCmd.AddCommand(NewOptionsCmd(flags))\n\tideCmd.AddCommand(NewListCmd(flags))\n\treturn ideCmd\n}\n"
  },
  {
    "path": "cmd/ide/list.go",
    "content": "package ide\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide/ideparse\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the list cmd flags\ntype ListCmd struct {\n\tflags.GlobalFlags\n\n\tOutput string\n}\n\n// NewListCmd creates a new command\nfunc NewListCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"List available IDEs\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn listCmd\n}\n\ntype IDEWithDefault struct {\n\tideparse.AllowedIDE `json:\",inline\"`\n\n\tDefault bool `json:\"default,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor _, entry := range ideparse.AllowedIDEs {\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tstring(entry.Name),\n\t\t\t\tstrconv.FormatBool(devPodConfig.Current().DefaultIDE == string(entry.Name)),\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Default\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\tides := []IDEWithDefault{}\n\t\tfor _, entry := range ideparse.AllowedIDEs {\n\t\t\tides = append(ides, IDEWithDefault{\n\t\t\t\tAllowedIDE: entry,\n\t\t\t\tDefault:    devPodConfig.Current().DefaultIDE == string(entry.Name),\n\t\t\t})\n\t\t}\n\n\t\tout, err := json.MarshalIndent(ides, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/ide/options.go",
    "content": "package ide\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/ide/ideparse\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// OptionsCmd holds the options cmd flags\ntype OptionsCmd struct {\n\tflags.GlobalFlags\n\n\tOutput string\n}\n\n// NewOptionsCmd creates a new command\nfunc NewOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &OptionsCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\toptionsCmd := &cobra.Command{\n\t\tUse:   \"options\",\n\t\tShort: \"List ide options\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the ide\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t}\n\n\toptionsCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn optionsCmd\n}\n\ntype optionWithValue struct {\n\tide.Option `json:\",inline\"`\n\n\tValue string `json:\"value,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *OptionsCmd) Run(ctx context.Context, ide string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvalues := devPodConfig.IDEOptions(ide)\n\tideOptions, err := ideparse.GetIDEOptions(ide)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor optionName, entry := range ideOptions {\n\t\t\tvalue := values[optionName].Value\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\toptionName,\n\t\t\t\tentry.Description,\n\t\t\t\tentry.Default,\n\t\t\t\tvalue,\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Description\",\n\t\t\t\"Default\",\n\t\t\t\"Value\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\toptions := map[string]optionWithValue{}\n\t\tfor optionName, entry := range ideOptions {\n\t\t\toptions[optionName] = optionWithValue{\n\t\t\t\tOption: entry,\n\t\t\t\tValue:  values[optionName].Value,\n\t\t\t}\n\t\t}\n\n\t\tout, err := json.Marshal(options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/ide/set_options.go",
    "content": "package ide\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide/ideparse\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SetOptionsCmd holds the setOptions cmd flags\ntype SetOptionsCmd struct {\n\tflags.GlobalFlags\n\n\tOptions []string\n}\n\n// NewSetOptionsCmd creates a new command\nfunc NewSetOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetOptionsCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tsetOptionsCmd := &cobra.Command{\n\t\tUse:   \"set-options\",\n\t\tShort: \"Configure ide options\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the ide\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t}\n\n\tsetOptionsCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"IDE option in the form KEY=VALUE\")\n\treturn setOptionsCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SetOptionsCmd) Run(ctx context.Context, ide string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tide = strings.ToLower(ide)\n\tideOptions, err := ideparse.GetIDEOptions(ide)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if there are setOptionsr options set\n\tif len(cmd.Options) > 0 {\n\t\terr = setOptions(devPodConfig, ide, cmd.Options, ideOptions)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/ide/use.go",
    "content": "package ide\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/ide/ideparse\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UseCmd holds the use cmd flags\ntype UseCmd struct {\n\tflags.GlobalFlags\n\n\tOptions []string\n}\n\n// NewUseCmd creates a new command\nfunc NewUseCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UseCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tuseCmd := &cobra.Command{\n\t\tUse:   \"use\",\n\t\tShort: \"Configure the default IDE to use (list available IDEs with 'devpod ide list')\",\n\t\tLong: `Configure the default IDE to use\n\nAvailable IDEs can be listed with 'devpod ide list'`,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the ide to use, list available IDEs with 'devpod ide list'\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t}\n\n\tuseCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"IDE option in the form KEY=VALUE\")\n\treturn useCmd\n}\n\n// Run runs the command logic\nfunc (cmd *UseCmd) Run(ctx context.Context, ide string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tide = strings.ToLower(ide)\n\tideOptions, err := ideparse.GetIDEOptions(ide)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if there are user options set\n\tif len(cmd.Options) > 0 {\n\t\terr = setOptions(devPodConfig, ide, cmd.Options, ideOptions)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdevPodConfig.Current().DefaultIDE = ide\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\treturn nil\n}\n\nfunc setOptions(devPodConfig *config.Config, ide string, options []string, ideOptions ide.Options) error {\n\toptionValues, err := ideparse.ParseOptions(options, ideOptions)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif devPodConfig.Current().IDEs == nil {\n\t\tdevPodConfig.Current().IDEs = map[string]*config.IDEConfig{}\n\t}\n\n\tnewValues := map[string]config.OptionValue{}\n\tif devPodConfig.Current().IDEs[ide] != nil {\n\t\tfor k, v := range devPodConfig.Current().IDEs[ide].Options {\n\t\t\tnewValues[k] = v\n\t\t}\n\t}\n\tfor k, v := range optionValues {\n\t\tnewValues[k] = v\n\t}\n\n\tdevPodConfig.Current().IDEs[ide] = &config.IDEConfig{\n\t\tOptions: newValues,\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/import.go",
    "content": "package cmd\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ImportCmd holds the export cmd flags\ntype ImportCmd struct {\n\t*flags.GlobalFlags\n\n\tWorkspaceID string\n\n\tMachineID    string\n\tMachineReuse bool\n\n\tProviderID    string\n\tProviderReuse bool\n\n\tData string\n}\n\n// NewImportCmd creates a new command\nfunc NewImportCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ImportCmd{\n\t\tGlobalFlags: flags,\n\t}\n\timportCmd := &cobra.Command{\n\t\tUse:    \"import\",\n\t\tShort:  \"Imports a workspace configuration\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tctx := context.Background()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, log.Default)\n\t\t},\n\t}\n\n\timportCmd.Flags().StringVar(&cmd.WorkspaceID, \"workspace-id\", \"\", \"To workspace id to use\")\n\timportCmd.Flags().StringVar(&cmd.MachineID, \"machine-id\", \"\", \"The machine id to use\")\n\timportCmd.Flags().BoolVar(&cmd.MachineReuse, \"machine-reuse\", false, \"If machine already exists, reuse existing machine\")\n\timportCmd.Flags().StringVar(&cmd.ProviderID, \"provider-id\", \"\", \"The provider id to use\")\n\timportCmd.Flags().BoolVar(&cmd.ProviderReuse, \"provider-reuse\", false, \"If provider already exists, reuse existing provider\")\n\timportCmd.Flags().StringVar(&cmd.Data, \"data\", \"\", \"The data to import as raw json\")\n\t_ = importCmd.MarkFlagRequired(\"data\")\n\treturn importCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ImportCmd) Run(ctx context.Context, devPodConfig *config.Config, log log.Logger) error {\n\texportConfig := &provider.ExportConfig{}\n\terr := json.Unmarshal([]byte(cmd.Data), exportConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode workspace data: %w\", err)\n\t} else if exportConfig.Workspace == nil {\n\t\treturn fmt.Errorf(\"workspace is missing in imported data\")\n\t} else if exportConfig.Provider == nil {\n\t\treturn fmt.Errorf(\"provider is missing in imported data\")\n\t}\n\n\t// set ids correctly\n\tif cmd.MachineID == \"\" && exportConfig.Machine != nil {\n\t\tcmd.MachineID = exportConfig.Machine.ID\n\t}\n\tif cmd.WorkspaceID == \"\" {\n\t\tcmd.WorkspaceID = exportConfig.Workspace.ID\n\t}\n\tif cmd.ProviderID == \"\" {\n\t\tcmd.ProviderID = exportConfig.Provider.ID\n\t}\n\n\t// check if conflicting ids\n\terr = cmd.checkForConflictingIDs(ctx, exportConfig, devPodConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// import provider\n\terr = cmd.importProvider(devPodConfig, exportConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// import machine\n\terr = cmd.importMachine(devPodConfig, exportConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// import workspace\n\terr = cmd.importWorkspace(devPodConfig, exportConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *ImportCmd) importWorkspace(devPodConfig *config.Config, exportConfig *provider.ExportConfig, log log.Logger) error {\n\tworkspaceDir, err := provider.GetWorkspaceDir(devPodConfig.DefaultContext, cmd.WorkspaceID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get workspace dir: %w\", err)\n\t}\n\n\terr = os.MkdirAll(workspaceDir, 0755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create workspace dir: %w\", err)\n\t}\n\n\tdecoded, err := base64.RawStdEncoding.DecodeString(exportConfig.Workspace.Data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode workspace data: %w\", err)\n\t}\n\n\terr = extract.Extract(bytes.NewReader(decoded), workspaceDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"extract workspace data: %w\", err)\n\t}\n\n\t// exchange config\n\tworkspaceConfig, err := provider.LoadWorkspaceConfig(devPodConfig.DefaultContext, cmd.WorkspaceID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load machine config: %w\", err)\n\t}\n\tworkspaceConfig.ID = cmd.WorkspaceID\n\tworkspaceConfig.Context = devPodConfig.DefaultContext\n\tworkspaceConfig.Machine.ID = cmd.MachineID\n\tworkspaceConfig.Provider.Name = cmd.ProviderID\n\n\t// save machine config\n\terr = provider.SaveWorkspaceConfig(workspaceConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save workspace config: %w\", err)\n\t}\n\n\tlog.Donef(\"Successfully imported workspace %s\", cmd.WorkspaceID)\n\treturn nil\n}\n\nfunc (cmd *ImportCmd) importMachine(devPodConfig *config.Config, exportConfig *provider.ExportConfig, log log.Logger) error {\n\tif exportConfig.Machine == nil {\n\t\treturn nil\n\t}\n\n\t// if machine already exists we skip\n\tif cmd.MachineReuse && provider.MachineExists(devPodConfig.DefaultContext, cmd.MachineID) {\n\t\tlog.Infof(\"Reusing existing machine %s\", cmd.MachineID)\n\t\treturn nil\n\t}\n\n\tmachineDir, err := provider.GetMachineDir(devPodConfig.DefaultContext, cmd.MachineID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get machine dir: %w\", err)\n\t}\n\n\terr = os.MkdirAll(machineDir, 0755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create machine dir: %w\", err)\n\t}\n\n\tdecoded, err := base64.RawStdEncoding.DecodeString(exportConfig.Machine.Data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode machine data: %w\", err)\n\t}\n\n\terr = extract.Extract(bytes.NewReader(decoded), machineDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"extract machine data: %w\", err)\n\t}\n\n\t// exchange config\n\tmachineConfig, err := provider.LoadMachineConfig(devPodConfig.DefaultContext, cmd.MachineID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load machine config: %w\", err)\n\t}\n\tmachineConfig.ID = cmd.MachineID\n\tmachineConfig.Context = devPodConfig.DefaultContext\n\tmachineConfig.Provider.Name = cmd.ProviderID\n\n\t// save machine config\n\terr = provider.SaveMachineConfig(machineConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save machine config: %w\", err)\n\t}\n\n\tlog.Donef(\"Successfully imported machine %s\", cmd.MachineID)\n\treturn nil\n}\n\nfunc (cmd *ImportCmd) importProvider(devPodConfig *config.Config, exportConfig *provider.ExportConfig, log log.Logger) error {\n\t// if provider already exists we skip\n\tif cmd.ProviderReuse && provider.ProviderExists(devPodConfig.DefaultContext, cmd.ProviderID) {\n\t\tlog.Infof(\"Reusing existing provider %s\", cmd.ProviderID)\n\t\treturn nil\n\t}\n\n\tproviderDir, err := provider.GetProviderDir(devPodConfig.DefaultContext, cmd.ProviderID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get provider dir: %w\", err)\n\t}\n\n\terr = os.MkdirAll(providerDir, 0755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create provider dir: %w\", err)\n\t}\n\n\tdecoded, err := base64.RawStdEncoding.DecodeString(exportConfig.Provider.Data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode provider data: %w\", err)\n\t}\n\n\terr = extract.Extract(bytes.NewReader(decoded), providerDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"extract provider data: %w\", err)\n\t}\n\n\t// exchange config\n\tproviderConfig, err := provider.LoadProviderConfig(devPodConfig.DefaultContext, cmd.ProviderID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load provider config: %w\", err)\n\t}\n\tproviderConfig.Name = cmd.ProviderID\n\n\t// save provider config\n\terr = provider.SaveProviderConfig(devPodConfig.DefaultContext, providerConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save provider config: %w\", err)\n\t}\n\n\t// add provider options\n\tif exportConfig.Provider.Config != nil {\n\t\tif devPodConfig.Current().Providers == nil {\n\t\t\tdevPodConfig.Current().Providers = map[string]*config.ProviderConfig{}\n\t\t}\n\n\t\tdevPodConfig.Current().Providers[cmd.ProviderID] = exportConfig.Provider.Config\n\t\terr = config.SaveConfig(devPodConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"save devpod config: %w\", err)\n\t\t}\n\t}\n\n\tlog.Donef(\"Successfully imported provider %s\", cmd.ProviderID)\n\treturn nil\n}\n\nfunc (cmd *ImportCmd) checkForConflictingIDs(ctx context.Context, exportConfig *provider.ExportConfig, devPodConfig *config.Config, log log.Logger) error {\n\tworkspaces, err := workspace.List(ctx, devPodConfig, false, cmd.Owner, log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error listing workspaces: %w\", err)\n\t}\n\n\t// check for workspace duplicate\n\tif exportConfig.Workspace != nil {\n\t\tfor _, workspace := range workspaces {\n\t\t\tif workspace.ID == cmd.WorkspaceID {\n\t\t\t\treturn fmt.Errorf(\"existing workspace with id %s found, please use --workspace-id to override the workspace id\", cmd.WorkspaceID)\n\t\t\t} else if workspace.UID == exportConfig.Workspace.UID {\n\t\t\t\treturn fmt.Errorf(\"existing workspace %s with uid %s found, please use --workspace-id to override the workspace id\", workspace.ID, workspace.UID)\n\t\t\t}\n\t\t}\n\t}\n\n\t// check if machine already exists\n\tif !cmd.MachineReuse && exportConfig.Machine != nil {\n\t\tif provider.MachineExists(devPodConfig.DefaultContext, cmd.MachineID) {\n\t\t\treturn fmt.Errorf(\"existing machine with id %s found, please use --machine-reuse to skip importing the machine or --machine-id to override the machine id\", cmd.MachineID)\n\t\t}\n\t}\n\n\t// check if provider already exists\n\tif !cmd.ProviderReuse && exportConfig.Provider != nil {\n\t\tif provider.ProviderExists(devPodConfig.DefaultContext, cmd.ProviderID) {\n\t\t\treturn fmt.Errorf(\"existing provider with id %s found, please use --provider-reuse to skip importing the provider or --provider-id to override the provider id\", cmd.ProviderID)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/list.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the configuration\ntype ListCmd struct {\n\t*flags.GlobalFlags\n\n\tOutput  string\n\tSkipPro bool\n}\n\n// NewListCmd creates a new destroy command\nfunc NewListCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"Lists existing workspaces\",\n\t\tArgs:    cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) > 0 {\n\t\t\t\treturn fmt.Errorf(\"no arguments are allowed for this command\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\tlistCmd.Flags().BoolVar(&cmd.SkipPro, \"skip-pro\", false, \"Don't list pro workspaces\")\n\treturn listCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaces, err := workspace.List(ctx, devPodConfig, cmd.SkipPro, cmd.Owner, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"json\" {\n\t\tsort.SliceStable(workspaces, func(i, j int) bool {\n\t\t\treturn workspaces[i].LastUsedTimestamp.Time.Unix() > workspaces[j].LastUsedTimestamp.Time.Unix()\n\t\t})\n\t\tout, err := json.Marshal(workspaces)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else if cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tsort.SliceStable(workspaces, func(i, j int) bool {\n\t\t\treturn workspaces[i].LastUsedTimestamp.Time.Unix() > workspaces[j].LastUsedTimestamp.Time.Unix()\n\t\t})\n\t\tfor _, entry := range workspaces {\n\t\t\tname := entry.ID\n\t\t\tif entry.IsPro() && entry.Pro.DisplayName != \"\" && entry.ID != entry.Pro.DisplayName {\n\t\t\t\tname = fmt.Sprintf(\"%s (%s)\", entry.Pro.DisplayName, entry.ID)\n\t\t\t}\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tname,\n\t\t\t\tentry.Source.String(),\n\t\t\t\tentry.Machine.ID,\n\t\t\t\tentry.Provider.Name,\n\t\t\t\tentry.IDE.Name,\n\t\t\t\ttime.Since(entry.LastUsedTimestamp.Time).Round(1 * time.Second).String(),\n\t\t\t\ttime.Since(entry.CreationTimestamp.Time).Round(1 * time.Second).String(),\n\t\t\t\tfmt.Sprintf(\"%t\", entry.IsPro()),\n\t\t\t})\n\t\t}\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Source\",\n\t\t\t\"Machine\",\n\t\t\t\"Provider\",\n\t\t\t\"IDE\",\n\t\t\t\"Last Used\",\n\t\t\t\"Age\",\n\t\t\t\"Pro\",\n\t\t}, tableEntries)\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/logs.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// LogsCmd holds the configuration\ntype LogsCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewLogsCmd creates a new destroy command\nfunc NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &LogsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstartCmd := &cobra.Command{\n\t\tUse:   \"logs [flags] [workspace-path|workspace-name]\",\n\t\tShort: \"Prints the workspace logs on the machine\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\treturn startCmd\n}\n\n// Run runs the command logic\nfunc (cmd *LogsCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseClient, err := workspace.Get(ctx, devPodConfig, args, false, cmd.Owner, false, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient, ok := baseClient.(clientpkg.WorkspaceClient)\n\tif !ok {\n\t\treturn fmt.Errorf(\"this command is not supported for proxy providers\")\n\t}\n\tlog := log.Default\n\n\t// create readers\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\t// ssh tunnel command\n\tsshServerCmd := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", client.AgentPath())\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tsshServerCmd += \" --debug\"\n\t}\n\n\t// Get the timeout from the context options\n\ttimeout := config.ParseTimeOption(devPodConfig, config.ContextOptionAgentInjectTimeout)\n\n\t// start ssh server in background\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tstderr := log.ErrorStreamOnly().Writer(logrus.DebugLevel, false)\n\t\tdefer stderr.Close()\n\n\t\terrChan <- agent.InjectAgentAndExecute(\n\t\t\tctx,\n\t\t\tfunc(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\t\treturn client.Command(ctx, clientpkg.CommandOptions{\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tStdin:   stdin,\n\t\t\t\t\tStdout:  stdout,\n\t\t\t\t\tStderr:  stderr,\n\t\t\t\t})\n\t\t\t},\n\t\t\tclient.AgentLocal(),\n\t\t\tclient.AgentPath(),\n\t\t\tclient.AgentURL(),\n\t\t\ttrue,\n\t\t\tsshServerCmd,\n\t\t\tstdinReader,\n\t\t\tstdoutWriter,\n\t\t\tstderr,\n\t\t\tlog.ErrorStreamOnly(), timeout)\n\t}()\n\n\t// create agent command\n\tagentCommand := fmt.Sprintf(\"'%s' agent workspace logs --context '%s' --id '%s'\", client.AgentPath(), client.Context(), client.Workspace())\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tagentCommand += \" --debug\"\n\t}\n\n\t// create new ssh client\n\t// start ssh client as root / default user\n\tsshClient, err := ssh.StdioClientWithUser(stdoutReader, stdinWriter, \"\" /* default */, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sshClient.Close()\n\n\tsession, err := sshClient.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer session.Close()\n\n\tsession.Stdout = os.Stdout\n\tsession.Stderr = os.Stderr\n\terr = session.Run(agentCommand)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/logs_daemon.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// LogsDaemonCmd holds the configuration\ntype LogsDaemonCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewLogsDaemonCmd creates a new destroy command\nfunc NewLogsDaemonCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &LogsDaemonCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstartCmd := &cobra.Command{\n\t\tUse:   \"logs-daemon\",\n\t\tShort: \"Prints the daemon logs on the machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn startCmd\n}\n\n// Run runs the command logic\nfunc (cmd *LogsDaemonCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseClient, err := workspace.Get(ctx, devPodConfig, args, false, cmd.Owner, false, log.Default)\n\tif err != nil {\n\t\treturn err\n\t} else if baseClient.WorkspaceConfig().Machine.ID == \"\" {\n\t\treturn fmt.Errorf(\"selected workspace is not a machine provider, there is not daemon running\")\n\t}\n\n\tworkspaceClient, ok := baseClient.(client.WorkspaceClient)\n\tif !ok {\n\t\treturn fmt.Errorf(\"this command is not supported for proxy providers\")\n\t}\n\n\t_, agentInfo, err := workspaceClient.AgentInfo(provider2.CLIOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcommand := fmt.Sprintf(\"'%s' agent workspace logs-daemon --context '%s' --id '%s'\", workspaceClient.AgentPath(), workspaceClient.Context(), workspaceClient.Workspace())\n\tif agentInfo.Agent.DataPath != \"\" {\n\t\tcommand += fmt.Sprintf(\" --agent-dir '%s'\", agentInfo.Agent.DataPath)\n\t}\n\n\t// read daemon logs\n\treturn workspaceClient.Command(ctx, client.CommandOptions{\n\t\tCommand: command,\n\t\tStdout:  os.Stdout,\n\t\tStderr:  os.Stderr,\n\t})\n}\n"
  },
  {
    "path": "cmd/machine/create.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// CreateCmd holds the configuration\ntype CreateCmd struct {\n\t*flags.GlobalFlags\n\n\tProviderOptions []string\n}\n\n// NewCreateCmd creates a new create command\nfunc NewCreateCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tcreateCmd := &cobra.Command{\n\t\tUse:   \"create [name]\",\n\t\tShort: \"Creates a new machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\tcreateCmd.Flags().StringSliceVar(&cmd.ProviderOptions, \"provider-option\", []string{}, \"Provider option in the form KEY=VALUE\")\n\treturn createCmd\n}\n\n// Run runs the command logic\nfunc (cmd *CreateCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.ResolveMachine(devPodConfig, args, cmd.ProviderOptions, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = machineClient.Create(ctx, client.CreateOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/delete.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DeleteCmd holds the configuration\ntype DeleteCmd struct {\n\t*flags.GlobalFlags\n\n\tGracePeriod string\n\tForce       bool\n}\n\n// NewDeleteCmd creates a new destroy command\nfunc NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete [name]\",\n\t\tShort: \"Deletes an existing machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tdeleteCmd.Flags().StringVar(&cmd.GracePeriod, \"grace-period\", \"\", \"The amount of time to give the command to delete the workspace\")\n\tdeleteCmd.Flags().BoolVar(&cmd.Force, \"force\", false, \"Delete workspace even if it is not found remotely anymore\")\n\treturn deleteCmd\n}\n\n// Run runs the command logic\nfunc (cmd *DeleteCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if there are workspaces that still use this machine\n\tworkspaces, err := workspace.List(ctx, devPodConfig, false, platform.SelfOwnerFilter, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// search for workspace that uses this machine\n\tfor _, workspace := range workspaces {\n\t\tif workspace.Machine.ID == machineClient.Machine() {\n\t\t\treturn fmt.Errorf(\"cannot delete machine '%s', because workspace '%s' is still using it. Please delete the workspace '%s' before deleting the machine\", workspace.Machine.ID, workspace.ID, workspace.ID)\n\t\t}\n\t}\n\n\terr = machineClient.Delete(ctx, client.DeleteOptions{\n\t\tForce:       cmd.Force,\n\t\tGracePeriod: cmd.GracePeriod,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/inspect.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype InspectCmd struct {\n\t*flags.GlobalFlags\n}\n\nfunc NewInspectCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &InspectCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstopCmd := &cobra.Command{\n\t\tUse:   \"inspect\",\n\t\tShort: \"Inspects an existing machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn stopCmd\n}\n\nfunc (cmd *InspectCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp, err := provider.LoadProviderConfig(devPodConfig.DefaultContext, machineClient.Provider())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineConfig := machineClient.MachineConfig()\n\tfor k := range machineConfig.Provider.Options {\n\t\toptConfig := p.Options[k]\n\t\tif optConfig.Hidden {\n\t\t\tdelete(machineConfig.Provider.Options, k)\n\t\t\tcontinue\n\t\t}\n\n\t\tif optConfig.Password {\n\t\t\topt := machineConfig.Provider.Options[k]\n\t\t\topt.Value = \"********\"\n\t\t}\n\t}\n\n\tout, err := json.MarshalIndent(machineConfig, \"\", \"  \")\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/list.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the configuration\ntype ListCmd struct {\n\t*flags.GlobalFlags\n\n\tOutput string\n}\n\n// NewListCmd creates a new destroy command\nfunc NewListCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"Lists existing machines\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn listCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineDir, err := provider.GetMachinesDir(devPodConfig.DefaultContext)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tentries, err := os.ReadDir(machineDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor _, entry := range entries {\n\t\t\tmachineConfig, err := provider.LoadMachineConfig(devPodConfig.DefaultContext, entry.Name())\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"load machine config\")\n\t\t\t}\n\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tmachineConfig.ID,\n\t\t\t\tmachineConfig.Provider.Name,\n\t\t\t\ttime.Since(machineConfig.CreationTimestamp.Time).Round(1 * time.Second).String(),\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Provider\",\n\t\t\t\"Age\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\ttableEntries := []*provider.Machine{}\n\t\tfor _, entry := range entries {\n\t\t\tmachineConfig, err := provider.LoadMachineConfig(devPodConfig.DefaultContext, entry.Name())\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"load machine config\")\n\t\t\t}\n\n\t\t\ttableEntries = append(tableEntries, machineConfig)\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i].ID < tableEntries[j].ID\n\t\t})\n\t\tout, err := json.Marshal(tableEntries)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/machine.go",
    "content": "package machine\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewMachineCmd returns a new root command\nfunc NewMachineCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tmachineCmd := &cobra.Command{\n\t\tUse:   \"machine\",\n\t\tShort: \"DevPod Machine commands\",\n\t}\n\n\tmachineCmd.AddCommand(NewListCmd(flags))\n\tmachineCmd.AddCommand(NewSSHCmd(flags))\n\tmachineCmd.AddCommand(NewStopCmd(flags))\n\tmachineCmd.AddCommand(NewStartCmd(flags))\n\tmachineCmd.AddCommand(NewStatusCmd(flags))\n\tmachineCmd.AddCommand(NewDeleteCmd(flags))\n\tmachineCmd.AddCommand(NewCreateCmd(flags))\n\tmachineCmd.AddCommand(NewInspectCmd(flags))\n\treturn machineCmd\n}\n"
  },
  {
    "path": "cmd/machine/ssh.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tdevagent \"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\tdevsshagent \"github.com/loft-sh/devpod/pkg/ssh/agent\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/mattn/go-isatty\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/term\"\n)\n\n// SSHCmd holds the configuration\ntype SSHCmd struct {\n\t*flags.GlobalFlags\n\n\tCommand         string\n\tAgentForwarding bool\n}\n\n// NewSSHCmd creates a new destroy command\nfunc NewSSHCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SSHCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh [name]\",\n\t\tShort: \"SSH into the machine\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tsshCmd.Flags().StringVar(&cmd.Command, \"command\", \"\", \"The command to execute on the remote machine\")\n\tsshCmd.Flags().BoolVar(&cmd.AgentForwarding, \"agent-forwarding\", false, \"If true, will forward the local ssh keys\")\n\treturn sshCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SSHCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twriter := log.Default.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// Get the timeout from the context options\n\ttimeout := config.ParseTimeOption(devPodConfig, config.ContextOptionAgentInjectTimeout)\n\n\t// start the ssh session\n\treturn StartSSHSession(\n\t\tctx,\n\t\t\"\",\n\t\tcmd.Command,\n\t\tcmd.AgentForwarding,\n\t\tfunc(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\tcommand := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", machineClient.AgentPath())\n\t\t\tif cmd.Debug {\n\t\t\t\tcommand += \" --debug\"\n\t\t\t}\n\t\t\treturn devagent.InjectAgentAndExecute(ctx, func(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\t\treturn machineClient.Command(ctx, client.CommandOptions{\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tStdin:   stdin,\n\t\t\t\t\tStdout:  stdout,\n\t\t\t\t\tStderr:  stderr,\n\t\t\t\t})\n\t\t\t},\n\t\t\t\tmachineClient.AgentLocal(),\n\t\t\t\tmachineClient.AgentPath(),\n\t\t\t\tmachineClient.AgentURL(),\n\t\t\t\ttrue,\n\t\t\t\tcommand,\n\t\t\t\tstdin,\n\t\t\t\tstdout,\n\t\t\t\tstderr,\n\t\t\t\tlog.Default.ErrorStreamOnly(),\n\t\t\t\ttimeout)\n\t\t}, writer)\n}\n\ntype ExecFunc func(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\nfunc StartSSHSession(ctx context.Context, user, command string, agentForwarding bool, exec ExecFunc, stderr io.Writer) error {\n\t// create readers\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdoutReader.Close()\n\tdefer stdoutWriter.Close()\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdinWriter.Close()\n\tdefer stdinReader.Close()\n\n\t// start ssh machine\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\terrChan <- exec(ctx, stdinReader, stdoutWriter, stderr)\n\t}()\n\n\tsshClient, err := devssh.StdioClientWithUser(stdoutReader, stdinWriter, user, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sshClient.Close()\n\n\treturn RunSSHSession(ctx, sshClient, agentForwarding, command, stderr)\n}\n\nfunc RunSSHSession(ctx context.Context, sshClient *ssh.Client, agentForwarding bool, command string, stderr io.Writer) error {\n\t// create a new session\n\tsession, err := sshClient.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer session.Close()\n\n\t// request agent forwarding\n\tauthSock := devsshagent.GetSSHAuthSocket()\n\tif agentForwarding && authSock != \"\" {\n\t\terr = devsshagent.ForwardToRemote(sshClient, authSock)\n\t\tif err != nil {\n\t\t\treturn errors.Errorf(\"forward agent: %v\", err)\n\t\t}\n\n\t\terr = devsshagent.RequestAgentForwarding(session)\n\t\tif err != nil {\n\t\t\treturn errors.Errorf(\"request agent forwarding: %v\", err)\n\t\t}\n\t}\n\n\tstdout := os.Stdout\n\tstdin := os.Stdin\n\n\tif isatty.IsTerminal(stdout.Fd()) {\n\t\tstate, err := term.MakeRaw(int(stdout.Fd()))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\t_ = term.Restore(int(stdout.Fd()), state)\n\t\t}()\n\n\t\twindowChange := devssh.WatchWindowSize(ctx)\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\tcase <-windowChange:\n\t\t\t\t}\n\t\t\t\twidth, height, err := term.GetSize(int(stdout.Fd()))\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t_ = session.WindowChange(height, width)\n\t\t\t}\n\t\t}()\n\n\t\t// get initial terminal\n\t\tt := \"xterm-256color\"\n\t\ttermEnv, ok := os.LookupEnv(\"TERM\")\n\t\tif ok {\n\t\t\tt = termEnv\n\t\t}\n\t\t// get initial window size\n\t\twidth, height := 80, 40\n\t\tif w, h, err := term.GetSize(int(stdout.Fd())); err == nil {\n\t\t\twidth, height = w, h\n\t\t}\n\t\tif err = session.RequestPty(t, height, width, ssh.TerminalModes{}); err != nil {\n\t\t\treturn fmt.Errorf(\"request pty: %w\", err)\n\t\t}\n\t}\n\n\tsession.Stdin = stdin\n\tsession.Stdout = stdout\n\tsession.Stderr = stderr\n\tif command == \"\" {\n\t\tif err := session.Shell(); err != nil {\n\t\t\treturn fmt.Errorf(\"start ssh session with shell: %w\", err)\n\t\t}\n\t} else {\n\t\tif err := session.Start(command); err != nil {\n\t\t\treturn fmt.Errorf(\"start ssh session with command %s: %w\", command, err)\n\t\t}\n\t}\n\n\tif err := session.Wait(); err != nil {\n\t\treturn fmt.Errorf(\"ssh session: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/start.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StartCmd holds the configuration\ntype StartCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewStartCmd creates a new destroy command\nfunc NewStartCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StartCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstartCmd := &cobra.Command{\n\t\tUse:   \"start [name]\",\n\t\tShort: \"Starts an existing machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn startCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StartCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = machineClient.Start(ctx, client.StartOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/status.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StatusCmd holds the configuration\ntype StatusCmd struct {\n\t*flags.GlobalFlags\n\n\tOutput string\n}\n\n// NewStatusCmd creates a new destroy command\nfunc NewStatusCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StatusCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstatusCmd := &cobra.Command{\n\t\tUse:   \"status [name]\",\n\t\tShort: \"Retrieves the status of an existing machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tstatusCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"Status shows the machine status\")\n\treturn statusCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StatusCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// get status\n\tmachineStatus, err := machineClient.Status(ctx, client.StatusOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\tif machineStatus == client.StatusStopped {\n\t\t\tlog.Default.Infof(\"Machine '%s' is '%s', you can start it via 'devpod machine start %s'\", machineClient.Machine(), machineStatus, machineClient.Machine())\n\t\t} else if machineStatus == client.StatusBusy {\n\t\t\tlog.Default.Infof(\"Machine '%s' is '%s', which means its currently unaccessible. This is usually resolved by waiting a couple of minutes\", machineClient.Machine(), machineStatus)\n\t\t} else if machineStatus == client.StatusNotFound {\n\t\t\tlog.Default.Infof(\"Machine '%s' is '%s'\", machineClient.Machine(), machineStatus)\n\t\t} else {\n\t\t\tlog.Default.Infof(\"Machine '%s' is '%s'\", machineClient.Machine(), machineStatus)\n\t\t}\n\t} else if cmd.Output == \"json\" {\n\t\tout, err := json.Marshal(struct {\n\t\t\tID       string `json:\"id,omitempty\"`\n\t\t\tContext  string `json:\"context,omitempty\"`\n\t\t\tProvider string `json:\"provider,omitempty\"`\n\t\t\tState    string `json:\"state,omitempty\"`\n\t\t}{\n\t\t\tID:       machineClient.Machine(),\n\t\t\tContext:  machineClient.Context(),\n\t\t\tProvider: machineClient.Provider(),\n\t\t\tState:    string(machineStatus),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/machine/stop.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StopCmd holds the configuration\ntype StopCmd struct {\n\t*flags.GlobalFlags\n}\n\n// NewStopCmd creates a new destroy command\nfunc NewStopCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StopCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstopCmd := &cobra.Command{\n\t\tUse:   \"stop [name]\",\n\t\tShort: \"Stops an existing machine\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\treturn stopCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StopCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineClient, err := workspace.GetMachine(devPodConfig, args, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = machineClient.Stop(ctx, client.StopOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/ping.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype PingCmd struct {\n\t*flags.GlobalFlags\n}\n\nfunc NewPingCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &PingCmd{\n\t\tGlobalFlags: flags,\n\t}\n\ttroubleshootCmd := &cobra.Command{\n\t\tUse:   \"ping [workspace-path|workspace-name]\",\n\t\tShort: \"Pings the DevPod Pro workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t\tHidden: true,\n\t}\n\n\treturn troubleshootCmd\n}\n\nfunc (cmd *PingCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient, err := workspace2.Get(ctx, devPodConfig, args, true, cmd.Owner, false, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdaemonClient, ok := client.(client2.DaemonClient)\n\tif !ok {\n\t\treturn fmt.Errorf(\"ping is only available for pro workspaces\")\n\t}\n\n\treturn daemonClient.Ping(ctx, os.Stdout)\n}\n"
  },
  {
    "path": "cmd/pro/add/add.go",
    "content": "package add\n\nimport (\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewAddCmd creates a new command\nfunc NewAddCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {\n\taddCmd := &cobra.Command{\n\t\tUse:   \"add\",\n\t\tShort: \"Adds a given resource to DevPod Pro\",\n\t\tArgs:  cobra.NoArgs,\n\t}\n\n\taddCmd.AddCommand(NewClusterCmd(globalFlags))\n\treturn addCmd\n}\n"
  },
  {
    "path": "cmd/pro/add/cluster.go",
    "content": "package add\n\nimport (\n\t\"cmp\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/sirupsen/logrus\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/client-go/kubernetes\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n)\n\ntype ClusterCmd struct {\n\tLog log.Logger\n\t*proflags.GlobalFlags\n\n\tNamespace        string\n\tServiceAccount   string\n\tDisplayName      string\n\tKubeContext      string\n\tInsecure         bool\n\tWait             bool\n\tHelmChartPath    string\n\tHelmChartVersion string\n\tHelmSet          []string\n\tHelmValues       []string\n\tHost             string\n}\n\n// NewClusterCmd creates a new command\nfunc NewClusterCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &ClusterCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\n\tc := &cobra.Command{\n\t\tUse:   \"cluster <cluster-name>\",\n\t\tShort: \"add current cluster to DevPod Pro\",\n\t\tArgs:  cobra.ExactArgs(1),\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Namespace, \"namespace\", \"loft\", \"The namespace to generate the service account in. The namespace will be created if it does not exist\")\n\tc.Flags().StringVar(&cmd.ServiceAccount, \"service-account\", \"loft-admin\", \"The service account name to create\")\n\tc.Flags().StringVar(&cmd.DisplayName, \"display-name\", \"\", \"The display name to show in the UI for this cluster\")\n\tc.Flags().BoolVar(&cmd.Wait, \"wait\", false, \"If true, will wait until the cluster is initialized\")\n\tc.Flags().BoolVar(&cmd.Insecure, \"insecure\", false, \"If true, deploys the agent in insecure mode\")\n\tc.Flags().StringVar(&cmd.HelmChartVersion, \"helm-chart-version\", \"\", \"The agent chart version to deploy\")\n\tc.Flags().StringVar(&cmd.HelmChartPath, \"helm-chart-path\", \"\", \"The agent chart to deploy\")\n\tc.Flags().StringArrayVar(&cmd.HelmSet, \"helm-set\", []string{}, \"Extra helm values for the agent chart\")\n\tc.Flags().StringArrayVar(&cmd.HelmValues, \"helm-values\", []string{}, \"Extra helm values for the agent chart\")\n\tc.Flags().StringVar(&cmd.KubeContext, \"kube-context\", \"\", \"The kube context to use for installation\")\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\n\treturn c\n}\n\nfunc (cmd *ClusterCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcmd.Host, err = ensureHost(devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get clusterName from command argument\n\tclusterName := args[0]\n\n\tbaseClient, err := platform.InitClientFromHost(ctx, devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tloftVersion, err := baseClient.Version()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get pro version: %w\", err)\n\t}\n\n\tuser, team := getUserOrTeam(ctx, baseClient)\n\n\t_, err = managementClient.Loft().ManagementV1().Clusters().Create(ctx, &managementv1.Cluster{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: clusterName,\n\t\t},\n\t\tSpec: managementv1.ClusterSpec{\n\t\t\tClusterSpec: storagev1.ClusterSpec{\n\t\t\t\tDisplayName: cmd.DisplayName,\n\t\t\t\tOwner: &storagev1.UserOrTeam{\n\t\t\t\t\tUser: user,\n\t\t\t\t\tTeam: team,\n\t\t\t\t},\n\t\t\t\tNetworkPeer: true,\n\t\t\t\tAccess:      getAccess(user, team),\n\t\t\t},\n\t\t},\n\t}, metav1.CreateOptions{})\n\tif err != nil && !kerrors.IsAlreadyExists(err) {\n\t\treturn fmt.Errorf(\"create cluster: %w\", err)\n\t}\n\n\taccessKey, err := managementClient.Loft().ManagementV1().Clusters().GetAccessKey(ctx, clusterName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get cluster access key: %w\", err)\n\t}\n\n\tnamespace := cmd.Namespace\n\n\thelmArgs := []string{\n\t\t\"upgrade\", \"loft\",\n\t}\n\n\tif os.Getenv(\"DEVELOPMENT\") == \"true\" {\n\t\thelmArgs = []string{\n\t\t\t\"upgrade\", \"--install\", \"loft\", cmp.Or(os.Getenv(\"DEVELOPMENT_CHART_DIR\"), \"./chart\"),\n\t\t\t\"--create-namespace\",\n\t\t\t\"--namespace\", namespace,\n\t\t\t\"--set\", \"agentOnly=true\",\n\t\t\t\"--set\", \"image=\" + cmp.Or(os.Getenv(\"DEVELOPMENT_IMAGE\"), \"ghcr.io/loft-sh/enterprise:release-test\"),\n\t\t}\n\t} else {\n\t\tif cmd.HelmChartPath != \"\" {\n\t\t\thelmArgs = append(helmArgs, cmd.HelmChartPath)\n\t\t} else {\n\t\t\thelmArgs = append(helmArgs, \"loft\", \"--repo\", \"https://charts.loft.sh\")\n\t\t}\n\n\t\tif loftVersion.Version != \"\" {\n\t\t\thelmArgs = append(helmArgs, \"--version\", loftVersion.Version)\n\t\t}\n\n\t\tif cmd.HelmChartVersion != \"\" {\n\t\t\thelmArgs = append(helmArgs, \"--version\", cmd.HelmChartVersion)\n\t\t}\n\n\t\t// general arguments\n\t\thelmArgs = append(helmArgs, \"--install\", \"--create-namespace\", \"--namespace\", cmd.Namespace, \"--set\", \"agentOnly=true\")\n\t}\n\n\tfor _, set := range cmd.HelmSet {\n\t\thelmArgs = append(helmArgs, \"--set\", set)\n\t}\n\tfor _, values := range cmd.HelmValues {\n\t\thelmArgs = append(helmArgs, \"--values\", values)\n\t}\n\n\tif accessKey.LoftHost != \"\" {\n\t\thelmArgs = append(helmArgs, \"--set\", \"url=\"+accessKey.LoftHost)\n\t}\n\n\tif accessKey.AccessKey != \"\" {\n\t\thelmArgs = append(helmArgs, \"--set\", \"token=\"+accessKey.AccessKey)\n\t}\n\n\tif cmd.Insecure || accessKey.Insecure {\n\t\thelmArgs = append(helmArgs, \"--set\", \"insecureSkipVerify=true\")\n\t}\n\n\tif accessKey.CaCert != \"\" {\n\t\thelmArgs = append(helmArgs, \"--set\", \"additionalCA=\"+accessKey.CaCert)\n\t}\n\n\tif cmd.Wait {\n\t\thelmArgs = append(helmArgs, \"--wait\")\n\t}\n\n\tif cmd.KubeContext != \"\" {\n\t\thelmArgs = append(helmArgs, \"--kube-context\", cmd.KubeContext)\n\t}\n\n\tkubeClientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{})\n\n\tif cmd.KubeContext != \"\" {\n\t\tkubeConfig, err := kubeClientConfig.RawConfig()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"there is an error loading your current kube config (%w), please make sure you have access to a kubernetes cluster and the command `kubectl get namespaces` is working\", err)\n\t\t}\n\n\t\tkubeClientConfig = clientcmd.NewNonInteractiveClientConfig(kubeConfig, cmd.KubeContext, &clientcmd.ConfigOverrides{}, clientcmd.NewDefaultClientConfigLoadingRules())\n\t}\n\n\tconfig, err := kubeClientConfig.ClientConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"there is an error loading your current kube config (%w), please make sure you have access to a kubernetes cluster and the command `kubectl get namespaces` is working\", err)\n\t}\n\n\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create kube client: %w\", err)\n\t}\n\n\terrChan := make(chan error)\n\n\tgo func() {\n\t\thelmCmd := exec.CommandContext(ctx, \"helm\", helmArgs...)\n\n\t\thelmCmd.Stdout = cmd.Log.Writer(logrus.DebugLevel, true)\n\t\thelmCmd.Stderr = cmd.Log.Writer(logrus.DebugLevel, true)\n\t\thelmCmd.Stdin = os.Stdin\n\n\t\tcmd.Log.Info(\"Installing agent...\")\n\t\tcmd.Log.Debugf(\"Running helm command: %v\", helmCmd.Args)\n\n\t\terr = helmCmd.Run()\n\t\tif err != nil {\n\t\t\terrChan <- fmt.Errorf(\"failed to install chart: %w\", err)\n\t\t}\n\n\t\tclose(errChan)\n\t}()\n\n\t_, err = platform.WaitForPodReady(ctx, clientset, namespace, cmd.Log)\n\tif err = errors.Join(err, <-errChan); err != nil {\n\t\treturn fmt.Errorf(\"wait for pod: %w\", err)\n\t}\n\n\tif cmd.Wait {\n\t\tcmd.Log.Info(\"Waiting for the cluster to be initialized...\")\n\t\twaitErr := wait.PollUntilContextTimeout(ctx, time.Second, 5*time.Minute, false, func(ctx context.Context) (done bool, err error) {\n\t\t\tclusterInstance, err := managementClient.Loft().ManagementV1().Clusters().Get(ctx, clusterName, metav1.GetOptions{})\n\t\t\tif err != nil && !kerrors.IsNotFound(err) {\n\t\t\t\treturn false, err\n\t\t\t}\n\n\t\t\treturn clusterInstance != nil && clusterInstance.Status.Phase == storagev1.ClusterStatusPhaseInitialized, nil\n\t\t})\n\t\tif waitErr != nil {\n\t\t\treturn fmt.Errorf(\"get cluster: %w\", waitErr)\n\t\t}\n\t}\n\n\tcmd.Log.Donef(\"Successfully added cluster %s\", clusterName)\n\n\treturn nil\n}\n\nfunc ensureHost(devPodConfig *config.Config, host string, log log.Logger) (string, error) {\n\tif host != \"\" {\n\t\treturn host, nil\n\t}\n\n\tproInstances, err := workspace.ListProInstances(devPodConfig, log)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"list pro instances: %w\", err)\n\t}\n\toptions := []string{}\n\tfor _, pro := range proInstances {\n\t\toptions = append(options, pro.Host)\n\t}\n\th, err := log.Question(&survey.QuestionOptions{\n\t\tQuestion:     \"Select Pro instance to connect your cluster to\",\n\t\tOptions:      options,\n\t\tDefaultValue: options[0],\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"select pro instance: %w\", err)\n\t}\n\n\treturn h, nil\n}\n\nfunc getUserOrTeam(ctx context.Context, baseClient client.Client) (string, string) {\n\tvar user, team string\n\n\tself := baseClient.Self()\n\tuserName := self.Status.User\n\tteamName := self.Status.Team\n\n\tif userName != nil {\n\t\tuser = userName.Name\n\t} else {\n\t\tteam = teamName.Name\n\t}\n\n\treturn user, team\n}\n\nfunc getAccess(user, team string) []storagev1.Access {\n\taccess := []storagev1.Access{\n\t\t{\n\t\t\tVerbs:        []string{\"*\"},\n\t\t\tSubresources: []string{\"*\"},\n\t\t},\n\t}\n\n\tif team != \"\" {\n\t\taccess[0].Teams = []string{team}\n\t} else {\n\t\taccess[0].Users = []string{user}\n\t}\n\n\treturn access\n}\n"
  },
  {
    "path": "cmd/pro/check_health.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// CheckHealthCmd holds the cmd flags\ntype CheckHealthCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewCheckHealthCmd creates a new command\nfunc NewCheckHealthCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CheckHealthCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"check-health\",\n\t\tShort:  \"Check platform health\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\troot := cmd.Root()\n\t\t\tif root == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif root.Annotations == nil {\n\t\t\t\troot.Annotations = map[string]string{}\n\t\t\t}\n\t\t\t// Don't print debug message\n\t\t\troot.Annotations[agent.AgentExecutedAnnotation] = \"true\"\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *CheckHealthCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"health\",\n\t\tprovider.Exec.Proxy.Health,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\tdevPodConfig.ProviderOptions(provider.Name),\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tcmd.Log.Writer(logrus.ErrorLevel, true),\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"check health with provider \\\"%s\\\": %w\", provider.Name, err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/check_update.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tversionpkg \"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// CheckUpdateCmd holds the cmd flags\ntype CheckUpdateCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewCheckUpdateCmd creates a new command\nfunc NewCheckUpdateCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CheckUpdateCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"check-update\",\n\t\tShort:  \"Check platform provider update\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\troot := cmd.Root()\n\t\t\tif root == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif root.Annotations == nil {\n\t\t\t\troot.Annotations = map[string]string{}\n\t\t\t}\n\t\t\t// Don't print debug message\n\t\t\troot.Annotations[agent.AgentExecutedAnnotation] = \"true\"\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\ntype ProviderUpdateInfo struct {\n\tAvailable  bool   `json:\"available,omitempty\"`\n\tNewVersion string `json:\"newVersion,omitempty\"`\n}\n\nfunc (cmd *CheckUpdateCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\tremoteVersion, err := platform.GetDevPodVersion(fmt.Sprintf(\"https://%s\", cmd.Host))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderUpdate := ProviderUpdateInfo{}\n\tif provider.Version == versionpkg.DevVersion {\n\t\tproviderUpdate.Available = false\n\t} else if provider.Version != remoteVersion {\n\t\tproviderUpdate.Available = true\n\t\tproviderUpdate.NewVersion = remoteVersion\n\t}\n\n\tout, err := json.Marshal(providerUpdate)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Print(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/completion/suggestions.go",
    "content": "package completion\n\nimport (\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc GetPlatformHostSuggestions(rootCmd *cobra.Command, context, provider string, args []string, toComplete string, owner platform.OwnerFilter, logger log.Logger) ([]string, cobra.ShellCompDirective) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tproInstances, err := workspace.ListProInstances(devPodConfig, logger)\n\tif err != nil {\n\t\treturn nil, cobra.ShellCompDirectiveError\n\t}\n\n\tvar suggestions []string\n\n\tfor _, instance := range proInstances {\n\t\tif strings.HasPrefix(instance.Host, toComplete) {\n\t\t\tsuggestions = append(suggestions, instance.Host)\n\t\t}\n\t}\n\n\treturn suggestions, cobra.ShellCompDirectiveNoFileComp\n}\n"
  },
  {
    "path": "cmd/pro/create_workspace.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// CreateWorkspaceCmd holds the cmd flags\ntype CreateWorkspaceCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost     string\n\tInstance string\n}\n\n// NewCreateWorkspaceCmd creates a new command\nfunc NewCreateWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateWorkspaceCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"create-workspace\",\n\t\tShort:  \"Create workspace instance\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\tc.Flags().StringVar(&cmd.Instance, \"instance\", \"\", \"The workspace instance to create\")\n\t_ = c.MarkFlagRequired(\"instance\")\n\n\treturn c\n}\n\nfunc (cmd *CreateWorkspaceCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(provider.Name)\n\topts[platform.WorkspaceInstanceEnv] = config.OptionValue{Value: cmd.Instance}\n\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"createWorkspace\",\n\t\tprovider.Exec.Proxy.Create.Workspace,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tcmd.Log.ErrorStreamOnly().Writer(logrus.ErrorLevel, true),\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create workspace: %w\", err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/daemon/daemon.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"daemon\",\n\t\tShort:  \"DevPod Pro Provider daemon commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewStartCmd(globalFlags))\n\tc.AddCommand(NewStatusCmd(globalFlags))\n\tc.AddCommand(NewNetcheckCmd(globalFlags))\n\n\treturn c\n}\n\nfunc findProProvider(ctx context.Context, context, provider, host string, log log.Logger) (*config.Config, *providerpkg.ProviderConfig, error) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpCfg, err := workspace.ProviderFromHost(ctx, devPodConfig, host, log)\n\tif err != nil {\n\t\treturn devPodConfig, nil, fmt.Errorf(\"load provider: %w\", err)\n\t}\n\n\treturn devPodConfig, pCfg, nil\n}\n"
  },
  {
    "path": "cmd/pro/daemon/netcheck.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/pro/completion\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\t\"tailscale.com/client/tailscale\"\n)\n\n// NetcheckCmd holds the DevPod daemon flags\ntype NetcheckCmd struct {\n\t*proflags.GlobalFlags\n\n\tHost string\n\tLog  log.Logger\n}\n\n// NewNetcheckCmd creates a new command\nfunc NewNetcheckCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &NetcheckCmd{\n\t\tGlobalFlags: flags,\n\t\tLog:         log.Default,\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"netcheck\",\n\t\tShort: \"Get the status of the current network\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\troot := cmd.Root()\n\t\t\tif root == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif root.Annotations == nil {\n\t\t\t\troot.Annotations = map[string]string{}\n\t\t\t}\n\t\t\t// Don't print debug message\n\t\t\troot.Annotations[agent.AgentExecutedAnnotation] = \"true\"\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\t_ = c.RegisterFlagCompletionFunc(\"host\", func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn completion.GetPlatformHostSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, cmd.Log)\n\t})\n\n\treturn c\n}\n\nfunc (cmd *NetcheckCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *providerpkg.ProviderConfig) error {\n\ttsClient := &tailscale.LocalClient{\n\t\tSocket:        daemon.GetSocketAddr(provider.Name),\n\t\tUseSocketOnly: true,\n\t}\n\n\tdm, err := tsClient.CurrentDERPMap(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, region := range dm.Regions {\n\t\treport, err := tsClient.DebugDERPRegion(ctx, strconv.Itoa(region.RegionID))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmsg := fmt.Sprintf(\"DERP %d (%s)\\n\", region.RegionID, region.RegionCode)\n\t\tif len(report.Errors) > 0 {\n\t\t\tfor _, error := range report.Errors {\n\t\t\t\tmsg += fmt.Sprintf(\"  Error: %s\\n\", error)\n\t\t\t}\n\t\t}\n\t\tif len(report.Warnings) > 0 {\n\t\t\tfor _, warning := range report.Warnings {\n\t\t\t\tmsg += fmt.Sprintf(\"  Warning: %s\\n\", warning)\n\t\t\t}\n\t\t}\n\t\tif len(report.Info) > 0 {\n\t\t\tfor _, info := range report.Info {\n\t\t\t\tmsg += fmt.Sprintf(\"  Info: %s\\n\", info)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(msg)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/daemon/start.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"path/filepath\"\n\t\"syscall\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/completion\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StartCmd holds the devpod daemon flags\ntype StartCmd struct {\n\t*proflags.GlobalFlags\n\n\tHost string\n\tLog  log.Logger\n}\n\n// NewStartCmd creates a new command\nfunc NewStartCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &StartCmd{\n\t\tGlobalFlags: flags,\n\t\tLog:         log.Default,\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"start\",\n\t\tShort: \"Start the client daemon\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\t_ = c.RegisterFlagCompletionFunc(\"host\", func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn completion.GetPlatformHostSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, cmd.Log)\n\t})\n\n\treturn c\n}\n\nfunc (cmd *StartCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *providerpkg.ProviderConfig) error {\n\tisDesktopControlled := os.Getenv(\"DEVPOD_UI\") == \"true\"\n\tdir, err := ensureDaemonDir(devPodConfig.DefaultContext, provider.Name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tloftConfigPath := filepath.Join(dir, \"..\", \"loft-config.json\")\n\tbaseClient, err := client.InitClientFromPath(ctx, loftConfigPath)\n\tif err != nil {\n\t\tif daemon.IsAccessKeyNotFound(err) && isDesktopControlled {\n\t\t\tprintStatus(daemon.Status{State: daemon.DaemonStateStopped, LoginRequired: true})\n\t\t\treturn err\n\t\t}\n\n\t\treturn err\n\t}\n\tuserName := getUserName(baseClient.Self())\n\tif userName == \"\" {\n\t\treturn fmt.Errorf(\"user name not set\")\n\t}\n\n\t// Create a context with signal handling\n\tctx, cancel := withGracefulShutdown(ctx, cmd.Log)\n\tdefer cancel()\n\n\td, err := daemon.Init(ctx, daemon.InitConfig{\n\t\tRootDir:        dir,\n\t\tProviderName:   provider.Name,\n\t\tContext:        devPodConfig.DefaultContext,\n\t\tUserName:       userName,\n\t\tPlatformClient: baseClient,\n\t\tDebug:          cmd.Debug,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"init daemon: %w\", err)\n\t}\n\n\tif isDesktopControlled {\n\t\tprintStatus(daemon.Status{State: daemon.DaemonStatePending})\n\t}\n\n\treturn d.Start(ctx)\n}\n\n// withGracefulShutdown returns a context that is canceled when termination signals are received.\n// It implements a two-phase shutdown where a second signal forces immediate termination.\nfunc withGracefulShutdown(ctx context.Context, log log.Logger) (context.Context, func()) {\n\tctx, cancel := context.WithCancel(ctx)\n\tsigChan := make(chan os.Signal, 2)\n\tsignal.Notify(sigChan, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT)\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase sig := <-sigChan:\n\t\t\t\tlog.Infof(\"Received signal %s, starting graceful shutdown...\", sig)\n\t\t\t\tcancel()\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\tgo func() {\n\t\t<-ctx.Done()\n\t\t<-sigChan\n\t\t// force shutdown if context is done and we receive another signal\n\t\tos.Exit(1)\n\t}()\n\n\treturn ctx, func() {\n\t\tcancel()\n\t\tsignal.Stop(sigChan)\n\t}\n}\n\nfunc ensureDaemonDir(context, providerName string) (string, error) {\n\ttsDir, err := providerpkg.GetDaemonDir(context, providerName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get daemon dir: %w\", err)\n\t}\n\n\terr = os.MkdirAll(tsDir, 0o700)\n\tif err != nil {\n\t\treturn tsDir, fmt.Errorf(\"make daemon dir: %w\", err)\n\t}\n\n\treturn tsDir, nil\n}\n\nfunc printStatus(status daemon.Status) {\n\tout, err := json.Marshal(status)\n\tif err != nil {\n\t\tfmt.Printf(\"failed to marshal status: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(out))\n}\n\nfunc getUserName(self *managementv1.Self) string {\n\tif self.Status.User != nil {\n\t\treturn self.Status.User.Name\n\t}\n\n\tif self.Status.Team != nil {\n\t\treturn self.Status.Team.Name\n\t}\n\n\treturn self.Status.Subject\n}\n"
  },
  {
    "path": "cmd/pro/daemon/status.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tplatformdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/pro/completion\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StatusCmd holds the DevPod daemon flags\ntype StatusCmd struct {\n\t*proflags.GlobalFlags\n\n\tHost string\n\tLog  log.Logger\n}\n\n// NewStatusCmd creates a new command\nfunc NewStatusCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &StatusCmd{\n\t\tGlobalFlags: flags,\n\t\tLog:         log.Default,\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"status\",\n\t\tShort: \"Get the status of the daemon\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\troot := cmd.Root()\n\t\t\tif root == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif root.Annotations == nil {\n\t\t\t\troot.Annotations = map[string]string{}\n\t\t\t}\n\t\t\t// Don't print debug message\n\t\t\troot.Annotations[agent.AgentExecutedAnnotation] = \"true\"\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\t_ = c.RegisterFlagCompletionFunc(\"host\", func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn completion.GetPlatformHostSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, cmd.Log)\n\t})\n\n\treturn c\n}\n\nfunc (cmd *StatusCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *providerpkg.ProviderConfig) error {\n\tstatus, err := platformdaemon.NewLocalClient(provider.Name).Status(ctx, cmd.Debug)\n\tif err != nil {\n\t\treturn err\n\t}\n\tout, err := json.Marshal(status)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Print(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/delete.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\tprovidercmd \"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n)\n\n// DeleteCmd holds the delete cmd flags\ntype DeleteCmd struct {\n\t*proflags.GlobalFlags\n\n\tIgnoreNotFound bool\n}\n\n// NewDeleteCmd creates a new command\nfunc NewDeleteCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete\",\n\t\tShort: \"Delete or logout from a DevPod Pro Instance\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t}\n\n\tdeleteCmd.Flags().BoolVar(&cmd.IgnoreNotFound, \"ignore-not-found\", false, \"Treat \\\"pro instance not found\\\" as a successful delete\")\n\treturn deleteCmd\n}\n\nfunc (cmd *DeleteCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"please specify an pro instance to delete\")\n\t}\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// load pro instance config\n\tproInstanceName := args[0]\n\tproInstanceConfig, err := provider.LoadProInstanceConfig(devPodConfig.DefaultContext, proInstanceName)\n\tif err != nil {\n\t\tif os.IsNotExist(err) && cmd.IgnoreNotFound {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn fmt.Errorf(\"load pro instance %s: %w\", proInstanceName, err)\n\t}\n\n\tproviderConfig, err := provider.LoadProviderConfig(devPodConfig.DefaultContext, proInstanceConfig.Provider)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load provider: %w\", err)\n\t}\n\n\t// stop daemon and clean up local workspaces\n\tif providerConfig.IsDaemonProvider() {\n\t\t// clean up local workspaces\n\t\tworkspaces, err := workspace.ListLocalWorkspaces(devPodConfig.DefaultContext, false, log.Default)\n\t\tif err != nil {\n\t\t\tlog.Default.Warnf(\"Failed to list workspaces: %v\", err)\n\t\t} else {\n\t\t\tcleanupLocalWorkspaces(ctx, devPodConfig, workspaces, providerConfig.Name, cmd.Owner, log.Default)\n\t\t}\n\n\t\tdaemonClient := daemon.NewLocalClient(proInstanceConfig.Provider)\n\t\terr = daemonClient.Shutdown(ctx)\n\t\tif err != nil {\n\t\t\tlog.Default.Warnf(\"Failed to shut down daemon: %v\", err)\n\t\t}\n\t\tlog.Default.Debug(\"Waiting for daemon to shut down\")\n\t\terr = waitDaemonStopped(ctx, providerConfig.Name)\n\t\tif err != nil {\n\t\t\tlog.Default.Warnf(\"Failed to wait for daemon to be stopped: %v\", err)\n\t\t}\n\t}\n\n\t// delete the provider config\n\terr = providercmd.DeleteProviderConfig(devPodConfig, proInstanceConfig.Provider, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// delete the pro instance dir itself\n\tproInstanceDir, err := provider.GetProInstanceDir(devPodConfig.DefaultContext, proInstanceConfig.Host)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.RemoveAll(proInstanceDir)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"delete pro instance dir\")\n\t}\n\n\tlog.Default.Donef(\"Successfully deleted pro instance '%s'\", proInstanceName)\n\treturn nil\n}\n\nfunc cleanupLocalWorkspaces(ctx context.Context, devPodConfig *config.Config, workspaces []*provider.Workspace, providerName string, owner platform.OwnerFilter, log log.Logger) {\n\tusedWorkspaces := []*provider.Workspace{}\n\n\tfor _, workspace := range workspaces {\n\t\tif workspace.Provider.Name == providerName {\n\t\t\tusedWorkspaces = append(usedWorkspaces, workspace)\n\t\t}\n\t}\n\n\tif len(usedWorkspaces) > 0 {\n\t\twg := sync.WaitGroup{}\n\t\t// try to force delete all workspaces in the background\n\t\tfor _, w := range usedWorkspaces {\n\t\t\twg.Add(1)\n\t\t\tgo func(w provider.Workspace) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tclient, err := workspace.Get(ctx, devPodConfig, []string{w.ID}, true, owner, true, log)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Errorf(\"Failed to get workspace %s: %v\", w.ID, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// delete workspace folder\n\t\t\t\terr = clientimplementation.DeleteWorkspaceFolder(devPodConfig.DefaultContext, client.Workspace(), client.WorkspaceConfig().SSHConfigPath, log)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Errorf(\"Failed to remove workspace %s: %v\", w.ID, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tlog.Donef(\"Successfully removed workspace %s\", w.ID)\n\t\t\t}(*w)\n\t\t}\n\n\t\tlog.Infof(\"Waiting for %d workspace(s) to be removed locally\", len(usedWorkspaces))\n\t\twg.Wait()\n\t}\n}\n\nfunc waitDaemonStopped(ctx context.Context, providerName string) error {\n\treturn wait.PollUntilContextTimeout(ctx, 250*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (done bool, err error) {\n\t\t_, err = daemon.Dial(daemon.GetSocketAddr(providerName))\n\t\tif err != nil {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, nil\n\t})\n}\n"
  },
  {
    "path": "cmd/pro/flags/flags.go",
    "content": "package flags\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\tflag \"github.com/spf13/pflag\"\n)\n\n// GlobalFlags is the flags that contains the global flags\ntype GlobalFlags struct {\n\t*flags.GlobalFlags\n\n\tConfig string\n}\n\n// SetGlobalFlags applies the global flags\nfunc SetGlobalFlags(flags *flag.FlagSet) *GlobalFlags {\n\tglobalFlags := &GlobalFlags{}\n\n\tflags.StringVar(&globalFlags.Config, \"config\", client.DefaultCacheConfig, \"The config to use (will be created if it does not exist)\")\n\n\treturn globalFlags\n}\n"
  },
  {
    "path": "cmd/pro/import_workspace.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/list\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/options\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/parameters\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/random\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\t\"gopkg.in/yaml.v2\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n)\n\ntype ImportCmd struct {\n\t*proflags.GlobalFlags\n\n\tWorkspaceId      string\n\tWorkspaceUid     string\n\tWorkspaceProject string\n\n\tOwn bool\n\tlog log.Logger\n}\n\n// NewImportCmd creates a new command\nfunc NewImportCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {\n\tlogger := log.GetInstance()\n\tcmd := &ImportCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         logger,\n\t}\n\n\timportCmd := &cobra.Command{\n\t\tUse:   \"import-workspace\",\n\t\tShort: \"Imports a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\timportCmd.Flags().StringVar(&cmd.WorkspaceId, \"workspace-id\", \"\", \"ID of a workspace to import\")\n\timportCmd.Flags().StringVar(&cmd.WorkspaceUid, \"workspace-uid\", \"\", \"UID of a workspace to import\")\n\timportCmd.Flags().StringVar(&cmd.WorkspaceProject, \"workspace-project\", \"\", \"Project of the workspace to import\")\n\timportCmd.Flags().BoolVar(&cmd.Own, \"own\", false, \"If true, will behave as if workspace was not imported\")\n\t_ = importCmd.MarkFlagRequired(\"workspace-uid\")\n\treturn importCmd\n}\n\nfunc (cmd *ImportCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"usage: devpod pro import-workspace <devpod-pro-host>\")\n\t}\n\n\tdevPodProHost := args[0]\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set uid as id\n\tif cmd.WorkspaceId == \"\" {\n\t\tcmd.WorkspaceId = cmd.WorkspaceUid\n\t}\n\n\t// check if workspace already exists\n\tif provider2.WorkspaceExists(devPodConfig.DefaultContext, cmd.WorkspaceId) {\n\t\tworkspaceConfig, err := provider2.LoadWorkspaceConfig(devPodConfig.DefaultContext, cmd.WorkspaceId)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"load workspace: %w\", err)\n\t\t} else if workspaceConfig.UID == cmd.WorkspaceUid {\n\t\t\tcmd.log.Infof(\"Workspace %s already imported\", cmd.WorkspaceId)\n\t\t\treturn nil\n\t\t}\n\n\t\tnewWorkspaceId := cmd.WorkspaceId + \"-\" + random.String(5)\n\t\tif provider2.WorkspaceExists(devPodConfig.DefaultContext, newWorkspaceId) {\n\t\t\treturn fmt.Errorf(\"workspace %s already exists\", cmd.WorkspaceId)\n\t\t}\n\n\t\tcmd.log.Infof(\"Workspace %s already exists, will use name %s instead\", cmd.WorkspaceId, newWorkspaceId)\n\t\tcmd.WorkspaceId = newWorkspaceId\n\t}\n\n\tprovider, err := workspace.ProviderFromHost(ctx, devPodConfig, devPodProHost, cmd.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve provider: %w\", err)\n\t}\n\n\tbaseClient, err := platform.InitClientFromProvider(ctx, devPodConfig, provider.Name, cmd.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"base client: %w\", err)\n\t}\n\tinstance, err := platform.FindInstanceInProject(ctx, baseClient, cmd.WorkspaceUid, cmd.WorkspaceProject)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"find workspace instance: %w\", err)\n\t}\n\tif instance == nil {\n\t\treturn fmt.Errorf(\"workspace instance with UID %s not found\", cmd.WorkspaceUid)\n\t}\n\n\t// old pro provider\n\tif !provider.HasHealthCheck() {\n\t\tinstanceOpts, err := resolveInstanceOptions(ctx, instance, baseClient)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"resolve instance options: %w\", err)\n\t\t}\n\n\t\terr = cmd.writeWorkspaceDefinition(devPodConfig, provider, instanceOpts, instance)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"prepare workspace to import definition\")\n\t\t}\n\t\tcmd.log.Infof(\"Successfully imported workspace %s\", cmd.WorkspaceId)\n\t\treturn nil\n\t}\n\n\t// new pro provider\n\terr = cmd.writeNewWorkspaceDefinition(devPodConfig, instance, provider.Name)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"prepare workspace to import definition\")\n\t}\n\tcmd.log.Infof(\"Successfully imported workspace %s\", cmd.WorkspaceId)\n\n\treturn nil\n}\n\nfunc (cmd *ImportCmd) writeNewWorkspaceDefinition(devPodConfig *config.Config, instance *managementv1.DevPodWorkspaceInstance, providerName string) error {\n\tworkspaceObj := &provider2.Workspace{\n\t\tID:       cmd.WorkspaceId,\n\t\tUID:      cmd.WorkspaceUid,\n\t\tProvider: provider2.WorkspaceProviderConfig{Name: providerName},\n\t\tContext:  devPodConfig.DefaultContext,\n\t\tImported: !cmd.Own,\n\t\tPro: &provider2.ProMetadata{\n\t\t\tInstanceName: instance.GetName(),\n\t\t\tProject:      project.ProjectFromNamespace(instance.Namespace),\n\t\t\tDisplayName:  instance.Spec.DisplayName,\n\t\t},\n\t}\n\n\treturn provider2.SaveWorkspaceConfig(workspaceObj)\n}\n\nfunc (cmd *ImportCmd) writeWorkspaceDefinition(devPodConfig *config.Config, provider *provider2.ProviderConfig, instanceOpts map[string]string, instance *managementv1.DevPodWorkspaceInstance) error {\n\tworkspaceObj := &provider2.Workspace{\n\t\tID:  cmd.WorkspaceId,\n\t\tUID: cmd.WorkspaceUid,\n\t\tProvider: provider2.WorkspaceProviderConfig{\n\t\t\tName:    provider.Name,\n\t\t\tOptions: map[string]config.OptionValue{},\n\t\t},\n\t\tContext:  devPodConfig.DefaultContext,\n\t\tImported: !cmd.Own,\n\t\tPro: &provider2.ProMetadata{\n\t\t\tInstanceName: instance.GetName(),\n\t\t\tProject:      instanceOpts[platform.ProjectEnv],\n\t\t\tDisplayName:  instance.Spec.DisplayName,\n\t\t},\n\t}\n\n\tdevPodConfig, err := options.ResolveOptions(context.Background(), devPodConfig, provider, instanceOpts, false, false, nil, cmd.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve options: %w\", err)\n\t}\n\tif devPodConfig.Current() == nil || devPodConfig.Current().Providers[provider.Name] == nil {\n\t\treturn fmt.Errorf(\"unable to resolve provider config for provider %s\", provider.Name)\n\t}\n\tworkspaceObj.Provider.Options = devPodConfig.Current().Providers[provider.Name].Options\n\n\terr = provider2.SaveWorkspaceConfig(workspaceObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc resolveInstanceOptions(ctx context.Context, instance *managementv1.DevPodWorkspaceInstance, baseClient client.Client) (map[string]string, error) {\n\topts := map[string]string{}\n\tprojectName := project.ProjectFromNamespace(instance.Namespace)\n\n\topts[platform.ProjectEnv] = projectName\n\tif instance.Spec.TemplateRef == nil {\n\t\treturn opts, nil\n\t}\n\t//nolint:all\n\tif instance.Spec.RunnerRef.Runner != \"\" {\n\t\topts[platform.RunnerEnv] = instance.Spec.RunnerRef.Runner //nolint:all\n\t}\n\topts[platform.TemplateOptionEnv] = instance.Spec.TemplateRef.Name\n\n\tif instance.Spec.TemplateRef.Version != \"\" {\n\t\topts[platform.TemplateVersionOptionEnv] = instance.Spec.TemplateRef.Version\n\t}\n\n\tif instance.Spec.Parameters == \"\" {\n\t\treturn opts, nil\n\t}\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get management client: %w\", err)\n\t}\n\ttemplate, err := list.FindTemplate(ctx, managementClient, projectName, instance.Spec.TemplateRef.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find template: %w\", err)\n\t}\n\ttemplateParameters := template.Spec.Parameters\n\tif len(template.Spec.Versions) > 0 {\n\t\ttemplateParameters, err = list.GetTemplateParameters(template, instance.Spec.TemplateRef.Version)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"get template parameters: %w\", err)\n\t\t}\n\t}\n\terr = fillParameterOptions(opts, templateParameters, instance.Spec.Parameters)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"fill parameter options: %w\", err)\n\t}\n\n\treturn opts, nil\n}\n\nfunc fillParameterOptions(opts map[string]string, parameterDefinitions []storagev1.AppParameter, instanceParameters string) error {\n\tparametersMap := map[string]interface{}{}\n\terr := yaml.Unmarshal([]byte(instanceParameters), &parametersMap)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unmarshal parameters: %w\", err)\n\t}\n\n\tfor _, parameter := range parameterDefinitions {\n\t\tval := parameters.GetDeepValue(parametersMap, parameter.Variable)\n\t\tvar strVal string\n\t\tif val != nil {\n\t\t\tswitch t := val.(type) {\n\t\t\tcase string:\n\t\t\t\tstrVal = t\n\t\t\tcase int:\n\t\t\t\tstrVal = strconv.Itoa(t)\n\t\t\tcase bool:\n\t\t\t\tstrVal = strconv.FormatBool(t)\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unrecognized type for parameter %s (%s) in file: %v\", parameter.Label, parameter.Variable, t)\n\t\t\t}\n\t\t}\n\n\t\t_, err := parameters.VerifyValue(strVal, parameter)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\toptionName := list.VariableToEnvironmentVariable(parameter.Variable)\n\t\topts[optionName] = strVal\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/list.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"time\"\n\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the list cmd flags\ntype ListCmd struct {\n\tproflags.GlobalFlags\n\n\tOutput string\n\tLogin  bool\n}\n\n// NewListCmd creates a new command\nfunc NewListCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"List available DevPod Pro instances\",\n\t\tArgs:    cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\tlistCmd.Flags().BoolVar(&cmd.Login, \"login\", false, \"Check if the user is logged into the pro instance\")\n\treturn listCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproInstances, err := workspace.ListProInstances(devPodConfig, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor _, proInstance := range proInstances {\n\t\t\tentry := []string{\n\t\t\t\tproInstance.Host,\n\t\t\t\tproInstance.Provider,\n\t\t\t\ttime.Since(proInstance.CreationTimestamp.Time).Round(1 * time.Second).String(),\n\t\t\t}\n\t\t\tif cmd.Login {\n\t\t\t\terr = checkLogin(ctx, devPodConfig, proInstance)\n\t\t\t\tentry = append(entry, fmt.Sprintf(\"%t\", err == nil))\n\t\t\t}\n\n\t\t\ttableEntries = append(tableEntries, entry)\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttableHeaders := []string{\n\t\t\t\"Host\",\n\t\t\t\"Provider\",\n\t\t\t\"Age\",\n\t\t}\n\t\tif cmd.Login {\n\t\t\ttableHeaders = append(tableHeaders, \"Authenticated\")\n\t\t}\n\n\t\ttable.PrintTable(log.Default, tableHeaders, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\ttableEntries := []*proTableEntry{}\n\t\tfor _, proInstance := range proInstances {\n\t\t\tentry := &proTableEntry{\n\t\t\t\tProInstance:  proInstance,\n\t\t\t\tContext:      devPodConfig.DefaultContext,\n\t\t\t\tCapabilities: getCapabilities(ctx, devPodConfig, proInstance, log.Discard),\n\t\t\t}\n\t\t\tif cmd.Login {\n\t\t\t\terr = checkLogin(ctx, devPodConfig, proInstance)\n\t\t\t\tisAuthenticated := err == nil\n\t\t\t\tentry.Authenticated = &isAuthenticated\n\t\t\t}\n\n\t\t\ttableEntries = append(tableEntries, entry)\n\t\t}\n\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i].Host < tableEntries[j].Host\n\t\t})\n\t\tout, err := json.Marshal(tableEntries)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n\ntype proTableEntry struct {\n\t*provider.ProInstance\n\n\tAuthenticated *bool        `json:\"authenticated,omitempty\"`\n\tContext       string       `json:\"context,omitempty\"`\n\tCapabilities  []Capability `json:\"capabilities,omitempty\"`\n}\n\ntype Capability string\n\nvar (\n\tcapabilityDaemon         Capability = \"daemon\"\n\tcapabilityHealthCheck    Capability = \"health-check\"\n\tcapabilityUpdateProvider Capability = \"update-provider\"\n)\n\nfunc checkLogin(ctx context.Context, devPodConfig *config.Config, proInstance *provider.ProInstance) error {\n\t// for every pro instance, check auth status by calling login\n\tif err := login(ctx, devPodConfig, proInstance.Host, proInstance.Provider, \"\", true, false, log.Default); err != nil {\n\t\treturn fmt.Errorf(\"not logged into %s\", proInstance.Host)\n\t}\n\n\treturn nil\n}\n\nfunc getCapabilities(ctx context.Context, devPodConfig *config.Config, proInstance *provider.ProInstance, log log.Logger) []Capability {\n\tcapabilities := []Capability{}\n\tprovider, err := workspace.FindProvider(devPodConfig, proInstance.Provider, log)\n\tif err != nil {\n\t\treturn capabilities\n\t}\n\n\tif provider.Config.HasHealthCheck() {\n\t\tcapabilities = append(capabilities, capabilityHealthCheck)\n\t\tcapabilities = append(capabilities, capabilityUpdateProvider)\n\t}\n\n\tif provider.Config.IsDaemonProvider() {\n\t\tcapabilities = append(capabilities, capabilityDaemon)\n\t}\n\n\treturn capabilities\n}\n"
  },
  {
    "path": "cmd/pro/list_clusters.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListClustersCmd holds the cmd flags\ntype ListClustersCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost    string\n\tProject string\n}\n\n// NewListClustersCmd creates a new command\nfunc NewListClustersCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListClustersCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"list-clusters\",\n\t\tShort:  \"List clusters\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\n\treturn c\n}\n\nfunc (cmd *ListClustersCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(provider.Name)\n\topts[platform.ProjectEnv] = config.OptionValue{Value: cmd.Project}\n\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\tvar buf bytes.Buffer\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"listClusters\",\n\t\tprovider.Exec.Proxy.List.Clusters,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list clusters with provider \\\"%s\\\": %w\", provider.Name, err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/list_projects.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListProjectsCmd holds the cmd flags\ntype ListProjectsCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewListProjectsCmd creates a new command\nfunc NewListProjectsCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListProjectsCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"list-projects\",\n\t\tShort:  \"List projects\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *ListProjectsCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"listProjects\",\n\t\tprovider.Exec.Proxy.List.Projects,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\tdevPodConfig.ProviderOptions(provider.Name),\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"watch workspaces with provider \\\"%s\\\": %w\", provider.Name, err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/list_templates.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListTemplatesCmd holds the cmd flags\ntype ListTemplatesCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost    string\n\tProject string\n}\n\n// NewListTemplatesCmd creates a new command\nfunc NewListTemplatesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListTemplatesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"list-templates\",\n\t\tShort:  \"List templates\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\n\treturn c\n}\n\nfunc (cmd *ListTemplatesCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(provider.Name)\n\topts[platform.ProjectEnv] = config.OptionValue{Value: cmd.Project}\n\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\tvar buf bytes.Buffer\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"listTemplates\",\n\t\tprovider.Exec.Proxy.List.Templates,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list templates with provider \\\"%s\\\": %w\", provider.Name, err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/list_workspaces.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListWorkspacesCmd holds the cmd flags\ntype ListWorkspacesCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewListWorkspacesCmd creates a new command\nfunc NewListWorkspacesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListWorkspacesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"list-workspaces\",\n\t\tShort:  \"List Workspaces\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *ListWorkspacesCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"listWorkspaces\",\n\t\tprovider.Exec.Proxy.List.Workspaces,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\tdevPodConfig.ProviderOptions(provider.Name),\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list workspaces: %w\", err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/login.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/blang/semver\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\tprovidercmd \"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\tversionpkg \"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/mgutz/ansi\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst PROVIDER_BINARY = \"PRO_PROVIDER\"\nconst providerRepo = \"loft-sh/devpod\"\n\n// LoginCmd holds the login cmd flags\ntype LoginCmd struct {\n\tproflags.GlobalFlags\n\n\tAccessKey      string\n\tProvider       string\n\tVersion        string\n\tProviderSource string\n\n\tOptions []string\n\n\tLogin        bool\n\tUse          bool\n\tForceBrowser bool\n}\n\n// NewLoginCmd creates a new command\nfunc NewLoginCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &LoginCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tloginCmd := &cobra.Command{\n\t\tUse:   \"login\",\n\t\tShort: \"Log into a DevPod Pro instance\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the DevPod Pro host, e.g. devpod pro login my-pro.my-domain.com\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0], log.Default)\n\t\t},\n\t}\n\n\tloginCmd.Flags().StringVar(&cmd.AccessKey, \"access-key\", \"\", \"If defined will use the given access key to login\")\n\tloginCmd.Flags().BoolVar(&cmd.Login, \"login\", true, \"If enabled will automatically try to log into the Loft DevPod Pro\")\n\tloginCmd.Flags().BoolVar(&cmd.Use, \"use\", true, \"If enabled will automatically activate the provider\")\n\tloginCmd.Flags().StringVar(&cmd.Provider, \"provider\", \"\", \"Optional name how the DevPod Pro provider will be named\")\n\tloginCmd.Flags().StringVar(&cmd.Version, \"version\", \"\", \"The version to use for the DevPod provider\")\n\tloginCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"Provider option in the form KEY=VALUE\")\n\tloginCmd.Flags().BoolVar(&cmd.ForceBrowser, \"force-browser\", false, \"Force login through browser\")\n\n\tloginCmd.Flags().StringVar(&cmd.ProviderSource, \"provider-source\", \"\", \"The source of the provider\")\n\t_ = loginCmd.Flags().MarkHidden(\"provider-source\")\n\treturn loginCmd\n}\n\n// Run runs the command logic\nfunc (cmd *LoginCmd) Run(ctx context.Context, fullURL string, log log.Logger) error {\n\tif strings.HasPrefix(fullURL, \"http://\") {\n\t\treturn fmt.Errorf(\"http is not supported for DevPod Pro, please use https:// instead\")\n\t} else if !strings.HasPrefix(fullURL, \"https://\") {\n\t\tfullURL = \"https://\" + fullURL\n\t} else if cmd.Provider != \"\" && len(cmd.Provider) > 32 {\n\t\treturn fmt.Errorf(\"cannot use a provider name greater than 32 characters\")\n\t}\n\n\t// get host from url\n\tparsedURL, err := url.Parse(fullURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid url %s: %w\", fullURL, err)\n\t}\n\n\t// extract host\n\thost := parsedURL.Host\n\n\t// load devpod config\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if there is already a pro instance with that url\n\tproInstances, err := workspace.ListProInstances(devPodConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if url is found somewhere\n\tvar currentInstance *provider.ProInstance\n\tfor _, proInstance := range proInstances {\n\t\tif proInstance.Host == host {\n\t\t\tcurrentInstance = proInstance\n\t\t\tbreak\n\t\t}\n\t}\n\tif currentInstance != nil {\n\t\tcmd.Provider = currentInstance.Provider\n\t} else {\n\t\t// find a provider name\n\t\tif cmd.Provider == \"\" {\n\t\t\tcmd.Provider = \"devpod-pro\"\n\t\t}\n\t\tcmd.Provider = provider.ToProInstanceID(cmd.Provider)\n\n\t\t// check if provider already exists\n\t\tproviders, err := workspace.LoadAllProviders(devPodConfig, log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"load providers: %w\", err)\n\t\t}\n\n\t\t// provider already exists?\n\t\tif providers[cmd.Provider] != nil {\n\t\t\t// alternative name\n\t\t\tcmd.Provider = provider.ToProInstanceID(\"devpod-\" + host)\n\t\t\tif providers[cmd.Provider] != nil {\n\t\t\t\treturn fmt.Errorf(\"provider %s already exists, please choose a different name via --provider\", cmd.Provider)\n\t\t\t}\n\t\t}\n\t}\n\n\t// 1. Add provider\n\tif currentInstance == nil {\n\t\tcurrentInstance = &provider.ProInstance{\n\t\t\tProvider:          cmd.Provider,\n\t\t\tHost:              host,\n\t\t\tCreationTimestamp: types.Now(),\n\t\t}\n\n\t\tremoteVersion, err := platform.GetDevPodVersion(fullURL)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trv, err := semver.Parse(strings.TrimPrefix(remoteVersion, \"v\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid version %s: %w\", remoteVersion, err)\n\t\t}\n\t\tif rv.LT(semver.Version{Major: 0, Minor: 6, Patch: 999}) && remoteVersion != versionpkg.DevVersion {\n\t\t\tlog.Debug(\"remote version < 0.7.0, installing proxy provider\")\n\t\t\t// proxy providers are deprecated and shouldn't be used\n\t\t\t// unless explicitly the server version is below 0.7.0\n\t\t\terr = cmd.addLoftProvider(devPodConfig, fullURL, log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\t// add built-in pro (daemon) provider\n\t\t\t_, err = workspace.AddProvider(devPodConfig, cmd.Provider, \"pro\", log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terr = provider.SaveProInstanceConfig(devPodConfig.DefaultContext, currentInstance)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// reload devpod config\n\t\tdevPodConfig, err = config.LoadConfig(devPodConfig.DefaultContext, cmd.Provider)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// get provider config\n\tproviderConfig, err := provider.LoadProviderConfig(devPodConfig.DefaultContext, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// 2. Login to Loft\n\tif cmd.Login {\n\t\terr = login(ctx, devPodConfig, fullURL, cmd.Provider, cmd.AccessKey, false, cmd.ForceBrowser, log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Donef(\"Successfully logged into DevPod Pro instance %s\", ansi.Color(fullURL, \"white+b\"))\n\t}\n\n\t// 3. Configure provider\n\tif cmd.Use {\n\t\terr := providercmd.ConfigureProvider(ctx, providerConfig, devPodConfig.DefaultContext, cmd.Options, false, false, false, nil, log)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"configure provider\")\n\t\t}\n\t}\n\n\tlog.Donef(\"Successfully configured DevPod Pro\")\n\treturn nil\n}\n\nfunc (cmd *LoginCmd) addLoftProvider(devPodConfig *config.Config, url string, log log.Logger) error {\n\t// find out loft version\n\terr := cmd.resolveProviderSource(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// add the provider\n\tlog.Infof(\"Add DevPod Pro provider...\")\n\n\t// is development?\n\tif cmd.ProviderSource == providerRepo+\"@v0.0.0\" {\n\t\tlog.Debugf(\"Add development provider\")\n\t\t_, err = workspace.AddProviderRaw(devPodConfig, cmd.Provider, &provider.ProviderSource{}, []byte(fallbackProvider), log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t_, err = workspace.AddProvider(devPodConfig, cmd.Provider, cmd.ProviderSource, log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *LoginCmd) resolveProviderSource(url string) error {\n\tif cmd.ProviderSource != \"\" {\n\t\treturn nil\n\t}\n\tif cmd.Version != \"\" {\n\t\tcmd.ProviderSource = providerRepo + \"@\" + cmd.Version\n\t\treturn nil\n\t}\n\n\tversion, err := platform.GetDevPodVersion(url)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get version: %w\", err)\n\t}\n\tcmd.ProviderSource = providerRepo + \"@\" + version\n\n\treturn nil\n}\n\nfunc login(ctx context.Context, devPodConfig *config.Config, url string, providerName string, accessKey string, skipBrowserLogin, forceBrowser bool, log log.Logger) error {\n\tconfigPath, err := platform.LoftConfigPath(devPodConfig.DefaultContext, providerName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tloader, err := client.NewClientFromPath(configPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !strings.HasPrefix(url, \"http\") {\n\t\turl = \"https://\" + url\n\t}\n\n\tif accessKey == \"\" {\n\t\taccessKey = loader.Config().AccessKey\n\t}\n\n\t// log in\n\turl = strings.TrimSuffix(url, \"/\")\n\tif accessKey != \"\" && !forceBrowser {\n\t\terr = loader.LoginWithAccessKey(url, accessKey, true, true)\n\t} else {\n\t\tif skipBrowserLogin {\n\t\t\treturn fmt.Errorf(\"unable to login to loft host\")\n\t\t}\n\t\terr = loader.Login(url, true, log)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nvar fallbackProvider = `name: devpod-pro\nversion: v0.0.0\nicon: https://devpod.sh/assets/devpod.svg\ndescription: DevPod Pro\noptions:\n  LOFT_CONFIG:\n    global: true\n    hidden: true\n    required: true\n    default: \"${PROVIDER_FOLDER}/loft-config.json\"\nbinaries:\n  PRO_PROVIDER:\n    - os: linux\n      arch: amd64\n      path: /usr/local/bin/devpod\n    - os: linux\n      arch: arm64\n      path: /usr/local/bin/devpod\n    - os: darwin \n      arch: amd64\n      path: /usr/local/bin/devpod\n    - os: darwin\n      arch: arm64\n      path: /usr/local/bin/devpod\n    - os: windows\n      arch: amd64\n      path: \"C:\\\\Users\\\\pasca\\\\workspace\\\\devpod\\\\desktop\\\\src-tauri\\\\bin\\\\devpod-cli-x86_64-pc-windows-msvc.exe\"\nexec:\n  proxy:\n    up: |-\n      ${PRO_PROVIDER} pro provider up\n    ssh: |-\n      ${PRO_PROVIDER} pro provider ssh\n    stop: |-\n      ${PRO_PROVIDER} pro provider stop\n    status: |-\n      ${PRO_PROVIDER} pro provider status\n    delete: |-\n      ${PRO_PROVIDER} pro provider delete\n    health: |-\n      ${PRO_PROVIDER} pro provider health\n    daemon:\n      start: |-\n        ${PRO_PROVIDER} pro provider daemon start\n      status: |-\n        ${PRO_PROVIDER} pro provider daemon status\n    create:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider create workspace\n    get:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider get workspace\n      self: |-\n        ${PRO_PROVIDER} pro provider get self\n      version: |-\n        ${PRO_PROVIDER} pro provider get version\n    update:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider update workspace\n    watch:\n      workspaces: |-\n        ${PRO_PROVIDER} pro provider watch workspaces\n    list:\n      workspaces: |-\n        ${PRO_PROVIDER} pro provider list workspaces\n      projects: |-\n        ${PRO_PROVIDER} pro provider list projects\n      templates: |-\n        ${PRO_PROVIDER} pro provider list templates\n      clusters: |-\n        ${PRO_PROVIDER} pro provider list clusters\n`\n"
  },
  {
    "path": "cmd/pro/pro.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/pro/add\"\n\t\"github.com/loft-sh/devpod/cmd/pro/daemon\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider\"\n\t\"github.com/loft-sh/devpod/cmd/pro/reset\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewProCmd returns a new command\nfunc NewProCmd(flags *flags.GlobalFlags, streamLogger *log.StreamLogger) *cobra.Command {\n\tglobalFlags := &proflags.GlobalFlags{GlobalFlags: flags}\n\tproCmd := &cobra.Command{\n\t\tUse:           \"pro\",\n\t\tShort:         \"DevPod Pro commands\",\n\t\tSilenceUsage:  true,\n\t\tSilenceErrors: true,\n\t\tArgs:          cobra.NoArgs,\n\t\tPersistentPreRunE: func(c *cobra.Command, _ []string) error {\n\t\t\tglobalFlags = proflags.SetGlobalFlags(c.PersistentFlags())\n\t\t\tif flags.Silent {\n\t\t\t\tstreamLogger.SetLevel(logrus.FatalLevel)\n\t\t\t}\n\t\t\tif flags.Debug {\n\t\t\t\tstreamLogger.SetLevel(logrus.DebugLevel)\n\t\t\t}\n\n\t\t\tif os.Getenv(\"DEVPOD_DEBUG\") == \"true\" {\n\t\t\t\tlog.Default.SetLevel(logrus.DebugLevel)\n\t\t\t}\n\t\t\tif flags.LogOutput == \"json\" {\n\t\t\t\tlog.Default.SetFormat(log.JSONFormat)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tproCmd.AddCommand(NewLoginCmd(globalFlags))\n\tproCmd.AddCommand(NewListCmd(globalFlags))\n\tproCmd.AddCommand(NewDeleteCmd(globalFlags))\n\tproCmd.AddCommand(NewImportCmd(globalFlags))\n\tproCmd.AddCommand(NewStartCmd(globalFlags))\n\tproCmd.AddCommand(NewRebuildCmd(globalFlags))\n\tproCmd.AddCommand(NewSleepCmd(globalFlags))\n\tproCmd.AddCommand(NewWakeupCmd(globalFlags))\n\tproCmd.AddCommand(reset.NewResetCmd(globalFlags))\n\tproCmd.AddCommand(provider.NewProProviderCmd(globalFlags))\n\tproCmd.AddCommand(daemon.NewCmd(globalFlags))\n\tproCmd.AddCommand(add.NewAddCmd(globalFlags))\n\tproCmd.AddCommand(NewWatchWorkspacesCmd(globalFlags))\n\tproCmd.AddCommand(NewSelfCmd(globalFlags))\n\tproCmd.AddCommand(NewVersionCmd(globalFlags))\n\tproCmd.AddCommand(NewListProjectsCmd(globalFlags))\n\tproCmd.AddCommand(NewListWorkspacesCmd(globalFlags))\n\tproCmd.AddCommand(NewListTemplatesCmd(globalFlags))\n\tproCmd.AddCommand(NewListClustersCmd(globalFlags))\n\tproCmd.AddCommand(NewCreateWorkspaceCmd(globalFlags))\n\tproCmd.AddCommand(NewUpdateWorkspaceCmd(globalFlags))\n\tproCmd.AddCommand(NewCheckHealthCmd(globalFlags))\n\tproCmd.AddCommand(NewCheckUpdateCmd(globalFlags))\n\tproCmd.AddCommand(NewUpdateProviderCmd(globalFlags))\n\treturn proCmd\n}\n\nfunc findProProvider(ctx context.Context, context, provider, host string, log log.Logger) (*config.Config, *providerpkg.ProviderConfig, error) {\n\tdevPodConfig, err := config.LoadConfig(context, provider)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpCfg, err := workspace.ProviderFromHost(ctx, devPodConfig, host, log)\n\tif err != nil {\n\t\treturn devPodConfig, nil, fmt.Errorf(\"load provider: %w\", err)\n\t}\n\n\treturn devPodConfig, pCfg, nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/create/create.go",
    "content": "package create\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"create\",\n\t\tShort:  \"DevPod Pro Provider create commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewWorkspaceCmd(globalFlags))\n\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/create/workspace.go",
    "content": "package create\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/form\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/terminal\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// WorkspaceCmd holds the cmd flags\ntype WorkspaceCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewWorkspaceCmd creates a new command\nfunc NewWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WorkspaceCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance().ErrorStreamOnly(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"workspace\",\n\t\tShort:  \"Create a workspace\",\n\t\tHidden: true,\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *WorkspaceCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// fully serialized intance, right now only used by GUI\n\tinstanceEnv := os.Getenv(platform.WorkspaceInstanceEnv)\n\tif instanceEnv != \"\" {\n\t\tinstance := &managementv1.DevPodWorkspaceInstance{} // init pointer\n\t\terr := json.Unmarshal([]byte(instanceEnv), instance)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshal workpace instance %s: %w\", instanceEnv, err)\n\t\t}\n\n\t\tupdatedInstance, err := createInstance(ctx, baseClient, instance, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tout, err := json.Marshal(updatedInstance)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Println(string(out))\n\t\treturn nil\n\t}\n\n\t// Info through env, right now only used by CLI\n\tworkspaceID := os.Getenv(provider.WORKSPACE_ID)\n\tworkspaceUID := os.Getenv(provider.WORKSPACE_UID)\n\tworkspaceFolder := os.Getenv(provider.WORKSPACE_FOLDER)\n\tworkspaceContext := os.Getenv(provider.WORKSPACE_CONTEXT)\n\tworkspacePicture := os.Getenv(platform.WorkspacePictureEnv)\n\tworkspaceSource := os.Getenv(platform.WorkspaceSourceEnv)\n\tif workspaceUID == \"\" || workspaceID == \"\" || workspaceFolder == \"\" {\n\t\treturn fmt.Errorf(\"workspaceID, workspaceUID or workspace folder not found: %s, %s, %s\", workspaceID, workspaceUID, workspaceFolder)\n\t}\n\tinstance, err := platform.FindInstance(ctx, baseClient, workspaceUID)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Nothing left to do if we already have an instance\n\tif instance != nil {\n\t\treturn nil\n\t}\n\tif !terminal.IsTerminalIn {\n\t\treturn fmt.Errorf(\"unable to create new instance through CLI if stdin is not a terminal\")\n\t}\n\n\tinstance, err = form.CreateInstance(ctx, baseClient, workspaceID, workspaceUID, workspaceSource, workspacePicture, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = createInstance(ctx, baseClient, instance, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// once we have the instance, update workspace and save config\n\t// TODO: Do we need a file lock?\n\tworkspaceConfig, err := provider.LoadWorkspaceConfig(workspaceContext, workspaceID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load workspace config: %w\", err)\n\t}\n\tworkspaceConfig.Pro = &provider.ProMetadata{\n\t\tInstanceName: instance.GetName(),\n\t\tProject:      project.ProjectFromNamespace(instance.GetNamespace()),\n\t\tDisplayName:  instance.Spec.DisplayName,\n\t}\n\n\terr = provider.SaveWorkspaceConfig(workspaceConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save workspace config: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc createInstance(ctx context.Context, client client.Client, instance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tupdatedInstance, err := managementClient.Loft().ManagementV1().\n\t\tDevPodWorkspaceInstances(instance.GetNamespace()).\n\t\tCreate(ctx, instance, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create workspace instance: %w\", err)\n\t}\n\n\treturn platform.WaitForInstance(ctx, client, updatedInstance, log)\n}\n"
  },
  {
    "path": "cmd/pro/provider/delete.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// DeleteCmd holds the cmd flags\ntype DeleteCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewDeleteCmd creates a new command\nfunc NewDeleteCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tHidden: true,\n\t\tUse:    \"delete\",\n\t\tShort:  \"Runs delete on a workspace\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *DeleteCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := platform.FindInstanceInProject(ctx, baseClient, info.UID, info.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\treturn fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(workspace.Namespace).Delete(ctx, workspace.Name, metav1.DeleteOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"delete workspace: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/get/get.go",
    "content": "package get\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"get\",\n\t\tShort:  \"DevPod Pro Provider get commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewWorkspaceCmd(globalFlags))\n\tc.AddCommand(NewSelfCmd(globalFlags))\n\tc.AddCommand(NewVersionCmd(globalFlags))\n\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/get/self.go",
    "content": "package get\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SelfCmd holds the cmd flags\ntype SelfCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewSelfCmd creates a new command\nfunc NewSelfCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SelfCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"self\",\n\t\tShort: \"Get self\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *SelfCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(baseClient.Self())\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/get/version.go",
    "content": "package get\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// VersionCmd holds the cmd flags\ntype VersionCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\ntype VersionInfo struct {\n\t// ServerVersion is the platform deployment version\n\tServerVersion string `json:\"serverVersion,omitempty\"`\n\n\t// RemoteProviderVersion is the desired provider version of the current platform deployment\n\tRemoteProviderVersion string `json:\"remoteProviderVersion,omitempty\"`\n\n\t// CurrentProviderVersion is the currently installed provider version\n\tCurrentProviderVersion string `json:\"currentProviderVersion,omitempty\"`\n}\n\n// NewVersionCmd creates a new command\nfunc NewVersionCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &VersionCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"version\",\n\t\tShort: \"Get platform version\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *VersionCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderContext := os.Getenv(provider.PROVIDER_CONTEXT)\n\tif providerContext == \"\" {\n\t\tproviderContext = config.DefaultContext\n\t}\n\tproviderID := os.Getenv(provider.PROVIDER_ID)\n\tif providerID == \"\" {\n\t\treturn fmt.Errorf(\"provider ID %s not defined\", providerID)\n\t}\n\n\t// get our own version\n\tproviderConfig, err := provider.LoadProviderConfig(providerContext, providerID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tproviderVersion := providerConfig.Version\n\n\t// get platform version\n\tplatformVersion, err := platform.GetPlatformVersion(baseClient.Config().Host)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tv := VersionInfo{\n\t\tServerVersion:          platformVersion.Version,\n\t\tRemoteProviderVersion:  platformVersion.DevPodVersion,\n\t\tCurrentProviderVersion: providerVersion,\n\t}\n\tout, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/get/workspace.go",
    "content": "package get\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// WorkspaceCmd holds the cmd flags\ntype WorkspaceCmd struct {\n\t*flags.GlobalFlags\n\n\tlog log.Logger\n}\n\n// NewWorkspaceCmd creates a new command\nfunc NewWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WorkspaceCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"workspace\",\n\t\tShort: \"Get workspace for the provider\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *WorkspaceCmd) Run(ctx context.Context) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceInfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstance, err := platform.FindInstanceInProject(ctx, baseClient, workspaceInfo.UID, workspaceInfo.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstanceBytes, err := json.Marshal(instance)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tfmt.Println(string(instanceBytes))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/health.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// HealthCmd holds the cmd flags\ntype HealthCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewHealthCmd creates a new command\nfunc NewHealthCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &HealthCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"health\",\n\t\tShort:  \"Check platform health\",\n\t\tHidden: true,\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *HealthCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfig := baseClient.Config()\n\tu, err := url.Parse(fmt.Sprintf(\"%s/healthz\", config.Host))\n\tif err != nil {\n\t\treturn err\n\t}\n\tres, err := devpodhttp.GetHTTPClient().Get(u.String())\n\tif err != nil {\n\t\treturn err\n\t}\n\thealthCheck := HealthCheck{\n\t\tHealthy: res.StatusCode == http.StatusOK,\n\t}\n\n\tout, err := json.Marshal(healthCheck)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n\ntype HealthCheck struct {\n\tHealthy bool `json:\"healthy,omitempty\"`\n}\n"
  },
  {
    "path": "cmd/pro/provider/list/clusters.go",
    "content": "package list\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// ClustersCmd holds the cmd flags\ntype ClustersCmd struct {\n\t*flags.GlobalFlags\n\n\tlog log.Logger\n}\n\n// NewClustersCmd creates a new command\nfunc NewClustersCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ClustersCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"clusters\",\n\t\tShort: \"Lists clusters for the provider\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *ClustersCmd) Run(ctx context.Context) error {\n\tprojectName := os.Getenv(platform.ProjectEnv)\n\tif projectName == \"\" {\n\t\treturn fmt.Errorf(\"%s environment variable is empty\", platform.ProjectEnv)\n\t}\n\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclustersList, err := Clusters(ctx, baseClient, projectName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(clustersList)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n\nfunc Clusters(ctx context.Context, client client.Client, projectName string) (*managementv1.ProjectClusters, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclustersList, err := managementClient.Loft().ManagementV1().Projects().ListClusters(ctx, projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn clustersList, fmt.Errorf(\"list clusters: %w\", err)\n\t}\n\n\treturn clustersList, nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/list/list.go",
    "content": "package list\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"list\",\n\t\tShort:  \"DevPod Pro Provider list commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewWorkspacesCmd(globalFlags))\n\tc.AddCommand(NewProjectsCmd(globalFlags))\n\tc.AddCommand(NewTemplatesCmd(globalFlags))\n\tc.AddCommand(NewClustersCmd(globalFlags))\n\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/list/projects.go",
    "content": "package list\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// ProjectsCmd holds the cmd flags\ntype ProjectsCmd struct {\n\t*flags.GlobalFlags\n\n\tlog log.Logger\n}\n\n// NewProjectsCmd creates a new command\nfunc NewProjectsCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ProjectsCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"projects\",\n\t\tShort: \"Lists projects for the provider\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *ProjectsCmd) Run(ctx context.Context) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprojectList, err := Projects(ctx, baseClient)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(projectList.Items)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n\nfunc Projects(ctx context.Context, client client.Client) (*managementv1.ProjectList, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprojectList, err := managementClient.Loft().ManagementV1().Projects().List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn projectList, fmt.Errorf(\"list projects: %w\", err)\n\t} else if len(projectList.Items) == 0 {\n\t\treturn projectList, fmt.Errorf(\"you don't have access to any projects, please make sure you have at least access to 1 project\")\n\t}\n\n\treturn projectList, nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/list/templates.go",
    "content": "package list\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/blang/semver\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/kube\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n)\n\n// TemplatesCmd holds the cmd flags\ntype TemplatesCmd struct {\n\t*flags.GlobalFlags\n\n\tlog log.Logger\n}\n\n// NewTemplatesCmd creates a new command\nfunc NewTemplatesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &TemplatesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"templates\",\n\t\tShort: \"Lists templates for the provider\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *TemplatesCmd) Run(ctx context.Context) error {\n\tprojectName := os.Getenv(platform.ProjectEnv)\n\tif projectName == \"\" {\n\t\treturn fmt.Errorf(\"%s environment variable is empty\", platform.ProjectEnv)\n\t}\n\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttemplates, err := Templates(ctx, baseClient, projectName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(templates)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\n\treturn nil\n}\n\nfunc Templates(ctx context.Context, client client.Client, projectName string) (*managementv1.ProjectTemplates, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttemplateList, err := managementClient.Loft().ManagementV1().Projects().ListTemplates(ctx, projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn templateList, fmt.Errorf(\"list templates: %w\", err)\n\t} else if len(templateList.DevPodWorkspaceTemplates) == 0 {\n\t\treturn templateList, fmt.Errorf(\"seems like there is no template allowed in project %s, please make sure to at least have a single template available\", projectName)\n\t}\n\n\treturn templateList, nil\n}\n\nfunc FindTemplate(ctx context.Context, managementClient kube.Interface, projectName, templateName string) (*managementv1.DevPodWorkspaceTemplate, error) {\n\ttemplateList, err := managementClient.Loft().ManagementV1().Projects().ListTemplates(ctx, projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list templates: %w\", err)\n\t} else if len(templateList.DevPodWorkspaceTemplates) == 0 {\n\t\treturn nil, fmt.Errorf(\"seems like there is no DevPod template allowed in project %s, please make sure to at least have a single template available\", projectName)\n\t}\n\n\t// find template\n\tvar template *managementv1.DevPodWorkspaceTemplate\n\tfor _, workspaceTemplate := range templateList.DevPodWorkspaceTemplates {\n\t\tif workspaceTemplate.Name == templateName {\n\t\t\tt := workspaceTemplate\n\t\t\ttemplate = &t\n\t\t\tbreak\n\t\t}\n\t}\n\tif template == nil {\n\t\treturn nil, fmt.Errorf(\"couldn't find template %s\", templateName)\n\t}\n\n\treturn template, nil\n}\n\nfunc GetTemplateParameters(template *managementv1.DevPodWorkspaceTemplate, templateVersion string) ([]storagev1.AppParameter, error) {\n\tif templateVersion == \"latest\" {\n\t\ttemplateVersion = \"\"\n\t}\n\n\tif templateVersion == \"\" {\n\t\tlatestVersion := GetLatestVersion(template)\n\t\tif latestVersion == nil {\n\t\t\treturn nil, fmt.Errorf(\"couldn't find any version in template\")\n\t\t}\n\n\t\treturn latestVersion.(*storagev1.DevPodWorkspaceTemplateVersion).Parameters, nil\n\t}\n\n\t_, latestMatched, err := GetLatestMatchedVersion(template, templateVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if latestMatched == nil {\n\t\treturn nil, fmt.Errorf(\"couldn't find any matching version to %s\", templateVersion)\n\t}\n\n\treturn latestMatched.(*storagev1.DevPodWorkspaceTemplateVersion).Parameters, nil\n}\n\ntype matchedVersion struct {\n\tObject  storagev1.VersionAccessor\n\tVersion semver.Version\n}\n\nfunc GetLatestVersion(versions storagev1.VersionsAccessor) storagev1.VersionAccessor {\n\t// find the latest version\n\tvar latestVersion *matchedVersion\n\tfor _, version := range versions.GetVersions() {\n\t\tparsedVersion, err := semver.Parse(strings.TrimPrefix(version.GetVersion(), \"v\"))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// latest available version\n\t\tif latestVersion == nil || latestVersion.Version.LT(parsedVersion) {\n\t\t\tlatestVersion = &matchedVersion{\n\t\t\t\tObject:  version,\n\t\t\t\tVersion: parsedVersion,\n\t\t\t}\n\t\t}\n\t}\n\tif latestVersion == nil {\n\t\treturn nil\n\t}\n\n\treturn latestVersion.Object\n}\n\nfunc GetLatestMatchedVersion(versions storagev1.VersionsAccessor, versionPattern string) (latestVersion storagev1.VersionAccessor, latestMatchedVersion storagev1.VersionAccessor, err error) {\n\t// parse version\n\tsplittedVersion := strings.Split(strings.ToLower(strings.TrimPrefix(versionPattern, \"v\")), \".\")\n\tif len(splittedVersion) != 3 {\n\t\treturn nil, nil, fmt.Errorf(\"couldn't parse version %s, expected version in format: 0.0.0\", versionPattern)\n\t}\n\n\t// find latest version that matches our defined version\n\tvar latestVersionObj *matchedVersion\n\tvar latestMatchedVersionObj *matchedVersion\n\tfor _, version := range versions.GetVersions() {\n\t\tparsedVersion, err := semver.Parse(strings.TrimPrefix(version.GetVersion(), \"v\"))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// does the version match our restrictions?\n\t\tif (splittedVersion[0] == \"x\" || splittedVersion[0] == \"X\" || strconv.FormatUint(parsedVersion.Major, 10) == splittedVersion[0]) &&\n\t\t\t(splittedVersion[1] == \"x\" || splittedVersion[1] == \"X\" || strconv.FormatUint(parsedVersion.Minor, 10) == splittedVersion[1]) &&\n\t\t\t(splittedVersion[2] == \"x\" || splittedVersion[2] == \"X\" || strconv.FormatUint(parsedVersion.Patch, 10) == splittedVersion[2]) {\n\t\t\tif latestMatchedVersionObj == nil || latestMatchedVersionObj.Version.LT(parsedVersion) {\n\t\t\t\tlatestMatchedVersionObj = &matchedVersion{\n\t\t\t\t\tObject:  version,\n\t\t\t\t\tVersion: parsedVersion,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// latest available version\n\t\tif latestVersionObj == nil || latestVersionObj.Version.LT(parsedVersion) {\n\t\t\tlatestVersionObj = &matchedVersion{\n\t\t\t\tObject:  version,\n\t\t\t\tVersion: parsedVersion,\n\t\t\t}\n\t\t}\n\t}\n\n\tif latestVersionObj != nil {\n\t\tlatestVersion = latestVersionObj.Object\n\t}\n\tif latestMatchedVersionObj != nil {\n\t\tlatestMatchedVersion = latestMatchedVersionObj.Object\n\t}\n\n\treturn latestVersion, latestMatchedVersion, nil\n}\n\nvar replaceRegEx = regexp.MustCompile(\"[^a-zA-Z0-9]+\")\n\nfunc VariableToEnvironmentVariable(variable string) string {\n\treturn \"TEMPLATE_OPTION_\" + strings.ToUpper(replaceRegEx.ReplaceAllString(variable, \"_\"))\n}\n"
  },
  {
    "path": "cmd/pro/provider/list/workspaces.go",
    "content": "package list\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/labels\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// WorkspacesCmd holds the cmd flags\ntype WorkspacesCmd struct {\n\t*flags.GlobalFlags\n\n\tlog log.Logger\n}\n\n// NewWorkspacesCmd creates a new command\nfunc NewWorkspacesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WorkspacesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"workspaces\",\n\t\tShort: \"Lists workspaces for the provider\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *WorkspacesCmd) Run(ctx context.Context) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprojectList, err := managementClient.Loft().ManagementV1().Projects().List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list projects: %w\", err)\n\t} else if len(projectList.Items) == 0 {\n\t\treturn fmt.Errorf(\"you don't have access to any projects within DevPod Pro, please make sure you have at least access to 1 project\")\n\t}\n\n\tfilterByOwner := os.Getenv(provider.LOFT_FILTER_BY_OWNER) == \"true\"\n\tworkspaces := []*managementv1.DevPodWorkspaceInstance{}\n\tfor _, p := range projectList.Items {\n\t\tns := project.ProjectNamespace(p.GetName())\n\t\tworkspaceList, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(ns).List(ctx, metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tcmd.log.Info(\"list workspaces in project \\\"%s\\\": %w\", p.GetName(), err)\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, instance := range workspaceList.Items {\n\t\t\tinstance := &instance\n\t\t\tif filterByOwner && !platform.IsOwner(baseClient.Self(), instance.GetOwner()) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif instance.GetLabels() == nil {\n\t\t\t\tinstance.Labels = map[string]string{}\n\t\t\t}\n\t\t\tinstance.Labels[labels.ProjectLabel] = p.GetName()\n\n\t\t\tworkspaces = append(workspaces, instance)\n\t\t}\n\t}\n\n\twBytes, err := json.Marshal(workspaces)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal workspaces: %w\", err)\n\t}\n\tfmt.Println(string(wBytes))\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/provider.go",
    "content": "package provider\n\nimport (\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/create\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/get\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/list\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/update\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/watch\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/telemetry\"\n\t\"github.com/loft-sh/log\"\n\n\t\"github.com/spf13/cobra\"\n)\n\n// NewProProviderCmd creates a new cobra command\nfunc NewProProviderCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"provider\",\n\t\tShort:  \"DevPod Pro provider commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif (globalFlags.Config == \"\" || globalFlags.Config == client.DefaultCacheConfig) && os.Getenv(\"LOFT_CONFIG\") != \"\" {\n\t\t\t\tglobalFlags.Config = os.Getenv(platform.ConfigEnv)\n\t\t\t}\n\n\t\t\tlog.Default.SetFormat(log.JSONFormat)\n\n\t\t\tif os.Getenv(clientimplementation.DevPodDebug) == \"true\" {\n\t\t\t\tglobalFlags.Debug = true\n\t\t\t}\n\n\t\t\t// Disable debug hints if we execute pro commands from DevPod Desktop\n\t\t\t// We're reusing the agent.AgentExecutedAnnotation for simplicity, could rename in the future\n\t\t\tif os.Getenv(telemetry.UIEnvVar) == \"true\" {\n\t\t\t\tcmd.VisitParents(func(c *cobra.Command) {\n\t\t\t\t\t// find the root command\n\t\t\t\t\tif c.Name() == \"devpod\" {\n\t\t\t\t\t\tif c.Annotations == nil {\n\t\t\t\t\t\t\tc.Annotations = map[string]string{}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc.Annotations[agent.AgentExecutedAnnotation] = \"true\"\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t}\n\n\tc.AddCommand(list.NewCmd(globalFlags))\n\tc.AddCommand(watch.NewCmd(globalFlags))\n\tc.AddCommand(create.NewCmd(globalFlags))\n\tc.AddCommand(get.NewCmd(globalFlags))\n\tc.AddCommand(update.NewCmd(globalFlags))\n\tc.AddCommand(NewHealthCmd(globalFlags))\n\n\tc.AddCommand(NewUpCmd(globalFlags))\n\tc.AddCommand(NewStopCmd(globalFlags))\n\tc.AddCommand(NewSshCmd(globalFlags))\n\tc.AddCommand(NewStatusCmd(globalFlags))\n\tc.AddCommand(NewDeleteCmd(globalFlags))\n\tc.AddCommand(NewRebuildCmd(globalFlags))\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/rebuild.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst AllWorkspaces = \"all\"\n\n// RebuildCmd holds the cmd flags\ntype RebuildCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tProject string\n}\n\n// NewRebuildCmd creates a new command\nfunc NewRebuildCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &RebuildCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"rebuild\",\n\t\tShort: \"Rebuild a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tlog.Default.SetFormat(log.TextFormat)\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\n\treturn c\n}\n\nfunc (cmd *RebuildCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"please provide a workspace name\")\n\t}\n\ttargetWorkspace := args[0]\n\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspace, err := platform.FindInstanceByName(ctx, baseClient, targetWorkspace, cmd.Project)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\topts := struct {\n\t\tRecreate bool `json:\"recreate\"`\n\t}{Recreate: true}\n\trawOpts, err := json.Marshal(opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalues := url.Values{\"options\": []string{string(rawOpts)}, \"cliMode\": []string{\"true\"}}\n\tconn, err := platform.DialInstance(baseClient, workspace, \"up\", values, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, os.Stdin, os.Stdout, os.Stderr, cmd.Log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/ssh.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SshCmd holds the cmd flags\ntype SshCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewSshCmd creates a new command\nfunc NewSshCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SshCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tHidden: true,\n\t\tUse:    \"ssh\",\n\t\tShort:  \"Runs ssh on a workspace\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *SshCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := platform.FindInstanceInProject(ctx, baseClient, info.UID, info.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\treturn fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\tconn, err := platform.DialInstance(baseClient, workspace, \"ssh\", platform.OptionsFromEnv(\"DEVPOD_FLAGS_SSH\"), cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, stdin, stdout, stderr, cmd.Log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/status.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StatusCmd holds the cmd flags\ntype StatusCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewStatusCmd creates a new command\nfunc NewStatusCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StatusCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tHidden: true,\n\t\tUse:    \"status\",\n\t\tShort:  \"Runs status on a workspace\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *StatusCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := platform.FindInstanceInProject(ctx, baseClient, info.UID, info.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\tout, err := json.Marshal(&storagev1.WorkspaceStatusResult{\n\t\t\tID:       os.Getenv(platform.WorkspaceIDEnv),\n\t\t\tContext:  os.Getenv(platform.WorkspaceContextEnv),\n\t\t\tState:    string(storagev1.WorkspaceStatusNotFound),\n\t\t\tProvider: os.Getenv(platform.WorkspaceProviderEnv),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Println(string(out))\n\t\treturn nil\n\t}\n\n\tconn, err := platform.DialInstance(baseClient, workspace, \"getstatus\", platform.OptionsFromEnv(\"DEVPOD_FLAGS_STATUS\"), cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, stdin, stdout, stderr, cmd.Log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/stop.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StopCmd holds the cmd flags\ntype StopCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewStopCmd creates a new command\nfunc NewStopCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StopCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tHidden: true,\n\t\tUse:    \"stop\",\n\t\tShort:  \"Runs stop on a workspace\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *StopCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := platform.FindInstanceInProject(ctx, baseClient, info.UID, info.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\treturn fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\tconn, err := platform.DialInstance(baseClient, workspace, \"stop\", platform.OptionsFromEnv(storagev1.DevPodFlagsStop), cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, stdin, stdout, stderr, cmd.Log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/provider/up.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\tcorev1 \"k8s.io/api/core/v1\"\n)\n\n// UpCmd holds the cmd flags:\ntype UpCmd struct {\n\t*flags.GlobalFlags\n\n\tLog     log.Logger\n\tstreams streams\n}\n\ntype streams struct {\n\tStdin  io.Reader\n\tStdout io.Writer\n\tStderr io.Writer\n}\n\n// NewUpCmd creates a new command\nfunc NewUpCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tlogLevel := logrus.InfoLevel\n\tif os.Getenv(clientimplementation.DevPodDebug) == \"true\" || globalFlags.Debug {\n\t\tlogLevel = logrus.DebugLevel\n\t}\n\n\tcmd := &UpCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog: log.NewStreamLoggerWithFormat( /* we don't use stdout */ nil,\n\t\t\tos.Stderr, logLevel, log.JSONFormat).ErrorStreamOnly(),\n\t\tstreams: streams{\n\t\t\tStdin:  os.Stdin,\n\t\t\tStdout: os.Stdout,\n\t\t\tStderr: os.Stderr,\n\t\t},\n\t}\n\tc := &cobra.Command{\n\t\tHidden: true,\n\t\tUse:    \"up\",\n\t\tShort:  \"Runs up on a workspace\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context())\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *UpCmd) Run(ctx context.Context) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := platform.GetWorkspaceInfoFromEnv()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstance, err := platform.FindInstanceInProject(ctx, baseClient, info.UID, info.ProjectName)\n\tif err != nil {\n\t\treturn err\n\t} else if instance == nil {\n\t\treturn fmt.Errorf(\"workspace %s not found in project %s. Looks like it does not exist anymore and you can delete it\", info.ID, info.ProjectName)\n\t}\n\n\t// Log current workspace information. This is both useful to the user to understand the workspace configuration\n\t// and to us when we receive troubleshooting logs\n\tprintInstanceInfo(instance, cmd.Log)\n\n\tif instance.Spec.TemplateRef != nil && templateUpdateRequired(instance) {\n\t\tcmd.Log.Info(\"Template update required\")\n\t\toldInstance := instance.DeepCopy()\n\t\tinstance.Spec.TemplateRef.SyncOnce = true\n\n\t\tinstance, err = platform.UpdateInstance(ctx, baseClient, oldInstance, instance, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"update instance: %w\", err)\n\t\t}\n\t\tcmd.Log.Info(\"Successfully updated template\")\n\t}\n\n\treturn cmd.up(ctx, instance, baseClient)\n}\n\nfunc (cmd *UpCmd) up(ctx context.Context, workspace *managementv1.DevPodWorkspaceInstance, client client.Client) error {\n\toptions := platform.OptionsFromEnv(storagev1.DevPodFlagsUp)\n\tif options != nil && os.Getenv(\"DEBUG\") == \"true\" {\n\t\toptions.Add(\"debug\", \"true\")\n\t}\n\n\tconn, err := platform.DialInstance(client, workspace, \"up\", options, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, cmd.streams.Stdin, cmd.streams.Stdout, cmd.streams.Stderr, cmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc templateUpdateRequired(instance *managementv1.DevPodWorkspaceInstance) bool {\n\tvar templateResolved, templateChangesAvailable bool\n\tfor _, condition := range instance.Status.Conditions {\n\t\tif condition.Type == storagev1.InstanceTemplateResolved {\n\t\t\ttemplateResolved = condition.Status == corev1.ConditionTrue\n\t\t\tcontinue\n\t\t}\n\n\t\tif condition.Type == storagev1.InstanceTemplateSynced {\n\t\t\ttemplateChangesAvailable = condition.Status == corev1.ConditionFalse &&\n\t\t\t\tcondition.Reason == \"TemplateChangesAvailable\"\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn !templateResolved || templateChangesAvailable\n}\n\nfunc printInstanceInfo(instance *managementv1.DevPodWorkspaceInstance, log log.Logger) {\n\tworkspaceConfig, _ := json.Marshal(struct {\n\t\t// Cluster    storagev1.WorkspaceTargetNamespace\n\t\tTemplate   *storagev1.TemplateRef\n\t\tParameters string\n\t}{\n\t\t// Cluster:    cluster,\n\t\t// FIXME: Bring back runner ref\n\t\tTemplate:   instance.Spec.TemplateRef,\n\t\tParameters: instance.Spec.Parameters,\n\t})\n\tlog.Debug(\"Starting pro workspace with configuration\", string(workspaceConfig))\n}\n"
  },
  {
    "path": "cmd/pro/provider/update/update.go",
    "content": "package update\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"update\",\n\t\tShort:  \"DevPod Pro Provider update commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewWorkspaceCmd(globalFlags))\n\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/update/workspace.go",
    "content": "package update\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/form\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/terminal\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// WorkspaceCmd holds the cmd flags\ntype WorkspaceCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewWorkspaceCmd creates a new command\nfunc NewWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WorkspaceCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance().ErrorStreamOnly(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"workspace\",\n\t\tShort:  \"Create a workspace\",\n\t\tHidden: true,\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\nfunc (cmd *WorkspaceCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// GUI\n\tinstanceEnv := os.Getenv(platform.WorkspaceInstanceEnv)\n\tif instanceEnv != \"\" {\n\t\tnewInstance := &managementv1.DevPodWorkspaceInstance{}\n\t\terr := json.Unmarshal([]byte(instanceEnv), newInstance)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshal workpace instance %s: %w\", instanceEnv, err)\n\t\t}\n\t\tnewInstance.TypeMeta = metav1.TypeMeta{} // ignore\n\n\t\tprojectName := project.ProjectFromNamespace(newInstance.GetNamespace())\n\t\toldInstance, err := platform.FindInstanceByName(ctx, baseClient, newInstance.GetName(), projectName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tupdatedInstance, err := updateInstance(ctx, baseClient, oldInstance, newInstance, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tout, err := json.Marshal(updatedInstance)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(string(out))\n\n\t\treturn nil\n\t}\n\n\t// CLI\n\tif !terminal.IsTerminalIn {\n\t\treturn fmt.Errorf(\"unable to update instance through CLI if stdin is not a terminal\")\n\t}\n\tworkspaceID := os.Getenv(platform.WorkspaceIDEnv)\n\tworkspaceUID := os.Getenv(platform.WorkspaceUIDEnv)\n\tproject := os.Getenv(platform.ProjectEnv)\n\tif workspaceUID == \"\" || workspaceID == \"\" || project == \"\" {\n\t\treturn fmt.Errorf(\"workspaceID, workspaceUID or project not found: %s, %s, %s\", workspaceID, workspaceUID, project)\n\t}\n\n\toldInstance, err := platform.FindInstanceInProject(ctx, baseClient, workspaceUID, project)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnewInstance, err := form.UpdateInstance(ctx, baseClient, oldInstance, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = updateInstance(ctx, baseClient, oldInstance, newInstance, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc updateInstance(ctx context.Context, client client.Client, oldInstance *managementv1.DevPodWorkspaceInstance, newInstance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\t// This ensures the template is kept up to date with configuration changes\n\tif newInstance.Spec.TemplateRef != nil {\n\t\tnewInstance.Spec.TemplateRef.SyncOnce = true\n\t}\n\n\treturn platform.UpdateInstance(ctx, client, oldInstance, newInstance, log)\n}\n"
  },
  {
    "path": "cmd/pro/provider/watch/watch.go",
    "content": "package watch\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewCmd creates a new cobra command\nfunc NewCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:    \"watch\",\n\t\tShort:  \"DevPod Pro Provider watch commands\",\n\t\tArgs:   cobra.NoArgs,\n\t\tHidden: true,\n\t}\n\n\tc.AddCommand(NewWorkspacesCmd(globalFlags))\n\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/provider/watch/workspaces.go",
    "content": "package watch\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\tloftclient \"github.com/loft-sh/api/v4/pkg/clientset/versioned\"\n\tinformers \"github.com/loft-sh/api/v4/pkg/informers/externalversions\"\n\tinformermanagementv1 \"github.com/loft-sh/api/v4/pkg/informers/externalversions/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/client-go/tools/cache\"\n)\n\n// WorkspacesCmd holds the cmd flags\ntype WorkspacesCmd struct {\n\t*flags.GlobalFlags\n\n\tLog log.Logger\n}\n\n// NewWorkspacesCmd creates a new command\nfunc NewWorkspacesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WorkspacesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.Default.ErrorStreamOnly(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"workspaces\",\n\t\tShort:  \"Watches all workspaces for a project\",\n\t\tHidden: true,\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), os.Stdin, os.Stdout, os.Stderr)\n\t\t},\n\t}\n\n\treturn c\n}\n\ntype ProWorkspaceInstance struct {\n\tmetav1.TypeMeta   `json:\",inline\"`\n\tmetav1.ObjectMeta `json:\"metadata,omitempty\"`\n\n\tSpec   managementv1.DevPodWorkspaceInstanceSpec `json:\"spec,omitempty\"`\n\tStatus ProWorkspaceInstanceStatus               `json:\"status,omitempty\"`\n}\n\ntype ProWorkspaceInstanceStatus struct {\n\tmanagementv1.DevPodWorkspaceInstanceStatus `json:\",inline\"`\n\n\tSource *provider.WorkspaceSource    `json:\"source,omitempty\"`\n\tIDE    *provider.WorkspaceIDEConfig `json:\"ide,omitempty\"`\n}\n\nfunc (cmd *WorkspacesCmd) Run(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tif cmd.Context == \"\" {\n\t\tcmd.Context = config.DefaultContext\n\t}\n\n\tprojectName := os.Getenv(provider.LOFT_PROJECT)\n\tif projectName == \"\" {\n\t\treturn fmt.Errorf(\"project name not found\")\n\t}\n\n\tbaseClient, err := client.InitClientFromPath(ctx, cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanagementConfig, err := baseClient.ManagementConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclientset, err := loftclient.NewForConfig(managementConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfactory := informers.NewSharedInformerFactoryWithOptions(clientset, time.Second*60,\n\t\tinformers.WithNamespace(project.ProjectNamespace(projectName)),\n\t)\n\tworkspaceInformer := factory.Management().V1().DevPodWorkspaceInstances()\n\n\tself := baseClient.Self()\n\tfilterByOwner := os.Getenv(provider.LOFT_FILTER_BY_OWNER) == \"true\"\n\tinstanceStore := newStore(workspaceInformer, self, cmd.Context, filterByOwner, cmd.Log)\n\n\t_, err = workspaceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{\n\t\tAddFunc: func(obj interface{}) {\n\t\t\tinstance, ok := obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tinstanceStore.Add(instance)\n\t\t\tprintInstances(stdout, instanceStore.List())\n\t\t},\n\t\tUpdateFunc: func(oldObj interface{}, newObj interface{}) {\n\t\t\toldInstance, ok := oldObj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tnewInstance, ok := newObj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tinstanceStore.Update(oldInstance, newInstance)\n\t\t\tprintInstances(stdout, instanceStore.List())\n\t\t},\n\t\tDeleteFunc: func(obj interface{}) {\n\t\t\tinstance, ok := obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\t// check for DeletedFinalStateUnknown. Can happen if the informer misses the delete event\n\t\t\t\tu, ok := obj.(cache.DeletedFinalStateUnknown)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tinstance, ok = u.Obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tinstanceStore.Delete(instance)\n\t\t\tprintInstances(stdout, instanceStore.List())\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstopCh := make(chan struct{})\n\tdefer close(stopCh)\n\tgo func() {\n\t\tfactory.Start(stopCh)\n\t\tfactory.WaitForCacheSync(stopCh)\n\n\t\t// Kick off initial message\n\t\tprintInstances(stdout, instanceStore.List())\n\t}()\n\n\t<-stopCh\n\n\treturn nil\n}\n\ntype instanceStore struct {\n\tinformer      informermanagementv1.DevPodWorkspaceInstanceInformer\n\tself          *managementv1.Self\n\tcontext       string\n\tfilterByOwner bool\n\n\tm         sync.Mutex\n\tinstances map[string]*ProWorkspaceInstance\n\n\tlog log.Logger\n}\n\nfunc newStore(informer informermanagementv1.DevPodWorkspaceInstanceInformer, self *managementv1.Self, context string, filterByOwner bool, log log.Logger) *instanceStore {\n\treturn &instanceStore{\n\t\tinformer:      informer,\n\t\tself:          self,\n\t\tcontext:       context,\n\t\tfilterByOwner: filterByOwner,\n\t\tinstances:     map[string]*ProWorkspaceInstance{},\n\t\tlog:           log,\n\t}\n}\n\nfunc (s *instanceStore) key(meta metav1.ObjectMeta) string {\n\treturn fmt.Sprintf(\"%s/%s\", meta.Namespace, meta.Name)\n}\n\nfunc (s *instanceStore) Add(instance *managementv1.DevPodWorkspaceInstance) {\n\tif s.filterByOwner && !platform.IsOwner(s.self, instance.Spec.Owner) {\n\t\treturn\n\t}\n\tvar source *provider.WorkspaceSource\n\tif instance.GetAnnotations() != nil && instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation] != \"\" {\n\t\tsource = provider.ParseWorkspaceSource(instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation])\n\t}\n\n\tvar ideConfig *provider.WorkspaceIDEConfig\n\tif instance.GetLabels() != nil && instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel] != \"\" {\n\t\tid := instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel]\n\t\tworkspaceConfig, err := provider.LoadWorkspaceConfig(s.context, id)\n\t\tif err == nil {\n\t\t\tideConfig = &workspaceConfig.IDE\n\t\t}\n\t}\n\n\tproInstance := &ProWorkspaceInstance{\n\t\tTypeMeta:   instance.TypeMeta,\n\t\tObjectMeta: instance.ObjectMeta,\n\t\tSpec:       instance.Spec,\n\t\tStatus: ProWorkspaceInstanceStatus{\n\t\t\tDevPodWorkspaceInstanceStatus: instance.Status,\n\t\t\tSource:                        source,\n\t\t\tIDE:                           ideConfig,\n\t\t},\n\t}\n\n\tkey := s.key(instance.ObjectMeta)\n\ts.m.Lock()\n\ts.instances[key] = proInstance\n\ts.m.Unlock()\n}\n\nfunc (s *instanceStore) Update(oldInstance *managementv1.DevPodWorkspaceInstance, newInstance *managementv1.DevPodWorkspaceInstance) {\n\ts.Add(newInstance)\n}\n\nfunc (s *instanceStore) Delete(instance *managementv1.DevPodWorkspaceInstance) {\n\tif s.filterByOwner && !platform.IsOwner(s.self, instance.Spec.Owner) {\n\t\treturn\n\t}\n\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\tkey := s.key(instance.ObjectMeta)\n\tdelete(s.instances, key)\n}\n\nfunc (s *instanceStore) List() []*ProWorkspaceInstance {\n\tinstanceList := []*ProWorkspaceInstance{}\n\t// Check local imported workspaces\n\t// Eventually this should be implemented by filtering based on ownership and access on the CRD, for now we're stuck with this approach...\n\tlocalWorkspaces, err := workspace.ListLocalWorkspaces(s.context, false, s.log)\n\tif err == nil {\n\t\tfor _, workspace := range localWorkspaces {\n\t\t\tif workspace.Imported && workspace.Pro != nil {\n\t\t\t\t// get instance for imported workspace\n\t\t\t\tselector, err := metav1.LabelSelectorAsSelector(&metav1.LabelSelector{\n\t\t\t\t\tMatchLabels: map[string]string{\n\t\t\t\t\t\tstoragev1.DevPodWorkspaceUIDLabel: workspace.UID,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tl, err := s.informer.Lister().\n\t\t\t\t\tDevPodWorkspaceInstances(project.ProjectFromNamespace(workspace.Pro.Project)).\n\t\t\t\t\tList(selector)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif len(l) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tinstance := l[0]\n\t\t\t\ts.m.Lock()\n\t\t\t\tif _, ok := s.instances[s.key(instance.ObjectMeta)]; ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ts.m.Unlock()\n\n\t\t\t\tvar source *provider.WorkspaceSource\n\t\t\t\tif instance.GetAnnotations() != nil && instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation] != \"\" {\n\t\t\t\t\tsource = provider.ParseWorkspaceSource(instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation])\n\t\t\t\t}\n\n\t\t\t\tvar ideConfig *provider.WorkspaceIDEConfig\n\t\t\t\tif instance.GetLabels() != nil && instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel] != \"\" {\n\t\t\t\t\tid := instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel]\n\t\t\t\t\tworkspaceConfig, err := provider.LoadWorkspaceConfig(s.context, id)\n\t\t\t\t\tif err == nil {\n\t\t\t\t\t\tideConfig = &workspaceConfig.IDE\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproInstance := &ProWorkspaceInstance{\n\t\t\t\t\tTypeMeta:   instance.TypeMeta,\n\t\t\t\t\tObjectMeta: instance.ObjectMeta,\n\t\t\t\t\tSpec:       instance.Spec,\n\t\t\t\t\tStatus: ProWorkspaceInstanceStatus{\n\t\t\t\t\t\tDevPodWorkspaceInstanceStatus: instance.Status,\n\t\t\t\t\t\tSource:                        source,\n\t\t\t\t\t\tIDE:                           ideConfig,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\tinstanceList = append(instanceList, proInstance)\n\t\t\t}\n\t\t}\n\t}\n\n\ts.m.Lock()\n\tfor _, instance := range s.instances {\n\t\tinstanceList = append(instanceList, instance)\n\t}\n\ts.m.Unlock()\n\n\treturn instanceList\n}\n\nfunc printInstances(w io.Writer, instances []*ProWorkspaceInstance) {\n\tout, err := json.Marshal(instances)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfmt.Fprintln(w, string(out))\n}\n"
  },
  {
    "path": "cmd/pro/rebuild.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/remotecommand\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst AllWorkspaces = \"all\"\n\n// RebuildCmd holds the cmd flags\ntype RebuildCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tProject string\n\tHost    string\n}\n\n// NewRebuildCmd creates a new command\nfunc NewRebuildCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &RebuildCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"rebuild\",\n\t\tShort: \"Rebuild a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tlog.Default.SetFormat(log.TextFormat)\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *RebuildCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"please provide a workspace name\")\n\t}\n\ttargetWorkspace := args[0]\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseClient, err := platform.InitClientFromHost(ctx, devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve host \\\"%s\\\": %w\", cmd.Host, err)\n\t}\n\n\tworkspace, err := platform.FindInstanceByName(ctx, baseClient, targetWorkspace, cmd.Project)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\topts := struct {\n\t\tRecreate bool `json:\"recreate\"`\n\t}{Recreate: true}\n\trawOpts, err := json.Marshal(opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalues := url.Values{\"options\": []string{string(rawOpts)}, \"cliMode\": []string{\"true\"}}\n\tconn, err := platform.DialInstance(baseClient, workspace, \"up\", values, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = remotecommand.ExecuteConn(ctx, conn, os.Stdin, os.Stdout, os.Stderr, cmd.Log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error executing: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/reset/password.go",
    "content": "package reset\n\nimport (\n\t\"context\"\n\t\"crypto/sha256\"\n\t\"fmt\"\n\t\"strings\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform/kube\"\n\t\"github.com/loft-sh/devpod/pkg/random\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\tctrl \"sigs.k8s.io/controller-runtime\"\n)\n\n// PasswordCmd holds the lags\ntype PasswordCmd struct {\n\t*flags.GlobalFlags\n\n\tUser     string\n\tPassword string\n\tCreate   bool\n\tForce    bool\n\n\tLog log.Logger\n}\n\n// NewPasswordCmd creates a new command\nfunc NewPasswordCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &PasswordCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tdescription := `\nResets the password of a user.\n\nExample:\ndevpod pro reset password\ndevpod pro reset password --user admin\n#######################################################\n\t`\n\tc := &cobra.Command{\n\t\tUse:   \"password\",\n\t\tShort: \"Resets the password of a user\",\n\t\tLong:  description,\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run()\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.User, \"user\", \"admin\", \"The name of the user to reset the password\")\n\tc.Flags().StringVar(&cmd.Password, \"password\", \"\", \"The new password to use\")\n\tc.Flags().BoolVar(&cmd.Create, \"create\", false, \"Creates the user if it does not exist\")\n\tc.Flags().BoolVar(&cmd.Force, \"force\", false, \"If user had no password will create one\")\n\treturn c\n}\n\n// Run executes the functionality\nfunc (cmd *PasswordCmd) Run() error {\n\trestConfig, err := ctrl.GetConfig()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get kube config\")\n\t}\n\n\tmanagementClient, err := kube.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// get user\n\tcmd.Log.Infof(\"Resetting password of user %s\", cmd.User)\n\tuser, err := managementClient.Loft().StorageV1().Users().Get(context.Background(), cmd.User, metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn errors.Wrap(err, \"get user\")\n\t} else if kerrors.IsNotFound(err) {\n\t\t// create user\n\t\tif !cmd.Create {\n\t\t\treturn fmt.Errorf(\"user %s was not found, run with '--create' to create this user automatically\", cmd.User)\n\t\t}\n\n\t\tuser, err = managementClient.Loft().StorageV1().Users().Create(context.Background(), &storagev1.User{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: cmd.User,\n\t\t\t},\n\t\t\tSpec: storagev1.UserSpec{\n\t\t\t\tUsername: cmd.User,\n\t\t\t\tSubject:  cmd.User,\n\t\t\t\tGroups: []string{\n\t\t\t\t\t\"system:masters\",\n\t\t\t\t},\n\t\t\t\tPasswordRef: &storagev1.SecretRef{\n\t\t\t\t\tSecretName:      \"loft-password-\" + random.String(5),\n\t\t\t\t\tSecretNamespace: \"loft\",\n\t\t\t\t\tKey:             \"password\",\n\t\t\t\t},\n\t\t\t},\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// check if user had a password before\n\tif user.Spec.PasswordRef == nil || user.Spec.PasswordRef.SecretName == \"\" || user.Spec.PasswordRef.SecretNamespace == \"\" || user.Spec.PasswordRef.Key == \"\" {\n\t\tif !cmd.Force {\n\t\t\treturn fmt.Errorf(\"user %s had no password. If you want to force password creation, please run with the '--force' flag\", cmd.User)\n\t\t}\n\n\t\tuser.Spec.PasswordRef = &storagev1.SecretRef{\n\t\t\tSecretName:      \"loft-password-\" + random.String(5),\n\t\t\tSecretNamespace: \"loft\",\n\t\t\tKey:             \"password\",\n\t\t}\n\t\tuser, err = managementClient.Loft().StorageV1().Users().Update(context.Background(), user, metav1.UpdateOptions{})\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"update user\")\n\t\t}\n\t}\n\n\t// now ask user for new password\n\tpassword := cmd.Password\n\tif password == \"\" {\n\t\tfor {\n\t\t\tpassword, err = cmd.Log.Question(&survey.QuestionOptions{\n\t\t\t\tQuestion:   \"Please enter a new password\",\n\t\t\t\tIsPassword: true,\n\t\t\t})\n\t\t\tpassword = strings.TrimSpace(password)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t} else if password == \"\" {\n\t\t\t\tcmd.Log.Error(\"Please enter a password\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\t}\n\tpasswordHash := []byte(fmt.Sprintf(\"%x\", sha256.Sum256([]byte(password))))\n\n\t// check if secret exists\n\tpasswordSecret, err := managementClient.CoreV1().Secrets(user.Spec.PasswordRef.SecretNamespace).Get(context.Background(), user.Spec.PasswordRef.SecretName, metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t} else if kerrors.IsNotFound(err) {\n\t\t_, err = managementClient.CoreV1().Secrets(user.Spec.PasswordRef.SecretNamespace).Create(context.Background(), &corev1.Secret{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName:      user.Spec.PasswordRef.SecretName,\n\t\t\t\tNamespace: user.Spec.PasswordRef.SecretNamespace,\n\t\t\t},\n\t\t\tData: map[string][]byte{\n\t\t\t\tuser.Spec.PasswordRef.Key: passwordHash,\n\t\t\t},\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"create password secret\")\n\t\t}\n\t} else {\n\t\tif passwordSecret.Data == nil {\n\t\t\tpasswordSecret.Data = map[string][]byte{}\n\t\t}\n\t\tpasswordSecret.Data[user.Spec.PasswordRef.Key] = passwordHash\n\t\t_, err = managementClient.CoreV1().Secrets(user.Spec.PasswordRef.SecretNamespace).Update(context.Background(), passwordSecret, metav1.UpdateOptions{})\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"update password secret\")\n\t\t}\n\t}\n\n\tcmd.Log.Donef(\"Successfully reset password of user %s\", cmd.User)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/reset/reset.go",
    "content": "package reset\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewResetCmd creates a new cobra command\nfunc NewResetCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:   \"reset\",\n\t\tShort: \"Reset configuration\",\n\t\tArgs:  cobra.NoArgs,\n\t}\n\n\tc.AddCommand(NewPasswordCmd(globalFlags))\n\treturn c\n}\n"
  },
  {
    "path": "cmd/pro/self.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SelfCmd holds the cmd flags\ntype SelfCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewSelfCmd creates a new command\nfunc NewSelfCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SelfCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"self\",\n\t\tShort:  \"Get self\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *SelfCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"getSelf\",\n\t\tprovider.Exec.Proxy.Get.Self,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\tdevPodConfig.ProviderOptions(provider.Name),\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get self: %w\", err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/sleep.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n\n\tclusterv1 \"github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\tctrlclient \"sigs.k8s.io/controller-runtime/pkg/client\"\n)\n\n// SleepCmd holds the cmd flags\ntype SleepCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tProject       string\n\tHost          string\n\tForceDuration int64\n}\n\n// NewSleepCmd creates a new command\nfunc NewSleepCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SleepCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"sleep\",\n\t\tShort: \"Put a workspace to sleep\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tlog.Default.SetFormat(log.TextFormat)\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\tc.Flags().Int64Var(&cmd.ForceDuration, \"prevent-wakeup\", -1, \"The amount of seconds this workspace should sleep until it can be woken up again (use 0 for infinite sleeping). During this time the space can only be woken up by `devpod pro wakeup`, manually deleting the annotation on the namespace or through the UI\")\n\t_ = c.MarkFlagRequired(\"project\")\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *SleepCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"please provide a workspace name\")\n\t}\n\ttargetWorkspace := args[0]\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseClient, err := platform.InitClientFromHost(ctx, devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceInstance, err := platform.FindInstanceByName(ctx, baseClient, targetWorkspace, cmd.Project)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create a deep copy of the workspace instance\n\toldWorkspaceInstance := workspaceInstance.DeepCopy()\n\toldWorkspaceInstance.Status = workspaceInstance.Status\n\toldWorkspaceInstance.ObjectMeta = workspaceInstance.ObjectMeta\n\toldWorkspaceInstance.TypeMeta = workspaceInstance.TypeMeta\n\n\t// create a patch from the old workspace instance\n\tpatch := ctrlclient.MergeFrom(oldWorkspaceInstance)\n\tif workspaceInstance.Annotations == nil {\n\t\tworkspaceInstance.Annotations = map[string]string{}\n\t}\n\tworkspaceInstance.Annotations[clusterv1.SleepModeForceAnnotation] = \"true\"\n\tif cmd.ForceDuration >= 0 {\n\t\tworkspaceInstance.Annotations[clusterv1.SleepModeForceDurationAnnotation] = strconv.FormatInt(cmd.ForceDuration, 10)\n\t}\n\tpatchData, err := patch.Data(workspaceInstance)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create patch: %w\", err)\n\t}\n\n\t_, err = managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(cmd.Project)).Patch(ctx, workspaceInstance.Name, patch.Type(), patchData, metav1.PatchOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait for sleeping\n\tcmd.Log.Info(\"Wait until workspace is sleeping...\")\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, platform.Timeout(), false, func(ctx context.Context) (done bool, err error) {\n\t\tworkspaceInstance, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(cmd.Project)).Get(ctx, workspaceInstance.Name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn workspaceInstance.Status.Phase == storagev1.InstanceSleeping, nil\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error waiting for workspace to start sleeping: %w\", err)\n\t}\n\n\tcmd.Log.Donef(\"Successfully put workspace %s to sleep\", workspaceInstance.Name)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/start.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\tnetUrl \"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/denisbrodbeck/machineid\"\n\tjsonpatch \"github.com/evanphx/json-patch\"\n\t\"github.com/mgutz/ansi\"\n\t\"github.com/skratchdot/open-golang/open\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/api/v4/pkg/auth\"\n\tloftclientset \"github.com/loft-sh/api/v4/pkg/clientset/versioned\"\n\tproflags \"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/hash\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/types\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\t\"k8s.io/client-go/kubernetes\"\n\t\"k8s.io/client-go/rest\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n\t\"k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset\"\n\t\"k8s.io/kubectl/pkg/util/term\"\n)\n\nconst LoftRouterDomainSecret = \"loft-router-domain\"\nconst passwordChangedHint = \"(has been changed)\"\nconst defaultUser = \"admin\"\n\nconst defaultReleaseName = \"devpod-pro\"\n\nvar defaultDeploymentName = \"loft\" // Need to update helm chart if we change this!\n\n// StartCmd holds the login cmd flags\ntype StartCmd struct {\n\tproflags.GlobalFlags\n\n\tKubeClient       kubernetes.Interface\n\tLog              log.Logger\n\tRestConfig       *rest.Config\n\tContext          string\n\tValues           string\n\tLocalPort        string\n\tVersion          string\n\tDockerImage      string\n\tNamespace        string\n\tPassword         string\n\tHost             string\n\tEmail            string\n\tChartRepo        string\n\tProduct          string\n\tChartName        string\n\tChartPath        string\n\tDockerArgs       []string\n\tReset            bool\n\tNoPortForwarding bool\n\tNoTunnel         bool\n\tNoLogin          bool\n\tNoWait           bool\n\tUpgrade          bool\n\tReuseValues      bool\n\tDocker           bool\n}\n\n// NewStartCmd creates a new command\nfunc NewStartCmd(flags *proflags.GlobalFlags) *cobra.Command {\n\tcmd := &StartCmd{GlobalFlags: *flags,\n\t\tProduct:   \"devpod-pro\",\n\t\tChartName: \"devpod-pro\",\n\t\tLog:       log.Default,\n\t}\n\tstartCmd := &cobra.Command{\n\t\tUse:   \"start\",\n\t\tShort: \"Start a Devpod Pro instance\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tstartCmd.Flags().BoolVar(&cmd.Docker, \"docker\", false, \"If enabled will try to deploy DevPod Pro to the local docker installation.\")\n\tstartCmd.Flags().StringVar(&cmd.DockerImage, \"docker-image\", \"\", \"The docker image to install.\")\n\tstartCmd.Flags().StringArrayVar(&cmd.DockerArgs, \"docker-arg\", []string{}, \"Extra docker args\")\n\tstartCmd.Flags().StringVar(&cmd.Context, \"context\", \"\", \"The kube context to use for installation\")\n\tstartCmd.Flags().StringVar(&cmd.Namespace, \"namespace\", \"devpod-pro\", \"The namespace to install into\")\n\tstartCmd.Flags().StringVar(&cmd.Host, \"host\", \"\", \"Provide a hostname to enable ingress and configure its hostname\")\n\tstartCmd.Flags().StringVar(&cmd.Password, \"password\", \"\", \"The password to use for the admin account. (If empty this will be the namespace UID)\")\n\tstartCmd.Flags().StringVar(&cmd.Version, \"version\", \"\", \"The version to install\")\n\tstartCmd.Flags().StringVar(&cmd.Values, \"values\", \"\", \"Path to a file for extra helm chart values\")\n\tstartCmd.Flags().BoolVar(&cmd.ReuseValues, \"reuse-values\", true, \"Reuse previous helm values on upgrade\")\n\tstartCmd.Flags().BoolVar(&cmd.Upgrade, \"upgrade\", false, \"If true, will try to upgrade the release\")\n\tstartCmd.Flags().StringVar(&cmd.Email, \"email\", \"\", \"The email to use for the installation\")\n\tstartCmd.Flags().BoolVar(&cmd.Reset, \"reset\", false, \"If true, an existing instance will be deleted before installing DevPod Pro\")\n\tstartCmd.Flags().BoolVar(&cmd.NoWait, \"no-wait\", false, \"If true, will not wait after installing it\")\n\tstartCmd.Flags().BoolVar(&cmd.NoTunnel, \"no-tunnel\", false, \"If true, will not create a loft.host tunnel for this installation\")\n\tstartCmd.Flags().BoolVar(&cmd.NoLogin, \"no-login\", false, \"If true, will not login to a DevPod Pro instance on start\")\n\tstartCmd.Flags().StringVar(&cmd.ChartPath, \"chart-path\", \"\", \"The local chart path to deploy DevPod Pro\")\n\tstartCmd.Flags().StringVar(&cmd.ChartRepo, \"chart-repo\", \"https://charts.loft.sh/\", \"The chart repo to deploy DevPod Pro\")\n\n\treturn startCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StartCmd) Run(ctx context.Context) error {\n\tif cmd.Docker {\n\t\treturn cmd.startDocker(ctx)\n\t}\n\n\t// only set local port by default in kubernetes installation\n\tif cmd.LocalPort == \"\" {\n\t\tcmd.LocalPort = \"9898\"\n\t}\n\n\terr := cmd.prepare()\n\tif err != nil {\n\t\treturn err\n\t}\n\tcmd.Log.WriteString(logrus.InfoLevel, \"\\n\")\n\n\t// Uninstall already existing instance\n\tif cmd.Reset {\n\t\terr = uninstall(ctx, cmd.KubeClient, cmd.RestConfig, cmd.Context, cmd.Namespace, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Is already installed?\n\tisInstalled, err := isAlreadyInstalled(ctx, cmd.KubeClient, cmd.Namespace)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Use default password if none is set\n\tif cmd.Password == \"\" {\n\t\tdefaultPassword, err := getDefaultPassword(ctx, cmd.KubeClient, cmd.Namespace)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcmd.Password = defaultPassword\n\t}\n\n\t// Upgrade Loft if already installed\n\tif isInstalled {\n\t\treturn cmd.handleAlreadyExistingInstallation(ctx)\n\t}\n\n\t// Install Loft\n\tcmd.Log.Info(\"Welcome to DevPod Pro!\")\n\tcmd.Log.Info(\"This installer will help you to get started.\")\n\n\t// make sure we are ready for installing\n\terr = cmd.prepareInstall(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = cmd.upgrade()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn cmd.success(ctx)\n}\n\nfunc (cmd *StartCmd) upgrade() error {\n\textraArgs := []string{}\n\tif cmd.Host != \"\" || cmd.NoTunnel {\n\t\textraArgs = append(extraArgs, \"--set-string\", \"env.DISABLE_LOFT_ROUTER=true\")\n\t}\n\tif cmd.Password != \"\" {\n\t\textraArgs = append(extraArgs, \"--set\", \"admin.password=\"+cmd.Password)\n\t}\n\tif cmd.Host != \"\" {\n\t\textraArgs = append(extraArgs, \"--set\", \"ingress.enabled=true\", \"--set\", \"ingress.host=\"+cmd.Host)\n\t\textraArgs = append(extraArgs, \"--set\", \"env.LOFT_HOST=\"+cmd.Host)\n\t\textraArgs = append(extraArgs, \"--set\", \"devpodIngress.enabled=true\", \"--set\", \"devpodIngress.host=*.\"+cmd.Host)\n\t\textraArgs = append(extraArgs, \"--set\", \"env.DEVPOD_SUBDOMAIN=*.\"+cmd.Host)\n\t}\n\tif cmd.Version != \"\" {\n\t\textraArgs = append(extraArgs, \"--version\", cmd.Version)\n\t}\n\tif cmd.Product != \"\" {\n\t\textraArgs = append(extraArgs, \"--set\", \"product=\"+cmd.Product)\n\t}\n\n\t// Do not use --reuse-values if --reset flag is provided because this should be a new install and it will cause issues with `helm template`\n\tif !cmd.Reset && cmd.ReuseValues {\n\t\textraArgs = append(extraArgs, \"--reuse-values\")\n\t}\n\n\tif cmd.Values != \"\" {\n\t\tabsValuesPath, err := filepath.Abs(cmd.Values)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\textraArgs = append(extraArgs, \"--values\", absValuesPath)\n\t}\n\n\tchartName := cmd.ChartPath\n\tchartRepo := \"\"\n\tif chartName == \"\" {\n\t\tchartName = cmd.ChartName\n\t\tchartRepo = cmd.ChartRepo\n\t}\n\n\terr := upgradeRelease(chartName, chartRepo, cmd.Context, cmd.Namespace, extraArgs, cmd.Log)\n\tif err != nil {\n\t\tif !cmd.Reset {\n\t\t\treturn errors.New(err.Error() + fmt.Sprintf(\"\\n\\nIf want to purge and reinstall DevPod Pro, run: %s\\n\", ansi.Color(\"devpod pro start --reset\", \"green+b\")))\n\t\t}\n\n\t\t// Try to purge Loft and retry install\n\t\tcmd.Log.Info(\"Trying to delete objects blocking current installation\")\n\n\t\tmanifests, err := getReleaseManifests(chartName, chartRepo, cmd.Context, cmd.Namespace, extraArgs, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tkubectlDelete := exec.Command(\"kubectl\", \"delete\", \"-f\", \"-\", \"--ignore-not-found=true\", \"--grace-period=0\", \"--force\")\n\n\t\tbuffer := bytes.Buffer{}\n\t\tbuffer.Write([]byte(manifests))\n\n\t\tkubectlDelete.Stdin = &buffer\n\t\tkubectlDelete.Stdout = os.Stdout\n\t\tkubectlDelete.Stderr = os.Stderr\n\n\t\t// Ignoring potential errors here\n\t\t_ = kubectlDelete.Run()\n\n\t\t// Retry Loft installation\n\t\terr = upgradeRelease(chartName, chartRepo, cmd.Context, cmd.Namespace, extraArgs, cmd.Log)\n\t\tif err != nil {\n\t\t\treturn errors.New(err.Error() + fmt.Sprintf(\"\\n\\nExisting installation failed. Reach out to get help:\\n- via Slack: %s (fastest option)\\n- via Online Chat: %s\\n- via Email: %s\\n\", ansi.Color(\"https://slack.loft.sh/\", \"green+b\"), ansi.Color(\"https://loft.sh/\", \"green+b\"), ansi.Color(\"support@loft.sh\", \"green+b\")))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) success(ctx context.Context) error {\n\tif cmd.NoWait {\n\t\treturn nil\n\t}\n\n\t// wait until deployment is ready\n\tloftPod, err := cmd.waitForDeployment(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if installed locally\n\tisLocal := isInstalledLocally(ctx, cmd.KubeClient, cmd.Namespace)\n\tif isLocal {\n\t\t// check if loft domain secret is there\n\t\tif !cmd.NoTunnel {\n\t\t\tloftRouterDomain, err := cmd.pingLoftRouter(ctx, loftPod)\n\t\t\tif err != nil {\n\t\t\t\tcmd.Log.Errorf(\"Error retrieving loft router domain: %v\", err)\n\t\t\t\tcmd.Log.Info(\"Fallback to use port-forwarding\")\n\t\t\t} else if loftRouterDomain != \"\" {\n\t\t\t\treturn cmd.successLoftRouter(loftRouterDomain)\n\t\t\t}\n\t\t}\n\n\t\treturn cmd.successLocal()\n\t}\n\n\t// get login link\n\tcmd.Log.Info(\"Checking Loft status...\")\n\thost, err := getIngressHost(ctx, cmd.KubeClient, cmd.Namespace)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if loft is reachable\n\treachable, err := isHostReachable(ctx, host)\n\tif !reachable || err != nil {\n\t\tconst (\n\t\t\tYesOption = \"Yes\"\n\t\t\tNoOption  = \"No, please re-run the DNS check\"\n\t\t)\n\n\t\tanswer, err := cmd.Log.Question(&survey.QuestionOptions{\n\t\t\tQuestion:     \"Unable to reach Loft at https://\" + host + \". Do you want to start port-forwarding instead?\",\n\t\t\tDefaultValue: YesOption,\n\t\t\tOptions: []string{\n\t\t\t\tYesOption,\n\t\t\t\tNoOption,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif answer == YesOption {\n\t\t\treturn cmd.successLocal()\n\t\t}\n\t}\n\n\treturn cmd.successRemote(ctx, host)\n}\n\nfunc (cmd *StartCmd) successRemote(ctx context.Context, host string) error {\n\tprintSuccess := func() {\n\t\turl := \"https://\" + host\n\n\t\tpassword := cmd.Password\n\t\tif password == \"\" {\n\t\t\tpassword = passwordChangedHint\n\t\t}\n\n\t\tcmd.Log.WriteString(logrus.InfoLevel, fmt.Sprintf(`\n\n\n##########################   LOGIN   ############################\n\nUsername: `+ansi.Color(\"admin\", \"green+b\")+`\nPassword: `+ansi.Color(password, \"green+b\")+`  # Change via UI or via: `+ansi.Color(\"devpod pro reset password\", \"green+b\")+`\n\nLogin via UI:  %s\nLogin via CLI: %s\n\n!!! You must accept the untrusted certificate in your browser !!!\n\nFollow this guide to add a valid certificate: %s\n\n#################################################################\n\nDevPod Pro was successfully installed and can now be reached at: %s\n\nThanks for using DevPod Pro!\n`,\n\t\t\tansi.Color(url, \"green+b\"),\n\t\t\tansi.Color(\"devpod pro login \"+url, \"green+b\"),\n\t\t\t\"https://loft.sh/docs/administration/ssl\",\n\t\t\turl))\n\t}\n\tready, err := isHostReachable(ctx, host)\n\tif err != nil {\n\t\treturn err\n\t} else if ready {\n\t\tprintSuccess()\n\t\treturn nil\n\t}\n\n\t// Print DNS Configuration\n\tcmd.Log.WriteString(logrus.InfoLevel, `\n\n###################################     DNS CONFIGURATION REQUIRED     ##################################\n\nCreate a DNS A-record for `+host+` with the EXTERNAL-IP of your nginx-ingress controller.\nTo find this EXTERNAL-IP, run the following command and look at the output:\n\n> kubectl get services -n ingress-nginx\n                                                     |---------------|\nNAME                       TYPE           CLUSTER-IP | EXTERNAL-IP   |  PORT(S)                      AGE\ningress-nginx-controller   LoadBalancer   10.0.0.244 | XX.XXX.XXX.XX |  80:30984/TCP,443:31758/TCP   19m\n                                                     |^^^^^^^^^^^^^^^|\n\nEXTERNAL-IP may be 'pending' for a while until your cloud provider has created a new load balancer.\n\n#########################################################################################################\n\nThe command will wait until DevPod Pro is reachable under the host.\n\n`)\n\n\tcmd.Log.Info(\"Waiting for you to configure DNS, so DevPod Pro can be reached on https://\" + host)\n\terr = wait.PollUntilContextTimeout(ctx, 5*time.Second, platform.Timeout(), true, func(ctx context.Context) (done bool, err error) {\n\t\treturn isHostReachable(ctx, host)\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcmd.Log.Done(\"DevPod Pro is reachable at https://\" + host)\n\n\tprintSuccess()\n\treturn nil\n}\nfunc (cmd *StartCmd) successLocal() error {\n\turl := \"https://localhost:\" + cmd.LocalPort\n\n\tif !cmd.NoLogin {\n\t\terr := cmd.login(url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tpassword := cmd.Password\n\tif password == \"\" {\n\t\tpassword = passwordChangedHint\n\t}\n\n\tcmd.Log.WriteString(logrus.InfoLevel, fmt.Sprintf(`\n\n##########################   LOGIN   ############################\n\nUsername: `+ansi.Color(\"admin\", \"green+b\")+`\nPassword: `+ansi.Color(password, \"green+b\")+`  # Change via UI or via: `+ansi.Color(\"devpod pro reset password\", \"green+b\")+`\n\nLogin via UI:  %s\nLogin via CLI: %s\n\n!!! You must accept the untrusted certificate in your browser !!!\n\n#################################################################\n\nDevPod Pro was successfully installed.\n\nThanks for using DevPod Pro!\n`, ansi.Color(url, \"green+b\"), ansi.Color(\"devpod pro login\"+\" --insecure \"+url, \"green+b\")))\n\tblockChan := make(chan bool)\n\t<-blockChan\n\treturn nil\n}\n\nfunc (cmd *StartCmd) startDocker(ctx context.Context) error {\n\tcmd.Log.Infof(\"Starting DevPod Pro in Docker...\")\n\tname := \"devpod-pro\"\n\n\t// prepare installation\n\terr := cmd.prepareDocker()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// try to find loft container\n\tcontainerID, err := cmd.findLoftContainer(ctx, name, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if container is there\n\tif containerID != \"\" && (cmd.Reset || cmd.Upgrade) {\n\t\tcmd.Log.Info(\"Existing instance found.\")\n\t\terr = cmd.uninstallDocker(ctx, containerID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcontainerID = \"\"\n\t}\n\n\t// Use default password if none is set\n\tif cmd.Password == \"\" {\n\t\tcmd.Password = getMachineUID(cmd.Log)\n\t}\n\n\t// check if is installed\n\tif containerID != \"\" {\n\t\tcmd.Log.Info(\"Existing instance found. Run with --upgrade to apply new configuration\")\n\t\treturn cmd.successDocker(ctx, containerID)\n\t}\n\n\t// Install Loft\n\tcmd.Log.Info(\"Welcome to DevPod Pro!\")\n\tcmd.Log.Info(\"This installer will help you get started.\")\n\n\t// make sure we are ready for installing\n\tcontainerID, err = cmd.runInDocker(ctx, name)\n\tif err != nil {\n\t\treturn err\n\t} else if containerID == \"\" {\n\t\treturn fmt.Errorf(\"%w: %s\", ErrMissingContainer, \"couldn't find Loft container after starting it\")\n\t}\n\n\treturn cmd.successDocker(ctx, containerID)\n}\n\nfunc (cmd *StartCmd) successDocker(ctx context.Context, containerID string) error {\n\tif cmd.NoWait {\n\t\treturn nil\n\t}\n\n\t// wait until Loft is ready\n\thost, err := cmd.waitForLoftDocker(ctx, containerID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait for domain to become reachable\n\tcmd.Log.Infof(\"Wait for DevPod Pro to become available at %s...\", host)\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, time.Minute*10, true, func(ctx context.Context) (bool, error) {\n\t\tcontainerDetails, err := cmd.inspectContainer(ctx, containerID)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"inspect loft container: %w\", err)\n\t\t} else if strings.ToLower(containerDetails.State.Status) == \"exited\" || strings.ToLower(containerDetails.State.Status) == \"dead\" {\n\t\t\tlogs, _ := cmd.logsContainer(ctx, containerID)\n\t\t\treturn false, fmt.Errorf(\"container failed (status: %s):\\n %s\", containerDetails.State.Status, logs)\n\t\t}\n\n\t\treturn isHostReachable(ctx, host)\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error waiting for DevPod Pro: %w\", err)\n\t}\n\n\t// print success message\n\tPrintSuccessMessageDockerInstall(host, cmd.Password, cmd.Log)\n\treturn nil\n}\n\nfunc PrintSuccessMessageDockerInstall(host, password string, log log.Logger) {\n\turl := \"https://\" + host\n\tlog.WriteString(logrus.InfoLevel, fmt.Sprintf(`\n\n\n##########################   LOGIN   ############################\n\nUsername: `+ansi.Color(\"admin\", \"green+b\")+`\nPassword: `+ansi.Color(password, \"green+b\")+`\n\nLogin via UI:  %s\nLogin via CLI: %s\n\n#################################################################\n\nDevPod Pro was successfully installed and can now be reached at: %s\n\nThanks for using DevPod Pro!\n`,\n\t\tansi.Color(url, \"green+b\"),\n\t\tansi.Color(\"devpod pro login\"+\" \"+url, \"green+b\"),\n\t\turl,\n\t))\n}\n\nfunc (cmd *StartCmd) waitForLoftDocker(ctx context.Context, containerID string) (string, error) {\n\tcmd.Log.Info(\"Wait for DevPod Pro to become available...\")\n\n\t// check for local port\n\tcontainerDetails, err := cmd.inspectContainer(ctx, containerID)\n\tif err != nil {\n\t\treturn \"\", err\n\t} else if len(containerDetails.NetworkSettings.Ports) > 0 && len(containerDetails.NetworkSettings.Ports[\"10443/tcp\"]) > 0 {\n\t\treturn \"localhost:\" + containerDetails.NetworkSettings.Ports[\"10443/tcp\"][0].HostPort, nil\n\t}\n\n\t// check if no tunnel\n\tif cmd.NoTunnel {\n\t\treturn \"\", fmt.Errorf(\"%w: %s\", ErrLoftNotReachable, \"cannot connect to DevPod Pro as it has no exposed port and --no-tunnel is enabled\")\n\t}\n\n\t// wait for router\n\turl := \"\"\n\twaitErr := wait.PollUntilContextTimeout(ctx, time.Second, time.Minute*10, true, func(ctx context.Context) (bool, error) {\n\t\turl, err = cmd.findLoftRouter(ctx, containerID)\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\treturn true, nil\n\t})\n\tif waitErr != nil {\n\t\treturn \"\", fmt.Errorf(\"error waiting for loft router domain: %w\", err)\n\t}\n\n\treturn url, nil\n}\n\nfunc (cmd *StartCmd) findLoftRouter(ctx context.Context, id string) (string, error) {\n\tout, err := cmd.buildDockerCmd(ctx, \"exec\", id, \"cat\", \"/var/lib/loft/loft-domain.txt\").Output()\n\tif err != nil {\n\t\treturn \"\", WrapCommandError(out, err)\n\t}\n\n\treturn strings.TrimSpace(string(out)), nil\n}\n\nfunc (cmd *StartCmd) prepareDocker() error {\n\t// test for helm and kubectl\n\t_, err := exec.LookPath(\"docker\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like docker is not installed. Docker is required for the installation of loft. Please visit https://docs.docker.com/engine/install/ for install instructions\")\n\t}\n\n\toutput, err := exec.Command(\"docker\", \"ps\").CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like there are issues with your docker cli: \\n\\n%s\", output)\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) uninstallDocker(ctx context.Context, id string) error {\n\tcmd.Log.Infof(\"Uninstalling...\")\n\n\t// stop container\n\tout, err := cmd.buildDockerCmd(ctx, \"stop\", id).Output()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"stop container: %w\", WrapCommandError(out, err))\n\t}\n\n\t// remove container\n\tout, err = cmd.buildDockerCmd(ctx, \"rm\", id).Output()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"remove container: %w\", WrapCommandError(out, err))\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) runInDocker(ctx context.Context, name string) (string, error) {\n\targs := []string{\"run\", \"-d\", \"--name\", name}\n\tif cmd.NoTunnel {\n\t\targs = append(args, \"--env\", \"DISABLE_LOFT_ROUTER=true\")\n\t}\n\tif cmd.Password != \"\" {\n\t\targs = append(args, \"--env\", \"ADMIN_PASSWORD_HASH=\"+hash.String(cmd.Password))\n\t}\n\n\t// run as root otherwise we get permission errors\n\targs = append(args, \"-u\", \"root\")\n\n\t// mount the loft lib\n\targs = append(args, \"-v\", \"loft-data:/var/lib/loft\")\n\n\t// set port\n\tif cmd.LocalPort != \"\" {\n\t\targs = append(args, \"-p\", cmd.LocalPort+\":10443\")\n\t}\n\n\t// set extra args\n\targs = append(args, cmd.DockerArgs...)\n\n\t// set image\n\tif cmd.DockerImage != \"\" {\n\t\targs = append(args, cmd.DockerImage)\n\t} else if cmd.Version != \"\" {\n\t\targs = append(args, \"ghcr.io/loft-sh/devpod-pro:\"+strings.TrimPrefix(cmd.Version, \"v\"))\n\t} else {\n\t\targs = append(args, \"ghcr.io/loft-sh/devpod-pro:latest\")\n\t}\n\n\tcmd.Log.Infof(\"Start DevPod Pro via 'docker %s'\", strings.Join(args, \" \"))\n\trunCmd := cmd.buildDockerCmd(ctx, args...)\n\trunCmd.Stdout = os.Stdout\n\trunCmd.Stderr = os.Stderr\n\terr := runCmd.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn cmd.findLoftContainer(ctx, name, false)\n}\n\nfunc (cmd *StartCmd) logsContainer(ctx context.Context, id string) (string, error) {\n\targs := []string{\"logs\", id}\n\tout, err := cmd.buildDockerCmd(ctx, args...).CombinedOutput()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"logs container: %w\", WrapCommandError(out, err))\n\t}\n\n\treturn string(out), nil\n}\n\nfunc (cmd *StartCmd) inspectContainer(ctx context.Context, id string) (*ContainerDetails, error) {\n\targs := []string{\"inspect\", \"--type\", \"container\", id}\n\tout, err := cmd.buildDockerCmd(ctx, args...).Output()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"inspect container: %w\", WrapCommandError(out, err))\n\t}\n\n\tcontainerDetails := []*ContainerDetails{}\n\terr = json.Unmarshal(out, &containerDetails)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse inspect output: %w\", err)\n\t} else if len(containerDetails) == 0 {\n\t\treturn nil, fmt.Errorf(\"coudln't find container %s\", id)\n\t}\n\n\treturn containerDetails[0], nil\n}\n\nfunc (cmd *StartCmd) removeContainer(ctx context.Context, id string) error {\n\targs := []string{\"rm\", id}\n\tout, err := cmd.buildDockerCmd(ctx, args...).Output()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"remove container: %w\", WrapCommandError(out, err))\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) findLoftContainer(ctx context.Context, name string, onlyRunning bool) (string, error) {\n\targs := []string{\"ps\", \"-q\", \"-a\", \"-f\", \"name=^\" + name + \"$\"}\n\tout, err := cmd.buildDockerCmd(ctx, args...).Output()\n\tif err != nil {\n\t\t// fallback to manual search\n\t\treturn \"\", fmt.Errorf(\"error finding container: %w\", WrapCommandError(out, err))\n\t}\n\n\tarr := []string{}\n\tscan := scanner.NewScanner(bytes.NewReader(out))\n\tfor scan.Scan() {\n\t\tarr = append(arr, strings.TrimSpace(scan.Text()))\n\t}\n\tif len(arr) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\t// remove the failed / exited containers\n\trunningContainerID := \"\"\n\tfor _, containerID := range arr {\n\t\tcontainerState, err := cmd.inspectContainer(ctx, containerID)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t} else if onlyRunning && strings.ToLower(containerState.State.Status) != \"running\" {\n\t\t\terr = cmd.removeContainer(ctx, containerID)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t} else {\n\t\t\trunningContainerID = containerID\n\t\t}\n\t}\n\n\treturn runningContainerID, nil\n}\n\nfunc (cmd *StartCmd) buildDockerCmd(ctx context.Context, args ...string) *exec.Cmd {\n\treturn exec.CommandContext(ctx, \"docker\", args...)\n}\n\nfunc (cmd *StartCmd) prepareInstall(ctx context.Context) error {\n\t// delete admin user & secret\n\treturn uninstall(ctx, cmd.KubeClient, cmd.RestConfig, cmd.Context, cmd.Namespace, log.Discard)\n}\n\nfunc (cmd *StartCmd) prepare() error {\n\tloader, err := client.NewClientFromPath(cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\tloftConfig := loader.Config()\n\n\t// first load the kube config\n\tkubeClientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{})\n\n\t// load the raw config\n\tkubeConfig, err := kubeClientConfig.RawConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"there is an error loading your current kube config (%w), please make sure you have access to a kubernetes cluster and the command `kubectl get namespaces` is working\", err)\n\t}\n\n\t// we switch the context to the install config\n\tcontextToLoad := kubeConfig.CurrentContext\n\tif cmd.Context != \"\" {\n\t\tcontextToLoad = cmd.Context\n\t} else if loftConfig.LastInstallContext != \"\" && loftConfig.LastInstallContext != contextToLoad {\n\t\tcontextToLoad, err = cmd.Log.Question(&survey.QuestionOptions{\n\t\t\tQuestion:     \"Seems like you try to use 'devpod pro start' with a different kubernetes context than before. Please choose which kubernetes context you want to use\",\n\t\t\tDefaultValue: contextToLoad,\n\t\t\tOptions:      []string{contextToLoad, loftConfig.LastInstallContext},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tcmd.Context = contextToLoad\n\n\tloftConfig.LastInstallContext = contextToLoad\n\t_ = loader.Save()\n\n\t// kube client config\n\tkubeClientConfig = clientcmd.NewNonInteractiveClientConfig(kubeConfig, contextToLoad, &clientcmd.ConfigOverrides{}, clientcmd.NewDefaultClientConfigLoadingRules())\n\n\t// test for helm and kubectl\n\t_, err = exec.LookPath(\"helm\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like helm is not installed. Helm is required for the installation of loft. Please visit https://helm.sh/docs/intro/install/ for install instructions\")\n\t}\n\n\toutput, err := exec.Command(\"helm\", \"version\").CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like there are issues with your helm client: \\n\\n%s\", output)\n\t}\n\n\t_, err = exec.LookPath(\"kubectl\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like kubectl is not installed. Kubectl is required for the installation of loft. Please visit https://kubernetes.io/docs/tasks/tools/install-kubectl/ for install instructions\")\n\t}\n\n\toutput, err = exec.Command(\"kubectl\", \"version\", \"--context\", contextToLoad).CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"seems like kubectl cannot connect to your Kubernetes cluster: \\n\\n%s\", output)\n\t}\n\n\tcmd.RestConfig, err = kubeClientConfig.ClientConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"there is an error loading your current kube config (%w), please make sure you have access to a kubernetes cluster and the command `kubectl get namespaces` is working\", err)\n\t}\n\tcmd.KubeClient, err = kubernetes.NewForConfig(cmd.RestConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"there is an error loading your current kube config (%w), please make sure you have access to a kubernetes cluster and the command `kubectl get namespaces` is working\", err)\n\t}\n\n\t// Check if cluster has RBAC correctly configured\n\t_, err = cmd.KubeClient.RbacV1().ClusterRoles().Get(context.Background(), \"cluster-admin\", metav1.GetOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error retrieving cluster role 'cluster-admin': %w. Please make sure RBAC is correctly configured in your cluster\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) handleAlreadyExistingInstallation(ctx context.Context) error {\n\tenableIngress := false\n\n\t// Only ask if ingress should be enabled if --upgrade flag is not provided\n\tif !cmd.Upgrade && term.IsTerminal(os.Stdin) {\n\t\tcmd.Log.Info(\"Existing instance found.\")\n\n\t\t// Check if Loft is installed in a local cluster\n\t\tisLocal := isInstalledLocally(ctx, cmd.KubeClient, cmd.Namespace)\n\n\t\t// Skip question if --host flag is provided\n\t\tif cmd.Host != \"\" {\n\t\t\tenableIngress = true\n\t\t}\n\n\t\tif enableIngress {\n\t\t\tif isLocal {\n\t\t\t\t// Confirm with user if this is a local cluster\n\t\t\t\tconst (\n\t\t\t\t\tYesOption = \"Yes\"\n\t\t\t\t\tNoOption  = \"No, my cluster is running not locally (GKE, EKS, Bare Metal, etc.)\"\n\t\t\t\t)\n\n\t\t\t\tanswer, err := cmd.Log.Question(&survey.QuestionOptions{\n\t\t\t\t\tQuestion:     \"Seems like your cluster is running locally (docker desktop, minikube, kind etc.). Is that correct?\",\n\t\t\t\t\tDefaultValue: YesOption,\n\t\t\t\t\tOptions: []string{\n\t\t\t\t\t\tYesOption,\n\t\t\t\t\t\tNoOption,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tisLocal = answer == YesOption\n\t\t\t}\n\n\t\t\tif isLocal {\n\t\t\t\t// Confirm with user if ingress should be installed in local cluster\n\t\t\t\tvar (\n\t\t\t\t\tYesOption = \"Yes, enable the ingress anyway\"\n\t\t\t\t\tNoOption  = \"No\"\n\t\t\t\t)\n\n\t\t\t\tanswer, err := cmd.Log.Question(&survey.QuestionOptions{\n\t\t\t\t\tQuestion:     \"Enabling ingress is usually only useful for remote clusters. Do you still want to deploy the ingress to your local cluster?\",\n\t\t\t\t\tDefaultValue: NoOption,\n\t\t\t\t\tOptions: []string{\n\t\t\t\t\t\tNoOption,\n\t\t\t\t\t\tYesOption,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tenableIngress = answer == YesOption\n\t\t\t}\n\t\t}\n\n\t\t// Check if we need to enable ingress\n\t\tif enableIngress {\n\t\t\t// Ask for hostname if --host flag is not provided\n\t\t\tif cmd.Host == \"\" {\n\t\t\t\thost, err := enterHostNameQuestion(cmd.Log)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tcmd.Host = host\n\t\t\t} else {\n\t\t\t\tcmd.Log.Info(\"Will enable an ingress with hostname: \" + cmd.Host)\n\t\t\t}\n\n\t\t\tif term.IsTerminal(os.Stdin) {\n\t\t\t\terr := ensureIngressController(ctx, cmd.KubeClient, cmd.Context, cmd.Log)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"install ingress controller\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Only upgrade if --upgrade flag is present or user decided to enable ingress\n\tif cmd.Upgrade || enableIngress {\n\t\terr := cmd.upgrade()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn cmd.success(ctx)\n}\n\nfunc (cmd *StartCmd) waitForDeployment(ctx context.Context) (*corev1.Pod, error) {\n\t// wait for loft pod to start\n\tcmd.Log.Info(\"Waiting for DevPod Pro pod to be running...\")\n\tloftPod, err := platform.WaitForPodReady(ctx, cmd.KubeClient, cmd.Namespace, cmd.Log)\n\tcmd.Log.Donef(\"Release Pod successfully started\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// ensure user admin secret is there\n\tisNewPassword, err := ensureAdminPassword(ctx, cmd.KubeClient, cmd.RestConfig, cmd.Password, cmd.Log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If password is different than expected\n\tif isNewPassword {\n\t\tcmd.Password = \"\"\n\t}\n\n\treturn loftPod, nil\n}\n\nfunc (cmd *StartCmd) pingLoftRouter(ctx context.Context, loftPod *corev1.Pod) (string, error) {\n\tloftRouterSecret, err := cmd.KubeClient.CoreV1().Secrets(loftPod.Namespace).Get(ctx, LoftRouterDomainSecret, metav1.GetOptions{})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn \"\", nil\n\t\t}\n\n\t\treturn \"\", fmt.Errorf(\"find loft router domain secret: %w\", err)\n\t} else if loftRouterSecret.Data == nil || len(loftRouterSecret.Data[\"domain\"]) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\t// get the domain from secret\n\tloftRouterDomain := string(loftRouterSecret.Data[\"domain\"])\n\n\t// wait until loft is reachable at the given url\n\thttpClient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tTLSClientConfig: &tls.Config{\n\t\t\t\tInsecureSkipVerify: true,\n\t\t\t},\n\t\t},\n\t}\n\tcmd.Log.Infof(\"Waiting until DevPod Pro is reachable at https://%s\", loftRouterDomain)\n\terr = wait.PollUntilContextTimeout(ctx, time.Second*3, time.Minute*5, true, func(ctx context.Context) (bool, error) {\n\t\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, \"https://\"+loftRouterDomain+\"/version\", nil)\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\tresp, err := httpClient.Do(req)\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\treturn resp.StatusCode == http.StatusOK, nil\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn loftRouterDomain, nil\n}\n\nfunc (cmd *StartCmd) successLoftRouter(url string) error {\n\tif !cmd.NoLogin {\n\t\terr := cmd.login(url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\turl = \"https://\" + url\n\n\tpassword := cmd.Password\n\tif password == \"\" {\n\t\tpassword = passwordChangedHint\n\t}\n\n\tcmd.Log.WriteString(logrus.InfoLevel, fmt.Sprintf(`\n\n\n##########################   LOGIN   ############################\n\nUsername: `+ansi.Color(\"admin\", \"green+b\")+`\nPassword: `+ansi.Color(password, \"green+b\")+`  # Change via UI or via: `+ansi.Color(\"devpod pro reset password\", \"green+b\")+`\n\nLogin via UI:  %s\nLogin via CLI: %s\n\n#################################################################\n\nDevPod Pro was successfully installed and can now be reached at: %s\n\nThanks for using DevPod Pro!\n`,\n\t\tansi.Color(url, \"green+b\"),\n\t\tansi.Color(\"devpod pro login\"+\" \"+url, \"green+b\"),\n\t\turl,\n\t))\n\treturn nil\n}\n\nfunc (cmd *StartCmd) login(url string) error {\n\tif !strings.HasPrefix(url, \"https://\") {\n\t\turl = \"https://\" + url\n\t}\n\n\t// check if we are already logged in\n\tif cmd.isLoggedIn(url) {\n\t\t// still open the UI\n\t\terr := open.Run(url)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't open the login page in a browser: %w\", err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// log into the CLI\n\terr := cmd.loginViaCLI(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// log into the UI\n\terr = cmd.loginUI(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) loginViaCLI(url string) error {\n\tloginPath := \"%s/auth/password/login\"\n\n\tloginRequest := auth.PasswordLoginRequest{\n\t\tUsername: defaultUser,\n\t\tPassword: cmd.Password,\n\t}\n\tloginRequestBytes, err := json.Marshal(loginRequest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tloginRequestBuf := bytes.NewBuffer(loginRequestBytes)\n\ttr := &http.Transport{\n\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t}\n\thttpClient := &http.Client{Transport: tr}\n\n\tresp, err := httpClient.Post(fmt.Sprintf(loginPath, url), \"application/json\", loginRequestBuf)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\taccessKey := &auth.AccessKey{}\n\terr = json.Unmarshal(body, accessKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// log into loft\n\tloader, err := client.NewClientFromPath(cmd.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\turl = strings.TrimSuffix(url, \"/\")\n\terr = loader.LoginWithAccessKey(url, accessKey.AccessKey, true, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcmd.Log.WriteString(logrus.InfoLevel, \"\\n\")\n\tcmd.Log.Donef(\"Successfully logged in via CLI into %s\", ansi.Color(url, \"white+b\"))\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) loginUI(url string) error {\n\tqueryString := fmt.Sprintf(\"username=%s&password=%s\", defaultUser, netUrl.QueryEscape(cmd.Password))\n\tloginURL := fmt.Sprintf(\"%s/login#%s\", url, queryString)\n\n\terr := open.Run(loginURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't open the login page in a browser: %w\", err)\n\t}\n\n\tcmd.Log.Infof(\"If the browser does not open automatically, please navigate to %s\", loginURL)\n\n\treturn nil\n}\n\nfunc (cmd *StartCmd) isLoggedIn(url string) bool {\n\turl = strings.TrimPrefix(url, \"https://\")\n\n\tc, err := client.NewClientFromPath(cmd.Config)\n\treturn err == nil && strings.TrimPrefix(strings.TrimSuffix(c.Config().Host, \"/\"), \"https://\") == strings.TrimSuffix(url, \"/\")\n}\n\nfunc uninstall(ctx context.Context, kubeClient kubernetes.Interface, restConfig *rest.Config, kubeContext, namespace string, log log.Logger) error {\n\treleaseName := \"devpod-pro\"\n\tdeploy, err := kubeClient.AppsV1().Deployments(namespace).Get(ctx, defaultDeploymentName, metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t} else if deploy != nil && deploy.Labels != nil && deploy.Labels[\"release\"] != \"\" {\n\t\treleaseName = deploy.Labels[\"release\"]\n\t}\n\n\targs := []string{\n\t\t\"uninstall\",\n\t\treleaseName,\n\t\t\"--kube-context\",\n\t\tkubeContext,\n\t\t\"--namespace\",\n\t\tnamespace,\n\t}\n\tlog.Infof(\"Executing command: helm %s\", strings.Join(args, \" \"))\n\toutput, err := exec.Command(\"helm\", args...).CombinedOutput()\n\tif err != nil {\n\t\tlog.Errorf(\"error during helm command: %s (%v)\", string(output), err)\n\t}\n\n\t// we also cleanup the validating webhook configuration and apiservice\n\tapiRegistrationClient, err := clientset.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = apiRegistrationClient.ApiregistrationV1().APIServices().Delete(ctx, \"v1.management.loft.sh\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = deleteUser(ctx, restConfig, \"admin\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = kubeClient.CoreV1().Secrets(namespace).Delete(context.Background(), \"loft-user-secret-admin\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = kubeClient.CoreV1().Secrets(namespace).Delete(context.Background(), LoftRouterDomainSecret, metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\t// we also cleanup the validating webhook configuration and apiservice\n\terr = kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(ctx, \"loft-agent\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = apiRegistrationClient.ApiregistrationV1().APIServices().Delete(ctx, \"v1alpha1.tenancy.kiosk.sh\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = apiRegistrationClient.ApiregistrationV1().APIServices().Delete(ctx, \"v1.cluster.loft.sh\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = kubeClient.CoreV1().ConfigMaps(namespace).Delete(ctx, \"loft-agent-controller\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\terr = kubeClient.CoreV1().ConfigMaps(namespace).Delete(ctx, \"loft-applied-defaults\", metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tlog.WriteString(logrus.InfoLevel, \"\\n\")\n\tlog.Done(\"Successfully uninstalled DevPod Pro\")\n\tlog.WriteString(logrus.InfoLevel, \"\\n\")\n\n\treturn nil\n}\n\nfunc isAlreadyInstalled(ctx context.Context, kubeClient kubernetes.Interface, namespace string) (bool, error) {\n\t_, err := kubeClient.AppsV1().Deployments(namespace).Get(ctx, defaultDeploymentName, metav1.GetOptions{})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn false, nil\n\t\t}\n\n\t\treturn false, fmt.Errorf(\"error accessing kubernetes cluster: %w\", err)\n\t}\n\n\treturn true, nil\n}\n\nfunc getDefaultPassword(ctx context.Context, kubeClient kubernetes.Interface, namespace string) (string, error) {\n\tloftNamespace, err := kubeClient.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\tloftNamespace, err := kubeClient.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: namespace,\n\t\t\t\t},\n\t\t\t}, metav1.CreateOptions{})\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\n\t\t\treturn string(loftNamespace.UID), nil\n\t\t}\n\n\t\treturn \"\", err\n\t}\n\n\treturn string(loftNamespace.UID), nil\n}\n\nfunc isInstalledLocally(ctx context.Context, kubeClient kubernetes.Interface, namespace string) bool {\n\t_, err := kubeClient.NetworkingV1().Ingresses(namespace).Get(ctx, \"loft-ingress\", metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\t_, err = kubeClient.NetworkingV1beta1().Ingresses(namespace).Get(ctx, \"loft-ingress\", metav1.GetOptions{})\n\t\treturn kerrors.IsNotFound(err)\n\t}\n\n\treturn kerrors.IsNotFound(err)\n}\n\nfunc enterHostNameQuestion(log log.Logger) (string, error) {\n\treturn log.Question(&survey.QuestionOptions{\n\t\tQuestion: fmt.Sprintf(\"Enter a hostname for your %s instance (e.g. loft.my-domain.tld): \\n \", \"DevPod Pro\"),\n\t\tValidationFunc: func(answer string) error {\n\t\t\tu, err := netUrl.Parse(\"https://\" + answer)\n\t\t\tif err != nil || u.Path != \"\" || u.Port() != \"\" || len(strings.Split(answer, \".\")) < 2 {\n\t\t\t\treturn fmt.Errorf(\"please enter a valid hostname without protocol (https://), without path and without port, e.g. loft.my-domain.tld\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t})\n}\n\nfunc ensureIngressController(ctx context.Context, kubeClient kubernetes.Interface, kubeContext string, log log.Logger) error {\n\t// first create an ingress controller\n\tconst (\n\t\tYesOption = \"Yes\"\n\t\tNoOption  = \"No, I already have an ingress controller installed.\"\n\t)\n\n\tanswer, err := log.Question(&survey.QuestionOptions{\n\t\tQuestion:     \"Ingress controller required. Should the nginx-ingress controller be installed?\",\n\t\tDefaultValue: YesOption,\n\t\tOptions: []string{\n\t\t\tYesOption,\n\t\t\tNoOption,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif answer == YesOption {\n\t\targs := []string{\n\t\t\t\"install\",\n\t\t\t\"ingress-nginx\",\n\t\t\t\"ingress-nginx\",\n\t\t\t\"--repository-config=''\",\n\t\t\t\"--repo\",\n\t\t\t\"https://kubernetes.github.io/ingress-nginx\",\n\t\t\t\"--kube-context\",\n\t\t\tkubeContext,\n\t\t\t\"--namespace\",\n\t\t\t\"ingress-nginx\",\n\t\t\t\"--create-namespace\",\n\t\t\t\"--set-string\",\n\t\t\t\"controller.config.hsts=false\",\n\t\t\t\"--wait\",\n\t\t}\n\t\tlog.WriteString(logrus.InfoLevel, \"\\n\")\n\t\tlog.Infof(\"Executing command: helm %s\\n\", strings.Join(args, \" \"))\n\t\tlog.Info(\"Waiting for ingress controller deployment, this can take several minutes...\")\n\t\thelmCmd := exec.Command(\"helm\", args...)\n\t\toutput, err := helmCmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error during helm command: %s (%w)\", string(output), err)\n\t\t}\n\n\t\tlist, err := kubeClient.CoreV1().Secrets(\"ingress-nginx\").List(ctx, metav1.ListOptions{\n\t\t\tLabelSelector: \"name=ingress-nginx,owner=helm,status=deployed\",\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(list.Items) == 1 {\n\t\t\tsecret := list.Items[0]\n\t\t\toriginalSecret := secret.DeepCopy()\n\t\t\tsecret.Labels[\"loft.sh/app\"] = \"true\"\n\t\t\tif secret.Annotations == nil {\n\t\t\t\tsecret.Annotations = map[string]string{}\n\t\t\t}\n\n\t\t\tsecret.Annotations[\"loft.sh/url\"] = \"https://kubernetes.github.io/ingress-nginx\"\n\t\t\toriginalJSON, err := json.Marshal(originalSecret)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmodifiedJSON, err := json.Marshal(secret)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdata, err := jsonpatch.CreateMergePatch(originalJSON, modifiedJSON)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t_, err = kubeClient.CoreV1().Secrets(secret.Namespace).Patch(ctx, secret.Name, types.MergePatchType, data, metav1.PatchOptions{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tlog.Done(\"Successfully installed ingress-nginx to your kubernetes cluster!\")\n\t}\n\n\treturn nil\n}\n\nfunc deleteUser(ctx context.Context, restConfig *rest.Config, name string) error {\n\tloftClient, err := loftclientset.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuser, err := loftClient.StorageV1().Users().Get(ctx, name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil\n\t} else if len(user.Finalizers) > 0 {\n\t\tuser.Finalizers = nil\n\t\t_, err = loftClient.StorageV1().Users().Update(ctx, user, metav1.UpdateOptions{})\n\t\tif err != nil {\n\t\t\tif kerrors.IsConflict(err) {\n\t\t\t\treturn deleteUser(ctx, restConfig, name)\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\t}\n\n\terr = loftClient.StorageV1().Users().Delete(ctx, name, metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc ensureAdminPassword(ctx context.Context, kubeClient kubernetes.Interface, restConfig *rest.Config, password string, log log.Logger) (bool, error) {\n\tloftClient, err := loftclientset.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tadmin, err := loftClient.StorageV1().Users().Get(ctx, \"admin\", metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn false, err\n\t} else if admin == nil {\n\t\tadmin, err = loftClient.StorageV1().Users().Create(ctx, &storagev1.User{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: \"admin\",\n\t\t\t},\n\t\t\tSpec: storagev1.UserSpec{\n\t\t\t\tUsername: \"admin\",\n\t\t\t\tEmail:    \"test@domain.tld\",\n\t\t\t\tSubject:  \"admin\",\n\t\t\t\tGroups:   []string{\"system:masters\"},\n\t\t\t\tPasswordRef: &storagev1.SecretRef{\n\t\t\t\t\tSecretName:      \"loft-user-secret-admin\",\n\t\t\t\t\tSecretNamespace: \"loft\",\n\t\t\t\t\tKey:             \"password\",\n\t\t\t\t},\n\t\t\t},\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t} else if admin.Spec.PasswordRef == nil || admin.Spec.PasswordRef.SecretName == \"\" || admin.Spec.PasswordRef.SecretNamespace == \"\" {\n\t\treturn false, nil\n\t}\n\n\tkey := admin.Spec.PasswordRef.Key\n\tif key == \"\" {\n\t\tkey = \"password\"\n\t}\n\n\tpasswordHash := fmt.Sprintf(\"%x\", sha256.Sum256([]byte(password)))\n\n\tsecret, err := kubeClient.CoreV1().Secrets(admin.Spec.PasswordRef.SecretNamespace).Get(ctx, admin.Spec.PasswordRef.SecretName, metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn false, err\n\t} else if err == nil {\n\t\texistingPasswordHash, keyExists := secret.Data[key]\n\t\tif keyExists {\n\t\t\treturn (string(existingPasswordHash) != passwordHash), nil\n\t\t}\n\n\t\tsecret.Data[key] = []byte(passwordHash)\n\t\t_, err = kubeClient.CoreV1().Secrets(secret.Namespace).Update(ctx, secret, metav1.UpdateOptions{})\n\t\tif err != nil {\n\t\t\treturn false, errors.Wrap(err, \"update admin password secret\")\n\t\t}\n\t\treturn false, nil\n\t}\n\n\t// create the password secret if it was not found, this can happen if you delete the loft namespace without deleting the admin user\n\tsecret = &corev1.Secret{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName:      admin.Spec.PasswordRef.SecretName,\n\t\t\tNamespace: admin.Spec.PasswordRef.SecretNamespace,\n\t\t},\n\t\tData: map[string][]byte{\n\t\t\tkey: []byte(passwordHash),\n\t\t},\n\t}\n\t_, err = kubeClient.CoreV1().Secrets(secret.Namespace).Create(ctx, secret, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"create admin password secret\")\n\t}\n\n\tlog.Info(\"Successfully recreated admin password secret\")\n\treturn false, nil\n}\n\nfunc getIngressHost(ctx context.Context, kubeClient kubernetes.Interface, namespace string) (string, error) {\n\tingress, err := kubeClient.NetworkingV1().Ingresses(namespace).Get(ctx, \"loft-ingress\", metav1.GetOptions{})\n\tif err != nil {\n\t\tingress, err := kubeClient.NetworkingV1beta1().Ingresses(namespace).Get(ctx, \"loft-ingress\", metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t} else {\n\t\t\t// find host\n\t\t\tfor _, rule := range ingress.Spec.Rules {\n\t\t\t\treturn rule.Host, nil\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// find host\n\t\tfor _, rule := range ingress.Spec.Rules {\n\t\t\treturn rule.Host, nil\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"couldn't find any host in loft ingress '%s/loft-ingress', please make sure you have not changed any deployed resources\", namespace)\n}\n\ntype version struct {\n\tVersion string `json:\"version\"`\n}\n\nfunc isHostReachable(ctx context.Context, host string) (bool, error) {\n\ttransport := http.DefaultTransport.(*http.Transport).Clone()\n\t// we disable http2 as Kubernetes has problems with this\n\ttransport.ForceAttemptHTTP2 = false\n\ttransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}\n\t// wait until loft is reachable at the given url\n\tclient := &http.Client{Transport: transport}\n\turl := \"https://\" + host + \"/version\"\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"error creating request with context: %w\", err)\n\t}\n\tresp, err := client.Do(req)\n\tif err == nil && resp.StatusCode == http.StatusOK {\n\t\tout, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\tv := &version{}\n\t\terr = json.Unmarshal(out, v)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error decoding response from %s: %w. Try running '%s --reset'\", url, err, \"devpod pro start\")\n\t\t} else if v.Version == \"\" {\n\t\t\treturn false, fmt.Errorf(\"unexpected response from %s: %s. Try running '%s --reset'\", url, string(out), \"devpod pro start\")\n\t\t}\n\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}\n\nfunc upgradeRelease(chartName, chartRepo, kubeContext, namespace string, extraArgs []string, log log.Logger) error {\n\t// now we install loft\n\targs := []string{\n\t\t\"upgrade\",\n\t\tdefaultReleaseName,\n\t\tchartName,\n\t\t\"--install\",\n\t\t\"--create-namespace\",\n\t\t\"--repository-config=''\",\n\t\t\"--kube-context\",\n\t\tkubeContext,\n\t\t\"--namespace\",\n\t\tnamespace,\n\t}\n\tif chartRepo != \"\" {\n\t\targs = append(args, \"--repo\", chartRepo)\n\t}\n\targs = append(args, extraArgs...)\n\n\tlog.WriteString(logrus.InfoLevel, \"\\n\")\n\tlog.Infof(\"Executing command: helm %s\\n\", strings.Join(args, \" \"))\n\tlog.Info(\"Waiting for helm command, this can take up to several minutes...\")\n\thelmCmd := exec.Command(\"helm\", args...)\n\tif chartRepo != \"\" {\n\t\thelmWorkDir, err := getHelmWorkdir(chartName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\thelmCmd.Dir = helmWorkDir\n\t}\n\toutput, err := helmCmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error during helm command: %s (%w)\", string(output), err)\n\t}\n\n\tlog.Donef(\"DevPod Pro has been deployed to your cluster!\")\n\treturn nil\n}\n\nfunc getReleaseManifests(chartName, chartRepo, kubeContext, namespace string, extraArgs []string, _ log.Logger) (string, error) {\n\targs := []string{\n\t\t\"template\",\n\t\tdefaultReleaseName,\n\t\tchartName,\n\t\t\"--repository-config=''\",\n\t\t\"--kube-context\",\n\t\tkubeContext,\n\t\t\"--namespace\",\n\t\tnamespace,\n\t}\n\tif chartRepo != \"\" {\n\t\targs = append(args, \"--repo\", chartRepo)\n\t}\n\targs = append(args, extraArgs...)\n\n\thelmCmd := exec.Command(\"helm\", args...)\n\tif chartRepo != \"\" {\n\t\thelmWorkDir, err := getHelmWorkdir(chartName)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\thelmCmd.Dir = helmWorkDir\n\t}\n\toutput, err := helmCmd.CombinedOutput()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error during helm command: %s (%w)\", string(output), err)\n\t}\n\treturn string(output), nil\n}\n\nfunc getHelmWorkdir(chartName string) (string, error) {\n\t// If chartName folder exists, check temp dir next\n\tif _, err := os.Stat(chartName); err == nil {\n\t\ttempDir := os.TempDir()\n\n\t\t// If tempDir/chartName folder exists, create temp folder\n\t\tif _, err := os.Stat(path.Join(tempDir, chartName)); err == nil {\n\t\t\ttempDir, err = os.MkdirTemp(tempDir, chartName)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", errors.New(\"problematic directory `\" + chartName + \"` found: please execute command in a different folder\")\n\t\t\t}\n\t\t}\n\n\t\t// Use tempDir\n\t\treturn tempDir, nil\n\t}\n\n\t// Use current workdir\n\treturn \"\", nil\n}\n\nvar (\n\tErrMissingContainer = errors.New(\"missing container\")\n\tErrLoftNotReachable = errors.New(\"DevPod Pro is not reachable\")\n)\n\ntype ContainerDetails struct {\n\tNetworkSettings ContainerNetworkSettings `json:\"NetworkSettings,omitempty\"`\n\tState           ContainerDetailsState    `json:\"State,omitempty\"`\n\tID              string                   `json:\"ID,omitempty\"`\n\tCreated         string                   `json:\"Created,omitempty\"`\n\tConfig          ContainerDetailsConfig   `json:\"Config,omitempty\"`\n}\n\ntype ContainerNetworkSettings struct {\n\tPorts map[string][]ContainerPort `json:\"ports,omitempty\"`\n}\n\ntype ContainerPort struct {\n\tHostIP   string `json:\"HostIp,omitempty\"`\n\tHostPort string `json:\"HostPort,omitempty\"`\n}\n\ntype ContainerDetailsConfig struct {\n\tLabels map[string]string `json:\"Labels,omitempty\"`\n\tImage  string            `json:\"Image,omitempty\"`\n\tUser   string            `json:\"User,omitempty\"`\n\tEnv    []string          `json:\"Env,omitempty\"`\n}\n\ntype ContainerDetailsState struct {\n\tStatus    string `json:\"Status,omitempty\"`\n\tStartedAt string `json:\"StartedAt,omitempty\"`\n}\n\nfunc WrapCommandError(stdout []byte, err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\treturn &Error{\n\t\tstdout: stdout,\n\t\terr:    err,\n\t}\n}\n\ntype Error struct {\n\terr    error\n\tstdout []byte\n}\n\nfunc (e *Error) Error() string {\n\tmessage := \"\"\n\tif len(e.stdout) > 0 {\n\t\tmessage += string(e.stdout) + \"\\n\"\n\t}\n\n\tvar exitError *exec.ExitError\n\tif errors.As(e.err, &exitError) && len(exitError.Stderr) > 0 {\n\t\tmessage += string(exitError.Stderr) + \"\\n\"\n\t}\n\n\treturn message + e.err.Error()\n}\n\nfunc getMachineUID(log log.Logger) string {\n\tid, err := machineid.ID()\n\tif err != nil {\n\t\tid = \"error\"\n\t\tif log != nil {\n\t\t\tlog.Debugf(\"Error retrieving machine uid: %v\", err)\n\t\t}\n\t}\n\t// get $HOME to distinguish two users on the same machine\n\t// will be hashed later together with the ID\n\thome, err := util.UserHomeDir()\n\tif err != nil {\n\t\thome = \"error\"\n\t\tif log != nil {\n\t\t\tlog.Debugf(\"Error retrieving machine home: %v\", err)\n\t\t}\n\t}\n\tmac := hmac.New(sha256.New, []byte(id))\n\tmac.Write([]byte(home))\n\treturn fmt.Sprintf(\"%x\", mac.Sum(nil))\n}\n"
  },
  {
    "path": "cmd/pro/update_provider.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\tprovidercmd \"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpdateProviderCmd holds the cmd flags\ntype UpdateProviderCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost     string\n\tInstance string\n}\n\n// NewUpdateProviderCmd creates a new command\nfunc NewUpdateProviderCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpdateProviderCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"update-provider [new-version]\",\n\t\tShort:  \"Update platform provider\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *UpdateProviderCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"new version is missing\")\n\t}\n\tnewVersion := args[0]\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprovider, err := workspace.ProviderFromHost(ctx, devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load provider: %w\", err)\n\t}\n\tif provider.Source.Internal {\n\t\treturn nil\n\t}\n\tproviderSource, err := workspace.ResolveProviderSource(devPodConfig, provider.Name, cmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve provider source %s: %w\", provider.Name, err)\n\t}\n\tsplitted := strings.Split(providerSource, \"@\")\n\tif len(splitted) == 0 {\n\t\treturn fmt.Errorf(\"no provider source found %s\", providerSource)\n\t}\n\tproviderSource = splitted[0] + \"@\" + newVersion\n\n\t_, err = workspace.UpdateProvider(devPodConfig, provider.Name, providerSource, cmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"update provider %s: %w\", provider.Name, err)\n\t}\n\n\terr = providercmd.ConfigureProvider(ctx, provider, devPodConfig.DefaultContext, []string{}, true, true, true, nil, log.Discard)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"configure provider, please retry with 'devpod provider use %s --reconfigure': %w\", provider.Name, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/update_workspace.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpdateWorkspaceCmd holds the cmd flags\ntype UpdateWorkspaceCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost     string\n\tInstance string\n}\n\n// NewUpdateWorkspaceCmd creates a new command\nfunc NewUpdateWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpdateWorkspaceCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"update-workspace\",\n\t\tShort:  \"Update workspace instance\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\tc.Flags().StringVar(&cmd.Instance, \"instance\", \"\", \"The workspace instance to update\")\n\t_ = c.MarkFlagRequired(\"instance\")\n\n\treturn c\n}\n\nfunc (cmd *UpdateWorkspaceCmd) Run(ctx context.Context, devPodConfig *config.Config, provider *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(provider.Name)\n\topts[platform.WorkspaceInstanceEnv] = config.OptionValue{Value: cmd.Instance}\n\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"updateWorkspace\",\n\t\tprovider.Exec.Proxy.Update.Workspace,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tcmd.Log.ErrorStreamOnly().Writer(logrus.ErrorLevel, true),\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"update workspace with provider \\\"%s\\\": %w\", provider.Name, err)\n\t}\n\n\tfmt.Println(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/version.go",
    "content": "package pro\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// VersionCmd holds the cmd flags\ntype VersionCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost string\n}\n\n// NewVersionCmd creates a new command\nfunc NewVersionCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &VersionCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"version\",\n\t\tShort:  \"Get version\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *VersionCmd) Run(ctx context.Context, devPodConfig *config.Config, providerConfig *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(providerConfig.Name)\n\topts[provider.PROVIDER_ID] = config.OptionValue{Value: providerConfig.Name}\n\topts[provider.PROVIDER_CONTEXT] = config.OptionValue{Value: cmd.Context}\n\n\tvar buf bytes.Buffer\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"getVersion\",\n\t\tproviderConfig.Exec.Proxy.Get.Version,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tproviderConfig,\n\t\tnil,\n\t\tnil,\n\t\t&buf,\n\t\tnil,\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get version: %w\", err)\n\t}\n\n\tfmt.Print(buf.String())\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/wakeup.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n\n\tclusterv1 \"github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\tctrlclient \"sigs.k8s.io/controller-runtime/pkg/client\"\n)\n\n// WakeupCmd holds the cmd flags\ntype WakeupCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tProject string\n\tHost    string\n}\n\n// NewWakeupCmd creates a new command\nfunc NewWakeupCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WakeupCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:   \"wakeup\",\n\t\tShort: \"Wake a workspace up\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tlog.Default.SetFormat(log.TextFormat)\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\n\treturn c\n}\n\nfunc (cmd *WakeupCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"please provide a workspace name\")\n\t}\n\ttargetWorkspace := args[0]\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseClient, err := platform.InitClientFromHost(ctx, devPodConfig, cmd.Host, cmd.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceInstance, err := platform.FindInstanceByName(ctx, baseClient, targetWorkspace, cmd.Project)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif workspaceInstance.Status.Phase != storagev1.InstanceSleeping {\n\t\tcmd.Log.Infof(\"Workspace %s is not sleeping\", targetWorkspace, workspaceInstance.Name)\n\t\treturn nil\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create a deep copy of the workspace instance\n\toldWorkspaceInstance := workspaceInstance.DeepCopy()\n\toldWorkspaceInstance.Status = workspaceInstance.Status\n\toldWorkspaceInstance.ObjectMeta = workspaceInstance.ObjectMeta\n\toldWorkspaceInstance.TypeMeta = workspaceInstance.TypeMeta\n\n\t// create a patch from the old workspace instance\n\tpatch := ctrlclient.MergeFrom(oldWorkspaceInstance)\n\tif workspaceInstance.Annotations == nil {\n\t\tworkspaceInstance.Annotations = map[string]string{}\n\t}\n\tdelete(workspaceInstance.Annotations, clusterv1.SleepModeForceAnnotation)\n\tdelete(workspaceInstance.Annotations, clusterv1.SleepModeForceDurationAnnotation)\n\tworkspaceInstance.Annotations[clusterv1.SleepModeLastActivityAnnotation] = strconv.FormatInt(time.Now().Unix(), 10)\n\n\tpatchData, err := patch.Data(workspaceInstance)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(cmd.Project)).Patch(ctx, workspaceInstance.Name, patch.Type(), patchData, metav1.PatchOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait for sleeping\n\tcmd.Log.Info(\"Wait until workspace wakes up...\")\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, platform.Timeout(), false, func(ctx context.Context) (done bool, err error) {\n\t\tworkspaceInstance, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(cmd.Project)).Get(ctx, workspaceInstance.Name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn workspaceInstance.Status.Phase == storagev1.InstanceReady, nil\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error waiting for workspace to wake up: %w\", err)\n\t}\n\n\tcmd.Log.Donef(\"Successfully woke up workspace %s\", workspaceInstance.Name)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/pro/watch_workspaces.go",
    "content": "package pro\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/loft-sh/devpod/cmd/pro/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// WatchWorkspacesCmd holds the cmd flags\ntype WatchWorkspacesCmd struct {\n\t*flags.GlobalFlags\n\tLog log.Logger\n\n\tHost          string\n\tProject       string\n\tFilterByOwner bool\n}\n\n// NewWatchWorkspacesCmd creates a new command\nfunc NewWatchWorkspacesCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &WatchWorkspacesCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tLog:         log.GetInstance(),\n\t}\n\tc := &cobra.Command{\n\t\tUse:    \"watch-workspaces\",\n\t\tShort:  \"Watch workspaces\",\n\t\tHidden: true,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, provider, err := findProProvider(cobraCmd.Context(), cmd.Context, cmd.Provider, cmd.Host, cmd.Log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(cobraCmd.Context(), devPodConfig, provider)\n\t\t},\n\t}\n\n\tc.Flags().StringVar(&cmd.Host, \"host\", \"\", \"The pro instance to use\")\n\t_ = c.MarkFlagRequired(\"host\")\n\tc.Flags().StringVar(&cmd.Project, \"project\", \"\", \"The project to use\")\n\t_ = c.MarkFlagRequired(\"project\")\n\tc.Flags().BoolVar(&cmd.FilterByOwner, \"filter-by-owner\", true, \"If true only shows workspaces of current owner\")\n\n\treturn c\n}\n\nfunc (cmd *WatchWorkspacesCmd) Run(ctx context.Context, devPodConfig *config.Config, providerConfig *provider.ProviderConfig) error {\n\topts := devPodConfig.ProviderOptions(providerConfig.Name)\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tif cmd.FilterByOwner {\n\t\topts[provider.LOFT_FILTER_BY_OWNER] = config.OptionValue{Value: \"true\"}\n\t}\n\topts[provider.LOFT_PROJECT] = config.OptionValue{Value: cmd.Project}\n\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, syscall.SIGINT)\n\n\tgo func() {\n\t\t<-sigChan\n\t\tcancel()\n\t}()\n\n\t// ignore --debug because we tunnel json through stdio\n\tcmd.Log.SetLevel(logrus.InfoLevel)\n\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tcancelCtx,\n\t\t\"watchWorkspaces\",\n\t\tproviderConfig.Exec.Proxy.Watch.Workspaces,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tproviderConfig,\n\t\tnil,\n\t\tnil,\n\t\tos.Stdout,\n\t\tlog.Default.ErrorStreamOnly().Writer(logrus.ErrorLevel, false),\n\t\tcmd.Log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"watch workspaces with provider \\\"%s\\\": %w\", providerConfig.Name, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/profile.go",
    "content": "//go:build profile\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/pprof\"\n\t\"os\"\n)\n\nfunc init() {\n\tgo func() {\n\t\tmyMux := http.NewServeMux()\n\n\t\tmyMux.HandleFunc(\"/debug/pprof/\", pprof.Index)\n\t\tmyMux.HandleFunc(\"/debug/pprof/{action}\", pprof.Index)\n\t\tmyMux.HandleFunc(\"/debug/pprof/symbol\", pprof.Symbol)\n\n\t\tlistener, err := net.Listen(\"tcp\", \":0\")\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tf, err := os.OpenFile(\"/tmp/pprof_ports\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\tif err == nil {\n\t\t\tf.Write([]byte(fmt.Sprintf(\"%d=%d\\n\", os.Getpid(), listener.Addr().(*net.TCPAddr).Port)))\n\t\t\tf.Close()\n\t\t}\n\n\t\thttp.Serve(listener, myMux)\n\t}()\n}\n"
  },
  {
    "path": "cmd/provider/add.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// AddCmd holds the cmd flags\ntype AddCmd struct {\n\t*flags.GlobalFlags\n\n\tUse           bool\n\tSingleMachine bool\n\tOptions       []string\n\n\tName         string\n\tFromExisting string\n}\n\n// NewAddCmd creates a new command\nfunc NewAddCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &AddCmd{\n\t\tGlobalFlags: flags,\n\t}\n\taddCmd := &cobra.Command{\n\t\tUse:   \"add [URL or path]\",\n\t\tShort: \"Adds a new provider to DevPod\",\n\t\tPreRunE: func(cobraCommand *cobra.Command, args []string) error {\n\t\t\tif cmd.FromExisting != \"\" {\n\t\t\t\treturn cobraCommand.MarkFlagRequired(\"name\")\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tctx := context.Background()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn cmd.Run(ctx, devPodConfig, args)\n\t\t},\n\t}\n\n\taddCmd.Flags().BoolVar(&cmd.SingleMachine, \"single-machine\", false, \"If enabled will use a single machine for all workspaces\")\n\taddCmd.Flags().StringVar(&cmd.Name, \"name\", \"\", \"The name to use for this provider. If empty will use the name within the loaded config\")\n\taddCmd.Flags().StringVar(&cmd.FromExisting, \"from-existing\", \"\", \"The name of an existing provider to use as a template. Needs to be used in conjunction with the --name flag\")\n\taddCmd.Flags().BoolVar(&cmd.Use, \"use\", true, \"If enabled will automatically activate the provider\")\n\taddCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"Provider option in the form KEY=VALUE\")\n\n\treturn addCmd\n}\n\nfunc (cmd *AddCmd) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\tif len(args) != 1 && cmd.FromExisting == \"\" {\n\t\treturn fmt.Errorf(\"please specify either a local file, url or git repository. E.g. devpod provider add https://path/to/my/provider.yaml\")\n\t} else if cmd.Name != \"\" && provider.ProviderNameRegEx.MatchString(cmd.Name) {\n\t\treturn fmt.Errorf(\"provider name can only include smaller case letters, numbers or dashes\")\n\t} else if cmd.Name != \"\" && len(cmd.Name) > 32 {\n\t\treturn fmt.Errorf(\"provider name cannot be longer than 32 characters\")\n\t} else if cmd.FromExisting != \"\" && devPodConfig.Current() != nil && devPodConfig.Current().Providers[cmd.FromExisting] == nil {\n\t\treturn fmt.Errorf(\"provider %s does not exist\", cmd.FromExisting)\n\t}\n\n\tvar providerConfig *provider.ProviderConfig\n\tvar options []string\n\tif cmd.FromExisting != \"\" {\n\t\tproviderWithOptions, err := workspace.CloneProvider(devPodConfig, cmd.Name, cmd.FromExisting, log.Default)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tproviderConfig = providerWithOptions.Config\n\t\toptions = mergeOptions(providerWithOptions.Config.Options, providerWithOptions.State.Options, cmd.Options)\n\t} else {\n\t\tc, err := workspace.AddProvider(devPodConfig, cmd.Name, args[0], log.Default)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tproviderConfig = c\n\t\toptions = cmd.Options\n\t}\n\n\tlog.Default.Donef(\"Successfully installed provider %s\", providerConfig.Name)\n\tif cmd.Use {\n\t\tconfigureErr := ConfigureProvider(ctx, providerConfig, devPodConfig.DefaultContext, options, true, false, false, &cmd.SingleMachine, log.Default)\n\t\tif configureErr != nil {\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, \"\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = DeleteProvider(ctx, devPodConfig, providerConfig.Name, true, true, log.Default)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"delete provider\")\n\t\t\t}\n\n\t\t\treturn errors.Wrap(configureErr, \"configure provider\")\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tlog.Default.Infof(\"To use the provider, please run the following command:\")\n\tlog.Default.Infof(\"devpod provider use %s\", providerConfig.Name)\n\treturn nil\n}\n\n// mergeOptions combines user options with existing options, user provided options take precedence\nfunc mergeOptions(desiredOptions map[string]*types.Option, stateOptions map[string]config.OptionValue, userOptions []string) []string {\n\tretOptions := []string{}\n\tfor key := range desiredOptions {\n\t\tuserOption, ok := getUserOption(userOptions, key)\n\t\tif ok {\n\t\t\tretOptions = append(retOptions, userOption)\n\t\t\tcontinue\n\t\t}\n\t\tstateOption, ok := stateOptions[key]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tretOptions = append(retOptions, fmt.Sprintf(\"%s=%s\", key, stateOption.Value))\n\t}\n\n\treturn retOptions\n}\n\nfunc getUserOption(allOptions []string, optionKey string) (string, bool) {\n\tif len(allOptions) == 0 {\n\t\treturn \"\", false\n\t}\n\n\tfor _, option := range allOptions {\n\t\tsplitted := strings.Split(option, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\t// ignore\n\t\t\tcontinue\n\t\t}\n\t\tif splitted[0] == optionKey {\n\t\t\treturn option, true\n\t\t}\n\t}\n\n\treturn \"\", false\n}\n"
  },
  {
    "path": "cmd/provider/delete.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\tlogpkg \"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n)\n\n// DeleteCmd holds the delete cmd flags\ntype DeleteCmd struct {\n\t*flags.GlobalFlags\n\n\tIgnoreNotFound bool\n\tForce          bool\n}\n\n// NewDeleteCmd creates a new command\nfunc NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &DeleteCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tdeleteCmd := &cobra.Command{\n\t\tUse:   \"delete [name]\",\n\t\tShort: \"Delete a provider\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetProviderSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, logpkg.Default)\n\t\t},\n\t}\n\n\tdeleteCmd.Flags().BoolVar(&cmd.IgnoreNotFound, \"ignore-not-found\", false, \"Treat \\\"provider not found\\\" as a successful delete\")\n\tdeleteCmd.Flags().BoolVar(&cmd.Force, \"force\", false, \"Force delete the provider and ignore provider is already used\")\n\t_ = deleteCmd.Flags().MarkHidden(\"force\")\n\treturn deleteCmd\n}\n\nfunc (cmd *DeleteCmd) Run(ctx context.Context, args []string) error {\n\tif len(args) > 1 {\n\t\treturn fmt.Errorf(\"please specify a provider to delete\")\n\t}\n\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprovider := devPodConfig.Current().DefaultProvider\n\tif len(args) > 0 {\n\t\tprovider = args[0]\n\t} else if provider == \"\" {\n\t\treturn fmt.Errorf(\"please specify a provider to delete\")\n\t}\n\n\t// delete the provider\n\terr = DeleteProvider(ctx, devPodConfig, provider, cmd.IgnoreNotFound, cmd.Force, logpkg.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogpkg.Default.Donef(\"Successfully deleted provider '%s'\", provider)\n\treturn nil\n}\n\nfunc DeleteProvider(ctx context.Context, devPodConfig *config.Config, provider string, ignoreNotFound, force bool, log logpkg.Logger) error {\n\t// if force is not set, check if the provider is associated with a pro instance or workspace\n\tif !force {\n\t\t// check if this provider is associated with a pro instance\n\t\tproInstances, err := workspace.ListProInstances(devPodConfig, logpkg.Default)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"list pro instances: %w\", err)\n\t\t}\n\t\tfor _, instance := range proInstances {\n\t\t\tif instance.Provider == provider {\n\t\t\t\treturn fmt.Errorf(\"cannot delete provider '%s', because it is connected to Pro instance '%s'. Removing the Pro instance will automatically delete this provider\", instance.Provider, instance.Host)\n\t\t\t}\n\t\t}\n\n\t\t// check if there are workspaces that still use this provider\n\t\tworkspaces, err := workspace.List(ctx, devPodConfig, true, platform.AllOwnerFilter, log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// search for workspace that uses this machine\n\t\tfor _, workspace := range workspaces {\n\t\t\tif workspace.Provider.Name == provider {\n\t\t\t\treturn fmt.Errorf(\"cannot delete provider '%s', because workspace '%s' is still using it. Please delete the workspace '%s' before deleting the provider\", workspace.Provider.Name, workspace.ID, workspace.ID)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn DeleteProviderConfig(devPodConfig, provider, ignoreNotFound)\n}\n\nfunc DeleteProviderConfig(devPodConfig *config.Config, provider string, ignoreNotFound bool) error {\n\tif devPodConfig.Current().DefaultProvider == provider {\n\t\tdevPodConfig.Current().DefaultProvider = \"\"\n\t}\n\tdelete(devPodConfig.Current().Providers, provider)\n\terr := config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save config: %w\", err)\n\t}\n\n\tproviderDir, err := provider2.GetProviderDir(devPodConfig.DefaultContext, provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = os.Stat(providerDir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif ignoreNotFound {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn fmt.Errorf(\"provider '%s' does not exist\", provider)\n\t\t}\n\n\t\treturn err\n\t}\n\terr = os.RemoveAll(providerDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"delete provider dir: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/provider/list-default-providers.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListAvailableCmd holds the list cmd flags\ntype ListAvailableCmd struct {\n\tflags.GlobalFlags\n}\n\nfunc getDevpodProviderList() error {\n\treq, err := http.NewRequest(\"GET\", \"https://api.github.com/users/loft-sh/repos\", nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tresult, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar jsonResult []map[string]interface{}\n\terr = json.Unmarshal(result, &jsonResult)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(\"List of available providers from loft:\")\n\tfor _, v := range jsonResult {\n\t\tif strings.Contains(v[\"name\"].(string), \"devpod-provider\") {\n\t\t\tname := strings.TrimPrefix(v[\"name\"].(string), \"devpod-provider-\")\n\t\t\tfmt.Println(\"\\t\", name)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// NewListAvailableCmd creates a new command\nfunc NewListAvailableCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListAvailableCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tlistAvailableCmd := &cobra.Command{\n\t\tUse:   \"list-available\",\n\t\tShort: \"List providers available for installation\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\treturn listAvailableCmd\n}\n\n// Run runs the command logic\nfunc (cmd *ListAvailableCmd) Run(ctx context.Context) error {\n\treturn getDevpodProviderList()\n}\n"
  },
  {
    "path": "cmd/provider/list.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// ListCmd holds the list cmd flags\ntype ListCmd struct {\n\tflags.GlobalFlags\n\n\tOutput string\n}\n\n// NewListCmd creates a new command\nfunc NewListCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &ListCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tlistCmd := &cobra.Command{\n\t\tUse:     \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort:   \"List available providers\",\n\t\tArgs:    cobra.NoArgs,\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background())\n\t\t},\n\t}\n\n\tlistCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn listCmd\n}\n\ntype ProviderWithDefault struct {\n\tworkspace.ProviderWithOptions `json:\",inline\"`\n\n\tDefault bool `json:\"default,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *ListCmd) Run(ctx context.Context) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviders, err := workspace.LoadAllProviders(devPodConfig, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfiguredProviders := devPodConfig.Current().Providers\n\tif configuredProviders == nil {\n\t\tconfiguredProviders = map[string]*config.ProviderConfig{}\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor _, entry := range providers {\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\tentry.Config.Name,\n\t\t\t\tentry.Config.Version,\n\t\t\t\tstrconv.FormatBool(devPodConfig.Current().DefaultProvider == entry.Config.Name),\n\t\t\t\tstrconv.FormatBool(entry.State != nil && entry.State.Initialized),\n\t\t\t\tentry.Config.Description,\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Version\",\n\t\t\t\"Default\",\n\t\t\t\"Initialized\",\n\t\t\t\"Description\",\n\t\t}, tableEntries)\n\t} else if cmd.Output == \"json\" {\n\t\tretMap := map[string]ProviderWithDefault{}\n\t\tfor k, entry := range providers {\n\t\t\tvar dynamicOptions map[string]*types.Option\n\t\t\tif configuredProviders[entry.Config.Name] != nil {\n\t\t\t\tdynamicOptions = configuredProviders[entry.Config.Name].DynamicOptions\n\t\t\t}\n\n\t\t\tsrcOptions := MergeDynamicOptions(entry.Config.Options, dynamicOptions)\n\t\t\tentry.Config.Options = srcOptions\n\t\t\tretMap[k] = ProviderWithDefault{\n\t\t\t\tProviderWithOptions: *entry,\n\t\t\t\tDefault:             devPodConfig.Current().DefaultProvider == entry.Config.Name,\n\t\t\t}\n\t\t}\n\n\t\tout, err := json.MarshalIndent(retMap, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/provider/options.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/table\"\n\t\"github.com/spf13/cobra\"\n)\n\n// OptionsCmd holds the options cmd flags\ntype OptionsCmd struct {\n\t*flags.GlobalFlags\n\n\tHidden bool\n\tOutput string\n}\n\n// NewOptionsCmd creates a new command\nfunc NewOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &OptionsCmd{\n\t\tGlobalFlags: flags,\n\t}\n\toptionsCmd := &cobra.Command{\n\t\tUse:   \"options [provider]\",\n\t\tShort: \"Show options of an existing provider\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(context.Background(), args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetProviderSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\toptionsCmd.Flags().BoolVar(&cmd.Hidden, \"hidden\", false, \"If true, will also show hidden options.\")\n\toptionsCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"The output format to use. Can be json or plain\")\n\treturn optionsCmd\n}\n\ntype optionWithValue struct {\n\ttypes.Option `json:\",inline\"`\n\n\tChildren []string `json:\"children,omitempty\"`\n\tValue    string   `json:\"value,omitempty\"`\n}\n\n// Run runs the command logic\nfunc (cmd *OptionsCmd) Run(ctx context.Context, args []string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderName := devPodConfig.Current().DefaultProvider\n\tif len(args) > 0 {\n\t\tproviderName = args[0]\n\t} else if providerName == \"\" {\n\t\treturn fmt.Errorf(\"please specify a provider\")\n\t}\n\n\tif providerName != \"\" && cmd.GlobalFlags.Provider != \"\" {\n\t\tif providerName != cmd.GlobalFlags.Provider {\n\t\t\tlog.Default.Infof(\"providerName=%+v\", providerName)\n\t\t\tlog.Default.Infof(\"GlobalFlags.Provider=%+v\", cmd.GlobalFlags.Provider)\n\t\t\treturn fmt.Errorf(\"ambiguous provider configuration detected\")\n\t\t}\n\t}\n\n\tproviderWithOptions, err := workspace.FindProvider(devPodConfig, providerName, log.Default.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn printOptions(devPodConfig, providerWithOptions, cmd.Output, cmd.Hidden)\n}\n\nfunc printOptions(devPodConfig *config.Config, provider *workspace.ProviderWithOptions, format string, showHidden bool) error {\n\tentryOptions := devPodConfig.ProviderOptions(provider.Config.Name)\n\tdynamicOptions := devPodConfig.DynamicProviderOptionDefinitions(provider.Config.Name)\n\tsrcOptions := MergeDynamicOptions(provider.Config.Options, dynamicOptions)\n\tif format == \"plain\" {\n\t\ttableEntries := [][]string{}\n\t\tfor optionName, entry := range srcOptions {\n\t\t\tif !showHidden && entry.Hidden {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvalue := entryOptions[optionName].Value\n\t\t\tif value != \"\" && entry.Password {\n\t\t\t\tvalue = \"********\"\n\t\t\t}\n\n\t\t\ttableEntries = append(tableEntries, []string{\n\t\t\t\toptionName,\n\t\t\t\tstrconv.FormatBool(entry.Required),\n\t\t\t\tentry.Description,\n\t\t\t\tentry.Default,\n\t\t\t\tvalue,\n\t\t\t})\n\t\t}\n\t\tsort.SliceStable(tableEntries, func(i, j int) bool {\n\t\t\treturn tableEntries[i][0] < tableEntries[j][0]\n\t\t})\n\n\t\ttable.PrintTable(log.Default, []string{\n\t\t\t\"Name\",\n\t\t\t\"Required\",\n\t\t\t\"Description\",\n\t\t\t\"Default\",\n\t\t\t\"Value\",\n\t\t}, tableEntries)\n\t} else if format == \"json\" {\n\t\toptions := map[string]optionWithValue{}\n\t\tfor optionName, entry := range srcOptions {\n\t\t\tif !showHidden && entry.Hidden {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\toptions[optionName] = optionWithValue{\n\t\t\t\tOption:   *entry,\n\t\t\t\tChildren: entryOptions[optionName].Children,\n\t\t\t\tValue:    entryOptions[optionName].Value,\n\t\t\t}\n\t\t}\n\n\t\tout, err := json.MarshalIndent(options, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", format)\n\t}\n\n\treturn nil\n}\n\n// MergeDynamicOptions merges the static provider options and dynamic options\nfunc MergeDynamicOptions(options map[string]*types.Option, dynamicOptions config.OptionDefinitions) map[string]*types.Option {\n\tretOptions := map[string]*types.Option{}\n\tfor k, option := range options {\n\t\tretOptions[k] = option\n\t}\n\tfor k, option := range dynamicOptions {\n\t\tretOptions[k] = option\n\t}\n\n\treturn retOptions\n}\n"
  },
  {
    "path": "cmd/provider/provider.go",
    "content": "package provider\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewProviderCmd returns a new root command\nfunc NewProviderCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tproviderCmd := &cobra.Command{\n\t\tUse:   \"provider\",\n\t\tShort: \"DevPod Provider commands\",\n\t}\n\n\tproviderCmd.AddCommand(NewListCmd(flags))\n\tproviderCmd.AddCommand(NewListAvailableCmd(flags))\n\tproviderCmd.AddCommand(NewUseCmd(flags))\n\tproviderCmd.AddCommand(NewOptionsCmd(flags))\n\tproviderCmd.AddCommand(NewDeleteCmd(flags))\n\tproviderCmd.AddCommand(NewAddCmd(flags))\n\tproviderCmd.AddCommand(NewUpdateCmd(flags))\n\tproviderCmd.AddCommand(NewSetOptionsCmd(flags))\n\treturn providerCmd\n}\n"
  },
  {
    "path": "cmd/provider/set_options.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// SetOptionsCmd holds the use cmd flags\ntype SetOptionsCmd struct {\n\tflags.GlobalFlags\n\n\tDry bool\n\n\tReconfigure   bool\n\tSingleMachine bool\n\tOptions       []string\n}\n\n// NewSetOptionsCmd creates a new command\nfunc NewSetOptionsCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SetOptionsCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tsetOptionsCmd := &cobra.Command{\n\t\tUse:   \"set-options [provider]\",\n\t\tShort: \"Sets options for the given provider. Similar to 'devpod provider use', but does not switch the default provider.\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tlogger := log.Logger(log.Default)\n\t\t\tif cmd.Dry {\n\t\t\t\tlogger = log.Default.ErrorStreamOnly()\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args, logger)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetProviderSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\tsetOptionsCmd.Flags().BoolVar(&cmd.SingleMachine, \"single-machine\", false, \"If enabled will use a single machine for all workspaces\")\n\tsetOptionsCmd.Flags().BoolVar(&cmd.Reconfigure, \"reconfigure\", false, \"If enabled will not merge existing provider config\")\n\tsetOptionsCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"Provider option in the form KEY=VALUE\")\n\tsetOptionsCmd.Flags().BoolVar(&cmd.Dry, \"dry\", false, \"Dry will not persist the options to file and instead return the new filled options\")\n\treturn setOptionsCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SetOptionsCmd) Run(ctx context.Context, args []string, log log.Logger) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderName := devPodConfig.Current().DefaultProvider\n\tif len(args) > 0 {\n\t\tproviderName = args[0]\n\t} else if providerName == \"\" {\n\t\treturn fmt.Errorf(\"please specify a provider\")\n\t}\n\tlog.Debugf(\"providerName=%+v\", providerName)\n\n\tif os.Getenv(\"DEVPOD_UI\") == \"\" && len(cmd.Options) == 0 {\n\t\treturn fmt.Errorf(\"please specify option\")\n\t}\n\tlog.Debugf(\"Options=%+v\", cmd.Options)\n\n\tproviderWithOptions, err := workspace.FindProvider(devPodConfig, providerName, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdevPodConfig, err = setOptions(\n\t\tctx,\n\t\tproviderWithOptions.Config,\n\t\tdevPodConfig.DefaultContext,\n\t\tcmd.Options,\n\t\tcmd.Reconfigure,\n\t\tcmd.Dry,\n\t\tcmd.Dry,\n\t\tfalse,\n\t\t&cmd.SingleMachine,\n\t\tlog,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// save provider config\n\tif !cmd.Dry {\n\t\terr = config.SaveConfig(devPodConfig)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"save config\")\n\t\t}\n\t} else {\n\t\t// print options to stdout\n\t\terr = printOptions(devPodConfig, providerWithOptions, \"json\", true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"print options: %w\", err)\n\t\t}\n\t}\n\n\t// print success message\n\tlog.Donef(\"Successfully set options for provider '%s'\", providerWithOptions.Config.Name)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/provider/update.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpdateCmd holds the cmd flags\ntype UpdateCmd struct {\n\t*flags.GlobalFlags\n\n\tUse     bool\n\tOptions []string\n}\n\n// NewUpdateCmd creates a new command\nfunc NewUpdateCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpdateCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tupdateCmd := &cobra.Command{\n\t\tUse:   \"update [name] [URL or path]\",\n\t\tShort: \"Updates a provider in DevPod\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tctx := context.Background()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, args)\n\t\t},\n\t}\n\n\tupdateCmd.Flags().BoolVar(&cmd.Use, \"use\", true, \"If enabled will automatically activate the provider\")\n\tupdateCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"Provider option in the form KEY=VALUE\")\n\treturn updateCmd\n}\n\nfunc (cmd *UpdateCmd) Run(ctx context.Context, devPodConfig *config.Config, args []string) error {\n\tif len(args) != 1 && len(args) != 2 {\n\t\treturn fmt.Errorf(\"please specify either a local file, url or git repository. E.g. devpod provider update my-provider loft-sh/devpod-provider-gcloud\")\n\t}\n\n\tproviderSource := \"\"\n\tif len(args) == 2 {\n\t\tproviderSource = args[1]\n\t}\n\n\tproviderConfig, err := workspace.UpdateProvider(devPodConfig, args[0], providerSource, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Default.Donef(\"Successfully updated provider %s\", providerConfig.Name)\n\tif cmd.Use {\n\t\terr = ConfigureProvider(ctx, providerConfig, devPodConfig.DefaultContext, cmd.Options, false, false, false, nil, log.Default)\n\t\tif err != nil {\n\t\t\tlog.Default.Errorf(\"Error configuring provider, please retry with 'devpod provider use %s --reconfigure'\", providerConfig.Name)\n\t\t\treturn errors.Wrap(err, \"configure provider\")\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tlog.Default.Infof(\"To use the provider, please run the following command:\")\n\tlog.Default.Infof(\"devpod provider use %s\", providerConfig.Name)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/provider/use.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\toptions2 \"github.com/loft-sh/devpod/pkg/options\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UseCmd holds the use cmd flags\ntype UseCmd struct {\n\tflags.GlobalFlags\n\n\tReconfigure   bool\n\tSingleMachine bool\n\tOptions       []string\n\n\t// only for testing\n\tSkipInit bool\n}\n\n// NewUseCmd creates a new command\nfunc NewUseCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UseCmd{\n\t\tGlobalFlags: *flags,\n\t}\n\tuseCmd := &cobra.Command{\n\t\tUse:   \"use [name]\",\n\t\tShort: \"Configure an existing provider and set as default\",\n\t\tRunE: func(_ *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"please specify the provider to use\")\n\t\t\t}\n\n\t\t\treturn cmd.Run(context.Background(), args[0])\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetProviderSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\tAddFlags(useCmd, cmd)\n\treturn useCmd\n}\n\nfunc AddFlags(useCmd *cobra.Command, cmd *UseCmd) {\n\tuseCmd.Flags().BoolVar(&cmd.SingleMachine, \"single-machine\", false, \"If enabled will use a single machine for all workspaces\")\n\tuseCmd.Flags().BoolVar(&cmd.Reconfigure, \"reconfigure\", false, \"If enabled will not merge existing provider config\")\n\tuseCmd.Flags().StringArrayVarP(&cmd.Options, \"option\", \"o\", []string{}, \"Provider option in the form KEY=VALUE\")\n\n\tuseCmd.Flags().BoolVar(&cmd.SkipInit, \"skip-init\", false, \"ONLY FOR TESTING: If true will skip init\")\n\t_ = useCmd.Flags().MarkHidden(\"skip-init\")\n}\n\n// Run runs the command logic\nfunc (cmd *UseCmd) Run(ctx context.Context, providerName string) error {\n\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderWithOptions, err := workspace.FindProvider(devPodConfig, providerName, log.Default)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// should reconfigure?\n\tshouldReconfigure := cmd.Reconfigure || len(cmd.Options) > 0 || providerWithOptions.State == nil || cmd.SingleMachine\n\tif shouldReconfigure {\n\t\treturn ConfigureProvider(ctx, providerWithOptions.Config, devPodConfig.DefaultContext, cmd.Options, cmd.Reconfigure, cmd.SkipInit, false, &cmd.SingleMachine, log.Default)\n\t} else {\n\t\tlog.Default.Infof(\"To reconfigure provider %s, run with '--reconfigure' to reconfigure the provider\", providerWithOptions.Config.Name)\n\t}\n\n\t// set options\n\tdefaultContext := devPodConfig.Current()\n\tdefaultContext.DefaultProvider = providerWithOptions.Config.Name\n\n\t// save provider config\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\t// print success message\n\tlog.Default.Donef(\"Successfully switched default provider to '%s'\", providerWithOptions.Config.Name)\n\treturn nil\n}\n\nfunc ConfigureProvider(ctx context.Context, provider *provider2.ProviderConfig, context string, userOptions []string, reconfigure, skipInit, skipSubOptions bool, singleMachine *bool, log log.Logger) error {\n\t// set options\n\tdevPodConfig, err := setOptions(ctx, provider, context, userOptions, reconfigure, false, skipInit, skipSubOptions, singleMachine, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set options\n\tdefaultContext := devPodConfig.Current()\n\tdefaultContext.DefaultProvider = provider.Name\n\n\t// save provider config\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"save config\")\n\t}\n\n\tlog.Donef(\"Successfully configured provider '%s'\", provider.Name)\n\treturn nil\n}\n\nfunc setOptions(\n\tctx context.Context,\n\tprovider *provider2.ProviderConfig,\n\tcontext string,\n\tuserOptions []string,\n\treconfigure,\n\tskipRequired,\n\tskipInit,\n\tskipSubOptions bool,\n\tsingleMachine *bool,\n\tlog log.Logger,\n) (*config.Config, error) {\n\tdevPodConfig, err := config.LoadConfig(context, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// parse options\n\toptions, err := provider2.ParseOptions(userOptions)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse options\")\n\t}\n\n\t// merge with old values\n\tif !reconfigure {\n\t\tfor k, v := range devPodConfig.ProviderOptions(provider.Name) {\n\t\t\t_, ok := options[k]\n\t\t\tif !ok && v.UserProvided {\n\t\t\t\toptions[k] = v.Value\n\t\t\t}\n\t\t}\n\t}\n\n\t// fill defaults\n\tdevPodConfig, err = options2.ResolveOptions(ctx, devPodConfig, provider, options, skipRequired, skipSubOptions, singleMachine, log)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"resolve options\")\n\t}\n\n\t// run init command\n\tif !skipInit {\n\t\tstdout := log.Writer(logrus.InfoLevel, false)\n\t\tdefer stdout.Close()\n\n\t\tstderr := log.Writer(logrus.ErrorLevel, false)\n\t\tdefer stderr.Close()\n\n\t\terr = initProvider(ctx, devPodConfig, provider, stdout, stderr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn devPodConfig, nil\n}\n\nfunc initProvider(ctx context.Context, devPodConfig *config.Config, provider *provider2.ProviderConfig, stdout, stderr io.Writer) error {\n\t// run init command\n\terr := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"init\",\n\t\tprovider.Exec.Init,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\tdevPodConfig.ProviderOptions(provider.Name),\n\t\tprovider,\n\t\tnil,\n\t\tnil,\n\t\tstdout,\n\t\tstderr,\n\t\tlog.Default,\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"init\")\n\t}\n\tif devPodConfig.Current().Providers == nil {\n\t\tdevPodConfig.Current().Providers = map[string]*config.ProviderConfig{}\n\t}\n\tif devPodConfig.Current().Providers[provider.Name] == nil {\n\t\tdevPodConfig.Current().Providers[provider.Name] = &config.ProviderConfig{}\n\t}\n\tdevPodConfig.Current().Providers[provider.Name].Initialized = true\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/root.go",
    "content": "package cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/devpod/cmd/agent\"\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/context\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/helper\"\n\t\"github.com/loft-sh/devpod/cmd/ide\"\n\t\"github.com/loft-sh/devpod/cmd/machine\"\n\t\"github.com/loft-sh/devpod/cmd/pro\"\n\t\"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/loft-sh/devpod/cmd/use\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/telemetry\"\n\tlog2 \"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/terminal\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nvar globalFlags *flags.GlobalFlags\n\n// NewRootCmd returns a new root command\nfunc NewRootCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse:           \"devpod\",\n\t\tShort:         \"DevPod\",\n\t\tSilenceUsage:  true,\n\t\tSilenceErrors: true,\n\t\tPersistentPreRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tif globalFlags.LogOutput == \"json\" {\n\t\t\t\tlog2.Default.SetFormat(log2.JSONFormat)\n\t\t\t} else if globalFlags.LogOutput == \"raw\" {\n\t\t\t\tlog2.Default.SetFormat(log2.RawFormat)\n\t\t\t} else if globalFlags.LogOutput != \"plain\" {\n\t\t\t\treturn fmt.Errorf(\"unrecognized log format %s, needs to be either plain or json\", globalFlags.LogOutput)\n\t\t\t}\n\n\t\t\tif globalFlags.Silent {\n\t\t\t\tlog2.Default.SetLevel(logrus.FatalLevel)\n\t\t\t} else if globalFlags.Debug {\n\t\t\t\tlog2.Default.SetLevel(logrus.DebugLevel)\n\t\t\t} else if os.Getenv(clientimplementation.DevPodDebug) == \"true\" {\n\t\t\t\tlog2.Default.SetLevel(logrus.DebugLevel)\n\t\t\t}\n\n\t\t\tif globalFlags.DevPodHome != \"\" {\n\t\t\t\t_ = os.Setenv(config.DEVPOD_HOME, globalFlags.DevPodHome)\n\t\t\t}\n\n\t\t\tdevPodConfig, err := config.LoadConfig(globalFlags.Context, globalFlags.Provider)\n\t\t\tif err == nil {\n\t\t\t\ttelemetry.StartCLI(devPodConfig, cobraCmd)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tPersistentPostRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif globalFlags.DevPodHome != \"\" {\n\t\t\t\t_ = os.Unsetenv(config.DEVPOD_HOME)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n}\n\n// Execute adds all child commands to the root command and sets flags appropriately.\n// This is called by main.main(). It only needs to happen once to the rootCmd.\nfunc Execute() {\n\t// build the root command\n\trootCmd := BuildRoot()\n\n\t// execute command\n\terr := rootCmd.Execute()\n\ttelemetry.CollectorCLI.RecordCLI(err)\n\ttelemetry.CollectorCLI.Flush()\n\tif err != nil {\n\t\t//nolint:all\n\t\tif sshExitErr, ok := err.(*ssh.ExitError); ok {\n\t\t\tos.Exit(sshExitErr.ExitStatus())\n\t\t}\n\n\t\t//nolint:all\n\t\tif execExitErr, ok := err.(*exec.ExitError); ok {\n\t\t\tos.Exit(execExitErr.ExitCode())\n\t\t}\n\n\t\tif globalFlags.Debug {\n\t\t\tlog2.Default.Fatalf(\"%+v\", err)\n\t\t} else {\n\t\t\tif rootCmd.Annotations == nil || rootCmd.Annotations[agent.AgentExecutedAnnotation] != \"true\" {\n\t\t\t\tif terminal.IsTerminalIn {\n\t\t\t\t\tlog2.Default.Error(\"Try using the --debug flag to see a more verbose output\")\n\t\t\t\t} else if os.Getenv(telemetry.UIEnvVar) == \"true\" {\n\t\t\t\t\tlog2.Default.Error(\"Try enabling Debug mode under Settings to see a more verbose output\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tlog2.Default.Fatal(err)\n\t\t}\n\t}\n}\n\n// BuildRoot creates a new root command from the\nfunc BuildRoot() *cobra.Command {\n\trootCmd := NewRootCmd()\n\tpersistentFlags := rootCmd.PersistentFlags()\n\tglobalFlags = flags.SetGlobalFlags(persistentFlags)\n\t_ = completion.RegisterFlagCompletionFuns(rootCmd, globalFlags)\n\n\trootCmd.AddCommand(agent.NewAgentCmd(globalFlags))\n\trootCmd.AddCommand(provider.NewProviderCmd(globalFlags))\n\trootCmd.AddCommand(use.NewUseCmd(globalFlags))\n\trootCmd.AddCommand(helper.NewHelperCmd(globalFlags))\n\trootCmd.AddCommand(ide.NewIDECmd(globalFlags))\n\trootCmd.AddCommand(machine.NewMachineCmd(globalFlags))\n\trootCmd.AddCommand(context.NewContextCmd(globalFlags))\n\trootCmd.AddCommand(pro.NewProCmd(globalFlags, log2.Default))\n\trootCmd.AddCommand(NewUpCmd(globalFlags))\n\trootCmd.AddCommand(NewDeleteCmd(globalFlags))\n\trootCmd.AddCommand(NewSSHCmd(globalFlags))\n\trootCmd.AddCommand(NewVersionCmd())\n\trootCmd.AddCommand(NewStopCmd(globalFlags))\n\trootCmd.AddCommand(NewListCmd(globalFlags))\n\trootCmd.AddCommand(NewStatusCmd(globalFlags))\n\trootCmd.AddCommand(NewBuildCmd(globalFlags))\n\trootCmd.AddCommand(NewLogsDaemonCmd(globalFlags))\n\trootCmd.AddCommand(NewExportCmd(globalFlags))\n\trootCmd.AddCommand(NewImportCmd(globalFlags))\n\trootCmd.AddCommand(NewLogsCmd(globalFlags))\n\trootCmd.AddCommand(NewUpgradeCmd())\n\trootCmd.AddCommand(NewTroubleshootCmd(globalFlags))\n\trootCmd.AddCommand(NewPingCmd(globalFlags))\n\treturn rootCmd\n}\n"
  },
  {
    "path": "cmd/ssh.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/machine\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/gpg\"\n\t\"github.com/loft-sh/devpod/pkg/port\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/devpod/pkg/tunnel\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nconst (\n\tDisableSSHKeepAlive time.Duration = 0 * time.Second\n)\n\n// SSHCmd holds the ssh cmd flags\ntype SSHCmd struct {\n\t*flags.GlobalFlags\n\n\tForwardPortsTimeout string\n\tForwardPorts        []string\n\tReverseForwardPorts []string\n\tSendEnvVars         []string\n\tSetEnvVars          []string\n\n\tStdio                     bool\n\tJumpContainer             bool\n\tReuseSSHAuthSock          string\n\tAgentForwarding           bool\n\tGPGAgentForwarding        bool\n\tGitSSHSignatureForwarding bool\n\n\t// ssh keepalive options\n\tSSHKeepAliveInterval time.Duration `json:\"sshKeepAliveInterval,omitempty\"`\n\n\tStartServices bool\n\n\tCommand string\n\tUser    string\n\tWorkDir string\n}\n\n// NewSSHCmd creates a new ssh command\nfunc NewSSHCmd(f *flags.GlobalFlags) *cobra.Command {\n\tcmd := &SSHCmd{\n\t\tGlobalFlags: f,\n\t}\n\tsshCmd := &cobra.Command{\n\t\tUse:   \"ssh [flags] [workspace-folder|workspace-name]\",\n\t\tShort: \"Starts a new ssh session to a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlocalOnly := false\n\t\t\tif cmd.Stdio {\n\t\t\t\tlocalOnly = true\n\t\t\t}\n\n\t\t\tctx := cobraCmd.Context()\n\t\t\tclient, err := workspace2.Get(ctx, devPodConfig, args, true, cmd.Owner, localOnly, log.Default.ErrorStreamOnly())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, client, log.Default.ErrorStreamOnly())\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\tsshCmd.Flags().StringArrayVarP(&cmd.ForwardPorts, \"forward-ports\", \"L\", []string{}, \"Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix socket, on the remote side.\")\n\tsshCmd.Flags().StringArrayVarP(&cmd.ReverseForwardPorts, \"reverse-forward-ports\", \"R\", []string{}, \"Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be reverse forwarded to the given host and port, or Unix socket, on the remote side.\")\n\tsshCmd.Flags().StringArrayVarP(&cmd.SendEnvVars, \"send-env\", \"\", []string{}, \"Specifies which local env variables shall be sent to the container.\")\n\tsshCmd.Flags().StringArrayVarP(&cmd.SetEnvVars, \"set-env\", \"\", []string{}, \"Specifies env variables to be set in the container.\")\n\tsshCmd.Flags().StringVar(&cmd.ForwardPortsTimeout, \"forward-ports-timeout\", \"\", \"Specifies the timeout after which the command should terminate when the ports are unused.\")\n\tsshCmd.Flags().StringVar(&cmd.Command, \"command\", \"\", \"The command to execute within the workspace\")\n\tsshCmd.Flags().StringVar(&cmd.User, \"user\", \"\", \"The user of the workspace to use\")\n\tsshCmd.Flags().StringVar(&cmd.WorkDir, \"workdir\", \"\", \"The working directory in the container\")\n\tsshCmd.Flags().BoolVar(&cmd.AgentForwarding, \"agent-forwarding\", true, \"If true forward the local ssh keys to the remote machine\")\n\tsshCmd.Flags().StringVar(&cmd.ReuseSSHAuthSock, \"reuse-ssh-auth-sock\", \"\", \"If set, the SSH_AUTH_SOCK is expected to already be available in the workspace (under /tmp using the key provided) and the connection reuses this instead of creating a new one\")\n\t_ = sshCmd.Flags().MarkHidden(\"reuse-ssh-auth-sock\")\n\tsshCmd.Flags().BoolVar(&cmd.GPGAgentForwarding, \"gpg-agent-forwarding\", false, \"If true forward the local gpg-agent to the remote machine\")\n\tsshCmd.Flags().BoolVar(&cmd.Stdio, \"stdio\", false, \"If true will tunnel connection through stdout and stdin\")\n\tsshCmd.Flags().BoolVar(&cmd.StartServices, \"start-services\", true, \"If false will not start any port-forwarding or git / docker credentials helper\")\n\tsshCmd.Flags().DurationVar(&cmd.SSHKeepAliveInterval, \"ssh-keepalive-interval\", 55*time.Second, \"How often should keepalive request be made (55s)\")\n\n\treturn sshCmd\n}\n\n// Run runs the command logic\nfunc (cmd *SSHCmd) Run(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tlog log.Logger) error {\n\t// add ssh keys to agent\n\tif devPodConfig.ContextOption(config.ContextOptionSSHAgentForwarding) == \"true\" && devPodConfig.ContextOption(config.ContextOptionSSHAddPrivateKeys) == \"true\" {\n\t\tlog.Debug(\"Adding ssh keys to agent, disable via 'devpod context set-options -o SSH_ADD_PRIVATE_KEYS=false'\")\n\t\terr := devssh.AddPrivateKeysToAgent(ctx, log)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error adding private keys to ssh-agent: %v\", err)\n\t\t}\n\t}\n\n\t// get user\n\tif cmd.User == \"\" {\n\t\tvar err error\n\t\tcmd.User, err = devssh.GetUser(client.WorkspaceConfig().ID, client.WorkspaceConfig().SSHConfigPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// set default context if needed\n\tif cmd.Context == \"\" {\n\t\tcmd.Context = devPodConfig.DefaultContext\n\t}\n\n\tworkspaceClient, ok := client.(client2.WorkspaceClient)\n\tif ok {\n\t\treturn cmd.jumpContainer(ctx, devPodConfig, workspaceClient, log)\n\t}\n\tproxyClient, ok := client.(client2.ProxyClient)\n\tif ok {\n\t\treturn cmd.startProxyTunnel(ctx, devPodConfig, proxyClient, log)\n\t}\n\tdaemonClient, ok := client.(client2.DaemonClient)\n\tif ok {\n\t\treturn cmd.jumpContainerTailscale(ctx, devPodConfig, daemonClient, log)\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *SSHCmd) jumpContainerTailscale(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.DaemonClient,\n\tlog log.Logger,\n) error {\n\tlog.Debugf(\"Starting tailscale connection\")\n\n\terr := client.CheckWorkspaceReachable(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttoolSSHClient, sshClient, err := client.SSHClients(ctx, cmd.User)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer toolSSHClient.Close()\n\tdefer sshClient.Close()\n\n\t// Forward ports if specified\n\tif len(cmd.ForwardPorts) > 0 {\n\t\treturn cmd.forwardPorts(ctx, toolSSHClient, log)\n\t}\n\n\t// Reverse forward ports if specified\n\tif len(cmd.ReverseForwardPorts) > 0 && !cmd.GPGAgentForwarding {\n\t\treturn cmd.reverseForwardPorts(ctx, toolSSHClient, log)\n\t}\n\n\tif cmd.StartServices {\n\t\tgo func() {\n\t\t\terr = startServicesDaemon(ctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\tclient,\n\t\t\t\ttoolSSHClient,\n\t\t\t\tcmd.User,\n\t\t\t\tlog,\n\t\t\t\tfalse,\n\t\t\t\tnil,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Error starting services: %v\", err)\n\t\t\t}\n\t\t}()\n\t}\n\n\t// Handle GPG agent forwarding\n\tif cmd.GPGAgentForwarding || devPodConfig.ContextOption(config.ContextOptionGPGAgentForwarding) == \"true\" {\n\t\tif gpg.IsGpgTunnelRunning(cmd.User, ctx, toolSSHClient, log) {\n\t\t\tlog.Debugf(\"[GPG] exporting already running, skipping\")\n\t\t} else if err := cmd.setupGPGAgent(ctx, toolSSHClient, log); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Handle ssh stdio mode\n\tif cmd.Stdio {\n\t\tif cmd.SSHKeepAliveInterval != DisableSSHKeepAlive {\n\t\t\tgo startSSHKeepAlive(ctx, toolSSHClient, cmd.SSHKeepAliveInterval, log)\n\t\t}\n\n\t\treturn client.DirectTunnel(ctx, os.Stdin, os.Stdout)\n\t}\n\n\t// Connect to the inner server and handle user session\n\treturn machine.RunSSHSession(\n\t\tctx,\n\t\tsshClient,\n\t\tcmd.AgentForwarding,\n\t\tcmd.Command,\n\t\tos.Stderr,\n\t)\n}\n\nfunc (cmd *SSHCmd) startProxyTunnel(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.ProxyClient,\n\tlog log.Logger,\n) error {\n\tlog.Debugf(\"Start proxy tunnel\")\n\treturn tunnel.NewTunnel(\n\t\tctx,\n\t\tfunc(ctx context.Context, stdin io.Reader, stdout io.Writer) error {\n\t\t\treturn client.Ssh(ctx, client2.SshOptions{\n\t\t\t\tUser:   cmd.User,\n\t\t\t\tStdin:  stdin,\n\t\t\t\tStdout: stdout,\n\t\t\t})\n\t\t},\n\t\tfunc(ctx context.Context, containerClient *ssh.Client) error {\n\t\t\treturn cmd.startTunnel(ctx, devPodConfig, containerClient, client, log)\n\t\t},\n\t)\n}\n\nfunc startWait(\n\tctx context.Context,\n\tclient client2.WorkspaceClient,\n\tcreate bool,\n\tlog log.Logger,\n) error {\n\tstartWaiting := time.Now()\n\tfor {\n\t\tinstanceStatus, err := client.Status(ctx, client2.StatusOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if instanceStatus == client2.StatusBusy {\n\t\t\tif time.Since(startWaiting) > time.Second*10 {\n\t\t\t\tlog.Infof(\"Waiting for workspace to come up...\")\n\t\t\t\tlog.Debugf(\"Got status %s, expected: Running\", instanceStatus)\n\t\t\t\tstartWaiting = time.Now()\n\t\t\t}\n\n\t\t\ttime.Sleep(time.Second * 2)\n\t\t\tcontinue\n\t\t} else if instanceStatus == client2.StatusStopped {\n\t\t\tif create {\n\t\t\t\t// start environment\n\t\t\t\terr = client.Start(ctx, client2.StartOptions{})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"start workspace\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"DevPod workspace is stopped\")\n\t\t\t}\n\t\t} else if instanceStatus == client2.StatusNotFound {\n\t\t\tif create {\n\t\t\t\t// create environment\n\t\t\t\terr = client.Create(ctx, client2.CreateOptions{})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"DevPod workspace wasn't found\")\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n}\n\nfunc (cmd *SSHCmd) retrieveEnVars() (map[string]string, error) {\n\tenvVars := make(map[string]string)\n\tfor _, envVar := range cmd.SendEnvVars {\n\t\tenvVarValue, exist := os.LookupEnv(envVar)\n\t\tif exist {\n\t\t\tenvVars[envVar] = envVarValue\n\t\t}\n\t}\n\tfor _, envVar := range cmd.SetEnvVars {\n\t\tparts := strings.Split(envVar, \"=\")\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid env var: %s\", envVar)\n\t\t}\n\t\tenvVars[parts[0]] = parts[1]\n\t}\n\n\treturn envVars, nil\n}\n\nfunc (cmd *SSHCmd) jumpContainer(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.WorkspaceClient,\n\tlog log.Logger,\n) error {\n\t// lock the workspace as long as we init the connection\n\terr := client.Lock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Unlock()\n\n\t// start the workspace\n\terr = startWait(ctx, client, false, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tenvVars, err := cmd.retrieveEnVars()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// tunnel to container\n\treturn tunnel.NewContainerTunnel(client, log).\n\t\tRun(ctx, func(ctx context.Context, containerClient *ssh.Client) error {\n\t\t\t// we have a connection to the container, make sure others can connect as well\n\t\t\tclient.Unlock()\n\n\t\t\t// start ssh tunnel\n\t\t\treturn cmd.startTunnel(ctx, devPodConfig, containerClient, client, log)\n\t\t}, devPodConfig, envVars)\n}\n\nfunc (cmd *SSHCmd) forwardTimeout(log log.Logger) (time.Duration, error) {\n\ttimeout := time.Duration(0)\n\tif cmd.ForwardPortsTimeout != \"\" {\n\t\ttimeout, err := time.ParseDuration(cmd.ForwardPortsTimeout)\n\t\tif err != nil {\n\t\t\treturn timeout, fmt.Errorf(\"parse forward ports timeout: %w\", err)\n\t\t}\n\n\t\tlog.Infof(\"Using port forwarding timeout of %s\", cmd.ForwardPortsTimeout)\n\t}\n\n\treturn timeout, nil\n}\n\nfunc (cmd *SSHCmd) reverseForwardPorts(\n\tctx context.Context,\n\tcontainerClient *ssh.Client,\n\tlog log.Logger,\n) error {\n\ttimeout, err := cmd.forwardTimeout(log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse forward ports timeout: %w\", err)\n\t}\n\n\terrChan := make(chan error, len(cmd.ReverseForwardPorts))\n\tfor _, portMapping := range cmd.ReverseForwardPorts {\n\t\tmapping, err := port.ParsePortSpec(portMapping)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parse port mapping: %w\", err)\n\t\t}\n\n\t\t// start the forwarding\n\t\tlog.Infof(\n\t\t\t\"Reverse forwarding local %s/%s to remote %s/%s\",\n\t\t\tmapping.Host.Protocol,\n\t\t\tmapping.Host.Address,\n\t\t\tmapping.Container.Protocol,\n\t\t\tmapping.Container.Address,\n\t\t)\n\t\tgo func(portMapping string) {\n\t\t\terr := devssh.ReversePortForward(\n\t\t\t\tctx,\n\t\t\t\tcontainerClient,\n\t\t\t\tmapping.Host.Protocol,\n\t\t\t\tmapping.Host.Address,\n\t\t\t\tmapping.Container.Protocol,\n\t\t\t\tmapping.Container.Address,\n\t\t\t\ttimeout,\n\t\t\t\tlog,\n\t\t\t)\n\t\t\tif !errors.Is(io.EOF, err) {\n\t\t\t\terrChan <- fmt.Errorf(\"error forwarding %s: %w\", portMapping, err)\n\t\t\t}\n\t\t}(portMapping)\n\t}\n\n\treturn <-errChan\n}\n\nfunc (cmd *SSHCmd) forwardPorts(\n\tctx context.Context,\n\tcontainerClient *ssh.Client,\n\tlog log.Logger,\n) error {\n\ttimeout, err := cmd.forwardTimeout(log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse forward ports timeout: %w\", err)\n\t}\n\n\terrChan := make(chan error, len(cmd.ForwardPorts))\n\tfor _, portMapping := range cmd.ForwardPorts {\n\t\tmapping, err := port.ParsePortSpec(portMapping)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parse port mapping: %w\", err)\n\t\t}\n\n\t\t// start the forwarding\n\t\tlog.Infof(\n\t\t\t\"Forwarding local %s/%s to remote %s/%s\",\n\t\t\tmapping.Host.Protocol,\n\t\t\tmapping.Host.Address,\n\t\t\tmapping.Container.Protocol,\n\t\t\tmapping.Container.Address,\n\t\t)\n\t\tgo func(portMapping string) {\n\t\t\terr := devssh.PortForward(\n\t\t\t\tctx,\n\t\t\t\tcontainerClient,\n\t\t\t\tmapping.Host.Protocol,\n\t\t\t\tmapping.Host.Address,\n\t\t\t\tmapping.Container.Protocol,\n\t\t\t\tmapping.Container.Address,\n\t\t\t\ttimeout,\n\t\t\t\tlog,\n\t\t\t)\n\t\t\tif !errors.Is(io.EOF, err) {\n\t\t\t\terrChan <- fmt.Errorf(\"error forwarding %s: %w\", portMapping, err)\n\t\t\t}\n\t\t}(portMapping)\n\t}\n\n\treturn <-errChan\n}\n\nfunc (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config, containerClient *ssh.Client, workspaceClient client2.BaseWorkspaceClient, log log.Logger) error {\n\t// check if we should forward ports\n\tif len(cmd.ForwardPorts) > 0 {\n\t\treturn cmd.forwardPorts(ctx, containerClient, log)\n\t}\n\n\t// check if we should reverse forward ports\n\tif len(cmd.ReverseForwardPorts) > 0 && !cmd.GPGAgentForwarding {\n\t\treturn cmd.reverseForwardPorts(ctx, containerClient, log)\n\t}\n\n\tif cmd.StartServices {\n\t\tconfigureDockerCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectDockerCredentials) == \"true\"\n\t\tconfigureGitCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectGitCredentials) == \"true\"\n\t\tconfigureGitSSHSignatureHelper := devPodConfig.ContextOption(config.ContextOptionGitSSHSignatureForwarding) == \"true\"\n\n\t\tgo cmd.startServices(ctx, devPodConfig, containerClient, workspaceClient.WorkspaceConfig(), configureDockerCredentials, configureGitCredentials, configureGitSSHSignatureHelper, log)\n\t}\n\t// start ssh\n\twriter := log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// check if we should do gpg agent forwarding\n\tif cmd.GPGAgentForwarding || devPodConfig.ContextOption(config.ContextOptionGPGAgentForwarding) == \"true\" {\n\t\t// Check if a forwarding is already enabled and running, in that case\n\t\t// we skip the forwarding and keep using the original one\n\t\tif gpg.IsGpgTunnelRunning(cmd.User, ctx, containerClient, log) {\n\t\t\tlog.Debugf(\"[GPG] exporting already running, skipping\")\n\t\t} else {\n\t\t\terr := cmd.setupGPGAgent(ctx, containerClient, log)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tworkdir := filepath.Join(\"/workspaces\", workspaceClient.Workspace())\n\tif cmd.WorkDir != \"\" {\n\t\tworkdir = cmd.WorkDir\n\t}\n\n\tlog.Debugf(\"Run outer container tunnel\")\n\tcommand := fmt.Sprintf(\"'%s' helper ssh-server --track-activity --stdio --workdir '%s'\", agent.ContainerDevPodHelperLocation, workdir)\n\tif cmd.ReuseSSHAuthSock != \"\" {\n\t\tlog.Debug(\"Reusing SSH_AUTH_SOCK\")\n\t\tcommand += fmt.Sprintf(\" --reuse-ssh-auth-sock=%s\", cmd.ReuseSSHAuthSock)\n\t}\n\tif cmd.Debug {\n\t\tcommand += \" --debug\"\n\t}\n\tif cmd.User != \"\" && cmd.User != \"root\" {\n\t\tcommand = fmt.Sprintf(\"su -c \\\"%s\\\" '%s'\", command, cmd.User)\n\t}\n\n\tenvVars, err := cmd.retrieveEnVars()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Traffic is coming in from the outside, we need to forward it to the container\n\tif cmd.Stdio {\n\t\treturn devssh.Run(ctx, containerClient, command, os.Stdin, os.Stdout, writer, envVars)\n\t}\n\n\treturn machine.StartSSHSession(\n\t\tctx,\n\t\tcmd.User,\n\t\tcmd.Command,\n\t\tcmd.AgentForwarding && devPodConfig.ContextOption(config.ContextOptionSSHAgentForwarding) == \"true\",\n\t\tfunc(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\tif cmd.SSHKeepAliveInterval != DisableSSHKeepAlive {\n\t\t\t\tgo startSSHKeepAlive(ctx, containerClient, cmd.SSHKeepAliveInterval, log)\n\t\t\t}\n\t\t\treturn devssh.Run(ctx, containerClient, command, stdin, stdout, stderr, envVars)\n\t\t},\n\t\twriter,\n\t)\n}\n\nfunc (cmd *SSHCmd) startServices(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tcontainerClient *ssh.Client,\n\tworkspace *provider.Workspace,\n\tconfigureDockerCredentials, configureGitCredentials, configureGitSSHSignatureHelper bool,\n\tlog log.Logger,\n) {\n\tif cmd.User != \"\" {\n\t\terr := tunnel.RunServices(\n\t\t\tctx,\n\t\t\tdevPodConfig,\n\t\t\tcontainerClient,\n\t\t\tcmd.User,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tworkspace,\n\t\t\tconfigureDockerCredentials,\n\t\t\tconfigureGitCredentials,\n\t\t\tconfigureGitSSHSignatureHelper,\n\t\t\tlog,\n\t\t)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error running credential server: %v\", err)\n\t\t}\n\t}\n}\n\n// setupGPGAgent will forward a local gpg-agent into the remote container\n// this works by using cmd/agent/workspace/setup_gpg\nfunc (cmd *SSHCmd) setupGPGAgent(\n\tctx context.Context,\n\tcontainerClient *ssh.Client,\n\tlog log.Logger,\n) error {\n\tlog.Debugf(\"[GPG] exporting gpg owner trust from host\")\n\townerTrustExport, err := gpg.GetHostOwnerTrust()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"export local ownertrust from GPG: %w\", err)\n\t}\n\townerTrustArgument := base64.StdEncoding.EncodeToString(ownerTrustExport)\n\n\tlog.Debugf(\"[GPG] detecting gpg-agent socket path on host\")\n\t// Detect local agent extra socket, this will be forwarded to the remote and\n\t// symlinked in multiple paths\n\tgpgExtraSocketBytes, err := exec.Command(\"gpgconf\", []string{\"--list-dir\", \"agent-extra-socket\"}...).\n\t\tOutput()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgpgExtraSocketPath := strings.TrimSpace(string(gpgExtraSocketBytes))\n\tlog.Debugf(\"[GPG] detected gpg-agent socket path %s\", gpgExtraSocketPath)\n\n\tgitGpgKey, err := exec.Command(\"git\", []string{\"config\", \"user.signingKey\"}...).Output()\n\tif err != nil {\n\t\tlog.Debugf(\"[GPG] no git signkey detected, skipping\")\n\t} else {\n\t\tlog.Debugf(\"[GPG] detected git sign key %s\", gitGpgKey)\n\t}\n\n\tcmd.ReverseForwardPorts = append(cmd.ReverseForwardPorts, gpgExtraSocketPath)\n\n\t// Now we forward the agent socket to the remote, and setup remote gpg to use it\n\tforwardAgent := []string{\n\t\tagent.ContainerDevPodHelperLocation,\n\t\t\"agent\",\n\t\t\"workspace\",\n\t\t\"setup-gpg\",\n\t\t\"--ownertrust\",\n\t\townerTrustArgument,\n\t\t\"--socketpath\",\n\t\tgpgExtraSocketPath,\n\t}\n\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tforwardAgent = append(forwardAgent, \"--debug\")\n\t}\n\n\tif len(gitGpgKey) > 0 {\n\t\tgitKey := strings.TrimSpace(string(gitGpgKey))\n\t\tforwardAgent = append(forwardAgent, \"--gitkey\")\n\t\tforwardAgent = append(forwardAgent, fmt.Sprintf(\"'%s'\", gitKey))\n\t}\n\n\tcommand := strings.Join(forwardAgent, \" \")\n\tif cmd.User != \"\" && cmd.User != \"root\" {\n\t\tcommand = fmt.Sprintf(\"su -c \\\"%s\\\" '%s'\", command, cmd.User)\n\t}\n\n\tlog.Debugf(\n\t\t\"[GPG] start reverse forward of gpg-agent socket %s, keeping connection open\",\n\t\tgpgExtraSocketPath,\n\t)\n\n\tgo func() {\n\t\tlog.Error(cmd.reverseForwardPorts(ctx, containerClient, log))\n\t}()\n\n\twriter := log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\terr = devssh.Run(ctx, containerClient, command, nil, writer, writer, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"run gpg agent setup command: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc startSSHKeepAlive(ctx context.Context, client *ssh.Client, interval time.Duration, log log.Logger) {\n\tticker := time.NewTicker(interval)\n\tdefer ticker.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\t_, _, err := client.SendRequest(\"keepalive@openssh.com\", true, nil)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Failed to send keepalive: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc startServicesDaemon(ctx context.Context, devPodConfig *config.Config, client client2.DaemonClient, sshClient *ssh.Client, user string, log log.Logger, forwardPorts bool, extraPorts []string) error {\n\tworkspace, err := daemon.NewLocalClient(client.Provider()).GetWorkspace(ctx, client.WorkspaceConfig().UID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfigureDockerCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectDockerCredentials) == \"true\"\n\tconfigureGitCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectGitCredentials) == \"true\"\n\tconfigureGitSSHSignatureHelper := devPodConfig.ContextOption(config.ContextOptionGitSSHSignatureForwarding) == \"true\"\n\n\tif workspace != nil && workspace.Status.Instance != nil && workspace.Status.Instance.CredentialForwarding != nil {\n\t\tif workspace.Status.Instance.CredentialForwarding.Docker != nil {\n\t\t\tconfigureDockerCredentials = !workspace.Status.Instance.CredentialForwarding.Docker.Disabled\n\t\t}\n\t\tif workspace.Status.Instance.CredentialForwarding.Git != nil {\n\t\t\tconfigureGitCredentials = !workspace.Status.Instance.CredentialForwarding.Git.Disabled\n\t\t\tconfigureGitSSHSignatureHelper = !workspace.Status.Instance.CredentialForwarding.Git.Disabled\n\t\t}\n\t}\n\n\tif user != \"\" {\n\t\treturn tunnel.RunServices(\n\t\t\tctx,\n\t\t\tdevPodConfig,\n\t\t\tsshClient,\n\t\t\tuser,\n\t\t\tforwardPorts,\n\t\t\textraPorts,\n\t\t\tnil,\n\t\t\tclient.WorkspaceConfig(),\n\t\t\tconfigureDockerCredentials,\n\t\t\tconfigureGitCredentials,\n\t\t\tconfigureGitSSHSignatureHelper,\n\t\t\tlog,\n\t\t)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/status.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StatusCmd holds the cmd flags\ntype StatusCmd struct {\n\t*flags.GlobalFlags\n\tclient2.StatusOptions\n\n\tOutput  string\n\tTimeout string\n}\n\n// NewStatusCmd creates a new command\nfunc NewStatusCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StatusCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstatusCmd := &cobra.Command{\n\t\tUse:   \"status [flags] [workspace-path|workspace-name]\",\n\t\tShort: \"Shows the status of a workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\t_, err := clientimplementation.DecodeOptionsFromEnv(clientimplementation.DevPodFlagsStatus, &cmd.StatusOptions)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"decode status options: %w\", err)\n\t\t\t}\n\n\t\t\tctx := cobraCmd.Context()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlogger := log.Default.ErrorStreamOnly()\n\t\t\tclient, err := workspace2.Get(ctx, devPodConfig, args, false, cmd.Owner, false, logger)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, client, logger)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\tstatusCmd.Flags().BoolVar(&cmd.ContainerStatus, \"container-status\", true, \"If enabled shows the workspace container status as well\")\n\tstatusCmd.Flags().StringVar(&cmd.Output, \"output\", \"plain\", \"Status shows the workspace status\")\n\tstatusCmd.Flags().StringVar(&cmd.Timeout, \"timeout\", \"30s\", \"The timeout to wait until the status can be retrieved\")\n\treturn statusCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StatusCmd) Run(ctx context.Context, client client2.BaseWorkspaceClient, log log.Logger) error {\n\t// parse timeout\n\tif cmd.Timeout != \"\" {\n\t\tduration, err := time.ParseDuration(cmd.Timeout)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"parse --timeout\")\n\t\t}\n\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, duration)\n\t\tdefer cancel()\n\t}\n\n\t// get instance status\n\tinstanceStatus, err := client.Status(ctx, cmd.StatusOptions)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.Output == \"plain\" {\n\t\tif instanceStatus == client2.StatusStopped {\n\t\t\tlog.Infof(\"Workspace '%s' is '%s', you can start it via 'devpod up %s'\", client.Workspace(), instanceStatus, client.Workspace())\n\t\t} else if instanceStatus == client2.StatusBusy {\n\t\t\tlog.Infof(\"Workspace '%s' is '%s', which means its currently unaccessible. This is usually resolved by waiting a couple of minutes\", client.Workspace(), instanceStatus)\n\t\t} else if instanceStatus == client2.StatusNotFound {\n\t\t\tlog.Infof(\"Workspace '%s' is '%s', you can create it via 'devpod up %s'\", client.Workspace(), instanceStatus, client.Workspace())\n\t\t} else {\n\t\t\tlog.Infof(\"Workspace '%s' is '%s'\", client.Workspace(), instanceStatus)\n\t\t}\n\t} else if cmd.Output == \"json\" {\n\t\tout, err := json.Marshal(&client2.WorkspaceStatus{\n\t\t\tID:       client.Workspace(),\n\t\t\tContext:  client.Context(),\n\t\t\tProvider: client.Provider(),\n\t\t\tState:    string(instanceStatus),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Print(string(out))\n\t} else {\n\t\treturn fmt.Errorf(\"unexpected output format, choose either json or plain. Got %s\", cmd.Output)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/stop.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// StopCmd holds the destroy cmd flags\ntype StopCmd struct {\n\t*flags.GlobalFlags\n\tclient2.StopOptions\n}\n\n// NewStopCmd creates a new destroy command\nfunc NewStopCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &StopCmd{\n\t\tGlobalFlags: flags,\n\t}\n\tstopCmd := &cobra.Command{\n\t\tUse:     \"stop [flags] [workspace-path|workspace-name]\",\n\t\tAliases: []string{\"down\"},\n\t\tShort:   \"Stops an existing workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tctx := cobraCmd.Context()\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = clientimplementation.DecodePlatformOptionsFromEnv(&cmd.StopOptions.Platform)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"decode platform options: %w\", err)\n\t\t\t}\n\n\t\t\tclient, err := workspace2.Get(ctx, devPodConfig, args, false, cmd.Owner, false, log.Default)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, client)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t}\n\n\treturn stopCmd\n}\n\n// Run runs the command logic\nfunc (cmd *StopCmd) Run(ctx context.Context, devPodConfig *config.Config, client client2.BaseWorkspaceClient) error {\n\t// lock workspace\n\tif !cmd.Platform.Enabled {\n\t\terr := client.Lock(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer client.Unlock()\n\t}\n\n\t// get instance status\n\tinstanceStatus, err := client.Status(ctx, client2.StatusOptions{})\n\tif err != nil {\n\t\treturn err\n\t} else if instanceStatus != client2.StatusRunning {\n\t\treturn fmt.Errorf(\"cannot stop workspace because it is '%s'\", instanceStatus)\n\t}\n\n\t// stop if single machine provider\n\twasStopped, err := cmd.stopSingleMachine(ctx, client, devPodConfig)\n\tif err != nil {\n\t\treturn err\n\t} else if wasStopped {\n\t\treturn nil\n\t}\n\n\t// stop environment\n\terr = client.Stop(ctx, client2.StopOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *StopCmd) stopSingleMachine(ctx context.Context, client client2.BaseWorkspaceClient, devPodConfig *config.Config) (bool, error) {\n\t// check if single machine\n\tsingleMachineName := workspace2.SingleMachineName(devPodConfig, client.Provider(), log.Default)\n\tif !devPodConfig.Current().IsSingleMachine(client.Provider()) || client.WorkspaceConfig().Machine.ID != singleMachineName {\n\t\treturn false, nil\n\t}\n\n\t// try to find other workspace with same machine\n\tworkspaces, err := workspace2.List(ctx, devPodConfig, false, cmd.Owner, log.Default)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"list workspaces\")\n\t}\n\n\t// loop workspaces\n\tfoundOther := false\n\tfor _, workspace := range workspaces {\n\t\tif workspace.ID == client.Workspace() || workspace.Machine.ID != singleMachineName {\n\t\t\tcontinue\n\t\t}\n\n\t\tfoundOther = true\n\t\tbreak\n\t}\n\tif foundOther {\n\t\treturn false, nil\n\t}\n\n\t// if we haven't found another workspace on this machine, delete the whole machine\n\tmachineClient, err := workspace2.GetMachine(devPodConfig, []string{singleMachineName}, log.Default)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"get machine\")\n\t}\n\n\t// stop the machine\n\terr = machineClient.Stop(ctx, client2.StopOptions{})\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"delete machine\")\n\t}\n\n\tlog.Default.Donef(\"Successfully stopped workspace '%s'\", client.Workspace())\n\treturn true, nil\n}\n"
  },
  {
    "path": "cmd/troubleshoot.go",
    "content": "package cmd\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/cmd/completion\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tpkgprovider \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/spf13/cobra\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\ntype TroubleshootCmd struct {\n\t*flags.GlobalFlags\n}\n\nfunc NewTroubleshootCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &TroubleshootCmd{\n\t\tGlobalFlags: flags,\n\t}\n\ttroubleshootCmd := &cobra.Command{\n\t\tUse:   \"troubleshoot [workspace-path|workspace-name]\",\n\t\tShort: \"Prints the workspaces troubleshooting information\",\n\t\tRun: func(cobraCmd *cobra.Command, args []string) {\n\t\t\tcmd.Run(cobraCmd.Context(), args)\n\t\t},\n\t\tValidArgsFunction: func(rootCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completion.GetWorkspaceSuggestions(rootCmd, cmd.Context, cmd.Provider, args, toComplete, cmd.Owner, log.Default)\n\t\t},\n\t\tHidden: true,\n\t}\n\n\treturn troubleshootCmd\n}\n\nfunc (cmd *TroubleshootCmd) Run(ctx context.Context, args []string) {\n\t// (ThomasK33): We're creating an anonymous struct here, so that we group\n\t// everything and then we can serialize it in one call.\n\tvar info struct {\n\t\tCLIVersion            string\n\t\tConfig                *config.Config\n\t\tProviders             map[string]provider.ProviderWithDefault\n\t\tDevPodProInstances    []DevPodProInstance\n\t\tWorkspace             *pkgprovider.Workspace\n\t\tWorkspaceStatus       client.Status\n\t\tWorkspaceTroubleshoot *managementv1.DevPodWorkspaceInstanceTroubleshoot\n\t\tDaemonStatus          *daemon.Status\n\n\t\tErrors []PrintableError `json:\",omitempty\"`\n\t}\n\tinfo.CLIVersion = version.GetVersion()\n\n\t// (ThomasK33): We are defering the printing here, as we want to make sure\n\t// that we will always print, even in the case of a panic.\n\tdefer func() {\n\t\tout, err := json.MarshalIndent(info, \"\", \"  \")\n\t\tif err == nil {\n\t\t\tfmt.Print(string(out))\n\t\t} else {\n\t\t\tfmt.Print(err)\n\t\t\tfmt.Print(info)\n\t\t}\n\t}()\n\n\t// NOTE(ThomasK33): Since this is a troubleshooting command, we want to\n\t// collect as many relevant information as possible.\n\t// For this reason we may not return with an error early.\n\t// We are fine with a partially filled TrbouelshootInfo struct, as this\n\t// already provides us with more information then before.\n\tvar err error\n\tinfo.Config, err = config.LoadConfig(cmd.Context, cmd.Provider)\n\tif err != nil {\n\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"load config: %w\", err)})\n\t\t// (ThomasK33): It's fine to return early here, as without the devpod config\n\t\t// we cannot do any further troubleshooting.\n\t\treturn\n\t}\n\n\tlogger := log.Default.ErrorStreamOnly()\n\tinfo.Providers, err = collectProviders(info.Config, logger)\n\tif err != nil {\n\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"collect providers: %w\", err)})\n\t}\n\n\tinfo.DevPodProInstances, err = collectPlatformInfo(info.Config, logger)\n\tif err != nil {\n\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"collect platform info: %w\", err)})\n\t}\n\n\tworkspaceClient, err := workspace.Get(ctx, info.Config, args, false, cmd.Owner, false, logger)\n\tif err == nil {\n\t\tinfo.Workspace = workspaceClient.WorkspaceConfig()\n\t\tinfo.WorkspaceStatus, err = workspaceClient.Status(ctx, client.StatusOptions{})\n\t\tif err != nil {\n\t\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"workspace status: %w\", err)})\n\t\t}\n\n\t\tif info.Workspace.Pro != nil {\n\t\t\t// (ThomasK33): As there can be multiple pro instances configured\n\t\t\t// we want to iterate over all and find the host that this workspace belongs to.\n\t\t\tvar proInstance DevPodProInstance\n\n\t\t\tfor _, instance := range info.DevPodProInstances {\n\t\t\t\tif instance.ProviderName == info.Workspace.Provider.Name {\n\t\t\t\t\tproInstance = instance\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif proInstance.ProviderName != \"\" {\n\t\t\t\tinfo.WorkspaceTroubleshoot, err = collectProWorkspaceInfo(\n\t\t\t\t\tctx,\n\t\t\t\t\tinfo.Config,\n\t\t\t\t\tproInstance.Host,\n\t\t\t\t\tlogger,\n\t\t\t\t\tinfo.Workspace.UID,\n\t\t\t\t\tinfo.Workspace.Pro.Project,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"collect pro workspace info: %w\", err)})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"get workspace: %w\", err)})\n\t}\n\n\tdaemonClient, ok := workspaceClient.(client.DaemonClient)\n\tif ok {\n\t\tstatus, err := daemon.NewLocalClient(daemonClient.Provider()).Status(ctx, true)\n\t\tif err != nil {\n\t\t\tinfo.Errors = append(info.Errors, PrintableError{fmt.Errorf(\"get daemon status: %w\", err)})\n\t\t} else {\n\t\t\tinfo.DaemonStatus = &status\n\t\t}\n\t}\n}\n\n// collectProWorkspaceInfo collects troubleshooting information for a DevPod Pro instance.\n// It initializes a client from the host, finds the workspace instance in the project, and retrieves\n// troubleshooting information using the management client.\nfunc collectProWorkspaceInfo(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\thost string,\n\tlogger log.Logger,\n\tworkspaceUID string,\n\tproject string,\n) (*managementv1.DevPodWorkspaceInstanceTroubleshoot, error) {\n\tbaseClient, err := platform.InitClientFromHost(ctx, devPodConfig, host, logger)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"init client from host: %w\", err)\n\t}\n\n\tworkspace, err := platform.FindInstanceInProject(ctx, baseClient, workspaceUID, project)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if workspace == nil {\n\t\treturn nil, fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"management: %w\", err)\n\t}\n\n\ttroubleshoot, err := managementClient.\n\t\tLoft().\n\t\tManagementV1().\n\t\tDevPodWorkspaceInstances(workspace.Namespace).\n\t\tTroubleshoot(ctx, workspace.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"troubleshoot: %w\", err)\n\t}\n\n\treturn troubleshoot, nil\n}\n\n// collectProviders collects and configures providers based on the given devPodConfig.\n// It returns a map of providers with their default settings and an error if any occurs.\nfunc collectProviders(devPodConfig *config.Config, logger log.Logger) (map[string]provider.ProviderWithDefault, error) {\n\tproviders, err := workspace.LoadAllProviders(devPodConfig, logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfiguredProviders := devPodConfig.Current().Providers\n\tif configuredProviders == nil {\n\t\tconfiguredProviders = map[string]*config.ProviderConfig{}\n\t}\n\n\tretMap := map[string]provider.ProviderWithDefault{}\n\tfor k, entry := range providers {\n\t\tif configuredProviders[entry.Config.Name] == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tsrcOptions := provider.MergeDynamicOptions(entry.Config.Options, configuredProviders[entry.Config.Name].DynamicOptions)\n\t\tentry.Config.Options = srcOptions\n\t\tretMap[k] = provider.ProviderWithDefault{\n\t\t\tProviderWithOptions: *entry,\n\t\t\tDefault:             devPodConfig.Current().DefaultProvider == entry.Config.Name,\n\t\t}\n\t}\n\n\treturn retMap, nil\n}\n\ntype DevPodProInstance struct {\n\tHost         string\n\tProviderName string\n\tVersion      string\n}\n\n// collectPlatformInfo collects information about all platform instances in a given devPodConfig.\n// It iterates over the pro instances, retrieves their versions, and appends them to the ProInstance slice.\n// Any errors encountered during this process are combined and returned along with the ProInstance slice.\n// This means that even when an error value is returned, the pro instance slice will contain valid values.\nfunc collectPlatformInfo(devPodConfig *config.Config, logger log.Logger) ([]DevPodProInstance, error) {\n\tproInstanceList, err := workspace.ListProInstances(devPodConfig, logger)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list pro instances: %w\", err)\n\t}\n\n\tvar proInstances []DevPodProInstance\n\tvar combinedErrs error\n\n\tfor _, proInstance := range proInstanceList {\n\t\tversion, err := platform.GetProInstanceDevPodVersion(&pkgprovider.ProInstance{Host: proInstance.Host})\n\t\tcombinedErrs = errors.Join(combinedErrs, err)\n\t\tproInstances = append(proInstances, DevPodProInstance{\n\t\t\tHost:         proInstance.Host,\n\t\t\tProviderName: proInstance.Provider,\n\t\t\tVersion:      version,\n\t\t})\n\t}\n\n\treturn proInstances, combinedErrs\n}\n\n// (ThomasK33): Little type embedding here, so that we can\n// serialize the error strings when invoking json.Marshal.\ntype PrintableError struct{ error }\n\nfunc (p PrintableError) MarshalJSON() ([]byte, error) { return json.Marshal(p.Error()) }\n"
  },
  {
    "path": "cmd/up.go",
    "content": "package cmd\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/signal\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/blang/semver\"\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/ide/fleet\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jetbrains\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jupyter\"\n\t\"github.com/loft-sh/devpod/pkg/ide/openvscode\"\n\t\"github.com/loft-sh/devpod/pkg/ide/rstudio\"\n\t\"github.com/loft-sh/devpod/pkg/ide/vscode\"\n\t\"github.com/loft-sh/devpod/pkg/ide/zed\"\n\topen2 \"github.com/loft-sh/devpod/pkg/open\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/port\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/devpod/pkg/telemetry\"\n\t\"github.com/loft-sh/devpod/pkg/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\tworkspace2 \"github.com/loft-sh/devpod/pkg/workspace\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/skratchdot/open-golang/open\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// UpCmd holds the up cmd flags\ntype UpCmd struct {\n\tprovider2.CLIOptions\n\t*flags.GlobalFlags\n\n\tMachine string\n\n\tProviderOptions []string\n\n\tConfigureSSH       bool\n\tGPGAgentForwarding bool\n\tOpenIDE            bool\n\tReconfigure        bool\n\n\tSSHConfigPath string\n\n\tDotfilesSource        string\n\tDotfilesScript        string\n\tDotfilesScriptEnv     []string // Key=Value to pass to install script\n\tDotfilesScriptEnvFile []string // Paths to files containing Key=Value pairs to pass to install script\n}\n\n// NewUpCmd creates a new up command\nfunc NewUpCmd(f *flags.GlobalFlags) *cobra.Command {\n\tcmd := &UpCmd{\n\t\tGlobalFlags: f,\n\t}\n\tupCmd := &cobra.Command{\n\t\tUse:   \"up [flags] [workspace-path|workspace-name]\",\n\t\tShort: \"Starts a new workspace\",\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tdevPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif devPodConfig.ContextOption(config.ContextOptionSSHStrictHostKeyChecking) == \"true\" {\n\t\t\t\tcmd.StrictHostKeyChecking = true\n\t\t\t}\n\n\t\t\tctx, cancel := WithSignals(cobraCmd.Context())\n\t\t\tdefer cancel()\n\n\t\t\tclient, logger, err := cmd.prepareClient(ctx, devPodConfig, args)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"prepare workspace client: %w\", err)\n\t\t\t}\n\t\t\ttelemetry.CollectorCLI.SetClient(client)\n\n\t\t\treturn cmd.Run(ctx, devPodConfig, client, args, logger)\n\t\t},\n\t}\n\tupCmd.Flags().BoolVar(&cmd.ConfigureSSH, \"configure-ssh\", true, \"If true will configure the ssh config to include the DevPod workspace\")\n\tupCmd.Flags().BoolVar(&cmd.GPGAgentForwarding, \"gpg-agent-forwarding\", false, \"If true forward the local gpg-agent to the DevPod workspace\")\n\tupCmd.Flags().StringVar(&cmd.SSHConfigPath, \"ssh-config\", \"\", \"The path to the ssh config to modify, if empty will use ~/.ssh/config\")\n\tupCmd.Flags().StringVar(&cmd.DotfilesSource, \"dotfiles\", \"\", \"The path or url to the dotfiles to use in the container\")\n\tupCmd.Flags().StringVar(&cmd.DotfilesScript, \"dotfiles-script\", \"\", \"The path in dotfiles directory to use to install the dotfiles, if empty will try to guess\")\n\tupCmd.Flags().StringSliceVar(&cmd.DotfilesScriptEnv, \"dotfiles-script-env\", []string{}, \"Extra environment variables to put into the dotfiles install script. E.g. MY_ENV_VAR=MY_VALUE\")\n\tupCmd.Flags().StringSliceVar(&cmd.DotfilesScriptEnvFile, \"dotfiles-script-env-file\", []string{}, \"The path to files containing environment variables to set for the dotfiles install script\")\n\tupCmd.Flags().StringArrayVar(&cmd.IDEOptions, \"ide-option\", []string{}, \"IDE option in the form KEY=VALUE\")\n\tupCmd.Flags().StringVar(&cmd.DevContainerImage, \"devcontainer-image\", \"\", \"The container image to use, this will override the devcontainer.json value in the project\")\n\tupCmd.Flags().StringVar(&cmd.DevContainerPath, \"devcontainer-path\", \"\", \"The path to the devcontainer.json relative to the project\")\n\tupCmd.Flags().StringArrayVar(&cmd.ProviderOptions, \"provider-option\", []string{}, \"Provider option in the form KEY=VALUE\")\n\tupCmd.Flags().BoolVar(&cmd.Reconfigure, \"reconfigure\", false, \"Reconfigure the options for this workspace. Only supported in DevPod Pro right now.\")\n\tupCmd.Flags().BoolVar(&cmd.Recreate, \"recreate\", false, \"If true will remove any existing containers and recreate them\")\n\tupCmd.Flags().BoolVar(&cmd.Reset, \"reset\", false, \"If true will remove any existing containers including sources, and recreate them\")\n\tupCmd.Flags().StringSliceVar(&cmd.PrebuildRepositories, \"prebuild-repository\", []string{}, \"Docker repository that hosts devpod prebuilds for this workspace\")\n\tupCmd.Flags().StringArrayVar(&cmd.WorkspaceEnv, \"workspace-env\", []string{}, \"Extra env variables to put into the workspace. E.g. MY_ENV_VAR=MY_VALUE\")\n\tupCmd.Flags().StringSliceVar(&cmd.WorkspaceEnvFile, \"workspace-env-file\", []string{}, \"The path to files containing a list of extra env variables to put into the workspace. E.g. MY_ENV_VAR=MY_VALUE\")\n\tupCmd.Flags().StringArrayVar(&cmd.InitEnv, \"init-env\", []string{}, \"Extra env variables to inject during the initialization of the workspace. E.g. MY_ENV_VAR=MY_VALUE\")\n\tupCmd.Flags().StringVar(&cmd.ID, \"id\", \"\", \"The id to use for the workspace\")\n\tupCmd.Flags().StringVar(&cmd.Machine, \"machine\", \"\", \"The machine to use for this workspace. The machine needs to exist beforehand or the command will fail. If the workspace already exists, this option has no effect\")\n\tupCmd.Flags().StringVar(&cmd.IDE, \"ide\", \"\", \"The IDE to open the workspace in. If empty will use vscode locally or in browser\")\n\tupCmd.Flags().BoolVar(&cmd.OpenIDE, \"open-ide\", true, \"If this is false and an IDE is configured, DevPod will only install the IDE server backend, but not open it\")\n\tupCmd.Flags().Var(&cmd.GitCloneStrategy, \"git-clone-strategy\", \"The git clone strategy DevPod uses to checkout git based workspaces. Can be full (default), blobless, treeless or shallow\")\n\tupCmd.Flags().BoolVar(&cmd.GitCloneRecursiveSubmodules, \"git-clone-recursive-submodules\", false, \"If true will clone git submodule repositories recursively\")\n\tupCmd.Flags().StringVar(&cmd.GitSSHSigningKey, \"git-ssh-signing-key\", \"\", \"The ssh key to use when signing git commits. Used to explicitly setup DevPod's ssh signature forwarding with given key. Should be same format as value of `git config user.signingkey`\")\n\tupCmd.Flags().StringVar(&cmd.FallbackImage, \"fallback-image\", \"\", \"The fallback image to use if no devcontainer configuration has been detected\")\n\tupCmd.Flags().BoolVar(&cmd.DisableDaemon, \"disable-daemon\", false, \"If enabled, will not install a daemon into the target machine to track activity\")\n\tupCmd.Flags().StringVar(&cmd.Source, \"source\", \"\", \"Optional source for the workspace. E.g. git:https://github.com/my-org/my-repo\")\n\n\t// testing\n\tupCmd.Flags().StringVar(&cmd.DaemonInterval, \"daemon-interval\", \"\", \"TESTING ONLY\")\n\t_ = upCmd.Flags().MarkHidden(\"daemon-interval\")\n\tupCmd.Flags().BoolVar(&cmd.ForceDockerless, \"force-dockerless\", false, \"TESTING ONLY\")\n\t_ = upCmd.Flags().MarkHidden(\"force-dockerless\")\n\treturn upCmd\n}\n\n// Run runs the command logic\nfunc (cmd *UpCmd) Run(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\targs []string,\n\tlog log.Logger,\n) error {\n\t// a reset implies a recreate\n\tif cmd.Reset {\n\t\tcmd.Recreate = true\n\t}\n\n\t// check if we are a browser IDE and need to reuse the SSH_AUTH_SOCK\n\ttargetIDE := client.WorkspaceConfig().IDE.Name\n\t// Check override\n\tif cmd.IDE != \"\" {\n\t\ttargetIDE = cmd.IDE\n\t}\n\tif !cmd.Platform.Enabled && ide.ReusesAuthSock(targetIDE) {\n\t\tcmd.SSHAuthSockID = util.RandStringBytes(10)\n\t\tlog.Debug(\"Reusing SSH_AUTH_SOCK\", cmd.SSHAuthSockID)\n\t} else if cmd.Platform.Enabled && ide.ReusesAuthSock(targetIDE) {\n\t\tlog.Debug(\"Reusing SSH_AUTH_SOCK is not supported with platform mode, consider launching the IDE from the platform UI\")\n\t}\n\n\t// run devpod agent up\n\tresult, err := cmd.devPodUp(ctx, devPodConfig, client, log)\n\tif err != nil {\n\t\treturn err\n\t} else if result == nil {\n\t\treturn fmt.Errorf(\"didn't receive a result back from agent\")\n\t} else if cmd.Platform.Enabled {\n\t\treturn nil\n\t}\n\n\t// get user from result\n\tuser := config2.GetRemoteUser(result)\n\n\tvar workdir string\n\tif result.MergedConfig != nil && result.MergedConfig.WorkspaceFolder != \"\" {\n\t\tworkdir = result.MergedConfig.WorkspaceFolder\n\t}\n\tif client.WorkspaceConfig().Source.GitSubPath != \"\" {\n\t\tresult.SubstitutionContext.ContainerWorkspaceFolder = filepath.Join(result.SubstitutionContext.ContainerWorkspaceFolder, client.WorkspaceConfig().Source.GitSubPath)\n\t\tworkdir = result.SubstitutionContext.ContainerWorkspaceFolder\n\t}\n\n\t// configure container ssh\n\tif cmd.ConfigureSSH {\n\t\tdevPodHome := \"\"\n\t\tenvDevPodHome, ok := os.LookupEnv(\"DEVPOD_HOME\")\n\t\tif ok {\n\t\t\tdevPodHome = envDevPodHome\n\t\t}\n\t\tsetupGPGAgentForwarding := cmd.GPGAgentForwarding || devPodConfig.ContextOption(config.ContextOptionGPGAgentForwarding) == \"true\"\n\n\t\terr = configureSSH(client, cmd.SSHConfigPath, user, workdir, setupGPGAgentForwarding, devPodHome)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tlog.Infof(\"Run 'ssh %s.devpod' to ssh into the devcontainer\", client.Workspace())\n\t}\n\n\t// setup git ssh signature\n\tif cmd.GitSSHSigningKey != \"\" {\n\t\terr = setupGitSSHSignature(cmd.GitSSHSigningKey, client, log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setup dotfiles in the container\n\terr = setupDotfiles(cmd.DotfilesSource, cmd.DotfilesScript, cmd.DotfilesScriptEnvFile, cmd.DotfilesScriptEnv, client, devPodConfig, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// open ide\n\tif cmd.OpenIDE {\n\t\tideConfig := client.WorkspaceConfig().IDE\n\t\tswitch ideConfig.Name {\n\t\tcase string(config.IDEVSCode):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorStable,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDEVSCodeInsiders):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorInsiders,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDECursor):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorCursor,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDECodium):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorCodium,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDEPositron):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorPositron,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDEWindsurf):\n\t\t\treturn vscode.Open(\n\t\t\t\tctx,\n\t\t\t\tclient.Workspace(),\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tvscode.Options.GetValue(ideConfig.Options, vscode.OpenNewWindow) == \"true\",\n\t\t\t\tvscode.FlavorWindsurf,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDEOpenVSCode):\n\t\t\treturn startVSCodeInBrowser(\n\t\t\t\tcmd.GPGAgentForwarding,\n\t\t\t\tctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\tclient,\n\t\t\t\tresult.SubstitutionContext.ContainerWorkspaceFolder,\n\t\t\t\tuser,\n\t\t\t\tideConfig.Options,\n\t\t\t\tcmd.SSHAuthSockID,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDERustRover):\n\t\t\treturn jetbrains.NewRustRoverServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEGoland):\n\t\t\treturn jetbrains.NewGolandServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEPyCharm):\n\t\t\treturn jetbrains.NewPyCharmServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEPhpStorm):\n\t\t\treturn jetbrains.NewPhpStorm(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEIntellij):\n\t\t\treturn jetbrains.NewIntellij(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDECLion):\n\t\t\treturn jetbrains.NewCLionServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDERider):\n\t\t\treturn jetbrains.NewRiderServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDERubyMine):\n\t\t\treturn jetbrains.NewRubyMineServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEWebStorm):\n\t\t\treturn jetbrains.NewWebStormServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEDataSpell):\n\t\t\treturn jetbrains.NewDataSpellServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())\n\t\tcase string(config.IDEFleet):\n\t\t\treturn startFleet(ctx, client, log)\n\t\tcase string(config.IDEZed):\n\t\t\treturn zed.Open(ctx, ideConfig.Options, config2.GetRemoteUser(result), result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace(), log)\n\t\tcase string(config.IDEJupyterNotebook):\n\t\t\treturn startJupyterNotebookInBrowser(\n\t\t\t\tcmd.GPGAgentForwarding,\n\t\t\t\tctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\tclient,\n\t\t\t\tuser,\n\t\t\t\tideConfig.Options,\n\t\t\t\tcmd.SSHAuthSockID,\n\t\t\t\tlog,\n\t\t\t)\n\t\tcase string(config.IDERStudio):\n\t\t\treturn startRStudioInBrowser(\n\t\t\t\tcmd.GPGAgentForwarding,\n\t\t\t\tctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\tclient,\n\t\t\t\tuser,\n\t\t\t\tideConfig.Options,\n\t\t\t\tcmd.SSHAuthSockID,\n\t\t\t\tlog,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (cmd *UpCmd) devPodUp(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tlog log.Logger,\n) (*config2.Result, error) {\n\tvar err error\n\n\t// only lock if we are not in platform mode\n\tif !cmd.Platform.Enabled {\n\t\terr := client.Lock(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer client.Unlock()\n\t}\n\n\t// get result\n\tvar result *config2.Result\n\n\tswitch client := client.(type) {\n\tcase client2.WorkspaceClient:\n\t\tresult, err = cmd.devPodUpMachine(ctx, devPodConfig, client, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase client2.ProxyClient:\n\t\tresult, err = cmd.devPodUpProxy(ctx, client, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase client2.DaemonClient:\n\t\tresult, err = cmd.devPodUpDaemon(ctx, client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported client type: %T\", client)\n\t}\n\n\t// save result to file\n\terr = provider2.SaveWorkspaceResult(client.WorkspaceConfig(), result)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"save workspace result: %w\", err)\n\t}\n\n\treturn result, nil\n}\n\nfunc (cmd *UpCmd) devPodUpProxy(\n\tctx context.Context,\n\tclient client2.ProxyClient,\n\tlog log.Logger,\n) (*config2.Result, error) {\n\t// create pipes\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\n\t// start machine on stdio\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// create up command\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tdefer log.Debugf(\"Done executing up command\")\n\t\tdefer cancel()\n\n\t\t// build devpod up options\n\t\tworkspace := client.WorkspaceConfig()\n\t\tbaseOptions := cmd.CLIOptions\n\t\tbaseOptions.ID = workspace.ID\n\t\tbaseOptions.DevContainerPath = workspace.DevContainerPath\n\t\tbaseOptions.DevContainerImage = workspace.DevContainerImage\n\t\tbaseOptions.IDE = workspace.IDE.Name\n\t\tbaseOptions.IDEOptions = nil\n\t\tbaseOptions.Source = workspace.Source.String()\n\t\tfor optionName, optionValue := range workspace.IDE.Options {\n\t\t\tbaseOptions.IDEOptions = append(\n\t\t\t\tbaseOptions.IDEOptions,\n\t\t\t\toptionName+\"=\"+optionValue.Value,\n\t\t\t)\n\t\t}\n\n\t\t// run devpod up elsewhere\n\t\terr = client.Up(ctx, client2.UpOptions{\n\t\t\tCLIOptions: baseOptions,\n\t\t\tDebug:      cmd.Debug,\n\n\t\t\tStdin:  stdinReader,\n\t\t\tStdout: stdoutWriter,\n\t\t})\n\t\tif err != nil {\n\t\t\terrChan <- fmt.Errorf(\"executing up proxy command: %w\", err)\n\t\t} else {\n\t\t\terrChan <- nil\n\t\t}\n\t}()\n\n\t// create container etc.\n\tresult, err := tunnelserver.RunUpServer(\n\t\tcancelCtx,\n\t\tstdoutReader,\n\t\tstdinWriter,\n\t\ttrue,\n\t\ttrue,\n\t\tclient.WorkspaceConfig(),\n\t\tlog,\n\t)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"run tunnel machine\")\n\t}\n\n\t// wait until command finished\n\treturn result, <-errChan\n}\n\nfunc (cmd *UpCmd) devPodUpDaemon(\n\tctx context.Context,\n\tclient client2.DaemonClient,\n) (*config2.Result, error) {\n\t// build devpod up options\n\tworkspace := client.WorkspaceConfig()\n\tbaseOptions := cmd.CLIOptions\n\tbaseOptions.ID = workspace.ID\n\tbaseOptions.DevContainerPath = workspace.DevContainerPath\n\tbaseOptions.DevContainerImage = workspace.DevContainerImage\n\tbaseOptions.IDE = workspace.IDE.Name\n\tbaseOptions.IDEOptions = nil\n\tbaseOptions.Source = workspace.Source.String()\n\tfor optionName, optionValue := range workspace.IDE.Options {\n\t\tbaseOptions.IDEOptions = append(\n\t\t\tbaseOptions.IDEOptions,\n\t\t\toptionName+\"=\"+optionValue.Value,\n\t\t)\n\t}\n\n\t// run devpod up elsewhere\n\treturn client.Up(ctx, client2.UpOptions{\n\t\tCLIOptions: baseOptions,\n\t\tDebug:      cmd.Debug,\n\t})\n}\n\nfunc (cmd *UpCmd) devPodUpMachine(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.WorkspaceClient,\n\tlog log.Logger,\n) (*config2.Result, error) {\n\terr := startWait(ctx, client, true, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// compress info\n\tworkspaceInfo, wInfo, err := client.AgentInfo(cmd.CLIOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create container etc.\n\tlog.Infof(\"Creating devcontainer...\")\n\tdefer log.Debugf(\"Done creating devcontainer\")\n\n\t// if we run on a platform, we need to pass the platform options\n\tif cmd.Platform.Enabled {\n\t\treturn buildAgentClient(ctx, client, cmd.CLIOptions, \"up\", log, tunnelserver.WithPlatformOptions(&cmd.Platform))\n\t}\n\n\t// ssh tunnel command\n\tsshTunnelCmd := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", client.AgentPath())\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tsshTunnelCmd += \" --debug\"\n\t}\n\n\t// create agent command\n\tagentCommand := fmt.Sprintf(\n\t\t\"'%s' agent workspace up --workspace-info '%s'\",\n\t\tclient.AgentPath(),\n\t\tworkspaceInfo,\n\t)\n\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tagentCommand += \" --debug\"\n\t}\n\n\tagentInjectFunc := func(cancelCtx context.Context, sshCmd string, sshTunnelStdinReader, sshTunnelStdoutWriter *os.File, writer io.WriteCloser) error {\n\t\treturn agent.InjectAgentAndExecute(\n\t\t\tcancelCtx,\n\t\t\tfunc(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\t\treturn client.Command(ctx, client2.CommandOptions{\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tStdin:   stdin,\n\t\t\t\t\tStdout:  stdout,\n\t\t\t\t\tStderr:  stderr,\n\t\t\t\t})\n\t\t\t},\n\t\t\tclient.AgentLocal(),\n\t\t\tclient.AgentPath(),\n\t\t\tclient.AgentURL(),\n\t\t\ttrue,\n\t\t\tsshCmd,\n\t\t\tsshTunnelStdinReader,\n\t\t\tsshTunnelStdoutWriter,\n\t\t\twriter,\n\t\t\tlog.ErrorStreamOnly(),\n\t\t\twInfo.InjectTimeout,\n\t\t)\n\t}\n\n\treturn sshtunnel.ExecuteCommand(\n\t\tctx,\n\t\tclient,\n\t\tdevPodConfig.ContextOption(config.ContextOptionSSHAddPrivateKeys) == \"true\",\n\t\tagentInjectFunc,\n\t\tsshTunnelCmd,\n\t\tagentCommand,\n\t\tlog,\n\t\tfunc(ctx context.Context, stdin io.WriteCloser, stdout io.Reader) (*config2.Result, error) {\n\t\t\treturn tunnelserver.RunUpServer(\n\t\t\t\tctx,\n\t\t\t\tstdout,\n\t\t\t\tstdin,\n\t\t\t\tclient.AgentInjectGitCredentials(cmd.CLIOptions),\n\t\t\t\tclient.AgentInjectDockerCredentials(cmd.CLIOptions),\n\t\t\t\tclient.WorkspaceConfig(),\n\t\t\t\tlog,\n\t\t\t)\n\t\t},\n\t)\n}\n\nfunc startJupyterNotebookInBrowser(\n\tforwardGpg bool,\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tuser string,\n\tideOptions map[string]config.OptionValue,\n\tauthSockID string,\n\tlogger log.Logger,\n) error {\n\tif forwardGpg {\n\t\terr := performGpgForwarding(client, logger)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// determine port\n\tjupyterAddress, jupyterPort, err := parseAddressAndPort(\n\t\tjupyter.Options.GetValue(ideOptions, jupyter.BindAddressOption),\n\t\tjupyter.DefaultServerPort,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait until reachable then open browser\n\ttargetURL := fmt.Sprintf(\"http://localhost:%d/lab\", jupyterPort)\n\tif jupyter.Options.GetValue(ideOptions, jupyter.OpenOption) == \"true\" {\n\t\tgo func() {\n\t\t\terr = open2.Open(ctx, targetURL, logger)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorf(\"error opening jupyter notebook: %v\", err)\n\t\t\t}\n\n\t\t\tlogger.Infof(\n\t\t\t\t\"Successfully started jupyter notebook in browser mode. Please keep this terminal open as long as you use Jupyter Notebook\",\n\t\t\t)\n\t\t}()\n\t}\n\n\t// start in browser\n\tlogger.Infof(\"Starting jupyter notebook in browser mode at %s\", targetURL)\n\textraPorts := []string{fmt.Sprintf(\"%s:%d\", jupyterAddress, jupyter.DefaultServerPort)}\n\treturn startBrowserTunnel(\n\t\tctx,\n\t\tdevPodConfig,\n\t\tclient,\n\t\tuser,\n\t\ttargetURL,\n\t\tfalse,\n\t\textraPorts,\n\t\tauthSockID,\n\t\tlogger,\n\t)\n}\n\nfunc startRStudioInBrowser(\n\tforwardGpg bool,\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tuser string,\n\tideOptions map[string]config.OptionValue,\n\tauthSockID string,\n\tlogger log.Logger,\n) error {\n\tif forwardGpg {\n\t\terr := performGpgForwarding(client, logger)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// determine port\n\taddr, port, err := parseAddressAndPort(\n\t\trstudio.Options.GetValue(ideOptions, rstudio.BindAddressOption),\n\t\trstudio.DefaultServerPort,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait until reachable then open browser\n\ttargetURL := fmt.Sprintf(\"http://localhost:%d\", port)\n\tif rstudio.Options.GetValue(ideOptions, rstudio.OpenOption) == \"true\" {\n\t\tgo func() {\n\t\t\terr = open2.Open(ctx, targetURL, logger)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorf(\"error opening rstudio: %v\", err)\n\t\t\t}\n\n\t\t\tlogger.Infof(\n\t\t\t\t\"Successfully started RStudio Server in browser mode. Please keep this terminal open as long as you use it\",\n\t\t\t)\n\t\t}()\n\t}\n\n\t// start in browser\n\tlogger.Infof(\"Starting RStudio server in browser mode at %s\", targetURL)\n\textraPorts := []string{fmt.Sprintf(\"%s:%d\", addr, rstudio.DefaultServerPort)}\n\treturn startBrowserTunnel(\n\t\tctx,\n\t\tdevPodConfig,\n\t\tclient,\n\t\tuser,\n\t\ttargetURL,\n\t\tfalse,\n\t\textraPorts,\n\t\tauthSockID,\n\t\tlogger,\n\t)\n}\n\nfunc startFleet(ctx context.Context, client client2.BaseWorkspaceClient, logger log.Logger) error {\n\t// create ssh command\n\tstdout := &bytes.Buffer{}\n\tcmd, err := createSSHCommand(\n\t\tctx,\n\t\tclient,\n\t\tlogger,\n\t\t[]string{\"--command\", \"cat \" + fleet.FleetURLFile},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcmd.Stdout = stdout\n\terr = cmd.Run()\n\tif err != nil {\n\t\treturn command.WrapCommandError(stdout.Bytes(), err)\n\t}\n\n\turl := strings.TrimSpace(stdout.String())\n\tif len(url) == 0 {\n\t\treturn fmt.Errorf(\"seems like fleet is not running within the container\")\n\t}\n\n\tlogger.Warnf(\n\t\t\"Fleet is exposed at a publicly reachable URL, please make sure to not disclose this URL to anyone as they will be able to reach your workspace from that\",\n\t)\n\tlogger.Infof(\"Starting Fleet at %s ...\", url)\n\terr = open.Run(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc startVSCodeInBrowser(\n\tforwardGpg bool,\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tworkspaceFolder, user string,\n\tideOptions map[string]config.OptionValue,\n\tauthSockID string,\n\tlogger log.Logger,\n) error {\n\tif forwardGpg {\n\t\terr := performGpgForwarding(client, logger)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// determine port\n\tvscodeAddress, vscodePort, err := parseAddressAndPort(\n\t\topenvscode.Options.GetValue(ideOptions, openvscode.BindAddressOption),\n\t\topenvscode.DefaultVSCodePort,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait until reachable then open browser\n\ttargetURL := fmt.Sprintf(\"http://localhost:%d/?folder=%s\", vscodePort, workspaceFolder)\n\tif openvscode.Options.GetValue(ideOptions, openvscode.OpenOption) == \"true\" {\n\t\tgo func() {\n\t\t\terr = open2.Open(ctx, targetURL, logger)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorf(\"error opening vscode: %v\", err)\n\t\t\t}\n\n\t\t\tlogger.Infof(\n\t\t\t\t\"Successfully started vscode in browser mode. Please keep this terminal open as long as you use VSCode browser version\",\n\t\t\t)\n\t\t}()\n\t}\n\n\t// start in browser\n\tlogger.Infof(\"Starting vscode in browser mode at %s\", targetURL)\n\tforwardPorts := openvscode.Options.GetValue(ideOptions, openvscode.ForwardPortsOption) == \"true\"\n\textraPorts := []string{fmt.Sprintf(\"%s:%d\", vscodeAddress, openvscode.DefaultVSCodePort)}\n\treturn startBrowserTunnel(\n\t\tctx,\n\t\tdevPodConfig,\n\t\tclient,\n\t\tuser,\n\t\ttargetURL,\n\t\tforwardPorts,\n\t\textraPorts,\n\t\tauthSockID,\n\t\tlogger,\n\t)\n}\n\nfunc parseAddressAndPort(bindAddressOption string, defaultPort int) (string, int, error) {\n\tvar (\n\t\terr      error\n\t\taddress  string\n\t\tportName int\n\t)\n\tif bindAddressOption == \"\" {\n\t\tportName, err = port.FindAvailablePort(defaultPort)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\n\t\taddress = fmt.Sprintf(\"%d\", portName)\n\t} else {\n\t\taddress = bindAddressOption\n\t\t_, port, err := net.SplitHostPort(address)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, fmt.Errorf(\"parse host:port: %w\", err)\n\t\t} else if port == \"\" {\n\t\t\treturn \"\", 0, fmt.Errorf(\"parse ADDRESS: expected host:port, got %s\", address)\n\t\t}\n\n\t\tportName, err = strconv.Atoi(port)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, fmt.Errorf(\"parse host:port: %w\", err)\n\t\t}\n\t}\n\n\treturn address, portName, nil\n}\n\n// setupBackhaul sets up a long running command in the container to ensure an SSH connection is kept alive\nfunc setupBackhaul(client client2.BaseWorkspaceClient, authSockId string, log log.Logger) error {\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tremoteUser, err := devssh.GetUser(client.WorkspaceConfig().ID, client.WorkspaceConfig().SSHConfigPath)\n\tif err != nil {\n\t\tremoteUser = \"root\"\n\t}\n\n\tdotCmd := exec.Command(\n\t\texecPath,\n\t\t\"ssh\",\n\t\t\"--agent-forwarding=true\",\n\t\tfmt.Sprintf(\"--reuse-ssh-auth-sock=%s\", authSockId),\n\t\t\"--start-services=false\",\n\t\t\"--user\",\n\t\tremoteUser,\n\t\t\"--context\",\n\t\tclient.Context(),\n\t\tclient.Workspace(),\n\t\t\"--log-output=raw\",\n\t\t\"--command\",\n\t\t\"while true; do sleep 6000000; done\", // sleep infinity is not available on all systems\n\t)\n\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tdotCmd.Args = append(dotCmd.Args, \"--debug\")\n\t}\n\n\tlog.Info(\"Setting up backhaul SSH connection\")\n\n\twriter := log.Writer(logrus.InfoLevel, false)\n\n\tdotCmd.Stdout = writer\n\tdotCmd.Stderr = writer\n\n\terr = dotCmd.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Infof(\"Done setting up backhaul\")\n\n\treturn nil\n}\n\nfunc startBrowserTunnel(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tclient client2.BaseWorkspaceClient,\n\tuser, targetURL string,\n\tforwardPorts bool,\n\textraPorts []string,\n\tauthSockID string,\n\tlogger log.Logger,\n) error {\n\t// Setup a backhaul SSH connection using the remote user so there is an AUTH SOCK to use\n\t// With normal IDEs this would be the SSH connection made by the IDE\n\t// authSockID is not set when in proxy mode since we cannot use the proxies ssh-agent\n\tif authSockID != \"\" {\n\t\tgo func() {\n\t\t\tif err := setupBackhaul(client, authSockID, logger); err != nil {\n\t\t\t\tlogger.Error(\"Failed to setup backhaul SSH connection: \", err)\n\t\t\t}\n\t\t}()\n\t}\n\n\t// handle this directly with the daemon client\n\tdaemonClient, ok := client.(client2.DaemonClient)\n\tif ok {\n\t\ttoolClient, _, err := daemonClient.SSHClients(ctx, user)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer toolClient.Close()\n\n\t\terr = startServicesDaemon(ctx,\n\t\t\tdevPodConfig,\n\t\t\tdaemonClient,\n\t\t\ttoolClient,\n\t\t\tuser,\n\t\t\tlogger,\n\t\t\tforwardPorts,\n\t\t\textraPorts,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t<-ctx.Done()\n\n\t\treturn nil\n\t}\n\n\terr := tunnel.NewTunnel(\n\t\tctx,\n\t\tfunc(ctx context.Context, stdin io.Reader, stdout io.Writer) error {\n\t\t\twriter := logger.Writer(logrus.DebugLevel, false)\n\t\t\tdefer writer.Close()\n\n\t\t\tcmd, err := createSSHCommand(ctx, client, logger, []string{\n\t\t\t\t\"--log-output=raw\",\n\t\t\t\tfmt.Sprintf(\"--reuse-ssh-auth-sock=%s\", authSockID),\n\t\t\t\t\"--stdio\",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcmd.Stdout = stdout\n\t\t\tcmd.Stdin = stdin\n\t\t\tcmd.Stderr = writer\n\t\t\treturn cmd.Run()\n\t\t},\n\t\tfunc(ctx context.Context, containerClient *ssh.Client) error {\n\t\t\t// print port to console\n\t\t\tstreamLogger, ok := logger.(*log.StreamLogger)\n\t\t\tif ok {\n\t\t\t\tstreamLogger.JSON(logrus.InfoLevel, map[string]string{\n\t\t\t\t\t\"url\":  targetURL,\n\t\t\t\t\t\"done\": \"true\",\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tconfigureDockerCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectDockerCredentials) == \"true\"\n\t\t\tconfigureGitCredentials := devPodConfig.ContextOption(config.ContextOptionSSHInjectGitCredentials) == \"true\"\n\t\t\tconfigureGitSSHSignatureHelper := devPodConfig.ContextOption(config.ContextOptionGitSSHSignatureForwarding) == \"true\"\n\n\t\t\t// run in container\n\t\t\terr := tunnel.RunServices(\n\t\t\t\tctx,\n\t\t\t\tdevPodConfig,\n\t\t\t\tcontainerClient,\n\t\t\t\tuser,\n\t\t\t\tforwardPorts,\n\t\t\t\textraPorts,\n\t\t\t\tnil,\n\t\t\t\tclient.WorkspaceConfig(),\n\t\t\t\tconfigureDockerCredentials,\n\t\t\t\tconfigureGitCredentials,\n\t\t\t\tconfigureGitSSHSignatureHelper,\n\t\t\t\tlogger,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"run credentials server in browser tunnel: %w\", err)\n\t\t\t}\n\n\t\t\t<-ctx.Done()\n\t\t\treturn nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc configureSSH(client client2.BaseWorkspaceClient, sshConfigPath, user, workdir string, gpgagent bool, devPodHome string) error {\n\tpath, err := devssh.ResolveSSHConfigPath(sshConfigPath)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Invalid ssh config path\")\n\t}\n\tsshConfigPath = path\n\n\terr = devssh.ConfigureSSHConfig(\n\t\tsshConfigPath,\n\t\tclient.Context(),\n\t\tclient.Workspace(),\n\t\tuser,\n\t\tworkdir,\n\t\tgpgagent,\n\t\tdevPodHome,\n\t\tlog.Default,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc mergeDevPodUpOptions(baseOptions *provider2.CLIOptions) error {\n\toldOptions := *baseOptions\n\tfound, err := clientimplementation.DecodeOptionsFromEnv(\n\t\tclientimplementation.DevPodFlagsUp,\n\t\tbaseOptions,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode up options: %w\", err)\n\t} else if found {\n\t\tbaseOptions.WorkspaceEnv = append(oldOptions.WorkspaceEnv, baseOptions.WorkspaceEnv...)\n\t\tbaseOptions.InitEnv = append(oldOptions.InitEnv, baseOptions.InitEnv...)\n\t\tbaseOptions.PrebuildRepositories = append(oldOptions.PrebuildRepositories, baseOptions.PrebuildRepositories...)\n\t\tbaseOptions.IDEOptions = append(oldOptions.IDEOptions, baseOptions.IDEOptions...)\n\t}\n\n\terr = clientimplementation.DecodePlatformOptionsFromEnv(&baseOptions.Platform)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decode platform options: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc mergeEnvFromFiles(baseOptions *provider2.CLIOptions) error {\n\tvar variables []string\n\tfor _, file := range baseOptions.WorkspaceEnvFile {\n\t\tenvFromFile, err := config2.ParseKeyValueFile(file)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvariables = append(variables, envFromFile...)\n\t}\n\tbaseOptions.WorkspaceEnv = append(baseOptions.WorkspaceEnv, variables...)\n\n\treturn nil\n}\n\nfunc createSSHCommand(\n\tctx context.Context,\n\tclient client2.BaseWorkspaceClient,\n\tlogger log.Logger,\n\textraArgs []string,\n) (*exec.Cmd, error) {\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\targs := []string{\n\t\t\"ssh\",\n\t\t\"--user=root\",\n\t\t\"--agent-forwarding=false\",\n\t\t\"--start-services=false\",\n\t\t\"--context\",\n\t\tclient.Context(),\n\t\tclient.Workspace(),\n\t}\n\tif logger.GetLevel() == logrus.DebugLevel {\n\t\targs = append(args, \"--debug\")\n\t}\n\targs = append(args, extraArgs...)\n\n\treturn exec.CommandContext(ctx, execPath, args...), nil\n}\n\nfunc setupDotfiles(\n\tdotfiles, script string,\n\tenvFiles, envKeyValuePairs []string,\n\tclient client2.BaseWorkspaceClient,\n\tdevPodConfig *config.Config,\n\tlog log.Logger,\n) error {\n\tdotfilesRepo := devPodConfig.ContextOption(config.ContextOptionDotfilesURL)\n\tif dotfiles != \"\" {\n\t\tdotfilesRepo = dotfiles\n\t}\n\n\tdotfilesScript := devPodConfig.ContextOption(config.ContextOptionDotfilesScript)\n\tif script != \"\" {\n\t\tdotfilesScript = script\n\t}\n\n\tif dotfilesRepo == \"\" {\n\t\tlog.Debug(\"No dotfiles repo specified, skipping\")\n\t\treturn nil\n\t}\n\n\tlog.Infof(\"Dotfiles git repository %s specified\", dotfilesRepo)\n\tlog.Debug(\"Cloning dotfiles into the devcontainer...\")\n\n\tdotCmd, err := buildDotCmd(devPodConfig, dotfilesRepo, dotfilesScript, envFiles, envKeyValuePairs, client, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tdotCmd.Args = append(dotCmd.Args, \"--debug\")\n\t}\n\n\tlog.Debugf(\"Running dotfiles setup command: %v\", dotCmd.Args)\n\n\twriter := log.Writer(logrus.InfoLevel, false)\n\n\tdotCmd.Stdout = writer\n\tdotCmd.Stderr = writer\n\n\terr = dotCmd.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Infof(\"Done setting up dotfiles into the devcontainer\")\n\n\treturn nil\n}\n\nfunc buildDotCmdAgentArguments(devPodConfig *config.Config, dotfilesRepo, dotfilesScript string, log log.Logger) []string {\n\tagentArguments := []string{\n\t\t\"agent\",\n\t\t\"workspace\",\n\t\t\"install-dotfiles\",\n\t\t\"--repository\",\n\t\tdotfilesRepo,\n\t}\n\n\tif devPodConfig.ContextOption(config.ContextOptionSSHStrictHostKeyChecking) == \"true\" {\n\t\tagentArguments = append(agentArguments, \"--strict-host-key-checking\")\n\t}\n\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tagentArguments = append(agentArguments, \"--debug\")\n\t}\n\n\tif dotfilesScript != \"\" {\n\t\tlog.Infof(\"Dotfiles script %s specified\", dotfilesScript)\n\t\tagentArguments = append(agentArguments, \"--install-script\", dotfilesScript)\n\t}\n\n\treturn agentArguments\n}\n\nfunc buildDotCmd(devPodConfig *config.Config, dotfilesRepo, dotfilesScript string, envFiles, envKeyValuePairs []string, client client2.BaseWorkspaceClient, log log.Logger) (*exec.Cmd, error) {\n\tsshCmd := []string{\n\t\t\"ssh\",\n\t\t\"--agent-forwarding=true\",\n\t\t\"--start-services=true\",\n\t}\n\n\tenvFilesKeyValuePairs, err := collectDotfilesScriptEnvKeyvaluePairs(envFiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Collect file-based and CLI options env variables names (aka keys) and\n\t// configure ssh env var passthrough with send-env\n\tallEnvKeyValuesPairs := slices.Concat(envFilesKeyValuePairs, envKeyValuePairs)\n\tallEnvKeys := extractKeysFromEnvKeyValuePairs(allEnvKeyValuesPairs)\n\tfor _, envKey := range allEnvKeys {\n\t\tsshCmd = append(sshCmd, \"--send-env\", envKey)\n\t}\n\n\tremoteUser, err := devssh.GetUser(client.WorkspaceConfig().ID, client.WorkspaceConfig().SSHConfigPath)\n\tif err != nil {\n\t\tremoteUser = \"root\"\n\t}\n\n\tagentArguments := buildDotCmdAgentArguments(devPodConfig, dotfilesRepo, dotfilesScript, log)\n\tsshCmd = append(sshCmd,\n\t\t\"--user\",\n\t\tremoteUser,\n\t\t\"--context\",\n\t\tclient.Context(),\n\t\tclient.Workspace(),\n\t\t\"--log-output=raw\",\n\t\t\"--command\",\n\t\tagent.ContainerDevPodHelperLocation+\" \"+strings.Join(agentArguments, \" \"),\n\t)\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdotCmd := exec.Command(\n\t\texecPath,\n\t\tsshCmd...,\n\t)\n\n\tdotCmd.Env = append(dotCmd.Environ(), allEnvKeyValuesPairs...)\n\treturn dotCmd, nil\n}\n\nfunc extractKeysFromEnvKeyValuePairs(envKeyValuePairs []string) []string {\n\tkeys := []string{}\n\tfor _, env := range envKeyValuePairs {\n\t\tkeyValue := strings.SplitN(env, \"=\", 2)\n\t\tif len(keyValue) == 2 {\n\t\t\tkeys = append(keys, keyValue[0])\n\t\t}\n\t}\n\treturn keys\n}\n\nfunc collectDotfilesScriptEnvKeyvaluePairs(envFiles []string) ([]string, error) {\n\tkeyValues := []string{}\n\tfor _, file := range envFiles {\n\t\tenvFromFile, err := config2.ParseKeyValueFile(file)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkeyValues = append(keyValues, envFromFile...)\n\t}\n\treturn keyValues, nil\n}\n\nfunc setupGitSSHSignature(signingKey string, client client2.BaseWorkspaceClient, log log.Logger) error {\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tremoteUser, err := devssh.GetUser(client.WorkspaceConfig().ID, client.WorkspaceConfig().SSHConfigPath)\n\tif err != nil {\n\t\tremoteUser = \"root\"\n\t}\n\n\terr = exec.Command(\n\t\texecPath,\n\t\t\"ssh\",\n\t\t\"--agent-forwarding=true\",\n\t\t\"--start-services=true\",\n\t\t\"--user\",\n\t\tremoteUser,\n\t\t\"--context\",\n\t\tclient.Context(),\n\t\tclient.Workspace(),\n\t\t\"--command\", fmt.Sprintf(\"devpod agent git-ssh-signature-helper %s\", signingKey),\n\t).Run()\n\tif err != nil {\n\t\tlog.Error(\"failure in setting up git ssh signature helper\")\n\t}\n\treturn nil\n}\n\nfunc performGpgForwarding(\n\tclient client2.BaseWorkspaceClient,\n\tlog log.Logger,\n) error {\n\tlog.Debug(\"gpg forwarding enabled, performing immediately\")\n\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tremoteUser, err := devssh.GetUser(client.WorkspaceConfig().ID, client.WorkspaceConfig().SSHConfigPath)\n\tif err != nil {\n\t\tremoteUser = \"root\"\n\t}\n\n\tlog.Info(\"forwarding gpg-agent\")\n\n\t// perform in background an ssh command forwarding the\n\t// gpg agent, in order to have it immediately take effect\n\tgo func() {\n\t\terr = exec.Command(\n\t\t\texecPath,\n\t\t\t\"ssh\",\n\t\t\t\"--gpg-agent-forwarding=true\",\n\t\t\t\"--agent-forwarding=true\",\n\t\t\t\"--start-services=true\",\n\t\t\t\"--user\",\n\t\t\tremoteUser,\n\t\t\t\"--context\",\n\t\t\tclient.Context(),\n\t\t\tclient.Workspace(),\n\t\t\t\"--log-output=raw\",\n\t\t\t\"--command\", \"sleep infinity\",\n\t\t).Run()\n\t\tif err != nil {\n\t\t\tlog.Error(\"failure in forwarding gpg-agent\")\n\t\t}\n\t}()\n\n\treturn nil\n}\n\n// checkProviderUpdate currently only ensures the local provider is in sync with the remote for DevPod Pro instances\n// Potentially auto-upgrade other providers in the future.\nfunc checkProviderUpdate(devPodConfig *config.Config, proInstance *provider2.ProInstance, log log.Logger) error {\n\tif version.GetVersion() == version.DevVersion {\n\t\tlog.Debugf(\"Skipping provider upgrade check during development\")\n\t\treturn nil\n\t}\n\tif proInstance == nil {\n\t\tlog.Debugf(\"No pro instance available, skipping provider upgrade check\")\n\t\treturn nil\n\t}\n\n\t// compare versions\n\tnewVersion, err := platform.GetProInstanceDevPodVersion(proInstance)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"version for pro instance %s: %w\", proInstance.Host, err)\n\t}\n\n\tp, err := workspace2.FindProvider(devPodConfig, proInstance.Provider, log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get provider config for pro provider %s: %w\", proInstance.Provider, err)\n\t}\n\tif p.Config.Version == version.DevVersion {\n\t\treturn nil\n\t}\n\tif p.Config.Source.Internal {\n\t\treturn nil\n\t}\n\n\tv1, err := semver.Parse(strings.TrimPrefix(newVersion, \"v\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse version %s: %w\", newVersion, err)\n\t}\n\tv2, err := semver.Parse(strings.TrimPrefix(p.Config.Version, \"v\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse version %s: %w\", p.Config.Version, err)\n\t}\n\tif v1.Compare(v2) == 0 {\n\t\treturn nil\n\t}\n\tlog.Infof(\"New provider version available, attempting to update %s from %s to %s\", proInstance.Provider, p.Config.Version, newVersion)\n\n\tproviderSource, err := workspace2.ResolveProviderSource(devPodConfig, proInstance.Provider, log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve provider source %s: %w\", proInstance.Provider, err)\n\t}\n\n\tsplitted := strings.Split(providerSource, \"@\")\n\tif len(splitted) == 0 {\n\t\treturn fmt.Errorf(\"no provider source found %s\", providerSource)\n\t}\n\tproviderSource = splitted[0] + \"@\" + newVersion\n\n\t_, err = workspace2.UpdateProvider(devPodConfig, proInstance.Provider, providerSource, log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"update provider %s: %w\", proInstance.Provider, err)\n\t}\n\n\tlog.Donef(\"Successfully updated provider %s\", proInstance.Provider)\n\treturn nil\n}\n\nfunc getProInstance(devPodConfig *config.Config, providerName string, log log.Logger) *provider2.ProInstance {\n\tproInstances, err := workspace2.ListProInstances(devPodConfig, log)\n\tif err != nil {\n\t\treturn nil\n\t} else if len(proInstances) == 0 {\n\t\treturn nil\n\t}\n\n\tproInstance, ok := workspace2.FindProviderProInstance(proInstances, providerName)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn proInstance\n}\n\nfunc (cmd *UpCmd) prepareClient(ctx context.Context, devPodConfig *config.Config, args []string) (client2.BaseWorkspaceClient, log.Logger, error) {\n\t// try to parse flags from env\n\tif err := mergeDevPodUpOptions(&cmd.CLIOptions); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar logger log.Logger = log.Default\n\tif cmd.Platform.Enabled {\n\t\tlogger = logger.ErrorStreamOnly()\n\t\tlogger.Debug(\"Running in platform mode\")\n\t\tlogger.Debug(\"Using error output stream\")\n\n\t\t// merge context options from env\n\t\tconfig.MergeContextOptions(devPodConfig.Current(), os.Environ())\n\t}\n\n\tif err := mergeEnvFromFiles(&cmd.CLIOptions); err != nil {\n\t\treturn nil, logger, err\n\t}\n\n\tvar source *provider2.WorkspaceSource\n\tif cmd.Source != \"\" {\n\t\tsource = provider2.ParseWorkspaceSource(cmd.Source)\n\t\tif source == nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"workspace source is missing\")\n\t\t} else if source.LocalFolder != \"\" && cmd.Platform.Enabled {\n\t\t\treturn nil, nil, fmt.Errorf(\"local folder is not supported in platform mode. Please specify a git repository instead\")\n\t\t}\n\t}\n\n\tif cmd.SSHConfigPath == \"\" {\n\t\tcmd.SSHConfigPath = devPodConfig.ContextOption(config.ContextOptionSSHConfigPath)\n\t}\n\n\tclient, err := workspace2.Resolve(\n\t\tctx,\n\t\tdevPodConfig,\n\t\tcmd.IDE,\n\t\tcmd.IDEOptions,\n\t\targs,\n\t\tcmd.ID,\n\t\tcmd.Machine,\n\t\tcmd.ProviderOptions,\n\t\tcmd.Reconfigure,\n\t\tcmd.DevContainerImage,\n\t\tcmd.DevContainerPath,\n\t\tcmd.SSHConfigPath,\n\t\tsource,\n\t\tcmd.UID,\n\t\ttrue,\n\t\tcmd.Owner,\n\t\tlogger,\n\t)\n\tif err != nil {\n\t\treturn nil, logger, err\n\t}\n\n\tif !cmd.Platform.Enabled {\n\t\tproInstance := getProInstance(devPodConfig, client.Provider(), logger)\n\t\terr = checkProviderUpdate(devPodConfig, proInstance, logger)\n\t\tif err != nil {\n\t\t\treturn nil, logger, err\n\t\t}\n\t}\n\n\treturn client, logger, nil\n}\n\nfunc WithSignals(ctx context.Context) (context.Context, func()) {\n\tctx, cancel := context.WithCancel(ctx)\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, os.Interrupt, syscall.SIGHUP, syscall.SIGTERM, syscall.SIGQUIT)\n\tgo func() {\n\t\tselect {\n\t\tcase <-signals:\n\t\t\tcancel()\n\t\tcase <-ctx.Done():\n\t\t}\n\t}()\n\n\tgo func() {\n\t\t<-ctx.Done()\n\t\t<-signals\n\t\t// force shutdown if context is done and we receive another signal\n\t\tos.Exit(1)\n\t}()\n\n\treturn ctx, func() {\n\t\tcancel()\n\t\tsignal.Stop(signals)\n\t}\n}\n"
  },
  {
    "path": "cmd/upgrade.go",
    "content": "package cmd\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/upgrade\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n)\n\n// UpgradeCmd is a struct that defines a command call for \"upgrade\"\ntype UpgradeCmd struct {\n\tlog     log.Logger\n\tVersion string\n}\n\n// NewUpgradeCmd creates a new upgrade command\nfunc NewUpgradeCmd() *cobra.Command {\n\tcmd := &UpgradeCmd{log: log.GetInstance()}\n\tupgradeCmd := &cobra.Command{\n\t\tUse:   \"upgrade\",\n\t\tShort: \"Upgrade the DevPod CLI to the newest version\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\tupgradeCmd.Flags().StringVar(&cmd.Version, \"version\", \"\", \"The version to update to. Defaults to the latest stable version available\")\n\treturn upgradeCmd\n}\n\n// Run executes the command logic\nfunc (cmd *UpgradeCmd) Run(*cobra.Command, []string) error {\n\terr := upgrade.Upgrade(cmd.Version, cmd.log)\n\tif err != nil {\n\t\treturn errors.Errorf(\"unable to upgrade: %v\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/use/use.go",
    "content": "package use\n\nimport (\n\t\"github.com/loft-sh/devpod/cmd/flags\"\n\t\"github.com/loft-sh/devpod/cmd/ide\"\n\t\"github.com/loft-sh/devpod/cmd/provider\"\n\t\"github.com/spf13/cobra\"\n)\n\n// NewUseCmd returns a new root command\nfunc NewUseCmd(flags *flags.GlobalFlags) *cobra.Command {\n\tuseCmd := &cobra.Command{\n\t\tUse:   \"use\",\n\t\tShort: \"Use DevPod resources\",\n\t}\n\n\t// use provider\n\tuseProviderCmd := provider.NewUseCmd(flags)\n\tuseProviderCmd.Use = \"provider\"\n\tuseCmd.AddCommand(useProviderCmd)\n\n\t// use ide\n\tuseIDECmd := ide.NewUseCmd(flags)\n\tuseIDECmd.Use = \"ide\"\n\tuseCmd.AddCommand(useIDECmd)\n\treturn useCmd\n}\n"
  },
  {
    "path": "cmd/version.go",
    "content": "package cmd\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/spf13/cobra\"\n)\n\n// VersionCmd holds the ws-tunnel cmd flags\ntype VersionCmd struct {\n}\n\n// NewVersionCmd creates a new ws-tunnel command\nfunc NewVersionCmd() *cobra.Command {\n\tcmd := &VersionCmd{}\n\tversionCmd := &cobra.Command{\n\t\tUse:   \"version\",\n\t\tShort: \"Prints the version\",\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  cmd.Run,\n\t}\n\n\treturn versionCmd\n}\n\n// Run runs the command logic\nfunc (cmd *VersionCmd) Run(_ *cobra.Command, _ []string) error {\n\tfmt.Print(version.GetVersion())\n\treturn nil\n}\n"
  },
  {
    "path": "community.yaml",
    "content": "providers:\n  - repository: https://github.com/alexandrevilain/devpod-provider-ovhcloud\n  - repository: https://github.com/dirien/devpod-provider-exoscale\n  - repository: https://github.com/dirien/devpod-provider-scaleway\n  - repository: https://github.com/mrsimonemms/devpod-provider-hetzner\n  - repository: https://github.com/cloudbit-ch/devpod-provider-cloudbit\n  - repository: https://github.com/flowswiss/devpod-provider-flow\n  - repository: https://github.com/navaneeth-dev/devpod-provider-vultr\n  - repository: https://github.com/minhio/devpod-provider-multipass\n  - repository: https://github.com/akyriako/devpod-provider-opentelekomcloud\n  - repository: https://github.com/stackitcloud/devpod-provider-stackit\n"
  },
  {
    "path": "desktop/.gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\nsrc-tauri/bin/*\n.DS_Store\n"
  },
  {
    "path": "desktop/.npmrc",
    "content": "save-exact=true\n"
  },
  {
    "path": "desktop/.prettierignore",
    "content": "/src-tauri\n/public\n/.vscode\n/dist\n\n"
  },
  {
    "path": "desktop/.prettierrc",
    "content": "{\n  \"trailingComma\": \"es5\",\n  \"printWidth\": 100,\n  \"tabWidth\": 2,\n  \"semi\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"bracketSameLine\": true\n}\n"
  },
  {
    "path": "desktop/.vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\"tauri-apps.tauri-vscode\", \"rust-lang.rust-analyzer\"]\n}\n"
  },
  {
    "path": "desktop/README.md",
    "content": "# Devpod Desktop\n\n[Open Example Devpod](devpod://open?workspace=vscode-remote-try-go&source=https://github.com/Microsoft/vscode-remote-try-go&provider=docker)\n\n## Development\n\n1. Install [NodeJS](https://nodejs.org/en/)\n2. Install [Yarn](https://yarnpkg.com/getting-started/install) and make sure you\n   use yarn v1, by running `yarn set version 1.22.1`\n3. Install [Rust](https://www.rust-lang.org/tools/install)\n4. Install [Go](https://go.dev/doc/install)\n5. Run `./hack/rebuild.sh` from the root directory of the repo\n6. Install dependencies with `yarn` in the `desktop` directory\n7. Run `yarn tauri dev` in the `desktop` directory\n\n### Build dependencies\n\nTo build the app on Linux, you will need the following dependencies:\n\n```bash\nsudo apt-get install libappindicator3-1 libgdk-pixbuf2.0-0 libbsd0 libxdmcp6 \\\n  libwmf-0.2-7 libwmf-0.2-7-gtk libgtk-3-0 libwmf-dev libwebkit2gtk-4.0-37 \\\n  librust-openssl-sys-dev librust-glib-sys-dev\nsudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev \\\n  libayatana-appindicator3-dev librsvg2-dev file build-essential\n```\n\n### Additional Information\n\nMake sure all of your dependencies are installed and up to date by running `yarn`\nand `cd src-tauri && cargo update`.\n\nFrontend code lives in `src`\nBackend code lives in `src-tauri`\n\nEntrypoint for the application is the `main` function in `src-tauri/main.rs`.\nIt instructs tauri to set up the application, bootstrap the webview and serve our\nstatic assets. As of now, we just bundle all of the javascript into one file, so\nwe don't have any prerendering or code splitting going on.\n\nTo spin up the application in development mode, run `yarn tauri dev`. It will\nreport both the frontend webserver output (vite) and the backend logs to your\ncurrent terminal.\nTauri should automatically restart the app if your backend code changes and vite\nis responsible for hot module updates in the frontend.\nEnable debug logging to stdout during development with `DEBUG=true yarn tauri dev`.\n\nIf you just want to preview the project locally, make sure to disabled the auto\nupdate feature by setting `desktop/src-tauri/tauri.conf.json->updater.active=false`.\nPlease be careful not to commit this change later on.\nOnce you're happy with the current state, give it a spin in release mode by running\n`yarn tauri build`. You can find the packaged version of the application in the\n`src-tauri/target/release/{PLATFORM}` folder.\n\n## Check Type Errors\n\nRun `yarn types:check` to check for errors\n\n## Versioning\n\nThe apps version is determined by the one in `package.json`. Be careful not to add\none in `tauri.conf.json` as it override the current one.\nYou can upgrade the version manually or run `yarn version ...`\n\n## Build desktop app\n\nIf your development environment is setup successfully and you're able to run\n`yarn desktop:dev` without problems, you also should be able to build the app\nlocally by runnning `yarn desktop:build:dev`.\nNotice the `:dev` suffix, if you omit this it'll try to build with the updater\nenabled. This won't work on your machine as it requires sensitive information.\n\nThe output of the command can be found in `desktop/src-tauri/target/release/bundle`.\n"
  },
  {
    "path": "desktop/eslint.config.js",
    "content": "import { fixupConfigRules, fixupPluginRules } from \"@eslint/compat\"\nimport react from \"eslint-plugin-react\"\nimport typescriptEslint from \"@typescript-eslint/eslint-plugin\"\nimport tanstackQuery from \"@tanstack/eslint-plugin-query\"\nimport globals from \"globals\"\nimport tsParser from \"@typescript-eslint/parser\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport js from \"@eslint/js\"\nimport { FlatCompat } from \"@eslint/eslintrc\"\nimport reactRefresh from \"eslint-plugin-react-refresh\"\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\nconst compat = new FlatCompat({\n  baseDirectory: __dirname,\n  recommendedConfig: js.configs.recommended,\n  allConfig: js.configs.all,\n})\n\nexport default [\n  {\n    ignores: [\"dist/**/*\", \"src-tauri/**/*\", \"public/**/*\", \"src/gen/**/*\"],\n  },\n  ...fixupConfigRules(\n    compat.extends(\n      \"eslint:recommended\",\n      \"plugin:react/recommended\",\n      \"plugin:@typescript-eslint/eslint-recommended\",\n      \"plugin:react-hooks/recommended\",\n      \"prettier\",\n      \"plugin:@tanstack/eslint-plugin-query/recommended\"\n    )\n  ),\n  reactRefresh.configs.recommended,\n  {\n    plugins: {\n      react: fixupPluginRules(react),\n      \"@typescript-eslint\": fixupPluginRules(typescriptEslint),\n      \"@tanstack/query\": fixupPluginRules(tanstackQuery),\n    },\n\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        Atomics: \"readonly\",\n        SharedArrayBuffer: \"readonly\",\n      },\n\n      parser: tsParser,\n      ecmaVersion: 5,\n\n      parserOptions: {\n        project: true,\n        tsConfigRootDir: __dirname,\n      },\n    },\n\n    settings: {\n      react: {\n        version: \"detect\",\n      },\n    },\n    rules: {\n      \"react/react-in-jsx-scope\": \"off\",\n      \"no-unused-vars\": \"off\",\n      \"@typescript-eslint/no-unused-vars\": [\"error\"],\n\n      \"padding-line-between-statements\": [\n        \"warn\",\n        {\n          blankLine: \"always\",\n          prev: \"*\",\n          next: \"return\",\n        },\n      ],\n\n      \"no-warning-comments\": [\n        \"error\",\n        {\n          terms: [\"fixme\"],\n          location: \"start\",\n        },\n      ],\n\n      \"@typescript-eslint/no-unnecessary-condition\": [\n        \"warn\",\n        {\n          allowConstantLoopConditions: true,\n        },\n      ],\n\n      \"@typescript-eslint/naming-convention\": [\n        \"error\",\n        {\n          selector: [\"typeParameter\", \"typeAlias\"],\n          format: [\"PascalCase\"],\n          prefix: [\"T\"],\n        },\n        {\n          selector: [\"interface\"],\n          format: [\"PascalCase\"],\n          prefix: [\"I\"],\n        },\n        {\n          selector: [\"enum\"],\n          format: [\"PascalCase\"],\n          prefix: [\"E\"],\n        },\n      ],\n    },\n  },\n]\n"
  },
  {
    "path": "desktop/flatpak/DevPod.metainfo.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<component type=\"desktop-application\">\n  <id>sh.loft.devpod</id>\n\n  <name>Devpod</name>\n  <summary>Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.</summary>\n  <developer_name>Loft Labs</developer_name>\n\n  <metadata_license>FSFAP</metadata_license>\n  <project_license>MPL-2.0</project_license>\n\n  <url type=\"homepage\">https://devpod.sh</url>\n  <url type=\"vcs-browser\">https://github.com/loft-sh/devpod</url>\n  <url type=\"bugtracker\">https://github.com/loft-sh/devpod/issues</url>\n\n  <supports>\n    <control>pointing</control>\n    <control>keyboard</control>\n    <control>touch</control>\n  </supports>\n\n  <description>\n    <p>\n\tCodespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.\n    </p>\n  </description>\n\n  <launchable type=\"desktop-id\">sh.loft.devpod.desktop</launchable>\n  <screenshots>\n    <screenshot type=\"default\">\n      <image>https://devpod.sh/docs/media/devpod-architecture-2.png</image>\n      <caption>Devpod Architecture</caption>\n    </screenshot>\n    <screenshot>\n      <image>https://devpod.sh/docs/media/add-provider-2.png</image>\n      <caption>Adding a Provider</caption>\n    </screenshot>\n    <screenshot>\n      <image>https://devpod.sh/docs/media/create-workspace-vscode-browser.png</image>\n      <caption>Using vscode in the browser</caption>\n    </screenshot>\n  </screenshots>\n\n  <releases>\n    <release type=\"stable\" version=\"v0.6.10\" date=\"2024-01-21\">\n      <description>\n\t\t    <p>Release notes can be found at https://github.com/loft-sh/devpod/releases/tag/v0.6.10</p>\n      </description>\n    </release>\n  </releases>\n\n  <content_rating type=\"oars-1.1\"/>\n</component>"
  },
  {
    "path": "desktop/flatpak/sh.loft.devpod.tmpl",
    "content": "id: sh.loft.devpod\n\nruntime: org.gnome.Platform\nruntime-version: '47'\nsdk: org.gnome.Sdk\n\ncommand: \"sh.loft.devpod\"\nfinish-args:\n  - --socket=wayland # Permission needed to show the window\n  - --socket=fallback-x11 # Permission needed to show the window\n  - --device=dri # OpenGL, not necessary for all projects\n  - --share=ipc\n  - --share=network\n  - --socket=ssh-auth\n  - --socket=gpg-agent\n  - --filesystem=home\n  - --talk-name=org.freedesktop.Flatpak\n  - --talk-name=org.freedesktop.Notifications\n  - --talk-name=org.kde.StatusNotifierWatcher\n  - --filesystem=xdg-run/keyring\n\nmodules:\n  - shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json\n  - name: devpod\n    buildsystem: simple\n    sources:\n      - type: file\n        url: https://github.com/loft-sh/devpod/releases/download/v${VERSION}/DevPod_${VERSION}_amd64.deb\n        sha256: ${SHA256}\n        only-arches: [x86_64]\n      - type: file\n        url: https://github.com/loft-sh/devpod/releases/download/v${VERSION}/DevPod.desktop\n        sha256: ${DESKTOP_SHA256}\n      - type: file\n        url: https://github.com/loft-sh/devpod/releases/download/v${VERSION}/DevPod.metainfo.xml\n        sha256: ${META_SHA256}\n      - type: file\n        path: devpod-wrapper\n    build-commands:\n      - ar -x *.deb\n      - tar -xf data.tar.gz\n      - cp devpod-wrapper /app/bin/devpod-cli\n      - chmod +x /app/bin/devpod-cli\n      - install -Dm755 usr/bin/devpod-cli /app/bin/devpod-bin\n      - install -Dm755 usr/bin/DevPod\\ Desktop /app/bin/sh.loft.devpod\n      - install -Dm644 DevPod.desktop /app/share/applications/sh.loft.devpod.desktop\n      - desktop-file-edit --set-key Exec --set-value sh.loft.devpod /app/share/applications/sh.loft.devpod.desktop\n      - desktop-file-edit --set-icon sh.loft.devpod /app/share/applications/sh.loft.devpod.desktop\n      - install -Dm644 usr/share/icons/hicolor/128x128/apps/DevPod\\ Desktop.png /app/share/icons/hicolor/128x128/apps/sh.loft.devpod.png\n      - install -Dm644 usr/share/icons/hicolor/32x32/apps/DevPod\\ Desktop.png /app/share/icons/hicolor/32x32/apps/sh.loft.devpod.png\n      - install -Dm644 usr/share/icons/hicolor/256x256@2/apps/DevPod\\ Desktop.png /app/share/icons/hicolor/256x256@2/apps/sh.loft.devpod.png\n      - install -Dm644 DevPod.metainfo.xml /app/share/metainfo/sh.loft.devpod.metainfo.xml"
  },
  {
    "path": "desktop/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>DevPod</title>\n  </head>\n\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.tsx\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "desktop/package.json",
    "content": "{\n  \"name\": \"devpod\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"tsc && vite build\",\n    \"preview\": \"vite preview\",\n    \"tauri\": \"tauri\",\n    \"desktop:dev\": \"tauri dev --config src-tauri/tauri-dev.conf.json\",\n    \"desktop:dev:debug\": \"DEBUG=true yarn desktop:dev\",\n    \"desktop:build:dev\": \"DEBUG=true tauri build --config src-tauri/tauri-dev.conf.json\",\n    \"desktop:build:flatpak\": \"tauri build --config src-tauri/tauri-flatpak.conf.json\",\n    \"desktop:build:flatpak:debug\": \"DEBUG=true tauri build --config src-tauri/tauri-flatpak.conf.json --debug\",\n    \"desktop:build:debug\": \"tauri build --debug\",\n    \"desktop:build\": \"tauri build\",\n    \"format:check\": \"prettier --check .\",\n    \"format:fix\": \"prettier --write .\",\n    \"types:check\": \"tsc -p ./tsconfig.json --noEmit\",\n    \"lint:ci\": \"eslint . --ext '.ts,.tsx'\"\n  },\n  \"dependencies\": {\n    \"@chakra-ui/icons\": \"2.1.1\",\n    \"@chakra-ui/react\": \"2.8.1\",\n    \"@emotion/react\": \"11.11.1\",\n    \"@emotion/styled\": \"11.11.0\",\n    \"@headlessui/react\": \"1.7.17\",\n    \"@kubernetes/client-node\": \"1.0.0\",\n    \"@loft-enterprise/client\": \"https://github.com/loft-sh/loft-javascript-client#v4.3.0-devpod.alpha.11\",\n    \"@tanstack/react-query\": \"4.36.1\",\n    \"@tanstack/react-query-devtools\": \"4.36.1\",\n    \"@tanstack/react-table\": \"8.10.7\",\n    \"@tauri-apps/api\": \"^2.4.0\",\n    \"@tauri-apps/plugin-clipboard-manager\": \"2.2.2\",\n    \"@tauri-apps/plugin-dialog\": \"2.2.0\",\n    \"@tauri-apps/plugin-fs\": \"2.2.0\",\n    \"@tauri-apps/plugin-log\": \"2.3.1\",\n    \"@tauri-apps/plugin-os\": \"2.2.1\",\n    \"@tauri-apps/plugin-process\": \"2.2.0\",\n    \"@tauri-apps/plugin-shell\": \"2.2.0\",\n    \"@tauri-apps/plugin-store\": \"2.2.0\",\n    \"@tauri-apps/plugin-updater\": \"2.6.1\",\n    \"@types/lodash.debounce\": \"4.0.9\",\n    \"@xterm/addon-fit\": \"0.10.0\",\n    \"@xterm/xterm\": \"5.5.0\",\n    \"compare-versions\": \"6.1.1\",\n    \"dayjs\": \"1.11.10\",\n    \"framer-motion\": \"10.16.9\",\n    \"js-yaml\": \"4.1.0\",\n    \"jszip\": \"3.10.1\",\n    \"lodash.debounce\": \"4.0.8\",\n    \"markdown-to-jsx\": \"7.3.2\",\n    \"react\": \"18.2.0\",\n    \"react-dom\": \"18.2.0\",\n    \"react-error-boundary\": \"4.1.2\",\n    \"react-hook-form\": \"7.48.2\",\n    \"react-icons\": \"4.12.0\",\n    \"react-router\": \"6.20.0\",\n    \"react-router-dom\": \"6.20.0\",\n    \"tauri-plugin-store-api\": \"https://github.com/tauri-apps/tauri-plugin-store#v1\",\n    \"uuid\": \"9.0.1\"\n  },\n  \"devDependencies\": {\n    \"@eslint/compat\": \"1.2.7\",\n    \"@eslint/eslintrc\": \"3.3.0\",\n    \"@eslint/js\": \"9.22.0\",\n    \"@tanstack/eslint-plugin-query\": \"4.36.1\",\n    \"@tauri-apps/cli\": \"2.4.0\",\n    \"@types/node\": \"18.15.3\",\n    \"@types/react\": \"18.2.28\",\n    \"@types/react-dom\": \"18.2.13\",\n    \"@types/uuid\": \"9.0.5\",\n    \"@typescript-eslint/eslint-plugin\": \"8.26.1\",\n    \"@typescript-eslint/parser\": \"8.26.1\",\n    \"@vitejs/plugin-react\": \"4.3.4\",\n    \"eslint\": \"9.22.0\",\n    \"eslint-config-prettier\": \"10.1.1\",\n    \"eslint-config-react-app\": \"7.0.1\",\n    \"eslint-plugin-react\": \"7.37.4\",\n    \"eslint-plugin-react-hooks\": \"5.2.0\",\n    \"eslint-plugin-react-refresh\": \"0.4.19\",\n    \"globals\": \"16.0.0\",\n    \"prettier\": \"3.0.3\",\n    \"typescript\": \"5.0.4\",\n    \"vite\": \"6.2.0\"\n  },\n  \"resolutions\": {\n    \"lodash\": \"4.17.21\"\n  },\n  \"packageManager\": \"yarn@1.22.19\"\n}\n"
  },
  {
    "path": "desktop/src/App/App.tsx",
    "content": "import { Box, Code, Container, Link, Text, VStack, useColorModeValue } from \"@chakra-ui/react\"\nimport { useEffect, useMemo } from \"react\"\nimport { Link as RouterLink, useMatch, useRouteError } from \"react-router-dom\"\nimport {\n  DevPodProvider,\n  ProInstancesProvider,\n  WorkspaceStore,\n  WorkspaceStoreProvider,\n  useChangeSettings,\n} from \"../contexts\"\nimport { Routes } from \"../routes\"\nimport { OSSApp } from \"./OSSApp\"\nimport { ProApp } from \"./ProApp\"\nimport { usePreserveLocation } from \"./usePreserveLocation\"\nimport { ErrorBoundary } from \"react-error-boundary\"\nimport { ErrorMessageBox } from \"@/components\"\n\nexport function App() {\n  const routeMatchPro = useMatch(`${Routes.PRO}/*`)\n  usePreserveLocation()\n  usePartyParrot()\n\n  const store = useMemo(() => {\n    if (routeMatchPro == null) {\n      return new WorkspaceStore()\n    }\n  }, [routeMatchPro])\n\n  return (\n    <ErrorBoundary\n      fallbackRender={({ error }) => (\n        <ErrorMessageBox\n          error={error || new Error(\"Something went wrong. Please restart the application\")}\n        />\n      )}>\n      {routeMatchPro == null ? (\n        <WorkspaceStoreProvider store={store!}>\n          <DevPodProvider>\n            <ProInstancesProvider>\n              <OSSApp />\n            </ProInstancesProvider>\n          </DevPodProvider>\n        </WorkspaceStoreProvider>\n      ) : (\n        <ProApp />\n      )}\n    </ErrorBoundary>\n  )\n}\n\nexport function ErrorPage() {\n  const error = useRouteError()\n  const contentBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n\n  return (\n    <Box height=\"100vh\" width=\"100vw\" backgroundColor={contentBackgroundColor}>\n      <Container padding=\"16\">\n        <VStack>\n          <Text>Whoops, something went wrong or this page doesn&apos;t exist.</Text>\n          <Box paddingBottom=\"6\">\n            <Link as={RouterLink} to={Routes.ROOT}>\n              Go back to home\n            </Link>\n          </Box>\n          <Code>{JSON.stringify(error, null, 2)}</Code>{\" \"}\n        </VStack>\n      </Container>\n    </Box>\n  )\n}\n\nfunction usePartyParrot() {\n  const { set: setSettings, settings } = useChangeSettings()\n\n  useEffect(() => {\n    const handler = (event: KeyboardEvent) => {\n      if (event.shiftKey && event.ctrlKey && event.key.toLowerCase() === \"p\") {\n        const current = settings.partyParrot\n        setSettings(\"partyParrot\", !current)\n      }\n    }\n    document.addEventListener(\"keyup\", handler)\n\n    return () => document.addEventListener(\"keyup\", handler)\n  }, [setSettings, settings.partyParrot])\n}\n"
  },
  {
    "path": "desktop/src/App/Changelog.tsx",
    "content": "import { Box, Heading, Link, ListItem, UnorderedList } from \"@chakra-ui/react\"\nimport Markdown from \"markdown-to-jsx\"\nimport { client } from \"../client\"\n\nexport type TLinkClickEvent = React.MouseEvent<HTMLLinkElement> & { target: HTMLLinkElement }\nexport type TChangeLogProps = Readonly<{ rawMarkdown: string }>\n\nexport function Changelog({ rawMarkdown }: TChangeLogProps) {\n  return (\n    <Box paddingX=\"6\" paddingY=\"2\" marginBottom=\"4\">\n      <Markdown\n        options={{\n          overrides: {\n            h2: {\n              component: Heading,\n              props: {\n                size: \"md\",\n                marginBottom: \"2\",\n                marginTop: \"4\",\n              },\n            },\n            h3: {\n              component: Heading,\n              props: {\n                size: \"sm\",\n                marginBottom: \"2\",\n                marginTop: \"4\",\n              },\n            },\n            a: {\n              component: Link,\n              props: {\n                onClick: (e: TLinkClickEvent) => {\n                  e.preventDefault()\n                  client.open(e.target.href)\n                },\n              },\n            },\n            ul: {\n              component: UnorderedList,\n            },\n            li: {\n              component: ListItem,\n            },\n          },\n        }}>\n        {rawMarkdown}\n      </Markdown>\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/App/OSSApp.tsx",
    "content": "import { client } from \"@/client\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport {\n  Box,\n  Flex,\n  Grid,\n  GridItem,\n  GridProps,\n  HStack,\n  LinkBox,\n  LinkOverlay,\n  Text,\n  VStack,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { useEffect, useMemo } from \"react\"\nimport { Outlet, Link as RouterLink, useMatch, useNavigate } from \"react-router-dom\"\nimport { useBorderColor } from \"../Theme\"\nimport {\n  Notifications,\n  ProSwitcher,\n  Sidebar,\n  SidebarMenuItem,\n  StatusBar,\n  Toolbar,\n} from \"../components\"\nimport { SIDEBAR_WIDTH, STATUS_BAR_HEIGHT } from \"../constants\"\nimport { ToolbarProvider, useProviders, useSettings } from \"../contexts\"\nimport { Briefcase, Cog, Stack3D } from \"../icons\"\nimport { isLinux, isMacOS } from \"../lib\"\nimport { Routes } from \"../routes\"\nimport { useWelcomeModal } from \"../useWelcomeModal\"\nimport { showTitleBar, titleBarSafeArea } from \"./constants\"\nimport { useAppReady } from \"./useAppReady\"\n\nexport function OSSApp() {\n  const navigate = useNavigate()\n  const { errorModal, changelogModal, proLoginModal } = useAppReady()\n  const rootRouteMatch = useMatch(Routes.ROOT)\n  const { sidebarPosition } = useSettings()\n  const contentBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n  const actionHoverColor = useColorModeValue(\"gray.100\", \"gray.700\")\n  const toolbarHeight = useToken(\"sizes\", showTitleBar ? \"28\" : \"20\")\n  const borderColor = useBorderColor()\n  const showTitle = isMacOS || isLinux\n\n  const providerUpdateInfo = useProviderUpdates()\n  const providerUpdateCount = providerUpdateInfo?.length ?? 0\n\n  const mainGridProps = useMemo<GridProps>(() => {\n    if (sidebarPosition === \"right\") {\n      return { templateAreas: `\"main sidebar\"`, gridTemplateColumns: `1fr ${SIDEBAR_WIDTH}` }\n    }\n\n    return { templateAreas: `\"sidebar main\"`, gridTemplateColumns: `${SIDEBAR_WIDTH} 1fr` }\n  }, [sidebarPosition])\n\n  useEffect(() => {\n    if (rootRouteMatch !== null) {\n      navigate(Routes.WORKSPACES)\n    }\n  }, [navigate, rootRouteMatch])\n\n  const { modal: welcomeModal } = useWelcomeModal()\n\n  return (\n    <>\n      <Flex width=\"100vw\" maxWidth=\"100vw\" overflow=\"hidden\">\n        {showTitleBar && <TitleBar showTitle={showTitle} />}\n\n        <Box width=\"full\" height=\"full\" >\n          <Grid height=\"full\" {...mainGridProps}>\n            <GridItem area=\"sidebar\">\n              <Sidebar paddingTop={titleBarSafeArea}>\n                <SidebarMenuItem to={Routes.WORKSPACES} icon={<Briefcase />}>\n                  Workspaces\n                </SidebarMenuItem>\n                <SidebarMenuItem to={Routes.PROVIDERS} icon={<Stack3D />}>\n                  Providers\n                </SidebarMenuItem>\n                <SidebarMenuItem to={Routes.SETTINGS} icon={<Cog />}>\n                  Settings\n                </SidebarMenuItem>\n              </Sidebar>\n            </GridItem>\n\n            <GridItem area=\"main\" height=\"100vh\" width=\"full\" overflowX=\"auto\">\n              <ToolbarProvider>\n                <Box\n                  data-tauri-drag-region // keep!\n                  backgroundColor={contentBackgroundColor}\n                  position=\"relative\"\n                  width=\"full\"\n                  height=\"full\"\n                  overflowY=\"auto\">\n                  <Toolbar\n                    paddingTop={titleBarSafeArea}\n                    backgroundColor={contentBackgroundColor}\n                    height={toolbarHeight}\n                    position=\"sticky\"\n                    zIndex={1}\n                    width=\"full\">\n                    <Grid\n                      alignContent=\"center\"\n                      templateRows=\"1fr\"\n                      templateColumns=\"minmax(auto, 18rem) 3fr fit-content(15rem)\"\n                      width=\"full\"\n                      paddingX=\"4\">\n                      <GridItem display=\"flex\" alignItems=\"center\">\n                        <Toolbar.Title />\n                      </GridItem>\n                      <GridItem\n                        marginLeft={2}\n                        display=\"flex\"\n                        alignItems=\"center\"\n                        justifyContent=\"start\"\n                        columnGap={4}>\n                        <Toolbar.Actions />\n                      </GridItem>\n                      <GridItem display=\"flex\" alignItems=\"center\" justifyContent=\"center\">\n                        <Box mr=\"4\">\n                          <Notifications\n                            getActionDestination={(action) => Routes.toAction(action.id)}\n                            badgeNumber={providerUpdateCount}\n                            providerUpdates={\n                              providerUpdateInfo &&\n                              providerUpdateCount > 0 && (\n                                <>\n                                  {providerUpdateInfo.map(({ providerName }) => (\n                                    <LinkBox\n                                      key={providerName}\n                                      padding={2}\n                                      fontSize=\"sm\"\n                                      borderRadius=\"md\"\n                                      width=\"full\"\n                                      display=\"flex\"\n                                      flexFlow=\"row nowrap\"\n                                      alignItems=\"center\"\n                                      gap={3}\n                                      _hover={{ backgroundColor: actionHoverColor }}>\n                                      <Stack3D color=\"gray.400\" />\n                                      <VStack align=\"start\" spacing=\"0\">\n                                        <Text>\n                                          <LinkOverlay\n                                            as={RouterLink}\n                                            to={Routes.PROVIDERS}\n                                            textTransform=\"capitalize\">\n                                            <Text fontWeight=\"bold\">Provider {providerName}</Text>\n                                          </LinkOverlay>\n                                        </Text>\n                                        <Text marginTop=\"-1\">Update available</Text>\n                                      </VStack>\n                                    </LinkBox>\n                                  ))}\n                                </>\n                              )\n                            }\n                          />\n                        </Box>\n                        <ProSwitcher />\n                      </GridItem>\n                    </Grid>\n                  </Toolbar>\n                  <Box\n                    as=\"main\"\n                    paddingTop=\"8\"\n                    paddingBottom={STATUS_BAR_HEIGHT}\n                    paddingX=\"8\"\n                    width=\"full\"\n                    height={`calc(100vh - ${toolbarHeight})`}\n                    overflowY=\"auto\">\n                    <Outlet />\n                  </Box>\n                  <StatusBar\n                    height={STATUS_BAR_HEIGHT}\n                    position=\"fixed\"\n                    bottom=\"0\"\n                    width={`calc(100% - ${SIDEBAR_WIDTH})`}\n                    borderTopWidth=\"thin\"\n                    borderTopColor={borderColor}\n                    backgroundColor={contentBackgroundColor}>\n                    <HStack>\n                      <StatusBar.Version />\n                      <StatusBar.Platform />\n                      <StatusBar.Arch />\n                    </HStack>\n\n                    <HStack>\n                      <StatusBar.ZoomMenu />\n                      <StatusBar.GitHubStar />\n                      <StatusBar.OSSDocs />\n                      <StatusBar.OSSReportIssue />\n                      <StatusBar.DebugMenu />\n                    </HStack>\n                  </StatusBar>\n                </Box>\n              </ToolbarProvider>\n            </GridItem>\n          </Grid>\n        </Box>\n      </Flex>\n\n      {welcomeModal}\n      {errorModal}\n      {changelogModal}\n      {proLoginModal}\n    </>\n  )\n}\n\ntype TTitleBarProps = Readonly<{\n  showTitle?: boolean\n}>\nfunction TitleBar({ showTitle = true }: TTitleBarProps) {\n  return (\n    <Box\n      data-tauri-drag-region // keep!\n      height={titleBarSafeArea}\n      position=\"fixed\"\n      top=\"0\"\n      width=\"full\"\n      textAlign=\"center\"\n      zIndex=\"modal\"\n      justifyItems=\"center\">\n      {showTitle && (\n        <Text\n          data-tauri-drag-region // keep!\n          fontWeight=\"bold\"\n          marginTop=\"2\">\n          DevPod\n        </Text>\n      )}\n    </Box>\n  )\n}\n\nfunction useProviderUpdates() {\n  const [[providers]] = useProviders()\n\n  const { data: providerUpdateInfo } = useQuery({\n    // eslint-disable-next-line @tanstack/query/exhaustive-deps\n    queryKey: QueryKeys.PROVIDERS_CHECK_UPDATE_ALL,\n    queryFn: async () => {\n      if (providers === undefined || Object.keys(providers).length === 0) {\n        return\n      }\n\n      const results = await Promise.allSettled(\n        Object.entries(providers)\n          .filter(([, provider]) => !provider.isProxyProvider)\n          .map(async ([p]) => ({\n            name: p,\n            update: await client.providers.checkUpdate(p),\n          }))\n      )\n\n      return results\n        .map((r) => {\n          if (r.status !== \"fulfilled\" || r.value.update.err) {\n            return null\n          }\n\n          if (!r.value.update.val.updateAvailable) {\n            return null\n          }\n\n          return { providerName: r.value.name, updateAvailable: r.value.update.val.updateAvailable }\n        })\n        .filter((r): r is Exclude<typeof r, null> => r !== null)\n    },\n    refetchInterval: 1000 * 60 * 60 * 30, // 30 minutes\n    staleTime: Infinity,\n  })\n\n  return providerUpdateInfo\n}\n"
  },
  {
    "path": "desktop/src/App/ProApp.tsx",
    "content": "import { STATUS_BAR_HEIGHT } from \"@/constants\"\nimport { ProviderProvider } from \"@/contexts/DevPodContext/DevPodProvider\"\nimport { BellDuotone, CogDuotone, LockDuotone } from \"@/icons\"\nimport { TConnectionStatus, useConnectionStatus } from \"@/lib\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport { Routes } from \"@/routes\"\nimport { TPlatformVersionInfo } from \"@/types\"\nimport {\n  Avatar,\n  Box,\n  Button,\n  Divider,\n  HStack,\n  IconButton,\n  Link,\n  List,\n  ListItem,\n  Popover,\n  PopoverArrow,\n  PopoverContent,\n  PopoverHeader,\n  PopoverTrigger,\n  Portal,\n  Text,\n  Tooltip,\n  useColorModeValue,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { ManagementV1Self } from \"@loft-enterprise/client/gen/models/managementV1Self\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { ReactElement, ReactNode, cloneElement, useMemo } from \"react\"\nimport { Outlet, Link as RouterLink, To } from \"react-router-dom\"\nimport { Notifications, ProLayout, StatusBar, Toolbar } from \"../components\"\nimport {\n  ProInstancesProvider,\n  ProProvider,\n  ProWorkspaceStore,\n  ToolbarProvider,\n  WorkspaceStoreProvider,\n  useProContext,\n  useProHost,\n} from \"../contexts\"\nimport { DaemonClient } from \"@/client/pro/client\"\n\nexport function ProApp() {\n  const host = useProHost()\n  if (!host) {\n    throw new Error(\"No host found. This shouldn't happen\")\n  }\n\n  const store = useMemo(() => new ProWorkspaceStore(host), [host])\n\n  return (\n    <WorkspaceStoreProvider store={store}>\n      <ProviderProvider>\n        <ProInstancesProvider>\n          <ToolbarProvider>\n            <ProProvider host={host}>\n              <ProAppContent host={host} />\n            </ProProvider>\n          </ToolbarProvider>\n        </ProInstancesProvider>\n      </ProviderProvider>\n    </WorkspaceStoreProvider>\n  )\n}\n\ntype TProAppContentProps = Readonly<{ host: string }>\nfunction ProAppContent({ host }: TProAppContentProps) {\n  const { managementSelfQuery: selfQuery, client } = useProContext()\n  const connectionStatus = useConnectionStatus()\n  const versionInfo = usePlatformVersion()\n\n  return (\n    <ProLayout\n      toolbarItems={\n        <>\n          <HStack gap=\"4\">\n            <Box>\n              <Link variant=\"\" to={Routes.toProInstance(host)} as={RouterLink}>\n                <Toolbar.Title />\n              </Link>\n            </Box>\n            <Box>\n              <Toolbar.Actions />\n            </Box>\n          </HStack>\n          <HStack pr=\"2\">\n            {client instanceof DaemonClient ? (\n              <>\n                <Notifications\n                  getActionDestination={(action) => Routes.toProWorkspace(host, action.targetID)}\n                  icon={\n                    <BellDuotone\n                      color={\"primary.600\"}\n                      _dark={{ color: \"primary.300\" }}\n                      position=\"absolute\"\n                    />\n                  }\n                />\n                <Divider orientation=\"vertical\" h=\"10\" />\n                <UserMenu host={host} self={selfQuery.data} />\n              </>\n            ) : (\n              <>\n                <Link as={RouterLink} to={Routes.toProSettings(host)}>\n                  <IconButton\n                    variant=\"ghost\"\n                    size=\"md\"\n                    rounded=\"full\"\n                    aria-label=\"Go to settings\"\n                    icon={<CogDuotone color={\"primary.600\"} _dark={{ color: \"primary.300\" }} />}\n                  />\n                </Link>\n                <Notifications\n                  getActionDestination={(action) => Routes.toProWorkspace(host, action.targetID)}\n                  icon={\n                    <BellDuotone\n                      color={\"primary.600\"}\n                      _dark={{ color: \"primary.300\" }}\n                      position=\"absolute\"\n                    />\n                  }\n                />\n              </>\n            )}\n          </HStack>\n        </>\n      }\n      statusBarItems={\n        <>\n          <HStack />\n          <HStack gap=\"1\">\n            <Tooltip label=\"Client version\">\n              {/* The box is just here for tooltip to take a ref */}\n              <Box>\n                <StatusBar.Version />\n              </Box>\n            </Tooltip>\n            {versionInfo?.currentProviderVersion && (\n              <Tooltip label=\"Provider version\">\n                <Text>\n                  {versionInfo.currentProviderVersion}\n                  {versionInfo.currentProviderVersion !== versionInfo.remoteProviderVersion\n                    ? `/${versionInfo.remoteProviderVersion}`\n                    : \"\"}\n                </Text>\n              </Tooltip>\n            )}\n            {versionInfo?.serverVersion && (\n              <Tooltip label=\"Platform version\">\n                <Text>{versionInfo.serverVersion}</Text>\n              </Tooltip>\n            )}\n            <StatusBar.Platform />\n            <StatusBar.Arch />\n            <StatusBar.DebugMenu />\n            <Divider orientation=\"vertical\" h={STATUS_BAR_HEIGHT} mx=\"2\" />\n            <ConnectionStatus status={connectionStatus} />\n          </HStack>\n        </>\n      }>\n      <Outlet />\n    </ProLayout>\n  )\n}\n\nfunction usePlatformVersion(): TPlatformVersionInfo | undefined {\n  const { host, client } = useProContext()\n  const { data } = useQuery({\n    queryKey: QueryKeys.versionInfo(host),\n    queryFn: async () => {\n      return (await client.getVersion()).unwrap()\n    },\n    refetchInterval: 1_000 * 60, // every minute\n  })\n\n  return data\n}\n\ntype TConnectionStatusProps = Readonly<{\n  status: TConnectionStatus\n}>\nfunction ConnectionStatus({ status }: TConnectionStatusProps) {\n  if (status.isLoading) {\n    return null\n  }\n\n  const content = (\n    <HStack gap=\"1\">\n      <Box\n        boxSize=\"2\"\n        bg={status.healthy && status.online ? \"green.400\" : \"red.400\"}\n        rounded=\"full\"\n      />\n      <Text color=\"gray.600\" _dark={{ color: \"gray.400\" }} textTransform=\"capitalize\">\n        {status.healthy ? \"Connected\" : \"Disconnected\"}\n      </Text>\n    </HStack>\n  )\n\n  if (status.details && status.details.length > 0) {\n    return (\n      <Tooltip\n        label={\n          <List>\n            {status.details.map((detail, i) => (\n              <ListItem key={i}>{detail}</ListItem>\n            ))}\n            )\n          </List>\n        }>\n        {content}\n      </Tooltip>\n    )\n  }\n\n  return content\n}\n\ntype TProfileMenuProps = Readonly<{\n  host: string\n  self: ManagementV1Self | undefined\n}>\nfunction UserMenu({ host, self }: TProfileMenuProps) {\n  const iconColor = useColorModeValue(\"primary.600\", \"primary.300\")\n  const { isOpen, onClose, onToggle } = useDisclosure()\n\n  const userName = self?.status?.user?.displayName ?? self?.status?.user?.name ?? \"Anonymous\"\n\n  return (\n    <>\n      <Popover placement=\"bottom\" isOpen={isOpen} onClose={onClose} returnFocusOnClose={false}>\n        <PopoverTrigger>\n          <IconButton\n            onClick={onToggle}\n            variant=\"ghost\"\n            size=\"md\"\n            rounded=\"full\"\n            aria-label=\"User Menu\"\n            icon={\n              <Avatar\n                name={userName}\n                size=\"xs\"\n                fontWeight=\"bold\"\n                bg={iconColor}\n                _dark={{ color: \"gray.900\" }}\n                src={self?.status?.user?.icon}\n              />\n            }\n          />\n        </PopoverTrigger>\n        <Portal>\n          <PopoverContent zIndex=\"popover\" w=\"72\">\n            <PopoverArrow />\n            <PopoverHeader textOverflow=\"ellipsis\" overflow=\"hidden\" maxW=\"72\" whiteSpace=\"nowrap\">\n              {userName}\n            </PopoverHeader>\n            <List my=\"4\" onClick={onClose}>\n              <ListItem>\n                {/* TODO: Implement when we need it\n                 UserLinkButton to={Routes.toProProfile(host)} icon={<ProfileDuotone />}>\n                  Profile\n                </UserLinkButton>*/}\n              </ListItem>\n              <ListItem>\n                <UserLinkButton to={Routes.toProCredentials(host)} icon={<LockDuotone />}>\n                  Credentials\n                </UserLinkButton>\n              </ListItem>\n              <ListItem>\n                <UserLinkButton to={Routes.toProSettings(host)} icon={<CogDuotone />}>\n                  Settings\n                </UserLinkButton>\n              </ListItem>\n            </List>\n          </PopoverContent>\n        </Portal>\n      </Popover>\n    </>\n  )\n}\n\ntype TUserLinkButton = Readonly<{ children: ReactNode; to: To; icon: ReactElement }>\nfunction UserLinkButton({ children, to, icon }: TUserLinkButton) {\n  const clonedIcon = cloneElement(icon, { boxSize: 5 })\n\n  return (\n    <Button\n      as={RouterLink}\n      size=\"sm\"\n      fontWeight=\"semibold\"\n      variant={\"ghost\"}\n      w=\"full\"\n      display=\"flex\"\n      justifyContent=\"start\"\n      alignItems=\"center\"\n      leftIcon={clonedIcon}\n      to={to}>\n      {children}\n    </Button>\n  )\n}\n"
  },
  {
    "path": "desktop/src/App/constants.ts",
    "content": "import { BoxProps } from \"@chakra-ui/react\"\nimport { isLinux, isMacOS, isWindows } from \"../lib\"\n\nexport const showTitleBar = isMacOS || isLinux || isWindows\nexport const titleBarSafeArea: BoxProps[\"height\"] = showTitleBar ? isWindows ? \"6\" : \"12\" : 0\n"
  },
  {
    "path": "desktop/src/App/index.ts",
    "content": "export { App, ErrorPage } from \"./App\"\n"
  },
  {
    "path": "desktop/src/App/useAppReady.tsx",
    "content": "import { QueryKeys } from \"@/queryKeys\"\nimport { TProInstance } from \"@/types\"\nimport {\n  Button,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  Text,\n  useDisclosure,\n  useToast,\n} from \"@chakra-ui/react\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { getCurrentWebviewWindow } from \"@tauri-apps/api/webviewWindow\"\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\"\nimport { matchPath, useNavigate } from \"react-router\"\nimport { client } from \"../client\"\nimport { ErrorMessageBox } from \"../components\"\nimport { WORKSPACE_SOURCE_BRANCH_DELIMITER, WORKSPACE_SOURCE_COMMIT_DELIMITER } from \"../constants\"\nimport {\n  startWorkspaceAction,\n  useChangeSettings,\n  useProInstances,\n  useWorkspaceStore,\n} from \"../contexts\"\nimport { exists, hasCapability, useLoginProModal } from \"../lib\"\nimport { Routes } from \"../routes\"\nimport { useChangelogModal } from \"./useChangelogModal\"\n\nexport function useAppReady() {\n  const [[proInstances]] = useProInstances()\n  const { store } = useWorkspaceStore()\n  const isReadyLockRef = useRef<boolean>(false)\n  const viewID = useId()\n  const navigate = useNavigate()\n  const toast = useToast()\n  const { modal: errorModal, setFailedMessage } = useErrorModal()\n  const { modal: changelogModal } = useChangelogModal(isReadyLockRef.current)\n  const { modal: proLoginModal, handleOpenLogin: handleProLogin } = useLoginProModal()\n  const { set: setSetting } = useChangeSettings()\n\n  // auto-update pro providers in the background\n  useQuery({\n    queryKey: QueryKeys.proProviderUpdates(proInstances),\n    queryFn: async () => {\n      if (!proInstances || proInstances.length === 0) {\n        return null\n      }\n\n      // let pro client check for updates without using the provider\n      // we don't really care about the result in the context of the GUI, just need to make sure it's updating\n      await Promise.allSettled(\n        proInstances\n          .filter(\n            (instance) =>\n              instance.provider && instance.host && hasCapability(instance, \"update-provider\")\n          )\n          .map(async (instance) => {\n            const proClient = client.getProClient(instance)\n            const checkUpdateRes = await proClient.checkUpdate()\n            if (checkUpdateRes.err) {\n              client.log(\n                \"error\",\n                `[${instance.host ?? \"\"}] Failed to check for upgrade: ${\n                  checkUpdateRes.val.message\n                }`\n              )\n\n              return null\n            }\n\n            const { available: updateAvailable, newVersion } = checkUpdateRes.val\n            if (!updateAvailable || !newVersion) {\n              return null\n            }\n            client.log(\n              \"info\",\n              `[${\n                instance.host ?? \"\"\n              }] New version available (${newVersion}). Attempting to update.`\n            )\n\n            const updateRes = await proClient.update(newVersion)\n            if (updateRes.err) {\n              client.log(\n                \"error\",\n                `[${instance.host ?? \"\"}] Failed to upgrade: ${updateRes.val.message}`\n              )\n\n              return null\n            }\n\n            client.log(\"info\", `[${instance.host ?? \"\"}] Successfully updated to ${newVersion}`)\n          })\n      )\n\n      return null\n    },\n    enabled: proInstances && proInstances.length > 0,\n    refetchInterval: 1_000 * 60 * 5, // 5 minutes\n  })\n\n  useEffect(() => {\n    window.addEventListener(\"contextmenu\", (e) => {\n      e.preventDefault()\n\n      return false\n    })\n  }, [])\n\n  const handleMessage: Parameters<typeof client.subscribe>[1] = useCallback(\n    async (event) => {\n      if (event.type === \"ShowDashboard\") {\n        if (await getCurrentWebviewWindow().isMinimized()) {\n          await getCurrentWebviewWindow().unminimize()\n        }\n\n        if (!(await getCurrentWebviewWindow().isVisible())) {\n          await getCurrentWebviewWindow().show()\n        }\n\n        await getCurrentWebviewWindow().setFocus()\n\n        return\n      }\n\n      if (event.type === \"ShowToast\") {\n        await getCurrentWebviewWindow().setFocus()\n\n        toast({\n          title: event.title,\n          description: event.message,\n          status: event.status,\n          duration: 5_000,\n          isClosable: true,\n        })\n\n        return\n      }\n\n      if (event.type === \"CommandFailed\") {\n        await getCurrentWebviewWindow().setFocus()\n        const message = Object.entries(event)\n          .filter(([key]) => key !== \"type\")\n          .map(([key, value]) => `${key}: ${value}`)\n          .join(\"\\n\")\n        setFailedMessage(message)\n\n        return\n      }\n\n      if (event.type === \"LoginRequired\") {\n        const proInstances = await client.pro.listProInstances()\n        if (proInstances.err) {\n          return\n        }\n        const existingInstance = proInstances.val.find((i) => i.host === event.host)\n        if (!existingInstance) {\n          return\n        }\n\n        await getCurrentWebviewWindow().setFocus()\n        const match = matchPath(Routes.toProInstance(event.host), location.pathname)\n        if (match != null) {\n          // only show toast if we're not on pro instance page anyway\n          return\n        }\n        toast({\n          title: \"Login Required\",\n          description: (\n            <HStack>\n              <Text>You have been logged out. Please log back in.</Text>\n              <Button\n                ml=\"2\"\n                variant=\"ghost\"\n                onClick={() => navigate(Routes.toProInstance(event.host))}>\n                Log in\n              </Button>\n            </HStack>\n          ),\n          status: \"warning\",\n          duration: 5_000,\n          isClosable: true,\n        })\n\n        return\n      }\n\n      if (event.type === \"SetupPro\") {\n        // check if host is already taken. If not, set window to foreground and pass evnet to pro login handler\n        const proInstances = await client.pro.listProInstances()\n        if (proInstances.err) {\n          return\n        }\n\n        const existingInstance = proInstances.val.find((i) => i.host === event.host)\n        if (existingInstance) {\n          // only warn in console, don't show modal\n          console.warn(\"Pro instance already exists\", existingInstance)\n\n          return\n        }\n\n        const data: Parameters<typeof handleProLogin>[0] = {\n          host: event.host,\n          suggestedOptions: {},\n        }\n        if (event.accessKey) {\n          data.accessKey = event.accessKey\n        }\n        if (event.options) {\n          data.suggestedOptions = event.options\n        }\n\n        await getCurrentWebviewWindow().setFocus()\n        // ensure pro is enabled\n        setSetting(\"experimental_devPodPro\", true)\n        handleProLogin(data)\n\n        return\n      }\n\n      if (event.type === \"OpenProInstance\") {\n        const proInstances = await client.pro.listProInstances()\n        if (proInstances.err) {\n          return\n        }\n\n        const existingInstance = proInstances.val.find((i) => i.host === event.host)\n        if (!existingInstance?.host) {\n          return\n        }\n\n        await getCurrentWebviewWindow().setFocus()\n        navigate(Routes.toProInstance(existingInstance.host))\n\n        return\n      }\n\n      if (event.type === \"ImportWorkspace\") {\n        await getCurrentWebviewWindow().setFocus()\n        // Do we already know the workspace?\n        let workspacesResult = await client.workspaces.listAll(false)\n        if (workspacesResult.err) {\n          const cleanedMsg = workspacesResult.val.message.split(\"\\n\").at(-1) ?? \"\"\n          setFailedMessage(\"Failed to list workspaces: \" + cleanedMsg)\n\n          return\n        }\n        let maybeWorkspace = workspacesResult.val.find((w) => w.id === event.workspace_id)\n        // Is it a pro workspace?\n        if (maybeWorkspace && maybeWorkspace.provider?.name) {\n          const proInstance = await findProInstance(maybeWorkspace.provider.name)\n          if (proInstance && proInstance.host) {\n            navigate(Routes.toProWorkspace(proInstance.host, maybeWorkspace.id))\n\n            return\n          }\n        }\n\n        // At this point it can't be a new pro workspace anymore,\n        // we'll have to go through the old import flow\n        const importResult = await client.pro.importWorkspace({\n          workspaceID: event.workspace_id,\n          workspaceUID: event.workspace_uid,\n          devPodProHost: event.devpod_pro_host,\n          project: event.project,\n          options: event.options,\n        })\n        if (importResult.err) {\n          const cleanedMsg = importResult.val.message.split(\"\\n\").at(-1) ?? \"\"\n          setFailedMessage(\"Failed to import workspace: \" + cleanedMsg)\n\n          return\n        }\n        workspacesResult = await client.workspaces.listAll(false)\n        if (workspacesResult.err) {\n          return\n        }\n        maybeWorkspace = workspacesResult.val.find((w) => w.id === event.workspace_id)\n        if (!maybeWorkspace) {\n          setFailedMessage(\"Could not find workspace after import\")\n\n          return\n        }\n\n        const actionID = startWorkspaceAction({\n          workspaceID: maybeWorkspace.id,\n          streamID: viewID,\n          config: {\n            id: maybeWorkspace.id,\n            providerConfig: {\n              providerID: maybeWorkspace.provider?.name ?? undefined,\n            },\n            ideConfig: {\n              name: maybeWorkspace.ide?.name,\n            },\n          },\n          store,\n        })\n        navigate(Routes.toAction(actionID))\n\n        return\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      if (event.type === \"OpenWorkspace\") {\n        const workspacesResult = await client.workspaces.listAll(false)\n        if (workspacesResult.err) {\n          return\n        }\n\n        // Try to find workspace by source\n        let maybeWorkspace = workspacesResult.val.find((w) => {\n          if (!w.source) {\n            return false\n          }\n\n          // Check `repo@sha256:commitHash`\n          if (\n            `${w.source.gitRepository ?? \"\"}${WORKSPACE_SOURCE_COMMIT_DELIMITER}${\n              w.source.gitCommit ?? \"\"\n            }` === event.source\n          ) {\n            return true\n          }\n\n          // Check `repo@branch`\n          if (\n            `${w.source.gitRepository ?? \"\"}${WORKSPACE_SOURCE_BRANCH_DELIMITER}${\n              w.source.gitBranch ?? \"\"\n            }` === event.source\n          ) {\n            return true\n          }\n\n          // Check Git repo\n          if (w.source.gitRepository === event.source) {\n            return true\n          }\n\n          // Check local folder\n          if (w.source.localFolder === event.source) {\n            return true\n          }\n\n          // Check Docker Image\n          if (w.source.image === event.source) {\n            return true\n          }\n\n          return false\n        })\n\n        // If we don't have a workspace by now, `source` isn't defined but `workspace_id` is, try to find workspace by ID\n        // This happens for example if the message is triggered by a system tray item\n        // WARN: `event.source` can be an empty string here, hence the falsy check\n        if (maybeWorkspace === undefined && !event.source && exists(event.workspace_id)) {\n          maybeWorkspace = workspacesResult.val.find((w) => w.id === event.workspace_id)\n        }\n\n        const ides = await client.ides.listAll()\n        let defaultIDE = undefined\n        if (ides.ok) {\n          defaultIDE = ides.val.find((ide) => ide.default)?.name\n        }\n\n        const providerName = maybeWorkspace?.provider?.name\n        if (maybeWorkspace !== undefined && providerName) {\n          const proInstance = await findProInstance(providerName)\n          if (proInstance && proInstance.host) {\n            navigate(Routes.toProWorkspace(proInstance.host, maybeWorkspace.id))\n\n            return\n          }\n\n          const actionID = startWorkspaceAction({\n            workspaceID: maybeWorkspace.id,\n            streamID: viewID,\n            config: {\n              id: maybeWorkspace.id,\n              providerConfig: { providerID: providerName },\n              ideConfig: { name: defaultIDE ?? maybeWorkspace.ide?.name ?? null },\n            },\n            store,\n          })\n\n          navigate(Routes.toAction(actionID))\n\n          return\n        }\n\n        const match = matchPath(Routes.PRO_INSTANCE, location.pathname)\n        if (match && match.params.host) {\n          navigate(Routes.toProWorkspaceCreate(match.params.host))\n\n          return\n        }\n\n        navigate(\n          Routes.toWorkspaceCreate({\n            workspaceID: event.workspace_id,\n            providerID: event.provider_id,\n            rawSource: event.source,\n            ide: event.ide,\n          })\n        )\n      }\n    },\n    [handleProLogin, navigate, setFailedMessage, setSetting, store, toast, viewID]\n  )\n\n  // notifies underlying layer that ui is ready for communication\n  useEffect(() => {\n    const unsubscribePromise = client.subscribe(\"event\", handleMessage)\n    if (!isReadyLockRef.current) {\n      isReadyLockRef.current = true\n\n      unsubscribePromise.then(async () => {\n        try {\n          await client.ready()\n        } catch (err) {\n          return console.error(err)\n        }\n      })\n    }\n\n    return () => {\n      unsubscribePromise.then((unsubscribe) => {\n        unsubscribe()\n      })\n    }\n  }, [handleMessage, navigate])\n\n  return { errorModal, changelogModal, proLoginModal }\n}\n\nfunction useErrorModal() {\n  const [failedMessage, setFailedMessage] = useState<string | null>(null)\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const modal = useMemo(() => {\n    return (\n      <Modal\n        onClose={onClose}\n        isOpen={isOpen}\n        onCloseComplete={() => setFailedMessage(null)}\n        isCentered>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalCloseButton />\n          {/* todo: customize the header */}\n          <ModalHeader>Failed to open workspace from URL</ModalHeader>\n          <ModalBody>\n            <ErrorMessageBox error={Error(failedMessage!)} />\n          </ModalBody>\n          <ModalFooter />\n        </ModalContent>\n      </Modal>\n    )\n  }, [isOpen, onClose, failedMessage])\n\n  useEffect(() => {\n    if (failedMessage !== null) {\n      onOpen()\n    } else {\n      onClose()\n    }\n  }, [onClose, onOpen, failedMessage])\n\n  return { modal, handleOpen: onOpen, setFailedMessage }\n}\n\nasync function findProInstance(providerName: string): Promise<TProInstance | null> {\n  const providersRes = await client.providers.listAll()\n  if (providersRes.err) return null\n  const provider = providersRes.val[providerName]\n  if (!provider || !provider.isProxyProvider) return null\n\n  // handle pro provider\n  const proInstanceRes = await client.pro.listProInstances()\n  if (proInstanceRes.err) return null\n  const proInstance = proInstanceRes.val.find(\n    (proInstance) => proInstance.provider === providerName\n  )\n  if (!proInstance?.host) return null\n\n  return proInstance\n}\n"
  },
  {
    "path": "desktop/src/App/useChangelogModal.tsx",
    "content": "import {\n  Button,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  Text,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { Release } from \"../gen\"\nimport { useReleases, useVersion } from \"../lib\"\nimport { Changelog } from \"./Changelog\"\n\nconst LAST_INSTALLED_VERSION_KEY = \"devpod-last-installed-version\"\n\nexport function useChangelogModal(isReady: boolean) {\n  const currentVersion = useVersion()\n  const releases = useReleases()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const [latestRelease, setLatestRelease] = useState<Release | null>(null)\n  const modal = useMemo(\n    () =>\n      latestRelease !== null ? (\n        <Modal onClose={onClose} isOpen={isOpen} scrollBehavior=\"inside\" size=\"3xl\" isCentered>\n          <ModalOverlay />\n          <ModalContent>\n            <ModalCloseButton />\n            <ModalHeader>Changelog</ModalHeader>\n            <ModalBody>\n              {latestRelease.body ? (\n                <Changelog rawMarkdown={latestRelease.body} />\n              ) : (\n                <Text>This release doesn&apos;t have a changelog</Text>\n              )}\n            </ModalBody>\n            <ModalFooter>\n              <Button onClick={onClose}>Done</Button>\n            </ModalFooter>\n          </ModalContent>\n        </Modal>\n      ) : null,\n    [isOpen, latestRelease, onClose]\n  )\n\n  useEffect(() => {\n    if (!isReady || !currentVersion || !releases) {\n      return\n    }\n\n    const latestVersion = localStorage.getItem(LAST_INSTALLED_VERSION_KEY)\n    const maybeRelease = releases.find((r) => r.tag_name === `v${currentVersion}`)\n\n    if (latestVersion !== currentVersion) {\n      localStorage.setItem(LAST_INSTALLED_VERSION_KEY, currentVersion)\n\n      if (maybeRelease !== undefined && !maybeRelease.name?.endsWith(\"[skip changelog]\")) {\n        setLatestRelease(maybeRelease)\n        onOpen()\n      }\n    }\n  }, [currentVersion, isReady, onOpen, releases])\n\n  return { modal }\n}\n"
  },
  {
    "path": "desktop/src/App/usePreserveLocation.tsx",
    "content": "import { useEffect } from \"react\"\nimport { Location, matchRoutes, useLocation } from \"react-router\"\nimport { client } from \"../client\"\nimport { LocalStorageBackend, Store } from \"../lib\"\nimport { Routes } from \"@/routes\"\n\nconst LOCATION_KEY = \"location\"\nconst CURRENT_LOCATION_KEY = \"current\"\ntype TLocationStore = { [CURRENT_LOCATION_KEY]: Location }\nconst store = new Store<TLocationStore>(new LocalStorageBackend<TLocationStore>(LOCATION_KEY))\n\nexport function usePreserveLocation() {\n  const location = useLocation()\n\n  useEffect(() => {\n    // only save location for these routes\n    const match = matchRoutes(\n      [\n        { path: Routes.ROOT },\n        { path: Routes.PROVIDER },\n        { path: Routes.PROVIDERS },\n        { path: Routes.WORKSPACES },\n        { path: Routes.PRO_INSTANCE },\n      ],\n      location\n    )\n    if (match == null) {\n      return\n    }\n\n    try {\n      store.set(CURRENT_LOCATION_KEY, location)\n    } catch (err) {\n      client.log(\"error\", `Failed to serialize location: ${err}`)\n    }\n  }, [location])\n}\n"
  },
  {
    "path": "desktop/src/ProRoot.tsx",
    "content": "import { Outlet } from \"react-router-dom\"\n\nexport function ProRoot() {\n  return <Outlet />\n}\n"
  },
  {
    "path": "desktop/src/Theme/ThemeProvider.tsx",
    "content": "import { ChakraProvider, Theme, ToastProviderProps, extendTheme } from \"@chakra-ui/react\"\nimport { ReactNode, useEffect, useState } from \"react\"\nimport { TSettings, useSettings } from \"../contexts\"\nimport { theme as initialTheme } from \"./theme\"\nconst toastOptions: ToastProviderProps = { defaultOptions: { variant: \"subtle\" } }\n\nconst fontSize: Record<TSettings[\"zoom\"], string> = {\n  sm: \"12px\",\n  md: \"14px\",\n  lg: \"16px\",\n  xl: \"18px\",\n}\n\nexport function ThemeProvider({ children }: Readonly<{ children?: ReactNode }>) {\n  const settings = useSettings()\n  const [theme, setTheme] = useState<Theme>(initialTheme)\n\n  useEffect(() => {\n    setTheme(\n      (current) =>\n        extendTheme(\n          {\n            styles: {\n              global: {\n                html: {\n                  fontSize: fontSize[settings.zoom],\n                },\n              },\n            },\n          },\n          current\n        ) as Theme\n    )\n  }, [settings])\n\n  return (\n    <ChakraProvider theme={theme} toastOptions={toastOptions}>\n      {children}\n    </ChakraProvider>\n  )\n}\n"
  },
  {
    "path": "desktop/src/Theme/button.ts",
    "content": "import { defineStyleConfig } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\nimport { theme as defaultTheme } from \"@chakra-ui/theme\"\n\nexport const Button = defineStyleConfig({\n  defaultProps: {\n    size: \"sm\",\n  },\n  variants: {\n    primary(props) {\n      return {\n        color: mode(\"white\", \"gray.50\")(props),\n        borderColor: \"primary.600\",\n        _dark: {\n          borderColor: \"primary.500\",\n          backgroundColor: \"primary.600\",\n        },\n        borderWidth: 1,\n        backgroundColor: \"primary.500\",\n        _hover: {\n          backgroundColor: \"primary.600\",\n          _disabled: {\n            background: \"primary.500\",\n          },\n          _dark: {\n            backgroundColor: \"primary.700\",\n          },\n        },\n      }\n    },\n    outline(props) {\n      return {\n        borderColor: props.colorScheme == \"primary\" ? \"primary.600\" : \"gray.200\",\n        _dark: {\n          borderColor: props.colorScheme == \"primary\" ? \"primary.200\" : \"gray.700\",\n        },\n        _hover: {\n          _dark: {\n            bg: props.colorScheme == \"primary\" ? \"\" : \"gray.700\",\n          },\n        },\n        _active: {\n          _dark: {\n            bg: props.colorScheme == \"primary\" ? \"\" : \"gray.800\",\n          },\n        },\n      }\n    },\n    solid(props) {\n      let bgDark = \"gray.800\"\n      if (props.colorScheme === \"primary\") {\n        bgDark = \"\"\n      } else {\n        bgDark = defaultTheme.components.Button.variants?.solid(props).bg ?? \"\"\n      }\n\n      let bgHoverDark = \"gray.700\"\n      if (props.colorScheme === \"primary\") {\n        bgHoverDark = \"\"\n      } else {\n        bgHoverDark = defaultTheme.components.Button.variants?.solid(props)._hover.bg ?? \"\"\n      }\n      let bgActiveDark = \"gray.700\"\n      if (props.colorScheme === \"primary\") {\n        bgActiveDark = \"\"\n      } else {\n        bgActiveDark = defaultTheme.components.Button.variants?.solid(props)._active.bg ?? \"\"\n      }\n\n      return {\n        _dark: {\n          bg: bgDark,\n        },\n        _hover: {\n          _dark: {\n            bg: bgHoverDark,\n          },\n        },\n        _active: {\n          _dark: {\n            bg: bgActiveDark,\n          },\n        },\n      }\n    },\n    [\"solid-outline\"](props) {\n      return {\n        color: mode(\"gray.800\", \"gray.100\")(props),\n        borderColor: mode(\"gray.200\", \"gray.700\")(props),\n        borderWidth: 1,\n        \".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)\":\n          { marginEnd: \"-1px\" },\n        \".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)\": {\n          marginBottom: \"-1px\",\n        },\n        backgroundColor: mode(\"gray.100\", \"gray.800\")(props),\n        _hover: {\n          backgroundColor: mode(\"gray.200\", \"gray.700\")(props),\n        },\n        _active: {\n          backgroundColor: mode(\"gray.300\", \"gray.900\")(props),\n        },\n      }\n    },\n    announcement({ theme }) {\n      const from = theme.colors.primary[\"900\"]\n      const to = theme.colors.primary[\"600\"]\n\n      return {\n        color: \"white\",\n        transition: \"background 150ms\",\n        fontWeight: \"regular\",\n        background: `linear-gradient(170deg, ${from} 15%, ${to})`,\n        backgroundSize: \"130% 130%\",\n        _hover: {\n          backgroundPosition: \"90% 50%\",\n        },\n        _active: {\n          boxShadow: \"inset 0 0 3px 2px rgba(0, 0, 0, 0.2)\",\n        },\n      }\n    },\n    proWorkspaceIDE(_props) {\n      return {\n        color: \"primary.900\",\n        fontWeight: \"semibold\",\n        bg: \"primary.100\",\n        _hover: {\n          bg: \"primary.200\",\n        },\n        _active: {\n          bg: \"primary.300\",\n        },\n      }\n    },\n    ghost(props) {\n      return {\n        _hover: {\n          _dark: {\n            bg: props.colorScheme == \"primary\" ? \"\" : \"gray.700\",\n          },\n        },\n        _active: {\n          _dark: {\n            bg: props.colorScheme == \"primary\" ? \"\" : \"gray.800\",\n          },\n        },\n      }\n    },\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/card.ts",
    "content": "import { cardAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(cardAnatomy.keys)\nexport const Card = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    return {\n      container: {\n        backgroundColor: \"gray.50\",\n        borderColor: mode(\"gray.200\", \"gray.700\")(props),\n        _dark: {\n          backgroundColor: \"gray.900\",\n        },\n      },\n    }\n  }),\n})\n"
  },
  {
    "path": "desktop/src/Theme/checkbox.ts",
    "content": "import { checkboxAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\n\nconst { defineMultiStyleConfig } = createMultiStyleConfigHelpers(checkboxAnatomy.keys)\n\nexport const Checkbox = defineMultiStyleConfig({\n  defaultProps: {\n    colorScheme: \"primary\",\n  },\n  baseStyle: {\n    container: {\n      borderColor: \"gray.200\",\n      _dark: {\n        borderColor: \"gray.700\",\n      },\n    },\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/form.ts",
    "content": "import { formAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(formAnatomy.keys)\nexport const Form = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    return {\n      helperText: {\n        color: mode(\"gray.500\", \"gray.300\")(props),\n      },\n    }\n  }),\n  variants: {\n    contrast: definePartsStyle((props) => {\n      return {\n        helperText: {\n          color: mode(\"gray.600\", \"gray.300\")(props),\n        },\n      }\n    }),\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/index.ts",
    "content": "export { ThemeProvider } from \"./ThemeProvider\"\nexport { useBorderColor } from \"./themeHooks\"\n"
  },
  {
    "path": "desktop/src/Theme/input.ts",
    "content": "import { inputAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(\n  inputAnatomy.keys\n)\nexport const Input = defineMultiStyleConfig({\n  variants: {\n    outline: definePartsStyle(() => {\n      return {\n        addon: {\n          borderColor: \"gray.200\",\n          _dark: {\n            borderColor: \"gray.800\",\n          },\n        },\n        field: {\n          borderColor: \"gray.200\",\n          _dark: {\n            borderColor: \"gray.800\",\n          },\n        },\n      }\n    }),\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/menu.ts",
    "content": "import { menuAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(menuAnatomy.keys)\nexport const Menu = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    return {\n      item: {\n        fontSize: \"sm\",\n        bg: mode(\"white\", \"gray.900\")(props),\n        _selected: {\n          bg: mode(\"gray.200\", \"gray.800\")(props),\n        },\n        _hover: {\n          bg: mode(\"gray.100\", \"gray.700\")(props),\n        },\n        borderColor: \"gray.200\",\n        _dark: {\n          borderColor: \"gray.700\",\n        },\n      },\n      list: {\n        bg: mode(\"white\", \"gray.900\")(props),\n        borderColor: \"gray.200\",\n        _dark: {\n          borderColor: \"gray.700\",\n        },\n      },\n      divider: {\n        borderColor: \"gray.200\",\n        _dark: {\n          borderColor: \"gray.700\",\n        },\n      },\n    }\n  }),\n})\n"
  },
  {
    "path": "desktop/src/Theme/modal.ts",
    "content": "import { modalAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(\n  modalAnatomy.keys\n)\nexport const Modal = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    return {\n      body: {\n        bg: mode(\"white\", \"gray.900\")(props),\n      },\n      dialog: {\n        bg: mode(\"white\", \"gray.900\")(props),\n      },\n    }\n  }),\n})\n"
  },
  {
    "path": "desktop/src/Theme/popover.ts",
    "content": "import { popoverAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers, cssVar } from \"@chakra-ui/react\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(\n  popoverAnatomy.keys\n)\nexport const Popover = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    const theme = props.theme\n    let bg = theme.colors.white\n    if (props.colorMode == \"dark\") {\n      bg = theme.colors.gray[\"900\"]\n    }\n\n    return {\n      content: {\n        borderColor: \"gray.200\",\n        bg,\n        boxShadow: theme.shadows.xl,\n        _focusVisible: {\n          outline: \"2px solid transparent\",\n          outlineOffset: \"2px\",\n          boxShadow: theme.shadows.xl,\n        },\n        [cssVar(\"popper-bg\").variable]: bg,\n        _dark: {\n          [cssVar(\"popper-arrow-bg\").variable]: bg,\n          borderColor: \"gray.700\",\n        },\n      },\n      arrow: { bg },\n      popper: {\n        zIndex: theme.zIndices.popover,\n        bg,\n      },\n      header: {\n        display: \"flex\",\n        alignItems: \"center\",\n        flexFlow: \"row nowrap\",\n        padding: 4,\n        spacing: 0,\n        justifyContent: \"space-between\",\n        borderBottomWidth: \"thin\",\n        borderColor: \"inherit\",\n        fontWeight: \"bold\",\n        p: {\n          fontWeight: \"normal\",\n        },\n      },\n    }\n  }),\n})\n"
  },
  {
    "path": "desktop/src/Theme/radio.ts",
    "content": "import { radioAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\n\nconst { defineMultiStyleConfig } = createMultiStyleConfigHelpers(radioAnatomy.keys)\n\nexport const Radio = defineMultiStyleConfig({\n  defaultProps: {\n    colorScheme: \"primary\",\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/select.ts",
    "content": "import { selectAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(\n  selectAnatomy.keys\n)\nexport const Select = defineMultiStyleConfig({\n  baseStyle: definePartsStyle({\n    addon: {\n      borderColor: \"gray.200\",\n      _dark: {\n        borderColor: \"gray.700\",\n      },\n    },\n    field: {\n      borderColor: \"gray.200\",\n      _dark: {\n        borderColor: \"gray.700\",\n      },\n    },\n  }),\n  variants: {\n    outline: definePartsStyle(() => {\n      return {\n        addon: {\n          border: \"\",\n          borderWidth: \"thin\",\n          borderStyle: \"solid\",\n          borderColor: \"gray.200\",\n          _dark: {\n            borderColor: \"gray.700\",\n          },\n        },\n        field: {\n          border: \"\",\n          borderWidth: \"thin\",\n          borderStyle: \"solid\",\n          borderColor: \"gray.200\",\n          _dark: {\n            borderColor: \"gray.700\",\n          },\n        },\n      }\n    }),\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/switch.ts",
    "content": "import { switchAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(\n  switchAnatomy.keys\n)\nexport const Switch = defineMultiStyleConfig({\n  baseStyle: definePartsStyle(({ theme }) => {\n    const from = theme.colors.primary[\"400\"]\n    const to = theme.colors.primary[\"800\"]\n\n    return {\n      track: {\n        _checked: {\n          background: `linear-gradient(90deg, ${from} 30%, ${to})`,\n        },\n      },\n    }\n  }),\n})\n"
  },
  {
    "path": "desktop/src/Theme/tabs.ts",
    "content": "import { tabsAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(tabsAnatomy.keys)\n\nconst muted = definePartsStyle((props) => {\n  return {\n    tab: {\n      bg: mode(\"white\", \"black\")(props),\n      fontWeight: \"medium\",\n      _selected: {\n        bg: mode(\"gray.100\", \"gray.900\")(props),\n      },\n      _hover: {\n        bg: mode(\"gray.50\", \"gray.700\")(props),\n      },\n    },\n    tablist: {\n      width: \"fit-content\",\n      borderWidth: \"thin\",\n      borderColor: \"inherit\",\n      borderRadius: \"md\",\n      \"> *:not(:last-child, :first-child)\": {\n        borderRightWidth: \"thin\",\n        borderRightColor: \"inherit\",\n        borderRadius: \"0\",\n      },\n      \"> :first-child\": {\n        borderTopLeftRadius: \"md\",\n        borderBottomLeftRadius: \"md\",\n        borderRightWidth: \"thin\",\n        borderRightColor: \"inherit\",\n      },\n      \"> :last-child\": {\n        borderTopRightRadius: \"md\",\n        borderBottomRightRadius: \"md\",\n      },\n    },\n  }\n})\nconst enclosed = definePartsStyle((props) => {\n  return {\n    tab: {\n      fontWeight: \"medium\",\n      _selected: {\n        color: mode(\"primary.600\", \"primary.300\")(props),\n      },\n      _hover: {\n        bg: mode(\"gray.50\", \"gray.800\")(props),\n      },\n    },\n  }\n})\n\nconst mutedPopover = definePartsStyle((props) => {\n  return {\n    tab: {\n      bg: mode(\"white\", \"gray.900\")(props),\n      fontWeight: \"medium\",\n      _selected: {\n        bg: mode(\"gray.100\", \"gray.800\")(props),\n      },\n      _hover: {\n        bg: mode(\"gray.50\", \"gray.700\")(props),\n      },\n    },\n    tablist: {\n      width: \"fit-content\",\n      borderWidth: \"thin\",\n      borderColor: \"inherit\",\n      borderRadius: \"md\",\n      \"> *:not(:last-child, :first-child)\": {\n        borderRightWidth: \"thin\",\n        borderRightColor: \"inherit\",\n        borderRadius: \"0\",\n      },\n      \"> :first-child\": {\n        borderTopLeftRadius: \"md\",\n        borderBottomLeftRadius: \"md\",\n        borderRightWidth: \"thin\",\n        borderRightColor: \"inherit\",\n      },\n      \"> :last-child\": {\n        borderTopRightRadius: \"md\",\n        borderBottomRightRadius: \"md\",\n      },\n    },\n  }\n})\n\nconst variants = {\n  muted,\n  enclosed,\n  \"muted-popover\": mutedPopover,\n}\n\nexport const Tabs = defineMultiStyleConfig({ variants })\n"
  },
  {
    "path": "desktop/src/Theme/tag.ts",
    "content": "import { tagAnatomy } from \"@chakra-ui/anatomy\"\nimport { createMultiStyleConfigHelpers } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nconst { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(tagAnatomy.keys)\n\nexport const Tag = defineMultiStyleConfig({\n  baseStyle: definePartsStyle((props) => {\n    return {\n      container: {\n        bg: mode(\"gray.200\", \"gray.700\")(props),\n        color: mode(\"gray.800\", \"gray.100\")(props),\n      },\n    }\n  }),\n  variants: {\n    ghost: definePartsStyle(() => {\n      return {\n        container: {\n          bg: \"transparent\",\n        },\n      }\n    }),\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/text.ts",
    "content": "import { defineStyleConfig } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\n\nexport const Text = defineStyleConfig({\n  variants: {\n    muted(props) {\n      return {\n        color: mode(\"gray.600\", \"gray.400\")(props),\n      }\n    },\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/textarea.ts",
    "content": "import { defineStyleConfig } from \"@chakra-ui/react\"\n\nexport const Textarea = defineStyleConfig({\n  variants: {\n    outline: {\n      borderColor: \"gray.200\",\n      _dark: {\n        borderColor: \"gray.800\",\n      },\n    },\n  },\n})\n"
  },
  {
    "path": "desktop/src/Theme/theme.ts",
    "content": "import { Theme, ThemeOverride, Tooltip, defineStyleConfig, extendTheme } from \"@chakra-ui/react\"\nimport { mode } from \"@chakra-ui/theme-tools\"\nimport { Button } from \"./button\"\nimport { Card } from \"./card\"\nimport { Checkbox } from \"./checkbox\"\nimport { Form } from \"./form\"\nimport { Input } from \"./input\"\nimport { Menu } from \"./menu\"\nimport { Modal } from \"./modal\"\nimport { Popover } from \"./popover\"\nimport { Radio } from \"./radio\"\nimport { Select } from \"./select\"\nimport { Switch } from \"./switch\"\nimport { Tabs } from \"./tabs\"\nimport { Tag } from \"./tag\"\nimport { Text } from \"./text\"\nimport { Textarea } from \"./textarea\"\n\nconst Code = defineStyleConfig({\n  variants: {\n    decorative(props) {\n      return {\n        backgroundColor: \"primary.400\",\n        color: mode(\"white\", \"gray.900\")(props),\n      }\n    },\n  },\n})\n\nconst Link = defineStyleConfig({\n  defaultProps: {\n    variant: \"primary\",\n  },\n  variants: {\n    muted(props) {\n      return { color: mode(\"gray.600\", \"gray.400\")(props) }\n    },\n    primary(props) {\n      const primary = props.theme.colors.primary\n\n      return { color: mode(primary[\"800\"], primary[\"400\"])(props) }\n    },\n  },\n})\n\nconst FormError = defineStyleConfig({\n  baseStyle: {\n    text: {\n      userSelect: \"text\",\n      cursor: \"text\",\n    },\n  },\n})\n\nconst TooltipTheme = defineStyleConfig({\n  baseStyle(props) {\n    return {\n      bg: mode(\"gray.800\", \"gray.200\")(props),\n      color: mode(\"gray.100\", \"gray.800\")(props),\n    }\n  },\n})\n\n// It's ugly but it works: https://github.com/chakra-ui/chakra-ui/issues/1424#issuecomment-743342944\n// Unfortunately there is no other way of overring the default placement.\nTooltip.defaultProps = { ...Tooltip.defaultProps, placement: \"top\" }\n\nexport const theme = extendTheme({\n  styles: {\n    global({ colorMode }) {\n      return {\n        html: {\n          fontSize: \"14px\",\n          overflow: \"hidden\",\n          background: \"transparent\",\n          position: \"fixed\",\n        },\n        body: {\n          background: \"transparent\",\n          userSelect: \"none\",\n          cursor: \"default\",\n        },\n        td: {\n          userSelect: \"text\",\n        },\n        code: {\n          userSelect: \"text\",\n          cursor: \"text\",\n        },\n        \"input::placeholder\": {\n          color: colorMode === \"light\" ? \"gray.500\" : \"gray.400\",\n        },\n      }\n    },\n  },\n  colors: {\n    primary: {\n      50: \"#F8EFFF\",\n      100: \"#F0DFFF\",\n      200: \"#D8ABFF\",\n      300: \"#BF76FF\",\n      400: \"#B157FF\",\n      500: \"#A640FF\",\n      600: \"#9B29FF\",\n      700: \"#8600DC\",\n      800: \"#7100B9\",\n      900: \"#40006A\",\n    },\n    gray: {\n      50: \"#F7F5F9\",\n      100: \"#ECE8F0\",\n      200: \"#DCD6E1\",\n      300: \"#C5BFC9\",\n      400: \"#ABA5B0\",\n      500: \"#948E99\",\n      600: \"#7C7581\",\n      700: \"#655E69\",\n      800: \"#4A464D\",\n      900: \"#2C2630\",\n    },\n    text: {\n      secondary: \"#465E75\",\n      tertiary: \"#5C7997\",\n    },\n    divider: {\n      main: \"#B0C3D6\",\n      light: \"#DCE5EE\",\n      dark: \"#465E75\",\n    },\n    background: {\n      darkest: \"rgb(16, 18, 20)\",\n    },\n  },\n  config: {\n    initialColorMode: \"system\",\n    useSystemColorMode: true,\n  },\n  components: {\n    Button,\n    Card,\n    Code,\n    Menu,\n    Switch,\n    Tabs,\n    Checkbox,\n    Radio,\n    Link,\n    Form,\n    FormError,\n    Popover,\n    Modal,\n    Tag,\n    Input,\n    Select,\n    Text,\n    Textarea,\n    Tooltip: TooltipTheme,\n  },\n} satisfies ThemeOverride) as Theme\n"
  },
  {
    "path": "desktop/src/Theme/themeHooks.tsx",
    "content": "import { useColorModeValue } from \"@chakra-ui/react\"\n\nexport function useBorderColor() {\n  return useColorModeValue(\"gray.200\", \"gray.700\")\n}\n"
  },
  {
    "path": "desktop/src/client/client.ts",
    "content": "import { UseToastOptions } from \"@chakra-ui/react\"\nimport { app, event, path } from \"@tauri-apps/api\"\nimport { invoke } from \"@tauri-apps/api/core\"\nimport { Theme as TauriTheme, getCurrentWindow } from \"@tauri-apps/api/window\"\nimport * as clipboard from \"@tauri-apps/plugin-clipboard-manager\"\nimport * as dialog from \"@tauri-apps/plugin-dialog\"\nimport * as fs from \"@tauri-apps/plugin-fs\"\nimport * as log from \"@tauri-apps/plugin-log\"\nimport * as os from \"@tauri-apps/plugin-os\"\nimport * as process from \"@tauri-apps/plugin-process\"\nimport * as shell from \"@tauri-apps/plugin-shell\"\nimport { Command } from \"@tauri-apps/plugin-shell\"\nimport * as updater from \"@tauri-apps/plugin-updater\"\nimport { TSettings } from \"../contexts\"\nimport { Release } from \"../gen\"\nimport { Result, Return, hasCapability, isError, noop } from \"../lib\"\nimport { TCommunityContributions, TProInstance, TUnsubscribeFn } from \"../types\"\nimport { Command as DevPodCommand } from \"./command\"\nimport { ContextClient } from \"./context\"\nimport { IDEsClient } from \"./ides\"\nimport { ProClient } from \"./pro\"\nimport { DaemonClient } from \"./pro/client\"\nimport { ProvidersClient } from \"./providers\"\nimport { TAURI_SERVER_URL } from \"./tauriClient\"\nimport { WorkspacesClient } from \"./workspaces\"\n\n// These types have to match the rust types! Make sure to update them as well!\ntype TChannels = {\n  event:\n    | Readonly<{\n        type: \"ShowToast\"\n        message: string\n        title: string\n        status: NonNullable<UseToastOptions[\"status\"]>\n      }>\n    | Readonly<{ type: \"ShowDashboard\" }>\n    | Readonly<{ type: \"CommandFailed\" }>\n    | Readonly<{\n        type: \"OpenWorkspace\"\n        workspace_id: string | null\n        provider_id: string | null\n        ide: string | null\n        source: string\n      }>\n    | Readonly<{\n        type: \"ImportWorkspace\"\n        workspace_id: string\n        workspace_uid: string\n        devpod_pro_host: string\n        project: string\n        options: Record<string, string> | null\n      }>\n    | Readonly<{\n        type: \"SetupPro\"\n        host: string\n        accessKey: string | null\n        options: Record<string, string> | null\n      }>\n    | Readonly<{\n        type: \"OpenProInstance\"\n        host: string | null\n      }>\n    | Readonly<{\n        type: \"LoginRequired\"\n        host: string\n        provider: string\n      }>\n}\ntype TChannelName = keyof TChannels\ntype TClientEventListener<TChannel extends TChannelName> = (payload: TChannels[TChannel]) => void\ntype TClientSettings = Pick<\n  TSettings,\n  | \"debugFlag\"\n  | \"additionalCliFlags\"\n  | \"dotfilesUrl\"\n  | \"additionalEnvVars\"\n  | \"sshKeyPath\"\n  | \"httpProxyUrl\"\n  | \"httpsProxyUrl\"\n  | \"noProxy\"\n>\nexport type TPlatform = Awaited<ReturnType<typeof os.platform>>\nexport type TArch = Awaited<ReturnType<typeof os.arch>>\n\nclass Client {\n  public readonly workspaces = new WorkspacesClient()\n  public readonly providers = new ProvidersClient()\n  public readonly ides = new IDEsClient()\n  public readonly context = new ContextClient()\n  public readonly pro = new ProClient(\"\")\n\n  public setSetting<TSettingName extends keyof TClientSettings>(\n    name: TSettingName,\n    value: TSettings[TSettingName]\n  ) {\n    if (name === \"debugFlag\") {\n      const debug: boolean = value as boolean\n      this.workspaces.setDebug(debug)\n      this.providers.setDebug(debug)\n      this.ides.setDebug(debug)\n      this.pro.setDebug(debug)\n    }\n    if (name === \"additionalCliFlags\") {\n      this.workspaces.setAdditionalFlags(value as string)\n    }\n    if (name === \"dotfilesUrl\") {\n      this.workspaces.setDotfilesFlag(value as string)\n    }\n    if (name === \"sshKeyPath\") {\n      this.workspaces.setSSHKeyPath(value as string)\n    }\n    if (name === \"additionalEnvVars\") {\n      DevPodCommand.ADDITIONAL_ENV_VARS = value as string\n    }\n    if (name === \"httpProxyUrl\") {\n      DevPodCommand.HTTP_PROXY = value as string\n    }\n    if (name === \"httpsProxyUrl\") {\n      DevPodCommand.HTTPS_PROXY = value as string\n    }\n    if (name === \"noProxy\") {\n      DevPodCommand.NO_PROXY = value as string\n    }\n  }\n\n  public ready(): Promise<void> {\n    return invoke(\"ui_ready\")\n  }\n\n  public async subscribe<T extends TChannelName>(\n    channel: T,\n    listener: TClientEventListener<T>\n  ): Promise<TUnsubscribeFn> {\n    // `TClient` is strictly typed so we're fine casting the response as `any`.\n    try {\n      const unsubscribe = await event.listen<any>(channel, (event) => {\n        listener(event.payload)\n      })\n\n      return unsubscribe\n    } catch {\n      return noop\n    }\n  }\n\n  // emitEvent publishes to a given channel and invokes the corresponding handler.\n  // This is only intended to be used for debugging right now.\n  public emitEvent<T extends TChannelName>(e: TChannels[T]) {\n    event.emit(\"event\", e)\n  }\n\n  public fetchPlatform(): TPlatform {\n    return os.platform()\n  }\n\n  public pathSeparator(): string {\n    return path.sep()\n  }\n\n  public fetchArch(): TArch {\n    return os.arch()\n  }\n\n  public fetchVersion(): Promise<string> {\n    return app.getVersion()\n  }\n\n  public async fetchCommunityContributions(): Promise<Result<TCommunityContributions>> {\n    try {\n      const contributions = await invoke<TCommunityContributions>(\"get_contributions\")\n\n      return Return.Value(contributions)\n    } catch (e) {\n      if (isError(e)) {\n        return Return.Failed(e.message)\n      }\n\n      const errMsg = \"Unable to fetch community contributions\"\n      if (typeof e === \"string\") {\n        return Return.Failed(`${errMsg}: ${e}`)\n      }\n\n      return Return.Failed(errMsg)\n    }\n  }\n\n  public async fetchReleases(): Promise<Result<readonly Release[]>> {\n    try {\n      // WARN: This is a workaround for a memory leak in tauri, see https://github.com/tauri-apps/tauri/issues/4026 for more details.\n      // tl;dr tauri doesn't release the memory in it's invoke api properly which is specially noticeable with larger payload, like the releases.\n      const res = await fetch(TAURI_SERVER_URL + \"/releases\")\n      if (!res.ok) {\n        return Return.Failed(`Fetch releases: ${res.statusText}`)\n      }\n      const releases = (await res.json()) as readonly Release[]\n\n      return Return.Value(releases)\n    } catch (e) {\n      // return empty list if error during development\n      if (isError(e)) {\n        return Return.Failed(e.message)\n      }\n\n      const errMsg = \"Unable to fetch releases\"\n      if (typeof e === \"string\") {\n        return Return.Failed(`${errMsg}: ${e}`)\n      }\n\n      return Return.Failed(errMsg)\n    }\n  }\n\n  public async getDir(\n    dir: Extract<keyof typeof fs.BaseDirectory, \"AppData\" | \"AppLog\" | \"Home\"> | \"SSH\"\n  ): Promise<string> {\n    switch (dir) {\n      case \"AppData\": {\n        return path.appDataDir()\n      }\n      case \"AppLog\": {\n        return await path.appLogDir()\n      }\n      case \"Home\": {\n        return await path.homeDir()\n      }\n      case \"SSH\": {\n        return await path.join(await path.homeDir(), \".ssh\")\n      }\n    }\n  }\n\n  public async openDir(\n    dir: Extract<keyof typeof fs.BaseDirectory, \"AppData\" | \"AppLog\">\n  ): Promise<void> {\n    try {\n      let p = await this.getDir(dir)\n      if (dir === \"AppLog\") {\n        p = await path.join(p, \"DevPod.log\")\n      }\n\n      shell.open(p)\n    } catch {\n      // noop for now\n    }\n  }\n\n  public async selectFromDir(title?: string): Promise<string | null> {\n    return dialog.open({ title, directory: true, multiple: false })\n  }\n\n  public async selectFileYaml(): Promise<string | string[] | null> {\n    return dialog.open({\n      filters: [{ name: \"yaml\", extensions: [\"yml\", \"yaml\"] }],\n      directory: false,\n      multiple: false,\n    })\n  }\n\n  public async selectFile(defaultPath?: string): Promise<string | string[] | null> {\n    return dialog.open({ directory: false, multiple: false, defaultPath })\n  }\n\n  public async copyFile(src: string, dest: string): Promise<void> {\n    return fs.copyFile(src, dest)\n  }\n\n  public async copyFilePaths(src: string[], dest: string[]) {\n    return this.copyFile(await path.join(...src), await path.join(...dest))\n  }\n\n  public async writeTextFile(targetPath: string[], data: string) {\n    return fs.writeTextFile(await path.join(...targetPath), data)\n  }\n\n  public async readFile(targetPath: string[]) {\n    return fs.readFile(await path.join(...targetPath))\n  }\n\n  public async readTextFile(targetPath: string[]) {\n    return fs.readTextFile(await path.join(...targetPath))\n  }\n\n  public async writeFile(targetPath: string[], data: Uint8Array) {\n    return fs.writeFile(await path.join(...targetPath), data)\n  }\n\n  public async installCLI(force: boolean = false): Promise<Result<void>> {\n    try {\n      await invoke(\"install_cli\", { force })\n\n      return Return.Ok()\n    } catch (e) {\n      if (isError(e)) {\n        return Return.Failed(e.message)\n      }\n\n      if (typeof e === \"string\") {\n        return Return.Failed(`Failed to install CLI: ${e}`)\n      }\n\n      return Return.Failed(\"Unable to install CLI\")\n    }\n  }\n\n  public async getEnv(name: string): Promise<boolean> {\n    return invoke<boolean>(\"get_env\", { name })\n  }\n\n  public async isCLIInstalled(): Promise<Result<boolean>> {\n    try {\n      // we're in a flatpak, we need to check in other paths.\n      const isFlatpak = await this.getEnv(\"FLATPAK_ID\")\n      if (isFlatpak) {\n        this.log(\"debug\", \"Running in flatpak, checking ~/.local/bin on the host\");\n        const home_dir = await this.getEnv(\"HOME\")\n        // this will throw if doesn't exist\n        const exists = await invoke<boolean>(\"file_exists\", {\n          filepath: home_dir + \"/.local/bin/devpod\",\n        })\n\n        return Return.Value(exists)\n      }\n\n      const result = await Command.create(\"run-path-devpod-cli\", [\"version\"]).execute()\n      if (result.code !== 0) {\n        return Return.Value(false)\n      }\n\n      return Return.Value(true)\n    } catch {\n      return Return.Value(false)\n    }\n  }\n\n  public open(link: string): void {\n    shell.open(link)\n  }\n\n  public async quit(): Promise<Result<void>> {\n    try {\n      await process.exit(0)\n\n      return Return.Ok()\n    } catch {\n      return Return.Failed(\"Unable to quit\")\n    }\n  }\n\n  public async writeToClipboard(data: string): Promise<Result<void>> {\n    try {\n      await clipboard.writeText(data)\n\n      return Return.Ok()\n    } catch (e) {\n      return Return.Failed(`Unable to write to clipboard: ${e}`)\n    }\n  }\n\n  public async checkUpdates(): Promise<Result<boolean>> {\n    try {\n      const isOk = await invoke<boolean>(\"check_updates\")\n\n      return Return.Value(isOk)\n    } catch (e) {\n      return Return.Failed(`${e}`)\n    }\n  }\n\n  public async fetchPendingUpdate(): Promise<Result<Release>> {\n    try {\n      const release = await invoke<Release>(\"get_pending_update\")\n\n      return Return.Value(release)\n    } catch (e) {\n      return Return.Failed(`${e}`)\n    }\n  }\n\n  public async installUpdate(): Promise<Result<void>> {\n    try {\n      const update = await updater.check()\n      if (!update) {\n        return Return.Ok()\n      }\n\n      await update.install()\n\n      return Return.Ok()\n    } catch (e) {\n      return Return.Failed(`${e}`)\n    }\n  }\n\n  public async restart(): Promise<void> {\n    await process.relaunch()\n  }\n  public async closeCurrentWindow(): Promise<void> {\n    await getCurrentWindow().close()\n  }\n\n  public async getSystemTheme(): Promise<TauriTheme | null> {\n    return getCurrentWindow().theme()\n  }\n\n  public log(level: \"debug\" | \"info\" | \"warn\" | \"error\", message: string) {\n    const logFn = log[level]\n    logFn(message)\n  }\n\n  public getProClient(proInstance: TProInstance): ProClient | DaemonClient {\n    if (hasCapability(proInstance, \"daemon\")) {\n      return new DaemonClient(proInstance.host!)\n    } else {\n      return new ProClient(proInstance.host!)\n    }\n  }\n}\n\n// Singleton client\nexport const client = new Client()\n"
  },
  {
    "path": "desktop/src/client/command.ts",
    "content": "import {\n  Child,\n  ChildProcess,\n  EventEmitter,\n  Command as ShellCommand,\n} from \"@tauri-apps/plugin-shell\"\nimport { debug, ErrorTypeCancelled, isError, Result, ResultError, Return, sleep } from \"../lib\"\nimport { DEVPOD_BINARY, DEVPOD_FLAG_OPTION, DEVPOD_UI_ENV_VAR, DEVPOD_ADDITIONAL_ENV_VARS } from \"./constants\"\nimport { TStreamEvent } from \"./types\"\nimport { TAURI_SERVER_URL } from \"./tauriClient\"\nimport * as log from \"@tauri-apps/plugin-log\"\nimport { invoke } from \"@tauri-apps/api/core\"\n\nexport type TStreamEventListenerFn = (event: TStreamEvent) => void\nexport type TEventListener<TEventName extends string> = Parameters<\n  EventEmitter<Record<TEventName, string>>[\"addListener\"]\n>[1]\ntype TStreamOptions = Readonly<{\n  ignoreStdoutError?: boolean\n  ignoreStderrError?: boolean\n}>\nconst defaultStreamOptions: TStreamOptions = {\n  ignoreStdoutError: false,\n  ignoreStderrError: false,\n}\n\nexport type TCommand<T> = {\n  run(): Promise<Result<T>>\n  stream(listener: TStreamEventListenerFn): Promise<ResultError>\n  cancel(): Promise<ResultError>\n}\n\nexport class Command implements TCommand<ChildProcess<string>> {\n  private sidecarCommand: ShellCommand<string>\n  private childProcess?: Child\n  private args: string[]\n  private cancelled = false\n  private isFlatpak: boolean | undefined\n  private extraEnvVars: Record<string, string>\n\n  public static ADDITIONAL_ENV_VARS: string = \"\"\n  public static HTTP_PROXY: string = \"\"\n  public static HTTPS_PROXY: string = \"\"\n  public static NO_PROXY: string = \"\"\n\n  constructor(args: string[]) {\n    debug(\"commands\", \"Creating Devpod command with args: \", args)\n    this.extraEnvVars = Command.ADDITIONAL_ENV_VARS.split(\",\")\n      .map((envVarStr) => envVarStr.split(\"=\"))\n      .reduce(\n        (acc, pair) => {\n          const [key, value] = pair\n          if (key === undefined || value === undefined) {\n            return acc\n          }\n\n          return { ...acc, [key]: value }\n        },\n        {} as Record<string, string>\n      )\n\n    // set proxy related environment variables\n    if (Command.HTTP_PROXY) {\n      this.extraEnvVars[\"HTTP_PROXY\"] = Command.HTTP_PROXY\n    }\n    if (Command.HTTPS_PROXY) {\n      this.extraEnvVars[\"HTTPS_PROXY\"] = Command.HTTPS_PROXY\n    }\n    if (Command.NO_PROXY) {\n      this.extraEnvVars[\"NO_PROXY\"] = Command.NO_PROXY\n    }\n\n    // allows the CLI to detect if commands have been invoked from the UI\n    this.extraEnvVars[DEVPOD_UI_ENV_VAR] = \"true\"\n    this.sidecarCommand = ShellCommand.sidecar(DEVPOD_BINARY, args, { env: this.extraEnvVars })\n    this.args = args\n  }\n\n  public async getEnv(name: string): Promise<boolean> {\n    return invoke<boolean>(\"get_env\", { name })\n  }\n\n  public async run(): Promise<Result<ChildProcess<string>>> {\n    try {\n      // Run once to check with the rust backend if we are running inside the flatpak sandbox\n      // This informs the CLI wrapper to use flatpak-spawn to escape the sandbox and export this.extraEnvVars\n      if (this.isFlatpak === undefined) {\n        this.isFlatpak = await this.getEnv(\"FLATPAK_ID\")\n        if (this.isFlatpak) {\n          this.extraEnvVars[\"FLATPAK_ID\"] = \"sh.loft.devpod\"\n          this.extraEnvVars[DEVPOD_ADDITIONAL_ENV_VARS] = recordToCSV(this.extraEnvVars)\n          this.sidecarCommand = ShellCommand.sidecar(DEVPOD_BINARY, this.args, { env: this.extraEnvVars })\n        }\n      }\n      const rawResult = await this.sidecarCommand.execute()\n      debug(\"commands\", `Result for command with args ${this.args}:`, rawResult)\n\n      return Return.Value(rawResult)\n    } catch (e) {\n      return Return.Failed(e + \"\")\n    }\n  }\n\n  public async stream(\n    listener: TStreamEventListenerFn,\n    streamOptions?: TStreamOptions\n  ): Promise<ResultError> {\n    let opts = defaultStreamOptions\n    if (streamOptions) {\n      opts = { ...defaultStreamOptions, ...streamOptions }\n    }\n\n    try {\n      this.childProcess = await this.sidecarCommand.spawn()\n      if (this.cancelled) {\n        await this.childProcess.kill()\n\n        return Return.Failed(\"Command already cancelled\", \"\", ErrorTypeCancelled)\n      }\n\n      await new Promise((res, rej) => {\n        const stdoutListener: TEventListener<\"data\"> = (message) => {\n          try {\n            const data = JSON.parse(message)\n\n            // special case: the cli sends us a message where \"done\" is \"true\"\n            // to signal the command is terminated and we should stop listen to it\n            // This happens for the vscode browser command as it needs to stay open\n            // for port-forwarding, but we don't care anymore about its output.\n            if (data?.done === \"true\") {\n              res(Return.Ok())\n            } else {\n              listener({ type: \"data\", data })\n            }\n          } catch (error) {\n            if (!opts.ignoreStdoutError) {\n              console.error(\"Failed to parse stdout message \", message, error)\n            }\n          }\n        }\n        const stderrListener: TEventListener<\"data\"> = (message) => {\n          try {\n            const error = JSON.parse(message)\n            listener({ type: \"error\", error })\n          } catch (error) {\n            if (!opts.ignoreStderrError) {\n              console.error(\"Failed to parse stderr message \", message, error)\n            }\n          }\n        }\n\n        this.sidecarCommand.stderr.addListener(\"data\", stderrListener)\n        this.sidecarCommand.stdout.addListener(\"data\", stdoutListener)\n\n        const cleanup = () => {\n          this.sidecarCommand.stderr.removeListener(\"data\", stderrListener)\n          this.sidecarCommand.stdout.removeListener(\"data\", stdoutListener)\n          this.childProcess = undefined\n        }\n\n        this.sidecarCommand.on(\"close\", ({ code }) => {\n          cleanup()\n          if (code !== 0) {\n            rej(new Error(\"exit code: \" + code))\n          } else {\n            res(Return.Ok())\n          }\n        })\n\n        this.sidecarCommand.on(\"error\", (arg) => {\n          cleanup()\n          rej(arg)\n        })\n      })\n\n      return Return.Ok()\n    } catch (e) {\n      if (isError(e)) {\n        if (this.cancelled) {\n          return Return.Failed(e.message, \"\", ErrorTypeCancelled)\n        }\n\n        return Return.Failed(e.message)\n      }\n      console.error(e)\n\n      return Return.Failed(\"streaming failed\")\n    }\n  }\n\n  /**\n   * Cancel the command.\n   * Only works if it has been created with the `stream` method.\n   */\n  public async cancel(): Promise<Result<undefined>> {\n    try {\n      this.cancelled = true\n      if (!this.childProcess) {\n        // nothing to clean up\n        return Return.Ok()\n      }\n      // Try to send signal first before force killing process\n      await fetch(TAURI_SERVER_URL + \"/child-process/signal\", {\n        method: \"POST\",\n        headers: {\n          \"content-type\": \"application/json\",\n        },\n        body: JSON.stringify({\n          processId: this.childProcess.pid,\n          signal: 2, // SIGINT\n        }),\n      })\n\n      await sleep(3_000)\n      // the actual child process could be gone after sending a SIGINT\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      if (this.childProcess) {\n        await this.childProcess.kill()\n      }\n\n      return Return.Ok()\n    } catch (e) {\n      if (isError(e)) {\n        return Return.Failed(e.message)\n      }\n\n      return Return.Failed(\"failed to cancel command\")\n    }\n  }\n}\n\nexport function isOk(result: ChildProcess<string>): boolean {\n  return result.code === 0\n}\n\nexport function toFlagArg(flag: string, arg: string) {\n  return [flag, arg].join(\"=\")\n}\n\nexport function serializeRawOptions(\n  rawOptions: Record<string, unknown>,\n  flag: string = DEVPOD_FLAG_OPTION\n): string[] {\n  return Object.entries(rawOptions).map(([key, value]) => flag + `=${key}=${value}`)\n}\n\nfunction recordToCSV(record: Record<string, string>): string {\n  return Object.entries(record)\n    .map(([key, value]) => `${key}=${value}`)\n    .join(',');\n}"
  },
  {
    "path": "desktop/src/client/commandCache.ts",
    "content": "import { TActionName } from \"../contexts\"\nimport { exists, isEmpty, noop, ResultError, SingleEventManager, THandler } from \"../lib\"\nimport { TUnsubscribeFn } from \"../types\"\nimport { TCommand, TStreamEventListenerFn } from \"./command\"\nimport { TStreamEvent } from \"./types\"\n\nexport type TCommandCacheInfo = Readonly<{ id: string; actionName: TActionName }>\ntype TCommandCacheID = `${string}:${TActionName}`\ntype TCommandHandler = Readonly<{\n  promise: Promise<ResultError>\n  stream?: (streamHandler?: THandler<TStreamEventListenerFn>) => TUnsubscribeFn\n  cancel?: () => Promise<ResultError>\n}>\ntype TCommandCacheStore = Map<TCommandCacheID, TCommandHandler>\n\nexport class CommandCache {\n  private store: TCommandCacheStore = new Map()\n\n  private getCacheID(info: TCommandCacheInfo): TCommandCacheID {\n    return `${info.id}:${info.actionName}`\n  }\n\n  public get(info: TCommandCacheInfo): TCommandHandler | undefined {\n    const cacheID = this.getCacheID(info)\n\n    return this.store.get(cacheID)\n  }\n\n  public findCommandHandlerById(id: string) {\n    for (const [cacheID, handler] of this.store) {\n      const [actionID] = cacheID.split(\":\")\n\n      if (actionID === id) {\n        return handler\n      }\n    }\n\n    return undefined\n  }\n\n  public clear(info: TCommandCacheInfo) {\n    const cacheID = this.getCacheID(info)\n    this.store.delete(cacheID)\n  }\n\n  public connect<T>(\n    info: TCommandCacheInfo,\n    cmd: Readonly<TCommand<T>>\n  ): Readonly<{\n    operation: TCommandHandler[\"promise\"]\n    stream: TCommandHandler[\"stream\"]\n  }> {\n    const events: TStreamEvent[] = []\n    const eventManager = new SingleEventManager<TStreamEvent>()\n\n    const promise = cmd.stream((event) => {\n      events.push(event)\n\n      eventManager.publish(event)\n    })\n    const stream: TCommandHandler[\"stream\"] = (handler) => {\n      if (!exists(handler)) {\n        return noop\n      }\n\n      //  events in-order before registering the new newHandler\n      if (!isEmpty(events)) {\n        for (const event of events) {\n          handler.notify(event)\n        }\n      }\n\n      // Make sure we subscribe handlers only once\n      if (eventManager.isSubscribed(handler)) {\n        return () => eventManager.unsubscribe(handler)\n      }\n\n      return eventManager.subscribe(handler)\n    }\n    const cancel: TCommandHandler[\"cancel\"] = () => {\n      return cmd.cancel()\n    }\n\n    const cacheID = this.getCacheID(info)\n    this.store.set(cacheID, {\n      promise,\n      stream,\n      cancel,\n    })\n\n    return { operation: promise, stream }\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/constants.ts",
    "content": "export const DEVPOD_GIT_REPOSITORY = \"https://github.com/loft-sh/devpod\"\n\nexport const DEFAULT_STATIC_COMMAND_CONFIG = {\n  streamResponse: false,\n  debug: false,\n} as const\n/** placeholder for arbitrary additional flags */\nexport const WORKSPACE_COMMAND_ADDITIONAL_FLAGS_KEY = \"additionalFlags\"\n\nexport const DEVPOD_BINARY = \"bin/devpod-cli\"\nexport const DEVPOD_COMMAND_LIST = \"list\"\nexport const DEVPOD_COMMAND_STATUS = \"status\"\nexport const DEVPOD_COMMAND_UP = \"up\"\nexport const DEVPOD_COMMAND_STOP = \"stop\"\nexport const DEVPOD_COMMAND_BUILD = \"build\"\nexport const DEVPOD_COMMAND_DELETE = \"delete\"\nexport const DEVPOD_COMMAND_PROVIDER = \"provider\"\nexport const DEVPOD_COMMAND_IDE = \"ide\"\nexport const DEVPOD_COMMAND_PRO = \"pro\"\nexport const DEVPOD_COMMAND_OPTIONS = \"options\"\nexport const DEVPOD_COMMAND_SET_OPTIONS = \"set-options\"\nexport const DEVPOD_COMMAND_USE = \"use\"\nexport const DEVPOD_COMMAND_ADD = \"add\"\nexport const DEVPOD_COMMAND_HELPER = \"helper\"\nexport const DEVPOD_COMMAND_UPDATE = \"update\"\nexport const DEVPOD_COMMAND_CONTEXT = \"context\"\nexport const DEVPOD_COMMAND_LOGIN = \"login\"\nexport const DEVPOD_COMMAND_IMPORT_WORKSPACE = \"import-workspace\"\nexport const DEVPOD_COMMAND_GET_WORKSPACE_NAME = \"get-workspace-name\"\nexport const DEVPOD_COMMAND_GET_WORKSPACE_UID = \"get-workspace-uid\"\nexport const DEVPOD_COMMAND_GET_WORKSPACE_CONFIG = \"get-workspace-config\"\nexport const DEVPOD_COMMAND_GET_PROVIDER_NAME = \"get-provider-name\"\nexport const DEVPOD_COMMAND_GET_PRO_NAME = \"get-pro-name\"\nexport const DEVPOD_COMMAND_CHECK_PROVIDER_UPDATE = \"check-provider-update\"\nexport const DEVPOD_COMMAND_TROUBLESHOOT = \"troubleshoot\"\nexport const DEVPOD_FLAG_JSON_LOG_OUTPUT = \"--log-output=json\"\nexport const DEVPOD_FLAG_JSON_OUTPUT = \"--output=json\"\nexport const DEVPOD_FLAG_OPTION = \"--option\"\nexport const DEVPOD_FLAG_FORCE = \"--force\"\nexport const DEVPOD_FLAG_FORCE_BUILD = \"--force-build\"\nexport const DEVPOD_FLAG_RECREATE = \"--recreate\"\nexport const DEVPOD_FLAG_RESET = \"--reset\"\nexport const DEVPOD_FLAG_IDE = \"--ide\"\nexport const DEVPOD_FLAG_PROVIDER = \"--provider\"\nexport const DEVPOD_FLAG_PROVIDER_OPTION = \"--provider-option\"\nexport const DEVPOD_FLAG_ACCESS_KEY = \"--access-key\"\nexport const DEVPOD_FLAG_PREBUILD_REPOSITORY = \"--prebuild-repository\"\nexport const DEVPOD_FLAG_ID = \"--id\"\nexport const DEVPOD_FLAG_SOURCE = \"--source\"\nexport const DEVPOD_FLAG_DEBUG = \"--debug\"\nexport const DEVPOD_FLAG_USE = \"--use\"\nexport const DEVPOD_FLAG_NAME = \"--name\"\nexport const DEVPOD_FLAG_SINGLE_MACHINE = \"--single-machine\"\nexport const DEVPOD_FLAG_DRY = \"--dry\"\nexport const DEVPOD_FLAG_RECONFIGURE = \"--reconfigure\"\nexport const DEVPOD_FLAG_SKIP_REQUIRED = \"--skip-required\"\nexport const DEVPOD_FLAG_TIMEOUT = \"--timeout\"\nexport const DEVPOD_FLAG_DEVCONTAINER_PATH = \"--devcontainer-path\"\nexport const DEVPOD_FLAG_WORKSPACE_ID = \"--workspace-id\"\nexport const DEVPOD_FLAG_WORKSPACE_UID = \"--workspace-uid\"\nexport const DEVPOD_FLAG_WORKSPACE_PROJECT = \"--workspace-project\"\nexport const DEVPOD_FLAG_LOGIN = \"--login\"\nexport const DEVPOD_FLAG_HOST = \"--host\"\nexport const DEVPOD_FLAG_INSTANCE = \"--instance\"\nexport const DEVPOD_FLAG_PROJECT = \"--project\"\nexport const DEVPOD_FLAG_SKIP_PRO = \"--skip-pro\"\nexport const DEVPOD_FLAG_DOTFILES = \"--dotfiles\"\nexport const DEVPOD_FLAG_GIT_SIGNING_KEY = \"--git-ssh-signing-key\"\nexport const DEVPOD_FLAG_FORCE_BROWSER = \"--force-browser\"\n\nexport const DEVPOD_UI_ENV_VAR = \"DEVPOD_UI\"\nexport const DEVPOD_ADDITIONAL_ENV_VARS = \"DEVPOD_ADDITIONAL_ENV_VARS\"\n"
  },
  {
    "path": "desktop/src/client/context/client.ts",
    "content": "import { Result, ResultError } from \"../../lib\"\nimport { TContextOptionName, TContextOptions } from \"../../types\"\nimport { TDebuggable } from \"../types\"\nimport { ContextCommands } from \"./contextCommands\"\n\nexport class ContextClient implements TDebuggable {\n  constructor() {}\n\n  public setDebug(isEnabled: boolean): void {\n    ContextCommands.DEBUG = isEnabled\n  }\n\n  public async setOption(option: TContextOptionName, value: string): Promise<ResultError> {\n    return ContextCommands.SetOptions({ [option]: value })\n  }\n\n  public async listOptions(): Promise<Result<TContextOptions>> {\n    return ContextCommands.ListOptions()\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/context/contextCommands.ts",
    "content": "import { Result, ResultError, Return, getErrorFromChildProcess } from \"../../lib\"\nimport { TContextOptionName, TContextOptions } from \"../../types\"\nimport { Command, isOk, serializeRawOptions } from \"../command\"\nimport {\n  DEVPOD_COMMAND_CONTEXT,\n  DEVPOD_COMMAND_OPTIONS,\n  DEVPOD_COMMAND_SET_OPTIONS,\n  DEVPOD_FLAG_DEBUG,\n  DEVPOD_FLAG_JSON_LOG_OUTPUT,\n  DEVPOD_FLAG_JSON_OUTPUT,\n} from \"../constants\"\n\nexport class ContextCommands {\n  static DEBUG = false\n\n  private static newCommand(args: string[]): Command {\n    return new Command([...args, ...(ContextCommands.DEBUG ? [DEVPOD_FLAG_DEBUG] : [])])\n  }\n\n  static async SetOptions(\n    rawOptions: Partial<Record<TContextOptionName, string>>\n  ): Promise<ResultError> {\n    const optionsFlag = serializeRawOptions(rawOptions)\n    const result = await ContextCommands.newCommand([\n      DEVPOD_COMMAND_CONTEXT,\n      DEVPOD_COMMAND_SET_OPTIONS,\n      ...optionsFlag,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async ListOptions(): Promise<Result<TContextOptions>> {\n    const result = await ContextCommands.newCommand([\n      DEVPOD_COMMAND_CONTEXT,\n      DEVPOD_COMMAND_OPTIONS,\n      DEVPOD_FLAG_JSON_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    const options = JSON.parse(result.val.stdout) as TContextOptions\n\n    return Return.Value(options)\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/context/index.ts",
    "content": "export { ContextClient } from \"./client\"\n"
  },
  {
    "path": "desktop/src/client/ides/client.ts",
    "content": "import { TDebuggable } from \"../types\"\nimport { Result, ResultError } from \"../../lib\"\nimport { TIDEs } from \"../../types\"\nimport { IDECommands } from \"./ideCommands\"\n\nexport class IDEsClient implements TDebuggable {\n  constructor() {}\n\n  public setDebug(isEnabled: boolean): void {\n    IDECommands.DEBUG = isEnabled\n  }\n\n  public async useIDE(ide: string): Promise<ResultError> {\n    return IDECommands.UseIDE(ide)\n  }\n\n  public async listAll(): Promise<Result<TIDEs>> {\n    return IDECommands.ListIDEs()\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/ides/ideCommands.ts",
    "content": "import { Command, isOk } from \"../command\"\nimport {\n  DEVPOD_COMMAND_IDE,\n  DEVPOD_COMMAND_LIST,\n  DEVPOD_COMMAND_USE,\n  DEVPOD_FLAG_DEBUG,\n  DEVPOD_FLAG_JSON_LOG_OUTPUT,\n  DEVPOD_FLAG_JSON_OUTPUT,\n} from \"../constants\"\nimport { getErrorFromChildProcess, Result, ResultError, Return } from \"@/lib\"\nimport { TIDEs } from \"@/types\"\n\nexport class IDECommands {\n  static DEBUG = false\n\n  private static newCommand(args: string[]): Command {\n    return new Command([...args, ...(IDECommands.DEBUG ? [DEVPOD_FLAG_DEBUG] : [])])\n  }\n\n  static async UseIDE(ide: string): Promise<ResultError> {\n    const result = await IDECommands.newCommand([\n      DEVPOD_COMMAND_IDE,\n      DEVPOD_COMMAND_USE,\n      ide,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async ListIDEs(): Promise<Result<TIDEs>> {\n    const result = await IDECommands.newCommand([\n      DEVPOD_COMMAND_IDE,\n      DEVPOD_COMMAND_LIST,\n      DEVPOD_FLAG_JSON_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    const ides = JSON.parse(result.val.stdout) as TIDEs\n\n    return Return.Value(ides)\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/ides/index.ts",
    "content": "export { IDEsClient } from \"./client\"\n"
  },
  {
    "path": "desktop/src/client/index.ts",
    "content": "export { client } from \"./client\"\nexport type { TArch, TPlatform } from \"./client\"\nexport { DEVPOD_GIT_REPOSITORY } from \"./constants\"\nexport type { TStreamEventListenerFn } from \"./types\"\nexport { ProClient } from \"./pro\"\n"
  },
  {
    "path": "desktop/src/client/pro/client.ts",
    "content": "import { TWorkspaceOwnerFilterState } from \"@/components\"\nimport { ProWorkspaceInstance } from \"@/contexts\"\nimport { DaemonStatus } from \"@/gen\"\nimport { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport { ManagementV1Project } from \"@loft-enterprise/client/gen/models/managementV1Project\"\nimport { ManagementV1ProjectClusters } from \"@loft-enterprise/client/gen/models/managementV1ProjectClusters\"\nimport { ManagementV1ProjectTemplates } from \"@loft-enterprise/client/gen/models/managementV1ProjectTemplates\"\nimport { ManagementV1Self } from \"@loft-enterprise/client/gen/models/managementV1Self\"\nimport { ManagementV1UserProfile } from \"@loft-enterprise/client/gen/models/managementV1UserProfile\"\nimport { Result, ResultError, Return, isError, sleep } from \"../../lib\"\nimport {\n  TGitCredentialHelperData,\n  TImportWorkspaceConfig,\n  TListProInstancesConfig,\n  TPlatformHealthCheck,\n  TPlatformVersionInfo,\n  TProID,\n  TProInstance,\n} from \"../../types\"\nimport { TAURI_SERVER_URL } from \"../tauriClient\"\nimport { TDebuggable, TStreamEventListenerFn } from \"../types\"\nimport { ProCommands } from \"./proCommands\"\nimport { client as globalClient } from \"@/client\"\n\nexport class ProClient implements TDebuggable {\n  constructor(protected readonly id: string) {}\n\n  public setDebug(isEnabled: boolean): void {\n    ProCommands.DEBUG = isEnabled\n  }\n\n  public async login(\n    host: string,\n    accessKey?: string,\n    listener?: TStreamEventListenerFn\n  ): Promise<ResultError> {\n    return ProCommands.Login(host, accessKey, listener)\n  }\n\n  public async checkHealth(): Promise<Result<TPlatformHealthCheck>> {\n    return ProCommands.CheckHealth(this.id)\n  }\n\n  public async getVersion() {\n    return ProCommands.GetVersion(this.id)\n  }\n\n  public async checkUpdate() {\n    return ProCommands.CheckUpdate(this.id)\n  }\n\n  public async update(version: string) {\n    return ProCommands.Update(this.id, version)\n  }\n\n  public async listProInstances(\n    config?: TListProInstancesConfig\n  ): Promise<Result<readonly TProInstance[]>> {\n    return ProCommands.ListProInstances(config)\n  }\n\n  public async removeProInstance(id: TProID) {\n    return ProCommands.RemoveProInstance(id)\n  }\n\n  public async importWorkspace(config: TImportWorkspaceConfig): Promise<ResultError> {\n    return ProCommands.ImportWorkspace(config)\n  }\n\n  public watchWorkspacesProxy(\n    projectName: string,\n    _ownerFilter: TWorkspaceOwnerFilterState,\n    listener: (newWorkspaces: readonly ProWorkspaceInstance[]) => void\n  ) {\n    const cmd = ProCommands.WatchWorkspaces(this.id, projectName)\n\n    // kick off stream in the background\n    cmd.stream(\n      (event) => {\n        if (event.type === \"data\") {\n          const rawInstances =\n            event.data as unknown as readonly ManagementV1DevPodWorkspaceInstance[]\n          const workspaceInstances = rawInstances.map(\n            (instance) => new ProWorkspaceInstance(instance)\n          )\n          listener(workspaceInstances)\n\n          return\n        }\n      },\n      { ignoreStderrError: true }\n    )\n\n    // Don't await here, we want to return the unsubscribe function\n    return () => {\n      // Still, return the promise so someone can choose to await if necessary.\n      return cmd.cancel()\n    }\n  }\n\n  public async listProjects(): Promise<Result<readonly ManagementV1Project[]>> {\n    return ProCommands.ListProjects(this.id)\n  }\n\n  public async getSelf(): Promise<Result<ManagementV1Self>> {\n    return ProCommands.GetSelf(this.id)\n  }\n\n  public async getProjectTemplates(\n    projectName: string\n  ): Promise<Result<ManagementV1ProjectTemplates>> {\n    return ProCommands.ListTemplates(this.id, projectName)\n  }\n\n  public async getProjectClusters(\n    projectName: string\n  ): Promise<Result<ManagementV1ProjectClusters>> {\n    return ProCommands.ListClusters(this.id, projectName)\n  }\n\n  public async createWorkspace(\n    instance: ManagementV1DevPodWorkspaceInstance\n  ): Promise<Result<ManagementV1DevPodWorkspaceInstance>> {\n    return ProCommands.CreateWorkspace(this.id, instance)\n  }\n\n  public async updateWorkspace(\n    instance: ManagementV1DevPodWorkspaceInstance\n  ): Promise<Result<ManagementV1DevPodWorkspaceInstance>> {\n    return ProCommands.UpdateWorkspace(this.id, instance)\n  }\n}\n\nexport class DaemonClient extends ProClient {\n  constructor(id: string) {\n    super(id)\n  }\n\n  public setDebug(isEnabled: boolean): void {\n    ProCommands.DEBUG = isEnabled\n  }\n\n  public async login(\n    host: string,\n    accessKey?: string,\n    listener?: TStreamEventListenerFn\n  ): Promise<ResultError> {\n    return ProCommands.Login(host, accessKey, listener)\n  }\n\n  private handleError<T>(err: unknown, fallbackMsg: string): Result<T> {\n    if (isError(err)) {\n      return Return.Failed(err.message)\n    }\n\n    if (typeof err === \"string\") {\n      return Return.Failed(`${fallbackMsg}: ${err}`)\n    }\n\n    return Return.Failed(fallbackMsg)\n  }\n\n  private async getProxy<T>(path: string): Promise<Result<T>> {\n    try {\n      const res = await fetch(`${TAURI_SERVER_URL}/daemon-proxy/${this.id}${path}`, {\n        method: \"GET\",\n        headers: {\n          \"content-type\": \"application/json\",\n        },\n      })\n      if (!res.ok) {\n        const maybeText = await res.text()\n\n        let errMessage = `Get resource: ${res.statusText}.`\n        if (maybeText) {\n          errMessage += maybeText\n        }\n\n        return Return.Failed(errMessage)\n      }\n      const json: T = await res.json()\n\n      return Return.Value(json)\n    } catch (e) {\n      return this.handleError(e, \"unable to get resource\")\n    }\n  }\n\n  private async get<T>(path: string): Promise<Result<T>> {\n    try {\n      const res = await fetch(`${TAURI_SERVER_URL}${path}`, {\n        method: \"GET\",\n        headers: {\n          \"content-type\": \"application/json\",\n        },\n      })\n      if (!res.ok) {\n        return Return.Failed(`Get resource: ${res.statusText}`)\n      }\n\n      const json: T = await res.json().catch(() => \"\")\n      return Return.Value(json)\n    } catch (e) {\n      return this.handleError(e, \"unable to get resource\")\n    }\n  }\n\n  private async post<T>(path: string, body: BodyInit): Promise<Result<T>> {\n    try {\n      const res = await fetch(`${TAURI_SERVER_URL}/daemon-proxy/${this.id}${path}`, {\n        method: \"POST\",\n        headers: {\n          \"content-type\": \"application/json\",\n        },\n        body,\n      })\n      if (!res.ok) {\n        return Return.Failed(`Error getting resource ${path} : ${res.statusText}`)\n      }\n      const json: T = await res.json()\n\n      return Return.Value(json)\n    } catch (e) {\n      return this.handleError(e, \"unable to get resource\")\n    }\n  }\n\n  public async restartDaemon() {\n    return this.get(`/daemon/${this.id}/restart`)\n  }\n\n  public async checkHealth(): Promise<Result<TPlatformHealthCheck>> {\n    // NOTE: We don't access this through the proxy because there might be issues during daemon startup\n    // that we couldn't surface otherwise\n    const res = await this.get<DaemonStatus>(`/daemon/${this.id}/status`)\n    if (!res.ok) {\n      return res\n    }\n    const status = res.val\n    let healthy = status.state === \"running\"\n\n    const details = []\n    if (status.loginRequired) {\n      healthy = false\n      details.push(\"Login required to connect to platform\")\n    }\n    if (status.state === \"pending\") {\n      details.push(\"Daemon is starting up\")\n    }\n\n    // if the backend state is running but we are not online, something is wrong with networking\n    if (!status.online) {\n      healthy = false\n      details.push(\"Platform is offline\")\n    }\n\n    return Return.Value({ healthy, details, loginRequired: status.loginRequired, online: status.online })\n  }\n\n  public watchWorkspaces(\n    projectName: string,\n    ownerFilter: TWorkspaceOwnerFilterState,\n    listener: TWorksaceListener\n  ): () => void {\n    const watcher = new WorkspaceWatcher(this.id, projectName, ownerFilter, listener)\n\n    return watcher.watch()\n  }\n\n  public async getSelf(): Promise<Result<ManagementV1Self>> {\n    return this.getProxy(\"/self\")\n  }\n\n  public async getUserProfile(): Promise<Result<ManagementV1UserProfile>> {\n    return this.getProxy(\"/user-profile\")\n  }\n\n  public async updateUserProfile(\n    userProfile: ManagementV1UserProfile\n  ): Promise<Result<ManagementV1UserProfile>> {\n    try {\n      const body = JSON.stringify(userProfile)\n      const res = (await this.post(\"/update-user-profile\", body)) as Result<ManagementV1UserProfile>\n\n      return res\n    } catch (e) {\n      return this.handleError(e, \"failed to update workspace\")\n    }\n  }\n\n  public async listProjects(): Promise<Result<readonly ManagementV1Project[]>> {\n    return this.getProxy(\"/projects\")\n  }\n\n  public async getVersion() {\n    return this.getProxy<TPlatformVersionInfo>(\"/version\")\n  }\n\n  public async getProjectTemplates(\n    projectName: string\n  ): Promise<Result<ManagementV1ProjectTemplates>> {\n    return this.getProxy(`/projects/${projectName}/templates`)\n  }\n\n  public async getProjectClusters(\n    projectName: string\n  ): Promise<Result<ManagementV1ProjectClusters>> {\n    return this.getProxy(`/projects/${projectName}/clusters`)\n  }\n\n  public async createWorkspace(\n    instance: ManagementV1DevPodWorkspaceInstance\n  ): Promise<Result<ManagementV1DevPodWorkspaceInstance>> {\n    try {\n      const body = JSON.stringify(instance)\n\n      return this.post(\"/create-workspace\", body)\n    } catch (e) {\n      return this.handleError(e, \"failed to create workspace\")\n    }\n  }\n\n  public async updateWorkspace(\n    instance: ManagementV1DevPodWorkspaceInstance\n  ): Promise<Result<ManagementV1DevPodWorkspaceInstance>> {\n    try {\n      const body = JSON.stringify(instance)\n\n      return this.post(\"/update-workspace\", body)\n    } catch (e) {\n      return this.handleError(e, \"failed to update workspace\")\n    }\n  }\n\n  public async queryGitCredentialsHelper(\n    host: string\n  ): Promise<Result<TGitCredentialHelperData | undefined>> {\n    const searchParams = new URLSearchParams([[\"host\", host]])\n\n    return this.getProxy(\"/git-credentials?\" + searchParams.toString())\n  }\n\n  public async checkUpdate() {\n    return Return.Failed(\"provider is built-in, update is not supported\")\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  public async update(_version: string) {\n    return Return.Failed(\"provider is built-in, update is not supported\")\n  }\n}\ntype TWorksaceListener = (newWorkspaces: readonly ProWorkspaceInstance[]) => void\n\nclass WorkspaceWatcher {\n  private abortController = new AbortController()\n  private reader: ReadableStreamDefaultReader | undefined\n  private buffer: string = \"\"\n\n  constructor(\n    private readonly hostID: string,\n    private readonly projectName: string,\n    private readonly ownerFilter: TWorkspaceOwnerFilterState,\n    private readonly listener: TWorksaceListener\n  ) {}\n\n  public cancel() {\n    try {\n      this.abortController.abort(\"watcher cancelled\")\n      this.reader?.cancel().catch((err) => {\n        console.debug(\"cancel failed\", err)\n      })\n    } catch(err) {\n      console.error(err)\n    }\n    this.reader = undefined\n    this.buffer = \"\"\n  }\n\n  public watch(): () => void {\n    try {\n      const url = new URL(`${TAURI_SERVER_URL}/daemon-proxy/${this.hostID}/watch-workspaces`)\n      url.searchParams.set(\"project\", this.projectName)\n      url.searchParams.set(\"owner\", this.ownerFilter)\n\n      // start long-lived request. This should never stop unless cancelled through abortController\n      fetch(url, {\n        method: \"GET\",\n        headers: { \"content-type\": \"application/json\" },\n        keepalive: true,\n        signal: this.abortController.signal,\n      })\n        .then((res) => {\n          this.reader = res.body?.getReader()\n\n          return this.read()\n        })\n        .catch((err) => {\n          globalClient.log(\"info\", `[${this.hostID}] watch workspaces error: ${err}`)\n        })\n        .finally(async () => {\n          if (!this.abortController.signal.aborted && !(await this.reader?.closed)) {\n            // Either the webview or the daemon terminated the watcher, try to reconnect\n            console.info(\"reconnect\")\n            this.reader = undefined\n            this.buffer = \"\"\n            this.watch()\n          }\n          \n          // Otherwise caller is responsible for reestablishing connection\n        })\n      return this.cancel.bind(this)\n    } catch {\n      return this.cancel.bind(this)\n    }\n  }\n\n  private async read(): Promise<unknown> {\n    const decoder = new TextDecoder()\n\n    try {\n      if (!this.reader) {\n        return\n      }\n\n      const { done, value } = await this.reader.read()\n      if (done) {\n        return\n      }\n      this.buffer += decoder.decode(value, { stream: true })\n      // NOTE: This relies on sender to end every message with a newline character. Make sure you also update the daemon server if you change this!\n      const lines = this.buffer.split(\"\\n\")\n      // Keep the last partial line in the buffer\n      const maybeLine = lines.pop()\n      if (maybeLine !== undefined) {\n        this.buffer = maybeLine\n      }\n\n      lines.forEach((line) => {\n        if (line.trim()) {\n          try {\n            const rawInstances: readonly ManagementV1DevPodWorkspaceInstance[] = JSON.parse(line)\n            const workspaceInstances = rawInstances.map(\n              (instance) => new ProWorkspaceInstance(instance)\n            )\n            this.listener(workspaceInstances)\n          } catch (err) {\n            const res = this.handleError(err, \"failed to parse workspaces\")\n            if (res.err) {\n              return err\n            }\n          }\n        }\n      })\n\n      // Continue reading\n      this.read()\n    } catch (err) {\n      return err\n    }\n  }\n\n  private handleError<T>(err: unknown, fallbackMsg: string): Result<T> {\n    if (isError(err)) {\n      return Return.Failed(err.message)\n    }\n\n    if (typeof err === \"string\") {\n      return Return.Failed(`${fallbackMsg}: ${err}`)\n    }\n\n    return Return.Failed(fallbackMsg)\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/pro/index.ts",
    "content": "export { ProClient } from \"./client\"\n"
  },
  {
    "path": "desktop/src/client/pro/proCommands.ts",
    "content": "import { Result, ResultError, Return, getErrorFromChildProcess } from \"@/lib\"\nimport {\n  TImportWorkspaceConfig,\n  TListProInstancesConfig,\n  TPlatformHealthCheck,\n  TProID,\n  TProInstance,\n  TPlatformVersionInfo,\n  TPlatformUpdateCheck,\n} from \"@/types\"\nimport { Command, isOk, serializeRawOptions, toFlagArg } from \"../command\"\nimport {\n  DEVPOD_COMMAND_DELETE,\n  DEVPOD_COMMAND_IMPORT_WORKSPACE,\n  DEVPOD_COMMAND_LIST,\n  DEVPOD_COMMAND_LOGIN,\n  DEVPOD_COMMAND_PRO,\n  DEVPOD_FLAG_ACCESS_KEY,\n  DEVPOD_FLAG_DEBUG,\n  DEVPOD_FLAG_FORCE_BROWSER,\n  DEVPOD_FLAG_HOST,\n  DEVPOD_FLAG_INSTANCE,\n  DEVPOD_FLAG_JSON_LOG_OUTPUT,\n  DEVPOD_FLAG_JSON_OUTPUT,\n  DEVPOD_FLAG_LOGIN,\n  DEVPOD_FLAG_PROJECT,\n  DEVPOD_FLAG_USE,\n  DEVPOD_FLAG_WORKSPACE_ID,\n  DEVPOD_FLAG_WORKSPACE_PROJECT,\n  DEVPOD_FLAG_WORKSPACE_UID,\n} from \"../constants\"\nimport { TStreamEventListenerFn } from \"../types\"\nimport { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport { ManagementV1Project } from \"@loft-enterprise/client/gen/models/managementV1Project\"\nimport { ManagementV1Self } from \"@loft-enterprise/client/gen/models/managementV1Self\"\nimport { ManagementV1ProjectTemplates } from \"@loft-enterprise/client/gen/models/managementV1ProjectTemplates\"\nimport { ManagementV1ProjectClusters } from \"@loft-enterprise/client/gen/models/managementV1ProjectClusters\"\n\nexport class ProCommands {\n  static DEBUG = false\n\n  private static newCommand(args: string[]): Command {\n    return new Command([...args, ...(ProCommands.DEBUG ? [DEVPOD_FLAG_DEBUG] : [])])\n  }\n\n  static async Login(\n    host: string,\n    accessKey?: string,\n    listener?: TStreamEventListenerFn\n  ): Promise<ResultError> {\n    const maybeAccessKeyFlag = accessKey ? [toFlagArg(DEVPOD_FLAG_ACCESS_KEY, accessKey)] : []\n    const useFlag = toFlagArg(DEVPOD_FLAG_USE, \"false\")\n\n    const cmd = ProCommands.newCommand([\n      DEVPOD_COMMAND_PRO,\n      DEVPOD_COMMAND_LOGIN,\n      host,\n      useFlag,\n      DEVPOD_FLAG_FORCE_BROWSER,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n      ...maybeAccessKeyFlag,\n    ])\n    if (listener) {\n      return cmd.stream(listener)\n    } else {\n      const result = await cmd.run()\n      if (result.err) {\n        return result\n      }\n\n      if (!isOk(result.val)) {\n        return getErrorFromChildProcess(result.val)\n      }\n\n      return Return.Ok()\n    }\n  }\n\n  static async ListProInstances(\n    config?: TListProInstancesConfig\n  ): Promise<Result<readonly TProInstance[]>> {\n    const maybeLoginFlag = config?.authenticate ? [DEVPOD_FLAG_LOGIN] : []\n    const result = await ProCommands.newCommand([\n      DEVPOD_COMMAND_PRO,\n      DEVPOD_COMMAND_LIST,\n      DEVPOD_FLAG_JSON_OUTPUT,\n      ...maybeLoginFlag,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    const instances = JSON.parse(result.val.stdout) as readonly TProInstance[]\n\n    return Return.Value(instances)\n  }\n\n  static async RemoveProInstance(id: TProID) {\n    const result = await ProCommands.newCommand([\n      DEVPOD_COMMAND_PRO,\n      DEVPOD_COMMAND_DELETE,\n      id,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async ImportWorkspace(config: TImportWorkspaceConfig): Promise<ResultError> {\n    const optionsFlag = config.options ? serializeRawOptions(config.options) : []\n    const result = await new Command([\n      DEVPOD_COMMAND_PRO,\n      DEVPOD_COMMAND_IMPORT_WORKSPACE,\n      config.devPodProHost,\n      DEVPOD_FLAG_WORKSPACE_ID,\n      config.workspaceID,\n      DEVPOD_FLAG_WORKSPACE_UID,\n      config.workspaceUID,\n      DEVPOD_FLAG_WORKSPACE_PROJECT,\n      config.project,\n      ...optionsFlag,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static WatchWorkspaces(id: TProID, projectName: string) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const projectFlag = toFlagArg(DEVPOD_FLAG_PROJECT, projectName)\n    const args = [DEVPOD_COMMAND_PRO, \"watch-workspaces\", hostFlag, projectFlag]\n\n    return ProCommands.newCommand(args)\n  }\n\n  static async ListProjects(id: TProID) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"list-projects\", hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as readonly ManagementV1Project[])\n  }\n\n  static async GetSelf(id: TProID) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"self\", hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as ManagementV1Self)\n  }\n\n  static async ListTemplates(id: TProID, projectName: string) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const projectFlag = toFlagArg(DEVPOD_FLAG_PROJECT, projectName)\n    const args = [DEVPOD_COMMAND_PRO, \"list-templates\", hostFlag, projectFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as ManagementV1ProjectTemplates)\n  }\n\n  static async ListClusters(id: TProID, projectName: string) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const projectFlag = toFlagArg(DEVPOD_FLAG_PROJECT, projectName)\n    const args = [DEVPOD_COMMAND_PRO, \"list-clusters\", hostFlag, projectFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as ManagementV1ProjectClusters)\n  }\n\n  static async CreateWorkspace(id: TProID, instance: ManagementV1DevPodWorkspaceInstance) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const instanceFlag = toFlagArg(DEVPOD_FLAG_INSTANCE, JSON.stringify(instance))\n    const args = [DEVPOD_COMMAND_PRO, \"create-workspace\", hostFlag, instanceFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as ManagementV1DevPodWorkspaceInstance)\n  }\n\n  static async UpdateWorkspace(id: TProID, instance: ManagementV1DevPodWorkspaceInstance) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const instanceFlag = toFlagArg(DEVPOD_FLAG_INSTANCE, JSON.stringify(instance))\n    const args = [DEVPOD_COMMAND_PRO, \"update-workspace\", hostFlag, instanceFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as ManagementV1DevPodWorkspaceInstance)\n  }\n\n  static async CheckHealth(id: TProID) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"check-health\", hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TPlatformHealthCheck)\n  }\n\n  static async GetVersion(id: TProID) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"version\", hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TPlatformVersionInfo)\n  }\n\n  static async CheckUpdate(id: TProID) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"check-update\", hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TPlatformUpdateCheck)\n  }\n\n  static async Update(id: TProID, version: string) {\n    const hostFlag = toFlagArg(DEVPOD_FLAG_HOST, id)\n    const args = [DEVPOD_COMMAND_PRO, \"update-provider\", version, hostFlag]\n\n    const result = await ProCommands.newCommand(args).run()\n    if (result.err) {\n      return result\n    }\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TPlatformUpdateCheck)\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/providers/client.ts",
    "content": "import { FileStorageBackend, Result, ResultError, Return, Store, isEmpty } from \"../../lib\"\nimport {\n  TAddProviderConfig,\n  TCheckProviderUpdateResult,\n  TConfigureProviderConfig,\n  TProviderID,\n  TProviderOptions,\n  TProviderSource,\n  TProviders,\n} from \"../../types\"\nimport { TDebuggable } from \"../types\"\nimport { ProviderCommands } from \"./providerCommands\"\n\n// WARN: These need to match the rust `file_name` and `dangling_provider_key` constants\n// for reliable cleanup!\n// Make sure to update them in `src/provider.rs` if you change them here!\nconst PROVIDERS_STORE_FILE_NAME = \"providers\"\nconst PROVIDERS_STORE_DANGLING_PROVIDER_KEY = \"danglingProviders\"\n\ntype TProviderStore = Readonly<{ [PROVIDERS_STORE_DANGLING_PROVIDER_KEY]: readonly TProviderID[] }>\n\nexport class ProvidersClient implements TDebuggable {\n  private readonly store = new Store<TProviderStore>(\n    new FileStorageBackend<TProviderStore>(PROVIDERS_STORE_FILE_NAME)\n  )\n  private danglingProviderIDs: TProviderID[] = []\n  // Queues store operations and guarantees they will be executed in order\n  private storeOperationQueue: Promise<unknown> = Promise.resolve()\n\n  constructor() {}\n\n  public setDebug(isEnabled: boolean): void {\n    ProviderCommands.DEBUG = isEnabled\n  }\n\n  public async listAll(): Promise<Result<TProviders>> {\n    return ProviderCommands.ListProviders()\n  }\n\n  public async newID(rawSource: string): Promise<Result<string>> {\n    return ProviderCommands.GetProviderID(rawSource)\n  }\n\n  public async checkUpdate(id: TProviderID): Promise<Result<TCheckProviderUpdateResult>> {\n    return ProviderCommands.CheckProviderUpdate(id)\n  }\n\n  public async update(id: TProviderID, source: TProviderSource): Promise<Result<void>> {\n    return ProviderCommands.UpdateProvider(id, source)\n  }\n\n  public async add(rawSource: TProviderID, config: TAddProviderConfig): Promise<ResultError> {\n    return ProviderCommands.AddProvider(rawSource, config)\n  }\n\n  public async remove(id: TProviderID): Promise<ResultError> {\n    return ProviderCommands.RemoveProvider(id)\n  }\n\n  public async getOptions(id: TProviderID): Promise<Result<TProviderOptions>> {\n    return ProviderCommands.GetProviderOptions(id)\n  }\n\n  public async useProvider(id: TProviderID): Promise<ResultError> {\n    return ProviderCommands.UseProvider(id)\n  }\n\n  public async setOptionsDry(\n    id: TProviderID,\n    { options, reconfigure }: TConfigureProviderConfig\n  ): Promise<Result<TProviderOptions | undefined>> {\n    return ProviderCommands.SetProviderOptions(id, options, false, true, reconfigure)\n  }\n\n  public async configure(\n    id: TProviderID,\n    { useAsDefaultProvider, reuseMachine, options }: TConfigureProviderConfig\n  ): Promise<ResultError> {\n    const setResult = await ProviderCommands.SetProviderOptions(id, options, !!reuseMachine)\n    if (setResult.err) {\n      return setResult as ResultError\n    }\n\n    if (useAsDefaultProvider) {\n      return ProviderCommands.UseProvider(id)\n    }\n\n    return Return.Ok()\n  }\n\n  public setDangling(id: TProviderID): void {\n    this.danglingProviderIDs.push(id)\n    const ids = this.danglingProviderIDs.slice()\n    this.storeOperationQueue = this.storeOperationQueue.then(() =>\n      this.store.set(\"danglingProviders\", ids)\n    )\n  }\n\n  public popAllDangling(): readonly TProviderID[] {\n    const maybeProviderIDs = this.danglingProviderIDs.slice()\n    this.danglingProviderIDs.length = 0\n    this.storeOperationQueue = this.storeOperationQueue.then(() =>\n      this.store.remove(\"danglingProviders\")\n    )\n\n    return maybeProviderIDs\n  }\n\n  public popDangling(): TProviderID | undefined {\n    const lastProviderID = this.danglingProviderIDs.pop()\n    const ids = this.danglingProviderIDs.slice()\n    this.storeOperationQueue = this.storeOperationQueue.then(() => {\n      if (isEmpty(ids)) {\n        return this.store.remove(\"danglingProviders\")\n      }\n\n      return this.store.set(\"danglingProviders\", ids)\n    })\n\n    return lastProviderID\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/providers/index.ts",
    "content": "export { ProvidersClient } from \"./client\"\n"
  },
  {
    "path": "desktop/src/client/providers/providerCommands.ts",
    "content": "import { exists, getErrorFromChildProcess, Result, ResultError, Return } from \"../../lib\"\nimport {\n  TAddProviderConfig,\n  TCheckProviderUpdateResult,\n  TProviderID,\n  TProviderOptions,\n  TProviders,\n  TProviderSource,\n} from \"../../types\"\nimport { Command, isOk, serializeRawOptions, toFlagArg } from \"../command\"\nimport {\n  DEVPOD_COMMAND_ADD,\n  DEVPOD_COMMAND_DELETE,\n  DEVPOD_COMMAND_GET_PROVIDER_NAME,\n  DEVPOD_COMMAND_LIST,\n  DEVPOD_COMMAND_OPTIONS,\n  DEVPOD_COMMAND_PROVIDER,\n  DEVPOD_COMMAND_SET_OPTIONS,\n  DEVPOD_COMMAND_UPDATE,\n  DEVPOD_COMMAND_USE,\n  DEVPOD_FLAG_DEBUG,\n  DEVPOD_FLAG_DRY,\n  DEVPOD_FLAG_JSON_LOG_OUTPUT,\n  DEVPOD_FLAG_JSON_OUTPUT,\n  DEVPOD_FLAG_NAME,\n  DEVPOD_FLAG_RECONFIGURE,\n  DEVPOD_FLAG_SINGLE_MACHINE,\n  DEVPOD_FLAG_USE,\n} from \"../constants\"\nimport { DEVPOD_COMMAND_CHECK_PROVIDER_UPDATE, DEVPOD_COMMAND_HELPER } from \"./../constants\"\n\nexport class ProviderCommands {\n  static DEBUG = false\n\n  private static newCommand(args: string[]): Command {\n    return new Command([...args, ...(ProviderCommands.DEBUG ? [DEVPOD_FLAG_DEBUG] : [])])\n  }\n\n  static async ListProviders(): Promise<Result<TProviders>> {\n    const result = await new Command([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_LIST,\n      DEVPOD_FLAG_JSON_OUTPUT,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    const rawProviders = JSON.parse(result.val.stdout) as TProviders\n    for (const provider of Object.values(rawProviders)) {\n      provider.isProxyProvider =\n        provider.config?.exec?.proxy !== undefined || provider.config?.exec?.daemon !== undefined\n    }\n\n    return Return.Value(rawProviders)\n  }\n\n  static async GetProviderID(source: string) {\n    const result = await new Command([\n      DEVPOD_COMMAND_HELPER,\n      DEVPOD_COMMAND_GET_PROVIDER_NAME,\n      source,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(result.val.stdout)\n  }\n\n  static async AddProvider(\n    rawProviderSource: string,\n    config: TAddProviderConfig\n  ): Promise<ResultError> {\n    const maybeName = config.name\n    const maybeNameFlag = exists(maybeName) ? [toFlagArg(DEVPOD_FLAG_NAME, maybeName)] : []\n    const useFlag = toFlagArg(DEVPOD_FLAG_USE, \"false\")\n\n    const result = await ProviderCommands.newCommand([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_ADD,\n      rawProviderSource,\n      ...maybeNameFlag,\n      useFlag,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async RemoveProvider(id: TProviderID) {\n    const result = await ProviderCommands.newCommand([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_DELETE,\n      id,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async UseProvider(\n    id: TProviderID,\n    rawOptions?: Record<string, unknown>,\n    reuseMachine?: boolean\n  ) {\n    const optionsFlag = rawOptions ? serializeRawOptions(rawOptions) : []\n    const maybeResuseMachineFlag = reuseMachine ? [DEVPOD_FLAG_SINGLE_MACHINE] : []\n\n    const result = await ProviderCommands.newCommand([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_USE,\n      id,\n      ...optionsFlag,\n      ...maybeResuseMachineFlag,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n\n  static async SetProviderOptions(\n    id: TProviderID,\n    rawOptions: Record<string, unknown>,\n    reuseMachine: boolean,\n    dry?: boolean,\n    reconfigure?: boolean\n  ) {\n    const optionsFlag = serializeRawOptions(rawOptions)\n    const maybeResuseMachineFlag = reuseMachine ? [DEVPOD_FLAG_SINGLE_MACHINE] : []\n    const maybeDry = dry ? [DEVPOD_FLAG_DRY] : []\n    const maybeReconfigure = reconfigure ? [DEVPOD_FLAG_RECONFIGURE] : []\n\n    const result = await ProviderCommands.newCommand([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_SET_OPTIONS,\n      id,\n      ...optionsFlag,\n      ...maybeResuseMachineFlag,\n      ...maybeDry,\n      ...maybeReconfigure,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    } else if (dry) {\n      return Return.Value(JSON.parse(result.val.stdout) as TProviderOptions)\n    }\n\n    return Return.Ok()\n  }\n\n  static async GetProviderOptions(id: TProviderID) {\n    const result = await new Command([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_OPTIONS,\n      id,\n      DEVPOD_FLAG_JSON_OUTPUT,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TProviderOptions)\n  }\n\n  static async CheckProviderUpdate(id: TProviderID) {\n    const result = await new Command([\n      DEVPOD_COMMAND_HELPER,\n      DEVPOD_COMMAND_CHECK_PROVIDER_UPDATE,\n      id,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Value(JSON.parse(result.val.stdout) as TCheckProviderUpdateResult)\n  }\n\n  static async UpdateProvider(id: TProviderID, source: TProviderSource) {\n    const useFlag = toFlagArg(DEVPOD_FLAG_USE, \"false\")\n\n    const result = await new Command([\n      DEVPOD_COMMAND_PROVIDER,\n      DEVPOD_COMMAND_UPDATE,\n      id,\n      source.raw ?? source.github ?? source.url ?? source.file ?? \"\",\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n      useFlag,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return getErrorFromChildProcess(result.val)\n    }\n\n    return Return.Ok()\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/tauriClient/index.ts",
    "content": "export const TAURI_SERVER_URL = \"http://localhost:25842\"\n"
  },
  {
    "path": "desktop/src/client/types.ts",
    "content": "import { TLogOutput } from \"../types\"\n\nexport type TDebuggable = Readonly<{ setDebug(isEnabled: boolean): void }>\nexport type TStreamEvent = Readonly<\n  { type: \"data\"; data: TLogOutput } | { type: \"error\"; error: TLogOutput }\n>\nexport type TStreamEventListenerFn = (event: TStreamEvent) => void\n"
  },
  {
    "path": "desktop/src/client/workspaces/client.ts",
    "content": "import { TActionID, TActionName, TActionObj } from \"../../contexts\"\nimport { Result, ResultError, Return, THandler, exists, isError, noop } from \"../../lib\"\nimport {\n  TDevcontainerSetup,\n  TStreamID,\n  TUnsubscribeFn,\n  TWorkspace,\n  TWorkspaceID,\n  TWorkspaceStartConfig,\n  TWorkspaceWithoutStatus,\n} from \"../../types\"\nimport { TCommand, TStreamEventListenerFn } from \"../command\"\nimport { CommandCache, TCommandCacheInfo } from \"../commandCache\"\nimport { TDebuggable, TStreamEvent } from \"../types\"\nimport { WorkspaceCommands } from \"./workspaceCommands\"\nimport {\n  DEVPOD_FLAG_DOTFILES,\n  DEVPOD_FLAG_GIT_SIGNING_KEY,\n  WORKSPACE_COMMAND_ADDITIONAL_FLAGS_KEY,\n} from \"../constants\"\nimport { invoke } from \"@tauri-apps/api/core\"\n\n// Every workspace can have one active action at a time,\n// but multiple views might need to listen to the same action.\n// The `streamID` identifies a view listener.\ntype TWorkspaceClientContext = Readonly<{\n  id: TWorkspaceID\n  actionID: TActionID\n  streamID: TStreamID\n}>\n\nexport class WorkspacesClient implements TDebuggable {\n  private readonly commandCache = new CommandCache()\n\n  constructor() {}\n\n  private createStreamHandler(\n    id: TStreamID,\n    listener: TStreamEventListenerFn\n  ): THandler<TStreamEventListenerFn> {\n    return {\n      id,\n      eq(other) {\n        return id === other.id\n      },\n      notify: listener,\n    }\n  }\n\n  private async writeEvent(actionID: TActionID, event: TStreamEvent) {\n    // Be wary of the spelling, tauri expects this to be `actionId` instead of `actionID` because of the serde deserialization\n    await invoke(\"write_action_log\", { actionId: actionID, data: JSON.stringify(event) })\n  }\n\n  private async execActionCmd<T>(\n    cmd: Readonly<TCommand<T>>,\n    ctx: Readonly<{\n      id: TWorkspaceID\n      actionID: TActionID\n      streamID: TStreamID\n      listener?: TStreamEventListenerFn | undefined\n      actionName: TActionName\n    }>\n  ) {\n    const cacheInfo: TCommandCacheInfo = { id: ctx.id, actionName: ctx.actionName }\n    const maybeRunningCommand = this.commandCache.get(cacheInfo)\n    const handler = this.createStreamHandler(ctx.streamID, (event) => {\n      this.writeEvent(ctx.actionID, event)\n\n      ctx.listener?.(event)\n    })\n\n    // If `start` for id is running already,\n    // wire up the new listener and return the existing operation\n    if (exists(maybeRunningCommand)) {\n      maybeRunningCommand.stream?.(handler)\n      await maybeRunningCommand.promise\n\n      return this.getStatus(ctx.id)\n    }\n\n    const { operation, stream } = this.commandCache.connect(cacheInfo, cmd)\n    stream?.(handler)\n\n    const result = await operation\n    this.commandCache.clear(cacheInfo)\n\n    if (result.err) {\n      return result\n    }\n\n    return result\n  }\n\n  public setDebug(isEnabled: boolean): void {\n    WorkspaceCommands.DEBUG = isEnabled\n  }\n\n  public setDotfilesFlag(dotfilesUrl: string): void {\n    if (!dotfilesUrl) {\n      return\n    }\n    WorkspaceCommands.ADDITIONAL_FLAGS.set(DEVPOD_FLAG_DOTFILES, dotfilesUrl)\n  }\n\n  public setAdditionalFlags(additionalFlags: string): void {\n    WorkspaceCommands.ADDITIONAL_FLAGS.set(WORKSPACE_COMMAND_ADDITIONAL_FLAGS_KEY, additionalFlags)\n  }\n\n  public setSSHKeyPath(sshKeyPath: string): void {\n    if (!sshKeyPath) {\n      return\n    }\n    WorkspaceCommands.ADDITIONAL_FLAGS.set(DEVPOD_FLAG_GIT_SIGNING_KEY, sshKeyPath)\n  }\n\n  public async listAll(\n    skipPro: boolean = true\n  ): Promise<Result<readonly TWorkspaceWithoutStatus[]>> {\n    return WorkspaceCommands.ListWorkspaces(skipPro)\n  }\n\n  public async getStatus(id: TWorkspaceID): Promise<Result<TWorkspace[\"status\"]>> {\n    const result = await WorkspaceCommands.FetchWorkspaceStatus(id)\n    if (result.err) {\n      return result\n    }\n\n    const { status } = result.val\n\n    return Return.Value(status)\n  }\n\n  public async newID(rawSource: string): Promise<Result<string>> {\n    return WorkspaceCommands.GetWorkspaceID(rawSource)\n  }\n\n  public async newUID(): Promise<Result<string>> {\n    return WorkspaceCommands.GetWorkspaceUID()\n  }\n\n  public async start(\n    config: TWorkspaceStartConfig,\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<Result<TWorkspace[\"status\"]>> {\n    const cmd = WorkspaceCommands.StartWorkspace(ctx.id, config)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"start\" })\n    if (result.err) {\n      return result\n    }\n\n    return this.getStatus(ctx.id)\n  }\n\n  public async stop(\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<Result<TWorkspace[\"status\"]>> {\n    const cmd = WorkspaceCommands.StopWorkspace(ctx.id)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"stop\" })\n    if (result.err) {\n      return result\n    }\n\n    return this.getStatus(ctx.id)\n  }\n\n  public async rebuild(\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<Result<TWorkspace[\"status\"]>> {\n    const cmd = WorkspaceCommands.RebuildWorkspace(ctx.id)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"rebuild\" })\n    if (result.err) {\n      return result\n    }\n\n    return this.getStatus(ctx.id)\n  }\n\n  public async troubleshoot(ctx: TWorkspaceClientContext) {\n    const cmd = WorkspaceCommands.TroubleshootWorkspace(ctx.id)\n\n    return cmd.run()\n  }\n\n  public async reset(\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<Result<TWorkspace[\"status\"]>> {\n    const cmd = WorkspaceCommands.ResetWorkspace(ctx.id)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"reset\" })\n    if (result.err) {\n      return result\n    }\n\n    return this.getStatus(ctx.id)\n  }\n\n  public async remove(\n    force: boolean,\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<Result<TWorkspace[\"status\"]>> {\n    const cmd = WorkspaceCommands.RemoveWorkspace(ctx.id, force)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"remove\" })\n    if (result.err) {\n      return result\n    }\n\n    return result\n  }\n\n  public async checkStatus(\n    listener: TStreamEventListenerFn | undefined,\n    ctx: TWorkspaceClientContext\n  ): Promise<ResultError> {\n    const cmd = WorkspaceCommands.GetStatusLogs(ctx.id)\n    const result = await this.execActionCmd(cmd, { ...ctx, listener, actionName: \"checkStatus\" })\n    if (result.err) {\n      return result\n    }\n\n    return Return.Ok()\n  }\n\n  public async checkDevcontainerSetup(rawSource: string): Promise<Result<TDevcontainerSetup>> {\n    const result = await WorkspaceCommands.GetDevcontainerConfig(rawSource).run()\n    if (result.err) {\n      return result\n    }\n\n    try {\n      const setup = JSON.parse(result.val.stdout) as TDevcontainerSetup\n\n      return Return.Value(setup)\n    } catch (err) {\n      return Return.Failed(`Failed to parse devcontainer setup: ${err}`)\n    }\n  }\n\n  public subscribe(\n    action: TActionObj,\n    streamID: TStreamID,\n    listener: TStreamEventListenerFn\n  ): TUnsubscribeFn {\n    const maybeRunningCommand = this.commandCache.get({\n      id: action.targetID,\n      actionName: action.name,\n    })\n    if (!exists(maybeRunningCommand)) {\n      return noop\n    }\n\n    const maybeUnsubscribe = maybeRunningCommand.stream?.(\n      this.createStreamHandler(streamID, listener)\n    )\n\n    return () => maybeUnsubscribe?.()\n  }\n\n  public replayAction(actionID: TActionID, listener: TStreamEventListenerFn): TUnsubscribeFn {\n    let cancelled = false\n    const unsubscribe = () => {\n      cancelled = true\n    }\n    // Be wary of the spelling, tauri expects this to be `actionId` instead of `actionID` because of the serde deserialization\n    invoke<readonly string[]>(\"get_action_logs\", { actionId: actionID })\n      .then((events) => {\n        if (cancelled) {\n          return\n        }\n        for (const event of events) {\n          try {\n            listener(JSON.parse(event))\n          } catch (e) {\n            console.log(e)\n            // noop\n          }\n        }\n      })\n      .catch((e) => {\n        console.error(\"Failed to replay action\", e)\n        unsubscribe()\n      })\n\n    return unsubscribe\n  }\n\n  public async cancelAction(actionID: TActionID): Promise<ResultError> {\n    const cmdHandler = this.commandCache.findCommandHandlerById(actionID)\n\n    return cmdHandler?.cancel?.() ?? Return.Ok()\n  }\n\n  public async getActionLogFile(actionID: TActionID): Promise<Result<string>> {\n    try {\n      const path = await invoke<string>(\"get_action_log_file\", { actionId: actionID })\n\n      return Return.Value(path)\n    } catch (e) {\n      if (isError(e)) {\n        return Return.Failed(e.message)\n      }\n\n      return Return.Failed(`Unable to retrieve log file for action ${actionID}`)\n    }\n  }\n}\n"
  },
  {
    "path": "desktop/src/client/workspaces/index.ts",
    "content": "export { WorkspacesClient } from \"./client\"\n"
  },
  {
    "path": "desktop/src/client/workspaces/workspaceCommands.ts",
    "content": "import { exists, Result, Return } from \"../../lib\"\nimport {\n  TWorkspace,\n  TWorkspaceID,\n  TWorkspaceStartConfig,\n  TWorkspaceStatusResult,\n  TWorkspaceWithoutStatus,\n} from \"../../types\"\nimport { Command, isOk, serializeRawOptions, toFlagArg } from \"../command\"\nimport {\n  DEVPOD_COMMAND_DELETE,\n  DEVPOD_COMMAND_GET_WORKSPACE_CONFIG,\n  DEVPOD_COMMAND_GET_WORKSPACE_NAME,\n  DEVPOD_COMMAND_GET_WORKSPACE_UID,\n  DEVPOD_COMMAND_HELPER,\n  DEVPOD_COMMAND_LIST,\n  DEVPOD_COMMAND_STATUS,\n  DEVPOD_COMMAND_STOP,\n  DEVPOD_COMMAND_UP,\n  DEVPOD_COMMAND_TROUBLESHOOT,\n  DEVPOD_FLAG_DEBUG,\n  DEVPOD_FLAG_DEVCONTAINER_PATH,\n  DEVPOD_FLAG_FORCE,\n  DEVPOD_FLAG_ID,\n  DEVPOD_FLAG_IDE,\n  DEVPOD_FLAG_JSON_LOG_OUTPUT,\n  DEVPOD_FLAG_JSON_OUTPUT,\n  DEVPOD_FLAG_PREBUILD_REPOSITORY,\n  DEVPOD_FLAG_PROVIDER,\n  DEVPOD_FLAG_PROVIDER_OPTION,\n  DEVPOD_FLAG_RECREATE,\n  DEVPOD_FLAG_RESET,\n  DEVPOD_FLAG_SKIP_PRO,\n  DEVPOD_FLAG_SOURCE,\n  DEVPOD_FLAG_TIMEOUT,\n  WORKSPACE_COMMAND_ADDITIONAL_FLAGS_KEY,\n} from \"../constants\"\n\ntype TRawWorkspaces = readonly (Omit<TWorkspace, \"status\" | \"id\"> &\n  Readonly<{ id: string | null }>)[]\n\nexport class WorkspaceCommands {\n  static DEBUG = false\n  static ADDITIONAL_FLAGS = new Map<string, string>()\n\n  private static newCommand(args: string[]): Command {\n    const extraFlags = []\n    if (WorkspaceCommands.DEBUG) {\n      extraFlags.push(DEVPOD_FLAG_DEBUG)\n    }\n\n    return new Command([...args, ...extraFlags])\n  }\n\n  static async ListWorkspaces(skipPro: boolean): Promise<Result<TWorkspaceWithoutStatus[]>> {\n    const maybeSkipProFlag = skipPro ? [DEVPOD_FLAG_SKIP_PRO] : []\n\n    const result = await new Command([\n      DEVPOD_COMMAND_LIST,\n      DEVPOD_FLAG_JSON_OUTPUT,\n      ...maybeSkipProFlag,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    const rawWorkspaces = JSON.parse(result.val.stdout) as TRawWorkspaces\n\n    return Return.Value(\n      rawWorkspaces.filter((workspace): workspace is TWorkspaceWithoutStatus =>\n        exists(workspace.id)\n      )\n    )\n  }\n\n  static async FetchWorkspaceStatus(\n    id: string\n  ): Promise<Result<Pick<TWorkspace, \"id\" | \"status\">>> {\n    const result = await new Command([DEVPOD_COMMAND_STATUS, id, DEVPOD_FLAG_JSON_OUTPUT]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return Return.Failed(`Failed to get status for workspace ${id}: ${result.val.stderr}`)\n    }\n\n    const { state } = JSON.parse(result.val.stdout) as TWorkspaceStatusResult\n\n    return Return.Value({ id, status: state })\n  }\n\n  static async GetWorkspaceID(source: string) {\n    const result = await new Command([\n      DEVPOD_COMMAND_HELPER,\n      DEVPOD_COMMAND_GET_WORKSPACE_NAME,\n      source,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return Return.Failed(`Failed to get ID for workspace source ${source}: ${result.val.stderr}`)\n    }\n\n    return Return.Value(result.val.stdout)\n  }\n\n  static async GetWorkspaceUID() {\n    const result = await new Command([\n      DEVPOD_COMMAND_HELPER,\n      DEVPOD_COMMAND_GET_WORKSPACE_UID,\n    ]).run()\n    if (result.err) {\n      return result\n    }\n\n    if (!isOk(result.val)) {\n      return Return.Failed(`Failed to get UID: ${result.val.stderr}`)\n    }\n\n    return Return.Value(result.val.stdout)\n  }\n\n  static GetStatusLogs(id: string) {\n    return new Command([DEVPOD_COMMAND_STATUS, id, DEVPOD_FLAG_JSON_LOG_OUTPUT])\n  }\n\n  static StartWorkspace(id: TWorkspaceID, config: TWorkspaceStartConfig) {\n    const maybeSource = config.sourceConfig?.source\n    const maybeIDFlag = exists(maybeSource) ? [toFlagArg(DEVPOD_FLAG_ID, id)] : []\n\n    const maybeSourceType = config.sourceConfig?.type\n    const maybeSourceFlag =\n      exists(maybeSourceType) && exists(maybeSource)\n        ? [toFlagArg(DEVPOD_FLAG_SOURCE, `${maybeSourceType}:${maybeSource}`)]\n        : []\n    const identifier = exists(maybeSource) && exists(maybeIDFlag) ? maybeSource : id\n\n    const maybeIdeName = config.ideConfig?.name\n    const maybeIDEFlag = exists(maybeIdeName) ? [toFlagArg(DEVPOD_FLAG_IDE, maybeIdeName)] : []\n\n    const maybeProviderID = config.providerConfig?.providerID\n    const maybeProviderFlag = exists(maybeProviderID)\n      ? [toFlagArg(DEVPOD_FLAG_PROVIDER, maybeProviderID)]\n      : []\n    const maybeProviderOptions = config.providerConfig?.options\n    const maybeProviderOptionsFlag = exists(maybeProviderOptions)\n      ? serializeRawOptions(maybeProviderOptions, DEVPOD_FLAG_PROVIDER_OPTION)\n      : []\n\n    const maybePrebuildRepositories = config.prebuildRepositories?.length\n      ? [toFlagArg(DEVPOD_FLAG_PREBUILD_REPOSITORY, config.prebuildRepositories.join(\",\"))]\n      : []\n\n    const maybeDevcontainerPath = config.devcontainerPath\n      ? [toFlagArg(DEVPOD_FLAG_DEVCONTAINER_PATH, config.devcontainerPath)]\n      : []\n\n    const additionalFlags = []\n    if (WorkspaceCommands.ADDITIONAL_FLAGS.size > 0) {\n      for (const [key, value] of WorkspaceCommands.ADDITIONAL_FLAGS.entries()) {\n        if (key === WORKSPACE_COMMAND_ADDITIONAL_FLAGS_KEY) {\n          additionalFlags.push(value)\n          continue\n        }\n\n        additionalFlags.push(toFlagArg(key, value))\n      }\n    }\n\n    return WorkspaceCommands.newCommand([\n      DEVPOD_COMMAND_UP,\n      identifier,\n      ...maybeIDFlag,\n      ...maybeSourceFlag,\n      ...maybeIDEFlag,\n      ...maybeProviderFlag,\n      ...maybePrebuildRepositories,\n      ...maybeDevcontainerPath,\n      ...additionalFlags,\n      ...maybeProviderOptionsFlag,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n    ])\n  }\n\n  static StopWorkspace(id: TWorkspaceID) {\n    return WorkspaceCommands.newCommand([DEVPOD_COMMAND_STOP, id, DEVPOD_FLAG_JSON_LOG_OUTPUT])\n  }\n\n  static RebuildWorkspace(id: TWorkspaceID) {\n    return WorkspaceCommands.newCommand([\n      DEVPOD_COMMAND_UP,\n      id,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n      DEVPOD_FLAG_RECREATE,\n    ])\n  }\n\n  static ResetWorkspace(id: TWorkspaceID) {\n    return WorkspaceCommands.newCommand([\n      DEVPOD_COMMAND_UP,\n      id,\n      DEVPOD_FLAG_JSON_LOG_OUTPUT,\n      DEVPOD_FLAG_RESET,\n    ])\n  }\n\n  static TroubleshootWorkspace(id: TWorkspaceID) {\n    return WorkspaceCommands.newCommand([DEVPOD_COMMAND_TROUBLESHOOT, id])\n  }\n\n  static RemoveWorkspace(id: TWorkspaceID, force?: boolean) {\n    const args = [DEVPOD_COMMAND_DELETE, id, DEVPOD_FLAG_JSON_LOG_OUTPUT]\n    if (force) {\n      args.push(DEVPOD_FLAG_FORCE)\n    }\n\n    return WorkspaceCommands.newCommand(args)\n  }\n\n  static GetDevcontainerConfig(rawSource: string) {\n    return new Command([\n      DEVPOD_COMMAND_HELPER,\n      DEVPOD_COMMAND_GET_WORKSPACE_CONFIG,\n      rawSource,\n      DEVPOD_FLAG_TIMEOUT,\n      \"10s\",\n    ])\n  }\n}\n"
  },
  {
    "path": "desktop/src/components/Animation/Ripple.tsx",
    "content": "import { Icon, IconProps } from \"@chakra-ui/react\"\nimport { motion } from \"framer-motion\"\n\nconst initial = {\n  r: 4,\n  opacity: 0.3,\n}\nconst animate = { r: 12, opacity: 0 }\nconst transition = { duration: 4, repeat: Infinity }\nexport function Ripple(props: IconProps) {\n  return (\n    <Icon {...props} fill=\"currentColor\" viewBox=\"0 0 24 24\">\n      <motion.circle cx=\"12\" cy=\"12\" initial={initial} animate={animate} transition={transition} />\n      <motion.circle\n        cx=\"12\"\n        cy=\"12\"\n        initial={initial}\n        animate={animate}\n        transition={{ ...transition, delay: 1 }}\n      />\n      <motion.circle\n        cx=\"12\"\n        cy=\"12\"\n        initial={initial}\n        animate={animate}\n        transition={{ ...transition, delay: 2 }}\n      />\n    </Icon>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Animation/index.ts",
    "content": "export { Ripple } from \"./Ripple\"\n"
  },
  {
    "path": "desktop/src/components/AutoComplete/AutoComplete.tsx",
    "content": "import {\n  Box,\n  Fade,\n  Icon,\n  Input,\n  InputGroup,\n  InputRightElement,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { Combobox } from \"@headlessui/react\"\nimport { forwardRef, useEffect, useRef, useState } from \"react\"\nimport { AiOutlineCaretRight } from \"react-icons/ai\"\n\ntype TAutoCompleteOption = Readonly<{\n  key: string\n  label: string\n}>\ntype TAutoCompleteProps = Readonly<{\n  options: readonly TAutoCompleteOption[]\n  onChange?: (value: string) => void\n  onBlur?: () => void\n  value?: string\n  defaultValue?: string\n  placeholder?: string\n  name?: string\n}>\n\n/* \n * Can be integrated with `react-hook-form` like this:\n * ```tsx\n    const {  handleSubmit, control } = useForm()\n\n    <form onSubmit={handleSubmit(onSubmit)}>\n      <Controller\n        name=\"auto\"\n        control={control}\n        render={({ field }) => <AutoComplete options={options} {...field} />}\n      />\n      <button type=\"submit\">Submit</button>\n    </form>\n  ```\n */\nexport const AutoComplete = forwardRef<HTMLElement, TAutoCompleteProps>(function InnerAutoComplete(\n  { name, placeholder, options, defaultValue, value, onChange, onBlur },\n  ref\n) {\n  const openButtonRef = useRef<HTMLButtonElement>(null)\n  const optionsBackgroundColor = useColorModeValue(\"gray.100\", \"gray.800\")\n  const optionsZIndex = useToken(\"zIndices\", \"dropdown\")\n  const [query, setQuery] = useState(\"\")\n\n  useEffect(() => {\n    // set value initially\n    if (value) {\n      onChange?.(value)\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [])\n\n  const filteredOptions =\n    query === \"\"\n      ? options\n      : options.filter((option) => {\n          return option.key.toLowerCase().includes(query.toLowerCase())\n        })\n\n  function handleInputFocused(isOpen: boolean) {\n    return () => {\n      if (!isOpen) {\n        openButtonRef.current?.click()\n      }\n    }\n  }\n\n  return (\n    <Combobox<string>\n      ref={ref}\n      name={name}\n      value={value}\n      defaultValue={defaultValue}\n      onChange={onChange}>\n      {({ open: isOpen }) => (\n        <Box position=\"relative\" zIndex={\"\"}>\n          <InputGroup>\n            <Input\n              onBlur={onBlur}\n              spellCheck={false}\n              as={Combobox.Input}\n              placeholder={placeholder}\n              onChange={(event) => {\n                setQuery(event.target.value)\n                onChange?.(event.target.value)\n              }}\n              onClick={handleInputFocused(isOpen)}\n            />\n            <InputRightElement>\n              <Box\n                onClick={(e) => {\n                  e.preventDefault()\n                  e.stopPropagation()\n                }}>\n                <Combobox.Button ref={openButtonRef}>\n                  <Icon\n                    boxSize={4}\n                    transition={\"transform .2s\"}\n                    transform={isOpen ? \"rotate(90deg)\" : \"\"}\n                    as={AiOutlineCaretRight}\n                  />\n                </Combobox.Button>\n              </Box>\n            </InputRightElement>\n          </InputGroup>\n          <Combobox.Options\n            style={{\n              position: \"absolute\",\n              width: \"100%\",\n              zIndex: optionsZIndex,\n            }}>\n            {({ open: isOpen }) => (\n              <Box\n                maxHeight=\"48\"\n                overflowY=\"auto\"\n                backgroundColor={optionsBackgroundColor}\n                padding=\"2\"\n                borderRadius=\"md\">\n                <Fade in={isOpen}>\n                  {query.length > 0 && !filteredOptions.find((o) => o.label === query) && (\n                    <Option option={{ key: query, label: query }} />\n                  )}\n                  {filteredOptions.map((option) => (\n                    <Option key={option.key} option={option} />\n                  ))}\n                </Fade>\n              </Box>\n            )}\n          </Combobox.Options>\n        </Box>\n      )}\n    </Combobox>\n  )\n})\n\nfunction Option({ option }: { option: TAutoCompleteOption }) {\n  const activeOptionBackgroundColor = useColorModeValue(\"gray.200\", \"gray.700\")\n\n  return (\n    <Combobox.Option style={{ listStyleType: \"none\" }} key={option.key} value={option.key}>\n      {({ active }) => (\n        <Box\n          padding=\"2\"\n          borderRadius=\"md\"\n          backgroundColor={active ? activeOptionBackgroundColor : undefined}>\n          {option.label}\n        </Box>\n      )}\n    </Combobox.Option>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/AutoComplete/index.ts",
    "content": "export { AutoComplete } from \"./AutoComplete\"\n"
  },
  {
    "path": "desktop/src/components/BottomActionBar/BottomActionBar.tsx",
    "content": "import { SIDEBAR_WIDTH } from \"@/constants\"\nimport { ExclamationCircle } from \"@/icons\"\nimport { exists, isError } from \"@/lib\"\nimport {\n  BoxProps,\n  HStack,\n  IconButton,\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n  useBreakpointValue,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { motion } from \"framer-motion\"\nimport { RefObject, createContext, useContext, useEffect, useMemo, useRef, useState } from \"react\"\nimport { ErrorMessageBox } from \"../Error\"\nimport { useBorderColor } from \"@/Theme\"\n\ntype TModalBottomBarProps = Readonly<{\n  isModal?: boolean\n  hasSidebar?: boolean\n  stickToBottom?: boolean\n  children: React.ReactNode\n}>\n\nconst BottomActionBarContext = createContext<{ ref: RefObject<HTMLDivElement> } | undefined>(\n  undefined\n)\nexport function BottomActionBar({\n  isModal = false,\n  hasSidebar = true,\n  stickToBottom,\n  children,\n}: TModalBottomBarProps) {\n  const ref = useRef<HTMLDivElement>(null)\n  const bottomBarBackgroundColor = useColorModeValue(\"white\", \"gray.900\")\n  const bottomBarBackgroundColorModal = useColorModeValue(\"white\", \"background.darkest\")\n  const borderColor = useBorderColor()\n  const translateX = useBreakpointValue({\n    base: hasSidebar ? \"translateX(-3rem)\" : \"\",\n    xl: isModal ? \"translateX(-3rem)\" : \"\",\n  })\n  const paddingX = useBreakpointValue({ base: \"3rem\", xl: isModal ? \"3rem\" : \"4\" })\n  const value = useMemo(() => ({ ref }), [ref])\n\n  const width = useMemo(() => {\n    if (isModal) {\n      return \"calc(100% + 5.5rem)\"\n    }\n\n    if (hasSidebar) {\n      return { base: `calc(100vw - ${SIDEBAR_WIDTH})`, xl: \"full\" }\n    }\n\n    return { base: \"100vw\", xl: \"full\" }\n  }, [hasSidebar, isModal])\n\n  const otherProps = useMemo<BoxProps>(() => {\n    if (stickToBottom) {\n      return {\n        position: \"fixed\",\n        bottom: \"2rem\",\n      }\n    }\n\n    return {\n      position: \"sticky\",\n      bottom: \"-1.1rem\",\n    }\n  }, [stickToBottom])\n\n  return (\n    <BottomActionBarContext.Provider value={value}>\n      <HStack\n        ref={ref}\n        as={motion.div}\n        {...otherProps}\n        initial={{ transform: `translateY(100%) ${translateX}` }}\n        animate={{ transform: `translateY(0) ${translateX}` }}\n        marginTop=\"10\"\n        left=\"0\"\n        width={width}\n        height=\"20\"\n        alignItems=\"center\"\n        borderTopWidth=\"thin\"\n        borderColor={borderColor}\n        backgroundColor={isModal ? bottomBarBackgroundColor : bottomBarBackgroundColorModal}\n        justifyContent=\"space-between\"\n        paddingX={paddingX}\n        zIndex=\"overlay\">\n        {children}\n      </HStack>\n    </BottomActionBarContext.Provider>\n  )\n}\n\ntype TBottomActionBarErrorProps = Readonly<{\n  error?: Error | null\n  containerRef?: RefObject<HTMLDivElement>\n}>\nexport function BottomActionBarError({ error, containerRef }: TBottomActionBarErrorProps) {\n  const ctx = useContext(BottomActionBarContext)\n  const { height, width } = useErrorDimensions(containerRef, ctx?.ref)\n  // Open error popover when error changes\n  const errorButtonRef = useRef<HTMLButtonElement>(null)\n  useEffect(() => {\n    if (error) {\n      errorButtonRef.current?.click()\n    }\n  }, [error])\n\n  return (\n    <Popover placement=\"top\" computePositionOnMount>\n      <PopoverTrigger>\n        <IconButton\n          ref={errorButtonRef}\n          visibility={error ? \"visible\" : \"hidden\"}\n          variant=\"ghost\"\n          aria-label=\"Show errors\"\n          icon={\n            <motion.span\n              key={error ? \"error\" : undefined}\n              animate={{ scale: [1, 1.2, 1] }}\n              transition={{ type: \"keyframes\", ease: [\"easeInOut\"] }}>\n              <ExclamationCircle boxSize=\"8\" color=\"red.400\" />\n            </motion.span>\n          }\n          isDisabled={!exists(error)}\n        />\n      </PopoverTrigger>\n      <PopoverContent width={width} margin=\"4\" zIndex=\"overlay\">\n        {isError(error) && <ErrorMessageBox maxHeight={height} overflowY=\"auto\" error={error} />}\n      </PopoverContent>\n    </Popover>\n  )\n}\n\nfunction useErrorDimensions(\n  ref: RefObject<HTMLElement> | undefined,\n  _parentRef: RefObject<HTMLElement> | undefined,\n  defaultHeight: BoxProps[\"height\"] = \"5xl\",\n  defaultWidth: BoxProps[\"width\"] = \"5xl\"\n) {\n  const [errorHeight, setErrorHeight] = useState<BoxProps[\"height\"]>(defaultHeight)\n  const [errorWidth] = useState<BoxProps[\"width\"]>(defaultWidth)\n\n  useEffect(() => {\n    const curr = ref?.current\n    if (!curr) {\n      return\n    }\n    const observer = new ResizeObserver((entries) => {\n      for (const entry of entries) {\n        if (entry.target === curr) {\n          const heightPx = entry.contentRect.height\n\n          setErrorHeight(`calc(${heightPx}px - 4rem)`)\n        }\n      }\n    })\n    observer.observe(curr)\n\n    return () => observer.disconnect()\n  }, [ref])\n\n  return { height: errorHeight, width: errorWidth }\n}\n"
  },
  {
    "path": "desktop/src/components/BottomActionBar/index.ts",
    "content": "export { BottomActionBar, BottomActionBarError } from \"./BottomActionBar\"\n"
  },
  {
    "path": "desktop/src/components/CardHeader/WorkspaceCardHeader.tsx",
    "content": "import { Box, Checkbox, HStack, Heading, Icon, Text, VStack } from \"@chakra-ui/react\"\nimport dayjs from \"dayjs\"\nimport { ReactNode, useId } from \"react\"\nimport { HiClock, HiOutlineCode } from \"react-icons/hi\"\nimport { useNavigate } from \"react-router\"\nimport { IconTag } from \"@/components\"\nimport { Stack3D } from \"@/icons\"\nimport { Routes } from \"@/routes\"\n\ntype TWorkspaceCardHeaderProps = Readonly<{\n  id: string\n  statusBadge?: ReactNode\n  controls?: ReactNode\n  children?: ReactNode\n  source?: ReactNode\n\n  isSelected?: boolean\n  onSelectionChange?: (isSelected: boolean) => void\n}>\nexport function WorkspaceCardHeader({\n  id,\n  isSelected,\n  onSelectionChange,\n  statusBadge,\n  controls,\n  source,\n  children,\n}: TWorkspaceCardHeaderProps) {\n  const checkboxID = useId()\n\n  return (\n    <>\n      <VStack align=\"start\" spacing={0}>\n        <HStack w=\"full\">\n          {onSelectionChange && (\n            <Checkbox\n              id={checkboxID}\n              paddingRight=\"2\"\n              isChecked={isSelected}\n              onChange={(e) => onSelectionChange(e.target.checked)}\n            />\n          )}\n          <Heading size=\"md\">\n            <HStack alignItems=\"baseline\" justifyContent=\"space-between\">\n              <Text\n                as=\"label\"\n                htmlFor={checkboxID}\n                fontWeight=\"bold\"\n                maxWidth=\"23rem\"\n                overflow=\"hidden\"\n                whiteSpace=\"nowrap\"\n                textOverflow=\"ellipsis\">\n                {id}\n              </Text>\n              <Box transform=\"translateY(1px)\">{statusBadge}</Box>\n            </HStack>\n          </Heading>\n          <Box marginLeft=\"auto\">{controls}</Box>\n        </HStack>\n        {source}\n      </VStack>\n\n      <HStack rowGap={2} marginTop={4} flexWrap=\"wrap\" alignItems=\"center\" paddingLeft=\"8\">\n        {children}\n      </HStack>\n    </>\n  )\n}\n\ntype TProviderProps = Readonly<{ name: string | undefined }>\nfunction Provider({ name }: TProviderProps) {\n  const navigate = useNavigate()\n\n  return (\n    <IconTag\n      icon={<Stack3D />}\n      label={name ?? \"No provider\"}\n      info={name ? `Uses provider ${name}` : undefined}\n      onClick={() => {\n        if (!name) {\n          return\n        }\n\n        navigate(Routes.toProvider(name))\n      }}\n    />\n  )\n}\nWorkspaceCardHeader.Provider = Provider\n\ntype TIDEProps = Readonly<{ name: string }>\nfunction IDE({ name }: TIDEProps) {\n  return (\n    <IconTag icon={<Icon as={HiOutlineCode} />} label={name} info={`Will be opened in ${name}`} />\n  )\n}\nWorkspaceCardHeader.IDE = IDE\n\ntype TLastUsedProps = Readonly<{ timestamp: string }>\nfunction LastUsed({ timestamp }: TLastUsedProps) {\n  return (\n    <IconTag\n      icon={<Icon as={HiClock} />}\n      label={dayjs(new Date(timestamp)).fromNow()}\n      info={`Last used ${dayjs(new Date(timestamp)).fromNow()}`}\n    />\n  )\n}\nWorkspaceCardHeader.LastUsed = LastUsed\n"
  },
  {
    "path": "desktop/src/components/CardHeader/index.ts",
    "content": "export { WorkspaceCardHeader } from \"./WorkspaceCardHeader\"\n"
  },
  {
    "path": "desktop/src/components/DeleteWorkspacesModal/DeleteWorkspacesModal.tsx",
    "content": "import {\n  Box,\n  Button,\n  Checkbox,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n} from \"@chakra-ui/react\"\nimport React, { useCallback, useState } from \"react\"\n\nexport function DeleteWorkspacesModal({\n  onDeleteRequested,\n  onCloseRequested,\n  amount,\n  isOpen,\n  pro = false,\n}: {\n  isOpen: boolean\n  onCloseRequested: () => void\n  onDeleteRequested: (forceDelete: boolean) => void\n  amount: number\n  pro?: boolean\n}) {\n  const [forceDelete, setForceDelete] = useState(false)\n\n  const onDeleteClick = useCallback(() => {\n    onCloseRequested()\n    onDeleteRequested(pro ? true : forceDelete)\n  }, [forceDelete, onDeleteRequested, onCloseRequested])\n\n  const onForceDeleteChanged = useCallback(\n    (e: React.ChangeEvent<HTMLInputElement>) => {\n      setForceDelete(e.target.checked)\n    },\n    [setForceDelete]\n  )\n\n  return (\n    <Modal onClose={onCloseRequested} isOpen={isOpen} isCentered>\n      <ModalOverlay />\n      <ModalContent>\n        <ModalHeader>Delete {amount} Workspaces</ModalHeader>\n        <ModalCloseButton />\n        <ModalBody>\n          Deleting the workspaces will erase all state. Are you sure you want to delete the selected\n          workspaces?\n          {!pro && (\n            <Box marginTop={\"2.5\"}>\n              <Checkbox checked={forceDelete} onChange={onForceDeleteChanged}>\n                Force Delete\n              </Checkbox>\n            </Box>\n          )}\n        </ModalBody>\n        <ModalFooter>\n          <HStack spacing={\"2\"}>\n            <Button onClick={onCloseRequested}>Close</Button>\n            <Button colorScheme=\"red\" onClick={onDeleteClick}>\n              Delete\n            </Button>\n          </HStack>\n        </ModalFooter>\n      </ModalContent>\n    </Modal>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/DeleteWorkspacesModal/index.ts",
    "content": "export * from \"./DeleteWorkspacesModal\"\n"
  },
  {
    "path": "desktop/src/components/Error/ErrorMessageBox.tsx",
    "content": "import { Box, BoxProps, Text, useColorModeValue } from \"@chakra-ui/react\"\nimport React from \"react\"\n\ntype TErrorMessageBox = Readonly<{ error: Error }> & BoxProps\nexport function ErrorMessageBox({ error, ...boxProps }: TErrorMessageBox) {\n  const backgroundColor = useColorModeValue(\"red.50\", \"red.100\")\n  const textColor = useColorModeValue(\"red.700\", \"red.800\")\n\n  return (\n    <Box\n      backgroundColor={backgroundColor}\n      paddingY=\"1\"\n      paddingX=\"2\"\n      borderRadius=\"md\"\n      display=\"inline-block\"\n      {...boxProps}>\n      <Text userSelect=\"text\" cursor=\"text\" color={textColor} fontFamily=\"monospace\">\n        {error.message.split(\"\\n\").map((line, index) => (\n          <React.Fragment key={index}>\n            {line}\n            <br />\n          </React.Fragment>\n        ))}\n      </Text>\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Error/index.ts",
    "content": "export { ErrorMessageBox } from \"./ErrorMessageBox\"\n"
  },
  {
    "path": "desktop/src/components/ExampleCard.tsx",
    "content": "import {\n  BoxProps,\n  Card,\n  Image,\n  ImageProps,\n  Text,\n  Tooltip,\n  forwardRef,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { ComponentType, ReactElement, cloneElement, useMemo } from \"react\"\n\ntype TExampleCardProps = {\n  name: string\n  image?: string | ReactElement\n  size?: keyof typeof sizes\n\n  isSelected?: boolean\n  isDisabled?: boolean\n  showTooltip?: boolean\n  onClick?: () => void\n} & BoxProps\n\nconst sizes: Record<\"sm\" | \"md\" | \"lg\", BoxProps[\"width\"]> = {\n  sm: \"12\",\n  md: \"16\",\n  lg: \"20\",\n} as const\n\nexport const ExampleCard = forwardRef<TExampleCardProps, ComponentType<typeof Card>>(\n  function InnerExampleCard(\n    {\n      name,\n      image,\n      isSelected,\n      isDisabled,\n      size = \"lg\",\n      showTooltip = true,\n      onClick,\n      ...restBoxProps\n    },\n    ref\n  ) {\n    const hoverBackgroundColor = useColorModeValue(\"gray.50\", \"gray.800\")\n\n    const primaryColorLight = useToken(\"colors\", \"primary.400\")\n    const primaryColorDark = useToken(\"colors\", \"primary.800\")\n\n    const selectedProps = isSelected\n      ? {\n          _before: {\n            content: '\"\"',\n            position: \"absolute\",\n            top: 0,\n            bottom: 0,\n            left: 0,\n            right: 0,\n            background: `linear-gradient(135deg, ${primaryColorLight}55 30%, ${primaryColorDark}55, ${primaryColorDark}88)`,\n            opacity: 0.7,\n            width: \"full\",\n            height: \"full\",\n          },\n          boxShadow: `inset 0px 0px 0px 1px ${primaryColorDark}55`,\n        }\n      : {}\n\n    const disabledProps = isDisabled ? { filter: \"grayscale(100%)\", cursor: \"not-allowed\" } : {}\n\n    const imageElement = useMemo(() => {\n      if (image === undefined) {\n        return null\n      }\n      const imageProps: ImageProps = { objectFit: \"fill\", overflow: \"hidden\", zIndex: \"1\" }\n      if (typeof image === \"string\") {\n        return <Image src={image} {...imageProps} />\n      }\n\n      return cloneElement(image, imageProps)\n    }, [image])\n\n    return (\n      <Tooltip textTransform={\"capitalize\"} label={name} isDisabled={size === \"lg\" || !showTooltip}>\n        <Card\n          ref={ref}\n          {...restBoxProps}\n          variant=\"unstyled\"\n          width={sizes[size]}\n          height={sizes[size]}\n          alignItems=\"center\"\n          display=\"flex\"\n          justifyContent=\"center\"\n          cursor=\"pointer\"\n          boxSizing=\"border-box\"\n          position=\"relative\"\n          backgroundColor=\"transparent\"\n          _dark={{\n            backgroundColor: \"transparent\",\n            _hover: {\n              backgroundColor: isDisabled || isSelected ? undefined : hoverBackgroundColor,\n            },\n          }}\n          overflow=\"hidden\"\n          _hover={{ backgroundColor: isDisabled || isSelected ? undefined : hoverBackgroundColor }}\n          {...(onClick && !isDisabled && !isSelected ? { onClick } : {})}\n          {...selectedProps}\n          {...disabledProps}>\n          {imageElement}\n          {size === \"lg\" && (\n            <Text\n              paddingBottom=\"1\"\n              fontSize=\"11px\"\n              color=\"gray.500\"\n              _dark={{ color: \"gray.300\" }}\n              fontWeight=\"medium\"\n              overflow=\"hidden\"\n              maxWidth={sizes[size]}\n              textOverflow=\"ellipsis\"\n              whiteSpace=\"nowrap\"\n              textTransform={\"capitalize\"}>\n              {name}\n            </Text>\n          )}\n        </Card>\n      </Tooltip>\n    )\n  }\n)\n"
  },
  {
    "path": "desktop/src/components/Form/Form.tsx",
    "content": "import { Box, BoxProps, forwardRef } from \"@chakra-ui/react\"\n\ntype TFormProps = Readonly<{\n  ref?: React.Ref<HTMLFormElement>\n  children: React.ReactNode\n  onSubmit?: React.FormEventHandler<HTMLFormElement>\n}> &\n  Omit<BoxProps, \"onSubmit\">\n\nexport const Form = forwardRef<TFormProps, typeof Box>(function InnerForm(\n  { children, onSubmit, ...boxProps },\n  ref\n) {\n  return (\n    <Box\n      ref={ref}\n      as=\"form\"\n      spellCheck={false}\n      width=\"full\"\n      display=\"flex\"\n      flexFlow=\"column nowrap\"\n      {...boxProps}\n      onSubmit={onSubmit}>\n      {children}\n    </Box>\n  )\n})\n"
  },
  {
    "path": "desktop/src/components/Form/index.ts",
    "content": "export { Form } from \"./Form\"\n"
  },
  {
    "path": "desktop/src/components/IDEGroup/IDEGroup.tsx",
    "content": "import { TIDE } from \"@/types\"\nimport { getIDEDisplayName, useHover } from \"@/lib\"\nimport {\n  HStack,\n  MenuItem,\n  PlacementWithLogical,\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n  Portal,\n  Text,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ChevronRightIcon } from \"@chakra-ui/icons\"\nimport { IDEIcon } from \"@/components\"\nimport { useCallback, useEffect } from \"react\"\n\nexport function IDEGroup({\n  ides,\n  group,\n  disabled,\n  onItemClick,\n  placement,\n  offset,\n  onHoverChange,\n}: {\n  ides?: TIDE[]\n  group: string\n  disabled?: boolean\n  onItemClick: (ide: TIDE[\"name\"]) => void\n  placement?: PlacementWithLogical\n  offset?: [number, number]\n  onHoverChange?: (group: string, hover: boolean) => void\n}) {\n  const [popoverHover, popoverRef] = useHover()\n  const [triggerHover, triggerRef] = useHover()\n\n  useEffect(() => {\n    onHoverChange?.(group, popoverHover || triggerHover)\n  }, [popoverHover, triggerHover, onHoverChange, group])\n\n  return (\n    <Popover\n      isOpen={popoverHover || triggerHover}\n      placement={placement ?? \"right-end\"}\n      offset={offset ?? [100, 0]}>\n      <PopoverTrigger>\n        <MenuItem ref={triggerRef} isDisabled={disabled}>\n          <HStack width=\"full\" justifyContent=\"space-between\">\n            <Text>{group}</Text>\n            <ChevronRightIcon boxSize={4} />\n          </HStack>\n        </MenuItem>\n      </PopoverTrigger>\n      <Portal>\n        <PopoverContent zIndex=\"popover\" width=\"fit-content\" ref={popoverRef}>\n          {ides?.map((ide) => (\n            <IDEItem key={ide.name} ide={ide} onItemClick={onItemClick} disabled={disabled} />\n          ))}\n        </PopoverContent>\n      </Portal>\n    </Popover>\n  )\n}\n\nfunction IDEItem({\n  disabled,\n  onItemClick,\n  ide,\n}: {\n  ide: TIDE\n  onItemClick: (ide: TIDE[\"name\"]) => void\n  disabled?: boolean\n}) {\n  const menuHoverColor = useColorModeValue(\"gray.100\", \"gray.700\")\n\n\n  const onClick = useCallback(() => {\n    onItemClick(ide.name)\n  }, [onItemClick, ide])\n\n  return (\n    <MenuItem\n      _hover={{ bg: menuHoverColor }}\n      isDisabled={disabled}\n      onClick={onClick}\n      value={ide.name!}\n      icon={<IDEIcon ide={ide} width={6} height={6} size=\"sm\" />}>\n      {getIDEDisplayName(ide)}\n    </MenuItem>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/IDEGroup/index.ts",
    "content": "export * from \"./IDEGroup\"\n"
  },
  {
    "path": "desktop/src/components/IDEIcon/IDEIcon.tsx",
    "content": "import {\n  Box,\n  BoxProps,\n  Icon,\n  IconProps,\n  Image,\n  useColorMode,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { HiBeaker } from \"react-icons/hi2\"\nimport {\n  CLionSvg,\n  CodiumSvg,\n  CursorSvg,\n  DataSpellSvg,\n  FleetSvg,\n  GolandSvg,\n  IntelliJSvg,\n  JupyterNotebookDarkSvg,\n  JupyterNotebookSvg,\n  NoneSvg,\n  NoneSvgDark,\n  PHPStormSvg,\n  PositronSvg,\n  PycharmSvg,\n  RStudioSvg,\n  RiderSvg,\n  RubyMineSvg,\n  RustRoverSvg,\n  VSCodeBrowser,\n  VSCodeInsidersSvg,\n  VSCodeSvg,\n  WebstormSvg,\n  WindsurfSvg,\n  ZedDarkSvg,\n  ZedSvg,\n} from \"../../images\"\nimport { TIDE } from \"../../types\"\nimport { useMemo } from \"react\"\n\nconst SIZES: Record<NonNullable<TIDEIconProps[\"size\"]>, IconProps> = {\n  sm: {\n    boxSize: 3,\n    padding: \"1px\",\n  },\n  md: {\n    boxSize: 6,\n    padding: \"3px\",\n  },\n}\n\nconst IDE_ICONS: Record<string, string> = {\n  none: NoneSvg,\n  vscode: VSCodeSvg,\n  \"vscode-insiders\": VSCodeInsidersSvg,\n  openvscode: VSCodeBrowser,\n  intellij: IntelliJSvg,\n  goland: GolandSvg,\n  rustrover: RustRoverSvg,\n  pycharm: PycharmSvg,\n  phpstorm: PHPStormSvg,\n  clion: CLionSvg,\n  rubymine: RubyMineSvg,\n  rider: RiderSvg,\n  webstorm: WebstormSvg,\n  dataspell: DataSpellSvg,\n  fleet: FleetSvg,\n  jupyternotebook: JupyterNotebookSvg,\n  jupyternotebook_dark: JupyterNotebookDarkSvg,\n  cursor: CursorSvg,\n  positron: PositronSvg,\n  codium: CodiumSvg,\n  zed: ZedSvg,\n  zed_dark: ZedDarkSvg,\n  rstudio: RStudioSvg,\n  windsurf: WindsurfSvg,\n}\n\ntype TIDEIconProps = Readonly<{ ide: TIDE; size?: \"sm\" | \"md\" }> & BoxProps\nexport function IDEIcon({ ide, size = \"md\", ...boxProps }: TIDEIconProps) {\n  const experimentalIconSizeProps = SIZES[size]\n  const primaryColorDarkToken = useColorModeValue(\"primary.800\", \"primary.400\")\n  const primaryColorDark = useToken(\"colors\", primaryColorDarkToken)\n  const primaryColorLightToken = useColorModeValue(\"primary.400\", \"primary.800\")\n  const primaryColorLight = useToken(\"colors\", primaryColorLightToken)\n  const backgroundColor = useColorModeValue(\"white\", \"gray.700\")\n  const { colorMode } = useColorMode()\n\n  const experimentalIconStylingProps =\n    size === \"sm\"\n      ? {\n          color: primaryColorDark,\n        }\n      : {\n          boxShadow: `inset 0px 0px 0px 1px ${primaryColorDark}55`,\n          background:\n            colorMode === \"light\"\n              ? `linear-gradient(135deg, ${primaryColorLight}55 50%, ${primaryColorDark}55, ${primaryColorDark}88)`\n              : `linear-gradient(135deg, ${primaryColorDark}55 50%, ${primaryColorLight}55, ${primaryColorLight}88)`,\n          color: `${primaryColorDark}CC`,\n        }\n  const fallbackIcon = colorMode === \"light\" ? NoneSvg : NoneSvgDark\n\n  const icon = useMemo(() => {\n    if (colorMode === \"light\") {\n      return IDE_ICONS[ide.name!] ?? ide.icon\n    } else {\n      const darkIcon = IDE_ICONS[ide.name! + \"_dark\"] ?? ide.iconDark\n      if (darkIcon) {\n        return darkIcon\n      }\n\n      // fall back to regular icon\n      return IDE_ICONS[ide.name!] ?? ide.icon\n    }\n  }, [colorMode, ide])\n\n  return (\n    <Box width=\"full\" height=\"full\" position=\"relative\">\n      <Image src={icon ?? fallbackIcon} {...boxProps} />\n      {ide.experimental && (\n        <>\n          <Box\n            position=\"absolute\"\n            bottom=\"0\"\n            right=\"0\"\n            zIndex=\"docked\"\n            borderRadius=\"full\"\n            boxSize={experimentalIconSizeProps.boxSize}\n            backgroundColor={backgroundColor}\n          />\n          <Icon\n            position=\"absolute\"\n            bottom=\"0\"\n            right=\"0\"\n            zIndex=\"docked\"\n            borderRadius=\"full\"\n            as={HiBeaker}\n            {...experimentalIconSizeProps}\n            {...experimentalIconStylingProps}\n          />\n        </>\n      )}\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/IDEIcon/index.ts",
    "content": "export { IDEIcon } from \"./IDEIcon\"\n"
  },
  {
    "path": "desktop/src/components/Layout/NavigationViewLayout.tsx",
    "content": "import { Heading, HStack } from \"@chakra-ui/react\"\nimport { ReactNode } from \"react\"\nimport { exists } from \"../../lib\"\nimport { ToolbarTitle } from \"./Toolbar\"\nimport { TViewTitle } from \"./types\"\n\ntype TNavigationViewLayoutProps = Readonly<{ title: TViewTitle | null; children?: ReactNode }>\nexport function NavigationViewLayout({ title, children }: TNavigationViewLayoutProps) {\n  return (\n    <>\n      {exists(title) && (\n        <ToolbarTitle>\n          <HStack align=\"center\" width=\"full\" overflow=\"hidden\">\n            {exists(title.leadingAction) && title.leadingAction}\n            <Heading\n              overflow=\"hidden\"\n              whiteSpace={\"nowrap\"}\n              textOverflow=\"ellipsis\"\n              as={title.priority === \"high\" ? \"h1\" : \"h2\"}\n              size=\"sm\">\n              {title.label}\n            </Heading>\n            {exists(title.trailingAction) && title.trailingAction}\n          </HStack>\n        </ToolbarTitle>\n      )}\n      {children}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/Notifications.tsx",
    "content": "import {\n  Badge,\n  Box,\n  Button,\n  Center,\n  Divider,\n  HStack,\n  Heading,\n  IconButton,\n  Image,\n  Link,\n  LinkBox,\n  LinkOverlay,\n  Popover,\n  PopoverArrow,\n  PopoverBody,\n  PopoverContent,\n  PopoverHeader,\n  PopoverTrigger,\n  Portal,\n  Spinner,\n  Text,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport dayjs from \"dayjs\"\nimport { JSX, ReactNode, useMemo } from \"react\"\nimport { Link as RouterLink, To, useLocation } from \"react-router-dom\"\nimport { client } from \"../../client\"\nimport { TActionObj, useAllWorkspaceActions, useSettings } from \"../../contexts\"\nimport { Bell, CheckCircle, ExclamationCircle, ExclamationTriangle } from \"../../icons\"\nimport { getActionDisplayName, useUpdate } from \"../../lib\"\nimport { Ripple } from \"../Animation\"\n\ntype TNotificationsProps = Readonly<{\n  badgeNumber?: number\n  providerUpdates?: ReactNode\n  icon?: JSX.Element\n  getActionDestination: (action: TActionObj) => To\n}>\nexport function Notifications({\n  icon,\n  badgeNumber = 0,\n  providerUpdates,\n  getActionDestination,\n}: TNotificationsProps) {\n  const location = useLocation()\n  const actions = useAllWorkspaceActions()\n  const backgroundColor = useColorModeValue(\"white\", \"gray.900\")\n  const subheadingTextColor = useColorModeValue(\"gray.500\", \"gray.400\")\n  const actionHoverColor = useColorModeValue(\"gray.100\", \"gray.700\")\n  const hasActiveActions = actions.active.length > 0\n  const settings = useSettings()\n  const { pendingUpdate, install: installUpdate, isInstalling, isInstallDisabled } = useUpdate()\n\n  const combinedActions = useMemo(() => {\n    return [...actions.active, ...actions.history]\n  }, [actions.active, actions.history])\n\n  const maybeIconColor = useMemo(() => icon?.props.color, [icon])\n\n  return (\n    <Popover placement=\"bottom\">\n      <PopoverTrigger>\n        <Center>\n          <IconButton\n            variant=\"ghost\"\n            size=\"md\"\n            rounded=\"full\"\n            aria-label=\"Show onging operations\"\n            {...(maybeIconColor ? { color: maybeIconColor } : {})}\n            icon={\n              <>\n                {icon ? icon : <Bell boxSize={6} position=\"absolute\" />}\n                {(pendingUpdate || badgeNumber !== 0) && (\n                  <Badge\n                    colorScheme=\"red\"\n                    position=\"absolute\"\n                    variant=\"solid\"\n                    bgColor=\"red.500\"\n                    borderRadius=\"full\"\n                    right=\"0\"\n                    top=\"0\">\n                    {pendingUpdate ? 1 + badgeNumber : badgeNumber}\n                  </Badge>\n                )}\n                {hasActiveActions && <Ripple boxSize={10} />}\n              </>\n            }\n          />\n        </Center>\n      </PopoverTrigger>\n      <Portal>\n        <Box width=\"full\" height=\"full\" zIndex=\"popover\" position=\"relative\">\n          <PopoverContent backgroundColor={backgroundColor} zIndex=\"popover\">\n            <PopoverArrow backgroundColor={backgroundColor} />\n            <PopoverHeader>Notifications</PopoverHeader>\n            <PopoverBody overflow=\"hidden\" maxHeight=\"20rem\" paddingInline=\"0\">\n              {pendingUpdate && (\n                <HStack\n                  justifyContent=\"space-between\"\n                  paddingX=\"7\"\n                  paddingTop=\"2\"\n                  paddingBottom=\"3\"\n                  width=\"calc(100% + 1.5rem)\"\n                  transform={\"translateX(-0.75rem)\"}\n                  borderBottomWidth=\"thin\"\n                  borderColor=\"inherit\"\n                  spacing=\"0\">\n                  <VStack align=\"start\" spacing=\"0\">\n                    <Heading size=\"xs\">{pendingUpdate.tag_name} is available</Heading>\n                    <Text fontSize=\"xs\">\n                      See{\" \"}\n                      <Link onClick={() => client.open(pendingUpdate.html_url)}>release notes</Link>\n                    </Text>\n                  </VStack>\n                  <Button\n                    isLoading={isInstalling}\n                    isDisabled={isInstallDisabled}\n                    onClick={() => installUpdate()}\n                    variant=\"outline\">\n                    Install now\n                  </Button>\n                </HStack>\n              )}\n              <Box width=\"full\" overflowY=\"auto\" maxHeight=\"17rem\" height=\"full\" padding=\"1\">\n                {combinedActions.length === 0 && badgeNumber === 0 && (\n                  <Text padding={2}>No notifications</Text>\n                )}\n\n                {providerUpdates && (\n                  <>\n                    {providerUpdates}\n                    <Divider />\n                  </>\n                )}\n\n                {combinedActions.map((action) => (\n                  <LinkBox\n                    key={action.id}\n                    padding={2}\n                    fontSize=\"sm\"\n                    borderRadius=\"md\"\n                    width=\"full\"\n                    display=\"flex\"\n                    flexFlow=\"row nowrap\"\n                    alignItems=\"center\"\n                    gap={3}\n                    _hover={{ backgroundColor: actionHoverColor }}>\n                    {action.status === \"pending\" ? (\n                      settings.partyParrot ? (\n                        <Image\n                          width=\"6\"\n                          height=\"6\"\n                          src={\"https://cdn3.emoji.gg/emojis/2747_PartyParrot.gif\"}\n                        />\n                      ) : (\n                        <Spinner color=\"blue.300\" size=\"sm\" />\n                      )\n                    ) : null}\n                    {action.status === \"success\" && <CheckCircle color=\"green.300\" />}\n                    {action.status === \"error\" && <ExclamationCircle color=\"red.300\" />}\n                    {action.status === \"cancelled\" && <ExclamationTriangle color=\"orange.300\" />}\n\n                    <VStack align=\"start\" spacing=\"0\">\n                      <Text fontWeight=\"bold\">\n                        <LinkOverlay\n                          as={RouterLink}\n                          to={getActionDestination(action)}\n                          state={{ origin: location.pathname, actionID: action.id }}\n                          textTransform=\"capitalize\">\n                          {getActionDisplayName(action)}\n                        </LinkOverlay>\n                      </Text>\n                      {action.finishedAt !== undefined && (\n                        <Text color={subheadingTextColor} marginTop=\"-1\">\n                          {dayjs(action.finishedAt).fromNow()}\n                        </Text>\n                      )}\n                    </VStack>\n                  </LinkBox>\n                ))}\n              </Box>\n            </PopoverBody>\n          </PopoverContent>\n        </Box>\n      </Portal>\n    </Popover>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/ProLayout.tsx",
    "content": "import { useBorderColor } from \"@/Theme\"\nimport { STATUS_BAR_HEIGHT } from \"@/constants\"\nimport { Box, Flex, HStack, useColorModeValue, useToken } from \"@chakra-ui/react\"\nimport { ReactNode } from \"react\"\nimport { StatusBar } from \"./StatusBar\"\nimport { Toolbar } from \"./Toolbar\"\nimport { isMacOS } from \"@/lib\"\n\ntype TProLayoutProps = Readonly<{\n  toolbarItems: ReactNode\n  statusBarItems: ReactNode\n  children: ReactNode\n}>\nexport function ProLayout({ toolbarItems, statusBarItems, children }: TProLayoutProps) {\n  const contentBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n  const toolbarHeight = useToken(\"sizes\", \"10\")\n  const statusBarHeight = useToken(\"sizes\", \"8\")\n  const borderColor = useBorderColor()\n\n  return (\n    <Flex width=\"100vw\" maxWidth=\"100vw\" overflow=\"hidden\">\n      <Box width=\"full\" height=\"full\">\n        <Box\n          data-tauri-drag-region // keep!\n          backgroundColor={contentBackgroundColor}\n          position=\"relative\"\n          width=\"full\"\n          height=\"full\"\n          overflowY=\"auto\">\n          <Toolbar\n            backgroundColor={contentBackgroundColor}\n            height={toolbarHeight}\n            position=\"sticky\"\n            data-tauri-drag-region // keep!\n            width=\"full\">\n            <HStack\n              justifyContent=\"space-between\"\n              paddingLeft={isMacOS ? \"24\" : \"8\"}\n              data-tauri-drag-region // keep!\n            >\n              {toolbarItems}\n            </HStack>\n          </Toolbar>\n          <Box\n            as=\"main\"\n            paddingTop=\"8\"\n            paddingBottom={STATUS_BAR_HEIGHT}\n            paddingX=\"8\"\n            width=\"full\"\n            height={`calc(100vh - ${toolbarHeight} - ${statusBarHeight})`}\n            overflowX=\"hidden\"\n            overflowY=\"auto\">\n            {children}\n          </Box>\n          <StatusBar\n            height={STATUS_BAR_HEIGHT}\n            position=\"fixed\"\n            bottom=\"0\"\n            width=\"full\"\n            borderTopWidth=\"thin\"\n            borderTopColor={borderColor}\n            backgroundColor={contentBackgroundColor}>\n            {statusBarItems}\n          </StatusBar>\n        </Box>\n      </Box>\n    </Flex>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/ProSwitcher.tsx",
    "content": "import { client } from \"@/client\"\nimport { useProInstances, useProviders, useSettings } from \"@/contexts\"\nimport { CheckCircle, CircleWithArrow, DevPodProBadge, ExclamationTriangle } from \"@/icons\"\nimport {\n  exists,\n  canHealthCheck as isNewProProvider,\n  useLoginProModal,\n  useReLoginProModal,\n} from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { TProID, TProInstance, TProInstances, TProviderConfig } from \"@/types\"\nimport { useDeleteProviderModal } from \"@/views/Providers/useDeleteProviderModal\"\nimport { ChevronDownIcon, CloseIcon } from \"@chakra-ui/icons\"\nimport {\n  Box,\n  Button,\n  ButtonGroup,\n  HStack,\n  Heading,\n  Icon,\n  IconButton,\n  Link,\n  List,\n  ListItem,\n  Popover,\n  PopoverArrow,\n  PopoverBody,\n  PopoverContent,\n  PopoverHeader,\n  PopoverTrigger,\n  Portal,\n  Text,\n  Tooltip,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport dayjs from \"dayjs\"\nimport { Dispatch, ReactElement, SetStateAction, useEffect, useMemo, useState } from \"react\"\nimport { HiArrowRightOnRectangle, HiClock } from \"react-icons/hi2\"\nimport { useNavigate } from \"react-router-dom\"\nimport { IconTag } from \"../Tag\"\n\ntype TProInstanceWithProvider = TProInstance & Readonly<{ providerConfig: TProviderConfig | null }>\nexport function ProSwitcher() {\n  const [[proInstances]] = useProInstances()\n  const { modal: loginProModal, handleOpenLogin: handleConnectClicked } = useLoginProModal()\n  const { modal: reLoginProModal, handleOpenLogin: handleReLoginClicked } = useReLoginProModal()\n  const [isDeleting, setIsDeleting] = useState(false)\n\n  const backgroundColor = useColorModeValue(\"white\", \"gray.900\")\n  const handleAnnouncementClicked = () => {\n    client.open(\"https://devpod.sh/pro\")\n  }\n  const { experimental_devPodPro } = useSettings()\n  const isProUnauthenticated = proInstances?.some(({ authenticated }) => !authenticated)\n  if (!experimental_devPodPro) {\n    return (\n      <Button\n        variant=\"outline\"\n        leftIcon={<DevPodProBadge width=\"9\" height=\"8\" />}\n        onClick={handleAnnouncementClicked}>\n        Try DevPod Pro\n      </Button>\n    )\n  }\n\n  return (\n    <>\n      <Popover isLazy isOpen={isDeleting ? true : undefined}>\n        <PopoverTrigger>\n          <Button\n            variant=\"outline\"\n            rightIcon={<ChevronDownIcon boxSize={6} />}\n            {...(isProUnauthenticated && {\n              leftIcon: <ExclamationTriangle boxSize={4} color=\"orange.300\" />,\n            })}>\n            DevPod Pro\n          </Button>\n        </PopoverTrigger>\n        <Portal>\n          <PopoverContent backgroundColor={backgroundColor} zIndex=\"popover\">\n            <PopoverArrow backgroundColor={backgroundColor} />\n            <ProPopoverContent\n              proInstances={proInstances}\n              onConnect={handleConnectClicked}\n              setIsDeleting={setIsDeleting}\n              onReLogin={(host) => handleReLoginClicked({ host })}\n              emptyProInstances={<EmptyProInstances onConnect={handleConnectClicked} />}\n            />\n          </PopoverContent>\n        </Portal>\n      </Popover>\n      {loginProModal}\n      {reLoginProModal}\n    </>\n  )\n}\n\ntype TProPopoverContentProps = Readonly<{\n  proInstances: TProInstances | undefined\n  emptyProInstances: ReactElement\n  setIsDeleting: Dispatch<SetStateAction<boolean>>\n  onConnect: VoidFunction\n  onReLogin: (host: string) => void\n}>\nfunction ProPopoverContent({\n  proInstances,\n  emptyProInstances,\n  setIsDeleting,\n  onConnect,\n  onReLogin,\n}: TProPopoverContentProps) {\n  const navigate = useNavigate()\n  const hoverBgColor = useColorModeValue(\"gray.100\", \"gray.700\")\n  const [[providers]] = useProviders()\n  const { newProInstances, legacyProInstances } = useMemo(() => {\n    return (\n      proInstances\n        ?.map((instance) => {\n          if (!instance.provider) {\n            return { ...instance, providerConfig: null }\n          }\n          const providerConfig = providers?.[instance.provider]?.config\n          if (!providerConfig) {\n            return { ...instance, providerConfig: null }\n          }\n\n          return { ...instance, providerConfig }\n        })\n        .reduce(\n          (acc, curr) => {\n            if (!curr.providerConfig) {\n              acc.legacyProInstances.push(curr)\n\n              return acc\n            }\n            if (!isNewProProvider(curr.providerConfig)) {\n              acc.legacyProInstances.push(curr)\n\n              return acc\n            }\n\n            acc.newProInstances.push(curr)\n\n            return acc\n          },\n          {\n            newProInstances: [] as TProInstanceWithProvider[],\n            legacyProInstances: [] as TProInstanceWithProvider[],\n          }\n        ) ?? {\n        newProInstances: [] as TProInstanceWithProvider[],\n        legacyProInstances: [] as TProInstanceWithProvider[],\n      }\n    )\n  }, [proInstances, providers])\n\n  return (\n    <>\n      <PopoverHeader>\n        <VStack align=\"start\" spacing=\"0\">\n          <Heading size=\"sm\" as=\"h3\">\n            Your Pro Instances\n          </Heading>\n          <Text fontSize=\"xs\">Manage DevPod Pro</Text>\n        </VStack>\n        <ButtonGroup variant=\"outline\">\n          <Tooltip label=\"Connect to Pro instance\">\n            <IconButton\n              aria-label=\"Connect to Pro Instace\"\n              onClick={onConnect}\n              icon={<Icon as={HiArrowRightOnRectangle} boxSize={5} />}\n            />\n          </Tooltip>\n        </ButtonGroup>\n      </PopoverHeader>\n      <PopoverBody>\n        <Box width=\"full\" overflowY=\"auto\" maxHeight=\"17rem\" height=\"full\" px=\"2\">\n          {proInstances === undefined || (proInstances.length === 0 && emptyProInstances)}\n          {legacyProInstances.map((proInstance) => {\n            const host = proInstance.host\n            if (!host) {\n              return null\n            }\n\n            return (\n              <ProInstanceRow\n                key={host}\n                {...proInstance}\n                host={host}\n                onIsDeletingChanged={setIsDeleting}\n                onLoginClicked={() => onReLogin(host)}\n              />\n            )\n          })}\n        </Box>\n\n        <List>\n          {newProInstances.map(({ host, authenticated }) => {\n            if (!host) {\n              return null\n            }\n\n            return (\n              <ListItem key={host}>\n                <Button\n                  _hover={{ bg: hoverBgColor }}\n                  variant=\"unstyled\"\n                  w=\"full\"\n                  px=\"4\"\n                  h=\"12\"\n                  onClick={() => navigate(Routes.toProInstance(host))}>\n                  <HStack w=\"full\" justify=\"space-between\">\n                    <Text maxW=\"50%\" overflow=\"hidden\" textOverflow=\"ellipsis\">\n                      {host}\n                    </Text>\n                    <HStack>\n                      {authenticated != null && (\n                        <Box\n                          boxSize=\"2\"\n                          bg={authenticated ? \"green.400\" : \"orange.400\"}\n                          rounded=\"full\"\n                        />\n                      )}\n                      <Text fontSize=\"xs\" fontWeight=\"normal\">\n                        {host}\n                      </Text>\n                      <CircleWithArrow boxSize={5} />\n                    </HStack>\n                  </HStack>\n                </Button>\n              </ListItem>\n            )\n          })}\n        </List>\n      </PopoverBody>\n    </>\n  )\n}\n\ntype TEmptyProInstancesProps = Readonly<{\n  onConnect: VoidFunction\n}>\nfunction EmptyProInstances({ onConnect }: TEmptyProInstancesProps) {\n  return (\n    <VStack align=\"start\" padding=\"2\" spacing=\"0\">\n      <Text fontWeight=\"bold\">No Pro instances</Text>\n      <Text lineHeight={\"1.2rem\"} fontSize=\"sm\" color=\"gray.500\">\n        You don&apos;t have any Pro instances set up. Connect to an existing Instance or create a\n        new one. <br />\n        <Link color=\"primary.600\" onClick={() => client.open(\"https://devpod.sh/pro\")}>\n          Learn more\n        </Link>\n      </Text>\n      <Button marginTop=\"4\" variant=\"primary\" onClick={onConnect}>\n        Login to Pro\n      </Button>\n    </VStack>\n  )\n}\n\ntype TProInstaceRowProps = Omit<TProInstance, \"host\"> &\n  Readonly<{\n    host: TProID\n    onIsDeletingChanged: (isDeleting: boolean) => void\n    onLoginClicked?: VoidFunction\n  }>\nfunction ProInstanceRow({\n  host,\n  creationTimestamp,\n  onIsDeletingChanged,\n  authenticated,\n  onLoginClicked,\n}: TProInstaceRowProps) {\n  const [, { disconnect }] = useProInstances()\n  const {\n    modal: deleteProviderModal,\n    open: openDeleteProviderModal,\n    isOpen,\n  } = useDeleteProviderModal(host, \"Pro instance\", \"disconnect\", () => disconnect.run({ id: host }))\n  useEffect(() => {\n    onIsDeletingChanged(isOpen)\n    // `onIsDeletingChanged` is expected to be a stable reference\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [isOpen])\n\n  return (\n    <>\n      <HStack width=\"full\" padding=\"2\" justifyContent=\"space-between\">\n        <VStack align=\"start\" spacing=\"0\" fontSize=\"sm\">\n          <HStack>\n            <Text fontWeight=\"bold\">{host}</Text>\n            {exists(authenticated) && (\n              <IconTag\n                variant=\"ghost\"\n                icon={\n                  authenticated ? (\n                    <CheckCircle color={\"green.300\"} />\n                  ) : (\n                    <ExclamationTriangle color=\"orange.300\" />\n                  )\n                }\n                label=\"\"\n                paddingInlineStart=\"0\"\n                info={authenticated ? \"Authenticated\" : \"Not Authenticated\"}\n                {...(authenticated ? {} : { onClick: onLoginClicked, cursor: \"pointer\" })}\n              />\n            )}\n          </HStack>\n          <HStack>\n            {exists(creationTimestamp) && (\n              <IconTag\n                paddingInlineStart=\"0\"\n                variant=\"ghost\"\n                icon={<Icon as={HiClock} />}\n                label={dayjs(new Date(creationTimestamp)).format(\"MMM D, YY\")}\n                info={`Created ${dayjs(new Date(creationTimestamp)).fromNow()}`}\n              />\n            )}\n          </HStack>\n        </VStack>\n\n        {exists(host) && (\n          <Tooltip label=\"Disconnect from Instance\">\n            <IconButton\n              variant=\"ghost\"\n              size=\"xs\"\n              aria-label=\"Disconnect from Instance\"\n              onClick={openDeleteProviderModal}\n              icon={<CloseIcon />}\n            />\n          </Tooltip>\n        )}\n      </HStack>\n\n      {deleteProviderModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/Sidebar.tsx",
    "content": "import { useSystemTheme } from \"@/lib\"\nimport {\n  Box,\n  BoxProps,\n  Flex,\n  Grid,\n  HStack,\n  Link,\n  Text,\n  useColorMode,\n  useColorModeValue,\n  useToken,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { cloneElement, ReactElement, ReactNode } from \"react\"\nimport { LinkProps, NavLink as RouterLink } from \"react-router-dom\"\nimport { useSettings } from \"../../contexts\"\nimport { DevpodWordmark } from \"../../icons\"\nimport { useBorderColor } from \"../../Theme\"\nimport { LoftOSSBadge } from \"../LoftOSSBadge\"\n\ntype TSidebarProps = Readonly<{ children?: readonly ReactElement[] }> & BoxProps\nexport function Sidebar({ children, ...boxProps }: TSidebarProps) {\n  const { colorMode } = useColorMode()\n  const systemTheme = useSystemTheme()\n  const borderColor = useBorderColor()\n  const backgroundColor = useColorModeValue(\"white\", \"black\")\n  const alternativeBackgroundColor = useColorModeValue(\"gray.100\", \"gray.900\")\n  const wordmarkColor = useColorModeValue(\"black\", \"white\")\n  const isLeft = useSettings().sidebarPosition === \"left\"\n  const { transparency } = useSettings()\n\n  const sharedBackgroundMaterialProps = {\n    \"aria-hidden\": true,\n    width: \"full\",\n    height: \"full\",\n    position: \"absolute\",\n    zIndex: -1,\n  } as const\n\n  return (\n    <Grid\n      as=\"aside\"\n      templateRows=\"4rem 1fr 6rem\"\n      width=\"full\"\n      height=\"100vh\"\n      borderRightColor={borderColor}\n      borderRightWidth=\"thin\"\n      position=\"relative\"\n      {...boxProps}>\n      <Flex\n        alignItems=\"start\"\n        flexFlow={isLeft ? \"row\" : \"row-reverse\"}\n        justify=\"flex-start\"\n        width=\"full\">\n        <Box width=\"8\" />\n        <DevpodWordmark marginTop={2} width={32} height={10} color={wordmarkColor} />\n      </Flex>\n      <VStack marginTop=\"8\" as=\"nav\" align=\"start\">\n        {children}\n      </VStack>\n      <HStack alignSelf=\"end\" paddingTop=\"4\" paddingLeft=\"8\" paddingBottom=\"4\">\n        <LoftOSSBadge />\n      </HStack>\n\n      {/* Background Material */}\n      {transparency ? (\n        <Box\n          {...sharedBackgroundMaterialProps}\n          backgroundColor={backgroundColor}\n          opacity={systemTheme === \"dark\" && colorMode !== \"dark\" ? 0.8 : 0.2}\n        />\n      ) : (\n        <Box {...sharedBackgroundMaterialProps} backgroundColor={alternativeBackgroundColor} />\n      )}\n    </Grid>\n  )\n}\n\ntype TSidebarMenuProps = Pick<LinkProps, \"to\"> &\n  Readonly<{ children?: ReactNode; icon: ReactElement }>\nexport function SidebarMenuItem({ to, children, icon: iconProps }: TSidebarMenuProps) {\n  const settings = useSettings()\n  const backgroundColorToken = useColorModeValue(\"gray.300\", \"gray.700\")\n  const backgroundColor = useToken(\"colors\", backgroundColorToken)\n  const borderColorToken = useColorModeValue(\"primary.600\", \"primary.600\")\n  const borderColor = useToken(\"colors\", borderColorToken)\n  const backgroundActiveColorToken = useColorModeValue(\"primary.500\", \"primary.700\")\n  const backgroundActiveColor = useToken(\"colors\", backgroundActiveColorToken)\n  const isLeft = settings.sidebarPosition === \"left\"\n  const icon = cloneElement(iconProps, { boxSize: 4 })\n\n  return (\n    <Box paddingX=\"4\" width=\"full\">\n      <Link\n        variant=\"ghost\"\n        display=\"flex\"\n        paddingX=\"4\"\n        paddingY=\"2\"\n        as={RouterLink}\n        to={to}\n        width=\"full\"\n        borderRadius=\"md\"\n        flexDirection=\"row\"\n        flexGrow=\"nowrap\"\n        alignItems=\"center\"\n        flexFlow={isLeft ? \"row\" : \"row-reverse\"}\n        justifyContent=\"flex-start\"\n        borderWidth=\"thin\"\n        borderColor=\"transparent\"\n        opacity={0.8}\n        fontSize=\"md\"\n        color=\"gray.900\"\n        _dark={{ color: \"gray.100\" }}\n        _hover={{ textDecoration: \"none\", backgroundColor }}\n        // @ts-ignore // this function is added by react-router-dom's `NavLink`\n        style={({ isActive }) => ({\n          ...(isActive\n            ? {\n                backgroundColor: backgroundActiveColor,\n                color: \"white\",\n                borderColor,\n                opacity: 1,\n              }\n            : {}),\n        })}>\n        {icon}\n        <Box width=\"2\" />\n        <Text>{children}</Text>\n      </Link>\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/StatusBar.tsx",
    "content": "import { CheckIcon, StarIcon } from \"@chakra-ui/icons\"\nimport {\n  BoxProps,\n  Button,\n  Checkbox,\n  HStack,\n  Icon,\n  IconButton,\n  Input,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalHeader,\n  ModalOverlay,\n  Text,\n  Tooltip,\n  useColorModeValue,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo, useRef } from \"react\"\nimport { FaBug } from \"react-icons/fa\"\nimport { HiDocumentMagnifyingGlass, HiMagnifyingGlassPlus } from \"react-icons/hi2\"\nimport { client } from \"../../client\"\nimport { useChangeSettings } from \"../../contexts\"\nimport { Debug, useArch, useDebug, usePlatform, useVersion } from \"../../lib\"\n\nexport function StatusBar(boxProps: BoxProps) {\n  return (\n    <HStack\n      justify=\"space-between\"\n      paddingX=\"6\"\n      fontSize=\"sm\"\n      zIndex=\"overlay\"\n      {...boxProps}\n      color=\"gray.600\"\n      _dark={{ color: \"gray.400\" }}\n    />\n  )\n}\n\nfunction Version() {\n  const version = useVersion()\n\n  return <Text>{version ?? \"unknown version\"}</Text>\n}\n\nfunction Platform() {\n  const platform = usePlatform()\n\n  return <Text>{platform ?? \"unknown platform\"}</Text>\n}\n\nfunction Arch() {\n  const arch = useArch()\n\n  return <Text>{arch ?? \"unknown arch\"}</Text>\n}\n\nfunction ZoomMenu() {\n  const { settings, set } = useChangeSettings()\n  const zoomIcon = useMemo(() => {\n    return { icon: <CheckIcon /> }\n  }, [])\n  const textColor = useColorModeValue(\"gray.900\", \"gray.300\")\n\n  return (\n    <Menu>\n      <MenuButton\n        as={IconButton}\n        variant=\"ghost\"\n        aria-label=\"zoom\"\n        rounded=\"full\"\n        icon={<Icon boxSize=\"5\" color=\"iconColor\" as={HiMagnifyingGlassPlus} />}\n      />\n      <MenuList color={textColor}>\n        <MenuItem onClick={() => set(\"zoom\", \"sm\")} {...(settings.zoom === \"sm\" ? zoomIcon : {})}>\n          Small\n        </MenuItem>\n        <MenuItem onClick={() => set(\"zoom\", \"md\")} {...(settings.zoom === \"md\" ? zoomIcon : {})}>\n          Regular\n        </MenuItem>\n        <MenuItem onClick={() => set(\"zoom\", \"lg\")} {...(settings.zoom === \"lg\" ? zoomIcon : {})}>\n          Large\n        </MenuItem>\n        <MenuItem onClick={() => set(\"zoom\", \"xl\")} {...(settings.zoom === \"xl\" ? zoomIcon : {})}>\n          Extra Large\n        </MenuItem>\n      </MenuList>\n    </Menu>\n  )\n}\n\nfunction GitHubStar() {\n  const iconColor = useStatusBarIconColor()\n\n  return (\n    <Tooltip label=\"Loving DevPod? Give us a star on Github\">\n      <IconButton\n        variant=\"ghost\"\n        rounded=\"full\"\n        icon={<StarIcon color={iconColor} />}\n        aria-label=\"Loving DevPod? Give us a star on Github\"\n        onClick={() => client.open(\"https://github.com/loft-sh/devpod\")}\n      />\n    </Tooltip>\n  )\n}\n\nfunction OSSDocs() {\n  const iconColor = useStatusBarIconColor()\n\n  return (\n    <Tooltip label=\"How to DevPod - Docs\">\n      <IconButton\n        variant=\"ghost\"\n        rounded=\"full\"\n        icon={<Icon as={HiDocumentMagnifyingGlass} color={iconColor} />}\n        aria-label=\"How to DevPod - Docs\"\n        onClick={() => client.open(\"https://devpod.sh/docs\")}\n      />\n    </Tooltip>\n  )\n}\n\nfunction OSSReportIssue() {\n  const iconColor = useStatusBarIconColor()\n\n  return (\n    <Tooltip label=\"Report an Issue\">\n      <IconButton\n        variant=\"ghost\"\n        rounded=\"full\"\n        icon={<Icon as={FaBug} color={iconColor} />}\n        aria-label=\"Report an Issue\"\n        onClick={() => client.open(\"https://github.com/loft-sh/devpod/issues/new/choose\")}\n      />\n    </Tooltip>\n  )\n}\n\nfunction DebugMenu() {\n  const inputRef = useRef<HTMLInputElement>(null)\n  const debug = useDebug()\n  const { isOpen, onClose, onOpen: openModal } = useDisclosure()\n\n  if (!debug.isEnabled) {\n    return null\n  }\n\n  const handleMenuItemClicked =\n    (option: Parameters<NonNullable<(typeof Debug)[\"toggle\"]>>[0]) => (e: React.MouseEvent) => {\n      Debug.toggle?.(option)\n      e.stopPropagation()\n    }\n\n  const handleImportLinkClicked = () => {\n    const rawLink = inputRef.current?.value\n    if (!rawLink) {\n      return\n    }\n    const url = new URL(rawLink.replace(/#/g, \"?\"))\n    const workspaceUID = url.searchParams.get(\"workspace-uid\")\n    const workspaceID = url.searchParams.get(\"workspace-id\")\n    const host = url.searchParams.get(\"devpod-pro-host\")\n    const project = url.searchParams.get(\"project\")\n    if (!workspaceUID || !workspaceID || !host || !project) {\n      console.error(\n        \"Some parameters are missing for import\",\n        url,\n        Array.from(url.searchParams.entries())\n      )\n\n      return\n    }\n    client.emitEvent({\n      type: \"ImportWorkspace\",\n      workspace_uid: workspaceUID,\n      workspace_id: workspaceID,\n      devpod_pro_host: host,\n      project,\n      options: {},\n    })\n    onClose()\n  }\n\n  return (\n    <>\n      <Menu>\n        <MenuButton>Debug</MenuButton>\n        <MenuList>\n          <MenuItem onClick={handleMenuItemClicked(\"commands\")}>\n            <Checkbox isChecked={debug.options.commands} />\n            <Text paddingLeft=\"4\">Print command logs</Text>\n          </MenuItem>\n          <MenuItem onClick={handleMenuItemClicked(\"actions\")}>\n            <Checkbox isChecked={debug.options.actions} />\n            <Text paddingLeft=\"4\">Print action logs</Text>\n          </MenuItem>\n          <MenuItem onClick={handleMenuItemClicked(\"workspaces\")}>\n            <Checkbox isChecked={debug.options.workspaces} />\n            <Text paddingLeft=\"4\">Print workspace logs</Text>\n          </MenuItem>\n          <MenuItem\n            onClick={(e) => {\n              client.openDir(\"AppData\")\n              e.stopPropagation()\n            }}>\n            <Text paddingLeft=\"4\">Open app_dir</Text>\n          </MenuItem>\n          <MenuItem\n            onClick={(e) => {\n              openModal()\n              e.stopPropagation()\n            }}>\n            <Text paddingLeft=\"4\">Open import tool</Text>\n          </MenuItem>\n        </MenuList>\n      </Menu>\n      <Modal isOpen={isOpen} onClose={onClose}>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalCloseButton />\n          <ModalHeader>Import workspace</ModalHeader>\n          <ModalBody pb=\"8\">\n            <Text mb=\"4\">Paste a platform import link here</Text>\n            <Input mb=\"4\" ref={inputRef} type=\"text\" />\n            <Button onClick={handleImportLinkClicked}>Import</Button>\n          </ModalBody>\n        </ModalContent>\n      </Modal>\n    </>\n  )\n}\n\nfunction useStatusBarIconColor() {\n  return useColorModeValue(\"iconColor\", \"gray.400\")\n}\n\nStatusBar.Version = Version\nStatusBar.Platform = Platform\nStatusBar.Arch = Arch\nStatusBar.ZoomMenu = ZoomMenu\nStatusBar.GitHubStar = GitHubStar\nStatusBar.OSSDocs = OSSDocs\nStatusBar.OSSReportIssue = OSSReportIssue\nStatusBar.DebugMenu = DebugMenu\n"
  },
  {
    "path": "desktop/src/components/Layout/Toolbar.tsx",
    "content": "import { Box, BoxProps } from \"@chakra-ui/react\"\nimport { ReactNode, useEffect, useId } from \"react\"\nimport { useBorderColor } from \"../../Theme\"\nimport { useToolbar } from \"../../contexts\"\n\nexport function Toolbar({ ...boxProps }: BoxProps) {\n  const borderColor = useBorderColor()\n\n  return <Box borderBottomColor={borderColor} borderBottomWidth=\"thin\" {...boxProps} />\n}\n\nfunction Title() {\n  const { title } = useToolbar()\n\n  return <>{title}</>\n}\n\nfunction Actions() {\n  const { actions } = useToolbar()\n\n  return <>{actions}</>\n}\n\nToolbar.Title = Title\nToolbar.Actions = Actions\n\nexport function ToolbarTitle({ children }: Readonly<{ children: ReactNode }>) {\n  const { setTitle } = useToolbar()\n\n  useEffect(() => {\n    setTitle(children)\n  }, [children, setTitle])\n\n  return null\n}\n\nexport function ToolbarActions({ children }: Readonly<{ children: ReactNode }>) {\n  const { addAction } = useToolbar()\n  const id = useId()\n\n  useEffect(() => {\n    const removeActions = addAction(id, children)\n\n    return removeActions\n  }, [children, addAction, id])\n\n  return null\n}\n"
  },
  {
    "path": "desktop/src/components/Layout/index.ts",
    "content": "export { NavigationViewLayout } from \"./NavigationViewLayout\"\nexport { Sidebar, SidebarMenuItem } from \"./Sidebar\"\nexport type { TViewTitle } from \"./types\"\nexport { Toolbar, ToolbarTitle, ToolbarActions } from \"./Toolbar\"\nexport { StatusBar } from \"./StatusBar\"\nexport { Notifications } from \"./Notifications\"\nexport { ProSwitcher } from \"./ProSwitcher\"\nexport { ProLayout } from \"./ProLayout\"\n"
  },
  {
    "path": "desktop/src/components/Layout/types.ts",
    "content": "import { ReactElement } from \"react\"\n\nexport type TViewTitle = Readonly<{\n  label: string\n  priority: \"high\" | \"regular\"\n  leadingAction?: ReactElement\n  trailingAction?: ReactElement\n}>\n"
  },
  {
    "path": "desktop/src/components/ListSelection/ListSelection.tsx",
    "content": "import { Pause, Trash } from \"@/icons\"\nimport { Button, Checkbox, FormLabel, HStack } from \"@chakra-ui/react\"\nimport { ThemeTypings } from \"@chakra-ui/styled-system\"\nimport { ReactElement, useMemo } from \"react\"\n\ntype TSelectionAction = {\n  label: string\n  icon?: ReactElement\n  perform?: () => unknown\n  style?: {\n    colorScheme?: ThemeTypings[\"colorSchemes\"]\n  }\n}\n\ntype TListSelectionProps = {\n  totalAmount: number\n  selectionAmount: number\n  handleSelectAllClicked?: () => void\n  selectionActions?: TSelectionAction[]\n}\n\nexport function ListSelection({\n  totalAmount,\n  selectionAmount,\n  handleSelectAllClicked,\n  selectionActions,\n}: TListSelectionProps) {\n  return (\n    <HStack>\n      <Checkbox\n        id=\"select-all\"\n        isIndeterminate={selectionAmount > 0 && selectionAmount < totalAmount}\n        isChecked={totalAmount > 0 && selectionAmount === totalAmount}\n        onChange={handleSelectAllClicked}\n      />\n      <FormLabel whiteSpace=\"nowrap\" paddingTop=\"2\" htmlFor=\"select-all\">\n        {selectionAmount === 0 ? \"Select all\" : ` ${selectionAmount} of ${totalAmount} selected`}\n      </FormLabel>\n      {selectionAmount > 0 && (\n        <>\n          {selectionActions?.map((action, index) => (\n            <Button\n              key={index}\n              variant={\"ghost\"}\n              colorScheme={action.style?.colorScheme}\n              leftIcon={action.icon}\n              onClick={action.perform}>\n              {action.label}\n            </Button>\n          ))}\n        </>\n      )}\n    </HStack>\n  )\n}\n\ntype TWorkspaceListSelectionProps = Omit<TListSelectionProps, \"selectionActions\"> & {\n  handleDeleteClicked?: () => void\n  handleStopAllClicked?: () => void\n}\n\nexport function WorkspaceListSelection({\n  handleDeleteClicked,\n  handleStopAllClicked,\n  ...props\n}: TWorkspaceListSelectionProps) {\n  const actions: TSelectionAction[] = useMemo(\n    () => [\n      {\n        label: \"Stop\",\n        icon: <Pause boxSize={4} />,\n        perform: handleStopAllClicked,\n      },\n      {\n        label: \"Delete\",\n        icon: <Trash boxSize={4} />,\n        perform: handleDeleteClicked,\n        style: {\n          colorScheme: \"red\",\n        },\n      },\n    ],\n    [handleStopAllClicked, handleDeleteClicked]\n  )\n\n  return <ListSelection {...props} selectionActions={actions} />\n}\n"
  },
  {
    "path": "desktop/src/components/ListSelection/index.ts",
    "content": "export * from \"./ListSelection\"\n"
  },
  {
    "path": "desktop/src/components/LoftOSSBadge.tsx",
    "content": "import { Link, Text } from \"@chakra-ui/react\"\nimport { client } from \"../client\"\nimport { Loft } from \"../icons\"\n\nexport function LoftOSSBadge() {\n  return (\n    <Link\n      display=\"flex\"\n      alignItems=\"center\"\n      justifyContent=\"start\"\n      onClick={() => client.open(\"https://loft.sh/\")}>\n      <Text fontSize=\"sm\" variant=\"muted\" marginRight=\"2\">\n        Open sourced by\n      </Text>\n      <Loft width=\"10\" height=\"6\" />\n    </Link>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Section/CollapsibleSection.tsx",
    "content": "import { Box, BoxProps, Button, ButtonProps, Icon, useDisclosure } from \"@chakra-ui/react\"\nimport { AnimatePresence, motion, Variants } from \"framer-motion\"\nimport { forwardRef, ReactNode, useLayoutEffect, useRef } from \"react\"\nimport { AiOutlineCaretRight } from \"react-icons/ai\"\n\nconst variants: Variants = {\n  enter: {\n    opacity: 1,\n    height: \"auto\",\n    overflow: \"revert\",\n    transition: {\n      opacity: { duration: 0.2 },\n      height: { duration: 0.3 },\n    },\n  },\n  exit: {\n    opacity: 0,\n    height: 0,\n    overflow: \"hidden\",\n    transition: {\n      opacity: { duration: 0.3 },\n      height: { duration: 0.2 },\n    },\n  },\n}\n\ntype TCollapsibleSectionProps = Readonly<{\n  title: ReactNode | ((isOpen: boolean) => ReactNode)\n  children: ReactNode\n  isOpen?: boolean\n  isDisabled?: boolean\n  showIcon?: boolean\n  headerProps?: ButtonProps\n  contentProps?: BoxProps\n  onOpenChange?: (isOpen: boolean, element: HTMLDivElement | null) => void\n}>\nexport const CollapsibleSection = forwardRef<HTMLDivElement, TCollapsibleSectionProps>(\n  function CollapsibleSection(\n    {\n      title,\n      headerProps,\n      contentProps,\n      children,\n      onOpenChange,\n      isOpen: isOpenProp = false,\n      isDisabled = false,\n      showIcon,\n    },\n    ref\n  ) {\n    const motionRef = useRef<HTMLDivElement>(null)\n    const { isOpen, onOpen, onClose, getDisclosureProps, getButtonProps } = useDisclosure()\n    const buttonProps = getButtonProps({ isDisabled })\n    const disclosureProps = getDisclosureProps()\n\n    useLayoutEffect(() => {\n      if (isOpenProp) {\n        onOpen()\n      } else {\n        onClose()\n      }\n    }, [isOpenProp, onClose, onOpen])\n\n    return (\n      <Box width=\"full\">\n        <Button ref={ref} variant=\"ghost\" width=\"full\" {...headerProps} {...buttonProps}>\n          <Box as=\"span\" flex=\"1\" textAlign=\"left\" display=\"flex\" alignItems=\"center\">\n            {showIcon && (\n              <Icon\n                marginRight=\"1\"\n                boxSize={3}\n                transition={\"transform .2s\"}\n                transform={isOpen ? \"rotate(90deg)\" : \"\"}\n                as={AiOutlineCaretRight}\n              />\n            )}\n            {typeof title === \"function\" ? title(isOpen) : title}\n          </Box>\n        </Button>\n        <AnimatePresence initial={false}>\n          {isOpen && (\n            <motion.div\n              ref={motionRef}\n              variants={variants}\n              initial=\"exit\"\n              animate=\"enter\"\n              exit=\"exit\"\n              onAnimationComplete={(definition) => {\n                if (definition === \"exit\") {\n                  onOpenChange?.(false, motionRef.current)\n                } else {\n                  onOpenChange?.(true, motionRef.current)\n                }\n              }}\n              style={{\n                display: \"block\",\n              }}>\n              <Box\n                {...disclosureProps}\n                marginTop={4}\n                paddingLeft={4}\n                width=\"full\"\n                {...contentProps}>\n                {children}\n              </Box>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </Box>\n    )\n  }\n)\n"
  },
  {
    "path": "desktop/src/components/Section/index.ts",
    "content": "export { CollapsibleSection } from \"./CollapsibleSection\"\n"
  },
  {
    "path": "desktop/src/components/Steps/Steps.tsx",
    "content": "import { Box, Button, HStack, useColorModeValue } from \"@chakra-ui/react\"\nimport {\n  createContext,\n  ReactNode,\n  useCallback,\n  useContext,\n  useEffect,\n  useId,\n  useMemo,\n  useState,\n} from \"react\"\n\ntype TStepContext = Readonly<{\n  addStep: (id: string, step: ReactNode) => void\n}>\ntype TStep = Readonly<{\n  id: string\n  node: ReactNode\n}>\n\nconst StepsContext = createContext<TStepContext>(null!)\ntype TStepsProps = Readonly<{ onFinish?: VoidFunction; finishText?: string; children: ReactNode }>\nexport function Steps({ onFinish, finishText, children }: TStepsProps) {\n  const [steps, setSteps] = useState<readonly TStep[]>([])\n  // Steps are 0 based for easier array indexing\n  const [currentStep, setCurrentStep] = useState(0)\n  const stepIndicatorInactiveColor = useColorModeValue(\"gray.200\", \"gray.700\")\n  const stepIndicatorActiveColor = useColorModeValue(\"primary.600\", \"primary.400\")\n\n  const isLastStep = useMemo(() => currentStep >= steps.length - 1, [currentStep, steps.length])\n  const isFirstStep = useMemo(() => currentStep <= 0, [currentStep])\n\n  const addStep = useCallback<TStepContext[\"addStep\"]>((id, node) => {\n    setSteps((steps) => {\n      const newSteps = steps.slice()\n      const index = newSteps.findIndex((a) => a.id === id)\n      if (index !== -1) {\n        newSteps.splice(index, 1, { id, node: node })\n      } else {\n        newSteps.push({ id, node: node })\n      }\n\n      return newSteps\n    })\n\n    return () => {\n      setSteps((steps) => steps.filter((a) => a.id !== id))\n    }\n  }, [])\n\n  const handleBackClicked = useCallback(() => {\n    if (isFirstStep) {\n      return\n    }\n\n    setCurrentStep((currentStep) => currentStep - 1)\n  }, [isFirstStep])\n\n  const handleNextClicked = useCallback(() => {\n    if (isLastStep) {\n      onFinish?.()\n\n      return\n    }\n\n    setCurrentStep((currentStep) => currentStep + 1)\n  }, [isLastStep, onFinish])\n\n  const value = useMemo(() => ({ addStep }), [addStep])\n\n  return (\n    <StepsContext.Provider value={value}>\n      <>\n        {children}\n\n        {steps[currentStep]?.node}\n\n        <HStack width=\"full\" justifyContent=\"space-between\">\n          <Button\n            variant=\"ghost\"\n            isDisabled={isFirstStep}\n            visibility={isFirstStep ? \"hidden\" : \"visible\"}\n            onClick={handleBackClicked}>\n            Back\n          </Button>\n          <HStack width=\"full\" justifyContent=\"center\" gap=\"2\">\n            {steps.map((_, i) => (\n              <Box\n                key={i}\n                width=\"3\"\n                height=\"3\"\n                borderRadius=\"full\"\n                marginInlineStart=\"0 !important\"\n                backgroundColor={\n                  i === currentStep ? stepIndicatorActiveColor : stepIndicatorInactiveColor\n                }\n              />\n            ))}\n          </HStack>\n          <Button variant={isLastStep ? \"primary\" : \"solid\"} onClick={handleNextClicked}>\n            {isLastStep ? (finishText !== undefined ? finishText : \"Done\") : \"Next\"}\n          </Button>\n        </HStack>\n      </>\n    </StepsContext.Provider>\n  )\n}\n\ntype TStepProps = Readonly<{ children: ReactNode }>\nexport function Step({ children }: TStepProps) {\n  const { addStep } = useContext(StepsContext)\n  const id = useId()\n\n  useEffect(() => {\n    const removeStep = addStep(id, children)\n\n    return removeStep\n  }, [children, addStep, id])\n\n  return null\n}\n"
  },
  {
    "path": "desktop/src/components/Steps/index.ts",
    "content": "export { Steps, Step } from \"./Steps\"\n"
  },
  {
    "path": "desktop/src/components/Tag/IconTag.tsx",
    "content": "import { ButtonProps, Tag, TagLabel, TagProps, Tooltip } from \"@chakra-ui/react\"\nimport { ReactElement, ReactNode, cloneElement } from \"react\"\n\ntype TIconTagProps = Readonly<{\n  icon: ReactElement\n  label: string\n  info?: ReactNode\n}> &\n  Pick<ButtonProps, \"onClick\"> &\n  TagProps\n\nexport function IconTag({ icon: iconProps, label, info, onClick, ...tagProps }: TIconTagProps) {\n  const icon = cloneElement(iconProps, { boxSize: 4 })\n\n  return (\n    <Tooltip label={info}>\n      <Tag\n        borderRadius=\"full\"\n        onClick={onClick}\n        role={onClick ? \"button\" : \"status\"}\n        cursor={onClick ? \"pointer\" : \"default\"}\n        {...tagProps}>\n        {icon}\n        <TagLabel marginLeft={2}>{label}</TagLabel>\n      </Tag>\n    </Tooltip>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Tag/index.ts",
    "content": "export { IconTag } from \"./IconTag\"\n"
  },
  {
    "path": "desktop/src/components/Terminal/Terminal.tsx",
    "content": "import { Box, useColorModeValue, useToken } from \"@chakra-ui/react\"\nimport { css } from \"@emotion/react\"\nimport React, {\n  forwardRef,\n  useEffect,\n  useImperativeHandle,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n} from \"react\"\nimport { ITerminalAddon, ITheme as IXTermTheme, Terminal as XTermTerminal } from \"@xterm/xterm\"\nimport { FitAddon } from \"@xterm/addon-fit\"\nimport { exists, remToPx } from \"@/lib\"\n\ntype TTerminalRef = Readonly<{\n  clear: VoidFunction\n  write: (data: string) => void\n  writeln: (data: string) => void\n  highlight: (\n    row: number,\n    col: number,\n    len: number,\n    color: string,\n    invertText: boolean\n  ) => (() => void) | undefined\n  getTerminal: () => XTermTerminal | null\n}>\ntype TTerminalProps = Readonly<{\n  fontSize: string\n  borderRadius?: string\n  onResize?: (cols: number, rows: number) => void\n}>\nexport type TTerminal = TTerminalRef\n\nexport const Terminal = forwardRef<TTerminalRef, TTerminalProps>(function T(\n  { fontSize, onResize, borderRadius },\n  ref\n) {\n  const containerRef = useRef<HTMLDivElement>(null)\n  const terminalRef = useRef<XTermTerminal | null>(null)\n  const termFitRef = useRef<FitAddon | null>(null)\n\n  const backgroundColorToken = useColorModeValue(\"gray.900\", \"background.darkest\")\n  const backgroundColor = useToken(\"colors\", backgroundColorToken)\n  const textColor = useToken(\"colors\", \"gray.100\")\n\n  const scrollBarThumbToken = useColorModeValue(\"gray.500\", \"gray.200\")\n  const scrollBarThumbColor = useToken(\"colors\", scrollBarThumbToken)\n\n  const selectionBackgroundToken = useColorModeValue(\"gray.600\", \"gray.600\")\n  const selectionBackgroundColor = useToken(\"colors\", selectionBackgroundToken)\n\n  const terminalTheme = useMemo<Partial<IXTermTheme>>(\n    () => ({\n      background: backgroundColor,\n      foreground: textColor,\n      selectionBackground: selectionBackgroundColor,\n    }),\n    [backgroundColor, selectionBackgroundColor, textColor]\n  )\n\n  useLayoutEffect(() => {\n    if (!exists(terminalRef.current)) {\n      const terminal = new XTermTerminal({\n        convertEol: true,\n        scrollback: 25_000,\n        theme: terminalTheme,\n        allowProposedApi: true,\n        cursorStyle: \"underline\",\n        disableStdin: true,\n        cursorBlink: false,\n        fontSize: remToPx(fontSize),\n      })\n      terminalRef.current = terminal\n\n      terminal.attachCustomKeyEventHandler(event => {\n        return !(event.type === \"keydown\" && event.key === \"c\" && event.ctrlKey);\n      });\n\n      const loadAddon = <T extends ITerminalAddon>(\n        AddonClass: new () => T,\n        ref: React.MutableRefObject<T | null>\n      ) => {\n        const addon = new AddonClass()\n        ref.current = addon\n        terminal.loadAddon(addon)\n\n        return addon\n      }\n\n      const termFit = loadAddon(FitAddon, termFitRef)\n\n      // Perform initial fit. Dimensions are only available after the terminal has been rendered once.\n      const disposable = terminal.onRender(() => {\n        if (termFit.proposeDimensions()) {\n          termFit.fit()\n          disposable.dispose()\n        }\n      })\n\n      terminal.open(containerRef.current!)\n\n      // Clean up aaaall the things :)\n      return () => {\n        disposable.dispose()\n\n        termFitRef.current?.dispose()\n        termFitRef.current = null\n\n        terminalRef.current?.dispose()\n        terminalRef.current = null\n      }\n    }\n\n    // Don't initialize more than once! Use imperative api to update terminal state\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [])\n\n  // Apply outer resize handler to the terminal here.\n  // Terminal should be guaranteed to be present by the time we get here.\n  useEffect(() => {\n    if (!onResize) {\n      return\n    }\n\n    const disposable = terminalRef.current?.onResize((event) => {\n      onResize(event.cols, event.rows)\n    })\n\n    return () => {\n      disposable?.dispose()\n    }\n  }, [onResize])\n\n  useEffect(() => {\n    const resizeHandler = () => {\n      try {\n        termFitRef.current?.fit()\n      } catch {\n        /* ignore */\n      }\n    }\n    window.addEventListener(\"resize\", resizeHandler, true)\n\n    return () => window.removeEventListener(\"resize\", resizeHandler, true)\n  }, [])\n\n  useEffect(() => {\n    let maybeTheme = terminalRef.current?.options.theme\n    if (exists(maybeTheme)) {\n      maybeTheme = terminalTheme\n    }\n  }, [terminalTheme])\n\n  useEffect(() => {\n    let maybeFontSize = terminalRef.current?.options.fontSize\n    if (exists(maybeFontSize)) {\n      maybeFontSize = remToPx(fontSize)\n    }\n  }, [fontSize])\n\n  useImperativeHandle(\n    ref,\n    () => {\n      return {\n        clear() {\n          terminalRef.current?.clear()\n        },\n        write(data) {\n          terminalRef.current?.write(data)\n          termFitRef.current?.fit()\n        },\n        writeln(data) {\n          terminalRef.current?.writeln(data)\n          termFitRef.current?.fit()\n        },\n        highlight(row: number, startCol: number, len: number, color: string, invertText: boolean) {\n          const terminal = terminalRef.current\n\n          if (!terminal) {\n            return undefined\n          }\n\n          const rowRelative = -terminal.buffer.active.baseY - terminal.buffer.active.cursorY + row\n\n          const marker = terminal.registerMarker(rowRelative)\n          const decoration = terminal.registerDecoration({\n            marker,\n            x: startCol,\n            width: len,\n            backgroundColor: color,\n            foregroundColor: invertText ? \"#000000\" : \"#FFFFFF\",\n            layer: \"top\",\n            overviewRulerOptions: {\n              color: color,\n            },\n          })\n\n          return () => {\n            marker.dispose()\n            decoration?.dispose()\n          }\n        },\n        getTerminal() {\n          return terminalRef.current\n        },\n      }\n    },\n    [terminalRef]\n  )\n\n  return (\n    <Box width=\"full\" height=\"full\">\n      <Box\n        height=\"full\"\n        as=\"div\"\n        backgroundColor={terminalTheme.background}\n        borderRadius={borderRadius ?? \"md\"}\n        borderWidth={6}\n        boxSizing=\"content-box\" // needs to be set to accommodate for the way xterm measures it's container\n        borderColor={terminalTheme.background}\n        ref={containerRef}\n        css={css`\n          .xterm-viewport {\n            &::-webkit-scrollbar-button {\n              display: none;\n              height: 13px;\n              border-radius: 0px;\n              background-color: transparent;\n            }\n            &::-webkit-scrollbar-button:hover {\n              background-color: transparent;\n            }\n            &::-webkit-scrollbar-thumb {\n              border-radius: 4px;\n              background-color: ${scrollBarThumbColor};\n            }\n            &::-webkit-scrollbar-track {\n              background-color: transparent;\n            }\n            &::-webkit-scrollbar-track:hover {\n              background-color: transparent;\n            }\n            &::-webkit-scrollbar {\n              width: 6px;\n            }\n          }\n        `}\n      />\n    </Box>\n  )\n})\n"
  },
  {
    "path": "desktop/src/components/Terminal/TerminalSearchBar.tsx",
    "content": "import {\n  Box,\n  HStack,\n  IconButton,\n  Input,\n  InputGroup,\n  InputLeftElement,\n  InputRightElement,\n  Tooltip,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ArrowDown, ArrowUp, MatchCase, Search, WholeWord } from \"@/icons\"\nimport { ReactElement, useEffect, useRef, useState } from \"react\"\nimport { TSearchOptions } from \"@/components/Terminal/useTerminalSearch\"\n\ntype TTerminalSearchBarProps = {\n  prevSearchResult: VoidFunction\n  nextSearchResult: VoidFunction\n  totalSearchResults: number\n  activeSearchResult: number\n  onUpdateSearchOptions: (searchOptions: TSearchOptions) => void\n  paddingX?: number\n  paddingY?: number\n}\n\nexport function TerminalSearchBar({\n  prevSearchResult,\n  nextSearchResult,\n  totalSearchResults,\n  activeSearchResult,\n  onUpdateSearchOptions,\n  paddingY,\n  paddingX,\n}: TTerminalSearchBarProps) {\n  const bgColor = useColorModeValue(\"white\", \"gray.800\")\n  const [searchString, setSearchString] = useState<string | undefined>(undefined)\n  const [debouncedSearchString, setDebouncedSearchString] = useState<string | undefined>(undefined)\n  const [caseSensitive, setCaseSensitive] = useState<boolean>(false)\n  const [wholeWordSearch, setWholeWordSearch] = useState<boolean>(false)\n\n  const searchInputRef = useRef<HTMLInputElement | null>(null)\n\n  // Debounce to prevent stutter when having a huge amount of results.\n  useEffect(() => {\n    // Sneaky heuristic:\n    // If we have more than two characters, we're likely to have a more sane amount of results, so we can skip debouncing.\n    const len = searchString?.length ?? 0\n    if (len > 2) {\n      setDebouncedSearchString(searchString)\n\n      return\n    }\n\n    const timeout = setTimeout(() => {\n      setDebouncedSearchString(searchString)\n    }, 200)\n\n    return () => clearTimeout(timeout)\n  }, [searchString])\n\n  // Pass on the search options to the outside world. We do it like this so the debouncing works nicely.\n  useEffect(() => {\n    onUpdateSearchOptions({ searchString: debouncedSearchString, caseSensitive, wholeWordSearch })\n  }, [debouncedSearchString, wholeWordSearch, caseSensitive, onUpdateSearchOptions])\n\n  return (\n    <HStack w={\"full\"} alignItems={\"center\"} paddingX={paddingX} paddingY={paddingY}>\n      <InputGroup>\n        <InputLeftElement cursor={\"text\"} onClick={() => searchInputRef.current?.focus()}>\n          <Search boxSize={5} color={\"text.tertiary\"} />\n        </InputLeftElement>\n        <Input\n          ref={searchInputRef}\n          value={searchString ?? \"\"}\n          placeholder={\"Search...\"}\n          spellCheck={false}\n          bg={bgColor}\n          onKeyDown={(e) => {\n            if (e.key === \"Enter\") {\n              if (e.shiftKey) {\n                prevSearchResult()\n              } else {\n                nextSearchResult()\n              }\n            }\n          }}\n          onChange={(e) => {\n            setSearchString(e.target.value ? e.target.value : undefined)\n          }}\n        />\n        <InputRightElement w={\"fit-content\"} paddingX={\"4\"}>\n          <HStack alignItems={\"center\"} w={\"fit-content\"}>\n            <ToggleButton\n              label={\"Case sensitive\"}\n              icon={<MatchCase boxSize={5} />}\n              value={caseSensitive}\n              setValue={setCaseSensitive}\n            />\n            <ToggleButton\n              label={\"Whole word\"}\n              icon={<WholeWord boxSize={5} />}\n              value={wholeWordSearch}\n              setValue={setWholeWordSearch}\n            />\n          </HStack>\n        </InputRightElement>\n      </InputGroup>\n\n      <Box\n        flexShrink={0}\n        minWidth={16}\n        flexDirection={\"row\"}\n        display={\"flex\"}\n        justifyContent={\"center\"}>\n        {totalSearchResults > 0 ? (\n          <Box marginLeft={2} marginRight={\"1\"} color={\"text.tertiary\"}>\n            {activeSearchResult + 1} of {totalSearchResults}\n          </Box>\n        ) : searchString ? (\n          <Box marginLeft={2} marginRight={\"1\"} color={\"text.tertiary\"}>\n            0 of 0\n          </Box>\n        ) : (\n          <></>\n        )}\n      </Box>\n\n      <Tooltip label={\"Previous search result\"}>\n        <IconButton\n          variant={\"ghost\"}\n          onClick={prevSearchResult}\n          aria-label={\"Previous search result\"}\n          disabled={!totalSearchResults}\n          icon={<ArrowUp boxSize={5} />}\n        />\n      </Tooltip>\n\n      <Tooltip label={\"Next search result\"}>\n        <IconButton\n          variant={\"ghost\"}\n          onClick={nextSearchResult}\n          aria-label={\"Next search result\"}\n          disabled={!totalSearchResults}\n          icon={<ArrowDown boxSize={5} />}\n        />\n      </Tooltip>\n    </HStack>\n  )\n}\n\nfunction ToggleButton({\n  label,\n  icon,\n  value,\n  setValue,\n}: {\n  label: string\n  icon: ReactElement | undefined\n  value: boolean\n  setValue: (value: boolean) => void\n}) {\n  const hoverBgColor = useColorModeValue(\"gray.100\", \"gray.700\")\n\n  return (\n    <Tooltip label={label}>\n      <IconButton\n        borderRadius={\"100%\"}\n        variant={\"ghost\"}\n        color={value ? \"white\" : undefined}\n        backgroundColor={value ? \"primary.400\" : undefined}\n        _hover={{\n          bg: value ? \"primary.600\" : hoverBgColor,\n        }}\n        aria-label={label}\n        fontFamily={\"mono\"}\n        icon={icon}\n        onClick={() => setValue(!value)}\n      />\n    </Tooltip>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Terminal/index.ts",
    "content": "export * from \"./Terminal\"\nexport * from \"./useStreamingTerminal\"\nexport * from \"./TerminalSearchBar\"\n"
  },
  {
    "path": "desktop/src/components/Terminal/useStreamingTerminal.tsx",
    "content": "import dayjs from \"dayjs\"\nimport { Theme, useToken } from \"@chakra-ui/react\"\nimport React, { useCallback, useMemo, useRef } from \"react\"\nimport { TStreamEventListenerFn } from \"@/client\"\nimport { TLogOutput } from \"@/types\"\nimport { Terminal, TTerminal } from \"./Terminal\"\nimport { TSearchOptions, useTerminalSearch } from \"@/components/Terminal/useTerminalSearch\"\n\nexport function useStreamingTerminal({\n  fontSize,\n  borderRadius,\n  searchOptions,\n}:\n  | {\n      fontSize?: keyof Theme[\"fontSizes\"]\n      borderRadius?: keyof Theme[\"radii\"]\n      searchOptions?: TSearchOptions\n    }\n  | undefined = {}) {\n  const terminalRef = useRef<TTerminal | null>(null)\n\n  const {\n    internals: { searchStateRef, debounceSearchResults, resetSearch, onResize },\n    searchApi,\n  } = useTerminalSearch(terminalRef, searchOptions)\n\n  const fontSizeToken = useToken(\n    \"fontSizes\",\n    useMemo(() => fontSize ?? \"md\", [fontSize])\n  )\n\n  const borderRadiusToken = useToken(\n    \"radii\",\n    useMemo(() => borderRadius ?? \"md\", [borderRadius])\n  )\n\n  const terminal = useMemo(\n    () => (\n      <Terminal\n        ref={terminalRef}\n        fontSize={fontSizeToken}\n        borderRadius={borderRadiusToken}\n        onResize={onResize}\n      />\n    ),\n    [fontSizeToken, onResize, borderRadiusToken]\n  )\n\n  const connectStream = useCallback<TStreamEventListenerFn>(\n    (event) => {\n      switch (event.type) {\n        case \"data\": {\n          if (event.data.message === undefined) {\n            return\n          }\n\n          const formattedLine = formatLine(event.data)\n          terminalRef.current?.writeln(formattedLine.ansi)\n\n          searchStateRef.current.preWrappedLines = undefined\n          searchStateRef.current.searchableLines.push(...processInputLine(formattedLine.plain))\n\n          debounceSearchResults(searchStateRef.current.searchOptions)\n\n          break\n        }\n        case \"error\": {\n          if (event.error.message === undefined) {\n            return\n          }\n\n          const formattedLine = formatLine(event.error)\n          terminalRef.current?.writeln(formattedLine.ansi)\n\n          searchStateRef.current.preWrappedLines = undefined\n          searchStateRef.current.searchableLines.push(...processInputLine(formattedLine.plain))\n\n          debounceSearchResults(searchStateRef.current.searchOptions)\n\n          break\n        }\n      }\n    },\n    [terminalRef, searchStateRef, debounceSearchResults]\n  )\n\n  const clear = useCallback(() => {\n    resetSearch()\n    terminalRef.current?.clear()\n  }, [terminalRef, resetSearch])\n\n  return {\n    terminal,\n    connectStream,\n    clear,\n    search: searchApi,\n  }\n}\n\nfunction processInputLine(line: string) {\n  // Default tabStopWidth is 8.\n  const withoutTabs = line.replaceAll(/\\t/g, \" \".repeat(8))\n\n  const subLines = withoutTabs.split(/\\r\\n|\\n/)\n\n  return subLines.map((sl) => {\n    const splitByCR = sl.split(\"\\r\")\n\n    return splitByCR[splitByCR.length - 1]!\n  })\n}\n\nconst ANSI_COLOR = {\n  Reset: \"0\",\n  White: \"97\",\n  BrightCyan: \"96\",\n  BrightMagenta: \"95\",\n  BrightBlue: \"94\",\n  BrightYellow: \"93\",\n  BrightGreen: \"92\",\n  BrightRed: \"91\",\n  BrightBlack: \"90\",\n\n  DarkWhite: \"37\",\n  DarkCyan: \"36\",\n  DarkMagenta: \"35\",\n  DarkBlue: \"34\",\n  DarkYellow: \"33\",\n  DarkGreen: \"32\",\n  DarkRed: \"31\",\n  Black: \"30\",\n}\nconst ANSI_TEXT = {\n  Bold: \"1\",\n  Underline: \"4\",\n  NoUnderline: \"24\",\n  Reverse: \"7\",\n  NoReverse: \"27\",\n}\n\nconst LOG_COLORS = {\n  panic: ANSI_COLOR.DarkMagenta,\n  fatal: ANSI_COLOR.DarkRed,\n  error: ANSI_COLOR.BrightRed,\n  warn: ANSI_COLOR.DarkYellow,\n  info: ANSI_COLOR.BrightBlue,\n  debug: ANSI_COLOR.BrightGreen,\n}\n\nfunction formatLine({ level, message, time }: TLogOutput) {\n  let levelColor = ANSI_COLOR.White\n  if (level in LOG_COLORS) {\n    levelColor = LOG_COLORS[level as keyof typeof LOG_COLORS]\n  }\n\n  const formattedTime = dayjs(time).format(\"HH:mm:ss\")\n\n  const date = `\\x1b[${ANSI_COLOR.DarkWhite}m[${formattedTime}]`\n  const prefix = `\\x1b[${ANSI_TEXT.Bold};${levelColor}m${level}`\n  const data = `\\x1b[${ANSI_COLOR.Reset}m${message}`\n\n  return { ansi: `${date} ${prefix} ${data}`, plain: `[${formattedTime}] ${level} ${message}` }\n}\n"
  },
  {
    "path": "desktop/src/components/Terminal/useTerminalSearch.tsx",
    "content": "import React, { useCallback, useEffect, useRef, useState } from \"react\"\nimport { TTerminal } from \"@/components\"\n\nexport type TSearchOptions = {\n  searchString?: string\n  caseSensitive?: boolean\n  wholeWordSearch?: boolean\n}\n\ntype TSearchResult = [row: number, col: number, len: number]\n\ntype TDisplayLine = {\n  index: number\n  text: string\n  inputLine: number\n  startCol: number\n  endCol: number\n}\n\ntype THighlight = {\n  displayRow: number\n\n  // Bounds of the highlight within a row.\n  startCol: number\n  endCol: number\n\n  // Which search result this highlight is attached to.\n  resultIndex: number\n}\n\ntype TDisplayLineMap = { [key: number]: TDisplayLine[] }\n\n// Used for keeping track of anchors/jump points in the wrapped lines to jump to for any given search result.\ntype TJumpMap = { [resultIndex: number]: number }\n\ntype TSearchState = {\n  searchableLines: string[]\n  disposables: VoidFunction[]\n  searchOptions: TSearchOptions | undefined\n  jumpMap: TJumpMap\n  debounce: number | undefined\n  activeSearchResult: number\n  preWrappedLines: TDisplayLineMap | undefined\n  searchResults: TSearchResult[]\n  highlights: THighlight[]\n}\n\nexport function useTerminalSearch(\n  terminalRef: React.MutableRefObject<TTerminal | null>,\n  searchOptions?: TSearchOptions\n) {\n  const [totalSearchResults, setTotalSearchResults] = useState<number>(-1)\n  const [activeSearchResult, setActiveSearchResult] = useState<number>(0)\n\n  // We have to exercise caution not to re-generate connectStream,\n  // so we have to store a lot of state outside the usual mechanisms.\n  // Otherwise, we will make the terminal flicker.\n\n  const searchStateRef = useRef<TSearchState>({\n    searchableLines: [],\n    disposables: [],\n    searchOptions,\n    jumpMap: {},\n    debounce: undefined,\n    activeSearchResult: 0,\n    preWrappedLines: undefined,\n    searchResults: [],\n    highlights: [],\n  })\n\n  const clearDisposables = useCallback(() => {\n    const toClear = searchStateRef.current.disposables\n    toClear.forEach((disposable) => disposable())\n    searchStateRef.current.disposables = []\n  }, [searchStateRef])\n\n  const repaintHighlights = useCallback(\n    (highlights: THighlight[]) => {\n      const terminal = terminalRef.current\n      const displayLines = searchStateRef.current.preWrappedLines\n      const searchResults = searchStateRef.current.searchResults\n\n      if (!displayLines || !terminal || !searchResults.length) {\n        return\n      }\n\n      searchStateRef.current.highlights = highlights\n\n      for (const highlight of highlights) {\n        const isActive = highlight.resultIndex === searchStateRef.current.activeSearchResult\n\n        const disposable = terminal.highlight(\n          highlight.displayRow,\n          highlight.startCol,\n          highlight.endCol - highlight.startCol,\n          isActive ? \"#E4ADFF\" : \"#8E00EB\",\n          isActive\n        )\n\n        if (disposable) {\n          searchStateRef.current.disposables.push(disposable)\n        }\n      }\n    },\n    [searchStateRef, terminalRef]\n  )\n\n  // When the terminal is resized, we need to re-calculate the highlights and jump anchors,\n  // as these have to be positioned per wrapped line.\n  const onResize = useCallback(\n    (cols: number) => {\n      const displayLines = wrapLines(searchStateRef.current.searchableLines, cols)\n      searchStateRef.current.preWrappedLines = displayLines\n\n      const [highlights, jumpMap] = generateHighlights(\n        searchStateRef.current.searchResults,\n        displayLines\n      )\n\n      searchStateRef.current.jumpMap = jumpMap\n\n      clearDisposables()\n      repaintHighlights(highlights)\n    },\n    [repaintHighlights, clearDisposables]\n  )\n\n  // Currently we kind of have to split the state for the active search result to allow re-rendering\n  // but also to prevent a change of the connectStream function, so this is a setter that handles both ends.\n  const changeActiveSearchResult = useCallback(\n    (result: number, repaint?: boolean) => {\n      searchStateRef.current.activeSearchResult = result\n      setActiveSearchResult(result)\n      if (repaint) {\n        clearDisposables()\n        repaintHighlights(searchStateRef.current.highlights)\n      }\n    },\n    [searchStateRef, repaintHighlights, clearDisposables, setActiveSearchResult]\n  )\n\n  const jumpToResult = useCallback(\n    (resultIndex: number, repaint?: boolean) => {\n      changeActiveSearchResult(resultIndex, repaint)\n      const jumpIndex = searchStateRef.current.jumpMap[resultIndex]\n      if (jumpIndex != null) {\n        terminalRef.current?.getTerminal()?.scrollToLine(jumpIndex)\n      }\n    },\n    [terminalRef, searchStateRef, changeActiveSearchResult]\n  )\n\n  const jumpNext = useCallback(() => {\n    if (totalSearchResults <= 1) {\n      return\n    }\n\n    const nextIndex = wrapNumber(searchStateRef.current.activeSearchResult + 1, totalSearchResults)\n    jumpToResult(nextIndex, true)\n  }, [totalSearchResults, jumpToResult, searchStateRef])\n\n  const jumpPrev = useCallback(() => {\n    if (totalSearchResults <= 1) {\n      return\n    }\n\n    const prevIndex = wrapNumber(searchStateRef.current.activeSearchResult - 1, totalSearchResults)\n\n    jumpToResult(prevIndex, true)\n  }, [totalSearchResults, jumpToResult, searchStateRef])\n\n  const performSearch = useCallback(\n    (opts: TSearchOptions | undefined, jump?: boolean) => {\n      clearDisposables()\n\n      const terminal = terminalRef.current\n      const inputLines = searchStateRef.current.searchableLines\n\n      if (!terminal || !opts?.searchString || !inputLines.length) {\n        setTotalSearchResults(-1)\n        searchStateRef.current.highlights = []\n        searchStateRef.current.searchResults = []\n\n        return\n      }\n\n      const results = (searchStateRef.current.searchResults = search(inputLines, opts))\n      setTotalSearchResults(results.length)\n\n      if (!results.length) {\n        searchStateRef.current.highlights = []\n        searchStateRef.current.searchResults = []\n\n        return\n      }\n\n      // We need to calculate wrapped lines:\n      // xterm internally treats lines that get wrapped as seperate lines & uses these for navigation.\n      // Did not find a reasonable way to extract these from xterm, so we do it ourselves.\n      let displayLines = searchStateRef.current.preWrappedLines\n\n      // Optimization: Don't calculate the wrapping if we've done it before for the current set of lines.\n      // Requires the consumer of this API to properly reset the preWrappedLines when it feeds in new lines.\n      if (!displayLines) {\n        searchStateRef.current.preWrappedLines = displayLines = wrapLines(\n          inputLines,\n          terminal.getTerminal()?.cols ?? 0\n        )\n      }\n\n      searchStateRef.current.preWrappedLines = displayLines\n\n      const [highlights, jumpMap] = generateHighlights(results, displayLines)\n\n      searchStateRef.current.jumpMap = jumpMap\n\n      if (jump) {\n        jumpToResult(0)\n      }\n\n      repaintHighlights(highlights)\n    },\n    [searchStateRef, terminalRef, jumpToResult, clearDisposables, repaintHighlights]\n  )\n\n  // This is used for a search while the terminal still gets new input.\n  // Since it is likely that there are going to be many new lines within a short timeframe,\n  // we debounce the search on new input so we don't calculate results uselessly.\n  const debounceSearchResults = useCallback(\n    (opts: TSearchOptions | undefined) => {\n      if (searchStateRef.current.debounce != null) {\n        clearTimeout(searchStateRef.current.debounce)\n      }\n\n      const timeout = setTimeout(() => {\n        if (searchStateRef.current.debounce === timeout) {\n          searchStateRef.current.debounce = undefined\n        }\n        performSearch(opts)\n      }, 100) as unknown as number\n\n      searchStateRef.current.debounce = timeout\n    },\n    [performSearch, searchStateRef]\n  )\n\n  const resetSearch = useCallback(() => {\n    // Remove all dangling highlights.\n    clearDisposables()\n\n    // Reset internal search state.\n    searchStateRef.current = {\n      // We keep the current search options because these are synced from the outside.\n      searchOptions: searchStateRef.current.searchOptions,\n      searchableLines: [],\n      disposables: [],\n      jumpMap: {},\n      debounce: undefined,\n      activeSearchResult: 0,\n      preWrappedLines: undefined,\n      searchResults: [],\n      highlights: [],\n    }\n\n    // Reset externally available state.\n    changeActiveSearchResult(0)\n    setTotalSearchResults(-1)\n  }, [setTotalSearchResults, changeActiveSearchResult, searchStateRef, clearDisposables])\n\n  // Synchronize the search options with the consuming components and re-trigger the search when they change.\n  useEffect(() => {\n    searchStateRef.current.searchOptions = searchOptions\n\n    performSearch(searchOptions, true)\n  }, [searchOptions, performSearch])\n\n  return {\n    internals: {\n      searchStateRef,\n      debounceSearchResults,\n      resetSearch,\n      onResize,\n    },\n    searchApi: {\n      nextSearchResult: jumpNext,\n      prevSearchResult: jumpPrev,\n      totalSearchResults,\n      activeSearchResult,\n    },\n  }\n}\n\nfunction search(inputLines: string[], opts: TSearchOptions) {\n  let pattern = escapeRegex(opts.searchString!)\n\n  if (opts.wholeWordSearch) {\n    pattern = `\\\\b${pattern}\\\\b`\n  }\n\n  return inputLines.reduce((accum, line, index) => {\n    const regex = new RegExp(pattern, opts.caseSensitive ? \"g\" : \"ig\")\n\n    let match\n\n    while ((match = regex.exec(line)) && match[0]) {\n      accum.push([index, match.index, match[0].length])\n    }\n\n    return accum\n  }, [] as TSearchResult[])\n}\n\n/**\n * Generates one or more highlight specification per search result.\n * One search result can produce multiple highlights as they can get wrapped and we have to instantiate\n * decorations per wrapped line.\n */\nfunction generateHighlights(\n  results: TSearchResult[],\n  displayLinesMap: TDisplayLineMap\n): [THighlight[], TJumpMap] {\n  const highlights: THighlight[] = []\n  const jumpMap: TJumpMap = {}\n\n  results.forEach((result, resultIndex) => {\n    const [inputLine, start, length] = result\n    const end = start + length\n    const displayLines = displayLinesMap[inputLine]!\n\n    displayLines.forEach((displayLine) => {\n      const overlapStart = Math.max(start, displayLine.startCol)\n      const overlapEnd = Math.min(end, displayLine.endCol)\n\n      if (overlapStart < overlapEnd) {\n        if (jumpMap[resultIndex] == null) {\n          jumpMap[resultIndex] = displayLine.index\n        }\n\n        highlights.push({\n          displayRow: displayLine.index,\n          startCol: overlapStart - displayLine.startCol,\n          endCol: overlapEnd - displayLine.startCol,\n          resultIndex,\n        })\n      }\n    })\n  })\n\n  return [highlights, jumpMap]\n}\n\n/**\n * Emulates the wrapping of lines by max columns as it is done in the terminal.\n */\nfunction wrapLines(inputLines: string[], cols: number) {\n  const result: TDisplayLineMap = {}\n\n  let count = 0\n\n  for (let inputLineIndex = 0; inputLineIndex < inputLines.length; inputLineIndex++) {\n    const line = inputLines[inputLineIndex]!\n\n    let startCharIndex = 0\n\n    const displayLines: TDisplayLine[] = []\n\n    // Special case: There may be lines with 0 length.\n    // While no displayLine is required for this, we still need to increment the counter.\n    if (line.length === 0) {\n      count++\n    } else {\n      while (startCharIndex < line.length) {\n        const endCharIndex = Math.min(startCharIndex + cols, line.length)\n        const text = line.substring(startCharIndex, endCharIndex)\n\n        displayLines.push({\n          index: count++,\n          text: text,\n          inputLine: inputLineIndex,\n          startCol: startCharIndex,\n          endCol: endCharIndex,\n        })\n\n        startCharIndex = endCharIndex\n      }\n    }\n\n    result[inputLineIndex] = displayLines\n  }\n\n  return result\n}\n\n/**\n * Wraps around numbers in the bounds [0-max].\n */\nfunction wrapNumber(num: number, max: number) {\n  return ((num % max) + max) % max\n}\n\n/**\n * Escapes anything that could be interpreted as regex syntax when parsing the string as a regex.\n */\nfunction escapeRegex(str: string) {\n  return str.replace(/[/\\-\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\")\n}\n"
  },
  {
    "path": "desktop/src/components/Warning/WarningMessageBox.tsx",
    "content": "import { Box, Text, useColorModeValue } from \"@chakra-ui/react\"\nimport React from \"react\"\n\nconst SIZES = {\n  sm: {\n    fontSize: \"sm\",\n  },\n  md: {\n    fontSize: \"md\",\n  },\n}\nconst VARIANTS = {\n  solid: {\n    color: { light: \"orange.700\", dark: \"orange.800\" },\n  },\n  ghost: {\n    color: { light: \"orange.400\", dark: \"orange.300\" },\n  },\n}\ntype TWarningMessageBoxProps = Readonly<{\n  warning: React.ReactNode\n  size?: keyof typeof SIZES\n  variant?: \"solid\" | \"ghost\"\n}>\nexport function WarningMessageBox({\n  warning,\n  size = \"md\",\n  variant = \"solid\",\n}: TWarningMessageBoxProps) {\n  const { color } = VARIANTS[variant]\n  const backgroundColor = useColorModeValue(\"orange.100\", \"orange.200\")\n  const textColor = useColorModeValue(color.light, color.dark)\n  const { fontSize } = SIZES[size]\n\n  return (\n    <Box\n      {...(variant === \"solid\"\n        ? {\n            backgroundColor,\n            marginTop: \"4\",\n            padding: \"4\",\n            borderRadius: \"md\",\n          }\n        : {})}\n      userSelect=\"text\"\n      display=\"inline-block\">\n      <Text color={textColor} fontSize={fontSize}>\n        {warning}\n      </Text>\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/Warning/index.ts",
    "content": "export { WarningMessageBox } from \"./WarningMessageBox\"\n"
  },
  {
    "path": "desktop/src/components/WorkspaceOwnerFilter/WorkspaceOwnerFilter.tsx",
    "content": "import { ChevronDownIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  Menu,\n  MenuButton,\n  MenuItemOption,\n  MenuList,\n  MenuOptionGroup,\n} from \"@chakra-ui/react\"\nimport { useCallback } from \"react\"\n\nexport type TWorkspaceOwnerFilterState = \"self\" | \"all\"\n\nexport function WorkspaceOwnerFilter({\n  ownerFilter,\n  setOwnerFilter,\n}: {\n  ownerFilter: TWorkspaceOwnerFilterState\n  setOwnerFilter: (ownerFilter: TWorkspaceOwnerFilterState) => void\n}) {\n  const onChange = useCallback(\n    (value: string[] | string) => {\n      setOwnerFilter((Array.isArray(value) ? value[0] : value) as TWorkspaceOwnerFilterState)\n    },\n    [setOwnerFilter]\n  )\n\n  return (\n    <Menu offset={[0, 2]}>\n      <MenuButton as={Button} variant=\"outline\" rightIcon={<ChevronDownIcon boxSize={4} />}>\n        Workspaces: {ownerFilter == \"self\" ? \"Mine\" : \"All\"}\n      </MenuButton>\n      <MenuList>\n        <MenuOptionGroup type=\"radio\" value={ownerFilter} onChange={onChange}>\n          <MenuItemOption key=\"self\" value=\"self\">\n            Mine\n          </MenuItemOption>\n          <MenuItemOption key=\"all\" value=\"all\">\n            All\n          </MenuItemOption>\n        </MenuOptionGroup>\n      </MenuList>\n    </Menu>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/WorkspaceOwnerFilter/index.ts",
    "content": "export * from \"./WorkspaceOwnerFilter\"\n"
  },
  {
    "path": "desktop/src/components/WorkspaceSorter/WorkspaceSorter.tsx",
    "content": "import {\n  Button,\n  Menu,\n  MenuButton,\n  MenuItemOption,\n  MenuList,\n  MenuOptionGroup,\n} from \"@chakra-ui/react\"\nimport { ChevronDownIcon } from \"@chakra-ui/icons\"\nimport { DEFAULT_SORT_WORKSPACE_MODE, ESortWorkspaceMode } from \"@/lib/useSortWorkspaces\"\nimport { useCallback } from \"react\"\n\nexport function WorkspaceSorter({\n  sortMode,\n  setSortMode,\n}: {\n  sortMode: ESortWorkspaceMode\n  setSortMode: (sortMode: ESortWorkspaceMode) => void\n}) {\n  const onChange = useCallback(\n    (value: string | string[] | undefined) => {\n      const mode = Array.isArray(value)\n        ? (value[0] as ESortWorkspaceMode | undefined)\n        : (value as ESortWorkspaceMode | undefined)\n      setSortMode(mode ?? DEFAULT_SORT_WORKSPACE_MODE)\n    },\n    [setSortMode]\n  )\n\n  return (\n    <Menu offset={[0, 2]}>\n      <MenuButton as={Button} variant=\"outline\" rightIcon={<ChevronDownIcon boxSize={4} />}>\n        Sort by: {sortMode}\n      </MenuButton>\n      <MenuList>\n        <MenuOptionGroup type=\"radio\" value={sortMode} onChange={onChange}>\n          {Object.values(ESortWorkspaceMode).map((option) => (\n            <MenuItemOption key={option} value={option}>\n              {option}\n            </MenuItemOption>\n          ))}\n        </MenuOptionGroup>\n      </MenuList>\n    </Menu>\n  )\n}\n"
  },
  {
    "path": "desktop/src/components/WorkspaceSorter/index.ts",
    "content": "export * from \"./WorkspaceSorter\"\n"
  },
  {
    "path": "desktop/src/components/WorkspaceStatusFilter/WorkspaceStatusFilter.tsx",
    "content": "import {\n  Button,\n  HStack,\n  Menu,\n  MenuButton,\n  MenuDivider,\n  MenuItemOption,\n  MenuList,\n  MenuOptionGroup,\n  Text,\n} from \"@chakra-ui/react\"\nimport { WorkspaceStatus } from \"@/icons\"\nimport { WORKSPACE_STATUSES } from \"@/constants\"\nimport { WorkspaceStatusBadge } from \"@/views/Workspaces/WorkspaceStatusBadge\"\nimport { useCallback } from \"react\"\nimport { WorkspaceDisplayStatusBadge } from \"@/views/Pro/Workspace/WorkspaceStatus\"\nimport { TWorkspace } from \"@/types\"\nimport { TWorkspaceDisplayStatus, WorkspaceDisplayStatus } from \"@/views/Pro/Workspace/status\"\n\nexport type TWorkspaceStatusFilterState = string[] | \"all\"\n\nexport function WorkspaceStatusFilter({\n  statusFilter,\n  setStatusFilter,\n  variant = \"oss\",\n}: {\n  statusFilter: TWorkspaceStatusFilterState\n  setStatusFilter: (statusFilter: TWorkspaceStatusFilterState) => void\n  variant?: \"oss\" | \"pro\"\n}) {\n  const availableStatuses =\n    variant === \"oss\" ? WORKSPACE_STATUSES : Object.values(WorkspaceDisplayStatus)\n\n  const onSelectAll = useCallback(() => {\n    if (statusFilter === \"all\") {\n      setStatusFilter([])\n    } else {\n      setStatusFilter(\"all\")\n    }\n  }, [statusFilter, setStatusFilter])\n\n  const onChange = useCallback(\n    (value: string | string[]) => {\n      setStatusFilter(typeof value === \"string\" ? [value] : value)\n    },\n    [setStatusFilter]\n  )\n\n  return (\n    <Menu closeOnSelect={false} offset={[0, 2]}>\n      <MenuButton\n        as={Button}\n        variant=\"outline\"\n        leftIcon={<WorkspaceStatus boxSize={4} color=\"gray.600\" />}>\n        Status ({getCurrentFilterCount(statusFilter, availableStatuses.length)}/\n        {availableStatuses.length})\n      </MenuButton>\n      <MenuList>\n        <MenuItemOption\n          isChecked={\n            statusFilter.includes(\"all\") || statusFilter.length === availableStatuses.length\n          }\n          onClick={onSelectAll}\n          key=\"all\"\n          value=\"all\">\n          Select All\n        </MenuItemOption>\n        <MenuOptionGroup\n          value={statusFilter === \"all\" ? (availableStatuses as unknown as string[]) : statusFilter}\n          onChange={onChange}\n          type=\"checkbox\">\n          <MenuDivider />\n          {availableStatuses.map((status) => (\n            <MenuItemOption key={status} value={status}>\n              <HStack>\n                {variant === \"oss\" ? (\n                  <WorkspaceStatusBadge\n                    status={status as TWorkspace[\"status\"]}\n                    isLoading={false}\n                    hasError={false}\n                    showText={false}\n                  />\n                ) : (\n                  <WorkspaceDisplayStatusBadge\n                    compact={true}\n                    displayStatus={status as TWorkspaceDisplayStatus}\n                  />\n                )}{\" \"}\n                <Text> {status || \"Waiting to Initialize\"}</Text>\n              </HStack>\n            </MenuItemOption>\n          ))}\n        </MenuOptionGroup>\n      </MenuList>\n    </Menu>\n  )\n}\n\nfunction getCurrentFilterCount(filter: TWorkspaceStatusFilterState, total: number) {\n  if (filter === \"all\") {\n    return total\n  }\n\n  return filter.length\n}\n"
  },
  {
    "path": "desktop/src/components/WorkspaceStatusFilter/index.ts",
    "content": "export * from \"./WorkspaceStatusFilter\"\n"
  },
  {
    "path": "desktop/src/components/index.ts",
    "content": "export * from \"./Animation\"\nexport * from \"./AutoComplete\"\nexport * from \"./CardHeader\"\nexport * from \"./Error\"\nexport * from \"./Form\"\nexport * from \"./IDEGroup\"\nexport * from \"./IDEIcon\"\nexport * from \"./ListSelection\"\nexport * from \"./DeleteWorkspacesModal\"\nexport * from \"./ExampleCard\"\nexport * from \"./Layout\"\nexport * from \"./LoftOSSBadge\"\nexport * from \"./BottomActionBar\"\nexport * from \"./Section\"\nexport * from \"./Steps\"\nexport * from \"./Terminal\"\nexport * from \"./Tag\"\nexport * from \"./useInstallCLI\"\nexport * from \"./Warning\"\nexport * from \"./WorkspaceSorter\"\nexport * from \"./WorkspaceStatusFilter\"\nexport * from \"./WorkspaceOwnerFilter\"\n"
  },
  {
    "path": "desktop/src/components/useInstallCLI.tsx",
    "content": "import { QuestionIcon } from \"@chakra-ui/icons\"\nimport {\n  AlertDialog,\n  AlertDialogBody,\n  AlertDialogContent,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogOverlay,\n  Button,\n  ButtonGroup,\n  Code,\n  Tooltip,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useMemo, useRef } from \"react\"\nimport { client } from \"../client\"\nimport { CheckCircle, ExclamationCircle } from \"../icons\"\nimport { Err, Failed, isError, isMacOS, isWindows } from \"../lib\"\nimport { QueryKeys } from \"../queryKeys\"\nimport { ErrorMessageBox } from \"./Error\"\n\nexport function useInstallCLI() {\n  const { isOpen, onOpen: showAlertDialog, onClose } = useDisclosure()\n  const cancelRef = useRef<HTMLButtonElement>(null)\n  const { data: isCLIInstalled } = useQuery<boolean>({\n    queryKey: QueryKeys.IS_CLI_INSTALLED,\n    queryFn: async () => {\n      return (await client.isCLIInstalled()).unwrap()!\n    },\n  })\n  const queryClient = useQueryClient()\n  const {\n    mutate: addBinaryToPath,\n    isLoading,\n    error,\n    status,\n  } = useMutation<void, Err<Failed>, { force?: boolean }>({\n    mutationFn: async ({ force = false }) => {\n      ;(await client.installCLI(force)).unwrap()\n      // throw Return.Failed(\"Did not work\")\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries(QueryKeys.IS_CLI_INSTALLED)\n    },\n    onError: (_, { force }) => {\n      if (isMacOS && !force) {\n        showAlertDialog()\n      }\n    },\n  })\n\n  const badge = useMemo(() => {\n    if (isCLIInstalled === undefined) {\n      return (\n        <Tooltip label=\"No information available\">\n          <QuestionIcon boxSize={5} color=\"gray.400\" />\n        </Tooltip>\n      )\n    }\n\n    return isCLIInstalled ? (\n      <Tooltip label=\"Installed\">\n        <CheckCircle boxSize={5} color=\"green.500\" />\n      </Tooltip>\n    ) : (\n      <Tooltip label=\"Not Installed\">\n        <ExclamationCircle boxSize={5} color=\"red.500\" />\n      </Tooltip>\n    )\n  }, [isCLIInstalled])\n\n  const button = useMemo(() => {\n    return (\n      <>\n        <Button\n          variant=\"outline\"\n          isLoading={isLoading}\n          onClick={() => addBinaryToPath({})}\n          isDisabled={status === \"success\"}>\n          Add CLI to Path\n        </Button>\n        <AlertDialog isOpen={isOpen} onClose={onClose} leastDestructiveRef={cancelRef}>\n          <AlertDialogOverlay>\n            <AlertDialogContent>\n              <AlertDialogHeader>Failed to add CLI to path</AlertDialogHeader>\n              <AlertDialogBody>\n                Do you want to retry with Admin Privileges? You will be prompted for authentication\n              </AlertDialogBody>\n              <AlertDialogFooter>\n                <ButtonGroup>\n                  <Button variant=\"ghost\" ref={cancelRef} onClick={onClose}>\n                    Cancel\n                  </Button>\n                  <Button\n                    variant=\"solid\"\n                    onClick={() => {\n                      addBinaryToPath({ force: true })\n                      onClose()\n                    }}>\n                    Okay\n                  </Button>\n                </ButtonGroup>\n              </AlertDialogFooter>\n            </AlertDialogContent>\n          </AlertDialogOverlay>\n        </AlertDialog>\n      </>\n    )\n  }, [addBinaryToPath, isLoading, isOpen, onClose, status])\n\n  const helpText = useMemo(() => {\n    return (\n      <>\n        Adds the DevPod CLI to your <Code>$PATH</Code>.{\" \"}\n        {isWindows ? (\n          <>\n            It will be placed in <Code>%APP_DATA%\\sh.loft.devpod\\bin</Code>\n          </>\n        ) : (\n          <>\n            It will be placed in either <Code>/usr/local/bin</Code>,<Code>$HOME/.local/bin</Code> or{\" \"}\n            <Code>$HOME/bin</Code> depending on your permissions\n          </>\n        )}\n      </>\n    )\n  }, [])\n\n  const errorMessage = useMemo(() => {\n    return error !== null && isError(error.val) && <ErrorMessageBox error={error.val} />\n  }, [error])\n\n  return {\n    isInstalled: isCLIInstalled,\n    install: addBinaryToPath,\n    isLoading,\n    error,\n    status,\n    badge,\n    button,\n    helpText,\n    errorMessage,\n  }\n}\n"
  },
  {
    "path": "desktop/src/constants.ts",
    "content": "import { BoxProps } from \"@chakra-ui/react\"\nimport {\n  AWSSvg,\n  AWSWhiteSvg,\n  AzureSvg,\n  CivoSvg,\n  DigitalOceanSvg,\n  DockerSvg,\n  GCloudSvg,\n  KubernetesSvg,\n  SSHSvg,\n} from \"./images\"\n\nexport const STATUS_BAR_HEIGHT: NonNullable<BoxProps[\"height\"]> = \"8\"\nexport const SIDEBAR_WIDTH: BoxProps[\"width\"] = \"15rem\"\nexport const RECOMMENDED_PROVIDER_SOURCES = [\n  // generic\n  { image: DockerSvg, imageDarkMode: undefined, name: \"docker\", group: \"generic\" },\n  { image: KubernetesSvg, imageDarkMode: undefined, name: \"kubernetes\", group: \"generic\" },\n  { image: SSHSvg, imageDarkMode: undefined, name: \"ssh\", group: \"generic\" },\n  // cloud\n  { image: AWSSvg, imageDarkMode: AWSWhiteSvg, name: \"aws\", group: \"cloud\" },\n  { image: GCloudSvg, imageDarkMode: undefined, name: \"gcloud\", group: \"cloud\" },\n  { image: AzureSvg, imageDarkMode: undefined, name: \"azure\", group: \"cloud\" },\n  { image: DigitalOceanSvg, imageDarkMode: undefined, name: \"digitalocean\", group: \"cloud\" },\n  { image: CivoSvg, imageDarkMode: undefined, name: \"civo\", group: \"cloud\" },\n] as const\n\nexport const WORKSPACE_SOURCE_BRANCH_DELIMITER = \"@\"\nexport const WORKSPACE_SOURCE_COMMIT_DELIMITER = \"@sha256:\"\nexport const WORKSPACE_STATUSES = [\"Running\", \"Stopped\", \"Busy\", \"NotFound\"] as const\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/DevPodProvider/DevPodContext.tsx",
    "content": "import { createContext } from \"react\"\nimport { TProviders, TQueryResult } from \"../../../types\"\n\nexport type TDevpodContext = Readonly<{\n  providers: TQueryResult<TProviders>\n}>\nexport const DevPodContext = createContext<TDevpodContext | null>(null)\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/DevPodProvider/DevPodProvider.tsx",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { ReactNode, useMemo } from \"react\"\nimport { client } from \"../../../client\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport { REFETCH_PROVIDER_INTERVAL_MS } from \"../constants\"\nimport { usePollWorkspaces } from \"../workspaces\"\nimport { DevPodContext, TDevpodContext } from \"./DevPodContext\"\n\nexport function DevPodProvider({ children }: Readonly<{ children?: ReactNode }>) {\n  usePollWorkspaces()\n\n  const providersQuery = useQuery({\n    queryKey: QueryKeys.PROVIDERS,\n    queryFn: async () => (await client.providers.listAll()).unwrap(),\n    refetchInterval: REFETCH_PROVIDER_INTERVAL_MS,\n    enabled: true,\n  })\n\n  const value = useMemo<TDevpodContext>(\n    () => ({\n      providers: [\n        providersQuery.data,\n        { status: providersQuery.status, error: providersQuery.error },\n      ],\n    }),\n    [providersQuery.data, providersQuery.status, providersQuery.error]\n  )\n\n  return <DevPodContext.Provider value={value}>{children}</DevPodContext.Provider>\n}\n\nexport function ProviderProvider({ children }: Readonly<{ children?: ReactNode }>) {\n  const providersQuery = useQuery({\n    queryKey: QueryKeys.PROVIDERS,\n    queryFn: async () => (await client.providers.listAll()).unwrap(),\n    refetchInterval: REFETCH_PROVIDER_INTERVAL_MS,\n    enabled: true,\n  })\n\n  const value = useMemo<TDevpodContext>(\n    () => ({\n      providers: [\n        providersQuery.data,\n        { status: providersQuery.status, error: providersQuery.error },\n      ],\n    }),\n    [providersQuery.data, providersQuery.status, providersQuery.error]\n  )\n\n  return <DevPodContext.Provider value={value}>{children}</DevPodContext.Provider>\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/DevPodProvider/index.ts",
    "content": "export { DevPodProvider, ProviderProvider } from \"./DevPodProvider\"\nexport { DevPodContext } from \"./DevPodContext\"\nexport type { TDevpodContext } from \"./DevPodContext\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/ContextSwitcher.tsx",
    "content": "import { Close, Connect, DevpodWordmark, Ellipsis, Folder } from \"@/icons\"\nimport { Result, getDisplayName, useLoginProModal } from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { TProInstance } from \"@/types\"\nimport { useDeleteProviderModal } from \"@/views/Providers\"\nimport { ArrowUpDownIcon, CheckIcon } from \"@chakra-ui/icons\"\nimport {\n  Box,\n  Button,\n  HStack,\n  Heading,\n  IconButton,\n  Image,\n  List,\n  ListItem,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Popover,\n  PopoverBody,\n  PopoverContent,\n  PopoverTrigger,\n  Portal,\n  Spinner,\n  Text,\n  Tooltip,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ManagementV1Project } from \"@loft-enterprise/client/gen/models/managementV1Project\"\nimport { ReactNode, useMemo } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { useProInstances } from \"../proInstances\"\nimport { HOST_OSS } from \"./constants\"\n\ntype THostPickerProps = Readonly<{\n  currentHost: string\n  onHostChange: (newHost: string) => void\n\n  currentProject: ManagementV1Project\n  projects: readonly ManagementV1Project[]\n  onProjectChange: (newProject: ManagementV1Project) => void\n  onCancelWatch?: () => Promise<Result<undefined>>\n  waitingForCancel: boolean\n}>\nexport function ContextSwitcher({\n  currentHost,\n  projects,\n  currentProject,\n  onProjectChange,\n  onHostChange,\n  onCancelWatch,\n  waitingForCancel,\n}: THostPickerProps) {\n  const [[rawProInstances]] = useProInstances()\n  const proInstances = useMemo(() => {\n    const p: (TProInstance & { image?: string | ReactNode })[] =\n      rawProInstances\n        ?.slice()\n        .sort((a, b) => {\n          if (a.host === currentHost) {\n            return -1\n          }\n          if (b.host === currentHost) {\n            return 1\n          }\n\n          return 0\n        })\n        .map((proInstance) => ({ ...proInstance })) ?? []\n\n    p.push({\n      host: HOST_OSS,\n      image: <DevpodWordmark w=\"20\" h=\"6\" />,\n      authenticated: undefined,\n      provider: undefined,\n      creationTimestamp: undefined,\n      capabilities: undefined,\n    })\n\n    return p\n  }, [currentHost, rawProInstances])\n\n  const { modal: loginProModal, handleOpenLogin: handleConnectClicked } = useLoginProModal()\n  const handleConnectPlatform = () => {\n    handleConnectClicked()\n  }\n  const hoverBgColor = useColorModeValue(\"gray.100\", \"gray.700\")\n  const projectsColor = useColorModeValue(\"gray.600\", \"gray.300\")\n\n  return (\n    <>\n      <Popover>\n        <PopoverTrigger>\n          <Button variant=\"ghost\" rightIcon={<ArrowUpDownIcon />}>\n            {getDisplayName(currentProject, \"Unknown Project\")}\n          </Button>\n        </PopoverTrigger>\n        <Portal>\n          <PopoverContent minWidth={\"25rem\"}>\n            <PopoverBody p=\"0\">\n              {waitingForCancel ? (\n                <HStack alignItems={\"center\"} justifyContent={\"center\"} paddingY={\"4\"}>\n                  <Spinner />\n                </HStack>\n              ) : (\n                <List>\n                  {proInstances.map(({ host, authenticated, image }, index) => (\n                    <ListItem key={host}>\n                      <PlatformDetails\n                        currentHost={currentHost}\n                        host={host!}\n                        image={image}\n                        showBorder={index != proInstances.length - 1}\n                        onCancelWatch={onCancelWatch}\n                        authenticated={authenticated}\n                        onConnect={handleConnectPlatform}\n                        onClick={() => onHostChange(host!)}\n                      />\n                      {host === currentHost && (\n                        <VStack\n                          w=\"full\"\n                          align=\"start\"\n                          pb=\"4\"\n                          pt=\"2\"\n                          pl=\"2\"\n                          borderBottomWidth=\"thin\"\n                          borderBottomStyle=\"solid\">\n                          <Heading pl=\"4\" size=\"xs\" color={projectsColor} textTransform=\"uppercase\">\n                            Projects\n                          </Heading>\n                          <List w=\"full\">\n                            {projects.map((project) => (\n                              <ListItem key={project.metadata!.name}>\n                                <Button\n                                  _hover={{ bgColor: hoverBgColor }}\n                                  variant=\"unstyled\"\n                                  w=\"full\"\n                                  display=\"flex\"\n                                  justifyContent=\"start\"\n                                  alignItems=\"center\"\n                                  leftIcon={<Folder boxSize={5} />}\n                                  pl=\"4\"\n                                  color={projectsColor}\n                                  fontWeight=\"normal\"\n                                  rightIcon={\n                                    project.metadata?.name === currentProject.metadata?.name ? (\n                                      <CheckIcon />\n                                    ) : undefined\n                                  }\n                                  onClick={() => onProjectChange(project)}>\n                                  {getDisplayName(project, \"Unknown Project\")}\n                                </Button>\n                              </ListItem>\n                            ))}\n                          </List>\n                        </VStack>\n                      )}\n                    </ListItem>\n                  ))}\n                </List>\n              )}\n            </PopoverBody>\n          </PopoverContent>\n        </Portal>\n      </Popover>\n\n      {loginProModal}\n    </>\n  )\n}\ntype TPlatformDetailsProps = Readonly<{\n  host: string\n  currentHost: string\n  image: ReactNode\n  authenticated?: boolean | null\n  showBorder?: boolean\n  onClick: VoidFunction\n  onConnect: VoidFunction\n  onCancelWatch?: () => Promise<Result<undefined>>\n}>\nfunction PlatformDetails({\n  host,\n  currentHost,\n  image,\n  authenticated,\n  showBorder = true,\n  onClick,\n  onConnect,\n  onCancelWatch,\n}: TPlatformDetailsProps) {\n  const navigate = useNavigate()\n  const [, { disconnect }] = useProInstances()\n  const { modal: deleteProviderModal, open: openDeleteProviderModal } = useDeleteProviderModal(\n    host,\n    \"Pro instance\",\n    \"disconnect\",\n    async () => {\n      await onCancelWatch?.()\n      disconnect.run({ id: host })\n      navigate(Routes.ROOT)\n    }\n  )\n  const hoverBgColor = useColorModeValue(\"gray.100\", \"gray.700\")\n  const menuColor = useColorModeValue(\"gray.700\", \"gray.200\")\n\n  return (\n    <>\n      <HStack\n        _hover={{ bgColor: hoverBgColor, cursor: \"pointer\" }}\n        w=\"full\"\n        px=\"4\"\n        h=\"12\"\n        onClick={onClick}\n        {...(currentHost != host\n          ? {\n              borderBottomStyle: \"solid\",\n              borderBottomWidth: showBorder ? \"thin\" : \"none\",\n            }\n          : {})}>\n        <HStack\n          w=\"full\"\n          overflow=\"hidden\"\n          textOverflow=\"ellipsis\"\n          whiteSpace=\"nowrap\"\n          justify=\"space-between\">\n          {image ? (\n            typeof image === \"string\" ? (\n              <Image src={image} />\n            ) : (\n              image\n            )\n          ) : (\n            <Tooltip maxW={\"25rem\"} label={host} openDelay={0} closeDelay={0}>\n              <Text\n                maxW=\"50%\"\n                fontWeight=\"semibold\"\n                fontSize=\"sm\"\n                overflow=\"hidden\"\n                textOverflow=\"ellipsis\">\n                {host}\n              </Text>\n            </Tooltip>\n          )}\n          <HStack maxW=\"50%\">\n            {authenticated != null && (\n              <Box\n                flexShrink=\"0\"\n                boxSize=\"2\"\n                bg={authenticated ? \"green.400\" : \"orange.400\"}\n                rounded=\"full\"\n              />\n            )}\n            <Tooltip maxW={\"25rem\"} label={host} openDelay={0} closeDelay={0}>\n              <Text\n                overflow=\"hidden\"\n                textOverflow=\"ellipsis\"\n                whiteSpace=\"nowrap\"\n                marginTop=\"1px\"\n                fontSize=\"xs\"\n                fontWeight=\"normal\">\n                {host}\n              </Text>\n            </Tooltip>\n            {host !== HOST_OSS && (\n              <Menu>\n                <MenuButton\n                  onClick={(e) => e.stopPropagation()}\n                  as={IconButton}\n                  variant=\"ghost\"\n                  aria-label=\"More actions\"\n                  colorScheme=\"gray\"\n                  icon={<Ellipsis transform={\"rotate(90deg)\"} boxSize={5} />}\n                />\n                <MenuList color={menuColor} onClick={(e) => e.stopPropagation()}>\n                  <MenuItem icon={<Connect boxSize={4} />} onClick={onConnect}>\n                    Connect another platform\n                  </MenuItem>\n                  <MenuItem icon={<Close boxSize={4} />} onClick={openDeleteProviderModal}>\n                    Disconnect\n                  </MenuItem>\n                </MenuList>\n              </Menu>\n            )}\n          </HStack>\n        </HStack>\n      </HStack>\n      {deleteProviderModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/ProProvider.tsx",
    "content": "import { client as globalClient } from \"@/client\"\nimport { DaemonClient } from \"@/client/pro/client\"\nimport { TWorkspaceOwnerFilterState, ToolbarActions, ToolbarTitle } from \"@/components\"\nimport { Annotations, Result } from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { Text } from \"@chakra-ui/react\"\nimport { ManagementV1Project } from \"@loft-enterprise/client/gen/models/managementV1Project\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { ReactNode, useEffect, useMemo, useState } from \"react\"\nimport { Navigate, useNavigate } from \"react-router-dom\"\nimport { useProInstances } from \"../proInstances\"\nimport { ProWorkspaceStore, useWorkspaceStore } from \"../workspaceStore\"\nimport { ContextSwitcher } from \"./ContextSwitcher\"\nimport { HOST_OSS } from \"./constants\"\nimport { ProContext, TProContext } from \"./useProContext\"\n\nexport function ProProvider({ host, children }: { host: string; children: ReactNode }) {\n  const [[proInstances, { status: proInstancesStatus }]] = useProInstances()\n  const [isLoadingWorkspaces, setIsLoadingWorkspaces] = useState(false)\n  const [ownerFilter, setOwnerFilter] = useState<TWorkspaceOwnerFilterState>(\"self\")\n  const [currentProjectName, setCurrentProjectName] = useState<string | undefined>(\n    () => localStorage.getItem(getProjectStorageKey(host)) ?? undefined\n  )\n  const navigate = useNavigate()\n  const currentProInstance = useMemo(() => {\n    return proInstances?.find((instance) => instance.host == host)\n  }, [host, proInstances])\n  const { store } = useWorkspaceStore<ProWorkspaceStore>()\n  const client = useMemo(() => {\n    if (!currentProInstance) {\n      return null\n    }\n\n    return globalClient.getProClient(currentProInstance)\n  }, [currentProInstance])\n  const managementSelfQuery = useQuery({\n    queryKey: [\"managementSelf\", client],\n    queryFn: async () => {\n      return (await client!.getSelf()).unwrap()\n    },\n    enabled: !!client,\n  })\n  const projectsQuery = useQuery({\n    queryKey: [\"pro\", host, \"projects\", client],\n    queryFn: async () => {\n      return (await client!.listProjects()).unwrap()\n    },\n    enabled: !!client,\n  })\n\n  const currentProject = useMemo<ManagementV1Project | undefined>(() => {\n    if (projectsQuery.data == null) {\n      return undefined\n    }\n\n    if (!currentProjectName) {\n      return projectsQuery.data[0] ?? undefined\n    }\n\n    const maybeProject =\n      projectsQuery.data.find((project) => project.metadata?.name === currentProjectName) ??\n      undefined\n    if (!maybeProject) {\n      return projectsQuery.data[0] ?? undefined\n    }\n\n    return maybeProject\n  }, [currentProjectName, projectsQuery.data])\n\n  const [cancelWatch, setCancelWatch] = useState<\n    { fn: () => Promise<Result<undefined>> } | undefined\n  >(undefined)\n\n  const [waitingForCancel, setWaitingForCancel] = useState<boolean>(false)\n\n  useEffect(() => {\n    if (!currentProject?.metadata?.name || !client) {\n      return\n    }\n    setIsLoadingWorkspaces(true)\n\n    if (client instanceof DaemonClient) {\n      // daemon client impl\n      return client.watchWorkspaces(currentProject.metadata.name, ownerFilter, (workspaces) => {\n        // sort by last activity (newest > oldest)\n        const sorted = workspaces.slice().sort((a, b) => {\n          const lastActivityA = a.metadata?.annotations?.[Annotations.SleepModeLastActivity]\n          const lastActivityB = b.metadata?.annotations?.[Annotations.SleepModeLastActivity]\n          if (!(lastActivityA && lastActivityB)) {\n            return 0\n          }\n\n          return parseInt(lastActivityB, 10) - parseInt(lastActivityA, 10)\n        })\n        store.setWorkspaces(sorted)\n        setIsLoadingWorkspaces(false)\n      })\n    } else {\n      let canceled = false\n      // proxy client impl\n      const toCancel = client.watchWorkspacesProxy(\n        currentProject.metadata.name,\n        ownerFilter,\n        (workspaces) => {\n          if (canceled) {\n            return\n          }\n\n          // sort by last activity (newest > oldest)\n          const sorted = workspaces.slice().sort((a, b) => {\n            const lastActivityA = a.metadata?.annotations?.[Annotations.SleepModeLastActivity]\n            const lastActivityB = b.metadata?.annotations?.[Annotations.SleepModeLastActivity]\n            if (!(lastActivityA && lastActivityB)) {\n              return 0\n            }\n\n            return parseInt(lastActivityB, 10) - parseInt(lastActivityA, 10)\n          })\n          store.setWorkspaces(sorted)\n          // dirty, dirty\n          setTimeout(() => {\n            setIsLoadingWorkspaces(false)\n          }, 1_000)\n        }\n      )\n\n      function canceler() {\n        canceled = true\n        setCancelWatch(undefined)\n        setWaitingForCancel(true)\n\n        return toCancel().finally(() => setWaitingForCancel(false))\n      }\n      setCancelWatch({ fn: canceler })\n\n      return () => {\n        canceler()\n      }\n    }\n  }, [client, store, currentProject, ownerFilter])\n\n  const handleProjectChanged = (newProject: ManagementV1Project) => {\n    const projectName = newProject.metadata?.name ?? \"\"\n    localStorage.setItem(getProjectStorageKey(host), projectName)\n    setCurrentProjectName(projectName)\n    navigate(Routes.toProInstance(host))\n  }\n\n  const handleHostChanged = (newHost: string) => {\n    if (newHost === HOST_OSS) {\n      navigate(Routes.WORKSPACES)\n\n      return\n    }\n\n    const projectName = localStorage.getItem(getProjectStorageKey(newHost)) ?? undefined\n    setCurrentProjectName(projectName)\n    navigate(Routes.toProInstance(newHost))\n  }\n\n  const value = useMemo<TProContext>(() => {\n    return {\n      managementSelfQuery,\n      currentProject,\n      host,\n      client: client!,\n      isLoadingWorkspaces,\n      ownerFilter,\n      setOwnerFilter,\n    }\n  }, [managementSelfQuery, currentProject, host, client, isLoadingWorkspaces, ownerFilter])\n\n  // this pro instance doesn't exist, let's route back to root\n  if (proInstancesStatus == \"success\" && !currentProInstance) {\n    return <Navigate to={Routes.ROOT} />\n  }\n\n  if (!client) {\n    return null\n  }\n\n  return (\n    <ProContext.Provider value={value}>\n      <ToolbarTitle>\n        <Text maxW=\"60\" fontSize=\"sm\" overflow=\"hidden\" textOverflow=\"ellipsis\" whiteSpace=\"nowrap\">\n          {host}\n        </Text>\n      </ToolbarTitle>\n      <ToolbarActions>\n        <ContextSwitcher\n          currentHost={host}\n          onHostChange={handleHostChanged}\n          projects={projectsQuery.data ?? []}\n          currentProject={currentProject!}\n          onProjectChange={handleProjectChanged}\n          onCancelWatch={cancelWatch?.fn}\n          waitingForCancel={waitingForCancel}\n        />\n      </ToolbarActions>\n      {children}\n    </ProContext.Provider>\n  )\n}\n\nconst PROJECT_STORAGE_KEY = \"devpod_current_project\"\n\nfunction getProjectStorageKey(host: string) {\n  return `${PROJECT_STORAGE_KEY}_${host}`\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/constants.ts",
    "content": "export const HOST_OSS = \"Open Source\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/index.ts",
    "content": "export { ProProvider } from \"./ProProvider\"\nexport { useProContext } from \"./useProContext\"\nexport { ProWorkspaceInstance } from \"./workspaceInstance\"\nexport { useProHost } from \"./useProHost\"\nexport { useTemplates } from \"./useTemplates\"\nexport { useProjectClusters } from \"./useProjectClusters\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/useProContext.ts",
    "content": "import { ProClient } from \"@/client\"\nimport { TWorkspaceOwnerFilterState } from \"@/components\"\nimport { ManagementV1Project } from \"@loft-enterprise/client/gen/models/managementV1Project\"\nimport { ManagementV1Self } from \"@loft-enterprise/client/gen/models/managementV1Self\"\nimport { UseQueryResult } from \"@tanstack/react-query\"\nimport { Dispatch, SetStateAction, createContext, useContext } from \"react\"\n\nexport type TProContext = Readonly<{\n  managementSelfQuery: UseQueryResult<ManagementV1Self | undefined>\n  currentProject?: ManagementV1Project\n  host: string\n  client: ProClient\n  isLoadingWorkspaces: boolean\n  ownerFilter: TWorkspaceOwnerFilterState\n  setOwnerFilter: Dispatch<SetStateAction<TWorkspaceOwnerFilterState>>\n}>\nexport const ProContext = createContext<TProContext>(null!)\n\nexport function useProContext() {\n  return useContext(ProContext)\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/useProHost.ts",
    "content": "import { useParams } from \"react-router-dom\"\n\nexport function useProHost() {\n  const { host } = useParams<{ host: string | undefined }>()\n\n  return host\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/useProjectClusters.tsx",
    "content": "import { useProContext } from \"@/contexts\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport { ManagementV1Runner } from \"@/runner\"\nimport { ManagementV1ProjectClusters } from \"@loft-enterprise/client/gen/models/managementV1ProjectClusters\"\nimport { useQuery, UseQueryResult } from \"@tanstack/react-query\"\n\nexport type TProjectCluster = ManagementV1ProjectClusters & {\n  runners?: Array<ManagementV1Runner>\n}\nexport function useProjectClusters(): UseQueryResult<TProjectCluster | undefined> {\n  const { host, currentProject, client } = useProContext()\n  const query = useQuery({\n    queryKey: QueryKeys.proClusters(host, currentProject?.metadata!.name!),\n    queryFn: async () => {\n      return (await client.getProjectClusters(currentProject?.metadata!.name!)).unwrap()\n    },\n    enabled: !!currentProject,\n  })\n\n  return query\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/useTemplates.ts",
    "content": "import { useProContext } from \"@/contexts\"\nimport { useQuery, UseQueryResult } from \"@tanstack/react-query\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport { ManagementV1DevPodEnvironmentTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodEnvironmentTemplate\"\nimport { ManagementV1DevPodWorkspacePreset } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspacePreset\"\n\ntype TTemplates = Readonly<{\n  default: ManagementV1DevPodWorkspaceTemplate | undefined\n  workspace: readonly ManagementV1DevPodWorkspaceTemplate[]\n  environment: readonly ManagementV1DevPodEnvironmentTemplate[]\n  presets: readonly ManagementV1DevPodWorkspacePreset[]\n}>\nexport function useTemplates(): UseQueryResult<TTemplates> {\n  const { host, currentProject, client } = useProContext()\n  const query = useQuery<TTemplates>({\n    queryKey: QueryKeys.proWorkspaceTemplates(host, currentProject?.metadata!.name!),\n    queryFn: async () => {\n      const projectTemplates = (\n        await client.getProjectTemplates(currentProject?.metadata!.name!)\n      ).unwrap()\n\n      // try to find default template in list\n      let defaultTemplate: ManagementV1DevPodWorkspaceTemplate | undefined = undefined\n      if (projectTemplates?.defaultDevPodWorkspaceTemplate) {\n        defaultTemplate = projectTemplates.devPodWorkspaceTemplates?.find(\n          (template) => template.metadata?.name === projectTemplates.defaultDevPodWorkspaceTemplate\n        )\n      }\n\n      return {\n        default: defaultTemplate,\n        workspace: projectTemplates?.devPodWorkspaceTemplates ?? [],\n        environment: projectTemplates?.devPodEnvironmentTemplates ?? [],\n        presets: projectTemplates?.devPodWorkspacePresets ?? [],\n      }\n    },\n    enabled: !!currentProject,\n  })\n\n  return query\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/Pro/workspaceInstance.ts",
    "content": "import { TIDE, TIdentifiable, TWorkspaceSource } from \"@/types\"\nimport { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport { Labels, deepCopy } from \"@/lib\"\nimport { Resources } from \"@loft-enterprise/client\"\nimport { ManagementV1DevPodWorkspaceInstanceStatus } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstanceStatus\"\n\nexport class ProWorkspaceInstance\n  extends ManagementV1DevPodWorkspaceInstance\n  implements TIdentifiable\n{\n  public readonly status: ProWorkspaceInstanceStatus | undefined\n\n  public get id(): string {\n    const maybeID = this.metadata?.labels?.[Labels.WorkspaceID]\n    if (!maybeID) {\n      // If we don't have an ID we should ignore the instance.\n      // Throwing an error for now to see how often this happens\n      throw new Error(`No Workspace ID label present on instance ${this.metadata?.name}`)\n    }\n\n    return maybeID\n  }\n\n  constructor(instance: ManagementV1DevPodWorkspaceInstance) {\n    super()\n\n    this.apiVersion = `${Resources.ManagementV1DevPodWorkspaceInstance.group}/${Resources.ManagementV1DevPodWorkspaceInstance.version}`\n    this.kind = Resources.ManagementV1DevPodWorkspaceInstance.kind\n    this.metadata = deepCopy(instance.metadata)\n    this.spec = deepCopy(instance.spec)\n    this.status = deepCopy(instance.status) as ProWorkspaceInstanceStatus\n  }\n}\n\nclass ProWorkspaceInstanceStatus extends ManagementV1DevPodWorkspaceInstanceStatus {\n  \"source\"?: TWorkspaceSource\n  \"ide\"?: TIDE\n  \"metrics\"?: ProWorkspaceMetricsSummary\n\n  constructor() {\n    super()\n  }\n}\n\nclass ProWorkspaceMetricsSummary {\n  \"latencyMs\"?: number\n  \"connectionType\"?: \"direct\" | \"DERP\"\n  \"derpRegion\"?: string\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/action/action.ts",
    "content": "import { Result, SingleEventManager, EventManager } from \"../../../lib\"\nimport { v4 as uuidv4 } from \"uuid\"\n\nexport type TActionName = \"start\" | \"stop\" | \"rebuild\" | \"reset\" | \"remove\" | \"checkStatus\"\nexport type TActionFn = (context: TActionContext) => Promise<Result<unknown>>\nexport type TActionStatus = \"pending\" | \"success\" | \"error\" | \"cancelled\"\nexport type TActionID = Action[\"id\"]\n// We don't want to expose the methods to consumers of these actions, so we'll limit the type to data-only properties\nexport type TActionObj = Pick<\n  Action,\n  \"id\" | \"name\" | \"status\" | \"error\" | \"createdAt\" | \"finishedAt\" | \"targetID\"\n>\nexport type TActions = Readonly<{\n  active: readonly TActionObj[]\n  history: readonly TActionObj[]\n}>\ntype TActionContext = Readonly<{ id: Action[\"id\"] }>\n\nexport class Action {\n  private _status: TActionStatus = \"pending\"\n  private _error: Error | undefined = undefined\n  private _finishedAt: number | undefined = undefined\n  private readonly eventManager = new SingleEventManager<TActionStatus>()\n  public readonly id = uuidv4()\n  public readonly createdAt = Date.now()\n\n  public static deserialize(str: string): TActionObj {\n    return JSON.parse(str)\n  }\n\n  constructor(\n    public readonly name: TActionName,\n    public readonly targetID: string,\n    private actionFn: TActionFn\n  ) {}\n\n  public get status() {\n    return this._status\n  }\n\n  public get error() {\n    return this._error\n  }\n\n  public get finishedAt() {\n    return this._finishedAt\n  }\n\n  private failed(error: Error) {\n    if (this._status !== \"pending\") {\n      return\n    }\n    this._status = \"error\"\n    this._error = error\n    this._finishedAt = Date.now()\n    this.eventManager.publish(this._status)\n  }\n\n  private succeeded() {\n    if (this._status !== \"pending\") {\n      return\n    }\n    this._status = \"success\"\n    this._finishedAt = Date.now()\n    this.eventManager.publish(this._status)\n  }\n\n  public run() {\n    this.actionFn({ id: this.id }).then((result) => {\n      if (result.err) {\n        this.failed(result.val)\n\n        return\n      }\n\n      this.succeeded()\n    })\n  }\n\n  public cancel() {\n    if (this._status !== \"pending\") {\n      return\n    }\n    // We're no longer interested in status updates\n    this.eventManager.clear()\n    this._status = \"cancelled\"\n    this._finishedAt = Date.now()\n  }\n\n  public once(listener: (status: TActionStatus) => void): void {\n    const unsubscribe = this.eventManager.subscribe(\n      EventManager.toHandler((status) => {\n        listener(status)\n        unsubscribe()\n      })\n    )\n  }\n\n  public getData(): TActionObj {\n    return {\n      id: this.id,\n      targetID: this.targetID,\n      name: this.name,\n      status: this.status,\n      error: this.error,\n      createdAt: this.createdAt,\n      finishedAt: this.finishedAt,\n    }\n  }\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/action/actionHistory.ts",
    "content": "import { Action, TActionObj, TActions } from \"./action\"\n\nconst HISTORY_KEY = \"devpod-workspace-action-history\"\nconst MAX_HISTORY_ENTRIES = 50\n\nexport class ActionHistory {\n  private active = new Map<string, Action>()\n  private history: TActionObj[]\n\n  private localStorageKey: string\n\n  constructor(keySuffix?: string) {\n    let localStorageKey = HISTORY_KEY\n    if (keySuffix) {\n      localStorageKey = `${localStorageKey}-${keySuffix}`\n    }\n    this.localStorageKey = localStorageKey\n\n    const maybeHistory = localStorage.getItem(this.localStorageKey)\n    if (maybeHistory === null) {\n      this.history = []\n\n      return\n    }\n\n    this.history = JSON.parse(maybeHistory) as TActionObj[]\n  }\n\n  private getAllActive(): readonly TActionObj[] {\n    const active = []\n    for (const action of this.active.values()) {\n      active.push(action.getData())\n    }\n\n    return active\n  }\n\n  public getActive(targetID: string): Action | undefined {\n    return this.active.get(targetID)\n  }\n\n  public getAll(): TActions {\n    const active = this.getAllActive()\n    const history = this.history.slice()\n\n    return { active, history }\n  }\n\n  public addActive(targetID: string, action: Action): void {\n    this.active.set(targetID, action)\n  }\n\n  public archive(action: Action): void {\n    this.active.delete(action.targetID)\n    this.history.push(action.getData())\n\n    // Limit history size\n    const overflow = this.history.length - MAX_HISTORY_ENTRIES\n    if (overflow > 0) {\n      this.history.splice(0, overflow)\n    }\n\n    window.localStorage.setItem(this.localStorageKey, JSON.stringify(this.history))\n  }\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/action/index.ts",
    "content": "export { getAction, useAction, useReplayAction, useConnectAction } from \"./useAction\"\nexport { Action } from \"./action\"\nexport type {\n  TActionName,\n  TActionObj,\n  TActionID,\n  TActions as TWorkspaceActions,\n  TActionFn,\n} from \"./action\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/action/useAction.ts",
    "content": "import { useCallback, useEffect, useId, useMemo, useRef, useSyncExternalStore } from \"react\"\nimport { TStreamEventListenerFn, client } from \"../../../client\"\nimport { TStreamID, TUnsubscribeFn } from \"../../../types\"\nimport { useWorkspaceStore } from \"../workspaceStore\"\nimport { IWorkspaceStore } from \"../workspaceStore/workspaceStore\"\nimport { TActionID, TActionObj } from \"./action\"\n\ntype TActionResult = Readonly<{\n  data: TActionObj\n  connectOrReplay(onStream: TStreamEventListenerFn): void | VoidFunction\n  cancel(): void\n}>\n\nexport function useAction(actionID: TActionID | undefined): TActionResult | undefined {\n  const { store } = useWorkspaceStore()\n  const isCancellingRef = useRef(false)\n  const viewID = useId()\n  const data = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => {\n      if (actionID === undefined) {\n        return undefined\n      }\n\n      return getAction(actionID, store)\n    }\n  )\n\n  const connect = useConnectAction(data, viewID)\n  const replay = useReplayAction()\n\n  return useMemo(() => {\n    if (data === undefined) {\n      return undefined\n    }\n\n    return {\n      data,\n      connectOrReplay: (onStream) => {\n        if (data.status === \"pending\") {\n          return connect(onStream)\n        }\n\n        return replay(data.id, onStream)\n      },\n      cancel: () => {\n        if (isCancellingRef.current) {\n          return\n        }\n        isCancellingRef.current = true\n        // could improve by setting timeout as fallback if promise doesn't resolve, let's see if this is enough\n        client.workspaces.cancelAction(data.targetID).finally(() => {\n          isCancellingRef.current = false\n        })\n      },\n    }\n  }, [data, connect, replay])\n}\n\nexport function getAction(\n  actionID: TActionID,\n  store: IWorkspaceStore<string, unknown>\n): TActionObj | undefined {\n  const { active, history } = store.getAllActions()\n\n  return [...active, ...history].find((action) => action.id === actionID)\n}\n\nexport function useConnectAction(\n  action: TActionObj | undefined,\n  streamID: TStreamID\n): (onStream: TStreamEventListenerFn) => void {\n  const subscriptionRef = useRef<TUnsubscribeFn>()\n  // Make sure we unsubscribe on onmount\n  useEffect(() => {\n    return () => subscriptionRef.current?.()\n  }, [])\n\n  // Unsubscribe whenever action changes\n  useEffect(() => {\n    if (\n      (action === undefined || action.status !== \"pending\") &&\n      subscriptionRef.current !== undefined\n    ) {\n      subscriptionRef.current()\n      subscriptionRef.current = undefined\n    }\n  }, [action])\n\n  return useCallback(\n    (onStream) => {\n      if (action === undefined) {\n        return\n      }\n\n      subscriptionRef.current = client.workspaces.subscribe(action, streamID, onStream)\n    },\n    [action, streamID]\n  )\n}\n\nexport function useReplayAction(): (\n  actionID: TActionID,\n  onStream: TStreamEventListenerFn\n) => VoidFunction {\n  return useCallback((actionID, onStream) => client.workspaces.replayAction(actionID, onStream), [])\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/constants.ts",
    "content": "export const REFETCH_INTERVAL_MS = 5_000\n\nexport const REFETCH_PROVIDER_INTERVAL_MS = 1_000\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/helpers.ts",
    "content": "// copied from https://github.com/TkDodo/react-query/blob/c1ae82ba188fd5abda5e256cac070145e5941447/src/core/utils.ts#L346\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep<T>(a: unknown, b: T): T\nexport function replaceEqualDeep(a: any, b: any): any {\n  if (a === b) {\n    return a\n  }\n\n  const array = Array.isArray(a) && Array.isArray(b)\n\n  if (array || (isPlainObject(a) && isPlainObject(b))) {\n    const aSize = array ? a.length : Object.keys(a).length\n    const bItems = array ? b : Object.keys(b)\n    const bSize = bItems.length\n    const copy: any = array ? [] : {}\n\n    let equalItems = 0\n\n    for (let i = 0; i < bSize; i++) {\n      const key = array ? i : bItems[i]\n      copy[key] = replaceEqualDeep(a[key], b[key])\n      if (copy[key] === a[key]) {\n        equalItems++\n      }\n    }\n    const sameSize = aSize === bSize\n    const sameItems = equalItems === aSize\n    const keepA = sameSize && sameItems\n\n    return keepA ? a : copy\n  }\n\n  return b\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Object {\n  if (!hasObjectPrototype(o)) {\n    return false\n  }\n\n  // If has modified constructor\n  const ctor = o.constructor\n  if (typeof ctor === \"undefined\") {\n    return true\n  }\n\n  // If has modified prototype\n  const prot = ctor.prototype\n  if (!hasObjectPrototype(prot)) {\n    return false\n  }\n\n  // If constructor does not have an Object-specific method\n  // eslint-disable-next-line no-prototype-builtins\n  if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n    return false\n  }\n\n  // Most likely a plain Object\n  return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n  return Object.prototype.toString.call(o) === \"[object Object]\"\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/index.ts",
    "content": "export { getAction, useAction } from \"./action\"\nexport type { TActionName, TActionID, TActionObj } from \"./action\"\nexport { DevPodProvider } from \"./DevPodProvider\"\nexport { useProInstances, ProInstancesProvider, useProInstanceManager } from \"./proInstances\"\nexport { useProvider } from \"./useProvider\"\nexport { useProviders } from \"./useProviders\"\nexport { useProviderManager } from \"./useProviderManager\"\nexport {\n  useWorkspace,\n  useWorkspaces,\n  useAllWorkspaceActions,\n  useWorkspaceActions,\n  startWorkspaceAction,\n} from \"./workspaces\"\nexport {\n  WorkspaceStoreProvider,\n  useWorkspaceStore,\n  WorkspaceStore,\n  ProWorkspaceStore,\n} from \"./workspaceStore\"\nexport {\n  useProHost,\n  ProProvider,\n  ProWorkspaceInstance,\n  useProContext,\n  useProjectClusters,\n  useTemplates,\n} from \"./Pro\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/proInstances/ProInstancesProvider.tsx",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { ReactNode, useMemo } from \"react\"\nimport { client } from \"../../../client\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport { useChangeSettings } from \"../../SettingsContext\"\nimport { REFETCH_INTERVAL_MS } from \"../constants\"\nimport { ProInstancesContext, TProInstancesContext } from \"./context\"\n\nexport function ProInstancesProvider({ children }: Readonly<{ children?: ReactNode }>) {\n  const { set } = useChangeSettings()\n\n  const proInstancesQuery = useQuery({\n    queryKey: QueryKeys.PRO_INSTANCES,\n    queryFn: async () => {\n      const proInstances = (await client.pro.listProInstances({ authenticate: true })).unwrap()\n      if (proInstances !== undefined && proInstances.length > 0) {\n        set(\"experimental_devPodPro\", true)\n      }\n\n      return proInstances\n    },\n    refetchInterval: REFETCH_INTERVAL_MS,\n  })\n\n  const value = useMemo<TProInstancesContext>(\n    () => [\n      proInstancesQuery.data,\n      { status: proInstancesQuery.status, error: proInstancesQuery.error },\n    ],\n    [proInstancesQuery.data, proInstancesQuery.status, proInstancesQuery.error]\n  )\n\n  return <ProInstancesContext.Provider value={value}>{children}</ProInstancesContext.Provider>\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/proInstances/context.ts",
    "content": "import { createContext } from \"react\"\nimport { TProInstances, TQueryResult } from \"../../../types\"\n\nexport type TProInstancesContext = TQueryResult<TProInstances>\nexport const ProInstancesContext = createContext<TProInstancesContext>([\n  [],\n] as unknown as TProInstancesContext)\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/proInstances/index.ts",
    "content": "export { useProInstances } from \"./useProInstances\"\nexport { useProInstanceManager } from \"./useProInstanceManager\"\nexport { ProInstancesProvider } from \"./ProInstancesProvider\"\nexport { ProInstancesContext } from \"./context\"\nexport type { TProInstancesContext } from \"./context\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/proInstances/useProInstanceManager.ts",
    "content": "import { DaemonClient } from \"@/client/pro/client\"\nimport { Err, Failed } from \"@/lib\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { useMemo } from \"react\"\nimport { client } from \"../../../client\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport { TProInstanceLoginConfig, TProInstanceManager, TProvider, TWithProID } from \"../../../types\"\n\nconst FALLBACK_PROVIDER_NAME = \"devpod-pro\"\n\nexport function useProInstanceManager(): TProInstanceManager {\n  const queryClient = useQueryClient()\n  const loginMutation = useMutation<TProvider | undefined, Error, TProInstanceLoginConfig>({\n    mutationFn: async ({ host, accessKey, streamListener }) => {\n      ;(await client.pro.login(host, accessKey, streamListener)).unwrap()\n\n      // if we don't have a provider name, check for the pro instance and then use it's provider name\n      const proInstances = (await client.pro.listProInstances()).unwrap()\n      const maybeNewInstance = proInstances?.find((instance) => instance.host === host)\n      let maybeProviderName = maybeNewInstance?.provider\n\n      if (maybeNewInstance) {\n        const proClient = client.getProClient(maybeNewInstance)\n        if (proClient instanceof DaemonClient) {\n          await proClient.restartDaemon()\n        }\n      }\n      try {\n        const providers = (await client.providers.listAll()).unwrap()\n        if (providers === undefined || Object.keys(providers).length === 0) {\n          throw new Error(\"No providers found\")\n        }\n        if (!maybeProviderName) {\n          maybeProviderName = FALLBACK_PROVIDER_NAME\n        }\n        const maybeProvider = providers[maybeProviderName]\n        if (!maybeProvider) {\n          throw new Error(`Provider ${maybeProviderName} not found`)\n        }\n\n        return maybeProvider\n      } catch (e) {\n        ;(await client.pro.removeProInstance(host)).unwrap()\n\n        throw e\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(QueryKeys.PRO_INSTANCES)\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n    },\n  })\n  const disconnectMutation = useMutation<undefined, Err<Failed>, TWithProID>({\n    mutationFn: async ({ id }) => (await client.pro.removeProInstance(id)).unwrap(),\n    onSuccess: () => {\n      queryClient.invalidateQueries(QueryKeys.PRO_INSTANCES)\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n    },\n  })\n\n  return useMemo(\n    () => ({\n      login: {\n        run: loginMutation.mutate,\n        status: loginMutation.status,\n        error: loginMutation.error,\n        reset: loginMutation.reset,\n        provider: loginMutation.data,\n      },\n      disconnect: {\n        run: disconnectMutation.mutate,\n        status: disconnectMutation.status,\n        error: disconnectMutation.error,\n        target: disconnectMutation.variables,\n      },\n    }),\n    [disconnectMutation, loginMutation]\n  )\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/proInstances/useProInstances.tsx",
    "content": "import { useContext } from \"react\"\nimport { TProInstanceManager } from \"../../../types\"\nimport { useProInstanceManager } from \"./useProInstanceManager\"\nimport { ProInstancesContext, TProInstancesContext } from \"./context\"\n\nexport function useProInstances(): [TProInstancesContext, TProInstanceManager] {\n  const proInstances = useContext(ProInstancesContext)\n  const manager = useProInstanceManager()\n\n  return [proInstances, manager]\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/useProvider.ts",
    "content": "import { TProvider, TProviderID, TProviderManager } from \"../../types\"\nimport { useProviders } from \"./useProviders\"\n\nexport function useProvider(\n  providerID: TProviderID | undefined | null\n): [TProvider | undefined, TProviderManager] {\n  const [[providers], manager] = useProviders()\n\n  return [providerID ? providers?.[providerID] : undefined, manager]\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/useProviderManager.ts",
    "content": "import { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { useMemo } from \"react\"\nimport { client } from \"../../client\"\nimport { exists } from \"../../lib\"\nimport { QueryKeys } from \"../../queryKeys\"\nimport { TProviderManager, TProviders, TWithProviderID } from \"../../types\"\n\nexport function useProviderManager(): TProviderManager {\n  const queryClient = useQueryClient()\n\n  const removeMutation = useMutation({\n    mutationFn: async ({ providerID }: TWithProviderID) =>\n      (await client.providers.remove(providerID)).unwrap(),\n    onMutate({ providerID }) {\n      // Optimistically updates `delete` mutation\n      queryClient.cancelQueries(QueryKeys.PROVIDERS)\n      const oldProviderSnapshot = queryClient.getQueryData<TProviders>(QueryKeys.PROVIDERS)?.[\n        providerID\n      ]\n      queryClient.setQueryData<TProviders>(QueryKeys.PROVIDERS, (current) => {\n        const shallowCopy = { ...current }\n        delete shallowCopy[providerID]\n\n        return shallowCopy\n      })\n\n      return { oldProviderSnapshot }\n    },\n    onError(_, { providerID }, ctx) {\n      const maybeOldProvider = ctx?.oldProviderSnapshot\n      if (exists(maybeOldProvider)) {\n        queryClient.setQueryData<TProviders>(QueryKeys.PROVIDERS, (current) => ({\n          ...current,\n          [providerID]: maybeOldProvider,\n        }))\n      }\n    },\n    onSuccess(_, { providerID }) {\n      queryClient.invalidateQueries(QueryKeys.provider(providerID))\n    },\n  })\n\n  return useMemo(\n    () => ({\n      remove: {\n        run: removeMutation.mutate,\n        status: removeMutation.status,\n        error: removeMutation.error,\n        target: removeMutation.variables,\n      },\n    }),\n    [removeMutation]\n  )\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/useProviders.ts",
    "content": "import { useContext } from \"react\"\nimport { TProviderManager } from \"../../types\"\nimport { DevPodContext, TDevpodContext } from \"./DevPodProvider\"\nimport { useProviderManager } from \"./useProviderManager\"\n\nexport function useProviders(): [TDevpodContext[\"providers\"] | [undefined], TProviderManager] {\n  const providers = useContext(DevPodContext)?.providers ?? [undefined]\n  const manager = useProviderManager()\n\n  return [providers, manager]\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/WorkspaceStoreProvider.tsx",
    "content": "import { ReactNode, useMemo } from \"react\"\nimport { WorkspaceStoreContext } from \"./context\"\nimport { IWorkspaceStore } from \"./workspaceStore\"\n\ntype TWorkspaceStoreProps<TStore> = Readonly<{\n  store: TStore\n  children?: ReactNode\n}>\nexport function WorkspaceStoreProvider<TStore extends IWorkspaceStore<string, any>>({\n  children,\n  store,\n}: TWorkspaceStoreProps<TStore>) {\n  const value = useMemo(() => ({ store }), [store])\n\n  return <WorkspaceStoreContext.Provider value={value}>{children}</WorkspaceStoreContext.Provider>\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/context.ts",
    "content": "import { createContext } from \"react\"\nimport { IWorkspaceStore } from \"./workspaceStore\"\n\nexport type TWorkspaceStoreContext = Readonly<{\n  store: IWorkspaceStore<string, unknown>\n}>\nexport const WorkspaceStoreContext = createContext<TWorkspaceStoreContext>(null!)\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/index.ts",
    "content": "export { WorkspaceStoreProvider } from \"./WorkspaceStoreProvider\"\nexport { useWorkspaceStore } from \"./useWorkspaceStore\"\nexport { WorkspaceStore, ProWorkspaceStore } from \"./workspaceStore\"\nexport type { IWorkspaceStore } from \"./workspaceStore\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/types.ts",
    "content": ""
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/useWorkspaceStore.ts",
    "content": "import { useContext } from \"react\"\nimport { WorkspaceStoreContext } from \"./context\"\nimport { IWorkspaceStore } from \"./workspaceStore\"\n\nexport function useWorkspaceStore<T extends IWorkspaceStore<string, unknown>>() {\n  const { store } = useContext(WorkspaceStoreContext)\n\n  return { store: store as T }\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaceStore/workspaceStore.ts",
    "content": "import { debug, EventManager, SingleEventManager } from \"../../../lib\"\nimport {\n  TProID,\n  TUnsubscribeFn,\n  TWorkspace,\n  TWorkspaceID,\n  TWorkspaceWithoutStatus,\n} from \"../../../types\"\nimport { ProWorkspaceInstance } from \"../Pro\"\nimport { Action, TActionFn, TActionName, TActionObj } from \"../action\"\nimport { ActionHistory } from \"../action/actionHistory\" // This is a workaround for how typescript resolves circular dependencies, usually the import should be from \"./action\"\nimport { replaceEqualDeep } from \"../helpers\"\n\ntype TLastActions = Readonly<{ active: readonly TActionObj[]; history: readonly TActionObj[] }>\ntype TStartActionArgs = Readonly<{\n  actionName: TActionName\n  workspaceKey: TInstanceID\n  actionFn: TActionFn\n}>\n\nexport interface IWorkspaceStore<TKey extends string, TW> {\n  // workspaces\n  get(id: TKey): TW | undefined\n  getAll(): readonly TW[]\n  setWorkspace(id: TKey, newWorkspace: TW): void\n  setWorkspaces(newWorkspaces: readonly TW[]): void\n  removeWorkspace(workspaceKey: TKey): void\n  subscribe(listener: VoidFunction): TUnsubscribeFn\n  setStatus(workspaceKey: TKey, status: string | null | undefined): void\n\n  // workspace actions\n  getAllActions(): TLastActions\n  getCurrentAction(workspaceKey: TKey): TActionObj | undefined\n  getWorkspaceActions(workspaceKey: TKey): TActionObj[]\n  startAction(args: TStartActionArgs): Action[\"id\"]\n}\n\nclass InternalWorkspaceStore<TKey extends string, TWorkspace> {\n  private readonly eventManager = new SingleEventManager<void>()\n  private actionsHistory: ActionHistory\n  private workspaces = new Map<TKey, TWorkspace>()\n  private lastWorkspaces: readonly TWorkspace[] = []\n  private lastActions: TLastActions = { active: [], history: [] }\n\n  constructor(key?: string) {\n    this.actionsHistory = new ActionHistory(key)\n    this.lastActions = this.actionsHistory.getAll()\n  }\n\n  public subscribe(listener: VoidFunction): TUnsubscribeFn {\n    const handler = EventManager.toHandler(listener)\n\n    return this.eventManager.subscribe(handler)\n  }\n\n  public get(key: TKey): TWorkspace | undefined {\n    return this.workspaces.get(key)\n  }\n\n  public getAll(): readonly TWorkspace[] {\n    return this.lastWorkspaces\n  }\n\n  public getWorkspaceActions(workspaceKey: TKey): TActionObj[] {\n    return [\n      ...this.lastActions.active.filter((action) => action.targetID === workspaceKey),\n      ...this.lastActions.history.filter((action) => action.targetID === workspaceKey).reverse(),\n    ]\n  }\n\n  public getCurrentAction(workspaceKey: TKey): TActionObj | undefined {\n    return this.lastActions.active.find((action) => action.targetID === workspaceKey)\n  }\n\n  public getAllActions(): TLastActions {\n    return this.lastActions\n  }\n\n  public removeWorkspace(workspaceKey: TKey): void {\n    this.workspaces.delete(workspaceKey)\n    this.workspacesDidChange()\n  }\n\n  public startAction({ actionName, workspaceKey, actionFn }: TStartActionArgs): Action[\"id\"] {\n    // By default, actions cancel previous actios.\n    // If you need to wait for an action to finish, you can use `getCurrentAction` and wait until it is undefined\n    const maybeCurrentAction = this.actionsHistory.getActive(workspaceKey)\n    if (maybeCurrentAction !== undefined) {\n      maybeCurrentAction.cancel()\n      this.actionsHistory.archive(maybeCurrentAction)\n    }\n\n    const action = new Action(actionName, workspaceKey, actionFn)\n    this.actionsHistory.addActive(workspaceKey, action)\n\n    // Setup listener for when the action is done\n    action.once(() => {\n      // We need to give the UI a chance to listen to the settled state, so we need to inform it about the change once\n      // before and once after archiving the action\n      this.actionDidChange()\n      this.actionsHistory.archive(action)\n      // Notify react on next tick of event loop to check the actions once more.\n      // This ensures we have a chance to move from the `pending` to one of the `settled` states with the UI noticing.\n      setTimeout(() => {\n        this.actionDidChange()\n      }, 0)\n    })\n\n    action.run()\n    this.actionDidChange()\n\n    return action.id\n  }\n\n  public setWorkspaces(newWorkspaces: Map<TKey, TWorkspace>) {\n    this.workspaces = newWorkspaces\n    this.workspacesDidChange()\n  }\n\n  public setWorkspace(id: TKey, newWorkspace: TWorkspace) {\n    this.workspaces.set(id, newWorkspace)\n    this.workspacesDidChange()\n  }\n\n  private actionDidChange() {\n    this.lastActions = this.actionsHistory.getAll()\n    this.eventManager.publish()\n    debug(\"actions\", this.lastActions)\n  }\n\n  private workspacesDidChange() {\n    this.lastWorkspaces = Array.from(this.workspaces.values())\n    this.eventManager.publish()\n    debug(\"workspaces\", this.lastWorkspaces)\n  }\n}\n\nexport class WorkspaceStore implements IWorkspaceStore<TWorkspaceID, TWorkspace> {\n  private store = new InternalWorkspaceStore<TWorkspaceID, TWorkspace>()\n\n  public get(id: TWorkspaceID): TWorkspace | undefined {\n    return this.store.get(id)\n  }\n\n  public getAll(): readonly TWorkspace[] {\n    return this.store.getAll()\n  }\n\n  public setWorkspace(id: TWorkspaceID, newWorkspace: TWorkspace): void {\n    return this.store.setWorkspace(id, newWorkspace)\n  }\n\n  public setWorkspaces(newWorkspaces: readonly TWorkspaceWithoutStatus[]): void {\n    const prevWorkspaces = this.store.getAll().map((workspace) => {\n      // we need to remove `status` before comparing the workspaces because the new ones will not have it.\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      const { status: _, ...w } = workspace\n\n      return w\n    })\n\n    const workspaces = replaceEqualDeep(prevWorkspaces, newWorkspaces)\n\n    if (Object.is(workspaces, prevWorkspaces)) {\n      return\n    }\n\n    const newWorkspacesMap = new Map(\n      workspaces.map((workspace) => {\n        // patch existing status if we have one for this workspace - new ones will be sent without it\n        const maybeExistingWorkspace = this.store.get(workspace.id)\n\n        return [workspace.id, { ...workspace, status: maybeExistingWorkspace?.status }]\n      })\n    )\n    this.store.setWorkspaces(newWorkspacesMap)\n  }\n\n  public removeWorkspace(workspaceID: TWorkspaceID): void {\n    return this.store.removeWorkspace(workspaceID)\n  }\n\n  public subscribe(listener: VoidFunction): TUnsubscribeFn {\n    return this.store.subscribe(listener)\n  }\n\n  public setStatus(workspaceID: TWorkspaceID, status: string | null | undefined): void {\n    const maybeWorkspace = this.store.get(workspaceID)\n    if (maybeWorkspace === undefined) {\n      return\n    }\n\n    const prevStatus = maybeWorkspace.status\n    if (status === prevStatus) {\n      return\n    }\n\n    this.store.setWorkspace(workspaceID, {\n      ...maybeWorkspace,\n      status: status as TWorkspace[\"status\"],\n    })\n  }\n\n  public getAllActions(): TLastActions {\n    return this.store.getAllActions()\n  }\n\n  public getCurrentAction(workspaceID: TWorkspaceID): TActionObj | undefined {\n    return this.store.getCurrentAction(workspaceID)\n  }\n\n  public getWorkspaceActions(workspaceID: TWorkspaceID): TActionObj[] {\n    return this.store.getWorkspaceActions(workspaceID)\n  }\n\n  public startAction(args: TStartActionArgs): Action[\"id\"] {\n    return this.store.startAction(args)\n  }\n}\n\ntype TInstanceID = string\nexport class ProWorkspaceStore implements IWorkspaceStore<TInstanceID, ProWorkspaceInstance> {\n  private store: InternalWorkspaceStore<TInstanceID, ProWorkspaceInstance>\n  constructor(id: TProID) {\n    this.store = new InternalWorkspaceStore<TInstanceID, ProWorkspaceInstance>(id)\n  }\n\n  public get(key: TInstanceID): ProWorkspaceInstance | undefined {\n    return this.store.get(key)\n  }\n\n  public getAll(): readonly ProWorkspaceInstance[] {\n    return this.store.getAll()\n  }\n\n  public setWorkspace(key: TInstanceID, newWorkspace: ProWorkspaceInstance): void {\n    return this.store.setWorkspace(key, newWorkspace)\n  }\n\n  public setWorkspaces(newInstances: readonly ProWorkspaceInstance[]): void {\n    const prevInstances = this.store.getAll()\n\n    const instances = replaceEqualDeep(prevInstances, newInstances)\n\n    if (Object.is(instances, prevInstances)) {\n      return\n    }\n\n    const newWorkspacesMap = new Map(instances.map((instance) => [instance.id, instance]))\n    this.store.setWorkspaces(newWorkspacesMap)\n  }\n\n  public removeWorkspace(workspaceKey: TInstanceID): void {\n    return this.store.removeWorkspace(workspaceKey)\n  }\n\n  public subscribe(listener: VoidFunction): TUnsubscribeFn {\n    return this.store.subscribe(listener)\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  public setStatus(_workspaceKey: TInstanceID, _status: string): void {\n    // noop\n    return\n  }\n\n  public getAllActions(): TLastActions {\n    return this.store.getAllActions()\n  }\n\n  public getCurrentAction(workspaceKey: TInstanceID): TActionObj | undefined {\n    return this.store.getCurrentAction(workspaceKey)\n  }\n\n  public getWorkspaceActions(workspaceKey: TInstanceID): TActionObj[] {\n    return this.store.getWorkspaceActions(workspaceKey)\n  }\n\n  public startAction(args: TStartActionArgs): Action[\"id\"] {\n    return this.store.startAction(args)\n  }\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaces/index.ts",
    "content": "export { usePollWorkspaces } from \"./usePollWorkspaces\"\nexport {\n  useWorkspace,\n  useWorkspaceActions,\n  startWorkspaceAction,\n  stopWorkspaceAction,\n  removeWorkspaceAction,\n} from \"./useWorkspace\"\nexport { useWorkspaces } from \"./useWorkspaces\"\nexport { useAllWorkspaceActions } from \"./useAllWorkspaceActions\"\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaces/useAllWorkspaceActions.ts",
    "content": "import { useCallback, useSyncExternalStore } from \"react\"\nimport { TActionObj } from \"../action\"\nimport { useWorkspaceStore } from \"../workspaceStore\"\n\nexport function useAllWorkspaceActions() {\n  const { store } = useWorkspaceStore()\n  const actions = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => store.getAllActions()\n  )\n\n  return { active: actions.active, history: actions.history.slice().sort(sortByCreationDesc) }\n}\n\nfunction sortByCreationDesc(a: TActionObj, b: TActionObj) {\n  return b.createdAt - a.createdAt\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaces/usePollWorkspaces.ts",
    "content": "import { useCallback, useEffect } from \"react\"\nimport { client } from \"../../../client\"\nimport { TWorkspaceID } from \"../../../types\"\nimport { REFETCH_INTERVAL_MS } from \"../constants\"\nimport { WorkspaceStore, useWorkspaceStore } from \"../workspaceStore\"\n\nexport function usePollWorkspaces() {\n  const { store } = useWorkspaceStore<WorkspaceStore>()\n  const listWorkspaces = useCallback(async () => {\n    const result = await client.workspaces.listAll()\n    if (result.err) {\n      return\n    }\n    store.setWorkspaces(result.val)\n  }, [store])\n\n  const updateStatus = useCallback(\n    async (ongoingRequests: Record<TWorkspaceID, true>) => {\n      for (const workspace of store.getAll()) {\n        // Don't kick off a request if we already have one in flight or if we're executing an action on this workspace\n        const currentAction = store.getCurrentAction(workspace.id)\n        if (ongoingRequests[workspace.id] !== undefined || currentAction != undefined) {\n          continue\n        }\n\n        ongoingRequests[workspace.id] = true\n        try {\n          const result = await client.workspaces.getStatus(workspace.id)\n          if (result.err) {\n            continue\n          }\n          // We don't care about the order here, we just want to update the status\n          // whenever we get a result back\n          store.setStatus(workspace.id, result.val)\n        } finally {\n          delete ongoingRequests[workspace.id]\n        }\n      }\n    },\n    [store]\n  )\n\n  useEffect(() => {\n    const workspacesIntervalID = setInterval(listWorkspaces, REFETCH_INTERVAL_MS)\n\n    const ongoingRequests: Record<TWorkspaceID, true> = {}\n    const statusIntervalID = setInterval(async () => {\n      await updateStatus(ongoingRequests)\n    }, REFETCH_INTERVAL_MS)\n\n    const initialTimeoutID = setTimeout(async () => {\n      await listWorkspaces()\n      await updateStatus(ongoingRequests)\n    }, 0)\n\n    return () => {\n      clearInterval(workspacesIntervalID)\n      clearInterval(statusIntervalID)\n      clearTimeout(initialTimeoutID)\n    }\n  }, [listWorkspaces, updateStatus])\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaces/useWorkspace.ts",
    "content": "import { useCallback, useId, useMemo, useRef, useSyncExternalStore } from \"react\"\nimport { TStreamEventListenerFn, client } from \"../../../client\"\nimport { exists } from \"../../../lib\"\nimport { TIdentifiable, TStreamID, TWorkspaceID, TWorkspaceStartConfig } from \"../../../types\"\nimport { TActionID, TActionObj, useConnectAction, useReplayAction } from \"../action\"\nimport { IWorkspaceStore, ProWorkspaceStore, useWorkspaceStore } from \"../workspaceStore\"\n\nexport type TWorkspaceResult<T> = Readonly<{\n  data: T | undefined\n  isLoading: boolean\n  current:\n    | (TActionObj & Readonly<{ connect: (listener: TStreamEventListenerFn) => void }>)\n    | undefined\n  history: Readonly<{\n    // all: readonly TActionObj[]\n    replay: (actionID: TActionID, listener: TStreamEventListenerFn) => void\n  }>\n  start: (config: TWorkspaceStartConfig, onStream?: TStreamEventListenerFn) => TActionID | undefined\n  create: (\n    config: Omit<TWorkspaceStartConfig, \"sourceConfig\"> &\n      Pick<TWorkspaceStartConfig, \"sourceConfig\"> &\n      Readonly<{ workspaceKey?: string }>,\n    onStream?: TStreamEventListenerFn\n  ) => TActionID\n  stop: (onStream?: TStreamEventListenerFn) => TActionID | undefined\n  remove: (force: boolean, onStream?: TStreamEventListenerFn) => TActionID | undefined\n  rebuild: (onStream?: TStreamEventListenerFn) => TActionID | undefined\n  reset: (onStream?: TStreamEventListenerFn) => TActionID | undefined\n  checkStatus: (onStream?: TStreamEventListenerFn) => TActionID | undefined\n}>\n\nexport function useWorkspaceActions(\n  workspaceID: TWorkspaceID | undefined\n): TActionObj[] | undefined {\n  const { store } = useWorkspaceStore()\n  const dataCache = useRef<TActionObj[]>()\n  const data = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => {\n      if (workspaceID === undefined) {\n        return undefined\n      }\n\n      // It's okay to use sort directly here because the store always returns a new array\n      const workspaceActions = store.getWorkspaceActions(workspaceID).sort((a, b) => {\n        if (a.finishedAt && b.finishedAt) {\n          return b.finishedAt - a.finishedAt\n        }\n\n        return b.createdAt - a.createdAt\n      })\n      if (!dataCache.current || dataCache.current.length !== workspaceActions.length) {\n        dataCache.current = workspaceActions\n\n        return dataCache.current\n      }\n\n      // compare actions\n      const diff = dataCache.current.filter(\n        (action) => !workspaceActions.find((workspaceAction) => action.id === workspaceAction.id)\n      )\n      if (diff.length > 0) {\n        dataCache.current = workspaceActions\n\n        return dataCache.current\n      }\n\n      return dataCache.current\n    }\n  )\n\n  return data\n}\n\nexport function useWorkspace<TW extends TIdentifiable>(\n  workspaceKey: string | undefined\n): TWorkspaceResult<TW> {\n  const { store } = useWorkspaceStore<IWorkspaceStore<string, TW>>()\n  const viewID = useId()\n  const data = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => (workspaceKey !== undefined ? store.get(workspaceKey) : undefined)\n  )\n  const workspaceID = useMemo(() => {\n    if (!data) {\n      return undefined\n    }\n\n    return data.id\n  }, [data])\n\n  const create = useCallback<TWorkspaceResult<TW>[\"create\"]>(\n    (config, onStream) => {\n      return store.startAction({\n        actionName: \"start\",\n        workspaceKey: config.workspaceKey ?? config.id,\n        actionFn: async (ctx) => {\n          const result = await client.workspaces.start(config, onStream, {\n            id: config.id,\n            actionID: ctx.id,\n            streamID: viewID,\n          })\n          if (result.err) {\n            return result\n          }\n          store.setStatus(config.id, result.val)\n\n          return result\n        },\n      })\n    },\n    [store, viewID]\n  )\n\n  const start = useCallback<TWorkspaceResult<TW>[\"start\"]>(\n    (config, onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return startWorkspaceAction({ workspaceID, config, onStream, streamID: viewID, store })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const checkStatus = useCallback<TWorkspaceResult<TW>[\"checkStatus\"]>(\n    (onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return store.startAction({\n        actionName: \"checkStatus\",\n        workspaceKey: workspaceID,\n        actionFn: async (ctx) => {\n          const result = await client.workspaces.checkStatus(onStream, {\n            id: workspaceID,\n            actionID: ctx.id,\n            streamID: viewID,\n          })\n          if (result.err) {\n            return result\n          }\n          store.setStatus(workspaceID, result.val)\n\n          return result\n        },\n      })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const stop = useCallback<TWorkspaceResult<TW>[\"stop\"]>(\n    (onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return stopWorkspaceAction({ workspaceID, onStream, streamID: viewID, store })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const rebuild = useCallback<TWorkspaceResult<TW>[\"rebuild\"]>(\n    (onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return store.startAction({\n        actionName: \"rebuild\",\n        workspaceKey: workspaceID,\n        actionFn: async (ctx) => {\n          const result = await client.workspaces.rebuild(onStream, {\n            id: workspaceID,\n            actionID: ctx.id,\n            streamID: viewID,\n          })\n          if (result.err) {\n            return result\n          }\n          store.setStatus(workspaceID, result.val)\n\n          return result\n        },\n      })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const reset = useCallback<TWorkspaceResult<TW>[\"reset\"]>(\n    (onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return store.startAction({\n        actionName: \"reset\",\n        workspaceKey: workspaceID,\n        actionFn: async (ctx) => {\n          const result = await client.workspaces.reset(onStream, {\n            id: workspaceID,\n            actionID: ctx.id,\n            streamID: viewID,\n          })\n          if (result.err) {\n            return result\n          }\n          store.setStatus(workspaceID, result.val)\n\n          return result\n        },\n      })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const remove = useCallback<TWorkspaceResult<TW>[\"remove\"]>(\n    (force, onStream) => {\n      if (workspaceID === undefined) {\n        return\n      }\n\n      return removeWorkspaceAction({ force, workspaceID, onStream, streamID: viewID, store })\n    },\n    [store, viewID, workspaceID]\n  )\n\n  const currentAction = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => (workspaceID !== undefined ? store.getCurrentAction(workspaceID) : undefined)\n  )\n  const isLoading = useMemo(() => exists(currentAction), [currentAction])\n\n  const connect = useConnectAction(currentAction, viewID)\n  const current = useMemo<TWorkspaceResult<TW>[\"current\"]>(() => {\n    if (currentAction === undefined) {\n      return undefined\n    }\n\n    return {\n      ...currentAction,\n      connect,\n    }\n  }, [currentAction, connect])\n\n  const replay = useReplayAction()\n  const history = useMemo<TWorkspaceResult<TW>[\"history\"]>(() => {\n    return { replay }\n  }, [replay])\n\n  return useMemo(\n    () => ({\n      data,\n      isLoading,\n      current,\n      history,\n      create,\n      start,\n      stop,\n      rebuild,\n      reset,\n      remove,\n      checkStatus,\n    }),\n    [data, isLoading, current, history, create, start, stop, rebuild, reset, remove, checkStatus]\n  )\n}\n\ntype TStartWorkspaceActionArgs = Readonly<{\n  config: TWorkspaceStartConfig\n  onStream?: TStreamEventListenerFn\n  workspaceID: TWorkspaceID\n  streamID: TStreamID\n  store: IWorkspaceStore<string, unknown>\n}>\nexport function startWorkspaceAction({\n  workspaceID,\n  streamID,\n  config,\n  onStream,\n  store,\n}: TStartWorkspaceActionArgs): TActionObj[\"id\"] {\n  return store.startAction({\n    actionName: \"start\",\n    workspaceKey: workspaceID,\n    actionFn: async (ctx) => {\n      const result = await client.workspaces.start(config, onStream, {\n        id: workspaceID,\n        actionID: ctx.id,\n        streamID,\n      })\n      if (result.err) {\n        return result\n      }\n      store.setStatus(workspaceID, result.val)\n\n      return result\n    },\n  })\n}\n\ntype TStopWorkspaceActionArgs = Readonly<{\n  onStream?: TStreamEventListenerFn\n  workspaceID: TWorkspaceID\n  streamID: TStreamID\n  store: IWorkspaceStore<string, unknown>\n}>\nexport function stopWorkspaceAction({\n  workspaceID,\n  onStream,\n  streamID,\n  store,\n}: TStopWorkspaceActionArgs): TActionObj[\"id\"] {\n  return store.startAction({\n    actionName: \"stop\",\n    workspaceKey: workspaceID,\n    actionFn: async (ctx) => {\n      const result = await client.workspaces.stop(onStream, {\n        id: workspaceID,\n        actionID: ctx.id,\n        streamID,\n      })\n      if (result.err) {\n        return result\n      }\n      store.setStatus(workspaceID, result.val)\n\n      return result\n    },\n  })\n}\n\ntype TRemoveWorkspaceActionArgs = Readonly<{\n  onStream?: TStreamEventListenerFn\n  workspaceID: TWorkspaceID\n  streamID: TStreamID\n  force: boolean\n  store: IWorkspaceStore<string, unknown>\n}>\nexport function removeWorkspaceAction({\n  workspaceID,\n  onStream,\n  streamID,\n  force,\n  store,\n}: TRemoveWorkspaceActionArgs): TActionObj[\"id\"] {\n  return store.startAction({\n    actionName: \"remove\",\n    workspaceKey: workspaceID,\n    actionFn: async (ctx) => {\n      const result = await client.workspaces.remove(force, onStream, {\n        id: workspaceID,\n        actionID: ctx.id,\n        streamID,\n      })\n      if (result.err) {\n        return result\n      }\n      // Pro Desktop app will get updates through watcher, no need to remove from local store\n      if (store instanceof ProWorkspaceStore) {\n        return result\n      }\n\n      store.removeWorkspace(workspaceID)\n\n      return result\n    },\n  })\n}\n"
  },
  {
    "path": "desktop/src/contexts/DevPodContext/workspaces/useWorkspaces.ts",
    "content": "import { useCallback, useSyncExternalStore } from \"react\"\nimport { IWorkspaceStore, useWorkspaceStore } from \"../workspaceStore\"\n\nexport function useWorkspaces<TW>(): readonly TW[] {\n  const { store } = useWorkspaceStore<IWorkspaceStore<string, TW>>()\n  const workspaces = useSyncExternalStore(\n    useCallback((listener) => store.subscribe(listener), [store]),\n    () => store.getAll()\n  )\n\n  return workspaces\n}\n"
  },
  {
    "path": "desktop/src/contexts/SettingsContext/SettingsContext.tsx",
    "content": "import { ReactNode, useCallback, useEffect, useMemo, useState } from \"react\"\nimport { client } from \"@/client\"\nimport { getKeys, LocalStorageToFileMigrationBackend, Store } from \"@/lib\"\nimport { TUnsubscribeFn } from \"@/types\"\nimport { TSetting, TSettings, TSettingsContext, SettingsContext } from \"./useSettings\"\n\nconst initialSettings: TSettings = {\n  sidebarPosition: \"left\",\n  debugFlag: false,\n  partyParrot: false,\n  fixedIDE: false,\n  zoom: \"md\",\n  transparency: false,\n  autoUpdate: true,\n  additionalCliFlags: \"\",\n  additionalEnvVars: \"\",\n  dotfilesUrl: \"\",\n  sshKeyPath: \"\",\n  httpProxyUrl: \"\",\n  httpsProxyUrl: \"\",\n  noProxy: \"\",\n\n  experimental_colorMode: \"light\",\n  experimental_multiDevcontainer: false,\n  experimental_fleet: true,\n  experimental_jupyterNotebooks: true,\n  experimental_vscodeInsiders: true,\n  experimental_cursor: true,\n  experimental_positron: true,\n  experimental_zed: true,\n  experimental_codium: true,\n  experimental_rstudio: true,\n  experimental_windsurf: true,\n  experimental_devPodPro: false,\n}\nfunction getSettingKeys(): readonly TSetting[] {\n  return getKeys(initialSettings)\n}\n\n// WARN: needs to match the filename on the rust side\nconst SETTING_STORE_KEY = \"settings\"\nconst settingsStore = new Store<Record<TSetting, string | boolean | unknown>>(\n  new LocalStorageToFileMigrationBackend(SETTING_STORE_KEY)\n)\n\nexport function SettingsProvider({ children }: Readonly<{ children?: ReactNode }>) {\n  const [settings, setSettings] = useState(initialSettings)\n\n  useEffect(() => {\n    ;(async () => {\n      const initialOptions = await Promise.all(\n        getSettingKeys().map((option) =>\n          settingsStore\n            .get(option)\n            .then((value) => [option, value ?? initialSettings[option]] as const)\n            .catch(() => [option, false] as const)\n        )\n      )\n      setSettings(\n        initialOptions.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), initialSettings)\n      )\n    })()\n  }, [])\n\n  useEffect(() => {\n    const subscriptions: TUnsubscribeFn[] = []\n\n    for (const setting of getSettingKeys()) {\n      subscriptions.push(\n        settingsStore.subscribe(setting, (newValue) =>\n          setSettings((current) => ({ ...current, [setting]: newValue }))\n        )\n      )\n    }\n\n    return () => {\n      for (const unsubscribe of subscriptions) {\n        unsubscribe()\n      }\n    }\n  }, [])\n\n  useEffect(() => {\n    client.setSetting(\"debugFlag\", settings.debugFlag)\n  }, [settings.debugFlag])\n\n  useEffect(() => {\n    client.setSetting(\"additionalCliFlags\", settings.additionalCliFlags)\n  }, [settings.additionalCliFlags])\n\n  useEffect(() => {\n    client.setSetting(\"dotfilesUrl\", settings.dotfilesUrl)\n  }, [settings.dotfilesUrl])\n\n  useEffect(() => {\n    client.setSetting(\"additionalEnvVars\", settings.additionalEnvVars)\n  }, [settings.additionalEnvVars])\n\n  useEffect(() => {\n    client.setSetting(\"httpProxyUrl\", settings.httpProxyUrl)\n    client.setSetting(\"httpsProxyUrl\", settings.httpsProxyUrl)\n    client.setSetting(\"noProxy\", settings.noProxy)\n  }, [settings.httpProxyUrl, settings.httpsProxyUrl, settings.noProxy])\n\n  const set = useCallback<TSettingsContext[\"set\"]>((key, value) => {\n    settingsStore.set(key, value)\n  }, [])\n\n  const value = useMemo(() => ({ settings, set }), [set, settings])\n\n  return <SettingsContext.Provider value={value}>{children}</SettingsContext.Provider>\n}\n"
  },
  {
    "path": "desktop/src/contexts/SettingsContext/index.ts",
    "content": "export { useSettings, useChangeSettings } from \"./useSettings\"\nexport { SettingsProvider } from \"./SettingsContext\"\nexport type { TSettingsContext, TSettings } from \"./useSettings\"\n"
  },
  {
    "path": "desktop/src/contexts/SettingsContext/useSettings.ts",
    "content": "import { createContext, useContext } from \"react\"\nimport { Settings } from \"@/gen\"\n\nexport type TSettings = Settings\nexport type TSetting = keyof TSettings\n\nexport type TSettingsContext = Readonly<{\n  settings: TSettings\n  set<TKey extends keyof TSettings>(setting: TKey, value: TSettings[TKey]): void\n}>\n\nexport const SettingsContext = createContext<TSettingsContext>(null!)\nexport function useSettings() {\n  return useContext(SettingsContext).settings\n}\n\nexport function useChangeSettings() {\n  return useContext(SettingsContext)\n}\n"
  },
  {
    "path": "desktop/src/contexts/ToolbarContext/ToolbarContext.tsx",
    "content": "import { ReactNode, useCallback, useMemo, useState } from \"react\"\nimport { TToolbarAction, TToolbarContext, ToolbarContext } from \"./useToolbar\"\n\nexport function ToolbarProvider({ children }: Readonly<{ children: ReactNode }>) {\n  const [title, setTitle] = useState<ReactNode>(null)\n  const [actions, setActions] = useState<readonly TToolbarAction[]>([])\n  const addAction = useCallback<TToolbarContext[\"addAction\"]>((id, node) => {\n    setActions((actions) => {\n      const newActions = actions.slice()\n      const index = newActions.findIndex((a) => a.id === id)\n      if (index !== -1) {\n        newActions.splice(index, 1, { id, node: node })\n      } else {\n        newActions.push({ id, node: node })\n      }\n\n      return newActions\n    })\n\n    return () => {\n      setActions((actions) => actions.filter((a) => a.id !== id))\n    }\n  }, [])\n  const value = useMemo(\n    () => ({ title, setTitle, actions: actions.map((a) => a.node), addAction }),\n    [title, actions, addAction]\n  )\n\n  return <ToolbarContext.Provider value={value}>{children}</ToolbarContext.Provider>\n}\n"
  },
  {
    "path": "desktop/src/contexts/ToolbarContext/index.ts",
    "content": "export * from \"./ToolbarContext\"\nexport { useToolbar } from \"./useToolbar\"\n"
  },
  {
    "path": "desktop/src/contexts/ToolbarContext/useToolbar.ts",
    "content": "import { ReactNode, createContext, useContext } from \"react\"\n\nexport type TToolbarContext = Readonly<{\n  title: ReactNode\n  setTitle: (title: ReactNode) => void\n  actions: readonly ReactNode[]\n  addAction: (id: string, action: ReactNode) => void\n}>\nexport type TToolbarAction = Readonly<{\n  id: string\n  node: ReactNode\n}>\nexport const ToolbarContext = createContext<TToolbarContext>(null!)\nexport function useToolbar() {\n  return useContext(ToolbarContext)\n}\n"
  },
  {
    "path": "desktop/src/contexts/index.ts",
    "content": "export * from \"./DevPodContext\"\nexport * from \"./ToolbarContext\"\nexport { SettingsProvider, useSettings, useChangeSettings } from \"./SettingsContext\"\nexport type { TSettings } from \"./SettingsContext\"\n"
  },
  {
    "path": "desktop/src/gen/Asset.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport interface Asset {\n  url: string\n  browser_download_url: string\n  id: bigint\n  node_id: string\n  name: string\n  label: string | null\n  state: string\n  content_type: string\n  size: bigint\n  download_count: bigint\n  created_at: string\n  updated_at: string\n}\n"
  },
  {
    "path": "desktop/src/gen/Author.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport interface Author {\n  login: string\n  id: bigint\n  node_id: string\n  avatar_url: String\n  gravatar_id: string\n  url: string\n  html_url: string\n  followers_url: string\n  following_url: string\n  gists_url: string\n  starred_url: string\n  subscriptions_url: string\n  organizations_url: string\n  repos_url: string\n  events_url: string\n  received_events_url: string\n  type: string\n  site_admin: boolean\n}\n"
  },
  {
    "path": "desktop/src/gen/ColorMode.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport type ColorMode = \"dark\" | \"light\"\n"
  },
  {
    "path": "desktop/src/gen/DaemonState.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport type DaemonState = \"stopped\" | \"pending\" | \"running\"\n"
  },
  {
    "path": "desktop/src/gen/DaemonStatus.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\nimport type { DaemonState } from \"./DaemonState\"\n\nexport interface DaemonStatus {\n  state: DaemonState\n  online: boolean\n  loginRequired: boolean\n}\n"
  },
  {
    "path": "desktop/src/gen/Release.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\nimport type { Asset } from \"./Asset\"\nimport type { Author } from \"./Author\"\n\nexport interface Release {\n  url: String\n  html_url: string\n  assets_url: string\n  upload_url: string\n  tarball_url: string | null\n  zipball_url: string | null\n  id: bigint\n  node_id: string\n  tag_name: string\n  target_commitish: string\n  name: string | null\n  body: string | null\n  draft: boolean\n  prerelease: boolean\n  created_at: string | null\n  published_at: string | null\n  author: Author\n  assets: Array<Asset>\n}\n"
  },
  {
    "path": "desktop/src/gen/Settings.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\nimport type { ColorMode } from \"./ColorMode\"\nimport type { SidebarPosition } from \"./SidebarPosition\"\nimport type { Zoom } from \"./Zoom\"\n\nexport interface Settings {\n  sidebarPosition: SidebarPosition\n  debugFlag: boolean\n  partyParrot: boolean\n  fixedIDE: boolean\n  zoom: Zoom\n  transparency: boolean\n  autoUpdate: boolean\n  additionalCliFlags: string\n  additionalEnvVars: string\n  dotfilesUrl: string\n  sshKeyPath: string\n  httpProxyUrl: string\n  httpsProxyUrl: string\n  noProxy: string\n  experimental_multiDevcontainer: boolean\n  experimental_fleet: boolean\n  experimental_jupyterNotebooks: boolean\n  experimental_vscodeInsiders: boolean\n  experimental_cursor: boolean\n  experimental_codium: boolean\n  experimental_zed: boolean\n  experimental_positron: boolean\n  experimental_rstudio: boolean\n  experimental_windsurf: boolean\n  experimental_devPodPro: boolean\n  experimental_colorMode: ColorMode\n}\n"
  },
  {
    "path": "desktop/src/gen/SidebarPosition.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport type SidebarPosition = \"left\" | \"right\"\n"
  },
  {
    "path": "desktop/src/gen/Zoom.ts",
    "content": "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n\nexport type Zoom = \"sm\" | \"md\" | \"lg\" | \"xl\"\n"
  },
  {
    "path": "desktop/src/gen/index.ts",
    "content": "export * from \"./Asset\"\nexport * from \"./Author\"\nexport * from \"./ColorMode\"\nexport * from \"./DaemonState\"\nexport * from \"./DaemonStatus\"\nexport * from \"./Release\"\nexport * from \"./Settings\"\nexport * from \"./SidebarPosition\"\nexport * from \"./Zoom\"\nexport * from \"./index\"\n"
  },
  {
    "path": "desktop/src/icons/ArrowCycle.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ArrowCycle = createIcon({\n  displayName: \"ArrowCycle\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      d=\"M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ArrowDown.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ArrowDown = createIcon({\n  displayName: \"ArrowDown\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M13.4692 7.27031H12.2036C12.1317 7.27031 12.063 7.30156 12.0145 7.35625L8.59423 11.2984V2.5C8.59423 2.43125 8.53798 2.375 8.46923 2.375H7.53173C7.46298 2.375 7.40673 2.43125 7.40673 2.5V11.2984L3.98641 7.35625C3.93954 7.30156 3.87079 7.27031 3.79735 7.27031H2.53173C2.42548 7.27031 2.36766 7.39687 2.43798 7.47656L7.62391 13.4531C7.67079 13.5072 7.72875 13.5506 7.79385 13.5803C7.85896 13.61 7.92969 13.6254 8.00126 13.6254C8.07283 13.6254 8.14356 13.61 8.20866 13.5803C8.27377 13.5506 8.33172 13.5072 8.3786 13.4531L13.563 7.47656C13.6333 7.39531 13.5755 7.27031 13.4692 7.27031Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ArrowLeft.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ArrowLeft = createIcon({\n  displayName: \"ArrowLeft\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M15 10a.75.75 0 01-.75.75H7.612l2.158 1.96a.75.75 0 11-1.04 1.08l-3.5-3.25a.75.75 0 010-1.08l3.5-3.25a.75.75 0 111.04 1.08L7.612 9.25h6.638A.75.75 0 0115 10z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ArrowPath.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ArrowPath = createIcon({\n  displayName: \"ArrowPath\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ArrowUp.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ArrowUp = createIcon({\n  displayName: \"ArrowUp\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M13.5619 8.52283L8.37594 2.54626C8.32906 2.49218 8.2711 2.44881 8.206 2.41909C8.1409 2.38936 8.07016 2.37398 7.99859 2.37398C7.92702 2.37398 7.85629 2.38936 7.79119 2.41909C7.72608 2.44881 7.66813 2.49218 7.62125 2.54626L2.43687 8.52283C2.42121 8.54084 2.41105 8.56298 2.40761 8.5866C2.40417 8.61023 2.40759 8.63434 2.41747 8.65608C2.42735 8.67781 2.44327 8.69625 2.46333 8.70919C2.48339 8.72213 2.50675 8.72903 2.53062 8.72908H3.79625C3.86812 8.72908 3.93687 8.69783 3.98531 8.64314L7.40562 4.70095V13.4994C7.40562 13.5681 7.46187 13.6244 7.53062 13.6244H8.46812C8.53687 13.6244 8.59312 13.5681 8.59312 13.4994V4.70095L12.0134 8.64314C12.0603 8.69783 12.1291 8.72908 12.2025 8.72908H13.4681C13.5744 8.72908 13.6322 8.60408 13.5619 8.52283Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Bell.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Bell = createIcon({\n  displayName: \"Bell\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M10 2a6 6 0 00-6 6c0 1.887-.454 3.665-1.257 5.234a.75.75 0 00.515 1.076 32.91 32.91 0 003.256.508 3.5 3.5 0 006.972 0 32.903 32.903 0 003.256-.508.75.75 0 00.515-1.076A11.448 11.448 0 0116 8a6 6 0 00-6-6zM8.05 14.943a33.54 33.54 0 003.9 0 2 2 0 01-3.9 0z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/BellDuotone.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const BellDuotone = createIcon({\n  displayName: \"BellDuotone\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      opacity=\"0.1\"\n      d=\"M8 3.43699C7.13125 3.43699 6.31562 3.77449 5.70156 4.38856C5.0875 5.00262 4.75 5.81824 4.75 6.68699V11.9995H11.25V6.68699C11.25 5.81824 10.9125 5.00262 10.2984 4.38856C9.68437 3.77449 8.86875 3.43699 8 3.43699ZM12.375 6.68699C12.375 4.48231 10.7453 2.65887 8.625 2.35574V2.35731C10.7453 2.66043 12.375 4.48231 12.375 6.68699ZM7.375 2.35731V2.35574C5.25469 2.65887 3.625 4.48231 3.625 6.68699C3.625 4.48231 5.25469 2.66043 7.375 2.35731Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M12.75 12H12.375V6.6875C12.375 4.48281 10.7453 2.66094 8.625 2.35781V1.75C8.625 1.40469 8.34531 1.125 8 1.125C7.65469 1.125 7.375 1.40469 7.375 1.75V2.35781C5.25469 2.66094 3.625 4.48281 3.625 6.6875V12H3.25C2.97344 12 2.75 12.2234 2.75 12.5V13C2.75 13.0688 2.80625 13.125 2.875 13.125H6.25C6.25 14.0906 7.03438 14.875 8 14.875C8.96562 14.875 9.75 14.0906 9.75 13.125H13.125C13.1938 13.125 13.25 13.0688 13.25 13V12.5C13.25 12.2234 13.0266 12 12.75 12ZM8 13.875C7.58594 13.875 7.25 13.5391 7.25 13.125H8.75C8.75 13.5391 8.41406 13.875 8 13.875ZM11.25 12H4.75V6.6875C4.75 5.81875 5.0875 5.00312 5.70156 4.38906C6.31562 3.775 7.13125 3.4375 8 3.4375C8.86875 3.4375 9.68437 3.775 10.2984 4.38906C10.9125 5.00312 11.25 5.81875 11.25 6.6875V12Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Briefcase.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Briefcase = createIcon({\n  displayName: \"Briefcase\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      fillRule=\"evenodd\"\n      d=\"M6 3.75A2.75 2.75 0 018.75 1h2.5A2.75 2.75 0 0114 3.75v.443c.572.055 1.14.122 1.706.2C17.053 4.582 18 5.75 18 7.07v3.469c0 1.126-.694 2.191-1.83 2.54-1.952.599-4.024.921-6.17.921s-4.219-.322-6.17-.921C2.694 12.73 2 11.665 2 10.539V7.07c0-1.321.947-2.489 2.294-2.676A41.047 41.047 0 016 4.193V3.75zm6.5 0v.325a41.622 41.622 0 00-5 0V3.75c0-.69.56-1.25 1.25-1.25h2.5c.69 0 1.25.56 1.25 1.25zM10 10a1 1 0 00-1 1v.01a1 1 0 001 1h.01a1 1 0 001-1V11a1 1 0 00-1-1H10z\"\n      clipRule=\"evenodd\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M3 15.055v-.684c.126.053.255.1.39.142 2.092.642 4.313.987 6.61.987 2.297 0 4.518-.345 6.61-.987.135-.041.264-.089.39-.142v.684c0 1.347-.985 2.53-2.363 2.686a41.454 41.454 0 01-9.274 0C3.985 17.585 3 16.402 3 15.055z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/CPU.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CPU = createIcon({\n  displayName: \"CPU\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      fillRule=\"evenodd\"\n      clipRule=\"evenodd\"\n      d=\"M17.5 6.50012H6.5V17.5001H17.5V6.50012ZM6.5 5.00012C5.67157 5.00012 5 5.67169 5 6.50012V17.5001C5 18.3285 5.67157 19.0001 6.5 19.0001H17.5C18.3284 19.0001 19 18.3285 19 17.5001V6.50012C19 5.67169 18.3284 5.00012 17.5 5.00012H6.5Z\"\n    />,\n    <path d=\"M1 8.00012H5V10.0001H1V8.00012Z\" />,\n    <path d=\"M1 14.0001H5V16.0001H1V14.0001Z\" />,\n    <path d=\"M19 8.00012H23V10.0001H19V8.00012Z\" />,\n    <path d=\"M19 14.0001H23V16.0001H19V14.0001Z\" />,\n    <path\n      fillRule=\"evenodd\"\n      clipRule=\"evenodd\"\n      d=\"M10.5 12.0001C10.5 12.8285 11.1716 13.5001 12 13.5001C12.8284 13.5001 13.5 12.8285 13.5 12.0001C13.5 11.1717 12.8284 10.5001 12 10.5001C11.1716 10.5001 10.5 11.1717 10.5 12.0001ZM12 9.00012C10.3431 9.00012 9 10.3433 9 12.0001C9 13.657 10.3431 15.0001 12 15.0001C13.6569 15.0001 15 13.657 15 12.0001C15 10.3433 13.6569 9.00012 12 9.00012Z\"\n    />,\n    <path d=\"M10 1.00012L10 5.00012L8 5.00012L8 1.00012L10 1.00012Z\" />,\n    <path d=\"M16 1.00012L16 5.00012L14 5.00012L14 1.00012L16 1.00012Z\" />,\n    <path d=\"M10 19.0001L10 23.0001L8 23.0001L8 19.0001L10 19.0001Z\" />,\n    <path d=\"M16 19.0001L16 23.0001L14 23.0001L14 19.0001L16 19.0001Z\" />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/CheckCircle.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CheckCircle = createIcon({\n  displayName: \"CheckCircle\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/CircleDuotone.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CircleDuotone = createIcon({\n  displayName: \"CircleDuotone\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <circle\n      fill=\"currentColor\"\n      fillOpacity={0.4}\n      stroke=\"currentColor\"\n      cx=\"8\"\n      cy=\"8\"\n      r=\"6\"\n      strokeWidth=\"1.5\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/CircleWithArrow.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CircleWithArrow = createIcon({\n  displayName: \"CircleWithArrow\",\n  viewBox: \"0 0 16 17\",\n  defaultProps,\n  path: (\n    <path d=\"M13.562 11.937h-1.098a.246.246 0 0 0-.193.09 5.53 5.53 0 0 1-4.266 2.003 5.512 5.512 0 0 1-3.915-1.62 5.52 5.52 0 0 1-1.187-1.758A5.477 5.477 0 0 1 2.468 8.5 5.505 5.505 0 0 1 4.09 4.59a5.529 5.529 0 0 1 3.916-1.621 5.53 5.53 0 0 1 4.266 2.003c.046.058.118.09.192.09h1.098c.098 0 .16-.109.105-.192A6.722 6.722 0 0 0 7.989 1.78 6.711 6.711 0 0 0 1.28 8.568a6.723 6.723 0 0 0 6.725 6.65 6.723 6.723 0 0 0 5.66-3.09.125.125 0 0 0-.104-.191Zm1.39-3.536-2.218-1.75a.125.125 0 0 0-.203.098v1.188H7.624a.125.125 0 0 0-.125.125v.875c0 .068.057.125.125.125h4.907v1.187c0 .105.122.164.203.098l2.217-1.75a.125.125 0 0 0 0-.196Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Clock.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Clock = createIcon({\n  displayName: \"Clock\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M8 0.999985C4.13438 0.999985 1 4.13436 1 7.99998C1 11.8656 4.13438 15 8 15C11.8656 15 15 11.8656 15 7.99998C15 4.13436 11.8656 0.999985 8 0.999985ZM8 13.8125C4.79063 13.8125 2.1875 11.2094 2.1875 7.99998C2.1875 4.79061 4.79063 2.18748 8 2.18748C11.2094 2.18748 13.8125 4.79061 13.8125 7.99998C13.8125 11.2094 11.2094 13.8125 8 13.8125Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M10.7297 9.97809L8.50156 8.36716V4.49998C8.50156 4.43123 8.44531 4.37498 8.37656 4.37498H7.625C7.55625 4.37498 7.5 4.43123 7.5 4.49998V8.8031C7.5 8.84372 7.51875 8.88122 7.55156 8.90466L10.1359 10.789C10.1922 10.8297 10.2703 10.8172 10.3109 10.7625L10.7578 10.1531C10.7984 10.0953 10.7859 10.0172 10.7297 9.97809Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Close.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Close = createIcon({\n  displayName: \"Close\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M10.8386 5.40978C10.8386 5.33776 10.7797 5.27883 10.7077 5.27883L9.62733 5.28374L8.00025 7.22347L6.37481 5.28538L5.29282 5.28047C5.2208 5.28047 5.16187 5.33776 5.16187 5.41142C5.16187 5.44252 5.17333 5.47199 5.19297 5.49654L7.32257 8.03374L5.19297 10.5693C5.17319 10.5933 5.16221 10.6233 5.16187 10.6544C5.16187 10.7265 5.2208 10.7854 5.29282 10.7854L6.37481 10.7805L8.00025 8.84074L9.62569 10.7788L10.706 10.7837C10.7781 10.7837 10.837 10.7265 10.837 10.6528C10.837 10.6217 10.8255 10.5922 10.8059 10.5677L8.67956 8.03211L10.8092 5.4949C10.8288 5.47199 10.8386 5.44088 10.8386 5.40978Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M7.99999 0.666575C3.95029 0.666575 0.666656 3.95021 0.666656 7.99991C0.666656 12.0496 3.95029 15.3332 7.99999 15.3332C12.0497 15.3332 15.3333 12.0496 15.3333 7.99991C15.3333 3.95021 12.0497 0.666575 7.99999 0.666575ZM7.99999 14.0892C4.63779 14.0892 1.9107 11.3621 1.9107 7.99991C1.9107 4.63771 4.63779 1.91062 7.99999 1.91062C11.3622 1.91062 14.0893 4.63771 14.0893 7.99991C14.0893 11.3621 11.3622 14.0892 7.99999 14.0892Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Code.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Code = createIcon({\n  displayName: \"Code\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      clipRule=\"evenodd\"\n      d=\"M9.49519 2.02006C9.85238 2.10936 10.0696 2.47132 9.98026 2.82851L7.31359 13.4952C7.22429 13.8524 6.86234 14.0696 6.50514 13.9803C6.14794 13.891 5.93077 13.529 6.02007 13.1718L8.68673 2.50513C8.77603 2.14794 9.13799 1.93076 9.49519 2.02006ZM5.13823 4.86209C5.39858 5.12244 5.39858 5.54455 5.13823 5.8049L2.94297 8.00016L5.13823 10.1954C5.39858 10.4558 5.39858 10.8779 5.13823 11.1382C4.87788 11.3986 4.45577 11.3986 4.19543 11.1382L1.52876 8.47156C1.26841 8.21121 1.26841 7.7891 1.52876 7.52875L4.19543 4.86209C4.45577 4.60174 4.87788 4.60174 5.13823 4.86209ZM10.8621 4.86209C11.1224 4.60174 11.5446 4.60174 11.8049 4.86209L14.4716 7.52875C14.7319 7.7891 14.7319 8.21121 14.4716 8.47156L11.8049 11.1382C11.5446 11.3986 11.1224 11.3986 10.8621 11.1382C10.6017 10.8779 10.6017 10.4558 10.8621 10.1954L13.0574 8.00016L10.8621 5.8049C10.6017 5.54455 10.6017 5.12244 10.8621 4.86209Z\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Cog.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Cog = createIcon({\n  displayName: \"Cog\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M7.84 1.804A1 1 0 018.82 1h2.36a1 1 0 01.98.804l.331 1.652a6.993 6.993 0 011.929 1.115l1.598-.54a1 1 0 011.186.447l1.18 2.044a1 1 0 01-.205 1.251l-1.267 1.113a7.047 7.047 0 010 2.228l1.267 1.113a1 1 0 01.206 1.25l-1.18 2.045a1 1 0 01-1.187.447l-1.598-.54a6.993 6.993 0 01-1.929 1.115l-.33 1.652a1 1 0 01-.98.804H8.82a1 1 0 01-.98-.804l-.331-1.652a6.993 6.993 0 01-1.929-1.115l-1.598.54a1 1 0 01-1.186-.447l-1.18-2.044a1 1 0 01.205-1.251l1.267-1.114a7.05 7.05 0 010-2.227L1.821 7.773a1 1 0 01-.206-1.25l1.18-2.045a1 1 0 011.187-.447l1.598.54A6.993 6.993 0 017.51 3.456l.33-1.652zM10 13a3 3 0 100-6 3 3 0 000 6z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/CogDuotone.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CogDuotone = createIcon({\n  displayName: \"CogDuotone\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"m13.427 8.902.003.001a5.554 5.554 0 0 0 .07-.905c0 .304-.025.607-.073.904ZM1.547 6.22a.26.26 0 0 1-.022-.02l.035.033 1.023.873v-.001L1.547 6.22Zm8.385-3.375h.001l-.242-1.31a.36.36 0 0 0-.011-.043l.006.025.246 1.328Zm.843 8.54.49-.404 1.45.514a5.78 5.78 0 0 0 .667-1.15l-1.168-.998.104-.627a4.429 4.429 0 0 0 0-1.44l-.102-.624 1.167-.998a5.904 5.904 0 0 0-.665-1.15l-1.45.514-.491-.403a4.387 4.387 0 0 0-1.24-.716l-.595-.223-.28-1.516a5.899 5.899 0 0 0-1.327 0l-.28 1.519-.592.223c-.446.169-.86.41-1.23.714l-.49.405-1.46-.519c-.266.358-.489.742-.666 1.15l1.18 1.008-.101.625a4.308 4.308 0 0 0 0 1.422l.101.625-1.18 1.008c.179.406.4.792.666 1.15l1.46-.519.49.405c.37.304.784.545 1.23.714l.59.226.28 1.52c.44.05.89.05 1.328 0l.28-1.517.595-.223c.45-.169.866-.41 1.24-.716Zm-2.767-.787a2.74 2.74 0 0 1-1.317-.336A2.75 2.75 0 0 1 8 5.094a2.75 2.75 0 0 1 2.418 1.44 2.747 2.747 0 0 1-2.41 4.064ZM3.238 12.7a.493.493 0 0 1-.26.019c.09.019.183.015.274-.016l1.272-.453-.007-.005-1.28.455ZM14.45 6.22l-1.023.875.001.011 1.022-.873a.502.502 0 0 0 .175-.375.501.501 0 0 1-.175.362Z\"\n      opacity=\".1\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M14.622 10.103a.484.484 0 0 1-.026.22l-.014.041a6.969 6.969 0 0 1-1.246 2.155l-.028.033a.5.5 0 0 1-.548.148l-1.27-.451a5.473 5.473 0 0 1-1.558.9l-.246 1.328a.5.5 0 0 1-.403.401l-.042.008c-.408.074-.822.111-1.237.111h.004c.418 0 .835-.037 1.24-.11l.043-.009a.502.502 0 0 0 .403-.401l.246-1.327a5.491 5.491 0 0 0 1.556-.898l1.269.451a.5.5 0 0 0 .548-.148l.028-.033a6.969 6.969 0 0 0 1.244-2.151l.014-.041a.51.51 0 0 0 .023-.227Z\"\n      opacity=\".1\"\n    />,\n    <path\n      key=\"3\"\n      d=\"M10.75 7.844a2.75 2.75 0 1 0-5.5 0 2.75 2.75 0 1 0 5.5 0Zm-4.5 0c0-.467.183-.907.513-1.238.33-.331.77-.512 1.237-.512.467 0 .906.181 1.238.512a1.744 1.744 0 0 1 .512 1.238A1.744 1.744 0 0 1 8.67 9.46a1.744 1.744 0 0 1-2.287-.947 1.744 1.744 0 0 1-.133-.67Z\"\n    />,\n    <path\n      key=\"4\"\n      d=\"M9.283 14.878a.5.5 0 0 0 .404-.401l.245-1.328a5.466 5.466 0 0 0 1.558-.9l1.27.451a.5.5 0 0 0 .548-.148l.029-.033a6.97 6.97 0 0 0 1.245-2.155l.014-.04a.484.484 0 0 0 .027-.22.51.51 0 0 0-.172-.327l-1.02-.874-.004-.001a5.623 5.623 0 0 0 .017-1.692c-.004-.035-.01-.07-.015-.103l-.002-.011 1.024-.875a.501.501 0 0 0 .145-.55l-.014-.041a6.936 6.936 0 0 0-1.245-2.155l-.029-.033a.501.501 0 0 0-.548-.148l-1.27.452a5.498 5.498 0 0 0-1.557-.9h-.001l-.245-1.329-.007-.025a.501.501 0 0 0-.397-.376l-.042-.008a7.059 7.059 0 0 0-2.484 0l-.042.008a.5.5 0 0 0-.403.401l-.247 1.335a5.498 5.498 0 0 0-1.547.897l-1.28-.455a.5.5 0 0 0-.548.148l-.028.033A6.969 6.969 0 0 0 1.416 5.63l-.014.04a.501.501 0 0 0 .124.53l.022.02 1.035.885v.002a5.478 5.478 0 0 0 0 1.782l-1.036.885a.5.5 0 0 0-.145.55l.014.04a6.951 6.951 0 0 0 1.246 2.155l.028.033a.499.499 0 0 0 .548.148l1.28-.454.006.004c.464.38.981.681 1.54.893l.248 1.334a.5.5 0 0 0 .403.401l.042.008c.408.074.825.111 1.242.111h.005a6.96 6.96 0 0 0 1.237-.11l.042-.009Zm-.621-1.039c-.442.05-.887.05-1.329 0l-.28-1.518-.59-.227a4.372 4.372 0 0 1-1.23-.714l-.49-.405-1.46.519a5.902 5.902 0 0 1-.665-1.15l1.18-1.008-.102-.625a4.308 4.308 0 0 1 0-1.422l.102-.625-1.18-1.007c.176-.408.4-.793.665-1.15l1.46.518.49-.404c.37-.305.785-.546 1.23-.714l.592-.224.28-1.519c.44-.05.888-.05 1.328 0l.28 1.516.595.223c.449.17.866.41 1.24.716l.49.403 1.45-.514c.265.358.487.744.665 1.15l-1.167.999.102.623a4.418 4.418 0 0 1 0 1.44l-.103.627 1.167.999c-.177.407-.4.793-.666 1.15l-1.45-.514-.49.403a4.366 4.366 0 0 1-1.24.715l-.595.224-.28 1.515Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/CogOutlined.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CogOutlined = createIcon({\n  displayName: \"CogOutlined\",\n  viewBox: \"0 0 16 17\",\n  defaultProps,\n  path: (\n    <path d=\"M14.45 10.275 13.428 9.4a5.623 5.623 0 0 0 0-1.806l1.024-.875a.5.5 0 0 0 .145-.55l-.014-.04a6.935 6.935 0 0 0-1.245-2.155l-.029-.033a.501.501 0 0 0-.548-.148l-1.27.451a5.507 5.507 0 0 0-1.558-.9l-.245-1.328a.5.5 0 0 0-.404-.401l-.042-.008a7.059 7.059 0 0 0-2.484 0l-.042.008a.5.5 0 0 0-.403.401L6.065 3.35a5.498 5.498 0 0 0-1.547.897l-1.28-.454a.5.5 0 0 0-.548.148l-.028.033a6.969 6.969 0 0 0-1.246 2.155l-.014.04a.502.502 0 0 0 .146.55l1.035.885a5.497 5.497 0 0 0 0 1.784l-1.036.884a.5.5 0 0 0-.145.55l.014.041a6.951 6.951 0 0 0 1.246 2.155l.028.032a.502.502 0 0 0 .548.149l1.28-.455c.465.383.986.686 1.547.897l.247 1.335a.5.5 0 0 0 .403.401l.042.008a7.025 7.025 0 0 0 2.484 0l.042-.008a.502.502 0 0 0 .404-.402l.245-1.328a5.47 5.47 0 0 0 1.558-.9l1.27.452a.5.5 0 0 0 .548-.149l.029-.032a6.97 6.97 0 0 0 1.245-2.155l.014-.04a.498.498 0 0 0-.145-.548ZM12.319 7.78a4.418 4.418 0 0 1 0 1.44l-.103.627 1.167.998c-.177.408-.4.794-.666 1.15l-1.45-.514-.49.403a4.363 4.363 0 0 1-1.24.716l-.595.223-.28 1.516c-.44.05-.886.05-1.328 0l-.28-1.519-.59-.226a4.372 4.372 0 0 1-1.23-.714l-.49-.405-1.46.519a5.905 5.905 0 0 1-.665-1.15l1.18-1.008-.102-.625a4.307 4.307 0 0 1 0-1.422l.102-.625-1.18-1.008c.176-.408.4-.792.665-1.15l1.46.519.49-.405c.37-.304.785-.545 1.23-.714l.592-.223.28-1.519c.44-.05.888-.05 1.328 0l.28 1.516.595.223c.449.169.866.41 1.24.716l.49.403 1.45-.514c.265.358.487.743.665 1.15l-1.167.998.102.624ZM8 5.593a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5ZM9.238 9.58a1.744 1.744 0 0 1-1.237.513 1.744 1.744 0 0 1-1.618-1.08 1.744 1.744 0 0 1 .38-1.907c.331-.332.77-.513 1.238-.513.467 0 .906.18 1.237.512a1.744 1.744 0 0 1 .513 1.238c0 .467-.183.906-.513 1.237Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/CommandLine.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const CommandLine = createIcon({\n  displayName: \"CommandLine\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M3.25 3A2.25 2.25 0 001 5.25v9.5A2.25 2.25 0 003.25 17h13.5A2.25 2.25 0 0019 14.75v-9.5A2.25 2.25 0 0016.75 3H3.25zm.943 8.752a.75.75 0 01.055-1.06L6.128 9l-1.88-1.693a.75.75 0 111.004-1.114l2.5 2.25a.75.75 0 010 1.114l-2.5 2.25a.75.75 0 01-1.06-.055zM9.75 10.25a.75.75 0 000 1.5h2.5a.75.75 0 000-1.5h-2.5z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Connect.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Connect = createIcon({\n  displayName: \"Connect\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M7.06295 0.666574H8.28518C8.39382 0.666574 8.44814 0.720895 8.44814 0.829537V15.1703C8.44814 15.2789 8.39382 15.3332 8.28518 15.3332H7.06295C6.95431 15.3332 6.89999 15.2789 6.89999 15.1703V0.829537C6.89999 0.720895 6.95431 0.666574 7.06295 0.666574Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M0.829619 7.22583H14.5185C14.6272 7.22583 14.6815 7.28015 14.6815 7.3888V8.61102C14.6815 8.71966 14.6272 8.77398 14.5185 8.77398H0.829619C0.720977 8.77398 0.666656 8.71966 0.666656 8.61102V7.3888C0.666656 7.28015 0.720977 7.22583 0.829619 7.22583Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Dashboard.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Dashboard = createIcon({\n  displayName: \"Dashboard\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M21.675 9.03762C21.1479 7.79006 20.3838 6.65662 19.425 5.70012C18.4685 4.74131 17.3351 3.97719 16.0875 3.45012C14.7914 2.90168 13.418 2.62512 12 2.62512C10.582 2.62512 9.20859 2.90168 7.9125 3.45012C6.66494 3.97719 5.5315 4.74131 4.575 5.70012C3.61619 6.65662 2.85207 7.79006 2.325 9.03762C1.77656 10.3337 1.5 11.7072 1.5 13.1251C1.5 16.2353 2.86641 19.165 5.24766 21.1665L5.2875 21.1993C5.42344 21.3118 5.59453 21.3751 5.77031 21.3751H18.232C18.4078 21.3751 18.5789 21.3118 18.7148 21.1993L18.7547 21.1665C21.1336 19.165 22.5 16.2353 22.5 13.1251C22.5 11.7072 22.2211 10.3337 21.675 9.03762ZM17.8453 19.5939H6.15469C5.24905 18.7773 4.52524 17.7794 4.03021 16.665C3.53518 15.5506 3.28001 14.3445 3.28125 13.1251C3.28125 10.7954 4.18828 8.60637 5.83594 6.96106C7.48359 5.3134 9.67266 4.40637 12 4.40637C14.3297 4.40637 16.5188 5.3134 18.1641 6.96106C19.8117 8.60872 20.7188 10.7978 20.7188 13.1251C20.7188 15.6001 19.6758 17.9415 17.8453 19.5939ZM14.6133 9.87903C14.578 9.84413 14.5305 9.82456 14.4809 9.82456C14.4313 9.82456 14.3837 9.84413 14.3484 9.87903L12.368 11.8595C11.9297 11.7423 11.4445 11.8548 11.1 12.1993C10.978 12.3211 10.8812 12.4658 10.8151 12.6251C10.749 12.7843 10.715 12.9551 10.715 13.1275C10.715 13.2999 10.749 13.4706 10.8151 13.6299C10.8812 13.7891 10.978 13.9338 11.1 14.0556C11.2218 14.1776 11.3665 14.2744 11.5257 14.3405C11.685 14.4065 11.8557 14.4405 12.0281 14.4405C12.2005 14.4405 12.3713 14.4065 12.5305 14.3405C12.6898 14.2744 12.8344 14.1776 12.9562 14.0556C13.1195 13.8929 13.2369 13.6899 13.2965 13.4673C13.3562 13.2446 13.3561 13.0102 13.2961 12.7876L15.2766 10.8072C15.3492 10.7345 15.3492 10.615 15.2766 10.5423L14.6133 9.87903ZM11.4844 7.50012H12.5156C12.6187 7.50012 12.7031 7.41575 12.7031 7.31262V5.43762C12.7031 5.3345 12.6187 5.25012 12.5156 5.25012H11.4844C11.3813 5.25012 11.2969 5.3345 11.2969 5.43762V7.31262C11.2969 7.41575 11.3813 7.50012 11.4844 7.50012ZM17.5781 12.6095V13.6407C17.5781 13.7439 17.6625 13.8282 17.7656 13.8282H19.6406C19.7437 13.8282 19.8281 13.7439 19.8281 13.6407V12.6095C19.8281 12.5064 19.7437 12.422 19.6406 12.422H17.7656C17.6625 12.422 17.5781 12.5064 17.5781 12.6095ZM17.8758 7.98762L17.1469 7.25872C17.1116 7.22382 17.064 7.20425 17.0145 7.20425C16.9649 7.20425 16.9173 7.22382 16.882 7.25872L15.5555 8.58528C15.5206 8.62052 15.501 8.66811 15.501 8.7177C15.501 8.76729 15.5206 8.81488 15.5555 8.85012L16.2844 9.57903C16.357 9.65168 16.4766 9.65168 16.5492 9.57903L17.8758 8.25247C17.9484 8.17981 17.9484 8.06028 17.8758 7.98762ZM7.12734 7.25872C7.0921 7.22382 7.04452 7.20425 6.99492 7.20425C6.94533 7.20425 6.89774 7.22382 6.8625 7.25872L6.13359 7.98762C6.0987 8.02286 6.07912 8.07045 6.07913 8.12004C6.07912 8.16964 6.0987 8.21723 6.13359 8.25247L7.46016 9.57903C7.53281 9.65168 7.65234 9.65168 7.725 9.57903L8.45391 8.85012C8.52656 8.77747 8.52656 8.65793 8.45391 8.58528L7.12734 7.25872ZM6.14062 12.422H4.26562C4.1625 12.422 4.07812 12.5064 4.07812 12.6095V13.6407C4.07812 13.7439 4.1625 13.8282 4.26562 13.8282H6.14062C6.24375 13.8282 6.32812 13.7439 6.32812 13.6407V12.6095C6.32812 12.5064 6.24375 12.422 6.14062 12.422Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Database.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Database = createIcon({\n  displayName: \"Database\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M19.5 1.50012H4.5C4.08516 1.50012 3.75 1.83528 3.75 2.25012V21.7501C3.75 22.165 4.08516 22.5001 4.5 22.5001H19.5C19.9148 22.5001 20.25 22.165 20.25 21.7501V2.25012C20.25 1.83528 19.9148 1.50012 19.5 1.50012ZM5.4375 3.18762H18.5625V8.06262H5.4375V3.18762ZM18.5625 14.4376H5.4375V9.56262H18.5625V14.4376ZM18.5625 20.8126H5.4375V15.9376H18.5625V20.8126ZM7.125 5.62512C7.125 5.87376 7.22377 6.11222 7.39959 6.28803C7.5754 6.46385 7.81386 6.56262 8.0625 6.56262C8.31114 6.56262 8.5496 6.46385 8.72541 6.28803C8.90123 6.11222 9 5.87376 9 5.62512C9 5.37648 8.90123 5.13802 8.72541 4.96221C8.5496 4.78639 8.31114 4.68762 8.0625 4.68762C7.81386 4.68762 7.5754 4.78639 7.39959 4.96221C7.22377 5.13802 7.125 5.37648 7.125 5.62512ZM7.125 12.0001C7.125 12.2488 7.22377 12.4872 7.39959 12.663C7.5754 12.8389 7.81386 12.9376 8.0625 12.9376C8.31114 12.9376 8.5496 12.8389 8.72541 12.663C8.90123 12.4872 9 12.2488 9 12.0001C9 11.7515 8.90123 11.513 8.72541 11.3372C8.5496 11.1614 8.31114 11.0626 8.0625 11.0626C7.81386 11.0626 7.5754 11.1614 7.39959 11.3372C7.22377 11.513 7.125 11.7515 7.125 12.0001ZM7.125 18.3751C7.125 18.6238 7.22377 18.8622 7.39959 19.038C7.5754 19.2139 7.81386 19.3126 8.0625 19.3126C8.31114 19.3126 8.5496 19.2139 8.72541 19.038C8.90123 18.8622 9 18.6238 9 18.3751C9 18.1265 8.90123 17.888 8.72541 17.7122C8.5496 17.5364 8.31114 17.4376 8.0625 17.4376C7.81386 17.4376 7.5754 17.5364 7.39959 17.7122C7.22377 17.888 7.125 18.1265 7.125 18.3751Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/DevPodProBadge.tsx",
    "content": "import { Icon, IconProps, useColorMode } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const DevPodProBadge = (props: IconProps) => {\n  const { colorMode } = useColorMode()\n\n  return (\n    <Icon viewBox=\"0 0 64 32\" {...defaultProps} {...props}>\n      <path\n        key=\"1\"\n        fill=\"currentColor\"\n        d=\"M50.708 2H5.082A4.078 4.078 0 0 0 1 6.073v16.253A4.078 4.078 0 0 0 5.082 26.4h45.626a4.078 4.078 0 0 0 4.082-4.074V6.073A4.078 4.078 0 0 0 50.708 2Z\"\n      />\n      <path\n        key=\"2\"\n        fill={colorMode === \"light\" ? \"#fff\" : \"#000\"}\n        d=\"M11.91 19.099c0 .404-.135.731-.405.984-.27.254-.598.38-.978.38-.381 0-.721-.126-.987-.38-.266-.253-.397-.58-.397-.984 0-.405.13-.736.397-.993.266-.258.594-.388.987-.388s.704.13.978.388c.274.257.405.588.405.993ZM17.654 8.153c1.74 0 3.075.319 4.004.948.93.633 1.392 1.622 1.392 2.97 0 .703-.123 1.304-.373 1.806-.25.499-.61.911-1.08 1.226-.475.319-1.049.552-1.732.699-.68.15-1.458.224-2.334.224h-1.089v4.213h-2.178V8.447a10.979 10.979 0 0 1 1.687-.233 25.91 25.91 0 0 1 1.703-.06Zm.156 1.884c-.553 0-1.008.016-1.368.053v4.073h1.056c1.049 0 1.86-.147 2.424-.441.565-.294.848-.85.848-1.667 0-.392-.074-.719-.226-.985a1.62 1.62 0 0 0-.622-.62 2.872 2.872 0 0 0-.942-.32 7.029 7.029 0 0 0-1.166-.093h-.004ZM28.343 8.153c1.732 0 3.054.319 3.971.948.917.633 1.376 1.602 1.376 2.9 0 1.623-.802 2.722-2.403 3.298.22.266.466.588.745.968a28.26 28.26 0 0 1 1.678 2.599c.267.466.504.923.709 1.373h-2.44c-.221-.413-.455-.83-.709-1.25-.253-.421-.511-.83-.77-1.226a28 28 0 0 0-1.477-2.064 5.4 5.4 0 0 1-.414.017h-1.383v4.523h-2.178V8.447a11.938 11.938 0 0 1 1.695-.233c.597-.04 1.134-.06 1.609-.06h-.009Zm.156 1.884c-.463 0-.889.016-1.281.053v3.865h.95c.527 0 .998-.029 1.4-.086.405-.057.74-.16 1.01-.31.27-.152.476-.352.615-.605s.208-.576.208-.968c0-.368-.07-.679-.208-.932a1.543 1.543 0 0 0-.598-.605 2.777 2.777 0 0 0-.925-.318 6.948 6.948 0 0 0-1.175-.094h.004ZM47.097 14.245c0 1.026-.15 1.928-.458 2.709-.307.784-.72 1.434-1.245 1.957a5.09 5.09 0 0 1-1.842 1.18 6.314 6.314 0 0 1-2.247.397c-.795 0-1.548-.13-2.256-.396a5.14 5.14 0 0 1-1.85-1.181c-.525-.523-.942-1.177-1.253-1.957-.311-.78-.467-1.688-.467-2.709 0-1.021.156-1.924.467-2.7.31-.777.737-1.43 1.273-1.958a5.234 5.234 0 0 1 1.859-1.193 6.257 6.257 0 0 1 2.23-.396c.787 0 1.528.13 2.232.396a5.065 5.065 0 0 1 1.842 1.193c.524.527.942 1.181 1.253 1.957.311.777.467 1.68.467 2.701h-.005Zm-9.358 0c0 .658.082 1.25.241 1.785.16.536.393.99.7 1.365.307.376.676.666 1.118.87.438.209.933.31 1.486.31.553 0 1.032-.101 1.47-.31.438-.208.81-.498 1.117-.87.308-.376.54-.83.7-1.365.16-.535.242-1.131.242-1.785 0-.654-.082-1.25-.241-1.785a3.88 3.88 0 0 0-.7-1.365 3.138 3.138 0 0 0-1.118-.87 3.383 3.383 0 0 0-1.47-.31c-.54 0-1.048.101-1.486.31-.438.208-.81.502-1.117.882-.308.38-.54.834-.7 1.365-.164.527-.242 1.123-.242 1.777v-.004Z\"\n      />\n    </Icon>\n  )\n}\n"
  },
  {
    "path": "desktop/src/icons/Devpod.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const DevPodIcon = createIcon({\n  displayName: \"DevPodIcon\",\n  viewBox: \"0 0 184 152\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M72.47 79.3398V151.7H0V147.44C0 147.05 0 146.66 0.02 146.29C0.32 137 4.15 128.32 10.83 121.84C16.79 116.06 24.46 112.58 32.66 111.9C33.39 103.46 37.08 95.6198 43.19 89.6098C49.91 82.9898 58.79 79.3498 68.2 79.3498H72.46L72.47 79.3398Z\"\n      fill=\"currentColor\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M184 76.09C183.97 86.28 181.96 96.17 177.99 105.48C174.18 114.47 168.72 122.55 161.78 129.49C154.82 136.45 146.71 141.92 137.67 145.74C128.32 149.69 118.38 151.7 108.15 151.7H95.22V111.77H108.15C117.74 111.77 126.76 108.04 133.54 101.26C140.25 94.54 143.99 85.62 144.06 76.13C144.12 66.62 140.41 57.6 133.61 50.75C130.26 47.37 126.34 44.71 121.98 42.85C117.47 40.92 112.69 39.94 107.79 39.94H72.22V60.8H67.96C48.3 60.8 32.29 44.8 32.29 25.13V0H107.67C117.96 0 127.97 2.04 137.43 6.08C146.56 9.97 154.77 15.52 161.81 22.59C168.79 29.58 174.25 37.68 178.07 46.68C182.03 56.03 184.03 65.92 183.99 76.09H184Z\"\n      fill=\"currentColor\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/DevpodWordmark.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const DevpodWordmark = createIcon({\n  displayName: \"DevpodWordmark\",\n  viewBox: \"0 0 648 153\",\n  defaultProps,\n  path: [\n    <defs key=\"one\">\n      <clipPath id=\"clippath\">\n        <rect x=\"0\" y=\".52\" width=\"647.43\" height=\"151.7\" fill=\"none\" />\n      </clipPath>\n    </defs>,\n    <g style={{ clipPath: \"url(#clippath)\" }} key=\"two\">\n      <g>\n        <path\n          d=\"M225.76,116V36.96h27.63c8.45,0,15.79,1.62,22.02,4.87,6.22,3.25,11.07,7.86,14.55,13.82,3.47,5.97,5.21,12.94,5.21,20.95s-1.74,14.94-5.21,20.84c-3.47,5.89-8.32,10.45-14.55,13.71-6.23,3.24-13.57,4.87-22.02,4.87h-27.63ZM241.73,102.42h11.09c8.31,0,14.71-2.26,19.2-6.79,4.49-4.53,6.74-10.87,6.74-19.02s-2.25-14.57-6.74-19.25c-4.49-4.68-10.89-7.02-19.2-7.02h-11.09v52.09Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M336.85,116.8c-4.83,0-9.3-.75-13.42-2.26-4.12-1.51-7.7-3.66-10.75-6.45-3.06-2.8-5.44-6.13-7.13-10.02-1.7-3.89-2.55-8.21-2.55-12.96s.87-9.36,2.6-13.37c1.73-4,4.15-7.43,7.24-10.3,3.1-2.87,6.65-5.08,10.64-6.63,4-1.55,8.22-2.32,12.68-2.32,3.78,0,7.32.51,10.64,1.53,3.32,1.02,6.24,2.46,8.77,4.3,2.53,1.85,4.49,4.06,5.89,6.62,1.39,2.57,2.1,5.36,2.1,8.38,0,3.92-1.14,7.21-3.4,9.85-2.26,2.64-5.26,4.74-9,6.29s-7.83,2.6-12.28,3.17c-4.46.57-8.83.77-13.14.62-.68-.07-1.48-.11-2.37-.11s-1.71-.02-2.44-.05c-.71-.04-1.19-.06-1.41-.06.45,2.04,1.53,3.92,3.23,5.67,1.7,1.73,3.8,3.08,6.29,4.02,2.49.94,5.17,1.41,8.04,1.41,2.49,0,4.9-.41,7.24-1.25,2.34-.82,4.51-1.98,6.51-3.46,2-1.48,3.64-3.07,4.92-4.81l10.98,8.27c-2.42,3.17-5.21,5.79-8.38,7.87-3.17,2.08-6.56,3.6-10.19,4.58-3.62.98-7.4,1.48-11.32,1.48h.02ZM326.32,81.81c2.49,0,5-.11,7.53-.34,2.53-.23,4.87-.66,7.02-1.3,2.15-.64,3.89-1.55,5.21-2.71,1.32-1.17,1.98-2.66,1.98-4.47,0-1.51-.51-2.85-1.53-4.02-1.02-1.17-2.37-2.12-4.08-2.83-1.7-.72-3.64-1.07-5.83-1.07-3.48,0-6.55.79-9.23,2.37-2.68,1.59-4.78,3.64-6.28,6.17-1.51,2.53-2.34,5.15-2.49,7.87.91.07,2.04.15,3.4.23,1.37.08,2.8.11,4.3.11h.01Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M391.09,63.98l12.23,37.31,12.23-37.31c2.09-6.39,8.06-10.71,14.78-10.71h5.83l-23.21,62.73h-19.48l-22.98-62.73h5.83c6.72,0,12.68,4.32,14.78,10.71Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M445.09,116V36.08h29.1c6.42,0,11.73,1.07,15.97,3.23,4.23,2.15,7.38,5.08,9.45,8.77,2.07,3.7,3.12,7.86,3.12,12.46,0,4-.96,7.87-2.89,11.61-1.93,3.74-4.97,6.79-9.11,9.17-4.15,2.37-9.66,3.57-16.53,3.57h-13.14v31.11h-15.97ZM461.06,71.98h12.46c4.46,0,7.72-1.04,9.79-3.12,2.07-2.07,3.12-4.85,3.12-8.32s-1.04-6.45-3.12-8.49c-2.08-2.04-5.35-3.06-9.79-3.06h-12.46v22.98h0Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M540.78,116.8c-6.04,0-11.46-1.32-16.24-3.96-4.79-2.64-8.61-6.38-11.44-11.21-2.83-4.83-4.24-10.53-4.24-17.1s1.43-12.25,4.3-17.04c2.87-4.79,6.76-8.49,11.66-11.09,4.9-2.6,10.38-3.91,16.42-3.91s11.49,1.3,16.36,3.91,8.74,6.31,11.61,11.09c2.87,4.79,4.3,10.47,4.3,17.04s-1.46,12.27-4.36,17.1c-2.91,4.83-6.83,8.57-11.78,11.21-4.94,2.64-10.48,3.96-16.59,3.96h.02ZM540.78,102.86c2.8,0,5.44-.66,7.93-1.98,2.49-1.32,4.53-3.36,6.11-6.11,1.59-2.76,2.37-6.17,2.37-10.25s-.78-7.47-2.32-10.19c-1.55-2.71-3.55-4.74-6.01-6.06-2.46-1.32-5.08-1.98-7.86-1.98s-5.38.66-7.76,1.98-4.32,3.34-5.83,6.06c-1.51,2.72-2.27,6.11-2.27,10.19s.72,7.49,2.16,10.25c1.43,2.76,3.34,4.79,5.72,6.11,2.37,1.32,4.96,1.98,7.76,1.98h-.01Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M610.31,116.8c-5.51,0-10.38-1.38-14.6-4.14s-7.55-6.56-9.97-11.44c-2.42-4.87-3.62-10.4-3.62-16.59s1.21-11.82,3.62-16.65c2.41-4.83,5.74-8.63,9.97-11.38,4.23-2.75,9.09-4.13,14.6-4.13,4.99,0,9.32,1.28,13.02,3.85,3.7,2.57,6.38,6.11,8.04,10.64v-31.06h6.03c5.55,0,10.05,4.49,10.05,10.05v70.05h-7.7c-2.57,0-4.6-.77-6.11-2.32-1.51-1.55-2.26-3.6-2.26-6.17v-5.33c-1.66,4.6-4.35,8.2-8.04,10.75-3.7,2.57-8.04,3.85-13.02,3.85h0ZM614.84,102.86c2.94,0,5.67-.71,8.15-2.15,2.49-1.43,4.51-3.51,6.06-6.23,1.55-2.71,2.32-6,2.32-9.85s-.78-7.24-2.32-9.96c-1.55-2.71-3.57-4.78-6.06-6.17-2.49-1.39-5.21-2.1-8.15-2.1s-5.45.7-7.98,2.1c-2.53,1.39-4.57,3.46-6.11,6.17-1.55,2.72-2.32,6.04-2.32,9.96s.77,7.13,2.32,9.85c1.55,2.72,3.58,4.79,6.11,6.23,2.53,1.43,5.19,2.15,7.98,2.15Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M72.47,79.86v72.36H0v-4.26c0-.39,0-.78.02-1.15.3-9.29,4.13-17.97,10.81-24.45,5.96-5.78,13.63-9.26,21.83-9.94.73-8.44,4.42-16.28,10.53-22.29,6.72-6.62,15.6-10.26,25.01-10.26h4.26Z\"\n          fill=\"#a640ff\"\n        />\n        <path\n          d=\"M184,76.61c-.03,10.19-2.04,20.08-6.01,29.39-3.81,8.99-9.27,17.07-16.21,24.01-6.96,6.96-15.07,12.43-24.11,16.25-9.35,3.95-19.29,5.96-29.52,5.96h-12.93v-39.93h12.93c9.59,0,18.61-3.73,25.39-10.51,6.71-6.72,10.45-15.64,10.52-25.13.06-9.51-3.65-18.53-10.45-25.38-3.35-3.38-7.27-6.04-11.63-7.9-4.51-1.93-9.29-2.91-14.19-2.91h-35.57v20.86h-4.26c-19.66,0-35.67-16-35.67-35.67V.52h75.38c10.29,0,20.3,2.04,29.76,6.08,9.13,3.89,17.34,9.44,24.38,16.51,6.98,6.99,12.44,15.09,16.26,24.09,3.96,9.35,5.96,19.24,5.92,29.41Z\"\n          fill=\"#a640ff\"\n        />\n      </g>\n    </g>,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Ellipsis.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Ellipsis = createIcon({\n  displayName: \"Ellipsis\",\n  viewBox: \"64 64 896 896\",\n  defaultProps,\n  path: (\n    <path\n      key=\"1\"\n      d=\"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ExclamationCircle.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ExclamationCircle = createIcon({\n  displayName: \"ExclamationCircle\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ExclamationTriangle.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ExclamationTriangle = createIcon({\n  displayName: \"ExclamationTriangle\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/File.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const File = createIcon({\n  displayName: \"File\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M20.0297 6.76418L14.9859 1.72043C14.8453 1.57981 14.6555 1.50012 14.4562 1.50012H4.5C4.08516 1.50012 3.75 1.83528 3.75 2.25012V21.7501C3.75 22.165 4.08516 22.5001 4.5 22.5001H19.5C19.9148 22.5001 20.25 22.165 20.25 21.7501V7.29622C20.25 7.097 20.1703 6.90481 20.0297 6.76418ZM18.5203 7.64075H14.1094V3.22981L18.5203 7.64075ZM18.5625 20.8126H5.4375V3.18762H12.5156V8.25012C12.5156 8.51119 12.6193 8.76157 12.8039 8.94618C12.9885 9.13079 13.2389 9.2345 13.5 9.2345H18.5625V20.8126Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Folder.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Folder = createIcon({\n  displayName: \"Folder\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M2 4.75C2 3.784 2.784 3 3.75 3h4.971c.58 0 1.12.286 1.447.765l1.404 2.063c.046.069.124.11.207.11h8.471c.966 0 1.75.783 1.75 1.75V19.25A1.75 1.75 0 0 1 20.25 21H3.75A1.75 1.75 0 0 1 2 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V7.687a.25.25 0 0 0-.25-.25h-8.471a1.75 1.75 0 0 1-1.447-.765L8.928 4.61a.252.252 0 0 0-.208-.11Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Form.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Form = createIcon({\n  displayName: \"Form\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M21.1875 12.0001H19.875C19.7719 12.0001 19.6875 12.0845 19.6875 12.1876V19.6876H4.3125V4.31262H11.8125C11.9156 4.31262 12 4.22825 12 4.12512V2.81262C12 2.7095 11.9156 2.62512 11.8125 2.62512H3.375C2.96016 2.62512 2.625 2.96028 2.625 3.37512V20.6251C2.625 21.04 2.96016 21.3751 3.375 21.3751H20.625C21.0398 21.3751 21.375 21.04 21.375 20.6251V12.1876C21.375 12.0845 21.2906 12.0001 21.1875 12.0001Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M8.3423 12.5368L8.29777 15.3236C8.29543 15.5322 8.46418 15.7032 8.67277 15.7032H8.68214L11.4478 15.6353C11.4946 15.6329 11.5415 15.6142 11.5743 15.5814L21.322 5.85481C21.3946 5.78215 21.3946 5.66262 21.322 5.58997L18.4087 2.67903C18.3712 2.64153 18.3243 2.62512 18.2751 2.62512C18.2259 2.62512 18.179 2.64387 18.1415 2.67903L8.39621 12.4056C8.36235 12.441 8.3431 12.4879 8.3423 12.5368ZM9.83058 13.09L18.2751 4.66418L19.3345 5.72122L10.8853 14.1517L9.81418 14.1775L9.83058 13.09Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Git.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Git = createIcon({\n  displayName: \"Git\",\n  viewBox: \"0 0 92 92\",\n  defaultProps,\n  path: [\n    <defs key=\"1\">\n      <clipPath id=\"a\">\n        <path d=\"M0 .113h91.887V92H0Zm0 0\" />\n      </clipPath>\n    </defs>,\n    <g key=\"2\" clipPath=\"url(#a)\">\n      <path d=\"M90.156 41.965 50.036 1.848a5.913 5.913 0 0 0-8.368 0l-8.332 8.332 10.566 10.566a7.03 7.03 0 0 1 7.23 1.684 7.043 7.043 0 0 1 1.673 7.277l10.183 10.184a7.026 7.026 0 0 1 7.278 1.672 7.04 7.04 0 0 1 0 9.957 7.045 7.045 0 0 1-9.961 0 7.038 7.038 0 0 1-1.532-7.66l-9.5-9.497V59.36a7.04 7.04 0 0 1 1.86 11.29 7.04 7.04 0 0 1-9.957 0 7.04 7.04 0 0 1 0-9.958 7.034 7.034 0 0 1 2.308-1.539V33.926a7.001 7.001 0 0 1-2.308-1.535 7.049 7.049 0 0 1-1.516-7.7L29.242 14.273 1.734 41.777a5.918 5.918 0 0 0 0 8.371L41.855 90.27a5.92 5.92 0 0 0 8.368 0l39.933-39.934a5.925 5.925 0 0 0 0-8.371\" />\n    </g>,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/GitBranch.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const GitBranch = createIcon({\n  displayName: \"GitBranch\",\n  viewBox: \"0 0 12 14\",\n  defaultProps,\n  path: (\n    <path d=\"M9.563 1.516a1.751 1.751 0 0 0-.524 3.42v1.498L3 8.412V3.97A1.751 1.751 0 1 0 .687 2.312c0 .77.497 1.422 1.188 1.658v6.061a1.751 1.751 0 1 0 2.313 1.658c0-.769-.497-1.422-1.188-1.658v-.434L9.617 7.43a.79.79 0 0 0 .545-.753V4.909c.67-.247 1.15-.89 1.15-1.643 0-.966-.784-1.75-1.75-1.75Zm-7.876.796a.75.75 0 0 1 1.5 0 .75.75 0 0 1-1.5 0Zm1.5 9.376a.75.75 0 0 1-1.5 0 .75.75 0 0 1 1.5 0Zm6.376-7.672a.75.75 0 0 1 0-1.5.75.75 0 0 1 0 1.5Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/GitCommit.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const GitCommit = createIcon({\n  displayName: \"GitCommit\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path key=\"dot\" fill=\"currentColor\" d=\"M1.333 7.333h13.333v1.333H1.333z\" />,\n    <path\n      key=\"stroke\"\n      fill=\"#fff\"\n      stroke=\"currentColor\"\n      strokeWidth=\"1.4\"\n      d=\"M9.967 8a1.967 1.967 0 1 1-3.934 0 1.967 1.967 0 0 1 3.934 0Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/GitPR.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const GitPR = createIcon({\n  displayName: \"GitPR\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M16 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm-14.5 0a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM4.75 3a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 3Zm0 14.5a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 17.5Zm14.5 0a1.75 1.75 0 1 0 .001 3.501 1.75 1.75 0 0 0-.001-3.501Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M13.405 1.72a.75.75 0 0 1 0 1.06L12.185 4h4.065A3.75 3.75 0 0 1 20 7.75v8.75a.75.75 0 0 1-1.5 0V7.75a2.25 2.25 0 0 0-2.25-2.25h-4.064l1.22 1.22a.75.75 0 0 1-1.061 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0ZM4.75 7.25A.75.75 0 0 1 5.5 8v8A.75.75 0 0 1 4 16V8a.75.75 0 0 1 .75-.75Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/GitSubPath.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const GitSubPath = createIcon({\n  displayName: \"GitSubPath\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M2 4.75C2 3.784 2.784 3 3.75 3h4.971c.58 0 1.12.286 1.447.765l1.404 2.063c.046.069.124.11.207.11h8.471c.966 0 1.75.783 1.75 1.75V19.25A1.75 1.75 0 0 1 20.25 21H3.75A1.75 1.75 0 0 1 2 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V7.687a.25.25 0 0 0-.25-.25h-8.471a1.75 1.75 0 0 1-1.447-.765L8.928 4.61a.252.252 0 0 0-.208-.11Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Globe.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Globe = createIcon({\n  displayName: \"Globe\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"m13.35 12.514.01-.014A6.966 6.966 0 0 0 15 8a6.973 6.973 0 0 0-1.637-4.5l-.011-.013-.05-.057-.02-.022-.063-.074-.002-.001-.072-.08-.001-.001c-.05-.054-.1-.107-.152-.158l-.001-.002-.075-.075-.005-.004a2.634 2.634 0 0 0-.095-.091l-.047-.044-.016-.016A6.966 6.966 0 0 0 8 1a6.973 6.973 0 0 0-4.755 1.862l-.015.016-.047.045-.025.024-.07.067-.005.005-.075.075-.002.001-.151.158-.002.002a3.314 3.314 0 0 0-.072.08H2.78a1.434 1.434 0 0 0-.064.074l-.02.022c-.016.019-.032.04-.05.058-.002.005-.007.008-.01.013A6.973 6.973 0 0 0 1 8c0 1.714.616 3.283 1.638 4.5l.01.014.049.058.019.022.064.073.001.003c.024.027.047.053.072.078l.002.002.15.158.001.001.074.074.004.005A6.987 6.987 0 0 0 8 15a6.974 6.974 0 0 0 4.91-2.012l.006-.005c.025-.025.05-.049.073-.074l.002-.001c.051-.052.101-.105.15-.158l.001-.002c.024-.026.049-.051.072-.078 0-.001.002-.001.002-.003.022-.023.043-.048.064-.073l.018-.022.052-.058Zm.064-2.228c-.216.51-.5.981-.847 1.41a6.937 6.937 0 0 0-1.273-.874c.181-.733.293-1.538.323-2.384h2.242a5.843 5.843 0 0 1-.445 1.848Zm.445-2.723h-2.242a11.679 11.679 0 0 0-.323-2.385 6.938 6.938 0 0 0 1.273-.873 5.842 5.842 0 0 1 1.292 3.258Zm-3.573-4.977c.62.262 1.184.625 1.681 1.081a6.17 6.17 0 0 1-.928.653c-.245-.703-.56-1.314-.925-1.803.058.022.116.046.172.069ZM8.87 13.533a1.772 1.772 0 0 1-.432.256v-2.898a6.08 6.08 0 0 1 1.807.409c-.13.384-.28.74-.453 1.06-.272.506-.59.91-.922 1.173Zm.922-9.892c.172.321.324.676.453 1.059a6.08 6.08 0 0 1-1.807.41V2.211c.143.058.289.143.432.257.332.26.65.665.922 1.172Zm-1.354 6.373V8.438h2.304c-.025.69-.11 1.36-.255 1.996l-.004.02a6.953 6.953 0 0 0-2.046-.44Zm0-2.451V5.986a6.953 6.953 0 0 0 2.045-.44l.005.02c.143.636.23 1.304.254 1.997H8.437Zm-.876.875v1.576a6.953 6.953 0 0 0-2.045.44l-.005-.02a10.835 10.835 0 0 1-.254-1.996h2.304Zm-2.304-.876c.025-.69.11-1.36.255-1.996l.004-.02a6.943 6.943 0 0 0 2.045.44v1.577H5.258Zm2.304 3.329v2.896a1.747 1.747 0 0 1-.432-.256c-.332-.26-.652-.667-.924-1.173a7.06 7.06 0 0 1-.453-1.06 6.1 6.1 0 0 1 1.81-.407Zm0-5.782A6.08 6.08 0 0 1 5.755 4.7c.13-.384.28-.74.453-1.06.272-.506.59-.912.923-1.173.144-.112.288-.198.433-.256v2.898h-.002ZM5.715 2.586c.058-.023.114-.047.172-.069-.366.49-.68 1.1-.925 1.803a6.057 6.057 0 0 1-.928-.653 5.84 5.84 0 0 1 1.681-1.081ZM2.586 5.714c.216-.51.5-.981.847-1.41.389.337.815.63 1.273.874a11.682 11.682 0 0 0-.323 2.385H2.14c.046-.64.196-1.26.445-1.849ZM2.14 8.437h2.242c.03.847.142 1.652.323 2.385a6.936 6.936 0 0 0-1.273.873A5.842 5.842 0 0 1 2.14 8.437Zm3.573 4.977a5.84 5.84 0 0 1-1.681-1.081c.289-.247.6-.464.928-.653.245.703.56 1.314.925 1.803a5.781 5.781 0 0 1-.172-.069Zm4.572 0c-.058.024-.114.047-.172.069.366-.49.68-1.1.925-1.803.328.187.64.406.928.653a5.841 5.841 0 0 1-1.681 1.081Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Gold.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Gold = createIcon({\n  displayName: \"Gold\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M5.34375 7.375H10.6875C10.6938 7.375 10.7016 7.375 10.7078 7.37344C10.7766 7.3625 10.8219 7.29844 10.8109 7.22969L10.1828 3.35469C10.1734 3.29375 10.1203 3.25 10.0594 3.25H5.97188C5.91094 3.25 5.85781 3.29375 5.84844 3.35469L5.22031 7.22969C5.21875 7.23594 5.21875 7.24375 5.21875 7.25C5.21875 7.31875 5.275 7.375 5.34375 7.375ZM6.76875 4.3125H9.26094L9.58438 6.3125H6.44375L6.76875 4.3125ZM6.80781 8.72969C6.79844 8.66875 6.74531 8.625 6.68437 8.625H2.59687C2.53594 8.625 2.48281 8.66875 2.47344 8.72969L1.84531 12.6047C1.84375 12.6109 1.84375 12.6187 1.84375 12.625C1.84375 12.6938 1.9 12.75 1.96875 12.75H7.3125C7.31875 12.75 7.32656 12.75 7.33281 12.7484C7.40156 12.7375 7.44688 12.6734 7.43594 12.6047L6.80781 8.72969ZM3.07031 11.6875L3.39375 9.6875H5.88594L6.20937 11.6875H3.07031ZM14.1547 12.6047L13.5266 8.72969C13.5172 8.66875 13.4641 8.625 13.4031 8.625H9.31563C9.25469 8.625 9.20156 8.66875 9.19219 8.72969L8.56406 12.6047C8.5625 12.6109 8.5625 12.6187 8.5625 12.625C8.5625 12.6938 8.61875 12.75 8.6875 12.75H14.0312C14.0375 12.75 14.0453 12.75 14.0516 12.7484C14.1187 12.7375 14.1656 12.6734 14.1547 12.6047ZM9.78906 11.6875L10.1125 9.6875H12.6047L12.9281 11.6875H9.78906Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/History.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const History = createIcon({\n  displayName: \"History\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M12.5641 6.39844H11.4368C11.3337 6.39844 11.2493 6.48282 11.2493 6.58594V13.0383C11.2493 13.0992 11.2774 13.1555 11.3266 13.1906L15.2009 16.0195C15.2852 16.0805 15.4024 16.0641 15.4634 15.9797L16.1337 15.0656C16.197 14.9789 16.1782 14.8617 16.0938 14.8031L12.7516 12.3867V6.58594C12.7516 6.48282 12.6673 6.39844 12.5641 6.39844ZM17.7157 8.16094L21.3907 9.0586C21.5079 9.08672 21.6227 8.99766 21.6227 8.87813L21.6415 5.09297C21.6415 4.93594 21.461 4.84688 21.3391 4.94532L17.6454 7.83047C17.6175 7.85207 17.5962 7.8811 17.5841 7.91424C17.5719 7.94738 17.5694 7.98327 17.5767 8.0178C17.5841 8.05232 17.601 8.08407 17.6256 8.10939C17.6502 8.13471 17.6814 8.15258 17.7157 8.16094ZM21.6462 15.218L20.3173 14.7609C20.2709 14.7451 20.2202 14.7479 20.176 14.769C20.1318 14.79 20.0975 14.8275 20.0805 14.8734C20.036 14.993 19.9891 15.1102 19.9399 15.2273C19.5227 16.2141 18.9251 17.1023 18.161 17.8641C17.4054 18.622 16.51 19.2261 15.5243 19.643C14.5032 20.0747 13.4056 20.2963 12.297 20.2945C11.1766 20.2945 10.0915 20.0766 9.06961 19.643C8.08392 19.2261 7.18847 18.622 6.43289 17.8641C5.67117 17.1023 5.07352 16.2141 4.65399 15.2273C4.22465 14.2057 4.00468 13.1082 4.00711 12C4.00711 10.8797 4.22508 9.79219 4.65867 8.77032C5.07586 7.7836 5.67352 6.89532 6.43758 6.1336C7.19316 5.37567 8.08861 4.77154 9.0743 4.35469C10.0915 3.9211 11.179 3.70313 12.2993 3.70313C13.4196 3.70313 14.5048 3.9211 15.5266 4.35469C16.5123 4.77154 17.4078 5.37567 18.1634 6.1336C18.4024 6.375 18.6274 6.62578 18.8337 6.89063L20.2352 5.79375C18.3907 3.43594 15.5196 1.91953 12.2946 1.92188C6.67899 1.92422 2.16961 6.48516 2.22586 12.1031C2.28211 17.6227 6.77039 22.0781 12.2993 22.0781C16.647 22.0781 20.3501 19.3219 21.761 15.4617C21.7962 15.3633 21.7446 15.2531 21.6462 15.218Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Image.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Image = createIcon({\n  displayName: \"Image\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z\"></path>\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Laptop.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Laptop = createIcon({\n  displayName: \"Laptop\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M14.9514 13.2047L14.0061 9.875V2.625C14.0061 2.34844 13.7826 2.125 13.5061 2.125H2.50607C2.22951 2.125 2.00607 2.34844 2.00607 2.625V9.875L1.06076 13.2047C0.943572 13.5312 1.1842 13.875 1.53107 13.875H14.4811C14.8279 13.875 15.0686 13.5312 14.9514 13.2047ZM3.13107 3.25H12.8811V9.42188H3.13107V3.25V3.25ZM6.69826 12.75L6.82482 12.1719H9.17326L9.29982 12.75H6.69826V12.75ZM10.1983 12.75L9.89982 11.3953C9.88732 11.3375 9.83576 11.2969 9.77795 11.2969H6.2217C6.16232 11.2969 6.11232 11.3375 6.09982 11.3953L5.80138 12.75H2.3592L3.02013 10.4219H12.992L13.6529 12.75H10.1983Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/LockDuotone.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const LockDuotone = createIcon({\n  displayName: \"LockDuotone\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M19.5 10.875H17.9062V5.625C17.9062 3.96797 16.5633 2.625 14.9062 2.625H9.09375C7.43672 2.625 6.09375 3.96797 6.09375 5.625V10.875H4.5C4.08516 10.875 3.75 11.2102 3.75 11.625V20.625C3.75 21.0398 4.08516 21.375 4.5 21.375H19.5C19.9148 21.375 20.25 21.0398 20.25 20.625V11.625C20.25 11.2102 19.9148 10.875 19.5 10.875ZM7.78125 5.625C7.78125 4.90078 8.36953 4.3125 9.09375 4.3125H14.9062C15.6305 4.3125 16.2188 4.90078 16.2188 5.625V10.875H7.78125V5.625ZM18.5625 19.6875H5.4375V12.5625H18.5625V19.6875Z\"\n    />,\n    <path\n      key=\"2\"\n      opacity=\"0.1\"\n      d=\"M5.4375 19.6875H18.5625V12.5625H5.4375V19.6875ZM12 14.3906C12.2381 14.3907 12.4701 14.4663 12.6625 14.6065C12.8549 14.7468 12.9979 14.9445 13.0708 15.1711C13.1438 15.3978 13.1429 15.6417 13.0684 15.8679C12.9939 16.0941 12.8496 16.2908 12.6562 16.4297V17.6719C12.6562 17.775 12.5719 17.8594 12.4688 17.8594H11.5312C11.4281 17.8594 11.3438 17.775 11.3438 17.6719V16.4297C11.1504 16.2908 11.0061 16.0941 10.9316 15.8679C10.8571 15.6417 10.8562 15.3978 10.9292 15.1711C11.0021 14.9445 11.1451 14.7468 11.3375 14.6065C11.5299 14.4663 11.7619 14.3907 12 14.3906Z\"\n    />,\n    <path\n      key=\"3\"\n      d=\"M11.3435 16.43V17.6722C11.3435 17.7753 11.4279 17.8597 11.531 17.8597H12.4685C12.5716 17.8597 12.656 17.7753 12.656 17.6722V16.43C12.8495 16.2911 12.9939 16.0944 13.0684 15.8682C13.143 15.642 13.1438 15.398 13.0709 15.1713C12.9979 14.9446 12.8549 14.7468 12.6624 14.6066C12.4699 14.4663 12.2379 14.3907 11.9997 14.3907C11.7616 14.3907 11.5296 14.4663 11.3371 14.6066C11.1446 14.7468 11.0016 14.9446 10.9286 15.1713C10.8556 15.398 10.8565 15.642 10.9311 15.8682C11.0056 16.0944 11.15 16.2911 11.3435 16.43Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Loft.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Loft = createIcon({\n  displayName: \"Loft\",\n  viewBox: \"0 0 270.6 137.3\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      fill=\"#00BCFF\"\n      d=\"M124,57.5c-3.6-3.8-8-6.8-13.1-9c-5.1-2.1-10.7-3.2-16.8-3.2c-6,0-11.5,1.1-16.6,3.2c-5.1,2.1-9.5,5.1-13.1,9\n            c-3.7,3.8-6.6,8.5-8.7,14c-2.1,5.5-3.1,9-3.1,15.6c0,6.6,1,12.7,3,18.2c2,5.5,4.9,10.2,8.5,14.1c3.6,3.9,8,6.9,13.1,9.1\n            c5.1,2.1,10.7,3.2,16.9,3.2c6.3,0,12-1.1,17.1-3.2c5.1-2.1,9.4-5.2,13.1-9.1c3.6-3.9,6.4-8.6,8.3-14.1c1.9-5.5,2.9-11.6,2.9-18.2\n            c0-6.6-1-10.2-3-15.6C130.4,66,127.6,61.3,124,57.5z M106.7,104.6c-2.9,4.3-7.1,6.5-12.6,6.5c-5.5,0-9.7-2.2-12.7-6.5\n            c-3-4.3-4.5-10.2-4.5-17.6c0-7.4,1.5-10.7,4.5-14.9c3-4.2,7.2-6.3,12.7-6.3c5.5,0,9.6,2.1,12.6,6.3c2.9,4.2,4.4,7.5,4.4,14.9\n            C111.1,94.4,109.7,100.3,106.7,104.6z\"\n    />,\n    <polygon\n      key=\"2\"\n      fill=\"#00BCFF\"\n      points=\"132.5,47.8 132.5,26.6 94.3,5.4 56.1,26.6 56.1,47.8 94.3,26.6\"\n    />,\n    <path\n      key=\"3\"\n      fill=\"#00BCFF\"\n      d=\"M260.3,109.9c-2.2,0.9-4.7,1.5-7.5,2c-2.7,0.5-5.4,0.7-7.9,0.7c-5.3,0-8.9-1.5-10.7-4.5c-1.8-3-2.6-7-2.6-12\n    V69.4h28.7V49.5h-28.7V20.7l-23.9,12.8v16h-36.4v-7.2c0-2.2,0.2-4.3,0.7-6.3c0.5-1.9,1.3-3.6,2.4-5c1.1-1.4,2.7-2.5,4.7-3.3\n    c2-0.8,4.4-1.2,7.3-1.2c1.8,0,3.7,0.2,5.8,0.5c0,0,0,0,0,0c1.8,0.3,4.3,0.7,5.4,1.3l4-19c-4-2-10.9-2.7-10.9-2.7l0,0\n    c-2.1-0.2-4.4-0.4-6.7-0.4c-12.1,0-21.2,3.2-27.3,9.6c-6.1,6.4-9.2,15.1-9.2,26v88.8h23.9V69.4h36.4v27c0,5.5,0.5,10.4,1.5,14.9\n    c1,4.5,2.8,8.3,5.4,11.5c2.6,3.2,6,5.6,10.3,7.4c4.3,1.8,9.7,2.6,16.2,2.6c5.1,0,9.5-0.4,13-1.3c3.5-0.9,6.7-1.9,9.6-3L260.3,109.9\n    z\"\n    />,\n    <path\n      key=\"4\"\n      fill=\"#00BCFF\"\n      d=\"M42.4,112.3c-1.1,0-2.2-0.2-3.3-0.6c-0.3-0.1-0.6-0.2-0.9-0.3c-1.7-0.7-3-1.7-3.9-2.9\n    c-0.9-1.2-1.5-2.6-1.8-4.3c-0.3-1.7-0.5-3.6-0.5-5.8V4.5L8,16.3v86.8c0,4.5,0.5,8.5,1.4,12.1c0.9,3.6,2.6,6.6,5.1,9.1\n    c2.5,2.5,5.9,4.5,10.3,5.9c3.5,1.1,7.9,1.8,13.1,2.1l3.3,0.1c0.1,0,0.1,0,0.2,0c0.1,0,0.1,0,0.2,0l0,0c4.3,0,7.1-0.2,10.7-1.4\n    c0.8-0.3,1.6-0.5,2.3-0.9l-10.2-18C43.7,112.4,43.4,112.3,42.4,112.3z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/LoftDevpodPro.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const LoftDevPodPro = createIcon({\n  displayName: \"LoftDevPodPro\",\n  viewBox: \"0 0 684 350\",\n  defaultProps,\n  path: [\n    <rect\n      key={1}\n      width=\"131.39\"\n      height=\"59.72\"\n      x=\"277.15\"\n      y=\"206.89\"\n      fill=\"#ba50ff\"\n      rx=\"9.97\"\n      ry=\"9.97\"\n    />,\n    <path\n      key={2}\n      d=\"M561.25 130.82c-2.37-2.52-5.17-4.46-8.48-5.82-3.31-1.37-6.9-2.08-10.85-2.08s-7.47.72-10.71 2.08c-3.31 1.37-6.11 3.31-8.48 5.82-2.37 2.52-4.24 5.46-5.61 8.98-1.37 3.52-2.01 7.4-2.01 11.71s.65 8.19 1.94 11.79c1.29 3.59 3.16 6.61 5.46 9.13 2.37 2.52 5.17 4.46 8.48 5.89 3.31 1.37 6.9 2.08 10.92 2.08s7.76-.72 11.07-2.08c3.31-1.37 6.11-3.31 8.48-5.89 2.37-2.52 4.17-5.53 5.39-9.13 1.22-3.59 1.87-7.47 1.87-11.79s-.65-8.19-1.94-11.71c-1.37-3.45-3.23-6.47-5.53-8.98Zm-11.14 32.12c-1.87 2.8-4.6 4.17-8.12 4.17s-6.25-1.37-8.19-4.17c-1.94-2.8-2.87-6.61-2.87-11.35s.93-8.55 2.87-11.28c1.94-2.73 4.67-4.1 8.19-4.1s6.25 1.37 8.12 4.1c1.87 2.73 2.87 6.47 2.87 11.28-.07 4.74-1.01 8.55-2.87 11.35ZM504.62 115.23c-5.82-3.81-14.16-5.75-25.08-5.75-3.02 0-6.54.14-10.49.43-4.02.29-7.76.79-11.35 1.51v68.85h16.46v-21.34h5.17c10.92 0 19.4-1.94 25.3-5.82 5.89-3.88 8.84-10.2 8.84-18.97-.07-8.77-3.02-15.09-8.84-18.9Zm-12.5 27.31c-2.87 1.51-7.19 2.3-12.86 2.3h-5.17v-21.06c.86-.07 1.87-.14 3.02-.22 1.15-.07 2.3-.07 3.52-.07 2.37 0 4.53.14 6.54.5 1.94.29 3.67.86 5.03 1.65 1.37.79 2.44 1.87 3.16 3.23.72 1.37 1.08 3.02 1.08 5.03 0 4.24-1.44 7.11-4.31 8.62ZM330.35 118.17c-3.59-2.95-7.83-5.1-12.79-6.47-4.96-1.37-10.49-2.08-16.6-2.08-2.87 0-6.32.14-10.35.36-4.02.22-7.83.72-11.57 1.37v67.34c3.67.79 7.47 1.22 11.28 1.51 3.81.22 7.19.36 10.06.36 6.32 0 12-.79 17.03-2.23 5.1-1.51 9.34-3.74 12.86-6.76 3.52-3.02 6.25-6.83 8.19-11.43 1.94-4.6 2.87-7.91 2.87-14.09s-.93-11.93-2.87-16.53c-1.8-4.67-4.53-8.41-8.12-11.35Zm-11.21 42.54c-3.88 4.02-9.85 6.04-17.82 6.04-1.37 0-2.59 0-3.52-.07-1.01 0-1.87-.07-2.59-.14v-42.9c1.01-.14 2.16-.22 3.31-.29 1.15 0 2.3-.07 3.38-.07 8.05 0 13.87 1.94 17.61 5.75 3.67 3.81 5.53 9.49 5.53 16.96-.07 7.19-2.01 10.71-5.89 14.73ZM432.76 134.85c-.93 3.09-1.87 6.25-2.87 9.49-1.01 3.16-2.01 6.25-3.02 9.27-1.01 3.02-2.01 5.75-2.87 8.19-.93-2.44-1.94-5.17-2.95-8.19-1.01-3.02-2.01-6.11-3.02-9.27-1.01-3.16-1.94-6.32-2.87-9.49-.93-3.09-1.72-6.04-2.44-8.7h-16.24c3.23 10.85 6.68 20.84 10.28 30.04 3.59 9.2 7.19 17.18 10.71 24.07h12.72c3.52-6.83 7.04-14.88 10.64-24.07 3.59-9.2 7.04-19.19 10.28-30.04H435.3c-.79 2.66-1.58 5.53-2.52 8.7ZM391.29 165.25c-.07 0-.14.07-.22.07-1.22.5-2.44.86-3.67 1.22-.86.22-1.72.43-2.73.57-1.29.22-2.66.43-3.95.57-1.44.14-2.87.22-4.31.22-4.38 0-7.91-.93-10.49-2.8-2.59-1.87-4.1-4.38-4.38-7.47h34.71c.07-.79.14-1.8.22-2.8.07-1.08.07-2.01.07-2.95 0-9.13-2.23-16.03-6.68-20.7-4.46-4.67-10.49-7.04-18.18-7.04-3.31 0-6.47.65-9.63 1.87-3.09 1.22-5.89 3.02-8.26 5.46-2.37 2.37-4.31 5.39-5.82 8.98-1.51 3.59-2.23 7.76-2.23 12.58 0 3.95.57 7.69 1.72 11.07 1.15 3.45 2.87 6.4 5.25 8.91 2.37 2.52 5.32 4.46 8.91 5.89 3.59 1.44 7.83 2.16 12.72 2.16 1.94 0 3.81-.07 5.75-.29.43-.07.79-.07 1.22-.14 10.56-1.15 16.46-4.31 16.46-4.31l-4.1-12.29c-.79.5-1.58.86-2.37 1.22Zm-28.89-21.92c.43-1.29 1.08-2.37 1.87-3.31.79-.93 1.87-1.72 3.09-2.3 1.22-.57 2.73-.86 4.38-.86 1.8 0 3.31.29 4.46.93 1.22.65 2.16 1.44 2.95 2.37.79.93 1.37 2.08 1.72 3.31.36 1.22.57 2.52.65 3.81h-20.05c.22-1.44.5-2.73.93-3.95ZM609.69 112.35v12.72c-1.72-.79-3.52-1.37-5.25-1.8-1.72-.43-3.67-.65-5.82-.65-3.95 0-7.4.65-10.49 2.01-3.02 1.37-5.61 3.23-7.76 5.82-2.08 2.52-3.74 5.61-4.81 9.2-1.15 3.59-1.65 7.69-1.65 12.15s.65 8.41 1.94 11.93c1.29 3.52 3.16 6.54 5.61 9.05 2.44 2.52 5.46 4.38 9.05 5.75 3.59 1.37 7.62 2.01 12.22 2.01 1.87 0 3.88-.07 5.96-.29 2.08-.14 4.1-.43 6.11-.72 2.01-.29 3.88-.65 5.75-1.01 1.8-.36 3.45-.79 4.81-1.22v-72.64l-15.67 7.69Zm0 54.33c-.79.14-1.72.29-2.95.36-1.22.07-2.52.14-3.88.14-4.31 0-7.55-1.51-9.7-4.46-2.16-2.95-3.23-6.83-3.23-11.71 0-10.13 3.74-15.16 11.14-15.16 1.58 0 3.23.22 4.81.65 1.58.43 2.87.93 3.81 1.58v28.6ZM117.33 214.7l82.76-155.31h-29.45l-68.9 129.3-14.4-26.01 28.7-51.7h-28.7l-28.69 51.7 28.69 51.69h.75l-.21.33h29.45zM213.95 111.63h-.65l.11-.33h-29.45l-82.75 155.31h29.45l68.89-129.3 14.4 26.01-28.7 51.7h28.7l28.7-51.7-28.7-51.69z\"\n      fill=\"#ba50ff\"\n    />,\n    <path\n      key={3}\n      d=\"M303.8 248.74c0 .99-.33 1.79-.99 2.41s-1.46.93-2.39.93-1.76-.31-2.41-.93c-.65-.62-.97-1.42-.97-2.41s.32-1.8.97-2.43c.65-.63 1.45-.95 2.41-.95s1.72.32 2.39.95.99 1.44.99 2.43ZM317.83 221.95c4.25 0 7.51.78 9.78 2.32 2.27 1.55 3.4 3.97 3.4 7.27 0 1.72-.3 3.19-.91 4.42a7.707 7.707 0 0 1-2.64 3c-1.16.78-2.56 1.35-4.23 1.71-1.66.37-3.56.55-5.7.55h-2.66v10.31h-5.32v-28.86c1.24-.28 2.61-.47 4.12-.57s2.89-.15 4.16-.15Zm.38 4.61c-1.35 0-2.46.04-3.34.13v9.97h2.58c2.56 0 4.54-.36 5.92-1.08 1.38-.72 2.07-2.08 2.07-4.08 0-.96-.18-1.76-.55-2.41-.37-.65-.87-1.15-1.52-1.52-.65-.37-1.42-.63-2.3-.78-.89-.15-1.84-.23-2.85-.23ZM343.94 221.95c4.23 0 7.46.78 9.7 2.32 2.24 1.55 3.36 3.92 3.36 7.1 0 3.97-1.96 6.66-5.87 8.07.54.65 1.14 1.44 1.82 2.37s1.37 1.94 2.07 3.02c.7 1.08 1.38 2.2 2.03 3.34.65 1.14 1.23 2.26 1.73 3.36h-5.96a68.88 68.88 0 0 0-1.73-3.06c-.62-1.03-1.25-2.03-1.88-3a68.7 68.7 0 0 0-3.61-5.05c-.39.03-.73.04-1.01.04h-3.38v11.07h-5.32v-28.86c1.3-.28 2.68-.47 4.14-.57 1.46-.1 2.77-.15 3.93-.15Zm.38 4.61c-1.13 0-2.17.04-3.13.13v9.46h2.32c1.29 0 2.44-.07 3.42-.21.99-.14 1.81-.39 2.47-.76.66-.37 1.16-.86 1.5-1.48.34-.62.51-1.41.51-2.37 0-.9-.17-1.66-.51-2.28s-.82-1.11-1.46-1.48-1.39-.63-2.26-.78c-.87-.15-1.83-.23-2.87-.23ZM389.75 236.86c0 2.51-.37 4.72-1.12 6.63-.75 1.92-1.76 3.51-3.04 4.79a12.427 12.427 0 0 1-4.5 2.89c-1.72.65-3.55.97-5.49.97s-3.78-.32-5.51-.97c-1.73-.65-3.24-1.61-4.52-2.89-1.28-1.28-2.3-2.88-3.06-4.79s-1.14-4.13-1.14-6.63.38-4.71 1.14-6.61c.76-1.9 1.8-3.5 3.11-4.79 1.31-1.3 2.82-2.27 4.54-2.92 1.72-.65 3.53-.97 5.45-.97s3.73.32 5.45.97c1.72.65 3.22 1.62 4.5 2.92 1.28 1.29 2.3 2.89 3.06 4.79.76 1.9 1.14 4.11 1.14 6.61Zm-22.86 0c0 1.61.2 3.06.59 4.37.39 1.31.96 2.42 1.71 3.34s1.65 1.63 2.73 2.13c1.07.51 2.28.76 3.63.76s2.52-.25 3.59-.76a7.899 7.899 0 0 0 2.73-2.13c.75-.92 1.32-2.03 1.71-3.34.39-1.31.59-2.77.59-4.37s-.2-3.06-.59-4.37c-.39-1.31-.96-2.42-1.71-3.34a7.669 7.669 0 0 0-2.73-2.13c-1.07-.51-2.27-.76-3.59-.76s-2.56.25-3.63.76a7.75 7.75 0 0 0-2.73 2.16c-.75.93-1.32 2.04-1.71 3.34-.4 1.29-.59 2.75-.59 4.35Z\"\n      fill=\"#fff\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/MatchCase.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"@/icons/defaultProps\"\n\nexport const MatchCase = createIcon({\n  displayName: \"MatchCase\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <>\n      <g clipPath=\"url(#clip0_619_349)\">\n        <path d=\"M11.1782 12.6321C10.7635 12.6321 10.3899 12.5582 10.0575 12.4105C9.72794 12.2599 9.46658 12.0383 9.2734 11.7457C9.08306 11.4531 8.98788 11.0923 8.98788 10.6633C8.98788 10.294 9.05607 9.98863 9.19243 9.74715C9.32879 9.50567 9.51487 9.31249 9.75067 9.1676C9.98646 9.02272 10.2521 8.91334 10.5475 8.83948C10.8458 8.76277 11.1541 8.70738 11.4723 8.67329C11.8558 8.63351 12.1669 8.598 12.4055 8.56675C12.6441 8.53266 12.8174 8.48152 12.9254 8.41334C13.0362 8.34232 13.0916 8.23294 13.0916 8.08522V8.05965C13.0916 7.73863 12.9964 7.49005 12.8061 7.31391C12.6157 7.13777 12.3416 7.04971 11.9836 7.04971C11.6058 7.04971 11.3061 7.13209 11.0845 7.29687C10.8657 7.46164 10.718 7.65624 10.6413 7.88067L9.20095 7.67613C9.31459 7.2784 9.50209 6.94601 9.76345 6.67897C10.0248 6.40908 10.3444 6.20738 10.7223 6.07385C11.1001 5.93749 11.5177 5.86931 11.9751 5.86931C12.2904 5.86931 12.6044 5.90624 12.9169 5.9801C13.2294 6.05397 13.5149 6.17613 13.7734 6.34658C14.0319 6.51419 14.2393 6.74289 14.3956 7.03266C14.5546 7.32243 14.6342 7.68465 14.6342 8.11931V12.5H13.1512V11.6008H13.1001C13.0064 11.7827 12.8742 11.9531 12.7038 12.1122C12.5362 12.2685 12.3245 12.3949 12.0689 12.4915C11.816 12.5852 11.5191 12.6321 11.1782 12.6321ZM11.5788 11.4986C11.8885 11.4986 12.1569 11.4375 12.3842 11.3153C12.6115 11.1903 12.7862 11.0256 12.9083 10.821C13.0333 10.6165 13.0958 10.3935 13.0958 10.152V9.38067C13.0475 9.42045 12.9652 9.45738 12.8487 9.49147C12.735 9.52556 12.6072 9.55539 12.4652 9.58096C12.3231 9.60652 12.1825 9.62925 12.0433 9.64914C11.9041 9.66902 11.7833 9.68607 11.6811 9.70027C11.451 9.73152 11.245 9.78266 11.0632 9.85368C10.8814 9.92471 10.7379 10.0241 10.6328 10.152C10.5277 10.277 10.4751 10.4389 10.4751 10.6378C10.4751 10.9219 10.5788 11.1364 10.7862 11.2812C10.9936 11.4261 11.2578 11.4986 11.5788 11.4986Z\" />\n        <path d=\"M1.68002 12.5H-0.00747681L3.06497 3.77272H5.01667L8.09338 12.5H6.40588L4.07491 5.56249H4.00673L1.68002 12.5ZM1.73542 9.07812H6.33769V10.348H1.73542V9.07812Z\" />\n      </g>\n      <defs>\n        <clipPath id=\"clip0_619_349\">\n          <rect width=\"16\" height=\"16\" />\n        </clipPath>\n      </defs>\n    </>\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Memory.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Memory = createIcon({\n  displayName: \"Memory\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      fillRule=\"evenodd\"\n      clipRule=\"evenodd\"\n      d=\"M17.5 2.50012H6.5V21.5001H17.5V2.50012ZM6.5 1.00012C5.67157 1.00012 5 1.67169 5 2.50012V21.5001C5 22.3285 5.67157 23.0001 6.5 23.0001H17.5C18.3284 23.0001 19 22.3285 19 21.5001V2.50012C19 1.67169 18.3284 1.00012 17.5 1.00012H6.5Z\"\n    />,\n    <path key=\"2\" d=\"M1 5.00012H5V7.00012H1V5.00012Z\" />,\n    <path key=\"3\" d=\"M19 5.00012H23V7.00012H19V5.00012Z\" />,\n    <path key=\"4\" d=\"M1 9.00012H5V11.0001H1V9.00012Z\" />,\n    <path key=\"5\" d=\"M19 9.00012H23V11.0001H19V9.00012Z\" />,\n    <path key=\"6\" d=\"M1 13.0001H5V15.0001H1V13.0001Z\" />,\n    <path key=\"7\" d=\"M19 13.0001H23V15.0001H19V13.0001Z\" />,\n    <path key=\"8\" d=\"M1 17.0001H5V19.0001H1V17.0001Z\" />,\n    <path key=\"9\" d=\"M19 17.0001H23V19.0001H19V17.0001Z\" />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/NotFound.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const NotFound = createIcon({\n  displayName: \"NotFound\",\n  viewBox: \"0 0 12 14\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      clipRule=\"evenodd\"\n      d=\"M0.325745 0H7.86359L11.6742 3.81064V14H0.325745V0ZM1.38635 1.06061V12.9394H10.6136V5.51515H5.94696V1.06061H1.38635ZM7.00756 1.06061V4.45455H10.6136V4.24996L7.42427 1.06061H7.00756ZM2.97726 5.51515V3.39394H4.03787V5.51515H2.97726ZM7.70772 11.0704C6.94361 9.65675 4.94482 9.57688 4.07036 10.925L3.95247 11.1068L3.06266 10.5296L3.18056 10.3478C4.49325 8.32411 7.49371 8.444 8.64074 10.566L7.70772 11.0704Z\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Parameters.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Parameters = createIcon({\n  displayName: \"Parameters\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M13 1H3C2.72344 1 2.5 1.22344 2.5 1.5V14.5C2.5 14.7766 2.72344 15 3 15H13C13.2766 15 13.5 14.7766 13.5 14.5V1.5C13.5 1.22344 13.2766 1 13 1ZM3.625 2.125H12.375V5.375H3.625V2.125ZM12.375 9.625H3.625V6.375H12.375V9.625ZM12.375 13.875H3.625V10.625H12.375V13.875ZM4.75 3.75C4.75 3.91576 4.81585 4.07473 4.93306 4.19194C5.05027 4.30915 5.20924 4.375 5.375 4.375C5.54076 4.375 5.69973 4.30915 5.81694 4.19194C5.93415 4.07473 6 3.91576 6 3.75C6 3.58424 5.93415 3.42527 5.81694 3.30806C5.69973 3.19085 5.54076 3.125 5.375 3.125C5.20924 3.125 5.05027 3.19085 4.93306 3.30806C4.81585 3.42527 4.75 3.58424 4.75 3.75V3.75ZM4.75 8C4.75 8.16576 4.81585 8.32473 4.93306 8.44194C5.05027 8.55915 5.20924 8.625 5.375 8.625C5.54076 8.625 5.69973 8.55915 5.81694 8.44194C5.93415 8.32473 6 8.16576 6 8C6 7.83424 5.93415 7.67527 5.81694 7.55806C5.69973 7.44085 5.54076 7.375 5.375 7.375C5.20924 7.375 5.05027 7.44085 4.93306 7.55806C4.81585 7.67527 4.75 7.83424 4.75 8V8ZM4.75 12.25C4.75 12.4158 4.81585 12.5747 4.93306 12.6919C5.05027 12.8092 5.20924 12.875 5.375 12.875C5.54076 12.875 5.69973 12.8092 5.81694 12.6919C5.93415 12.5747 6 12.4158 6 12.25C6 12.0842 5.93415 11.9253 5.81694 11.8081C5.69973 11.6908 5.54076 11.625 5.375 11.625C5.20924 11.625 5.05027 11.6908 4.93306 11.8081C4.81585 11.9253 4.75 12.0842 4.75 12.25V12.25Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Pause.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Pause = createIcon({\n  displayName: \"Pause\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path d=\"M5.75 3a.75.75 0 00-.75.75v12.5c0 .414.336.75.75.75h1.5a.75.75 0 00.75-.75V3.75A.75.75 0 007.25 3h-1.5zM12.75 3a.75.75 0 00-.75.75v12.5c0 .414.336.75.75.75h1.5a.75.75 0 00.75-.75V3.75a.75.75 0 00-.75-.75h-1.5z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Play.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Play = createIcon({\n  displayName: \"Play\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path d=\"M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Plus.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Plus = createIcon({\n  displayName: \"Plus\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path d=\"M10.75 6.75a.75.75 0 00-1.5 0v2.5h-2.5a.75.75 0 000 1.5h2.5v2.5a.75.75 0 001.5 0v-2.5h2.5a.75.75 0 000-1.5h-2.5v-2.5z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Preset.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Preset = createIcon({\n  displayName: \"Preset\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <path d=\"M5.34375 7.375H10.6875C10.6938 7.375 10.7016 7.375 10.7078 7.37344C10.7766 7.3625 10.8219 7.29844 10.8109 7.22969L10.1828 3.35469C10.1734 3.29375 10.1203 3.25 10.0594 3.25H5.97188C5.91094 3.25 5.85781 3.29375 5.84844 3.35469L5.22031 7.22969C5.21875 7.23594 5.21875 7.24375 5.21875 7.25C5.21875 7.31875 5.275 7.375 5.34375 7.375ZM6.76875 4.3125H9.26094L9.58438 6.3125H6.44375L6.76875 4.3125ZM6.80781 8.72969C6.79844 8.66875 6.74531 8.625 6.68437 8.625H2.59687C2.53594 8.625 2.48281 8.66875 2.47344 8.72969L1.84531 12.6047C1.84375 12.6109 1.84375 12.6187 1.84375 12.625C1.84375 12.6938 1.9 12.75 1.96875 12.75H7.3125C7.31875 12.75 7.32656 12.75 7.33281 12.7484C7.40156 12.7375 7.44688 12.6734 7.43594 12.6047L6.80781 8.72969ZM3.07031 11.6875L3.39375 9.6875H5.88594L6.20937 11.6875H3.07031ZM14.1547 12.6047L13.5266 8.72969C13.5172 8.66875 13.4641 8.625 13.4031 8.625H9.31563C9.25469 8.625 9.20156 8.66875 9.19219 8.72969L8.56406 12.6047C8.5625 12.6109 8.5625 12.6187 8.5625 12.625C8.5625 12.6938 8.61875 12.75 8.6875 12.75H14.0312C14.0375 12.75 14.0453 12.75 14.0516 12.7484C14.1187 12.7375 14.1656 12.6734 14.1547 12.6047ZM9.78906 11.6875L10.1125 9.6875H12.6047L12.9281 11.6875H9.78906Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/ProfileDuotone.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const ProfileDuotone = createIcon({\n  displayName: \"ProfileDuotone\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M20.625 2.625H3.375C2.96016 2.625 2.625 2.96016 2.625 3.375V20.625C2.625 21.0398 2.96016 21.375 3.375 21.375H20.625C21.0398 21.375 21.375 21.0398 21.375 20.625V3.375C21.375 2.96016 21.0398 2.625 20.625 2.625ZM19.6875 19.6875H4.3125V4.3125H19.6875V19.6875Z\"\n    />,\n    <path\n      key=\"2\"\n      opacity=\"0.1\"\n      d=\"M4.3125 19.6875H19.6875V4.3125H4.3125V19.6875ZM11.3438 8.0625C11.3438 7.95937 11.4281 7.875 11.5312 7.875H15.8438C15.9469 7.875 16.0312 7.95937 16.0312 8.0625V9.1875C16.0312 9.29063 15.9469 9.375 15.8438 9.375H11.5312C11.4281 9.375 11.3438 9.29063 11.3438 9.1875V8.0625ZM11.3438 11.4375C11.3438 11.3344 11.4281 11.25 11.5312 11.25H15.8438C15.9469 11.25 16.0312 11.3344 16.0312 11.4375V12.5625C16.0312 12.6656 15.9469 12.75 15.8438 12.75H11.5312C11.4281 12.75 11.3438 12.6656 11.3438 12.5625V11.4375ZM11.3438 14.8125C11.3438 14.7094 11.4281 14.625 11.5312 14.625H15.8438C15.9469 14.625 16.0312 14.7094 16.0312 14.8125V15.9375C16.0312 16.0406 15.9469 16.125 15.8438 16.125H11.5312C11.4281 16.125 11.3438 16.0406 11.3438 15.9375V14.8125ZM8.90625 7.6875C9.42422 7.6875 9.84375 8.10703 9.84375 8.625C9.84375 9.14297 9.42422 9.5625 8.90625 9.5625C8.38828 9.5625 7.96875 9.14297 7.96875 8.625C7.96875 8.10703 8.38828 7.6875 8.90625 7.6875ZM8.90625 11.0625C9.42422 11.0625 9.84375 11.482 9.84375 12C9.84375 12.518 9.42422 12.9375 8.90625 12.9375C8.38828 12.9375 7.96875 12.518 7.96875 12C7.96875 11.482 8.38828 11.0625 8.90625 11.0625ZM8.90625 14.4375C9.42422 14.4375 9.84375 14.857 9.84375 15.375C9.84375 15.893 9.42422 16.3125 8.90625 16.3125C8.38828 16.3125 7.96875 15.893 7.96875 15.375C7.96875 14.857 8.38828 14.4375 8.90625 14.4375Z\"\n    />,\n    <path\n      key=\"3\"\n      d=\"M7.96875 15.375C7.96875 15.6236 8.06752 15.8621 8.24334 16.0379C8.41915 16.2137 8.65761 16.3125 8.90625 16.3125C9.15489 16.3125 9.39335 16.2137 9.56916 16.0379C9.74498 15.8621 9.84375 15.6236 9.84375 15.375C9.84375 15.1264 9.74498 14.8879 9.56916 14.7121C9.39335 14.5363 9.15489 14.4375 8.90625 14.4375C8.65761 14.4375 8.41915 14.5363 8.24334 14.7121C8.06752 14.8879 7.96875 15.1264 7.96875 15.375ZM7.96875 12C7.96875 12.2486 8.06752 12.4871 8.24334 12.6629C8.41915 12.8387 8.65761 12.9375 8.90625 12.9375C9.15489 12.9375 9.39335 12.8387 9.56916 12.6629C9.74498 12.4871 9.84375 12.2486 9.84375 12C9.84375 11.7514 9.74498 11.5129 9.56916 11.3371C9.39335 11.1613 9.15489 11.0625 8.90625 11.0625C8.65761 11.0625 8.41915 11.1613 8.24334 11.3371C8.06752 11.5129 7.96875 11.7514 7.96875 12ZM7.96875 8.625C7.96875 8.87364 8.06752 9.1121 8.24334 9.28791C8.41915 9.46373 8.65761 9.5625 8.90625 9.5625C9.15489 9.5625 9.39335 9.46373 9.56916 9.28791C9.74498 9.1121 9.84375 8.87364 9.84375 8.625C9.84375 8.37636 9.74498 8.1379 9.56916 7.96209C9.39335 7.78627 9.15489 7.6875 8.90625 7.6875C8.65761 7.6875 8.41915 7.78627 8.24334 7.96209C8.06752 8.1379 7.96875 8.37636 7.96875 8.625ZM11.5312 16.125H15.8438C15.9469 16.125 16.0312 16.0406 16.0312 15.9375V14.8125C16.0312 14.7094 15.9469 14.625 15.8438 14.625H11.5312C11.4281 14.625 11.3438 14.7094 11.3438 14.8125V15.9375C11.3438 16.0406 11.4281 16.125 11.5312 16.125ZM11.5312 12.75H15.8438C15.9469 12.75 16.0312 12.6656 16.0312 12.5625V11.4375C16.0312 11.3344 15.9469 11.25 15.8438 11.25H11.5312C11.4281 11.25 11.3438 11.3344 11.3438 11.4375V12.5625C11.3438 12.6656 11.4281 12.75 11.5312 12.75ZM11.5312 9.375H15.8438C15.9469 9.375 16.0312 9.29062 16.0312 9.1875V8.0625C16.0312 7.95937 15.9469 7.875 15.8438 7.875H11.5312C11.4281 7.875 11.3438 7.95937 11.3438 8.0625V9.1875C11.3438 9.29062 11.4281 9.375 11.5312 9.375Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/ProviderPlaceholder.tsx",
    "content": "import { Icon, IconProps, useColorModeValue, useToken } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport function ProviderPlaceholder(iconProps: IconProps) {\n  const circleFillColorToken = useColorModeValue(\"gray.100\", \"gray.700\")\n  const circleFillColor = useToken(\"colors\", circleFillColorToken)\n\n  return (\n    <Icon viewBox=\"0 0 68 68\" {...defaultProps} {...iconProps}>\n      <circle key=\"1\" cx=\"34\" cy=\"34\" r=\"34\" fill={circleFillColor} />\n      <path\n        d=\"M33.644 23.5901C33.7534 23.5311 33.8757 23.5002 34 23.5002C34.1243 23.5002 34.2466 23.5311 34.356 23.5901L44.106 28.8401C44.2251 28.9044 44.3245 28.9997 44.3939 29.1158C44.4632 29.232 44.4998 29.3648 44.4998 29.5001C44.4998 29.6354 44.4632 29.7682 44.3939 29.8844C44.3245 30.0006 44.2251 30.0959 44.106 30.1601L34.356 35.4101C34.2466 35.4691 34.1243 35.5 34 35.5C33.8757 35.5 33.7534 35.4691 33.644 35.4101L23.894 30.1601C23.775 30.0959 23.6755 30.0006 23.6062 29.8844C23.5368 29.7682 23.5002 29.6354 23.5002 29.5001C23.5002 29.3648 23.5368 29.232 23.6062 29.1158C23.6755 28.9997 23.775 28.9044 23.894 28.8401L33.644 23.5901Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M25.265 32.6021L32.933 36.7311C33.2609 36.9077 33.6275 37.0002 34 37.0002C34.3724 37.0002 34.7391 36.9077 35.067 36.7311L42.735 32.6011L44.105 33.3401C44.2241 33.4043 44.3235 33.4996 44.3928 33.6158C44.4622 33.732 44.4988 33.8648 44.4988 34.0001C44.4988 34.1354 44.4622 34.2682 44.3928 34.3843C44.3235 34.5005 44.2241 34.5958 44.105 34.6601L34.355 39.9101C34.2459 39.9687 34.1239 39.9994 34 39.9994C33.8761 39.9994 33.7541 39.9687 33.645 39.9101L23.895 34.6601C23.7759 34.5958 23.6765 34.5005 23.6071 34.3843C23.5378 34.2682 23.5012 34.1354 23.5012 34.0001C23.5012 33.8648 23.5378 33.732 23.6071 33.6158C23.6765 33.4996 23.7759 33.4043 23.895 33.3401L25.265 32.6021Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M32.933 41.2311L25.265 37.1011L23.895 37.8401C23.7759 37.9043 23.6765 37.9996 23.6071 38.1158C23.5378 38.232 23.5012 38.3648 23.5012 38.5001C23.5012 38.6354 23.5378 38.7682 23.6071 38.8843C23.6765 39.0005 23.7759 39.0958 23.895 39.1601L33.645 44.4101C33.866 44.5301 34.134 44.5301 34.355 44.4101L44.105 39.1601C44.2241 39.0958 44.3235 39.0005 44.3928 38.8843C44.4622 38.7682 44.4988 38.6354 44.4988 38.5001C44.4988 38.3648 44.4622 38.232 44.3928 38.1158C44.3235 37.9996 44.2241 37.9043 44.105 37.8401L42.735 37.1021L35.067 41.2321C34.739 41.4085 34.3723 41.5008 33.9999 41.5007C33.6274 41.5005 33.2608 41.4079 32.933 41.2311Z\"\n        fill=\"currentColor\"\n      />\n    </Icon>\n  )\n}\n"
  },
  {
    "path": "desktop/src/icons/Search.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"@/icons/defaultProps\"\n\nexport const Search = createIcon({\n  displayName: \"Search\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <>\n      <g clipPath=\"url(#clip0_597_4191)\">\n        <path d=\"M15.2893 14.279L10.5281 9.51787C11.2669 8.56271 11.6666 7.39488 11.6666 6.16656C11.6666 4.69623 11.0928 3.31757 10.0551 2.27807C9.01745 1.23858 7.63513 0.66658 6.16663 0.66658C4.69814 0.66658 3.31581 1.24041 2.27815 2.27807C1.23865 3.31574 0.666656 4.69623 0.666656 6.16656C0.666656 7.63505 1.24049 9.01738 2.27815 10.055C3.31581 11.0945 4.69631 11.6665 6.16663 11.6665C7.39496 11.6665 8.56096 11.2669 9.51612 10.5299L14.2773 15.2892C14.2912 15.3032 14.3078 15.3142 14.326 15.3218C14.3443 15.3294 14.3638 15.3332 14.3836 15.3332C14.4033 15.3332 14.4229 15.3294 14.4411 15.3218C14.4594 15.3142 14.476 15.3032 14.4899 15.2892L15.2893 14.4917C15.3032 14.4777 15.3143 14.4612 15.3219 14.4429C15.3294 14.4247 15.3333 14.4051 15.3333 14.3854C15.3333 14.3656 15.3294 14.346 15.3219 14.3278C15.3143 14.3096 15.3032 14.293 15.2893 14.279ZM9.07062 9.07054C8.29329 9.84604 7.26296 10.2732 6.16663 10.2732C5.0703 10.2732 4.03998 9.84604 3.26265 9.07054C2.48715 8.29321 2.05998 7.26289 2.05998 6.16656C2.05998 5.07023 2.48715 4.03807 3.26265 3.26257C4.03998 2.48707 5.0703 2.05991 6.16663 2.05991C7.26296 2.05991 8.29512 2.48524 9.07062 3.26257C9.84612 4.0399 10.2733 5.07023 10.2733 6.16656C10.2733 7.26289 9.84612 8.29505 9.07062 9.07054Z\" />\n      </g>\n      <defs>\n        <clipPath id=\"clip0_597_4191\">\n          <rect width=\"16\" height=\"16\" />\n        </clipPath>\n      </defs>\n    </>\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Sleep.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Sleep = createIcon({\n  displayName: \"Sleep\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M11.5443 6.64431C11.8499 6.27765 11.5443 5.66655 11.0554 5.66655H8.61104V6.88877H9.83326L8.73327 8.35542C8.42771 8.72209 8.73327 9.33318 9.22216 9.33318H11.6666V8.11096H10.4444L11.5443 6.64431Z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M15.211 2.97768C15.5165 2.61102 15.211 1.99992 14.7221 1.99992H12.2777V3.22214H13.4999L12.3999 4.68879C12.0943 5.05546 12.3999 5.66655 12.8888 5.66655H15.3332V4.44433H14.111L15.211 2.97768Z\"\n    />,\n    <path\n      key=\"3\"\n      d=\"M8.54991 11.1665C6.59436 11.1054 4.94438 9.51649 4.94438 7.49985C4.94438 6.52209 5.31104 5.5443 6.04437 4.8721C6.47213 4.50544 6.1666 3.77211 5.55548 3.83321C2.86663 3.83321 0.666656 6.03319 0.666656 8.72207C0.666656 11.4109 2.86663 13.6109 5.5555 13.6109C6.83882 13.6109 8.06104 13.122 8.9777 12.2054C9.34434 11.8387 9.0999 11.1665 8.54991 11.1665ZM5.5555 12.3887C3.53886 12.3887 1.88888 10.7387 1.94998 8.66096C1.94998 7.13321 2.86663 5.78876 4.27218 5.29989C3.96662 5.97212 3.78329 6.70545 3.72219 7.49987C3.72219 9.57762 5.00551 11.4109 6.96105 12.0832C6.53326 12.2665 6.04437 12.3887 5.5555 12.3887Z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Stack3D.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Stack3D = createIcon({\n  displayName: \"Stack3D\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: [\n    <path\n      key=\"1\"\n      d=\"M3.196 12.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 12.87z\"\n    />,\n    <path\n      key=\"2\"\n      d=\"M3.196 8.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 8.87z\"\n    />,\n    <path\n      key=\"3\"\n      d=\"M10.38 1.103a.75.75 0 00-.76 0l-7.25 4.25a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.76 0l7.25-4.25a.75.75 0 000-1.294l-7.25-4.25z\"\n    />,\n  ],\n})\n"
  },
  {
    "path": "desktop/src/icons/Status.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Status = createIcon({\n  displayName: \"Status\",\n  viewBox: \"0 0 16 17\",\n  defaultProps,\n  path: (\n    <path d=\"M13.353 5.01 9.991 1.646a.5.5 0 0 0-.354-.147H3a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V5.364a.503.503 0 0 0-.147-.355Zm-1.006.584h-2.94v-2.94l2.94 2.94Zm.028 8.781h-8.75V2.625h4.719V6A.656.656 0 0 0 9 6.656h3.375v7.719Zm-4.5-4.219H5a.125.125 0 0 0-.125.125v.75c0 .069.056.125.125.125h2.875A.125.125 0 0 0 8 11.031v-.75a.125.125 0 0 0-.125-.125Zm-3-2v.75c0 .069.056.125.125.125h6a.125.125 0 0 0 .125-.125v-.75A.125.125 0 0 0 11 8.031H5a.125.125 0 0 0-.125.125Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Stop.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Stop = createIcon({\n  displayName: \"Stop\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path d=\"M5 5h10v10H5z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Template.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Template = createIcon({\n  displayName: \"Template\",\n  viewBox: \"0 0 24 25\",\n  defaultProps,\n  path: (\n    <path d=\"M6.9375 6.60461C6.83437 6.60461 6.75 6.68899 6.75 6.79211V7.91711C6.75 8.02024 6.83437 8.10461 6.9375 8.10461H15.9375C16.0406 8.10461 16.125 8.02024 16.125 7.91711V6.79211C16.125 6.68899 16.0406 6.60461 15.9375 6.60461H6.9375ZM11.4375 11.2921V10.1671C11.4375 10.064 11.3531 9.97961 11.25 9.97961H6.9375C6.83437 9.97961 6.75 10.064 6.75 10.1671V11.2921C6.75 11.3952 6.83437 11.4796 6.9375 11.4796H11.25C11.3531 11.4796 11.4375 11.3952 11.4375 11.2921ZM10.3125 20.5734H4.875V4.07336H18V12.1359C18 12.239 18.0844 12.3234 18.1875 12.3234H19.5C19.6031 12.3234 19.6875 12.239 19.6875 12.1359V3.13586C19.6875 2.72102 19.3523 2.38586 18.9375 2.38586H3.9375C3.52266 2.38586 3.1875 2.72102 3.1875 3.13586V21.5109C3.1875 21.9257 3.52266 22.2609 3.9375 22.2609H10.3125C10.4156 22.2609 10.5 22.1765 10.5 22.0734V20.7609C10.5 20.6577 10.4156 20.5734 10.3125 20.5734ZM12.7523 17.864C12.7945 17.0554 13.132 16.2984 13.7086 15.7218C14.3227 15.1077 15.1617 14.7609 16.0312 14.7609C16.9078 14.7609 17.7328 15.1031 18.3539 15.7218C18.4289 15.7968 18.5016 15.8765 18.5695 15.9585L18.0281 16.3781C18.0002 16.3996 17.979 16.4287 17.9668 16.4618C17.9547 16.495 17.9521 16.5309 17.9595 16.5654C17.9668 16.5999 17.9837 16.6316 18.0083 16.657C18.0329 16.6823 18.0641 16.7002 18.0984 16.7085L20.2852 17.2359C20.4023 17.264 20.5148 17.1749 20.5172 17.0554L20.5312 14.8195C20.5316 14.7842 20.522 14.7496 20.5036 14.7196C20.4852 14.6896 20.4586 14.6654 20.4271 14.6497C20.3955 14.634 20.3602 14.6276 20.3252 14.6311C20.2901 14.6346 20.2567 14.6479 20.2289 14.6695L19.7531 15.0398C18.8766 13.9546 17.5336 13.2609 16.0312 13.2609C13.4555 13.2609 11.3531 15.2976 11.25 17.8476C11.2453 17.9531 11.332 18.0421 11.4375 18.0421H12.5648C12.6656 18.0421 12.7477 17.9648 12.7523 17.864ZM20.625 18.0421H19.4977C19.3969 18.0421 19.3148 18.1195 19.3102 18.2202C19.268 19.0288 18.9305 19.7859 18.3539 20.3624C17.7398 20.9765 16.9008 21.3234 16.0312 21.3234C15.1547 21.3234 14.3297 20.9812 13.7086 20.3624C13.6336 20.2874 13.5609 20.2077 13.493 20.1257L14.0344 19.7062C14.0623 19.6846 14.0835 19.6555 14.0957 19.6224C14.1078 19.5893 14.1104 19.5534 14.103 19.5189C14.0957 19.4843 14.0788 19.4526 14.0542 19.4273C14.0296 19.4019 13.9984 19.3841 13.9641 19.3757L11.7773 18.8484C11.6602 18.8202 11.5477 18.9093 11.5453 19.0288L11.5312 21.2648C11.5309 21.3 11.5405 21.3346 11.5589 21.3646C11.5773 21.3946 11.6039 21.4189 11.6354 21.4345C11.667 21.4502 11.7023 21.4566 11.7373 21.4531C11.7724 21.4496 11.8058 21.4363 11.8336 21.4148L12.3094 21.0445C13.1859 22.1296 14.5289 22.8234 16.0312 22.8234C18.607 22.8234 20.7094 20.7866 20.8125 18.2366C20.8172 18.1312 20.7305 18.0421 20.625 18.0421Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/Trash.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const Trash = createIcon({\n  displayName: \"Trash\",\n  viewBox: \"0 0 20 20\",\n  defaultProps,\n  path: (\n    <path\n      fillRule=\"evenodd\"\n      d=\"M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z\"\n      clipRule=\"evenodd\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/User.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const User = createIcon({\n  displayName: \"User\",\n  viewBox: \"0 0 24 24\",\n  defaultProps,\n  path: (\n    <path d=\"M20.12 17.897a8.766 8.766 0 0 0-1.889-2.8 8.802 8.802 0 0 0-2.8-1.89c-.01-.005-.02-.007-.028-.012A5.811 5.811 0 0 0 12 2.672a5.811 5.811 0 0 0-3.404 10.526l-.028.011a8.727 8.727 0 0 0-2.8 1.89 8.805 8.805 0 0 0-1.89 2.8 8.712 8.712 0 0 0-.691 3.237.188.188 0 0 0 .187.192h1.407a.187.187 0 0 0 .187-.183 6.987 6.987 0 0 1 2.058-4.788 6.984 6.984 0 0 1 4.973-2.06c1.88 0 3.645.731 4.974 2.06a6.987 6.987 0 0 1 2.058 4.788.185.185 0 0 0 .187.183h1.406a.184.184 0 0 0 .135-.056.187.187 0 0 0 .053-.136 8.732 8.732 0 0 0-.692-3.239ZM12 12.516a4.005 4.005 0 0 1-2.85-1.181 4.005 4.005 0 0 1-1.182-2.85c0-1.076.42-2.089 1.181-2.85A4.005 4.005 0 0 1 12 4.453c1.076 0 2.089.42 2.85 1.181a4.005 4.005 0 0 1 1.182 2.85c0 1.076-.42 2.089-1.182 2.85A4.005 4.005 0 0 1 12 12.517Z\" />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/WholeWord.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"@/icons/defaultProps\"\n\nexport const WholeWord = createIcon({\n  displayName: \"WholeWord\",\n  viewBox: \"0 0 16 16\",\n  defaultProps,\n  path: (\n    <>\n      <path d=\"M13.7188 9.78178H12.7812C12.7125 9.78178 12.6562 9.83803 12.6562 9.90678V12.313H3.34375V9.90678C3.34375 9.83803 3.2875 9.78178 3.21875 9.78178H2.28125C2.2125 9.78178 2.15625 9.83803 2.15625 9.90678V13.0005C2.15625 13.2771 2.37969 13.5005 2.65625 13.5005H13.3438C13.6203 13.5005 13.8438 13.2771 13.8438 13.0005V9.90678C13.8438 9.83803 13.7875 9.78178 13.7188 9.78178Z\" />\n      <path d=\"M8.42468 8.66659V2.8484H9.45309V5.02454H9.49571C9.54874 4.91848 9.62355 4.80579 9.72014 4.68647C9.81673 4.56526 9.94741 4.46204 10.1122 4.37681C10.277 4.28969 10.4872 4.24613 10.7429 4.24613C11.08 4.24613 11.384 4.33231 11.6548 4.50465C11.9275 4.67511 12.1434 4.92795 12.3025 5.26318C12.4635 5.59651 12.544 6.0056 12.544 6.49045C12.544 6.96962 12.4654 7.37681 12.3082 7.71204C12.151 8.04727 11.937 8.30295 11.6662 8.47909C11.3953 8.65522 11.0885 8.74329 10.7457 8.74329C10.4957 8.74329 10.2883 8.70162 10.1235 8.61829C9.95877 8.53496 9.8262 8.43458 9.72582 8.31715C9.62733 8.19784 9.55063 8.08515 9.49571 7.97909H9.43605V8.66659H8.42468ZM9.43321 6.48477C9.43321 6.76696 9.47298 7.01412 9.55252 7.22625C9.63396 7.43837 9.75044 7.60409 9.90196 7.7234C10.0554 7.84083 10.241 7.89954 10.4588 7.89954C10.686 7.89954 10.8764 7.83893 11.0298 7.71772C11.1832 7.59462 11.2987 7.427 11.3764 7.21488C11.4559 7.00087 11.4957 6.7575 11.4957 6.48477C11.4957 6.21393 11.4569 5.9734 11.3792 5.76318C11.3016 5.55295 11.186 5.38818 11.0326 5.26886C10.8792 5.14954 10.6879 5.08988 10.4588 5.08988C10.2391 5.08988 10.0525 5.14765 9.89911 5.26318C9.74571 5.37871 9.62923 5.54064 9.54968 5.74897C9.47203 5.95731 9.43321 6.20257 9.43321 6.48477Z\" />\n      <path d=\"M4.96117 8.75465C4.68466 8.75465 4.43561 8.7054 4.21401 8.60692C3.99432 8.50654 3.82007 8.35881 3.69129 8.16374C3.56439 7.96866 3.50095 7.72813 3.50095 7.44215C3.50095 7.19593 3.5464 6.99234 3.63731 6.83135C3.72822 6.67037 3.85227 6.54158 4.00947 6.44499C4.16667 6.3484 4.34375 6.27548 4.54072 6.22624C4.73958 6.1751 4.94507 6.13817 5.1572 6.11544C5.41288 6.08893 5.62026 6.06525 5.77936 6.04442C5.93845 6.02169 6.05398 5.9876 6.12595 5.94215C6.19981 5.8948 6.23674 5.82188 6.23674 5.7234V5.70635C6.23674 5.49234 6.17329 5.32662 6.0464 5.20919C5.91951 5.09177 5.73674 5.03306 5.49811 5.03306C5.24621 5.03306 5.0464 5.08798 4.89867 5.19783C4.75284 5.30768 4.65436 5.43741 4.60322 5.58703L3.64299 5.45067C3.71875 5.18552 3.84375 4.96393 4.01799 4.7859C4.19223 4.60597 4.4053 4.4715 4.6572 4.38249C4.90909 4.29158 5.1875 4.24612 5.49242 4.24612C5.70265 4.24612 5.91193 4.27075 6.12026 4.31999C6.3286 4.36923 6.51894 4.45067 6.69129 4.56431C6.86364 4.67605 7.00189 4.82851 7.10606 5.02169C7.21212 5.21487 7.26515 5.45635 7.26515 5.74612V8.66658H6.27651V8.06715H6.24242C6.17992 8.18836 6.09186 8.302 5.97822 8.40806C5.86648 8.51222 5.72538 8.5965 5.55492 8.6609C5.38636 8.7234 5.18845 8.75465 4.96117 8.75465ZM5.22822 7.99896C5.43466 7.99896 5.61364 7.95825 5.76515 7.87681C5.91667 7.79347 6.03314 7.68362 6.11458 7.54726C6.19792 7.4109 6.23958 7.26222 6.23958 7.10124V6.58703C6.20739 6.61355 6.15246 6.63817 6.07481 6.6609C5.99905 6.68362 5.91383 6.70351 5.81913 6.72056C5.72443 6.7376 5.63068 6.75275 5.53788 6.76601C5.44507 6.77927 5.36458 6.79063 5.2964 6.8001C5.14299 6.82093 5.00568 6.85503 4.88447 6.90237C4.76326 6.94972 4.66761 7.01601 4.59754 7.10124C4.52746 7.18457 4.49242 7.29253 4.49242 7.4251C4.49242 7.6145 4.56155 7.75749 4.69981 7.85408C4.83807 7.95067 5.0142 7.99896 5.22822 7.99896Z\" />\n    </>\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/WorkspaceStatus.tsx",
    "content": "import { createIcon } from \"@chakra-ui/react\"\nimport { defaultProps } from \"./defaultProps\"\n\nexport const WorkspaceStatus = createIcon({\n  displayName: \"WorkspaceStatus\",\n  viewBox: \"0 0 12 12\",\n  defaultProps,\n  path: (\n    <path\n      fill=\"currentColor\"\n      d=\"M6 0C2.69 0 0 2.69 0 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6Zm3.36 6.568h-.91l-.884 1.769a.612.612 0 0 1-.518.316.563.563 0 0 1-.505-.316L4.952 5.192l-.53 1.06a.577.577 0 0 1-.506.316H2.653A.566.566 0 0 1 2.084 6c0-.316.253-.568.569-.568h.91l.883-1.769c.19-.379.821-.379 1.01 0l1.58 3.145.543-1.073a.577.577 0 0 1 .505-.316h1.263c.316 0 .569.253.569.568 0 .316-.24.581-.556.581Z\"\n    />\n  ),\n})\n"
  },
  {
    "path": "desktop/src/icons/defaultProps.tsx",
    "content": "import { IconProps } from \"@chakra-ui/react\"\n\nexport const defaultProps: IconProps = { boxSize: 6, fill: \"currentColor\" }\n"
  },
  {
    "path": "desktop/src/icons/index.ts",
    "content": "export * from \"./Devpod\"\nexport { ArrowLeft } from \"./ArrowLeft\"\nexport { ArrowPath } from \"./ArrowPath\"\nexport { ArrowCycle } from \"./ArrowCycle\"\nexport { Bell } from \"./Bell\"\nexport { Briefcase } from \"./Briefcase\"\nexport { CheckCircle } from \"./CheckCircle\"\nexport { CircleDuotone } from \"./CircleDuotone\"\nexport { Cog } from \"./Cog\"\nexport { CogOutlined } from \"./CogOutlined\"\nexport { CommandLine } from \"./CommandLine\"\nexport { DevpodWordmark } from \"./DevpodWordmark\"\nexport { DevPodProBadge } from \"./DevPodProBadge\"\nexport { Ellipsis } from \"./Ellipsis\"\nexport { ExclamationCircle } from \"./ExclamationCircle\"\nexport { ExclamationTriangle } from \"./ExclamationTriangle\"\nexport { Pause } from \"./Pause\"\nexport { Stop } from \"./Stop\"\nexport { Loft } from \"./Loft\"\nexport { LoftDevPodPro } from \"./LoftDevpodPro\"\nexport { Play } from \"./Play\"\nexport { Plus } from \"./Plus\"\nexport { ProviderPlaceholder } from \"./ProviderPlaceholder\"\nexport { Stack3D } from \"./Stack3D\"\nexport { WorkspaceStatus } from \"./WorkspaceStatus\"\nexport { Trash } from \"./Trash\"\nexport { Template } from \"./Template\"\nexport { GitBranch } from \"./GitBranch\"\nexport { GitCommit } from \"./GitCommit\"\nexport { GitPR } from \"./GitPR\"\nexport { GitSubPath } from \"./GitSubPath\"\nexport { Status } from \"./Status\"\nexport { Git } from \"./Git\"\nexport { Image } from \"./Image\"\nexport { Folder } from \"./Folder\"\nexport { Globe } from \"./Globe\"\nexport { Clock } from \"./Clock\"\nexport { CogDuotone } from \"./CogDuotone\"\nexport { BellDuotone } from \"./BellDuotone\"\nexport { CircleWithArrow } from \"./CircleWithArrow\"\nexport { Preset } from \"./Preset\"\nexport { Code } from \"./Code\"\nexport { Parameters } from \"./Parameters\"\nexport { Laptop } from \"./Laptop\"\nexport { Sleep } from \"./Sleep\"\nexport { NotFound } from \"./NotFound\"\nexport { Connect } from \"./Connect\"\nexport { Close } from \"./Close\"\nexport { MatchCase } from \"./MatchCase\"\nexport { WholeWord } from \"./WholeWord\"\nexport { ArrowUp } from \"./ArrowUp\"\nexport { ArrowDown } from \"./ArrowDown\"\nexport { Search } from \"./Search\"\nexport { User } from \"./User\"\nexport { ProfileDuotone } from \"./ProfileDuotone\"\nexport { LockDuotone } from \"./LockDuotone\"\nexport { Form } from \"./Form\"\nexport { File } from \"./File\"\nexport { Dashboard } from \"./Dashboard\"\nexport { History } from \"./History\"\nexport { Memory } from \"./Memory\"\nexport { Database } from \"./Database\"\nexport { CPU } from \"./CPU\"\n"
  },
  {
    "path": "desktop/src/images/index.ts",
    "content": "export { default as NoWorkspaceImageSvg } from \"./empty_workspace.svg\"\nexport { default as CppSvg } from \"./cpp.svg\"\nexport { default as CustomSvg } from \"./custom.svg\"\nexport { default as CommunitySvg } from \"./community.svg\"\nexport { default as SSHSvg } from \"./ssh.svg\"\nexport { default as DotnetcoreSvg } from \"./dotnet.svg\"\nexport { default as GoSvg } from \"./go.svg\"\nexport { default as GoSvgDark } from \"./go_dark.svg\"\nexport { default as JavaSvg } from \"./java.svg\"\nexport { default as NodejsSvg } from \"./nodejs.svg\"\nexport { default as NoneSvg } from \"./none.svg\"\nexport { default as NoneSvgDark } from \"./none_dark.svg\"\nexport { default as PhpSvg } from \"./php.svg\"\nexport { default as PhpSvgDark } from \"./php_dark.svg\"\nexport { default as PythonSvg } from \"./python.svg\"\nexport { default as RustSvg } from \"./rust.svg\"\nexport { default as RustSvgDark } from \"./rust_dark.svg\"\nexport { default as DockerSvg } from \"./docker.svg\"\nexport { default as KubernetesSvg } from \"./kubernetes.svg\"\nexport { default as GCloudSvg } from \"./gcp.svg\"\nexport { default as AWSSvg } from \"./aws.svg\"\nexport { default as AWSWhiteSvg } from \"./aws_white.svg\"\nexport { default as DigitalOceanSvg } from \"./digitalocean.svg\"\nexport { default as AzureSvg } from \"./azure.svg\"\nexport { default as CivoSvg } from \"./civo.svg\"\nexport { default as TerraformSvg } from \"./terraform.svg\"\nexport { default as VSCodeBrowser } from \"./vscodebrowser.svg\"\nexport { default as VSCodeSvg } from \"./vscode.svg\"\nexport { default as VSCodeInsidersSvg } from \"./vscode_insiders.svg\"\nexport { default as ProviderPlaceholderSvg } from \"./provider_placeholder.svg\"\nexport { default as RubySvg } from \"./ruby.svg\"\nexport { default as IntelliJSvg } from \"./intellij.svg\"\nexport { default as GolandSvg } from \"./goland.svg\"\nexport { default as PycharmSvg } from \"./pycharm.svg\"\nexport { default as WebstormSvg } from \"./webstorm.svg\"\nexport { default as CLionSvg } from \"./clion.svg\"\nexport { default as RiderSvg } from \"./rider.svg\"\nexport { default as RubyMineSvg } from \"./rubymine.svg\"\nexport { default as RustRoverSvg } from \"./rustrover.svg\"\nexport { default as PHPStormSvg } from \"./phpstorm.svg\"\nexport { default as DataSpellSvg } from \"./dataspell.svg\"\nexport { default as FleetSvg } from \"./fleet.svg\"\nexport { default as CursorSvg } from \"./cursor.svg\"\nexport { default as JupyterNotebookSvg } from \"./jupyter.svg\"\nexport { default as JupyterNotebookDarkSvg } from \"./jupyter_dark.svg\"\nexport { default as PositronSvg } from \"./positron.svg\"\nexport { default as CodiumSvg } from \"./codium.svg\"\nexport { default as ZedSvg } from \"./zed.svg\"\nexport { default as ZedDarkSvg } from \"./zed_dark.svg\"\nexport { default as RStudioSvg } from \"./rstudio.svg\"\nexport { default as WindsurfSvg } from \"./windsurf.svg\"\n"
  },
  {
    "path": "desktop/src/lib/debugSettings.ts",
    "content": "import { useEffect, useState } from \"react\"\nimport { TUnsubscribeFn } from \"../types\"\nimport { LocalStorageBackend, Store } from \"./store\"\n\nconst DEBUG_STORE_KEY = \"debug\"\nconst DEBUG_OPTIONS = [\"commands\", \"actions\", \"workspaces\"] as const\ntype TDebugOption = (typeof DEBUG_OPTIONS)[number]\ntype TDebug = Readonly<{\n  isEnabled?: boolean\n  toggle?(option: TDebugOption): Promise<void>\n  get?(option: TDebugOption): Promise<boolean>\n  print?(): void\n}>\ntype TDebugStore = Record<TDebugOption, boolean>\ntype TInternalDebug = Readonly<{\n  subscribe(option: TDebugOption, listener: (newValue: boolean) => void): TUnsubscribeFn\n}>\n\nfunction init(): TDebug & TInternalDebug {\n  const store = new Store<TDebugStore>(new LocalStorageBackend<TDebugStore>(DEBUG_STORE_KEY))\n\n  return {\n    isEnabled: true,\n    async toggle(option) {\n      const current = (await store.get(option)) ?? false\n      const newOptionValue = !current\n      await store.set(option, newOptionValue)\n    },\n    async get(option) {\n      return (await store.get(option)) ?? false\n    },\n    subscribe(option, listener) {\n      return store.subscribe(option, listener)\n    },\n    print() {\n      console.log(store)\n    },\n  }\n}\n\nconst initialDebugOptions: TDebugStore = { commands: false, workspaces: false, actions: false }\n\ntype TUseDebug = Readonly<{ options: Record<TDebugOption, boolean> }> & Pick<TDebug, \"isEnabled\">\nfunction useInternalDebug(): TUseDebug {\n  const [options, setOptions] = useState<TDebugStore>(initialDebugOptions)\n\n  useEffect(() => {\n    ;(async () => {\n      const initialOptions = await Promise.all(\n        DEBUG_OPTIONS.map((option) =>\n          Debug.get!(option)\n            .then((value) => [option, value] as const)\n            .catch(() => [option, false] as const)\n        )\n      )\n      setOptions(\n        initialOptions.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {} as TDebugStore)\n      )\n    })()\n  }, [])\n\n  useEffect(() => {\n    const subscriptions: TUnsubscribeFn[] = []\n    for (const option of DEBUG_OPTIONS) {\n      subscriptions.push(\n        (Debug as TInternalDebug).subscribe(option, (newValue) =>\n          setOptions((currentOptions) => ({ ...currentOptions, [option]: newValue }))\n        )\n      )\n    }\n\n    return () => {\n      for (const unsubscribe of subscriptions) {\n        unsubscribe()\n      }\n    }\n  }, [])\n\n  return { options, isEnabled: true }\n}\nexport function debug(option: TDebugOption, ...args: Parameters<(typeof console)[\"info\"]>): void {\n  Debug.get?.(option).then((isEnabled) => {\n    if (isEnabled) {\n      console.info(...args)\n    }\n  })\n}\n\n// Only available during development\nexport const Debug: TDebug = import.meta.env.DEV ? init() : { isEnabled: false }\n// Only available during development\nexport const useDebug: typeof useInternalDebug = import.meta.env.DEV\n  ? useInternalDebug\n  : () => ({ options: initialDebugOptions, isEnabled: false })\n"
  },
  {
    "path": "desktop/src/lib/eventManager.ts",
    "content": "import { TComparable, TIdentifiable, TUnsubscribeFn } from \"../types\"\nimport { exists, isEmpty } from \"./helpers\"\nimport { v4 as uuidv4 } from \"uuid\"\n\ntype TEventHandler<TEvents, TEventName extends keyof TEvents = keyof TEvents> = THandler<\n  (event: TEvents[TEventName]) => void\n>\nexport type THandler<TFn = Function> = Readonly<{ notify: TFn }> &\n  TIdentifiable &\n  TComparable<TIdentifiable>\ntype TBaseEvents = Record<string | number | symbol, unknown>\n\ntype TEventManager<TEvents extends TBaseEvents> = Readonly<{\n  subscribe: <TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ) => TUnsubscribeFn\n  isSubscribed: <TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ) => boolean\n  unsubscribe: <TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ) => void\n  publish: <TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    event: TEvents[TEventName]\n  ) => boolean\n  clear: <TEventName extends keyof TEvents>(eventName: TEventName) => void\n}>\n\nexport class EventManager<TEvents extends TBaseEvents> implements TEventManager<TEvents> {\n  private handlers = new Map<keyof TEvents, TEventHandler<TEvents>[]>()\n\n  public static toHandler<TFn extends Function>(\n    listenerFn: TFn,\n    id: string = uuidv4()\n  ): THandler<TFn> {\n    return {\n      id,\n      eq(other) {\n        return this.id === other.id\n      },\n      notify: listenerFn,\n    }\n  }\n\n  public subscribe<TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ): VoidFunction {\n    const maybeHandlers = this.handlers.get(eventName)\n    if (!exists(maybeHandlers)) {\n      this.handlers.set(eventName, [handler as TEventHandler<TEvents>])\n    } else {\n      this.handlers.set(eventName, [...maybeHandlers, handler as TEventHandler<TEvents>])\n    }\n\n    return () => this.unsubscribe(eventName, handler)\n  }\n\n  public isSubscribed<TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ): boolean {\n    const maybeHandlers = this.handlers.get(eventName)\n    if (!exists(maybeHandlers)) {\n      return false\n    }\n\n    return exists(maybeHandlers.find((l) => l.eq(handler)))\n  }\n\n  public unsubscribe<TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    handler: TEventHandler<TEvents, TEventName>\n  ): void {\n    const maybeEventHandlers = this.handlers.get(eventName)\n    if (!exists(maybeEventHandlers)) {\n      return\n    }\n\n    this.handlers.set(\n      eventName,\n      maybeEventHandlers.filter((h) => !h.eq(handler))\n    )\n\n    if (isEmpty(maybeEventHandlers)) {\n      this.handlers.delete(eventName)\n    }\n  }\n\n  public publish<TEventName extends keyof TEvents>(\n    eventName: TEventName,\n    event: TEvents[TEventName]\n  ): boolean {\n    const maybeHandlers = this.handlers.get(eventName)\n    if (!exists(maybeHandlers)) {\n      return false\n    }\n\n    for (const handler of maybeHandlers) {\n      handler.notify(event)\n    }\n\n    return true\n  }\n\n  public clear<TEventName extends keyof TEvents>(eventName: TEventName): void {\n    this.handlers.delete(eventName)\n  }\n}\n\nexport class SingleEventManager<T> {\n  private manager = new EventManager<{ event: T }>()\n\n  subscribe(handler: TEventHandler<{ event: T }, \"event\">): VoidFunction {\n    return this.manager.subscribe(\"event\", handler)\n  }\n\n  isSubscribed(handler: TEventHandler<{ event: T }, \"event\">): boolean {\n    return this.manager.isSubscribed(\"event\", handler)\n  }\n\n  unsubscribe(handler: TEventHandler<{ event: T }, \"event\">): void {\n    return this.manager.unsubscribe(\"event\", handler)\n  }\n\n  publish(event: T): boolean {\n    return this.manager.publish(\"event\", event)\n  }\n\n  clear(): void {\n    return this.manager.clear(\"event\")\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/helpers.ts",
    "content": "import { TIDE, TLogOutput, TProInstance, TProvider } from \"../types\"\nimport { ChildProcess } from \"@tauri-apps/plugin-shell\"\nimport { Err, Failed, Return } from \"./result\"\nimport { TActionObj } from \"../contexts\"\nimport { WORKSPACE_SOURCE_BRANCH_DELIMITER, WORKSPACE_SOURCE_COMMIT_DELIMITER } from \"@/constants\"\nimport { TWorkspace, TIDEs } from \"@/types\"\n\nexport function exists<T extends any | null | undefined>(\n  arg: T\n): arg is Exclude<T, null | undefined> {\n  return arg !== undefined && arg !== null\n}\n\nexport function isError(error: unknown): error is Error {\n  return error instanceof Error\n}\n\nexport function noop(): void {}\nexport async function noopAsync(): Promise<void> {}\n\n// WARN: All keys and values of `map` need to be serializable by `JSON.stringify` for this to work!\n// See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#description)\n// if you're unsure\nexport function serializeMap<T extends Map<unknown, unknown>>(map: T): string {\n  return JSON.stringify(Array.from(map.entries()))\n}\n\nexport function deserializeMap<T extends Map<unknown, unknown>>(serializedMap: string): T {\n  return new Map(JSON.parse(serializedMap)) as T\n}\n\nexport function isEmpty<T extends { length: number }>(arg: T): boolean {\n  return arg.length <= 0\n}\n\nexport function safeJSONParse<T>(arg: string): T | null {\n  try {\n    return JSON.parse(arg) as T\n  } catch {\n    return null\n  }\n}\n\nexport function getErrorFromChildProcess(result: ChildProcess<string>): Err<Failed> {\n  const stdout = parseOutput(result.stdout)\n  const stderr = parseOutput(result.stderr)\n  const sorted = [...stdout, ...stderr].sort((a, b) => {\n    if (a.time === b.time) {\n      return 0\n    }\n\n    const aTime = new Date(a.time).getTime() || 0\n    const bTime = new Date(b.time).getTime() || 0\n    if (aTime < bTime) {\n      return -1\n    }\n\n    return 1\n  })\n\n  const message: string[] = sorted.reduce((acc, log) => {\n    const line = log.message?.trim()\n    if (!line) {\n      return acc\n    }\n\n    acc.push(line)\n\n    return acc\n  }, [] as string[])\n\n  return Return.Failed(message.join(\"\\n\"))\n}\n\nexport function parseOutput(arg: string): TLogOutput[] {\n  const retOutput: TLogOutput[] = arg.split(\"\\n\").reduce((acc, line) => {\n    const trimmed = line.trim()\n    if (!trimmed) {\n      return acc\n    }\n\n    const logLine = safeJSONParse(line) as TLogOutput | undefined\n    if (!logLine?.message) {\n      return acc\n    }\n\n    acc.push(logLine)\n\n    return acc\n  }, [] as TLogOutput[])\n\n  return retOutput\n}\n\nexport function getKeys<T extends object>(arg: T): readonly (keyof T)[] {\n  return Object.keys(arg) as unknown as readonly (keyof T)[]\n}\n\nexport function sleep(ms: number): Promise<void> {\n  return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nexport function getActionDisplayName(action: TActionObj): string {\n  if (action.name === \"checkStatus\") {\n    return `check status ${action.targetID}`\n  }\n\n  return `${action.name} ${action.targetID}`\n}\n\nexport function getIDEDisplayName(ide: TIDE) {\n  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n  return ide.displayName ?? ide.name ?? \"Unknown\"\n}\n\nexport function randomString(length: number): string {\n  return [...Array(length)].map(() => (~~(Math.random() * 36)).toString(36)).join(\"\")\n}\n\nexport function remToPx(rem: string): number {\n  return parseFloat(rem) * parseFloat(getComputedStyle(document.documentElement).fontSize)\n}\n\nexport function getIDEName(ide: TWorkspace[\"ide\"], ides: TIDEs | undefined) {\n  const maybeIDE = ides?.find((i) => i.name === ide?.name)\n\n  return maybeIDE?.displayName ?? ide?.name ?? maybeIDE?.name ?? \"Unknown\"\n}\n\nexport function getWorkspaceSourceName({\n  gitRepository,\n  gitBranch,\n  gitCommit,\n  localFolder,\n  image,\n}: NonNullable<TWorkspace[\"source\"]>): string {\n  if (exists(gitRepository) && exists(gitCommit)) {\n    return `${gitRepository}${WORKSPACE_SOURCE_COMMIT_DELIMITER}${gitCommit}`\n  }\n\n  if (exists(gitRepository) && exists(gitBranch)) {\n    return `${gitRepository}${WORKSPACE_SOURCE_BRANCH_DELIMITER}${gitBranch}`\n  }\n\n  if (exists(gitRepository)) {\n    return gitRepository\n  }\n\n  if (exists(image)) {\n    return image\n  }\n\n  if (exists(localFolder)) {\n    return localFolder\n  }\n\n  return \"\"\n}\n\nexport function deepCopy<T>(obj: T): T | undefined {\n  if (obj === undefined) {\n    return undefined\n  }\n\n  return JSON.parse(JSON.stringify(obj))\n}\n\nexport function canHealthCheck(providerConfig: TProvider[\"config\"]): boolean {\n  return !!providerConfig?.exec?.proxy?.[\"health\"] || !!providerConfig?.exec?.daemon\n}\n\nexport function hasCapability(\n  proInstance: TProInstance | undefined,\n  capability: \"daemon\" | \"update-provider\" | \"health-check\"\n): boolean {\n  return proInstance?.capabilities?.includes(capability) ?? false\n}\n"
  },
  {
    "path": "desktop/src/lib/index.ts",
    "content": "export * from \"./helpers\"\nexport { EventManager, SingleEventManager } from \"./eventManager\"\nexport type { THandler } from \"./eventManager\"\nexport { Debug, useDebug, debug } from \"./debugSettings\"\nexport * from \"./platform\"\nexport * from \"./result\"\nexport {\n  Store,\n  LocalStorageBackend,\n  FileStorageBackend,\n  LocalStorageToFileMigrationBackend,\n} from \"./store\"\nexport { useArch, usePlatform, useSystemTheme } from \"./systemInfo\"\nexport * from \"./types\"\nexport * from \"./releases\"\nexport { useFormErrors } from \"./useFormErrors\"\nexport { useHover } from \"./useHover\"\nexport { useVersion } from \"./useVersion\"\nexport { useUpdate } from \"./useUpdate\"\nexport { useDownloadLogs } from \"./useDownloadLogs\"\nexport { useSelection } from \"./useSelection\"\nexport * from \"./useSortWorkspaces\"\nexport * from \"./modals\"\nexport * from \"./pro\"\n"
  },
  {
    "path": "desktop/src/lib/modals/index.ts",
    "content": "export { useStopWorkspaceModal } from \"./useStopWorkspaceModal\"\nexport { useDeleteWorkspaceModal } from \"./useDeleteWorkspaceModal\"\nexport { useRebuildWorkspaceModal } from \"./useRebuildWorkspaceModal\"\nexport { useResetWorkspaceModal } from \"./useResetWorkspaceModal\"\nexport { useLoginProModal, useReLoginProModal } from \"./useLoginProModal\"\n"
  },
  {
    "path": "desktop/src/lib/modals/useDeleteWorkspaceModal.tsx",
    "content": "import {\n  Box,\n  Button,\n  Checkbox,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo, useState } from \"react\"\n\nexport function useDeleteWorkspaceModal(\n  workspaceName: string,\n  onClick: (forceDelete: boolean, closeModal: VoidFunction) => void,\n  force?: boolean\n) {\n  const { isOpen, onOpen, onClose } = useDisclosure()\n  const [forceDelete, setForceDelete] = useState<boolean>(false)\n\n  const modal = useMemo(\n    () => (\n      <Modal onClose={onClose} isOpen={isOpen} isCentered>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalHeader>Delete Workspace</ModalHeader>\n          <ModalCloseButton />\n          <ModalBody>\n            Deleting the workspace will erase all state. Are you sure you want to delete{\" \"}\n            {workspaceName}?\n            {force == null && (\n              <Box marginTop={\"2.5\"}>\n                <Checkbox checked={forceDelete} onChange={(e) => setForceDelete(e.target.checked)}>\n                  Force Delete the Workspace\n                </Checkbox>\n              </Box>\n            )}\n          </ModalBody>\n          <ModalFooter>\n            <HStack spacing={\"2\"}>\n              <Button onClick={onClose}>Close</Button>\n              <Button colorScheme={\"red\"} onClick={() => onClick(forceDelete, onClose)}>\n                Delete\n              </Button>\n            </HStack>\n          </ModalFooter>\n        </ModalContent>\n      </Modal>\n    ),\n    [force, forceDelete, isOpen, onClick, onClose, workspaceName]\n  )\n\n  return { modal, open: onOpen }\n}\n"
  },
  {
    "path": "desktop/src/lib/modals/useLoginProModal.tsx",
    "content": "import { BottomActionBar, BottomActionBarError, Form, useStreamingTerminal } from \"@/components\"\nimport { useProInstanceManager, useProInstances, useProviders } from \"@/contexts\"\nimport { canHealthCheck, exists, useFormErrors } from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport {\n  Box,\n  Button,\n  Container,\n  Divider,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Heading,\n  Input,\n  InputGroup,\n  InputLeftAddon,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  Tooltip,\n  VStack,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport { SubmitHandler, useForm } from \"react-hook-form\"\nimport { useNavigate } from \"react-router\"\nimport { ConfigureProviderOptionsForm, useSetupProvider } from \"@/views/Providers\"\nimport { To } from \"react-router-dom\"\n\ntype TFormValues = {\n  [FieldName.PRO_HOST]: string\n  [FieldName.ACCESS_KEY]: string | undefined\n}\nconst FieldName = {\n  PRO_HOST: \"proURL\",\n  ACCESS_KEY: \"accessKey\",\n} as const\n\ntype TSetupProInitialData = {\n  host: string\n  accessKey?: string\n  suggestedOptions: Record<string, string>\n}\n\nexport function useLoginProModal() {\n  const [suggestedOptions, setSuggestedOptions] = useState<\n    TSetupProInitialData[\"suggestedOptions\"]\n  >({})\n  const { terminal, connectStream, clear: clearTerminal } = useStreamingTerminal({ fontSize: \"sm\" })\n  const [[proInstances], { login, disconnect }] = useProInstances()\n  const [[providers]] = useProviders()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const { handleSubmit, formState, register, reset, setValue } = useForm<TFormValues>({\n    mode: \"onBlur\",\n  })\n  const containerRef = useRef<HTMLDivElement>(null)\n  const onSubmit = useCallback<SubmitHandler<TFormValues>>(\n    (data) => {\n      clearTerminal()\n      login.run({\n        host: data[FieldName.PRO_HOST],\n        accessKey: data[FieldName.ACCESS_KEY],\n        streamListener: connectStream,\n      })\n    },\n    [connectStream, login, clearTerminal]\n  )\n\n  const handleOpenLogin = useCallback(\n    (data?: TSetupProInitialData) => {\n      onOpen()\n      if (data === undefined || login.status === \"loading\") {\n        return\n      }\n\n      setValue(FieldName.PRO_HOST, data.host)\n      if (data.accessKey) {\n        setValue(FieldName.ACCESS_KEY, data.accessKey)\n      }\n      setSuggestedOptions(data.suggestedOptions)\n      handleSubmit(onSubmit)()\n    },\n    [handleSubmit, login.status, onOpen, onSubmit, setValue]\n  )\n\n  const {\n    state,\n    reset: resetSetupProvider,\n    completeSetupProvider,\n    completeConfigureProvider,\n    removeDanglingProviders,\n  } = useSetupProvider()\n\n  const { proURLError } = useFormErrors(Object.values(FieldName), formState)\n\n  useEffect(() => {\n    if (login.status === \"success\") {\n      const providerID = login.provider?.config?.name\n\n      if (!exists(providerID)) {\n        return\n      }\n      completeSetupProvider({ providerID, suggestedOptions })\n    }\n  }, [completeSetupProvider, login.provider, login.status, suggestedOptions])\n\n  const resetModal = useCallback(\n    (checkDanglingProInstance: boolean = false) => {\n      reset()\n      login.reset()\n      if (checkDanglingProInstance) {\n        const proInstanceID = proInstances?.find((pro) => pro.provider === state.providerID)?.host\n        if (proInstanceID) {\n          disconnect.run({ id: proInstanceID })\n        }\n      }\n      onClose()\n    },\n    [disconnect, login, onClose, proInstances, reset, state.providerID]\n  )\n\n  useEffect(() => {\n    if (state.currentStep === \"done\") {\n      resetSetupProvider()\n      removeDanglingProviders()\n    }\n  }, [removeDanglingProviders, resetSetupProvider, state.currentStep])\n\n  const areInputsDisabled = useMemo(\n    () => login.status === \"success\" || login.status === \"loading\",\n    [login.status]\n  )\n\n  const navigate = useNavigate()\n  const completeFlow = useCallback(() => {\n    completeConfigureProvider()\n    resetModal()\n\n    const proInstanceID = proInstances?.find((pro) => pro.provider === state.providerID)?.host\n    if (!proInstanceID || !state.providerID) return\n\n    const provider = providers?.[state.providerID]\n\n    let route: To\n\n    // We only redirect to the new experience if the provider supports it.\n    // Support can be determined via canHealthCheck.\n    if (provider && canHealthCheck(provider.config)) {\n      route = Routes.toProInstance(proInstanceID)\n    } else {\n      route = Routes.toWorkspaceCreate({\n        workspaceID: null,\n        ide: null,\n        rawSource: null,\n        providerID: state.providerID,\n      })\n    }\n\n    // workaround for layout shift after closing modal, no clue why\n    setTimeout(() => {\n      navigate(route)\n    }, 0)\n  }, [completeConfigureProvider, navigate, providers, proInstances, resetModal, state.providerID])\n\n  const modal = useMemo(() => {\n    return (\n      <Modal\n        onClose={() => resetModal(true)}\n        isOpen={isOpen}\n        closeOnEsc={login.status !== \"loading\"}\n        closeOnOverlayClick={login.status !== \"loading\"}\n        isCentered\n        size=\"4xl\"\n        scrollBehavior=\"inside\">\n        <ModalOverlay />\n        <ModalContent overflow=\"hidden\">\n          {login.status !== \"loading\" && <ModalCloseButton />}\n          <ModalHeader>Connect to DevPod Pro</ModalHeader>\n          <ModalBody overflowX=\"hidden\" overflowY=\"auto\" paddingBottom=\"0\" ref={containerRef}>\n            <VStack align=\"start\" spacing=\"8\" paddingX=\"4\" paddingTop=\"4\">\n              <Form onSubmit={handleSubmit(onSubmit)} justifyContent=\"center\">\n                <Container minHeight=\"40\" maxWidth=\"container.md\">\n                  <FormControl\n                    isRequired\n                    isInvalid={exists(proURLError)}\n                    isDisabled={areInputsDisabled}>\n                    <FormLabel>URL</FormLabel>\n                    <InputGroup>\n                      <InputLeftAddon>https://</InputLeftAddon>\n                      <Input\n                        type=\"text\"\n                        placeholder=\"my-pro.my-domain.com\"\n                        {...register(FieldName.PRO_HOST, {\n                          required: true,\n                          validate: {\n                            url: (value) => {\n                              try {\n                                new URL(`https://${value.replace(/^https?:\\/\\//, \"\")}`)\n\n                                return true\n                              } catch {\n                                return \"Please enter a valid URL\"\n                              }\n                            },\n                            unique: (value) => {\n                              const isHostTaken = proInstances?.some(\n                                (instance) => instance.host === value\n                              )\n\n                              return isHostTaken\n                                ? `URL must be unique, an instance with the URL https://${value} already exists`\n                                : true\n                            },\n                          },\n                        })}\n                      />\n                    </InputGroup>\n                    {proURLError && proURLError.message ? (\n                      <FormErrorMessage>{proURLError.message}</FormErrorMessage>\n                    ) : (\n                      <FormHelperText>\n                        Enter a URL to the DevPod Pro instance you intend to connect to. If\n                        you&apos;re unsure about it, ask your company administrator or create a new\n                        Pro instance on your local machine.\n                      </FormHelperText>\n                    )}\n                  </FormControl>\n                </Container>\n\n                {login.status !== \"idle\" && state.currentStep === \"select-provider\" && (\n                  <Box width=\"full\" height=\"10rem\">\n                    {terminal}\n                  </Box>\n                )}\n\n                {state.currentStep !== \"configure-provider\" && (\n                  <BottomActionBar isModal>\n                    <Tooltip label=\"Please fill in URL\" isDisabled={formState.isValid}>\n                      <Button\n                        type=\"submit\"\n                        variant=\"primary\"\n                        isLoading={formState.isSubmitting || login.status === \"loading\"}\n                        isDisabled={!formState.isValid}\n                        title=\"Login\">\n                        Login\n                      </Button>\n                    </Tooltip>\n\n                    <BottomActionBarError containerRef={containerRef} error={login.error} />\n                  </BottomActionBar>\n                )}\n              </Form>\n              {state.currentStep === \"configure-provider\" && (\n                <>\n                  <Divider />\n                  <Heading size=\"md\" as=\"h2\">\n                    Configure your Pro provider\n                  </Heading>\n\n                  <ConfigureProviderOptionsForm\n                    isModal\n                    isDefault\n                    addProvider\n                    reuseMachine={false}\n                    showBottomActionBar={true}\n                    providerID={state.providerID}\n                    containerRef={containerRef}\n                    suggestedOptions={state.suggestedOptions}\n                    onFinish={completeFlow}\n                  />\n                </>\n              )}\n            </VStack>\n          </ModalBody>\n        </ModalContent>\n      </Modal>\n    )\n  }, [\n    resetModal,\n    isOpen,\n    login.status,\n    login.error,\n    handleSubmit,\n    onSubmit,\n    proURLError,\n    areInputsDisabled,\n    register,\n    state,\n    terminal,\n    formState.isValid,\n    formState.isSubmitting,\n    completeFlow,\n    proInstances,\n  ])\n\n  return { modal, handleOpenLogin }\n}\n\nexport function useReLoginProModal() {\n  const { terminal, connectStream, clear: clearTerminal } = useStreamingTerminal({ fontSize: \"sm\" })\n  const { login } = useProInstanceManager()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const containerRef = useRef<HTMLDivElement>(null)\n\n  const handleOpenLogin = useCallback(\n    (data: NonNullable<Pick<TSetupProInitialData, \"host\">>) => {\n      onOpen()\n      login.run({ host: data.host, streamListener: connectStream })\n    },\n    [connectStream, login, onOpen]\n  )\n\n  const resetModal = useCallback(() => {\n    clearTerminal()\n    onClose()\n  }, [clearTerminal, onClose])\n\n  const modal = useMemo(() => {\n    return (\n      <Modal\n        onClose={resetModal}\n        isOpen={isOpen}\n        closeOnEsc={login.status !== \"loading\"}\n        closeOnOverlayClick={login.status !== \"loading\"}\n        isCentered\n        size=\"4xl\"\n        scrollBehavior=\"inside\">\n        <ModalOverlay />\n        <ModalContent overflow=\"hidden\">\n          {login.status !== \"loading\" && <ModalCloseButton />}\n          <ModalHeader>Login to DevPod Pro</ModalHeader>\n          <ModalBody overflowX=\"hidden\" overflowY=\"auto\" paddingBottom=\"0\" ref={containerRef}>\n            <VStack align=\"start\" spacing=\"8\" paddingX=\"4\" paddingTop=\"4\" paddingBottom=\"6\">\n              {login.status !== \"idle\" && (\n                <Box width=\"full\" height=\"10rem\">\n                  {terminal}\n                </Box>\n              )}\n            </VStack>\n          </ModalBody>\n          <ModalFooter>\n            <Button\n              isDisabled={login.status !== \"success\"}\n              isLoading={login.status === \"loading\"}\n              variant=\"solid\"\n              onClick={resetModal}>\n              Done\n            </Button>\n          </ModalFooter>\n        </ModalContent>\n      </Modal>\n    )\n  }, [resetModal, isOpen, login.status, terminal])\n\n  return { modal, handleOpenLogin }\n}\n"
  },
  {
    "path": "desktop/src/lib/modals/useRebuildWorkspaceModal.tsx",
    "content": "import {\n  Button,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\n\nexport function useRebuildWorkspaceModal(\n  workspaceName: string,\n  onClick: (closeModal: VoidFunction) => void\n) {\n  const { isOpen, onOpen, onClose } = useDisclosure()\n\n  const modal = useMemo(\n    () => (\n      <Modal onClose={onClose} isOpen={isOpen} isCentered>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalHeader>Rebuild Workspace</ModalHeader>\n          <ModalCloseButton />\n          <ModalBody>\n            Rebuilding the workspace will erase all state saved in the docker container overlay.\n            This means you might need to reinstall or reconfigure certain applications. State in\n            docker volumes is persisted. Are you sure you want to rebuild {workspaceName}?\n          </ModalBody>\n          <ModalFooter>\n            <HStack spacing={\"2\"}>\n              <Button onClick={onClose}>Close</Button>\n              <Button colorScheme={\"primary\"} onClick={() => onClick(onClose)}>\n                Rebuild\n              </Button>\n            </HStack>\n          </ModalFooter>\n        </ModalContent>\n      </Modal>\n    ),\n    [isOpen, onClick, onClose, workspaceName]\n  )\n\n  return { modal, open: onOpen }\n}\n"
  },
  {
    "path": "desktop/src/lib/modals/useResetWorkspaceModal.tsx",
    "content": "import {\n  Button,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\n\nexport function useResetWorkspaceModal(\n  workspaceName: string,\n  onClick: (closeModal: VoidFunction) => void\n) {\n  const { isOpen, onOpen, onClose } = useDisclosure()\n\n  const modal = useMemo(\n    () => (\n      <Modal onClose={onClose} isOpen={isOpen} isCentered>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalHeader>Reset Workspace</ModalHeader>\n          <ModalCloseButton />\n          <ModalBody>\n            Resetting the workspace will erase all state saved in the docker container overlay and\n            DELETE ALL UNCOMMITTED CODE. This means you might need to reinstall or reconfigure\n            certain applications. You can also just recreate the pod with rebuild without wiping all state. With reset, you will start with a fresh clone of the repository. Are you sure\n            you want to reset {workspaceName}?\n          </ModalBody>\n          <ModalFooter>\n            <HStack spacing={\"2\"}>\n              <Button onClick={onClose}>Close</Button>\n              <Button colorScheme={\"primary\"} onClick={() => onClick(onClose)}>\n                Reset\n              </Button>\n            </HStack>\n          </ModalFooter>\n        </ModalContent>\n      </Modal>\n    ),\n    [isOpen, onClick, onClose, workspaceName]\n  )\n\n  return { modal, open: onOpen }\n}\n"
  },
  {
    "path": "desktop/src/lib/modals/useStopWorkspaceModal.tsx",
    "content": "import {\n  Button,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\n\nexport function useStopWorkspaceModal(onClick: (closeModal: VoidFunction) => void) {\n  const { isOpen, onOpen, onClose } = useDisclosure()\n\n  const modal = useMemo(\n    () => (\n      <Modal onClose={onClose} isOpen={isOpen} isCentered>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalHeader>Stop Workspace</ModalHeader>\n          <ModalCloseButton />\n          <ModalBody>\n            Stopping a workspace while it&apos;s not running may leave it in a corrupted state. Do\n            you want to stop it regardless?\n          </ModalBody>\n          <ModalFooter>\n            <HStack spacing={\"2\"}>\n              <Button onClick={onClose}>Close</Button>\n              <Button colorScheme={\"red\"} onClick={() => onClick(onClose)}>\n                Stop\n              </Button>\n            </HStack>\n          </ModalFooter>\n        </ModalContent>\n      </Modal>\n    ),\n    [isOpen, onClick, onClose]\n  )\n\n  return { modal, open: onOpen }\n}\n"
  },
  {
    "path": "desktop/src/lib/platform.ts",
    "content": "export const isLinux = import.meta.env.TAURI_ENV_PLATFORM === \"linux\"\nexport const isMacOS = import.meta.env.TAURI_ENV_PLATFORM === \"darwin\"\nexport const isWindows = import.meta.env.TAURI_ENV_PLATFORM === \"windows\"\n"
  },
  {
    "path": "desktop/src/lib/pro/constants.ts",
    "content": "export const WorkspaceInstanceSource = {\n  prefixGit: \"git:\",\n  prefixImage: \"image:\",\n  prefixLocal: \"local:\",\n}\n\nexport const Annotations = {\n  WorkspaceSource: \"loft.sh/workspace-source\",\n  SleepModeLastActivity: \"sleepmode.loft.sh/last-activity\",\n}\n\nexport const Labels = {\n  WorkspaceID: \"loft.sh/workspace-id\",\n  WorkspaceUID: \"loft.sh/workspace-uid\",\n}\n"
  },
  {
    "path": "desktop/src/lib/pro/index.ts",
    "content": "export * from \"./name\"\nexport * from \"./constants\"\nexport * from \"./source\"\nexport * from \"./time\"\nexport * from \"./parameters\"\nexport * from \"./useConnectionStatus\"\n"
  },
  {
    "path": "desktop/src/lib/pro/name.ts",
    "content": "export function getDisplayName(\n  entity:\n    | Readonly<{\n        metadata?: { name?: string }\n        spec?: {\n          displayName?: string\n        }\n      }>\n    | undefined,\n  fallback: string = \"\"\n): string {\n  if (entity?.spec?.displayName) {\n    return entity.spec.displayName\n  }\n\n  if (entity?.metadata?.name) {\n    return entity.metadata.name\n  }\n\n  return fallback\n}\n\nexport async function safeMaxName(str: string, maxLength: number): Promise<string> {\n  if (str.length <= maxLength) {\n    return str\n  }\n\n  try {\n    const text = new TextEncoder().encode(str)\n    const digest = await crypto.subtle.digest(\"SHA-256\", text)\n    const hash = new Uint8Array(digest).reduce((s, b) => s + b.toString(16).padStart(2, \"0\"), \"\")\n\n    return `${str.substring(0, maxLength - 8)}-${hash.substring(0, 7)}`\n  } catch (err) {\n    console.error(\"Failed to hash string\", str, err)\n\n    return str.substring(0, maxLength)\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/pro/parameters.tsx",
    "content": "import { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport { StorageV1AppParameter } from \"@loft-enterprise/client/gen/models/storageV1AppParameter\"\nimport { StorageV1DevPodWorkspaceTemplateVersion } from \"@loft-enterprise/client/gen/models/storageV1DevPodWorkspaceTemplateVersion\"\nimport { compareVersions } from \"compare-versions\"\nimport jsyaml from \"js-yaml\"\n\nexport type TParameterWithValue = StorageV1AppParameter & { value?: string | number | boolean }\n\nexport function getParametersWithValues(\n  instance: ManagementV1DevPodWorkspaceInstance,\n  template: ManagementV1DevPodWorkspaceTemplate\n): readonly TParameterWithValue[] | undefined {\n  let rawParameters: StorageV1AppParameter[] | undefined = template.spec?.parameters\n  if (instance.spec?.templateRef?.version) {\n    // find versioned parameters\n    rawParameters = template.spec?.versions?.find(\n      (version) => version.version === instance.spec?.templateRef?.version\n    )?.parameters\n  } else if (template.spec?.versions && template.spec.versions.length > 0) {\n    // fall back to latest version\n    rawParameters = template.spec.versions[0]?.parameters\n  }\n\n  if (!instance.spec?.parameters || !rawParameters) {\n    return undefined\n  }\n\n  try {\n    const out = jsyaml.load(instance.spec.parameters) as Record<string, string | number | boolean>\n\n    return rawParameters.map((param) => {\n      const path = param.variable\n      if (path) {\n        return { ...param, value: out[path] }\n      }\n\n      return param\n    })\n  } catch {\n    return undefined\n  }\n}\n\nexport function getParameters(\n  template: ManagementV1DevPodWorkspaceTemplate | undefined,\n  selectedVersion: string | undefined\n): readonly StorageV1AppParameter[] | undefined {\n  if (!template?.spec) {\n    return undefined\n  }\n\n  if (selectedVersion) {\n    return template.spec.versions?.find((version) => version.version === selectedVersion)\n      ?.parameters\n  }\n\n  if (template.spec.versions && template.spec.versions.length > 0) {\n    const latestVersion = findLatestVersion(template.spec.versions)\n    if (latestVersion) {\n      return template.spec.versions.find((version) => version.version === latestVersion.version)\n        ?.parameters\n    }\n  }\n\n  return template.spec.parameters\n}\n\nfunction findLatestVersion(\n  versions: readonly StorageV1DevPodWorkspaceTemplateVersion[]\n): StorageV1DevPodWorkspaceTemplateVersion | undefined {\n  return versions.slice().sort(sortByVersionDesc)[0]\n}\n\nexport function sortByVersionDesc(\n  a: StorageV1DevPodWorkspaceTemplateVersion,\n  b: StorageV1DevPodWorkspaceTemplateVersion\n): number {\n  return compareVersions(stripVersionPrefix(b.version ?? \"\"), stripVersionPrefix(a.version ?? \"\"))\n}\n\nfunction stripVersionPrefix(version: string): string {\n  if (version.startsWith(\"v\")) {\n    return version.substring(1, version.length)\n  }\n\n  return version\n}\n"
  },
  {
    "path": "desktop/src/lib/pro/source.ts",
    "content": "import { WorkspaceInstanceSource } from \"./constants\"\nimport { TWorkspaceSourceType } from \"@/types\"\n\nexport class Source {\n  readonly type: TWorkspaceSourceType\n  readonly value: string\n\n  constructor(type?: TWorkspaceSourceType, value?: string) {\n    this.type = type ?? \"git\"\n    this.value = value ?? \"\"\n  }\n\n  static fromRaw(rawSource?: string): Source {\n    if (rawSource?.startsWith(WorkspaceInstanceSource.prefixGit)) {\n      return new Source(\"git\", rawSource.replace(WorkspaceInstanceSource.prefixGit, \"\"))\n    }\n\n    if (rawSource?.startsWith(WorkspaceInstanceSource.prefixImage)) {\n      return new Source(\"image\", rawSource.replace(WorkspaceInstanceSource.prefixImage, \"\"))\n    }\n\n    if (rawSource?.startsWith(WorkspaceInstanceSource.prefixLocal)) {\n      return new Source(\"local\", rawSource.replace(WorkspaceInstanceSource.prefixLocal, \"\"))\n    }\n\n    return new Source()\n  }\n\n  public stringify(): string {\n    const value = this.value.trim()\n    switch (this.type) {\n      case \"git\":\n        return `${WorkspaceInstanceSource.prefixGit}${value}`\n      case \"image\":\n        return `${WorkspaceInstanceSource.prefixImage}${value}`\n      case \"local\":\n        return `${WorkspaceInstanceSource.prefixLocal}${value}`\n    }\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/pro/time.ts",
    "content": "import { ProWorkspaceInstance } from \"@/contexts\"\nimport { Annotations } from \"./constants\"\n\nexport function getLastActivity(instance: ProWorkspaceInstance): Date | undefined {\n  const maybeTimestamp = instance.metadata?.annotations?.[Annotations.SleepModeLastActivity]\n  if (!maybeTimestamp) {\n    return undefined\n  }\n\n  const timestamp = Number.parseInt(maybeTimestamp)\n  if (Number.isNaN(timestamp)) {\n    return undefined\n  }\n\n  return new Date(timestamp * 1_000)\n}\n"
  },
  {
    "path": "desktop/src/lib/pro/useConnectionStatus.tsx",
    "content": "import { useProContext } from \"@/contexts\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport { TPlatformHealthCheck } from \"@/types\"\nimport { useQuery } from \"@tanstack/react-query\"\n\nexport type TConnectionStatus = Partial<TPlatformHealthCheck> & {\n  isLoading: boolean\n}\nexport function useConnectionStatus(): TConnectionStatus {\n  const { host, client } = useProContext()\n  const { data: connection, isLoading } = useQuery({\n    queryKey: QueryKeys.connectionStatus(host),\n    queryFn: async () => {\n      try {\n        const platformRes = await client.checkHealth()\n        if (platformRes.ok) {\n          return platformRes.val\n        }\n\n        return { healthy: false }\n      } catch {\n        return { healthy: false }\n      }\n    },\n    refetchInterval: 5_000,\n  })\n\n  return { ...connection, isLoading }\n}\n"
  },
  {
    "path": "desktop/src/lib/randomWords.ts",
    "content": "const words = [\n  \"ability\",\n  \"able\",\n  \"aboard\",\n  \"about\",\n  \"above\",\n  \"accept\",\n  \"accident\",\n  \"according\",\n  \"account\",\n  \"accurate\",\n  \"acres\",\n  \"across\",\n  \"act\",\n  \"action\",\n  \"active\",\n  \"activity\",\n  \"actual\",\n  \"actually\",\n  \"add\",\n  \"addition\",\n  \"additional\",\n  \"adjective\",\n  \"adult\",\n  \"adventure\",\n  \"advice\",\n  \"affect\",\n  \"afraid\",\n  \"after\",\n  \"afternoon\",\n  \"again\",\n  \"against\",\n  \"age\",\n  \"ago\",\n  \"agree\",\n  \"ahead\",\n  \"aid\",\n  \"air\",\n  \"airplane\",\n  \"alike\",\n  \"alive\",\n  \"all\",\n  \"allow\",\n  \"almost\",\n  \"alone\",\n  \"along\",\n  \"aloud\",\n  \"alphabet\",\n  \"already\",\n  \"also\",\n  \"although\",\n  \"am\",\n  \"among\",\n  \"amount\",\n  \"ancient\",\n  \"angle\",\n  \"angry\",\n  \"animal\",\n  \"announced\",\n  \"another\",\n  \"answer\",\n  \"ants\",\n  \"any\",\n  \"anybody\",\n  \"anyone\",\n  \"anything\",\n  \"anyway\",\n  \"anywhere\",\n  \"apart\",\n  \"apartment\",\n  \"appearance\",\n  \"apple\",\n  \"applied\",\n  \"appropriate\",\n  \"are\",\n  \"area\",\n  \"arm\",\n  \"army\",\n  \"around\",\n  \"arrange\",\n  \"arrangement\",\n  \"arrive\",\n  \"arrow\",\n  \"art\",\n  \"article\",\n  \"as\",\n  \"aside\",\n  \"ask\",\n  \"asleep\",\n  \"at\",\n  \"ate\",\n  \"atmosphere\",\n  \"atom\",\n  \"atomic\",\n  \"attached\",\n  \"attack\",\n  \"attempt\",\n  \"attention\",\n  \"audience\",\n  \"author\",\n  \"automobile\",\n  \"available\",\n  \"average\",\n  \"avoid\",\n  \"aware\",\n  \"away\",\n  \"baby\",\n  \"back\",\n  \"bad\",\n  \"badly\",\n  \"bag\",\n  \"balance\",\n  \"ball\",\n  \"balloon\",\n  \"band\",\n  \"bank\",\n  \"bar\",\n  \"bare\",\n  \"bark\",\n  \"barn\",\n  \"base\",\n  \"baseball\",\n  \"basic\",\n  \"basis\",\n  \"basket\",\n  \"bat\",\n  \"battle\",\n  \"be\",\n  \"bean\",\n  \"bear\",\n  \"beat\",\n  \"beautiful\",\n  \"beauty\",\n  \"became\",\n  \"because\",\n  \"become\",\n  \"becoming\",\n  \"bee\",\n  \"been\",\n  \"before\",\n  \"began\",\n  \"beginning\",\n  \"begun\",\n  \"behavior\",\n  \"behind\",\n  \"being\",\n  \"believed\",\n  \"bell\",\n  \"belong\",\n  \"below\",\n  \"belt\",\n  \"bend\",\n  \"beneath\",\n  \"bent\",\n  \"beside\",\n  \"best\",\n  \"bet\",\n  \"better\",\n  \"between\",\n  \"beyond\",\n  \"bicycle\",\n  \"bigger\",\n  \"biggest\",\n  \"bill\",\n  \"birds\",\n  \"birth\",\n  \"birthday\",\n  \"bit\",\n  \"bite\",\n  \"black\",\n  \"blank\",\n  \"blanket\",\n  \"blew\",\n  \"blind\",\n  \"block\",\n  \"blood\",\n  \"blow\",\n  \"blue\",\n  \"board\",\n  \"boat\",\n  \"body\",\n  \"bone\",\n  \"book\",\n  \"border\",\n  \"born\",\n  \"both\",\n  \"bottle\",\n  \"bottom\",\n  \"bound\",\n  \"bow\",\n  \"bowl\",\n  \"box\",\n  \"boy\",\n  \"brain\",\n  \"branch\",\n  \"brass\",\n  \"brave\",\n  \"bread\",\n  \"break\",\n  \"breakfast\",\n  \"breath\",\n  \"breathe\",\n  \"breathing\",\n  \"breeze\",\n  \"brick\",\n  \"bridge\",\n  \"brief\",\n  \"bright\",\n  \"bring\",\n  \"broad\",\n  \"broke\",\n  \"broken\",\n  \"brother\",\n  \"brought\",\n  \"brown\",\n  \"brush\",\n  \"buffalo\",\n  \"build\",\n  \"building\",\n  \"built\",\n  \"buried\",\n  \"burn\",\n  \"burst\",\n  \"bus\",\n  \"bush\",\n  \"business\",\n  \"busy\",\n  \"but\",\n  \"butter\",\n  \"buy\",\n  \"by\",\n  \"cabin\",\n  \"cage\",\n  \"cake\",\n  \"call\",\n  \"calm\",\n  \"came\",\n  \"camera\",\n  \"camp\",\n  \"can\",\n  \"canal\",\n  \"cannot\",\n  \"cap\",\n  \"capital\",\n  \"captain\",\n  \"captured\",\n  \"car\",\n  \"carbon\",\n  \"card\",\n  \"care\",\n  \"careful\",\n  \"carefully\",\n  \"carried\",\n  \"carry\",\n  \"case\",\n  \"cast\",\n  \"castle\",\n  \"cat\",\n  \"catch\",\n  \"cattle\",\n  \"caught\",\n  \"cause\",\n  \"cave\",\n  \"cell\",\n  \"cent\",\n  \"center\",\n  \"central\",\n  \"century\",\n  \"certain\",\n  \"certainly\",\n  \"chain\",\n  \"chair\",\n  \"chamber\",\n  \"chance\",\n  \"change\",\n  \"changing\",\n  \"chapter\",\n  \"character\",\n  \"characteristic\",\n  \"charge\",\n  \"chart\",\n  \"check\",\n  \"cheese\",\n  \"chemical\",\n  \"chest\",\n  \"chicken\",\n  \"chief\",\n  \"child\",\n  \"children\",\n  \"choice\",\n  \"choose\",\n  \"chose\",\n  \"chosen\",\n  \"church\",\n  \"circle\",\n  \"circus\",\n  \"citizen\",\n  \"city\",\n  \"class\",\n  \"classroom\",\n  \"claws\",\n  \"clay\",\n  \"clean\",\n  \"clear\",\n  \"clearly\",\n  \"climate\",\n  \"climb\",\n  \"clock\",\n  \"close\",\n  \"closely\",\n  \"closer\",\n  \"cloth\",\n  \"clothes\",\n  \"clothing\",\n  \"cloud\",\n  \"club\",\n  \"coach\",\n  \"coal\",\n  \"coast\",\n  \"coat\",\n  \"coffee\",\n  \"cold\",\n  \"collect\",\n  \"college\",\n  \"colony\",\n  \"color\",\n  \"column\",\n  \"combination\",\n  \"combine\",\n  \"come\",\n  \"comfortable\",\n  \"coming\",\n  \"command\",\n  \"common\",\n  \"community\",\n  \"company\",\n  \"compare\",\n  \"compass\",\n  \"complete\",\n  \"completely\",\n  \"complex\",\n  \"composed\",\n  \"composition\",\n  \"compound\",\n  \"concerned\",\n  \"condition\",\n  \"congress\",\n  \"connected\",\n  \"consider\",\n  \"consist\",\n  \"consonant\",\n  \"constantly\",\n  \"construction\",\n  \"contain\",\n  \"continent\",\n  \"continued\",\n  \"contrast\",\n  \"control\",\n  \"conversation\",\n  \"cook\",\n  \"cookies\",\n  \"cool\",\n  \"copper\",\n  \"copy\",\n  \"corn\",\n  \"corner\",\n  \"correct\",\n  \"correctly\",\n  \"cost\",\n  \"cotton\",\n  \"could\",\n  \"count\",\n  \"country\",\n  \"couple\",\n  \"courage\",\n  \"course\",\n  \"court\",\n  \"cover\",\n  \"cow\",\n  \"cowboy\",\n  \"crack\",\n  \"cream\",\n  \"create\",\n  \"creature\",\n  \"crew\",\n  \"crop\",\n  \"cross\",\n  \"crowd\",\n  \"cry\",\n  \"cup\",\n  \"curious\",\n  \"current\",\n  \"curve\",\n  \"customs\",\n  \"cut\",\n  \"cutting\",\n  \"daily\",\n  \"damage\",\n  \"dance\",\n  \"danger\",\n  \"dangerous\",\n  \"dark\",\n  \"darkness\",\n  \"date\",\n  \"daughter\",\n  \"dawn\",\n  \"day\",\n  \"dead\",\n  \"deal\",\n  \"dear\",\n  \"death\",\n  \"decide\",\n  \"declared\",\n  \"deep\",\n  \"deeply\",\n  \"deer\",\n  \"definition\",\n  \"degree\",\n  \"depend\",\n  \"depth\",\n  \"describe\",\n  \"desert\",\n  \"design\",\n  \"desk\",\n  \"detail\",\n  \"determine\",\n  \"develop\",\n  \"development\",\n  \"diagram\",\n  \"diameter\",\n  \"did\",\n  \"die\",\n  \"differ\",\n  \"difference\",\n  \"different\",\n  \"difficult\",\n  \"difficulty\",\n  \"dig\",\n  \"dinner\",\n  \"direct\",\n  \"direction\",\n  \"directly\",\n  \"dirt\",\n  \"dirty\",\n  \"disappear\",\n  \"discover\",\n  \"discovery\",\n  \"discuss\",\n  \"discussion\",\n  \"disease\",\n  \"dish\",\n  \"distance\",\n  \"distant\",\n  \"divide\",\n  \"division\",\n  \"do\",\n  \"doctor\",\n  \"does\",\n  \"dog\",\n  \"doing\",\n  \"doll\",\n  \"dollar\",\n  \"done\",\n  \"donkey\",\n  \"door\",\n  \"dot\",\n  \"double\",\n  \"doubt\",\n  \"down\",\n  \"dozen\",\n  \"draw\",\n  \"drawn\",\n  \"dream\",\n  \"dress\",\n  \"drew\",\n  \"dried\",\n  \"drink\",\n  \"drive\",\n  \"driven\",\n  \"driver\",\n  \"driving\",\n  \"drop\",\n  \"dropped\",\n  \"drove\",\n  \"dry\",\n  \"duck\",\n  \"due\",\n  \"dug\",\n  \"dull\",\n  \"during\",\n  \"dust\",\n  \"duty\",\n  \"each\",\n  \"eager\",\n  \"ear\",\n  \"earlier\",\n  \"early\",\n  \"earn\",\n  \"earth\",\n  \"easier\",\n  \"easily\",\n  \"east\",\n  \"easy\",\n  \"eat\",\n  \"eaten\",\n  \"edge\",\n  \"education\",\n  \"effect\",\n  \"effort\",\n  \"egg\",\n  \"eight\",\n  \"either\",\n  \"electric\",\n  \"electricity\",\n  \"element\",\n  \"elephant\",\n  \"eleven\",\n  \"else\",\n  \"empty\",\n  \"end\",\n  \"enemy\",\n  \"energy\",\n  \"engine\",\n  \"engineer\",\n  \"enjoy\",\n  \"enough\",\n  \"enter\",\n  \"entire\",\n  \"entirely\",\n  \"environment\",\n  \"equal\",\n  \"equally\",\n  \"equator\",\n  \"equipment\",\n  \"escape\",\n  \"especially\",\n  \"essential\",\n  \"establish\",\n  \"even\",\n  \"evening\",\n  \"event\",\n  \"eventually\",\n  \"ever\",\n  \"every\",\n  \"everybody\",\n  \"everyone\",\n  \"everything\",\n  \"everywhere\",\n  \"evidence\",\n  \"exact\",\n  \"exactly\",\n  \"examine\",\n  \"example\",\n  \"excellent\",\n  \"except\",\n  \"exchange\",\n  \"excited\",\n  \"excitement\",\n  \"exciting\",\n  \"exclaimed\",\n  \"exercise\",\n  \"exist\",\n  \"expect\",\n  \"experience\",\n  \"experiment\",\n  \"explain\",\n  \"explanation\",\n  \"explore\",\n  \"express\",\n  \"expression\",\n  \"extra\",\n  \"eye\",\n  \"face\",\n  \"facing\",\n  \"fact\",\n  \"factor\",\n  \"factory\",\n  \"failed\",\n  \"fair\",\n  \"fairly\",\n  \"fall\",\n  \"fallen\",\n  \"familiar\",\n  \"family\",\n  \"famous\",\n  \"far\",\n  \"farm\",\n  \"farmer\",\n  \"farther\",\n  \"fast\",\n  \"fastened\",\n  \"faster\",\n  \"fat\",\n  \"father\",\n  \"favorite\",\n  \"fear\",\n  \"feathers\",\n  \"feature\",\n  \"fed\",\n  \"feed\",\n  \"feel\",\n  \"feet\",\n  \"fell\",\n  \"fellow\",\n  \"felt\",\n  \"fence\",\n  \"few\",\n  \"fewer\",\n  \"field\",\n  \"fierce\",\n  \"fifteen\",\n  \"fifth\",\n  \"fifty\",\n  \"fight\",\n  \"fighting\",\n  \"figure\",\n  \"fill\",\n  \"film\",\n  \"final\",\n  \"finally\",\n  \"find\",\n  \"fine\",\n  \"finest\",\n  \"finger\",\n  \"finish\",\n  \"fire\",\n  \"fireplace\",\n  \"firm\",\n  \"first\",\n  \"fish\",\n  \"five\",\n  \"fix\",\n  \"flag\",\n  \"flame\",\n  \"flat\",\n  \"flew\",\n  \"flies\",\n  \"flight\",\n  \"floating\",\n  \"floor\",\n  \"flow\",\n  \"flower\",\n  \"fly\",\n  \"fog\",\n  \"folks\",\n  \"follow\",\n  \"food\",\n  \"foot\",\n  \"football\",\n  \"for\",\n  \"force\",\n  \"foreign\",\n  \"forest\",\n  \"forget\",\n  \"forgot\",\n  \"forgotten\",\n  \"form\",\n  \"former\",\n  \"fort\",\n  \"forth\",\n  \"forty\",\n  \"forward\",\n  \"fought\",\n  \"found\",\n  \"four\",\n  \"fourth\",\n  \"fox\",\n  \"frame\",\n  \"free\",\n  \"freedom\",\n  \"frequently\",\n  \"fresh\",\n  \"friend\",\n  \"friendly\",\n  \"frighten\",\n  \"frog\",\n  \"from\",\n  \"front\",\n  \"frozen\",\n  \"fruit\",\n  \"fuel\",\n  \"full\",\n  \"fully\",\n  \"fun\",\n  \"function\",\n  \"funny\",\n  \"fur\",\n  \"furniture\",\n  \"further\",\n  \"future\",\n  \"gain\",\n  \"game\",\n  \"garage\",\n  \"garden\",\n  \"gas\",\n  \"gasoline\",\n  \"gate\",\n  \"gather\",\n  \"gave\",\n  \"general\",\n  \"generally\",\n  \"gentle\",\n  \"gently\",\n  \"get\",\n  \"getting\",\n  \"giant\",\n  \"gift\",\n  \"girl\",\n  \"give\",\n  \"given\",\n  \"giving\",\n  \"glad\",\n  \"glass\",\n  \"globe\",\n  \"go\",\n  \"goes\",\n  \"gold\",\n  \"golden\",\n  \"gone\",\n  \"good\",\n  \"goose\",\n  \"got\",\n  \"government\",\n  \"grabbed\",\n  \"grade\",\n  \"gradually\",\n  \"grain\",\n  \"grandfather\",\n  \"grandmother\",\n  \"graph\",\n  \"grass\",\n  \"gravity\",\n  \"gray\",\n  \"great\",\n  \"greater\",\n  \"greatest\",\n  \"greatly\",\n  \"green\",\n  \"grew\",\n  \"ground\",\n  \"group\",\n  \"grow\",\n  \"grown\",\n  \"growth\",\n  \"guard\",\n  \"guess\",\n  \"guide\",\n  \"gulf\",\n  \"gun\",\n  \"habit\",\n  \"had\",\n  \"hair\",\n  \"half\",\n  \"halfway\",\n  \"hall\",\n  \"hand\",\n  \"handle\",\n  \"handsome\",\n  \"hang\",\n  \"happen\",\n  \"happened\",\n  \"happily\",\n  \"happy\",\n  \"harbor\",\n  \"hard\",\n  \"harder\",\n  \"hardly\",\n  \"has\",\n  \"hat\",\n  \"have\",\n  \"having\",\n  \"hay\",\n  \"he\",\n  \"headed\",\n  \"heading\",\n  \"health\",\n  \"heard\",\n  \"hearing\",\n  \"heart\",\n  \"heat\",\n  \"heavy\",\n  \"height\",\n  \"held\",\n  \"hello\",\n  \"help\",\n  \"helpful\",\n  \"her\",\n  \"herd\",\n  \"here\",\n  \"herself\",\n  \"hidden\",\n  \"hide\",\n  \"high\",\n  \"higher\",\n  \"highest\",\n  \"highway\",\n  \"hill\",\n  \"him\",\n  \"himself\",\n  \"his\",\n  \"history\",\n  \"hit\",\n  \"hold\",\n  \"hole\",\n  \"hollow\",\n  \"home\",\n  \"honor\",\n  \"hope\",\n  \"horn\",\n  \"horse\",\n  \"hospital\",\n  \"hot\",\n  \"hour\",\n  \"house\",\n  \"how\",\n  \"however\",\n  \"huge\",\n  \"human\",\n  \"hundred\",\n  \"hung\",\n  \"hungry\",\n  \"hunt\",\n  \"hunter\",\n  \"hurried\",\n  \"hurry\",\n  \"hurt\",\n  \"husband\",\n  \"ice\",\n  \"idea\",\n  \"identity\",\n  \"if\",\n  \"ill\",\n  \"image\",\n  \"imagine\",\n  \"immediately\",\n  \"importance\",\n  \"important\",\n  \"impossible\",\n  \"improve\",\n  \"in\",\n  \"inch\",\n  \"include\",\n  \"including\",\n  \"income\",\n  \"increase\",\n  \"indeed\",\n  \"independent\",\n  \"indicate\",\n  \"individual\",\n  \"industrial\",\n  \"industry\",\n  \"influence\",\n  \"information\",\n  \"inside\",\n  \"instance\",\n  \"instant\",\n  \"instead\",\n  \"instrument\",\n  \"interest\",\n  \"interior\",\n  \"into\",\n  \"introduced\",\n  \"invented\",\n  \"involved\",\n  \"iron\",\n  \"is\",\n  \"island\",\n  \"it\",\n  \"its\",\n  \"itself\",\n  \"jack\",\n  \"jar\",\n  \"jet\",\n  \"job\",\n  \"join\",\n  \"joined\",\n  \"journey\",\n  \"joy\",\n  \"judge\",\n  \"jump\",\n  \"jungle\",\n  \"just\",\n  \"keep\",\n  \"kept\",\n  \"key\",\n  \"kids\",\n  \"kill\",\n  \"kind\",\n  \"kitchen\",\n  \"knew\",\n  \"knife\",\n  \"know\",\n  \"knowledge\",\n  \"known\",\n  \"label\",\n  \"labor\",\n  \"lack\",\n  \"lady\",\n  \"laid\",\n  \"lake\",\n  \"lamp\",\n  \"land\",\n  \"language\",\n  \"large\",\n  \"larger\",\n  \"largest\",\n  \"last\",\n  \"late\",\n  \"later\",\n  \"laugh\",\n  \"law\",\n  \"lay\",\n  \"layers\",\n  \"lead\",\n  \"leader\",\n  \"leaf\",\n  \"learn\",\n  \"least\",\n  \"leather\",\n  \"leave\",\n  \"leaving\",\n  \"led\",\n  \"left\",\n  \"leg\",\n  \"length\",\n  \"lesson\",\n  \"let\",\n  \"letter\",\n  \"level\",\n  \"library\",\n  \"lie\",\n  \"life\",\n  \"lift\",\n  \"light\",\n  \"like\",\n  \"likely\",\n  \"limited\",\n  \"line\",\n  \"lion\",\n  \"lips\",\n  \"liquid\",\n  \"list\",\n  \"listen\",\n  \"little\",\n  \"live\",\n  \"living\",\n  \"load\",\n  \"local\",\n  \"locate\",\n  \"location\",\n  \"log\",\n  \"lonely\",\n  \"long\",\n  \"longer\",\n  \"look\",\n  \"loose\",\n  \"lose\",\n  \"loss\",\n  \"lost\",\n  \"lot\",\n  \"loud\",\n  \"love\",\n  \"lovely\",\n  \"low\",\n  \"lower\",\n  \"luck\",\n  \"lucky\",\n  \"lunch\",\n  \"lungs\",\n  \"lying\",\n  \"machine\",\n  \"machinery\",\n  \"mad\",\n  \"made\",\n  \"magic\",\n  \"magnet\",\n  \"mail\",\n  \"main\",\n  \"mainly\",\n  \"major\",\n  \"make\",\n  \"making\",\n  \"man\",\n  \"managed\",\n  \"manner\",\n  \"manufacturing\",\n  \"many\",\n  \"map\",\n  \"mark\",\n  \"market\",\n  \"married\",\n  \"mass\",\n  \"massage\",\n  \"master\",\n  \"material\",\n  \"mathematics\",\n  \"matter\",\n  \"may\",\n  \"maybe\",\n  \"me\",\n  \"meal\",\n  \"mean\",\n  \"means\",\n  \"meant\",\n  \"measure\",\n  \"meat\",\n  \"medicine\",\n  \"meet\",\n  \"melted\",\n  \"member\",\n  \"memory\",\n  \"men\",\n  \"mental\",\n  \"merely\",\n  \"met\",\n  \"metal\",\n  \"method\",\n  \"mice\",\n  \"middle\",\n  \"might\",\n  \"mighty\",\n  \"mile\",\n  \"military\",\n  \"milk\",\n  \"mill\",\n  \"mind\",\n  \"mine\",\n  \"minerals\",\n  \"minute\",\n  \"mirror\",\n  \"missing\",\n  \"mission\",\n  \"mistake\",\n  \"mix\",\n  \"mixture\",\n  \"model\",\n  \"modern\",\n  \"molecular\",\n  \"moment\",\n  \"money\",\n  \"monkey\",\n  \"month\",\n  \"mood\",\n  \"moon\",\n  \"more\",\n  \"morning\",\n  \"most\",\n  \"mostly\",\n  \"mother\",\n  \"motion\",\n  \"motor\",\n  \"mountain\",\n  \"mouse\",\n  \"mouth\",\n  \"move\",\n  \"movement\",\n  \"movie\",\n  \"moving\",\n  \"mud\",\n  \"muscle\",\n  \"music\",\n  \"musical\",\n  \"must\",\n  \"my\",\n  \"myself\",\n  \"mysterious\",\n  \"nails\",\n  \"name\",\n  \"nation\",\n  \"national\",\n  \"native\",\n  \"natural\",\n  \"naturally\",\n  \"nature\",\n  \"near\",\n  \"nearby\",\n  \"nearer\",\n  \"nearest\",\n  \"nearly\",\n  \"necessary\",\n  \"neck\",\n  \"needed\",\n  \"needle\",\n  \"needs\",\n  \"negative\",\n  \"neighbor\",\n  \"neighborhood\",\n  \"nervous\",\n  \"nest\",\n  \"never\",\n  \"new\",\n  \"news\",\n  \"newspaper\",\n  \"next\",\n  \"nice\",\n  \"night\",\n  \"nine\",\n  \"no\",\n  \"nobody\",\n  \"nodded\",\n  \"noise\",\n  \"none\",\n  \"noon\",\n  \"nor\",\n  \"north\",\n  \"nose\",\n  \"not\",\n  \"note\",\n  \"noted\",\n  \"nothing\",\n  \"notice\",\n  \"noun\",\n  \"now\",\n  \"number\",\n  \"numeral\",\n  \"nuts\",\n  \"object\",\n  \"observe\",\n  \"obtain\",\n  \"occasionally\",\n  \"occur\",\n  \"ocean\",\n  \"of\",\n  \"off\",\n  \"offer\",\n  \"office\",\n  \"officer\",\n  \"official\",\n  \"oil\",\n  \"old\",\n  \"older\",\n  \"oldest\",\n  \"on\",\n  \"once\",\n  \"one\",\n  \"only\",\n  \"onto\",\n  \"open\",\n  \"operation\",\n  \"opinion\",\n  \"opportunity\",\n  \"opposite\",\n  \"or\",\n  \"orange\",\n  \"orbit\",\n  \"order\",\n  \"ordinary\",\n  \"organization\",\n  \"organized\",\n  \"origin\",\n  \"original\",\n  \"other\",\n  \"ought\",\n  \"our\",\n  \"ourselves\",\n  \"out\",\n  \"outer\",\n  \"outline\",\n  \"outside\",\n  \"over\",\n  \"own\",\n  \"owner\",\n  \"oxygen\",\n  \"pack\",\n  \"package\",\n  \"page\",\n  \"paid\",\n  \"pain\",\n  \"paint\",\n  \"pair\",\n  \"palace\",\n  \"pale\",\n  \"pan\",\n  \"paper\",\n  \"paragraph\",\n  \"parallel\",\n  \"parent\",\n  \"park\",\n  \"part\",\n  \"particles\",\n  \"particular\",\n  \"particularly\",\n  \"partly\",\n  \"parts\",\n  \"party\",\n  \"pass\",\n  \"passage\",\n  \"past\",\n  \"path\",\n  \"pattern\",\n  \"pay\",\n  \"peace\",\n  \"pen\",\n  \"pencil\",\n  \"people\",\n  \"per\",\n  \"percent\",\n  \"perfect\",\n  \"perfectly\",\n  \"perhaps\",\n  \"period\",\n  \"person\",\n  \"personal\",\n  \"pet\",\n  \"phrase\",\n  \"physical\",\n  \"piano\",\n  \"pick\",\n  \"picture\",\n  \"pictured\",\n  \"pie\",\n  \"piece\",\n  \"pig\",\n  \"pile\",\n  \"pilot\",\n  \"pine\",\n  \"pink\",\n  \"pipe\",\n  \"pitch\",\n  \"place\",\n  \"plain\",\n  \"plan\",\n  \"plane\",\n  \"planet\",\n  \"planned\",\n  \"planning\",\n  \"plant\",\n  \"plastic\",\n  \"plate\",\n  \"plates\",\n  \"play\",\n  \"pleasant\",\n  \"please\",\n  \"pleasure\",\n  \"plenty\",\n  \"plural\",\n  \"plus\",\n  \"pocket\",\n  \"poem\",\n  \"poet\",\n  \"poetry\",\n  \"point\",\n  \"pole\",\n  \"police\",\n  \"policeman\",\n  \"political\",\n  \"pond\",\n  \"pony\",\n  \"pool\",\n  \"poor\",\n  \"popular\",\n  \"population\",\n  \"porch\",\n  \"port\",\n  \"position\",\n  \"positive\",\n  \"possible\",\n  \"possibly\",\n  \"post\",\n  \"pot\",\n  \"potatoes\",\n  \"pound\",\n  \"pour\",\n  \"powder\",\n  \"power\",\n  \"powerful\",\n  \"practical\",\n  \"practice\",\n  \"prepare\",\n  \"present\",\n  \"president\",\n  \"press\",\n  \"pressure\",\n  \"pretty\",\n  \"prevent\",\n  \"previous\",\n  \"price\",\n  \"pride\",\n  \"primitive\",\n  \"principal\",\n  \"principle\",\n  \"printed\",\n  \"private\",\n  \"prize\",\n  \"probably\",\n  \"problem\",\n  \"process\",\n  \"produce\",\n  \"product\",\n  \"production\",\n  \"program\",\n  \"progress\",\n  \"promised\",\n  \"proper\",\n  \"properly\",\n  \"property\",\n  \"protection\",\n  \"proud\",\n  \"prove\",\n  \"provide\",\n  \"public\",\n  \"pull\",\n  \"pupil\",\n  \"pure\",\n  \"purple\",\n  \"purpose\",\n  \"push\",\n  \"put\",\n  \"putting\",\n  \"quarter\",\n  \"queen\",\n  \"question\",\n  \"quick\",\n  \"quickly\",\n  \"quiet\",\n  \"quietly\",\n  \"quite\",\n  \"rabbit\",\n  \"race\",\n  \"radio\",\n  \"railroad\",\n  \"rain\",\n  \"raise\",\n  \"ran\",\n  \"ranch\",\n  \"range\",\n  \"rapidly\",\n  \"rate\",\n  \"rather\",\n  \"raw\",\n  \"rays\",\n  \"reach\",\n  \"read\",\n  \"reader\",\n  \"ready\",\n  \"real\",\n  \"realize\",\n  \"rear\",\n  \"reason\",\n  \"recall\",\n  \"receive\",\n  \"recent\",\n  \"recently\",\n  \"recognize\",\n  \"record\",\n  \"red\",\n  \"refer\",\n  \"refused\",\n  \"region\",\n  \"regular\",\n  \"related\",\n  \"relationship\",\n  \"religious\",\n  \"remain\",\n  \"remarkable\",\n  \"remember\",\n  \"remove\",\n  \"repeat\",\n  \"replace\",\n  \"replied\",\n  \"report\",\n  \"represent\",\n  \"require\",\n  \"research\",\n  \"respect\",\n  \"rest\",\n  \"result\",\n  \"return\",\n  \"review\",\n  \"rhyme\",\n  \"rhythm\",\n  \"rice\",\n  \"rich\",\n  \"ride\",\n  \"riding\",\n  \"right\",\n  \"ring\",\n  \"rise\",\n  \"rising\",\n  \"river\",\n  \"road\",\n  \"roar\",\n  \"rock\",\n  \"rocket\",\n  \"rocky\",\n  \"rod\",\n  \"roll\",\n  \"roof\",\n  \"room\",\n  \"root\",\n  \"rope\",\n  \"rose\",\n  \"rough\",\n  \"round\",\n  \"route\",\n  \"row\",\n  \"rubbed\",\n  \"rubber\",\n  \"rule\",\n  \"ruler\",\n  \"run\",\n  \"running\",\n  \"rush\",\n  \"sad\",\n  \"saddle\",\n  \"safe\",\n  \"safety\",\n  \"said\",\n  \"sail\",\n  \"sale\",\n  \"salmon\",\n  \"salt\",\n  \"same\",\n  \"sand\",\n  \"sang\",\n  \"sat\",\n  \"satellites\",\n  \"satisfied\",\n  \"save\",\n  \"saved\",\n  \"saw\",\n  \"say\",\n  \"scale\",\n  \"scared\",\n  \"scene\",\n  \"school\",\n  \"science\",\n  \"scientific\",\n  \"scientist\",\n  \"score\",\n  \"screen\",\n  \"sea\",\n  \"search\",\n  \"season\",\n  \"seat\",\n  \"second\",\n  \"secret\",\n  \"section\",\n  \"see\",\n  \"seed\",\n  \"seeing\",\n  \"seems\",\n  \"seen\",\n  \"seldom\",\n  \"select\",\n  \"selection\",\n  \"sell\",\n  \"send\",\n  \"sense\",\n  \"sent\",\n  \"sentence\",\n  \"separate\",\n  \"series\",\n  \"serious\",\n  \"serve\",\n  \"service\",\n  \"sets\",\n  \"setting\",\n  \"settle\",\n  \"settlers\",\n  \"seven\",\n  \"several\",\n  \"shade\",\n  \"shadow\",\n  \"shake\",\n  \"shaking\",\n  \"shall\",\n  \"shallow\",\n  \"shape\",\n  \"share\",\n  \"sharp\",\n  \"she\",\n  \"sheep\",\n  \"sheet\",\n  \"shelf\",\n  \"shells\",\n  \"shelter\",\n  \"shine\",\n  \"shinning\",\n  \"ship\",\n  \"shirt\",\n  \"shoe\",\n  \"shoot\",\n  \"shop\",\n  \"shore\",\n  \"short\",\n  \"shorter\",\n  \"shot\",\n  \"should\",\n  \"shoulder\",\n  \"shout\",\n  \"show\",\n  \"shown\",\n  \"shut\",\n  \"sick\",\n  \"sides\",\n  \"sight\",\n  \"sign\",\n  \"signal\",\n  \"silence\",\n  \"silent\",\n  \"silk\",\n  \"silly\",\n  \"silver\",\n  \"similar\",\n  \"simple\",\n  \"simplest\",\n  \"simply\",\n  \"since\",\n  \"sing\",\n  \"single\",\n  \"sink\",\n  \"sister\",\n  \"sit\",\n  \"sitting\",\n  \"situation\",\n  \"six\",\n  \"size\",\n  \"skill\",\n  \"skin\",\n  \"sky\",\n  \"slabs\",\n  \"slave\",\n  \"sleep\",\n  \"slept\",\n  \"slide\",\n  \"slight\",\n  \"slightly\",\n  \"slip\",\n  \"slipped\",\n  \"slope\",\n  \"slow\",\n  \"slowly\",\n  \"small\",\n  \"smaller\",\n  \"smallest\",\n  \"smell\",\n  \"smile\",\n  \"smoke\",\n  \"smooth\",\n  \"snake\",\n  \"snow\",\n  \"so\",\n  \"soap\",\n  \"social\",\n  \"society\",\n  \"soft\",\n  \"softly\",\n  \"soil\",\n  \"solar\",\n  \"sold\",\n  \"soldier\",\n  \"solid\",\n  \"solution\",\n  \"solve\",\n  \"some\",\n  \"somebody\",\n  \"somehow\",\n  \"someone\",\n  \"something\",\n  \"sometime\",\n  \"somewhere\",\n  \"son\",\n  \"song\",\n  \"soon\",\n  \"sort\",\n  \"sound\",\n  \"source\",\n  \"south\",\n  \"southern\",\n  \"space\",\n  \"speak\",\n  \"special\",\n  \"species\",\n  \"specific\",\n  \"speech\",\n  \"speed\",\n  \"spell\",\n  \"spend\",\n  \"spent\",\n  \"spider\",\n  \"spin\",\n  \"spirit\",\n  \"spite\",\n  \"split\",\n  \"spoken\",\n  \"sport\",\n  \"spread\",\n  \"spring\",\n  \"square\",\n  \"stage\",\n  \"stairs\",\n  \"stand\",\n  \"standard\",\n  \"star\",\n  \"stared\",\n  \"start\",\n  \"state\",\n  \"statement\",\n  \"station\",\n  \"stay\",\n  \"steady\",\n  \"steam\",\n  \"steel\",\n  \"steep\",\n  \"stems\",\n  \"step\",\n  \"stepped\",\n  \"stick\",\n  \"stiff\",\n  \"still\",\n  \"stock\",\n  \"stomach\",\n  \"stone\",\n  \"stood\",\n  \"stop\",\n  \"stopped\",\n  \"store\",\n  \"storm\",\n  \"story\",\n  \"stove\",\n  \"straight\",\n  \"strange\",\n  \"stranger\",\n  \"straw\",\n  \"stream\",\n  \"street\",\n  \"strength\",\n  \"stretch\",\n  \"strike\",\n  \"string\",\n  \"strip\",\n  \"strong\",\n  \"stronger\",\n  \"struck\",\n  \"structure\",\n  \"struggle\",\n  \"stuck\",\n  \"student\",\n  \"studied\",\n  \"studying\",\n  \"subject\",\n  \"substance\",\n  \"success\",\n  \"successful\",\n  \"such\",\n  \"sudden\",\n  \"suddenly\",\n  \"sugar\",\n  \"suggest\",\n  \"suit\",\n  \"sum\",\n  \"summer\",\n  \"sun\",\n  \"sunlight\",\n  \"supper\",\n  \"supply\",\n  \"support\",\n  \"suppose\",\n  \"sure\",\n  \"surface\",\n  \"surprise\",\n  \"surrounded\",\n  \"swam\",\n  \"sweet\",\n  \"swept\",\n  \"swim\",\n  \"swimming\",\n  \"swing\",\n  \"swung\",\n  \"syllable\",\n  \"symbol\",\n  \"system\",\n  \"table\",\n  \"tail\",\n  \"take\",\n  \"taken\",\n  \"tales\",\n  \"talk\",\n  \"tall\",\n  \"tank\",\n  \"tape\",\n  \"task\",\n  \"taste\",\n  \"taught\",\n  \"tax\",\n  \"tea\",\n  \"teach\",\n  \"teacher\",\n  \"team\",\n  \"tears\",\n  \"teeth\",\n  \"telephone\",\n  \"television\",\n  \"tell\",\n  \"temperature\",\n  \"ten\",\n  \"tent\",\n  \"term\",\n  \"terrible\",\n  \"test\",\n  \"than\",\n  \"thank\",\n  \"that\",\n  \"thee\",\n  \"them\",\n  \"themselves\",\n  \"then\",\n  \"theory\",\n  \"there\",\n  \"therefore\",\n  \"these\",\n  \"they\",\n  \"thick\",\n  \"thin\",\n  \"thing\",\n  \"think\",\n  \"third\",\n  \"thirty\",\n  \"this\",\n  \"those\",\n  \"thou\",\n  \"though\",\n  \"thought\",\n  \"thousand\",\n  \"thread\",\n  \"three\",\n  \"threw\",\n  \"throat\",\n  \"through\",\n  \"throughout\",\n  \"throw\",\n  \"thrown\",\n  \"thumb\",\n  \"thus\",\n  \"thy\",\n  \"tide\",\n  \"tie\",\n  \"tight\",\n  \"tightly\",\n  \"till\",\n  \"time\",\n  \"tin\",\n  \"tiny\",\n  \"tip\",\n  \"tired\",\n  \"title\",\n  \"to\",\n  \"tobacco\",\n  \"today\",\n  \"together\",\n  \"told\",\n  \"tomorrow\",\n  \"tone\",\n  \"tongue\",\n  \"tonight\",\n  \"too\",\n  \"took\",\n  \"tool\",\n  \"top\",\n  \"topic\",\n  \"torn\",\n  \"total\",\n  \"touch\",\n  \"toward\",\n  \"tower\",\n  \"town\",\n  \"toy\",\n  \"trace\",\n  \"track\",\n  \"trade\",\n  \"traffic\",\n  \"trail\",\n  \"train\",\n  \"transportation\",\n  \"trap\",\n  \"travel\",\n  \"treated\",\n  \"tree\",\n  \"triangle\",\n  \"tribe\",\n  \"trick\",\n  \"tried\",\n  \"trip\",\n  \"troops\",\n  \"tropical\",\n  \"trouble\",\n  \"truck\",\n  \"trunk\",\n  \"truth\",\n  \"try\",\n  \"tube\",\n  \"tune\",\n  \"turn\",\n  \"twelve\",\n  \"twenty\",\n  \"twice\",\n  \"two\",\n  \"type\",\n  \"typical\",\n  \"uncle\",\n  \"under\",\n  \"underline\",\n  \"understanding\",\n  \"unhappy\",\n  \"union\",\n  \"unit\",\n  \"universe\",\n  \"unknown\",\n  \"unless\",\n  \"until\",\n  \"unusual\",\n  \"up\",\n  \"upon\",\n  \"upper\",\n  \"upward\",\n  \"us\",\n  \"use\",\n  \"useful\",\n  \"using\",\n  \"usual\",\n  \"usually\",\n  \"valley\",\n  \"valuable\",\n  \"value\",\n  \"vapor\",\n  \"variety\",\n  \"various\",\n  \"vast\",\n  \"vegetable\",\n  \"verb\",\n  \"vertical\",\n  \"very\",\n  \"vessels\",\n  \"victory\",\n  \"view\",\n  \"village\",\n  \"visit\",\n  \"visitor\",\n  \"voice\",\n  \"volume\",\n  \"vote\",\n  \"vowel\",\n  \"voyage\",\n  \"wagon\",\n  \"wait\",\n  \"walk\",\n  \"wall\",\n  \"want\",\n  \"war\",\n  \"warm\",\n  \"warn\",\n  \"was\",\n  \"wash\",\n  \"waste\",\n  \"watch\",\n  \"water\",\n  \"wave\",\n  \"way\",\n  \"we\",\n  \"weak\",\n  \"wealth\",\n  \"wear\",\n  \"weather\",\n  \"week\",\n  \"weigh\",\n  \"weight\",\n  \"welcome\",\n  \"well\",\n  \"went\",\n  \"were\",\n  \"west\",\n  \"western\",\n  \"wet\",\n  \"whale\",\n  \"what\",\n  \"whatever\",\n  \"wheat\",\n  \"wheel\",\n  \"when\",\n  \"whenever\",\n  \"where\",\n  \"wherever\",\n  \"whether\",\n  \"which\",\n  \"while\",\n  \"whispered\",\n  \"whistle\",\n  \"white\",\n  \"who\",\n  \"whole\",\n  \"whom\",\n  \"whose\",\n  \"why\",\n  \"wide\",\n  \"widely\",\n  \"wife\",\n  \"wild\",\n  \"will\",\n  \"willing\",\n  \"win\",\n  \"wind\",\n  \"window\",\n  \"wing\",\n  \"winter\",\n  \"wire\",\n  \"wise\",\n  \"wish\",\n  \"with\",\n  \"within\",\n  \"without\",\n  \"wolf\",\n  \"women\",\n  \"won\",\n  \"wonder\",\n  \"wonderful\",\n  \"wood\",\n  \"wooden\",\n  \"wool\",\n  \"word\",\n  \"wore\",\n  \"work\",\n  \"worker\",\n  \"world\",\n  \"worried\",\n  \"worry\",\n  \"worse\",\n  \"worth\",\n  \"would\",\n  \"wrapped\",\n  \"write\",\n  \"writer\",\n  \"writing\",\n  \"written\",\n  \"wrong\",\n  \"wrote\",\n  \"yard\",\n  \"year\",\n  \"yellow\",\n  \"yes\",\n  \"yesterday\",\n  \"yet\",\n  \"you\",\n  \"young\",\n  \"younger\",\n  \"your\",\n  \"yourself\",\n  \"youth\",\n  \"zero\",\n  \"zebra\",\n  \"zipper\",\n  \"zoo\",\n  \"zulu\",\n]\n\nconst shortestWordSize = words.reduce((shortestWord, currentWord) =>\n  currentWord.length < shortestWord.length ? currentWord : shortestWord\n).length\n\nconst longestWordSize = words.reduce((longestWord, currentWord) =>\n  currentWord.length > longestWord.length ? currentWord : longestWord\n).length\n\nexport function randomWords(\n  options: Readonly<{ amount: number; maxLength?: number; minLength?: number }>\n): readonly string[] {\n  const { amount, minLength, maxLength } = options\n\n  function word(): string | undefined {\n    let min = typeof minLength !== \"number\" ? shortestWordSize : limitWordSize(minLength)\n    const max = typeof maxLength !== \"number\" ? longestWordSize : limitWordSize(maxLength)\n\n    if (min > max) min = max\n\n    let rightSize = false\n    let wordUsed: string = \"\"\n    while (!rightSize) {\n      wordUsed = generateRandomWord()\n      rightSize = wordUsed.length <= max && wordUsed.length >= min\n    }\n\n    return wordUsed\n  }\n\n  function generateRandomWord(): string {\n    return words[randInt(words.length)] ?? \"apple-tree\"\n  }\n\n  // limits the size of words to the minimum and maximum possible\n  function limitWordSize(wordSize: number) {\n    if (wordSize < shortestWordSize) wordSize = shortestWordSize\n    if (wordSize > longestWordSize) wordSize = longestWordSize\n\n    return wordSize\n  }\n\n  function randInt(lessThan: number): number {\n    return Math.floor(Math.random() * lessThan)\n  }\n\n  const results: string[] = []\n  let token = \"\"\n\n  for (let i = 0; i < amount; i++) {\n    token += word()\n    results.push(token)\n    token = \"\"\n  }\n\n  return results\n}\n"
  },
  {
    "path": "desktop/src/lib/releases.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { client } from \"../client\"\nimport { Release } from \"../gen\"\nimport { QueryKeys } from \"../queryKeys\"\n\nexport function useReleases(): readonly Release[] | undefined {\n  const { data: releases } = useQuery({\n    queryKey: QueryKeys.RELEASES,\n    queryFn: async () => {\n      return (await client.fetchReleases()).unwrap()\n    },\n  })\n\n  return releases\n}\n"
  },
  {
    "path": "desktop/src/lib/result.ts",
    "content": "export class Err<TError extends Error> {\n  readonly ok = false\n  readonly err = true\n\n  constructor(public readonly val: TError) {}\n\n  public unwrap(): undefined {\n    throw new Error(this.val.message, { cause: this.val })\n  }\n}\n\nexport class Ok<T> {\n  readonly ok = true\n  readonly err = false\n\n  constructor(public readonly val: T) {}\n\n  public unwrap(): T {\n    return this.val\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type ResultError = Ok<undefined> | Err<Failed>\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type Result<T> = Ok<T> | Err<Failed>\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type ErrorType = string\n\nexport const ErrorTypeUnknown: ErrorType = \"\"\nexport const ErrorTypeCancelled: ErrorType = \"cancelled\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const MapErrorCode = (code: number): ErrorType => {\n  return ErrorTypeUnknown\n}\n\nexport class Return {\n  static Ok() {\n    return new Ok<undefined>(undefined)\n  }\n\n  static Value<TVal>(val: TVal) {\n    return new Ok<TVal>(val)\n  }\n\n  static Failed(message: string, reason: string = \"\", type: ErrorType = ErrorTypeUnknown) {\n    return new Err<Failed>(new Failed(message, type, reason))\n  }\n\n  static Error<TError extends Error>(val: TError): Err<TError> {\n    return new Err<TError>(val)\n  }\n}\n\nexport class Failed extends Error {\n  constructor(\n    public readonly message: string,\n    public readonly type: ErrorType = ErrorTypeUnknown,\n    public readonly reason: string = \"\"\n  ) {\n    super(message)\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/store.ts",
    "content": "import { LazyStore } from \"@tauri-apps/plugin-store\"\nimport { TUnsubscribeFn } from \"../types\"\nimport { EventManager } from \"./eventManager\"\nimport { exists } from \"./helpers\"\n\ntype TBaseStore = Record<string | number | symbol, unknown>\n\ntype TStore<T extends TBaseStore> = Readonly<{\n  set<TKey extends keyof T>(key: TKey, value: T[TKey]): Promise<void>\n  get<TKey extends keyof T>(key: TKey): Promise<T[TKey] | null>\n  remove<TKey extends keyof T>(key: TKey): Promise<void>\n  subscribe<TKey extends keyof T>(key: TKey, listener: (newValue: T[TKey]) => void): TUnsubscribeFn\n  clear(): Promise<void>\n}>\ntype TStorageBackend<T extends TBaseStore = TBaseStore> = Omit<TStore<T>, \"subscribe\">\n\nexport class Store<T extends TBaseStore> implements TStore<T> {\n  private eventManager = new EventManager<T>()\n  constructor(private backend: TStorageBackend<T>) {}\n\n  public async set<TKey extends keyof T>(key: TKey, value: T[TKey]): Promise<void> {\n    await this.backend.set(key, value)\n    this.eventManager.publish(key, value)\n  }\n\n  public async get<TKey extends keyof T>(key: TKey): Promise<T[TKey] | null> {\n    return this.backend.get(key)\n  }\n\n  public async remove<TKey extends keyof T>(key: TKey): Promise<void> {\n    return this.backend.remove(key)\n  }\n\n  public subscribe<TKey extends keyof T>(\n    key: TKey,\n    listener: (newValue: T[TKey]) => void\n  ): VoidFunction {\n    const handler = EventManager.toHandler(listener)\n\n    return this.eventManager.subscribe(key, handler)\n  }\n\n  public async clear(): Promise<void> {\n    return this.backend.clear()\n  }\n}\n\nexport class LocalStorageBackend<T extends TBaseStore> implements TStorageBackend<T> {\n  constructor(private storageKey: string) {}\n\n  private getKey(key: keyof TBaseStore): string {\n    return `devpod-${this.storageKey}-${key.toString()}`\n  }\n\n  public async set<TKey extends keyof T>(key: TKey, value: T[TKey]): Promise<void> {\n    try {\n      window.localStorage.setItem(this.getKey(key), JSON.stringify(value))\n    } catch {\n      // noop\n    }\n  }\n\n  public async get<TKey extends keyof T>(key: TKey): Promise<T[TKey] | null> {\n    try {\n      const maybeValue = window.localStorage.getItem(this.getKey(key))\n      if (!exists(maybeValue)) {\n        return null\n      }\n\n      return JSON.parse(maybeValue)\n    } catch {\n      return null\n    }\n  }\n\n  public async remove<TKey extends keyof T>(key: TKey): Promise<void> {\n    window.localStorage.removeItem(this.getKey(key))\n  }\n\n  public async clear(): Promise<void> {\n    window.localStorage.clear()\n  }\n}\n\nexport class FileStorageBackend<T extends TBaseStore> implements TStorageBackend<T> {\n  private readonly store: LazyStore\n\n  constructor(name: string) {\n    const fileName = `.${name}.json`\n    this.store = new LazyStore(fileName)\n  }\n\n  public async set<TKey extends keyof T>(key: TKey, value: T[TKey]): Promise<void> {\n    try {\n      await this.store.set(key.toString(), value)\n      await this.store.save()\n    } catch {\n      // noop\n    }\n  }\n\n  public async get<TKey extends keyof T>(key: TKey): Promise<T[TKey] | null> {\n    try {\n      const maybeValue = await this.store.get<T[TKey] | null>(key.toString())\n      if (!exists(maybeValue)) {\n        return null\n      }\n\n      return maybeValue\n    } catch {\n      return null\n    }\n  }\n\n  public async remove<TKey extends keyof T>(key: TKey): Promise<void> {\n    await this.store.delete(key.toString())\n    await this.store.save()\n  }\n\n  public async clear(): Promise<void> {\n    await this.store.clear()\n    await this.store.save()\n  }\n}\n\nexport class LocalStorageToFileMigrationBackend<T extends TBaseStore>\n  implements TStorageBackend<T>\n{\n  private lsBackend: LocalStorageBackend<T>\n  private fsBackend: FileStorageBackend<T>\n\n  constructor(private storageKey: string) {\n    this.lsBackend = new LocalStorageBackend<T>(this.storageKey)\n    this.fsBackend = new FileStorageBackend<T>(this.storageKey)\n  }\n\n  public async set<TKey extends keyof T>(key: TKey, value: T[TKey]): Promise<void> {\n    await this.fsBackend.set(key, value)\n    // don't wait for removal to confirm\n    try {\n      this.lsBackend.remove(key)\n    } catch {\n      // noop\n    }\n  }\n\n  public async get<TKey extends keyof T>(key: TKey): Promise<T[TKey] | null> {\n    const fsValue = await this.fsBackend.get(key)\n    if (exists(fsValue)) {\n      return fsValue\n    }\n\n    const lsValue = await this.lsBackend.get(key)\n    if (exists(lsValue)) {\n      await this.fsBackend.set(key, lsValue)\n\n      return lsValue\n    }\n\n    return null\n  }\n\n  public async remove<TKey extends keyof T>(key: TKey): Promise<void> {\n    await Promise.all([this.lsBackend.remove(key), this.fsBackend.remove(key)])\n  }\n\n  public async clear(): Promise<void> {\n    await Promise.all([this.lsBackend.clear(), this.fsBackend.clear()])\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/systemInfo.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { client, TArch, TPlatform } from \"../client\"\nimport { QueryKeys } from \"../queryKeys\"\n\nexport function usePlatform(): TPlatform | undefined {\n  const { data: platform } = useQuery({\n    queryKey: QueryKeys.PLATFORM,\n    queryFn: () => client.fetchPlatform(),\n  })\n\n  return platform\n}\n\nexport function useArch(): TArch | undefined {\n  const { data: arch } = useQuery({\n    queryKey: QueryKeys.ARCHITECTURE,\n    queryFn: () => client.fetchArch(),\n  })\n\n  return arch\n}\n\ntype TSystemTheme = Awaited<Exclude<ReturnType<typeof client.getSystemTheme>, null>>\nexport function useSystemTheme(): TSystemTheme | undefined {\n  const { data: systemTheme } = useQuery({\n    queryKey: QueryKeys.SYSTEM_THEME,\n    queryFn: async () => {\n      const t = await client.getSystemTheme()\n      if (t === null) {\n        throw new Error(\"System theme is not available\")\n      }\n\n      return t\n    },\n  })\n\n  return systemTheme\n}\n"
  },
  {
    "path": "desktop/src/lib/types.ts",
    "content": "export type TAction<\n  TType extends string,\n  TPayload extends unknown | undefined = undefined,\n> = TPayload extends undefined\n  ? Readonly<{\n      type: TType\n    }>\n  : {\n      type: TType\n      payload: TPayload\n    }\n\nconst PRO_INSTANCE_DETAILS = [\"logs\", \"configuration\"] as const\nexport type TProInstanceDetail = (typeof PRO_INSTANCE_DETAILS)[number]\n"
  },
  {
    "path": "desktop/src/lib/useDownloadLogs.ts",
    "content": "import { client } from \"@/client\"\nimport { TActionID } from \"@/contexts\"\nimport { useToast } from \"@chakra-ui/react\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport * as dialog from \"@tauri-apps/plugin-dialog\"\n\nexport function useDownloadLogs() {\n  const toast = useToast()\n  const { mutate, isLoading: isDownloading } = useMutation({\n    mutationFn: async ({ actionID }: { actionID: TActionID }) => {\n      const actionLogFile = (await client.workspaces.getActionLogFile(actionID)).unwrap()\n\n      if (actionLogFile === undefined) {\n        throw new Error(`Unable to retrieve file for action ${actionID}`)\n      }\n\n      const targetFile = await dialog.save({\n        title: \"Save Logs\",\n        filters: [{ name: \"format\", extensions: [\"log\", \"txt\"] }],\n      })\n\n      // user cancelled \"save file\" dialog\n      if (targetFile === null) {\n        return\n      }\n\n      await client.copyFile(actionLogFile, targetFile)\n      client.open(targetFile)\n    },\n    onError(error) {\n      toast({\n        title: `Failed to save logs: ${error}`,\n        status: \"error\",\n        isClosable: true,\n        duration: 30_000, // 30 sec\n      })\n    },\n  })\n\n  return { download: mutate, isDownloading }\n}\n"
  },
  {
    "path": "desktop/src/lib/useFormErrors.ts",
    "content": "import { useMemo } from \"react\"\nimport { FieldError, FieldValues, FormState } from \"react-hook-form\"\n\ntype TErr<TPrefix extends string> = `${TPrefix}Error`\ntype TFormErrors<T extends Record<string, unknown>> = {\n  [K in keyof T as TErr<K extends string ? K : never>]?: FieldError\n}\n\nexport function useFormErrors<TFormValues extends FieldValues>(\n  fieldNames: readonly (keyof TFormValues)[],\n  formState: FormState<TFormValues>\n): TFormErrors<TFormValues> {\n  return useMemo(() => {\n    return fieldNames.reduce<TFormErrors<TFormValues>>(\n      (acc, curr) => ({ ...acc, [`${String(curr)}Error`]: formState.errors[curr] }),\n      {}\n    )\n  }, [fieldNames, formState.errors])\n}\n"
  },
  {
    "path": "desktop/src/lib/useHover.ts",
    "content": "import { LegacyRef, useEffect, useRef, useState } from \"react\"\n\nexport function useHover<T extends HTMLButtonElement>(): [boolean, LegacyRef<T>] {\n  const [isHovering, setIsHovering] = useState<boolean>(false)\n\n  const ref = useRef<T>(null)\n\n  useEffect(\n    () => {\n      const handleMouseOver = () => setIsHovering(true)\n      const handleMouseOut = () => setIsHovering(false)\n\n      setTimeout(() => {\n        const node = ref.current\n        if (node) {\n          node.addEventListener(\"mouseover\", handleMouseOver)\n          node.addEventListener(\"mouseout\", handleMouseOut)\n\n          return () => {\n            node.removeEventListener(\"mouseover\", handleMouseOver)\n            node.removeEventListener(\"mouseout\", handleMouseOut)\n          }\n        }\n      })\n    },\n    // rerun if ref changes!\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [ref.current]\n  )\n\n  return [isHovering, ref]\n}\n"
  },
  {
    "path": "desktop/src/lib/useSelection.ts",
    "content": "import { useCallback, useMemo, useState } from \"react\"\n\nexport function useSelection<TIdType extends string | number = string>() {\n  const [selectedItems, setSelectedItems] = useState(new Set<TIdType>())\n\n  const toggleSelection = useCallback(\n    (id: TIdType) => {\n      setSelectedItems((curr) => {\n        const updated = new Set(curr)\n        if (updated.has(id)) {\n          updated.delete(id)\n        } else {\n          updated.add(id)\n        }\n\n        return updated\n      })\n    },\n    [setSelectedItems]\n  )\n\n  const toggleSelectAll = useCallback(\n    (allSet: TIdType[]) => {\n      setSelectedItems((curr) => {\n        if (curr.size === allSet.length) {\n          return new Set<TIdType>()\n        }\n\n        return new Set<TIdType>(allSet)\n      })\n    },\n    [setSelectedItems]\n  )\n\n  const setSelected = useCallback(\n    (id: TIdType, selected: boolean) => {\n      if (!selectedItems.has(id) && selected) {\n        const updated = new Set<TIdType>(selectedItems)\n        updated.add(id)\n        setSelectedItems(updated)\n      } else if (selectedItems.has(id) && !selected) {\n        const updated = new Set<TIdType>(selectedItems)\n        updated.delete(id)\n        setSelectedItems(updated)\n      }\n    },\n    [setSelectedItems, selectedItems]\n  )\n\n  // Will remove outdated selection items if they are no longer part of the entire set.\n  const prune = useCallback(\n    (allSet: TIdType[]) => {\n      const updated = new Set(selectedItems)\n\n      let changed = false\n\n      for (const id of selectedItems) {\n        if (!allSet.includes(id)) {\n          updated.delete(id)\n          changed = true\n        }\n      }\n\n      if (changed) {\n        setSelectedItems(updated)\n      }\n    },\n    [setSelectedItems, selectedItems]\n  )\n\n  const clear = useCallback(() => {\n    setSelectedItems(new Set<TIdType>())\n  }, [setSelectedItems])\n\n  const has = useCallback(\n    (id: TIdType) => {\n      return selectedItems.has(id)\n    },\n    [selectedItems]\n  )\n\n  return useMemo(\n    () => ({\n      toggleSelection,\n      toggleSelectAll,\n      size: selectedItems.size,\n      clear,\n      prune,\n      setSelected,\n      has,\n      selectedItems: {\n        val: selectedItems,\n        set: setSelectedItems,\n      },\n    }),\n    [\n      selectedItems,\n      setSelectedItems,\n      toggleSelection,\n      toggleSelectAll,\n      clear,\n      prune,\n      has,\n      setSelected,\n    ]\n  )\n}\n"
  },
  {
    "path": "desktop/src/lib/useSortWorkspaces.tsx",
    "content": "import { TWorkspace } from \"@/types\"\nimport { useMemo } from \"react\"\nimport { ProWorkspaceInstance } from \"@/contexts\"\nimport { getLastActivity } from \"@/lib/pro\"\n\nexport enum ESortWorkspaceMode {\n  RECENTLY_USED = \"Recently Used\",\n  LEAST_RECENTLY_USED = \"Least Recently Used\",\n  RECENTLY_CREATED = \"Recently Created\",\n  LEAST_RECENTLY_CREATED = \"Least Recently Created\",\n}\n\nexport const DEFAULT_SORT_WORKSPACE_MODE = ESortWorkspaceMode.RECENTLY_USED\n\ntype TSortable<TOriginal> = {\n  original: TOriginal\n  created: number\n  used: number\n}\n\nfunction sortWorkspaces<T>(\n  sortables: TSortable<T>[],\n  sortMode: ESortWorkspaceMode | undefined\n): T[] {\n  const copy = [...sortables]\n\n  copy.sort((a, b) => {\n    if (sortMode === ESortWorkspaceMode.RECENTLY_USED) {\n      return a.used > b.used ? -1 : 1\n    }\n\n    if (sortMode === ESortWorkspaceMode.LEAST_RECENTLY_USED) {\n      return b.used > a.used ? -1 : 1\n    }\n\n    if (sortMode === ESortWorkspaceMode.RECENTLY_CREATED) {\n      return a.created > b.created ? -1 : 1\n    }\n\n    if (sortMode === ESortWorkspaceMode.LEAST_RECENTLY_CREATED) {\n      return b.created > a.created ? -1 : 1\n    }\n\n    return 0\n  })\n\n  return copy.map((copy) => copy.original)\n}\n\nexport function useSortWorkspaces(\n  workspaces: readonly TWorkspace[] | undefined,\n  sortMode: ESortWorkspaceMode | undefined\n) {\n  return useMemo(() => {\n    if (!workspaces) {\n      return undefined\n    }\n\n    const sortables = workspaces.map((workspace) => ({\n      original: workspace,\n      created: new Date(workspace.creationTimestamp).getTime(),\n      used: new Date(workspace.lastUsed).getTime(),\n    }))\n\n    return sortWorkspaces(sortables, sortMode)\n  }, [workspaces, sortMode])\n}\n\nexport function useSortProWorkspaces(\n  workspaces: readonly ProWorkspaceInstance[] | undefined,\n  sortMode: ESortWorkspaceMode | undefined\n) {\n  return useMemo(() => {\n    if (!workspaces) {\n      return undefined\n    }\n\n    const sortables = workspaces.map((workspace) => ({\n      original: workspace,\n      created: new Date(workspace.metadata?.creationTimestamp ?? 0).getTime(),\n      used: getLastActivity(workspace)?.getTime() ?? 0,\n    }))\n\n    return sortWorkspaces(sortables, sortMode)\n  }, [workspaces, sortMode])\n}\n"
  },
  {
    "path": "desktop/src/lib/useStoreTroubleshoot.ts",
    "content": "import { client } from \"@/client\"\nimport { TActionObj } from \"@/contexts/DevPodContext/action\"\nimport { TWorkspace } from \"@/types\"\nimport { useToast } from \"@chakra-ui/react\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport { ProWorkspaceInstance } from \"@/contexts\"\nimport JSZip from \"jszip\"\n\nexport function useStoreTroubleshoot() {\n  const toast = useToast()\n  const { mutate, isLoading: isStoring } = useMutation({\n    mutationFn: async ({\n      workspace,\n      workspaceActions,\n    }: {\n      workspace: TWorkspace | ProWorkspaceInstance\n      workspaceActions: TActionObj[]\n    }) => {\n      const logFiles = await Promise.all(\n        workspaceActions.map((action) => client.workspaces.getActionLogFile(action.id))\n      )\n\n      const targetFolder = await client.selectFromDir(\"Save Troubleshooting Data\")\n\n      // user cancelled \"save file\" dialog\n      if (targetFolder === null) {\n        return\n      }\n\n      const unwrappedLogFiles: [src: [string], targetFolder: string][] = logFiles\n        .filter((f) => f.ok)\n        .map((f) => f.unwrap() ?? \"\")\n        .map((f) => [[f], f.split(client.pathSeparator()).pop() ?? \"\"])\n\n      const zip = new JSZip()\n\n      const logFilesData = (\n        await Promise.all(\n          unwrappedLogFiles.map(async ([src, target]) => {\n            try {\n              const data = await client.readFile(src)\n\n              return { fileName: target, data }\n            } catch {\n              // ignore missing log files and continue\n              return null\n            }\n          })\n        )\n      ).filter((d): d is Exclude<typeof d, null> => d != null)\n\n      logFilesData.forEach((logFile) => {\n        zip.file(logFile.fileName, logFile.data)\n      })\n\n      zip.file(\"workspace_actions.json\", JSON.stringify(workspaceActions, null, 2))\n      zip.file(\"workspace.json\", JSON.stringify(workspace, null, 2))\n\n      const troubleshootOutput = await client.workspaces.troubleshoot({\n        id: workspace.id,\n        actionID: \"\",\n        streamID: \"\",\n      })\n\n      if (troubleshootOutput.ok) {\n        zip.file(\"cli_troubleshoot.json\", troubleshootOutput.unwrap().stdout)\n      }\n\n      const out = await zip.generateAsync({ type: \"uint8array\" })\n\n      await client.writeFile([targetFolder, \"devpod_troubleshoot.zip\"], out)\n\n      client.open(targetFolder)\n    },\n    onError(error) {\n      toast({\n        title: `Failed to save zip: ${error}`,\n        status: \"error\",\n        isClosable: true,\n        duration: 30_000, // 30 sec\n      })\n    },\n  })\n\n  return { store: mutate, isStoring }\n}\n"
  },
  {
    "path": "desktop/src/lib/useUpdate.ts",
    "content": "import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useCallback, useState } from \"react\"\nimport { client } from \"../client\"\nimport { QueryKeys } from \"../queryKeys\"\n\nexport function useUpdate() {\n  const queryClient = useQueryClient()\n  const {\n    data: isUpdateAvailable,\n    refetch,\n    // Need to use `isFetching` as a workaround for interaction with `enabled: false`\n    isFetching: isChecking,\n  } = useQuery({\n    queryKey: QueryKeys.UPDATE_RELEASE,\n    queryFn: async () => (await client.checkUpdates()).unwrap(),\n    enabled: false,\n    onSettled: () => {\n      queryClient.resetQueries(QueryKeys.PENDING_UPDATE)\n    },\n  })\n\n  const { data: pendingUpdate } = useQuery({\n    queryKey: QueryKeys.PENDING_UPDATE,\n    queryFn: async () => (await client.fetchPendingUpdate()).unwrap(),\n    enabled: false,\n  })\n\n  const { mutate: installMutate, isLoading: isInstalling } = useMutation({\n    mutationKey: QueryKeys.INSTALL_UPDATE,\n    mutationFn: async () => (await client.installUpdate()).unwrap(),\n    onSettled: () => {\n      queryClient.resetQueries(QueryKeys.PENDING_UPDATE)\n    },\n  })\n\n  const [isInstallDisabled, setIsInstallDisabled] = useState(false)\n  const install = useCallback(() => {\n    if (isInstallDisabled) {\n      return\n    }\n\n    installMutate(undefined, {\n      onError: () => setIsInstallDisabled(false),\n      onSuccess: () => setIsInstallDisabled(true),\n    })\n  }, [installMutate, isInstallDisabled])\n\n  return {\n    check: refetch,\n    isUpdateAvailable,\n    isChecking,\n    pendingUpdate,\n    install,\n    isInstalling,\n    isInstallDisabled,\n  }\n}\n"
  },
  {
    "path": "desktop/src/lib/useVersion.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { client } from \"../client\"\nimport { QueryKeys } from \"../queryKeys\"\n\nexport function useVersion(): string | undefined {\n  const { data: version } = useQuery({\n    queryKey: QueryKeys.APP_VERSION,\n    queryFn: () => client.fetchVersion(),\n    cacheTime: Infinity,\n    staleTime: Infinity,\n  })\n\n  return version\n}\n"
  },
  {
    "path": "desktop/src/main.tsx",
    "content": "import { Logger, QueryClient, QueryClientProvider } from \"@tanstack/react-query\"\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\"\nimport dayjs from \"dayjs\"\nimport relativeTime from \"dayjs/plugin/relativeTime\"\nimport { StrictMode } from \"react\"\nimport ReactDOM from \"react-dom/client\"\nimport { Location, RouterProvider } from \"react-router\"\nimport \"@xterm/xterm/css/xterm.css\"\nimport { ThemeProvider } from \"./Theme\"\nimport { SettingsProvider } from \"./contexts\"\nimport { router } from \"./routes\"\nimport { client } from \"./client\"\nimport { ColorModeScript } from \"@chakra-ui/react\"\n\ndayjs.extend(relativeTime)\n\nconst logger: Logger | undefined = import.meta.env.PROD\n  ? {\n      log: () => {\n        // noop in prod\n      },\n      warn: (...args: any[]) => {\n        client.log(\"warn\", args.join(\" \"))\n      },\n      error: (...args: any[]) => {\n        client.log(\"error\", args.join(\" \"))\n      },\n    }\n  : undefined\nconst queryClient = new QueryClient({ logger })\n\nlet render = true\nconst l = localStorage.getItem(\"devpod-location-current\") // check usePreserveLocation before changing this\nif (l) {\n  const loc = JSON.parse(l) as Location\n  if (window.location.pathname !== loc.pathname) {\n    window.location.href = loc.pathname + loc.search\n    render = false\n  }\n}\n\nif (render) {\n  ReactDOM.createRoot(document.getElementById(\"root\") as HTMLElement).render(<Root />)\n}\n// force chakra to determine color mode on startup\nlocalStorage.removeItem(\"chakra-ui-color-mode\")\n\nfunction Root() {\n  return (\n    <StrictMode>\n      <SettingsProvider>\n        <ColorModeScript initialColorMode={\"system\"} />\n        <ThemeProvider>\n          <QueryClientProvider client={queryClient}>\n            <RouterProvider router={router} />\n            {/* Will be disabled in production automatically */}\n            <ReactQueryDevtools\n              position=\"bottom-right\"\n              toggleButtonProps={{ style: { margin: \"0.5em 0.5em 2rem\" } }}\n            />\n          </QueryClientProvider>\n        </ThemeProvider>\n      </SettingsProvider>\n    </StrictMode>\n  )\n}\n"
  },
  {
    "path": "desktop/src/queryKeys.ts",
    "content": "import { TProInstances, TProviderID, TWorkspaceID } from \"./types\"\n\nexport const QueryKeys = {\n  PLATFORM: [\"platform\"],\n  ARCHITECTURE: [\"architecture\"],\n  SYSTEM_THEME: [\"systemTheme\"],\n  WORKSPACES: [\"workspaces\"],\n  PROVIDERS: [\"providers\"],\n  PROVIDERS_CHECK_UPDATE_ALL: [\"providers\", \"update\", \"all\"],\n  IDES: [\"ides\"],\n  COMMUNITY_CONTRIBUTIONS: [\"communityContributions\"],\n  CONTEXT_OPTIONS: [\"contextOptions\"],\n  RELEASES: [\"releases\"],\n  APP_VERSION: [\"appVersion\"],\n  UPDATE_RELEASE: [\"updateRelease\"],\n  PENDING_UPDATE: [\"pendingUpdate\"],\n  INSTALL_UPDATE: [\"installUpdate\"],\n  PRO_INSTANCES: [\"proInstances\"],\n  workspace(id: TWorkspaceID): string[] {\n    return [...QueryKeys.WORKSPACES, id]\n  },\n  workspaceStatus(id: TWorkspaceID): string[] {\n    return [...QueryKeys.WORKSPACES, id, \"status\"]\n  },\n  provider(id: TProviderID): string[] {\n    return [...QueryKeys.PROVIDERS, id]\n  },\n  IS_CLI_INSTALLED: [\"isCliInstalled\"],\n  providerOptions(id: TProviderID): string[] {\n    return [...QueryKeys.provider(id), \"options\"]\n  },\n  providerSetOptions(id: TProviderID): string[] {\n    return [...QueryKeys.provider(id), \"set-options\"]\n  },\n  providerUpdate(id: TProviderID): string[] {\n    return [...QueryKeys.provider(id), \"update\"]\n  },\n  proWorkspaceTemplates(host: string, project: string): string[] {\n    return [\"workspaceTemplates\", host, project]\n  },\n  proClusters(host: string, project: string): string[] {\n    return [\"clusters\", host, project]\n  },\n  connectionStatus(host: string): string[] {\n    return [\"connectionStatus\", host]\n  },\n  versionInfo(host: string): string[] {\n    return [\"versionInfo\", host]\n  },\n  proProviderUpdates(proInstances: TProInstances | undefined) {\n    return [\"check-pro-provider-updates\", proInstances]\n  },\n  userProfile(name: string | undefined) {\n    return [\"user-profile\", name]\n  },\n}\n\nexport const MutationKeys = {\n  CREATE_WORKSPACE: [\"createWorkspace\"],\n  START_WORKSPACE: [\"startWorkspace\"],\n  STOP_WORKSPACE: [\"stopWorkspace\"],\n  REBUILD_WORKSPACE: [\"rebuildWorkspace\"],\n  REMOVE_WORKSPACE: [\"removeWorkspace\"],\n} as const\n"
  },
  {
    "path": "desktop/src/routes.tsx",
    "content": "import { Params, Path, createBrowserRouter } from \"react-router-dom\"\nimport { App, ErrorPage } from \"./App\"\nimport { ProRoot } from \"./ProRoot\"\nimport { TActionID } from \"./contexts\"\nimport { TProInstanceDetail, exists } from \"./lib\"\nimport { TProviderID, TSupportedIDE, TWorkspaceID } from \"./types\"\nimport { Actions, Pro, Providers, Settings, Workspaces } from \"./views\"\n\nexport const Routes = {\n  ROOT: \"/\",\n  SETTINGS: \"/settings\",\n  WORKSPACES: \"/workspaces\",\n  ACTIONS: \"/actions\",\n  get ACTION(): string {\n    return `${Routes.ACTIONS}/:action`\n  },\n  get WORKSPACE_CREATE(): string {\n    return `${Routes.WORKSPACES}/new`\n  },\n  toWorkspaceCreate(\n    options: Readonly<{\n      workspaceID: TWorkspaceID | null\n      providerID: TProviderID | null\n      ide: string | null\n      rawSource: string | null\n    }>\n  ): Partial<Path> {\n    const searchParams = new URLSearchParams()\n    for (const [key, value] of Object.entries(options)) {\n      if (exists(value)) {\n        searchParams.set(key, value)\n      }\n    }\n\n    return {\n      pathname: Routes.WORKSPACE_CREATE,\n      search: searchParams.toString(),\n    }\n  },\n  toAction(actionID: TActionID, onSuccess?: string): string {\n    if (onSuccess) {\n      return `${Routes.ACTIONS}/${actionID}?onSuccess=${encodeURIComponent(onSuccess)}`\n    }\n\n    return `${Routes.ACTIONS}/${actionID}`\n  },\n  getActionID(params: Params<string>): string | undefined {\n    // Needs to match `:action` from detail route exactly!\n    return params[\"action\"]\n  },\n  getWorkspaceCreateParamsFromSearchParams(searchParams: URLSearchParams): Partial<\n    Readonly<{\n      workspaceID: TWorkspaceID\n      providerID: TProviderID\n      ide: TSupportedIDE\n      rawSource: string\n    }>\n  > {\n    return {\n      workspaceID: searchParams.get(\"workspaceID\") ?? undefined,\n      providerID: searchParams.get(\"providerID\") ?? undefined,\n      ide: (searchParams.get(\"ide\") as TSupportedIDE | null) ?? undefined,\n      rawSource: searchParams.get(\"rawSource\") ?? undefined,\n    }\n  },\n  PROVIDERS: \"/providers\",\n  get PROVIDER(): string {\n    return `${Routes.PROVIDERS}/:provider`\n  },\n  toProvider(providerID: string): string {\n    return `${Routes.PROVIDERS}/${providerID}`\n  },\n  getProviderId(params: Params<string>): string | undefined {\n    // Needs to match `:provider` from detail route exactly!\n    return params[\"provider\"]\n  },\n  PRO: \"/pro\",\n  PRO_INSTANCE: \"/pro/:host\",\n  PRO_WORKSPACE: \"/pro/:host/:workspace\",\n  PRO_WORKSPACE_SELECT_PRESET: \"/pro/:host/select-preset\",\n  PRO_WORKSPACE_CREATE: \"/pro/:host/new\",\n  PRO_SETTINGS: \"/pro/:host/user/settings\",\n  PRO_CREDENTIALS: \"/pro/:host/user/credentials\",\n  PRO_PROFILE: \"/pro/:host/user/profile\",\n  toProInstance(host: string): string {\n    return `/pro/${host}`\n  },\n  toProWorkspace(host: string, instanceID: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/${instanceID}`\n  },\n  toProWorkspaceCreate(host: string, fromPreset?: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/new${fromPreset ? `?fromPreset=${fromPreset}` : \"\"}`\n  },\n  toProSelectPreset(host: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/select-preset`\n  },\n  toProWorkspaceDetail(host: string, instanceID: string, detail: TProInstanceDetail): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/${instanceID}?tab=${detail}`\n  },\n  toProSettings(host: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/user/settings`\n  },\n  toProCredentials(host: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/user/credentials`\n  },\n  toProProfile(host: string): string {\n    const base = this.toProInstance(host)\n\n    return `${base}/user/profile`\n  },\n  getProWorkspaceDetailsParams(\n    searchParams: URLSearchParams\n  ): Partial<Readonly<{ tab: TProInstanceDetail | null }>> {\n    return { tab: searchParams.get(\"tab\") as TProInstanceDetail | null }\n  },\n} as const\n\nexport const router = createBrowserRouter([\n  {\n    path: Routes.ROOT,\n    element: <App />,\n    errorElement: <ErrorPage />,\n    children: [\n      {\n        path: Routes.PRO,\n        element: <ProRoot />,\n        children: [\n          {\n            path: Routes.PRO_INSTANCE,\n            element: <Pro.ProInstance />,\n            children: [\n              {\n                index: true,\n                element: <Pro.ListWorkspaces />,\n              },\n              {\n                path: Routes.PRO_WORKSPACE,\n                element: <Pro.Workspace />,\n              },\n              {\n                path: Routes.PRO_WORKSPACE_CREATE,\n                element: <Pro.CreateWorkspace />,\n              },\n              {\n                path: Routes.PRO_WORKSPACE_SELECT_PRESET,\n                element: <Pro.SelectPreset />,\n              },\n              { path: Routes.PRO_SETTINGS, element: <Pro.Settings /> },\n              { path: Routes.PRO_CREDENTIALS, element: <Pro.Credentials /> },\n              { path: Routes.PRO_PROFILE, element: <Pro.Profile /> },\n            ],\n          },\n        ],\n      },\n      {\n        path: Routes.WORKSPACES,\n        element: <Workspaces.Workspaces />,\n        children: [\n          {\n            index: true,\n            element: <Workspaces.ListWorkspaces />,\n          },\n          {\n            path: Routes.WORKSPACE_CREATE,\n            element: <Workspaces.CreateWorkspace />,\n          },\n        ],\n      },\n      {\n        path: Routes.PROVIDERS,\n        element: <Providers.Providers />,\n        children: [\n          { index: true, element: <Providers.ListProviders /> },\n          {\n            path: Routes.PROVIDER,\n            element: <Providers.Provider />,\n          },\n        ],\n      },\n      {\n        path: Routes.ACTIONS,\n        element: <Actions.Actions />,\n        children: [{ path: Routes.ACTION, element: <Actions.Action /> }],\n      },\n      { path: Routes.SETTINGS, element: <Settings.Settings /> },\n    ],\n  },\n])\n"
  },
  {
    "path": "desktop/src/runner.ts",
    "content": "import { V1Affinity } from \"@loft-enterprise/client/gen/models/V1Affinity\"\nimport { V1Container } from \"@loft-enterprise/client/gen/models/V1Container\"\nimport { V1EnvFromSource } from \"@loft-enterprise/client/gen/models/V1EnvFromSource\"\nimport { V1EnvVar } from \"@loft-enterprise/client/gen/models/V1EnvVar\"\nimport { V1HostAlias } from \"@loft-enterprise/client/gen/models/V1HostAlias\"\nimport { V1ObjectMeta } from \"@loft-enterprise/client/gen/models/V1ObjectMeta\"\nimport { V1ResourceRequirements } from \"@loft-enterprise/client/gen/models/V1ResourceRequirements\"\nimport { V1Toleration } from \"@loft-enterprise/client/gen/models/V1Toleration\"\nimport { V1Volume } from \"@loft-enterprise/client/gen/models/V1Volume\"\nimport { V1VolumeMount } from \"@loft-enterprise/client/gen/models/V1VolumeMount\"\nimport { StorageV1Condition } from \"@loft-enterprise/client/gen/models/agentstorageV1Condition\"\nimport { StorageV1Access } from \"@loft-enterprise/client/gen/models/storageV1Access\"\nimport { StorageV1TemplateMetadata } from \"@loft-enterprise/client/gen/models/storageV1TemplateMetadata\"\nimport { StorageV1UserOrTeam } from \"@loft-enterprise/client/gen/models/storageV1UserOrTeam\"\n\n/**\n * Runner holds the Runner information\n */\nexport class ManagementV1Runner {\n  /**\n   * 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\n   */\n  \"apiVersion\"?: string\n  /**\n   * 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\n   */\n  \"kind\"?: string\n  \"metadata\"?: V1ObjectMeta\n  \"spec\"?: ManagementV1RunnerSpec\n  \"status\"?: ManagementV1RunnerStatus\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"apiVersion\",\n      baseName: \"apiVersion\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"kind\",\n      baseName: \"kind\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"metadata\",\n      baseName: \"metadata\",\n      type: \"V1ObjectMeta\",\n      format: \"\",\n    },\n    {\n      name: \"spec\",\n      baseName: \"spec\",\n      type: \"ManagementV1RunnerSpec\",\n      format: \"\",\n    },\n    {\n      name: \"status\",\n      baseName: \"status\",\n      type: \"ManagementV1RunnerStatus\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return ManagementV1Runner.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\n/**\n * RunnerSpec holds the specification\n */\nexport class ManagementV1RunnerSpec {\n  /**\n   * Access holds the access rights for users and teams\n   */\n  \"access\"?: Array<StorageV1Access>\n  \"clusterRef\"?: StorageV1RunnerClusterRef\n  /**\n   * Description describes a cluster access object\n   */\n  \"description\"?: string\n  /**\n   * The display name shown in the UI\n   */\n  \"displayName\"?: string\n  /**\n   * Endpoint is the hostname used to connect directly to the runner\n   */\n  \"endpoint\"?: string\n  /**\n   * NetworkPeerName is the network peer name used to connect directly to the runner\n   */\n  \"networkPeerName\"?: string\n  \"owner\"?: StorageV1UserOrTeam\n  /**\n   * If unusable is true, no DevPod workspaces can be scheduled on this runner.\n   */\n  \"unusable\"?: boolean\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"access\",\n      baseName: \"access\",\n      type: \"Array<StorageV1Access>\",\n      format: \"\",\n    },\n    {\n      name: \"clusterRef\",\n      baseName: \"clusterRef\",\n      type: \"StorageV1RunnerClusterRef\",\n      format: \"\",\n    },\n    {\n      name: \"description\",\n      baseName: \"description\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"displayName\",\n      baseName: \"displayName\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"endpoint\",\n      baseName: \"endpoint\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"networkPeerName\",\n      baseName: \"networkPeerName\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"owner\",\n      baseName: \"owner\",\n      type: \"StorageV1UserOrTeam\",\n      format: \"\",\n    },\n    {\n      name: \"unusable\",\n      baseName: \"unusable\",\n      type: \"boolean\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return ManagementV1RunnerSpec.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\n/**\n * RunnerStatus holds the status\n */\nexport class ManagementV1RunnerStatus {\n  /**\n   * Conditions holds several conditions the virtual cluster might be in\n   */\n  \"conditions\"?: Array<StorageV1Condition>\n  /**\n   * Message describes the reason in human-readable form\n   */\n  \"message\"?: string\n  /**\n   * Phase describes the current phase the space instance is in\n   */\n  \"phase\"?: string\n  /**\n   * Reason describes the reason in machine-readable form\n   */\n  \"reason\"?: string\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"conditions\",\n      baseName: \"conditions\",\n      type: \"Array<StorageV1Condition>\",\n      format: \"\",\n    },\n    {\n      name: \"message\",\n      baseName: \"message\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"phase\",\n      baseName: \"phase\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"reason\",\n      baseName: \"reason\",\n      type: \"string\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return ManagementV1RunnerStatus.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerClusterRef {\n  /**\n   * Cluster is the connected cluster the space will be created in\n   */\n  \"cluster\"?: string\n  /**\n   * Namespace is the namespace inside the connected cluster holding the space\n   */\n  \"namespace\"?: string\n  \"persistentVolumeClaimTemplate\"?: StorageV1RunnerPersistentVolumeClaimTemplate\n  \"podTemplate\"?: StorageV1RunnerPodTemplate\n  \"serviceTemplate\"?: StorageV1RunnerServiceTemplate\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"cluster\",\n      baseName: \"cluster\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"namespace\",\n      baseName: \"namespace\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"persistentVolumeClaimTemplate\",\n      baseName: \"persistentVolumeClaimTemplate\",\n      type: \"StorageV1RunnerPersistentVolumeClaimTemplate\",\n      format: \"\",\n    },\n    {\n      name: \"podTemplate\",\n      baseName: \"podTemplate\",\n      type: \"StorageV1RunnerPodTemplate\",\n      format: \"\",\n    },\n    {\n      name: \"serviceTemplate\",\n      baseName: \"serviceTemplate\",\n      type: \"StorageV1RunnerServiceTemplate\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerClusterRef.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerPodTemplate {\n  \"metadata\"?: StorageV1TemplateMetadata\n  \"spec\"?: StorageV1RunnerPodTemplateSpec\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"metadata\",\n      baseName: \"metadata\",\n      type: \"StorageV1TemplateMetadata\",\n      format: \"\",\n    },\n    {\n      name: \"spec\",\n      baseName: \"spec\",\n      type: \"StorageV1RunnerPodTemplateSpec\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerPodTemplate.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerPersistentVolumeClaimTemplateSpec {\n  /**\n   * accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1\n   */\n  \"accessModes\"?: Array<StorageV1RunnerPersistentVolumeClaimTemplateSpecAccessModesEnum>\n  /**\n   * storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1\n   */\n  \"storageClassName\"?: string\n  /**\n   * storageSize is the size of the storage to reserve for the pvc\n   */\n  \"storageSize\"?: string\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"accessModes\",\n      baseName: \"accessModes\",\n      type: \"Array<StorageV1RunnerPersistentVolumeClaimTemplateSpecAccessModesEnum>\",\n      format: \"\",\n    },\n    {\n      name: \"storageClassName\",\n      baseName: \"storageClassName\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"storageSize\",\n      baseName: \"storageSize\",\n      type: \"string\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerPersistentVolumeClaimTemplateSpec.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport enum StorageV1RunnerPersistentVolumeClaimTemplateSpecAccessModesEnum {\n  ReadOnlyMany = \"ReadOnlyMany\",\n  ReadWriteMany = \"ReadWriteMany\",\n  ReadWriteOnce = \"ReadWriteOnce\",\n  ReadWriteOncePod = \"ReadWriteOncePod\",\n}\n\nexport class StorageV1RunnerPodTemplateSpec {\n  \"affinity\"?: V1Affinity\n  /**\n   * List of environment variables to set in the container. Cannot be updated.\n   */\n  \"env\"?: Array<V1EnvVar>\n  /**\n   * List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.\n   */\n  \"envFrom\"?: Array<V1EnvFromSource>\n  /**\n   * Set host aliases for the Runner Pod\n   */\n  \"hostAliases\"?: Array<V1HostAlias>\n  /**\n   * Runner pod image to use other than default\n   */\n  \"image\"?: string\n  /**\n   * Set up Init Containers for the Runner\n   */\n  \"initContainers\"?: Array<V1Container>\n  /**\n   * Set the NodeSelector for the Runner Pod\n   */\n  \"nodeSelector\"?: { [key: string]: string }\n  \"resource\"?: V1ResourceRequirements\n  /**\n   * Set the Tolerations for the Runner Pod\n   */\n  \"tolerations\"?: Array<V1Toleration>\n  /**\n   * Set Volume Mounts for the Runner Pod\n   */\n  \"volumeMounts\"?: Array<V1VolumeMount>\n  /**\n   * Set Volumes for the Runner Pod\n   */\n  \"volumes\"?: Array<V1Volume>\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"affinity\",\n      baseName: \"affinity\",\n      type: \"V1Affinity\",\n      format: \"\",\n    },\n    {\n      name: \"env\",\n      baseName: \"env\",\n      type: \"Array<V1EnvVar>\",\n      format: \"\",\n    },\n    {\n      name: \"envFrom\",\n      baseName: \"envFrom\",\n      type: \"Array<V1EnvFromSource>\",\n      format: \"\",\n    },\n    {\n      name: \"hostAliases\",\n      baseName: \"hostAliases\",\n      type: \"Array<V1HostAlias>\",\n      format: \"\",\n    },\n    {\n      name: \"image\",\n      baseName: \"image\",\n      type: \"string\",\n      format: \"\",\n    },\n    {\n      name: \"initContainers\",\n      baseName: \"initContainers\",\n      type: \"Array<V1Container>\",\n      format: \"\",\n    },\n    {\n      name: \"nodeSelector\",\n      baseName: \"nodeSelector\",\n      type: \"{ [key: string]: string; }\",\n      format: \"\",\n    },\n    {\n      name: \"resource\",\n      baseName: \"resource\",\n      type: \"V1ResourceRequirements\",\n      format: \"\",\n    },\n    {\n      name: \"tolerations\",\n      baseName: \"tolerations\",\n      type: \"Array<V1Toleration>\",\n      format: \"\",\n    },\n    {\n      name: \"volumeMounts\",\n      baseName: \"volumeMounts\",\n      type: \"Array<V1VolumeMount>\",\n      format: \"\",\n    },\n    {\n      name: \"volumes\",\n      baseName: \"volumes\",\n      type: \"Array<V1Volume>\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerPodTemplateSpec.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerPersistentVolumeClaimTemplate {\n  \"metadata\"?: StorageV1TemplateMetadata\n  \"spec\"?: StorageV1RunnerPersistentVolumeClaimTemplateSpec\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"metadata\",\n      baseName: \"metadata\",\n      type: \"StorageV1TemplateMetadata\",\n      format: \"\",\n    },\n    {\n      name: \"spec\",\n      baseName: \"spec\",\n      type: \"StorageV1RunnerPersistentVolumeClaimTemplateSpec\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerPersistentVolumeClaimTemplate.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerServiceTemplate {\n  \"metadata\"?: StorageV1TemplateMetadata\n  \"spec\"?: StorageV1RunnerServiceTemplateSpec\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"metadata\",\n      baseName: \"metadata\",\n      type: \"StorageV1TemplateMetadata\",\n      format: \"\",\n    },\n    {\n      name: \"spec\",\n      baseName: \"spec\",\n      type: \"StorageV1RunnerServiceTemplateSpec\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerServiceTemplate.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport class StorageV1RunnerServiceTemplateSpec {\n  /**\n   * type determines how the Service is exposed. Defaults to ClusterIP  Possible enum values:  - `\\\"ClusterIP\\\"` means a service will only be accessible inside the cluster, via the cluster IP.  - `\\\"ExternalName\\\"` means a service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved.  - `\\\"LoadBalancer\\\"` means a service will be exposed via an external load balancer (if the cloud provider supports it), in addition to \\'NodePort\\' type.  - `\\\"NodePort\\\"` means a service will be exposed on one port of every node, in addition to \\'ClusterIP\\' type.\n   */\n  \"type\"?: StorageV1RunnerServiceTemplateSpecTypeEnum\n\n  static readonly discriminator: string | undefined = undefined\n\n  static readonly attributeTypeMap: Array<{\n    name: string\n    baseName: string\n    type: string\n    format: string\n  }> = [\n    {\n      name: \"type\",\n      baseName: \"type\",\n      type: \"StorageV1RunnerServiceTemplateSpecTypeEnum\",\n      format: \"\",\n    },\n  ]\n\n  static getAttributeTypeMap() {\n    return StorageV1RunnerServiceTemplateSpec.attributeTypeMap\n  }\n\n  public constructor() {}\n}\n\nexport enum StorageV1RunnerServiceTemplateSpecTypeEnum {\n  ClusterIp = \"ClusterIP\",\n  ExternalName = \"ExternalName\",\n  LoadBalancer = \"LoadBalancer\",\n  NodePort = \"NodePort\",\n}\n"
  },
  {
    "path": "desktop/src/types.ts",
    "content": "import { UseMutationResult } from \"@tanstack/react-query\"\nimport { TStreamEventListenerFn } from \"./client\"\n\ntype TMaybe<T> = T | null | undefined\nexport type TUnsubscribeFn = VoidFunction\nexport type TComparable<T> = Readonly<{ eq(b: T): boolean }>\nexport type TIdentifiable = Readonly<{ id: string }>\nexport type TStreamID = string\nexport type TDeepNonNullable<T> = {\n  [K in keyof T]-?: T[K] extends object ? TDeepNonNullable<T[K]> : Required<NonNullable<T[K]>>\n}\n\n//#region Shared\nexport type TLogOutput = Readonly<{ time: Date; message?: string; level: string }>\nexport type TQueryResult<TData extends Readonly<object>> = [\n  TData | undefined,\n  Pick<UseMutationResult, \"status\" | \"error\">,\n]\nexport type TRunnable<TRunConfig> = Readonly<{ run(config: TRunConfig): void }>\n//#endregion\n\n//#region IDE\nexport type TIDEs = readonly TIDE[]\nexport type TIDE = Readonly<{\n  name: TMaybe<string>\n  displayName: string\n  default: TMaybe<boolean>\n  icon: TMaybe<string>\n  iconDark: TMaybe<string>\n  experimental: TMaybe<boolean>\n  group: TMaybe<\"Primary\" | \"JetBrains\" | \"Other\">\n}>\n//#endregion\n\n//#region Provider\nexport type TProviderID = string\nexport type TOptionID = string\nexport type TWithProviderID = Readonly<{ providerID: TProviderID }>\nexport type TProviders = Record<TProviderID, TProvider>\nexport type TProvider = Readonly<{\n  config: TMaybe<TProviderConfig>\n  default: TMaybe<boolean>\n  state: TMaybe<\n    Readonly<{\n      initialized: TMaybe<boolean>\n      singleMachine: TMaybe<boolean>\n      creationTimestamp: TMaybe<string>\n      options: TMaybe<TProviderOptions>\n    }>\n  >\n}> & {\n  isProxyProvider: boolean\n}\nexport type TNamedProvider = TProvider & Readonly<{ name: string }>\nexport type TProviderConfig = Readonly<{\n  name: TMaybe<string>\n  version: TMaybe<string>\n  source: TMaybe<TProviderSource>\n  description: TMaybe<string>\n  optionGroups: TProviderOptionGroup[]\n  options: TProviderOptions\n  icon: TMaybe<string>\n  home: TMaybe<string>\n  exec:\n    | TMaybe<Record<string, readonly string[]> & { proxy: never; daemon: never }>\n    | TMaybe<{ proxy: TMaybe<Record<string, readonly string[]>>; daemon: never }>\n    | TMaybe<{ daemon: TMaybe<Record<string, readonly string[]>>; proxy: never }>\n}>\nexport type TProviderOptionGroup = Readonly<{\n  name: TMaybe<string>\n  options: TMaybe<string[]>\n  defaultVisible: TMaybe<boolean>\n}>\nexport type TProviderSource = Readonly<{\n  internal: TMaybe<boolean>\n  github: TMaybe<string>\n  file: TMaybe<string>\n  url: TMaybe<string>\n  raw: TMaybe<string>\n}>\nexport type TProviderOptions = Record<string, TProviderOption>\nexport type TProviderOption = Readonly<{\n  // Value is the options current value\n  value: TMaybe<string>\n  // Children are the children generated by this option\n  children: TMaybe<string[]>\n  // If value is a password\n  password: TMaybe<boolean>\n  // DisplayName of the option, preferred over the option name by a supporting tool.\n  displayName: TMaybe<string>\n  // A description of the option displayed to the user by a supporting tool.\n  description: TMaybe<string>\n  // If required is true and the user doesn't supply a value, devpod will ask the user\n  required: TMaybe<boolean>\n  // Allowed values for this option.\n  enum: TMaybe<TOptionEnum[]>\n  // Suggestions are suggestions to show in the DevPod UI for this option\n  suggestions: TMaybe<string[]>\n  // Hidden specifies if the option should be hidden\n  hidden: TMaybe<boolean>\n  // Local means the variable is not resolved immediately and instead later when the workspace / machine was created.\n  local: TMaybe<boolean>\n  // Default value if the user omits this option from their configuration.\n  default: TMaybe<string>\n  // Command is the command to run to specify an option\n  command: TMaybe<string>\n  // SubOptionsCommand is the command to retrieve sub options\n  subOptionsCommand: TMaybe<string>\n  // Type is the provider option type. Can be one of: string, multiline, duration, number or boolean. Defaults to string\n  type: TMaybe<\"string\" | \"duration\" | \"number\" | \"boolean\" | \"multiline\">\n  // Mutable specifies if an option can be changed on the workspace or machine after creating it\n  mutable: TMaybe<boolean>\n}>\nexport type TOptionEnum = Readonly<{\n  value: TMaybe<string>\n  displayName: TMaybe<string>\n}>\n\nexport type TAddProviderConfig = Readonly<{\n  name?: TProviderConfig[\"name\"]\n}>\nexport type TConfigureProviderConfig = Readonly<{\n  options: Record<string, string>\n  useAsDefaultProvider?: boolean\n  reuseMachine?: boolean\n  reconfigure?: boolean\n}>\nexport type TProviderManager = Readonly<{\n  remove: TRunnable<TWithProviderID> &\n    Pick<UseMutationResult, \"status\" | \"error\"> & { target: TWithProviderID | undefined }\n}>\nexport type TCheckProviderUpdateResult = Readonly<{\n  updateAvailable: boolean\n  latestVersion?: string\n}>\n\n//#endregion\n\n//#region Workspace\nexport type TWorkspaceID = NonNullable<TWorkspace[\"id\"]>\nexport type TWithWorkspaceID = Readonly<{ workspaceID: TWorkspaceID }>\nexport type TWorkspace = Readonly<{\n  id: string\n  uid: string\n  picture: TMaybe<string>\n  machine: TMaybe<Readonly<{ machineId: TMaybe<string> }>>\n  provider: TMaybe<Readonly<{ name: TMaybe<string>; options: TMaybe<TProviderOptions> }>>\n  status: TMaybe<\"Running\" | \"Busy\" | \"Stopped\" | \"NotFound\">\n  ide: TMaybe<{\n    name: TMaybe<string>\n  }>\n  creationTimestamp: string\n  lastUsed: string\n  source: TMaybe<TWorkspaceSource>\n}>\nexport type TWorkspaceWithoutStatus = Omit<TWorkspace, \"status\"> & Readonly<{ status: null }>\nexport type TWorkspaceStatusResult = Readonly<{\n  id: TMaybe<string>\n  context: TMaybe<string>\n  provider: TMaybe<string>\n  state: TMaybe<TWorkspace[\"status\"]>\n}>\nexport type TWorkspaceSourceType = \"local\" | \"git\" | \"image\"\nexport type TWorkspaceStartConfig = Readonly<{\n  id: string\n  prebuildRepositories?: string[]\n  devcontainerPath?: string\n  ideConfig?: TWorkspace[\"ide\"]\n  providerConfig?: Readonly<{ providerID?: TProviderID; options?: Record<string, string> }>\n  // Instead of starting a workspace just by ID, the sourceConfig starts it with a `source/ID` combination\n  sourceConfig?: Readonly<{\n    source: string\n    type?: TWorkspaceSourceType\n  }>\n}>\nexport type TWorkspaceSource = {\n  gitRepository: TMaybe<string>\n  gitBranch: TMaybe<string>\n  gitCommit: TMaybe<string>\n  gitPRReference: TMaybe<string>\n  gitSubPath: TMaybe<string>\n  localFolder: TMaybe<string>\n  image: TMaybe<string>\n}\nexport const SUPPORTED_IDES = [\n  \"none\",\n  \"vscode\",\n  \"vscode-insiders\",\n  \"intellj\",\n  \"goland\",\n  \"rustrover\",\n  \"pycharm\",\n  \"phpstorm\",\n  \"clion\",\n  \"rubymine\",\n  \"rider\",\n  \"webstorm\",\n  \"openvscode\",\n  \"jupyternotebook\",\n  \"fleet\",\n  \"windsurf\",\n] as const\nexport type TSupportedIDE = (typeof SUPPORTED_IDES)[number]\nexport type TImportWorkspaceConfig = Readonly<{\n  workspaceID: string\n  workspaceUID: string\n  devPodProHost: string\n  project: string\n  options: Record<string, string> | null\n}>\n\n//#endregion\n\n//#region Context\nexport type TContextOptions = Record<TContextOptionName, TContextOption>\n// See pkg/config/context.go\nexport type TContextOptionName =\n  | \"AGENT_URL\"\n  | \"TELEMETRY\"\n  | \"SSH_INJECT_DOCKER_CREDENTIALS\"\n  | \"SSH_INJECT_GIT_CREDENTIALS\"\nexport type TContextOption = Readonly<{\n  name: TContextOptionName\n  description: string | null | undefined\n  default: string | null | undefined\n  enum: readonly string[] | null | undefined\n  value: string | null | undefined\n}>\n//#endregion\n\n//#region Pro\nexport type TProID = string\nexport type TWithProID = Readonly<{ id: TProID }>\nexport type TProInstance = Readonly<{\n  host: TMaybe<string>\n  provider: TMaybe<string>\n  creationTimestamp: TMaybe<string>\n  authenticated: TMaybe<boolean>\n  capabilities: TMaybe<readonly string[]>\n}>\nexport type TProInstances = readonly TProInstance[]\nexport type TProInstanceManager = Readonly<{\n  login: TRunnable<TProInstanceLoginConfig> &\n    Pick<UseMutationResult<TProvider, Error, unknown>, \"status\" | \"error\" | \"reset\"> & {\n      provider: TProvider | undefined\n    }\n  disconnect: TRunnable<TWithProID> &\n    Pick<UseMutationResult, \"status\" | \"error\"> & { target: TWithProID | undefined }\n}>\nexport type TProInstanceLoginConfig = Readonly<{\n  host: string\n  accessKey?: string\n  streamListener?: TStreamEventListenerFn\n}>\nexport type TListProInstancesConfig = Readonly<\n  | {\n      authenticate?: boolean\n    }\n  | undefined\n>\nexport type TPlatformVersionInfo = Readonly<{\n  serverVersion: TMaybe<string>\n  remoteProviderVersion: TMaybe<string>\n  currentProviderVersion: TMaybe<string>\n}>\n//#endregion\n\nexport type TDevcontainerSetup = Readonly<{\n  isGitRepository: boolean\n  isLocal: boolean\n  isImage: boolean\n  configPaths: string[]\n}>\n//#region CommunityContributions\nexport type TCommunityContributions = Readonly<{\n  providers: readonly TCommunityProvider[]\n}>\nexport type TCommunityProvider = Readonly<{\n  repository: string\n}>\n//#endregion\nexport type TPlatformHealthCheck = Readonly<{\n  healthy: TMaybe<boolean>\n  online: TMaybe<boolean>\n  loginRequired: TMaybe<boolean>\n  details: TMaybe<string[]>\n}>\nexport type TPlatformUpdateCheck = Readonly<{\n  available: TMaybe<boolean>\n  newVersion: TMaybe<string>\n}>\nexport const UserSecret = {\n  GIT_HTTP: \"devpod-git-http\",\n  GIT_SSH: \"devpod-git-ssh\",\n} as const\nexport type TUserSecretType = (typeof UserSecret)[keyof typeof UserSecret]\nexport type TGitCredentialData = {\n  password?: string\n  key?: string\n  host?: string\n  user?: string\n  path?: string\n}\nexport type TGitCredentialHelperData = Readonly<{\n  host: string\n  path?: string\n  username?: string\n  password: string\n}>\n\nexport function isWithWorkspaceID(arg: unknown): arg is TWithWorkspaceID {\n  return typeof arg === \"object\" && arg !== null && \"workspaceID\" in arg\n}\n"
  },
  {
    "path": "desktop/src/useCommunityContributions.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { client } from \"./client\"\nimport { TCommunityContributions } from \"./types\"\nimport { QueryKeys } from \"./queryKeys\"\n\nexport function useCommunityContributions(): Readonly<{\n  contributions: TCommunityContributions | undefined\n  isLoading: boolean\n}> {\n  const { data, isLoading } = useQuery({\n    queryKey: QueryKeys.COMMUNITY_CONTRIBUTIONS,\n    queryFn: async () => {\n      return (await client.fetchCommunityContributions()).unwrap()\n    },\n    refetchOnWindowFocus: false,\n    refetchOnMount: false,\n    refetchOnReconnect: false,\n  })\n\n  return { contributions: data, isLoading }\n}\n"
  },
  {
    "path": "desktop/src/useIDEs.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\"\nimport { useMemo } from \"react\"\nimport { client } from \"./client\"\nimport { useSettings } from \"./contexts\"\nimport { QueryKeys } from \"./queryKeys\"\nimport { TIDE, TIDEs } from \"@/types\"\n\n// See pkg/config/ide.go for names\nconst FLEET_IDE_NAME = \"fleet\"\nconst JUPYTER_IDE_NAME = \"jupyternotebook\"\nconst VSCODE_INSIDERS = \"vscode-insiders\"\nconst CURSOR = \"cursor\"\nconst POSITRON = \"positron\"\nconst CODIUM = \"codium\"\nconst ZED = \"zed\"\nconst RSTUDIO = \"rstudio\"\nconst WINDSURF = \"windsurf\"\n\nexport function useIDEs() {\n  const idesQuery = useQuery({\n    queryKey: QueryKeys.IDES,\n    queryFn: async () => (await client.ides.listAll()).unwrap(),\n  })\n  const settings = useSettings()\n\n  const ides = useMemo(\n    () =>\n      idesQuery.data?.filter((ide) => {\n        if (!ide.experimental) return true\n\n        if (ide.name === FLEET_IDE_NAME && settings.experimental_fleet) return true\n        if (ide.name === JUPYTER_IDE_NAME && settings.experimental_jupyterNotebooks) return true\n        if (ide.name === VSCODE_INSIDERS && settings.experimental_vscodeInsiders) return true\n        if (ide.name === CURSOR && settings.experimental_cursor) return true\n        if (ide.name === POSITRON && settings.experimental_positron) return true\n        if (ide.name === CODIUM && settings.experimental_codium) return true\n        if (ide.name === ZED && settings.experimental_zed) return true\n        if (ide.name === RSTUDIO && settings.experimental_rstudio) return true\n        if (ide.name === WINDSURF && settings.experimental_windsurf) return true\n\n        return false\n      }),\n    [settings, idesQuery.data]\n  )\n\n  return useMemo(\n    () => ({ ides, defaultIDE: idesQuery.data?.find((ide) => ide.default) }),\n    [ides, idesQuery.data]\n  )\n}\n\nexport function useGroupIDEs(ides?: TIDEs) {\n  return useMemo(() => {\n    return ides?.reduce(\n      (accum, ide) => {\n        const group = ide.group ?? \"Other\"\n\n        if (group === \"Primary\") {\n          accum.primary.push(ide)\n        } else {\n          if (!accum.subMenus[group]) {\n            accum.subMenus[group] = []\n            accum.subMenuGroups.push(group)\n          }\n\n          accum.subMenus[group]!.push(ide)\n        }\n\n        return accum\n      },\n      {\n        primary: [] as TIDE[],\n        subMenuGroups: [] as string[],\n        subMenus: {} as { [key: string]: TIDE[] },\n      }\n    )\n  }, [ides])\n}\n"
  },
  {
    "path": "desktop/src/useWelcomeModal.tsx",
    "content": "import {\n  Code,\n  Heading,\n  HStack,\n  Link,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalOverlay,\n  Text,\n  useDisclosure,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { useCallback, useEffect, useMemo, useState } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { client } from \"./client\"\nimport { LoftOSSBadge, Step, Steps, useInstallCLI } from \"./components\"\nimport { Briefcase, CommandLine, DevpodWordmark } from \"./icons\"\nimport { Routes } from \"./routes\"\n\nconst IS_FIRST_VISIT_KEY = \"devpod-is-first-visit\"\n\nexport function useWelcomeModal() {\n  const navigate = useNavigate()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const [isCancellable, setIsCancellable] = useState(false)\n  const {\n    badge: installCLIBadge,\n    button: installCLIButton,\n    helpText: installCLIHelpText,\n    errorMessage: installCLIErrorMessage,\n  } = useInstallCLI()\n  const handleSetupFinished = useCallback(() => {\n    onClose()\n    navigate(Routes.WORKSPACE_CREATE)\n  }, [navigate, onClose])\n\n  // Open the welcome modal on first visit, except if we start with a `SetupPro` event\n  useEffect(() => {\n    const maybeFirstVisit = localStorage.getItem(IS_FIRST_VISIT_KEY)\n    let shouldShowWelcomeModal = maybeFirstVisit === null && !isOpen\n\n    const listenerPromise = client.subscribe(\"event\", (event) => {\n      if (event.type === \"SetupPro\") {\n        shouldShowWelcomeModal = false\n        onClose()\n      }\n    })\n\n    if (shouldShowWelcomeModal) {\n      onOpen()\n      localStorage.setItem(IS_FIRST_VISIT_KEY, \"false\")\n\n      return\n    }\n\n    return () => {\n      listenerPromise.then((unsubscribe) => unsubscribe())\n    }\n  }, [isOpen, onClose, onOpen])\n\n  const modal = useMemo(() => {\n    return (\n      <Modal\n        onClose={onClose}\n        isOpen={isOpen}\n        isCentered\n        size=\"4xl\"\n        scrollBehavior=\"inside\"\n        closeOnEsc={isCancellable}\n        closeOnOverlayClick={isCancellable}>\n        <ModalOverlay />\n        <ModalContent>\n          {isCancellable && <ModalCloseButton />}\n          <ModalBody borderRadius={\"md\"}>\n            <VStack align=\"start\" spacing=\"8\" paddingX=\"4\" paddingTop=\"4\">\n              <Steps finishText=\"Get Started\" onFinish={handleSetupFinished}>\n                <Step>\n                  <HStack width=\"full\" justifyContent=\"space-between\" alignItems=\"center\">\n                    <HStack>\n                      <Heading as=\"h1\" size=\"lg\">\n                        Welcome to\n                      </Heading>\n                      <DevpodWordmark width=\"40\" height=\"16\" />\n                    </HStack>\n                    <LoftOSSBadge />\n                  </HStack>\n\n                  <Text fontWeight=\"bold\">\n                    DevPod is a tool to create reproducible developer environments.\n                  </Text>\n                  <Text>\n                    Each developer environment runs in a separate container and is specified through\n                    a devcontainer.json. Through DevPod providers these containers can be created on\n                    the local computer, any reachable remote machine or in a public or private\n                    cloud. It&apos;s also possible to extend DevPod and write your own custom\n                    providers. <br />\n                    For more information, head over to our{\" \"}\n                    <Link onClick={() => client.open(\"https://devpod.sh/docs\")}>\n                      documentation.\n                    </Link>\n                  </Text>\n\n                  <Text fontWeight=\"bold\">Let&apos;s set you up!</Text>\n                </Step>\n\n                <Step>\n                  <HStack>\n                    <CommandLine boxSize=\"6\" />\n                    <Heading as=\"h1\" size=\"lg\" marginRight=\"2\">\n                      CLI\n                    </Heading>\n                  </HStack>\n\n                  <Text>\n                    DevPod ships with a powerful CLI that allows you to create, manage and connect\n                    to your workspaces and providers. You can either{\" \"}\n                    <Link onClick={() => client.open(\"https://github.com/loft-sh/devpod/releases\")}>\n                      download the standalone binary\n                    </Link>{\" \"}\n                    or directly add it to your <Code>$PATH</Code>.\n                    <br />\n                    <Text as=\"span\" variant=\"muted\">\n                      Feel free to skip this step. You can always install the CLI from the{\" \"}\n                      <Code variant=\"decorative\">Settings</Code> tab.\n                    </Text>\n                  </Text>\n                  <VStack align=\"start\">\n                    <HStack>\n                      {installCLIButton}\n                      {installCLIBadge}\n                    </HStack>\n                    <Text variant=\"muted\" fontSize=\"sm\">\n                      {installCLIHelpText}\n                    </Text>\n                  </VStack>\n                  {installCLIErrorMessage}\n                </Step>\n\n                <Step>\n                  <HStack>\n                    <Briefcase boxSize=\"6\" />\n                    <Heading as=\"h1\" size=\"lg\" marginRight=\"2\">\n                      Workspaces\n                    </Heading>\n                  </HStack>\n\n                  <Text>\n                    Workspaces are your reproducible development environment on a per-project basis.\n                    Turn a local folder, git repository or docker container into a workspace and\n                    connect it to your favorite coding tool. Or just ssh into them start developing.\n                  </Text>\n                </Step>\n              </Steps>\n            </VStack>\n          </ModalBody>\n          <ModalFooter />\n        </ModalContent>\n      </Modal>\n    )\n  }, [\n    handleSetupFinished,\n    installCLIBadge,\n    installCLIButton,\n    installCLIErrorMessage,\n    installCLIHelpText,\n    isCancellable,\n    isOpen,\n    onClose,\n  ])\n\n  const show = useCallback(\n    ({ cancellable = false }: Readonly<{ cancellable?: boolean }>) => {\n      setIsCancellable(cancellable)\n      onOpen()\n    },\n    [onOpen]\n  )\n\n  return { modal, show }\n}\n"
  },
  {
    "path": "desktop/src/views/Actions/Action.tsx",
    "content": "import { useDownloadLogs } from \"@/lib\"\nimport { DownloadIcon } from \"@chakra-ui/icons\"\nimport { Box, Button, IconButton, Tooltip } from \"@chakra-ui/react\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { HiStop } from \"react-icons/hi2\"\nimport { useNavigate } from \"react-router\"\nimport { useParams, useSearchParams } from \"react-router-dom\"\nimport { TerminalSearchBar, ToolbarActions, useStreamingTerminal } from \"@/components\"\nimport { useAction } from \"@/contexts\"\nimport { Routes } from \"@/routes\"\nimport { TSearchOptions } from \"@/components/Terminal/useTerminalSearch\"\n\nexport function Action() {\n  const [searchParams] = useSearchParams()\n  const params = useParams()\n  const navigate = useNavigate()\n  const actionID = useMemo(() => Routes.getActionID(params), [params])\n  const action = useAction(actionID)\n\n  const [searchOptions, setSearchOptions] = useState<TSearchOptions>({})\n\n  const {\n    terminal,\n    connectStream,\n    clear,\n    search: { totalSearchResults, nextSearchResult, prevSearchResult, activeSearchResult },\n  } = useStreamingTerminal({ searchOptions })\n\n  const { download, isDownloading: isDownloadingLogs } = useDownloadLogs()\n\n  useEffect(() => {\n    if (action === undefined) {\n      return\n    }\n\n    clear()\n\n    return action.connectOrReplay(connectStream)\n  }, [action, actionID, clear, connectStream])\n\n  useEffect(() => {\n    const onSuccess = searchParams.get(\"onSuccess\")\n    if (onSuccess && action?.data.status === \"success\") {\n      navigate(onSuccess)\n    }\n  }, [searchParams, action, navigate])\n\n  return (\n    <>\n      <ToolbarActions>\n        {action?.data.status === \"pending\" && (\n          <Button\n            variant=\"outline\"\n            aria-label=\"Cancel action\"\n            leftIcon={<HiStop />}\n            onClick={() => action.cancel()}>\n            Cancel\n          </Button>\n        )}\n        {actionID !== undefined && (\n          <Tooltip label=\"Save Logs\">\n            <IconButton\n              isLoading={isDownloadingLogs}\n              title=\"Save Logs\"\n              variant=\"outline\"\n              aria-label=\"Save Logs\"\n              icon={<DownloadIcon />}\n              onClick={() => download({ actionID })}\n            />\n          </Tooltip>\n        )}\n      </ToolbarActions>\n      <TerminalSearchBar\n        prevSearchResult={prevSearchResult}\n        nextSearchResult={nextSearchResult}\n        totalSearchResults={totalSearchResults}\n        activeSearchResult={activeSearchResult}\n        onUpdateSearchOptions={setSearchOptions}\n      />\n      <Box height=\"calc(100% - 8rem)\" mt={8} width=\"full\">\n        {terminal}\n      </Box>\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Actions/Actions.tsx",
    "content": "import { Box } from \"@chakra-ui/react\"\nimport { Outlet } from \"react-router-dom\"\nimport { NavigationViewLayout } from \"../../components\"\nimport { useActionTitle } from \"./useActionTitle\"\n\nexport function Actions() {\n  const title = useActionTitle()\n\n  return (\n    <NavigationViewLayout title={title}>\n      <Box height=\"full\" width=\"full\">\n        <Outlet />\n      </Box>\n    </NavigationViewLayout>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Actions/index.ts",
    "content": "export { Action } from \"./Action\"\nexport { Actions } from \"./Actions\"\n"
  },
  {
    "path": "desktop/src/views/Actions/useActionTitle.tsx",
    "content": "import { IconButton } from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\nimport { useLocation, useMatch, useNavigate } from \"react-router-dom\"\nimport { TViewTitle } from \"../../components\"\nimport { getAction, useWorkspaceStore } from \"../../contexts\"\nimport { ArrowLeft } from \"../../icons\"\nimport { exists, getActionDisplayName } from \"../../lib\"\nimport { Routes } from \"../../routes\"\n\nexport function useActionTitle(): TViewTitle | null {\n  const { store } = useWorkspaceStore()\n  const navigate = useNavigate()\n  const location = useLocation()\n\n  const matchAction = useMatch(Routes.ACTION)\n\n  return useMemo<TViewTitle | null>(() => {\n    if (!exists(matchAction)) {\n      return null\n    }\n    const maybeActionID = Routes.getActionID(matchAction.params)\n    if (!maybeActionID) {\n      return null\n    }\n    const maybeAction = getAction(maybeActionID, store)\n    if (maybeAction === undefined) {\n      return null\n    }\n\n    const targetRoute =\n      // Unfortunately `Location` isn't typed, so be careful if you change this\n      exists(location.state?.origin) && location.state?.origin !== \"\"\n        ? location.state?.origin\n        : Routes.WORKSPACES\n\n    return {\n      label: getActionDisplayName(maybeAction),\n      priority: \"regular\",\n      leadingAction: (\n        <IconButton\n          variant=\"ghost\"\n          aria-label=\"Navigate back to Workspaces\"\n          icon={<ArrowLeft />}\n          onClick={() => {\n            navigate(targetRoute)\n          }}\n        />\n      ),\n    }\n  }, [location.state?.origin, matchAction, navigate, store])\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/BackToWorkspaces.tsx",
    "content": "import { useProContext } from \"@/contexts\"\nimport { Routes } from \"@/routes\"\nimport { ChevronLeftIcon } from \"@chakra-ui/icons\"\nimport { Link } from \"@chakra-ui/react\"\nimport { Link as RouterLink } from \"react-router-dom\"\n\nexport function BackToWorkspaces() {\n  const { host } = useProContext()\n\n  return (\n    <Link as={RouterLink} variant=\"muted\" to={Routes.toProInstance(host)}>\n      <ChevronLeftIcon boxSize={5} /> Back to Workspaces\n    </Link>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/CreateWorkspace.tsx",
    "content": "import { client as globalClient } from \"@/client\"\nimport {\n  ProWorkspaceInstance,\n  ProWorkspaceStore,\n  useProContext,\n  useTemplates,\n  useWorkspace,\n  useWorkspaceStore,\n} from \"@/contexts\"\nimport {\n  Annotations,\n  Failed,\n  Labels,\n  randomString,\n  Result,\n  Return,\n  safeMaxName,\n  Source,\n} from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { Box, Heading, HStack, VStack } from \"@chakra-ui/react\"\nimport { getProjectNamespace, NewResource, Resources } from \"@loft-enterprise/client\"\nimport { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport * as jsyaml from \"js-yaml\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { useNavigate } from \"react-router-dom\"\nimport { BackToWorkspaces } from \"../BackToWorkspaces\"\nimport { CreateWorkspaceForm } from \"./CreateWorkspaceForm\"\nimport { TFormValues } from \"./types\"\nimport { useLocation } from \"react-router\"\nimport { DaemonClient } from \"@/client/pro/client\"\n\nexport function CreateWorkspace() {\n  const workspace = useWorkspace<ProWorkspaceInstance>(undefined)\n  const { store } = useWorkspaceStore<ProWorkspaceStore>()\n  const [globalError, setGlobalError] = useState<Failed | null>(null)\n  const { host, currentProject, managementSelfQuery, client } = useProContext()\n  const navigate = useNavigate()\n\n  const { data: templates, isLoading: isTemplatesLoading } = useTemplates()\n\n  const presets = templates?.presets\n\n  const [presetId, setPresetId] = useState<string | undefined>(undefined)\n  const routerLocation = useLocation()\n\n  useEffect(() => {\n    const searchParams = new URLSearchParams(routerLocation.search)\n    const fromPreset = searchParams.get(\"fromPreset\")\n\n    if (fromPreset && !presetId) {\n      setPresetId(fromPreset)\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [])\n\n  const preset = useMemo(() => {\n    if (!presetId) {\n      return undefined\n    }\n\n    return (presets ?? []).find((p) => p.metadata?.name === presetId)\n  }, [presetId, presets])\n\n  const handleReset = () => {\n    setGlobalError(null)\n    navigate(Routes.toProInstance(host))\n  }\n\n  const handleSubmit = async (values: TFormValues) => {\n    setGlobalError(null)\n    const shouldUseRunner = !(client instanceof DaemonClient)\n    const instanceRes = await buildWorkspaceInstance(\n      values,\n      currentProject?.metadata?.name,\n      managementSelfQuery.data?.status?.projectNamespacePrefix,\n      presetId,\n      shouldUseRunner\n    )\n    if (instanceRes.err) {\n      setGlobalError(instanceRes.val)\n\n      return\n    }\n\n    const createRes = await client.createWorkspace(instanceRes.val.instance)\n    if (createRes.err) {\n      setGlobalError(createRes.val)\n\n      return\n    }\n    // update workspace store immediately\n    const instance = new ProWorkspaceInstance(createRes.val)\n    store.setWorkspace(instance.id, instance)\n\n    workspace.create({\n      id: instanceRes.val.workspaceID,\n      workspaceKey: instance.id,\n      ideConfig: {\n        name: values.defaultIDE,\n      },\n    })\n\n    navigate(Routes.toProWorkspace(host, instance.id))\n  }\n\n  return (\n    <Box mb=\"40\">\n      <VStack align=\"start\">\n        <BackToWorkspaces />\n        <HStack align=\"center\" justify=\"space-between\" mb=\"8\" mt={\"2\"}>\n          <Heading fontWeight=\"thin\">Create Workspace</Heading>\n        </HStack>\n      </VStack>\n      <CreateWorkspaceForm\n        onReset={handleReset}\n        onSubmit={handleSubmit}\n        loading={isTemplatesLoading}\n        error={globalError}\n        preset={preset}\n        presets={presets}\n        setPreset={setPresetId}\n      />\n    </Box>\n  )\n}\n\nasync function buildWorkspaceInstance(\n  values: TFormValues,\n  currentProject: string | undefined,\n  projectNamespacePrefix: string | undefined,\n  preset: string | undefined,\n  shouldUseRunner: boolean\n): Promise<Result<{ workspaceID: string; instance: ManagementV1DevPodWorkspaceInstance }>> {\n  const instance = NewResource(Resources.ManagementV1DevPodWorkspaceInstance)\n  const workspaceSource = new Source(values.sourceType, values.source)\n\n  // Workspace name\n  const sourceIDRes = await globalClient.workspaces.newID(workspaceSource.stringify())\n  if (sourceIDRes.err) {\n    return sourceIDRes\n  }\n  const id = getID(sourceIDRes.val)\n\n  // Kubernetes name\n  const kubeNameRes = await getKubeName(values.name || id)\n  if (kubeNameRes.err) {\n    return kubeNameRes\n  }\n  const kubeName = kubeNameRes.val\n\n  // ID/UID\n  const uidRes = await globalClient.workspaces.newUID()\n  if (uidRes.err) {\n    return uidRes\n  }\n  const uid = uidRes.val\n  const displayName = values.name\n  const ns = getProjectNamespace(currentProject, projectNamespacePrefix)\n\n  if (!instance.metadata) {\n    instance.metadata = {}\n  }\n  if (!instance.metadata.labels) {\n    instance.metadata.labels = {}\n  }\n  if (!instance.metadata.annotations) {\n    instance.metadata.annotations = {}\n  }\n  if (!instance.spec) {\n    instance.spec = {}\n  }\n  instance.metadata.generateName = `${kubeName}-`\n  instance.metadata.namespace = ns\n  instance.metadata.labels[Labels.WorkspaceID] = id\n  instance.metadata.labels[Labels.WorkspaceUID] = uid\n  instance.metadata.annotations[Annotations.WorkspaceSource] = workspaceSource.stringify()\n  instance.spec.displayName = displayName\n\n  // TODO: Remove when removing proxy provider\n  if (shouldUseRunner) {\n    instance.spec.runnerRef = {\n      runner: values.target,\n    }\n  } else {\n    instance.spec.target = {\n      cluster: { name: values.target },\n    }\n  }\n\n  // Template, version and parameters\n  const { workspaceTemplate: template, workspaceTemplateVersion, ...parameters } = values.options\n\n  try {\n    instance.spec.parameters = jsyaml.dump(parameters)\n  } catch (err) {\n    return Return.Failed(err as any)\n  }\n\n  if (preset) {\n    instance.spec.presetRef = { name: preset }\n  } else {\n    let templateVersion = workspaceTemplateVersion\n    if (templateVersion === \"latest\") {\n      templateVersion = \"\"\n    }\n    instance.spec.templateRef = {\n      name: template,\n      version: templateVersion,\n    }\n\n    // Environment template\n    if (values.devcontainerType === \"external\") {\n      instance.spec.environmentRef = {\n        name: values.devcontainerJSON,\n      }\n\n      if (values.envTemplateVersion !== \"latest\") {\n        instance.spec.environmentRef.version = values.envTemplateVersion\n      }\n    }\n  }\n\n  return Return.Value({ workspaceID: id, instance })\n}\n\nasync function getKubeName(name: string): Promise<Result<string>> {\n  try {\n    const kubeName = await safeMaxName(\n      name\n        .toLowerCase()\n        .replace(/[^a-z0-9]/g, \"-\")\n        .replace(/--+/g, \"-\")\n        .replace(/(^[^a-z0-9])|([^a-z0-9]$)/, \"\"),\n      39\n    )\n\n    return Return.Value(kubeName)\n  } catch (err) {\n    return Return.Failed(`Failed to get kubernetes name from ${name}: ${err}`)\n  }\n}\n\nfunction getID(name: string): string {\n  if (name.length <= 48 - 6) {\n    return `${name}-${randomString(5)}`\n  }\n  const start = name.substring(0, 48 - 6)\n\n  return `${start}-${randomString(5)}`\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/CreateWorkspaceForm.tsx",
    "content": "import { BottomActionBar, BottomActionBarError, Form } from \"@/components\"\nimport { ProWorkspaceInstance, useProjectClusters, useTemplates } from \"@/contexts\"\nimport { Code, Laptop, Parameters } from \"@/icons\"\nimport {\n  Annotations,\n  exists,\n  Failed,\n  getParametersWithValues,\n  Labels,\n  Source,\n  useFormErrors,\n} from \"@/lib\"\nimport { useIDEs } from \"@/useIDEs\"\nimport {\n  Box,\n  Button,\n  ButtonGroup,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Grid,\n  Input,\n  Spinner,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport { ReactNode, useCallback, useEffect, useMemo, useRef } from \"react\"\nimport { Controller, DefaultValues, FormProvider, useForm } from \"react-hook-form\"\nimport { DevContainerInput } from \"./DevContainerInput\"\nimport { IDEInput } from \"./IDEInput\"\nimport { InfrastructureTemplateInput } from \"./InfrastructureTemplateInput\"\nimport { SourceInput } from \"./SourceInput\"\nimport { FieldName, TFormValues } from \"./types\"\nimport { TargetInput } from \"@/views/Pro/CreateWorkspace/RunnerInput\"\nimport { ManagementV1DevPodWorkspacePreset } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspacePreset\"\nimport { Gold } from \"@/icons/Gold\"\nimport { PresetInput } from \"@/views/Pro/CreateWorkspace/PresetInput\"\n\ntype TCreateWorkspaceFormProps = Readonly<{\n  instance?: ProWorkspaceInstance\n  template?: ManagementV1DevPodWorkspaceTemplate\n  onSubmit: (data: TFormValues) => void\n  onReset: VoidFunction\n  error: Failed | null\n  preset?: ManagementV1DevPodWorkspacePreset\n  presets?: readonly ManagementV1DevPodWorkspacePreset[]\n  setPreset?: (preset: string | undefined) => void\n  loading?: boolean\n}>\nexport function CreateWorkspaceForm({\n  instance,\n  template,\n  onSubmit,\n  onReset,\n  error,\n  preset,\n  presets,\n  loading,\n  setPreset,\n}: TCreateWorkspaceFormProps) {\n  const defaultValues = useMemo(() => getDefaultValues(instance, template), [instance, template])\n  const containerRef = useRef<HTMLDivElement>(null)\n\n  const { ides, defaultIDE } = useIDEs()\n  const { data: templates, isLoading: isTemplatesLoading } = useTemplates()\n  const { data: projectClusterData, isLoading: projectClusterDataLoading } = useProjectClusters()\n\n  const form = useForm<TFormValues>({ mode: \"onChange\", defaultValues })\n  const {\n    sourceError,\n    defaultIDEError,\n    nameError,\n    devcontainerJSONError,\n    optionsError,\n    targetError,\n  } = useFormErrors(Object.values(FieldName), form.formState)\n\n  const isUpdate = useMemo(() => {\n    return !!instance\n  }, [instance])\n\n  const resetPreset = useCallback(() => {\n    setPreset?.(undefined)\n  }, [setPreset])\n\n  useEffect(() => {\n    if (!form.getFieldState(FieldName.DEFAULT_IDE).isDirty && defaultIDE && defaultIDE.name) {\n      form.setValue(FieldName.DEFAULT_IDE, defaultIDE.name, {\n        shouldDirty: false,\n        shouldTouch: true,\n      })\n    }\n  }, [defaultIDE, form])\n\n  useEffect(() => {\n    if (!isUpdate && preset) {\n      const opts = { shouldDirty: true } // To enable the create workspace button.\n\n      const sourceType = preset.spec?.source.image ? \"image\" : \"git\"\n      const source = preset.spec?.source.image ?? preset.spec?.source.git\n\n      form.setValue(FieldName.SOURCE_TYPE, sourceType, opts)\n      form.setValue(FieldName.SOURCE, source ?? \"\", opts)\n\n      if (preset.spec?.infrastructureRef.name) {\n        form.setValue(\n          `${FieldName.OPTIONS}.workspaceTemplate`,\n          preset.spec.infrastructureRef.name,\n          opts\n        )\n        form.setValue(\n          `${FieldName.OPTIONS}.workspaceTemplateVersion`,\n          preset.spec.infrastructureRef.version ?? \"latest\",\n          opts\n        )\n      }\n\n      if (preset.spec?.environmentRef?.name) {\n        form.setValue(FieldName.DEVCONTAINER_TYPE, \"external\", opts)\n        form.setValue(FieldName.DEVCONTAINER_JSON, preset.spec.environmentRef.name, opts)\n        form.setValue(\n          FieldName.ENV_TEMPLATE_VERSION,\n          preset.spec.environmentRef.version ?? \"latest\",\n          opts\n        )\n      } else {\n        form.setValue(FieldName.DEVCONTAINER_TYPE, \"path\", opts)\n        form.setValue(FieldName.ENV_TEMPLATE_VERSION, \"latest\", opts)\n        form.setValue(FieldName.DEVCONTAINER_JSON, \"\", opts)\n      }\n    }\n  }, [preset, form, isUpdate])\n  const inputBg = useColorModeValue(\"white\", \"background.darkest\")\n\n  return (\n    <Form onSubmit={form.handleSubmit(onSubmit)}>\n      <FormProvider {...form}>\n        <VStack w=\"full\" gap=\"8\" ref={containerRef}>\n          {presets?.length ? (\n            <FormControl isDisabled={isUpdate}>\n              <CreateWorkspaceRow\n                label={\n                  <FormLabel>\n                    <Gold boxSize={5} mr=\"1\" />\n                    Workspace Preset\n                  </FormLabel>\n                }>\n                <PresetInput\n                  preset={preset}\n                  presets={presets}\n                  loading={loading}\n                  setPreset={setPreset}\n                  isUpdate={isUpdate}\n                />\n              </CreateWorkspaceRow>\n            </FormControl>\n          ) : (\n            <></>\n          )}\n          <FormControl isDisabled={isUpdate} isRequired isInvalid={exists(sourceError)}>\n            <CreateWorkspaceRow\n              label={\n                <FormLabel>\n                  <Code boxSize={5} mr=\"1\" />\n                  Source Code\n                </FormLabel>\n              }>\n              <SourceInput isDisabled={isUpdate} resetPreset={resetPreset} />\n\n              {exists(sourceError) && (\n                <FormErrorMessage>{sourceError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <FormControl isRequired isInvalid={exists(optionsError)}>\n            <CreateWorkspaceRow\n              label={\n                <FormLabel>\n                  <Parameters boxSize={5} mr=\"1\" />\n                  Parameters\n                </FormLabel>\n              }>\n              {isTemplatesLoading ? (\n                <Spinner />\n              ) : (\n                <InfrastructureTemplateInput\n                  resetPreset={resetPreset}\n                  infraTemplates={templates!.workspace}\n                  defaultInfraTemplate={templates!.default}\n                />\n              )}\n\n              {exists(optionsError) && (\n                <FormErrorMessage>{optionsError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <FormControl isDisabled={!!instance} isRequired isInvalid={exists(targetError)}>\n            <CreateWorkspaceRow\n              label={\n                <FormLabel>\n                  <Code boxSize={5} mr=\"1\" />\n                  Cluster\n                </FormLabel>\n              }>\n              {projectClusterDataLoading ? (\n                <Spinner />\n              ) : (\n                <TargetInput projectClusters={projectClusterData} />\n              )}\n\n              {exists(targetError) && (\n                <FormErrorMessage>{targetError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <FormControl isInvalid={exists(defaultIDEError)}>\n            <CreateWorkspaceRow\n              label={\n                <VStack gap=\"1\" align=\"start\">\n                  <FormLabel>\n                    <Laptop boxSize={5} mr=\"1\" />\n                    Default IDE\n                  </FormLabel>\n                  <FormHelperText mt=\"0\">\n                    The default IDE to use when starting the workspace. This can be changed later.\n                  </FormHelperText>\n                </VStack>\n              }>\n              <Controller\n                name={FieldName.DEFAULT_IDE}\n                control={form.control}\n                render={({ field }) => (\n                  <IDEInput field={field} ides={ides} onClick={(name) => field.onChange(name)} />\n                )}\n              />\n              {exists(defaultIDEError) && (\n                <FormErrorMessage>{defaultIDEError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <FormControl isDisabled={!!instance} isInvalid={exists(devcontainerJSONError)}>\n            <CreateWorkspaceRow\n              label={\n                <VStack gap=\"1\" align=\"start\">\n                  <FormLabel>\n                    <Laptop boxSize={5} mr=\"1\" />\n                    Devcontainer.json\n                  </FormLabel>\n                  <FormHelperText mt=\"0\">\n                    Set an external source or a relative path in the source code. Otherwise, we’ll\n                    look in the code repository.\n                  </FormHelperText>\n                </VStack>\n              }>\n              <DevContainerInput\n                resetPreset={resetPreset}\n                environmentTemplates={templates?.environment ?? []}\n              />\n\n              {exists(devcontainerJSONError) && (\n                <FormErrorMessage>{devcontainerJSONError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <FormControl isInvalid={exists(nameError)}>\n            <CreateWorkspaceRow\n              label={\n                <FormLabel>\n                  <Laptop boxSize={5} mr=\"1\" />\n                  Workspace Name\n                </FormLabel>\n              }>\n              <Input {...form.register(FieldName.NAME, { required: false })} bg={inputBg} />\n\n              {exists(nameError) && (\n                <FormErrorMessage>{nameError.message ?? \"Error\"}</FormErrorMessage>\n              )}\n            </CreateWorkspaceRow>\n          </FormControl>\n\n          <BottomActionBar hasSidebar={false} stickToBottom>\n            <BottomActionBarError error={error} containerRef={containerRef} />\n            <ButtonGroup marginLeft=\"auto\">\n              <Button\n                isDisabled={Object.keys(form.formState.dirtyFields).length === 0}\n                onClick={() => {\n                  form.reset(defaultValues)\n                  onReset()\n                }}>\n                {instance ? \"Reset Changes\" : \"Cancel\"}{\" \"}\n              </Button>\n              <Button\n                type=\"submit\"\n                isLoading={form.formState.isSubmitting}\n                isDisabled={\n                  Object.keys(form.formState.errors).length > 0 ||\n                  Object.keys(form.formState.dirtyFields).length === 0\n                }>\n                {instance ? \"Save & Rebuild\" : \"Create Workspace\"}\n              </Button>\n            </ButtonGroup>\n          </BottomActionBar>\n        </VStack>\n      </FormProvider>\n    </Form>\n  )\n}\n\ntype TCreateWorkspaceRowProps = Readonly<{\n  label: ReactNode\n  children: ReactNode\n}>\nfunction CreateWorkspaceRow({ label, children }: TCreateWorkspaceRowProps) {\n  return (\n    <Grid templateColumns=\"1fr 3fr\" w=\"full\">\n      <Box w=\"full\" h=\"full\" pr=\"10\">\n        {label}\n      </Box>\n      <Box w=\"full\" h=\"full\">\n        {children}\n      </Box>\n    </Grid>\n  )\n}\n\nfunction getDefaultValues(\n  instance: ProWorkspaceInstance | undefined,\n  template: ManagementV1DevPodWorkspaceTemplate | undefined\n): DefaultValues<TFormValues> | undefined {\n  if (instance === undefined) {\n    return undefined\n  }\n  const defaultValues: DefaultValues<TFormValues> = {\n    defaultIDE: instance.status?.ide?.name ?? \"none\",\n    target: instance.spec?.runnerRef?.runner ?? instance.spec?.target?.cluster?.name,\n  }\n\n  // source\n  const rawSource = instance.metadata?.annotations?.[Annotations.WorkspaceSource]\n  if (rawSource) {\n    const source = Source.fromRaw(rawSource)\n    defaultValues.sourceType = source.type\n    defaultValues.source = source.value\n  }\n\n  // infrastructure template\n  if (template && instance.spec?.parameters) {\n    if (!defaultValues.options) {\n      defaultValues.options = {}\n    }\n    defaultValues.options.workspaceTemplate = instance.spec.templateRef?.name\n    defaultValues.options.workspaceTemplateVersion = instance.spec.templateRef?.version\n\n    const parameters = getParametersWithValues(instance, template)\n    if (parameters && parameters.length > 0) {\n      for (const parameter of parameters) {\n        if (!parameter.variable) {\n          continue\n        }\n        defaultValues.options[parameter.variable] = parameter.value\n      }\n    }\n  }\n\n  // environment template\n  const environmentRefName = instance.spec?.environmentRef?.name\n  if (environmentRefName) {\n    defaultValues.devcontainerType = \"external\"\n    defaultValues.devcontainerJSON = environmentRefName\n    defaultValues.envTemplateVersion = instance.spec?.environmentRef?.version ?? \"latest\"\n  }\n\n  // name\n  const name = instance.spec?.displayName ?? instance.metadata?.labels?.[Labels.WorkspaceID]\n  if (name) {\n    defaultValues.name = name\n  }\n\n  return defaultValues\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/DevContainerInput.tsx",
    "content": "import { getDisplayName } from \"@/lib\"\nimport {\n  Box,\n  Input,\n  InputGroup,\n  InputLeftAddon,\n  Select,\n  useColorMode,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { ManagementV1DevPodEnvironmentTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodEnvironmentTemplate\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { FieldName } from \"./types\"\n\ntype TDevContainerInputProps = Readonly<{\n  environmentTemplates: readonly ManagementV1DevPodEnvironmentTemplate[]\n  resetPreset?: VoidFunction\n}>\nexport function DevContainerInput({\n  resetPreset,\n  environmentTemplates: templates,\n}: TDevContainerInputProps) {\n  const errorBorderColor = useToken(\"colors\", \"red.500\")\n  const { register, watch, resetField } = useFormContext()\n  const devContainerType = watch(FieldName.DEVCONTAINER_TYPE, \"path\")\n  const envTemplateValue = watch(FieldName.DEVCONTAINER_JSON)\n  const bg = useColorModeValue(\"white\", \"background.darkest\")\n  const { colorMode } = useColorMode()\n\n  const [envReference, setEnvReference] = useState<string | undefined>(envTemplateValue)\n\n  // Need the extra render cycle, because the form will not report the default value of the\n  // environment template immediately if the type is changed.\n  useEffect(() => {\n    setEnvReference(envTemplateValue)\n  }, [envTemplateValue])\n\n  const envTemplate = useMemo(() => {\n    return determineEnvironmentTemplate(templates, envReference, devContainerType)\n  }, [templates, envReference, devContainerType])\n\n  const versions = useMemo(() => {\n    if (devContainerType === \"path\") {\n      return undefined\n    }\n\n    return envTemplate?.spec?.versions?.map((v) => v.version!)\n  }, [envTemplate, devContainerType])\n\n  const inputProps = useMemo(\n    () =>\n      register(FieldName.DEVCONTAINER_JSON, {\n        required: false,\n        onChange: () => {\n          resetPreset?.()\n          resetField(FieldName.ENV_TEMPLATE_VERSION, { defaultValue: \"latest\" })\n        },\n      }),\n    [register, resetField, resetPreset]\n  )\n\n  const { input } = useMemo(() => {\n    if (devContainerType === \"path\") {\n      return { input: <Input {...inputProps} placeholder=\"path/to/devcontainer.json\" /> }\n    }\n\n    return {\n      input: (\n        <Select\n          w=\"full\"\n          cursor={\"pointer\"}\n          {...inputProps}\n          isDisabled={templates.length === 0}\n          placeholder={templates.length === 0 ? \"No templates available\" : \"\"}>\n          {templates.map((template) => (\n            <option key={template.metadata!.name} value={template.metadata!.name}>\n              {getDisplayName(template)}\n            </option>\n          ))}\n        </Select>\n      ),\n    }\n  }, [devContainerType, inputProps, templates])\n\n  return (\n    <Box display={\"flex\"} flexDirection={\"row\"} w={\"full\"} gap={\"4\"}>\n      <Box flexGrow={1}>\n        <InputGroup bg={bg} w={\"full\"}>\n          <InputLeftAddon padding=\"0\" bg={colorMode == \"dark\" ? \"gray.800\" : undefined}>\n            <Select\n              {...register(FieldName.DEVCONTAINER_TYPE, {\n                onChange: () => {\n                  resetPreset?.()\n                  resetField(FieldName.ENV_TEMPLATE_VERSION, { defaultValue: \"latest\" })\n                  resetField(FieldName.DEVCONTAINER_JSON)\n                },\n              })}\n              _invalid={{\n                borderStyle: \"solid\",\n                borderWidth: \"1px\",\n                borderRightWidth: 0,\n                borderColor: errorBorderColor,\n              }}\n              borderTopRightRadius=\"0\"\n              borderBottomRightRadius=\"0\"\n              focusBorderColor=\"transparent\"\n              cursor=\"pointer\"\n              w=\"full\"\n              border=\"none\">\n              <option value=\"path\">Path</option>\n              <option value=\"external\">External</option>\n            </Select>\n          </InputLeftAddon>\n          {input}\n        </InputGroup>\n      </Box>\n\n      {versions?.length && (\n        <Box w={48}>\n          <InputGroup bg={bg} w={\"full\"}>\n            <Select\n              {...register(FieldName.ENV_TEMPLATE_VERSION, {\n                onChange: () => {\n                  resetPreset?.()\n                },\n              })}\n              _invalid={{\n                borderStyle: \"solid\",\n                borderWidth: \"1px\",\n                borderRightWidth: 0,\n                borderColor: errorBorderColor,\n              }}\n              cursor=\"pointer\"\n              w=\"full\">\n              <option value={\"latest\"}>Latest</option>\n              {versions.map((v) => (\n                <option key={v} value={v}>\n                  {v}\n                </option>\n              ))}\n            </Select>\n          </InputGroup>\n        </Box>\n      )}\n    </Box>\n  )\n}\n\nfunction determineEnvironmentTemplate(\n  templates: readonly ManagementV1DevPodEnvironmentTemplate[],\n  envTemplateValue: string | undefined,\n  devContainerType: \"path\" | \"external\" | undefined\n): ManagementV1DevPodEnvironmentTemplate | undefined {\n  if (devContainerType === \"path\" || !envTemplateValue) {\n    return undefined\n  }\n\n  return templates.find((t) => t.metadata?.name === envTemplateValue)\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/IDEInput.tsx",
    "content": "import { IDEIcon } from \"@/components\"\nimport { TIDE } from \"@/types\"\nimport { InfoIcon } from \"@chakra-ui/icons\"\nimport { Box, Card, HStack, Text, Tooltip, useColorModeValue } from \"@chakra-ui/react\"\nimport { ReactElement, cloneElement } from \"react\"\nimport { ControllerRenderProps } from \"react-hook-form\"\nimport { FieldName, TFormValues } from \"./types\"\n\ntype TIDEInputProps = Readonly<{\n  ides: readonly TIDE[] | undefined\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"DEFAULT_IDE\"]>\n  onClick: (name: NonNullable<TIDE[\"name\"]>) => void\n}>\nexport function IDEInput({ ides, field, onClick }: TIDEInputProps) {\n  return (\n    <HStack h=\"full\" flexWrap=\"wrap\">\n      {ides?.map((ide) => {\n        const isSelected = field.value === ide.name\n\n        return (\n          <Box key={ide.name}>\n            <IDECard\n              name={ide.displayName}\n              icon={<IDEIcon ide={ide} />}\n              isSelected={isSelected}\n              onClick={() => onClick(ide.name!)}\n            />\n          </Box>\n        )\n      })}\n    </HStack>\n  )\n}\n\ntype TIDECardProps = Readonly<{\n  name: string\n  icon: ReactElement\n  isSelected: boolean\n  onClick: VoidFunction\n}>\nfunction IDECard({ name, isSelected, icon, onClick }: TIDECardProps) {\n  const iconColor = useColorModeValue(\"gray.700\", \"gray.500\")\n\n  let content = icon\n  if (name === \"None\") {\n    content = (\n      <HStack px=\"2\" py=\"0\" align=\"center\" justify=\"center\" h=\"full\" w=\"full\">\n        <Text fontWeight=\"medium\" variant=\"contrast\">\n          SSH\n        </Text>\n        <Tooltip label=\"Selecting SSH only adds an entry in the form of `$workspace.devpod` to your SSH configuration. You can connect to it using your terminal or IDEs that aren't supported by DevPod but support SSH connections.\">\n          <InfoIcon ml=\"-0.5\" color={iconColor} />\n        </Tooltip>\n      </HStack>\n    )\n  } else {\n    content = cloneElement(icon, { boxSize: \"10\" })\n  }\n\n  return (\n    <Tooltip label={name} openDelay={0} closeDelay={0}>\n      <Card\n        w={name === \"None\" ? \"20\" : \"12\"}\n        h=\"12\"\n        variant=\"outline\"\n        alignItems=\"center\"\n        display=\"flex\"\n        justifyContent=\"center\"\n        cursor=\"pointer\"\n        boxSizing=\"border-box\"\n        position=\"relative\"\n        overflow=\"hidden\"\n        padding=\"1\"\n        {...(isSelected\n          ? {\n              borderColor: \"primary.500\",\n              borderWidth: \"2px\",\n              _dark: {\n                borderColor: \"primary.500\",\n                bg: \"gray.800\",\n              },\n            }\n          : {})}\n        {...(!isSelected ? { onClick } : {})}>\n        {content}\n      </Card>\n    </Tooltip>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx",
    "content": "import { useBorderColor } from \"@/Theme\"\nimport { exists, getDisplayName, getParameters, sortByVersionDesc } from \"@/lib\"\nimport { TProviderOption } from \"@/types\"\nimport { TOptionWithID } from \"@/views/Providers\"\nimport {\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Input,\n  Select,\n  SimpleGrid,\n  Switch,\n  Textarea,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport { StorageV1AppParameter } from \"@loft-enterprise/client/gen/models/storageV1AppParameter\"\nimport { ReactNode, useEffect, useMemo } from \"react\"\nimport { ChangeHandler, Controller, useFormContext } from \"react-hook-form\"\nimport { FieldName, TFormValues } from \"./types\"\n\ntype TOptionsInputProps = Readonly<{\n  resetPreset?: VoidFunction\n  infraTemplates: readonly ManagementV1DevPodWorkspaceTemplate[]\n  defaultInfraTemplate: ManagementV1DevPodWorkspaceTemplate | undefined\n}>\nexport function InfrastructureTemplateInput({\n  infraTemplates: templates,\n  defaultInfraTemplate,\n  resetPreset,\n}: TOptionsInputProps) {\n  const { getValues, watch, resetField, formState, unregister, setValue } =\n    useFormContext<TFormValues>()\n  const borderColor = useBorderColor()\n\n  const defaultTemplate = defaultInfraTemplate ?? templates[0]\n  const selectedTemplateName = watch(\n    `${FieldName.OPTIONS}.workspaceTemplate`,\n    defaultTemplate?.metadata?.name\n  )\n  const selectedTemplateVersion = watch(`${FieldName.OPTIONS}.workspaceTemplateVersion`)\n  const currentTemplate = useMemo(\n    () => templates.find((template) => template.metadata?.name === selectedTemplateName),\n    [selectedTemplateName, templates]\n  )\n  const currentParameters = useMemo(() => {\n    let v = selectedTemplateVersion\n    if (selectedTemplateVersion === \"latest\") {\n      v = \"\"\n    }\n\n    const params = getParameters(currentTemplate, v)\n\n    return !params ? params : [...params]\n  }, [currentTemplate, selectedTemplateVersion])\n\n  useEffect(() => {\n    const value = getValues()\n\n    // Apply default values manually when the set of parameters changes.\n    currentParameters?.forEach((p) => {\n      if (!p.variable) {\n        return\n      }\n\n      const paramValue = getDeepValue(value.options, p.variable)\n      if (paramValue == null && p.defaultValue != null) {\n        if (p.type === \"number\") {\n          setValue(`${FieldName.OPTIONS}.${p.variable}`, parseFloat(p.defaultValue))\n        } else if (p.type === \"boolean\") {\n          setValue(`${FieldName.OPTIONS}.${p.variable}`, p.defaultValue === \"true\")\n        } else {\n          setValue(`${FieldName.OPTIONS}.${p.variable}`, p.defaultValue)\n        }\n      }\n    })\n\n    // resetField won't properly delete the keys when you switch templates,\n    // so it's probably best to clean it up every time the set of parameters changes...\n    return () => {\n      currentParameters?.forEach((p) => {\n        unregister(`${FieldName.OPTIONS}.${p.variable?.split(/\\./)[0]}`)\n      })\n    }\n  }, [currentParameters, unregister, getValues, setValue])\n\n  const currentTemplateVersions = useMemo(() => {\n    return currentTemplate?.spec?.versions?.slice().sort(sortByVersionDesc)\n  }, [currentTemplate?.spec?.versions])\n\n  const resetTemplate = () => {\n    resetPreset?.()\n\n    // reset all other options, including version\n    const options = getValues(\"options\")\n    for (const [k] of Object.entries(options)) {\n      if (k === \"workspaceTemplate\") {\n        continue\n      }\n      if (k === \"workspaceTemplateVersion\") {\n        resetField(`${FieldName.OPTIONS}.workspaceTemplateVersion`, {\n          defaultValue: \"latest\",\n        })\n        continue\n      }\n      resetField(`${FieldName.OPTIONS}.${k}`, {})\n    }\n  }\n\n  const resetTemplateVersion = () => {\n    resetPreset?.()\n\n    const resetOptions: Parameters<typeof resetField>[1] = {\n      defaultValue: undefined,\n    }\n    // reset all parameters options\n    const options = getValues(\"options\")\n    for (const [k] of Object.entries(options)) {\n      if (k === \"workspaceTemplate\" || k === \"workspaceTemplateVersion\") {\n        continue\n      }\n      resetField(`${FieldName.OPTIONS}.${k}`, resetOptions)\n    }\n  }\n  const bg = useColorModeValue(\"gray.50\", \"gray.900\")\n\n  return (\n    <VStack\n      align=\"start\"\n      padding=\"8\"\n      gap=\"4\"\n      bg={bg}\n      borderRadius=\"md\"\n      borderWidth=\"thin\"\n      borderColor={borderColor}>\n      <FormControl display=\"flex\" gap=\"4\">\n        <OptionFormField\n          id={`${FieldName.OPTIONS}.workspaceTemplate`}\n          isRequired\n          type=\"string\"\n          defaultValue={\n            formState.defaultValues?.options?.workspaceTemplate ?? defaultTemplate?.metadata?.name\n          }\n          displayName=\"Infrastructure Template\"\n          enum={templates.map((template) => ({\n            value: template.metadata!.name!,\n            displayName: getDisplayName(template),\n          }))}\n          onChange={resetTemplate}\n        />\n        {currentTemplateVersions && currentTemplateVersions.length > 0 && (\n          <OptionFormField\n            id={`${FieldName.OPTIONS}.workspaceTemplateVersion`}\n            type=\"string\"\n            defaultValue={formState.defaultValues?.options?.workspaceTemplateVersion ?? \"latest\"}\n            displayName=\"Version\"\n            enum={[\n              { value: \"latest\", displayName: \"Latest\" },\n              ...currentTemplateVersions.map((version) => ({\n                value: version.version,\n                displayName: version.version,\n              })),\n            ]}\n            onChange={resetTemplateVersion}\n          />\n        )}\n      </FormControl>\n\n      {currentParameters && currentParameters.length > 0 && (\n        <SimpleGrid columns={[2]} gap=\"4\" borderRadius={\"md\"} w=\"full\">\n          {currentParameters.map((param) => {\n            const paramID = param.variable\n            if (!paramID) {\n              return null\n            }\n            const fieldID = `${FieldName.OPTIONS}.${paramID}`\n\n            let defaultValue = param.defaultValue\n            if (typeof formState.defaultValues?.options?.[paramID] === \"string\") {\n              defaultValue = formState.defaultValues.options[paramID] as string\n            }\n\n            return (\n              <OptionFormField\n                key={fieldID}\n                id={fieldID}\n                displayName={param.label ?? paramID}\n                description={param.description}\n                defaultValue={defaultValue}\n                type={convertParameterType(param.type)}\n                enum={param.options?.map((option) => ({\n                  value: option,\n                  displayName: option,\n                }))}\n                isRequired={param.required}\n              />\n            )\n          })}\n        </SimpleGrid>\n      )}\n    </VStack>\n  )\n}\n\ntype TOptionFormFieldProps = Partial<\n  Pick<TOptionWithID, \"type\" | \"displayName\" | \"defaultValue\" | \"description\" | \"enum\">\n> &\n  Readonly<{\n    id: string\n    isRequired?: boolean\n    placeholder?: string\n    onChange?: VoidFunction\n  }>\nfunction OptionFormField({\n  id,\n  defaultValue,\n  description,\n  type,\n  displayName,\n  enum: enumProp,\n  placeholder,\n  isRequired = false,\n  onChange,\n}: TOptionFormFieldProps) {\n  const inputBackground = useColorModeValue(\"white\", \"background.darkest\")\n  const { register, formState, control } = useFormContext()\n  const optionError = formState.errors[id]\n\n  const input = useMemo<ReactNode>(() => {\n    const registerProps = register(id, { required: isRequired })\n    const defaultValueProp = exists(defaultValue) ? { defaultValue } : {}\n    const props = {\n      ...defaultValueProp,\n      ...registerProps,\n      onChange: (e: Parameters<ChangeHandler>[0]) => {\n        registerProps.onChange(e)\n        onChange?.()\n      },\n      background: inputBackground,\n    }\n\n    if (enumProp?.length) {\n      let ph: string | undefined = placeholder ?? \"Select option\"\n      if (defaultValue) {\n        ph = undefined\n      }\n\n      return (\n        <Select {...props} placeholder={ph}>\n          {enumProp.map(\n            (opt, i) =>\n              opt.value && (\n                <option key={i} value={opt.value}>\n                  {opt.displayName ?? opt.value}\n                </option>\n              )\n          )}\n        </Select>\n      )\n    }\n\n    switch (type) {\n      case \"boolean\":\n        return (\n          <Controller\n            name={id}\n            control={control}\n            rules={{ required: isRequired }}\n            defaultValue={defaultValue}\n            render={({ field: { onChange, onBlur, value } }) => {\n              let isChecked = value\n              if (typeof value === \"string\") {\n                isChecked = value === \"true\"\n              }\n\n              return (\n                <Switch\n                  onChange={(e) => onChange(e.target.checked)}\n                  onBlur={onBlur}\n                  isChecked={isChecked}\n                />\n              )\n            }}\n          />\n        )\n      case \"number\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={placeholder ?? `Enter ${displayName}`}\n            type=\"number\"\n            onWheel={(e) => {\n              // This prevents the input field from increasing/decreasing the numbers when the scroll event is captured\n              // while this input field is focused\n              ;(e.target as HTMLInputElement).blur()\n            }}\n            {...props}\n          />\n        )\n      case \"duration\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={placeholder ?? `Enter ${displayName}`}\n            type=\"text\"\n            {...props}\n          />\n        )\n      case \"string\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={placeholder ?? `Enter ${displayName}`}\n            type=\"text\"\n            {...props}\n          />\n        )\n      case \"multiline\":\n        return (\n          <Textarea\n            rows={2}\n            spellCheck={false}\n            placeholder={placeholder ?? `Enter ${displayName}`}\n            whiteSpace=\"pre\"\n            {...props}\n          />\n        )\n      default:\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={placeholder ?? `Enter ${displayName}`}\n            type=\"text\"\n            {...props}\n          />\n        )\n    }\n  }, [\n    register,\n    id,\n    isRequired,\n    defaultValue,\n    inputBackground,\n    enumProp,\n    type,\n    onChange,\n    placeholder,\n    displayName,\n    control,\n  ])\n\n  return (\n    <FormControl isRequired={isRequired}>\n      <FormLabel fontSize=\"sm\">{displayName}</FormLabel>\n\n      {exists(optionError) ? (\n        <FormErrorMessage>{optionError.message?.toString() ?? \"Error\"}</FormErrorMessage>\n      ) : (\n        exists(description) && <FormHelperText userSelect=\"text\">{description}</FormHelperText>\n      )}\n\n      {input}\n    </FormControl>\n  )\n}\n\nfunction convertParameterType(paramType: StorageV1AppParameter[\"type\"]): TProviderOption[\"type\"] {\n  if (!paramType) {\n    return undefined\n  }\n\n  switch (paramType) {\n    case \"string\":\n      return \"string\"\n    case \"multiline\":\n      return \"multiline\"\n    case \"number\":\n      return \"number\"\n    case \"password\":\n      return \"string\"\n    case \"boolean\":\n      return \"boolean\"\n    default:\n      return undefined\n  }\n}\n\nfunction createTraversablePropertyPath(path: string): string[] {\n  path = path.replace(/\\[(\\w+)\\]/g, \".$1\")\n  path = path.replace(/^\\./, \"\")\n\n  return path.split(\".\")\n}\n\nfunction getDeepValue<T>(obj: any, path: string): T | undefined {\n  if (!obj) return undefined\n\n  const a = createTraversablePropertyPath(path)\n  let o = obj\n  while (a.length) {\n    const n = a.shift()\n    if (!n) continue\n    if (o == null || !(n in o)) return undefined\n    o = o[n]\n  }\n\n  return o\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/PresetInput.tsx",
    "content": "import { useBorderColor } from \"@/Theme\"\nimport { presetDisplayName } from \"@/views/Pro/helpers\"\nimport {\n  Box,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Portal,\n  Spinner,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ManagementV1DevPodWorkspacePreset } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspacePreset\"\nimport { AiOutlineCodeSandbox } from \"react-icons/ai\"\n\ntype TPresetInputProps = Readonly<{\n  preset?: ManagementV1DevPodWorkspacePreset\n  presets?: readonly ManagementV1DevPodWorkspacePreset[]\n  setPreset?: (presetId: string | undefined) => void\n  loading?: boolean\n  isUpdate?: boolean\n}>\nexport function PresetInput({ preset, presets, loading, isUpdate, setPreset }: TPresetInputProps) {\n  const selectedColor = useColorModeValue(\"primary.500\", \"primary.300\")\n  const unusedColor = useBorderColor()\n  const textColor = useColorModeValue(\"gray.800\", \"gray.200\")\n\n  const displayName = presetDisplayName(preset)\n\n  return loading ? (\n    <Spinner />\n  ) : (\n    <Box\n      display={\"flex\"}\n      flexDirection={\"row\"}\n      alignItems={\"center\"}\n      gap={3}\n      paddingY={\"4\"}\n      paddingX={\"6\"}\n      border={\"1px\"}\n      borderRadius={\"4px\"}\n      transitionProperty={\"border-color,color\"}\n      transitionDuration={\"0.3s\"}\n      color={displayName ? selectedColor : unusedColor}\n      borderColor={displayName ? selectedColor : unusedColor}>\n      <AiOutlineCodeSandbox opacity={0.7} size={\"24\"} />\n      <Box color={textColor} fontWeight={displayName ? \"semibold\" : undefined}>\n        {displayName ?? \"No preset selected\"}\n      </Box>\n\n      {!isUpdate && (\n        <Box ml={\"auto\"}>\n          <Menu>\n            <MenuButton\n              as={Box}\n              cursor={\"pointer\"}\n              fontWeight={\"semibold\"}\n              color={\"primary.500\"}\n              _dark={{ color: \"primary.300\" }}>\n              Change Preset\n            </MenuButton>\n            <Portal>\n              <MenuList zIndex={\"popover\"}>\n                <MenuItem\n                  fontSize={\"md\"}\n                  color={\"gray.500\"}\n                  onClick={() => {\n                    setPreset?.(undefined)\n                  }}>\n                  {\"No preset\"}\n                </MenuItem>\n                {presets?.map((p, i) => (\n                  <MenuItem\n                    fontSize={\"md\"}\n                    key={i}\n                    onClick={() => {\n                      setPreset?.(p.metadata?.name)\n                    }}>\n                    {presetDisplayName(p) ?? \"\"}\n                  </MenuItem>\n                ))}\n              </MenuList>\n            </Portal>\n          </Menu>\n        </Box>\n      )}\n    </Box>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/RunnerInput.tsx",
    "content": "import { useFormContext } from \"react-hook-form\"\nimport { FieldName, TFormValues } from \"@/views/Pro/CreateWorkspace/types\"\nimport { Select } from \"@chakra-ui/react\"\nimport { TProjectCluster } from \"@/contexts/DevPodContext/Pro/useProjectClusters\"\n\nexport function TargetInput({\n  projectClusters,\n}: {\n  projectClusters: TProjectCluster | undefined\n}) {\n  const { register } = useFormContext<TFormValues>()\n\n  const clusters =\n    projectClusters?.runners && projectClusters.runners.length > 0\n      ? projectClusters.runners\n      : projectClusters?.clusters\n\n  return (\n    <Select {...register(FieldName.TARGET)}>\n      {clusters?.map((r, index) => (\n        <option key={index} value={r.metadata?.name}>\n          {r.spec?.displayName ?? r.metadata?.name}\n        </option>\n      ))}\n    </Select>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/SourceInput.tsx",
    "content": "import { client } from \"@/client\"\nimport { ChevronDownIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  Icon,\n  Input,\n  InputGroup,\n  InputLeftAddon,\n  Popover,\n  PopoverArrow,\n  PopoverContent,\n  PopoverTrigger,\n  Select,\n  Tab,\n  TabList,\n  TabPanels,\n  Tabs,\n  Tooltip,\n  VStack,\n  useToken,\n} from \"@chakra-ui/react\"\nimport debounce from \"lodash.debounce\"\nimport { useCallback, useMemo, useState } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { FiFolder } from \"react-icons/fi\"\nimport { FieldName, TFormValues } from \"./types\"\n\n// WARN: Make sure these match the regexes in /pkg/git/git.go\nconst GIT_REPOSITORY_PATTERN =\n  \"((?:(?:https?|git|ssh)://)?(?:[^@/\\\\n]+@)?(?:[^:/\\\\n]+)(?:[:/][^/\\\\n]+)+(?:\\\\.git)?)\"\nconst GIT_REPOSITORY_REGEX = new RegExp(GIT_REPOSITORY_PATTERN)\nconst BRANCH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@([a-zA-Z0-9\\\\./\\\\-\\\\_]+)$`)\nconst COMMIT_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@sha256:([a-zA-Z0-9]+)$`)\nconst PR_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@pull\\\\/([0-9]+)\\\\/head$`)\nconst SUBPATH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@subpath:([a-zA-Z0-9\\\\./\\\\-\\\\_]+)$`)\n\nconst AdvancedGitSetting = {\n  BRANCH: \"branch\",\n  COMMIT: \"commit\",\n  PR: \"pr\",\n  SUBPATH: \"subpath\",\n} as const\nconst ADVANCED_GIT_SETTING_TABS = [\n  AdvancedGitSetting.BRANCH,\n  AdvancedGitSetting.COMMIT,\n  AdvancedGitSetting.PR,\n  AdvancedGitSetting.SUBPATH,\n]\ntype TAdvancedGitSetting = (typeof AdvancedGitSetting)[keyof typeof AdvancedGitSetting]\nconst INITIAL_ADVANCED_SETTINGS = { option: AdvancedGitSetting.BRANCH, value: \"\" }\n\ntype TSourceInputProps = Readonly<{ isDisabled: boolean; resetPreset: VoidFunction }>\nexport function SourceInput({ isDisabled, resetPreset }: TSourceInputProps) {\n  const { register, formState, watch, setValue, trigger: validate } = useFormContext<TFormValues>()\n  const currentValue = watch(FieldName.SOURCE)\n  const sourceType = watch(FieldName.SOURCE_TYPE, \"git\")\n  const errorBorderColor = useToken(\"colors\", \"red.500\")\n  const [tabIndex, setTabIndex] = useState(0)\n  const [advancedGitSettings, setAdvancedGitSettings] =\n    useState<Readonly<{ option: TAdvancedGitSetting | null; value: string }>>(\n      INITIAL_ADVANCED_SETTINGS\n    )\n\n  const updateAdvancedGitSettings = useCallback(\n    <TKey extends keyof typeof advancedGitSettings>(\n      key: TKey,\n      val: (typeof advancedGitSettings)[TKey]\n    ) => {\n      setAdvancedGitSettings((prev) => {\n        const newSettings = { ...prev, [key]: val }\n        if (newSettings.option === prev.option && newSettings.value === prev.value) {\n          return prev\n        }\n\n        // NOTE: currentValue can be undefined\n        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n        if (newSettings.value !== \"\" && newSettings.option !== null && currentValue !== undefined) {\n          // update source\n          setValue(\n            FieldName.SOURCE,\n            appendGitSetting(currentValue, newSettings.option, newSettings.value),\n            { shouldDirty: true, shouldTouch: true, shouldValidate: true }\n          )\n          // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n        } else if (newSettings.value === \"\" && currentValue !== undefined) {\n          setValue(FieldName.SOURCE, pruneGitSettings(currentValue), {\n            shouldDirty: true,\n            shouldTouch: true,\n            shouldValidate: true,\n          })\n        }\n\n        resetPreset()\n\n        return newSettings\n      })\n    },\n    [currentValue, setValue, resetPreset]\n  )\n\n  const handleSelectFolderClicked = useCallback(async () => {\n    const selected = await client.selectFromDir()\n    if (typeof selected === \"string\") {\n      setValue(FieldName.SOURCE, selected, {\n        shouldDirty: true,\n        shouldValidate: true,\n        shouldTouch: true,\n      })\n      resetPreset()\n    }\n  }, [setValue, resetPreset])\n\n  const handleAdvancedOptionTabChanged = useCallback(\n    (index: number) => {\n      const option = ADVANCED_GIT_SETTING_TABS[index]\n      updateAdvancedGitSettings(\"option\", option as TAdvancedGitSetting)\n      setTabIndex(index)\n    },\n    [updateAdvancedGitSettings]\n  )\n\n  const handlePopoverOpened = useCallback(() => {\n    // synchronize currentValue with internal state\n    const settings = parseAdvancedSettings(currentValue)\n    if (settings.option === null) {\n      // set default\n      settings.option = INITIAL_ADVANCED_SETTINGS.option\n    }\n\n    setAdvancedGitSettings((prev) => {\n      if (settings.option === prev.option && settings.value === prev.value) {\n        return prev\n      }\n\n      return settings\n    })\n    setTabIndex(ADVANCED_GIT_SETTING_TABS.indexOf(settings.option))\n  }, [currentValue])\n\n  const hasErrors = formState.errors[FieldName.SOURCE]\n  const allowPullRequest =\n    advancedGitSettings.value.length === 0 || !isNaN(parseInt(advancedGitSettings.value))\n\n  const { placeholder, secondaryAction } = useMemo(() => {\n    if (sourceType === \"local\") {\n      return {\n        placeholder: \"/path/to/workspace\",\n        secondaryAction: (\n          <Button\n            bg=\"gray.200\"\n            _dark={{ bg: \"gray.800\" }}\n            isDisabled={isDisabled}\n            aria-invalid={hasErrors ? \"true\" : undefined}\n            _invalid={{\n              borderStyle: \"solid\",\n              borderWidth: \"1px\",\n              borderLeftWidth: 0,\n              borderColor: errorBorderColor,\n            }}\n            leftIcon={<Icon as={FiFolder} />}\n            transform=\"auto\"\n            borderTopLeftRadius={0}\n            borderBottomLeftRadius={0}\n            borderTopWidth={\"thin\"}\n            borderRightWidth={\"thin\"}\n            borderBottomWidth={\"thin\"}\n            minW=\"28\"\n            height=\"10\"\n            onClick={handleSelectFolderClicked}>\n            Browse...\n          </Button>\n        ),\n      }\n    }\n    if (sourceType === \"image\") {\n      return { placeholder: \"alpine\" }\n    }\n\n    return {\n      placeholder: \"github.com/loft-sh/devpod-example-go\",\n      secondaryAction: (\n        <Popover isLazy onOpen={handlePopoverOpened}>\n          <PopoverTrigger>\n            <Button\n              variant=\"ghost\"\n              bg=\"gray.200\"\n              borderColor=\"gray.200\"\n              _dark={{ bg: \"gray.800\", borderColor: \"gray.800\" }}\n              isDisabled={isDisabled}\n              aria-invalid={hasErrors ? \"true\" : undefined}\n              _invalid={{\n                borderStyle: \"solid\",\n                borderWidth: \"thin\",\n                borderLeftWidth: 0,\n                borderColor: errorBorderColor,\n              }}\n              leftIcon={<ChevronDownIcon boxSize={5} />}\n              transform=\"auto\"\n              borderTopLeftRadius={0}\n              borderBottomLeftRadius={0}\n              borderTopWidth={\"thin\"}\n              borderRightWidth={\"thin\"}\n              borderBottomWidth={\"thin\"}\n              minW=\"32\"\n              height=\"10\">\n              Advanced...\n            </Button>\n          </PopoverTrigger>\n          <PopoverContent width=\"auto\" padding=\"4\">\n            <PopoverArrow />\n            <VStack>\n              <Tabs\n                variant=\"muted-popover\"\n                size=\"sm\"\n                index={tabIndex}\n                onChange={handleAdvancedOptionTabChanged}>\n                <TabList>\n                  <Tab>Branch</Tab>\n                  <Tab>Commit</Tab>\n                  <Tab isDisabled={!allowPullRequest}>\n                    <Tooltip\n                      label={!allowPullRequest ? \"Pull request reference must be a number\" : \"\"}>\n                      Pull Request\n                    </Tooltip>\n                  </Tab>\n                  <Tab>Sub Folder</Tab>\n                </TabList>\n                <TabPanels paddingTop=\"2\">\n                  <Tooltip\n                    placement=\"top-start\"\n                    label={\n                      hasErrors\n                        ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n                          `Git repository \"${currentValue ?? \"\"}\" is empty or invalid`\n                        : \"\"\n                    }>\n                    <Input\n                      value={advancedGitSettings.value}\n                      isDisabled={!!hasErrors}\n                      onChange={(e) => updateAdvancedGitSettings(\"value\", e.target.value)}\n                      placeholder={getAdvancedSettingsPlaceholder(\n                        ADVANCED_GIT_SETTING_TABS[tabIndex]\n                      )}\n                    />\n                  </Tooltip>\n                </TabPanels>\n              </Tabs>\n            </VStack>\n          </PopoverContent>\n        </Popover>\n      ),\n    }\n  }, [\n    advancedGitSettings.value,\n    allowPullRequest,\n    currentValue,\n    errorBorderColor,\n    handleAdvancedOptionTabChanged,\n    handlePopoverOpened,\n    handleSelectFolderClicked,\n    hasErrors,\n    isDisabled,\n    sourceType,\n    tabIndex,\n    updateAdvancedGitSettings,\n  ])\n\n  return (\n    <InputGroup zIndex=\"docked\">\n      <InputLeftAddon padding=\"0\" h=\"10\">\n        <Select\n          {...register(FieldName.SOURCE_TYPE, {\n            onChange: () => {\n              validate(FieldName.SOURCE)\n              resetPreset()\n            },\n          })}\n          _invalid={{\n            borderStyle: \"solid\",\n            borderWidth: \"thin\",\n            borderRightWidth: 0,\n            borderColor: errorBorderColor,\n          }}\n          bg=\"gray.200\"\n          _dark={{ bg: \"gray.800\" }}\n          borderTopRightRadius=\"0\"\n          borderBottomRightRadius=\"0\"\n          focusBorderColor=\"transparent\"\n          cursor=\"pointer\"\n          w=\"full\"\n          border=\"none\">\n          <option value=\"git\">Repo</option>\n          <option value=\"local\">Local Folder</option>\n          <option value=\"image\">Image</option>\n        </Select>\n      </InputLeftAddon>\n      <Input\n        {...register(FieldName.SOURCE, {\n          validate: (value, { sourceType }) => {\n            return new Promise((res) => {\n              debounce(() => {\n                if (sourceType === \"git\") {\n                  return res(GIT_REPOSITORY_REGEX.test(value))\n                }\n\n                return res(true)\n              }, 700)()\n            })\n          },\n          onChange: () => {\n            resetPreset()\n          },\n        })}\n        _invalid={{\n          borderWidth: \"1px\",\n          borderLeftWidth: 0,\n          borderRightWidth: 0,\n          borderColor: errorBorderColor,\n        }}\n        spellCheck={false}\n        fontSize=\"md\"\n        height=\"10\"\n        type=\"text\"\n        w=\"full\"\n        placeholder={placeholder}\n        borderTopRightRadius={0}\n        borderBottomRightRadius={0}\n      />\n      {secondaryAction}\n    </InputGroup>\n  )\n}\n\nfunction appendGitSetting(\n  currentValue: string,\n  setting: TAdvancedGitSetting,\n  settingValue: string\n): string {\n  currentValue = pruneGitSettings(currentValue)\n\n  switch (setting) {\n    case AdvancedGitSetting.BRANCH:\n      return `${currentValue}@${settingValue}`\n    case AdvancedGitSetting.COMMIT:\n      return `${currentValue}@sha256:${settingValue}`\n    case AdvancedGitSetting.PR:\n      if (isNaN(parseInt(settingValue, 10))) {\n        return currentValue\n      }\n\n      return `${currentValue}@pull/${settingValue}/head`\n    case AdvancedGitSetting.SUBPATH:\n      return `${currentValue}@subpath:${settingValue}`\n  }\n}\n\nfunction pruneGitSettings(value: string): string {\n  return value\n    .replace(/\\/$/, \"\")\n    .replace(BRANCH_REGEX, \"$1\")\n    .replace(COMMIT_REGEX, \"$1\")\n    .replace(PR_REGEX, \"$1\")\n    .replace(SUBPATH_REGEX, \"$1\")\n}\n\nfunction getAdvancedSettingsPlaceholder(setting: TAdvancedGitSetting | undefined): string {\n  if (setting === undefined) {\n    return \"\"\n  }\n\n  switch (setting) {\n    case AdvancedGitSetting.BRANCH:\n      return \"Enter git branch\"\n    case AdvancedGitSetting.COMMIT:\n      return \"Enter SHA256 hash\"\n    case AdvancedGitSetting.PR:\n      return \"Enter PR reference number\"\n    case AdvancedGitSetting.SUBPATH:\n      return \"Enter sub folder path\"\n  }\n}\n\nfunction parseAdvancedSettings(value: string | undefined): {\n  option: TAdvancedGitSetting | null\n  value: string\n} {\n  if (!value) {\n    return { option: null, value: \"\" }\n  }\n\n  let matches = value.match(COMMIT_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.COMMIT, value: matches[2] }\n  }\n  matches = value.match(SUBPATH_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.SUBPATH, value: matches[2] }\n  }\n  matches = value.match(PR_REGEX)\n  if (matches && matches[2] && !isNaN(parseInt(matches[2]))) {\n    return { option: AdvancedGitSetting.PR, value: matches[2] }\n  }\n  matches = value.match(BRANCH_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.BRANCH, value: matches[2] }\n  }\n\n  // shouldn't happen\n  return { value: \"\", option: null }\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/UpdateWorkspace.tsx",
    "content": "import {\n  ProWorkspaceInstance,\n  ProWorkspaceStore,\n  useProContext,\n  useTemplates,\n  useWorkspace,\n  useWorkspaceStore,\n} from \"@/contexts\"\nimport { Failed, Result, Return } from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport jsyaml from \"js-yaml\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { CreateWorkspaceForm } from \"./CreateWorkspaceForm\"\nimport { TFormValues } from \"./types\"\nimport { Box } from \"@chakra-ui/react\"\n\ntype TUpdateWorkspaceProps = Readonly<{\n  instance: ProWorkspaceInstance\n  template: ManagementV1DevPodWorkspaceTemplate | undefined\n}>\nexport function UpdateWorkspace({ instance, template }: TUpdateWorkspaceProps) {\n  const navigate = useNavigate()\n  const workspace = useWorkspace<ProWorkspaceInstance>(instance.id)\n  const { store } = useWorkspaceStore<ProWorkspaceStore>()\n  const { host, client } = useProContext()\n  const [globalError, setGlobalError] = useState<Failed | null>(null)\n\n  const { data: templates, isLoading: isTemplatesLoading } = useTemplates()\n\n  const presets = templates?.presets\n\n  const [presetId, setPresetId] = useState<string | undefined>(instance.spec?.presetRef?.name)\n\n  useEffect(() => {\n    setPresetId(instance.spec?.presetRef?.name)\n  }, [instance.spec?.presetRef?.name])\n\n  const preset = useMemo(() => {\n    if (!presetId) {\n      return undefined\n    }\n\n    return (presets ?? []).find((p) => p.metadata?.name === presetId)\n  }, [presetId, presets])\n\n  const handleSubmit = async (values: TFormValues) => {\n    setGlobalError(null)\n\n    const res = updateWorkspaceInstance(instance, values, presetId)\n    if (res.err) {\n      setGlobalError(res.val)\n\n      return\n    }\n\n    const updateRes = await client.updateWorkspace(res.val)\n    if (updateRes.err) {\n      setGlobalError(updateRes.val)\n\n      return\n    }\n    // update workspace store immediately\n    const updatedInstance = new ProWorkspaceInstance(updateRes.val)\n    store.setWorkspace(updatedInstance.id, updatedInstance)\n\n    workspace.start({ id: updatedInstance.id, ideConfig: { name: values.defaultIDE } })\n\n    navigate(Routes.toProWorkspaceDetail(host, instance.id, \"logs\"))\n  }\n\n  const handleReset = () => {\n    setGlobalError(null)\n  }\n\n  return (\n    <Box pb=\"24\">\n      <CreateWorkspaceForm\n        instance={instance}\n        presets={presets}\n        preset={preset}\n        loading={isTemplatesLoading}\n        template={template}\n        onSubmit={handleSubmit}\n        setPreset={setPresetId}\n        onReset={handleReset}\n        error={globalError}\n      />\n    </Box>\n  )\n}\n\nfunction updateWorkspaceInstance(\n  instance: ProWorkspaceInstance,\n  values: TFormValues,\n  preset: string | undefined\n): Result<ProWorkspaceInstance> {\n  const newInstance = new ProWorkspaceInstance(instance)\n  if (!newInstance.spec) {\n    newInstance.spec = {}\n  }\n\n  // source can't be updated\n\n  // template\n  const { workspaceTemplate: template, workspaceTemplateVersion, ...parameters } = values.options\n\n  if (preset) {\n    newInstance.spec.presetRef = { name: preset }\n  } else {\n    let templateVersion = workspaceTemplateVersion\n    if (templateVersion === \"latest\") {\n      templateVersion = \"\"\n    }\n    if (\n      newInstance.spec.templateRef?.name !== template ||\n      newInstance.spec.templateRef?.version !== workspaceTemplateVersion\n    ) {\n      newInstance.spec.templateRef = {\n        name: template,\n        version: templateVersion,\n      }\n    }\n  }\n\n  // parameters\n  try {\n    const newParameters = jsyaml.dump(parameters)\n    if (newInstance.spec.parameters !== newParameters) {\n      newInstance.spec.parameters = newParameters\n    }\n  } catch (err) {\n    return Return.Failed(err as any)\n  }\n\n  // name\n  if (newInstance.spec.displayName !== values.name) {\n    newInstance.spec.displayName = values.name\n  }\n\n  // devcontainer.json can't be updated\n\n  return Return.Value(newInstance)\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/index.ts",
    "content": "export { CreateWorkspace } from \"./CreateWorkspace\"\nexport { UpdateWorkspace } from \"./UpdateWorkspace\"\n"
  },
  {
    "path": "desktop/src/views/Pro/CreateWorkspace/types.ts",
    "content": "import { TWorkspaceSourceType } from \"@/types\"\n\nexport const FieldName = {\n  SOURCE: \"source\",\n  SOURCE_TYPE: \"sourceType\",\n  NAME: \"name\",\n  DEFAULT_IDE: \"defaultIDE\",\n  TARGET: \"target\",\n  DEVCONTAINER_JSON: \"devcontainerJSON\",\n  ENV_TEMPLATE_VERSION: \"envTemplateVersion\",\n  DEVCONTAINER_TYPE: \"devcontainerType\",\n  OPTIONS: \"options\",\n} as const\n\nexport type TFormValues = {\n  [FieldName.SOURCE]: string\n  [FieldName.SOURCE_TYPE]: TWorkspaceSourceType\n  [FieldName.DEFAULT_IDE]: string\n  [FieldName.NAME]: string\n  [FieldName.DEVCONTAINER_JSON]: string\n  [FieldName.TARGET]: TTarget\n  [FieldName.ENV_TEMPLATE_VERSION]: string\n  [FieldName.DEVCONTAINER_TYPE]: TDevContainerType\n  [FieldName.OPTIONS]: TOptions\n}\n\ntype TTarget = string // either runner or cluster, depending on provider\ntype TOptions = {\n  workspaceTemplate?: string\n  workspaceTemplateVersion?: string\n  [key: string]: string | boolean | number | Record<string, unknown> | undefined\n}\n\nexport type TDevContainerType = \"path\" | \"external\"\n"
  },
  {
    "path": "desktop/src/views/Pro/Credentials/AddGitHTTPCredentials.tsx",
    "content": "import { client as globalClient } from \"@/client\"\nimport { DaemonClient } from \"@/client/pro/client\"\nimport { Form } from \"@/components\"\nimport { useProContext } from \"@/contexts\"\nimport { CheckCircle, Form as FormIcon } from \"@/icons\"\nimport { exists, useFormErrors } from \"@/lib\"\nimport { TGitCredentialData } from \"@/types\"\nimport { QuestionIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  Divider,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Grid,\n  HStack,\n  Input,\n  Link,\n  Text,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { ReactNode, useState } from \"react\"\nimport { FieldError, SubmitHandler, useForm } from \"react-hook-form\"\n\ntype TFormValues = {\n  [FieldName.NAME]: string\n  [FieldName.TYPE]: string\n  [FieldName.HOST]: string | undefined\n  [FieldName.PATH]: string | undefined\n  [FieldName.USERNAME]: string | undefined\n  [FieldName.TOKEN]: string | undefined\n}\nconst FieldName = {\n  NAME: \"name\",\n  TYPE: \"type\",\n  HOST: \"host\",\n  PATH: \"path\",\n  USERNAME: \"username\",\n  TOKEN: \"token\",\n} as const\ntype TCreateGitHTTPCredentialsProps = Readonly<{\n  isDisabled: boolean\n  onCreate(name: string | undefined, data: TGitCredentialData): void\n}>\nexport function AddGitHTTPCredentials({ isDisabled, onCreate }: TCreateGitHTTPCredentialsProps) {\n  const { client } = useProContext()\n  const { handleSubmit, formState, register, setValue } = useForm<TFormValues>({\n    mode: \"onBlur\",\n  })\n  const errors = useFormErrors(Object.values(FieldName), formState)\n  const [hostQuery, setHostQuery] = useState(\"\")\n\n  const credentialsQuery = useQuery({\n    // eslint-disable-next-line @tanstack/query/exhaustive-deps\n    queryKey: [\"git-credentials\", hostQuery],\n    queryFn: async () => {\n      const res = await (client as DaemonClient).queryGitCredentialsHelper(hostQuery)\n      if (!res.ok) {\n        return null\n      }\n      if (!res.val) {\n        return null\n      }\n\n      return res.val\n    },\n    enabled: hostQuery.length > 0,\n  })\n\n  const onSubmit: SubmitHandler<TFormValues> = (data) => {\n    onCreate(data[FieldName.NAME], {\n      host: data[FieldName.HOST]!,\n      password: data[FieldName.TOKEN]!,\n      user: data[FieldName.USERNAME]!,\n      path: data[FieldName.PATH],\n    })\n  }\n\n  const handleFillClicked = () => {\n    const data = credentialsQuery.data\n    if (!data) {\n      return\n    }\n\n    setValue(FieldName.HOST, data.host)\n    setValue(FieldName.TOKEN, data.password)\n    if (data.username) {\n      setValue(FieldName.USERNAME, data.username)\n    }\n    if (data.path) {\n      setValue(FieldName.PATH, data.path)\n    }\n    setHostQuery(\"\")\n  }\n\n  return (\n    <Form paddingX=\"4\" paddingTop=\"4\" onSubmit={handleSubmit(onSubmit)}>\n      <VStack gap=\"6\" align=\"start\">\n        <VStack w=\"full\" align=\"start\">\n          <Input\n            type=\"text\"\n            value={hostQuery}\n            placeholder=\"Query your local git credentials by host, i.e. github.com\"\n            onChange={(e) => setHostQuery(e.target.value)}\n          />\n          {credentialsQuery.data ? (\n            <HStack alignItems={\"center\"}>\n              <CheckCircle boxSize={5} color=\"green.500\" />\n              <Text variant=\"muted\" fontSize=\"sm\">\n                Found git credentials locally\n              </Text>\n              <Button\n                variant=\"outline\"\n                size=\"xs\"\n                leftIcon={<FormIcon boxSize={4} />}\n                onClick={handleFillClicked}>\n                Fill in\n              </Button>\n            </HStack>\n          ) : (\n            <HStack alignItems={\"center\"}>\n              <QuestionIcon boxSize={4} color=\"gray.500\" />\n              <Text variant=\"muted\" fontSize=\"sm\">\n                No credentials for host <q>{hostQuery}</q> found locally\n              </Text>\n            </HStack>\n          )}\n        </VStack>\n\n        <Divider my=\"4\" />\n\n        <FormSection\n          isDisabled={isDisabled}\n          description=\"Set the git provider host, i.e. github.com\"\n          label=\"Host\"\n          error={errors.hostError}>\n          <Input\n            spellCheck={false}\n            placeholder=\"github.com\"\n            type=\"text\"\n            {...register(FieldName.HOST)}\n          />\n        </FormSection>\n\n        <FormSection\n          isDisabled={isDisabled}\n          description=\"Set the git user\"\n          label=\"User\"\n          error={errors.usernameError}>\n          <Input\n            spellCheck={false}\n            placeholder=\"myuser\"\n            type=\"text\"\n            {...register(FieldName.USERNAME)}\n          />\n        </FormSection>\n\n        <FormSection\n          isDisabled={isDisabled}\n          description=\"Set the personal access token\"\n          label=\"Token\"\n          error={errors.tokenError}>\n          <Input\n            spellCheck={false}\n            placeholder=\"PAT\"\n            type=\"password\"\n            {...register(FieldName.TOKEN)}\n          />\n        </FormSection>\n\n        <FormSection\n          isDisabled={isDisabled}\n          isRequired={false}\n          description={\n            <Text variant=\"\">\n              Optionally set the httpPath for the host. This is most commonly required by Azure\n              DevOps. If you&apos;re not sure if you need this, leave it empty. Read more in the{\" \"}\n              <Link\n                onClick={() =>\n                  globalClient.open(\n                    \"https://git-scm.com/docs/gitcredentials#Documentation/gitcredentials.txt-useHttpPath\"\n                  )\n                }>\n                git documentation\n              </Link>\n            </Text>\n          }\n          label=\"Path\"\n          error={errors.pathError}>\n          <Input spellCheck={false} placeholder=\"/\" type=\"text\" {...register(FieldName.PATH)} />\n        </FormSection>\n\n        <FormSection\n          isDisabled={isDisabled}\n          isRequired={false}\n          description=\"Optionally give your credential a name. Leave it empty to generate a random name\"\n          label=\"Name\"\n          error={errors.nameError}>\n          <Input\n            spellCheck={false}\n            placeholder=\"pat\"\n            type=\"text\"\n            {...register(FieldName.NAME, {\n              validate: (value) => {\n                if (!value) {\n                  return \"Name is required\"\n                }\n\n                if (!/^[a-z][a-z0-9-_]*$/.test(value)) {\n                  return \"Name can only contain lowercase letters, numbers, - and _\"\n                }\n\n                return undefined\n              },\n            })}\n          />\n        </FormSection>\n      </VStack>\n\n      <Button\n        mt=\"4\"\n        alignSelf={\"end\"}\n        w=\"fit-content\"\n        type=\"submit\"\n        variant=\"primary\"\n        isLoading={formState.isSubmitting || isDisabled}\n        isDisabled={!formState.isValid}\n        title=\"Login\">\n        Add Token\n      </Button>\n    </Form>\n  )\n}\n\ntype TFormSectionProps = Readonly<{\n  label: string\n  description: ReactNode\n  error: FieldError | undefined\n  isDisabled: boolean\n  isRequired?: boolean\n  children: ReactNode\n}>\nfunction FormSection({\n  label,\n  description,\n  error,\n  isDisabled,\n  isRequired = true,\n  children,\n}: TFormSectionProps) {\n  return (\n    <FormControl isRequired={isRequired} isInvalid={exists(error)} isDisabled={isDisabled}>\n      <Grid gridTemplateColumns=\"20rem 1fr\" columnGap=\"10\" width=\"full\">\n        <VStack align=\"start\" justifyContent={\"start\"} gap=\"0\">\n          <FormLabel mb=\"0\">{label}</FormLabel>\n          <FormHelperText mt=\"1\">{description}</FormHelperText>\n          {exists(error) && <FormErrorMessage>{error.message ?? \"Error\"}</FormErrorMessage>}\n        </VStack>\n\n        {children}\n      </Grid>\n    </FormControl>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Credentials/AddGitSSHCredentials.tsx",
    "content": "import { Form } from \"@/components\"\nimport { exists, useFormErrors } from \"@/lib\"\nimport { TGitCredentialData } from \"@/types\"\nimport {\n  Button,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Grid,\n  Input,\n  Textarea,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { ReactNode } from \"react\"\nimport { FieldError, SubmitHandler, useForm } from \"react-hook-form\"\nimport { client as globalClient } from \"../../../client\"\nimport { File } from \"@/icons\"\n\ntype TFormValues = {\n  [FieldName.NAME]: string\n  [FieldName.KEY]: string\n}\nconst FieldName = {\n  NAME: \"name\",\n  KEY: \"key\",\n} as const\ntype TAddGitSSHCredentialsProps = Readonly<{\n  isDisabled: boolean\n  onCreate(name: string | undefined, data: TGitCredentialData): void\n}>\nexport function AddGitSSHCredentials({ isDisabled, onCreate }: TAddGitSSHCredentialsProps) {\n  const { handleSubmit, formState, register, setValue } = useForm<TFormValues>({\n    mode: \"onBlur\",\n  })\n  const errors = useFormErrors(Object.values(FieldName), formState)\n\n  const onSubmit: SubmitHandler<TFormValues> = (data) => {\n    try {\n      const privateKey = data[FieldName.KEY]\n      const privateKeyBase64 = window.btoa(privateKey)\n      onCreate(data[FieldName.NAME], {\n        key: privateKeyBase64,\n      })\n    } catch {\n      // noop, shouldn't happen\n    }\n  }\n\n  const handleSelectFileKeyClicked = async () => {\n    try {\n      const sshDir = await globalClient.getDir(\"SSH\")\n      const fileName = await globalClient.selectFile(sshDir)\n      if (!fileName || Array.isArray(fileName)) {\n        return\n      }\n\n      const privateKeyRaw = await globalClient.readFile([fileName])\n      const privateKey = new TextDecoder().decode(privateKeyRaw)\n      setValue(FieldName.KEY, privateKey)\n    } catch {\n      // noop\n    }\n  }\n\n  return (\n    <Form paddingX=\"4\" paddingTop=\"4\" onSubmit={handleSubmit(onSubmit)}>\n      <VStack gap=\"6\">\n        <FormSection\n          isDisabled={isDisabled}\n          description=\"The private key to authenticate against a git provider\"\n          label=\"Private Key\"\n          error={errors.keyError}>\n          <VStack>\n            <Textarea\n              variant=\"outline\"\n              minH=\"32\"\n              spellCheck={false}\n              placeholder={`-----BEGIN OPENSSH PRIVATE KEY-----\n              ...\n-----END OPENSSH PRIVATE KEY-----\n              `}\n              {...register(FieldName.KEY)}\n            />\n            <Button\n              alignSelf=\"flex-end\"\n              isDisabled={isDisabled}\n              leftIcon={<File boxSize={4} />}\n              onClick={handleSelectFileKeyClicked}>\n              Upload from file\n            </Button>\n          </VStack>\n        </FormSection>\n\n        <FormSection\n          isDisabled={isDisabled}\n          isRequired={false}\n          description=\"Optionally give your credential a name. Leave it empty to generate a random name\"\n          label=\"Name\"\n          error={errors.nameError}>\n          <Input\n            spellCheck={false}\n            placeholder=\"git-private-key\"\n            type=\"text\"\n            {...register(FieldName.NAME, {\n              validate: (value) => {\n                if (!value) {\n                  return \"Name is required\"\n                }\n\n                if (!/^[a-z][a-z0-9-_]*$/.test(value)) {\n                  return \"Name can only contain lowercase letters, numbers, - and _\"\n                }\n\n                return undefined\n              },\n            })}\n          />\n        </FormSection>\n      </VStack>\n\n      <Button\n        mt=\"4\"\n        alignSelf={\"end\"}\n        w=\"fit-content\"\n        type=\"submit\"\n        variant=\"primary\"\n        isLoading={formState.isSubmitting || isDisabled}\n        isDisabled={!formState.isValid}\n        title=\"Login\">\n        Add Key\n      </Button>\n    </Form>\n  )\n}\n\ntype TFormSectionProps = Readonly<{\n  label: string\n  description: string\n  error: FieldError | undefined\n  isDisabled: boolean\n  isRequired?: boolean\n  children: ReactNode\n}>\nfunction FormSection({\n  label,\n  description,\n  error,\n  isDisabled,\n  isRequired = true,\n  children,\n}: TFormSectionProps) {\n  return (\n    <FormControl isRequired={isRequired} isInvalid={exists(error)} isDisabled={isDisabled}>\n      <Grid gridTemplateColumns=\"20rem 1fr\" columnGap=\"10\" width=\"full\">\n        <VStack align=\"start\" justifyContent={\"start\"} gap=\"0\">\n          <FormLabel mb=\"0\">{label}</FormLabel>\n          <FormHelperText mt=\"1\">{description}</FormHelperText>\n          {exists(error) && <FormErrorMessage>{error.message ?? \"Error\"}</FormErrorMessage>}\n        </VStack>\n\n        {children}\n      </Grid>\n    </FormControl>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Credentials/Credentials.tsx",
    "content": "import { DaemonClient } from \"@/client/pro/client\"\nimport { ErrorMessageBox } from \"@/components\"\nimport { useProContext } from \"@/contexts\"\nimport { LockDuotone, Trash } from \"@/icons\"\nimport EmptyImage from \"@/images/empty_default.svg\"\nimport EmptyDarkImage from \"@/images/empty_default_dark.svg\"\nimport { deepCopy } from \"@/lib\"\nimport { randomWords } from \"@/lib/randomWords\"\nimport { QueryKeys } from \"@/queryKeys\"\nimport { TGitCredentialData, TUserSecretType, UserSecret } from \"@/types\"\nimport {\n  Button,\n  HStack,\n  Heading,\n  IconButton,\n  Image,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalHeader,\n  ModalOverlay,\n  Skeleton,\n  Tab,\n  TabList,\n  TabPanel,\n  TabPanels,\n  Table,\n  TableContainer,\n  Tabs,\n  Tag,\n  Tbody,\n  Td,\n  Text,\n  Th,\n  Thead,\n  Tooltip,\n  Tr,\n  VStack,\n  useColorMode,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { ManagementV1UserProfile } from \"@loft-enterprise/client/gen/models/managementV1UserProfile\"\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useCallback, useMemo } from \"react\"\nimport { BackToWorkspaces } from \"../BackToWorkspaces\"\nimport { AddGitHTTPCredentials } from \"./AddGitHTTPCredentials\"\nimport { AddGitSSHCredentials } from \"./AddGitSSHCredentials\"\n\nexport function Credentials() {\n  const queryClient = useQueryClient()\n  const { client, managementSelfQuery: s } = useProContext()\n  const { data: userProfile, isLoading } = useQuery({\n    queryKey: QueryKeys.userProfile(s.data?.status?.user?.name),\n    queryFn: async () => {\n      return (await (client as DaemonClient).getUserProfile()).unwrap()\n    },\n  })\n  const { colorMode } = useColorMode()\n  const { modal, show } = useCreateCredentialModal(userProfile, s.data?.status?.user?.name)\n  const secrets = Object.entries(userProfile?.secrets ?? {})\n\n  const deleteSecret = useMutation({\n    mutationFn: async ({ name }: Readonly<{ name: string }>) => {\n      const newSecrets = deepCopy(userProfile?.secrets)\n      delete newSecrets?.[name]\n\n      return (\n        await (client as DaemonClient).updateUserProfile({ ...userProfile, secrets: newSecrets })\n      ).unwrap()\n    },\n    onSuccess: (newData) => {\n      // optimistic update\n      queryClient.setQueryData(QueryKeys.userProfile(s.data?.status?.user?.name), newData)\n      queryClient.invalidateQueries(QueryKeys.userProfile(s.data?.status?.user?.name))\n    },\n  })\n\n  return (\n    <>\n      <VStack align=\"start\">\n        <BackToWorkspaces />\n        <HStack align=\"center\" justify=\"space-between\" mb=\"2\" w=\"full\">\n          <Heading fontWeight=\"thin\">Credentials</Heading>\n          <Button\n            variant=\"outline\"\n            colorScheme=\"primary\"\n            leftIcon={<LockDuotone boxSize={5} />}\n            onClick={show}>\n            Add Credentials\n          </Button>\n        </HStack>\n        <Text my=\"4\" variant=\"muted\">\n          Credentials connect DevPod Pro to one or multiple of your git providers. You can upload\n          both HTTPS tokens and SSH private keys.\n        </Text>\n        {isLoading ? (\n          <Table>\n            <Thead>\n              <Tr>\n                <Th>\n                  <Skeleton h=\"5\" w=\"36\" />\n                </Th>\n                <Th>\n                  <Skeleton h=\"5\" w=\"24\" />\n                </Th>\n              </Tr>\n            </Thead>\n            <Tbody>\n              {[...Array(3)].map((_, i) => (\n                <Tr key={i}>\n                  <Td>\n                    <Skeleton h=\"5\" w=\"48\" />\n                  </Td>\n                  <Td>\n                    <Skeleton h=\"5\" w=\"32\" />\n                  </Td>\n                </Tr>\n              ))}\n            </Tbody>\n          </Table>\n        ) : secrets.length === 0 ? (\n          <VStack\n            h={\"full\"}\n            w={\"full\"}\n            justifyContent={\"center\"}\n            alignItems={\"center\"}\n            flexGrow={1}\n            my=\"8\">\n            <Image src={colorMode === \"dark\" ? EmptyDarkImage : EmptyImage} />\n            <Text variant=\"muted\" fontWeight={\"semibold\"} fontSize={\"sm\"}>\n              No credentials found\n            </Text>\n          </VStack>\n        ) : (\n          <TableContainer w=\"full\">\n            <Table size=\"sm\">\n              <Thead w=\"full\">\n                <Tr>\n                  <Th>Name</Th>\n                  <Th>Type</Th>\n                  <Th>Host</Th>\n                  <Th>User</Th>\n                  <Th />\n                </Tr>\n              </Thead>\n              <Tbody>\n                {secrets.map(([name, secret]) => {\n                  let gitData = {} as TGitCredentialData\n                  try {\n                    gitData = JSON.parse(secret.data ?? \"\") as TGitCredentialData\n                  } catch {\n                    // noop\n                  }\n\n                  return (\n                    <Tr key={name}>\n                      <Td>{name}</Td>\n                      <Td>\n                        <SecretTypeTag type={secret.type} />\n                      </Td>\n                      <Td>{gitData.host}</Td>\n                      <Td>{gitData.user}</Td>\n                      <Td textAlign=\"end\">\n                        <Tooltip label=\"Delete secret\">\n                          <IconButton\n                            ml=\"auto\"\n                            aria-label=\"Delete secret\"\n                            icon={<Trash boxSize={5} />}\n                            variant=\"ghost\"\n                            size=\"sm\"\n                            colorScheme=\"red\"\n                            onClick={() => deleteSecret.mutate({ name })}\n                          />\n                        </Tooltip>\n                      </Td>\n                    </Tr>\n                  )\n                })}\n              </Tbody>\n            </Table>\n          </TableContainer>\n        )}\n      </VStack>\n\n      {modal}\n    </>\n  )\n}\n\ntype TSecretTypeTagProps = Readonly<{ type: string | undefined }>\nfunction SecretTypeTag({ type }: TSecretTypeTagProps) {\n  const displayName = useMemo(() => {\n    if (type === UserSecret.GIT_HTTP) {\n      return \"https\"\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n    if (type === UserSecret.GIT_SSH) {\n      return \"ssh\"\n    }\n\n    return \"\"\n  }, [type])\n\n  return <Tag>{displayName}</Tag>\n}\n\nfunction useCreateCredentialModal(\n  userProfile: ManagementV1UserProfile | undefined,\n  userName: string | undefined\n) {\n  const queryClient = useQueryClient()\n  const { client } = useProContext()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const addCredentials = useMutation({\n    mutationFn: async ({\n      newCredentials,\n      name,\n      type,\n    }: Readonly<{ name: string; type: TUserSecretType; newCredentials: TGitCredentialData }>) => {\n      return (\n        await (client as DaemonClient).updateUserProfile({\n          ...userProfile,\n          secrets: {\n            ...userProfile?.secrets,\n            [name]: {\n              type,\n              data: JSON.stringify(newCredentials),\n            },\n          },\n        })\n      ).unwrap()\n    },\n  })\n  const areInputsDisabled = useMemo(\n    () => addCredentials.status === \"success\" || addCredentials.status === \"loading\",\n    [addCredentials.status]\n  )\n\n  const handleAddCredentials = useCallback(\n    (type: TUserSecretType) => (name: string | undefined, data: TGitCredentialData) => {\n      if (!name) {\n        name = randomWords({ amount: 2, maxLength: 40 }).join(\"-\")\n      }\n      addCredentials.mutate(\n        { name, type, newCredentials: data },\n        {\n          onSuccess: () => {\n            queryClient.invalidateQueries(QueryKeys.userProfile(userName))\n            onClose()\n          },\n        }\n      )\n    },\n    [addCredentials, onClose, queryClient, userName]\n  )\n\n  const modal = useMemo(() => {\n    return (\n      <Modal\n        onClose={onClose}\n        isOpen={isOpen}\n        isCentered\n        size=\"4xl\"\n        scrollBehavior=\"inside\"\n        closeOnEsc\n        closeOnOverlayClick>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalCloseButton />\n          <ModalHeader>Add New Credentials</ModalHeader>\n          <ModalBody borderRadius={\"md\"}>\n            <Tabs colorScheme=\"gray\">\n              <TabList>\n                <Tab>SSH</Tab>\n                <Tab>HTTPS</Tab>\n              </TabList>\n              <TabPanels paddingTop=\"2\">\n                <TabPanel>\n                  {addCredentials.error ? (\n                    <ErrorMessageBox ml=\"4\" error={Error(addCredentials.error as any)} />\n                  ) : null}\n                  <AddGitSSHCredentials\n                    isDisabled={areInputsDisabled}\n                    onCreate={handleAddCredentials(UserSecret.GIT_SSH)}\n                  />\n                </TabPanel>\n                <TabPanel>\n                  {addCredentials.error ? (\n                    <ErrorMessageBox error={Error(addCredentials.error as any)} />\n                  ) : null}\n                  <AddGitHTTPCredentials\n                    isDisabled={areInputsDisabled}\n                    onCreate={handleAddCredentials(UserSecret.GIT_HTTP)}\n                  />\n                </TabPanel>\n              </TabPanels>\n            </Tabs>\n          </ModalBody>\n        </ModalContent>\n      </Modal>\n    )\n  }, [addCredentials.error, areInputsDisabled, handleAddCredentials, isOpen, onClose])\n\n  const show = useCallback(() => {\n    onOpen()\n  }, [onOpen])\n\n  return { modal, show }\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Credentials/index.ts",
    "content": "export { Credentials } from \"./Credentials\"\n"
  },
  {
    "path": "desktop/src/views/Pro/ListWorkspaces.tsx",
    "content": "import { TWorkspaceStatusFilterState, WorkspaceSorter, WorkspaceStatusFilter } from \"@/components\"\nimport { DeleteWorkspacesModal } from \"@/components/DeleteWorkspacesModal\"\nimport { WorkspaceListSelection } from \"@/components/ListSelection\"\nimport { WorkspaceOwnerFilter } from \"@/components/WorkspaceOwnerFilter\"\nimport {\n  ProWorkspaceInstance,\n  useProContext,\n  useTemplates,\n  useWorkspaceStore,\n  useWorkspaces,\n} from \"@/contexts\"\nimport { IWorkspaceStore } from \"@/contexts/DevPodContext/workspaceStore\"\nimport { removeWorkspaceAction, stopWorkspaceAction } from \"@/contexts/DevPodContext/workspaces\"\nimport { DevPodIcon } from \"@/icons\"\nimport EmptyImage from \"@/images/empty_default.svg\"\nimport EmptyDarkImage from \"@/images/empty_default.svg\"\nimport EmptyWorkspacesImage from \"@/images/empty_workspaces.svg\"\nimport EmptyDarkWorkspacesImage from \"@/images/empty_workspaces_dark.svg\"\nimport {\n  DEFAULT_SORT_WORKSPACE_MODE,\n  useSelection,\n  useSortProWorkspaces,\n  useStopWorkspaceModal,\n} from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport {\n  Button,\n  Container,\n  HStack,\n  Heading,\n  Image,\n  List,\n  ListItem,\n  Skeleton,\n  Text,\n  VStack,\n  useColorMode,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { ManagementV1Self } from \"@loft-enterprise/client/gen/models/managementV1Self\"\nimport { useCallback, useEffect, useId, useMemo, useState } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { WorkspaceInstanceCard } from \"./Workspace\"\nimport { determineDisplayStatus } from \"./Workspace/status\"\n\nexport function ListWorkspaces() {\n  const { store } = useWorkspaceStore<IWorkspaceStore<string, ProWorkspaceInstance>>()\n  const instances = useWorkspaces<ProWorkspaceInstance>()\n  const viewID = useId()\n  const { host, isLoadingWorkspaces, managementSelfQuery, ownerFilter, setOwnerFilter } =\n    useProContext()\n  const navigate = useNavigate()\n  const { data: templates } = useTemplates()\n  const { colorMode } = useColorMode()\n\n  const [statusFilter, setStatusFilter] = useState<TWorkspaceStatusFilterState>(\"all\")\n\n  const filteredWorkspaces = useMemo(() => {\n    let retInstances = instances\n\n    // owner filter\n    if (ownerFilter == \"self\") {\n      retInstances = retInstances.filter((i) => isOwner(i, managementSelfQuery.data))\n    }\n\n    // status filter\n    if (statusFilter != \"all\") {\n      retInstances = retInstances.filter((i) =>\n        statusFilter.includes(determineDisplayStatus(i.status, i.metadata?.deletionTimestamp))\n      )\n    }\n\n    return retInstances\n  }, [instances, managementSelfQuery.data, ownerFilter, statusFilter])\n\n  const [selectedSortOption, setSelectedSortOption] = useState(DEFAULT_SORT_WORKSPACE_MODE)\n  const sortedWorkspaces = useSortProWorkspaces(filteredWorkspaces, selectedSortOption)\n\n  const selection = useSelection()\n\n  const { isOpen: isDeleteOpen, onOpen: openDeleteModal, onClose: onDeleteClose } = useDisclosure()\n\n  const instanceIDs = useMemo(() => {\n    return (sortedWorkspaces ?? []).map((i) => i.id)\n  }, [sortedWorkspaces])\n\n  useEffect(() => {\n    selection.prune(instanceIDs)\n  }, [instanceIDs, selection])\n\n  const handleDeleteAllClicked = useCallback(() => {\n    const allSelected = instances.filter((workspace) => selection.has(workspace.id))\n    for (const w of allSelected) {\n      removeWorkspaceAction({\n        workspaceID: w.id,\n        streamID: viewID,\n        force: true,\n        store,\n      })\n    }\n    selection.clear()\n  }, [selection, instances, viewID, store])\n\n  const stopAll = useCallback(() => {\n    const allSelected = instances.filter((workspace) => selection.has(workspace.id))\n    for (const w of allSelected) {\n      stopWorkspaceAction({\n        workspaceID: w.id,\n        streamID: viewID,\n        store,\n      })\n    }\n\n    selection.clear()\n  }, [instances, selection, store, viewID])\n\n  const handleSelectAllClicked = useCallback(() => {\n    selection.toggleSelectAll(instanceIDs)\n  }, [instanceIDs, selection])\n\n  const handleCreateClicked = useCallback(() => {\n    if (templates?.presets.length) {\n      navigate(Routes.toProSelectPreset(host))\n    } else {\n      navigate(Routes.toProWorkspaceCreate(host))\n    }\n  }, [navigate, templates, host])\n\n  const { modal: stopModal, open: openStopModal } = useStopWorkspaceModal(\n    useCallback(\n      (close) => {\n        stopAll()\n        close()\n      },\n      [stopAll]\n    )\n  )\n\n  const handleStopAllClicked = useCallback(() => {\n    const nonRunningWorkspace = instances.find(\n      (i) => selection.has(i.id) && i.status?.lastWorkspaceStatus !== \"Running\"\n    )\n\n    if (nonRunningWorkspace) {\n      openStopModal()\n    } else {\n      stopAll()\n    }\n  }, [stopAll, openStopModal, instances, selection])\n\n  const hasWorkspaces = instances.length > 0\n\n  return (\n    <>\n      <VStack align=\"start\" gap=\"4\" w=\"full\" h=\"full\">\n        <HStack align=\"center\" justify=\"space-between\" mb=\"8\" w=\"full\">\n          <Heading fontWeight=\"thin\">Workspaces</Heading>\n          <Button\n            variant=\"outline\"\n            colorScheme=\"primary\"\n            leftIcon={<DevPodIcon boxSize={5} />}\n            onClick={handleCreateClicked}>\n            Create Workspace\n          </Button>\n        </HStack>\n        <HStack align={\"center\"} justify={\"space-between\"} w={\"full\"}>\n          <WorkspaceListSelection\n            totalAmount={filteredWorkspaces.length}\n            selectionAmount={selection.size}\n            handleSelectAllClicked={handleSelectAllClicked}\n            handleStopAllClicked={handleStopAllClicked}\n            handleDeleteClicked={openDeleteModal}\n          />\n          <HStack align={\"center\"}>\n            <WorkspaceOwnerFilter ownerFilter={ownerFilter} setOwnerFilter={setOwnerFilter} />\n            <WorkspaceStatusFilter\n              variant={\"pro\"}\n              statusFilter={statusFilter}\n              setStatusFilter={setStatusFilter}\n            />\n            <WorkspaceSorter sortMode={selectedSortOption} setSortMode={setSelectedSortOption} />\n          </HStack>\n        </HStack>\n        {hasWorkspaces ? (\n          <List w=\"full\" h={\"full\"} mb=\"4\">\n            {!sortedWorkspaces?.length && (\n              <VStack\n                w={\"full\"}\n                h={\"full\"}\n                justifyContent={\"center\"}\n                alignItems={\"center\"}\n                flexGrow={1}>\n                <Image src={colorMode == \"dark\" ? EmptyDarkImage : EmptyImage} />\n                <Text fontWeight={\"semibold\"} fontSize={\"sm\"} color={\"text.secondary\"}>\n                  No items found\n                </Text>\n              </VStack>\n            )}\n            {sortedWorkspaces?.map((instance) => (\n              <ListItem key={instance.id}>\n                <WorkspaceInstanceCard\n                  host={host}\n                  isSelected={selection.has(instance.id)}\n                  onSelectionChange={(isSelected) => selection.setSelected(instance.id, isSelected)}\n                  instanceName={instance.id}\n                />\n              </ListItem>\n            ))}\n          </List>\n        ) : isLoadingWorkspaces ? (\n          <VStack w=\"full\" h=\"full\" gap=\"4\" flexFlow=\"column nowrap\">\n            <Skeleton w=\"full\" h=\"40\" speed={1} />\n            <Skeleton w=\"full\" h=\"40\" speed={1} />\n            <Skeleton w=\"full\" h=\"40\" speed={1} />\n          </VStack>\n        ) : (\n          <Container maxW=\"container.lg\" h=\"full\">\n            <VStack align=\"center\" justify=\"start\" w=\"full\" h=\"full\">\n              <Image\n                src={colorMode === \"dark\" ? EmptyDarkWorkspacesImage : EmptyWorkspacesImage}\n                w=\"100%\"\n                h=\"30vh\"\n                my=\"12\"\n              />\n\n              <Button\n                variant=\"primary\"\n                leftIcon={<DevPodIcon boxSize={5} />}\n                onClick={handleCreateClicked}>\n                Create Workspace\n              </Button>\n            </VStack>\n          </Container>\n        )}\n      </VStack>\n\n      <DeleteWorkspacesModal\n        pro\n        isOpen={isDeleteOpen}\n        onCloseRequested={onDeleteClose}\n        onDeleteRequested={handleDeleteAllClicked}\n        amount={selection.size}\n      />\n\n      {stopModal}\n    </>\n  )\n}\n\nfunction isOwner(instance: ProWorkspaceInstance, self: ManagementV1Self | undefined): boolean {\n  if (!self) {\n    return false\n  }\n\n  if (!instance.spec?.owner) {\n    return false\n  }\n\n  const owner = instance.spec.owner\n  if (self.status?.user?.name == owner.user) {\n    return true\n  }\n  if (owner.team && self.status?.user?.teams?.find((team) => team.name == owner.team)) {\n    return true\n  }\n\n  return false\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/ProInstance.tsx",
    "content": "import { useAppReady } from \"@/App/useAppReady\"\nimport { useProContext, useProInstances } from \"@/contexts\"\nimport { DevPodIcon } from \"@/icons\"\nimport disconnectedImage from \"@/images/disconnected.svg\"\nimport disconnectedDarkImage from \"@/images/disconnected_dark.svg\"\nimport { hasCapability, useConnectionStatus, useReLoginProModal } from \"@/lib\"\nimport { Button, Container, Heading, Image, VStack, useColorMode } from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\nimport { Outlet } from \"react-router-dom\"\n\nexport function ProInstance() {\n  const connectionStatus = useConnectionStatus()\n  const { host } = useProContext()\n  const { errorModal, changelogModal, proLoginModal } = useAppReady()\n  const [[proInstances]] = useProInstances()\n  const proInstance = useMemo(() => {\n    return proInstances?.find((proInstance) => proInstance.host === host)\n  }, [host, proInstances])\n  const { modal: reLoginProModal, handleOpenLogin: handleReLoginClicked } = useReLoginProModal()\n  const { colorMode } = useColorMode()\n\n  const loginContent = (\n    <Container maxW=\"container.lg\" h=\"full\">\n      <VStack align=\"center\" justify=\"center\" w=\"full\" h=\"full\">\n        <Image\n          src={colorMode == \"dark\" ? disconnectedDarkImage : disconnectedImage}\n          w=\"100%\"\n          h=\"40vh\"\n        />\n\n        <Heading fontWeight=\"thin\" mb=\"4\" color=\"gray.600\">\n          You&apos;ve been logged out\n        </Heading>\n        <Button\n          variant=\"primary\"\n          leftIcon={<DevPodIcon boxSize={5} />}\n          onClick={() => handleReLoginClicked({ host })}>\n          Log In\n        </Button>\n      </VStack>\n      {reLoginProModal}\n    </Container>\n  )\n\n  if (hasCapability(proInstance, \"daemon\")) {\n    if (connectionStatus.loginRequired) {\n      // we are not logged in, so we show the login content\n      return loginContent\n    }\n  } else if (\n    !hasCapability(proInstance, \"daemon\") &&\n    proInstance?.authenticated === false &&\n    connectionStatus.healthy\n  ) {\n    // TODO: This branch can be deprecated after removing proxy provider\n    return loginContent\n  }\n\n  return (\n    <>\n      <Outlet />\n\n      {errorModal}\n      {changelogModal}\n      {proLoginModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Profile.tsx",
    "content": "import { HStack, Heading, VStack } from \"@chakra-ui/react\"\nimport { BackToWorkspaces } from \"./BackToWorkspaces\"\n\nexport function Profile() {\n  return (\n    <VStack align=\"start\">\n      <BackToWorkspaces />\n      <HStack align=\"center\" justify=\"space-between\" mb=\"6\">\n        <Heading fontWeight=\"thin\">Profile</Heading>\n      </HStack>\n    </VStack>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/SelectPreset/SelectPreset.tsx",
    "content": "import { useBorderColor } from \"@/Theme\"\nimport { useProContext, useTemplates } from \"@/contexts\"\nimport { Routes } from \"@/routes\"\nimport { BackToWorkspaces } from \"@/views/Pro/BackToWorkspaces\"\nimport { presetDisplayName } from \"@/views/Pro/helpers\"\nimport { SearchIcon } from \"@chakra-ui/icons\"\nimport {\n  Box,\n  Button,\n  Card,\n  Grid,\n  Heading,\n  HStack,\n  IconButton,\n  Input,\n  InputGroup,\n  InputLeftElement,\n  InputRightElement,\n  Link,\n  Spinner,\n  Text,\n  useColorModeValue,\n  useToken,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { ChangeEvent, useCallback, useMemo, useRef, useState } from \"react\"\nimport { AiOutlineCloseCircle } from \"react-icons/ai\"\nimport { useNavigate } from \"react-router\"\n\nexport function SelectPreset() {\n  const gridChildWidth = useToken(\"sizes\", \"96\")\n  const gridChildHeight = useToken(\"sizes\", \"48\")\n  const bg = useColorModeValue(\"white\", \"background.darkest\")\n  const borderColor = useBorderColor()\n\n  const [searchString, setSearchString] = useState<string | undefined>(undefined)\n  const searchInputRef = useRef<HTMLInputElement | null>(null)\n\n  const { host } = useProContext()\n  const { data: templates, isLoading: isTemplatesLoading } = useTemplates()\n\n  const filteredPresets = useMemo(() => {\n    return (templates?.presets ?? []).filter((preset) => {\n      if (!searchString) {\n        return true\n      }\n\n      if ((presetDisplayName(preset) ?? \"\").includes(searchString)) {\n        return true\n      }\n\n      if (preset.spec?.source.image && preset.spec.source.image.includes(searchString)) {\n        return true\n      }\n\n      return preset.spec?.source.git && preset.spec.source.git.includes(searchString)\n    })\n  }, [templates?.presets, searchString])\n\n  const navigate = useNavigate()\n\n  const createPlain = useCallback(() => {\n    navigate(Routes.toProWorkspaceCreate(host))\n  }, [navigate, host])\n\n  const changeSearchString = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n    setSearchString(e.target.value ? e.target.value : undefined)\n  }, [])\n\n  return (\n    <Box display={\"flex\"} flexFlow={\"column\"} w={\"full\"} mb=\"20\">\n      <BackToWorkspaces />\n      <HStack w={\"full\"} align={\"center\"} justifyContent={\"space-between\"} mt={\"4\"} mb={\"8\"}>\n        <VStack w={\"full\"} align={\"start\"} justify={\"start\"}>\n          <Heading fontWeight={\"thin\"}>Create Workspace</Heading>\n          <Text>\n            Select a preset below or <Link onClick={createPlain}>create a custom workspace</Link>\n          </Text>\n        </VStack>\n        <InputGroup>\n          <InputLeftElement cursor={\"text\"} onClick={() => searchInputRef.current?.focus()}>\n            <SearchIcon />\n          </InputLeftElement>\n          <Input\n            ref={searchInputRef}\n            value={searchString ?? \"\"}\n            placeholder={\"Filter by name, repo or image\"}\n            spellCheck={false}\n            onChange={changeSearchString}\n            bg={bg}\n          />\n          {searchString && (\n            <InputRightElement>\n              <IconButton\n                onClick={() => setSearchString(undefined)}\n                aria-label={\"Clear search\"}\n                variant={\"ghost\"}\n                icon={<AiOutlineCloseCircle />}\n              />\n            </InputRightElement>\n          )}\n        </InputGroup>\n      </HStack>\n      {isTemplatesLoading ? (\n        <Spinner />\n      ) : (\n        <Grid\n          gridTemplateColumns={`repeat(auto-fit, ${gridChildWidth})`}\n          rowGap={\"5\"}\n          columnGap={\"5\"}\n          w={\"full\"}>\n          {!searchString && (\n            <Card\n              variant=\"outline\"\n              onClick={createPlain}\n              display={\"flex\"}\n              cursor={\"pointer\"}\n              flexDir={\"column\"}\n              alignItems={\"center\"}\n              justifyContent={\"center\"}\n              h={gridChildHeight}\n              borderWidth=\"thin\"\n              borderColor={borderColor}\n              boxSizing={\"border-box\"}\n              borderRadius={\"4px\"}>\n              <Button variant={\"outline\"} colorScheme={\"primary\"}>\n                New Custom Workspace\n              </Button>\n            </Card>\n          )}\n          {filteredPresets.map((preset) => (\n            <PresetBox\n              key={preset.metadata!.name!}\n              preset={preset.metadata?.name ?? \"\"}\n              host={host}\n              height={gridChildHeight}\n              name={presetDisplayName(preset) ?? \"\"}\n              source={preset.spec?.source.image ?? preset.spec?.source.git ?? \"\"}\n            />\n          ))}\n        </Grid>\n      )}\n    </Box>\n  )\n}\n\nfunction PresetBox({\n  height,\n  name,\n  source,\n  host,\n  preset,\n}: {\n  height: string\n  name: string\n  source: string\n  preset: string\n  host: string\n}) {\n  const navigate = useNavigate()\n  const borderColor = useBorderColor()\n\n  const createFromPreset = useCallback(() => {\n    navigate(Routes.toProWorkspaceCreate(host, preset))\n  }, [navigate, host, preset])\n\n  return (\n    <Card\n      variant=\"outline\"\n      _hover={{\n        _dark: {\n          borderColor: \"primary.500\",\n        },\n        borderColor: \"primary.500\",\n      }}\n      onClick={createFromPreset}\n      h={height}\n      cursor={\"pointer\"}\n      display={\"flex\"}\n      flexDir={\"column\"}\n      justifyContent={\"space-between\"}\n      border={\"1px\"}\n      borderColor={borderColor}\n      boxSizing={\"border-box\"}\n      boxShadow={\"0px 8px 16px 4px rgba(0, 0, 0, 0.10)\"}\n      paddingY={\"18px\"}\n      paddingX={\"24px\"}\n      transitionProperty={\"border-color\"}\n      transitionDuration={\"0.3s\"}\n      borderRadius={\"4px\"}>\n      <Box display={\"flex\"} flexDir={\"column\"}>\n        <Heading fontSize={\"md\"} fontWeight={\"semibold\"} as={\"h3\"}>\n          {name}\n        </Heading>\n        <Box display={\"flex\"} mt={\"10px\"} flexDir={\"column\"}>\n          <Box fontSize={\"sm\"}>Source Code:</Box>\n          <Box fontSize={\"md\"} color={\"gray.500\"}>\n            {source}\n          </Box>\n        </Box>\n      </Box>\n      <Button flexShrink={0} variant={\"primary\"}>\n        Select Preset\n      </Button>\n    </Card>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/SelectPreset/index.ts",
    "content": "export { SelectPreset } from \"./SelectPreset\"\n"
  },
  {
    "path": "desktop/src/views/Pro/Settings.tsx",
    "content": "import { HStack, Heading, VStack } from \"@chakra-ui/react\"\nimport { Settings as OSSSettings } from \"../Settings\"\nimport { BackToWorkspaces } from \"./BackToWorkspaces\"\n\nexport function Settings() {\n  return (\n    <VStack align=\"start\">\n      <BackToWorkspaces />\n      <HStack align=\"center\" justify=\"space-between\" mb=\"6\">\n        <Heading fontWeight=\"thin\">Settings</Heading>\n      </HStack>\n      <OSSSettings />\n    </VStack>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/Configuration.tsx",
    "content": "import { UpdateWorkspace } from \"../CreateWorkspace\"\nimport { TTabProps } from \"./types\"\n\nexport function Configuration({ instance, template }: TTabProps) {\n  return <UpdateWorkspace instance={instance} template={template} />\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/Logs.tsx",
    "content": "import { TerminalSearchBar, useStreamingTerminal } from \"@/components\"\nimport { TSearchOptions } from \"@/components/Terminal/useTerminalSearch\"\nimport { useAction } from \"@/contexts\"\nimport { useWorkspaceActions } from \"@/contexts/DevPodContext/workspaces/useWorkspace\"\nimport { CheckCircle, ExclamationCircle, ExclamationTriangle } from \"@/icons\"\nimport EmptyImage from \"@/images/empty_default.svg\"\nimport EmptyDarkImage from \"@/images/empty_default_dark.svg\"\nimport { exists, useDownloadLogs } from \"@/lib\"\nimport { Routes } from \"@/routes\"\nimport { DownloadIcon } from \"@chakra-ui/icons\"\nimport {\n  Accordion,\n  AccordionButton,\n  AccordionIcon,\n  AccordionItem,\n  AccordionPanel,\n  Box,\n  Button,\n  HStack,\n  Heading,\n  IconButton,\n  Image,\n  LinkBox,\n  LinkOverlay,\n  Spinner,\n  Text,\n  Tooltip,\n  VStack,\n  useColorMode,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport dayjs from \"dayjs\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { HiStop } from \"react-icons/hi\"\nimport { Link as RouterLink, useLocation } from \"react-router-dom\"\nimport { TTabProps } from \"./types\"\n\nconst MAX_LOGS = 10\n\nexport function Logs({ host, instance }: TTabProps) {\n  const [accordionIndex, setAccordionIndex] = useState<number>(0)\n  const workspaceActions = useWorkspaceActions(instance.id)\n  const actions = useMemo(() => {\n    return workspaceActions?.slice(0, MAX_LOGS)\n  }, [workspaceActions])\n  const { colorMode } = useColorMode()\n\n  const location = useLocation()\n\n  useEffect(() => {\n    // NOTE: It's important to use `exists` here as actionID could be 0\n    if (exists(location.state?.actionID) && actions && actions.length > 0) {\n      const maybeActionIdx = actions.findIndex((action) => action.id === location.state.actionID)\n      if (!exists(maybeActionIdx)) {\n        return\n      }\n      setAccordionIndex(maybeActionIdx)\n    }\n  }, [actions, location.state?.actionID])\n\n  return (\n    <VStack align=\"start\" w=\"full\" h={\"full\"}>\n      {!actions?.length ? (\n        <VStack h={\"full\"} w={\"full\"} justifyContent={\"center\"} alignItems={\"center\"} flexGrow={1}>\n          <Image src={colorMode == \"dark\" ? EmptyDarkImage : EmptyImage} />\n          <Text\n            fontWeight={\"semibold\"}\n            fontSize={\"sm\"}\n            color={\"gray.600\"}\n            _dark={{ color: \"gray.300\" }}>\n            No logs to show yet\n          </Text>\n        </VStack>\n      ) : (\n        <Accordion\n          w=\"full\"\n          allowToggle\n          index={accordionIndex}\n          onChange={(idx) => setAccordionIndex(idx as number)}>\n          {actions.map((action) => (\n            <AccordionItem mb={\"2\"} key={action.id} w=\"full\" border={\"none\"}>\n              {({ isExpanded }) => (\n                <ActionAccordionItem\n                  actionID={action.id}\n                  isExpanded={isExpanded}\n                  host={host}\n                  instanceID={instance.id}\n                />\n              )}\n            </AccordionItem>\n          ))}\n        </Accordion>\n      )}\n    </VStack>\n  )\n}\n\ntype TActionAccordionItemProps = Readonly<{\n  host: string\n  actionID: string\n  isExpanded: boolean\n  instanceID: string\n}>\nfunction ActionAccordionItem({\n  host,\n  instanceID,\n  actionID,\n  isExpanded,\n}: TActionAccordionItemProps) {\n  const action = useAction(actionID)\n  const bgColor = useColorModeValue(\"white\", \"background.darkest\")\n\n  const handleCancelClicked = () => {\n    action?.cancel()\n  }\n\n  return action?.data ? (\n    <>\n      <Heading as={\"h2\"}>\n        <AccordionButton\n          as={LinkBox}\n          w=\"full\"\n          display=\"flex\"\n          alignItems=\"center\"\n          gap=\"2\"\n          paddingY={2}\n          paddingX={3}\n          borderWidth=\"thin\"\n          borderRadius=\"md\"\n          boxSizing={\"border-box\"}\n          borderBottomRadius={isExpanded ? 0 : undefined}\n          backgroundColor={bgColor}\n          width=\"full\"\n          flexFlow=\"row nowrap\">\n          {action.data.status === \"pending\" && <Spinner color=\"blue.300\" size=\"sm\" />}\n          {action.data.status === \"success\" && <CheckCircle color=\"green.300\" boxSize=\"5\" />}\n          {action.data.status === \"error\" && <ExclamationCircle color=\"red.300\" boxSize=\"5\" />}\n          {action.data.status === \"cancelled\" && (\n            <ExclamationTriangle color=\"orange.300\" boxSize=\"5\" />\n          )}\n\n          <LinkOverlay\n            as={RouterLink}\n            to={Routes.toProWorkspaceDetail(host, instanceID, \"logs\")}\n            fontWeight=\"semibold\"\n            textTransform=\"capitalize\"\n            state={{ origin: location.pathname, actionID: actionID }}>\n            {action.data.name}\n          </LinkOverlay>\n\n          <Tooltip label={dayjs(action.data.createdAt).format()}>\n            <Text fontWeight=\"normal\" color=\"gray.600\" _dark={{ color: \"gray.400\" }}>\n              {dayjs(action.data.createdAt).fromNow()}\n            </Text>\n          </Tooltip>\n\n          {action.data.status === \"pending\" && (\n            <Button\n              variant=\"outline\"\n              aria-label=\"Cancel action\"\n              leftIcon={<HiStop />}\n              onClick={(e) => {\n                e.stopPropagation()\n                handleCancelClicked()\n              }}>\n              Cancel\n            </Button>\n          )}\n\n          <HStack ml=\"auto\">\n            {action.data.status !== \"pending\" && <DownloadLogsButton actionID={actionID} />}\n            <AccordionIcon />\n          </HStack>\n        </AccordionButton>\n      </Heading>\n      <AccordionPanel\n        bgColor={bgColor}\n        borderWidth={isExpanded ? \"thin\" : \"unset\"}\n        borderTop={\"none\"}\n        borderBottomRadius={\"md\"}\n        padding={0}>\n        {isExpanded && <ActionTerminal actionID={actionID} />}\n      </AccordionPanel>\n    </>\n  ) : null\n}\ntype TActionTerminalProps = Readonly<{\n  actionID: string\n}>\nfunction ActionTerminal({ actionID }: TActionTerminalProps) {\n  const action = useAction(actionID)\n\n  const [searchOptions, setSearchOptions] = useState<TSearchOptions>({})\n\n  const {\n    terminal,\n    connectStream,\n    clear: clearTerminal,\n    search: { totalSearchResults, nextSearchResult, prevSearchResult, activeSearchResult },\n  } = useStreamingTerminal({ searchOptions, borderRadius: \"none\" })\n\n  useEffect(() => {\n    if (!action) return\n\n    let isActive = true\n    clearTerminal()\n\n    // Create a new subscription with a delay for replay\n    const setupStream = async () => {\n      if (action.data.status === \"pending\") {\n        // For pending actions, subscribe immediately\n        return action.connectOrReplay((e) => {\n          if (isActive) {\n            connectStream(e)\n          }\n        })\n      } else {\n        // For completed actions, add a small delay to ensure cleanup\n        await new Promise((resolve) => setTimeout(resolve, 100))\n        if (!isActive) return () => {}\n\n        return action.connectOrReplay((e) => {\n          if (isActive) {\n            connectStream(e)\n          }\n        })\n      }\n    }\n\n    let cleanup: VoidFunction | void\n    setupStream().then((unsubscribe) => {\n      if (isActive) {\n        cleanup = unsubscribe\n      } else {\n        unsubscribe?.()\n      }\n    })\n\n    return () => {\n      isActive = false\n      cleanup?.()\n    }\n  }, [action, clearTerminal, connectStream])\n\n  return (\n    <VStack w={\"full\"}>\n      <TerminalSearchBar\n        paddingX={4}\n        paddingY={3}\n        prevSearchResult={prevSearchResult}\n        nextSearchResult={nextSearchResult}\n        totalSearchResults={totalSearchResults}\n        activeSearchResult={activeSearchResult}\n        onUpdateSearchOptions={setSearchOptions}\n      />\n\n      <Box h=\"50vh\" w=\"full\" mb=\"4\">\n        {terminal}\n      </Box>\n    </VStack>\n  )\n}\n\ntype TDownloadLogsButtonProps = Readonly<{ actionID: string }>\nfunction DownloadLogsButton({ actionID }: TDownloadLogsButtonProps) {\n  const { download, isDownloading } = useDownloadLogs()\n\n  return (\n    <Tooltip label=\"Save Logs\">\n      <IconButton\n        ml=\"auto\"\n        mr=\"4\"\n        isLoading={isDownloading}\n        title=\"Save Logs\"\n        variant=\"ghost\"\n        aria-label=\"Save Logs\"\n        icon={<DownloadIcon />}\n        onClick={(e) => {\n          e.stopPropagation()\n          download({ actionID })\n        }}\n      />\n    </Tooltip>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/Tabs.tsx",
    "content": "import { TProInstanceDetail } from \"@/lib\"\nimport { ComponentType, useMemo } from \"react\"\nimport { TTabProps } from \"./types\"\nimport { Logs } from \"./Logs\"\nimport { Configuration } from \"./Configuration\"\nimport { Tab, TabList, TabPanel, TabPanels, Tabs, useColorModeValue } from \"@chakra-ui/react\"\nimport { useSearchParams } from \"react-router-dom\"\nimport { Routes } from \"@/routes\"\n\nconst DETAILS_TABS: Readonly<{\n  key: TProInstanceDetail\n  label: string\n  component: ComponentType<TTabProps>\n}>[] = [\n  { key: \"logs\", label: \"Logs\", component: Logs },\n  { key: \"configuration\", label: \"Configuration\", component: Configuration },\n]\ntype TWorkspaceTabProps = Readonly<{}> & TTabProps\nexport function WorkspaceTabs({ ...tabProps }: TWorkspaceTabProps) {\n  const headerBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n  const contentBackgroundColor = useColorModeValue(\"gray.50\", \"background.darkest\")\n  const [searchParams, setSearchParams] = useSearchParams()\n\n  const tabIndex = useMemo(() => {\n    const currentTab = Routes.getProWorkspaceDetailsParams(searchParams).tab\n\n    const idx = DETAILS_TABS.findIndex((v) => v.key === currentTab)\n    if (idx === -1) {\n      return 0\n    }\n\n    return idx\n  }, [searchParams])\n\n  const handleTabIndexChanged = (newIndex: number) => {\n    const key = DETAILS_TABS[newIndex]?.key\n    if (!key) return\n    setSearchParams((prev) => {\n      prev.set(\"tab\", key)\n\n      return prev\n    })\n  }\n\n  return (\n    <Tabs\n      colorScheme=\"gray\"\n      isLazy\n      w=\"full\"\n      h=\"full\"\n      index={tabIndex}\n      onChange={handleTabIndexChanged}>\n      <TabList ml=\"-8\" px=\"8\" mb=\"0\" bgColor={headerBackgroundColor}>\n        {DETAILS_TABS.map(({ key, label }) => (\n          <Tab fontWeight=\"semibold\" key={key}>\n            {label}\n          </Tab>\n        ))}\n      </TabList>\n      <TabPanels h=\"99%\">\n        {DETAILS_TABS.map(({ label, component: Component }) => (\n          <TabPanel\n            bgColor={contentBackgroundColor}\n            minH={label === \"Configuration\" ? \"\" : \"full\"}\n            width=\"100vw\"\n            ml=\"-8\"\n            px=\"12\"\n            pt=\"8\"\n            pb=\"0\"\n            key={label}>\n            <Component {...tabProps} />\n          </TabPanel>\n        ))}\n      </TabPanels>\n    </Tabs>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/Workspace.tsx",
    "content": "import {\n  ProWorkspaceInstance,\n  useProContext,\n  useProjectClusters,\n  useWorkspace,\n  useWorkspaceActions,\n} from \"@/contexts\"\nimport EmptyImage from \"@/images/empty_default.svg\"\nimport EmptyDarkImage from \"@/images/empty_default_dark.svg\"\nimport {\n  getDisplayName,\n  useDeleteWorkspaceModal,\n  useRebuildWorkspaceModal,\n  useResetWorkspaceModal,\n  useStopWorkspaceModal,\n} from \"@/lib\"\nimport { useStoreTroubleshoot } from \"@/lib/useStoreTroubleshoot\"\nimport { Routes } from \"@/routes\"\nimport { Box, Center, Image, Spinner, Text, VStack, useColorMode } from \"@chakra-ui/react\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport { useCallback, useEffect, useMemo } from \"react\"\nimport { useNavigate, useParams } from \"react-router-dom\"\nimport { BackToWorkspaces } from \"../BackToWorkspaces\"\nimport { WorkspaceTabs } from \"./Tabs\"\nimport { WorkspaceCardHeader } from \"./WorkspaceCardHeader\"\nimport { WorkspaceDetails } from \"./WorkspaceDetails\"\nimport { useTemplate } from \"./useTemplate\"\n\nexport function Workspace() {\n  const params = useParams<{ workspace: string }>()\n  const { data: projectClusters } = useProjectClusters()\n  const { host, isLoadingWorkspaces, client } = useProContext()\n  const navigate = useNavigate()\n  const workspace = useWorkspace<ProWorkspaceInstance>(params.workspace)\n  const instance = workspace.data\n  const instanceDisplayName = getDisplayName(instance)\n  const workspaceActions = useWorkspaceActions(instance?.id)\n\n  const { mutate: updateWorkspaceDisplayName } = useMutation({\n    mutationFn: async ({ newName }: Readonly<{ newName: string }>) => {\n      if (!instance) {\n        return\n      }\n      const updatedWorkspace = new ProWorkspaceInstance(instance)\n      if (!updatedWorkspace.spec) {\n        updatedWorkspace.spec = {}\n      }\n      updatedWorkspace.spec.displayName = newName\n\n      return (await client.updateWorkspace(updatedWorkspace)).unwrap()\n    },\n  })\n\n  const { modal: stopModal, open: openStopModal } = useStopWorkspaceModal(\n    useCallback(\n      (close) => {\n        workspace.stop()\n        close()\n      },\n      [workspace]\n    )\n  )\n  const { modal: deleteModal, open: openDeleteModal } = useDeleteWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (_, close) => {\n        workspace.remove(true)\n        close()\n      },\n      [workspace]\n    ),\n    true\n  )\n  const { modal: rebuildModal, open: openRebuildModal } = useRebuildWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (close) => {\n        workspace.rebuild()\n        close()\n        instance?.id && navigate(Routes.toProWorkspace(host, instance.id))\n      },\n      [workspace, navigate, host, instance]\n    )\n  )\n  const { modal: resetModal, open: openResetModal } = useResetWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (close) => {\n        workspace.reset()\n        close()\n        instance?.id && navigate(Routes.toProWorkspace(host, instance.id))\n      },\n      [workspace, navigate, host, instance]\n    )\n  )\n  const { template, parameters } = useTemplate(instance)\n\n  const cluster = useMemo(() => {\n    if (instance?.spec?.runnerRef?.runner) {\n      return projectClusters?.runners?.find(\n        (runner) => runner.metadata?.name === instance?.spec?.runnerRef?.runner\n      )\n    }\n\n    return projectClusters?.clusters?.find(\n      (cluster) => cluster.metadata?.name === instance?.spec?.target?.cluster?.name\n    )\n  }, [projectClusters, instance])\n\n  // navigate to pro instance view after successfully deleting the workspace\n  useEffect(() => {\n    if (workspace.current?.name === \"remove\" && workspace.current.status === \"success\") {\n      navigate(Routes.toProInstance(host))\n    }\n  }, [host, navigate, workspace])\n\n  const { store: storeTroubleshoot } = useStoreTroubleshoot()\n\n  const handleTroubleshootClicked = useCallback(() => {\n    if (workspace.data && workspaceActions) {\n      storeTroubleshoot({\n        workspace: workspace.data,\n        workspaceActions: workspaceActions,\n      })\n    }\n  }, [storeTroubleshoot, workspace.data, workspaceActions])\n\n  const { colorMode } = useColorMode()\n\n  if (!instance) {\n    if (isLoadingWorkspaces) {\n      return (\n        <Center w=\"full\" h=\"60%\" flexFlow=\"column nowrap\">\n          <Spinner size=\"xl\" thickness=\"4px\" speed=\"1s\" color=\"gray.600\" />\n          <Text mt=\"4\">Loading Workspace...</Text>\n        </Center>\n      )\n    }\n\n    return (\n      <VStack align=\"start\" justifyContent=\"start\">\n        <BackToWorkspaces />\n        <VStack w=\"full\" py=\"32\" justifyContent=\"center\" alignItems=\"center\">\n          <Image src={colorMode == \"dark\" ? EmptyDarkImage : EmptyImage} />\n          <Text\n            fontWeight={\"semibold\"}\n            fontSize={\"sm\"}\n            color={\"gray.600\"}\n            _dark={{ color: \"gray.300\" }}>\n            Workspace not found\n          </Text>\n        </VStack>\n      </VStack>\n    )\n  }\n\n  const canStop =\n    instance.status?.lastWorkspaceStatus != \"Busy\" &&\n    instance.status?.lastWorkspaceStatus != \"Stopped\"\n\n  const handleOpenClicked = (ideName: string) => {\n    workspace.start({ id: instance.id, ideConfig: { name: ideName } })\n    navigate(Routes.toProWorkspace(host, instance.id))\n  }\n\n  const handleWorkspaceDisplayNameChanged = (newName: string) => {\n    updateWorkspaceDisplayName({ newName })\n  }\n\n  return (\n    <>\n      <VStack align=\"start\" width=\"full\" height=\"full\">\n        <BackToWorkspaces />\n        <VStack align=\"start\" width=\"full\" pl=\"4\" px=\"4\" paddingInlineEnd=\"0\">\n          <Box w=\"full\">\n            <WorkspaceCardHeader\n              instance={instance}\n              showSource={false}\n              onDisplayNameChange={handleWorkspaceDisplayNameChanged}>\n              <WorkspaceCardHeader.Controls\n                onOpenClicked={handleOpenClicked}\n                onDeleteClicked={openDeleteModal}\n                onRebuildClicked={openRebuildModal}\n                onResetClicked={openResetModal}\n                onStopClicked={!canStop ? openStopModal : workspace.stop}\n                onTroubleshootClicked={handleTroubleshootClicked}\n              />\n            </WorkspaceCardHeader>\n          </Box>\n\n          <WorkspaceDetails\n            instance={instance}\n            template={template}\n            cluster={cluster}\n            parameters={parameters}\n          />\n        </VStack>\n        <Box height=\"full\">\n          <WorkspaceTabs\n            host={host}\n            workspace={workspace}\n            instance={instance}\n            template={template}\n          />\n        </Box>\n      </VStack>\n\n      {stopModal}\n      {rebuildModal}\n      {resetModal}\n      {deleteModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/WorkspaceCardHeader.tsx",
    "content": "import { IDEGroup, IDEIcon } from \"@/components\"\nimport { ProWorkspaceInstance, useSettings } from \"@/contexts\"\nimport {\n  ArrowCycle,\n  ArrowPath,\n  Close,\n  Cog,\n  Ellipsis,\n  GitBranch,\n  GitCommit,\n  GitPR,\n  GitSubPath,\n  Stop,\n  Trash,\n} from \"@/icons\"\nimport { getDisplayName, getIDEDisplayName } from \"@/lib\"\nimport { TIDE, TIDEs, TWorkspaceSource } from \"@/types\"\nimport { useGroupIDEs, useIDEs } from \"@/useIDEs\"\nimport { CheckIcon, ChevronDownIcon, CloseIcon, EditIcon } from \"@chakra-ui/icons\"\nimport {\n  Box,\n  Button,\n  ButtonGroup,\n  Checkbox,\n  HStack,\n  Heading,\n  IconButton,\n  Input,\n  InputGroup,\n  InputRightAddon,\n  InputRightElement,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Portal,\n  Text,\n  TextProps,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport React, {\n  ChangeEventHandler,\n  KeyboardEventHandler,\n  ReactNode,\n  createContext,\n  useCallback,\n  useContext,\n  useState,\n} from \"react\"\n\ntype TWorkspaceCardHeaderContext = ProWorkspaceInstance\nconst WorkspaceCardHeaderContext = createContext<TWorkspaceCardHeaderContext>(null!)\n\ntype TWorkspaceCardHeaderProps = Readonly<{\n  instance: ProWorkspaceInstance\n  children?: ReactNode\n  showSource?: boolean\n  isSelected?: boolean\n  showSelection?: boolean\n  onSelectionChange?: (isSelected: boolean) => void\n  onDisplayNameChange?: (newName: string) => void\n}>\nexport function WorkspaceCardHeader({\n  instance,\n  children,\n  isSelected,\n  showSelection,\n  showSource = true,\n  onSelectionChange,\n  onDisplayNameChange,\n}: TWorkspaceCardHeaderProps) {\n  const [isEditingWorkspaceName, setIsEditingWorkspaceName] = useState(false)\n  const [currentWorkspaceName, setCurrentWorkspaceName] = useState(() =>\n    getDisplayName(instance, instance.id)\n  )\n  const source = instance.status?.source\n  const sourceDetail = getSourceDetail(source)\n  const textColor = useColorModeValue(\"gray.500\", \"gray.400\")\n\n  const reset = () => {\n    setIsEditingWorkspaceName(false)\n    setCurrentWorkspaceName(getDisplayName(instance, instance.id))\n  }\n  const handleCurrentWorkspaceNameChanged: ChangeEventHandler<HTMLInputElement> = (e) => {\n    setCurrentWorkspaceName(e.target.value)\n  }\n  const handleSave = () => {\n    if (currentWorkspaceName.length > 0) {\n      onDisplayNameChange?.(currentWorkspaceName)\n      setIsEditingWorkspaceName(false)\n    } else {\n      reset()\n    }\n  }\n  const handleKeyUp: KeyboardEventHandler<HTMLInputElement> = (e) => {\n    if (e.key === \"Escape\") {\n      reset()\n      return\n    }\n    if (e.keyCode === 13) {\n      handleSave()\n      return\n    }\n  }\n\n  return (\n    <HStack justify=\"space-between\" align=\"start\">\n      <VStack align=\"start\" spacing={0}>\n        <HStack alignItems={\"center\"}>\n          {showSelection && (\n            <Box mr={\"1\"} onClick={(e) => e.stopPropagation()}>\n              <Checkbox\n                mt={\"1\"}\n                isChecked={isSelected}\n                onClick={(e) => e.stopPropagation()}\n                onChange={(e) => {\n                  onSelectionChange?.(e.target.checked)\n                }}\n              />\n            </Box>\n          )}\n          {showSource && (\n            <Text color={textColor}>\n              {source?.gitRepository || source?.image || source?.localFolder}\n            </Text>\n          )}\n        </HStack>\n        <HStack alignItems={\"center\"}>\n          <Heading size=\"md\" my=\"1\" data-group>\n            {isEditingWorkspaceName ? (\n              <>\n                <HStack>\n                  <Input\n                    autoFocus\n                    value={currentWorkspaceName}\n                    onChange={handleCurrentWorkspaceNameChanged}\n                    onKeyUp={handleKeyUp}\n                  />\n                  <ButtonGroup variant=\"ghost\" isAttached>\n                    <IconButton\n                      aria-label=\"Save name\"\n                      icon={<CheckIcon boxSize=\"3\" />}\n                      onClick={handleSave}\n                    />\n                    <IconButton\n                      aria-label=\"Cancel\"\n                      icon={<CloseIcon boxSize=\"3\" />}\n                      onClick={reset}\n                    />\n                  </ButtonGroup>\n                </HStack>\n              </>\n            ) : (\n              <Text\n                lineHeight={onDisplayNameChange ? \"2\" : \"\"}\n                fontWeight=\"bold\"\n                maxW=\"50rem\"\n                overflow=\"hidden\"\n                whiteSpace=\"nowrap\"\n                textOverflow=\"ellipsis\">\n                {currentWorkspaceName}\n                {onDisplayNameChange && (\n                  <IconButton\n                    ml=\"2\"\n                    opacity=\"0\"\n                    _groupHover={{ opacity: \"1\" }}\n                    variant=\"ghost\"\n                    borderRadius={\"full\"}\n                    aria-label=\"Change workspace name\"\n                    icon={<EditIcon />}\n                    onClick={() => setIsEditingWorkspaceName(true)}\n                  />\n                )}\n              </Text>\n            )}\n          </Heading>\n        </HStack>\n        {showSource && sourceDetail ? sourceDetail : null}\n      </VStack>\n\n      <WorkspaceCardHeaderContext.Provider value={instance}>\n        {children}\n      </WorkspaceCardHeaderContext.Provider>\n    </HStack>\n  )\n}\n\ntype TControlsProps = Readonly<{\n  onOpenClicked: (ideName: string) => void\n  onStopClicked: VoidFunction\n  onResetClicked: VoidFunction\n  onRebuildClicked: VoidFunction\n  onDeleteClicked: VoidFunction\n  onTroubleshootClicked: VoidFunction\n}>\nexport function Controls({\n  onOpenClicked,\n  onStopClicked,\n  onResetClicked,\n  onRebuildClicked,\n  onDeleteClicked,\n  onTroubleshootClicked,\n}: TControlsProps) {\n  const { ides, defaultIDE } = useIDEs()\n  const settings = useSettings()\n  const instance = useContext(WorkspaceCardHeaderContext)\n  const ide = getWorkspaceIDE(instance, ides, defaultIDE, settings.fixedIDE)\n  const groupedIDEs = useGroupIDEs(ides)\n  const borderColor = useColorModeValue(\"white\", \"gray.900\")\n  const menuHoverColor = useColorModeValue(\"gray.200\", \"gray.700\")\n  const menuActiveColor = useColorModeValue(\"gray.300\", \"gray.700\")\n\n  const stopPropagation = useCallback((e: React.UIEvent) => e.stopPropagation(), [])\n\n  return (\n    <ButtonGroup size=\"sm\" onClick={stopPropagation}>\n      <ButtonGroup variant=\"proWorkspaceIDE\" isAttached onClick={stopPropagation}>\n        {ide && (\n          <Button onClick={() => onOpenClicked(ide.name!)}>\n            <HStack>\n              {ide.name !== \"none\" && <IDEIcon ide={ide} width={6} height={6} size=\"sm\" />}\n              <Text>{ide.name === \"none\" ? \"SSH\" : getIDEDisplayName(ide)}</Text>\n            </HStack>\n          </Button>\n        )}\n        <Menu>\n          <MenuButton\n            as={IconButton}\n            borderLeftColor={borderColor}\n            borderLeftStyle=\"solid\"\n            borderLeftWidth=\"thin\"\n            aria-label=\"Show more IDEs\"\n            icon={<ChevronDownIcon boxSize=\"5\" />}\n          />\n          <MenuList>\n            {groupedIDEs?.primary.map((ide) => (\n              <MenuItem\n                onClick={() => onOpenClicked(ide.name!)}\n                key={ide.name}\n                value={ide.name!}\n                icon={<IDEIcon ide={ide} width={6} height={6} size=\"sm\" />}>\n                {getIDEDisplayName(ide)}\n              </MenuItem>\n            ))}\n            {groupedIDEs?.subMenuGroups.map((group) => (\n              <IDEGroup\n                key={group}\n                placement={\"left-end\"}\n                ides={groupedIDEs.subMenus[group]}\n                group={group}\n                onItemClick={(selectedIDE) => onOpenClicked(selectedIDE!)}\n              />\n            ))}\n          </MenuList>\n        </Menu>\n      </ButtonGroup>\n\n      <Menu placement=\"bottom\">\n        <MenuButton\n          as={IconButton}\n          variant=\"ghost\"\n          aria-label=\"More actions\"\n          _hover={{ bgColor: menuHoverColor }}\n          _active={{ bgColor: menuActiveColor }}\n          icon={<Ellipsis transform={\"rotate(90deg)\"} boxSize={5} />}\n        />\n        <Portal>\n          <MenuList mr=\"4\">\n            <MenuItem isDisabled={false} onClick={onStopClicked} icon={<Stop boxSize={4} />}>\n              Stop...\n            </MenuItem>\n            <MenuItem\n              icon={<ArrowPath boxSize={4} />}\n              onClick={onRebuildClicked}\n              isDisabled={false}>\n              Rebuild...\n            </MenuItem>\n            <MenuItem icon={<ArrowCycle boxSize={4} />} onClick={onResetClicked} isDisabled={false}>\n              Reset...\n            </MenuItem>\n            <MenuItem\n              fontWeight=\"normal\"\n              icon={<Cog boxSize={4} />}\n              onClick={onTroubleshootClicked}>\n              Troubleshoot\n            </MenuItem>\n            <MenuItem\n              isDisabled={false}\n              fontWeight=\"normal\"\n              icon={<Trash boxSize={4} />}\n              onClick={onDeleteClicked}>\n              Delete...\n            </MenuItem>\n          </MenuList>\n        </Portal>\n      </Menu>\n    </ButtonGroup>\n  )\n}\nWorkspaceCardHeader.Controls = Controls\n\nfunction getSourceDetail(source: TWorkspaceSource | undefined): ReactNode | undefined {\n  if (!source) {\n    return undefined\n  }\n\n  const sharedProps: TextProps = { color: \"gray.500\", gap: \"1\", align: \"center\" }\n\n  if (source.gitBranch) {\n    return (\n      <HStack {...sharedProps}>\n        <GitBranch boxSize=\"4\" />\n        <Text>{source.gitBranch}</Text>\n      </HStack>\n    )\n  }\n\n  if (source.gitCommit) {\n    return (\n      <HStack {...sharedProps}>\n        <GitCommit boxSize=\"4\" />\n        <Text>{source.gitCommit}</Text>\n      </HStack>\n    )\n  }\n\n  if (source.gitPRReference) {\n    return (\n      <HStack {...sharedProps}>\n        <GitPR boxSize=\"4\" />\n        <Text>{source.gitPRReference}</Text>\n      </HStack>\n    )\n  }\n\n  if (source.gitSubPath) {\n    return (\n      <HStack {...sharedProps}>\n        <GitSubPath boxSize=\"4\" />\n        <Text>{source.gitSubPath}</Text>\n      </HStack>\n    )\n  }\n}\n\nfunction getWorkspaceIDE(\n  instance: ProWorkspaceInstance,\n  ides: TIDEs | undefined,\n  defaultIDE: TIDE | undefined,\n  fixedIDE: boolean\n): TIDE | undefined {\n  if (fixedIDE && defaultIDE) {\n    return defaultIDE\n  }\n  const instanceIDEName = instance.status?.ide?.name\n  const instanceIDE = ides?.find((ide) => ide.name === instanceIDEName)\n\n  if (instanceIDE) {\n    return instanceIDE\n  }\n\n  if (defaultIDE) {\n    return defaultIDE\n  }\n\n  return ides?.find((ide) => ide.name === \"vscode\")\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/WorkspaceDetails.tsx",
    "content": "import { ProWorkspaceInstance } from \"@/contexts\"\nimport {\n  CPU,\n  Clock,\n  CogOutlined,\n  Dashboard,\n  Database,\n  Folder,\n  Git,\n  Globe,\n  History as HistoryIcon,\n  Image,\n  Memory,\n  Status,\n  User,\n} from \"@/icons\"\nimport { Annotations, Source, TParameterWithValue, getDisplayName, getLastActivity } from \"@/lib\"\nimport { ManagementV1Runner } from \"@/runner\"\nimport {\n  ComponentWithAs,\n  HStack,\n  IconProps,\n  Text,\n  Tooltip,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { ManagementV1Cluster } from \"@loft-enterprise/client/gen/models/managementV1Cluster\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport dayjs from \"dayjs\"\nimport { ReactElement, ReactNode, cloneElement, useMemo } from \"react\"\nimport { WorkspaceStatus } from \"./WorkspaceStatus\"\nimport { ManagementV1DevPodWorkspaceInstanceKubernetesStatus } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstanceKubernetesStatus\"\nimport { ManagementV1DevPodWorkspaceInstancePodStatus, ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstancePodStatus\"\nimport { ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatus, ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstancePersistentVolumeClaimStatus\"\nimport { quantityToScalar } from \"@kubernetes/client-node/dist/util\"\n\ntype TWorkspaceDetailsProps = Readonly<{\n  instance: ProWorkspaceInstance\n  template: ManagementV1DevPodWorkspaceTemplate | undefined\n  cluster: ManagementV1Cluster | ManagementV1Runner | undefined\n  parameters: readonly TParameterWithValue[]\n  showDetails?: boolean\n}>\nexport function WorkspaceDetails({\n  instance,\n  cluster,\n  template,\n  parameters,\n  showDetails = true,\n}: TWorkspaceDetailsProps) {\n  const sourceInfo = getSourceInfo(\n    Source.fromRaw(instance.metadata?.annotations?.[Annotations.WorkspaceSource])\n  )\n  const owner = useMemo(() => {\n    return instance?.spec?.owner?.user ?? instance?.spec?.owner?.team ?? \"unknown\"\n  }, [instance])\n\n  const mainContainerImage = useMemo(\n    () =>\n      instance?.status?.kubernetes?.podStatus?.containerStatuses?.find(\n        ({ name }) => name === \"devpod\"\n      )?.image,\n    [instance.status?.kubernetes]\n  )\n\n  // Format timespan labels.\n  const [lastActivity, created] = useMemo(() => {\n    if (!instance) {\n      return [undefined, undefined]\n    }\n\n    const lastActivityDate = getLastActivity(instance)\n    const lastActivityFormatted = lastActivityDate\n      ? dayjs(lastActivityDate).from(Date.now())\n      : undefined\n\n    const createdFormatted = instance.metadata?.creationTimestamp\n      ? dayjs(instance.metadata.creationTimestamp).from(Date.now())\n      : undefined\n\n    return [\n      lastActivityFormatted\n        ? { formatted: lastActivityFormatted, date: lastActivityDate }\n        : undefined,\n      createdFormatted\n        ? { formatted: createdFormatted, date: instance.metadata?.creationTimestamp }\n        : undefined,\n    ]\n  }, [instance])\n\n  return (\n    <VStack align=\"start\" w=\"full\" gap=\"4\" pb=\"4\">\n      <HStack w=\"full\" flexWrap=\"wrap\">\n        {showDetails && (\n          <>\n            {sourceInfo && (\n              <WorkspaceInfoDetail\n                icon={sourceInfo.icon}\n                label={sourceInfo.label}\n                tooltipLabel={\"Source\"}\n              />\n            )}\n\n            <WorkspaceInfoDetail\n              icon={Status}\n              label={\n                <HStack whiteSpace=\"nowrap\" wordBreak={\"keep-all\"}>\n                  <Text>{instance.id}</Text>\n                </HStack>\n              }\n              tooltipLabel={\"ID\"}\n            />\n          </>\n        )}\n        <WorkspaceInfoDetail\n          icon={Status}\n          label={formatTemplateDetail(instance, template)}\n          tooltipLabel={\"Template\"}\n        />\n        <WorkspaceInfoDetail\n          icon={Globe}\n          label={<Text>{getDisplayName(cluster)}</Text>}\n          tooltipLabel={\"Cluster\"}\n        />\n        <WorkspaceInfoDetail icon={User} label={<Text>{owner}</Text>} tooltipLabel={\"Owner\"} />\n\n        {lastActivity && (\n          <WorkspaceInfoDetail\n            icon={Clock}\n            label={<Text>{lastActivity.formatted}</Text>}\n            tooltipLabel={\n              \"Last activity: \" + (lastActivity.date ? lastActivity.date.toLocaleString() : \"\")\n            }\n          />\n        )}\n\n        {created && (\n          <WorkspaceInfoDetail\n            icon={HistoryIcon}\n            label={<Text>{created.formatted}</Text>}\n            tooltipLabel={\n              \"Created: \" + (created.date ? new Date(created.date).toLocaleString() : \"\")\n            }\n          />\n        )}\n        {mainContainerImage && (\n          <WorkspaceInfoDetail\n            icon={Image}\n            label={\n              <Text maxW=\"56\" overflow=\"hidden\" textOverflow={\"ellipsis\"}>\n                {formatContainerImage(mainContainerImage)}\n              </Text>\n            }\n            tooltipLabel={`Image: ${mainContainerImage}`}\n          />\n        )}\n      </HStack>\n\n      <HStack w=\"full\" flexWrap={\"wrap\"}>\n        <HStack gap=\"6\" mr=\"8\">\n          <StackedWorkspaceInfoDetail icon={Status} label={<Text>Status</Text>}>\n            <WorkspaceStatus\n              status={instance.status}\n              deletionTimestamp={instance.metadata?.deletionTimestamp}\n            />\n          </StackedWorkspaceInfoDetail>\n\n          <StackedWorkspaceInfoDetail icon={Dashboard} label={<Text>Avg. Latency</Text>}>\n            <Text>\n              {instance.status?.metrics?.latencyMs\n                ? instance.status.metrics.latencyMs?.toFixed(2) + \"ms\"\n                : \"-\"}\n            </Text>\n          </StackedWorkspaceInfoDetail>\n\n          {instance.status?.kubernetes && <KubernetesDetails status={instance.status.kubernetes} />}\n        </HStack>\n\n        {parameters.length > 0 && (\n          <HStack\n            py=\"2\"\n            px=\"4\"\n            gap=\"6\"\n            wrap=\"wrap\"\n            bg=\"gray.50\"\n            borderRadius=\"md\"\n            borderWidth={\"thin\"}\n            borderColor={\"gray.200\"}\n            _dark={{ bg: \"whiteAlpha.50\", borderColor: \"gray.700\" }}>\n            {parameters.map((param) => {\n              let label = param.label\n              if (!label) {\n                label = param.variable\n              }\n\n              let value = param.value ?? param.defaultValue ?? \"\"\n              if (param.type === \"boolean\") {\n                if (value) {\n                  value = \"true\"\n                } else {\n                  value = \"false\"\n                }\n              }\n\n              return (\n                <ParameterDetail\n                  key={param.variable}\n                  icon={CogOutlined}\n                  label={<Text>{label}</Text>}>\n                  <Text>{value}</Text>\n                </ParameterDetail>\n              )\n            })}\n          </HStack>\n        )}\n      </HStack>\n    </VStack>\n  )\n}\n\ntype TWorkspaceInfoDetailProps = Readonly<{\n  icon?: ComponentWithAs<\"svg\", IconProps>\n  label: ReactElement\n  tooltipLabel?: ReactNode\n}>\nfunction WorkspaceInfoDetail({ icon: Icon, label, tooltipLabel }: TWorkspaceInfoDetailProps) {\n  const color = useColorModeValue(\"gray.600\", \"gray.200\")\n  const l = cloneElement(label, { color })\n\n  const content = (\n    <HStack gap=\"1\" whiteSpace=\"nowrap\" userSelect=\"text\" cursor=\"text\">\n      {Icon && <Icon boxSize=\"5\" color=\"gray.500\" />}\n      {l}\n    </HStack>\n  )\n  if (tooltipLabel) {\n    return <Tooltip label={tooltipLabel}>{content}</Tooltip>\n  }\n\n  return content\n}\n\nfunction getSourceInfo(\n  source: Source | undefined\n): Readonly<{ icon: ComponentWithAs<\"svg\", IconProps>; label: ReactElement }> | undefined {\n  if (!source) {\n    return undefined\n  }\n\n  switch (source.type) {\n    case \"git\":\n      return {\n        icon: Git,\n        label: <Text>{source.value}</Text>,\n      }\n    case \"image\":\n      return {\n        icon: Image,\n        label: <Text>{source.value}</Text>,\n      }\n    case \"local\":\n      return {\n        icon: Folder,\n        label: <Text>{source.value}</Text>,\n      }\n  }\n}\n\nfunction formatTemplateDetail(\n  instance: ProWorkspaceInstance,\n  template: ManagementV1DevPodWorkspaceTemplate | undefined\n): ReactElement {\n  const templateName = instance.spec?.templateRef?.name\n  const templateDisplayName = getDisplayName(template, templateName)\n  let templateVersion = instance.spec?.templateRef?.version\n  if (!templateVersion) {\n    templateVersion = \"latest\"\n  }\n\n  return (\n    <Text>\n      {templateDisplayName}/{templateVersion}\n    </Text>\n  )\n}\n\ntype TStackedWorkspaceInfoDetailProps = Readonly<{\n  icon: ComponentWithAs<\"svg\", IconProps>\n  label: ReactElement\n  children: ReactNode\n  tooltipLabel?: ReactNode\n}>\nfunction StackedWorkspaceInfoDetail({\n  icon: Icon,\n  label,\n  children,\n  tooltipLabel,\n}: TStackedWorkspaceInfoDetailProps) {\n  const color = useColorModeValue(\"gray.700\", \"gray.200\")\n  const labelColor = useColorModeValue(\"gray.500\", \"gray.300\")\n  const l = cloneElement(label, { color: labelColor, fontWeight: \"medium\", fontSize: \"sm\" })\n\n  const content = (\n    <VStack align=\"start\" gap=\"1\" color={color}>\n      <HStack gap=\"1\">\n        <Icon boxSize={4} color={labelColor} />\n        {l}\n      </HStack>\n      {children}\n    </VStack>\n  )\n  if (tooltipLabel) {\n    return <Tooltip label={tooltipLabel}>{content}</Tooltip>\n  }\n\n  return content\n}\n\ntype TParameterDetailProps = Readonly<{\n  icon: ComponentWithAs<\"svg\", IconProps>\n  label: ReactElement\n  children: ReactNode\n}>\nfunction ParameterDetail({ icon: Icon, label, children }: TParameterDetailProps) {\n  const color = useColorModeValue(\"gray.800\", \"gray.200\")\n  const labelColor = useColorModeValue(\"gray.600\", \"gray.300\")\n  const l = cloneElement(label, { color: labelColor, fontWeight: \"medium\", fontSize: \"sm\" })\n\n  return (\n    <VStack align=\"start\" gap=\"1\" color={color}>\n      <HStack gap=\"1\">\n        <Icon boxSize={4} color={labelColor} />\n        {l}\n      </HStack>\n      {children}\n    </VStack>\n  )\n}\n\ntype TKubernetesDetailsProps = Readonly<{\n  status: ManagementV1DevPodWorkspaceInstanceKubernetesStatus\n}>\nfunction KubernetesDetails({ status }: TKubernetesDetailsProps) {\n  const storageCapacity = status.persistentVolumeClaimStatus?.capacity?.[\"storage\"]\n  const resources = useMemo(() => {\n    const mainContainerResources = status.podStatus?.containerResources?.find(\n      ({ name }) => name === \"devpod\"\n    )\n    if (!mainContainerResources) {\n      return []\n    }\n\n    const mainContainerMetrics = status.podStatus?.containerMetrics?.find(\n      ({ name }) => name === \"devpod\"\n    )\n    const indexedMetrics: Record<string, string> = {}\n    if (mainContainerMetrics?.usage) {\n      for (const [k, v] of Object.entries(mainContainerMetrics.usage)) {\n        indexedMetrics[k] = v\n      }\n    }\n\n    if (!mainContainerResources.resources?.limits) {\n      return Object.entries(mainContainerMetrics?.usage ?? {}).map(([type, quantity]) => {\n        return getResourceDetails(type, undefined, quantity, undefined)\n      })\n    }\n\n    return Object.entries(mainContainerResources.resources?.limits ?? {}).map(\n      ([type, quantity]) => {\n        const used = indexedMetrics[type]\n        let usagePercentage = calculateUsagePercentage(\n          quantityToScalarBigInt(used),\n          quantityToScalarBigInt(quantity)\n        )\n\n        return getResourceDetails(type, quantity, used, usagePercentage)\n      }\n    )\n  }, [status.podStatus])\n\n  return (\n    <>\n      {storageCapacity && (\n        <StackedWorkspaceInfoDetail icon={Dashboard} label={<Text>Disk Size</Text>}>\n          <Text>{storageCapacity}</Text>\n        </StackedWorkspaceInfoDetail>\n      )}\n\n      {status.podStatus && <PodStatus podStatus={status.podStatus} />}\n      {status.persistentVolumeClaimStatus && <PvcStatus pvcStatus={status.persistentVolumeClaimStatus} />}\n\n      {resources.map((resource) => {\n        return (\n          <StackedWorkspaceInfoDetail\n            key={resource.type}\n            icon={resource.icon ?? Database}\n            label={<Text textTransform={\"capitalize\"}>{resource.label ?? resource.type}</Text>}\n            tooltipLabel={\n              <Text>\n                {resource.type}: {resource.used ? resource.used : \"-\"}/\n                {resource.total ? resource.total : \"-\"}\n                {resource.unit ? resource.unit : \"\"}\n              </Text>\n            }>\n            <Text>\n              {resource.usagePercentage != null\n                ? resource.usagePercentage != invalidQuantity\n                  ? resource.usagePercentage + \"%\"\n                  : \"-\"\n                : resource.used != null\n                ? resource.used + (resource.unit ?? \"\")\n                : \"-\"}\n            </Text>\n          </StackedWorkspaceInfoDetail>\n        )\n      })}\n    </>\n  )\n}\n\nfunction PodStatus({ podStatus }: { podStatus: ManagementV1DevPodWorkspaceInstancePodStatus }) {\n  const phase = podStatus.phase\n  const phaseColor = {\n    [ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Pending]: \"yellow.500\",\n    [ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Running]: \"\",\n    [ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Succeeded]: \"red.400\",\n    [ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Failed]: \"red.400\",\n    [ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Unknown]: \"red.400\",\n  }\n\n  let reason = podStatus.reason\n  let message = podStatus.message\n  if (phase !== ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Running) {\n    // check container status first\n    const containerStatus = podStatus.containerStatuses?.find((container) => container.name === \"devpod\" && (container.state?.waiting?.reason || container.state?.terminated?.reason))\n    if (containerStatus) {\n      if (containerStatus.state?.waiting) {\n        reason = containerStatus.state.waiting.reason\n        message = containerStatus.state.waiting.message\n      } else if (containerStatus.state?.terminated) {\n        reason = containerStatus.state.terminated.reason\n        message = containerStatus.state.terminated.message\n        if (!containerStatus.state.terminated.message && containerStatus.state.terminated.exitCode != 0) {\n          message = \"Exit code: \" + containerStatus.state.terminated.exitCode\n        }\n      }\n    }\n\n    // check pod conditions\n    if (!reason && !message) {\n      const podCondition = podStatus.conditions?.find((condition) => condition.status === \"False\" && condition.reason)\n      if (podCondition) {\n        reason = podCondition.reason\n        message = podCondition.message\n      }\n    }\n\n    // try to find warning event\n    if (!reason && !message) {\n      const warningEvent = podStatus.events?.find((event) => event.type === \"Warning\")\n      if (warningEvent) {\n        reason = warningEvent.reason\n        message = warningEvent.message\n      }\n    }\n\n    // try to find normal event\n    if (!reason && !message) {\n      const normalEvent = podStatus.events?.find((event) => event.type === \"Normal\")\n      if (normalEvent) {\n            reason = normalEvent.reason\n            message = normalEvent.message\n      }\n    }\n  }\n\n  return (\n    <StackedWorkspaceInfoDetail icon={Dashboard} label={<Text>Pod</Text>}>\n      <Text color={phase ? phaseColor[phase] : \"gray.500\"}>\n        {phase === ManagementV1DevPodWorkspaceInstancePodStatusPhaseEnum.Running ? podStatus.phase : (\n          (reason && message) ? <Tooltip label={message}>\n            <Text>{podStatus.phase} ({reason})</Text>\n          </Tooltip> : (reason ? <Text>{podStatus.phase} ({reason})</Text> : podStatus.phase)\n        )}\n      </Text>\n    </StackedWorkspaceInfoDetail>\n  )\n}\n\n\nfunction PvcStatus({ pvcStatus }: { pvcStatus: ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatus }) {\n  const phase = pvcStatus.phase\n  const phaseColor = {\n    [ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum.Pending]: \"yellow.500\",\n    [ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum.Bound]: \"\",\n    [ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum.Lost]: \"red.400\",\n  } \n\n  let reason: string | undefined = \"\"\n  let message: string | undefined = \"\"\n  if (phase !== ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum.Bound) {\n    reason = pvcStatus.conditions?.find((condition) => condition.status === \"False\")?.reason\n    message = pvcStatus.conditions?.find((condition) => condition.status === \"False\")?.message\n\n    // try to find warning event\n    if (!reason && !message) {\n      const warningEvent = pvcStatus.events?.find((event) => event.type === \"Warning\")\n      if (warningEvent) {\n        reason = warningEvent.reason\n        message = warningEvent.message\n      }\n    }\n\n    // try to find normal event\n    if (!reason && !message) {\n      const normalEvent = pvcStatus.events?.find((event) => event.type === \"Normal\")\n      if (normalEvent) {\n        reason = normalEvent.reason\n        message = normalEvent.message\n      }\n    }\n  }\n\n  return (\n    <StackedWorkspaceInfoDetail icon={Dashboard} label={<Text>Volume</Text>}>\n      <Text color={phase ? phaseColor[phase] : \"gray.500\"}>\n        {phase === ManagementV1DevPodWorkspaceInstancePersistentVolumeClaimStatusPhaseEnum.Bound ? pvcStatus.phase : ((reason && message) ? <Tooltip label={message}>\n          <Text>{pvcStatus.phase} ({reason})</Text>\n        </Tooltip> : reason ? <Text>{pvcStatus.phase} ({reason})</Text> : pvcStatus.phase) }\n      </Text>\n    </StackedWorkspaceInfoDetail>\n  )\n}\n\nconst invalidQuantity = -1\n\nfunction quantityToScalarBigInt(quantity: string | number | undefined): bigint | number {\n  if (!quantity) {\n    return invalidQuantity\n  }\n\n  try {\n    return quantityToScalar(String(quantity))\n  } catch {\n    return invalidQuantity\n  }\n}\n\nfunction calculateUsagePercentage(current: number | bigint, total: number | bigint) {\n  if (current === invalidQuantity || total === invalidQuantity) {\n    return invalidQuantity\n  }\n\n  try {\n    if (typeof current === \"bigint\" || typeof total === \"bigint\") {\n      return Number((BigInt(current) * 100n) / BigInt(total))\n    }\n\n    return Math.floor((current / total) * 100)\n  } catch {\n    return invalidQuantity\n  }\n}\n\nfunction formatCPU(input: string | undefined): string | undefined {\n  if (!input) {\n    return undefined\n  }\n  const nanoMatch = input.match(/^([0-9]+)n$/)?.[1]\n  const f = (num: number): string => {\n    if (Number.isInteger(num)) {\n      return num.toString()\n    } else {\n      return num.toFixed(2)\n    }\n  }\n  if (nanoMatch !== undefined) {\n    return f(parseInt(nanoMatch) / 1000 / 1000 / 1000)\n  }\n\n  const uMatch = input.match(/^([0-9]+)u$/)?.[1]\n  if (uMatch !== undefined) {\n    return f(parseInt(uMatch) / 1000 / 1000)\n  }\n\n  const milliMatch = input.match(/^([0-9]+)m$/)?.[1]\n  if (milliMatch !== undefined) {\n    return f(parseInt(milliMatch) / 1000)\n  }\n\n  return f(parseFloat(input))\n}\n\nconst memoryMultipliers = {\n  k: 1000,\n  M: 1000 ** 2,\n  G: 1000 ** 3,\n  T: 1000 ** 4,\n  P: 1000 ** 5,\n  E: 1000 ** 6,\n  Ki: 1024,\n  Mi: 1024 ** 2,\n  Gi: 1024 ** 3,\n  Ti: 1024 ** 4,\n  Pi: 1024 ** 5,\n  Ei: 1024 ** 6,\n} as const\n\nfunction formatMemoryGi(input: string | undefined): string | undefined {\n  if (!input) {\n    return undefined\n  }\n  const unitMatch = input.match(/^([0-9]+)([A-Za-z]{1,2})$/)\n  if (unitMatch) {\n    const num =\n      (parseInt(unitMatch[1]!, 10) *\n        memoryMultipliers[unitMatch[2]! as keyof typeof memoryMultipliers]) /\n      1024 /\n      1024 /\n      1024\n\n    if (Number.isInteger(num)) {\n      return num.toString()\n    } else {\n      return num.toFixed(2)\n    }\n  }\n\n  return parseInt(input, 10).toFixed(2)\n}\n\nfunction formatContainerImage(fullImageName: string): string {\n  try {\n    const url = new URL(\"https://\" + fullImageName)\n    const path = url.pathname\n    if (path.startsWith(\"/\")) {\n      return path.substring(1, path.length)\n    }\n    return path\n  } catch {\n    return fullImageName\n  }\n}\n\nfunction getResourceDetails(\n  type: string,\n  total: string | undefined,\n  used: string | undefined,\n  usagePercentage: number | undefined\n) {\n  if (type === \"memory\") {\n    return {\n      type,\n      usagePercentage,\n      icon: Memory,\n      used: formatMemoryGi(used),\n      total: formatMemoryGi(total),\n      unit: \"Gi\",\n    }\n  }\n\n  if (type === \"cpu\") {\n    return {\n      type,\n      usagePercentage,\n      icon: CPU,\n      label: \"CPU\",\n      used: formatCPU(used),\n      total: formatCPU(total),\n    }\n  }\n  if (type.endsWith(\"/gpu\")) {\n    return {\n      type,\n      used,\n      icon: CPU,\n      label: \"GPU\",\n      total: total,\n      usagePercentage: 100, // need to adjust if fractional GPUs and GPU monitoring are supported by the k8s metrics server\n    }\n  }\n\n  return {\n    type,\n    used,\n    total: total,\n    usagePercentage,\n  }\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/WorkspaceInstanceCard.tsx",
    "content": "import {\n  ProWorkspaceInstance,\n  useProjectClusters,\n  useTemplates,\n  useWorkspace,\n  useWorkspaceActions,\n} from \"@/contexts\"\nimport {\n  getDisplayName,\n  useDeleteWorkspaceModal,\n  useRebuildWorkspaceModal,\n  useResetWorkspaceModal,\n  useStopWorkspaceModal,\n} from \"@/lib\"\nimport { useStoreTroubleshoot } from \"@/lib/useStoreTroubleshoot\"\nimport { Routes } from \"@/routes\"\nimport { Card, CardBody, CardHeader, useColorModeValue } from \"@chakra-ui/react\"\nimport { useCallback, useMemo } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { WorkspaceCardHeader } from \"./WorkspaceCardHeader\"\nimport { WorkspaceDetails } from \"./WorkspaceDetails\"\nimport { useTemplate } from \"./useTemplate\"\n\ntype TWorkspaceInstanceCardProps = Readonly<{\n  host: string\n  instanceName: string\n  isSelected?: boolean\n  onSelectionChange?: (isSelected: boolean) => void\n}>\n\nexport function WorkspaceInstanceCard({\n  instanceName,\n  host,\n  isSelected,\n  onSelectionChange,\n}: TWorkspaceInstanceCardProps) {\n  const bgColor = useColorModeValue(\"white\", \"gray.900\")\n  const hoverBorderColor = useColorModeValue(\"primary.600\", \"primary.300\")\n  const workspace = useWorkspace<ProWorkspaceInstance>(instanceName)\n  const instance = workspace.data\n  const instanceDisplayName = getDisplayName(instance)\n  const workspaceActions = useWorkspaceActions(instance?.id)\n  const { data: projectClusters } = useProjectClusters()\n\n  const navigate = useNavigate()\n\n  const { modal: stopModal, open: openStopModal } = useStopWorkspaceModal(\n    useCallback(\n      (close) => {\n        workspace.stop()\n        close()\n      },\n      [workspace]\n    )\n  )\n\n  const { modal: deleteModal, open: openDeleteModal } = useDeleteWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (_, close) => {\n        workspace.remove(true)\n        close()\n      },\n      [workspace]\n    ),\n    true\n  )\n\n  const { modal: rebuildModal, open: openRebuildModal } = useRebuildWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (close) => {\n        workspace.rebuild()\n        close()\n        instance?.id && navigate(Routes.toProWorkspace(host, instance.id))\n      },\n      [workspace, navigate, host, instance]\n    )\n  )\n\n  const { modal: resetModal, open: openResetModal } = useResetWorkspaceModal(\n    instanceDisplayName,\n    useCallback(\n      (close) => {\n        workspace.reset()\n        close()\n        instance?.id && navigate(Routes.toProWorkspace(host, instance.id))\n      },\n      [workspace, navigate, host, instance]\n    )\n  )\n\n  const { store: storeTroubleshoot } = useStoreTroubleshoot()\n\n  const handleTroubleshootClicked = useCallback(() => {\n    if (instance && workspaceActions) {\n      storeTroubleshoot({\n        workspace: instance,\n        workspaceActions: workspaceActions,\n      })\n    }\n  }, [storeTroubleshoot, instance, workspaceActions])\n\n  if (!instance) {\n    return null\n  }\n\n  const handleOpenClicked = (ideName: string) => {\n    workspace.start({ id: instance.id, ideConfig: { name: ideName } })\n    navigate(Routes.toProWorkspace(host, instance.id))\n  }\n\n  const cluster = useMemo(() => {\n    if (instance?.spec?.runnerRef?.runner) {\n      return projectClusters?.runners?.find(\n        (runner) => runner.metadata?.name === instance?.spec?.runnerRef?.runner\n      )\n    }\n\n    return projectClusters?.clusters?.find(\n      (cluster) => cluster.metadata?.name === instance?.spec?.target?.cluster?.name\n    )\n  }, [projectClusters, instance])\n\n  const { template, parameters } = useTemplate(instance)\n\n  const isRunning = instance.status?.lastWorkspaceStatus === \"Running\"\n\n  return (\n    <>\n      <Card\n        direction=\"column\"\n        width=\"full\"\n        variant=\"outline\"\n        marginBottom=\"3\"\n        paddingLeft=\"2\"\n        bg={bgColor}\n        _hover={{ borderColor: hoverBorderColor, cursor: \"pointer\" }}\n        boxShadow=\"0px 2px 4px 0px rgba(0, 0, 0, 0.07)\"\n        onClick={() => navigate(Routes.toProWorkspace(host, instance.id))}>\n        <CardHeader overflow=\"hidden\" w=\"full\" pb=\"2\">\n          <WorkspaceCardHeader\n            showSelection={true}\n            isSelected={isSelected}\n            onSelectionChange={onSelectionChange}\n            instance={instance}>\n            <WorkspaceCardHeader.Controls\n              onOpenClicked={handleOpenClicked}\n              onDeleteClicked={openDeleteModal}\n              onRebuildClicked={openRebuildModal}\n              onResetClicked={openResetModal}\n              onStopClicked={!isRunning ? openStopModal : workspace.stop}\n              onTroubleshootClicked={handleTroubleshootClicked}\n            />\n          </WorkspaceCardHeader>\n        </CardHeader>\n        <CardBody py=\"0\">\n          <WorkspaceDetails\n            instance={instance}\n            template={template}\n            cluster={cluster}\n            parameters={parameters}\n            showDetails={false}\n          />\n        </CardBody>\n      </Card>\n\n      {resetModal}\n      {rebuildModal}\n      {deleteModal}\n      {stopModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/WorkspaceStatus.tsx",
    "content": "import { ProWorkspaceInstance } from \"@/contexts\"\nimport { CheckCircle, CircleDuotone, Clock, ExclamationTriangle, NotFound, Sleep } from \"@/icons\"\nimport { BoxProps, HStack, Text } from \"@chakra-ui/react\"\nimport { V1ObjectMeta } from \"@loft-enterprise/client/gen/models/V1ObjectMeta\"\nimport React from \"react\"\nimport { TWorkspaceDisplayStatus, WorkspaceDisplayStatus, determineDisplayStatus } from \"./status\"\n\nconst badgeOptionMappings: {\n  [key in TWorkspaceDisplayStatus]?: Pick<TStatusBadgeProps, \"icon\" | \"color\">\n} = {\n  [WorkspaceDisplayStatus.Pending]: {\n    icon: <Clock boxSize={5} />,\n    color: \"orange.500\",\n  },\n  [WorkspaceDisplayStatus.Sleeping]: {\n    icon: <Sleep boxSize={5} />,\n    color: \"#706BFF\",\n  },\n  [WorkspaceDisplayStatus.Error]: {\n    icon: <ExclamationTriangle boxSize={5} />,\n    color: \"red.500\",\n  },\n  [WorkspaceDisplayStatus.NotFound]: {\n    icon: <NotFound boxSize={5} />,\n    color: \"gray.600\",\n  },\n  [WorkspaceDisplayStatus.Stopped]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"red.400\",\n  },\n  [WorkspaceDisplayStatus.Busy]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"red.500\",\n  },\n  [WorkspaceDisplayStatus.Failed]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"red.500\",\n  },\n  [WorkspaceDisplayStatus.Deleting]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"red.500\",\n  },\n  [WorkspaceDisplayStatus.Running]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"primary.500\",\n  },\n  [WorkspaceDisplayStatus.Ready]: {\n    icon: <CheckCircle boxSize={5} />,\n    color: \"primary.400\",\n  },\n  [WorkspaceDisplayStatus.WaitingToInitialize]: {\n    icon: <CircleDuotone boxSize={5} />,\n    color: \"gray.600\",\n  },\n}\n\ntype TWorkspaceStatusProps = Readonly<{\n  status: ProWorkspaceInstance[\"status\"]\n  deletionTimestamp: V1ObjectMeta[\"deletionTimestamp\"]\n}>\nexport function WorkspaceStatus({ status, deletionTimestamp }: TWorkspaceStatusProps) {\n  const displayStatus = determineDisplayStatus(status, deletionTimestamp)\n\n  return <WorkspaceDisplayStatusBadge displayStatus={displayStatus} />\n}\n\nexport function WorkspaceDisplayStatusBadge({\n  displayStatus,\n  compact,\n}: {\n  displayStatus: TWorkspaceDisplayStatus\n  compact?: boolean\n}) {\n  const badgeProps = badgeOptionMappings[displayStatus]\n\n  return <StatusBadge displayStatus={displayStatus} compact={compact} {...badgeProps} />\n}\n\ntype TStatusBadgeProps = Readonly<{\n  icon?: React.ReactNode\n  color?: BoxProps[\"color\"]\n  displayStatus: TWorkspaceDisplayStatus\n  compact?: boolean\n}>\nfunction StatusBadge({ icon, displayStatus, color, compact }: TStatusBadgeProps) {\n  let s: string = displayStatus\n  if (displayStatus === WorkspaceDisplayStatus.WaitingToInitialize) {\n    s = \"Waiting to Initialize\"\n  }\n\n  return (\n    <HStack\n      w={compact ? \"fit-content\" : \"full\"}\n      align=\"center\"\n      justify=\"start\"\n      gap=\"1\"\n      color={color}>\n      {icon}\n      {!compact && <Text fontWeight=\"medium\">{s}</Text>}\n    </HStack>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/index.ts",
    "content": "export { Workspace } from \"./Workspace\"\nexport { WorkspaceStatus } from \"./WorkspaceStatus\"\nexport { WorkspaceInstanceCard } from \"./WorkspaceInstanceCard\"\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/status.ts",
    "content": "import { ProWorkspaceInstance } from \"@/contexts\"\n\nexport const InstancePhase = {\n  Ready: \"Ready\",\n  WaitingToInitialize: \"\",\n  Sleeping: \"Sleeping\",\n  Failed: \"Failed\",\n  Deleting: \"Deleting\",\n  Pending: \"Pending\",\n} as const\n\nexport const InstanceStatus = {\n  Running: \"Running\",\n  Stopped: \"Stopped\",\n  Busy: \"Busy\",\n  NotFound: \"NotFound\",\n} as const\n\nexport const WorkspaceDisplayStatus = {\n  ...InstancePhase,\n  ...InstanceStatus,\n  Error: \"Error\",\n} as const\nexport type TWorkspaceDisplayStatus =\n  (typeof WorkspaceDisplayStatus)[keyof typeof WorkspaceDisplayStatus]\n\nexport function determineDisplayStatus(\n  status: ProWorkspaceInstance[\"status\"],\n  deletionTimestamp: Date | undefined\n): TWorkspaceDisplayStatus {\n  const phase = status?.phase\n  const lastWorkspaceStatus = status?.lastWorkspaceStatus\n  if (deletionTimestamp) {\n    return WorkspaceDisplayStatus.Deleting\n  }\n\n  if (!phase || phase === InstancePhase.Pending) {\n    return WorkspaceDisplayStatus.Pending\n  }\n\n  if (phase === InstancePhase.Failed) {\n    return WorkspaceDisplayStatus.Error\n  }\n\n  if (phase === InstancePhase.WaitingToInitialize) {\n    return WorkspaceDisplayStatus.WaitingToInitialize\n  }\n\n  if (phase === InstancePhase.Ready) {\n    if (lastWorkspaceStatus === InstanceStatus.NotFound) {\n      return WorkspaceDisplayStatus.NotFound\n    }\n\n    if (lastWorkspaceStatus === InstanceStatus.Stopped) {\n      return WorkspaceDisplayStatus.Stopped\n    }\n\n    if (lastWorkspaceStatus === InstanceStatus.Busy) {\n      return WorkspaceDisplayStatus.Busy\n    }\n\n    if (lastWorkspaceStatus === InstanceStatus.Running) {\n      return WorkspaceDisplayStatus.Running\n    }\n\n    return WorkspaceDisplayStatus.Ready\n  }\n\n  return phase as TWorkspaceDisplayStatus\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/types.ts",
    "content": "import { ProWorkspaceInstance } from \"@/contexts\"\nimport { TWorkspaceResult } from \"@/contexts/DevPodContext/workspaces/useWorkspace\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\n\nexport type TTabProps = Readonly<{\n  host: string\n  workspace: TWorkspaceResult<ProWorkspaceInstance>\n  instance: ProWorkspaceInstance\n  template: ManagementV1DevPodWorkspaceTemplate | undefined\n}>\n"
  },
  {
    "path": "desktop/src/views/Pro/Workspace/useTemplate.ts",
    "content": "import { useTemplates } from \"@/contexts\"\nimport { TParameterWithValue, getParametersWithValues } from \"@/lib\"\nimport { ManagementV1DevPodWorkspaceInstance } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceInstance\"\nimport { ManagementV1DevPodWorkspaceTemplate } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspaceTemplate\"\nimport { useMemo } from \"react\"\n\nexport function useTemplate(instance: ManagementV1DevPodWorkspaceInstance | undefined) {\n  const { data: templates } = useTemplates()\n\n  return useMemo<{\n    parameters: readonly TParameterWithValue[]\n    template: ManagementV1DevPodWorkspaceTemplate | undefined\n  }>(() => {\n    // find template for workspace\n    const currentTemplate = templates?.workspace.find(\n      (template) => instance?.spec?.templateRef?.name === template.metadata?.name\n    )\n    const empty = { parameters: [], template: undefined }\n    if (!currentTemplate || !instance) {\n      return empty\n    }\n\n    const parameters = getParametersWithValues(instance, currentTemplate)\n    if (!parameters) {\n      return { parameters: [], template: currentTemplate }\n    }\n\n    return { parameters, template: currentTemplate }\n  }, [instance, templates])\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/helpers.ts",
    "content": "import { ManagementV1DevPodWorkspacePreset } from \"@loft-enterprise/client/gen/models/managementV1DevPodWorkspacePreset\"\n\nexport function presetDisplayName(preset: ManagementV1DevPodWorkspacePreset | undefined) {\n  return preset?.spec?.displayName ?? preset?.metadata?.name\n}\n"
  },
  {
    "path": "desktop/src/views/Pro/index.ts",
    "content": "export { ListWorkspaces } from \"./ListWorkspaces\"\nexport { ProInstance } from \"./ProInstance\"\nexport { Workspace } from \"./Workspace\"\nexport { CreateWorkspace } from \"./CreateWorkspace\"\nexport { SelectPreset } from \"./SelectPreset\"\nexport { Settings } from \"./Settings\"\nexport { Profile } from \"./Profile\"\nexport { Credentials } from \"./Credentials\"\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/ConfigureProviderOptionsForm.tsx",
    "content": "import { BottomActionBar, BottomActionBarError, CollapsibleSection } from \"@/components\"\nimport { CheckIcon } from \"@chakra-ui/icons\"\nimport {\n  Box,\n  Button,\n  Center,\n  Checkbox,\n  CircularProgress,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  HStack,\n  SimpleGrid,\n  Spinner,\n  Tooltip,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport styled from \"@emotion/styled\"\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport {\n  FormEventHandler,\n  RefObject,\n  useCallback,\n  useEffect,\n  useMemo,\n  useRef,\n  useState,\n} from \"react\"\nimport { DefaultValues, FormProvider, UseFormReturn, useForm } from \"react-hook-form\"\nimport { useBorderColor } from \"../../../Theme\"\nimport { client } from \"../../../client\"\nimport { useProvider } from \"../../../contexts\"\nimport { exists, useFormErrors } from \"../../../lib\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport {\n  TConfigureProviderConfig,\n  TProvider,\n  TProviderID,\n  TProviderOption,\n  TProviderOptions,\n  TWorkspace,\n} from \"../../../types\"\nimport { canCreateMachine } from \"../helpers\"\nimport { OptionFormField } from \"./OptionFormField\"\nimport { useProviderDisplayOptions } from \"./useProviderOptions\"\n\nconst Form = styled.form`\n  width: 100%;\n  position: relative;\n`\n\nconst FieldName = {\n  REUSE_MACHINE: \"reuseMachine\",\n  USE_AS_DEFAULT: \"useAsDefault\",\n} as const\n\ntype TFieldValues = Readonly<{\n  [FieldName.REUSE_MACHINE]: boolean | undefined\n  [FieldName.USE_AS_DEFAULT]: boolean\n  [key: string]: string | boolean | undefined\n}>\ntype TCommonProps = Readonly<{\n  providerID: TProviderID\n  isModal?: boolean\n  addProvider?: boolean\n  isDefault?: boolean\n  reuseMachine: boolean\n  containerRef?: RefObject<HTMLDivElement>\n  showBottomActionBar?: boolean\n  suggestedOptions?: Record<string, string>\n  submitTitle?: string\n}>\ntype TConfigureProviderOptionsFormProps = TWithWorkspace | TWithoutWorkspace\ntype TWithWorkspace = Readonly<{\n  workspace: TWorkspace\n  onFinish?: (extraProviderOptions: Record<string, string>) => void\n}> &\n  TCommonProps\ntype TWithoutWorkspace = Readonly<{\n  workspace?: never\n  onFinish?: () => void\n}> &\n  TCommonProps\n\nexport function ConfigureProviderOptionsForm(props: TConfigureProviderOptionsFormProps) {\n  if (props.workspace !== undefined) {\n    // configure provider options on workspace level\n    return <WorkspaceProviderOptionsForm {...props} workspace={props.workspace} />\n  }\n\n  // configure provider\n  return <ProviderOptionsForm {...props} />\n}\n\ntype TProviderOptionsFormProps = TWithoutWorkspace\nfunction ProviderOptionsForm(props: TProviderOptionsFormProps) {\n  const queryClient = useQueryClient()\n  const handleSave: TConfigureOptionsFormProps[\"onSave\"] = useCallback(\n    async ({ providerID, config }) => {\n      ;(await client.providers.configure(providerID, config)).unwrap()\n      await queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n    },\n    [queryClient]\n  )\n\n  return <ConfigureOptionsForm {...props} onSave={handleSave} />\n}\n\ntype TWorkspaceProviderOptionsFormProps = TWithWorkspace\nfunction WorkspaceProviderOptionsForm({ workspace, ...props }: TWorkspaceProviderOptionsFormProps) {\n  const handleSave: TConfigureOptionsFormProps[\"onSave\"] = useCallback(async () => {\n    /* noop */\n  }, [])\n\n  return <ConfigureOptionsForm {...props} workspace={workspace} onSave={handleSave} />\n}\n\ntype TConfigureOptionsFormProps = TConfigureProviderOptionsFormProps &\n  Readonly<{\n    onSave: (\n      args: Readonly<{ providerID: TProviderID; config: TConfigureProviderConfig }>\n    ) => Promise<void>\n  }>\nfunction ConfigureOptionsForm({\n  containerRef,\n  providerID,\n  onFinish,\n  isDefault,\n  reuseMachine,\n  addProvider = false,\n  isModal = false,\n  showBottomActionBar = true,\n  submitTitle,\n  suggestedOptions,\n  workspace,\n  onSave,\n}: TConfigureOptionsFormProps) {\n  const loadingBgColor = useColorModeValue(\"whiteAlpha.400\", \"blackAlpha.400\")\n  const [provider] = useProvider(providerID)\n\n  const formMethods = useForm<TFieldValues>({\n    defaultValues: {\n      reuseMachine,\n      useAsDefault: isDefault,\n    },\n  })\n  const { reuseMachineError, useAsDefaultError } = useFormErrors(\n    Object.values(FieldName),\n    formMethods.formState\n  )\n\n  const {\n    allOptions,\n    displayOptions,\n    error: optionsError,\n    refresh: refreshOptions,\n    isRefreshing,\n  } = useOptions(providerID, provider, workspace, suggestedOptions, formMethods)\n\n  const {\n    status,\n    error: configureError,\n    mutate: configureProvider,\n  } = useMutation<\n    void,\n    Error,\n    Readonly<{ providerID: TProviderID; config: TConfigureProviderConfig }>\n  >({\n    mutationFn: onSave,\n    onSuccess(_, { config: { options } }) {\n      formMethods.reset(\n        { reuseMachine, useAsDefault: isDefault },\n        { keepValues: true, keepDirty: false }\n      )\n      onFinish?.(options)\n    },\n  })\n\n  const error = useMemo(\n    () => configureError ?? optionsError ?? undefined,\n    [configureError, optionsError]\n  )\n  // Open error popover when error changes\n  const errorButtonRef = useRef<HTMLButtonElement>(null)\n  useEffect(() => {\n    if (error) {\n      errorButtonRef.current?.click()\n    }\n  }, [error])\n\n  const backgroundColor = useColorModeValue(\"gray.50\", \"gray.800\")\n  const borderColor = useBorderColor()\n\n  const handleRefreshSubOptions = useCallback(\n    (id: string) => refreshOptions({ targetOptionID: id }),\n    [refreshOptions]\n  )\n\n  const handleSubmit: FormEventHandler<HTMLFormElement> = (event) => {\n    // make sure we don't bubble up the event to the parent\n    event.stopPropagation()\n    event.preventDefault()\n\n    formMethods.handleSubmit((data) => {\n      const { useAsDefault, reuseMachine } = data\n      configureProvider({\n        providerID,\n        config: {\n          reuseMachine: reuseMachine ?? false,\n          useAsDefaultProvider: useAsDefault,\n          options: filterOptions(data, allOptions),\n        },\n      })\n    })(event)\n  }\n\n  const submitButtonText = useMemo(() => {\n    if (submitTitle !== undefined) {\n      return submitTitle\n    }\n\n    return addProvider ? \"Add Provider\" : \"Update Options\"\n  }, [addProvider, submitTitle])\n\n  const showDefaultField = useMemo(() => {\n    if (isDefault === undefined) {\n      return false\n    }\n\n    return addProvider || !isDefault\n  }, [addProvider, isDefault])\n\n  const showReuseMachineField = useMemo(\n    () => canCreateMachine(provider?.config),\n    [provider?.config]\n  )\n\n  if (!exists(provider) || !allOptions) {\n    return <Spinner style={{ margin: \"0 auto 3rem auto\" }} />\n  }\n\n  return (\n    <FormProvider {...formMethods}>\n      <Form aria-readonly={true} onSubmit={handleSubmit}>\n        <VStack align=\"start\" width=\"full\">\n          <VStack align=\"start\" spacing={8} position=\"relative\" width=\"full\">\n            <Center\n              opacity={isRefreshing ? \"1\" : \"0\"}\n              pointerEvents={isRefreshing ? \"auto\" : \"none\"}\n              transitionDuration=\"150ms\"\n              transitionProperty=\"opacity,backdrop-filter\"\n              position=\"absolute\"\n              zIndex=\"tooltip\"\n              top=\"0\"\n              bottom=\"0\"\n              width=\"full\"\n              backdropFilter=\"auto\"\n              backdropBlur=\"2px\"\n              bgColor={loadingBgColor}>\n              <CircularProgress isIndeterminate boxSize={6} margin=\"auto\" color=\"gray.700\" />\n            </Center>\n\n            {displayOptions.required.length > 0 && (\n              <Box width=\"full\">\n                <VStack align=\"start\" spacing={4}>\n                  {displayOptions.required.map((option) => (\n                    <OptionFormField\n                      key={option.id}\n                      onRefresh={handleRefreshSubOptions}\n                      isRequired\n                      {...option}\n                    />\n                  ))}\n                </VStack>\n              </Box>\n            )}\n\n            {displayOptions.groups.map(\n              (group) =>\n                group.options.length > 0 && (\n                  <Box key={group.name} width=\"full\">\n                    <CollapsibleSection\n                      showIcon={true}\n                      title={group.name}\n                      isOpen={!!group.defaultVisible}>\n                      <SimpleGrid minChildWidth=\"60\" spacingX={8} spacingY={4}>\n                        {group.options.map((option) => (\n                          <OptionFormField\n                            key={option.id}\n                            onRefresh={handleRefreshSubOptions}\n                            isRequired={!!option.required}\n                            {...option}\n                          />\n                        ))}\n                      </SimpleGrid>\n                    </CollapsibleSection>\n                  </Box>\n                )\n            )}\n\n            {displayOptions.other.length > 0 && (\n              <Box width=\"full\">\n                <CollapsibleSection showIcon={true} title={\"Optional\"} isOpen={false}>\n                  <SimpleGrid minChildWidth=\"60\" spacingX={8} spacingY={4}>\n                    {displayOptions.other.map((option) => (\n                      <OptionFormField\n                        key={option.id}\n                        onRefresh={handleRefreshSubOptions}\n                        {...option}\n                      />\n                    ))}\n                  </SimpleGrid>\n                </CollapsibleSection>\n              </Box>\n            )}\n\n            {showReuseMachineField && (\n              <Box width=\"full\">\n                <VStack\n                  align=\"start\"\n                  spacing={4}\n                  width=\"full\"\n                  backgroundColor={backgroundColor}\n                  borderRadius=\"lg\"\n                  borderWidth=\"thin\"\n                  padding={\"10px\"}\n                  margin={\"10px\"}\n                  borderColor={borderColor}>\n                  <FormControl variant=\"contrast\">\n                    <Checkbox {...formMethods.register(FieldName.REUSE_MACHINE)}>\n                      Reuse Machine\n                    </Checkbox>\n                    {exists(reuseMachineError) ? (\n                      <FormErrorMessage>{reuseMachineError.message ?? \"Error\"}</FormErrorMessage>\n                    ) : (\n                      <FormHelperText>\n                        Provider will reuse the VM of the first workspace for all subsequent\n                        workspaces. Otherwise, it will spin up one VM per workspace.\n                      </FormHelperText>\n                    )}\n                  </FormControl>\n                </VStack>\n              </Box>\n            )}\n          </VStack>\n\n          {showBottomActionBar && (\n            <BottomActionBar isModal={isModal}>\n              <HStack>\n                <Tooltip\n                  label=\"Please configure provider\"\n                  isDisabled={formMethods.formState.isValid}>\n                  <Button\n                    type=\"submit\"\n                    variant=\"primary\"\n                    isLoading={formMethods.formState.isSubmitting || status === \"loading\"}\n                    isDisabled={!formMethods.formState.isValid || isRefreshing}\n                    rightIcon={\n                      status === \"success\" && !formMethods.formState.isDirty ? (\n                        <CheckIcon />\n                      ) : undefined\n                    }\n                    title={submitButtonText}>\n                    {submitButtonText}\n                  </Button>\n                </Tooltip>\n\n                {showDefaultField && (\n                  <FormControl\n                    paddingX=\"6\"\n                    flexDirection=\"row\"\n                    display=\"flex\"\n                    width=\"fit-content\"\n                    isInvalid={exists(useAsDefaultError)}>\n                    <Checkbox {...formMethods.register(FieldName.USE_AS_DEFAULT)} />\n                    <FormHelperText marginLeft=\"2\" marginTop=\"0\">\n                      Set as default{\" \"}\n                    </FormHelperText>\n                  </FormControl>\n                )}\n              </HStack>\n\n              <HStack />\n\n              <BottomActionBarError error={error} containerRef={containerRef} />\n            </BottomActionBar>\n          )}\n        </VStack>\n      </Form>\n    </FormProvider>\n  )\n}\n\nfunction stripOptionChildren(\n  configuredOptions: Record<string, string>,\n  allOptions: TProviderOptions | undefined,\n  id: string\n) {\n  // filter children\n  allOptions?.[id]?.children?.forEach((child) => {\n    delete configuredOptions[child]\n    stripOptionChildren(configuredOptions, allOptions, child)\n  })\n}\n\nfunction filterOptions(\n  configuredOptions: TFieldValues,\n  allOptions: TProviderOptions | undefined\n): Record<string, string> {\n  const newOptions: Record<string, string> = {}\n  Object.keys(configuredOptions).forEach((option) => {\n    if (exists(configuredOptions[option]) && exists(allOptions?.[option])) {\n      newOptions[option] = configuredOptions[option] + \"\"\n    }\n  })\n\n  return newOptions\n}\n\nfunction useOptions(\n  providerID: string,\n  provider: TProvider | undefined,\n  workspace: TWorkspace | undefined,\n  suggestedOptions: Record<string, string> | undefined,\n  formMethods: UseFormReturn<TFieldValues>\n) {\n  const [isEditingWorkspaceOptions, setIsEditingWorkspaceOptions] = useState(false)\n  const { data: queryOptions, error: queryError } = useQuery<TProviderOptions | undefined, Error>({\n    queryKey: QueryKeys.providerSetOptions(providerID),\n    queryFn: async () => {\n      return (\n        await client.providers.setOptionsDry(providerID, { options: {}, reconfigure: false })\n      ).unwrap()\n    },\n  })\n\n  const {\n    data: refreshOptions,\n    error: refreshError,\n    status: refreshStatus,\n    mutate: refreshSubOptionsMutation,\n  } = useMutation<\n    TProviderOptions | undefined,\n    Error,\n    Readonly<{ targetOptionID?: string; options?: TProviderOptions }>\n  >({\n    mutationFn: async ({ targetOptionID, options }) => {\n      const filteredOptions = filterOptions(formMethods.getValues(), options ?? allOptions)\n      if (targetOptionID) {\n        stripOptionChildren(filteredOptions, allOptions, targetOptionID)\n      }\n\n      return (\n        await client.providers.setOptionsDry(providerID, {\n          options: filteredOptions,\n          reconfigure: true,\n        })\n      ).unwrap()\n    },\n    onSuccess(data) {\n      if (!data) {\n        return\n      }\n\n      const newOptions: DefaultValues<TFieldValues> = {}\n      for (const option in data) {\n        if (data[option]?.value) {\n          newOptions[option] = data[option]?.value ?? undefined\n        }\n      }\n\n      formMethods.reset(newOptions, { keepDirty: true, keepTouched: true, keepSubmitCount: true })\n    },\n  })\n\n  useEffect(() => {\n    if (Object.keys(suggestedOptions ?? {}).length === 0) {\n      return\n    }\n\n    const opts = suggestedOptions ?? {}\n    const changedOptions = []\n    for (const option in suggestedOptions) {\n      const { isDirty } = formMethods.getFieldState(option)\n      if (!isDirty) {\n        formMethods.setValue(option, opts[option], {\n          shouldDirty: true,\n          shouldValidate: true,\n          shouldTouch: true,\n        })\n      }\n      changedOptions.push(option)\n    }\n    if (changedOptions.length > 0) {\n      refreshSubOptionsMutation({\n        options: changedOptions.reduce((acc, o) => {\n          const option = { value: opts[o] } as unknown as TProviderOption\n\n          return { ...acc, [o]: option }\n        }, {} as TProviderOptions),\n      })\n    }\n    // only rerun when suggestedOptions changes\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [suggestedOptions])\n\n  useEffect(() => {\n    const workspaceOptions = workspace?.provider?.options\n    if (!workspaceOptions) {\n      return\n    }\n\n    const changedOptions: TProviderOptions = {}\n    for (const [optionName, option] of Object.entries(workspaceOptions)) {\n      const { isDirty } = formMethods.getFieldState(optionName)\n      if (!isDirty && option.value !== null) {\n        formMethods.setValue(optionName, option.value, {\n          shouldDirty: true,\n          shouldValidate: true,\n          shouldTouch: true,\n        })\n      }\n      changedOptions[optionName] = option\n    }\n    if (Object.keys(changedOptions).length > 0) {\n      setIsEditingWorkspaceOptions(true)\n      refreshSubOptionsMutation({ options: changedOptions })\n    }\n    // only rerun when workspace options change\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [workspace?.provider?.options])\n\n  const allOptions = useMemo(() => {\n    if (refreshOptions) {\n      return refreshOptions\n    }\n\n    if (queryOptions) {\n      return queryOptions\n    }\n\n    return undefined\n  }, [queryOptions, refreshOptions])\n  const error = queryError ?? refreshError\n  const displayOptions = useProviderDisplayOptions(\n    allOptions,\n    provider?.config?.optionGroups ?? [],\n    isEditingWorkspaceOptions\n  )\n  const isRefreshing = refreshStatus === \"loading\"\n\n  return { allOptions, displayOptions, error, isRefreshing, refresh: refreshSubOptionsMutation }\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/LoadingProviderIndicator.tsx",
    "content": "import { Box, HStack, Text } from \"@chakra-ui/react\"\n\nexport function LoadingProviderIndicator({ label }: Readonly<{ label: string | undefined }>) {\n  return (\n    <HStack marginTop=\"2\" justifyContent=\"center\" alignItems=\"center\" color=\"gray.600\">\n      <Text fontWeight=\"medium\">{label}</Text>\n      <Box as=\"svg\" height=\"3\" marginInlineStart=\"0 !important\" width=\"8\" viewBox=\"0 0 48 30\">\n        <circle fill=\"currentColor\" stroke=\"none\" cx=\"6\" cy=\"24\" r=\"6\">\n          <animateTransform\n            attributeName=\"transform\"\n            dur=\"1s\"\n            type=\"translate\"\n            values=\"0 0; 0 -12; 0 0; 0 0; 0 0; 0 0\"\n            repeatCount=\"indefinite\"\n            begin=\"0\"\n          />\n        </circle>\n        <circle fill=\"currentColor\" stroke=\"none\" cx=\"24\" cy=\"24\" r=\"6\">\n          <animateTransform\n            id=\"op\"\n            attributeName=\"transform\"\n            dur=\"1s\"\n            type=\"translate\"\n            values=\"0 0; 0 -12; 0 0; 0 0; 0 0; 0 0\"\n            repeatCount=\"indefinite\"\n            begin=\"0.3s\"\n          />\n        </circle>\n        <circle fill=\"currentColor\" stroke=\"none\" cx=\"42\" cy=\"24\" r=\"6\">\n          <animateTransform\n            id=\"op\"\n            attributeName=\"transform\"\n            dur=\"1s\"\n            type=\"translate\"\n            values=\"0 0; 0 -12; 0 0; 0 0; 0 0; 0 0\"\n            repeatCount=\"indefinite\"\n            begin=\"0.6s\"\n          />\n        </circle>\n      </Box>\n    </HStack>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/OptionFormField.tsx",
    "content": "import { TOptionWithID } from \"../helpers\"\nimport { Controller, useFormContext } from \"react-hook-form\"\nimport { ReactNode, useMemo } from \"react\"\nimport { exists } from \"../../../lib\"\nimport { AutoComplete } from \"../../../components\"\nimport {\n  Checkbox,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Input,\n  Select,\n  Textarea,\n} from \"@chakra-ui/react\"\n\ntype TOptionFormField = TOptionWithID &\n  Readonly<{ isRequired?: boolean; onRefresh?: (id: string) => void }>\n\nexport function OptionFormField({\n  id,\n  defaultValue,\n  value,\n  password,\n  description,\n  type,\n  displayName,\n  suggestions,\n  enum: enumProp,\n  onRefresh,\n  subOptionsCommand,\n  isRequired = false,\n}: TOptionFormField) {\n  const { register, formState } = useFormContext()\n  const optionError = formState.errors[id]\n\n  const input = useMemo<ReactNode>(() => {\n    const registerProps = register(id, { required: isRequired })\n    const valueProp = exists(value) ? { defaultValue: value } : {}\n    const defaultValueProp = exists(defaultValue) ? { defaultValue } : {}\n    const props = {\n      ...defaultValueProp,\n      ...valueProp,\n      ...registerProps,\n    }\n    const refresh = () => {\n      onRefresh?.(id)\n    }\n\n    if (exists(suggestions)) {\n      return (\n        <Controller\n          name={id}\n          defaultValue={value ?? defaultValue ?? undefined}\n          rules={{ required: isRequired }}\n          render={({ field: { onChange, onBlur, value: v, ref } }) => {\n            return (\n              <AutoComplete\n                ref={ref}\n                value={v || \"\"}\n                onBlur={wrapFunction(onBlur, refresh, !!subOptionsCommand)}\n                onChange={(value) => {\n                  if (value) {\n                    onChange(value)\n                  }\n                }}\n                placeholder={`Enter ${displayName}`}\n                options={suggestions.map((s) => ({ key: s, label: s }))}\n              />\n            )\n          }}\n        />\n      )\n    }\n    if (enumProp?.length) {\n      let placeholder: string | undefined = \"Select option\"\n      if (value) {\n        placeholder = undefined\n      }\n\n      return (\n        <Select\n          {...props}\n          onChange={wrapFunction(props.onChange, refresh, !!subOptionsCommand)}\n          onBlur={wrapFunction(props.onChange, refresh, !!subOptionsCommand)}\n          placeholder={placeholder}>\n          {enumProp.map(\n            (opt, i) =>\n              opt.value && (\n                <option key={i} value={opt.value}>\n                  {opt.displayName ?? opt.value}\n                </option>\n              )\n          )}\n        </Select>\n      )\n    }\n\n    switch (type) {\n      case \"boolean\":\n        return (\n          <Checkbox {...props} defaultChecked={props.defaultValue === \"true\"}>\n            {displayName}\n          </Checkbox>\n        )\n      case \"number\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={`Enter ${displayName}`}\n            type=\"number\"\n            {...props}\n            onBlur={wrapFunction(props.onBlur, refresh, !!subOptionsCommand)}\n          />\n        )\n      case \"duration\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={`Enter ${displayName}`}\n            type=\"text\"\n            {...props}\n            onBlur={wrapFunction(props.onBlur, refresh, !!subOptionsCommand)}\n          />\n        )\n      case \"string\":\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={`Enter ${displayName}`}\n            type={password ? \"password\" : \"text\"}\n            {...props}\n            onBlur={wrapFunction(props.onBlur, refresh, !!subOptionsCommand)}\n          />\n        )\n      case \"multiline\":\n        return (\n          <Textarea\n            rows={2}\n            spellCheck={false}\n            placeholder={`Enter ${displayName}`}\n            whiteSpace=\"pre\"\n            {...props}\n            onBlur={wrapFunction(props.onBlur, refresh, !!subOptionsCommand)}\n          />\n        )\n      default:\n        return (\n          <Input\n            spellCheck={false}\n            placeholder={`Enter ${displayName}`}\n            type={password ? \"password\" : \"text\"}\n            {...props}\n            onBlur={wrapFunction(props.onBlur, refresh, !!subOptionsCommand)}\n          />\n        )\n    }\n  }, [\n    register,\n    id,\n    isRequired,\n    value,\n    defaultValue,\n    suggestions,\n    enumProp,\n    type,\n    onRefresh,\n    subOptionsCommand,\n    displayName,\n    password,\n  ])\n\n  return (\n    <FormControl isRequired={isRequired}>\n      <FormLabel>{displayName}</FormLabel>\n      {input}\n      {exists(optionError) ? (\n        <FormErrorMessage>{optionError.message?.toString() ?? \"Error\"}</FormErrorMessage>\n      ) : (\n        exists(description) && <FormHelperText userSelect=\"text\">{description}</FormHelperText>\n      )}\n    </FormControl>\n  )\n}\n\nfunction wrapFunction<TFn extends (event: any) => any>(\n  fn: TFn | undefined,\n  wrap: (() => void) | undefined,\n  shouldWrap: boolean\n): (event?: Parameters<TFn>[0]) => void {\n  return (event) => {\n    if (fn) {\n      fn(event)\n    }\n\n    if (shouldWrap) {\n      wrap?.()\n    }\n  }\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/SetupClonedProvider.tsx",
    "content": "import { Form } from \"@/components/Form\"\nimport {\n  Code,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { useCallback } from \"react\"\nimport { Controller, useForm } from \"react-hook-form\"\nimport { ErrorMessageBox } from \"../../../components\"\nimport { useProviders } from \"../../../contexts\"\nimport { exists, isError, useFormErrors } from \"../../../lib\"\nimport { LoadingProviderIndicator } from \"./LoadingProviderIndicator\"\nimport { CustomNameInput } from \"./SetupProviderSourceForm\"\nimport { ALLOWED_NAMES_REGEX } from \"./helpers\"\nimport { FieldName, TCloneProviderInfo, TFormValues, TSetupProviderResult } from \"./types\"\nimport { useAddProvider } from \"./useAddProvider\"\n\ntype TCloneProviderProps = Readonly<{\n  isModal?: boolean\n  cloneProviderInfo: TCloneProviderInfo\n  onFinish: (result: TSetupProviderResult) => void\n  reset: () => void\n}>\nexport function SetupClonedProvider({ cloneProviderInfo, onFinish, reset }: TCloneProviderProps) {\n  const [[providers]] = useProviders()\n  const { handleSubmit, formState, control, watch } = useForm<TFormValues>({\n    defaultValues: {\n      [FieldName.PROVIDER_SOURCE]: cloneProviderInfo.sourceProviderSource,\n    },\n  })\n  const newProviderName = watch(FieldName.PROVIDER_NAME)\n  const { providerNameError } = useFormErrors([FieldName.PROVIDER_NAME], formState)\n  const {\n    mutate: addProvider,\n    status,\n    error,\n  } = useAddProvider({\n    onSuccess(result) {\n      onFinish({\n        providerID: result.providerID,\n        suggestedOptions: {},\n      })\n    },\n    onError() {\n      reset()\n    },\n  })\n  const onSubmit = useCallback(\n    async (values: TFormValues) => {\n      addProvider({\n        rawProviderSource: values[FieldName.PROVIDER_SOURCE],\n        config: { name: values[FieldName.PROVIDER_NAME] },\n      })\n    },\n    [addProvider]\n  )\n  const isLoading = status === \"loading\"\n\n  return (\n    <>\n      <VStack align=\"start\" spacing={8} width=\"full\" marginBottom={6}>\n        <Form onSubmit={handleSubmit(onSubmit)} justifyContent=\"center\">\n          <FormControl\n            alignSelf=\"center\"\n            maxWidth={{ base: \"3xl\", xl: \"4xl\" }}\n            marginBottom={4}\n            isDisabled={isLoading || status === \"success\"}\n            isInvalid={exists(providerNameError)}>\n            <FormLabel>Name</FormLabel>\n            <Controller\n              name={FieldName.PROVIDER_NAME}\n              control={control}\n              rules={{\n                pattern: {\n                  value: ALLOWED_NAMES_REGEX,\n                  message: \"Name can only contain lowercase letters, numbers and -\",\n                },\n                validate: {\n                  unique: (value) => {\n                    if (value === undefined) return true\n                    if (value === \"\") return \"Name cannot be empty\"\n\n                    return providers?.[value] === undefined ? true : \"Name must be unique\"\n                  },\n                },\n                maxLength: { value: 48, message: \"Name cannot be longer than 48 characters\" },\n              }}\n              render={({ field }) => (\n                <CustomNameInput\n                  field={field}\n                  onAccept={handleSubmit(onSubmit)}\n                  isInvalid={exists(providerNameError)}\n                  isDisabled={isLoading || status === \"success\"}\n                />\n              )}\n            />\n            {exists(providerNameError) ? (\n              <FormErrorMessage>{providerNameError.message ?? \"Error\"}</FormErrorMessage>\n            ) : (\n              <FormHelperText>\n                Please give your provider a different name from the one specified in its{\" \"}\n                <Code>provider.yaml</Code>\n              </FormHelperText>\n            )}\n          </FormControl>\n\n          {status === \"error\" && isError(error) && <ErrorMessageBox error={error} />}\n          {isLoading && (\n            <LoadingProviderIndicator\n              label={`Cloning ${cloneProviderInfo.sourceProviderID} -> ${newProviderName}`}\n            />\n          )}\n        </Form>\n      </VStack>\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/SetupProviderSourceForm.tsx",
    "content": "import { Form } from \"@/components/Form\"\nimport { CheckIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  ButtonGroup,\n  Code,\n  Container,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  HStack,\n  Icon,\n  Input,\n  InputGroup,\n  InputProps,\n  InputRightElement,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Stack,\n  Text,\n  useBreakpointValue,\n  useColorMode,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { useQueryClient } from \"@tanstack/react-query\"\nimport { AnimatePresence, motion } from \"framer-motion\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport {\n  Controller,\n  ControllerRenderProps,\n  SetValueConfig,\n  SubmitHandler,\n  useForm,\n} from \"react-hook-form\"\nimport { FiFolder } from \"react-icons/fi\"\nimport { client } from \"../../../client\"\nimport { ErrorMessageBox, ExampleCard } from \"../../../components\"\nimport { RECOMMENDED_PROVIDER_SOURCES } from \"../../../constants\"\nimport { useProviders } from \"../../../contexts\"\nimport { Stack3D } from \"../../../icons\"\nimport { CommunitySvg, CustomSvg } from \"../../../images\"\nimport { exists, isError, randomString, useFormErrors } from \"../../../lib\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport { TCommunityProvider, TProviderID } from \"../../../types\"\nimport { useCommunityContributions } from \"../../../useCommunityContributions\"\nimport { LoadingProviderIndicator } from \"./LoadingProviderIndicator\"\nimport { FieldName, TFormValues, TSetupProviderResult } from \"./types\"\nimport { useAddProvider } from \"./useAddProvider\"\n\nconst ALLOWED_NAMES_REGEX = /^[a-z0-9\\\\-]+$/\nconst DEFAULT_VAL_OPTS: SetValueConfig = {\n  shouldDirty: true,\n  shouldValidate: true,\n}\n\ntype TSetupProviderSourceFormProps = Readonly<{\n  suggestedProvider?: TProviderID\n  reset: () => void\n  onFinish: (result: TSetupProviderResult) => void\n  removeDanglingProviders: VoidFunction\n}>\nexport function SetupProviderSourceForm({\n  suggestedProvider,\n  reset,\n  onFinish,\n  removeDanglingProviders,\n}: TSetupProviderSourceFormProps) {\n  const [[providers]] = useProviders()\n  const { contributions } = useCommunityContributions()\n  const [showCustom, setShowCustom] = useState({\n    manual: false,\n    community: false,\n  })\n  const { handleSubmit, formState, watch, setValue, control } = useForm<TFormValues>({\n    mode: \"onBlur\",\n  })\n  const providerSource = watch(FieldName.PROVIDER_SOURCE, \"\")\n  const providerName = watch(FieldName.PROVIDER_NAME, undefined)\n  const queryClient = useQueryClient()\n  const borderColor = useColorModeValue(\"gray.200\", \"gray.600\")\n  const hoverBackgroundColor = useColorModeValue(\"gray.50\", \"gray.800\")\n  const { colorMode } = useColorMode()\n\n  const {\n    mutate: addProvider,\n    status,\n    error,\n    reset: resetAddProvider,\n  } = useAddProvider({\n    onSuccess(result) {\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n      setValue(FieldName.PROVIDER_NAME, undefined, { shouldDirty: true })\n      setShowCustom({ manual: false, community: false })\n      onFinish(result)\n    },\n    onError() {\n      reset()\n    },\n  })\n\n  const onSubmit = useCallback<SubmitHandler<TFormValues>>(\n    async (data) => {\n      const providerSource = data[FieldName.PROVIDER_SOURCE].trim()\n      const maybeProviderName = data[FieldName.PROVIDER_NAME]?.trim()\n\n      const providerIDRes = await client.providers.newID(providerSource)\n      let preferredProviderName: string | undefined\n      if (providerIDRes.ok) {\n        preferredProviderName = providerIDRes.val\n      }\n\n      removeDanglingProviders()\n      // custom name taken\n      if (maybeProviderName !== undefined && providers?.[maybeProviderName] !== undefined) {\n        setValue(\n          FieldName.PROVIDER_NAME,\n          `${maybeProviderName}-${randomString(8)}`,\n          DEFAULT_VAL_OPTS\n        )\n        // preferred ID available\n      } else if (maybeProviderName === undefined && preferredProviderName !== undefined) {\n        // preferred ID taken\n        if (providers?.[preferredProviderName] !== undefined) {\n          setValue(\n            FieldName.PROVIDER_NAME,\n            `${preferredProviderName}-${randomString(8)}`,\n            DEFAULT_VAL_OPTS\n          )\n        } else {\n          // preferred ID available\n          setValue(FieldName.PROVIDER_NAME, undefined, DEFAULT_VAL_OPTS)\n          addProvider({\n            rawProviderSource: providerSource,\n            config: { name: preferredProviderName },\n          })\n        }\n      } else {\n        setValue(FieldName.PROVIDER_NAME, undefined, DEFAULT_VAL_OPTS)\n        addProvider({\n          rawProviderSource: providerSource,\n          config: { name: maybeProviderName ?? preferredProviderName },\n        })\n      }\n    },\n    [addProvider, providers, removeDanglingProviders, setValue]\n  )\n\n  useEffect(() => {\n    const watchProviderSource = watch(() => {\n      // Reset the provider mutation if the source changes after we ran into an error\n      if (status === \"error\") {\n        resetAddProvider()\n      }\n    })\n\n    return () => watchProviderSource.unsubscribe()\n  }, [watch, status, resetAddProvider])\n\n  const { providerSourceError, providerNameError } = useFormErrors(\n    Object.values(FieldName),\n    formState\n  )\n\n  const handleRecommendedProviderClicked = useCallback(\n    (sourceName: string) => () => {\n      setShowCustom({ manual: false, community: false })\n      setValue(FieldName.PROVIDER_SOURCE, sourceName, DEFAULT_VAL_OPTS)\n      setValue(FieldName.PROVIDER_NAME, undefined, DEFAULT_VAL_OPTS)\n      if (providerSource === sourceName) {\n        return\n      }\n\n      reset()\n      handleSubmit(onSubmit)()\n    },\n    [handleSubmit, onSubmit, providerSource, reset, setValue]\n  )\n\n  const suggestedProviderLock = useRef(true)\n  // handle provider suggestion\n  useEffect(() => {\n    if (\n      suggestedProvider &&\n      suggestedProvider !== \"\" &&\n      (!exists(providerSource) || providerSource === \"\") &&\n      suggestedProviderLock.current\n    ) {\n      suggestedProviderLock.current = false\n      setValue(FieldName.PROVIDER_SOURCE, suggestedProvider, {\n        shouldDirty: true,\n        shouldValidate: true,\n      })\n      handleRecommendedProviderClicked(suggestedProvider)()\n    }\n  }, [handleRecommendedProviderClicked, providerSource, setValue, suggestedProvider])\n\n  const handleCustomProviderClicked = useCallback(() => {\n    setShowCustom({ manual: true, community: false })\n    setValue(FieldName.PROVIDER_SOURCE, \"\", DEFAULT_VAL_OPTS)\n    setValue(FieldName.PROVIDER_NAME, undefined, DEFAULT_VAL_OPTS)\n    removeDanglingProviders()\n    reset()\n  }, [removeDanglingProviders, reset, setValue])\n\n  const handleCommunityProviderClicked = useCallback(\n    (communityProvider: TCommunityProvider) => {\n      setShowCustom({ manual: false, community: true })\n      let source = communityProvider.repository\n      // Github-hosted providers are special, the CLI expects them to be passed in without the `https://` prefix\n      if (source.includes(\"github.com\")) {\n        source = communityProvider.repository.replace(\"https://\", \"\")\n      }\n\n      setValue(FieldName.PROVIDER_SOURCE, source, DEFAULT_VAL_OPTS)\n      setValue(FieldName.PROVIDER_NAME, undefined, DEFAULT_VAL_OPTS)\n      removeDanglingProviders()\n      reset()\n      handleSubmit(onSubmit)()\n    },\n    [handleSubmit, onSubmit, removeDanglingProviders, reset, setValue]\n  )\n\n  const isLoading = formState.isSubmitting || status === \"loading\"\n  const exampleCardSize = useBreakpointValue<\"md\" | \"lg\">({ base: \"md\", xl: \"lg\" })\n\n  const genericProviders = RECOMMENDED_PROVIDER_SOURCES.filter((p) => p.group === \"generic\")\n  const cloudProviders = RECOMMENDED_PROVIDER_SOURCES.filter((p) => p.group === \"cloud\")\n  const communityProviders = contributions?.providers\n\n  return (\n    <>\n      <Form onSubmit={handleSubmit(onSubmit)}>\n        <Stack spacing={6} width=\"full\" alignItems=\"center\" paddingBottom={8}>\n          <FormControl\n            isRequired\n            isInvalid={exists(providerSourceError)}\n            display=\"flex\"\n            justifyContent=\"center\">\n            <HStack marginY=\"8\" spacing=\"0\" width=\"fit-content\">\n              <HStack\n                paddingX=\"6\"\n                spacing=\"4\"\n                height=\"full\"\n                borderRightWidth=\"thin\"\n                borderColor={borderColor}>\n                {genericProviders.map((source) => (\n                  <ExampleCard\n                    size={exampleCardSize}\n                    key={source.name}\n                    image={\n                      colorMode == \"dark\" && source.imageDarkMode\n                        ? source.imageDarkMode\n                        : source.image\n                    }\n                    name={source.name}\n                    isSelected={providerSource === source.name}\n                    isDisabled={isLoading}\n                    onClick={handleRecommendedProviderClicked(source.name)}\n                  />\n                ))}\n              </HStack>\n\n              <HStack\n                paddingX=\"6\"\n                spacing=\"4\"\n                height=\"full\"\n                borderRightWidth=\"thin\"\n                borderColor={borderColor}>\n                {cloudProviders.map((source) => (\n                  <ExampleCard\n                    size={exampleCardSize}\n                    key={source.name}\n                    image={\n                      colorMode == \"dark\" && source.imageDarkMode\n                        ? source.imageDarkMode\n                        : source.image\n                    }\n                    name={source.name}\n                    isDisabled={isLoading}\n                    isSelected={providerSource === source.name}\n                    onClick={handleRecommendedProviderClicked(source.name)}\n                  />\n                ))}\n              </HStack>\n\n              <HStack height=\"full\" paddingX=\"6\">\n                <Menu placement=\"left\">\n                  <MenuButton\n                    as={Button}\n                    isDisabled={isLoading || !communityProviders || communityProviders.length === 0}\n                    _disabled={{ opacity: 1, cursor: \"not-allowed\" }}\n                    _hover={{ bg: hoverBackgroundColor }}\n                    variant=\"ghost\"\n                    width=\"fit-content\"\n                    height=\"fit-content\"\n                    paddingInline=\"0 !important\">\n                    <ExampleCard\n                      size={exampleCardSize}\n                      name=\"community\"\n                      image={CommunitySvg}\n                      isSelected={showCustom.community}\n                      isDisabled={\n                        isLoading || !communityProviders || communityProviders.length === 0\n                      }\n                    />\n                  </MenuButton>\n                  <MenuList overflowY=\"auto\" maxHeight=\"72\">\n                    {communityProviders\n                      ?.map(mapCommunityProviderInfo)\n                      .filter((x): x is NonNullable<typeof x> => x !== undefined)\n                      .sort(sortCommunityProviderInfo)\n                      .map((info) => (\n                        <MenuItem\n                          key={info.repository}\n                          onClick={() => handleCommunityProviderClicked(info)}>\n                          <HStack>\n                            <Stack3D boxSize=\"4\" />\n                            {typeof info.title === \"string\" ? (\n                              <Text>{info.title}</Text>\n                            ) : (\n                              <Text>\n                                {info.title.org}/<b>{info.title.name}</b>\n                              </Text>\n                            )}\n                          </HStack>\n                        </MenuItem>\n                      ))}\n                  </MenuList>\n                </Menu>\n\n                <ExampleCard\n                  size={exampleCardSize}\n                  name=\"custom\"\n                  image={CustomSvg}\n                  isSelected={showCustom.manual}\n                  isDisabled={isLoading}\n                  onClick={handleCustomProviderClicked}\n                />\n              </HStack>\n            </HStack>\n          </FormControl>\n\n          <Container color=\"gray.700\" _dark={{ color: \"gray.200\" }} maxWidth=\"container.md\">\n            {showCustom.manual && (\n              <FormControl isRequired isInvalid={exists(providerSourceError)}>\n                <FormLabel>Source</FormLabel>\n                <Controller\n                  name={FieldName.PROVIDER_SOURCE}\n                  rules={{ required: true }}\n                  control={control}\n                  render={({ field }) => (\n                    <CustomProviderInput\n                      field={field}\n                      isInvalid={exists(providerSourceError)}\n                      onAccept={handleSubmit(onSubmit)}\n                    />\n                  )}\n                />\n                {providerSourceError && providerSourceError.message ? (\n                  <FormErrorMessage>{providerSourceError.message}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    Can either be a URL or local path to a <Code>provider</Code> file, or a github\n                    repo in the form of <Code>my-org/my-repo</Code>\n                  </FormHelperText>\n                )}\n              </FormControl>\n            )}\n\n            {!formState.isDirty && (\n              <>\n                <Text fontWeight=\"bold\">Choose your provider</Text>\n                <Text marginBottom=\"8\">\n                  Providers determine how and where your workspaces run. They connect to the cloud\n                  platform - or local environment - of your choice and spin up your workspaces. You\n                  can choose from a number of pre-built providers, or connect your own.\n                </Text>\n              </>\n            )}\n          </Container>\n\n          <AnimatePresence>\n            {exists(providerName) && (\n              <FormControl\n                maxWidth={{ base: \"3xl\", xl: \"4xl\" }}\n                as={motion.div}\n                initial={{ height: 0, overflow: \"hidden\" }}\n                animate={{ height: \"auto\", overflow: \"revert\" }}\n                exit={{ height: 0, overflow: \"hidden\" }}\n                isInvalid={exists(providerNameError)}>\n                <FormLabel>Name</FormLabel>\n                <Controller\n                  name={FieldName.PROVIDER_NAME}\n                  control={control}\n                  rules={{\n                    pattern: {\n                      value: ALLOWED_NAMES_REGEX,\n                      message: \"Name can only contain letters, numbers and -\",\n                    },\n                    validate: {\n                      unique: (value) => {\n                        if (value === undefined) return true\n                        if (value === \"\") return \"Name cannot be empty\"\n\n                        return providers?.[value] === undefined ? true : \"Name must be unique\"\n                      },\n                    },\n                    maxLength: { value: 48, message: \"Name cannot be longer than 48 characters\" },\n                  }}\n                  render={({ field }) => (\n                    <CustomNameInput\n                      field={field}\n                      onAccept={handleSubmit(onSubmit)}\n                      isInvalid={exists(providerNameError)}\n                    />\n                  )}\n                />\n                {exists(providerNameError) ? (\n                  <FormErrorMessage>{providerNameError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    Please give your provider a different name from the one specified in its{\" \"}\n                    <Code>provider.yaml</Code>\n                  </FormHelperText>\n                )}\n              </FormControl>\n            )}\n          </AnimatePresence>\n\n          {status === \"error\" && isError(error) && <ErrorMessageBox error={error} />}\n          {isLoading && (\n            <LoadingProviderIndicator label={`Loading ${providerName ?? providerSource}`} />\n          )}\n        </Stack>\n      </Form>\n    </>\n  )\n}\n\ntype TCustomNameInputProps = Readonly<{\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"PROVIDER_NAME\"]>\n  isInvalid: boolean\n  onAccept: () => void\n  isDisabled?: boolean\n}> &\n  InputProps\nexport function CustomNameInput({ field, isInvalid, onAccept, isDisabled }: TCustomNameInputProps) {\n  return (\n    <InputGroup>\n      <Input\n        size=\"md\"\n        type=\"text\"\n        placeholder=\"Custom provider name\"\n        spellCheck={false}\n        value={field.value}\n        onBlur={field.onBlur}\n        onChange={(e) => field.onChange(e.target.value)}\n      />\n      <InputRightElement width=\"24\">\n        <ButtonGroup>\n          <Button\n            variant=\"outline\"\n            aria-label=\"Save new name\"\n            colorScheme=\"green\"\n            isDisabled={isInvalid || field.value === \"\" || isDisabled}\n            leftIcon={<CheckIcon boxSize=\"4\" />}\n            onClick={() => onAccept()}>\n            Save\n          </Button>\n        </ButtonGroup>\n      </InputRightElement>\n    </InputGroup>\n  )\n}\n\ntype TCustomProviderInputProps = Readonly<{\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"PROVIDER_SOURCE\"]>\n  isInvalid: boolean\n  onAccept: () => void\n}> &\n  InputProps\nfunction CustomProviderInput({ field, isInvalid, onAccept }: TCustomProviderInputProps) {\n  const backgroundColor = useColorModeValue(\"white\", \"black\")\n  const handleSelectFileClicked = useCallback(async () => {\n    const selected = await client.selectFileYaml()\n    if (typeof selected === \"string\") {\n      field.onChange(selected)\n      field.onBlur()\n    }\n  }, [field])\n\n  return (\n    <InputGroup>\n      <Input\n        spellCheck={false}\n        placeholder=\"loft-sh/devpod-provider-terraform\"\n        type=\"text\"\n        value={field.value}\n        onBlur={field.onBlur}\n        onChange={(e) => field.onChange(e.target.value)}\n      />\n      <InputRightElement width=\"64\">\n        <Button\n          variant=\"outline\"\n          aria-label=\"Continue\"\n          colorScheme=\"green\"\n          isDisabled={isInvalid}\n          marginRight=\"2\"\n          marginLeft=\"3\"\n          backgroundColor={backgroundColor}\n          leftIcon={<CheckIcon boxSize=\"4\" />}\n          onClick={() => onAccept()}>\n          Continue\n        </Button>\n        <Button\n          leftIcon={<Icon as={FiFolder} />}\n          borderWidth=\"thin\"\n          borderTopRightRadius=\"md\"\n          borderBottomRightRadius=\"md\"\n          borderTopLeftRadius=\"0\"\n          borderBottomLeftRadius=\"0\"\n          borderColor={\"gray.200\"}\n          marginRight=\"-2px\"\n          onClick={handleSelectFileClicked}\n          height=\"calc(100% - 2px)\">\n          Select File\n        </Button>\n      </InputRightElement>\n    </InputGroup>\n  )\n}\n\ntype TCommunityProviderInfo = Readonly<{\n  title: string | { org: string; name: string }\n  repository: string\n}>\nfunction mapCommunityProviderInfo(\n  communityProvider: TCommunityProvider\n): TCommunityProviderInfo | undefined {\n  const repo = communityProvider.repository\n  try {\n    const url = new URL(repo)\n    const segments = url.pathname.split(\"/\").filter((s) => s !== \"\")\n\n    // probably $ORG/$REPO\n    if (segments.length === 2 && segments[0] !== undefined && segments[1] !== undefined) {\n      return { title: { org: segments[0], name: stripDevpodPrefix(segments[1]) }, repository: repo }\n    }\n\n    const last = segments.pop()\n    if (last !== undefined) {\n      return { title: stripDevpodPrefix(last), repository: repo }\n    }\n\n    return undefined\n  } catch (e) {\n    console.error(`Unable to convert \"${repo}\" to URL: ${e}`)\n\n    return undefined\n  }\n}\n\nfunction stripDevpodPrefix(rawCommunityProvider: string): string {\n  return rawCommunityProvider.replace(\"devpod-provider-\", \"\")\n}\n\nfunction sortCommunityProviderInfo(a: TCommunityProviderInfo, b: TCommunityProviderInfo): number {\n  if (typeof a.title === \"string\" && typeof b.title === \"string\") {\n    return a.title > b.title ? 1 : -1\n  }\n\n  if (typeof a.title === \"string\") return 1\n  if (typeof b.title === \"string\") return -1\n\n  return a.title.name > b.title.name ? 1 : -1\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/SetupProviderSteps.tsx",
    "content": "import { Box, Container, VStack } from \"@chakra-ui/react\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { TProviderID } from \"../../../types\"\nimport { SetupClonedProvider } from \"./SetupClonedProvider\"\nimport { ConfigureProviderOptionsForm } from \"./ConfigureProviderOptionsForm\"\nimport { SetupProviderSourceForm } from \"./SetupProviderSourceForm\"\nimport { TCloneProviderInfo } from \"./types\"\nimport { useSetupProvider } from \"./useSetupProvider\"\n\ntype TSetupProviderStepsProps = Readonly<{\n  onFinish?: () => void\n  isModal?: boolean\n  suggestedProvider?: TProviderID\n  cloneProviderInfo?: TCloneProviderInfo\n  containerRef?: RefObject<HTMLDivElement>\n  onProviderIDChanged?: (id: string | null) => void\n}>\n\nexport function SetupProviderSteps({\n  onFinish,\n  suggestedProvider,\n  cloneProviderInfo,\n  onProviderIDChanged,\n  containerRef,\n  isModal = false,\n}: TSetupProviderStepsProps) {\n  const openLockRef = useRef(false)\n  const configureProviderRef = useRef<HTMLDivElement>(null)\n  const {\n    state,\n    reset,\n    completeSetupProvider,\n    completeConfigureProvider,\n    removeDanglingProviders,\n  } = useSetupProvider()\n\n  useEffect(() => {\n    if (state.currentStep === \"done\") {\n      onFinish?.()\n    }\n  }, [onFinish, state.currentStep])\n\n  useEffect(() => {\n    if (state.providerID) {\n      onProviderIDChanged?.(state.providerID)\n\n      return () => onProviderIDChanged?.(null)\n    }\n  }, [onProviderIDChanged, state.providerID])\n\n  const scrollToElement = useCallback((el: HTMLElement | null) => {\n    if (!openLockRef.current) {\n      openLockRef.current = true\n      setTimeout(\n        () =>\n          el?.scrollIntoView({\n            behavior: \"smooth\",\n            block: \"start\",\n            inline: \"nearest\",\n          })\n      )\n    }\n  }, [])\n\n  return (\n    <Container maxWidth=\"container.lg\">\n      {cloneProviderInfo ? (\n        <SetupClonedProvider\n          cloneProviderInfo={cloneProviderInfo}\n          reset={reset}\n          onFinish={(result) => {\n            completeSetupProvider(result)\n            scrollToElement(configureProviderRef.current)\n          }}\n        />\n      ) : (\n        <VStack align=\"start\" spacing={8} width=\"full\">\n          <SetupProviderSourceForm\n            suggestedProvider={suggestedProvider}\n            reset={reset}\n            onFinish={(result) => {\n              completeSetupProvider(result)\n              scrollToElement(configureProviderRef.current)\n            }}\n            removeDanglingProviders={removeDanglingProviders}\n          />\n        </VStack>\n      )}\n\n      <VStack align=\"start\" spacing={8} marginTop={4} width=\"full\">\n        <Box width=\"full\" ref={configureProviderRef}>\n          {state.currentStep === \"configure-provider\" && (\n            <VStack align=\"start\" width=\"full\">\n              <ConfigureProviderOptionsForm\n                isModal={isModal}\n                addProvider={true}\n                providerID={state.providerID}\n                isDefault={true}\n                reuseMachine={true}\n                containerRef={containerRef}\n                onFinish={completeConfigureProvider}\n              />\n            </VStack>\n          )}\n        </Box>\n      </VStack>\n    </Container>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/helpers.ts",
    "content": "import { TProviderOptions } from \"../../../types\"\n\nexport const ALLOWED_NAMES_REGEX = /^[a-z0-9\\\\-]+$/\n\nexport function mergeProviderOptions(\n  old: TProviderOptions | undefined | null,\n  current: TProviderOptions\n): TProviderOptions {\n  let mergedOptions: TProviderOptions = {}\n  if (!old) {\n    mergedOptions = current\n  } else {\n    for (const [optionName, optionValue] of Object.entries(current)) {\n      const maybeOption = old[optionName]\n      mergedOptions[optionName] = { ...optionValue, value: maybeOption?.value ?? optionValue.value }\n    }\n  }\n\n  return mergedOptions\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/index.ts",
    "content": "export { SetupProviderSteps } from \"./SetupProviderSteps\"\nexport { useSetupProvider } from \"./useSetupProvider\"\nexport { ConfigureProviderOptionsForm } from \"./ConfigureProviderOptionsForm\"\nexport { useProviderDisplayOptions } from \"./useProviderOptions\"\nexport type { TCloneProviderInfo } from \"./types\"\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/types.ts",
    "content": "import { TProvider, TProviderID, TWithProviderID } from \"../../../types\"\n\nexport const FieldName = {\n  PROVIDER_SOURCE: \"providerSource\",\n  PROVIDER_NAME: \"providerName\",\n} as const\nexport type TFormValues = {\n  [FieldName.PROVIDER_SOURCE]: string\n  [FieldName.PROVIDER_NAME]: string | undefined\n}\n\nexport type TCloneProviderInfo = Readonly<{\n  sourceProviderID: TProviderID\n  sourceProvider: TProvider\n  sourceProviderSource: NonNullable<NonNullable<NonNullable<TProvider[\"config\"]>[\"source\"]>[\"raw\"]>\n}>\n\nexport type TSetupProviderResult = TWithProviderID &\n  Readonly<{ suggestedOptions: Record<string, string> }>\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/useAddProvider.ts",
    "content": "import { UseMutationOptions, useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { client } from \"../../../client\"\nimport { QueryKeys } from \"../../../queryKeys\"\nimport { TAddProviderConfig, TProviderID } from \"../../../types\"\n\ntype TAddUserMutationOptions = UseMutationOptions<\n  Readonly<{\n    providerID: TProviderID\n    suggestedOptions: Record<string, string>\n  }>,\n  unknown,\n  Readonly<{\n    rawProviderSource: string\n    config: TAddProviderConfig\n  }>,\n  unknown\n>\ntype TUseAddProvider = Pick<TAddUserMutationOptions, \"onSuccess\" | \"onError\">\nexport function useAddProvider({ onSuccess, onError }: TUseAddProvider) {\n  const queryClient = useQueryClient()\n\n  return useMutation({\n    mutationFn: async ({ rawProviderSource, config }) => {\n      // check if provider exists and is not initialized\n      const providerID = config.name || (await client.providers.newID(rawProviderSource)).unwrap()\n      if (!providerID) {\n        throw new Error(`Couldn't find provider id`)\n      }\n\n      // list all providers\n      let providers = (await client.providers.listAll()).unwrap()\n      if (providers?.[providerID]) {\n        if (!providers[providerID]?.state?.initialized) {\n          ;(await client.providers.remove(providerID)).unwrap()\n        } else {\n          throw new Error(\n            `Provider with name ${providerID} already exists, please choose a different name`\n          )\n        }\n      }\n\n      // add provider\n      ;(await client.providers.add(rawProviderSource, config)).unwrap()\n\n      // check if provider could be added\n      providers = (await client.providers.listAll()).unwrap()\n      if (!providers?.[providerID!]) {\n        throw new Error(`Provider ${providerID} couldn't be found`)\n      }\n\n      return {\n        providerID: providerID!,\n        suggestedOptions: {},\n      }\n    },\n    onSuccess(result, ...rest) {\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n      onSuccess?.(result, ...rest)\n    },\n    onError,\n  })\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/useProviderOptions.ts",
    "content": "import { useMemo } from \"react\"\nimport { TOptionWithID, getVisibleOptions } from \"../helpers\"\nimport { exists } from \"@/lib\"\nimport { TProviderOptionGroup, TProviderOptions } from \"@/types\"\n\ntype TOptionGroup = Readonly<{ options: TOptionWithID[] }> & Omit<TProviderOptionGroup, \"options\">\ntype TAllOptions = Readonly<{\n  required: TOptionWithID[]\n  groups: TOptionGroup[]\n  other: TOptionWithID[]\n}>\n\nexport function useProviderDisplayOptions(\n  options: TProviderOptions | undefined,\n  optionGroups: TProviderOptionGroup[],\n  edit?: boolean\n): TAllOptions {\n  return useMemo(\n    () => processDisplayOptions(options, optionGroups, edit),\n    [optionGroups, options, edit]\n  )\n}\n\n// processProviderOptions reads, parses and groups all options into a displayable format.\n// Option groups can contain wildcard options `MY_PREFIX_*`. All options matching the wildcard will be added to this group.\n// The first group to claim a wildcard takes precendence.\nexport function processDisplayOptions(\n  options: TProviderOptions | undefined,\n  optionGroups: TProviderOptionGroup[],\n  edit?: boolean\n): TAllOptions {\n  const initialGroups = optionGroups.map((group) => ({ ...group, options: [] }))\n  const empty: TAllOptions = { required: [], groups: initialGroups, other: [] }\n  if (!exists(options)) {\n    return empty\n  }\n\n  return getVisibleOptions(options, edit).reduce<TAllOptions>((acc, option) => {\n    const optionGroup = optionGroups.find((group) => {\n      return group.options?.find((o) => optionMatches(o, option.id))\n    })\n\n    if (optionGroup && optionGroup.name) {\n      // create group if not found\n      const groupIdx = acc.groups.findIndex((g) => g.name === optionGroup.name)\n      if (groupIdx === -1) {\n        acc.groups.push({\n          name: optionGroup.name,\n          options: [],\n          defaultVisible: optionGroup.defaultVisible,\n        })\n        acc.groups[acc.groups.length - 1]?.options.push(option)\n\n        return acc\n      }\n\n      acc.groups[groupIdx]?.options.push(option)\n\n      return acc\n    }\n\n    if (option.required) {\n      acc.required.push(option)\n\n      return acc\n    }\n\n    acc.other.push(option)\n\n    return acc\n  }, empty)\n}\n\nfunction optionMatches(optionName: string, optionID: string): boolean {\n  if (optionName.includes(\"*\")) {\n    const regEx = new RegExp(\"^\" + optionName.replaceAll(\"*\", \".*\") + \"$\")\n\n    return regEx.test(optionID)\n  }\n\n  return optionName === optionID\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/AddProvider/useSetupProvider.ts",
    "content": "import { useCallback, useEffect, useReducer } from \"react\"\nimport { client } from \"../../../client\"\nimport { useProviderManager } from \"../../../contexts\"\nimport { TAction } from \"../../../lib\"\nimport { TProviderID } from \"../../../types\"\n\nexport type TSetupProviderState = Readonly<\n  | {\n      currentStep: \"select-provider\"\n      providerID: null\n      suggestedOptions: null\n    }\n  | {\n      currentStep: \"configure-provider\"\n      providerID: TProviderID\n      suggestedOptions: Record<string, string>\n    }\n  | { currentStep: \"done\"; providerID: TProviderID }\n>\ntype TCompleteSetupProviderAction = TAction<\n  \"completeSetupProvider\",\n  Readonly<{\n    providerID: TProviderID\n    suggestedOptions: Record<string, string>\n  }>\n>\n\ntype TActions =\n  | TCompleteSetupProviderAction\n  | TAction<\"completeConfigureProvider\">\n  | TAction<\"reset\">\n\nconst initialState: TSetupProviderState = {\n  currentStep: \"select-provider\",\n  providerID: null,\n  suggestedOptions: null,\n}\nfunction setupProviderReducer(state: TSetupProviderState, action: TActions): TSetupProviderState {\n  switch (action.type) {\n    case \"reset\":\n      return initialState\n    case \"completeSetupProvider\":\n      return {\n        ...state,\n        currentStep: \"configure-provider\",\n        providerID: action.payload.providerID,\n        suggestedOptions: action.payload.suggestedOptions,\n      }\n    case \"completeConfigureProvider\":\n      return { currentStep: \"done\", providerID: state.providerID! }\n    default:\n      return state\n  }\n}\n\nexport function useSetupProvider() {\n  const [state, dispatch] = useReducer(setupProviderReducer, initialState)\n  const { remove } = useProviderManager()\n\n  const reset = useCallback(() => {\n    dispatch({ type: \"reset\" })\n  }, [])\n\n  const completeSetupProvider = useCallback((payload: TCompleteSetupProviderAction[\"payload\"]) => {\n    dispatch({ type: \"completeSetupProvider\", payload })\n  }, [])\n\n  const completeConfigureProvider = useCallback(() => {\n    if (state.currentStep !== \"configure-provider\") {\n      return\n    }\n\n    dispatch({ type: \"completeConfigureProvider\" })\n  }, [state.currentStep])\n\n  const removeDanglingProviders = useCallback(() => {\n    const danglingProviderIDs = client.providers.popAllDangling()\n    for (const danglingProviderID of danglingProviderIDs) {\n      remove.run({ providerID: danglingProviderID })\n    }\n  }, [remove])\n\n  useEffect(() => {\n    if (state.currentStep === \"done\") {\n      client.providers.popDangling()\n\n      return\n    }\n    if (state.providerID === null) {\n      return\n    }\n\n    client.providers.setDangling(state.providerID)\n  }, [state])\n\n  useEffect(() => {\n    return () => {\n      removeDanglingProviders()\n    }\n    // We need to ensure this effect only runs when the hook unmounts at the cost of potentially stale dependencies\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [])\n\n  return { state, reset, completeSetupProvider, completeConfigureProvider, removeDanglingProviders }\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/ListProviders.tsx",
    "content": "import { Button, Text, VStack, Wrap, WrapItem } from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\nimport { useProviders } from \"../../contexts\"\nimport { canHealthCheck, exists } from \"../../lib\"\nimport { TProvider, TProviderID } from \"../../types\"\nimport { useSetupProviderModal } from \"../Providers/useSetupProviderModal\"\nimport { ProviderCard } from \"./ProviderCard\"\n\ntype TProviderInfo = Readonly<{ id: TProviderID; data: TProvider }>\nexport function ListProviders() {\n  const [[providers], { remove }] = useProviders()\n  const { show: showSetupProvider, modal } = useSetupProviderModal()\n  const providersInfo = useMemo<readonly TProviderInfo[]>(() => {\n    if (!exists(providers)) {\n      return []\n    }\n\n    return Object.entries(providers)\n      .filter(([, details]) => details.state?.initialized && !canHealthCheck(details.config))\n      .map(([id, data]) => {\n        return { id, data }\n      })\n  }, [providers])\n\n  return (\n    <>\n      {providersInfo.length === 0 ? (\n        <VStack>\n          <Text>No providers found. Click here to add one</Text>\n          <Button onClick={() => showSetupProvider({ isStrict: false })}>Add Provider</Button>\n        </VStack>\n      ) : (\n        <Wrap paddingBottom={8}>\n          {providersInfo.map(({ id, data }) => (\n            <WrapItem key={id}>\n              <ProviderCard id={id} provider={data} remove={remove} />\n            </WrapItem>\n          ))}\n        </Wrap>\n      )}\n\n      {modal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/Provider.tsx",
    "content": "import { Container, Spinner } from \"@chakra-ui/react\"\nimport { useMemo, useRef } from \"react\"\nimport { useNavigate, useParams } from \"react-router\"\nimport { useProvider } from \"../../contexts\"\nimport { exists } from \"../../lib\"\nimport { Routes } from \"../../routes\"\nimport { ConfigureProviderOptionsForm } from \"./AddProvider\"\n\nexport function Provider() {\n  const navigate = useNavigate()\n  const params = useParams()\n  const providerID = useMemo(() => Routes.getProviderId(params), [params])\n  const [provider] = useProvider(providerID)\n  const containerRef = useRef<HTMLDivElement>(null)\n  if (!exists(provider)) {\n    return <Spinner />\n  }\n\n  if (!exists(providerID)) {\n    return null\n  }\n\n  return (\n    <Container width=\"full\" maxWidth=\"container.lg\" ref={containerRef}>\n      <ConfigureProviderOptionsForm\n        containerRef={containerRef}\n        providerID={providerID}\n        isDefault={!!provider.default}\n        addProvider={false}\n        reuseMachine={!!provider.state?.singleMachine}\n        onFinish={() => navigate(Routes.PROVIDERS)}\n      />\n    </Container>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/ProviderCard.tsx",
    "content": "import {\n  Box,\n  Button,\n  ButtonGroup,\n  Card,\n  CardBody,\n  CardFooter,\n  CardHeader,\n  Center,\n  HStack,\n  Heading,\n  Icon,\n  IconButton,\n  Image,\n  Link,\n  Switch,\n  Text,\n  Tooltip,\n} from \"@chakra-ui/react\"\nimport { UseMutationResult, useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useMemo } from \"react\"\nimport { HiDuplicate } from \"react-icons/hi\"\nimport { HiArrowPath, HiPencil } from \"react-icons/hi2\"\nimport { Link as RouterLink, useNavigate } from \"react-router-dom\"\nimport { client } from \"../../client\"\nimport { IconTag } from \"../../components\"\nimport { useWorkspaces } from \"../../contexts\"\nimport { ProviderPlaceholder, Stack3D, Trash } from \"../../icons\"\nimport { exists } from \"../../lib\"\nimport { QueryKeys } from \"../../queryKeys\"\nimport { Routes } from \"../../routes\"\nimport {\n  TProvider,\n  TProviderID,\n  TProviderSource,\n  TRunnable,\n  TWithProviderID,\n  TWorkspace,\n} from \"../../types\"\nimport { useSetupProviderModal } from \"./useSetupProviderModal\"\nimport { useDeleteProviderModal } from \"./useDeleteProviderModal\"\n\ntype TProviderCardProps = {\n  id: string\n  provider: TProvider\n  remove: TRunnable<TWithProviderID> &\n    Pick<UseMutationResult, \"status\" | \"error\"> & { target: TWithProviderID | undefined }\n}\n\nexport function ProviderCard({ id, provider, remove }: TProviderCardProps) {\n  const navigate = useNavigate()\n  const queryClient = useQueryClient()\n  const workspaces = useWorkspaces<TWorkspace>()\n  const providerWorkspaces = useMemo(\n    () => workspaces.filter((workspace) => workspace.provider?.name === id),\n    [id, workspaces]\n  )\n  const { modal: setupProviderModal, show: showSetupProviderModal } = useSetupProviderModal()\n  const { data: providerUpdate } = useQuery({\n    queryKey: QueryKeys.providerUpdate(id),\n    queryFn: async () => {\n      const result = (await client.providers.checkUpdate(id)).unwrap()\n\n      return result\n    },\n  })\n  const { mutate: updateDefaultProvider } = useMutation<\n    void,\n    unknown,\n    Readonly<{ providerID: TProviderID }>\n  >({\n    mutationFn: async ({ providerID }) => {\n      ;(await client.providers.useProvider(providerID)).unwrap()\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n    },\n  })\n  const { mutate: updateProvider } = useMutation<\n    void,\n    unknown,\n    Readonly<{ providerID: TProviderID; source: TProviderSource }>\n  >({\n    mutationFn: async ({ providerID, source }) => {\n      ;(await client.providers.update(providerID, source)).unwrap()\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS)\n      queryClient.invalidateQueries(QueryKeys.providerUpdate(id))\n      queryClient.invalidateQueries(QueryKeys.PROVIDERS_CHECK_UPDATE_ALL)\n    },\n  })\n  const { modal: deleteProviderModal, open: openDeleteProviderModal } = useDeleteProviderModal(\n    id,\n    \"provider\",\n    \"delete\",\n    () => remove.run({ providerID: id })\n  )\n\n  const providerIcon = provider.config?.icon\n  const isDefaultProvider = provider.default ?? false\n  const providerVersion = provider.config?.version\n  const providerRawSource = provider.config?.source?.raw\n  const providerSource = provider.config?.source\n\n  return (\n    <>\n      <Card variant=\"outline\" width=\"72\" height=\"96\" overflow=\"hidden\">\n        <Box\n          width=\"full\"\n          height=\"1\"\n          bgGradient={\n            isDefaultProvider ? \"linear(to-r, primary.400 30%, primary.500)\" : \"transparent\"\n          }\n          position=\"absolute\"\n        />\n        <CardHeader display=\"flex\" justifyContent=\"center\" padding=\"0\">\n          {exists(providerIcon) ? (\n            <Image\n              objectFit=\"cover\"\n              padding=\"4\"\n              borderRadius=\"md\"\n              height=\"44\"\n              src={providerIcon}\n              alt=\"Provider Image\"\n            />\n          ) : (\n            <Center height=\"44\">\n              <ProviderPlaceholder boxSize={24} color=\"chakra-body-text\" />\n            </Center>\n          )}\n        </CardHeader>\n        <CardBody>\n          <Heading size=\"md\">\n            <Link\n              as={RouterLink}\n              color=\"var(--chakra-colors-chakra-body-text)\"\n              to={Routes.toProvider(id)}>\n              {id}\n            </Link>\n          </Heading>\n          {providerVersion && (\n            <HStack spacing=\"0\">\n              <Text\n                variant=\"muted\"\n                paddingY=\"1\"\n                fontFamily=\"monospace\"\n                fontSize=\"sm\"\n                fontWeight=\"regular\">\n                {providerVersion}\n              </Text>\n              {providerUpdate &&\n                providerUpdate.updateAvailable &&\n                providerSource &&\n                !provider.isProxyProvider && (\n                  <Tooltip\n                    label={\n                      providerUpdate.latestVersion\n                        ? `Version ${providerUpdate.latestVersion} available`\n                        : \"New version available\"\n                    }>\n                    <Button\n                      marginLeft=\"2\"\n                      aria-label=\"Update provider\"\n                      colorScheme=\"orange\"\n                      size=\"xs\"\n                      leftIcon={<Icon as={HiArrowPath} boxSize=\"4\" />}\n                      onClick={() => updateProvider({ providerID: id, source: providerSource })}>\n                      Update\n                    </Button>\n                  </Tooltip>\n                )}\n            </HStack>\n          )}\n          <HStack rowGap={2} marginTop={4} flexWrap=\"nowrap\" alignItems=\"center\">\n            <IconTag\n              icon={<Stack3D />}\n              label={\n                providerWorkspaces.length === 1\n                  ? \"1 workspace\"\n                  : providerWorkspaces.length > 0\n                  ? providerWorkspaces.length + \" workspaces\"\n                  : \"No workspaces\"\n              }\n              info={`This provider is used by ${providerWorkspaces.length} ${\n                providerWorkspaces.length === 1 ? \"workspace\" : \"workspaces\"\n              }`}\n            />\n          </HStack>\n        </CardBody>\n        <CardFooter\n          display=\"flex\"\n          alignItems=\"flex-end\"\n          justify=\"space-between\"\n          paddingBottom=\"4\"\n          paddingTop=\"0\"\n          paddingX=\"4\">\n          <HStack>\n            <Switch\n              isDisabled={isDefaultProvider}\n              isChecked={isDefaultProvider}\n              onChange={(e) => {\n                if (e.target.checked) {\n                  updateDefaultProvider({ providerID: id })\n                }\n              }}\n            />\n            <Text fontSize=\"sm\" variant=\"muted\">\n              Default\n            </Text>\n          </HStack>\n          <ButtonGroup spacing=\"0\">\n            {providerRawSource && (\n              <Tooltip label=\"Clone Provider\">\n                <IconButton\n                  aria-label=\"Clone Provider\"\n                  variant=\"ghost\"\n                  onClick={() =>\n                    showSetupProviderModal({\n                      isStrict: false,\n                      cloneProviderInfo: {\n                        sourceProviderID: id,\n                        sourceProvider: provider,\n                        sourceProviderSource: providerRawSource,\n                      },\n                    })\n                  }\n                  icon={<Icon as={HiDuplicate} boxSize=\"4\" />}\n                  isDisabled={provider.isProxyProvider}\n                />\n              </Tooltip>\n            )}\n            <Tooltip label=\"Edit Provider\">\n              <IconButton\n                aria-label=\"Edit Provider\"\n                variant=\"ghost\"\n                onClick={() => navigate(Routes.toProvider(id))}\n                icon={<Icon as={HiPencil} boxSize=\"4\" />}\n              />\n            </Tooltip>\n            <Tooltip\n              label={\n                provider.isProxyProvider\n                  ? \"This provider is associated with a Pro instance. Disconnecting the Pro instance will automatically delete this provider\"\n                  : \"Delete Provider\"\n              }>\n              <IconButton\n                aria-label=\"Delete Provider\"\n                variant=\"ghost\"\n                colorScheme=\"gray\"\n                icon={<Trash boxSize=\"4\" />}\n                onClick={openDeleteProviderModal}\n                isLoading={remove.status === \"loading\" && remove.target?.providerID === id}\n                isDisabled={provider.isProxyProvider}\n              />\n            </Tooltip>\n          </ButtonGroup>\n        </CardFooter>\n      </Card>\n\n      {setupProviderModal}\n      {deleteProviderModal}\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/Providers.tsx",
    "content": "import { Box } from \"@chakra-ui/react\"\nimport { Outlet } from \"react-router\"\nimport { NavigationViewLayout } from \"../../components\"\nimport { useProviderTitle } from \"./useProviderTitle\"\n\nexport function Providers() {\n  const title = useProviderTitle()\n\n  return (\n    <>\n      <NavigationViewLayout title={title}>\n        <Box>\n          <Outlet />\n        </Box>\n      </NavigationViewLayout>\n    </>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/helpers.ts",
    "content": "import { exists } from \"../../lib\"\nimport { TOptionID, TProviderConfig, TProviderOption, TProviderOptions } from \"../../types\"\n\nexport type TOptionWithID = Readonly<{\n  id: TOptionID\n  defaultValue: TProviderOption[\"default\"]\n  displayName: string\n}> &\n  Omit<TProviderOption, \"default\" | \"children\">\nexport function getOptionValue(option: TOptionWithID) {\n  return option.value ?? option.defaultValue\n}\nexport function canCreateMachine(providerConfig: TProviderConfig | undefined | null): boolean {\n  const exec = providerConfig?.exec\n  if (exec?.proxy) {\n    return false\n  }\n\n  return exists((exec as Record<string, unknown> | undefined)?.[\"create\"])\n}\n\nfunction getOptionFallbackDisplayName(id: TOptionID) {\n  return id\n    .toLowerCase()\n    .replace(/_/g, \" \")\n    .replace(/\\b\\w/g, (l) => l.toUpperCase())\n}\n\nexport function getVisibleOptions(\n  options: TProviderOptions | undefined | null,\n  edit?: boolean\n): readonly TOptionWithID[] {\n  return Object.entries(options ?? {})\n    .filter(([, { hidden, mutable }]) => {\n      if (exists(hidden) && hidden) {\n        return false\n      }\n      if (edit && !mutable) {\n        return false\n      }\n\n      return true\n    })\n    .map<TOptionWithID>(([optionName, option]) => ({\n      id: optionName,\n      defaultValue: option.default,\n      ...option,\n      displayName: option.displayName || getOptionFallbackDisplayName(optionName),\n    }))\n}\n\nexport function mergeOptionDefinitions(\n  stateOptions: TProviderOptions,\n  configOptions: TProviderOptions\n): TProviderOptions {\n  const res: TProviderOptions = {}\n  for (const [k, v] of Object.entries(stateOptions)) {\n    const config = configOptions[k]\n    if (config) {\n      res[k] = { ...config, ...v }\n      continue\n    }\n\n    res[k] = v\n  }\n\n  return res\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/index.ts",
    "content": "export { SetupProviderSteps, useSetupProvider } from \"./AddProvider\"\nexport { Provider } from \"./Provider\"\nexport { Providers } from \"./Providers\"\nexport { ListProviders } from \"./ListProviders\"\nexport { useSetupProviderModal } from \"./useSetupProviderModal\"\nexport { useDeleteProviderModal } from \"./useDeleteProviderModal\"\nexport { ConfigureProviderOptionsForm, useProviderDisplayOptions } from \"./AddProvider\"\nexport type { TOptionWithID } from \"./helpers\"\n"
  },
  {
    "path": "desktop/src/views/Providers/useDeleteProviderModal.tsx",
    "content": "import {\n  Box,\n  Button,\n  HStack,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  Portal,\n  Text,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\n\nexport function useDeleteProviderModal(\n  id: string,\n  entityName: string,\n  actionName: \"delete\" | \"disconnect\",\n  onRemoveClicked: () => void\n) {\n  const { isOpen, onOpen, onClose } = useDisclosure()\n\n  const modal = useMemo(() => {\n    return (\n      <Portal>\n        <Modal onClose={onClose} isOpen={isOpen} isCentered>\n          <ModalOverlay />\n          <ModalContent>\n            <ModalHeader>\n              <Box as=\"span\" textTransform=\"capitalize\">\n                {actionName}\n              </Box>{\" \"}\n              {id}\n            </ModalHeader>\n            <ModalCloseButton />\n            <ModalBody>\n              <Text>\n                Please make sure to delete all workspaces that use this {entityName}, before{\" \"}\n                {actionName}ing the {entityName}.\n              </Text>\n            </ModalBody>\n            <ModalFooter>\n              <HStack spacing={\"2\"}>\n                <Button onClick={onClose}>Close</Button>\n                <Button\n                  textTransform=\"capitalize\"\n                  colorScheme=\"red\"\n                  onClick={() => {\n                    onRemoveClicked()\n                    onClose()\n                  }}>\n                  {actionName}\n                </Button>\n              </HStack>\n            </ModalFooter>\n          </ModalContent>\n        </Modal>\n      </Portal>\n    )\n  }, [actionName, entityName, id, isOpen, onClose, onRemoveClicked])\n\n  return { modal, open: onOpen, isOpen }\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/useProviderTitle.tsx",
    "content": "import { Button, IconButton } from \"@chakra-ui/react\"\nimport { useCallback, useMemo } from \"react\"\nimport { useMatch, useNavigate } from \"react-router\"\nimport { TViewTitle } from \"../../components\"\nimport { ArrowLeft, Plus } from \"../../icons\"\nimport { exists } from \"../../lib\"\nimport { Routes } from \"../../routes\"\nimport { useSetupProviderModal } from \"./useSetupProviderModal\"\n\nexport function useProviderTitle(): TViewTitle | null {\n  const navigate = useNavigate()\n\n  const matchProviderRoot = useMatch(Routes.PROVIDERS)\n  const matchProvider = useMatch(Routes.PROVIDER)\n  const { modal, show: showSetupProvider } = useSetupProviderModal()\n\n  const navigateToProviderRoot = useCallback(() => {\n    navigate(Routes.PROVIDERS)\n  }, [navigate])\n\n  const navigateBackAction = useMemo(() => {\n    return (\n      <IconButton\n        variant=\"ghost\"\n        aria-label=\"Navigate back to providers\"\n        icon={<ArrowLeft />}\n        onClick={navigateToProviderRoot}\n      />\n    )\n  }, [navigateToProviderRoot])\n\n  return useMemo<TViewTitle | null>(() => {\n    if (exists(matchProviderRoot)) {\n      return {\n        label: \"Providers\",\n        priority: \"high\",\n        trailingAction: (\n          <>\n            <Button\n              size=\"sm\"\n              variant=\"outline\"\n              aria-label=\"Add provider\"\n              leftIcon={<Plus />}\n              onClick={() => showSetupProvider({ isStrict: false })}>\n              Add\n            </Button>\n            {modal}\n          </>\n        ),\n      }\n    }\n\n    if (exists(matchProvider)) {\n      const maybeWorkspaceId = Routes.getProviderId(matchProvider.params)\n\n      return {\n        label: maybeWorkspaceId ?? \"Unknown Provider\",\n        priority: \"regular\",\n        leadingAction: navigateBackAction,\n      }\n    }\n\n    return null\n  }, [matchProvider, matchProviderRoot, modal, navigateBackAction, showSetupProvider])\n}\n"
  },
  {
    "path": "desktop/src/views/Providers/useSetupProviderModal.tsx",
    "content": "import {\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalHeader,\n  ModalOverlay,\n  useDisclosure,\n  VStack,\n} from \"@chakra-ui/react\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\nimport { useNavigate } from \"react-router-dom\"\nimport { Routes } from \"../../routes\"\nimport { TProviderID } from \"../../types\"\nimport { SetupProviderSteps } from \"../Providers\"\nimport { TCloneProviderInfo } from \"./AddProvider\"\n\nexport function useSetupProviderModal() {\n  const navigate = useNavigate()\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const [isStrict, setIsStrict] = useState(true)\n  const [suggestedProvider, setSuggestedProvider] = useState<TProviderID | undefined>(undefined)\n  const [cloneProviderInfo, setCloneProviderInfo] = useState<TCloneProviderInfo | undefined>(\n    undefined\n  )\n  const [wasDismissed, setWasDismissed] = useState(false)\n  const [currentProviderID, setCurrentProviderID] = useState<string | null>(null)\n  const containerRef = useRef<HTMLDivElement>(null)\n\n  const show = useCallback(\n    ({\n      isStrict,\n      suggestedProvider,\n      cloneProviderInfo,\n    }: Readonly<{\n      isStrict: boolean\n      suggestedProvider?: TProviderID\n      cloneProviderInfo?: TCloneProviderInfo\n    }>) => {\n      if (isOpen) {\n        return\n      }\n\n      if (suggestedProvider) {\n        setSuggestedProvider(suggestedProvider)\n      }\n\n      if (cloneProviderInfo) {\n        setCloneProviderInfo(cloneProviderInfo)\n      }\n\n      setIsStrict(isStrict)\n      onOpen()\n    },\n    [isOpen, onOpen]\n  )\n\n  const handleCloseClicked = useCallback(() => {\n    if (isStrict) {\n      navigate(Routes.WORKSPACES)\n\n      return\n    }\n\n    setWasDismissed(true)\n  }, [isStrict, navigate])\n\n  const title = useMemo(() => {\n    if (currentProviderID !== null) {\n      return `Configure Provider ${currentProviderID}`\n    }\n\n    if (isStrict) {\n      return \"Configure Provider before creating a workspace\"\n    }\n\n    return \"Configure Provider\"\n  }, [currentProviderID, isStrict])\n\n  const modal = useMemo(\n    () => (\n      <Modal\n        onClose={onClose}\n        isOpen={isOpen}\n        isCentered\n        size=\"6xl\"\n        scrollBehavior=\"inside\"\n        closeOnOverlayClick={true}>\n        <ModalOverlay />\n        <ModalContent position=\"relative\" overflow=\"hidden\">\n          <ModalHeader>{title}</ModalHeader>\n          <ModalCloseButton onClick={handleCloseClicked} />\n          <ModalBody overflowX=\"hidden\" overflowY=\"auto\" paddingBottom=\"0\" ref={containerRef}>\n            <VStack align=\"start\" spacing=\"8\">\n              <SetupProviderSteps\n                containerRef={containerRef}\n                suggestedProvider={suggestedProvider}\n                cloneProviderInfo={cloneProviderInfo}\n                onProviderIDChanged={setCurrentProviderID}\n                onFinish={onClose}\n                isModal\n              />\n            </VStack>\n          </ModalBody>\n        </ModalContent>\n      </Modal>\n    ),\n    [onClose, isOpen, title, handleCloseClicked, suggestedProvider, cloneProviderInfo]\n  )\n\n  return { modal, show, isOpen, wasDismissed }\n}\n"
  },
  {
    "path": "desktop/src/views/Settings/ClearableInput.tsx",
    "content": "import { CloseIcon } from \"@chakra-ui/icons\"\nimport { IconButton, Input, InputGroup, InputLeftAddon, InputRightElement } from \"@chakra-ui/react\"\nimport { FocusEvent, KeyboardEvent, ReactNode, useCallback, useRef, useState } from \"react\"\n\ntype TClearableInputProps = Readonly<{\n  defaultValue: string\n  placeholder: string\n  label?: ReactNode\n  onChange: (newValue: string) => void\n}>\nexport function ClearableInput({\n  defaultValue,\n  placeholder,\n  label,\n  onChange,\n}: TClearableInputProps) {\n  const [hasFocus, setHasFocus] = useState(false)\n  const inputRef = useRef<HTMLInputElement>(null)\n\n  const handleBlur = useCallback(\n    (e: FocusEvent<HTMLInputElement>) => {\n      const value = e.target.value.trim()\n      onChange(value)\n      setHasFocus(false)\n    },\n    [onChange]\n  )\n\n  const handleKeyUp = useCallback((e: KeyboardEvent<HTMLInputElement>) => {\n    if (e.key !== \"Enter\") return\n\n    e.currentTarget.blur()\n  }, [])\n\n  const handleFocus = useCallback(() => {\n    setHasFocus(true)\n  }, [])\n\n  const handleClearClicked = useCallback(() => {\n    const el = inputRef.current\n    if (!el) return\n\n    el.value = \"\"\n  }, [])\n\n  return (\n    <InputGroup maxWidth=\"96\">\n      {label && <InputLeftAddon>{label}</InputLeftAddon>}\n      <Input\n        ref={inputRef}\n        spellCheck={false}\n        placeholder={placeholder}\n        defaultValue={defaultValue}\n        onBlur={handleBlur}\n        onKeyUp={handleKeyUp}\n        onFocus={handleFocus}\n      />\n      <InputRightElement>\n        <IconButton\n          visibility={hasFocus ? \"visible\" : \"hidden\"}\n          size=\"xs\"\n          borderRadius=\"full\"\n          icon={<CloseIcon />}\n          aria-label=\"clear\"\n          onMouseDown={(e) => {\n            // needed to prevent losing focus from input\n            e.stopPropagation()\n            e.preventDefault()\n          }}\n          onClick={handleClearClicked}\n        />\n      </InputRightElement>\n    </InputGroup>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Settings/Settings.tsx",
    "content": "import {\n  Button,\n  Checkbox,\n  Code,\n  Divider,\n  FormLabel,\n  Grid,\n  HStack,\n  Heading,\n  Icon,\n  Link,\n  Radio,\n  RadioGroup,\n  Select,\n  Switch,\n  Tab,\n  TabList,\n  TabPanel,\n  TabPanels,\n  Tabs,\n  Text,\n  VStack,\n  useColorMode,\n} from \"@chakra-ui/react\"\nimport { compareVersions } from \"compare-versions\"\nimport { ReactNode, useEffect, useMemo, useState } from \"react\"\nimport { HiMagnifyingGlassPlus } from \"react-icons/hi2\"\nimport { client } from \"../../client\"\nimport { ToolbarTitle, useInstallCLI } from \"../../components\"\nimport { TSettings, useChangeSettings } from \"../../contexts\"\nimport {\n  getIDEDisplayName,\n  isMacOS,\n  useArch,\n  usePlatform,\n  useReleases,\n  useUpdate,\n  useVersion,\n} from \"../../lib\"\nimport { useWelcomeModal } from \"../../useWelcomeModal\"\nimport {\n  useAgentURLOption,\n  useDockerCredentialsForwardingOption,\n  useGitCredentialsForwardingOption,\n  useTelemetryOption,\n} from \"./useContextOptions\"\nimport { useIDESettings } from \"./useIDESettings\"\nimport {\n  useCLIFlagsOption,\n  useDotfilesOption,\n  useExtraEnvVarsOption,\n  useProxyOptions,\n  useSSHKeySignatureOption,\n} from \"./useSettingsOptions\"\n\nconst SETTINGS_TABS = [\n  { label: \"General\", component: <GeneralSettings /> },\n  { label: \"Customization\", component: <CustomizationSettings /> },\n  { label: \"Appearance\", component: <AppearanceSettings /> },\n  { label: \"Updates\", component: <UpdateSettings /> },\n  { label: \"Experimental\", component: <ExperimentalSettings /> },\n]\n\nexport function Settings() {\n  return (\n    <>\n      <ToolbarTitle>\n        <Heading as=\"h3\" size=\"sm\">\n          Settings\n        </Heading>\n      </ToolbarTitle>\n\n      <Tabs isLazy isFitted variant=\"muted\">\n        <TabList marginBottom=\"6\">\n          {SETTINGS_TABS.map(({ label }) => (\n            <Tab key={label}>{label}</Tab>\n          ))}\n        </TabList>\n        <TabPanels>\n          {SETTINGS_TABS.map(({ label, component }) => (\n            <TabPanel key={label}>{component}</TabPanel>\n          ))}\n        </TabPanels>\n      </Tabs>\n    </>\n  )\n}\n\nfunction GeneralSettings() {\n  const { settings, set } = useChangeSettings()\n  const { modal: welcomeModal, show: showWelcomeModal } = useWelcomeModal()\n  const { input: agentURLInput, helpText: agentURLHelpText } = useAgentURLOption()\n  const { input: proxyInput, helpText: proxyHelpText } = useProxyOptions()\n  const { input: telemetryInput, helpText: telemetryHelpText } = useTelemetryOption()\n  const {\n    badge: installCLIBadge,\n    button: installCLIButton,\n    helpText: installCLIHelpText,\n    errorMessage: installCLIErrorMessage,\n  } = useInstallCLI()\n\n  return (\n    <>\n      <SettingSection title=\"CLI\" description={installCLIHelpText}>\n        <HStack>\n          {installCLIButton}\n          {installCLIErrorMessage}\n          {installCLIBadge}\n        </HStack>\n      </SettingSection>\n\n      <SettingSection\n        title=\"Debug mode\"\n        description={\n          <>\n            Run all DevPod commands with the <Code>--debug</Code> flag, making it easier to\n            troubleshoot\n          </>\n        }>\n        <Switch\n          isChecked={settings.debugFlag}\n          onChange={(e) => set(\"debugFlag\", e.target.checked)}\n        />\n      </SettingSection>\n\n      <SettingSection title=\"Logs\" description={\"Open the logs for DevPod Desktop\"}>\n        <Button variant=\"outline\" onClick={() => client.openDir(\"AppLog\")}>\n          Open Logs\n        </Button>\n      </SettingSection>\n\n      <SettingSection title=\"Agent URL\" description={agentURLHelpText}>\n        {agentURLInput}\n      </SettingSection>\n\n      <SettingSection title=\"Proxy Configuration\" description={proxyHelpText}>\n        {proxyInput}\n      </SettingSection>\n\n      <SettingSection title=\"Telemetry\" description={telemetryHelpText}>\n        {telemetryInput}\n      </SettingSection>\n\n      <SettingSection\n        showDivider={false}\n        title=\"Show Intro\"\n        description=\"Show the introduction to DevPod again\">\n        <Button variant=\"outline\" onClick={() => showWelcomeModal({ cancellable: true })}>\n          Open\n        </Button>\n      </SettingSection>\n\n      <VStack align=\"start\" paddingTop=\"16\" paddingBottom=\"8\">\n        <Heading size=\"sm\" as=\"h4\" color=\"red.600\">\n          Danger Zone\n        </Heading>\n        <Button variant=\"outline\" colorScheme=\"red\" onClick={() => client.quit()}>\n          Quit DevPod\n        </Button>\n      </VStack>\n\n      {welcomeModal}\n    </>\n  )\n}\n\nfunction CustomizationSettings() {\n  const { input: dotfilesInput } = useDotfilesOption()\n  const { input: gitSSHSignatureInput } = useSSHKeySignatureOption()\n  const { settings, set } = useChangeSettings()\n  const { ides, defaultIDE, updateDefaultIDE } = useIDESettings()\n  const { input: dockerCredentialForwardingInput, helpText: dockerCredentialForwardingHelpText } =\n    useDockerCredentialsForwardingOption()\n  const { input: gitCredentialForwardingInput, helpText: gitCredentialForwardingHelpText } =\n    useGitCredentialsForwardingOption()\n\n  return (\n    <>\n      <SettingSection\n        title=\"IDE\"\n        description=\"Select the default IDE you're using for workspaces. This will be overridden whenever you create a workspace with a different IDE. You can prevent this by checking the 'Always use this IDE' checkbox\">\n        <>\n          <Select\n            maxWidth=\"52\"\n            textTransform=\"capitalize\"\n            onChange={(e) => updateDefaultIDE({ ide: e.target.value })}\n            value={defaultIDE ? defaultIDE.name! : undefined}>\n            {ides?.map((ide) => (\n              <option key={ide.name} value={ide.name!}>\n                {getIDEDisplayName(ide)}\n              </option>\n            ))}\n          </Select>\n          <Checkbox\n            isChecked={settings.fixedIDE}\n            onChange={(e) => set(\"fixedIDE\", e.target.checked)}>\n            Always use this IDE\n          </Checkbox>\n        </>\n      </SettingSection>\n\n      <SettingSection\n        title=\"Dotfiles\"\n        description=\"Set the dotfiles git repository to use inside workspaces\">\n        {dotfilesInput}\n      </SettingSection>\n\n      <SettingSection\n        title=\"SSH Key for Git commit signing\"\n        description=\"Set path of your SSH key you want to use for signing Git commits\">\n        {gitSSHSignatureInput}\n      </SettingSection>\n\n      <SettingSection\n        title=\"Docker credentials forwarding\"\n        description={dockerCredentialForwardingHelpText}>\n        {dockerCredentialForwardingInput}\n      </SettingSection>\n\n      <SettingSection\n        showDivider={false}\n        title=\"Git credentials forwarding\"\n        description={gitCredentialForwardingHelpText}>\n        {gitCredentialForwardingInput}\n      </SettingSection>\n    </>\n  )\n}\n\nfunction AppearanceSettings() {\n  const { settings, set } = useChangeSettings()\n\n  return (\n    <>\n      {isMacOS && (\n        <SettingSection\n          title=\"Translucent UI\"\n          description=\"Use transparency in the sidebar and other UI elements\">\n          <Switch\n            isChecked={settings.transparency}\n            onChange={(e) => set(\"transparency\", e.target.checked)}\n          />\n        </SettingSection>\n      )}\n\n      <SettingSection title=\"Zoom level\" description=\"Adjust the zoom level\">\n        <HStack>\n          <Select\n            onChange={(e) => set(\"zoom\", e.target.value as TSettings[\"zoom\"])}\n            value={settings.zoom}>\n            <option value={\"sm\"}>Small</option>\n            <option value={\"md\"}>Regular</option>\n            <option value={\"lg\"}>Large</option>\n            <option value={\"xl\"}>Extra Large</option>\n          </Select>\n          <Icon as={HiMagnifyingGlassPlus} boxSize=\"6\" color=\"gray.600\" />\n        </HStack>\n      </SettingSection>\n\n      <SettingSection showDivider={false} title=\"Sidebar position\" description=\"\">\n        <RadioGroup\n          value={settings.sidebarPosition}\n          onChange={(newValue: TSettings[\"sidebarPosition\"]) => set(\"sidebarPosition\", newValue)}>\n          <HStack>\n            <Radio value=\"left\">Left</Radio>\n            <Radio value=\"right\">Right</Radio>\n          </HStack>\n        </RadioGroup>\n      </SettingSection>\n    </>\n  )\n}\nfunction UpdateSettings() {\n  const { settings, set } = useChangeSettings()\n  const platform = usePlatform()\n  const arch = useArch()\n  const version = useVersion()\n  const [selectedVersion, setSelectedVersion] = useState<string | undefined>(undefined)\n  const { isChecking, check, isUpdateAvailable, pendingUpdate } = useUpdate()\n  const releases = useReleases()\n    ?.slice()\n    .sort((a, b) => compareVersions(b.tag_name, a.tag_name))\n  const downloadLink = useMemo(() => {\n    const release = releases?.find((release) => release.tag_name === selectedVersion)\n    if (!release) {\n      return undefined\n    }\n    if (!platform || !arch) {\n      return release.html_url\n    }\n    let p: string = platform\n    if (p === \"darwin\") {\n      p = \"macos\"\n    }\n\n    const r = new RegExp(`${p}_${arch}`, \"i\")\n    const asset = release.assets.find((asset) => r.test(asset.name))\n\n    return asset?.browser_download_url\n  }, [arch, platform, releases, selectedVersion])\n\n  useEffect(() => {\n    if (version) {\n      setSelectedVersion(`v${version}`)\n    }\n  }, [version])\n\n  const updateAvailableMessage = useMemo<undefined | string>(() => {\n    if (isUpdateAvailable === undefined && pendingUpdate === undefined) {\n      return undefined\n    }\n\n    return isUpdateAvailable || pendingUpdate !== undefined\n      ? \"New version available\"\n      : \"No new version\"\n  }, [isUpdateAvailable, pendingUpdate])\n\n  return (\n    <>\n      <SettingSection\n        title=\"Automatically keep up to date\"\n        description=\"Download and install new versions in the background\">\n        <Switch\n          isChecked={settings.autoUpdate}\n          onChange={(e) => set(\"autoUpdate\", e.target.checked)}\n        />\n      </SettingSection>\n      <SettingSection\n        title=\"Versions\"\n        description=\"Manage and explore DevPod versions\"\n        showDivider={false}>\n        <>\n          <VStack align=\"start\" width=\"full\" marginBottom=\"4\">\n            <Text fontSize=\"sm\">\n              Current version: {version}\n              <Text as=\"span\" fontWeight=\"semibold\">\n                {updateAvailableMessage !== undefined ? ` - ${updateAvailableMessage}` : \"\"}\n              </Text>\n            </Text>\n            <HStack>\n              <Button variant=\"outline\" isLoading={isChecking} onClick={() => check()}>\n                Check for updates\n              </Button>\n            </HStack>\n          </VStack>\n\n          <Text fontSize=\"sm\">Or download a specific version</Text>\n          <VStack align=\"start\" width=\"full\" overflow=\"hidden\">\n            <Select\n              maxWidth=\"52\"\n              onChange={(e) => setSelectedVersion(e.target.value)}\n              value={selectedVersion}>\n              <option value={undefined}>Select version</option>\n              {releases?.map((release) => (\n                <option key={release.tag_name} value={release.tag_name}>\n                  {release.tag_name}\n                </option>\n              ))}\n            </Select>\n            {downloadLink && (\n              <Text fontSize=\"sm\" width=\"full\">\n                Visit{\" \"}\n                <Link onClick={() => client.open(downloadLink)} fontSize=\"sm\">\n                  Github\n                </Link>{\" \"}\n                to download {selectedVersion}\n              </Text>\n            )}\n          </VStack>\n        </>\n      </SettingSection>\n    </>\n  )\n}\n\nfunction ExperimentalSettings() {\n  const { input: cliFlagsInput, helpText: cliFlagsHelpText } = useCLIFlagsOption()\n  const { input: extraEnvVarsInput, helpText: extraEnvVarsHelpText } = useExtraEnvVarsOption()\n  const { settings, set } = useChangeSettings()\n  const { setColorMode } = useColorMode()\n\n  return (\n    <VStack align=\"start\">\n      <SettingSection\n        title=\"Multiple devcontainer detection\"\n        description=\"Whenever new workspaces are created, check if there are multiple devcontainers in the source. This might take a while for larger repositories\">\n        <Switch\n          id=\"multicontainer\"\n          isChecked={settings.experimental_multiDevcontainer}\n          onChange={(e) => set(\"experimental_multiDevcontainer\", e.target.checked)}\n        />\n      </SettingSection>\n\n      <SettingSection\n        title=\"Experimental IDEs\"\n        description=\" Enable experimental IDEs. These IDEs are not officially supported by DevPod and might be unstable. We are working on making them generally available\">\n        <HStack>\n          <Switch\n            isChecked={settings.experimental_fleet}\n            onChange={(e) => set(\"experimental_fleet\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            JetBrains Fleet\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_jupyterNotebooks}\n            onChange={(e) => set(\"experimental_jupyterNotebooks\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Jupyter Notebooks\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_vscodeInsiders}\n            onChange={(e) => set(\"experimental_vscodeInsiders\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            VSCode Insiders\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_cursor}\n            onChange={(e) => set(\"experimental_cursor\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Cursor\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_positron}\n            onChange={(e) => set(\"experimental_positron\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Positron\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_codium}\n            onChange={(e) => set(\"experimental_codium\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Codium\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_zed}\n            onChange={(e) => set(\"experimental_zed\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Zed\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_rstudio}\n            onChange={(e) => set(\"experimental_rstudio\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            RStudio Server\n          </FormLabel>\n        </HStack>\n\n        <HStack width=\"full\" align=\"center\">\n          <Switch\n            isChecked={settings.experimental_windsurf}\n            onChange={(e) => set(\"experimental_windsurf\", e.target.checked)}\n          />\n          <FormLabel marginBottom=\"0\" whiteSpace=\"nowrap\" fontSize=\"sm\">\n            Windsurf\n          </FormLabel>\n        </HStack>\n      </SettingSection>\n\n      <SettingSection title=\"Additional CLI Flags\" description={cliFlagsHelpText}>\n        {cliFlagsInput}\n      </SettingSection>\n\n      <SettingSection title=\"Additional Environment Variables\" description={extraEnvVarsHelpText}>\n        {extraEnvVarsInput}\n      </SettingSection>\n\n      <SettingSection title=\"DevPod Pro (beta)\" description=\"Enable DevPod Pro login and creation\">\n        <Switch\n          isChecked={settings.experimental_devPodPro}\n          onChange={(e) => set(\"experimental_devPodPro\", e.target.checked)}\n        />\n      </SettingSection>\n\n      <SettingSection title=\"Color Mode\" description=\"\" showDivider={false}>\n        <RadioGroup\n          value={settings.experimental_colorMode}\n          onChange={(newValue: TSettings[\"experimental_colorMode\"]) => {\n            set(\"experimental_colorMode\", newValue)\n            setColorMode(newValue)\n          }}>\n          <HStack>\n            <Radio value=\"light\">Light</Radio>\n            <Radio value=\"dark\">Dark</Radio>\n          </HStack>\n        </RadioGroup>\n      </SettingSection>\n    </VStack>\n  )\n}\n\ntype TSettingDescriptionProps = Readonly<{ children: ReactNode }>\nfunction SettingDescription({ children }: TSettingDescriptionProps) {\n  return (\n    <Text color={\"gray.600\"} _dark={{ color: \"gray.300\" }} fontSize=\"sm\">\n      {children}\n    </Text>\n  )\n}\n\ntype TSettingSectionProps = Readonly<{\n  title: string\n  description: ReactNode\n  showDivider?: boolean\n  children: ReactNode\n}>\nfunction SettingSection({\n  title,\n  description,\n  showDivider = true,\n  children,\n}: TSettingSectionProps) {\n  return (\n    <>\n      <Grid gridTemplateColumns=\"32rem 1fr\" columnGap=\"20\" width=\"full\">\n        <VStack align=\"start\" gap=\"0\">\n          <Heading as=\"h4\" size=\"sm\" fontWeight=\"medium\">\n            {title}\n          </Heading>\n          <SettingDescription>{description}</SettingDescription>\n        </VStack>\n\n        <VStack align=\"start\" paddingX=\"2\" width=\"full\" overflow=\"hidden\">\n          {children}\n        </VStack>\n      </Grid>\n      {showDivider && <SettingDivider />}\n    </>\n  )\n}\n\nfunction SettingDivider() {\n  return <Divider marginY=\"4\" />\n}\n"
  },
  {
    "path": "desktop/src/views/Settings/index.ts",
    "content": "export { Settings } from \"./Settings\"\n"
  },
  {
    "path": "desktop/src/views/Settings/useContextOptions.tsx",
    "content": "import { Code, Link, Switch } from \"@chakra-ui/react\"\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useCallback, useMemo } from \"react\"\nimport { client } from \"../../client\"\nimport { QueryKeys } from \"../../queryKeys\"\nimport { TContextOptionName } from \"../../types\"\nimport { ClearableInput } from \"./ClearableInput\"\n\nconst DEFAULT_DEVPOD_AGENT_URL = \"https://github.com/loft-sh/devpod/releases/latest/download/\"\n\nexport function useContextOptions() {\n  const queryClient = useQueryClient()\n  const { data: options } = useQuery({\n    queryKey: QueryKeys.CONTEXT_OPTIONS,\n    queryFn: async () => (await client.context.listOptions()).unwrap(),\n  })\n  const { mutate: updateOption } = useMutation({\n    mutationFn: async ({ option, value }: { option: TContextOptionName; value: string }) => {\n      ;(await client.context.setOption(option, value)).unwrap()\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries(QueryKeys.CONTEXT_OPTIONS)\n    },\n  })\n\n  return useMemo(\n    () => ({\n      options,\n      updateOption,\n    }),\n    [options, updateOption]\n  )\n}\n\nexport function useAgentURLOption() {\n  const { options, updateOption } = useContextOptions()\n\n  const handleChanged = useCallback(\n    (newValue: string) => {\n      const value = newValue.trim()\n      updateOption({ option: \"AGENT_URL\", value })\n    },\n    [updateOption]\n  )\n\n  const input = useMemo(\n    () => (\n      <ClearableInput\n        placeholder=\"Override Agent URL\"\n        defaultValue={options?.AGENT_URL.value ?? \"\"}\n        onChange={handleChanged}\n      />\n    ),\n    [handleChanged, options?.AGENT_URL.value]\n  )\n\n  const helpText = useMemo(\n    () => (\n      <>\n        Set the Agent URL. If you leave this empty, it will be pulled from{\" \"}\n        <Code>{DEFAULT_DEVPOD_AGENT_URL}</Code>\n      </>\n    ),\n    []\n  )\n\n  return { input, helpText }\n}\n\nexport function useTelemetryOption() {\n  const { options, updateOption } = useContextOptions()\n\n  const input = useMemo(\n    () => (\n      <Switch\n        isChecked={options?.TELEMETRY.value === \"true\"}\n        onChange={(e) => updateOption({ option: \"TELEMETRY\", value: e.target.checked.toString() })}\n      />\n    ),\n    [options?.TELEMETRY.value, updateOption]\n  )\n\n  const helpText = useMemo(\n    () => (\n      <>\n        Telemetry plays an important role in improving DevPod for everyone.{\" \"}\n        <strong>We never collect any actual values, only anonymized metadata!</strong> For an\n        in-depth explanation, please refer to the{\" \"}\n        <Link onClick={() => client.open(\"https://devpod.sh/docs/other-topics/telemetry\")}>\n          documentation\n        </Link>\n      </>\n    ),\n    []\n  )\n\n  return { input, helpText }\n}\n\nexport function useDockerCredentialsForwardingOption() {\n  const { options, updateOption } = useContextOptions()\n\n  const input = useMemo(\n    () => (\n      <Switch\n        isChecked={options?.SSH_INJECT_DOCKER_CREDENTIALS.value === \"true\"}\n        onChange={(e) =>\n          updateOption({\n            option: \"SSH_INJECT_DOCKER_CREDENTIALS\",\n            value: e.target.checked.toString(),\n          })\n        }\n      />\n    ),\n    [options?.SSH_INJECT_DOCKER_CREDENTIALS.value, updateOption]\n  )\n\n  const helpText = useMemo(\n    () => <>Enable to forward your local docker credentials to workspaces</>,\n    []\n  )\n\n  return { input, helpText }\n}\n\nexport function useGitCredentialsForwardingOption() {\n  const { options, updateOption } = useContextOptions()\n\n  const input = useMemo(\n    () => (\n      <Switch\n        isChecked={options?.SSH_INJECT_GIT_CREDENTIALS.value === \"true\"}\n        onChange={(e) =>\n          updateOption({\n            option: \"SSH_INJECT_GIT_CREDENTIALS\",\n            value: e.target.checked.toString(),\n          })\n        }\n      />\n    ),\n    [options?.SSH_INJECT_GIT_CREDENTIALS.value, updateOption]\n  )\n\n  const helpText = useMemo(\n    () => <>Enable to forward your local HTTPS based git credentials to workspaces</>,\n    []\n  )\n\n  return { input, helpText }\n}\n"
  },
  {
    "path": "desktop/src/views/Settings/useIDESettings.tsx",
    "content": "import { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { useMemo } from \"react\"\nimport { client } from \"../../client\"\nimport { QueryKeys } from \"../../queryKeys\"\nimport { TIDE } from \"../../types\"\nimport { useIDEs } from \"../../useIDEs\"\n\nexport function useIDESettings() {\n  const queryClient = useQueryClient()\n  const { ides, defaultIDE } = useIDEs()\n  const { mutate: updateDefaultIDE } = useMutation({\n    mutationFn: async ({ ide }: { ide: NonNullable<TIDE[\"name\"]> }) => {\n      ;(await client.ides.useIDE(ide)).unwrap()\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries(QueryKeys.IDES)\n    },\n  })\n\n  return useMemo(\n    () => ({\n      ides,\n      defaultIDE,\n      updateDefaultIDE,\n    }),\n    [defaultIDE, ides, updateDefaultIDE]\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Settings/useSettingsOptions.tsx",
    "content": "import { useCallback, useMemo } from \"react\"\nimport { client } from \"../../client\"\nimport { Command } from \"../../client/command\"\nimport { TSettings, useChangeSettings } from \"../../contexts\"\nimport { ClearableInput } from \"./ClearableInput\"\n\nexport function useCLIFlagsOption() {\n  const { settings, set } = useChangeSettings()\n\n  const handleChanged = useCallback(\n    (newValue: string) => {\n      const value = newValue.trim()\n      set(\"additionalCliFlags\", value)\n      client.setSetting(\"additionalCliFlags\", value)\n    },\n    [set]\n  )\n\n  const input = useMemo(\n    () => (\n      <ClearableInput\n        placeholder=\"Additional CLI Flags\"\n        defaultValue={settings.additionalCliFlags}\n        onChange={handleChanged}\n      />\n    ),\n    [handleChanged, settings.additionalCliFlags]\n  )\n\n  const helpText = useMemo(() => <>Set additional CLI Flags to use.</>, [])\n\n  return { input, helpText }\n}\n\nexport function useExtraEnvVarsOption() {\n  const { settings, set } = useChangeSettings()\n\n  const handleChanged = useCallback(\n    (newValue: string) => {\n      const value = newValue.trim()\n      set(\"additionalEnvVars\", value)\n      Command.ADDITIONAL_ENV_VARS = value\n    },\n    [set]\n  )\n\n  const input = useMemo(\n    () => (\n      <ClearableInput\n        placeholder=\"Additional Environment Variables\"\n        defaultValue={settings.additionalEnvVars}\n        onChange={handleChanged}\n      />\n    ),\n    [handleChanged, settings.additionalEnvVars]\n  )\n\n  const helpText = useMemo(\n    () => (\n      <>\n        Set additional environment variables DevPod passes to all commands. Accepts a comma\n        separated list, e.g. FOO=bar,BAZ=false\n      </>\n    ),\n    []\n  )\n\n  return { input, helpText }\n}\n\nexport function useDotfilesOption() {\n  const { settings, set } = useChangeSettings()\n  const updateOption = useCallback(\n    (value: string) => {\n      set(\"dotfilesUrl\", value)\n      client.setSetting(\"dotfilesUrl\", value)\n    },\n    [set]\n  )\n\n  const input = useMemo(\n    () => (\n      <ClearableInput\n        placeholder=\"Dotfiles repo URL\"\n        defaultValue={settings.dotfilesUrl}\n        onChange={updateOption}\n      />\n    ),\n    [settings.dotfilesUrl, updateOption]\n  )\n\n  return { input }\n}\n\nexport function useSSHKeySignatureOption() {\n  const { settings, set } = useChangeSettings()\n  const updateOption = useCallback(\n    (value: string) => {\n      set(\"sshKeyPath\", value)\n      client.setSetting(\"sshKeyPath\", value)\n    },\n    [set]\n  )\n\n  const input = useMemo(\n    () => (\n      <ClearableInput\n        placeholder=\"SSH key path\"\n        defaultValue={settings.sshKeyPath}\n        onChange={updateOption}\n      />\n    ),\n    [settings.sshKeyPath, updateOption]\n  )\n\n  return { input }\n}\n\nexport function useProxyOptions() {\n  const { settings, set } = useChangeSettings()\n\n  const handleChanged = useCallback(\n    (s: keyof Pick<TSettings, \"httpProxyUrl\" | \"httpsProxyUrl\" | \"noProxy\">) =>\n      (newValue: string) => {\n        set(s, newValue)\n        client.setSetting(s, newValue)\n      },\n    [set]\n  )\n\n  const input = useMemo(() => {\n    return (\n      <>\n        <ClearableInput\n          defaultValue={settings.httpProxyUrl}\n          onChange={handleChanged(\"httpProxyUrl\")}\n          placeholder=\"Set HTTP_PROXY\"\n          label=\"HTTP\"\n        />\n        <ClearableInput\n          defaultValue={settings.httpsProxyUrl}\n          onChange={handleChanged(\"httpsProxyUrl\")}\n          placeholder=\"Set HTTPS_PROXY\"\n          label=\"HTTPS\"\n        />\n        <ClearableInput\n          defaultValue={settings.noProxy}\n          onChange={handleChanged(\"noProxy\")}\n          placeholder=\"Set NO_PROXY\"\n          label=\"NO_PROXY\"\n        />\n      </>\n    )\n  }, [handleChanged, settings.httpProxyUrl, settings.httpsProxyUrl, settings.noProxy])\n\n  const helpText = useMemo(\n    () => (\n      <>\n        Set HTTP(S) proxy configuration. These settings will only be used by DevPod itself and not\n        be available within your workspace.\n      </>\n    ),\n    []\n  )\n\n  return { input, helpText }\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/CreateWorkspace.tsx",
    "content": "import { ExampleCard, Form, IDEIcon, WarningMessageBox } from \"@/components\"\nimport {\n  Box,\n  Button,\n  Code,\n  Flex,\n  FormControl,\n  FormErrorMessage,\n  FormHelperText,\n  FormLabel,\n  Grid,\n  HStack,\n  IconButton,\n  Input,\n  Link,\n  Popover,\n  PopoverArrow,\n  PopoverBody,\n  PopoverCloseButton,\n  PopoverContent,\n  PopoverHeader,\n  PopoverTrigger,\n  SimpleGrid,\n  Text,\n  Tooltip,\n  VStack,\n  useColorMode,\n  useColorModeValue,\n  useToken,\n} from \"@chakra-ui/react\"\nimport { useCallback, useEffect, useMemo, useState } from \"react\"\nimport { Controller, ControllerRenderProps } from \"react-hook-form\"\nimport { useNavigate } from \"react-router\"\nimport { Link as RouterLink } from \"react-router-dom\"\nimport { useBorderColor } from \"../../../Theme\"\nimport { RECOMMENDED_PROVIDER_SOURCES, SIDEBAR_WIDTH } from \"../../../constants\"\nimport { useProvider, useProviders, useWorkspace, useWorkspaces } from \"../../../contexts\"\nimport { Plus } from \"../../../icons\"\nimport { CommunitySvg, ProviderPlaceholderSvg } from \"../../../images\"\nimport { canHealthCheck, exists, getKeys, isEmpty, useFormErrors } from \"../../../lib\"\nimport { Routes } from \"../../../routes\"\nimport { TIDE, TWorkspace, TWorkspaceSourceType } from \"../../../types\"\nimport { useIDEs } from \"../../../useIDEs\"\nimport { useSetupProviderModal } from \"../../Providers\"\nimport { ProviderOptionsPopover } from \"./ProviderOptionsPopover\"\nimport { WorkspaceSourceInput } from \"./WorkspaceSourceInput\"\nimport { COMMUNITY_WORKSPACE_EXAMPLES, WORKSPACE_EXAMPLES } from \"./constants\"\nimport { FieldName, TCreateWorkspaceArgs, TFormValues, TSelectProviderOptions } from \"./types\"\nimport { useCreateWorkspaceForm } from \"./useCreateWorkspaceForm\"\n\nexport function CreateWorkspace() {\n  const { ides } = useIDEs()\n\n  const navigate = useNavigate()\n  const workspace = useWorkspace<TWorkspace>(undefined)\n  const [[providers]] = useProviders()\n  const [sourceType, setSourceType] = useState<TWorkspaceSourceType>(\"git\")\n\n  const handleCreateWorkspace = useCallback(\n    ({\n      workspaceID,\n      providerID,\n      prebuildRepositories,\n      defaultIDE,\n      workspaceSource,\n      devcontainerPath,\n    }: TCreateWorkspaceArgs) => {\n      const actionID = workspace.create({\n        id: workspaceID,\n        prebuildRepositories,\n        devcontainerPath,\n        providerConfig: { providerID },\n        ideConfig: { name: defaultIDE },\n        sourceConfig: {\n          source: workspaceSource,\n          type: sourceType,\n        },\n      })\n\n      // set action id to show terminal\n      if (!isEmpty(actionID)) {\n        navigate(Routes.toAction(actionID, Routes.WORKSPACES))\n      }\n    },\n    [navigate, sourceType, workspace]\n  )\n\n  const {\n    formRef,\n    setValue,\n    register,\n    onSubmit,\n    control,\n    formState,\n    isSubmitting,\n    currentSource,\n    selectDevcontainerModal,\n  } = useCreateWorkspaceForm(handleCreateWorkspace)\n\n  const {\n    sourceError,\n    providerError,\n    defaultIDEError,\n    idError,\n    prebuildRepositoryError,\n    devcontainerPathError,\n  } = useFormErrors(Object.values(FieldName), formState)\n\n  const providerOptions = useMemo<TSelectProviderOptions>(() => {\n    if (!exists(providers)) {\n      return { installed: [], recommended: RECOMMENDED_PROVIDER_SOURCES }\n    }\n\n    const installed = Object.entries(providers)\n      .filter(([, p]) => !!p.state?.initialized && !canHealthCheck(p.config))\n      .map(([key, value]) => ({ name: key, ...value }))\n\n    return {\n      installed,\n      recommended: RECOMMENDED_PROVIDER_SOURCES,\n    }\n  }, [providers])\n\n  const handleExampleCardClicked = useCallback(\n    (newSource: string) => {\n      setValue(FieldName.SOURCE, newSource, {\n        shouldDirty: true,\n        shouldValidate: true,\n      })\n    },\n    [setValue]\n  )\n\n  const {\n    isOpen: isModalOpen,\n    modal: setupProviderModal,\n    show: showSetupProviderModal,\n    wasDismissed,\n  } = useSetupProviderModal()\n  useEffect(() => {\n    if (wasDismissed) {\n      return\n    }\n\n    // no provider available\n    if (isEmpty(getKeys(providers || {}))) {\n      showSetupProviderModal({ isStrict: true })\n\n      return\n    }\n  }, [providers, showSetupProviderModal, wasDismissed])\n\n  const backgroundColor = useColorModeValue(\"gray.50\", \"gray.900\")\n  const borderColor = useBorderColor()\n  const bottomBarBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n  const { colorMode } = useColorMode()\n\n  return (\n    <>\n      <Form ref={formRef} onSubmit={onSubmit} justifyContent={\"center\"}>\n        <VStack align=\"start\" spacing=\"6\" alignItems=\"center\" width=\"full\" maxWidth=\"container.lg\">\n          <HStack\n            gap=\"0\"\n            width=\"full\"\n            height=\"full\"\n            borderRadius=\"lg\"\n            borderWidth=\"thin\"\n            borderColor={borderColor}>\n            <FormControl\n              borderLeftRadius=\"lg\"\n              backgroundColor={backgroundColor}\n              paddingX=\"20\"\n              paddingY=\"20\"\n              height=\"full\"\n              isRequired\n              isInvalid={exists(sourceError)}\n              justifyContent=\"center\"\n              display=\"flex\"\n              borderRightWidth=\"thin\"\n              borderRightColor={borderColor}>\n              <VStack width=\"full\">\n                <Text width=\"90%\" marginBottom=\"6\" fontWeight=\"bold\">\n                  Enter Workspace Source\n                </Text>\n                <HStack spacing={0} justifyContent={\"center\"} width=\"full\">\n                  <Controller\n                    name={FieldName.SOURCE}\n                    control={control}\n                    rules={{ required: true }}\n                    render={({ field }) => (\n                      <WorkspaceSourceInput\n                        field={field}\n                        sourceType={sourceType}\n                        onSourceTypeChanged={setSourceType}\n                      />\n                    )}\n                  />\n                </HStack>\n                {exists(sourceError) && (\n                  <FormErrorMessage>{sourceError.message ?? \"Error\"}</FormErrorMessage>\n                )}\n                <FormHelperText textAlign={\"center\"}>\n                  Any git repository, local path to a folder or container image you would like to\n                  create a workspace from can be a source as long as it adheres to the{\" \"}\n                  <Link\n                    fontWeight=\"bold\"\n                    target=\"_blank\"\n                    href=\"https://containers.dev/implementors/json_reference/\">\n                    devcontainer standard\n                  </Link>\n                  .\n                </FormHelperText>\n              </VStack>\n            </FormControl>\n\n            <Box\n              width=\"72\"\n              marginInlineStart=\"0 !important\"\n              alignSelf=\"stretch\"\n              height=\"full\"\n              position=\"relative\">\n              <Text\n                paddingY=\"3\"\n                borderBottomWidth=\"thin\"\n                borderColor={borderColor}\n                width=\"full\"\n                marginBottom=\"4\"\n                fontWeight=\"medium\"\n                textAlign=\"center\">\n                Or select one of our quickstart examples\n              </Text>\n              <FormControl\n                paddingTop=\"2\"\n                marginBottom=\"4\"\n                width=\"full\"\n                display=\"flex\"\n                flexFlow=\"column\"\n                flexWrap=\"nowrap\"\n                alignItems=\"center\"\n                isRequired\n                isInvalid={exists(sourceError)}>\n                <SimpleGrid columns={2} spacingX={4} spacingY={4}>\n                  {WORKSPACE_EXAMPLES.map((example) => (\n                    <ExampleCard\n                      key={example.source}\n                      size=\"sm\"\n                      image={\n                        colorMode === \"dark\" ? example.imageDark ?? example.image : example.image\n                      }\n                      name={example.name}\n                      isSelected={currentSource === example.source}\n                      onClick={() => handleExampleCardClicked(example.source)}\n                    />\n                  ))}\n                  <Popover>\n                    <PopoverTrigger>\n                      <ExampleCard name=\"Community Quickstart\" size=\"sm\" image={CommunitySvg} />\n                    </PopoverTrigger>\n                    <PopoverContent>\n                      <PopoverArrow />\n                      <PopoverCloseButton />\n                      <PopoverHeader>Community Quickstart</PopoverHeader>\n                      <PopoverBody>\n                        <Flex gap={4}>\n                          {COMMUNITY_WORKSPACE_EXAMPLES.map((example) => (\n                            <ExampleCard\n                              key={example.source}\n                              size=\"sm\"\n                              image={colorMode === \"dark\" ? example.imageDark : example.image}\n                              name={example.name}\n                              isSelected={currentSource === example.source}\n                              onClick={() => handleExampleCardClicked(example.source)}\n                            />\n                          ))}\n                        </Flex>\n                      </PopoverBody>\n                    </PopoverContent>\n                  </Popover>\n                </SimpleGrid>\n              </FormControl>\n            </Box>\n          </HStack>\n\n          <VStack spacing=\"10\" maxWidth=\"container.lg\">\n            <HStack spacing=\"8\" alignItems={\"top\"} width={\"100%\"} justifyContent={\"start\"}>\n              <FormControl isRequired isInvalid={exists(providerError)}>\n                <FormLabel>Provider</FormLabel>\n                <Controller\n                  name={FieldName.PROVIDER}\n                  control={control}\n                  rules={{ required: true }}\n                  render={({ field }) => (\n                    <ProviderInput\n                      field={field}\n                      options={providerOptions}\n                      onAddProviderClicked={() =>\n                        showSetupProviderModal({\n                          isStrict: false,\n                        })\n                      }\n                    />\n                  )}\n                />\n                {exists(providerError) ? (\n                  <FormErrorMessage>{providerError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>Use this provider to create the workspace.</FormHelperText>\n                )}\n              </FormControl>\n\n              <FormControl isRequired isInvalid={exists(defaultIDEError)}>\n                <FormLabel>Default IDE</FormLabel>\n                <Controller\n                  name={FieldName.DEFAULT_IDE}\n                  control={control}\n                  render={({ field }) => (\n                    <IDEInput field={field} ides={ides} onClick={(name) => field.onChange(name)} />\n                  )}\n                />\n                {exists(defaultIDEError) ? (\n                  <FormErrorMessage>{defaultIDEError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    DevPod will open this workspace with the selected IDE by default. You can still\n                    change your default IDE later.\n                  </FormHelperText>\n                )}\n              </FormControl>\n            </HStack>\n            <HStack spacing=\"8\" alignItems={\"top\"} width={\"100%\"} justifyContent={\"start\"}>\n              <FormControl isInvalid={exists(idError)}>\n                <FormLabel>Workspace Name</FormLabel>\n                <Input\n                  spellCheck={false}\n                  placeholder=\"my-workspace\"\n                  type=\"text\"\n                  {...register(FieldName.ID, {\n                    validate: (value) => {\n                      if (/[^a-z0-9-]+/.test(value)) {\n                        return \"Name can only consist of lower case letters, numbers and dashes\"\n                      } else {\n                        return true\n                      }\n                    },\n                    maxLength: { value: 48, message: \"Name cannot be longer than 48 characters\" },\n                  })}\n                  onChange={(e) => {\n                    // for some reason this is needed to make `validate` work...\n                    setValue(FieldName.ID, e.target.value, {\n                      shouldDirty: true,\n                      shouldValidate: true,\n                    })\n                  }}\n                />\n                {exists(idError) ? (\n                  <FormErrorMessage>{idError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    This is the workspace name DevPod will use. This is an optional field and\n                    usually only needed if you have an already existing workspace with the same\n                    name.\n                  </FormHelperText>\n                )}\n              </FormControl>\n              <FormControl isInvalid={exists(prebuildRepositoryError)}>\n                <FormLabel>Prebuild Repository</FormLabel>\n                <Input\n                  spellCheck={false}\n                  placeholder=\"ghcr.io/my-org/my-repo\"\n                  type=\"text\"\n                  {...register(FieldName.PREBUILD_REPOSITORY)}\n                  onChange={(e) => {\n                    setValue(FieldName.PREBUILD_REPOSITORY, e.target.value, {\n                      shouldDirty: true,\n                      shouldValidate: true,\n                    })\n                  }}\n                />\n                {exists(prebuildRepositoryError) ? (\n                  <FormErrorMessage>{prebuildRepositoryError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    DevPod will use this repository to find prebuilds for the given workspace.\n                  </FormHelperText>\n                )}\n              </FormControl>\n            </HStack>\n\n            <HStack spacing=\"8\" alignItems={\"top\"} width={\"100%\"} justifyContent={\"start\"}>\n              <FormControl isInvalid={exists(devcontainerPathError)}>\n                <FormLabel>Devcontainer Path</FormLabel>\n                <Input\n                  spellCheck={false}\n                  placeholder=\"Optionally enter path to devcontainer.json\"\n                  type=\"text\"\n                  {...register(FieldName.DEVCONTAINER_PATH, { required: false })}\n                />\n                {exists(devcontainerPathError) ? (\n                  <FormErrorMessage>{devcontainerPathError.message ?? \"Error\"}</FormErrorMessage>\n                ) : (\n                  <FormHelperText>\n                    DevPod will use this path to create the dev container for this workspace. If not\n                    specified it&apos;ll use <Code>.devcontainer.json</Code> or{\" \"}\n                    <Code>.devcontainer/devcontainer.json</Code>. <br />\n                    Example: <Code>.devcontainer/service/devcontainer.json</Code>\n                  </FormHelperText>\n                )}\n              </FormControl>\n              {/* placholder box */}\n              <Box width={\"full\"} />\n            </HStack>\n          </VStack>\n\n          <HStack\n            position=\"sticky\"\n            bottom={{ base: \"-1.1rem\", xl: \"0\" }}\n            right=\"0\"\n            width={{ base: `calc(100vw - ${SIDEBAR_WIDTH})`, xl: \"full\" }}\n            height=\"20\"\n            alignItems=\"center\"\n            borderTopWidth=\"thin\"\n            borderTopColor={borderColor}\n            backgroundColor={bottomBarBackgroundColor}\n            paddingX={{ base: \"8\", xl: \"0\" }}\n            paddingY=\"8\"\n            zIndex=\"overlay\">\n            <Button\n              variant=\"primary\"\n              type=\"submit\"\n              isDisabled={formState.isSubmitting || !formState.isValid}\n              isLoading={isSubmitting}>\n              Create Workspace\n            </Button>\n          </HStack>\n        </VStack>\n      </Form>\n\n      {isModalOpen && setupProviderModal}\n\n      {selectDevcontainerModal}\n    </>\n  )\n}\n\ntype TProviderInputProps = Readonly<{\n  options: TSelectProviderOptions\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"PROVIDER\"]>\n  onAddProviderClicked?: VoidFunction\n}>\nfunction ProviderInput({ options, field, onAddProviderClicked }: TProviderInputProps) {\n  const gridChildWidth = useToken(\"sizes\", \"12\")\n  const [provider] = useProvider(field.value)\n  const workspaces = useWorkspaces<TWorkspace>()\n  const reuseWorkspace = useMemo(() => {\n    return workspaces.find((workspace) => {\n      return (\n        provider?.state?.singleMachine &&\n        workspace.provider?.name === provider.config?.name &&\n        workspace.machine?.machineId?.startsWith(\"devpod-shared-\")\n      )\n    })?.id\n  }, [provider, workspaces])\n\n  return (\n    <VStack align=\"start\" width=\"full\">\n      <Grid\n        templateColumns={`repeat(auto-fit, ${gridChildWidth})`}\n        gap=\"2\"\n        height=\"fit-content\"\n        width=\"full\"\n        flexWrap=\"wrap\">\n        {options.installed.map((p) => (\n          <Box key={p.name}>\n            <ProviderOptionsPopover\n              provider={p}\n              trigger={\n                <ExampleCard\n                  showTooltip={false}\n                  isSelected={field.value === p.name}\n                  name={p.name}\n                  size=\"sm\"\n                  onClick={() => field.onChange(p.name)}\n                  image={p.config?.icon ?? ProviderPlaceholderSvg}\n                />\n              }\n            />\n          </Box>\n        ))}\n        <Tooltip label=\"Add Provider\">\n          <IconButton\n            variant=\"outline\"\n            size=\"lg\"\n            icon={<Plus />}\n            aria-label=\"Add Provider\"\n            onClick={() => onAddProviderClicked?.()}\n          />\n        </Tooltip>\n      </Grid>\n\n      {reuseWorkspace && (\n        <WarningMessageBox\n          variant=\"ghost\"\n          size=\"sm\"\n          warning={\n            <span>\n              Will reuse the existing machine from {reuseWorkspace} and NOT create a new one. Go to{\" \"}\n              <Link as={RouterLink} to={Routes.toProvider(provider?.config?.name!)}>\n                <b>provider settings</b>\n              </Link>{\" \"}\n              to change this behaviour.\n            </span>\n          }\n        />\n      )}\n    </VStack>\n  )\n}\n\ntype TIDEInputProps = Readonly<{\n  ides: readonly TIDE[] | undefined\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"DEFAULT_IDE\"]>\n  onClick: (name: NonNullable<TIDE[\"name\"]>) => void\n}>\nfunction IDEInput({ ides, field, onClick }: TIDEInputProps) {\n  const gridChildWidth = useToken(\"sizes\", \"12\")\n\n  return (\n    <Grid\n      gap={2}\n      gridTemplateColumns={{\n        lg: `repeat(7, ${gridChildWidth})`,\n        xl: `repeat(9, ${gridChildWidth})`,\n        \"2xl\": `repeat(10, ${gridChildWidth})`,\n      }}>\n      {ides?.map((ide) => {\n        const isSelected = field.value === ide.name\n\n        return (\n          <Box key={ide.name}>\n            <ExampleCard\n              name={ide.displayName}\n              size=\"sm\"\n              image={<IDEIcon ide={ide} />}\n              isSelected={isSelected}\n              onClick={() => onClick(ide.name!)}\n            />\n          </Box>\n        )\n      })}\n    </Grid>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/ProviderOptionsPopover.tsx",
    "content": "import {\n  ConfigureProviderOptionsForm,\n  TOptionWithID,\n  useProviderDisplayOptions,\n} from \"@/views/Providers\"\nimport { mergeOptionDefinitions } from \"@/views/Providers/helpers\"\nimport { ViewIcon } from \"@chakra-ui/icons\"\nimport {\n  ButtonGroup,\n  Heading,\n  Icon,\n  IconButton,\n  List,\n  ListItem,\n  Popover,\n  PopoverArrow,\n  PopoverBody,\n  PopoverContent,\n  PopoverHeader,\n  PopoverTrigger,\n  Portal,\n  Text,\n  Tooltip,\n  VStack,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { ReactElement, useCallback, useRef, useState } from \"react\"\nimport { HiPencil } from \"react-icons/hi2\"\nimport { TNamedProvider } from \"../../../types\"\n\ntype TProviderOptionsPopoverProps = Readonly<{ provider: TNamedProvider; trigger: ReactElement }>\nexport function ProviderOptionsPopover({ provider, trigger }: TProviderOptionsPopoverProps) {\n  const { isOpen, onClose, onOpen } = useDisclosure()\n  const bodyRef = useRef<HTMLDivElement | null>(null)\n\n  const options = useProviderDisplayOptions(\n    mergeOptionDefinitions(provider.state?.options ?? {}, provider.config?.options ?? {}),\n    provider.config?.optionGroups ?? []\n  )\n  const [isLocked, setIsLocked] = useState(false)\n  const [isEditing, setIsEditing] = useState(false)\n  const reset = () => {\n    setIsEditing(false)\n    setIsLocked(false)\n    onClose()\n  }\n  const handleEditClicked = () => {\n    setIsEditing((x) => !x)\n    setIsLocked(true)\n  }\n\n  const contentRef = useRef<HTMLElement | null>(null)\n  const contentCallbackRef = useCallback((ref: HTMLElement | null) => {\n    const handlerOpts = { capture: true }\n    const handler = (event: KeyboardEvent) => {\n      event.stopPropagation()\n      event.preventDefault()\n      const isCurrentTarget = event.target === contentRef.current\n      if (isCurrentTarget && event.code === \"KeyE\") {\n        setIsEditing((x) => !x)\n        setIsLocked(true)\n      }\n    }\n    if (ref === null) {\n      contentRef.current?.removeEventListener(\"keyup\", handler, handlerOpts)\n      contentRef.current = ref\n\n      return\n    }\n\n    contentRef.current = ref\n    contentRef.current.addEventListener(\"keyup\", handler, handlerOpts)\n  }, [])\n\n  const handleContentAnimationEnd = () => {\n    if (isOpen) {\n      contentRef.current?.focus()\n    }\n  }\n\n  return (\n    <Popover\n      isOpen={isOpen}\n      onClose={reset}\n      trigger={isLocked ? \"click\" : \"hover\"}\n      placement=\"top\"\n      isLazy\n      onOpen={onOpen}>\n      <PopoverTrigger>{trigger}</PopoverTrigger>\n      <Portal>\n        <PopoverContent\n          onAnimationEnd={handleContentAnimationEnd}\n          ref={contentCallbackRef}\n          minWidth={isEditing ? \"2xl\" : \"sm\"}\n          height=\"full\">\n          <PopoverArrow />\n          <PopoverHeader fontWeight=\"semibold\">\n            <VStack align=\"start\" spacing=\"0\">\n              <Heading size=\"sm\" as=\"h3\">\n                {provider.name}\n              </Heading>\n              <Text fontSize=\"xs\">Current provider configuration</Text>\n            </VStack>\n            <ButtonGroup variant=\"outline\">\n              <Tooltip label={!isEditing ? \"Edit Provider (e)\" : \"View Configuration (e)\"}>\n                <IconButton\n                  aria-label={!isEditing ? \"Edit Provider\" : \"View Configuration\"}\n                  onClick={handleEditClicked}\n                  icon={!isEditing ? <Icon as={HiPencil} boxSize={5} /> : <ViewIcon boxSize={5} />}\n                />\n              </Tooltip>\n            </ButtonGroup>\n          </PopoverHeader>\n          <PopoverBody\n            ref={bodyRef}\n            height=\"full\"\n            maxHeight={isEditing ? \"md\" : \"sm\"}\n            overflowX=\"hidden\"\n            overflowY=\"auto\"\n            paddingBottom=\"0\">\n            {!isEditing ? (\n              <VStack align=\"start\" paddingTop=\"2\" paddingBottom=\"4\" width=\"full\">\n                {options.required.length > 0 && (\n                  <>\n                    <Heading size=\"sm\">Required</Heading>\n                    <ProviderOptionList options={options.required} />\n                  </>\n                )}\n\n                {options.groups.map(\n                  (group) =>\n                    group.options.length > 0 && (\n                      <>\n                        <Heading size=\"sm\">{group.name}</Heading>\n                        <ProviderOptionList options={group.options} />\n                      </>\n                    )\n                )}\n\n                {options.other.length > 0 && (\n                  <>\n                    <Heading size=\"sm\">Other</Heading>\n                    <ProviderOptionList options={options.other} />\n                  </>\n                )}\n              </VStack>\n            ) : (\n              <ConfigureProviderOptionsForm\n                isModal\n                containerRef={bodyRef}\n                providerID={provider.name}\n                reuseMachine={!!provider.state?.singleMachine}\n                isDefault={!!provider.default}\n              />\n            )}\n          </PopoverBody>\n        </PopoverContent>\n      </Portal>\n    </Popover>\n  )\n}\n\ntype TProviderOptionListProps = Readonly<{ options: readonly TOptionWithID[] }>\n\nfunction ProviderOptionList({ options }: TProviderOptionListProps) {\n  return (\n    <List width=\"full\" marginBottom=\"2\">\n      {options.map((option, i) => {\n        let value = option.value ?? \"-\"\n        if (option.password) {\n          value = \"*\".repeat(value.length)\n        }\n\n        return (\n          <ListItem key={i} width=\"full\" display=\"flex\" flexFlow=\"row nowrap\">\n            <Tooltip label={option.displayName}>\n              <Text\n                whiteSpace=\"nowrap\"\n                wordBreak=\"keep-all\"\n                marginRight=\"4\"\n                width=\"40\"\n                minWidth=\"40\"\n                overflowX=\"hidden\"\n                textOverflow=\"ellipsis\">\n                {option.displayName}\n              </Text>\n            </Tooltip>\n            {option.enum ? (\n              <Text\n                textOverflow=\"ellipsis\"\n                wordBreak=\"keep-all\"\n                whiteSpace=\"nowrap\"\n                width=\"full\"\n                overflowX=\"hidden\"\n                variant=\"muted\"\n                userSelect=\"text\"\n                _hover={{ overflow: \"visible\", cursor: \"text\" }}>\n                {option.enum.find((e) => e.value === value)?.displayName ?? value}\n              </Text>\n            ) : (\n              <Text\n                textOverflow=\"ellipsis\"\n                wordBreak=\"keep-all\"\n                whiteSpace=\"nowrap\"\n                width=\"full\"\n                overflowX=\"hidden\"\n                variant=\"muted\"\n                userSelect=\"text\"\n                _hover={{ overflow: \"visible\", cursor: \"text\" }}>\n                {value}\n              </Text>\n            )}\n          </ListItem>\n        )\n      })}\n    </List>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/WorkspaceSourceInput.tsx",
    "content": "import { ChevronDownIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  Icon,\n  Input,\n  InputProps,\n  Popover,\n  PopoverArrow,\n  PopoverContent,\n  PopoverTrigger,\n  Tab,\n  TabList,\n  TabPanel,\n  TabPanelProps,\n  TabPanels,\n  Tabs,\n  Tooltip,\n  VStack,\n  useColorModeValue,\n} from \"@chakra-ui/react\"\nimport { useCallback, useMemo, useState } from \"react\"\nimport { ControllerRenderProps } from \"react-hook-form\"\nimport { FiFolder } from \"react-icons/fi\"\nimport { useBorderColor } from \"../../../Theme\"\nimport { client } from \"../../../client\"\nimport { FieldName, TFormValues } from \"./types\"\nimport { TWorkspaceSourceType } from \"@/types\"\n\n// WARN: Make sure these match the regexes in /pkg/git/git.go\nconst GIT_REPOSITORY_PATTERN =\n  \"((?:(?:https?|git|ssh)://)?(?:[^@/\\\\n]+@)?(?:[^:/\\\\n]+)(?:[:/][^/\\\\n]+)+(?:\\\\.git)?)\"\nconst GIT_REPOSITORY_REGEX = new RegExp(GIT_REPOSITORY_PATTERN)\nconst BRANCH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@([a-zA-Z0-9\\\\./\\\\-\\\\_]+)$`)\nconst COMMIT_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@sha256:([a-zA-Z0-9]+)$`)\nconst PR_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@pull\\\\/([0-9]+)\\\\/head$`)\nconst SUBPATH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@subpath:([a-zA-Z0-9\\\\./\\\\-\\\\_]+)$`)\n\nconst AdvancedGitSetting = {\n  BRANCH: \"branch\",\n  COMMIT: \"commit\",\n  PR: \"pr\",\n  SUBPATH: \"subpath\",\n} as const\nconst ADVANCED_GIT_SETTING_TABS = [\n  AdvancedGitSetting.BRANCH,\n  AdvancedGitSetting.COMMIT,\n  AdvancedGitSetting.PR,\n  AdvancedGitSetting.SUBPATH,\n]\ntype TAdvancedGitSetting = (typeof AdvancedGitSetting)[keyof typeof AdvancedGitSetting]\nconst INITIAL_ADVANCED_SETTINGS = { option: AdvancedGitSetting.BRANCH, value: \"\" }\n\nconst SOURCE_TYPE_MAP = {\n  0: \"local\",\n  1: \"git\",\n  2: \"image\",\n  local: 0,\n  git: 1,\n  image: 2,\n}\ntype TWorkspaceSourceInputProps = Readonly<{\n  field: ControllerRenderProps<TFormValues, (typeof FieldName)[\"SOURCE\"]>\n  sourceType: TWorkspaceSourceType\n  onSourceTypeChanged: (type: TWorkspaceSourceType) => void\n}>\nexport function WorkspaceSourceInput({\n  field,\n  sourceType,\n  onSourceTypeChanged,\n}: TWorkspaceSourceInputProps) {\n  const inputBackgroundColor = useColorModeValue(\"white\", \"background.darkest\")\n  const borderColor = useBorderColor()\n  const [tabIndex, setTabIndex] = useState(0)\n  const typeTabIndex = SOURCE_TYPE_MAP[sourceType]\n  const handleSourceTypeChanged = (index: number) => {\n    onSourceTypeChanged(SOURCE_TYPE_MAP[index as 0 | 1 | 2] as TWorkspaceSourceType)\n  }\n  const [advancedGitSettings, setAdvancedGitSettings] =\n    useState<Readonly<{ option: TAdvancedGitSetting | null; value: string }>>(\n      INITIAL_ADVANCED_SETTINGS\n    )\n  const updateAdvancedGitSettings = <TKey extends keyof typeof advancedGitSettings>(\n    key: TKey,\n    val: (typeof advancedGitSettings)[TKey]\n  ) => {\n    setAdvancedGitSettings((prev) => {\n      const newSettings = { ...prev, [key]: val }\n      if (newSettings.option === prev.option && newSettings.value === prev.value) {\n        return prev\n      }\n\n      // NOTE: field.value can be undefined\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      if (newSettings.value !== \"\" && newSettings.option !== null && field.value !== undefined) {\n        // update source\n        field.onChange(appendGitSetting(field.value, newSettings.option, newSettings.value))\n        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      } else if (newSettings.value === \"\" && field.value !== undefined) {\n        field.onChange(pruneGitSettings(field.value))\n      }\n\n      return newSettings\n    })\n  }\n\n  const handleSelectFolderClicked = useCallback(async () => {\n    const selected = await client.selectFromDir()\n    if (typeof selected === \"string\") {\n      field.onChange(selected)\n    }\n  }, [field])\n\n  const handleAdvancedOptionTabChanged = (index: number) => {\n    const option = ADVANCED_GIT_SETTING_TABS[index]\n    updateAdvancedGitSettings(\"option\", option as TAdvancedGitSetting)\n    setTabIndex(index)\n  }\n\n  const handlePopoverOpened = () => {\n    // synchronize field value with internal state\n    const settings = parseAdvancedSettings(field.value)\n    if (settings.option === null) {\n      // set default\n      settings.option = INITIAL_ADVANCED_SETTINGS.option\n    }\n\n    setAdvancedGitSettings((prev) => {\n      if (settings.option === prev.option && settings.value === prev.value) {\n        return prev\n      }\n\n      return settings\n    })\n    setTabIndex(ADVANCED_GIT_SETTING_TABS.indexOf(settings.option))\n  }\n\n  const inputCommonProps = useMemo<InputProps>(() => {\n    return {\n      spellCheck: false,\n      backgroundColor: inputBackgroundColor,\n      fontSize: \"md\",\n      height: \"12\",\n      type: \"text\",\n      value: field.value,\n      onChange: field.onChange,\n      width: \"full\",\n    }\n  }, [field.onChange, field.value, inputBackgroundColor])\n\n  const tabPanelProps = useMemo<TabPanelProps>(() => {\n    return {\n      px: \"0\",\n      display: \"flex\",\n      flexDir: \"row\",\n      flexWrap: \"nowrap\",\n      alignItems: \"center\",\n      width: \"full\",\n    }\n  }, [])\n\n  const isGitRepoValid = GIT_REPOSITORY_REGEX.test(field.value)\n  const allowAdvancedInput = field.value && isGitRepoValid\n  const allowPullRequest =\n    advancedGitSettings.value.length === 0 || !isNaN(parseInt(advancedGitSettings.value))\n\n  return (\n    <Tabs width=\"90%\" variant=\"muted\" index={typeTabIndex} onChange={handleSourceTypeChanged}>\n      <TabList>\n        <Tab>Folder</Tab>\n        <Tab>Git Repo</Tab>\n        <Tab>Image</Tab>\n      </TabList>\n      <TabPanels>\n        <TabPanel {...tabPanelProps}>\n          <Input\n            {...inputCommonProps}\n            borderTopRightRadius={0}\n            borderBottomRightRadius={0}\n            placeholder=\"/path/to/workspace\"\n          />\n          <Button\n            leftIcon={<Icon as={FiFolder} />}\n            transform=\"auto\"\n            borderTopLeftRadius={0}\n            borderBottomLeftRadius={0}\n            borderTopWidth={\"thin\"}\n            borderRightWidth={\"thin\"}\n            borderBottomWidth={\"thin\"}\n            minW=\"28\"\n            borderColor={borderColor}\n            height={inputCommonProps.height}\n            onClick={handleSelectFolderClicked}>\n            Browse...\n          </Button>\n        </TabPanel>\n        <TabPanel {...tabPanelProps}>\n          <Input\n            {...inputCommonProps}\n            borderTopRightRadius={0}\n            borderBottomRightRadius={0}\n            placeholder=\"github.com/loft-sh/devpod-example-go\"\n          />\n          <Popover isLazy onOpen={handlePopoverOpened}>\n            <PopoverTrigger>\n              <Button\n                leftIcon={<ChevronDownIcon boxSize={5} />}\n                transform=\"auto\"\n                borderTopLeftRadius={0}\n                borderBottomLeftRadius={0}\n                borderTopWidth={\"thin\"}\n                borderRightWidth={\"thin\"}\n                borderBottomWidth={\"thin\"}\n                borderColor={borderColor}\n                minW=\"32\"\n                height={inputCommonProps.height}>\n                Advanced...\n              </Button>\n            </PopoverTrigger>\n            <PopoverContent width=\"auto\" padding=\"4\">\n              <PopoverArrow />\n              <VStack>\n                <Tabs\n                  variant=\"muted-popover\"\n                  size=\"sm\"\n                  index={tabIndex}\n                  onChange={handleAdvancedOptionTabChanged}>\n                  <TabList>\n                    <Tab>Branch</Tab>\n                    <Tab>Commit</Tab>\n                    <Tab isDisabled={!allowPullRequest}>\n                      <Tooltip\n                        label={!allowPullRequest ? \"Pull request reference must be a number\" : \"\"}>\n                        Pull Request\n                      </Tooltip>\n                    </Tab>\n                    <Tab>Sub Folder</Tab>\n                  </TabList>\n                  <TabPanels paddingTop=\"2\">\n                    <Tooltip\n                      placement=\"top-start\"\n                      label={\n                        !allowAdvancedInput\n                          ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n                            `Git repository \"${field.value ?? \"\"}\" is empty or invalid`\n                          : \"\"\n                      }>\n                      <Input\n                        value={advancedGitSettings.value}\n                        isDisabled={!allowAdvancedInput}\n                        onChange={(e) => updateAdvancedGitSettings(\"value\", e.target.value)}\n                        placeholder={getAdvancedSettingsPlaceholder(\n                          ADVANCED_GIT_SETTING_TABS[tabIndex]\n                        )}\n                      />\n                    </Tooltip>\n                  </TabPanels>\n                </Tabs>\n              </VStack>\n            </PopoverContent>\n          </Popover>\n        </TabPanel>\n        <TabPanel {...tabPanelProps}>\n          <Input {...inputCommonProps} width=\"full\" placeholder=\"alpine\" />\n        </TabPanel>\n      </TabPanels>\n    </Tabs>\n  )\n}\n\nfunction appendGitSetting(\n  currentValue: string,\n  setting: TAdvancedGitSetting,\n  settingValue: string\n): string {\n  currentValue = pruneGitSettings(currentValue)\n\n  switch (setting) {\n    case AdvancedGitSetting.BRANCH:\n      return `${currentValue}@${settingValue}`\n    case AdvancedGitSetting.COMMIT:\n      return `${currentValue}@sha256:${settingValue}`\n    case AdvancedGitSetting.PR:\n      if (isNaN(parseInt(settingValue, 10))) {\n        return currentValue\n      }\n\n      return `${currentValue}@pull/${settingValue}/head`\n    case AdvancedGitSetting.SUBPATH:\n      return `${currentValue}@subpath:${settingValue}`\n  }\n}\n\nfunction pruneGitSettings(value: string): string {\n  return value\n    .replace(/\\/$/, \"\")\n    .replace(BRANCH_REGEX, \"$1\")\n    .replace(COMMIT_REGEX, \"$1\")\n    .replace(PR_REGEX, \"$1\")\n    .replace(SUBPATH_REGEX, \"$1\")\n}\n\nfunction getAdvancedSettingsPlaceholder(setting: TAdvancedGitSetting | undefined): string {\n  if (setting === undefined) {\n    return \"\"\n  }\n\n  switch (setting) {\n    case AdvancedGitSetting.BRANCH:\n      return \"Enter git branch\"\n    case AdvancedGitSetting.COMMIT:\n      return \"Enter SHA256 hash\"\n    case AdvancedGitSetting.PR:\n      return \"Enter PR reference number\"\n    case AdvancedGitSetting.SUBPATH:\n      return \"Enter sub folder path\"\n  }\n}\n\nfunction parseAdvancedSettings(value: string | undefined): {\n  option: TAdvancedGitSetting | null\n  value: string\n} {\n  if (!value) {\n    return { option: null, value: \"\" }\n  }\n\n  let matches = value.match(COMMIT_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.COMMIT, value: matches[2] }\n  }\n  matches = value.match(SUBPATH_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.SUBPATH, value: matches[2] }\n  }\n  matches = value.match(PR_REGEX)\n  if (matches && matches[2] && !isNaN(parseInt(matches[2]))) {\n    return { option: AdvancedGitSetting.PR, value: matches[2] }\n  }\n  matches = value.match(BRANCH_REGEX)\n  if (matches && matches[2]) {\n    return { option: AdvancedGitSetting.BRANCH, value: matches[2] }\n  }\n\n  // shouldn't happen\n  return { value: \"\", option: null }\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/constants.ts",
    "content": "import {\n  CppSvg,\n  DotnetcoreSvg,\n  GoSvg,\n  GoSvgDark,\n  JavaSvg,\n  NodejsSvg,\n  PhpSvg,\n  PhpSvgDark,\n  PythonSvg,\n  RubySvg,\n  RustSvg,\n  RustSvgDark,\n} from \"../../../images\"\n\nexport const WORKSPACE_EXAMPLES = [\n  {\n    image: PythonSvg,\n    source: \"https://github.com/microsoft/vscode-remote-try-python\",\n    name: \"Try Python\",\n  },\n  {\n    image: NodejsSvg,\n    source: \"https://github.com/microsoft/vscode-remote-try-node\",\n    name: \"Try Node\",\n  },\n  {\n    image: GoSvg,\n    imageDark: GoSvgDark,\n    source: \"https://github.com/loft-sh/devpod-example-go\",\n    name: \"Try Go\",\n  },\n  {\n    image: RustSvg,\n    imageDark: RustSvgDark,\n    source: \"https://github.com/microsoft/vscode-remote-try-rust\",\n    name: \"Try Rust\",\n  },\n  {\n    image: JavaSvg,\n    source: \"https://github.com/microsoft/vscode-remote-try-java\",\n    name: \"Try Java\",\n  },\n  {\n    image: PhpSvg,\n    imageDark: PhpSvgDark,\n    source: \"https://github.com/microsoft/vscode-remote-try-php\",\n    name: \"Try PHP\",\n  },\n  {\n    image: CppSvg,\n    source: \"https://github.com/microsoft/vscode-remote-try-cpp\",\n    name: \"Try C++\",\n  },\n]\n\nexport const COMMUNITY_WORKSPACE_EXAMPLES = [\n  {\n    image: RubySvg,\n    imageDark: RubySvg,\n    source: \"https://github.com/loft-sh/devpod-quickstart-ruby\",\n    name: \"Try Ruby\",\n  },\n  {\n    image: DotnetcoreSvg,\n    source: \"https://github.com/microsoft/vscode-remote-try-dotnet\",\n    name: \"Try Dotnet\",\n  },\n]\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/index.ts",
    "content": "export { CreateWorkspace } from \"./CreateWorkspace\"\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/types.ts",
    "content": "import { RECOMMENDED_PROVIDER_SOURCES } from \"../../../constants\"\nimport { Routes } from \"../../../routes\"\nimport { TNamedProvider, TProviderID, TWorkspaceID } from \"../../../types\"\n\nexport const FieldName = {\n  SOURCE: \"source\",\n  ID: \"id\",\n  DEFAULT_IDE: \"defaultIDE\",\n  PROVIDER: \"provider\",\n  PREBUILD_REPOSITORY: \"prebuildRepository\",\n  DEVCONTAINER_PATH: \"devcontainerPath\",\n} as const\n\nexport type TFormValues = {\n  [FieldName.SOURCE]: string\n  [FieldName.DEFAULT_IDE]: string\n  [FieldName.PROVIDER]: TProviderID\n  [FieldName.ID]: string\n  [FieldName.PREBUILD_REPOSITORY]: string\n  [FieldName.DEVCONTAINER_PATH]?: string\n}\n\nexport type TCreateWorkspaceSearchParams = ReturnType<\n  typeof Routes.getWorkspaceCreateParamsFromSearchParams\n>\nexport type TCreateWorkspaceArgs = Readonly<{\n  workspaceID: TWorkspaceID\n  providerID: TProviderID\n  prebuildRepositories: string[]\n  defaultIDE: string\n  workspaceSource: string\n  devcontainerPath: string | undefined\n}>\nexport type TSelectProviderOptions = Readonly<{\n  installed: readonly TNamedProvider[]\n  recommended: typeof RECOMMENDED_PROVIDER_SOURCES\n}>\n"
  },
  {
    "path": "desktop/src/views/Workspaces/CreateWorkspace/useCreateWorkspaceForm.tsx",
    "content": "import { Routes } from \"@/routes\"\nimport {\n  Button,\n  Code,\n  List,\n  ListItem,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalFooter,\n  ModalHeader,\n  ModalOverlay,\n  Text,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { FormEventHandler, useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { createSearchParams } from \"react-router-dom\"\nimport { client } from \"../../../client\"\nimport { useSettings, useWorkspaces } from \"../../../contexts\"\nimport { exists } from \"../../../lib\"\nimport { randomWords } from \"../../../lib/randomWords\"\nimport { TIDEs, TProviders, TWorkspace } from \"../../../types\"\nimport { FieldName, TCreateWorkspaceArgs, TFormValues } from \"./types\"\n\nconst DEFAULT_PREBUILD_REPOSITORY_KEY = \"devpod-create-prebuild-repository\"\nconst DEFAULT_CONTAINER_PATH = \"__internal-default\"\n\nexport function useCreateWorkspaceForm(onCreateWorkspace: (args: TCreateWorkspaceArgs) => void) {\n  const formRef = useRef<HTMLFormElement>(null)\n  const settings = useSettings()\n  const workspaces = useWorkspaces<TWorkspace>()\n  const [isSubmitLoading, setIsSubmitLoading] = useState(false)\n  const { register, handleSubmit, formState, watch, setError, setValue, control, getFieldState } =\n    useForm<TFormValues>({\n      async defaultValues() {\n        const params = Routes.getWorkspaceCreateParamsFromSearchParams(\n          createSearchParams(location.search)\n        )\n\n        const [providersRes, idesRes] = await Promise.all([\n          client.providers.listAll(),\n          client.ides.listAll(),\n        ])\n        let providers: TProviders = {}\n        if (providersRes.ok) {\n          providers = providersRes.val\n        }\n\n        let ides: TIDEs = []\n        if (idesRes.ok) {\n          ides = idesRes.val\n        }\n\n        const defaultProvider =\n          params.providerID ??\n          Object.keys(providers).find((providerID) => providers[providerID]?.default) ??\n          Object.keys(providers)[0] ??\n          \"\"\n\n        const defaultIDE =\n          params.ide ??\n          ides.find((ide) => ide.default)?.name ??\n          ides.find((ide) => ide.name === \"openvscode\")?.name ??\n          \"\"\n\n        const defaultWorkspaceID = params.workspaceID ?? \"\"\n        const defaultSource = params.rawSource ?? \"\"\n        const defaultPrebuildRepo =\n          window.localStorage.getItem(DEFAULT_PREBUILD_REPOSITORY_KEY) ?? \"\"\n\n        return {\n          [FieldName.ID]: defaultWorkspaceID,\n          [FieldName.SOURCE]: defaultSource,\n          [FieldName.PROVIDER]: defaultProvider,\n          [FieldName.DEFAULT_IDE]: defaultIDE,\n          [FieldName.DEVCONTAINER_PATH]: undefined,\n          [FieldName.PREBUILD_REPOSITORY]: defaultPrebuildRepo,\n        }\n      },\n    })\n  const currentSource = watch(FieldName.SOURCE)\n  const currentProvider = watch(FieldName.PROVIDER)\n  const isSubmitting = useMemo(\n    () => formState.isSubmitting || isSubmitLoading,\n    [formState.isSubmitting, isSubmitLoading]\n  )\n  const handleDevcontainerSelected = useCallback(\n    (selectedDevcontainer: string | undefined) => {\n      setValue(FieldName.DEVCONTAINER_PATH, selectedDevcontainer ?? DEFAULT_CONTAINER_PATH, {\n        shouldDirty: true,\n        shouldValidate: true,\n      })\n      formRef.current?.dispatchEvent(new Event(\"submit\", { cancelable: true, bubbles: true }))\n    },\n    [setValue]\n  )\n\n  const { modal: selectDevcontainerModal, show: showSelectDevcontainerModal } =\n    useSelectDevcontainerModal({ onSelected: handleDevcontainerSelected })\n\n  // Handle workspace name\n  useEffect(() => {\n    if (exists(currentSource) && currentSource !== \"\") {\n      setValue(FieldName.ID, \"\", { shouldDirty: true })\n\n      client.workspaces.newID(currentSource).then((res) => {\n        if (res.err) {\n          setError(FieldName.SOURCE, { message: res.val.message })\n\n          return\n        }\n        let workspaceID = res.val\n        if (!isWorkspaceNameAvailable(workspaceID, workspaces)) {\n          workspaceID = `${workspaceID}-${currentProvider}`\n\n          if (isWorkspaceNameAvailable(workspaceID, workspaces)) {\n            setValue(FieldName.ID, workspaceID, { shouldDirty: true })\n\n            return\n          }\n\n          const words = randomWords({ amount: 2 })\n          workspaceID = `${res.val}-${words[0] ?? \"x\"}-${words[1] ?? \"y\"}`\n          if (isWorkspaceNameAvailable(workspaceID, workspaces)) {\n            setValue(FieldName.ID, workspaceID, { shouldDirty: true })\n\n            return\n          }\n\n          setError(FieldName.SOURCE, { message: \"Workspace with the same name already exists\" })\n\n          return\n        }\n      })\n    }\n  }, [currentProvider, currentSource, getFieldState, setError, setValue, workspaces])\n\n  const onSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n    (event) =>\n      handleSubmit(async (data) => {\n        // save prebuild repository\n        const maybePrebuildRepo = data[FieldName.PREBUILD_REPOSITORY]\n        if (maybePrebuildRepo) {\n          window.localStorage.setItem(DEFAULT_PREBUILD_REPOSITORY_KEY, maybePrebuildRepo)\n        } else {\n          window.localStorage.removeItem(DEFAULT_PREBUILD_REPOSITORY_KEY)\n        }\n\n        const workspaceSource = data[FieldName.SOURCE].trim()\n        setIsSubmitLoading(true)\n        let workspaceID = data[FieldName.ID]\n        if (!workspaceID) {\n          const newIDResult = await client.workspaces.newID(workspaceSource)\n          if (newIDResult.err) {\n            setIsSubmitLoading(false)\n            setError(FieldName.SOURCE, { message: newIDResult.val.message })\n\n            return\n          }\n\n          workspaceID = newIDResult.val\n        }\n\n        if (workspaces.find((workspace) => workspace.id === workspaceID)) {\n          setIsSubmitLoading(false)\n          setError(FieldName.SOURCE, { message: \"workspace with the same name already exists\" })\n\n          return\n        }\n\n        const providerID = data[FieldName.PROVIDER]\n        const defaultIDE = data[FieldName.DEFAULT_IDE]\n\n        // set default provider\n        const useProviderResult = await client.providers.useProvider(providerID)\n        if (useProviderResult.err) {\n          setIsSubmitLoading(false)\n          setError(FieldName.SOURCE, { message: useProviderResult.val.message })\n\n          return\n        }\n\n        let maybeDevcontainerPath = data[FieldName.DEVCONTAINER_PATH]\n        if (maybeDevcontainerPath === DEFAULT_CONTAINER_PATH) {\n          maybeDevcontainerPath = undefined\n        } else if (settings.experimental_multiDevcontainer && maybeDevcontainerPath === \"\") {\n          // check for multiple devcontainers\n          const checkDevcontainerSetupResult =\n            await client.workspaces.checkDevcontainerSetup(workspaceSource)\n          setIsSubmitLoading(false)\n          if (!checkDevcontainerSetupResult.ok) {\n            setError(FieldName.DEVCONTAINER_PATH, {\n              message: checkDevcontainerSetupResult.val.message,\n            })\n          } else if (checkDevcontainerSetupResult.val.configPaths.length > 1) {\n            showSelectDevcontainerModal(checkDevcontainerSetupResult.val.configPaths)\n\n            return\n          }\n        }\n\n        if (!settings.fixedIDE) {\n          // set default ide\n          const useIDEResult = await client.ides.useIDE(defaultIDE)\n          if (useIDEResult.err) {\n            setIsSubmitLoading(false)\n            setError(FieldName.SOURCE, { message: useIDEResult.val.message })\n\n            return\n          }\n        }\n\n        setIsSubmitLoading(false)\n        const prebuildRepositories = data[FieldName.PREBUILD_REPOSITORY]\n          ? [data[FieldName.PREBUILD_REPOSITORY]]\n          : []\n\n        onCreateWorkspace({\n          workspaceID,\n          providerID,\n          prebuildRepositories,\n          defaultIDE,\n          workspaceSource,\n          devcontainerPath: maybeDevcontainerPath,\n        })\n      })(event),\n    [\n      handleSubmit,\n      workspaces,\n      settings.experimental_multiDevcontainer,\n      settings.fixedIDE,\n      onCreateWorkspace,\n      setError,\n      showSelectDevcontainerModal,\n    ]\n  )\n\n  return {\n    formRef,\n    register,\n    setValue,\n    isSubmitLoading,\n    formState,\n    onSubmit,\n    isSubmitting,\n    currentSource,\n    control,\n    selectDevcontainerModal,\n  }\n}\n\nfunction isWorkspaceNameAvailable(workspaceID: string, workspaces: readonly TWorkspace[]): boolean {\n  return workspaces.find((workspace) => workspace.id === workspaceID) === undefined\n}\n\nfunction useSelectDevcontainerModal({\n  onSelected,\n}: Readonly<{ onSelected: (path: string | undefined) => void }>) {\n  const [devcontainerPaths, setDevcontainerPaths] = useState<string[]>([])\n  const { isOpen, onClose, onOpen } = useDisclosure()\n\n  const modal = useMemo(\n    () => (\n      <Modal\n        onClose={() => {\n          onSelected(undefined)\n          onClose()\n        }}\n        isOpen={isOpen}\n        isCentered\n        size=\"3xl\"\n        scrollBehavior=\"inside\"\n        closeOnEsc={true}\n        closeOnOverlayClick={true}>\n        <ModalOverlay />\n        <ModalContent>\n          <ModalCloseButton />\n          <ModalHeader>Select devcontainer</ModalHeader>\n          <ModalBody>\n            <Text>\n              There are multiple <Code>devcontainer.json</Code> files available. Please select one\n              or dismiss to use default.\n            </Text>\n            <List spacing=\"2\" paddingTop=\"4\">\n              {devcontainerPaths.map((devcontainerPath) => (\n                <ListItem key={devcontainerPath}>\n                  <Button\n                    width=\"full\"\n                    justifyContent=\"start\"\n                    variant=\"ghost\"\n                    key={devcontainerPath}\n                    onClick={() => {\n                      onClose()\n                      onSelected(devcontainerPath)\n                    }}>\n                    {devcontainerPath}\n                  </Button>\n                </ListItem>\n              ))}\n            </List>\n          </ModalBody>\n          <ModalFooter />\n        </ModalContent>\n      </Modal>\n    ),\n    [devcontainerPaths, isOpen, onClose, onSelected]\n  )\n\n  const show = useCallback(\n    (devcontainerPaths: string[]) => {\n      setDevcontainerPaths(devcontainerPaths)\n      onOpen()\n    },\n    [onOpen]\n  )\n\n  return { show, modal }\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/ListWorkspaces.tsx",
    "content": "import { TWorkspaceStatusFilterState, WorkspaceSorter, WorkspaceStatusFilter } from \"@/components\"\nimport { DeleteWorkspacesModal } from \"@/components/DeleteWorkspacesModal\"\nimport { WorkspaceListSelection } from \"@/components/ListSelection\"\nimport { useProviders, useWorkspaceStore, useWorkspaces } from \"@/contexts\"\nimport { removeWorkspaceAction, stopWorkspaceAction } from \"@/contexts/DevPodContext/workspaces\"\nimport { Stack3D } from \"@/icons\"\nimport { exists, useSelection, useSortWorkspaces } from \"@/lib\"\nimport { DEFAULT_SORT_WORKSPACE_MODE } from \"@/lib/useSortWorkspaces\"\nimport { Routes } from \"@/routes\"\nimport { TProvider, TProviderID, TWorkspace } from \"@/types\"\nimport {\n  Box,\n  Button,\n  ColorMode,\n  HStack,\n  Image,\n  Menu,\n  MenuButton,\n  MenuDivider,\n  MenuItemOption,\n  MenuList,\n  MenuOptionGroup,\n  Text,\n  VStack,\n  useColorMode,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useCallback, useEffect, useId, useMemo, useState } from \"react\"\nimport { useNavigate } from \"react-router\"\nimport { WorkspaceCard } from \"./WorkspaceCard\"\nimport { RECOMMENDED_PROVIDER_SOURCES } from \"../../constants\"\n\ntype TWorkspacesInfo = Readonly<{\n  workspaceCards: TWorkspace[]\n}>\n\nexport function ListWorkspaces() {\n  const { store } = useWorkspaceStore()\n  const viewID = useId()\n  const navigate = useNavigate()\n  const [[providers]] = useProviders()\n  const workspaces = useWorkspaces<TWorkspace>()\n  const { colorMode } = useColorMode()\n\n  const selection = useSelection()\n\n  const {\n    isOpen: isDeleteOpen,\n    onOpen: handleDeleteClicked,\n    onClose: onDeleteClose,\n  } = useDisclosure()\n\n  const [providersFilter, setProvidersFilter] = useState<TProviderID[] | \"all\">(\"all\")\n  const [statusFilter, setStatusFilter] = useState<TWorkspaceStatusFilterState>(\"all\")\n\n  const [selectedSortOption, setSelectedSortOption] = useState(DEFAULT_SORT_WORKSPACE_MODE)\n  const sortedWorkspaces = useSortWorkspaces(workspaces, selectedSortOption)\n\n  const { workspaceCards } = useMemo<TWorkspacesInfo>(() => {\n    const empty: TWorkspacesInfo = { workspaceCards: [] }\n    if (!exists(sortedWorkspaces)) {\n      return empty\n    }\n\n    return sortedWorkspaces.reduce<TWorkspacesInfo>((acc, workspace) => {\n      const { id } = workspace\n      if (!exists(id)) {\n        return acc\n      }\n\n      if (\n        workspace.provider?.name &&\n        providersFilter !== \"all\" &&\n        !providersFilter.includes(workspace.provider.name)\n      ) {\n        return acc\n      }\n\n      if (statusFilter !== \"all\" && !statusFilter.includes(workspace.status as string)) {\n        return acc\n      }\n\n      acc.workspaceCards.push(workspace)\n\n      return acc\n    }, empty)\n  }, [providersFilter, statusFilter, sortedWorkspaces])\n\n  const workspaceIds = useMemo(() => {\n    return workspaceCards.map((w) => w.id)\n  }, [workspaceCards])\n\n  useEffect(() => {\n    selection.prune(workspaceIds)\n  }, [selection, workspaceIds])\n\n  const handleSelectionChanged = useCallback(\n    (workspaceID: string) => () => selection.toggleSelection(workspaceID),\n    [selection]\n  )\n\n  const handleSelectAllClicked = useCallback(() => {\n    selection.toggleSelectAll(workspaceIds)\n  }, [workspaceIds, selection])\n\n  const handleStopAllClicked = useCallback(() => {\n    const allSelected = workspaces.filter((workspace) => selection.has(workspace.id))\n    for (const w of allSelected) {\n      stopWorkspaceAction({\n        workspaceID: w.id,\n        streamID: viewID,\n        store,\n      })\n    }\n\n    selection.clear()\n  }, [selection, store, viewID, workspaces])\n\n  const handleDeleteAllClicked = useCallback(\n    (forceDelete: boolean) => {\n      const allSelected = workspaces.filter((workspace) => selection.has(workspace.id))\n      for (const w of allSelected) {\n        removeWorkspaceAction({\n          workspaceID: w.id,\n          streamID: viewID,\n          force: forceDelete,\n          store,\n        })\n      }\n      selection.clear()\n    },\n    [selection, workspaces, viewID, store]\n  )\n\n  const availableProviders = Object.entries(providers ?? {}).filter(\n    ([, provider]) => !provider.isProxyProvider\n  )\n  const allProvidersCount = availableProviders.length\n\n  return (\n    <>\n      <VStack alignItems={\"flex-start\"} paddingBottom=\"6\" w=\"full\">\n        <HStack justifyContent=\"space-between\" w=\"full\">\n          <WorkspaceListSelection\n            totalAmount={workspaceCards.length}\n            selectionAmount={selection.size}\n            handleSelectAllClicked={handleSelectAllClicked}\n            handleStopAllClicked={handleStopAllClicked}\n            handleDeleteClicked={handleDeleteClicked}\n          />\n\n          <HStack>\n            <Menu closeOnSelect={false} offset={[0, 2]}>\n              <MenuButton as={Button} variant=\"outline\" leftIcon={<Stack3D boxSize={4} />}>\n                Providers ({getCurrentFilterCount(providersFilter, allProvidersCount)}/\n                {allProvidersCount})\n              </MenuButton>\n              <MenuList>\n                <MenuItemOption\n                  isChecked={\n                    providersFilter.includes(\"all\") || providersFilter.length === allProvidersCount\n                  }\n                  onClick={() => setProvidersFilter((curr) => (curr === \"all\" ? [] : \"all\"))}\n                  value=\"all\">\n                  Select All\n                </MenuItemOption>\n                <MenuOptionGroup\n                  value={providersFilter === \"all\" ? Object.keys(providers ?? {}) : providersFilter}\n                  onChange={(value) =>\n                    setProvidersFilter(typeof value === \"string\" ? [value] : value)\n                  }\n                  type=\"checkbox\">\n                  <MenuDivider />\n                  {availableProviders.map(([providerID, provider]) => {\n                    const icon = getProviderIcon(provider, colorMode)\n\n                    return (\n                      <MenuItemOption key={providerID} value={providerID}>\n                        <HStack>\n                          {icon ? <Image src={icon} boxSize={4} /> : <Box boxSize={4} />}\n                          <Text>{providerID}</Text>\n                        </HStack>\n                      </MenuItemOption>\n                    )\n                  })}\n                </MenuOptionGroup>\n              </MenuList>\n            </Menu>\n\n            <WorkspaceStatusFilter statusFilter={statusFilter} setStatusFilter={setStatusFilter} />\n\n            <WorkspaceSorter sortMode={selectedSortOption} setSortMode={setSelectedSortOption} />\n          </HStack>\n        </HStack>\n\n        <Box w=\"full\" h=\"full\">\n          {workspaceCards.length === 0 ? (\n            <VStack paddingTop=\"6\">\n              <Text>No workspaces for selection found. Click here to create one</Text>\n              <Button onClick={() => navigate(Routes.WORKSPACE_CREATE)}>Create Workspace</Button>\n            </VStack>\n          ) : (\n            workspaceCards.map((workspace) => (\n              <WorkspaceCard\n                key={workspace.id}\n                workspaceID={workspace.id}\n                isSelected={selection.has(workspace.id)}\n                onSelectionChange={handleSelectionChanged(workspace.id)}\n              />\n            ))\n          )}\n        </Box>\n      </VStack>\n\n      <DeleteWorkspacesModal\n        isOpen={isDeleteOpen}\n        onCloseRequested={onDeleteClose}\n        onDeleteRequested={handleDeleteAllClicked}\n        amount={selection.size}\n      />\n    </>\n  )\n}\n\nfunction getCurrentFilterCount(filter: string[] | \"all\", total: number) {\n  if (filter === \"all\") {\n    return total\n  }\n\n  return filter.length\n}\n\nfunction getProviderIcon(provider: TProvider, colorMode: ColorMode): string | undefined {\n  const maybeProviderSource = RECOMMENDED_PROVIDER_SOURCES.find(\n    (p) => p.name === provider.config?.name\n  )\n  if (maybeProviderSource) {\n    if (colorMode === \"dark\") {\n      return maybeProviderSource.imageDarkMode ?? maybeProviderSource.image\n    }\n\n    return maybeProviderSource.image\n  }\n\n  return provider.config?.icon ?? undefined\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/WorkspaceCard.tsx",
    "content": "import { Template } from \"@/icons\"\nimport { useStoreTroubleshoot } from \"@/lib/useStoreTroubleshoot\"\nimport {\n  Box,\n  Card,\n  CardHeader,\n  Icon,\n  List,\n  ListItem,\n  Modal,\n  ModalBody,\n  ModalCloseButton,\n  ModalContent,\n  ModalHeader,\n  ModalOverlay,\n  Text,\n  useDisclosure,\n} from \"@chakra-ui/react\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\nimport { HiServerStack } from \"react-icons/hi2\"\nimport { useNavigate } from \"react-router\"\nimport { IconTag, WorkspaceCardHeader } from \"../../components\"\nimport {\n  TActionID,\n  useProvider,\n  useSettings,\n  useWorkspace,\n  useWorkspaceActions,\n} from \"../../contexts\"\nimport {\n  getIDEName,\n  getWorkspaceSourceName,\n  useDeleteWorkspaceModal,\n  useRebuildWorkspaceModal,\n  useResetWorkspaceModal,\n  useStopWorkspaceModal,\n} from \"../../lib\"\nimport { Routes } from \"../../routes\"\nimport { TProvider, TWorkspace, TWorkspaceID } from \"../../types\"\nimport { useIDEs } from \"../../useIDEs\"\nimport { ConfigureProviderOptionsForm } from \"../Providers\"\nimport { processDisplayOptions } from \"../Providers/AddProvider/useProviderOptions\"\nimport { TOptionWithID, mergeOptionDefinitions } from \"../Providers/helpers\"\nimport { WorkspaceControls } from \"./WorkspaceControls\"\nimport { WorkspaceStatusBadge } from \"./WorkspaceStatusBadge\"\n\ntype TWorkspaceCardProps = Readonly<{\n  workspaceID: TWorkspaceID\n  isSelected?: boolean\n  onSelectionChange?: (isSelected: boolean) => void\n}>\n\nexport function WorkspaceCard({ workspaceID, isSelected, onSelectionChange }: TWorkspaceCardProps) {\n  const changeOptionsModalBodyRef = useRef<HTMLDivElement>(null)\n  const settings = useSettings()\n  const navigate = useNavigate()\n  const { ides, defaultIDE } = useIDEs()\n  const workspace = useWorkspace<TWorkspace>(workspaceID)\n  const workspaceName = workspace.data?.id ?? \"\"\n  const workspaceActions = useWorkspaceActions(workspaceName)\n  const navigateToAction = useCallback(\n    (actionID: TActionID | undefined) => {\n      if (actionID !== undefined && actionID !== \"\") {\n        navigate(Routes.toAction(actionID))\n      }\n    },\n    [navigate]\n  )\n  const { modal: stopModal, open: openStopModal } = useStopWorkspaceModal(\n    useCallback(\n      (close) => {\n        workspace.stop()\n        close()\n      },\n      [workspace]\n    )\n  )\n  const { modal: deleteModal, open: openDeleteModal } = useDeleteWorkspaceModal(\n    workspaceName,\n    useCallback(\n      (force, close) => {\n        workspace.remove(force)\n        close()\n      },\n      [workspace]\n    )\n  )\n  const { modal: rebuildModal, open: openRebuildModal } = useRebuildWorkspaceModal(\n    workspaceName,\n    useCallback(\n      (close) => {\n        const actionID = workspace.rebuild()\n        close()\n        navigateToAction(actionID)\n      },\n      [navigateToAction, workspace]\n    )\n  )\n  const { modal: resetModal, open: openResetModal } = useResetWorkspaceModal(\n    workspaceName,\n    useCallback(\n      (close) => {\n        const actionID = workspace.reset()\n        close()\n        navigateToAction(actionID)\n      },\n      [navigateToAction, workspace]\n    )\n  )\n  const {\n    isOpen: isChangeOptionsOpen,\n    onOpen: handleChangeOptionsClicked,\n    onClose: onChangeOptionsClose,\n  } = useDisclosure()\n  const { store: storeTroubleshoot } = useStoreTroubleshoot()\n\n  const [provider] = useProvider(workspace.data?.provider?.name)\n  const [ideName, setIdeName] = useState<string | undefined>(() => {\n    if (settings.fixedIDE && defaultIDE?.name) {\n      return defaultIDE.name\n    }\n\n    return workspace.data?.ide?.name ?? undefined\n  })\n  const ideDisplayName =\n    ideName !== undefined\n      ? getIDEName({ name: ideName }, ides)\n      : getIDEName(workspace.data?.ide, ides)\n\n  const handleLogsClicked = useCallback(() => {\n    let actionID = workspace.current?.id\n    if (actionID === undefined) {\n      actionID = workspace.checkStatus()\n    }\n\n    navigateToAction(actionID)\n  }, [navigateToAction, workspace])\n\n  const handleTroubleshootClicked = useCallback(() => {\n    if (workspaceActions && workspace.data) {\n      storeTroubleshoot({\n        workspace: workspace.data,\n        workspaceActions: workspaceActions,\n      })\n    }\n  }, [storeTroubleshoot, workspace.data, workspaceActions])\n\n  const hasError = useMemo<boolean>(() => {\n    if (!workspaceActions?.length || workspaceActions[0]?.status !== \"error\") {\n      return false\n    }\n\n    return true\n  }, [workspaceActions])\n\n  const handleBadgeClicked = useCallback(() => {\n    if (workspace.current !== undefined) {\n      navigateToAction(workspace.current.id)\n    }\n\n    if (workspace.data?.status === undefined || workspace.data.status === \"NotFound\") {\n      const actionID = workspace.checkStatus()\n      navigateToAction(actionID)\n    }\n\n    const maybeLastAction = workspaceActions?.[0]\n    if (maybeLastAction) {\n      navigateToAction(maybeLastAction.id)\n    }\n\n    return undefined\n  }, [navigateToAction, workspace, workspaceActions])\n\n  const handleChangeOptionsFinishClicked = (extraProviderOptions: Record<string, string>) => {\n    // diff against current workspace options\n    let changedOptions: Record<string, string> | undefined = undefined\n    if (Object.keys(extraProviderOptions).length > 0) {\n      changedOptions = {}\n      const workspaceOptions = workspace.data?.provider?.options ?? {}\n      for (const [k, v] of Object.entries(extraProviderOptions)) {\n        // check if current workspace option doesn't contain option or it does but value is different\n        if (!workspaceOptions[k] || workspaceOptions[k]?.value !== v) {\n          changedOptions[k] = v\n        }\n      }\n    }\n    const actionID = workspace.start({\n      id: workspaceID,\n      providerConfig: { options: changedOptions },\n    })\n    onChangeOptionsClose()\n    navigateToAction(actionID)\n  }\n\n  const isLoading = workspace.current?.status === \"pending\"\n\n  if (workspace.data === undefined) {\n    return null\n  }\n\n  const maybeRunnerName = getRunnerName(workspace.data, provider)\n  const maybeTemplate = getTemplate(workspace.data, provider)\n  const maybeTemplateOptions = getTemplateOptions(workspace.data, provider)\n\n  return (\n    <>\n      <Card\n        key={workspace.data.id}\n        direction=\"row\"\n        width=\"full\"\n        maxWidth=\"60rem\"\n        variant=\"outline\"\n        marginBottom=\"3\">\n        <CardHeader overflow=\"hidden\" w=\"full\">\n          <WorkspaceCardHeader\n            id={workspace.data.id}\n            source={\n              workspace.data.source && (\n                <Text\n                  fontSize=\"sm\"\n                  color={\"gray.600\"}\n                  _dark={{ color: \"gray.300\" }}\n                  userSelect=\"text\"\n                  maxWidth=\"30rem\"\n                  overflow=\"hidden\"\n                  whiteSpace=\"nowrap\"\n                  textOverflow=\"ellipsis\"\n                  marginTop={-0.5}\n                  _hover={{ overflow: \"visible\", cursor: \"text\" }}>\n                  {getWorkspaceSourceName(workspace.data.source)}\n                </Text>\n              )\n            }\n            isSelected={isSelected}\n            onSelectionChange={onSelectionChange}\n            statusBadge={\n              <WorkspaceStatusBadge\n                status={workspace.data.status}\n                isLoading={isLoading}\n                hasError={hasError}\n                onClick={handleBadgeClicked}\n              />\n            }\n            controls={\n              <WorkspaceControls\n                id={workspace.data.id}\n                workspace={workspace}\n                provider={provider}\n                isLoading={isLoading}\n                isIDEFixed={settings.fixedIDE}\n                ides={ides}\n                ideName={ideName}\n                setIdeName={setIdeName}\n                navigateToAction={navigateToAction}\n                onRebuildClicked={openRebuildModal}\n                onResetClicked={openResetModal}\n                onDeleteClicked={openDeleteModal}\n                onStopClicked={openStopModal}\n                onLogsClicked={handleLogsClicked}\n                onTroubleshootClicked={handleTroubleshootClicked}\n                onChangeOptionsClicked={handleChangeOptionsClicked}\n              />\n            }>\n            <WorkspaceCardHeader.Provider name={workspace.data.provider?.name ?? undefined} />\n            <WorkspaceCardHeader.IDE name={ideDisplayName} />\n            <WorkspaceCardHeader.LastUsed timestamp={workspace.data.lastUsed} />\n            {maybeTemplate && (\n              <IconTag\n                icon={<Template />}\n                label={maybeTemplate}\n                info={\n                  <Box width=\"full\">\n                    Using {maybeTemplate} template with options: <br />\n                    {maybeTemplateOptions.length > 0 ? (\n                      <List mt=\"2\" width=\"full\">\n                        {maybeTemplateOptions.map((opt) => (\n                          <ListItem\n                            key={opt.id}\n                            width=\"full\"\n                            display=\"flex\"\n                            flexFlow=\"row nowrap\"\n                            alignItems=\"space-between\">\n                            <Text fontWeight=\"bold\">{opt.value}</Text>\n                            <Text ml=\"4\">({opt.displayName || opt.id})</Text>\n                          </ListItem>\n                        ))}\n                      </List>\n                    ) : (\n                      \"No options configured\"\n                    )}\n                  </Box>\n                }\n              />\n            )}\n            {maybeRunnerName && (\n              <IconTag\n                icon={<Icon as={HiServerStack} />}\n                label={maybeRunnerName}\n                info={`Running on ${maybeRunnerName}`}\n              />\n            )}\n          </WorkspaceCardHeader>\n        </CardHeader>\n      </Card>\n\n      {resetModal}\n      {rebuildModal}\n      {deleteModal}\n      {stopModal}\n\n      <Modal\n        onClose={onChangeOptionsClose}\n        isOpen={isChangeOptionsOpen}\n        isCentered\n        size=\"4xl\"\n        scrollBehavior=\"inside\">\n        <ModalOverlay />\n        <ModalContent>\n          <ModalHeader>Change Options</ModalHeader>\n          <ModalCloseButton />\n          <ModalBody\n            ref={changeOptionsModalBodyRef}\n            overflowX=\"hidden\"\n            overflowY=\"auto\"\n            paddingBottom=\"0\">\n            {workspace.data.provider?.name ? (\n              <ConfigureProviderOptionsForm\n                workspace={workspace.data}\n                showBottomActionBar\n                isModal\n                submitTitle=\"Update &amp; Open\"\n                containerRef={changeOptionsModalBodyRef}\n                reuseMachine={false}\n                providerID={workspace.data.provider.name}\n                onFinish={handleChangeOptionsFinishClicked}\n              />\n            ) : (\n              <>Unable to find provider for this workspace</>\n            )}\n          </ModalBody>\n        </ModalContent>\n      </Modal>\n    </>\n  )\n}\n\nfunction getRunnerName(workspace: TWorkspace, provider: TProvider | undefined): string | undefined {\n  const options = mergeOptionDefinitions(\n    workspace.provider?.options ?? {},\n    provider?.config?.options ?? {}\n  )\n  const maybeRunnerOption = options[\"LOFT_RUNNER\"]\n  if (!maybeRunnerOption) {\n    return undefined\n  }\n  const value = maybeRunnerOption.value\n\n  return maybeRunnerOption.enum?.find((e) => e.value === value)?.displayName ?? value ?? undefined\n}\n\nfunction getTemplate(workspace: TWorkspace, provider: TProvider | undefined): string | undefined {\n  const options = mergeOptionDefinitions(\n    workspace.provider?.options ?? {},\n    provider?.config?.options ?? {}\n  )\n  const maybeTemplateOption = options[\"LOFT_TEMPLATE\"]\n  if (!maybeTemplateOption) {\n    return undefined\n  }\n  const value = maybeTemplateOption.value\n\n  return maybeTemplateOption.enum?.find((e) => e.value === value)?.displayName ?? value ?? undefined\n}\n\nfunction getTemplateOptions(\n  workspace: TWorkspace,\n  provider: TProvider | undefined\n): readonly TOptionWithID[] {\n  const options = mergeOptionDefinitions(\n    workspace.provider?.options ?? {},\n    provider?.config?.options ?? {}\n  )\n  const displayOptions = processDisplayOptions(options, [], true)\n\n  // shouldn't have groups here as we passed in empty array earlier\n  return [...displayOptions.required, ...displayOptions.other].filter(\n    (opt) => opt.id !== \"LOFT_TEMPLATE\"\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/WorkspaceControls.tsx",
    "content": "import { TWorkspaceResult } from \"@/contexts/DevPodContext/workspaces/useWorkspace\"\nimport { ChevronRightIcon } from \"@chakra-ui/icons\"\nimport {\n  Button,\n  ButtonGroup,\n  HStack,\n  Icon,\n  IconButton,\n  Menu,\n  MenuButton,\n  MenuItem,\n  MenuList,\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n  Portal,\n  Text,\n  Tooltip,\n  useToast,\n} from \"@chakra-ui/react\"\nimport { useMemo, useCallback, useState } from \"react\"\nimport { HiOutlineCode, HiShare } from \"react-icons/hi\"\nimport { client } from \"@/client\"\nimport { IDEGroup, IDEIcon } from \"@/components\"\nimport { TActionID, useProInstances } from \"@/contexts\"\nimport {\n  ArrowCycle,\n  ArrowPath,\n  CommandLine,\n  Cog,\n  Ellipsis,\n  Pause,\n  Play,\n  Stack3D,\n  Trash,\n} from \"@/icons\"\nimport { getIDEDisplayName, useHover } from \"@/lib\"\nimport { TIDE, TIDEs, TProInstance, TProvider, TWorkspace, TWorkspaceID } from \"@/types\"\nimport { useGroupIDEs } from \"@/useIDEs\"\n\ntype TWorkspaceControlsProps = Readonly<{\n  id: TWorkspaceID\n  workspace: TWorkspaceResult<TWorkspace>\n  provider: TProvider | undefined\n  isIDEFixed: boolean\n  isLoading: boolean\n  ides: TIDEs | undefined\n  ideName: TIDE[\"name\"]\n  setIdeName: (ideName: string | undefined) => void\n  navigateToAction: (actionID: TActionID | undefined) => void\n  onRebuildClicked: VoidFunction\n  onResetClicked: VoidFunction\n  onDeleteClicked: VoidFunction\n  onStopClicked: VoidFunction\n  onLogsClicked: VoidFunction\n  onTroubleshootClicked: VoidFunction\n  onChangeOptionsClicked?: VoidFunction\n}>\nexport function WorkspaceControls({\n  id,\n  workspace,\n  isLoading,\n  ides,\n  ideName,\n  isIDEFixed,\n  provider,\n  setIdeName,\n  navigateToAction,\n  onRebuildClicked,\n  onResetClicked,\n  onDeleteClicked,\n  onStopClicked,\n  onLogsClicked,\n  onTroubleshootClicked,\n  onChangeOptionsClicked,\n}: TWorkspaceControlsProps) {\n  const [[proInstances]] = useProInstances()\n  const proInstance = useMemo<TProInstance | undefined>(() => {\n    if (!provider?.isProxyProvider) {\n      return undefined\n    }\n\n    return proInstances?.find((instance) => instance.provider === provider.config?.name)\n  }, [proInstances, provider?.config?.name, provider?.isProxyProvider])\n  const { isEnabled: isShareEnabled, onClick: handleShareClicked } = useShareWorkspace(\n    workspace.data,\n    proInstance\n  )\n\n  const handleOpenWithIDEClicked = useCallback(\n    (id: TWorkspaceID, ide: TIDE[\"name\"]) => async () => {\n      if (!ide) {\n        return\n      }\n      setIdeName(ide)\n\n      const actionID = workspace.start({ id, ideConfig: { name: ide } })\n      if (!isIDEFixed) {\n        await client.ides.useIDE(ide)\n      }\n      navigateToAction(actionID)\n    },\n    [isIDEFixed, setIdeName, workspace, navigateToAction]\n  )\n\n  const onIDESelected = useCallback(\n    (selectedIDE: TIDE[\"name\"]) => {\n      handleOpenWithIDEClicked(id, selectedIDE)()\n    },\n    [id, handleOpenWithIDEClicked]\n  )\n\n  const isOpenDisabled = workspace.data?.status === \"Busy\"\n  const isOpenDisabledReason =\n    \"Cannot open this workspace because it is busy. If this doesn't change, try to force delete and recreate it.\"\n  const [isStartWithHovering, startWithRef] = useHover()\n  const [isPopoverHovering, popoverContentRef] = useHover()\n\n  const [ideGroupHoverState, setIdeGroupHoverState] = useState<{ [key: string]: boolean }>({})\n\n  const setIdeGroupHovered = useCallback(\n    (group: string, hovered: boolean) => {\n      setIdeGroupHoverState((old) => ({ ...old, [group]: hovered }))\n    },\n    [setIdeGroupHoverState]\n  )\n\n  const ideGroupHovered = useMemo(() => {\n    return Object.values(ideGroupHoverState).includes(true)\n  }, [ideGroupHoverState])\n\n  const isChangeOptionsEnabled =\n    workspace.data?.provider?.options != null && proInstance !== undefined\n\n  const groupedIDEs = useGroupIDEs(ides)\n\n  return (\n    <HStack spacing=\"2\" width=\"full\" justifyContent=\"end\">\n      <ButtonGroup isAttached variant=\"solid-outline\">\n        <Tooltip label={isOpenDisabled ? isOpenDisabledReason : undefined}>\n          <Button\n            aria-label=\"Start workspace\"\n            leftIcon={<Icon as={HiOutlineCode} boxSize={5} />}\n            isDisabled={isOpenDisabled}\n            onClick={() => {\n              const actionID = workspace.start({\n                id,\n                ideConfig: { name: ideName ?? ideName ?? null },\n              })\n              navigateToAction(actionID)\n            }}\n            isLoading={isLoading}>\n            Open\n          </Button>\n        </Tooltip>\n        <Menu placement=\"top\">\n          <MenuButton\n            as={IconButton}\n            aria-label=\"More actions\"\n            colorScheme=\"gray\"\n            icon={<Ellipsis transform={\"rotate(90deg)\"} boxSize={5} />}\n          />\n          <Portal>\n            <MenuList>\n              <Popover\n                isOpen={isStartWithHovering || isPopoverHovering || ideGroupHovered}\n                placement=\"right\"\n                offset={[100, 0]}>\n                <PopoverTrigger>\n                  <MenuItem\n                    ref={startWithRef}\n                    icon={<Play boxSize={4} />}\n                    isDisabled={isOpenDisabled || isLoading}>\n                    <HStack width=\"full\" justifyContent=\"space-between\">\n                      <Text>Start with</Text>\n                      <ChevronRightIcon boxSize={4} />\n                    </HStack>\n                  </MenuItem>\n                </PopoverTrigger>\n                <Portal>\n                  <PopoverContent zIndex=\"popover\" width=\"fit-content\" ref={popoverContentRef}>\n                    {groupedIDEs?.primary.map((ide) => (\n                      <MenuItem\n                        isDisabled={isOpenDisabled || isLoading}\n                        onClick={handleOpenWithIDEClicked(id, ide.name)}\n                        key={ide.name}\n                        value={ide.name!}\n                        icon={<IDEIcon ide={ide} width={6} height={6} size=\"sm\" />}>\n                        {getIDEDisplayName(ide)}\n                      </MenuItem>\n                    ))}\n                    {groupedIDEs?.subMenuGroups.map((group) => (\n                      <IDEGroup\n                        key={group}\n                        ides={groupedIDEs.subMenus[group]}\n                        group={group}\n                        onHoverChange={setIdeGroupHovered}\n                        disabled={isOpenDisabled || isLoading}\n                        onItemClick={onIDESelected}\n                      />\n                    ))}\n                  </PopoverContent>\n                </Portal>\n              </Popover>\n              <MenuItem\n                isDisabled={workspace.data?.status !== \"Running\"}\n                onClick={() => {\n                  if (workspace.data?.status !== \"Running\") {\n                    onStopClicked()\n\n                    return\n                  }\n\n                  workspace.stop()\n                }}\n                icon={<Pause boxSize={4} />}>\n                Stop\n              </MenuItem>\n              <MenuItem\n                icon={<ArrowPath boxSize={4} />}\n                onClick={onRebuildClicked}\n                isDisabled={isOpenDisabled || isLoading}>\n                Rebuild\n              </MenuItem>\n              <MenuItem\n                icon={<ArrowCycle boxSize={4} />}\n                onClick={onResetClicked}\n                isDisabled={isOpenDisabled || isLoading}>\n                Reset\n              </MenuItem>\n              {isChangeOptionsEnabled && (\n                <MenuItem\n                  icon={<Stack3D boxSize={4} />}\n                  onClick={onChangeOptionsClicked}\n                  isDisabled={isOpenDisabled || isLoading}>\n                  Change Options\n                </MenuItem>\n              )}\n              {isShareEnabled && (\n                <MenuItem icon={<Icon as={HiShare} boxSize={4} />} onClick={handleShareClicked}>\n                  Share\n                </MenuItem>\n              )}\n              <MenuItem\n                fontWeight=\"normal\"\n                icon={<CommandLine boxSize={4} />}\n                onClick={onLogsClicked}>\n                Logs\n              </MenuItem>\n              <MenuItem\n                fontWeight=\"normal\"\n                icon={<Cog boxSize={4} />}\n                onClick={onTroubleshootClicked}>\n                Troubleshoot\n              </MenuItem>\n              <MenuItem\n                isDisabled={isOpenDisabled || isLoading}\n                fontWeight=\"normal\"\n                icon={<Trash boxSize={4} />}\n                onClick={onDeleteClicked}>\n                Delete\n              </MenuItem>\n            </MenuList>\n          </Portal>\n        </Menu>\n      </ButtonGroup>\n    </HStack>\n  )\n}\n\nfunction useShareWorkspace(\n  workspace: TWorkspace | undefined,\n  proInstance: TProInstance | undefined\n) {\n  const toast = useToast()\n\n  const handleShareClicked = useCallback(async () => {\n    const devpodProHost = proInstance?.host\n    const workspace_id = workspace?.id\n    const workspace_uid = workspace?.uid\n    if (!devpodProHost || !workspace_id || !workspace_uid) {\n      return\n    }\n\n    const searchParams = new URLSearchParams()\n    searchParams.set(\"workspace-uid\", workspace_uid)\n    searchParams.set(\"workspace-id\", workspace_id)\n    searchParams.set(\"devpod-pro-host\", devpodProHost)\n\n    const link = `https://devpod.sh/import#${searchParams.toString()}`\n    const res = await client.writeToClipboard(link)\n    if (!res.ok) {\n      toast({\n        title: \"Failed to share workspace\",\n        description: res.val.message,\n        status: \"error\",\n        duration: 5_000,\n        isClosable: true,\n      })\n\n      return\n    }\n\n    toast({\n      title: \"Copied workspace link to clipboard\",\n      status: \"success\",\n      duration: 5_000,\n      isClosable: true,\n    })\n  }, [proInstance?.host, toast, workspace?.id, workspace?.uid])\n\n  return {\n    isEnabled: workspace !== undefined && proInstance !== undefined,\n    onClick: handleShareClicked,\n  }\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/WorkspaceStatusBadge.tsx",
    "content": "import React from \"react\"\nimport { Ripple } from \"@/components\"\nimport { TWorkspace } from \"@/types\"\nimport { Box, BoxProps, HStack, IconProps, Text, TextProps } from \"@chakra-ui/react\"\nimport { useMemo } from \"react\"\n\ntype TWorkspaceStatusBadgeProps = Readonly<{\n  status: TWorkspace[\"status\"]\n  isLoading: boolean\n  hasError: boolean\n  showText?: boolean\n  onClick?: () => void\n}>\nexport function WorkspaceStatusBadge({\n  onClick,\n  status,\n  hasError,\n  isLoading,\n  showText = true,\n}: TWorkspaceStatusBadgeProps) {\n  const badge = useMemo(() => {\n    const sharedProps: BoxProps = {\n      as: \"span\",\n      borderRadius: \"full\",\n      width: \"12px\",\n      height: \"12px\",\n      borderWidth: \"2px\",\n      zIndex: \"1\",\n    }\n    const sharedTextProps: TextProps = {\n      fontWeight: \"medium\",\n      fontSize: \"12px\",\n    }\n    const rippleProps: IconProps = {\n      boxSize: 8,\n      position: \"absolute\",\n      left: \"-8px\",\n      zIndex: \"0\",\n    }\n\n    if (hasError || status === \"NotFound\") {\n      return (\n        <>\n          <Box {...sharedProps} backgroundColor=\"white\" borderColor=\"red.400\" />\n          {showText && (\n            <Text {...sharedTextProps} color=\"red.400\">\n              Error\n            </Text>\n          )}\n        </>\n      )\n    }\n\n    if (isLoading) {\n      return (\n        <>\n          <Box {...sharedProps} backgroundColor=\"white\" borderColor=\"yellow.500\" />\n          <Ripple {...rippleProps} color=\"yellow.500\" />\n          {showText && (\n            <Text {...sharedTextProps} color=\"yellow.500\">\n              Loading\n            </Text>\n          )}\n        </>\n      )\n    }\n\n    if (status === \"Running\") {\n      return (\n        <>\n          <Box {...sharedProps} backgroundColor=\"green.200\" borderColor=\"green.400\" />\n          {showText && (\n            <Text {...sharedTextProps} color=\"green.400\">\n              Running\n            </Text>\n          )}\n        </>\n      )\n    }\n\n    return (\n      <>\n        <Box {...sharedProps} backgroundColor=\"purple.200\" borderColor=\"purple.400\" zIndex=\"1\" />\n        {showText && (\n          <Text {...sharedTextProps} color=\"purple.400\">\n            {status ?? \"Unknown\"}\n          </Text>\n        )}\n      </>\n    )\n  }, [hasError, isLoading, showText, status])\n\n  return (\n    <HStack\n      cursor={onClick ? \"pointer\" : \"default\"}\n      onClick={onClick}\n      spacing=\"1\"\n      position=\"relative\">\n      {badge}\n    </HStack>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/Workspaces.tsx",
    "content": "import { Box } from \"@chakra-ui/react\"\nimport { Outlet } from \"react-router\"\nimport { NavigationViewLayout } from \"../../components\"\nimport { useWorkspaceTitle } from \"./useWorkspaceTitle\"\n\nexport function Workspaces() {\n  const title = useWorkspaceTitle()\n\n  return (\n    <NavigationViewLayout title={title}>\n      <Box>\n        <Outlet />\n      </Box>\n    </NavigationViewLayout>\n  )\n}\n"
  },
  {
    "path": "desktop/src/views/Workspaces/index.ts",
    "content": "export { CreateWorkspace } from \"./CreateWorkspace\"\nexport { ListWorkspaces } from \"./ListWorkspaces\"\nexport { Workspaces } from \"./Workspaces\"\n"
  },
  {
    "path": "desktop/src/views/Workspaces/useWorkspaceTitle.tsx",
    "content": "import { Button, IconButton } from \"@chakra-ui/react\"\nimport { useCallback, useMemo } from \"react\"\nimport { useMatch, useNavigate } from \"react-router\"\nimport { TViewTitle } from \"../../components\"\nimport { ArrowLeft, Plus } from \"../../icons\"\nimport { exists } from \"../../lib\"\nimport { Routes } from \"../../routes\"\n\nexport function useWorkspaceTitle(): TViewTitle | null {\n  const navigate = useNavigate()\n\n  const matchWorkspacesRoot = useMatch(Routes.WORKSPACES)\n  const matchCreateWorkspace = useMatch(Routes.WORKSPACE_CREATE)\n\n  const navigateToWorkspacesRoot = useCallback(() => {\n    navigate(Routes.WORKSPACES)\n  }, [navigate])\n\n  const navigateBackAction = useMemo(() => {\n    return (\n      <IconButton\n        variant=\"ghost\"\n        aria-label=\"Navigate back to Workspaces\"\n        icon={<ArrowLeft />}\n        onClick={navigateToWorkspacesRoot}\n      />\n    )\n  }, [navigateToWorkspacesRoot])\n\n  return useMemo<TViewTitle | null>(() => {\n    if (exists(matchWorkspacesRoot)) {\n      return {\n        label: \"Workspaces\",\n        priority: \"high\",\n        trailingAction: (\n          <Button\n            size=\"sm\"\n            variant=\"outline\"\n            aria-label=\"Create new workspace\"\n            leftIcon={<Plus boxSize={5} />}\n            onClick={() => navigate(Routes.WORKSPACE_CREATE)}>\n            Create\n          </Button>\n        ),\n      }\n    }\n\n    if (exists(matchCreateWorkspace)) {\n      return {\n        label: \"Create Workspace\",\n        priority: \"regular\",\n        leadingAction: navigateBackAction,\n      }\n    }\n\n    return null\n  }, [matchCreateWorkspace, matchWorkspacesRoot, navigate, navigateBackAction])\n}\n"
  },
  {
    "path": "desktop/src/views/index.ts",
    "content": "export * as Actions from \"./Actions\"\nexport * as Providers from \"./Providers\"\nexport * as Settings from \"./Settings\"\nexport * as Workspaces from \"./Workspaces\"\nexport * as Pro from \"./Pro\"\n"
  },
  {
    "path": "desktop/src/vite-env.d.ts",
    "content": "/// <reference types=\"vite/client\" />\ndeclare const process: {\n  env: {\n    TAURI_ENV_DEBUG: boolean\n    TAURI_ENV_PLATFORM: string\n  }\n}\n"
  },
  {
    "path": "desktop/src-tauri/.gitignore",
    "content": "# Generated by Cargo\n# will have compiled files and executables\n/target/\n.DS_Store\n\n"
  },
  {
    "path": "desktop/src-tauri/Cargo.toml",
    "content": "[package]\nname = \"devpod-desktop\"\nversion = \"0.1.0\"\ndescription = \"A Tauri App\"\nauthors = [\"loft.sh\"]\nlicense = \"\"\nrepository = \"\"\nedition = \"2021\"\n\n[build-dependencies]\ntauri-build = { version = \"2.1.0\", features = [] }\n\n[dependencies]\n# Tauri\ntauri = { version = \"2.4.0\", features = [\n        \"macos-private-api\",\n        \"image-ico\",\n        \"image-png\",\n        \"tray-icon\",\n] }\n# Serde\nserde_json = \"1.0\"\nserde = { version = \"1.0\", features = [\"derive\"] }\nserde_qs = \"0.12.0\"\nserde_yaml = \"0.9.21\"\nserde_urlencoded = \"0.7.1\"\n\n# Tauri plugins\ntauri-plugin-deep-link = { version = \"0.1.0\" }\ntauri-plugin-store = { version = \"2.1.0\" }\ntauri-plugin-dialog = \"2\"\ntauri-plugin-shell = \"2\"\ntauri-plugin-clipboard-manager = \"2\"\ntauri-plugin-fs = \"2\"\ntauri-plugin-os = \"2\"\ntauri-plugin-process = \"2\"\ntauri-plugin-updater = \"2\"\ntauri-plugin-notification = \"2\"\ntauri-plugin-single-instance = \"2\"\n\n# Logging\nlog = { version = \"0.4\" }\ntauri-plugin-log = { version = \"2\" }\n# Datetime\nchrono = { version = \"0.4.23\", features = [\"serde\"] }\n\ntokio = { version = \"1.26.0\", features = [\n        \"time\",\n        \"parking_lot\",\n        \"sync\",\n        \"net\",\n] }\nthiserror = \"1.0.38\"\nregex = \"1.7.1\"\nlazy_static = \"1.4.0\"\nurl = \"2.3.1\"\nanyhow = \"1.0.70\"\ndirs = \"5.0.1\"\nreqwest = { version = \"0.12.12\", features = [\"json\"] }\ndispatch = \"0.2.0\"\nts-rs = { version = \"6.2.1\", features = [\"serde-compat\", \"chrono-impl\"] }\nsemver = \"1.0.18\"\nstrip-ansi-escapes = \"0.1.1\"\naxum = { version = \"0.7.1\", features = [\"ws\"] }\ntower-http = { version = \"0.5.1\", features = [\"cors\"] }\nhttp = \"1.0.0\"\nnix = { version = \"0.29.0\", features = [\"signal\"] }\ninterprocess = \"1.2.1\"\nhyper = { version = \"1.6.0\", features = [\"client\", \"http1\"] }\npin-project-lite = \"0.2.16\"\nbytes = \"1.10.0\"\nhttp-body-util = \"0.1.2\"\n\n[patch.crates-io]\n\n# Change to version if this is released: https://github.com/hoodie/notify-rust/pull/244\nnotify-rust = { git = \"https://github.com/hoodie/notify-rust.git\", branch = \"main\" }\n\n[target.'cfg(target_os = \"windows\")'.dependencies]\nwinreg = \"0.50.0\"\nwindows = { version = \"0.48\", features = [\n        \"Win32_Foundation\",\n        \"Win32_UI_WindowsAndMessaging\",\n        \"Win32_System\",\n        \"Win32_System_Diagnostics\",\n        \"Win32_System_Diagnostics_ToolHelp\",\n        \"Win32_System_Threading\",\n] }\n\n[target.'cfg(target_os = \"macos\")'.dependencies]\nwindow-vibrancy = \"0.5.2\"\ncocoa = \"0.24\"\nobjc = \"0.2\"\n\n[features]\n# by default Tauri runs in production mode\n# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL\ndefault = [\"custom-protocol\"]\n# this feature is used used for production builds where `devPath` points to the filesystem\n# DO NOT remove this\ncustom-protocol = [\"tauri/custom-protocol\"]\n"
  },
  {
    "path": "desktop/src-tauri/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Viewer</string>\n\t\t\t<key>CFBundleURLName</key>\n\t\t\t<string>sh.loft.devpod</string>\n\t\t\t<key>LSUIElement</key>\n\t\t\t<true/>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n\t\t\t\t<string>devpod</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "desktop/src-tauri/bin/.gitkeep",
    "content": ""
  },
  {
    "path": "desktop/src-tauri/build.rs",
    "content": "fn main() {\n    tauri_build::build();\n}\n"
  },
  {
    "path": "desktop/src-tauri/capabilities/migrated.json",
    "content": "{\n  \"identifier\": \"main\",\n  \"description\": \"Main capabilities\",\n  \"local\": true,\n  \"windows\": [\n    \"main\"\n  ],\n  \"permissions\": [\n    \"core:default\",\n    \"process:allow-exit\",\n    \"process:allow-restart\",\n    \"os:default\",\n    \"shell:allow-open\",\n    \"shell:allow-kill\",\n    \"shell:allow-spawn\",\n    {\n      \"identifier\": \"shell:allow-execute\",\n      \"allow\": [\n        {\n          \"name\": \"bin/devpod-cli\",\n          \"sidecar\": true,\n          \"args\": true\n        },\n        {\n          \"name\": \"bin/devpod-cli\",\n          \"cmd\": \"/app/bin/devpod-cli\",\n          \"args\": true\n        },\n        {\n          \"name\": \"run-path-devpod-cli\",\n          \"cmd\": \"devpod\",\n          \"args\": [\n            \"version\"\n          ]\n        }\n      ]\n    },\n    {\n      \"identifier\": \"shell:allow-spawn\",\n      \"allow\": [\n        {\n          \"name\": \"bin/devpod-cli\",\n          \"sidecar\": true,\n          \"args\": true\n        }\n      ]\n    },\n    {\n      \"identifier\": \"shell:allow-kill\",\n      \"allow\": [\n        {\n          \"name\": \"bin/devpod-cli\",\n          \"sidecar\": true,\n          \"args\": true\n        }\n      ]\n    },\n    \"fs:default\",\n    \"fs:allow-app-read-recursive\",\n    \"fs:allow-app-write-recursive\",\n    \"fs:allow-app-meta-recursive\",\n    \"fs:allow-appdata-write-recursive\",\n    \"fs:allow-appdata-read-recursive\",\n    \"fs:allow-home-read-recursive\",\n    \"fs:allow-home-write-recursive\",\n    \"fs:allow-home-meta-recursive\",\n    \"clipboard-manager:allow-write-text\",\n    \"updater:default\",\n    \"core:window:default\",\n    \"core:window:allow-start-dragging\",\n    \"core:window:allow-close\",\n    \"core:window:allow-set-focus\",\n    \"core:window:allow-unminimize\",\n    \"notification:default\",\n    \"store:allow-load\",\n    \"store:default\",\n    \"dialog:allow-save\",\n    \"dialog:default\",\n    \"log:default\",\n    \"log:allow-log\"\n  ]\n}\n"
  },
  {
    "path": "desktop/src-tauri/capabilities/updater.json",
    "content": "{\n  \"identifier\": \"updater\",\n  \"description\": \"Updater Capabilities\",\n  \"local\": true,\n  \"windows\": [\n    \"update_ready\"\n  ],\n  \"permissions\": [\n    \"core:default\",\n    \"process:allow-exit\",\n    \"process:allow-restart\",\n    \"core:window:default\",\n    \"core:window:allow-close\",\n    \"os:default\"\n  ]\n}\n"
  },
  {
    "path": "desktop/src-tauri/entitlements.plist",
    "content": "<!--?xml version=\"1.0\" encoding=\"UTF-8\"?-->\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n    <dict>\n        <key>com.apple.security.cs.allow-unsigned-executable-memory</key>\n        <true/>\n        <key>com.apple.security.cs.allow-jit</key>\n        <true/>\n        <key>com.apple.security.cs.disable-library-validation</key>\n        <true/>\n        <key>com.apple.security.hypervisor</key>\n        <true/>\n        <key>com.apple.security.virtualization</key>\n        <true/>\n    </dict>\n</plist>\n"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/acl-manifests.json",
    "content": "{\"clipboard-manager\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"No features are enabled by default, as we believe\\nthe clipboard can be inherently dangerous and it is \\napplication specific if read and/or write access is needed.\\n\\nClipboard interaction needs to be explicitly enabled.\\n\",\"permissions\":[]},\"permissions\":{\"allow-clear\":{\"identifier\":\"allow-clear\",\"description\":\"Enables the clear command without any pre-configured scope.\",\"commands\":{\"allow\":[\"clear\"],\"deny\":[]}},\"allow-read-image\":{\"identifier\":\"allow-read-image\",\"description\":\"Enables the read_image command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_image\"],\"deny\":[]}},\"allow-read-text\":{\"identifier\":\"allow-read-text\",\"description\":\"Enables the read_text command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_text\"],\"deny\":[]}},\"allow-write-html\":{\"identifier\":\"allow-write-html\",\"description\":\"Enables the write_html command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write_html\"],\"deny\":[]}},\"allow-write-image\":{\"identifier\":\"allow-write-image\",\"description\":\"Enables the write_image command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write_image\"],\"deny\":[]}},\"allow-write-text\":{\"identifier\":\"allow-write-text\",\"description\":\"Enables the write_text command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write_text\"],\"deny\":[]}},\"deny-clear\":{\"identifier\":\"deny-clear\",\"description\":\"Denies the clear command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"clear\"]}},\"deny-read-image\":{\"identifier\":\"deny-read-image\",\"description\":\"Denies the read_image command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_image\"]}},\"deny-read-text\":{\"identifier\":\"deny-read-text\",\"description\":\"Denies the read_text command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_text\"]}},\"deny-write-html\":{\"identifier\":\"deny-write-html\",\"description\":\"Denies the write_html command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write_html\"]}},\"deny-write-image\":{\"identifier\":\"deny-write-image\",\"description\":\"Denies the write_image command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write_image\"]}},\"deny-write-text\":{\"identifier\":\"deny-write-text\",\"description\":\"Denies the write_text command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write_text\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default core plugins set which includes:\\n- 'core:path:default'\\n- 'core:event:default'\\n- 'core:window:default'\\n- 'core:webview:default'\\n- 'core:app:default'\\n- 'core:image:default'\\n- 'core:resources:default'\\n- 'core:menu:default'\\n- 'core:tray:default'\\n\",\"permissions\":[\"core:path:default\",\"core:event:default\",\"core:window:default\",\"core:webview:default\",\"core:app:default\",\"core:image:default\",\"core:resources:default\",\"core:menu:default\",\"core:tray:default\"]},\"permissions\":{},\"permission_sets\":{},\"global_scope_schema\":null},\"core:app\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-version\",\"allow-name\",\"allow-tauri-version\",\"allow-identifier\"]},\"permissions\":{\"allow-app-hide\":{\"identifier\":\"allow-app-hide\",\"description\":\"Enables the app_hide command without any pre-configured scope.\",\"commands\":{\"allow\":[\"app_hide\"],\"deny\":[]}},\"allow-app-show\":{\"identifier\":\"allow-app-show\",\"description\":\"Enables the app_show command without any pre-configured scope.\",\"commands\":{\"allow\":[\"app_show\"],\"deny\":[]}},\"allow-default-window-icon\":{\"identifier\":\"allow-default-window-icon\",\"description\":\"Enables the default_window_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"default_window_icon\"],\"deny\":[]}},\"allow-fetch-data-store-identifiers\":{\"identifier\":\"allow-fetch-data-store-identifiers\",\"description\":\"Enables the fetch_data_store_identifiers command without any pre-configured scope.\",\"commands\":{\"allow\":[\"fetch_data_store_identifiers\"],\"deny\":[]}},\"allow-identifier\":{\"identifier\":\"allow-identifier\",\"description\":\"Enables the identifier command without any pre-configured scope.\",\"commands\":{\"allow\":[\"identifier\"],\"deny\":[]}},\"allow-name\":{\"identifier\":\"allow-name\",\"description\":\"Enables the name command without any pre-configured scope.\",\"commands\":{\"allow\":[\"name\"],\"deny\":[]}},\"allow-remove-data-store\":{\"identifier\":\"allow-remove-data-store\",\"description\":\"Enables the remove_data_store command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove_data_store\"],\"deny\":[]}},\"allow-set-app-theme\":{\"identifier\":\"allow-set-app-theme\",\"description\":\"Enables the set_app_theme command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_app_theme\"],\"deny\":[]}},\"allow-tauri-version\":{\"identifier\":\"allow-tauri-version\",\"description\":\"Enables the tauri_version command without any pre-configured scope.\",\"commands\":{\"allow\":[\"tauri_version\"],\"deny\":[]}},\"allow-version\":{\"identifier\":\"allow-version\",\"description\":\"Enables the version command without any pre-configured scope.\",\"commands\":{\"allow\":[\"version\"],\"deny\":[]}},\"deny-app-hide\":{\"identifier\":\"deny-app-hide\",\"description\":\"Denies the app_hide command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"app_hide\"]}},\"deny-app-show\":{\"identifier\":\"deny-app-show\",\"description\":\"Denies the app_show command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"app_show\"]}},\"deny-default-window-icon\":{\"identifier\":\"deny-default-window-icon\",\"description\":\"Denies the default_window_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"default_window_icon\"]}},\"deny-fetch-data-store-identifiers\":{\"identifier\":\"deny-fetch-data-store-identifiers\",\"description\":\"Denies the fetch_data_store_identifiers command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"fetch_data_store_identifiers\"]}},\"deny-identifier\":{\"identifier\":\"deny-identifier\",\"description\":\"Denies the identifier command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"identifier\"]}},\"deny-name\":{\"identifier\":\"deny-name\",\"description\":\"Denies the name command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"name\"]}},\"deny-remove-data-store\":{\"identifier\":\"deny-remove-data-store\",\"description\":\"Denies the remove_data_store command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove_data_store\"]}},\"deny-set-app-theme\":{\"identifier\":\"deny-set-app-theme\",\"description\":\"Denies the set_app_theme command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_app_theme\"]}},\"deny-tauri-version\":{\"identifier\":\"deny-tauri-version\",\"description\":\"Denies the tauri_version command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"tauri_version\"]}},\"deny-version\":{\"identifier\":\"deny-version\",\"description\":\"Denies the version command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"version\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:event\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-listen\",\"allow-unlisten\",\"allow-emit\",\"allow-emit-to\"]},\"permissions\":{\"allow-emit\":{\"identifier\":\"allow-emit\",\"description\":\"Enables the emit command without any pre-configured scope.\",\"commands\":{\"allow\":[\"emit\"],\"deny\":[]}},\"allow-emit-to\":{\"identifier\":\"allow-emit-to\",\"description\":\"Enables the emit_to command without any pre-configured scope.\",\"commands\":{\"allow\":[\"emit_to\"],\"deny\":[]}},\"allow-listen\":{\"identifier\":\"allow-listen\",\"description\":\"Enables the listen command without any pre-configured scope.\",\"commands\":{\"allow\":[\"listen\"],\"deny\":[]}},\"allow-unlisten\":{\"identifier\":\"allow-unlisten\",\"description\":\"Enables the unlisten command without any pre-configured scope.\",\"commands\":{\"allow\":[\"unlisten\"],\"deny\":[]}},\"deny-emit\":{\"identifier\":\"deny-emit\",\"description\":\"Denies the emit command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"emit\"]}},\"deny-emit-to\":{\"identifier\":\"deny-emit-to\",\"description\":\"Denies the emit_to command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"emit_to\"]}},\"deny-listen\":{\"identifier\":\"deny-listen\",\"description\":\"Denies the listen command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"listen\"]}},\"deny-unlisten\":{\"identifier\":\"deny-unlisten\",\"description\":\"Denies the unlisten command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"unlisten\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:image\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-new\",\"allow-from-bytes\",\"allow-from-path\",\"allow-rgba\",\"allow-size\"]},\"permissions\":{\"allow-from-bytes\":{\"identifier\":\"allow-from-bytes\",\"description\":\"Enables the from_bytes command without any pre-configured scope.\",\"commands\":{\"allow\":[\"from_bytes\"],\"deny\":[]}},\"allow-from-path\":{\"identifier\":\"allow-from-path\",\"description\":\"Enables the from_path command without any pre-configured scope.\",\"commands\":{\"allow\":[\"from_path\"],\"deny\":[]}},\"allow-new\":{\"identifier\":\"allow-new\",\"description\":\"Enables the new command without any pre-configured scope.\",\"commands\":{\"allow\":[\"new\"],\"deny\":[]}},\"allow-rgba\":{\"identifier\":\"allow-rgba\",\"description\":\"Enables the rgba command without any pre-configured scope.\",\"commands\":{\"allow\":[\"rgba\"],\"deny\":[]}},\"allow-size\":{\"identifier\":\"allow-size\",\"description\":\"Enables the size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"size\"],\"deny\":[]}},\"deny-from-bytes\":{\"identifier\":\"deny-from-bytes\",\"description\":\"Denies the from_bytes command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"from_bytes\"]}},\"deny-from-path\":{\"identifier\":\"deny-from-path\",\"description\":\"Denies the from_path command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"from_path\"]}},\"deny-new\":{\"identifier\":\"deny-new\",\"description\":\"Denies the new command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"new\"]}},\"deny-rgba\":{\"identifier\":\"deny-rgba\",\"description\":\"Denies the rgba command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"rgba\"]}},\"deny-size\":{\"identifier\":\"deny-size\",\"description\":\"Denies the size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"size\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:menu\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-new\",\"allow-append\",\"allow-prepend\",\"allow-insert\",\"allow-remove\",\"allow-remove-at\",\"allow-items\",\"allow-get\",\"allow-popup\",\"allow-create-default\",\"allow-set-as-app-menu\",\"allow-set-as-window-menu\",\"allow-text\",\"allow-set-text\",\"allow-is-enabled\",\"allow-set-enabled\",\"allow-set-accelerator\",\"allow-set-as-windows-menu-for-nsapp\",\"allow-set-as-help-menu-for-nsapp\",\"allow-is-checked\",\"allow-set-checked\",\"allow-set-icon\"]},\"permissions\":{\"allow-append\":{\"identifier\":\"allow-append\",\"description\":\"Enables the append command without any pre-configured scope.\",\"commands\":{\"allow\":[\"append\"],\"deny\":[]}},\"allow-create-default\":{\"identifier\":\"allow-create-default\",\"description\":\"Enables the create_default command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create_default\"],\"deny\":[]}},\"allow-get\":{\"identifier\":\"allow-get\",\"description\":\"Enables the get command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get\"],\"deny\":[]}},\"allow-insert\":{\"identifier\":\"allow-insert\",\"description\":\"Enables the insert command without any pre-configured scope.\",\"commands\":{\"allow\":[\"insert\"],\"deny\":[]}},\"allow-is-checked\":{\"identifier\":\"allow-is-checked\",\"description\":\"Enables the is_checked command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_checked\"],\"deny\":[]}},\"allow-is-enabled\":{\"identifier\":\"allow-is-enabled\",\"description\":\"Enables the is_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_enabled\"],\"deny\":[]}},\"allow-items\":{\"identifier\":\"allow-items\",\"description\":\"Enables the items command without any pre-configured scope.\",\"commands\":{\"allow\":[\"items\"],\"deny\":[]}},\"allow-new\":{\"identifier\":\"allow-new\",\"description\":\"Enables the new command without any pre-configured scope.\",\"commands\":{\"allow\":[\"new\"],\"deny\":[]}},\"allow-popup\":{\"identifier\":\"allow-popup\",\"description\":\"Enables the popup command without any pre-configured scope.\",\"commands\":{\"allow\":[\"popup\"],\"deny\":[]}},\"allow-prepend\":{\"identifier\":\"allow-prepend\",\"description\":\"Enables the prepend command without any pre-configured scope.\",\"commands\":{\"allow\":[\"prepend\"],\"deny\":[]}},\"allow-remove\":{\"identifier\":\"allow-remove\",\"description\":\"Enables the remove command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove\"],\"deny\":[]}},\"allow-remove-at\":{\"identifier\":\"allow-remove-at\",\"description\":\"Enables the remove_at command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove_at\"],\"deny\":[]}},\"allow-set-accelerator\":{\"identifier\":\"allow-set-accelerator\",\"description\":\"Enables the set_accelerator command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_accelerator\"],\"deny\":[]}},\"allow-set-as-app-menu\":{\"identifier\":\"allow-set-as-app-menu\",\"description\":\"Enables the set_as_app_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_as_app_menu\"],\"deny\":[]}},\"allow-set-as-help-menu-for-nsapp\":{\"identifier\":\"allow-set-as-help-menu-for-nsapp\",\"description\":\"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_as_help_menu_for_nsapp\"],\"deny\":[]}},\"allow-set-as-window-menu\":{\"identifier\":\"allow-set-as-window-menu\",\"description\":\"Enables the set_as_window_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_as_window_menu\"],\"deny\":[]}},\"allow-set-as-windows-menu-for-nsapp\":{\"identifier\":\"allow-set-as-windows-menu-for-nsapp\",\"description\":\"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_as_windows_menu_for_nsapp\"],\"deny\":[]}},\"allow-set-checked\":{\"identifier\":\"allow-set-checked\",\"description\":\"Enables the set_checked command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_checked\"],\"deny\":[]}},\"allow-set-enabled\":{\"identifier\":\"allow-set-enabled\",\"description\":\"Enables the set_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_enabled\"],\"deny\":[]}},\"allow-set-icon\":{\"identifier\":\"allow-set-icon\",\"description\":\"Enables the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_icon\"],\"deny\":[]}},\"allow-set-text\":{\"identifier\":\"allow-set-text\",\"description\":\"Enables the set_text command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_text\"],\"deny\":[]}},\"allow-text\":{\"identifier\":\"allow-text\",\"description\":\"Enables the text command without any pre-configured scope.\",\"commands\":{\"allow\":[\"text\"],\"deny\":[]}},\"deny-append\":{\"identifier\":\"deny-append\",\"description\":\"Denies the append command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"append\"]}},\"deny-create-default\":{\"identifier\":\"deny-create-default\",\"description\":\"Denies the create_default command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create_default\"]}},\"deny-get\":{\"identifier\":\"deny-get\",\"description\":\"Denies the get command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get\"]}},\"deny-insert\":{\"identifier\":\"deny-insert\",\"description\":\"Denies the insert command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"insert\"]}},\"deny-is-checked\":{\"identifier\":\"deny-is-checked\",\"description\":\"Denies the is_checked command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_checked\"]}},\"deny-is-enabled\":{\"identifier\":\"deny-is-enabled\",\"description\":\"Denies the is_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_enabled\"]}},\"deny-items\":{\"identifier\":\"deny-items\",\"description\":\"Denies the items command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"items\"]}},\"deny-new\":{\"identifier\":\"deny-new\",\"description\":\"Denies the new command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"new\"]}},\"deny-popup\":{\"identifier\":\"deny-popup\",\"description\":\"Denies the popup command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"popup\"]}},\"deny-prepend\":{\"identifier\":\"deny-prepend\",\"description\":\"Denies the prepend command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"prepend\"]}},\"deny-remove\":{\"identifier\":\"deny-remove\",\"description\":\"Denies the remove command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove\"]}},\"deny-remove-at\":{\"identifier\":\"deny-remove-at\",\"description\":\"Denies the remove_at command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove_at\"]}},\"deny-set-accelerator\":{\"identifier\":\"deny-set-accelerator\",\"description\":\"Denies the set_accelerator command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_accelerator\"]}},\"deny-set-as-app-menu\":{\"identifier\":\"deny-set-as-app-menu\",\"description\":\"Denies the set_as_app_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_as_app_menu\"]}},\"deny-set-as-help-menu-for-nsapp\":{\"identifier\":\"deny-set-as-help-menu-for-nsapp\",\"description\":\"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_as_help_menu_for_nsapp\"]}},\"deny-set-as-window-menu\":{\"identifier\":\"deny-set-as-window-menu\",\"description\":\"Denies the set_as_window_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_as_window_menu\"]}},\"deny-set-as-windows-menu-for-nsapp\":{\"identifier\":\"deny-set-as-windows-menu-for-nsapp\",\"description\":\"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_as_windows_menu_for_nsapp\"]}},\"deny-set-checked\":{\"identifier\":\"deny-set-checked\",\"description\":\"Denies the set_checked command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_checked\"]}},\"deny-set-enabled\":{\"identifier\":\"deny-set-enabled\",\"description\":\"Denies the set_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_enabled\"]}},\"deny-set-icon\":{\"identifier\":\"deny-set-icon\",\"description\":\"Denies the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_icon\"]}},\"deny-set-text\":{\"identifier\":\"deny-set-text\",\"description\":\"Denies the set_text command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_text\"]}},\"deny-text\":{\"identifier\":\"deny-text\",\"description\":\"Denies the text command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"text\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:path\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-resolve-directory\",\"allow-resolve\",\"allow-normalize\",\"allow-join\",\"allow-dirname\",\"allow-extname\",\"allow-basename\",\"allow-is-absolute\"]},\"permissions\":{\"allow-basename\":{\"identifier\":\"allow-basename\",\"description\":\"Enables the basename command without any pre-configured scope.\",\"commands\":{\"allow\":[\"basename\"],\"deny\":[]}},\"allow-dirname\":{\"identifier\":\"allow-dirname\",\"description\":\"Enables the dirname command without any pre-configured scope.\",\"commands\":{\"allow\":[\"dirname\"],\"deny\":[]}},\"allow-extname\":{\"identifier\":\"allow-extname\",\"description\":\"Enables the extname command without any pre-configured scope.\",\"commands\":{\"allow\":[\"extname\"],\"deny\":[]}},\"allow-is-absolute\":{\"identifier\":\"allow-is-absolute\",\"description\":\"Enables the is_absolute command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_absolute\"],\"deny\":[]}},\"allow-join\":{\"identifier\":\"allow-join\",\"description\":\"Enables the join command without any pre-configured scope.\",\"commands\":{\"allow\":[\"join\"],\"deny\":[]}},\"allow-normalize\":{\"identifier\":\"allow-normalize\",\"description\":\"Enables the normalize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"normalize\"],\"deny\":[]}},\"allow-resolve\":{\"identifier\":\"allow-resolve\",\"description\":\"Enables the resolve command without any pre-configured scope.\",\"commands\":{\"allow\":[\"resolve\"],\"deny\":[]}},\"allow-resolve-directory\":{\"identifier\":\"allow-resolve-directory\",\"description\":\"Enables the resolve_directory command without any pre-configured scope.\",\"commands\":{\"allow\":[\"resolve_directory\"],\"deny\":[]}},\"deny-basename\":{\"identifier\":\"deny-basename\",\"description\":\"Denies the basename command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"basename\"]}},\"deny-dirname\":{\"identifier\":\"deny-dirname\",\"description\":\"Denies the dirname command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"dirname\"]}},\"deny-extname\":{\"identifier\":\"deny-extname\",\"description\":\"Denies the extname command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"extname\"]}},\"deny-is-absolute\":{\"identifier\":\"deny-is-absolute\",\"description\":\"Denies the is_absolute command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_absolute\"]}},\"deny-join\":{\"identifier\":\"deny-join\",\"description\":\"Denies the join command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"join\"]}},\"deny-normalize\":{\"identifier\":\"deny-normalize\",\"description\":\"Denies the normalize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"normalize\"]}},\"deny-resolve\":{\"identifier\":\"deny-resolve\",\"description\":\"Denies the resolve command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"resolve\"]}},\"deny-resolve-directory\":{\"identifier\":\"deny-resolve-directory\",\"description\":\"Denies the resolve_directory command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"resolve_directory\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:resources\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-close\"]},\"permissions\":{\"allow-close\":{\"identifier\":\"allow-close\",\"description\":\"Enables the close command without any pre-configured scope.\",\"commands\":{\"allow\":[\"close\"],\"deny\":[]}},\"deny-close\":{\"identifier\":\"deny-close\",\"description\":\"Denies the close command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"close\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:tray\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-new\",\"allow-get-by-id\",\"allow-remove-by-id\",\"allow-set-icon\",\"allow-set-menu\",\"allow-set-tooltip\",\"allow-set-title\",\"allow-set-visible\",\"allow-set-temp-dir-path\",\"allow-set-icon-as-template\",\"allow-set-show-menu-on-left-click\"]},\"permissions\":{\"allow-get-by-id\":{\"identifier\":\"allow-get-by-id\",\"description\":\"Enables the get_by_id command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_by_id\"],\"deny\":[]}},\"allow-new\":{\"identifier\":\"allow-new\",\"description\":\"Enables the new command without any pre-configured scope.\",\"commands\":{\"allow\":[\"new\"],\"deny\":[]}},\"allow-remove-by-id\":{\"identifier\":\"allow-remove-by-id\",\"description\":\"Enables the remove_by_id command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove_by_id\"],\"deny\":[]}},\"allow-set-icon\":{\"identifier\":\"allow-set-icon\",\"description\":\"Enables the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_icon\"],\"deny\":[]}},\"allow-set-icon-as-template\":{\"identifier\":\"allow-set-icon-as-template\",\"description\":\"Enables the set_icon_as_template command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_icon_as_template\"],\"deny\":[]}},\"allow-set-menu\":{\"identifier\":\"allow-set-menu\",\"description\":\"Enables the set_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_menu\"],\"deny\":[]}},\"allow-set-show-menu-on-left-click\":{\"identifier\":\"allow-set-show-menu-on-left-click\",\"description\":\"Enables the set_show_menu_on_left_click command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_show_menu_on_left_click\"],\"deny\":[]}},\"allow-set-temp-dir-path\":{\"identifier\":\"allow-set-temp-dir-path\",\"description\":\"Enables the set_temp_dir_path command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_temp_dir_path\"],\"deny\":[]}},\"allow-set-title\":{\"identifier\":\"allow-set-title\",\"description\":\"Enables the set_title command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_title\"],\"deny\":[]}},\"allow-set-tooltip\":{\"identifier\":\"allow-set-tooltip\",\"description\":\"Enables the set_tooltip command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_tooltip\"],\"deny\":[]}},\"allow-set-visible\":{\"identifier\":\"allow-set-visible\",\"description\":\"Enables the set_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_visible\"],\"deny\":[]}},\"deny-get-by-id\":{\"identifier\":\"deny-get-by-id\",\"description\":\"Denies the get_by_id command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_by_id\"]}},\"deny-new\":{\"identifier\":\"deny-new\",\"description\":\"Denies the new command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"new\"]}},\"deny-remove-by-id\":{\"identifier\":\"deny-remove-by-id\",\"description\":\"Denies the remove_by_id command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove_by_id\"]}},\"deny-set-icon\":{\"identifier\":\"deny-set-icon\",\"description\":\"Denies the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_icon\"]}},\"deny-set-icon-as-template\":{\"identifier\":\"deny-set-icon-as-template\",\"description\":\"Denies the set_icon_as_template command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_icon_as_template\"]}},\"deny-set-menu\":{\"identifier\":\"deny-set-menu\",\"description\":\"Denies the set_menu command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_menu\"]}},\"deny-set-show-menu-on-left-click\":{\"identifier\":\"deny-set-show-menu-on-left-click\",\"description\":\"Denies the set_show_menu_on_left_click command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_show_menu_on_left_click\"]}},\"deny-set-temp-dir-path\":{\"identifier\":\"deny-set-temp-dir-path\",\"description\":\"Denies the set_temp_dir_path command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_temp_dir_path\"]}},\"deny-set-title\":{\"identifier\":\"deny-set-title\",\"description\":\"Denies the set_title command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_title\"]}},\"deny-set-tooltip\":{\"identifier\":\"deny-set-tooltip\",\"description\":\"Denies the set_tooltip command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_tooltip\"]}},\"deny-set-visible\":{\"identifier\":\"deny-set-visible\",\"description\":\"Denies the set_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_visible\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:webview\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-get-all-webviews\",\"allow-webview-position\",\"allow-webview-size\",\"allow-internal-toggle-devtools\"]},\"permissions\":{\"allow-clear-all-browsing-data\":{\"identifier\":\"allow-clear-all-browsing-data\",\"description\":\"Enables the clear_all_browsing_data command without any pre-configured scope.\",\"commands\":{\"allow\":[\"clear_all_browsing_data\"],\"deny\":[]}},\"allow-create-webview\":{\"identifier\":\"allow-create-webview\",\"description\":\"Enables the create_webview command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create_webview\"],\"deny\":[]}},\"allow-create-webview-window\":{\"identifier\":\"allow-create-webview-window\",\"description\":\"Enables the create_webview_window command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create_webview_window\"],\"deny\":[]}},\"allow-get-all-webviews\":{\"identifier\":\"allow-get-all-webviews\",\"description\":\"Enables the get_all_webviews command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_all_webviews\"],\"deny\":[]}},\"allow-internal-toggle-devtools\":{\"identifier\":\"allow-internal-toggle-devtools\",\"description\":\"Enables the internal_toggle_devtools command without any pre-configured scope.\",\"commands\":{\"allow\":[\"internal_toggle_devtools\"],\"deny\":[]}},\"allow-print\":{\"identifier\":\"allow-print\",\"description\":\"Enables the print command without any pre-configured scope.\",\"commands\":{\"allow\":[\"print\"],\"deny\":[]}},\"allow-reparent\":{\"identifier\":\"allow-reparent\",\"description\":\"Enables the reparent command without any pre-configured scope.\",\"commands\":{\"allow\":[\"reparent\"],\"deny\":[]}},\"allow-set-webview-background-color\":{\"identifier\":\"allow-set-webview-background-color\",\"description\":\"Enables the set_webview_background_color command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_webview_background_color\"],\"deny\":[]}},\"allow-set-webview-focus\":{\"identifier\":\"allow-set-webview-focus\",\"description\":\"Enables the set_webview_focus command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_webview_focus\"],\"deny\":[]}},\"allow-set-webview-position\":{\"identifier\":\"allow-set-webview-position\",\"description\":\"Enables the set_webview_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_webview_position\"],\"deny\":[]}},\"allow-set-webview-size\":{\"identifier\":\"allow-set-webview-size\",\"description\":\"Enables the set_webview_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_webview_size\"],\"deny\":[]}},\"allow-set-webview-zoom\":{\"identifier\":\"allow-set-webview-zoom\",\"description\":\"Enables the set_webview_zoom command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_webview_zoom\"],\"deny\":[]}},\"allow-webview-close\":{\"identifier\":\"allow-webview-close\",\"description\":\"Enables the webview_close command without any pre-configured scope.\",\"commands\":{\"allow\":[\"webview_close\"],\"deny\":[]}},\"allow-webview-hide\":{\"identifier\":\"allow-webview-hide\",\"description\":\"Enables the webview_hide command without any pre-configured scope.\",\"commands\":{\"allow\":[\"webview_hide\"],\"deny\":[]}},\"allow-webview-position\":{\"identifier\":\"allow-webview-position\",\"description\":\"Enables the webview_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"webview_position\"],\"deny\":[]}},\"allow-webview-show\":{\"identifier\":\"allow-webview-show\",\"description\":\"Enables the webview_show command without any pre-configured scope.\",\"commands\":{\"allow\":[\"webview_show\"],\"deny\":[]}},\"allow-webview-size\":{\"identifier\":\"allow-webview-size\",\"description\":\"Enables the webview_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"webview_size\"],\"deny\":[]}},\"deny-clear-all-browsing-data\":{\"identifier\":\"deny-clear-all-browsing-data\",\"description\":\"Denies the clear_all_browsing_data command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"clear_all_browsing_data\"]}},\"deny-create-webview\":{\"identifier\":\"deny-create-webview\",\"description\":\"Denies the create_webview command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create_webview\"]}},\"deny-create-webview-window\":{\"identifier\":\"deny-create-webview-window\",\"description\":\"Denies the create_webview_window command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create_webview_window\"]}},\"deny-get-all-webviews\":{\"identifier\":\"deny-get-all-webviews\",\"description\":\"Denies the get_all_webviews command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_all_webviews\"]}},\"deny-internal-toggle-devtools\":{\"identifier\":\"deny-internal-toggle-devtools\",\"description\":\"Denies the internal_toggle_devtools command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"internal_toggle_devtools\"]}},\"deny-print\":{\"identifier\":\"deny-print\",\"description\":\"Denies the print command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"print\"]}},\"deny-reparent\":{\"identifier\":\"deny-reparent\",\"description\":\"Denies the reparent command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"reparent\"]}},\"deny-set-webview-background-color\":{\"identifier\":\"deny-set-webview-background-color\",\"description\":\"Denies the set_webview_background_color command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_webview_background_color\"]}},\"deny-set-webview-focus\":{\"identifier\":\"deny-set-webview-focus\",\"description\":\"Denies the set_webview_focus command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_webview_focus\"]}},\"deny-set-webview-position\":{\"identifier\":\"deny-set-webview-position\",\"description\":\"Denies the set_webview_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_webview_position\"]}},\"deny-set-webview-size\":{\"identifier\":\"deny-set-webview-size\",\"description\":\"Denies the set_webview_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_webview_size\"]}},\"deny-set-webview-zoom\":{\"identifier\":\"deny-set-webview-zoom\",\"description\":\"Denies the set_webview_zoom command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_webview_zoom\"]}},\"deny-webview-close\":{\"identifier\":\"deny-webview-close\",\"description\":\"Denies the webview_close command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"webview_close\"]}},\"deny-webview-hide\":{\"identifier\":\"deny-webview-hide\",\"description\":\"Denies the webview_hide command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"webview_hide\"]}},\"deny-webview-position\":{\"identifier\":\"deny-webview-position\",\"description\":\"Denies the webview_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"webview_position\"]}},\"deny-webview-show\":{\"identifier\":\"deny-webview-show\",\"description\":\"Denies the webview_show command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"webview_show\"]}},\"deny-webview-size\":{\"identifier\":\"deny-webview-size\",\"description\":\"Denies the webview_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"webview_size\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"core:window\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Default permissions for the plugin.\",\"permissions\":[\"allow-get-all-windows\",\"allow-scale-factor\",\"allow-inner-position\",\"allow-outer-position\",\"allow-inner-size\",\"allow-outer-size\",\"allow-is-fullscreen\",\"allow-is-minimized\",\"allow-is-maximized\",\"allow-is-focused\",\"allow-is-decorated\",\"allow-is-resizable\",\"allow-is-maximizable\",\"allow-is-minimizable\",\"allow-is-closable\",\"allow-is-visible\",\"allow-is-enabled\",\"allow-title\",\"allow-current-monitor\",\"allow-primary-monitor\",\"allow-monitor-from-point\",\"allow-available-monitors\",\"allow-cursor-position\",\"allow-theme\",\"allow-is-always-on-top\",\"allow-internal-toggle-maximize\"]},\"permissions\":{\"allow-available-monitors\":{\"identifier\":\"allow-available-monitors\",\"description\":\"Enables the available_monitors command without any pre-configured scope.\",\"commands\":{\"allow\":[\"available_monitors\"],\"deny\":[]}},\"allow-center\":{\"identifier\":\"allow-center\",\"description\":\"Enables the center command without any pre-configured scope.\",\"commands\":{\"allow\":[\"center\"],\"deny\":[]}},\"allow-close\":{\"identifier\":\"allow-close\",\"description\":\"Enables the close command without any pre-configured scope.\",\"commands\":{\"allow\":[\"close\"],\"deny\":[]}},\"allow-create\":{\"identifier\":\"allow-create\",\"description\":\"Enables the create command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create\"],\"deny\":[]}},\"allow-current-monitor\":{\"identifier\":\"allow-current-monitor\",\"description\":\"Enables the current_monitor command without any pre-configured scope.\",\"commands\":{\"allow\":[\"current_monitor\"],\"deny\":[]}},\"allow-cursor-position\":{\"identifier\":\"allow-cursor-position\",\"description\":\"Enables the cursor_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"cursor_position\"],\"deny\":[]}},\"allow-destroy\":{\"identifier\":\"allow-destroy\",\"description\":\"Enables the destroy command without any pre-configured scope.\",\"commands\":{\"allow\":[\"destroy\"],\"deny\":[]}},\"allow-get-all-windows\":{\"identifier\":\"allow-get-all-windows\",\"description\":\"Enables the get_all_windows command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_all_windows\"],\"deny\":[]}},\"allow-hide\":{\"identifier\":\"allow-hide\",\"description\":\"Enables the hide command without any pre-configured scope.\",\"commands\":{\"allow\":[\"hide\"],\"deny\":[]}},\"allow-inner-position\":{\"identifier\":\"allow-inner-position\",\"description\":\"Enables the inner_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"inner_position\"],\"deny\":[]}},\"allow-inner-size\":{\"identifier\":\"allow-inner-size\",\"description\":\"Enables the inner_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"inner_size\"],\"deny\":[]}},\"allow-internal-toggle-maximize\":{\"identifier\":\"allow-internal-toggle-maximize\",\"description\":\"Enables the internal_toggle_maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"internal_toggle_maximize\"],\"deny\":[]}},\"allow-is-always-on-top\":{\"identifier\":\"allow-is-always-on-top\",\"description\":\"Enables the is_always_on_top command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_always_on_top\"],\"deny\":[]}},\"allow-is-closable\":{\"identifier\":\"allow-is-closable\",\"description\":\"Enables the is_closable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_closable\"],\"deny\":[]}},\"allow-is-decorated\":{\"identifier\":\"allow-is-decorated\",\"description\":\"Enables the is_decorated command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_decorated\"],\"deny\":[]}},\"allow-is-enabled\":{\"identifier\":\"allow-is-enabled\",\"description\":\"Enables the is_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_enabled\"],\"deny\":[]}},\"allow-is-focused\":{\"identifier\":\"allow-is-focused\",\"description\":\"Enables the is_focused command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_focused\"],\"deny\":[]}},\"allow-is-fullscreen\":{\"identifier\":\"allow-is-fullscreen\",\"description\":\"Enables the is_fullscreen command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_fullscreen\"],\"deny\":[]}},\"allow-is-maximizable\":{\"identifier\":\"allow-is-maximizable\",\"description\":\"Enables the is_maximizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_maximizable\"],\"deny\":[]}},\"allow-is-maximized\":{\"identifier\":\"allow-is-maximized\",\"description\":\"Enables the is_maximized command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_maximized\"],\"deny\":[]}},\"allow-is-minimizable\":{\"identifier\":\"allow-is-minimizable\",\"description\":\"Enables the is_minimizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_minimizable\"],\"deny\":[]}},\"allow-is-minimized\":{\"identifier\":\"allow-is-minimized\",\"description\":\"Enables the is_minimized command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_minimized\"],\"deny\":[]}},\"allow-is-resizable\":{\"identifier\":\"allow-is-resizable\",\"description\":\"Enables the is_resizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_resizable\"],\"deny\":[]}},\"allow-is-visible\":{\"identifier\":\"allow-is-visible\",\"description\":\"Enables the is_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_visible\"],\"deny\":[]}},\"allow-maximize\":{\"identifier\":\"allow-maximize\",\"description\":\"Enables the maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"maximize\"],\"deny\":[]}},\"allow-minimize\":{\"identifier\":\"allow-minimize\",\"description\":\"Enables the minimize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"minimize\"],\"deny\":[]}},\"allow-monitor-from-point\":{\"identifier\":\"allow-monitor-from-point\",\"description\":\"Enables the monitor_from_point command without any pre-configured scope.\",\"commands\":{\"allow\":[\"monitor_from_point\"],\"deny\":[]}},\"allow-outer-position\":{\"identifier\":\"allow-outer-position\",\"description\":\"Enables the outer_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"outer_position\"],\"deny\":[]}},\"allow-outer-size\":{\"identifier\":\"allow-outer-size\",\"description\":\"Enables the outer_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"outer_size\"],\"deny\":[]}},\"allow-primary-monitor\":{\"identifier\":\"allow-primary-monitor\",\"description\":\"Enables the primary_monitor command without any pre-configured scope.\",\"commands\":{\"allow\":[\"primary_monitor\"],\"deny\":[]}},\"allow-request-user-attention\":{\"identifier\":\"allow-request-user-attention\",\"description\":\"Enables the request_user_attention command without any pre-configured scope.\",\"commands\":{\"allow\":[\"request_user_attention\"],\"deny\":[]}},\"allow-scale-factor\":{\"identifier\":\"allow-scale-factor\",\"description\":\"Enables the scale_factor command without any pre-configured scope.\",\"commands\":{\"allow\":[\"scale_factor\"],\"deny\":[]}},\"allow-set-always-on-bottom\":{\"identifier\":\"allow-set-always-on-bottom\",\"description\":\"Enables the set_always_on_bottom command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_always_on_bottom\"],\"deny\":[]}},\"allow-set-always-on-top\":{\"identifier\":\"allow-set-always-on-top\",\"description\":\"Enables the set_always_on_top command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_always_on_top\"],\"deny\":[]}},\"allow-set-background-color\":{\"identifier\":\"allow-set-background-color\",\"description\":\"Enables the set_background_color command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_background_color\"],\"deny\":[]}},\"allow-set-badge-count\":{\"identifier\":\"allow-set-badge-count\",\"description\":\"Enables the set_badge_count command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_badge_count\"],\"deny\":[]}},\"allow-set-badge-label\":{\"identifier\":\"allow-set-badge-label\",\"description\":\"Enables the set_badge_label command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_badge_label\"],\"deny\":[]}},\"allow-set-closable\":{\"identifier\":\"allow-set-closable\",\"description\":\"Enables the set_closable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_closable\"],\"deny\":[]}},\"allow-set-content-protected\":{\"identifier\":\"allow-set-content-protected\",\"description\":\"Enables the set_content_protected command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_content_protected\"],\"deny\":[]}},\"allow-set-cursor-grab\":{\"identifier\":\"allow-set-cursor-grab\",\"description\":\"Enables the set_cursor_grab command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_cursor_grab\"],\"deny\":[]}},\"allow-set-cursor-icon\":{\"identifier\":\"allow-set-cursor-icon\",\"description\":\"Enables the set_cursor_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_cursor_icon\"],\"deny\":[]}},\"allow-set-cursor-position\":{\"identifier\":\"allow-set-cursor-position\",\"description\":\"Enables the set_cursor_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_cursor_position\"],\"deny\":[]}},\"allow-set-cursor-visible\":{\"identifier\":\"allow-set-cursor-visible\",\"description\":\"Enables the set_cursor_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_cursor_visible\"],\"deny\":[]}},\"allow-set-decorations\":{\"identifier\":\"allow-set-decorations\",\"description\":\"Enables the set_decorations command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_decorations\"],\"deny\":[]}},\"allow-set-effects\":{\"identifier\":\"allow-set-effects\",\"description\":\"Enables the set_effects command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_effects\"],\"deny\":[]}},\"allow-set-enabled\":{\"identifier\":\"allow-set-enabled\",\"description\":\"Enables the set_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_enabled\"],\"deny\":[]}},\"allow-set-focus\":{\"identifier\":\"allow-set-focus\",\"description\":\"Enables the set_focus command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_focus\"],\"deny\":[]}},\"allow-set-fullscreen\":{\"identifier\":\"allow-set-fullscreen\",\"description\":\"Enables the set_fullscreen command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_fullscreen\"],\"deny\":[]}},\"allow-set-icon\":{\"identifier\":\"allow-set-icon\",\"description\":\"Enables the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_icon\"],\"deny\":[]}},\"allow-set-ignore-cursor-events\":{\"identifier\":\"allow-set-ignore-cursor-events\",\"description\":\"Enables the set_ignore_cursor_events command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_ignore_cursor_events\"],\"deny\":[]}},\"allow-set-max-size\":{\"identifier\":\"allow-set-max-size\",\"description\":\"Enables the set_max_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_max_size\"],\"deny\":[]}},\"allow-set-maximizable\":{\"identifier\":\"allow-set-maximizable\",\"description\":\"Enables the set_maximizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_maximizable\"],\"deny\":[]}},\"allow-set-min-size\":{\"identifier\":\"allow-set-min-size\",\"description\":\"Enables the set_min_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_min_size\"],\"deny\":[]}},\"allow-set-minimizable\":{\"identifier\":\"allow-set-minimizable\",\"description\":\"Enables the set_minimizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_minimizable\"],\"deny\":[]}},\"allow-set-overlay-icon\":{\"identifier\":\"allow-set-overlay-icon\",\"description\":\"Enables the set_overlay_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_overlay_icon\"],\"deny\":[]}},\"allow-set-position\":{\"identifier\":\"allow-set-position\",\"description\":\"Enables the set_position command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_position\"],\"deny\":[]}},\"allow-set-progress-bar\":{\"identifier\":\"allow-set-progress-bar\",\"description\":\"Enables the set_progress_bar command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_progress_bar\"],\"deny\":[]}},\"allow-set-resizable\":{\"identifier\":\"allow-set-resizable\",\"description\":\"Enables the set_resizable command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_resizable\"],\"deny\":[]}},\"allow-set-shadow\":{\"identifier\":\"allow-set-shadow\",\"description\":\"Enables the set_shadow command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_shadow\"],\"deny\":[]}},\"allow-set-size\":{\"identifier\":\"allow-set-size\",\"description\":\"Enables the set_size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_size\"],\"deny\":[]}},\"allow-set-size-constraints\":{\"identifier\":\"allow-set-size-constraints\",\"description\":\"Enables the set_size_constraints command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_size_constraints\"],\"deny\":[]}},\"allow-set-skip-taskbar\":{\"identifier\":\"allow-set-skip-taskbar\",\"description\":\"Enables the set_skip_taskbar command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_skip_taskbar\"],\"deny\":[]}},\"allow-set-theme\":{\"identifier\":\"allow-set-theme\",\"description\":\"Enables the set_theme command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_theme\"],\"deny\":[]}},\"allow-set-title\":{\"identifier\":\"allow-set-title\",\"description\":\"Enables the set_title command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_title\"],\"deny\":[]}},\"allow-set-title-bar-style\":{\"identifier\":\"allow-set-title-bar-style\",\"description\":\"Enables the set_title_bar_style command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_title_bar_style\"],\"deny\":[]}},\"allow-set-visible-on-all-workspaces\":{\"identifier\":\"allow-set-visible-on-all-workspaces\",\"description\":\"Enables the set_visible_on_all_workspaces command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set_visible_on_all_workspaces\"],\"deny\":[]}},\"allow-show\":{\"identifier\":\"allow-show\",\"description\":\"Enables the show command without any pre-configured scope.\",\"commands\":{\"allow\":[\"show\"],\"deny\":[]}},\"allow-start-dragging\":{\"identifier\":\"allow-start-dragging\",\"description\":\"Enables the start_dragging command without any pre-configured scope.\",\"commands\":{\"allow\":[\"start_dragging\"],\"deny\":[]}},\"allow-start-resize-dragging\":{\"identifier\":\"allow-start-resize-dragging\",\"description\":\"Enables the start_resize_dragging command without any pre-configured scope.\",\"commands\":{\"allow\":[\"start_resize_dragging\"],\"deny\":[]}},\"allow-theme\":{\"identifier\":\"allow-theme\",\"description\":\"Enables the theme command without any pre-configured scope.\",\"commands\":{\"allow\":[\"theme\"],\"deny\":[]}},\"allow-title\":{\"identifier\":\"allow-title\",\"description\":\"Enables the title command without any pre-configured scope.\",\"commands\":{\"allow\":[\"title\"],\"deny\":[]}},\"allow-toggle-maximize\":{\"identifier\":\"allow-toggle-maximize\",\"description\":\"Enables the toggle_maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"toggle_maximize\"],\"deny\":[]}},\"allow-unmaximize\":{\"identifier\":\"allow-unmaximize\",\"description\":\"Enables the unmaximize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"unmaximize\"],\"deny\":[]}},\"allow-unminimize\":{\"identifier\":\"allow-unminimize\",\"description\":\"Enables the unminimize command without any pre-configured scope.\",\"commands\":{\"allow\":[\"unminimize\"],\"deny\":[]}},\"deny-available-monitors\":{\"identifier\":\"deny-available-monitors\",\"description\":\"Denies the available_monitors command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"available_monitors\"]}},\"deny-center\":{\"identifier\":\"deny-center\",\"description\":\"Denies the center command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"center\"]}},\"deny-close\":{\"identifier\":\"deny-close\",\"description\":\"Denies the close command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"close\"]}},\"deny-create\":{\"identifier\":\"deny-create\",\"description\":\"Denies the create command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create\"]}},\"deny-current-monitor\":{\"identifier\":\"deny-current-monitor\",\"description\":\"Denies the current_monitor command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"current_monitor\"]}},\"deny-cursor-position\":{\"identifier\":\"deny-cursor-position\",\"description\":\"Denies the cursor_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"cursor_position\"]}},\"deny-destroy\":{\"identifier\":\"deny-destroy\",\"description\":\"Denies the destroy command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"destroy\"]}},\"deny-get-all-windows\":{\"identifier\":\"deny-get-all-windows\",\"description\":\"Denies the get_all_windows command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_all_windows\"]}},\"deny-hide\":{\"identifier\":\"deny-hide\",\"description\":\"Denies the hide command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"hide\"]}},\"deny-inner-position\":{\"identifier\":\"deny-inner-position\",\"description\":\"Denies the inner_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"inner_position\"]}},\"deny-inner-size\":{\"identifier\":\"deny-inner-size\",\"description\":\"Denies the inner_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"inner_size\"]}},\"deny-internal-toggle-maximize\":{\"identifier\":\"deny-internal-toggle-maximize\",\"description\":\"Denies the internal_toggle_maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"internal_toggle_maximize\"]}},\"deny-is-always-on-top\":{\"identifier\":\"deny-is-always-on-top\",\"description\":\"Denies the is_always_on_top command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_always_on_top\"]}},\"deny-is-closable\":{\"identifier\":\"deny-is-closable\",\"description\":\"Denies the is_closable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_closable\"]}},\"deny-is-decorated\":{\"identifier\":\"deny-is-decorated\",\"description\":\"Denies the is_decorated command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_decorated\"]}},\"deny-is-enabled\":{\"identifier\":\"deny-is-enabled\",\"description\":\"Denies the is_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_enabled\"]}},\"deny-is-focused\":{\"identifier\":\"deny-is-focused\",\"description\":\"Denies the is_focused command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_focused\"]}},\"deny-is-fullscreen\":{\"identifier\":\"deny-is-fullscreen\",\"description\":\"Denies the is_fullscreen command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_fullscreen\"]}},\"deny-is-maximizable\":{\"identifier\":\"deny-is-maximizable\",\"description\":\"Denies the is_maximizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_maximizable\"]}},\"deny-is-maximized\":{\"identifier\":\"deny-is-maximized\",\"description\":\"Denies the is_maximized command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_maximized\"]}},\"deny-is-minimizable\":{\"identifier\":\"deny-is-minimizable\",\"description\":\"Denies the is_minimizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_minimizable\"]}},\"deny-is-minimized\":{\"identifier\":\"deny-is-minimized\",\"description\":\"Denies the is_minimized command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_minimized\"]}},\"deny-is-resizable\":{\"identifier\":\"deny-is-resizable\",\"description\":\"Denies the is_resizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_resizable\"]}},\"deny-is-visible\":{\"identifier\":\"deny-is-visible\",\"description\":\"Denies the is_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_visible\"]}},\"deny-maximize\":{\"identifier\":\"deny-maximize\",\"description\":\"Denies the maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"maximize\"]}},\"deny-minimize\":{\"identifier\":\"deny-minimize\",\"description\":\"Denies the minimize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"minimize\"]}},\"deny-monitor-from-point\":{\"identifier\":\"deny-monitor-from-point\",\"description\":\"Denies the monitor_from_point command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"monitor_from_point\"]}},\"deny-outer-position\":{\"identifier\":\"deny-outer-position\",\"description\":\"Denies the outer_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"outer_position\"]}},\"deny-outer-size\":{\"identifier\":\"deny-outer-size\",\"description\":\"Denies the outer_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"outer_size\"]}},\"deny-primary-monitor\":{\"identifier\":\"deny-primary-monitor\",\"description\":\"Denies the primary_monitor command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"primary_monitor\"]}},\"deny-request-user-attention\":{\"identifier\":\"deny-request-user-attention\",\"description\":\"Denies the request_user_attention command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"request_user_attention\"]}},\"deny-scale-factor\":{\"identifier\":\"deny-scale-factor\",\"description\":\"Denies the scale_factor command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"scale_factor\"]}},\"deny-set-always-on-bottom\":{\"identifier\":\"deny-set-always-on-bottom\",\"description\":\"Denies the set_always_on_bottom command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_always_on_bottom\"]}},\"deny-set-always-on-top\":{\"identifier\":\"deny-set-always-on-top\",\"description\":\"Denies the set_always_on_top command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_always_on_top\"]}},\"deny-set-background-color\":{\"identifier\":\"deny-set-background-color\",\"description\":\"Denies the set_background_color command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_background_color\"]}},\"deny-set-badge-count\":{\"identifier\":\"deny-set-badge-count\",\"description\":\"Denies the set_badge_count command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_badge_count\"]}},\"deny-set-badge-label\":{\"identifier\":\"deny-set-badge-label\",\"description\":\"Denies the set_badge_label command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_badge_label\"]}},\"deny-set-closable\":{\"identifier\":\"deny-set-closable\",\"description\":\"Denies the set_closable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_closable\"]}},\"deny-set-content-protected\":{\"identifier\":\"deny-set-content-protected\",\"description\":\"Denies the set_content_protected command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_content_protected\"]}},\"deny-set-cursor-grab\":{\"identifier\":\"deny-set-cursor-grab\",\"description\":\"Denies the set_cursor_grab command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_cursor_grab\"]}},\"deny-set-cursor-icon\":{\"identifier\":\"deny-set-cursor-icon\",\"description\":\"Denies the set_cursor_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_cursor_icon\"]}},\"deny-set-cursor-position\":{\"identifier\":\"deny-set-cursor-position\",\"description\":\"Denies the set_cursor_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_cursor_position\"]}},\"deny-set-cursor-visible\":{\"identifier\":\"deny-set-cursor-visible\",\"description\":\"Denies the set_cursor_visible command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_cursor_visible\"]}},\"deny-set-decorations\":{\"identifier\":\"deny-set-decorations\",\"description\":\"Denies the set_decorations command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_decorations\"]}},\"deny-set-effects\":{\"identifier\":\"deny-set-effects\",\"description\":\"Denies the set_effects command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_effects\"]}},\"deny-set-enabled\":{\"identifier\":\"deny-set-enabled\",\"description\":\"Denies the set_enabled command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_enabled\"]}},\"deny-set-focus\":{\"identifier\":\"deny-set-focus\",\"description\":\"Denies the set_focus command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_focus\"]}},\"deny-set-fullscreen\":{\"identifier\":\"deny-set-fullscreen\",\"description\":\"Denies the set_fullscreen command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_fullscreen\"]}},\"deny-set-icon\":{\"identifier\":\"deny-set-icon\",\"description\":\"Denies the set_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_icon\"]}},\"deny-set-ignore-cursor-events\":{\"identifier\":\"deny-set-ignore-cursor-events\",\"description\":\"Denies the set_ignore_cursor_events command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_ignore_cursor_events\"]}},\"deny-set-max-size\":{\"identifier\":\"deny-set-max-size\",\"description\":\"Denies the set_max_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_max_size\"]}},\"deny-set-maximizable\":{\"identifier\":\"deny-set-maximizable\",\"description\":\"Denies the set_maximizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_maximizable\"]}},\"deny-set-min-size\":{\"identifier\":\"deny-set-min-size\",\"description\":\"Denies the set_min_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_min_size\"]}},\"deny-set-minimizable\":{\"identifier\":\"deny-set-minimizable\",\"description\":\"Denies the set_minimizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_minimizable\"]}},\"deny-set-overlay-icon\":{\"identifier\":\"deny-set-overlay-icon\",\"description\":\"Denies the set_overlay_icon command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_overlay_icon\"]}},\"deny-set-position\":{\"identifier\":\"deny-set-position\",\"description\":\"Denies the set_position command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_position\"]}},\"deny-set-progress-bar\":{\"identifier\":\"deny-set-progress-bar\",\"description\":\"Denies the set_progress_bar command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_progress_bar\"]}},\"deny-set-resizable\":{\"identifier\":\"deny-set-resizable\",\"description\":\"Denies the set_resizable command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_resizable\"]}},\"deny-set-shadow\":{\"identifier\":\"deny-set-shadow\",\"description\":\"Denies the set_shadow command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_shadow\"]}},\"deny-set-size\":{\"identifier\":\"deny-set-size\",\"description\":\"Denies the set_size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_size\"]}},\"deny-set-size-constraints\":{\"identifier\":\"deny-set-size-constraints\",\"description\":\"Denies the set_size_constraints command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_size_constraints\"]}},\"deny-set-skip-taskbar\":{\"identifier\":\"deny-set-skip-taskbar\",\"description\":\"Denies the set_skip_taskbar command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_skip_taskbar\"]}},\"deny-set-theme\":{\"identifier\":\"deny-set-theme\",\"description\":\"Denies the set_theme command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_theme\"]}},\"deny-set-title\":{\"identifier\":\"deny-set-title\",\"description\":\"Denies the set_title command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_title\"]}},\"deny-set-title-bar-style\":{\"identifier\":\"deny-set-title-bar-style\",\"description\":\"Denies the set_title_bar_style command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_title_bar_style\"]}},\"deny-set-visible-on-all-workspaces\":{\"identifier\":\"deny-set-visible-on-all-workspaces\",\"description\":\"Denies the set_visible_on_all_workspaces command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set_visible_on_all_workspaces\"]}},\"deny-show\":{\"identifier\":\"deny-show\",\"description\":\"Denies the show command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"show\"]}},\"deny-start-dragging\":{\"identifier\":\"deny-start-dragging\",\"description\":\"Denies the start_dragging command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"start_dragging\"]}},\"deny-start-resize-dragging\":{\"identifier\":\"deny-start-resize-dragging\",\"description\":\"Denies the start_resize_dragging command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"start_resize_dragging\"]}},\"deny-theme\":{\"identifier\":\"deny-theme\",\"description\":\"Denies the theme command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"theme\"]}},\"deny-title\":{\"identifier\":\"deny-title\",\"description\":\"Denies the title command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"title\"]}},\"deny-toggle-maximize\":{\"identifier\":\"deny-toggle-maximize\",\"description\":\"Denies the toggle_maximize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"toggle_maximize\"]}},\"deny-unmaximize\":{\"identifier\":\"deny-unmaximize\",\"description\":\"Denies the unmaximize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"unmaximize\"]}},\"deny-unminimize\":{\"identifier\":\"deny-unminimize\",\"description\":\"Denies the unminimize command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"unminimize\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"dialog\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures the types of dialogs\\navailable from the dialog plugin.\\n\\n#### Granted Permissions\\n\\nAll dialog types are enabled.\\n\\n\\n\",\"permissions\":[\"allow-ask\",\"allow-confirm\",\"allow-message\",\"allow-save\",\"allow-open\"]},\"permissions\":{\"allow-ask\":{\"identifier\":\"allow-ask\",\"description\":\"Enables the ask command without any pre-configured scope.\",\"commands\":{\"allow\":[\"ask\"],\"deny\":[]}},\"allow-confirm\":{\"identifier\":\"allow-confirm\",\"description\":\"Enables the confirm command without any pre-configured scope.\",\"commands\":{\"allow\":[\"confirm\"],\"deny\":[]}},\"allow-message\":{\"identifier\":\"allow-message\",\"description\":\"Enables the message command without any pre-configured scope.\",\"commands\":{\"allow\":[\"message\"],\"deny\":[]}},\"allow-open\":{\"identifier\":\"allow-open\",\"description\":\"Enables the open command without any pre-configured scope.\",\"commands\":{\"allow\":[\"open\"],\"deny\":[]}},\"allow-save\":{\"identifier\":\"allow-save\",\"description\":\"Enables the save command without any pre-configured scope.\",\"commands\":{\"allow\":[\"save\"],\"deny\":[]}},\"deny-ask\":{\"identifier\":\"deny-ask\",\"description\":\"Denies the ask command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"ask\"]}},\"deny-confirm\":{\"identifier\":\"deny-confirm\",\"description\":\"Denies the confirm command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"confirm\"]}},\"deny-message\":{\"identifier\":\"deny-message\",\"description\":\"Denies the message command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"message\"]}},\"deny-open\":{\"identifier\":\"deny-open\",\"description\":\"Denies the open command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"open\"]}},\"deny-save\":{\"identifier\":\"deny-save\",\"description\":\"Denies the save command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"save\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"fs\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\"permissions\":[\"create-app-specific-dirs\",\"read-app-specific-dirs-recursive\",\"deny-default\"]},\"permissions\":{\"allow-copy-file\":{\"identifier\":\"allow-copy-file\",\"description\":\"Enables the copy_file command without any pre-configured scope.\",\"commands\":{\"allow\":[\"copy_file\"],\"deny\":[]}},\"allow-create\":{\"identifier\":\"allow-create\",\"description\":\"Enables the create command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create\"],\"deny\":[]}},\"allow-exists\":{\"identifier\":\"allow-exists\",\"description\":\"Enables the exists command without any pre-configured scope.\",\"commands\":{\"allow\":[\"exists\"],\"deny\":[]}},\"allow-fstat\":{\"identifier\":\"allow-fstat\",\"description\":\"Enables the fstat command without any pre-configured scope.\",\"commands\":{\"allow\":[\"fstat\"],\"deny\":[]}},\"allow-ftruncate\":{\"identifier\":\"allow-ftruncate\",\"description\":\"Enables the ftruncate command without any pre-configured scope.\",\"commands\":{\"allow\":[\"ftruncate\"],\"deny\":[]}},\"allow-lstat\":{\"identifier\":\"allow-lstat\",\"description\":\"Enables the lstat command without any pre-configured scope.\",\"commands\":{\"allow\":[\"lstat\"],\"deny\":[]}},\"allow-mkdir\":{\"identifier\":\"allow-mkdir\",\"description\":\"Enables the mkdir command without any pre-configured scope.\",\"commands\":{\"allow\":[\"mkdir\"],\"deny\":[]}},\"allow-open\":{\"identifier\":\"allow-open\",\"description\":\"Enables the open command without any pre-configured scope.\",\"commands\":{\"allow\":[\"open\"],\"deny\":[]}},\"allow-read\":{\"identifier\":\"allow-read\",\"description\":\"Enables the read command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read\"],\"deny\":[]}},\"allow-read-dir\":{\"identifier\":\"allow-read-dir\",\"description\":\"Enables the read_dir command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_dir\"],\"deny\":[]}},\"allow-read-file\":{\"identifier\":\"allow-read-file\",\"description\":\"Enables the read_file command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_file\"],\"deny\":[]}},\"allow-read-text-file\":{\"identifier\":\"allow-read-text-file\",\"description\":\"Enables the read_text_file command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_text_file\"],\"deny\":[]}},\"allow-read-text-file-lines\":{\"identifier\":\"allow-read-text-file-lines\",\"description\":\"Enables the read_text_file_lines command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_text_file_lines\",\"read_text_file_lines_next\"],\"deny\":[]}},\"allow-read-text-file-lines-next\":{\"identifier\":\"allow-read-text-file-lines-next\",\"description\":\"Enables the read_text_file_lines_next command without any pre-configured scope.\",\"commands\":{\"allow\":[\"read_text_file_lines_next\"],\"deny\":[]}},\"allow-remove\":{\"identifier\":\"allow-remove\",\"description\":\"Enables the remove command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove\"],\"deny\":[]}},\"allow-rename\":{\"identifier\":\"allow-rename\",\"description\":\"Enables the rename command without any pre-configured scope.\",\"commands\":{\"allow\":[\"rename\"],\"deny\":[]}},\"allow-seek\":{\"identifier\":\"allow-seek\",\"description\":\"Enables the seek command without any pre-configured scope.\",\"commands\":{\"allow\":[\"seek\"],\"deny\":[]}},\"allow-size\":{\"identifier\":\"allow-size\",\"description\":\"Enables the size command without any pre-configured scope.\",\"commands\":{\"allow\":[\"size\"],\"deny\":[]}},\"allow-stat\":{\"identifier\":\"allow-stat\",\"description\":\"Enables the stat command without any pre-configured scope.\",\"commands\":{\"allow\":[\"stat\"],\"deny\":[]}},\"allow-truncate\":{\"identifier\":\"allow-truncate\",\"description\":\"Enables the truncate command without any pre-configured scope.\",\"commands\":{\"allow\":[\"truncate\"],\"deny\":[]}},\"allow-unwatch\":{\"identifier\":\"allow-unwatch\",\"description\":\"Enables the unwatch command without any pre-configured scope.\",\"commands\":{\"allow\":[\"unwatch\"],\"deny\":[]}},\"allow-watch\":{\"identifier\":\"allow-watch\",\"description\":\"Enables the watch command without any pre-configured scope.\",\"commands\":{\"allow\":[\"watch\"],\"deny\":[]}},\"allow-write\":{\"identifier\":\"allow-write\",\"description\":\"Enables the write command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write\"],\"deny\":[]}},\"allow-write-file\":{\"identifier\":\"allow-write-file\",\"description\":\"Enables the write_file command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write_file\",\"open\",\"write\"],\"deny\":[]}},\"allow-write-text-file\":{\"identifier\":\"allow-write-text-file\",\"description\":\"Enables the write_text_file command without any pre-configured scope.\",\"commands\":{\"allow\":[\"write_text_file\"],\"deny\":[]}},\"create-app-specific-dirs\":{\"identifier\":\"create-app-specific-dirs\",\"description\":\"This permissions allows to create the application specific directories.\\n\",\"commands\":{\"allow\":[\"mkdir\",\"scope-app-index\"],\"deny\":[]}},\"deny-copy-file\":{\"identifier\":\"deny-copy-file\",\"description\":\"Denies the copy_file command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"copy_file\"]}},\"deny-create\":{\"identifier\":\"deny-create\",\"description\":\"Denies the create command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create\"]}},\"deny-exists\":{\"identifier\":\"deny-exists\",\"description\":\"Denies the exists command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"exists\"]}},\"deny-fstat\":{\"identifier\":\"deny-fstat\",\"description\":\"Denies the fstat command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"fstat\"]}},\"deny-ftruncate\":{\"identifier\":\"deny-ftruncate\",\"description\":\"Denies the ftruncate command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"ftruncate\"]}},\"deny-lstat\":{\"identifier\":\"deny-lstat\",\"description\":\"Denies the lstat command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"lstat\"]}},\"deny-mkdir\":{\"identifier\":\"deny-mkdir\",\"description\":\"Denies the mkdir command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"mkdir\"]}},\"deny-open\":{\"identifier\":\"deny-open\",\"description\":\"Denies the open command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"open\"]}},\"deny-read\":{\"identifier\":\"deny-read\",\"description\":\"Denies the read command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read\"]}},\"deny-read-dir\":{\"identifier\":\"deny-read-dir\",\"description\":\"Denies the read_dir command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_dir\"]}},\"deny-read-file\":{\"identifier\":\"deny-read-file\",\"description\":\"Denies the read_file command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_file\"]}},\"deny-read-text-file\":{\"identifier\":\"deny-read-text-file\",\"description\":\"Denies the read_text_file command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_text_file\"]}},\"deny-read-text-file-lines\":{\"identifier\":\"deny-read-text-file-lines\",\"description\":\"Denies the read_text_file_lines command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_text_file_lines\"]}},\"deny-read-text-file-lines-next\":{\"identifier\":\"deny-read-text-file-lines-next\",\"description\":\"Denies the read_text_file_lines_next command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"read_text_file_lines_next\"]}},\"deny-remove\":{\"identifier\":\"deny-remove\",\"description\":\"Denies the remove command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove\"]}},\"deny-rename\":{\"identifier\":\"deny-rename\",\"description\":\"Denies the rename command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"rename\"]}},\"deny-seek\":{\"identifier\":\"deny-seek\",\"description\":\"Denies the seek command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"seek\"]}},\"deny-size\":{\"identifier\":\"deny-size\",\"description\":\"Denies the size command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"size\"]}},\"deny-stat\":{\"identifier\":\"deny-stat\",\"description\":\"Denies the stat command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"stat\"]}},\"deny-truncate\":{\"identifier\":\"deny-truncate\",\"description\":\"Denies the truncate command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"truncate\"]}},\"deny-unwatch\":{\"identifier\":\"deny-unwatch\",\"description\":\"Denies the unwatch command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"unwatch\"]}},\"deny-watch\":{\"identifier\":\"deny-watch\",\"description\":\"Denies the watch command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"watch\"]}},\"deny-webview-data-linux\":{\"identifier\":\"deny-webview-data-linux\",\"description\":\"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\"commands\":{\"allow\":[],\"deny\":[]}},\"deny-webview-data-windows\":{\"identifier\":\"deny-webview-data-windows\",\"description\":\"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\"commands\":{\"allow\":[],\"deny\":[]}},\"deny-write\":{\"identifier\":\"deny-write\",\"description\":\"Denies the write command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write\"]}},\"deny-write-file\":{\"identifier\":\"deny-write-file\",\"description\":\"Denies the write_file command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write_file\"]}},\"deny-write-text-file\":{\"identifier\":\"deny-write-text-file\",\"description\":\"Denies the write_text_file command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"write_text_file\"]}},\"read-all\":{\"identifier\":\"read-all\",\"description\":\"This enables all read related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"read_dir\",\"read_file\",\"read\",\"open\",\"read_text_file\",\"read_text_file_lines\",\"read_text_file_lines_next\",\"seek\",\"stat\",\"lstat\",\"fstat\",\"exists\",\"watch\",\"unwatch\"],\"deny\":[]}},\"read-app-specific-dirs-recursive\":{\"identifier\":\"read-app-specific-dirs-recursive\",\"description\":\"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\"commands\":{\"allow\":[\"read_dir\",\"read_file\",\"read_text_file\",\"read_text_file_lines\",\"read_text_file_lines_next\",\"exists\",\"scope-app-recursive\"],\"deny\":[]}},\"read-dirs\":{\"identifier\":\"read-dirs\",\"description\":\"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"read_dir\",\"stat\",\"lstat\",\"fstat\",\"exists\"],\"deny\":[]}},\"read-files\":{\"identifier\":\"read-files\",\"description\":\"This enables file read related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"read_file\",\"read\",\"open\",\"read_text_file\",\"read_text_file_lines\",\"read_text_file_lines_next\",\"seek\",\"stat\",\"lstat\",\"fstat\",\"exists\"],\"deny\":[]}},\"read-meta\":{\"identifier\":\"read-meta\",\"description\":\"This enables all index or metadata related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"read_dir\",\"stat\",\"lstat\",\"fstat\",\"exists\",\"size\"],\"deny\":[]}},\"scope\":{\"identifier\":\"scope\",\"description\":\"An empty permission you can use to modify the global scope.\",\"commands\":{\"allow\":[],\"deny\":[]}},\"scope-app\":{\"identifier\":\"scope-app\",\"description\":\"This scope permits access to all files and list content of top level directories in the application folders.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"},{\"path\":\"$APPCONFIG/*\"},{\"path\":\"$APPDATA\"},{\"path\":\"$APPDATA/*\"},{\"path\":\"$APPLOCALDATA\"},{\"path\":\"$APPLOCALDATA/*\"},{\"path\":\"$APPCACHE\"},{\"path\":\"$APPCACHE/*\"},{\"path\":\"$APPLOG\"},{\"path\":\"$APPLOG/*\"}]}},\"scope-app-index\":{\"identifier\":\"scope-app-index\",\"description\":\"This scope permits to list all files and folders in the application directories.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"},{\"path\":\"$APPDATA\"},{\"path\":\"$APPLOCALDATA\"},{\"path\":\"$APPCACHE\"},{\"path\":\"$APPLOG\"}]}},\"scope-app-recursive\":{\"identifier\":\"scope-app-recursive\",\"description\":\"This scope permits recursive access to the complete application folders, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"},{\"path\":\"$APPCONFIG/**\"},{\"path\":\"$APPDATA\"},{\"path\":\"$APPDATA/**\"},{\"path\":\"$APPLOCALDATA\"},{\"path\":\"$APPLOCALDATA/**\"},{\"path\":\"$APPCACHE\"},{\"path\":\"$APPCACHE/**\"},{\"path\":\"$APPLOG\"},{\"path\":\"$APPLOG/**\"}]}},\"scope-appcache\":{\"identifier\":\"scope-appcache\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCACHE\"},{\"path\":\"$APPCACHE/*\"}]}},\"scope-appcache-index\":{\"identifier\":\"scope-appcache-index\",\"description\":\"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCACHE\"}]}},\"scope-appcache-recursive\":{\"identifier\":\"scope-appcache-recursive\",\"description\":\"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCACHE\"},{\"path\":\"$APPCACHE/**\"}]}},\"scope-appconfig\":{\"identifier\":\"scope-appconfig\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"},{\"path\":\"$APPCONFIG/*\"}]}},\"scope-appconfig-index\":{\"identifier\":\"scope-appconfig-index\",\"description\":\"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"}]}},\"scope-appconfig-recursive\":{\"identifier\":\"scope-appconfig-recursive\",\"description\":\"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPCONFIG\"},{\"path\":\"$APPCONFIG/**\"}]}},\"scope-appdata\":{\"identifier\":\"scope-appdata\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPDATA\"},{\"path\":\"$APPDATA/*\"}]}},\"scope-appdata-index\":{\"identifier\":\"scope-appdata-index\",\"description\":\"This scope permits to list all files and folders in the `$APPDATA`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPDATA\"}]}},\"scope-appdata-recursive\":{\"identifier\":\"scope-appdata-recursive\",\"description\":\"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPDATA\"},{\"path\":\"$APPDATA/**\"}]}},\"scope-applocaldata\":{\"identifier\":\"scope-applocaldata\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOCALDATA\"},{\"path\":\"$APPLOCALDATA/*\"}]}},\"scope-applocaldata-index\":{\"identifier\":\"scope-applocaldata-index\",\"description\":\"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOCALDATA\"}]}},\"scope-applocaldata-recursive\":{\"identifier\":\"scope-applocaldata-recursive\",\"description\":\"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOCALDATA\"},{\"path\":\"$APPLOCALDATA/**\"}]}},\"scope-applog\":{\"identifier\":\"scope-applog\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOG\"},{\"path\":\"$APPLOG/*\"}]}},\"scope-applog-index\":{\"identifier\":\"scope-applog-index\",\"description\":\"This scope permits to list all files and folders in the `$APPLOG`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOG\"}]}},\"scope-applog-recursive\":{\"identifier\":\"scope-applog-recursive\",\"description\":\"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$APPLOG\"},{\"path\":\"$APPLOG/**\"}]}},\"scope-audio\":{\"identifier\":\"scope-audio\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$AUDIO\"},{\"path\":\"$AUDIO/*\"}]}},\"scope-audio-index\":{\"identifier\":\"scope-audio-index\",\"description\":\"This scope permits to list all files and folders in the `$AUDIO`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$AUDIO\"}]}},\"scope-audio-recursive\":{\"identifier\":\"scope-audio-recursive\",\"description\":\"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$AUDIO\"},{\"path\":\"$AUDIO/**\"}]}},\"scope-cache\":{\"identifier\":\"scope-cache\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CACHE\"},{\"path\":\"$CACHE/*\"}]}},\"scope-cache-index\":{\"identifier\":\"scope-cache-index\",\"description\":\"This scope permits to list all files and folders in the `$CACHE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CACHE\"}]}},\"scope-cache-recursive\":{\"identifier\":\"scope-cache-recursive\",\"description\":\"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CACHE\"},{\"path\":\"$CACHE/**\"}]}},\"scope-config\":{\"identifier\":\"scope-config\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CONFIG\"},{\"path\":\"$CONFIG/*\"}]}},\"scope-config-index\":{\"identifier\":\"scope-config-index\",\"description\":\"This scope permits to list all files and folders in the `$CONFIG`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CONFIG\"}]}},\"scope-config-recursive\":{\"identifier\":\"scope-config-recursive\",\"description\":\"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$CONFIG\"},{\"path\":\"$CONFIG/**\"}]}},\"scope-data\":{\"identifier\":\"scope-data\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DATA\"},{\"path\":\"$DATA/*\"}]}},\"scope-data-index\":{\"identifier\":\"scope-data-index\",\"description\":\"This scope permits to list all files and folders in the `$DATA`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DATA\"}]}},\"scope-data-recursive\":{\"identifier\":\"scope-data-recursive\",\"description\":\"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DATA\"},{\"path\":\"$DATA/**\"}]}},\"scope-desktop\":{\"identifier\":\"scope-desktop\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DESKTOP\"},{\"path\":\"$DESKTOP/*\"}]}},\"scope-desktop-index\":{\"identifier\":\"scope-desktop-index\",\"description\":\"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DESKTOP\"}]}},\"scope-desktop-recursive\":{\"identifier\":\"scope-desktop-recursive\",\"description\":\"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DESKTOP\"},{\"path\":\"$DESKTOP/**\"}]}},\"scope-document\":{\"identifier\":\"scope-document\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOCUMENT\"},{\"path\":\"$DOCUMENT/*\"}]}},\"scope-document-index\":{\"identifier\":\"scope-document-index\",\"description\":\"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOCUMENT\"}]}},\"scope-document-recursive\":{\"identifier\":\"scope-document-recursive\",\"description\":\"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOCUMENT\"},{\"path\":\"$DOCUMENT/**\"}]}},\"scope-download\":{\"identifier\":\"scope-download\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOWNLOAD\"},{\"path\":\"$DOWNLOAD/*\"}]}},\"scope-download-index\":{\"identifier\":\"scope-download-index\",\"description\":\"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOWNLOAD\"}]}},\"scope-download-recursive\":{\"identifier\":\"scope-download-recursive\",\"description\":\"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$DOWNLOAD\"},{\"path\":\"$DOWNLOAD/**\"}]}},\"scope-exe\":{\"identifier\":\"scope-exe\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$EXE\"},{\"path\":\"$EXE/*\"}]}},\"scope-exe-index\":{\"identifier\":\"scope-exe-index\",\"description\":\"This scope permits to list all files and folders in the `$EXE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$EXE\"}]}},\"scope-exe-recursive\":{\"identifier\":\"scope-exe-recursive\",\"description\":\"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$EXE\"},{\"path\":\"$EXE/**\"}]}},\"scope-font\":{\"identifier\":\"scope-font\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$FONT\"},{\"path\":\"$FONT/*\"}]}},\"scope-font-index\":{\"identifier\":\"scope-font-index\",\"description\":\"This scope permits to list all files and folders in the `$FONT`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$FONT\"}]}},\"scope-font-recursive\":{\"identifier\":\"scope-font-recursive\",\"description\":\"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$FONT\"},{\"path\":\"$FONT/**\"}]}},\"scope-home\":{\"identifier\":\"scope-home\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$HOME\"},{\"path\":\"$HOME/*\"}]}},\"scope-home-index\":{\"identifier\":\"scope-home-index\",\"description\":\"This scope permits to list all files and folders in the `$HOME`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$HOME\"}]}},\"scope-home-recursive\":{\"identifier\":\"scope-home-recursive\",\"description\":\"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$HOME\"},{\"path\":\"$HOME/**\"}]}},\"scope-localdata\":{\"identifier\":\"scope-localdata\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOCALDATA\"},{\"path\":\"$LOCALDATA/*\"}]}},\"scope-localdata-index\":{\"identifier\":\"scope-localdata-index\",\"description\":\"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOCALDATA\"}]}},\"scope-localdata-recursive\":{\"identifier\":\"scope-localdata-recursive\",\"description\":\"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOCALDATA\"},{\"path\":\"$LOCALDATA/**\"}]}},\"scope-log\":{\"identifier\":\"scope-log\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOG\"},{\"path\":\"$LOG/*\"}]}},\"scope-log-index\":{\"identifier\":\"scope-log-index\",\"description\":\"This scope permits to list all files and folders in the `$LOG`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOG\"}]}},\"scope-log-recursive\":{\"identifier\":\"scope-log-recursive\",\"description\":\"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$LOG\"},{\"path\":\"$LOG/**\"}]}},\"scope-picture\":{\"identifier\":\"scope-picture\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PICTURE\"},{\"path\":\"$PICTURE/*\"}]}},\"scope-picture-index\":{\"identifier\":\"scope-picture-index\",\"description\":\"This scope permits to list all files and folders in the `$PICTURE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PICTURE\"}]}},\"scope-picture-recursive\":{\"identifier\":\"scope-picture-recursive\",\"description\":\"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PICTURE\"},{\"path\":\"$PICTURE/**\"}]}},\"scope-public\":{\"identifier\":\"scope-public\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PUBLIC\"},{\"path\":\"$PUBLIC/*\"}]}},\"scope-public-index\":{\"identifier\":\"scope-public-index\",\"description\":\"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PUBLIC\"}]}},\"scope-public-recursive\":{\"identifier\":\"scope-public-recursive\",\"description\":\"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$PUBLIC\"},{\"path\":\"$PUBLIC/**\"}]}},\"scope-resource\":{\"identifier\":\"scope-resource\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RESOURCE\"},{\"path\":\"$RESOURCE/*\"}]}},\"scope-resource-index\":{\"identifier\":\"scope-resource-index\",\"description\":\"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RESOURCE\"}]}},\"scope-resource-recursive\":{\"identifier\":\"scope-resource-recursive\",\"description\":\"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RESOURCE\"},{\"path\":\"$RESOURCE/**\"}]}},\"scope-runtime\":{\"identifier\":\"scope-runtime\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RUNTIME\"},{\"path\":\"$RUNTIME/*\"}]}},\"scope-runtime-index\":{\"identifier\":\"scope-runtime-index\",\"description\":\"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RUNTIME\"}]}},\"scope-runtime-recursive\":{\"identifier\":\"scope-runtime-recursive\",\"description\":\"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$RUNTIME\"},{\"path\":\"$RUNTIME/**\"}]}},\"scope-temp\":{\"identifier\":\"scope-temp\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMP\"},{\"path\":\"$TEMP/*\"}]}},\"scope-temp-index\":{\"identifier\":\"scope-temp-index\",\"description\":\"This scope permits to list all files and folders in the `$TEMP`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMP\"}]}},\"scope-temp-recursive\":{\"identifier\":\"scope-temp-recursive\",\"description\":\"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMP\"},{\"path\":\"$TEMP/**\"}]}},\"scope-template\":{\"identifier\":\"scope-template\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMPLATE\"},{\"path\":\"$TEMPLATE/*\"}]}},\"scope-template-index\":{\"identifier\":\"scope-template-index\",\"description\":\"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMPLATE\"}]}},\"scope-template-recursive\":{\"identifier\":\"scope-template-recursive\",\"description\":\"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$TEMPLATE\"},{\"path\":\"$TEMPLATE/**\"}]}},\"scope-video\":{\"identifier\":\"scope-video\",\"description\":\"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$VIDEO\"},{\"path\":\"$VIDEO/*\"}]}},\"scope-video-index\":{\"identifier\":\"scope-video-index\",\"description\":\"This scope permits to list all files and folders in the `$VIDEO`folder.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$VIDEO\"}]}},\"scope-video-recursive\":{\"identifier\":\"scope-video-recursive\",\"description\":\"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\"commands\":{\"allow\":[],\"deny\":[]},\"scope\":{\"allow\":[{\"path\":\"$VIDEO\"},{\"path\":\"$VIDEO/**\"}]}},\"write-all\":{\"identifier\":\"write-all\",\"description\":\"This enables all write related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"mkdir\",\"create\",\"copy_file\",\"remove\",\"rename\",\"truncate\",\"ftruncate\",\"write\",\"write_file\",\"write_text_file\"],\"deny\":[]}},\"write-files\":{\"identifier\":\"write-files\",\"description\":\"This enables all file write related commands without any pre-configured accessible paths.\",\"commands\":{\"allow\":[\"create\",\"copy_file\",\"remove\",\"rename\",\"truncate\",\"ftruncate\",\"write\",\"write_file\",\"write_text_file\"],\"deny\":[]}}},\"permission_sets\":{\"allow-app-meta\":{\"identifier\":\"allow-app-meta\",\"description\":\"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-app-index\"]},\"allow-app-meta-recursive\":{\"identifier\":\"allow-app-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-app-recursive\"]},\"allow-app-read\":{\"identifier\":\"allow-app-read\",\"description\":\"This allows non-recursive read access to the application folders.\",\"permissions\":[\"read-all\",\"scope-app\"]},\"allow-app-read-recursive\":{\"identifier\":\"allow-app-read-recursive\",\"description\":\"This allows full recursive read access to the complete application folders, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-app-recursive\"]},\"allow-app-write\":{\"identifier\":\"allow-app-write\",\"description\":\"This allows non-recursive write access to the application folders.\",\"permissions\":[\"write-all\",\"scope-app\"]},\"allow-app-write-recursive\":{\"identifier\":\"allow-app-write-recursive\",\"description\":\"This allows full recursive write access to the complete application folders, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-app-recursive\"]},\"allow-appcache-meta\":{\"identifier\":\"allow-appcache-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appcache-index\"]},\"allow-appcache-meta-recursive\":{\"identifier\":\"allow-appcache-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appcache-recursive\"]},\"allow-appcache-read\":{\"identifier\":\"allow-appcache-read\",\"description\":\"This allows non-recursive read access to the `$APPCACHE` folder.\",\"permissions\":[\"read-all\",\"scope-appcache\"]},\"allow-appcache-read-recursive\":{\"identifier\":\"allow-appcache-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-appcache-recursive\"]},\"allow-appcache-write\":{\"identifier\":\"allow-appcache-write\",\"description\":\"This allows non-recursive write access to the `$APPCACHE` folder.\",\"permissions\":[\"write-all\",\"scope-appcache\"]},\"allow-appcache-write-recursive\":{\"identifier\":\"allow-appcache-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-appcache-recursive\"]},\"allow-appconfig-meta\":{\"identifier\":\"allow-appconfig-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appconfig-index\"]},\"allow-appconfig-meta-recursive\":{\"identifier\":\"allow-appconfig-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appconfig-recursive\"]},\"allow-appconfig-read\":{\"identifier\":\"allow-appconfig-read\",\"description\":\"This allows non-recursive read access to the `$APPCONFIG` folder.\",\"permissions\":[\"read-all\",\"scope-appconfig\"]},\"allow-appconfig-read-recursive\":{\"identifier\":\"allow-appconfig-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-appconfig-recursive\"]},\"allow-appconfig-write\":{\"identifier\":\"allow-appconfig-write\",\"description\":\"This allows non-recursive write access to the `$APPCONFIG` folder.\",\"permissions\":[\"write-all\",\"scope-appconfig\"]},\"allow-appconfig-write-recursive\":{\"identifier\":\"allow-appconfig-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-appconfig-recursive\"]},\"allow-appdata-meta\":{\"identifier\":\"allow-appdata-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appdata-index\"]},\"allow-appdata-meta-recursive\":{\"identifier\":\"allow-appdata-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-appdata-recursive\"]},\"allow-appdata-read\":{\"identifier\":\"allow-appdata-read\",\"description\":\"This allows non-recursive read access to the `$APPDATA` folder.\",\"permissions\":[\"read-all\",\"scope-appdata\"]},\"allow-appdata-read-recursive\":{\"identifier\":\"allow-appdata-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-appdata-recursive\"]},\"allow-appdata-write\":{\"identifier\":\"allow-appdata-write\",\"description\":\"This allows non-recursive write access to the `$APPDATA` folder.\",\"permissions\":[\"write-all\",\"scope-appdata\"]},\"allow-appdata-write-recursive\":{\"identifier\":\"allow-appdata-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-appdata-recursive\"]},\"allow-applocaldata-meta\":{\"identifier\":\"allow-applocaldata-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-applocaldata-index\"]},\"allow-applocaldata-meta-recursive\":{\"identifier\":\"allow-applocaldata-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-applocaldata-recursive\"]},\"allow-applocaldata-read\":{\"identifier\":\"allow-applocaldata-read\",\"description\":\"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\"permissions\":[\"read-all\",\"scope-applocaldata\"]},\"allow-applocaldata-read-recursive\":{\"identifier\":\"allow-applocaldata-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-applocaldata-recursive\"]},\"allow-applocaldata-write\":{\"identifier\":\"allow-applocaldata-write\",\"description\":\"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\"permissions\":[\"write-all\",\"scope-applocaldata\"]},\"allow-applocaldata-write-recursive\":{\"identifier\":\"allow-applocaldata-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-applocaldata-recursive\"]},\"allow-applog-meta\":{\"identifier\":\"allow-applog-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-applog-index\"]},\"allow-applog-meta-recursive\":{\"identifier\":\"allow-applog-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-applog-recursive\"]},\"allow-applog-read\":{\"identifier\":\"allow-applog-read\",\"description\":\"This allows non-recursive read access to the `$APPLOG` folder.\",\"permissions\":[\"read-all\",\"scope-applog\"]},\"allow-applog-read-recursive\":{\"identifier\":\"allow-applog-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-applog-recursive\"]},\"allow-applog-write\":{\"identifier\":\"allow-applog-write\",\"description\":\"This allows non-recursive write access to the `$APPLOG` folder.\",\"permissions\":[\"write-all\",\"scope-applog\"]},\"allow-applog-write-recursive\":{\"identifier\":\"allow-applog-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-applog-recursive\"]},\"allow-audio-meta\":{\"identifier\":\"allow-audio-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-audio-index\"]},\"allow-audio-meta-recursive\":{\"identifier\":\"allow-audio-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-audio-recursive\"]},\"allow-audio-read\":{\"identifier\":\"allow-audio-read\",\"description\":\"This allows non-recursive read access to the `$AUDIO` folder.\",\"permissions\":[\"read-all\",\"scope-audio\"]},\"allow-audio-read-recursive\":{\"identifier\":\"allow-audio-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-audio-recursive\"]},\"allow-audio-write\":{\"identifier\":\"allow-audio-write\",\"description\":\"This allows non-recursive write access to the `$AUDIO` folder.\",\"permissions\":[\"write-all\",\"scope-audio\"]},\"allow-audio-write-recursive\":{\"identifier\":\"allow-audio-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-audio-recursive\"]},\"allow-cache-meta\":{\"identifier\":\"allow-cache-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-cache-index\"]},\"allow-cache-meta-recursive\":{\"identifier\":\"allow-cache-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-cache-recursive\"]},\"allow-cache-read\":{\"identifier\":\"allow-cache-read\",\"description\":\"This allows non-recursive read access to the `$CACHE` folder.\",\"permissions\":[\"read-all\",\"scope-cache\"]},\"allow-cache-read-recursive\":{\"identifier\":\"allow-cache-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-cache-recursive\"]},\"allow-cache-write\":{\"identifier\":\"allow-cache-write\",\"description\":\"This allows non-recursive write access to the `$CACHE` folder.\",\"permissions\":[\"write-all\",\"scope-cache\"]},\"allow-cache-write-recursive\":{\"identifier\":\"allow-cache-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-cache-recursive\"]},\"allow-config-meta\":{\"identifier\":\"allow-config-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-config-index\"]},\"allow-config-meta-recursive\":{\"identifier\":\"allow-config-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-config-recursive\"]},\"allow-config-read\":{\"identifier\":\"allow-config-read\",\"description\":\"This allows non-recursive read access to the `$CONFIG` folder.\",\"permissions\":[\"read-all\",\"scope-config\"]},\"allow-config-read-recursive\":{\"identifier\":\"allow-config-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-config-recursive\"]},\"allow-config-write\":{\"identifier\":\"allow-config-write\",\"description\":\"This allows non-recursive write access to the `$CONFIG` folder.\",\"permissions\":[\"write-all\",\"scope-config\"]},\"allow-config-write-recursive\":{\"identifier\":\"allow-config-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-config-recursive\"]},\"allow-data-meta\":{\"identifier\":\"allow-data-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-data-index\"]},\"allow-data-meta-recursive\":{\"identifier\":\"allow-data-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-data-recursive\"]},\"allow-data-read\":{\"identifier\":\"allow-data-read\",\"description\":\"This allows non-recursive read access to the `$DATA` folder.\",\"permissions\":[\"read-all\",\"scope-data\"]},\"allow-data-read-recursive\":{\"identifier\":\"allow-data-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-data-recursive\"]},\"allow-data-write\":{\"identifier\":\"allow-data-write\",\"description\":\"This allows non-recursive write access to the `$DATA` folder.\",\"permissions\":[\"write-all\",\"scope-data\"]},\"allow-data-write-recursive\":{\"identifier\":\"allow-data-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-data-recursive\"]},\"allow-desktop-meta\":{\"identifier\":\"allow-desktop-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-desktop-index\"]},\"allow-desktop-meta-recursive\":{\"identifier\":\"allow-desktop-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-desktop-recursive\"]},\"allow-desktop-read\":{\"identifier\":\"allow-desktop-read\",\"description\":\"This allows non-recursive read access to the `$DESKTOP` folder.\",\"permissions\":[\"read-all\",\"scope-desktop\"]},\"allow-desktop-read-recursive\":{\"identifier\":\"allow-desktop-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-desktop-recursive\"]},\"allow-desktop-write\":{\"identifier\":\"allow-desktop-write\",\"description\":\"This allows non-recursive write access to the `$DESKTOP` folder.\",\"permissions\":[\"write-all\",\"scope-desktop\"]},\"allow-desktop-write-recursive\":{\"identifier\":\"allow-desktop-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-desktop-recursive\"]},\"allow-document-meta\":{\"identifier\":\"allow-document-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-document-index\"]},\"allow-document-meta-recursive\":{\"identifier\":\"allow-document-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-document-recursive\"]},\"allow-document-read\":{\"identifier\":\"allow-document-read\",\"description\":\"This allows non-recursive read access to the `$DOCUMENT` folder.\",\"permissions\":[\"read-all\",\"scope-document\"]},\"allow-document-read-recursive\":{\"identifier\":\"allow-document-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-document-recursive\"]},\"allow-document-write\":{\"identifier\":\"allow-document-write\",\"description\":\"This allows non-recursive write access to the `$DOCUMENT` folder.\",\"permissions\":[\"write-all\",\"scope-document\"]},\"allow-document-write-recursive\":{\"identifier\":\"allow-document-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-document-recursive\"]},\"allow-download-meta\":{\"identifier\":\"allow-download-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-download-index\"]},\"allow-download-meta-recursive\":{\"identifier\":\"allow-download-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-download-recursive\"]},\"allow-download-read\":{\"identifier\":\"allow-download-read\",\"description\":\"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\"permissions\":[\"read-all\",\"scope-download\"]},\"allow-download-read-recursive\":{\"identifier\":\"allow-download-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-download-recursive\"]},\"allow-download-write\":{\"identifier\":\"allow-download-write\",\"description\":\"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\"permissions\":[\"write-all\",\"scope-download\"]},\"allow-download-write-recursive\":{\"identifier\":\"allow-download-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-download-recursive\"]},\"allow-exe-meta\":{\"identifier\":\"allow-exe-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-exe-index\"]},\"allow-exe-meta-recursive\":{\"identifier\":\"allow-exe-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-exe-recursive\"]},\"allow-exe-read\":{\"identifier\":\"allow-exe-read\",\"description\":\"This allows non-recursive read access to the `$EXE` folder.\",\"permissions\":[\"read-all\",\"scope-exe\"]},\"allow-exe-read-recursive\":{\"identifier\":\"allow-exe-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-exe-recursive\"]},\"allow-exe-write\":{\"identifier\":\"allow-exe-write\",\"description\":\"This allows non-recursive write access to the `$EXE` folder.\",\"permissions\":[\"write-all\",\"scope-exe\"]},\"allow-exe-write-recursive\":{\"identifier\":\"allow-exe-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-exe-recursive\"]},\"allow-font-meta\":{\"identifier\":\"allow-font-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-font-index\"]},\"allow-font-meta-recursive\":{\"identifier\":\"allow-font-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-font-recursive\"]},\"allow-font-read\":{\"identifier\":\"allow-font-read\",\"description\":\"This allows non-recursive read access to the `$FONT` folder.\",\"permissions\":[\"read-all\",\"scope-font\"]},\"allow-font-read-recursive\":{\"identifier\":\"allow-font-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-font-recursive\"]},\"allow-font-write\":{\"identifier\":\"allow-font-write\",\"description\":\"This allows non-recursive write access to the `$FONT` folder.\",\"permissions\":[\"write-all\",\"scope-font\"]},\"allow-font-write-recursive\":{\"identifier\":\"allow-font-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-font-recursive\"]},\"allow-home-meta\":{\"identifier\":\"allow-home-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-home-index\"]},\"allow-home-meta-recursive\":{\"identifier\":\"allow-home-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-home-recursive\"]},\"allow-home-read\":{\"identifier\":\"allow-home-read\",\"description\":\"This allows non-recursive read access to the `$HOME` folder.\",\"permissions\":[\"read-all\",\"scope-home\"]},\"allow-home-read-recursive\":{\"identifier\":\"allow-home-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-home-recursive\"]},\"allow-home-write\":{\"identifier\":\"allow-home-write\",\"description\":\"This allows non-recursive write access to the `$HOME` folder.\",\"permissions\":[\"write-all\",\"scope-home\"]},\"allow-home-write-recursive\":{\"identifier\":\"allow-home-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-home-recursive\"]},\"allow-localdata-meta\":{\"identifier\":\"allow-localdata-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-localdata-index\"]},\"allow-localdata-meta-recursive\":{\"identifier\":\"allow-localdata-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-localdata-recursive\"]},\"allow-localdata-read\":{\"identifier\":\"allow-localdata-read\",\"description\":\"This allows non-recursive read access to the `$LOCALDATA` folder.\",\"permissions\":[\"read-all\",\"scope-localdata\"]},\"allow-localdata-read-recursive\":{\"identifier\":\"allow-localdata-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-localdata-recursive\"]},\"allow-localdata-write\":{\"identifier\":\"allow-localdata-write\",\"description\":\"This allows non-recursive write access to the `$LOCALDATA` folder.\",\"permissions\":[\"write-all\",\"scope-localdata\"]},\"allow-localdata-write-recursive\":{\"identifier\":\"allow-localdata-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-localdata-recursive\"]},\"allow-log-meta\":{\"identifier\":\"allow-log-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-log-index\"]},\"allow-log-meta-recursive\":{\"identifier\":\"allow-log-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-log-recursive\"]},\"allow-log-read\":{\"identifier\":\"allow-log-read\",\"description\":\"This allows non-recursive read access to the `$LOG` folder.\",\"permissions\":[\"read-all\",\"scope-log\"]},\"allow-log-read-recursive\":{\"identifier\":\"allow-log-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-log-recursive\"]},\"allow-log-write\":{\"identifier\":\"allow-log-write\",\"description\":\"This allows non-recursive write access to the `$LOG` folder.\",\"permissions\":[\"write-all\",\"scope-log\"]},\"allow-log-write-recursive\":{\"identifier\":\"allow-log-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-log-recursive\"]},\"allow-picture-meta\":{\"identifier\":\"allow-picture-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-picture-index\"]},\"allow-picture-meta-recursive\":{\"identifier\":\"allow-picture-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-picture-recursive\"]},\"allow-picture-read\":{\"identifier\":\"allow-picture-read\",\"description\":\"This allows non-recursive read access to the `$PICTURE` folder.\",\"permissions\":[\"read-all\",\"scope-picture\"]},\"allow-picture-read-recursive\":{\"identifier\":\"allow-picture-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-picture-recursive\"]},\"allow-picture-write\":{\"identifier\":\"allow-picture-write\",\"description\":\"This allows non-recursive write access to the `$PICTURE` folder.\",\"permissions\":[\"write-all\",\"scope-picture\"]},\"allow-picture-write-recursive\":{\"identifier\":\"allow-picture-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-picture-recursive\"]},\"allow-public-meta\":{\"identifier\":\"allow-public-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-public-index\"]},\"allow-public-meta-recursive\":{\"identifier\":\"allow-public-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-public-recursive\"]},\"allow-public-read\":{\"identifier\":\"allow-public-read\",\"description\":\"This allows non-recursive read access to the `$PUBLIC` folder.\",\"permissions\":[\"read-all\",\"scope-public\"]},\"allow-public-read-recursive\":{\"identifier\":\"allow-public-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-public-recursive\"]},\"allow-public-write\":{\"identifier\":\"allow-public-write\",\"description\":\"This allows non-recursive write access to the `$PUBLIC` folder.\",\"permissions\":[\"write-all\",\"scope-public\"]},\"allow-public-write-recursive\":{\"identifier\":\"allow-public-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-public-recursive\"]},\"allow-resource-meta\":{\"identifier\":\"allow-resource-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-resource-index\"]},\"allow-resource-meta-recursive\":{\"identifier\":\"allow-resource-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-resource-recursive\"]},\"allow-resource-read\":{\"identifier\":\"allow-resource-read\",\"description\":\"This allows non-recursive read access to the `$RESOURCE` folder.\",\"permissions\":[\"read-all\",\"scope-resource\"]},\"allow-resource-read-recursive\":{\"identifier\":\"allow-resource-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-resource-recursive\"]},\"allow-resource-write\":{\"identifier\":\"allow-resource-write\",\"description\":\"This allows non-recursive write access to the `$RESOURCE` folder.\",\"permissions\":[\"write-all\",\"scope-resource\"]},\"allow-resource-write-recursive\":{\"identifier\":\"allow-resource-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-resource-recursive\"]},\"allow-runtime-meta\":{\"identifier\":\"allow-runtime-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-runtime-index\"]},\"allow-runtime-meta-recursive\":{\"identifier\":\"allow-runtime-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-runtime-recursive\"]},\"allow-runtime-read\":{\"identifier\":\"allow-runtime-read\",\"description\":\"This allows non-recursive read access to the `$RUNTIME` folder.\",\"permissions\":[\"read-all\",\"scope-runtime\"]},\"allow-runtime-read-recursive\":{\"identifier\":\"allow-runtime-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-runtime-recursive\"]},\"allow-runtime-write\":{\"identifier\":\"allow-runtime-write\",\"description\":\"This allows non-recursive write access to the `$RUNTIME` folder.\",\"permissions\":[\"write-all\",\"scope-runtime\"]},\"allow-runtime-write-recursive\":{\"identifier\":\"allow-runtime-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-runtime-recursive\"]},\"allow-temp-meta\":{\"identifier\":\"allow-temp-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-temp-index\"]},\"allow-temp-meta-recursive\":{\"identifier\":\"allow-temp-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-temp-recursive\"]},\"allow-temp-read\":{\"identifier\":\"allow-temp-read\",\"description\":\"This allows non-recursive read access to the `$TEMP` folder.\",\"permissions\":[\"read-all\",\"scope-temp\"]},\"allow-temp-read-recursive\":{\"identifier\":\"allow-temp-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-temp-recursive\"]},\"allow-temp-write\":{\"identifier\":\"allow-temp-write\",\"description\":\"This allows non-recursive write access to the `$TEMP` folder.\",\"permissions\":[\"write-all\",\"scope-temp\"]},\"allow-temp-write-recursive\":{\"identifier\":\"allow-temp-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-temp-recursive\"]},\"allow-template-meta\":{\"identifier\":\"allow-template-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-template-index\"]},\"allow-template-meta-recursive\":{\"identifier\":\"allow-template-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-template-recursive\"]},\"allow-template-read\":{\"identifier\":\"allow-template-read\",\"description\":\"This allows non-recursive read access to the `$TEMPLATE` folder.\",\"permissions\":[\"read-all\",\"scope-template\"]},\"allow-template-read-recursive\":{\"identifier\":\"allow-template-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-template-recursive\"]},\"allow-template-write\":{\"identifier\":\"allow-template-write\",\"description\":\"This allows non-recursive write access to the `$TEMPLATE` folder.\",\"permissions\":[\"write-all\",\"scope-template\"]},\"allow-template-write-recursive\":{\"identifier\":\"allow-template-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-template-recursive\"]},\"allow-video-meta\":{\"identifier\":\"allow-video-meta\",\"description\":\"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-video-index\"]},\"allow-video-meta-recursive\":{\"identifier\":\"allow-video-meta-recursive\",\"description\":\"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\"permissions\":[\"read-meta\",\"scope-video-recursive\"]},\"allow-video-read\":{\"identifier\":\"allow-video-read\",\"description\":\"This allows non-recursive read access to the `$VIDEO` folder.\",\"permissions\":[\"read-all\",\"scope-video\"]},\"allow-video-read-recursive\":{\"identifier\":\"allow-video-read-recursive\",\"description\":\"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\"permissions\":[\"read-all\",\"scope-video-recursive\"]},\"allow-video-write\":{\"identifier\":\"allow-video-write\",\"description\":\"This allows non-recursive write access to the `$VIDEO` folder.\",\"permissions\":[\"write-all\",\"scope-video\"]},\"allow-video-write-recursive\":{\"identifier\":\"allow-video-write-recursive\",\"description\":\"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\"permissions\":[\"write-all\",\"scope-video-recursive\"]},\"deny-default\":{\"identifier\":\"deny-default\",\"description\":\"This denies access to dangerous Tauri relevant files and folders by default.\",\"permissions\":[\"deny-webview-data-linux\",\"deny-webview-data-windows\"]}},\"global_scope_schema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"anyOf\":[{\"description\":\"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\"type\":\"string\"},{\"properties\":{\"path\":{\"description\":\"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}],\"description\":\"FS scope entry.\",\"title\":\"FsScopeEntry\"}},\"log\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"Allows the log command\",\"permissions\":[\"allow-log\"]},\"permissions\":{\"allow-log\":{\"identifier\":\"allow-log\",\"description\":\"Enables the log command without any pre-configured scope.\",\"commands\":{\"allow\":[\"log\"],\"deny\":[]}},\"deny-log\":{\"identifier\":\"deny-log\",\"description\":\"Denies the log command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"log\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"notification\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures which\\nnotification features are by default exposed.\\n\\n#### Granted Permissions\\n\\nIt allows all notification related features.\\n\\n\",\"permissions\":[\"allow-is-permission-granted\",\"allow-request-permission\",\"allow-notify\",\"allow-register-action-types\",\"allow-register-listener\",\"allow-cancel\",\"allow-get-pending\",\"allow-remove-active\",\"allow-get-active\",\"allow-check-permissions\",\"allow-show\",\"allow-batch\",\"allow-list-channels\",\"allow-delete-channel\",\"allow-create-channel\",\"allow-permission-state\"]},\"permissions\":{\"allow-batch\":{\"identifier\":\"allow-batch\",\"description\":\"Enables the batch command without any pre-configured scope.\",\"commands\":{\"allow\":[\"batch\"],\"deny\":[]}},\"allow-cancel\":{\"identifier\":\"allow-cancel\",\"description\":\"Enables the cancel command without any pre-configured scope.\",\"commands\":{\"allow\":[\"cancel\"],\"deny\":[]}},\"allow-check-permissions\":{\"identifier\":\"allow-check-permissions\",\"description\":\"Enables the check_permissions command without any pre-configured scope.\",\"commands\":{\"allow\":[\"check_permissions\"],\"deny\":[]}},\"allow-create-channel\":{\"identifier\":\"allow-create-channel\",\"description\":\"Enables the create_channel command without any pre-configured scope.\",\"commands\":{\"allow\":[\"create_channel\"],\"deny\":[]}},\"allow-delete-channel\":{\"identifier\":\"allow-delete-channel\",\"description\":\"Enables the delete_channel command without any pre-configured scope.\",\"commands\":{\"allow\":[\"delete_channel\"],\"deny\":[]}},\"allow-get-active\":{\"identifier\":\"allow-get-active\",\"description\":\"Enables the get_active command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_active\"],\"deny\":[]}},\"allow-get-pending\":{\"identifier\":\"allow-get-pending\",\"description\":\"Enables the get_pending command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_pending\"],\"deny\":[]}},\"allow-is-permission-granted\":{\"identifier\":\"allow-is-permission-granted\",\"description\":\"Enables the is_permission_granted command without any pre-configured scope.\",\"commands\":{\"allow\":[\"is_permission_granted\"],\"deny\":[]}},\"allow-list-channels\":{\"identifier\":\"allow-list-channels\",\"description\":\"Enables the list_channels command without any pre-configured scope.\",\"commands\":{\"allow\":[\"list_channels\"],\"deny\":[]}},\"allow-notify\":{\"identifier\":\"allow-notify\",\"description\":\"Enables the notify command without any pre-configured scope.\",\"commands\":{\"allow\":[\"notify\"],\"deny\":[]}},\"allow-permission-state\":{\"identifier\":\"allow-permission-state\",\"description\":\"Enables the permission_state command without any pre-configured scope.\",\"commands\":{\"allow\":[\"permission_state\"],\"deny\":[]}},\"allow-register-action-types\":{\"identifier\":\"allow-register-action-types\",\"description\":\"Enables the register_action_types command without any pre-configured scope.\",\"commands\":{\"allow\":[\"register_action_types\"],\"deny\":[]}},\"allow-register-listener\":{\"identifier\":\"allow-register-listener\",\"description\":\"Enables the register_listener command without any pre-configured scope.\",\"commands\":{\"allow\":[\"register_listener\"],\"deny\":[]}},\"allow-remove-active\":{\"identifier\":\"allow-remove-active\",\"description\":\"Enables the remove_active command without any pre-configured scope.\",\"commands\":{\"allow\":[\"remove_active\"],\"deny\":[]}},\"allow-request-permission\":{\"identifier\":\"allow-request-permission\",\"description\":\"Enables the request_permission command without any pre-configured scope.\",\"commands\":{\"allow\":[\"request_permission\"],\"deny\":[]}},\"allow-show\":{\"identifier\":\"allow-show\",\"description\":\"Enables the show command without any pre-configured scope.\",\"commands\":{\"allow\":[\"show\"],\"deny\":[]}},\"deny-batch\":{\"identifier\":\"deny-batch\",\"description\":\"Denies the batch command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"batch\"]}},\"deny-cancel\":{\"identifier\":\"deny-cancel\",\"description\":\"Denies the cancel command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"cancel\"]}},\"deny-check-permissions\":{\"identifier\":\"deny-check-permissions\",\"description\":\"Denies the check_permissions command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"check_permissions\"]}},\"deny-create-channel\":{\"identifier\":\"deny-create-channel\",\"description\":\"Denies the create_channel command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"create_channel\"]}},\"deny-delete-channel\":{\"identifier\":\"deny-delete-channel\",\"description\":\"Denies the delete_channel command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"delete_channel\"]}},\"deny-get-active\":{\"identifier\":\"deny-get-active\",\"description\":\"Denies the get_active command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_active\"]}},\"deny-get-pending\":{\"identifier\":\"deny-get-pending\",\"description\":\"Denies the get_pending command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_pending\"]}},\"deny-is-permission-granted\":{\"identifier\":\"deny-is-permission-granted\",\"description\":\"Denies the is_permission_granted command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"is_permission_granted\"]}},\"deny-list-channels\":{\"identifier\":\"deny-list-channels\",\"description\":\"Denies the list_channels command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"list_channels\"]}},\"deny-notify\":{\"identifier\":\"deny-notify\",\"description\":\"Denies the notify command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"notify\"]}},\"deny-permission-state\":{\"identifier\":\"deny-permission-state\",\"description\":\"Denies the permission_state command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"permission_state\"]}},\"deny-register-action-types\":{\"identifier\":\"deny-register-action-types\",\"description\":\"Denies the register_action_types command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"register_action_types\"]}},\"deny-register-listener\":{\"identifier\":\"deny-register-listener\",\"description\":\"Denies the register_listener command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"register_listener\"]}},\"deny-remove-active\":{\"identifier\":\"deny-remove-active\",\"description\":\"Denies the remove_active command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"remove_active\"]}},\"deny-request-permission\":{\"identifier\":\"deny-request-permission\",\"description\":\"Denies the request_permission command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"request_permission\"]}},\"deny-show\":{\"identifier\":\"deny-show\",\"description\":\"Denies the show command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"show\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"os\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures which\\noperating system information are available\\nto gather from the frontend.\\n\\n#### Granted Permissions\\n\\nAll information except the host name are available.\\n\\n\",\"permissions\":[\"allow-arch\",\"allow-exe-extension\",\"allow-family\",\"allow-locale\",\"allow-os-type\",\"allow-platform\",\"allow-version\"]},\"permissions\":{\"allow-arch\":{\"identifier\":\"allow-arch\",\"description\":\"Enables the arch command without any pre-configured scope.\",\"commands\":{\"allow\":[\"arch\"],\"deny\":[]}},\"allow-exe-extension\":{\"identifier\":\"allow-exe-extension\",\"description\":\"Enables the exe_extension command without any pre-configured scope.\",\"commands\":{\"allow\":[\"exe_extension\"],\"deny\":[]}},\"allow-family\":{\"identifier\":\"allow-family\",\"description\":\"Enables the family command without any pre-configured scope.\",\"commands\":{\"allow\":[\"family\"],\"deny\":[]}},\"allow-hostname\":{\"identifier\":\"allow-hostname\",\"description\":\"Enables the hostname command without any pre-configured scope.\",\"commands\":{\"allow\":[\"hostname\"],\"deny\":[]}},\"allow-locale\":{\"identifier\":\"allow-locale\",\"description\":\"Enables the locale command without any pre-configured scope.\",\"commands\":{\"allow\":[\"locale\"],\"deny\":[]}},\"allow-os-type\":{\"identifier\":\"allow-os-type\",\"description\":\"Enables the os_type command without any pre-configured scope.\",\"commands\":{\"allow\":[\"os_type\"],\"deny\":[]}},\"allow-platform\":{\"identifier\":\"allow-platform\",\"description\":\"Enables the platform command without any pre-configured scope.\",\"commands\":{\"allow\":[\"platform\"],\"deny\":[]}},\"allow-version\":{\"identifier\":\"allow-version\",\"description\":\"Enables the version command without any pre-configured scope.\",\"commands\":{\"allow\":[\"version\"],\"deny\":[]}},\"deny-arch\":{\"identifier\":\"deny-arch\",\"description\":\"Denies the arch command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"arch\"]}},\"deny-exe-extension\":{\"identifier\":\"deny-exe-extension\",\"description\":\"Denies the exe_extension command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"exe_extension\"]}},\"deny-family\":{\"identifier\":\"deny-family\",\"description\":\"Denies the family command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"family\"]}},\"deny-hostname\":{\"identifier\":\"deny-hostname\",\"description\":\"Denies the hostname command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"hostname\"]}},\"deny-locale\":{\"identifier\":\"deny-locale\",\"description\":\"Denies the locale command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"locale\"]}},\"deny-os-type\":{\"identifier\":\"deny-os-type\",\"description\":\"Denies the os_type command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"os_type\"]}},\"deny-platform\":{\"identifier\":\"deny-platform\",\"description\":\"Denies the platform command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"platform\"]}},\"deny-version\":{\"identifier\":\"deny-version\",\"description\":\"Denies the version command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"version\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"process\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures which\\nprocess feeatures are by default exposed.\\n\\n#### Granted Permissions\\n\\nThis enables to quit via `allow-exit` and restart via `allow-restart`\\nthe application.\\n\",\"permissions\":[\"allow-exit\",\"allow-restart\"]},\"permissions\":{\"allow-exit\":{\"identifier\":\"allow-exit\",\"description\":\"Enables the exit command without any pre-configured scope.\",\"commands\":{\"allow\":[\"exit\"],\"deny\":[]}},\"allow-restart\":{\"identifier\":\"allow-restart\",\"description\":\"Enables the restart command without any pre-configured scope.\",\"commands\":{\"allow\":[\"restart\"],\"deny\":[]}},\"deny-exit\":{\"identifier\":\"deny-exit\",\"description\":\"Denies the exit command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"exit\"]}},\"deny-restart\":{\"identifier\":\"deny-restart\",\"description\":\"Denies the restart command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"restart\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"shell\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\"permissions\":[\"allow-open\"]},\"permissions\":{\"allow-execute\":{\"identifier\":\"allow-execute\",\"description\":\"Enables the execute command without any pre-configured scope.\",\"commands\":{\"allow\":[\"execute\"],\"deny\":[]}},\"allow-kill\":{\"identifier\":\"allow-kill\",\"description\":\"Enables the kill command without any pre-configured scope.\",\"commands\":{\"allow\":[\"kill\"],\"deny\":[]}},\"allow-open\":{\"identifier\":\"allow-open\",\"description\":\"Enables the open command without any pre-configured scope.\",\"commands\":{\"allow\":[\"open\"],\"deny\":[]}},\"allow-spawn\":{\"identifier\":\"allow-spawn\",\"description\":\"Enables the spawn command without any pre-configured scope.\",\"commands\":{\"allow\":[\"spawn\"],\"deny\":[]}},\"allow-stdin-write\":{\"identifier\":\"allow-stdin-write\",\"description\":\"Enables the stdin_write command without any pre-configured scope.\",\"commands\":{\"allow\":[\"stdin_write\"],\"deny\":[]}},\"deny-execute\":{\"identifier\":\"deny-execute\",\"description\":\"Denies the execute command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"execute\"]}},\"deny-kill\":{\"identifier\":\"deny-kill\",\"description\":\"Denies the kill command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"kill\"]}},\"deny-open\":{\"identifier\":\"deny-open\",\"description\":\"Denies the open command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"open\"]}},\"deny-spawn\":{\"identifier\":\"deny-spawn\",\"description\":\"Denies the spawn command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"spawn\"]}},\"deny-stdin-write\":{\"identifier\":\"deny-stdin-write\",\"description\":\"Denies the stdin_write command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"stdin_write\"]}}},\"permission_sets\":{},\"global_scope_schema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"anyOf\":[{\"additionalProperties\":false,\"properties\":{\"args\":{\"allOf\":[{\"$ref\":\"#/definitions/ShellScopeEntryAllowedArgs\"}],\"description\":\"The allowed arguments for the command execution.\"},\"cmd\":{\"description\":\"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\"type\":\"string\"},\"name\":{\"description\":\"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\"type\":\"string\"}},\"required\":[\"cmd\",\"name\"],\"type\":\"object\"},{\"additionalProperties\":false,\"properties\":{\"args\":{\"allOf\":[{\"$ref\":\"#/definitions/ShellScopeEntryAllowedArgs\"}],\"description\":\"The allowed arguments for the command execution.\"},\"name\":{\"description\":\"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\"type\":\"string\"},\"sidecar\":{\"description\":\"If this command is a sidecar command.\",\"type\":\"boolean\"}},\"required\":[\"name\",\"sidecar\"],\"type\":\"object\"}],\"definitions\":{\"ShellScopeEntryAllowedArg\":{\"anyOf\":[{\"description\":\"A non-configurable argument that is passed to the command in the order it was specified.\",\"type\":\"string\"},{\"additionalProperties\":false,\"description\":\"A variable that is set while calling the command from the webview API.\",\"properties\":{\"raw\":{\"default\":false,\"description\":\"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\\n\\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.\",\"type\":\"boolean\"},\"validator\":{\"description\":\"[regex] validator to require passed values to conform to an expected input.\\n\\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\\n\\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\\\w+` regex would be registered as `^https?://\\\\w+$`.\\n\\n[regex]: <https://docs.rs/regex/latest/regex/#syntax>\",\"type\":\"string\"}},\"required\":[\"validator\"],\"type\":\"object\"}],\"description\":\"A command argument allowed to be executed by the webview API.\"},\"ShellScopeEntryAllowedArgs\":{\"anyOf\":[{\"description\":\"Use a simple boolean to allow all or disable all arguments to this command configuration.\",\"type\":\"boolean\"},{\"description\":\"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.\",\"items\":{\"$ref\":\"#/definitions/ShellScopeEntryAllowedArg\"},\"type\":\"array\"}],\"description\":\"A set of command arguments allowed to be executed by the webview API.\\n\\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.\"}},\"description\":\"Shell scope entry.\",\"title\":\"ShellScopeEntry\"}},\"store\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures what kind of\\noperations are available from the store plugin.\\n\\n#### Granted Permissions\\n\\nAll operations are enabled by default.\\n\\n\",\"permissions\":[\"allow-load\",\"allow-get-store\",\"allow-set\",\"allow-get\",\"allow-has\",\"allow-delete\",\"allow-clear\",\"allow-reset\",\"allow-keys\",\"allow-values\",\"allow-entries\",\"allow-length\",\"allow-reload\",\"allow-save\"]},\"permissions\":{\"allow-clear\":{\"identifier\":\"allow-clear\",\"description\":\"Enables the clear command without any pre-configured scope.\",\"commands\":{\"allow\":[\"clear\"],\"deny\":[]}},\"allow-delete\":{\"identifier\":\"allow-delete\",\"description\":\"Enables the delete command without any pre-configured scope.\",\"commands\":{\"allow\":[\"delete\"],\"deny\":[]}},\"allow-entries\":{\"identifier\":\"allow-entries\",\"description\":\"Enables the entries command without any pre-configured scope.\",\"commands\":{\"allow\":[\"entries\"],\"deny\":[]}},\"allow-get\":{\"identifier\":\"allow-get\",\"description\":\"Enables the get command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get\"],\"deny\":[]}},\"allow-get-store\":{\"identifier\":\"allow-get-store\",\"description\":\"Enables the get_store command without any pre-configured scope.\",\"commands\":{\"allow\":[\"get_store\"],\"deny\":[]}},\"allow-has\":{\"identifier\":\"allow-has\",\"description\":\"Enables the has command without any pre-configured scope.\",\"commands\":{\"allow\":[\"has\"],\"deny\":[]}},\"allow-keys\":{\"identifier\":\"allow-keys\",\"description\":\"Enables the keys command without any pre-configured scope.\",\"commands\":{\"allow\":[\"keys\"],\"deny\":[]}},\"allow-length\":{\"identifier\":\"allow-length\",\"description\":\"Enables the length command without any pre-configured scope.\",\"commands\":{\"allow\":[\"length\"],\"deny\":[]}},\"allow-load\":{\"identifier\":\"allow-load\",\"description\":\"Enables the load command without any pre-configured scope.\",\"commands\":{\"allow\":[\"load\"],\"deny\":[]}},\"allow-reload\":{\"identifier\":\"allow-reload\",\"description\":\"Enables the reload command without any pre-configured scope.\",\"commands\":{\"allow\":[\"reload\"],\"deny\":[]}},\"allow-reset\":{\"identifier\":\"allow-reset\",\"description\":\"Enables the reset command without any pre-configured scope.\",\"commands\":{\"allow\":[\"reset\"],\"deny\":[]}},\"allow-save\":{\"identifier\":\"allow-save\",\"description\":\"Enables the save command without any pre-configured scope.\",\"commands\":{\"allow\":[\"save\"],\"deny\":[]}},\"allow-set\":{\"identifier\":\"allow-set\",\"description\":\"Enables the set command without any pre-configured scope.\",\"commands\":{\"allow\":[\"set\"],\"deny\":[]}},\"allow-values\":{\"identifier\":\"allow-values\",\"description\":\"Enables the values command without any pre-configured scope.\",\"commands\":{\"allow\":[\"values\"],\"deny\":[]}},\"deny-clear\":{\"identifier\":\"deny-clear\",\"description\":\"Denies the clear command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"clear\"]}},\"deny-delete\":{\"identifier\":\"deny-delete\",\"description\":\"Denies the delete command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"delete\"]}},\"deny-entries\":{\"identifier\":\"deny-entries\",\"description\":\"Denies the entries command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"entries\"]}},\"deny-get\":{\"identifier\":\"deny-get\",\"description\":\"Denies the get command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get\"]}},\"deny-get-store\":{\"identifier\":\"deny-get-store\",\"description\":\"Denies the get_store command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"get_store\"]}},\"deny-has\":{\"identifier\":\"deny-has\",\"description\":\"Denies the has command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"has\"]}},\"deny-keys\":{\"identifier\":\"deny-keys\",\"description\":\"Denies the keys command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"keys\"]}},\"deny-length\":{\"identifier\":\"deny-length\",\"description\":\"Denies the length command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"length\"]}},\"deny-load\":{\"identifier\":\"deny-load\",\"description\":\"Denies the load command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"load\"]}},\"deny-reload\":{\"identifier\":\"deny-reload\",\"description\":\"Denies the reload command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"reload\"]}},\"deny-reset\":{\"identifier\":\"deny-reset\",\"description\":\"Denies the reset command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"reset\"]}},\"deny-save\":{\"identifier\":\"deny-save\",\"description\":\"Denies the save command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"save\"]}},\"deny-set\":{\"identifier\":\"deny-set\",\"description\":\"Denies the set command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"set\"]}},\"deny-values\":{\"identifier\":\"deny-values\",\"description\":\"Denies the values command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"values\"]}}},\"permission_sets\":{},\"global_scope_schema\":null},\"updater\":{\"default_permission\":{\"identifier\":\"default\",\"description\":\"This permission set configures which kind of\\nupdater functions are exposed to the frontend.\\n\\n#### Granted Permissions\\n\\nThe full workflow from checking for updates to installing them\\nis enabled.\\n\\n\",\"permissions\":[\"allow-check\",\"allow-download\",\"allow-install\",\"allow-download-and-install\"]},\"permissions\":{\"allow-check\":{\"identifier\":\"allow-check\",\"description\":\"Enables the check command without any pre-configured scope.\",\"commands\":{\"allow\":[\"check\"],\"deny\":[]}},\"allow-download\":{\"identifier\":\"allow-download\",\"description\":\"Enables the download command without any pre-configured scope.\",\"commands\":{\"allow\":[\"download\"],\"deny\":[]}},\"allow-download-and-install\":{\"identifier\":\"allow-download-and-install\",\"description\":\"Enables the download_and_install command without any pre-configured scope.\",\"commands\":{\"allow\":[\"download_and_install\"],\"deny\":[]}},\"allow-install\":{\"identifier\":\"allow-install\",\"description\":\"Enables the install command without any pre-configured scope.\",\"commands\":{\"allow\":[\"install\"],\"deny\":[]}},\"deny-check\":{\"identifier\":\"deny-check\",\"description\":\"Denies the check command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"check\"]}},\"deny-download\":{\"identifier\":\"deny-download\",\"description\":\"Denies the download command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"download\"]}},\"deny-download-and-install\":{\"identifier\":\"deny-download-and-install\",\"description\":\"Denies the download_and_install command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"download_and_install\"]}},\"deny-install\":{\"identifier\":\"deny-install\",\"description\":\"Denies the install command without any pre-configured scope.\",\"commands\":{\"allow\":[],\"deny\":[\"install\"]}}},\"permission_sets\":{},\"global_scope_schema\":null}}"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/capabilities.json",
    "content": "{\"main\":{\"identifier\":\"main\",\"description\":\"Main capabilities\",\"local\":true,\"windows\":[\"main\"],\"permissions\":[\"core:default\",\"process:allow-exit\",\"process:allow-restart\",\"os:default\",\"shell:allow-open\",\"shell:allow-kill\",\"shell:allow-spawn\",{\"identifier\":\"shell:allow-execute\",\"allow\":[{\"args\":true,\"name\":\"bin/devpod-cli\",\"sidecar\":true},{\"args\":true,\"cmd\":\"/app/bin/devpod-cli\",\"name\":\"bin/devpod-cli\"},{\"args\":[\"version\"],\"cmd\":\"devpod\",\"name\":\"run-path-devpod-cli\"}]},{\"identifier\":\"shell:allow-spawn\",\"allow\":[{\"args\":true,\"name\":\"bin/devpod-cli\",\"sidecar\":true}]},{\"identifier\":\"shell:allow-kill\",\"allow\":[{\"args\":true,\"name\":\"bin/devpod-cli\",\"sidecar\":true}]},\"fs:default\",\"fs:allow-app-read-recursive\",\"fs:allow-app-write-recursive\",\"fs:allow-app-meta-recursive\",\"fs:allow-appdata-write-recursive\",\"fs:allow-appdata-read-recursive\",\"fs:allow-home-read-recursive\",\"fs:allow-home-write-recursive\",\"fs:allow-home-meta-recursive\",\"clipboard-manager:allow-write-text\",\"updater:default\",\"core:window:default\",\"core:window:allow-start-dragging\",\"core:window:allow-close\",\"core:window:allow-set-focus\",\"core:window:allow-unminimize\",\"notification:default\",\"store:allow-load\",\"store:default\",\"dialog:allow-save\",\"dialog:default\",\"log:default\",\"log:allow-log\"]},\"updater\":{\"identifier\":\"updater\",\"description\":\"Updater Capabilities\",\"local\":true,\"windows\":[\"update_ready\"],\"permissions\":[\"core:default\",\"process:allow-exit\",\"process:allow-restart\",\"core:window:default\",\"core:window:allow-close\",\"os:default\"]}}"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/desktop-schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"CapabilityFile\",\n  \"description\": \"Capability formats accepted in a capability file.\",\n  \"anyOf\": [\n    {\n      \"description\": \"A single capability.\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Capability\"\n        }\n      ]\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/Capability\"\n      }\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"capabilities\"\n      ],\n      \"properties\": {\n        \"capabilities\": {\n          \"description\": \"The list of capabilities.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Capability\"\n          }\n        }\n      }\n    }\n  ],\n  \"definitions\": {\n    \"Capability\": {\n      \"description\": \"A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\\n\\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\\n\\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\\n\\n## Example\\n\\n```json { \\\"identifier\\\": \\\"main-user-files-write\\\", \\\"description\\\": \\\"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\\\", \\\"windows\\\": [ \\\"main\\\" ], \\\"permissions\\\": [ \\\"core:default\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] }, ], \\\"platforms\\\": [\\\"macOS\\\",\\\"windows\\\"] } ```\",\n      \"type\": \"object\",\n      \"required\": [\n        \"identifier\",\n        \"permissions\"\n      ],\n      \"properties\": {\n        \"identifier\": {\n          \"description\": \"Identifier of the capability.\\n\\n## Example\\n\\n`main-user-files-write`\",\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"description\": \"Description of what the capability is intended to allow on associated windows.\\n\\nIt should contain a description of what the grouped permissions should allow.\\n\\n## Example\\n\\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\",\n          \"default\": \"\",\n          \"type\": \"string\"\n        },\n        \"remote\": {\n          \"description\": \"Configure remote URLs that can use the capability permissions.\\n\\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\\n\\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\\n\\n## Example\\n\\n```json { \\\"urls\\\": [\\\"https://*.mydomain.dev\\\"] } ```\",\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/CapabilityRemote\"\n            },\n            {\n              \"type\": \"null\"\n            }\n          ]\n        },\n        \"local\": {\n          \"description\": \"Whether this capability is enabled for local app URLs or not. Defaults to `true`.\",\n          \"default\": true,\n          \"type\": \"boolean\"\n        },\n        \"windows\": {\n          \"description\": \"List of windows that are affected by this capability. Can be a glob pattern.\\n\\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\\n\\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\\n\\n## Example\\n\\n`[\\\"main\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"webviews\": {\n          \"description\": \"List of webviews that are affected by this capability. Can be a glob pattern.\\n\\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\\n\\n## Example\\n\\n`[\\\"sub-webview-one\\\", \\\"sub-webview-two\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"permissions\": {\n          \"description\": \"List of permissions attached to this capability.\\n\\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\\n\\n## Example\\n\\n```json [ \\\"core:default\\\", \\\"shell:allow-open\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] } ] ```\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/PermissionEntry\"\n          },\n          \"uniqueItems\": true\n        },\n        \"platforms\": {\n          \"description\": \"Limit which target platforms this capability applies to.\\n\\nBy default all platforms are targeted.\\n\\n## Example\\n\\n`[\\\"macOS\\\",\\\"windows\\\"]`\",\n          \"type\": [\n            \"array\",\n            \"null\"\n          ],\n          \"items\": {\n            \"$ref\": \"#/definitions/Target\"\n          }\n        }\n      }\n    },\n    \"CapabilityRemote\": {\n      \"description\": \"Configuration for remote URLs that are associated with the capability.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"urls\"\n      ],\n      \"properties\": {\n        \"urls\": {\n          \"description\": \"Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\\n\\n## Examples\\n\\n- \\\"https://*.mydomain.dev\\\": allows subdomains of mydomain.dev - \\\"https://mydomain.dev/api/*\\\": allows any subpath of mydomain.dev/api\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"PermissionEntry\": {\n      \"description\": \"An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Reference a permission or permission set by identifier.\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Identifier\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Reference a permission or permission set by identifier and extends its scope.\",\n          \"type\": \"object\",\n          \"allOf\": [\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:default\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-default\"\n                      },\n                      {\n                        \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-copy-file\"\n                      },\n                      {\n                        \"description\": \"Enables the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-create\"\n                      },\n                      {\n                        \"description\": \"Enables the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exists\"\n                      },\n                      {\n                        \"description\": \"Enables the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-fstat\"\n                      },\n                      {\n                        \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Enables the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-lstat\"\n                      },\n                      {\n                        \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-mkdir\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read\"\n                      },\n                      {\n                        \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-dir\"\n                      },\n                      {\n                        \"description\": \"Enables the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Enables the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-remove\"\n                      },\n                      {\n                        \"description\": \"Enables the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-rename\"\n                      },\n                      {\n                        \"description\": \"Enables the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-seek\"\n                      },\n                      {\n                        \"description\": \"Enables the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-size\"\n                      },\n                      {\n                        \"description\": \"Enables the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-stat\"\n                      },\n                      {\n                        \"description\": \"Enables the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-truncate\"\n                      },\n                      {\n                        \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-unwatch\"\n                      },\n                      {\n                        \"description\": \"Enables the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-watch\"\n                      },\n                      {\n                        \"description\": \"Enables the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write\"\n                      },\n                      {\n                        \"description\": \"Enables the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-file\"\n                      },\n                      {\n                        \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This permissions allows to create the application specific directories.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:create-app-specific-dirs\"\n                      },\n                      {\n                        \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-copy-file\"\n                      },\n                      {\n                        \"description\": \"Denies the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-create\"\n                      },\n                      {\n                        \"description\": \"Denies the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-exists\"\n                      },\n                      {\n                        \"description\": \"Denies the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-fstat\"\n                      },\n                      {\n                        \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Denies the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-lstat\"\n                      },\n                      {\n                        \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-mkdir\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read\"\n                      },\n                      {\n                        \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-dir\"\n                      },\n                      {\n                        \"description\": \"Denies the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Denies the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-remove\"\n                      },\n                      {\n                        \"description\": \"Denies the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-rename\"\n                      },\n                      {\n                        \"description\": \"Denies the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-seek\"\n                      },\n                      {\n                        \"description\": \"Denies the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-size\"\n                      },\n                      {\n                        \"description\": \"Denies the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-stat\"\n                      },\n                      {\n                        \"description\": \"Denies the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-truncate\"\n                      },\n                      {\n                        \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-unwatch\"\n                      },\n                      {\n                        \"description\": \"Denies the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-watch\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-linux\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-windows\"\n                      },\n                      {\n                        \"description\": \"Denies the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write\"\n                      },\n                      {\n                        \"description\": \"Denies the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-file\"\n                      },\n                      {\n                        \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-all\"\n                      },\n                      {\n                        \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-app-specific-dirs-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-dirs\"\n                      },\n                      {\n                        \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-files\"\n                      },\n                      {\n                        \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-meta\"\n                      },\n                      {\n                        \"description\": \"An empty permission you can use to modify the global scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the application directories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-all\"\n                      },\n                      {\n                        \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-files\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:default\"\n                      },\n                      {\n                        \"description\": \"Enables the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-execute\"\n                      },\n                      {\n                        \"description\": \"Enables the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-kill\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-spawn\"\n                      },\n                      {\n                        \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-stdin-write\"\n                      },\n                      {\n                        \"description\": \"Denies the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-execute\"\n                      },\n                      {\n                        \"description\": \"Denies the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-kill\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-spawn\"\n                      },\n                      {\n                        \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-stdin-write\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                },\n                \"allow\": {\n                  \"description\": \"Data that defines what is allowed by the scope.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                },\n                \"deny\": {\n                  \"description\": \"Data that defines what is denied by the scope. This should be prioritized by validation logic.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                }\n              }\n            }\n          ],\n          \"required\": [\n            \"identifier\"\n          ]\n        }\n      ]\n    },\n    \"Identifier\": {\n      \"description\": \"Permission identifier\",\n      \"oneOf\": [\n        {\n          \"description\": \"No features are enabled by default, as we believe\\nthe clipboard can be inherently dangerous and it is \\napplication specific if read and/or write access is needed.\\n\\nClipboard interaction needs to be explicitly enabled.\\n\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-image\"\n        },\n        {\n          \"description\": \"Enables the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-text\"\n        },\n        {\n          \"description\": \"Enables the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-html\"\n        },\n        {\n          \"description\": \"Enables the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-image\"\n        },\n        {\n          \"description\": \"Enables the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-text\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-image\"\n        },\n        {\n          \"description\": \"Denies the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-text\"\n        },\n        {\n          \"description\": \"Denies the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-html\"\n        },\n        {\n          \"description\": \"Denies the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-image\"\n        },\n        {\n          \"description\": \"Denies the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-text\"\n        },\n        {\n          \"description\": \"Default core plugins set which includes:\\n- 'core:path:default'\\n- 'core:event:default'\\n- 'core:window:default'\\n- 'core:webview:default'\\n- 'core:app:default'\\n- 'core:image:default'\\n- 'core:resources:default'\\n- 'core:menu:default'\\n- 'core:tray:default'\\n\",\n          \"type\": \"string\",\n          \"const\": \"core:default\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:default\"\n        },\n        {\n          \"description\": \"Enables the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-hide\"\n        },\n        {\n          \"description\": \"Enables the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-show\"\n        },\n        {\n          \"description\": \"Enables the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-default-window-icon\"\n        },\n        {\n          \"description\": \"Enables the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Enables the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-identifier\"\n        },\n        {\n          \"description\": \"Enables the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-name\"\n        },\n        {\n          \"description\": \"Enables the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-remove-data-store\"\n        },\n        {\n          \"description\": \"Enables the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-set-app-theme\"\n        },\n        {\n          \"description\": \"Enables the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-tauri-version\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-version\"\n        },\n        {\n          \"description\": \"Denies the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-hide\"\n        },\n        {\n          \"description\": \"Denies the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-show\"\n        },\n        {\n          \"description\": \"Denies the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-default-window-icon\"\n        },\n        {\n          \"description\": \"Denies the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Denies the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-identifier\"\n        },\n        {\n          \"description\": \"Denies the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-name\"\n        },\n        {\n          \"description\": \"Denies the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-remove-data-store\"\n        },\n        {\n          \"description\": \"Denies the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-set-app-theme\"\n        },\n        {\n          \"description\": \"Denies the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-tauri-version\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-version\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:default\"\n        },\n        {\n          \"description\": \"Enables the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit\"\n        },\n        {\n          \"description\": \"Enables the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit-to\"\n        },\n        {\n          \"description\": \"Enables the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-listen\"\n        },\n        {\n          \"description\": \"Enables the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-unlisten\"\n        },\n        {\n          \"description\": \"Denies the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit\"\n        },\n        {\n          \"description\": \"Denies the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit-to\"\n        },\n        {\n          \"description\": \"Denies the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-listen\"\n        },\n        {\n          \"description\": \"Denies the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-unlisten\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:default\"\n        },\n        {\n          \"description\": \"Enables the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-bytes\"\n        },\n        {\n          \"description\": \"Enables the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-path\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-new\"\n        },\n        {\n          \"description\": \"Enables the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-rgba\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-size\"\n        },\n        {\n          \"description\": \"Denies the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-bytes\"\n        },\n        {\n          \"description\": \"Denies the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-path\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-new\"\n        },\n        {\n          \"description\": \"Denies the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-rgba\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:default\"\n        },\n        {\n          \"description\": \"Enables the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-append\"\n        },\n        {\n          \"description\": \"Enables the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-create-default\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-get\"\n        },\n        {\n          \"description\": \"Enables the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-insert\"\n        },\n        {\n          \"description\": \"Enables the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-checked\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-items\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-new\"\n        },\n        {\n          \"description\": \"Enables the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-popup\"\n        },\n        {\n          \"description\": \"Enables the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-prepend\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove-at\"\n        },\n        {\n          \"description\": \"Enables the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-accelerator\"\n        },\n        {\n          \"description\": \"Enables the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-checked\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-text\"\n        },\n        {\n          \"description\": \"Enables the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-text\"\n        },\n        {\n          \"description\": \"Denies the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-append\"\n        },\n        {\n          \"description\": \"Denies the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-create-default\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-get\"\n        },\n        {\n          \"description\": \"Denies the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-insert\"\n        },\n        {\n          \"description\": \"Denies the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-checked\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-items\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-new\"\n        },\n        {\n          \"description\": \"Denies the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-popup\"\n        },\n        {\n          \"description\": \"Denies the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-prepend\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove-at\"\n        },\n        {\n          \"description\": \"Denies the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-accelerator\"\n        },\n        {\n          \"description\": \"Denies the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-checked\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-text\"\n        },\n        {\n          \"description\": \"Denies the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-text\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:default\"\n        },\n        {\n          \"description\": \"Enables the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-basename\"\n        },\n        {\n          \"description\": \"Enables the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-dirname\"\n        },\n        {\n          \"description\": \"Enables the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-extname\"\n        },\n        {\n          \"description\": \"Enables the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-is-absolute\"\n        },\n        {\n          \"description\": \"Enables the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-join\"\n        },\n        {\n          \"description\": \"Enables the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-normalize\"\n        },\n        {\n          \"description\": \"Enables the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve\"\n        },\n        {\n          \"description\": \"Enables the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve-directory\"\n        },\n        {\n          \"description\": \"Denies the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-basename\"\n        },\n        {\n          \"description\": \"Denies the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-dirname\"\n        },\n        {\n          \"description\": \"Denies the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-extname\"\n        },\n        {\n          \"description\": \"Denies the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-is-absolute\"\n        },\n        {\n          \"description\": \"Denies the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-join\"\n        },\n        {\n          \"description\": \"Denies the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-normalize\"\n        },\n        {\n          \"description\": \"Denies the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve\"\n        },\n        {\n          \"description\": \"Denies the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve-directory\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:default\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:allow-close\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:deny-close\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:default\"\n        },\n        {\n          \"description\": \"Enables the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-get-by-id\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-new\"\n        },\n        {\n          \"description\": \"Enables the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-remove-by-id\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Enables the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-menu\"\n        },\n        {\n          \"description\": \"Enables the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Enables the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-tooltip\"\n        },\n        {\n          \"description\": \"Enables the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-visible\"\n        },\n        {\n          \"description\": \"Denies the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-get-by-id\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-new\"\n        },\n        {\n          \"description\": \"Denies the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-remove-by-id\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Denies the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-menu\"\n        },\n        {\n          \"description\": \"Denies the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Denies the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-tooltip\"\n        },\n        {\n          \"description\": \"Denies the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-visible\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:default\"\n        },\n        {\n          \"description\": \"Enables the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Enables the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview\"\n        },\n        {\n          \"description\": \"Enables the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview-window\"\n        },\n        {\n          \"description\": \"Enables the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-get-all-webviews\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Enables the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-print\"\n        },\n        {\n          \"description\": \"Enables the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-reparent\"\n        },\n        {\n          \"description\": \"Enables the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-focus\"\n        },\n        {\n          \"description\": \"Enables the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-position\"\n        },\n        {\n          \"description\": \"Enables the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-size\"\n        },\n        {\n          \"description\": \"Enables the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Enables the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-close\"\n        },\n        {\n          \"description\": \"Enables the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-hide\"\n        },\n        {\n          \"description\": \"Enables the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-position\"\n        },\n        {\n          \"description\": \"Enables the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-show\"\n        },\n        {\n          \"description\": \"Enables the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-size\"\n        },\n        {\n          \"description\": \"Denies the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Denies the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview\"\n        },\n        {\n          \"description\": \"Denies the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview-window\"\n        },\n        {\n          \"description\": \"Denies the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-get-all-webviews\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Denies the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-print\"\n        },\n        {\n          \"description\": \"Denies the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-reparent\"\n        },\n        {\n          \"description\": \"Denies the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-focus\"\n        },\n        {\n          \"description\": \"Denies the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-position\"\n        },\n        {\n          \"description\": \"Denies the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-size\"\n        },\n        {\n          \"description\": \"Denies the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Denies the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-close\"\n        },\n        {\n          \"description\": \"Denies the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-hide\"\n        },\n        {\n          \"description\": \"Denies the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-position\"\n        },\n        {\n          \"description\": \"Denies the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-show\"\n        },\n        {\n          \"description\": \"Denies the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:default\"\n        },\n        {\n          \"description\": \"Enables the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-available-monitors\"\n        },\n        {\n          \"description\": \"Enables the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-center\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-close\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-create\"\n        },\n        {\n          \"description\": \"Enables the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-current-monitor\"\n        },\n        {\n          \"description\": \"Enables the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-destroy\"\n        },\n        {\n          \"description\": \"Enables the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-get-all-windows\"\n        },\n        {\n          \"description\": \"Enables the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-hide\"\n        },\n        {\n          \"description\": \"Enables the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-position\"\n        },\n        {\n          \"description\": \"Enables the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-size\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-closable\"\n        },\n        {\n          \"description\": \"Enables the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-decorated\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-focused\"\n        },\n        {\n          \"description\": \"Enables the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximizable\"\n        },\n        {\n          \"description\": \"Enables the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximized\"\n        },\n        {\n          \"description\": \"Enables the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimizable\"\n        },\n        {\n          \"description\": \"Enables the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimized\"\n        },\n        {\n          \"description\": \"Enables the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-resizable\"\n        },\n        {\n          \"description\": \"Enables the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-visible\"\n        },\n        {\n          \"description\": \"Enables the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-maximize\"\n        },\n        {\n          \"description\": \"Enables the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-minimize\"\n        },\n        {\n          \"description\": \"Enables the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-monitor-from-point\"\n        },\n        {\n          \"description\": \"Enables the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-position\"\n        },\n        {\n          \"description\": \"Enables the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-size\"\n        },\n        {\n          \"description\": \"Enables the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-primary-monitor\"\n        },\n        {\n          \"description\": \"Enables the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-request-user-attention\"\n        },\n        {\n          \"description\": \"Enables the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-scale-factor\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-count\"\n        },\n        {\n          \"description\": \"Enables the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-label\"\n        },\n        {\n          \"description\": \"Enables the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-closable\"\n        },\n        {\n          \"description\": \"Enables the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-content-protected\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Enables the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-decorations\"\n        },\n        {\n          \"description\": \"Enables the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-effects\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-focus\"\n        },\n        {\n          \"description\": \"Enables the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Enables the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-max-size\"\n        },\n        {\n          \"description\": \"Enables the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-maximizable\"\n        },\n        {\n          \"description\": \"Enables the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-min-size\"\n        },\n        {\n          \"description\": \"Enables the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-minimizable\"\n        },\n        {\n          \"description\": \"Enables the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Enables the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-position\"\n        },\n        {\n          \"description\": \"Enables the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-progress-bar\"\n        },\n        {\n          \"description\": \"Enables the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-resizable\"\n        },\n        {\n          \"description\": \"Enables the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-shadow\"\n        },\n        {\n          \"description\": \"Enables the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size\"\n        },\n        {\n          \"description\": \"Enables the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size-constraints\"\n        },\n        {\n          \"description\": \"Enables the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Enables the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-theme\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Enables the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-show\"\n        },\n        {\n          \"description\": \"Enables the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-dragging\"\n        },\n        {\n          \"description\": \"Enables the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Enables the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-theme\"\n        },\n        {\n          \"description\": \"Enables the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-title\"\n        },\n        {\n          \"description\": \"Enables the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unmaximize\"\n        },\n        {\n          \"description\": \"Enables the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unminimize\"\n        },\n        {\n          \"description\": \"Denies the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-available-monitors\"\n        },\n        {\n          \"description\": \"Denies the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-center\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-close\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-create\"\n        },\n        {\n          \"description\": \"Denies the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-current-monitor\"\n        },\n        {\n          \"description\": \"Denies the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-destroy\"\n        },\n        {\n          \"description\": \"Denies the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-get-all-windows\"\n        },\n        {\n          \"description\": \"Denies the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-hide\"\n        },\n        {\n          \"description\": \"Denies the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-position\"\n        },\n        {\n          \"description\": \"Denies the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-size\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-closable\"\n        },\n        {\n          \"description\": \"Denies the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-decorated\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-focused\"\n        },\n        {\n          \"description\": \"Denies the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximizable\"\n        },\n        {\n          \"description\": \"Denies the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximized\"\n        },\n        {\n          \"description\": \"Denies the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimizable\"\n        },\n        {\n          \"description\": \"Denies the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimized\"\n        },\n        {\n          \"description\": \"Denies the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-resizable\"\n        },\n        {\n          \"description\": \"Denies the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-visible\"\n        },\n        {\n          \"description\": \"Denies the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-maximize\"\n        },\n        {\n          \"description\": \"Denies the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-minimize\"\n        },\n        {\n          \"description\": \"Denies the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-monitor-from-point\"\n        },\n        {\n          \"description\": \"Denies the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-position\"\n        },\n        {\n          \"description\": \"Denies the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-size\"\n        },\n        {\n          \"description\": \"Denies the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-primary-monitor\"\n        },\n        {\n          \"description\": \"Denies the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-request-user-attention\"\n        },\n        {\n          \"description\": \"Denies the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-scale-factor\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-count\"\n        },\n        {\n          \"description\": \"Denies the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-label\"\n        },\n        {\n          \"description\": \"Denies the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-closable\"\n        },\n        {\n          \"description\": \"Denies the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-content-protected\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Denies the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-decorations\"\n        },\n        {\n          \"description\": \"Denies the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-effects\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-focus\"\n        },\n        {\n          \"description\": \"Denies the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Denies the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-max-size\"\n        },\n        {\n          \"description\": \"Denies the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-maximizable\"\n        },\n        {\n          \"description\": \"Denies the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-min-size\"\n        },\n        {\n          \"description\": \"Denies the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-minimizable\"\n        },\n        {\n          \"description\": \"Denies the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Denies the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-position\"\n        },\n        {\n          \"description\": \"Denies the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-progress-bar\"\n        },\n        {\n          \"description\": \"Denies the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-resizable\"\n        },\n        {\n          \"description\": \"Denies the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-shadow\"\n        },\n        {\n          \"description\": \"Denies the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size\"\n        },\n        {\n          \"description\": \"Denies the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size-constraints\"\n        },\n        {\n          \"description\": \"Denies the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Denies the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-theme\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Denies the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-show\"\n        },\n        {\n          \"description\": \"Denies the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-dragging\"\n        },\n        {\n          \"description\": \"Denies the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Denies the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-theme\"\n        },\n        {\n          \"description\": \"Denies the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-title\"\n        },\n        {\n          \"description\": \"Denies the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unmaximize\"\n        },\n        {\n          \"description\": \"Denies the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unminimize\"\n        },\n        {\n          \"description\": \"This permission set configures the types of dialogs\\navailable from the dialog plugin.\\n\\n#### Granted Permissions\\n\\nAll dialog types are enabled.\\n\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"dialog:default\"\n        },\n        {\n          \"description\": \"Enables the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-ask\"\n        },\n        {\n          \"description\": \"Enables the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-confirm\"\n        },\n        {\n          \"description\": \"Enables the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-message\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-open\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-save\"\n        },\n        {\n          \"description\": \"Denies the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-ask\"\n        },\n        {\n          \"description\": \"Denies the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-confirm\"\n        },\n        {\n          \"description\": \"Denies the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-message\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-open\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-save\"\n        },\n        {\n          \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:default\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write-recursive\"\n        },\n        {\n          \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-default\"\n        },\n        {\n          \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-copy-file\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-create\"\n        },\n        {\n          \"description\": \"Enables the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exists\"\n        },\n        {\n          \"description\": \"Enables the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-fstat\"\n        },\n        {\n          \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-ftruncate\"\n        },\n        {\n          \"description\": \"Enables the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-lstat\"\n        },\n        {\n          \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-mkdir\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-open\"\n        },\n        {\n          \"description\": \"Enables the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read\"\n        },\n        {\n          \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-dir\"\n        },\n        {\n          \"description\": \"Enables the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-rename\"\n        },\n        {\n          \"description\": \"Enables the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-seek\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-size\"\n        },\n        {\n          \"description\": \"Enables the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-stat\"\n        },\n        {\n          \"description\": \"Enables the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-truncate\"\n        },\n        {\n          \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-unwatch\"\n        },\n        {\n          \"description\": \"Enables the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-watch\"\n        },\n        {\n          \"description\": \"Enables the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write\"\n        },\n        {\n          \"description\": \"Enables the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-file\"\n        },\n        {\n          \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-text-file\"\n        },\n        {\n          \"description\": \"This permissions allows to create the application specific directories.\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:create-app-specific-dirs\"\n        },\n        {\n          \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-copy-file\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-create\"\n        },\n        {\n          \"description\": \"Denies the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-exists\"\n        },\n        {\n          \"description\": \"Denies the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-fstat\"\n        },\n        {\n          \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-ftruncate\"\n        },\n        {\n          \"description\": \"Denies the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-lstat\"\n        },\n        {\n          \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-mkdir\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-open\"\n        },\n        {\n          \"description\": \"Denies the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read\"\n        },\n        {\n          \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-dir\"\n        },\n        {\n          \"description\": \"Denies the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-rename\"\n        },\n        {\n          \"description\": \"Denies the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-seek\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-size\"\n        },\n        {\n          \"description\": \"Denies the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-stat\"\n        },\n        {\n          \"description\": \"Denies the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-truncate\"\n        },\n        {\n          \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-unwatch\"\n        },\n        {\n          \"description\": \"Denies the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-watch\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-linux\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-windows\"\n        },\n        {\n          \"description\": \"Denies the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write\"\n        },\n        {\n          \"description\": \"Denies the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-file\"\n        },\n        {\n          \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-text-file\"\n        },\n        {\n          \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-all\"\n        },\n        {\n          \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-app-specific-dirs-recursive\"\n        },\n        {\n          \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-dirs\"\n        },\n        {\n          \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-files\"\n        },\n        {\n          \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-meta\"\n        },\n        {\n          \"description\": \"An empty permission you can use to modify the global scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the application directories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-recursive\"\n        },\n        {\n          \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-all\"\n        },\n        {\n          \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-files\"\n        },\n        {\n          \"description\": \"Allows the log command\",\n          \"type\": \"string\",\n          \"const\": \"log:default\"\n        },\n        {\n          \"description\": \"Enables the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:allow-log\"\n        },\n        {\n          \"description\": \"Denies the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:deny-log\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nnotification features are by default exposed.\\n\\n#### Granted Permissions\\n\\nIt allows all notification related features.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"notification:default\"\n        },\n        {\n          \"description\": \"Enables the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-batch\"\n        },\n        {\n          \"description\": \"Enables the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-cancel\"\n        },\n        {\n          \"description\": \"Enables the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-check-permissions\"\n        },\n        {\n          \"description\": \"Enables the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-create-channel\"\n        },\n        {\n          \"description\": \"Enables the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-delete-channel\"\n        },\n        {\n          \"description\": \"Enables the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-active\"\n        },\n        {\n          \"description\": \"Enables the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-pending\"\n        },\n        {\n          \"description\": \"Enables the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-is-permission-granted\"\n        },\n        {\n          \"description\": \"Enables the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-list-channels\"\n        },\n        {\n          \"description\": \"Enables the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-notify\"\n        },\n        {\n          \"description\": \"Enables the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-permission-state\"\n        },\n        {\n          \"description\": \"Enables the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-action-types\"\n        },\n        {\n          \"description\": \"Enables the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-listener\"\n        },\n        {\n          \"description\": \"Enables the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-remove-active\"\n        },\n        {\n          \"description\": \"Enables the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-request-permission\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-show\"\n        },\n        {\n          \"description\": \"Denies the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-batch\"\n        },\n        {\n          \"description\": \"Denies the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-cancel\"\n        },\n        {\n          \"description\": \"Denies the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-check-permissions\"\n        },\n        {\n          \"description\": \"Denies the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-create-channel\"\n        },\n        {\n          \"description\": \"Denies the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-delete-channel\"\n        },\n        {\n          \"description\": \"Denies the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-active\"\n        },\n        {\n          \"description\": \"Denies the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-pending\"\n        },\n        {\n          \"description\": \"Denies the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-is-permission-granted\"\n        },\n        {\n          \"description\": \"Denies the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-list-channels\"\n        },\n        {\n          \"description\": \"Denies the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-notify\"\n        },\n        {\n          \"description\": \"Denies the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-permission-state\"\n        },\n        {\n          \"description\": \"Denies the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-action-types\"\n        },\n        {\n          \"description\": \"Denies the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-listener\"\n        },\n        {\n          \"description\": \"Denies the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-remove-active\"\n        },\n        {\n          \"description\": \"Denies the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-request-permission\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-show\"\n        },\n        {\n          \"description\": \"This permission set configures which\\noperating system information are available\\nto gather from the frontend.\\n\\n#### Granted Permissions\\n\\nAll information except the host name are available.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"os:default\"\n        },\n        {\n          \"description\": \"Enables the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-arch\"\n        },\n        {\n          \"description\": \"Enables the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-exe-extension\"\n        },\n        {\n          \"description\": \"Enables the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-family\"\n        },\n        {\n          \"description\": \"Enables the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-hostname\"\n        },\n        {\n          \"description\": \"Enables the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-locale\"\n        },\n        {\n          \"description\": \"Enables the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-os-type\"\n        },\n        {\n          \"description\": \"Enables the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-platform\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-version\"\n        },\n        {\n          \"description\": \"Denies the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-arch\"\n        },\n        {\n          \"description\": \"Denies the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-exe-extension\"\n        },\n        {\n          \"description\": \"Denies the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-family\"\n        },\n        {\n          \"description\": \"Denies the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-hostname\"\n        },\n        {\n          \"description\": \"Denies the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-locale\"\n        },\n        {\n          \"description\": \"Denies the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-os-type\"\n        },\n        {\n          \"description\": \"Denies the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-platform\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-version\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nprocess feeatures are by default exposed.\\n\\n#### Granted Permissions\\n\\nThis enables to quit via `allow-exit` and restart via `allow-restart`\\nthe application.\\n\",\n          \"type\": \"string\",\n          \"const\": \"process:default\"\n        },\n        {\n          \"description\": \"Enables the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-exit\"\n        },\n        {\n          \"description\": \"Enables the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-restart\"\n        },\n        {\n          \"description\": \"Denies the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-exit\"\n        },\n        {\n          \"description\": \"Denies the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-restart\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n          \"type\": \"string\",\n          \"const\": \"shell:default\"\n        },\n        {\n          \"description\": \"Enables the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-execute\"\n        },\n        {\n          \"description\": \"Enables the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-kill\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-open\"\n        },\n        {\n          \"description\": \"Enables the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-spawn\"\n        },\n        {\n          \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-stdin-write\"\n        },\n        {\n          \"description\": \"Denies the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-execute\"\n        },\n        {\n          \"description\": \"Denies the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-kill\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-open\"\n        },\n        {\n          \"description\": \"Denies the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-spawn\"\n        },\n        {\n          \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-stdin-write\"\n        },\n        {\n          \"description\": \"This permission set configures what kind of\\noperations are available from the store plugin.\\n\\n#### Granted Permissions\\n\\nAll operations are enabled by default.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"store:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-delete\"\n        },\n        {\n          \"description\": \"Enables the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-entries\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get\"\n        },\n        {\n          \"description\": \"Enables the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get-store\"\n        },\n        {\n          \"description\": \"Enables the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-has\"\n        },\n        {\n          \"description\": \"Enables the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-keys\"\n        },\n        {\n          \"description\": \"Enables the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-length\"\n        },\n        {\n          \"description\": \"Enables the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-load\"\n        },\n        {\n          \"description\": \"Enables the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reload\"\n        },\n        {\n          \"description\": \"Enables the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reset\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-save\"\n        },\n        {\n          \"description\": \"Enables the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-set\"\n        },\n        {\n          \"description\": \"Enables the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-values\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-delete\"\n        },\n        {\n          \"description\": \"Denies the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-entries\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get\"\n        },\n        {\n          \"description\": \"Denies the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get-store\"\n        },\n        {\n          \"description\": \"Denies the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-has\"\n        },\n        {\n          \"description\": \"Denies the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-keys\"\n        },\n        {\n          \"description\": \"Denies the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-length\"\n        },\n        {\n          \"description\": \"Denies the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-load\"\n        },\n        {\n          \"description\": \"Denies the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reload\"\n        },\n        {\n          \"description\": \"Denies the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reset\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-save\"\n        },\n        {\n          \"description\": \"Denies the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-set\"\n        },\n        {\n          \"description\": \"Denies the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-values\"\n        },\n        {\n          \"description\": \"This permission set configures which kind of\\nupdater functions are exposed to the frontend.\\n\\n#### Granted Permissions\\n\\nThe full workflow from checking for updates to installing them\\nis enabled.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"updater:default\"\n        },\n        {\n          \"description\": \"Enables the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-check\"\n        },\n        {\n          \"description\": \"Enables the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download\"\n        },\n        {\n          \"description\": \"Enables the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download-and-install\"\n        },\n        {\n          \"description\": \"Enables the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-install\"\n        },\n        {\n          \"description\": \"Denies the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-check\"\n        },\n        {\n          \"description\": \"Denies the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download\"\n        },\n        {\n          \"description\": \"Denies the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download-and-install\"\n        },\n        {\n          \"description\": \"Denies the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-install\"\n        }\n      ]\n    },\n    \"Value\": {\n      \"description\": \"All supported ACL values.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents a null JSON value.\",\n          \"type\": \"null\"\n        },\n        {\n          \"description\": \"Represents a [`bool`].\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"Represents a valid ACL [`Number`].\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Number\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Represents a [`String`].\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"Represents a list of other [`Value`]s.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        },\n        {\n          \"description\": \"Represents a map of [`String`] keys to [`Value`]s.\",\n          \"type\": \"object\",\n          \"additionalProperties\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        }\n      ]\n    },\n    \"Number\": {\n      \"description\": \"A valid ACL number.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents an [`i64`].\",\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        {\n          \"description\": \"Represents a [`f64`].\",\n          \"type\": \"number\",\n          \"format\": \"double\"\n        }\n      ]\n    },\n    \"Target\": {\n      \"description\": \"Platform target.\",\n      \"oneOf\": [\n        {\n          \"description\": \"MacOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"macOS\"\n          ]\n        },\n        {\n          \"description\": \"Windows.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"windows\"\n          ]\n        },\n        {\n          \"description\": \"Linux.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"linux\"\n          ]\n        },\n        {\n          \"description\": \"Android.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"android\"\n          ]\n        },\n        {\n          \"description\": \"iOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"iOS\"\n          ]\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArg\": {\n      \"description\": \"A command argument allowed to be executed by the webview API.\",\n      \"anyOf\": [\n        {\n          \"description\": \"A non-configurable argument that is passed to the command in the order it was specified.\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"A variable that is set while calling the command from the webview API.\",\n          \"type\": \"object\",\n          \"required\": [\n            \"validator\"\n          ],\n          \"properties\": {\n            \"raw\": {\n              \"description\": \"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\\n\\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.\",\n              \"default\": false,\n              \"type\": \"boolean\"\n            },\n            \"validator\": {\n              \"description\": \"[regex] validator to require passed values to conform to an expected input.\\n\\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\\n\\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\\\w+` regex would be registered as `^https?://\\\\w+$`.\\n\\n[regex]: <https://docs.rs/regex/latest/regex/#syntax>\",\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArgs\": {\n      \"description\": \"A set of command arguments allowed to be executed by the webview API.\\n\\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Use a simple boolean to allow all or disable all arguments to this command configuration.\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/ShellScopeEntryAllowedArg\"\n          }\n        }\n      ]\n    }\n  }\n}"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/linux-schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"CapabilityFile\",\n  \"description\": \"Capability formats accepted in a capability file.\",\n  \"anyOf\": [\n    {\n      \"description\": \"A single capability.\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Capability\"\n        }\n      ]\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/Capability\"\n      }\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"capabilities\"\n      ],\n      \"properties\": {\n        \"capabilities\": {\n          \"description\": \"The list of capabilities.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Capability\"\n          }\n        }\n      }\n    }\n  ],\n  \"definitions\": {\n    \"Capability\": {\n      \"description\": \"A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\\n\\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\\n\\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\\n\\n## Example\\n\\n```json { \\\"identifier\\\": \\\"main-user-files-write\\\", \\\"description\\\": \\\"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\\\", \\\"windows\\\": [ \\\"main\\\" ], \\\"permissions\\\": [ \\\"core:default\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] }, ], \\\"platforms\\\": [\\\"macOS\\\",\\\"windows\\\"] } ```\",\n      \"type\": \"object\",\n      \"required\": [\n        \"identifier\",\n        \"permissions\"\n      ],\n      \"properties\": {\n        \"identifier\": {\n          \"description\": \"Identifier of the capability.\\n\\n## Example\\n\\n`main-user-files-write`\",\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"description\": \"Description of what the capability is intended to allow on associated windows.\\n\\nIt should contain a description of what the grouped permissions should allow.\\n\\n## Example\\n\\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\",\n          \"default\": \"\",\n          \"type\": \"string\"\n        },\n        \"remote\": {\n          \"description\": \"Configure remote URLs that can use the capability permissions.\\n\\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\\n\\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\\n\\n## Example\\n\\n```json { \\\"urls\\\": [\\\"https://*.mydomain.dev\\\"] } ```\",\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/CapabilityRemote\"\n            },\n            {\n              \"type\": \"null\"\n            }\n          ]\n        },\n        \"local\": {\n          \"description\": \"Whether this capability is enabled for local app URLs or not. Defaults to `true`.\",\n          \"default\": true,\n          \"type\": \"boolean\"\n        },\n        \"windows\": {\n          \"description\": \"List of windows that are affected by this capability. Can be a glob pattern.\\n\\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\\n\\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\\n\\n## Example\\n\\n`[\\\"main\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"webviews\": {\n          \"description\": \"List of webviews that are affected by this capability. Can be a glob pattern.\\n\\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\\n\\n## Example\\n\\n`[\\\"sub-webview-one\\\", \\\"sub-webview-two\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"permissions\": {\n          \"description\": \"List of permissions attached to this capability.\\n\\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\\n\\n## Example\\n\\n```json [ \\\"core:default\\\", \\\"shell:allow-open\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] } ] ```\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/PermissionEntry\"\n          },\n          \"uniqueItems\": true\n        },\n        \"platforms\": {\n          \"description\": \"Limit which target platforms this capability applies to.\\n\\nBy default all platforms are targeted.\\n\\n## Example\\n\\n`[\\\"macOS\\\",\\\"windows\\\"]`\",\n          \"type\": [\n            \"array\",\n            \"null\"\n          ],\n          \"items\": {\n            \"$ref\": \"#/definitions/Target\"\n          }\n        }\n      }\n    },\n    \"CapabilityRemote\": {\n      \"description\": \"Configuration for remote URLs that are associated with the capability.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"urls\"\n      ],\n      \"properties\": {\n        \"urls\": {\n          \"description\": \"Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\\n\\n## Examples\\n\\n- \\\"https://*.mydomain.dev\\\": allows subdomains of mydomain.dev - \\\"https://mydomain.dev/api/*\\\": allows any subpath of mydomain.dev/api\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"PermissionEntry\": {\n      \"description\": \"An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Reference a permission or permission set by identifier.\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Identifier\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Reference a permission or permission set by identifier and extends its scope.\",\n          \"type\": \"object\",\n          \"allOf\": [\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:default\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-default\"\n                      },\n                      {\n                        \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-copy-file\"\n                      },\n                      {\n                        \"description\": \"Enables the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-create\"\n                      },\n                      {\n                        \"description\": \"Enables the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exists\"\n                      },\n                      {\n                        \"description\": \"Enables the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-fstat\"\n                      },\n                      {\n                        \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Enables the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-lstat\"\n                      },\n                      {\n                        \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-mkdir\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read\"\n                      },\n                      {\n                        \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-dir\"\n                      },\n                      {\n                        \"description\": \"Enables the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Enables the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-remove\"\n                      },\n                      {\n                        \"description\": \"Enables the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-rename\"\n                      },\n                      {\n                        \"description\": \"Enables the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-seek\"\n                      },\n                      {\n                        \"description\": \"Enables the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-size\"\n                      },\n                      {\n                        \"description\": \"Enables the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-stat\"\n                      },\n                      {\n                        \"description\": \"Enables the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-truncate\"\n                      },\n                      {\n                        \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-unwatch\"\n                      },\n                      {\n                        \"description\": \"Enables the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-watch\"\n                      },\n                      {\n                        \"description\": \"Enables the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write\"\n                      },\n                      {\n                        \"description\": \"Enables the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-file\"\n                      },\n                      {\n                        \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This permissions allows to create the application specific directories.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:create-app-specific-dirs\"\n                      },\n                      {\n                        \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-copy-file\"\n                      },\n                      {\n                        \"description\": \"Denies the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-create\"\n                      },\n                      {\n                        \"description\": \"Denies the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-exists\"\n                      },\n                      {\n                        \"description\": \"Denies the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-fstat\"\n                      },\n                      {\n                        \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Denies the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-lstat\"\n                      },\n                      {\n                        \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-mkdir\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read\"\n                      },\n                      {\n                        \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-dir\"\n                      },\n                      {\n                        \"description\": \"Denies the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Denies the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-remove\"\n                      },\n                      {\n                        \"description\": \"Denies the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-rename\"\n                      },\n                      {\n                        \"description\": \"Denies the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-seek\"\n                      },\n                      {\n                        \"description\": \"Denies the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-size\"\n                      },\n                      {\n                        \"description\": \"Denies the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-stat\"\n                      },\n                      {\n                        \"description\": \"Denies the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-truncate\"\n                      },\n                      {\n                        \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-unwatch\"\n                      },\n                      {\n                        \"description\": \"Denies the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-watch\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-linux\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-windows\"\n                      },\n                      {\n                        \"description\": \"Denies the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write\"\n                      },\n                      {\n                        \"description\": \"Denies the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-file\"\n                      },\n                      {\n                        \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-all\"\n                      },\n                      {\n                        \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-app-specific-dirs-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-dirs\"\n                      },\n                      {\n                        \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-files\"\n                      },\n                      {\n                        \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-meta\"\n                      },\n                      {\n                        \"description\": \"An empty permission you can use to modify the global scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the application directories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-all\"\n                      },\n                      {\n                        \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-files\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:default\"\n                      },\n                      {\n                        \"description\": \"Enables the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-execute\"\n                      },\n                      {\n                        \"description\": \"Enables the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-kill\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-spawn\"\n                      },\n                      {\n                        \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-stdin-write\"\n                      },\n                      {\n                        \"description\": \"Denies the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-execute\"\n                      },\n                      {\n                        \"description\": \"Denies the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-kill\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-spawn\"\n                      },\n                      {\n                        \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-stdin-write\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                },\n                \"allow\": {\n                  \"description\": \"Data that defines what is allowed by the scope.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                },\n                \"deny\": {\n                  \"description\": \"Data that defines what is denied by the scope. This should be prioritized by validation logic.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                }\n              }\n            }\n          ],\n          \"required\": [\n            \"identifier\"\n          ]\n        }\n      ]\n    },\n    \"Identifier\": {\n      \"description\": \"Permission identifier\",\n      \"oneOf\": [\n        {\n          \"description\": \"No features are enabled by default, as we believe\\nthe clipboard can be inherently dangerous and it is \\napplication specific if read and/or write access is needed.\\n\\nClipboard interaction needs to be explicitly enabled.\\n\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-image\"\n        },\n        {\n          \"description\": \"Enables the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-text\"\n        },\n        {\n          \"description\": \"Enables the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-html\"\n        },\n        {\n          \"description\": \"Enables the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-image\"\n        },\n        {\n          \"description\": \"Enables the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-text\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-image\"\n        },\n        {\n          \"description\": \"Denies the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-text\"\n        },\n        {\n          \"description\": \"Denies the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-html\"\n        },\n        {\n          \"description\": \"Denies the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-image\"\n        },\n        {\n          \"description\": \"Denies the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-text\"\n        },\n        {\n          \"description\": \"Default core plugins set which includes:\\n- 'core:path:default'\\n- 'core:event:default'\\n- 'core:window:default'\\n- 'core:webview:default'\\n- 'core:app:default'\\n- 'core:image:default'\\n- 'core:resources:default'\\n- 'core:menu:default'\\n- 'core:tray:default'\\n\",\n          \"type\": \"string\",\n          \"const\": \"core:default\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:default\"\n        },\n        {\n          \"description\": \"Enables the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-hide\"\n        },\n        {\n          \"description\": \"Enables the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-show\"\n        },\n        {\n          \"description\": \"Enables the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-default-window-icon\"\n        },\n        {\n          \"description\": \"Enables the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Enables the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-identifier\"\n        },\n        {\n          \"description\": \"Enables the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-name\"\n        },\n        {\n          \"description\": \"Enables the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-remove-data-store\"\n        },\n        {\n          \"description\": \"Enables the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-set-app-theme\"\n        },\n        {\n          \"description\": \"Enables the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-tauri-version\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-version\"\n        },\n        {\n          \"description\": \"Denies the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-hide\"\n        },\n        {\n          \"description\": \"Denies the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-show\"\n        },\n        {\n          \"description\": \"Denies the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-default-window-icon\"\n        },\n        {\n          \"description\": \"Denies the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Denies the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-identifier\"\n        },\n        {\n          \"description\": \"Denies the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-name\"\n        },\n        {\n          \"description\": \"Denies the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-remove-data-store\"\n        },\n        {\n          \"description\": \"Denies the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-set-app-theme\"\n        },\n        {\n          \"description\": \"Denies the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-tauri-version\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-version\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:default\"\n        },\n        {\n          \"description\": \"Enables the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit\"\n        },\n        {\n          \"description\": \"Enables the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit-to\"\n        },\n        {\n          \"description\": \"Enables the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-listen\"\n        },\n        {\n          \"description\": \"Enables the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-unlisten\"\n        },\n        {\n          \"description\": \"Denies the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit\"\n        },\n        {\n          \"description\": \"Denies the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit-to\"\n        },\n        {\n          \"description\": \"Denies the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-listen\"\n        },\n        {\n          \"description\": \"Denies the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-unlisten\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:default\"\n        },\n        {\n          \"description\": \"Enables the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-bytes\"\n        },\n        {\n          \"description\": \"Enables the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-path\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-new\"\n        },\n        {\n          \"description\": \"Enables the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-rgba\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-size\"\n        },\n        {\n          \"description\": \"Denies the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-bytes\"\n        },\n        {\n          \"description\": \"Denies the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-path\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-new\"\n        },\n        {\n          \"description\": \"Denies the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-rgba\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:default\"\n        },\n        {\n          \"description\": \"Enables the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-append\"\n        },\n        {\n          \"description\": \"Enables the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-create-default\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-get\"\n        },\n        {\n          \"description\": \"Enables the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-insert\"\n        },\n        {\n          \"description\": \"Enables the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-checked\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-items\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-new\"\n        },\n        {\n          \"description\": \"Enables the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-popup\"\n        },\n        {\n          \"description\": \"Enables the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-prepend\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove-at\"\n        },\n        {\n          \"description\": \"Enables the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-accelerator\"\n        },\n        {\n          \"description\": \"Enables the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-checked\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-text\"\n        },\n        {\n          \"description\": \"Enables the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-text\"\n        },\n        {\n          \"description\": \"Denies the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-append\"\n        },\n        {\n          \"description\": \"Denies the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-create-default\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-get\"\n        },\n        {\n          \"description\": \"Denies the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-insert\"\n        },\n        {\n          \"description\": \"Denies the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-checked\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-items\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-new\"\n        },\n        {\n          \"description\": \"Denies the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-popup\"\n        },\n        {\n          \"description\": \"Denies the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-prepend\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove-at\"\n        },\n        {\n          \"description\": \"Denies the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-accelerator\"\n        },\n        {\n          \"description\": \"Denies the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-checked\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-text\"\n        },\n        {\n          \"description\": \"Denies the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-text\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:default\"\n        },\n        {\n          \"description\": \"Enables the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-basename\"\n        },\n        {\n          \"description\": \"Enables the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-dirname\"\n        },\n        {\n          \"description\": \"Enables the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-extname\"\n        },\n        {\n          \"description\": \"Enables the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-is-absolute\"\n        },\n        {\n          \"description\": \"Enables the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-join\"\n        },\n        {\n          \"description\": \"Enables the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-normalize\"\n        },\n        {\n          \"description\": \"Enables the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve\"\n        },\n        {\n          \"description\": \"Enables the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve-directory\"\n        },\n        {\n          \"description\": \"Denies the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-basename\"\n        },\n        {\n          \"description\": \"Denies the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-dirname\"\n        },\n        {\n          \"description\": \"Denies the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-extname\"\n        },\n        {\n          \"description\": \"Denies the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-is-absolute\"\n        },\n        {\n          \"description\": \"Denies the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-join\"\n        },\n        {\n          \"description\": \"Denies the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-normalize\"\n        },\n        {\n          \"description\": \"Denies the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve\"\n        },\n        {\n          \"description\": \"Denies the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve-directory\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:default\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:allow-close\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:deny-close\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:default\"\n        },\n        {\n          \"description\": \"Enables the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-get-by-id\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-new\"\n        },\n        {\n          \"description\": \"Enables the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-remove-by-id\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Enables the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-menu\"\n        },\n        {\n          \"description\": \"Enables the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Enables the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-tooltip\"\n        },\n        {\n          \"description\": \"Enables the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-visible\"\n        },\n        {\n          \"description\": \"Denies the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-get-by-id\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-new\"\n        },\n        {\n          \"description\": \"Denies the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-remove-by-id\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Denies the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-menu\"\n        },\n        {\n          \"description\": \"Denies the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Denies the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-tooltip\"\n        },\n        {\n          \"description\": \"Denies the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-visible\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:default\"\n        },\n        {\n          \"description\": \"Enables the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Enables the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview\"\n        },\n        {\n          \"description\": \"Enables the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview-window\"\n        },\n        {\n          \"description\": \"Enables the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-get-all-webviews\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Enables the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-print\"\n        },\n        {\n          \"description\": \"Enables the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-reparent\"\n        },\n        {\n          \"description\": \"Enables the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-focus\"\n        },\n        {\n          \"description\": \"Enables the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-position\"\n        },\n        {\n          \"description\": \"Enables the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-size\"\n        },\n        {\n          \"description\": \"Enables the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Enables the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-close\"\n        },\n        {\n          \"description\": \"Enables the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-hide\"\n        },\n        {\n          \"description\": \"Enables the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-position\"\n        },\n        {\n          \"description\": \"Enables the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-show\"\n        },\n        {\n          \"description\": \"Enables the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-size\"\n        },\n        {\n          \"description\": \"Denies the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Denies the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview\"\n        },\n        {\n          \"description\": \"Denies the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview-window\"\n        },\n        {\n          \"description\": \"Denies the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-get-all-webviews\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Denies the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-print\"\n        },\n        {\n          \"description\": \"Denies the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-reparent\"\n        },\n        {\n          \"description\": \"Denies the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-focus\"\n        },\n        {\n          \"description\": \"Denies the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-position\"\n        },\n        {\n          \"description\": \"Denies the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-size\"\n        },\n        {\n          \"description\": \"Denies the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Denies the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-close\"\n        },\n        {\n          \"description\": \"Denies the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-hide\"\n        },\n        {\n          \"description\": \"Denies the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-position\"\n        },\n        {\n          \"description\": \"Denies the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-show\"\n        },\n        {\n          \"description\": \"Denies the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:default\"\n        },\n        {\n          \"description\": \"Enables the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-available-monitors\"\n        },\n        {\n          \"description\": \"Enables the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-center\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-close\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-create\"\n        },\n        {\n          \"description\": \"Enables the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-current-monitor\"\n        },\n        {\n          \"description\": \"Enables the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-destroy\"\n        },\n        {\n          \"description\": \"Enables the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-get-all-windows\"\n        },\n        {\n          \"description\": \"Enables the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-hide\"\n        },\n        {\n          \"description\": \"Enables the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-position\"\n        },\n        {\n          \"description\": \"Enables the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-size\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-closable\"\n        },\n        {\n          \"description\": \"Enables the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-decorated\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-focused\"\n        },\n        {\n          \"description\": \"Enables the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximizable\"\n        },\n        {\n          \"description\": \"Enables the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximized\"\n        },\n        {\n          \"description\": \"Enables the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimizable\"\n        },\n        {\n          \"description\": \"Enables the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimized\"\n        },\n        {\n          \"description\": \"Enables the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-resizable\"\n        },\n        {\n          \"description\": \"Enables the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-visible\"\n        },\n        {\n          \"description\": \"Enables the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-maximize\"\n        },\n        {\n          \"description\": \"Enables the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-minimize\"\n        },\n        {\n          \"description\": \"Enables the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-monitor-from-point\"\n        },\n        {\n          \"description\": \"Enables the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-position\"\n        },\n        {\n          \"description\": \"Enables the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-size\"\n        },\n        {\n          \"description\": \"Enables the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-primary-monitor\"\n        },\n        {\n          \"description\": \"Enables the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-request-user-attention\"\n        },\n        {\n          \"description\": \"Enables the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-scale-factor\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-count\"\n        },\n        {\n          \"description\": \"Enables the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-label\"\n        },\n        {\n          \"description\": \"Enables the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-closable\"\n        },\n        {\n          \"description\": \"Enables the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-content-protected\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Enables the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-decorations\"\n        },\n        {\n          \"description\": \"Enables the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-effects\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-focus\"\n        },\n        {\n          \"description\": \"Enables the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Enables the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-max-size\"\n        },\n        {\n          \"description\": \"Enables the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-maximizable\"\n        },\n        {\n          \"description\": \"Enables the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-min-size\"\n        },\n        {\n          \"description\": \"Enables the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-minimizable\"\n        },\n        {\n          \"description\": \"Enables the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Enables the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-position\"\n        },\n        {\n          \"description\": \"Enables the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-progress-bar\"\n        },\n        {\n          \"description\": \"Enables the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-resizable\"\n        },\n        {\n          \"description\": \"Enables the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-shadow\"\n        },\n        {\n          \"description\": \"Enables the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size\"\n        },\n        {\n          \"description\": \"Enables the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size-constraints\"\n        },\n        {\n          \"description\": \"Enables the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Enables the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-theme\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Enables the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-show\"\n        },\n        {\n          \"description\": \"Enables the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-dragging\"\n        },\n        {\n          \"description\": \"Enables the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Enables the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-theme\"\n        },\n        {\n          \"description\": \"Enables the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-title\"\n        },\n        {\n          \"description\": \"Enables the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unmaximize\"\n        },\n        {\n          \"description\": \"Enables the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unminimize\"\n        },\n        {\n          \"description\": \"Denies the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-available-monitors\"\n        },\n        {\n          \"description\": \"Denies the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-center\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-close\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-create\"\n        },\n        {\n          \"description\": \"Denies the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-current-monitor\"\n        },\n        {\n          \"description\": \"Denies the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-destroy\"\n        },\n        {\n          \"description\": \"Denies the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-get-all-windows\"\n        },\n        {\n          \"description\": \"Denies the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-hide\"\n        },\n        {\n          \"description\": \"Denies the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-position\"\n        },\n        {\n          \"description\": \"Denies the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-size\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-closable\"\n        },\n        {\n          \"description\": \"Denies the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-decorated\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-focused\"\n        },\n        {\n          \"description\": \"Denies the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximizable\"\n        },\n        {\n          \"description\": \"Denies the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximized\"\n        },\n        {\n          \"description\": \"Denies the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimizable\"\n        },\n        {\n          \"description\": \"Denies the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimized\"\n        },\n        {\n          \"description\": \"Denies the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-resizable\"\n        },\n        {\n          \"description\": \"Denies the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-visible\"\n        },\n        {\n          \"description\": \"Denies the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-maximize\"\n        },\n        {\n          \"description\": \"Denies the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-minimize\"\n        },\n        {\n          \"description\": \"Denies the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-monitor-from-point\"\n        },\n        {\n          \"description\": \"Denies the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-position\"\n        },\n        {\n          \"description\": \"Denies the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-size\"\n        },\n        {\n          \"description\": \"Denies the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-primary-monitor\"\n        },\n        {\n          \"description\": \"Denies the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-request-user-attention\"\n        },\n        {\n          \"description\": \"Denies the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-scale-factor\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-count\"\n        },\n        {\n          \"description\": \"Denies the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-label\"\n        },\n        {\n          \"description\": \"Denies the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-closable\"\n        },\n        {\n          \"description\": \"Denies the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-content-protected\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Denies the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-decorations\"\n        },\n        {\n          \"description\": \"Denies the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-effects\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-focus\"\n        },\n        {\n          \"description\": \"Denies the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Denies the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-max-size\"\n        },\n        {\n          \"description\": \"Denies the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-maximizable\"\n        },\n        {\n          \"description\": \"Denies the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-min-size\"\n        },\n        {\n          \"description\": \"Denies the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-minimizable\"\n        },\n        {\n          \"description\": \"Denies the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Denies the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-position\"\n        },\n        {\n          \"description\": \"Denies the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-progress-bar\"\n        },\n        {\n          \"description\": \"Denies the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-resizable\"\n        },\n        {\n          \"description\": \"Denies the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-shadow\"\n        },\n        {\n          \"description\": \"Denies the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size\"\n        },\n        {\n          \"description\": \"Denies the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size-constraints\"\n        },\n        {\n          \"description\": \"Denies the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Denies the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-theme\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Denies the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-show\"\n        },\n        {\n          \"description\": \"Denies the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-dragging\"\n        },\n        {\n          \"description\": \"Denies the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Denies the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-theme\"\n        },\n        {\n          \"description\": \"Denies the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-title\"\n        },\n        {\n          \"description\": \"Denies the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unmaximize\"\n        },\n        {\n          \"description\": \"Denies the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unminimize\"\n        },\n        {\n          \"description\": \"This permission set configures the types of dialogs\\navailable from the dialog plugin.\\n\\n#### Granted Permissions\\n\\nAll dialog types are enabled.\\n\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"dialog:default\"\n        },\n        {\n          \"description\": \"Enables the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-ask\"\n        },\n        {\n          \"description\": \"Enables the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-confirm\"\n        },\n        {\n          \"description\": \"Enables the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-message\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-open\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-save\"\n        },\n        {\n          \"description\": \"Denies the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-ask\"\n        },\n        {\n          \"description\": \"Denies the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-confirm\"\n        },\n        {\n          \"description\": \"Denies the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-message\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-open\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-save\"\n        },\n        {\n          \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:default\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write-recursive\"\n        },\n        {\n          \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-default\"\n        },\n        {\n          \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-copy-file\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-create\"\n        },\n        {\n          \"description\": \"Enables the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exists\"\n        },\n        {\n          \"description\": \"Enables the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-fstat\"\n        },\n        {\n          \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-ftruncate\"\n        },\n        {\n          \"description\": \"Enables the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-lstat\"\n        },\n        {\n          \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-mkdir\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-open\"\n        },\n        {\n          \"description\": \"Enables the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read\"\n        },\n        {\n          \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-dir\"\n        },\n        {\n          \"description\": \"Enables the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-rename\"\n        },\n        {\n          \"description\": \"Enables the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-seek\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-size\"\n        },\n        {\n          \"description\": \"Enables the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-stat\"\n        },\n        {\n          \"description\": \"Enables the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-truncate\"\n        },\n        {\n          \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-unwatch\"\n        },\n        {\n          \"description\": \"Enables the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-watch\"\n        },\n        {\n          \"description\": \"Enables the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write\"\n        },\n        {\n          \"description\": \"Enables the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-file\"\n        },\n        {\n          \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-text-file\"\n        },\n        {\n          \"description\": \"This permissions allows to create the application specific directories.\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:create-app-specific-dirs\"\n        },\n        {\n          \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-copy-file\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-create\"\n        },\n        {\n          \"description\": \"Denies the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-exists\"\n        },\n        {\n          \"description\": \"Denies the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-fstat\"\n        },\n        {\n          \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-ftruncate\"\n        },\n        {\n          \"description\": \"Denies the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-lstat\"\n        },\n        {\n          \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-mkdir\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-open\"\n        },\n        {\n          \"description\": \"Denies the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read\"\n        },\n        {\n          \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-dir\"\n        },\n        {\n          \"description\": \"Denies the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-rename\"\n        },\n        {\n          \"description\": \"Denies the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-seek\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-size\"\n        },\n        {\n          \"description\": \"Denies the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-stat\"\n        },\n        {\n          \"description\": \"Denies the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-truncate\"\n        },\n        {\n          \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-unwatch\"\n        },\n        {\n          \"description\": \"Denies the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-watch\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-linux\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-windows\"\n        },\n        {\n          \"description\": \"Denies the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write\"\n        },\n        {\n          \"description\": \"Denies the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-file\"\n        },\n        {\n          \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-text-file\"\n        },\n        {\n          \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-all\"\n        },\n        {\n          \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-app-specific-dirs-recursive\"\n        },\n        {\n          \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-dirs\"\n        },\n        {\n          \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-files\"\n        },\n        {\n          \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-meta\"\n        },\n        {\n          \"description\": \"An empty permission you can use to modify the global scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the application directories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-recursive\"\n        },\n        {\n          \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-all\"\n        },\n        {\n          \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-files\"\n        },\n        {\n          \"description\": \"Allows the log command\",\n          \"type\": \"string\",\n          \"const\": \"log:default\"\n        },\n        {\n          \"description\": \"Enables the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:allow-log\"\n        },\n        {\n          \"description\": \"Denies the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:deny-log\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nnotification features are by default exposed.\\n\\n#### Granted Permissions\\n\\nIt allows all notification related features.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"notification:default\"\n        },\n        {\n          \"description\": \"Enables the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-batch\"\n        },\n        {\n          \"description\": \"Enables the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-cancel\"\n        },\n        {\n          \"description\": \"Enables the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-check-permissions\"\n        },\n        {\n          \"description\": \"Enables the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-create-channel\"\n        },\n        {\n          \"description\": \"Enables the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-delete-channel\"\n        },\n        {\n          \"description\": \"Enables the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-active\"\n        },\n        {\n          \"description\": \"Enables the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-pending\"\n        },\n        {\n          \"description\": \"Enables the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-is-permission-granted\"\n        },\n        {\n          \"description\": \"Enables the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-list-channels\"\n        },\n        {\n          \"description\": \"Enables the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-notify\"\n        },\n        {\n          \"description\": \"Enables the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-permission-state\"\n        },\n        {\n          \"description\": \"Enables the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-action-types\"\n        },\n        {\n          \"description\": \"Enables the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-listener\"\n        },\n        {\n          \"description\": \"Enables the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-remove-active\"\n        },\n        {\n          \"description\": \"Enables the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-request-permission\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-show\"\n        },\n        {\n          \"description\": \"Denies the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-batch\"\n        },\n        {\n          \"description\": \"Denies the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-cancel\"\n        },\n        {\n          \"description\": \"Denies the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-check-permissions\"\n        },\n        {\n          \"description\": \"Denies the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-create-channel\"\n        },\n        {\n          \"description\": \"Denies the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-delete-channel\"\n        },\n        {\n          \"description\": \"Denies the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-active\"\n        },\n        {\n          \"description\": \"Denies the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-pending\"\n        },\n        {\n          \"description\": \"Denies the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-is-permission-granted\"\n        },\n        {\n          \"description\": \"Denies the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-list-channels\"\n        },\n        {\n          \"description\": \"Denies the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-notify\"\n        },\n        {\n          \"description\": \"Denies the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-permission-state\"\n        },\n        {\n          \"description\": \"Denies the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-action-types\"\n        },\n        {\n          \"description\": \"Denies the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-listener\"\n        },\n        {\n          \"description\": \"Denies the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-remove-active\"\n        },\n        {\n          \"description\": \"Denies the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-request-permission\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-show\"\n        },\n        {\n          \"description\": \"This permission set configures which\\noperating system information are available\\nto gather from the frontend.\\n\\n#### Granted Permissions\\n\\nAll information except the host name are available.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"os:default\"\n        },\n        {\n          \"description\": \"Enables the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-arch\"\n        },\n        {\n          \"description\": \"Enables the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-exe-extension\"\n        },\n        {\n          \"description\": \"Enables the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-family\"\n        },\n        {\n          \"description\": \"Enables the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-hostname\"\n        },\n        {\n          \"description\": \"Enables the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-locale\"\n        },\n        {\n          \"description\": \"Enables the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-os-type\"\n        },\n        {\n          \"description\": \"Enables the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-platform\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-version\"\n        },\n        {\n          \"description\": \"Denies the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-arch\"\n        },\n        {\n          \"description\": \"Denies the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-exe-extension\"\n        },\n        {\n          \"description\": \"Denies the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-family\"\n        },\n        {\n          \"description\": \"Denies the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-hostname\"\n        },\n        {\n          \"description\": \"Denies the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-locale\"\n        },\n        {\n          \"description\": \"Denies the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-os-type\"\n        },\n        {\n          \"description\": \"Denies the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-platform\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-version\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nprocess feeatures are by default exposed.\\n\\n#### Granted Permissions\\n\\nThis enables to quit via `allow-exit` and restart via `allow-restart`\\nthe application.\\n\",\n          \"type\": \"string\",\n          \"const\": \"process:default\"\n        },\n        {\n          \"description\": \"Enables the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-exit\"\n        },\n        {\n          \"description\": \"Enables the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-restart\"\n        },\n        {\n          \"description\": \"Denies the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-exit\"\n        },\n        {\n          \"description\": \"Denies the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-restart\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n          \"type\": \"string\",\n          \"const\": \"shell:default\"\n        },\n        {\n          \"description\": \"Enables the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-execute\"\n        },\n        {\n          \"description\": \"Enables the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-kill\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-open\"\n        },\n        {\n          \"description\": \"Enables the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-spawn\"\n        },\n        {\n          \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-stdin-write\"\n        },\n        {\n          \"description\": \"Denies the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-execute\"\n        },\n        {\n          \"description\": \"Denies the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-kill\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-open\"\n        },\n        {\n          \"description\": \"Denies the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-spawn\"\n        },\n        {\n          \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-stdin-write\"\n        },\n        {\n          \"description\": \"This permission set configures what kind of\\noperations are available from the store plugin.\\n\\n#### Granted Permissions\\n\\nAll operations are enabled by default.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"store:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-delete\"\n        },\n        {\n          \"description\": \"Enables the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-entries\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get\"\n        },\n        {\n          \"description\": \"Enables the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get-store\"\n        },\n        {\n          \"description\": \"Enables the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-has\"\n        },\n        {\n          \"description\": \"Enables the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-keys\"\n        },\n        {\n          \"description\": \"Enables the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-length\"\n        },\n        {\n          \"description\": \"Enables the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-load\"\n        },\n        {\n          \"description\": \"Enables the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reload\"\n        },\n        {\n          \"description\": \"Enables the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reset\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-save\"\n        },\n        {\n          \"description\": \"Enables the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-set\"\n        },\n        {\n          \"description\": \"Enables the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-values\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-delete\"\n        },\n        {\n          \"description\": \"Denies the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-entries\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get\"\n        },\n        {\n          \"description\": \"Denies the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get-store\"\n        },\n        {\n          \"description\": \"Denies the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-has\"\n        },\n        {\n          \"description\": \"Denies the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-keys\"\n        },\n        {\n          \"description\": \"Denies the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-length\"\n        },\n        {\n          \"description\": \"Denies the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-load\"\n        },\n        {\n          \"description\": \"Denies the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reload\"\n        },\n        {\n          \"description\": \"Denies the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reset\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-save\"\n        },\n        {\n          \"description\": \"Denies the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-set\"\n        },\n        {\n          \"description\": \"Denies the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-values\"\n        },\n        {\n          \"description\": \"This permission set configures which kind of\\nupdater functions are exposed to the frontend.\\n\\n#### Granted Permissions\\n\\nThe full workflow from checking for updates to installing them\\nis enabled.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"updater:default\"\n        },\n        {\n          \"description\": \"Enables the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-check\"\n        },\n        {\n          \"description\": \"Enables the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download\"\n        },\n        {\n          \"description\": \"Enables the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download-and-install\"\n        },\n        {\n          \"description\": \"Enables the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-install\"\n        },\n        {\n          \"description\": \"Denies the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-check\"\n        },\n        {\n          \"description\": \"Denies the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download\"\n        },\n        {\n          \"description\": \"Denies the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download-and-install\"\n        },\n        {\n          \"description\": \"Denies the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-install\"\n        }\n      ]\n    },\n    \"Value\": {\n      \"description\": \"All supported ACL values.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents a null JSON value.\",\n          \"type\": \"null\"\n        },\n        {\n          \"description\": \"Represents a [`bool`].\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"Represents a valid ACL [`Number`].\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Number\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Represents a [`String`].\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"Represents a list of other [`Value`]s.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        },\n        {\n          \"description\": \"Represents a map of [`String`] keys to [`Value`]s.\",\n          \"type\": \"object\",\n          \"additionalProperties\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        }\n      ]\n    },\n    \"Number\": {\n      \"description\": \"A valid ACL number.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents an [`i64`].\",\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        {\n          \"description\": \"Represents a [`f64`].\",\n          \"type\": \"number\",\n          \"format\": \"double\"\n        }\n      ]\n    },\n    \"Target\": {\n      \"description\": \"Platform target.\",\n      \"oneOf\": [\n        {\n          \"description\": \"MacOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"macOS\"\n          ]\n        },\n        {\n          \"description\": \"Windows.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"windows\"\n          ]\n        },\n        {\n          \"description\": \"Linux.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"linux\"\n          ]\n        },\n        {\n          \"description\": \"Android.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"android\"\n          ]\n        },\n        {\n          \"description\": \"iOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"iOS\"\n          ]\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArg\": {\n      \"description\": \"A command argument allowed to be executed by the webview API.\",\n      \"anyOf\": [\n        {\n          \"description\": \"A non-configurable argument that is passed to the command in the order it was specified.\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"A variable that is set while calling the command from the webview API.\",\n          \"type\": \"object\",\n          \"required\": [\n            \"validator\"\n          ],\n          \"properties\": {\n            \"raw\": {\n              \"description\": \"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\\n\\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.\",\n              \"default\": false,\n              \"type\": \"boolean\"\n            },\n            \"validator\": {\n              \"description\": \"[regex] validator to require passed values to conform to an expected input.\\n\\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\\n\\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\\\w+` regex would be registered as `^https?://\\\\w+$`.\\n\\n[regex]: <https://docs.rs/regex/latest/regex/#syntax>\",\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArgs\": {\n      \"description\": \"A set of command arguments allowed to be executed by the webview API.\\n\\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Use a simple boolean to allow all or disable all arguments to this command configuration.\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/ShellScopeEntryAllowedArg\"\n          }\n        }\n      ]\n    }\n  }\n}"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/macOS-schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"CapabilityFile\",\n  \"description\": \"Capability formats accepted in a capability file.\",\n  \"anyOf\": [\n    {\n      \"description\": \"A single capability.\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Capability\"\n        }\n      ]\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/Capability\"\n      }\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"capabilities\"\n      ],\n      \"properties\": {\n        \"capabilities\": {\n          \"description\": \"The list of capabilities.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Capability\"\n          }\n        }\n      }\n    }\n  ],\n  \"definitions\": {\n    \"Capability\": {\n      \"description\": \"A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\\n\\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\\n\\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\\n\\n## Example\\n\\n```json { \\\"identifier\\\": \\\"main-user-files-write\\\", \\\"description\\\": \\\"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\\\", \\\"windows\\\": [ \\\"main\\\" ], \\\"permissions\\\": [ \\\"core:default\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] }, ], \\\"platforms\\\": [\\\"macOS\\\",\\\"windows\\\"] } ```\",\n      \"type\": \"object\",\n      \"required\": [\n        \"identifier\",\n        \"permissions\"\n      ],\n      \"properties\": {\n        \"identifier\": {\n          \"description\": \"Identifier of the capability.\\n\\n## Example\\n\\n`main-user-files-write`\",\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"description\": \"Description of what the capability is intended to allow on associated windows.\\n\\nIt should contain a description of what the grouped permissions should allow.\\n\\n## Example\\n\\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\",\n          \"default\": \"\",\n          \"type\": \"string\"\n        },\n        \"remote\": {\n          \"description\": \"Configure remote URLs that can use the capability permissions.\\n\\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\\n\\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\\n\\n## Example\\n\\n```json { \\\"urls\\\": [\\\"https://*.mydomain.dev\\\"] } ```\",\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/CapabilityRemote\"\n            },\n            {\n              \"type\": \"null\"\n            }\n          ]\n        },\n        \"local\": {\n          \"description\": \"Whether this capability is enabled for local app URLs or not. Defaults to `true`.\",\n          \"default\": true,\n          \"type\": \"boolean\"\n        },\n        \"windows\": {\n          \"description\": \"List of windows that are affected by this capability. Can be a glob pattern.\\n\\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\\n\\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\\n\\n## Example\\n\\n`[\\\"main\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"webviews\": {\n          \"description\": \"List of webviews that are affected by this capability. Can be a glob pattern.\\n\\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\\n\\n## Example\\n\\n`[\\\"sub-webview-one\\\", \\\"sub-webview-two\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"permissions\": {\n          \"description\": \"List of permissions attached to this capability.\\n\\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\\n\\n## Example\\n\\n```json [ \\\"core:default\\\", \\\"shell:allow-open\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] } ] ```\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/PermissionEntry\"\n          },\n          \"uniqueItems\": true\n        },\n        \"platforms\": {\n          \"description\": \"Limit which target platforms this capability applies to.\\n\\nBy default all platforms are targeted.\\n\\n## Example\\n\\n`[\\\"macOS\\\",\\\"windows\\\"]`\",\n          \"type\": [\n            \"array\",\n            \"null\"\n          ],\n          \"items\": {\n            \"$ref\": \"#/definitions/Target\"\n          }\n        }\n      }\n    },\n    \"CapabilityRemote\": {\n      \"description\": \"Configuration for remote URLs that are associated with the capability.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"urls\"\n      ],\n      \"properties\": {\n        \"urls\": {\n          \"description\": \"Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\\n\\n## Examples\\n\\n- \\\"https://*.mydomain.dev\\\": allows subdomains of mydomain.dev - \\\"https://mydomain.dev/api/*\\\": allows any subpath of mydomain.dev/api\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"PermissionEntry\": {\n      \"description\": \"An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Reference a permission or permission set by identifier.\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Identifier\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Reference a permission or permission set by identifier and extends its scope.\",\n          \"type\": \"object\",\n          \"allOf\": [\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:default\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-default\"\n                      },\n                      {\n                        \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-copy-file\"\n                      },\n                      {\n                        \"description\": \"Enables the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-create\"\n                      },\n                      {\n                        \"description\": \"Enables the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exists\"\n                      },\n                      {\n                        \"description\": \"Enables the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-fstat\"\n                      },\n                      {\n                        \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Enables the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-lstat\"\n                      },\n                      {\n                        \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-mkdir\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read\"\n                      },\n                      {\n                        \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-dir\"\n                      },\n                      {\n                        \"description\": \"Enables the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Enables the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-remove\"\n                      },\n                      {\n                        \"description\": \"Enables the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-rename\"\n                      },\n                      {\n                        \"description\": \"Enables the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-seek\"\n                      },\n                      {\n                        \"description\": \"Enables the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-size\"\n                      },\n                      {\n                        \"description\": \"Enables the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-stat\"\n                      },\n                      {\n                        \"description\": \"Enables the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-truncate\"\n                      },\n                      {\n                        \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-unwatch\"\n                      },\n                      {\n                        \"description\": \"Enables the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-watch\"\n                      },\n                      {\n                        \"description\": \"Enables the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write\"\n                      },\n                      {\n                        \"description\": \"Enables the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-file\"\n                      },\n                      {\n                        \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This permissions allows to create the application specific directories.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:create-app-specific-dirs\"\n                      },\n                      {\n                        \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-copy-file\"\n                      },\n                      {\n                        \"description\": \"Denies the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-create\"\n                      },\n                      {\n                        \"description\": \"Denies the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-exists\"\n                      },\n                      {\n                        \"description\": \"Denies the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-fstat\"\n                      },\n                      {\n                        \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Denies the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-lstat\"\n                      },\n                      {\n                        \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-mkdir\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read\"\n                      },\n                      {\n                        \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-dir\"\n                      },\n                      {\n                        \"description\": \"Denies the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Denies the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-remove\"\n                      },\n                      {\n                        \"description\": \"Denies the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-rename\"\n                      },\n                      {\n                        \"description\": \"Denies the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-seek\"\n                      },\n                      {\n                        \"description\": \"Denies the size command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-size\"\n                      },\n                      {\n                        \"description\": \"Denies the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-stat\"\n                      },\n                      {\n                        \"description\": \"Denies the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-truncate\"\n                      },\n                      {\n                        \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-unwatch\"\n                      },\n                      {\n                        \"description\": \"Denies the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-watch\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-linux\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-windows\"\n                      },\n                      {\n                        \"description\": \"Denies the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write\"\n                      },\n                      {\n                        \"description\": \"Denies the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-file\"\n                      },\n                      {\n                        \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-all\"\n                      },\n                      {\n                        \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-app-specific-dirs-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-dirs\"\n                      },\n                      {\n                        \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-files\"\n                      },\n                      {\n                        \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-meta\"\n                      },\n                      {\n                        \"description\": \"An empty permission you can use to modify the global scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the application directories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-all\"\n                      },\n                      {\n                        \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-files\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"A path that can be accessed by the webview when using the fs APIs.\\n\\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:default\"\n                      },\n                      {\n                        \"description\": \"Enables the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-execute\"\n                      },\n                      {\n                        \"description\": \"Enables the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-kill\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-spawn\"\n                      },\n                      {\n                        \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-stdin-write\"\n                      },\n                      {\n                        \"description\": \"Denies the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-execute\"\n                      },\n                      {\n                        \"description\": \"Denies the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-kill\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-spawn\"\n                      },\n                      {\n                        \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-stdin-write\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                },\n                \"allow\": {\n                  \"description\": \"Data that defines what is allowed by the scope.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                },\n                \"deny\": {\n                  \"description\": \"Data that defines what is denied by the scope. This should be prioritized by validation logic.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                }\n              }\n            }\n          ],\n          \"required\": [\n            \"identifier\"\n          ]\n        }\n      ]\n    },\n    \"Identifier\": {\n      \"description\": \"Permission identifier\",\n      \"oneOf\": [\n        {\n          \"description\": \"No features are enabled by default, as we believe\\nthe clipboard can be inherently dangerous and it is \\napplication specific if read and/or write access is needed.\\n\\nClipboard interaction needs to be explicitly enabled.\\n\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-image\"\n        },\n        {\n          \"description\": \"Enables the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-text\"\n        },\n        {\n          \"description\": \"Enables the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-html\"\n        },\n        {\n          \"description\": \"Enables the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-image\"\n        },\n        {\n          \"description\": \"Enables the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-text\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-image\"\n        },\n        {\n          \"description\": \"Denies the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-text\"\n        },\n        {\n          \"description\": \"Denies the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-html\"\n        },\n        {\n          \"description\": \"Denies the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-image\"\n        },\n        {\n          \"description\": \"Denies the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-text\"\n        },\n        {\n          \"description\": \"Default core plugins set which includes:\\n- 'core:path:default'\\n- 'core:event:default'\\n- 'core:window:default'\\n- 'core:webview:default'\\n- 'core:app:default'\\n- 'core:image:default'\\n- 'core:resources:default'\\n- 'core:menu:default'\\n- 'core:tray:default'\\n\",\n          \"type\": \"string\",\n          \"const\": \"core:default\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:default\"\n        },\n        {\n          \"description\": \"Enables the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-hide\"\n        },\n        {\n          \"description\": \"Enables the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-show\"\n        },\n        {\n          \"description\": \"Enables the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-default-window-icon\"\n        },\n        {\n          \"description\": \"Enables the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Enables the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-identifier\"\n        },\n        {\n          \"description\": \"Enables the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-name\"\n        },\n        {\n          \"description\": \"Enables the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-remove-data-store\"\n        },\n        {\n          \"description\": \"Enables the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-set-app-theme\"\n        },\n        {\n          \"description\": \"Enables the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-tauri-version\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-version\"\n        },\n        {\n          \"description\": \"Denies the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-hide\"\n        },\n        {\n          \"description\": \"Denies the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-show\"\n        },\n        {\n          \"description\": \"Denies the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-default-window-icon\"\n        },\n        {\n          \"description\": \"Denies the fetch_data_store_identifiers command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-fetch-data-store-identifiers\"\n        },\n        {\n          \"description\": \"Denies the identifier command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-identifier\"\n        },\n        {\n          \"description\": \"Denies the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-name\"\n        },\n        {\n          \"description\": \"Denies the remove_data_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-remove-data-store\"\n        },\n        {\n          \"description\": \"Denies the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-set-app-theme\"\n        },\n        {\n          \"description\": \"Denies the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-tauri-version\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-version\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:default\"\n        },\n        {\n          \"description\": \"Enables the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit\"\n        },\n        {\n          \"description\": \"Enables the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit-to\"\n        },\n        {\n          \"description\": \"Enables the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-listen\"\n        },\n        {\n          \"description\": \"Enables the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-unlisten\"\n        },\n        {\n          \"description\": \"Denies the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit\"\n        },\n        {\n          \"description\": \"Denies the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit-to\"\n        },\n        {\n          \"description\": \"Denies the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-listen\"\n        },\n        {\n          \"description\": \"Denies the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-unlisten\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:default\"\n        },\n        {\n          \"description\": \"Enables the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-bytes\"\n        },\n        {\n          \"description\": \"Enables the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-path\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-new\"\n        },\n        {\n          \"description\": \"Enables the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-rgba\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-size\"\n        },\n        {\n          \"description\": \"Denies the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-bytes\"\n        },\n        {\n          \"description\": \"Denies the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-path\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-new\"\n        },\n        {\n          \"description\": \"Denies the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-rgba\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:default\"\n        },\n        {\n          \"description\": \"Enables the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-append\"\n        },\n        {\n          \"description\": \"Enables the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-create-default\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-get\"\n        },\n        {\n          \"description\": \"Enables the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-insert\"\n        },\n        {\n          \"description\": \"Enables the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-checked\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-items\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-new\"\n        },\n        {\n          \"description\": \"Enables the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-popup\"\n        },\n        {\n          \"description\": \"Enables the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-prepend\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove-at\"\n        },\n        {\n          \"description\": \"Enables the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-accelerator\"\n        },\n        {\n          \"description\": \"Enables the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-checked\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-text\"\n        },\n        {\n          \"description\": \"Enables the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-text\"\n        },\n        {\n          \"description\": \"Denies the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-append\"\n        },\n        {\n          \"description\": \"Denies the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-create-default\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-get\"\n        },\n        {\n          \"description\": \"Denies the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-insert\"\n        },\n        {\n          \"description\": \"Denies the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-checked\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-items\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-new\"\n        },\n        {\n          \"description\": \"Denies the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-popup\"\n        },\n        {\n          \"description\": \"Denies the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-prepend\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove-at\"\n        },\n        {\n          \"description\": \"Denies the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-accelerator\"\n        },\n        {\n          \"description\": \"Denies the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-checked\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-text\"\n        },\n        {\n          \"description\": \"Denies the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-text\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:default\"\n        },\n        {\n          \"description\": \"Enables the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-basename\"\n        },\n        {\n          \"description\": \"Enables the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-dirname\"\n        },\n        {\n          \"description\": \"Enables the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-extname\"\n        },\n        {\n          \"description\": \"Enables the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-is-absolute\"\n        },\n        {\n          \"description\": \"Enables the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-join\"\n        },\n        {\n          \"description\": \"Enables the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-normalize\"\n        },\n        {\n          \"description\": \"Enables the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve\"\n        },\n        {\n          \"description\": \"Enables the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve-directory\"\n        },\n        {\n          \"description\": \"Denies the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-basename\"\n        },\n        {\n          \"description\": \"Denies the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-dirname\"\n        },\n        {\n          \"description\": \"Denies the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-extname\"\n        },\n        {\n          \"description\": \"Denies the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-is-absolute\"\n        },\n        {\n          \"description\": \"Denies the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-join\"\n        },\n        {\n          \"description\": \"Denies the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-normalize\"\n        },\n        {\n          \"description\": \"Denies the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve\"\n        },\n        {\n          \"description\": \"Denies the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve-directory\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:default\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:allow-close\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:deny-close\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:default\"\n        },\n        {\n          \"description\": \"Enables the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-get-by-id\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-new\"\n        },\n        {\n          \"description\": \"Enables the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-remove-by-id\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Enables the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-menu\"\n        },\n        {\n          \"description\": \"Enables the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Enables the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-tooltip\"\n        },\n        {\n          \"description\": \"Enables the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-visible\"\n        },\n        {\n          \"description\": \"Denies the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-get-by-id\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-new\"\n        },\n        {\n          \"description\": \"Denies the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-remove-by-id\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Denies the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-menu\"\n        },\n        {\n          \"description\": \"Denies the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Denies the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-tooltip\"\n        },\n        {\n          \"description\": \"Denies the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-visible\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:default\"\n        },\n        {\n          \"description\": \"Enables the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Enables the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview\"\n        },\n        {\n          \"description\": \"Enables the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview-window\"\n        },\n        {\n          \"description\": \"Enables the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-get-all-webviews\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Enables the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-print\"\n        },\n        {\n          \"description\": \"Enables the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-reparent\"\n        },\n        {\n          \"description\": \"Enables the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-focus\"\n        },\n        {\n          \"description\": \"Enables the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-position\"\n        },\n        {\n          \"description\": \"Enables the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-size\"\n        },\n        {\n          \"description\": \"Enables the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Enables the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-close\"\n        },\n        {\n          \"description\": \"Enables the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-hide\"\n        },\n        {\n          \"description\": \"Enables the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-position\"\n        },\n        {\n          \"description\": \"Enables the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-show\"\n        },\n        {\n          \"description\": \"Enables the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-size\"\n        },\n        {\n          \"description\": \"Denies the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Denies the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview\"\n        },\n        {\n          \"description\": \"Denies the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview-window\"\n        },\n        {\n          \"description\": \"Denies the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-get-all-webviews\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Denies the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-print\"\n        },\n        {\n          \"description\": \"Denies the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-reparent\"\n        },\n        {\n          \"description\": \"Denies the set_webview_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-focus\"\n        },\n        {\n          \"description\": \"Denies the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-position\"\n        },\n        {\n          \"description\": \"Denies the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-size\"\n        },\n        {\n          \"description\": \"Denies the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Denies the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-close\"\n        },\n        {\n          \"description\": \"Denies the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-hide\"\n        },\n        {\n          \"description\": \"Denies the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-position\"\n        },\n        {\n          \"description\": \"Denies the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-show\"\n        },\n        {\n          \"description\": \"Denies the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:default\"\n        },\n        {\n          \"description\": \"Enables the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-available-monitors\"\n        },\n        {\n          \"description\": \"Enables the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-center\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-close\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-create\"\n        },\n        {\n          \"description\": \"Enables the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-current-monitor\"\n        },\n        {\n          \"description\": \"Enables the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-destroy\"\n        },\n        {\n          \"description\": \"Enables the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-get-all-windows\"\n        },\n        {\n          \"description\": \"Enables the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-hide\"\n        },\n        {\n          \"description\": \"Enables the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-position\"\n        },\n        {\n          \"description\": \"Enables the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-size\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-closable\"\n        },\n        {\n          \"description\": \"Enables the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-decorated\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-focused\"\n        },\n        {\n          \"description\": \"Enables the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximizable\"\n        },\n        {\n          \"description\": \"Enables the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximized\"\n        },\n        {\n          \"description\": \"Enables the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimizable\"\n        },\n        {\n          \"description\": \"Enables the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimized\"\n        },\n        {\n          \"description\": \"Enables the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-resizable\"\n        },\n        {\n          \"description\": \"Enables the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-visible\"\n        },\n        {\n          \"description\": \"Enables the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-maximize\"\n        },\n        {\n          \"description\": \"Enables the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-minimize\"\n        },\n        {\n          \"description\": \"Enables the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-monitor-from-point\"\n        },\n        {\n          \"description\": \"Enables the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-position\"\n        },\n        {\n          \"description\": \"Enables the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-size\"\n        },\n        {\n          \"description\": \"Enables the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-primary-monitor\"\n        },\n        {\n          \"description\": \"Enables the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-request-user-attention\"\n        },\n        {\n          \"description\": \"Enables the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-scale-factor\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-background-color\"\n        },\n        {\n          \"description\": \"Enables the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-count\"\n        },\n        {\n          \"description\": \"Enables the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-badge-label\"\n        },\n        {\n          \"description\": \"Enables the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-closable\"\n        },\n        {\n          \"description\": \"Enables the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-content-protected\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Enables the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-decorations\"\n        },\n        {\n          \"description\": \"Enables the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-effects\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-focus\"\n        },\n        {\n          \"description\": \"Enables the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Enables the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-max-size\"\n        },\n        {\n          \"description\": \"Enables the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-maximizable\"\n        },\n        {\n          \"description\": \"Enables the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-min-size\"\n        },\n        {\n          \"description\": \"Enables the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-minimizable\"\n        },\n        {\n          \"description\": \"Enables the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Enables the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-position\"\n        },\n        {\n          \"description\": \"Enables the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-progress-bar\"\n        },\n        {\n          \"description\": \"Enables the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-resizable\"\n        },\n        {\n          \"description\": \"Enables the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-shadow\"\n        },\n        {\n          \"description\": \"Enables the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size\"\n        },\n        {\n          \"description\": \"Enables the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size-constraints\"\n        },\n        {\n          \"description\": \"Enables the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Enables the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-theme\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Enables the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-show\"\n        },\n        {\n          \"description\": \"Enables the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-dragging\"\n        },\n        {\n          \"description\": \"Enables the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Enables the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-theme\"\n        },\n        {\n          \"description\": \"Enables the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-title\"\n        },\n        {\n          \"description\": \"Enables the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unmaximize\"\n        },\n        {\n          \"description\": \"Enables the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unminimize\"\n        },\n        {\n          \"description\": \"Denies the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-available-monitors\"\n        },\n        {\n          \"description\": \"Denies the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-center\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-close\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-create\"\n        },\n        {\n          \"description\": \"Denies the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-current-monitor\"\n        },\n        {\n          \"description\": \"Denies the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-destroy\"\n        },\n        {\n          \"description\": \"Denies the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-get-all-windows\"\n        },\n        {\n          \"description\": \"Denies the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-hide\"\n        },\n        {\n          \"description\": \"Denies the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-position\"\n        },\n        {\n          \"description\": \"Denies the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-size\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the is_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-closable\"\n        },\n        {\n          \"description\": \"Denies the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-decorated\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-focused\"\n        },\n        {\n          \"description\": \"Denies the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximizable\"\n        },\n        {\n          \"description\": \"Denies the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximized\"\n        },\n        {\n          \"description\": \"Denies the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimizable\"\n        },\n        {\n          \"description\": \"Denies the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimized\"\n        },\n        {\n          \"description\": \"Denies the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-resizable\"\n        },\n        {\n          \"description\": \"Denies the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-visible\"\n        },\n        {\n          \"description\": \"Denies the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-maximize\"\n        },\n        {\n          \"description\": \"Denies the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-minimize\"\n        },\n        {\n          \"description\": \"Denies the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-monitor-from-point\"\n        },\n        {\n          \"description\": \"Denies the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-position\"\n        },\n        {\n          \"description\": \"Denies the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-size\"\n        },\n        {\n          \"description\": \"Denies the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-primary-monitor\"\n        },\n        {\n          \"description\": \"Denies the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-request-user-attention\"\n        },\n        {\n          \"description\": \"Denies the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-scale-factor\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the set_background_color command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-background-color\"\n        },\n        {\n          \"description\": \"Denies the set_badge_count command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-count\"\n        },\n        {\n          \"description\": \"Denies the set_badge_label command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-badge-label\"\n        },\n        {\n          \"description\": \"Denies the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-closable\"\n        },\n        {\n          \"description\": \"Denies the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-content-protected\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Denies the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-decorations\"\n        },\n        {\n          \"description\": \"Denies the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-effects\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-focus\"\n        },\n        {\n          \"description\": \"Denies the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Denies the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-max-size\"\n        },\n        {\n          \"description\": \"Denies the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-maximizable\"\n        },\n        {\n          \"description\": \"Denies the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-min-size\"\n        },\n        {\n          \"description\": \"Denies the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-minimizable\"\n        },\n        {\n          \"description\": \"Denies the set_overlay_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-overlay-icon\"\n        },\n        {\n          \"description\": \"Denies the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-position\"\n        },\n        {\n          \"description\": \"Denies the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-progress-bar\"\n        },\n        {\n          \"description\": \"Denies the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-resizable\"\n        },\n        {\n          \"description\": \"Denies the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-shadow\"\n        },\n        {\n          \"description\": \"Denies the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size\"\n        },\n        {\n          \"description\": \"Denies the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size-constraints\"\n        },\n        {\n          \"description\": \"Denies the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Denies the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-theme\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Denies the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-show\"\n        },\n        {\n          \"description\": \"Denies the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-dragging\"\n        },\n        {\n          \"description\": \"Denies the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Denies the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-theme\"\n        },\n        {\n          \"description\": \"Denies the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-title\"\n        },\n        {\n          \"description\": \"Denies the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unmaximize\"\n        },\n        {\n          \"description\": \"Denies the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unminimize\"\n        },\n        {\n          \"description\": \"This permission set configures the types of dialogs\\navailable from the dialog plugin.\\n\\n#### Granted Permissions\\n\\nAll dialog types are enabled.\\n\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"dialog:default\"\n        },\n        {\n          \"description\": \"Enables the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-ask\"\n        },\n        {\n          \"description\": \"Enables the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-confirm\"\n        },\n        {\n          \"description\": \"Enables the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-message\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-open\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-save\"\n        },\n        {\n          \"description\": \"Denies the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-ask\"\n        },\n        {\n          \"description\": \"Denies the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-confirm\"\n        },\n        {\n          \"description\": \"Denies the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-message\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-open\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-save\"\n        },\n        {\n          \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n#### Included permissions within this default permission set:\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:default\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write-recursive\"\n        },\n        {\n          \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-default\"\n        },\n        {\n          \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-copy-file\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-create\"\n        },\n        {\n          \"description\": \"Enables the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exists\"\n        },\n        {\n          \"description\": \"Enables the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-fstat\"\n        },\n        {\n          \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-ftruncate\"\n        },\n        {\n          \"description\": \"Enables the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-lstat\"\n        },\n        {\n          \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-mkdir\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-open\"\n        },\n        {\n          \"description\": \"Enables the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read\"\n        },\n        {\n          \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-dir\"\n        },\n        {\n          \"description\": \"Enables the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-rename\"\n        },\n        {\n          \"description\": \"Enables the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-seek\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-size\"\n        },\n        {\n          \"description\": \"Enables the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-stat\"\n        },\n        {\n          \"description\": \"Enables the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-truncate\"\n        },\n        {\n          \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-unwatch\"\n        },\n        {\n          \"description\": \"Enables the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-watch\"\n        },\n        {\n          \"description\": \"Enables the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write\"\n        },\n        {\n          \"description\": \"Enables the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-file\"\n        },\n        {\n          \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-text-file\"\n        },\n        {\n          \"description\": \"This permissions allows to create the application specific directories.\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:create-app-specific-dirs\"\n        },\n        {\n          \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-copy-file\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-create\"\n        },\n        {\n          \"description\": \"Denies the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-exists\"\n        },\n        {\n          \"description\": \"Denies the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-fstat\"\n        },\n        {\n          \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-ftruncate\"\n        },\n        {\n          \"description\": \"Denies the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-lstat\"\n        },\n        {\n          \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-mkdir\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-open\"\n        },\n        {\n          \"description\": \"Denies the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read\"\n        },\n        {\n          \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-dir\"\n        },\n        {\n          \"description\": \"Denies the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-rename\"\n        },\n        {\n          \"description\": \"Denies the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-seek\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-size\"\n        },\n        {\n          \"description\": \"Denies the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-stat\"\n        },\n        {\n          \"description\": \"Denies the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-truncate\"\n        },\n        {\n          \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-unwatch\"\n        },\n        {\n          \"description\": \"Denies the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-watch\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-linux\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-windows\"\n        },\n        {\n          \"description\": \"Denies the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write\"\n        },\n        {\n          \"description\": \"Denies the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-file\"\n        },\n        {\n          \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-text-file\"\n        },\n        {\n          \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-all\"\n        },\n        {\n          \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-app-specific-dirs-recursive\"\n        },\n        {\n          \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-dirs\"\n        },\n        {\n          \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-files\"\n        },\n        {\n          \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-meta\"\n        },\n        {\n          \"description\": \"An empty permission you can use to modify the global scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the application directories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-recursive\"\n        },\n        {\n          \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-all\"\n        },\n        {\n          \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-files\"\n        },\n        {\n          \"description\": \"Allows the log command\",\n          \"type\": \"string\",\n          \"const\": \"log:default\"\n        },\n        {\n          \"description\": \"Enables the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:allow-log\"\n        },\n        {\n          \"description\": \"Denies the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:deny-log\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nnotification features are by default exposed.\\n\\n#### Granted Permissions\\n\\nIt allows all notification related features.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"notification:default\"\n        },\n        {\n          \"description\": \"Enables the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-batch\"\n        },\n        {\n          \"description\": \"Enables the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-cancel\"\n        },\n        {\n          \"description\": \"Enables the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-check-permissions\"\n        },\n        {\n          \"description\": \"Enables the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-create-channel\"\n        },\n        {\n          \"description\": \"Enables the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-delete-channel\"\n        },\n        {\n          \"description\": \"Enables the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-active\"\n        },\n        {\n          \"description\": \"Enables the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-pending\"\n        },\n        {\n          \"description\": \"Enables the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-is-permission-granted\"\n        },\n        {\n          \"description\": \"Enables the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-list-channels\"\n        },\n        {\n          \"description\": \"Enables the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-notify\"\n        },\n        {\n          \"description\": \"Enables the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-permission-state\"\n        },\n        {\n          \"description\": \"Enables the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-action-types\"\n        },\n        {\n          \"description\": \"Enables the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-listener\"\n        },\n        {\n          \"description\": \"Enables the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-remove-active\"\n        },\n        {\n          \"description\": \"Enables the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-request-permission\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-show\"\n        },\n        {\n          \"description\": \"Denies the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-batch\"\n        },\n        {\n          \"description\": \"Denies the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-cancel\"\n        },\n        {\n          \"description\": \"Denies the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-check-permissions\"\n        },\n        {\n          \"description\": \"Denies the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-create-channel\"\n        },\n        {\n          \"description\": \"Denies the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-delete-channel\"\n        },\n        {\n          \"description\": \"Denies the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-active\"\n        },\n        {\n          \"description\": \"Denies the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-pending\"\n        },\n        {\n          \"description\": \"Denies the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-is-permission-granted\"\n        },\n        {\n          \"description\": \"Denies the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-list-channels\"\n        },\n        {\n          \"description\": \"Denies the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-notify\"\n        },\n        {\n          \"description\": \"Denies the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-permission-state\"\n        },\n        {\n          \"description\": \"Denies the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-action-types\"\n        },\n        {\n          \"description\": \"Denies the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-listener\"\n        },\n        {\n          \"description\": \"Denies the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-remove-active\"\n        },\n        {\n          \"description\": \"Denies the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-request-permission\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-show\"\n        },\n        {\n          \"description\": \"This permission set configures which\\noperating system information are available\\nto gather from the frontend.\\n\\n#### Granted Permissions\\n\\nAll information except the host name are available.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"os:default\"\n        },\n        {\n          \"description\": \"Enables the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-arch\"\n        },\n        {\n          \"description\": \"Enables the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-exe-extension\"\n        },\n        {\n          \"description\": \"Enables the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-family\"\n        },\n        {\n          \"description\": \"Enables the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-hostname\"\n        },\n        {\n          \"description\": \"Enables the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-locale\"\n        },\n        {\n          \"description\": \"Enables the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-os-type\"\n        },\n        {\n          \"description\": \"Enables the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-platform\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-version\"\n        },\n        {\n          \"description\": \"Denies the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-arch\"\n        },\n        {\n          \"description\": \"Denies the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-exe-extension\"\n        },\n        {\n          \"description\": \"Denies the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-family\"\n        },\n        {\n          \"description\": \"Denies the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-hostname\"\n        },\n        {\n          \"description\": \"Denies the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-locale\"\n        },\n        {\n          \"description\": \"Denies the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-os-type\"\n        },\n        {\n          \"description\": \"Denies the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-platform\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-version\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nprocess feeatures are by default exposed.\\n\\n#### Granted Permissions\\n\\nThis enables to quit via `allow-exit` and restart via `allow-restart`\\nthe application.\\n\",\n          \"type\": \"string\",\n          \"const\": \"process:default\"\n        },\n        {\n          \"description\": \"Enables the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-exit\"\n        },\n        {\n          \"description\": \"Enables the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-restart\"\n        },\n        {\n          \"description\": \"Denies the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-exit\"\n        },\n        {\n          \"description\": \"Denies the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-restart\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n          \"type\": \"string\",\n          \"const\": \"shell:default\"\n        },\n        {\n          \"description\": \"Enables the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-execute\"\n        },\n        {\n          \"description\": \"Enables the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-kill\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-open\"\n        },\n        {\n          \"description\": \"Enables the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-spawn\"\n        },\n        {\n          \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-stdin-write\"\n        },\n        {\n          \"description\": \"Denies the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-execute\"\n        },\n        {\n          \"description\": \"Denies the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-kill\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-open\"\n        },\n        {\n          \"description\": \"Denies the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-spawn\"\n        },\n        {\n          \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-stdin-write\"\n        },\n        {\n          \"description\": \"This permission set configures what kind of\\noperations are available from the store plugin.\\n\\n#### Granted Permissions\\n\\nAll operations are enabled by default.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"store:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-delete\"\n        },\n        {\n          \"description\": \"Enables the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-entries\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get\"\n        },\n        {\n          \"description\": \"Enables the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get-store\"\n        },\n        {\n          \"description\": \"Enables the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-has\"\n        },\n        {\n          \"description\": \"Enables the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-keys\"\n        },\n        {\n          \"description\": \"Enables the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-length\"\n        },\n        {\n          \"description\": \"Enables the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-load\"\n        },\n        {\n          \"description\": \"Enables the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reload\"\n        },\n        {\n          \"description\": \"Enables the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reset\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-save\"\n        },\n        {\n          \"description\": \"Enables the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-set\"\n        },\n        {\n          \"description\": \"Enables the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-values\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-delete\"\n        },\n        {\n          \"description\": \"Denies the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-entries\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get\"\n        },\n        {\n          \"description\": \"Denies the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get-store\"\n        },\n        {\n          \"description\": \"Denies the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-has\"\n        },\n        {\n          \"description\": \"Denies the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-keys\"\n        },\n        {\n          \"description\": \"Denies the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-length\"\n        },\n        {\n          \"description\": \"Denies the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-load\"\n        },\n        {\n          \"description\": \"Denies the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reload\"\n        },\n        {\n          \"description\": \"Denies the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reset\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-save\"\n        },\n        {\n          \"description\": \"Denies the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-set\"\n        },\n        {\n          \"description\": \"Denies the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-values\"\n        },\n        {\n          \"description\": \"This permission set configures which kind of\\nupdater functions are exposed to the frontend.\\n\\n#### Granted Permissions\\n\\nThe full workflow from checking for updates to installing them\\nis enabled.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"updater:default\"\n        },\n        {\n          \"description\": \"Enables the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-check\"\n        },\n        {\n          \"description\": \"Enables the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download\"\n        },\n        {\n          \"description\": \"Enables the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download-and-install\"\n        },\n        {\n          \"description\": \"Enables the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-install\"\n        },\n        {\n          \"description\": \"Denies the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-check\"\n        },\n        {\n          \"description\": \"Denies the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download\"\n        },\n        {\n          \"description\": \"Denies the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download-and-install\"\n        },\n        {\n          \"description\": \"Denies the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-install\"\n        }\n      ]\n    },\n    \"Value\": {\n      \"description\": \"All supported ACL values.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents a null JSON value.\",\n          \"type\": \"null\"\n        },\n        {\n          \"description\": \"Represents a [`bool`].\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"Represents a valid ACL [`Number`].\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Number\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Represents a [`String`].\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"Represents a list of other [`Value`]s.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        },\n        {\n          \"description\": \"Represents a map of [`String`] keys to [`Value`]s.\",\n          \"type\": \"object\",\n          \"additionalProperties\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        }\n      ]\n    },\n    \"Number\": {\n      \"description\": \"A valid ACL number.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents an [`i64`].\",\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        {\n          \"description\": \"Represents a [`f64`].\",\n          \"type\": \"number\",\n          \"format\": \"double\"\n        }\n      ]\n    },\n    \"Target\": {\n      \"description\": \"Platform target.\",\n      \"oneOf\": [\n        {\n          \"description\": \"MacOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"macOS\"\n          ]\n        },\n        {\n          \"description\": \"Windows.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"windows\"\n          ]\n        },\n        {\n          \"description\": \"Linux.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"linux\"\n          ]\n        },\n        {\n          \"description\": \"Android.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"android\"\n          ]\n        },\n        {\n          \"description\": \"iOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"iOS\"\n          ]\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArg\": {\n      \"description\": \"A command argument allowed to be executed by the webview API.\",\n      \"anyOf\": [\n        {\n          \"description\": \"A non-configurable argument that is passed to the command in the order it was specified.\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"A variable that is set while calling the command from the webview API.\",\n          \"type\": \"object\",\n          \"required\": [\n            \"validator\"\n          ],\n          \"properties\": {\n            \"raw\": {\n              \"description\": \"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\\n\\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.\",\n              \"default\": false,\n              \"type\": \"boolean\"\n            },\n            \"validator\": {\n              \"description\": \"[regex] validator to require passed values to conform to an expected input.\\n\\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\\n\\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\\\w+` regex would be registered as `^https?://\\\\w+$`.\\n\\n[regex]: <https://docs.rs/regex/latest/regex/#syntax>\",\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArgs\": {\n      \"description\": \"A set of command arguments allowed to be executed by the webview API.\\n\\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Use a simple boolean to allow all or disable all arguments to this command configuration.\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/ShellScopeEntryAllowedArg\"\n          }\n        }\n      ]\n    }\n  }\n}"
  },
  {
    "path": "desktop/src-tauri/gen/schemas/windows-schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"CapabilityFile\",\n  \"description\": \"Capability formats accepted in a capability file.\",\n  \"anyOf\": [\n    {\n      \"description\": \"A single capability.\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Capability\"\n        }\n      ]\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/Capability\"\n      }\n    },\n    {\n      \"description\": \"A list of capabilities.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"capabilities\"\n      ],\n      \"properties\": {\n        \"capabilities\": {\n          \"description\": \"The list of capabilities.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Capability\"\n          }\n        }\n      }\n    }\n  ],\n  \"definitions\": {\n    \"Capability\": {\n      \"description\": \"A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\\n\\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If a window is not matching any capability then it has no access to the IPC layer at all.\\n\\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\\n\\n## Example\\n\\n```json { \\\"identifier\\\": \\\"main-user-files-write\\\", \\\"description\\\": \\\"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\\\", \\\"windows\\\": [ \\\"main\\\" ], \\\"permissions\\\": [ \\\"core:default\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] }, ], \\\"platforms\\\": [\\\"macOS\\\",\\\"windows\\\"] } ```\",\n      \"type\": \"object\",\n      \"required\": [\n        \"identifier\",\n        \"permissions\"\n      ],\n      \"properties\": {\n        \"identifier\": {\n          \"description\": \"Identifier of the capability.\\n\\n## Example\\n\\n`main-user-files-write`\",\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"description\": \"Description of what the capability is intended to allow on associated windows.\\n\\nIt should contain a description of what the grouped permissions should allow.\\n\\n## Example\\n\\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\",\n          \"default\": \"\",\n          \"type\": \"string\"\n        },\n        \"remote\": {\n          \"description\": \"Configure remote URLs that can use the capability permissions.\\n\\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\\n\\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\\n\\n## Example\\n\\n```json { \\\"urls\\\": [\\\"https://*.mydomain.dev\\\"] } ```\",\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/CapabilityRemote\"\n            },\n            {\n              \"type\": \"null\"\n            }\n          ]\n        },\n        \"local\": {\n          \"description\": \"Whether this capability is enabled for local app URLs or not. Defaults to `true`.\",\n          \"default\": true,\n          \"type\": \"boolean\"\n        },\n        \"windows\": {\n          \"description\": \"List of windows that are affected by this capability. Can be a glob pattern.\\n\\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.\\n\\n## Example\\n\\n`[\\\"main\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"webviews\": {\n          \"description\": \"List of webviews that are affected by this capability. Can be a glob pattern.\\n\\nThis is only required when using on multiwebview contexts, by default all child webviews of a window that matches [`Self::windows`] are linked.\\n\\n## Example\\n\\n`[\\\"sub-webview-one\\\", \\\"sub-webview-two\\\"]`\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"permissions\": {\n          \"description\": \"List of permissions attached to this capability.\\n\\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\\n\\n## Example\\n\\n```json [ \\\"core:default\\\", \\\"shell:allow-open\\\", \\\"dialog:open\\\", { \\\"identifier\\\": \\\"fs:allow-write-text-file\\\", \\\"allow\\\": [{ \\\"path\\\": \\\"$HOME/test.txt\\\" }] } ```\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/PermissionEntry\"\n          },\n          \"uniqueItems\": true\n        },\n        \"platforms\": {\n          \"description\": \"Limit which target platforms this capability applies to.\\n\\nBy default all platforms are targeted.\\n\\n## Example\\n\\n`[\\\"macOS\\\",\\\"windows\\\"]`\",\n          \"type\": [\n            \"array\",\n            \"null\"\n          ],\n          \"items\": {\n            \"$ref\": \"#/definitions/Target\"\n          }\n        }\n      }\n    },\n    \"CapabilityRemote\": {\n      \"description\": \"Configuration for remote URLs that are associated with the capability.\",\n      \"type\": \"object\",\n      \"required\": [\n        \"urls\"\n      ],\n      \"properties\": {\n        \"urls\": {\n          \"description\": \"Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\\n\\n## Examples\\n\\n- \\\"https://*.mydomain.dev\\\": allows subdomains of mydomain.dev - \\\"https://mydomain.dev/api/*\\\": allows any subpath of mydomain.dev/api\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"PermissionEntry\": {\n      \"description\": \"An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Reference a permission or permission set by identifier.\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Identifier\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Reference a permission or permission set by identifier and extends its scope.\",\n          \"type\": \"object\",\n          \"allOf\": [\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:default\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-app-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appcache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appconfig-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-appdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applocaldata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-applog-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-audio-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-cache-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-config-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-data-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-desktop-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-document-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-download-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exe-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-font-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-home-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-localdata-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-log-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-picture-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-public-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-resource-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-runtime-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-temp-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-template-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-meta-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-read-recursive\"\n                      },\n                      {\n                        \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write\"\n                      },\n                      {\n                        \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-video-write-recursive\"\n                      },\n                      {\n                        \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-default\"\n                      },\n                      {\n                        \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-copy-file\"\n                      },\n                      {\n                        \"description\": \"Enables the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-create\"\n                      },\n                      {\n                        \"description\": \"Enables the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-exists\"\n                      },\n                      {\n                        \"description\": \"Enables the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-fstat\"\n                      },\n                      {\n                        \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Enables the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-lstat\"\n                      },\n                      {\n                        \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-mkdir\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read\"\n                      },\n                      {\n                        \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-dir\"\n                      },\n                      {\n                        \"description\": \"Enables the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Enables the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-remove\"\n                      },\n                      {\n                        \"description\": \"Enables the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-rename\"\n                      },\n                      {\n                        \"description\": \"Enables the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-seek\"\n                      },\n                      {\n                        \"description\": \"Enables the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-stat\"\n                      },\n                      {\n                        \"description\": \"Enables the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-truncate\"\n                      },\n                      {\n                        \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-unwatch\"\n                      },\n                      {\n                        \"description\": \"Enables the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-watch\"\n                      },\n                      {\n                        \"description\": \"Enables the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write\"\n                      },\n                      {\n                        \"description\": \"Enables the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-file\"\n                      },\n                      {\n                        \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:allow-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This permissions allows to create the application specific directories.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:create-app-specific-dirs\"\n                      },\n                      {\n                        \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-copy-file\"\n                      },\n                      {\n                        \"description\": \"Denies the create command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-create\"\n                      },\n                      {\n                        \"description\": \"Denies the exists command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-exists\"\n                      },\n                      {\n                        \"description\": \"Denies the fstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-fstat\"\n                      },\n                      {\n                        \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-ftruncate\"\n                      },\n                      {\n                        \"description\": \"Denies the lstat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-lstat\"\n                      },\n                      {\n                        \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-mkdir\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the read command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read\"\n                      },\n                      {\n                        \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-dir\"\n                      },\n                      {\n                        \"description\": \"Denies the read_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines\"\n                      },\n                      {\n                        \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-read-text-file-lines-next\"\n                      },\n                      {\n                        \"description\": \"Denies the remove command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-remove\"\n                      },\n                      {\n                        \"description\": \"Denies the rename command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-rename\"\n                      },\n                      {\n                        \"description\": \"Denies the seek command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-seek\"\n                      },\n                      {\n                        \"description\": \"Denies the stat command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-stat\"\n                      },\n                      {\n                        \"description\": \"Denies the truncate command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-truncate\"\n                      },\n                      {\n                        \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-unwatch\"\n                      },\n                      {\n                        \"description\": \"Denies the watch command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-watch\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-linux\"\n                      },\n                      {\n                        \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-webview-data-windows\"\n                      },\n                      {\n                        \"description\": \"Denies the write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write\"\n                      },\n                      {\n                        \"description\": \"Denies the write_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-file\"\n                      },\n                      {\n                        \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:deny-write-text-file\"\n                      },\n                      {\n                        \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-all\"\n                      },\n                      {\n                        \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-app-specific-dirs-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-dirs\"\n                      },\n                      {\n                        \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-files\"\n                      },\n                      {\n                        \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:read-meta\"\n                      },\n                      {\n                        \"description\": \"An empty permission you can use to modify the global scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the application directories.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-app-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appcache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appconfig-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-appdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applocaldata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-applog-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-audio-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-cache-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-config-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-data-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-desktop-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-document-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-download-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-exe-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-font-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-home-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-localdata-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-log-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-picture-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-public-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-resource-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-runtime-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-temp-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-template-recursive\"\n                      },\n                      {\n                        \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video\"\n                      },\n                      {\n                        \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-index\"\n                      },\n                      {\n                        \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:scope-video-recursive\"\n                      },\n                      {\n                        \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-all\"\n                      },\n                      {\n                        \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n                        \"type\": \"string\",\n                        \"const\": \"fs:write-files\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"FS scope path.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"FS scope path.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"FsScopeEntry\",\n                      \"description\": \"FS scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"description\": \"FS scope path.\",\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"path\"\n                          ],\n                          \"properties\": {\n                            \"path\": {\n                              \"description\": \"FS scope path.\",\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"if\": {\n                \"properties\": {\n                  \"identifier\": {\n                    \"anyOf\": [\n                      {\n                        \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:default\"\n                      },\n                      {\n                        \"description\": \"Enables the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-execute\"\n                      },\n                      {\n                        \"description\": \"Enables the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-kill\"\n                      },\n                      {\n                        \"description\": \"Enables the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-open\"\n                      },\n                      {\n                        \"description\": \"Enables the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-spawn\"\n                      },\n                      {\n                        \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:allow-stdin-write\"\n                      },\n                      {\n                        \"description\": \"Denies the execute command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-execute\"\n                      },\n                      {\n                        \"description\": \"Denies the kill command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-kill\"\n                      },\n                      {\n                        \"description\": \"Denies the open command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-open\"\n                      },\n                      {\n                        \"description\": \"Denies the spawn command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-spawn\"\n                      },\n                      {\n                        \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n                        \"type\": \"string\",\n                        \"const\": \"shell:deny-stdin-write\"\n                      }\n                    ]\n                  }\n                }\n              },\n              \"then\": {\n                \"properties\": {\n                  \"allow\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  },\n                  \"deny\": {\n                    \"items\": {\n                      \"title\": \"ShellScopeEntry\",\n                      \"description\": \"Shell scope entry.\",\n                      \"anyOf\": [\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"cmd\",\n                            \"name\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"cmd\": {\n                              \"description\": \"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.\",\n                              \"type\": \"string\"\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"name\",\n                            \"sidecar\"\n                          ],\n                          \"properties\": {\n                            \"args\": {\n                              \"description\": \"The allowed arguments for the command execution.\",\n                              \"allOf\": [\n                                {\n                                  \"$ref\": \"#/definitions/ShellScopeEntryAllowedArgs\"\n                                }\n                              ]\n                            },\n                            \"name\": {\n                              \"description\": \"The name for this allowed shell command configuration.\\n\\nThis name will be used inside of the webview API to call this command along with any specified arguments.\",\n                              \"type\": \"string\"\n                            },\n                            \"sidecar\": {\n                              \"description\": \"If this command is a sidecar command.\",\n                              \"type\": \"boolean\"\n                            }\n                          },\n                          \"additionalProperties\": false\n                        }\n                      ]\n                    }\n                  }\n                }\n              },\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                }\n              }\n            },\n            {\n              \"properties\": {\n                \"identifier\": {\n                  \"description\": \"Identifier of the permission or permission set.\",\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/definitions/Identifier\"\n                    }\n                  ]\n                },\n                \"allow\": {\n                  \"description\": \"Data that defines what is allowed by the scope.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                },\n                \"deny\": {\n                  \"description\": \"Data that defines what is denied by the scope. This should be prioritized by validation logic.\",\n                  \"type\": [\n                    \"array\",\n                    \"null\"\n                  ],\n                  \"items\": {\n                    \"$ref\": \"#/definitions/Value\"\n                  }\n                }\n              }\n            }\n          ],\n          \"required\": [\n            \"identifier\"\n          ]\n        }\n      ]\n    },\n    \"Identifier\": {\n      \"description\": \"Permission identifier\",\n      \"oneOf\": [\n        {\n          \"description\": \"No features are enabled by default, as we believe\\nthe clipboard can be inherently dangerous and it is \\napplication specific if read and/or write access is needed.\\n\\nClipboard interaction needs to be explicitly enabled.\\n\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-image\"\n        },\n        {\n          \"description\": \"Enables the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-read-text\"\n        },\n        {\n          \"description\": \"Enables the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-html\"\n        },\n        {\n          \"description\": \"Enables the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-image\"\n        },\n        {\n          \"description\": \"Enables the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:allow-write-text\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the read_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-image\"\n        },\n        {\n          \"description\": \"Denies the read_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-read-text\"\n        },\n        {\n          \"description\": \"Denies the write_html command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-html\"\n        },\n        {\n          \"description\": \"Denies the write_image command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-image\"\n        },\n        {\n          \"description\": \"Denies the write_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"clipboard-manager:deny-write-text\"\n        },\n        {\n          \"description\": \"Default core plugins set which includes:\\n- 'core:path:default'\\n- 'core:event:default'\\n- 'core:window:default'\\n- 'core:webview:default'\\n- 'core:app:default'\\n- 'core:image:default'\\n- 'core:resources:default'\\n- 'core:menu:default'\\n- 'core:tray:default'\\n\",\n          \"type\": \"string\",\n          \"const\": \"core:default\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:default\"\n        },\n        {\n          \"description\": \"Enables the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-hide\"\n        },\n        {\n          \"description\": \"Enables the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-app-show\"\n        },\n        {\n          \"description\": \"Enables the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-default-window-icon\"\n        },\n        {\n          \"description\": \"Enables the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-name\"\n        },\n        {\n          \"description\": \"Enables the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-set-app-theme\"\n        },\n        {\n          \"description\": \"Enables the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-tauri-version\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:allow-version\"\n        },\n        {\n          \"description\": \"Denies the app_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-hide\"\n        },\n        {\n          \"description\": \"Denies the app_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-app-show\"\n        },\n        {\n          \"description\": \"Denies the default_window_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-default-window-icon\"\n        },\n        {\n          \"description\": \"Denies the name command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-name\"\n        },\n        {\n          \"description\": \"Denies the set_app_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-set-app-theme\"\n        },\n        {\n          \"description\": \"Denies the tauri_version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-tauri-version\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:app:deny-version\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:default\"\n        },\n        {\n          \"description\": \"Enables the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit\"\n        },\n        {\n          \"description\": \"Enables the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-emit-to\"\n        },\n        {\n          \"description\": \"Enables the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-listen\"\n        },\n        {\n          \"description\": \"Enables the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:allow-unlisten\"\n        },\n        {\n          \"description\": \"Denies the emit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit\"\n        },\n        {\n          \"description\": \"Denies the emit_to command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-emit-to\"\n        },\n        {\n          \"description\": \"Denies the listen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-listen\"\n        },\n        {\n          \"description\": \"Denies the unlisten command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:event:deny-unlisten\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:default\"\n        },\n        {\n          \"description\": \"Enables the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-bytes\"\n        },\n        {\n          \"description\": \"Enables the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-from-path\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-new\"\n        },\n        {\n          \"description\": \"Enables the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-rgba\"\n        },\n        {\n          \"description\": \"Enables the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:allow-size\"\n        },\n        {\n          \"description\": \"Denies the from_bytes command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-bytes\"\n        },\n        {\n          \"description\": \"Denies the from_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-from-path\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-new\"\n        },\n        {\n          \"description\": \"Denies the rgba command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-rgba\"\n        },\n        {\n          \"description\": \"Denies the size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:image:deny-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:default\"\n        },\n        {\n          \"description\": \"Enables the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-append\"\n        },\n        {\n          \"description\": \"Enables the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-create-default\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-get\"\n        },\n        {\n          \"description\": \"Enables the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-insert\"\n        },\n        {\n          \"description\": \"Enables the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-checked\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-items\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-new\"\n        },\n        {\n          \"description\": \"Enables the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-popup\"\n        },\n        {\n          \"description\": \"Enables the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-prepend\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-remove-at\"\n        },\n        {\n          \"description\": \"Enables the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-accelerator\"\n        },\n        {\n          \"description\": \"Enables the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Enables the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-checked\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-set-text\"\n        },\n        {\n          \"description\": \"Enables the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:allow-text\"\n        },\n        {\n          \"description\": \"Denies the append command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-append\"\n        },\n        {\n          \"description\": \"Denies the create_default command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-create-default\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-get\"\n        },\n        {\n          \"description\": \"Denies the insert command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-insert\"\n        },\n        {\n          \"description\": \"Denies the is_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-checked\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the items command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-items\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-new\"\n        },\n        {\n          \"description\": \"Denies the popup command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-popup\"\n        },\n        {\n          \"description\": \"Denies the prepend command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-prepend\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the remove_at command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-remove-at\"\n        },\n        {\n          \"description\": \"Denies the set_accelerator command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-accelerator\"\n        },\n        {\n          \"description\": \"Denies the set_as_app_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-app-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-help-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_as_window_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-window-menu\"\n        },\n        {\n          \"description\": \"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-as-windows-menu-for-nsapp\"\n        },\n        {\n          \"description\": \"Denies the set_checked command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-checked\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-set-text\"\n        },\n        {\n          \"description\": \"Denies the text command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:menu:deny-text\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:default\"\n        },\n        {\n          \"description\": \"Enables the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-basename\"\n        },\n        {\n          \"description\": \"Enables the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-dirname\"\n        },\n        {\n          \"description\": \"Enables the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-extname\"\n        },\n        {\n          \"description\": \"Enables the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-is-absolute\"\n        },\n        {\n          \"description\": \"Enables the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-join\"\n        },\n        {\n          \"description\": \"Enables the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-normalize\"\n        },\n        {\n          \"description\": \"Enables the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve\"\n        },\n        {\n          \"description\": \"Enables the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:allow-resolve-directory\"\n        },\n        {\n          \"description\": \"Denies the basename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-basename\"\n        },\n        {\n          \"description\": \"Denies the dirname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-dirname\"\n        },\n        {\n          \"description\": \"Denies the extname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-extname\"\n        },\n        {\n          \"description\": \"Denies the is_absolute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-is-absolute\"\n        },\n        {\n          \"description\": \"Denies the join command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-join\"\n        },\n        {\n          \"description\": \"Denies the normalize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-normalize\"\n        },\n        {\n          \"description\": \"Denies the resolve command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve\"\n        },\n        {\n          \"description\": \"Denies the resolve_directory command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:path:deny-resolve-directory\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:default\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:allow-close\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:resources:deny-close\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:default\"\n        },\n        {\n          \"description\": \"Enables the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-get-by-id\"\n        },\n        {\n          \"description\": \"Enables the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-new\"\n        },\n        {\n          \"description\": \"Enables the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-remove-by-id\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Enables the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-menu\"\n        },\n        {\n          \"description\": \"Enables the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Enables the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-tooltip\"\n        },\n        {\n          \"description\": \"Enables the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:allow-set-visible\"\n        },\n        {\n          \"description\": \"Denies the get_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-get-by-id\"\n        },\n        {\n          \"description\": \"Denies the new command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-new\"\n        },\n        {\n          \"description\": \"Denies the remove_by_id command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-remove-by-id\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_icon_as_template command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-icon-as-template\"\n        },\n        {\n          \"description\": \"Denies the set_menu command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-menu\"\n        },\n        {\n          \"description\": \"Denies the set_show_menu_on_left_click command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-show-menu-on-left-click\"\n        },\n        {\n          \"description\": \"Denies the set_temp_dir_path command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-temp-dir-path\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_tooltip command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-tooltip\"\n        },\n        {\n          \"description\": \"Denies the set_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:tray:deny-set-visible\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:default\"\n        },\n        {\n          \"description\": \"Enables the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Enables the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview\"\n        },\n        {\n          \"description\": \"Enables the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-create-webview-window\"\n        },\n        {\n          \"description\": \"Enables the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-get-all-webviews\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Enables the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-print\"\n        },\n        {\n          \"description\": \"Enables the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-reparent\"\n        },\n        {\n          \"description\": \"Enables the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-focus\"\n        },\n        {\n          \"description\": \"Enables the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-position\"\n        },\n        {\n          \"description\": \"Enables the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-size\"\n        },\n        {\n          \"description\": \"Enables the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Enables the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-close\"\n        },\n        {\n          \"description\": \"Enables the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-hide\"\n        },\n        {\n          \"description\": \"Enables the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-position\"\n        },\n        {\n          \"description\": \"Enables the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-show\"\n        },\n        {\n          \"description\": \"Enables the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:allow-webview-size\"\n        },\n        {\n          \"description\": \"Denies the clear_all_browsing_data command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-clear-all-browsing-data\"\n        },\n        {\n          \"description\": \"Denies the create_webview command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview\"\n        },\n        {\n          \"description\": \"Denies the create_webview_window command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-create-webview-window\"\n        },\n        {\n          \"description\": \"Denies the get_all_webviews command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-get-all-webviews\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_devtools command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-internal-toggle-devtools\"\n        },\n        {\n          \"description\": \"Denies the print command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-print\"\n        },\n        {\n          \"description\": \"Denies the reparent command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-reparent\"\n        },\n        {\n          \"description\": \"Denies the set_webview_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-focus\"\n        },\n        {\n          \"description\": \"Denies the set_webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-position\"\n        },\n        {\n          \"description\": \"Denies the set_webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-size\"\n        },\n        {\n          \"description\": \"Denies the set_webview_zoom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-set-webview-zoom\"\n        },\n        {\n          \"description\": \"Denies the webview_close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-close\"\n        },\n        {\n          \"description\": \"Denies the webview_hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-hide\"\n        },\n        {\n          \"description\": \"Denies the webview_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-position\"\n        },\n        {\n          \"description\": \"Denies the webview_show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-show\"\n        },\n        {\n          \"description\": \"Denies the webview_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:webview:deny-webview-size\"\n        },\n        {\n          \"description\": \"Default permissions for the plugin.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:default\"\n        },\n        {\n          \"description\": \"Enables the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-available-monitors\"\n        },\n        {\n          \"description\": \"Enables the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-center\"\n        },\n        {\n          \"description\": \"Enables the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-close\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-create\"\n        },\n        {\n          \"description\": \"Enables the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-current-monitor\"\n        },\n        {\n          \"description\": \"Enables the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-destroy\"\n        },\n        {\n          \"description\": \"Enables the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-get-all-windows\"\n        },\n        {\n          \"description\": \"Enables the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-hide\"\n        },\n        {\n          \"description\": \"Enables the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-position\"\n        },\n        {\n          \"description\": \"Enables the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-inner-size\"\n        },\n        {\n          \"description\": \"Enables the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-closable\"\n        },\n        {\n          \"description\": \"Enables the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-decorated\"\n        },\n        {\n          \"description\": \"Enables the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-enabled\"\n        },\n        {\n          \"description\": \"Enables the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-focused\"\n        },\n        {\n          \"description\": \"Enables the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximizable\"\n        },\n        {\n          \"description\": \"Enables the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-maximized\"\n        },\n        {\n          \"description\": \"Enables the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimizable\"\n        },\n        {\n          \"description\": \"Enables the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-minimized\"\n        },\n        {\n          \"description\": \"Enables the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-resizable\"\n        },\n        {\n          \"description\": \"Enables the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-is-visible\"\n        },\n        {\n          \"description\": \"Enables the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-maximize\"\n        },\n        {\n          \"description\": \"Enables the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-minimize\"\n        },\n        {\n          \"description\": \"Enables the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-monitor-from-point\"\n        },\n        {\n          \"description\": \"Enables the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-position\"\n        },\n        {\n          \"description\": \"Enables the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-outer-size\"\n        },\n        {\n          \"description\": \"Enables the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-primary-monitor\"\n        },\n        {\n          \"description\": \"Enables the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-request-user-attention\"\n        },\n        {\n          \"description\": \"Enables the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-scale-factor\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Enables the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-always-on-top\"\n        },\n        {\n          \"description\": \"Enables the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-closable\"\n        },\n        {\n          \"description\": \"Enables the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-content-protected\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-position\"\n        },\n        {\n          \"description\": \"Enables the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Enables the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-decorations\"\n        },\n        {\n          \"description\": \"Enables the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-effects\"\n        },\n        {\n          \"description\": \"Enables the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-enabled\"\n        },\n        {\n          \"description\": \"Enables the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-focus\"\n        },\n        {\n          \"description\": \"Enables the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-fullscreen\"\n        },\n        {\n          \"description\": \"Enables the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-icon\"\n        },\n        {\n          \"description\": \"Enables the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Enables the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-max-size\"\n        },\n        {\n          \"description\": \"Enables the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-maximizable\"\n        },\n        {\n          \"description\": \"Enables the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-min-size\"\n        },\n        {\n          \"description\": \"Enables the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-minimizable\"\n        },\n        {\n          \"description\": \"Enables the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-position\"\n        },\n        {\n          \"description\": \"Enables the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-progress-bar\"\n        },\n        {\n          \"description\": \"Enables the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-resizable\"\n        },\n        {\n          \"description\": \"Enables the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-shadow\"\n        },\n        {\n          \"description\": \"Enables the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size\"\n        },\n        {\n          \"description\": \"Enables the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-size-constraints\"\n        },\n        {\n          \"description\": \"Enables the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Enables the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-theme\"\n        },\n        {\n          \"description\": \"Enables the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title\"\n        },\n        {\n          \"description\": \"Enables the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Enables the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-show\"\n        },\n        {\n          \"description\": \"Enables the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-dragging\"\n        },\n        {\n          \"description\": \"Enables the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Enables the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-theme\"\n        },\n        {\n          \"description\": \"Enables the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-title\"\n        },\n        {\n          \"description\": \"Enables the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-toggle-maximize\"\n        },\n        {\n          \"description\": \"Enables the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unmaximize\"\n        },\n        {\n          \"description\": \"Enables the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:allow-unminimize\"\n        },\n        {\n          \"description\": \"Denies the available_monitors command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-available-monitors\"\n        },\n        {\n          \"description\": \"Denies the center command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-center\"\n        },\n        {\n          \"description\": \"Denies the close command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-close\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-create\"\n        },\n        {\n          \"description\": \"Denies the current_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-current-monitor\"\n        },\n        {\n          \"description\": \"Denies the cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the destroy command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-destroy\"\n        },\n        {\n          \"description\": \"Denies the get_all_windows command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-get-all-windows\"\n        },\n        {\n          \"description\": \"Denies the hide command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-hide\"\n        },\n        {\n          \"description\": \"Denies the inner_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-position\"\n        },\n        {\n          \"description\": \"Denies the inner_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-inner-size\"\n        },\n        {\n          \"description\": \"Denies the internal_toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-internal-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the is_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-closable\"\n        },\n        {\n          \"description\": \"Denies the is_decorated command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-decorated\"\n        },\n        {\n          \"description\": \"Denies the is_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-enabled\"\n        },\n        {\n          \"description\": \"Denies the is_focused command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-focused\"\n        },\n        {\n          \"description\": \"Denies the is_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the is_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximizable\"\n        },\n        {\n          \"description\": \"Denies the is_maximized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-maximized\"\n        },\n        {\n          \"description\": \"Denies the is_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimizable\"\n        },\n        {\n          \"description\": \"Denies the is_minimized command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-minimized\"\n        },\n        {\n          \"description\": \"Denies the is_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-resizable\"\n        },\n        {\n          \"description\": \"Denies the is_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-is-visible\"\n        },\n        {\n          \"description\": \"Denies the maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-maximize\"\n        },\n        {\n          \"description\": \"Denies the minimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-minimize\"\n        },\n        {\n          \"description\": \"Denies the monitor_from_point command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-monitor-from-point\"\n        },\n        {\n          \"description\": \"Denies the outer_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-position\"\n        },\n        {\n          \"description\": \"Denies the outer_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-outer-size\"\n        },\n        {\n          \"description\": \"Denies the primary_monitor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-primary-monitor\"\n        },\n        {\n          \"description\": \"Denies the request_user_attention command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-request-user-attention\"\n        },\n        {\n          \"description\": \"Denies the scale_factor command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-scale-factor\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_bottom command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-bottom\"\n        },\n        {\n          \"description\": \"Denies the set_always_on_top command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-always-on-top\"\n        },\n        {\n          \"description\": \"Denies the set_closable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-closable\"\n        },\n        {\n          \"description\": \"Denies the set_content_protected command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-content-protected\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_grab command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-grab\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-icon\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-position\"\n        },\n        {\n          \"description\": \"Denies the set_cursor_visible command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-cursor-visible\"\n        },\n        {\n          \"description\": \"Denies the set_decorations command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-decorations\"\n        },\n        {\n          \"description\": \"Denies the set_effects command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-effects\"\n        },\n        {\n          \"description\": \"Denies the set_enabled command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-enabled\"\n        },\n        {\n          \"description\": \"Denies the set_focus command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-focus\"\n        },\n        {\n          \"description\": \"Denies the set_fullscreen command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-fullscreen\"\n        },\n        {\n          \"description\": \"Denies the set_icon command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-icon\"\n        },\n        {\n          \"description\": \"Denies the set_ignore_cursor_events command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-ignore-cursor-events\"\n        },\n        {\n          \"description\": \"Denies the set_max_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-max-size\"\n        },\n        {\n          \"description\": \"Denies the set_maximizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-maximizable\"\n        },\n        {\n          \"description\": \"Denies the set_min_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-min-size\"\n        },\n        {\n          \"description\": \"Denies the set_minimizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-minimizable\"\n        },\n        {\n          \"description\": \"Denies the set_position command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-position\"\n        },\n        {\n          \"description\": \"Denies the set_progress_bar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-progress-bar\"\n        },\n        {\n          \"description\": \"Denies the set_resizable command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-resizable\"\n        },\n        {\n          \"description\": \"Denies the set_shadow command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-shadow\"\n        },\n        {\n          \"description\": \"Denies the set_size command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size\"\n        },\n        {\n          \"description\": \"Denies the set_size_constraints command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-size-constraints\"\n        },\n        {\n          \"description\": \"Denies the set_skip_taskbar command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-skip-taskbar\"\n        },\n        {\n          \"description\": \"Denies the set_theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-theme\"\n        },\n        {\n          \"description\": \"Denies the set_title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title\"\n        },\n        {\n          \"description\": \"Denies the set_title_bar_style command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-title-bar-style\"\n        },\n        {\n          \"description\": \"Denies the set_visible_on_all_workspaces command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-set-visible-on-all-workspaces\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-show\"\n        },\n        {\n          \"description\": \"Denies the start_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-dragging\"\n        },\n        {\n          \"description\": \"Denies the start_resize_dragging command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-start-resize-dragging\"\n        },\n        {\n          \"description\": \"Denies the theme command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-theme\"\n        },\n        {\n          \"description\": \"Denies the title command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-title\"\n        },\n        {\n          \"description\": \"Denies the toggle_maximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-toggle-maximize\"\n        },\n        {\n          \"description\": \"Denies the unmaximize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unmaximize\"\n        },\n        {\n          \"description\": \"Denies the unminimize command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"core:window:deny-unminimize\"\n        },\n        {\n          \"description\": \"This permission set configures the types of dialogs\\navailable from the dialog plugin.\\n\\n#### Granted Permissions\\n\\nAll dialog types are enabled.\\n\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"dialog:default\"\n        },\n        {\n          \"description\": \"Enables the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-ask\"\n        },\n        {\n          \"description\": \"Enables the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-confirm\"\n        },\n        {\n          \"description\": \"Enables the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-message\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-open\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:allow-save\"\n        },\n        {\n          \"description\": \"Denies the ask command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-ask\"\n        },\n        {\n          \"description\": \"Denies the confirm command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-confirm\"\n        },\n        {\n          \"description\": \"Denies the message command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-message\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-open\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"dialog:deny-save\"\n        },\n        {\n          \"description\": \"This set of permissions describes the what kind of\\nfile system access the `fs` plugin has enabled or denied by default.\\n\\n#### Granted Permissions\\n\\nThis default permission set enables read access to the\\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\\nAppLog) and all files and sub directories created in it.\\nThe location of these directories depends on the operating system,\\nwhere the application is run.\\n\\nIn general these directories need to be manually created\\nby the application at runtime, before accessing files or folders\\nin it is possible.\\n\\nTherefore, it is also allowed to create all of these folders via\\nthe `mkdir` command.\\n\\n#### Denied Permissions\\n\\nThis default permission set prevents access to critical components\\nof the Tauri application by default.\\nOn Windows the webview data folder access is denied.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:default\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the application folders, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete application folders, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-app-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appcache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appconfig-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-appdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applocaldata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-applog-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-audio-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-cache-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-config-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-data-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-desktop-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-document-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-download-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exe-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-font-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-home-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-localdata-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-log-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-picture-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-public-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-resource-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-runtime-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-temp-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-template-write-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-meta-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive read access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read\"\n        },\n        {\n          \"description\": \"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-read-recursive\"\n        },\n        {\n          \"description\": \"This allows non-recursive write access to the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write\"\n        },\n        {\n          \"description\": \"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-video-write-recursive\"\n        },\n        {\n          \"description\": \"This denies access to dangerous Tauri relevant files and folders by default.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-default\"\n        },\n        {\n          \"description\": \"Enables the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-copy-file\"\n        },\n        {\n          \"description\": \"Enables the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-create\"\n        },\n        {\n          \"description\": \"Enables the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-exists\"\n        },\n        {\n          \"description\": \"Enables the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-fstat\"\n        },\n        {\n          \"description\": \"Enables the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-ftruncate\"\n        },\n        {\n          \"description\": \"Enables the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-lstat\"\n        },\n        {\n          \"description\": \"Enables the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-mkdir\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-open\"\n        },\n        {\n          \"description\": \"Enables the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read\"\n        },\n        {\n          \"description\": \"Enables the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-dir\"\n        },\n        {\n          \"description\": \"Enables the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Enables the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Enables the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-remove\"\n        },\n        {\n          \"description\": \"Enables the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-rename\"\n        },\n        {\n          \"description\": \"Enables the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-seek\"\n        },\n        {\n          \"description\": \"Enables the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-stat\"\n        },\n        {\n          \"description\": \"Enables the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-truncate\"\n        },\n        {\n          \"description\": \"Enables the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-unwatch\"\n        },\n        {\n          \"description\": \"Enables the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-watch\"\n        },\n        {\n          \"description\": \"Enables the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write\"\n        },\n        {\n          \"description\": \"Enables the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-file\"\n        },\n        {\n          \"description\": \"Enables the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:allow-write-text-file\"\n        },\n        {\n          \"description\": \"This permissions allows to create the application specific directories.\\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:create-app-specific-dirs\"\n        },\n        {\n          \"description\": \"Denies the copy_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-copy-file\"\n        },\n        {\n          \"description\": \"Denies the create command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-create\"\n        },\n        {\n          \"description\": \"Denies the exists command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-exists\"\n        },\n        {\n          \"description\": \"Denies the fstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-fstat\"\n        },\n        {\n          \"description\": \"Denies the ftruncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-ftruncate\"\n        },\n        {\n          \"description\": \"Denies the lstat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-lstat\"\n        },\n        {\n          \"description\": \"Denies the mkdir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-mkdir\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-open\"\n        },\n        {\n          \"description\": \"Denies the read command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read\"\n        },\n        {\n          \"description\": \"Denies the read_dir command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-dir\"\n        },\n        {\n          \"description\": \"Denies the read_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines\"\n        },\n        {\n          \"description\": \"Denies the read_text_file_lines_next command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-read-text-file-lines-next\"\n        },\n        {\n          \"description\": \"Denies the remove command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-remove\"\n        },\n        {\n          \"description\": \"Denies the rename command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-rename\"\n        },\n        {\n          \"description\": \"Denies the seek command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-seek\"\n        },\n        {\n          \"description\": \"Denies the stat command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-stat\"\n        },\n        {\n          \"description\": \"Denies the truncate command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-truncate\"\n        },\n        {\n          \"description\": \"Denies the unwatch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-unwatch\"\n        },\n        {\n          \"description\": \"Denies the watch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-watch\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-linux\"\n        },\n        {\n          \"description\": \"This denies read access to the\\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\\nAllowing access can lead to sensitive information disclosure and should be well considered.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-webview-data-windows\"\n        },\n        {\n          \"description\": \"Denies the write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write\"\n        },\n        {\n          \"description\": \"Denies the write_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-file\"\n        },\n        {\n          \"description\": \"Denies the write_text_file command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:deny-write-text-file\"\n        },\n        {\n          \"description\": \"This enables all read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-all\"\n        },\n        {\n          \"description\": \"This permission allows recursive read functionality on the application\\nspecific base directories. \\n\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-app-specific-dirs-recursive\"\n        },\n        {\n          \"description\": \"This enables directory read and file metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-dirs\"\n        },\n        {\n          \"description\": \"This enables file read related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-files\"\n        },\n        {\n          \"description\": \"This enables all index or metadata related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:read-meta\"\n        },\n        {\n          \"description\": \"An empty permission you can use to modify the global scope.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the application folders.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the application directories.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete application folders, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-app-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appcache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPCONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appconfig-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-appdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applocaldata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$APPLOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-applog-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$AUDIO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-audio-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CACHE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-cache-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$CONFIG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-config-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-data-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DESKTOP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-desktop-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOCUMENT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-document-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$DOWNLOAD`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-download-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$EXE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$EXE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-exe-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$FONT` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$FONT`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-font-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$HOME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$HOME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-home-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOCALDATA`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-localdata-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$LOG` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$LOG`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-log-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PICTURE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-picture-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$PUBLIC`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-public-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RESOURCE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-resource-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$RUNTIME`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-runtime-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMP`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-temp-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$TEMPLATE`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-template-recursive\"\n        },\n        {\n          \"description\": \"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video\"\n        },\n        {\n          \"description\": \"This scope permits to list all files and folders in the `$VIDEO`folder.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-index\"\n        },\n        {\n          \"description\": \"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.\",\n          \"type\": \"string\",\n          \"const\": \"fs:scope-video-recursive\"\n        },\n        {\n          \"description\": \"This enables all write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-all\"\n        },\n        {\n          \"description\": \"This enables all file write related commands without any pre-configured accessible paths.\",\n          \"type\": \"string\",\n          \"const\": \"fs:write-files\"\n        },\n        {\n          \"description\": \"Allows the log command\",\n          \"type\": \"string\",\n          \"const\": \"log:default\"\n        },\n        {\n          \"description\": \"Enables the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:allow-log\"\n        },\n        {\n          \"description\": \"Denies the log command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"log:deny-log\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nnotification features are by default exposed.\\n\\n#### Granted Permissions\\n\\nIt allows all notification related features.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"notification:default\"\n        },\n        {\n          \"description\": \"Enables the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-batch\"\n        },\n        {\n          \"description\": \"Enables the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-cancel\"\n        },\n        {\n          \"description\": \"Enables the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-check-permissions\"\n        },\n        {\n          \"description\": \"Enables the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-create-channel\"\n        },\n        {\n          \"description\": \"Enables the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-delete-channel\"\n        },\n        {\n          \"description\": \"Enables the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-active\"\n        },\n        {\n          \"description\": \"Enables the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-get-pending\"\n        },\n        {\n          \"description\": \"Enables the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-is-permission-granted\"\n        },\n        {\n          \"description\": \"Enables the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-list-channels\"\n        },\n        {\n          \"description\": \"Enables the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-notify\"\n        },\n        {\n          \"description\": \"Enables the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-permission-state\"\n        },\n        {\n          \"description\": \"Enables the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-action-types\"\n        },\n        {\n          \"description\": \"Enables the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-register-listener\"\n        },\n        {\n          \"description\": \"Enables the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-remove-active\"\n        },\n        {\n          \"description\": \"Enables the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-request-permission\"\n        },\n        {\n          \"description\": \"Enables the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:allow-show\"\n        },\n        {\n          \"description\": \"Denies the batch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-batch\"\n        },\n        {\n          \"description\": \"Denies the cancel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-cancel\"\n        },\n        {\n          \"description\": \"Denies the check_permissions command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-check-permissions\"\n        },\n        {\n          \"description\": \"Denies the create_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-create-channel\"\n        },\n        {\n          \"description\": \"Denies the delete_channel command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-delete-channel\"\n        },\n        {\n          \"description\": \"Denies the get_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-active\"\n        },\n        {\n          \"description\": \"Denies the get_pending command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-get-pending\"\n        },\n        {\n          \"description\": \"Denies the is_permission_granted command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-is-permission-granted\"\n        },\n        {\n          \"description\": \"Denies the list_channels command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-list-channels\"\n        },\n        {\n          \"description\": \"Denies the notify command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-notify\"\n        },\n        {\n          \"description\": \"Denies the permission_state command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-permission-state\"\n        },\n        {\n          \"description\": \"Denies the register_action_types command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-action-types\"\n        },\n        {\n          \"description\": \"Denies the register_listener command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-register-listener\"\n        },\n        {\n          \"description\": \"Denies the remove_active command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-remove-active\"\n        },\n        {\n          \"description\": \"Denies the request_permission command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-request-permission\"\n        },\n        {\n          \"description\": \"Denies the show command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"notification:deny-show\"\n        },\n        {\n          \"description\": \"This permission set configures which\\noperating system information are available\\nto gather from the frontend.\\n\\n#### Granted Permissions\\n\\nAll information except the host name are available.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"os:default\"\n        },\n        {\n          \"description\": \"Enables the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-arch\"\n        },\n        {\n          \"description\": \"Enables the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-exe-extension\"\n        },\n        {\n          \"description\": \"Enables the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-family\"\n        },\n        {\n          \"description\": \"Enables the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-hostname\"\n        },\n        {\n          \"description\": \"Enables the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-locale\"\n        },\n        {\n          \"description\": \"Enables the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-os-type\"\n        },\n        {\n          \"description\": \"Enables the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-platform\"\n        },\n        {\n          \"description\": \"Enables the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:allow-version\"\n        },\n        {\n          \"description\": \"Denies the arch command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-arch\"\n        },\n        {\n          \"description\": \"Denies the exe_extension command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-exe-extension\"\n        },\n        {\n          \"description\": \"Denies the family command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-family\"\n        },\n        {\n          \"description\": \"Denies the hostname command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-hostname\"\n        },\n        {\n          \"description\": \"Denies the locale command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-locale\"\n        },\n        {\n          \"description\": \"Denies the os_type command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-os-type\"\n        },\n        {\n          \"description\": \"Denies the platform command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-platform\"\n        },\n        {\n          \"description\": \"Denies the version command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"os:deny-version\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nprocess feeatures are by default exposed.\\n\\n#### Granted Permissions\\n\\nThis enables to quit via `allow-exit` and restart via `allow-restart`\\nthe application.\\n\",\n          \"type\": \"string\",\n          \"const\": \"process:default\"\n        },\n        {\n          \"description\": \"Enables the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-exit\"\n        },\n        {\n          \"description\": \"Enables the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:allow-restart\"\n        },\n        {\n          \"description\": \"Denies the exit command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-exit\"\n        },\n        {\n          \"description\": \"Denies the restart command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"process:deny-restart\"\n        },\n        {\n          \"description\": \"This permission set configures which\\nshell functionality is exposed by default.\\n\\n#### Granted Permissions\\n\\nIt allows to use the `open` functionality without any specific\\nscope pre-configured. It will allow opening `http(s)://`,\\n`tel:` and `mailto:` links.\\n\",\n          \"type\": \"string\",\n          \"const\": \"shell:default\"\n        },\n        {\n          \"description\": \"Enables the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-execute\"\n        },\n        {\n          \"description\": \"Enables the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-kill\"\n        },\n        {\n          \"description\": \"Enables the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-open\"\n        },\n        {\n          \"description\": \"Enables the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-spawn\"\n        },\n        {\n          \"description\": \"Enables the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:allow-stdin-write\"\n        },\n        {\n          \"description\": \"Denies the execute command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-execute\"\n        },\n        {\n          \"description\": \"Denies the kill command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-kill\"\n        },\n        {\n          \"description\": \"Denies the open command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-open\"\n        },\n        {\n          \"description\": \"Denies the spawn command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-spawn\"\n        },\n        {\n          \"description\": \"Denies the stdin_write command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"shell:deny-stdin-write\"\n        },\n        {\n          \"description\": \"This permission set configures what kind of\\noperations are available from the store plugin.\\n\\n#### Granted Permissions\\n\\nAll operations are enabled by default.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"store:default\"\n        },\n        {\n          \"description\": \"Enables the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-clear\"\n        },\n        {\n          \"description\": \"Enables the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-delete\"\n        },\n        {\n          \"description\": \"Enables the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-entries\"\n        },\n        {\n          \"description\": \"Enables the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get\"\n        },\n        {\n          \"description\": \"Enables the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-get-store\"\n        },\n        {\n          \"description\": \"Enables the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-has\"\n        },\n        {\n          \"description\": \"Enables the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-keys\"\n        },\n        {\n          \"description\": \"Enables the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-length\"\n        },\n        {\n          \"description\": \"Enables the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-load\"\n        },\n        {\n          \"description\": \"Enables the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reload\"\n        },\n        {\n          \"description\": \"Enables the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-reset\"\n        },\n        {\n          \"description\": \"Enables the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-save\"\n        },\n        {\n          \"description\": \"Enables the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-set\"\n        },\n        {\n          \"description\": \"Enables the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:allow-values\"\n        },\n        {\n          \"description\": \"Denies the clear command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-clear\"\n        },\n        {\n          \"description\": \"Denies the delete command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-delete\"\n        },\n        {\n          \"description\": \"Denies the entries command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-entries\"\n        },\n        {\n          \"description\": \"Denies the get command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get\"\n        },\n        {\n          \"description\": \"Denies the get_store command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-get-store\"\n        },\n        {\n          \"description\": \"Denies the has command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-has\"\n        },\n        {\n          \"description\": \"Denies the keys command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-keys\"\n        },\n        {\n          \"description\": \"Denies the length command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-length\"\n        },\n        {\n          \"description\": \"Denies the load command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-load\"\n        },\n        {\n          \"description\": \"Denies the reload command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reload\"\n        },\n        {\n          \"description\": \"Denies the reset command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-reset\"\n        },\n        {\n          \"description\": \"Denies the save command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-save\"\n        },\n        {\n          \"description\": \"Denies the set command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-set\"\n        },\n        {\n          \"description\": \"Denies the values command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"store:deny-values\"\n        },\n        {\n          \"description\": \"This permission set configures which kind of\\nupdater functions are exposed to the frontend.\\n\\n#### Granted Permissions\\n\\nThe full workflow from checking for updates to installing them\\nis enabled.\\n\\n\",\n          \"type\": \"string\",\n          \"const\": \"updater:default\"\n        },\n        {\n          \"description\": \"Enables the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-check\"\n        },\n        {\n          \"description\": \"Enables the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download\"\n        },\n        {\n          \"description\": \"Enables the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-download-and-install\"\n        },\n        {\n          \"description\": \"Enables the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:allow-install\"\n        },\n        {\n          \"description\": \"Denies the check command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-check\"\n        },\n        {\n          \"description\": \"Denies the download command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download\"\n        },\n        {\n          \"description\": \"Denies the download_and_install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-download-and-install\"\n        },\n        {\n          \"description\": \"Denies the install command without any pre-configured scope.\",\n          \"type\": \"string\",\n          \"const\": \"updater:deny-install\"\n        }\n      ]\n    },\n    \"Value\": {\n      \"description\": \"All supported ACL values.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents a null JSON value.\",\n          \"type\": \"null\"\n        },\n        {\n          \"description\": \"Represents a [`bool`].\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"Represents a valid ACL [`Number`].\",\n          \"allOf\": [\n            {\n              \"$ref\": \"#/definitions/Number\"\n            }\n          ]\n        },\n        {\n          \"description\": \"Represents a [`String`].\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"Represents a list of other [`Value`]s.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        },\n        {\n          \"description\": \"Represents a map of [`String`] keys to [`Value`]s.\",\n          \"type\": \"object\",\n          \"additionalProperties\": {\n            \"$ref\": \"#/definitions/Value\"\n          }\n        }\n      ]\n    },\n    \"Number\": {\n      \"description\": \"A valid ACL number.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Represents an [`i64`].\",\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        {\n          \"description\": \"Represents a [`f64`].\",\n          \"type\": \"number\",\n          \"format\": \"double\"\n        }\n      ]\n    },\n    \"Target\": {\n      \"description\": \"Platform target.\",\n      \"oneOf\": [\n        {\n          \"description\": \"MacOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"macOS\"\n          ]\n        },\n        {\n          \"description\": \"Windows.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"windows\"\n          ]\n        },\n        {\n          \"description\": \"Linux.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"linux\"\n          ]\n        },\n        {\n          \"description\": \"Android.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"android\"\n          ]\n        },\n        {\n          \"description\": \"iOS.\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"iOS\"\n          ]\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArg\": {\n      \"description\": \"A command argument allowed to be executed by the webview API.\",\n      \"anyOf\": [\n        {\n          \"description\": \"A non-configurable argument that is passed to the command in the order it was specified.\",\n          \"type\": \"string\"\n        },\n        {\n          \"description\": \"A variable that is set while calling the command from the webview API.\",\n          \"type\": \"object\",\n          \"required\": [\n            \"validator\"\n          ],\n          \"properties\": {\n            \"raw\": {\n              \"description\": \"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\\n\\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.\",\n              \"default\": false,\n              \"type\": \"boolean\"\n            },\n            \"validator\": {\n              \"description\": \"[regex] validator to require passed values to conform to an expected input.\\n\\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\\n\\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\\\w+` regex would be registered as `^https?://\\\\w+$`.\\n\\n[regex]: <https://docs.rs/regex/latest/regex/#syntax>\",\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false\n        }\n      ]\n    },\n    \"ShellScopeEntryAllowedArgs\": {\n      \"description\": \"A set of command arguments allowed to be executed by the webview API.\\n\\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.\",\n      \"anyOf\": [\n        {\n          \"description\": \"Use a simple boolean to allow all or disable all arguments to this command configuration.\",\n          \"type\": \"boolean\"\n        },\n        {\n          \"description\": \"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/ShellScopeEntryAllowedArg\"\n          }\n        }\n      ]\n    }\n  }\n}"
  },
  {
    "path": "desktop/src-tauri/sign.bat",
    "content": "@echo off\nREM Check if the binary path parameter was provided\nif \"%~1\"==\"\" (\n    echo Error: No binary path provided.\n    echo Usage: %~nx0 \"path_to_binary\"\n    exit /b 1\n)\n\nREM Execute the signing command using CodeSignTool.bat with the required environment variables\nCodeSignTool.bat sign ^\n    -username \"%CODESIGNTOOL_USERNAME%\" ^\n    -password \"%CODESIGNTOOL_PASSWORD%\" ^\n    -totp_secret \"%CODESIGNTOOL_TOTP_SECRET%\" ^\n    -credential_id \"%CODESIGNTOOL_CREDENTIAL_ID%\" ^\n    -input_file_path \"%~1\" ^\n    -override\n\nexit /b %errorlevel%\n"
  },
  {
    "path": "desktop/src-tauri/src/action_logs.rs",
    "content": "use crate::AppHandle;\nuse anyhow::Context;\nuse log::info;\nuse std::{\n    fs::{self, OpenOptions},\n    io::Write,\n    path::PathBuf,\n    time::{Duration, SystemTime},\n};\nuse thiserror::Error;\nuse tauri::Manager;\n\nconst ACTION_LOGS_DIR: &str = \"action_logs\";\nconst THIRTY_DAYS: Duration = Duration::new(60 * 60 * 24 * 30, 0);\n\n#[derive(Error, Debug)]\npub enum ActionLogError {\n    #[error(\"unable to get app data dir\")]\n    NoDir,\n    #[error(\"unable to open file\")]\n    FileOpen(#[source] std::io::Error),\n    #[error(\"unable to write to file\")]\n    Write(#[source] std::io::Error),\n    #[error(\"unable to delete to file\")]\n    FileDelete(#[source] std::io::Error),\n}\nimpl serde::Serialize for ActionLogError {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: serde::Serializer,\n    {\n        serializer.serialize_str(self.to_string().as_ref())\n    }\n}\n\n#[tauri::command]\npub fn write_action_log(\n    app_handle: AppHandle,\n    action_id: String,\n    data: String,\n) -> Result<(), ActionLogError> {\n    let mut path = get_actions_dir(&app_handle).map_err(|_| ActionLogError::NoDir)?;\n    path.push(format!(\"{}.log\", &action_id));\n\n    let mut file = OpenOptions::new()\n        .create(true)\n        .append(true)\n        .open(path)\n        .map_err(ActionLogError::FileOpen)?;\n\n    file.write_all(format!(\"{}\\n\", data).as_bytes())\n        .map_err(ActionLogError::Write)?;\n\n    Ok(())\n}\n\n#[tauri::command]\npub fn get_action_logs(\n    app_handle: AppHandle,\n    action_id: String,\n) -> Result<Vec<String>, ActionLogError> {\n    let mut path = get_actions_dir(&app_handle).map_err(|_| ActionLogError::NoDir)?;\n    path.push(format!(\"{}.log\", &action_id));\n\n    let lines = fs::read_to_string(path)\n        .map_err(ActionLogError::FileOpen)?\n        .lines()\n        .map(|s| s.to_string())\n        .collect();\n\n    Ok(lines)\n}\n\n#[tauri::command]\npub fn get_action_log_file(\n    app_handle: AppHandle,\n    action_id: String,\n) -> Result<String, ActionLogError> {\n    let mut path = get_actions_dir(&app_handle).map_err(|_| ActionLogError::NoDir)?;\n    path.push(format!(\"{}.log\", &action_id));\n\n    Ok(path.to_string_lossy().into())\n}\n\npub fn setup(app_handle: &AppHandle) -> anyhow::Result<()> {\n    let dir_path = get_actions_dir(app_handle)?;\n    let _ = fs::create_dir_all(&dir_path); // Make sure we have the action logs dir\n\n    // delete all actions older than a month\n    let now = SystemTime::now();\n    let dir = fs::read_dir(dir_path);\n    let paths_to_delete = dir?.filter_map(|r| {\n        if !r.is_ok() {\n            return None;\n        }\n        let entry = r.unwrap();\n        let path = entry.path();\n\n        let metadata = entry.metadata();\n        if !metadata.is_ok() {\n            return None;\n        };\n        let created = metadata.unwrap().created();\n        if !created.is_ok() {\n            return None;\n        };\n\n        let elapsed = now.duration_since(created.unwrap());\n        if !elapsed.is_ok() || elapsed.unwrap() < THIRTY_DAYS {\n            return None;\n        }\n        return Some(path);\n    });\n\n    for path in paths_to_delete {\n        info!(\"Deleting {:?}\", path);\n        let _ = fs::remove_file(path);\n    }\n\n    Ok(())\n}\n\nfn get_actions_dir(app_handle: &AppHandle) -> anyhow::Result<PathBuf> {\n    let mut dir_path = app_handle\n        .path()\n        .app_data_dir()\n        .context(\"App data dir not found\")?;\n    dir_path.push(ACTION_LOGS_DIR);\n\n    Ok(dir_path)\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/config.rs",
    "content": "use std::collections::HashMap;\n\nuse tauri::AppHandle;\nuse tauri_plugin_shell::{process::Command, ShellExt};\nuse thiserror::Error;\n\nuse crate::commands::constants::DEVPOD_BINARY_NAME;\n\nuse super::constants::DEVPOD_UI_ENV_VAR;\n\npub struct CommandConfig<'a> {\n    pub(crate) binary_name: &'static str,\n    pub(crate) args: Vec<&'a str>,\n}\n\nimpl<'a> CommandConfig<'_> {\n    pub fn binary_name(&self) -> &'static str {\n        self.binary_name\n    }\n\n    pub fn args(&self) -> &Vec<&str> {\n        &self.args\n    }\n}\n\n#[derive(Error, Debug)]\npub enum DevpodCommandError {\n    #[error(\"unable to parse command response\")]\n    Parse(#[from] serde_json::Error),\n    #[error(\"unable to find sidecar binary\")]\n    Sidecar,\n    #[error(\"unable to collect output from command\")]\n    Output,\n    #[error(\"command failed\")]\n    Failed(#[from] tauri_plugin_shell::Error),\n    #[error(\"command exited with non-zero code\")]\n    Exit,\n    #[error(\"error\")]\n    Any(#[from] anyhow::Error)\n}\nimpl serde::Serialize for DevpodCommandError {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: serde::Serializer,\n    {\n        serializer.serialize_str(self.to_string().as_ref())\n    }\n}\npub trait DevpodCommandConfig<T> {\n    fn config(&self) -> CommandConfig {\n        CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![],\n        }\n    }\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<T, DevpodCommandError>;\n\n    fn new_command(&self, app_handle: &AppHandle) -> Result<Command, DevpodCommandError> {\n        let config = self.config();\n        let env_vars: HashMap<String, String> =\n            HashMap::from([(DEVPOD_UI_ENV_VAR.into(), \"true\".into())]);\n\n        let cmd = app_handle\n            .shell()\n            .sidecar(config.binary_name())\n            .map_err(|_| DevpodCommandError::Sidecar)?\n            .envs(env_vars)\n            .args(config.args());\n\n        Ok(cmd)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/constants.rs",
    "content": "// Binaries\npub const DEVPOD_BINARY_NAME: &str = \"devpod-cli\";\n\n// Commands\npub(super) const DEVPOD_COMMAND_LIST: &str = \"list\";\npub(super) const DEVPOD_COMMAND_PROVIDER: &str = \"provider\";\npub(super) const DEVPOD_COMMAND_PRO: &str = \"pro\";\npub(super) const DEVPOD_COMMAND_DELETE: &str = \"delete\";\npub(super) const DEVPOD_COMMAND_DAEMON: &str = \"daemon\";\npub(super) const DEVPOD_COMMAND_START: &str = \"start\";\n\n// Flags\npub(super) const FLAG_OUTPUT_JSON: &str = \"--output=json\";\npub(super) const FLAG_HOST: &str = \"--host\";\npub(super) const FLAG_DEBUG: &str = \"--debug\";\npub(super) const FLAG_IGNORE_NOT_FOUND: &str = \"--ignore-not-found\";\n\n// Env vars\npub(super) const DEVPOD_UI_ENV_VAR: &str = \"DEVPOD_UI\";\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/delete_pro_instance.rs",
    "content": "use tauri::AppHandle;\n\nuse super::{\n    config::{CommandConfig, DevpodCommandConfig, DevpodCommandError},\n    constants::{\n        DEVPOD_BINARY_NAME, DEVPOD_COMMAND_DELETE, DEVPOD_COMMAND_PRO, FLAG_IGNORE_NOT_FOUND,\n    },\n};\n\npub struct DeleteProInstanceCommand {\n    pro_id: String,\n}\nimpl DeleteProInstanceCommand {\n    pub fn new(pro_id: String) -> Self {\n        DeleteProInstanceCommand { pro_id }\n    }\n}\nimpl DevpodCommandConfig<()> for DeleteProInstanceCommand {\n    fn config(&self) -> CommandConfig {\n        CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![\n                DEVPOD_COMMAND_PRO,\n                DEVPOD_COMMAND_DELETE,\n                &self.pro_id,\n                FLAG_IGNORE_NOT_FOUND,\n            ],\n        }\n    }\n\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<(), DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        tauri::async_runtime::block_on(async move { cmd.status().await })\n            .map_err(DevpodCommandError::Failed)?\n            .success()\n            .then_some(())\n            .ok_or_else(|| DevpodCommandError::Exit)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/delete_provider.rs",
    "content": "use tauri::AppHandle;\n\nuse super::{\n    config::{CommandConfig, DevpodCommandConfig, DevpodCommandError},\n    constants::{DEVPOD_BINARY_NAME, DEVPOD_COMMAND_DELETE, DEVPOD_COMMAND_PROVIDER},\n};\n\npub struct DeleteProviderCommand {\n    provider_id: String,\n}\nimpl DeleteProviderCommand {\n    pub fn new(provider_id: String) -> Self {\n        DeleteProviderCommand { provider_id }\n    }\n}\nimpl DevpodCommandConfig<()> for DeleteProviderCommand {\n    fn config(&self) -> CommandConfig {\n        CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![\n                DEVPOD_COMMAND_PROVIDER,\n                DEVPOD_COMMAND_DELETE,\n                &self.provider_id,\n            ],\n        }\n    }\n\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<(), DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        tauri::async_runtime::block_on(async move { cmd.status().await })\n            .map_err(DevpodCommandError::Failed)?\n            .success()\n            .then_some(())\n            .ok_or_else(|| DevpodCommandError::Exit)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/list_pro_instances.rs",
    "content": "use tauri::AppHandle;\nuse crate::resource_watcher::ProInstance;\n\nuse super::{\n    config::{CommandConfig, DevpodCommandConfig, DevpodCommandError},\n    constants::{DEVPOD_BINARY_NAME, DEVPOD_COMMAND_LIST, DEVPOD_COMMAND_PRO, FLAG_OUTPUT_JSON},\n};\n\npub struct ListProInstancesCommand {}\nimpl ListProInstancesCommand {\n    pub fn new() -> Self {\n        ListProInstancesCommand {}\n    }\n\n    fn deserialize(&self, d: Vec<u8>) -> Result<Vec<ProInstance>, DevpodCommandError> {\n        serde_json::from_slice(&d).map_err(DevpodCommandError::Parse)\n    }\n}\nimpl DevpodCommandConfig<Vec<ProInstance>> for ListProInstancesCommand {\n    fn config(&self) -> CommandConfig {\n        CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![DEVPOD_COMMAND_PRO, DEVPOD_COMMAND_LIST, FLAG_OUTPUT_JSON],\n        }\n    }\n\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<Vec<ProInstance>, DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        let output = tauri::async_runtime::block_on(async move { cmd.output().await })\n            .map_err(|_| DevpodCommandError::Output)?;\n\n        self.deserialize(output.stdout)\n    }\n}\nimpl ListProInstancesCommand {\n    pub async fn exec(\n        self,\n        app_handle: &AppHandle,\n    ) -> Result<Vec<ProInstance>, DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        let output = cmd.output().await.map_err(|_| DevpodCommandError::Output)?;\n\n        self.deserialize(output.stdout)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/list_workspaces.rs",
    "content": "use tauri::AppHandle;\n\nuse crate::resource_watcher::Workspace;\n\nuse super::{\n    config::{CommandConfig, DevpodCommandConfig, DevpodCommandError},\n    constants::{DEVPOD_BINARY_NAME, DEVPOD_COMMAND_LIST, FLAG_OUTPUT_JSON},\n};\n\npub struct ListWorkspacesCommand {}\nimpl ListWorkspacesCommand {\n    pub fn new() -> Self {\n        ListWorkspacesCommand {}\n    }\n\n    fn deserialize(&self, d: Vec<u8>) -> Result<Vec<Workspace>, DevpodCommandError> {\n        serde_json::from_slice(&d).map_err(DevpodCommandError::Parse)\n    }\n}\nimpl DevpodCommandConfig<Vec<Workspace>> for ListWorkspacesCommand {\n    fn config(&self) -> CommandConfig {\n        CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![DEVPOD_COMMAND_LIST, FLAG_OUTPUT_JSON],\n        }\n    }\n\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<Vec<Workspace>, DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        let output = tauri::async_runtime::block_on(async move { cmd.output().await })\n            .map_err(|_| DevpodCommandError::Output)?;\n\n        self.deserialize(output.stdout)\n    }\n}\n\nimpl ListWorkspacesCommand {\n    pub async fn exec(self, app_handle: &AppHandle) -> Result<Vec<Workspace>, DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        let output = cmd.output().await.map_err(|_| DevpodCommandError::Output)?;\n\n        self.deserialize(output.stdout)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands/start_daemon.rs",
    "content": "use tauri::AppHandle;\nuse tauri_plugin_shell::process::Command;\n\nuse super::{\n    config::{CommandConfig, DevpodCommandConfig, DevpodCommandError},\n    constants::{DEVPOD_BINARY_NAME, DEVPOD_COMMAND_PRO, DEVPOD_COMMAND_DAEMON, DEVPOD_COMMAND_START, FLAG_DEBUG, FLAG_HOST},\n};\n\npub struct StartDaemonCommand {\n    host_flag: String,\n    debug_flag: String,\n}\nimpl StartDaemonCommand {\n    pub fn new(host: String, debug: bool) -> Self {\n        let debug_flag = match debug {\n            true => format!(\"{}=true\", FLAG_DEBUG),\n            false => \"\".to_string(),\n        };\n\n        return StartDaemonCommand {\n            host_flag: format!(\"{}={}\", FLAG_HOST, host),\n            debug_flag: debug_flag.to_string(),\n        };\n    }\n}\n\nimpl DevpodCommandConfig<()> for StartDaemonCommand {\n    fn exec_blocking(self, app_handle: &AppHandle) -> Result<(), DevpodCommandError> {\n        let cmd = self.new_command(app_handle)?;\n\n        tauri::async_runtime::block_on(async move { cmd.output().await })\n            .map_err(|_| DevpodCommandError::Output)?;\n\n        return Ok(());\n    }\n\n    fn config(&self) -> CommandConfig {\n        return CommandConfig {\n            binary_name: DEVPOD_BINARY_NAME,\n            args: vec![\n                DEVPOD_COMMAND_PRO,\n                DEVPOD_COMMAND_DAEMON,\n                DEVPOD_COMMAND_START,\n                &self.host_flag,\n                &self.debug_flag,\n            ],\n        };\n    }\n}\n\nimpl StartDaemonCommand {\n    pub fn command(self, app_handle: &AppHandle) -> Result<Command, DevpodCommandError> {\n        return self.new_command(app_handle);\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/commands.rs",
    "content": "mod config;\npub mod constants;\npub use config::{DevpodCommandConfig, DevpodCommandError};\npub use constants::DEVPOD_BINARY_NAME;\n\npub mod delete_provider;\npub mod delete_pro_instance;\npub mod list_workspaces;\npub mod list_pro_instances;\npub mod start_daemon;\n"
  },
  {
    "path": "desktop/src-tauri/src/community_contributions.rs",
    "content": "use crate::AppState;\n\nconst RAW_COMMUNITY_YAML: &str = include_str!(\"../../../community.yaml\");\n\n#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]\npub struct CommunityContributions {\n    providers: Vec<CommunityProvider>,\n}\n\n#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]\nstruct CommunityProvider {\n    repository: String,\n}\n\npub fn init() -> anyhow::Result<CommunityContributions> {\n    serde_yaml::from_str(RAW_COMMUNITY_YAML).map_err(|e| anyhow::anyhow!(e))\n}\n\n#[tauri::command]\npub fn get_contributions(state: tauri::State<'_, AppState>) -> Result<CommunityContributions, ()> {\n    let community_contributions = state.community_contributions.lock().unwrap();\n\n    Ok(community_contributions.clone())\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/custom_protocol.rs",
    "content": "use crate::ui_messages::{\n    send_ui_message, ImportWorkspaceMsg, OpenWorkspaceMsg, SetupProMsg, ShowToastMsg, ToastStatus,\n    UiMessage,\n};\nuse crate::AppState;\nuse log::{error, info, warn};\nuse serde::{Deserialize, Serialize};\nuse std::env;\nuse std::path::Path;\nuse tauri::{AppHandle, Manager, State};\nuse thiserror::Error;\nuse url::Url;\n\n// Should match the one from \"tauri.config.json\" and \"Info.plist\"\nconst APP_IDENTIFIER: &str = \"sh.loft.devpod\";\nconst APP_URL_SCHEME: &str = \"devpod\";\n\npub struct CustomProtocol;\n\npub struct Request {\n    host: String,\n    query: String,\n}\n\npub struct UrlParser {}\n\nimpl UrlParser {\n    const ALLOWED_METHODS: [&'static str; 3] = [\"open\", \"import\", \"pro\"];\n\n    fn get_host(url: &Url) -> String {\n        url.host_str().unwrap_or(\"no host\").to_string()\n    }\n\n    fn parse_raw_url(url_scheme: &str) -> Result<Url, ParseError> {\n        Url::parse(url_scheme).map_err(|_| ParseError::InvalidQuery(url_scheme.to_string()))\n    }\n\n    fn is_allowed_method(host_str: &str) -> bool {\n        Self::ALLOWED_METHODS.contains(&host_str)\n    }\n\n    fn parse_query(url: &Url) -> String {\n        url.query().unwrap_or(\"\").to_string()\n    }\n\n    pub fn parse(url_scheme: &str) -> Result<Request, ParseError> {\n        let url = Self::parse_raw_url(url_scheme)?;\n        let host_str = Self::get_host(&url);\n\n        if !Self::is_allowed_method(&host_str) {\n            return Err(ParseError::UnsupportedHost(host_str));\n        }\n        return Ok(Request {\n            host: host_str,\n            query: Self::parse_query(&url),\n        });\n    }\n}\n\npub struct OpenHandler {}\n\nimpl OpenHandler {\n    pub async fn handle(msg: Result<OpenWorkspaceMsg, ParseError>, app_state: State<'_, AppState>) {\n        match msg {\n            Ok(msg) => Self::handle_ok(msg, app_state).await,\n            Err(err) => Self::handle_error(err, app_state).await,\n        }\n    }\n\n    async fn handle_ok(msg: OpenWorkspaceMsg, app_state: State<'_, AppState>) {\n        // try to send to UI if ready, otherwise buffer and let ui_ready handle\n        send_ui_message(\n            app_state,\n            UiMessage::OpenWorkspace(msg),\n            \"Failed to broadcast custom protocol message\",\n        )\n        .await;\n    }\n\n    async fn handle_error(err: ParseError, app_state: State<'_, AppState>) {\n        #[cfg(not(target_os = \"windows\"))]\n        send_ui_message(\n            app_state,\n            UiMessage::CommandFailed(err),\n            \"Failed to broadcast invalid custom protocol message\",\n        )\n        .await;\n    }\n}\n\npub struct ImportHandler {}\n\nimpl ImportHandler {\n    pub async fn handle(\n        msg: Result<ImportWorkspaceMsg, ParseError>,\n        app_state: State<'_, AppState>,\n    ) {\n        match msg {\n            Ok(msg) => Self::handle_ok(msg, app_state).await,\n            Err(err) => Self::handle_error(err, app_state).await,\n        }\n    }\n\n    async fn handle_ok(msg: ImportWorkspaceMsg, app_state: State<'_, AppState>) {\n        // try to send to UI if ready, otherwise buffer and let ui_ready handle\n        send_ui_message(\n            app_state,\n            UiMessage::ImportWorkspace(msg),\n            \"Failed to broadcast custom protocol message\",\n        )\n        .await;\n    }\n\n    async fn handle_error(err: ParseError, app_state: State<'_, AppState>) {\n        #[cfg(not(target_os = \"windows\"))]\n        send_ui_message(\n            app_state,\n            UiMessage::CommandFailed(err),\n            \"Failed to broadcast invalid custom protocol message\",\n        )\n        .await;\n    }\n}\n\npub struct ProHandler {}\n\nimpl ProHandler {\n    pub async fn handle(msg: Result<SetupProMsg, ParseError>, app_state: State<'_, AppState>) {\n        match msg {\n            Ok(msg) => Self::handle_ok(msg, app_state).await,\n            Err(err) => Self::handle_error(err, app_state).await,\n        }\n    }\n\n    async fn handle_ok(msg: SetupProMsg, app_state: State<'_, AppState>) {\n        // try to send to UI if ready, otherwise buffer and let ui_ready handle\n        send_ui_message(\n            app_state,\n            UiMessage::SetupPro(msg),\n            \"Failed to broadcast custom protocol message\",\n        )\n        .await;\n    }\n\n    async fn handle_error(err: ParseError, app_state: State<'_, AppState>) {\n        #[cfg(not(target_os = \"windows\"))]\n        send_ui_message(\n            app_state,\n            UiMessage::CommandFailed(err),\n            \"Failed to broadcast invalid custom protocol message\",\n        )\n        .await;\n    }\n}\n\nimpl CustomProtocol {\n    pub fn init() -> Self {\n        tauri_plugin_deep_link::prepare(APP_IDENTIFIER);\n        Self {}\n    }\n\n    pub fn forward_deep_link() {\n        #[cfg(target_os = \"linux\")]\n        {\n            use std::{\n                fs::{remove_file},\n                io::{ErrorKind, Write},\n                os::unix::net::{UnixStream}\n            };\n\n            let addr = format!(\"/tmp/{}-deep-link.sock\", APP_IDENTIFIER);\n\n            match UnixStream::connect(&addr) {\n                Ok(mut stream) => {\n                    if let Err(io_err) = stream.write_all(std::env::args().nth(1).unwrap_or_default().as_bytes())\n                    {\n                        log::error!(\n                            \"Error sending message to primary instance: {}\",\n                            io_err.to_string()\n                        );\n                    };\n                }\n                Err(err) => {\n                    log::error!(\"Error creating socket listener: {}\", err.to_string());\n                    if err.kind() == ErrorKind::ConnectionRefused {\n                        let _ = remove_file(&addr);\n                    }\n                }\n            };\n        }\n\n        #[cfg(target_os = \"windows\")]\n        {\n            use std::io::Write;\n            use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};\n\n            if let Ok(mut conn) = LocalSocketStream::connect(APP_IDENTIFIER) {\n                if let Err(io_err) = conn.write_all(std::env::args().nth(1).unwrap_or_default().as_bytes())\n                {\n                    log::error!(\n                        \"Error sending message to primary instance: {}\",\n                        io_err.to_string()\n                    );\n                };\n                let _ = conn.write_all(b\"\\n\");\n            }\n        }\n\n    }\n\n    pub fn setup(&self, app: AppHandle) {\n        let app_handle = app.clone();\n\n        let result = tauri_plugin_deep_link::register(APP_URL_SCHEME, move |url_scheme| {\n            tauri::async_runtime::block_on(async {\n                info!(\"App opened with URL: {:?}\", url_scheme.to_string());\n\n                let request = UrlParser::parse(&url_scheme.to_string());\n                let app_state = app_handle.state::<AppState>();\n                if let Err(err) = request {\n                    warn!(\"Failed to broadcast custom protocol message: {:?}\", err);\n                    return;\n                }\n                let request = request.unwrap();\n\n                match request.host.as_str() {\n                    \"open\" => {\n                        let msg = CustomProtocol::parse(&request);\n                        OpenHandler::handle(msg, app_state).await\n                    }\n                    \"import\" => {\n                        let msg = CustomProtocol::parse(&request);\n                        ImportHandler::handle(msg, app_state).await\n                    }\n                    \"pro\" => {\n                        let msg = CustomProtocol::parse(&request);\n                        ProHandler::handle(msg, app_state).await\n                    }\n                    _ => {}\n                }\n            })\n        });\n\n        #[cfg(target_os = \"linux\")]\n        {\n            match result {\n                Ok(..) => {}\n                Err(error) => {\n                    let mut is_flatpak = false;\n\n                    match env::var(\"FLATPAK_ID\") {\n                        Ok(_) => is_flatpak = true,\n                        Err(_) => is_flatpak = false,\n                    }\n\n                    if !is_flatpak {\n                        let msg = \"Either update-desktop-database or xdg-mime are missing. Please make sure they are available on your system\";\n                        log::warn!(\"Custom protocol setup failed; {}: {}\", msg, error);\n\n                        tauri::async_runtime::block_on(async {\n                            let app_state = app.state::<AppState>();\n                            let show_toast_msg = ShowToastMsg::new(\n                                \"Custom protocol handling needs to be configured\".to_string(),\n                                msg.to_string(),\n                                ToastStatus::Warning,\n                            );\n                            if let Err(err) = app_state\n                                .ui_messages\n                                .send(UiMessage::ShowToast(show_toast_msg))\n                                .await\n                            {\n                                log::error!(\n                                    \"Failed to broadcast show toast message: {:?}, {}\",\n                                    err.0,\n                                    err\n                                );\n                            };\n                        })\n                    }\n                }\n            };\n        }\n\n        let _ = result;\n    }\n\n    fn parse<'a, Msg>(request: &'a Request) -> Result<Msg, ParseError>\n    where\n        Msg: Deserialize<'a>,\n    {\n        serde_qs::from_str::<Msg>(&request.query)\n            .map_err(|_| ParseError::InvalidQuery(request.query.clone()))\n    }\n}\n\n#[derive(Error, Debug, Clone, Serialize)]\npub enum ParseError {\n    #[error(\"Unsupported host: {0}\")]\n    UnsupportedHost(String),\n    #[error(\"Unsupported query arguments: {0}\")]\n    InvalidQuery(String),\n}\n\n#[cfg(test)]\nmod tests {\n    mod url_parser {\n        use super::super::*;\n\n        #[test]\n        fn should_parse() {\n            let url_str = \"devpod://open?workspace=workspace\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            assert_eq!(request.host, \"open\".to_string());\n            assert_eq!(request.query, \"workspace=workspace\".to_string());\n        }\n\n        #[test]\n        fn should_parse_with_empty_query() {\n            let url_str = \"devpod://import\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            assert_eq!(request.host, \"import\".to_string());\n            assert_eq!(request.query, \"\".to_string());\n        }\n\n        #[test]\n        #[should_panic]\n        fn should_fail_on_invalid_method() {\n            let url_str = \"devpod://something\";\n            let _ = UrlParser::parse(&url_str).unwrap();\n        }\n\n        #[test]\n        #[should_panic]\n        fn should_fail_on_invalid_scheme() {\n            let url_str = \"invalid-scheme\";\n            let _ = UrlParser::parse(&url_str).unwrap();\n        }\n    }\n\n    mod custom_handler_open {\n        use crate::custom_protocol::OpenWorkspaceMsg;\n\n        use super::super::*;\n\n        #[test]\n        fn should_parse_full() {\n            let url_str =\n                \"devpod://open?workspace=workspace&provider=provider&source=https://github.com/test123&ide=vscode\";\n            let request = UrlParser::parse(&url_str).unwrap();\n            let got: OpenWorkspaceMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.workspace_id, Some(\"workspace\".to_string()));\n            assert_eq!(got.provider_id, Some(\"provider\".into()));\n            assert_eq!(got.source, Some(\"https://github.com/test123\".to_string()));\n            assert_eq!(got.ide, Some(\"vscode\".into()));\n        }\n\n        #[test]\n        fn should_parse_workspace() {\n            let url_str = \"devpod://open?workspace=some-workspace\";\n            let request = UrlParser::parse(&url_str).unwrap();\n            let got: OpenWorkspaceMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.workspace_id, Some(\"some-workspace\".to_string()));\n            assert_eq!(got.provider_id, None);\n            assert_eq!(got.source, None);\n            assert_eq!(got.ide, None)\n        }\n\n        #[test]\n        fn should_parse() {\n            let url_str = \"devpod://open?source=some-source\";\n            let request = UrlParser::parse(&url_str).unwrap();\n            let got: OpenWorkspaceMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.workspace_id, None);\n            assert_eq!(got.provider_id, None);\n            assert_eq!(got.source, Some(\"some-source\".to_string()));\n            assert_eq!(got.ide, None)\n        }\n    }\n\n    mod custom_handler_import {\n        use crate::custom_protocol::ImportWorkspaceMsg;\n\n        use super::super::*;\n\n        #[test]\n        fn should_parse_full() {\n            let url_str =\n                \"devpod://import?workspace-id=workspace&workspace-uid=uid&devpod-pro-host=devpod.pro&other=other&project=foo\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            let got: ImportWorkspaceMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.workspace_id, \"workspace\".to_string());\n            assert_eq!(got.workspace_uid, \"uid\".to_string());\n            assert_eq!(got.project, \"foo\".to_string());\n            assert_eq!(got.devpod_pro_host, \"devpod.pro\".to_string());\n            assert_eq!(got.options.get(\"other\"), Some(&\"other\".to_string()));\n        }\n\n        #[test]\n        #[should_panic]\n        fn should_fail_on_missing_workspace_id() {\n            let url_str =\n                \"devpod://import?workspace-uid=uid&devpod-pro-host=devpod.pro&other=other\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            let got: Result<ImportWorkspaceMsg, ParseError> = CustomProtocol::parse(&request);\n            got.unwrap();\n        }\n    }\n\n    mod custom_handler_pro_setup {\n        use crate::custom_protocol::SetupProMsg;\n\n        use super::super::*;\n\n        #[test]\n        fn should_parse_full() {\n            let url_str = \"devpod://pro/setup?host=foo&access_key=bar\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            let got: SetupProMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.host, \"foo\".to_string());\n            assert_eq!(got.access_key, Option::Some(\"bar\".to_string()));\n        }\n\n        #[test]\n        fn should_parse_host() {\n            let url_str = \"devpod://pro/setup?host=localhost%3A8080\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            let got: SetupProMsg = CustomProtocol::parse(&request).unwrap();\n\n            assert_eq!(got.host, \"localhost:8080\".to_string());\n        }\n\n        #[test]\n        #[should_panic]\n        fn should_fail_on_missing_workspace_id() {\n            let url_str =\n                \"devpod://import?workspace-uid=uid&devpod-pro-host=devpod.pro&other=other\";\n            let request = UrlParser::parse(&url_str).unwrap();\n\n            let got: Result<ImportWorkspaceMsg, ParseError> = CustomProtocol::parse(&request);\n            got.unwrap();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/daemon/client.rs",
    "content": "use crate::daemon::DaemonStatus;\nuse anyhow::anyhow;\nuse bytes::{Buf, Bytes};\nuse http::Uri;\nuse http_body_util::{BodyExt, Empty};\nuse hyper::header;\nuse log::error;\nuse pin_project_lite::pin_project;\nuse serde::de::DeserializeOwned;\nuse std::{\n    io,\n    path::Path,\n    pin::Pin,\n    task::{Context, Poll},\n};\nuse tokio::io::AsyncWriteExt;\n\npub type Request = hyper::Request<axum::body::Body>;\npub type Response = hyper::Response<hyper::body::Incoming>;\n#[derive(Debug)]\npub struct Client {\n    socket: String,\n}\nimpl Client {\n    pub fn new(socket: String) -> Client {\n        return Client { socket };\n    }\n\n    pub fn clone(&self) -> Client {\n        return Client { socket: self.socket.clone() };\n    }\n\n    pub async fn status(&self) -> anyhow::Result<DaemonStatus> {\n        let res = self.get::<DaemonStatus>(\"/status\").await?;\n        return Ok(res);\n    }\n\n    pub async fn proxy(&self, mut req: Request) -> anyhow::Result<Response> {\n        let addr = Path::new(&self.socket);\n        let handshake_stream = HandshakeStream::connect(&addr).await?;\n        let io = TokioIo::new(handshake_stream);\n\n        let (mut sender, conn) = hyper::client::conn::http1::handshake(io).await?;\n        tokio::task::spawn(async move {\n            if let Err(err) = conn.await {\n                error!(\"Connection failed: {:?}\", err);\n            }\n        });\n\n        let path_and_query = req\n            .uri()\n            .path_and_query()\n            .map(|pq| pq.as_str())\n            .unwrap_or(\"\");\n        let new_uri = format!(\"http://localclient.devpod{}\", path_and_query);\n        *req.uri_mut() = new_uri\n            .parse::<Uri>()\n            .map_err(|e| anyhow!(\"failed to parse new URI: {:?}\", e))?;\n\n        req.headers_mut().insert(\n            header::HOST,\n            header::HeaderValue::from_static(\"sh.loft.devpod.desktop\"),\n        );\n\n        let res = sender.send_request(req).await?;\n        return Ok(res);\n    }\n\n    async fn get<T: DeserializeOwned>(&self, target_path: &str) -> anyhow::Result<T> {\n        let addr = Path::new(&self.socket);\n        let handshake_stream = HandshakeStream::connect(&addr).await?;\n        let io = TokioIo::new(handshake_stream);\n\n        let (mut sender, conn) = hyper::client::conn::http1::handshake(io).await?;\n        tokio::task::spawn(async move {\n            if let Err(err) = conn.await {\n                error!(\"Connection failed: {:?}\", err);\n            }\n        });\n\n        let req = hyper::Request::builder()\n            .uri(format!(\"http://localclient.devpod{}\", target_path))\n            .header(hyper::header::HOST, \"sh.loft.devpod.desktop\")\n            .body(Empty::<Bytes>::new())?;\n\n        let res = sender.send_request(req).await?;\n        if res.status() != http::StatusCode::OK {\n            return Err(anyhow!(\n                \"request to {} failed: {}\",\n                target_path,\n                res.status()\n            ));\n        }\n\n        let body = res.collect().await?.aggregate();\n        let out: T = serde_json::from_reader(body.reader())?;\n\n        return Ok(out);\n    }\n}\n\nconst DEVPOD_PREFIX_BYTE: u8 = 0x01;\n\npub struct HandshakeStream {\n    inner: InnerStream,\n}\n#[cfg(not(windows))]\ntype InnerStream = tokio::net::UnixStream;\n#[cfg(windows)]\ntype InnerStream = tokio::net::windows::named_pipe::NamedPipeClient;\n\nimpl HandshakeStream {\n    pub async fn connect(p: &Path) -> tokio::io::Result<Self> {\n        let mut inner: InnerStream;\n        #[cfg(not(windows))]\n        {\n            inner = tokio::net::UnixStream::connect(p).await?;\n        }\n        #[cfg(windows)]\n        {\n            inner = tokio::net::windows::named_pipe::ClientOptions::new().open(p)?;\n        }\n        let mut hs = HandshakeStream { inner };\n        // send devpod prefix as first byte\n        hs.inner.write_u8(DEVPOD_PREFIX_BYTE).await?;\n        Ok(hs)\n    }\n}\n\nimpl tokio::io::AsyncRead for HandshakeStream {\n    fn poll_read(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        buf: &mut tokio::io::ReadBuf<'_>,\n    ) -> Poll<io::Result<()>> {\n        Pin::new(&mut self.get_mut().inner).poll_read(cx, buf)\n    }\n}\n\nimpl tokio::io::AsyncWrite for HandshakeStream {\n    fn poll_write(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        buf: &[u8],\n    ) -> Poll<Result<usize, io::Error>> {\n        Pin::new(&mut self.get_mut().inner).poll_write(cx, buf)\n    }\n\n    fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>> {\n        Pin::new(&mut self.get_mut().inner).poll_flush(cx)\n    }\n\n    fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>> {\n        Pin::new(&mut self.get_mut().inner).poll_shutdown(cx)\n    }\n}\n\n// bridge between tokio and hyper, copied from https://github.com/hyperium/hyper/blob/master/benches/support/tokiort.rs#L92\npin_project! {\n    #[derive(Debug)]\n    pub struct TokioIo<T> {\n        #[pin]\n        inner: T,\n    }\n}\n\nimpl<T> TokioIo<T> {\n    pub fn new(inner: T) -> Self {\n        Self { inner }\n    }\n}\n\nimpl<T> hyper::rt::Read for TokioIo<T>\nwhere\n    T: tokio::io::AsyncRead,\n{\n    fn poll_read(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        mut buf: hyper::rt::ReadBufCursor<'_>,\n    ) -> Poll<Result<(), std::io::Error>> {\n        let n = unsafe {\n            let mut tbuf = tokio::io::ReadBuf::uninit(buf.as_mut());\n            match tokio::io::AsyncRead::poll_read(self.project().inner, cx, &mut tbuf) {\n                Poll::Ready(Ok(())) => tbuf.filled().len(),\n                other => return other,\n            }\n        };\n\n        unsafe {\n            buf.advance(n);\n        }\n        Poll::Ready(Ok(()))\n    }\n}\n\nimpl<T> hyper::rt::Write for TokioIo<T>\nwhere\n    T: tokio::io::AsyncWrite,\n{\n    fn poll_write(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        buf: &[u8],\n    ) -> Poll<Result<usize, std::io::Error>> {\n        tokio::io::AsyncWrite::poll_write(self.project().inner, cx, buf)\n    }\n\n    fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), std::io::Error>> {\n        tokio::io::AsyncWrite::poll_flush(self.project().inner, cx)\n    }\n\n    fn poll_shutdown(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n    ) -> Poll<Result<(), std::io::Error>> {\n        tokio::io::AsyncWrite::poll_shutdown(self.project().inner, cx)\n    }\n\n    fn is_write_vectored(&self) -> bool {\n        tokio::io::AsyncWrite::is_write_vectored(&self.inner)\n    }\n\n    fn poll_write_vectored(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        bufs: &[std::io::IoSlice<'_>],\n    ) -> Poll<Result<usize, std::io::Error>> {\n        tokio::io::AsyncWrite::poll_write_vectored(self.project().inner, cx, bufs)\n    }\n}\n\nimpl<T> tokio::io::AsyncRead for TokioIo<T>\nwhere\n    T: hyper::rt::Read,\n{\n    fn poll_read(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        tbuf: &mut tokio::io::ReadBuf<'_>,\n    ) -> Poll<Result<(), std::io::Error>> {\n        //let init = tbuf.initialized().len();\n        let filled = tbuf.filled().len();\n        let sub_filled = unsafe {\n            let mut buf = hyper::rt::ReadBuf::uninit(tbuf.unfilled_mut());\n\n            match hyper::rt::Read::poll_read(self.project().inner, cx, buf.unfilled()) {\n                Poll::Ready(Ok(())) => buf.filled().len(),\n                other => return other,\n            }\n        };\n\n        let n_filled = filled + sub_filled;\n        // At least sub_filled bytes had to have been initialized.\n        let n_init = sub_filled;\n        unsafe {\n            tbuf.assume_init(n_init);\n            tbuf.set_filled(n_filled);\n        }\n\n        Poll::Ready(Ok(()))\n    }\n}\n\nimpl<T> tokio::io::AsyncWrite for TokioIo<T>\nwhere\n    T: hyper::rt::Write,\n{\n    fn poll_write(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        buf: &[u8],\n    ) -> Poll<Result<usize, std::io::Error>> {\n        hyper::rt::Write::poll_write(self.project().inner, cx, buf)\n    }\n\n    fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), std::io::Error>> {\n        hyper::rt::Write::poll_flush(self.project().inner, cx)\n    }\n\n    fn poll_shutdown(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n    ) -> Poll<Result<(), std::io::Error>> {\n        hyper::rt::Write::poll_shutdown(self.project().inner, cx)\n    }\n\n    fn is_write_vectored(&self) -> bool {\n        hyper::rt::Write::is_write_vectored(&self.inner)\n    }\n\n    fn poll_write_vectored(\n        self: Pin<&mut Self>,\n        cx: &mut Context<'_>,\n        bufs: &[std::io::IoSlice<'_>],\n    ) -> Poll<Result<usize, std::io::Error>> {\n        hyper::rt::Write::poll_write_vectored(self.project().inner, cx, bufs)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/daemon.rs",
    "content": "use serde::{Deserialize, Serialize};\nuse ts_rs::TS;\nuse lazy_static::lazy_static;\nuse tauri::image::Image;\n\npub mod client;\n\n#[derive(Debug, Default, Serialize, Deserialize, Eq, PartialEq, TS)]\n#[serde(rename_all = \"camelCase\", default)]\n#[ts(export)]\npub struct DaemonStatus {\n    pub state: DaemonState,\n    pub online: bool,\n    pub login_required: bool,\n}\n\n#[derive(Debug, Default, Eq, PartialEq, Serialize, Deserialize, TS)]\n#[serde(rename_all = \"lowercase\")]\n#[ts(export)]\npub enum DaemonState {\n    Stopped,\n    #[default]\n    Pending,\n    Running,\n}\nimpl DaemonState {\n    pub fn running_icon() -> Image<'static> {\n        lazy_static! {\n            static ref RUNNING_ICON: Image<'static> =\n                Image::from_bytes(include_bytes!(\"../icons/running.png\")).unwrap();\n        }\n        return RUNNING_ICON.clone();\n    }\n    pub fn stopped_icon() -> Image<'static> {\n        lazy_static! {\n            static ref STOPPED_ICON: Image<'static> =\n                Image::from_bytes(include_bytes!(\"../icons/stopped.png\")).unwrap();\n        }\n        return STOPPED_ICON.clone();\n    }\n    pub fn pending_icon() -> Image<'static> {\n        lazy_static! {\n            static ref PENDING_ICON: Image<'static> =\n                Image::from_bytes(include_bytes!(\"../icons/pending.png\")).unwrap();\n        }\n        return PENDING_ICON.clone();\n    }\n\n    pub fn get_icon(&self) -> tauri::image::Image {\n        return match self {\n            DaemonState::Running => Self::running_icon(),\n            DaemonState::Stopped => Self::stopped_icon(),\n            DaemonState::Pending => Self::pending_icon(),\n        };\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/file_exists.rs",
    "content": "use crate::{commands::DevpodCommandError, AppState, UiMessage};\nuse log::{error, info, warn};\nuse std::path::Path;\n\n#[tauri::command]\npub fn file_exists(filepath: &str) -> bool {\n    info!(\"finding file in {}\", filepath);\n    return Path::new(&filepath).exists();\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/fix_env.rs",
    "content": "use std::fmt::format;\nuse std::process::Output;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(transparent)]\n    Shell(#[from] std::io::Error),\n    #[error(\"invalid output from shell echo: {0}\")]\n    InvalidOutput(String),\n    #[error(\"failed to run shell echo: {0}\")]\n    EchoFailed(String),\n}\n\nfn get_shell() -> String {\n    let default_shell = if cfg!(target_os = \"macos\") {\n        \"/bin/zsh\"\n    } else {\n        \"/bin/sh\"\n    };\n    return std::env::var(\"SHELL\").unwrap_or_else(|_| default_shell.into());\n}\n\nfn read_path_env_cmd(shell: String, var_name: String) -> Result<Output, Error> {\n    return std::process::Command::new(shell)\n        .arg(\"-ilc\")\n        .arg(format!(\"printenv {}; exit\", var_name))\n        // Disables Oh My Zsh auto-update thing that can block the process.\n        .env(\"DISABLE_AUTO_UPDATE\", \"true\")\n        .output()\n        .map_err(Error::Shell);\n}\n\npub fn fix_env(var_name: &str) -> Result<(), Error> {\n    #[cfg(windows)]\n    {\n        return Ok(());\n    }\n    #[cfg(not(windows))]\n    {\n        let shell = get_shell();\n        let out = read_path_env_cmd(shell, String::from(var_name))?;\n\n        if out.status.success() {\n            let stdout = String::from_utf8_lossy(&out.stdout).into_owned();\n            let cleaned = &strip_ansi_escapes::strip(stdout)?;\n            let value = String::from_utf8_lossy(cleaned);\n            std::env::set_var(var_name, value.as_ref());\n            Ok(())\n        } else {\n            Err(Error::EchoFailed(\n                String::from_utf8_lossy(&out.stderr).into_owned(),\n            ))\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/get_env.rs",
    "content": "use crate::{commands::DevpodCommandError, AppState, UiMessage};\nuse log::error;\n\n#[tauri::command]\npub fn get_env(name: &str) -> String {\n    std::env::var(String::from(name)).unwrap_or(String::from(\"\"))\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/install_cli.rs",
    "content": "use crate::{commands::DEVPOD_BINARY_NAME, AppHandle};\nuse log::error;\nuse std::path::Path;\nuse std::str::Lines;\nuse std::{env, path::PathBuf};\nuse thiserror::Error;\nuse std::fs;\nuse log::{info,debug};\n\n#[derive(Error, Debug)]\n#[allow(dead_code)]\npub enum InstallCLIError {\n    #[error(\"Unable to get current executable path\")]\n    NoExePath(#[source] std::io::Error),\n    #[error(\"Unable to create link to cli {0}\")]\n    Link(#[source] anyhow::Error),\n    #[error(\"Unable to convert path to string\")]\n    PathConversion,\n    #[error(\"Encountered an issue with the windows registry: \")]\n    Registry(#[source] std::io::Error),\n    #[error(\"No data directory found\")]\n    DataDir,\n    #[error(\"Unable to create directory\")]\n    CreateDir(#[source] std::io::Error),\n    #[error(\"Unable to write to file\")]\n    WriteFile(#[source] std::io::Error),\n    #[error(\"Failed to inform Windows about the change in environment variables. You will need to reboot you machine for them to take effect.\")]\n    WindowsBroadcastChange,\n}\nimpl serde::Serialize for InstallCLIError {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: serde::Serializer,\n    {\n        serializer.serialize_str(self.to_string().as_ref())\n    }\n}\n\n#[tauri::command]\npub fn install_cli(app_handle: AppHandle, force: bool) -> Result<(), InstallCLIError> {\n    if let Err(err) = install(app_handle, force) {\n        error!(\"{}\", err);\n        Err(err)\n    } else {\n        Ok(())\n    }\n}\n\n// The path to the `devpod-cli` binary/executable. If bundled correctly, will be placed next to the desktop app executable.\nfn get_cli_path() -> Result<PathBuf, std::io::Error> {\n    let mut exe_path = env::current_exe()?;\n    exe_path.pop();\n    exe_path.push(DEVPOD_BINARY_NAME);\n\n    Ok(exe_path)\n}\n\n#[cfg(not(target_os = \"windows\"))]\nfn install(_app_handle: AppHandle, force: bool) -> Result<(), InstallCLIError> {\n    use anyhow::Context;\n    use dirs::home_dir;\n    use log::{info, warn};\n    use std::{fs::remove_file, os::unix::fs::symlink};\n\n    let cli_path = get_cli_path().map_err(InstallCLIError::NoExePath)?;\n\n    // The binary we ship with is `devpod-cli`, but we want to link it to `devpod` so that users can just run `devpod` in their terminal\n    let mut target_paths: Vec<PathBuf> = vec![];\n\n    // /usr/local/bin/devpod\n    let raw_system_bin = format!(\"/usr/local/bin/{}\", \"devpod\");\n    target_paths.push(PathBuf::from(&raw_system_bin));\n\n    if force {\n        info!(\"Attempting to force install CLI\");\n        let script = format!(\"osascript -e \\\"do shell script \\\\\\\"mkdir -p /usr/local/bin && ln -sf '{}' '{}'\\\\\\\" with administrator privileges\\\"\", cli_path.to_string_lossy(), raw_system_bin);\n        let status = std::process::Command::new(\"sh\")\n            .arg(\"-c\")\n            .arg(script)\n            .status()\n            .map_err(anyhow::Error::msg)\n            .map_err(InstallCLIError::Link)?;\n        info!(\"Status: {}\", status);\n\n        return Ok(());\n    }\n\n    if let Some(home) = home_dir() {\n        // $HOME/bin/devpod\n        let mut user_bin = home.clone();\n        user_bin.push(\"bin/devpod\");\n\n        // $HOME/.local/bin/devpod\n        let mut user_local_bin = home;\n        user_local_bin.push(\".local/bin/devpod\");\n\n        // create .local/bin if necessary\n        if let Some(path) = user_local_bin.clone().parent() {\n            fs::create_dir_all(path);\n        }\n\n        target_paths.push(user_local_bin);\n        target_paths.push(user_bin);\n    }\n\n    let mut latest_error: Option<InstallCLIError> = None;\n    let is_on_tmpfs = is_tmpfs(&cli_path.as_path());\n\n    for target_path in target_paths {\n        let str_target_path = target_path.to_string_lossy();\n        match target_path.try_exists() {\n            Ok(exists) => {\n                if exists {\n                    // Remove link before attempting to create another one\n                    if let Err(err) = remove_file(&target_path)\n                        .with_context(|| format!(\"path: {}\", str_target_path))\n                        .map_err(InstallCLIError::Link)\n                    {\n                        warn!(\n                            \"Failed to remove link: {}; Retrying with other paths...\",\n                            err\n                        );\n                        continue;\n                    };\n                }\n            }\n            _ => { /* fallthrough */ }\n        }\n        info!(\n            \"Attempting to link cli to {}\",\n            target_path.to_string_lossy()\n        );\n\n        let mut is_flatpak = false;\n\n        match env::var(\"FLATPAK_ID\") {\n            Ok(_) => is_flatpak = true,\n            Err(_) => is_flatpak = false,\n        }\n\n        if is_flatpak {\n            match copy(cli_path.clone(), &target_path)\n                .with_context(|| format!(\"path: {}\", str_target_path))\n                .map_err(InstallCLIError::Link)\n            {\n                Ok(..) => {\n                    return Ok(());\n                }\n                Err(err) => {\n                    warn!(\n                        \"Failed to copy from {} to {}: {}; Retrying with other paths...\",\n                        cli_path.to_string_lossy(),\n                        target_path.to_string_lossy(),\n                        err\n                    );\n                    latest_error = Some(err);\n                }\n            }\n        } else {\n            let operation = if is_on_tmpfs { copy } else { symlink };\n\n            match operation(cli_path.clone(), &target_path)\n                .with_context(|| format!(\"path: {}\", str_target_path))\n                .map_err(InstallCLIError::Link)\n            {\n                Ok(..) => {\n                    return Ok(());\n                }\n                Err(err) => {\n                    warn!(\n                        \"Failed to link to {}: {}; Retrying with other paths...\",\n                        target_path.to_string_lossy(),\n                        err\n                    );\n                    latest_error = Some(err);\n                }\n            }\n        }\n    }\n\n    if let Some(err) = latest_error {\n        return Err(err);\n    }\n\n    Ok(())\n}\n\nfn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> std::io::Result<()> {\n    std::fs::copy(from, to).map(|_| ())\n}\n\n#[cfg(not(target_os = \"windows\"))]\nfn is_tmpfs(path: &Path) -> bool {\n    let mountpoint_file = match std::fs::read_to_string(\"/proc/mounts\") {\n        Ok(contents) => contents,\n        Err(_) => return false,\n    };\n\n    let mount_lines = mountpoint_file.lines();\n    let fs = match find_fs_type(path, &mount_lines) {\n        Some(contents) => contents,\n        None => return false,\n    };\n\n    return fs.to_string() == \"tmpfs\" || fs.to_string().contains(\"fuse\");\n}\n\n#[cfg(not(target_os = \"windows\"))]\nfn find_fs_type(curr_path: &Path, mount_lines: &Lines) -> Option<String> {\n    for line in mount_lines.clone() {\n        let columns: Vec<&str> = line.split_whitespace().collect();\n\n        if &curr_path.to_str()? == columns.get(1)? {\n            return Some(columns.get(2)?.to_string());\n        }\n    }\n\n    return find_fs_type(curr_path.parent()?, mount_lines);\n}\n\n#[cfg(target_os = \"windows\")]\nfn install(app_handle: AppHandle, force: bool) -> Result<(), InstallCLIError> {\n    use log::error;\n    use tauri::Manager;\n    use std::fs;\n    use windows::Win32::{\n        Foundation::{GetLastError, HWND, LPARAM},\n        UI::WindowsAndMessaging::{SendMessageTimeoutW, SMTO_ABORTIFHUNG, WM_SETTINGCHANGE},\n    };\n    use winreg::{\n        enums::{HKEY_CURRENT_USER, KEY_ALL_ACCESS},\n        RegKey,\n    };\n\n    struct BinFile {\n        name: String,\n        content: String,\n    }\n\n    let cli_path = get_cli_path().map_err(|e| InstallCLIError::NoExePath(e))?;\n    let mut bin_dir = app_handle\n        .path()\n        .app_data_dir()\n        .map_err(|_|InstallCLIError::DataDir)?;\n    bin_dir.push(\"bin\");\n\n    // Create binary directory in app dir and write bin_files to disk\n    // These will be stored in a /bin folder under our control, usually `%APP_DIR%/sh.loft.devpod/bin`\n    let cli_path = cli_path.to_str().ok_or(InstallCLIError::PathConversion)?;\n\n    let sh_file = BinFile {\n        name: \"devpod\".to_string(),\n        // WARN: we actually need to debug print here because this escapes the backslash to `\\\\` and will then be recognised by the shell\n        content: format!(\"#!/usr/bin/env sh\\n{:?}.exe \\\"$@\\\" \\nexit $?\", cli_path),\n    };\n\n    let cmd_file = BinFile {\n        name: format!(\"{}.cmd\", \"devpod\".to_string()),\n        content: format!(\"@echo off\\n\\\"{}.exe\\\" %*\", cli_path),\n    };\n\n    fs::create_dir_all(bin_dir.clone()).map_err(|e| InstallCLIError::CreateDir(e))?;\n    for BinFile { content, name } in [sh_file, cmd_file] {\n        let mut file_path = bin_dir.clone();\n        file_path.push(name);\n\n        if let Err(e) = fs::write(file_path, content.as_bytes()) {\n            return Err(InstallCLIError::WriteFile(e));\n        }\n    }\n\n    // Now that we placed our entry points in the /bin folder, we need to update the users path environment variable\n    // to include said folder\n    let current_dir_path = bin_dir.to_str().ok_or(InstallCLIError::PathConversion)?;\n    let hkcu = RegKey::predef(HKEY_CURRENT_USER);\n    let environment_key = hkcu\n        .open_subkey_with_flags(\"Environment\", KEY_ALL_ACCESS)\n        .map_err(|e| InstallCLIError::Registry(e))?;\n    let mut current_env_path: String = environment_key\n        .get_value(\"Path\")\n        .map_err(|e| InstallCLIError::Registry(e))?;\n\n    // Make sure we only add the path once\n    if current_env_path.contains(current_dir_path) {\n        return Ok(());\n    }\n\n    current_env_path.push_str(&format!(\";{}\", current_dir_path));\n\n    environment_key\n        .set_value(\"Path\", &current_env_path)\n        .map_err(|e| InstallCLIError::Registry(e))?;\n\n    // After setting the registry key we need to inform windows about the changes.\n    // Otherwise it would require a full system reboot for them to take effect.\n    unsafe {\n        // See https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange\n        // and https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagetimeoutw\n        // for more information about `WM_SETTINGCHANGE` and `SendMessageTimeoutW`.\n\n        #[allow(non_snake_case)]\n        let HWND_BROADCAST = HWND(0xffff);\n        let environment_ptr = LPARAM(\"Environment\".as_ptr() as isize);\n        // Apparently we can only broadcast this message via a synchronous operation, `PostMessage` doesn't work here\n        // This function blocks until either all windows handled the message or the timeout is exceeded for every one of them. You can check the documentation for details.\n        // Because of this, we need to ensure this function will only be called on a thread that's okay with being blocked for some time.\n        // Right now this will only be called from a tauri command, so we're good. If you need to call this function from somewhere else, be aware of the blocking.\n        let result = SendMessageTimeoutW(\n            HWND_BROADCAST,\n            WM_SETTINGCHANGE,\n            None,\n            environment_ptr,\n            SMTO_ABORTIFHUNG,\n            3_000,\n            None,\n        );\n        if result.0 == 0 {\n            let last_error = GetLastError();\n            error!(\"{:?}\", last_error);\n\n            return Err(InstallCLIError::WindowsBroadcastChange);\n        }\n    };\n\n    Ok(())\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/logging.rs",
    "content": "use log::LevelFilter;\nuse tauri::{plugin::TauriPlugin, Wry};\nuse tauri_plugin_log::{Target, TargetKind};\n\n#[allow(unused_variables)]\npub fn build_plugin() -> TauriPlugin<Wry> {\n    let enable_debug_logging: Option<&'static str> = option_env!(\"DEBUG\");\n    let mut targets: Vec<_> = vec![];\n\n    #[cfg(debug_assertions)] // only enable during development\n    if enable_debug_logging.is_some() {\n        targets.push(Target::new(TargetKind::Stdout));\n    }\n    #[cfg(not(debug_assertions))] // only enable in release builds\n    targets.push(Target::new(TargetKind::LogDir {\n        file_name: Some(\"DevPod\".to_string()),\n    }));\n\n    let builder = tauri_plugin_log::Builder::default().targets(targets);\n    #[cfg(debug_assertions)] // only enable during development\n    let builder = builder.level(LevelFilter::Debug);\n    #[cfg(not(debug_assertions))] // only enable in release builds\n    let builder = builder.level(LevelFilter::Info);\n\n    builder.build()\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/main.rs",
    "content": "#![cfg_attr(\n    all(not(debug_assertions), target_os = \"windows\"),\n    windows_subsystem = \"windows\"\n)]\n\n#[cfg(target_os = \"macos\")]\n#[macro_use]\nextern crate objc;\n\nmod action_logs;\nmod commands;\nmod community_contributions;\nmod custom_protocol;\nmod daemon;\nmod file_exists;\nmod fix_env;\nmod get_env;\nmod install_cli;\nmod logging;\nmod providers;\nmod resource_watcher;\nmod server;\nmod settings;\nmod system_tray;\nmod ui_messages;\nmod ui_ready;\nmod updates;\nmod util;\nmod window;\n\nuse community_contributions::CommunityContributions;\nuse custom_protocol::CustomProtocol;\nuse log::{error, info};\nuse resource_watcher::{ProState, WorkspacesState};\nuse std::sync::{Arc, Mutex};\nuse system_tray::{SystemTray, SYSTEM_TRAY_ICON_BYTES};\nuse tauri::{image::Image, tray::TrayIconBuilder, Manager, Wry};\nuse tokio::sync::{\n    mpsc::{self, Sender},\n    RwLock,\n};\nuse ui_messages::UiMessage;\nuse util::{kill_child_processes, QUIT_EXIT_CODE};\n\npub type AppHandle = tauri::AppHandle<Wry>;\n\npub struct AppState {\n    workspaces: Arc<RwLock<WorkspacesState>>,\n    pro: Arc<RwLock<ProState>>,\n    community_contributions: Arc<Mutex<CommunityContributions>>,\n    ui_messages: Sender<UiMessage>,\n    releases: Arc<Mutex<updates::Releases>>,\n    pending_update: Arc<Mutex<Option<updates::Release>>>,\n    update_installed: Arc<Mutex<bool>>,\n    resources_handles: Arc<Mutex<Vec<tauri::async_runtime::JoinHandle<()>>>>,\n}\nfn main() -> anyhow::Result<()> {\n    // https://unix.stackexchange.com/questions/82620/gui-apps-dont-inherit-path-from-parent-console-apps\n    fix_env::fix_env(\"PATH\")?;\n\n    let contributions = community_contributions::init()?;\n\n    let ctx = tauri::generate_context!();\n    let app_name = ctx.package_info().name.to_string();\n\n    CustomProtocol::forward_deep_link();\n\n    let (tx, rx) = mpsc::channel::<UiMessage>(10);\n\n    let mut app_builder = tauri::Builder::default();\n    // this case is handled by macos itself + tauri::RunEvent::Reopen\n    #[cfg(not(target_os = \"macos\"))]\n    {\n        app_builder = app_builder.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {\n            let app_state = app.state::<AppState>();\n\n            tauri::async_runtime::block_on(async move {\n                if let Err(err) = app_state.ui_messages.send(UiMessage::ShowDashboard).await {\n                    error!(\"Failed to broadcast show dashboard message: {}\", err);\n                };\n            });\n        }));\n    }\n    app_builder = app_builder\n        .manage(AppState {\n            workspaces: Arc::new(RwLock::new(WorkspacesState::default())),\n            pro: Arc::new(RwLock::new(ProState::default())),\n            community_contributions: Arc::new(Mutex::new(contributions)),\n            ui_messages: tx.clone(),\n            releases: Arc::new(Mutex::new(updates::Releases::default())),\n            pending_update: Arc::new(Mutex::new(None)),\n            update_installed: Arc::new(Mutex::new(false)),\n            resources_handles: Arc::new(Mutex::new(vec![])),\n        })\n        .plugin(logging::build_plugin())\n        .plugin(tauri_plugin_store::Builder::default().build())\n        .plugin(tauri_plugin_dialog::init())\n        .plugin(tauri_plugin_clipboard_manager::init())\n        .plugin(tauri_plugin_fs::init())\n        .plugin(tauri_plugin_os::init())\n        .plugin(tauri_plugin_process::init())\n        .plugin(tauri_plugin_shell::init())\n        .plugin(tauri_plugin_notification::init())\n        .plugin(tauri_plugin_updater::Builder::new().build())\n        .setup(move |app| {\n            info!(\"Setup application\");\n\n            providers::check_dangling_provider(&app.handle());\n            let window_helper = window::WindowHelper::new(app.handle().clone());\n\n            let window = app.get_webview_window(\"main\").unwrap();\n            window_helper.setup(&window);\n\n            let app_handle = app.handle().clone();\n            resource_watcher::setup(&app_handle);\n\n            action_logs::setup(&app.handle())?;\n\n            let custom_protocol = CustomProtocol::init();\n            custom_protocol.setup(app.handle().clone());\n\n            let app_handle = app.handle().clone();\n            tauri::async_runtime::spawn(async move {\n                let update_helper = updates::UpdateHelper::new(&app_handle);\n                if let Ok(releases) = update_helper.fetch_releases().await {\n                    let state = app_handle.state::<AppState>();\n                    let mut releases_state = state.releases.lock().unwrap();\n                    *releases_state = releases;\n                }\n\n                update_helper.poll().await;\n            });\n\n            let app_handle = app.handle().clone();\n            tauri::async_runtime::spawn(async move {\n                if let Err(err) = server::setup(&app_handle).await {\n                    error!(\"Failed to start server: {}\", err);\n                }\n            });\n\n            let app_handle = app.handle().clone();\n            tauri::async_runtime::spawn(async move {\n                ui_messages::UiMessageHelper::new(app_handle, app_name, window_helper)\n                    .listen(rx)\n                    .await;\n            });\n\n            let system_tray = SystemTray::new();\n            let app_handle = app.handle().clone();\n            tauri::async_runtime::block_on(async move {\n                if let Ok(menu) = system_tray.init(&app_handle).await {\n                    let _tray = TrayIconBuilder::with_id(\"main\")\n                        .icon(Image::from_bytes(SYSTEM_TRAY_ICON_BYTES).unwrap(),)\n                        .icon_as_template(true)\n                        .menu(&menu)\n                        .menu_on_left_click(true)\n                        .on_menu_event(system_tray.get_menu_event_handler())\n                        .on_tray_icon_event(system_tray.get_tray_icon_event_handler())\n                        .build(app);\n                }\n            });\n\n            info!(\"Setup done\");\n            Ok(())\n        });\n\n    app_builder = app_builder.invoke_handler(tauri::generate_handler![\n        ui_ready::ui_ready,\n        action_logs::write_action_log,\n        action_logs::get_action_logs,\n        action_logs::get_action_log_file,\n        install_cli::install_cli,\n        get_env::get_env,\n        file_exists::file_exists,\n        community_contributions::get_contributions,\n        updates::get_pending_update,\n        updates::check_updates\n    ]);\n\n    let app = app_builder\n        .build(ctx)\n        .expect(\"error while building tauri application\");\n\n    app.run(move |app_handle, event| {\n        let exit_requested_tx = tx.clone();\n        let reopen_tx = tx.clone();\n\n        #[cfg(target_os = \"macos\")]\n        {\n            if let tauri::RunEvent::Reopen { .. } = event {\n                tauri::async_runtime::block_on(async move {\n                    if let Err(err) = reopen_tx.send(UiMessage::ShowDashboard).await {\n                        error!(\"Failed to broadcast show dashboard message: {}\", err);\n                    };\n                });\n\n                return;\n            }\n        }\n\n        match event {\n            // Prevents app from exiting when last window is closed, leaving the system tray active\n            tauri::RunEvent::ExitRequested { api, code, .. } => {\n                info!(\"Handling ExitRequested event.\");\n\n                // On windows, we want to kill all existing child processes to prevent dangling processes later down the line.\n\n                tauri::async_runtime::block_on(async move {\n                    if let Err(err) = exit_requested_tx.send(UiMessage::ExitRequested).await {\n                        error!(\"Failed to broadcast UI ready message: {:?}\", err);\n                    }\n                });\n\n                // Check if the user clicked \"Quit\" in the system tray, in which case we have to actually close.\n                if let Some(code) = code {\n                    if code == QUIT_EXIT_CODE {\n                        return;\n                    }\n                }\n\n                // Otherwise, we stay alive in the system tray.\n                api.prevent_exit();\n            }\n            tauri::RunEvent::WindowEvent { event, label, .. } => {\n                if let tauri::WindowEvent::Destroyed = event {\n                    providers::check_dangling_provider(app_handle);\n                    #[cfg(target_os = \"macos\")]\n                    {\n                        let window_helper = window::WindowHelper::new(app_handle.clone());\n                        let window_count = app_handle.webview_windows().len();\n                        info!(\"Window \\\"{}\\\" destroyed, {} remaining\", label, window_count);\n                        if window_count == 0 {\n                            window_helper.set_dock_icon_visibility(false);\n                        }\n                    }\n                }\n            }\n            tauri::RunEvent::Exit => {\n                kill_child_processes(std::process::id());\n                providers::check_dangling_provider(app_handle);\n                tauri::async_runtime::block_on(async move {\n                    resource_watcher::shutdown(app_handle).await;\n                });\n            }\n            _ => {}\n        }\n    });\n\n    Ok(())\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/providers.rs",
    "content": "use crate::commands::delete_pro_instance::DeleteProInstanceCommand;\nuse crate::commands::list_pro_instances::ListProInstancesCommand;\nuse crate::commands::{delete_provider::DeleteProviderCommand, DevpodCommandConfig};\nuse crate::resource_watcher::{Identifiable, ProInstance};\nuse crate::AppHandle;\nuse log::{debug, error, info};\nuse tauri_plugin_store::StoreExt;\n\npub fn check_dangling_provider(app_handle: &AppHandle) {\n    let dangling_provider_key = \"danglingProviders\"; // WARN: needs to match the key defined in typescript\n    let filename = \".providers.json\"; // WARN: needs to match the file name defined in typescript\n\n    debug!(\"Checking for dangling providers\");\n    let store = app_handle.store(filename);\n    if store.is_err() {\n        error!(\"unable to open store {}\", filename);\n        return;\n    }\n    let store = store.unwrap();\n    let dangling_providers = store\n        .get(dangling_provider_key)\n        .and_then(|dangling_providers| {\n            serde_json::from_value::<Vec<String>>(dangling_providers.clone()).ok()\n        });\n\n    if dangling_providers.is_none() {\n        debug!(\"No dangling providers found\");\n        return;\n    }\n    let dangling_providers = dangling_providers.unwrap();\n\n    if dangling_providers.is_empty() {\n        debug!(\"No dangling providers found\");\n        return;\n    }\n\n    info!(\n        \"Found dangling providers: {}, attempting to delete\",\n        dangling_providers.join(\", \")\n    );\n\n    let pro_instances = match ListProInstancesCommand::new().exec_blocking(app_handle) {\n        Ok(pro_instances) => pro_instances,\n        Err(err) => {\n            error!(\"Failed to list pro instances, {}\", err);\n            vec![]\n        }\n    };\n\n    for dangling_provider in dangling_providers.iter() {\n        // Make sure we clean up accompanying pro instances\n        check_pro_instances(app_handle, &pro_instances, &dangling_provider);\n\n        if DeleteProviderCommand::new(dangling_provider.clone())\n            .exec_blocking(&app_handle)\n            .is_ok()\n            && store.delete(dangling_provider_key)\n        {\n            info!(\n                \"Successfully deleted dangling provider: {}\",\n                dangling_provider\n            );\n            let _ = store.save();\n        }\n    }\n}\n\nfn check_pro_instances(\n    app_handle: &AppHandle,\n    pro_instances: &Vec<ProInstance>,\n    dangling_provider: &String,\n) {\n    if let Some(pro_instance) = pro_instances\n        .iter()\n        .find(|pro_instance| &pro_instance.id() == dangling_provider)\n    {\n        let pro_id = pro_instance.id();\n        info!(\n            \"Found dangling provider {} matching pro instance {}\",\n            dangling_provider, pro_id\n        );\n\n        match DeleteProInstanceCommand::new(pro_id.to_string()).exec_blocking(app_handle) {\n            Ok(_) => info!(\"Successfully deleted pro instance {}\", pro_id),\n            Err(err) => error!(\"Failed to delete pro instance {}, {}\", pro_id, err),\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/resource_watcher.rs",
    "content": "use crate::{\n    commands::{\n        list_pro_instances::ListProInstancesCommand, list_workspaces::ListWorkspacesCommand,\n        start_daemon::StartDaemonCommand, DevpodCommandError,\n    },\n    daemon,\n    system_tray::{ToSystemTraySubmenu, SYSTEM_TRAY_ICON_BYTES, WARNING_SYSTEM_TRAY_ICON_BYTES},\n    ui_messages,\n};\nuse crate::{AppHandle, AppState};\nuse anyhow::anyhow;\nuse log::{debug, error, info};\nuse serde::Deserialize;\nuse std::{collections::HashSet, hash::Hash, time};\nuse tauri::{\n    async_runtime::Receiver,\n    image::Image,\n    menu::{IconMenuItem, MenuItem, Submenu, SubmenuBuilder},\n    Manager, Wry,\n};\nuse tauri_plugin_notification::NotificationExt;\nuse tauri_plugin_shell::process::{CommandChild, CommandEvent};\n\n\npub trait Identifiable {\n    type ID: Eq + Hash + Clone;\n    fn id(&self) -> Self::ID;\n}\n#[derive(Default)]\npub struct WorkspacesState {\n    workspaces: Vec<Workspace>,\n    submenu: Option<Submenu<Wry>>,\n}\n\n#[derive(Deserialize, Clone)]\npub struct Workspace {\n    id: String,\n    #[serde(skip)]\n    menu_item: Option<MenuItem<Wry>>,\n}\nimpl Identifiable for Workspace {\n    type ID = String;\n    fn id(&self) -> String {\n        return self.id.clone();\n    }\n}\nimpl PartialEq for Workspace {\n    fn eq(&self, other: &Self) -> bool {\n        self.id() == other.id()\n    }\n}\nimpl Workspace {\n    fn new_menu_item(&self, app_handle: &AppHandle) -> tauri::Result<MenuItem<Wry>> {\n        return MenuItem::with_id(\n            app_handle,\n            WorkspacesState::item_id(&self.id()),\n            self.id(),\n            true,\n            None::<&str>,\n        );\n    }\n}\n\nimpl WorkspacesState {\n    pub const IDENTIFIER_PREFIX: &'static str = \"workspaces-\";\n    pub const CREATE_WORKSPACE_ID: &'static str = \"workspaces-create_workspace\";\n\n    fn item_id(id: &String) -> String {\n        format!(\"{}{}\", Self::IDENTIFIER_PREFIX, id)\n    }\n\n    pub fn set_submenu(&mut self, submenu: Submenu<Wry>) {\n        self.submenu = Some(submenu);\n    }\n\n    pub async fn load_workspaces(\n        app_handle: &AppHandle,\n    ) -> Result<Vec<Workspace>, DevpodCommandError> {\n        let list_workspaces_cmd = ListWorkspacesCommand::new();\n\n        return list_workspaces_cmd.exec(app_handle).await;\n    }\n}\n\nimpl ToSystemTraySubmenu for WorkspacesState {\n    fn to_submenu(&self, app_handle: &AppHandle) -> anyhow::Result<tauri::menu::Submenu<Wry>> {\n        let mut submenu = SubmenuBuilder::with_id(app_handle, \"workspace\", \"Workspaces\");\n\n        let create_workspace = MenuItem::with_id(\n            app_handle,\n            Self::CREATE_WORKSPACE_ID,\n            \"Create Workspace\",\n            true,\n            None::<&str>,\n        )?;\n        submenu = submenu.item(&create_workspace);\n        submenu = submenu.separator();\n\n        return Ok(submenu.build()?);\n    }\n}\n\nstatic CAPABILITY_DAEMON: &str = \"daemon\";\nstatic MAX_RETRY_COUNT: i64 = 10;\nstatic RETRY_DEBUG_THRESHOLD: i64 = 7;\n#[derive(Default)]\npub struct ProState {\n    instances: Vec<ProInstance>,\n    submenu: Option<Submenu<tauri::Wry>>,\n    all_ready: bool,\n}\nimpl Identifiable for ProInstance {\n    type ID = String;\n    fn id(&self) -> String {\n        return self.host.clone();\n    }\n}\nimpl PartialEq for ProInstance {\n    fn eq(&self, other: &Self) -> bool {\n        self.id() == other.id()\n    }\n}\n\nimpl ProState {\n    pub const IDENTIFIER_PREFIX: &'static str = \"pro-instances-\";\n\n    fn item_id(id: &String) -> String {\n        format!(\"{}{}\", Self::IDENTIFIER_PREFIX, id)\n    }\n\n    pub async fn load_pro_instances(\n        app_handle: &AppHandle,\n    ) -> Result<Vec<ProInstance>, DevpodCommandError> {\n        let cmd = ListProInstancesCommand::new();\n        let pro_instances = cmd.exec(app_handle).await?;\n\n        Ok(pro_instances)\n    }\n\n    pub fn set_submenu(&mut self, submenu: Submenu<Wry>) {\n        self.submenu = Some(submenu);\n    }\n\n    pub fn find_instance(&self, pro_id: String) -> Option<&ProInstance> {\n        return self.instances.iter().find(|i| i.id() == pro_id);\n    }\n\n    pub fn find_instance_mut(&mut self, pro_id: String) -> Option<&mut ProInstance> {\n        return self.instances.iter_mut().find(|i| i.id() == pro_id);\n    }\n}\n\n#[derive(Deserialize)]\n#[serde(rename_all(serialize = \"camelCase\", deserialize = \"camelCase\"))]\npub struct ProInstance {\n    host: String,\n    provider: Option<String>,\n    context: Option<String>,\n    capabilities: Option<Vec<String>>,\n    #[serde(skip)]\n    menu_item: Option<IconMenuItem<Wry>>,\n    #[serde(skip)]\n    daemon: Option<Daemon>,\n}\nimpl ProInstance {\n    pub fn has_capability(&self, capability: String) -> bool {\n        if let Some(capabilities) = &self.capabilities {\n            for cap in capabilities {\n                if *cap == capability {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    pub fn daemon(&self) -> &Option<Daemon> {\n        return &self.daemon;\n    }\n\n    pub fn daemon_mut(&mut self) -> Option<&mut Daemon> {\n        return self.daemon.as_mut();\n    }\n\n    fn new_menu_item(&self, app_handle: &AppHandle) -> tauri::Result<IconMenuItem<Wry>> {\n        return IconMenuItem::with_id(\n            app_handle,\n            ProState::item_id(&self.id()),\n            self.id(),\n            true,\n            self.get_icon(),\n            None::<&str>,\n        );\n    }\n\n    fn get_icon(&self) -> Option<Image> {\n        return self\n            .daemon\n            .as_ref()\n            .map(|daemon| daemon.status.state.get_icon());\n    }\n}\n\n#[derive(Debug)]\npub struct Daemon {\n    status: daemon::DaemonStatus,\n    command: Option<(Receiver<CommandEvent>, CommandChild)>,\n    retry_count: i64,\n    client: daemon::client::Client,\n    provider: Option<String>,\n\n    notified_user_daemon_failed: bool,\n    notified_login_required: bool,\n}\nimpl Daemon {\n    pub fn new(provider: Option<String>) -> anyhow::Result<Daemon> {\n        let socket_addr = Daemon::get_socket_addr(provider.clone())?;\n        let client = daemon::client::Client::new(socket_addr);\n\n        return Ok(Daemon {\n            status: daemon::DaemonStatus::default(),\n            command: None,\n            retry_count: 0,\n            notified_user_daemon_failed: false,\n            notified_login_required: false,\n            provider,\n            client,\n        });\n    }\n\n    fn get_socket_addr(\n        provider: Option<String>,\n    ) -> Result<String, DevpodCommandError> {\n        let provider = provider.clone().ok_or(DevpodCommandError::Any(anyhow!(\n            \"provider not set for pro instance\"\n        )))?;\n        #[cfg(unix)]\n        {\n            return Ok(format!(\n                \"/tmp/devpod-{}.sock\",\n                provider\n            ));\n        }\n        #[cfg(windows)]\n        {\n            return Ok(format!(\"\\\\\\\\.\\\\pipe\\\\devpod.{}\", provider).to_string());\n        }\n    }\n\n    pub fn get_client(&self) -> &daemon::client::Client {\n        return &self.client;\n    }\n\n    pub async fn get_status(&self) -> anyhow::Result<daemon::DaemonStatus> {\n        return self.client.status().await;\n    }\n\n    pub async fn try_start(&mut self, host: String, app_handle: &AppHandle) {\n        info!(\"[{}] attempting to start daemon\", host.clone());\n        if let Some(_) = self.command {\n            self.try_stop().await;\n        }\n        match self.spawn(host.clone(), app_handle).await {\n            Ok(command) => {\n                info!(\"[{}] Successfully started daemon\", host.clone());\n                self.command = Some(command);\n            }\n            Err(err) => {\n                error!(\"[{}] Failed to spawn daemon command {:?}\", host, err);\n            }\n        }\n    }\n\n    pub async fn try_stop(&mut self) {\n        if let Some(command) = self.command.take() {\n            let pid = command.1.pid();\n            if let Err(err) = command.1.kill() {\n                debug!(\"Failed to kill command {:?}\", err);\n                // kill it with fire\n                crate::util::kill_process(pid);\n            }\n        }\n        self.command = None;\n        self.status = daemon::DaemonStatus::default();\n    }\n\n    fn should_retry(&mut self, app_handle: &AppHandle) -> bool {\n        if self.status.login_required {\n            return false;\n        }\n\n        self.retry_count += 1;\n        if self.retry_count < MAX_RETRY_COUNT {\n            return true;\n        } else {\n            self.try_notify_failed(app_handle);\n\n            // fall back to every 5 ticks after reaching `MAX_RETRY_COUNT`\n            return self.retry_count % 5 == 0;\n        }\n    }\n\n    fn should_debug(&self) -> bool {\n        return self.retry_count >= RETRY_DEBUG_THRESHOLD;\n    }\n\n    async fn spawn(\n        &mut self,\n        host: String,\n        app_handle: &AppHandle,\n    ) -> Result<(Receiver<CommandEvent>, CommandChild), DevpodCommandError> {\n        let (mut rx, child) = StartDaemonCommand::new(host.clone(), self.should_debug())\n            .command(app_handle)?\n            .spawn()?;\n\n        tokio::select! {\n            status = self.get_initial_status(&mut rx) => {\n                if let Ok(status) = status {\n                    self.status = status;\n                    if self.status.login_required {\n                        self.try_notify_login(host, app_handle).await;\n                    }\n                }\n            },\n            _ = tokio::time::sleep(tokio::time::Duration::from_secs(30)) => {\n                return Err(DevpodCommandError::Any(anyhow!(\"Timed out waiting for daemon to start\")));\n            }\n        }\n\n        return Ok((rx, child));\n    }\n\n    async fn get_initial_status(\n        &self,\n        rx: &mut Receiver<CommandEvent>,\n    ) -> anyhow::Result<daemon::DaemonStatus> {\n        loop {\n            if let Some(event) = rx.recv().await {\n                match event {\n                    CommandEvent::Stdout(out) => {\n                        return serde_json::from_slice::<daemon::DaemonStatus>(&out)\n                            .map_err(|err| anyhow!(\"failed to parse status: {:?}\", err));\n                    }\n                    _ => {\n                        return Err(anyhow!(\"expected stdout message\"));\n                    }\n                }\n            }\n        }\n    }\n\n    async fn try_notify_login(&mut self, host: String, app_handle: &AppHandle) {\n        if self.notified_login_required {\n            return;\n        }\n\n        let msg = ui_messages::LoginRequiredMsg {\n            host,\n            provider: self.provider.clone().unwrap_or(\"\".to_string()),\n        };\n        let _ = app_handle\n            .state::<AppState>()\n            .ui_messages\n            .send(ui_messages::UiMessage::LoginRequired(msg))\n            .await;\n\n        self.notified_login_required = true;\n    }\n\n    fn try_notify_failed(&mut self, app_handle: &AppHandle) {\n        if self.notified_user_daemon_failed {\n            return;\n        }\n        let res = app_handle\n                .notification()\n                .builder()\n                .title(\"Failed to start daemon\")\n                .body(\"Please take a look at \\\"Settings > Open Logs\\\" or report this issue to an administrator\")\n                .show();\n        if let Err(err) = res {\n            error!(\"Unable to send daemon-failed notification: {}\", err);\n        }\n\n        self.notified_user_daemon_failed = true;\n    }\n}\n\nimpl ToSystemTraySubmenu for ProState {\n    fn to_submenu(&self, app_handle: &AppHandle) -> anyhow::Result<tauri::menu::Submenu<Wry>> {\n        return Ok(SubmenuBuilder::with_id(app_handle, \"pro\", \"Pro\").build()?);\n    }\n}\n\npub fn setup(app_handle: &AppHandle) {\n    let state = app_handle.state::<AppState>();\n    let mut resource_handles = state.resources_handles.lock().unwrap();\n    // daemon watcher\n    let daemon_app_handle = app_handle.clone();\n    let daemon_watcher_handle = tauri::async_runtime::spawn(async move {\n        let sleep_duration = time::Duration::from_millis(1_000);\n        loop {\n            let res = watch_daemons(&daemon_app_handle).await;\n            if let Err(err) = res {\n                error!(\"watch daemons: {}\", err)\n            };\n            let _ = tokio::time::sleep(sleep_duration).await;\n        }\n    });\n    resource_handles.push(daemon_watcher_handle);\n\n    // main resources watchers\n    let resources_app_handle = app_handle.clone();\n    let resources_handle = tauri::async_runtime::spawn(async move {\n        let sleep_duration = time::Duration::from_millis(5_000);\n        loop {\n            handle_workspaces(&resources_app_handle).await;\n            handle_pro_instances(&resources_app_handle).await;\n            let _ = tokio::time::sleep(sleep_duration).await;\n        }\n    });\n    resource_handles.push(resources_handle);\n}\n\npub async fn shutdown(app_handle: &AppHandle) {\n    info!(\"Shutting down resource watchers\");\n    let state = app_handle.state::<AppState>();\n    // shut down background tasks\n    let mut handles = state.resources_handles.lock().unwrap();\n    for handle in handles.iter() {\n        handle.abort();\n    }\n    handles.clear();\n    // shut down daemons\n    let mut pro_state = state.pro.write().await;\n    for pro_instance in pro_state.instances.iter_mut() {\n        let id = pro_instance.id().clone();\n        if let Some(daemon) = pro_instance.daemon.as_mut() {\n            info!(\"[{}] Stopping daemon\", id);\n            daemon.try_stop().await;\n        }\n    }\n}\n\nasync fn watch_daemons(app_handle: &AppHandle) -> anyhow::Result<()> {\n    let state: tauri::State<'_, AppState> = app_handle.state::<AppState>();\n    let mut pro_state = state.pro.write().await;\n    let mut all_ready = true;\n\n    // TODO: parallelize\n    for instance in &mut pro_state.instances {\n        let id = instance.id();\n        if !instance.has_capability(CAPABILITY_DAEMON.to_string()) {\n            continue;\n        }\n        let daemon = instance.daemon();\n        if daemon.is_none() {\n            instance.daemon = Some(\n                Daemon::new(instance.provider.clone())\n                    .map_err(|err| anyhow!(\"Failed to create new daemon: {}\", err))?,\n            );\n        }\n        let daemon = instance.daemon.as_mut().unwrap();\n        if !daemon.should_retry(app_handle) {\n            all_ready = false;\n            continue;\n        }\n\n        if let Some(menu_item) = &instance.menu_item {\n            let _ = menu_item.set_icon(Some(daemon.status.state.get_icon()));\n        }\n\n        match daemon.get_status().await {\n            Ok(status) => {\n                daemon.status = status;\n                match daemon.status.state {\n                    daemon::DaemonState::Running => {\n                        daemon.retry_count = 0;\n                        // reset login notification once the daemon is up and running\n                        daemon.notified_login_required = false;\n                    }\n                    daemon::DaemonState::Stopped => {\n                        all_ready = false;\n                        info!(\"[{}] daemon stopped, attempting to restart\", id);\n                        daemon.status.state = daemon::DaemonState::Pending;\n                        daemon.try_start(id, app_handle).await;\n                    }\n                    daemon::DaemonState::Pending => {\n                        all_ready = false;\n                    }\n                }\n            }\n            Err(err) => {\n                all_ready = false;\n                info!(\"[{}] failed to get daemon status: {}\", id, err);\n                daemon.status.state = daemon::DaemonState::Stopped;\n\n                match daemon.command.as_mut() {\n                    Some(cmd) => {\n                        // replay stderr for debugging purposes\n                        while let Some(event) = cmd.0.recv().await {\n                            if let CommandEvent::Stderr(out) = event {\n                                error!(\"{}\", String::from_utf8(out)?.trim());\n                            }\n                        }\n                        // kill the current command and restart on the next iteration\n                        crate::util::kill_process(cmd.1.pid());\n                        daemon.command = None;\n                    }\n                    None => {\n                        daemon.status.state = daemon::DaemonState::Pending;\n                        daemon.try_start(id, app_handle).await;\n                    }\n                }\n            }\n        }\n\n        if let Some(menu_item) = &instance.menu_item {\n            let _ = menu_item.set_icon(Some(daemon.status.state.get_icon()));\n        }\n    }\n\n    if pro_state.all_ready != all_ready {\n        pro_state.all_ready = all_ready;\n\n        // update main system tray icon\n        if let Some(main_tray) = app_handle.tray_by_id(\"main\") {\n            let icon = match pro_state.all_ready {\n                true => Image::from_bytes(SYSTEM_TRAY_ICON_BYTES).unwrap(),\n                false => Image::from_bytes(WARNING_SYSTEM_TRAY_ICON_BYTES).unwrap(),\n            };\n            let _ = main_tray.set_icon(Some(icon));\n            let _ = main_tray.set_icon_as_template(true);\n        }\n    }\n\n    return Ok(());\n}\n\nasync fn handle_workspaces(app_handle: &AppHandle) {\n    let workspaces = WorkspacesState::load_workspaces(app_handle).await;\n    if workspaces.is_err() {\n        return;\n    }\n\n    let mut workspaces = workspaces.unwrap();\n    let state = app_handle.state::<AppState>();\n    let state = &mut state.workspaces.write().await;\n    if workspaces == state.workspaces {\n        return;\n    }\n\n    if let Some(submenu) = &state.submenu {\n        let (removed, added) = diff_mut(&state.workspaces, &mut workspaces);\n        for w in removed {\n            if let Some(menu_item) = &w.menu_item {\n                _ = submenu.remove(menu_item);\n            }\n        }\n        for w in added {\n            if let Ok(menu_item) = w.new_menu_item(app_handle) {\n                let _ = submenu.append(&menu_item);\n                w.menu_item = Some(menu_item);\n            }\n        }\n    }\n    state.workspaces = workspaces;\n}\n\nasync fn handle_pro_instances(app_handle: &AppHandle) {\n    let pro_instances = ProState::load_pro_instances(app_handle).await;\n    if pro_instances.is_err() {\n        return;\n    }\n    let mut pro_instances = pro_instances.unwrap();\n\n    let state = app_handle.state::<AppState>();\n    let state = &mut state.pro.write().await;\n    if pro_instances == state.instances {\n        return;\n    }\n    if let Some(submenu) = &state.submenu {\n        let (removed, added) = diff_mut(&state.instances, &mut pro_instances);\n        for p in removed {\n            if let Some(menu_item) = &p.menu_item {\n                _ = submenu.remove(menu_item);\n            }\n        }\n        for p in added {\n            if let Ok(menu_item) = p.new_menu_item(app_handle) {\n                let _ = submenu.append(&menu_item);\n                p.menu_item = Some(menu_item);\n            }\n        }\n    }\n\n    state.instances = pro_instances;\n}\n\nfn diff_mut<'a, T: Identifiable>(old: &'a [T], new: &'a mut [T]) -> (Vec<&'a T>, Vec<&'a mut T>) {\n    let old_ids: HashSet<_> = old.iter().map(|item| item.id()).collect();\n    let new_ids: HashSet<_> = new.iter().map(|item| item.id()).collect();\n\n    let removed: Vec<_> = old\n        .iter()\n        .filter(|ws| !new_ids.contains(&ws.id()))\n        .collect();\n\n    let added: Vec<_> = new\n        .iter_mut()\n        .filter(|ws| !old_ids.contains(&ws.id()))\n        .collect();\n\n    return (removed, added);\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/server.rs",
    "content": "use crate::{ui_messages, util, AppHandle, AppState, daemon};\nuse axum::{\n    body::Body,\n    extract::{\n        connect_info::ConnectInfo,\n        ws::{Message, WebSocket, WebSocketUpgrade},\n        Path, Request, State as AxumState,\n    },\n    http::{HeaderMap, StatusCode},\n    response::{IntoResponse, Response},\n    routing::{any, get, post},\n    Json, Router,\n};\nuse http::Method;\nuse log::{debug, info, warn};\nuse serde::{Deserialize, Serialize};\nuse std::net::SocketAddr;\nuse tauri::Manager;\nuse tower_http::cors::{Any, CorsLayer};\n\n#[derive(Clone)]\nstruct ServerState {\n    app_handle: AppHandle,\n}\n\npub async fn setup(app_handle: &AppHandle) -> anyhow::Result<()> {\n    let state = ServerState {\n        app_handle: app_handle.clone(),\n    };\n\n    let cors = CorsLayer::new()\n        .allow_methods([Method::GET, Method::POST])\n        .allow_headers(Any)\n        .allow_origin(Any);\n\n    let router = Router::new()\n        .route(\"/ws\", get(ws_handler))\n        .route(\"/releases\", get(releases_handler))\n        .route(\"/child-process/signal\", post(signal_handler))\n        .route(\"/daemon/:pro_id/status\", get(daemon_status_handler))\n        .route(\"/daemon/:pro_id/restart\", get(daemon_restart_handler))\n        .route(\"/daemon-proxy/:pro_id/*path\", any(daemon_proxy_handler))\n        .with_state(state)\n        .layer(cors);\n\n    let listener = tokio::net::TcpListener::bind(\"127.0.0.1:25842\").await?;\n    info!(\"Listening on {}\", listener.local_addr()?);\n    return axum::serve(\n        listener,\n        router.into_make_service_with_connect_info::<SocketAddr>(),\n    )\n    .await\n    .map_err(anyhow::Error::from);\n}\n\n#[derive(Debug, Serialize, Deserialize)]\n#[serde(rename_all = \"camelCase\")]\nstruct SendSignalMessage {\n    process_id: i32,\n    signal: i32, // should match nix::sys::signal::Signal\n}\n\nasync fn signal_handler(\n    AxumState(_server): AxumState<ServerState>,\n    Json(payload): Json<SendSignalMessage>,\n) -> impl IntoResponse {\n    info!(\n        \"received request to send signal {} to process {}\",\n        payload.signal,\n        payload.process_id.to_string()\n    );\n    util::kill_process(payload.process_id as u32);\n\n    return StatusCode::OK;\n}\n\nasync fn releases_handler(AxumState(server): AxumState<ServerState>) -> impl IntoResponse {\n    let state = server.app_handle.state::<AppState>();\n    let releases = state.releases.lock().unwrap();\n    let releases = releases.clone();\n\n    Json(releases)\n}\n\nasync fn daemon_status_handler(\n    Path(pro_id): Path<String>,\n    AxumState(server): AxumState<ServerState>,\n) -> impl IntoResponse {\n    return match new_daemon_client(pro_id, server).await {\n        Some(client) => match client.status().await {\n            Ok(status) => Json(status).into_response(),\n            Err(_) => StatusCode::INTERNAL_SERVER_ERROR.into_response(),\n        },\n        None => StatusCode::NOT_FOUND.into_response(),\n    };\n}\n\nasync fn new_daemon_client(\n    pro_id: String,\n    server: ServerState,\n) -> Option<daemon::client::Client> {\n    let state = server.app_handle.state::<AppState>();\n    let pro = state.pro.read().await;\n    return match pro.find_instance(pro_id) {\n        Some(pro_instance) => match pro_instance.daemon() {\n            Some(daemon) => Some(daemon.get_client().clone()),\n            None => None,\n        },\n        None => None,\n    };\n}\n\nasync fn daemon_restart_handler(\n    Path(pro_id): Path<String>,\n    AxumState(server): AxumState<ServerState>,\n) -> impl IntoResponse {\n    let state = server.app_handle.state::<AppState>();\n    let mut pro = state.pro.write().await;\n    info!(\"Attempting to restart daemon\");\n    return match pro.find_instance_mut(pro_id) {\n        Some(pro_instance) => match pro_instance.daemon_mut() {\n            Some(daemon) => {\n                daemon.try_stop().await;\n                return StatusCode::OK.into_response();\n            }\n            None => StatusCode::NOT_FOUND.into_response(),\n        },\n        None => StatusCode::NOT_FOUND.into_response(),\n    };\n}\n\nasync fn daemon_proxy_handler(\n    Path((pro_id, path)): Path<(String, String)>,\n    AxumState(server): AxumState<ServerState>,\n    mut req: Request<Body>,\n) -> impl IntoResponse {\n    return match new_daemon_client(pro_id, server).await {\n        Some(client) => {\n            // strip `daemon-proxy/:pro_id` from path before we hand the request to the daemon\n            let original_query = req.uri().query();\n            let new_path_with_query = match original_query {\n                    Some(query) => format!(\"/{}?{}\", path, query),\n                    None => format!(\"/{}\", path),\n                };\n                let mut parts = req.uri().clone().into_parts();\n                parts.path_and_query = Some(new_path_with_query.parse().expect(\"Invalid path\"));\n                let new_uri = http::Uri::from_parts(parts).expect(\"Failed to build new URI\");\n                *req.uri_mut() = new_uri;\n\n                let original_path = req.uri().path_and_query().expect(\"Invalid path\").to_string();\n                debug!(\"proxying daemon request: {}\", original_path);\n\n                return match client.proxy(req).await {\n                    Ok(res) => res.into_response(),\n                    Err(_) => StatusCode::INTERNAL_SERVER_ERROR.into_response(),\n                };\n            }\n        None => StatusCode::NOT_FOUND.into_response(),\n    };\n}\n\nasync fn ws_handler(\n    ws: WebSocketUpgrade,\n    headers: HeaderMap,\n    ConnectInfo(addr): ConnectInfo<SocketAddr>,\n    AxumState(server): AxumState<ServerState>,\n) -> Response {\n    let app_handle = server.app_handle;\n    let user_agent = if let Some(user_agent) = headers.get(\"user-agent\") {\n        user_agent.to_str().unwrap_or(\"Unknown browser\")\n    } else {\n        \"Unknown browser\"\n    };\n\n    info!(\"`{user_agent}` at {addr} connected.\");\n    ws.on_upgrade(move |socket| handle_socket(socket, addr, app_handle))\n}\n\nasync fn handle_socket(mut socket: WebSocket, who: SocketAddr, app_handle: AppHandle) {\n    while let Some(msg) = socket.recv().await {\n        if let Ok(msg) = msg {\n            match msg {\n                Message::Text(raw_text) => 'text: {\n                    info!(\"Received message: {}\", raw_text);\n                    let json = serde_json::from_str::<ui_messages::SetupProMsg>(raw_text.as_str());\n                    if let Err(err) = json {\n                        warn!(\"Failed to parse json: {}\", err);\n                        // drop message\n                        break 'text;\n                    };\n\n                    let payload = json.unwrap(); // we can safely unwrap here, checked for error earlier\n                    ui_messages::send_ui_message(\n                        app_handle.state::<AppState>(),\n                        ui_messages::UiMessage::SetupPro(payload),\n                        \"failed to send pro setup message from server ws connection\",\n                    )\n                    .await;\n                }\n                Message::Close(_) => {\n                    info!(\"Client at {} disconnected.\", who);\n                    return;\n                }\n                _ => {\n                    info!(\"Received non-text message: {:?}\", msg);\n                }\n            }\n        } else {\n            info!(\"Client at {} disconnected.\", who);\n\n            return;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/settings.rs",
    "content": "#![allow(dead_code)]\n\nuse crate::AppHandle;\nuse log::error;\nuse serde::Serialize;\nuse tauri_plugin_store::StoreExt;\nuse ts_rs::TS;\nuse std::env;\n\nconst SETTINGS_FILE_NAME: &str = \".settings.json\";\n\n#[derive(Debug, Serialize, TS)]\n#[ts(rename_all = \"camelCase\")]\n#[ts(export)]\npub struct Settings {\n    sidebar_position: SidebarPosition,\n    debug_flag: bool,\n    party_parrot: bool,\n    #[serde(rename = \"fixedIDE\")]\n    fixed_ide: bool,\n    zoom: Zoom,\n    transparency: bool,\n    auto_update: bool,\n    additional_cli_flags: String,\n    additional_env_vars: String,\n    dotfiles_url: String,\n    ssh_key_path: String,\n    http_proxy_url: String,\n    https_proxy_url: String,\n    no_proxy: String,\n    #[serde(rename = \"experimental_multiDevcontainer\")]\n    experimental_multi_devcontainer: bool,\n    #[serde(rename = \"experimental_fleet\")]\n    experimental_fleet: bool,\n    #[serde(rename = \"experimental_jupyterNotebooks\")]\n    experimental_jupyter_notebooks: bool,\n    #[serde(rename = \"experimental_vscodeInsiders\")]\n    experimental_vscode_insiders: bool,\n    #[serde(rename = \"experimental_cursor\")]\n    experimental_cursor: bool,\n    #[serde(rename = \"experimental_codium\")]\n    experimental_codium: bool,\n    #[serde(rename = \"experimental_zed\")]\n    experimental_zed: bool,\n    #[serde(rename = \"experimental_positron\")]\n    experimental_positron: bool,\n    #[serde(rename = \"experimental_rstudio\")]\n    experimental_rstudio: bool,\n    #[serde(rename = \"experimental_devPodPro\")]\n    experimental_devpod_pro: bool,\n    #[serde(rename = \"experimental_colorMode\")]\n    experimental_color_mode: ColorMode,\n}\n\n#[derive(Debug, Serialize, TS)]\n#[ts(rename_all = \"camelCase\")]\n#[ts(export)]\nenum SidebarPosition {\n    Left,\n    Right,\n}\n\n#[derive(Debug, Serialize, TS)]\n#[ts(rename_all = \"camelCase\")]\n#[ts(export)]\nenum ColorMode {\n    Dark,\n    Light,\n}\n\n#[derive(Debug, Serialize, TS)]\n#[ts(rename_all = \"camelCase\")]\n#[ts(export)]\nenum Zoom {\n    Sm,\n    Md,\n    Lg,\n    Xl,\n}\n\nimpl Settings {\n    pub fn auto_update_enabled(app_handle: &AppHandle) -> bool {\n        // check something in auto updates\n        let store = app_handle.store(SETTINGS_FILE_NAME);\n        if store.is_err() {\n            error!(\"unable to open store {}\", SETTINGS_FILE_NAME);\n            return false;\n        }\n\n        let mut is_flatpak = false;\n        match env::var(\"FLATPAK_ID\") {\n            Ok(_) => is_flatpak = true,\n            Err(_) => is_flatpak = false,\n        }\n        if is_flatpak {\n            return false\n        }\n\n        store\n            .unwrap()\n            .get(\"autoUpdate\")\n            .and_then(|v| v.as_bool())\n            .unwrap_or(true)\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/system_tray.rs",
    "content": "use crate::{\n    resource_watcher::{ProState, WorkspacesState},\n    ui_messages::{OpenProInstanceMsg, OpenWorkspaceMsg},\n    util, AppHandle, AppState, UiMessage,\n};\nuse log::{error, warn};\nuse tauri::{\n    menu::{Menu, MenuBuilder, MenuEvent, MenuItem, Submenu},\n    tray::{MouseButton, TrayIcon, TrayIconEvent},\n    Manager, Wry,\n};\nuse util::QUIT_EXIT_CODE;\n\n#[cfg(not(target_os = \"macos\"))]\npub static WARNING_SYSTEM_TRAY_ICON_BYTES: &'static [u8] = include_bytes!(\"../icons/icon_warning_system_tray_color.png\");\n#[cfg(target_os = \"macos\")]\npub static WARNING_SYSTEM_TRAY_ICON_BYTES: &'static [u8] = include_bytes!(\"../icons/icon_warning_system_tray.png\");\n\n#[cfg(not(target_os = \"macos\"))]\npub static SYSTEM_TRAY_ICON_BYTES: &'static [u8] = include_bytes!(\"../icons/icon_system_tray_color.png\");\n#[cfg(target_os = \"macos\")]\npub static SYSTEM_TRAY_ICON_BYTES: &'static [u8] = include_bytes!(\"../icons/icon_system_tray.png\");\n\npub trait ToSystemTraySubmenu {\n    fn to_submenu(&self, app_handle: &AppHandle) -> anyhow::Result<Submenu<Wry>>;\n}\n\npub struct SystemTray {}\n\nimpl SystemTray {\n    pub fn new() -> Self {\n        SystemTray {}\n    }\n}\n\nimpl SystemTray {\n    const QUIT_ID: &str = \"quit\";\n    const SHOW_DASHBOARD_ID: &str = \"show_dashboard\";\n}\n\nimpl SystemTray {\n    pub async fn init(&self, app_handle: &AppHandle) -> anyhow::Result<Menu<Wry>> {\n        let mut menu = MenuBuilder::new(app_handle);\n        let show_dashboard = MenuItem::with_id(\n            app_handle,\n            Self::SHOW_DASHBOARD_ID,\n            \"Show Dashboard\",\n            true,\n            None::<&str>,\n        )?;\n        menu = menu.item(&show_dashboard);\n\n        let state = app_handle.state::<AppState>();\n\n        let mut workspaces = state.workspaces.write().await;\n        let submenu = workspaces.to_submenu(app_handle)?;\n        menu = menu.item(&submenu);\n        workspaces.set_submenu(submenu);\n\n        let mut pro = state.pro.write().await;\n        let submenu = pro.to_submenu(app_handle)?;\n        menu = menu.item(&submenu);\n        pro.set_submenu(submenu);\n\n        let quit = MenuItem::with_id(app_handle, Self::QUIT_ID, \"Quit\", true, None::<&str>)?;\n        menu = menu.item(&quit);\n\n        let m = menu.build()?;\n\n        Ok(m)\n    }\n\n    pub fn get_menu_event_handler(&self) -> impl Fn(&AppHandle, MenuEvent) + Send + Sync {\n        |app, event| match event.id.as_ref() {\n            Self::QUIT_ID => app.exit(QUIT_EXIT_CODE),\n            Self::SHOW_DASHBOARD_ID => {\n                let app_state = app.state::<AppState>();\n\n                tauri::async_runtime::block_on(async move {\n                    if let Err(err) = app_state.ui_messages.send(UiMessage::ShowDashboard).await {\n                        error!(\"Failed to broadcast show dashboard message: {}\", err);\n                    };\n                });\n            }\n            id => {\n                let app_state = app.state::<AppState>();\n\n                tauri::async_runtime::block_on(async move {\n                    if let Err(err) = app_state.ui_messages.send(UiMessage::ShowDashboard).await {\n                        error!(\"Failed to broadcast show dashboard message: {}\", err);\n                    };\n                    if id.starts_with(WorkspacesState::IDENTIFIER_PREFIX) {\n                        let tx = &app_state.ui_messages;\n\n                        if id == WorkspacesState::CREATE_WORKSPACE_ID {\n                            if let Err(err) = tx\n                                .send(UiMessage::OpenWorkspace(OpenWorkspaceMsg::empty()))\n                                .await\n                            {\n                                error!(\"Failed to send create workspace message: {:?}\", err);\n                            };\n                        } else {\n                            let workspace_id = id.replace(WorkspacesState::IDENTIFIER_PREFIX, \"\");\n                            if let Err(err) = tx\n                                .send(UiMessage::OpenWorkspace(OpenWorkspaceMsg::with_id(\n                                    workspace_id,\n                                )))\n                                .await\n                            {\n                                error!(\"Failed to send create workspace message: {:?}\", err);\n                            };\n                        }\n                    } else if id.starts_with(ProState::IDENTIFIER_PREFIX) {\n                        let tx = &app_state.ui_messages;\n\n                        let host = id.replace(ProState::IDENTIFIER_PREFIX, \"\");\n                        if let Err(err) = tx\n                            .send(UiMessage::OpenProInstance(OpenProInstanceMsg {\n                                host: Some(host),\n                            }))\n                            .await\n                        {\n                            error!(\"Failed to send open pro instance message: {:?}\", err);\n                        };\n                    } else {\n                        warn!(\"Received unhandled click for ID: {}\", id);\n                    }\n                });\n            }\n        }\n    }\n\n    pub fn get_tray_icon_event_handler(&self) -> impl Fn(&TrayIcon, TrayIconEvent) + Send + Sync {\n        |icon, event| match event {\n            TrayIconEvent::DoubleClick { button, .. } => {\n                if button == MouseButton::Left {\n                    let app_state = icon.app_handle().state::<AppState>();\n\n                    tauri::async_runtime::block_on(async move {\n                        if let Err(err) = app_state.ui_messages.send(UiMessage::ShowDashboard).await\n                        {\n                            error!(\"Failed to broadcast show dashboard message: {}\", err);\n                        };\n                    });\n                }\n            }\n            _ => {}\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/ui_messages.rs",
    "content": "use crate::AppState;\nuse crate::{custom_protocol::ParseError, window::WindowHelper, AppHandle};\nuse log::{error, info, warn};\nuse serde::{de, Deserialize, Serialize};\nuse std::collections::{HashMap, VecDeque};\nuse tauri::{Emitter, Manager, State};\nuse tauri_plugin_notification::NotificationExt;\nuse tokio::sync::mpsc::Receiver;\n\npub async fn send_ui_message(\n    app_state: State<'_, AppState>,\n    msg: UiMessage,\n    log_msg_on_failure: &str,\n) {\n    if let Err(err) = app_state.ui_messages.send(msg).await {\n        error!(\"{}: {:?}, {}\", log_msg_on_failure, err.0, err);\n    };\n}\n\n#[derive(Debug, Clone)]\npub struct UiMessageHelper {\n    app_handle: AppHandle,\n    app_name: String,\n    window_helper: WindowHelper,\n    message_buffer: VecDeque<UiMessage>,\n    is_ready: bool,\n}\n\nimpl UiMessageHelper {\n    pub fn new(app_handle: AppHandle, app_name: String, window_helper: WindowHelper) -> Self {\n        Self {\n            app_handle,\n            app_name,\n            window_helper,\n            message_buffer: VecDeque::new(),\n            is_ready: false,\n        }\n    }\n\n    pub async fn listen(&mut self, mut receiver: Receiver<UiMessage>) {\n        while let Some(ui_msg) = receiver.recv().await {\n            match ui_msg {\n                UiMessage::Ready => {\n                    self.is_ready = true;\n\n                    self.app_handle.get_webview_window(\"main\").map(|w| w.show());\n                    while let Some(msg) = self.message_buffer.pop_front() {\n                        let emit_result = self.app_handle.emit(\"event\", msg);\n                        if let Err(err) = emit_result {\n                            warn!(\"Error sending message: {}\", err);\n                        }\n                    }\n                }\n                UiMessage::ExitRequested => {\n                    self.is_ready = false;\n                }\n                UiMessage::LoginRequired(msg) => {\n                    info!(\"Login required: {} {}\", msg.host, msg.provider);\n\n                    let main_window = self.app_handle.get_webview_window(\"main\");\n                    if !self.is_ready || main_window.is_none() {\n                        // send os notification if we aren't ready to display the main window\n                        let title = \"Login required\".to_string();\n                        let body = format!(\n                            \"You have been logged out. Please log back in to {}\",\n                            msg.host,\n                        );\n                        let _ = self\n                            .app_handle\n                            .notification()\n                            .builder()\n                            .title(title)\n                            .body(body)\n                            .show();\n                        continue;\n                    }\n\n                    // let main window handle\n                    let _ = self.app_handle.emit(\"event\", UiMessage::LoginRequired(msg));\n                }\n                // send all other messages to the UI\n                _ => self.handle_msg(ui_msg),\n            }\n        }\n    }\n\n    fn handle_msg(&mut self, msg: UiMessage) {\n        if self.is_ready {\n            self.app_handle.get_webview_window(\"main\").map(|w| w.show());\n            let _ = self.app_handle.emit(\"event\", msg);\n        } else {\n            // recreate window\n            self.message_buffer.push_back(msg);\n\n            // create a new main window if we can't find it\n            let main_window = self.app_handle.get_webview_window(\"main\");\n            if main_window.is_none() {\n                let _ = self.window_helper.new_main(self.app_name.clone());\n            }\n        }\n    }\n}\n\n#[derive(Debug, Serialize, Clone)]\n#[serde(tag = \"type\")]\n#[allow(dead_code)]\npub enum UiMessage {\n    Ready,\n    ExitRequested,\n    ShowDashboard,\n    ShowToast(ShowToastMsg),\n    OpenWorkspace(OpenWorkspaceMsg),\n    OpenProInstance(OpenProInstanceMsg),\n    SetupPro(SetupProMsg),\n    ImportWorkspace(ImportWorkspaceMsg),\n    CommandFailed(ParseError),\n    LoginRequired(LoginRequiredMsg),\n}\n\n#[derive(Debug, Serialize, Clone)]\npub struct ShowToastMsg {\n    title: String,\n    message: String,\n    status: ToastStatus,\n}\n\nimpl ShowToastMsg {\n    pub fn new(title: String, message: String, status: ToastStatus) -> Self {\n        Self {\n            title,\n            message,\n            status,\n        }\n    }\n}\n\n// WARN: Needs to match the UI's toast status\n#[derive(Debug, Serialize, Clone)]\n#[serde(rename_all = \"lowercase\")]\n#[allow(dead_code)]\npub enum ToastStatus {\n    Success,\n    Error,\n    Warning,\n    Info,\n    Loading,\n}\n\n#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]\n#[serde(deny_unknown_fields)]\npub struct OpenWorkspaceMsg {\n    #[serde(rename(deserialize = \"workspace\"))]\n    pub workspace_id: Option<String>,\n    #[serde(rename(deserialize = \"provider\"))]\n    pub provider_id: Option<String>,\n    pub ide: Option<String>,\n    pub source: Option<String>,\n}\n\n#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]\n#[serde(deny_unknown_fields)]\npub struct OpenProInstanceMsg {\n    pub host: Option<String>,\n}\n\n#[derive(Debug, PartialEq, Serialize, Clone)]\n#[serde(deny_unknown_fields)]\npub struct ImportWorkspaceMsg {\n    pub workspace_id: String,\n    pub workspace_uid: String,\n    pub devpod_pro_host: String,\n    pub project: String,\n    pub options: HashMap<String, String>,\n}\n\nimpl<'de> Deserialize<'de> for ImportWorkspaceMsg {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: serde::Deserializer<'de>,\n    {\n        let mut options = HashMap::deserialize(deserializer)?;\n\n        let workspace_id = options\n            .remove(\"workspace-id\")\n            .ok_or_else(|| de::Error::missing_field(\"workspace-id\"))?;\n\n        let workspace_uid = options\n            .remove(\"workspace-uid\")\n            .ok_or_else(|| de::Error::missing_field(\"workspace-uid\"))?;\n\n        let devpod_pro_host = options\n            .remove(\"devpod-pro-host\")\n            .ok_or_else(|| de::Error::missing_field(\"devpod-pro-host\"))?;\n\n        let project = options\n            .remove(\"project\")\n            .ok_or_else(|| de::Error::missing_field(\"project\"))?;\n\n        Ok(ImportWorkspaceMsg {\n            workspace_id,\n            workspace_uid,\n            devpod_pro_host,\n            project,\n            options,\n        })\n    }\n}\n\n#[derive(Debug, PartialEq, Serialize, Clone)]\n#[serde(deny_unknown_fields)]\npub struct SetupProMsg {\n    pub host: String,\n    #[serde(rename(serialize = \"accessKey\"))]\n    pub access_key: Option<String>,\n    pub options: Option<HashMap<String, String>>,\n}\n\nimpl<'de> Deserialize<'de> for SetupProMsg {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: serde::Deserializer<'de>,\n    {\n        let mut all_fields = HashMap::<String, String>::deserialize(deserializer)?;\n\n        let host = all_fields\n            .remove(\"host\")\n            .ok_or_else(|| de::Error::missing_field(\"host\"))?;\n\n        let mut access_key = all_fields.remove(\"access_key\");\n        if access_key.is_none() {\n            access_key = all_fields.remove(\"accessKey\");\n        }\n\n        // Options are urlencoded\n        let options = all_fields.remove(\"options\");\n        if let Some(options) = options {\n            let options =\n                serde_urlencoded::from_str::<Vec<(String, String)>>(&options).map_err(|err| {\n                    de::Error::custom(format!(\"Failed to url decode options: {}\", err))\n                })?;\n            let options =\n                serde_json::from_str::<HashMap<String, String>>(&options[0].0).map_err(|err| {\n                    de::Error::custom(format!(\"Failed to json parse options: {}\", err))\n                })?;\n\n            Ok(SetupProMsg {\n                host,\n                access_key,\n                options: Some(options),\n            })\n        } else {\n            Ok(SetupProMsg {\n                host,\n                access_key,\n                options: None,\n            })\n        }\n    }\n}\n\nimpl OpenWorkspaceMsg {\n    pub fn empty() -> OpenWorkspaceMsg {\n        OpenWorkspaceMsg {\n            workspace_id: None,\n            provider_id: None,\n            ide: None,\n            source: None,\n        }\n    }\n    pub fn with_id(id: String) -> OpenWorkspaceMsg {\n        OpenWorkspaceMsg {\n            workspace_id: Some(id),\n            provider_id: None,\n            ide: None,\n            source: None,\n        }\n    }\n}\n\n#[derive(Debug, PartialEq, Serialize, Clone)]\n#[serde(deny_unknown_fields)]\npub struct LoginRequiredMsg {\n    pub host: String,\n    pub provider: String,\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/ui_ready.rs",
    "content": "use crate::{commands::DevpodCommandError, AppState, UiMessage};\nuse log::error;\n\n// This command is expected to be invoked exactly once per window\n#[tauri::command]\npub async fn ui_ready(state: tauri::State<'_, AppState>) -> Result<(), DevpodCommandError> {\n    if let Err(err) = state.ui_messages.send(UiMessage::Ready).await {\n        error!(\"Failed to broadcast UI ready message: {:?}\", err);\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/updates.rs",
    "content": "use crate::{settings::Settings, window::WindowHelper, AppHandle, AppState};\nuse anyhow::Context;\nuse chrono::{DateTime, Utc};\nuse lazy_static::lazy_static;\nuse log::{debug, error, info, warn};\nuse regex::Regex;\nuse reqwest::{Client, Method};\nuse serde::{Deserialize, Serialize};\nuse std::collections::HashMap;\nuse tauri::Manager;\nuse tauri_plugin_notification::NotificationExt;\nuse tauri_plugin_updater::UpdaterExt;\nuse thiserror::Error;\nuse tokio::fs::File;\nuse ts_rs::TS;\n\nconst UPDATE_POLL_INTERVAL: std::time::Duration = std::time::Duration::from_secs(60 * 10);\nconst RELEASES_URL: &str = \"https://update-server.devpod.sh/releases\";\nconst FALLBACK_RELEASES_URL: &str = \"https://api.github.com/repos/loft-sh/devpod/releases\";\n\n#[derive(Error, Debug)]\npub enum UpdateError {\n    #[error(\"unable to get latest release {0}\")]\n    NoReleaseFound(String),\n    #[error(\"failed to check for updates {0}\")]\n    CheckUpdate(#[from] tauri_plugin_updater::Error),\n    #[error(\"failed to fetch releases {0}\")]\n    FetchRelease(#[from] anyhow::Error),\n}\nimpl serde::Serialize for UpdateError {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: serde::Serializer,\n    {\n        serializer.serialize_str(self.to_string().as_ref())\n    }\n}\n\npub type Releases = Vec<Release>;\n\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]\n#[serde(rename_all = \"snake_case\")]\n#[ts(export)]\npub struct Release {\n    #[ts(type = \"String\")]\n    pub url: String,\n    pub html_url: String,\n    pub assets_url: String,\n    pub upload_url: String,\n    pub tarball_url: Option<String>,\n    pub zipball_url: Option<String>,\n    pub id: u64,\n    pub node_id: String,\n    pub tag_name: String,\n    pub target_commitish: String,\n    pub name: Option<String>,\n    pub body: Option<String>,\n    pub draft: bool,\n    pub prerelease: bool,\n    pub created_at: Option<DateTime<Utc>>,\n    pub published_at: Option<DateTime<Utc>>,\n    pub author: Author,\n    pub assets: Vec<Asset>,\n}\nimpl Release {\n    pub fn is_pre(&self) -> bool {\n        lazy_static! {\n            static ref PRE_REGEX: Regex = Regex::new(r\"^.*-(alpha|beta).\\d*$\").unwrap();\n        }\n        PRE_REGEX.is_match(&self.tag_name)\n    }\n\n    pub fn trim_pre(&self) -> String {\n        lazy_static! {\n            static ref PRE_REPL_REGEX: Regex = Regex::new(r\"-(alpha|beta).\\d*\").unwrap();\n        }\n        PRE_REPL_REGEX.replace_all(&self.tag_name, \"\").to_string()\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]\n#[serde(rename_all = \"snake_case\")]\n#[ts(export)]\n#[non_exhaustive]\npub struct Asset {\n    pub url: String,\n    pub browser_download_url: String,\n    pub id: u64,\n    pub node_id: String,\n    pub name: String,\n    pub label: Option<String>,\n    pub state: String,\n    pub content_type: String,\n    pub size: i64,\n    pub download_count: i64,\n    pub created_at: DateTime<Utc>,\n    pub updated_at: DateTime<Utc>,\n}\n\n#[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, TS)]\n#[serde(rename_all = \"snake_case\")]\n#[ts(export)]\n#[non_exhaustive]\npub struct Author {\n    pub login: String,\n    pub id: u64,\n    pub node_id: String,\n    #[ts(type = \"String\")]\n    pub avatar_url: String,\n    pub gravatar_id: String,\n    pub url: String,\n    pub html_url: String,\n    pub followers_url: String,\n    pub following_url: String,\n    pub gists_url: String,\n    pub starred_url: String,\n    pub subscriptions_url: String,\n    pub organizations_url: String,\n    pub repos_url: String,\n    pub events_url: String,\n    pub received_events_url: String,\n    pub r#type: String,\n    pub site_admin: bool,\n}\n\n#[tauri::command]\npub async fn get_pending_update(state: tauri::State<'_, AppState>) -> Result<Release, ()> {\n    let release = state.pending_update.lock().unwrap();\n    release.clone().ok_or(())\n}\n\n#[tauri::command]\npub async fn check_updates(app_handle: AppHandle) -> Result<bool, UpdateError> {\n    let updater = app_handle\n        .updater()\n        .map_err(|e| UpdateError::CheckUpdate(e))?;\n    match updater.check().await {\n        Ok(update) => {\n            let update_available = update.is_some();\n            info!(\"Update check completed, result: {}\", update_available);\n\n            return Ok(update_available);\n        }\n        Err(e) => {\n            error!(\"Failed to get update: {}\", e);\n\n            return Err(UpdateError::CheckUpdate(e));\n        }\n    }\n}\n\n#[derive(Clone, Debug)]\npub struct UpdateHelper<'a> {\n    app_handle: &'a AppHandle,\n}\n\nimpl<'a> UpdateHelper<'a> {\n    pub fn new(app_handle: &'a AppHandle) -> Self {\n        Self {\n            app_handle: &app_handle,\n        }\n    }\n\n    pub async fn poll(&self) {\n        #[cfg(debug_assertions)] // disable during development\n        {\n            return;\n        }\n\n        loop {\n            // check if we have updated the app recently\n            // if so, show changelog in app\n\n            let app_handle = self.app_handle.clone();\n            let updater = app_handle.updater();\n            if updater.is_err() {\n                error!(\"Failed to get updater\");\n\n                continue;\n            }\n            info!(\"Attempting to check update\");\n            if let Ok(update) = updater.unwrap().check().await {\n                match update {\n                    Some(..) => info!(\"update available\"),\n                    None => info!(\"no update available\"),\n                };\n\n                if let Some(update) = update {\n                    let state = self.app_handle.state::<AppState>();\n                    let update_installed_state = *state.update_installed.lock().unwrap();\n                    // prevent ourselves from installing the same update multiple times\n                    if update_installed_state {\n                        return;\n                    }\n\n                    let new_version = update.version.as_str();\n                    let update_helper = UpdateHelper::new(&self.app_handle);\n                    if let Err(e) = update_helper.update_app_releases(new_version).await {\n                        error!(\"Failed to update app releases: {}\", e);\n                    }\n\n                    if Settings::auto_update_enabled(&self.app_handle) {\n                        let on_chunk = |_, _| {};\n                        let on_download_fininshed = || {\n                            info!(\"Download for version {} finished\", new_version);\n                        };\n                        info!(\n                            \"Update available, current: {}, new: {}\",\n                            update.current_version, new_version,\n                        );\n                        info!(\"Starting to download\");\n                        if let Err(err) = update\n                            .download_and_install(on_chunk, on_download_fininshed)\n                            .await\n                        {\n                            error!(\"Failed to download and install update: {}\", err);\n                        }\n\n                        let window_helper = WindowHelper::new(self.app_handle.clone());\n                        let _ = window_helper.new_update_ready_window();\n\n                        let state = self.app_handle.state::<AppState>();\n                        let mut pending_update_state = state.pending_update.lock().unwrap();\n                        *pending_update_state = None;\n\n                        let mut update_installed_state = state.update_installed.lock().unwrap();\n                        *update_installed_state = true;\n                    } else {\n                        match self.update_app_releases(new_version).await {\n                            Ok(release) => {\n                                if let Err(err) = self.notify_update_available(&release).await {\n                                    warn!(\"Failed to send update notification: {}\", err);\n                                }\n\n                                // display update available in the UI\n                                let state = self.app_handle.state::<AppState>();\n                                let mut pending_update_state = state.pending_update.lock().unwrap();\n                                *pending_update_state = Some(release);\n                            }\n                            Err(e) => {\n                                error!(\"Failed to update app releases: {}\", e);\n                            }\n                        }\n                    }\n                }\n            }\n            tokio::time::sleep(UPDATE_POLL_INTERVAL).await;\n        }\n    }\n\n    pub async fn update_app_releases(&self, new_version: &str) -> Result<Release, UpdateError> {\n        let releases = self\n            .fetch_releases()\n            .await\n            .map_err(UpdateError::FetchRelease)?;\n        let state = self.app_handle.state::<AppState>();\n        let mut releases_state = state.releases.lock().unwrap();\n        *releases_state = releases;\n\n        Ok(releases_state\n            .iter()\n            .find(|r| r.tag_name.contains(new_version))\n            .ok_or(UpdateError::NoReleaseFound(\n                \"No releases found in releases state\".to_string(),\n            ))?\n            .clone())\n    }\n\n    pub async fn fetch_releases_from_url(&self, url: &str) -> anyhow::Result<Vec<Release>> {\n        let client = Client::builder().user_agent(\"loft-sh/devpod\").build()?;\n\n        let response = client\n            .request(Method::GET, url)\n            .header(\"Accept\", \"application/vnd.github+json\")\n            .header(\"X-GitHub-Api-Version\", \"2022-11-28\")\n            .send()\n            .await\n            .with_context(|| format!(\"Fetch releases from {}\", url))?;\n\n        if !response.status().is_success() {\n            return Err(anyhow::anyhow!(\n                \"Status code {} from {}\",\n                response.status(),\n                url\n            ));\n        }\n\n        let releases = response\n            .json::<Vec<Release>>()\n            .await\n            .with_context(|| format!(\"Parse JSON from {}\", url))?;\n\n        Ok(releases)\n    }\n\n    pub async fn fetch_releases(&self) -> anyhow::Result<Releases> {\n        debug!(\"Querying releases from update server: {}\", RELEASES_URL);\n        let releases = match self.fetch_releases_from_url(RELEASES_URL).await {\n            Ok(releases) => releases,\n            Err(_) => {\n                debug!(\"Query from main update server failed. Querying from fallback URL: {}\", FALLBACK_RELEASES_URL);\n                match self.fetch_releases_from_url(FALLBACK_RELEASES_URL).await {\n                    Ok(releases) => releases,\n                    Err(e2) => {\n                        return Err(e2).context(\"No endpoint delivered updates.\");\n                    }\n                }\n            }\n        };\n\n        let releases = &releases\n            .into_iter()\n            .filter(|release| !release.draft)\n            .map(|release| (release.tag_name.clone(), release))\n            .collect::<HashMap<String, Release>>();\n\n        let mut releases = releases\n            .into_iter()\n            .filter_map(|(_, release)| {\n                if release.prerelease || release.is_pre() {\n                    let stable_tag_name = release.trim_pre();\n                    if releases.get(&stable_tag_name).is_some() {\n                        return None;\n                    }\n                }\n\n                Some(release.clone())\n            })\n            .collect::<Vec<Release>>();\n        releases.sort_by(|a, b| b.tag_name.cmp(&a.tag_name));\n\n        Ok(releases)\n    }\n\n    async fn notify_update_available(&self, release: &Release) -> anyhow::Result<()> {\n        if let Ok(mut target) = self.app_handle.path().app_cache_dir() {\n            target.push(format!(\"update_{}\", release.tag_name.clone()));\n\n            if target.exists() {\n                return Ok(());\n            }\n            let _ = File::create(target).await?;\n        }\n\n        let builder = self.app_handle.notification().builder();\n        _ = builder\n            .title(\"Update available\")\n            .body(&format!(\"Version {} is available\", release.tag_name))\n            .show()?;\n\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/util.rs",
    "content": "use log::{debug, error, info};\nuse std::time::{Duration, Instant};\n\n// Exit code for the window to signal that the application was quit by the user through the system tray\n// and event handlers may not use prevent_exit().\npub const QUIT_EXIT_CODE: i32 = 1337;\n\n/// `measure`  the duration it took a function to execute.\n#[allow(dead_code)]\npub fn measure<F>(f: F) -> Duration\nwhere\n    F: Fn(),\n{\n    let start = Instant::now();\n    f();\n\n    start.elapsed()\n}\n\n/// Kills all child processes of a pid on windows, does nothing on all the other OSs.\npub fn kill_child_processes(parent_pid: u32) {\n    #[cfg(windows)]\n    {\n        use windows::Win32::Foundation::*;\n        use windows::Win32::System::Diagnostics::ToolHelp::*;\n        use windows::Win32::System::Threading::*;\n\n        info!(\"Trying to kill child processes of PID {}.\", parent_pid);\n\n        let snapshot: HANDLE = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0).unwrap() };\n\n        if snapshot.is_invalid() {\n            info!(\"Failed to take process snapshot.\");\n            return;\n        }\n\n        info!(\"Obtained process snapshot.\");\n\n        let mut process_entry: PROCESSENTRY32 = unsafe { std::mem::zeroed() };\n        process_entry.dwSize = std::mem::size_of::<PROCESSENTRY32>() as u32;\n\n        unsafe {\n            if Process32First(snapshot, &mut process_entry).as_bool() {\n                loop {\n                    // Check if the process we're looking at is a *direct* child process.\n                    if process_entry.th32ParentProcessID == parent_pid {\n                        let pid = process_entry.th32ProcessID;\n\n                        // Extract zero-terminated string for the executable.\n                        let exe_name = process_entry\n                            .szExeFile\n                            .iter()\n                            .take_while(|&&ch| ch != 0)\n                            .map(|&ch| ch as u8 as char)\n                            .collect::<String>();\n\n                        info!(\n                            \"Found process with PID {} as child of PID {} ({}).\",\n                            pid, parent_pid, exe_name,\n                        );\n\n                        // Special exception: We do not clean up tauri's webviews. For now.\n                        if exe_name == \"msedgewebview2.exe\" {\n                            info!(\"Ignoring process PID {}.\", pid);\n                        } else {\n                            // Recursively terminate children of children.\n                            kill_child_processes(pid);\n\n                            // Obtain handle for the child process.\n                            let child_process_handle: windows::core::Result<HANDLE> =\n                                OpenProcess(PROCESS_TERMINATE, false, pid);\n\n                            if child_process_handle.is_err() {\n                                error!(\n                                    \"Unable to open process {}: {:?}\",\n                                    pid,\n                                    child_process_handle.unwrap_err()\n                                );\n                            } else {\n                                let child_process_handle: HANDLE = child_process_handle.unwrap();\n\n                                // Attempt to terminate the child process.\n                                let close_result = TerminateProcess(child_process_handle, 1);\n\n                                // Clean up the handle.\n                                CloseHandle(child_process_handle);\n\n                                if !close_result.as_bool() {\n                                    error!(\"Unable to terminate process {}\", pid);\n                                } else {\n                                    info!(\"Terminated process {}.\", pid);\n                                }\n                            }\n                        }\n                    }\n\n                    // Obtain next process or end the loop if there is none available.\n                    if !Process32Next(snapshot, &mut process_entry).as_bool() {\n                        break;\n                    }\n                }\n            }\n\n            // Clean up the snapshot.\n            CloseHandle(snapshot);\n        }\n    }\n}\n\npub fn kill_process(pid: u32) {\n    #[cfg(not(windows))]\n    {\n        use nix::sys::signal::{self, Signal};\n        use nix::unistd::Pid;\n        let pid = Pid::from_raw(pid as i32);\n        let signal = Signal::SIGINT;\n        match signal::kill(pid, signal) {\n            Ok(_) => debug!(\"Successfully killed process {}\", pid),\n            Err(err) => {\n                error!(\"Failed to kill process: {}\", err);\n                return;\n            }\n        };\n        return;\n    }\n\n    #[cfg(windows)]\n    {\n        use crate::util::kill_child_processes;\n        use windows::Win32::Foundation::{CloseHandle, HANDLE};\n        use windows::Win32::System::Threading::{OpenProcess, TerminateProcess, PROCESS_TERMINATE};\n\n        // kill_child_processes(pid);\n\n        unsafe {\n            let handle: windows::core::Result<HANDLE> =\n                OpenProcess(PROCESS_TERMINATE, false, pid);\n            if handle.is_err() {\n                error!(\"unable to open process {}: {:?}\", pid, handle.unwrap_err());\n                return;\n            }\n            let handle: HANDLE = handle.unwrap();\n\n            let result = TerminateProcess(handle, 1);\n            CloseHandle(handle);\n            if !result.as_bool() {\n                error!(\"unable to terminate process {}\", pid);\n                return\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src-tauri/src/window.rs",
    "content": "use crate::AppHandle;\nuse anyhow::{Context, Result};\nuse log::error;\nuse tauri::{WebviewWindow, WebviewWindowBuilder, Wry, WebviewUrl};\n\n#[derive(Clone, Debug)]\npub struct WindowHelper {\n    app_handle: AppHandle,\n}\n\nimpl WindowHelper {\n    pub fn new(app_handle: AppHandle) -> Self {\n        Self { app_handle }\n    }\n\n    pub fn setup(&self, window: &WebviewWindow<Wry>) {\n        // open browser devtools automatically during development\n        #[cfg(debug_assertions)]\n        {\n            window.open_devtools();\n        }\n\n        // Window vibrancy\n        #[cfg(target_os = \"macos\")]\n        {\n            window_vibrancy::apply_vibrancy(\n                window,\n                window_vibrancy::NSVisualEffectMaterial::Sidebar,\n                None,\n                None,\n            )\n            .expect(\"Unsupported platform! 'apply_vibrancy' is only supported on macOS\");\n        }\n    }\n\n    pub fn new_main(&self, app_name: String) -> Result<()> {\n        let handle = self.app_handle.clone();\n        let self_ = self.clone();\n\n        #[cfg(target_os = \"macos\")]\n        self.set_dock_icon_visibility(true);\n\n        self.app_handle\n            .run_on_main_thread(move || {\n                // Config should match the config in `src-tauri/tauri.conf.json` for a consistent window appearance\n                let window_builder =\n                    WebviewWindowBuilder::new(&handle, \"main\".to_string(), WebviewUrl::default())\n                        .title(app_name)\n                        .fullscreen(false)\n                        .resizable(true)\n                        .transparent(true)\n                        .min_inner_size(1000.0, 700.0)\n                        .inner_size(1200.0, 800.0)\n                        .visible(false);\n\n                #[cfg(target_os = \"macos\")]\n                let window_builder = window_builder\n                    .title_bar_style(tauri::TitleBarStyle::Overlay)\n                    .hidden_title(true);\n\n                let window = window_builder.build();\n\n                if let Ok(window) = window {\n                    self_.setup(&window);\n                }\n            })\n            .context(\"Failed to create main window\")\n    }\n\n    pub fn new_update_ready_window(&self) -> Result<()> {\n        let handle = self.app_handle.clone();\n\n        self.app_handle\n            .run_on_main_thread(move || {\n                let window_builder = WebviewWindowBuilder::new(\n                    &handle,\n                    \"update_ready\".to_string(),\n                    WebviewUrl::App(\"update-window/index.html\".into()),\n                )\n                .title(\"DevPod Update\")\n                .fullscreen(false)\n                .resizable(false)\n                .transparent(false)\n                .inner_size(300.0, 175.0)\n                .visible(true);\n\n                if let Err(err) = window_builder.build() {\n                    error!(\"Failed to create update ready window: {}\", err);\n                }\n            })\n            .context(\"Failed to create update ready window\")\n    }\n}\n\n#[cfg(target_os = \"macos\")]\nuse cocoa::{\n    appkit::{\n        NSApp, NSApplicationActivateIgnoringOtherApps,\n        NSApplicationActivationPolicy::{self, *},\n        NSImage,\n    },\n    base::{id, nil, BOOL},\n    foundation::{NSArray, NSData, NSString},\n};\n#[cfg(target_os = \"macos\")]\nuse dispatch::Queue;\n#[cfg(target_os = \"macos\")]\nuse std::time::Duration;\n#[cfg(target_os = \"macos\")]\nuse tauri::ActivationPolicy;\n\n#[cfg(target_os = \"macos\")]\n#[allow(dead_code)]\nimpl WindowHelper {\n    unsafe fn get_current_application() -> cocoa::base::id {\n        msg_send![class!(NSRunningApplication), currentApplication]\n    }\n\n    unsafe fn is_current_app_active() -> bool {\n        let current_app = Self::get_current_application();\n        #[cfg(not(target_arch = \"aarch64\"))]\n        {\n            let is_active: BOOL = msg_send![current_app, isActive];\n\n            return is_active == cocoa::base::YES;\n        }\n\n        #[cfg(target_arch = \"aarch64\")]\n        {\n            let is_active: BOOL = msg_send![current_app, isActive];\n\n            return is_active;\n        }\n    }\n\n    pub fn set_dock_icon_visibility(&self, visible: bool) {\n        unsafe {\n            let psn = ProcessSerialNumber {\n                lowLongOfPSN: K_CURRENT_PROCESS,\n                highLongOfPSN: 0,\n            };\n\n            if !visible {\n                let result = TransformProcessType(\n                    &psn as *const ProcessSerialNumber,\n                    TransformState::ProcessTransformToUIElementApplication,\n                );\n                if result != 0 {\n                    error!(\"Failed to set dock icon visibility: {}\", result);\n                }\n                return;\n            }\n\n            let is_active = Self::is_current_app_active();\n            if is_active {\n                let application_id = NSString::alloc(nil).init_str(\"com.apple.dock\");\n                let running_applications: id = msg_send![\n                    class!(NSRunningApplication),\n                    runningApplicationsWithBundleIdentifier: application_id\n                ];\n                for i in 0..NSArray::count(running_applications) {\n                    let app: id = msg_send![running_applications, objectAtIndex: i];\n                    let _: () = msg_send![\n                        app,\n                        activateWithOptions: NSApplicationActivateIgnoringOtherApps\n                    ];\n                    break;\n                }\n\n                Queue::main().exec_after(Duration::from_millis(1), move || {\n                    let result = TransformProcessType(\n                        &psn as *const ProcessSerialNumber,\n                        TransformState::ProcessTransformToForegroundApplication,\n                    );\n                    if result != 0 {\n                        error!(\"Failed to set dock icon visibility: {}\", result);\n                    }\n\n                    Queue::main().exec_after(Duration::from_millis(1), move || {\n                        let _: () = msg_send![\n                            Self::get_current_application(),\n                            activateWithOptions: NSApplicationActivateIgnoringOtherApps\n                        ];\n                    });\n                });\n            } else {\n                let result = TransformProcessType(\n                    &psn as *const ProcessSerialNumber,\n                    TransformState::ProcessTransformToForegroundApplication,\n                );\n            }\n            self.set_default_app_icon();\n        }\n    }\n\n    fn set_default_app_icon(&self) {\n        let _ = self.app_handle.run_on_main_thread(move || unsafe {\n            let app: id = msg_send![class!(NSApplication), sharedApplication];\n            let icon = include_bytes!(\"../icons/icon.icns\");\n            let data = NSData::dataWithBytes_length_(\n                nil,\n                icon.as_ptr() as *const std::os::raw::c_void,\n                icon.len() as u64,\n            );\n            let app_icon = NSImage::initWithData_(NSImage::alloc(nil), data);\n\n            let res: () = msg_send![app, setApplicationIconImage: app_icon];\n        });\n    }\n\n    // May work at some point, will keep function here for now\n    fn set_activation_policy(act_pol: ActivationPolicy) {\n        let act_pol = match act_pol {\n            ActivationPolicy::Regular => NSApplicationActivationPolicyRegular,\n            ActivationPolicy::Accessory => NSApplicationActivationPolicyAccessory,\n            ActivationPolicy::Prohibited => NSApplicationActivationPolicyProhibited,\n            _ => unimplemented!(),\n        };\n\n        unsafe {\n            let ns_app = NSApp();\n            let res: BOOL = msg_send![ns_app, setActivationPolicy: act_pol];\n        }\n    }\n\n    // May work at some point, will keep function here for now\n    pub fn get_activation_policy() -> ActivationPolicy {\n        unsafe {\n            let ns_app = NSApp();\n            let res: NSApplicationActivationPolicy = msg_send![ns_app, activationPolicy];\n            match res {\n                NSApplicationActivationPolicyRegular => ActivationPolicy::Regular,\n                NSApplicationActivationPolicyAccessory => ActivationPolicy::Accessory,\n                NSApplicationActivationPolicyProhibited => ActivationPolicy::Prohibited,\n                _ => unimplemented!(),\n            }\n        }\n    }\n}\n#[cfg(target_os = \"macos\")]\n#[repr(u32)]\nenum TransformState {\n    // https://developer.apple.com/documentation/applicationservices/1501117-anonymous/kprocesstransformtoforegroundapplication?language=objc\n    ProcessTransformToForegroundApplication = 1,\n    // https://developer.apple.com/documentation/applicationservices/1501117-anonymous/kprocesstransformtouielementapplication?language=objc\n    ProcessTransformToUIElementApplication = 4,\n}\n\n#[cfg(target_os = \"macos\")]\nconst K_CURRENT_PROCESS: u32 = 2;\n\n#[cfg(target_os = \"macos\")]\n#[allow(non_snake_case)]\n#[repr(C)]\n#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]\npub struct ProcessSerialNumber {\n    pub highLongOfPSN: u32,\n    pub lowLongOfPSN: u32,\n}\n\n#[cfg(target_os = \"macos\")]\n#[link(name = \"ApplicationServices\", kind = \"framework\")]\nextern \"C\" {\n    fn TransformProcessType(psn: *const ProcessSerialNumber, transformState: TransformState)\n        -> i32;\n}\n"
  },
  {
    "path": "desktop/src-tauri/tauri-dev-linux.conf.json",
    "content": "{\n  \"app\": {\n    \"windows\": [\n      {\n        \"title\": \"DevPod\",\n        \"width\": 1200,\n        \"height\": 800,\n        \"minWidth\": 1000,\n        \"minHeight\": 700,\n        \"x\": 0,\n        \"y\": 0,\n        \"focus\": false,\n        \"titleBarStyle\": \"Overlay\",\n        \"fullscreen\": false,\n        \"resizable\": true,\n        \"hiddenTitle\": true\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "desktop/src-tauri/tauri-dev.conf.json",
    "content": "{\n  \"identifier\": \"sh.loft.devpod.for.devpod.devs\",\n  \"plugins\": {\n    \"updater\": {\n      \"active\": false\n    }\n  }\n}\n"
  },
  {
    "path": "desktop/src-tauri/tauri-flatpak.conf.json",
    "content": "{\n  \"plugins\": {\n    \"updater\": {\n      \"active\": false\n    }\n  },\n  \"app\": {\n    \"windows\": [\n      {\n        \"title\": \"DevPod\",\n        \"width\": 1200,\n        \"height\": 800,\n        \"minWidth\": 1000,\n        \"minHeight\": 700,\n        \"x\": 0,\n        \"y\": 0,\n        \"focus\": false,\n        \"titleBarStyle\": \"Overlay\",\n        \"fullscreen\": false,\n        \"resizable\": true,\n        \"hiddenTitle\": true\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "desktop/src-tauri/tauri.conf.json",
    "content": "{\n  \"build\": {\n    \"beforeDevCommand\": \"yarn dev\",\n    \"beforeBuildCommand\": \"yarn build\",\n    \"frontendDist\": \"../dist\",\n    \"devUrl\": \"http://localhost:1420\"\n  },\n  \"bundle\": {\n    \"active\": true,\n    \"windows\": {\n      \"certificateThumbprint\": null,\n      \"digestAlgorithm\": \"sha256\",\n      \"timestampUrl\": \"\",\n      \"nsis\": {\n        \"displayLanguageSelector\": false,\n        \"installMode\": \"currentUser\"\n      },\n      \"signCommand\": \".\\\\sign.bat %1\"\n    },\n    \"category\": \"DeveloperTool\",\n    \"copyright\": \"\",\n    \"externalBin\": [\n      \"bin/devpod-cli\"\n    ],\n    \"resources\": [],\n    \"icon\": [\n      \"icons/32x32.png\",\n      \"icons/128x128.png\",\n      \"icons/128x128@2x.png\",\n      \"icons/icon.icns\",\n      \"icons/icon.ico\"\n    ],\n    \"shortDescription\": \"Spin up dev environments in any infra\",\n    \"longDescription\": \"Dev-environments-as-code like Terraform but for dev environments. Like Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just on localhost docker.\",\n    \"targets\": \"all\",\n    \"macOS\": {\n      \"entitlements\": \"./entitlements.plist\",\n      \"exceptionDomain\": \"\",\n      \"frameworks\": [],\n      \"providerShortName\": null,\n      \"signingIdentity\": null,\n      \"dmg\": {\n        \"background\": \"dmg-background.png\",\n        \"windowSize\": {\n          \"width\": 660,\n          \"height\": 400\n        },\n        \"appPosition\": {\n          \"x\": 180,\n          \"y\": 160\n        },\n        \"applicationFolderPosition\": {\n          \"x\": 480,\n          \"y\": 160\n        }\n      }\n    },\n    \"linux\": {\n      \"deb\": {\n        \"depends\": []\n      }\n    },\n    \"createUpdaterArtifacts\": \"v1Compatible\"\n  },\n  \"productName\": \"DevPod\",\n  \"mainBinaryName\": \"DevPod Desktop\",\n  \"version\": \"../package.json\",\n  \"identifier\": \"sh.loft.devpod\",\n  \"plugins\": {\n    \"updater\": {\n      \"pubkey\": \"dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEY1NDg1NDE4MzA1NDI3QjcKUldTM0oxUXdHRlJJOVhyNUtFc2xkNFZyTmE2R2w0dTRXTFF6OUVMSW03ekphejlPM3U1M2FHUCsK\",\n      \"windows\": {\n        \"installMode\": \"passive\"\n      },\n      \"endpoints\": [\n        \"https://update-server.devpod.sh/latest\",\n        \"https://github.com/loft-sh/devpod/releases/latest/download/latest.json\"\n      ]\n    }\n  },\n  \"app\": {\n    \"withGlobalTauri\": false,\n    \"macOSPrivateApi\": true,\n    \"security\": {\n      \"csp\": null\n    },\n    \"windows\": [\n      {\n        \"title\": \"DevPod\",\n        \"width\": 1200,\n        \"height\": 800,\n        \"minWidth\": 1000,\n        \"minHeight\": 700,\n        \"x\": 0,\n        \"y\": 0,\n        \"focus\": false,\n        \"titleBarStyle\": \"Overlay\",\n        \"fullscreen\": false,\n        \"resizable\": true,\n        \"hiddenTitle\": true,\n        \"transparent\": true,\n        \"visible\": false\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "desktop/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ESNext\",\n    \"useDefineForClassFields\": true,\n    \"lib\": [\"DOM\", \"DOM.Iterable\", \"ESNext\"],\n    \"allowJs\": false,\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": false,\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"noImplicitAny\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Node\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react-jsx\",\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"src/*\"]\n    }\n  },\n  \"include\": [\"src\", \"./eslint.config.js\", \"update-window\", \"vite.config.ts\"],\n  \"references\": [\n    {\n      \"path\": \"tsconfig.node.json\"\n    }\n  ]\n}\n"
  },
  {
    "path": "desktop/tsconfig.node.json",
    "content": "{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Node\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.ts\", \"eslint.config.js\"]\n}\n"
  },
  {
    "path": "desktop/update-window/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Update DevPod</title>\n  </head>\n\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/update-window/src/main.tsx\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "desktop/update-window/src/main.tsx",
    "content": "import { StrictMode } from \"react\"\nimport ReactDOM from \"react-dom/client\"\nimport { ThemeProvider } from \"@/Theme\"\nimport { SettingsProvider } from \"@/contexts\"\nimport { Button, ButtonGroup, Grid, Heading, Text } from \"@chakra-ui/react\"\nimport { client } from \"@/client\"\n\nReactDOM.createRoot(document.getElementById(\"root\") as HTMLElement).render(<Root />)\n\nfunction handleLaterClicked() {\n  client.closeCurrentWindow()\n}\n\nfunction handleRestartClicked() {\n  client.restart()\n}\n\nfunction Root() {\n  return (\n    <StrictMode>\n      <SettingsProvider>\n        <ThemeProvider>\n          <Grid width=\"100vw\" height=\"100vh\" placeContent=\"center\" padding=\"4\">\n            <Heading size=\"md\">Installed Update</Heading>\n            <Text fontSize=\"md\">Restart the application for the changes to take effect</Text>\n\n            <ButtonGroup justifyContent={\"end\"} marginTop=\"4\">\n              <Button variant=\"ghost\" onClick={handleLaterClicked}>\n                Not now\n              </Button>\n              <Button variant=\"primary\" onClick={handleRestartClicked}>\n                Restart\n              </Button>\n            </ButtonGroup>\n          </Grid>\n        </ThemeProvider>\n      </SettingsProvider>\n    </StrictMode>\n  )\n}\n"
  },
  {
    "path": "desktop/vite.config.ts",
    "content": "import react from \"@vitejs/plugin-react\"\nimport { resolve } from \"node:path\"\nimport { defineConfig } from \"vite\"\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [react()],\n  resolve: {\n    alias: {\n      \"@\": resolve(__dirname, \"./src\"),\n    },\n  },\n\n  // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`\n  // prevent vite from obscuring rust errors\n  clearScreen: false,\n  // tauri expects a fixed port, fail if that port is not available\n  server: {\n    port: 1420,\n    strictPort: true,\n  },\n  esbuild: {\n    target: \"safari14\",\n  },\n  // to make use of `TAURI_DEBUG` and other env variables\n  // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand\n  envPrefix: [\"VITE_\", \"TAURI_\"],\n  build: {\n    // Tauri supports es2021\n    target: process.env.TAURI_ENV_PLATFORM == \"windows\" ? \"chrome105\" : \"safari13\",\n    // don't minify for debug builds\n    minify: !process.env.TAURI_ENV_DEBUG ? \"esbuild\" : false,\n    // produce sourcemaps for debug builds\n    sourcemap: !!process.env.TAURI_ENV_DEBUG,\n    rollupOptions: {\n      input: {\n        main: resolve(__dirname, \"index.html\"),\n        updateWindow: resolve(__dirname, \"update-window/index.html\"),\n      },\n    },\n  },\n})\n"
  },
  {
    "path": "docs/.gitignore",
    "content": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "docs/README.md",
    "content": "# Documentation\n\nThis website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.\n\n### Installation\n\n```\n$ yarn\n```\n\n### Local Development\n\n```\n$ yarn start\n```\n\nThis command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.\n\n### Build\n\n```\n$ yarn build\n```\n\nThis command generates static content into the `build` directory and can be served using any static contents hosting service.\n\n\n## Creating New Versions\n\n### 1. Generate Command Docs\n```bash\ncd ../ # main project directory\ngo run -mod=vendor ./hack/gen-docs.go\n```\n\n### 2. Create Version\n```bash\nyarn run docusaurus docs:version 0.1\n```\n"
  },
  {
    "path": "docs/docusaurus.config.js",
    "content": "__webpack_public_path__ = \"/docs/\";\n\nmodule.exports = {\n  title: \"DevPod docs | DevContainers everywhere\",\n  tagline: \"DevContainers everywhere\",\n  url: \"https://devpod.sh\",\n  baseUrl: __webpack_public_path__,\n  favicon: \"/media/devpod-favicon.svg\",\n  organizationName: \"loft-sh\", // Usually your GitHub org/user name.\n  projectName: \"devpod\", // Usually your repo name.\n  themeConfig: {\n    colorMode: {\n      defaultMode: \"light\",\n      disableSwitch: false,\n      respectPrefersColorScheme: true,\n    },\n    navbar: {\n      logo: {\n        alt: \"devpod\",\n        src: \"/media/devpod-logo-horizontal.svg\",\n        srcDark: \"/media/devpod-logo-horizontal-dark.svg\",\n        href: \"https://devpod.sh/\",\n        target: \"_self\",\n      },\n      items: [\n        {\n          href: \"https://devpod.sh/\",\n          label: \"Website\",\n          position: \"left\",\n          target: \"_self\",\n        },\n        {\n          to: \"/docs/what-is-devpod\",\n          label: \"Docs\",\n          position: \"left\",\n        },\n        {\n          href: \"https://loft.sh/blog\",\n          label: \"Blog\",\n          position: \"left\",\n          target: \"_self\",\n        },\n        {\n          href: \"https://slack.loft.sh/\",\n          className: \"slack-link\",\n          \"aria-label\": \"Slack\",\n          position: \"right\",\n        },\n        {\n          href: \"https://github.com/loft-sh/devpod\",\n          className: \"github-link\",\n          \"aria-label\": \"GitHub\",\n          position: \"right\",\n        },\n      ],\n    },\n    algolia: {\n      appId: \"Y3XX0IC1ZW\",\n      apiKey: \"cfc452201042c6b5483694d4d0492aa8\",\n      indexName: \"devpod\",\n      algoliaOptions: {},\n      placeholder: \"Search...\",\n      contextualSearch: false,\n    },\n    footer: {\n      style: \"light\",\n      links: [],\n      copyright: `Copyright © ${new Date().getFullYear()} <a href=\"https://loft.sh/\">Loft Labs, Inc.</a>`,\n    },\n  },\n  presets: [\n    [\n      \"@docusaurus/preset-classic\",\n      {\n        docs: {\n          path: \"pages\",\n          routeBasePath: \"/\",\n          sidebarPath: require.resolve(\"./sidebars.js\"),\n          editUrl: \"https://github.com/loft-sh/devpod/edit/main/docs/\",\n        },\n        theme: {\n          customCss: require.resolve(\"./src/css/custom.css\"),\n        },\n      },\n    ],\n  ],\n  plugins: [],\n  scripts: [\n    {\n      src: \"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js\",\n      async: true,\n    },\n    {\n      src: \"/docs/js/custom.js\",\n      async: true,\n    },\n  ],\n};\n"
  },
  {
    "path": "docs/package.json",
    "content": "{\n  \"name\": \"devpod-docs\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"docusaurus start\",\n    \"build\": \"docusaurus build\",\n    \"swizzle\": \"docusaurus swizzle\",\n    \"deploy\": \"docusaurus deploy\"\n  },\n  \"dependencies\": {\n    \"@docusaurus/core\": \"^3.5.2\",\n    \"@docusaurus/preset-classic\": \"^3.5.2\",\n    \"classnames\": \"^2.2.6\",\n    \"docusaurus\": \"^1.14.7\",\n    \"docusaurus-gtm-plugin\": \"^0.0.2\",\n    \"mdx-link-checker\": \"^0.1.1\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\"\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/connect-to-a-workspace.mdx",
    "content": "---\ntitle: Connect to a Workspace\nsidebar_label: Connect to a Workspace\n---\n\n## Connect to a Workspace\n\nAfter a workspace is successfully created, the workspace is reachable via the ssh host `WORKSPACE_NAME.devpod`.\nIf you have selected an IDE to automatically open, DevPod will automatically try to open the IDE after a successful workspace creation or `devpod up` command.\n\n:::info\nYou can change the default IDE to open globally via: `devpod use ide vscode` or `devpod up my-workspace --ide vscode` for an individual workspace.\n:::\n\n### VS Code Browser\n\nDevPod is able to open VS Code in a browser in a workspace.\nIt will use the open source project [openvscode-server](https://github.com/gitpod-io/openvscode-server) for installing a vscode server binary in the workspace and then tunnel a connection to that binary from the localhost.\nTo open the workspace inside VS Code browser, you can run the following command:\n```\ndevpod up my-workspace --ide openvscode\n```\n\nTo select a different openvscode version, please run with:\n```\ndevpod up my-workspace --ide openvscode --ide-option VERSION=v1.76.2\n```\n\n### VS Code\n\nBefore connecting VS Code with DevPod, make sure you have installed the [remote ssh extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) and the [code CLI](https://code.visualstudio.com/docs/editor/command-line). Then you can start the workspace directly in VS Code with:\n```\ndevpod up my-workspace --ide vscode\n```\n\n:::info SSH Fallback\nIf for whatever reason this does not work you can also use the regular SSH connection with `WORKSPACE_NAME.devpod` to connect VS Code with a workspace\n:::\n\n### JetBrains Suite (Goland, PyCharm, Intellij etc.)\n\nMake sure you have [JetBrains Gateway](https://www.jetbrains.com/remote-development/gateway/) installed and a valid jetbrains subscription for your local IDE. The following JetBrains IDEs are supported:\n* **CLion (clion)**\n* **Goland (goland)**\n* **PyCharm (pycharm)**\n* **Intellij (intellij)**\n* **PhpStorm (phpstorm)**\n* **WebStorm (webstorm)**\n* **Rider (rider)**\n* **RubyMine (rubymine)**\n\nThen start your workspace via:\n```\ndevpod up my-workspace --ide goland\n```\n\nWhich will install the goland server binary into the workspace and then open JetBrains Gateway to open this workspace.\n\nAfter successful installation the Gateway SSH dialog will popup prefilled with the correct information, please click **Check Connection and Continue**, which will start your desired IDE inside the workspace.\n\nTo select a different IDE version, please run with:\n```\ndevpod up my-workspace --ide goland --ide-option VERSION=2022.3.3\n```\n\n:::info SSH Fallback\nIf for whatever reason this does not work you can also use the regular SSH connection with `WORKSPACE_NAME.devpod` to connect your JetBrains IDE with a workspace\n:::\n\n:::info Fleet Support\nFleet currently only works by manually adding an SSH connection with `WORKSPACE_NAME.devpod`\n:::\n\n### SSH\n\nUpon workspace creation, DevPod will automatically modify the `~/.ssh/config` to include an entry for `WORKSPACE_NAME.devpod`, which allows you to use the following command to connect to your workspace:\n```\nssh WORKSPACE_NAME.devpod\n```\n\nThis also allows you to connect any IDE that supports remote development through SSH via the given host `WORKSPACE_NAME.devpod`.\n\n### DevPod CLI\n\nIf you don't have `ssh` installed or cannot connect through any other IDE, you can use the following DevPod command to access a workspace:\n```\ndevpod ssh my-workspace\n```\n\nOptionally you can also define a command to run:\n```\ndevpod ssh my-workspace --command \"echo Hello World\"\n```\n\n## IDE Commands\n\nThis section shows additional commands to configure DevPod's behavior when opening a workspace.\n\n### Configure IDE Options\n\nYou can specify certain options such as IDE version and download path if needed. You can list the available options for an IDE via:\n```\ndevpod ide options openvscode\n```\n\nYou will see available options and default values for them. To change an option, you can run:\n```\ndevpod ide set-options openvscode -o VERSION=v1.76.2\n```\n\n### Change Default IDE\n\nTo change the default IDE DevPod will use for connecting to a workspace, please run:\n```\ndevpod ide use vscode\n```\n\n### List supported IDEs\n\nYou can list all DevPod supported IDEs via:\n```\ndevpod ide list\n```\n\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/create-a-workspace.mdx",
    "content": "---\ntitle: Create a Workspace\nsidebar_label: Create a Workspace\n---\n\n## Create a Workspace\n\nYou can create a workspace either from the DevPod CLI or through the DevPod desktop application. A workspace can be created from a git repository, a local path or a docker container (e.g. `golang:latest`).\n\nUpon successful creation, DevPod will make the development container available through the ssh host `WORKSPACE_NAME.devpod`. Alternatively, DevPod can automatically open the workspace in a locally installed IDE, such as VS Code or Intellij.\n\n:::info\nA workspace is defined through a `devcontainer.json`. If DevPod can't find one, it will automatically try to guess the programming language of your project and provide a fitting template.\n:::\n\n### Via DevPod Desktop Application\n\nNavigate to the 'Workspaces' view and click on the 'Create' button in the title. Enter the git repository you want to work on or select a local folder.\n\n:::info Add Provider\nIf you haven't configured a provider yet, DevPod will automatically open the provider modal for you. You can later add providers in the same way by navigating to 'Providers' > 'Add'\n:::\n\nYou can also configure one of the additional settings:\n- **Provider**: The provider to use for this workspace. Cannot be changed later.\n- **Default IDE**: The ide to open after successfully creating this workspace. Can be changed later.\n- **Workspace Name**: Override the automatically determined workspace name with this option. Cannot be changed later.\n- **Prebuild Repository**: A docker image repository such as `ghcr.io/my-org/my-repo` that contains prebuilds for this workspace. DevPod will try to automatically find a fitting prebuild for this workspace in the given repository.\n\nThen press `Create Workspace` to launch the workspace.\n\n:::info\nUnder the hood, the Desktop Application will call the CLI command `devpod up REPOSITORY`\n:::\n\n:::info Note\nYou can set the location of your devpod home by passing the `--devpod-home={home_path}` flag, \nor by setting the env var `DEVPOD_HOME` to your desired home directory.\n\nThis can be useful if you are having trouble with a workspace trying to mount to a windows location when it should be mounting to a path inside the WSL VM.\n\nFor example: setting `devpod-home=/mnt/c/Users/MyUser/` will result in a workspace path of something like `/mnt/c/Users/MyUser/.devpod/contexts/default/workspaces/...`\n:::\n\n### Via DevPod CLI\n\nMake sure to [install the DevPod CLI locally](../getting-started/install.mdx#optional-install-devpod-cli) and select a provider you would like to host the workspace on (such as local docker) via:\n```\n# Add a provider if you haven't already\ndevpod provider add docker\n```\n\n#### Git Repository\n\nRun the following command in a terminal to start a new workspace:\n\n```\n# Create from git repository\ndevpod up github.com/microsoft/vscode-remote-try-node\n```\n\nYou can check out specific states of the repository by appending a commit hash, branch or Pull Request slug to the repository url:\n```\nBranch: devpod up github.com/microsoft/vscode-remote-try-node@main\nCommit: devpod up github.com/microsoft/vscode-remote-try-node@sha256:15ba80171af11374143288fd3d54898860107323\nPR:     devpod up github.com/microsoft/vscode-remote-try-node@pull/108/head # Only works for GitHub!\n```\n\n:::info Private Git Repositories\nDevPod will forward git credentials to a remote machine so that you can also pull private repositories.\n:::\n\n\n:::info Multiple workspaces from the same repository\nUse the `--id` flag to override the name of the workspace. This allows you to create multiple workspaces from the same repository.\n:::\n\n\n#### Local Path\n\nRun the following command in a terminal to create a new workspace:\n\n```\n# Create from a local path\ndevpod up ./path/to/my-folder\n```\n\nDevPod will sync the folder into the remote machine and create a development environment from the `devcontainer.json`.\n\n#### Docker Image\n\nRun the following command in a terminal to create a new workspace from a docker image:\n\n```\n# Create from a docker image\ndevpod up ghcr.io/my-org/my-repo:latest\n```\n\nDevPod will create the following `.devcontainer.json`:\n```\n{\n    \"image\": \"ghcr.io/my-org/my-repo:latest\"\n}\n```\n\n#### Existing local container\n\nIf you have a local container running, you can create a workspace from it by running:\n```\ndevpod up my-workspace --source container:$CONTAINER_ID \n```\n\nThis only works with the `docker` provider.\n\n:::info\nUsing `--recreate` on a workspace based on an already existing container will be rejected.\n:::\n\n## Recreating a workspace\n\nIf you are working on the `devcontainer.json` or have pulled changes that affect the development environment, you can recreate a workspace. Recreating a workspace means to apply changes in the `devcontainer.json` or related `Dockerfile` to the development environment. If a prebuild repository is supplied, DevPod will try to find the updated development environment image inside the prebuild repository and if not found will fall back to building it.\n\nWhen recreating a workspace, changes only to the project path or mounted volumes will be preserved. **All other changes made in the container will be lost.**\n\n### Via DevPod Desktop Application\n\nNavigate to the 'Workspaces' view and press on the 'More Options' button on the workspace you want to recreate. Then press 'Rebuild' and confirm to rebuild the workspace.\n\n### Via DevPod CLI\n\nRun the following command to rebuild an existing workspace:\n```\ndevpod up my-workspace --recreate\n```\n\n## Resetting a workspace\n\nSome scenarios require pulling in the latest changes from a git repository or re-uploading your local folder. If instead of recreating the devcontainer you need to completely restart your workspace from a clean slate, use `Reset` over `Recreate`.\n\n** When recreating a workspace, no changes will be preserved! **\n\n### Via DevPod Desktop Application\n\nNavigate to the 'Workspaces' view and press on the 'More Options' button on the workspace you want to reset. Then press 'Reset' and confirm.\n\n### Via DevPod CLI\n\nRun the following command to reset an existing workspace:\n```\ndevpod up my-workspace --reset\n```"
  },
  {
    "path": "docs/pages/developing-in-workspaces/credentials.mdx",
    "content": "---\ntitle: Reuse local credentials\nsidebar_label: Reuse local credentials\n---\n\nDevPod will automatically make certain local credentials available inside of the development container through a [credentials helper](https://git-scm.com/docs/gitcredentials).\nThis allows you to reuse existing local credentials in a safe manner within the development container without explicitly configuring them inside each workspace.\nCurrently DevPod supports this feature for git credentials and docker credentials.\n\n## Git credentials\n\nDevPod will make https credentials available inside the dev container through a [git credentials helper](https://git-scm.com/docs/gitcredentials). ssh credentials are available through agent-forwarding that will be configured automatically on the ssh configuration for the workspace.\n\nIf you don't want DevPod to inject the credentials, you can disable that via the following command for all workspaces:\n```\ndevpod context set-options default -o SSH_INJECT_GIT_CREDENTIALS=false\n```\n\n## Docker credentials\n\nDevPod will make docker registry credentials available inside the dev container through a [docker credentials helper](https://docs.docker.com/engine/reference/commandline/login/#credential-helpers). This allows you to pull and push images from and to private registries from within the dev container.\n\nIf you don't want DevPod to inject the credentials, you can disable that via the following command for all workspaces:\n```\ndevpod context set-options default -o SSH_INJECT_DOCKER_CREDENTIALS=false\n```\n\n## GPG credentials\n\nDevPod will make gpg keys available inside the dev container through an ssh tunnel. This allows you to sign commits from inside the workspace.\n\nIf you want DevPod to inject the gpg keys, you must that via the following command for all workspaces:\n```\ndevpod context set-options default -o GPG_AGENT_FORWARDING=true\n```\n\nOr when creating a workspace using:\n\n```\ndevpod up --gpg-agent-forwarding my-workspace\n```\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/delete-a-workspace.mdx",
    "content": "---\ntitle: Delete a Workspace\nsidebar_label: Delete a Workspace\n---\n\n## Delete a workspace\n\nDeleting a workspace means to erase all state of an existing workspace and remove all traces of it within DevPod.\nDepending on the DevPod provider, this means either removing a docker container or deleting a whole virtual machine.\nDevPod will automatically determine what specific action to take when a workspace is deleted.\n\n### Via DevPod Desktop Application\n\nIn the 'Workspaces' view, click on the 'More Options' button and then on 'Delete'. This will delete the workspace.\n\n:::info Force Deletion\nIf deletion fails because the Provider is not reachable anymore or another error has occurred, you can also force delete a workspace by checking the force checkbox.\nHowever, this means the workspace will only be deleted on the DevPod side locally, and any error raised by the used provider will be ignored. Only use this option with caution as this might leave previously created resources behind.\n:::\n\n### Via DevPod CLI\n\nRun the following command to delete a workspace:\n```\ndevpod delete my-workspace\n```\n\nIf deletion fails because the Provider is not reachable anymore or another error has occurred, you can also force delete a workspace via:\n```\ndevpod delete my-workspace --force\n```\n\nHowever, this means the workspace will only be deleted on the DevPod side locally, and any error raised by the used provider will be ignored. Only use this option with caution as this might leave previously created resources behind.\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/devcontainer-json.mdx",
    "content": "---\ntitle: devcontainer.json\nsidebar_label: devcontainer.json\n---\n\nDevPod uses the [open `devcontainer.json` standard](https://containers.dev/) to allow users to customize their development containers.\nDevelopment containers are Docker containers that provide a user with a fully featured development environment.\nWithin DevPod, this container is created based on the underlying provider either locally, in a remote virtual machine or even in a Kubernetes cluster.\nDevPod makes sure that no matter where you use this configuration the developer experience stays the same.\n\nYou can configure this development container for a certain git repository so that each workspace gives you a custom development environment\ncompletely configured with the tooling and runtimes you need for working on that specific project.\nIf DevPod doesn't find any configuration for the project it will automatically detect the programming language and provide a sane default configuration.\n\n:::info Compatibility with VS Code & Codespaces\nThe same format is used by VS Code for their development containers and by Github for their Codespaces.\nThis makes it easy to reuse existing configurations and tooling around this standard within DevPod.\n:::\n\n:::info Additional References\nThis page mostly gives you an introduction on how to work with devcontainers. For additional information take a look at:\n* [DevContainer Reference](https://containers.dev/implementors/json_reference/)\n* [VS Code DevContainer Documentation](https://code.visualstudio.com/docs/devcontainers/create-dev-container)\n* [Github Codespaces Documentation](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers#devcontainerjson)\n:::\n\n:::warning Unsupported Properties\nCurrently, these `devcontainer.json` properties are not supported in DevPod. These may be implemented in future releases.\n* userEnvProve\n* waitFor\n* Parallel lifecycle scripts\n:::\n\n## devcontainer.json\n\nThe primary file to configure your workspace is the `devcontainer.json`, that lives in the `.devcontainer` sub-folder of your project.\nThis file includes information on what frameworks, tools, VS Code extensions and port-forwarding should be used during development.\nThe file also usually references a Dockerfile or a Docker image to use as the base for the development environment.\nIf DevPod doesn't find any configuration for the project, it will automatically detect the programming language and provide a sane default configuration.\n\nThe `devcontainer.json` can be located at the following places within your project:\n* `.devcontainer/devcontainer.json`\n* `.devcontainer.json`\n* `.devcontainer/my-other-folder/devcontainer.json`\n\nYou can specify a specific file to use via the `--devcontainer-path` CLI flag:\n```\ndevpod up github.com/my-org/my-repo --devcontainer-path ./my-git-path-to/a-devcontainer-json-file.json\n```\n\nA `devcontainer.json` is not able to import or inherit any settings from other `devcontainer.json` files, so make sure all dependent files and folders are available within the configuration subdirectory.\n\n### Using a Dockerfile\n\nIn order to use a Dockerfile for your configuration, you can specify the following within your `devcontainer.json`:\n```\n{\n  \"build\": {\n    \"dockerfile\": \"Dockerfile\"\n  },\n  ...\n}\n```\n\nAnd the Dockerfile could look like this:\n```\nFROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16-buster\n\n# Install extra tooling into the environment via the following command\nRUN apt-get update && apt-get install vim\n```\n\nFor more information about how to write Dockerfiles, please visit the [official documentation](https://docs.docker.com/engine/reference/builder/)\n\n### Add Additional DevContainer Features\n\n`devcontainer.json` allows you to reuse certain predefined features within your configuration.\nYou can think of features as reusable Dockerfile parts that will be merged into your Dockerfile upon creation.\nThis makes it easy to reuse functionality such as `docker-in-docker` or install extra tooling such as `node` or `kubectl` without having to look up the exact Dockerfile commands.\nA list of available features can be found [here](https://containers.dev/features).\n\nDevpod is able to add HTTP headers when downloading\nfeature archives as tar.gz files. To do so, add the needed headers in the `customizations`\nfield of the `devcontainer.json` file as follows:\n\n```\n{\n  ...\n  \"features\": {\n    \"https://example.com/foo_feature.tar.gz\": []\n  },\n  \"customizations\": {\n    \"devpod\": {\n      \"featureDownloadHTTPHeaders\": {\n        \"FOO_HEADER\": \"${env:FOO_ENV_VAR}\"\n        \"BAR_HEADER\": \"bar\"\n      }\n    }\n  }\n}\n```\n\n## devcontainer.json Development Flow\n\nWhen working on the `devcontainer.json` itself, it's important to understand when DevPod will apply new configuration.\n\nA naive approach would be to delete and recreate a workspace after each `devcontainer.json` change (which obviously works), but DevPod allows you to make changes to the configuration on the fly and reapply them via `devpod up my-workspace --recreate`.\nThis will apply **ALL** new configurations including Dockerfile changes as well as new mounts, new features or any other configuration that is not included in the above command. DevPod will only replace the existing running container if the command has succeeded, so if there is a mistake in the new configuration, the existing workspace should not be impacted.\nThe Desktop app equivalent for this is the 'Rebuild' button.\n\n:::warning Recreating / Rebuilding\nChanges in the overlay layer of the container, which means all changes to non-volumes will be lost. Changes within the project path and all other mounted paths will be preserved.\n:::\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/dotfiles-in-a-workspace.mdx",
    "content": "---\ntitle: Dotfiles in a Workspace\nsidebar_label: Dotfiles in a Workspace\n---\n\n## Personalizing a Workspace\n\nYou can personalize your workspace environment by using a `dotfiles` repository.\n\nDotfiles are plain text configuration files on Unix like systems (e.g. MacOS, Linux, BSD).  \nDotfiles store settings of almost every application, service and tool running on your system.  \nIt is common practice to track dotfiles with a version control system such as Git\nto keep track of changes and synchronize dotfiles across various hosts. \n\nYou can use the `--dotfiles` flag when creating a workspace, so that DevPod will\nautomatically clone and install your dotfiles in the workspace.\n\nIf you only specify the dotfiles repo, DevPod will clone your selected dotfiles\nrepository into the workspace, and will look into one of these locations to find\na script to setup the environment.\n\n- install.sh\n- install\n- bootstrap.sh\n- bootstrap\n- script/bootstrap\n- setup.sh\n- setup\n- script/setup\n\nIf none of the previous location are found, DevPod will just link every hidden file (files starting with `.`)\nin the `$HOME` directory of the container.\n\nIt is possible to specify **custom install script locations** for your special setup. \nIf a custom install script is specified, DevPod will directly run that one instead.\n\n### Via DevPod CLI\n\nRun the following command to a workspace with a dotfiles repo:\n\n```\ndevpod up https://github.com/example/repo --dotfiles https://github.com/my-user/my-dotfiles-repo\n```\n\nSpecifying a custom install script:\n\n```\ndevpod up https://github.com/example/repo --dotfiles https://github.com/my-user/my-dotfiles-repo --dotfiles-script custom/location/install.sh\n```\n\n#### For all Workspaces\n\nYou can setup these options on a **context wide scope** so that you won't have to specify\ndotfiles ad dotfiles-script for each single workspace:\n\nExample with a real repository:\n\n```\ndevpod context set-options -o DOTFILES_URL=https://github.com/89luca89/dotfiles -o DOTFILES_SCRIPT=bin/.local/bin/dotfiles\n```\n\nAll new Workspaces will be created with that dotfile repository and install script.\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/environment-variables-in-devcontainer-json.mdx",
    "content": "---\ntitle: Environment variables in devcontainer.json\nsidebar_label: Environment variables in devcontainer.json\n---\n\nIf you're combining SSH provider with using environment variables in your `.devcontainer.json`,\nplease follow the steps below to make sure that your environment variables are properly set on the remote machine.\n\n### Steps\n\n1. Prepare a `.devcontainer.json` to include `${localEnv:<VARIABLE_NAME>}` directive.<br/>\n    Example `.devcontainer.json`:\n```json\n{\n    \"name\": \"Node.js\",\n    \"image\": \"mcr.microsoft.com/devcontainers/javascript-node:${localEnv:IMAGE_VERSION}\"\n}\n```\n\n2. Prepare an entry in a local `.ssh/config` to include `SetEnv <VARIABLE_NAME>=<VARIABLE_VALUE>` directive.<br/>\n    Example `.ssh/config`:\n```console\nHost <REMOTE-SSH-SERVER>\n   SetEnv IMAGE_VERSION=0-18-bullseye\n```\n\n3. Log to your remote machine and in the `/etc/ssh/sshd_config` add an entry `AcceptEnv <VARIABLE_NAME>`.<br/>\n    For example:\n```console\nAcceptEnv IMAGE_VERSION\n```\n\n4. Restart SSH service on your remote machine.<br/>\nFor example on Debian Linux:\n```console\nsystemctl restart ssh.service\n```\n\n4. Run a `devpod up` command:\n\n```console\ndevpod up <GITHUB-REPOSITORY-URL> --ide=none\n```\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/inactivity-timeout.mdx",
    "content": "---\ntitle: Auto-Inactivity Timeout\nsidebar_label: Auto-Inactivity Timeout\n---\n\nBy default, most providers are able to automatically shutdown unused workspaces to save costs. For example, for cloud providers such as AWS, Azure and Google Cloud, DevPod will automatically stop the machine to save costs when workspaces are not used.\n\nMachines stopped this way preserve the data and state, so when a workspace [is started again](./connect-to-a-workspace.mdx), DevPod will simply restart the machine and the workspace.\n\n:::info\nAll official DevPod providers offer this pre-configured to 5-10 minutes. Check the provider options to see how to change the timeout.\n:::\n\n## Configuring the timeout\n\nChanging the default setting for inactivity timeout can be done by [configuring the provider options](../managing-providers/add-provider.mdx#set-provider-options). Typically there is an option called `INACTIVITY_TIMEOUT` that controls this behaviour.\n\n:::info\nMore info about the provider's auto-shutdown can be found in the [agent's development guide](../developing-providers/agent.mdx#machine-providers)\nThat will explain how this is done and what can be configured.\n:::\n\n## How does it work?\n\n### Non-Machine Providers\n\nFor non-machine providers, DevPod can automatically kill the container its running in by terminating the process with pid 1. This is useful for providers such as docker, kubernetes or ssh, where you don't want the container to be running if its not needed. If configured on the provider, DevPod will start a process within the container to keep track of activity and then kill itself when the user hasn't connected for the given duration. This will not erase any state within the container and instead only stop it. Then when the user wants to start working with the workspace again, DevPod will restart the container again.\n\n### Machine Providers\n\nFor machine providers, killing just the container within the remote machine is typically not enough as VMs still generate costs even if they are unused.\nInstead, DevPod will install itself as a Daemon into the remote VM and track the activity from there. If there wasn't activity for a given amount of time, DevPod will automatically shutdown the machine or even delete it, based on what's cheaper for the given cloud provider.\nThen when the developer wants to resume development, DevPod will restart or recreate the virtual machine.\n\n:::info\nSee [agent's development guide](../developing-providers/agent.mdx#machine-providers) to learn more about how inactivity-timeout works on the provider side.\n:::\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/prebuild-a-workspace.mdx",
    "content": "---\ntitle: Prebuild a Workspace\nsidebar_label: Prebuild a Workspace\n---\n\n## Prebuild a Workspace\n\nPrebuilding a workspace means building a ready-to-use docker image out of the `devcontainer.json`, its referenced features and optionally a linked `Dockerfile`.\nUsually when creating a new workspace, DevPod will first build a docker image based on the configuration and then later use this image to create the development environment.\nWith prebuilds, this step can be omitted and DevPod can directly use the docker image to start the development environment. This can save start up time, especially for more complex development environments.\n\n### How does it work?\n\nBased on the `devcontainer.json` configuration, DevPod will generate a hash in the form of `devpod-HASH` and use this as a tag for the created docker image.\nYou can then reference docker image repositories, where DevPod will search this tag and if found uses it instead of building the image itself.\n\nTo prebuild a workspace, you can run the following command:\n```\n# Prebuild the docker image for github.com/my-org/my-repo and save it in image registry ghcr.io/my-org/my-repo\ndevpod build github.com/my-org/my-repo --repository ghcr.io/my-org/my-repo\n```\n\n:::info Detecting existing Prebuilds\nDevPod will only build the workspace if there isn't an existing prebuild found in the specified docker image repository\n:::\n\nDevPod will use the current provider for doing this, which means you can also use remote providers to prebuild an image. You can even have a separate provider just for prebuilding images.\n\n## Using Prebuilds\n\nUsing prebuilds means you specify a docker image repository, where DevPod will search for an image with a specific hash generated from the devcontainer configuration. You can either specify this prebuild repository via a flag during workspace creation or directly in the `devcontainer.json`.\n\n:::info Prebuild not found\nIf a prebuild cannot be found in the given repository or credentials are missing locally, DevPod will just skip the repository.\n:::\n\n### Reference Prebuild Repository as Flag\n\nWhen creating a new workspace, you can define the prebuild repository via the `--prebuild-repository` flag:\n```\ndevpod up github.com/my-org/my-repo --prebuild-repository ghcr.io/my-org/my-repo\n```\n\n### Reference Prebuild Repository in devcontainer.json\n\nIt's also possible to include the prebuild repository directly in the `devcontainer.json`, which makes it easy to automate prebuilding through a CI/CD pipeline on changes. You can specify the prebuild repository via:\n```\n{\n  \"name\": \"my-project\",\n  \"customizations\": {\n    \"devpod\": {\n      \"prebuildRepository\": \"ghcr.io/my-org/my-repo\"\n    }\n  }\n}\n```\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/stop-a-workspace.mdx",
    "content": "---\ntitle: Stop a Workspace\nsidebar_label: Stop a Workspace\n---\n\n## Stop a Workspace\n\nStopping a workspace means to temporarily pause a container so that it doesn't consume any more computing resources such as CPU or memory.\nDepending on the provider used, this either means to stop a container (see [docker stop](https://docs.docker.com/engine/reference/commandline/stop/) for more information)\nor shutdown the underlying VM where the container is running.\nDevPod will automatically determine what specific action to take when a workspace is stopped.\n\n### Via DevPod Desktop Application\n\nIn the 'Workspaces' view, click on the 'More Options' button and then on 'Stop'. This will stop the workspace. Afterwards, you can resume the workspace by pressing the 'Open' button.\n\n### Via DevPod CLI\n\nRun the following command to stop a workspace:\n```\ndevpod stop my-workspace\n```\n\nAfterwards, you can start the workspace via:\n```\ndevpod up my-workspace\n```\n\n## Automatic stopping via a Provider\n\nSome providers allow automatic stop of a workspace, usually to save costs when a workspace is not used.\nFor example, the Google Cloud provider will shutdown the virtual machine where the workspace is running after it's unused for 10 minutes, by default.\nThis means you need to start the workspace after it has been stopped when you want to reconnect.\n"
  },
  {
    "path": "docs/pages/developing-in-workspaces/what-are-workspaces.mdx",
    "content": "---\ntitle: What are Workspaces?\nsidebar_label: What are Workspaces?\n---\n\nA workspace in DevPod is a containerized development environment, that holds the source code of a project as well as the dependencies to work on that project, such as a compiler and debugger.\nThe underlying environment where the container runs will be created and managed through a DevPod provider. This allows DevPod to provide a consistent development experience no matter where the container is actually running, which can be a remote machine in a public cloud, localhost or even a Kubernetes cluster.\n\nTo configure the development container, DevPod reuses the [devcontainer.json](https://containers.dev/) specification, which is also used by other popular tools, such as [VS Code dev containers](https://code.visualstudio.com/docs/devcontainers/containers) or [Github Codespaces](https://github.com/features/codespaces).\nThis means you can already reuse projects that use this configuration to spin up a workspace in DevPod. If no configuration is found, DevPod will automatically try to find out what programming language is used and provide an appropriate template.\n\nA workspace in DevPod can be stopped and restarted without losing its state. This allows you to install additional programs or change configuration without the need to reconfigure the container.\nDepending on the Provider, DevPod will also automatically determine when a workspace is currently not be used and shutdown any unused resources to save costs.\n\n"
  },
  {
    "path": "docs/pages/developing-providers/agent.mdx",
    "content": "---\ntitle: Provider Agent\nsidebar_label: Provider Agent\n---\n\nWhen DevPod connects through a Provider to an environment, it will inject itself into the environment to handle the following tasks:\n- deploying the container\n- forward credentials\n- ssh server\n- auto-shutdown after a period of inactivity\n\nThis counterpart is called the DevPod agent, which is available in the same DevPod binary under `devpod agent`.\nWithin the `provider.yaml` you can configure certain parts of how local DevPod should interact with its agent counterpart.\n\n:::info\nAgent's **Driver** specifies how the whole container workloads is deployed inside\nthe provider's resources.\n\nHead over to the [drivers section](./driver.mdx) to understand how this impacts\nthe provider\n:::\n\n## Agent section\n\nThe following options are available in the `agent` section\n\n```yaml\nagent: # You can also use options within this section (see injectGitCredentials as an example)\n  path: $\\{DEVPOD\\}\n  driver: docker # Optional, default: docker\n  inactivityTimeout: 10m\n  containerInactivityTimeout: 10m\n  injectGitCredentials: ${INJECT_GIT_CREDENTIALS}\n  injectDockerCredentials: ${INJECT_DOCKER_CREDENTIALS}\n  binaries:\n    MY_BINARY:\n      - os: linux\n        arch: amd64\n        path: https://url-to-binary.com\n        checksum: shasum-of-binary\n  exec:\n    shutdown: |-\n      ${MY_BINARY} stop\n```\n\nBreaking down the options:\n\n- **path**: where to place the agent on the remote machine. Use $\\{DEVPOD\\} here if you want to use the local machine instead.\n- **driver**: which driver to use to run container, [check the Drivers section for more information](./driver.mdx)\n- **inactivityTimeout**: after how much time to shut down the machine. Use for machine providers\n- **containerInactivityTimeout**: after how much time to shut down the container. Use for non-machine providers\n- **injectGitCredentials**: whether to inject git credentials into the machine.\n- **injectDockerCredentials**: whether to inject docker credentials into the machine.\n- **exec.shutdown**: command to execute when shutting down the machine after DevPod has determined the `inactivityTimeout`. Option values will be available here as well. For example, you can reuse an option that stores a cloud api key within this command to terminate the machine.\n- **binaries**: this section can be used to declare additional binaries to download on the machine to use in `exec.shutdown`\n\n:::info\nThe `binaries` section is useful for injecting a helper binary in the machine, in order to\nuse the specific cloud's APIs to shut down the machine, if a simple `shutdown -h now` does not work\n:::\n\n:::info\nThe `binaries` section follows the same syntax and structure of the [binaries section in the main provider manifest](./binaries.mdx)\n:::\n\n## Auto-Inactivity Stop\n\nOne of the most important features of DevPod is to make sure that developer environments use as little resources as possible when they are not used.\n\n### Non-Machine Providers\n\nFor non-machine providers, DevPod can automatically kill the container its running in by terminating the process with pid 1. This is useful for providers such as docker, kubernetes or ssh, where you don't want the container to be running if its not needed. The timeout can be configured through `agent.containerInactivityTimeout`. DevPod will then start a process within the container to keep track of activity and then kill itself when the user hasn't connected for the given duration. This will not erase any state within the container and instead only stop it. Then when the user wants to start working with the workspace again, DevPod will start the container again.\n\n### Machine Providers\n\nFor machine providers, killing just the container within the remote machine is typically not enough as VMs still generate costs even if they are unused.\nHence DevPod provides a way to configure automatically shutting down or deleting an unused machine on the cloud provider side if a developer is currently not working anymore.\nDevPod will then restart or recreate it again, when the development should continue.\n\nDevPod tries to make this as easy as possible for you, as it will automatically keep track of when a user is connected to a workspace or not and only needs the command to run when the machine should be stopped from the provider.\nThis command can be defined through `agent.exec.shutdown`.\nAll configured options are available in this command and helper binaries needed can be defined through `agent.exec.binaries`\n\nOfficial providers that use this method of automatically stopping an inactive machine are:\n- [devpod-provider-azure](https://github.com/loft-sh/devpod-provider-azure): Just uses `shutdown -t now` as `agent.exec.shutdown` to shutdown an unused machine.\n- [devpod-provider-aws](https://github.com/loft-sh/devpod-provider-aws): Uses the local `aws` cli tool to generate a temporary token, which is then saved in a DevPod option. This token is then used within `agent.exec.shutdown` to shutdown the machine on the agent side with an AWS api call.\n- [devpod-provider-gcloud](https://github.com/loft-sh/devpod-provider-gcloud): Uses the local `gcloud` cli tool to generate a temporary token, which is then saved in a DevPod option. This token is then used within `agent.exec.shutdown` to shutdown the machine on the agent side with an Google Cloud api call.\n- [devpod-provider-digitalocean](https://github.com/loft-sh/devpod-provider-digitalocean): Deletes the whole machine on inactivity as stopped machines are still billed by DigitalOcean. The local digital ocean token is reused on the agent side to make an API call to delete the whole machine and preserve the state in an extra volume.\n"
  },
  {
    "path": "docs/pages/developing-providers/binaries.mdx",
    "content": "---\ntitle: Provider Binaries\nsidebar_label: Provider Binaries\n---\n\nThe `binaries` section can be used to specify helper binaries DevPod should download that help the provider to accomplish its tasks.\n\nAn example of this type of provider are:\n\n- [devpod-provider-aws](https://github.com/loft-sh/devpod-provider-aws/releases)\n- [devpod-provider-azure](https://github.com/loft-sh/devpod-provider-azure/releases)\n- [devpod-provider-civo](https://github.com/loft-sh/devpod-provider-civo/releases)\n- [devpod-provider-digitalocean](https://github.com/loft-sh/devpod-provider-digitalocean/releases)\n- [devpod-provider-gcloud](https://github.com/loft-sh/devpod-provider-gcloud/releases)\n\nEach binary that is required is declared through:\n\n```yaml\nbinaries:\n  NAME:\n    - os: # Which OS is this specific binary\n      arch: # Binary arch\n      path: # Remote (URL) or local path to binary\n      checksum:  # sha sum of the binary\n      archivePath: # If its an archive, the relative path to the binary. Supported archives are .tgz, .tar, .tar.gz, .zip\n```\n\nWhen [Adding a provider](../managing-providers/add-provider.mdx), DevPod will\nmatch the binary for your OS and Arch and download the specific one for it.\n\nExample of the binary section in a `provider.yaml`:\n\n```yaml\nbinaries:\n  AWS_PROVIDER:\n    - os: linux\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-aws/releases/download/v0.0.1-alpha.15/devpod-provider-aws-linux-amd64\n      checksum: d1e774419d90c3ed399963d9322d57bfdcee189767eabb076a2c2e926bfd9b8b\n    - os: linux\n      arch: arm64\n      path: https://github.com/loft-sh/devpod-provider-aws/releases/download/v0.0.1-alpha.15/devpod-provider-aws-linux-arm64\n      checksum: fa15c13e3f0619170d002f9dae3ef41c9949a4595a71c5efe364d89ada604cec\n    - os: darwin\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-aws/releases/download/v0.0.1-alpha.15/devpod-provider-aws-darwin-amd64\n      checksum: fb89d41f6ce3e01e953f3ffd18f85bd5a42dd633abafd5d586dc9d9b1322166c\n    - os: darwin\n      arch: arm64\n      path: https://github.com/loft-sh/devpod-provider-aws/releases/download/v0.0.1-alpha.15/devpod-provider-aws-darwin-arm64\n      checksum: 82b6713069fa061ea59941600ed32a15f73806a9af3074d67a20ed367d18b2aa\n    - os: windows\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-aws/releases/download/v0.0.1-alpha.15/devpod-provider-aws-windows-amd64.exe\n      checksum: 49bd899d439f38d4e8647102db1c18b7a0d5242b3c09c89071b20a5444e20a81\n```\n\n### Binary Checksum\n\nEach binary is also verified over an expected checksum. This is important to\nensure that whatever binary is declared in `provider.yaml` is indeed executed on\nthe machine.\n\n## Use binaries in commands\n\nDevPod will make the binary path available through an environment variable within the exec section. For example:\n\n```yaml\nbinaries:\n  MY_BINARY:\n    ....\n\nexec:\n  init: ${MY_BINARY} init\n  ....\n```\n\n## Use binaries in options\n\nYou can also use binaries within the option `command` attribute. For example:\n\n ```yaml\n binaries:\n   MY_BINARY:\n     ....\n\n options:\n   MY_OPTION:\n     command: ${MY_BINARY} retrieve-option\n ```\n\n## Use binaries on the agent side\n\nYou can also define binaries DevPod should install on the agent side through `agent.binaries`. These binaries can then be used within the `agent.exec` section to automatically stop a virtual machine if inactive.\nFor example:\n\n```yaml\nagent:\n  path: ${AGENT_PATH}\n  binaries:\n    GCLOUD_PROVIDER:\n      - os: linux\n        arch: amd64\n        path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-linux-amd64\n        checksum: 38f92457507563ee56ea40a2ec40196d12ac2bbd50a924d76f55827e96e5f831\n      - os: linux\n        arch: arm64\n        path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-linux-arm64\n        checksum: 48e8dfa20962f1c3eb1e3da17d57842a0e26155df2b94377bcdf5b8070d7b17e\n  exec:\n    shutdown: |-\n      ${GCLOUD_PROVIDER} stop --raw\n```\n\n\n\n"
  },
  {
    "path": "docs/pages/developing-providers/driver.mdx",
    "content": "---\ntitle: Drivers\nsidebar_label: Drivers\n---\n\nIn DevPod you can specify a **Driver** in the [Agent's configuration](./agent.mdx).\n\nA Driver indicates how DevPod deploys the workspace container.\n\nThere are two types of drivers:\n\n- Docker driver\n- Kubernetes driver\n\n:::info\nIf no driver is specified, the default is **Docker**\n:::\n\n## Docker Driver\n\nThe Docker driver is the default driver that DevPod uses to deploy the workspace container.\n\nThis container (specified through a [devcontainer.json](../developing-in-workspaces/devcontainer-json.mdx)),\nis executed through Docker inside the provider environment, for example in a VM [in case of Machine Providers](../managing-providers/what-are-providers.mdx).\n\nSome optional configs are available:\n\n- **path**: where to find the Docker CLI or a replacement, such as the Podman\n- **install**: whether to install Docker or not in the target environment\n\nExample config:\n\n```yaml\nagent:\n  containerInactivityTimeout: 300\n  docker:\n    path: /usr/bin/docker\n    install: false\n```\n\n## Kubernetes Driver\n\nInstead of Docker, DevPod is also able to use Kubernetes as a Driver, which allows you to deploy the workspace to a Kubernetes cluster instead.\nFor example, this makes it possible to create a provider that spins up a remote Kubernetes cluster (or just a namespace), connect to it, and create a workspace there.\nDevPod also has a default Kubernetes provider that uses the local Kubernetes config file to deploy the workspace.\n\nDevPod also allows building an image through Kubernetes with [buildkit](https://github.com/moby/buildkit).\nDevPod will automatically determine if building is necessary or if a prebuild can be used. However, the `buildRepository` option needs to be specified for this to work.\n\nThe allowed options for the Kubernetes driver are:\n- **path**: where to find the `kubectl` binary or a drop-in replacement\n- **namespace**: which namespace to use (if empty will use current namespace or default)\n- **context**: which kube context to use (if empty will use current kube context)\n- **config**: path to which kube config to use (if empty will use default kube config at `~/.kube/config`)\n- **clusterRole**: If defined, DevPod will create a role binding for the given cluster role for the workspace container. This is useful if you need Kubernetes access within the workspace container\n- **serviceAccount**: If defined, DevPod will use the given service account for the dev container\n- **buildRepository**: If defined, DevPod will build and push images to the given repository. If empty, DevPod will not build any images. Make sure you have push permissions for the given repository locally.\n- **helperImage**: The image DevPod will use to find out the cluster architecture. Defaults to alpine.\n- **buildkitImage**: The buildkit image to use for building dev containers.\n- **buildkitPrivileged**: If the buildkit pod should run as a privileged pod\n- **persistentVolumeSize**: The default size for the persistent volume to use.\n- **createNamespace**: If true, DevPod will try to create the namespace\n\n### Example Kubernetes Provider\n\nExample Kubernetes provider that uses local kubectl to run a workspace in the current kube context:\n\n```yaml\nname: simple-kubernetes\nversion: v0.0.1\nagent:\n  containerInactivityTimeout: 300 # Pod will automatically kill itself after timeout\n  path: ${DEVPOD}\n  driver: kubernetes\n  kubernetes:\n    # path: /usr/bin/kubectl\n    # namespace: my-namespace-for-devpod\n    # context: default\n    # clusterRole: \"\"\n    # serviceAccount: \"\"\n    buildRepository: \"ghcr.io/my-user/my-repo\"\n    # helperImage: \"ubuntu:latest\"\n    # buildkitImage: \"moby/buildkit\"\n    # buildkitPrivileged: false\n    persistentVolumeSize: 20Gi\n    createNamespace: true\nexec:\n  command: |-\n    ${DEVPOD} helper sh -c \"${COMMAND}\"\n```\n\nThen add the provider via `devpod provider add ./simple-kubernetes.yaml`\n"
  },
  {
    "path": "docs/pages/developing-providers/options.mdx",
    "content": "---\ntitle: Provider Options\nsidebar_label: Provider Options\n---\n\nInside the [`provider.yaml`](./quickstart.mdx#provideryaml), you can specify options\nthat DevPod can pass to the provider when calling it.\nEach option will be passed as an environment variable to the commands or can be used directly inside the `agent` section of a provider.\n\n```yaml\n...\n...\noptions:\n  MY_OPTION_NAME:\n    description: \"this is my option\"\n    default: \"default_value\"\n    required: false\n    password: true\n...\n...\n```\n\n## How options work\n\nOptions are variables needed for the provider to function properly, for example:\n\n- User Accounts\n- VMs images\n- VMs sizes\n- Account region\n\nThese options are parsed and validated by DevPod when [Adding the provider](../managing-providers/add-provider.mdx)\nand passed to the provider as **environment variables**.\n\nIt's the provider's job to retrieve them from the environment and validate them.\nIt's recommended to make use of the `init` command that will be called by DevPod when options change to validate environment variables on the provider side.\n\nYou can check our example in the [Devpod's AWS Provider](https://github.com/loft-sh/devpod-provider-aws/blob/main/pkg/options/options.go#L44)\nwhere we parse and validate the variables:\n\n```go\n...\n    diskSizeGB, err := fromEnvOrError(\"AWS_DISK_SIZE\")\n    if err != nil {\n        return nil, err\n    }\n\n    retOptions.DiskSizeGB, err = strconv.Atoi(diskSizeGB)\n    if err != nil {\n        return nil, err\n    }\n...\n```\n\nOptions will also be passed to the agent and can be used in the `agent.exec` section. This is very useful if you require certain information on the agent side to perform an auto-inactivity timeout.\n\n### Option configuration\n\nEach option has a set of attributes that can modify how DevPod interprets it when\nconfiguring or adding the provider:\n\n- `description`: Description shown in `devpod provider options` and in the Desktop App\n- `default`: Default value of the option provided as a string. Can also reference other variables, e.g. `${MY_OTHER_VAR}-suffix`\n- `required`: Boolean if this option needs to be non-empty before using the provider. DevPod will ask in the CLI and make sure that this option is filled in the Desktop application.\n- `password`: Boolean to indicate this is a sensitive value. Prevents this value from showing up in the `devpod provider options` command and will be a password field in the Desktop application.\n- `suggestions`: An array of suggestions for this option. Will be shown as auto complete options in the DevPod desktop application\n- `command`: A command to retrieve the option value automatically. Can also reference other variables in the command, e.g. `echo ${MY_OTHER_VAR}-suffix`. For compatibility reasons, this command will be executed in an emulated shell on Windows.\n- `local`: If true, the option will be filled individually for each machine / workspace\n- `global`: If true, the option will be reused for each machine / workspace\n- `cache`: If non-empty, DevPod will re-execute the command after the given timeout. E.g. if this is 5m, DevPod will re-execute the command after 5 minutes to re-fill this value. This is useful if you want to store a token or something that expires locally in a variable.\n- `hidden`: If true, DevPod will not show this option in the Desktop application or through `devpod provider options`. Can be used to calculate variables internally or save tokens or other things internally.\n\n### Default values\n\nAs the name implies, this is a default value for the option. It is always advisable\nto place a sensible default for any option.\n\nYou can also reference other options inside the default value, e.g. `${MY_OTHER_VAR}-suffix`. DevPod will automatically figure out what options need to be resolved before this option.\n\n**If not specified, it defaults to an empty string**.\n\n### Required options\n\nIf an option is required, and no default is set, DevPod will prompt the user for\na value when adding the provider.\n\nIn the DevPod Desktop App, the required options will be displayed and prompted\nright in the Provider's \"Add\" page.\n\n**If not specified, it defaults to false**.\n\n### Password options\n\nIf specified and true, the option's value will be treated as a secret, so it\nwon't be shown when listing options.\n\nExample:\n\n```sh\n~$ adevpod provider options civo\n\n          NAME            | REQUIRED |          DESCRIPTION           |               DEFAULT                |                VALUE\n----------------------------+----------+--------------------------------+--------------------------------------+---------------------------------------\nAGENT_PATH                | false    | The path where to inject the   | /var/lib/toolbox/devpod              | /var/lib/toolbox/devpod\n                          |          | DevPod agent to.               |                                      |\nCIVO_API_KEY              | true     | The civo api key to use        |                                      | ********\nCIVO_DISK_IMAGE           | false    | The disk image to use.         | d927ad2f-5073-4ed6-b2eb-b8e61aef29a8 | d927ad2f-5073-4ed6-b2eb-b8e61aef29a8\n\n...\n```\n\n**If not specified, it defaults to false**.\n\n### Options suggestions\n\nSuggestions are a list of possible values for the option. Suggested use-cases\ncould be for regions/locations, VM sizes, etc...\n\n:::info\nThis option is specifically for the DevPod desktop application, suggestions won't\nbe shown in the CLI app.\n:::\n\n**If not specified, it defaults to empty and ignored**.\n\n### Command options\n\nThe command option lets you define a possible value for an option based on a shell\ncommand launched on your machine. Can also reference other variables in the command, e.g. `echo ${MY_OTHER_VAR}-suffix`. For compatibility reasons, this command will be executed in an emulated shell on Windows.\n\nOne example would be to forward ENV variables from your machine to the provider,\nfor example:\n\n\n```yaml\n  AWS_ACCESS_KEY_ID:\n    description: The aws access key id\n    required: false\n    command: printf \"%s\" \"${AWS_ACCESS_KEY_ID:-}\"\n  AWS_SECRET_ACCESS_KEY:\n    description: The aws secret access key\n    required: false\n    command: printf \"%s\" \"${AWS_SECRET_ACCESS_KEY:-}\"\n```\n\nOr running an helper command (defined in the binaries section), and forwarding the result as the option's value:\n\n```yaml\n  AWS_TOKEN:\n    local: true\n    hidden: true\n    cache: 5m\n    description: \"The AWS auth token to use\"\n    command: |-\n      ${AWS_PROVIDER} token\n```\n\n**If not specified, it defaults to empty and ignored**.\n\n## Built-In Options\n\nThere are a couple of predefined options from DevPod, that can be used within the default field of another option or in an option command. Some built-in options are only available for `local` options as the `MACHINE_ID` might not be available already.\nPredefined options:\n- **DEVPOD**: Absolute path to the current DevPod CLI binary. Can be used to call a helper function within DevPod or any other DevPod command. Also available on the agent side.\n- **DEVPOD_OS**: Current Operating system. Can be either: linux, darwin or windows\n- **DEVPOD_ARCH**: Current operating system architecture. Can be either: amd64 or arm64.\n- **MACHINE_ID**: The machine id that should be used. (Only available for local options, commands and machine providers)\n- **MACHINE_FOLDER**: The machine folder that can be used to cache information locally. (Only available for local options, commands and machine providers)\n- **MACHINE_CONTEXT**: The DevPod context this machine was created in. (Only available for local options, commands and machine providers)\n- **MACHINE_PROVIDER**: The provider name that was used to create this machine. (Only available for local options, commands and machine providers)\n- **WORKSPACE_ID**: The workspace id that should be used. (Only available for local options, commands and non-machine providers)\n- **WORKSPACE_FOLDER**: The workspace folder that can be used to cache information locally. (Only available for local options, commands and non-machine providers)\n- **WORKSPACE_CONTEXT**: The DevPod context this workspace was created in. (Only available for local options, commands and non-machine providers)\n- **WORKSPACE_PROVIDER**: The provider name that was used to create this workspace. (Only available for local options, commands and non-machine providers)\n- **PROVIDER_ID**: The provider name. (Only available for local options, commands and non-machine providers)\n- **PROVIDER_CONTEXT**: The provider context. (Only available for local options, commands and non-machine providers)\n- **PROVIDER_FOLDER**: The provider folder where the provider config is saved in, can be used to save global information about the provider such as global session tokens etc. (Only available for local options, commands and non-machine providers)\n\n## Option Groups\n\n:::info\nThis section is specifically for organizing options in the DevPod Desktop app.\nThis has no effect on the CLI app.\n:::\n\nYou can organize your options in groups, for example:\n\n```yaml\noptionGroups:\n  - options:\n      - AWS_ACCESS_KEY_ID\n      - AWS_SECRET_ACCESS_KEY\n      - AWS_AMI\n      - AWS_DISK_SIZE\n      - AWS_INSTANCE_TYPE\n      - AWS_VPC_ID\n    name: \"AWS options\"\n    defaultVisible: true\n  - options:\n      - AGENT_PATH\n      - INACTIVITY_TIMEOUT\n      - INJECT_DOCKER_CREDENTIALS\n      - INJECT_GIT_CREDENTIALS\n    name: \"Agent options\"\n    defaultVisible: false\n```\n\nOptions are easily grouped by listing them, each group has a `name` and a\n`defaultVisible` property, which is **false by default**.\nIf `defaultVisible` is false, then an user will need to manually expand the option\ngroup in the Desktop App.\n"
  },
  {
    "path": "docs/pages/developing-providers/quickstart.mdx",
    "content": "---\ntitle: Quickstart Guide\nsidebar_label: Quickstart\n---\n\nOn this page we will cover all the basics to develop a functional provider for DevPod.\n\n:::info Recommended Reading\nBefore starting, it's best if you have already taken a look at [What are providers](../managing-providers/what-are-providers.mdx)\nand [How to manage them](../managing-providers/add-provider.mdx).\n:::\n\n:::info Provider Examples\nAnother good starting point are the official DevPod providers specified at [Add Provider](../managing-providers/add-provider.mdx)\n:::\n\nA very basic provider that reuses local Docker to spin up workspaces would look like this:\n```yaml\nname: my-first-provider  # Required name of the provider\nversion: v0.0.1          # Required version of the provider\nagent:                   # DevPod Agent options\n  path: ${DEVPOD}        # Path to the current DevPod binary\nexec:\n  # Command specifies how to run a command in the environment.\n  # In this case we want to reuse the local environment, so we just execute the command in a local shell.\n  command: |-\n    sh -c \"${COMMAND}\"\n```\n\nYou can save this provider to a file called `provider.yaml` and then add it via:\n```\ndevpod provider add ./path/to/provider.yaml\n```\n\nThen try to start a new workspace with:\n```\ndevpod up github.com/microsoft/vscode-remote-try-go\n```\n\n## Developing a DevPod provider\n\nDevPod providers are small CLI programs defined through a `provider.yaml` that DevPod interacts with, in order to bring up the workspace.\n\nProviders are standalone programs that DevPod will call, parsing a **manifest**\ncalled `provider.yaml` that will instruct DevPod on how to interact with the program. The most important sections of a `provider.yaml` are:\n* [exec](#how-devpod-interacts-with-a-provider): Defines what commands DevPod should execute to interact with the environment\n* [options](./options.mdx): Defines what Options the user can configure in the provider\n* [binaries](./binaries.mdx): Defines what additional helper binaries are required to run the provider\n* [agent](./agent.mdx): Defines configuration options for the provider such as drivers, auto-inactivity timeout and credentials injection\n\n## Provider.yaml\n\nWith the `provider.yaml`, DevPod will know how to call the provider's binary, in order\nto perform all the required actions to bring up or down an environment for a workspace.\n\nFollowing is a minimal example manifest for a provider:\n\n```yaml\nname:  name-of-provider\nversion: version-number\ndescription: quick description # Optional\nicon: https://url-to-icon.com  # Shown in the Desktop App\noptions:\n  # Options for the provider, DevPod will pass these as\n  # ENV Variables when calling the provider\n  OPTION_NAME:\n    description: \"option description\"\n    default: \"value\"\n    required: true # or false\n  AGENT_PATH:\n    description: The path where to inject the DevPod agent to.\n    default: /opt/devpod/agent\nagent:\n  path: ${AGENT_PATH}\nexec:\n  command: # Required: a command to execute on the remote machine or container\n  init:    # Optional: a command to init the provider, login to an account or similar\n  create:  # Optional: a command to create the machine\n  delete:  # Optional: a command to delete the machine\n  start:   # Optional: a command to start the machine\n  stop:    # Optional: a command to stop the machine\n  status:  # Optional: a command to get the machine's status\nbinaries:  # Optional binaries DevPod should download for this provider\n  MY_BINARY: # Will be available as MY_BINARY environment variable in the exec section\n    ...\n```\n\n### How DevPod interacts with a provider\n\nDevPod uses the `exec` section within the `provider.yaml` to know what commands it needs to execute to interact with the provider environments.\nThese \"commands\" are regular POSIX shell scripts that call a helper program or directly interact with the underlying system of the user to manage the environment.\n\nIn the `exec` section of the `provider.yaml`, the following commands are allowed:\n\n- **command**: The only command that is required for a provider to work, which defines how to run a command in the environment. DevPod will use this command to inject itself into the environment and route all communication through the commands standard output and input. An example for a local development provider would be: `sh -c \"${COMMAND}\"`.\n- **init**: Optional command to check if options are defined correctly and the provider is ready to create environments. For example for the Docker provider, this command checks if Docker is installed and reachable locally.\n- **create**: Optional command how to create a machine. If this command is defined, the provider will automatically be treated as a machine provider and DevPod will also expect **delete** to be defined.\n- **delete**: Optional command how to delete a machine. Counter command to **create**.\n- **start**: Optional command how to start a stopped machine. Only usable for machine providers.\n- **stop**: Optional command how to stop a machine. Only usable for machine providers.\n- **status**: Optional command how to retrieve the status of a machine. Expects one of the following statuses on standard output:\n  - Running: Machine is running and ready\n  - Busy: Machine is doing something and DevPod should wait (e.g. terminating, starting, stopping etc.)\n  - Stopped: Machine is currently stopped\n  - NotFound: Machine is not found\n\n:::info Windows Compatibility\nDevPod will execute these commands on Unix systems directly in a POSIX shell, while on Windows in an [emulated shell](https://github.com/mvdan/sh) to provide compatibility. However, not all commands, such as `grep`, `sed` etc. are available there and if needed, such functionality should be transferred to a small helper binary DevPod can download and install through the binaries section.\n:::\n\nFor example, taking the [SSH Provider](https://github.com/loft-sh/devpod-provider-ssh):\n\n```yaml\nexec:\n  init: |-\n    OUTPUT=$(ssh -oStrictHostKeyChecking=no \\\n                 -p ${PORT} \\\n                 ${EXTRA_FLAGS} \\\n                 \"${HOST}\" \\\n                 'sh -c \"echo DevPodTest\"')\n\n    if [ \"$OUTPUT\" != \"DevPodTest\" ]; then\n      >&2 echo \"Unexpected ssh output.\"\n      >&2 echo \"Please make sure you have configured the correct SSH host\"\n      >&2 echo \"and the following command can be executed on your system:\"\n      >&2 echo ssh -oStrictHostKeyChecking=no -p \"${PORT}\" \"${HOST}\" 'sh -c \"echo DevPodTest\"'\n      exit 1\n    fi\n\n  command: |-\n    ssh -oStrictHostKeyChecking=no \\\n        -p ${PORT} \\\n        \"${EXTRA_FLAGS}\" \\\n        \"${HOST}\" \\\n        \"${COMMAND}\"\n```\n\nThe **init** is used to perform actions in order to verify and validate the options\npassed (in this case try a dummy command on the selected host)\n\nThe **command** is used to access the remote environment. `${COMMAND}` will be supplied by DevPod and is a placeholder for the command DevPod will execute.\nIn case of [Machines providers](../managing-providers/what-are-providers.mdx) this will\nusually have to SSH on the VMs created.\n\n### Non-Machine provider\n\nFor Non-Machine providers that don't want to manage any machine lifecycle, the available commands that can be used are:\n- command\n- init (optional)\n\n### Machine provider\n\nFor Machine Providers, you can use all of the commands in order to guarantee a full VMs lifecycle management.\n\n### Options\n\nThe Options section is a set of OPTION_NAME and values that DevPod will inject in\nthe environment when calling the provider's commands.\n\nHead over to the [Options Page](./options.mdx) to know more about how to set them up\n\n### Agent\n\nOne important part of the lifecycle management of the DevPod's provider's resources is the **Agent**.\nThe agent is a helper that DevPod will inject into the workspace in order to perform utilities like:\n\n- auto-shutdown the VM after inactivity\n- inject git credentials\n- inject docker credentials\n\nHead over to the [Agent page](./agent.mdx) to know more about the agent setup.\n\n### Binaries\n\nDevPod allows you to install additional binaries that help you to create cloud resources or access these. For example, the Google Cloud provider installs its own binary via:\n```yaml\n...\nbinaries:\n  GCLOUD_PROVIDER:\n    - os: linux\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-linux-amd64\n      checksum: 38f92457507563ee56ea40a2ec40196d12ac2bbd50a924d76f55827e96e5f831\n    - os: linux\n      arch: arm64\n      path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-linux-arm64\n      checksum: 48e8dfa20962f1c3eb1e3da17d57842a0e26155df2b94377bcdf5b8070d7b17e\n    - os: darwin\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-darwin-amd64\n      checksum: 43ee6ecb7855d282a0512ccf6055cce029895f173beb95a8c442f77560d26678\n    - os: darwin\n      arch: arm64\n      path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-darwin-arm64\n      checksum: c2c2d57c5d48f22814f2393f61fd6a78bdc2cde7eabc3faffd8f35eaceec4422\n    - os: windows\n      arch: amd64\n      path: https://github.com/loft-sh/devpod-provider-gcloud/releases/download/v0.0.1-alpha.10/devpod-provider-gcloud-windows-amd64.exe\n      checksum: 9b81ec48c849f222aaf30f0cb85057d4e6619d1c0f787b27925c8b8adb431a58\nexec:\n  init: ${GCLOUD_PROVIDER} init\n  command: ${GCLOUD_PROVIDER} command\n  create: ${GCLOUD_PROVIDER} create\n  delete: ${GCLOUD_PROVIDER} delete\n  start: ${GCLOUD_PROVIDER} start\n  stop: ${GCLOUD_PROVIDER} stop\n  status: ${GCLOUD_PROVIDER} status\n```\n\nYou can find more information on the [Provider binaries](./binaries.mdx) page."
  },
  {
    "path": "docs/pages/fragments/add-provider.mdx",
    "content": "\nAdd a provider via 'Providers' > '+ Add'. Select a provider and select 'Continue'.\n\n<figure>\n  <img src=\"/docs/media/add-provider-1.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select Provider</figcaption>\n</figure>\n\nAfter selecting a provider, fill out the options (if necessary) and click on 'Add Provider'\n\n<figure>\n  <img src=\"/docs/media/add-provider-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>Add Provider</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/fragments/setup-virtualbox.mdx",
    "content": "\n## Install Virtualbox\n\n### Recommended machine requirements\n\nBased on [Virtualbox](https://www.virtualbox.org/wiki/End-user_documentation) and \n[Ubuntu Desktop](https://ubuntu.com/download/desktop) documentation the following are the\nminimum machine requirement:\n\n| Item | Minimum requirement|\n|---|---|\n| CPU | dual core CPU |\n| RAM | 8GB |\n| Storage | 30GB |\n| Network Connectivity | access to public internet |\n\n### Virtualbox Installer\n\nDownload and install [Virtualbox](https://www.virtualbox.org/wiki/Downloads) on your machine."
  },
  {
    "path": "docs/pages/fragments/virtualbox-ubuntu-22.04.mdx",
    "content": "\n\n## Create Ubuntu 22.04 Virtual machine\n\n### Download Ubuntu Desktop 22.04 ISO\n\nDownload the official ISO for [Ubuntu 22.04](https://ubuntu.com/download/desktop).\n\n### New Ubuntu 22.04 Virtual machine\n\nWith Virtualbox running, open the a new Virtual machine dialog. 'machine' > 'new ...'\n\n### New Virtual Machine dialog\n\n#### Step 1 - Virtual Machine Name and Operating System\n\n| Input | Suggested Value |\n|---|---|\n| Name | ubuntu-desktop-22.04 (name used through this example) |\n| Folder | default value is suitable in most cases |\n| ISO Image | browse to the path of the downloaded ubuntu 22.04 ISO |\n| Skip unnattended installation | true / ticked (this setup sudo group during installation) |\n\nSelect 'Next'\n\n#### Step 2 - Hardware\n\n| Input | Suggested Value |\n|---|---|\n| Name | ubuntu-desktop-22.04 (name used through this example) |\n| Base Memory | 8192 MB (minimum recommended) |\n| Processors | 2 CPU (minimum recommended) |\n\nSelect 'Next'\n\n#### Step 3 - Virtual Hard Disk\n\n| Input | Suggested Value |\n|---|---|\n| Name | ubuntu-desktop-22.04 (name used through this example) |\n| Create a new hard disk now | 30 GB (minimum recommended) |\n\nSelect 'Next'\n\n#### Step 4 - Summary\n\nReview the configuration summary and click 'Finish' to commence creating the VM.\n\n### Start installation\n\nTo start the Ubuntu installation, select the vm 'ubuntu-desktop-22.04' and 'Start'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-start-vm.png\" alt=\"Virtualbox Start\" />\n  <figcaption>Virtualbox Start</figcaption>\n</figure>\n\nThis will power up the VM and trigger Ubuntu's installation process.\n\n#### Step 1 - Ubuntu CLI Selection\n\nSelect 'Try/Install Ubuntu'\n\n#### Step 2 - Install\n\nSelect Language and Install Ubuntu\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-install-ubuntu.png\" alt=\"Install Ubuntu\" />\n  <figcaption>Install Ubuntu</figcaption>\n</figure>\n\n#### Step 3 - Keyboard Layout\n\nSelect your desired Keyboard layout, select 'Continue'.\n\n#### Step 3 - Update and Other Software\n\n| Input | Suggested Value |\n|---|---|\n| Name | ubuntu-desktop-22.04 (name used through this example) |\n| Normal or Minimal Installation  | Minimal Installation |\n| Download updates will installing Ubuntu  | yes |\n| Install third party software for graphics and WI-FI hardware and additional media formats | yes (adds closed source drivers and software that can't be included in Ubuntu). You need to understand the consequences of this option for your personal needs. |\n\n#### Step 4 - Installation Type\n\nSelect 'Erase disk and install Ubuntu', click 'Install Now'\n\nWrite the changes to disks?. Select 'Continue'\n\n#### Step 5 - Where are you?\n\nSelect your location, click 'Continue'\n\n#### Step 6 - Who are you?\n\n| Input | Suggested value |\n|---|---|\n| Your name | dev |\n| Your computer's name | devpods |\n| Pick a username | dev |\n| Choose password | your password |\n| Confirm your password | your password |\n\nSelect 'Continue'\n\n\n\n\n\n\n"
  },
  {
    "path": "docs/pages/getting-started/install.mdx",
    "content": "---\ntitle: Install DevPod\nsidebar_label: Install DevPod\n---\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\nimport CodeBlock from '@theme/CodeBlock';\n\nTo get started with DevPod, choose either the [DevPod Desktop](#install-devpod) application or the [DevPod CLI](#install-devpod-cli).\n\n## Install DevPod\n\nDownload DevPod Desktop:\n- [MacOS Silicon/ARM](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_macos_aarch64.dmg)\n- [MacOS Intel/AMD](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_macos_x64.dmg)\n- [Windows](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_windows_x64_en-US.msi)\n- [Linux AppImage](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_linux_amd64.AppImage)\n- [Linux Targz](https://github.com/loft-sh/devpod/releases/latest/download/DevPod_linux_x86_64.tar.gz)\n\n:::info Previous Releases\nFor earlier versions, visit the [GitHub releases page](https://github.com/loft-sh/devpod/releases)\n:::\n\n:::info Linux Packages\n**The official package is the Appimage**, it has been tested working on:\n\n- Debian 12 and newer\n- Ubuntu 22.04 and newer\n- Fedora 36 and newer\n- Opensuse Leap 15.3 and newer\n- Opensuse Tumbleweed\n- Archlinux\n\nMake sure you have the following dependencies installed for the Appimage to work (usually already installed in desktop distributions):\n\n- glibc version 2.35+\n- fuse2, fuse2 libraries, libopengl, libfribidi, libegl, libxgl\n    - `sudo apt-get install fuse libfuse2 libopengl0 libfribidi0 libgles2-mesa`\n    - `sudo dnf install fuse fuse-libs libglvnd-egl libglvnd-opengl libglvnd-glx harfbuzz fontconfig fribidi libthai`\n    - `sudo zypper in fuse libfuse2 libharfbuzz0 libfribidi0 libthai0`\n\nThese are generally needed for AppImage to work; they are not specific to DevPod.\n:::\n\n:::info Windows Packages\nMake sure you have the following dependencies installed for the Desktop App to work:\n\n- [WebView 2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/?form=MA13LH)\n\nNote that WebView 2 is normally already installed on recent versions of Windows and should not need installing unless you experience issues.\n:::\n\n:::info Linux Custom Packages\nSince we're not providing deb or rpm packages anymore, we're now providing a tar.gz\nthat can be used as source for your custom package.\n\nKeep in mind the following dependencies need to be declared in the package for the\ncorrect functioning of the program:\n\n- libappindicator3-1\n- libgdk-pixbuf2.0-0\n- libbsd0\n- libxdmcp6\n- libwmf-0.2-7\n- libwmf-0.2-7-gtk\n- libgtk-3-0\n- libwmf-dev\n- libwebkit2gtk-4.1-0\n- librust-openssl-sys-dev\n- librust-glib-sys-dev\n\nOn Fedora: `sudo dnf install libappindicator-gtk3`\n:::\n\n## Install DevPod CLI\n\nAlternatively, you can also use the CLI instead of the desktop application. The DevPod CLI is useful for managing DevPod directly from a terminal. Choose an installation method below, or install it later from the Desktop App.\"\n\n<Tabs values={[\n          {label: 'MacOS Silicon/ARM', value: 'macarm64'},\n          {label: 'MacOS Intel/AMD', value: 'macamd64'},\n          {label: 'Windows', value: 'windows'},\n          {label: 'Linux AMD', value: 'linuxamd'},\n          {label: 'Linux ARM', value: 'linuxarm'},\n        ]}>\n<TabItem value=\"macarm64\">\n\n```bash\ncurl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-darwin-arm64\" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod\n```\n\n</TabItem>\n<TabItem value=\"macamd64\">\n\n```bash\ncurl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-darwin-amd64\" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod\n```\n\n</TabItem>\n<TabItem value=\"windows\">\n\n```text\nmd -Force \"$Env:APPDATA\\devpod\"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';\nInvoke-WebRequest -URI \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-windows-amd64.exe\" -OutFile $Env:APPDATA\\devpod\\devpod.exe;\n$env:Path += \";\" + $Env:APPDATA + \"\\devpod\";\n[Environment]::SetEnvironmentVariable(\"Path\", $env:Path, [System.EnvironmentVariableTarget]::User);\n```\n\n</TabItem>\n<TabItem value=\"linuxamd\">\n\n```bash\ncurl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64\" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod\n```\n\n</TabItem>\n<TabItem value=\"linuxarm\">\n\n```bash\ncurl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-arm64\" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod\n```\n\n</TabItem>\n</Tabs>\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-devpod-cli.mdx",
    "content": "---\ntitle: Quickstart DevPod CLI\nsidebar_label: Quickstart DevPod CLI\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with DevPod CLI\n\nMake sure you have installed [DevPod CLI](./install.mdx#optional-install-devpod-cli) on your system.\n\n### Add a Provider\n\nYou can add a provider via (local-docker for example):\n\n```\ndevpod provider add docker\n```\n\n:::info Other providers\nFor more providers, please take a look at [Add a DevPod Provider](../managing-providers/add-provider.mdx)\n:::\n\n### Start a Workspace\n\nAfterwards you can start a workspace via:\n\n```\n# Start in VS Code browser\ndevpod up github.com/microsoft/vscode-remote-try-node --ide openvscode\n\n# Start in VS Code\ndevpod up github.com/microsoft/vscode-remote-try-node --ide vscode\n\n# Start without IDE\ndevpod up github.com/microsoft/vscode-remote-try-node --ide none\n```\n\nIf you have selected an IDE it should popup automatically. If not, you can connect to the workspace manually:\n\n```\nssh MY_WORKSPACE_NAME.devpod\n```\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-jetbrains.mdx",
    "content": "---\ntitle: Quickstart JetBrains (IntelliJ etc.)\nsidebar_label: Quickstart JetBrains (IntelliJ etc.)\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with JetBrains\n\nMake sure you have installed [DevPod](./install.mdx) on your system.\n\n### Install Prerequisites\n\nMake sure to install the following prerequisites:\n* [Jetbrains IDE](https://www.jetbrains.com/)\n* [Jetbrains Gateway](https://www.jetbrains.com/remote-development/gateway/)\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select a JetBrains IDE under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-jetbrains.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, JetBrains Gateway should automatically open with a prefilled form for the workspace.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>JetBrains Gateway opens automatically</figcaption>\n</figure>\n\nPress 'Check Connection and Continue' without changing any configuration. This should start the IDE in the workspace. After the IDE has been initialized, your JetBrains IDE should open up inside the workspace.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains-3.png\" alt=\"DevPod Flow\" />\n  <figcaption>IDE opens within the workspace</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-ssh.mdx",
    "content": "---\ntitle: Quickstart SSH\nsidebar_label: Quickstart SSH\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with SSH\n\nMake sure you have installed [DevPod](./install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with SSH\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'None' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-ssh.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-ssh.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, you can connect to the workspace via ssh:\n\n```\nssh MY_WORKSPACE_NAME.devpod\n```\n\n### Using environment variables in your .devcontainer.json\n\nIf you want to use env variables e.g. for dynamic control over container image version\nplease follow this instruction: [Environment variables in devcontainer.json](../developing-in-workspaces/environment-variables-in-devcontainer-json.mdx)\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-vim.mdx",
    "content": "---\ntitle: Quickstart Vim/Neovim\nsidebar_label: Quickstart Vim/Neovim\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with Vim/Nvim\n\nMake sure you have installed [DevPod](./install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with Vim/Neovim\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'None' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vim.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vim.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace.\nAfter the workspace was created, you have a two options to start coding in vim:\n\n#### Netrw/SCP\n\nVim/Neovim allow you to edit remote files using [Netrw](https://www.vim.org/scripts/script.php?script_id=1075). \nYou can connect it either from within vim `:e scp://[user@]machine[[:#]port]/path` or by starting vim with `vim scp://[user@]machine[[:#]port]/path`.\nWhen you open the workspace, the DevPod logs give you the user/machine combination you'll need to connect to the workspace, usually in the format of `WORKSPACE_NAME.devpod` \n\n#### Spinning up your vim config in the workspace\n\nSince DevPods target environment is a docker container, you can also ssh into it and install your vim/neovim configuration like you would on any new machine.\nTo connect to the workspace, run the command DevPod gives you after starting the workspace, usually `ssh WORKSPACE_NAME.devpod`.\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-vscode-browser.mdx",
    "content": "---\ntitle: Quickstart VS Code Browser\nsidebar_label: Quickstart VS Code Browser\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with VS Code Browser\n\nMake sure you have installed [DevPod](./install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with VS Code Browser\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'VS Code Browser' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vscode-browser.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically in the browser</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/getting-started/quickstart-vscode.mdx",
    "content": "---\ntitle: Quickstart VS Code\nsidebar_label: Quickstart VS Code\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with VS Code\n\nMake sure you have installed [DevPod](./install.mdx) on your system.\n\n### Install Prerequisites\n\nMake sure to install the following prerequisites:\n* [VS Code](https://code.visualstudio.com/download)\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with VS Code\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'VS Code' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vscode.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/getting-started/update.mdx",
    "content": "---\ntitle: Update DevPod\nsidebar_label: Update DevPod\n---\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\nimport CodeBlock from '@theme/CodeBlock';\n\n## DevPod Desktop\n\nDevPod desktop automatically checks for updates on GitHub every 15minutes.\nWhen an update will be available this popup will appear to confirm the update process:\n\n<figure>\n  <img src=\"/docs/media/devpod-update-available.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nThe update will continue in background. When it's done you'll be prompted to restart the application.\n\n<figure>\n  <img src=\"/docs/media/devpod-update-done.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nAt restart the application will be at latest version.\n\n## DevPod Desktop - alternative\n\nIf you installed DevPod using deb or rpm packages, you'll need to [download the\nnew package](https://github.com/loft-sh/devpod/releases/latest/), and install it using your package manager again.\n\n## Optional: Update DevPod CLI\n\nIf you just installed the CLI, you just need to download the latest version again\nto update.\n"
  },
  {
    "path": "docs/pages/how-it-works/building-workspaces.mdx",
    "content": "---\ntitle: How DevPod Builds Workspaces\nsidebar_label: Building workspaces\n---\n\nDevpod provides the ability to build workspaces by taking a devcontainer.json and a git repository to compile an OCI compliant image with everything you need to develop\nagainst using local tools.\n\n<figure>\n  <img src=\"/docs/media/c4_build.png\" alt=\"DevPod Architecture\" />\n  <figcaption>DevPod - Container Diagram</figcaption>\n</figure>\n\nIt does this by parsing the devcontainer.json, extracting the \"features\" and appending them as build stages to the base Dockerfile. The container is then built, depending on the driver\nthis could be docker, buildkit or kaniko and deployed with the configuration defined by your context. Optionally once the container is built, it can be pushed to a registry to cache for\nother developers or in case you rebuild your workspace later. See #tutorials/reduce-build-times.\n\n"
  },
  {
    "path": "docs/pages/how-it-works/deploy-k8s.mdx",
    "content": "---\ntitle: How it works using kubernetes\nsidebar_label: Deploying kubernetes\n---\n\nDevPod works the same with kubernetes as with Machines, the key difference is the secure tunnel is set up using the kubernetes control plane (e.g. kubectl ...) so an agent is not necessary\nto be run on the kubernetes node. Instead devpod-provider-kubernetes simply wraps the appropriate `kubectl` commands to start and connect a workspace using a devcontainer.\n\n<figure>\n  <img src=\"/docs/media/c4_k8s.png\" alt=\"DevPod Architecture\" />\n  <figcaption>DevPod - Container Diagram Kubernetes</figcaption>\n</figure>\n\nDevPod often has to build workspaces even when an \"image\" is specified in .devcontainer.json. This is because the devcontainer can contain \"features\" the cause the Dockerfile to be extended.\nWhen this happens, or simply when \"build\" is used in .devcontainer.json, DevPod deploys an init container to the workspace that uses kaniko to first build your image (see #tutorials/reduce-build-times\nfor more details on kaniko) then executes the container's entrypoint in the pod's main container. While building, if REGISTRY_CACHE has been specified in the context options, kaniko will download\nexisting build layers from the registry to reduce the overall build time.\n\n<figure>\n  <img src=\"/docs/media/c4_build_k8s.png\" alt=\"DevPod Architecture 2\" />\n  <figcaption>DevPod - Component Diagram Kubernetes Build Process</figcaption>\n</figure>"
  },
  {
    "path": "docs/pages/how-it-works/deploy-machines.mdx",
    "content": "---\ntitle: How it works using VMs\nsidebar_label: Deploying machines\n---\n\n\nIn DevPod, machines are the infrastructure that run your devcontainer. Providers like GCP, AWS, and DigitalOcean are considered \"machine\" providers because they first set up a virtual machine (VM) to host your container.\n \nWhen you start a workspace with DevPod, such as running `devpod up`, DevPod uses a selected provider and starts your devcontainer. \nIf the provider requires a virtual machine (VM), DevPod determines whether to create one. It uses your local environment's credentials and the corresponding CLI tool (e.g., `aws` for AWS or `az` for Azure) to set up the VM. \nOnce the VM is running, DevPod connects to it through the provider's secure tunnel. Below are examples of providers and their secure tunnels.\n\n- AWS: [Instance Connect](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html)\n- Google Cloud (GCP): [Cloud IAP (Identity-Aware Proxy)](https://cloud.google.com/security/products/iap)\n- Azure: [Azure Bastion](https://learn.microsoft.com/en-us/azure/bastion/bastion-overview)\n\n:::note\nAlternatively, you can use [SSH tunneling](https://www.ssh.com/academy/ssh/tunneling-example) to connect to your machines, if supported by your setup.\n::: \n\nThe dedvpod agent starts a SSH server using the STDIO of the secure tunnel in order for you local DevPod CLI/UI to forward ports over the SSH connection. Once this is done DevPod starts your local \nIDE and connects it to the devcontainer via SSH.\n\n<figure>\n  <img src=\"/docs/media/c4_machines.png\" alt=\"DevPod Architecture\" />\n  <figcaption>DevPod - Component Diagram</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/how-it-works/deploying-workspaces.mdx",
    "content": "---\ntitle: How DevPod Deploys Workspaces\nsidebar_label: Deploying workspaces\n---\n\nDevpod deploys workspaces using the \"up\" command, when executed DevPod builds a devcontainer, if not already available, then uses the provider to deploy the devcontainer to a workspace. Below is a sequence diagram\nof the main stages of the \"up\" command.\n\n<figure>\n  <img src=\"/docs/media/up_sequence.png\" alt=\"DevPod Up Sequence\" />\n  <figcaption>DevPod up - Sequence Diagram</figcaption>\n</figure>\n\nFirst DevPod checks if we need to create/start a machine to deploy the devcontainer to. Next we pull the source code and .devcontainer.json source from git or a local file and use this with the local environment\nto build the workspace. Building is done by the agent since we need access to build tools such as buildkit or kaniko, i.e. `devpod workspace build`. The workspace now contains everything needed, \nso DevPod sets up a SSH connection to the DevPod agent running alongside the container's control plane. \n\nThe agent recieves \"devpod agent workspace up\" with the workspace spec serialised as workspace-info and uses the control plane (kube api server for k8s, docker daemon for anything else) to start the devcontainer. \nOnce started DevPod deploys a daemon to monitor activity, optionally sets up any platform access for pro users then optionally retrieves credentials from the local environment before launching the IDE. Once the \nIDE has started the deployment process has complete, DevPod's agent daemon will continue to monitor the pod, if deployed, to put the machine or container to sleep when not in use."
  },
  {
    "path": "docs/pages/how-it-works/overview.mdx",
    "content": "---\ntitle: How it works\nsidebar_label: Overview\n---\n\nDevpod provides the ability to provision workspaces on any infrastructure. It does so by wrapping your conventional CLI tools such as kubectl, docker, gcloud etc to deploy your development environment \nand set up everything required to run the dev container. While creating the workspace DevPod deploys an agent to the machine running the container as well as to the container itself to provide useful \nfunctions such as port forwarding, credential forwarding and log streaming. Doing so it provides a control plane across your development environment.\n\nDevpod uses a client-agent architecture, where the client deploys it's own agent to host various servers, such as a grpc server or SSH server. \nIn this regard the system is not unlike a browser server architecture where the front end is deployed and executed on a remote host. There are several improvements this brings to our specific context:\n - There can be no conflict of versions between client and server, since you install only one version of the client\n - There is no infrastructure to manage for users\n \nTo simplify debugging, DevPod connects your local shell with the agent's STDIO so you can see what's happening locally and in the container at all times.\n\nBelow is a high level overview of how DevPod uses your local environment, a source repo and a devcontainer to deploy your workspace to the cloud.\n\n<figure>\n  <img src=\"/docs/media/c4_workspaces.png\" alt=\"DevPod Architecture\" />\n  <figcaption>DevPod - Component Diagram</figcaption>\n</figure>\n\nDevpod establishes a connection to the workspace using a vendor specific API. This vendor specific communication channel is referred to as the \"tunnel\".  When you run a `devpod up` command, DevPod selects a \nprovider based on your context and starts your devcontainer. If using a machine provider, DevPod will check if it should create a VM first. Once the devcontainer\nis running DevPod deploys an agent to the container. The way in which DevPod communicates with the workspace depends on the provider, this is known as the \"tunnel\". For AWS this could be instance connect, kubernetes uses\nthe kubernetes control plane (kubectl), this connection is secured based on this tunnel. The DevPod agent starts a SSH server using the STDIO of the secure tunnel in order for you local DevPod CLI/UI to forward\nports over the SSH connection. Once this is done DevPod starts your local IDE and connects it to the devcontainer via SSH.\n\nIf you developer environment requires any port forwarding, then your IDE or an SSH connection must be running. That's because devpod needs the SSH server running on the agent to perform the forwarding,\nwhich is deployed when starting the IDE or SSH session."
  },
  {
    "path": "docs/pages/licenses/devpod.mdx",
    "content": "---\ntitle: Open Source Licenses\nsidebar_label: OSS Licenses\n---\n\n# Devpod dependencies\n\nThe following open source dependencies are used to build the [DevPod][] CLI.\n\n[DevPod]: https://devpod.sh\n\n## Go Packages\n\nSome packages may only be included on certain architectures or operating systems.\n\n\n - [cloud.google.com/go/compute/metadata](https://pkg.go.dev/cloud.google.com/go/compute/metadata) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/cloud.google.com/go/compute/metadata/LICENSE))\n - [github.com/AlecAivazis/survey/v2](https://pkg.go.dev/github.com/AlecAivazis/survey/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/AlecAivazis/survey/v2/LICENSE))\n - [github.com/AlecAivazis/survey/v2/terminal](https://pkg.go.dev/github.com/AlecAivazis/survey/v2/terminal) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/AlecAivazis/survey/v2/terminal/LICENSE.txt))\n - [github.com/Azure/azure-sdk-for-go](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt))\n - [github.com/Azure/go-autorest/autorest](https://pkg.go.dev/github.com/Azure/go-autorest/autorest) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/autorest/LICENSE))\n - [github.com/Azure/go-autorest/autorest/adal](https://pkg.go.dev/github.com/Azure/go-autorest/autorest/adal) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE))\n - [github.com/Azure/go-autorest/autorest/azure/auth](https://pkg.go.dev/github.com/Azure/go-autorest/autorest/azure/auth) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/autorest/azure/auth/LICENSE))\n - [github.com/Azure/go-autorest/autorest/azure/cli](https://pkg.go.dev/github.com/Azure/go-autorest/autorest/azure/cli) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/autorest/azure/cli/LICENSE))\n - [github.com/Azure/go-autorest/autorest/date](https://pkg.go.dev/github.com/Azure/go-autorest/autorest/date) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE))\n - [github.com/Azure/go-autorest/logger](https://pkg.go.dev/github.com/Azure/go-autorest/logger) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/logger/LICENSE))\n - [github.com/Azure/go-autorest/tracing](https://pkg.go.dev/github.com/Azure/go-autorest/tracing) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/Azure/go-autorest/tracing/LICENSE))\n - [github.com/BurntSushi/toml](https://pkg.go.dev/github.com/BurntSushi/toml) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/BurntSushi/toml/COPYING))\n - [github.com/NYTimes/gziphandler](https://pkg.go.dev/github.com/NYTimes/gziphandler) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/NYTimes/gziphandler/LICENSE))\n - [github.com/PaesslerAG/gval](https://pkg.go.dev/github.com/PaesslerAG/gval) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/PaesslerAG/gval/LICENSE))\n - [github.com/PaesslerAG/jsonpath](https://pkg.go.dev/github.com/PaesslerAG/jsonpath) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/PaesslerAG/jsonpath/LICENSE))\n - [github.com/acarl005/stripansi](https://pkg.go.dev/github.com/acarl005/stripansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/acarl005/stripansi/LICENSE))\n - [github.com/alessio/shellescape](https://pkg.go.dev/github.com/alessio/shellescape) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/alessio/shellescape/LICENSE))\n - [github.com/anmitsu/go-shlex](https://pkg.go.dev/github.com/anmitsu/go-shlex) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/anmitsu/go-shlex/LICENSE))\n - [github.com/antlr4-go/antlr/v4](https://pkg.go.dev/github.com/antlr4-go/antlr/v4) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/antlr4-go/antlr/v4/LICENSE))\n - [github.com/asaskevich/govalidator](https://pkg.go.dev/github.com/asaskevich/govalidator) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/asaskevich/govalidator/LICENSE))\n - [github.com/atotto/clipboard](https://pkg.go.dev/github.com/atotto/clipboard) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/atotto/clipboard/LICENSE))\n - [github.com/aws/aws-sdk-go-v2](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/credentials](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/credentials) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/feature/ec2/imds](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/feature/ec2/imds) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/internal/configsources](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/internal/configsources) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/internal/endpoints/v2](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/internal/ini](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/internal/ini) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/internal/sync/singleflight](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE))\n - [github.com/aws/aws-sdk-go-v2/service/ecr](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ecr) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/ecrpublic](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ecrpublic) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/internal/presigned-url](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/sso](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/sso) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/ssooidc](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ssooidc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt))\n - [github.com/aws/aws-sdk-go-v2/service/sts](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/sts) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt))\n - [github.com/aws/smithy-go](https://pkg.go.dev/github.com/aws/smithy-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/smithy-go/LICENSE))\n - [github.com/aws/smithy-go/internal/sync/singleflight](https://pkg.go.dev/github.com/aws/smithy-go/internal/sync/singleflight) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE))\n - [github.com/awslabs/amazon-ecr-credential-helper/ecr-login](https://pkg.go.dev/github.com/awslabs/amazon-ecr-credential-helper/ecr-login) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/LICENSE))\n - [github.com/aymanbagabas/go-osc52/v2](https://pkg.go.dev/github.com/aymanbagabas/go-osc52/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE))\n - [github.com/beorn7/perks/quantile](https://pkg.go.dev/github.com/beorn7/perks/quantile) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/beorn7/perks/LICENSE))\n - [github.com/blang/semver](https://pkg.go.dev/github.com/blang/semver) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/blang/semver/LICENSE))\n - [github.com/blang/semver/v4](https://pkg.go.dev/github.com/blang/semver/v4) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/blang/semver/v4/LICENSE))\n - [github.com/bmatcuk/doublestar/v4](https://pkg.go.dev/github.com/bmatcuk/doublestar/v4) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/bmatcuk/doublestar/v4/LICENSE))\n - [github.com/catppuccin/go](https://pkg.go.dev/github.com/catppuccin/go) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/catppuccin/go/LICENSE))\n - [github.com/cenkalti/backoff/v4](https://pkg.go.dev/github.com/cenkalti/backoff/v4) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/cenkalti/backoff/v4/LICENSE))\n - [github.com/cespare/xxhash/v2](https://pkg.go.dev/github.com/cespare/xxhash/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/cespare/xxhash/v2/LICENSE.txt))\n - [github.com/charmbracelet/bubbles](https://pkg.go.dev/github.com/charmbracelet/bubbles) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/bubbles/LICENSE))\n - [github.com/charmbracelet/bubbletea](https://pkg.go.dev/github.com/charmbracelet/bubbletea) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/bubbletea/LICENSE))\n - [github.com/charmbracelet/huh](https://pkg.go.dev/github.com/charmbracelet/huh) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/huh/LICENSE))\n - [github.com/charmbracelet/lipgloss](https://pkg.go.dev/github.com/charmbracelet/lipgloss) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/lipgloss/LICENSE))\n - [github.com/charmbracelet/x/ansi](https://pkg.go.dev/github.com/charmbracelet/x/ansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/x/ansi/LICENSE))\n - [github.com/charmbracelet/x/exp/strings](https://pkg.go.dev/github.com/charmbracelet/x/exp/strings) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/x/exp/strings/LICENSE))\n - [github.com/charmbracelet/x/term](https://pkg.go.dev/github.com/charmbracelet/x/term) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/charmbracelet/x/term/LICENSE))\n - [github.com/chrismellard/docker-credential-acr-env/pkg](https://pkg.go.dev/github.com/chrismellard/docker-credential-acr-env/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/chrismellard/docker-credential-acr-env/LICENSE))\n - [github.com/compose-spec/compose-go/v2](https://pkg.go.dev/github.com/compose-spec/compose-go/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/v2/LICENSE))\n - [github.com/compose-spec/compose-go/v2/dotenv](https://pkg.go.dev/github.com/compose-spec/compose-go/v2/dotenv) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/v2/dotenv/LICENSE))\n - [github.com/containerd/console](https://pkg.go.dev/github.com/containerd/console) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/console/LICENSE))\n - [github.com/containerd/containerd](https://pkg.go.dev/github.com/containerd/containerd) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/containerd/LICENSE))\n - [github.com/containerd/containerd/api/services/content/v1](https://pkg.go.dev/github.com/containerd/containerd/api/services/content/v1) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/containerd/api/LICENSE))\n - [github.com/containerd/continuity/sysx](https://pkg.go.dev/github.com/containerd/continuity/sysx) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/continuity/LICENSE))\n - [github.com/containerd/errdefs](https://pkg.go.dev/github.com/containerd/errdefs) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/errdefs/LICENSE))\n - [github.com/containerd/log](https://pkg.go.dev/github.com/containerd/log) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/log/LICENSE))\n - [github.com/containerd/platforms](https://pkg.go.dev/github.com/containerd/platforms) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/platforms/LICENSE))\n - [github.com/containerd/stargz-snapshotter/estargz](https://pkg.go.dev/github.com/containerd/stargz-snapshotter/estargz) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE))\n - [github.com/containerd/ttrpc](https://pkg.go.dev/github.com/containerd/ttrpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/ttrpc/LICENSE))\n - [github.com/containerd/typeurl/v2](https://pkg.go.dev/github.com/containerd/typeurl/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/typeurl/v2/LICENSE))\n - [github.com/containers/image/v5](https://pkg.go.dev/github.com/containers/image/v5) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containers/image/v5/LICENSE))\n - [github.com/containers/storage/pkg](https://pkg.go.dev/github.com/containers/storage/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containers/storage/LICENSE))\n - [github.com/coreos/go-semver/semver](https://pkg.go.dev/github.com/coreos/go-semver/semver) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/coreos/go-semver/LICENSE))\n - [github.com/coreos/go-systemd/v22](https://pkg.go.dev/github.com/coreos/go-systemd/v22) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/coreos/go-systemd/v22/LICENSE))\n - [github.com/creack/pty](https://pkg.go.dev/github.com/creack/pty) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/creack/pty/LICENSE))\n - [github.com/davecgh/go-spew/spew](https://pkg.go.dev/github.com/davecgh/go-spew/spew) ([ISC](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/davecgh/go-spew/LICENSE))\n - [github.com/denisbrodbeck/machineid](https://pkg.go.dev/github.com/denisbrodbeck/machineid) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/denisbrodbeck/machineid/LICENSE.md))\n - [github.com/dimchansky/utfbom](https://pkg.go.dev/github.com/dimchansky/utfbom) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/dimchansky/utfbom/LICENSE))\n - [github.com/distribution/reference](https://pkg.go.dev/github.com/distribution/reference) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/distribution/reference/LICENSE))\n - [github.com/docker/cli/cli/config](https://pkg.go.dev/github.com/docker/cli/cli/config) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/cli/LICENSE))\n - [github.com/docker/distribution/registry/client/auth/challenge](https://pkg.go.dev/github.com/docker/distribution/registry/client/auth/challenge) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/distribution/LICENSE))\n - [github.com/docker/docker](https://pkg.go.dev/github.com/docker/docker) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/docker/LICENSE))\n - [github.com/docker/docker-credential-helpers](https://pkg.go.dev/github.com/docker/docker-credential-helpers) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/docker-credential-helpers/LICENSE))\n - [github.com/docker/go-connections](https://pkg.go.dev/github.com/docker/go-connections) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/go-connections/LICENSE))\n - [github.com/docker/go-units](https://pkg.go.dev/github.com/docker/go-units) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/docker/go-units/LICENSE))\n - [github.com/dustin/go-humanize](https://pkg.go.dev/github.com/dustin/go-humanize) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/dustin/go-humanize/LICENSE))\n - [github.com/emicklei/go-restful/v3](https://pkg.go.dev/github.com/emicklei/go-restful/v3) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/emicklei/go-restful/v3/LICENSE))\n - [github.com/evanphx/json-patch](https://pkg.go.dev/github.com/evanphx/json-patch) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/evanphx/json-patch/LICENSE))\n - [github.com/evanphx/json-patch/v5](https://pkg.go.dev/github.com/evanphx/json-patch/v5) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/evanphx/json-patch/v5/LICENSE))\n - [github.com/felixge/httpsnoop](https://pkg.go.dev/github.com/felixge/httpsnoop) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/felixge/httpsnoop/LICENSE.txt))\n - [github.com/fsnotify/fsnotify](https://pkg.go.dev/github.com/fsnotify/fsnotify) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/fsnotify/fsnotify/LICENSE))\n - [github.com/fxamacker/cbor/v2](https://pkg.go.dev/github.com/fxamacker/cbor/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/fxamacker/cbor/v2/LICENSE))\n - [github.com/ghodss/yaml](https://pkg.go.dev/github.com/ghodss/yaml) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/ghodss/yaml/LICENSE))\n - [github.com/go-logr/logr](https://pkg.go.dev/github.com/go-logr/logr) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-logr/logr/LICENSE))\n - [github.com/go-logr/stdr](https://pkg.go.dev/github.com/go-logr/stdr) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-logr/stdr/LICENSE))\n - [github.com/go-openapi/jsonpointer](https://pkg.go.dev/github.com/go-openapi/jsonpointer) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/jsonpointer/LICENSE))\n - [github.com/go-openapi/jsonreference](https://pkg.go.dev/github.com/go-openapi/jsonreference) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/jsonreference/LICENSE))\n - [github.com/go-openapi/swag](https://pkg.go.dev/github.com/go-openapi/swag) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/swag/LICENSE))\n - [github.com/go-viper/mapstructure/v2](https://pkg.go.dev/github.com/go-viper/mapstructure/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-viper/mapstructure/v2/LICENSE))\n - [github.com/gofrs/flock](https://pkg.go.dev/github.com/gofrs/flock) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gofrs/flock/LICENSE))\n - [github.com/gogo/protobuf](https://pkg.go.dev/github.com/gogo/protobuf) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gogo/protobuf/LICENSE))\n - [github.com/golang-jwt/jwt/v4](https://pkg.go.dev/github.com/golang-jwt/jwt/v4) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/golang-jwt/jwt/v4/LICENSE))\n - [github.com/golang/groupcache/lru](https://pkg.go.dev/github.com/golang/groupcache/lru) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/golang/groupcache/LICENSE))\n - [github.com/golang/protobuf](https://pkg.go.dev/github.com/golang/protobuf) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/golang/protobuf/LICENSE))\n - [github.com/google/cel-go](https://pkg.go.dev/github.com/google/cel-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/cel-go/LICENSE))\n - [github.com/google/gnostic-models](https://pkg.go.dev/github.com/google/gnostic-models) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/gnostic-models/LICENSE))\n - [github.com/google/go-cmp/cmp](https://pkg.go.dev/github.com/google/go-cmp/cmp) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/go-cmp/LICENSE))\n - [github.com/google/go-containerregistry](https://pkg.go.dev/github.com/google/go-containerregistry) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/go-containerregistry/LICENSE))\n - [github.com/google/go-containerregistry/pkg/authn/kubernetes](https://pkg.go.dev/github.com/google/go-containerregistry/pkg/authn/kubernetes) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/go-containerregistry/pkg/authn/kubernetes/LICENSE))\n - [github.com/google/go-github/v30/github](https://pkg.go.dev/github.com/google/go-github/v30/github) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/go-github/v30/LICENSE))\n - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/go-querystring/LICENSE))\n - [github.com/google/gofuzz](https://pkg.go.dev/github.com/google/gofuzz) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/gofuzz/LICENSE))\n - [github.com/google/shlex](https://pkg.go.dev/github.com/google/shlex) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/shlex/COPYING))\n - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/google/uuid/LICENSE))\n - [github.com/gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) ([BSD-2-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gorilla/websocket/LICENSE))\n - [github.com/grpc-ecosystem/go-grpc-prometheus](https://pkg.go.dev/github.com/grpc-ecosystem/go-grpc-prometheus) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE))\n - [github.com/grpc-ecosystem/grpc-gateway/v2](https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE))\n - [github.com/hashicorp/errwrap](https://pkg.go.dev/github.com/hashicorp/errwrap) ([MPL-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/hashicorp/errwrap/LICENSE))\n - [github.com/hashicorp/go-cleanhttp](https://pkg.go.dev/github.com/hashicorp/go-cleanhttp) ([MPL-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/hashicorp/go-cleanhttp/LICENSE))\n - [github.com/hashicorp/go-multierror](https://pkg.go.dev/github.com/hashicorp/go-multierror) ([MPL-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/hashicorp/go-multierror/LICENSE))\n - [github.com/imdario/mergo](https://pkg.go.dev/github.com/imdario/mergo) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/imdario/mergo/LICENSE))\n - [github.com/in-toto/in-toto-golang/in_toto](https://pkg.go.dev/github.com/in-toto/in-toto-golang/in_toto) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/in-toto/in-toto-golang/LICENSE))\n - [github.com/inconshreveable/go-update](https://pkg.go.dev/github.com/inconshreveable/go-update) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/inconshreveable/go-update/LICENSE))\n - [github.com/inconshreveable/go-update/internal/binarydist](https://pkg.go.dev/github.com/inconshreveable/go-update/internal/binarydist) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/inconshreveable/go-update/internal/binarydist/License))\n - [github.com/inconshreveable/go-update/internal/osext](https://pkg.go.dev/github.com/inconshreveable/go-update/internal/osext) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/inconshreveable/go-update/internal/osext/LICENSE))\n - [github.com/jmespath/go-jmespath](https://pkg.go.dev/github.com/jmespath/go-jmespath) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/jmespath/go-jmespath/LICENSE))\n - [github.com/joho/godotenv](https://pkg.go.dev/github.com/joho/godotenv) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/joho/godotenv/LICENCE))\n - [github.com/josharian/intern](https://pkg.go.dev/github.com/josharian/intern) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/josharian/intern/license.md))\n - [github.com/json-iterator/go](https://pkg.go.dev/github.com/json-iterator/go) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/json-iterator/go/LICENSE))\n - [github.com/k0kubun/go-ansi](https://pkg.go.dev/github.com/k0kubun/go-ansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/k0kubun/go-ansi/LICENSE.txt))\n - [github.com/kballard/go-shellquote](https://pkg.go.dev/github.com/kballard/go-shellquote) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/kballard/go-shellquote/LICENSE))\n - [github.com/klauspost/compress](https://pkg.go.dev/github.com/klauspost/compress) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/klauspost/compress/LICENSE))\n - [github.com/klauspost/compress/internal/snapref](https://pkg.go.dev/github.com/klauspost/compress/internal/snapref) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/klauspost/compress/internal/snapref/LICENSE))\n - [github.com/klauspost/compress/zstd/internal/xxhash](https://pkg.go.dev/github.com/klauspost/compress/zstd/internal/xxhash) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt))\n - [github.com/kr/fs](https://pkg.go.dev/github.com/kr/fs) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/kr/fs/LICENSE))\n - [github.com/kylelemons/godebug/diff](https://pkg.go.dev/github.com/kylelemons/godebug/diff) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/kylelemons/godebug/LICENSE))\n - [github.com/liggitt/tabwriter](https://pkg.go.dev/github.com/liggitt/tabwriter) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/liggitt/tabwriter/LICENSE))\n - [github.com/lucasb-eyer/go-colorful](https://pkg.go.dev/github.com/lucasb-eyer/go-colorful) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/lucasb-eyer/go-colorful/LICENSE))\n - [github.com/mailru/easyjson](https://pkg.go.dev/github.com/mailru/easyjson) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mailru/easyjson/LICENSE))\n - [github.com/mattn/go-colorable](https://pkg.go.dev/github.com/mattn/go-colorable) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mattn/go-colorable/LICENSE))\n - [github.com/mattn/go-isatty](https://pkg.go.dev/github.com/mattn/go-isatty) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mattn/go-isatty/LICENSE))\n - [github.com/mattn/go-runewidth](https://pkg.go.dev/github.com/mattn/go-runewidth) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mattn/go-runewidth/LICENSE))\n - [github.com/mattn/go-shellwords](https://pkg.go.dev/github.com/mattn/go-shellwords) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mattn/go-shellwords/LICENSE))\n - [github.com/mgutz/ansi](https://pkg.go.dev/github.com/mgutz/ansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mgutz/ansi/LICENSE))\n - [github.com/mitchellh/go-homedir](https://pkg.go.dev/github.com/mitchellh/go-homedir) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/go-homedir/LICENSE))\n - [github.com/mitchellh/go-wordwrap](https://pkg.go.dev/github.com/mitchellh/go-wordwrap) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md))\n - [github.com/mitchellh/hashstructure/v2](https://pkg.go.dev/github.com/mitchellh/hashstructure/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/hashstructure/v2/LICENSE))\n - [github.com/moby/buildkit](https://pkg.go.dev/github.com/moby/buildkit) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/buildkit/LICENSE))\n - [github.com/moby/docker-image-spec/specs-go/v1](https://pkg.go.dev/github.com/moby/docker-image-spec/specs-go/v1) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/docker-image-spec/LICENSE))\n - [github.com/moby/locker](https://pkg.go.dev/github.com/moby/locker) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/locker/LICENSE))\n - [github.com/moby/patternmatcher](https://pkg.go.dev/github.com/moby/patternmatcher) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/patternmatcher/LICENSE))\n - [github.com/moby/spdystream](https://pkg.go.dev/github.com/moby/spdystream) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/spdystream/LICENSE))\n - [github.com/moby/sys/capability](https://pkg.go.dev/github.com/moby/sys/capability) ([BSD-2-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/sys/capability/LICENSE))\n - [github.com/moby/sys/mountinfo](https://pkg.go.dev/github.com/moby/sys/mountinfo) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/sys/mountinfo/LICENSE))\n - [github.com/moby/sys/signal](https://pkg.go.dev/github.com/moby/sys/signal) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/sys/signal/LICENSE))\n - [github.com/moby/sys/user](https://pkg.go.dev/github.com/moby/sys/user) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/sys/user/LICENSE))\n - [github.com/moby/term](https://pkg.go.dev/github.com/moby/term) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/term/LICENSE))\n - [github.com/modern-go/concurrent](https://pkg.go.dev/github.com/modern-go/concurrent) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/modern-go/concurrent/LICENSE))\n - [github.com/modern-go/reflect2](https://pkg.go.dev/github.com/modern-go/reflect2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/modern-go/reflect2/LICENSE))\n - [github.com/morikuni/aec](https://pkg.go.dev/github.com/morikuni/aec) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/morikuni/aec/LICENSE))\n - [github.com/muesli/ansi](https://pkg.go.dev/github.com/muesli/ansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/muesli/ansi/LICENSE))\n - [github.com/muesli/cancelreader](https://pkg.go.dev/github.com/muesli/cancelreader) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/muesli/cancelreader/LICENSE))\n - [github.com/muesli/termenv](https://pkg.go.dev/github.com/muesli/termenv) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/muesli/termenv/LICENSE))\n - [github.com/munnerz/goautoneg](https://pkg.go.dev/github.com/munnerz/goautoneg) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/munnerz/goautoneg/LICENSE))\n - [github.com/mxk/go-flowrate/flowrate](https://pkg.go.dev/github.com/mxk/go-flowrate/flowrate) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mxk/go-flowrate/LICENSE))\n - [github.com/olekukonko/tablewriter](https://pkg.go.dev/github.com/olekukonko/tablewriter) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/olekukonko/tablewriter/LICENSE.md))\n - [github.com/onsi/ginkgo/v2](https://pkg.go.dev/github.com/onsi/ginkgo/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/onsi/ginkgo/v2/LICENSE))\n - [github.com/onsi/gomega](https://pkg.go.dev/github.com/onsi/gomega) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/onsi/gomega/LICENSE))\n - [github.com/opencontainers/go-digest](https://pkg.go.dev/github.com/opencontainers/go-digest) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/opencontainers/go-digest/LICENSE))\n - [github.com/opencontainers/image-spec/specs-go](https://pkg.go.dev/github.com/opencontainers/image-spec/specs-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/opencontainers/image-spec/LICENSE))\n - [github.com/opencontainers/runtime-spec/specs-go](https://pkg.go.dev/github.com/opencontainers/runtime-spec/specs-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/opencontainers/runtime-spec/LICENSE))\n - [github.com/otiai10/copy](https://pkg.go.dev/github.com/otiai10/copy) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/otiai10/copy/LICENSE))\n - [github.com/pkg/errors](https://pkg.go.dev/github.com/pkg/errors) ([BSD-2-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/pkg/errors/LICENSE))\n - [github.com/pkg/sftp](https://pkg.go.dev/github.com/pkg/sftp) ([BSD-2-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/pkg/sftp/LICENSE))\n - [github.com/planetscale/vtprotobuf](https://pkg.go.dev/github.com/planetscale/vtprotobuf) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/planetscale/vtprotobuf/LICENSE))\n - [github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil](https://pkg.go.dev/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE))\n - [github.com/prometheus/client_golang/prometheus](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/prometheus/client_golang/LICENSE))\n - [github.com/prometheus/client_model/go](https://pkg.go.dev/github.com/prometheus/client_model/go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/prometheus/client_model/LICENSE))\n - [github.com/prometheus/common](https://pkg.go.dev/github.com/prometheus/common) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/prometheus/common/LICENSE))\n - [github.com/prometheus/procfs](https://pkg.go.dev/github.com/prometheus/procfs) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/prometheus/procfs/LICENSE))\n - [github.com/rhysd/go-github-selfupdate/selfupdate](https://pkg.go.dev/github.com/rhysd/go-github-selfupdate/selfupdate) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/rhysd/go-github-selfupdate/LICENSE))\n - [github.com/rivo/uniseg](https://pkg.go.dev/github.com/rivo/uniseg) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/rivo/uniseg/LICENSE.txt))\n - [github.com/secure-systems-lab/go-securesystemslib](https://pkg.go.dev/github.com/secure-systems-lab/go-securesystemslib) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/secure-systems-lab/go-securesystemslib/LICENSE))\n - [github.com/shibumi/go-pathspec](https://pkg.go.dev/github.com/shibumi/go-pathspec) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/shibumi/go-pathspec/LICENSE))\n - [github.com/sirupsen/logrus](https://pkg.go.dev/github.com/sirupsen/logrus) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/sirupsen/logrus/LICENSE))\n - [github.com/skratchdot/open-golang/open](https://pkg.go.dev/github.com/skratchdot/open-golang/open) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/skratchdot/open-golang/LICENSE))\n - [github.com/spf13/cobra](https://pkg.go.dev/github.com/spf13/cobra) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/spf13/cobra/LICENSE.txt))\n - [github.com/spf13/pflag](https://pkg.go.dev/github.com/spf13/pflag) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/spf13/pflag/LICENSE))\n - [github.com/stoewer/go-strcase](https://pkg.go.dev/github.com/stoewer/go-strcase) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/stoewer/go-strcase/LICENSE))\n - [github.com/takama/daemon](https://pkg.go.dev/github.com/takama/daemon) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/takama/daemon/LICENSE))\n - [github.com/tcnksm/go-gitconfig](https://pkg.go.dev/github.com/tcnksm/go-gitconfig) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tcnksm/go-gitconfig/LICENSE))\n - [github.com/tidwall/jsonc](https://pkg.go.dev/github.com/tidwall/jsonc) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tidwall/jsonc/LICENSE))\n - [github.com/tonistiigi/fsutil](https://pkg.go.dev/github.com/tonistiigi/fsutil) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tonistiigi/fsutil/LICENSE))\n - [github.com/tonistiigi/go-csvvalue](https://pkg.go.dev/github.com/tonistiigi/go-csvvalue) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tonistiigi/go-csvvalue/LICENSE))\n - [github.com/tonistiigi/units](https://pkg.go.dev/github.com/tonistiigi/units) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tonistiigi/units/LICENSE))\n - [github.com/tonistiigi/vt100](https://pkg.go.dev/github.com/tonistiigi/vt100) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/tonistiigi/vt100/LICENSE))\n - [github.com/ulikunitz/xz](https://pkg.go.dev/github.com/ulikunitz/xz) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/ulikunitz/xz/LICENSE))\n - [github.com/vbatts/tar-split/archive/tar](https://pkg.go.dev/github.com/vbatts/tar-split/archive/tar) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/vbatts/tar-split/LICENSE))\n - [github.com/x448/float16](https://pkg.go.dev/github.com/x448/float16) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/x448/float16/LICENSE))\n - [github.com/xeipuuv/gojsonpointer](https://pkg.go.dev/github.com/xeipuuv/gojsonpointer) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/xeipuuv/gojsonpointer/LICENSE-APACHE-2.0.txt))\n - [github.com/xeipuuv/gojsonreference](https://pkg.go.dev/github.com/xeipuuv/gojsonreference) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/xeipuuv/gojsonreference/LICENSE-APACHE-2.0.txt))\n - [github.com/xeipuuv/gojsonschema](https://pkg.go.dev/github.com/xeipuuv/gojsonschema) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/xeipuuv/gojsonschema/LICENSE-APACHE-2.0.txt))\n - [go.etcd.io/etcd/api/v3](https://pkg.go.dev/go.etcd.io/etcd/api/v3) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.etcd.io/etcd/api/v3/LICENSE))\n - [go.etcd.io/etcd/client/pkg/v3](https://pkg.go.dev/go.etcd.io/etcd/client/pkg/v3) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE))\n - [go.etcd.io/etcd/client/v3](https://pkg.go.dev/go.etcd.io/etcd/client/v3) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.etcd.io/etcd/client/v3/LICENSE))\n - [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/LICENSE))\n - [go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/LICENSE))\n - [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE))\n - [go.opentelemetry.io/otel](https://pkg.go.dev/go.opentelemetry.io/otel) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/LICENSE))\n - [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/LICENSE))\n - [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/LICENSE))\n - [go.opentelemetry.io/otel/metric](https://pkg.go.dev/go.opentelemetry.io/otel/metric) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/metric/LICENSE))\n - [go.opentelemetry.io/otel/sdk](https://pkg.go.dev/go.opentelemetry.io/otel/sdk) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/sdk/LICENSE))\n - [go.opentelemetry.io/otel/trace](https://pkg.go.dev/go.opentelemetry.io/otel/trace) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/otel/trace/LICENSE))\n - [go.opentelemetry.io/proto/otlp](https://pkg.go.dev/go.opentelemetry.io/proto/otlp) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.opentelemetry.io/proto/otlp/LICENSE))\n - [go.uber.org/multierr](https://pkg.go.dev/go.uber.org/multierr) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.uber.org/multierr/LICENSE.txt))\n - [go.uber.org/zap](https://pkg.go.dev/go.uber.org/zap) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/go.uber.org/zap/LICENSE))\n - [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/crypto/LICENSE))\n - [golang.org/x/exp](https://pkg.go.dev/golang.org/x/exp) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/exp/LICENSE))\n - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/net/LICENSE))\n - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/oauth2/LICENSE))\n - [golang.org/x/sync](https://pkg.go.dev/golang.org/x/sync) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/sync/LICENSE))\n - [golang.org/x/sys/unix](https://pkg.go.dev/golang.org/x/sys/unix) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/sys/LICENSE))\n - [golang.org/x/term](https://pkg.go.dev/golang.org/x/term) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/term/LICENSE))\n - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/text/LICENSE))\n - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/golang.org/x/time/LICENSE))\n - [gomodules.xyz/jsonpatch/v2](https://pkg.go.dev/gomodules.xyz/jsonpatch/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gomodules.xyz/jsonpatch/v2/LICENSE))\n - [google.golang.org/genproto/googleapis/api](https://pkg.go.dev/google.golang.org/genproto/googleapis/api) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/google.golang.org/genproto/googleapis/api/LICENSE))\n - [google.golang.org/genproto/googleapis/rpc](https://pkg.go.dev/google.golang.org/genproto/googleapis/rpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE))\n - [google.golang.org/genproto/protobuf/field_mask](https://pkg.go.dev/google.golang.org/genproto/protobuf/field_mask) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/google.golang.org/genproto/LICENSE))\n - [google.golang.org/grpc](https://pkg.go.dev/google.golang.org/grpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/google.golang.org/grpc/LICENSE))\n - [google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/google.golang.org/protobuf/LICENSE))\n - [gopkg.in/evanphx/json-patch.v4](https://pkg.go.dev/gopkg.in/evanphx/json-patch.v4) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/evanphx/json-patch.v4/LICENSE))\n - [gopkg.in/inf.v0](https://pkg.go.dev/gopkg.in/inf.v0) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/inf.v0/LICENSE))\n - [gopkg.in/natefinch/lumberjack.v2](https://pkg.go.dev/gopkg.in/natefinch/lumberjack.v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/natefinch/lumberjack.v2/LICENSE))\n - [gopkg.in/square/go-jose.v2](https://pkg.go.dev/gopkg.in/square/go-jose.v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/square/go-jose.v2/LICENSE))\n - [gopkg.in/square/go-jose.v2/json](https://pkg.go.dev/gopkg.in/square/go-jose.v2/json) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/square/go-jose.v2/json/LICENSE))\n - [gopkg.in/yaml.v2](https://pkg.go.dev/gopkg.in/yaml.v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/yaml.v2/LICENSE))\n - [gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/gopkg.in/yaml.v3/LICENSE))\n - [k8s.io/api](https://pkg.go.dev/k8s.io/api) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/api/LICENSE))\n - [k8s.io/apiextensions-apiserver/pkg/apis/apiextensions](https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/apiextensions-apiserver/LICENSE))\n - [k8s.io/apimachinery/pkg](https://pkg.go.dev/k8s.io/apimachinery/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/apimachinery/LICENSE))\n - [k8s.io/apimachinery/third_party/forked/golang](https://pkg.go.dev/k8s.io/apimachinery/third_party/forked/golang) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/apimachinery/third_party/forked/golang/LICENSE))\n - [k8s.io/apiserver](https://pkg.go.dev/k8s.io/apiserver) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/apiserver/LICENSE))\n - [k8s.io/cli-runtime/pkg/printers](https://pkg.go.dev/k8s.io/cli-runtime/pkg/printers) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/cli-runtime/LICENSE))\n - [k8s.io/client-go](https://pkg.go.dev/k8s.io/client-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/client-go/LICENSE))\n - [k8s.io/client-go/third_party/forked/golang/template](https://pkg.go.dev/k8s.io/client-go/third_party/forked/golang/template) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/client-go/third_party/forked/golang/LICENSE))\n - [k8s.io/component-base](https://pkg.go.dev/k8s.io/component-base) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/component-base/LICENSE))\n - [k8s.io/klog/v2](https://pkg.go.dev/k8s.io/klog/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/klog/v2/LICENSE))\n - [k8s.io/kube-aggregator/pkg](https://pkg.go.dev/k8s.io/kube-aggregator/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-aggregator/LICENSE))\n - [k8s.io/kube-openapi/pkg](https://pkg.go.dev/k8s.io/kube-openapi/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-openapi/LICENSE))\n - [k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json](https://pkg.go.dev/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/LICENSE))\n - [k8s.io/kube-openapi/pkg/validation/errors](https://pkg.go.dev/k8s.io/kube-openapi/pkg/validation/errors) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-openapi/pkg/validation/errors/LICENSE))\n - [k8s.io/kube-openapi/pkg/validation/spec](https://pkg.go.dev/k8s.io/kube-openapi/pkg/validation/spec) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-openapi/pkg/validation/spec/LICENSE))\n - [k8s.io/kube-openapi/pkg/validation/strfmt](https://pkg.go.dev/k8s.io/kube-openapi/pkg/validation/strfmt) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kube-openapi/pkg/validation/strfmt/LICENSE))\n - [k8s.io/kubectl/pkg/util](https://pkg.go.dev/k8s.io/kubectl/pkg/util) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/kubectl/LICENSE))\n - [k8s.io/utils](https://pkg.go.dev/k8s.io/utils) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/utils/LICENSE))\n - [k8s.io/utils/internal/third_party/forked/golang](https://pkg.go.dev/k8s.io/utils/internal/third_party/forked/golang) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/k8s.io/utils/internal/third_party/forked/golang/LICENSE))\n - [mvdan.cc/sh/v3](https://pkg.go.dev/mvdan.cc/sh/v3) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/mvdan.cc/sh/v3/LICENSE))\n - [sigs.k8s.io/apiserver-network-proxy/konnectivity-client](https://pkg.go.dev/sigs.k8s.io/apiserver-network-proxy/konnectivity-client) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/LICENSE))\n - [sigs.k8s.io/controller-runtime](https://pkg.go.dev/sigs.k8s.io/controller-runtime) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/controller-runtime/LICENSE))\n - [sigs.k8s.io/json](https://pkg.go.dev/sigs.k8s.io/json) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/json/LICENSE))\n - [sigs.k8s.io/structured-merge-diff/v4](https://pkg.go.dev/sigs.k8s.io/structured-merge-diff/v4) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/structured-merge-diff/v4/LICENSE))\n - [sigs.k8s.io/yaml](https://pkg.go.dev/sigs.k8s.io/yaml) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/yaml/LICENSE))\n - [sigs.k8s.io/yaml/goyaml.v2](https://pkg.go.dev/sigs.k8s.io/yaml/goyaml.v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/sigs.k8s.io/yaml/goyaml.v2/LICENSE))\n\n"
  },
  {
    "path": "docs/pages/managing-machines/manage-machines.mdx",
    "content": "---\ntitle: Manage Machines\nsidebar_label: Manage Machines\n---\n\n## Create a machine\n\nYou can create a new machine using:\n\n```sh\ndevpod machine create <name-of-machine> --provider <provider-name>\n```\n\nAt any point you can list all the machines using:\n\n```sh\ndevpod machine list\n```\n\nAn example output would be:\n\n```\n  NAME | PROVIDER | AGE\n-------+----------+------\n  <name-of-machine> | aws      | 21s\n```\n\nYou can check in which state is a machine using:\n\n```sh\ndevpod machine status <name-of-machine>\n```\n\nExample output:\n\n```\n08:48:58 info Machine '<name-of-machine>' is 'Running'\n```\n\n## SSH into a machine\n\nIt is possible to SSH directly into the provider's machine using\n\n```sh\ndevpod machine ssh <name-of-machine>\n```\n\nThis will open a full ssh session to the machine.\n\n## Stop a machine\n\nStopping a machine is as easy as:\n\n```sh\ndevpod machine stop <name-of-machine>\n```\n\nYou can check the status afterwards using:\n\n```sh\ndevpod machine status <name-of-machine>\n```\n\nExample output:\n\n```\n08:58:58 info Machine '<name-of-machine>' is 'Stopped, you can start it via 'devpod machine start <name-of-machine>''\n```\n\n## Delete a machine\n\nFinally, you can delete the machine simply using:\n\n```sh\ndevpod machine delete <name-of-machine>\n```\n\n:::warning\n**Be aware**: this is non-reversible, all the workspace containers, and data will be\nlost after deletion.\n:::\n"
  },
  {
    "path": "docs/pages/managing-machines/what-are-machines.mdx",
    "content": "---\ntitle: What are Machines?\nsidebar_label: What are Machines?\n---\n\nA [Machine Provider](../managing-providers/what-are-providers.mdx) is responsible for provisioning machines to host your workspace. \nFor cloud providers, these machines are typically virtual machines (VMs). DevPod manages the lifecycle of these machines, including creation and deletion of a workspace.\n\nYou can directly manage all the machines in the various workspaces using:\n\n```sh\ndevpod machine\n```\n"
  },
  {
    "path": "docs/pages/managing-providers/add-provider.mdx",
    "content": "---\ntitle: Add a Provider\nsidebar_label: Add a Provider\n---\n\nThe DevPod team maintains providers for popular services such as:\n\n- [Docker (docker)](https://github.com/loft-sh/devpod/tree/main/providers/docker)\n- [Kubernetes (kubernetes)](https://github.com/loft-sh/devpod-provider-kubernetes)\n- [SSH (ssh)](https://github.com/loft-sh/devpod-provider-ssh)\n- [AWS (aws)](https://github.com/loft-sh/devpod-provider-aws)\n- [Google Cloud (gcloud)](https://github.com/loft-sh/devpod-provider-gcloud)\n- [Azure (azure)](https://github.com/loft-sh/devpod-provider-azure)\n- [Digital Ocean (digitalocean)](https://github.com/loft-sh/devpod-provider-digitalocean)\n\nThese providers can be installed with the DevPod CLI in the following form:\n```\ndevpod provider add docker\n```\n\nYou can get a list of available 1st party providers by using the command:\n\n```\ndevpod provider list-available\n```\n\n## Via DevPod Desktop Application\n\nNavigate to the 'Providers' view and click on the 'Add' button in the title.\nSelect one of the providers supplied by default, or click on the '+' button to\nadd a custom one.\n\nYou will be prompted to fill some additional settings if needed, depending on\nthe provider's needs.\n\n:::info\nUnder the hood, the Desktop Application will call a `devpod provider add PROVIDER`\n:::\n\n### Adding a custom provider\n\nAfter you click the `Add` button in the `Providers` section, you can click the\nbig `+` button to add a custom provider, then fill the `Source` section with either\n\n- A GitHub link to the provider's project\n- An URL to a `provider.yaml`\n- A File Path to a `provider.yaml`\n\n## Via DevPod CLI\nThe providers in this list can easily be installed like:\n\n```sh\ndevpod provider add docker\ndevpod provider add kubernetes\ndevpod provider add ssh\ndevpod provider add aws\ndevpod provider add azure\ndevpod provider add gcloud\ndevpod provider add digitalocean\n```\n\n:::info Multiple providers at the same time\nYou can use the `--name` flag to add multiple providers of the same type with different options, for example `devpod provider add aws --name aws-gpu -o AWS_INSTANCE_TYPE=p3.8xlarge`\n:::\n\n### From Github\n\nYou can specify a custom provider, directly from GitHub, by using the format\n`my-username/repo`, so for example:\n\n```sh\ndevpod provider add loft-sh/devpod-provider-terraform\n```\n\nDevPod will search the latest release for a `provider.yaml` and download that automatically. This should work for private GitHub repositories where DevPod will use the local https credentials to connect to the GitHub repository.\n\nIf you want to install the provider from a different release, you can do the following:\n```sh\ndevpod provider add my-org/my-repo@v0.0.1\n```\n\n### From Local Path\n\nIf you have locally downloaded providers, you can also add them directly to\nDevPod, by pointing to the file path of `provider.yaml` manifest:\n\n```sh\ndevpod provider add ../devpod-provider-mock/provider.yaml\n```\n\n### From URL\n\nYou can also specify the URL to the `provider.yaml` file, for example:\n\n```sh\ndevpod provider add https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.3/provider.yaml\n```\n\n## Set Provider Options\n\nEach provider has a set of options, those options can be different for each of\nthem, as they are defined by the provider's developers.\n\n### Managing options from DevPod Desktop Application\n\nTo manage options from the app, head over the `Providers` section, and click\n`Edit` on the provider you want to configure.\n\n### Managing options from DevPod CLI\n\nOptions for providers can be set during the `use` or `add` phase:\n\n```sh\ndevpod provider add <provider-name> -o KEY=value\n```\n\nor\n\n```sh\ndevpod provider use <provider-name> -o KEY=value\n```\n\n\nElse, to can manage options afterwards from CLI, you can list the table of provider's options by using:\n\n\n```sh\ndevpod provider options <provider-name>\n```\n\nAn example output for the AWS Provider is:\n\n```\n          NAME            | REQUIRED |          DESCRIPTION           |         DEFAULT         |          VALUE           \n----------------------------+----------+--------------------------------+-------------------------+--------------------------\nAGENT_PATH                | false    | The path where to inject the   | /var/lib/toolbox/devpod | /var/lib/toolbox/devpod  \n                          |          | DevPod agent to.               |                         |                          \nAWS_ACCESS_KEY_ID         | false    | The AWS access key id          |                         |                          \nAWS_AMI                   | false    | The disk image to use.         |                         |                          \nAWS_DISK_SIZE             | false    | The disk size to use.          | 40                      | 40                       \nAWS_INSTANCE_TYPE         | false    | The machine type to use.       | c5.xlarge               | c5.xlarge                \nAWS_REGION                | true     | The AWS cloud region to create |                         | us-west-2                \n                          |          | the VM in. E.g. us-west-1      |                         |                          \nAWS_SECRET_ACCESS_KEY     | false    | The AWS secret access key      |                         |                          \nAWS_VPC_ID                | false    | The vpc id to use.             |                         |                          \nINACTIVITY_TIMEOUT        | false    | If defined, will automatically | 10m                     | 10m                      \n                          |          | stop the VM after the          |                         |                          \n                          |          | inactivity period.             |                         |                          \nINJECT_DOCKER_CREDENTIALS | false    | If DevPod should inject docker | true                    | true                     \n                          |          | credentials into the remote    |                         |                          \n                          |          | host.                          |                         |                          \nINJECT_GIT_CREDENTIALS    | false    | If DevPod should inject git    | true                    | true                     \n                          |          | credentials into the remote    |                         |                          \n                          |          | host.                          |                         |  \n```\n\nYou can see this table as an overview, you can change each option using:\n\n```sh\ndevpod provider set-options <provider-name> --option <KEY>=<VALUE>\n```\n\nSo for example, to change the default disk size from 40gb to 120gb, you could use:\n\n```sh\ndevpod provider set-options aws --option AWS_DISK_SIZE=120\n```\n\nAnd check again the options for the provider using `devpod provider options aws`:\n\n```\n          NAME            | REQUIRED |          DESCRIPTION           |         DEFAULT         |          VALUE\n----------------------------+----------+--------------------------------+-------------------------+--------------------------\nAGENT_PATH                | false    | The path where to inject the   | /var/lib/toolbox/devpod | /var/lib/toolbox/devpod\n                          |          | DevPod agent to.               |                         |\nAWS_ACCESS_KEY_ID         | false    | The aws access key id          |                         |\nAWS_AMI                   | false    | The disk image to use.         |                         |\nAWS_DISK_SIZE             | false    | The disk size to use.          | 40                      | 120\nAWS_INSTANCE_TYPE         | false    | The machine type to use.       | c5.xlarge               | c5.xlarge\nAWS_REGION                | true     | The aws cloud region to create |                         | us-west-2\n                          |          | the VM in. E.g. us-west-1      |                         |\nAWS_SECRET_ACCESS_KEY     | false    | The aws secret access key      |                         |\nAWS_VPC_ID                | false    | The vpc id to use.             |                         |\nINACTIVITY_TIMEOUT        | false    | If defined, will automatically | 10m                     | 10m\n                          |          | stop the VM after the          |                         |\n                          |          | inactivity period.             |                         |\nINJECT_DOCKER_CREDENTIALS | false    | If DevPod should inject docker | true                    | true\n                          |          | credentials into the remote    |                         |\n                          |          | host.                          |                         |\nINJECT_GIT_CREDENTIALS    | false    | If DevPod should inject git    | true                    | true\n                          |          | credentials into the remote    |                         |\n                          |          | host.                          |                         |\n```\n\n## Single Machine Provider\n\nBy default, DevPod will use a separate machine for each workspace using the same provider,\nyou can enable `Reuse machine` in a provider in order to use a single machine for all workspaces.\n\nIn **the desktop app** the option is available in the option management interface for the provider\n(see section above)\n\nIn **the CLI** you can set this option using:\n\n```sh\ndevpod provider use <provider-name> --single-machine\n```\n\n## Default Provider\n\nWhen adding a provider to DevPod, you can specify it to be the **default provider**,\nthis implies that when you create a Workspace, this provider will be used if no\nother is specified.\n\nIn **the desktop app**, you can set a provider to be default in the option management interface for the provider\n(see section above)\n\nIn **the CLI** you can set this option using:\n\n```sh\ndevpod provider use <provider-name>\n```\n\n## Community Providers\n\nThe community maintains providers for additional services.\n\n- [Cloudbit (cloudbit-ch/devpod-provider-cloudbit)](https://github.com/cloudbit-ch/devpod-provider-cloudbit)\n- [Flow (flowswiss/devpod-provider-flow)](https://github.com/flowswiss/devpod-provider-flow)\n- [Hetzner (mrsimonemms/devpod-provider-hetzner)](https://github.com/mrsimonemms/devpod-provider-hetzner)\n- [OVHcloud (alexandrevilain/devpod-provider-ovhcloud)](https://github.com/alexandrevilain/devpod-provider-ovhcloud)\n- [Scaleway (dirien/devpod-provider-scaleway)](https://github.com/dirien/devpod-provider-scaleway)\n- [Exoscale (dirien/devpod-provider-exoscale)](https://github.com/dirien/devpod-provider-exoscale)\n- [Multipass (minhio/devpod-provider-multipass)](https://github.com/minhio/devpod-provider-multipass)\n- [Open Telekom Cloud (akyriako/devpod-provider-opentelekomcloud)](https://github.com/akyriako/devpod-provider-opentelekomcloud)\n- [Vultr (navaneeth-dev/devpod-provider-vultr)](https://github.com/navaneeth-dev/devpod-provider-vultr)\n- [STACKIT (stackitcloud/devpod-provider-stackit)](https://github.com/stackitcloud/devpod-provider-stackit)\n\nThese providers can be installed with the DevPod CLI in the following form:\n```\ndevpod provider add <user/repository>\n```\n"
  },
  {
    "path": "docs/pages/managing-providers/delete-provider.mdx",
    "content": "---\ntitle: Delete a Provider\nsidebar_label: Delete a Provider\n---\n\n## Via DevPod Desktop Application\n\nNavigate to the 'Providers' view and click on the trash icon of the provider\nyou want to remove.\n\nIf a workspace is currently using the provider, you'll be prompted to first\nremove that workspace, in order to then remove the provider.\n\n## Via DevPod CLI\n\nAn already installed provider can be removed by using:\n\n```sh\ndevpod provider delete <provider name>\n```\n\n:::warning\n⚠️ **BE CAREFUL**:⚠️\nRemember first to delete any workspace related to this provider first, or move\nthem to another provider, else you'll not be able to interact with the workspace\nuntil you re-install the provider used.\n:::\n"
  },
  {
    "path": "docs/pages/managing-providers/update-provider.mdx",
    "content": "---\ntitle: Update a Provider\nsidebar_label: Update a Provider\n---\n\n\nTo update a provider to its latest version, you can use:\n\n```sh\ndevpod provider update <name>\n```\n\n:::info\nBe aware at this time, the desktop application does not have an update button\nfor a provider.\n:::\n\n## From GitHub\n\nSimilar to adding a provider, you can update via:\n```sh\ndevpod provider update <provider-name> my-org/my-repo\n```\n\nIf you want to update (or downgrade) a specific version, you can do:\n```sh\ndevpod provider update <provider-name> github.com/my-org/my-repo@v0.2.0\n```\n\n## From URL\n\nYou can also specify the URL to the `provider.yaml` file, for example:\n\n```sh\ndevpod provider update <provider-name> http://path/to/my/provider.yaml\n```\n\n### From File\n\nRun the following command to update provider `provider-name`:\n```sh\ndevpod provider update <provider-name> ../path-to-updated/provider.yaml\n```\n\n\n\n"
  },
  {
    "path": "docs/pages/managing-providers/what-are-providers.mdx",
    "content": "---\ntitle: What are Providers?\nsidebar_label: What are Providers?\n---\n\nProviders are simple CLI programs that let DevPod create, manage and run the workspaces requested by the user.\nIn the simplest form, a provider defines a command to create, delete and connect to a virtual machine in a cloud.\n\nDevPod relies on the provider model in order to allow flexibility and adaptability for any backend of choice.\nProviders in DevPod are defined through a `provider.yaml` that defines the necessary options, configuration, binaries and commands needed to handle workspace creation.\n\nSee the [Add a provider](./add-provider.mdx) section to learn more about how to add a provider to DevPod.\nSee [How to develop a provider](../developing-providers/quickstart.mdx) to learn more about how to create your own provider for DevPod.\n\n## Type of providers\n\nThere are two types of providers:\n\n* Machine providers\n* Non-machine providers\n\n### Machine providers\n\nMachine providers are those who will create and manage a VM for the workspace\nselected.\nAn example of a Machine provider is the AWS Provider, which uses EC2 instances to\nrun the environment.\nThese type of providers will also manage the lifecycle of the VM, starting/stopping\nand deleting it when needed.\n\n### Non-Machine providers\n\nNon-machine providers are those who will work directly with containers, instead\nof using VMs.\nAn example of this can be the SSH, Kubernetes and Docker providers.\nThose providers will **not** create any VMs, but instead directly run the workspace\ncontainer on the target.\n\n## Managing providers\n\nYou can head over the next sections on how to manage DevPod providers:\n\n- [Add a Provider](./add-provider.mdx)\n- [Update a Provider](./update-provider.mdx)\n- [Delete a provider](./delete-provider.mdx)\n"
  },
  {
    "path": "docs/pages/other-topics/advanced-guides/minikube-vscode-browser.mdx",
    "content": "---\ntitle: Kubernetes Provider with Minikube and VS Code Browser\nsidebar_label: Kubernetes Provider with Minikube\n---\n\nimport SetupVirtualbox from '../../fragments/setup-virtualbox.mdx'\n\nimport VirtualboxUbuntu2204 from '../../fragments/virtualbox-ubuntu-22.04.mdx'\n\n## Purpose\n\nThe purpose of this quickstart is to provide a small scale representation of on-premise Kubernetes and guide a new user through the configuration of a Kubernetes provider.\n\n<SetupVirtualbox />\n\n<VirtualboxUbuntu2204 />\n\n## Install Minikube on Ubuntu 22.04\n\nInstall dependencies for installing minikube and vscode\n```sh\nsudo apt update\nsudo apt install git vim gpg wget -y\n```\n\n### Install VSCODE\n\nFollow instructions from VSCODE Docs > [Linux Setup](https://code.visualstudio.com/docs/setup/linux)\n\n### Install Minikube\n\nClone Sander van Vugt's Ubuntu CKAD repository for his CKAD course [Certified Kubernetes Application Developer (CKAD), 2nd Edition, 4.3 Installing Minikube on Ubuntu. O'Reilly Course](https://learning.oreilly.com/videos/certified-kubernetes-application/9780137841509/9780137841509-CKAD_01_04_03/)\n\n```sh\ngit clone https://github.com/sandervanvugt/ckad.git\ncd ./ckad\n./minikube-docker-setup.sh\n```\n\n#### Create startup script\n\n```sh\ncd ~\ntouch minikube-start.sh\nsudo chmod u+x minikube-start.sh\n```\n\nAdd the following contents to minikube-start.sh:\n\n```bash\n#!/bin/bash\n\nminikube start --vm-driver=docker --cni=calico\n```\n\nNow to start minikube from home:\n\n```sh\n~./minikube-start.sh\n```\n\nNote: you need to start minikube between vm shutdown/reboots\n\n#### Test your install\n\nTest your install with the following command\n```sh\nkubectl get all\n```\n\nExample Result:\n```sh\nkubectl get all\nNAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE\nservice/kubernetes   ClusterIP   xxx.yyy.zzz.qqq    <none>        443/TCP   4d14h\n```\n\n## Install Devpods\n\nUsing the Devpods install for Linux deb [docs](https://devpod.sh/docs/getting-started/install)\n\nDownload the deb install\n\n```sh\n\ncd ~/\nwget https://github.com/loft-sh/devpod/releases/latest/download/DevPod_linux_amd64.deb?_gl=1*76i3lz*_ga*MTczNjE4NzI1My4xNjkxNDQ1ODU1*_ga_4RQQZ3WGE9*MTY5MjY4MTU4NS45LjAuMTY5MjY4MTU4Ny41OC4wLjA. -O DevPod_linux_amd64.deb\nsudo dpkg -i DevPod_linux_amd64.deb\n```\n\n### Test the Devpods install \n\nStart Devpods:\n\n```sh\ndev-pod\n```\n\n## Configure Minikube for the provider\n\nBefore configuring the kubernetes provider we need to create a persistent volume for the devcontainer and ensure we have a kubeconfig for the provider.\n\n### Create Kubernetes Persistent Volume for devcontainers\n\nKubernetes persistent volume [docs](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n\n```\nmkdir ~/devpods\ncd ~/devpods\ntouch devpod-pv.yml\nvim devpod-pv.yml # or your preferred text editor\n```\n\nEdit devpod-pv.yml and save\n```yaml\nkind: PersistentVolume\napiVersion: v1\nmetadata:\n  name: devpod-pv\n  labels:\n    type: devpod\nspec:\n  capacity:\n    storage: 1Gi\n  accessModes:\n    - ReadWriteOnce\n  hostPath:\n    path: \"/home/dev/devpods/share\"\n```\n\nCreate a directory for the persistent volume\n\n```sh\nmkdir /home/dev/devpods/share\n```\n\nCreate the persisent volume for the Kubernetes Provider.\n\n```sh\nkubectl create -f ~/devpods/devpod-pv.yml\n```\n\nConfirm the persisent volume has been created.\n\n```sh\nkubectl get pv\nNAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE\ndevpod-pv                                  1Gi        RWO            Retain           Available                                   12d\n```\n\n### Locate your kubeconfig\n\nList the director ~/.kube\n\n```sh\nls ~/.kube\ncache  completion.bash.inc  config\n```\n\nWithin .minikube the config file is the kubeconfig that can be used by Devpods kubernetes provider.\n\nWithin the kubernetes provider the kubeconfig path will be\n\n```\n/home/dev/.kube/config\n```\n\n**Note**\nThis is a simplification for a production setup where a kubeconfig should be provided for a kubernetes context, namespace and users. You will also need kubectl installed where your Devpods client is running from. The kubernetes provider uses the underlying kubectl providing the locally stored kubeconfig to access a remote cluster. This setup requires kubernetes administration support.\n\n### Identify your namespaces\n\nThe kubernetes provider requires a namespace and this example will use the 'default' namespace \n\n```sh\nkubectl get ns\nNAME              STATUS   AGE\ndefault           Active   12d\nkube-node-lease   Active   12d\nkube-public       Active   12d\nkube-system       Active   12d\n```\n\n## Add Provider\n\nAdd a provider via 'Providers' > '+ Add'. Select the kubernetes provider.\n\n<figure>\n  <img src=\"/docs/media/add-provider-1.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select Provider</figcaption>\n</figure>\n\n\n### Configure the Kubernetes Provider\n\n| Setting | Value |\n|---|---|\n| Kubernetes Namespace | default |\n| Disk Size | 1Gi |\n| Kubernetes Config | /home/dev/.kube/config |\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-kubernetes-provider-configuration.png\" alt=\"DevPod Flow\" />\n  <figcaption>Kubernetes Provider Configuration</figcaption>\n</figure>\n\nSelect **Add Provider**\n\n### Add a Workspace\n\n#### Start a Workspace with VS Code Browser\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. Make sure to select 'VS Code Browser' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-workspace.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-workspace-create.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically in the browser</figcaption>\n</figure>"
  },
  {
    "path": "docs/pages/other-topics/mobile-support.mdx",
    "content": "---\ntitle: Mobile Support\nsidebar_label: Mobile Support\n---\n\n## DevPod on mobile platforms\n\nAt the moment, DevPod **doesn't** officially support mobile platforms.\n\nYou can roll your own distribution or check out these community projects. Please open a [Github issue](https://github.com/loft-sh/devpod/issues) to add yours to the list.\n\n### Android\n- [Vanarok Fork](https://github.com/vanarok/devpod/blob/84c6d3ec6bc1b4ebc4c618696e58ca6b5d25571f/.github/workflows/release.yaml#L168)\n- [nix-on-droid](https://github.com/nix-community/nix-on-droid): `nix shell nixpkgs#devpod --extra-experimental-features nix-command --extra-experimental-features flakes`\n\n### iOS\nno projects\n \n"
  },
  {
    "path": "docs/pages/other-topics/telemetry.mdx",
    "content": "---\ntitle: Telemetry\nsidebar_label: Telemetry\n---\n\nIn this section, you will find a description of the DevPod telemetry - why we are collecting telemetry, what data points are we gathering, where we are sending the data, and how to opt-out.\n\n\n### Why do we collect telemetry\n\nBecause DevPod is a freely available open-source project, we as maintainers have a very limited idea of how the project is being used, and very limited possibilities to gather this information from the users. Without reliable information, it is difficult to make decisions about the prioritization of features, test automation, or bug fixes. Deprecation of the flags and features turns into guesswork, and removal becomes nearly impossible.\nTo move forward quickly, and ensure long-term maintainability, we will be making decisions about new features, deprecations, prioritizing test coverage, etc., and we want these decisions to be data-driven.\n\n\n### What are we collecting and how\n\nWhen a user executes a non-trivial CLI command, one that loads the configuration, the CLI will send an event about the command and basic information about the execution environment (Operating system, CPU architecture, DevPod version, etc.). Another event is sent if a command fails, or when it takes longer than 10 seconds to complete. The events are sent to our self-hosted backend.  \nWe want to emphasize that we are **not interested in collecting data about individuals** that are using DevPod, we are collecting **only data about how it is being used**. This should be evident from the code that implements telemetry on the CLI side, which is of course open source and included in the same source code repository.\n\n### Telemetry payload example\n\nBelow you can find an example of the payload that DevPod CLI would send to our telemetry backend.\n\n```yaml\n{\n  \"event\":{\n    \"type\":\"devpod_cli\",                   # type of event\n    \"machine_id\":\"3ed2c7...ee308e6\",  # securely hashed machine ID to de-duplicate information received from the same user\n    \"timestamp\":1683878643781772,\n    \"properties\": {\n      \"command\":\"devpod provider delete\",   # the CLI command that was executed\n      \"provider\":\"kubernetes\",              # the default provider\n      \"source_type\":\"git:\",                 # the workspace source type (git, image, local, container, unknown)\n      \"ide\":\"vscode\",                       # the IDE used to open a workspace\n      \"desktop\":\"true\",                     # whether this cli command has been executed by DevPod Desktop or is a direct CLI invocation\n      \"version\":\"v0.5.29\",                  # the CLI version\n      \"error\":\"provider 'docker' does not exist\" # an error that occurred during command execution\n    }\n  },\n  \"user\":{\n    \"machine_id\":\"3ed2c7...ee308e6\",  # securely hashed machine ID to de-duplicate information received from the same user\n    \"arch\":\"amd64\",                   # CPU architecture\n    \"os\":\"linux\",                     # Operating system\n  },\n}\n```\n\n### Telemetry opt-out process\n\nTo disable the telemetry, set the environment variable `DEVPOD_DISABLE_TELEMETRY=true`. It can also be opted out for individual context by executing the following command:\n\n```bash\ndevpod context set-options -o TELEMETRY=false\n```\n"
  },
  {
    "path": "docs/pages/quickstart/browser.mdx",
    "content": "---\ntitle: Quickstart VS Code Browser\nsidebar_label: VS Code Browser\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with VS Code Browser\n\nMake sure you have installed [DevPod](../getting-started/install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with VS Code Browser\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'VS Code Browser' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vscode-browser.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically in the browser</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/quickstart/devpod-cli.mdx",
    "content": "---\ntitle: Quickstart DevPod CLI\nsidebar_label: DevPod CLI\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with DevPod CLI\n\nMake sure you have installed [DevPod CLI](../getting-started/install.mdx#optional-install-devpod-cli) on your system.\n\n### Add a Provider\n\nYou can add a provider via (local-docker for example):\n\n```\ndevpod provider add docker\n```\n\n:::info Other providers\nFor more providers, please take a look at [Add a DevPod Provider](../managing-providers/add-provider.mdx)\n:::\n\n### Start a Workspace\n\nAfterwards you can start a workspace via:\n\n```\n# Start in VS Code browser\ndevpod up github.com/microsoft/vscode-remote-try-node --ide openvscode\n\n# Start in VS Code\ndevpod up github.com/microsoft/vscode-remote-try-node --ide vscode\n\n# Start without IDE\ndevpod up github.com/microsoft/vscode-remote-try-node --ide none\n```\n\nIf you have selected an IDE it should popup automatically. If not, you can connect to the workspace manually:\n\n```\nssh MY_WORKSPACE_NAME.devpod\n```\n"
  },
  {
    "path": "docs/pages/quickstart/jetbrains.mdx",
    "content": "---\ntitle: Quickstart JetBrains (IntelliJ etc.)\nsidebar_label: JetBrains (IntelliJ etc.)\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with JetBrains\n\nMake sure you have installed [DevPod](../getting-started/install.mdx) on your system.\n\n### Install Prerequisites\n\nMake sure to install the following prerequisites:\n* [Jetbrains IDE](https://www.jetbrains.com/)\n* [Jetbrains Gateway](https://www.jetbrains.com/remote-development/gateway/)\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select a JetBrains IDE under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-jetbrains.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, JetBrains Gateway should automatically open with a prefilled form for the workspace.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>JetBrains Gateway opens automatically</figcaption>\n</figure>\n\nPress 'Check Connection and Continue' without changing any configuration. This should start the IDE in the workspace. After the IDE has been initialized, your JetBrains IDE should open up inside the workspace.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-jetbrains-3.png\" alt=\"DevPod Flow\" />\n  <figcaption>IDE opens within the workspace</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/quickstart/ssh.mdx",
    "content": "---\ntitle: Quickstart SSH\nsidebar_label: SSH\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with SSH\n\nMake sure you have installed [DevPod](../getting-started/install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with SSH\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'None' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-ssh.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-ssh.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, you can connect to the workspace via ssh:\n\n```\nssh MY_WORKSPACE_NAME.devpod\n```\n\n### Using environment variables in your .devcontainer.json\n\nIf you want to use env variables e.g. for dynamic control over container image version\nplease follow this instruction: [Environment variables in devcontainer.json](../developing-in-workspaces/environment-variables-in-devcontainer-json.mdx)\n"
  },
  {
    "path": "docs/pages/quickstart/vim.mdx",
    "content": "---\ntitle: Quickstart Vim/Neovim\nsidebar_label: Vim/Neovim\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with Vim/Nvim\n\nMake sure you have installed [DevPod](../getting-started/install.mdx) on your system.\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with Vim/Neovim\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'None' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vim.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vim.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace.\nAfter the workspace was created, you have a two options to start coding in vim:\n\n#### Netrw/SCP\n\nVim/Neovim allow you to edit remote files using [Netrw](https://www.vim.org/scripts/script.php?script_id=1075). \nYou can connect it either from within vim `:e scp://[user@]machine[[:#]port]/path` or by starting vim with `vim scp://[user@]machine[[:#]port]/path`.\nWhen you open the workspace, the DevPod logs give you the user/machine combination you'll need to connect to the workspace, usually in the format of `WORKSPACE_NAME.devpod` \n\n#### Spinning up your vim config in the workspace\n\nSince DevPods target environment is a docker container, you can also ssh into it and install your vim/neovim configuration like you would on any new machine.\nTo connect to the workspace, run the command DevPod gives you after starting the workspace, usually `ssh WORKSPACE_NAME.devpod`.\n"
  },
  {
    "path": "docs/pages/quickstart/vscode.mdx",
    "content": "---\ntitle: Quickstart VS Code\nsidebar_label: VS Code\n---\n\nimport AddProvider from '../fragments/add-provider.mdx'\n\n## Quickstart with VS Code\n\nMake sure you have installed [DevPod](../getting-started/install.mdx) on your system.\n\n### Install Prerequisites\n\nMake sure to install the following prerequisites:\n* [VS Code](https://code.visualstudio.com/download)\n\n### Add a Provider\n\n<AddProvider />\n\n### Start a Workspace with VS Code\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. \n\n<figure>\n<img src=\"/docs/media/create-workspace-repo.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nMake sure to select 'VS Code' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select IDE</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-final-vscode.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically</figcaption>\n</figure>\n\n"
  },
  {
    "path": "docs/pages/troubleshooting/ide-troubleshooting.mdx",
    "content": "---\ntitle: IDE Troubleshooting\nsidebar_label: IDE Troubleshooting\n---\n\nThis purpose of this page is to outline any known issues with using devpod on unsupported IDEs using the SSH provider\n\n### NeoVim\n\nSome issues such as setting $TERM have been noticed on NeoVim, a solution has been documented [here](https://github.com/loft-sh/devpod/issues/1187)"
  },
  {
    "path": "docs/pages/troubleshooting/linux-troubleshooting.mdx",
    "content": "---\ntitle: Linux Troubleshooting\nsidebar_label: Linux Troubleshooting\n---\n\nThis purpose of this page is to outline any known issues with using devpod on Linux and provide known workarounds / fixes.\n\n### File permission issues when using a local directory and a remoteUser (or containerUser)\n\nWhen up'ing a workspace using a local directory, that also specifies a remote container user (via devcontainer.json), the ownership of the directory will change\nto the remote user. Since this remote user is in a different user namespace, the ownership will appear as a unknown user. To fix this, simply chown the directory\nback to the local user, such as `sudo chown -R $USER:$GROUP .`. The reason this is neccesary is by default, when a new user is created by the container runtime,\nsuch as docker, all files from the host file system will be owned by root during the overlay. For your dev environment to be useful remotely, DevPod needs to\nchown the workspace to the remote user. Once the workspace has stopped, you need to change the ownership back. In general local direcotories are typically used\nfor development, once the devcontainer is working it is better to push the workspace to a git repo and use this.\n\n### Using FISH shell\n\nCustom configurations in config.fish file run every time a fish -c command is called, so this processes somewhat get on the way of devpod agent workspace up.\n\nThe solution is to move the customizations inside the if status is-interactive case.\n\nFrom this\n\n```\nif status is-interactive\n    # Commands to run in interactive sessions can go here\nend\neval \"$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)\"\n\n# customizations\n```\n\nto this\n\n```\nif status is-interactive\n    # Commands to run in interactive sessions can go here\n    eval \"$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)\"\n    \n    # customizations\nend\n```\n\n### Using SELinux\n\nIf you are running SELinux and try to start a workspace with a mounted volume, you may recieve a \"Permission Denied\" even if the ownership of the files are correct. To resolve\nappend `:Z` to your volume definitions, like so\n\n```\n{\n    // some fields\n\n    \"workspaceMount\": \"\",\n    \"workspaceFolder\": \"/workspaces/${localWorkspaceFolderBasename}\",\n    \"runArgs\": [\n        // other args\n        \"--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z\"\n    ]\n}\n```\n\n### ENAMETOOLONG error when opening a workspace in vscode\n\nThere is a [known issue](https://github.com/loft-sh/devpod/issues/1045) where some linux distros use a large PATH to find SSH and causes the connection string to be too long. The workaround is to specify\nthe SSH binary explicitly in vscode."
  },
  {
    "path": "docs/pages/troubleshooting/troubleshooting.mdx",
    "content": "---\ntitle: Troubleshooting\nsidebar_label: Troubleshooting\n---\n\nThis purpose of this page is to outline any known issues with using devpod and provide known workarounds / fixes.\n\n### Utilities not found in PATH\n\nIf DevPod Desktop reports that it cannot find utilities in the PATH, you may need to wrap the call in a shell. Something like\n\n```\n#! /usr/bin/env sh\n\nexec $SHELL -c 'exec /Applications/DevPod.app/Contents/MacOS/DevPod'\n```\n\n### Port forwarding not working when NOT using an ide\n\nDevPod relies on an active SSH session to perform port forwarding to the local host. When running DevPod without an IDE, such as `--ide none`,\nan active SSH session needs to be open using `devpod ssh {workspace}` (unless you are specifying forwarded ports using docker compose).\n"
  },
  {
    "path": "docs/pages/troubleshooting/windows-troubleshooting.mdx",
    "content": "---\ntitle: Windows Troubleshooting\nsidebar_label: Windows Troubleshooting\n---\n\nThis purpose of this page is to outline any known issues with using devpod on Windows and provide known workarounds / fixes.\n\n### line 2: $'\\r': command not found\n\nErrors like this are caused from windows line endings, to fix add the following to `.gitattributes`\n\n```\n*.sh eol=lf\n```"
  },
  {
    "path": "docs/pages/tutorials/docker-provider-via-wsl.mdx",
    "content": "---\ntitle: Docker provider via WSL\nsidebar_label: Docker provider via WSL\n---\n\n## Purpose\n\nThe purpose of this quickstart is to provide a Docker environment via WSL, and a guide on how to integrate DevPod to Docker running in WSL.\n\nThere are 3 parts to this tutorial. \n1. Step 1 to Step 5 relates to installing Docker in WSL\n2. Step 6 and Step 7 relate to integrating Docker client (for Windows) with Docker daemon in WSL\n3. Step 8 relates to Integrating DevPod with Docker in WSL\n\n## Installing Docker in WSL\n\n### 1. Enable WSL2 feature\n\nTo enable WSL2 on your Windows machine, run this command in **Powershell (run as Administrator)**. Make sure to restart your computer after this command is completed.\n\nYou can skip this if you have installed WSL2 previously.\n\n```\ndism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart\n```\n\n### 2. Install WSL2 Distro\n\nInstall `Ubuntu-24.04`. Supply the `username` and `password` when asked.\n\n```\nwsl --install Ubuntu-24.04\n```\n\nTo access the Ubuntu shell, type `wsl` in Powershell.\n\n### 3. Install Docker in Ubuntu-24.04\n\nUse the command below to install the Docker engine on Ubuntu 24.04.\n\n```\n#!/bin/bash\n# If your machine is behind corporate firewall, \n# make sure to define your HTTP_PROXY and HTTPS_PROXY before running the command below\n\nsudo apt-get update\nsudo apt-get install ca-certificates curl\nsudo install -m 0755 -d /etc/apt/keyrings\nsudo -E curl --verbose -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc\nsudo chmod a+r /etc/apt/keyrings/docker.asc\n\n# Add the repository to Apt sources:\necho \\\n  \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \\\n  $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\nsudo apt-get update\nsudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\n\nsudo usermod -aG docker $USER\nsudo systemctl enable docker.service\nsudo systemctl enable containerd.service\n\nsudo systemctl start docker.service\nsudo systemctl start containerd.service\n\n```\n\n### 4. [optional] Configure docker daemon proxy\n\n```\n#!/bin/bash\n# If your machine is behind corporate firewall, \n# make sure to define your HTTP_PROXY and HTTPS_PROXY before running the command below\n\nsudo mkdir -p /etc/systemd/system/docker.service.d\nsudo touch /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"[Service]\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='HTTP_PROXY=$HTTP_PROXY'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='HTTPS_PROXY=$HTTPS_PROXY'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='NO_PROXY=$NO_PROXY'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='http_proxy=$http_proxy'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='https_proxy=$https_proxy'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\necho \"Environment='no_proxy=$no_proxy'\" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf\n\n# restart docker daemon\nsudo systemctl daemon-reload\nsudo systemctl restart docker.service\nsudo systemctl restart containerd.service\n```\n\n### 5. Expose docker daemon to windows via port 2375\n\nThis command allows the Docker daemon to receive instructions from port `2375`. This also means that we can access port `2375` from Windows.\n\n```\n#!/bin/bash\nsudo cp /lib/systemd/system/docker.service /etc/systemd/system/\nsudo sed -i 's/\\ -H\\ fd:\\/\\//\\ -H\\ fd:\\/\\/\\ -H\\ tcp:\\/\\/127.0.0.1:2375/g' /etc/systemd/system/docker.service\nsudo systemctl daemon-reload\nsudo systemctl restart docker.service\n```\n\n## Integrate Docker client (for Windows) with Docker daemon in WSL\n\n### 6. Download the Docker client for Windows\n\nDownload the docker client from [this url](https://download.docker.com/win/static/stable/x86_64/). At the time of writing, the latest version is `docker-27.5.1.zip`. \nExtract the downloaded zip, and add the folder to your PATH environment variable.\n\nVerify that everything works by typing `docker` in a new Powershell.\n\n### 7. Integrate Docker Windows client with Docker installed in WSL\n\n```\n# run this command in Powershell\n\ndocker --version\ndocker context create lin --docker host=tcp://127.0.0.1:2375\ndocker context use lin\ndocker run hello-world\n```\n\n## Integrate DevPod with Docker in WSL\n\n### 8. Setup DevPod Docker provider to use Docker installed in WSL\n\nSet `Docker Host` as `tcp://127.0.0.1:2375` and `Docker Path` as `docker`.\n\n<figure>\n  <img src=\"/docs/media/docker-provider-via-wsl.png\" alt=\"set docker provider to use tcp://127.0.0.1:2375\" />\n  <figcaption>set docker provider to use tcp://127.0.0.1:2375</figcaption>\n</figure>\n\n## Summary\n\nFollowing this tutorial, you should be able to use DevPod with a Docker provider running in WSL. \nYou can try any of the examples in `Create Workspace`.\n\n"
  },
  {
    "path": "docs/pages/tutorials/minikube-vscode-browser.mdx",
    "content": "---\ntitle: Kubernetes Provider with Minikube and VS Code Browser\nsidebar_label: Kubernetes Provider with Minikube\n---\n\nimport SetupVirtualbox from '../fragments/setup-virtualbox.mdx'\n\nimport VirtualboxUbuntu2204 from '../fragments/virtualbox-ubuntu-22.04.mdx'\n\n## Purpose\n\nThe purpose of this quickstart is to provide a small scale representation of on-premise Kubernetes and guide a new user through the configuration of a Kubernetes provider.\n\n<SetupVirtualbox />\n\n<VirtualboxUbuntu2204 />\n\n## Install Minikube on Ubuntu 22.04\n\nInstall dependencies for installing minikube and vscode\n```sh\nsudo apt update\nsudo apt install git vim gpg wget -y\n```\n\n### Install VSCODE\n\nFollow instructions from VSCODE Docs > [Linux Setup](https://code.visualstudio.com/docs/setup/linux)\n\n### Install Minikube\n\nClone Sander van Vugt's Ubuntu CKAD repository for his CKAD course [Certified Kubernetes Application Developer (CKAD), 2nd Edition, 4.3 Installing Minikube on Ubuntu. O'Reilly Course](https://learning.oreilly.com/videos/certified-kubernetes-application/9780137841509/9780137841509-CKAD_01_04_03/)\n\n```sh\ngit clone https://github.com/sandervanvugt/ckad.git\ncd ./ckad\n./minikube-docker-setup.sh\n```\n\n#### Create startup script\n\n```sh\ncd ~\ntouch minikube-start.sh\nsudo chmod u+x minikube-start.sh\n```\n\nAdd the following contents to minikube-start.sh:\n\n```bash\n#!/bin/bash\n\nminikube start --vm-driver=docker --cni=calico\n```\n\nNow to start minikube from home:\n\n```sh\n~./minikube-start.sh\n```\n\nNote: you need to start minikube between vm shutdown/reboots\n\n#### Test your install\n\nTest your install with the following command\n```sh\nkubectl get all\n```\n\nExample Result:\n```sh\nkubectl get all\nNAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE\nservice/kubernetes   ClusterIP   xxx.yyy.zzz.qqq    <none>        443/TCP   4d14h\n```\n\n## Install Devpods\n\nUsing the Devpods install for Linux deb [docs](https://devpod.sh/docs/getting-started/install)\n\nDownload the deb install\n\n```sh\n\ncd ~/\nwget https://github.com/loft-sh/devpod/releases/latest/download/DevPod_linux_amd64.deb?_gl=1*76i3lz*_ga*MTczNjE4NzI1My4xNjkxNDQ1ODU1*_ga_4RQQZ3WGE9*MTY5MjY4MTU4NS45LjAuMTY5MjY4MTU4Ny41OC4wLjA. -O DevPod_linux_amd64.deb\nsudo dpkg -i DevPod_linux_amd64.deb\n```\n\n### Test the Devpods install \n\nStart Devpods:\n\n```sh\ndev-pod\n```\n\n## Configure Minikube for the provider\n\nBefore configuring the kubernetes provider we need to create a persistent volume for the devcontainer and ensure we have a kubeconfig for the provider.\n\n### Create Kubernetes Persistent Volume for devcontainers\n\nKubernetes persistent volume [docs](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n\n```\nmkdir ~/devpods\ncd ~/devpods\ntouch devpod-pv.yml\nvim devpod-pv.yml # or your preferred text editor\n```\n\nEdit devpod-pv.yml and save\n```yaml\nkind: PersistentVolume\napiVersion: v1\nmetadata:\n  name: devpod-pv\n  labels:\n    type: devpod\nspec:\n  capacity:\n    storage: 1Gi\n  accessModes:\n    - ReadWriteOnce\n  hostPath:\n    path: \"/home/dev/devpods/share\"\n```\n\nCreate a directory for the persistent volume\n\n```sh\nmkdir /home/dev/devpods/share\n```\n\nCreate the persisent volume for the Kubernetes Provider.\n\n```sh\nkubectl create -f ~/devpods/devpod-pv.yml\n```\n\nConfirm the persisent volume has been created.\n\n```sh\nkubectl get pv\nNAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE\ndevpod-pv                                  1Gi        RWO            Retain           Available                                   12d\n```\n\n### Locate your kubeconfig\n\nList the director ~/.kube\n\n```sh\nls ~/.kube\ncache  completion.bash.inc  config\n```\n\nWithin .minikube the config file is the kubeconfig that can be used by Devpods kubernetes provider.\n\nWithin the kubernetes provider the kubeconfig path will be\n\n```\n/home/dev/.kube/config\n```\n\n**Note**\nThis is a simplification for a production setup where a kubeconfig should be provided for a kubernetes context, namespace and users. You will also need kubectl installed where your Devpods client is running from. The kubernetes provider uses the underlying kubectl providing the locally stored kubeconfig to access a remote cluster. This setup requires kubernetes administration support.\n\n### Identify your namespaces\n\nThe kubernetes provider requires a namespace and this example will use the 'default' namespace \n\n```sh\nkubectl get ns\nNAME              STATUS   AGE\ndefault           Active   12d\nkube-node-lease   Active   12d\nkube-public       Active   12d\nkube-system       Active   12d\n```\n\n## Add Provider\n\nAdd a provider via 'Providers' > '+ Add'. Select the kubernetes provider.\n\n<figure>\n  <img src=\"/docs/media/add-provider-1.png\" alt=\"DevPod Flow\" />\n  <figcaption>Select Provider</figcaption>\n</figure>\n\n\n### Configure the Kubernetes Provider\n\n| Setting | Value |\n|---|---|\n| Kubernetes Namespace | default |\n| Disk Size | 1Gi |\n| Kubernetes Config | /home/dev/.kube/config |\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-kubernetes-provider-configuration.png\" alt=\"DevPod Flow\" />\n  <figcaption>Kubernetes Provider Configuration</figcaption>\n</figure>\n\nSelect **Add Provider**\n\n### Add a Workspace\n\n#### Start a Workspace with VS Code Browser\n\nNavigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples. Make sure to select 'VS Code Browser' under 'Default IDE'\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-workspace.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nThen press 'Create Workspace'.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-virtualbox-workspace-create.png\" alt=\"DevPod Flow\" />\n  <figcaption>Create Workspace</figcaption>\n</figure>\n\nA new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.\n\n<figure>\n  <img src=\"/docs/media/create-workspace-vscode-browser-2.png\" alt=\"DevPod Flow\" />\n  <figcaption>VS Code opens automatically in the browser</figcaption>\n</figure>"
  },
  {
    "path": "docs/pages/tutorials/reduce-build-times-with-cache.mdx",
    "content": "---\ntitle: Reduce build times with remote caching\nsidebar_label: Reduce build times\n---\n\nDevpod provides the ability to use a registry as a remote backend cache for your container builds. To enable it perform\n\n```\ndevpod context set-options -o REGISTRY_CACHE={registry}\n```\n\nwhere registry follows the syntax \"\\{domain\\}/\\{project\\}/\\{repo\\}\", such as gcr.io/my-project/my-dev-env\n\n\nIf using the docker provider, ensure your docker environment has the image snapshotter enabled in your daemon (https://docs.docker.com/engine/storage/containerd/)\n```\ncat /etc/docker/daemon.json\n\n{\n  \"features\": {\n    \"containerd-snapshotter\": true\n  }\n}\n```\n\nThen prebuild your image, this will populate the registry cache so that developers that need to build updates can build on top of the existing pre build.\n\n```\ndevpod build my-workspace\n```\n\nNow the next time you or anyone in your team needs to build an image, it can pull from the cache. If you've made changes to your environment, then DevPod will detect these changes and are \nbuilt on top of the existing image layers.\n\n\n#### How does DevPod detect changes?\n\nDevpod parses your Dockerfile and .devcontainer.json to detect file paths that can affect your build context. Devpod traverses these files and makes a hash of the file contents to use as the \ncontainer's image tag. When you make changes to these files, the hash will change causing a rebuild. Thanks to the remote cache the previous layers will be built so only changes are needed. To \nreduce build times it is recommened to follow docker's best practices when writing Dockerfiles.\n\n#### Why Kaniko?\n\nWhen DevPod uses the kubernetes driver and needs to build a devcontainer, but your local environment does not have a container runtime, it builds the container in the cluster. It does so using\nKaniko, Kaniko builds the container in userspace and does not require super user priveleges. This is much more secure than docker in docker, where the docker daemon is either mounted locally on \nthe container or over a network within the cluster, neither being ideal."
  },
  {
    "path": "docs/pages/what-is-devpod.mdx",
    "content": "---\ntitle: What is DevPod?\nsidebar_label: What is DevPod?\n---\n\nDevPod is a tool used to create reproducible developer environments. Each developer environment runs in a separate container and is specified through a [devcontainer.json](https://containers.dev/). [DevPod providers](./managing-providers/what-are-providers) can create these containers on the local computer, any reachable remote machine, or in a public or private cloud. It's also possible to extend DevPod and write your own custom providers.\n\n<figure>\n  <img src=\"/docs/media/devpod-flow.gif\" alt=\"DevPod Flow\" />\n  <figcaption>DevPod</figcaption>\n</figure>\n\nYou can think of DevPod as the glue connecting your local IDE to a machine you want to use for development. So depending on your project's requirements, you can create a workspace locally on the computer, a powerful cloud machine, or a spare remote computer. Within DevPod, every workspace is managed the same way, which also makes it easy to switch between workspaces that might be hosted somewhere else.\n\n\n<figure>\n  <img src=\"/docs/media/devpod-architecture-2.png\" alt=\"DevPod Architecture\" />\n  <figcaption>DevPod - Architecture</figcaption>\n</figure>\n\n## Why DevPod?\n\nDevPod reuses the open [DevContainer standard](https://containers.dev/) to create a consistent developer experience no matter what backend you want to use.\n\n<figure>\n  <img src=\"/docs/media/codespaces-but.png\" alt=\"What is DevPod\" />\n</figure>\n\nCompared to hosted services such as Github Codespaces, JetBrains Spaces or Google Cloud Workstations, DevPod has the following advantages:\n* **Cost savings**: DevPod is usually around 5-10 times cheaper than existing services with comparable feature sets, because it uses bare virtual machines and shuts down unused virtual machines automatically.\n* **No vendor lock-in**: Choose whatever cloud provider suits you best, be it the cheapest one or the most powerful, DevPod supports all cloud providers. If you are tired of using a provider, change it with a single command.\n* **Local development**: You get the same developer experience also locally, so you don't need to rely on a cloud provider at all.\n* **Cross IDE support**: VS Code and the full JetBrains suite is supported, all others can be connected through simple SSH.\n* **Client-only**: No need to install a server backend, DevPod runs solely on your computer.\n* **Open-Source**: DevPod is 100% open-source and extensible. A provider doesn't exist? Just create your own.\n* **Rich feature set**: DevPod already supports prebuilds, auto inactivity shutdown, git & docker credentials sync and many more features to come.\n* **Desktop App**: DevPod comes with an easy-to-use desktop application that abstracts all the complexity away. If you want to build your own integration, DevPod offers a feature-rich CLI as well.\n"
  },
  {
    "path": "docs/public/_redirects",
    "content": "# Home Routes\n/                                               /docs/what-is-devpod                   301!\n/docs                                           /docs/what-is-devpod                   301!\n"
  },
  {
    "path": "docs/sidebars.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nmodule.exports = {\n  adminSidebar: [\n    {\n      type: \"doc\",\n      id: \"what-is-devpod\",\n    },\n    {\n      type: \"category\",\n      label: \"Getting Started\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"getting-started/install\",\n        },\n        {\n          type: \"doc\",\n          id: \"getting-started/update\",\n        },\n        {\n          type: \"category\",\n          label: \"Quick Start\",\n          items: [\n            {\n              type: \"doc\",\n              id: \"quickstart/browser\",\n            },\n            {\n              type: \"doc\",\n              id: \"quickstart/vscode\",\n            },\n            {\n              type: \"doc\",\n              id: \"quickstart/jetbrains\",\n            },\n            {\n              type: \"doc\",\n              id: \"quickstart/ssh\",\n            },\n            {\n              type: \"doc\",\n              id: \"quickstart/vim\",\n            },\n            {\n              type: \"doc\",\n              id: \"quickstart/devpod-cli\",\n            },\n          ],\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Developing in a Workspace\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/what-are-workspaces\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/create-a-workspace\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/connect-to-a-workspace\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/devcontainer-json\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/environment-variables-in-devcontainer-json\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/prebuild-a-workspace\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/dotfiles-in-a-workspace\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/credentials\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/inactivity-timeout\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/stop-a-workspace\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-in-workspaces/delete-a-workspace\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Managing your Machines\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"managing-machines/what-are-machines\",\n        },\n        {\n          type: \"doc\",\n          id: \"managing-machines/manage-machines\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Managing your Providers\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"managing-providers/what-are-providers\",\n        },\n        {\n          type: \"doc\",\n          id: \"managing-providers/add-provider\",\n        },\n        {\n          type: \"doc\",\n          id: \"managing-providers/update-provider\",\n        },\n        {\n          type: \"doc\",\n          id: \"managing-providers/delete-provider\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Architecture\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"how-it-works/overview\",\n        },\n        {\n          type: \"doc\",\n          id: \"how-it-works/deploy-machines\",\n        },\n        {\n          type: \"doc\",\n          id: \"how-it-works/deploy-k8s\",\n        },\n        {\n          type: \"doc\",\n          id: \"how-it-works/building-workspaces\",\n        },\n        {\n          type: \"doc\",\n          id: \"how-it-works/deploying-workspaces\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Tutorials\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"tutorials/minikube-vscode-browser\",\n        },\n        {\n          type: \"doc\",\n          id: \"tutorials/reduce-build-times-with-cache\",\n        },\n        {\n          type: \"doc\",\n          id: \"tutorials/docker-provider-via-wsl\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Developing Providers\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"developing-providers/quickstart\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-providers/options\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-providers/binaries\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-providers/agent\",\n        },\n        {\n          type: \"doc\",\n          id: \"developing-providers/driver\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Troubleshooting\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"troubleshooting/troubleshooting\",\n        },\n        {\n          type: \"doc\",\n          id: \"troubleshooting/linux-troubleshooting\",\n        },\n        {\n          type: \"doc\",\n          id: \"troubleshooting/windows-troubleshooting\",\n        },\n        {\n          type: \"doc\",\n          id: \"troubleshooting/ide-troubleshooting\",\n        },\n      ],\n    },\n    {\n      type: \"category\",\n      label: \"Other topics\",\n      items: [\n        {\n          type: \"doc\",\n          id: \"other-topics/telemetry\",\n        },\n        {\n          type: \"doc\",\n          id: \"other-topics/mobile-support\",\n        }\n      ],\n    },\n    {\n      type: \"doc\",\n      id: \"licenses/devpod\",\n    },\n    {\n      type: \"link\",\n      label: \"Open Sourced by Loft\",\n      href: \"https://loft.sh/\",\n    },\n  ],\n};\n"
  },
  {
    "path": "docs/src/components/Highlight/Highlight.js",
    "content": "import React from 'react';\nimport styles from './styles.module.css';\n\nexport default class Highlight extends React.Component {\n  render() {\n    let {children, ...highlightStyle} = this.props\n\n    return <span style={highlightStyle} className={`${styles.highlight} ${this.props.className}`}> {children} </span>;\n  }\n}"
  },
  {
    "path": "docs/src/components/Highlight/styles.module.css",
    "content": ".highlight {\n  display: inline-block;\n  margin-bottom: 0.4em;\n  padding: 0.2em 0.4em 0.2em 0.5em;\n  color: #fff;\n  font-weight: 600;\n  background-color: var(--ifm-color-primary);\n  border-radius: 4px;\n}"
  },
  {
    "path": "docs/src/components/Step/Step.js",
    "content": "import React from 'react';\nimport styles from './styles.module.css';\nimport Highlight from '../Highlight/Highlight';\n\nexport default class Step extends React.Component {\n  render() {\n    let {children, ...props} = this.props\n\n    props.className += ` ${styles.step}`\n\n    return <Highlight {...props}>STEP {children}</Highlight>;\n  }\n}"
  },
  {
    "path": "docs/src/components/Step/styles.module.css",
    "content": ".step {\n  float: left;\n  margin-top: -0.2em;\n  margin-right: 0.7em;\n  background-color: #8fa6b2 !important;\n}\n\n.step + h2,\n.step + h3,\n.step + h4,\n.step + h5 {\n  display: inline-block;\n}\n\n.step:global(.h2) {\n  margin-top: calc(var(--ifm-h2-vertical-rhythm-top) * var(--ifm-h2-font-size) * var(--ifm-leading-number));\n}\n\n.step:nth-of-type(1) + h2 {\n  margin-top: 0;\n}\n\n.step + h2 :global(.hash-link) {\n  left: 0;\n}"
  },
  {
    "path": "docs/src/css/custom.css",
    "content": "/**\n * Any CSS included here will be global. The classic template\n * bundles Infima by default. Infima is a CSS framework designed to\n * work well for content-centric websites.\n */\n\n.table-of-contents__link {\n  position: relative;\n}\n\n.table-of-contents__link--active::before {\n  content: \" \";\n  background: var(--ifm-color-primary);\n  position: absolute;\n  left: -17px;\n  top: -5px;\n  bottom: -5px;\n  width: 6px;\n}\n\nul ul .table-of-contents__link--active::before {\n  left: -32px;\n}\n\n.menu::-webkit-scrollbar,\n.menu::-webkit-scrollbar-thumb,\n.menu::-webkit-scrollbar-track {\n  transition: all 0.3s !important;\n  border-radius: 0 !important;\n}\n\n.menu:not(:hover)::-webkit-scrollbar,\n.menu:not(:hover)::-webkit-scrollbar-thumb,\n.menu:not(:hover)::-webkit-scrollbar-track {\n  background-color: #fff !important;\n}\n\n[data-theme=\"dark\"] .menu:not(:hover)::-webkit-scrollbar,\n[data-theme=\"dark\"] .menu:not(:hover)::-webkit-scrollbar-thumb,\n[data-theme=\"dark\"] .menu:not(:hover)::-webkit-scrollbar-track {\n  background-color: #1b1b1d !important;\n}\n\n.menu__list {\n  margin-right: 0;\n}\n\n.menu__link {\n  outline: none;\n  font-weight: 400;\n}\n\n.menu__list-item > .menu__list .menu__list-item {\n  margin: 0 !important;\n  padding: 0 0 0.2em 0.8em;\n}\n\n.menu__list-item > .menu__list .menu__link {\n  position: relative;\n  margin: 0 !important;\n  padding: 0.1em 0 0.1em 0.2em;\n  background: transparent;\n}\n\n.menu\n  > .menu__list\n  > .menu__list-item\n  > .menu__list\n  .menu__list-item:not(.menu__list-item--collapsed)\n  .menu__list {\n  font-size: 0.85em;\n  margin-top: 0.3em;\n}\n\n.menu__list-item > .menu__list .menu__link:hover {\n  color: var(--ifm-color-primary);\n}\n\n.menu__list-item > .menu__list .menu__link--active {\n  font-weight: 600;\n}\n\n.menu__list > .menu__list-item:nth-child(2) > .menu__link--sublist::after {\n  display: none;\n}\n\n.menu > .menu__list > .menu__list-item:nth-child(-n + 7) {\n  margin: 1em 0;\n}\n\n.menu\n  > .menu__list\n  > .menu__list-item:nth-child(-n + 7)\n  > .menu__link--sublist {\n  pointer-events: none;\n  color: var(--ifm-menu-color) !important;\n  font-weight: 500;\n  text-transform: uppercase;\n}\n\n.menu\n  > .menu__list\n  > .menu__list-item:nth-child(-n + 7)\n  > .menu__link--sublist::after {\n  display: none;\n}\n\n.menu > .menu__list > .menu__list-item:last-child {\n  margin-top: 1.5em;\n  padding-top: 1.5em;\n  border-top: 1px solid #e9e9e9;\n}\n\n.markdown figure figcaption {\n  z-index: 1;\n}\n\n.markdown p + ul {\n  margin-top: -1.2em !important;\n  margin-bottom: 1.4em !important;\n}\n\n.markdown ul > li {\n  margin-top: 0 !important;\n}\n\n.markdown h2,\n.markdown h3 {\n  margin-top: 2.4em;\n  line-height: 1em;\n}\n\n.markdown .step_src-components-Step- {\n  margin-top: 0.8em !important;\n}\n\n.markdown .step_src-components-Step- + h2,\n.markdown .step_src-components-Step- + h3,\n.markdown .step_src-components-Step- + h4,\n.markdown .step_src-components-Step- + h5,\n.markdown .step_src-components-Step- + p {\n  display: inline-block;\n  margin-top: 1em;\n  margin-bottom: 0.9em;\n}\n\n:root {\n  --ifm-color-info: #077eec;\n  --ifm-color-success: rgb(64, 185, 255);\n  --ifm-color-warning: #ed7200;\n  --ifm-color-error: #c21b1b;\n}\n\nul[role=\"tablist\"] {\n  margin-top: -0.6em;\n  border-bottom: none;\n}\n\nul[role=\"tablist\"] li,\nul[role=\"tablist\"] li:hover {\n  background: transparent;\n  padding: 0.5em 1.2em;\n}\n\nul[role=\"tablist\"] li:not([aria-selected=\"true\"]):hover {\n  border-bottom-color: #a6acd0;\n}\n\n[role=\"tabpanel\"] {\n  background-color: #f7f8fc;\n  padding: 1.3em;\n  margin: 0 -0.2em 1.8em !important;\n  border: 1px solid #d2e8fd !important;\n  border-radius: 5px;\n}\n\n[role=\"tabpanel\"] [role=\"tabpanel\"] {\n  background-color: #fff;\n  margin-left: -5px !important;\n  margin-right: -5px !important;\n  border-radius: 3px;\n}\n\n.tabs + div {\n  margin-top: 0 !important;\n}\n\n.tabs__item {\n  border-bottom-left-radius: 0;\n  border-bottom-right-radius: 0;\n}\n\n.markdown p + ul,\n.markdown p + ol {\n  margin-top: calc(-0.5 * var(--ifm-paragraph-margin-bottom));\n  margin-bottom: calc(0.8 * var(--ifm-paragraph-margin-bottom));\n}\n\n.markdown .admonition {\n  margin-left: -1px;\n  border-radius: 4px;\n}\n\n.admonition-note code {\n  background: #cdcdcd;\n}\n\n.markdown\n  .codeBlockTitle_node_modules-\\@docusaurus-theme-classic-src-theme-CodeBlock- {\n  background: transparent !important;\n  display: none;\n}\n\n.markdown [role=\"tab\"],\n.markdown .prism-code,\ncode {\n  outline: none;\n}\n\n.markdown [role=\"tab\"] .comment,\n.markdown .prism-code .comment,\ncode .comment {\n  user-select: none;\n}\n\nhtml body .markdown button[aria-label=\"Copy code to clipboard\"],\nhtml body pre.prism-code > button {\n  margin-top: 0.25em !important;\n  box-shadow: 0 0 0 8px #292d3e;\n}\n\n.active-section,\n[id^=\"fn-\"] {\n  position: relative;\n}\n\n[id^=\"fn-\"] {\n  display: block;\n  text-indent: -0.8em;\n  padding-left: 0.8em;\n}\n\n.active-section::before,\nspan:target::before {\n  content: \" \";\n  width: 3px;\n  position: absolute;\n  left: -17px;\n  top: -10px;\n  bottom: calc(-1 * var(--ifm-paragraph-margin-bottom));\n  background: #077eec;\n}\n\n@media (min-width: 1500px) {\n  .active-section::before,\n  span:target::before {\n    left: -40px;\n  }\n}\n\nspan:target::before {\n  bottom: -5px;\n}\n\ndetails .active-section::before {\n  display: none;\n}\n\nblockquote.active-section::before {\n  left: -25px;\n}\n\n.markdown h4 {\n  font-size: 1.15em;\n  margin-bottom: 0.4em;\n}\n\n.markdown h2 + h3 {\n  margin-top: 1.5em !important;\n}\n\nh3.active-section::before {\n  top: -2.4em;\n}\n\n*:not(.active-section) + h2.active-section::before,\n*:not(.active-section) + h3.active-section::before {\n  top: -0.5em;\n}\n\n.step_src-components-Step-.active-section::before,\n.step_src-components-Step- + h2.active-section::before,\n.step_src-components-Step- + h3.active-section::before,\n.step_src-components-Step- + h4.active-section::before {\n  display: none;\n}\n\n.step_src-components-Step- + h2.active-section + .active-section::before {\n  top: -5rem;\n}\n\n.step_src-components-Step- + h3.active-section + .active-section::before,\n.step_src-components-Step- + h4.active-section + .active-section::before {\n  top: -3.5rem;\n}\n\n.embed-container {\n  position: relative;\n  padding-bottom: 56.25%;\n  height: 0;\n  overflow: hidden;\n  max-width: 100%;\n}\n\n.embed-container iframe,\n.embed-container object,\n.embed-container embed {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\ntable thead > tr {\n  border-top: none;\n}\n\ntable th:first-child:empty {\n  opacity: 0;\n  border: none;\n}\n\n.container > .row > .col > div {\n  display: flex;\n  flex-direction: column;\n}\n\n/* Button: Edit this page */\n.container > .row > .col > div > .margin-vert--xl {\n  order: -1;\n  height: 3em;\n  margin: 0 !important;\n  text-align: right;\n}\n\n/* Button: Edit this page */\n.container > .row > .col > div > .margin-vert--xl a {\n  padding: 0.3em 0.5em;\n  background: var(--ifm-color-primary-lighter);\n  color: #fff;\n  font-size: 0.8em;\n  font-weight: 600;\n  border-radius: 4px;\n  text-decoration: none;\n  transition: background-color 0.3s;\n}\n\n/* Button: Edit this page */\n.container > .row > .col > div > .margin-vert--xl a:hover {\n  background: var(--ifm-color-primary);\n}\n\n.docusaurus-highlight-code-line {\n  background-color: rgb(72, 77, 91);\n  display: block;\n  margin: 0 calc(-1 * var(--ifm-pre-padding));\n  padding: 0 var(--ifm-pre-padding);\n}\n\nhtml body .markdown button[aria-label=\"Copy code to clipboard\"],\nhtml body pre.prism-code > button {\n  z-index: 1;\n  border: none;\n  background: var(--ifm-color-primary-lighter);\n  color: #fff;\n  text-transform: uppercase;\n  font-size: 0.8em;\n  font-weight: 700;\n  border-radius: 3px;\n  padding: 0.6em 0.8em;\n  margin-top: -0.2em;\n  letter-spacing: 0.1em;\n  transition: background-color 0.3s;\n}\n\nhtml body .markdown button[aria-label=\"Copy code to clipboard\"]:hover,\nhtml body pre.prism-code > button:hover {\n  background: var(--ifm-color-primary-darker);\n}\n\nbody .prism-code,\npre.prism-code {\n  margin-top: -0.2em;\n  border-radius: 4px;\n}\n\nbody .prism-code,\ncode {\n  counter-reset: linenumber;\n}\n\nbody .prism-code .token-line,\ncode > .token-line {\n  counter-increment: linenumber;\n}\n\nbody .prism-code .token-line::before,\ncode > .token-line::before {\n  width: 1em;\n  content: counter(linenumber);\n  color: #fff;\n  display: block;\n  float: left;\n  padding-right: 0.8em;\n  text-align: right;\n  opacity: 0.6;\n\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\nbody .prism-code .token-line:first-child:last-child::before,\ncode > .token-line:first-child:last-child::before {\n  display: none;\n}\n\nbody .prism-code .token-line,\ncode .token-line {\n  padding-right: 2em;\n}\n\n.tabs {\n  border-bottom: 1px solid var(--ifm-color-primary-lightest);\n}\n\n.tabs > .tab-item {\n  border-radius: 0;\n  padding: 0.6em 1.2em;\n}\n\n.tabs > .tab-item:focus,\n.tabs > .tab-item:hover {\n  background-color: #f2f9fb;\n}\n\ndiv[role=\"tabpanel\"] {\n  border-bottom: 1px solid var(--ifm-color-primary-lightest);\n}\n\nbody .markdown {\n  position: relative;\n  --ifm-h2-vertical-rhythm-top: 1.8;\n}\n\n.markdown *:not(pre) > code,\n.contents code {\n  white-space: nowrap;\n}\n\n.admonition-warning a,\n.admonition-info a,\n.admonition-warning a:hover,\n.admonition-info a:hover {\n  color: rgb(255, 251, 0);\n}\n\n.markdown figure {\n  margin: 1em 0 2em;\n}\n\n.markdown figure:last-child {\n  margin-bottom: 1.2em;\n}\n\n.markdown figure.stretch,\n.markdown figure.stretch img {\n  width: 100%;\n}\n\n.markdown figure.frame img,\n.markdown figure.frame video {\n  width: 100%;\n  box-shadow: 0 0 7px 5px #00000009;\n  border: 1.5px solid #c6cbd1;\n  border-radius: 4px;\n}\n\n.markdown figcaption {\n  position: relative;\n  left: 0;\n  width: 100%;\n  top: 0;\n  margin-top: 5px;\n  outline: 0;\n  text-align: center;\n  z-index: 300;\n  font-size: 14px;\n  line-height: 1.4;\n  letter-spacing: 0;\n}\n\n.navbar__brand::after {\n  display: block;\n  content: \" \";\n  background: #dadde1;\n  width: 1px;\n  height: 47px;\n  margin-left: 20px;\n  transform: skew(-15deg, 0);\n}\n\n.menu__link--active {\n  color: var(--ifm-color-primary) !important;\n}\n\n.version-link {\n  position: relative;\n  margin-right: 20px;\n  padding: 0.2em 0.6em;\n  background-color: var(--ifm-color-primary);\n  color: #fff;\n  font-weight: 600;\n  border-radius: 3px;\n  transition: background-color 0.3s;\n}\n\n.version-link:hover {\n  color: #fff;\n  text-decoration: none;\n  background-color: var(--ifm-color-primary-darkest);\n}\n\n.version-link::before {\n  content: \"v\";\n  padding-right: 0.1em;\n}\n\n.version-link::after {\n  display: block;\n  content: \" \";\n  width: 1px;\n  height: 60px;\n  position: absolute;\n  top: -16px;\n  right: -20px;\n  transform: skew(-15deg, 0deg);\n  background: rgb(218, 221, 225);\n}\n\n.github-link,\n.slack-link {\n  padding: 0;\n}\n\n.github-link:before {\n  content: \"\";\n  margin-left: 14px;\n  width: 24px;\n  height: 24px;\n  display: flex;\n  background-image: url(\"data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E%0A\");\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: contain;\n}\n\n[data-theme=\"dark\"] .github-link:before {\n  content: \"\";\n  margin-left: 14px;\n  width: 24px;\n  height: 24px;\n  display: flex;\n  background-image: url(\"data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E%0A\");\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: contain;\n}\n\n.slack-link:before {\n  content: \"\";\n  width: 130px;\n  height: 32px;\n  display: flex;\n  background-image: url(\"data:image/svg+xml,%3Csvg width='165' height='41' viewBox='0 0 165 41' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.5 0.5H158.5C161.8 0.5 164.5 3.2 164.5 6.5V34.5C164.5 37.8 161.8 40.5 158.5 40.5H6.5C3.2 40.5 0.5 37.8 0.5 34.5V6.5C0.5 3.2 3.2 0.5 6.5 0.5Z' stroke='%23C7CACD'/%3E%3Cpath d='M15.1 23.4C15.1 24.7 14.1 25.7 12.8 25.7C11.5 25.7 10.5 24.7 10.5 23.4C10.5 22.1 11.5 21.1 12.8 21.1H15.1V23.4V23.4Z' fill='%23E01E5A'/%3E%3Cpath d='M16.3 23.4C16.3 22.1 17.3 21.1 18.6 21.1C19.9 21.1 20.9 22.1 20.9 23.4V29.2C20.9 30.5 19.9 31.5 18.6 31.5C17.3 31.5 16.3 30.5 16.3 29.2V23.4Z' fill='%23E01E5A'/%3E%3Cpath d='M18.6 14.2C17.3 14.2 16.3 13.2 16.3 11.9C16.3 10.6 17.3 9.6 18.6 9.6C19.9 9.6 20.9 10.6 20.9 11.9V14.2H18.6Z' fill='%2336C5F0'/%3E%3Cpath d='M18.6 15.3C19.9 15.3 20.9 16.3 20.9 17.6C20.9 18.9 19.9 19.9 18.6 19.9H12.8C11.5 19.9 10.5 18.9 10.5 17.6C10.5 16.3 11.5 15.3 12.8 15.3H18.6Z' fill='%2336C5F0'/%3E%3Cpath d='M27.9 17.7C27.9 16.4 28.9 15.4 30.2 15.4C31.5 15.4 32.5 16.4 32.5 17.7C32.5 19 31.5 20 30.2 20H27.9V17.7Z' fill='%232EB67D'/%3E%3Cpath d='M26.7 17.7C26.7 19 25.7 20 24.4 20C23.1 20 22.1 19 22.1 17.7V11.9C22.1 10.6 23.1 9.6 24.4 9.6C25.7 9.6 26.7 10.6 26.7 11.9V17.7Z' fill='%232EB67D'/%3E%3Cpath d='M24.4 26.9C25.7 26.9 26.7 27.9 26.7 29.2C26.7 30.5 25.7 31.5 24.4 31.5C23.1 31.5 22.1 30.5 22.1 29.2V26.9H24.4Z' fill='%23ECB22E'/%3E%3Cpath d='M24.4 25.8C23.1 25.8 22.1 24.8 22.1 23.5C22.1 22.2 23.1 21.2 24.4 21.2H30.2C31.5 21.2 32.5 22.2 32.5 23.5C32.5 24.8 31.5 25.8 30.2 25.8H24.4Z' fill='%23ECB22E'/%3E%3Cpath d='M47.056 23.152V14.576H45.536V22.928C45.536 23.5573 45.4027 24.0587 45.136 24.432C44.88 24.8053 44.4053 24.992 43.712 24.992C43.3387 24.992 43.0293 24.9387 42.784 24.832C42.5493 24.7147 42.3627 24.5547 42.224 24.352C42.096 24.1493 42.0053 23.9093 41.952 23.632C41.8987 23.3547 41.872 23.0507 41.872 22.72V22.24H40.352V22.944C40.352 24.032 40.64 24.8587 41.216 25.424C41.792 25.9787 42.6133 26.256 43.68 26.256C44.32 26.256 44.8533 26.1707 45.28 26C45.7173 25.8187 46.064 25.584 46.32 25.296C46.5867 24.9973 46.7733 24.6613 46.88 24.288C46.9973 23.9147 47.056 23.536 47.056 23.152Z' fill='black'/%3E%3Cpath d='M49.8329 21.872C49.8329 21.3707 49.8969 20.928 50.0249 20.544C50.1635 20.1493 50.3502 19.8187 50.5849 19.552C50.8195 19.2853 51.0915 19.0827 51.4009 18.944C51.7209 18.8053 52.0569 18.736 52.4089 18.736C52.7609 18.736 53.0915 18.8053 53.4009 18.944C53.7209 19.0827 53.9982 19.2853 54.2329 19.552C54.4675 19.8187 54.6489 20.1493 54.7769 20.544C54.9155 20.928 54.9849 21.3707 54.9849 21.872C54.9849 22.3733 54.9155 22.8213 54.7769 23.216C54.6489 23.6 54.4675 23.9253 54.2329 24.192C53.9982 24.448 53.7209 24.6453 53.4009 24.784C53.0915 24.9227 52.7609 24.992 52.4089 24.992C52.0569 24.992 51.7209 24.9227 51.4009 24.784C51.0915 24.6453 50.8195 24.448 50.5849 24.192C50.3502 23.9253 50.1635 23.6 50.0249 23.216C49.8969 22.8213 49.8329 22.3733 49.8329 21.872ZM48.3929 21.872C48.3929 22.48 48.4782 23.0453 48.6489 23.568C48.8195 24.0907 49.0755 24.5493 49.4169 24.944C49.7582 25.328 50.1795 25.632 50.6809 25.856C51.1822 26.0693 51.7582 26.176 52.4089 26.176C53.0702 26.176 53.6462 26.0693 54.1369 25.856C54.6382 25.632 55.0595 25.328 55.4009 24.944C55.7422 24.5493 55.9982 24.0907 56.1689 23.568C56.3395 23.0453 56.4249 22.48 56.4249 21.872C56.4249 21.264 56.3395 20.6987 56.1689 20.176C55.9982 19.6427 55.7422 19.184 55.4009 18.8C55.0595 18.4053 54.6382 18.096 54.1369 17.872C53.6462 17.648 53.0702 17.536 52.4089 17.536C51.7582 17.536 51.1822 17.648 50.6809 17.872C50.1795 18.096 49.7582 18.4053 49.4169 18.8C49.0755 19.184 48.8195 19.6427 48.6489 20.176C48.4782 20.6987 48.3929 21.264 48.3929 21.872Z' fill='black'/%3E%3Cpath d='M58.9884 16.24V14.576H57.6284V16.24H58.9884ZM57.6284 17.728V26H58.9884V17.728H57.6284Z' fill='black'/%3E%3Cpath d='M60.6152 17.728V26H61.9752V21.328C61.9752 20.9547 62.0232 20.6133 62.1192 20.304C62.2259 19.984 62.3806 19.7067 62.5832 19.472C62.7859 19.2373 63.0366 19.056 63.3352 18.928C63.6446 18.8 64.0072 18.736 64.4232 18.736C64.9459 18.736 65.3566 18.8853 65.6552 19.184C65.9539 19.4827 66.1032 19.888 66.1032 20.4V26H67.4632V20.56C67.4632 20.112 67.4152 19.7067 67.3192 19.344C67.2339 18.9707 67.0792 18.6507 66.8552 18.384C66.6312 18.1173 66.3379 17.9093 65.9752 17.76C65.6126 17.6107 65.1592 17.536 64.6152 17.536C63.3886 17.536 62.4926 18.0373 61.9272 19.04H61.8952V17.728H60.6152Z' fill='black'/%3E%3Cpath d='M79.847 26V17.728H78.487V22.4C78.487 22.7733 78.4337 23.12 78.327 23.44C78.231 23.7493 78.0817 24.0213 77.879 24.256C77.6763 24.4907 77.4203 24.672 77.111 24.8C76.8123 24.928 76.455 24.992 76.039 24.992C75.5163 24.992 75.1057 24.8427 74.807 24.544C74.5083 24.2453 74.359 23.84 74.359 23.328V17.728H72.999V23.168C72.999 23.616 73.0417 24.0267 73.127 24.4C73.223 24.7627 73.383 25.0773 73.607 25.344C73.831 25.6107 74.1243 25.8187 74.487 25.968C74.8497 26.1067 75.303 26.176 75.847 26.176C76.455 26.176 76.983 26.0587 77.431 25.824C77.879 25.5787 78.247 25.2 78.535 24.688H78.567V26H79.847Z' fill='black'/%3E%3Cpath d='M82.2416 23.392H80.8816C80.9029 23.904 81.0096 24.3413 81.2016 24.704C81.3936 25.056 81.6496 25.344 81.9696 25.568C82.2896 25.7813 82.6576 25.936 83.0736 26.032C83.4896 26.128 83.9269 26.176 84.3856 26.176C84.8016 26.176 85.2176 26.1333 85.6336 26.048C86.0603 25.9733 86.4389 25.8347 86.7696 25.632C87.1109 25.4293 87.3829 25.1627 87.5856 24.832C87.7989 24.5013 87.9056 24.0853 87.9056 23.584C87.9056 23.1893 87.8256 22.8587 87.6656 22.592C87.5163 22.3253 87.3136 22.1067 87.0576 21.936C86.8123 21.7547 86.5243 21.6107 86.1936 21.504C85.8736 21.3973 85.5429 21.3067 85.2016 21.232C84.8816 21.1573 84.5616 21.088 84.2416 21.024C83.9216 20.9493 83.6336 20.864 83.3776 20.768C83.1216 20.6613 82.9083 20.5333 82.7376 20.384C82.5776 20.224 82.4976 20.0267 82.4976 19.792C82.4976 19.5787 82.5509 19.408 82.6576 19.28C82.7643 19.1413 82.9029 19.0347 83.0736 18.96C83.2443 18.8747 83.4309 18.816 83.6336 18.784C83.8469 18.752 84.0549 18.736 84.2576 18.736C84.4816 18.736 84.7003 18.7627 84.9136 18.816C85.1376 18.8587 85.3403 18.9333 85.5216 19.04C85.7029 19.1467 85.8523 19.2907 85.9696 19.472C86.0869 19.6427 86.1563 19.8613 86.1776 20.128H87.5376C87.5056 19.6267 87.3989 19.2107 87.2176 18.88C87.0363 18.5387 86.7909 18.272 86.4816 18.08C86.1829 17.8773 85.8363 17.7387 85.4416 17.664C85.0469 17.5787 84.6149 17.536 84.1456 17.536C83.7829 17.536 83.4149 17.584 83.0416 17.68C82.6789 17.7653 82.3483 17.904 82.0496 18.096C81.7616 18.2773 81.5216 18.5173 81.3296 18.816C81.1483 19.1147 81.0576 19.472 81.0576 19.888C81.0576 20.4213 81.1909 20.8373 81.4576 21.136C81.7243 21.4347 82.0549 21.6693 82.4496 21.84C82.8549 22 83.2923 22.128 83.7616 22.224C84.2309 22.3093 84.6629 22.4107 85.0576 22.528C85.4629 22.6347 85.7989 22.7787 86.0656 22.96C86.3323 23.1413 86.4656 23.408 86.4656 23.76C86.4656 24.016 86.4016 24.2293 86.2736 24.4C86.1456 24.56 85.9803 24.6827 85.7776 24.768C85.5856 24.8533 85.3723 24.912 85.1376 24.944C84.9029 24.976 84.6789 24.992 84.4656 24.992C84.1883 24.992 83.9163 24.9653 83.6496 24.912C83.3936 24.8587 83.1589 24.7733 82.9456 24.656C82.7429 24.528 82.5776 24.3627 82.4496 24.16C82.3216 23.9467 82.2523 23.6907 82.2416 23.392Z' fill='black'/%3E%3Cpath d='M93.8947 21.872C93.8947 21.3707 93.9587 20.928 94.0867 20.544C94.2254 20.1493 94.4121 19.8187 94.6467 19.552C94.8814 19.2853 95.1534 19.0827 95.4627 18.944C95.7827 18.8053 96.1187 18.736 96.4707 18.736C96.8227 18.736 97.1534 18.8053 97.4627 18.944C97.7827 19.0827 98.0601 19.2853 98.2947 19.552C98.5294 19.8187 98.7107 20.1493 98.8387 20.544C98.9774 20.928 99.0467 21.3707 99.0467 21.872C99.0467 22.3733 98.9774 22.8213 98.8387 23.216C98.7107 23.6 98.5294 23.9253 98.2947 24.192C98.0601 24.448 97.7827 24.6453 97.4627 24.784C97.1534 24.9227 96.8227 24.992 96.4707 24.992C96.1187 24.992 95.7827 24.9227 95.4627 24.784C95.1534 24.6453 94.8814 24.448 94.6467 24.192C94.4121 23.9253 94.2254 23.6 94.0867 23.216C93.9587 22.8213 93.8947 22.3733 93.8947 21.872ZM92.4547 21.872C92.4547 22.48 92.5401 23.0453 92.7107 23.568C92.8814 24.0907 93.1374 24.5493 93.4787 24.944C93.8201 25.328 94.2414 25.632 94.7427 25.856C95.2441 26.0693 95.8201 26.176 96.4707 26.176C97.1321 26.176 97.7081 26.0693 98.1987 25.856C98.7001 25.632 99.1214 25.328 99.4627 24.944C99.8041 24.5493 100.06 24.0907 100.231 23.568C100.401 23.0453 100.487 22.48 100.487 21.872C100.487 21.264 100.401 20.6987 100.231 20.176C100.06 19.6427 99.8041 19.184 99.4627 18.8C99.1214 18.4053 98.7001 18.096 98.1987 17.872C97.7081 17.648 97.1321 17.536 96.4707 17.536C95.8201 17.536 95.2441 17.648 94.7427 17.872C94.2414 18.096 93.8201 18.4053 93.4787 18.8C93.1374 19.184 92.8814 19.6427 92.7107 20.176C92.5401 20.6987 92.4547 21.264 92.4547 21.872Z' fill='black'/%3E%3Cpath d='M101.61 17.728V26H102.97V21.328C102.97 20.9547 103.018 20.6133 103.114 20.304C103.221 19.984 103.376 19.7067 103.578 19.472C103.781 19.2373 104.032 19.056 104.33 18.928C104.64 18.8 105.002 18.736 105.418 18.736C105.941 18.736 106.352 18.8853 106.65 19.184C106.949 19.4827 107.098 19.888 107.098 20.4V26H108.458V20.56C108.458 20.112 108.41 19.7067 108.314 19.344C108.229 18.9707 108.074 18.6507 107.85 18.384C107.626 18.1173 107.333 17.9093 106.97 17.76C106.608 17.6107 106.154 17.536 105.61 17.536C104.384 17.536 103.488 18.0373 102.922 19.04H102.89V17.728H101.61Z' fill='black'/%3E%3Cpath d='M120.6 18.2C120.5 17.6 120 16.6 118.5 16.6C117.4 16.6 116.7 17.3 116.7 18C116.7 18.6 117.1 19.1 117.9 19.3L119.5 19.6C121.6 20 122.7 21.3 122.7 22.9C122.7 24.6 121.2 26.4 118.6 26.4C115.6 26.4 114.3 24.5 114.1 22.8L116.1 22.3C116.2 23.4 117 24.4 118.6 24.4C119.8 24.4 120.4 23.8 120.4 23C120.4 22.3 119.9 21.8 119 21.7L117.4 21.4C115.6 21 114.4 19.9 114.4 18.2C114.4 16.2 116.2 14.6 118.4 14.6C121.2 14.6 122.2 16.3 122.5 17.5L120.6 18.2Z' fill='black'/%3E%3Cpath d='M124 26.2V14.6H126.1V26.2H124Z' fill='black'/%3E%3Cpath d='M129.7 21.7L131.6 21.4C132 21.3 132.2 21.1 132.2 20.8C132.2 20.2 131.8 19.8 130.9 19.8C130 19.8 129.5 20.4 129.4 21.1L127.5 20.7C127.6 19.5 128.8 18.1 130.9 18.1C133.4 18.1 134.3 19.5 134.3 21.1V25C134.3 25.4 134.3 26 134.4 26.2H132.4C132.4 26 132.3 25.6 132.3 25.3C131.9 25.9 131.1 26.5 130 26.5C128.3 26.5 127.3 25.4 127.3 24.1C127.3 22.6 128.4 21.9 129.7 21.7ZM132.2 23V22.6L130.4 22.9C129.9 23 129.4 23.3 129.4 23.9C129.4 24.4 129.7 24.8 130.4 24.8C131.4 24.8 132.2 24.4 132.2 23Z' fill='black'/%3E%3Cpath d='M137.5 22.3C137.5 23.7 138.4 24.5 139.5 24.5C140.6 24.5 141.1 23.8 141.3 23.2L143.2 23.8C142.8 25.1 141.6 26.5 139.5 26.5C137.2 26.5 135.4 24.7 135.4 22.3C135.4 19.9 137.2 18.1 139.5 18.1C141.6 18.1 142.9 19.4 143.2 20.8L141.3 21.4C141.1 20.7 140.6 20.1 139.6 20.1C138.4 20.1 137.5 20.8 137.5 22.3Z' fill='black'/%3E%3Cpath d='M148.7 21.6L151.9 26.2H149.3L147.2 23.2L146.3 24.1V26.2H144.2V14.6H146.3V21.2L149 18.3H151.8L148.7 21.6Z' fill='black'/%3E%3C/svg%3E%0A\");\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: contain;\n}\n\n[data-theme=\"dark\"] .slack-link:before {\n  content: \"\";\n  width: 130px;\n  height: 32px;\n  display: flex;\n  background-image: url('data:image/svg+xml,<svg width=\"165\" height=\"41\" viewBox=\"0 0 165 41\" fill=\"black\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"165\" height=\"41\" fill=\"%23242526\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.5 0.5H158.5C161.8 0.5 164.5 3.2 164.5 6.5V34.5C164.5 37.8 161.8 40.5 158.5 40.5H6.5C3.2 40.5 0.5 37.8 0.5 34.5V6.5C0.5 3.2 3.2 0.5 6.5 0.5Z\" fill=\"%231E1E1E\" stroke=\"%23C7CACD\"/><path d=\"M15.1 23.4C15.1 24.7 14.1 25.7 12.8 25.7C11.5 25.7 10.5 24.7 10.5 23.4C10.5 22.1 11.5 21.1 12.8 21.1H15.1V23.4V23.4Z\" fill=\"%23E01E5A\"/><path d=\"M16.3 23.4C16.3 22.1 17.3 21.1 18.6 21.1C19.9 21.1 20.9 22.1 20.9 23.4V29.2C20.9 30.5 19.9 31.5 18.6 31.5C17.3 31.5 16.3 30.5 16.3 29.2V23.4Z\" fill=\"%23E01E5A\"/><path d=\"M18.6 14.2C17.3 14.2 16.3 13.2 16.3 11.9C16.3 10.6 17.3 9.6 18.6 9.6C19.9 9.6 20.9 10.6 20.9 11.9V14.2H18.6Z\" fill=\"%2336C5F0\"/><path d=\"M18.6 15.3C19.9 15.3 20.9 16.3 20.9 17.6C20.9 18.9 19.9 19.9 18.6 19.9H12.8C11.5 19.9 10.5 18.9 10.5 17.6C10.5 16.3 11.5 15.3 12.8 15.3H18.6Z\" fill=\"%2336C5F0\"/><path d=\"M27.9 17.7C27.9 16.4 28.9 15.4 30.2 15.4C31.5 15.4 32.5 16.4 32.5 17.7C32.5 19 31.5 20 30.2 20H27.9V17.7Z\" fill=\"%232EB67D\"/><path d=\"M26.7 17.7C26.7 19 25.7 20 24.4 20C23.1 20 22.1 19 22.1 17.7V11.9C22.1 10.6 23.1 9.6 24.4 9.6C25.7 9.6 26.7 10.6 26.7 11.9V17.7Z\" fill=\"%232EB67D\"/><path d=\"M24.4 26.9C25.7 26.9 26.7 27.9 26.7 29.2C26.7 30.5 25.7 31.5 24.4 31.5C23.1 31.5 22.1 30.5 22.1 29.2V26.9H24.4Z\" fill=\"%23ECB22E\"/><path d=\"M24.4 25.8C23.1 25.8 22.1 24.8 22.1 23.5C22.1 22.2 23.1 21.2 24.4 21.2H30.2C31.5 21.2 32.5 22.2 32.5 23.5C32.5 24.8 31.5 25.8 30.2 25.8H24.4Z\" fill=\"%23ECB22E\"/><path d=\"M47.056 23.152V14.576H45.536V22.928C45.536 23.5573 45.4027 24.0587 45.136 24.432C44.88 24.8053 44.4053 24.992 43.712 24.992C43.3387 24.992 43.0293 24.9387 42.784 24.832C42.5493 24.7147 42.3627 24.5547 42.224 24.352C42.096 24.1493 42.0053 23.9093 41.952 23.632C41.8987 23.3547 41.872 23.0507 41.872 22.72V22.24H40.352V22.944C40.352 24.032 40.64 24.8587 41.216 25.424C41.792 25.9787 42.6133 26.256 43.68 26.256C44.32 26.256 44.8533 26.1707 45.28 26C45.7173 25.8187 46.064 25.584 46.32 25.296C46.5867 24.9973 46.7733 24.6613 46.88 24.288C46.9973 23.9147 47.056 23.536 47.056 23.152Z\" fill=\"white\"/><path d=\"M49.8329 21.872C49.8329 21.3707 49.8969 20.928 50.0249 20.544C50.1635 20.1493 50.3502 19.8187 50.5849 19.552C50.8195 19.2853 51.0915 19.0827 51.4009 18.944C51.7209 18.8053 52.0569 18.736 52.4089 18.736C52.7609 18.736 53.0915 18.8053 53.4009 18.944C53.7209 19.0827 53.9982 19.2853 54.2329 19.552C54.4675 19.8187 54.6489 20.1493 54.7769 20.544C54.9155 20.928 54.9849 21.3707 54.9849 21.872C54.9849 22.3733 54.9155 22.8213 54.7769 23.216C54.6489 23.6 54.4675 23.9253 54.2329 24.192C53.9982 24.448 53.7209 24.6453 53.4009 24.784C53.0915 24.9227 52.7609 24.992 52.4089 24.992C52.0569 24.992 51.7209 24.9227 51.4009 24.784C51.0915 24.6453 50.8195 24.448 50.5849 24.192C50.3502 23.9253 50.1635 23.6 50.0249 23.216C49.8969 22.8213 49.8329 22.3733 49.8329 21.872ZM48.3929 21.872C48.3929 22.48 48.4782 23.0453 48.6489 23.568C48.8195 24.0907 49.0755 24.5493 49.4169 24.944C49.7582 25.328 50.1795 25.632 50.6809 25.856C51.1822 26.0693 51.7582 26.176 52.4089 26.176C53.0702 26.176 53.6462 26.0693 54.1369 25.856C54.6382 25.632 55.0595 25.328 55.4009 24.944C55.7422 24.5493 55.9982 24.0907 56.1689 23.568C56.3395 23.0453 56.4249 22.48 56.4249 21.872C56.4249 21.264 56.3395 20.6987 56.1689 20.176C55.9982 19.6427 55.7422 19.184 55.4009 18.8C55.0595 18.4053 54.6382 18.096 54.1369 17.872C53.6462 17.648 53.0702 17.536 52.4089 17.536C51.7582 17.536 51.1822 17.648 50.6809 17.872C50.1795 18.096 49.7582 18.4053 49.4169 18.8C49.0755 19.184 48.8195 19.6427 48.6489 20.176C48.4782 20.6987 48.3929 21.264 48.3929 21.872Z\" fill=\"white\"/><path d=\"M58.9884 16.24V14.576H57.6284V16.24H58.9884ZM57.6284 17.728V26H58.9884V17.728H57.6284Z\" fill=\"white\"/><path d=\"M60.6152 17.728V26H61.9752V21.328C61.9752 20.9547 62.0232 20.6133 62.1192 20.304C62.2259 19.984 62.3806 19.7067 62.5832 19.472C62.7859 19.2373 63.0366 19.056 63.3352 18.928C63.6446 18.8 64.0072 18.736 64.4232 18.736C64.9459 18.736 65.3566 18.8853 65.6552 19.184C65.9539 19.4827 66.1032 19.888 66.1032 20.4V26H67.4632V20.56C67.4632 20.112 67.4152 19.7067 67.3192 19.344C67.2339 18.9707 67.0792 18.6507 66.8552 18.384C66.6312 18.1173 66.3379 17.9093 65.9752 17.76C65.6126 17.6107 65.1592 17.536 64.6152 17.536C63.3886 17.536 62.4926 18.0373 61.9272 19.04H61.8952V17.728H60.6152Z\" fill=\"white\"/><path d=\"M79.847 26V17.728H78.487V22.4C78.487 22.7733 78.4337 23.12 78.327 23.44C78.231 23.7493 78.0817 24.0213 77.879 24.256C77.6763 24.4907 77.4203 24.672 77.111 24.8C76.8123 24.928 76.455 24.992 76.039 24.992C75.5163 24.992 75.1057 24.8427 74.807 24.544C74.5083 24.2453 74.359 23.84 74.359 23.328V17.728H72.999V23.168C72.999 23.616 73.0417 24.0267 73.127 24.4C73.223 24.7627 73.383 25.0773 73.607 25.344C73.831 25.6107 74.1243 25.8187 74.487 25.968C74.8497 26.1067 75.303 26.176 75.847 26.176C76.455 26.176 76.983 26.0587 77.431 25.824C77.879 25.5787 78.247 25.2 78.535 24.688H78.567V26H79.847Z\" fill=\"white\"/><path d=\"M82.2416 23.392H80.8816C80.9029 23.904 81.0096 24.3413 81.2016 24.704C81.3936 25.056 81.6496 25.344 81.9696 25.568C82.2896 25.7813 82.6576 25.936 83.0736 26.032C83.4896 26.128 83.9269 26.176 84.3856 26.176C84.8016 26.176 85.2176 26.1333 85.6336 26.048C86.0603 25.9733 86.4389 25.8347 86.7696 25.632C87.1109 25.4293 87.3829 25.1627 87.5856 24.832C87.7989 24.5013 87.9056 24.0853 87.9056 23.584C87.9056 23.1893 87.8256 22.8587 87.6656 22.592C87.5163 22.3253 87.3136 22.1067 87.0576 21.936C86.8123 21.7547 86.5243 21.6107 86.1936 21.504C85.8736 21.3973 85.5429 21.3067 85.2016 21.232C84.8816 21.1573 84.5616 21.088 84.2416 21.024C83.9216 20.9493 83.6336 20.864 83.3776 20.768C83.1216 20.6613 82.9083 20.5333 82.7376 20.384C82.5776 20.224 82.4976 20.0267 82.4976 19.792C82.4976 19.5787 82.5509 19.408 82.6576 19.28C82.7643 19.1413 82.9029 19.0347 83.0736 18.96C83.2443 18.8747 83.4309 18.816 83.6336 18.784C83.8469 18.752 84.0549 18.736 84.2576 18.736C84.4816 18.736 84.7003 18.7627 84.9136 18.816C85.1376 18.8587 85.3403 18.9333 85.5216 19.04C85.7029 19.1467 85.8523 19.2907 85.9696 19.472C86.0869 19.6427 86.1563 19.8613 86.1776 20.128H87.5376C87.5056 19.6267 87.3989 19.2107 87.2176 18.88C87.0363 18.5387 86.7909 18.272 86.4816 18.08C86.1829 17.8773 85.8363 17.7387 85.4416 17.664C85.0469 17.5787 84.6149 17.536 84.1456 17.536C83.7829 17.536 83.4149 17.584 83.0416 17.68C82.6789 17.7653 82.3483 17.904 82.0496 18.096C81.7616 18.2773 81.5216 18.5173 81.3296 18.816C81.1483 19.1147 81.0576 19.472 81.0576 19.888C81.0576 20.4213 81.1909 20.8373 81.4576 21.136C81.7243 21.4347 82.0549 21.6693 82.4496 21.84C82.8549 22 83.2923 22.128 83.7616 22.224C84.2309 22.3093 84.6629 22.4107 85.0576 22.528C85.4629 22.6347 85.7989 22.7787 86.0656 22.96C86.3323 23.1413 86.4656 23.408 86.4656 23.76C86.4656 24.016 86.4016 24.2293 86.2736 24.4C86.1456 24.56 85.9803 24.6827 85.7776 24.768C85.5856 24.8533 85.3723 24.912 85.1376 24.944C84.9029 24.976 84.6789 24.992 84.4656 24.992C84.1883 24.992 83.9163 24.9653 83.6496 24.912C83.3936 24.8587 83.1589 24.7733 82.9456 24.656C82.7429 24.528 82.5776 24.3627 82.4496 24.16C82.3216 23.9467 82.2523 23.6907 82.2416 23.392Z\" fill=\"white\"/><path d=\"M93.8947 21.872C93.8947 21.3707 93.9587 20.928 94.0867 20.544C94.2254 20.1493 94.4121 19.8187 94.6467 19.552C94.8814 19.2853 95.1534 19.0827 95.4627 18.944C95.7827 18.8053 96.1187 18.736 96.4707 18.736C96.8227 18.736 97.1534 18.8053 97.4627 18.944C97.7827 19.0827 98.0601 19.2853 98.2947 19.552C98.5294 19.8187 98.7107 20.1493 98.8387 20.544C98.9774 20.928 99.0467 21.3707 99.0467 21.872C99.0467 22.3733 98.9774 22.8213 98.8387 23.216C98.7107 23.6 98.5294 23.9253 98.2947 24.192C98.0601 24.448 97.7827 24.6453 97.4627 24.784C97.1534 24.9227 96.8227 24.992 96.4707 24.992C96.1187 24.992 95.7827 24.9227 95.4627 24.784C95.1534 24.6453 94.8814 24.448 94.6467 24.192C94.4121 23.9253 94.2254 23.6 94.0867 23.216C93.9587 22.8213 93.8947 22.3733 93.8947 21.872ZM92.4547 21.872C92.4547 22.48 92.5401 23.0453 92.7107 23.568C92.8814 24.0907 93.1374 24.5493 93.4787 24.944C93.8201 25.328 94.2414 25.632 94.7427 25.856C95.2441 26.0693 95.8201 26.176 96.4707 26.176C97.1321 26.176 97.7081 26.0693 98.1987 25.856C98.7001 25.632 99.1214 25.328 99.4627 24.944C99.8041 24.5493 100.06 24.0907 100.231 23.568C100.401 23.0453 100.487 22.48 100.487 21.872C100.487 21.264 100.401 20.6987 100.231 20.176C100.06 19.6427 99.8041 19.184 99.4627 18.8C99.1214 18.4053 98.7001 18.096 98.1987 17.872C97.7081 17.648 97.1321 17.536 96.4707 17.536C95.8201 17.536 95.2441 17.648 94.7427 17.872C94.2414 18.096 93.8201 18.4053 93.4787 18.8C93.1374 19.184 92.8814 19.6427 92.7107 20.176C92.5401 20.6987 92.4547 21.264 92.4547 21.872Z\" fill=\"white\"/><path d=\"M101.61 17.728V26H102.97V21.328C102.97 20.9547 103.018 20.6133 103.114 20.304C103.221 19.984 103.376 19.7067 103.578 19.472C103.781 19.2373 104.032 19.056 104.33 18.928C104.64 18.8 105.002 18.736 105.418 18.736C105.941 18.736 106.352 18.8853 106.65 19.184C106.949 19.4827 107.098 19.888 107.098 20.4V26H108.458V20.56C108.458 20.112 108.41 19.7067 108.314 19.344C108.229 18.9707 108.074 18.6507 107.85 18.384C107.626 18.1173 107.333 17.9093 106.97 17.76C106.608 17.6107 106.154 17.536 105.61 17.536C104.384 17.536 103.488 18.0373 102.922 19.04H102.89V17.728H101.61Z\" fill=\"white\"/><path d=\"M120.6 18.2C120.5 17.6 120 16.6 118.5 16.6C117.4 16.6 116.7 17.3 116.7 18C116.7 18.6 117.1 19.1 117.9 19.3L119.5 19.6C121.6 20 122.7 21.3 122.7 22.9C122.7 24.6 121.2 26.4 118.6 26.4C115.6 26.4 114.3 24.5 114.1 22.8L116.1 22.3C116.2 23.4 117 24.4 118.6 24.4C119.8 24.4 120.4 23.8 120.4 23C120.4 22.3 119.9 21.8 119 21.7L117.4 21.4C115.6 21 114.4 19.9 114.4 18.2C114.4 16.2 116.2 14.6 118.4 14.6C121.2 14.6 122.2 16.3 122.5 17.5L120.6 18.2Z\" fill=\"white\"/><path d=\"M124 26.2V14.6H126.1V26.2H124Z\" fill=\"white\"/><path d=\"M129.7 21.7L131.6 21.4C132 21.3 132.2 21.1 132.2 20.8C132.2 20.2 131.8 19.8 130.9 19.8C130 19.8 129.5 20.4 129.4 21.1L127.5 20.7C127.6 19.5 128.8 18.1 130.9 18.1C133.4 18.1 134.3 19.5 134.3 21.1V25C134.3 25.4 134.3 26 134.4 26.2H132.4C132.4 26 132.3 25.6 132.3 25.3C131.9 25.9 131.1 26.5 130 26.5C128.3 26.5 127.3 25.4 127.3 24.1C127.3 22.6 128.4 21.9 129.7 21.7ZM132.2 23V22.6L130.4 22.9C129.9 23 129.4 23.3 129.4 23.9C129.4 24.4 129.7 24.8 130.4 24.8C131.4 24.8 132.2 24.4 132.2 23Z\" fill=\"white\"/><path d=\"M137.5 22.3C137.5 23.7 138.4 24.5 139.5 24.5C140.6 24.5 141.1 23.8 141.3 23.2L143.2 23.8C142.8 25.1 141.6 26.5 139.5 26.5C137.2 26.5 135.4 24.7 135.4 22.3C135.4 19.9 137.2 18.1 139.5 18.1C141.6 18.1 142.9 19.4 143.2 20.8L141.3 21.4C141.1 20.7 140.6 20.1 139.6 20.1C138.4 20.1 137.5 20.8 137.5 22.3Z\" fill=\"white\"/><path d=\"M148.7 21.6L151.9 26.2H149.3L147.2 23.2L146.3 24.1V26.2H144.2V14.6H146.3V21.2L149 18.3H151.8L148.7 21.6Z\" fill=\"white\"/></svg>');\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: contain;\n}\n.pagination-nav__link {\n  height: auto;\n}\n"
  },
  {
    "path": "docs/src/pages/index.js",
    "content": "import React from 'react';\nimport Layout from '@theme/Layout';\nimport useDocusaurusContext from '@docusaurus/useDocusaurusContext';\n\nfunction Home() {\n  const context = useDocusaurusContext();\n  const {siteConfig = {}} = context;\n  return (\n    <Layout\n      title={`Hello from ${siteConfig.title}`}\n      description=\"Description will go into a meta tag in <head />\">\n    </Layout>\n  );\n}\n\nexport default Home;\n"
  },
  {
    "path": "docs/src/pages/styles.module.css",
    "content": "/**\n * CSS files with the .module.css suffix will be treated as CSS modules\n * and scoped locally.\n */\n\n.heroBanner {\n  padding: 4rem 0;\n  text-align: center;\n  position: relative;\n  overflow: hidden;\n}\n\n@media screen and (max-width: 966px) {\n  .heroBanner {\n    padding: 2rem;\n  }\n}\n\n.buttons {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.features {\n  display: flex;\n  align-items: center;\n  padding: 2rem 0;\n  width: 100%;\n}\n\n.featureImage {\n  height: 200px;\n  width: 200px;\n}\n"
  },
  {
    "path": "docs/static/js/custom.js",
    "content": "var firstCall = true;\n\nconst highlightDetailsOnActiveHash = function (activeHash, doNotOpen) {\n  const activeAnchors = document.querySelectorAll(\n    \".anchor[id='\" + activeHash + \"'\"\n  );\n  const detailsElements = document.querySelectorAll(\"details\");\n  const activeSectionElements = document.querySelectorAll(\".active-section\");\n  for (let i = 0; i < activeSectionElements.length; i++) {\n    activeSectionElements[i].classList.remove(\"active-section\");\n  }\n\n  for (let i = 0; i < activeAnchors.length; i++) {\n    const headline = activeAnchors[i].parentElement;\n    const headlineRank = activeAnchors[i].parentElement.nodeName.substr(1);\n    let el = headline;\n\n    while (el) {\n      if (el.tagName != \"BR\" && el.tagName != \"HR\") {\n        el.classList.add(\"active-section\");\n      }\n      el = el.nextElementSibling;\n\n      if (el) {\n        elRank = el.nodeName.substr(1);\n\n        if (elRank > 0 && elRank <= headlineRank) {\n          break;\n        }\n      }\n    }\n  }\n\n  for (let i = 0; i < detailsElements.length; i++) {\n    let detailsElement = detailsElements[i];\n\n    detailsElement.classList.remove(\"active\");\n  }\n\n  if (activeAnchors.length > 0) {\n    for (let i = 0; i < activeAnchors.length; i++) {\n      let element = activeAnchors[i];\n\n      for (; element && element !== document; element = element.parentElement) {\n        if (element.tagName == \"DETAILS\") {\n          element.classList.add(\"active\");\n\n          if (!doNotOpen) {\n            element.open = true;\n          }\n        }\n      }\n    }\n  }\n};\n\nconst highlightActiveOnPageLink = function () {\n  var activeHash;\n\n  if (firstCall) {\n    firstCall = false;\n\n    if (location.hash.length > 0) {\n      activeHash = location.hash.substr(1);\n\n      highlightDetailsOnActiveHash(activeHash);\n    }\n    window.addEventListener(\"scroll\", highlightActiveOnPageLink);\n  }\n\n  setTimeout(function () {\n    if (!activeHash) {\n      const anchors = document.querySelectorAll(\"h2 > .anchor, h3 > .anchor\");\n\n      if (anchors.length > 0) {\n        if (document.scrollingElement.scrollTop < 100) {\n          activeHash = anchors[0].attributes.id.value;\n        } else if (\n          document.scrollingElement.scrollTop ==\n          document.scrollingElement.scrollHeight -\n            document.scrollingElement.clientHeight\n        ) {\n          activeHash = anchors[anchors.length - 1].attributes.id.value;\n        } else {\n          for (let i = 0; i < anchors.length; i++) {\n            const anchor = anchors[i];\n\n            if (\n              anchor.parentElement.getBoundingClientRect().top <\n              window.screen.availHeight * 0.5\n            ) {\n              activeHash = anchor.attributes.id.value;\n            } else {\n              break;\n            }\n          }\n        }\n      }\n\n      if (!activeHash) {\n        const firstOnPageNavLink = document.querySelectorAll(\n          \".toc-headings:first-child > li:first-child > a\"\n        );\n\n        if (firstOnPageNavLink.attributes) {\n          activeHash = firstOnPageNavLink.attributes.href.value.substr(1);\n        }\n      }\n    }\n\n    const allLinks = document.querySelectorAll(\"a\");\n\n    for (let i = 0; i < allLinks.length; i++) {\n      const link = allLinks[i];\n      link.classList.remove(\"active\");\n\n      if (\n        link.parentElement &&\n        link.parentElement.parentElement &&\n        link.parentElement.parentElement.tagName == \"UL\"\n      ) {\n        link.parentElement.parentElement.classList.remove(\"active\");\n      }\n    }\n\n    const activeLinks = document.querySelectorAll(\n      \"a[href='#\" + activeHash + \"'\"\n    );\n\n    for (let i = 0; i < activeLinks.length; i++) {\n      const link = activeLinks[i];\n      link.classList.add(\"active\");\n\n      if (\n        link.parentElement &&\n        link.parentElement.parentElement &&\n        link.parentElement.parentElement.tagName == \"UL\"\n      ) {\n        link.parentElement.parentElement.classList.add(\"active\");\n      }\n    }\n  }, 100);\n};\n\nconst hashLinkClickSet = false;\n\nconst allowHashLinkClick = function () {\n  if (!hashLinkClickSet) {\n    const hashLinkIcons = document.querySelectorAll(\".hash-link-icon\");\n\n    for (let i = 0; i < hashLinkIcons.length; i++) {\n      const hashLinkIcon = hashLinkIcons[i];\n      hashLinkIcon.addEventListener(\"mousedown\", function () {\n        history.pushState(\n          null,\n          null,\n          hashLinkIcon.parentElement.attributes.href.value\n        );\n        highlightActiveOnPageLink();\n        highlightDetailsOnActiveHash(location.hash.substr(1), true);\n      });\n    }\n  }\n};\n\nwindow.addEventListener(\"load\", allowHashLinkClick);\nwindow.addEventListener(\"load\", highlightActiveOnPageLink);\nwindow.addEventListener(\n  \"popstate\",\n  function (event) {\n    highlightDetailsOnActiveHash(location.hash.substr(1));\n  },\n  false\n);\nwindow.addEventListener(\"click\", function (e) {\n  if (e.target.nodeName == \"A\" || e.target == document) {\n    setTimeout(function () {\n      highlightDetailsOnActiveHash(location.hash.substr(1));\n    }, 1000);\n  }\n});\n\n/*const fixCopyButtons = function(e){\n    if (e.target.nodeName == \"A\" || e.target == document) {\n        setTimeout(function() {\n            document.querySelectorAll('html body .markdown button[aria-label=\"Copy code to clipboard\"]').forEach(function(el) {\n                const newEl = el.cloneNode(true);\n                el.parentNode.replaceChild(newEl, el);\n                newEl.addEventListener(\"click\", function(e) {\n                    const selection = window.getSelection();\n                    const range = document.createRange();\n                    range.selectNodeContents(e.target.parentElement.querySelector(':scope > .prism-code'));\n                    selection.removeAllRanges();\n                    selection.addRange(range);\n                    \n                    document.execCommand('copy');\n                    selection.removeAllRanges();\n            \n                    const original = e.target.textContent;\n                    e.target.textContent = 'Copied';\n            \n                    setTimeout(() => {\n                        e.target.textContent = original;\n                    }, 1200);\n                })\n            });\n        }, 1000);\n    }\n}*/\n\n//document.addEventListener(\"DOMContentLoaded\", fixCopyButtons);\n//window.addEventListener(\"popstate\", fixCopyButtons);\n//window.addEventListener(\"click\", fixCopyButtons);\n"
  },
  {
    "path": "docs/uml/c4_build.puml",
    "content": "@startuml\n!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml\n\nskinparam linetype ortho\nskinparam nodesep 100\nskinparam ranksep 250\nscale 1920x1080\n\nLAYOUT_TOP_DOWN()\nHIDE_STEREOTYPE()\n\ntitle Component Diagram for DevPod Build Process\n\nPerson(user, \"DevPod\", \"CLI or UI\")\nComponent(reg, \"Registry\", \"Remote cache\")\nComponent(ctx, \"Context\", \"Build options, driver, registry cache etc.\")\nComponent(cdf, \"Compiled Dockerfile\", \"\")\n\nBoundary(repo, \"Git repo\") {\n  Component(bctx, \"Build context\", \"Source code, dot files etc.\")\n  Component(df, \"Dockerfile\", \"\")\n\n  Boundary(cluster, \"Dev Container Spec\") {\n    Component(dc, \".devcontainer.json\", \"Define dev env\")\n    Component(fa, \"Feature A\", \"docker in docker\")\n    Component(fb, \"Feature B\", \"git stuff\")\n  }\n}\n\nRel(repo, user, \"\")\nRel(dc, user, \"\")\nRel(fa, user, \"\")\nRel(fb, user, \"\")\nRel_Right(ctx, user, \"\")\nRel(user, cdf, \"\")\nRel(cdf, reg, \"\")\n@enduml"
  },
  {
    "path": "docs/uml/c4_build_k8s.puml",
    "content": "@startuml\n!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml\n!include <material/common>\n!include <material/sync>\n\nHIDE_STEREOTYPE()\nLAYOUT_TOP_DOWN()\n\nPerson(user, \"DevPod\", \"Uses kubectl\")\nSystem(prov, \"Kubernetes Provider\", \"Devpod Provider\")\n\nSystem_Boundary(host, \"Kubernetes Cluster\") {\n    System(controlPlane, \"kube API server\", \"Manages the cluster\")\n\n    System_Boundary(devpodns, \"devpod namespace\") {\n        \n        Container_Boundary(kaniko1, \"Workspace\") {\n            ContainerDb(cache, \"Build Cache\", \"Volume\", \"Local registry mirror\")\n            ContainerDb(dir, \"Workspace Directory\", \"Volume\", \"Build context\")\n            Container(kr1, \"Kaniko Runner\", \"kaniko:executor\", \"Runs container as linux process\")\n            Container(kb1, \"Kaniko Builder\", \"kaniko:executor\", \"Builds image in userspace\")\n        }\n    }\n}\n\nSystem_Boundary(registry, \"Container Registry\") {\n    System(registryCache, \"Image Repository\", \"\")\n    System(cacheRepo, \"Cached Layer Repositories\", \"\")\n}\n\nRel(user, prov, \" devpod up ...\")\nRel(prov, controlPlane, \" kubectl ...\")\nRel(controlPlane, kb1, \" \")\nRel(user, registry, \"devpod build ...\")\nRel(registry, kb1, \"\")\nRel(kb1, kr1, \" image\")\n@enduml"
  },
  {
    "path": "docs/uml/c4_k8s.puml",
    "content": "@startuml\n!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml\n\nskinparam linetype ortho\nskinparam nodesep 200\nskinparam ranksep 150\nscale 1920x1080\n\nHIDE_STEREOTYPE()\nLAYOUT_TOP_DOWN()\n\ntitle Component diagram for DevPod with kubernetes\n\nPerson(user, \"DevPod\", \"CLI or UI\")\nSystem(prov, \"Kubernetes Provider\", \"Devpod Provider\")\nComponent(ide, \"IDE\", \"Local IDE\")\nComponent(ctx, \"Context\", \"Config, working dir etc.\")\nComponent(env, \"Local Env\", \"Shell variables, git credentials etc.\")\n\nSystem_Boundary(cluster, \"Kubernetes Cluster\") {\n  System(controlPlane, \"kube API server\", \"Manages the cluster\")\n  System_Boundary(ns, \"devpod namespace\") {\n    Container_Boundary(ws, \"Workspace\") {\n      Component(runner, \"Dev Container\", \"kaniko:executor\")\n      Component(agent, \"Agent\", \"\")\n      Component(ssh, \"SSH server\", \"\")\n      ContainerDb(dir, \"Workspace Directory\", \"Volume\", \"\")\n    }\n  }\n}\n\nBiRel_Right(user, prov, \"devpod up ...\")\nBiRel(prov, controlPlane, \" kubectl ...\")\nBiRel(controlPlane, agent, \" \")\nBiRel_Left(agent, ssh, \"Tunnelled STDIO\")\nRel(agent, runner, \" \")\nBiRel(user, ide, \"SSH port forwarding\")\nRel_Up(user, ctx, \"\")\nRel_Left(user, env, \"\")\n@enduml"
  },
  {
    "path": "docs/uml/c4_machines.puml",
    "content": "@startuml\n!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml\n\nskinparam linetype ortho\nskinparam nodesep 150\nskinparam ranksep 150\nscale 1920x1080\n\nHIDE_STEREOTYPE()\nLAYOUT_TOP_DOWN()\n\ntitle Component diagram for DevPod with machine providers\n\nPerson(user, \"DevPod\", \"CLI or UI\")\nSystem(prov, \"DevPod Provider\", \"aws, gcloud etc.\")\nComponent(ide, \"IDE\", \"Local IDE\")\nComponent(ctx, \"Context\", \"Config, working dir etc.\")\nComponent(env, \"Local Env\", \"Shell variables, git credentials etc.\")\n\nSystem_Boundary(cluster, \"Virtual Machine\") {\n  System(controlPlane, \"DevPod Agent\", \"Manages the machine\")\n  System(dockerd, \"Docker daemon\", \"Manages the containers\")\n  Container_Boundary(ws, \"Workspace\") {\n    Component(runner, \"devcontainer\", \"\")\n    Component(agent, \"DevPod Container Agent\", \"\")\n    Component(ssh, \"SSH server\", \"\")\n    ContainerDb(dir, \"Workspace Directory\", \"Volume\", \"\")\n  }\n}\n\nBiRel(user, prov, \" devpod up ...\")\nBiRel(prov, controlPlane, \"secure provider specific tunnel\")\nRel(controlPlane, dockerd, \"docker run ...\")\nRel(dockerd, ws, \"\")\nRel(agent, ssh, \"\")\nRel(agent, runner, \"\")\nBiRel_Right(user, ide, \"SSH port forwarding\")\nRel(ctx, user, \"\")\nRel(env, user, \"\")\nBiRel(controlPlane, agent, \"SSH  \")\n@enduml"
  },
  {
    "path": "docs/uml/c4_workspaces.puml",
    "content": "@startuml\n!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml\n\nskinparam linetype ortho\nskinparam nodesep 150\nskinparam ranksep 150\nscale 1920x1080\n\nHIDE_STEREOTYPE()\nLAYOUT_TOP_DOWN()\n\ntitle Component diagram for DevPod\n\nPerson(user, \"DevPod\", \"CLI or UI\")\nSystem(prov, \"Provider\", \"Devpod Provider\")\nComponent(ide, \"IDE\", \"Local IDE\")\nComponent(ctx, \"Context\", \"Config, working dir etc.\")\nComponent(env, \"Local Env\", \"Shell variables, git credentials etc.\")\nComponent(dc, \".devcontainer.json\", \"Dev container spec\")\nComponent(git, \"Git repo\", \"Project repo\")\n\nSystem_Boundary(cluster, \"Machine / Cluster\") {\n  System(controlPlane, \"Control plane\", \"Tunnels connection\")\n  Container_Boundary(ws, \"Workspace\") {\n    Component(runner, \"Dev container\", \"\")\n    Component(agent, \"Agent\", \"\")\n    Component(ssh, \"SSH server\", \"\")\n  }\n}\n\nBiRel(user, prov, \"devpod up ...\")\nBiRel(prov, controlPlane, \"\")\nBiRel(controlPlane, agent, \" gRPC\")\nBiRel_Left(agent, ssh, \"Tunnelled STDIO\")\nRel(agent, runner, \"\")\nBiRel_Left(user, ide, \"SSH port forwarding\")\nRel(ctx, user, \"\")\nRel(env, user, \"\")\nRel(git, user, \"\")\nRel(dc, user, \"\")\n@enduml"
  },
  {
    "path": "docs/uml/up_sequence.puml",
    "content": "@startuml\n\n!theme cloudscape-design\nskinparam BackgroundColor lightgray\n\nalt using machine provider\nalt machine doesn't exist\nDevPod -> Provider: devpod machine create\nProvider --> DevPod: machine id\nend\nDevPod -> Provider: devpod machine start\nProvider --> DevPod: machine id\nend\n\nDevPod -> Repo: git pull\nRepo --> DevPod: source code\n\nalt image not already available\nDevPod -> Agent: devpod workspace build\nactivate Agent\nAgent --> ContainerRuntime: build\nContainerRuntime --> Agent: image\nAgent --> DevPod: \ndeactivate Agent\nend\n\nDevPod -> Agent: devpod helper ssh-server --stdio\nactivate Agent\nDevPod -> Agent: devpod agent daemon\nDevPod -> Agent: devpod agent workspace up --workspace-info\n\nAgent -> ContainerRuntime: run\nContainerRuntime --> Agent: container id\n\nAgent -> ContainerAgent: devpod helper ssh-server --stdio\nactivate ContainerAgent\n\nAgent -> ContainerAgent: devpod agent container setup\nAgent -> ContainerAgent: devpod agent container credentials-server\nalt if EXIT_AFTER_TIMEOUT\nAgent -> ContainerAgent: devpod agent container daemon\nend\n\nalt if pro user\nAgent -> ContainerAgent: devpod agent container setup-loft-platform-access\nContainerAgent -> Platform: Setup pro\nPlatform --> ContainerAgent: platform creds\nend\n\nalt if GIT_SSH_SIGNATURE_FORWARDING\nAgent -> DevPod: devpod agent git-credentials\nDevPod --> Agent: git creds\nend\nalt if SSH_INJECT_DOCKER_CREDENTIALS\nAgent -> DevPod: devpod agent docker-credentials\nDevPod --> Agent: docker creds\nend\n\nAgent -> ContainerAgent: Run life cycle hooks\n\nContainerAgent --> Agent: \ndeactivate ContainerAgent\nAgent --> DevPod: \ndeactivate Agent\n\nalt if using browser based IDE (openvscode, jupyter)\nDevPod -> ContainerAgent: devpod ssh --reuse-ssh-auth-sock\nend\n\nDevPod -> IDE: Start\n\nalt if using normal IDE (vscode, intilliJ)\nIDE -> ContainerAgent: devpod ssh\nContainerAgent --> IDE: ssh close\nend\n\nalt if using browser based IDE (openvscode, jupyter)\nContainerAgent -> DevPod: ssh close\nend\n\n\n@enduml\n"
  },
  {
    "path": "e2e/README.md",
    "content": "### E2E tests\n\n#### Prerequisites\n\nMake sure you have ginkgo installed on your local machine:\n```\ngo get github.com/onsi/ginkgo/ginkgo\n```\n\nTo build the binaries locally use the following command from this directory\n```\nBUILDDIR=bin SRCDIR=\"..\" ../hack/build-e2e.sh\n```\n\n#### Run all E2E test\n```\n# Install ginkgo and run in this directory\nginkgo\n```\n"
  },
  {
    "path": "e2e/devcontainer-feature.json",
    "content": "{\n  \"name\": \"Hello\",\n  \"id\": \"hello\",\n  \"version\": \"0.0.1\",\n  \"description\": \"A feature installing hello\"\n}\n"
  },
  {
    "path": "e2e/e2e_suite_test.go",
    "content": "package e2e\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/onsi/ginkgo/v2\"\n\n\t\"github.com/onsi/gomega\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\n\t// Register tests\n\t_ \"github.com/loft-sh/devpod/e2e/tests/build\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/context\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/ide\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/integration\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/machine\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/machineprovider\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/provider\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/ssh\"\n\t_ \"github.com/loft-sh/devpod/e2e/tests/up\"\n)\n\n// TestRunE2ETests checks configuration parameters (specified through flags) and then runs\n// E2E tests using the Ginkgo runner.\n// If a \"report directory\" is specified, one or more JUnit test reports will be\n// generated in this directory, and cluster logs will also be saved.\n// This function is called on each Ginkgo node in parallel mode.\nfunc TestRunE2ETests(t *testing.T) {\n\tif runtime.GOOS != \"linux\" {\n\t\tgo framework.ServeAgent()\n\n\t\t// wait for http server to be up and running\n\t\tfor {\n\t\t\ttime.Sleep(time.Second)\n\t\t\tif os.Getenv(\"DEVPOD_AGENT_URL\") != \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tgomega.RegisterFailHandler(ginkgo.Fail)\n\tginkgo.RunSpecs(t, \"DevPod e2e suite\")\n}\n"
  },
  {
    "path": "e2e/framework/command.go",
    "content": "package framework\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/workspace\"\n)\n\nfunc (f *Framework) FindWorkspace(ctx context.Context, id string) (*provider2.Workspace, error) {\n\tlist, err := f.DevPodListParsed(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceID := workspace.ToID(id)\n\tfor _, w := range list {\n\t\tif w.ID == workspaceID {\n\t\t\treturn w, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"couldn't find workspace %s\", workspaceID)\n}\n\nfunc (f *Framework) DevPodListParsed(ctx context.Context) ([]*provider2.Workspace, error) {\n\traw, err := f.DevPodList(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tretList := []*provider2.Workspace{}\n\terr = json.Unmarshal([]byte(raw), &retList)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn retList, nil\n}\n\n// DevPodList executes the `devpod list` command in the test framework\nfunc (f *Framework) DevPodList(ctx context.Context) (string, error) {\n\tlistArgs := []string{\"list\", \"--output\", \"json\"}\n\n\tout, _, err := f.ExecCommandCapture(ctx, listArgs)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"devpod list failed: %s\", err.Error())\n\t}\n\treturn out, nil\n}\n\nfunc (f *Framework) DevPodUpStreams(ctx context.Context, workspace string, additionalArgs ...string) (string, string, error) {\n\tupArgs := []string{\"up\", \"--ide\", \"none\", workspace}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\tstdout, stderr, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn stdout, stderr, fmt.Errorf(\"devpod up failed: %s\", err.Error())\n\t}\n\n\treturn stdout, stderr, nil\n}\n\n// DevPodUp executes the `devpod up` command in the test framework\nfunc (f *Framework) DevPodUpWithIDE(ctx context.Context, additionalArgs ...string) error {\n\tupArgs := []string{\"up\", \"--debug\"}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\t_, _, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod up failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodBuild(ctx context.Context, additionalArgs ...string) error {\n\tupArgs := []string{\"build\", \"--debug\"}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\t_, _, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod build failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodUp(ctx context.Context, additionalArgs ...string) error {\n\tupArgs := []string{\"up\", \"--debug\", \"--ide\", \"none\"}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\t_, _, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod up failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodUpRecreate(ctx context.Context, additionalArgs ...string) error {\n\tupArgs := []string{\"up\", \"--recreate\", \"--debug\", \"--ide\", \"none\"}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\t_, _, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod up --recreate failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodUpReset(ctx context.Context, additionalArgs ...string) error {\n\tupArgs := []string{\"up\", \"--reset\", \"--debug\", \"--ide\", \"none\"}\n\tupArgs = append(upArgs, additionalArgs...)\n\n\t_, _, err := f.ExecCommandCapture(ctx, upArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod up --reset failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodSSH(ctx context.Context, workspace string, command string) (string, error) {\n\tout, err := f.ExecCommandOutput(ctx, []string{\"ssh\", workspace, \"--command\", command})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"devpod ssh failed: %s\", err.Error())\n\t}\n\treturn out, nil\n}\n\nfunc (f *Framework) DevPodSSHEchoTestString(ctx context.Context, workspace string) error {\n\terr := f.ExecCommand(ctx, true, true, \"mYtEsTsTrInG\", []string{\"ssh\", \"--command\", \"echo 'bVl0RXNUc1RySW5H' | base64 -d\", workspace})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod ssh failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderOptionsCheckNamespaceDescription(ctx context.Context, provider, searchStr string) error {\n\terr := f.ExecCommand(ctx, true, true, searchStr, []string{\"provider\", \"options\", provider})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"did not found value %s in devpod provider options output. error: %s\", searchStr, err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderList(ctx context.Context, extraArgs ...string) error {\n\tbaseArgs := []string{\"provider\", \"list\"}\n\terr := f.ExecCommand(ctx, false, true, \"\", append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod provider list failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderUse(ctx context.Context, provider string, extraArgs ...string) error {\n\tbaseArgs := []string{\"provider\", \"use\", provider}\n\terr := f.ExecCommand(ctx, false, true, \"\", append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod provider use failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodStatus(ctx context.Context, extraArgs ...string) (client.WorkspaceStatus, error) {\n\tbaseArgs := []string{\"status\", \"--output\", \"json\"}\n\tbaseArgs = append(baseArgs, extraArgs...)\n\tstdout, err := f.ExecCommandOutput(ctx, baseArgs)\n\tif err != nil {\n\t\treturn client.WorkspaceStatus{}, fmt.Errorf(\"devpod status failed: %s\", err.Error())\n\t}\n\n\tstatus := &client.WorkspaceStatus{}\n\terr = json.Unmarshal([]byte(stdout), status)\n\tif err != nil {\n\t\treturn client.WorkspaceStatus{}, err\n\t}\n\n\treturn *status, nil\n}\n\nfunc (f *Framework) DevPodStop(ctx context.Context, workspace string) error {\n\tbaseArgs := []string{\"stop\"}\n\tbaseArgs = append(baseArgs, workspace)\n\terr := f.ExecCommand(ctx, false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod stop failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderAdd(ctx context.Context, args ...string) error {\n\tbaseArgs := []string{\"provider\", \"add\"}\n\tbaseArgs = append(baseArgs, args...)\n\terr := f.ExecCommand(ctx, false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod provider add failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderDelete(ctx context.Context, args ...string) error {\n\tbaseArgs := []string{\"provider\", \"delete\"}\n\tbaseArgs = append(baseArgs, args...)\n\terr := f.ExecCommand(ctx, false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (f *Framework) DevPodProviderUpdate(ctx context.Context, args ...string) error {\n\tbaseArgs := []string{\"provider\", \"update\"}\n\tbaseArgs = append(baseArgs, args...)\n\terr := f.ExecCommand(ctx, false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod provider update failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodMachineCreate(args []string) error {\n\tbaseArgs := []string{\"machine\", \"create\"}\n\tbaseArgs = append(baseArgs, args...)\n\terr := f.ExecCommand(context.Background(), false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod nachine create failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodMachineDelete(args []string) error {\n\tbaseArgs := []string{\"machine\", \"delete\"}\n\tbaseArgs = append(baseArgs, args...)\n\terr := f.ExecCommand(context.Background(), false, false, \"\", baseArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod nachine delete failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodWorkspaceStop(ctx context.Context, extraArgs ...string) error {\n\tbaseArgs := []string{\"stop\"}\n\tbaseArgs = append(baseArgs, extraArgs...)\n\treturn f.ExecCommandStdout(ctx, baseArgs)\n}\n\nfunc (f *Framework) DevPodWorkspaceDelete(ctx context.Context, workspace string, extraArgs ...string) error {\n\tbaseArgs := []string{\"delete\", workspace, \"--ignore-not-found\"}\n\tbaseArgs = append(baseArgs, extraArgs...)\n\n\treturn f.ExecCommand(ctx, false, true, fmt.Sprintf(\"Successfully deleted workspace '%s'\", workspace), baseArgs)\n}\n\nfunc (f *Framework) SetupGPG(tmpDir string) error {\n\tif _, err := exec.LookPath(\"gpg\"); err != nil {\n\t\terr := exec.Command(\"sudo\", \"apt-get\", \" install\", \"gnupg2\", \"-y\").Run()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\terr := exec.Command(\"gpg\", \"--import\", filepath.Join(tmpDir, \"gpg-public.key\")).Run()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\terr = exec.Command(\"gpg\", \"--import\", filepath.Join(tmpDir, \"gpg-private.key\")).Run()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\terr = exec.Command(\"gpgconf\", \"--kill\", \"gpg-agent\").Run()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\terr = exec.Command(\"gpg-agent\", \"--homedir\", \"$HOME/.gnupg\", \"--use-standard-socket\", \"--daemon\").Run()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn exec.Command(\"gpg\", \"-k\").Run()\n}\n\nfunc (f *Framework) DevPodSSHGpgTestKey(ctx context.Context, workspace string) error {\n\tpubKeyB, err := exec.Command(\"sh\", \"-c\", \"gpg -k --with-colons 2>/dev/null | grep sec | base64 -w0\").Output()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// First run to trigger the first forwarding\n\tstdout, _, err := f.ExecCommandCapture(ctx, []string{\n\t\t\"ssh\",\n\t\t\"--agent-forwarding\",\n\t\t\"--gpg-agent-forwarding\",\n\t\t\"--command\",\n\t\t\"gpg -k --with-colons 2>/dev/null |grep sec |  base64 -w0\", workspace,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif stdout != string(pubKeyB) {\n\t\treturn fmt.Errorf(\"devpod gpg public key forwarding failed, expected %s, got %s\", string(pubKeyB), stdout)\n\t}\n\n\treturn nil\n}\n\nfunc (f *Framework) DevpodPortTest(ctx context.Context, port string, workspace string) error {\n\t// First run to trigger the first forwarding\n\t_, _, err := f.ExecCommandCapture(ctx, []string{\n\t\t\"ssh\",\n\t\t\"--forward-ports\", port, workspace,\n\t})\n\treturn err\n}\n\nfunc (f *Framework) DevPodProviderFindOption(ctx context.Context, provider string, searchStr string, extraArgs ...string) error {\n\tbaseArgs := []string{\"provider\", \"options\", provider}\n\terr := f.ExecCommand(ctx, false, true, searchStr, append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod provider use failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodContextCreate(ctx context.Context, name string, extraArgs ...string) error {\n\tbaseArgs := []string{\"context\", \"create\", name}\n\terr := f.ExecCommand(ctx, false, true, \"\", append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod context create failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodContextUse(ctx context.Context, name string, extraArgs ...string) error {\n\tbaseArgs := []string{\"context\", \"use\", name}\n\terr := f.ExecCommand(ctx, false, true, \"\", append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod context use failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc (f *Framework) DevPodContextDelete(ctx context.Context, name string, extraArgs ...string) error {\n\tbaseArgs := []string{\"context\", \"delete\", name}\n\terr := f.ExecCommand(ctx, false, true, \"\", append(baseArgs, extraArgs...))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"devpod context delete failed: %s\", err.Error())\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "e2e/framework/exec.go",
    "content": "package framework\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// ExecCommand executes the command string with the devpod test binary\nfunc (f *Framework) ExecCommandOutput(ctx context.Context, args []string) (string, error) {\n\tvar execOut bytes.Buffer\n\n\tcmd := exec.CommandContext(ctx, filepath.Join(f.DevpodBinDir, f.DevpodBinName), args...)\n\tcmd.Stdout = io.MultiWriter(os.Stdout, &execOut)\n\tcmd.Stderr = os.Stderr\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn execOut.String(), nil\n}\n\n// ExecCommandStdout executes the command string with the devpod test binary\nfunc (f *Framework) ExecCommandStdout(ctx context.Context, args []string) error {\n\tcmd := exec.CommandContext(ctx, filepath.Join(f.DevpodBinDir, f.DevpodBinName), args...)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tif err := cmd.Run(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// ExecCommand executes the command string with the devpod test binary\nfunc (f *Framework) ExecCommand(ctx context.Context, captureStdOut, searchForString bool, searchString string, args []string) error {\n\tvar execOut bytes.Buffer\n\n\tcmd := exec.CommandContext(ctx, filepath.Join(f.DevpodBinDir, f.DevpodBinName), args...)\n\tcmd.Stdout = io.MultiWriter(os.Stdout, &execOut)\n\tcmd.Stderr = os.Stderr\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn err\n\t}\n\n\tif captureStdOut && searchForString {\n\t\tif strings.Contains(execOut.String(), searchString) {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn fmt.Errorf(\"expected to find string %s in output\", searchString)\n\t}\n\n\treturn nil\n}\n\n// ExecCommandCapture executes the command string with the devpod test binary, and returns stdout, stderr, and any error that occurred.\nfunc (f *Framework) ExecCommandCapture(ctx context.Context, args []string) (string, string, error) {\n\tvar execOut bytes.Buffer\n\tvar execErr bytes.Buffer\n\n\tcmd := exec.CommandContext(ctx, filepath.Join(f.DevpodBinDir, f.DevpodBinName), args...)\n\tcmd.Stdout = io.MultiWriter(os.Stdout, &execOut)\n\tcmd.Stderr = io.MultiWriter(os.Stderr, &execErr)\n\n\terr := cmd.Run()\n\treturn execOut.String(), execErr.String(), err\n}\n"
  },
  {
    "path": "e2e/framework/framework.go",
    "content": "package framework\n\nimport (\n\t\"runtime\"\n)\n\ntype Framework struct {\n\tDevpodBinDir  string\n\tDevpodBinName string\n}\n\nfunc NewDefaultFramework(path string) *Framework {\n\tbinName := \"devpod-\"\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\tbinName = binName + \"darwin-\"\n\tcase \"linux\":\n\t\tbinName = binName + \"linux-\"\n\tcase \"windows\":\n\t\tbinName = binName + \"windows-\"\n\t}\n\n\tswitch runtime.GOARCH {\n\tcase \"amd64\":\n\t\tbinName = binName + \"amd64\"\n\tcase \"arm64\":\n\t\tbinName = binName + \"arm64\"\n\t}\n\n\tif runtime.GOOS == \"windows\" {\n\t\tbinName = binName + \".exe\"\n\t}\n\n\treturn &Framework{DevpodBinDir: path, DevpodBinName: binName}\n}\n"
  },
  {
    "path": "e2e/framework/helper.go",
    "content": "package framework\n\nimport \"github.com/onsi/gomega\"\n\n// ExpectEqual expects the specified two are the same, otherwise an exception raises\nfunc ExpectEqual(actual interface{}, extra interface{}, explain ...interface{}) {\n\tgomega.ExpectWithOffset(1, actual).To(gomega.Equal(extra), explain...)\n}\n\n// ExpectNotEqual expects the specified two are not the same, otherwise an exception raises\nfunc ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{}) {\n\tgomega.ExpectWithOffset(1, actual).NotTo(gomega.Equal(extra), explain...)\n}\n\n// ExpectError expects an error happens, otherwise an exception raises\nfunc ExpectError(err error, explain ...interface{}) {\n\tgomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...)\n}\n\n// ExpectNoError checks if \"err\" is set, and if so, fails assertion while logging the error.\nfunc ExpectNoError(err error, explain ...interface{}) {\n\tExpectNoErrorWithOffset(1, err, explain...)\n}\n\n// ExpectNoErrorWithOffset checks if \"err\" is set, and if so, fails assertion while logging the error at \"offset\" levels above its caller\n// (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for \"f\").\nfunc ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) {\n\tgomega.ExpectWithOffset(1+offset, err).NotTo(gomega.HaveOccurred(), explain...)\n}\n"
  },
  {
    "path": "e2e/framework/server_utils.go",
    "content": "package framework\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// ServeAgent will be a simple http file server that will expose our\n// freshly compiled devpod binaries to be downloaded as agents.\n// useful for non-linux runners\nfunc ServeAgent() {\n\t// Specify the directory containing the files you want to serve\n\tdir := \"bin\"\n\n\twd, err := os.Getwd()\n\tif err == nil {\n\t\tdir = filepath.Join(wd, \"bin\")\n\t}\n\n\t// Create a file server handler for the specified directory\n\tfileServer := http.FileServer(http.Dir(dir))\n\n\t// Register the file server handler to serve files under the /files route\n\thttp.Handle(\"/files/\", http.StripPrefix(\"/files\", fileServer))\n\n\tip := getIP()\n\n\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\"%v:0\", ip))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\taddr := listener.Addr().String()\n\terr = os.Setenv(\"DEVPOD_AGENT_URL\", \"http://\"+addr+\"/files/\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Start the HTTP server on port 8080\n\tlog.Printf(\"Server started on %s\", addr)\n\n\terr = http.Serve(listener, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc getIP() string {\n\t// Get a list of network interfaces\n\tifaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn \"0.0.0.0\"\n\t}\n\n\t// Iterate over each network interface\n\tfor _, iface := range ifaces {\n\t\taddrs, err := iface.Addrs()\n\t\tif err != nil {\n\t\t\treturn \"0.0.0.0\"\n\t\t}\n\n\t\tfor _, addr := range addrs {\n\t\t\tswitch v := addr.(type) {\n\t\t\tcase *net.IPAddr:\n\t\t\t\tif v.IP.To4() != nil {\n\t\t\t\t\tif v.IP.DefaultMask().String() == \"ffffff00\" || v.IP.DefaultMask().String() == \"ff000000\" {\n\t\t\t\t\t\treturn v.IP.String()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase *net.IPNet:\n\t\t\t\tif v.IP.To4() != nil {\n\t\t\t\t\tif v.IP.DefaultMask().String() == \"ffffff00\" || v.IP.DefaultMask().String() == \"ff000000\" {\n\t\t\t\t\t\treturn v.IP.String()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"0.0.0.0\"\n}\n"
  },
  {
    "path": "e2e/framework/types.go",
    "content": "package framework\n\n// PodList is a list of Pods.\ntype PodList struct {\n\tItems []Pod `json:\"items\"`\n}\n\ntype Pod struct {\n\tSpec PodSpec `json:\"spec,omitempty\"`\n}\n\ntype PodSpec struct {\n\tContainers []PodContainer `json:\"containers,omitempty\"`\n}\n\ntype PodContainer struct {\n\tImage string `json:\"image,omitempty\"`\n}\n"
  },
  {
    "path": "e2e/framework/util.go",
    "content": "package framework\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/otiai10/copy\"\n)\n\nfunc GetTimeout() time.Duration {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn 600 * time.Second\n\t}\n\n\treturn 60 * time.Second\n}\n\nfunc CreateTempDir() (string, error) {\n\t// Create temporary directory\n\tdir, err := os.MkdirTemp(\"\", \"temp-*\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Make sure temp dir path is an absolute path\n\tdir, err = filepath.EvalSymlinks(dir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn dir, nil\n}\n\nfunc CopyToTempDirWithoutChdir(relativePath string) (string, error) {\n\t// Create temporary directory\n\tdir, err := os.MkdirTemp(\"\", \"temp-*\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Make sure temp dir path is an absolute path\n\tdir, err = filepath.EvalSymlinks(dir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Copy the file files from relativePath to the temp dir\n\terr = copy.Copy(relativePath, dir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dir)\n\t\treturn \"\", err\n\t}\n\n\treturn dir, nil\n}\n\nfunc CopyToTempDirInDir(baseDir, relativePath string) (string, error) {\n\t// Create temporary directory\n\tdir, err := os.MkdirTemp(baseDir, \"temp-*\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Make sure temp dir path is an absolute path\n\tdir, err = filepath.EvalSymlinks(dir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Copy the file files from relativePath to the temp dir\n\terr = copy.Copy(relativePath, dir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dir)\n\t\treturn \"\", err\n\t}\n\n\t// Set the temp director as the current directory\n\terr = os.Chdir(dir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dir)\n\t\treturn \"\", err\n\t}\n\n\treturn dir, nil\n}\n\nfunc CopyToTempDir(relativePath string) (string, error) {\n\treturn CopyToTempDirInDir(\"\", relativePath)\n}\n\nfunc CleanupTempDir(initialDir, tempDir string) {\n\terr := os.Chdir(initialDir)\n\tExpectNoError(err)\n\n\terr = os.RemoveAll(tempDir)\n\tif err != nil {\n\t\tfmt.Println(\"WARN:\", err)\n\t}\n}\n\nfunc CleanString(input string) string {\n\tinput = strings.ReplaceAll(input, \"\\\\\", \"\")\n\treturn strings.ReplaceAll(input, \"/\", \"\")\n}\n"
  },
  {
    "path": "e2e/tests/build/build.go",
    "content": "package build\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/dockerfile\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod build test suite\", func() {\n\tginkgo.Context(\"testing build\", ginkgo.Label(\"build\"), ginkgo.Ordered, func() {\n\t\tvar initialDir string\n\t\tvar dockerHelper *docker.DockerHelper\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t})\n\n\t\tginkgo.It(\"build docker buildx\", func() {\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tcfg := getDevcontainerConfig(tempDir)\n\n\t\t\tdockerfilePath := tempDir + \"/.devcontainer/Dockerfile\"\n\t\t\tdockerfileContent, err := os.ReadFile(dockerfilePath)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, modifiedDockerfileContents, err := dockerfile.EnsureDockerfileHasFinalStageName(string(dockerfileContent), config.DockerfileDefaultTarget)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tprebuildRepo := \"test-repo\"\n\n\t\t\t// do the build\n\t\t\terr = f.DevPodBuild(ctx, tempDir, \"--force-build\", \"--platform\", \"linux/amd64,linux/arm64\", \"--repository\", prebuildRepo, \"--skip-push\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// parse the dockerfile\n\t\t\tfile, err := dockerfile.Parse(modifiedDockerfileContents)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tinfo := &config.ImageBuildInfo{Dockerfile: file}\n\n\t\t\t// make sure images are there\n\t\t\tprebuildHash, err := config.CalculatePrebuildHash(cfg, \"linux/amd64\", \"amd64\", filepath.Dir(cfg.Origin), dockerfilePath, modifiedDockerfileContents, info, log.Default)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = dockerHelper.InspectImage(ctx, prebuildRepo+\":\"+prebuildHash, false)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tprebuildHash, err = config.CalculatePrebuildHash(cfg, \"linux/arm64\", \"arm64\", filepath.Dir(cfg.Origin), dockerfilePath, modifiedDockerfileContents, info, log.Default)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = dockerHelper.InspectImage(ctx, prebuildRepo+\":\"+prebuildHash, false)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdetails, err := dockerHelper.InspectImage(ctx, prebuildRepo+\":\"+prebuildHash, false)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(details.Config.Labels[\"test\"], \"VALUE\", \"should contain test label\")\n\t\t})\n\n\t\tginkgo.It(\"should build image without repository specified if skip-push flag is set\", func() {\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\tcfg := getDevcontainerConfig(tempDir)\n\n\t\t\tdockerfilePath := tempDir + \"/.devcontainer/Dockerfile\"\n\t\t\tdockerfileContent, err := os.ReadFile(dockerfilePath)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, modifiedDockerfileContents, err := dockerfile.EnsureDockerfileHasFinalStageName(string(dockerfileContent), config.DockerfileDefaultTarget)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// do the build\n\t\t\terr = f.DevPodBuild(ctx, tempDir, \"--skip-push\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// parse the dockerfile\n\t\t\tfile, err := dockerfile.Parse(modifiedDockerfileContents)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tinfo := &config.ImageBuildInfo{Dockerfile: file}\n\n\t\t\t// make sure images are there\n\t\t\tprebuildHash, err := config.CalculatePrebuildHash(cfg, \"linux/\"+runtime.GOARCH, runtime.GOARCH, filepath.Dir(cfg.Origin), dockerfilePath, modifiedDockerfileContents, info, log.Default)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = dockerHelper.InspectImage(ctx, build.GetImageName(tempDir, prebuildHash), false)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should build the image of the referenced service from the docker compose file\", func() {\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/docker-compose\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\tprebuildRepo := \"test-repo\"\n\n\t\t\t// do the build\n\t\t\terr = f.DevPodBuild(ctx, tempDir, \"--repository\", prebuildRepo, \"--skip-push\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"build docker internal buildkit\", func() {\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\tcfg := getDevcontainerConfig(tempDir)\n\n\t\t\tdockerfilePath := tempDir + \"/.devcontainer/Dockerfile\"\n\t\t\tdockerfileContent, err := os.ReadFile(dockerfilePath)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, modifiedDockerfileContents, err := dockerfile.EnsureDockerfileHasFinalStageName(string(dockerfileContent), config.DockerfileDefaultTarget)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tprebuildRepo := \"test-repo\"\n\n\t\t\t// do the build\n\t\t\terr = f.DevPodBuild(ctx, tempDir, \"--force-build\", \"--force-internal-buildkit\", \"--repository\", prebuildRepo, \"--skip-push\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// parse the dockerfile\n\t\t\tfile, err := dockerfile.Parse(modifiedDockerfileContents)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tinfo := &config.ImageBuildInfo{Dockerfile: file}\n\n\t\t\t// make sure images are there\n\t\t\tprebuildHash, err := config.CalculatePrebuildHash(cfg, \"linux/amd64\", \"amd64\", filepath.Dir(cfg.Origin), dockerfilePath, modifiedDockerfileContents, info, log.Default)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t_, err = dockerHelper.InspectImage(ctx, prebuildRepo+\":\"+prebuildHash, false)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"build kubernetes dockerless\", func() {\n\t\t\t// skip windows for now\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"kubernetes\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"kubernetes\", \"-o\", \"KUBERNETES_NAMESPACE=devpod\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// do the up\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if ssh works\n\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"echo -n $MY_TEST\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, \"test456\", \"should contain my-test\")\n\t\t})\n\n\t\tginkgo.It(\"rebuild kubernetes dockerless\", func() {\n\t\t\t// skip windows for now\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"kubernetes\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"kubernetes\", \"-o\", \"KUBERNETES_NAMESPACE=devpod\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// do the up\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// create files in root and in workspace, after create we expect data to still be there\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"touch /workspaces/\"+filepath.Base(tempDir)+\"/DATA\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"touch /ROOTFS\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// recreate\n\t\t\terr = f.DevPodUpRecreate(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// this should still be there\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"ls /workspaces/\"+filepath.Base(tempDir)+\"/DATA\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\t// this should fail! because --recreare should trigger a new build, so a new rootfs\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"ls /ROOTFS\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\n\t\tginkgo.It(\"reset kubernetes dockerless\", func() {\n\t\t\t// skip windows for now\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/build/testdata/kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"kubernetes\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"kubernetes\", \"-o\", \"KUBERNETES_NAMESPACE=devpod\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// do the up\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// create files in root and in workspace, after create we expect data to still be there\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"touch /workspaces/\"+filepath.Base(tempDir)+\"/DATA\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"touch /ROOTFS\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// recreate\n\t\t\terr = f.DevPodUpReset(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// this should fail! because --reset should trigger a new git clone\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"ls /workspaces/\"+filepath.Base(tempDir)+\"/DATA\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\t// this should fail! because --recreare should trigger a new build, so a new rootfs\n\t\t\t_, err = f.DevPodSSH(ctx, tempDir, \"ls /ROOTFS\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\t})\n})\n\nfunc getDevcontainerConfig(dir string) *config.DevContainerConfig {\n\treturn &config.DevContainerConfig{\n\t\tDevContainerConfigBase: config.DevContainerConfigBase{\n\t\t\tName: \"Build Example\",\n\t\t},\n\t\tDevContainerActions: config.DevContainerActions{},\n\t\tNonComposeBase:      config.NonComposeBase{},\n\t\tImageContainer:      config.ImageContainer{},\n\t\tComposeContainer:    config.ComposeContainer{},\n\t\tDockerfileContainer: config.DockerfileContainer{\n\t\t\tBuild: &config.ConfigBuildOptions{\n\t\t\t\tDockerfile: \"Dockerfile\",\n\t\t\t\tContext:    \".\",\n\t\t\t\tOptions:    []string{\"--label=test=VALUE\"},\n\t\t\t},\n\t\t},\n\t\tOrigin: dir + \"/.devcontainer/devcontainer.json\",\n\t}\n}\n"
  },
  {
    "path": "e2e/tests/build/framework.go",
    "content": "package build\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[build] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/build/testdata/docker/.devcontainer/Dockerfile",
    "content": "FROM alpine"
  },
  {
    "path": "e2e/tests/build/testdata/docker/.devcontainer/devcontainer.json",
    "content": "{\n  \"name\": \"Build Example\",\n  \"build\": {\n    \"dockerfile\": \"Dockerfile\",\n    \"context\": \".\",\n    \"options\": [\"--label=test=VALUE\"]\n  }\n}\n"
  },
  {
    "path": "e2e/tests/build/testdata/docker-compose/.devcontainer/Dockerfile",
    "content": "FROM alpine"
  },
  {
    "path": "e2e/tests/build/testdata/docker-compose/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Build Example\",\n\t\"dockerComposeFile\": [\n        \"docker-compose.yaml\"\n    ],\n\t\"service\": \"test-service\"\n}"
  },
  {
    "path": "e2e/tests/build/testdata/docker-compose/.devcontainer/docker-compose.yaml",
    "content": "services:\n  test-service:\n    image: test-repo:latest\n    build:\n      context: ./\n      dockerfile: Dockerfile"
  },
  {
    "path": "e2e/tests/build/testdata/kubernetes/.devcontainer/Dockerfile",
    "content": "FROM alpine AS start\n\nENV MY_TEST=test123\n\nFROM ubuntu\n\nENV MY_TEST=test456"
  },
  {
    "path": "e2e/tests/build/testdata/kubernetes/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Build Example Kubernetes\",\n\t\"build\": {\n\t\t\"dockerfile\": \"Dockerfile\"\n\t}\n}"
  },
  {
    "path": "e2e/tests/context/context.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod context test suite\", func() {\n\tginkgo.Context(\"testing context command\", ginkgo.Label(\"context\"), ginkgo.Ordered, func() {\n\t\tctx := context.Background()\n\t\tinitialDir, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tginkgo.It(\"create a new context, switch to it and delete afterwards\", func() {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\terr = f.DevPodContextCreate(ctx, \"test-context\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodContextUse(context.Background(), \"test-context\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodContextDelete(context.Background(), \"test-context\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/context/framework.go",
    "content": "package context\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[context] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/ide/framework.go",
    "content": "package ide\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[ide] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/ide/ide.go",
    "content": "package ide\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod ide test suite\", func() {\n\tginkgo.Context(\"testing ides\", ginkgo.Label(\"ide\"), ginkgo.Ordered, func() {\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"start ides\", func() {\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/ide/testdata\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\terr = f.DevPodUpWithIDE(ctx, tempDir, \"--open-ide=false\", \"--ide=vscode\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodUpWithIDE(ctx, tempDir, \"--open-ide=false\", \"--ide=openvscode\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodUpWithIDE(ctx, tempDir, \"--open-ide=false\", \"--ide=jupyternotebook\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodUpWithIDE(ctx, tempDir, \"--open-ide=false\", \"--ide=fleet\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if ssh works\n\t\t\terr = f.DevPodSSHEchoTestString(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// TODO: test jetbrains ides\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/ide/testdata/.devcontainer.json",
    "content": "{\n\t\"name\": \"Python\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/python:0-3.11\",\n\n\t\"customizations\": {\n\t\t\"vscode\": {\n\t\t\t\"settings\": {},\n\t\t\t\"extensions\": [\n\t\t\t\t\"streetsidesoftware.code-spell-checker\"\n\t\t\t]\n\t\t}\n\t}\n}"
  },
  {
    "path": "e2e/tests/integration/framework.go",
    "content": "package integration\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[integration] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/integration/integration.go",
    "content": "package integration\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n)\n\nvar _ = ginkgo.Describe(\"[integration]: devpod provider ssh test suite\", ginkgo.Ordered, func() {\n\tginkgo.Context(\"testing provider integration\", ginkgo.Label(\"integration\"), ginkgo.Ordered, func() {\n\t\tvar initialDir string\n\t\tctx := context.Background()\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should generate ssh keypairs\", func() {\n\t\t\t_, err := os.Stat(os.Getenv(\"HOME\") + \"/.ssh/id_rsa\")\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"generating ssh keys\")\n\t\t\t\tcmd := exec.Command(\"ssh-keygen\", \"-q\", \"-t\", \"rsa\", \"-N\", \"\", \"-f\", os.Getenv(\"HOME\")+\"/.ssh/id_rsa\")\n\t\t\t\terr = cmd.Run()\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcmd = exec.Command(\"ssh-keygen\", \"-y\", \"-f\", os.Getenv(\"HOME\")+\"/.ssh/id_rsa\")\n\t\t\t\toutput, err := cmd.Output()\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\terr = os.WriteFile(os.Getenv(\"HOME\")+\"/.ssh/id_rsa.pub\", output, 0600)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}\n\n\t\t\tcmd := exec.Command(\"ssh-keygen\", \"-y\", \"-f\", os.Getenv(\"HOME\")+\"/.ssh/id_rsa\")\n\t\t\tpublicKey, err := cmd.Output()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t_, err = os.Stat(os.Getenv(\"HOME\") + \"/.ssh/authorized_keys\")\n\t\t\tif err != nil {\n\t\t\t\terr = os.WriteFile(os.Getenv(\"HOME\")+\"/.ssh/authorized_keys\", publicKey, 0600)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t} else {\n\t\t\t\tf, err := os.OpenFile(os.Getenv(\"HOME\")+\"/.ssh/authorized_keys\",\n\t\t\t\t\tos.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tdefer f.Close()\n\t\t\t\t_, err = f.Write(publicKey)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}\n\t\t})\n\n\t\tginkgo.It(\"should add provider to devpod\", func() {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t// ensure we don't have the ssh provider present\n\t\t\terr := f.DevPodProviderDelete(ctx, \"ssh\")\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"warning: \" + err.Error())\n\t\t\t}\n\n\t\t\terr = f.DevPodProviderAdd(ctx, \"ssh\", \"-o\", \"HOST=localhost\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should run devpod up\", func(ctx context.Context) {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\terr := f.DevPodUp(ctx, \"tests/integration/testdata/\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should run commands to workspace via ssh\", func() {\n\t\t\tcmd := exec.Command(\"ssh\", \"testdata.devpod\", \"echo\", \"test\")\n\t\t\toutput, err := cmd.Output()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tgomega.Expect(output).To(gomega.Equal([]byte(\"test\\n\")))\n\t\t})\n\n\t\tginkgo.It(\"should cleanup devpod workspace\", func(ctx context.Context) {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\terr := f.DevPodWorkspaceDelete(ctx, \"testdata\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/integration/testdata/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\"\n}"
  },
  {
    "path": "e2e/tests/machine/create.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod machine create\", func() {\n\tginkgo.Context(\"testing machine\", ginkgo.Label(\"machine\"), ginkgo.Ordered, func() {\n\t\tctx := context.Background()\n\t\tinitialDir, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tginkgo.It(\"should add simple machine and then delete it\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/machine/testdata\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that mock-provider is deleted\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"mock-provider\")\n\n\t\t\tginkgo.By(\"Add mock provider\")\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/mock-provider.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.By(\"Use mock provier\")\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"mock-provider\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tmachineUUID, _ := uuid.NewRandom()\n\t\t\tmachineName := machineUUID.String()\n\n\t\t\tginkgo.By(\"Create test machine with mock provider\")\n\t\t\terr = f.DevPodMachineCreate([]string{machineName})\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.By(\"Remove test machine\")\n\t\t\terr = f.DevPodMachineDelete([]string{machineName})\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/machine/delete.go",
    "content": "package machine\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod machine delete\", func() {\n\tginkgo.Context(\"testing machine\", ginkgo.Label(\"machine\"), ginkgo.Ordered, func() {\n\t\tctx := context.Background()\n\t\tinitialDir, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tginkgo.It(\"should delete a non-existing machine and get an error\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/machine/testdata\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that mock-provider is deleted\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"mock-provider\")\n\n\t\t\tginkgo.By(\"Add mock provider\")\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/mock-provider.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.By(\"Use mock provier\")\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"mock-provider\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tmachineUUID1, _ := uuid.NewRandom()\n\t\t\tmachineName1 := machineUUID1.String()\n\n\t\t\tmachineUUID2, _ := uuid.NewRandom()\n\t\t\tmachineName2 := machineUUID2.String()\n\n\t\t\tginkgo.By(\"Create test machine with mock provider\")\n\t\t\terr = f.DevPodMachineCreate([]string{machineName1})\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.By(\"Remove existing test machine\")\n\t\t\terr = f.DevPodMachineDelete([]string{machineName1})\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.By(\"Remove not existing test machine (should get an error)\")\n\t\t\terr = f.DevPodMachineDelete([]string{machineName2})\n\t\t\tframework.ExpectError(err)\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/machine/framework.go",
    "content": "package machine\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[machine] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/machine/testdata/mock-provider.yaml",
    "content": "name: mock-provider\nversion: 0.0.1\ndescription: |-\n  DevPod on docker\noptionGroups:\n  - options:\n      - AGENT_PATH\n      - INACTIVITY_TIMEOUT\n      - INJECT_DOCKER_CREDENTIALS\n      - INJECT_GIT_CREDENTIALS\n    name: \"Agent options\"\n    defaultVisible: false\noptions:\n  INACTIVITY_TIMEOUT:\n    description: \"If defined, will automatically stop the container after the inactivity period. Example: 10m\"\n  AGENT_PATH:\n    description: The path where to inject the DevPod agent to.\n    default: /opt/devpod/agent\n  INJECT_GIT_CREDENTIALS:\n    description: \"If DevPod should inject git credentials into the remote host.\"\n    default: \"true\"\n  INJECT_DOCKER_CREDENTIALS:\n    description: \"If DevPod should inject docker credentials into the remote host.\"\n    default: \"true\"\nagent:\n  inactivityTimeout: ${INACTIVITY_TIMEOUT}\n  injectGitCredentials: ${INJECT_GIT_CREDENTIALS}\n  injectDockerCredentials: ${INJECT_DOCKER_CREDENTIALS}\n  path: ${AGENT_PATH}\nexec:\n  init: docker ps -a\n  command: docker exec -ti ${MACHINE_ID} ${COMMAND}\n  create: |-\n    docker create --name ${MACHINE_ID} ubuntu:latest sleep infinity\n    docker start ${MACHINE_ID}\n  delete: docker rm --force ${MACHINE_ID}\n  start: docker start ${MACHINE_ID}\n  stop: docker stop ${MACHINE_ID}\n  status: |-\n    STATE=$(docker inspect ${MACHINE_ID} --format {{.State.Status}})\n    if [ ! -z \"${STATE}\" ] ; then\n      if [ \"${STATE}\" -eq \"running\" ]; then\n        echo RUNNING\n      elif [ \"${STATE}\" -eq \"stopped\" ]; then\n        echo STOPPED\n      elif [ \"${STATE}\" -eq \"exited\" ]; then\n        echo STOPPED\n      else\n        echo BUSY\n      fi\n    else\n      echo NOTFOUND\n    fi"
  },
  {
    "path": "e2e/tests/machineprovider/framework.go",
    "content": "package machineprovider\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[machineprovider] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/machineprovider/machineprovider.go",
    "content": "package machineprovider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod machine provider test suite\", func() {\n\tginkgo.Context(\"testing machine providers\", ginkgo.Label(\"machineprovider\"), ginkgo.Ordered, func() {\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"test start / stop / status\", func(ctx context.Context) {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// copy test dir\n\t\t\ttempDir, err := framework.CopyToTempDirWithoutChdir(initialDir + \"/tests/machineprovider/testdata/machineprovider\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\t_ = os.RemoveAll(tempDir)\n\t\t\t})\n\n\t\t\ttempDirLocation, err := os.MkdirTemp(\"\", \"\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\t_ = os.RemoveAll(tempDirLocation)\n\t\t\t})\n\n\t\t\t// create docker provider\n\t\t\terr = f.DevPodProviderAdd(ctx, filepath.Join(tempDir, \"provider.yaml\"), \"-o\", \"LOCATION=\"+tempDirLocation)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(context.Background(), \"docker123\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// expect workspace\n\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check status\n\t\t\tstatus, err := f.DevPodStatus(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(strings.ToUpper(status.State), \"RUNNING\", \"workspace status did not match\")\n\n\t\t\t// stop container\n\t\t\terr = f.DevPodStop(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check status\n\t\t\tstatus, err = f.DevPodStatus(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(strings.ToUpper(status.State), \"STOPPED\", \"workspace status did not match\")\n\n\t\t\t// wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if ssh works as it should start the container\n\t\t\tout, err := f.DevPodSSH(ctx, tempDir, fmt.Sprintf(\"cat /workspaces/%s/test.txt\", workspace.ID))\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, \"Test123\", \"workspace content does not match\")\n\n\t\t\t// delete workspace\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\tginkgo.It(\"test devpod inactivity timeout\", func(ctx context.Context) {\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// copy test dir\n\t\t\ttempDir, err := framework.CopyToTempDirWithoutChdir(initialDir + \"/tests/machineprovider/testdata/machineprovider2\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = os.RemoveAll(tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\ttempDirLocation, err := os.MkdirTemp(\"\", \"\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = os.RemoveAll(tempDirLocation)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\t// create provider\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker123\")\n\t\t\terr = f.DevPodProviderAdd(ctx, filepath.Join(tempDir, \"provider.yaml\"))\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(context.Background(), \"docker123\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\", \"--daemon-interval=3s\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\t// delete workspace\n\t\t\t\terr = f.DevPodWorkspaceDelete(context.Background(), tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\t// check status\n\t\t\tstatus, err := f.DevPodStatus(ctx, tempDir, \"--container-status=false\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(strings.ToUpper(status.State), \"RUNNING\", \"workspace status did not match\")\n\n\t\t\t// stop container\n\t\t\terr = f.DevPodStop(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check status\n\t\t\tstatus, err = f.DevPodStatus(ctx, tempDir, \"--container-status=false\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(strings.ToUpper(status.State), \"STOPPED\", \"workspace status did not match\")\n\n\t\t\t// wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, tempDir, \"--daemon-interval=3s\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check status\n\t\t\tstatus, err = f.DevPodStatus(ctx, tempDir, \"--container-status=false\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(strings.ToUpper(status.State), \"RUNNING\", \"workspace status did not match\")\n\n\t\t\t// wait until workspace is stopped again\n\t\t\tnow := time.Now()\n\t\t\tfor {\n\t\t\t\tstatus, err := f.DevPodStatus(ctx, tempDir, \"--container-status=false\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tframework.ExpectEqual(time.Since(now) < time.Minute*2, true, \"machine did not shutdown in time\")\n\t\t\t\tif status.State == \"Stopped\" {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\ttime.Sleep(time.Second * 2)\n\t\t\t}\n\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()*5))\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\"\n}"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider/provider.yaml",
    "content": "name: docker123\nversion: v0.0.1\ndescription: |-\n  DevPod on Docker\noptions:\n  LOCATION:\n    description: The location DevPod should use\nagent:\n  local: true\n  docker:\n    install: false\nexec:\n  create: |-\n    mkdir -p ${LOCATION}/${MACHINE_ID}\n    echo \"RUNNING\" > ${LOCATION}/${MACHINE_ID}/status.txt \n\n  delete: |-\n    rm -R ${LOCATION}/${MACHINE_ID}\n\n  start: |-\n    echo \"RUNNING\" > ${LOCATION}/${MACHINE_ID}/status.txt\n\n  stop: |-\n    echo \"STOPPED\" > ${LOCATION}/${MACHINE_ID}/status.txt \n\n  status: |-\n    cat ${LOCATION}/${MACHINE_ID}/status.txt 2>/dev/null || echo \"NOTFOUND\"\n\n  command: |-\n    \"${DEVPOD}\" helper sh -c \"${COMMAND}\"\n"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider/test.txt",
    "content": "Test123"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider2/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"ubuntu\"\n}"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider2/provider.yaml",
    "content": "name: docker123\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    description: The namespace to use\n    default: devpod-e2e\n  INACTIVITY_TIMEOUT:\n    description: The timeout until the pod will be stopped\n    default: 5s\nagent:\n  path: /usr/local/bin/devpod\n  inactivityTimeout: ${INACTIVITY_TIMEOUT}\n  exec:\n    shutdown: |-\n      kill 1\nexec:\n  command: |-\n    docker exec -i devpod-${MACHINE_ID} sh -c \"${COMMAND}\"\n  stop: |-\n    docker stop devpod-${MACHINE_ID}\n  start: |-\n    docker start devpod-${MACHINE_ID}\n    sleep 5\n  status: |-\n    STATUS=$(docker inspect devpod-${MACHINE_ID} 2>/dev/null | ${DEVPOD} helper json get \"[0].State.Status\" || true)\n    if [ -z $STATUS ]; then\n      echo \"NOTFOUND\"\n    else\n      if [ \"$STATUS\" = \"exited\" ]; then\n        echo \"STOPPED\"\n      elif [ \"$STATUS\" = \"running\" ]; then\n        echo \"RUNNING\"\n      else\n        echo \"BUSY\"\n      fi\n    fi\n  create: |-\n    docker run -d --privileged --name devpod-${MACHINE_ID} docker\n    docker exec devpod-${MACHINE_ID} mkdir /etc/init.d\n    sleep 5\n  delete: |-\n    docker stop devpod-${MACHINE_ID} && docker rm devpod-${MACHINE_ID}\n"
  },
  {
    "path": "e2e/tests/machineprovider/testdata/machineprovider2/test.txt",
    "content": "Test123"
  },
  {
    "path": "e2e/tests/provider/framework.go",
    "content": "package provider\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[provider] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/provider/provider.go",
    "content": "package provider\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod provider test suite\", func() {\n\tginkgo.Context(\"testing non-machine providers\", ginkgo.Label(\"provider\"), ginkgo.Ordered, func() {\n\t\tctx := context.Background()\n\t\tinitialDir, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tginkgo.It(\"should add simple provider and delete it\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/provider/testdata/simple-k8s-provider\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that provider 1 is deleted\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider1\", \"--ignore-not-found\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Add provider 1\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/provider1.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Ensure provider 1 exists but not provider X\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider1\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"providerX\")\n\t\t\tframework.ExpectError(err)\n\n\t\t\t// Cleanup: delete provider 1\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider1\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: ensure provider 1 is deleted\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider1\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\n\t\tginkgo.It(\"should add simple provider and update it\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/provider/testdata/simple-k8s-provider\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer framework.CleanupTempDir(initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that provider 2 is deleted\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider2\", \"--ignore-not-found\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Add provider 2 and use it\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/provider2.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider2\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Ensure provider 2 namespace parameter has the default value\n\t\t\tctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(30*time.Second))\n\t\t\terr = f.DevPodProviderOptionsCheckNamespaceDescription(ctx, \"provider2\", \"The namespace to use\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tcancel()\n\n\t\t\t// Update provider 2 (change the namespace description value)\n\t\t\terr = f.DevPodProviderUpdate(context.Background(), \"provider2\", tempDir+\"/provider2-update.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Ensure that provider 2 was updated\n\t\t\tctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(30*time.Second))\n\t\t\terr = f.DevPodProviderOptionsCheckNamespaceDescription(ctx, \"provider2\", \"Updated namespace parameter\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tcancel()\n\n\t\t\t// Cleanup: delete provider 2\n\t\t\terr = f.DevPodProviderDelete(context.Background(), \"provider2\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: ensure provider 2 is deleted\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider2\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\n\t\tginkgo.It(\"should list all providers\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/provider/testdata/simple-k8s-provider\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that provider 1 is deleted\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider1\", \"--ignore-not-found\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Add provider 1\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/provider1.yaml\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\t// Ensure provider 1 exists\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider1\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Add .DS_Store file to tempDir\n\t\t\terr = os.Mkdir(tempDir+\"/.DS_Store\", 0755)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// List providers\n\t\t\terr = f.DevPodProviderList(context.Background())\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: delete provider 1\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider1\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: ensure provider 1 is deleted\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider1\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\n\t\tginkgo.It(\"should parse options\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/provider/testdata/simple-k8s-provider\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// Ensure that provider is deleted\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider3\", \"--ignore-not-found\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tpodManifest := `\napiVersion: v1\nkind: Pod\nmetadata:\n\tname: test\nspec:\n\tcontainers:\n\t- name: devpod\n`\n\t\t\t// Add provider\n\t\t\terr = f.DevPodProviderAdd(ctx, tempDir+\"/provider3.yaml\", \"--option=TEMPLATE=\"+podManifest)\n\t\t\tframework.ExpectNoError(err)\n\t\t\t// Ensure provider exists\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider3\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// look for template option\n\t\t\terr = f.DevPodProviderFindOption(context.Background(), \"provider3\", podManifest)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: delete provider\n\t\t\terr = f.DevPodProviderDelete(ctx, \"provider3\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Cleanup: ensure provider is deleted\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"provider3\")\n\t\t\tframework.ExpectError(err)\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/provider/testdata/simple-k8s-provider/provider1.yaml",
    "content": "name: provider1\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    required: true\n    description: The namespace to use\n    command: |-\n      NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\n      if [ -z \"${NAMESPACE}\" ]; then\n        NAMESPACE=default\n      fi\n      echo $NAMESPACE\nagent:\n  path: /tmp/devpod\nexec:\n  command: |-\n    kubectl exec -n \"${NAMESPACE}\" -c devpod-container -i devpod-${MACHINE_ID} -- sh -c \"${COMMAND}\"\n  create: |-\n    kubectl create -n \"${NAMESPACE}\" -f - << EOF\n    apiVersion: v1\n    kind: Pod\n    metadata:\n      name: devpod-${MACHINE_ID}\n      labels:\n        app: devpod\n    spec:\n      volumes:\n        - name: devpod-storage\n          emptyDir: {}\n      containers:\n        - name: devpod-container\n          image: docker:dind\n          volumeMounts:\n          - mountPath: /var/lib/docker\n            name: devpod-storage\n            subPath: var/lib/docker\n          - mountPath: /root\n            name: devpod-storage\n            subPath: root\n          securityContext:\n            privileged: true\n    EOF\n  delete: |-\n    kubectl delete pod devpod-${MACHINE_ID} -n \"${NAMESPACE}\" || true\n"
  },
  {
    "path": "e2e/tests/provider/testdata/simple-k8s-provider/provider2-update.yaml",
    "content": "name: provider2\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    required: true\n    description: Updated namespace parameter description\n    command: |-\n      NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\n      if [ -z \"${NAMESPACE}\" ]; then\n        NAMESPACE=default\n      fi\n      echo $NAMESPACE\nagent:\n  path: /tmp/devpod\nexec:\n  command: |-\n    kubectl exec -n \"${NAMESPACE}\" -c devpod-container -i devpod-${MACHINE_ID} -- sh -c \"${COMMAND}\"\n  create: |-\n    kubectl create -n \"${NAMESPACE}\" -f - << EOF\n    apiVersion: v1\n    kind: Pod\n    metadata:\n      name: devpod-${MACHINE_ID}\n      labels:\n        app: devpod\n    spec:\n      volumes:\n        - name: devpod-storage\n          emptyDir: {}\n      containers:\n        - name: devpod-container\n          image: docker:dind\n          volumeMounts:\n          - mountPath: /var/lib/docker\n            name: devpod-storage\n            subPath: var/lib/docker\n          - mountPath: /root\n            name: devpod-storage\n            subPath: root\n          securityContext:\n            privileged: true\n    EOF\n  delete: |-\n    kubectl delete pod devpod-${MACHINE_ID} -n \"${NAMESPACE}\" || true\n"
  },
  {
    "path": "e2e/tests/provider/testdata/simple-k8s-provider/provider2.yaml",
    "content": "name: provider2\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    required: true\n    description: The namespace to use\n    command: |-\n      NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\n      if [ -z \"${NAMESPACE}\" ]; then\n        NAMESPACE=default\n      fi\n      echo $NAMESPACE\nagent:\n  path: /tmp/devpod\nexec:\n  command: |-\n    kubectl exec -n \"${NAMESPACE}\" -c devpod-container -i devpod-${MACHINE_ID} -- sh -c \"${COMMAND}\"\n  create: |-\n    kubectl create -n \"${NAMESPACE}\" -f - << EOF\n    apiVersion: v1\n    kind: Pod\n    metadata:\n      name: devpod-${MACHINE_ID}\n      labels:\n        app: devpod\n    spec:\n      volumes:\n        - name: devpod-storage\n          emptyDir: {}\n      containers:\n        - name: devpod-container\n          image: docker:dind\n          volumeMounts:\n          - mountPath: /var/lib/docker\n            name: devpod-storage\n            subPath: var/lib/docker\n          - mountPath: /root\n            name: devpod-storage\n            subPath: root\n          securityContext:\n            privileged: true\n    EOF\n  delete: |-\n    kubectl delete pod devpod-${MACHINE_ID} -n \"${NAMESPACE}\" || true\n"
  },
  {
    "path": "e2e/tests/provider/testdata/simple-k8s-provider/provider3.yaml",
    "content": "name: provider3\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    required: true\n    description: The namespace to use\n    command: |-\n      NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\n      if [ -z \"${NAMESPACE}\" ]; then\n        NAMESPACE=default\n      fi\n      echo $NAMESPACE\n  TEMPLATE:\n    required: true\n    type: multiline\nagent:\n  path: /tmp/devpod\nexec:\n  command: |-\n    kubectl exec -n \"${NAMESPACE}\" -c devpod-container -i devpod-${MACHINE_ID} -- sh -c \"${COMMAND}\"\n  create: |-\n    kubectl create -n \"${NAMESPACE}\" -f - << EOF\n    apiVersion: v1\n    kind: Pod\n    metadata:\n      name: devpod-${MACHINE_ID}\n      labels:\n        app: devpod\n    spec:\n      volumes:\n        - name: devpod-storage\n          emptyDir: {}\n      containers:\n        - name: devpod-container\n          image: docker:dind\n          volumeMounts:\n          - mountPath: /var/lib/docker\n            name: devpod-storage\n            subPath: var/lib/docker\n          - mountPath: /root\n            name: devpod-storage\n            subPath: root\n          securityContext:\n            privileged: true\n    EOF\n  delete: |-\n    kubectl delete pod devpod-${MACHINE_ID} -n \"${NAMESPACE}\" || true\n"
  },
  {
    "path": "e2e/tests/ssh/framework.go",
    "content": "package ssh\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[ssh] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/ssh/ssh.go",
    "content": "package ssh\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod ssh test suite\", func() {\n\tginkgo.Context(\"testing ssh command\", ginkgo.Label(\"ssh\"), ginkgo.Ordered, func() {\n\t\tctx := context.Background()\n\t\tinitialDir, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tginkgo.It(\"should start a new workspace with a docker provider (default) and ssh into it\", func() {\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/ssh/testdata/local-test\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer framework.CleanupTempDir(initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// Start up devpod workspace\n\t\t\tdevpodUpDeadline := time.Now().Add(5 * time.Minute)\n\t\t\tdevpodUpCtx, cancel := context.WithDeadline(context.Background(), devpodUpDeadline)\n\t\t\tdefer cancel()\n\t\t\terr = f.DevPodUp(devpodUpCtx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdevpodSSHDeadline := time.Now().Add(20 * time.Second)\n\t\t\tdevpodSSHCtx, cancelSSH := context.WithDeadline(context.Background(), devpodSSHDeadline)\n\t\t\tdefer cancelSSH()\n\t\t\terr = f.DevPodSSHEchoTestString(devpodSSHCtx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\t// ginkgo.It(\"should start a new workspace with a docker provider (default) and forward gpg agent into it\", func() {\n\t\t// \t// skip windows for now\n\t\t// \tif runtime.GOOS == \"windows\" {\n\t\t// \t\treturn\n\t\t// \t}\n\t\t//\n\t\t// \ttempDir, err := framework.CopyToTempDir(\"tests/ssh/testdata/gpg-forwarding\")\n\t\t// \tframework.ExpectNoError(err)\n\t\t// \tdefer framework.CleanupTempDir(initialDir, tempDir)\n\t\t//\n\t\t// \tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t// \t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t// \terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t// \tframework.ExpectNoError(err)\n\t\t//\n\t\t// \tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\t\t//\n\t\t// \tout, err := exec.Command(\"gpg\", \"-k\").Output()\n\t\t// \tif err != nil || len(out) == 0 {\n\t\t// \t\terr = f.SetupGPG(tempDir)\n\t\t// \t\tframework.ExpectNoError(err)\n\t\t// \t}\n\t\t//\n\t\t// \t// Start up devpod workspace\n\t\t// \tdevpodUpDeadline := time.Now().Add(5 * time.Minute)\n\t\t// \tdevpodUpCtx, cancel := context.WithDeadline(context.Background(), devpodUpDeadline)\n\t\t// \tdefer cancel()\n\t\t// \terr = f.DevPodUp(devpodUpCtx, tempDir, \"--gpg-agent-forwarding\")\n\t\t// \tframework.ExpectNoError(err)\n\t\t//\n\t\t// \tdevpodSSHDeadline := time.Now().Add(20 * time.Second)\n\t\t// \tdevpodSSHCtx, cancelSSH := context.WithDeadline(context.Background(), devpodSSHDeadline)\n\t\t// \tdefer cancelSSH()\n\t\t//\n\t\t// \t// GPG agent might be not ready, let's try 10 times, 1 second each\n\t\t// \tretries := 10\n\t\t// \tfor retries > 0 {\n\t\t// \t\terr = f.DevPodSSHGpgTestKey(devpodSSHCtx, tempDir)\n\t\t// \t\tif err != nil {\n\t\t// \t\t\tretries--\n\t\t// \t\t\ttime.Sleep(time.Second)\n\t\t// \t\t} else {\n\t\t// \t\t\tbreak\n\t\t// \t\t}\n\t\t// \t}\n\t\t// \tframework.ExpectNoError(err)\n\t\t// })\n\n\t\tginkgo.It(\"should start a new workspace with a docker provider (default) and forward a port into it\", func() {\n\t\t\t// skip windows for now\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/ssh/testdata/forward-test\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer framework.CleanupTempDir(initialDir, tempDir)\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t// Create a new random number generator with a custom seed (e.g., current time)\n\t\t\tsource := rand.NewSource(time.Now().UnixNano())\n\t\t\trng := rand.New(source)\n\n\t\t\t// Start up devpod workspace\n\t\t\tdevpodUpDeadline := time.Now().Add(5 * time.Minute)\n\t\t\tdevpodUpCtx, cancel := context.WithDeadline(context.Background(), devpodUpDeadline)\n\t\t\tdefer cancel()\n\t\t\terr = f.DevPodUp(devpodUpCtx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Generate a random number for the server port between 50000 and 51000\n\t\t\tport := rng.Intn(1000) + 50000\n\n\t\t\tfmt.Println(\"Running netcat server on port\", port)\n\n\t\t\tdevpodSSHDeadline := time.Now().Add(20 * time.Second)\n\t\t\tdevpodSSHCtx, cancelSSH := context.WithDeadline(context.Background(), devpodSSHDeadline)\n\t\t\tdefer cancelSSH()\n\n\t\t\tfmt.Println(\"Starting pong service\")\n\t\t\t// start a ping/pong service on the port\n\t\t\tcmd := exec.CommandContext(ctx, f.DevpodBinDir+\"/\"+f.DevpodBinName,\n\t\t\t\t[]string{\n\t\t\t\t\t\"ssh\", tempDir, \"--command\",\n\t\t\t\t\t\"sh -c \\\"while true; do echo PONG | nc -n -lk -p \" + strconv.Itoa(port) + \"; done\\\"\",\n\t\t\t\t}...,\n\t\t\t)\n\t\t\terr = cmd.Start()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tfmt.Println(\"Forwarding port\", port)\n\t\t\t// start ssh with port forwarding in background\n\t\t\tgo func() {\n\t\t\t\t_ = f.DevpodPortTest(devpodSSHCtx, strconv.Itoa(port), tempDir)\n\t\t\t}()\n\n\t\t\tfmt.Println(\"Waiting for port\", port, \"to be open\")\n\t\t\t// wait for port to be open\n\t\t\tretries := 5\n\t\t\tout := \"\"\n\t\t\taddress := net.JoinHostPort(\"localhost\", strconv.Itoa(port))\n\t\t\tfor retries > 0 {\n\t\t\t\tfmt.Println(\"retries left\", retries)\n\n\t\t\t\t// wait 3s between retries\n\t\t\t\ttime.Sleep(time.Second * 3)\n\n\t\t\t\tconn, err := net.Dial(\"tcp\", address)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Println(\"port still closed\")\n\t\t\t\t\tretries = retries - 1\n\t\t\t\t} else {\n\t\t\t\t\tif conn != nil {\n\t\t\t\t\t\tdefer conn.Close()\n\t\t\t\t\t\tfmt.Println(\"connecting to\", port)\n\n\t\t\t\t\t\tfmt.Println(\"sending PING\")\n\t\t\t\t\t\t_, err = conn.Write([]byte(\"PING\"))\n\t\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\t\tfmt.Println(\"waiting for response\")\n\t\t\t\t\t\tout, err = bufio.NewReader(conn).ReadString('\\n')\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tfmt.Println(\"invalid response\")\n\t\t\t\t\t\t\tretries = retries - 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfmt.Println(\"received\", out)\n\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(\"invalid connection\")\n\t\t\t\t\t\tretries = retries - 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tframework.ExpectNotEqual(retries, 0)\n\n\t\t\tfmt.Println(\"Verifying output match\")\n\t\t\tframework.ExpectEqual(out, \"PONG\\n\")\n\t\t\tfmt.Println(\"Success\")\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/ssh/testdata/forward-test/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"alpine:latest\",\n}\n"
  },
  {
    "path": "e2e/tests/ssh/testdata/gpg-forwarding/.devcontainer.json",
    "content": "{\"image\":\"mcr.microsoft.com/devcontainers/base:ubuntu\"}"
  },
  {
    "path": "e2e/tests/ssh/testdata/gpg-forwarding/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\",\n}"
  },
  {
    "path": "e2e/tests/ssh/testdata/gpg-forwarding/gpg-private.key",
    "content": "-----BEGIN PGP PRIVATE KEY BLOCK-----\n\nlFgEZTjL1BYJKwYBBAHaRw8BAQdAQoPc9KLpPyIwDwv4Cp7M8zl2QUqOBttpw/5s\nW597ruAAAQCHcDfUaL5nkrQLw8kTCeY+IvtEHMEj7OowYvwFY4Wacg9rtAZkZXZw\nb2SImQQTFgoAQRYhBAf2gbn9bDQR9nm/0fUXadtXLd0/BQJlOMvUAhsDBQkFo5qA\nBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEPUXadtXLd0/8JoBAPEh+P1T\nphQtC88guMbM+SYldPhkSRfBDGXhIOhvUzR1AQDPmz8M5D6JbROnXJf+qiyrAkXu\nhq/9E0oQhGgHgLZlDZxdBGU4y9QSCisGAQQBl1UBBQEBB0DT4TlQNUGYsBLxlF2i\n6IrGWf4Ro6P2qgj+qC7pcK8LCwMBCAcAAP9LWFcPdRBEcshDjwwf4K/IAYs1jCbR\nd3nesg3dti++mA9IiHgEGBYKACAWIQQH9oG5/Ww0EfZ5v9H1F2nbVy3dPwUCZTjL\n1AIbDAAKCRD1F2nbVy3dP5gjAP9aFsyVBpTuUZ9JFWlP5U4DSiBVt68tD859/n04\ne2bJ/gEAu0nMy9A04tO7UcsL++7XCqMBhSfP14xXZndSdHgRbg4=\n=GB0r\n-----END PGP PRIVATE KEY BLOCK-----\n"
  },
  {
    "path": "e2e/tests/ssh/testdata/gpg-forwarding/gpg-public.key",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmDMEZTjL1BYJKwYBBAHaRw8BAQdAQoPc9KLpPyIwDwv4Cp7M8zl2QUqOBttpw/5s\nW597ruC0BmRldnBvZIiZBBMWCgBBFiEEB/aBuf1sNBH2eb/R9Rdp21ct3T8FAmU4\ny9QCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQ9Rdp21ct\n3T/wmgEA8SH4/VOmFC0LzyC4xsz5JiV0+GRJF8EMZeEg6G9TNHUBAM+bPwzkPolt\nE6dcl/6qLKsCRe6Gr/0TShCEaAeAtmUNuDgEZTjL1BIKKwYBBAGXVQEFAQEHQNPh\nOVA1QZiwEvGUXaLoisZZ/hGjo/aqCP6oLulwrwsLAwEIB4h4BBgWCgAgFiEEB/aB\nuf1sNBH2eb/R9Rdp21ct3T8FAmU4y9QCGwwACgkQ9Rdp21ct3T+YIwD/WhbMlQaU\n7lGfSRVpT+VOA0ogVbevLQ/Off59OHtmyf4BALtJzMvQNOLTu1HLC/vu1wqjAYUn\nz9eMV2Z3UnR4EW4O\n=58pH\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "e2e/tests/ssh/testdata/local-test/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\",\n}"
  },
  {
    "path": "e2e/tests/up/docker-wsl.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/ghttp\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-docker-wsl\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = os.Setenv(\"DOCKER_HOST\", \"tcp://localhost:2375\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"with docker\", ginkgo.Ordered, func() {\n\t\t\tginkgo.It(\"should start a new workspace with existing image\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with existing running container\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/no-devcontainer\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\terr = dockerHelper.Run(ctx, []string{\"run\", \"-d\", \"--label\", \"devpod-e2e-test-container=true\", \"-w\", \"/workspaces/e2e\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\", \"sleep\", \"infinity\"}, nil, nil, nil)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\"devpod-e2e-test-container=true\",\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 container is created\")\n\t\t\t\tginkgo.DeferCleanup(dockerHelper.Remove, ids[0])\n\t\t\t\tginkgo.DeferCleanup(dockerHelper.Stop, ids[0])\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Config.WorkingDir).To(gomega.Equal(\"/workspaces/e2e\"))\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--source\", fmt.Sprintf(\"container:%s\", containerDetail.ID))\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace and substitute devcontainer.json variables\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-variables\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tprojectName := workspace.ID\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tdevContainerID, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/dev-container-id.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(devContainerID).NotTo(gomega.BeEmpty())\n\n\t\t\t\tcontainerEnvPath, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-env-path.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerEnvPath).To(gomega.ContainSubstring(\"/usr/local/bin\"))\n\n\t\t\t\tlocalEnvHome, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-env-home.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localEnvHome).To(gomega.Equal(os.Getenv(\"HOME\")))\n\n\t\t\t\tlocalWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(framework.CleanString(localWorkspaceFolder)).To(gomega.Equal(framework.CleanString(tempDir)))\n\n\t\t\t\tlocalWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localWorkspaceFolderBasename).To(gomega.Equal(filepath.Base(tempDir)))\n\n\t\t\t\tcontainerWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(framework.CleanString(containerWorkspaceFolder)).To(gomega.Equal(\n\t\t\t\t\tframework.CleanString(\"workspaces\" + filepath.Base(tempDir)),\n\t\t\t\t))\n\n\t\t\t\tcontainerWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerWorkspaceFolderBasename).To(gomega.Equal(filepath.Base(tempDir)))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with mounts\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-mounts\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tfoo, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt1/foo.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(foo).To(gomega.Equal(\"BAR\"))\n\n\t\t\t\tbar, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt2/bar.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(bar).To(gomega.Equal(\"FOO\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.Context(\"should start a new workspace with features\", func() {\n\t\t\t\tginkgo.It(\"ensure dependencies installed via features are accessible in lifecycle hooks\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-features-lifecycle-hooks\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls ~/.file*\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := `/home/vscode/.file1\n/home/vscode/.file2\n/home/vscode/.file3\n`\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - install script\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles\", \"--dotfiles-script\", \"install-example\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls /tmp/worked\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"/tmp/worked\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script, commit\", func(ctx context.Context) {\n\t\t\t\t// need to debug\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles@sha256:9a0b41808bf8f50e9871b3b5c9280fe22bf46a04\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls ~/.file*\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := `/home/vscode/.file1\n/home/vscode/.file2\n/home/vscode/.file3\n`\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script, branch\", func(ctx context.Context) {\n\t\t\t\t// need to debug\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles@do-not-delete\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"cat ~/.branch_test\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"test\\n\"\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with custom image\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--devcontainer-image\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"grep ^ID= /etc/os-release\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"ID=alpine\\n\"\n\t\t\t\tunexpectedOutput := \"ID=debian\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t\tframework.ExpectNotEqual(out, unexpectedOutput, \"should NOT match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with custom image and skip building\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-with-multi-stage-build\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--devcontainer-image\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"grep ^ID= /etc/os-release\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"ID=alpine\\n\"\n\t\t\t\tunexpectedOutput := \"ID=debian\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t\tframework.ExpectNotEqual(out, unexpectedOutput, \"should NOT match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should use http headers to download feature\", func(ctx context.Context) {\n\t\t\t\tserver := ghttp.NewServer()\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-features-http-headers\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tfeatureArchiveFilePath := path.Join(tempDir, \"devcontainer-feature-hello.tgz\")\n\t\t\t\tfeatureFiles := []string{path.Join(tempDir, \"devcontainer-feature.json\"), path.Join(tempDir, \"install.sh\")}\n\t\t\t\terr = createTarGzArchive(featureArchiveFilePath, featureFiles)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tdevContainerFileBuf, err := os.ReadFile(path.Join(tempDir, \".devcontainer.json\"))\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\toutput := strings.Replace(string(devContainerFileBuf), \"#{server_url}\", server.URL(), -1)\n\t\t\t\terr = os.WriteFile(path.Join(tempDir, \".devcontainer.json\"), []byte(output), 0644)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\t\t\t\tginkgo.DeferCleanup(server.Close)\n\n\t\t\t\trespHeader := http.Header{}\n\t\t\t\trespHeader.Set(\"Content-Disposition\", \"attachment; filename=devcontainer-feature-hello.tgz\")\n\n\t\t\t\tfeatureArchiveFileBuf, err := os.ReadFile(featureArchiveFilePath)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\tserver.AppendHandlers(\n\t\t\t\t\tghttp.CombineHandlers(\n\t\t\t\t\t\tghttp.VerifyRequest(\"GET\", \"/devcontainer-feature-hello.tgz\"),\n\t\t\t\t\t\tghttp.VerifyHeaderKV(\"Foo-Header\", \"Foo\"),\n\t\t\t\t\t\tghttp.RespondWith(http.StatusOK, featureArchiveFileBuf, respHeader),\n\t\t\t\t\t),\n\t\t\t\t)\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tserver.Close()\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/docker.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/ghttp\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-docker\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"with docker\", ginkgo.Ordered, func() {\n\t\t\tginkgo.It(\"should start a new workspace with existing image\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with existing running container\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/no-devcontainer\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\terr = dockerHelper.Run(ctx, []string{\"run\", \"-d\", \"--label\", \"devpod-e2e-test-container=true\", \"-w\", \"/workspaces/e2e\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\", \"sleep\", \"infinity\"}, nil, nil, nil)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\"devpod-e2e-test-container=true\",\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 container is created\")\n\t\t\t\tginkgo.DeferCleanup(dockerHelper.Remove, ids[0])\n\t\t\t\tginkgo.DeferCleanup(dockerHelper.Stop, ids[0])\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Config.WorkingDir).To(gomega.Equal(\"/workspaces/e2e\"))\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--source\", fmt.Sprintf(\"container:%s\", containerDetail.ID))\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace and substitute devcontainer.json variables\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-variables\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tprojectName := workspace.ID\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tdevContainerID, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/dev-container-id.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(devContainerID).NotTo(gomega.BeEmpty())\n\n\t\t\t\tcontainerEnvPath, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-env-path.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerEnvPath).To(gomega.ContainSubstring(\"/usr/local/bin\"))\n\n\t\t\t\tlocalEnvHome, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-env-home.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localEnvHome).To(gomega.Equal(os.Getenv(\"HOME\")))\n\n\t\t\t\tlocalWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(framework.CleanString(localWorkspaceFolder)).To(gomega.Equal(framework.CleanString(tempDir)))\n\n\t\t\t\tlocalWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localWorkspaceFolderBasename).To(gomega.Equal(filepath.Base(tempDir)))\n\n\t\t\t\tcontainerWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(framework.CleanString(containerWorkspaceFolder)).To(gomega.Equal(\n\t\t\t\t\tframework.CleanString(\"workspaces\" + filepath.Base(tempDir)),\n\t\t\t\t))\n\n\t\t\t\tcontainerWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerWorkspaceFolderBasename).To(gomega.Equal(filepath.Base(tempDir)))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with mounts\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-mounts\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tfoo, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt1/foo.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(foo).To(gomega.Equal(\"BAR\"))\n\n\t\t\t\tbar, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt2/bar.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(bar).To(gomega.Equal(\"FOO\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.Context(\"should start a new workspace with features\", func() {\n\t\t\t\tginkgo.It(\"ensure dependencies installed via features are accessible in lifecycle hooks\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-features-lifecycle-hooks\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls ~/.file*\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := `/home/vscode/.file1\n/home/vscode/.file2\n/home/vscode/.file3\n`\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - install script\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles\", \"--dotfiles-script\", \"install-example\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls /tmp/worked\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"/tmp/worked\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script, commit\", func(ctx context.Context) {\n\t\t\t\t// need to debug\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles@sha256:9a0b41808bf8f50e9871b3b5c9280fe22bf46a04\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"ls ~/.file*\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := `/home/vscode/.file1\n/home/vscode/.file2\n/home/vscode/.file3\n`\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"should start a new workspace with dotfiles - no install script, branch\", func(ctx context.Context) {\n\t\t\t\t// need to debug\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--dotfiles\", \"https://github.com/loft-sh/example-dotfiles@do-not-delete\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"cat ~/.branch_test\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"test\\n\"\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with custom image\", func(ctx context.Context) {\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--devcontainer-image\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"grep ^ID= /etc/os-release\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"ID=alpine\\n\"\n\t\t\t\tunexpectedOutput := \"ID=debian\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t\tframework.ExpectNotEqual(out, unexpectedOutput, \"should NOT match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with custom image and skip building\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-with-multi-stage-build\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--devcontainer-image\", \"mcr.microsoft.com/vscode/devcontainers/base:alpine\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tout, err := f.DevPodSSH(ctx, tempDir, \"grep ^ID= /etc/os-release\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\texpectedOutput := \"ID=alpine\\n\"\n\t\t\t\tunexpectedOutput := \"ID=debian\\n\"\n\n\t\t\t\tframework.ExpectEqual(out, expectedOutput, \"should match\")\n\t\t\t\tframework.ExpectNotEqual(out, unexpectedOutput, \"should NOT match\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should use http headers to download feature\", func(ctx context.Context) {\n\t\t\t\tserver := ghttp.NewServer()\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-features-http-headers\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tfeatureArchiveFilePath := path.Join(tempDir, \"devcontainer-feature-hello.tgz\")\n\t\t\t\tfeatureFiles := []string{path.Join(tempDir, \"devcontainer-feature.json\"), path.Join(tempDir, \"install.sh\")}\n\t\t\t\terr = createTarGzArchive(featureArchiveFilePath, featureFiles)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tdevContainerFileBuf, err := os.ReadFile(path.Join(tempDir, \".devcontainer.json\"))\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\toutput := strings.Replace(string(devContainerFileBuf), \"#{server_url}\", server.URL(), -1)\n\t\t\t\terr = os.WriteFile(path.Join(tempDir, \".devcontainer.json\"), []byte(output), 0644)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\t\t\t\tginkgo.DeferCleanup(server.Close)\n\n\t\t\t\trespHeader := http.Header{}\n\t\t\t\trespHeader.Set(\"Content-Disposition\", \"attachment; filename=devcontainer-feature-hello.tgz\")\n\n\t\t\t\tfeatureArchiveFileBuf, err := os.ReadFile(featureArchiveFilePath)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\tserver.AppendHandlers(\n\t\t\t\t\tghttp.CombineHandlers(\n\t\t\t\t\t\tghttp.VerifyRequest(\"GET\", \"/devcontainer-feature-hello.tgz\"),\n\t\t\t\t\t\tghttp.VerifyHeaderKV(\"Foo-Header\", \"Foo\"),\n\t\t\t\t\t\tghttp.RespondWith(http.StatusOK, featureArchiveFileBuf, respHeader),\n\t\t\t\t\t),\n\t\t\t\t)\n\n\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tserver.Close()\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/docker_build.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-docker-build\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\t\tginkgo.Context(\"with docker\", ginkgo.Ordered, func() {\n\t\t\tginkgo.It(\"should start a new workspace with multistage build\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-with-multi-stage-build\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()*3))\n\t\t\tginkgo.Context(\"should start a workspace from a Dockerfile build\", func() {\n\t\t\t\tginkgo.It(\"should rebuild image in case of changes in files in build context\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-dockerfile-buildcontext\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tcontainer, err := dockerHelper.FindDevContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\timage1 := container.Config.LegacyImage\n\n\t\t\t\t\tscriptFile, err := os.OpenFile(tempDir+\"/scripts/alias.sh\",\n\t\t\t\t\t\tos.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tdefer scriptFile.Close()\n\n\t\t\t\t\tginkgo.By(\"Changing a file within the context\")\n\t\t\t\t\t_, err = scriptFile.Write([]byte(\"alias yr='date +%Y'\"))\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod again with --recreate\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\", \"--recreate\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tcontainer, err = dockerHelper.FindDevContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\timage2 := container.Config.LegacyImage\n\n\t\t\t\t\tgomega.Expect(image2).ShouldNot(gomega.Equal(image1), \"images should be different\")\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t\tginkgo.It(\"should not rebuild image for changes in files mentioned in .dockerignore\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-dockerfile-buildcontext\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tcontainer, err := dockerHelper.FindDevContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\timage1 := container.Config.LegacyImage\n\n\t\t\t\t\tscriptFile, err := os.OpenFile(tempDir+\"/scripts/install.sh\",\n\t\t\t\t\t\tos.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tdefer scriptFile.Close()\n\n\t\t\t\t\tginkgo.By(\"Changing a file within context\")\n\t\t\t\t\t_, err = scriptFile.Write([]byte(\"apt install python\"))\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod again with --recreate\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\", \"--recreate\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tcontainer, err = dockerHelper.FindDevContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\timage2 := container.Config.LegacyImage\n\n\t\t\t\t\tgomega.Expect(image2).Should(gomega.Equal(image1), \"image should be same\")\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/docker_compose.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-docker-compose\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar composeHelper *compose.ComposeHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tcomposeHelper, err = compose.NewComposeHelper(\"\", dockerHelper)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"with docker-compose\", func() {\n\t\t\tginkgo.It(\"should start a new workspace with root folder configuration\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Mounts).To(gomega.HaveLen(1), \"1 container volume mount\")\n\n\t\t\t\tmount := containerDetail.Mounts[0]\n\t\t\t\tgomega.Expect(mount.Source).To(gomega.Equal(tempDir))\n\t\t\t\tgomega.Expect(mount.Destination).To(gomega.Equal(\"/workspaces\"))\n\t\t\t\tgomega.Expect(mount.RW).To(gomega.BeTrue())\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with sub-folder configuration\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-subfolder\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Mounts).To(gomega.HaveLen(1), \"1 container volume mount\")\n\n\t\t\t\tmount := containerDetail.Mounts[0]\n\t\t\t\tgomega.Expect(mount.Source).To(gomega.Equal(tempDir))\n\t\t\t\tgomega.Expect(mount.Destination).To(gomega.Equal(\"/workspaces\"))\n\t\t\t\tgomega.Expect(mount.RW).To(gomega.BeTrue())\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with multiple services\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-multiple-services\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := composeHelper.GetProjectName(workspace.UID)\n\n\t\t\t\tappIDs, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, projectName),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(appIDs).To(gomega.HaveLen(1), \"app container to be created\")\n\n\t\t\t\tdbIDs, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, projectName),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"db\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(dbIDs).To(gomega.HaveLen(1), \"db container to be created\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with specific services\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-run-services\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := composeHelper.GetProjectName(workspace.UID)\n\n\t\t\t\tappIDs, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, projectName),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(appIDs).To(gomega.HaveLen(1), \"app container to be created\")\n\n\t\t\t\tdbIDs, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, projectName),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"db\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(dbIDs).To(gomega.BeEmpty(), \"db container not to be created\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with .devcontainer docker-compose overrides\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-overrides\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := composeHelper.GetProjectName(workspace.UID)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, projectName),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Mounts).To(gomega.HaveLen(1), \"1 container volume mount\")\n\n\t\t\t\tmount := containerDetail.Mounts[0]\n\t\t\t\tgomega.Expect(mount.Source).To(gomega.Equal(tempDir))\n\t\t\t\tgomega.Expect(mount.Destination).To(gomega.Equal(\"/workspaces\"))\n\t\t\t\tgomega.Expect(mount.RW).To(gomega.BeTrue())\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with container environment variables set\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-container-env\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\terr = f.ExecCommand(ctx, true, true, \"BAR\", []string{\"ssh\", \"--command\", \"echo $FOO\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with container user\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-container-user\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\terr = f.ExecCommand(ctx, true, true, \"root\", []string{\"ssh\", \"--command\", \"ps u -p 1\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with privileged\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-privileged\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.HostConfig.Privileged).To(gomega.BeTrue(), \"container run with privileged true\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with capAdd\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-capadd\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.HostConfig.CapAdd).To(gomega.ContainElement(\"SYS_PTRACE\"), \"image capabilities are not duplicated\")\n\t\t\t\tgomega.Expect(containerDetail.HostConfig.CapAdd).To(gomega.ContainElement(\"NET_ADMIN\"), \"devcontainer configuration can add capabilities\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with securityOpt\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-securityOpt\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.HostConfig.SecurityOpt).To(gomega.ContainElement(\"seccomp=unconfined\"), \"securityOpts contain seccomp=unconfined\")\n\t\t\t\tgomega.Expect(containerDetail.HostConfig.SecurityOpt).To(gomega.ContainElement(\"apparmor=unconfined\"), \"securityOpts contain apparmor=unconfined\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with override command\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-override-command\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvar containerDetails []types.ContainerJSON\n\t\t\t\terr = dockerHelper.Inspect(ctx, ids, \"container\", &containerDetails)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tcontainerDetail := containerDetails[0]\n\t\t\t\tgomega.Expect(containerDetail.Config.Entrypoint).NotTo(gomega.ContainElement(\"bash\"), \"overrides container entry point\")\n\t\t\t\tgomega.Expect(containerDetail.Config.Cmd).To(gomega.BeEmpty(), \"overrides container command\")\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with remote env\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-remote-env\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\terr = f.ExecCommand(ctx, true, true, \"/home/vscode/remote-env.out\", []string{\"ssh\", \"--command\", \"ls $HOME/remote-env.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\terr = f.ExecCommand(ctx, true, true, \"BAR\", []string{\"ssh\", \"--command\", \"cat $HOME/remote-env.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with remote user\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-remote-user\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\terr = f.ExecCommand(ctx, true, true, \"root\", []string{\"ssh\", \"--command\", \"cat $HOME/remote-user.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace and substitute devcontainer.json variables\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-variables\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tdevContainerID, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/dev-container-id.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(devContainerID).NotTo(gomega.BeEmpty())\n\n\t\t\t\tcontainerEnvPath, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-env-path.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerEnvPath).To(gomega.ContainSubstring(\"/usr/local/bin\"))\n\n\t\t\t\tlocalEnvHome, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-env-home.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localEnvHome).To(gomega.Equal(os.Getenv(\"HOME\")))\n\n\t\t\t\tlocalWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(framework.CleanString(localWorkspaceFolder)).To(gomega.Equal(framework.CleanString(tempDir)))\n\n\t\t\t\tlocalWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/local-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(localWorkspaceFolderBasename).To(gomega.Equal(filepath.Base(tempDir)))\n\n\t\t\t\tcontainerWorkspaceFolder, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerWorkspaceFolder).To(gomega.Equal(\"/workspaces\"))\n\n\t\t\t\tcontainerWorkspaceFolderBasename, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/container-workspace-folder-basename.out\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(containerWorkspaceFolderBasename).To(gomega.Equal(\"workspaces\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with mounts\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-mounts\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t// Check for docker-compose container running\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\t_, _, err = f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"touch /home/vscode/mnt1/foo.txt\", projectName, \"--user\", \"root\"})\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t_, _, err = f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"echo -n BAR > /home/vscode/mnt1/foo.txt\", projectName, \"--user\", \"root\"})\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tfoo, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt1/foo.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(foo).To(gomega.Equal(\"BAR\"))\n\n\t\t\t\tbar, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/mnt2/bar.txt\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(bar).To(gomega.Equal(\"FOO\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with host:port forwardPorts\", func(ctx context.Context) {\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-forward-ports\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t// Check for docker-compose container running\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tdone := make(chan error)\n\n\t\t\t\tsshContext, sshCancel := context.WithCancel(context.Background())\n\t\t\t\tgo func() {\n\t\t\t\t\tcmd := exec.CommandContext(sshContext, filepath.Join(f.DevpodBinDir, f.DevpodBinName), \"ssh\", projectName, \"--command\", \"sleep 30\")\n\n\t\t\t\t\tif err := cmd.Start(); err != nil {\n\t\t\t\t\t\tdone <- err\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif err := cmd.Wait(); err != nil {\n\t\t\t\t\t\tdone <- err\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tdone <- nil\n\t\t\t\t}()\n\n\t\t\t\tgomega.Eventually(func(g gomega.Gomega) {\n\t\t\t\t\tresponse, err := http.Get(\"http://localhost:8080\")\n\t\t\t\t\tg.Expect(err).NotTo(gomega.HaveOccurred())\n\n\t\t\t\t\tbody, err := io.ReadAll(response.Body)\n\t\t\t\t\tg.Expect(err).NotTo(gomega.HaveOccurred())\n\t\t\t\t\tg.Expect(body).To(gomega.ContainSubstring(\"Thank you for using nginx.\"))\n\t\t\t\t}).\n\t\t\t\t\tWithPolling(1 * time.Second).\n\t\t\t\t\tWithTimeout(20 * time.Second).\n\t\t\t\t\tShould(gomega.Succeed())\n\n\t\t\t\tsshCancel()\n\t\t\t\terr = <-done\n\n\t\t\t\t// skip windows for now\n\t\t\t\tif runtime.GOOS != \"windows\" {\n\t\t\t\t\tgomega.Expect(err).To(gomega.Or(\n\t\t\t\t\t\tgomega.MatchError(\"signal: killed\"),\n\t\t\t\t\t\tgomega.MatchError(context.Canceled),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with features\", func(ctx context.Context) {\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t\t}\n\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-features\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\tvclusterVersionOutput, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"vcluster --version\", projectName})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(vclusterVersionOutput).To(gomega.ContainSubstring(\"vcluster version 0.24.1\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should start a new workspace with env-file\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-env-file\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\tdevPodUpOutput, _, err := f.ExecCommandCapture(ctx, []string{\"up\", \"--debug\", \"--ide\", \"none\", tempDir})\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\t\t\t\tgomega.Expect(devPodUpOutput).NotTo(gomega.ContainSubstring(\"Defaulting to a blank string.\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.It(\"should restart a workspace\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-env-file\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\tdevPodUpOutput, _, err := f.ExecCommandCapture(ctx, []string{\"up\", \"--debug\", \"--ide\", \"none\", tempDir})\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t})\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\t\t\t\tgomega.Expect(devPodUpOutput).NotTo(gomega.ContainSubstring(\"Defaulting to a blank string.\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\tginkgo.Context(\"with lifecycle commands\", func() {\n\t\t\t\tginkgo.It(\"should start a new workspace and execute array based lifecycle commands\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-lifecycle-array\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tprojectName := workspace.ID\n\n\t\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\t\tinitializeCommand, err := os.ReadFile(filepath.Join(tempDir, \"initialize-command.out\"))\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(initializeCommand).To(gomega.ContainSubstring(\"initializeCommand\"))\n\n\t\t\t\t\tonCreateCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/on-create-command.out\", projectName})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(onCreateCommand).To(gomega.ContainSubstring(\"onCreateCommand\"))\n\n\t\t\t\t\tupdateContentCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/update-content-command.out\", projectName})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(updateContentCommand).To(gomega.Equal(\"updateContentCommand\"))\n\n\t\t\t\t\tpostCreateCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-create-command.out\", projectName})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(postCreateCommand).To(gomega.Equal(\"postCreateCommand\"))\n\n\t\t\t\t\tpostStartCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-start-command.out\", projectName})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(postStartCommand).To(gomega.Equal(\"postStartCommand\"))\n\n\t\t\t\t\tpostAttachCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-attach-command.out\", projectName})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(postAttachCommand).To(gomega.Equal(\"postAttachCommand\"))\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\t\t//ginkgo.FIt(\"should start a new workspace and execute object based lifecycle commands\", func(ctx context.Context) {\n\t\t\t\t//\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-lifecycle-object\")\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\t\t\t\t//\n\t\t\t\t//\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t//\t_ = f.DevPodProviderAdd(ctx, \"docker\"})\n\t\t\t\t//\terr = f.DevPodProviderUse(context.Background(), \"docker\")\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\n\t\t\t\t//\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\n\t\t\t\t//\t// Check for docker-compose container running\n\t\t\t\t//\tprojectName := composeHelper.ToProjectName(filepath.Base(tempDir))\n\t\t\t\t//\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), projectName)\n\t\t\t\t//\n\t\t\t\t//\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t//\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t//\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t//\t})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\t\t\t\t//\n\t\t\t\t//\tinitializeCommand, err := os.ReadFile(filepath.Join(tempDir, \"initialize-command.out\"))\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(initializeCommand).To(gomega.ContainSubstring(\"initializeCommand\"))\n\t\t\t\t//\n\t\t\t\t//\tonCreateCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/on-create-command.out\", projectName})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(onCreateCommand).To(gomega.ContainSubstring(\"onCreateCommand\"))\n\t\t\t\t//\n\t\t\t\t//\tupdateContentCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/update-content-command.out\", projectName})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(updateContentCommand).To(gomega.Equal(\"updateContentCommand\"))\n\t\t\t\t//\n\t\t\t\t//\tpostCreateCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-create-command.out\", projectName})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(postCreateCommand).To(gomega.Equal(\"postCreateCommand\"))\n\t\t\t\t//\n\t\t\t\t//\tpostStartCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-start-command.out\", projectName})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(postStartCommand).To(gomega.Equal(\"postStartCommand\"))\n\t\t\t\t//\n\t\t\t\t//\tpostAttachCommand, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat $HOME/post-attach-command.out\", projectName})\n\t\t\t\t//\tframework.ExpectNoError(err)\n\t\t\t\t//\tgomega.Expect(postAttachCommand).To(gomega.Equal(\"postAttachCommand\"))\n\t\t\t\t//}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/docker_compose_build.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-docker-compose-build\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar composeHelper *compose.ComposeHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tcomposeHelper, err = compose.NewComposeHelper(\"\", dockerHelper)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"with docker-compose\", func() {\n\t\t\tginkgo.It(\"should start a new workspace with multistage build\", func(ctx context.Context) {\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-with-multi-stage-build\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()*3))\n\n\t\t\tginkgo.Context(\"with --recreate\", func() {\n\t\t\t\tginkgo.It(\"should NOT delete container when rebuild fails\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-rebuild-fail\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Should start a docker-compose container\")\n\t\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\t\tginkgo.By(\"Modifying .devcontainer.json with failing changes\")\n\t\t\t\t\torigPath := filepath.Join(tempDir, \".devcontainer.json\")\n\t\t\t\t\terr = os.Remove(origPath)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tfailingConfig, err := os.Open(filepath.Join(tempDir, \"fail.devcontainer.json\"))\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tnewConfig, err := os.Create(origPath)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\t_, err = io.Copy(newConfig, failingConfig)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod again with --recreate\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\", \"--recreate\")\n\t\t\t\t\tframework.ExpectError(err)\n\n\t\t\t\t\tginkgo.By(\"Should leave original container running\")\n\t\t\t\t\tids2, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(ids2[0]).To(gomega.Equal(ids[0]), \"Should use original container\")\n\t\t\t\t})\n\n\t\t\t\tginkgo.It(\"should delete container upon successful rebuild\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker-compose-rebuild-success\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Should start a docker-compose container\")\n\t\t\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\t\t\tginkgo.By(\"Starting DevPod again with --recreate\")\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir, \"--debug\", \"--recreate\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.By(\"Should start a new docker-compose container on rebuild\")\n\t\t\t\t\tids2, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ProjectLabel, composeHelper.GetProjectName(workspace.UID)),\n\t\t\t\t\t\tfmt.Sprintf(\"%s=%s\", compose.ServiceLabel, \"app\"),\n\t\t\t\t\t})\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tgomega.Expect(ids2[0]).NotTo(gomega.Equal(ids[0]), \"Should restart container\")\n\t\t\t\t})\n\n\t\t\t})\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/framework.go",
    "content": "package up\n\nimport \"github.com/onsi/ginkgo/v2\"\n\n// DevPodDescribe annotates the test with the label.\nfunc DevPodDescribe(text string, body func()) bool {\n\treturn ginkgo.Describe(\"[up] \"+text, body)\n}\n"
  },
  {
    "path": "e2e/tests/up/helper.go",
    "content": "package up\n\nimport (\n\t\"archive/tar\"\n\t\"compress/gzip\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n)\n\nfunc findMessage(reader io.Reader, message string) error {\n\tscan := scanner.NewScanner(reader)\n\tfor scan.Scan() {\n\t\tline := scan.Bytes()\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tlineObject := &log.Line{}\n\t\terr := json.Unmarshal(line, lineObject)\n\t\tif err == nil && strings.Contains(lineObject.Message, message) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"couldn't find message '%s' in log\", message)\n}\n\nfunc verifyLogStream(reader io.Reader) error {\n\tscan := scanner.NewScanner(reader)\n\tfor scan.Scan() {\n\t\tline := scan.Bytes()\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tlineObject := &log.Line{}\n\t\terr := json.Unmarshal(line, lineObject)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading line %s: %w\", string(line), err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc createTarGzArchive(outputFilePath string, filePaths []string) error {\n\toutputFile, err := os.Create(outputFilePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer outputFile.Close()\n\n\tgzipWriter := gzip.NewWriter(outputFile)\n\tdefer gzipWriter.Close()\n\n\ttarWriter := tar.NewWriter(gzipWriter)\n\tdefer gzipWriter.Close()\n\n\tfor _, filePath := range filePaths {\n\t\tfile, err := os.Open(filePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\n\t\tfileInfo, err := file.Stat()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfileInfoHdr, err := tar.FileInfoHeader(fileInfo, fileInfo.Name())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = tarWriter.WriteHeader(fileInfoHdr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = io.Copy(tarWriter, file)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "e2e/tests/up/podman.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/onsi/ginkgo/v2\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up-podman\"), ginkgo.Ordered, func() {\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"using docker provider\", func() {\n\t\t\tginkgo.Context(\"with rootfull podman\", ginkgo.Ordered, func() {\n\t\t\t\tginkgo.It(\"should setup rootful podman\", func(ctx context.Context) {\n\t\t\t\t\twrapper, err := os.Create(initialDir + \"/bin/podman-rootful\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tdefer wrapper.Close()\n\n\t\t\t\t\t_, err = wrapper.WriteString(`#!/bin/sh\n\t\t\t\tsudo podman \"$@\"\n\t\t\t\t`)\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\terr = wrapper.Close()\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tcmd := exec.Command(\"sudo\", \"chmod\", \"+x\", initialDir+\"/bin/podman-rootful\")\n\t\t\t\t\terr = cmd.Run()\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\terr = exec.Command(initialDir+\"/bin/podman-rootful\", \"ps\").Run()\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\n\t\t\t\tginkgo.It(\"should start a new workspace with existing image\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\", \"-o\", \"DOCKER_PATH=\"+initialDir+\"/bin/podman-rootful\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t\tginkgo.Context(\"with rootless podman\", ginkgo.Ordered, func() {\n\t\t\t\tginkgo.It(\"should start a new workspace with existing image\", func(ctx context.Context) {\n\t\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\", \"-o\", \"DOCKER_PATH=podman\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), tempDir)\n\n\t\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\t})\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-capadd/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"capAdd\": [\n\t\t\"SYS_PTRACE\",\n\t\t\"NET_ADMIN\"\n \t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-capadd/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-container-env/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"containerEnv\": {\n\t\t\"FOO\": \"BAR\"\n\t}\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-container-env/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-container-user/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"containerUser\": \"root\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-container-user/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-env-file/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"../docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-env-file/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:${TAG}\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-extensions/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"../docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"customizations\": {\n\t\t\"vscode\": {\n\t\t\t\"settings\": {},\n\t\t\t\"extensions\": [\n\t\t\t\t\"streetsidesoftware.code-spell-checker\"\n\t\t\t]\n\t\t}\n\t}\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-extensions/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-features/.devcontainer.json",
    "content": "{\n  \"name\": \"Go\",\n  \"dockerComposeFile\": \"./docker-compose.yaml\",\n  \"service\": \"app\",\n  \"workspaceFolder\": \"/workspaces\",\n  \"features\": {\n    \"ghcr.io/loft-sh/devcontainer-features/vcluster:1.0.1\": {\n      \"version\": \"v0.24.1\"\n    }\n  }\n}\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-features/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-forward-ports/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"runServices\": [\"nginx\"],\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"forwardPorts\": [\n\t\t4000,\n\t\t\"3000\",\n\t\t\"nginx:8080\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-forward-ports/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached\n  nginx:\n    image: nginxinc/nginx-unprivileged"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-lifecycle-array/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"initializeCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"initializeCommand\\\" > ./initialize-command.out\"\n\t],\n\t\"onCreateCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"onCreateCommand\\\" > $HOME/on-create-command.out\"\n\t],\n\t\"updateContentCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"updateContentCommand\\\" > $HOME/update-content-command.out\"\n\t],\n\t\"postCreateCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"postCreateCommand\\\" > $HOME/post-create-command.out\"\n\t],\n\t\"postStartCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"postStartCommand\\\" > $HOME/post-start-command.out\"\n\t],\n\t\"postAttachCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n \\\"postAttachCommand\\\" > $HOME/post-attach-command.out\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-lifecycle-array/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-lifecycle-object/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"remoteEnv\": {\n\t\t\"FOO\": \"BAR\",\n\t\t\"LOCAL_ENV_HOME\": \"${localEnv:HOME}\",\n\t\t\"CONTAINER_ENV_PATH\": \"${containerEnv:PATH}\"\n\t},\n\t\"initializeCommand\": {\n\t\t\"one\": \"echo initializeCommandOne > ./initialize-command1.out\",\n\t\t\"two\":[\n\t\t\t\"sh\", \"-c\", \"echo -n \\\"initializeCommandTwo\\\" > ./initialize-command2.out\"\n\t\t]\n\t}\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-lifecycle-object/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-mounts/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"mounts\": [\n\t\t{\n\t\t\t\"type\": \"volume\",\n\t\t\t\"source\": \"mount1\",\n\t\t\t\"target\": \"/home/vscode/mnt1\"\n\t\t},\n\t\t\"source=${localWorkspaceFolder}/mount2,target=/home/vscode/mnt2,type=bind\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-mounts/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-mounts/mount2/bar.txt",
    "content": "FOO"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-multiple-services/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"../docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-multiple-services/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached\n  db:\n    image: postgres:latest\n    restart: unless-stopped\n    volumes:\n      - postgres-data:/var/lib/postgresql/data\n    environment:\n      POSTGRES_PASSWORD: postgres\n      POSTGRES_USER: postgres\n      POSTGRES_DB: postgres\n\nvolumes:\n  postgres-data:"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-override-command/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"overrideCommand\": true\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-override-command/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: bash\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-overrides/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": [\n\t\t\"../docker-compose.yaml\",\n\t\t\"./docker-compose.devcontainer.yaml\"\n\t],\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-overrides/.devcontainer/docker-compose.devcontainer.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    command: sleep infinity"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-overrides/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-privileged/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"privileged\": true\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-privileged/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-rebuild-fail/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-rebuild-fail/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-rebuild-fail/fail.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app1\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-rebuild-success/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-rebuild-success/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-remote-env/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"remoteEnv\": {\n\t\t\"FOO\": \"BAR\"\n\t},\n\t\"postCreateCommand\": [\n\t\t\"sh\", \"-c\", \"echo $FOO > $HOME/remote-env.out\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-remote-env/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-remote-user/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"remoteUser\": \"root\",\n\t\"postCreateCommand\": [\n\t\t\"sh\", \"-c\", \"whoami > $HOME/remote-user.out\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-remote-user/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-run-services/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"../docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"runServices\": [\"app\"],\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-run-services/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached\n  db:\n    image: postgres:latest\n    restart: unless-stopped\n    volumes:\n      - postgres-data:/var/lib/postgresql/data\n    environment:\n      POSTGRES_PASSWORD: postgres\n      POSTGRES_USER: postgres\n      POSTGRES_DB: postgres\n\nvolumes:\n  postgres-data:"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-securityOpt/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"securityOpt\": [\n\t\t\"seccomp=unconfined\",\n\t\t\"apparmor=unconfined\"\n \t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-securityOpt/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-subfolder/.devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"../docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-subfolder/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-variables/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\",\n\t\"remoteEnv\": {\n\t\t\"FOO\": \"BAR\",\n\t\t\"LOCAL_ENV_HOME\": \"${localEnv:HOME}\",\n\t\t\"CONTAINER_ENV_PATH\": \"${containerEnv:PATH}\"\n\t},\n\t\"postCreateCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n ${devcontainerId} > $HOME/dev-container-id.out && echo -n ${CONTAINER_ENV_PATH} > $HOME/container-env-path.out && echo -n ${LOCAL_ENV_HOME} > $HOME/local-env-home.out && echo -n ${localWorkspaceFolder} > $HOME/local-workspace-folder.out && echo -n ${localWorkspaceFolderBasename} > $HOME/local-workspace-folder-basename.out && echo -n ${containerWorkspaceFolder} > $HOME/container-workspace-folder.out && echo -n ${containerWorkspaceFolderBasename} > $HOME/container-workspace-folder-basename.out\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-variables/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-with-multi-stage-build/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"dockerComposeFile\": \"./docker-compose.yaml\",\n\t\"service\": \"app\",\n\t\"workspaceFolder\": \"/workspaces\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-with-multi-stage-build/Dockerfile",
    "content": "FROM mcr.microsoft.com/vscode/devcontainers/ruby:3.2-bullseye AS base\n\nRUN apt update\nRUN apt install vim -y\n\nFROM base\n\nRUN mkdir -p /app\nWORKDIR /app"
  },
  {
    "path": "e2e/tests/up/testdata/docker-compose-with-multi-stage-build/docker-compose.yaml",
    "content": "version: '3'\n\nservices:\n  app:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    command: sleep infinity\n    volumes:\n      - .:/workspaces:cached"
  },
  {
    "path": "e2e/tests/up/testdata/docker-dockerfile-buildcontext/.devcontainer/devcontainer.json",
    "content": "{\n    \"name\": \"Test\",\n    \"build\": {\n        \"dockerfile\": \"../Dockerfile\"\n    }\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-dockerfile-buildcontext/.dockerignore",
    "content": "scripts/install.sh"
  },
  {
    "path": "e2e/tests/up/testdata/docker-dockerfile-buildcontext/Dockerfile",
    "content": "FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu\n\nCOPY scripts /scripts\n\nCMD bash"
  },
  {
    "path": "e2e/tests/up/testdata/docker-dockerfile-buildcontext/scripts/alias.sh",
    "content": "alias hello='echo Hello $USER'"
  },
  {
    "path": "e2e/tests/up/testdata/docker-dockerfile-buildcontext/scripts/install.sh",
    "content": "#!/bin/bash\n\napt update -y\napt install curl"
  },
  {
    "path": "e2e/tests/up/testdata/docker-features-http-headers/.devcontainer.json",
    "content": "{\n  \"name\": \"Test hello\",\n  \"image\": \"mcr.microsoft.com/vscode/devcontainers/base:ubuntu\",\n  \"features\": {\n    \"#{server_url}/devcontainer-feature-hello.tgz\": {}\n  },\n  \"customizations\": {\n    \"devpod\": {\n      \"featureDownloadHTTPHeaders\": {\n        \"Foo-Header\": \"Foo\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker-features-http-headers/devcontainer-feature.json",
    "content": "{\n  \"name\": \"Hello\",\n  \"id\": \"hello\",\n  \"version\": \"0.0.1\",\n  \"description\": \"A feature installing hello\"\n}\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker-features-http-headers/install.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nexport DEBIAN_FRONTEND=noninteractive\n\napt-get update\napt-get install -y hello\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker-features-lifecycle-hooks/.devcontainer.json",
    "content": "{\n    \"name\": \"Test Git\",\n    \"image\": \"mcr.microsoft.com/vscode/devcontainers/base:ubuntu\",\n    \"features\": {\n      \"ghcr.io/devcontainers/features/git:1\": {}\n    },\n    \"postStartCommand\": \"git version\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-mounts/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\",\n\t\"mounts\": [\n\t\t{\n\t\t\t\"type\": \"bind\",\n\t\t\t\"source\": \"${localWorkspaceFolder}/mount1\",\n\t\t\t\"target\": \"/home/vscode/mnt1\"\n\t\t},\n\t\t\"source=${localWorkspaceFolder}/mount2,target=/home/vscode/mnt2,type=bind\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-mounts/mount1/foo.txt",
    "content": "BAR"
  },
  {
    "path": "e2e/tests/up/testdata/docker-mounts/mount2/bar.txt",
    "content": "FOO"
  },
  {
    "path": "e2e/tests/up/testdata/docker-variables/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\",\n\t\"remoteEnv\": {\n\t\t\"FOO\": \"BAR\",\n\t\t\"LOCAL_ENV_HOME\": \"${localEnv:HOME}\",\n\t\t\"CONTAINER_ENV_PATH\": \"${containerEnv:PATH}\"\n\t},\n\t\"postCreateCommand\": [\n\t\t\"sh\", \"-c\", \"echo -n ${devcontainerId} > $HOME/dev-container-id.out && echo -n ${CONTAINER_ENV_PATH} > $HOME/container-env-path.out && echo -n ${LOCAL_ENV_HOME} > $HOME/local-env-home.out && echo -n ${localWorkspaceFolder} > $HOME/local-workspace-folder.out && echo -n ${localWorkspaceFolderBasename} > $HOME/local-workspace-folder-basename.out && echo -n ${containerWorkspaceFolder} > $HOME/container-workspace-folder.out && echo -n ${containerWorkspaceFolderBasename} > $HOME/container-workspace-folder-basename.out\"\n\t]\n}"
  },
  {
    "path": "e2e/tests/up/testdata/docker-with-multi-stage-build/.devcontainer.json",
    "content": "{\n\t\"name\": \"Ruby\",\n\t\"workspaceFolder\": \"/app\",\n\t\"build\": {\n\t\t\"dockerfile\": \"Dockerfile\"\n\t},\n\t\"customizations\": {\n\t\t\"vscode\": {\n\t\t\t\"settings\": {},\n\t\t\t\"extensions\": []\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "e2e/tests/up/testdata/docker-with-multi-stage-build/Dockerfile",
    "content": "FROM mcr.microsoft.com/vscode/devcontainers/ruby:3.2-bullseye AS base\n\nRUN apt update\nRUN apt install vim -y\n\nFROM base\n\nRUN mkdir -p /app\nWORKDIR /app"
  },
  {
    "path": "e2e/tests/up/testdata/kubernetes/.devcontainer.json",
    "content": "{\n\t\"name\": \"Go\",\n\t\"image\": \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\"\n}"
  },
  {
    "path": "e2e/tests/up/testdata/kubernetes/test_file.txt",
    "content": "test"
  },
  {
    "path": "e2e/tests/up/testdata/no-devcontainer/empty.go",
    "content": "package no_devcontainer\n"
  },
  {
    "path": "e2e/tests/up/up.go",
    "content": "package up\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/e2e/framework\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdocker \"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/language\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/onsi/ginkgo/v2\"\n\t\"github.com/onsi/gomega\"\n)\n\nvar _ = DevPodDescribe(\"devpod up test suite\", func() {\n\tginkgo.Context(\"testing up command\", ginkgo.Label(\"up\"), ginkgo.Ordered, func() {\n\t\tvar dockerHelper *docker.DockerHelper\n\t\tvar initialDir string\n\n\t\tginkgo.BeforeEach(func() {\n\t\t\tvar err error\n\t\t\tinitialDir, err = os.Getwd()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tdockerHelper = &docker.DockerHelper{DockerCommand: \"docker\", Log: log.Default}\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"with env vars\", func() {\n\t\t\tctx := context.Background()\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tname := \"vscode-remote-try-python\"\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), name)\n\n\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, \"https://github.com/microsoft/vscode-remote-try-python.git\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err := f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, \"\", \"should be empty\")\n\n\t\t\t// set env var\n\t\t\tvalue := \"test-variable\"\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env\", \"TEST_VAR=\"+value)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, value, \"should be set now\")\n\n\t\t\t// check env var again\n\t\t\terr = f.DevPodUp(ctx, name)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, value, \"should still be set\")\n\n\t\t\t// delete env var\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env\", \"TEST_VAR=\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, \"\", \"should be empty\")\n\n\t\t\t// set env vars with file\n\t\t\ttmpDir, err := framework.CreateTempDir()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// create invalid env file\n\t\t\tinvalidData := []byte(\"TEST VAR=\" + value)\n\t\t\tworkspaceEnvFileInvalid := filepath.Join(tmpDir, \".invalid\")\n\t\t\terr = os.WriteFile(\n\t\t\t\tworkspaceEnvFileInvalid,\n\t\t\t\tinvalidData, 0o644)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer os.Remove(workspaceEnvFileInvalid)\n\n\t\t\t// set env var\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env-file\", workspaceEnvFileInvalid)\n\t\t\tframework.ExpectError(err)\n\n\t\t\t// create valid env file\n\t\t\tvalidData := []byte(\"TEST_VAR=\" + value)\n\t\t\tworkspaceEnvFileValid := filepath.Join(tmpDir, \".valid\")\n\t\t\terr = os.WriteFile(\n\t\t\t\tworkspaceEnvFileValid,\n\t\t\t\tvalidData, 0o644)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer os.Remove(workspaceEnvFileValid)\n\n\t\t\t// set env var\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env-file\", workspaceEnvFileValid)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, value, \"should be set now\")\n\n\t\t\t// delete env var\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env\", \"TEST_VAR=\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, \"\", \"should be empty\")\n\n\t\t\t// create a second valid env file with a different env var\n\t\t\tvalidData = []byte(\"TEST_OTHER_VAR=\" + value)\n\t\t\tworkspaceEnvFileValid2 := filepath.Join(tmpDir, \".valid2\")\n\t\t\terr = os.WriteFile(\n\t\t\t\tworkspaceEnvFileValid2,\n\t\t\t\tvalidData, 0o644)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer os.Remove(workspaceEnvFileValid2)\n\n\t\t\t// set env var from both files\n\t\t\terr = f.DevPodUp(ctx, name, \"--workspace-env-file\", fmt.Sprintf(\"%s,%s\", workspaceEnvFileValid, workspaceEnvFileValid2))\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check env var from .valid file\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, value, \"should be set now\")\n\n\t\t\t// check env var from .valid2 file\n\t\t\tout, err = f.DevPodSSH(ctx, name, \"echo -n $TEST_OTHER_VAR\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, value, \"should be set now\")\n\t\t})\n\n\t\tginkgo.It(\"should allow checkout of a GitRepo from a commit hash\", func() {\n\t\t\tctx := context.Background()\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tname := \"sha256-0c1547c\"\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), name)\n\n\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, \"github.com/microsoft/vscode-remote-try-python@sha256:0c1547c\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should allow checkout of a GitRepo from a pull request reference\", func() {\n\t\t\tctx := context.Background()\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tname := \"pr3\"\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), name)\n\n\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, \"github.com/loft-sh/devpod@pull/3/head\")\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"should allow checkout of a private GitRepo\", func() {\n\t\t\t// need to debug\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\tginkgo.Skip(\"skipping on windows\")\n\t\t\t}\n\n\t\t\tusername := os.Getenv(\"GH_USERNAME\")\n\t\t\ttoken := os.Getenv(\"GH_ACCESS_TOKEN\")\n\n\t\t\tif username == \"\" || token == \"\" {\n\t\t\t\tginkgo.Skip(\"WARNING: skipping test, secrets not found\")\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"docker\")\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, \"docker\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// setup git credentials\n\t\t\terr = exec.Command(\"git\", []string{\"config\", \"--global\", \"credential.helper\", \"store\"}...).Run()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tgitCredentialString := []byte(\"https://\" + username + \":\" + token + \"@github.com\")\n\t\t\terr = os.WriteFile(\n\t\t\t\tfilepath.Join(os.Getenv(\"HOME\"), \".git-credentials\"),\n\t\t\t\tgitCredentialString, 0o644)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tdefer os.Remove(filepath.Join(os.Getenv(\"HOME\"), \".git-credentials\"))\n\n\t\t\tname := \"testprivaterepo\"\n\t\t\tginkgo.DeferCleanup(f.DevPodWorkspaceDelete, context.Background(), name)\n\n\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\terr = f.DevPodUp(ctx, \"https://github.com/\"+username+\"/test_private_repo.git\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// Ensure git credentials are properly forwarded by cloning the private repo\n\t\t\t// from within the container\n\t\t\tout, err := f.DevPodSSH(ctx, name, \"git clone https://github.com/\"+username+\"/test_private_repo\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tfmt.Println(out)\n\t\t})\n\n\t\tginkgo.It(\"run devpod in Kubernetes\", func() {\n\t\t\tctx := context.Background()\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/kubernetes\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t_ = f.DevPodProviderDelete(ctx, \"kubernetes\")\n\t\t\terr = f.DevPodProviderAdd(ctx, \"kubernetes\", \"-o\", \"KUBERNETES_NAMESPACE=devpod\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(ctx, \"kubernetes\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\t// run up\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check pod is there\n\t\t\tcmd := exec.Command(\"kubectl\", \"get\", \"pods\", \"-l\", \"devpod.sh/created=true\", \"-o\", \"json\", \"-n\", \"devpod\")\n\t\t\tstdout, err := cmd.Output()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if pod is there\n\t\t\tlist := &framework.PodList{}\n\t\t\terr = json.Unmarshal(stdout, list)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(len(list.Items), 1, \"Expect 1 pod\")\n\t\t\tframework.ExpectEqual(len(list.Items[0].Spec.Containers), 1, \"Expect 1 container\")\n\t\t\tframework.ExpectEqual(list.Items[0].Spec.Containers[0].Image, \"mcr.microsoft.com/devcontainers/go:0-1.19-bullseye\", \"Expect container image\")\n\n\t\t\t// check if ssh works\n\t\t\terr = f.DevPodSSHEchoTestString(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// stop workspace\n\t\t\terr = f.DevPodWorkspaceStop(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check pod is there\n\t\t\tcmd = exec.Command(\"kubectl\", \"get\", \"pods\", \"-l\", \"devpod.sh/created=true\", \"-o\", \"json\", \"-n\", \"devpod\")\n\t\t\tstdout, err = cmd.Output()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if pod is there\n\t\t\tlist = &framework.PodList{}\n\t\t\terr = json.Unmarshal(stdout, list)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(len(list.Items), 0, \"Expect no pods\")\n\n\t\t\t// run up\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check pod is there\n\t\t\tcmd = exec.Command(\"kubectl\", \"get\", \"pods\", \"-l\", \"devpod.sh/created=true\", \"-o\", \"json\", \"-n\", \"devpod\")\n\t\t\tstdout, err = cmd.Output()\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// check if pod is there\n\t\t\tlist = &framework.PodList{}\n\t\t\terr = json.Unmarshal(stdout, list)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(len(list.Items), 1, \"Expect 1 pod\")\n\n\t\t\t// check if ssh works\n\t\t\terr = f.DevPodSSHEchoTestString(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// delete workspace\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"create workspace without devcontainer.json\", func() {\n\t\t\tconst providerName = \"test-docker\"\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/no-devcontainer\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t// provider add, use and delete afterwards\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\", \"--name\", providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(ctx, providerName)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tworkspace, err := f.FindWorkspace(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tprojectName := workspace.ID\n\t\t\tids, err := dockerHelper.FindContainer(ctx, []string{\n\t\t\t\tfmt.Sprintf(\"%s=%s\", config.DockerIDLabel, workspace.UID),\n\t\t\t})\n\t\t\tframework.ExpectNoError(err)\n\t\t\tgomega.Expect(ids).To(gomega.HaveLen(1), \"1 compose container to be created\")\n\n\t\t\tdevcontainerPath := filepath.Join(\"/workspaces\", projectName, \".devcontainer.json\")\n\n\t\t\tcontainerEnvPath, _, err := f.ExecCommandCapture(ctx, []string{\"ssh\", \"--command\", \"cat \" + devcontainerPath, projectName})\n\t\t\tframework.ExpectNoError(err)\n\t\t\texpectedImageName := language.MapConfig[language.Go].ImageContainer.Image\n\n\t\t\tgomega.Expect(containerEnvPath).To(gomega.Equal(fmt.Sprintf(\"{\\\"image\\\":\\\"%s\\\"}\", expectedImageName)))\n\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"recreate a local workspace\", func() {\n\t\t\tconst providerName = \"test-docker\"\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/no-devcontainer\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t// provider add, use and delete afterwards\n\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\", \"--name\", providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(ctx, providerName)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\terr = f.DevPodUp(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// recreate\n\t\t\terr = f.DevPodUpRecreate(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, tempDir)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"create workspace in a subpath\", func() {\n\t\t\tconst providerName = \"test-docker\"\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// provider add, use and delete afterwards\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\", \"--name\", providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(ctx, providerName)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\terr = f.DevPodUp(ctx, \"https://github.com/loft-sh/examples@subpath:/devpod/jupyter-notebook-hello-world\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\tid := \"subpath--devpod-jupyter-notebook-hello-world\"\n\t\t\tout, err := f.DevPodSSH(ctx, id, \"pwd\")\n\t\t\tframework.ExpectNoError(err)\n\t\t\tframework.ExpectEqual(out, fmt.Sprintf(\"/workspaces/%s\\n\", id), \"should be subpath\")\n\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, id)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"recreate a remote workspace\", func() {\n\t\t\tconst providerName = \"test-docker\"\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// provider add, use and delete afterwards\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\", \"--name\", providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodProviderDelete(ctx, providerName)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\tid := \"subpath--devpod-jupyter-notebook-hello-world\"\n\t\t\terr = f.DevPodUp(ctx, \"https://github.com/loft-sh/examples@subpath:/devpod/jupyter-notebook-hello-world\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t_, err = f.DevPodSSH(ctx, id, \"pwd\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// recreate\n\t\t\terr = f.DevPodUpRecreate(ctx, \"https://github.com/loft-sh/examples@subpath:/devpod/jupyter-notebook-hello-world\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t_, err = f.DevPodSSH(ctx, id, \"pwd\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, id)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.It(\"reset a remote workspace\", func() {\n\t\t\tconst providerName = \"test-docker\"\n\t\t\tctx := context.Background()\n\n\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\n\t\t\t// provider add, use and delete afterwards\n\t\t\terr := f.DevPodProviderAdd(ctx, \"docker\", \"--name\", providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\terr = f.DevPodProviderUse(ctx, providerName)\n\t\t\tframework.ExpectNoError(err)\n\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\terr = f.DevPodWorkspaceDelete(ctx, \"jupyter-notebook-hello-world\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\terr = f.DevPodProviderDelete(ctx, providerName)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t})\n\n\t\t\tid := \"subpath--devpod-jupyter-notebook-hello-world\"\n\t\t\terr = f.DevPodUp(ctx, \"https://github.com/loft-sh/examples@subpath:/devpod/jupyter-notebook-hello-world\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// create files in root and in workspace, after create we expect data to still be there\n\t\t\t_, err = f.DevPodSSH(ctx, id, fmt.Sprintf(\"sudo touch /workspaces/%s/DATA\", id))\n\t\t\tframework.ExpectNoError(err)\n\t\t\t_, err = f.DevPodSSH(ctx, id, \"sudo touch /ROOTFS\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// reset\n\t\t\terr = f.DevPodUpReset(ctx, \"https://github.com/loft-sh/examples/@subpath:/devpod/jupyter-notebook-hello-world\")\n\t\t\tframework.ExpectNoError(err)\n\n\t\t\t// this should fail! because --reset should trigger a new git clone\n\t\t\t_, err = f.DevPodSSH(ctx, id, fmt.Sprintf(\"ls /workspaces/%s/DATA\", id))\n\t\t\tframework.ExpectError(err)\n\t\t\t// this should fail! because --recreare should trigger a new build, so a new rootfs\n\t\t\t_, err = f.DevPodSSH(ctx, id, \"ls /ROOTFS\")\n\t\t\tframework.ExpectError(err)\n\n\t\t\terr = f.DevPodWorkspaceDelete(ctx, id)\n\t\t\tframework.ExpectNoError(err)\n\t\t})\n\n\t\tginkgo.Context(\"print error message correctly\", func() {\n\t\t\tginkgo.It(\"make sure devpod output is correct and log-output works correctly\", func(ctx context.Context) {\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\ttempDir, err := framework.CopyToTempDir(\"tests/up/testdata/docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)\n\n\t\t\t\terr = f.DevPodProviderAdd(ctx, \"docker\", \"--name\", \"test-docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tginkgo.DeferCleanup(func() {\n\t\t\t\t\terr = f.DevPodProviderDelete(context.Background(), \"test-docker\")\n\t\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t})\n\n\t\t\t\terr = f.DevPodProviderUse(ctx, \"test-docker\", \"-o\", \"DOCKER_PATH=abc\", \"--skip-init\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\t// Wait for devpod workspace to come online\n\t\t\t\tstdout, stderr, err := f.DevPodUpStreams(ctx, tempDir, \"--log-output=json\")\n\t\t\t\tdeleteErr := f.DevPodWorkspaceDelete(ctx, tempDir, \"--force\")\n\t\t\t\tframework.ExpectNoError(deleteErr)\n\t\t\t\tframework.ExpectError(err, \"expected error\")\n\t\t\t\tframework.ExpectNoError(verifyLogStream(strings.NewReader(stdout)))\n\t\t\t\tframework.ExpectNoError(verifyLogStream(strings.NewReader(stderr)))\n\t\t\t\tframework.ExpectNoError(findMessage(strings.NewReader(stdout), \"exec: \\\"abc\\\": executable file not found in $PATH\"))\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t})\n\n\t\tginkgo.Context(\"cleanup up on failure\", func() {\n\t\t\tginkgo.It(\"ensure workspace cleanup when failing to create a workspace\", func(ctx context.Context) {\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr := f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tinitialList, err := f.DevPodList(ctx)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, \"github.com/i/do-not-exist.git\")\n\t\t\t\tframework.ExpectError(err)\n\n\t\t\t\tout, err := f.DevPodList(ctx)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tframework.ExpectEqual(out, initialList)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t\tginkgo.It(\"ensure workspace cleanup when not a git or folder\", func(ctx context.Context) {\n\t\t\t\tf := framework.NewDefaultFramework(initialDir + \"/bin\")\n\t\t\t\t_ = f.DevPodProviderAdd(ctx, \"docker\")\n\t\t\t\terr := f.DevPodProviderUse(ctx, \"docker\")\n\t\t\t\tframework.ExpectNoError(err)\n\n\t\t\t\tinitialList, err := f.DevPodList(ctx)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\t// Wait for devpod workspace to come online (deadline: 30s)\n\t\t\t\terr = f.DevPodUp(ctx, \"notfound.loft.sh\")\n\t\t\t\tframework.ExpectError(err)\n\n\t\t\t\tout, err := f.DevPodList(ctx)\n\t\t\t\tframework.ExpectNoError(err)\n\t\t\t\tframework.ExpectEqual(out, initialList)\n\t\t\t}, ginkgo.SpecTimeout(framework.GetTimeout()))\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "examples/build/.devcontainer.json",
    "content": "{\n  \"name\": \"My dev env\",\n  \"build\": {\n    \"context\": \".\",\n    \"dockerfile\": \"./Dockerfile\"\n  },\n  \"features\":{\n    \"ghcr.io/devcontainers/features/github-cli:1\": {}\n  }\n}\n"
  },
  {
    "path": "examples/build/Dockerfile",
    "content": "# syntax=docker/dockerfile:1\nFROM mcr.microsoft.com/devcontainers/go:1.22-bullseye\n\nARG TARGETOS\nARG TARGETARCH\n\n# Install Node.js\nRUN \\\n    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set environment variables for Rust\nENV RUSTUP_HOME=/usr/local/rustup \\\n    CARGO_HOME=/usr/local/cargo \\\n    PATH=/usr/local/cargo/bin:$PATH \\\n    RUST_VERSION=1.69.0\n\n# Install Protobuf compiler\nRUN \\\n    apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nCOPY app /app\n\nRUN echo hello"
  },
  {
    "path": "examples/build/README.md",
    "content": "## Build Example\n\nThis folder holds a super simple devcontainer configuration that builds a local Dockerfile with a devcontainer feature. You can start this project via:\n```\ndevpod up ./examples/build\n```\n"
  },
  {
    "path": "examples/build/app/code",
    "content": ""
  },
  {
    "path": "examples/build-multi-stage/.devcontainer.json",
    "content": "{\n  \"name\": \"My dev env\",\n  \"build\": {\n    \"context\": \".\",\n    \"dockerfile\": \"./Dockerfile\"\n  },\n  \"features\":{\n    \"ghcr.io/devcontainers/features/github-cli:1\": {},\n    \"ghcr.io/devcontainers/features/node:1\": {\n\t\t\t\"installYarnUsingApt\": true,\n\t\t        \"version\": \"lts\",\n\t \t\t\"nvmVersion\": \"latest\"\n\t \t}\n  }\n}\n"
  },
  {
    "path": "examples/build-multi-stage/Dockerfile",
    "content": "FROM mcr.microsoft.com/devcontainers/go:1.22-bullseye AS go\n\nARG TARGETOS\nARG TARGETARCH\n\n# Install Node.js\nRUN \\\n    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set environment variables for Rust\nENV RUSTUP_HOME=/usr/local/rustup \\\n    CARGO_HOME=/usr/local/cargo \\\n    PATH=/usr/local/cargo/bin:$PATH \\\n    RUST_VERSION=1.69.0\n\n# Install Protobuf compiler\nRUN \\\n    apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nFROM go AS final\n\nCOPY app /app\n\nRUN echo hello\n"
  },
  {
    "path": "examples/build-multi-stage/README.md",
    "content": "## Multi Stage Build Example\n\nThis folder holds a simple devcontainer configuration that builds a local multi stages Dockerfile with a devcontainer feature. This is ideal for testing the build pipeline for more advance use cases, especially the extending of the Dockerfile. \n\nYou can start this project via:\n```\ndevpod up ./examples/build-multi-stage\n```\n"
  },
  {
    "path": "examples/compose/.devcontainer.json",
    "content": "{\n  \"dockerComposeFile\": \"docker-compose.devcontainer.yml\",\n  \"service\": \"app\",\n  \"runServices\": [\"app2\"],\n  \"workspaceFolder\": \"/workspaces\",\n  \"features\":{\n    \"ghcr.io/devcontainers/features/github-cli:1\": {},\n    \"ghcr.io/devcontainers/features/node:1\": {\n      \"installYarnUsingApt\": true,\n      \"version\": \"lts\",\n      \"nvmVersion\": \"latest\"\n    }\n  },\n  \"forwardPorts\": [1337, \"db:5432\"]\n}\n"
  },
  {
    "path": "examples/compose/Dockerfile",
    "content": "# syntax=docker/dockerfile:1\nFROM mcr.microsoft.com/devcontainers/go:1.22-bullseye AS go\n\nARG TARGETOS\nARG TARGETARCH\n\n# Install Node.js\nRUN \\\n    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set environment variables for Rust\nENV RUSTUP_HOME=/usr/local/rustup \\\n    CARGO_HOME=/usr/local/cargo \\\n    PATH=/usr/local/cargo/bin:$PATH \\\n    RUST_VERSION=1.69.0\n\n# Install Protobuf compiler\nRUN \\\n    apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nFROM go AS final\n\nCOPY app /app\n\nRUN echo hello\n"
  },
  {
    "path": "examples/compose/README.md",
    "content": "## Docker Compose Example\n\nThis folder holds a simple devcontainer configuration that uses docker-compose to start and build several services.\n\nYou can start this project via:\n```\ndevpod up ./examples/compose\n```\n"
  },
  {
    "path": "examples/compose/devcontainer.Dockerfile",
    "content": "FROM mcr.microsoft.com/devcontainers/go:1.22-bullseye AS go\n\nARG TARGETOS\nARG TARGETARCH\n\n# Install Node.js\nRUN \\\n    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set environment variables for Rust\nENV RUSTUP_HOME=/usr/local/rustup \\\n    CARGO_HOME=/usr/local/cargo \\\n    PATH=/usr/local/cargo/bin:$PATH \\\n    RUST_VERSION=1.69.0\n\n# Install Protobuf compiler\nRUN \\\n    apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nFROM go AS final\n\nCOPY app /app\n\nRUN echo hello\n"
  },
  {
    "path": "examples/compose/devcontainer.Dockerfile2",
    "content": "FROM mcr.microsoft.com/devcontainers/base:ubuntu\nRUN echo test\n"
  },
  {
    "path": "examples/compose/docker-compose.devcontainer.yml",
    "content": "version: '3.8'\n\nservices:\n  app:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    env_file:\n      - .env\n\n    volumes:\n      - .:/workspaces:cached\n\n    # Overrides default command so things don't shut down after the process ends.\n    command: sleep infinity\n\n  app2:\n    build:\n      context: .\n      dockerfile: devcontainer.Dockerfile2\n    env_file:\n      - .env\n\n    volumes:\n      - .:/workspaces:cached\n\n    # Overrides default command so things don't shut down after the process ends.\n    command: sleep infinity\n\n  db:\n    image: postgres:latest\n    restart: unless-stopped\n    volumes:\n      - postgres-data:/var/lib/postgresql/data\n    env_file:\n      - .env\nvolumes:\n  postgres-data:\n"
  },
  {
    "path": "examples/feature/.devcontainer.json",
    "content": "{\n  \"image\": \"ubuntu\",\n  \"remoteUser\": \"auser\",\n  \"features\": {\n    \"./afeature\": {}\n  }\n}\n"
  },
  {
    "path": "examples/feature/afeature/devcontainer-feature.json",
    "content": "{\n  \"name\": \"A feature\",\n  \"id\": \"afeature\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A feature.\",\n  \"options\": {}\n}\n"
  },
  {
    "path": "examples/feature/afeature/install.sh",
    "content": "#!/bin/bash\n\necho \"hello world\"\nuseradd -l -m -s /bin/bash -N -u 1001 \"auser\"\n"
  },
  {
    "path": "examples/multi-devcontainer/.devcontainer.json",
    "content": "{\"image\":\"mcr.microsoft.com/devcontainers/base:ubuntu\",\"build\":{}}"
  },
  {
    "path": "examples/multi-devcontainer/proj1/.devcontainer.json",
    "content": "{\n  \"name\": \"Python 3\",\n  \"image\": \"mcr.microsoft.com/vscode/devcontainers/python:0-3\"\n}\n"
  },
  {
    "path": "examples/multi-devcontainer/proj2/.devcontainer.json",
    "content": "{\n  \"name\": \"Go\",\n  \"image\": \"mcr.microsoft.com/vscode/devcontainers/go:0-1.19-bullseye\"\n}\n"
  },
  {
    "path": "examples/object-lifecycle-hooks/.devcontainer.json",
    "content": "{\n  \"name\": \"Object-Lifecycle\",\n  \"image\": \"mcr.microsoft.com/vscode/devcontainers/go:1\",\n  \"postStartCommand\": {\n    \"cobra-install\": \"go install github.com/spf13/cobra-cli@latest\",\n    \"golangci-lint\": \"go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest\",\n    \"errcheck\": \"go install github.com/kisielk/errcheck@latest\"\n  }\n}\n"
  },
  {
    "path": "examples/simple/.devcontainer.json",
    "content": "// For format details, see https://aka.ms/devcontainer.json. For config options, see the\n// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet\n{\n  \"name\": \"C# (.NET)\",\n  // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile\n  \"image\": \"mcr.microsoft.com/devcontainers/dotnet:1-8.0\",\n\n  // Features to add to the dev container. More info: https://containers.dev/features.\n  \"features\": {\n    \"ghcr.io/devcontainers/features/kubectl-helm-minikube:1\": {\n      \"version\": \"latest\",\n      \"helm\": \"latest\",\n      \"minikube\": \"none\"\n    },\n    \"ghcr.io/loft-sh/devcontainer-features/vcluster:1\": {\n      \"version\": \"latest\"\n    },\n    \"ghcr.io/larsnieuwenhuizen/features/jqyq:0\": {}\n  },\n\n  // Configure tool-specific properties.\n  \"customizations\": {\n    // Configure properties specific to VS Code.\n    \"vscode\": {\n      \"settings\": {},\n      \"extensions\": [\"streetsidesoftware.code-spell-checker\"]\n    }\n  },\n\n  // Use 'portsAttributes' to set default properties for specific forwarded ports.\n  // More info: https://containers.dev/implementors/json_reference/#port-attributes\n  \"portsAttributes\": {\n    \"5000\": {\n      \"label\": \"Hello Remote World\",\n      \"onAutoForward\": \"notify\"\n    },\n    \"5001\": {\n      \"protocol\": \"https\"\n    }\n  }\n\n  // Use 'forwardPorts' to make a list of ports inside the container available locally.\n  // \"forwardPorts\": [5000, 5001],\n\n  // Use 'postCreateCommand' to run commands after the container is created.\n  // \"postCreateCommand\": \"chmod +x .devcontainer/post_setup.sh && .devcontainer/post_setup.sh\"\n\n  // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.\n  // \"remoteUser\": \"root\"\n}\n"
  },
  {
    "path": "examples/simple/README.md",
    "content": "## Simple Example\n\nThis folder holds a super simple devcontainer configuration. You can start this project via:\n```\ndevpod up ./examples/simple\n```\n"
  },
  {
    "path": "examples/simple-k8s-provider/README.md",
    "content": "## Simple Kubernetes Provider\n\nThis provider starts a privileged Docker-in-Docker pod in a Kubernetes cluster and connects the workspace to it. To use this provider simply clone the repo and run:\n```\ndevpod provider add ./examples/provider.yaml\n```\n\nThen start a new workspace via:\n```\ndevpod up github.com/microsoft/vscode-course-sample\n```\n"
  },
  {
    "path": "examples/simple-k8s-provider/provider.yaml",
    "content": "name: kubernetes\nversion: 0.0.1\ndescription: |-\n  DevPod on Kubernetes\noptions:\n  NAMESPACE:\n    required: true\n    description: The namespace to use\n    command: |-\n      NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\n      if [ -z \"${NAMESPACE}\" ]; then\n        NAMESPACE=default\n      fi\n      echo $NAMESPACE\nagent:\n  path: /tmp/devpod\nexec:\n  command: |-\n    kubectl exec -n \"${NAMESPACE}\" -c devpod-container -i devpod-${MACHINE_ID} -- sh -c \"${COMMAND}\"\n  create: |-\n    kubectl create -n \"${NAMESPACE}\" -f - << EOF\n    apiVersion: v1\n    kind: Pod\n    metadata:\n      name: devpod-${MACHINE_ID}\n      labels:\n        app: devpod\n    spec:\n      volumes:\n        - name: devpod-storage\n          emptyDir: {}\n      containers:\n        - name: devpod-container\n          image: docker:dind\n          volumeMounts:\n          - mountPath: /var/lib/docker\n            name: devpod-storage\n            subPath: var/lib/docker\n          - mountPath: /root\n            name: devpod-storage\n            subPath: root\n          securityContext:\n            privileged: true\n    EOF\n  delete: |-\n    kubectl delete pod devpod-${MACHINE_ID} -n \"${NAMESPACE}\" || true\n"
  },
  {
    "path": "examples/ztunnel/README.md",
    "content": "# Ztunnel example\n\n```bash\ncurl -L -o devpod \"https://github.com/loft-sh/devpod/releases/latest/download/devpod-darwin-arm64\" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod\n```\n\nUpdate the provider\n\n```bash\ndevpod provider update kubernetes kubernetes\n```\n\nVersion deployed and version of source code matters. Make sure they match. Pull the latest version of the source code. And copy the devcontainer.json file to the source code. Or you can use the latest version of `gcr.io/istio-testing/build-tools` image.\n\nMake sure you hve a fresh installation of Istio:\n\n```bash\nistioctl uninstall --purge -y\n\nistioctl install -y --set profile=ambient --set meshConfig.accessLogFile=/dev/stdout\n```\n\nAlso, if you want to start from scratch, better you delete the devpod:\n\n```bash\ndevpod delete . --force\n```\n\nLet's deploy an app to test ambient:\n\n```bash\nkubectl create ns my-ambient\nkubectl label namespace my-ambient istio.io/dataplane-mode=ambient --overwrite\nkubectl apply -f sleep.yaml -n my-ambient\nkubectl apply -f helloworld.yaml -n my-ambient\n```\n\nVerify that app was included to Ambient mode:\n\n```bash\nkubectl -n istio-system logs -l k8s-app=istio-cni-node\n```\n\nSend traffic to the app:\n\n```bash\nkubectl -n my-ambient exec deploy/sleep -- sh -c 'for i in $(seq 1 100); do curl -s -I http://helloworld:5000/hello; done'\n```\n\nOutput:\n\n```text\nHTTP/1.1 200 OK\nServer: gunicorn\nDate: Tue, 23 Jul 2024 14:21:03 GMT\nConnection: keep-alive\nContent-Type: text/html; charset=utf-8\nContent-Length: 60\n```\n\nVerify that the logs are being written to the stdout:\n\n```bash\nkubectl -n istio-system logs -l app=ztunnel\n```\n\nOutput:\n\n```text\n2024-07-23T14:21:03.450051Z\tinfo\taccess\tconnection complete\tsrc.addr=10.12.0.8:37522 src.workload=sleep-bc9998558-bhv5z src.namespace=my-ambient src.identity=\"spiffe://cluster.local/ns/my-ambient/sa/sleep\" dst.addr=10.12.0.9:15008 dst.hbone_addr=10.12.0.9:5000 dst.service=helloworld.my-ambient.svc.cluster.local dst.workload=helloworld-v1-77489ccb5f-pjbq5 dst.namespace=my-ambient dst.identity=\"spiffe://cluster.local/ns/my-ambient/sa/default\" direction=\"outbound\" bytes_sent=84 bytes_recv=158 duration=\"118ms\"\n```\n\nAt this point, traffic flows through the ztunnel.\n\nLet's label with `devpod-ztunnel=enabled` only one node to deploy devpod-ztunnel in there:\n\n```shell\nFIRST_NODE=$(kubectl get nodes -o jsonpath='{.items[0].metadata.name}')\nkubectl label node $FIRST_NODE devpod-ztunnel=enabled\n```\n\nNext command add nodeAffinity to make sure that the upstream ztunnel is not deployed in any node so our test if focused on one node and one devpod-ztunnel:\n\n```bash\nkubectl patch daemonset -n istio-system ztunnel --type=merge -p='{\"spec\":{\"template\":{\"spec\":{\"affinity\":{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"upstream-ztunnel\",\"operator\":\"In\",\"values\":[\"no\"]}]}]}}}}}}}'\n```\n\nYou should see that the ztunnel is not deployed anymore. \n\n**NOTE**: To revert the previous command, run the following:\n\n```bash\n# RUN THIS ONLY TO REVERT THE PREVIOUS COMMAND\n# kubectl patch daemonset -n istio-system ztunnel --type=merge -p='{\"spec\":{\"template\":{\"spec\":{\"affinity\":{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"upstream-ztunnel\",\"operator\":\"NotIn\",\"values\":[\"no\"]}]}]}}}}}}}'\n```\n\nMake sure you have docker installed:\n\n```bash\ndocker --version\n```\n\nGo to the root of the project and run the devpod:\n\n**Note** Normally, to start a Devpod is a straight forward simple command. However, given the complexty of ztunnel setup, we need to adjut it a bit.\n\n- `devcontainer.json` is overriden. In our version, we create a `postStartCommand` required to set the secret in the place that ztunnel app can find. Also, some `remoteEnv` are set to help on builing the app in the remote container.\n- Using Kind cluster, the `STORAGE_CLASS` is `standard`. If you are using a different cluster, you may need to change it (i.e in EKS it would be `gp2`)\n- The template of the pod is also overriden to match what ztunnel needs to run.\n\n```bash\ndevpod up . --provider-option STORAGE_CLASS=gp2 --provider-option KUBECTL_PATH=/usr/local/bin/kubectl --provider-option KUBERNETES_NAMESPACE=istio-system --provider-option POD_MANIFEST_TEMPLATE=$(pwd)/devpod/pod_manifest.yaml --devcontainer-path devpod/devcontainer.json --ide vscode --debug \\\n  --recreate --reset\n```\n\nYou will see DevPod cli copying your project files to the remote container. In the case of ztunnel project, make sure that the `out` folder is deleted before starting devpod. That folder is usully too heavy and unnecesary to be copied to the container.\n\nAt the moment, changes in the project when working in the container are not reflected in the local files. To do so, you can run the following command:\n\n```bash\nrsync -rlptzv --progress --delete --exclude=.git --exclude=out \"ztunnel.devpod:/workspaces/ztunnel\" .\n```\n\nWhen the process finishes, you can build the project:\n\n```bash\ncargo clean\n\n\nRUST_LOG=\"debug\" CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=\"sudo -E\" cargo build --bin=ztunnel --package=ztunnel --message-format=json\n```\n\n\n\n\n\n\n\n"
  },
  {
    "path": "examples/ztunnel/devcontainer.json",
    "content": "{\n  \"name\": \"istio build-tools\",\n  \"image\": \"gcr.io/istio-testing/build-tools:release-1.23-d82829888b6f4a2b2b2644fe481d72ced2e402aa\",\n  \"postStartCommand\": \"mkdir -p /workspaces/ztunnel/var/run/secrets; cp -R /var/run/secrets/tokens /workspaces/ztunnel/var/run/secrets/; cp -R /var/run/secrets/istio /workspaces/ztunnel/var/run/secrets/\",\n  \"privileged\": true,\n  \"remoteEnv\": {\n    \"USE_GKE_GCLOUD_AUTH_PLUGIN\": \"True\",\n    \"BUILD_WITH_CONTAINER\": \"0\",\n    \"CARGO_HOME\": \"/home/.cargo\",\n    \"RUSTUP_HOME\": \"/home/.rustup\",\n    \"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER\": \"sudo -E\"\n  },\n  // \"features\": {\n  //   \"ghcr.io/devcontainers/features/docker-outside-of-docker:1\": {}\n  // },\n  \"customizations\": {\n    \"vscode\": {\n      \"extensions\": [\n        \"golang.go\",\n        \"rust-lang.rust-analyzer\",\n        \"eamodio.gitlens\",\n        \"zxh404.vscode-proto3\",\n        \"ms-azuretools.vscode-docker\",\n        \"redhat.vscode-yaml\",\n        \"IBM.output-colorizer\",\n        \"vadimcn.vscode-lldb\"\n      ],\n      \"settings\": {\n        \"files.eol\": \"\\n\",\n        \"go.useLanguageServer\": true,\n        \"go.lintTool\": \"golangci-lint\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "examples/ztunnel/helloworld.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  name: helloworld\n  labels:\n    app: helloworld\n    service: helloworld\nspec:\n  ports:\n  - port: 5000\n    name: http\n  selector:\n    app: helloworld\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: helloworld-v1\n  labels:\n    app: helloworld\n    version: v1\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: helloworld\n      version: v1\n  template:\n    metadata:\n      labels:\n        app: helloworld\n        version: v1\n    spec:\n      affinity:\n        nodeAffinity:\n          requiredDuringSchedulingIgnoredDuringExecution:\n            nodeSelectorTerms:\n            - matchExpressions:\n              - key: devpod-ztunnel\n                operator: In\n                values:\n                - enabled\n      containers:\n      - name: helloworld\n        image: docker.io/istio/examples-helloworld-v1\n        resources:\n          requests:\n            cpu: \"100m\"\n        imagePullPolicy: IfNotPresent #Always\n        ports:\n        - containerPort: 5000\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: helloworld-v2\n  labels:\n    app: helloworld\n    version: v2\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: helloworld\n      version: v2\n  template:\n    metadata:\n      labels:\n        app: helloworld\n        version: v2\n    spec:\n      containers:\n      - name: helloworld\n        image: docker.io/istio/examples-helloworld-v2\n        resources:\n          requests:\n            cpu: \"100m\"\n        imagePullPolicy: IfNotPresent #Always\n        ports:\n        - containerPort: 5000\n"
  },
  {
    "path": "examples/ztunnel/launch.json",
    "content": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug unit tests in library 'ztunnel'\",\n      \"cargo\": {\n        \"args\": [\n          \"test\",\n          \"--no-run\",\n          \"--lib\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"ztunnel\",\n          \"kind\": \"lib\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\"\n    },\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug executable 'ztunnel'\",\n      \"cargo\": {\n        \"args\": [\n          \"build\",\n          \"--bin=ztunnel\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"ztunnel\",\n          \"kind\": \"bin\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\",\n      \"env\": {\n        \"RUST_LOG\": \"debug\",\n        \"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER\": \"sudo -E\",\n      }\n    },\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug unit tests in executable 'ztunnel'\",\n      \"cargo\": {\n        \"args\": [\n          \"test\",\n          \"--no-run\",\n          \"--bin=ztunnel\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"ztunnel\",\n          \"kind\": \"bin\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\"\n    },\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug integration test 'namespaced'\",\n      \"cargo\": {\n        \"args\": [\n          \"test\",\n          \"--no-run\",\n          \"--test=namespaced\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"namespaced\",\n          \"kind\": \"test\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\"\n    },\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug integration test 'direct'\",\n      \"cargo\": {\n        \"args\": [\n          \"test\",\n          \"--no-run\",\n          \"--test=direct\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"direct\",\n          \"kind\": \"test\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\"\n    },\n    {\n      \"type\": \"lldb\",\n      \"request\": \"launch\",\n      \"name\": \"Debug benchmark 'throughput'\",\n      \"cargo\": {\n        \"args\": [\n          \"test\",\n          \"--no-run\",\n          \"--bench=throughput\",\n          \"--package=ztunnel\"\n        ],\n        \"filter\": {\n          \"name\": \"throughput\",\n          \"kind\": \"bench\"\n        }\n      },\n      \"args\": [],\n      \"cwd\": \"${workspaceFolder}\"\n    }\n  ]\n}"
  },
  {
    "path": "examples/ztunnel/pod_manifest.yaml",
    "content": "apiVersion: v1\nkind: Pod\nmetadata:\n  namespace: istio-system\n  # name: devpod-ztunnel-1-21-0 # NOTE: This is ignored\n  annotations:\n    ambient.istio.io/redirection: disabled\n    prometheus.io/scrape: \"true\"\n    sidecar.istio.io/inject: \"false\"\n  # generateName: ztunnel-\n  labels:\n    featureid: \"1234\"\n    devpod: ztunnel\n    sidecar.istio.io/inject: \"false\"\n    app: devpod-ztunnel # NOTE: This make devpod fails\nspec:\n  affinity:\n    nodeAffinity:\n      requiredDuringSchedulingIgnoredDuringExecution:\n        nodeSelectorTerms:\n        - matchExpressions:\n          - key: devpod-ztunnel\n            operator: In\n            values:\n            - enabled\n  containers:\n  - name: \"devpod\"\n    env:\n    - name: CA_ADDRESS\n      value: istiod.istio-system.svc:15012\n    - name: XDS_ADDRESS\n      value: istiod.istio-system.svc:15012\n    - name: RUST_LOG\n      value: info\n    - name: ISTIO_META_CLUSTER_ID\n      value: cluster1\n    - name: INPOD_ENABLED\n      value: \"true\"\n    - name: ISTIO_META_DNS_PROXY_ADDR\n      value: 127.0.0.1:15053\n    - name: POD_NAME\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: metadata.name\n    - name: POD_NAMESPACE\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: metadata.namespace\n    - name: NODE_NAME\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: spec.nodeName\n    - name: INSTANCE_IP\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: status.podIP\n    - name: SERVICE_ACCOUNT\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: spec.serviceAccountName\n    ports:\n    - containerPort: 15020\n      name: ztunnel-stats\n      protocol: TCP\n#     # readinessProbe:\n#     #   failureThreshold: 3\n#     #   httpGet:\n#     #     path: /healthz/ready\n#     #     port: 15021\n#     #     scheme: HTTP\n#     #   periodSeconds: 10\n#     #   successThreshold: 1\n#     #   timeoutSeconds: 1\n    resources:\n      limits:\n        cpu: 500m\n        memory: 2Gi\n      requests:\n        cpu: 500m\n        memory: 2Gi\n    securityContext:\n      allowPrivilegeEscalation: false\n      capabilities:\n        add:\n        - NET_ADMIN\n        - SYS_ADMIN\n        - NET_RAW\n        drop:\n        - ALL\n      privileged: false\n      readOnlyRootFilesystem: true\n      runAsGroup: 1337\n      runAsNonRoot: false\n      runAsUser: 0\n    # terminationMessagePath: /dev/termination-log\n    # terminationMessagePolicy: File\n    volumeMounts:\n    - mountPath: /var/run/secrets/istio\n      name: istiod-ca-cert\n    - mountPath: /var/run/secrets/tokens\n      name: istio-token\n    - mountPath: /var/run/ztunnel\n      name: cni-ztunnel-sock-dir\n    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount\n      name: kube-api-access-c5j45\n    - name: containerd-sock\n      mountPath: /run/containerd/containerd.sock\n      readOnly: true\n  # dnsPolicy: ClusterFirst\n  # enableServiceLinks: true\n  # nodeName: kind1-control-plane\n  # nodeSelector:\n  #   kubernetes.io/os: linux\n  serviceAccount: ztunnel\n  serviceAccountName: ztunnel\n  # terminationGracePeriodSeconds: 30\n  volumes:\n  - name: istio-token\n    projected:\n      defaultMode: 420\n      sources:\n      - serviceAccountToken:\n          audience: istio-ca\n          expirationSeconds: 43200\n          path: istio-token\n  - configMap:\n      defaultMode: 420\n      name: istio-ca-root-cert\n    name: istiod-ca-cert\n  - hostPath:\n      path: /var/run/ztunnel\n      type: DirectoryOrCreate\n    name: cni-ztunnel-sock-dir\n  - name: kube-api-access-c5j45\n    projected:\n      defaultMode: 420\n      sources:\n      - serviceAccountToken:\n          expirationSeconds: 3607\n          path: token\n      - configMap:\n          items:\n          - key: ca.crt\n            path: ca.crt\n          name: kube-root-ca.crt\n      - downwardAPI:\n          items:\n          - fieldRef:\n              apiVersion: v1\n              fieldPath: metadata.namespace\n            path: namespace\n  - name: containerd-sock\n    hostPath:\n      path: \"/var/run/containerd/containerd.sock\"\n            \n\n"
  },
  {
    "path": "examples/ztunnel/sleep.yaml",
    "content": "# Copyright Istio Authors\n#\n#   Licensed under the Apache License, Version 2.0 (the \"License\");\n#   you may not use this file except in compliance with the License.\n#   You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n#   Unless required by applicable law or agreed to in writing, software\n#   distributed under the License is distributed on an \"AS IS\" BASIS,\n#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#   See the License for the specific language governing permissions and\n#   limitations under the License.\n\n##################################################################################################\n# Sleep service\n##################################################################################################\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: sleep\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: sleep\n  labels:\n    app: sleep\n    service: sleep\nspec:\n  ports:\n  - port: 80\n    name: http\n  selector:\n    app: sleep\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: sleep\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: sleep\n  template:\n    metadata:\n      labels:\n        app: sleep\n    spec:\n      terminationGracePeriodSeconds: 0\n      serviceAccountName: sleep\n      affinity:\n        nodeAffinity:\n          requiredDuringSchedulingIgnoredDuringExecution:\n            nodeSelectorTerms:\n            - matchExpressions:\n              - key: devpod-ztunnel\n                operator: In\n                values:\n                - enabled\n      containers:\n      - name: sleep\n        image: curlimages/curl\n        command: [\"/bin/sleep\", \"infinity\"]\n        imagePullPolicy: IfNotPresent\n        volumeMounts:\n        - mountPath: /etc/sleep/tls\n          name: secret-volume\n      volumes:\n      - name: secret-volume\n        secret:\n          secretName: sleep-secret\n          optional: true\n---\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/loft-sh/devpod\n\ngo 1.23.1\n\ntoolchain go1.23.5\n\nrequire (\n\tgithub.com/PaesslerAG/jsonpath v0.1.1\n\tgithub.com/alessio/shellescape v1.4.1\n\tgithub.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7\n\tgithub.com/blang/semver v3.5.1+incompatible\n\tgithub.com/blang/semver/v4 v4.0.0\n\tgithub.com/bmatcuk/doublestar/v4 v4.6.0\n\tgithub.com/charmbracelet/huh v0.6.0\n\tgithub.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589\n\tgithub.com/compose-spec/compose-go/v2 v2.2.0\n\tgithub.com/containers/image/v5 v5.33.1\n\tgithub.com/creack/pty v1.1.23\n\tgithub.com/distribution/reference v0.6.0\n\tgithub.com/docker/cli v27.5.1+incompatible\n\tgithub.com/docker/docker v27.5.1+incompatible\n\tgithub.com/docker/go-connections v0.5.0\n\tgithub.com/evanphx/json-patch v5.8.1+incompatible\n\tgithub.com/ghodss/yaml v1.0.0\n\tgithub.com/gofrs/flock v0.12.1\n\tgithub.com/google/go-containerregistry v0.20.2\n\tgithub.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240418155129-98dd3e91704f\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/gorilla/handlers v1.5.2\n\tgithub.com/gorilla/websocket v1.5.3\n\tgithub.com/joho/godotenv v1.5.1\n\tgithub.com/julienschmidt/httprouter v1.3.0\n\tgithub.com/loft-sh/agentapi/v4 v4.3.0-devpod.alpha.31\n\tgithub.com/loft-sh/analytics-client v0.0.0-20240219162240-2f4c64b2494e\n\tgithub.com/loft-sh/api/v4 v4.3.0-devpod.alpha.31\n\tgithub.com/loft-sh/apiserver v0.0.0-20250206205835-422f1d472459\n\tgithub.com/loft-sh/log v0.0.0-20250409101748-50124f882858\n\tgithub.com/loft-sh/programming-language-detection v0.0.5\n\tgithub.com/loft-sh/ssh v0.0.5\n\tgithub.com/mattn/go-isatty v0.0.20\n\tgithub.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d\n\tgithub.com/moby/buildkit v0.20.1\n\tgithub.com/moby/term v0.5.2\n\tgithub.com/onsi/ginkgo/v2 v2.21.0\n\tgithub.com/onsi/gomega v1.35.1\n\tgithub.com/otiai10/copy v1.7.0\n\tgithub.com/pkg/errors v0.9.1\n\tgithub.com/pkg/sftp v1.13.6\n\tgithub.com/ramr/go-reaper v0.2.3\n\tgithub.com/rhysd/go-github-selfupdate v1.2.3\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966\n\tgithub.com/spf13/cobra v1.8.1\n\tgithub.com/spf13/pflag v1.0.5\n\tgithub.com/takama/daemon v1.0.0\n\tgithub.com/tidwall/jsonc v0.3.2\n\tgolang.org/x/crypto v0.36.0\n\tgolang.org/x/sys v0.31.0\n\tgolang.org/x/term v0.30.0\n\tgoogle.golang.org/grpc v1.69.4\n\tgoogle.golang.org/protobuf v1.35.2\n\tgopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce\n\tgopkg.in/square/go-jose.v2 v2.6.0\n\tgopkg.in/yaml.v2 v2.4.0\n\tgotest.tools v2.2.0+incompatible\n\tk8s.io/api v0.32.1\n\tk8s.io/apimachinery v0.32.1\n\tk8s.io/client-go v0.32.1\n\tk8s.io/klog/v2 v2.130.1\n\tk8s.io/kube-aggregator v0.32.1\n\tk8s.io/kubectl v0.29.1\n\tk8s.io/utils v0.0.0-20241104100929-3ea5e8cea738\n\tmvdan.cc/sh/v3 v3.6.0\n\tsigs.k8s.io/controller-runtime v0.20.1\n\ttailscale.com v1.68.2\n)\n\nrequire (\n\tcel.dev/expr v0.18.0 // indirect\n\tcloud.google.com/go/compute/metadata v0.5.2 // indirect\n\tfilippo.io/edwards25519 v1.1.0 // indirect\n\tgithub.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect\n\tgithub.com/AlecAivazis/survey/v2 v2.3.7 // indirect\n\tgithub.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect\n\tgithub.com/Azure/go-autorest v14.2.0+incompatible // indirect\n\tgithub.com/Azure/go-autorest/autorest v0.11.29 // indirect\n\tgithub.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect\n\tgithub.com/Azure/go-autorest/autorest/azure/auth v0.5.12 // indirect\n\tgithub.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect\n\tgithub.com/Azure/go-autorest/autorest/date v0.3.0 // indirect\n\tgithub.com/Azure/go-autorest/logger v0.2.1 // indirect\n\tgithub.com/Azure/go-autorest/tracing v0.6.0 // indirect\n\tgithub.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect\n\tgithub.com/NYTimes/gziphandler v1.1.1 // indirect\n\tgithub.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect\n\tgithub.com/akutz/memconn v0.1.0 // indirect\n\tgithub.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect\n\tgithub.com/antlr4-go/antlr/v4 v4.13.1 // indirect\n\tgithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect\n\tgithub.com/atotto/clipboard v0.1.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2 v1.30.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/config v1.27.27 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect\n\tgithub.com/aws/smithy-go v1.20.3 // indirect\n\tgithub.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect\n\tgithub.com/beorn7/perks v1.0.1 // indirect\n\tgithub.com/bits-and-blooms/bitset v1.13.0 // indirect\n\tgithub.com/catppuccin/go v0.2.0 // indirect\n\tgithub.com/cenkalti/backoff/v4 v4.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/charmbracelet/bubbles v0.20.0 // indirect\n\tgithub.com/charmbracelet/bubbletea v1.1.0 // indirect\n\tgithub.com/charmbracelet/lipgloss v0.13.0 // indirect\n\tgithub.com/charmbracelet/x/ansi v0.2.3 // indirect\n\tgithub.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect\n\tgithub.com/charmbracelet/x/term v0.2.0 // indirect\n\tgithub.com/cilium/ebpf v0.16.0 // indirect\n\tgithub.com/coder/websocket v1.8.12 // indirect\n\tgithub.com/containerd/containerd/api v1.8.0 // indirect\n\tgithub.com/containerd/containerd/v2 v2.0.3 // indirect\n\tgithub.com/containerd/errdefs v1.0.0 // indirect\n\tgithub.com/containerd/errdefs/pkg v0.3.0 // indirect\n\tgithub.com/containerd/log v0.1.0 // indirect\n\tgithub.com/containerd/platforms v1.0.0-rc.1 // indirect\n\tgithub.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect\n\tgithub.com/containerd/ttrpc v1.2.7 // indirect\n\tgithub.com/containerd/typeurl/v2 v2.2.3 // indirect\n\tgithub.com/containers/storage v1.56.1 // indirect\n\tgithub.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect\n\tgithub.com/coreos/go-semver v0.3.1 // indirect\n\tgithub.com/coreos/go-systemd/v22 v22.5.0 // indirect\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect\n\tgithub.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect\n\tgithub.com/dimchansky/utfbom v1.1.1 // indirect\n\tgithub.com/dustin/go-humanize v1.0.1 // indirect\n\tgithub.com/emicklei/go-restful/v3 v3.12.1 // indirect\n\tgithub.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect\n\tgithub.com/evanphx/json-patch/v5 v5.9.0 // indirect\n\tgithub.com/felixge/httpsnoop v1.0.4 // indirect\n\tgithub.com/fsnotify/fsnotify v1.7.0 // indirect\n\tgithub.com/fxamacker/cbor/v2 v2.7.0 // indirect\n\tgithub.com/gaissmai/bart v0.11.1 // indirect\n\tgithub.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect\n\tgithub.com/go-ole/go-ole v1.3.0 // indirect\n\tgithub.com/go-openapi/jsonpointer v0.21.0 // indirect\n\tgithub.com/go-openapi/jsonreference v0.21.0 // indirect\n\tgithub.com/go-openapi/swag v0.23.0 // indirect\n\tgithub.com/go-task/slim-sprig/v3 v3.0.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.0.0 // indirect\n\tgithub.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect\n\tgithub.com/golang-jwt/jwt/v4 v4.5.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/google/btree v1.1.3 // indirect\n\tgithub.com/google/cel-go v0.22.0 // indirect\n\tgithub.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect\n\tgithub.com/google/go-github/v30 v30.1.0 // indirect\n\tgithub.com/google/go-querystring v1.0.0 // indirect\n\tgithub.com/google/gofuzz v1.2.0 // indirect\n\tgithub.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 // indirect\n\tgithub.com/gorilla/csrf v1.7.2 // indirect\n\tgithub.com/gorilla/securecookie v1.1.2 // indirect\n\tgithub.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect\n\tgithub.com/hashicorp/errwrap v1.1.0 // indirect\n\tgithub.com/hashicorp/go-cleanhttp v0.5.2 // indirect\n\tgithub.com/hashicorp/go-multierror v1.1.1 // indirect\n\tgithub.com/hdevalence/ed25519consensus v0.2.0 // indirect\n\tgithub.com/illarion/gonotify/v2 v2.0.3 // indirect\n\tgithub.com/in-toto/in-toto-golang v0.9.0 // indirect\n\tgithub.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect\n\tgithub.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 // indirect\n\tgithub.com/jmespath/go-jmespath v0.4.0 // indirect\n\tgithub.com/josharian/intern v1.0.0 // indirect\n\tgithub.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect\n\tgithub.com/jsimonetti/rtnetlink v1.4.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 // indirect\n\tgithub.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect\n\tgithub.com/kylelemons/godebug v1.1.0 // indirect\n\tgithub.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect\n\tgithub.com/loft-sh/admin-apis v0.0.0-20250221182517-7499d86167d2 // indirect\n\tgithub.com/lucasb-eyer/go-colorful v1.2.0 // indirect\n\tgithub.com/mailru/easyjson v0.7.7 // indirect\n\tgithub.com/mattn/go-localereader v0.0.1 // indirect\n\tgithub.com/mdlayher/genetlink v1.3.2 // indirect\n\tgithub.com/mdlayher/netlink v1.7.2 // indirect\n\tgithub.com/mdlayher/sdnotify v1.0.0 // indirect\n\tgithub.com/mdlayher/socket v0.5.0 // indirect\n\tgithub.com/miekg/dns v1.1.58 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/mitchellh/go-ps v1.0.0 // indirect\n\tgithub.com/mitchellh/go-wordwrap v1.0.1 // indirect\n\tgithub.com/mitchellh/hashstructure/v2 v2.0.2 // indirect\n\tgithub.com/moby/docker-image-spec v1.3.1 // indirect\n\tgithub.com/moby/locker v1.0.1 // indirect\n\tgithub.com/moby/spdystream v0.5.0 // indirect\n\tgithub.com/moby/sys/capability v0.3.0 // indirect\n\tgithub.com/moby/sys/mountinfo v0.7.2 // indirect\n\tgithub.com/moby/sys/user v0.3.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.2 // indirect\n\tgithub.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect\n\tgithub.com/muesli/cancelreader v0.2.2 // indirect\n\tgithub.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect\n\tgithub.com/olekukonko/tablewriter v0.0.5 // indirect\n\tgithub.com/opencontainers/image-spec v1.1.0 // indirect\n\tgithub.com/opencontainers/runtime-spec v1.2.0 // indirect\n\tgithub.com/pierrec/lz4/v4 v4.1.21 // indirect\n\tgithub.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect\n\tgithub.com/prometheus-community/pro-bing v0.4.0 // indirect\n\tgithub.com/prometheus/client_golang v1.20.5 // indirect\n\tgithub.com/prometheus/client_model v0.6.1 // indirect\n\tgithub.com/prometheus/common v0.60.0 // indirect\n\tgithub.com/prometheus/procfs v0.15.1 // indirect\n\tgithub.com/rivo/uniseg v0.4.7 // indirect\n\tgithub.com/safchain/ethtool v0.3.0 // indirect\n\tgithub.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect\n\tgithub.com/shibumi/go-pathspec v1.3.0 // indirect\n\tgithub.com/stoewer/go-strcase v1.3.0 // indirect\n\tgithub.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect\n\tgithub.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect\n\tgithub.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4 // indirect\n\tgithub.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect\n\tgithub.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect\n\tgithub.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect\n\tgithub.com/tailscale/peercred v0.0.0-20240214030740-b535050b2aa4 // indirect\n\tgithub.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1 // indirect\n\tgithub.com/tailscale/wireguard-go v0.0.0-20241113014420-4e883d38c8d3 // indirect\n\tgithub.com/tcnksm/go-gitconfig v0.1.2 // indirect\n\tgithub.com/tcnksm/go-httpstat v0.2.0 // indirect\n\tgithub.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect\n\tgithub.com/u-root/uio v0.0.0-20240118234441-a3c409a6018e // indirect\n\tgithub.com/ulikunitz/xz v0.5.12 // indirect\n\tgithub.com/vbatts/tar-split v0.11.6 // indirect\n\tgithub.com/vishvananda/netns v0.0.5 // indirect\n\tgithub.com/x448/float16 v0.8.4 // indirect\n\tgo.etcd.io/etcd/api/v3 v3.5.16 // indirect\n\tgo.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect\n\tgo.etcd.io/etcd/client/v3 v3.5.16 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.1.0 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect\n\tgo.opentelemetry.io/otel v1.33.0 // indirect\n\tgo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect\n\tgo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect\n\tgo.opentelemetry.io/otel/metric v1.33.0 // indirect\n\tgo.opentelemetry.io/otel/sdk v1.31.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.33.0 // indirect\n\tgo.opentelemetry.io/proto/otlp v1.3.1 // indirect\n\tgo.uber.org/multierr v1.11.0 // indirect\n\tgo.uber.org/zap v1.27.0 // indirect\n\tgo4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect\n\tgo4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect\n\tgolang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect\n\tgolang.org/x/mod v0.22.0 // indirect\n\tgolang.org/x/oauth2 v0.28.0 // indirect\n\tgolang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect\n\tgolang.zx2c4.com/wireguard/windows v0.5.3 // indirect\n\tgomodules.xyz/jsonpatch/v2 v2.4.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect\n\tgopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect\n\tgopkg.in/inf.v0 v0.9.1 // indirect\n\tgopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect\n\tgvisor.dev/gvisor v0.0.0-20240722211153-64c016c92987 // indirect\n\tk8s.io/apiextensions-apiserver v0.32.1 // indirect\n\tk8s.io/apiserver v0.32.1 // indirect\n\tk8s.io/cli-runtime v0.29.1 // indirect\n\tk8s.io/component-base v0.32.1 // indirect\n\tk8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect\n\tk8s.io/metrics v0.32.1 // indirect\n\tsigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect\n\tsigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect\n\tsigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect\n\tsigs.k8s.io/yaml v1.4.0 // indirect\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/Microsoft/go-winio v0.6.2 // indirect\n\tgithub.com/PaesslerAG/gval v1.0.0 // indirect\n\tgithub.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect\n\tgithub.com/containerd/console v1.0.4 // indirect\n\tgithub.com/containerd/continuity v0.4.5 // indirect\n\tgithub.com/denisbrodbeck/machineid v1.0.1\n\tgithub.com/docker/distribution v2.8.3+incompatible // indirect\n\tgithub.com/docker/docker-credential-helpers v0.8.2 // indirect\n\tgithub.com/docker/go-units v0.5.0 // indirect\n\tgithub.com/go-logr/logr v1.4.2\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/gogo/protobuf v1.3.2 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/google/go-cmp v0.6.0\n\tgithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect\n\tgithub.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect\n\tgithub.com/klauspost/compress v1.17.11 // indirect\n\tgithub.com/kr/fs v0.1.0 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-runewidth v0.0.16 // indirect\n\tgithub.com/mattn/go-shellwords v1.0.12 // indirect\n\tgithub.com/moby/patternmatcher v0.6.0\n\tgithub.com/moby/sys/signal v0.7.1 // indirect\n\tgithub.com/morikuni/aec v1.0.0 // indirect\n\tgithub.com/opencontainers/go-digest v1.0.0 // indirect\n\tgithub.com/tonistiigi/fsutil v0.0.0-20250113203817-b14e27f4135a\n\tgithub.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect\n\tgithub.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect\n\tgithub.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect\n\tgithub.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect\n\tgithub.com/xeipuuv/gojsonschema v1.2.0 // indirect\n\tgolang.org/x/net v0.37.0 // indirect\n\tgolang.org/x/sync v0.12.0 // indirect\n\tgolang.org/x/text v0.23.0 // indirect\n\tgolang.org/x/time v0.9.0 // indirect\n\tgolang.org/x/tools v0.29.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n\nreplace tailscale.com => github.com/loft-sh/tailscale v1.78.1-loft.8\n"
  },
  {
    "path": "go.sum",
    "content": "cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo=\ncel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=\ncloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo=\ncloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=\nfilippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=\nfilippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=\nfilippo.io/mkcert v1.4.4 h1:8eVbbwfVlaqUM7OwuftKc2nuYOoTDQWqsoXmzoXZdbc=\nfilippo.io/mkcert v1.4.4/go.mod h1:VyvOchVuAye3BoUsPUOOofKygVwLV2KQMVFJNRq+1dA=\ngithub.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=\ngithub.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=\ngithub.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 h1:dIScnXFlF784X79oi7MzVT6GWqr/W1uUt0pB5CsDs9M=\ngithub.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2/go.mod h1:gCLVsLfv1egrcZu+GoJATN5ts75F2s62ih/457eWzOw=\ngithub.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=\ngithub.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=\ngithub.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU=\ngithub.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=\ngithub.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=\ngithub.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc=\ngithub.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw=\ngithub.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs=\ngithub.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=\ngithub.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk=\ngithub.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8=\ngithub.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c=\ngithub.com/Azure/go-autorest/autorest/azure/auth v0.5.12 h1:wkAZRgT/pn8HhFyzfe9UnqOjJYqlembgCTi72Bm/xKk=\ngithub.com/Azure/go-autorest/autorest/azure/auth v0.5.12/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg=\ngithub.com/Azure/go-autorest/autorest/azure/cli v0.4.5/go.mod h1:ADQAXrkgm7acgWVUNamOgh8YNrv4p27l3Wc55oVfpzg=\ngithub.com/Azure/go-autorest/autorest/azure/cli v0.4.6 h1:w77/uPk80ZET2F+AfQExZyEWtn+0Rk/uw17m9fv5Ajc=\ngithub.com/Azure/go-autorest/autorest/azure/cli v0.4.6/go.mod h1:piCfgPho7BiIDdEQ1+g4VmKyD5y+p/XtSNqE6Hc4QD0=\ngithub.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=\ngithub.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=\ngithub.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=\ngithub.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw=\ngithub.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU=\ngithub.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=\ngithub.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=\ngithub.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=\ngithub.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=\ngithub.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=\ngithub.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=\ngithub.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=\ngithub.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=\ngithub.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=\ngithub.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=\ngithub.com/Microsoft/hcsshim v0.12.9 h1:2zJy5KA+l0loz1HzEGqyNnjd3fyZA31ZBCGKacp6lLg=\ngithub.com/Microsoft/hcsshim v0.12.9/go.mod h1:fJ0gkFAna6ukt0bLdKB8djt4XIJhF/vEPuoIWYVvZ8Y=\ngithub.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=\ngithub.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=\ngithub.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=\ngithub.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=\ngithub.com/PaesslerAG/gval v1.0.0 h1:GEKnRwkWDdf9dOmKcNrar9EA1bz1z9DqPIO1+iLzhd8=\ngithub.com/PaesslerAG/gval v1.0.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I=\ngithub.com/PaesslerAG/jsonpath v0.1.0/go.mod h1:4BzmtoM/PI8fPO4aQGIusjGxGir2BzcV0grWtFzq1Y8=\ngithub.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk=\ngithub.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY=\ngithub.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=\ngithub.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=\ngithub.com/akutz/memconn v0.1.0 h1:NawI0TORU4hcOMsMr11g7vwlCdkYeLKXBcxWu2W/P8A=\ngithub.com/akutz/memconn v0.1.0/go.mod h1:Jo8rI7m0NieZyLI5e2CDlRdRqRRB4S7Xp77ukDjH+Fw=\ngithub.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0=\ngithub.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30=\ngithub.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=\ngithub.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=\ngithub.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=\ngithub.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=\ngithub.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=\ngithub.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=\ngithub.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=\ngithub.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=\ngithub.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=\ngithub.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=\ngithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=\ngithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=\ngithub.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=\ngithub.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=\ngithub.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=\ngithub.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=\ngithub.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=\ngithub.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4=\ngithub.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=\ngithub.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=\ngithub.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 h1:wlTgmb/sCmVRJrN5De3CiHj4v/bTCgL5+qpdEd0CPtw=\ngithub.com/aws/aws-sdk-go-v2/service/ecr v1.18.11/go.mod h1:Ce1q2jlNm8BVpjLaOnwnm5v2RClAbK6txwPljFzyW6c=\ngithub.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 h1:yflJrGmi1pXtP9lOpOeaNZyc0vXnJTuP2sor3nJcGGo=\ngithub.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2/go.mod h1:uHtRE7aqXNmpeYL+7Ec7LacH5zC9+w2T5MBOeEKDdu0=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII=\ngithub.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 h1:a8HvP/+ew3tKwSXqL3BCSjiuicr+XTU2eFYeogV9GJE=\ngithub.com/aws/aws-sdk-go-v2/service/ssm v1.44.7/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=\ngithub.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=\ngithub.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE=\ngithub.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=\ngithub.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7 h1:G5IT+PEpFY0CDb3oITDP9tkmLrHkVD8Ny+elUmBqVYI=\ngithub.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7/go.mod h1:VVALgT1UESBh91dY0GprHnT1Z7mKd96VDk8qVy+bmu0=\ngithub.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=\ngithub.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=\ngithub.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=\ngithub.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=\ngithub.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=\ngithub.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=\ngithub.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=\ngithub.com/bmatcuk/doublestar/v4 v4.6.0 h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=\ngithub.com/bmatcuk/doublestar/v4 v4.6.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=\ngithub.com/catppuccin/go v0.2.0 h1:ktBeIrIP42b/8FGiScP9sgrWOss3lw0Z5SktRoithGA=\ngithub.com/catppuccin/go v0.2.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc=\ngithub.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=\ngithub.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE=\ngithub.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU=\ngithub.com/charmbracelet/bubbletea v1.1.0 h1:FjAl9eAL3HBCHenhz/ZPjkKdScmaS5SK69JAK2YJK9c=\ngithub.com/charmbracelet/bubbletea v1.1.0/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4=\ngithub.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8=\ngithub.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU=\ngithub.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw=\ngithub.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY=\ngithub.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY=\ngithub.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=\ngithub.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4=\ngithub.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=\ngithub.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0=\ngithub.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0=\ngithub.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 h1:krfRl01rzPzxSxyLyrChD+U+MzsBXbm0OwYYB67uF+4=\ngithub.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589/go.mod h1:OuDyvmLnMCwa2ep4Jkm6nyA0ocJuZlGyk2gGseVzERM=\ngithub.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok=\ngithub.com/cilium/ebpf v0.16.0/go.mod h1:L7u2Blt2jMM/vLAVgjxluxtBKlz3/GWjB0dMOEngfwE=\ngithub.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=\ngithub.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=\ngithub.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=\ngithub.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=\ngithub.com/compose-spec/compose-go/v2 v2.2.0 h1:VsQosGhuO+H9wh5laiIiAe4TVd73kQ5NWwmNrdm0HRA=\ngithub.com/compose-spec/compose-go/v2 v2.2.0/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=\ngithub.com/containerd/cgroups v1.0.1 h1:iJnMvco9XGvKUvNQkv88bE4uJXxRQH18efbKo9w5vHQ=\ngithub.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=\ngithub.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=\ngithub.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=\ngithub.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=\ngithub.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0=\ngithub.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc=\ngithub.com/containerd/containerd/v2 v2.0.3 h1:zBKgwgZsuu+LPCMzCLgA4sC4MiZzZ59ZT31XkmiISQM=\ngithub.com/containerd/containerd/v2 v2.0.3/go.mod h1:5j9QUUaV/cy9ZeAx4S+8n9ffpf+iYnEj4jiExgcbuLY=\ngithub.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4=\ngithub.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE=\ngithub.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=\ngithub.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=\ngithub.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=\ngithub.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=\ngithub.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=\ngithub.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=\ngithub.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=\ngithub.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=\ngithub.com/containerd/nydus-snapshotter v0.15.0 h1:RqZRs1GPeM6T3wmuxJV9u+2Rg4YETVMwTmiDeX+iWC8=\ngithub.com/containerd/nydus-snapshotter v0.15.0/go.mod h1:biq0ijpeZe0I5yZFSJyHzFSjjRZQ7P7y/OuHyd7hYOw=\ngithub.com/containerd/platforms v1.0.0-rc.1 h1:83KIq4yy1erSRgOVHNk1HYdPvzdJ5CnsWaRoJX4C41E=\ngithub.com/containerd/platforms v1.0.0-rc.1/go.mod h1:J71L7B+aiM5SdIEqmd9wp6THLVRzJGXfNuWCZCllLA4=\ngithub.com/containerd/plugin v1.0.0 h1:c8Kf1TNl6+e2TtMHZt+39yAPDbouRH9WAToRjex483Y=\ngithub.com/containerd/plugin v1.0.0/go.mod h1:hQfJe5nmWfImiqT1q8Si3jLv3ynMUIBB47bQ+KexvO8=\ngithub.com/containerd/stargz-snapshotter/estargz v0.16.3 h1:7evrXtoh1mSbGj/pfRccTampEyKpjpOnS3CyiV1Ebr8=\ngithub.com/containerd/stargz-snapshotter/estargz v0.16.3/go.mod h1:uyr4BfYfOj3G9WBVE8cOlQmXAbPN9VEQpBBeJIuOipU=\ngithub.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ=\ngithub.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o=\ngithub.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40=\ngithub.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk=\ngithub.com/containers/image/v5 v5.33.1 h1:nTWKwxAlY0aJrilvvhssqssJVnley6VqxkLiLzTEYIs=\ngithub.com/containers/image/v5 v5.33.1/go.mod h1:/FJiLlvVbeBxWNMPVPPIWJxHTAzwBoFvyN0a51zo1CE=\ngithub.com/containers/storage v1.56.1 h1:gDZj/S6Zxus4Xx42X6iNB3ODXuh0qoOdH/BABfrvcKo=\ngithub.com/containers/storage v1.56.1/go.mod h1:c6WKowcAlED/DkWGNuL9bvGYqIWCVy7isRMdCSKWNjk=\ngithub.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 h1:8h5+bWd7R6AYUslN6c6iuZWTKsKxUFDlpnmilO6R2n0=\ngithub.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=\ngithub.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=\ngithub.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=\ngithub.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=\ngithub.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=\ngithub.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/creack/pty v1.1.23 h1:4M6+isWdcStXEf15G/RbrMPOQj1dZ7HPZCGwE4kOeP0=\ngithub.com/creack/pty v1.1.23/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=\ngithub.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa h1:h8TfIT1xc8FWbwwpmHn1J5i43Y0uZP97GqasGCzSRJk=\ngithub.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa/go.mod h1:Nx87SkVqTKd8UtT+xu7sM/l+LgXs6c0aHrlKusR+2EQ=\ngithub.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=\ngithub.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=\ngithub.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e h1:vUmf0yezR0y7jJ5pceLHthLaYf4bA5T14B6q39S4q2Q=\ngithub.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e/go.mod h1:YTIHhz/QFSYnu/EhlF2SpU2Uk+32abacUYA5ZPljz1A=\ngithub.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=\ngithub.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=\ngithub.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=\ngithub.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=\ngithub.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=\ngithub.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0=\ngithub.com/docker/cli v27.5.1+incompatible h1:JB9cieUT9YNiMITtIsguaN55PLOHhBSz3LKVc6cqWaY=\ngithub.com/docker/cli v27.5.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=\ngithub.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=\ngithub.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=\ngithub.com/docker/docker v27.5.1+incompatible h1:4PYU5dnBYqRQi0294d1FBECqT9ECWeQAIfE8q4YnPY8=\ngithub.com/docker/docker v27.5.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=\ngithub.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=\ngithub.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=\ngithub.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=\ngithub.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=\ngithub.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=\ngithub.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=\ngithub.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=\ngithub.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=\ngithub.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=\ngithub.com/dsnet/try v0.0.3 h1:ptR59SsrcFUYbT/FhAbKTV6iLkeD6O18qfIWRml2fqI=\ngithub.com/dsnet/try v0.0.3/go.mod h1:WBM8tRpUmnXXhY1U6/S8dt6UWdHTQ7y8A5YSkRCkq40=\ngithub.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=\ngithub.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=\ngithub.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=\ngithub.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=\ngithub.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=\ngithub.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=\ngithub.com/evanphx/json-patch v5.8.1+incompatible h1:2toJaoe7/rNa1zpeQx0UnVEjqk6z2ecyA20V/zg8vTU=\ngithub.com/evanphx/json-patch v5.8.1+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=\ngithub.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=\ngithub.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=\ngithub.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=\ngithub.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=\ngithub.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=\ngithub.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=\ngithub.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=\ngithub.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=\ngithub.com/gaissmai/bart v0.11.1 h1:5Uv5XwsaFBRo4E5VBcb9TzY8B7zxFf+U7isDxqOrRfc=\ngithub.com/gaissmai/bart v0.11.1/go.mod h1:KHeYECXQiBjTzQz/om2tqn3sZF1J7hw9m6z41ftj3fg=\ngithub.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=\ngithub.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=\ngithub.com/github/fakeca v0.1.0 h1:Km/MVOFvclqxPM9dZBC4+QE564nU4gz4iZ0D9pMw28I=\ngithub.com/github/fakeca v0.1.0/go.mod h1:+bormgoGMMuamOscx7N91aOuUST7wdaJ2rNjeohylyo=\ngithub.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 h1:ymLjT4f35nQbASLnvxEde4XOBL+Sn7rFuV+FOJqkljg=\ngithub.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0/go.mod h1:6daplAwHHGbUGib4990V3Il26O0OC4aRyvewaaAihaA=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=\ngithub.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=\ngithub.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=\ngithub.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=\ngithub.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=\ngithub.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=\ngithub.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=\ngithub.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=\ngithub.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=\ngithub.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=\ngithub.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=\ngithub.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=\ngithub.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=\ngithub.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=\ngithub.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=\ngithub.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg=\ngithub.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU=\ngithub.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=\ngithub.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=\ngithub.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=\ngithub.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=\ngithub.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=\ngithub.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=\ngithub.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=\ngithub.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=\ngithub.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=\ngithub.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=\ngithub.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=\ngithub.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=\ngithub.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g=\ngithub.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8=\ngithub.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU=\ngithub.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M=\ngithub.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo=\ngithub.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8=\ngithub.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240418155129-98dd3e91704f h1:yvqkwgo5+YJNRSpaCwo1GbEdYlJAnkWVYVb0oInLc9s=\ngithub.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240418155129-98dd3e91704f/go.mod h1:8oYKXummIO/NNasXRCKr4DBziuA1MZ+VEhSQMYI8aJ0=\ngithub.com/google/go-github/v30 v30.1.0 h1:VLDx+UolQICEOKu2m4uAoMti1SxuEBAl7RSEG16L+Oo=\ngithub.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8=\ngithub.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=\ngithub.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=\ngithub.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 h1:wG8RYIyctLhdFk6Vl1yPGtSRtwGpVkWyZww1OCil2MI=\ngithub.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806/go.mod h1:Beg6V6zZ3oEn0JuiUQ4wqwuyqqzasOltcoXPtgLbFp4=\ngithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=\ngithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=\ngithub.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=\ngithub.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/gorilla/csrf v1.7.2 h1:oTUjx0vyf2T+wkrx09Trsev1TE+/EbDAeHtSTbtC2eI=\ngithub.com/gorilla/csrf v1.7.2/go.mod h1:F1Fj3KG23WYHE6gozCmBAezKookxbIvUJT+121wTuLk=\ngithub.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=\ngithub.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=\ngithub.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=\ngithub.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=\ngithub.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA=\ngithub.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=\ngithub.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=\ngithub.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=\ngithub.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=\ngithub.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=\ngithub.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=\ngithub.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=\ngithub.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=\ngithub.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=\ngithub.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=\ngithub.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=\ngithub.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=\ngithub.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU=\ngithub.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo=\ngithub.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=\ngithub.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=\ngithub.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=\ngithub.com/illarion/gonotify/v2 v2.0.3 h1:B6+SKPo/0Sw8cRJh1aLzNEeNVFfzE3c6N+o+vyxM+9A=\ngithub.com/illarion/gonotify/v2 v2.0.3/go.mod h1:38oIJTgFqupkEydkkClkbL6i5lXV/bxdH9do5TALPEE=\ngithub.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU=\ngithub.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo=\ngithub.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8=\ngithub.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 h1:9K06NfxkBh25x56yVhWWlKFE8YpicaSfHwoV8SFbueA=\ngithub.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2/go.mod h1:3A9PQ1cunSDF/1rbTq99Ts4pVnycWg+vlPkfeD2NLFI=\ngithub.com/jellydator/ttlcache/v3 v3.1.0 h1:0gPFG0IHHP6xyUyXq+JaD8fwkDCqgqwohXNJBcYE71g=\ngithub.com/jellydator/ttlcache/v3 v3.1.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4=\ngithub.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=\ngithub.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=\ngithub.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=\ngithub.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=\ngithub.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=\ngithub.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=\ngithub.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=\ngithub.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=\ngithub.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=\ngithub.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk=\ngithub.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86/go.mod h1:aFAMtuldEgx/4q7iSGazk22+IcgvtiC+HIimFO9XlS8=\ngithub.com/jsimonetti/rtnetlink v1.4.0 h1:Z1BF0fRgcETPEa0Kt0MRk3yV5+kF1FWTni6KUFKrq2I=\ngithub.com/jsimonetti/rtnetlink v1.4.0/go.mod h1:5W1jDvWdnthFJ7fxYX1GMK07BUpI4oskfOqvPteYS6E=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=\ngithub.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=\ngithub.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 h1:qGQQKEcAR99REcMpsXCp3lJ03zYT1PkRd3kQGPn9GVg=\ngithub.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=\ngithub.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=\ngithub.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=\ngithub.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=\ngithub.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=\ngithub.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=\ngithub.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=\ngithub.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a h1:+RR6SqnTkDLWyICxS1xpjCi/3dhyV+TgZwA6Ww3KncQ=\ngithub.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a/go.mod h1:YTtCCM3ryyfiu4F7t8HQ1mxvp1UBdWM2r6Xa+nGWvDk=\ngithub.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=\ngithub.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=\ngithub.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=\ngithub.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=\ngithub.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=\ngithub.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=\ngithub.com/loft-sh/admin-apis v0.0.0-20250221182517-7499d86167d2 h1:om1MqUdW84ZQc0GMGGgFfPI6xpTbrF+6DwKVq+76R44=\ngithub.com/loft-sh/admin-apis v0.0.0-20250221182517-7499d86167d2/go.mod h1:WHCqWfljfD1hkwk41hLeqBhW2yeLvWipB1sH6vfnR7U=\ngithub.com/loft-sh/agentapi/v4 v4.3.0-devpod.alpha.29 h1:AAbhuBMm6ZV3OXSx8VXqCqQ9o/mOl6Hh425qZsGNUqw=\ngithub.com/loft-sh/agentapi/v4 v4.3.0-devpod.alpha.29/go.mod h1:zkceRmB+KkkhDMHUQO1sQdcNfF2EPxl+RsSIEOAN/R8=\ngithub.com/loft-sh/agentapi/v4 v4.3.0-devpod.alpha.31 h1://tt9YAWfcCydJ5d991rsYin+KxzqNC3U6S8mEN882o=\ngithub.com/loft-sh/agentapi/v4 v4.3.0-devpod.alpha.31/go.mod h1:zkceRmB+KkkhDMHUQO1sQdcNfF2EPxl+RsSIEOAN/R8=\ngithub.com/loft-sh/analytics-client v0.0.0-20240219162240-2f4c64b2494e h1:JcPnMaoczikvpasi8OJ47dCkWZjfgFubWa4V2SZo7h0=\ngithub.com/loft-sh/analytics-client v0.0.0-20240219162240-2f4c64b2494e/go.mod h1:FFWcGASyM2QlWTDTCG/WBVM/XYr8btqYt335TFNRCFg=\ngithub.com/loft-sh/api/v4 v4.3.0-devpod.alpha.29 h1:0xlQGAMwluhI6UbiDarKT21v5j/AULpxpDADdPzDxxI=\ngithub.com/loft-sh/api/v4 v4.3.0-devpod.alpha.29/go.mod h1:X1ho9aS6qCBMSOtIvRfjVa5htDO5UDlYyDUAKpvtY+k=\ngithub.com/loft-sh/api/v4 v4.3.0-devpod.alpha.31 h1:H2k4Qi7zWloBQmD6fepUaZOpzmv6A7WxAWtDOdzrQC0=\ngithub.com/loft-sh/api/v4 v4.3.0-devpod.alpha.31/go.mod h1:qBNf6+sIg2XNYdBWe2c16C1gjDcrKZ88sGd76oYT3Jg=\ngithub.com/loft-sh/apiserver v0.0.0-20250206205835-422f1d472459 h1:6SrgBtT1S9ANsQMoO/O0Mq+hs9EbC5te5kPqOBfg5UI=\ngithub.com/loft-sh/apiserver v0.0.0-20250206205835-422f1d472459/go.mod h1:rung3jsKjaVAtykQN0vWmFHhx2A/umpRyAae8BJVSeE=\ngithub.com/loft-sh/log v0.0.0-20250409101748-50124f882858 h1:MKlp3CvzXqd+a2plptpE/bKcVMb8t/7BrEuy6Yqmnaw=\ngithub.com/loft-sh/log v0.0.0-20250409101748-50124f882858/go.mod h1:YImeRjXH34Yf5E79T7UHBQpDZl9fIaaFRgyZ/bkY+UQ=\ngithub.com/loft-sh/programming-language-detection v0.0.5 h1:XiWlxtrf4t6Z7SQiob0JMKaCeMHCP3kWhB80wLt+EMY=\ngithub.com/loft-sh/programming-language-detection v0.0.5/go.mod h1:QGPQGKr9q1+rQS4OyisS5CPGY1a76SdNaZuk9oy+2cE=\ngithub.com/loft-sh/ssh v0.0.5 h1:CmLfBrbekAZmYhpS+urhqmUZW1XU9kUo2bi4lJiUFH8=\ngithub.com/loft-sh/ssh v0.0.5/go.mod h1:jgAfPSNioyL2wdFesXY5Wi4pYpdNo4u7AzworofHeyU=\ngithub.com/loft-sh/tailscale v1.78.1-loft.8 h1:7eA3EGetH9dGo6uy6uGkWyxr7cX70WLmC2m8/AASyMc=\ngithub.com/loft-sh/tailscale v1.78.1-loft.8/go.mod h1:u/vvqy1cqBer179jxNgPN3qN8YBMGzw+5bPo66z6yHo=\ngithub.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=\ngithub.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=\ngithub.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=\ngithub.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=\ngithub.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=\ngithub.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\ngithub.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=\ngithub.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=\ngithub.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=\ngithub.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=\ngithub.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=\ngithub.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=\ngithub.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=\ngithub.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=\ngithub.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=\ngithub.com/mdlayher/genetlink v1.3.2 h1:KdrNKe+CTu+IbZnm/GVUMXSqBBLqcGpRDa0xkQy56gw=\ngithub.com/mdlayher/genetlink v1.3.2/go.mod h1:tcC3pkCrPUGIKKsCsp0B3AdaaKuHtaxoJRz3cc+528o=\ngithub.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g=\ngithub.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw=\ngithub.com/mdlayher/sdnotify v1.0.0 h1:Ma9XeLVN/l0qpyx1tNeMSeTjCPH6NtuD6/N9XdTlQ3c=\ngithub.com/mdlayher/sdnotify v1.0.0/go.mod h1:HQUmpM4XgYkhDLtd+Uad8ZFK1T9D5+pNxnXQjCeJlGE=\ngithub.com/mdlayher/socket v0.5.0 h1:ilICZmJcQz70vrWVes1MFera4jGiWNocSkykwwoy3XI=\ngithub.com/mdlayher/socket v0.5.0/go.mod h1:WkcBFfvyG8QENs5+hfQPl1X6Jpd2yeLIYgrGFmJiJxI=\ngithub.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=\ngithub.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=\ngithub.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=\ngithub.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=\ngithub.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY=\ngithub.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=\ngithub.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=\ngithub.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=\ngithub.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=\ngithub.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=\ngithub.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=\ngithub.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=\ngithub.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=\ngithub.com/moby/buildkit v0.20.1 h1:sT0ZXhhNo5rVbMcYfgttma3TdUHfO5JjFA0UAL8p9fY=\ngithub.com/moby/buildkit v0.20.1/go.mod h1:Rq9nB/fJImdk6QeM0niKtOHJqwKeYMrK847hTTDVuA4=\ngithub.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=\ngithub.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=\ngithub.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=\ngithub.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=\ngithub.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=\ngithub.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=\ngithub.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=\ngithub.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=\ngithub.com/moby/sys/capability v0.3.0 h1:kEP+y6te0gEXIaeQhIi0s7vKs/w0RPoH1qPa6jROcVg=\ngithub.com/moby/sys/capability v0.3.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=\ngithub.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=\ngithub.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=\ngithub.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=\ngithub.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=\ngithub.com/moby/sys/signal v0.7.1 h1:PrQxdvxcGijdo6UXXo/lU/TvHUWyPhj7UOpSo8tuvk0=\ngithub.com/moby/sys/signal v0.7.1/go.mod h1:Se1VGehYokAkrSQwL4tDzHvETwUZlnY7S5XtQ50mQp8=\ngithub.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=\ngithub.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=\ngithub.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=\ngithub.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=\ngithub.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=\ngithub.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=\ngithub.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=\ngithub.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=\ngithub.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=\ngithub.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a h1:2MaM6YC3mGu54x+RKAA6JiFFHlHDY1UbkxqppT7wYOg=\ngithub.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a/go.mod h1:hxSnBBYLK21Vtq/PHd0S2FYCxBXzBua8ov5s1RobyRQ=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=\ngithub.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=\ngithub.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=\ngithub.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=\ngithub.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=\ngithub.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=\ngithub.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=\ngithub.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=\ngithub.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=\ngithub.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=\ngithub.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=\ngithub.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=\ngithub.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=\ngithub.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=\ngithub.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=\ngithub.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=\ngithub.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=\ngithub.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=\ngithub.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jDMcgULaH8=\ngithub.com/opencontainers/selinux v1.11.1/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=\ngithub.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=\ngithub.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U=\ngithub.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=\ngithub.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=\ngithub.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=\ngithub.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI=\ngithub.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=\ngithub.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=\ngithub.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=\ngithub.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=\ngithub.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=\ngithub.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=\ngithub.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=\ngithub.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=\ngithub.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/prometheus-community/pro-bing v0.4.0 h1:YMbv+i08gQz97OZZBwLyvmmQEEzyfyrrjEaAchdy3R4=\ngithub.com/prometheus-community/pro-bing v0.4.0/go.mod h1:b7wRYZtCcPmt4Sz319BykUU241rWLe1VFXyiyWK/dH4=\ngithub.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=\ngithub.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=\ngithub.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=\ngithub.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=\ngithub.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA=\ngithub.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=\ngithub.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=\ngithub.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=\ngithub.com/ramr/go-reaper v0.2.3 h1:2dSj+5SaIiWr6Lzaq2J7Fok0vUuF4zK1AmsE6iuxyao=\ngithub.com/ramr/go-reaper v0.2.3/go.mod h1:bgru3llkYWSj8qb6akpA0sh0pq468OQ5wqvFT3BFHsE=\ngithub.com/rhysd/go-github-selfupdate v1.2.3 h1:iaa+J202f+Nc+A8zi75uccC8Wg3omaM7HDeimXA22Ag=\ngithub.com/rhysd/go-github-selfupdate v1.2.3/go.mod h1:mp/N8zj6jFfBQy/XMYoWsmfzxazpPAODuqarmPDe2Rg=\ngithub.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=\ngithub.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=\ngithub.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=\ngithub.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=\ngithub.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=\ngithub.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=\ngithub.com/safchain/ethtool v0.3.0/go.mod h1:SA9BwrgyAqNo7M+uaL6IYbxpm5wk3L7Mm6ocLW+CJUs=\ngithub.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=\ngithub.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU=\ngithub.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=\ngithub.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=\ngithub.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=\ngithub.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=\ngithub.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=\ngithub.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=\ngithub.com/spdx/tools-golang v0.5.3 h1:ialnHeEYUC4+hkm5vJm4qz2x+oEJbS0mAMFrNXdQraY=\ngithub.com/spdx/tools-golang v0.5.3/go.mod h1:/ETOahiAo96Ob0/RAIBmFZw6XN0yTnyr/uFZm2NTMhI=\ngithub.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=\ngithub.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=\ngithub.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=\ngithub.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=\ngithub.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=\ngithub.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=\ngithub.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e h1:PtWT87weP5LWHEY//SWsYkSO3RWRZo4OSWagh3YD2vQ=\ngithub.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e/go.mod h1:XrBNfAFN+pwoWuksbFS9Ccxnopa15zJGgXRFN90l3K4=\ngithub.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 h1:Gzfnfk2TWrk8Jj4P4c1a3CtQyMaTVCznlkLZI++hok4=\ngithub.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55/go.mod h1:4k4QO+dQ3R5FofL+SanAUZe+/QfeK0+OIuwDIRu2vSg=\ngithub.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4 h1:rXZGgEa+k2vJM8xT0PoSKfVXwFGPQ3z3CJfmnHJkZZw=\ngithub.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4/go.mod h1:ikbF+YT089eInTp9f2vmvy4+ZVnW5hzX1q2WknxSprQ=\ngithub.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 h1:4chzWmimtJPxRs2O36yuGRW3f9SYV+bMTTvMBI0EKio=\ngithub.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05/go.mod h1:PdCqy9JzfWMJf1H5UJW2ip33/d4YkoKN0r67yKH1mG8=\ngithub.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a h1:SJy1Pu0eH1C29XwJucQo73FrleVK6t4kYz4NVhp34Yw=\ngithub.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a/go.mod h1:DFSS3NAGHthKo1gTlmEcSBiZrRJXi28rLNd/1udP1c8=\ngithub.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 h1:uFsXVBE9Qr4ZoF094vE6iYTLDl0qCiKzYXlL6UeWObU=\ngithub.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7/go.mod h1:NzVQi3Mleb+qzq8VmcWpSkcSYxXIg0DkI6XDzpVkhJ0=\ngithub.com/tailscale/peercred v0.0.0-20240214030740-b535050b2aa4 h1:Gz0rz40FvFVLTBk/K8UNAenb36EbDSnh+q7Z9ldcC8w=\ngithub.com/tailscale/peercred v0.0.0-20240214030740-b535050b2aa4/go.mod h1:phI29ccmHQBc+wvroosENp1IF9195449VDnFDhJ4rJU=\ngithub.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1 h1:tdUdyPqJ0C97SJfjB9tW6EylTtreyee9C44de+UBG0g=\ngithub.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1/go.mod h1:agQPE6y6ldqCOui2gkIh7ZMztTkIQKH049tv8siLuNQ=\ngithub.com/tailscale/wf v0.0.0-20240214030419-6fbb0a674ee6 h1:l10Gi6w9jxvinoiq15g8OToDdASBni4CyJOdHY1Hr8M=\ngithub.com/tailscale/wf v0.0.0-20240214030419-6fbb0a674ee6/go.mod h1:ZXRML051h7o4OcI0d3AaILDIad/Xw0IkXaHM17dic1Y=\ngithub.com/tailscale/wireguard-go v0.0.0-20241113014420-4e883d38c8d3 h1:dmoPb3dG27tZgMtrvqfD/LW4w7gA6BSWl8prCPNmkCQ=\ngithub.com/tailscale/wireguard-go v0.0.0-20241113014420-4e883d38c8d3/go.mod h1:BOm5fXUBFM+m9woLNBoxI9TaBXXhGNP50LX/TGIvGb4=\ngithub.com/tailscale/xnet v0.0.0-20240729143630-8497ac4dab2e h1:zOGKqN5D5hHhiYUp091JqK7DPCqSARyUfduhGUY8Bek=\ngithub.com/tailscale/xnet v0.0.0-20240729143630-8497ac4dab2e/go.mod h1:orPd6JZXXRyuDusYilywte7k094d7dycXXU5YnWsrwg=\ngithub.com/takama/daemon v1.0.0 h1:XS3VLnFKmqw2Z7fQ/dHRarrVjdir9G3z7BEP8osjizQ=\ngithub.com/takama/daemon v1.0.0/go.mod h1:gKlhcjbqtBODg5v9H1nj5dU1a2j2GemtuWSNLD5rxOE=\ngithub.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA=\ngithub.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk=\ngithub.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw=\ngithub.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE=\ngithub.com/tcnksm/go-httpstat v0.2.0 h1:rP7T5e5U2HfmOBmZzGgGZjBQ5/GluWUylujl0tJ04I0=\ngithub.com/tcnksm/go-httpstat v0.2.0/go.mod h1:s3JVJFtQxtBEBC9dwcdTTXS9xFnM3SXAZwPG41aurT8=\ngithub.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc=\ngithub.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uSFCyJE=\ngithub.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=\ngithub.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=\ngithub.com/tonistiigi/fsutil v0.0.0-20250113203817-b14e27f4135a h1:EfGw4G0x/8qXWgtcZ6KVaPS+wpWOQMaypczzP8ojkMY=\ngithub.com/tonistiigi/fsutil v0.0.0-20250113203817-b14e27f4135a/go.mod h1:Dl/9oEjK7IqnjAm21Okx/XIxUCFJzvh+XdVHUlBwXTw=\ngithub.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 h1:7I5c2Ig/5FgqkYOh/N87NzoyI9U15qUPXhDD8uCupv8=\ngithub.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE=\ngithub.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=\ngithub.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=\ngithub.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab h1:H6aJ0yKQ0gF49Qb2z5hI1UHxSQt4JMyxebFR15KnApw=\ngithub.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=\ngithub.com/u-root/u-root v0.12.0 h1:K0AuBFriwr0w/PGS3HawiAw89e3+MU7ks80GpghAsNs=\ngithub.com/u-root/u-root v0.12.0/go.mod h1:FYjTOh4IkIZHhjsd17lb8nYW6udgXdJhG1c0r6u0arI=\ngithub.com/u-root/uio v0.0.0-20240118234441-a3c409a6018e h1:BA9O3BmlTmpjbvajAwzWx4Wo2TRVdpPXZEeemGQcajw=\ngithub.com/u-root/uio v0.0.0-20240118234441-a3c409a6018e/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264=\ngithub.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=\ngithub.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=\ngithub.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=\ngithub.com/vbatts/tar-split v0.11.6 h1:4SjTW5+PU11n6fZenf2IPoV8/tz3AaYHMWjf23envGs=\ngithub.com/vbatts/tar-split v0.11.6/go.mod h1:dqKNtesIOr2j2Qv3W/cHjnvk9I8+G7oAkFDFN6TCBEI=\ngithub.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=\ngithub.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=\ngithub.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=\ngithub.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=\ngithub.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=\ngithub.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=\ngithub.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=\ngithub.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=\ngithub.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=\ngithub.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=\ngithub.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=\ngithub.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=\ngithub.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk=\ngithub.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=\ngithub.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngo.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=\ngo.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=\ngo.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0=\ngo.etcd.io/etcd/api/v3 v3.5.16/go.mod h1:1P4SlIP/VwkDmGo3OlOD7faPeP8KDIFhqvciH5EfN28=\ngo.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q=\ngo.etcd.io/etcd/client/pkg/v3 v3.5.16/go.mod h1:V8acl8pcEK0Y2g19YlOV9m9ssUe6MgiDSobSoaBAM0E=\ngo.etcd.io/etcd/client/v2 v2.305.16 h1:kQrn9o5czVNaukf2A2At43cE9ZtWauOtf9vRZuiKXow=\ngo.etcd.io/etcd/client/v2 v2.305.16/go.mod h1:h9YxWCzcdvZENbfzBTFCnoNumr2ax3F19sKMqHFmXHE=\ngo.etcd.io/etcd/client/v3 v3.5.16 h1:sSmVYOAHeC9doqi0gv7v86oY/BTld0SEFGaxsU9eRhE=\ngo.etcd.io/etcd/client/v3 v3.5.16/go.mod h1:X+rExSGkyqxvu276cr2OwPLBaeqFu1cIl4vmRjAD/50=\ngo.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc=\ngo.etcd.io/etcd/pkg/v3 v3.5.16/go.mod h1:+lutCZHG5MBBFI/U4eYT5yL7sJfnexsoM20Y0t2uNuY=\ngo.etcd.io/etcd/raft/v3 v3.5.16 h1:zBXA3ZUpYs1AwiLGPafYAKKl/CORn/uaxYDwlNwndAk=\ngo.etcd.io/etcd/raft/v3 v3.5.16/go.mod h1:P4UP14AxofMJ/54boWilabqqWoW9eLodl6I5GdGzazI=\ngo.etcd.io/etcd/server/v3 v3.5.16 h1:d0/SAdJ3vVsZvF8IFVb1k8zqMZ+heGcNfft71ul9GWE=\ngo.etcd.io/etcd/server/v3 v3.5.16/go.mod h1:ynhyZZpdDp1Gq49jkUg5mfkDWZwXnn3eIqCqtJnrD/s=\ngo.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=\ngo.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=\ngo.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=\ngo.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 h1:yMkBS9yViCc7U7yeLzJPM2XizlfdVvBRSmsQDWu6qc0=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0/go.mod h1:n8MR6/liuGB5EmTETUBeU5ZgqMOlqKRxUaqPQBOANZ8=\ngo.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 h1:4BZHA+B1wXEQoGNHxW8mURaLhcdGwvRnmhGbm+odRbc=\ngo.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0/go.mod h1:3qi2EEwMgB4xnKgPLqsDP3j9qxnHDZeHsnAxfjQqTko=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q=\ngo.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw=\ngo.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 h1:FFeLy03iVTXP6ffeN2iXrxfGsZGCjVx0/4KlizjyBwU=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0/go.mod h1:TMu73/k1CP8nBUpDLc71Wj/Kf7ZS9FK5b53VapRsP9o=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 h1:lUsI2TYsQw2r1IASwoROaCnjdj2cvC2+Jbxvk6nHnWU=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0/go.mod h1:2HpZxxQurfGxJlJDblybejHB6RX6pmExPNe517hREw4=\ngo.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ=\ngo.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M=\ngo.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=\ngo.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=\ngo.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=\ngo.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=\ngo.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=\ngo.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=\ngo.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=\ngo.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=\ngo.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=\ngo.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=\ngo.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=\ngo4.org/mem v0.0.0-20220726221520-4f986261bf13 h1:CbZeCBZ0aZj8EfVgnqQcYZgf0lpZ3H9rmp5nkDTAst8=\ngo4.org/mem v0.0.0-20220726221520-4f986261bf13/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g=\ngo4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=\ngo4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=\ngolang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=\ngolang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=\ngolang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=\ngolang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=\ngolang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=\ngolang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=\ngolang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA=\ngolang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=\ngolang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8=\ngolang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=\ngolang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=\ngolang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=\ngolang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=\ngolang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=\ngolang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=\ngolang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=\ngolang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=\ngolang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=\ngolang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=\ngolang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=\ngolang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=\ngolang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=\ngolang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=\ngolang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=\ngolang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=\ngolang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=\ngolang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=\ngolang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=\ngolang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=\ngolang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=\ngolang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=\ngolang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=\ngolang.zx2c4.com/wireguard/windows v0.5.3 h1:On6j2Rpn3OEMXqBq00QEDC7bWSZrPIHKIus8eIuExIE=\ngolang.zx2c4.com/wireguard/windows v0.5.3/go.mod h1:9TEe8TJmtwyQebdFwAkEWOPr3prrtqm+REGFifP60hI=\ngomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=\ngomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=\ngoogle.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=\ngoogle.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=\ngoogle.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=\ngoogle.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 h1:2oV8dfuIkM1Ti7DwXc0BJfnwr9csz4TDXI9EmiI+Rbw=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38/go.mod h1:vuAjtvlwkDKF6L1GQ0SokiRLCGFfeBUXWr/aFFkHACc=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 h1:zciRKQ4kBpFgpfC5QQCVtnnNAcLIqweL7plyZRQHVpI=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=\ngoogle.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=\ngoogle.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=\ngoogle.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=\ngoogle.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=\ngopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=\ngopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=\ngopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=\ngopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=\ngopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=\ngopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=\ngopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=\ngopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=\ngopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=\ngopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=\ngopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=\ngopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=\ngotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=\ngvisor.dev/gvisor v0.0.0-20240722211153-64c016c92987 h1:TU8z2Lh3Bbq77w0t1eG8yRlLcNHzZu3x6mhoH2Mk0c8=\ngvisor.dev/gvisor v0.0.0-20240722211153-64c016c92987/go.mod h1:sxc3Uvk/vHcd3tj7/DHVBoR5wvWT/MmRq2pj7HRJnwU=\nhonnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=\nhonnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=\nhowett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM=\nhowett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=\nk8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=\nk8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=\nk8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw=\nk8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto=\nk8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs=\nk8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=\nk8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak=\nk8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw=\nk8s.io/cli-runtime v0.29.1 h1:By3WVOlEWYfyxhGko0f/IuAOLQcbBSMzwSaDren2JUs=\nk8s.io/cli-runtime v0.29.1/go.mod h1:vjEY9slFp8j8UoMhV5AlO8uulX9xk6ogfIesHobyBDU=\nk8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=\nk8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=\nk8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk=\nk8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w=\nk8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=\nk8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=\nk8s.io/kube-aggregator v0.32.1 h1:cztPyIHbo6tgrhYHDqmdmvxUufJKuxgAC/vog7yeWek=\nk8s.io/kube-aggregator v0.32.1/go.mod h1:sXjL5T8FO/rlBzTbBhahw9V5Nnr1UtzZHKTj9WxQCOU=\nk8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=\nk8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=\nk8s.io/kubectl v0.29.1 h1:rWnW3hi/rEUvvg7jp4iYB68qW5un/urKbv7fu3Vj0/s=\nk8s.io/kubectl v0.29.1/go.mod h1:SZzvLqtuOJYSvZzPZR9weSuP0wDQ+N37CENJf0FhDF4=\nk8s.io/metrics v0.32.1 h1:Ou4nrEtZS2vFf7OJCf9z3+2kr0A00kQzfoSwxg0gXps=\nk8s.io/metrics v0.32.1/go.mod h1:cLnai9XKYby1tNMX+xe8p9VLzTqrxYPcmqfCBoWObcM=\nk8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=\nk8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=\nmvdan.cc/sh/v3 v3.6.0 h1:gtva4EXJ0dFNvl5bHjcUEvws+KRcDslT8VKheTYkbGU=\nmvdan.cc/sh/v3 v3.6.0/go.mod h1:U4mhtBLZ32iWhif5/lD+ygy1zrgaQhUu+XFy7C8+TTA=\nsigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=\nsigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=\nsigs.k8s.io/controller-runtime v0.20.1 h1:JbGMAG/X94NeM3xvjenVUaBjy6Ui4Ogd/J5ZtjZnHaE=\nsigs.k8s.io/controller-runtime v0.20.1/go.mod h1:BrP3w158MwvB3ZbNpaAcIKkHQ7YGpYnzpoSTZ8E14WU=\nsigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=\nsigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=\nsigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA=\nsigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4=\nsigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=\nsigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=\nsoftware.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=\nsoftware.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=\n"
  },
  {
    "path": "hack/build-e2e.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nBUILD_DIR=\"${BUILDDIR:=test}\"\nSRC_DIR=\"${SRCDIR:=.}\"\n\n# Create directory if it doesn't exist\nif [ ! -d $BUILD_DIR ]\nthen\n    mkdir ./$BUILD_DIR\nfi\n\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \"-s -w\" -o $BUILD_DIR/devpod-linux-amd64 $SRC_DIR\nCGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags \"-s -w\" -o $BUILD_DIR/devpod-linux-arm64 $SRC_DIR\nCGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags \"-s -w\" -o $BUILD_DIR/devpod-darwin-arm64 $SRC_DIR\nCGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags \"-s -w\" -o $BUILD_DIR/devpod-darwin-amd64 $SRC_DIR\n\nchmod +x $BUILD_DIR/devpod-linux-amd64\nchmod +x $BUILD_DIR/devpod-linux-arm64\nchmod +x $BUILD_DIR/devpod-darwin-arm64\nchmod +x $BUILD_DIR/devpod-darwin-amd64\nmkdir -p /tmp/devpod-cache\ncp $BUILD_DIR/devpod-linux-amd64 /tmp/devpod-cache/devpod-linux-amd64\ncp $BUILD_DIR/devpod-linux-arm64 /tmp/devpod-cache/devpod-linux-arm64\n"
  },
  {
    "path": "hack/build-grpc.sh",
    "content": "#!/bin/sh\n\n# sudo apt install protobuf-compiler\ngo install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n\ncd pkg/agent/tunnel/\nprotoc -I . tunnel.proto  --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative\n"
  },
  {
    "path": "hack/dev_devpod_pro.sh",
    "content": "#! /usr/bin/env zsh\n\nset -e\n\nNS=${1:-\"default\"}\nRACE=${2:-\"no\"}\n\nif [[ ! $PWD == *\"/go/src/devpod\"* ]]; then\n  echo \"Please run this script from the /workspace/loft/devpod directory\"\n  exit 1\nfi\n\nif [[ $RACE == \"yes\" ]]; then\n  echo \"Building devpod with race detector\"\n  CGO_ENABLED=1 go build -ldflags \"-s -w\" -tags profile -race -o devpod-cli\nelse\n  CGO_ENABLED=0 go build -ldflags \"-s -w\" -tags profile -o devpod-cli\nfi\n\nkubectl -n $NS cp --no-preserve=true ./devpod-cli $(kubectl -n $NS get pods -l app=loft -o jsonpath=\"{.items[0].metadata.name}\"):/usr/local/bin/devpod\n"
  },
  {
    "path": "hack/gen-desktop.sh",
    "content": "#!/bin/bash\n\nif [ ! -d \".git\" ]; then\n    echo \"Error: incompatible working directory, you need to run this command from the root of the project.\"\n    exit 1\nfi\n\nTARGET_DIR=\"desktop/src/gen\"\nif [ -d \"$TARGET_DIR\" ]; then rm -Rf $TARGET_DIR; fi\n\necho \"Generating types...\"\ncd desktop/src-tauri\ncargo test --quiet &> /dev/null 2>&1\ncd ../..\nprintf \"Done\\n\"\n\necho \"Copying generated types...\"\nmkdir -p desktop/src/gen\ncp -r desktop/src-tauri/bindings/* desktop/src/gen \nrm -rf desktop/src-tauri/bindings\n\n# Add index.ts file for easy import\ntouch desktop/src/gen/index.ts\nfor filename in desktop/src/gen/*.ts; do\n    echo \"export * from './$(basename ${filename} .ts)'\" >> desktop/src/gen/index.ts\ndone\nprintf \"Done\\n\"\n\necho \"Formatting generated types...\"\ncd desktop\nyarn prettier --write src/gen --log-level silent\ncd ..\nprintf \"Done\\n\"\n"
  },
  {
    "path": "hack/pro/main.go",
    "content": "package main\n\nimport (\n\t\"crypto/sha256\"\n\t_ \"embed\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n//go:embed provider.yaml\nvar provider string\n\nvar checksumMap = map[string]string{\n\t\"./release/devpod-linux-amd64\":       \"##CHECKSUM_LINUX_AMD64##\",\n\t\"./release/devpod-linux-arm64\":       \"##CHECKSUM_LINUX_ARM64##\",\n\t\"./release/devpod-darwin-amd64\":      \"##CHECKSUM_DARWIN_AMD64##\",\n\t\"./release/devpod-darwin-arm64\":      \"##CHECKSUM_DARWIN_ARM64##\",\n\t\"./release/devpod-windows-amd64.exe\": \"##CHECKSUM_WINDOWS_AMD64##\",\n}\n\nfunc main() {\n\tpartial := os.Getenv(\"PARTIAL\") == \"true\"\n\tsourceFile, ok := os.LookupEnv(\"SOURCE_FILE\")\n\tabsPath := \"\"\n\n\tif ok {\n\t\tvar err error\n\n\t\tabsPath, err = filepath.Abs(sourceFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tproviderBytes, err := os.ReadFile(absPath)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tprovider = string(providerBytes)\n\t}\n\n\treplaced := strings.Replace(provider, \"##VERSION##\", os.Args[1], -1)\n\tfor k, v := range checksumMap {\n\t\tchecksum, err := File(k)\n\t\tif err != nil {\n\t\t\tif partial {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tpanic(fmt.Errorf(\"generate checksum for %s: %w\", k, err))\n\t\t}\n\n\t\treplaced = strings.Replace(replaced, v, checksum, -1)\n\t}\n\n\tif ok {\n\t\terr := os.WriteFile(absPath, []byte(replaced), 0644)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t} else {\n\t\tfmt.Println(replaced)\n\t}\n}\n\n// File hashes a given file to a sha256 string\nfunc File(filePath string) (string, error) {\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\thash := sha256.New()\n\n\t_, err = io.Copy(hash, file)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.ToLower(hex.EncodeToString(hash.Sum(nil))), nil\n}\n"
  },
  {
    "path": "hack/pro/provider.yaml",
    "content": "name: devpod-pro\nversion: ##VERSION##\nicon: https://devpod.sh/assets/devpod.svg\ndescription: DevPod Pro\noptions:\n  LOFT_CONFIG:\n    global: true\n    hidden: true\n    required: true\n    default: \"${PROVIDER_FOLDER}/loft-config.json\"\nbinaries:\n  PRO_PROVIDER:\n    - os: linux\n      arch: amd64\n      path: https://github.com/loft-sh/devpod/releases/download/##VERSION##/devpod-linux-amd64\n      checksum: ##CHECKSUM_LINUX_AMD64##\n    - os: linux\n      arch: arm64\n      path: https://github.com/loft-sh/devpod/releases/download/##VERSION##/devpod-linux-arm64\n      checksum: ##CHECKSUM_LINUX_ARM64##\n    - os: darwin\n      arch: amd64\n      path: https://github.com/loft-sh/devpod/releases/download/##VERSION##/devpod-darwin-amd64\n      checksum: ##CHECKSUM_DARWIN_AMD64##\n    - os: darwin\n      arch: arm64\n      path: https://github.com/loft-sh/devpod/releases/download/##VERSION##/devpod-darwin-arm64\n      checksum: ##CHECKSUM_DARWIN_ARM64##\n    - os: windows\n      arch: amd64\n      path: https://github.com/loft-sh/devpod/releases/download/##VERSION##/devpod-windows-amd64.exe\n      checksum: ##CHECKSUM_WINDOWS_AMD64##\nexec:\n  proxy:\n    up: |-\n      ${PRO_PROVIDER} pro provider up\n    ssh: |-\n      ${PRO_PROVIDER} pro provider ssh\n    stop: |-\n      ${PRO_PROVIDER} pro provider stop\n    status: |-\n      ${PRO_PROVIDER} pro provider status\n    delete: |-\n      ${PRO_PROVIDER} pro provider delete\n    health: |-\n      ${PRO_PROVIDER} pro provider health\n    daemon:\n      start: |-\n        ${PRO_PROVIDER} pro provider daemon start\n      status: |-\n        ${PRO_PROVIDER} pro provider daemon status\n    create:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider create workspace\n    get:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider get workspace\n      self: |-\n        ${PRO_PROVIDER} pro provider get self\n      version: |-\n        ${PRO_PROVIDER} pro provider get version\n    update:\n      workspace: |-\n        ${PRO_PROVIDER} pro provider update workspace\n    watch:\n      workspaces: |-\n        ${PRO_PROVIDER} pro provider watch workspaces\n    list:\n      workspaces: |-\n        ${PRO_PROVIDER} pro provider list workspaces\n      projects: |-\n        ${PRO_PROVIDER} pro provider list projects\n      templates: |-\n        ${PRO_PROVIDER} pro provider list templates\n      clusters: |-\n        ${PRO_PROVIDER} pro provider list clusters\n"
  },
  {
    "path": "hack/rebuild.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nif [[ -z \"${TMPDIR}\" ]]; then\n    TMPDIR=\"/tmp\"\nfi\n\nif [[ -z \"${BUILD_PLATFORMS}\" ]]; then\n    BUILD_PLATFORMS=\"linux windows darwin\"\nfi\n\nif [[ -z \"${BUILD_ARCHS}\" ]]; then\n    BUILD_ARCHS=\"amd64 arm64\"\nfi\n\nfor os in $BUILD_PLATFORMS; do\n    for arch in $BUILD_ARCHS; do\n        # don't build for arm on windows\n        if [[ \"$os\" == \"windows\" && \"$arch\" == \"arm64\" ]]; then\n            continue\n        fi\n        echo \"[INFO] Building for $os/$arch\"\n        if [[ $RACE == \"yes\" ]]; then\n            echo \"Building devpod with race detector\"\n            CGO_ENABLED=1 GOOS=$os GOARCH=$arch go build -race -ldflags \"-s -w\" -o test/devpod-cli-$os-$arch\n        else\n            CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -ldflags \"-s -w\" -o test/devpod-cli-$os-$arch\n        fi\n    done\ndone\necho \"[INFO] Built binaries for all platforms in test/ directory\"\n\n# if not true, install the binary\nif [[ \"${SKIP_INSTALL}\" != \"true\" ]]; then\n    if command -v sudo &> /dev/null; then\n        go build -o test/devpod && sudo mv test/devpod /usr/local/bin/\n    else \n        go install .\n    fi\n    echo \"[INFO] Installed devpod binary to /usr/local/bin\"\nelse \n    echo \"[INFO] Skipping install of devpod binary\"\nfi\n\nif [[ $BUILD_PLATFORMS == *\"linux\"* ]]; then\n    cp test/devpod-cli-linux-amd64 test/devpod-linux-amd64 \n    cp test/devpod-cli-linux-arm64 test/devpod-linux-arm64\nfi\n\nif [ -d \"desktop/src-tauri/bin\" ]; then\n    if [[ $BUILD_PLATFORMS == *\"linux\"* ]]; then\n        cp test/devpod-cli-linux-amd64 desktop/src-tauri/bin/devpod-cli-x86_64-unknown-linux-gnu\n        cp test/devpod-cli-linux-arm64 desktop/src-tauri/bin/devpod-cli-aarch64-unknown-linux-gnu\n    fi\n    if [[ $BUILD_PLATFORMS == *\"windows\"* ]]; then\n        cp test/devpod-cli-windows-amd64 desktop/src-tauri/bin/devpod-cli-x86_64-pc-windows-msvc.exe\n    fi\n    if [[ $BUILD_PLATFORMS == *\"darwin\"* ]]; then\n        cp test/devpod-cli-darwin-amd64 desktop/src-tauri/bin/devpod-cli-x86_64-apple-darwin\n        cp test/devpod-cli-darwin-arm64 desktop/src-tauri/bin/devpod-cli-aarch64-apple-darwin\n    fi\necho \"[INFO] Copied binaries to desktop/src-tauri/bin\"\nfi\n\nif [[ $BUILD_PLATFORMS == *\"linux\"* ]]; then\n    rm -R $TMPDIR/devpod-cache 2>/dev/null || true\n    mkdir -p $TMPDIR/devpod-cache\n    cp test/devpod-cli-linux-amd64 $TMPDIR/devpod-cache/devpod-linux-amd64\n    cp test/devpod-cli-linux-arm64 $TMPDIR/devpod-cache/devpod-linux-arm64\n    echo \"[INFO] Copied binaries to $TMPDIR/devpod-cache\"\nfi\n"
  },
  {
    "path": "hack/unit-tests.sh",
    "content": "#!/usr/bin/env bash\n\n# Set required go flags\nexport GO111MODULE=on\nexport GOFLAGS=-mod=vendor\n\n# Test if we can build the program\necho \"Building DevPod...\"\ngo generate ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go || exit 1\n \n# List packages\nPKGS=$(go list ./... | grep -v -e /vendor/ -e /test -e /e2e)\n\necho \"Start testing...\"\nfail=false\nfor pkg in $PKGS; do\n go test -race -coverprofile=profile.out -covermode=atomic $pkg\n if [ $? -ne 0 ]; then\n   fail=true\n fi\ndone\n\nif [ \"$fail\" = true ]; then\n echo \"Failure\"\n exit 1\nfi\n"
  },
  {
    "path": "loadtest/README.md",
    "content": "## Load Testing DevPod\n\n### Create the workspaces\n\n`./startWorkspaces.sh`\n\n### Run the load test and generate wait times\n\n`./run.sh`\n\nUpdate NUM_WORKSPACES or NUM_COMMANDS_PER_WORKSPACE to adjust load signature\n\n### Clean up\n\n`./deleteWorkspaces.sh`\n\n### Things to note\n\n`generateLoad.sh` contains the SSH command to generate load, change the command here to adjust how you want to generate traffic\n\n### Get core dump from loft\n\n```\nkubectl -n devpod-pro set env deployment/loft LOFTDEBUG=true\n\nkubectl -n devpod-pro port-forward loft-55df4d875f-j9vnd 8080:8080 &\n\ncurl -s -v http://localhost:8080/debug/pprof/heap > $(date '+%Y-%m-%d-%H:%M:%S').out\n```\n\n### Profile the server every 30 seconds\n\n```\nwhile true; do curl -s -v http://localhost:8080/debug/pprof/heap > $(date '+%Y-%m-%d-%H:%M:%S').out; sleep 30; done\n```\n\n"
  },
  {
    "path": "loadtest/deleteWorkspaces.sh",
    "content": "#!/bin/zsh\n\nexport NUM_WORKSPACES=60\n\n# Start the workspaces\nfor i in $(seq 1 $NUM_WORKSPACES);\ndo\n    devpod delete --force \"loadtest$i\" &\n    sleep 2\ndone\n\nwait\n"
  },
  {
    "path": "loadtest/emulateTraffic.sh",
    "content": "#!/bin/zsh\n\n# SSH to the workspace and execute command\nfor j in $(seq 1 $NUM_COMMANDS_PER_WORKSPACE);\ndo\n    ./generateLoad.sh $1\n    sleep 1\ndone\n"
  },
  {
    "path": "loadtest/generateLoad.sh",
    "content": "#!/bin/zsh\n\ndevpod ssh \"loadtest$1\" --command=\"tr -dc A-Za-z0-9 </dev/urandom | head -c 100000000; echo\" > /dev/null\n"
  },
  {
    "path": "loadtest/init_monitor.sh",
    "content": "#!/bin/zsh\n\n#kubectl -n devpod-pro set env deployment/loft LOFTDEBUG=true\n\nkubectl -n devpod-pro port-forward $(kubectl -n devpod-pro get pods -l app=loft -o jsonpath=\"{.items[0].metadata.name}\") 8080:8080\n"
  },
  {
    "path": "loadtest/monitor.sh",
    "content": "#!/bin/zsh\n\nmkdir results\n\nexport INTERVAL_SECONDS=30\n\necho \"Monitoring heap, go routines, and threads every $INTERVAL_SECONDS seconds ...\"\n\nwhile true; do curl -s -k https://localhost:8080/debug/pprof/heap > ./results/$(date '+%Y-%m-%d-%H:%M:%S').heap; sleep $(echo $INTERVAL_SECONDS); done &\n\nwhile true; do curl -s -k https://localhost:8080/debug/pprof/goroutine > ./results/$(date '+%Y-%m-%d-%H:%M:%S').cpu; sleep $(echo $INTERVAL_SECONDS); done &\n\nwhile true; do curl -s -k https://localhost:8080/debug/pprof/threadcreate > ./results/$(date '+%Y-%m-%d-%H:%M:%S').threads; sleep $(echo $INTERVAL_SECONDS); done &\n\ntrap \"trap - SIGTERM && kill -- -$$\" SIGINT SIGTERM EXIT\nwait\n"
  },
  {
    "path": "loadtest/run.sh",
    "content": "#!/bin/zsh\n\nexport NUM_WORKSPACES=10\nexport NUM_COMMANDS_PER_WORKSPACE=1\n\necho \"Running $NUM_WORKSPACES workspaces with $NUM_COMMANDS_PER_WORKSPACE commands each ...\"\n\n# SSH to the workspace and execute command\nfor j in $(seq 1 $NUM_WORKSPACES);\ndo\n    time ./emulateTraffic.sh $j &\n    sleep 2\ndone\n\n# Keep the session active to allow the commands to execute and use STDOUT\nwait\n"
  },
  {
    "path": "loadtest/startWorkspaces.sh",
    "content": "#!/bin/zsh\n\nexport NUM_WORKSPACES=20\n\n# Start the workspaces\nfor i in $(seq 11 $NUM_WORKSPACES);\ndo\n    devpod up --id \"loadtest$i\" --debug --ide none http://github.com/kubernetes/kubernetes\ndone\n\nwait\n"
  },
  {
    "path": "main.go",
    "content": "package main\n\nimport \"github.com/loft-sh/devpod/cmd\"\n\nfunc main() {\n\tcmd.Execute()\n}\n"
  },
  {
    "path": "netlify.toml",
    "content": "[build]\nbase = \"docs/\"\npublish = \"build/\"\ncommand = \"\"\"\n    set -e\n\n    export OUT_DIR=\"build/\"\n    export TARGET_OUT_DIR=\"build/docs\"\n\n    # Build docs\n    yarn build\n\n    # Delete fragments folder\n    #rm -rf $OUT_DIR/fragments\n\n    # Move files to build/docs/\n    mkdir -p tmp-$TARGET_OUT_DIR\n    mv $OUT_DIR/* tmp-$TARGET_OUT_DIR\n    mkdir -p $TARGET_OUT_DIR\n    mv tmp-$TARGET_OUT_DIR/* $TARGET_OUT_DIR\n\n    # Add extra files\n    mv public/* $OUT_DIR/\n  \"\"\"\n\n[build.processing]\nskip_processing = false\n[build.processing.html]\npretty_urls = true\n[build.processing.css]\nbundle = false\nminify = false\n[build.processing.js]\nbundle = false\nminify = false\n[build.processing.images]\ncompress = true\n"
  },
  {
    "path": "pkg/agent/agent.go",
    "content": "package agent\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst DefaultInactivityTimeout = time.Minute * 20\n\nconst ContainerDevPodHelperLocation = \"/usr/local/bin/devpod\"\n\nconst RemoteDevPodHelperLocation = \"/tmp/devpod\"\n\nconst ContainerActivityFile = \"/tmp/devpod.activity\"\n\nconst defaultAgentDownloadURL = \"https://github.com/loft-sh/devpod/releases/download/\"\n\nconst EnvDevPodAgentURL = \"DEVPOD_AGENT_URL\"\n\nconst WorkspaceBusyFile = \"workspace.lock\"\n\nfunc DefaultAgentDownloadURL() string {\n\tdevPodAgentURL := os.Getenv(EnvDevPodAgentURL)\n\tif devPodAgentURL != \"\" {\n\t\treturn strings.TrimSuffix(devPodAgentURL, \"/\") + \"/\"\n\t}\n\n\tif version.GetVersion() == version.DevVersion {\n\t\treturn \"https://github.com/loft-sh/devpod/releases/latest/download/\"\n\t}\n\n\treturn defaultAgentDownloadURL + version.GetVersion()\n}\n\nfunc DecodeContainerWorkspaceInfo(workspaceInfoRaw string) (*provider2.ContainerWorkspaceInfo, string, error) {\n\tdecoded, err := compress.Decompress(workspaceInfoRaw)\n\tif err != nil {\n\t\treturn nil, \"\", perrors.Wrap(err, \"decode workspace info\")\n\t}\n\n\tworkspaceInfo := &provider2.ContainerWorkspaceInfo{}\n\terr = json.Unmarshal([]byte(decoded), workspaceInfo)\n\tif err != nil {\n\t\treturn nil, \"\", perrors.Wrap(err, \"parse workspace info\")\n\t}\n\n\treturn workspaceInfo, decoded, nil\n}\n\nfunc DecodeWorkspaceInfo(workspaceInfoRaw string) (*provider2.AgentWorkspaceInfo, string, error) {\n\tdecoded, err := compress.Decompress(workspaceInfoRaw)\n\tif err != nil {\n\t\treturn nil, \"\", perrors.Wrap(err, \"decode workspace info\")\n\t}\n\n\tworkspaceInfo := &provider2.AgentWorkspaceInfo{}\n\terr = json.Unmarshal([]byte(decoded), workspaceInfo)\n\tif err != nil {\n\t\treturn nil, \"\", perrors.Wrap(err, \"parse workspace info\")\n\t}\n\n\treturn workspaceInfo, decoded, nil\n}\n\nfunc readAgentWorkspaceInfo(agentFolder, context, id string) (*provider2.AgentWorkspaceInfo, error) {\n\t// get workspace folder\n\tworkspaceDir, err := GetAgentWorkspaceDir(agentFolder, context, id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// parse agent workspace info\n\treturn ParseAgentWorkspaceInfo(filepath.Join(workspaceDir, provider2.WorkspaceConfigFile))\n}\n\nfunc ParseAgentWorkspaceInfo(workspaceConfigFile string) (*provider2.AgentWorkspaceInfo, error) {\n\t// read workspace config\n\tout, err := os.ReadFile(workspaceConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// json unmarshal\n\tworkspaceInfo := &provider2.AgentWorkspaceInfo{}\n\terr = json.Unmarshal(out, workspaceInfo)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"parse workspace info\")\n\t}\n\n\tworkspaceInfo.Origin = filepath.Dir(workspaceConfigFile)\n\treturn workspaceInfo, nil\n}\n\nfunc ReadAgentWorkspaceInfo(agentFolder, context, id string, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error) {\n\tworkspaceInfo, err := readAgentWorkspaceInfo(agentFolder, context, id)\n\tif err != nil && !(errors.Is(err, ErrFindAgentHomeFolder) || errors.Is(err, os.ErrPermission)) {\n\t\treturn false, nil, err\n\t}\n\n\t// check if we need to become root\n\tshouldExit, err := rerunAsRoot(workspaceInfo, log)\n\tif err != nil {\n\t\treturn false, nil, perrors.Wrap(err, \"rerun as root\")\n\t} else if shouldExit {\n\t\treturn true, nil, nil\n\t} else if workspaceInfo == nil {\n\t\treturn false, nil, ErrFindAgentHomeFolder\n\t}\n\n\treturn false, workspaceInfo, nil\n}\n\nfunc WorkspaceInfo(workspaceInfoEncoded string, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error) {\n\treturn decodeWorkspaceInfoAndWrite(workspaceInfoEncoded, false, nil, log)\n}\n\nfunc WriteWorkspaceInfo(workspaceInfoEncoded string, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error) {\n\treturn WriteWorkspaceInfoAndDeleteOld(workspaceInfoEncoded, nil, log)\n}\n\nfunc WriteWorkspaceInfoAndDeleteOld(workspaceInfoEncoded string, deleteWorkspace func(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error) {\n\treturn decodeWorkspaceInfoAndWrite(workspaceInfoEncoded, true, deleteWorkspace, log)\n}\n\nfunc decodeWorkspaceInfoAndWrite(\n\tworkspaceInfoEncoded string,\n\twriteInfo bool,\n\tdeleteWorkspace func(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error,\n\tlog log.Logger,\n) (bool, *provider2.AgentWorkspaceInfo, error) {\n\tworkspaceInfo, _, err := DecodeWorkspaceInfo(workspaceInfoEncoded)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\t// check if we need to become root\n\tshouldExit, err := rerunAsRoot(workspaceInfo, log)\n\tif err != nil {\n\t\treturn false, nil, fmt.Errorf(\"rerun as root: %w\", err)\n\t} else if shouldExit {\n\t\treturn true, nil, nil\n\t}\n\n\t// write to workspace folder\n\tworkspaceDir, err := CreateAgentWorkspaceDir(workspaceInfo.Agent.DataPath, workspaceInfo.Workspace.Context, workspaceInfo.Workspace.ID)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\tlog.Debugf(\"Use %s as workspace dir\", workspaceDir)\n\n\t// check if workspace config already exists\n\tworkspaceConfig := filepath.Join(workspaceDir, provider2.WorkspaceConfigFile)\n\tif deleteWorkspace != nil {\n\t\toldWorkspaceInfo, _ := ParseAgentWorkspaceInfo(workspaceConfig)\n\t\tif oldWorkspaceInfo != nil && oldWorkspaceInfo.Workspace.UID != workspaceInfo.Workspace.UID {\n\t\t\t// delete the old workspace\n\t\t\tlog.Infof(\"Delete old workspace '%s'\", oldWorkspaceInfo.Workspace.ID)\n\t\t\terr = deleteWorkspace(oldWorkspaceInfo, log)\n\t\t\tif err != nil {\n\t\t\t\treturn false, nil, perrors.Wrap(err, \"delete old workspace\")\n\t\t\t}\n\n\t\t\t// recreate workspace folder again\n\t\t\tworkspaceDir, err = CreateAgentWorkspaceDir(workspaceInfo.Agent.DataPath, workspaceInfo.Workspace.Context, workspaceInfo.Workspace.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn false, nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// check content folder for local folder workspace source\n\t//\n\t// We don't want to initialize the content folder with the value of the local workspace folder\n\t// if we're running in proxy mode.\n\t// We only have write access to /var/lib/loft/* by default causing nearly all local folders to run into permissions issues\n\tif workspaceInfo.Workspace.Source.LocalFolder != \"\" && !workspaceInfo.CLIOptions.Platform.Enabled {\n\t\t_, err = os.Stat(workspaceInfo.WorkspaceOrigin)\n\t\tif err == nil {\n\t\t\tworkspaceInfo.ContentFolder = workspaceInfo.Workspace.Source.LocalFolder\n\t\t}\n\t}\n\n\t// set content folder\n\tif workspaceInfo.ContentFolder == \"\" {\n\t\tworkspaceInfo.ContentFolder = GetAgentWorkspaceContentDir(workspaceDir)\n\t}\n\n\t// write workspace info\n\tif writeInfo {\n\t\terr = writeWorkspaceInfo(workspaceConfig, workspaceInfo)\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\t}\n\n\tworkspaceInfo.Origin = workspaceDir\n\treturn false, workspaceInfo, nil\n}\n\nfunc CreateWorkspaceBusyFile(folder string) {\n\tfilePath := filepath.Join(folder, WorkspaceBusyFile)\n\t_, err := os.Stat(filePath)\n\tif err == nil {\n\t\treturn\n\t}\n\n\t_ = os.WriteFile(filePath, nil, 0600)\n}\n\nfunc HasWorkspaceBusyFile(folder string) bool {\n\tfilePath := filepath.Join(folder, WorkspaceBusyFile)\n\t_, err := os.Stat(filePath)\n\treturn err == nil\n}\n\nfunc DeleteWorkspaceBusyFile(folder string) {\n\t_ = os.Remove(filepath.Join(folder, WorkspaceBusyFile))\n}\n\nfunc writeWorkspaceInfo(file string, workspaceInfo *provider2.AgentWorkspaceInfo) error {\n\t// copy workspace info\n\tcloned := provider2.CloneAgentWorkspaceInfo(workspaceInfo)\n\n\t// never save cli options\n\tcloned.CLIOptions = provider2.CLIOptions{}\n\n\t// encode workspace info\n\tencoded, err := json.Marshal(workspaceInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write workspace config\n\terr = os.WriteFile(file, encoded, 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"write workspace config file: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc rerunAsRoot(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (bool, error) {\n\t// check if root is required\n\tif runtime.GOOS != \"linux\" || os.Getuid() == 0 || (workspaceInfo != nil && workspaceInfo.Agent.Local == \"true\") {\n\t\treturn false, nil\n\t}\n\n\t// check if we can reach docker with no problems\n\tdockerRootRequired := false\n\tif workspaceInfo != nil && (workspaceInfo.Agent.Driver == \"\" || workspaceInfo.Agent.Driver == provider2.DockerDriver) {\n\t\tvar err error\n\t\tdockerRootRequired, err = dockerReachable(workspaceInfo.Agent.Docker.Path, workspaceInfo.Agent.Docker.Env)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error trying to reach docker daemon: %v\", err)\n\t\t\tdockerRootRequired = true\n\t\t}\n\t}\n\n\t// check if daemon needs to be installed\n\tagentRootRequired := false\n\tif workspaceInfo == nil || len(workspaceInfo.Agent.Exec.Shutdown) > 0 {\n\t\tagentRootRequired = true\n\t}\n\n\t// check if root required\n\tif !dockerRootRequired && !agentRootRequired {\n\t\tlog.Debugf(\"No root required, because neither docker nor agent daemon needs to be installed\")\n\t\treturn false, nil\n\t}\n\n\t// execute ourself as root\n\tbinary, err := os.Executable()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// call ourself\n\targs := []string{\"--preserve-env\", binary}\n\targs = append(args, os.Args[1:]...)\n\tlog.Debugf(\"Rerun as root: %s\", strings.Join(args, \" \"))\n\tcmd := exec.Command(\"sudo\", args...)\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\terr = cmd.Run()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}\n\ntype Exec func(ctx context.Context, user string, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\nfunc Tunnel(\n\tctx context.Context,\n\texec Exec,\n\tuser string,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\tstderr io.Writer,\n\tlog log.Logger,\n\ttimeout time.Duration,\n) error {\n\t// inject agent\n\terr := InjectAgent(ctx, func(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\treturn exec(ctx, \"root\", command, stdin, stdout, stderr)\n\t}, false, ContainerDevPodHelperLocation, DefaultAgentDownloadURL(), false, log, timeout)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// build command\n\tcommand := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", ContainerDevPodHelperLocation)\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tcommand += \" --debug\"\n\t}\n\tif user == \"\" {\n\t\tuser = \"root\"\n\t}\n\n\t// create tunnel\n\terr = exec(ctx, user, command, stdin, stdout, stderr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc dockerReachable(dockerOverride string, envs map[string]string) (bool, error) {\n\tdocker := \"docker\"\n\tif dockerOverride != \"\" {\n\t\tdocker = dockerOverride\n\t}\n\n\tif !command.Exists(docker) {\n\t\t// if docker is overridden, we assume that there is an error as we don't know how to install the command provided\n\t\tif dockerOverride != \"\" {\n\t\t\treturn false, fmt.Errorf(\"docker command '%s' not found\", dockerOverride)\n\t\t}\n\t\t// we need root to install docker\n\t\treturn true, nil\n\t}\n\n\tcmd := exec.Command(docker, \"ps\")\n\tif len(envs) > 0 {\n\t\tnewEnvs := os.Environ()\n\t\tfor k, v := range envs {\n\t\t\tnewEnvs = append(newEnvs, k+\"=\"+v)\n\t\t}\n\t\tcmd.Env = newEnvs\n\t}\n\n\t_, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"permission denied\") {\n\t\t\tif dockerOverride == \"\" {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\n\t\treturn false, perrors.Wrapf(err, \"%s ps\", docker)\n\t}\n\n\treturn false, nil\n}\n"
  },
  {
    "path": "pkg/agent/inject.go",
    "content": "package agent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"time\"\n\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/inject\"\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n)\n\nvar waitForInstanceConnectionTimeout = time.Minute * 5\n\nfunc InjectAgent(\n\tctx context.Context,\n\texec inject.ExecFunc,\n\tlocal bool,\n\tremoteAgentPath,\n\tdownloadURL string,\n\tpreferDownload bool,\n\tlog log.Logger,\n\ttimeout time.Duration,\n) error {\n\treturn InjectAgentAndExecute(\n\t\tctx,\n\t\texec,\n\t\tlocal,\n\t\tremoteAgentPath,\n\t\tdownloadURL,\n\t\tpreferDownload,\n\t\t\"\",\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tlog,\n\t\ttimeout,\n\t)\n}\n\nfunc InjectAgentAndExecute(\n\tctx context.Context,\n\texec inject.ExecFunc,\n\tlocal bool,\n\tremoteAgentPath,\n\tdownloadURL string,\n\tpreferDownload bool,\n\tcommand string,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\tstderr io.Writer,\n\tlog log.Logger,\n\ttimeout time.Duration,\n) error {\n\t// should execute locally?\n\tif local {\n\t\tif command == \"\" {\n\t\t\treturn nil\n\t\t}\n\n\t\tlog.Debugf(\"Execute command locally\")\n\t\treturn shell.RunEmulatedShell(ctx, command, stdin, stdout, stderr, nil)\n\t}\n\n\tdefer log.Debugf(\"Done InjectAgentAndExecute\")\n\tif remoteAgentPath == \"\" {\n\t\tremoteAgentPath = RemoteDevPodHelperLocation\n\t}\n\tif downloadURL == \"\" {\n\t\tdownloadURL = DefaultAgentDownloadURL()\n\t}\n\n\tversionCheck := fmt.Sprintf(`[ \"$(%s version 2>/dev/null || echo 'false')\" != \"%s\" ]`, remoteAgentPath, version.GetVersion())\n\tif version.GetVersion() == version.DevVersion {\n\t\tpreferDownload = false\n\t}\n\n\t// install devpod into the target\n\t// do a simple hello world to check if we can get something\n\tnow := time.Now()\n\tlastMessage := time.Now()\n\tfor {\n\t\tbuf := &bytes.Buffer{}\n\t\tif stderr != nil {\n\t\t\tstderr = io.MultiWriter(stderr, buf)\n\t\t} else {\n\t\t\tstderr = buf\n\t\t}\n\n\t\tscriptParams := &inject.Params{\n\t\t\tCommand:             command,\n\t\t\tAgentRemotePath:     remoteAgentPath,\n\t\t\tDownloadURLs:        inject.NewDownloadURLs(downloadURL),\n\t\t\tExistsCheck:         versionCheck,\n\t\t\tPreferAgentDownload: preferDownload,\n\t\t\tShouldChmodPath:     true,\n\t\t}\n\n\t\twasExecuted, err := inject.InjectAndExecute(\n\t\t\tctx,\n\t\t\texec,\n\t\t\tfunc(arm bool) (io.ReadCloser, error) {\n\t\t\t\treturn injectBinary(arm, downloadURL, log)\n\t\t\t},\n\t\t\tscriptParams,\n\t\t\tstdin,\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\ttimeout,\n\t\t\tlog,\n\t\t)\n\t\tif err != nil {\n\t\t\tif time.Since(now) > waitForInstanceConnectionTimeout {\n\t\t\t\treturn fmt.Errorf(\"timeout waiting for instance connection: %w\", err)\n\t\t\t} else if wasExecuted {\n\t\t\t\treturn fmt.Errorf(\"agent error: %s: %w\", buf.String(), err)\n\t\t\t}\n\n\t\t\tif time.Since(lastMessage) > time.Second*5 {\n\t\t\t\tlog.Infof(\"Waiting for devpod agent to come up...\")\n\t\t\t\tlastMessage = time.Now()\n\t\t\t}\n\n\t\t\tlog.Debugf(\"Inject Error: %s%v\", buf.String(), err)\n\t\t\ttime.Sleep(time.Second * 3)\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\nfunc injectBinary(arm bool, tryDownloadURL string, log log.Logger) (io.ReadCloser, error) {\n\t// this means we need to\n\ttargetArch := \"amd64\"\n\tif arm {\n\t\ttargetArch = \"arm64\"\n\t}\n\n\t// make sure a linux arm64 binary exists locally\n\tvar err error\n\tvar binaryPath string\n\tif runtime.GOOS == \"linux\" && runtime.GOARCH == targetArch {\n\t\tbinaryPath, err = os.Executable()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"get executable: %w\", err)\n\t\t}\n\n\t\t// check if we still exist\n\t\t_, err = os.Stat(binaryPath)\n\t\tif err != nil {\n\t\t\tbinaryPath = \"\"\n\t\t}\n\t}\n\n\t// try to look up runner binaries\n\tif binaryPath == \"\" {\n\t\tbinaryPath = getRunnerBinary(targetArch)\n\t}\n\n\t// download devpod locally\n\tif binaryPath == \"\" {\n\t\tbinaryPath, err = downloadAgentLocally(tryDownloadURL, targetArch, log)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"download agent locally: %w\", err)\n\t\t}\n\t}\n\n\t// read file\n\tfile, err := os.Open(binaryPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open agent binary: %w\", err)\n\t}\n\n\treturn file, nil\n}\n\nfunc downloadAgentLocally(tryDownloadURL, targetArch string, log log.Logger) (string, error) {\n\tagentPath := filepath.Join(os.TempDir(), \"devpod-cache\", \"devpod-linux-\"+targetArch)\n\terr := os.MkdirAll(filepath.Dir(agentPath), 0755)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"create agent path: %w\", err)\n\t}\n\n\tstat, statErr := os.Stat(agentPath)\n\tif version.GetVersion() == version.DevVersion && statErr == nil {\n\t\treturn agentPath, nil\n\t}\n\n\tfullDownloadURL := tryDownloadURL + \"/devpod-linux-\" + targetArch\n\tlog.Debugf(\"Attempting to download DevPod agent from: %s\", fullDownloadURL)\n\n\tresp, err := devpodhttp.GetHTTPClient().Get(fullDownloadURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download devpod: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif statErr == nil && stat.Size() == resp.ContentLength {\n\t\treturn agentPath, nil\n\t}\n\n\tlog.Infof(\"Download DevPod Agent...\")\n\tfile, err := os.Create(agentPath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"create agent binary: %w\", err)\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, resp.Body)\n\tif err != nil {\n\t\t_ = os.Remove(agentPath)\n\t\treturn \"\", fmt.Errorf(\"failed to download devpod from URL %s: %w\", fullDownloadURL, err)\n\t}\n\n\treturn agentPath, nil\n}\n\nfunc getRunnerBinary(targetArch string) string {\n\tbinaryPath := filepath.Join(os.TempDir(), \"devpod-cache\", \"devpod-linux-\"+targetArch)\n\t_, err := os.Stat(binaryPath)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn binaryPath\n}\n"
  },
  {
    "path": "pkg/agent/tunnel/tunnel.pb.go",
    "content": "// protoc -I . tunnel.proto  --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative\n\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.4\n// \tprotoc        v5.27.3\n// source: tunnel.proto\n\npackage tunnel\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n\tunsafe \"unsafe\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype LogLevel int32\n\nconst (\n\tLogLevel_DEBUG   LogLevel = 0\n\tLogLevel_INFO    LogLevel = 1\n\tLogLevel_DONE    LogLevel = 2\n\tLogLevel_WARNING LogLevel = 3\n\tLogLevel_ERROR   LogLevel = 4\n)\n\n// Enum value maps for LogLevel.\nvar (\n\tLogLevel_name = map[int32]string{\n\t\t0: \"DEBUG\",\n\t\t1: \"INFO\",\n\t\t2: \"DONE\",\n\t\t3: \"WARNING\",\n\t\t4: \"ERROR\",\n\t}\n\tLogLevel_value = map[string]int32{\n\t\t\"DEBUG\":   0,\n\t\t\"INFO\":    1,\n\t\t\"DONE\":    2,\n\t\t\"WARNING\": 3,\n\t\t\"ERROR\":   4,\n\t}\n)\n\nfunc (x LogLevel) Enum() *LogLevel {\n\tp := new(LogLevel)\n\t*p = x\n\treturn p\n}\n\nfunc (x LogLevel) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (LogLevel) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_tunnel_proto_enumTypes[0].Descriptor()\n}\n\nfunc (LogLevel) Type() protoreflect.EnumType {\n\treturn &file_tunnel_proto_enumTypes[0]\n}\n\nfunc (x LogLevel) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use LogLevel.Descriptor instead.\nfunc (LogLevel) EnumDescriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{0}\n}\n\ntype StreamMountRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tMount         string                 `protobuf:\"bytes,1,opt,name=mount,proto3\" json:\"mount,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *StreamMountRequest) Reset() {\n\t*x = StreamMountRequest{}\n\tmi := &file_tunnel_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *StreamMountRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StreamMountRequest) ProtoMessage() {}\n\nfunc (x *StreamMountRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[0]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StreamMountRequest.ProtoReflect.Descriptor instead.\nfunc (*StreamMountRequest) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *StreamMountRequest) GetMount() string {\n\tif x != nil {\n\t\treturn x.Mount\n\t}\n\treturn \"\"\n}\n\ntype StopForwardPortRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tPort          string                 `protobuf:\"bytes,1,opt,name=port,proto3\" json:\"port,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *StopForwardPortRequest) Reset() {\n\t*x = StopForwardPortRequest{}\n\tmi := &file_tunnel_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *StopForwardPortRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StopForwardPortRequest) ProtoMessage() {}\n\nfunc (x *StopForwardPortRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[1]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StopForwardPortRequest.ProtoReflect.Descriptor instead.\nfunc (*StopForwardPortRequest) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *StopForwardPortRequest) GetPort() string {\n\tif x != nil {\n\t\treturn x.Port\n\t}\n\treturn \"\"\n}\n\ntype StopForwardPortResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *StopForwardPortResponse) Reset() {\n\t*x = StopForwardPortResponse{}\n\tmi := &file_tunnel_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *StopForwardPortResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StopForwardPortResponse) ProtoMessage() {}\n\nfunc (x *StopForwardPortResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[2]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StopForwardPortResponse.ProtoReflect.Descriptor instead.\nfunc (*StopForwardPortResponse) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{2}\n}\n\ntype ForwardPortRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tPort          string                 `protobuf:\"bytes,1,opt,name=port,proto3\" json:\"port,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *ForwardPortRequest) Reset() {\n\t*x = ForwardPortRequest{}\n\tmi := &file_tunnel_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ForwardPortRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ForwardPortRequest) ProtoMessage() {}\n\nfunc (x *ForwardPortRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[3]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ForwardPortRequest.ProtoReflect.Descriptor instead.\nfunc (*ForwardPortRequest) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *ForwardPortRequest) GetPort() string {\n\tif x != nil {\n\t\treturn x.Port\n\t}\n\treturn \"\"\n}\n\ntype ForwardPortResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *ForwardPortResponse) Reset() {\n\t*x = ForwardPortResponse{}\n\tmi := &file_tunnel_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ForwardPortResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ForwardPortResponse) ProtoMessage() {}\n\nfunc (x *ForwardPortResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[4]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ForwardPortResponse.ProtoReflect.Descriptor instead.\nfunc (*ForwardPortResponse) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{4}\n}\n\ntype Message struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tMessage       string                 `protobuf:\"bytes,1,opt,name=message,proto3\" json:\"message,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Message) Reset() {\n\t*x = Message{}\n\tmi := &file_tunnel_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Message) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Message) ProtoMessage() {}\n\nfunc (x *Message) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[5]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Message.ProtoReflect.Descriptor instead.\nfunc (*Message) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{5}\n}\n\nfunc (x *Message) GetMessage() string {\n\tif x != nil {\n\t\treturn x.Message\n\t}\n\treturn \"\"\n}\n\ntype Chunk struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tContent       []byte                 `protobuf:\"bytes,1,opt,name=Content,proto3\" json:\"Content,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Chunk) Reset() {\n\t*x = Chunk{}\n\tmi := &file_tunnel_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Chunk) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Chunk) ProtoMessage() {}\n\nfunc (x *Chunk) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[6]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Chunk.ProtoReflect.Descriptor instead.\nfunc (*Chunk) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{6}\n}\n\nfunc (x *Chunk) GetContent() []byte {\n\tif x != nil {\n\t\treturn x.Content\n\t}\n\treturn nil\n}\n\ntype LogMessage struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tLogLevel      LogLevel               `protobuf:\"varint,1,opt,name=logLevel,proto3,enum=tunnel.LogLevel\" json:\"logLevel,omitempty\"`\n\tMessage       string                 `protobuf:\"bytes,2,opt,name=message,proto3\" json:\"message,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *LogMessage) Reset() {\n\t*x = LogMessage{}\n\tmi := &file_tunnel_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *LogMessage) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*LogMessage) ProtoMessage() {}\n\nfunc (x *LogMessage) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[7]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use LogMessage.ProtoReflect.Descriptor instead.\nfunc (*LogMessage) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{7}\n}\n\nfunc (x *LogMessage) GetLogLevel() LogLevel {\n\tif x != nil {\n\t\treturn x.LogLevel\n\t}\n\treturn LogLevel_DEBUG\n}\n\nfunc (x *LogMessage) GetMessage() string {\n\tif x != nil {\n\t\treturn x.Message\n\t}\n\treturn \"\"\n}\n\ntype Empty struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Empty) Reset() {\n\t*x = Empty{}\n\tmi := &file_tunnel_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Empty) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Empty) ProtoMessage() {}\n\nfunc (x *Empty) ProtoReflect() protoreflect.Message {\n\tmi := &file_tunnel_proto_msgTypes[8]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Empty.ProtoReflect.Descriptor instead.\nfunc (*Empty) Descriptor() ([]byte, []int) {\n\treturn file_tunnel_proto_rawDescGZIP(), []int{8}\n}\n\nvar File_tunnel_proto protoreflect.FileDescriptor\n\nvar file_tunnel_proto_rawDesc = string([]byte{\n\t0x0a, 0x0c, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,\n\t0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x2a, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,\n\t0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,\n\t0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x75,\n\t0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x16, 0x53, 0x74, 0x6f, 0x70, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72,\n\t0x64, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,\n\t0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74,\n\t0x22, 0x19, 0x0a, 0x17, 0x53, 0x74, 0x6f, 0x70, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x50,\n\t0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x0a, 0x12, 0x46,\n\t0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,\n\t0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,\n\t0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64,\n\t0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x0a, 0x07,\n\t0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t0x65, 0x22, 0x21, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x43, 0x6f, 0x6e,\n\t0x74, 0x65, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61,\n\t0x67, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4c, 0x6f,\n\t0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c,\n\t0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d,\n\t0x70, 0x74, 0x79, 0x2a, 0x41, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12,\n\t0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e,\n\t0x46, 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0b,\n\t0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45,\n\t0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x32, 0xbf, 0x06, 0x0a, 0x06, 0x54, 0x75, 0x6e, 0x6e, 0x65,\n\t0x6c, 0x12, 0x26, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e,\n\t0x65, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65,\n\t0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x03, 0x4c, 0x6f, 0x67,\n\t0x12, 0x12, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73,\n\t0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x45, 0x6d,\n\t0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73,\n\t0x75, 0x6c, 0x74, 0x12, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73,\n\t0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x45, 0x6d,\n\t0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x11, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x43,\n\t0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x0f, 0x2e, 0x74, 0x75, 0x6e,\n\t0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, 0x74, 0x75,\n\t0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x34,\n\t0x0a, 0x0e, 0x47, 0x69, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73,\n\t0x12, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t0x65, 0x1a, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61,\n\t0x67, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0f, 0x47, 0x69, 0x74, 0x53, 0x53, 0x48, 0x53, 0x69,\n\t0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c,\n\t0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65,\n\t0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, 0x47,\n\t0x69, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e,\n\t0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d,\n\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0a, 0x4c, 0x6f, 0x66, 0x74,\n\t0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e,\n\t0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c,\n\t0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x0d, 0x47, 0x50,\n\t0x47, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x0f, 0x2e, 0x74, 0x75,\n\t0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, 0x74,\n\t0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12,\n\t0x30, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0f, 0x2e,\n\t0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f,\n\t0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22,\n\t0x00, 0x12, 0x48, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x72, 0x74,\n\t0x12, 0x1a, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72,\n\t0x64, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74,\n\t0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x72,\n\t0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x53,\n\t0x74, 0x6f, 0x70, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e,\n\t0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x46, 0x6f, 0x72, 0x77,\n\t0x61, 0x72, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f,\n\t0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x46, 0x6f, 0x72, 0x77,\n\t0x61, 0x72, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,\n\t0x00, 0x12, 0x32, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x47, 0x69, 0x74, 0x43, 0x6c,\n\t0x6f, 0x6e, 0x65, 0x12, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x45, 0x6d, 0x70,\n\t0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x43, 0x68, 0x75, 0x6e,\n\t0x6b, 0x22, 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x57,\n\t0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65,\n\t0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c,\n\t0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x0b, 0x53, 0x74,\n\t0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x74, 0x75, 0x6e, 0x6e,\n\t0x65, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x43,\n\t0x68, 0x75, 0x6e, 0x6b, 0x22, 0x00, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68,\n\t0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x6f, 0x66, 0x74, 0x2d, 0x73, 0x68, 0x2f, 0x64,\n\t0x65, 0x76, 0x70, 0x6f, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f,\n\t0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n})\n\nvar (\n\tfile_tunnel_proto_rawDescOnce sync.Once\n\tfile_tunnel_proto_rawDescData []byte\n)\n\nfunc file_tunnel_proto_rawDescGZIP() []byte {\n\tfile_tunnel_proto_rawDescOnce.Do(func() {\n\t\tfile_tunnel_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tunnel_proto_rawDesc), len(file_tunnel_proto_rawDesc)))\n\t})\n\treturn file_tunnel_proto_rawDescData\n}\n\nvar file_tunnel_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_tunnel_proto_msgTypes = make([]protoimpl.MessageInfo, 9)\nvar file_tunnel_proto_goTypes = []any{\n\t(LogLevel)(0),                   // 0: tunnel.LogLevel\n\t(*StreamMountRequest)(nil),      // 1: tunnel.StreamMountRequest\n\t(*StopForwardPortRequest)(nil),  // 2: tunnel.StopForwardPortRequest\n\t(*StopForwardPortResponse)(nil), // 3: tunnel.StopForwardPortResponse\n\t(*ForwardPortRequest)(nil),      // 4: tunnel.ForwardPortRequest\n\t(*ForwardPortResponse)(nil),     // 5: tunnel.ForwardPortResponse\n\t(*Message)(nil),                 // 6: tunnel.Message\n\t(*Chunk)(nil),                   // 7: tunnel.Chunk\n\t(*LogMessage)(nil),              // 8: tunnel.LogMessage\n\t(*Empty)(nil),                   // 9: tunnel.Empty\n}\nvar file_tunnel_proto_depIdxs = []int32{\n\t0,  // 0: tunnel.LogMessage.logLevel:type_name -> tunnel.LogLevel\n\t9,  // 1: tunnel.Tunnel.Ping:input_type -> tunnel.Empty\n\t8,  // 2: tunnel.Tunnel.Log:input_type -> tunnel.LogMessage\n\t6,  // 3: tunnel.Tunnel.SendResult:input_type -> tunnel.Message\n\t6,  // 4: tunnel.Tunnel.DockerCredentials:input_type -> tunnel.Message\n\t6,  // 5: tunnel.Tunnel.GitCredentials:input_type -> tunnel.Message\n\t6,  // 6: tunnel.Tunnel.GitSSHSignature:input_type -> tunnel.Message\n\t9,  // 7: tunnel.Tunnel.GitUser:input_type -> tunnel.Empty\n\t6,  // 8: tunnel.Tunnel.LoftConfig:input_type -> tunnel.Message\n\t6,  // 9: tunnel.Tunnel.GPGPublicKeys:input_type -> tunnel.Message\n\t6,  // 10: tunnel.Tunnel.KubeConfig:input_type -> tunnel.Message\n\t4,  // 11: tunnel.Tunnel.ForwardPort:input_type -> tunnel.ForwardPortRequest\n\t2,  // 12: tunnel.Tunnel.StopForwardPort:input_type -> tunnel.StopForwardPortRequest\n\t9,  // 13: tunnel.Tunnel.StreamGitClone:input_type -> tunnel.Empty\n\t9,  // 14: tunnel.Tunnel.StreamWorkspace:input_type -> tunnel.Empty\n\t1,  // 15: tunnel.Tunnel.StreamMount:input_type -> tunnel.StreamMountRequest\n\t9,  // 16: tunnel.Tunnel.Ping:output_type -> tunnel.Empty\n\t9,  // 17: tunnel.Tunnel.Log:output_type -> tunnel.Empty\n\t9,  // 18: tunnel.Tunnel.SendResult:output_type -> tunnel.Empty\n\t6,  // 19: tunnel.Tunnel.DockerCredentials:output_type -> tunnel.Message\n\t6,  // 20: tunnel.Tunnel.GitCredentials:output_type -> tunnel.Message\n\t6,  // 21: tunnel.Tunnel.GitSSHSignature:output_type -> tunnel.Message\n\t6,  // 22: tunnel.Tunnel.GitUser:output_type -> tunnel.Message\n\t6,  // 23: tunnel.Tunnel.LoftConfig:output_type -> tunnel.Message\n\t6,  // 24: tunnel.Tunnel.GPGPublicKeys:output_type -> tunnel.Message\n\t6,  // 25: tunnel.Tunnel.KubeConfig:output_type -> tunnel.Message\n\t5,  // 26: tunnel.Tunnel.ForwardPort:output_type -> tunnel.ForwardPortResponse\n\t3,  // 27: tunnel.Tunnel.StopForwardPort:output_type -> tunnel.StopForwardPortResponse\n\t7,  // 28: tunnel.Tunnel.StreamGitClone:output_type -> tunnel.Chunk\n\t7,  // 29: tunnel.Tunnel.StreamWorkspace:output_type -> tunnel.Chunk\n\t7,  // 30: tunnel.Tunnel.StreamMount:output_type -> tunnel.Chunk\n\t16, // [16:31] is the sub-list for method output_type\n\t1,  // [1:16] is the sub-list for method input_type\n\t1,  // [1:1] is the sub-list for extension type_name\n\t1,  // [1:1] is the sub-list for extension extendee\n\t0,  // [0:1] is the sub-list for field type_name\n}\n\nfunc init() { file_tunnel_proto_init() }\nfunc file_tunnel_proto_init() {\n\tif File_tunnel_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: unsafe.Slice(unsafe.StringData(file_tunnel_proto_rawDesc), len(file_tunnel_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   9,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_tunnel_proto_goTypes,\n\t\tDependencyIndexes: file_tunnel_proto_depIdxs,\n\t\tEnumInfos:         file_tunnel_proto_enumTypes,\n\t\tMessageInfos:      file_tunnel_proto_msgTypes,\n\t}.Build()\n\tFile_tunnel_proto = out.File\n\tfile_tunnel_proto_goTypes = nil\n\tfile_tunnel_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/agent/tunnel/tunnel.proto",
    "content": "// protoc -I . tunnel.proto  --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative\nsyntax = \"proto3\";\n\noption go_package = \"github.com/loft-sh/devpod/pkg/agent/tunnel\";\n\npackage tunnel;\n\nservice Tunnel {\n  rpc Ping(Empty) returns (Empty) {}\n  rpc Log(LogMessage) returns (Empty) {}\n  rpc SendResult(Message) returns (Empty) {}\n\n  rpc DockerCredentials(Message) returns (Message) {}\n  rpc GitCredentials(Message) returns (Message) {}\n  rpc GitSSHSignature(Message) returns (Message) {}\n  rpc GitUser(Empty) returns (Message) {}\n  rpc LoftConfig(Message) returns (Message) {}\n  rpc GPGPublicKeys(Message) returns (Message) {}\n  rpc KubeConfig(Message) returns (Message) {}\n\n  rpc ForwardPort(ForwardPortRequest) returns (ForwardPortResponse) {}\n  rpc StopForwardPort(StopForwardPortRequest) returns (StopForwardPortResponse) {}\n\n  rpc StreamWorkspace(Empty) returns (stream Chunk) {}\n  rpc StreamMount(StreamMountRequest) returns (stream Chunk) {}\n}\n\nmessage StreamMountRequest {\n  string mount = 1;\n}\n\nmessage StopForwardPortRequest {\n  string port = 1;\n}\n\nmessage StopForwardPortResponse {\n\n}\n\nmessage ForwardPortRequest {\n  string port = 1;\n}\n\nmessage ForwardPortResponse {\n\n}\n\nmessage Message {\n  string message = 1;\n}\n\nmessage Chunk {\n  bytes Content = 1;\n}\n\nenum LogLevel {\n  DEBUG = 0;\n  INFO = 1;\n  DONE = 2;\n  WARNING = 3;\n  ERROR = 4;\n}\n\nmessage LogMessage {\n  LogLevel logLevel = 1;\n  string message = 2;\n}\n\nmessage Empty {\n\n}\n"
  },
  {
    "path": "pkg/agent/tunnel/tunnel_grpc.pb.go",
    "content": "// protoc -I . tunnel.proto  --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative\n\n// Code generated by protoc-gen-go-grpc. DO NOT EDIT.\n// versions:\n// - protoc-gen-go-grpc v1.5.1\n// - protoc             v5.27.3\n// source: tunnel.proto\n\npackage tunnel\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatus \"google.golang.org/grpc/status\"\n)\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the grpc package it is being compiled against.\n// Requires gRPC-Go v1.64.0 or later.\nconst _ = grpc.SupportPackageIsVersion9\n\nconst (\n\tTunnel_Ping_FullMethodName              = \"/tunnel.Tunnel/Ping\"\n\tTunnel_Log_FullMethodName               = \"/tunnel.Tunnel/Log\"\n\tTunnel_SendResult_FullMethodName        = \"/tunnel.Tunnel/SendResult\"\n\tTunnel_DockerCredentials_FullMethodName = \"/tunnel.Tunnel/DockerCredentials\"\n\tTunnel_GitCredentials_FullMethodName    = \"/tunnel.Tunnel/GitCredentials\"\n\tTunnel_GitSSHSignature_FullMethodName   = \"/tunnel.Tunnel/GitSSHSignature\"\n\tTunnel_GitUser_FullMethodName           = \"/tunnel.Tunnel/GitUser\"\n\tTunnel_LoftConfig_FullMethodName        = \"/tunnel.Tunnel/LoftConfig\"\n\tTunnel_GPGPublicKeys_FullMethodName     = \"/tunnel.Tunnel/GPGPublicKeys\"\n\tTunnel_KubeConfig_FullMethodName        = \"/tunnel.Tunnel/KubeConfig\"\n\tTunnel_ForwardPort_FullMethodName       = \"/tunnel.Tunnel/ForwardPort\"\n\tTunnel_StopForwardPort_FullMethodName   = \"/tunnel.Tunnel/StopForwardPort\"\n\tTunnel_StreamGitClone_FullMethodName    = \"/tunnel.Tunnel/StreamGitClone\"\n\tTunnel_StreamWorkspace_FullMethodName   = \"/tunnel.Tunnel/StreamWorkspace\"\n\tTunnel_StreamMount_FullMethodName       = \"/tunnel.Tunnel/StreamMount\"\n)\n\n// TunnelClient is the client API for Tunnel service.\n//\n// 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.\ntype TunnelClient interface {\n\tPing(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)\n\tLog(ctx context.Context, in *LogMessage, opts ...grpc.CallOption) (*Empty, error)\n\tSendResult(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error)\n\tDockerCredentials(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tGitCredentials(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tGitSSHSignature(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tGitUser(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Message, error)\n\tLoftConfig(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tGPGPublicKeys(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tKubeConfig(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)\n\tForwardPort(ctx context.Context, in *ForwardPortRequest, opts ...grpc.CallOption) (*ForwardPortResponse, error)\n\tStopForwardPort(ctx context.Context, in *StopForwardPortRequest, opts ...grpc.CallOption) (*StopForwardPortResponse, error)\n\tStreamGitClone(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error)\n\tStreamWorkspace(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error)\n\tStreamMount(ctx context.Context, in *StreamMountRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error)\n}\n\ntype tunnelClient struct {\n\tcc grpc.ClientConnInterface\n}\n\nfunc NewTunnelClient(cc grpc.ClientConnInterface) TunnelClient {\n\treturn &tunnelClient{cc}\n}\n\nfunc (c *tunnelClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Empty)\n\terr := c.cc.Invoke(ctx, Tunnel_Ping_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) Log(ctx context.Context, in *LogMessage, opts ...grpc.CallOption) (*Empty, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Empty)\n\terr := c.cc.Invoke(ctx, Tunnel_Log_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) SendResult(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Empty)\n\terr := c.cc.Invoke(ctx, Tunnel_SendResult_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) DockerCredentials(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_DockerCredentials_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) GitCredentials(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_GitCredentials_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) GitSSHSignature(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_GitSSHSignature_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) GitUser(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_GitUser_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) LoftConfig(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_LoftConfig_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) GPGPublicKeys(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_GPGPublicKeys_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) KubeConfig(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(Message)\n\terr := c.cc.Invoke(ctx, Tunnel_KubeConfig_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) ForwardPort(ctx context.Context, in *ForwardPortRequest, opts ...grpc.CallOption) (*ForwardPortResponse, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(ForwardPortResponse)\n\terr := c.cc.Invoke(ctx, Tunnel_ForwardPort_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) StopForwardPort(ctx context.Context, in *StopForwardPortRequest, opts ...grpc.CallOption) (*StopForwardPortResponse, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(StopForwardPortResponse)\n\terr := c.cc.Invoke(ctx, Tunnel_StopForwardPort_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *tunnelClient) StreamGitClone(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tstream, err := c.cc.NewStream(ctx, &Tunnel_ServiceDesc.Streams[0], Tunnel_StreamGitClone_FullMethodName, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &grpc.GenericClientStream[Empty, Chunk]{ClientStream: stream}\n\tif err := x.ClientStream.SendMsg(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := x.ClientStream.CloseSend(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn x, nil\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamGitCloneClient = grpc.ServerStreamingClient[Chunk]\n\nfunc (c *tunnelClient) StreamWorkspace(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tstream, err := c.cc.NewStream(ctx, &Tunnel_ServiceDesc.Streams[1], Tunnel_StreamWorkspace_FullMethodName, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &grpc.GenericClientStream[Empty, Chunk]{ClientStream: stream}\n\tif err := x.ClientStream.SendMsg(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := x.ClientStream.CloseSend(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn x, nil\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamWorkspaceClient = grpc.ServerStreamingClient[Chunk]\n\nfunc (c *tunnelClient) StreamMount(ctx context.Context, in *StreamMountRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tstream, err := c.cc.NewStream(ctx, &Tunnel_ServiceDesc.Streams[2], Tunnel_StreamMount_FullMethodName, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &grpc.GenericClientStream[StreamMountRequest, Chunk]{ClientStream: stream}\n\tif err := x.ClientStream.SendMsg(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := x.ClientStream.CloseSend(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn x, nil\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamMountClient = grpc.ServerStreamingClient[Chunk]\n\n// TunnelServer is the server API for Tunnel service.\n// All implementations must embed UnimplementedTunnelServer\n// for forward compatibility.\ntype TunnelServer interface {\n\tPing(context.Context, *Empty) (*Empty, error)\n\tLog(context.Context, *LogMessage) (*Empty, error)\n\tSendResult(context.Context, *Message) (*Empty, error)\n\tDockerCredentials(context.Context, *Message) (*Message, error)\n\tGitCredentials(context.Context, *Message) (*Message, error)\n\tGitSSHSignature(context.Context, *Message) (*Message, error)\n\tGitUser(context.Context, *Empty) (*Message, error)\n\tLoftConfig(context.Context, *Message) (*Message, error)\n\tGPGPublicKeys(context.Context, *Message) (*Message, error)\n\tKubeConfig(context.Context, *Message) (*Message, error)\n\tForwardPort(context.Context, *ForwardPortRequest) (*ForwardPortResponse, error)\n\tStopForwardPort(context.Context, *StopForwardPortRequest) (*StopForwardPortResponse, error)\n\tStreamGitClone(*Empty, grpc.ServerStreamingServer[Chunk]) error\n\tStreamWorkspace(*Empty, grpc.ServerStreamingServer[Chunk]) error\n\tStreamMount(*StreamMountRequest, grpc.ServerStreamingServer[Chunk]) error\n\tmustEmbedUnimplementedTunnelServer()\n}\n\n// UnimplementedTunnelServer must be embedded to have\n// forward compatible implementations.\n//\n// NOTE: this should be embedded by value instead of pointer to avoid a nil\n// pointer dereference when methods are called.\ntype UnimplementedTunnelServer struct{}\n\nfunc (UnimplementedTunnelServer) Ping(context.Context, *Empty) (*Empty, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Ping not implemented\")\n}\nfunc (UnimplementedTunnelServer) Log(context.Context, *LogMessage) (*Empty, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Log not implemented\")\n}\nfunc (UnimplementedTunnelServer) SendResult(context.Context, *Message) (*Empty, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method SendResult not implemented\")\n}\nfunc (UnimplementedTunnelServer) DockerCredentials(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method DockerCredentials not implemented\")\n}\nfunc (UnimplementedTunnelServer) GitCredentials(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method GitCredentials not implemented\")\n}\nfunc (UnimplementedTunnelServer) GitSSHSignature(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method GitSSHSignature not implemented\")\n}\nfunc (UnimplementedTunnelServer) GitUser(context.Context, *Empty) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method GitUser not implemented\")\n}\nfunc (UnimplementedTunnelServer) LoftConfig(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method LoftConfig not implemented\")\n}\nfunc (UnimplementedTunnelServer) GPGPublicKeys(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method GPGPublicKeys not implemented\")\n}\nfunc (UnimplementedTunnelServer) KubeConfig(context.Context, *Message) (*Message, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method KubeConfig not implemented\")\n}\nfunc (UnimplementedTunnelServer) ForwardPort(context.Context, *ForwardPortRequest) (*ForwardPortResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method ForwardPort not implemented\")\n}\nfunc (UnimplementedTunnelServer) StopForwardPort(context.Context, *StopForwardPortRequest) (*StopForwardPortResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method StopForwardPort not implemented\")\n}\nfunc (UnimplementedTunnelServer) StreamGitClone(*Empty, grpc.ServerStreamingServer[Chunk]) error {\n\treturn status.Errorf(codes.Unimplemented, \"method StreamGitClone not implemented\")\n}\nfunc (UnimplementedTunnelServer) StreamWorkspace(*Empty, grpc.ServerStreamingServer[Chunk]) error {\n\treturn status.Errorf(codes.Unimplemented, \"method StreamWorkspace not implemented\")\n}\nfunc (UnimplementedTunnelServer) StreamMount(*StreamMountRequest, grpc.ServerStreamingServer[Chunk]) error {\n\treturn status.Errorf(codes.Unimplemented, \"method StreamMount not implemented\")\n}\nfunc (UnimplementedTunnelServer) mustEmbedUnimplementedTunnelServer() {}\nfunc (UnimplementedTunnelServer) testEmbeddedByValue()                {}\n\n// UnsafeTunnelServer may be embedded to opt out of forward compatibility for this service.\n// Use of this interface is not recommended, as added methods to TunnelServer will\n// result in compilation errors.\ntype UnsafeTunnelServer interface {\n\tmustEmbedUnimplementedTunnelServer()\n}\n\nfunc RegisterTunnelServer(s grpc.ServiceRegistrar, srv TunnelServer) {\n\t// If the following call pancis, it indicates UnimplementedTunnelServer was\n\t// embedded by pointer and is nil.  This will cause panics if an\n\t// unimplemented method is ever invoked, so we test this at initialization\n\t// time to prevent it from happening at runtime later due to I/O.\n\tif t, ok := srv.(interface{ testEmbeddedByValue() }); ok {\n\t\tt.testEmbeddedByValue()\n\t}\n\ts.RegisterService(&Tunnel_ServiceDesc, srv)\n}\n\nfunc _Tunnel_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Empty)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).Ping(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_Ping_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).Ping(ctx, req.(*Empty))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(LogMessage)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).Log(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_Log_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).Log(ctx, req.(*LogMessage))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_SendResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).SendResult(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_SendResult_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).SendResult(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_DockerCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).DockerCredentials(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_DockerCredentials_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).DockerCredentials(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_GitCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).GitCredentials(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_GitCredentials_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).GitCredentials(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_GitSSHSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).GitSSHSignature(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_GitSSHSignature_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).GitSSHSignature(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_GitUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Empty)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).GitUser(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_GitUser_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).GitUser(ctx, req.(*Empty))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_LoftConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).LoftConfig(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_LoftConfig_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).LoftConfig(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_GPGPublicKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).GPGPublicKeys(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_GPGPublicKeys_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).GPGPublicKeys(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_KubeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(Message)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).KubeConfig(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_KubeConfig_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).KubeConfig(ctx, req.(*Message))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_ForwardPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(ForwardPortRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).ForwardPort(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_ForwardPort_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).ForwardPort(ctx, req.(*ForwardPortRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_StopForwardPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(StopForwardPortRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(TunnelServer).StopForwardPort(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: Tunnel_StopForwardPort_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(TunnelServer).StopForwardPort(ctx, req.(*StopForwardPortRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Tunnel_StreamGitClone_Handler(srv interface{}, stream grpc.ServerStream) error {\n\tm := new(Empty)\n\tif err := stream.RecvMsg(m); err != nil {\n\t\treturn err\n\t}\n\treturn srv.(TunnelServer).StreamGitClone(m, &grpc.GenericServerStream[Empty, Chunk]{ServerStream: stream})\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamGitCloneServer = grpc.ServerStreamingServer[Chunk]\n\nfunc _Tunnel_StreamWorkspace_Handler(srv interface{}, stream grpc.ServerStream) error {\n\tm := new(Empty)\n\tif err := stream.RecvMsg(m); err != nil {\n\t\treturn err\n\t}\n\treturn srv.(TunnelServer).StreamWorkspace(m, &grpc.GenericServerStream[Empty, Chunk]{ServerStream: stream})\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamWorkspaceServer = grpc.ServerStreamingServer[Chunk]\n\nfunc _Tunnel_StreamMount_Handler(srv interface{}, stream grpc.ServerStream) error {\n\tm := new(StreamMountRequest)\n\tif err := stream.RecvMsg(m); err != nil {\n\t\treturn err\n\t}\n\treturn srv.(TunnelServer).StreamMount(m, &grpc.GenericServerStream[StreamMountRequest, Chunk]{ServerStream: stream})\n}\n\n// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.\ntype Tunnel_StreamMountServer = grpc.ServerStreamingServer[Chunk]\n\n// Tunnel_ServiceDesc is the grpc.ServiceDesc for Tunnel service.\n// It's only intended for direct use with grpc.RegisterService,\n// and not to be introspected or modified (even as a copy)\nvar Tunnel_ServiceDesc = grpc.ServiceDesc{\n\tServiceName: \"tunnel.Tunnel\",\n\tHandlerType: (*TunnelServer)(nil),\n\tMethods: []grpc.MethodDesc{\n\t\t{\n\t\t\tMethodName: \"Ping\",\n\t\t\tHandler:    _Tunnel_Ping_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Log\",\n\t\t\tHandler:    _Tunnel_Log_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"SendResult\",\n\t\t\tHandler:    _Tunnel_SendResult_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"DockerCredentials\",\n\t\t\tHandler:    _Tunnel_DockerCredentials_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"GitCredentials\",\n\t\t\tHandler:    _Tunnel_GitCredentials_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"GitSSHSignature\",\n\t\t\tHandler:    _Tunnel_GitSSHSignature_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"GitUser\",\n\t\t\tHandler:    _Tunnel_GitUser_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"LoftConfig\",\n\t\t\tHandler:    _Tunnel_LoftConfig_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"GPGPublicKeys\",\n\t\t\tHandler:    _Tunnel_GPGPublicKeys_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"KubeConfig\",\n\t\t\tHandler:    _Tunnel_KubeConfig_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"ForwardPort\",\n\t\t\tHandler:    _Tunnel_ForwardPort_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"StopForwardPort\",\n\t\t\tHandler:    _Tunnel_StopForwardPort_Handler,\n\t\t},\n\t},\n\tStreams: []grpc.StreamDesc{\n\t\t{\n\t\t\tStreamName:    \"StreamGitClone\",\n\t\t\tHandler:       _Tunnel_StreamGitClone_Handler,\n\t\t\tServerStreams: true,\n\t\t},\n\t\t{\n\t\t\tStreamName:    \"StreamWorkspace\",\n\t\t\tHandler:       _Tunnel_StreamWorkspace_Handler,\n\t\t\tServerStreams: true,\n\t\t},\n\t\t{\n\t\t\tStreamName:    \"StreamMount\",\n\t\t\tHandler:       _Tunnel_StreamMount_Handler,\n\t\t\tServerStreams: true,\n\t\t},\n\t},\n\tMetadata: \"tunnel.proto\",\n}\n"
  },
  {
    "path": "pkg/agent/tunnelserver/client.go",
    "content": "package tunnelserver\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/stdio\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n\t\"google.golang.org/grpc/resolver\"\n)\n\nfunc NewTunnelClient(reader io.Reader, writer io.WriteCloser, exitOnClose bool, exitCode int) (tunnel.TunnelClient, error) {\n\tpipe := stdio.NewStdioStream(reader, writer, exitOnClose, exitCode)\n\n\t// After moving from deprecated grpc.Dial to grpc.NewClient we need to setup resolver first\n\t// https://github.com/grpc/grpc-go/issues/1786#issuecomment-2119088770\n\tresolver.SetDefaultScheme(\"passthrough\")\n\n\t// Set up a connection to the server.\n\tconn, err := grpc.NewClient(\"\",\n\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t\tgrpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {\n\t\t\treturn pipe, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := tunnel.NewTunnelClient(conn)\n\n\treturn c, nil\n}\n"
  },
  {
    "path": "pkg/agent/tunnelserver/logger.go",
    "content": "package tunnelserver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/go-logr/logr\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc NewTunnelLogger(ctx context.Context, client tunnel.TunnelClient, debug bool) log.Logger {\n\tlevel := logrus.InfoLevel\n\tif debug {\n\t\tlevel = logrus.DebugLevel\n\t}\n\n\tlogger := &tunnelLogger{\n\t\tctx:     ctx,\n\t\tclient:  client,\n\t\tlevel:   level,\n\t\tlogChan: make(chan *tunnel.LogMessage, 1000), // Buffer size of 1000 messages\n\t}\n\n\tgo logger.worker()\n\n\treturn logger\n}\n\ntype tunnelLogger struct {\n\tctx     context.Context\n\tlevel   logrus.Level\n\tclient  tunnel.TunnelClient\n\tlogChan chan *tunnel.LogMessage\n}\n\nfunc (s *tunnelLogger) worker() {\n\tfor {\n\t\tselect {\n\t\tcase msg := <-s.logChan:\n\t\t\tctx, cancel := context.WithTimeout(s.ctx, 5*time.Second)\n\t\t\t_, _ = s.client.Log(ctx, msg)\n\t\t\t// ignore error since we can't use the logger itself\n\t\t\tcancel()\n\t\tcase <-s.ctx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (s *tunnelLogger) Debug(args ...interface{}) {\n\tif s.level < logrus.DebugLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_DEBUG,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n}\n\nfunc (s *tunnelLogger) Debugf(format string, args ...interface{}) {\n\tif s.level < logrus.DebugLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_DEBUG,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n}\n\nfunc (s *tunnelLogger) Info(args ...interface{}) {\n\tif s.level < logrus.InfoLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_INFO,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n}\n\nfunc (s *tunnelLogger) Infof(format string, args ...interface{}) {\n\tif s.level < logrus.InfoLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_INFO,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n}\n\nfunc (s *tunnelLogger) Warn(args ...interface{}) {\n\tif s.level < logrus.WarnLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_WARNING,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n}\n\nfunc (s *tunnelLogger) Warnf(format string, args ...interface{}) {\n\tif s.level < logrus.WarnLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_WARNING,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n}\n\nfunc (s *tunnelLogger) Error(args ...interface{}) {\n\tif s.level < logrus.ErrorLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_ERROR,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n}\n\nfunc (s *tunnelLogger) Errorf(format string, args ...interface{}) {\n\tif s.level < logrus.ErrorLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_ERROR,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n}\n\nfunc (s *tunnelLogger) Fatal(args ...interface{}) {\n\tif s.level < logrus.FatalLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_ERROR,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n\n\tos.Exit(1)\n}\n\nfunc (s *tunnelLogger) Fatalf(format string, args ...interface{}) {\n\tif s.level < logrus.FatalLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_ERROR,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n\n\tos.Exit(1)\n}\n\nfunc (s *tunnelLogger) Done(args ...interface{}) {\n\tif s.level < logrus.InfoLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_DONE,\n\t\tMessage:  fmt.Sprintln(args...),\n\t}\n}\n\nfunc (s *tunnelLogger) Donef(format string, args ...interface{}) {\n\tif s.level < logrus.InfoLevel {\n\t\treturn\n\t}\n\n\ts.logChan <- &tunnel.LogMessage{\n\t\tLogLevel: tunnel.LogLevel_DONE,\n\t\tMessage:  fmt.Sprintf(format, args...) + \"\\n\",\n\t}\n}\n\nfunc (s *tunnelLogger) Print(level logrus.Level, args ...interface{}) {\n\tswitch level {\n\tcase logrus.InfoLevel:\n\t\ts.Info(args...)\n\tcase logrus.DebugLevel:\n\t\ts.Debug(args...)\n\tcase logrus.WarnLevel:\n\t\ts.Warn(args...)\n\tcase logrus.ErrorLevel:\n\t\ts.Error(args...)\n\tcase logrus.FatalLevel:\n\t\ts.Fatal(args...)\n\tcase logrus.PanicLevel:\n\t\ts.Fatal(args...)\n\tcase logrus.TraceLevel:\n\t\ts.Debug(args...)\n\t}\n}\n\nfunc (s *tunnelLogger) Printf(level logrus.Level, format string, args ...interface{}) {\n\tswitch level {\n\tcase logrus.InfoLevel:\n\t\ts.Infof(format, args...)\n\tcase logrus.DebugLevel:\n\t\ts.Debugf(format, args...)\n\tcase logrus.WarnLevel:\n\t\ts.Warnf(format, args...)\n\tcase logrus.ErrorLevel:\n\t\ts.Errorf(format, args...)\n\tcase logrus.FatalLevel:\n\t\ts.Fatalf(format, args...)\n\tcase logrus.PanicLevel:\n\t\ts.Fatalf(format, args...)\n\tcase logrus.TraceLevel:\n\t\ts.Debugf(format, args...)\n\t}\n}\n\nfunc (s *tunnelLogger) SetLevel(level logrus.Level) {\n\ts.level = level\n}\n\nfunc (s *tunnelLogger) GetLevel() logrus.Level {\n\treturn s.level\n}\n\nfunc (s *tunnelLogger) Writer(level logrus.Level, raw bool) io.WriteCloser {\n\tif s.level < level {\n\t\treturn &log.NopCloser{Writer: io.Discard}\n\t}\n\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tsa := scanner.NewScanner(reader)\n\t\tfor sa.Scan() {\n\t\t\tif raw {\n\t\t\t\ts.WriteString(level, sa.Text()+\"\\n\")\n\t\t\t} else {\n\t\t\t\ts.Print(level, sa.Text())\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn writer\n}\n\nfunc (s *tunnelLogger) WriteString(level logrus.Level, message string) {\n\tif s.level < level {\n\t\treturn\n\t}\n\n\t// TODO: support this correctly\n\ts.Print(level, message)\n}\n\nfunc (s *tunnelLogger) WriteLevel(level logrus.Level, message []byte) (int, error) {\n\tif s.level < level {\n\t\treturn 0, nil\n\t}\n\n\ts.Print(level, string(message))\n\treturn len(message), nil\n}\n\nfunc (s *tunnelLogger) Question(params *survey.QuestionOptions) (string, error) {\n\treturn \"\", fmt.Errorf(\"not supported\")\n}\n\nfunc (s *tunnelLogger) ErrorStreamOnly() log.Logger {\n\treturn s\n}\n\nfunc (*tunnelLogger) LogrLogSink() logr.LogSink {\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/agent/tunnelserver/options.go",
    "content": "package tunnelserver\n\nimport (\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/netstat\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n)\n\ntype Option func(*tunnelServer) *tunnelServer\n\nfunc WithWorkspace(workspace *provider2.Workspace) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.workspace = workspace\n\t\treturn s\n\t}\n}\n\nfunc WithForwarder(forwarder netstat.Forwarder) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.forwarder = forwarder\n\t\treturn s\n\t}\n}\n\nfunc WithAllowGitCredentials(allowGitCredentials bool) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.allowGitCredentials = allowGitCredentials\n\t\treturn s\n\t}\n}\n\nfunc WithAllowDockerCredentials(allowDockerCredentials bool) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.allowDockerCredentials = allowDockerCredentials\n\t\treturn s\n\t}\n}\n\nfunc WithAllowKubeConfig(allow bool) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.allowKubeConfig = allow\n\t\treturn s\n\t}\n}\n\nfunc WithMounts(mounts []*config.Mount) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.mounts = mounts\n\t\treturn s\n\t}\n}\n\nfunc WithPlatformOptions(options *devpod.PlatformOptions) Option {\n\treturn func(s *tunnelServer) *tunnelServer {\n\t\ts.platformOptions = options\n\t\treturn s\n\t}\n}\n"
  },
  {
    "path": "pkg/agent/tunnelserver/stream.go",
    "content": "package tunnelserver\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc NewStreamReader(stream tunnel.Tunnel_StreamWorkspaceClient, log log.Logger) io.Reader {\n\treader, writer := io.Pipe()\n\n\tgo func() {\n\t\tdefer writer.Close()\n\n\t\tfor {\n\t\t\tresp, err := stream.Recv()\n\t\t\tif resp != nil && len(resp.Content) > 0 {\n\t\t\t\t_, err = writer.Write(resp.Content)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Debugf(\"Error writing to pipe: %v\", err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\treturn\n\t\t\t} else if err != nil {\n\t\t\t\tlog.Debugf(\"Error receiving from stream: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn reader\n}\n\nfunc NewStreamWriter(stream tunnel.Tunnel_StreamWorkspaceServer, log log.Logger) io.Writer {\n\treturn &streamWriter{stream: stream, log: log, lastMessage: time.Now()}\n}\n\ntype streamWriter struct {\n\tstream tunnel.Tunnel_StreamWorkspaceServer\n\n\tlastMessage  time.Time\n\tbytesWritten int64\n\tlog          log.Logger\n}\n\nfunc (s *streamWriter) Write(p []byte) (int, error) {\n\terr := s.stream.Send(&tunnel.Chunk{Content: p})\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\ts.bytesWritten += int64(len(p))\n\tif time.Since(s.lastMessage) > time.Second*2 {\n\t\ts.log.Infof(\"Uploaded %.2f MB\", float64(s.bytesWritten)/1024/1024)\n\t\ts.lastMessage = time.Now()\n\t}\n\n\treturn len(p), nil\n}\n"
  },
  {
    "path": "pkg/agent/tunnelserver/tunnelserver.go",
    "content": "package tunnelserver\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\t\"github.com/loft-sh/devpod/pkg/gitsshsigning\"\n\t\"github.com/loft-sh/devpod/pkg/gpg\"\n\t\"github.com/loft-sh/devpod/pkg/loftconfig\"\n\t\"github.com/loft-sh/devpod/pkg/netstat\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/stdio\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/moby/patternmatcher/ignorefile\"\n\tperrors \"github.com/pkg/errors\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/reflection\"\n)\n\nfunc RunServicesServer(ctx context.Context, reader io.Reader, writer io.WriteCloser, allowGitCredentials, allowDockerCredentials bool, forwarder netstat.Forwarder, workspace *provider2.Workspace, log log.Logger, options ...Option) error {\n\topts := append(options, []Option{\n\t\tWithForwarder(forwarder),\n\t\tWithAllowGitCredentials(allowGitCredentials),\n\t\tWithAllowDockerCredentials(allowDockerCredentials),\n\t\tWithWorkspace(workspace),\n\t}...)\n\ttunnelServ := New(log, opts...)\n\n\treturn tunnelServ.Run(ctx, reader, writer)\n}\n\nfunc RunUpServer(ctx context.Context, reader io.Reader, writer io.WriteCloser, allowGitCredentials, allowDockerCredentials bool, workspace *provider2.Workspace, log log.Logger, options ...Option) (*config.Result, error) {\n\topts := append(options, []Option{\n\t\tWithWorkspace(workspace),\n\t\tWithAllowGitCredentials(allowGitCredentials),\n\t\tWithAllowDockerCredentials(allowDockerCredentials),\n\t}...)\n\ttunnelServ := New(log, opts...)\n\n\treturn tunnelServ.RunWithResult(ctx, reader, writer)\n}\n\nfunc RunSetupServer(ctx context.Context, reader io.Reader, writer io.WriteCloser, allowGitCredentials, allowDockerCredentials bool, mounts []*config.Mount, log log.Logger, options ...Option) (*config.Result, error) {\n\topts := append(options, []Option{\n\t\tWithMounts(mounts),\n\t\tWithAllowGitCredentials(allowGitCredentials),\n\t\tWithAllowDockerCredentials(allowDockerCredentials),\n\t\tWithAllowKubeConfig(true),\n\t}...)\n\ttunnelServ := New(log, opts...)\n\ttunnelServ.allowPlatformOptions = true\n\n\treturn tunnelServ.RunWithResult(ctx, reader, writer)\n}\n\nfunc New(log log.Logger, options ...Option) *tunnelServer {\n\ts := &tunnelServer{\n\t\tlog: log,\n\t}\n\tfor _, o := range options {\n\t\ts = o(s)\n\t}\n\n\treturn s\n}\n\ntype tunnelServer struct {\n\ttunnel.UnimplementedTunnelServer\n\n\t// stream mounts\n\tmounts []*config.Mount\n\n\tforwarder              netstat.Forwarder\n\tallowGitCredentials    bool\n\tallowDockerCredentials bool\n\tallowKubeConfig        bool\n\tallowPlatformOptions   bool\n\tresult                 *config.Result\n\tworkspace              *provider2.Workspace\n\tlog                    log.Logger\n\n\tplatformOptions *devpod.PlatformOptions\n}\n\nfunc (t *tunnelServer) RunWithResult(ctx context.Context, reader io.Reader, writer io.WriteCloser) (*config.Result, error) {\n\tlis := stdio.NewStdioListener(reader, writer, false)\n\ts := grpc.NewServer()\n\ttunnel.RegisterTunnelServer(s, t)\n\treflection.Register(s)\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\terrChan <- s.Serve(lis)\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\treturn nil, err\n\tcase <-ctx.Done():\n\t\treturn t.result, nil\n\t}\n}\n\nfunc (t *tunnelServer) Run(ctx context.Context, reader io.Reader, writer io.WriteCloser) error {\n\t_, err := t.RunWithResult(ctx, reader, writer)\n\treturn err\n}\n\nfunc (t *tunnelServer) ForwardPort(ctx context.Context, portRequest *tunnel.ForwardPortRequest) (*tunnel.ForwardPortResponse, error) {\n\tif t.forwarder == nil {\n\t\treturn nil, fmt.Errorf(\"cannot forward ports\")\n\t}\n\n\terr := t.forwarder.Forward(portRequest.Port)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error forwarding port %s: %w\", portRequest.Port, err)\n\t}\n\n\treturn &tunnel.ForwardPortResponse{}, nil\n}\nfunc (t *tunnelServer) StopForwardPort(ctx context.Context, portRequest *tunnel.StopForwardPortRequest) (*tunnel.StopForwardPortResponse, error) {\n\tif t.forwarder == nil {\n\t\treturn nil, fmt.Errorf(\"cannot forward ports\")\n\t}\n\n\terr := t.forwarder.StopForward(portRequest.Port)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error stop forwarding port %s: %w\", portRequest.Port, err)\n\t}\n\n\treturn &tunnel.StopForwardPortResponse{}, nil\n}\n\nfunc (t *tunnelServer) DockerCredentials(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\tif !t.allowDockerCredentials {\n\t\treturn nil, fmt.Errorf(\"docker credentials forbidden\")\n\t}\n\n\trequest := &dockercredentials.Request{}\n\terr := json.Unmarshal([]byte(message.Message), request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check if list or get\n\tif request.ServerURL != \"\" {\n\t\tcredentials, err := dockercredentials.GetAuthConfig(request.ServerURL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tout, err := json.Marshal(credentials)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &tunnel.Message{Message: string(out)}, nil\n\t}\n\n\t// do a list\n\tlistResponse, err := dockercredentials.ListCredentials()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout, err := json.Marshal(listResponse)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tunnel.Message{Message: string(out)}, nil\n}\n\nfunc (t *tunnelServer) GitUser(ctx context.Context, empty *tunnel.Empty) (*tunnel.Message, error) {\n\tgitUser, err := gitcredentials.GetUser(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout, err := json.Marshal(gitUser)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tunnel.Message{\n\t\tMessage: string(out),\n\t}, nil\n}\n\nfunc (t *tunnelServer) GitCredentials(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\tif !t.allowGitCredentials {\n\t\treturn nil, fmt.Errorf(\"git credentials forbidden\")\n\t}\n\n\tcredentials := &gitcredentials.GitCredentials{}\n\terr := json.Unmarshal([]byte(message.Message), credentials)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"decode git credentials request\")\n\t}\n\n\tif t.platformOptions != nil && t.platformOptions.Enabled {\n\t\tgitHttpCredentials := append(t.platformOptions.UserCredentials.GitHttp, t.platformOptions.ProjectCredentials.GitHttp...)\n\t\tif len(gitHttpCredentials) > 0 {\n\t\t\tif len(gitHttpCredentials) == 1 {\n\t\t\t\tcredentials.Username = gitHttpCredentials[0].User\n\t\t\t\tcredentials.Password = gitHttpCredentials[0].Password\n\t\t\t\tcredentials.Path = gitHttpCredentials[0].Path\n\t\t\t} else {\n\t\t\t\tfor _, credential := range gitHttpCredentials {\n\t\t\t\t\tif credential.Host == credentials.Host {\n\t\t\t\t\t\tcredentials.Username = credential.User\n\t\t\t\t\t\tcredentials.Password = credential.Password\n\t\t\t\t\t\tcredentials.Path = credential.Path\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif t.workspace.Source.GitRepository != \"\" {\n\t\t\tpath, err := gitcredentials.GetHTTPPath(ctx, gitcredentials.GetHttpPathParameters{\n\t\t\t\tHost:        credentials.Host,\n\t\t\t\tProtocol:    credentials.Protocol,\n\t\t\t\tCurrentPath: credentials.Path,\n\t\t\t\tRepository:  t.workspace.Source.GitRepository,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"get http path: %w\", err)\n\t\t\t}\n\t\t\t// Set the credentials `path` field to the path component of the git repository URL.\n\t\t\t// This allows downstream credential helpers to figure out which passwords needs to be fetched\n\t\t\tcredentials.Path = path\n\t\t}\n\n\t\tresponse, err := gitcredentials.GetCredentials(credentials)\n\t\tif err != nil {\n\t\t\treturn nil, perrors.Wrap(err, \"get git response\")\n\t\t}\n\t\tcredentials = response\n\t}\n\n\tout, err := json.Marshal(credentials)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tunnel.Message{Message: string(out)}, nil\n}\n\nfunc (t *tunnelServer) GitSSHSignature(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\tsignatureRequest := &gitsshsigning.GitSSHSignatureRequest{}\n\terr := json.Unmarshal([]byte(message.Message), signatureRequest)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"git ssh sign request\")\n\t}\n\n\tsignatureResponse, err := signatureRequest.Sign()\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"get git ssh signature\")\n\t}\n\n\tout, err := json.Marshal(signatureResponse)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tunnel.Message{Message: string(out)}, nil\n}\n\nfunc (t *tunnelServer) LoftConfig(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\tloftConfigRequest := &loftconfig.LoftConfigRequest{}\n\terr := json.Unmarshal([]byte(message.Message), loftConfigRequest)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"loft platform config request\")\n\t}\n\n\tvar response *loftconfig.LoftConfigResponse\n\tif t.workspace != nil {\n\t\tresponse, err = loftconfig.ReadFromWorkspace(t.workspace)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read loft config: %w\", err)\n\t\t}\n\t} else {\n\t\tresponse, err = loftconfig.Read(loftConfigRequest)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read loft config: %w\", err)\n\t\t}\n\t}\n\n\tout, err := json.Marshal(response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tunnel.Message{Message: string(out)}, nil\n}\n\nfunc (t *tunnelServer) KubeConfig(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\tif !t.allowKubeConfig {\n\t\treturn nil, fmt.Errorf(\"kube config forbidden\")\n\t}\n\n\tkubeConfig, err := platform.NewInstanceKubeConfig(ctx, t.platformOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create kube config: %w\", err)\n\t}\n\n\treturn &tunnel.Message{Message: string(kubeConfig)}, nil\n}\n\nfunc (t *tunnelServer) GPGPublicKeys(ctx context.Context, message *tunnel.Message) (*tunnel.Message, error) {\n\trawPubKeys, err := gpg.GetHostPubKey()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get gpg host public keys: %w\", err)\n\t}\n\n\tpubKeyArgument := base64.StdEncoding.EncodeToString(rawPubKeys)\n\n\treturn &tunnel.Message{Message: pubKeyArgument}, nil\n}\n\nfunc (t *tunnelServer) SendResult(ctx context.Context, result *tunnel.Message) (*tunnel.Empty, error) {\n\tparsedResult := &config.Result{}\n\terr := json.Unmarshal([]byte(result.Message), parsedResult)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt.result = parsedResult\n\treturn &tunnel.Empty{}, nil\n}\n\nfunc (t *tunnelServer) Ping(context.Context, *tunnel.Empty) (*tunnel.Empty, error) {\n\tt.log.Debugf(\"Received ping from agent\")\n\treturn &tunnel.Empty{}, nil\n}\n\nfunc (t *tunnelServer) Log(ctx context.Context, message *tunnel.LogMessage) (*tunnel.Empty, error) {\n\tif message.LogLevel == tunnel.LogLevel_DEBUG {\n\t\tt.log.Debug(strings.TrimSpace(message.Message))\n\t} else if message.LogLevel == tunnel.LogLevel_INFO {\n\t\tt.log.Info(strings.TrimSpace(message.Message))\n\t} else if message.LogLevel == tunnel.LogLevel_WARNING {\n\t\tt.log.Warn(strings.TrimSpace(message.Message))\n\t} else if message.LogLevel == tunnel.LogLevel_ERROR {\n\t\tt.log.Error(strings.TrimSpace(message.Message))\n\t} else if message.LogLevel == tunnel.LogLevel_DONE {\n\t\tt.log.Done(strings.TrimSpace(message.Message))\n\t}\n\n\treturn &tunnel.Empty{}, nil\n}\n\nfunc (t *tunnelServer) StreamWorkspace(message *tunnel.Empty, stream tunnel.Tunnel_StreamWorkspaceServer) error {\n\tif t.platformOptions != nil && t.platformOptions.Enabled && !t.allowPlatformOptions {\n\t\treturn fmt.Errorf(\"streaming workspace from local computer to platform workspace is not supported. Please specify a git repository to clone instead\")\n\t}\n\tif t.workspace == nil {\n\t\treturn fmt.Errorf(\"workspace is nil\")\n\t}\n\n\t// Get .devpodignore files to exclude\n\texcludes := []string{}\n\tf, err := os.Open(filepath.Join(t.workspace.Source.LocalFolder, \".devpodignore\"))\n\tif err == nil {\n\t\texcludes, err = ignorefile.ReadAll(f)\n\t\tif err != nil {\n\t\t\tt.log.Warnf(\"Error reading .devpodignore file: %v\", err)\n\t\t}\n\t}\n\n\tbuf := bufio.NewWriterSize(NewStreamWriter(stream, t.log), 10*1024)\n\terr = extract.WriteTarExclude(buf, t.workspace.Source.LocalFolder, false, excludes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// make sure buffer is flushed\n\treturn buf.Flush()\n}\n\nfunc (t *tunnelServer) StreamMount(message *tunnel.StreamMountRequest, stream tunnel.Tunnel_StreamMountServer) error {\n\tif t.platformOptions != nil && t.platformOptions.Enabled && !t.allowPlatformOptions {\n\t\treturn fmt.Errorf(\"streaming mounts from local computer to platform workspace is not supported. Please specify a git repository to clone instead\")\n\t}\n\n\tvar mount *config.Mount\n\tfor _, m := range t.mounts {\n\t\tif m.String() == message.Mount {\n\t\t\tmount = m\n\t\t\tbreak\n\t\t}\n\t}\n\tif mount == nil {\n\t\treturn fmt.Errorf(\"mount %s is not allowed to download\", message.Mount)\n\t}\n\n\t// Get .devpodignore files to exclude\n\texcludes := []string{}\n\tif t.workspace != nil {\n\t\tf, err := os.Open(filepath.Join(t.workspace.Source.LocalFolder, \".devpodignore\"))\n\t\tif err == nil {\n\t\t\texcludes, err = ignorefile.ReadAll(f)\n\t\t\tif err != nil {\n\t\t\t\tt.log.Warnf(\"Error reading .devpodignore file: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tbuf := bufio.NewWriterSize(NewStreamWriter(stream, t.log), 10*1024)\n\terr := extract.WriteTarExclude(buf, mount.Source, false, excludes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// make sure buffer is flushed\n\treturn buf.Flush()\n}\n"
  },
  {
    "path": "pkg/agent/workspace.go",
    "content": "package agent\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/moby/patternmatcher/ignorefile\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n\t\"google.golang.org/grpc/status\"\n)\n\nvar extraSearchLocations = []string{\"/home/devpod/.devpod/agent\", \"/opt/devpod/agent\", \"/var/lib/devpod/agent\", \"/var/devpod/agent\"}\n\nvar ErrFindAgentHomeFolder = fmt.Errorf(\"couldn't find devpod home directory\")\n\nfunc GetAgentDaemonLogFolder(agentFolder string) (string, error) {\n\treturn FindAgentHomeFolder(agentFolder)\n}\n\nfunc findDir(agentFolder string, validate func(path string) bool) string {\n\t// get agent folder\n\tif agentFolder != \"\" {\n\t\tif !validate(agentFolder) {\n\t\t\treturn \"\"\n\t\t}\n\n\t\treturn agentFolder\n\t}\n\n\t// check environment\n\thomeFolder := os.Getenv(config.DEVPOD_HOME)\n\tif homeFolder != \"\" {\n\t\thomeFolder = filepath.Join(homeFolder, \"agent\")\n\t\tif !validate(homeFolder) {\n\t\t\treturn \"\"\n\t\t}\n\n\t\treturn homeFolder\n\t}\n\n\t// check home folder first\n\thomeDir, _ := util.UserHomeDir()\n\tif homeDir != \"\" {\n\t\thomeDir = filepath.Join(homeDir, \".devpod\", \"agent\")\n\t\tif validate(homeDir) {\n\t\t\treturn homeDir\n\t\t}\n\t}\n\n\t// check root folder\n\thomeDir, _ = command.GetHome(\"root\")\n\tif homeDir != \"\" {\n\t\thomeDir = filepath.Join(homeDir, \".devpod\", \"agent\")\n\t\tif validate(homeDir) {\n\t\t\treturn homeDir\n\t\t}\n\t}\n\n\t// check current directory\n\texecDir, _ := os.Executable()\n\tif execDir != \"\" {\n\t\texecDir = filepath.Join(filepath.Dir(execDir), \"agent\")\n\t\tif validate(execDir) {\n\t\t\treturn execDir\n\t\t}\n\t}\n\n\t// check other folders\n\tfor _, dir := range extraSearchLocations {\n\t\tif validate(dir) {\n\t\t\treturn dir\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\nfunc FindAgentHomeFolder(agentFolder string) (string, error) {\n\thomeDir := findDir(agentFolder, isDevPodHome)\n\tif homeDir != \"\" {\n\t\treturn homeDir, nil\n\t}\n\n\treturn \"\", ErrFindAgentHomeFolder\n}\n\nfunc isDevPodHome(dir string) bool {\n\t_, err := os.Stat(filepath.Join(dir, \"contexts\"))\n\treturn err == nil\n}\n\nfunc PrepareAgentHomeFolder(agentFolder string) (string, error) {\n\t// try to find agent home folder first\n\thomeFolder, err := FindAgentHomeFolder(agentFolder)\n\tif err == nil {\n\t\treturn homeFolder, nil\n\t}\n\n\t// try to find an executable directory\n\thomeDir := findDir(agentFolder, func(path string) bool {\n\t\tok, _ := isDirExecutable(path)\n\t\treturn ok\n\t})\n\tif homeDir != \"\" {\n\t\treturn homeDir, nil\n\t}\n\n\t// check if agentFolder is set\n\tif agentFolder != \"\" {\n\t\t_, err := isDirExecutable(agentFolder)\n\t\treturn \"\", err\n\t}\n\n\t// return generic error here\n\treturn \"\", fmt.Errorf(\"couldn't find an executable directory\")\n}\n\nfunc isDirExecutable(dir string) (bool, error) {\n\tif !filepath.IsAbs(dir) {\n\t\tvar err error\n\t\tdir, err = filepath.Abs(dir)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\terr := os.MkdirAll(dir, 0777)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\ttestFile := filepath.Join(dir, \"devpod_test.sh\")\n\terr = os.WriteFile(testFile, []byte(`#!/bin/sh\necho DevPod\n`), 0755)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer os.Remove(testFile)\n\tif runtime.GOOS != \"linux\" {\n\t\treturn true, nil\n\t}\n\n\t// try to execute\n\tout, err := exec.Command(testFile).Output()\n\tif err != nil {\n\t\treturn false, err\n\t} else if strings.TrimSpace(string(out)) != \"DevPod\" {\n\t\treturn false, fmt.Errorf(\"received %s, expected DevPod\", strings.TrimSpace(string(out)))\n\t}\n\n\treturn true, nil\n}\n\nfunc GetAgentWorkspaceContentDir(workspaceDir string) string {\n\treturn filepath.Join(workspaceDir, \"content\")\n}\n\nfunc GetAgentBinariesDirFromWorkspaceDir(workspaceDir string) (string, error) {\n\t// check if it already exists\n\t_, err := os.Stat(workspaceDir)\n\tif err == nil {\n\t\treturn filepath.Join(workspaceDir, \"binaries\"), nil\n\t}\n\n\treturn \"\", os.ErrNotExist\n}\n\nfunc GetAgentBinariesDir(agentFolder, context, workspaceID string) (string, error) {\n\thomeFolder, err := FindAgentHomeFolder(agentFolder)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif context == \"\" {\n\t\tcontext = config.DefaultContext\n\t}\n\n\t// workspace folder\n\tworkspaceDir := filepath.Join(homeFolder, \"contexts\", context, \"workspaces\", workspaceID)\n\n\t// get from workspace folder\n\treturn GetAgentBinariesDirFromWorkspaceDir(workspaceDir)\n}\n\nfunc GetAgentWorkspaceDir(agentFolder, context, workspaceID string) (string, error) {\n\thomeFolder, err := FindAgentHomeFolder(agentFolder)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif context == \"\" {\n\t\tcontext = config.DefaultContext\n\t}\n\n\t// workspace folder\n\tworkspaceDir := filepath.Join(homeFolder, \"contexts\", context, \"workspaces\", workspaceID)\n\n\t// check if it already exists\n\t_, err = os.Stat(workspaceDir)\n\tif err == nil {\n\t\treturn workspaceDir, nil\n\t}\n\n\treturn \"\", os.ErrNotExist\n}\n\nfunc CreateAgentWorkspaceDir(agentFolder, context, workspaceID string) (string, error) {\n\thomeFolder, err := PrepareAgentHomeFolder(agentFolder)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// workspace folder\n\tworkspaceDir := filepath.Join(homeFolder, \"contexts\", context, \"workspaces\", workspaceID)\n\n\t// create workspace folder\n\terr = os.MkdirAll(workspaceDir, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn workspaceDir, nil\n}\n\nfunc CloneRepositoryForWorkspace(\n\tctx context.Context,\n\tsource *provider2.WorkspaceSource,\n\tagentConfig *provider2.ProviderAgentConfig,\n\tworkspaceDir, helper string,\n\toptions provider2.CLIOptions,\n\toverwriteContent bool,\n\tlog log.Logger,\n) error {\n\tlog.Info(\"Clone repository\")\n\tlog.Infof(\"URL: %s\\n\", source.GitRepository)\n\tif source.GitBranch != \"\" {\n\t\tlog.Infof(\"Branch: %s\\n\", source.GitBranch)\n\t}\n\tif source.GitCommit != \"\" {\n\t\tlog.Infof(\"Commit: %s\\n\", source.GitCommit)\n\t}\n\tif source.GitSubPath != \"\" {\n\t\tlog.Infof(\"Subpath: %s\\n\", source.GitSubPath)\n\t}\n\tif source.GitPRReference != \"\" {\n\t\tlog.Infof(\"PR: %s\\n\", source.GitPRReference)\n\t}\n\n\t// remove the credential helper or otherwise we will receive strange errors within the container\n\tdefer func() {\n\t\tif helper != \"\" {\n\t\t\tif err := gitcredentials.RemoveHelperFromPath(gitcredentials.GetLocalGitConfigPath(workspaceDir)); err != nil {\n\t\t\t\tlog.Errorf(\"Remove git credential helper: %v\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// check if command exists\n\tif !command.Exists(\"git\") {\n\t\tlocal, _ := agentConfig.Local.Bool()\n\t\tif local {\n\t\t\treturn fmt.Errorf(\"seems like git isn't installed on your system. Please make sure to install git and make it available in the PATH\")\n\t\t}\n\t\tif err := git.InstallBinary(log); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif overwriteContent {\n\t\tif err := removeDirContents(workspaceDir); err != nil {\n\t\t\tlog.Infof(\"Failed cleanup\")\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setup private ssh key if passed in\n\textraEnv := []string{}\n\tgitSshCredentials := append(options.Platform.UserCredentials.GitSsh, options.Platform.ProjectCredentials.GitSsh...)\n\tif len(gitSshCredentials) > 0 {\n\t\tkeys := []string{}\n\t\tfor _, key := range gitSshCredentials {\n\t\t\tkeys = append(keys, key.Key)\n\t\t}\n\n\t\tsshExtraEnv, cleanUpSSHKey, err := setupSSHKey(keys, agentConfig.Path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer cleanUpSSHKey()\n\t\textraEnv = append(extraEnv, sshExtraEnv...)\n\t}\n\n\t// run git command\n\tgitInfo := git.NewGitInfo(source.GitRepository, source.GitBranch, source.GitCommit, source.GitPRReference, source.GitSubPath)\n\n\t// should run with platform git cache?\n\tplatformGitcacheEnabled := options.Platform.Enabled && options.Platform.RunnerSocket != \"\"\n\tif platformGitcacheEnabled {\n\t\t_, err := os.Stat(options.Platform.RunnerSocket)\n\t\tif err != nil {\n\t\t\tplatformGitcacheEnabled = false\n\t\t}\n\t}\n\n\t// try to clone with platform gitcache\n\tif platformGitcacheEnabled {\n\t\tdialer := &net.Dialer{}\n\t\tconn, err := dialer.DialContext(ctx, \"unix\", options.Platform.RunnerSocket)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"dial platform gitcache: %w\", err)\n\t\t}\n\t\tdefer conn.Close()\n\n\t\t// Set up a connection to the server.\n\t\tgrpcClient, err := grpc.NewClient(\n\t\t\t\"unix://\"+options.Platform.RunnerSocket,\n\t\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t\t\tgrpc.WithIdleTimeout(180*time.Minute), // cloning can take a long time for large monorepos\n\t\t)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create platform gitcache client: %w\", err)\n\t\t}\n\n\t\t// marshal options\n\t\tjsonOptions, err := json.Marshal(&devpod.CloneOptions{\n\t\t\tRepository:        source.GitRepository,\n\t\t\tBranch:            source.GitBranch,\n\t\t\tCommit:            source.GitCommit,\n\t\t\tPRReference:       source.GitPRReference,\n\t\t\tSubPath:           source.GitSubPath,\n\t\t\tCredentialsHelper: helper,\n\t\t\tExtraEnv:          append(git.GetDefaultExtraEnv(options.StrictHostKeyChecking), extraEnv...),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"marshal git options: %w\", err)\n\t\t}\n\n\t\t// create client\n\t\tlog.Infof(\"Cloning repository %s in platform\", source.GitRepository)\n\t\t_, err = devpod.NewRunnerClient(grpcClient).Clone(ctx, &devpod.CloneRequest{\n\t\t\tTargetPath: workspaceDir,\n\t\t\tOptions:    string(jsonOptions),\n\t\t})\n\t\tif err != nil {\n\t\t\t// unpack error\n\t\t\tstatusErr, ok := status.FromError(err)\n\t\t\tif ok && statusErr.Message() != \"\" {\n\t\t\t\terr = errors.New(statusErr.Message())\n\t\t\t}\n\n\t\t\t// cleanup workspace dir if clone failed, otherwise we won't try to clone again when rebuilding this workspace\n\t\t\tif cleanupErr := cleanupWorkspaceDir(workspaceDir); cleanupErr != nil {\n\t\t\t\treturn fmt.Errorf(\"clone repository (with gitcache): %w, cleanup workspace: %w\", err, cleanupErr)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"clone repository (with gitcache): %w\", err)\n\t\t}\n\t} else {\n\t\tif options.Platform.GitCloneStrategy != \"\" {\n\t\t\tlog.Infof(\"Using a %s clone\", options.Platform.GitCloneStrategy)\n\t\t}\n\t\tif options.Platform.GitSkipLFS {\n\t\t\tlog.Info(\"Skipping Git LFS\")\n\t\t}\n\t\terr := git.CloneRepositoryWithEnv(ctx, gitInfo, extraEnv, workspaceDir, helper, options.StrictHostKeyChecking, log, getGitOptions(options)...)\n\t\tif err != nil {\n\t\t\t// cleanup workspace dir if clone failed, otherwise we won't try to clone again when rebuilding this workspace\n\t\t\tif cleanupErr := cleanupWorkspaceDir(workspaceDir); cleanupErr != nil {\n\t\t\t\treturn fmt.Errorf(\"clone repository: %w, cleanup workspace: %w\", err, cleanupErr)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"clone repository: %w\", err)\n\t\t}\n\t}\n\n\tlog.Done(\"Successfully cloned repository\")\n\n\t// Get .devpodignore files to exclude\n\tf, err := os.Open(filepath.Join(workspaceDir, \".devpodignore\"))\n\tif err != nil {\n\t\treturn nil\n\t}\n\texcludes, err := ignorefile.ReadAll(f)\n\tif err != nil {\n\t\tlog.Warn(\".devpodignore file is invalid : \", err)\n\t\treturn nil\n\t}\n\t// Remove files from workspace content folder\n\tfor _, exclude := range excludes {\n\t\tos.RemoveAll(filepath.Join(workspaceDir, exclude))\n\t}\n\tlog.Debug(\"Ignore files from .devpodignore \", excludes)\n\n\treturn nil\n}\n\nfunc getGitOptions(options provider2.CLIOptions) []git.Option {\n\tgitOpts := []git.Option{}\n\tif options.GitCloneStrategy != \"\" {\n\t\tgitOpts = append(gitOpts, git.WithCloneStrategy(options.GitCloneStrategy))\n\t}\n\tif options.Platform.GitCloneStrategy != \"\" {\n\t\tgitOpts = append(gitOpts, git.WithCloneStrategy(git.CloneStrategy(options.Platform.GitCloneStrategy)))\n\t}\n\tif options.Platform.GitSkipLFS {\n\t\tgitOpts = append(gitOpts, git.WithSkipLFS())\n\t}\n\tif options.GitCloneRecursiveSubmodules {\n\t\tgitOpts = append(gitOpts, git.WithRecursiveSubmodules())\n\t}\n\treturn gitOpts\n}\n\nfunc cleanupWorkspaceDir(workspaceDir string) error {\n\treturn os.RemoveAll(workspaceDir)\n}\n\nfunc setupSSHKey(keys []string, agentPath string) ([]string, func(), error) {\n\tkeyFiles := []string{}\n\tfor _, key := range keys {\n\t\tkeyFile, err := os.CreateTemp(\"\", \"\")\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tdefer keyFile.Close()\n\n\t\tif err := writeSSHKey(keyFile, key); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tif err := os.Chmod(keyFile.Name(), 0o400); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tkeyFiles = append(keyFiles, keyFile.Name())\n\t}\n\n\tenv := []string{\"GIT_TERMINAL_PROMPT=0\"}\n\tgitSSHCmd := []string{agentPath, \"helper\", \"ssh-git-clone\"}\n\tfor _, keyFile := range keyFiles {\n\t\tgitSSHCmd = append(gitSSHCmd, \"--key-file=\"+keyFile)\n\t}\n\n\tenv = append(env, \"GIT_SSH_COMMAND=\"+command.Quote(gitSSHCmd))\n\tcleanup := func() {\n\t\tfor _, keyFile := range keyFiles {\n\t\t\tos.Remove(keyFile)\n\t\t}\n\t}\n\n\treturn env, cleanup, nil\n}\n\nfunc writeSSHKey(key *os.File, sshKey string) error {\n\tdata, err := base64.StdEncoding.DecodeString(sshKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = key.WriteString(string(data))\n\treturn err\n}\n\nfunc removeDirContents(dirPath string) error {\n\tentries, err := os.ReadDir(dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, entry := range entries {\n\t\tentryPath := filepath.Join(dirPath, entry.Name())\n\t\tif entry.IsDir() {\n\t\t\terr = os.RemoveAll(entryPath)\n\t\t} else {\n\t\t\terr = os.Remove(entryPath)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/binaries/download.go",
    "content": "package binaries\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/download\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/hash\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc ToEnvironmentWithBinaries(context string, workspace *provider2.Workspace, machine *provider2.Machine, options map[string]config.OptionValue, config *provider2.ProviderConfig, extraEnv map[string]string, log log.Logger) ([]string, error) {\n\tenviron := provider2.ToEnvironment(workspace, machine, options, extraEnv)\n\tbinariesMap, err := GetBinaries(context, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor k, v := range binariesMap {\n\t\tenviron = append(environ, k+\"=\"+v)\n\t}\n\treturn environ, nil\n}\n\nfunc GetBinariesFrom(config *provider2.ProviderConfig, binariesDir string) (map[string]string, error) {\n\tretBinaries := map[string]string{}\n\tfor binaryName, binaryLocations := range config.Binaries {\n\t\tfor _, binary := range binaryLocations {\n\t\t\tif binary.OS != runtime.GOOS || binary.Arch != runtime.GOARCH {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// get binaries\n\t\t\ttargetFolder := filepath.Join(binariesDir, strings.ToLower(binaryName))\n\t\t\tbinaryPath := getBinaryPath(binary, targetFolder)\n\t\t\t_, err := os.Stat(binaryPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error trying to find binary %s: %w\", binaryName, err)\n\t\t\t}\n\n\t\t\tretBinaries[binaryName] = binaryPath\n\t\t}\n\t\tif retBinaries[binaryName] == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cannot find provider binary %s, because no binary location matched OS %s and ARCH %s\", binaryName, runtime.GOOS, runtime.GOARCH)\n\t\t}\n\t}\n\n\treturn retBinaries, nil\n}\n\nfunc GetBinaries(context string, config *provider2.ProviderConfig) (map[string]string, error) {\n\tbinariesDir, err := provider2.GetProviderBinariesDir(context, config.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn GetBinariesFrom(config, binariesDir)\n}\n\nfunc DownloadBinaries(binaries map[string][]*provider2.ProviderBinary, targetFolder string, log log.Logger) (map[string]string, error) {\n\tretBinaries := map[string]string{}\n\tfor binaryName, binaryLocations := range binaries {\n\t\tfor _, binary := range binaryLocations {\n\t\t\tif binary.OS != runtime.GOOS || binary.Arch != runtime.GOARCH {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// check if binary is correct\n\t\t\ttargetFolder := filepath.Join(targetFolder, strings.ToLower(binaryName))\n\t\t\tbinaryPath := getBinaryPath(binary, targetFolder)\n\t\t\tif verifyBinary(binaryPath, binary.Checksum) || fromCache(binary, targetFolder, log) {\n\t\t\t\tretBinaries[binaryName] = binaryPath\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// try to download the binary\n\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\tbinaryPath, err := downloadBinary(binaryName, binary, targetFolder, log)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrapf(err, \"downloading binary %s\", binaryName)\n\t\t\t\t}\n\n\t\t\t\tif binary.Checksum != \"\" {\n\t\t\t\t\tfileHash, err := hash.File(binaryPath)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t_ = os.Remove(binaryPath)\n\t\t\t\t\t\tlog.Errorf(\"Error hashing %s: %v\", binaryPath, err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else if !strings.EqualFold(fileHash, binary.Checksum) {\n\t\t\t\t\t\t_ = os.Remove(binaryPath)\n\t\t\t\t\t\tlog.Errorf(\"Unexpected file checksum %s != %s for binary %s\", strings.ToLower(fileHash), strings.ToLower(binary.Checksum), binaryName)\n\t\t\t\t\t\ttime.Sleep(250 * time.Millisecond)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttoCache(binary, binaryPath, log)\n\t\t\t\tretBinaries[binaryName] = binaryPath\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif retBinaries[binaryName] == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"cannot download provider binary %s, because checksum check has failed\", binaryName)\n\t\t\t}\n\t\t}\n\t\tif retBinaries[binaryName] == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cannot download provider binary %s, because no binary location matched OS %s and ARCH %s\", binaryName, runtime.GOOS, runtime.GOARCH)\n\t\t}\n\t}\n\n\treturn retBinaries, nil\n}\n\nfunc toCache(binary *provider2.ProviderBinary, binaryPath string, log log.Logger) {\n\tif !isRemotePath(binary.Path) {\n\t\treturn\n\t}\n\n\tcachedBinaryPath := getCachedBinaryPath(binary.Path)\n\terr := os.MkdirAll(filepath.Dir(cachedBinaryPath), 0777)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = copy.File(binaryPath, cachedBinaryPath, 0755)\n\tif err != nil {\n\t\tlog.Warnf(\"Error copying binary to cache: %v\", err)\n\t\treturn\n\t}\n}\n\nfunc fromCache(binary *provider2.ProviderBinary, targetFolder string, log log.Logger) bool {\n\tif !isRemotePath(binary.Path) {\n\t\treturn false\n\t}\n\n\tbinaryPath := getBinaryPath(binary, targetFolder)\n\tcachedBinaryPath := getCachedBinaryPath(binary.Path)\n\tif !verifyBinary(cachedBinaryPath, binary.Checksum) {\n\t\treturn false\n\t}\n\n\terr := os.MkdirAll(path.Dir(binaryPath), 0755)\n\tif err != nil {\n\t\tlog.Warnf(\"Error creating directory %s: %v\", path.Dir(binaryPath), err)\n\t\treturn false\n\t}\n\n\terr = copy.File(cachedBinaryPath, binaryPath, 0755)\n\tif err != nil {\n\t\tlog.Warnf(\"Error copying cached binary from %s to %s: %v\", cachedBinaryPath, binaryPath, err)\n\t\treturn false\n\t}\n\n\terr = os.Chmod(binaryPath, 0755)\n\tif err != nil {\n\t\tlog.Warnf(\"Error chmod binary %s: %v\", binaryPath, err)\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc getCachedBinaryPath(url string) string {\n\treturn filepath.Join(os.TempDir(), \"devpod-binaries\", hash.String(url)[:16])\n}\n\nfunc verifyBinary(binaryPath, checksum string) bool {\n\t_, err := os.Stat(binaryPath)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t// verify checksum\n\tif checksum != \"\" {\n\t\tfileHash, err := hash.File(binaryPath)\n\t\tif err != nil || !strings.EqualFold(fileHash, checksum) {\n\t\t\t_ = os.Remove(binaryPath)\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc getBinaryPath(binary *provider2.ProviderBinary, targetFolder string) string {\n\tif filepath.IsAbs(binary.Path) {\n\t\treturn binary.Path\n\t}\n\n\t// check if download\n\tif !isRemotePath(binary.Path) {\n\t\treturn localTargetPath(binary, targetFolder)\n\t}\n\n\t// check if archive\n\tif binary.ArchivePath != \"\" {\n\t\treturn path.Join(filepath.ToSlash(targetFolder), binary.ArchivePath)\n\t}\n\n\t// determine binary name\n\tname := binary.Name\n\tif name == \"\" {\n\t\tname = path.Base(binary.Path)\n\t\tif runtime.GOOS == \"windows\" && !strings.HasSuffix(name, \".exe\") {\n\t\t\tname += \".exe\"\n\t\t}\n\t}\n\n\treturn path.Join(filepath.ToSlash(targetFolder), name)\n}\n\nfunc isRemotePath(path string) bool {\n\treturn strings.HasPrefix(path, \"http://\") || strings.HasPrefix(path, \"https://\")\n}\n\nfunc downloadBinary(binaryName string, binary *provider2.ProviderBinary, targetFolder string, log log.Logger) (string, error) {\n\t// check if local\n\t_, err := os.Stat(binary.Path)\n\tif err == nil {\n\t\tif filepath.IsAbs(binary.Path) {\n\t\t\treturn binary.Path, nil\n\t\t}\n\n\t\terr := os.MkdirAll(targetFolder, 0755)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"create folder\")\n\t\t}\n\n\t\ttargetPath := localTargetPath(binary, targetFolder)\n\t\terr = copyLocal(binary, targetFolder)\n\t\tif err != nil {\n\t\t\t_ = os.RemoveAll(targetFolder)\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treturn targetPath, nil\n\t}\n\n\t// check if download\n\tif !strings.HasPrefix(binary.Path, \"http://\") && !strings.HasPrefix(binary.Path, \"https://\") {\n\t\t// check if local already copied\n\t\ttargetPath := localTargetPath(binary, targetFolder)\n\t\t_, err := os.Stat(targetPath)\n\t\tif err == nil {\n\t\t\treturn targetPath, nil\n\t\t}\n\n\t\treturn \"\", fmt.Errorf(\"cannot download %s as scheme is missing\", binary.Path)\n\t}\n\n\t// create target folder\n\terr = os.MkdirAll(targetFolder, 0755)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"create folder\")\n\t}\n\n\t// check if archive\n\tif binary.ArchivePath != \"\" {\n\t\ttargetPath, err := downloadArchive(binaryName, binary, targetFolder, log)\n\t\tif err != nil {\n\t\t\t_ = os.RemoveAll(targetFolder)\n\t\t\treturn \"\", err\n\t\t}\n\n\t\terr = os.Chmod(targetPath, 0755)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treturn targetPath, nil\n\t}\n\n\t// download file\n\ttargetPath, err := downloadFile(binaryName, binary, targetFolder, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(targetFolder)\n\t\treturn \"\", err\n\t}\n\n\terr = os.Chmod(targetPath, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn targetPath, nil\n}\n\nfunc downloadFile(binaryName string, binary *provider2.ProviderBinary, targetFolder string, log log.Logger) (string, error) {\n\t// determine binary name\n\tname := binary.Name\n\tif name == \"\" {\n\t\tname = path.Base(binary.Path)\n\t\tif runtime.GOOS == \"windows\" && !strings.HasSuffix(name, \".exe\") {\n\t\t\tname += \".exe\"\n\t\t}\n\t}\n\n\ttargetPath := path.Join(filepath.ToSlash(targetFolder), name)\n\t_, err := os.Stat(targetPath)\n\tif err == nil {\n\t\treturn targetPath, nil\n\t}\n\n\t// initiate download\n\tlog.Infof(\"Download binary %s from %s\", binaryName, binary.Path)\n\tdefer log.Debugf(\"Successfully downloaded binary %s\", binary.Path)\n\tbody, err := download.File(binary.Path, log)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"download binary\")\n\t}\n\tdefer body.Close()\n\n\tfile, err := os.Create(targetPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, body)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"download file\")\n\t}\n\n\treturn targetPath, nil\n}\n\nfunc downloadArchive(binaryName string, binary *provider2.ProviderBinary, targetFolder string, log log.Logger) (string, error) {\n\ttargetPath := path.Join(filepath.ToSlash(targetFolder), binary.ArchivePath)\n\t_, err := os.Stat(targetPath)\n\tif err == nil {\n\t\treturn targetPath, nil\n\t}\n\n\t// initiate download\n\tlog.Infof(\"Download binary %s from %s\", binaryName, binary.Path)\n\tdefer log.Debugf(\"Successfully extracted & downloaded archive\")\n\tbody, err := download.File(binary.Path, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer body.Close()\n\n\t// determine archive\n\tif strings.HasSuffix(binary.Path, \".gz\") || strings.HasSuffix(binary.Path, \".tar\") || strings.HasSuffix(binary.Path, \".tgz\") {\n\t\terr = extract.Extract(body, targetFolder)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treturn targetPath, nil\n\t} else if strings.HasSuffix(binary.Path, \".zip\") {\n\t\ttempFile, err := downloadToTempFile(body)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdefer os.Remove(tempFile)\n\n\t\terr = extract.UnzipFolder(tempFile, targetFolder)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treturn targetPath, nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"unrecognized archive format %s\", binary.Path)\n}\n\nfunc downloadToTempFile(reader io.Reader) (string, error) {\n\ttempFile, err := os.CreateTemp(\"\", \"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer tempFile.Close()\n\n\t_, err = io.Copy(tempFile, reader)\n\tif err != nil {\n\t\t_ = os.Remove(tempFile.Name())\n\t\treturn \"\", err\n\t}\n\n\treturn tempFile.Name(), nil\n}\n\nfunc localTargetPath(binary *provider2.ProviderBinary, targetFolder string) string {\n\tname := binary.Name\n\tif name == \"\" {\n\t\tname = path.Base(binary.Path)\n\t}\n\n\ttargetPath := filepath.Join(targetFolder, name)\n\treturn targetPath\n}\n\nfunc copyLocal(binary *provider2.ProviderBinary, targetPath string) error {\n\t// determine binary name\n\ttargetPathStat, err := os.Stat(targetPath)\n\tif err == nil {\n\t\tbinaryStat, err := os.Stat(binary.Path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if targetPathStat.Size() == binaryStat.Size() {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\terr = copy.File(binary.Path, targetPath, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/client/client.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype BaseClient interface {\n\t// Provider returns the name of the provider\n\tProvider() string\n\n\t// Context returns the context of the provider\n\tContext() string\n\n\t// RefreshOptions updates the options\n\tRefreshOptions(ctx context.Context, userOptions []string, reconfigure bool) error\n\n\t// Status retrieves the workspace status\n\tStatus(ctx context.Context, options StatusOptions) (Status, error)\n\n\t// Stop stops the workspace\n\tStop(ctx context.Context, options StopOptions) error\n\n\t// Delete deletes the workspace\n\tDelete(ctx context.Context, options DeleteOptions) error\n}\n\ntype Client interface {\n\tBaseClient\n\n\t// AgentLocal returns if the agent runs locally\n\tAgentLocal() bool\n\n\t// AgentPath returns the agent path\n\tAgentPath() string\n\n\t// AgentURL returns the agent download url\n\tAgentURL() string\n\n\t// Create creates a new workspace\n\tCreate(ctx context.Context, options CreateOptions) error\n\n\t// Start starts the workspace\n\tStart(ctx context.Context, options StartOptions) error\n\n\t// Command creates an SSH tunnel into the workspace\n\tCommand(ctx context.Context, options CommandOptions) error\n}\n\n// ProxyClient executes it's commands on the platform\ntype ProxyClient interface {\n\tBaseWorkspaceClient\n\n\t// Create creates a new remote workspace\n\tCreate(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\n\t// Up creates a new remote workspace\n\tUp(ctx context.Context, options UpOptions) error\n\n\t// Ssh starts an ssh tunnel to the workspace container\n\tSsh(ctx context.Context, options SshOptions) error\n}\n\n// DaemonClient connects to workspaces through a shared daemon\ntype DaemonClient interface {\n\tBaseWorkspaceClient\n\n\t// Create creates a new remote workspace\n\tCreate(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\n\t// Up start a new remote workspace\n\tUp(ctx context.Context, options UpOptions) (*config.Result, error)\n\n\t// SSHClients returns an SSH client for the tool and one for the actual user\n\tSSHClients(ctx context.Context, user string) (*ssh.Client, *ssh.Client, error)\n\n\t// CheckWorkspaceReachable checks if the given workspace is reachable from the current machine\n\tCheckWorkspaceReachable(ctx context.Context) error\n\n\t// DirectTunnel forwards stdio to the workspace\n\tDirectTunnel(ctx context.Context, stdin io.Reader, stdout io.Writer) error\n\n\t// Ping tries to ping a workspace and prints results to stdout\n\tPing(ctx context.Context, stdout io.Writer) error\n}\n\ntype MachineClient interface {\n\tClient\n\n\t// Machine returns the machine of this client\n\tMachine() string\n\n\t// MachineConfig returns the machine config\n\tMachineConfig() *provider.Machine\n}\n\ntype BaseWorkspaceClient interface {\n\tBaseClient\n\n\t// Workspace returns the workspace of this provider\n\tWorkspace() string\n\n\t// WorkspaceConfig returns the workspace config\n\tWorkspaceConfig() *provider.Workspace\n\n\t// Lock locks the workspace. This is a file lock, which means\n\t// the workspace is locked across processes.\n\tLock(ctx context.Context) error\n\n\t// Unlock unlocks the workspace.\n\tUnlock()\n}\n\ntype WorkspaceClient interface {\n\tBaseWorkspaceClient\n\tClient\n\n\t// AgentInjectGitCredentials returns if the credentials helper should get injected\n\tAgentInjectGitCredentials(options provider.CLIOptions) bool\n\n\t// AgentInjectDockerCredentials returns if the credentials helper should get injected\n\tAgentInjectDockerCredentials(options provider.CLIOptions) bool\n\n\t// AgentInfo returns the info to send to the agent\n\tAgentInfo(options provider.CLIOptions) (string, *provider.AgentWorkspaceInfo, error)\n}\n\ntype InitOptions struct{}\n\ntype ValidateOptions struct{}\n\ntype StartOptions struct{}\n\ntype StopOptions struct {\n\tPlatform devpod.PlatformOptions `json:\"platform,omitempty\"`\n}\n\ntype DeleteOptions struct {\n\tPlatform devpod.PlatformOptions `json:\"platform,omitempty\"`\n\n\tIgnoreNotFound bool   `json:\"ignoreNotFound,omitempty\"`\n\tForce          bool   `json:\"force,omitempty\"`\n\tGracePeriod    string `json:\"gracePeriod,omitempty\"`\n}\n\ntype CreateOptions struct{}\n\ntype StatusOptions struct {\n\tContainerStatus bool `json:\"containerStatus,omitempty\"`\n}\n\ntype CommandOptions struct {\n\tCommand string\n\tStdin   io.Reader\n\tStdout  io.Writer\n\tStderr  io.Writer\n}\n\ntype UpOptions struct {\n\tprovider.CLIOptions\n\n\tDebug bool\n\n\tStdin  io.Reader\n\tStdout io.Writer\n}\n\ntype SshOptions struct {\n\tUser string\n\n\tStdin  io.Reader\n\tStdout io.Writer\n}\n\ntype ImportWorkspaceOptions map[string]string\n\ntype Status string\n\nconst (\n\tStatusRunning  = \"Running\"\n\tStatusBusy     = \"Busy\"\n\tStatusStopped  = \"Stopped\"\n\tStatusNotFound = \"NotFound\"\n)\n\nfunc ParseStatus(in string) (Status, error) {\n\tin = strings.ToUpper(strings.TrimSpace(in))\n\tswitch in {\n\tcase \"RUNNING\":\n\t\treturn StatusRunning, nil\n\tcase \"BUSY\":\n\t\treturn StatusBusy, nil\n\tcase \"STOPPED\":\n\t\treturn StatusStopped, nil\n\tcase \"NOTFOUND\":\n\t\treturn StatusNotFound, nil\n\tdefault:\n\t\treturn StatusNotFound, fmt.Errorf(\"error parsing status: '%s' unrecognized status, needs to be one of: %s\", in, []string{StatusRunning, StatusBusy, StatusStopped, StatusNotFound})\n\t}\n}\n\ntype WorkspaceStatus struct {\n\tID       string `json:\"id,omitempty\"`\n\tContext  string `json:\"context,omitempty\"`\n\tProvider string `json:\"provider,omitempty\"`\n\tState    string `json:\"state,omitempty\"`\n}\n\ntype User struct {\n\tName string `json:\"name,omitempty\"`\n\tUID  string `json:\"uid,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/client.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/netip\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/options\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tplatformclient \"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tsshServer \"github.com/loft-sh/devpod/pkg/ssh/server\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\t\"github.com/skratchdot/open-golang/open\"\n\t\"golang.org/x/crypto/ssh\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/tailcfg\"\n)\n\nvar (\n\tDevPodDebug = \"DEVPOD_DEBUG\"\n\n\tDevPodFlagsUp     = \"DEVPOD_FLAGS_UP\"\n\tDevPodFlagsSsh    = \"DEVPOD_FLAGS_SSH\"\n\tDevPodFlagsDelete = \"DEVPOD_FLAGS_DELETE\"\n\tDevPodFlagsStatus = \"DEVPOD_FLAGS_STATUS\"\n)\n\nfunc New(devPodConfig *config.Config, prov *provider.ProviderConfig, workspace *provider.Workspace, log log.Logger) (clientpkg.DaemonClient, error) {\n\ttsClient := &tailscale.LocalClient{\n\t\tSocket:        daemon.GetSocketAddr(workspace.Provider.Name),\n\t\tUseSocketOnly: true,\n\t}\n\n\treturn &client{\n\t\tdevPodConfig: devPodConfig,\n\t\tconfig:       prov,\n\t\tworkspace:    workspace,\n\t\tlog:          log,\n\t\ttsClient:     tsClient,\n\t\tlocalClient:  daemon.NewLocalClient(prov.Name),\n\t}, nil\n}\n\ntype client struct {\n\tm sync.Mutex\n\n\tdevPodConfig *config.Config\n\tconfig       *provider.ProviderConfig\n\tworkspace    *provider.Workspace\n\tlog          log.Logger\n\ttsClient     *tailscale.LocalClient\n\tlocalClient  *daemon.LocalClient\n}\n\nfunc (c *client) Lock(ctx context.Context) error {\n\t// noop\n\treturn nil\n}\n\nfunc (c *client) Unlock() {\n\t// noop\n}\n\nfunc (c *client) Provider() string {\n\treturn c.config.Name\n}\n\nfunc (c *client) Workspace() string {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\treturn c.workspace.ID\n}\n\nfunc (c *client) WorkspaceConfig() *provider.Workspace {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\treturn provider.CloneWorkspace(c.workspace)\n}\n\nfunc (c *client) Context() string {\n\treturn c.workspace.Context\n}\n\nfunc (c *client) RefreshOptions(ctx context.Context, userOptionsRaw []string, reconfigure bool) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tuserOptions, err := provider.ParseOptions(userOptionsRaw)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"parse options\")\n\t}\n\n\tworkspace, err := options.ResolveAndSaveOptionsProxy(ctx, c.devPodConfig, c.config, c.workspace, userOptions, c.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif reconfigure {\n\t\terr := c.updateInstance(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tc.workspace = workspace\n\treturn nil\n}\n\nfunc (c *client) CheckWorkspaceReachable(ctx context.Context) error {\n\twAddr, err := c.getWorkspaceAddress()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve workspace hostname: %w\", err)\n\t}\n\terr = ts.WaitHostReachable(ctx, c.tsClient, wAddr, 5, c.log)\n\tif err != nil {\n\t\tinstance, getWorkspaceErr := c.localClient.GetWorkspace(ctx, c.workspace.UID)\n\t\t// if we can't reach the daemon try to start the desktop app\n\t\tif daemon.IsDaemonNotAvailableError(getWorkspaceErr) {\n\t\t\tdeeplink := fmt.Sprintf(\"devpod://open?workspace=%s&provider=%s&source=%s&ide=%s\", c.workspace.ID, c.config.Name, c.workspace.Source.String(), c.workspace.IDE.Name)\n\t\t\topenErr := open.Run(deeplink)\n\t\t\tif openErr != nil {\n\t\t\t\treturn getWorkspaceErr // inform user about daemon state\n\t\t\t}\n\t\t\t// give desktop app a chance to start\n\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\t// let's try again\n\t\t\terr = ts.WaitHostReachable(ctx, c.tsClient, wAddr, 20, c.log)\n\t\t\tif err != nil {\n\t\t\t\tinstance, getWorkspaceErr = c.localClient.GetWorkspace(ctx, c.workspace.UID)\n\t\t\t} else {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif getWorkspaceErr != nil {\n\t\t\treturn fmt.Errorf(\"couldn't get workspace: %w\", getWorkspaceErr)\n\t\t} else if instance.Status.Phase != storagev1.InstanceReady {\n\t\t\treturn fmt.Errorf(\"workspace is '%s', please run `devpod up %s` to start it again\", instance.Status.Phase, c.workspace.ID)\n\t\t} else if instance.Status.LastWorkspaceStatus != storagev1.WorkspaceStatusRunning {\n\t\t\treturn fmt.Errorf(\"workspace is '%s', please run `devpod up %s` to start it again\", instance.Status.LastWorkspaceStatus, c.workspace.ID)\n\t\t}\n\n\t\treturn fmt.Errorf(\"reach host: %w\", err)\n\t}\n\n\tc.log.Debugf(\"Host %s is reachable. Proceeding with SSH session...\", wAddr.Host())\n\treturn nil\n}\n\nfunc (c *client) SSHClients(ctx context.Context, user string) (toolClient *ssh.Client, userClient *ssh.Client, err error) {\n\twAddr, err := c.getWorkspaceAddress()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"resolve workspace hostname: %w\", err)\n\t}\n\n\taddress := fmt.Sprintf(\"%s:%d\", wAddr.Host(), wAddr.Port())\n\tdial := func(ctx context.Context, network, address string) (net.Conn, error) {\n\t\taddressParts := strings.Split(address, \":\")\n\t\tif len(addressParts) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid address: %s\", address)\n\t\t}\n\n\t\tport, err := strconv.Atoi(addressParts[1])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid port: %s\", addressParts[1])\n\t\t}\n\n\t\treturn c.tsClient.DialTCP(ctx, addressParts[0], uint16(port))\n\t}\n\n\ttoolClient, err = ts.WaitForSSHClient(ctx, dial, \"tcp\", address, \"root\", time.Second*10, c.log)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"create SSH tool client: %w\", err)\n\t}\n\tuserClient, err = ts.WaitForSSHClient(ctx, dial, \"tcp\", address, user, time.Second*10, c.log)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"create SSH user client: %w\", err)\n\t}\n\n\treturn toolClient, userClient, nil\n}\n\nfunc (c *client) DirectTunnel(ctx context.Context, stdin io.Reader, stdout io.Writer) error {\n\twAddr, err := c.getWorkspaceAddress()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve workspace hostname: %w\", err)\n\t}\n\tconn, err := c.tsClient.DialTCP(ctx, wAddr.Host(), uint16(wAddr.Port()))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to SSH server in proxy mode: %w\", err)\n\t}\n\tdefer conn.Close()\n\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\t_, err := io.Copy(stdout, conn)\n\t\terrChan <- err\n\t}()\n\tgo func() {\n\t\t_, err := io.Copy(conn, stdin)\n\t\terrChan <- err\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase err := <-errChan:\n\t\treturn err\n\t}\n}\n\nfunc (c *client) Ping(ctx context.Context, writer io.Writer) error {\n\twAddr, err := c.getWorkspaceAddress()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatus, err := c.tsClient.Status(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\thostname := strings.TrimSuffix(wAddr.Host(), \".\"+status.CurrentTailnet.Name)\n\tvar ip *netip.Addr\n\tfor _, peer := range status.Peer {\n\t\tif peer.HostName == hostname {\n\t\t\tip = &peer.TailscaleIPs[0]\n\t\t}\n\t}\n\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"no network peer for hostname %s\", wAddr.Host())\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\t\tdefer cancel()\n\t\tresult, err := c.tsClient.Ping(timeoutCtx, *ip, tailcfg.PingDisco)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif result.Err != \"\" {\n\t\t\treturn errors.New(result.Err)\n\t\t}\n\t\tlatency := time.Duration(result.LatencySeconds * float64(time.Second)).Round(time.Millisecond)\n\t\tvia := result.Endpoint\n\t\tif result.DERPRegionID != 0 {\n\t\t\tvia = fmt.Sprintf(\"DERP(%s)\", result.DERPRegionCode)\n\t\t}\n\t\t_, err = writer.Write([]byte(fmt.Sprintf(\"pong from %s (%s) via %v in %v\\n\", result.NodeName, result.NodeIP, via, latency)))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to write ping result: %w\", err)\n\t\t}\n\n\t\ttime.Sleep(time.Second)\n\t}\n\n\treturn nil\n}\n\nfunc (c *client) initPlatformClient(ctx context.Context) (platformclient.Client, error) {\n\tconfigPath, err := platform.LoftConfigPath(c.Context(), c.Provider())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseClient, err := platformclient.InitClientFromPath(ctx, configPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn baseClient, nil\n}\n\nfunc (c *client) getWorkspaceAddress() (ts.Addr, error) {\n\tif c.workspace.Pro == nil || c.workspace.Pro.InstanceName == \"\" {\n\t\treturn ts.Addr{}, fmt.Errorf(\"workspace is not initialized\")\n\t}\n\n\treturn ts.NewAddr(ts.GetWorkspaceHostname(c.workspace.Pro.InstanceName, c.workspace.Pro.Project), sshServer.DefaultUserPort), nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/create.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log/terminal\"\n)\n\nfunc (c *client) Create(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstance, err := c.localClient.GetWorkspace(ctx, c.workspace.UID)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Nothing left to do if we already have an instance\n\tif instance != nil {\n\t\treturn nil\n\t}\n\tif !terminal.IsTerminalIn {\n\t\treturn fmt.Errorf(\"unable to create new instance through CLI if stdin is not a terminal\")\n\t}\n\n\tinstance, err = createInstanceInteractive(ctx, baseClient, c.workspace.ID, c.workspace.UID, c.workspace.Source.String(), c.workspace.Picture, c.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstance, err = c.localClient.CreateWorkspace(ctx, instance)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.workspace.Pro = &provider.ProMetadata{\n\t\tInstanceName: instance.Name,\n\t\tProject:      project.ProjectFromNamespace(instance.Namespace),\n\t\tDisplayName:  instance.Spec.DisplayName,\n\t}\n\n\terr = provider.SaveWorkspaceConfig(c.workspace)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save workspace config: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/delete.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n)\n\nfunc (c *client) Delete(ctx context.Context, opt clientpkg.DeleteOptions) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspace, err := platform.FindInstance(ctx, baseClient, c.workspace.UID)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\t// delete the workspace folder\n\t\terr = clientimplementation.DeleteWorkspaceFolder(c.workspace.Context, c.workspace.ID, c.workspace.SSHConfigPath, c.log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar gracePeriod *time.Duration\n\tif opt.GracePeriod != \"\" {\n\t\tduration, err := time.ParseDuration(opt.GracePeriod)\n\t\tif err == nil {\n\t\t\tgracePeriod = &duration\n\t\t}\n\t}\n\n\t// kill the command after the grace period\n\tif gracePeriod != nil {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, *gracePeriod)\n\t\tdefer cancel()\n\t}\n\n\t// delete the workspace\n\terr = managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(workspace.Namespace).Delete(ctx, workspace.Name, metav1.DeleteOptions{})\n\tif err != nil {\n\t\tif !opt.Force {\n\t\t\treturn fmt.Errorf(\"delete workspace: %w\", err)\n\t\t}\n\n\t\tif !kerrors.IsNotFound(err) {\n\t\t\tc.log.Errorf(\"Error deleting workspace: %v\", err)\n\t\t}\n\t}\n\n\t// delete the workspace folder\n\terr = clientimplementation.DeleteWorkspaceFolder(c.workspace.Context, c.workspace.ID, c.workspace.SSHConfigPath, c.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// calculate wait timeout\n\twaitTimeout := time.Minute\n\tif gracePeriod != nil {\n\t\twaitTimeout = *gracePeriod\n\t}\n\n\t// wait until the workspace is deleted\n\tc.log.Debugf(\"Waiting for workspace to get deleted...\")\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, waitTimeout, false, func(ctx context.Context) (done bool, err error) {\n\t\tworkspaceInstance, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(workspace.Namespace).Get(ctx, workspace.Name, metav1.GetOptions{})\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn true, nil\n\t\t} else if err != nil {\n\t\t\treturn false, fmt.Errorf(\"error getting workspace: %w\", err)\n\t\t} else if workspaceInstance.ObjectMeta.DeletionTimestamp == nil {\n\t\t\t// this can occur if the workspace is already deleted and was recreated\n\t\t\treturn true, nil\n\t\t}\n\n\t\tc.log.Debugf(\"Workspace is not deleted yet, waiting again...\")\n\t\treturn false, nil\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error waiting for workspace to get deleted: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/form.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/huh\"\n\t\"github.com/ghodss/yaml\"\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/list\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tplatformclient \"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/labels\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc createInstanceInteractive(ctx context.Context, baseClient platformclient.Client, id, uid, source, picture string, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tformCtx, cancelForm := context.WithCancel(ctx)\n\tdefer cancelForm()\n\n\tvar selectedCluster *managementv1.Cluster\n\tvar selectedProject *managementv1.Project\n\tvar selectedTemplate *managementv1.DevPodWorkspaceTemplate\n\tselectedTemplateVersion := \"\"\n\tprojectOptions, err := projectOptions(ctx, baseClient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = huh.NewForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewSelect[*managementv1.Project]().\n\t\t\t\tTitle(\"Project\").\n\t\t\t\tOptions(projectOptions...).\n\t\t\t\tValue(&selectedProject),\n\t\t\thuh.NewSelect[*managementv1.Cluster]().\n\t\t\t\tTitle(\"Cluster\").\n\t\t\t\tOptionsFunc(func() []huh.Option[*managementv1.Cluster] {\n\t\t\t\t\treturn getClusterOptions(ctx, baseClient, selectedProject, cancelForm, log)\n\t\t\t\t}, &selectedProject).\n\t\t\t\tValue(&selectedCluster).\n\t\t\t\tWithHeight(5),\n\t\t\thuh.NewSelect[*managementv1.DevPodWorkspaceTemplate]().\n\t\t\t\tTitle(\"Template\").\n\t\t\t\tOptionsFunc(func() []huh.Option[*managementv1.DevPodWorkspaceTemplate] {\n\t\t\t\t\treturn getTemplateOptions(ctx, baseClient, selectedProject, cancelForm, log)\n\t\t\t\t}, &selectedProject).\n\t\t\t\tValue(&selectedTemplate),\n\t\t\thuh.NewSelect[string]().\n\t\t\t\tTitle(\"Template Version\").\n\t\t\t\tOptionsFunc(func() []huh.Option[string] {\n\t\t\t\t\treturn getTemplateVersionOptions(selectedTemplate)\n\t\t\t\t}, &selectedTemplate).\n\t\t\t\tValue(&selectedTemplateVersion).\n\t\t\t\tWithHeight(8),\n\t\t),\n\t).RunWithContext(formCtx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparameters := selectedTemplate.Spec.Parameters\n\tif len(selectedTemplate.GetVersions()) > 0 {\n\t\tparameters, err = list.GetTemplateParameters(selectedTemplate, selectedTemplateVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trenderedParameters := \"\"\n\tif len(parameters) > 0 {\n\t\tfieldParameters := prepareParameters(parameters)\n\t\terr = huh.NewForm(\n\t\t\thuh.NewGroup(parameterFields(fieldParameters)...),\n\t\t).RunWithContext(formCtx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trenderedParameters, err = renderParameters(fieldParameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tinstance := &managementv1.DevPodWorkspaceInstance{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tGenerateName: encoding.SafeConcatNameMax([]string{id}, 53) + \"-\",\n\t\t\tNamespace:    project.ProjectNamespace(selectedProject.GetName()),\n\t\t\tLabels: map[string]string{\n\t\t\t\tstoragev1.DevPodWorkspaceIDLabel:  id,\n\t\t\t\tstoragev1.DevPodWorkspaceUIDLabel: uid,\n\t\t\t\tlabels.ProjectLabel:               selectedProject.GetName(),\n\t\t\t},\n\t\t\tAnnotations: map[string]string{\n\t\t\t\tstoragev1.DevPodWorkspacePictureAnnotation: picture,\n\t\t\t\tstoragev1.DevPodWorkspaceSourceAnnotation:  source,\n\t\t\t},\n\t\t},\n\t\tSpec: managementv1.DevPodWorkspaceInstanceSpec{\n\t\t\tDevPodWorkspaceInstanceSpec: storagev1.DevPodWorkspaceInstanceSpec{\n\t\t\t\tDisplayName: id,\n\t\t\t\tTemplateRef: &storagev1.TemplateRef{\n\t\t\t\t\tName:    selectedTemplate.GetName(),\n\t\t\t\t\tVersion: selectedTemplateVersion,\n\t\t\t\t},\n\t\t\t\tTarget: storagev1.WorkspaceTarget{\n\t\t\t\t\tCluster: &storagev1.WorkspaceTargetName{\n\t\t\t\t\t\tName: selectedCluster.GetName(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tParameters: renderedParameters,\n\t\t\t},\n\t\t},\n\t}\n\n\treturn instance, nil\n}\n\nfunc updateInstanceInteractive(ctx context.Context, baseClient platformclient.Client, instance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tformCtx, cancelForm := context.WithCancel(ctx)\n\tdefer cancelForm()\n\n\tprojectName := project.ProjectFromNamespace(instance.GetNamespace())\n\tprojectTemplates, err := list.Templates(ctx, baseClient, projectName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar selectedTemplate *managementv1.DevPodWorkspaceTemplate\n\ttemplateOptions := []TemplateOption{}\n\tfor _, template := range projectTemplates.DevPodWorkspaceTemplates {\n\t\tt := &template\n\t\ttemplateOptions = append(templateOptions, huh.Option[*managementv1.DevPodWorkspaceTemplate]{\n\t\t\tKey:   platform.DisplayName(template.GetName(), template.Spec.DisplayName),\n\t\t\tValue: t,\n\t\t})\n\n\t\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Name == template.GetName() {\n\t\t\tselectedTemplate = t\n\t\t}\n\t}\n\tif selectedTemplate == nil {\n\t\treturn nil, fmt.Errorf(\"template not found: %#v\", instance.Spec.TemplateRef)\n\t}\n\n\tvar selectedTemplateVersion string\n\tif instance.Spec.TemplateRef != nil {\n\t\tselectedTemplateVersion = instance.Spec.TemplateRef.Version\n\t}\n\n\terr = huh.NewForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewSelect[*managementv1.DevPodWorkspaceTemplate]().\n\t\t\t\tTitle(\"Template\").\n\t\t\t\tOptions(templateOptions...).\n\t\t\t\tValue(&selectedTemplate),\n\t\t\thuh.NewSelect[string]().\n\t\t\t\tTitle(\"Template Version\").\n\t\t\t\tOptionsFunc(func() []huh.Option[string] {\n\t\t\t\t\treturn getTemplateVersionOptions(selectedTemplate)\n\t\t\t\t}, &selectedTemplate).\n\t\t\t\tValue(&selectedTemplateVersion).\n\t\t\t\tWithHeight(8),\n\t\t),\n\t).RunWithContext(formCtx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparameters := selectedTemplate.Spec.Parameters\n\tif len(selectedTemplate.GetVersions()) > 0 {\n\t\tparameters, err = list.GetTemplateParameters(selectedTemplate, selectedTemplateVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trenderedParameters := \"\"\n\tif len(parameters) > 0 {\n\t\ttRef := instance.Spec.TemplateRef\n\t\tvar existingParameters map[string]interface{}\n\t\tif tRef != nil && tRef.Name == selectedTemplate.GetName() && tRef.Version == selectedTemplateVersion {\n\t\t\texistingParameters = map[string]interface{}{}\n\t\t\terr = yaml.Unmarshal([]byte(instance.Spec.Parameters), &existingParameters)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tfieldParameters := []*FieldParameter{}\n\t\t// reuse existing parameters as starting point\n\t\tfor _, p := range parameters {\n\t\t\tvar value interface{} = p.DefaultValue\n\t\t\tif existingParameters != nil {\n\t\t\t\tvalue = getDeepValue(existingParameters, p.Variable)\n\t\t\t}\n\t\t\tfieldParameter := FieldParameter{AppParameter: p}\n\n\t\t\tif p.Type == \"boolean\" && value != nil {\n\t\t\t\tv, err := strconv.ParseBool(value.(string))\n\t\t\t\tif err == nil {\n\t\t\t\t\tfieldParameter.BoolValue = v\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif value != nil {\n\t\t\t\t\tfieldParameter.StringValue = value.(string)\n\t\t\t\t} else {\n\t\t\t\t\tfieldParameter.StringValue = p.DefaultValue\n\t\t\t\t}\n\t\t\t}\n\t\t\tfieldParameters = append(fieldParameters, &fieldParameter)\n\t\t}\n\n\t\terr = huh.NewForm(\n\t\t\thuh.NewGroup(parameterFields(fieldParameters)...),\n\t\t).RunWithContext(formCtx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trenderedParameters, err = renderParameters(fieldParameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tnewInstance := instance.DeepCopy()\n\t// template\n\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Name != selectedTemplate.GetName() {\n\t\tnewInstance.Spec.TemplateRef.Name = selectedTemplate.GetName()\n\t}\n\t// version\n\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Version != selectedTemplateVersion {\n\t\tnewInstance.Spec.TemplateRef.Version = selectedTemplateVersion\n\t}\n\t// parameters\n\tif instance.Spec.Parameters != renderedParameters {\n\t\tnewInstance.Spec.Parameters = renderedParameters\n\t}\n\n\treturn newInstance, nil\n}\n\ntype ProjectOption = huh.Option[*managementv1.Project]\ntype TemplateOption = huh.Option[*managementv1.DevPodWorkspaceTemplate]\ntype CancelFunc = func()\n\nvar latestTemplateVersion = huh.Option[string]{\n\tKey:   \"latest\",\n\tValue: \"\",\n}\n\nfunc projectOptions(ctx context.Context, client platformclient.Client) ([]ProjectOption, error) {\n\tprojects, err := list.Projects(ctx, client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprojectOptions := []ProjectOption{}\n\tfor _, project := range projects.Items {\n\t\tp := &project\n\t\tprojectOptions = append(projectOptions, ProjectOption{\n\t\t\tKey:   platform.DisplayName(project.GetName(), project.Spec.DisplayName),\n\t\t\tValue: p,\n\t\t})\n\t}\n\n\treturn projectOptions, nil\n}\n\nfunc getClusterOptions(ctx context.Context, client platformclient.Client, project *managementv1.Project, cancel CancelFunc, log log.Logger) []huh.Option[*managementv1.Cluster] {\n\topts := []huh.Option[*managementv1.Cluster]{}\n\tif project == nil {\n\t\treturn opts\n\t}\n\n\tclusters, err := list.Clusters(ctx, client, project.GetName())\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tcancel()\n\n\t\treturn nil\n\t}\n\tfor _, cluster := range clusters.Clusters {\n\t\tr := &cluster\n\t\topts = append(opts, huh.Option[*managementv1.Cluster]{\n\t\t\tKey:   platform.DisplayName(cluster.GetName(), cluster.Spec.DisplayName),\n\t\t\tValue: r,\n\t\t})\n\t}\n\n\treturn opts\n}\n\nfunc getTemplateOptions(ctx context.Context, client platformclient.Client, project *managementv1.Project, cancel CancelFunc, log log.Logger) []huh.Option[*managementv1.DevPodWorkspaceTemplate] {\n\topts := []huh.Option[*managementv1.DevPodWorkspaceTemplate]{}\n\tif project == nil {\n\t\treturn opts\n\t}\n\n\ttemplates, err := list.Templates(ctx, client, project.GetName())\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tcancel()\n\n\t\treturn nil\n\t}\n\n\tvar defaultOpt huh.Option[*managementv1.DevPodWorkspaceTemplate]\n\tfor _, template := range templates.DevPodWorkspaceTemplates {\n\t\tt := &template\n\t\topt := huh.Option[*managementv1.DevPodWorkspaceTemplate]{\n\t\t\tKey:   platform.DisplayName(template.GetName(), template.Spec.DisplayName),\n\t\t\tValue: t,\n\t\t}\n\t\tif t.GetName() == templates.DefaultDevPodWorkspaceTemplate {\n\t\t\tdefaultOpt = opt\n\t\t\tcontinue\n\t\t}\n\t\topts = append(opts, opt)\n\t}\n\tif defaultOpt.Key != \"\" {\n\t\t// make sure the default template is the first\n\t\topts = slices.Insert(opts, 0, defaultOpt)\n\t}\n\n\treturn opts\n}\n\nfunc getTemplateVersionOptions(template *managementv1.DevPodWorkspaceTemplate) []huh.Option[string] {\n\topts := []huh.Option[string]{latestTemplateVersion}\n\tif template == nil {\n\t\treturn opts\n\t}\n\n\tfor _, version := range template.GetVersions() {\n\t\topts = append(opts, huh.Option[string]{\n\t\t\tKey:   version.GetVersion(),\n\t\t\tValue: version.GetVersion(),\n\t\t})\n\t}\n\n\treturn opts\n}\n\ntype FieldParameter struct {\n\tstoragev1.AppParameter\n\n\tStringValue string\n\tBoolValue   bool\n}\n\nfunc prepareParameters(parameters []storagev1.AppParameter) []*FieldParameter {\n\tretParams := []*FieldParameter{}\n\tfor _, p := range parameters {\n\t\tfieldParameter := FieldParameter{AppParameter: p}\n\t\tif p.Type == \"boolean\" {\n\t\t\tv, err := strconv.ParseBool(p.DefaultValue)\n\t\t\tif err == nil {\n\t\t\t\tfieldParameter.BoolValue = v\n\t\t\t}\n\t\t} else {\n\t\t\tfieldParameter.StringValue = p.DefaultValue\n\t\t}\n\n\t\tretParams = append(retParams, &fieldParameter)\n\t}\n\n\treturn retParams\n}\n\nfunc parameterFields(fieldParameters []*FieldParameter) []huh.Field {\n\tfields := []huh.Field{}\n\tfor _, param := range fieldParameters {\n\t\ttitle := param.Label\n\t\tif title == \"\" {\n\t\t\ttitle = param.Variable\n\t\t}\n\t\tparamType := param.Type\n\t\tif paramType == \"\" {\n\t\t\tparamType = \"string\"\n\t\t}\n\n\t\tvar field huh.Field\n\t\tswitch paramType {\n\t\tcase \"multiline\":\n\t\t\tfield = huh.NewText().\n\t\t\t\tTitle(title).\n\t\t\t\tDescription(param.Description).\n\t\t\t\tValue(&param.StringValue)\n\t\tcase \"password\":\n\t\t\tfallthrough\n\t\tcase \"number\":\n\t\t\tfallthrough\n\t\tcase \"string\":\n\t\t\t// display a select field if param has options\n\t\t\tif len(param.Options) > 0 {\n\t\t\t\topts := []huh.Option[string]{}\n\t\t\t\tfor _, o := range param.Options {\n\t\t\t\t\thuhOption := huh.Option[string]{\n\t\t\t\t\t\tKey:   o,\n\t\t\t\t\t\tValue: o,\n\t\t\t\t\t}\n\t\t\t\t\tif o == param.DefaultValue {\n\t\t\t\t\t\thuhOption = huhOption.Selected(true)\n\t\t\t\t\t}\n\t\t\t\t\topts = append(opts, huhOption)\n\t\t\t\t}\n\t\t\t\tfield = huh.NewSelect[string]().\n\t\t\t\t\tTitle(title).\n\t\t\t\t\tOptions(opts...).\n\t\t\t\t\tValue(&param.StringValue)\n\t\t\t} else {\n\t\t\t\tinput := huh.NewInput().Title(title).\n\t\t\t\t\tDescription(param.Description).\n\t\t\t\t\tValue(&param.StringValue)\n\n\t\t\t\tif param.Type == \"password\" {\n\t\t\t\t\tinput.EchoMode(huh.EchoModePassword)\n\t\t\t\t}\n\t\t\t\tif param.Type == \"number\" {\n\t\t\t\t\tinput.Validate(func(s string) error {\n\t\t\t\t\t\t_, err := strconv.ParseFloat(s, 64)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tfield = input\n\t\t\t}\n\t\tcase \"boolean\":\n\t\t\tfield = huh.NewConfirm().\n\t\t\t\tTitle(title).\n\t\t\t\tDescription(param.Description).\n\t\t\t\tValue(&param.BoolValue)\n\t\t}\n\n\t\tfields = append(fields, field)\n\t}\n\n\treturn fields\n}\n\nfunc renderParameters(fieldParameters []*FieldParameter) (string, error) {\n\tp := map[string]interface{}{}\n\tfor _, fp := range fieldParameters {\n\t\tif fp.StringValue != \"\" {\n\t\t\tp[fp.Variable] = fp.StringValue\n\t\t} else if fp.BoolValue {\n\t\t\tp[fp.Variable] = strconv.FormatBool(fp.BoolValue)\n\t\t}\n\t}\n\n\trawParameters, err := yaml.Marshal(p)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(rawParameters), nil\n}\n\nfunc getDeepValue(parameters interface{}, path string) interface{} {\n\tif parameters == nil {\n\t\treturn nil\n\t}\n\n\tpathSegments := strings.Split(path, \".\")\n\tswitch t := parameters.(type) {\n\tcase map[string]interface{}:\n\t\tval, ok := t[pathSegments[0]]\n\t\tif !ok {\n\t\t\treturn nil\n\t\t} else if len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn getDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\tcase []interface{}:\n\t\tindex, err := strconv.Atoi(pathSegments[0])\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t} else if index < 0 || index >= len(t) {\n\t\t\treturn nil\n\t\t}\n\n\t\tval := t[index]\n\t\tif len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn getDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/status.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n)\n\nfunc (c *client) Status(ctx context.Context, opt clientpkg.StatusOptions) (clientpkg.Status, error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tstatus := clientpkg.Status(clientpkg.StatusNotFound)\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tinstance, err := platform.FindInstance(ctx, baseClient, c.workspace.UID)\n\tif err != nil {\n\t\treturn status, err\n\t} else if instance == nil {\n\t\treturn status, fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\treturn clientpkg.Status(instance.Status.LastWorkspaceStatus), nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/stop.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n)\n\nfunc (c *client) Stop(ctx context.Context, opt clientpkg.StopOptions) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := platform.FindInstance(ctx, baseClient, c.workspace.UID)\n\tif err != nil {\n\t\treturn err\n\t} else if workspace == nil {\n\t\treturn fmt.Errorf(\"couldn't find workspace\")\n\t}\n\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trawOptions, _ := json.Marshal(opt)\n\tretStop, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(workspace.Namespace).Stop(ctx, workspace.Name, &managementv1.DevPodWorkspaceInstanceStop{\n\t\tSpec: managementv1.DevPodWorkspaceInstanceStopSpec{\n\t\t\tOptions: string(rawOptions),\n\t\t},\n\t}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error stopping workspace: %w\", err)\n\t} else if retStop.Status.TaskID == \"\" {\n\t\treturn fmt.Errorf(\"no stop task id returned from server\")\n\t}\n\n\t_, err = observeTask(ctx, managementClient, workspace, retStop.Status.TaskID, c.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"stop: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/up.go",
    "content": "package daemonclient\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/apiserver/pkg/builders\"\n\tclientpkg \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdevpodlog \"github.com/loft-sh/devpod/pkg/log\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/kube\"\n\t\"github.com/loft-sh/log\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\n\t_ \"github.com/loft-sh/api/v4/pkg/apis/management/install\" // Install the management group to ensure the option types are registered\n)\n\nfunc (c *client) Up(ctx context.Context, opt clientpkg.UpOptions) (*config.Result, error) {\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinstance, err := platform.FindInstance(ctx, baseClient, c.workspace.UID)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if instance == nil {\n\t\treturn nil, fmt.Errorf(\"workspace %s not found. Looks like it does not exist anymore and you can delete it\", c.workspace.ID)\n\t}\n\n\t// check if the workspace is migrated and we need to force recreate or reset\n\tif instance.Annotations[\"loft.sh/migrated\"] == \"true\" && !opt.Recreate && !opt.Reset {\n\t\tif os.Getenv(\"DEVPOD_UI\") == \"true\" {\n\t\t\treturn nil, fmt.Errorf(\"workspace %s is migrated and needs to be rebuild or reset. Please click on rebuild or reset on the workspace to do this\", c.workspace.ID)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"workspace %s is migrated and needs to be recreated or reset. Please use the recreate or reset flag to do this\", c.workspace.ID)\n\t\t}\n\t}\n\n\t// Log current workspace information. This is both useful to the user to understand the workspace configuration\n\t// and to us when we receive troubleshooting logs\n\tprintInstanceInfo(instance, c.log)\n\n\tif instance.Spec.TemplateRef != nil && templateUpdateRequired(instance) {\n\t\tc.log.Info(\"Template update required\")\n\t\toldInstance := instance.DeepCopy()\n\t\tinstance.Spec.TemplateRef.SyncOnce = true\n\n\t\tinstance, err = platform.UpdateInstance(ctx, baseClient, oldInstance, instance, c.log)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"update instance: %w\", err)\n\t\t}\n\t\tc.log.Info(\"Successfully updated template\")\n\t}\n\n\t// encode options\n\trawOptions, _ := json.Marshal(opt)\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting management client: %w\", err)\n\t}\n\n\t// prompt user to attach to active task or start new one\n\tc.log.Debug(\"Check active up task\")\n\tactiveUpTask, err := findActiveUpTask(ctx, managementClient, instance)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find active up task: %w\", err)\n\t}\n\n\t// if we have an active up task, cancel it before creating a new one\n\tif activeUpTask != nil {\n\t\tc.log.Warnf(\"Found active up task %s, attempting to cancel it\", activeUpTask.ID)\n\t\t_, err = managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(instance.Namespace).Cancel(ctx, instance.Name, &managementv1.DevPodWorkspaceInstanceCancel{\n\t\t\tTaskID: activeUpTask.ID,\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cancel task: %w\", err)\n\t\t}\n\t}\n\n\t// create up task\n\ttask, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(instance.Namespace).Up(ctx, instance.Name, &managementv1.DevPodWorkspaceInstanceUp{\n\t\tSpec: managementv1.DevPodWorkspaceInstanceUpSpec{\n\t\t\tDebug:   opt.Debug,\n\t\t\tOptions: string(rawOptions),\n\t\t},\n\t}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating up: %w\", err)\n\t} else if task.Status.TaskID == \"\" {\n\t\treturn nil, fmt.Errorf(\"no up task id returned from server\")\n\t}\n\n\treturn waitTaskDone(ctx, managementClient, instance, task.Status.TaskID, c.log)\n}\n\nfunc waitTaskDone(ctx context.Context, managementClient kube.Interface, instance *managementv1.DevPodWorkspaceInstance, taskID string, log log.Logger) (*config.Result, error) {\n\texitCode, err := observeTask(ctx, managementClient, instance, taskID, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"up: %w\", err)\n\t} else if exitCode != 0 {\n\t\treturn nil, fmt.Errorf(\"up failed with exit code %d\", exitCode)\n\t}\n\n\t// get result\n\ttasks := &managementv1.DevPodWorkspaceInstanceTasks{}\n\terr = managementClient.Loft().ManagementV1().RESTClient().Get().\n\t\tNamespace(instance.Namespace).\n\t\tResource(\"devpodworkspaceinstances\").\n\t\tName(instance.Name).\n\t\tSubResource(\"tasks\").\n\t\tVersionedParams(&managementv1.DevPodWorkspaceInstanceTasksOptions{\n\t\t\tTaskID: taskID,\n\t\t}, builders.ParameterCodec).\n\t\tDo(ctx).\n\t\tInto(tasks)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting up result: %w\", err)\n\t} else if len(tasks.Tasks) == 0 || tasks.Tasks[0].Result == nil {\n\t\treturn nil, fmt.Errorf(\"up result not found\")\n\t} else if len(tasks.Tasks) > 1 {\n\t\treturn nil, fmt.Errorf(\"multiple up results found\")\n\t}\n\n\t// unmarshal result\n\tresult := &config.Result{}\n\terr = json.Unmarshal(tasks.Tasks[0].Result, result)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshalling up result: %w\", err)\n\t}\n\n\t// return result\n\treturn result, nil\n}\n\nfunc templateUpdateRequired(instance *managementv1.DevPodWorkspaceInstance) bool {\n\tvar templateResolved, templateChangesAvailable bool\n\tfor _, condition := range instance.Status.Conditions {\n\t\tif condition.Type == storagev1.InstanceTemplateResolved {\n\t\t\ttemplateResolved = condition.Status == corev1.ConditionTrue\n\t\t\tcontinue\n\t\t}\n\n\t\tif condition.Type == storagev1.InstanceTemplateSynced {\n\t\t\ttemplateChangesAvailable = condition.Status == corev1.ConditionFalse &&\n\t\t\t\tcondition.Reason == \"TemplateChangesAvailable\"\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn !templateResolved || templateChangesAvailable\n}\n\nfunc printInstanceInfo(instance *managementv1.DevPodWorkspaceInstance, log log.Logger) {\n\tworkspaceConfig, _ := json.Marshal(struct {\n\t\tTarget     storagev1.WorkspaceTarget\n\t\tTemplate   *storagev1.TemplateRef\n\t\tParameters string\n\t}{\n\t\tTarget:     instance.Spec.Target,\n\t\tTemplate:   instance.Spec.TemplateRef,\n\t\tParameters: instance.Spec.Parameters,\n\t})\n\tlog.Debug(\"Starting pro workspace with configuration\", string(workspaceConfig))\n}\n\nfunc observeTask(ctx context.Context, managementClient kube.Interface, instance *managementv1.DevPodWorkspaceInstance, taskID string, log log.Logger) (int, error) {\n\tvar (\n\t\texitCode int\n\t\terr      error\n\t)\n\terrChan := make(chan error, 1)\n\n\tprintCtx, cancelPrintCtx := context.WithCancel(context.Background())\n\tdefer cancelPrintCtx()\n\n\tgo func() {\n\t\t// cancel ongoing task if context is done\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\ttimeoutCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\t\t\tdefer cancel()\n\t\t\tdefer cancelPrintCtx()\n\n\t\t\t_, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(instance.Namespace).Cancel(timeoutCtx, instance.Name, &managementv1.DevPodWorkspaceInstanceCancel{\n\t\t\t\tTaskID: taskID,\n\t\t\t}, metav1.CreateOptions{})\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t} else {\n\t\t\t\terrChan <- errors.New(\"canceled\")\n\t\t\t}\n\t\tcase <-errChan:\n\t\tcase <-printCtx.Done():\n\t\t}\n\t}()\n\tgo func() {\n\t\texitCode, err = printLogs(printCtx, managementClient, instance, taskID, log)\n\t\terrChan <- err\n\t}()\n\n\treturn exitCode, <-errChan\n}\n\ntype MessageType byte\n\nconst (\n\tStdoutData MessageType = 0\n\tStderrData MessageType = 2\n\tExitCode   MessageType = 6\n)\n\ntype Message struct {\n\tType     MessageType `json:\"type\"`\n\tExitCode int         `json:\"exitCode,omitempty\"`\n\tBytes    []byte      `json:\"bytes,omitempty\"`\n}\n\nfunc printLogs(ctx context.Context, managementClient kube.Interface, workspace *managementv1.DevPodWorkspaceInstance, taskID string, logger log.Logger) (int, error) {\n\t// get logs reader\n\tlogger.Debugf(\"printing logs of task: %s\", taskID)\n\tlogsReader, err := managementClient.Loft().ManagementV1().RESTClient().Get().\n\t\tNamespace(workspace.Namespace).\n\t\tResource(\"devpodworkspaceinstances\").\n\t\tName(workspace.Name).\n\t\tSubResource(\"log\").\n\t\tVersionedParams(&managementv1.DevPodWorkspaceInstanceLogOptions{\n\t\t\tTaskID: taskID,\n\t\t\tFollow: true,\n\t\t}, builders.ParameterCodec).\n\t\tStream(ctx)\n\tif err != nil {\n\t\treturn -1, fmt.Errorf(\"error getting task logs: %w\", err)\n\t}\n\tdefer logsReader.Close()\n\n\t// create scanner from logs reader\n\tscanner := bufio.NewScanner(logsReader)\n\n\t// Increase the maximum token size to handle very long lines.\n\t// Here, we set a maximum capacity of 1MB.\n\tconst maxCapacity = 1024 * 1024 // 1MB\n\tbuf := make([]byte, 1024)       // starting buffer size of 1KB\n\tscanner.Buffer(buf, maxCapacity)\n\n\t// create json streamer\n\tstdoutStreamer, stdoutDone := devpodlog.PipeJSONStream(logger)\n\tstderrStreamer, stderrDone := devpodlog.PipeJSONStream(logger.ErrorStreamOnly())\n\tdefer func() {\n\t\t// close the streams\n\t\tstdoutStreamer.Close()\n\t\tstderrStreamer.Close()\n\n\t\t// wait for the streams to be closed\n\t\t<-stdoutDone\n\t\t<-stderrDone\n\t}()\n\n\t// loop over all lines\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\t// parse message\n\t\tmessage := &Message{}\n\t\tif err := json.Unmarshal([]byte(line), message); err != nil {\n\t\t\treturn -1, fmt.Errorf(\"error parsing JSON from logs reader: %w, line: %s\", err, line)\n\t\t}\n\n\t\t// write message to stdout or stderr\n\t\tif message.Type == StdoutData {\n\t\t\tif _, err := stdoutStreamer.Write(message.Bytes); err != nil {\n\t\t\t\tlogger.Debugf(\"error read stdout: %v\", err)\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t} else if message.Type == StderrData {\n\t\t\tif _, err := stderrStreamer.Write(message.Bytes); err != nil {\n\t\t\t\tlogger.Debugf(\"error read stderr: %v\", err)\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t} else if message.Type == ExitCode {\n\t\t\tlogger.Debugf(\"exit code: %d\", message.ExitCode)\n\t\t\treturn message.ExitCode, nil\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tif errors.Is(err, context.Canceled) {\n\t\t\treturn 0, nil\n\t\t}\n\t\treturn -1, fmt.Errorf(\"logs reader error: %w\", err)\n\t}\n\n\treturn 0, nil\n}\n\nconst (\n\tTaskStatusRunning = \"Running\"\n\tTaskStatusSucceed = \"Succeeded\"\n\tTaskStatusFailed  = \"Failed\"\n)\nconst (\n\tTaskTypeUp     = \"up\"\n\tTaskTypeStop   = \"stop\"\n\tTaskTypeDelete = \"delete\"\n)\n\nfunc findActiveUpTask(ctx context.Context, managementClient kube.Interface, instance *managementv1.DevPodWorkspaceInstance) (*managementv1.DevPodWorkspaceInstanceTask, error) {\n\ttasks := &managementv1.DevPodWorkspaceInstanceTasks{}\n\terr := managementClient.Loft().ManagementV1().RESTClient().Get().\n\t\tNamespace(instance.Namespace).\n\t\tResource(\"devpodworkspaceinstances\").\n\t\tName(instance.Name).\n\t\tSubResource(\"tasks\").\n\t\tDo(ctx).\n\t\tInto(tasks)\n\n\tfor _, task := range tasks.Tasks {\n\t\tif task.Status == TaskStatusRunning && task.Type == TaskTypeUp {\n\t\t\treturn &task, nil\n\t\t}\n\t}\n\n\treturn nil, err\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/daemonclient/update.go",
    "content": "package daemonclient\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/log/terminal\"\n)\n\nfunc (c *client) updateInstance(ctx context.Context) error {\n\tbaseClient, err := c.initPlatformClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !terminal.IsTerminalIn {\n\t\treturn fmt.Errorf(\"unable to update instance through CLI if stdin is not a terminal\")\n\t}\n\n\toldInstance, err := c.localClient.GetWorkspace(ctx, c.workspace.UID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif oldInstance == nil {\n\t\treturn fmt.Errorf(\"unable to find old workspace instance\")\n\t}\n\tnewInstance, err := updateInstanceInteractive(ctx, baseClient, oldInstance, c.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = c.localClient.UpdateWorkspace(ctx, newInstance)\n\treturn err\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/machine_client.go",
    "content": "package clientimplementation\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/options\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc NewMachineClient(devPodConfig *config.Config, provider *provider.ProviderConfig, machine *provider.Machine, log log.Logger) (client.MachineClient, error) {\n\tif !provider.IsMachineProvider() {\n\t\treturn nil, fmt.Errorf(\"provider '%s' is not a machine provider. Please use another provider\", provider.Name)\n\t} else if machine == nil {\n\t\treturn nil, fmt.Errorf(\"machine doesn't exist. Seems like it was deleted without the workspace being deleted\")\n\t}\n\n\treturn &machineClient{\n\t\tdevPodConfig: devPodConfig,\n\t\tconfig:       provider,\n\t\tmachine:      machine,\n\t\tlog:          log,\n\t}, nil\n}\n\ntype machineClient struct {\n\tdevPodConfig *config.Config\n\tconfig       *provider.ProviderConfig\n\tmachine      *provider.Machine\n\tlog          log.Logger\n}\n\nfunc (s *machineClient) Provider() string {\n\treturn s.config.Name\n}\n\nfunc (s *machineClient) Machine() string {\n\treturn s.machine.ID\n}\n\nfunc (s *machineClient) MachineConfig() *provider.Machine {\n\treturn provider.CloneMachine(s.machine)\n}\n\nfunc (s *machineClient) RefreshOptions(ctx context.Context, userOptionsRaw []string, reconfigure bool) error {\n\tuserOptions, err := provider.ParseOptions(userOptionsRaw)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"parse options\")\n\t}\n\n\tmachine, err := options.ResolveAndSaveOptionsMachine(ctx, s.devPodConfig, s.config, s.machine, userOptions, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.machine = machine\n\treturn nil\n}\n\nfunc (s *machineClient) AgentPath() string {\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, nil, s.machine).Path\n}\n\nfunc (s *machineClient) AgentLocal() bool {\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, nil, s.machine).Local == \"true\"\n}\n\nfunc (s *machineClient) AgentURL() string {\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, nil, s.machine).DownloadURL\n}\n\nfunc (s *machineClient) Context() string {\n\treturn s.machine.Context\n}\n\nfunc (s *machineClient) Create(ctx context.Context, options client.CreateOptions) error {\n\tdone := printStillRunningLogMessagePeriodically(s.log)\n\tdefer close(done)\n\n\twriter := s.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// create a machine\n\ts.log.Infof(\"Create machine '%s' with provider '%s'...\", s.machine.ID, s.config.Name)\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"create\",\n\t\ts.config.Exec.Create,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.log.Donef(\"Successfully created machine '%s' with provider '%s'\", s.machine.ID, s.config.Name)\n\treturn nil\n}\n\nfunc (s *machineClient) Start(ctx context.Context, options client.StartOptions) error {\n\tdone := printStillRunningLogMessagePeriodically(s.log)\n\tdefer close(done)\n\n\twriter := s.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\ts.log.Infof(\"Starting machine '%s'...\", s.machine.ID)\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"start\",\n\t\ts.config.Exec.Start,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.log.Donef(\"Successfully started '%s'\", s.machine.ID)\n\n\treturn nil\n}\n\nfunc (s *machineClient) Stop(ctx context.Context, options client.StopOptions) error {\n\tdone := printStillRunningLogMessagePeriodically(s.log)\n\tdefer close(done)\n\n\twriter := s.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\ts.log.Infof(\"Stopping machine '%s'...\", s.machine.ID)\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"stop\",\n\t\ts.config.Exec.Stop,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.log.Donef(\"Successfully stopped '%s'\", s.machine.ID)\n\n\treturn nil\n}\n\nfunc (s *machineClient) Command(ctx context.Context, commandOptions client.CommandOptions) error {\n\treturn RunCommandWithBinaries(\n\t\tctx,\n\t\t\"command\",\n\t\ts.config.Exec.Command,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tmap[string]string{\n\t\t\tprovider.CommandEnv: commandOptions.Command,\n\t\t},\n\t\tcommandOptions.Stdin,\n\t\tcommandOptions.Stdout,\n\t\tcommandOptions.Stderr,\n\t\ts.log.ErrorStreamOnly(),\n\t)\n}\n\nfunc (s *machineClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) {\n\tstdout := &bytes.Buffer{}\n\tstderr := &bytes.Buffer{}\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"status\",\n\t\ts.config.Exec.Status,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\tstdout,\n\t\tstderr,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\treturn client.StatusNotFound, fmt.Errorf(\"get status: %s%s\", strings.TrimSpace(stdout.String()), strings.TrimSpace(stderr.String()))\n\t}\n\n\t// parse status\n\tparsedStatus, err := client.ParseStatus(stdout.String())\n\tif err != nil {\n\t\treturn client.StatusNotFound, err\n\t}\n\n\treturn parsedStatus, nil\n}\n\nfunc (s *machineClient) Delete(ctx context.Context, options client.DeleteOptions) error {\n\tvar gracePeriod *time.Duration\n\tif options.GracePeriod != \"\" {\n\t\tduration, err := time.ParseDuration(options.GracePeriod)\n\t\tif err == nil {\n\t\t\tgracePeriod = &duration\n\t\t}\n\t}\n\n\t// kill the command after the grace period\n\tif gracePeriod != nil {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, *gracePeriod)\n\t\tdefer cancel()\n\t}\n\n\tdone := printStillRunningLogMessagePeriodically(s.log)\n\tdefer close(done)\n\n\twriter := s.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\ts.log.Infof(\"Deleting '%s' machine '%s'...\", s.config.Name, s.machine.ID)\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"delete\",\n\t\ts.config.Exec.Delete,\n\t\ts.machine.Context,\n\t\tnil,\n\t\ts.machine,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\tif !options.Force {\n\t\t\treturn err\n\t\t}\n\n\t\ts.log.Errorf(\"Error deleting machine '%s': %v\", s.machine.ID, err)\n\t}\n\ts.log.Donef(\"Successfully deleted machine '%s'\", s.machine.ID)\n\n\t// delete machine folder\n\terr = DeleteMachineFolder(s.machine.Context, s.machine.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc runCommand(ctx context.Context, name string, command types.StrArray, environ []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, log log.Logger) (err error) {\n\tif len(command) == 0 {\n\t\treturn nil\n\t}\n\n\t// log\n\tlog.Debugf(\"Run %s provider command: %s\", name, strings.Join(command, \" \"))\n\n\t// set debug level\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tenviron = append(environ, DevPodDebug+\"=true\")\n\t}\n\n\t// run the command\n\treturn RunCommand(ctx, command, environ, stdin, stdout, stderr)\n}\n\nfunc printStillRunningLogMessagePeriodically(log log.Logger) chan struct{} {\n\treturn printLogMessagePeriodically(\"Please hang on, DevPod is still running, this might take a while...\", log)\n}\n\nfunc printLogMessagePeriodically(message string, log log.Logger) chan struct{} {\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-done:\n\t\t\t\treturn\n\t\t\tcase <-time.After(time.Second * 5):\n\t\t\t\tlog.Info(message)\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn done\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/proxy_client.go",
    "content": "package clientimplementation\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/blang/semver/v4\"\n\t\"github.com/gofrs/flock\"\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdevpodlog \"github.com/loft-sh/devpod/pkg/log\"\n\t\"github.com/loft-sh/devpod/pkg/options\"\n\tplatformclient \"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n)\n\nvar (\n\tDevPodDebug = \"DEVPOD_DEBUG\"\n\n\tDevPodPlatformOptions = \"DEVPOD_PLATFORM_OPTIONS\"\n\n\tDevPodFlagsUp     = \"DEVPOD_FLAGS_UP\"\n\tDevPodFlagsSsh    = \"DEVPOD_FLAGS_SSH\"\n\tDevPodFlagsDelete = \"DEVPOD_FLAGS_DELETE\"\n\tDevPodFlagsStatus = \"DEVPOD_FLAGS_STATUS\"\n)\n\nfunc NewProxyClient(devPodConfig *config.Config, prov *provider.ProviderConfig, workspace *provider.Workspace, log log.Logger) (client.ProxyClient, error) {\n\treturn &proxyClient{\n\t\tdevPodConfig: devPodConfig,\n\t\tconfig:       prov,\n\t\tworkspace:    workspace,\n\t\tlog:          log,\n\t}, nil\n}\n\ntype proxyClient struct {\n\tm sync.Mutex\n\n\tworkspaceLockOnce sync.Once\n\tworkspaceLock     *flock.Flock\n\n\tdevPodConfig *config.Config\n\tconfig       *provider.ProviderConfig\n\tworkspace    *provider.Workspace\n\tlog          log.Logger\n}\n\nfunc (s *proxyClient) Lock(ctx context.Context) error {\n\ts.initLock()\n\n\t// try to lock workspace\n\ts.log.Debugf(\"Acquire workspace lock...\")\n\terr := tryLock(ctx, s.workspaceLock, \"workspace\", s.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error locking workspace: %w\", err)\n\t}\n\ts.log.Debugf(\"Acquired workspace lock...\")\n\n\treturn nil\n}\n\nfunc (s *proxyClient) Unlock() {\n\ts.initLock()\n\n\t// try to unlock workspace\n\terr := s.workspaceLock.Unlock()\n\tif err != nil {\n\t\ts.log.Warnf(\"Error unlocking workspace: %v\", err)\n\t}\n}\n\nfunc tryLock(ctx context.Context, lock *flock.Flock, name string, log log.Logger) error {\n\tdone := printLogMessagePeriodically(fmt.Sprintf(\"Trying to lock %s, seems like another process is running that blocks this %s\", name, name), log)\n\tdefer close(done)\n\n\tnow := time.Now()\n\tfor time.Since(now) < time.Minute*5 {\n\t\tlocked, err := lock.TryLock()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if locked {\n\t\t\treturn nil\n\t\t}\n\n\t\tselect {\n\t\tcase <-time.After(time.Second):\n\t\t\tcontinue\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"timed out waiting to lock %s, seems like there is another process running on this machine that blocks it\", name)\n}\n\nfunc (s *proxyClient) initLock() {\n\ts.workspaceLockOnce.Do(func() {\n\t\ts.m.Lock()\n\t\tdefer s.m.Unlock()\n\n\t\t// get locks dir\n\t\tworkspaceLocksDir, err := provider.GetLocksDir(s.workspace.Context)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"get workspaces dir: %w\", err))\n\t\t}\n\t\t_ = os.MkdirAll(workspaceLocksDir, 0777)\n\n\t\t// create workspace lock\n\t\ts.workspaceLock = flock.New(filepath.Join(workspaceLocksDir, s.workspace.ID+\".workspace.lock\"))\n\t})\n}\n\nfunc (s *proxyClient) Provider() string {\n\treturn s.config.Name\n}\n\nfunc (s *proxyClient) Workspace() string {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn s.workspace.ID\n}\n\nfunc (s *proxyClient) WorkspaceConfig() *provider.Workspace {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn provider.CloneWorkspace(s.workspace)\n}\n\nfunc (s *proxyClient) Context() string {\n\treturn s.workspace.Context\n}\n\nfunc (s *proxyClient) RefreshOptions(ctx context.Context, userOptionsRaw []string, reconfigure bool) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tuserOptions, err := provider.ParseOptions(userOptionsRaw)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"parse options\")\n\t}\n\n\tworkspace, err := options.ResolveAndSaveOptionsProxy(ctx, s.devPodConfig, s.config, s.workspace, userOptions, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif reconfigure {\n\t\terr := s.updateInstance(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ts.workspace = workspace\n\treturn nil\n}\n\nfunc (s *proxyClient) Create(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"createWorkspace\",\n\t\ts.config.Exec.Proxy.Create.Workspace,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tstdin,\n\t\tstdout,\n\t\tstderr,\n\t\ts.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create remote workspace : %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *proxyClient) Up(ctx context.Context, opt client.UpOptions) error {\n\twriter, _ := devpodlog.PipeJSONStream(s.log.ErrorStreamOnly())\n\tdefer writer.Close()\n\n\topts := EncodeOptions(opt.CLIOptions, DevPodFlagsUp)\n\tif opt.Debug {\n\t\topts[\"DEBUG\"] = \"true\"\n\t}\n\n\t// check if the provider is outdated\n\tproviderOptions := s.devPodConfig.ProviderOptions(s.config.Name)\n\tif providerOptions[\"LOFT_CONFIG\"].Value != \"\" {\n\t\tbaseClient, err := platformclient.InitClientFromPath(ctx, providerOptions[\"LOFT_CONFIG\"].Value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error initializing platform client: %w\", err)\n\t\t}\n\n\t\tversion, err := baseClient.Version()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error retrieving platform version: %w\", err)\n\t\t}\n\n\t\t// check if the version is lower than v4.3.0-devpod.alpha.19\n\t\tparsedVersion, err := semver.Parse(strings.TrimPrefix(version.DevPodVersion, \"v\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing platform version: %w\", err)\n\t\t}\n\n\t\t// if devpod version is greater than 0.7.0 we error here\n\t\tif parsedVersion.GE(semver.MustParse(\"0.6.99\")) {\n\t\t\treturn fmt.Errorf(\"you are using an outdated provider version for this platform. Please disconnect and reconnect the platform to update the provider\")\n\t\t}\n\t}\n\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"up\",\n\t\ts.config.Exec.Proxy.Up,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\tproviderOptions,\n\t\ts.config,\n\t\topts,\n\t\topt.Stdin,\n\t\topt.Stdout,\n\t\twriter,\n\t\ts.log.ErrorStreamOnly(),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error running devpod up: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *proxyClient) Ssh(ctx context.Context, opt client.SshOptions) error {\n\twriter, _ := devpodlog.PipeJSONStream(s.log.ErrorStreamOnly())\n\tdefer writer.Close()\n\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"ssh\",\n\t\ts.config.Exec.Proxy.Ssh,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tEncodeOptions(opt, DevPodFlagsSsh),\n\t\topt.Stdin,\n\t\topt.Stdout,\n\t\twriter,\n\t\ts.log.ErrorStreamOnly(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *proxyClient) Delete(ctx context.Context, opt client.DeleteOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\twriter, _ := devpodlog.PipeJSONStream(s.log.ErrorStreamOnly())\n\tdefer writer.Close()\n\n\tvar gracePeriod *time.Duration\n\tif opt.GracePeriod != \"\" {\n\t\tduration, err := time.ParseDuration(opt.GracePeriod)\n\t\tif err == nil {\n\t\t\tgracePeriod = &duration\n\t\t}\n\t}\n\n\t// kill the command after the grace period\n\tif gracePeriod != nil {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, *gracePeriod)\n\t\tdefer cancel()\n\t}\n\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"delete\",\n\t\ts.config.Exec.Proxy.Delete,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tEncodeOptions(opt, DevPodFlagsDelete),\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\tif !opt.Force {\n\t\t\treturn fmt.Errorf(\"error deleting workspace: %w\", err)\n\t\t}\n\n\t\ts.log.Errorf(\"Error deleting workspace: %v\", err)\n\t}\n\n\treturn DeleteWorkspaceFolder(s.workspace.Context, s.workspace.ID, s.workspace.SSHConfigPath, s.log)\n}\n\nfunc (s *proxyClient) Stop(ctx context.Context, opt client.StopOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\twriter, _ := devpodlog.PipeJSONStream(s.log.ErrorStreamOnly())\n\tdefer writer.Close()\n\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"stop\",\n\t\ts.config.Exec.Proxy.Stop,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\ts.log,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error stopping container: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *proxyClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tstdout := &bytes.Buffer{}\n\tbuf := &bytes.Buffer{}\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"status\",\n\t\ts.config.Exec.Proxy.Status,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tEncodeOptions(options, DevPodFlagsStatus),\n\t\tnil,\n\t\tio.MultiWriter(stdout, buf),\n\t\tbuf,\n\t\ts.log.ErrorStreamOnly(),\n\t)\n\tif err != nil {\n\t\treturn client.StatusNotFound, fmt.Errorf(\"error retrieving container status: %s%w\", buf.String(), err)\n\t}\n\n\tdevpodlog.ReadJSONStream(bytes.NewReader(buf.Bytes()), s.log.ErrorStreamOnly())\n\tstatus := &client.WorkspaceStatus{}\n\terr = json.Unmarshal(stdout.Bytes(), status)\n\tif err != nil {\n\t\treturn client.StatusNotFound, fmt.Errorf(\"error parsing proxy command response: %s%w\", stdout.String(), err)\n\t}\n\n\t// parse status\n\treturn client.ParseStatus(status.State)\n}\n\nfunc (s *proxyClient) updateInstance(ctx context.Context) error {\n\terr := RunCommandWithBinaries(\n\t\tctx,\n\t\t\"updateWorkspace\",\n\t\ts.config.Exec.Proxy.Update.Workspace,\n\t\ts.workspace.Context,\n\t\ts.workspace,\n\t\tnil,\n\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\ts.config,\n\t\tnil,\n\t\tos.Stdin,\n\t\tos.Stdout,\n\t\tos.Stderr,\n\t\ts.log.ErrorStreamOnly(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc EncodeOptions(options any, name string) map[string]string {\n\traw, _ := json.Marshal(options)\n\treturn map[string]string{\n\t\tname: string(raw),\n\t}\n}\n\nfunc DecodeOptionsFromEnv(name string, into any) (bool, error) {\n\traw := os.Getenv(name)\n\tif raw == \"\" {\n\t\treturn false, nil\n\t}\n\n\treturn true, json.Unmarshal([]byte(raw), into)\n}\n\nfunc DecodePlatformOptionsFromEnv(into *devpod.PlatformOptions) error {\n\traw := os.Getenv(DevPodPlatformOptions)\n\tif raw == \"\" {\n\t\treturn nil\n\t}\n\n\treturn json.Unmarshal([]byte(raw), into)\n}\n"
  },
  {
    "path": "pkg/client/clientimplementation/workspace_client.go",
    "content": "package clientimplementation\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/gofrs/flock\"\n\t\"github.com/loft-sh/devpod/pkg/binaries\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/options\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc NewWorkspaceClient(devPodConfig *config.Config, prov *provider.ProviderConfig, workspace *provider.Workspace, machine *provider.Machine, log log.Logger) (client.WorkspaceClient, error) {\n\tif workspace.Machine.ID != \"\" && machine == nil {\n\t\treturn nil, fmt.Errorf(\"workspace machine is not found\")\n\t} else if prov.IsMachineProvider() && workspace.Machine.ID == \"\" {\n\t\treturn nil, fmt.Errorf(\"workspace machine ID is empty, but machine provider found\")\n\t}\n\n\treturn &workspaceClient{\n\t\tdevPodConfig: devPodConfig,\n\t\tconfig:       prov,\n\t\tworkspace:    workspace,\n\t\tmachine:      machine,\n\t\tlog:          log,\n\t}, nil\n}\n\ntype workspaceClient struct {\n\tm sync.Mutex\n\n\tworkspaceLockOnce sync.Once\n\tworkspaceLock     *flock.Flock\n\tmachineLock       *flock.Flock\n\n\tdevPodConfig *config.Config\n\tconfig       *provider.ProviderConfig\n\tworkspace    *provider.Workspace\n\tmachine      *provider.Machine\n\tlog          log.Logger\n}\n\nfunc (s *workspaceClient) Provider() string {\n\treturn s.config.Name\n}\n\nfunc (s *workspaceClient) Workspace() string {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn s.workspace.ID\n}\n\nfunc (s *workspaceClient) WorkspaceConfig() *provider.Workspace {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn provider.CloneWorkspace(s.workspace)\n}\n\nfunc (s *workspaceClient) AgentLocal() bool {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, s.workspace, s.machine).Local == \"true\"\n}\n\nfunc (s *workspaceClient) AgentPath() string {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, s.workspace, s.machine).Path\n}\n\nfunc (s *workspaceClient) AgentURL() string {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn options.ResolveAgentConfig(s.devPodConfig, s.config, s.workspace, s.machine).DownloadURL\n}\n\nfunc (s *workspaceClient) Context() string {\n\treturn s.workspace.Context\n}\n\nfunc (s *workspaceClient) RefreshOptions(ctx context.Context, userOptionsRaw []string, reconfigure bool) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tuserOptions, err := provider.ParseOptions(userOptionsRaw)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"parse options\")\n\t}\n\n\tif s.isMachineProvider() {\n\t\tif s.machine == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tmachine, err := options.ResolveAndSaveOptionsMachine(ctx, s.devPodConfig, s.config, s.machine, userOptions, s.log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ts.machine = machine\n\t\treturn nil\n\t}\n\n\tworkspace, err := options.ResolveAndSaveOptionsWorkspace(ctx, s.devPodConfig, s.config, s.workspace, userOptions, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.workspace = workspace\n\treturn nil\n}\n\nfunc (s *workspaceClient) AgentInjectGitCredentials(cliOptions provider.CLIOptions) bool {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn s.agentInfo(cliOptions).Agent.InjectGitCredentials == \"true\"\n}\n\nfunc (s *workspaceClient) AgentInjectDockerCredentials(cliOptions provider.CLIOptions) bool {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn s.agentInfo(cliOptions).Agent.InjectDockerCredentials == \"true\"\n}\n\nfunc (s *workspaceClient) AgentInfo(cliOptions provider.CLIOptions) (string, *provider.AgentWorkspaceInfo, error) {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\treturn s.compressedAgentInfo(cliOptions)\n}\n\nfunc (s *workspaceClient) compressedAgentInfo(cliOptions provider.CLIOptions) (string, *provider.AgentWorkspaceInfo, error) {\n\tagentInfo := s.agentInfo(cliOptions)\n\n\t// marshal config\n\tout, err := json.Marshal(agentInfo)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tcompressed, err := compress.Compress(string(out))\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\treturn compressed, agentInfo, nil\n}\n\nfunc (s *workspaceClient) agentInfo(cliOptions provider.CLIOptions) *provider.AgentWorkspaceInfo {\n\t// try to load last devcontainer.json\n\tvar lastDevContainerConfig *config2.DevContainerConfigWithPath\n\tvar workspaceOrigin string\n\tif s.workspace != nil {\n\t\tresult, err := provider.LoadWorkspaceResult(s.workspace.Context, s.workspace.ID)\n\t\tif err != nil {\n\t\t\ts.log.Debugf(\"Error loading workspace result: %v\", err)\n\t\t} else if result != nil {\n\t\t\tlastDevContainerConfig = result.DevContainerConfigWithPath\n\t\t}\n\n\t\tworkspaceOrigin = s.workspace.Origin\n\t}\n\n\t// build struct\n\tagentInfo := &provider.AgentWorkspaceInfo{\n\t\tWorkspaceOrigin:        workspaceOrigin,\n\t\tWorkspace:              s.workspace,\n\t\tMachine:                s.machine,\n\t\tLastDevContainerConfig: lastDevContainerConfig,\n\t\tCLIOptions:             cliOptions,\n\t\tAgent:                  options.ResolveAgentConfig(s.devPodConfig, s.config, s.workspace, s.machine),\n\t\tOptions:                s.devPodConfig.ProviderOptions(s.Provider()),\n\t}\n\n\t// if we are running platform mode\n\tif cliOptions.Platform.Enabled {\n\t\tagentInfo.Agent.InjectGitCredentials = \"true\"\n\t\tagentInfo.Agent.InjectDockerCredentials = \"true\"\n\t}\n\n\t// we don't send any provider options if proxy because these could contain\n\t// sensitive information and we don't want to allow privileged containers that\n\t// have access to the host to save these.\n\tif agentInfo.Agent.Driver != provider.CustomDriver && (cliOptions.Platform.Enabled || cliOptions.DisableDaemon) {\n\t\tagentInfo.Options = map[string]config.OptionValue{}\n\t\tagentInfo.Workspace = provider.CloneWorkspace(agentInfo.Workspace)\n\t\tagentInfo.Workspace.Provider.Options = map[string]config.OptionValue{}\n\t\tif agentInfo.Machine != nil {\n\t\t\tagentInfo.Machine = provider.CloneMachine(agentInfo.Machine)\n\t\t\tagentInfo.Machine.Provider.Options = map[string]config.OptionValue{}\n\t\t}\n\t}\n\n\t// Get the timeout from the context options\n\tagentInfo.InjectTimeout = config.ParseTimeOption(s.devPodConfig, config.ContextOptionAgentInjectTimeout)\n\n\t// Set registry cache from context option\n\tagentInfo.RegistryCache = s.devPodConfig.ContextOption(config.ContextOptionRegistryCache)\n\n\treturn agentInfo\n}\n\nfunc (s *workspaceClient) initLock() {\n\ts.workspaceLockOnce.Do(func() {\n\t\ts.m.Lock()\n\t\tdefer s.m.Unlock()\n\n\t\t// get locks dir\n\t\tworkspaceLocksDir, err := provider.GetLocksDir(s.workspace.Context)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"get workspaces dir: %w\", err))\n\t\t}\n\t\t_ = os.MkdirAll(workspaceLocksDir, 0777)\n\n\t\t// create workspace lock\n\t\ts.workspaceLock = flock.New(filepath.Join(workspaceLocksDir, s.workspace.ID+\".workspace.lock\"))\n\n\t\t// create machine lock\n\t\tif s.machine != nil {\n\t\t\ts.machineLock = flock.New(filepath.Join(workspaceLocksDir, s.machine.ID+\".machine.lock\"))\n\t\t}\n\t})\n}\n\nfunc (s *workspaceClient) Lock(ctx context.Context) error {\n\ts.initLock()\n\n\t// try to lock workspace\n\ts.log.Debugf(\"Acquire workspace lock...\")\n\terr := tryLock(ctx, s.workspaceLock, \"workspace\", s.log)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error locking workspace: %w\", err)\n\t}\n\ts.log.Debugf(\"Acquired workspace lock...\")\n\n\t// try to lock machine\n\tif s.machineLock != nil {\n\t\ts.log.Debugf(\"Acquire machine lock...\")\n\t\terr := tryLock(ctx, s.machineLock, \"machine\", s.log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error locking machine: %w\", err)\n\t\t}\n\t\ts.log.Debugf(\"Acquired machine lock...\")\n\t}\n\n\treturn nil\n}\n\nfunc (s *workspaceClient) Unlock() {\n\ts.initLock()\n\n\t// try to unlock machine\n\tif s.machineLock != nil {\n\t\terr := s.machineLock.Unlock()\n\t\tif err != nil {\n\t\t\ts.log.Warnf(\"Error unlocking machine: %v\", err)\n\t\t}\n\t}\n\n\t// try to unlock workspace\n\terr := s.workspaceLock.Unlock()\n\tif err != nil {\n\t\ts.log.Warnf(\"Error unlocking workspace: %v\", err)\n\t}\n}\n\nfunc (s *workspaceClient) Create(ctx context.Context, options client.CreateOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\t// provider doesn't support machines\n\tif !s.isMachineProvider() {\n\t\treturn nil\n\t}\n\n\t// check machine state\n\tif s.machine == nil {\n\t\treturn fmt.Errorf(\"machine is not defined\")\n\t}\n\n\t// create machine client\n\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// get status\n\tmachineStatus, err := machineClient.Status(ctx, client.StatusOptions{})\n\tif err != nil {\n\t\treturn err\n\t} else if machineStatus != client.StatusNotFound {\n\t\treturn nil\n\t}\n\n\t// create the machine\n\treturn machineClient.Create(ctx, client.CreateOptions{})\n}\n\nfunc (s *workspaceClient) Delete(ctx context.Context, opt client.DeleteOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\t// parse duration\n\tvar gracePeriod *time.Duration\n\tif opt.GracePeriod != \"\" {\n\t\tduration, err := time.ParseDuration(opt.GracePeriod)\n\t\tif err == nil {\n\t\t\tgracePeriod = &duration\n\t\t}\n\t}\n\n\t// kill the command after the grace period\n\tif gracePeriod != nil {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, *gracePeriod)\n\t\tdefer cancel()\n\t}\n\n\t// should just delete container?\n\tif !s.isMachineProvider() || !s.workspace.Machine.AutoDelete {\n\t\tisRunning, err := s.isMachineRunning(ctx)\n\t\tif err != nil {\n\t\t\tif !opt.Force {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if isRunning {\n\t\t\twriter := s.log.Writer(logrus.InfoLevel, false)\n\t\t\tdefer writer.Close()\n\n\t\t\ts.log.Infof(\"Deleting container...\")\n\t\t\tcompressed, info, err := s.compressedAgentInfo(provider.CLIOptions{})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"agent info\")\n\t\t\t}\n\t\t\tcommand := fmt.Sprintf(\"'%s' agent workspace delete --workspace-info '%s'\", info.Agent.Path, compressed)\n\t\t\terr = RunCommandWithBinaries(\n\t\t\t\tctx,\n\t\t\t\t\"command\",\n\t\t\t\ts.config.Exec.Command,\n\t\t\t\ts.workspace.Context,\n\t\t\t\ts.workspace,\n\t\t\t\ts.machine,\n\t\t\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\t\t\ts.config,\n\t\t\t\tmap[string]string{\n\t\t\t\t\tprovider.CommandEnv: command,\n\t\t\t\t},\n\t\t\t\tnil,\n\t\t\t\twriter,\n\t\t\t\twriter,\n\t\t\t\ts.log.ErrorStreamOnly(),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tif !opt.Force {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tif !errors.Is(err, context.DeadlineExceeded) {\n\t\t\t\t\ts.log.Errorf(\"Error deleting container: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if s.machine != nil && s.workspace.Machine.ID != \"\" && len(s.config.Exec.Delete) > 0 {\n\t\t// delete machine if config was found\n\t\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\t\tif err != nil {\n\t\t\tif !opt.Force {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terr = machineClient.Delete(ctx, opt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn DeleteWorkspaceFolder(s.workspace.Context, s.workspace.ID, s.workspace.SSHConfigPath, s.log)\n}\n\nfunc (s *workspaceClient) isMachineRunning(ctx context.Context) (bool, error) {\n\tif !s.isMachineProvider() {\n\t\treturn true, nil\n\t}\n\n\t// delete machine if config was found\n\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// retrieve status\n\tstatus, err := machineClient.Status(ctx, client.StatusOptions{})\n\tif err != nil {\n\t\treturn false, perrors.Wrap(err, \"retrieve machine status\")\n\t} else if status == client.StatusRunning {\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}\n\nfunc (s *workspaceClient) Start(ctx context.Context, options client.StartOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tif !s.isMachineProvider() || s.machine == nil {\n\t\treturn nil\n\t}\n\n\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn machineClient.Start(ctx, options)\n}\n\nfunc (s *workspaceClient) Stop(ctx context.Context, opt client.StopOptions) error {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tif !s.isMachineProvider() || !s.workspace.Machine.AutoDelete {\n\t\twriter := s.log.Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\n\t\ts.log.Infof(\"Stopping container...\")\n\t\tcompressed, info, err := s.compressedAgentInfo(provider.CLIOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"agent info\")\n\t\t}\n\t\tcommand := fmt.Sprintf(\"'%s' agent workspace stop --workspace-info '%s'\", info.Agent.Path, compressed)\n\t\terr = RunCommandWithBinaries(\n\t\t\tctx,\n\t\t\t\"command\",\n\t\t\ts.config.Exec.Command,\n\t\t\ts.workspace.Context,\n\t\t\ts.workspace,\n\t\t\ts.machine,\n\t\t\ts.devPodConfig.ProviderOptions(s.config.Name),\n\t\t\ts.config,\n\t\t\tmap[string]string{\n\t\t\t\tprovider.CommandEnv: command,\n\t\t\t},\n\t\t\tnil,\n\t\t\twriter,\n\t\t\twriter,\n\t\t\ts.log.ErrorStreamOnly(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ts.log.Infof(\"Successfully stopped container...\")\n\n\t\treturn nil\n\t}\n\n\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn machineClient.Stop(ctx, opt)\n}\n\nfunc (s *workspaceClient) Command(ctx context.Context, commandOptions client.CommandOptions) (err error) {\n\t// get environment variables\n\ts.m.Lock()\n\tenviron, err := binaries.ToEnvironmentWithBinaries(s.workspace.Context, s.workspace, s.machine, s.devPodConfig.ProviderOptions(s.config.Name), s.config, map[string]string{\n\t\tprovider.CommandEnv: commandOptions.Command,\n\t}, s.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.m.Unlock()\n\n\t// resolve options\n\treturn runCommand(ctx, \"command\", s.config.Exec.Command, environ, commandOptions.Stdin, commandOptions.Stdout, commandOptions.Stderr, s.log.ErrorStreamOnly())\n}\n\nfunc (s *workspaceClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\t// check if provider has status command\n\tif s.isMachineProvider() && len(s.config.Exec.Status) > 0 {\n\t\tif s.machine == nil {\n\t\t\treturn client.StatusNotFound, nil\n\t\t}\n\n\t\tmachineClient, err := NewMachineClient(s.devPodConfig, s.config, s.machine, s.log)\n\t\tif err != nil {\n\t\t\treturn client.StatusNotFound, err\n\t\t}\n\n\t\tstatus, err := machineClient.Status(ctx, options)\n\t\tif err != nil {\n\t\t\treturn status, err\n\t\t}\n\n\t\t// try to check container status and if that fails check workspace folder\n\t\tif status == client.StatusRunning && options.ContainerStatus {\n\t\t\treturn s.getContainerStatus(ctx)\n\t\t}\n\n\t\treturn status, err\n\t}\n\n\t// try to check container status and if that fails check workspace folder\n\tif options.ContainerStatus {\n\t\treturn s.getContainerStatus(ctx)\n\t}\n\n\t// logic:\n\t// - if workspace folder exists -> Running\n\t// - if workspace folder doesn't exist -> NotFound\n\tworkspaceFolder, err := provider.GetWorkspaceDir(s.workspace.Context, s.workspace.ID)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// does workspace folder exist?\n\t_, err = os.Stat(workspaceFolder)\n\tif err == nil {\n\t\treturn client.StatusRunning, nil\n\t}\n\n\treturn client.StatusNotFound, nil\n}\n\nfunc (s *workspaceClient) getContainerStatus(ctx context.Context) (client.Status, error) {\n\tstdout := &bytes.Buffer{}\n\tbuf := &bytes.Buffer{}\n\tcompressed, info, err := s.compressedAgentInfo(provider.CLIOptions{})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get agent info\")\n\t}\n\tcommand := fmt.Sprintf(\"'%s' agent workspace status --workspace-info '%s'\", info.Agent.Path, compressed)\n\terr = RunCommandWithBinaries(ctx, \"command\", s.config.Exec.Command, s.workspace.Context, s.workspace, s.machine, s.devPodConfig.ProviderOptions(s.config.Name), s.config, map[string]string{\n\t\tprovider.CommandEnv: command,\n\t}, nil, io.MultiWriter(stdout, buf), buf, s.log.ErrorStreamOnly())\n\tif err != nil {\n\t\treturn client.StatusNotFound, fmt.Errorf(\"error retrieving container status: %s%w\", buf.String(), err)\n\t}\n\n\tparsed, err := client.ParseStatus(stdout.String())\n\tif err != nil {\n\t\treturn client.StatusNotFound, fmt.Errorf(\"error parsing container status: %s%w\", buf.String(), err)\n\t}\n\n\ts.log.Debugf(\"Container status command output (stdout & stderr): %s %s (%s)\", buf.String(), stdout.String(), parsed)\n\treturn parsed, nil\n}\n\nfunc (s *workspaceClient) isMachineProvider() bool {\n\treturn len(s.config.Exec.Create) > 0\n}\n\nfunc RunCommandWithBinaries(ctx context.Context, name string, command types.StrArray, context string, workspace *provider.Workspace, machine *provider.Machine, options map[string]config.OptionValue, config *provider.ProviderConfig, extraEnv map[string]string, stdin io.Reader, stdout io.Writer, stderr io.Writer, log log.Logger) (err error) {\n\tenviron, err := binaries.ToEnvironmentWithBinaries(context, workspace, machine, options, config, extraEnv, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn runCommand(ctx, name, command, environ, stdin, stdout, stderr, log)\n}\n\nfunc RunCommand(ctx context.Context, command types.StrArray, environ []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tif len(command) == 0 {\n\t\treturn nil\n\t}\n\n\t// use shell if command length is equal 1\n\tif len(command) == 1 {\n\t\treturn shell.RunEmulatedShell(ctx, command[0], stdin, stdout, stderr, environ)\n\t}\n\n\t// run command\n\tcmd := exec.CommandContext(ctx, command[0], command[1:]...)\n\tcmd.Stdin = stdin\n\tcmd.Stdout = stdout\n\tcmd.Stderr = stderr\n\tcmd.Env = environ\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc DeleteMachineFolder(context, machineID string) error {\n\tmachineDir, err := provider.GetMachineDir(context, machineID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// remove machine folder\n\terr = os.RemoveAll(machineDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc DeleteWorkspaceFolder(context string, workspaceID string, sshConfigPath string, log log.Logger) error {\n\tpath, err := ssh.ResolveSSHConfigPath(sshConfigPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsshConfigPath = path\n\n\terr = ssh.RemoveFromConfig(workspaceID, sshConfigPath, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Remove workspace '%s' from ssh config: %v\", workspaceID, err)\n\t}\n\n\tworkspaceFolder, err := provider.GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// remove workspace folder\n\terr = os.RemoveAll(workspaceFolder)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/command/command.go",
    "content": "package command\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n)\n\nfunc WrapCommandError(stdout []byte, err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\treturn &Error{\n\t\tstdout: stdout,\n\t\terr:    err,\n\t}\n}\n\ntype Error struct {\n\tstdout []byte\n\terr    error\n}\n\nfunc (e *Error) Error() string {\n\tmessage := \"\"\n\tif len(e.stdout) > 0 {\n\t\tmessage += string(e.stdout) + \"\\n\"\n\t}\n\n\tvar exitError *exec.ExitError\n\tif errors.As(e.err, &exitError) && len(exitError.Stderr) > 0 {\n\t\tmessage += string(exitError.Stderr) + \"\\n\"\n\t}\n\n\treturn message + e.err.Error()\n}\n\nfunc Exists(cmd string) bool {\n\t_, err := exec.LookPath(cmd)\n\treturn err == nil\n}\n\nfunc ExistsForUser(cmd, user string) bool {\n\tcommand := \"which \" + cmd\n\tvar err error\n\tif user == \"\" {\n\t\treturn Exists(cmd)\n\t}\n\n\t_, err = exec.Command(\"su\", user, \"-l\", \"-c\", command).CombinedOutput()\n\treturn err == nil\n}\n"
  },
  {
    "path": "pkg/command/escape.go",
    "content": "package command\n\nimport (\n\t\"github.com/alessio/shellescape\"\n)\n\nfunc Quote(args []string) string {\n\tif len(args) == 0 {\n\t\treturn \"\"\n\t} else if len(args) == 1 {\n\t\treturn args[0]\n\t}\n\n\treturn shellescape.QuoteCommand(args)\n}\n"
  },
  {
    "path": "pkg/command/process.go",
    "content": "package command\n\nfunc IsRunning(pid string) (bool, error) {\n\treturn isRunning(pid)\n}\n\nfunc Kill(pid string) error {\n\treturn kill(pid)\n}\n"
  },
  {
    "path": "pkg/command/process_supported.go",
    "content": "//go:build linux || darwin || unix\n\npackage command\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc isRunning(pid string) (bool, error) {\n\tparsedPid, err := strconv.Atoi(pid)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tprocess, err := os.FindProcess(parsedPid)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\terr = process.Signal(syscall.Signal(0))\n\tif err != nil {\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}\n\nfunc kill(pid string) error {\n\tparsedPid, err := strconv.Atoi(pid)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_ = syscall.Kill(parsedPid, syscall.SIGTERM)\n\ttime.Sleep(2000)\n\t_ = syscall.Kill(parsedPid, syscall.SIGKILL)\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/command/process_unsupported.go",
    "content": "//go:build windows\n\npackage command\n\nfunc isRunning(pid string) (bool, error) {\n\tpanic(\"unsupported\")\n}\n\nfunc kill(pid string) error {\n\tpanic(\"unsupported\")\n}\n"
  },
  {
    "path": "pkg/command/user.go",
    "content": "package command\n\nimport (\n\t\"os/user\"\n\n\t\"github.com/loft-sh/devpod/pkg/util\"\n)\n\nfunc GetHome(userName string) (string, error) {\n\tif userName == \"\" {\n\t\treturn util.UserHomeDir()\n\t}\n\n\tu, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn u.HomeDir, nil\n}\n"
  },
  {
    "path": "pkg/compose/helper.go",
    "content": "package compose\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/blang/semver\"\n\tcomposecli \"github.com/compose-spec/compose-go/v2/cli\"\n\tcomposetypes \"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/pkg/errors\"\n)\n\nconst (\n\tDockerCommand        = \"docker\"\n\tDockerComposeCommand = \"docker-compose\"\n\tProjectLabel         = \"com.docker.compose.project\"\n\tServiceLabel         = \"com.docker.compose.service\"\n)\n\nfunc LoadDockerComposeProject(ctx context.Context, paths []string, envFiles []string) (*composetypes.Project, error) {\n\tprojectOptions, err := composecli.NewProjectOptions(\n\t\tpaths,\n\t\tcomposecli.WithOsEnv,\n\t\tcomposecli.WithEnvFiles(envFiles...),\n\t\tcomposecli.WithDotEnv,\n\t\tcomposecli.WithDefaultProfiles(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproject, err := composecli.ProjectFromOptions(ctx, projectOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn project, nil\n}\n\ntype ComposeHelper struct {\n\tCommand string\n\tVersion string\n\tArgs    []string\n\tDocker  *docker.DockerHelper\n}\n\nfunc NewComposeHelper(dockerComposeCLI string, dockerHelper *docker.DockerHelper) (*ComposeHelper, error) {\n\tdockerCLI := dockerHelper.DockerCommand\n\tif dockerCLI == \"\" {\n\t\tdockerCLI = DockerCommand\n\t}\n\n\tif dockerComposeCLI == \"\" {\n\t\tdockerComposeCLI = DockerComposeCommand\n\t}\n\n\tif out, err := exec.Command(dockerComposeCLI, \"version\", \"--short\").Output(); err == nil {\n\t\treturn &ComposeHelper{\n\t\t\tCommand: dockerComposeCLI,\n\t\t\tVersion: strings.TrimSpace(string(out)),\n\t\t\tArgs:    []string{},\n\t\t\tDocker:  dockerHelper,\n\t\t}, nil\n\t}\n\n\tout, err := exec.Command(dockerCLI, \"compose\", \"version\", \"--short\").Output()\n\tif err == nil {\n\t\treturn &ComposeHelper{\n\t\t\tCommand: dockerCLI,\n\t\t\tVersion: strings.TrimSpace(string(out)),\n\t\t\tArgs:    []string{\"compose\"},\n\t\t\tDocker:  dockerHelper,\n\t\t}, nil\n\t}\n\n\treturn nil, err\n}\n\nfunc (h *ComposeHelper) FindDevContainer(ctx context.Context, projectName, serviceName string) (*config.ContainerDetails, error) {\n\tcontainerIDs, err := h.Docker.FindContainer(ctx, []string{\n\t\tfmt.Sprintf(\"%s=%s\", ProjectLabel, projectName),\n\t\tfmt.Sprintf(\"%s=%s\", ServiceLabel, serviceName),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(containerIDs) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tcontainerDetails, err := h.Docker.InspectContainers(ctx, containerIDs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, details := range containerDetails {\n\t\tif details.State.Status != \"removing\" {\n\t\t\treturn &details, nil\n\t\t}\n\t}\n\n\treturn nil, nil\n}\n\nfunc (h *ComposeHelper) Run(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tcmd := h.buildCmd(ctx, args...)\n\tcmd.Stdin = stdin\n\tcmd.Stdout = stdout\n\tcmd.Stderr = stderr\n\treturn cmd.Run()\n}\n\nfunc (h *ComposeHelper) Stop(ctx context.Context, projectName string, args []string) error {\n\tbuildArgs := []string{\"--project-name\", projectName}\n\tbuildArgs = append(buildArgs, args...)\n\tbuildArgs = append(buildArgs, \"stop\")\n\n\tout, err := h.buildCmd(ctx, buildArgs...).CombinedOutput()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"%s\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc (h *ComposeHelper) Remove(ctx context.Context, projectName string, args []string) error {\n\tbuildArgs := []string{\"--project-name\", projectName}\n\tbuildArgs = append(buildArgs, args...)\n\tbuildArgs = append(buildArgs, \"down\")\n\n\tout, err := h.buildCmd(ctx, buildArgs...).CombinedOutput()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"%s\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc (h *ComposeHelper) GetDefaultImage(projectName, serviceName string) (string, error) {\n\tversion, err := semver.Parse(strings.TrimPrefix(h.Version, \"v\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tearlierVersion, err := semver.New(\"2.8.0\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif version.Compare(*earlierVersion) == -1 {\n\t\treturn fmt.Sprintf(\"%s_%s\", projectName, serviceName), nil\n\t}\n\n\treturn fmt.Sprintf(\"%s-%s\", projectName, serviceName), nil\n}\n\nfunc (h *ComposeHelper) FindProjectFiles(ctx context.Context, projectName string) ([]string, error) {\n\tbuildArgs := []string{\"--project-name\", projectName}\n\tbuildArgs = append(buildArgs, \"ls\", \"-a\", \"--filter\", \"name=\"+projectName, \"--format\", \"json\")\n\n\trawOut, err := h.buildCmd(ctx, buildArgs...).CombinedOutput()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"%s\", string(rawOut))\n\t}\n\n\ttype composeOutput struct {\n\t\tName        string\n\t\tStatus      string\n\t\tConfigFiles string\n\t}\n\tvar composeOutputs []composeOutput\n\tif err := json.Unmarshal(rawOut, &composeOutputs); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"parse compose output\")\n\t}\n\n\t// no compose project found\n\tif len(composeOutputs) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Parse project files of first match\n\tprojectFiles := strings.Split(composeOutputs[0].ConfigFiles, \",\")\n\treturn projectFiles, nil\n}\n\nfunc (h *ComposeHelper) GetProjectName(runnerID string) string {\n\t// Check for project name override - https://docs.docker.com/compose/how-tos/project-name/\n\tif projectNameOverride := os.Getenv(\"COMPOSE_PROJECT_NAME\"); projectNameOverride != \"\" {\n\t\treturn projectNameOverride\n\t}\n\treturn h.toProjectName(runnerID)\n}\n\nfunc (h *ComposeHelper) toProjectName(projectName string) string {\n\tuseNewProjectNameFormat, _ := h.useNewProjectName()\n\tif !useNewProjectNameFormat {\n\t\treturn regexp.MustCompile(\"[^a-z0-9]\").ReplaceAllString(strings.ToLower(projectName), \"\")\n\t}\n\n\treturn regexp.MustCompile(\"[^-_a-z0-9]\").ReplaceAllString(strings.ToLower(projectName), \"\")\n}\n\nfunc (h *ComposeHelper) buildCmd(ctx context.Context, args ...string) *exec.Cmd {\n\tvar allArgs []string\n\tallArgs = append(allArgs, h.Args...)\n\tallArgs = append(allArgs, args...)\n\treturn exec.CommandContext(ctx, h.Command, allArgs...)\n}\n\nfunc (h *ComposeHelper) useNewProjectName() (bool, error) {\n\tversion, err := semver.Parse(h.Version)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tearlierVersion, err := semver.New(\"1.12.0\")\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif version.Compare(*earlierVersion) == -1 {\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}\n"
  },
  {
    "path": "pkg/compress/compress.go",
    "content": "package compress\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"encoding/base64\"\n\t\"io\"\n)\n\n// Compress gzips a string and base64 encodes it\nfunc Compress(s string) (string, error) {\n\tif s == \"\" {\n\t\treturn \"\", nil\n\t}\n\n\tvar b bytes.Buffer\n\tgz := gzip.NewWriter(&b)\n\n\t_, err := gz.Write([]byte(s))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = gz.Flush()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = gz.Close()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(b.Bytes()), nil\n}\n\n// Decompress decompresses a string\nfunc Decompress(s string) (string, error) {\n\tif s == \"\" {\n\t\treturn \"\", nil\n\t}\n\n\tdecoded, err := base64.StdEncoding.DecodeString(s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trdata := bytes.NewReader(decoded)\n\tr, err := gzip.NewReader(rdata)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdecompressed, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(decompressed), nil\n}\n"
  },
  {
    "path": "pkg/config/config.go",
    "content": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ghodss/yaml\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/pkg/errors\"\n)\n\ntype Config struct {\n\t// DefaultContext is the default context to use. Defaults to \"default\"\n\tDefaultContext string `json:\"defaultContext,omitempty\"`\n\n\t// Contexts holds the config contexts\n\tContexts map[string]*ContextConfig `json:\"contexts,omitempty\"`\n\n\t// Origin holds the path where this config was loaded from\n\tOrigin string `json:\"-\"`\n\n\t// OriginalContext is the original default context\n\tOriginalContext string `json:\"-\"`\n}\n\ntype ContextConfig struct {\n\t// DefaultProvider is the default provider to use\n\tDefaultProvider string `json:\"defaultProvider,omitempty\"`\n\n\t// DefaultIDE holds default ide configuration\n\tDefaultIDE string `json:\"defaultIde,omitempty\"`\n\n\t// Options are additional context options\n\tOptions map[string]OptionValue `json:\"options,omitempty\"`\n\n\t// IDEs holds the ide configuration\n\tIDEs map[string]*IDEConfig `json:\"ides,omitempty\"`\n\n\t// Providers holds the provider configuration\n\tProviders map[string]*ProviderConfig `json:\"providers,omitempty\"`\n\n\t// OriginalProvider is the original default provider\n\tOriginalProvider string `json:\"-\"`\n}\n\ntype ContextOption struct {\n\t// Name of the context option\n\tName string `json:\"name,omitempty\"`\n\n\t// Description is the description of the context option\n\tDescription string `json:\"description,omitempty\"`\n\n\t// Default is the default value of the context option\n\tDefault string `json:\"default,omitempty\"`\n\n\t// Enum of the allowed values\n\tEnum []string `json:\"enum,omitempty\"`\n}\n\ntype IDEConfig struct {\n\t// Options are additional ide options\n\tOptions map[string]OptionValue `json:\"options,omitempty\"`\n}\n\ntype ProviderConfig struct {\n\t// Initialized holds if the provider was initialized correctly.\n\tInitialized bool `json:\"initialized,omitempty\"`\n\n\t// SingleMachine signals DevPod if a single machine should be used for this provider.\n\tSingleMachine bool `json:\"singleMachine,omitempty\"`\n\n\t// Options are the configured provider options\n\tOptions map[string]OptionValue `json:\"options,omitempty\"`\n\n\t// DynamicOptions are the unresolved dynamic provider options\n\tDynamicOptions OptionDefinitions `json:\"dynamicOptions,omitempty\"`\n\n\t// CreationTimestamp is the timestamp when this provider was added\n\tCreationTimestamp types.Time `json:\"creationTimestamp,omitempty\"`\n}\n\ntype OptionDefinitions = map[string]*types.Option\n\ntype OptionValue struct {\n\t// Value is the value of the option\n\tValue string `json:\"value,omitempty\"`\n\n\t// UserProvided signals that this value was user provided\n\tUserProvided bool `json:\"userProvided,omitempty\"`\n\n\t// Filled is the time when this value was filled\n\tFilled *types.Time `json:\"filled,omitempty\"`\n\n\t// Children are the child options\n\tChildren []string `json:\"children,omitempty\"`\n}\n\nfunc (c *Config) Current() *ContextConfig {\n\treturn c.Contexts[c.DefaultContext]\n}\n\nfunc (c *Config) ProviderOptions(provider string) map[string]OptionValue {\n\treturn c.Current().ProviderOptions(provider)\n}\n\nfunc (c *Config) DynamicProviderOptionDefinitions(provider string) OptionDefinitions {\n\treturn c.Current().DynamicProviderOptionDefinitions(provider)\n}\n\nfunc (c *Config) IDEOptions(ide string) map[string]OptionValue {\n\treturn c.Current().IDEOptions(ide)\n}\n\nfunc (c *Config) ContextOption(option string) string {\n\tif c.Contexts != nil {\n\t\tif _, ok := c.Contexts[c.DefaultContext]; ok && c.Current().Options != nil {\n\t\t\tif _, ok := c.Current().Options[option]; ok && c.Current().Options[option].Value != \"\" {\n\t\t\t\treturn c.Current().Options[option].Value\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, contextOption := range ContextOptions {\n\t\tif contextOption.Name == option {\n\t\t\tif contextOption.Default != \"\" {\n\t\t\t\treturn contextOption.Default\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\nfunc (c *ContextConfig) IsSingleMachine(provider string) bool {\n\tif c.Providers == nil || c.Providers[provider] == nil {\n\t\treturn false\n\t}\n\treturn c.Providers[provider].SingleMachine\n}\n\nfunc (c *ContextConfig) IDEOptions(ide string) map[string]OptionValue {\n\tretOptions := map[string]OptionValue{}\n\tif c.IDEs == nil || c.IDEs[ide] == nil {\n\t\treturn retOptions\n\t}\n\n\tfor k, v := range c.IDEs[ide].Options {\n\t\tretOptions[k] = v\n\t}\n\treturn retOptions\n}\n\nfunc (c *ContextConfig) ProviderOptions(provider string) map[string]OptionValue {\n\tretOptions := map[string]OptionValue{}\n\tif c.Providers == nil || c.Providers[provider] == nil {\n\t\treturn retOptions\n\t}\n\n\tfor k, v := range c.Providers[provider].Options {\n\t\tretOptions[k] = v\n\t}\n\treturn retOptions\n}\n\nfunc (c *ContextConfig) DynamicProviderOptionDefinitions(provider string) OptionDefinitions {\n\tretOptions := OptionDefinitions{}\n\tif c.Providers == nil || c.Providers[provider] == nil {\n\t\treturn retOptions\n\t}\n\n\tfor k, v := range c.Providers[provider].DynamicOptions {\n\t\tretOptions[k] = v\n\t}\n\treturn retOptions\n}\n\nvar ConfigFile = \"config.yaml\"\n\nconst DefaultContext = \"default\"\n\nfunc CloneConfig(config *Config) *Config {\n\tout, _ := json.Marshal(config)\n\tret := &Config{}\n\terr := json.Unmarshal(out, ret)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"failed to unmarshal config: %w\", err))\n\t}\n\tfor ctxName, ctx := range ret.Contexts {\n\t\tif ctx.Providers == nil {\n\t\t\tctx.Providers = map[string]*ProviderConfig{}\n\t\t}\n\t\tif ctx.IDEs == nil {\n\t\t\tctx.IDEs = map[string]*IDEConfig{}\n\t\t}\n\t\tctx.OriginalProvider = config.Contexts[ctxName].OriginalProvider\n\t}\n\tret.Origin = config.Origin\n\tret.OriginalContext = config.OriginalContext\n\treturn ret\n}\n\nfunc LoadConfig(contextOverride string, providerOverride string) (*Config, error) {\n\tconfigOrigin, err := GetConfigPath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigBytes, err := os.ReadFile(configOrigin)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, errors.Wrap(err, \"read config\")\n\t\t}\n\n\t\tcontext := contextOverride\n\t\tif context == \"\" {\n\t\t\tcontext = DefaultContext\n\t\t}\n\n\t\treturn &Config{\n\t\t\tDefaultContext: context,\n\t\t\tContexts: map[string]*ContextConfig{\n\t\t\t\tcontext: {\n\t\t\t\t\tDefaultProvider: providerOverride,\n\t\t\t\t\tProviders:       map[string]*ProviderConfig{},\n\t\t\t\t\tIDEs:            map[string]*IDEConfig{},\n\t\t\t\t\tOptions:         map[string]OptionValue{},\n\t\t\t\t},\n\t\t\t},\n\t\t\tOrigin: configOrigin,\n\t\t}, nil\n\t}\n\n\tconfig := &Config{}\n\terr = yaml.Unmarshal(configBytes, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif contextOverride != \"\" {\n\t\tconfig.OriginalContext = config.DefaultContext\n\t\tconfig.DefaultContext = contextOverride\n\t} else if config.DefaultContext == \"\" {\n\t\tconfig.DefaultContext = DefaultContext\n\t}\n\tif config.Contexts == nil {\n\t\tconfig.Contexts = map[string]*ContextConfig{}\n\t}\n\tif config.Contexts[config.DefaultContext] == nil {\n\t\tconfig.Contexts[config.DefaultContext] = &ContextConfig{}\n\t}\n\tif config.Contexts[config.DefaultContext].Options == nil {\n\t\tconfig.Contexts[config.DefaultContext].Options = map[string]OptionValue{}\n\t}\n\tif config.Contexts[config.DefaultContext].Providers == nil {\n\t\tconfig.Contexts[config.DefaultContext].Providers = map[string]*ProviderConfig{}\n\t}\n\tif config.Contexts[config.DefaultContext].IDEs == nil {\n\t\tconfig.Contexts[config.DefaultContext].IDEs = map[string]*IDEConfig{}\n\t}\n\tif providerOverride != \"\" {\n\t\tconfig.Contexts[config.DefaultContext].OriginalProvider = config.Contexts[config.DefaultContext].DefaultProvider\n\t\tconfig.Contexts[config.DefaultContext].DefaultProvider = providerOverride\n\t}\n\n\tconfig.Origin = configOrigin\n\n\treturn config, nil\n}\n\nfunc SaveConfig(config *Config) error {\n\tconfigOrigin, err := GetConfigPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfig = CloneConfig(config)\n\tif config.OriginalContext != \"\" {\n\t\tconfig.DefaultContext = config.OriginalContext\n\t}\n\tif config.Contexts[config.DefaultContext].OriginalProvider != \"\" {\n\t\tconfig.Contexts[config.DefaultContext].DefaultProvider = config.Contexts[config.DefaultContext].OriginalProvider\n\t}\n\n\tout, err := yaml.Marshal(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(filepath.Dir(configOrigin), 0700)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.WriteFile(configOrigin, out, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc ParseTimeOption(cfg *Config, opt string) time.Duration {\n\ttimeout, err := strconv.ParseInt(cfg.ContextOption(opt), 10, 64)\n\tif err != nil {\n\t\ttimeout = 20\n\t}\n\treturn time.Duration(timeout) * time.Second\n}\n"
  },
  {
    "path": "pkg/config/context.go",
    "content": "package config\n\nimport (\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\nconst (\n\tContextOptionSSHAddPrivateKeys          = \"SSH_ADD_PRIVATE_KEYS\"\n\tContextOptionGPGAgentForwarding         = \"GPG_AGENT_FORWARDING\"\n\tContextOptionGitSSHSignatureForwarding  = \"GIT_SSH_SIGNATURE_FORWARDING\"\n\tContextOptionSSHInjectDockerCredentials = \"SSH_INJECT_DOCKER_CREDENTIALS\"\n\tContextOptionSSHInjectGitCredentials    = \"SSH_INJECT_GIT_CREDENTIALS\"\n\tContextOptionExitAfterTimeout           = \"EXIT_AFTER_TIMEOUT\"\n\tContextOptionTelemetry                  = \"TELEMETRY\"\n\tContextOptionAgentURL                   = \"AGENT_URL\"\n\tContextOptionDotfilesURL                = \"DOTFILES_URL\"\n\tContextOptionDotfilesScript             = \"DOTFILES_SCRIPT\"\n\tContextOptionSSHAgentForwarding         = \"SSH_AGENT_FORWARDING\"\n\tContextOptionSSHConfigPath              = \"SSH_CONFIG_PATH\"\n\tContextOptionAgentInjectTimeout         = \"AGENT_INJECT_TIMEOUT\"\n\tContextOptionRegistryCache              = \"REGISTRY_CACHE\"\n\tContextOptionSSHStrictHostKeyChecking   = \"SSH_STRICT_HOST_KEY_CHECKING\"\n)\n\nvar ContextOptions = []ContextOption{\n\t{\n\t\tName:        ContextOptionSSHAddPrivateKeys,\n\t\tDescription: \"Specifies if DevPod should automatically add ssh-keys to the ssh-agent\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionExitAfterTimeout,\n\t\tDescription: \"Specifies if DevPod should exit the process after the browser has been idle for a minute\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionGPGAgentForwarding,\n\t\tDescription: \"Specifies if DevPod should do gpg-agent forwarding by default for ssh\",\n\t\tDefault:     \"false\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionGitSSHSignatureForwarding,\n\t\tDescription: \"Specifies if DevPod should automatically detect ssh signature git setting and inject ssh signature helper\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionSSHInjectDockerCredentials,\n\t\tDescription: \"Specifies if DevPod should inject docker credentials into the workspace\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionSSHInjectGitCredentials,\n\t\tDescription: \"Specifies if DevPod should inject git credentials into the workspace\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionSSHAgentForwarding,\n\t\tDescription: \"Specifies if DevPod should do agent forwarding by default into the workspace\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionTelemetry,\n\t\tDescription: \"Specifies if DevPod should send telemetry information\",\n\t\tDefault:     \"true\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n\t{\n\t\tName:        ContextOptionAgentURL,\n\t\tDescription: \"Specifies the agent url to use for DevPod\",\n\t},\n\t{\n\t\tName:        ContextOptionDotfilesURL,\n\t\tDescription: \"Specifies the dotfiles repo url to use for DevPod\",\n\t},\n\t{\n\t\tName:        ContextOptionDotfilesScript,\n\t\tDescription: \"Specifies the script to run after cloning dotfiles repo to install them\",\n\t},\n\t{\n\t\tName:        ContextOptionSSHConfigPath,\n\t\tDescription: \"Specifies the path where the ssh config should be written to\",\n\t},\n\t{\n\t\tName:        ContextOptionAgentInjectTimeout,\n\t\tDescription: \"Specifies the timeout to inject the agent\",\n\t\tDefault:     \"20\",\n\t},\n\t{\n\t\tName:        ContextOptionRegistryCache,\n\t\tDescription: \"Specifies the registry to use as a build cache, e.g. gcr.io/my-project/my-dev-env\",\n\t\tDefault:     \"\",\n\t},\n\t{\n\t\tName:        ContextOptionSSHStrictHostKeyChecking,\n\t\tDescription: \"Enables strict ssh host key checking for all operations\",\n\t\tDefault:     \"false\",\n\t\tEnum:        []string{\"true\", \"false\"},\n\t},\n}\n\nfunc MergeContextOptions(contextConfig *ContextConfig, environ []string) {\n\tenvVars := map[string]string{}\n\tfor _, v := range environ {\n\t\tt := strings.SplitN(v, \"=\", 2)\n\t\tif len(t) != 2 {\n\t\t\tcontinue\n\t\t}\n\t\tenvVars[t[0]] = t[1]\n\t}\n\n\tfor _, o := range ContextOptions {\n\t\t// look up in env\n\t\tenvVal, ok := envVars[o.Name]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\t// look up in current context options, skip if already exists\n\t\tif _, ok := contextConfig.Options[o.Name]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tcontextConfig.Options[o.Name] = OptionValue{\n\t\t\tValue:        envVal,\n\t\t\tUserProvided: true,\n\t\t\tFilled:       &[]types.Time{types.Now()}[0],\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/config/context_test.go",
    "content": "package config\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tgocmp \"github.com/google/go-cmp/cmp\"\n\t\"gotest.tools/assert\"\n\t\"gotest.tools/assert/cmp\"\n)\n\ntype testCaseMergeContextOption struct {\n\tdescription string\n\tin          *ContextConfig\n\tenviron     []string\n\texpected    *ContextConfig\n}\n\nfunc TestCaseMergeContextOption(t *testing.T) {\n\ttestCases := []testCaseMergeContextOption{\n\t\t{\n\t\t\tdescription: \"empty config, nothing in env\",\n\t\t\tin:          &ContextConfig{},\n\t\t\tenviron:     []string{},\n\t\t\texpected:    &ContextConfig{},\n\t\t},\n\t\t{\n\t\t\tdescription: \"docker injection is false, nothing coming in from env\",\n\t\t\tin: &ContextConfig{\n\t\t\t\tOptions: map[string]OptionValue{\n\t\t\t\t\tContextOptionSSHInjectDockerCredentials: {\n\t\t\t\t\t\tValue: \"false\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tenviron: []string{},\n\t\t\texpected: &ContextConfig{\n\t\t\t\tOptions: map[string]OptionValue{\n\t\t\t\t\tContextOptionSSHInjectDockerCredentials: {\n\t\t\t\t\t\tValue: \"false\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"docker injection set by env\",\n\t\t\tin: &ContextConfig{\n\t\t\t\tOptions: map[string]OptionValue{},\n\t\t\t},\n\t\t\tenviron: []string{fmt.Sprintf(\"%s=%s\", ContextOptionSSHInjectDockerCredentials, \"true\")},\n\t\t\texpected: &ContextConfig{\n\t\t\t\tOptions: map[string]OptionValue{\n\t\t\t\t\tContextOptionSSHInjectDockerCredentials: {\n\t\t\t\t\t\tValue:        \"true\",\n\t\t\t\t\t\tUserProvided: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tMergeContextOptions(tc.in, tc.environ)\n\t\tok := assert.Check(t, cmp.DeepEqual(tc.expected, tc.in, gocmp.FilterPath(func(p gocmp.Path) bool {\n\t\t\treturn p.String() != \"Filled\"\n\t\t}, gocmp.Ignore())))\n\t\tif !ok {\n\t\t\tfmt.Println(tc.description)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/config/dir.go",
    "content": "package config\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/util\"\n)\n\n// Override devpod home\nconst DEVPOD_HOME = \"DEVPOD_HOME\"\n\n// Override config path\nconst DEVPOD_CONFIG = \"DEVPOD_CONFIG\"\n\nfunc GetConfigDir() (string, error) {\n\thomeDir := os.Getenv(DEVPOD_HOME)\n\tif homeDir != \"\" {\n\t\treturn homeDir, nil\n\t}\n\n\thomeDir, err := util.UserHomeDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tconfigDir := filepath.Join(homeDir, \".devpod\")\n\treturn configDir, nil\n}\n\nfunc GetConfigPath() (string, error) {\n\tconfigOrigin := os.Getenv(DEVPOD_CONFIG)\n\tif configOrigin == \"\" {\n\t\tconfigDir, err := GetConfigDir()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treturn filepath.Join(configDir, ConfigFile), nil\n\t}\n\n\treturn configOrigin, nil\n}\n"
  },
  {
    "path": "pkg/config/ide.go",
    "content": "package config\n\ntype IDE string\n\nconst (\n\tIDENone            IDE = \"none\"\n\tIDEVSCode          IDE = \"vscode\"\n\tIDEVSCodeInsiders  IDE = \"vscode-insiders\"\n\tIDEOpenVSCode      IDE = \"openvscode\"\n\tIDEIntellij        IDE = \"intellij\"\n\tIDEGoland          IDE = \"goland\"\n\tIDERustRover       IDE = \"rustrover\"\n\tIDEPyCharm         IDE = \"pycharm\"\n\tIDEPhpStorm        IDE = \"phpstorm\"\n\tIDECLion           IDE = \"clion\"\n\tIDERubyMine        IDE = \"rubymine\"\n\tIDERider           IDE = \"rider\"\n\tIDEWebStorm        IDE = \"webstorm\"\n\tIDEDataSpell       IDE = \"dataspell\"\n\tIDEFleet           IDE = \"fleet\"\n\tIDEJupyterNotebook IDE = \"jupyternotebook\"\n\tIDECursor          IDE = \"cursor\"\n\tIDEPositron        IDE = \"positron\"\n\tIDECodium          IDE = \"codium\"\n\tIDEZed             IDE = \"zed\"\n\tIDERStudio         IDE = \"rstudio\"\n\tIDEWindsurf        IDE = \"windsurf\"\n)\n\ntype IDEGroup string\n\nconst (\n\tIDEGroupPrimary   IDEGroup = \"Primary\"\n\tIDEGroupJetBrains IDEGroup = \"JetBrains\"\n\tIDEGroupOther     IDEGroup = \"Other\"\n)\n"
  },
  {
    "path": "pkg/copy/copy.go",
    "content": "package copy\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/pkg/errors\"\n)\n\nfunc Chown(path string, userName string) error {\n\tif userName == \"\" {\n\t\treturn nil\n\t}\n\n\tuserID, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"lookup user\")\n\t}\n\n\tuid, _ := strconv.Atoi(userID.Uid)\n\tgid, _ := strconv.Atoi(userID.Gid)\n\treturn os.Lchown(path, uid, gid)\n}\n\nfunc ChownR(path string, userName string) error {\n\tif userName == \"\" {\n\t\treturn nil\n\t}\n\n\tuserID, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"lookup user\")\n\t}\n\n\tuid, _ := strconv.Atoi(userID.Uid)\n\tgid, _ := strconv.Atoi(userID.Gid)\n\treturn filepath.WalkDir(path, func(name string, dirEntry fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tinfo, err := dirEntry.Info()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tif IsUID(info, uint32(uid)) {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err == nil {\n\t\t\t_ = os.Lchown(name, uid, gid)\n\t\t}\n\t\treturn err\n\t})\n}\n\nfunc RenameDirectory(srcDir, dest string) error {\n\terr := Directory(srcDir, dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn os.RemoveAll(srcDir)\n}\n\nfunc Directory(scrDir, dest string) error {\n\tif err := CreateIfNotExists(dest, 0755); err != nil {\n\t\treturn err\n\t}\n\n\tentries, err := os.ReadDir(scrDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, entry := range entries {\n\t\tsourcePath := filepath.Join(scrDir, entry.Name())\n\t\tdestPath := filepath.Join(dest, entry.Name())\n\n\t\tfileInfo, err := os.Stat(sourcePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch fileInfo.Mode() & os.ModeType {\n\t\tcase os.ModeDir:\n\t\t\tif err := CreateIfNotExists(destPath, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := Directory(sourcePath, destPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase os.ModeSymlink:\n\t\t\tif err := Symlink(sourcePath, destPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tdefault:\n\t\t\tif err := File(sourcePath, destPath, 0644); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terr = Lchown(fileInfo, sourcePath, destPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfInfo, err := entry.Info()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tisSymlink := fInfo.Mode()&os.ModeSymlink != 0\n\t\tif !isSymlink {\n\t\t\tif err := os.Chmod(destPath, fInfo.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc File(srcFile, dstFile string, perm os.FileMode) error {\n\tout, err := os.OpenFile(dstFile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, perm)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer out.Close()\n\n\tin, err := os.Open(srcFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer in.Close()\n\n\t_, err = io.Copy(out, in)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc Exists(filePath string) bool {\n\tif _, err := os.Stat(filePath); os.IsNotExist(err) {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc CreateIfNotExists(dir string, perm os.FileMode) error {\n\tif Exists(dir) {\n\t\treturn nil\n\t}\n\n\tif err := os.MkdirAll(dir, perm); err != nil {\n\t\treturn fmt.Errorf(\"failed to create directory: '%s', error: '%s'\", dir, err.Error())\n\t}\n\n\treturn nil\n}\n\nfunc Symlink(source, dest string) error {\n\tlink, err := os.Readlink(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.Symlink(link, dest)\n}\n"
  },
  {
    "path": "pkg/copy/copy_supported.go",
    "content": "//go:build linux || darwin || unix\n\npackage copy\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n)\n\nfunc IsUID(info os.FileInfo, uid uint32) bool {\n\tstat, ok := info.Sys().(*syscall.Stat_t)\n\treturn ok && stat.Uid == uid\n}\n\nfunc Lchown(info os.FileInfo, sourcePath, destPath string) error {\n\tstat, ok := info.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn fmt.Errorf(\"failed to get raw syscall.Stat_t data for '%s'\", sourcePath)\n\t}\n\tif err := os.Lchown(destPath, int(stat.Uid), int(stat.Gid)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/copy/copy_unsupported.go",
    "content": "//go:build windows\n\npackage copy\n\nimport (\n\t\"os\"\n)\n\nfunc IsUID(info os.FileInfo, uid uint32) bool {\n\treturn true\n}\n\nfunc Lchown(info os.FileInfo, sourcePath, destPath string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/credentials/request.go",
    "content": "package credentials\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"syscall\"\n\t\"time\"\n\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\t\"k8s.io/client-go/util/retry\"\n)\n\nvar defaultBackoff = wait.Backoff{\n\tSteps:    4,\n\tDuration: 400 * time.Millisecond,\n\tFactor:   1,\n\tJitter:   0.1,\n}\n\nfunc PostWithRetry(port int, endpoint string, body io.Reader, log log.Logger) ([]byte, error) {\n\tvar out []byte\n\terr := retry.OnError(defaultBackoff, func(err error) bool {\n\t\t// connection refused is recoverable\n\t\treturn errors.Is(err, syscall.ECONNREFUSED)\n\t}, func() error {\n\t\turl := fmt.Sprintf(\"http://localhost:%s/%s\", strconv.Itoa(port), endpoint)\n\t\tresponse, err := devpodhttp.GetHTTPClient().Post(url, \"application/json\", body)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error calling %s: %v\", endpoint, err)\n\t\t\treturn err\n\t\t}\n\t\tdefer response.Body.Close()\n\n\t\traw, err := io.ReadAll(response.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// has the request succeeded?\n\t\tif response.StatusCode != http.StatusOK {\n\t\t\treturn fmt.Errorf(\"call %s (%d): %s\", endpoint, response.StatusCode, string(raw))\n\t\t}\n\n\t\tout = raw\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn out, nil\n}\n"
  },
  {
    "path": "pkg/credentials/server.go",
    "content": "package credentials\n\nimport (\n\t\"cmp\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nconst DefaultPort = \"12049\"\nconst CredentialsServerPortEnv = \"DEVPOD_CREDENTIALS_SERVER_PORT\"\n\nfunc RunCredentialsServer(\n\tctx context.Context,\n\tport int,\n\tclient tunnel.TunnelClient,\n\tlog log.Logger,\n) error {\n\tvar handler http.Handler = http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {\n\t\tlog.Debugf(\"Incoming client connection at %s\", request.URL.Path)\n\t\tif request.URL.Path == \"/git-credentials\" {\n\t\t\terr := handleGitCredentialsRequest(ctx, writer, request, client, log)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if request.URL.Path == \"/docker-credentials\" {\n\t\t\terr := handleDockerCredentialsRequest(ctx, writer, request, client, log)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if request.URL.Path == \"/git-ssh-signature\" {\n\t\t\terr := handleGitSSHSignatureRequest(ctx, writer, request, client, log)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if request.URL.Path == \"/loft-platform-credentials\" {\n\t\t\terr := handleLoftPlatformCredentialsRequest(ctx, writer, request, client, log)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\t\t}\n\t\t} else if request.URL.Path == \"/gpg-public-keys\" {\n\t\t\terr := handleGPGPublicKeysRequest(ctx, writer, request, client, log)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\t\t}\n\t\t}\n\t})\n\n\taddr := net.JoinHostPort(\"localhost\", strconv.Itoa(port))\n\tsrv := &http.Server{Addr: addr, Handler: handler}\n\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tlog.Debugf(\"Credentials server started on port %d...\", port)\n\n\t\t// always returns error. ErrServerClosed on graceful close\n\t\tif err := srv.ListenAndServe(); err != http.ErrServerClosed {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\terrChan <- nil\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\treturn err\n\tcase <-ctx.Done():\n\t\t_ = srv.Close()\n\t\treturn nil\n\t}\n}\n\nfunc GetPort() (int, error) {\n\tstrPort := cmp.Or(os.Getenv(CredentialsServerPortEnv), DefaultPort)\n\tport, err := strconv.Atoi(strPort)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"convert port %s: %w\", strPort, err)\n\t}\n\n\treturn port, nil\n}\n\nfunc handleDockerCredentialsRequest(ctx context.Context, writer http.ResponseWriter, request *http.Request, client tunnel.TunnelClient, log log.Logger) error {\n\tout, err := io.ReadAll(request.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read request body\")\n\t}\n\n\tlog.Debugf(\"Received docker credentials post data: %s\", string(out))\n\tresponse, err := client.DockerCredentials(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get docker credentials response\")\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\twriter.WriteHeader(http.StatusOK)\n\t_, _ = writer.Write([]byte(response.Message))\n\tlog.Debugf(\"Successfully wrote back %d bytes\", len(response.Message))\n\treturn nil\n}\n\nfunc handleGitCredentialsRequest(ctx context.Context, writer http.ResponseWriter, request *http.Request, client tunnel.TunnelClient, log log.Logger) error {\n\tout, err := io.ReadAll(request.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read request body\")\n\t}\n\n\tlog.Debugf(\"Received git credentials post data: %s\", string(out))\n\tresponse, err := client.GitCredentials(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\tlog.Debugf(\"Error receiving git credentials: %v\", err)\n\t\treturn errors.Wrap(err, \"get git credentials response\")\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\twriter.WriteHeader(http.StatusOK)\n\t_, _ = writer.Write([]byte(response.Message))\n\tlog.Debugf(\"Successfully wrote back %d bytes\", len(response.Message))\n\treturn nil\n}\n\nfunc handleGitSSHSignatureRequest(ctx context.Context, writer http.ResponseWriter, request *http.Request, client tunnel.TunnelClient, log log.Logger) error {\n\tout, err := io.ReadAll(request.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read request body\")\n\t}\n\n\tlog.Debugf(\"Received git ssh signature post data: %s\", string(out))\n\tresponse, err := client.GitSSHSignature(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\tlog.Errorf(\"Error receiving git ssh signature: %w\", err)\n\t\treturn errors.Wrap(err, \"get git ssh signature\")\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\twriter.WriteHeader(http.StatusOK)\n\t_, _ = writer.Write([]byte(response.Message))\n\tlog.Debugf(\"Successfully wrote back %d bytes\", len(response.Message))\n\treturn nil\n}\n\nfunc handleLoftPlatformCredentialsRequest(ctx context.Context, writer http.ResponseWriter, request *http.Request, client tunnel.TunnelClient, log log.Logger) error {\n\tout, err := io.ReadAll(request.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read request body\")\n\t}\n\n\tlog.Debugf(\"Received loft platform credentials post data: %s\", string(out))\n\tresponse, err := client.LoftConfig(ctx, &tunnel.Message{Message: string(out)})\n\tif err != nil {\n\t\tlog.Errorf(\"Error receiving platform credentials: %w\", err)\n\t\treturn errors.Wrap(err, \"get platform credentials\")\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\twriter.WriteHeader(http.StatusOK)\n\t_, _ = writer.Write([]byte(response.Message))\n\tlog.Debugf(\"Successfully wrote back %d bytes\", len(response.Message))\n\treturn nil\n}\n\nfunc handleGPGPublicKeysRequest(ctx context.Context, writer http.ResponseWriter, request *http.Request, client tunnel.TunnelClient, log log.Logger) error {\n\tresponse, err := client.GPGPublicKeys(ctx, &tunnel.Message{})\n\tif err != nil {\n\t\tlog.Errorf(\"Error receiving gpg public keys: %w\", err)\n\t\treturn errors.Wrap(err, \"get gpg public keys\")\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\twriter.WriteHeader(http.StatusOK)\n\t_, _ = writer.Write([]byte(response.Message))\n\tlog.Debugf(\"Successfully wrote back %d bytes\", len(response.Message))\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/credentials/start.go",
    "content": "package credentials\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\tportpkg \"github.com/loft-sh/devpod/pkg/port\"\n\t\"github.com/loft-sh/devpod/pkg/random\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc StartCredentialsServer(ctx context.Context, cancel context.CancelFunc, client tunnel.TunnelClient, log log.Logger) (int, error) {\n\tport, err := portpkg.FindAvailablePort(random.InRange(13000, 17000))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tgo func() {\n\t\tdefer cancel()\n\n\t\terr := RunCredentialsServer(ctx, port, client, log)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error running git credentials server: %v\", err)\n\t\t}\n\t}()\n\n\t// wait until credentials server is up\n\tmaxWait := time.Second * 4\n\tnow := time.Now()\nOuter:\n\tfor {\n\t\terr := PingURL(ctx, \"http://localhost:\"+strconv.Itoa(port))\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tbreak Outer\n\t\t\tcase <-time.After(time.Second):\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Debugf(\"Credentials server started...\")\n\t\t\tbreak\n\t\t}\n\n\t\tif time.Since(now) > maxWait {\n\t\t\tlog.Debugf(\"Credentials server didn't start in time...\")\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn port, nil\n}\n\nfunc PingURL(ctx context.Context, url string) error {\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, time.Second)\n\tdefer cancel()\n\n\treq, err := http.NewRequestWithContext(timeoutCtx, \"GET\", url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode >= 400 {\n\t\treturn fmt.Errorf(\"unexpected status code: %d\", resp.StatusCode)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/daemon/agent/daemon.go",
    "content": "package agent\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\t\"github.com/takama/daemon\"\n)\n\ntype SshConfig struct {\n\tWorkdir string `json:\"workdir,omitempty\"`\n\tUser    string `json:\"user,omitempty\"`\n}\n\ntype DaemonConfig struct {\n\tPlatform devpod.PlatformOptions `json:\"platform,omitempty\"`\n\tSsh      SshConfig              `json:\"ssh,omitempty\"`\n\tTimeout  string                 `json:\"timeout\"`\n}\n\nfunc BuildWorkspaceDaemonConfig(platformOptions devpod.PlatformOptions, workspaceConfig *provider2.Workspace, substitutionContext *config.SubstitutionContext, mergedConfig *config.MergedDevContainerConfig) (*DaemonConfig, error) {\n\tvar workdir string\n\tif workspaceConfig.Source.GitSubPath != \"\" {\n\t\tsubstitutionContext.ContainerWorkspaceFolder = filepath.Join(substitutionContext.ContainerWorkspaceFolder, workspaceConfig.Source.GitSubPath)\n\t\tworkdir = substitutionContext.ContainerWorkspaceFolder\n\t}\n\tif workdir == \"\" && mergedConfig != nil {\n\t\tworkdir = mergedConfig.WorkspaceFolder\n\t}\n\tif workdir == \"\" && substitutionContext != nil {\n\t\tworkdir = substitutionContext.ContainerWorkspaceFolder\n\t}\n\n\t// Get remote user; default to \"root\" if empty.\n\tuser := mergedConfig.RemoteUser\n\tif user == \"\" {\n\t\tuser = \"root\"\n\t}\n\n\t// build info isn't required in the workspace and can be omitted\n\tplatformOptions.Build = nil\n\n\tdaemonConfig := &DaemonConfig{\n\t\tPlatform: platformOptions,\n\t\tSsh: SshConfig{\n\t\t\tWorkdir: workdir,\n\t\t\tUser:    user,\n\t\t},\n\t}\n\n\treturn daemonConfig, nil\n}\n\nfunc GetEncodedWorkspaceDaemonConfig(platformOptions devpod.PlatformOptions, workspaceConfig *provider2.Workspace, substitutionContext *config.SubstitutionContext, mergedConfig *config.MergedDevContainerConfig) (string, error) {\n\tdaemonConfig, err := BuildWorkspaceDaemonConfig(platformOptions, workspaceConfig, substitutionContext, mergedConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdata, err := json.Marshal(daemonConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tencoded := base64.StdEncoding.EncodeToString(data)\n\treturn encoded, nil\n}\n\nfunc InstallDaemon(agentDir string, interval string, log log.Logger) error {\n\tif runtime.GOOS == \"windows\" || runtime.GOOS == \"darwin\" {\n\t\treturn fmt.Errorf(\"unsupported daemon os\")\n\t}\n\n\t// check if admin\n\tservice, err := daemon.New(\"devpod\", \"DevPod Agent Service\", daemon.SystemDaemon)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// install ourselves with devpod watch\n\targs := []string{\"agent\", \"daemon\"}\n\tif agentDir != \"\" {\n\t\targs = append(args, \"--agent-dir\", agentDir)\n\t}\n\tif interval != \"\" {\n\t\targs = append(args, \"--interval\", interval)\n\t}\n\t_, err = service.Install(args...)\n\tif err != nil && !errors.Is(err, daemon.ErrAlreadyInstalled) {\n\t\treturn perrors.Wrap(err, \"install service\")\n\t}\n\n\t// make sure daemon is started\n\t_, err = service.Start()\n\tif err != nil && !errors.Is(err, daemon.ErrAlreadyRunning) {\n\t\tlog.Warnf(\"Error starting service: %v\", err)\n\n\t\terr = single.Single(\"daemon.pid\", func() (*exec.Cmd, error) {\n\t\t\texecutable, err := os.Executable()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tlog.Infof(\"Successfully started DevPod daemon into server\")\n\t\t\treturn exec.Command(executable, args...), nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"start daemon: %w\", err)\n\t\t}\n\t} else if err == nil {\n\t\tlog.Infof(\"Successfully installed DevPod daemon into server\")\n\t}\n\n\treturn nil\n}\n\nfunc RemoveDaemon() error {\n\tif runtime.GOOS == \"windows\" || runtime.GOOS == \"darwin\" {\n\t\treturn fmt.Errorf(\"unsupported daemon os\")\n\t}\n\n\t// check if admin\n\tservice, err := daemon.New(\"devpod\", \"DevPod Agent Service\", daemon.SystemDaemon)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// remove daemon\n\t_, err = service.Remove()\n\tif err != nil && !errors.Is(err, daemon.ErrNotInstalled) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/daemon/agent/reaper_linux.go",
    "content": "//go:build linux\n// +build linux\n\npackage agent\n\nimport reaper \"github.com/ramr/go-reaper\"\n\nfunc RunProcessReaper() {\n\treaper.Reap()\n}\n"
  },
  {
    "path": "pkg/daemon/agent/reaper_stub.go",
    "content": "//go:build !linux\n// +build !linux\n\npackage agent\n\nfunc RunProcessReaper() {}\n"
  },
  {
    "path": "pkg/daemon/platform/client.go",
    "content": "package daemon\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n)\n\nconst devPodClientPrefix = 0x01\n\ntype LocalClient struct {\n\thttpClient *http.Client\n\tprovider   string\n}\n\nfunc NewLocalClient(provider string) *LocalClient {\n\tsocketAddr := GetSocketAddr(provider)\n\ttr := http.DefaultTransport.(*http.Transport).Clone()\n\ttr.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\tconn, err := Dial(socketAddr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t_, err = conn.Write([]byte{devPodClientPrefix})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn conn, err\n\t}\n\ttr.TLSHandshakeTimeout = 2 * time.Second\n\thttpClient := &http.Client{Transport: tr}\n\n\treturn &LocalClient{httpClient: httpClient, provider: provider}\n}\n\nfunc (c *LocalClient) Status(ctx context.Context, debug bool) (Status, error) {\n\tpath := routeStatus\n\tif debug {\n\t\tpath += \"?debug\"\n\t}\n\tb, err := c.doRequest(ctx, http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn Status{}, err\n\t}\n\n\tstatus := Status{}\n\terr = json.Unmarshal(b, &status)\n\tif err != nil {\n\t\treturn Status{}, err\n\t}\n\n\treturn status, nil\n}\n\nfunc (c *LocalClient) GetWorkspace(ctx context.Context, uid string) (*managementv1.DevPodWorkspaceInstance, error) {\n\tb, err := c.doRequest(ctx, http.MethodGet, routeGetWorkspace+fmt.Sprintf(\"?uid=%s\", uid), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(b) == 0 {\n\t\treturn nil, nil\n\t}\n\tinstance := &managementv1.DevPodWorkspaceInstance{}\n\terr = json.Unmarshal(b, instance)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn instance, nil\n}\n\nfunc (c *LocalClient) ListWorkspaces(ctx context.Context, ownerFilter platform.OwnerFilter) ([]managementv1.DevPodWorkspaceInstance, error) {\n\tb, err := c.doRequest(ctx, http.MethodGet, routeListWorkspaces+\"?owner=\"+ownerFilter.String(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinstances := []managementv1.DevPodWorkspaceInstance{}\n\terr = json.Unmarshal(b, &instances)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn instances, nil\n}\n\nfunc (c *LocalClient) CreateWorkspace(ctx context.Context, workspace *managementv1.DevPodWorkspaceInstance) (*managementv1.DevPodWorkspaceInstance, error) {\n\tbody, err := json.Marshal(workspace)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb, err := c.doRequest(ctx, http.MethodPost, routeCreateWorkspace, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewInstance := &managementv1.DevPodWorkspaceInstance{}\n\terr = json.Unmarshal(b, newInstance)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newInstance, nil\n}\n\nfunc (c *LocalClient) UpdateWorkspace(ctx context.Context, workspace *managementv1.DevPodWorkspaceInstance) (*managementv1.DevPodWorkspaceInstance, error) {\n\tbody, err := json.Marshal(workspace)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb, err := c.doRequest(ctx, http.MethodPost, routeUpdateWorkspace, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewInstance := &managementv1.DevPodWorkspaceInstance{}\n\terr = json.Unmarshal(b, newInstance)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newInstance, nil\n}\n\nfunc (c *LocalClient) Shutdown(ctx context.Context) error {\n\t_, err := c.doRequest(ctx, http.MethodGet, routeShutdown, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (c *LocalClient) doRequest(ctx context.Context, method string, path string, body io.Reader) ([]byte, error) {\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, 30*time.Second)\n\tdefer cancel()\n\n\treq, err := http.NewRequestWithContext(timeoutCtx, method, fmt.Sprintf(\"http://localclient.devpod%s\", path), body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\tif isConnectToDaemonError(err) {\n\t\t\treturn nil, &DaemonNotAvailableError{Err: err, Provider: c.provider}\n\t\t}\n\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != http.StatusOK {\n\t\tb, err := io.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s: %s\", res.Status, string(b))\n\t}\n\n\treturn io.ReadAll(res.Body)\n}\n"
  },
  {
    "path": "pkg/daemon/platform/daemon.go",
    "content": "package daemon\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\tdevpodlog \"github.com/loft-sh/devpod/pkg/log\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/tsnet\"\n\t\"tailscale.com/types/netmap\"\n)\n\ntype Daemon struct {\n\tsocketListener net.Listener\n\ttsServer       *tsnet.Server\n\tlocalServer    *localServer\n\trootDir        string\n\tlog            log.Logger\n}\n\ntype InitConfig struct {\n\tRootDir        string\n\tContext        string\n\tProviderName   string\n\tUserName       string\n\tPlatformClient client.Client\n\n\tDebug bool\n}\n\nfunc Init(ctx context.Context, config InitConfig) (*Daemon, error) {\n\tlog := initLogging(config.RootDir, config.Debug)\n\n\tsocketAddr := GetSocketAddr(config.ProviderName)\n\tlog.Infof(\"Starting Daemon on address: %s\", socketAddr)\n\t// listen to socket for early return  in case it's already in use\n\tsocketListener, err := listen(socketAddr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"listen on socket: %w\", err)\n\t}\n\n\tplatformConfig := config.PlatformClient.Config()\n\ttsServer, lc, err := newTSServer(ctx, platformConfig.Host, platformConfig.AccessKey, config.UserName, config.RootDir, platformConfig.Insecure, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create tailscale server: %w\", err)\n\t}\n\n\tlocalServer, err := newLocalServer(lc, config.PlatformClient, config.Context, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create local server: %w\", err)\n\t}\n\n\treturn &Daemon{\n\t\tsocketListener: socketListener,\n\t\ttsServer:       tsServer,\n\t\tlocalServer:    localServer,\n\t\trootDir:        config.RootDir,\n\t\tlog:            log,\n\t}, nil\n}\nfunc (d *Daemon) Start(ctx context.Context) error {\n\terrChan := make(chan error, 1)\n\n\tgo func() {\n\t\td.log.Infof(\"Starting local server: %s\", d.localServer.Addr())\n\t\terrChan <- d.localServer.ListenAndServe()\n\t}()\n\tgo func() {\n\t\td.log.Info(\"Start proxying connections\")\n\t\terrChan <- d.Listen(d.socketListener)\n\t}()\n\tgo func() {\n\t\td.log.Info(\"Start netmap watcher\")\n\t\terrChan <- d.watchNetmap(ctx)\n\t}()\n\n\tdefer func() {\n\t\td.log.Info(\"Cleaning up daemon resources\")\n\t\t_ = d.tsServer.Close()\n\t\t_ = d.localServer.Close()\n\t\t_ = d.socketListener.Close()\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\tif err != nil && !errors.Is(err, context.Canceled) {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\terr := ctx.Err()\n\t\tif !errors.Is(err, context.Canceled) {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n}\n\nfunc (d *Daemon) Listen(ln net.Listener) error {\n\tlc, err := d.tsServer.LocalClient()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get local tailscale client: %w\", err)\n\t}\n\n\tfor {\n\t\trawConn, err := ln.Accept()\n\t\tif err != nil {\n\t\t\td.log.Debugf(\"Failed to accept connection: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tbConn := newBufferedConn(rawConn)\n\t\tclientType, err := getClientType(bConn)\n\t\tif err != nil {\n\t\t\t_ = bConn.Close()\n\t\t\td.log.Debugf(\"Unknown client type: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tswitch clientType {\n\t\tcase devPodClientType:\n\t\t\tgo d.handler(bConn, dialLocal(d.localServer))\n\t\tcase tailscaleClientType:\n\t\t\tgo d.handler(bConn, dialTS(lc))\n\t\t}\n\t}\n}\n\nfunc (d *Daemon) handler(conn net.Conn, dialFunc dialFunc) {\n\tdefer conn.Close()\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\tbackendConn, err := dialFunc(ctx)\n\tif err != nil {\n\t\td.log.Error(\"dial: %v\", err)\n\t\treturn\n\t}\n\tdefer backendConn.Close()\n\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\t_, err := io.Copy(backendConn, conn)\n\t\terrChan <- err\n\t}()\n\tgo func() {\n\t\t_, err := io.Copy(conn, backendConn)\n\t\terrChan <- err\n\t}()\n\t<-errChan\n}\n\nfunc (d *Daemon) watchNetmap(ctx context.Context) error {\n\tlc, err := d.tsServer.LocalClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ts.WatchNetmap(ctx, lc, func(netMap *netmap.NetworkMap) {\n\t\tnm, err := json.Marshal(netMap)\n\t\tif err != nil {\n\t\t\td.log.Errorf(\"Failed to marshal netmap: %v\", err)\n\t\t} else {\n\t\t\t_ = os.WriteFile(filepath.Join(d.rootDir, \"netmap.json\"), nm, 0o644)\n\t\t}\n\t})\n}\n\nfunc initLogging(rootDir string, debug bool) log.Logger {\n\tlogLevel := logrus.InfoLevel\n\tif debug {\n\t\tlogLevel = logrus.DebugLevel\n\t}\n\n\tlogPath := filepath.Join(rootDir, \"daemon.log\")\n\tlogger := log.NewFileLogger(logPath, logLevel)\n\tif os.Getenv(\"DEVPOD_UI\") != \"true\" {\n\t\tlogger = devpodlog.NewCombinedLogger(logLevel, logger, log.NewStreamLogger(os.Stdout, os.Stderr, logLevel))\n\t}\n\n\treturn logger\n}\n\ntype dialFunc func(context.Context) (net.Conn, error)\n\nfunc dialTS(lc *tailscale.LocalClient) dialFunc {\n\treturn func(ctx context.Context) (net.Conn, error) {\n\t\treturn lc.Dial(ctx, \"tcp\", \"local-tailscaled.sock:80\")\n\t}\n}\n\nfunc dialLocal(l *localServer) dialFunc {\n\treturn func(ctx context.Context) (net.Conn, error) {\n\t\treturn l.Dial(ctx, \"tcp\", l.Addr())\n\t}\n}\n\ntype clientType string\n\nvar (\n\tdevPodClientType    clientType = \"devpod\"\n\ttailscaleClientType clientType = \"tailscale\"\n)\n\nfunc getClientType(bConn *bufferedConn) (clientType, error) {\n\tb, err := bConn.ReadByte()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tswitch b {\n\tcase devPodClientPrefix:\n\t\treturn devPodClientType, nil\n\tdefault:\n\t\treturn tailscaleClientType, bConn.UnreadByte()\n\t}\n}\n\nfunc newBufferedConn(conn net.Conn) *bufferedConn {\n\treturn &bufferedConn{\n\t\tConn: conn,\n\t\tbr:   bufio.NewReader(conn),\n\t}\n}\n\ntype bufferedConn struct {\n\tnet.Conn\n\tbr *bufio.Reader\n}\n\nfunc (c *bufferedConn) Read(b []byte) (int, error) {\n\treturn c.br.Read(b)\n}\n\nfunc (c *bufferedConn) ReadByte() (byte, error) {\n\treturn c.br.ReadByte()\n}\n\nfunc (c *bufferedConn) UnreadByte() error {\n\treturn c.br.UnreadByte()\n}\n"
  },
  {
    "path": "pkg/daemon/platform/error.go",
    "content": "package daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n)\n\ntype DaemonNotAvailableError struct {\n\tErr      error\n\tProvider string\n}\n\nfunc (e *DaemonNotAvailableError) Error() string {\n\treturn fmt.Sprintf(\"The DevPod Daemon for provider %s isn't reachable. Is DevPod Desktop or `devpod pro daemon start --host=$YOUR_PRO_HOST` running? %v\", e.Provider, e.Err)\n}\nfunc (e *DaemonNotAvailableError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc IsDaemonNotAvailableError(err error) bool {\n\tvar e *DaemonNotAvailableError\n\treturn errors.As(err, &e)\n}\n\nfunc IsAccessKeyNotFound(err error) bool {\n\t// we have to check against the string because the error is coming from the server\n\treturn strings.Contains(err.Error(), client.ErrAccessKeyNotFound.Error())\n}\n"
  },
  {
    "path": "pkg/daemon/platform/error_unix.go",
    "content": "//go:build linux || darwin || unix\n\npackage daemon\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n)\n\nfunc isConnectToDaemonError(err error) bool {\n\treturn errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, syscall.ENOENT)\n}\n"
  },
  {
    "path": "pkg/daemon/platform/error_windows.go",
    "content": "//go:build windows\n\npackage daemon\n\nimport (\n\t\"errors\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc isConnectToDaemonError(err error) bool {\n\treturn errors.Is(err, windows.WSAECONNREFUSED)\n}\n"
  },
  {
    "path": "pkg/daemon/platform/local_server.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"runtime/debug\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/gorilla/handlers\"\n\t\"github.com/julienschmidt/httprouter\"\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tplatformclient \"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/labels\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/klog/v2\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/ipn\"\n\t\"tailscale.com/ipn/ipnstate\"\n\t\"tailscale.com/net/memnet\"\n)\n\ntype localServer struct {\n\tdevPodContext  string\n\thttpServer     *http.Server\n\tlc             *tailscale.LocalClient\n\tlistener       *memnet.Listener\n\tpc             platformclient.Client\n\tplatformStatus *platformStatus\n\tlog            log.Logger\n\tstopChan       chan struct{}\n}\n\ntype Status struct {\n\tState         DaemonState  `json:\"state,omitempty\"`\n\tLoginRequired bool         `json:\"loginRequired,omitempty\"`\n\tOnline        bool         `json:\"online,omitempty\"`\n\tDebug         *DebugStatus `json:\"debug,omitempty\"`\n}\n\ntype DebugStatus struct {\n\tTailscale *ipnstate.Status   `json:\"tailscale,omitempty\"`\n\tSelf      *managementv1.Self `json:\"self,omitempty\"`\n}\n\ntype DaemonState string\n\nvar (\n\tDaemonStateRunning DaemonState = \"running\"\n\tDaemonStateStopped DaemonState = \"stopped\"\n\tDaemonStatePending DaemonState = \"pending\"\n)\n\nconst platformStatusCheckInterval = 10 * time.Second\n\ntype platformStatus struct {\n\tmu            sync.RWMutex\n\tauthenticated bool\n}\n\nvar (\n\trouteHealth            = \"/health\"\n\trouteStatus            = \"/status\"\n\trouteVersion           = \"/version\"\n\trouteShutdown          = \"/shutdown\"\n\trouteSelf              = \"/self\"\n\trouteProjects          = \"/projects\"\n\trouteProjectTemplates  = \"/projects/:project/templates\"\n\trouteProjectClusters   = \"/projects/:project/clusters\"\n\trouteGetWorkspace      = \"/workspace\"\n\trouteWatchWorkspaces   = \"/watch-workspaces\"\n\trouteListWorkspaces    = \"/list-workspaces\"\n\trouteCreateWorkspace   = \"/create-workspace\"\n\trouteUpdateWorkspace   = \"/update-workspace\"\n\trouteGetUserProfile    = \"/user-profile\"\n\trouteUpdateUserProfile = \"/update-user-profile\"\n\trouteGitCredentials    = \"/git-credentials\"\n\trouteDockerCredentials = \"/docker-credentials\"\n)\n\nfunc newLocalServer(lc *tailscale.LocalClient, pc platformclient.Client, devPodContext string, log log.Logger) (*localServer, error) {\n\tl := &localServer{\n\t\tlc:             lc,\n\t\tpc:             pc,\n\t\tlog:            log,\n\t\tdevPodContext:  devPodContext,\n\t\tlistener:       memnet.Listen(\"localclient.devpod:80\"),\n\t\tplatformStatus: &platformStatus{authenticated: true},\n\t\tstopChan:       make(chan struct{}, 1),\n\t}\n\n\trouter := httprouter.New()\n\trouter.PanicHandler = func(w http.ResponseWriter, r *http.Request, i interface{}) {\n\t\thttp.Error(w, fmt.Errorf(\"panic: %v\", i).Error(), http.StatusInternalServerError)\n\t\tl.log.Error(fmt.Errorf(\"panic: %v\", i), string(debug.Stack()))\n\t}\n\trouter.GET(routeHealth, l.health)\n\trouter.GET(routeStatus, l.status)\n\trouter.GET(routeVersion, l.version)\n\trouter.GET(routeShutdown, l.shutdown)\n\trouter.GET(routeSelf, l.self)\n\trouter.GET(routeProjects, l.projects)\n\trouter.GET(routeProjectTemplates, l.projectTemplates)\n\trouter.GET(routeProjectClusters, l.projectClusters)\n\trouter.GET(routeGetWorkspace, l.getWorkspace)\n\trouter.GET(routeWatchWorkspaces, l.watchWorkspaces)\n\trouter.GET(routeListWorkspaces, l.listWorkspace)\n\trouter.POST(routeCreateWorkspace, l.createWorkspace)\n\trouter.POST(routeUpdateWorkspace, l.updateWorkspace)\n\trouter.GET(routeGetUserProfile, l.userProfile)\n\trouter.POST(routeUpdateUserProfile, l.updateUserProfile)\n\trouter.GET(routeGitCredentials, l.getGitCredentials)\n\trouter.GET(routeDockerCredentials, l.getDockerCredentials)\n\n\thandler := handlers.LoggingHandler(log.Writer(logrus.DebugLevel, true), router)\n\thandler = handlers.RecoveryHandler(handlers.RecoveryLogger(panicLogger{log: l.log}), handlers.PrintRecoveryStack(true))(handler)\n\tl.httpServer = &http.Server{Handler: handler}\n\n\treturn l, nil\n}\n\ntype panicLogger struct {\n\tlog log.Logger\n}\n\nfunc (r panicLogger) Println(args ...interface{}) {\n\tr.log.Error(args...)\n}\n\nfunc (l *localServer) ListenAndServe() error {\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tl.log.Info(\"Start config watcher\")\n\t\terr := l.watchPlatform(l.stopChan)\n\t\terrChan <- err\n\t}()\n\tgo func() {\n\t\terr := l.httpServer.Serve(l.listener)\n\t\terrChan <- err\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\treturn err\n\tcase <-l.stopChan:\n\t\treturn nil\n\t}\n}\n\nfunc (l *localServer) Close() error {\n\tl.log.Info(\"shutting down local server\")\n\tl.stopChan <- struct{}{}\n\t_ = l.listener.Close()\n\treturn nil\n}\n\nfunc (l *localServer) Addr() string {\n\treturn l.listener.Addr().String()\n}\n\nfunc (l *localServer) Dial(ctx context.Context, network, addr string) (net.Conn, error) {\n\treturn l.listener.Dial(ctx, network, addr)\n}\n\nfunc (l *localServer) watchPlatform(stopChan <-chan struct{}) error {\n\tfor {\n\t\tl.log.Debug(\"Check platform status\")\n\n\t\tmanagementClient, err := l.pc.Management()\n\t\tif err != nil {\n\t\t\tl.log.Error(fmt.Errorf(\"create mangement client: %w\", err))\n\t\t} else {\n\t\t\t_, err = managementClient.Loft().ManagementV1().Selves().Create(context.Background(), &managementv1.Self{}, metav1.CreateOptions{})\n\t\t\tl.platformStatus.mu.Lock()\n\t\t\tif err != nil {\n\t\t\t\tif IsAccessKeyNotFound(err) {\n\t\t\t\t\tl.log.Warnf(\"client not authenticated: %s\", err)\n\t\t\t\t\tl.platformStatus.authenticated = false\n\t\t\t\t} else {\n\t\t\t\t\tl.log.Errorf(\"failed to create self: %v\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We don't want to be too restrictive in case the error\n\t\t\t\t// is transient and doesn't impact existing connections\n\t\t\t\tl.platformStatus.authenticated = true\n\t\t\t}\n\t\t\tl.platformStatus.mu.Unlock()\n\t\t}\n\n\t\tselect {\n\t\tcase <-stopChan:\n\t\t\treturn nil\n\t\tcase <-time.After(platformStatusCheckInterval):\n\t\t}\n\t}\n}\n\nfunc (l *localServer) health(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tw.WriteHeader(http.StatusOK)\n}\n\nfunc (l *localServer) status(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tst, err := l.lc.Status(r.Context())\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// overall state\n\tstatus := &Status{}\n\tswitch st.BackendState {\n\tcase ipn.Starting.String():\n\t\tstatus.State = DaemonStatePending\n\tcase ipn.Running.String():\n\t\tstatus.State = DaemonStateRunning\n\tdefault:\n\t\t// we consider all other states as `stopped`\n\t\tstatus.State = DaemonStateStopped\n\t}\n\n\t// authentication info\n\tl.platformStatus.mu.RLock()\n\tif !l.platformStatus.authenticated {\n\t\tstatus.LoginRequired = true\n\t}\n\tl.platformStatus.mu.RUnlock()\n\n\t// set online status\n\tstatus.Online = st.Self != nil && st.Self.Online && st.Self.InNetworkMap\n\n\t// debug info\n\tif r.URL.Query().Has(\"debug\") {\n\t\tself := l.pc.Self()\n\t\tself.Status.AccessKey = \"*********\" // redact access key\n\t\tstatus.Debug = &DebugStatus{\n\t\t\tTailscale: st,\n\t\t\tSelf:      self,\n\t\t}\n\t}\n\n\ttryJSON(w, status)\n}\n\nfunc (l *localServer) shutdown(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\terr := l.Close()\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"shut down daemon server: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n}\n\ntype VersionInfo struct {\n\tServerVersion string `json:\"serverVersion,omitempty\"`\n}\n\nfunc (l *localServer) version(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tplatformVersion, err := platform.GetPlatformVersion(l.pc.Config().Host)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"get platform version: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, VersionInfo{\n\t\tServerVersion: platformVersion.Version,\n\t})\n}\n\nfunc (l *localServer) self(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\ttryJSON(w, l.pc.Self())\n}\n\nfunc (l *localServer) userProfile(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tuserName := l.pc.Self().Status.User.Name\n\n\tprofile, err := managementClient.Loft().ManagementV1().Users().GetProfile(r.Context(), userName, metav1.GetOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"get user profile: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, profile)\n}\n\nfunc (l *localServer) updateUserProfile(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tprofile := &managementv1.UserProfile{}\n\terr := json.NewDecoder(r.Body).Decode(profile)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tprofile.TypeMeta = metav1.TypeMeta{}\n\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tuserName := l.pc.Self().Status.User.Name\n\tupdatedProfile, err := managementClient.Loft().ManagementV1().Users().UpdateProfile(r.Context(), userName, profile, metav1.CreateOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"update user profile: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, updatedProfile)\n}\n\nfunc (l *localServer) projects(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tprojectList, err := managementClient.Loft().ManagementV1().Projects().List(r.Context(), metav1.ListOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"list projects: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t} else if len(projectList.Items) == 0 {\n\t\terr := fmt.Errorf(\"you don't have access to any projects, please make sure you have at least access to 1 project\")\n\t\thttp.Error(w, err.Error(), http.StatusForbidden)\n\t\treturn\n\t}\n\n\ttryJSON(w, projectList.Items)\n}\n\nfunc (l *localServer) projectTemplates(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tprojectName := params.ByName(\"project\")\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttemplateList, err := managementClient.Loft().ManagementV1().Projects().ListTemplates(r.Context(), projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"list templates: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t} else if len(templateList.DevPodWorkspaceTemplates) == 0 {\n\t\terr := fmt.Errorf(\"seems like there is no template allowed in project %s, please make sure to at least have a single template available\", projectName)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, templateList)\n}\nfunc (l *localServer) projectClusters(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tprojectName := params.ByName(\"project\")\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tclusterList, err := managementClient.Loft().ManagementV1().Projects().ListClusters(r.Context(), projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"list cluster: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t} else if len(clusterList.Clusters) == 0 {\n\t\terr := fmt.Errorf(\"seems like there is no cluster allowed in project %s, please make sure to at least have a single cluster available\", projectName)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, clusterList)\n}\n\nfunc (l *localServer) listWorkspace(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\townerParam := r.URL.Query().Get(\"owner\")\n\townerFilter := platform.SelfOwnerFilter\n\tif ownerParam != \"\" {\n\t\townerFilter = platform.OwnerFilter(ownerParam)\n\t}\n\n\tmanagementClient, err := l.pc.Management()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tprojectList, err := managementClient.Loft().ManagementV1().Projects().List(r.Context(), metav1.ListOptions{})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"list projects: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t} else if len(projectList.Items) == 0 {\n\t\terr := fmt.Errorf(\"you don't have access to any projects, please make sure you have at least access to 1 project\")\n\t\thttp.Error(w, err.Error(), http.StatusForbidden)\n\t\treturn\n\t}\n\n\tinstances := []managementv1.DevPodWorkspaceInstance{}\n\tfor _, p := range projectList.Items {\n\t\tns := project.ProjectNamespace(p.GetName())\n\t\tworkspaceList, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(ns).List(r.Context(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\thttp.Error(w, fmt.Errorf(\"list workspaces in project %s: %w\", p.GetName(), err).Error(), http.StatusNoContent)\n\t\t\treturn\n\t\t}\n\n\t\tfor _, instance := range workspaceList.Items {\n\t\t\tif ownerFilter == platform.SelfOwnerFilter && !platform.IsOwner(l.pc.Self(), instance.GetOwner()) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif instance.GetLabels() == nil {\n\t\t\t\tinstance.Labels = map[string]string{}\n\t\t\t}\n\t\t\tinstance.Labels[labels.ProjectLabel] = p.GetName()\n\n\t\t\tinstances = append(instances, instance)\n\t\t}\n\t}\n\n\ttryJSON(w, instances)\n}\n\nfunc (l *localServer) getWorkspace(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tuid := r.URL.Query().Get(\"uid\")\n\tif uid == \"\" {\n\t\thttp.Error(w, \"missing required query parameter \\\"uid\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tinstance, err := platform.FindInstance(r.Context(), l.pc, uid)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"failed to get workspace with uid %s: %w\", uid, err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif instance == nil {\n\t\t// send OK but don't try to marshal nil instance\n\t\tw.WriteHeader(http.StatusOK)\n\t\treturn\n\t}\n\n\ttryJSON(w, instance)\n}\n\nfunc (l *localServer) watchWorkspaces(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tf, ok := w.(http.Flusher)\n\tif !ok {\n\t\thttp.Error(w, \"not a flusher\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tproject := r.URL.Query().Get(\"project\")\n\tif project == \"\" {\n\t\thttp.Error(w, \"missing required query parameter \\\"project\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\townerParam := r.URL.Query().Get(\"owner\")\n\townerFilter := platform.SelfOwnerFilter\n\tif ownerParam != \"\" {\n\t\townerFilter = platform.OwnerFilter(ownerParam)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tenc := json.NewEncoder(w)\n\terr := startWorkspaceWatcher(r.Context(), watchConfig{\n\t\tProject:        project,\n\t\tContext:        l.devPodContext,\n\t\tOwnerFilter:    ownerFilter,\n\t\tPlatformClient: l.pc,\n\t\tTsClient:       l.lc,\n\t\tLog:            l.log},\n\t\t// we need to debounce events here to avoid spamming the client with too many events\n\t\tthrottle(func(instanceList []*ProWorkspaceInstance) {\n\t\t\tif r.Context().Err() != nil {\n\t\t\t\treturn // Client disconnected, stop trying to write\n\t\t\t}\n\n\t\t\tif instanceList != nil {\n\t\t\t\terr := enc.Encode(instanceList)\n\t\t\t\tif err != nil {\n\t\t\t\t\thttp.Error(w, \"decode workspace list\", http.StatusInternalServerError)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tf.Flush()\n\t\t\t}\n\t\t}, time.Second),\n\t)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"failed to watch workspaces: %w\", err).Error(), http.StatusInternalServerError)\n\t\tl.log.Errorf(\"watch workspaces: %w\", err)\n\t\treturn\n\t}\n}\n\n// throttle returns a function that wraps f so that f is called at most once\n// every interval. If a call happens before the interval has elapsed,\n// the latest instanceList is saved and f will be called with it when possible.\nfunc throttle(f func(instanceList []*ProWorkspaceInstance), interval time.Duration) func(instanceList []*ProWorkspaceInstance) {\n\tvar mu sync.Mutex\n\tvar lastExecuted time.Time          // Time of the last execution of f.\n\tvar pending []*ProWorkspaceInstance // Latest instanceList waiting to be processed.\n\tvar timer *time.Timer               // Timer scheduled to call f.\n\n\treturn func(instanceList []*ProWorkspaceInstance) {\n\t\tmu.Lock()\n\t\tdefer mu.Unlock()\n\n\t\tnow := time.Now()\n\t\t// If enough time has passed and there's no pending timer, call immediately.\n\t\tif timer == nil && now.Sub(lastExecuted) >= interval {\n\t\t\tlastExecuted = now\n\t\t\t// Call f asynchronously so the caller is not blocked.\n\t\t\tf(instanceList)\n\t\t\treturn\n\t\t}\n\n\t\t// Otherwise, save the latest instanceList.\n\t\tpending = instanceList\n\n\t\t// If no timer is set, schedule one to run when the interval expires.\n\t\tif timer == nil {\n\t\t\tremaining := interval - now.Sub(lastExecuted)\n\t\t\tif remaining < 0 {\n\t\t\t\tremaining = 0\n\t\t\t}\n\t\t\ttimer = time.AfterFunc(remaining, func() {\n\t\t\t\tmu.Lock()\n\t\t\t\t// Grab the latest pending instanceList.\n\t\t\t\tcurrentPending := pending\n\t\t\t\t// Clear state.\n\t\t\t\tpending = nil\n\t\t\t\ttimer = nil\n\t\t\t\tlastExecuted = time.Now()\n\t\t\t\tmu.Unlock()\n\t\t\t\t// Execute the function with the latest instanceList.\n\t\t\t\tif currentPending != nil {\n\t\t\t\t\tf(currentPending)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n\nfunc (l *localServer) createWorkspace(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tinstance := &managementv1.DevPodWorkspaceInstance{}\n\terr := json.NewDecoder(r.Body).Decode(instance)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tinstance.TypeMeta = metav1.TypeMeta{}\n\n\tupdatedInstance, err := createInstance(r.Context(), l.pc, instance, l.log)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"create workspace: %w\", err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\ttryJSON(w, updatedInstance)\n}\n\nfunc (l *localServer) updateWorkspace(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\tnewInstance := &managementv1.DevPodWorkspaceInstance{}\n\terr := json.NewDecoder(r.Body).Decode(newInstance)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tnewInstance.TypeMeta = metav1.TypeMeta{}\n\n\tprojectName := project.ProjectFromNamespace(newInstance.GetNamespace())\n\toldInstance, err := platform.FindInstanceByName(r.Context(), l.pc, newInstance.GetName(), projectName)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"find old workspace: %w\", err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tupdatedInstance, err := updateInstance(r.Context(), l.pc, oldInstance, newInstance, l.log)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"update workspace: %w\", err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\ttryJSON(w, updatedInstance)\n}\n\nfunc (l *localServer) getGitCredentials(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\thost := r.URL.Query().Get(\"host\")\n\tif host == \"\" {\n\t\thttp.Error(w, \"missing required query parameter \\\"host\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tprotocol := r.URL.Query().Get(\"protocol\")\n\tif protocol == \"\" {\n\t\tprotocol = \"https\"\n\t}\n\n\tcredentials, err := gitcredentials.GetCredentials(&gitcredentials.GitCredentials{\n\t\tProtocol: protocol,\n\t\tHost:     host,\n\t})\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"get git credentials: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttryJSON(w, credentials)\n}\n\nfunc (l *localServer) getDockerCredentials(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\thost := r.URL.Query().Get(\"server\")\n\tif host == \"\" {\n\t\thttp.Error(w, \"missing required query parameter \\\"server\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tall, err := dockercredentials.ListCredentials()\n\tif err != nil {\n\t\tklog.Errorf(\"failed to list docker credentials: %v\", err)\n\t\thttp.Error(w, fmt.Errorf(\"list docker credentials: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tfor registry, cred := range all.Registries {\n\t\tif registry == host {\n\t\t\ttryJSON(w, cred)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc tryJSON(w http.ResponseWriter, obj interface{}) {\n\tout, err := json.Marshal(obj)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Errorf(\"marshal: %w\", err).Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t_, _ = w.Write(out)\n}\n\nfunc createInstance(ctx context.Context, client platformclient.Client, instance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tupdatedInstance, err := managementClient.Loft().ManagementV1().\n\t\tDevPodWorkspaceInstances(instance.GetNamespace()).\n\t\tCreate(ctx, instance, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create workspace instance: %w\", err)\n\t}\n\n\treturn platform.WaitForInstance(ctx, client, updatedInstance, log)\n}\n\nfunc updateInstance(ctx context.Context, client platformclient.Client, oldInstance *managementv1.DevPodWorkspaceInstance, newInstance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\t// This ensures the template is kept up to date with configuration changes\n\tif newInstance.Spec.TemplateRef != nil {\n\t\tnewInstance.Spec.TemplateRef.SyncOnce = true\n\t}\n\n\treturn platform.UpdateInstance(ctx, client, oldInstance, newInstance, log)\n}\n"
  },
  {
    "path": "pkg/daemon/platform/socket.go",
    "content": "//go:build linux || darwin || unix\n\npackage daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\nfunc GetSocketAddr(providerName string) string {\n\treturn filepath.Join(\"/tmp\", fmt.Sprintf(\"devpod-%s.sock\", providerName))\n}\n\nfunc Dial(addr string) (net.Conn, error) {\n\treturn net.DialTimeout(\"unix\", addr, 2*time.Second)\n}\n\nfunc listen(addr string) (net.Listener, error) {\n\tconn, err := net.Dial(\"unix\", addr)\n\tif err == nil {\n\t\tconn.Close()\n\t\treturn nil, fmt.Errorf(\"%s: address already in use\", addr)\n\t}\n\t_ = os.Remove(addr)\n\n\tsockDir := filepath.Dir(addr)\n\tif _, err := os.Stat(sockDir); errors.Is(err, os.ErrNotExist) {\n\t\t_ = os.MkdirAll(sockDir, 0o755) // best effort\n\t}\n\tpipe, err := net.Listen(\"unix\", addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_ = os.Chmod(addr, 0o666)\n\treturn pipe, err\n}\n"
  },
  {
    "path": "pkg/daemon/platform/socket_windows.go",
    "content": "//go:build windows\n\npackage daemon\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"gopkg.in/natefinch/npipe.v2\"\n)\n\nfunc GetSocketAddr(providerName string) string {\n\treturn fmt.Sprintf(\"\\\\\\\\.\\\\pipe\\\\devpod.%s\", providerName)\n}\n\nfunc Dial(addr string) (net.Conn, error) {\n\treturn npipe.DialTimeout(addr, 2*time.Second)\n}\n\nfunc listen(addr string) (net.Listener, error) {\n\treturn npipe.Listen(addr)\n}\n"
  },
  {
    "path": "pkg/daemon/platform/ts_server.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/envknob\"\n\t\"tailscale.com/ipn/store\"\n\t\"tailscale.com/tsnet\"\n\t\"tailscale.com/types/logger\"\n)\n\nfunc newTSServer(ctx context.Context, host, accessKey, userName, rootDir string, insecure bool, log log.Logger) (*tsnet.Server, *tailscale.LocalClient, error) {\n\t// Build the platform URL\n\tbaseUrl := url.URL{\n\t\tScheme: ts.GetEnvOrDefault(\"LOFT_TSNET_SCHEME\", \"https\"),\n\t\tHost:   ts.RemoveProtocol(host),\n\t}\n\tif err := ts.CheckDerpConnection(ctx, &baseUrl); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to verify DERP connection: %w\", err)\n\t}\n\tif insecure {\n\t\tenvknob.Setenv(\"TS_DEBUG_TLS_DIAL_INSECURE_SKIP_VERIFY\", \"true\")\n\t}\n\thostname, err := ts.GetClientHostname(userName)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"get hostname: %w\", err)\n\t}\n\tstatePath := filepath.Join(rootDir, provider.DaemonStateFile)\n\tstore, err := store.NewFileStore(logger.Discard, statePath)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"new state store: %w\", err)\n\t}\n\n\tlogPrefix := \"[ts] \"\n\tlogf := func(format string, args ...any) {\n\t\tif log.GetLevel() == logrus.DebugLevel {\n\t\t\tlog.Debugf(logPrefix+format, args...)\n\t\t}\n\t}\n\tuserLogf := func(format string, args ...any) {\n\t\tlog.Infof(logPrefix+format, args...)\n\t}\n\n\tserver := &tsnet.Server{\n\t\tHostname:   hostname,\n\t\tLogf:       logf,\n\t\tUserLogf:   userLogf,\n\t\tControlURL: baseUrl.String() + \"/coordinator/\",\n\t\tAuthKey:    accessKey,\n\t\tDir:        rootDir,\n\t\tEphemeral:  true,\n\t\tStore:      store,\n\t}\n\n\tlc, err := server.LocalClient()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn server, lc, nil\n}\n"
  },
  {
    "path": "pkg/daemon/platform/workspace_watcher.go",
    "content": "package daemon\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"runtime/debug\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\tloftclient \"github.com/loft-sh/api/v4/pkg/clientset/versioned\"\n\ttypedmanagementv1 \"github.com/loft-sh/api/v4/pkg/clientset/versioned/typed/management/v1\"\n\tinformers \"github.com/loft-sh/api/v4/pkg/informers/externalversions\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/ts\"\n\t\"github.com/loft-sh/log\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/client-go/rest\"\n\t\"k8s.io/client-go/tools/cache\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/ipn/ipnstate\"\n\t\"tailscale.com/tailcfg\"\n)\n\ntype ProWorkspaceInstance struct {\n\tmetav1.TypeMeta   `json:\",inline\"`\n\tmetav1.ObjectMeta `json:\"metadata,omitempty\"`\n\n\tSpec   managementv1.DevPodWorkspaceInstanceSpec `json:\"spec,omitempty\"`\n\tStatus ProWorkspaceInstanceStatus               `json:\"status,omitempty\"`\n}\n\ntype ProWorkspaceInstanceStatus struct {\n\tmanagementv1.DevPodWorkspaceInstanceStatus `json:\",inline\"`\n\n\tSource  *provider.WorkspaceSource       `json:\"source,omitempty\"`\n\tIDE     *provider.WorkspaceIDEConfig    `json:\"ide,omitempty\"`\n\tMetrics *WorkspaceNetworkMetricsSummary `json:\"metrics,omitempty\"`\n}\n\ntype watchConfig struct {\n\tContext        string\n\tProject        string\n\tPlatformClient client.Client\n\tTsClient       *tailscale.LocalClient\n\tOwnerFilter    platform.OwnerFilter\n\tLog            log.Logger\n}\n\ntype changeFn func(instanceList []*ProWorkspaceInstance)\n\nfunc startWorkspaceWatcher(ctx context.Context, config watchConfig, onChange changeFn) error {\n\tself := config.PlatformClient.Self()\n\tmanagementConfig, err := config.PlatformClient.ManagementConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclientset, err := getClientSet(managementConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstarted := &atomic.Bool{}\n\tfactory := informers.NewSharedInformerFactoryWithOptions(clientset, time.Second*10,\n\t\tinformers.WithNamespace(project.ProjectNamespace(config.Project)),\n\t)\n\tworkspaceInformer := factory.Management().V1().DevPodWorkspaceInstances()\n\tinstanceStore := newStore(self, config.Context, config.OwnerFilter, config.TsClient, config.Log)\n\t_, err = workspaceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{\n\t\tAddFunc: func(obj interface{}) {\n\t\t\tinstance, ok := obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tinstanceStore.Add(instance)\n\t\t\tif started.Load() {\n\t\t\t\tonChange(instanceStore.List())\n\t\t\t}\n\t\t},\n\t\tUpdateFunc: func(oldObj interface{}, newObj interface{}) {\n\t\t\toldInstance, ok := oldObj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tnewInstance, ok := newObj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tinstanceStore.Update(oldInstance, newInstance)\n\t\t\tif started.Load() {\n\t\t\t\tonChange(instanceStore.List())\n\t\t\t}\n\t\t},\n\t\tDeleteFunc: func(obj interface{}) {\n\t\t\tinstance, ok := obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\tif !ok {\n\t\t\t\t// check for DeletedFinalStateUnknown. Can happen if the informer misses the delete event\n\t\t\t\tu, ok := obj.(cache.DeletedFinalStateUnknown)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tinstance, ok = u.Obj.(*managementv1.DevPodWorkspaceInstance)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tinstanceStore.Delete(instance)\n\t\t\tif started.Load() {\n\t\t\t\tonChange(instanceStore.List())\n\t\t\t}\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tdefer func() {\n\t\t\tif err := recover(); err != nil {\n\t\t\t\tconfig.Log.Errorf(\"panic in workspace watcher: %v\\n%s\", err, debug.Stack())\n\t\t\t}\n\t\t}()\n\n\t\tconfig.Log.Info(\"starting workspace watcher\")\n\t\tfactory.Start(ctx.Done())\n\t\tfactory.WaitForCacheSync(ctx.Done())\n\t\tstarted.Store(true)\n\n\t\t// Kick off initial message\n\t\tonChange(instanceStore.List())\n\n\t\t// periodically collect workspace metrics\n\t\tinstanceStore.collectWorkspaceMetrics(ctx, onChange)\n\t}()\n\n\t<-ctx.Done()\n\tconfig.Log.Debug(\"workspace watcher done\")\n\treturn nil\n}\n\ntype instanceStore struct {\n\tself        *managementv1.Self\n\tcontext     string\n\townerFilter platform.OwnerFilter\n\n\tm         sync.Mutex\n\tinstances map[string]*ProWorkspaceInstance\n\ttsClient  *tailscale.LocalClient\n\n\tmetricsMu        sync.RWMutex\n\tmetrics          map[string][]WorkspaceNetworkMetrics\n\tmaxMetricSamples int\n\n\tlog log.Logger\n}\n\ntype ConnectionType string\n\nconst (\n\tConnectionTypeDirect ConnectionType = \"direct\"\n\tConnectionTypeDERP   ConnectionType = \"DERP\"\n)\n\ntype WorkspaceNetworkMetricsSummary struct {\n\tLatencyMs          float64        `json:\"latencyMs,omitempty\"`\n\tLastConnectionType ConnectionType `json:\"connectionType,omitempty\"`\n\tLastDERPRegion     string         `json:\"derpRegion,omitempty\"`\n}\n\ntype WorkspaceNetworkMetrics struct {\n\tLatencyMs      float64        `json:\"latencyMs,omitempty\"`\n\tConnectionType ConnectionType `json:\"connectionType,omitempty\"`\n\tDERPRegion     string         `json:\"derpRegion,omitempty\"`\n\tTimestamp      int64          `json:\"timestamp,omitempty\"`\n}\n\nfunc newStore(self *managementv1.Self, context string, ownerFilter platform.OwnerFilter, tsClient *tailscale.LocalClient, log log.Logger) *instanceStore {\n\treturn &instanceStore{\n\t\tself:             self,\n\t\tcontext:          context,\n\t\tinstances:        map[string]*ProWorkspaceInstance{},\n\t\townerFilter:      ownerFilter,\n\t\ttsClient:         tsClient,\n\t\tmetrics:          map[string][]WorkspaceNetworkMetrics{},\n\t\tmaxMetricSamples: 6,\n\t\tlog:              log,\n\t}\n}\n\nfunc (s *instanceStore) key(namespace, name string) string {\n\treturn fmt.Sprintf(\"%s/%s\", namespace, name)\n}\n\nfunc (s *instanceStore) Add(instance *managementv1.DevPodWorkspaceInstance) {\n\tif s.ownerFilter == platform.SelfOwnerFilter && !platform.IsOwner(s.self, instance.GetOwner()) {\n\t\treturn\n\t}\n\tvar source *provider.WorkspaceSource\n\tif instance.GetAnnotations() != nil && instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation] != \"\" {\n\t\tsource = provider.ParseWorkspaceSource(instance.GetAnnotations()[storagev1.DevPodWorkspaceSourceAnnotation])\n\t}\n\n\tvar ideConfig *provider.WorkspaceIDEConfig\n\tif instance.GetLabels() != nil && instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel] != \"\" {\n\t\tid := instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel]\n\t\tworkspaceConfig, err := provider.LoadWorkspaceConfig(s.context, id)\n\t\tif err == nil {\n\t\t\tideConfig = &workspaceConfig.IDE\n\t\t}\n\t}\n\n\tproInstance := &ProWorkspaceInstance{\n\t\tTypeMeta:   instance.TypeMeta,\n\t\tObjectMeta: instance.ObjectMeta,\n\t\tSpec:       instance.Spec,\n\t\tStatus: ProWorkspaceInstanceStatus{\n\t\t\tDevPodWorkspaceInstanceStatus: instance.Status,\n\t\t\tSource:                        source,\n\t\t\tIDE:                           ideConfig,\n\t\t},\n\t}\n\n\tkey := s.key(instance.ObjectMeta.Namespace, instance.ObjectMeta.Name)\n\ts.m.Lock()\n\ts.instances[key] = proInstance\n\ts.m.Unlock()\n}\n\nfunc (s *instanceStore) Update(oldInstance *managementv1.DevPodWorkspaceInstance, newInstance *managementv1.DevPodWorkspaceInstance) {\n\tif s.ownerFilter == platform.SelfOwnerFilter && !platform.IsOwner(s.self, newInstance.GetOwner()) {\n\t\treturn\n\t}\n\ts.Add(newInstance)\n}\n\nfunc (s *instanceStore) Delete(instance *managementv1.DevPodWorkspaceInstance) {\n\tif s.ownerFilter == platform.SelfOwnerFilter && !platform.IsOwner(s.self, instance.GetOwner()) {\n\t\treturn\n\t}\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\tkey := s.key(instance.ObjectMeta.Namespace, instance.ObjectMeta.Name)\n\tdelete(s.instances, key)\n\n\t// delete from metrics as well\n\ts.metricsMu.Lock()\n\tdefer s.metricsMu.Unlock()\n\tdelete(s.metrics, key)\n}\n\nfunc (s *instanceStore) List() []*ProWorkspaceInstance {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\n\tinstanceList := []*ProWorkspaceInstance{}\n\tfor _, instance := range s.instances {\n\t\tinstanceList = append(instanceList, s.convert(instance))\n\t}\n\n\treturn instanceList\n}\n\nfunc (s *instanceStore) convert(instance *ProWorkspaceInstance) *ProWorkspaceInstance {\n\tif instance == nil {\n\t\treturn nil\n\t}\n\n\ts.metricsMu.RLock()\n\tdefer s.metricsMu.RUnlock()\n\n\tmetrics := s.metrics[s.key(instance.ObjectMeta.Namespace, instance.ObjectMeta.Name)]\n\tif len(metrics) > 0 {\n\t\ttotalMetrics := len(metrics)\n\t\t// calculate average latency\n\t\tvar totalLatency float64\n\t\tfor _, metric := range metrics {\n\t\t\ttotalLatency += metric.LatencyMs\n\t\t}\n\t\tavgLatency := totalLatency / float64(totalMetrics)\n\n\t\tinstance.Status.Metrics = &WorkspaceNetworkMetricsSummary{\n\t\t\tLatencyMs:          avgLatency,\n\t\t\tLastConnectionType: metrics[totalMetrics-1].ConnectionType,\n\t\t\tLastDERPRegion:     metrics[totalMetrics-1].DERPRegion,\n\t\t}\n\t}\n\n\treturn instance\n}\n\nfunc (s *instanceStore) collectWorkspaceMetrics(ctx context.Context, onChange changeFn) {\n\tticker := time.NewTicker(15 * time.Second)\n\tdefer ticker.Stop()\n\n\t// let's kick it off once\n\ts.updateWorkspaceLatencies(ctx)\n\tonChange(s.List())\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\ts.updateWorkspaceLatencies(ctx)\n\t\t\tonChange(s.List())\n\t\t}\n\t}\n}\n\nfunc (s *instanceStore) updateWorkspaceLatencies(ctx context.Context) {\n\tstatus, err := s.tsClient.Status(ctx)\n\tif err != nil {\n\t\ts.log.Errorf(\"Failed to get tailscale status: %v\", err)\n\t\treturn\n\t}\n\n\tvar wg sync.WaitGroup\n\tfor _, peer := range status.Peer {\n\t\tif len(peer.TailscaleIPs) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tinstanceName, projectName, err := ts.ParseWorkspaceHostname(peer.HostName)\n\t\tif err != nil {\n\t\t\ts.log.Debugf(\"failed to parse hostname for peer %s: %v\", peer.HostName, err)\n\t\t\tcontinue\n\t\t}\n\t\tkey := fmt.Sprintf(\"%s/%s\", project.ProjectNamespace(projectName), instanceName)\n\t\ts.m.Lock()\n\t\tinstance := s.instances[key]\n\t\ts.m.Unlock()\n\t\tif instance == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tgo func(peer *ipnstate.PeerStatus, key string, instance *ProWorkspaceInstance) {\n\t\t\tdefer wg.Done()\n\n\t\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\t\t\tdefer cancel()\n\n\t\t\ts.log.Debugf(\"pinging workspace %s/%s\", instance.GetNamespace(), instance.GetName())\n\t\t\tpingResult, err := s.tsClient.Ping(timeoutCtx, peer.TailscaleIPs[0], tailcfg.PingDisco)\n\t\t\tif err != nil {\n\t\t\t\ts.log.Debugf(\"Failed to ping workspace %s/%s: %v\", instance.GetNamespace(), instance.GetName(), err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif pingResult.Err != \"\" {\n\t\t\t\ts.log.Debugf(\"Failed to ping workspace %s/%s: %v\", instance.GetNamespace(), instance.GetName(), pingResult.Err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Determine connection type\n\t\t\tconnectionType := ConnectionTypeDirect\n\t\t\tderpRegion := \"\"\n\t\t\tif pingResult.DERPRegionID != 0 {\n\t\t\t\tconnectionType = ConnectionTypeDERP\n\t\t\t\tderpRegion = pingResult.DERPRegionCode\n\t\t\t}\n\n\t\t\ts.metricsMu.Lock()\n\t\t\ts.metrics[key] = append(\n\t\t\t\ts.metrics[key],\n\t\t\t\tWorkspaceNetworkMetrics{\n\t\t\t\t\tLatencyMs:      pingResult.LatencySeconds * 1000,\n\t\t\t\t\tConnectionType: connectionType,\n\t\t\t\t\tDERPRegion:     derpRegion,\n\t\t\t\t\tTimestamp:      time.Now().Unix(),\n\t\t\t\t},\n\t\t\t)\n\t\t\t// trim down to max samples if necessary\n\t\t\tif len(s.metrics[key]) > s.maxMetricSamples {\n\t\t\t\ts.metrics[key] = s.metrics[key][1:]\n\t\t\t}\n\t\t\ts.metricsMu.Unlock()\n\t\t}(peer, key, instance)\n\t}\n\n\twg.Wait()\n}\n\nfunc getClientSet(config *rest.Config) (loftclient.Interface, error) {\n\tclientset, err := loftclient.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmv1 := clientset.ManagementV1()\n\tc := typedmanagementv1.New(&extendedRESTClient{Interface: mv1.RESTClient()})\n\n\treturn &extendedClientset{\n\t\tClientset:        clientset,\n\t\tManagementClient: c,\n\t}, nil\n}\n\nvar _ rest.Interface = (*extendedRESTClient)(nil)\n\ntype extendedClientset struct {\n\t*loftclient.Clientset\n\tManagementClient typedmanagementv1.ManagementV1Interface\n}\n\nfunc (c *extendedClientset) ManagementV1() typedmanagementv1.ManagementV1Interface {\n\treturn c.ManagementClient\n}\n\ntype extendedRESTClient struct {\n\trest.Interface\n}\n\nfunc (e *extendedRESTClient) Get() *rest.Request {\n\treq := e.Interface.Get()\n\t// We need to pass this to the backend for more information on the management CRD status\n\treq.Param(\"extended\", \"true\")\n\treq.Param(\"resync\", \"10\") // resync every 10 seconds in the watch request\n\n\treturn req\n}\n"
  },
  {
    "path": "pkg/devcontainer/build/options.go",
    "content": "package build\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/metadata\"\n\t\"github.com/loft-sh/devpod/pkg/dockerfile\"\n\t\"github.com/loft-sh/devpod/pkg/id\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log/hash\"\n\t\"github.com/pkg/errors\"\n)\n\ntype BuildOptions struct {\n\tBuildArgs map[string]string\n\tLabels    map[string]string\n\n\tCliOpts []string\n\n\tImages    []string\n\tCacheFrom []string\n\tCacheTo   []string\n\n\tDockerfile string\n\tContext    string\n\tContexts   map[string]string\n\n\tTarget string\n\n\tLoad   bool\n\tPush   bool\n\tUpload bool\n}\n\nfunc NewOptions(\n\tdockerfilePath, dockerfileContent string,\n\tparsedConfig *config.SubstitutedConfig,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n\timageName string,\n\toptions provider.BuildOptions,\n\tprebuildHash string,\n) (*BuildOptions, error) {\n\tvar err error\n\n\t// extra args?\n\tbuildOptions := &BuildOptions{\n\t\tLabels:   map[string]string{},\n\t\tContexts: map[string]string{},\n\t\tLoad:     true,\n\t}\n\n\t// get build args and target\n\tbuildOptions.BuildArgs, buildOptions.Target = GetBuildArgsAndTarget(parsedConfig, extendedBuildInfo)\n\n\t// get cli options\n\tbuildOptions.CliOpts = parsedConfig.Config.GetOptions()\n\n\t// get extended build info\n\tbuildOptions.Dockerfile, err = RewriteDockerfile(dockerfileContent, extendedBuildInfo)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if buildOptions.Dockerfile == \"\" {\n\t\tbuildOptions.Dockerfile = dockerfilePath\n\t}\n\n\t// add label\n\tif extendedBuildInfo != nil && extendedBuildInfo.MetadataLabel != \"\" {\n\t\tbuildOptions.Labels[metadata.ImageMetadataLabel] = extendedBuildInfo.MetadataLabel\n\t}\n\n\t// other options\n\tif imageName != \"\" {\n\t\tbuildOptions.Images = append(buildOptions.Images, imageName)\n\t}\n\tif options.Repository != \"\" {\n\t\tbuildOptions.Images = append(buildOptions.Images, options.Repository+\":\"+prebuildHash)\n\t}\n\tfor _, prebuildRepository := range options.PrebuildRepositories {\n\t\tbuildOptions.Images = append(buildOptions.Images, prebuildRepository+\":\"+prebuildHash)\n\t}\n\tbuildOptions.Context = config.GetContextPath(parsedConfig.Config)\n\n\t// add build arg\n\tif buildOptions.BuildArgs == nil {\n\t\tbuildOptions.BuildArgs = map[string]string{}\n\t}\n\n\t// define cache args\n\tif options.RegistryCache != \"\" {\n\t\tbuildOptions.CacheFrom = []string{fmt.Sprintf(\"type=registry,ref=%s\", options.RegistryCache)}\n\t\t// only export cache on build not up, otherwise we slow down the workspace start time\n\t\tif options.ExportCache {\n\t\t\tbuildOptions.CacheTo = []string{fmt.Sprintf(\"type=registry,ref=%s,mode=max,image-manifest=true\", options.RegistryCache)}\n\t\t}\n\t} else {\n\t\tbuildOptions.BuildArgs[\"BUILDKIT_INLINE_CACHE\"] = \"1\"\n\t}\n\n\treturn buildOptions, nil\n}\n\nfunc GetBuildArgsAndTarget(\n\tparsedConfig *config.SubstitutedConfig,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n) (map[string]string, string) {\n\tbuildArgs := map[string]string{}\n\tfor k, v := range parsedConfig.Config.GetArgs() {\n\t\tbuildArgs[k] = v\n\t}\n\n\t// get extended build info\n\tif extendedBuildInfo != nil && extendedBuildInfo.FeaturesBuildInfo != nil {\n\t\tfeatureBuildInfo := extendedBuildInfo.FeaturesBuildInfo\n\n\t\t// track additional build args to include below\n\t\tfor k, v := range featureBuildInfo.BuildArgs {\n\t\t\tbuildArgs[k] = v\n\t\t}\n\t}\n\n\ttarget := \"\"\n\tif extendedBuildInfo != nil && extendedBuildInfo.FeaturesBuildInfo != nil && extendedBuildInfo.FeaturesBuildInfo.OverrideTarget != \"\" {\n\t\ttarget = extendedBuildInfo.FeaturesBuildInfo.OverrideTarget\n\t} else if parsedConfig.Config.GetTarget() != \"\" {\n\t\ttarget = parsedConfig.Config.GetTarget()\n\t}\n\n\treturn buildArgs, target\n}\n\nfunc RewriteDockerfile(\n\tdockerfileContent string,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n) (string, error) {\n\tif extendedBuildInfo != nil && extendedBuildInfo.FeaturesBuildInfo != nil {\n\t\tfeatureBuildInfo := extendedBuildInfo.FeaturesBuildInfo\n\n\t\t// rewrite dockerfile\n\t\tfinalDockerfileContent := dockerfile.RemoveSyntaxVersion(dockerfileContent)\n\t\tfinalDockerfileContent = strings.TrimSpace(strings.Join([]string{\n\t\t\tfeatureBuildInfo.DockerfilePrefixContent,\n\t\t\tstrings.TrimSpace(finalDockerfileContent),\n\t\t\tfeatureBuildInfo.DockerfileContent,\n\t\t}, \"\\n\"))\n\n\t\t// write dockerfile with features\n\t\tfinalDockerfilePath := filepath.Join(featureBuildInfo.FeaturesFolder, \"Dockerfile-with-features\")\n\t\terr := os.WriteFile(finalDockerfilePath, []byte(finalDockerfileContent), 0600)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"write Dockerfile with features\")\n\t\t}\n\n\t\treturn finalDockerfilePath, nil\n\t}\n\n\treturn \"\", nil\n}\n\nfunc GetImageName(localWorkspaceFolder, prebuildHash string) string {\n\timageHash := hash.String(localWorkspaceFolder)[:5]\n\treturn id.ToDockerImageName(filepath.Base(localWorkspaceFolder)) + \"-\" + imageHash + \":\" + prebuildHash\n}\n"
  },
  {
    "path": "pkg/devcontainer/build.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/buildkit\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/metadata\"\n\t\"github.com/loft-sh/devpod/pkg/dockerfile\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc (r *runner) build(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\tif isDockerFileConfig(parsedConfig.Config) {\n\t\treturn r.buildAndExtendImage(ctx, parsedConfig, substitutionContext, options)\n\t} else if isDockerComposeConfig(parsedConfig.Config) {\n\t\treturn r.buildDevImageCompose(ctx, parsedConfig, substitutionContext, options)\n\t}\n\n\treturn r.extendImage(ctx, parsedConfig, substitutionContext, options)\n}\n\nfunc (r *runner) extendImage(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\timageBase := parsedConfig.Config.Image\n\timageBuildInfo, err := r.getImageBuildInfoFromImage(ctx, substitutionContext, imageBase)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image build info\")\n\t}\n\n\t// get extend image build info\n\textendedBuildInfo, err := feature.GetExtendedBuildInfo(substitutionContext, imageBuildInfo, imageBase, parsedConfig, r.Log, options.ForceBuild)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get extended build info\")\n\t}\n\n\t// no need to build here\n\tif extendedBuildInfo == nil || extendedBuildInfo.FeaturesBuildInfo == nil {\n\t\treturn &config.BuildInfo{\n\t\t\tImageDetails:  imageBuildInfo.ImageDetails,\n\t\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\t\tImageName:     imageBase,\n\t\t\tRegistryCache: options.RegistryCache,\n\t\t\tTags:          options.Tag,\n\t\t}, nil\n\t}\n\n\t// build the image\n\treturn r.buildImage(ctx, parsedConfig, substitutionContext, imageBuildInfo, extendedBuildInfo, \"\", \"\", options)\n}\n\nfunc (r *runner) buildAndExtendImage(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\tdockerFilePath, err := r.getDockerfilePath(parsedConfig.Config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdockerFileContent, err := os.ReadFile(dockerFilePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// ensure there is a target to choose for us\n\tvar imageBase string\n\tif parsedConfig.Config.GetTarget() != \"\" {\n\t\timageBase = parsedConfig.Config.GetTarget()\n\t} else {\n\t\tlastTargetName, modifiedDockerfileContents, err := dockerfile.EnsureDockerfileHasFinalStageName(string(dockerFileContent), config.DockerfileDefaultTarget)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t} else if modifiedDockerfileContents != \"\" {\n\t\t\tdockerFileContent = []byte(modifiedDockerfileContents)\n\t\t}\n\n\t\timageBase = lastTargetName\n\t}\n\n\t// get image build info\n\timageBuildInfo, err := r.getImageBuildInfoFromDockerfile(substitutionContext, string(dockerFileContent), parsedConfig.Config.GetArgs(), parsedConfig.Config.GetTarget())\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image build info\")\n\t}\n\n\t// get extend image build info\n\textendedBuildInfo, err := feature.GetExtendedBuildInfo(substitutionContext, imageBuildInfo, imageBase, parsedConfig, r.Log, options.ForceBuild)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get extended build info\")\n\t}\n\n\t// build the image\n\treturn r.buildImage(ctx, parsedConfig, substitutionContext, imageBuildInfo, extendedBuildInfo, dockerFilePath, string(dockerFileContent), options)\n}\n\nfunc (r *runner) getDockerfilePath(parsedConfig *config.DevContainerConfig) (string, error) {\n\tif parsedConfig.Origin == \"\" {\n\t\treturn \"\", fmt.Errorf(\"couldn't find path where config was loaded from\")\n\t}\n\n\tconfigFileDir := filepath.Dir(parsedConfig.Origin)\n\n\tdockerfilePath := filepath.Join(configFileDir, parsedConfig.GetDockerfile())\n\t_, err := os.Stat(dockerfilePath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"couldn't find Dockerfile at %s\", dockerfilePath)\n\t}\n\n\treturn dockerfilePath, nil\n}\n\nfunc (r *runner) getImageBuildInfoFromImage(ctx context.Context, substitutionContext *config.SubstitutionContext, imageName string) (*config.ImageBuildInfo, error) {\n\timageDetails, err := r.inspectImage(ctx, imageName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuser := \"root\"\n\tif imageDetails.Config.User != \"\" {\n\t\tuser = imageDetails.Config.User\n\t}\n\n\timageMetadata, err := metadata.GetImageMetadata(imageDetails, substitutionContext, r.Log)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image metadata\")\n\t}\n\n\treturn &config.ImageBuildInfo{\n\t\tImageDetails: imageDetails,\n\t\tUser:         user,\n\t\tMetadata:     imageMetadata,\n\t}, nil\n}\n\nfunc (r *runner) getImageBuildInfoFromDockerfile(substitutionContext *config.SubstitutionContext, dockerFileContent string, buildArgs map[string]string, target string) (*config.ImageBuildInfo, error) {\n\tparsedDockerfile, err := dockerfile.Parse(dockerFileContent)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse dockerfile\")\n\t}\n\n\t// Check that the build target specified in the devcontainer.json exists in the Dockerfile\n\tif target != \"\" && parsedDockerfile.StagesByTarget != nil {\n\t\t_, ok := parsedDockerfile.StagesByTarget[target]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"build target does not exist\")\n\t\t}\n\t}\n\n\tbaseImage := parsedDockerfile.FindBaseImage(buildArgs, target)\n\tif baseImage == \"\" {\n\t\treturn nil, fmt.Errorf(\"find base image %s\", target)\n\t}\n\n\timageDetails, err := r.inspectImage(context.TODO(), baseImage)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"inspect image %s\", baseImage)\n\t}\n\n\t// find user\n\tuser := parsedDockerfile.FindUserStatement(buildArgs, config.ListToObject(imageDetails.Config.Env), target)\n\tif user == \"\" {\n\t\tuser = imageDetails.Config.User\n\t}\n\tif user == \"\" {\n\t\tuser = \"root\"\n\t}\n\n\t// parse metadata from image details\n\timageMetadataConfig, err := metadata.GetImageMetadata(imageDetails, substitutionContext, r.Log)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image metadata\")\n\t}\n\n\treturn &config.ImageBuildInfo{\n\t\tDockerfile: parsedDockerfile,\n\t\tUser:       user,\n\t\tMetadata:   imageMetadataConfig,\n\t}, nil\n}\n\nfunc (r *runner) buildImage(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tbuildInfo *config.ImageBuildInfo,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n\tdockerfilePath,\n\tdockerfileContent string,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\ttargetArch, err := r.Driver.TargetArchitecture(ctx, r.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprebuildHash, err := config.CalculatePrebuildHash(parsedConfig.Config, options.Platform, targetArch, config.GetContextPath(parsedConfig.Config), dockerfilePath, dockerfileContent, buildInfo, r.Log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check if there is a prebuild image\n\tif !options.ForceDockerless && !options.ForceBuild {\n\t\tdevPodCustomizations := config.GetDevPodCustomizations(parsedConfig.Config)\n\t\tif options.Repository != \"\" {\n\t\t\toptions.PrebuildRepositories = append(options.PrebuildRepositories, options.Repository)\n\t\t}\n\t\toptions.PrebuildRepositories = append(options.PrebuildRepositories, devPodCustomizations.PrebuildRepository...)\n\n\t\tr.Log.Debugf(\"Try to find prebuild image %s in repositories %s\", prebuildHash, strings.Join(options.PrebuildRepositories, \",\"))\n\t\tfor _, prebuildRepo := range options.PrebuildRepositories {\n\t\t\tprebuildImage := prebuildRepo + \":\" + prebuildHash\n\t\t\timg, err := image.GetImageForArch(ctx, prebuildImage, targetArch)\n\t\t\tif err == nil && img != nil {\n\t\t\t\t// prebuild image found\n\t\t\t\tr.Log.Infof(\"Found existing prebuilt image %s\", prebuildImage)\n\n\t\t\t\t// inspect image\n\t\t\t\timageDetails, err := r.inspectImage(ctx, prebuildImage)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"get image details\")\n\t\t\t\t}\n\n\t\t\t\treturn &config.BuildInfo{\n\t\t\t\t\tImageDetails:  imageDetails,\n\t\t\t\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\t\t\t\tImageName:     prebuildImage,\n\t\t\t\t\tPrebuildHash:  prebuildHash,\n\t\t\t\t\tRegistryCache: options.RegistryCache,\n\t\t\t\t\tTags:          options.Tag,\n\t\t\t\t}, nil\n\t\t\t} else if err != nil {\n\t\t\t\tr.Log.Debugf(\"Error trying to find prebuild image %s: %v\", prebuildImage, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tif options.CLIOptions.Platform.Enabled {\n\t\tbuildInfo, err := buildkit.BuildRemote(ctx, prebuildHash, parsedConfig, extendedBuildInfo, dockerfilePath, dockerfileContent, r.LocalWorkspaceFolder, options, targetArch, r.Log)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"(remote) %w\", err)\n\t\t}\n\n\t\treturn buildInfo, nil\n\t}\n\n\t// check if we should fallback to dockerless.\n\t// This should only be OSS kubernetes as of March 06, 2025.\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif options.ForceDockerless || !ok {\n\t\tif r.WorkspaceConfig.Agent.Dockerless.Disabled == \"true\" {\n\t\t\treturn nil, fmt.Errorf(\"cannot build devcontainer because driver is non-docker and dockerless fallback is disabled\")\n\t\t}\n\n\t\treturn dockerlessFallback(r.LocalWorkspaceFolder, substitutionContext.ContainerWorkspaceFolder, parsedConfig, buildInfo, extendedBuildInfo, dockerfileContent, options)\n\t}\n\n\treturn dockerDriver.BuildDevContainer(ctx, prebuildHash, parsedConfig, extendedBuildInfo, dockerfilePath, dockerfileContent, r.LocalWorkspaceFolder, options)\n}\n\nfunc (r *runner) buildDevImageCompose(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\tcomposeHelper, err := r.composeHelper()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"find docker compose\")\n\t}\n\n\tenvFiles, err := r.getEnvFiles()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get env files\")\n\t}\n\n\tcomposeFiles, err := r.getDockerComposeFilePaths(parsedConfig, envFiles)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get docker compose file paths\")\n\t}\n\n\tvar composeGlobalArgs []string\n\tfor _, configFile := range composeFiles {\n\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"-f\", configFile)\n\t}\n\n\tfor _, envFile := range envFiles {\n\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"--env-file\", envFile)\n\t}\n\n\tr.Log.Debugf(\"Loading docker compose project %+v\", composeFiles)\n\tproject, err := compose.LoadDockerComposeProject(ctx, composeFiles, envFiles)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"load docker compose project\")\n\t}\n\tproject.Name = composeHelper.GetProjectName(r.ID)\n\tr.Log.Debugf(\"Loaded project %s\", project.Name)\n\n\tservice := parsedConfig.Config.Service\n\tcomposeService, err := project.GetService(service)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"service '%s' configured in devcontainer.json not found in Docker Compose configuration\", service)\n\t}\n\n\toriginalImageName := composeService.Image\n\tif originalImageName == \"\" {\n\t\toriginalImageName, err = composeHelper.GetDefaultImage(project.Name, service)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"get default image\")\n\t\t}\n\t}\n\n\toverrideBuildImageName, _, imageMetadata, _, err := r.buildAndExtendDockerCompose(ctx, parsedConfig, substitutionContext, project, composeHelper, &composeService, composeGlobalArgs)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"build and extend docker-compose\")\n\t}\n\n\tcurrentImageName := overrideBuildImageName\n\tif currentImageName == \"\" {\n\t\tcurrentImageName = originalImageName\n\t}\n\n\timageDetails, err := r.inspectImage(ctx, currentImageName)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"inspect image\")\n\t}\n\n\t// have a fallback value for PrebuildHash\n\t// we don't calculate prebuild hash on docker compose builds\n\t// let's use Images :tag then\n\timageTag, err := r.getImageTag(ctx, imageDetails.ID)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"inspect image\")\n\t}\n\n\treturn &config.BuildInfo{\n\t\tImageDetails:  imageDetails,\n\t\tImageMetadata: imageMetadata,\n\t\tImageName:     overrideBuildImageName,\n\t\tPrebuildHash:  imageTag,\n\t\tRegistryCache: options.RegistryCache,\n\t\tTags:          options.Tag,\n\t}, nil\n}\n\nfunc dockerlessFallback(\n\tlocalWorkspaceFolder,\n\tcontainerWorkspaceFolder string,\n\tparsedConfig *config.SubstitutedConfig,\n\tbuildInfo *config.ImageBuildInfo,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n\tdockerfileContent string,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\tcontextPath := config.GetContextPath(parsedConfig.Config)\n\tdevPodInternalFolder := filepath.Join(contextPath, config.DevPodContextFeatureFolder)\n\terr := os.MkdirAll(devPodInternalFolder, 0755)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create devpod folder: %w\", err)\n\t}\n\n\t// build dockerfile\n\tdevPodDockerfile, err := build.RewriteDockerfile(dockerfileContent, extendedBuildInfo)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"rewrite dockerfile: %w\", err)\n\t} else if devPodDockerfile == \"\" {\n\t\tdevPodDockerfile = filepath.Join(devPodInternalFolder, \"Dockerfile-without-features\")\n\t\terr = os.WriteFile(devPodDockerfile, []byte(dockerfileContent), 0600)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"write devpod dockerfile: %w\", err)\n\t\t}\n\t}\n\n\t// get build args and target\n\tcontainerContext, containerDockerfile := getContainerContextAndDockerfile(localWorkspaceFolder, containerWorkspaceFolder, contextPath, devPodDockerfile)\n\tbuildArgs, target := build.GetBuildArgsAndTarget(parsedConfig, extendedBuildInfo)\n\treturn &config.BuildInfo{\n\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\tDockerless: &config.BuildInfoDockerless{\n\t\t\tContext:    containerContext,\n\t\t\tDockerfile: containerDockerfile,\n\n\t\t\tBuildArgs: buildArgs,\n\t\t\tTarget:    target,\n\n\t\t\tUser: buildInfo.User,\n\t\t},\n\t\tRegistryCache: options.RegistryCache,\n\t\tTags:          options.Tag,\n\t}, nil\n}\n\nfunc getContainerContextAndDockerfile(localWorkspaceFolder, containerWorkspaceFolder, contextPath, devPodDockerfile string) (string, string) {\n\tprefixPath := path.Clean(filepath.ToSlash(localWorkspaceFolder))\n\tcontainerContext := path.Join(containerWorkspaceFolder, strings.TrimPrefix(path.Clean(filepath.ToSlash(contextPath)), prefixPath))\n\tcontainerDockerfile := path.Join(containerWorkspaceFolder, strings.TrimPrefix(path.Clean(filepath.ToSlash(devPodDockerfile)), prefixPath))\n\treturn containerContext, containerDockerfile\n}\n\nfunc cleanupBuildInformation(c *config.DevContainerConfig) {\n\tcontextPath := config.GetContextPath(c)\n\t_ = os.RemoveAll(filepath.Join(contextPath, config.DevPodContextFeatureFolder))\n}\n"
  },
  {
    "path": "pkg/devcontainer/build_test.go",
    "content": "package devcontainer\n\nimport (\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n)\n\nfunc TestFallbackContainerContextAndDockerfile(t *testing.T) {\n\ttestCases := []struct {\n\t\tname string\n\n\t\tlocalFolder  string\n\t\tremoteFolder string\n\t\tcontext      string\n\t\tdockerfile   string\n\n\t\texpectedContext    string\n\t\texpectedDockerfile string\n\t}{\n\t\t{\n\t\t\tname: \"simple\",\n\n\t\t\tlocalFolder:  \"/my/local/folder\",\n\t\t\tremoteFolder: \"/workspaces/test\",\n\t\t\tcontext:      \"/my/local/folder/context\",\n\t\t\tdockerfile:   \"/my/local/folder/Dockerfile\",\n\n\t\t\texpectedContext:    \"/workspaces/test/context\",\n\t\t\texpectedDockerfile: \"/workspaces/test/Dockerfile\",\n\t\t},\n\t\t{\n\t\t\tname: \"windows\",\n\n\t\t\tlocalFolder:  \"C:/my/local/folder\",\n\t\t\tremoteFolder: \"/workspaces/test\",\n\t\t\tcontext:      \"C:/my/local/folder\",\n\t\t\tdockerfile:   \"C:/my/local/folder/Dockerfile\",\n\n\t\t\texpectedContext:    \"/workspaces/test\",\n\t\t\texpectedDockerfile: \"/workspaces/test/Dockerfile\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\toutContext, outDockerfile := getContainerContextAndDockerfile(testCase.localFolder, testCase.remoteFolder, testCase.context, testCase.dockerfile)\n\t\tassert.Equal(t, outContext, testCase.expectedContext, testCase.name)\n\t\tassert.Equal(t, outDockerfile, testCase.expectedDockerfile, testCase.name)\n\t}\n}\n"
  },
  {
    "path": "pkg/devcontainer/buildkit/buildkit.go",
    "content": "package buildkit\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/log\"\n\tbuildkit \"github.com/moby/buildkit/client\"\n\t\"github.com/moby/buildkit/session\"\n\t\"github.com/moby/buildkit/session/auth/authprovider\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc Build(ctx context.Context, client *buildkit.Client, writer io.Writer, platform string, options *build.BuildOptions, log log.Logger) error {\n\tdockerConfig, err := docker.LoadDockerConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// cache from\n\tcacheFrom, err := ParseCacheEntry(options.CacheFrom)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcacheTo, err := ParseCacheEntry(options.CacheTo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// is context stream?\n\tattachable := []session.Attachable{}\n\tattachable = append(attachable, authprovider.NewDockerAuthProvider(authprovider.DockerAuthProviderConfig{ConfigFile: dockerConfig}))\n\n\t// create solve options\n\tsolveOptions := buildkit.SolveOpt{\n\t\tFrontend: \"dockerfile.v0\",\n\t\tFrontendAttrs: map[string]string{\n\t\t\t\"filename\": filepath.Base(options.Dockerfile),\n\t\t\t\"context\":  options.Context,\n\t\t},\n\t\tSession:      attachable,\n\t\tCacheImports: cacheFrom,\n\t\tCacheExports: cacheTo,\n\t}\n\n\t// set options target\n\tif options.Target != \"\" {\n\t\tsolveOptions.FrontendAttrs[\"target\"] = options.Target\n\t}\n\n\t// add platforms\n\tif platform != \"\" {\n\t\tsolveOptions.FrontendAttrs[\"platform\"] = platform\n\t}\n\n\t// add context and dockerfile to local dirs\n\tsolveOptions.LocalDirs = map[string]string{}\n\tsolveOptions.LocalDirs[\"context\"] = options.Context\n\tsolveOptions.LocalDirs[\"dockerfile\"] = filepath.Dir(options.Dockerfile)\n\n\t// multi contexts\n\tfor k, v := range options.Contexts {\n\t\tst, err := os.Stat(v)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"failed to get build context %v\", k)\n\t\t}\n\t\tif !st.IsDir() {\n\t\t\treturn fmt.Errorf(\"build context '%s' is not a directory\", v)\n\t\t}\n\t\tlocalName := k\n\t\tif k == \"context\" || k == \"dockerfile\" {\n\t\t\tlocalName = \"_\" + k // underscore to avoid collisions\n\t\t}\n\t\tsolveOptions.LocalDirs[localName] = v\n\t\tsolveOptions.FrontendAttrs[\"context:\"+k] = \"local:\" + localName\n\t}\n\n\t// load?\n\tif options.Load {\n\t\tsolveOptions.Exports = append(solveOptions.Exports, buildkit.ExportEntry{\n\t\t\tType: \"moby\",\n\t\t\tAttrs: map[string]string{\n\t\t\t\t\"name\": strings.Join(options.Images, \",\"),\n\t\t\t},\n\t\t})\n\t} else if options.Push {\n\t\tsolveOptions.Exports = append(solveOptions.Exports, buildkit.ExportEntry{\n\t\t\tType: \"image\",\n\t\t\tAttrs: map[string]string{\n\t\t\t\t\"name\":           strings.Join(options.Images, \",\"),\n\t\t\t\t\"name-canonical\": \"\",\n\t\t\t\t\"push\":           \"true\",\n\t\t\t},\n\t\t})\n\t}\n\n\t// add labels\n\tfor k, v := range options.Labels {\n\t\tsolveOptions.FrontendAttrs[\"label:\"+k] = v\n\t}\n\n\t// add build args\n\tfor key, value := range options.BuildArgs {\n\t\tsolveOptions.FrontendAttrs[\"build-arg:\"+key] = value\n\t}\n\n\t// add additional build cli options\n\t// TODO: convert options.CliOpts into a solveOptions.FrontendAttr\n\n\tpw, err := NewPrinter(ctx, writer)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// build\n\t_, err = client.Solve(ctx, nil, solveOptions, pw.Status())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/buildkit/cache.go",
    "content": "package buildkit\n\nimport (\n\t\"encoding/csv\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/moby/buildkit/client\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc ParseCacheEntry(in []string) ([]client.CacheOptionsEntry, error) {\n\timports := make([]client.CacheOptionsEntry, 0, len(in))\n\tfor _, in := range in {\n\t\tcsvReader := csv.NewReader(strings.NewReader(in))\n\t\tfields, err := csvReader.Read()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isRefOnlyFormat(fields) {\n\t\t\tfor _, field := range fields {\n\t\t\t\timports = append(imports, client.CacheOptionsEntry{\n\t\t\t\t\tType:  \"registry\",\n\t\t\t\t\tAttrs: map[string]string{\"ref\": field},\n\t\t\t\t})\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tim := client.CacheOptionsEntry{\n\t\t\tAttrs: map[string]string{},\n\t\t}\n\t\tfor _, field := range fields {\n\t\t\tparts := strings.SplitN(field, \"=\", 2)\n\t\t\tif len(parts) != 2 {\n\t\t\t\treturn nil, errors.Errorf(\"invalid value %s\", field)\n\t\t\t}\n\t\t\tkey := strings.ToLower(parts[0])\n\t\t\tvalue := parts[1]\n\t\t\tswitch key {\n\t\t\tcase \"type\":\n\t\t\t\tim.Type = value\n\t\t\tdefault:\n\t\t\t\tim.Attrs[key] = value\n\t\t\t}\n\t\t}\n\t\tif im.Type == \"\" {\n\t\t\treturn nil, errors.Errorf(\"type required form> %q\", in)\n\t\t}\n\t\tif !addGithubToken(&im) {\n\t\t\tcontinue\n\t\t}\n\t\timports = append(imports, im)\n\t}\n\treturn imports, nil\n}\n\nfunc isRefOnlyFormat(in []string) bool {\n\tfor _, v := range in {\n\t\tif strings.Contains(v, \"=\") {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc addGithubToken(ci *client.CacheOptionsEntry) bool {\n\tif ci.Type != \"gha\" {\n\t\treturn true\n\t}\n\tif _, ok := ci.Attrs[\"token\"]; !ok {\n\t\tif v, ok := os.LookupEnv(\"ACTIONS_RUNTIME_TOKEN\"); ok {\n\t\t\tci.Attrs[\"token\"] = v\n\t\t}\n\t}\n\tif _, ok := ci.Attrs[\"url\"]; !ok {\n\t\tif v, ok := os.LookupEnv(\"ACTIONS_CACHE_URL\"); ok {\n\t\t\tci.Attrs[\"url\"] = v\n\t\t}\n\t}\n\treturn ci.Attrs[\"token\"] != \"\" && ci.Attrs[\"url\"] != \"\"\n}\n"
  },
  {
    "path": "pkg/devcontainer/buildkit/conn.go",
    "content": "package buildkit\n\nimport (\n\t\"context\"\n\t\"net\"\n\n\tdockerclient \"github.com/docker/docker/client\"\n\t\"github.com/moby/buildkit/client\"\n)\n\nfunc NewDockerClient(ctx context.Context, dockerClient dockerclient.CommonAPIClient) (*client.Client, error) {\n\treturn client.New(ctx, \"\", client.WithContextDialer(func(context.Context, string) (net.Conn, error) {\n\t\treturn dockerClient.DialHijack(ctx, \"/grpc\", \"h2c\", nil)\n\t}), client.WithSessionDialer(func(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) {\n\t\treturn dockerClient.DialHijack(ctx, \"/session\", proto, meta)\n\t}))\n}\n"
  },
  {
    "path": "pkg/devcontainer/buildkit/printer.go",
    "content": "package buildkit\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/moby/buildkit/client\"\n\t\"github.com/moby/buildkit/util/progress/progressui\"\n\t\"github.com/moby/buildkit/util/progress/progresswriter\"\n)\n\ntype printer struct {\n\tstatus chan *client.SolveStatus\n\tdone   <-chan struct{}\n\terr    error\n}\n\nfunc (p *printer) Done() <-chan struct{} {\n\treturn p.done\n}\n\nfunc (p *printer) Err() error {\n\treturn p.err\n}\n\nfunc (p *printer) Status() chan *client.SolveStatus {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.status\n}\n\nfunc NewPrinter(ctx context.Context, out io.Writer) (progresswriter.Writer, error) {\n\tstatusCh := make(chan *client.SolveStatus)\n\tdoneCh := make(chan struct{})\n\n\tpw := &printer{\n\t\tstatus: statusCh,\n\t\tdone:   doneCh,\n\t}\n\n\td, err := progressui.NewDisplay(out, progressui.AutoMode)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo func() {\n\t\t// not using shared context to not disrupt display but let is finish reporting errors\n\t\t_, pw.err = d.UpdateFrom(ctx, statusCh)\n\t\tclose(doneCh)\n\t}()\n\treturn pw, nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/buildkit/remote.go",
    "content": "package buildkit\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/cli/cli/config/configfile\"\n\t\"github.com/docker/cli/cli/config/types\"\n\t\"github.com/google/go-containerregistry/pkg/authn\"\n\t\"github.com/google/go-containerregistry/pkg/name\"\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/moby/buildkit/client\"\n\t\"github.com/moby/buildkit/exporter/containerimage/exptypes\"\n\t\"github.com/moby/buildkit/session\"\n\t\"github.com/moby/buildkit/session/auth/authprovider\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/tonistiigi/fsutil\"\n)\n\nfunc BuildRemote(\n\tctx context.Context,\n\tprebuildHash string,\n\tparsedConfig *config.SubstitutedConfig,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n\tdockerfilePath,\n\tdockerfileContent string,\n\tlocalWorkspaceFolder string,\n\toptions provider.BuildOptions,\n\ttargetArch string,\n\tlog log.Logger,\n) (*config.BuildInfo, error) {\n\tif options.NoBuild {\n\t\treturn nil, fmt.Errorf(\"you cannot build in this mode. Please run 'devpod up' to rebuild the container\")\n\t}\n\tif !options.CLIOptions.Platform.Enabled {\n\t\treturn nil, errors.New(\"remote builds are only supported in DevPod Pro\")\n\t}\n\tif options.CLIOptions.Platform.Build == nil {\n\t\treturn nil, errors.New(\"build options are required for remote builds\")\n\t}\n\tif options.CLIOptions.Platform.Build.RemoteAddress == \"\" {\n\t\treturn nil, errors.New(\"builder address is required to build image remotely\")\n\t}\n\tif options.CLIOptions.Platform.Build.Repository == \"\" && !options.SkipPush {\n\t\treturn nil, errors.New(\"remote builds require a registry to be provided\")\n\t}\n\n\tremoteURL, err := url.Parse(options.CLIOptions.Platform.Build.RemoteAddress)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// temporarily write certs to disk because buildkit only accepts paths\n\ttmpDir, caPath, keyPath, certPath, err := ensureCertPaths(options.CLIOptions.Platform.Build)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ensure certificates: %w\", err)\n\t}\n\tdefer func() {\n\t\t_ = os.RemoveAll(tmpDir)\n\t}()\n\n\t// initialize remote buildkit client\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\tdefer cancel()\n\tc, err := client.New(timeoutCtx,\n\t\toptions.CLIOptions.Platform.Build.RemoteAddress,\n\t\tclient.WithServerConfig(remoteURL.Hostname(), caPath),\n\t\tclient.WithCredentials(certPath, keyPath),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get client: %w\", err)\n\t}\n\tdefer c.Close()\n\n\tinfo, err := c.Info(timeoutCtx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get remote builder info: %w\", err)\n\t}\n\n\timageName := options.CLIOptions.Platform.Build.Repository + \"/\" + build.GetImageName(localWorkspaceFolder, prebuildHash)\n\tref, err := name.ParseReference(imageName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to resolve registry %s and image %s: %w\",\n\t\t\toptions.CLIOptions.Platform.Build.Repository,\n\t\t\tbuild.GetImageName(localWorkspaceFolder, prebuildHash), err)\n\t}\n\tkeychain, err := image.GetKeychain(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get docker auth keychain: %w\", err)\n\t}\n\t// we can return early if we find an existing image with the exact configuration in the repository\n\timageDetails, err := getImageDetails(ctx, ref, targetArch, keychain)\n\tif err == nil {\n\t\tlog.Infof(\"Found existing image %s, skipping build\", imageName)\n\t\treturn &config.BuildInfo{\n\t\t\tImageDetails:  imageDetails,\n\t\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\t\tImageName:     imageName,\n\t\t\tPrebuildHash:  prebuildHash,\n\t\t\tRegistryCache: options.RegistryCache,\n\t\t\tTags:          options.Tag,\n\t\t}, nil\n\t}\n\n\t// check push permissions early\n\terr = remote.CheckPushPermission(ref, keychain, http.DefaultTransport)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"pushing %s is not allowed: %w\", ref, err)\n\t}\n\n\t// resolve credentials for registry\n\tauth, err := keychain.Resolve(ref.Context())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get authentication for %s: %w\", ref.Context().String(), err)\n\t}\n\tauthConfig, err := auth.Authorization()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get auth config for %s: %w\", ref.Context().String(), err)\n\t}\n\n\tregistry := ref.Context().Registry.RegistryStr()\n\tsession := []session.Attachable{\n\t\tauthprovider.NewDockerAuthProvider(authprovider.DockerAuthProviderConfig{\n\t\t\tConfigFile: &configfile.ConfigFile{\n\t\t\t\tAuthConfigs: map[string]types.AuthConfig{\n\t\t\t\t\tregistry: types.AuthConfig{\n\t\t\t\t\t\tUsername:      authConfig.Username,\n\t\t\t\t\t\tAuth:          authConfig.Auth,\n\t\t\t\t\t\tPassword:      authConfig.Password,\n\t\t\t\t\t\tIdentityToken: authConfig.IdentityToken,\n\t\t\t\t\t\tRegistryToken: authConfig.RegistryToken,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t}\n\n\tbuildOptions, err := build.NewOptions(dockerfilePath, dockerfileContent, parsedConfig, extendedBuildInfo, imageName, options, prebuildHash)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create build buildOptions: %w\", err)\n\t}\n\n\t// cache from\n\tcacheFrom, err := ParseCacheEntry(buildOptions.CacheFrom)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcacheTo, err := ParseCacheEntry(buildOptions.CacheTo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdockerfileDir := filepath.Dir(buildOptions.Dockerfile)\n\tlocalMounts := map[string]fsutil.FS{}\n\tdockerfileMount, err := fsutil.NewFS(dockerfileDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create local dockerfile mount: %w\", err)\n\t}\n\tlocalMounts[\"dockerfile\"] = dockerfileMount\n\tcontextMount, err := fsutil.NewFS(buildOptions.Context)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create local context mount: %w\", err)\n\t}\n\tlocalMounts[\"context\"] = contextMount\n\n\t// create solve options\n\tsolveOptions := client.SolveOpt{\n\t\tFrontend: \"dockerfile.v0\",\n\t\tFrontendAttrs: map[string]string{\n\t\t\t\"filename\": filepath.Base(buildOptions.Dockerfile),\n\t\t\t\"context\":  buildOptions.Context,\n\t\t},\n\t\tLocalMounts:  localMounts,\n\t\tSession:      session,\n\t\tCacheImports: cacheFrom,\n\t\tCacheExports: cacheTo,\n\t}\n\n\t// set buildOptions target\n\tif buildOptions.Target != \"\" {\n\t\tsolveOptions.FrontendAttrs[\"target\"] = buildOptions.Target\n\t}\n\n\t// add platforms\n\tif options.Platform != \"\" {\n\t\tsolveOptions.FrontendAttrs[\"platform\"] = options.Platform\n\t} else if targetArch != \"\" {\n\t\tsolveOptions.FrontendAttrs[\"platform\"] = \"linux/\" + targetArch\n\t}\n\n\t// multi contexts\n\tfor k, v := range buildOptions.Contexts {\n\t\tst, err := os.Stat(v)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"get build context %v: %w\", k, err)\n\t\t}\n\t\tif !st.IsDir() {\n\t\t\treturn nil, fmt.Errorf(\"build context '%s' is not a directory\", v)\n\t\t}\n\t\tlocalName := k\n\t\tif k == \"context\" || k == \"dockerfile\" {\n\t\t\tlocalName = \"_\" + k // underscore to avoid collisions\n\t\t}\n\n\t\tsolveOptions.LocalMounts[localName], err = fsutil.NewFS(v)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create local mount for %s at %s: %w\", localName, v, err)\n\t\t}\n\n\t\tsolveOptions.FrontendAttrs[\"context:\"+k] = \"local:\" + localName\n\t}\n\n\tpush := \"true\"\n\tif options.SkipPush {\n\t\tpush = \"false\"\n\t}\n\tsolveOptions.Exports = append(solveOptions.Exports, client.ExportEntry{\n\t\tType: client.ExporterImage,\n\t\tAttrs: map[string]string{\n\t\t\tstring(exptypes.OptKeyName): strings.Join(buildOptions.Images, \",\"),\n\t\t\tstring(exptypes.OptKeyPush): push,\n\t\t},\n\t})\n\n\t// add labels\n\tfor k, v := range buildOptions.Labels {\n\t\tsolveOptions.FrontendAttrs[\"label:\"+k] = v\n\t}\n\n\t// add build args\n\tfor key, value := range buildOptions.BuildArgs {\n\t\tsolveOptions.FrontendAttrs[\"build-arg:\"+key] = value\n\t}\n\n\tlog.Infof(\"Start building %s using platform builder (%s)\", strings.Join(buildOptions.Images, \",\"), info.BuildkitVersion.Version)\n\n\t// TODO: Writer should be async to prevent blocking while waiting for tunnel response\n\twriter := log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\tpw, err := NewPrinter(ctx, writer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = c.Solve(ctx, nil, solveOptions, pw.Status())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\timageDetails, err = getImageDetails(ctx, ref, targetArch, keychain)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get image details: %w\", err)\n\t}\n\treturn &config.BuildInfo{\n\t\tImageDetails:  imageDetails,\n\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\tImageName:     imageName,\n\t\tPrebuildHash:  prebuildHash,\n\t\tRegistryCache: options.RegistryCache,\n\t\tTags:          options.Tag,\n\t}, nil\n}\n\nfunc getImageDetails(ctx context.Context, ref name.Reference, targetArch string, keychain authn.Keychain) (*config.ImageDetails, error) {\n\tremoteImage, err := remote.Image(ref,\n\t\tremote.WithAuthFromKeychain(keychain),\n\t\tremote.WithPlatform(v1.Platform{Architecture: targetArch, OS: \"linux\"}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timageConfig, err := remoteImage.ConfigFile()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get image config file: %w\", err)\n\t}\n\n\timageDetails := &config.ImageDetails{\n\t\tID: ref.Name(),\n\t\tConfig: config.ImageDetailsConfig{\n\t\t\tUser:       imageConfig.Config.User,\n\t\t\tEnv:        imageConfig.Config.Env,\n\t\t\tLabels:     imageConfig.Config.Labels,\n\t\t\tEntrypoint: imageConfig.Config.Entrypoint,\n\t\t\tCmd:        imageConfig.Config.Cmd,\n\t\t},\n\t}\n\n\treturn imageDetails, nil\n}\n\nfunc ensureCertPaths(buildOpts *devpod.PlatformBuildOptions) (parentDir string, caPath string, keyPath string, certPath string, err error) {\n\tparentDir, err = os.MkdirTemp(\"\", \"build-certs-*\")\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"create temp dir: %w\", err)\n\t}\n\n\t// write CA\n\tcaPath = filepath.Join(parentDir, \"ca.pem\")\n\tcaBytes, err := base64.StdEncoding.DecodeString(buildOpts.CertCA)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"decode CA: %w\", err)\n\t}\n\terr = os.WriteFile(caPath, caBytes, 0o700)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"write CA file: %w\", err)\n\t}\n\n\t// write key\n\tkeyPath = filepath.Join(parentDir, \"key.pem\")\n\tkeyBytes, err := base64.StdEncoding.DecodeString(buildOpts.CertKey)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"decode private key: %w\", err)\n\t}\n\terr = os.WriteFile(keyPath, keyBytes, 0o700)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"write private key file: %w\", err)\n\t}\n\n\t// write cert\n\tcertPath = filepath.Join(parentDir, \"cert.pem\")\n\tcertBytes, err := base64.StdEncoding.DecodeString(buildOpts.Cert)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"decode cert: %w\", err)\n\t}\n\terr = os.WriteFile(certPath, certBytes, 0o700)\n\tif err != nil {\n\t\treturn parentDir, caPath, keyPath, caPath, fmt.Errorf(\"write cert file: %w\", err)\n\t}\n\n\treturn parentDir, caPath, keyPath, caPath, nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/compose.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\tcomposetypes \"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/joho/godotenv\"\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/metadata\"\n\t\"github.com/loft-sh/devpod/pkg/dockerfile\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"gopkg.in/yaml.v2\"\n)\n\nconst (\n\tConfigFilesLabel                = \"com.docker.compose.project.config_files\"\n\tFeaturesBuildOverrideFilePrefix = \"docker-compose.devcontainer.build\"\n\tFeaturesStartOverrideFilePrefix = \"docker-compose.devcontainer.containerFeatures\"\n)\n\nfunc (r *runner) composeHelper() (*compose.ComposeHelper, error) {\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"docker compose is not supported by this provider, please choose a different one\")\n\t}\n\n\treturn dockerDriver.ComposeHelper()\n}\n\nfunc (r *runner) stopDockerCompose(ctx context.Context, projectName string) error {\n\tcomposeHelper, err := r.composeHelper()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find docker compose\")\n\t}\n\n\tparsedConfig, _, err := r.getSubstitutedConfig(r.WorkspaceConfig.CLIOptions)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get parsed config\")\n\t}\n\n\t_, _, composeGlobalArgs, err := r.dockerComposeProjectFiles(parsedConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get compose/env files\")\n\t}\n\n\terr = composeHelper.Stop(ctx, projectName, composeGlobalArgs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (r *runner) deleteDockerCompose(ctx context.Context, projectName string) error {\n\tcomposeHelper, err := r.composeHelper()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find docker compose\")\n\t}\n\n\tparsedConfig, _, err := r.getSubstitutedConfig(r.WorkspaceConfig.CLIOptions)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get parsed config\")\n\t}\n\n\t_, _, composeGlobalArgs, err := r.dockerComposeProjectFiles(parsedConfig)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get compose/env files\")\n\t}\n\n\terr = composeHelper.Remove(ctx, projectName, composeGlobalArgs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (r *runner) dockerComposeProjectFiles(parsedConfig *config.SubstitutedConfig) ([]string, []string, []string, error) {\n\tenvFiles, err := r.getEnvFiles()\n\tif err != nil {\n\t\treturn nil, nil, nil, errors.Wrap(err, \"get env files\")\n\t}\n\n\tcomposeFiles, err := r.getDockerComposeFilePaths(parsedConfig, envFiles)\n\tif err != nil {\n\t\treturn nil, nil, nil, errors.Wrap(err, \"get docker compose file paths\")\n\t}\n\n\tvar args []string\n\tfor _, configFile := range composeFiles {\n\t\targs = append(args, \"-f\", configFile)\n\t}\n\n\tfor _, envFile := range envFiles {\n\t\targs = append(args, \"--env-file\", envFile)\n\t}\n\n\treturn composeFiles, envFiles, args, nil\n}\n\nfunc (r *runner) runDockerCompose(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions UpOptions,\n\ttimeout time.Duration,\n) (*config.Result, error) {\n\tcomposeHelper, err := r.composeHelper()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"find docker compose\")\n\t}\n\n\tcomposeFiles, envFiles, composeGlobalArgs, err := r.dockerComposeProjectFiles(parsedConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get compose/env files\")\n\t}\n\n\tr.Log.Debugf(\"Loading docker compose project %+v\", composeFiles)\n\tproject, err := compose.LoadDockerComposeProject(ctx, composeFiles, envFiles)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"load docker compose project\")\n\t}\n\tproject.Name = composeHelper.GetProjectName(r.ID)\n\tr.Log.Debugf(\"Loaded project %s\", project.Name)\n\n\tcontainerDetails, err := composeHelper.FindDevContainer(ctx, project.Name, parsedConfig.Config.Service)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"find dev container\")\n\t}\n\n\t// does the container already exist or is it not running?\n\tif containerDetails == nil || containerDetails.State.Status != \"running\" || options.Recreate {\n\t\tdidStartProject := false\n\t\t// Try to find existing project first\n\t\texistingProjectFiles, err := composeHelper.FindProjectFiles(ctx, project.Name)\n\t\tif err != nil {\n\t\t\tr.Log.Errorf(\"Error finding project files: %s\", err)\n\t\t} else if len(existingProjectFiles) > 0 && !options.Recreate {\n\t\t\tr.Log.Debugf(\"Found existing project files: %s\", existingProjectFiles)\n\t\t\t// make sure all project files are still available\n\t\t\tfor _, file := range existingProjectFiles {\n\t\t\t\tif _, err := os.Stat(file); err != nil {\n\t\t\t\t\tr.Log.Warnf(\"Project file %s does not exist anymore, recreating project\", file)\n\t\t\t\t\tcontainerDetails = nil\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If project is found, we can call `up` with the project name\n\t\t\t// If it fails, fall back to rebuilding\n\t\t\tupArgs := []string{\"--project-name\", project.Name}\n\t\t\tfor _, existingProjectFiles := range existingProjectFiles {\n\t\t\t\tupArgs = append(upArgs, \"-f\", existingProjectFiles)\n\t\t\t}\n\t\t\tupArgs = append(upArgs, \"up\", \"-d\")\n\t\t\tupArgs = r.onlyRunServices(upArgs, parsedConfig)\n\n\t\t\t// Run docker-compose\n\t\t\twriter := r.Log.Writer(logrus.InfoLevel, false)\n\t\t\terr = composeHelper.Run(ctx, upArgs, nil, writer, writer)\n\t\t\tif err != nil {\n\t\t\t\tr.Log.Errorf(\"Error starting project: %s\", err)\n\t\t\t} else {\n\t\t\t\t// wait for running and get container details\n\t\t\t\tdetails, err := composeHelper.FindDevContainer(ctx, project.Name, parsedConfig.Config.Service)\n\t\t\t\tif err != nil {\n\t\t\t\t\tr.Log.Errorf(\"Error finding dev container: %s\", err)\n\t\t\t\t} else {\n\t\t\t\t\tcontainerDetails = details\n\t\t\t\t\tdidStartProject = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Start container if not running\n\t\tif !didStartProject {\n\t\t\tcontainerDetails, err = r.startContainer(ctx, parsedConfig, substitutionContext, project, composeHelper, composeGlobalArgs, containerDetails, options)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"start container\")\n\t\t\t} else if containerDetails == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"couldn't find container after start\")\n\t\t\t}\n\t\t}\n\t}\n\n\timageMetadataConfig, err := metadata.GetImageMetadataFromContainer(containerDetails, substitutionContext, r.Log)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image metadata from container\")\n\t}\n\n\tmergedConfig, err := config.MergeConfiguration(parsedConfig.Config, imageMetadataConfig.Config)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"merge config\")\n\t}\n\n\t// setup container\n\treturn r.setupContainer(ctx, parsedConfig.Raw, containerDetails, mergedConfig, substitutionContext, timeout)\n}\n\n// onlyRunServices appends the services defined in .devcontainer.json runServices to the upArgs\nfunc (r *runner) onlyRunServices(upArgs []string, parsedConfig *config.SubstitutedConfig) []string {\n\tif len(parsedConfig.Config.RunServices) > 0 {\n\t\t// Run the main devcontainer\n\t\tupArgs = append(upArgs, parsedConfig.Config.Service)\n\t\t// Run the services defined in .devcontainer.json runServices\n\t\tfor _, service := range parsedConfig.Config.RunServices {\n\t\t\tif service == parsedConfig.Config.Service {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tupArgs = append(upArgs, service)\n\t\t}\n\t}\n\treturn upArgs\n}\n\nfunc (r *runner) getDockerComposeFilePaths(parsedConfig *config.SubstitutedConfig, envFiles []string) ([]string, error) {\n\tconfigFileDir := filepath.Dir(parsedConfig.Config.Origin)\n\n\t// Use docker compose files from config\n\tvar composeFiles []string\n\tif len(parsedConfig.Config.DockerComposeFile) > 0 {\n\t\tfor _, composeFile := range parsedConfig.Config.DockerComposeFile {\n\t\t\tabsPath := composeFile\n\t\t\tif !filepath.IsAbs(composeFile) {\n\t\t\t\tabsPath = filepath.Join(configFileDir, composeFile)\n\t\t\t}\n\t\t\tcomposeFiles = append(composeFiles, absPath)\n\t\t}\n\n\t\treturn composeFiles, nil\n\t}\n\n\t// Use docker compose files from $COMPOSE_FILE environment variable\n\tenvComposeFile := os.Getenv(\"COMPOSE_FILE\")\n\n\t// Load docker compose files from $COMPOSE_FILE in .env file\n\tif envComposeFile == \"\" {\n\t\tfor _, envFile := range envFiles {\n\t\t\tenv, err := godotenv.Read(envFile)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif env[\"COMPOSE_FILE\"] != \"\" {\n\t\t\t\tenvComposeFile = env[\"COMPOSE_FILE\"]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif envComposeFile != \"\" {\n\t\treturn filepath.SplitList(envComposeFile), nil\n\t}\n\n\treturn nil, nil\n}\n\nfunc (r *runner) getEnvFiles() ([]string, error) {\n\tvar envFiles []string\n\tenvFile := path.Join(r.LocalWorkspaceFolder, \".env\")\n\tenvFileStat, err := os.Stat(envFile)\n\tif err == nil && envFileStat.Mode().IsRegular() {\n\t\tenvFiles = append(envFiles, envFile)\n\t}\n\treturn envFiles, nil\n}\n\nfunc (r *runner) startContainer(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tproject *composetypes.Project,\n\tcomposeHelper *compose.ComposeHelper,\n\tcomposeGlobalArgs []string,\n\tcontainer *config.ContainerDetails,\n\toptions UpOptions,\n) (*config.ContainerDetails, error) {\n\tservice := parsedConfig.Config.Service\n\tcomposeService, err := project.GetService(service)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"service '%s' configured in devcontainer.json not found in Docker Compose configuration\", service)\n\t}\n\n\toriginalImageName := composeService.Image\n\tif originalImageName == \"\" {\n\t\toriginalImageName, err = composeHelper.GetDefaultImage(project.Name, service)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"get default image\")\n\t\t}\n\t}\n\n\tvar didRestoreFromPersistedShare bool\n\tif container != nil {\n\t\tlabels := container.Config.Labels\n\t\tif labels[ConfigFilesLabel] != \"\" {\n\t\t\tconfigFiles := strings.Split(labels[ConfigFilesLabel], \",\")\n\n\t\t\tpersistedBuildFileFound, persistedBuildFileExists, persistedBuildFile, err := checkForPersistedFile(configFiles, FeaturesBuildOverrideFilePrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"check for persisted build override\")\n\t\t\t}\n\n\t\t\t_, persistedStartFileExists, persistedStartFile, err := checkForPersistedFile(configFiles, FeaturesStartOverrideFilePrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"check for persisted start override\")\n\t\t\t}\n\n\t\t\tif (persistedBuildFileExists || !persistedBuildFileFound) && persistedStartFileExists {\n\t\t\t\tdidRestoreFromPersistedShare = true\n\n\t\t\t\tif persistedBuildFileExists {\n\t\t\t\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"-f\", persistedBuildFile)\n\t\t\t\t}\n\n\t\t\t\tif persistedStartFileExists {\n\t\t\t\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"-f\", persistedStartFile)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif container == nil || !didRestoreFromPersistedShare {\n\t\toverrideBuildImageName, overrideComposeBuildFilePath, imageMetadata, metadataLabel, err := r.buildAndExtendDockerCompose(ctx, parsedConfig, substitutionContext, project, composeHelper, &composeService, composeGlobalArgs)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"build and extend docker-compose\")\n\t\t}\n\n\t\tif overrideComposeBuildFilePath != \"\" {\n\t\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"-f\", overrideComposeBuildFilePath)\n\t\t}\n\n\t\tcurrentImageName := overrideBuildImageName\n\t\tif currentImageName == \"\" {\n\t\t\tcurrentImageName = originalImageName\n\t\t}\n\n\t\timageDetails, err := r.inspectImage(ctx, currentImageName)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"inspect image\")\n\t\t}\n\n\t\tmergedConfig, err := config.MergeConfiguration(parsedConfig.Config, imageMetadata.Config)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"merge configuration\")\n\t\t}\n\n\t\tadditionalLabels := map[string]string{\n\t\t\tmetadata.ImageMetadataLabel: metadataLabel,\n\t\t\tconfig.UserLabel:            imageDetails.Config.User,\n\t\t}\n\t\toverrideComposeUpFilePath, err := r.extendedDockerComposeUp(parsedConfig, mergedConfig, composeHelper, &composeService, originalImageName, overrideBuildImageName, imageDetails, additionalLabels)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"extend docker-compose up\")\n\t\t}\n\n\t\tif overrideComposeUpFilePath != \"\" {\n\t\t\tcomposeGlobalArgs = append(composeGlobalArgs, \"-f\", overrideComposeUpFilePath)\n\t\t}\n\t}\n\n\tif container != nil && options.Recreate {\n\t\tr.Log.Debugf(\"Deleting dev container %s due to --recreate\", container.ID)\n\n\t\tif err := r.Driver.StopDevContainer(ctx, r.ID); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"stop dev container\")\n\t\t}\n\n\t\tif err := r.Driver.DeleteDevContainer(ctx, r.ID); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"delete dev container\")\n\t\t}\n\t}\n\n\tupArgs := []string{\"--project-name\", project.Name}\n\tupArgs = append(upArgs, composeGlobalArgs...)\n\tupArgs = append(upArgs, \"up\", \"-d\")\n\tif container != nil {\n\t\tupArgs = append(upArgs, \"--no-recreate\")\n\t}\n\tupArgs = r.onlyRunServices(upArgs, parsedConfig)\n\n\t// start compose\n\twriter := r.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\terr = composeHelper.Run(ctx, upArgs, nil, writer, writer)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"docker-compose run\")\n\t}\n\n\t// TODO wait for started event?\n\tcontainerDetails, err := composeHelper.FindDevContainer(ctx, project.Name, composeService.Name)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"find dev container\")\n\t}\n\n\treturn containerDetails, nil\n}\n\n// prepareComposeBuildInfo modifies a compose project's devcontainer Dockerfile to ensure it can be extended with features\n// If an Image is specified instead of a Build, the metadata from the Image is used to populate the build info\nfunc (r *runner) prepareComposeBuildInfo(ctx context.Context, subCtx *config.SubstitutionContext, composeService *composetypes.ServiceConfig, buildTarget string) (*config.ImageBuildInfo, string, string, error) {\n\tvar dockerFilePath, dockerfileContents string\n\tvar imageBuildInfo *config.ImageBuildInfo\n\tvar err error\n\tif composeService.Build != nil {\n\t\t// Read Dockerfile\n\t\tif path.IsAbs(composeService.Build.Dockerfile) {\n\t\t\tdockerFilePath = composeService.Build.Dockerfile\n\t\t} else {\n\t\t\tdockerFilePath = filepath.Join(composeService.Build.Context, composeService.Build.Dockerfile)\n\t\t}\n\n\t\toriginalDockerfile, err := os.ReadFile(dockerFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", \"\", err\n\t\t}\n\n\t\t// Determine build target, if a multi stage build ensure it is valid and modify the Dockerfile if necessary\n\t\toriginalTarget := composeService.Build.Target\n\t\tif originalTarget != \"\" {\n\t\t\tbuildTarget = originalTarget\n\t\t} else {\n\t\t\tlastStageName, modifiedDockerfile, err := dockerfile.EnsureDockerfileHasFinalStageName(string(originalDockerfile), config.DockerfileDefaultTarget)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, \"\", \"\", err\n\t\t\t}\n\n\t\t\tbuildTarget = lastStageName\n\t\t\t// Override Dockerfile if it was modified, otherwise use the original\n\t\t\tif modifiedDockerfile != \"\" {\n\t\t\t\tdockerfileContents = modifiedDockerfile\n\t\t\t} else {\n\t\t\t\tdockerfileContents = string(originalDockerfile)\n\t\t\t}\n\t\t}\n\t\timageBuildInfo, err = r.getImageBuildInfoFromDockerfile(subCtx, string(originalDockerfile), mappingToMap(composeService.Build.Args), originalTarget)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", \"\", err\n\t\t}\n\t} else {\n\t\timageBuildInfo, err = r.getImageBuildInfoFromImage(ctx, subCtx, composeService.Image)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", \"\", err\n\t\t}\n\t}\n\treturn imageBuildInfo, dockerfileContents, buildTarget, nil\n}\n\n// This extends the build information for docker compose containers\nfunc (r *runner) buildAndExtendDockerCompose(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tproject *composetypes.Project,\n\tcomposeHelper *compose.ComposeHelper,\n\tcomposeService *composetypes.ServiceConfig,\n\tglobalArgs []string,\n) (string, string, *config.ImageMetadataConfig, string, error) {\n\tvar dockerFilePath, dockerfileContents, dockerComposeFilePath string\n\tvar imageBuildInfo *config.ImageBuildInfo\n\tvar err error\n\n\tbuildImageName := composeService.Image\n\t// If Image is empty then we are building the dev container and use the default name docker-compose uses\n\tif buildImageName == \"\" {\n\t\tbuildImageName = fmt.Sprintf(\"%s-%s\", project.Name, composeService.Name)\n\t}\n\tbuildTarget := \"dev_container_auto_added_stage_label\"\n\n\t// Determine base imageName for generated features build\n\timageBuildInfo, dockerfileContents, buildTarget, err = r.prepareComposeBuildInfo(ctx, substitutionContext, composeService, buildTarget)\n\tif err != nil {\n\t\treturn \"\", \"\", nil, \"\", err\n\t}\n\n\textendImageBuildInfo, err := feature.GetExtendedBuildInfo(substitutionContext, imageBuildInfo, buildTarget, parsedConfig, r.Log, false)\n\tif err != nil {\n\t\treturn \"\", \"\", nil, \"\", err\n\t}\n\n\tif extendImageBuildInfo != nil && extendImageBuildInfo.FeaturesBuildInfo != nil {\n\t\t// If the dockerfile is empty (because an Image was used) reference that image as the build target after the features / modified contents\n\t\tif dockerfileContents == \"\" {\n\t\t\tdockerfileContents = fmt.Sprintf(\"FROM %s AS %s\\n\", composeService.Image, buildTarget)\n\t\t}\n\n\t\t// Write the final Dockerfile with features\n\t\textendedDockerfilePath, extendedDockerfileContent := r.extendedDockerfile(\n\t\t\textendImageBuildInfo.FeaturesBuildInfo,\n\t\t\tdockerFilePath,\n\t\t\tdockerfileContents,\n\t\t)\n\n\t\tr.Log.Debugf(\n\t\t\t\"Creating extended Dockerfile %s with content: \\n %s\",\n\t\t\textendedDockerfilePath,\n\t\t\textendedDockerfileContent,\n\t\t)\n\n\t\tdefer os.RemoveAll(filepath.Dir(extendedDockerfilePath))\n\t\terr := os.WriteFile(extendedDockerfilePath, []byte(extendedDockerfileContent), 0600)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", nil, \"\", errors.Wrap(err, \"write Dockerfile with features\")\n\t\t}\n\n\t\t// Write the final docker-compose referencing the modified Dockerfile or Image\n\t\tdockerComposeFilePath, err = r.extendedDockerComposeBuild(\n\t\t\tcomposeService,\n\t\t\textendedDockerfilePath,\n\t\t\textendImageBuildInfo.FeaturesBuildInfo,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn buildImageName, \"\", nil, \"\", err\n\t\t}\n\t}\n\n\t// Prepare the docker-compose build arguments\n\tbuildArgs := []string{\"--project-name\", project.Name}\n\tbuildArgs = append(buildArgs, globalArgs...)\n\tif dockerComposeFilePath != \"\" {\n\t\tbuildArgs = append(buildArgs, \"-f\", dockerComposeFilePath)\n\t}\n\tbuildArgs = append(buildArgs, \"build\")\n\tif extendImageBuildInfo == nil {\n\t\tbuildArgs = append(buildArgs, \"--pull\")\n\t}\n\n\t// Only run the services defined in .devcontainer.json runServices\n\tif len(parsedConfig.Config.RunServices) > 0 {\n\t\tbuildArgs = append(buildArgs, composeService.Name)\n\t\tfor _, service := range parsedConfig.Config.RunServices {\n\t\t\tif service == composeService.Name {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuildArgs = append(buildArgs, service)\n\t\t}\n\t}\n\n\t// build image\n\twriter := r.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\tr.Log.Debugf(\"Run %s %s\", composeHelper.Command, strings.Join(buildArgs, \" \"))\n\terr = composeHelper.Run(ctx, buildArgs, nil, writer, writer)\n\tif err != nil {\n\t\treturn buildImageName, \"\", nil, \"\", err\n\t}\n\n\timageMetadata, err := metadata.GetDevContainerMetadata(substitutionContext, imageBuildInfo.Metadata, parsedConfig, extendImageBuildInfo.Features)\n\tif err != nil {\n\t\treturn buildImageName, \"\", nil, \"\", err\n\t}\n\n\treturn buildImageName, dockerComposeFilePath, imageMetadata, extendImageBuildInfo.MetadataLabel, nil\n}\n\nfunc (r *runner) extendedDockerfile(featureBuildInfo *feature.BuildInfo, dockerfilePath, dockerfileContent string) (string, string) {\n\t// extra args?\n\tfinalDockerfilePath := dockerfilePath\n\tfinalDockerfileContent := dockerfileContent\n\n\t// get extended build info\n\tif featureBuildInfo != nil {\n\t\t// rewrite dockerfile path\n\t\tfinalDockerfilePath = filepath.Join(featureBuildInfo.FeaturesFolder, \"Dockerfile-with-features\")\n\n\t\t// rewrite dockerfile\n\t\tfinalDockerfileContent = dockerfile.RemoveSyntaxVersion(dockerfileContent)\n\t\tfinalDockerfileContent = strings.TrimSpace(strings.Join([]string{\n\t\t\tfeatureBuildInfo.DockerfilePrefixContent,\n\t\t\tstrings.TrimSpace(finalDockerfileContent),\n\t\t\tfeatureBuildInfo.DockerfileContent,\n\t\t}, \"\\n\"))\n\t}\n\n\treturn finalDockerfilePath, finalDockerfileContent\n}\n\nfunc (r *runner) extendedDockerComposeBuild(composeService *composetypes.ServiceConfig, dockerFilePath string, featuresBuildInfo *feature.BuildInfo) (string, error) {\n\tservice := &composetypes.ServiceConfig{\n\t\tName: composeService.Name,\n\t\tBuild: &composetypes.BuildConfig{\n\t\t\tDockerfile: dockerFilePath,\n\t\t\tContext:    filepath.Dir(featuresBuildInfo.FeaturesFolder),\n\t\t},\n\t}\n\n\tif composeService.Build != nil && composeService.Build.Target != \"\" {\n\t\tservice.Build.Target = featuresBuildInfo.OverrideTarget\n\t}\n\n\tservice.Build.Args = composetypes.NewMappingWithEquals([]string{\"BUILDKIT_INLINE_CACHE=1\"})\n\tfor k, v := range featuresBuildInfo.BuildArgs {\n\t\tv := v\n\t\tservice.Build.Args[k] = &v\n\t}\n\n\tproject := &composetypes.Project{}\n\tproject.Services = map[string]composetypes.ServiceConfig{\n\t\tservice.Name: *service,\n\t}\n\n\tdockerComposeFolder := getDockerComposeFolder(r.WorkspaceConfig.Origin)\n\terr := os.MkdirAll(dockerComposeFolder, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdockerComposeData, err := yaml.Marshal(project)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdockerComposePath := filepath.Join(dockerComposeFolder, fmt.Sprintf(\"%s-%d.yml\", FeaturesBuildOverrideFilePrefix, time.Now().Second()))\n\n\tr.Log.Debugf(\n\t\t\"Creating docker-compose build %s with content:\\n %s\",\n\t\tdockerComposePath,\n\t\tstring(dockerComposeData),\n\t)\n\n\terr = os.WriteFile(dockerComposePath, dockerComposeData, 0600)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn dockerComposePath, nil\n}\n\nfunc (r *runner) extendedDockerComposeUp(\n\tparsedConfig *config.SubstitutedConfig,\n\tmergedConfig *config.MergedDevContainerConfig,\n\tcomposeHelper *compose.ComposeHelper,\n\tcomposeService *composetypes.ServiceConfig,\n\toriginalImageName,\n\toverrideImageName string,\n\timageDetails *config.ImageDetails,\n\tadditionalLabels map[string]string,\n) (string, error) {\n\tdockerComposeUpProject := r.generateDockerComposeUpProject(parsedConfig, mergedConfig, composeHelper, composeService, originalImageName, overrideImageName, imageDetails, additionalLabels)\n\tdockerComposeData, err := yaml.Marshal(dockerComposeUpProject)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdockerComposeFolder := getDockerComposeFolder(r.WorkspaceConfig.Origin)\n\terr = os.MkdirAll(dockerComposeFolder, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdockerComposePath := filepath.Join(dockerComposeFolder, fmt.Sprintf(\"%s-%d.yml\", FeaturesStartOverrideFilePrefix, time.Now().Second()))\n\n\tr.Log.Debugf(\n\t\t\"Creating docker-compose up %s with content:\\n %s\",\n\t\tdockerComposePath,\n\t\tstring(dockerComposeData),\n\t)\n\n\terr = os.WriteFile(dockerComposePath, dockerComposeData, 0600)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn dockerComposePath, nil\n}\n\nfunc (r *runner) generateDockerComposeUpProject(\n\tparsedConfig *config.SubstitutedConfig,\n\tmergedConfig *config.MergedDevContainerConfig,\n\tcomposeHelper *compose.ComposeHelper,\n\tcomposeService *composetypes.ServiceConfig,\n\toriginalImageName,\n\toverrideImageName string,\n\timageDetails *config.ImageDetails,\n\tadditionalLabels map[string]string,\n) *composetypes.Project {\n\t// Configure overridden service\n\tuserEntrypoint := composeService.Entrypoint\n\tuserCommand := composeService.Command\n\tif mergedConfig.OverrideCommand != nil && *mergedConfig.OverrideCommand {\n\t\tuserEntrypoint = []string{}\n\t\tuserCommand = []string{}\n\t} else {\n\t\tif len(userEntrypoint) == 0 {\n\t\t\tuserEntrypoint = imageDetails.Config.Entrypoint\n\t\t}\n\n\t\tif len(userCommand) == 0 {\n\t\t\tuserCommand = imageDetails.Config.Cmd\n\t\t}\n\t}\n\n\tentrypoint := composetypes.ShellCommand{\n\t\t\"/bin/sh\",\n\t\t\"-c\",\n\t\t`echo Container started\ntrap \"exit 0\" 15\n` + strings.Join(mergedConfig.Entrypoints, \"\\n\") + `\nexec \"$$@\"\n` + DefaultEntrypoint,\n\t\t\"-\",\n\t}\n\tentrypoint = append(entrypoint, userEntrypoint...)\n\n\tlabels := composetypes.Labels{\n\t\tconfig.DockerIDLabel: r.ID,\n\t}\n\tfor k, v := range additionalLabels {\n\t\t// Escape $ and ' to prevent substituting local environment variables!\n\t\tlabel := regexp.MustCompile(`\\$`).ReplaceAllString(v, \"$$$$\")\n\t\tlabel = regexp.MustCompile(`'`).ReplaceAllString(label, `\\'\\'`)\n\t\tlabels.Add(k, label)\n\t}\n\n\toverrideService := &composetypes.ServiceConfig{\n\t\tName:        composeService.Name,\n\t\tEntrypoint:  entrypoint,\n\t\tEnvironment: mappingFromMap(mergedConfig.ContainerEnv),\n\t\tInit:        mergedConfig.Init,\n\t\tCapAdd:      mergedConfig.CapAdd,\n\t\tSecurityOpt: mergedConfig.SecurityOpt,\n\t\tLabels:      labels,\n\t}\n\n\tif originalImageName != overrideImageName {\n\t\toverrideService.Image = overrideImageName\n\t}\n\n\tif !reflect.DeepEqual(userCommand, composeService.Command) {\n\t\toverrideService.Command = userCommand\n\t}\n\n\tif mergedConfig.ContainerUser != \"\" {\n\t\toverrideService.User = mergedConfig.ContainerUser\n\t}\n\n\tif mergedConfig.Privileged != nil {\n\t\toverrideService.Privileged = *mergedConfig.Privileged\n\t}\n\n\tgpuSupportEnabled, _ := composeHelper.Docker.GPUSupportEnabled()\n\tif parsedConfig.Config.HostRequirements != nil && parsedConfig.Config.HostRequirements.GPU == \"true\" && gpuSupportEnabled {\n\t\toverrideService.Deploy = &composetypes.DeployConfig{\n\t\t\tResources: composetypes.Resources{\n\t\t\t\tReservations: &composetypes.Resource{\n\t\t\t\t\tDevices: []composetypes.DeviceRequest{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCapabilities: []string{\"gpu\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\tfor _, mount := range mergedConfig.Mounts {\n\t\toverrideService.Volumes = append(overrideService.Volumes, composetypes.ServiceVolumeConfig{\n\t\t\tType:   mount.Type,\n\t\t\tSource: mount.Source,\n\t\t\tTarget: mount.Target,\n\t\t})\n\t}\n\n\tproject := &composetypes.Project{}\n\tproject.Services = map[string]composetypes.ServiceConfig{\n\t\toverrideService.Name: *overrideService,\n\t}\n\n\t// Configure volumes\n\tvar volumeMounts []composetypes.VolumeConfig\n\tfor _, m := range mergedConfig.Mounts {\n\t\tif m.Type == \"volume\" {\n\t\t\tvolumeMounts = append(volumeMounts, composetypes.VolumeConfig{\n\t\t\t\tName:     m.Source,\n\t\t\t\tExternal: composetypes.External(m.External),\n\t\t\t})\n\t\t}\n\t}\n\n\tif len(volumeMounts) > 0 {\n\t\tproject.Volumes = map[string]composetypes.VolumeConfig{}\n\t}\n\tfor _, volumeMount := range volumeMounts {\n\t\tproject.Volumes[volumeMount.Name] = volumeMount\n\t}\n\n\treturn project\n}\n\nfunc checkForPersistedFile(files []string, prefix string) (foundLabel bool, fileExists bool, filePath string, err error) {\n\tfor _, file := range files {\n\t\tif !strings.HasPrefix(file, prefix) {\n\t\t\tcontinue\n\t\t}\n\n\t\tstat, err := os.Stat(file)\n\t\tif err == nil && stat.Mode().IsRegular() {\n\t\t\treturn true, true, file, nil\n\t\t} else if os.IsNotExist(err) {\n\t\t\treturn true, false, file, nil\n\t\t}\n\t}\n\n\treturn false, false, \"\", nil\n}\n\nfunc getDockerComposeFolder(workspaceOriginFolder string) string {\n\treturn filepath.Join(workspaceOriginFolder, \".docker-compose\")\n}\n\nfunc mappingFromMap(m map[string]string) composetypes.MappingWithEquals {\n\tif len(m) == 0 {\n\t\treturn nil\n\t}\n\n\tvar values []string\n\tfor k, v := range m {\n\t\tvalues = append(values, k+\"=\"+v)\n\t}\n\treturn composetypes.NewMappingWithEquals(values)\n}\n\nfunc mappingToMap(mapping composetypes.MappingWithEquals) map[string]string {\n\tret := map[string]string{}\n\tfor k, v := range mapping {\n\t\tret[k] = *v\n\t}\n\treturn ret\n}\n\nfunc isDockerComposeConfig(config *config.DevContainerConfig) bool {\n\treturn len(config.DockerComposeFile) > 0\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/build.go",
    "content": "package config\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/dockerfile\"\n)\n\nconst (\n\tDockerIDLabel           = \"dev.containers.id\"\n\tDockerfileDefaultTarget = \"dev_container_auto_added_stage_label\"\n\n\tDevPodContextFeatureFolder      = \".devpod-internal\"\n\tDevPodDockerlessBuildInfoFolder = \"/workspaces/.dockerless\"\n\n\tWorkspaceDaemonConfigExtraEnvVar = \"DEVPOD_WORKSPACE_DAEMON_CONFIG\"\n)\n\nfunc GetDockerLabelForID(id string) []string {\n\treturn []string{DockerIDLabel + \"=\" + id}\n}\n\ntype BuildInfo struct {\n\tImageDetails  *ImageDetails\n\tImageMetadata *ImageMetadataConfig\n\tImageName     string\n\tPrebuildHash  string\n\tRegistryCache string\n\tTags          []string\n\n\tDockerless *BuildInfoDockerless\n}\n\ntype BuildInfoDockerless struct {\n\tContext    string\n\tDockerfile string\n\n\tBuildArgs map[string]string\n\tTarget    string\n\n\tUser string\n}\n\ntype ImageBuildInfo struct {\n\tUser     string\n\tMetadata *ImageMetadataConfig\n\n\t// Either on of these will be filled as will\n\tDockerfile   *dockerfile.Dockerfile\n\tImageDetails *ImageDetails\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/config.go",
    "content": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\ntype MergedDevContainerConfig struct {\n\tDevContainerConfigBase  `json:\",inline\"`\n\tUpdatedConfigProperties `json:\",inline\"`\n\tNonComposeBase          `json:\",inline\"`\n\tImageContainer          `json:\",inline\"`\n\tComposeContainer        `json:\",inline\"`\n\tDockerfileContainer     `json:\",inline\"`\n\tRunningContainer        `json:\",inline\"`\n\n\t// Origin is the origin from where this config was loaded\n\tOrigin string `json:\"-\"`\n}\n\ntype DevContainerConfig struct {\n\tDevContainerConfigBase `json:\",inline\"`\n\tDevContainerActions    `json:\",inline\"`\n\tNonComposeBase         `json:\",inline\"`\n\tImageContainer         `json:\",inline\"`\n\tComposeContainer       `json:\",inline\"`\n\tDockerfileContainer    `json:\",inline\"`\n\tRunningContainer       `json:\",inline\"`\n\n\t// Origin is the origin from where this config was loaded\n\tOrigin string `json:\"-\"`\n}\n\nfunc CloneDevContainerConfig(config *DevContainerConfig) *DevContainerConfig {\n\tout := &DevContainerConfig{}\n\t_ = Convert(config, out)\n\tout.Origin = config.Origin\n\treturn out\n}\n\ntype DevContainerConfigBase struct {\n\t// A name for the dev container which can be displayed to the user.\n\tName string `json:\"name,omitempty\"`\n\n\t// Features to add to the dev container.\n\tFeatures map[string]interface{} `json:\"features,omitempty\"`\n\n\t// Array consisting of the Feature id (without the semantic version) of Features in the order the user wants them to be installed.\n\tOverrideFeatureInstallOrder []string `json:\"overrideFeatureInstallOrder,omitempty\"`\n\n\t// Ports that are forwarded from the container to the local machine. Can be an integer port number, or a string of the format \"host:port_number\".\n\tForwardPorts types.StrIntArray `json:\"forwardPorts,omitempty\"`\n\n\t// Set default properties that are applied when a specific port number is forwarded.\n\tPortsAttributes map[string]PortAttribute `json:\"portAttributes,omitempty\"`\n\n\t// Set default properties that are applied to all ports that don't get properties from the setting `remote.portsAttributes`.\n\tOtherPortsAttributes *PortAttribute `json:\"otherPortsAttributes,omitempty\"`\n\n\t// Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder.\n\tUpdateRemoteUserUID *bool `json:\"updateRemoteUserUID,omitempty\"`\n\n\t// Remote environment variables to set for processes spawned in the container including lifecycle scripts and any remote editor/IDE server process.\n\tRemoteEnv map[string]string `json:\"remoteEnv,omitempty\"`\n\n\t// The username to use for spawning processes in the container including lifecycle scripts and any remote editor/IDE server process. The default is the same user as the container.\n\tRemoteUser string `json:\"remoteUser,omitempty\"`\n\n\t// A command to run locally before anything else. This command is run before \"onCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tInitializeCommand types.LifecycleHook `json:\"initializeCommand,omitempty\"`\n\n\t// Action to take when the user disconnects from the container in their editor. The default is to stop the container.\n\tShutdownAction string `json:\"shutdownAction,omitempty\"`\n\n\t// The user command to wait for before continuing execution in the background while the UI is starting up. The default is \"updateContentCommand\".\n\tWaitFor string `json:\"waitFor,omitempty\"`\n\n\t// User environment probe to run. The default is \"loginInteractiveShell\".\n\tUserEnvProbe string `json:\"userEnvProbe,omitempty\"`\n\n\t// Host hardware requirements.\n\tHostRequirements *HostRequirements `json:\"hostRequirements,omitempty\"`\n\n\t// Whether to overwrite the command specified in the image. The default is true.\n\tOverrideCommand *bool `json:\"overrideCommand,omitempty\"`\n\n\t// The path of the workspace folder inside the container.\n\tWorkspaceFolder string `json:\"workspaceFolder,omitempty\"`\n\n\t// DEPRECATED: Use 'customizations/vscode/settings' instead\n\t// Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again.\n\tSettings map[string]interface{} `json:\"settings,omitempty\"`\n\n\t// DEPRECATED: Use 'customizations/vscode/extensions' instead\n\t// An array of extensions that should be installed into the container.\n\tExtensions []string `json:\"extensions,omitempty\"`\n\n\t// DEPRECATED: Use 'customizations/vscode/devPort' instead\n\t// The port VS Code can use to connect to its backend.\n\tDevPort int `json:\"devPort,omitempty\"`\n}\n\ntype DevContainerActions struct {\n\t// A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tOnCreateCommand types.LifecycleHook `json:\"onCreateCommand,omitempty\"`\n\n\t// A command to run when creating the container and rerun when the workspace content was updated while creating the container.\n\t// This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell.\n\t// If this is an array of strings, it will be run as a single command without shell.\n\tUpdateContentCommand types.LifecycleHook `json:\"updateContentCommand,omitempty\"`\n\n\t// A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostCreateCommand types.LifecycleHook `json:\"postCreateCommand,omitempty\"`\n\n\t// A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostStartCommand types.LifecycleHook `json:\"postStartCommand,omitempty\"`\n\n\t// A command to run when attaching to the container. This command is run after \"postStartCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostAttachCommand types.LifecycleHook `json:\"postAttachCommand,omitempty\"`\n\n\t// Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations.\n\tCustomizations map[string]interface{} `json:\"customizations,omitempty\"`\n}\n\ntype UpdatedConfigProperties struct {\n\t// Entrypoint script that should fire at container start up.\n\tEntrypoints []string `json:\"entrypoints,omitempty\"`\n\n\t// A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tOnCreateCommands []types.LifecycleHook `json:\"onCreateCommand,omitempty\"`\n\n\t// A command to run when creating the container and rerun when the workspace content was updated while creating the container.\n\t// This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell.\n\t// If this is an array of strings, it will be run as a single command without shell.\n\tUpdateContentCommands []types.LifecycleHook `json:\"updateContentCommand,omitempty\"`\n\n\t// A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostCreateCommands []types.LifecycleHook `json:\"postCreateCommand,omitempty\"`\n\n\t// A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostStartCommands []types.LifecycleHook `json:\"postStartCommand,omitempty\"`\n\n\t// A command to run when attaching to the container. This command is run after \"postStartCommand\".\n\t// If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.\n\tPostAttachCommands []types.LifecycleHook `json:\"postAttachCommand,omitempty\"`\n\n\t// Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations.\n\tCustomizations map[string][]interface{} `json:\"customizations,omitempty\"`\n}\n\ntype ComposeContainer struct {\n\t// The name of the docker-compose file(s) used to start the services.\n\tDockerComposeFile types.StrArray `json:\"dockerComposeFile,omitempty\"`\n\n\t// The service you want to work on. This is considered the primary container for your dev environment which your editor will connect to.\n\tService string `json:\"service,omitempty\"`\n\n\t// An array of services that should be started and stopped.\n\tRunServices []string `json:\"runServices,omitempty\"`\n}\n\ntype ImageContainer struct {\n\t// The docker image that will be used to create the container.\n\tImage string `json:\"image,omitempty\"`\n}\n\ntype NonComposeBase struct {\n\t// Application ports that are exposed by the container. This can be a single port or an array of ports. Each port can be a number or a string.\n\t// A number is mapped to the same port on the host. A string is passed to Docker unchanged and can be used to map ports differently,\n\t// e.g. \"8000:8010\".\n\tAppPort types.StrIntArray `json:\"appPort,omitempty\"`\n\n\t// Container environment variables.\n\tContainerEnv map[string]string `json:\"containerEnv,omitempty\"`\n\n\t// The user the container will be started with. The default is the user on the Docker image.\n\tContainerUser string `json:\"containerUser,omitempty\"`\n\n\t// Mounts points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.\n\tMounts []*Mount `json:\"mounts,omitempty\"`\n\n\t// Passes the --init flag when creating the dev container.\n\tInit *bool `json:\"init,omitempty\"`\n\n\t// Passes the --privileged flag when creating the dev container.\n\tPrivileged *bool `json:\"privileged,omitempty\"`\n\n\t// Passes docker capabilities to include when creating the dev container.\n\tCapAdd []string `json:\"capAdd,omitempty\"`\n\n\t// Passes docker security options to include when creating the dev container.\n\tSecurityOpt []string `json:\"securityOpt,omitempty\"`\n\n\t// The arguments required when starting in the container.\n\tRunArgs []string `json:\"runArgs,omitempty\"`\n\n\t// The --mount parameter for docker run. The default is to mount the project folder at /workspaces/$project.\n\tWorkspaceMount string `json:\"workspaceMount,omitempty\"`\n}\n\ntype DockerfileContainer struct {\n\t// The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file.\n\tDockerfile string `json:\"dockerFile,omitempty\"`\n\n\t// The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file.\n\tContext string `json:\"context,omitempty\"`\n\n\t// Docker build-related options.\n\tBuild *ConfigBuildOptions `json:\"build,omitempty\"`\n}\n\ntype RunningContainer struct {\n\tContainerID string `json:\"containerID,omitempty\"`\n}\n\nfunc (d DockerfileContainer) GetDockerfile() string {\n\tif d.Dockerfile != \"\" {\n\t\treturn d.Dockerfile\n\t}\n\tif d.Build != nil && d.Build.Dockerfile != \"\" {\n\t\treturn d.Build.Dockerfile\n\t}\n\treturn \"\"\n}\n\nfunc (d DockerfileContainer) GetContext() string {\n\tif d.Context != \"\" {\n\t\treturn d.Context\n\t}\n\tif d.Build != nil && d.Build.Context != \"\" {\n\t\treturn d.Build.Context\n\t}\n\treturn \"\"\n}\n\nfunc (d DockerfileContainer) GetTarget() string {\n\tif d.Build != nil {\n\t\treturn d.Build.Target\n\t}\n\treturn \"\"\n}\n\nfunc (d DockerfileContainer) GetArgs() map[string]string {\n\tif d.Build != nil {\n\t\treturn d.Build.Args\n\t}\n\treturn nil\n}\n\nfunc (d DockerfileContainer) GetOptions() []string {\n\tif d.Build != nil {\n\t\treturn d.Build.Options\n\t}\n\treturn nil\n}\n\nfunc (d DockerfileContainer) GetCacheFrom() types.StrArray {\n\tif d.Build != nil {\n\t\treturn d.Build.CacheFrom\n\t}\n\treturn nil\n}\n\ntype ConfigBuildOptions struct {\n\t// The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file.\n\tDockerfile string `json:\"dockerfile,omitempty\"`\n\n\t// The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file.\n\tContext string `json:\"context,omitempty\"`\n\n\t// Target stage in a multi-stage build.\n\tTarget string `json:\"target,omitempty\"`\n\n\t// Build arguments.\n\tArgs map[string]string `json:\"args,omitempty\"`\n\n\t// The image to consider as a cache. Use an array to specify multiple images.\n\tCacheFrom types.StrArray `json:\"cacheFrom,omitempty\"`\n\n\t// Build cli options\n\tOptions []string `json:\"options,omitempty\"`\n}\n\ntype HostRequirements struct {\n\t// Number of required CPUs.\n\tCPUs int `json:\"cpus,omitempty\"`\n\n\t// Amount of required RAM in bytes. Supports units tb, gb, mb and kb.\n\tMemory string `json:\"memory,omitempty\"`\n\n\t// Amount of required disk space in bytes. Supports units tb, gb, mb and kb.\n\tStorage string `json:\"storage,omitempty\"`\n\n\t// If GPU support should be enabled\n\tGPU types.StrBool `json:\"gpu,omitempty\"`\n}\n\ntype PortAttribute struct {\n\t// Defines the action that occurs when the port is discovered for automatic forwarding\n\t// default=notify\n\tOnAutoForward string `json:\"onAutoForward,omitempty\"`\n\n\t// Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.\n\tElevateIfNeeded bool `json:\"elevateIfNeeded,omitempty\"`\n\n\t// Label that will be shown in the UI for this port.\n\t// default=Application\n\tLabel string `json:\"label,omitempty\"`\n\n\t// When true, a modal dialog will show if the chosen local port isn't used for forwarding.\n\tRequireLocalPort bool `json:\"requireLocalPort,omitempty\"`\n\n\t// The protocol to use when forwarding this port.\n\tProtocol string `json:\"protocol,omitempty\"`\n}\n\ntype DevPodCustomizations struct {\n\tPrebuildRepository         types.StrArray    `json:\"prebuildRepository,omitempty\"`\n\tFeatureDownloadHTTPHeaders map[string]string `json:\"featureDownloadHTTPHeaders,omitempty\"`\n}\n\ntype VSCodeCustomizations struct {\n\tSettings   map[string]interface{} `json:\"settings,omitempty\"`\n\tExtensions []string               `json:\"extensions,omitempty\"`\n\tDevPort    int                    `json:\"devPort,omitempty\"`\n}\n\ntype Mount struct {\n\tType     string   `json:\"type,omitempty\"`\n\tSource   string   `json:\"source,omitempty\"`\n\tTarget   string   `json:\"target,omitempty\"`\n\tExternal bool     `json:\"external,omitempty\"`\n\tOther    []string `json:\"other,omitempty\"`\n}\n\nfunc (m *Mount) String() string {\n\tcomponents := []string{}\n\tif m.Type != \"\" {\n\t\tcomponents = append(components, \"type=\"+m.Type)\n\t}\n\tif m.Source != \"\" {\n\t\tcomponents = append(components, \"src=\"+m.Source)\n\t}\n\tif m.Target != \"\" {\n\t\tcomponents = append(components, \"dst=\"+m.Target)\n\t}\n\tif m.External {\n\t\tcomponents = append(components, \"external=\"+strconv.FormatBool(m.External))\n\t}\n\tcomponents = append(components, m.Other...)\n\treturn strings.Join(components, \",\")\n}\n\nfunc GetContextPath(parsedConfig *DevContainerConfig) string {\n\tcontext := parsedConfig.GetContext()\n\tdockerfilePath := parsedConfig.GetDockerfile()\n\n\tconfigDir := path.Dir(filepath.ToSlash(parsedConfig.Origin))\n\tif context != \"\" {\n\t\treturn filepath.FromSlash(path.Join(configDir, context))\n\t} else if dockerfilePath != \"\" {\n\t\treturn filepath.FromSlash(path.Join(configDir, path.Dir(dockerfilePath)))\n\t}\n\n\treturn configDir\n}\n\nfunc ParseMount(str string) Mount {\n\tretMount := Mount{}\n\tsplitted := strings.Split(str, \",\")\n\tfor _, split := range splitted {\n\t\tsplitted2 := strings.Split(split, \"=\")\n\t\tkey := splitted2[0]\n\t\tif key == \"src\" || key == \"source\" {\n\t\t\tretMount.Source = splitted2[1]\n\t\t} else if key == \"dst\" || key == \"destination\" || key == \"target\" {\n\t\t\tretMount.Target = splitted2[1]\n\t\t} else if key == \"type\" {\n\t\t\tretMount.Type = splitted2[1]\n\t\t} else if key == \"external\" {\n\t\t\tretMount.External, _ = strconv.ParseBool(splitted2[1])\n\t\t} else {\n\t\t\tretMount.Other = append(retMount.Other, split)\n\t\t}\n\t}\n\n\treturn retMount\n}\n\nfunc (m *Mount) UnmarshalJSON(data []byte) error {\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase string:\n\t\t*m = ParseMount(obj)\n\t\treturn nil\n\tcase map[string]interface{}:\n\t\tsourceStr, ok := obj[\"source\"].(string)\n\t\tif ok {\n\t\t\tm.Source = sourceStr\n\t\t}\n\t\ttargetStr, ok := obj[\"target\"].(string)\n\t\tif ok {\n\t\t\tm.Target = targetStr\n\t\t}\n\t\ttypeStr, ok := obj[\"type\"].(string)\n\t\tif ok {\n\t\t\tm.Type = typeStr\n\t\t}\n\t\texternalStr, ok := obj[\"external\"].(bool)\n\t\tif ok {\n\t\t\tm.External = externalStr\n\t\t}\n\t\totherInterface, ok := obj[\"other\"].([]interface{})\n\t\tif ok {\n\t\t\totherStr := make([]string, len(otherInterface))\n\t\t\tfor i := range otherInterface {\n\t\t\t\totherStr[i] = otherInterface[i].(string)\n\t\t\t}\n\t\t\tm.Other = otherStr\n\t\t}\n\t\treturn nil\n\t}\n\treturn types.ErrUnsupportedType\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/container_details.go",
    "content": "package config\n\ntype ImageDetails struct {\n\tID     string\n\tConfig ImageDetailsConfig\n}\n\ntype ImageDetailsConfig struct {\n\tUser       string\n\tEnv        []string\n\tLabels     map[string]string\n\tEntrypoint []string\n\tCmd        []string\n}\n\ntype ContainerDetails struct {\n\tID      string                 `json:\"ID,omitempty\"`\n\tCreated string                 `json:\"Created,omitempty\"`\n\tState   ContainerDetailsState  `json:\"State,omitempty\"`\n\tConfig  ContainerDetailsConfig `json:\"Config,omitempty\"`\n}\n\ntype ContainerDetailsConfig struct {\n\tLabels map[string]string `json:\"Labels,omitempty\"`\n\n\t// WorkingDir specifies default working directory inside the container\n\tWorkingDir string `json:\"WorkingDir,omitempty\"`\n\n\t// LegacyUser shouldn't get used anymore and is only there for backwards compatibility, please\n\t// use the label config.UserLabel instead\n\tLegacyUser string `json:\"User,omitempty\"`\n\t// LegacyImage shouldn't get used anymore and is only there for testing\n\tLegacyImage string `json:\"Image,omitempty\"`\n}\n\ntype ContainerDetailsState struct {\n\tStatus    string `json:\"Status,omitempty\"`\n\tStartedAt string `json:\"StartedAt,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/feature.go",
    "content": "package config\n\nimport \"github.com/loft-sh/devpod/pkg/types\"\n\ntype FeatureSet struct {\n\tConfigID string\n\tFolder   string\n\tConfig   *FeatureConfig\n\tOptions  interface{}\n}\n\ntype FeatureConfig struct {\n\t// ID of the Feature. The id should be unique in the context of the repository/published package where the feature exists and must match the name of the directory where the devcontainer-feature.json resides.\n\tID string `json:\"id,omitempty\"`\n\n\t// Display name of the Feature.\n\tName string `json:\"name,omitempty\"`\n\n\t// The version of the Feature. Follows the semanatic versioning (semver) specification.\n\tVersion string `json:\"version,omitempty\"`\n\n\t// Description of the Feature. For the best appearance in an implementing tool, refrain from including markdown or HTML in the description.\n\tDescription string `json:\"description,omitempty\"`\n\n\t// Entrypoint script that should fire at container start up.\n\tEntrypoint string `json:\"entrypoint,omitempty\"`\n\n\t// Indicates that the Feature is deprecated, and will not receive any further updates/support. This property is intended to be used by the supporting tools for highlighting Feature deprecation.\n\tDeprecated bool `json:\"deprecated,omitempty\"`\n\n\t// Array of old IDs used to publish this Feature. The property is useful for renaming a currently published Feature within a single namespace.\n\tLegacyIds []string `json:\"legacyIds,omitempty\"`\n\n\t// Possible user-configurable options for this Feature. The selected options will be passed as environment variables when installing the Feature into the container.\n\tOptions map[string]FeatureConfigOption `json:\"options,omitempty\"`\n\n\t// URL to documentation for the Feature.\n\tDocumentationURL string `json:\"documentationURL,omitempty\"`\n\n\t// URL to the license for the Feature.\n\tLicenseURL string `json:\"licenseURL,omitempty\"`\n\n\t// Passes docker capabilities to include when creating the dev container.\n\tCapAdd []string `json:\"capAdd,omitempty\"`\n\n\t// Adds the tiny init process to the container (--init) when the Feature is used.\n\tInit *bool `json:\"init,omitempty\"`\n\n\t// Sets privileged mode (--privileged) for the container.\n\tPrivileged *bool `json:\"privileged,omitempty\"`\n\n\t// Sets container security options to include when creating the container.\n\tSecurityOpt []string `json:\"securityOpt,omitempty\"`\n\n\t// Mounts a volume or bind mount into the container.\n\tMounts []*Mount `json:\"mounts,omitempty\"`\n\n\t// Array of ID's of Features that should execute before this one. Allows control for feature authors on soft dependencies between different Features.\n\tInstallsAfter []string `json:\"installsAfter,omitempty\"`\n\n\t// Container environment variables.\n\tContainerEnv map[string]string `json:\"containerEnv,omitempty\"`\n\n\t// Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations.\n\tCustomizations map[string]interface{} `json:\"customizations,omitempty\"`\n\n\t// Origin is the path where the feature was loaded from\n\tOrigin string `json:\"-\"`\n}\n\ntype FeatureConfigOption struct {\n\t// Default value if the user omits this option from their configuration.\n\tDefault types.StrBool `json:\"default,omitempty\"`\n\n\t// A description of the option displayed to the user by a supporting tool.\n\tDescription string `json:\"description,omitempty\"`\n\n\t// The type of the option. Can be 'boolean' or 'string'.  Options of type 'string' should use the 'enum' or 'proposals' property to provide a list of allowed values.\n\tType string `json:\"type,omitempty\"`\n\n\t// Allowed values for this option.  Unlike 'proposals', the user cannot provide a custom value not included in the 'enum' array.\n\tEnum []string `json:\"enum,omitempty\"`\n\n\t// Suggested values for this option.  Unlike 'enum', the 'proposals' attribute indicates the installation script can handle arbitrary values provided by the user.\n\tProposals []string `json:\"proposals,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/merge.go",
    "content": "package config\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\nfunc MergeConfiguration(config *DevContainerConfig, imageMetadataEntries []*ImageMetadata) (*MergedDevContainerConfig, error) {\n\tcustomizations := map[string][]interface{}{}\n\tfor _, imageMetadata := range imageMetadataEntries {\n\t\tfor k, v := range imageMetadata.Customizations {\n\t\t\tcustomizations[k] = append(customizations[k], v)\n\t\t}\n\t}\n\n\tcopiedConfig := CloneDevContainerConfig(config)\n\n\t// reverse the order\n\treversed := ReverseSlice(imageMetadataEntries)\n\n\t// merge config\n\tmergedConfig := &MergedDevContainerConfig{\n\t\tUpdatedConfigProperties: UpdatedConfigProperties{\n\t\t\tCustomizations: customizations,\n\t\t},\n\t\tDevContainerConfigBase: copiedConfig.DevContainerConfigBase,\n\t\tNonComposeBase:         copiedConfig.NonComposeBase,\n\t\tImageContainer:         copiedConfig.ImageContainer,\n\t\tComposeContainer:       copiedConfig.ComposeContainer,\n\t\tDockerfileContainer:    copiedConfig.DockerfileContainer,\n\t}\n\n\t// adjust config\n\tmergedConfig.Init = some(reversed, func(entry *ImageMetadata) *bool { return entry.Init })\n\tmergedConfig.Privileged = some(reversed, func(entry *ImageMetadata) *bool { return entry.Privileged })\n\tmergedConfig.CapAdd = unique(unionOrNil(reversed, func(entry *ImageMetadata) []string { return entry.CapAdd }))\n\tmergedConfig.SecurityOpt = unique(unionOrNil(reversed, func(entry *ImageMetadata) []string { return entry.SecurityOpt }))\n\tmergedConfig.Entrypoints = collectOrNil(reversed, func(entry *ImageMetadata) string { return entry.Entrypoint })\n\tmergedConfig.Mounts = mergeMounts(reversed)\n\tmergedConfig.OnCreateCommands = mergeLifestyleHooks(reversed, func(entry *ImageMetadata) types.LifecycleHook { return entry.OnCreateCommand })\n\tmergedConfig.UpdateContentCommands = mergeLifestyleHooks(reversed, func(entry *ImageMetadata) types.LifecycleHook { return entry.UpdateContentCommand })\n\tmergedConfig.PostCreateCommands = mergeLifestyleHooks(reversed, func(entry *ImageMetadata) types.LifecycleHook { return entry.PostCreateCommand })\n\tmergedConfig.PostStartCommands = mergeLifestyleHooks(reversed, func(entry *ImageMetadata) types.LifecycleHook { return entry.PostStartCommand })\n\tmergedConfig.PostAttachCommands = mergeLifestyleHooks(reversed, func(entry *ImageMetadata) types.LifecycleHook { return entry.PostAttachCommand })\n\tmergedConfig.WaitFor = firstString(reversed, func(entry *ImageMetadata) string { return entry.WaitFor })\n\tmergedConfig.RemoteUser = firstString(reversed, func(entry *ImageMetadata) string { return entry.RemoteUser })\n\tmergedConfig.ContainerUser = firstString(reversed, func(entry *ImageMetadata) string { return entry.ContainerUser })\n\tmergedConfig.UserEnvProbe = firstString(reversed, func(entry *ImageMetadata) string { return entry.UserEnvProbe })\n\tmergedConfig.RemoteEnv = mergeMaps(reversed, func(entry *ImageMetadata) map[string]string { return entry.RemoteEnv })\n\tmergedConfig.ContainerEnv = mergeMaps(reversed, func(entry *ImageMetadata) map[string]string { return entry.ContainerEnv })\n\tmergedConfig.PortsAttributes = mergeMaps(reversed, func(entry *ImageMetadata) map[string]PortAttribute { return entry.PortsAttributes })\n\tmergedConfig.OverrideCommand = some(reversed, func(entry *ImageMetadata) *bool { return entry.OverrideCommand })\n\tmergedConfig.OtherPortsAttributes = mergeOtherPortsAttributes(reversed)\n\tmergedConfig.ShutdownAction = firstString(reversed, func(entry *ImageMetadata) string { return entry.ShutdownAction })\n\tmergedConfig.ForwardPorts = mergeForwardPorts(reversed)\n\tmergedConfig.UpdateRemoteUserUID = some(reversed, func(entry *ImageMetadata) *bool { return entry.UpdateRemoteUserUID })\n\tmergedConfig.HostRequirements = mergeHostRequirements(reversed)\n\n\treturn mergedConfig, nil\n}\n\nfunc mergeOtherPortsAttributes(entries []*ImageMetadata) *PortAttribute {\n\tfor _, entry := range entries {\n\t\tif entry.OtherPortsAttributes != nil {\n\t\t\treturn entry.OtherPortsAttributes\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc mergeMaps[K any](entries []*ImageMetadata, m func(entry *ImageMetadata) map[string]K) map[string]K {\n\tretMap := map[string]K{}\n\tfor _, entry := range entries {\n\t\tentryMap := m(entry)\n\t\tfor k, v := range entryMap {\n\t\t\tretMap[k] = v\n\t\t}\n\t}\n\n\treturn retMap\n}\n\nfunc firstString(entries []*ImageMetadata, m func(entry *ImageMetadata) string) string {\n\tfor _, entry := range entries {\n\t\tstr := m(entry)\n\t\tif str != \"\" {\n\t\t\treturn str\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc mergeHostRequirements(entries []*ImageMetadata) *HostRequirements {\n\t// TODO: union requirements here\n\tfor _, entry := range entries {\n\t\tif entry.HostRequirements != nil {\n\t\t\treturn entry.HostRequirements\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc mergeForwardPorts(entries []*ImageMetadata) types.StrIntArray {\n\tportMap := map[string]bool{}\n\tvar retPorts types.StrIntArray\n\tfor _, entry := range entries {\n\t\tfor _, port := range entry.ForwardPorts {\n\t\t\tportString := port\n\t\t\t_, err := strconv.Atoi(portString)\n\t\t\tif err == nil {\n\t\t\t\tportString = \"localhost:\" + portString\n\t\t\t}\n\t\t\tif portMap[portString] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tportMap[portString] = true\n\t\t\tretPorts = append(retPorts, port)\n\t\t}\n\t}\n\n\treturn retPorts\n}\n\nfunc mergeMounts(entries []*ImageMetadata) []*Mount {\n\ttargetMap := map[string]bool{}\n\tret := []*Mount{}\n\n\treversedEntries := ReverseSlice(entries)\n\tfor _, entry := range reversedEntries {\n\t\tfor _, mount := range entry.Mounts {\n\t\t\tif targetMap[mount.Target] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tret = append(ret, mount)\n\t\t\ttargetMap[mount.Target] = true\n\t\t}\n\t}\n\treturn ReverseSlice(ret)\n}\n\nfunc mergeLifestyleHooks(entries []*ImageMetadata, m func(entry *ImageMetadata) types.LifecycleHook) []types.LifecycleHook {\n\tvar out []types.LifecycleHook\n\tfor _, entry := range entries {\n\t\tval := m(entry)\n\t\tif len(val) > 0 {\n\t\t\tout = append(out, m(entry))\n\t\t}\n\t}\n\treturn out\n}\n\nfunc collectOrNil[T comparable, K any](entries []K, m func(entry K) T) []T {\n\tvar out []T\n\tfor _, entry := range entries {\n\t\tvar defaultValue T\n\t\tval := m(entry)\n\t\tif val != defaultValue {\n\t\t\tout = append(out, m(entry))\n\t\t}\n\t}\n\n\treturn out\n}\n\nfunc unionOrNil[T any, K any](entries []K, m func(entry K) []T) []T {\n\tvar out []T\n\tfor _, entry := range entries {\n\t\tvals := m(entry)\n\t\tif len(vals) > 0 {\n\t\t\tout = append(out, vals...)\n\t\t}\n\t}\n\n\treturn out\n}\n\nfunc unique[T comparable](s []T) []T {\n\tinResult := make(map[T]bool)\n\tvar result []T\n\tfor _, str := range s {\n\t\tif _, ok := inResult[str]; !ok {\n\t\t\tinResult[str] = true\n\t\t\tresult = append(result, str)\n\t\t}\n\t}\n\treturn result\n}\n\nfunc some[T any](entries []T, m func(entry T) *bool) *bool {\n\tfor _, entry := range entries {\n\t\tboolPtr := m(entry)\n\t\tif boolPtr != nil {\n\t\t\treturn boolPtr\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ReverseSlice[T comparable](s []T) []T {\n\tvar r []T\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tr = append(r, s[i])\n\t}\n\treturn r\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/metadata.go",
    "content": "package config\n\ntype ImageMetadataConfig struct {\n\tRaw    []*ImageMetadata\n\tConfig []*ImageMetadata\n}\n\ntype ImageMetadata struct {\n\tID                     string `json:\"id,omitempty\"`\n\tEntrypoint             string `json:\"entrypoint,omitempty\"`\n\tDevContainerConfigBase `json:\",inline\"`\n\tDevContainerActions    `json:\",inline\"`\n\tNonComposeBase         `json:\",inline\"`\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/parse.go",
    "content": "package config\n\nimport (\n\t\"bufio\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\tpath2 \"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\tdoublestar \"github.com/bmatcuk/doublestar/v4\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/tidwall/jsonc\"\n)\n\nconst DEVCONTAINER_FEATURE_FILE_NAME = \"devcontainer-feature.json\"\n\nfunc ParseDevContainerFeature(folder string) (*FeatureConfig, error) {\n\tpath := filepath.Join(folder, DEVCONTAINER_FEATURE_FILE_NAME)\n\t_, err := os.Stat(path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s is missing in feature folder\", DEVCONTAINER_FEATURE_FILE_NAME)\n\t}\n\n\tpath, err = filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"make path absolute\")\n\t}\n\n\tdata, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfeatureConfig := &FeatureConfig{}\n\terr = json.Unmarshal(jsonc.ToJSON(data), featureConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfeatureConfig.Origin = path\n\treturn featureConfig, nil\n}\n\nfunc SaveDevContainerJSON(config *DevContainerConfig) error {\n\tif config.Origin == \"\" {\n\t\treturn fmt.Errorf(\"no origin in config\")\n\t}\n\n\terr := os.MkdirAll(filepath.Dir(config.Origin), 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.WriteFile(config.Origin, out, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc ParseDevContainerJSON(folder, relativePath string) (*DevContainerConfig, error) {\n\tpath := \"\"\n\tif relativePath != \"\" {\n\t\tpath = path2.Join(filepath.ToSlash(folder), relativePath)\n\t\t_, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"devcontainer path %s doesn't exist: %w\", path, err)\n\t\t}\n\t} else {\n\t\tpath = filepath.Join(folder, \".devcontainer\", \"devcontainer.json\")\n\t\t_, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\tpath = filepath.Join(folder, \".devcontainer.json\")\n\t\t\t_, err = os.Stat(path)\n\t\t\tif err != nil {\n\t\t\t\tmatches, err := doublestar.FilepathGlob(filepath.ToSlash(filepath.Clean(folder)) + \"/.devcontainer/**/devcontainer.json\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t} else if len(matches) == 0 {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar err error\n\tpath, err = filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"make path absolute\")\n\t}\n\n\tbytes, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdevContainer := &DevContainerConfig{}\n\terr = json.Unmarshal(jsonc.ToJSON(bytes), devContainer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdevContainer.Origin = path\n\treturn replaceLegacy(devContainer)\n}\n\nfunc replaceLegacy(config *DevContainerConfig) (*DevContainerConfig, error) {\n\tif len(config.Extensions) == 0 && len(config.Settings) == 0 && config.DevPort == 0 {\n\t\treturn config, nil\n\t}\n\n\t// make sure customizations exist\n\tif config.Customizations == nil {\n\t\tconfig.Customizations = map[string]interface{}{}\n\t}\n\n\tvsCodeConfig := &VSCodeCustomizations{}\n\tvscode, ok := config.Customizations[\"vscode\"]\n\tif ok {\n\t\terr := Convert(vscode, &vsCodeConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif len(config.Extensions) > 0 {\n\t\tvsCodeConfig.Extensions = config.Extensions\n\t\tconfig.Extensions = nil\n\t}\n\n\tif len(config.Settings) > 0 {\n\t\tif vsCodeConfig.Settings == nil {\n\t\t\tvsCodeConfig.Settings = map[string]interface{}{}\n\t\t}\n\n\t\tfor k, v := range config.Settings {\n\t\t\t_, exists := vsCodeConfig.Settings[k]\n\t\t\tif !exists {\n\t\t\t\tvsCodeConfig.Settings[k] = v\n\t\t\t}\n\t\t}\n\n\t\tconfig.Settings = nil\n\t}\n\n\tif vsCodeConfig.DevPort == 0 {\n\t\tvsCodeConfig.DevPort = config.DevPort\n\t\tconfig.DevPort = 0\n\t}\n\n\tconfig.Customizations[\"vscode\"] = vsCodeConfig\n\treturn config, nil\n}\n\nfunc Convert(from interface{}, to interface{}) error {\n\tout, err := json.Marshal(from)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn json.Unmarshal(out, to)\n}\n\nfunc ParseKeyValueFile(filename string) ([]string, error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\tkeyValuePairs := []string{}\n\tscanner := bufio.NewScanner(f)\n\tlineNum := 1\n\tfor scanner.Scan() {\n\t\tscannedBytes := scanner.Bytes()\n\t\tif !utf8.Valid(scannedBytes) {\n\t\t\treturn nil, fmt.Errorf(\"env file %s contains invalid utf8 bytes in line %d\", filename, lineNum)\n\t\t}\n\t\tline := string(scannedBytes)\n\t\t// skip commented or empty lines\n\t\tif len(line) > 0 && !strings.HasPrefix(line, \"#\") {\n\t\t\tkey, value, found := strings.Cut(line, \"=\")\n\t\t\tif len(key) == 0 || strings.Contains(key, \" \") {\n\t\t\t\treturn nil, fmt.Errorf(\"env file %s contains invalid variable key in line %d: %s\", filename, lineNum, line)\n\t\t\t} else if len(value) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"env file %s contains invalid variable value in line %d: %s\", filename, lineNum, line)\n\t\t\t}\n\t\t\tif found {\n\t\t\t\tkeyValuePairs = append(keyValuePairs, line)\n\t\t\t}\n\t\t}\n\t\tlineNum++\n\t}\n\treturn keyValuePairs, nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/parse_test.go",
    "content": "package config\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestSaveDevContainerJSON(t *testing.T) {\n\ttype args struct {\n\t\tconfig *DevContainerConfig\n\t}\n\ttests := []struct {\n\t\tname     string\n\t\targs     args\n\t\twantErr  bool\n\t\twantJSON string\n\t}{\n\t\t{\n\t\t\tname: \"test omit build field in devcontainer.json\",\n\t\t\targs: args{\n\t\t\t\tconfig: &DevContainerConfig{\n\t\t\t\t\tImageContainer: ImageContainer{\n\t\t\t\t\t\tImage: \"test\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\twantErr:  false,\n\t\t\twantJSON: `{\"image\":\"test\"}`,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ttmpDir, err := os.MkdirTemp(os.TempDir(), \"test-devcontainer\")\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Failed to create temp dir: %v\", err)\n\t\t\t}\n\t\t\tdefer os.RemoveAll(tmpDir)\n\n\t\t\ttt.args.config.Origin = filepath.Join(tmpDir, \"devcontainer.json\")\n\n\t\t\tif err := SaveDevContainerJSON(tt.args.config); (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"SaveDevContainerJSON() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t}\n\n\t\t\tcontents, err := os.ReadFile(tt.args.config.Origin)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Failed to read file contents: %v\", err)\n\t\t\t}\n\t\t\tif string(contents) != tt.wantJSON {\n\t\t\t\tt.Errorf(\"Expected JSON = %v, got %v\", tt.wantJSON, string(contents))\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/prebuild.go",
    "content": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tutil \"github.com/loft-sh/devpod/pkg/util/hash\"\n\t\"github.com/moby/patternmatcher\"\n\t\"github.com/moby/patternmatcher/ignorefile\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/hash\"\n)\n\nfunc CalculatePrebuildHash(\n\toriginalConfig *DevContainerConfig,\n\tplatform, architecture, contextPath, dockerfilePath, dockerfileContent string,\n\tbuildInfo *ImageBuildInfo,\n\tlog log.Logger) (string, error) {\n\tparsedConfig := CloneDevContainerConfig(originalConfig)\n\n\tif platform != \"\" {\n\t\tsplitted := strings.Split(platform, \"/\")\n\t\tif len(splitted) == 2 && splitted[0] == \"linux\" {\n\t\t\tarchitecture = splitted[1]\n\t\t}\n\t}\n\n\t// delete all options that are not relevant for the build\n\tparsedConfig.Origin = \"\"\n\tparsedConfig.DevContainerActions = DevContainerActions{}\n\tparsedConfig.NonComposeBase = NonComposeBase{}\n\tparsedConfig.DevContainerConfigBase = DevContainerConfigBase{\n\t\tName:                        parsedConfig.Name,\n\t\tFeatures:                    parsedConfig.Features,\n\t\tOverrideFeatureInstallOrder: parsedConfig.OverrideFeatureInstallOrder,\n\t}\n\tparsedConfig.ImageContainer = ImageContainer{\n\t\tImage: parsedConfig.Image,\n\t}\n\tparsedConfig.ComposeContainer = ComposeContainer{}\n\tparsedConfig.DockerfileContainer = DockerfileContainer{\n\t\tDockerfile: parsedConfig.Dockerfile,\n\t\tContext:    parsedConfig.Context,\n\t\tBuild:      parsedConfig.Build,\n\t}\n\n\t// marshal the config\n\tconfigStr, err := json.Marshal(parsedConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// find out excludes from dockerignore\n\texcludes, err := readDockerignore(contextPath, dockerfilePath)\n\tif err != nil {\n\t\treturn \"\", errors.Errorf(\"Error reading .dockerignore: %v\", err)\n\t}\n\texcludes = append(excludes, DevPodContextFeatureFolder+\"/\")\n\n\t// find exact files to hash\n\t// todo pass down target or search all\n\t// todo update DirectoryHash function\n\tvar includes []string\n\tif buildInfo.Dockerfile != nil {\n\t\tincludes = buildInfo.Dockerfile.BuildContextFiles()\n\t}\n\tlog.Debug(\"Build context files to use for hash are \", includes)\n\n\t// get hash of the context directory\n\tcontextHash, err := util.DirectoryHash(contextPath, excludes, includes)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tlog.Debugf(\"Prebuild hash from:\")\n\tlog.Debugf(\"    Arch: %s\", architecture)\n\tlog.Debugf(\"    Config: %s\", string(configStr))\n\tlog.Debugf(\"    DockerfileContent: %s\", dockerfileContent)\n\tlog.Debugf(\"    ContextHash: %s\", contextHash)\n\treturn \"devpod-\" + hash.String(architecture + string(configStr) + dockerfileContent + contextHash)[:32], nil\n}\n\n// readDockerignore reads the .dockerignore file in the context directory and\n// returns the list of paths to exclude.\nfunc readDockerignore(contextDir string, dockerfile string) ([]string, error) {\n\tvar (\n\t\tf        *os.File\n\t\terr      error\n\t\texcludes = []string{}\n\t)\n\n\tdockerignorefilepath := dockerfile + \".dockerignore\"\n\tif filepath.IsAbs(dockerignorefilepath) {\n\t\tf, err = os.Open(dockerignorefilepath)\n\t} else {\n\t\tf, err = os.Open(filepath.Join(contextDir, dockerignorefilepath))\n\t}\n\tif os.IsNotExist(err) {\n\t\tdockerignorefilepath = \".dockerignore\"\n\t\tf, err = os.Open(filepath.Join(contextDir, dockerignorefilepath))\n\t\tif os.IsNotExist(err) {\n\t\t\treturn ensureDockerIgnoreAndDockerFile(excludes, dockerfile, dockerignorefilepath), nil\n\t\t} else if err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer f.Close()\n\n\texcludes, err = ignorefile.ReadAll(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ensureDockerIgnoreAndDockerFile(excludes, dockerfile, dockerignorefilepath), nil\n}\n\nfunc ensureDockerIgnoreAndDockerFile(excludes []string, dockerfile, dockerignorefilepath string) []string {\n\t_, dockerignorefile := filepath.Split(dockerignorefilepath)\n\tif keep, _ := patternmatcher.MatchesOrParentMatches(dockerignorefile, excludes); keep {\n\t\texcludes = append(excludes, \"!\"+dockerignorefile)\n\t}\n\n\tif keep, _ := patternmatcher.MatchesOrParentMatches(dockerfile, excludes); keep {\n\t\texcludes = append(excludes, \"!\"+dockerfile)\n\t}\n\n\treturn excludes\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/prepareprobe.go",
    "content": "//go:build !windows\n\npackage config\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc PrepareCmdUser(cmd *exec.Cmd, userName string) error {\n\t// execute as user\n\tu, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"lookup user %s: %w\", userName, err)\n\t}\n\tuid, _ := strconv.Atoi(u.Uid)\n\tgid, _ := strconv.Atoi(u.Gid)\n\tcmd.Env = patchEnvVars(cmd.Environ(), map[string]string{\n\t\t\"HOME\":    u.HomeDir,\n\t\t\"USER\":    u.Username,\n\t\t\"LOGNAME\": u.Username,\n\t})\n\n\tcmd.SysProcAttr = &syscall.SysProcAttr{\n\t\tCredential: &syscall.Credential{\n\t\t\tUid: uint32(uid),\n\t\t\tGid: uint32(gid),\n\t\t},\n\t}\n\n\treturn nil\n}\n\nfunc patchEnvVars(env []string, patches map[string]string) []string {\n\tnewEnv := map[string]string{}\n\tfor _, v := range env {\n\t\tt := strings.Split(v, \"=\")\n\t\tnewEnv[t[0]] = t[1]\n\t}\n\n\t// apply patches\n\tfor k, v := range patches {\n\t\tnewEnv[k] = v\n\t}\n\n\tretEnv := []string{}\n\tfor k, v := range newEnv {\n\t\tretEnv = append(retEnv, fmt.Sprintf(\"%s=%s\", k, v))\n\t}\n\n\treturn retEnv\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/prepareprobe_windows.go",
    "content": "//go:build windows\n\npackage config\n\nimport \"os/exec\"\n\nfunc PrepareCmdUser(cmd *exec.Cmd, userName string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/result.go",
    "content": "package config\n\nconst UserLabel = \"devpod.user\"\n\ntype Result struct {\n\tDevContainerConfigWithPath *DevContainerConfigWithPath `json:\"DevContainerConfigWithPath\"`\n\tMergedConfig               *MergedDevContainerConfig   `json:\"MergedConfig\"`\n\tSubstitutionContext        *SubstitutionContext        `json:\"SubstitutionContext\"`\n\tContainerDetails           *ContainerDetails           `json:\"ContainerDetails\"`\n}\n\ntype DevContainerConfigWithPath struct {\n\t// Config is the devcontainer.json config\n\tConfig *DevContainerConfig `json:\"config,omitempty\"`\n\n\t// Path is the relative path to the devcontainer.json from the workspace folder\n\tPath string `json:\"path,omitempty\"`\n}\n\nfunc GetMounts(result *Result) []*Mount {\n\tworkspaceMount := ParseMount(result.SubstitutionContext.WorkspaceMount)\n\tmounts := []*Mount{&workspaceMount}\n\tfor _, m := range result.MergedConfig.Mounts {\n\t\tif m.Type == \"bind\" {\n\t\t\tmounts = append(mounts, m)\n\t\t}\n\t}\n\n\treturn mounts\n}\n\nfunc GetRemoteUser(result *Result) string {\n\tuser := \"root\"\n\tif result != nil {\n\t\tif result.MergedConfig != nil && result.MergedConfig.RemoteUser != \"\" {\n\t\t\tuser = result.MergedConfig.RemoteUser\n\t\t} else if result.ContainerDetails != nil && result.ContainerDetails.Config.Labels != nil && result.ContainerDetails.Config.Labels[UserLabel] != \"\" {\n\t\t\tuser = result.ContainerDetails.Config.Labels[UserLabel]\n\t\t}\n\t}\n\n\treturn user\n}\n\nfunc GetDevPodCustomizations(parsedConfig *DevContainerConfig) *DevPodCustomizations {\n\tif parsedConfig.Customizations == nil || parsedConfig.Customizations[\"devpod\"] == nil {\n\t\treturn &DevPodCustomizations{}\n\t}\n\n\tdevPod := &DevPodCustomizations{}\n\terr := Convert(parsedConfig.Customizations[\"devpod\"], devPod)\n\tif err != nil {\n\t\treturn &DevPodCustomizations{}\n\t}\n\n\treturn devPod\n}\n\nfunc GetVSCodeConfiguration(mergedConfig *MergedDevContainerConfig) *VSCodeCustomizations {\n\tif mergedConfig.Customizations == nil || mergedConfig.Customizations[\"vscode\"] == nil {\n\t\treturn &VSCodeCustomizations{}\n\t}\n\n\tretVSCodeCustomizations := &VSCodeCustomizations{\n\t\tSettings:   map[string]interface{}{},\n\t\tExtensions: nil,\n\t}\n\tfor _, customization := range mergedConfig.Customizations[\"vscode\"] {\n\t\tvsCode := &VSCodeCustomizations{}\n\t\terr := Convert(customization, vsCode)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, extension := range vsCode.Extensions {\n\t\t\tif contains(retVSCodeCustomizations.Extensions, extension) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tretVSCodeCustomizations.Extensions = append(retVSCodeCustomizations.Extensions, extension)\n\t\t}\n\n\t\tfor k, v := range vsCode.Settings {\n\t\t\tretVSCodeCustomizations.Settings[k] = v\n\t\t}\n\t}\n\n\treturn retVSCodeCustomizations\n}\n\nfunc contains(stack []string, k string) bool {\n\tfor _, s := range stack {\n\t\tif s == k {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/substitute.go",
    "content": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"math/big\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log/hash\"\n)\n\ntype ReplaceFunction func(match, variable string, args []string) string\n\nvar VariableRegExp = regexp.MustCompile(`\\${(.*?)}`)\n\ntype SubstitutedConfig struct {\n\tConfig *DevContainerConfig\n\tRaw    *DevContainerConfig\n}\n\ntype SubstitutionContext struct {\n\tDevContainerID           string            `json:\"DevContainerID,omitempty\"`\n\tLocalWorkspaceFolder     string            `json:\"LocalWorkspaceFolder,omitempty\"`\n\tContainerWorkspaceFolder string            `json:\"ContainerWorkspaceFolder,omitempty\"`\n\tEnv                      map[string]string `json:\"Env,omitempty\"`\n\n\tWorkspaceMount string `json:\"WorkspaceMount,omitempty\"`\n}\n\nfunc Substitute(substitutionCtx *SubstitutionContext, config interface{}, out interface{}) error {\n\tnewVal := map[string]interface{}{}\n\terr := Convert(config, &newVal)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if windows adjust env\n\tisWindows := runtime.GOOS == \"windows\"\n\tif isWindows {\n\t\tnewEnv := map[string]string{}\n\t\tfor k, v := range substitutionCtx.Env {\n\t\t\tnewEnv[strings.ToLower(k)] = v\n\t\t}\n\t\tsubstitutionCtx.Env = newEnv\n\t}\n\n\tif substitutionCtx.ContainerWorkspaceFolder != \"\" {\n\t\tsubstitutionCtx.ContainerWorkspaceFolder = ResolveString(substitutionCtx.ContainerWorkspaceFolder, func(match, variable string, args []string) string {\n\t\t\treturn replaceWithContext(isWindows, substitutionCtx, match, variable, args)\n\t\t})\n\t}\n\tretVal := substitute0(newVal, func(match, variable string, args []string) string {\n\t\treturn replaceWithContext(isWindows, substitutionCtx, match, variable, args)\n\t})\n\n\terr = Convert(retVal, out)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc SubstituteContainerEnv(containerEnv map[string]string, config interface{}, out interface{}) error {\n\tnewVal := map[string]interface{}{}\n\terr := Convert(config, &newVal)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if windows adjust env\n\tretVal := substitute0(newVal, func(match, variable string, args []string) string {\n\t\treturn replaceWithContainerEnv(containerEnv, match, variable, args)\n\t})\n\n\terr = Convert(retVal, out)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc replaceWithContainerEnv(containerEnv map[string]string, match, variable string, args []string) string {\n\tswitch variable {\n\tcase \"containerEnv\":\n\t\treturn lookupValue(false, containerEnv, args, match)\n\tdefault:\n\t\treturn match\n\t}\n}\n\nfunc replaceWithContext(isWindows bool, substitutionCtx *SubstitutionContext, match, variable string, args []string) string {\n\tswitch variable {\n\tcase \"devcontainerId\":\n\t\tif substitutionCtx.DevContainerID != \"\" {\n\t\t\treturn substitutionCtx.DevContainerID\n\t\t}\n\t\treturn match\n\tcase \"env\":\n\t\tfallthrough\n\tcase \"localEnv\":\n\t\treturn lookupValue(isWindows, substitutionCtx.Env, args, match)\n\tcase \"localWorkspaceFolder\":\n\t\tif substitutionCtx.LocalWorkspaceFolder != \"\" {\n\t\t\treturn substitutionCtx.LocalWorkspaceFolder\n\t\t}\n\t\treturn match\n\tcase \"localWorkspaceFolderBasename\":\n\t\tif substitutionCtx.LocalWorkspaceFolder != \"\" {\n\t\t\treturn filepath.Base(substitutionCtx.LocalWorkspaceFolder)\n\t\t}\n\t\treturn match\n\tcase \"containerWorkspaceFolder\":\n\t\tif substitutionCtx.ContainerWorkspaceFolder != \"\" {\n\t\t\treturn substitutionCtx.ContainerWorkspaceFolder\n\t\t}\n\t\treturn match\n\tcase \"containerWorkspaceFolderBasename\":\n\t\tif substitutionCtx.ContainerWorkspaceFolder != \"\" {\n\t\t\treturn filepath.Base(substitutionCtx.ContainerWorkspaceFolder)\n\t\t}\n\t\treturn match\n\tdefault:\n\t\treturn match\n\t}\n}\n\nfunc lookupValue(isWindows bool, env map[string]string, args []string, match string) string {\n\tif len(args) > 0 {\n\t\tenvVariableName := args[0]\n\t\tif isWindows {\n\t\t\tenvVariableName = strings.ToLower(envVariableName)\n\t\t}\n\n\t\tfoundEnv, ok := env[envVariableName]\n\t\tif ok {\n\t\t\treturn foundEnv\n\t\t}\n\n\t\tif len(args) > 1 {\n\t\t\tdefaultValue := args[1]\n\t\t\treturn defaultValue\n\t\t}\n\n\t\t// For `env` we should do the same as a normal shell does - evaluates missing envs to an empty string #46436\n\t\treturn \"\"\n\t}\n\n\treturn match\n}\n\nfunc substitute0(val interface{}, replace ReplaceFunction) interface{} {\n\tswitch t := val.(type) {\n\tcase string:\n\t\treturn ResolveString(t, replace)\n\tcase []interface{}:\n\t\tfor i, v := range t {\n\t\t\tt[i] = substitute0(v, replace)\n\t\t}\n\t\treturn t\n\tcase map[string]interface{}:\n\t\tfor k, v := range t {\n\t\t\tt[k] = substitute0(v, replace)\n\t\t}\n\t\treturn t\n\tdefault:\n\t\treturn t\n\t}\n}\n\nfunc ResolveString(val string, replace ReplaceFunction) string {\n\treturn string(VariableRegExp.ReplaceAllFunc([]byte(val), func(match []byte) []byte {\n\t\tvariable := string(match[2 : len(match)-1])\n\n\t\t// try to separate variable arguments from variable name\n\t\targs := []string{}\n\t\tparts := strings.Split(variable, \":\")\n\t\tif len(parts) > 1 {\n\t\t\tvariable = parts[0]\n\t\t\targs = parts[1:]\n\t\t}\n\n\t\treturn []byte(replace(string(match), variable, args))\n\t}))\n}\n\nfunc ObjectToList(object map[string]string) []string {\n\tret := []string{}\n\tfor k, v := range object {\n\t\tret = append(ret, k+\"=\"+v)\n\t}\n\n\treturn ret\n}\n\nfunc ListToObject(list []string) map[string]string {\n\tret := map[string]string{}\n\tfor _, l := range list {\n\t\tsplitted := strings.Split(l, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tret[splitted[0]] = strings.Join(splitted[1:], \"=\")\n\t}\n\n\treturn ret\n}\n\nfunc GetDevContainerID(labels map[string]string) string {\n\tlabelsBytes, _ := json.Marshal(labels)\n\thashedLabels := hash.String(string(labelsBytes))\n\tbigInt := big.Int{}\n\tbigInt.SetString(hashedLabels, 16)\n\treturn bigInt.Text(32)\n}\n"
  },
  {
    "path": "pkg/devcontainer/config/userenvprobe.go",
    "content": "package config\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/log\"\n)\n\ntype UserEnvProbe string\n\nconst (\n\tLoginInteractiveShellProbe UserEnvProbe = \"loginInteractiveShell\"\n\tLoginShellProbe            UserEnvProbe = \"loginShell\"\n\tInteractiveShellProbe      UserEnvProbe = \"interactiveShell\"\n\tNoneProbe                  UserEnvProbe = \"none\"\n\n\tDefaultUserEnvProbe UserEnvProbe = LoginInteractiveShellProbe\n)\n\nfunc NewUserEnvProbe(probe string) (UserEnvProbe, error) {\n\tswitch probe {\n\tcase string(LoginInteractiveShellProbe):\n\t\treturn LoginInteractiveShellProbe, nil\n\tcase string(LoginShellProbe):\n\t\treturn LoginShellProbe, nil\n\tcase string(InteractiveShellProbe):\n\t\treturn InteractiveShellProbe, nil\n\tcase string(NoneProbe):\n\t\treturn NoneProbe, nil\n\tcase \"\":\n\t\treturn DefaultUserEnvProbe, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid userEnvProbe \\\"%s\\\", supported are \\\"%s\\\"\", probe,\n\t\t\tstrings.Join([]string{\n\t\t\t\tstring(LoginInteractiveShellProbe),\n\t\t\t\tstring(LoginShellProbe),\n\t\t\t\tstring(InteractiveShellProbe),\n\t\t\t\tstring(NoneProbe),\n\t\t\t}, \",\"))\n\t}\n}\n\nfunc ProbeUserEnv(ctx context.Context, probe string, userName string, log log.Logger) (map[string]string, error) {\n\tuserEnvProbe, err := NewUserEnvProbe(probe)\n\tif err != nil {\n\t\tlog.Warnf(\"Get user env probe: %v\", err)\n\t\tlog.Warnf(\"Falling back to default user env probe: %s\", DefaultUserEnvProbe)\n\t\tuserEnvProbe = DefaultUserEnvProbe\n\t}\n\tif userEnvProbe == NoneProbe {\n\t\treturn map[string]string{}, nil\n\t}\n\n\tpreferredShell, err := shell.GetShell(userName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find shell for user %s: %w\", userName, err)\n\t}\n\n\tlog.Debugf(\"running user env probe with shell \\\"%s\\\", probe \\\"%s\\\", user \\\"%s\\\" and command \\\"%s\\\"\",\n\t\tstrings.Join(preferredShell, \" \"), string(userEnvProbe), userName, \"cat /proc/self/environ\")\n\n\tprobedEnv, err := doProbe(ctx, userEnvProbe, preferredShell, userName, \"cat /proc/self/environ\", '\\x00', log)\n\tif err != nil {\n\t\tlog.Debugf(\"running user env probe with shell \\\"%s\\\", probe \\\"%s\\\", user \\\"%s\\\" and command \\\"%s\\\"\",\n\t\t\tstrings.Join(preferredShell, \" \"), string(userEnvProbe), userName, \"printenv\")\n\n\t\tnewProbedEnv, newErr := doProbe(ctx, userEnvProbe, preferredShell, userName, \"printenv\", '\\n', log)\n\t\tif newErr != nil {\n\t\t\tlog.Warnf(\"failed to probe user environment variables: %v, %v\", err, newErr)\n\t\t} else {\n\t\t\tprobedEnv = newProbedEnv\n\t\t}\n\t}\n\tif probedEnv == nil {\n\t\tprobedEnv = map[string]string{}\n\t}\n\n\treturn probedEnv, nil\n}\n\nfunc doProbe(ctx context.Context, userEnvProbe UserEnvProbe, preferredShell []string, userName string, probeCmd string, sep byte, log log.Logger) (map[string]string, error) {\n\targs := preferredShell\n\targs = append(args, getShellArgs(userEnvProbe, userName, probeCmd)...)\n\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\tdefer cancel()\n\tcmd := exec.CommandContext(timeoutCtx, args[0], args[1:]...)\n\n\terr := PrepareCmdUser(cmd, userName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"prepare probe: %w\", err)\n\t}\n\n\tout, err := cmd.Output()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"probe user env: %w\", err)\n\t}\n\n\tscanner := bufio.NewScanner(bytes.NewBuffer(out))\n\tscanner.Split(splitBySeparator(sep))\n\n\tretEnv := map[string]string{}\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSpace(scanner.Text())\n\t\ttokens := strings.Split(line, \"=\")\n\t\tif len(tokens) == 1 {\n\t\t\tlog.Debugf(\"failed to split env var: %s\", line)\n\t\t\tcontinue\n\t\t}\n\t\tretEnv[tokens[0]] = tokens[1]\n\t}\n\tif scanner.Err() != nil {\n\t\treturn nil, fmt.Errorf(\"scan shell output: %w\", err)\n\t}\n\tdelete(retEnv, \"PWD\")\n\n\treturn retEnv, nil\n}\n\nfunc getShellArgs(userEnvProbe UserEnvProbe, user, command string) []string {\n\targs := []string{}\n\tswitch userEnvProbe {\n\tcase LoginInteractiveShellProbe:\n\t\targs = append(args, \"-lic\")\n\tcase LoginShellProbe:\n\t\targs = append(args, \"-lc\")\n\tcase InteractiveShellProbe:\n\t\targs = append(args, \"-ic\")\n\t// shouldn't happen, added just for linting\n\tcase NoneProbe:\n\t\targs = append(args, \"-c\")\n\tdefault:\n\t\targs = append(args, \"-c\")\n\t}\n\targs = append(args, command)\n\n\treturn args\n}\n\nfunc splitBySeparator(sep byte) bufio.SplitFunc {\n\treturn func(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\t\tif atEOF && len(data) == 0 {\n\t\t\treturn 0, nil, nil\n\t\t}\n\t\tif i := bytes.IndexByte(data, sep); i >= 0 {\n\t\t\treturn i + 1, data[0:i], nil\n\t\t}\n\t\tif atEOF {\n\t\t\treturn len(data), data, nil\n\t\t}\n\t\t// Request more data.\n\t\treturn 0, nil, nil\n\t}\n}\n"
  },
  {
    "path": "pkg/devcontainer/config.go",
    "content": "package devcontainer\n\nimport (\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/crane\"\n\t\"github.com/loft-sh/devpod/pkg/language\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc (r *runner) getRawConfig(options provider2.CLIOptions) (*config.DevContainerConfig, error) {\n\tif r.WorkspaceConfig.Workspace.DevContainerConfig != nil {\n\t\trawParsedConfig := config.CloneDevContainerConfig(r.WorkspaceConfig.Workspace.DevContainerConfig)\n\t\tif r.WorkspaceConfig.Workspace.DevContainerPath != \"\" {\n\t\t\trawParsedConfig.Origin = path.Join(filepath.ToSlash(r.LocalWorkspaceFolder), r.WorkspaceConfig.Workspace.DevContainerPath)\n\t\t} else {\n\t\t\trawParsedConfig.Origin = path.Join(filepath.ToSlash(r.LocalWorkspaceFolder), \".devcontainer.devpod.json\")\n\t\t}\n\t\treturn rawParsedConfig, nil\n\t} else if r.WorkspaceConfig.Workspace.Source.Container != \"\" {\n\t\treturn &config.DevContainerConfig{\n\t\t\tDevContainerConfigBase: config.DevContainerConfigBase{\n\t\t\t\t// Default workspace directory for containers\n\t\t\t\t// Upon inspecting the container, this would be updated to the correct folder, if found set\n\t\t\t\tWorkspaceFolder: \"/\",\n\t\t\t},\n\t\t\tRunningContainer: config.RunningContainer{\n\t\t\t\tContainerID: r.WorkspaceConfig.Workspace.Source.Container,\n\t\t\t},\n\t\t\tOrigin: \"\",\n\t\t}, nil\n\t} else if crane.ShouldUse(&options) {\n\t\tlocalWorkspaceFolder, err := crane.PullConfigFromSource(r.WorkspaceConfig, &options, r.Log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn config.ParseDevContainerJSON(\n\t\t\tlocalWorkspaceFolder,\n\t\t\tr.WorkspaceConfig.Workspace.DevContainerPath,\n\t\t)\n\t}\n\n\tlocalWorkspaceFolder := r.LocalWorkspaceFolder\n\t// if a subpath is specified, let's move to it\n\n\tif r.WorkspaceConfig.Workspace.Source.GitSubPath != \"\" {\n\t\tlocalWorkspaceFolder = filepath.Join(r.LocalWorkspaceFolder, r.WorkspaceConfig.Workspace.Source.GitSubPath)\n\t}\n\n\t// parse the devcontainer json\n\trawParsedConfig, err := config.ParseDevContainerJSON(\n\t\tlocalWorkspaceFolder,\n\t\tr.WorkspaceConfig.Workspace.DevContainerPath,\n\t)\n\n\t// We want to fail only in case of real errors, non-existing devcontainer.jon\n\t// will be gracefully handled by the auto-detection mechanism\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, errors.Wrap(err, \"parsing devcontainer.json\")\n\t} else if rawParsedConfig == nil {\n\t\tr.Log.Infof(\"Couldn't find a devcontainer.json\")\n\t\treturn r.getDefaultConfig(options)\n\t}\n\treturn rawParsedConfig, nil\n}\n\nfunc (r *runner) getDefaultConfig(options provider2.CLIOptions) (*config.DevContainerConfig, error) {\n\tdefaultConfig := &config.DevContainerConfig{}\n\tif options.FallbackImage != \"\" {\n\t\tr.Log.Infof(\"Using fallback image %s\", options.FallbackImage)\n\t\tdefaultConfig.ImageContainer = config.ImageContainer{\n\t\t\tImage: options.FallbackImage,\n\t\t}\n\t} else {\n\t\tr.Log.Infof(\"Try detecting project programming language...\")\n\t\tdefaultConfig = language.DefaultConfig(r.LocalWorkspaceFolder, r.Log)\n\t}\n\n\tdefaultConfig.Origin = path.Join(filepath.ToSlash(r.LocalWorkspaceFolder), \".devcontainer.json\")\n\terr := config.SaveDevContainerJSON(defaultConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"write default devcontainer.json\")\n\t}\n\treturn defaultConfig, nil\n}\n\nfunc (r *runner) getSubstitutedConfig(options provider2.CLIOptions) (*config.SubstitutedConfig, *config.SubstitutionContext, error) {\n\trawConfig, err := r.getRawConfig(options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn r.substitute(options, rawConfig)\n}\n\nfunc (r *runner) substitute(\n\toptions provider2.CLIOptions,\n\trawParsedConfig *config.DevContainerConfig,\n) (*config.SubstitutedConfig, *config.SubstitutionContext, error) {\n\tconfigFile := rawParsedConfig.Origin\n\n\t// get workspace folder within container\n\tworkspaceMount, containerWorkspaceFolder := getWorkspace(\n\t\tr.LocalWorkspaceFolder,\n\t\tr.WorkspaceConfig.Workspace.ID,\n\t\trawParsedConfig,\n\t)\n\tsubstitutionContext := &config.SubstitutionContext{\n\t\tDevContainerID:           r.ID,\n\t\tLocalWorkspaceFolder:     r.LocalWorkspaceFolder,\n\t\tContainerWorkspaceFolder: containerWorkspaceFolder,\n\t\tEnv:                      config.ListToObject(os.Environ()),\n\n\t\tWorkspaceMount: workspaceMount,\n\t}\n\n\t// substitute & load\n\tparsedConfig := &config.DevContainerConfig{}\n\terr := config.Substitute(substitutionContext, rawParsedConfig, parsedConfig)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif parsedConfig.WorkspaceFolder != \"\" {\n\t\tsubstitutionContext.ContainerWorkspaceFolder = parsedConfig.WorkspaceFolder\n\t}\n\tif parsedConfig.WorkspaceMount != \"\" {\n\t\tsubstitutionContext.WorkspaceMount = parsedConfig.WorkspaceMount\n\t}\n\n\tif options.DevContainerImage != \"\" {\n\t\tparsedConfig.Build = nil\n\t\tparsedConfig.Dockerfile = \"\"\n\t\tparsedConfig.DockerfileContainer = config.DockerfileContainer{}\n\t\tparsedConfig.ImageContainer = config.ImageContainer{Image: options.DevContainerImage}\n\t}\n\n\tparsedConfig.Origin = configFile\n\treturn &config.SubstitutedConfig{\n\t\tConfig: parsedConfig,\n\t\tRaw:    rawParsedConfig,\n\t}, substitutionContext, nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/crane/run.go",
    "content": "package crane\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n)\n\nvar (\n\tcraneSigningKey string\n)\n\nconst (\n\tPullCommand    = \"pull\"\n\tDecryptCommand = \"decrypt\"\n\n\tEnvironmentCrane = \"environment\"\n\n\tdefaultBinName     = \"devpod-crane\"\n\tenvDevPodCraneName = \"DEVPOD_CRANE_NAME\"\n\ttmpDirTemplate     = \"devpod-crane-*\"\n)\n\ntype Content struct {\n\tFiles map[string]string `json:\"files\"`\n}\n\ntype command struct {\n\tcmd  string\n\targs []string\n}\n\nfunc New(cmd string) *command {\n\tnewCommand := &command{cmd: getBinName()}\n\treturn newCommand.WithArg(cmd)\n}\n\nfunc (c *command) WithFlag(flag, val string) *command {\n\tc.args = append(c.args, flag, val)\n\treturn c\n}\n\nfunc (c *command) WithArg(arg string) *command {\n\tc.args = append(c.args, arg)\n\treturn c\n}\n\nfunc (c *command) Run() (string, error) {\n\tcmd := exec.Command(c.cmd, c.args...)\n\n\tvar outBuf, errBuf bytes.Buffer\n\tcmd.Stdout = &outBuf\n\tcmd.Stderr = &errBuf\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to execute command: %v, error: %w\", errBuf.String(), err)\n\t}\n\n\treturn outBuf.String(), nil\n}\n\n// ShouldUse takes CLIOptions and returns true if crane should be used\nfunc ShouldUse(cliOptions *provider2.CLIOptions) bool {\n\treturn IsAvailable() && cliOptions.Platform.EnvironmentTemplate != \"\"\n}\n\n// IsAvailable checks if devpod crane is installed in host system\nfunc IsAvailable() bool {\n\t_, err := exec.LookPath(getBinName())\n\treturn err == nil\n}\n\n// PullConfigFromSource pulls devcontainer config from configSource using git crane and returns config path\nfunc PullConfigFromSource(workspaceInfo *provider2.AgentWorkspaceInfo, options *provider2.CLIOptions, log log.Logger) (string, error) {\n\tvar data string\n\tvar err error\n\tif options.Platform.EnvironmentTemplate == \"\" {\n\t\treturn \"\", fmt.Errorf(\"failed to pull config from source based on options\")\n\t}\n\n\tcommand := New(PullCommand).\n\t\tWithArg(EnvironmentCrane).\n\t\tWithArg(options.Platform.EnvironmentTemplate)\n\n\tif options.Platform.EnvironmentTemplateVersion != \"\" {\n\t\tcommand = command.WithFlag(\"--version\", options.Platform.EnvironmentTemplateVersion)\n\t}\n\n\tdata, err = command.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif craneSigningKey != \"\" {\n\t\tdata, err = New(DecryptCommand).WithArg(data).WithFlag(\"--key\", craneSigningKey).Run()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\tcontent := &Content{}\n\tif err := json.Unmarshal([]byte(data), content); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn writeContentToDirectory(workspaceInfo, content, log)\n}\n\nfunc writeContentToDirectory(workspaceInfo *provider2.AgentWorkspaceInfo, content *Content, _ log.Logger) (string, error) {\n\tpath := workspaceInfo.ContentFolder\n\tif path == \"\" {\n\t\tpath = createContentDirectory()\n\t\tif path == \"\" {\n\t\t\treturn path, fmt.Errorf(\"failed to create temporary directory\")\n\t\t}\n\t}\n\treturn storeFilesInDirectory(content, path)\n}\n\nfunc createContentDirectory() string {\n\ttmpDir, err := os.MkdirTemp(\"\", tmpDirTemplate)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn tmpDir\n}\n\nfunc storeFilesInDirectory(content *Content, path string) (string, error) {\n\tfor filename, fileContent := range content.Files {\n\t\tfilePath := filepath.Join(path, filename)\n\n\t\tdir := filepath.Dir(filePath)\n\t\tif err := os.MkdirAll(dir, os.ModePerm); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\terr := os.WriteFile(filePath, []byte(fileContent), os.ModePerm)\n\t\tif err != nil {\n\t\t\tos.RemoveAll(path)\n\t\t\treturn \"\", fmt.Errorf(\"failed to write file %s: %w\", filename, err)\n\t\t}\n\t}\n\n\treturn path, nil\n}\n\nfunc getBinName() string {\n\tif name := os.Getenv(envDevPodCraneName); name != \"\" {\n\t\treturn name\n\t}\n\treturn defaultBinName\n}\n"
  },
  {
    "path": "pkg/devcontainer/delete.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc (r *runner) Delete(ctx context.Context) error {\n\tcontainerDetails, err := r.Driver.FindDevContainer(ctx, r.ID)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find dev container\")\n\t} else if containerDetails == nil {\n\t\treturn nil\n\t}\n\n\tr.Log.Infof(\"Deleting devcontainer...\")\n\tif isDockerCompose, projectName := getDockerComposeProject(containerDetails); isDockerCompose {\n\t\terr = r.deleteDockerCompose(ctx, projectName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif strings.ToLower(containerDetails.State.Status) == \"running\" {\n\t\t\terr = r.Driver.StopDevContainer(ctx, r.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terr = r.Driver.DeleteDevContainer(ctx, r.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (r *runner) Stop(ctx context.Context) error {\n\tcontainerDetails, err := r.Driver.FindDevContainer(ctx, r.ID)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find dev container\")\n\t} else if containerDetails == nil {\n\t\treturn nil\n\t}\n\n\tif strings.ToLower(containerDetails.State.Status) == \"running\" {\n\t\tif isDockerCompose, projectName := getDockerComposeProject(containerDetails); isDockerCompose {\n\t\t\terr = r.stopDockerCompose(ctx, projectName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\terr = r.Driver.StopDevContainer(ctx, r.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getDockerComposeProject(containerDetails *config.ContainerDetails) (bool, string) {\n\tif projectName, ok := containerDetails.Config.Labels[\"com.docker.compose.project\"]; ok {\n\t\treturn true, projectName\n\t}\n\n\treturn false, \"\"\n}\n"
  },
  {
    "path": "pkg/devcontainer/feature/extend.go",
    "content": "package feature\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/google/go-containerregistry/pkg/name\"\n\t\"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/graph\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/metadata\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nvar featureSafeIDRegex1 = regexp.MustCompile(`[^\\w_]`)\nvar featureSafeIDRegex2 = regexp.MustCompile(`^[\\d_]+`)\n\nconst FEATURE_BASE_DOCKERFILE = `\nFROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage\n\nUSER root\n\nCOPY ./` + config.DevPodContextFeatureFolder + `/ /tmp/build-features/\nRUN chmod -R 0755 /tmp/build-features && ls /tmp/build-features\n\n#{featureLayer}\n\nARG _DEV_CONTAINERS_IMAGE_USER=root\nUSER $_DEV_CONTAINERS_IMAGE_USER\n`\n\ntype ExtendedBuildInfo struct {\n\tFeatures          []*config.FeatureSet\n\tFeaturesBuildInfo *BuildInfo\n\n\tMetadataConfig *config.ImageMetadataConfig\n\tMetadataLabel  string\n}\n\ntype BuildInfo struct {\n\tFeaturesFolder          string\n\tDockerfileContent       string\n\tOverrideTarget          string\n\tDockerfilePrefixContent string\n\tBuildArgs               map[string]string\n}\n\nfunc GetExtendedBuildInfo(ctx *config.SubstitutionContext, imageBuildInfo *config.ImageBuildInfo, target string, devContainerConfig *config.SubstitutedConfig, log log.Logger, forceBuild bool) (*ExtendedBuildInfo, error) {\n\tfeatures, err := fetchFeatures(devContainerConfig.Config, log, forceBuild)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"fetch features\")\n\t}\n\n\tmergedImageMetadataConfig, err := metadata.GetDevContainerMetadata(ctx, imageBuildInfo.Metadata, devContainerConfig, features)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get dev container metadata\")\n\t}\n\n\tmarshalled, err := json.Marshal(mergedImageMetadataConfig.Raw)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// no features?\n\tif len(features) == 0 {\n\t\treturn &ExtendedBuildInfo{\n\t\t\tMetadataLabel:  string(marshalled),\n\t\t\tMetadataConfig: mergedImageMetadataConfig,\n\t\t}, nil\n\t}\n\n\tcontextPath := config.GetContextPath(devContainerConfig.Config)\n\tbuildInfo, err := getFeatureBuildOptions(contextPath, imageBuildInfo, target, features)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ExtendedBuildInfo{\n\t\tFeatures:          features,\n\t\tFeaturesBuildInfo: buildInfo,\n\t\tMetadataConfig:    mergedImageMetadataConfig,\n\t\tMetadataLabel:     string(marshalled),\n\t}, nil\n}\n\nfunc getFeatureBuildOptions(contextPath string, imageBuildInfo *config.ImageBuildInfo, target string, features []*config.FeatureSet) (*BuildInfo, error) {\n\tcontainerUser, remoteUser := findContainerUsers(imageBuildInfo.Metadata, \"\", imageBuildInfo.User)\n\n\t// copy features\n\tfeatureFolder := filepath.Join(contextPath, config.DevPodContextFeatureFolder)\n\terr := copyFeaturesToDestination(features, featureFolder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// write devcontainer-features.builtin.env, its important to have a terminating \\n here as we append to that file later\n\terr = os.WriteFile(filepath.Join(featureFolder, \"devcontainer-features.builtin.env\"), []byte(`_CONTAINER_USER=`+containerUser+`\n_REMOTE_USER=`+remoteUser+\"\\n\"), 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// prepare dockerfile\n\tdockerfileContent := strings.ReplaceAll(FEATURE_BASE_DOCKERFILE, \"#{featureLayer}\", getFeatureLayers(containerUser, remoteUser, features))\n\t// get build syntax from Dockerfile or use default\n\tsyntax := \"docker.io/docker/dockerfile:1.4\"\n\tif imageBuildInfo.Dockerfile != nil && imageBuildInfo.Dockerfile.Syntax != \"\" {\n\t\tsyntax = imageBuildInfo.Dockerfile.Syntax\n\t}\n\tdockerfilePrefix := fmt.Sprintf(`\n# syntax=%s\nARG _DEV_CONTAINERS_BASE_IMAGE=placeholder`, syntax)\n\n\treturn &BuildInfo{\n\t\tFeaturesFolder:          featureFolder,\n\t\tDockerfileContent:       dockerfileContent,\n\t\tDockerfilePrefixContent: dockerfilePrefix,\n\t\tOverrideTarget:          \"dev_containers_target_stage\",\n\t\tBuildArgs: map[string]string{\n\t\t\t\"_DEV_CONTAINERS_BASE_IMAGE\": target,\n\t\t\t\"_DEV_CONTAINERS_IMAGE_USER\": imageBuildInfo.User,\n\t\t},\n\t}, nil\n}\n\nfunc copyFeaturesToDestination(features []*config.FeatureSet, targetDir string) error {\n\t// make sure the folder doesn't exist initially\n\t_ = os.RemoveAll(targetDir)\n\tfor i, feature := range features {\n\t\tfeatureDir := filepath.Join(targetDir, strconv.Itoa(i))\n\t\terr := os.MkdirAll(featureDir, 0755)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = copy.Directory(feature.Folder, featureDir)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"copy feature %s\", feature.ConfigID)\n\t\t}\n\n\t\t// copy feature folder\n\t\tenvPath := filepath.Join(featureDir, \"devcontainer-features.env\")\n\t\tvariables := getFeatureEnvVariables(feature.Config, feature.Options)\n\t\terr = os.WriteFile(envPath, []byte(strings.Join(variables, \"\\n\")), 0600)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"write variables of feature %s\", feature.ConfigID)\n\t\t}\n\n\t\tinstallWrapperPath := filepath.Join(featureDir, \"devcontainer-features-install.sh\")\n\t\tinstallWrapperContent := getFeatureInstallWrapperScript(feature.ConfigID, feature.Config, variables)\n\t\terr = os.WriteFile(installWrapperPath, []byte(installWrapperContent), 0600)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"write install wrapper script for feature %s\", feature.ConfigID)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getFeatureSafeID(featureID string) string {\n\treturn strings.ToUpper(featureSafeIDRegex2.ReplaceAllString(featureSafeIDRegex1.ReplaceAllString(featureID, \"_\"), \"_\"))\n}\n\nfunc getFeatureLayers(containerUser, remoteUser string, features []*config.FeatureSet) string {\n\tresult := `RUN \\\necho \"_CONTAINER_USER_HOME=$(getent passwd ` + containerUser + ` | cut -d: -f6)\" >> /tmp/build-features/devcontainer-features.builtin.env && \\\necho \"_REMOTE_USER_HOME=$(getent passwd ` + remoteUser + ` | cut -d: -f6)\" >> /tmp/build-features/devcontainer-features.builtin.env\n\n`\n\tfor i, feature := range features {\n\t\tresult += generateContainerEnvs(feature)\n\t\tresult += `\nRUN cd /tmp/build-features/` + strconv.Itoa(i) + ` \\\n&& chmod +x ./devcontainer-features-install.sh \\\n&& ./devcontainer-features-install.sh\n\n`\n\t}\n\n\treturn result\n}\n\nfunc generateContainerEnvs(feature *config.FeatureSet) string {\n\tresult := []string{}\n\tif len(feature.Config.ContainerEnv) == 0 {\n\t\treturn \"\"\n\t}\n\n\tfor k, v := range feature.Config.ContainerEnv {\n\t\tresult = append(result, fmt.Sprintf(\"ENV %s=%s\", k, v))\n\t}\n\treturn strings.Join(result, \"\\n\")\n}\n\nfunc findContainerUsers(baseImageMetadata *config.ImageMetadataConfig, composeServiceUser, imageUser string) (string, string) {\n\treversed := config.ReverseSlice(baseImageMetadata.Config)\n\tcontainerUser := \"\"\n\tremoteUser := \"\"\n\tfor _, imageMetadata := range reversed {\n\t\tif containerUser == \"\" && imageMetadata.ContainerUser != \"\" {\n\t\t\tcontainerUser = imageMetadata.ContainerUser\n\t\t}\n\t\tif remoteUser == \"\" && imageMetadata.RemoteUser != \"\" {\n\t\t\tremoteUser = imageMetadata.RemoteUser\n\t\t}\n\t}\n\n\tif containerUser == \"\" {\n\t\tif composeServiceUser != \"\" {\n\t\t\tcontainerUser = composeServiceUser\n\t\t} else if imageUser != \"\" {\n\t\t\tcontainerUser = imageUser\n\t\t}\n\t}\n\tif remoteUser == \"\" {\n\t\tif composeServiceUser != \"\" {\n\t\t\tremoteUser = composeServiceUser\n\t\t} else if imageUser != \"\" {\n\t\t\tremoteUser = imageUser\n\t\t}\n\t}\n\treturn containerUser, remoteUser\n}\n\nfunc fetchFeatures(devContainerConfig *config.DevContainerConfig, log log.Logger, forceBuild bool) ([]*config.FeatureSet, error) {\n\tfeatureSets := []*config.FeatureSet{}\n\tfor featureID, featureOptions := range devContainerConfig.Features {\n\t\tfeatureFolder, err := ProcessFeatureID(featureID, devContainerConfig, log, forceBuild)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"process feature \"+featureID)\n\t\t}\n\n\t\t// parse feature\n\t\tlog.Debugf(\"Parse dev container feature in %s\", featureFolder)\n\t\tfeatureConfig, err := config.ParseDevContainerFeature(featureFolder)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"parse feature \"+featureID)\n\t\t}\n\n\t\t// add to return array\n\t\tfeatureSets = append(featureSets, &config.FeatureSet{\n\t\t\tConfigID: NormalizeFeatureID(featureID),\n\t\t\tFolder:   featureFolder,\n\t\t\tConfig:   featureConfig,\n\t\t\tOptions:  featureOptions,\n\t\t})\n\t}\n\n\t// compute order here\n\tfeatureSets, err := computeFeatureOrder(devContainerConfig, featureSets)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"compute feature order\")\n\t}\n\n\treturn featureSets, nil\n}\n\nfunc NormalizeFeatureID(featureID string) string {\n\tref, err := name.ParseReference(featureID)\n\tif err != nil {\n\t\treturn featureID\n\t}\n\n\ttag, ok := ref.(name.Tag)\n\tif ok {\n\t\treturn tag.Repository.Name()\n\t}\n\n\treturn ref.String()\n}\n\nfunc computeFeatureOrder(devContainer *config.DevContainerConfig, features []*config.FeatureSet) ([]*config.FeatureSet, error) {\n\tif len(devContainer.OverrideFeatureInstallOrder) == 0 {\n\t\treturn computeAutomaticFeatureOrder(features)\n\t}\n\n\tautomaticOrder, err := computeAutomaticFeatureOrder(features)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\torderedFeatures := []*config.FeatureSet{}\n\tfor _, feature := range devContainer.OverrideFeatureInstallOrder {\n\t\tfeatureID := NormalizeFeatureID(feature)\n\n\t\t// remove from automaticOrder and move to orderedFeatures\n\t\tnewAutomaticOrder := []*config.FeatureSet{}\n\t\tfor _, featureConfig := range automaticOrder {\n\t\t\tif featureConfig.ConfigID == featureID {\n\t\t\t\torderedFeatures = append(orderedFeatures, featureConfig)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnewAutomaticOrder = append(newAutomaticOrder, featureConfig)\n\t\t}\n\t\tautomaticOrder = newAutomaticOrder\n\t}\n\n\torderedFeatures = append(orderedFeatures, automaticOrder...)\n\treturn orderedFeatures, nil\n}\n\nfunc computeAutomaticFeatureOrder(features []*config.FeatureSet) ([]*config.FeatureSet, error) {\n\tg := graph.NewGraph[*config.FeatureSet](graph.NewNode[*config.FeatureSet](\"root\", nil))\n\n\t// build lookup map\n\tlookup := map[string]*config.FeatureSet{}\n\tfor _, feature := range features {\n\t\tlookup[feature.ConfigID] = feature\n\t}\n\n\t// build graph\n\tfor _, feature := range features {\n\t\t_, err := g.InsertNodeAt(\"root\", feature.ConfigID, feature)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// add edges\n\t\tfor _, installAfter := range feature.Config.InstallsAfter {\n\t\t\tinstallAfterFeature, ok := lookup[installAfter]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// add an edge from feature to installAfterFeature\n\t\t\t_, err = g.InsertNodeAt(feature.ConfigID, installAfter, installAfterFeature)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// now remove node after node\n\tordered := []*config.FeatureSet{}\n\tfor {\n\t\tleaf := g.GetNextLeaf(g.Root)\n\t\tif leaf == g.Root {\n\t\t\tbreak\n\t\t}\n\n\t\terr := g.RemoveNode(leaf.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tordered = append(ordered, leaf.Data)\n\t}\n\n\treturn ordered, nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/feature/features.go",
    "content": "package feature\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/google/go-containerregistry/pkg/authn\"\n\t\"github.com/google/go-containerregistry/pkg/name\"\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/hash\"\n\t\"github.com/pkg/errors\"\n)\n\nconst DEVCONTAINER_MANIFEST_MEDIATYPE = \"application/vnd.devcontainers\"\n\nvar directTarballRegEx = regexp.MustCompile(\"devcontainer-feature-([a-zA-Z0-9_-]+).tgz\")\n\nfunc getFeatureInstallWrapperScript(idWithoutVersion string, feature *config.FeatureConfig, options []string) string {\n\tid := escapeQuotesForShell(idWithoutVersion)\n\tname := escapeQuotesForShell(feature.Name)\n\tdescription := escapeQuotesForShell(feature.Description)\n\tversion := escapeQuotesForShell(feature.Version)\n\tdocumentation := escapeQuotesForShell(feature.DocumentationURL)\n\toptionsIndented := escapeQuotesForShell(\"    \" + strings.Join(options, \"\\n    \"))\n\n\twarningHeader := \"\"\n\tif feature.Deprecated {\n\t\twarningHeader += `(!) WARNING: Using the deprecated Feature \"${escapeQuotesForShell(feature.id)}\". This Feature will no longer receive any further updates/support.\\n`\n\t}\n\n\techoWarning := \"\"\n\tif warningHeader != \"\" {\n\t\techoWarning = `echo '` + warningHeader + `'`\n\t}\n\n\terrorMessage := `ERROR: Feature \"` + name + `\" (` + id + `) failed to install!`\n\ttroubleshootingMessage := \"\"\n\tif documentation != \"\" {\n\t\ttroubleshootingMessage = ` Look at the documentation at ${documentation} for help troubleshooting this error.`\n\t}\n\n\treturn `#!/bin/sh\nset -e\n\non_exit () {\n\t[ $? -eq 0 ] && exit\n\techo '` + errorMessage + troubleshootingMessage + `'\n}\n\ntrap on_exit EXIT\n\nset -a\n. ../devcontainer-features.builtin.env\n. ./devcontainer-features.env\nset +a\n\necho ===========================================================================\n` + echoWarning + `\necho 'Feature       : ` + name + `'\necho 'Description   : ` + description + `'\necho 'Id            : ` + id + `'\necho 'Version       : ` + version + `'\necho 'Documentation : ` + documentation + `'\necho 'Options       :'\necho '` + optionsIndented + `'\necho 'Environment   :'\nprintenv\necho ===========================================================================\n\nchmod +x ./install.sh\n./install.sh\n`\n}\n\nfunc escapeQuotesForShell(str string) string {\n\t// The `input` is expected to be a string which will be printed inside single quotes\n\t// by the caller. This means we need to escape any nested single quotes within the string.\n\t// We can do this by ending the first string with a single quote ('), printing an escaped\n\t// single quote (\\'), and then opening a new string (').\n\treturn strings.ReplaceAll(str, \"'\", `'\\''`)\n}\n\nfunc ProcessFeatureID(id string, devContainerConfig *config.DevContainerConfig, log log.Logger, forceBuild bool) (string, error) {\n\tif strings.HasPrefix(id, \"https://\") || strings.HasPrefix(id, \"http://\") {\n\t\tlog.Debugf(\"Process url feature\")\n\t\treturn processDirectTarFeature(id, config.GetDevPodCustomizations(devContainerConfig).FeatureDownloadHTTPHeaders, log, forceBuild)\n\t} else if strings.HasPrefix(id, \"./\") || strings.HasPrefix(id, \"../\") {\n\t\tlog.Debugf(\"Process local feature\")\n\t\treturn filepath.Abs(path.Join(filepath.ToSlash(filepath.Dir(devContainerConfig.Origin)), id))\n\t}\n\n\t// get oci feature\n\tlog.Debugf(\"Process OCI feature\")\n\treturn processOCIFeature(id, log)\n}\n\nfunc processOCIFeature(id string, log log.Logger) (string, error) {\n\t// feature already exists?\n\tfeatureFolder := getFeaturesTempFolder(id)\n\tfeatureExtractedFolder := filepath.Join(featureFolder, \"extracted\")\n\t_, err := os.Stat(featureExtractedFolder)\n\tif err == nil {\n\t\t// make sure feature.json is there as well\n\t\t_, err = os.Stat(filepath.Join(featureExtractedFolder, config.DEVCONTAINER_FEATURE_FILE_NAME))\n\t\tif err == nil {\n\t\t\treturn featureExtractedFolder, nil\n\t\t} else {\n\t\t\tlog.Debugf(\"Feature folder already exists but seems to be empty\")\n\t\t\t_ = os.RemoveAll(featureFolder)\n\t\t}\n\t}\n\n\tref, err := name.ParseReference(id)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\timg, err := remote.Image(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdestFile := filepath.Join(featureFolder, \"feature.tgz\")\n\terr = downloadLayer(img, id, destFile, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfile, err := os.Open(destFile)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\tlog.Debugf(\"Extract feature into %s\", featureExtractedFolder)\n\terr = extract.Extract(file, featureExtractedFolder)\n\tif err != nil {\n\t\t_ = os.RemoveAll(featureExtractedFolder)\n\t\treturn \"\", err\n\t}\n\n\treturn featureExtractedFolder, nil\n}\n\nfunc downloadLayer(img v1.Image, id, destFile string, log log.Logger) error {\n\tmanifest, err := img.Manifest()\n\tif err != nil {\n\t\treturn err\n\t} else if manifest.Config.MediaType != DEVCONTAINER_MANIFEST_MEDIATYPE {\n\t\treturn fmt.Errorf(\"incorrect manifest type %s, expected %s\", manifest.Config.MediaType, DEVCONTAINER_MANIFEST_MEDIATYPE)\n\t} else if len(manifest.Layers) == 0 {\n\t\treturn fmt.Errorf(\"unexpected amount of layers, expected at least 1\")\n\t}\n\n\t// download layer\n\tlog.Debugf(\"Download feature %s layer %s into %s...\", id, manifest.Layers[0].Digest, destFile)\n\tlayer, err := img.LayerByDigest(manifest.Layers[0].Digest)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"retrieve layer\")\n\t}\n\n\tdata, err := layer.Uncompressed()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"download\")\n\t}\n\tdefer data.Close()\n\n\terr = os.MkdirAll(filepath.Dir(destFile), 0755)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create target folder\")\n\t}\n\n\tfile, err := os.Create(destFile)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create file\")\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, data)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"download layer\")\n\t}\n\n\treturn nil\n}\n\nfunc processDirectTarFeature(id string, httpHeaders map[string]string, log log.Logger, forceDownload bool) (string, error) {\n\tdownloadBase := id[strings.LastIndex(id, \"/\"):]\n\tif !directTarballRegEx.MatchString(downloadBase) {\n\t\treturn \"\", fmt.Errorf(\"expected tarball name to follow 'devcontainer-feature-<feature-id>.tgz' format.  Received '%s' \", downloadBase)\n\t}\n\n\t// feature already exists?\n\tfeatureFolder := getFeaturesTempFolder(id)\n\tfeatureExtractedFolder := filepath.Join(featureFolder, \"extracted\")\n\t_, err := os.Stat(featureExtractedFolder)\n\tif err == nil && !forceDownload {\n\t\treturn featureExtractedFolder, nil\n\t}\n\n\t// download feature tarball\n\tdownloadFile := filepath.Join(featureFolder, \"feature.tgz\")\n\terr = downloadFeatureFromURL(id, downloadFile, httpHeaders, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// extract file\n\tfile, err := os.Open(downloadFile)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\t// extract tar.gz\n\terr = extract.Extract(file, featureExtractedFolder)\n\tif err != nil {\n\t\t_ = os.RemoveAll(featureExtractedFolder)\n\t\treturn \"\", errors.Wrap(err, \"extract folder\")\n\t}\n\n\treturn featureExtractedFolder, nil\n}\n\nfunc downloadFeatureFromURL(url string, destFile string, httpHeaders map[string]string, log log.Logger) error {\n\t// create the features temp folder\n\terr := os.MkdirAll(filepath.Dir(destFile), 0755)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create feature folder\")\n\t}\n\n\t// initiate download\n\tlog.Debugf(\"Download feature from %s\", url)\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"make request\")\n\t}\n\tfor key, value := range httpHeaders {\n\t\treq.Header.Set(key, value)\n\t}\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"make request\")\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode >= 400 {\n\t\treturn fmt.Errorf(\"GET request failed, status code is '%d'\", resp.StatusCode)\n\t}\n\n\t// download the tar.gz file\n\tfile, err := os.Create(destFile)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create download file\")\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, resp.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"download feature\")\n\t}\n\n\treturn nil\n}\n\nfunc getFeaturesTempFolder(id string) string {\n\thashedID := hash.String(id)[:10]\n\treturn filepath.Join(os.TempDir(), \"devpod\", \"features\", hashedID)\n}\n"
  },
  {
    "path": "pkg/devcontainer/feature/options.go",
    "content": "package feature\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n)\n\nfunc getFeatureEnvVariables(feature *config.FeatureConfig, featureOptions interface{}) []string {\n\toptions := getFeatureValueObject(feature, featureOptions)\n\tvariables := []string{}\n\tfor k, v := range options {\n\t\tvariables = append(variables, fmt.Sprintf(`%s=\"%v\"`, getFeatureSafeID(k), v))\n\t}\n\n\tsort.Strings(variables)\n\n\treturn variables\n}\n\nfunc getFeatureValueObject(feature *config.FeatureConfig, featureOptions interface{}) map[string]interface{} {\n\tdefaults := getFeatureDefaults(feature)\n\tswitch t := featureOptions.(type) {\n\tcase map[string]interface{}:\n\t\tfor k, v := range t {\n\t\t\tdefaults[k] = v\n\t\t}\n\n\t\treturn defaults\n\tcase string:\n\t\tif feature.Options == nil {\n\t\t\treturn defaults\n\t\t}\n\n\t\t_, ok := feature.Options[\"version\"]\n\t\tif ok {\n\t\t\tdefaults[\"version\"] = t\n\t\t}\n\n\t\treturn defaults\n\t}\n\n\treturn defaults\n}\n\nfunc getFeatureDefaults(feature *config.FeatureConfig) map[string]interface{} {\n\tret := map[string]interface{}{}\n\tfor k, v := range feature.Options {\n\t\tret[k] = string(v.Default)\n\t}\n\n\treturn ret\n}\n"
  },
  {
    "path": "pkg/devcontainer/graph/graph.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n)\n\ntype Graph[T comparable] struct {\n\tNodes map[string]*Node[T]\n\tRoot  *Node[T]\n\n\titem string\n}\n\nfunc NewGraph[T comparable](root *Node[T]) *Graph[T] {\n\tgraph := &Graph[T]{\n\t\tNodes: make(map[string]*Node[T]),\n\t\tRoot:  root,\n\t}\n\n\tgraph.Nodes[root.ID] = root\n\treturn graph\n}\n\nfunc NewGraphOf[T comparable](root *Node[T], item string) *Graph[T] {\n\tgraph := &Graph[T]{\n\t\tNodes: make(map[string]*Node[T]),\n\t\tRoot:  root,\n\t\titem:  item,\n\t}\n\n\tgraph.Nodes[root.ID] = root\n\treturn graph\n}\n\n// Node is a node in a graph\ntype Node[T comparable] struct {\n\tID   string\n\tData T\n\n\tParents []*Node[T]\n\tChilds  []*Node[T]\n\n\tDone bool\n}\n\nfunc NewNode[T comparable](id string, data T) *Node[T] {\n\treturn &Node[T]{\n\t\tID:   id,\n\t\tData: data,\n\n\t\tParents: []*Node[T]{},\n\t\tChilds:  []*Node[T]{},\n\t}\n}\n\n// Clone returns a cloned graph\nfunc (g *Graph[T]) Clone() *Graph[T] {\n\tretGraph := &Graph[T]{\n\t\tNodes: map[string]*Node[T]{},\n\t\titem:  g.item,\n\t}\n\n\t// copy nodes\n\tfor k, v := range g.Nodes {\n\t\tretGraph.Nodes[k] = NewNode[T](v.ID, v.Data)\n\t}\n\tretGraph.Root = retGraph.Nodes[g.Root.ID]\n\n\t// copy edges\n\tfor k, v := range g.Nodes {\n\t\tfor _, child := range v.Childs {\n\t\t\tretGraph.Nodes[k].Childs = append(retGraph.Nodes[k].Childs, retGraph.Nodes[child.ID])\n\t\t}\n\t\tfor _, parent := range v.Parents {\n\t\t\tretGraph.Nodes[k].Parents = append(retGraph.Nodes[k].Parents, retGraph.Nodes[parent.ID])\n\t\t}\n\t}\n\n\treturn retGraph\n}\n\nfunc (g *Graph[T]) NextFromTop() *Node[T] {\n\tclonedGraph := g.Clone()\n\torderedOptions := []string{}\n\tnextLeaf := clonedGraph.GetNextLeaf(clonedGraph.Root)\n\tfor nextLeaf != clonedGraph.Root {\n\t\torderedOptions = append(orderedOptions, nextLeaf.ID)\n\t\terr := clonedGraph.RemoveNode(nextLeaf.ID)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tnextLeaf = clonedGraph.GetNextLeaf(clonedGraph.Root)\n\t}\n\n\tfor i := len(orderedOptions) - 1; i >= 0; i-- {\n\t\tnextNode := g.Nodes[orderedOptions[i]]\n\t\tif nextNode == nil || nextNode.Done {\n\t\t\tcontinue\n\t\t}\n\n\t\tnextNode.Done = true\n\t\treturn nextNode\n\t}\n\n\treturn nil\n}\n\n// InsertNodeAt inserts a new node at the given parent position\nfunc (g *Graph[T]) InsertNodeAt(parentID string, id string, data T) (*Node[T], error) {\n\tparentNode, ok := g.Nodes[parentID]\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"Parent %s does not exist\", parentID)\n\t}\n\tif existingNode, ok := g.Nodes[id]; ok {\n\t\terr := g.AddEdge(parentNode.ID, existingNode.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn existingNode, nil\n\t}\n\n\tnode := NewNode[T](id, data)\n\n\tg.Nodes[node.ID] = node\n\n\tparentNode.Childs = append(parentNode.Childs, node)\n\tnode.Parents = append(node.Parents, parentNode)\n\n\treturn node, nil\n}\n\nfunc (g *Graph[T]) RemoveSubGraph(id string) error {\n\tif node, ok := g.Nodes[id]; ok {\n\t\t// remove all childs\n\t\tfor _, child := range node.Childs {\n\t\t\terr := g.RemoveSubGraph(child.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t// Remove child from parents\n\t\treturn g.RemoveNode(id)\n\t}\n\n\treturn nil\n}\n\n// RemoveNode removes a node with no children in the graph\nfunc (g *Graph[T]) RemoveNode(id string) error {\n\tif node, ok := g.Nodes[id]; ok {\n\t\tif len(node.Childs) > 0 {\n\t\t\treturn errors.Errorf(\"Cannot remove %s from graph because it has still children\", getNameOrID(node))\n\t\t}\n\n\t\t// Remove child from parents\n\t\tfor _, parent := range node.Parents {\n\t\t\ti := -1\n\t\t\tfor idx, c := range parent.Childs {\n\t\t\t\tif c.ID == id {\n\t\t\t\t\ti = idx\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif i == -1 {\n\t\t\t\treturn fmt.Errorf(\"couldn't find %s in parent\", getNameOrID(node))\n\t\t\t}\n\t\t\tparent.Childs = append(parent.Childs[:i], parent.Childs[i+1:]...)\n\t\t}\n\n\t\t// Remove from graph nodes\n\t\tdelete(g.Nodes, id)\n\t}\n\n\treturn nil\n}\n\n// GetNextLeaf returns the next leaf in the graph from node start\nfunc (g *Graph[T]) GetNextLeaf(start *Node[T]) *Node[T] {\n\tif len(start.Childs) == 0 {\n\t\treturn start\n\t}\n\n\treturn g.GetNextLeaf(start.Childs[0])\n}\n\n// CyclicError is the type that is returned if a cyclic edge would be inserted\ntype CyclicError[T comparable] struct {\n\tWhat string\n\tpath []*Node[T]\n}\n\n// Error implements error interface\nfunc (c *CyclicError[T]) Error() string {\n\tcycle := []string{getNameOrID(c.path[len(c.path)-1])}\n\n\tfor _, node := range c.path {\n\t\tcycle = append(cycle, getNameOrID(node))\n\t}\n\n\twhat := \"dependency\"\n\tif c.What != \"\" {\n\t\twhat = c.What\n\t}\n\n\treturn fmt.Sprintf(\"cyclic %s found: \\n%s\", what, strings.Join(cycle, \"\\n\"))\n}\n\nfunc (g *Graph[T]) AddChild(parentID string, childID string) error {\n\treturn g.AddEdge(parentID, childID)\n}\n\n// AddEdge adds a new edge from a node to a node and returns an error if it would result in a cyclic graph\nfunc (g *Graph[T]) AddEdge(fromID string, toID string) error {\n\tfrom, ok := g.Nodes[fromID]\n\tif !ok {\n\t\treturn errors.Errorf(\"fromID %s does not exist\", fromID)\n\t}\n\tto, ok := g.Nodes[toID]\n\tif !ok {\n\t\treturn errors.Errorf(\"toID %s does not exist\", toID)\n\t}\n\n\t// Check if there is already an edge\n\tfor _, child := range from.Childs {\n\t\tif child.ID == to.ID {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// Check if cyclic\n\tpath := findFirstPath(to, from)\n\tif path != nil {\n\t\treturn &CyclicError[T]{\n\t\t\tpath: path,\n\t\t\tWhat: g.item,\n\t\t}\n\t}\n\n\tfrom.Childs = append(from.Childs, to)\n\tto.Parents = append(to.Parents, from)\n\treturn nil\n}\n\n// find first path from node to node with DFS\nfunc findFirstPath[T comparable](from *Node[T], to *Node[T]) []*Node[T] {\n\tisVisited := map[string]bool{}\n\tpathList := []*Node[T]{from}\n\n\t// Call recursive utility\n\tif findFirstPathRecursive(from, to, isVisited, &pathList) {\n\t\treturn pathList\n\t}\n\n\treturn nil\n}\n\n// A recursive function to print\n// all paths from 'u' to 'd'.\n// isVisited[] keeps track of\n// vertices in current path.\n// localPathList<> stores actual\n// vertices in the current path\nfunc findFirstPathRecursive[T comparable](u *Node[T], d *Node[T], isVisited map[string]bool, localPathList *[]*Node[T]) bool {\n\t// Mark the current node\n\tisVisited[u.ID] = true\n\n\t// Is destination?\n\tif u.ID == d.ID {\n\t\treturn true\n\t}\n\n\t// Recur for all the vertices\n\t// adjacent to current vertex\n\tfor _, child := range u.Childs {\n\t\tif _, ok := isVisited[child.ID]; !ok {\n\t\t\t// store current node\n\t\t\t// in path[]\n\t\t\t*localPathList = append(*localPathList, child)\n\t\t\tif findFirstPathRecursive(child, d, isVisited, localPathList) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// remove current node\n\t\t\t// in path[]\n\t\t\ti := -1\n\t\t\tfor idx, c := range *localPathList {\n\t\t\t\tif c.ID == child.ID {\n\t\t\t\t\ti = idx\n\t\t\t\t}\n\t\t\t}\n\t\t\tif i != -1 {\n\t\t\t\t*localPathList = append((*localPathList)[:i], (*localPathList)[i+1:]...)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Mark the current node\n\tdelete(isVisited, u.ID)\n\treturn false\n}\n\nfunc getNameOrID[T comparable](n *Node[T]) string {\n\treturn n.ID\n}\n"
  },
  {
    "path": "pkg/devcontainer/graph/graph_test.go",
    "content": "package graph\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGraph(t *testing.T) {\n\tvar (\n\t\troot                   = NewNode[interface{}](\"root\", nil)\n\t\trootChild1             = NewNode[interface{}](\"rootChild1\", nil)\n\t\trootChild2             = NewNode[interface{}](\"rootChild2\", nil)\n\t\trootChild3             = NewNode[interface{}](\"rootChild3\", nil)\n\t\trootChild2Child1       = NewNode[interface{}](\"rootChild2Child1\", nil)\n\t\trootChild2Child1Child1 = NewNode[interface{}](\"rootChild2Child1Child1\", nil)\n\n\t\ttestGraph = NewGraph[interface{}](root)\n\t)\n\n\t_, err := testGraph.InsertNodeAt(\"does not exits\", rootChild1.ID, nil)\n\tif err == nil {\n\t\tt.Fatal(\"InsertNodeAt error expected\")\n\t}\n\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild2.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild3.ID, nil)\n\n\t_, _ = testGraph.InsertNodeAt(rootChild2.ID, rootChild2Child1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(rootChild2Child1.ID, rootChild2Child1Child1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(rootChild3.ID, rootChild2.ID, nil)\n\n\t// Cyclic graph error\n\t_, err = testGraph.InsertNodeAt(rootChild2Child1Child1.ID, rootChild3.ID, nil)\n\tif err == nil {\n\t\tt.Fatal(\"Cyclic error expected\")\n\t} else {\n\t\terrMsg := `cyclic dependency found: \nrootChild2Child1Child1\nrootChild3\nrootChild2\nrootChild2Child1\nrootChild2Child1Child1`\n\n\t\tif err.Error() != errMsg {\n\t\t\tt.Fatalf(\"Expected %s, got %s\", errMsg, err.Error())\n\t\t}\n\t}\n\n\t// Find first path\n\tpath := findFirstPath(rootChild1, rootChild2)\n\tif path != nil {\n\t\tt.Fatalf(\"Wrong path found: %#+v\", path)\n\t}\n\n\t// Find first path\n\tpath = findFirstPath(root, rootChild2Child1Child1)\n\tif len(path) != 4 || path[0].ID != root.ID || path[1].ID != rootChild2.ID || path[2].ID != rootChild2Child1.ID || path[3].ID != rootChild2Child1Child1.ID {\n\t\tt.Fatalf(\"Wrong path found: %#+v\", path)\n\t}\n\n\t// Get leaf node\n\tleaf := testGraph.GetNextLeaf(root)\n\tif leaf.ID != rootChild1.ID {\n\t\tt.Fatalf(\"GetLeaf1: Got id %s, expected %s\", leaf.ID, rootChild1.ID)\n\t}\n\n\terr = testGraph.AddEdge(\"NotThere\", leaf.ID)\n\tif err == nil {\n\t\tt.Fatal(\"No error when adding an edge from a non-existing node\")\n\t}\n\n\terr = testGraph.AddEdge(leaf.ID, \"NotThere\")\n\tif err == nil {\n\t\tt.Fatal(\"No error when adding an edge to a non-existing node\")\n\t}\n\n\t// Remove node\n\terr = testGraph.RemoveNode(leaf.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Get leaf node\n\tleaf = testGraph.GetNextLeaf(root)\n\tif leaf.ID != rootChild2Child1Child1.ID {\n\t\tt.Fatalf(\"GetLeaf2: Got id %s, expected %s\", leaf.ID, rootChild2Child1Child1.ID)\n\t}\n\n\t// Remove node\n\terr = testGraph.RemoveNode(root.ID)\n\tif err == nil {\n\t\tt.Fatal(\"Expected error\")\n\t}\n}\n\nfunc TestRemoveSubGraph(t *testing.T) {\n\tvar (\n\t\troot                   = NewNode[interface{}](\"root\", nil)\n\t\trootChild1             = NewNode[interface{}](\"rootChild1\", nil)\n\t\trootChild2             = NewNode[interface{}](\"rootChild2\", nil)\n\t\trootChild3             = NewNode[interface{}](\"rootChild3\", nil)\n\t\trootChild2Child1       = NewNode[interface{}](\"rootChild2Child1\", nil)\n\t\trootChild2Child1Child1 = NewNode[interface{}](\"rootChild2Child1Child1\", nil)\n\n\t\ttestGraph = NewGraph[interface{}](root)\n\t)\n\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild2.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(root.ID, rootChild3.ID, nil)\n\n\t_, _ = testGraph.InsertNodeAt(rootChild2.ID, rootChild2Child1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(rootChild2Child1.ID, rootChild2Child1Child1.ID, nil)\n\t_, _ = testGraph.InsertNodeAt(rootChild3.ID, rootChild2.ID, nil)\n\n\terr := testGraph.RemoveSubGraph(rootChild2.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if testGraph.Nodes[\"rootChild2Child1\"] != nil {\n\t\tt.Fatal(\"rootChild2Child1 exists\")\n\t} else if len(testGraph.Nodes) != 3 {\n\t\tt.Fatal(\"too many nodes\")\n\t}\n}\n"
  },
  {
    "path": "pkg/devcontainer/helpers.go",
    "content": "package devcontainer\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/log\"\n)\n\ntype GetWorkspaceConfigResult struct {\n\tIsImage         bool     `json:\"isImage\"`\n\tIsGitRepository bool     `json:\"isGitRepository\"`\n\tIsLocal         bool     `json:\"isLocal\"`\n\tConfigPaths     []string `json:\"configPaths\"`\n}\n\nfunc FindDevcontainerFiles(ctx context.Context, rawSource, tmpDirPath string, maxDepth int, strictHostKeyChecking bool, log log.Logger) (*GetWorkspaceConfigResult, error) {\n\t// local path\n\tisLocalPath, _ := file.IsLocalDir(rawSource)\n\tif isLocalPath {\n\t\treturn FindFilesInLocalDir(rawSource, maxDepth, log)\n\t}\n\n\t// git repo\n\tgitRepository, gitPRReference, gitBranch, gitCommit, gitSubDir := git.NormalizeRepository(rawSource)\n\tif strings.HasSuffix(rawSource, \".git\") || git.PingRepository(gitRepository, git.GetDefaultExtraEnv(strictHostKeyChecking)) {\n\t\tlog.Debug(\"Git repository detected\")\n\t\treturn FindFilesInGitRepo(ctx, gitRepository, gitPRReference, gitBranch, gitCommit, gitSubDir, tmpDirPath, strictHostKeyChecking, maxDepth, log)\n\t}\n\n\tresult := &GetWorkspaceConfigResult{ConfigPaths: []string{}}\n\n\t// container image\n\t_, err := image.GetImage(ctx, rawSource)\n\tif err == nil {\n\t\tlog.Debug(\"Container image detected\")\n\t\tresult.IsImage = true\n\t\t// Doesn't matter, we just want to know if it's an image\n\t\t// not going to poke around in the image fs\n\t\treturn result, nil\n\t}\n\n\treturn result, nil\n}\n\nfunc FindFilesInLocalDir(rawSource string, maxDepth int, log log.Logger) (*GetWorkspaceConfigResult, error) {\n\tlog.Debug(\"Local directory detected\")\n\tresult := &GetWorkspaceConfigResult{ConfigPaths: []string{}}\n\tresult.IsLocal = true\n\tinitialDepth := strings.Count(rawSource, string(filepath.Separator))\n\terr := filepath.WalkDir(rawSource, func(path string, info fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdepth := strings.Count(path, string(filepath.Separator)) - initialDepth\n\t\tif info.IsDir() && depth > maxDepth {\n\t\t\treturn filepath.SkipDir\n\t\t}\n\n\t\tif isDevcontainerFilename(path) {\n\t\t\trelPath, err := filepath.Rel(rawSource, path)\n\t\t\tif err != nil {\n\t\t\t\tlog.Warnf(\"Unable to get relative path for %s: %s\", path, err.Error())\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tresult.ConfigPaths = append(result.ConfigPaths, relPath)\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}\n\nfunc FindFilesInGitRepo(ctx context.Context, gitRepository, gitPRReference, gitBranch, gitCommit, gitSubDir, tmpDirPath string, strictHostKeyChecking bool, maxDepth int, log log.Logger) (*GetWorkspaceConfigResult, error) {\n\tresult := &GetWorkspaceConfigResult{\n\t\tConfigPaths:     []string{},\n\t\tIsGitRepository: true,\n\t}\n\n\tgitInfo := git.NewGitInfo(gitRepository, gitBranch, gitCommit, gitPRReference, gitSubDir)\n\tlog.Debugf(\"Cloning git repository into %s\", tmpDirPath)\n\terr := git.CloneRepository(ctx, gitInfo, tmpDirPath, \"\", strictHostKeyChecking, log, git.WithCloneStrategy(git.BareCloneStrategy))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Debug(\"Listing git file tree\")\n\tref := \"HEAD\"\n\t// checkout on branch if available\n\tif gitBranch != \"\" {\n\t\tref = gitBranch\n\t}\n\t// git ls-tree -r --full-name --name-only $REF\n\tlsArgs := []string{\"ls-tree\", \"-r\", \"--full-name\", \"--name-only\", ref}\n\tlsCmd := git.CommandContext(ctx, git.GetDefaultExtraEnv(strictHostKeyChecking), lsArgs...)\n\tlsCmd.Dir = tmpDirPath\n\tstdout, err := lsCmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = lsCmd.Start()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tscanner := bufio.NewScanner(stdout)\n\tfor scanner.Scan() {\n\t\tpath := scanner.Text()\n\t\tdepth := strings.Count(path, string(filepath.Separator))\n\t\tif depth > maxDepth {\n\t\t\tcontinue\n\t\t}\n\t\tif isDevcontainerFilename(path) {\n\t\t\tresult.ConfigPaths = append(result.ConfigPaths, path)\n\t\t}\n\t}\n\n\terr = lsCmd.Wait()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}\n\nfunc isDevcontainerFilename(path string) bool {\n\treturn filepath.Base(path) == \".devcontainer.json\" || filepath.Base(path) == \"devcontainer.json\"\n}\n"
  },
  {
    "path": "pkg/devcontainer/inspect.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n)\n\nfunc (r *runner) inspectImage(ctx context.Context, imageName string) (*config.ImageDetails, error) {\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif ok {\n\t\treturn dockerDriver.InspectImage(ctx, imageName)\n\t}\n\n\t// fallback to just looking into the remote registry\n\timageConfig, _, err := image.GetImageConfig(ctx, imageName, r.Log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &config.ImageDetails{\n\t\tID: imageName,\n\t\tConfig: config.ImageDetailsConfig{\n\t\t\tUser:       imageConfig.Config.User,\n\t\t\tEnv:        imageConfig.Config.Env,\n\t\t\tLabels:     imageConfig.Config.Labels,\n\t\t\tEntrypoint: imageConfig.Config.Entrypoint,\n\t\t\tCmd:        imageConfig.Config.Cmd,\n\t\t},\n\t}, nil\n}\n\nfunc (r *runner) getImageTag(ctx context.Context, imageID string) (string, error) {\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif ok {\n\t\treturn dockerDriver.GetImageTag(ctx, imageID)\n\t}\n\n\treturn \"\", nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/metadata/metadata.go",
    "content": "package metadata\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst ImageMetadataLabel = \"devcontainer.metadata\"\n\nfunc GetDevContainerMetadata(substitutionContext *config.SubstitutionContext, baseImageMetadata *config.ImageMetadataConfig, devContainerConfig *config.SubstitutedConfig, featuresConfig []*config.FeatureSet) (*config.ImageMetadataConfig, error) {\n\t// features\n\tfeaturesRaw := []*config.ImageMetadata{}\n\tfor _, featureSet := range featuresConfig {\n\t\tfeaturesRaw = append(featuresRaw, FeatureConfigToImageMetadata(featureSet.Config))\n\t}\n\n\tretImageMetadataConfig := &config.ImageMetadataConfig{}\n\tretImageMetadataConfig.Raw = append(retImageMetadataConfig.Raw, baseImageMetadata.Raw...)\n\tretImageMetadataConfig.Raw = append(retImageMetadataConfig.Raw, featuresRaw...)\n\tretImageMetadataConfig.Raw = append(retImageMetadataConfig.Raw, DevContainerConfigToImageMetadata(devContainerConfig.Raw))\n\n\tretImageMetadataConfig.Config = append(retImageMetadataConfig.Config, baseImageMetadata.Config...)\n\tfor _, featureRaw := range featuresRaw {\n\t\tfeatureConfig := &config.ImageMetadata{}\n\t\terr := config.Substitute(substitutionContext, featureRaw, featureConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tretImageMetadataConfig.Config = append(retImageMetadataConfig.Config, featureConfig)\n\t}\n\tretImageMetadataConfig.Config = append(retImageMetadataConfig.Config, DevContainerConfigToImageMetadata(devContainerConfig.Config))\n\treturn retImageMetadataConfig, nil\n}\n\nfunc FeatureConfigToImageMetadata(feature *config.FeatureConfig) *config.ImageMetadata {\n\treturn &config.ImageMetadata{\n\t\tEntrypoint: feature.Entrypoint,\n\t\tDevContainerActions: config.DevContainerActions{\n\t\t\tCustomizations: feature.Customizations,\n\t\t},\n\t\tNonComposeBase: config.NonComposeBase{\n\t\t\tMounts:      feature.Mounts,\n\t\t\tInit:        feature.Init,\n\t\t\tPrivileged:  feature.Privileged,\n\t\t\tCapAdd:      feature.CapAdd,\n\t\t\tSecurityOpt: feature.SecurityOpt,\n\t\t},\n\t}\n}\n\nfunc DevContainerConfigToImageMetadata(devConfig *config.DevContainerConfig) *config.ImageMetadata {\n\treturn &config.ImageMetadata{\n\t\tDevContainerConfigBase: config.DevContainerConfigBase{\n\t\t\tForwardPorts:         devConfig.ForwardPorts,\n\t\t\tPortsAttributes:      devConfig.PortsAttributes,\n\t\t\tOtherPortsAttributes: devConfig.OtherPortsAttributes,\n\t\t\tUpdateRemoteUserUID:  devConfig.UpdateRemoteUserUID,\n\t\t\tRemoteEnv:            devConfig.RemoteEnv,\n\t\t\tRemoteUser:           devConfig.RemoteUser,\n\t\t\tShutdownAction:       devConfig.ShutdownAction,\n\t\t\tWaitFor:              devConfig.WaitFor,\n\t\t\tUserEnvProbe:         devConfig.UserEnvProbe,\n\t\t\tHostRequirements:     devConfig.HostRequirements,\n\t\t\tOverrideCommand:      devConfig.OverrideCommand,\n\t\t},\n\t\tDevContainerActions: config.DevContainerActions{\n\t\t\tOnCreateCommand:      devConfig.OnCreateCommand,\n\t\t\tUpdateContentCommand: devConfig.UpdateContentCommand,\n\t\t\tPostCreateCommand:    devConfig.PostCreateCommand,\n\t\t\tPostStartCommand:     devConfig.PostStartCommand,\n\t\t\tPostAttachCommand:    devConfig.PostAttachCommand,\n\t\t\tCustomizations:       devConfig.Customizations,\n\t\t},\n\t\tNonComposeBase: config.NonComposeBase{\n\t\t\tContainerEnv:  devConfig.ContainerEnv,\n\t\t\tContainerUser: devConfig.ContainerUser,\n\t\t\tMounts:        devConfig.Mounts,\n\t\t\tInit:          devConfig.Init,\n\t\t\tPrivileged:    devConfig.Privileged,\n\t\t\tCapAdd:        devConfig.CapAdd,\n\t\t\tSecurityOpt:   devConfig.SecurityOpt,\n\t\t},\n\t}\n}\n\nfunc GetImageMetadataFromContainer(containerDetails *config.ContainerDetails, substituteContext *config.SubstitutionContext, log log.Logger) (*config.ImageMetadataConfig, error) {\n\tif containerDetails == nil || containerDetails.Config.Labels == nil || containerDetails.Config.Labels[ImageMetadataLabel] == \"\" {\n\t\treturn &config.ImageMetadataConfig{}, nil\n\t}\n\n\timageMetadataConfig := &config.ImageMetadataConfig{}\n\tmultiple := []*config.ImageMetadata{}\n\terr := json.Unmarshal([]byte(containerDetails.Config.Labels[ImageMetadataLabel]), &multiple)\n\tif err != nil {\n\t\tsingle := &config.ImageMetadata{}\n\t\terr = json.Unmarshal([]byte(containerDetails.Config.Labels[ImageMetadataLabel]), single)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error parsing image metadata: %v\", err)\n\t\t\treturn &config.ImageMetadataConfig{}, nil\n\t\t}\n\n\t\timageMetadataConfig.Raw = []*config.ImageMetadata{single}\n\t} else {\n\t\timageMetadataConfig.Raw = multiple\n\t}\n\n\terr = substituteConfig(imageMetadataConfig, substituteContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn imageMetadataConfig, nil\n}\n\nfunc GetImageMetadata(imageDetails *config.ImageDetails, substituteContext *config.SubstitutionContext, log log.Logger) (*config.ImageMetadataConfig, error) {\n\tif imageDetails.Config.Labels == nil || imageDetails.Config.Labels[ImageMetadataLabel] == \"\" {\n\t\treturn &config.ImageMetadataConfig{}, nil\n\t}\n\n\timageMetadataConfig := &config.ImageMetadataConfig{}\n\tmultiple := []*config.ImageMetadata{}\n\terr := json.Unmarshal([]byte(imageDetails.Config.Labels[ImageMetadataLabel]), &multiple)\n\tif err != nil {\n\t\tsingle := &config.ImageMetadata{}\n\t\terr = json.Unmarshal([]byte(imageDetails.Config.Labels[ImageMetadataLabel]), single)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error parsing image metadata: %v\", err)\n\t\t\treturn &config.ImageMetadataConfig{}, nil\n\t\t}\n\n\t\timageMetadataConfig.Raw = []*config.ImageMetadata{single}\n\t} else {\n\t\timageMetadataConfig.Raw = multiple\n\t}\n\n\terr = substituteConfig(imageMetadataConfig, substituteContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn imageMetadataConfig, nil\n}\n\nfunc substituteConfig(imageConfig *config.ImageMetadataConfig, substituteContext *config.SubstitutionContext) error {\n\timageConfig.Config = []*config.ImageMetadata{}\n\tfor _, raw := range imageConfig.Raw {\n\t\timageMetadata := &config.ImageMetadata{}\n\t\terr := config.Substitute(substituteContext, raw, imageMetadata)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\timageConfig.Config = append(imageConfig.Config, imageMetadata)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/prebuild.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc (r *runner) Build(ctx context.Context, options provider.BuildOptions) (string, error) {\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"building only supported with docker driver\")\n\t}\n\n\tsubstitutedConfig, substitutionContext, err := r.getSubstitutedConfig(options.CLIOptions)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprebuildRepo := getPrebuildRepository(substitutedConfig)\n\n\tif !options.SkipPush && options.Repository == \"\" && prebuildRepo == \"\" {\n\t\treturn \"\", fmt.Errorf(\"repository needs to be specified\")\n\t}\n\n\t// remove build information\n\tdefer func() {\n\t\tcontextPath := config.GetContextPath(substitutedConfig.Config)\n\t\t_ = os.RemoveAll(filepath.Join(contextPath, config.DevPodContextFeatureFolder))\n\t}()\n\n\t// check if we need to build container\n\tbuildInfo, err := r.build(ctx, substitutedConfig, substitutionContext, options)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"build image\")\n\t}\n\n\t// have a fallback value for PrebuildHash\n\t// in some cases it may be empty, and this would lead to\n\t// invalid reference format during image pushing.\n\tif buildInfo.PrebuildHash == \"\" {\n\t\tbuildInfo.PrebuildHash = \"latest\"\n\t}\n\n\t// prebuild already exists\n\tvar prebuildImage string\n\tif options.Repository != \"\" {\n\t\tprebuildImage = options.Repository + \":\" + buildInfo.PrebuildHash\n\t} else if prebuildRepo != \"\" {\n\t\tprebuildImage = prebuildRepo + \":\" + buildInfo.PrebuildHash\n\t} else {\n\t\tprebuildImage = build.GetImageName(r.LocalWorkspaceFolder, buildInfo.PrebuildHash)\n\t}\n\n\tif buildInfo.ImageName == prebuildImage {\n\t\treturn buildInfo.ImageName, nil\n\t}\n\n\t// should we push?\n\tif options.SkipPush {\n\t\treturn prebuildImage, nil\n\t}\n\n\tif isDockerComposeConfig(substitutedConfig.Config) {\n\t\tif err := dockerDriver.TagDevContainer(ctx, buildInfo.ImageName, prebuildImage); err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"tag image\")\n\t\t}\n\t}\n\n\t// check if we can push image\n\tif err := image.CheckPushPermissions(prebuildImage); err != nil {\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"cannot push to repository %s. Please make sure you are logged into the registry and credentials are available. (Error: %w)\",\n\t\t\tprebuildImage,\n\t\t\terr,\n\t\t)\n\t}\n\n\t// Setup all image tags (prebuild and any user defined tags)\n\timageRefs := []string{prebuildImage}\n\n\timageRepoName := strings.Split(prebuildImage, \":\")\n\tif buildInfo.Tags != nil {\n\t\tfor _, tag := range buildInfo.Tags {\n\t\t\timageRefs = append(imageRefs, imageRepoName[0]+\":\"+tag)\n\t\t}\n\t}\n\n\t// tag the image\n\tfor _, imageRef := range imageRefs {\n\t\tif err := dockerDriver.TagDevContainer(ctx, prebuildImage, imageRef); err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"tag image\")\n\t\t}\n\t}\n\n\t// push the image to the registry\n\tfor _, imageRef := range imageRefs {\n\t\tif err := dockerDriver.PushDevContainer(ctx, imageRef); err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"push image\")\n\t\t}\n\t}\n\n\treturn prebuildImage, nil\n}\n\nfunc getPrebuildRepository(substitutedConfig *config.SubstitutedConfig) string {\n\tif len(config.GetDevPodCustomizations(substitutedConfig.Config).PrebuildRepository) > 0 {\n\t\treturn config.GetDevPodCustomizations(substitutedConfig.Config).PrebuildRepository[0]\n\t}\n\n\treturn \"\"\n}\n"
  },
  {
    "path": "pkg/devcontainer/run.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/driver/drivercreate\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/loft-sh/devpod/pkg/language\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Runner interface {\n\tUp(ctx context.Context, options UpOptions, timeout time.Duration) (*config.Result, error)\n\n\tBuild(ctx context.Context, options provider2.BuildOptions) (string, error)\n\n\tFind(ctx context.Context) (*config.ContainerDetails, error)\n\n\tCommand(\n\t\tctx context.Context,\n\t\tuser string,\n\t\tcommand string,\n\t\tstdin io.Reader,\n\t\tstdout io.Writer,\n\t\tstderr io.Writer,\n\t) error\n\n\tStop(ctx context.Context) error\n\n\tDelete(ctx context.Context) error\n\n\tLogs(ctx context.Context, writer io.Writer) error\n}\n\nfunc NewRunner(\n\tagentPath, agentDownloadURL string,\n\tworkspaceConfig *provider2.AgentWorkspaceInfo,\n\tlog log.Logger,\n) (Runner, error) {\n\tdriver, err := drivercreate.NewDriver(workspaceConfig, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// we use the workspace uid as id to avoid conflicts between container names\n\treturn &runner{\n\t\tDriver: driver,\n\n\t\tAgentPath:            agentPath,\n\t\tAgentDownloadURL:     agentDownloadURL,\n\t\tLocalWorkspaceFolder: workspaceConfig.ContentFolder,\n\t\tID:                   GetRunnerIDFromWorkspace(workspaceConfig.Workspace),\n\t\tWorkspaceConfig:      workspaceConfig,\n\t\tLog:                  log,\n\t}, nil\n}\n\ntype runner struct {\n\tDriver driver.Driver\n\n\tWorkspaceConfig  *provider2.AgentWorkspaceInfo\n\tAgentPath        string\n\tAgentDownloadURL string\n\n\tLocalWorkspaceFolder string\n\n\tID string\n\n\tLog log.Logger\n}\n\ntype UpOptions struct {\n\tprovider2.CLIOptions\n\n\tNoBuild       bool\n\tForceBuild    bool\n\tRegistryCache string\n}\n\nfunc (r *runner) Up(ctx context.Context, options UpOptions, timeout time.Duration) (*config.Result, error) {\n\tr.Log.Debugf(\"Up devcontainer for workspace '%s' with timeout %s\", r.WorkspaceConfig.Workspace.ID, timeout)\n\n\tsubstitutedConfig, substitutionContext, err := r.getSubstitutedConfig(options.CLIOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer cleanupBuildInformation(substitutedConfig.Config)\n\n\t// do not run initialize command in platform mode\n\tif !options.CLIOptions.Platform.Enabled {\n\t\tif err := runInitializeCommand(r.LocalWorkspaceFolder, substitutedConfig.Config, options.InitEnv, r.Log); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if len(substitutedConfig.Config.InitializeCommand) > 0 {\n\t\tr.Log.Info(\"Skipping initializeCommand on platform\")\n\t}\n\n\tswitch {\n\tcase isDockerFileConfig(substitutedConfig.Config),\n\t\tsubstitutedConfig.Config.Image != \"\",\n\t\tsubstitutedConfig.Config.ContainerID != \"\":\n\t\treturn r.runSingleContainer(\n\t\t\tctx,\n\t\t\tsubstitutedConfig,\n\t\t\tsubstitutionContext,\n\t\t\toptions,\n\t\t\ttimeout,\n\t\t)\n\tcase isDockerComposeConfig(substitutedConfig.Config):\n\t\treturn r.runDockerCompose(ctx, substitutedConfig, substitutionContext, options, timeout)\n\tdefault:\n\t\treturn r.runDefaultContainer(ctx, options, substitutedConfig, substitutionContext, timeout)\n\t}\n}\n\nfunc (r *runner) runDefaultContainer(ctx context.Context, options UpOptions, substitutedConfig *config.SubstitutedConfig, substitutionContext *config.SubstitutionContext, timeout time.Duration) (*config.Result, error) {\n\tif options.FallbackImage != \"\" {\n\t\tr.Log.Warn(\"dev container config is missing one of \\\"image\\\", \\\"dockerFile\\\" or \\\"dockerComposeFile\\\" properties, using fallback image \" + options.FallbackImage)\n\n\t\tsubstitutedConfig.Config.ImageContainer = config.ImageContainer{\n\t\t\tImage: options.FallbackImage,\n\t\t}\n\t} else {\n\t\tr.Log.Warn(\"dev container config is missing one of \\\"image\\\", \\\"dockerFile\\\" or \\\"dockerComposeFile\\\" properties, defaulting to auto-detection\")\n\n\t\tlang, err := language.DetectLanguage(r.LocalWorkspaceFolder)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not detect project language and dev container config is missing one of \\\"image\\\", \\\"dockerFile\\\" or \\\"dockerComposeFile\\\" properties\")\n\t\t}\n\n\t\tif language.MapConfig[lang] == nil {\n\t\t\treturn nil, fmt.Errorf(\"could not detect project language and dev container config is missing one of \\\"image\\\", \\\"dockerFile\\\" or \\\"dockerComposeFile\\\" properties\")\n\t\t}\n\t\tsubstitutedConfig.Config.ImageContainer = language.MapConfig[lang].ImageContainer\n\t}\n\n\treturn r.runSingleContainer(ctx, substitutedConfig, substitutionContext, options, timeout)\n}\n\nfunc (r *runner) Command(\n\tctx context.Context,\n\tuser string,\n\tcommand string,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\tstderr io.Writer,\n) error {\n\treturn r.Driver.CommandDevContainer(ctx, r.ID, user, command, stdin, stdout, stderr)\n}\n\nfunc (r *runner) Find(ctx context.Context) (*config.ContainerDetails, error) {\n\tcontainerDetails, err := r.Driver.FindDevContainer(ctx, r.ID)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"find dev container\")\n\t}\n\n\treturn containerDetails, nil\n}\n\nfunc (r *runner) Logs(ctx context.Context, writer io.Writer) error {\n\treturn r.Driver.GetDevContainerLogs(ctx, r.ID, writer, writer)\n}\n\nfunc isDockerFileConfig(config *config.DevContainerConfig) bool {\n\treturn config.GetDockerfile() != \"\"\n}\n\nfunc runInitializeCommand(\n\tworkspaceFolder string,\n\tconfig *config.DevContainerConfig,\n\textraEnvVars []string,\n\tlog log.Logger,\n) error {\n\tif len(config.InitializeCommand) == 0 {\n\t\treturn nil\n\t}\n\n\tshellArgs := []string{\"sh\", \"-c\"}\n\t// According to the devcontainer spec, `initializeCommand` needs to be run on the host.\n\t// On Windows we can't assume everyone has `sh` added to their PATH so we need to use Windows default shell (usually cmd.exe)\n\tif runtime.GOOS == \"windows\" {\n\t\tcomSpec := os.Getenv(\"COMSPEC\")\n\t\tif comSpec != \"\" {\n\t\t\tshellArgs = []string{comSpec, \"/c\"}\n\t\t} else {\n\t\t\tshellArgs = []string{\"cmd.exe\", \"/c\"}\n\t\t}\n\t}\n\n\tfor _, cmd := range config.InitializeCommand {\n\t\t// should run in shell?\n\t\tvar args []string\n\t\tif len(cmd) == 1 {\n\t\t\targs = []string{shellArgs[0], shellArgs[1], cmd[0]}\n\t\t} else {\n\t\t\targs = cmd\n\t\t}\n\n\t\t// run the command\n\t\tlog.Infof(\"Running initializeCommand from devcontainer.json: '%s'\", strings.Join(args, \" \"))\n\t\twriter := log.Writer(logrus.InfoLevel, false)\n\t\terrwriter := log.Writer(logrus.ErrorLevel, false)\n\t\tdefer writer.Close()\n\t\tdefer errwriter.Close()\n\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tenv := cmd.Environ()\n\t\tenv = append(env, extraEnvVars...)\n\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\tcmd.Dir = workspaceFolder\n\t\tcmd.Env = env\n\t\terr := cmd.Run()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getWorkspace(\n\tworkspaceFolder, workspaceID string,\n\tconf *config.DevContainerConfig,\n) (string, string) {\n\tif conf.WorkspaceMount != \"\" {\n\t\tmount := config.ParseMount(conf.WorkspaceMount)\n\t\treturn conf.WorkspaceMount, mount.Target\n\t}\n\n\tcontainerMountFolder := conf.WorkspaceFolder\n\tif containerMountFolder == \"\" {\n\t\tcontainerMountFolder = \"/workspaces/\" + workspaceID\n\t}\n\n\tconsistency := \"\"\n\tif runtime.GOOS != \"linux\" {\n\t\tconsistency = \",consistency='consistent'\"\n\t}\n\n\treturn fmt.Sprintf(\n\t\t\"type=bind,source=%s,target=%s%s\",\n\t\tworkspaceFolder,\n\t\tcontainerMountFolder,\n\t\tconsistency,\n\t), containerMountFolder\n}\n\nfunc GetRunnerIDFromWorkspace(workspace *provider2.Workspace) string {\n\tID := workspace.UID\n\tif encoding.IsLegacyUID(workspace.UID) {\n\t\tID = workspace.ID\n\t}\n\n\treturn ID\n}\n"
  },
  {
    "path": "pkg/devcontainer/setup/lifecyclehooks.go",
    "content": "package setup\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"regexp\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc RunLifecycleHooks(ctx context.Context, setupInfo *config.Result, log log.Logger) error {\n\tmergedConfig := setupInfo.MergedConfig\n\tremoteUser := config.GetRemoteUser(setupInfo)\n\tprobedEnv, err := config.ProbeUserEnv(ctx, mergedConfig.UserEnvProbe, remoteUser, log)\n\tif err != nil {\n\t\tlog.Errorf(\"failed to probe environment, this might lead to an incomplete setup of your workspace: %w\", err)\n\t}\n\tremoteEnv := mergeRemoteEnv(mergedConfig.RemoteEnv, probedEnv, remoteUser)\n\n\tworkspaceFolder := setupInfo.SubstitutionContext.ContainerWorkspaceFolder\n\tcontainerDetails := setupInfo.ContainerDetails\n\n\t// only run once per container run\n\terr = run(mergedConfig.OnCreateCommands, remoteUser, workspaceFolder, remoteEnv,\n\t\t\"onCreateCommands\", containerDetails.Created, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO: rerun when contents changed\n\terr = run(mergedConfig.UpdateContentCommands, remoteUser, workspaceFolder, remoteEnv,\n\t\t\"updateContentCommands\", containerDetails.Created, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// only run once per container run\n\terr = run(mergedConfig.PostCreateCommands, remoteUser, workspaceFolder, remoteEnv,\n\t\t\"postCreateCommands\", containerDetails.Created, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// run when the container was restarted\n\terr = run(mergedConfig.PostStartCommands, remoteUser, workspaceFolder, remoteEnv,\n\t\t\"postStartCommands\", containerDetails.State.StartedAt, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// run always when attaching to the container\n\terr = run(mergedConfig.PostAttachCommands, remoteUser, workspaceFolder, remoteEnv,\n\t\t\"postAttachCommands\", \"\", log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc run(commands []types.LifecycleHook, remoteUser, dir string, remoteEnv map[string]string, name, content string, log log.Logger) error {\n\tif len(commands) == 0 {\n\t\treturn nil\n\t}\n\n\t// check marker file\n\tif content != \"\" {\n\t\texists, err := markerFileExists(name, content)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if exists {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tremoteEnvArr := []string{}\n\tfor k, v := range remoteEnv {\n\t\tremoteEnvArr = append(remoteEnvArr, k+\"=\"+v)\n\t}\n\n\tfor _, cmd := range commands {\n\t\tif len(cmd) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor k, c := range cmd {\n\t\t\tlog.Infof(\"Run command %s: %s...\", k, strings.Join(c, \" \"))\n\t\t\tcurrentUser, err := user.Current()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\targs := []string{}\n\t\t\tif remoteUser != currentUser.Username {\n\t\t\t\targs = append(args, \"su\", remoteUser, \"-c\", command.Quote(c))\n\t\t\t} else {\n\t\t\t\targs = append(args, \"sh\", \"-c\", command.Quote(c))\n\t\t\t}\n\n\t\t\t// create command\n\t\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\t\tcmd.Dir = dir\n\t\t\tcmd.Env = os.Environ()\n\t\t\tcmd.Env = append(cmd.Env, remoteEnvArr...)\n\n\t\t\t// Create pipes for stdout and stderr\n\t\t\tstdoutPipe, err := cmd.StdoutPipe()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to get stdout pipe: %w\", err)\n\t\t\t}\n\t\t\tstderrPipe, err := cmd.StderrPipe()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to get stderr pipe: %w\", err)\n\t\t\t}\n\n\t\t\t// Start the command\n\t\t\tif err := cmd.Start(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to start command: %w\", err)\n\t\t\t}\n\n\t\t\t// Use WaitGroup to wait for both stdout and stderr processing\n\t\t\tvar wg sync.WaitGroup\n\t\t\twg.Add(2)\n\n\t\t\tgo func() {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tlogPipeOutput(log, stdoutPipe, logrus.InfoLevel)\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tlogPipeOutput(log, stderrPipe, logrus.ErrorLevel)\n\t\t\t}()\n\n\t\t\t// Wait for command to finish\n\t\t\twg.Wait()\n\t\t\terr = cmd.Wait()\n\t\t\tif err != nil {\n\t\t\t\tlog.Debugf(\"Failed running postCreateCommand lifecycle script %s: %v\", cmd.Args, err)\n\t\t\t\treturn fmt.Errorf(\"failed to run: %s, error: %w\", strings.Join(c, \" \"), err)\n\t\t\t}\n\n\t\t\tlog.Donef(\"Successfully ran command %s: %s\", k, strings.Join(c, \" \"))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc logPipeOutput(log log.Logger, pipe io.ReadCloser, level logrus.Level) {\n\tscanner := bufio.NewScanner(pipe)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif level == logrus.InfoLevel {\n\t\t\tlog.Info(line)\n\t\t} else if level == logrus.ErrorLevel {\n\t\t\tif containsError(line) {\n\t\t\t\tlog.Error(line)\n\t\t\t} else {\n\t\t\t\tlog.Warn(line)\n\t\t\t}\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Errorf(\"Error reading pipe: %v\", err)\n\t}\n}\n\n// containsError defines what log line treated as error log should contain.\nfunc containsError(line string) bool {\n\treturn strings.Contains(strings.ToLower(line), \"error\")\n}\n\nfunc mergeRemoteEnv(remoteEnv map[string]string, probedEnv map[string]string, remoteUser string) map[string]string {\n\tretEnv := map[string]string{}\n\n\t// Order matters here\n\t// remoteEnv should always override probedEnv as it has been specified explicitly by the devcontainer author\n\tfor k, v := range probedEnv {\n\t\tretEnv[k] = v\n\t}\n\tfor k, v := range remoteEnv {\n\t\tretEnv[k] = v\n\t}\n\tprobedPath, probeOk := probedEnv[\"PATH\"]\n\tremotePath, remoteOk := remoteEnv[\"PATH\"]\n\tif probeOk && remoteOk {\n\t\t// merge probed PATH and remote PATH\n\t\tsbinRegex := regexp.MustCompile(`/sbin(/|$)`)\n\t\tprobedTokens := strings.Split(probedPath, \":\")\n\t\tinsertAt := 0\n\t\tfor _, e := range strings.Split(remotePath, \":\") {\n\t\t\t// check if remotePath entry is in probed tokens\n\t\t\ti := slices.Index(probedTokens, e)\n\t\t\tif i == -1 {\n\t\t\t\t// only include /sbin paths for root users\n\t\t\t\tif remoteUser == \"root\" || !sbinRegex.MatchString(e) {\n\t\t\t\t\tprobedTokens = slices.Insert(probedTokens, insertAt, e)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinsertAt = i + 1\n\t\t\t}\n\t\t}\n\n\t\tretEnv[\"PATH\"] = strings.Join(probedTokens, \":\")\n\t}\n\n\treturn retEnv\n}\n"
  },
  {
    "path": "pkg/devcontainer/setup/setup.go",
    "content": "package setup\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnel\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\tcopy2 \"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/envfile\"\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n\tclientcmdapi \"k8s.io/client-go/tools/clientcmd/api\"\n)\n\nconst (\n\tResultLocation = \"/var/run/devpod/result.json\"\n)\n\nfunc SetupContainer(ctx context.Context, setupInfo *config.Result, extraWorkspaceEnv []string, chownProjects bool, platformOptions *devpod.PlatformOptions, tunnelClient tunnel.TunnelClient, log log.Logger) error {\n\t// write result to ResultLocation\n\tWriteResult(setupInfo, log)\n\n\t// chown user dir\n\terr := ChownWorkspace(setupInfo, chownProjects, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"chown workspace\")\n\t}\n\n\t// patch remote env\n\tlog.Debugf(\"Patch etc environment & profile...\")\n\terr = PatchEtcEnvironment(setupInfo.MergedConfig, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"patch etc environment\")\n\t}\n\terr = PatchEtcEnvironmentFlags(extraWorkspaceEnv, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"patch etc environment from flags\")\n\t}\n\n\t// patch etc profile\n\terr = PatchEtcProfile()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"patch etc profile\")\n\t}\n\n\t// link /home/root to root if necessary\n\terr = LinkRootHome(setupInfo)\n\tif err != nil {\n\t\tlog.Errorf(\"Error linking /home/root: %v\", err)\n\t}\n\n\t// chown agent sock file\n\terr = ChownAgentSock(setupInfo)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"chown ssh agent sock file\")\n\t}\n\n\t// setup kube config\n\terr = SetupKubeConfig(ctx, setupInfo, tunnelClient, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Error setting up KubeConfig: %v\", err)\n\t}\n\n\t// setup platform git credentials\n\terr = setupPlatformGitCredentials(config.GetRemoteUser(setupInfo), platformOptions, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Error setting up platform git credentials: %v\", err)\n\t}\n\n\t// run commands\n\tlog.Debugf(\"Run lifecycle hooks commands...\")\n\terr = RunLifecycleHooks(ctx, setupInfo, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"lifecycle hooks\")\n\t}\n\n\tlog.Debugf(\"Done setting up environment\")\n\treturn nil\n}\n\nfunc WriteResult(setupInfo *config.Result, log log.Logger) {\n\trawBytes, err := json.Marshal(setupInfo)\n\tif err != nil {\n\t\tlog.Warnf(\"Error marshal result: %v\", err)\n\t\treturn\n\t}\n\n\texisting, _ := os.ReadFile(ResultLocation)\n\tif string(rawBytes) == string(existing) {\n\t\treturn\n\t}\n\n\terr = os.MkdirAll(filepath.Dir(ResultLocation), 0777)\n\tif err != nil {\n\t\tlog.Warnf(\"Error create %s: %v\", filepath.Dir(ResultLocation), err)\n\t\treturn\n\t}\n\n\terr = os.WriteFile(ResultLocation, rawBytes, 0600)\n\tif err != nil {\n\t\tlog.Warnf(\"Error write result to %s: %v\", ResultLocation, err)\n\t\treturn\n\t}\n}\n\nfunc LinkRootHome(setupInfo *config.Result) error {\n\tuser := config.GetRemoteUser(setupInfo)\n\tif user != \"root\" {\n\t\treturn nil\n\t}\n\n\thome, err := command.GetHome(user)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find root home\")\n\t} else if home == \"/home/root\" {\n\t\treturn nil\n\t}\n\n\t_, err = os.Stat(\"/home/root\")\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\t// link /home/root to the root home\n\terr = os.MkdirAll(\"/home\", 0777)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create /home folder\")\n\t}\n\n\terr = os.Symlink(home, \"/home/root\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create symlink\")\n\t}\n\n\treturn nil\n}\n\nfunc ChownWorkspace(setupInfo *config.Result, recursive bool, log log.Logger) error {\n\tuser := config.GetRemoteUser(setupInfo)\n\texists, err := markerFileExists(\"chownWorkspace\", \"\")\n\tif err != nil {\n\t\treturn err\n\t} else if exists {\n\t\treturn nil\n\t}\n\n\tworkspaceRoot := filepath.Dir(setupInfo.SubstitutionContext.ContainerWorkspaceFolder)\n\n\tif workspaceRoot != \"/\" {\n\t\tlog.Infof(\"Chown workspace...\")\n\t\terr = copy2.Chown(workspaceRoot, user)\n\t\tif err != nil {\n\t\t\tlog.Warn(err)\n\t\t}\n\t}\n\n\tif recursive {\n\t\tlog.Infof(\"Chown projects...\")\n\t\terr = copy2.ChownR(setupInfo.SubstitutionContext.ContainerWorkspaceFolder, user)\n\t\t// do not exit on error, we can have non-fatal errors\n\t\tif err != nil {\n\t\t\tlog.Warn(err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc PatchEtcProfile() error {\n\texists, err := markerFileExists(\"patchEtcProfile\", \"\")\n\tif err != nil {\n\t\treturn err\n\t} else if exists {\n\t\treturn nil\n\t}\n\n\tout, err := exec.Command(\"sh\", \"-c\", `sed -i -E 's/((^|\\s)PATH=)([^\\$]*)$/\\1${PATH:-\\3}/g' /etc/profile || true`).CombinedOutput()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"create remote environment: %v\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc PatchEtcEnvironmentFlags(workspaceEnv []string, log log.Logger) error {\n\tif len(workspaceEnv) == 0 {\n\t\treturn nil\n\t}\n\n\t// make sure we sort the strings\n\tsort.Strings(workspaceEnv)\n\n\t// check if we need to update env\n\texists, err := markerFileExists(\"patchEtcEnvironmentFlags\", strings.Join(workspaceEnv, \"\\n\"))\n\tif err != nil {\n\t\treturn err\n\t} else if exists {\n\t\treturn nil\n\t}\n\n\t// update env\n\tenvfile.MergeAndApply(config.ListToObject(workspaceEnv), log)\n\treturn nil\n}\n\nfunc PatchEtcEnvironment(mergedConfig *config.MergedDevContainerConfig, log log.Logger) error {\n\tif len(mergedConfig.RemoteEnv) == 0 {\n\t\treturn nil\n\t}\n\n\t// build remote env\n\tremoteEnvs := []string{}\n\tfor k, v := range mergedConfig.RemoteEnv {\n\t\tremoteEnvs = append(remoteEnvs, k+\"=\\\"\"+v+\"\\\"\")\n\t}\n\tsort.Strings(remoteEnvs)\n\n\t// check if we need to update env\n\texists, err := markerFileExists(\"patchEtcEnvironment\", strings.Join(remoteEnvs, \"\\n\"))\n\tif err != nil {\n\t\treturn err\n\t} else if exists {\n\t\treturn nil\n\t}\n\n\t// update env\n\tenvfile.MergeAndApply(mergedConfig.RemoteEnv, log)\n\treturn nil\n}\n\nfunc ChownAgentSock(setupInfo *config.Result) error {\n\tuser := config.GetRemoteUser(setupInfo)\n\tagentSockFile := os.Getenv(\"SSH_AUTH_SOCK\")\n\tif agentSockFile != \"\" {\n\t\terr := copy2.ChownR(filepath.Dir(agentSockFile), user)\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// SetupKubeConfig retrieves and stores a KubeConfig file in the default location `$HOME/.kube/config`.\n// It merges our KubeConfig with existing ones.\nfunc SetupKubeConfig(ctx context.Context, setupInfo *config.Result, tunnelClient tunnel.TunnelClient, log log.Logger) error {\n\texists, err := markerFileExists(\"setupKubeConfig\", \"\")\n\tif err != nil {\n\t\treturn err\n\t} else if exists || tunnelClient == nil {\n\t\treturn nil\n\t}\n\tlog.Info(\"Setup KubeConfig\")\n\n\t// get kubernetes config from setup server\n\tkubeConfigRes, err := tunnelClient.KubeConfig(ctx, &tunnel.Message{})\n\tif err != nil {\n\t\treturn err\n\t} else if kubeConfigRes.Message == \"\" {\n\t\treturn nil\n\t}\n\n\tuser := config.GetRemoteUser(setupInfo)\n\thomeDir, err := command.GetHome(user)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkubeDir := filepath.Join(homeDir, \".kube\")\n\terr = os.Mkdir(kubeDir, 0755)\n\tif err != nil && !errors.Is(err, os.ErrExist) {\n\t\treturn err\n\t}\n\n\tconfigPath := filepath.Join(kubeDir, \"config\")\n\texistingConfig, err := clientcmd.LoadFromFile(configPath)\n\tif err != nil && !errors.Is(err, os.ErrNotExist) {\n\t\treturn err\n\t}\n\tif existingConfig == nil {\n\t\texistingConfig = clientcmdapi.NewConfig()\n\t}\n\n\tkubeConfig, err := clientcmd.Load([]byte(kubeConfigRes.Message))\n\tif err != nil {\n\t\treturn err\n\t}\n\t// merge with existing kubeConfig\n\tfor name, cluster := range kubeConfig.Clusters {\n\t\texistingConfig.Clusters[name] = cluster\n\t}\n\tfor name, authInfo := range kubeConfig.AuthInfos {\n\t\texistingConfig.AuthInfos[name] = authInfo\n\t}\n\tfor name, context := range kubeConfig.Contexts {\n\t\texistingConfig.Contexts[name] = context\n\t}\n\n\t// Set the current context to the new one.\n\t// This might not always be the correct choice but given that someone\n\t// explicitly required this workspace to be in a virtual cluster/space\n\t// it's fair to assume they also want to point the current context to it\n\texistingConfig.CurrentContext = kubeConfig.CurrentContext\n\n\terr = clientcmd.WriteToFile(*existingConfig, configPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// ensure `remoteUser` owns kubeConfig\n\terr = copy2.ChownR(kubeDir, user)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc markerFileExists(markerName string, markerContent string) (bool, error) {\n\tmarkerName = filepath.Join(\"/var/devpod\", markerName+\".marker\")\n\tt, err := os.ReadFile(markerName)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn false, err\n\t} else if err == nil && (markerContent == \"\" || string(t) == markerContent) {\n\t\treturn true, nil\n\t}\n\n\t// write marker\n\t_ = os.MkdirAll(filepath.Dir(markerName), 0777)\n\terr = os.WriteFile(markerName, []byte(markerContent), 0644)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"write marker\")\n\t}\n\n\treturn false, nil\n}\n\nfunc setupPlatformGitCredentials(userName string, platformOptions *devpod.PlatformOptions, log log.Logger) error {\n\t// platform is not enabled, skip\n\tif !platformOptions.Enabled {\n\t\treturn nil\n\t}\n\n\t// setup platform git user\n\tif platformOptions.UserCredentials.GitUser != \"\" && platformOptions.UserCredentials.GitEmail != \"\" {\n\t\tgitUser, err := gitcredentials.GetUser(userName)\n\t\tif err == nil && gitUser.Name == \"\" && gitUser.Email == \"\" {\n\t\t\tlog.Info(\"Setup workspace git user and email\")\n\t\t\terr := gitcredentials.SetUser(userName, &gitcredentials.GitUser{\n\t\t\t\tName:  platformOptions.UserCredentials.GitUser,\n\t\t\t\tEmail: platformOptions.UserCredentials.GitEmail,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"set git user: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// setup platform git http credentials\n\terr := setupPlatformGitHTTPCredentials(userName, platformOptions, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Error setting up platform git http credentials: %v\", err)\n\t}\n\n\t// setup platform git ssh keys\n\terr = setupPlatformGitSSHKeys(userName, platformOptions, log)\n\tif err != nil {\n\t\tlog.Errorf(\"Error setting up platform git ssh keys: %v\", err)\n\t}\n\n\treturn nil\n}\nfunc setupPlatformGitHTTPCredentials(userName string, platformOptions *devpod.PlatformOptions, log log.Logger) error {\n\tif !platformOptions.Enabled || len(platformOptions.UserCredentials.GitHttp) == 0 {\n\t\treturn nil\n\t}\n\n\tlog.Info(\"Setup platform user git http credentials\")\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = gitcredentials.ConfigureHelper(binaryPath, userName, -1)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"configure git helper: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc setupPlatformGitSSHKeys(userName string, platformOptions *devpod.PlatformOptions, log log.Logger) error {\n\tif !platformOptions.Enabled || len(platformOptions.UserCredentials.GitSsh) == 0 {\n\t\treturn nil\n\t}\n\n\tlog.Info(\"Setup platform user git ssh keys\")\n\thomeFolder, err := command.GetHome(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write ssh keys to ~/.ssh/id_rsa\n\tsshFolder := filepath.Join(homeFolder, \".ssh\")\n\terr = os.MkdirAll(sshFolder, 0700)\n\tif err != nil && !errors.Is(err, os.ErrExist) {\n\t\treturn err\n\t}\n\t_ = copy2.Chown(sshFolder, userName)\n\n\t// delete previous keys\n\tfiles, err := os.ReadDir(sshFolder)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, file := range files {\n\t\tif !strings.HasPrefix(file.Name(), \"platform_git_ssh_\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tfileName := strings.TrimPrefix(file.Name(), \"platform_git_ssh_\")\n\t\tindex, err := strconv.Atoi(fileName)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif index >= len(platformOptions.UserCredentials.GitSsh) {\n\t\t\tcontinue\n\t\t}\n\n\t\terr = os.Remove(filepath.Join(sshFolder, file.Name()))\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error removing previous platform git ssh key: %v\", err)\n\t\t}\n\t}\n\n\t// write new keys\n\tfor i, key := range platformOptions.UserCredentials.GitSsh {\n\t\tfileName := filepath.Join(sshFolder, fmt.Sprintf(\"platform_git_ssh_%d\", i))\n\n\t\t// base64 decode before writing to file\n\t\tdecoded, err := base64.StdEncoding.DecodeString(key.Key)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error decoding platform git ssh key: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\terr = os.WriteFile(fileName, decoded, 0600)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error writing platform git ssh key: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\terr = copy2.Chown(fileName, userName)\n\t\t// do not exit on error, we can have non-fatal errors\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error chowning platform git ssh keys: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/devcontainer/setup.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/compress\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/crane\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc (r *runner) setupContainer(\n\tctx context.Context,\n\trawConfig *config.DevContainerConfig,\n\tcontainerDetails *config.ContainerDetails,\n\tmergedConfig *config.MergedDevContainerConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\ttimeout time.Duration,\n) (*config.Result, error) {\n\t// inject agent\n\terr := agent.InjectAgent(ctx, func(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\treturn r.Driver.CommandDevContainer(ctx, r.ID, \"root\", command, stdin, stdout, stderr)\n\t}, false, agent.ContainerDevPodHelperLocation, agent.DefaultAgentDownloadURL(), false, r.Log, timeout)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"inject agent\")\n\t}\n\tr.Log.Debugf(\"Injected into container\")\n\tdefer r.Log.Debugf(\"Done setting up container\")\n\n\t// compress info\n\tresult := &config.Result{\n\t\tDevContainerConfigWithPath: &config.DevContainerConfigWithPath{\n\t\t\tConfig: rawConfig,\n\t\t\tPath:   getRelativeDevContainerJson(rawConfig.Origin, r.LocalWorkspaceFolder),\n\t\t},\n\n\t\tMergedConfig:        mergedConfig,\n\t\tSubstitutionContext: substitutionContext,\n\t\tContainerDetails:    containerDetails,\n\t}\n\n\t// Ensure workspace mounts cannot escape their content folder for local agents in proxy mode.\n\t// There _might_ be a use-case that requires an allowlist for certain directories\n\t// when running as a standalone runner with docker-in-docker set up. Let's add it when/if the time comes.\n\tif r.WorkspaceConfig.Agent.Local == \"true\" && r.WorkspaceConfig.CLIOptions.Platform.Enabled {\n\t\tresult.MergedConfig.Mounts = filterWorkspaceMounts(result.MergedConfig.Mounts, r.WorkspaceConfig.ContentFolder, r.Log)\n\t}\n\n\tmarshalled, err := json.Marshal(result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcompressed, err := compress.Compress(string(marshalled))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceConfig := &provider2.ContainerWorkspaceInfo{\n\t\tIDE:              r.WorkspaceConfig.Workspace.IDE,\n\t\tCLIOptions:       r.WorkspaceConfig.CLIOptions,\n\t\tDockerless:       r.WorkspaceConfig.Agent.Dockerless,\n\t\tContainerTimeout: r.WorkspaceConfig.Agent.ContainerTimeout,\n\t\tSource:           r.WorkspaceConfig.Workspace.Source,\n\t\tAgent:            r.WorkspaceConfig.Agent,\n\t\tContentFolder:    r.WorkspaceConfig.ContentFolder,\n\t}\n\tif crane.ShouldUse(&r.WorkspaceConfig.CLIOptions) && r.WorkspaceConfig.Workspace.Source.GitRepository != \"\" {\n\t\tworkspaceConfig.PullFromInsideContainer = \"true\"\n\t}\n\t// compress container workspace info\n\tworkspaceConfigRaw, err := json.Marshal(workspaceConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tworkspaceConfigCompressed, err := compress.Compress(string(workspaceConfigRaw))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check if docker driver\n\t_, isDockerDriver := r.Driver.(driver.DockerDriver)\n\n\t// setup container\n\tr.Log.Infof(\"Setup container...\")\n\n\tsetupCommand := fmt.Sprintf(\n\t\t\"'%s' agent container setup --setup-info '%s' --container-workspace-info '%s'\",\n\t\tagent.ContainerDevPodHelperLocation,\n\t\tcompressed,\n\t\tworkspaceConfigCompressed,\n\t)\n\tif runtime.GOOS == \"linux\" || !isDockerDriver {\n\t\tsetupCommand += \" --chown-workspace\"\n\t}\n\tif !isDockerDriver {\n\t\tsetupCommand += \" --stream-mounts\"\n\t}\n\tif r.WorkspaceConfig.Agent.InjectGitCredentials != \"false\" {\n\t\tsetupCommand += \" --inject-git-credentials\"\n\t}\n\tif r.WorkspaceConfig.CLIOptions.Platform.AccessKey != \"\" &&\n\t\tr.WorkspaceConfig.CLIOptions.Platform.WorkspaceHost != \"\" &&\n\t\tr.WorkspaceConfig.CLIOptions.Platform.PlatformHost != \"\" {\n\t\tsetupCommand += fmt.Sprintf(\" --access-key '%s' --workspace-host '%s' --platform-host '%s'\", r.WorkspaceConfig.CLIOptions.Platform.AccessKey, r.WorkspaceConfig.CLIOptions.Platform.WorkspaceHost, r.WorkspaceConfig.CLIOptions.Platform.PlatformHost)\n\t}\n\tif r.Log.GetLevel() == logrus.DebugLevel {\n\t\tsetupCommand += \" --debug\"\n\t}\n\n\t// run setup server\n\trunSetupServer := func(ctx context.Context, stdin io.WriteCloser, stdout io.Reader) (*config.Result, error) {\n\t\treturn tunnelserver.RunSetupServer(\n\t\t\tctx,\n\t\t\tstdout,\n\t\t\tstdin,\n\t\t\tr.WorkspaceConfig.Agent.InjectGitCredentials != \"false\",\n\t\t\tr.WorkspaceConfig.Agent.InjectDockerCredentials != \"false\",\n\t\t\tconfig.GetMounts(result),\n\t\t\tr.Log,\n\t\t\ttunnelserver.WithPlatformOptions(&r.WorkspaceConfig.CLIOptions.Platform),\n\t\t)\n\t}\n\n\t// ssh tunnel\n\tsshTunnelCmd := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", agent.ContainerDevPodHelperLocation)\n\tif ide.ReusesAuthSock(r.WorkspaceConfig.Workspace.IDE.Name) {\n\t\tsshTunnelCmd += fmt.Sprintf(\" --reuse-ssh-auth-sock=%s\", r.WorkspaceConfig.CLIOptions.SSHAuthSockID)\n\t}\n\tif r.Log.GetLevel() == logrus.DebugLevel {\n\t\tsshTunnelCmd += \" --debug\"\n\t}\n\n\tagentInjectFunc := func(cancelCtx context.Context, sshCmd string, sshTunnelStdinReader, sshTunnelStdoutWriter *os.File, writer io.WriteCloser) error {\n\t\treturn r.Driver.CommandDevContainer(cancelCtx, r.ID, \"root\", sshCmd, sshTunnelStdinReader, sshTunnelStdoutWriter, writer)\n\t}\n\treturn sshtunnel.ExecuteCommand(\n\t\tctx,\n\t\tnil,\n\t\tfalse,\n\t\tagentInjectFunc,\n\t\tsshTunnelCmd,\n\t\tsetupCommand,\n\t\tr.Log,\n\t\trunSetupServer,\n\t)\n}\n\nfunc getRelativeDevContainerJson(origin, localWorkspaceFolder string) string {\n\trelativePath := strings.TrimPrefix(filepath.ToSlash(origin), filepath.ToSlash(localWorkspaceFolder))\n\treturn strings.TrimPrefix(relativePath, \"/\")\n}\n\nfunc filterWorkspaceMounts(mounts []*config.Mount, baseFolder string, log log.Logger) []*config.Mount {\n\tretMounts := []*config.Mount{}\n\tfor _, mount := range mounts {\n\t\trel, err := filepath.Rel(baseFolder, mount.Source)\n\t\tif err != nil || strings.Contains(rel, \"..\") {\n\t\t\tlog.Infof(\"Dropping workspace mount %s because it possibly accesses data outside of it's content directory\", mount.Source)\n\t\t\tcontinue\n\t\t}\n\n\t\tretMounts = append(retMounts, mount)\n\t}\n\n\treturn retMounts\n}\n"
  },
  {
    "path": "pkg/devcontainer/single.go",
    "content": "package devcontainer\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/daemon/agent\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/metadata\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n)\n\nvar dockerlessImage = \"ghcr.io/loft-sh/dockerless:0.2.0\"\n\nconst (\n\tDevPodExtraEnvVar           = \"DEVPOD\"\n\tRemoteContainersExtraEnvVar = \"REMOTE_CONTAINERS\"\n\tWorkspaceIDExtraEnvVar      = \"DEVPOD_WORKSPACE_ID\"\n\tWorkspaceUIDExtraEnvVar     = \"DEVPOD_WORKSPACE_UID\"\n\n\tDefaultEntrypoint = `\nwhile ! command -v /usr/local/bin/devpod >/dev/null 2>&1; do\n  echo \"Waiting for devpod tool...\"\n  sleep 1\ndone\nexec /usr/local/bin/devpod agent container daemon\n`\n)\n\nfunc (r *runner) runSingleContainer(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\toptions UpOptions,\n\ttimeout time.Duration,\n) (*config.Result, error) {\n\tr.Log.Debugf(\"Starting devcontainer in single container mode...\")\n\tcontainerDetails, err := r.Driver.FindDevContainer(ctx, r.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find dev container: %w\", err)\n\t}\n\n\t// does the container already exist?\n\tvar (\n\t\tmergedConfig *config.MergedDevContainerConfig\n\t)\n\n\t// if options.Recreate is true, and workspace is a running container, we should not rebuild\n\tif options.Recreate && parsedConfig.Config.ContainerID != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot recreate container not created by DevPod\")\n\t} else if !options.Recreate && containerDetails != nil {\n\t\t// start container if not running\n\t\tif strings.ToLower(containerDetails.State.Status) != \"running\" {\n\t\t\terr = r.Driver.StartDevContainer(ctx, r.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\t// if we are working with a non-managed container, and it has set workingDir, set it as the workspaceFolder\n\t\tif parsedConfig.Config.ContainerID != \"\" && containerDetails.Config.WorkingDir != \"\" {\n\t\t\tsubstitutionContext.ContainerWorkspaceFolder = containerDetails.Config.WorkingDir\n\t\t}\n\n\t\timageMetadataConfig, err := metadata.GetImageMetadataFromContainer(containerDetails, substitutionContext, r.Log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tmergedConfig, err = config.MergeConfiguration(parsedConfig.Config, imageMetadataConfig.Config)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"merge config\")\n\t\t}\n\n\t\t// If driver can reprovision, rerun the devcontainer and let the driver handle follow-up steps\n\t\tif d, ok := r.Driver.(driver.ReprovisioningDriver); ok && d.CanReprovision() {\n\t\t\terr = r.Driver.RunDevContainer(ctx, r.ID, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"start dev container\")\n\t\t\t}\n\n\t\t\t// get from build info\n\t\t\tcontainerDetails, err = r.Driver.FindDevContainer(ctx, r.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"find dev container: %w\", err)\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// we need to build the container\n\t\tbuildInfo, err := r.build(ctx, parsedConfig, substitutionContext, provider2.BuildOptions{\n\t\t\tCLIOptions: provider2.CLIOptions{\n\t\t\t\tPrebuildRepositories: options.PrebuildRepositories,\n\t\t\t\tForceDockerless:      options.ForceDockerless,\n\t\t\t\tPlatform:             options.CLIOptions.Platform,\n\t\t\t},\n\t\t\tNoBuild:       options.NoBuild,\n\t\t\tRegistryCache: options.RegistryCache,\n\t\t\tExportCache:   false,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"build image\")\n\t\t}\n\n\t\t// delete container on recreation\n\t\tif options.Recreate {\n\t\t\tif _, ok := r.Driver.(driver.DockerDriver); ok {\n\t\t\t\terr := r.Delete(ctx)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"delete devcontainer\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terr := r.Driver.StopDevContainer(ctx, r.ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"stop devcontainer\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// merge configuration\n\t\tmergedConfig, err = config.MergeConfiguration(parsedConfig.Config, buildInfo.ImageMetadata.Config)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"merge config\")\n\t\t}\n\n\t\t// Inject the daemon entrypoint if platform configuration is provided.\n\t\tif options.CLIOptions.Platform.AccessKey != \"\" {\n\t\t\tr.Log.Debugf(\"Platform config detected, injecting DevPod daemon entrypoint.\")\n\n\t\t\tdata, err := agent.GetEncodedWorkspaceDaemonConfig(options.Platform, r.WorkspaceConfig.Workspace, substitutionContext, mergedConfig)\n\t\t\tif err != nil {\n\t\t\t\tr.Log.Errorf(\"Failed to marshal daemon config: %v\", err)\n\t\t\t} else {\n\t\t\t\tmergedConfig.ContainerEnv[config.WorkspaceDaemonConfigExtraEnvVar] = data\n\t\t\t}\n\t\t}\n\n\t\t// run dev container\n\t\terr = r.runContainer(ctx, parsedConfig, substitutionContext, mergedConfig, buildInfo)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"start dev container\")\n\t\t}\n\n\t\t// TODO: wait here a bit for correct startup?\n\n\t\t// get from build info\n\t\tcontainerDetails, err = r.Driver.FindDevContainer(ctx, r.ID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"find dev container: %w\", err)\n\t\t}\n\t}\n\n\t// setup container\n\treturn r.setupContainer(ctx, parsedConfig.Raw, containerDetails, mergedConfig, substitutionContext, timeout)\n}\n\nfunc (r *runner) runContainer(\n\tctx context.Context,\n\tparsedConfig *config.SubstitutedConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tmergedConfig *config.MergedDevContainerConfig,\n\tbuildInfo *config.BuildInfo,\n) error {\n\tvar err error\n\n\t// build run options for dockerless mode\n\tvar runOptions *driver.RunOptions\n\tif buildInfo.Dockerless != nil {\n\t\trunOptions, err = r.getDockerlessRunOptions(mergedConfig, substitutionContext, buildInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"build dockerless run options: %w\", err)\n\t\t}\n\t} else {\n\t\t// build run options\n\t\trunOptions, err = r.getRunOptions(mergedConfig, substitutionContext, buildInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"build run options: %w\", err)\n\t\t}\n\t}\n\n\trunOptions.Env = r.addExtraEnvVars(runOptions.Env)\n\n\t// check if docker\n\tdockerDriver, ok := r.Driver.(driver.DockerDriver)\n\tif ok {\n\t\treturn dockerDriver.RunDockerDevContainer(\n\t\t\tctx,\n\t\t\tr.ID,\n\t\t\trunOptions,\n\t\t\tparsedConfig.Config,\n\t\t\tmergedConfig.Init,\n\t\t\tr.WorkspaceConfig.Workspace.IDE.Name,\n\t\t\tr.WorkspaceConfig.Workspace.IDE.Options,\n\t\t)\n\t}\n\n\t// build run options for regular driver\n\treturn r.Driver.RunDevContainer(ctx, r.ID, runOptions)\n}\n\nfunc (r *runner) getDockerlessRunOptions(\n\tmergedConfig *config.MergedDevContainerConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tbuildInfo *config.BuildInfo,\n) (*driver.RunOptions, error) {\n\t// parse workspace mount\n\tworkspaceMountParsed := config.ParseMount(substitutionContext.WorkspaceMount)\n\n\t// add metadata as label here\n\tmarshalled, err := json.Marshal(buildInfo.ImageMetadata.Raw)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"marshal config\")\n\t}\n\tenv := map[string]string{\n\t\t\"DOCKERLESS\":            \"true\",\n\t\t\"DOCKERLESS_CONTEXT\":    buildInfo.Dockerless.Context,\n\t\t\"DOCKERLESS_DOCKERFILE\": buildInfo.Dockerless.Dockerfile,\n\t\t\"GODEBUG\":               \"http2client=0\", // https://github.com/GoogleContainerTools/kaniko/issues/875\n\t}\n\tfor k, v := range mergedConfig.ContainerEnv {\n\t\tenv[k] = v\n\t}\n\tif buildInfo.Dockerless.Target != \"\" {\n\t\tenv[\"DOCKERLESS_TARGET\"] = buildInfo.Dockerless.Target\n\t}\n\tif len(buildInfo.Dockerless.BuildArgs) > 0 {\n\t\tout, err := json.Marshal(config.ObjectToList(buildInfo.Dockerless.BuildArgs))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"marshal build args: %w\", err)\n\t\t}\n\n\t\tenv[\"DOCKERLESS_BUILD_ARGS\"] = string(out)\n\t}\n\n\timage := dockerlessImage\n\tif r.WorkspaceConfig != nil && r.WorkspaceConfig.Agent.Dockerless.Image != \"\" {\n\t\timage = r.WorkspaceConfig.Agent.Dockerless.Image\n\t}\n\n\t// we need to add an extra mount here, because otherwise the build config might get lost\n\tmounts := mergedConfig.Mounts\n\tmounts = append(mounts, &config.Mount{\n\t\tType:   \"volume\",\n\t\tSource: \"dockerless-\" + r.ID,\n\t\tTarget: \"/workspaces/.dockerless\",\n\t})\n\n\tuid := \"\"\n\tif r.WorkspaceConfig != nil && r.WorkspaceConfig.Workspace != nil {\n\t\tuid = r.WorkspaceConfig.Workspace.UID\n\t}\n\n\t// build run options\n\treturn &driver.RunOptions{\n\t\tUID:        uid,\n\t\tImage:      image,\n\t\tUser:       \"root\",\n\t\tEntrypoint: \"/.dockerless/dockerless\",\n\t\tCmd: []string{\n\t\t\t\"start\",\n\t\t\t\"--wait\",\n\t\t\t\"--entrypoint\", \"/.dockerless/bin/sh\",\n\t\t\t\"--cmd\", \"-c\",\n\t\t\t\"--cmd\", GetStartScript(mergedConfig),\n\t\t\t\"--user\", buildInfo.Dockerless.User,\n\t\t},\n\t\tEnv:    env,\n\t\tCapAdd: mergedConfig.CapAdd,\n\t\tLabels: []string{\n\t\t\tmetadata.ImageMetadataLabel + \"=\" + string(marshalled),\n\t\t\tconfig.UserLabel + \"=\" + buildInfo.Dockerless.User,\n\t\t},\n\t\tPrivileged:     mergedConfig.Privileged,\n\t\tWorkspaceMount: &workspaceMountParsed,\n\t\tMounts:         mounts,\n\t}, nil\n}\n\nfunc (r *runner) getRunOptions(\n\tmergedConfig *config.MergedDevContainerConfig,\n\tsubstitutionContext *config.SubstitutionContext,\n\tbuildInfo *config.BuildInfo,\n) (*driver.RunOptions, error) {\n\t// parse workspace mount\n\tworkspaceMountParsed := config.ParseMount(substitutionContext.WorkspaceMount)\n\n\t// add metadata as label here\n\tmarshalled, err := json.Marshal(buildInfo.ImageMetadata.Raw)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"marshal config\")\n\t}\n\n\t// build labels & entrypoint\n\tentrypoint, cmd := GetContainerEntrypointAndArgs(mergedConfig, buildInfo.ImageDetails)\n\tlabels := []string{\n\t\tmetadata.ImageMetadataLabel + \"=\" + string(marshalled),\n\t\tconfig.UserLabel + \"=\" + buildInfo.ImageDetails.Config.User,\n\t}\n\n\tuser := buildInfo.ImageDetails.Config.User\n\tif mergedConfig.ContainerUser != \"\" {\n\t\tuser = mergedConfig.ContainerUser\n\t}\n\n\tuid := \"\"\n\tif r.WorkspaceConfig != nil && r.WorkspaceConfig.Workspace != nil {\n\t\tuid = r.WorkspaceConfig.Workspace.UID\n\t}\n\n\treturn &driver.RunOptions{\n\t\tUID:            uid,\n\t\tImage:          buildInfo.ImageName,\n\t\tUser:           user,\n\t\tEntrypoint:     entrypoint,\n\t\tCmd:            cmd,\n\t\tEnv:            mergedConfig.ContainerEnv,\n\t\tCapAdd:         mergedConfig.CapAdd,\n\t\tLabels:         labels,\n\t\tPrivileged:     mergedConfig.Privileged,\n\t\tWorkspaceMount: &workspaceMountParsed,\n\t\tSecurityOpt:    mergedConfig.SecurityOpt,\n\t\tMounts:         mergedConfig.Mounts,\n\t}, nil\n}\n\n// add environment variables that signals that we are in a remote container\n// (vscode compatibility) and specifically that we are using devpod.\nfunc (r *runner) addExtraEnvVars(env map[string]string) map[string]string {\n\tif env == nil {\n\t\tenv = make(map[string]string)\n\t}\n\n\tenv[DevPodExtraEnvVar] = \"true\"\n\tenv[RemoteContainersExtraEnvVar] = \"true\"\n\tif r.WorkspaceConfig != nil && r.WorkspaceConfig.Workspace != nil && r.WorkspaceConfig.Workspace.ID != \"\" {\n\t\tenv[WorkspaceIDExtraEnvVar] = r.WorkspaceConfig.Workspace.ID\n\t}\n\tif r.WorkspaceConfig != nil && r.WorkspaceConfig.Workspace != nil && r.WorkspaceConfig.Workspace.UID != \"\" {\n\t\tenv[WorkspaceUIDExtraEnvVar] = r.WorkspaceConfig.Workspace.UID\n\t}\n\n\treturn env\n}\n\nfunc GetStartScript(mergedConfig *config.MergedDevContainerConfig) string {\n\tcustomEntrypoints := mergedConfig.Entrypoints\n\treturn `echo Container started\ntrap \"exit 0\" 15\nexec \"$@\"\n` + strings.Join(customEntrypoints, \"\\n\") + DefaultEntrypoint\n}\n\nfunc GetContainerEntrypointAndArgs(mergedConfig *config.MergedDevContainerConfig, imageDetails *config.ImageDetails) (string, []string) {\n\tcmd := []string{\"-c\", GetStartScript(mergedConfig), \"-\"} // `wait $!` allows for the `trap` to run (synchronous `sleep` would not).\n\tif imageDetails != nil && mergedConfig.OverrideCommand != nil && !*mergedConfig.OverrideCommand {\n\t\tcmd = append(cmd, imageDetails.Config.Entrypoint...)\n\t\tcmd = append(cmd, imageDetails.Config.Cmd...)\n\t}\n\treturn \"/bin/sh\", cmd\n}\n"
  },
  {
    "path": "pkg/devcontainer/sshtunnel/sshtunnel.go",
    "content": "package sshtunnel\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log\"\n\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\tdevsshagent \"github.com/loft-sh/devpod/pkg/ssh/agent\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype AgentInjectFunc func(context.Context, string, *os.File, *os.File, io.WriteCloser) error\ntype TunnelServerFunc func(ctx context.Context, stdin io.WriteCloser, stdout io.Reader) (*config2.Result, error)\n\n// ExecuteCommand runs the command in an SSH Tunnel and returns the result.\nfunc ExecuteCommand(\n\tctx context.Context,\n\tclient client2.WorkspaceClient,\n\taddPrivateKeys bool,\n\tagentInject AgentInjectFunc,\n\tsshCommand,\n\tcommand string,\n\tlog log.Logger,\n\ttunnelServerFunc TunnelServerFunc,\n) (*config2.Result, error) {\n\t// create pipes\n\tsshTunnelStdoutReader, sshTunnelStdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsshTunnelStdinReader, sshTunnelStdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer sshTunnelStdoutWriter.Close()\n\tdefer sshTunnelStdinWriter.Close()\n\n\t// start machine on stdio\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\terrChan := make(chan error, 2)\n\tgo func() {\n\t\tdefer log.Debugf(\"Done executing ssh server helper command\")\n\t\tdefer cancel()\n\n\t\twriter := log.Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\n\t\tlog.Debugf(\"Inject and run command: %s\", sshCommand)\n\t\terr := agentInject(ctx, sshCommand, sshTunnelStdinReader, sshTunnelStdoutWriter, writer)\n\t\tif err != nil && !errors.Is(err, context.Canceled) && !strings.Contains(err.Error(), \"signal: \") {\n\t\t\terrChan <- fmt.Errorf(\"executing agent command: %w\", err)\n\t\t} else {\n\t\t\terrChan <- nil\n\t\t}\n\t}()\n\n\tif addPrivateKeys {\n\t\tlog.Debug(\"Adding ssh keys to agent, disable via 'devpod context set-options -o SSH_ADD_PRIVATE_KEYS=false'\")\n\t\terr := devssh.AddPrivateKeysToAgent(ctx, log)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error adding private keys to ssh-agent: %v\", err)\n\t\t}\n\t}\n\n\t// create pipes\n\tgRPCConnStdoutReader, gRPCConnStdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgRPCConnStdinReader, gRPCConnStdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer gRPCConnStdoutWriter.Close()\n\tdefer gRPCConnStdinWriter.Close()\n\n\t// connect to container\n\tgo func() {\n\t\tdefer cancel()\n\n\t\tlog.Debugf(\"Attempting to create SSH client\")\n\t\t// start ssh client as root / default user\n\t\tsshClient, err := devssh.StdioClient(sshTunnelStdoutReader, sshTunnelStdinWriter, false)\n\t\tif err != nil {\n\t\t\terrChan <- errors.Wrap(err, \"create ssh client\")\n\t\t\treturn\n\t\t}\n\t\tdefer log.Debugf(\"Connection to SSH Server closed\")\n\t\tdefer sshClient.Close()\n\n\t\tlog.Debugf(\"SSH client created\")\n\n\t\tsess, err := sshClient.NewSession()\n\t\tif err != nil {\n\t\t\terrChan <- errors.Wrap(err, \"create ssh session\")\n\t\t}\n\t\tdefer sess.Close()\n\n\t\tlog.Debugf(\"SSH session created\")\n\n\t\tidentityAgent := devsshagent.GetSSHAuthSocket()\n\t\tif identityAgent != \"\" {\n\t\t\tlog.Debugf(\"Forwarding ssh-agent using %s\", identityAgent)\n\t\t\terr = devsshagent.ForwardToRemote(sshClient, identityAgent)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- errors.Wrap(err, \"forward agent\")\n\t\t\t}\n\t\t\terr = devsshagent.RequestAgentForwarding(sess)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- errors.Wrap(err, \"request agent forwarding failed\")\n\t\t\t}\n\t\t}\n\n\t\twriter := log.Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\n\t\terr = devssh.Run(ctx, sshClient, command, gRPCConnStdinReader, gRPCConnStdoutWriter, writer, nil)\n\t\tif err != nil {\n\t\t\terrChan <- errors.Wrap(err, \"run agent command\")\n\t\t} else {\n\t\t\terrChan <- nil\n\t\t}\n\t}()\n\n\tresult, err := tunnelServerFunc(cancelCtx, gRPCConnStdinWriter, gRPCConnStdoutReader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start tunnel server: %w\", err)\n\t}\n\n\t// wait until command finished\n\tif err := <-errChan; err != nil {\n\t\treturn result, err\n\t}\n\n\treturn result, <-errChan\n}\n"
  },
  {
    "path": "pkg/docker/client.go",
    "content": "package docker\n\nimport (\n\t\"context\"\n\n\tdockerclient \"github.com/docker/docker/client\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\n// Client is a client for docker\ntype Client struct {\n\tdockerclient.CommonAPIClient\n}\n\n// NewClient creates a new docker client\nfunc NewClient(ctx context.Context, log log.Logger) (*Client, error) {\n\tcli, err := newDockerClientFromEnvironment()\n\tif err != nil {\n\t\tlog.Warnf(\"Error creating docker client from environment: %v\", err)\n\n\t\t// Last try to create it without the environment option\n\t\tcli, err = newDockerClient()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"Cannot create docker client: %v\", err)\n\t\t}\n\t}\n\n\tcli.NegotiateAPIVersion(ctx)\n\treturn cli, nil\n}\n\nfunc newDockerClient() (*Client, error) {\n\tcli, err := dockerclient.NewClientWithOpts()\n\tif err != nil {\n\t\treturn nil, errors.Errorf(\"Couldn't create docker client: %s\", err)\n\t}\n\n\treturn &Client{\n\t\tCommonAPIClient: cli,\n\t}, nil\n}\n\nfunc newDockerClientFromEnvironment() (*Client, error) {\n\tcli, err := dockerclient.NewClientWithOpts(dockerclient.FromEnv)\n\tif err != nil {\n\t\treturn nil, errors.Errorf(\"Couldn't create docker client: %s\", err)\n\t}\n\n\treturn &Client{\n\t\tCommonAPIClient: cli,\n\t}, nil\n}\n"
  },
  {
    "path": "pkg/docker/config.go",
    "content": "package docker\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/cli/cli/config\"\n\t\"github.com/docker/cli/cli/config/configfile\"\n\n\t\"github.com/docker/docker/pkg/homedir\"\n)\n\nconst dockerFileFolder = \".docker\"\n\nfunc LoadDockerConfig() (*configfile.ConfigFile, error) {\n\tconfigDir := os.Getenv(\"DOCKER_CONFIG\")\n\tif configDir == \"\" {\n\t\tconfigDir = filepath.Join(homedir.Get(), dockerFileFolder)\n\t}\n\n\treturn config.Load(configDir)\n}\n"
  },
  {
    "path": "pkg/docker/helper.go",
    "content": "package docker\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\tperrors \"github.com/pkg/errors\"\n)\n\n// DockerBuilder represents the Docker builder types.\ntype DockerBuilder int\n\n// Enum values for DockerBuilder.\nconst (\n\tDockerBuilderDefault DockerBuilder = iota\n\tDockerBuilderBuildX\n\tDockerBuilderBuildKit\n)\n\nfunc (db DockerBuilder) String() string {\n\treturn [...]string{\"\", \"buildx\", \"buildkit\"}[db]\n}\n\nfunc DockerBuilderFromString(s string) (DockerBuilder, error) {\n\tswitch s {\n\tcase \"\":\n\t\treturn DockerBuilderDefault, nil\n\tcase \"buildkit\":\n\t\treturn DockerBuilderBuildKit, nil\n\tcase \"buildx\":\n\t\treturn DockerBuilderBuildX, nil\n\tdefault:\n\t\treturn DockerBuilderDefault, errors.New(\"invalid docker builder\")\n\t}\n}\n\ntype DockerHelper struct {\n\tDockerCommand string\n\t// for a running container, we cannot pass down the container ID to the driver without introducing\n\t// changes in the driver interface (which we do not want to do). So, to get around this, we pass\n\t// it down to the driver during docker helper initialization.\n\tContainerID string\n\t// allow command to have a custom environment\n\tEnvironment []string\n\tBuilder     DockerBuilder\n\tLog         log.Logger\n}\n\nfunc (r *DockerHelper) GPUSupportEnabled() (bool, error) {\n\tout, err := r.buildCmd(context.TODO(), \"info\", \"-f\", \"{{.Runtimes.nvidia}}\").Output()\n\tif err != nil {\n\t\treturn false, command.WrapCommandError(out, err)\n\t}\n\n\treturn strings.Contains(string(out), \"nvidia-container-runtime\"), nil\n}\n\nfunc (r *DockerHelper) FindDevContainer(ctx context.Context, labels []string) (*config.ContainerDetails, error) {\n\tcontainers, err := r.FindContainer(ctx, labels)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"docker ps: %w\", err)\n\t} else if len(containers) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn r.FindContainerByID(ctx, containers)\n}\n\nfunc (r *DockerHelper) FindContainerByID(ctx context.Context, containerIds []string) (*config.ContainerDetails, error) {\n\tcontainerDetails, err := r.InspectContainers(ctx, containerIds)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// find matching container\n\tfor _, details := range containerDetails {\n\t\tif strings.ToLower(details.State.Status) != \"removing\" {\n\t\t\tdetails.State.Status = strings.ToLower(details.State.Status)\n\t\t\treturn &details, nil\n\t\t}\n\t}\n\n\treturn nil, nil\n}\n\nfunc (r *DockerHelper) DeleteVolume(ctx context.Context, volume string) error {\n\tif volume == \"\" {\n\t\treturn nil\n\t}\n\n\t// If volume does not exist, just exit\n\tout, err := r.buildCmd(ctx, \"volume\", \"list\", \"-q\", \"--filter\", \"name=\"+volume).CombinedOutput()\n\tif err != nil {\n\t\treturn nil\n\t}\n\tif len(out) == 0 {\n\t\treturn nil\n\t}\n\n\tout, err = r.buildCmd(ctx, \"volume\", \"rm\", volume).CombinedOutput()\n\tif err != nil {\n\t\treturn perrors.Wrapf(err, \"%s\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc (r *DockerHelper) Stop(ctx context.Context, id string) error {\n\tout, err := r.buildCmd(ctx, \"stop\", id).CombinedOutput()\n\tif err != nil {\n\t\treturn perrors.Wrapf(err, \"%s\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc (r *DockerHelper) Pull(ctx context.Context, image string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tcmd := r.buildCmd(ctx, \"pull\", image)\n\tcmd.Stdin = stdin\n\tcmd.Stdout = stdout\n\tcmd.Stderr = stderr\n\treturn cmd.Run()\n}\n\nfunc (r *DockerHelper) Remove(ctx context.Context, id string) error {\n\tout, err := r.buildCmd(ctx, \"rm\", id).CombinedOutput()\n\tif err != nil {\n\t\treturn perrors.Wrapf(err, \"%s\", string(out))\n\t}\n\n\treturn nil\n}\n\nfunc (r *DockerHelper) Run(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\treturn r.RunWithDir(ctx, \"\", args, stdin, stdout, stderr)\n}\n\nfunc (r *DockerHelper) RunWithDir(ctx context.Context, dir string, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tcmd := r.buildCmd(ctx, args...)\n\tcmd.Dir = dir\n\tcmd.Stdin = stdin\n\tcmd.Stdout = stdout\n\tcmd.Stderr = stderr\n\treturn cmd.Run()\n}\n\nfunc (r *DockerHelper) StartContainer(ctx context.Context, containerId string) error {\n\tout, err := r.buildCmd(ctx, \"start\", containerId).CombinedOutput()\n\tif err != nil {\n\t\treturn perrors.Wrapf(err, \"start command: %v\", string(out))\n\t}\n\n\tcontainer, err := r.FindContainerByID(ctx, []string{containerId})\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn fmt.Errorf(\"container not found\")\n\t}\n\n\treturn nil\n}\n\nfunc (r *DockerHelper) GetImageTag(ctx context.Context, imageID string) (string, error) {\n\targs := []string{\"inspect\", \"--type\", \"image\", \"--format\", \"{{if .RepoTags}}{{index .RepoTags 0}}{{end}}\"}\n\targs = append(args, imageID)\n\tout, err := r.buildCmd(ctx, args...).Output()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"inspect container: %w\", command.WrapCommandError(out, err))\n\t}\n\n\trepoTag := string(out)\n\ttagSplits := strings.Split(repoTag, \":\")\n\n\tif len(tagSplits) > 0 {\n\t\treturn strings.TrimSpace(tagSplits[1]), nil\n\t}\n\n\treturn \"\", nil\n}\n\nfunc (r *DockerHelper) InspectImage(ctx context.Context, imageName string, tryRemote bool) (*config.ImageDetails, error) {\n\timageDetails := []*config.ImageDetails{}\n\terr := r.Inspect(ctx, []string{imageName}, \"image\", &imageDetails)\n\tif err != nil {\n\t\t// try remote?\n\t\tif !tryRemote {\n\t\t\treturn nil, err\n\t\t}\n\n\t\timageConfig, _, err := image.GetImageConfig(ctx, imageName, r.Log)\n\t\tif err != nil {\n\t\t\treturn nil, perrors.Wrap(err, \"get image config remotely\")\n\t\t}\n\n\t\treturn &config.ImageDetails{\n\t\t\tID: imageName,\n\t\t\tConfig: config.ImageDetailsConfig{\n\t\t\t\tUser:       imageConfig.Config.User,\n\t\t\t\tEnv:        imageConfig.Config.Env,\n\t\t\t\tLabels:     imageConfig.Config.Labels,\n\t\t\t\tEntrypoint: imageConfig.Config.Entrypoint,\n\t\t\t\tCmd:        imageConfig.Config.Cmd,\n\t\t\t},\n\t\t}, nil\n\t} else if len(imageDetails) == 0 {\n\t\treturn nil, fmt.Errorf(\"cannot find image details for %s\", imageName)\n\t}\n\n\treturn imageDetails[0], nil\n}\n\nfunc (r *DockerHelper) InspectContainers(ctx context.Context, ids []string) ([]config.ContainerDetails, error) {\n\tdetails := []config.ContainerDetails{}\n\terr := r.Inspect(ctx, ids, \"container\", &details)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn details, nil\n}\n\nfunc (r *DockerHelper) IsPodman() bool {\n\targs := []string{\"--version\"}\n\n\tout, err := r.buildCmd(context.TODO(), args...).Output()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn strings.Contains(string(out), \"podman\")\n}\n\nfunc (r *DockerHelper) IsNerdctl() bool {\n\targs := []string{\"--version\"}\n\n\tout, err := r.buildCmd(context.TODO(), args...).Output()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn strings.Contains(string(out), \"nerdctl\")\n}\n\nfunc (r *DockerHelper) Inspect(ctx context.Context, ids []string, inspectType string, obj interface{}) error {\n\targs := []string{\"inspect\", \"--type\", inspectType}\n\targs = append(args, ids...)\n\tout, err := r.buildCmd(ctx, args...).Output()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"inspect container: %w\", command.WrapCommandError(out, err))\n\t}\n\n\terr = json.Unmarshal(out, obj)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"parse inspect output\")\n\t}\n\n\treturn nil\n}\n\n// FindContainer will try to find a container based on the input labels.\n// If no container is found, it will search for the labels manually inspecting\n// containers.\nfunc (r *DockerHelper) FindContainer(ctx context.Context, labels []string) ([]string, error) {\n\targs := []string{\"ps\", \"-q\", \"-a\"}\n\tfor _, label := range labels {\n\t\targs = append(args, \"--filter\", \"label=\"+label)\n\t}\n\n\tout, err := r.buildCmd(ctx, args...).Output()\n\tif err != nil {\n\t\t// fallback to manual search\n\t\treturn r.FindContainerJSON(ctx, labels)\n\t}\n\n\tarr := []string{}\n\tscan := scanner.NewScanner(bytes.NewReader(out))\n\tfor scan.Scan() {\n\t\tarr = append(arr, strings.TrimSpace(scan.Text()))\n\t}\n\n\treturn arr, nil\n}\n\n// FindContainerJSON will manually search for containers with matching labels.\n// This is useful in case the `--filter` doesn't work.\nfunc (r *DockerHelper) FindContainerJSON(ctx context.Context, labels []string) ([]string, error) {\n\targs := []string{\"ps\", \"-q\", \"-a\"}\n\tout, err := r.buildCmd(ctx, args...).Output()\n\tif err != nil {\n\t\treturn nil, command.WrapCommandError(out, err)\n\t}\n\n\tresult := []string{}\n\n\tids := strings.Split(strings.TrimSuffix(string(out), \"\\n\"), \"\\n\")\n\tfor _, id := range ids {\n\t\tid = strings.TrimSpace(id)\n\t\tfound := true\n\n\t\tcontainers, err := r.InspectContainers(ctx, []string{id})\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, label := range labels {\n\t\t\tkey := strings.Split(label, \"=\")[0]\n\t\t\tvalue := strings.Join(strings.Split(label, \"=\")[1:], \"=\")\n\n\t\t\tfound = containers[0].Config.Labels[key] == value\n\t\t}\n\n\t\tif found {\n\t\t\tresult = append(result, id)\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\nfunc (r *DockerHelper) GetContainerLogs(ctx context.Context, id string, stdout io.Writer, stderr io.Writer) error {\n\targs := []string{\"logs\", id}\n\tcmd := r.buildCmd(ctx, args...)\n\tcmd.Stdout = stdout\n\tcmd.Stderr = stderr\n\n\treturn cmd.Run()\n}\n\nfunc (r *DockerHelper) buildCmd(ctx context.Context, args ...string) *exec.Cmd {\n\tcmd := exec.CommandContext(ctx, r.DockerCommand, args...)\n\tif r.Environment != nil {\n\t\tcmd.Env = append(os.Environ(), r.Environment...)\n\t}\n\treturn cmd\n}\n"
  },
  {
    "path": "pkg/dockercredentials/dockercredentials.go",
    "content": "package dockercredentials\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/cli/cli/config\"\n\t\"github.com/docker/cli/cli/config/types\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/devpod/pkg/random\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\n\tdockerconfig \"github.com/containers/image/v5/pkg/docker/config\"\n)\n\ntype Request struct {\n\t// If ServerURL is empty its a list request\n\tServerURL string\n}\n\ntype ListResponse struct {\n\tRegistries map[string]string\n}\n\n// Credentials holds the information shared between docker and the credentials store.\ntype Credentials struct {\n\tServerURL string\n\tUsername  string\n\tSecret    string\n}\n\nfunc (c *Credentials) AuthToken() string {\n\tif c.Username != \"\" {\n\t\treturn c.Username + \":\" + c.Secret\n\t}\n\treturn c.Secret\n}\n\nfunc ConfigureCredentialsContainer(userName string, port int, log log.Logger) error {\n\tuserHome, err := command.GetHome(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfigDir := os.Getenv(\"DOCKER_CONFIG\")\n\tif configDir == \"\" {\n\t\tconfigDir = filepath.Join(userHome, \".docker\")\n\t}\n\n\treturn configureCredentials(userName, \"#!/bin/sh\", \"/usr/local/bin\", configDir, port, log)\n}\n\nconst AzureContainerRegistryUsername = \"00000000-0000-0000-0000-000000000000\"\n\nfunc configureCredentials(userName, shebang string, targetDir, configDir string, port int, log log.Logger) error {\n\tbinaryPath, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = file.MkdirAll(userName, configDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdockerConfig, err := config.Load(configDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write credentials helper\n\tcredentialHelperPath := filepath.Join(targetDir, \"docker-credential-devpod\")\n\tlog.Debugf(\"Wrote docker credentials helper to %s\", credentialHelperPath)\n\terr = os.WriteFile(credentialHelperPath, []byte(fmt.Sprintf(shebang+`\n'%s' agent docker-credentials --port '%d' \"$@\"`, binaryPath, port)), 0755)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"write credential helper\")\n\t}\n\n\tdockerConfig.CredentialsStore = \"devpod\"\n\terr = dockerConfig.Save()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = file.Chown(userName, dockerConfig.Filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc ConfigureCredentialsDockerless(targetFolder string, port int, log log.Logger) (string, error) {\n\tdockerConfigDir := filepath.Join(targetFolder, \".cache\", random.String(6))\n\terr := configureCredentials(\"\", \"#!/.dockerless/bin/sh\", dockerConfigDir, dockerConfigDir, port, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\terr = os.Setenv(\"DOCKER_CONFIG\", dockerConfigDir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\terr = os.Setenv(\"PATH\", os.Getenv(\"PATH\")+\":\"+dockerConfigDir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\treturn dockerConfigDir, nil\n}\n\nfunc ConfigureCredentialsMachine(targetFolder string, port int, log log.Logger) (string, error) {\n\tdockerConfigDir := filepath.Join(targetFolder, \".cache\", random.String(12))\n\terr := configureCredentials(\"\", \"#!/bin/sh\", dockerConfigDir, dockerConfigDir, port, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\terr = os.Setenv(\"DOCKER_CONFIG\", dockerConfigDir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\terr = os.Setenv(\"PATH\", os.Getenv(\"PATH\")+\":\"+dockerConfigDir)\n\tif err != nil {\n\t\t_ = os.RemoveAll(dockerConfigDir)\n\t\treturn \"\", err\n\t}\n\n\treturn dockerConfigDir, nil\n}\n\nfunc ListCredentials() (*ListResponse, error) {\n\tretList := &ListResponse{Registries: map[string]string{}}\n\t// Get all of the credentials from container tools\n\t// i.e. podman, skopeo or others\n\tallContainerCredentials, err := dockerconfig.GetAllCredentials(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor registryHostname, auth := range allContainerCredentials {\n\t\tretList.Registries[registryHostname] = auth.Username\n\t}\n\n\t// get docker credentials\n\t// if a registry exists twice we overwrite with the docker auth\n\t// to avoid breaking existing behaviour\n\tdockerConfig, err := docker.LoadDockerConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tallCredentials, err := dockerConfig.GetAllCredentials()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor registryHostname, auth := range allCredentials {\n\t\tretList.Registries[registryHostname] = auth.Username\n\t}\n\n\treturn retList, nil\n}\n\nfunc GetAuthConfig(host string) (*Credentials, error) {\n\tdockerConfig, err := docker.LoadDockerConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif host == \"registry-1.docker.io\" {\n\t\thost = \"https://index.docker.io/v1/\"\n\t}\n\tac, err := dockerConfig.GetAuthConfig(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// let's try to query the containers ecosystem\n\t// if the credentials the docker SDK returns are empty\n\t// Unfortunately docker swallows credentials.errCredentialsNotFound\n\t// so we only have the option to compare against an empty types.AuthConfig\n\tempty := types.AuthConfig{}\n\tif ac == empty {\n\t\tsanitizedHost := strings.TrimPrefix(strings.TrimPrefix(host, \"https://\"), \"http://\")\n\t\tdac, err := dockerconfig.GetCredentials(nil, sanitizedHost)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tac.Username = dac.Username\n\t\tac.Password = dac.Password\n\t\tac.IdentityToken = dac.IdentityToken\n\t\tac.ServerAddress = host // Best approximation we have to mimic the docker type.\n\t}\n\n\t// In case of Azure registry we need to set the azure username to a default, in case it's not set.\n\tif ac.Username == \"\" && strings.HasSuffix(ac.ServerAddress, \"azurecr.io\") {\n\t\tac.Username = AzureContainerRegistryUsername\n\t}\n\n\tif ac.IdentityToken != \"\" {\n\t\treturn &Credentials{\n\t\t\tServerURL: host,\n\t\t\tUsername:  ac.Username,\n\t\t\tSecret:    ac.IdentityToken,\n\t\t}, nil\n\t}\n\n\treturn &Credentials{\n\t\tServerURL: host,\n\t\tUsername:  ac.Username,\n\t\tSecret:    ac.Password,\n\t}, nil\n}\n"
  },
  {
    "path": "pkg/dockerfile/parse.go",
    "content": "package dockerfile\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/moby/buildkit/frontend/dockerfile/parser\"\n)\n\nvar argumentExpression = regexp.MustCompile(`(?m)\\$\\{?([a-zA-Z0-9_]+)(:(-|\\+)([^\\}]+))?\\}?`)\n\nvar dockerfileSyntax = regexp.MustCompile(`(?m)^[\\s\\t]*#[\\s\\t]*syntax=.*$`)\n\nfunc (d *Dockerfile) FindUserStatement(buildArgs map[string]string, baseImageEnv map[string]string, target string) string {\n\tstage, ok := d.StagesByTarget[target]\n\tif !ok {\n\t\tstage = d.Stages[len(d.Stages)-1]\n\t}\n\n\tseenStages := map[string]bool{}\n\tfor {\n\t\tif seenStages[stageID(&stage.BaseStage)] {\n\t\t\treturn \"\"\n\t\t}\n\t\tseenStages[stageID(&stage.BaseStage)] = true\n\n\t\tif len(stage.Users) > 0 {\n\t\t\tlastUser := stage.Users[len(stage.Users)-1]\n\t\t\treturn d.replaceVariables(lastUser.Key, buildArgs, baseImageEnv, &stage.BaseStage, lastUser.Line)\n\t\t}\n\n\t\t// is preamble?\n\t\tif stage.Image == \"\" {\n\t\t\treturn \"\"\n\t\t}\n\n\t\timage := d.replaceVariables(stage.Image, buildArgs, baseImageEnv, &d.Preamble.BaseStage, d.Stages[0].Instructions[0].StartLine)\n\t\tstage, ok = d.StagesByTarget[image]\n\t\tif !ok {\n\t\t\treturn \"\"\n\t\t}\n\t}\n}\n\nfunc stageID(stage *BaseStage) string {\n\treturn stage.Image + \"-\" + stage.Target\n}\n\nfunc (d *Dockerfile) FindBaseImage(buildArgs map[string]string, target string) string {\n\tstage, ok := d.StagesByTarget[target]\n\tif !ok {\n\t\tstage = d.Stages[len(d.Stages)-1]\n\t}\n\n\tvisited := map[*Stage]bool{}\n\tfor stage != nil {\n\t\tif visited[stage] {\n\t\t\treturn \"\"\n\t\t}\n\t\tvisited[stage] = true\n\n\t\tnextTarget := d.replaceVariables(stage.Image, buildArgs, nil, &d.Preamble.BaseStage, d.Stages[0].Instructions[0].StartLine)\n\t\tnextStage := d.StagesByTarget[nextTarget]\n\t\tif nextStage == nil {\n\t\t\treturn nextTarget\n\t\t}\n\n\t\tstage = nextStage\n\t}\n\n\treturn \"\"\n}\n\n// BuildContextFiles traverses a build stage and returns a list of any file path that would affect the build context\nfunc (d *Dockerfile) BuildContextFiles() (files []string) {\n\t// Iterate over all build stages\n\tfor _, stage := range d.Stages {\n\t\t// Add the values of any ADD or COPY instructions\n\t\tfor _, in := range stage.Instructions {\n\t\t\tif strings.HasPrefix(in.Value, \"ADD\") || strings.HasPrefix(in.Value, \"COPY\") {\n\t\t\t\t// Take all parts except the first (ADD/COPY) and the last (destination on remote), e.g. \"COPY src files /app\", we want src and files\n\t\t\t\tparts := strings.Split(in.Original, \" \")\n\t\t\t\tif len(parts) > 2 {\n\t\t\t\t\tfiles = append(files, parts[1:len(parts)-1]...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn files\n}\n\nfunc (d *Dockerfile) replaceVariables(val string, buildArgs map[string]string, baseImageEnv map[string]string, stage *BaseStage, untilLine int) string {\n\tnewVal := argumentExpression.ReplaceAllFunc([]byte(val), func(match []byte) []byte {\n\t\tsubMatches := argumentExpression.FindStringSubmatch(string(match))\n\t\tvariable := subMatches[1]\n\t\tvalue := d.findValue(buildArgs, baseImageEnv, variable, stage, untilLine)\n\n\t\t// is expression?\n\t\tif subMatches[2] != \"\" {\n\t\t\tvalue = getExpressionValue(subMatches[3], value != \"\", subMatches[4], value)\n\t\t}\n\n\t\treturn []byte(value)\n\t})\n\n\treturn string(newVal)\n}\n\nfunc getExpressionValue(option string, isSet bool, defaultValue string, value string) string {\n\toutput := \"\"\n\tif option == \"-\" {\n\t\tif isSet {\n\t\t\toutput = value\n\t\t} else {\n\t\t\toutput = defaultValue\n\t\t}\n\t} else if option == \"+\" {\n\t\tif isSet {\n\t\t\toutput = defaultValue\n\t\t} else {\n\t\t\toutput = value\n\t\t}\n\t}\n\n\treturn strings.Trim(output, \"\\\"'\")\n}\n\nfunc (d *Dockerfile) findValue(buildArgs map[string]string, baseImageEnv map[string]string, variable string, stage *BaseStage, untilLine int) string {\n\tconsiderArg := true\n\tif buildArgs == nil {\n\t\tbuildArgs = map[string]string{}\n\t}\n\n\tseenStages := map[string]bool{}\n\tfor {\n\t\tif seenStages[stageID(stage)] {\n\t\t\treturn \"\"\n\t\t}\n\t\tseenStages[stageID(stage)] = true\n\n\t\t// search args\n\t\tif considerArg {\n\t\t\tfor i := len(stage.Args) - 1; i >= 0; i-- {\n\t\t\t\tif stage.Args[i].Key != variable || stage.Args[i].Line >= untilLine {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif buildArgs[stage.Args[i].Key] != \"\" {\n\t\t\t\t\treturn strings.Trim(buildArgs[stage.Args[i].Key], \"\\\"'\")\n\t\t\t\t} else if stage.Args[i].Value != \"\" {\n\t\t\t\t\treturn strings.Trim(d.replaceVariables(stage.Args[i].Value, buildArgs, baseImageEnv, stage, stage.Args[i].Line), \"\\\"'\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// search env\n\t\tfor i := len(stage.Envs) - 1; i >= 0; i-- {\n\t\t\tif stage.Envs[i].Key != variable || stage.Envs[i].Line >= untilLine {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif stage.Envs[i].Value != \"\" {\n\t\t\t\treturn d.replaceVariables(stage.Envs[i].Value, buildArgs, baseImageEnv, stage, stage.Envs[i].Line)\n\t\t\t}\n\t\t}\n\n\t\t// is preamble?\n\t\tif stage == &d.Preamble.BaseStage {\n\t\t\tif baseImageEnv != nil && baseImageEnv[variable] != \"\" {\n\t\t\t\treturn baseImageEnv[variable]\n\t\t\t}\n\n\t\t\treturn \"\"\n\t\t}\n\n\t\t// search in preamble\n\t\timage := d.replaceVariables(stage.Image, buildArgs, baseImageEnv, &d.Preamble.BaseStage, d.Stages[0].Instructions[0].StartLine)\n\t\tfoundStage, ok := d.StagesByTarget[image]\n\t\tif !ok {\n\t\t\tstage = &d.Preamble.BaseStage\n\t\t\tuntilLine = d.Stages[0].Instructions[0].StartLine\n\t\t\tconsiderArg = true\n\t\t} else {\n\t\t\tstage = &foundStage.BaseStage\n\t\t\tuntilLine = stage.Instructions[len(stage.Instructions)-1].StartLine + 1\n\t\t\tconsiderArg = false\n\t\t}\n\t}\n}\n\nfunc RemoveSyntaxVersion(dockerfileContent string) string {\n\t// just add the syntax and we are done\n\treturn dockerfileSyntax.ReplaceAllString(dockerfileContent, \"\")\n}\n\nfunc EnsureDockerfileHasFinalStageName(dockerfileContent string, defaultLastStageName string) (string, string, error) {\n\tresult, err := parser.Parse(strings.NewReader(dockerfileContent))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\t// find last from statement\n\tvar lastChild *parser.Node\n\tfor _, child := range result.AST.Children {\n\t\tif strings.ToLower(child.Value) == \"from\" {\n\t\t\tlastChild = child\n\t\t}\n\t}\n\n\t// check if there is an AS statement\n\tif lastChild == nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"no FROM statement in dockerfile\")\n\t}\n\n\t// try to get the last stage\n\tif lastChild.Next == nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"cannot parse FROM statement in dockerfile\")\n\t}\n\n\t// check next FROM statement\n\tif lastChild.Next.Next != nil && lastChild.Next.Next.Next != nil && strings.ToLower(lastChild.Next.Next.Value) == \"as\" {\n\t\treturn lastChild.Next.Next.Next.Value, \"\", nil\n\t}\n\n\t// replace FROM statement\n\tlastChild.Next.Next = &parser.Node{\n\t\tValue: \"AS\",\n\t\tNext: &parser.Node{\n\t\t\tValue: defaultLastStageName,\n\t\t},\n\t}\n\treturn defaultLastStageName, ReplaceInDockerfile(dockerfileContent, lastChild), nil\n}\n\nfunc ReplaceInDockerfile(dockerfileContent string, node *parser.Node) string {\n\tscan := scanner.NewScanner(strings.NewReader(dockerfileContent))\n\n\tlines := []string{}\n\tlineNumber := 0\n\tfor scan.Scan() {\n\t\tlineNumber++\n\n\t\t// for now we can only replace\n\t\tif lineNumber >= node.StartLine && lineNumber <= node.EndLine {\n\t\t\tlines = append(lines, DumpNode(node))\n\t\t\tcontinue\n\t\t}\n\n\t\tlines = append(lines, scan.Text())\n\t}\n\n\treturn strings.Join(lines, \"\\n\")\n}\n\ntype Dockerfile struct {\n\tRaw string\n\n\tDirectives []*parser.Directive\n\tPreamble   *Preamble\n\tSyntax     string // https://docs.docker.com/build/concepts/dockerfile/#dockerfile-syntax\n\n\tStages         []*Stage\n\tStagesByTarget map[string]*Stage\n}\n\ntype Preamble struct {\n\tBaseStage\n}\n\ntype Stage struct {\n\tBaseStage\n\tUsers []KeyValue\n}\n\ntype BaseStage struct {\n\tImage  string\n\tTarget string\n\n\tEnvs         []KeyValue\n\tArgs         []KeyValue\n\tInstructions []*parser.Node\n}\n\ntype KeyValue struct {\n\tKey   string\n\tValue string\n\tLine  int\n}\n\nfunc (d *Dockerfile) Dump() string {\n\tstrs := []string{}\n\tif d.Preamble != nil {\n\t\tstrs = append(strs, DumpAll(d.Preamble.Instructions))\n\t}\n\tfor _, stage := range d.Stages {\n\t\tstrs = append(strs, DumpAll(stage.Instructions))\n\t}\n\n\t// filter empty strings\n\tnewStrs := []string{}\n\tfor _, str := range strs {\n\t\tif str == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tnewStrs = append(newStrs, str)\n\t}\n\n\treturn strings.Join(newStrs, \"\\n\")\n}\n\nfunc Parse(dockerfileContent string) (*Dockerfile, error) {\n\tresult, err := parser.Parse(strings.NewReader(dockerfileContent))\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(result.AST.Children) == 0 {\n\t\treturn nil, fmt.Errorf(\"received empty Dockerfile\")\n\t}\n\n\td := &Dockerfile{\n\t\tRaw:            dockerfileContent,\n\t\tPreamble:       &Preamble{},\n\t\tStages:         nil,\n\t\tStagesByTarget: map[string]*Stage{},\n\t}\n\tinstructions := result.AST.Children\n\n\t// parse directives\n\tdirectiveParser := parser.DirectiveParser{}\n\tdirectives, err := directiveParser.ParseAll([]byte(dockerfileContent))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\td.Directives = directives\n\n\t// parse build syntax\n\tfor _, directive := range directives {\n\t\tif directive.Name == \"syntax\" {\n\t\t\td.Syntax = directive.Value\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// parse instructions\n\tisPreamble := true\n\tfor _, instruction := range instructions {\n\t\tif isPreamble {\n\t\t\tif strings.ToLower(instruction.Value) == \"from\" {\n\t\t\t\tisPreamble = false\n\t\t\t\td.Stages = append(d.Stages, parseStage(instruction))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\td.Preamble.Instructions = append(d.Preamble.Instructions, instruction)\n\t\t\tif strings.ToLower(instruction.Value) == \"env\" {\n\t\t\t\td.Preamble.Envs = append(d.Preamble.Envs, parseEnv(instruction)...)\n\t\t\t} else if strings.ToLower(instruction.Value) == \"arg\" {\n\t\t\t\td.Preamble.Args = append(d.Preamble.Args, parseArg(instruction))\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\t// is new stage?\n\t\tif strings.ToLower(instruction.Value) == \"from\" {\n\t\t\td.Stages = append(d.Stages, parseStage(instruction))\n\t\t\tcontinue\n\t\t}\n\n\t\tlastStage := d.Stages[len(d.Stages)-1]\n\t\tlastStage.Instructions = append(lastStage.Instructions, instruction)\n\t\tif strings.ToLower(instruction.Value) == \"env\" {\n\t\t\tlastStage.Envs = append(lastStage.Envs, parseEnv(instruction)...)\n\t\t} else if strings.ToLower(instruction.Value) == \"arg\" {\n\t\t\tlastStage.Args = append(lastStage.Args, parseArg(instruction))\n\t\t} else if strings.ToLower(instruction.Value) == \"user\" {\n\t\t\tlastStage.Users = append(lastStage.Users, parseUser(instruction))\n\t\t}\n\t}\n\n\t// map stages\n\tfor _, stage := range d.Stages {\n\t\tif stage.Target == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\td.StagesByTarget[stage.Target] = stage\n\t}\n\n\treturn d, nil\n}\n\nfunc parseUser(instruction *parser.Node) KeyValue {\n\t// trim group if necessary\n\tline := instruction.StartLine\n\tinstruction = instruction.Next\n\tsplitted := strings.Split(instruction.Value, \":\")\n\treturn KeyValue{\n\t\tKey:  splitted[0],\n\t\tLine: line,\n\t}\n}\n\nfunc parseArg(instruction *parser.Node) KeyValue {\n\tline := instruction.StartLine\n\tinstruction = instruction.Next\n\tif instruction.Next != nil {\n\t\treturn KeyValue{\n\t\t\tKey:   instruction.Value,\n\t\t\tValue: instruction.Next.Value,\n\t\t\tLine:  line,\n\t\t}\n\t}\n\n\tif strings.Contains(instruction.Value, \"=\") {\n\t\tsplitted := strings.Split(instruction.Value, \"=\")\n\t\treturn KeyValue{\n\t\t\tKey:   splitted[0],\n\t\t\tValue: strings.Join(splitted[1:], \"=\"),\n\t\t\tLine:  line,\n\t\t}\n\t}\n\n\treturn KeyValue{\n\t\tKey:  instruction.Value,\n\t\tLine: line,\n\t}\n}\n\nfunc parseEnv(instruction *parser.Node) []KeyValue {\n\tenvs := []KeyValue{}\n\tline := instruction.StartLine\n\tnode := instruction.Next\n\tfor node != nil {\n\t\tif node.Next == nil {\n\t\t\treturn envs\n\t\t}\n\n\t\tenvs = append(envs, KeyValue{\n\t\t\tKey:   strings.TrimSpace(node.Value),\n\t\t\tValue: strings.Trim(strings.ReplaceAll(node.Next.Value, \"\\\\\", \"\"), \"\\\"'\"),\n\t\t\tLine:  line,\n\t\t})\n\t\tnode = node.Next.Next\n\t}\n\n\treturn envs\n}\n\nfunc parseStage(instruction *parser.Node) *Stage {\n\timage := \"\"\n\tif instruction.Next != nil {\n\t\timage = instruction.Next.Value\n\t}\n\ttarget := \"\"\n\tif instruction.Next != nil && instruction.Next.Next != nil && strings.ToLower(instruction.Next.Next.Value) == \"as\" && instruction.Next.Next.Next != nil && instruction.Next.Next.Next.Value != \"\" {\n\t\ttarget = instruction.Next.Next.Next.Value\n\t}\n\treturn &Stage{\n\t\tBaseStage: BaseStage{\n\t\t\tImage:        image,\n\t\t\tTarget:       target,\n\t\t\tInstructions: []*parser.Node{instruction},\n\t\t},\n\t}\n}\n\nfunc DumpAll(result []*parser.Node) string {\n\tif len(result) == 0 {\n\t\treturn \"\"\n\t}\n\n\tchildren := []string{}\n\tfor _, n := range result {\n\t\tchildren = append(children, DumpNode(n))\n\t}\n\n\treturn strings.Join(children, \"\\n\")\n}\n\nfunc DumpNode(node *parser.Node) string {\n\tout := \"\"\n\tif len(node.PrevComment) > 0 {\n\t\tout += \"# \" + strings.Join(node.PrevComment, \"\\n# \")\n\t}\n\n\tif node.Value != \"\" {\n\t\tif len(node.PrevComment) > 0 {\n\t\t\tout += \"\\n\"\n\t\t}\n\n\t\tout += node.Value\n\t}\n\tfor _, child := range node.Flags {\n\t\tout += \" \" + child\n\t}\n\tif node.Next != nil {\n\t\tout += \" \" + DumpNode(node.Next)\n\t}\n\n\treturn out\n}\n"
  },
  {
    "path": "pkg/dockerfile/parse_test.go",
    "content": "package dockerfile\n\nimport (\n\t_ \"embed\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n)\n\n//go:embed test_Dockerfile\nvar testDockerFileContents string\n\nfunc TestBuildContextFiles(t *testing.T) {\n\tdockerFile, err := Parse(testDockerFileContents)\n\tassert.NilError(t, err)\n\n\tfmt.Print(dockerFile.Stages)\n\n\tfiles := dockerFile.BuildContextFiles()\n\tassert.Equal(t, len(files), 2)\n\tassert.Equal(t, files[0], \"app\")\n\tassert.Equal(t, files[1], \"files\")\n}\n"
  },
  {
    "path": "pkg/dockerfile/test_Dockerfile",
    "content": "FROM mcr.microsoft.com/devcontainers/go:1.22-bullseye\n\nARG TARGETOS\nARG TARGETARCH\n\n# Install Node.js\nRUN \\\n    --mount=type=cache,target=/var/cache/apt \\\n    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\n    && apt-get update \\\n    && apt-get install -y --no-install-recommends nodejs \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set environment variables for Rust\nENV RUSTUP_HOME=/usr/local/rustup \\\n    CARGO_HOME=/usr/local/cargo \\\n    PATH=/usr/local/cargo/bin:$PATH \\\n    RUST_VERSION=1.69.0\n\n# Install Protobuf compiler\nRUN \\\n    --mount=type=cache,target=/var/cache/apt \\\n    apt-get update \\\n    && apt-get install -y --no-install-recommends protobuf-compiler \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nCOPY app /app\nCOPY files /files\n\nRUN echo hello"
  },
  {
    "path": "pkg/download/download.go",
    "content": "package download\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/gitcredentials\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc Head(rawURL string) (int, error) {\n\treq, err := http.NewRequest(\"HEAD\", rawURL, nil)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"download file\")\n\t}\n\n\treturn resp.StatusCode, nil\n}\n\nfunc File(rawURL string, log log.Logger) (io.ReadCloser, error) {\n\tparsed, err := url.Parse(rawURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := http.NewRequest(\"GET\", rawURL, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif parsed.Host == \"github.com\" {\n\t\t// check if we can access the url\n\t\tcode, err := Head(rawURL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t} else if code == 404 {\n\t\t\t// check if github release\n\t\t\tpath := parsed.Path\n\t\t\torg, repo, release, file := parseGithubURL(path)\n\t\t\tif org != \"\" {\n\t\t\t\t// try to download with credentials if its a release\n\t\t\t\tlog.Debugf(\"Try to find credentials for github\")\n\t\t\t\tcredentials, err := gitcredentials.GetCredentials(&gitcredentials.GitCredentials{\n\t\t\t\t\tProtocol: parsed.Scheme,\n\t\t\t\t\tHost:     parsed.Host,\n\t\t\t\t\tPath:     parsed.Path,\n\t\t\t\t})\n\t\t\t\tif err == nil && credentials != nil && credentials.Password != \"\" {\n\t\t\t\t\tlog.Debugf(\"Make request with credentials\")\n\t\t\t\t\treturn downloadGithubRelease(org, repo, release, file, credentials.Password)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"download file\")\n\t} else if resp.StatusCode >= 400 {\n\t\t_ = resp.Body.Close()\n\t\treturn nil, fmt.Errorf(\"received status code %d when trying to download %s\", resp.StatusCode, rawURL)\n\t}\n\n\treturn resp.Body, nil\n}\n\ntype GithubRelease struct {\n\tAssets []GithubReleaseAsset `json:\"assets,omitempty\"`\n}\n\ntype GithubReleaseAsset struct {\n\tID   int    `json:\"id,omitempty\"`\n\tName string `json:\"name,omitempty\"`\n}\n\nfunc downloadGithubRelease(org, repo, release, file, token string) (io.ReadCloser, error) {\n\treleaseURL := \"\"\n\tif release == \"\" {\n\t\treleaseURL = fmt.Sprintf(\"https://api.github.com/repos/%s/%s/releases/latest\", org, repo)\n\t} else {\n\t\treleaseURL = fmt.Sprintf(\"https://api.github.com/repos/%s/%s/releases/tags/%s\", org, repo, release)\n\t}\n\n\treq, err := http.NewRequest(\"GET\", releaseURL, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+token)\n\treq.Header.Set(\"Accept\", \"application/vnd.github+json\")\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if resp.StatusCode >= 400 {\n\t\t_ = resp.Body.Close()\n\t\treturn nil, fmt.Errorf(\"received status code %d when trying to reach %s\", resp.StatusCode, releaseURL)\n\t}\n\n\traw, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treleaseObj := &GithubRelease{}\n\terr = json.Unmarshal(raw, releaseObj)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar releaseAsset *GithubReleaseAsset\n\tfor _, asset := range releaseObj.Assets {\n\t\tasset := asset\n\t\tif asset.Name == file {\n\t\t\treleaseAsset = &asset\n\t\t\tbreak\n\t\t}\n\t}\n\tif releaseAsset == nil {\n\t\treturn nil, fmt.Errorf(\"couldn't find asset %s in github release (%s)\", file, releaseURL)\n\t}\n\n\treq, err = http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.github.com/repos/%s/%s/releases/assets/%d\", org, repo, releaseAsset.ID), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+token)\n\treq.Header.Set(\"Accept\", \"application/octet-stream\")\n\tdownloadResp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if downloadResp.StatusCode >= 400 {\n\t\t_ = downloadResp.Body.Close()\n\t\treturn nil, fmt.Errorf(\"received status code %d when trying to reach %s\", downloadResp.StatusCode, releaseURL)\n\t}\n\n\treturn downloadResp.Body, nil\n}\n\nfunc parseGithubURL(path string) (org, repo, release, file string) {\n\tsplitted := strings.Split(strings.TrimPrefix(path, \"/\"), \"/\")\n\tif len(splitted) != 6 {\n\t\treturn \"\", \"\", \"\", \"\"\n\t} else if splitted[2] != \"releases\" {\n\t\treturn \"\", \"\", \"\", \"\"\n\t} else if (splitted[3] != \"latest\" || splitted[4] != \"download\") && splitted[3] != \"download\" {\n\t\treturn \"\", \"\", \"\", \"\"\n\t}\n\n\tif splitted[3] == \"latest\" {\n\t\treturn splitted[0], splitted[1], \"\", splitted[5]\n\t}\n\n\treturn splitted[0], splitted[1], splitted[4], splitted[5]\n}\n"
  },
  {
    "path": "pkg/driver/custom/custom.go",
    "content": "package custom\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/binaries\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc NewCustomDriver(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) driver.Driver {\n\treturn &customDriver{\n\t\tlog:           log,\n\t\tworkspaceInfo: workspaceInfo,\n\t}\n}\n\nvar _ driver.Driver = (*customDriver)(nil)\n\ntype customDriver struct {\n\tlog log.Logger\n\n\tworkspaceInfo *provider2.AgentWorkspaceInfo\n}\n\n// FindDevContainer returns a running devcontainer details\nfunc (c *customDriver) FindDevContainer(ctx context.Context, workspaceId string) (*config.ContainerDetails, error) {\n\twriter := c.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// run command\n\tstdout := &bytes.Buffer{}\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"findDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.FindDevContainer,\n\t\tnil,\n\t\tstdout,\n\t\twriter,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error finding dev container: %s%w\", stdout.String(), err)\n\t} else if len(stdout.Bytes()) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// parse stdout\n\tcontainerDetails := &config.ContainerDetails{}\n\terr = json.Unmarshal([]byte(strings.TrimSpace(stdout.String())), containerDetails)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing container details %s: %w\", stdout.String(), err)\n\t}\n\n\treturn containerDetails, nil\n}\n\n// CommandDevContainer runs the given command inside the devcontainer\nfunc (c *customDriver) CommandDevContainer(ctx context.Context, workspaceId, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t// run command\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"commandDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.CommandDevContainer,\n\t\tstdin,\n\t\tstdout,\n\t\tstderr,\n\t\t[]string{\n\t\t\t\"DEVCONTAINER_USER=\" + user,\n\t\t\t\"DEVCONTAINER_COMMAND=\" + command,\n\t\t},\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// TargetArchitecture returns the architecture of the container runtime. e.g. amd64 or arm64\nfunc (c *customDriver) TargetArchitecture(ctx context.Context, workspaceId string) (string, error) {\n\twriter := c.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// run command\n\tstdout := &bytes.Buffer{}\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"getTargetArchitecture\",\n\t\tc.workspaceInfo.Agent.Custom.TargetArchitecture,\n\t\tnil,\n\t\tstdout,\n\t\twriter,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error getting target architecture: %s%w\", stdout.String(), err)\n\t}\n\n\t// parse stdout\n\ttargetArchitecture := strings.ToLower(strings.TrimSpace(stdout.String()))\n\tif targetArchitecture != \"amd64\" && targetArchitecture != \"arm64\" {\n\t\treturn \"\", fmt.Errorf(\"invalid target architecture %s, expected either arm64 or amd64\", targetArchitecture)\n\t}\n\n\treturn targetArchitecture, nil\n}\n\n// DeleteDevContainer deletes the devcontainer\nfunc (c *customDriver) DeleteDevContainer(ctx context.Context, workspaceId string) error {\n\twriter := c.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// run command\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"deleteDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.DeleteDevContainer,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error deleting devcontainer: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// StartDevContainer starts the devcontainer\nfunc (c *customDriver) StartDevContainer(ctx context.Context, workspaceId string) error {\n\twriter := c.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// run command\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"startDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.StartDevContainer,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error starting devcontainer: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// StopDevContainer stops the devcontainer\nfunc (c *customDriver) StopDevContainer(ctx context.Context, workspaceId string) error {\n\twriter := c.log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// run command\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"stopDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.StopDevContainer,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error stopping devcontainer: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// RunDevContainer runs a devcontainer\nfunc (c *customDriver) RunDevContainer(ctx context.Context, workspaceId string, options *driver.RunOptions) error {\n\tout, err := json.Marshal(options)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal run options: %w\", err)\n\t}\n\n\tdone := make(chan struct{})\n\treader, writer := io.Pipe()\n\tdefer writer.Close()\n\tgo func() {\n\t\tscan := scanner.NewScanner(reader)\n\t\tfor scan.Scan() {\n\t\t\tc.log.Info(scan.Text())\n\t\t}\n\t\tdone <- struct{}{}\n\t}()\n\n\t// run command\n\terr = c.runCommand(\n\t\tctx,\n\t\tworkspaceId,\n\t\t\"runDevContainer\",\n\t\tc.workspaceInfo.Agent.Custom.RunDevContainer,\n\t\tnil,\n\t\twriter,\n\t\twriter,\n\t\t[]string{\n\t\t\t\"DEVCONTAINER_RUN_OPTIONS=\" + string(out),\n\t\t},\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\t// close writer, wait for logging to flush and shut down\n\t\twriter.Close()\n\t\tselect {\n\t\tcase <-done:\n\t\t// forcibly shut down after 1 second\n\t\tcase <-time.After(1 * time.Second):\n\t\t}\n\t\treturn fmt.Errorf(\"error running devcontainer: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (c *customDriver) GetDevContainerLogs(ctx context.Context, workspaceID string, stdout io.Writer, stderr io.Writer) error {\n\t// run command\n\terr := c.runCommand(\n\t\tctx,\n\t\tworkspaceID,\n\t\t\"getDevContainerLogs\",\n\t\tc.workspaceInfo.Agent.Custom.GetDevContainerLogs,\n\t\tnil,\n\t\tstdout,\n\t\tstderr,\n\t\tnil,\n\t\tc.log,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting devcontainer logs: %w\", err)\n\t}\n\n\treturn nil\n}\n\nvar _ driver.ReprovisioningDriver = (*customDriver)(nil)\n\nfunc (c *customDriver) CanReprovision() bool {\n\treturn c.workspaceInfo.Agent.Custom.CanReprovision == \"true\"\n}\n\nfunc (c *customDriver) runCommand(\n\tctx context.Context,\n\tworkspaceId string,\n\tname string,\n\tcommand types.StrArray,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\tstderr io.Writer,\n\textraEnv []string,\n\tlog log.Logger,\n) error {\n\tif len(command) == 0 {\n\t\treturn nil\n\t}\n\n\t// log\n\tlog.Debugf(\"Run %s driver command: %s\", name, strings.Join(command, \" \"))\n\n\t// get environ\n\tenviron, err := ToEnvironWithBinaries(c.workspaceInfo, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\tenviron = append(environ, provider2.DEVCONTAINER_ID+\"=\"+workspaceId)\n\tenviron = append(environ, extraEnv...)\n\n\t// set debug level\n\tif log.GetLevel() == logrus.DebugLevel {\n\t\tenviron = append(environ, clientimplementation.DevPodDebug+\"=true\")\n\t}\n\n\t// run the command\n\treturn clientimplementation.RunCommand(ctx, command, environ, stdin, stdout, stderr)\n}\n\nfunc ToEnvironWithBinaries(workspace *provider2.AgentWorkspaceInfo, log log.Logger) ([]string, error) {\n\t// get binaries dir\n\tbinariesDir, err := agent.GetAgentBinariesDirFromWorkspaceDir(workspace.Origin)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting workspace %s binaries dir: %s %w\", workspace.Workspace.ID, workspace.Origin, err)\n\t}\n\n\t// download binaries\n\tagentBinaries, err := binaries.DownloadBinaries(workspace.Agent.Binaries, binariesDir, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error downloading workspace %s binaries: %w\", workspace.Workspace.ID, err)\n\t}\n\n\t// get environ\n\tenviron := provider2.ToEnvironment(workspace.Workspace, workspace.Machine, workspace.Options, nil)\n\tfor k, v := range agentBinaries {\n\t\tenviron = append(environ, k+\"=\"+v)\n\t}\n\n\treturn environ, nil\n}\n"
  },
  {
    "path": "pkg/driver/docker/build.go",
    "content": "package docker\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/build\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/buildkit\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc (d *dockerDriver) BuildDevContainer(\n\tctx context.Context,\n\tprebuildHash string,\n\tparsedConfig *config.SubstitutedConfig,\n\textendedBuildInfo *feature.ExtendedBuildInfo,\n\tdockerfilePath,\n\tdockerfileContent string,\n\tlocalWorkspaceFolder string,\n\toptions provider.BuildOptions,\n) (*config.BuildInfo, error) {\n\t// check if image build is necessary\n\timageName := build.GetImageName(localWorkspaceFolder, prebuildHash)\n\tif options.Repository == \"\" && !options.ForceBuild {\n\t\timageDetails, err := d.Docker.InspectImage(ctx, imageName, false)\n\t\tif err == nil && imageDetails != nil {\n\t\t\t// local image found\n\t\t\td.Log.Infof(\"Found existing local image %s\", imageName)\n\t\t\treturn &config.BuildInfo{\n\t\t\t\tImageDetails:  imageDetails,\n\t\t\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\t\t\tImageName:     imageName,\n\t\t\t\tPrebuildHash:  prebuildHash,\n\t\t\t\tRegistryCache: options.RegistryCache,\n\t\t\t\tTags:          options.Tag,\n\t\t\t}, nil\n\t\t} else if err != nil {\n\t\t\td.Log.Debugf(\"Error trying to find local image %s: %v\", imageName, err)\n\t\t}\n\t}\n\n\t// check if we shouldn't build\n\tif options.NoBuild {\n\t\treturn nil, fmt.Errorf(\"you cannot build in this mode. Please run 'devpod up' to rebuild the container\")\n\t}\n\n\t// get build options\n\tbuildOptions, err := build.NewOptions(dockerfilePath, dockerfileContent, parsedConfig, extendedBuildInfo, imageName, options, prebuildHash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\td.Log.Debug(\"Using registry cache\", options.RegistryCache)\n\n\t// build image\n\twriter := d.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// check if docker buildx exists\n\tif options.Platform != \"\" {\n\t\td.Log.Infof(\"Build for platform '%s'...\", options.Platform)\n\t}\n\n\tbuilder := d.Docker.Builder\n\tif (builder == docker.DockerBuilderDefault || builder == docker.\n\t\tDockerBuilderBuildX) && d.buildxExists(ctx) && !options.ForceInternalBuildKit {\n\t\tbuilder = docker.DockerBuilderBuildX\n\t} else {\n\t\tbuilder = docker.DockerBuilderBuildKit\n\t}\n\n\tswitch builder {\n\tcase docker.DockerBuilderBuildX:\n\t\tif d.buildxExists(ctx) {\n\t\t\td.Log.Info(\"Build with docker buildx...\")\n\t\t\terr := d.buildxBuild(ctx, writer, options.Platform, buildOptions)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"buildx build\")\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"buildx is not available on your host. Use buildkit builder\")\n\t\t}\n\tcase docker.DockerBuilderBuildKit:\n\t\td.Log.Info(\"Build with internal buildkit...\")\n\t\terr := d.internalBuild(ctx, writer, options.Platform, buildOptions)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"internal build\")\n\t\t}\n\tcase docker.DockerBuilderDefault:\n\t\treturn nil, fmt.Errorf(\"invalid docker builder: %s\", builder)\n\t}\n\n\t// inspect image\n\timageDetails, err := d.Docker.InspectImage(ctx, imageName, false)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get image details\")\n\t}\n\n\treturn &config.BuildInfo{\n\t\tImageDetails:  imageDetails,\n\t\tImageMetadata: extendedBuildInfo.MetadataConfig,\n\t\tImageName:     imageName,\n\t\tPrebuildHash:  prebuildHash,\n\t\tRegistryCache: options.RegistryCache,\n\t\tTags:          options.Tag,\n\t}, nil\n}\n\nfunc (d *dockerDriver) buildxExists(ctx context.Context) bool {\n\tbuf := &bytes.Buffer{}\n\terr := d.Docker.Run(ctx, []string{\"buildx\", \"version\"}, nil, buf, buf)\n\n\treturn (err == nil) || d.Docker.IsPodman()\n}\n\nfunc (d *dockerDriver) internalBuild(ctx context.Context, writer io.Writer, platform string, options *build.BuildOptions) error {\n\tdockerClient, err := docker.NewClient(ctx, d.Log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create docker client\")\n\t}\n\tdefer dockerClient.Close()\n\n\tbuildKitClient, err := buildkit.NewDockerClient(ctx, dockerClient)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create buildkit client\")\n\t}\n\tdefer buildKitClient.Close()\n\n\terr = buildkit.Build(ctx, buildKitClient, writer, platform, options, d.Log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"build\")\n\t}\n\n\treturn nil\n}\n\nfunc (d *dockerDriver) buildxBuild(ctx context.Context, writer io.Writer, platform string, options *build.BuildOptions) error {\n\t// build args\n\targs := []string{\n\t\t\"buildx\",\n\t\t\"build\",\n\t\t\"-f\", options.Dockerfile,\n\t}\n\n\t// add load\n\tif options.Load {\n\t\targs = append(args, \"--load\")\n\t}\n\n\t// docker images\n\tfor _, image := range options.Images {\n\t\targs = append(args, \"-t\", image)\n\t}\n\n\t// build args\n\tfor k, v := range options.BuildArgs {\n\t\targs = append(args, \"--build-arg\", k+\"=\"+v)\n\t}\n\n\t// build contexts\n\tfor k, v := range options.Contexts {\n\t\targs = append(args, \"--build-context\", k+\"=\"+v)\n\t}\n\n\t// target stage\n\tif options.Target != \"\" {\n\t\targs = append(args, \"--target\", options.Target)\n\t}\n\n\t// platform\n\tif platform != \"\" {\n\t\targs = append(args, \"--platform\", platform)\n\t}\n\n\t// cache\n\tfor _, cacheFrom := range options.CacheFrom {\n\t\targs = append(args, \"--cache-from\", cacheFrom)\n\t}\n\tfor _, cacheTo := range options.CacheTo {\n\t\targs = append(args, \"--cache-to\", cacheTo)\n\t}\n\n\t// add additional build cli options\n\targs = append(args, options.CliOpts...)\n\n\t// context\n\targs = append(args, options.Context)\n\n\t// run command\n\td.Log.Debugf(\"Running docker %s: docker %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\terr := d.Docker.Run(ctx, args, nil, writer, writer)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"build image\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/docker/docker.go",
    "content": "package docker\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/user\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jetbrains\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc makeEnvironment(env map[string]string, log log.Logger) []string {\n\tif env == nil {\n\t\treturn nil\n\t}\n\n\tret := config.ObjectToList(env)\n\tif len(env) > 0 {\n\t\tlog.Debugf(\"Use docker environment variables: %v\", ret)\n\t}\n\n\treturn ret\n}\n\nfunc NewDockerDriver(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (driver.DockerDriver, error) {\n\tdockerCommand := \"docker\"\n\tif workspaceInfo.Agent.Docker.Path != \"\" {\n\t\tdockerCommand = workspaceInfo.Agent.Docker.Path\n\t}\n\n\tvar builder docker.DockerBuilder\n\tvar err error\n\tbuilder, err = docker.DockerBuilderFromString(workspaceInfo.Agent.Docker.Builder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Debugf(\"Using docker command '%s'\", dockerCommand)\n\treturn &dockerDriver{\n\t\tDocker: &docker.DockerHelper{\n\t\t\tDockerCommand: dockerCommand,\n\t\t\tEnvironment:   makeEnvironment(workspaceInfo.Agent.Docker.Env, log),\n\t\t\tContainerID:   workspaceInfo.Workspace.Source.Container,\n\t\t\tBuilder:       builder,\n\t\t\tLog:           log,\n\t\t},\n\t\tLog: log,\n\t}, nil\n}\n\ntype dockerDriver struct {\n\tDocker  *docker.DockerHelper\n\tCompose *compose.ComposeHelper\n\n\tLog log.Logger\n}\n\nfunc (d *dockerDriver) TargetArchitecture(ctx context.Context, workspaceId string) (string, error) {\n\treturn runtime.GOARCH, nil\n}\n\nfunc (d *dockerDriver) CommandDevContainer(ctx context.Context, workspaceId, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn fmt.Errorf(\"container not found\")\n\t}\n\n\targs := []string{\"exec\"}\n\tif stdin != nil {\n\t\targs = append(args, \"-i\")\n\t}\n\targs = append(args, \"-u\", user, container.ID, \"sh\", \"-c\", command)\n\treturn d.Docker.Run(ctx, args, stdin, stdout, stderr)\n}\n\nfunc (d *dockerDriver) PushDevContainer(ctx context.Context, image string) error {\n\t// push image\n\twriter := d.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// build args\n\targs := []string{\n\t\t\"push\",\n\t\timage,\n\t}\n\n\t// run command\n\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\terr := d.Docker.Run(ctx, args, nil, writer, writer)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"push image\")\n\t}\n\n\treturn nil\n}\n\nfunc (d *dockerDriver) TagDevContainer(ctx context.Context, image, tag string) error {\n\t// Tag image\n\twriter := d.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\t// build args\n\targs := []string{\n\t\t\"tag\",\n\t\timage,\n\t\ttag,\n\t}\n\n\t// run command\n\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\terr := d.Docker.Run(ctx, args, nil, writer, writer)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"tag image\")\n\t}\n\n\treturn nil\n}\n\nfunc (d *dockerDriver) DeleteDevContainer(ctx context.Context, workspaceId string) error {\n\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn nil\n\t}\n\n\terr = d.Docker.Remove(ctx, container.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (d *dockerDriver) StartDevContainer(ctx context.Context, workspaceId string) error {\n\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn fmt.Errorf(\"container not found\")\n\t}\n\n\treturn d.Docker.StartContainer(ctx, container.ID)\n}\n\nfunc (d *dockerDriver) StopDevContainer(ctx context.Context, workspaceId string) error {\n\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn fmt.Errorf(\"container not found\")\n\t}\n\n\treturn d.Docker.Stop(ctx, container.ID)\n}\n\nfunc (d *dockerDriver) InspectImage(ctx context.Context, imageName string) (*config.ImageDetails, error) {\n\treturn d.Docker.InspectImage(ctx, imageName, true)\n}\n\nfunc (d *dockerDriver) GetImageTag(ctx context.Context, imageID string) (string, error) {\n\treturn d.Docker.GetImageTag(ctx, imageID)\n}\n\nfunc (d *dockerDriver) ComposeHelper() (*compose.ComposeHelper, error) {\n\tif d.Compose != nil {\n\t\treturn d.Compose, nil\n\t}\n\n\tvar err error\n\td.Compose, err = compose.NewComposeHelper(compose.DockerComposeCommand, d.Docker)\n\treturn d.Compose, err\n}\n\nfunc (d *dockerDriver) DockerHelper() (*docker.DockerHelper, error) {\n\tif d.Docker == nil {\n\t\treturn nil, fmt.Errorf(\"no docker helper available\")\n\t}\n\n\treturn d.Docker, nil\n}\n\nfunc (d *dockerDriver) FindDevContainer(ctx context.Context, workspaceId string) (*config.ContainerDetails, error) {\n\tvar containerDetails *config.ContainerDetails\n\tvar err error\n\tif d.Docker.ContainerID != \"\" {\n\t\tcontainerDetails, err = d.Docker.FindContainerByID(ctx, []string{d.Docker.ContainerID})\n\t} else {\n\t\tcontainerDetails, err = d.Docker.FindDevContainer(ctx, []string{config.DockerIDLabel + \"=\" + workspaceId})\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t} else if containerDetails == nil {\n\t\treturn nil, nil\n\t}\n\n\tif containerDetails.Config.LegacyUser != \"\" {\n\t\tif containerDetails.Config.Labels == nil {\n\t\t\tcontainerDetails.Config.Labels = map[string]string{}\n\t\t}\n\t\tif containerDetails.Config.Labels[config.UserLabel] == \"\" {\n\t\t\tcontainerDetails.Config.Labels[config.UserLabel] = containerDetails.Config.LegacyUser\n\t\t}\n\t}\n\n\treturn containerDetails, nil\n}\n\nfunc (d *dockerDriver) RunDevContainer(\n\tctx context.Context,\n\tworkspaceId string,\n\toptions *driver.RunOptions,\n) error {\n\treturn fmt.Errorf(\"unsupported\")\n}\n\nfunc (d *dockerDriver) RunDockerDevContainer(\n\tctx context.Context,\n\tworkspaceId string,\n\toptions *driver.RunOptions,\n\tparsedConfig *config.DevContainerConfig,\n\tinit *bool,\n\tide string,\n\tideOptions map[string]config2.OptionValue,\n) error {\n\terr := d.EnsureImage(ctx, options)\n\tif err != nil {\n\t\treturn err\n\t}\n\thelper, err := d.DockerHelper()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\targs := []string{\"run\"}\n\tif !helper.IsNerdctl() {\n\t\targs = append(args, \"--sig-proxy=false\")\n\t}\n\n\t// add ports\n\tfor _, appPort := range parsedConfig.AppPort {\n\t\tintPort, err := strconv.Atoi(appPort)\n\t\tif err != nil {\n\t\t\targs = append(args, \"-p\", appPort)\n\t\t} else {\n\t\t\targs = append(args, \"-p\", fmt.Sprintf(\"127.0.0.1:%d:%d\", intPort, intPort))\n\t\t}\n\t}\n\n\t// workspace mount\n\tif options.WorkspaceMount != nil {\n\t\tworkspacePath := d.EnsurePath(options.WorkspaceMount)\n\t\tmountPath := workspacePath.String()\n\t\tif helper.IsNerdctl() && strings.Contains(mountPath, \",consistency='consistent'\") {\n\t\t\tmountPath = strings.Replace(mountPath, \",consistency='consistent'\", \"\", 1)\n\t\t}\n\n\t\targs = append(args, \"--mount\", mountPath)\n\t}\n\n\t// override container user\n\tif options.User != \"\" {\n\t\targs = append(args, \"-u\", options.User)\n\t}\n\n\t// container env\n\tfor k, v := range options.Env {\n\t\targs = append(args, \"-e\", k+\"=\"+v)\n\t}\n\n\tif options.Privileged != nil && *options.Privileged {\n\t\targs = append(args, \"--privileged\")\n\t}\n\n\t// In case we're using podman, let's use userns to keep\n\t// the ID of the user (vscode) inside the container as\n\t// the same of the external user.\n\t// This will avoid problems of mismatching chowns on the\n\t// project files.\n\tif d.Docker.IsPodman() && os.Getuid() != 0 {\n\t\targs = append(args, \"--userns\", \"keep-id\")\n\t}\n\n\tfor _, capAdd := range options.CapAdd {\n\t\targs = append(args, \"--cap-add\", capAdd)\n\t}\n\tfor _, securityOpt := range options.SecurityOpt {\n\t\targs = append(args, \"--security-opt\", securityOpt)\n\t}\n\n\t// mounts\n\tfor _, mount := range options.Mounts {\n\t\targs = append(args, \"--mount\", mount.String())\n\t}\n\n\t// add ide mounts\n\tswitch ide {\n\tcase string(config2.IDEGoland):\n\t\targs = append(args, \"--mount\", jetbrains.NewGolandServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDERustRover):\n\t\targs = append(args, \"--mount\", jetbrains.NewRustRoverServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDEPyCharm):\n\t\targs = append(args, \"--mount\", jetbrains.NewPyCharmServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDEPhpStorm):\n\t\targs = append(args, \"--mount\", jetbrains.NewPhpStorm(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDEIntellij):\n\t\targs = append(args, \"--mount\", jetbrains.NewIntellij(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDECLion):\n\t\targs = append(args, \"--mount\", jetbrains.NewCLionServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDERider):\n\t\targs = append(args, \"--mount\", jetbrains.NewRiderServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDERubyMine):\n\t\targs = append(args, \"--mount\", jetbrains.NewRubyMineServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDEWebStorm):\n\t\targs = append(args, \"--mount\", jetbrains.NewWebStormServer(\"\", ideOptions, d.Log).GetVolume())\n\tcase string(config2.IDEDataSpell):\n\t\targs = append(args, \"--mount\", jetbrains.NewDataSpellServer(\"\", ideOptions, d.Log).GetVolume())\n\t}\n\n\t// labels\n\tlabels := append(config.GetDockerLabelForID(workspaceId), options.Labels...)\n\tfor _, label := range labels {\n\t\targs = append(args, \"-l\", label)\n\t}\n\n\t// check GPU\n\tif parsedConfig.HostRequirements != nil && parsedConfig.HostRequirements.GPU == \"true\" {\n\t\tenabled, _ := d.Docker.GPUSupportEnabled()\n\t\tif enabled {\n\t\t\targs = append(args, \"--gpus\", \"all\")\n\t\t}\n\t}\n\n\t// runArgs\n\t// check if we need to add --gpus=all to the run args based on the dev container's host requirments\n\tif parsedConfig.HostRequirements != nil {\n\t\tusesGpu, err := parsedConfig.HostRequirements.GPU.Bool()\n\t\tif err != nil && usesGpu {\n\t\t\t// check if the user manually add --gpus=all, if not then add it\n\t\t\tif !slices.Contains(parsedConfig.RunArgs, \"--gpus=all\") {\n\t\t\t\targs = append(args, \"--gpus=all\")\n\t\t\t}\n\t\t}\n\t}\n\n\targs = append(args, parsedConfig.RunArgs...)\n\n\t// run detached\n\targs = append(args, \"-d\")\n\n\t// add entrypoint\n\tif options.Entrypoint != \"\" {\n\t\targs = append(args, \"--entrypoint\", options.Entrypoint)\n\t}\n\n\t// image name\n\targs = append(args, options.Image)\n\n\t// entrypoint\n\targs = append(args, options.Cmd...)\n\n\t// run the command\n\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\twriter := d.Log.Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif runtime.GOOS == \"linux\" && ((parsedConfig.ContainerUser != \"\" || parsedConfig.RemoteUser != \"\") &&\n\t\t(parsedConfig.UpdateRemoteUserUID == nil || *parsedConfig.UpdateRemoteUserUID)) {\n\t\t// Retrieve local user UID and GID\n\t\tlocalUser, err := user.Current()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlocalUid := localUser.Uid\n\t\tlocalGid := localUser.Gid\n\n\t\t// Retrieve user to update\n\t\tcontainerUser := parsedConfig.RemoteUser\n\t\tif containerUser == \"\" {\n\t\t\tcontainerUser = parsedConfig.ContainerUser\n\t\t}\n\t\tif containerUser == \"\" {\n\t\t\treturn nil\n\t\t}\n\t\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if container == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Create temporary files to store /etc/passwd and /etc/group\n\t\tcontainerPasswdFileIn, err := os.CreateTemp(\"\", \"devpod_container_passwd_in\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.Remove(containerPasswdFileIn.Name())\n\n\t\tcontainerGroupFileIn, err := os.CreateTemp(\"\", \"devpod_container_group_in\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.Remove(containerGroupFileIn.Name())\n\n\t\tcontainerPasswdFileOut, err := os.CreateTemp(\"\", \"devpod_container_passwd_out\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.Remove(containerPasswdFileOut.Name())\n\n\t\tcontainerGroupFileOut, err := os.CreateTemp(\"\", \"devpod_container_group_out\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.Remove(containerGroupFileOut.Name())\n\n\t\t// Copy /etc/passwd and /etc/group from the container to the temporary files\n\t\targs = []string{\"cp\", fmt.Sprintf(\"%s:/etc/passwd\", container.ID), containerPasswdFileIn.Name()}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\targs = []string{\"cp\", fmt.Sprintf(\"%s:/etc/group\", container.ID), containerGroupFileIn.Name()}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcontainerPasswdFileIn, err = os.Open(containerPasswdFileIn.Name())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer containerPasswdFileIn.Close()\n\t\t// Update /etc/passwd and /etc/group with the new user UID and GID\n\t\tscanner := bufio.NewScanner(containerPasswdFileIn)\n\t\tcontainerUid := \"\"\n\t\tcontainerGid := \"\"\n\t\tcontainerHome := \"\"\n\n\t\tre := regexp.MustCompile(fmt.Sprintf(`^%s:(?P<password>x?):(?P<uid>.*):(?P<gid>.*):(?P<gcos>.*):(?P<home>.*):(?P<shell>.*)$`, containerUser))\n\t\tfor scanner.Scan() {\n\t\t\tmatch := re.FindStringSubmatch(scanner.Text())\n\t\t\tif match == nil {\n\t\t\t\t_, err := containerPasswdFileOut.WriteString(fmt.Sprintf(\"%s\\n\", scanner.Text()))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult := make(map[string]string)\n\t\t\tfor i, name := range re.SubexpNames() {\n\t\t\t\tif i != 0 && name != \"\" {\n\t\t\t\t\tresult[name] = match[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontainerUid = result[\"uid\"]\n\t\t\tcontainerGid = result[\"gid\"]\n\t\t\tcontainerHome = result[\"home\"]\n\n\t\t\t_, err := containerPasswdFileOut.WriteString(fmt.Sprintf(\"%s:%s:%s:%s:%s:%s:%s\\n\", containerUser, result[\"password\"], localUid, localGid, result[\"gcos\"], result[\"home\"], result[\"shell\"]))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := scanner.Err(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif localUid == \"0\" || containerUid == \"0\" || (localUid == containerUid && localGid == containerGid) {\n\t\t\treturn nil\n\t\t}\n\n\t\tcontainerGroupFileIn, err = os.Open(containerGroupFileIn.Name())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer containerGroupFileIn.Close()\n\n\t\tscanner = bufio.NewScanner(containerGroupFileIn)\n\n\t\tre = regexp.MustCompile(fmt.Sprintf(`^(?P<group>.*):(?P<password>x?):%s:(?P<group_list>.*)$`, containerGid))\n\t\tfor scanner.Scan() {\n\t\t\tmatch := re.FindStringSubmatch(scanner.Text())\n\t\t\tif match == nil {\n\t\t\t\t_, err := containerGroupFileOut.WriteString(fmt.Sprintf(\"%s\\n\", scanner.Text()))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult := make(map[string]string)\n\t\t\tfor i, name := range re.SubexpNames() {\n\t\t\t\tif i != 0 && name != \"\" {\n\t\t\t\t\tresult[name] = match[i]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_, err := containerGroupFileOut.WriteString(fmt.Sprintf(\"%s:%s:%s:%s\\n\", result[\"group\"], result[\"password\"], localGid, result[\"group_list\"]))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := scanner.Err(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\td.Log.Debugf(\"Updating container user uid\")\n\n\t\t// Copy /etc/passwd and /etc/group back to the container\n\t\targs = []string{\"cp\", containerPasswdFileOut.Name(), fmt.Sprintf(\"%s:/etc/passwd\", container.ID)}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\targs = []string{\"cp\", containerGroupFileOut.Name(), fmt.Sprintf(\"%s:/etc/group\", container.ID)}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\targs = []string{\"exec\", \"-u\", \"root\", container.ID, \"chmod\", \"644\", \"/etc/passwd\", \"/etc/group\"}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\targs = []string{\"exec\", \"-u\", \"root\", container.ID, \"chown\", \"-R\", fmt.Sprintf(\"%s:%s\", localUid, localGid), containerHome}\n\t\td.Log.Debugf(\"Running docker command: %s %s\", d.Docker.DockerCommand, strings.Join(args, \" \"))\n\t\terr = d.Docker.Run(ctx, args, nil, writer, writer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (d *dockerDriver) EnsureImage(\n\tctx context.Context,\n\toptions *driver.RunOptions,\n) error {\n\td.Log.Infof(\"Inspecting image %s\", options.Image)\n\t_, err := d.Docker.InspectImage(ctx, options.Image, false)\n\tif err != nil {\n\t\td.Log.Infof(\"Image %s not found\", options.Image)\n\t\td.Log.Infof(\"Pulling image %s\", options.Image)\n\t\twriter := d.Log.Writer(logrus.DebugLevel, false)\n\t\tdefer writer.Close()\n\n\t\treturn d.Docker.Pull(ctx, options.Image, nil, writer, writer)\n\t}\n\treturn nil\n}\n\nfunc (d *dockerDriver) EnsurePath(path *config.Mount) *config.Mount {\n\t// in case of local windows and remote linux tcp, we need to manually do the path conversion\n\tif runtime.GOOS == \"windows\" {\n\t\tfor _, v := range d.Docker.Environment {\n\t\t\t// we do this only is DOCKER_HOST is not docker-desktop engine, but\n\t\t\t// a direct TCP connection to a docker daemon running in WSL\n\t\t\tif strings.Contains(v, \"DOCKER_HOST=tcp://\") {\n\t\t\t\tunixPath := path.Source\n\t\t\t\tunixPath = strings.Replace(unixPath, \"C:\", \"c\", 1)\n\t\t\t\tunixPath = strings.ReplaceAll(unixPath, \"\\\\\", \"/\")\n\t\t\t\tunixPath = \"/mnt/\" + unixPath\n\n\t\t\t\tpath.Source = unixPath\n\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t}\n\treturn path\n}\n\nfunc (d *dockerDriver) GetDevContainerLogs(ctx context.Context, workspaceId string, stdout io.Writer, stderr io.Writer) error {\n\tcontainer, err := d.FindDevContainer(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if container == nil {\n\t\treturn fmt.Errorf(\"container not found\")\n\t}\n\n\treturn d.Docker.GetContainerLogs(ctx, container.ID, stdout, stderr)\n}\n"
  },
  {
    "path": "pkg/driver/docker.go",
    "content": "package driver\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/pkg/compose\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/feature\"\n\t\"github.com/loft-sh/devpod/pkg/docker\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n)\n\ntype DockerDriver interface {\n\tDriver\n\n\t// InspectImage inspects the given image name\n\tInspectImage(ctx context.Context, imageName string) (*config.ImageDetails, error)\n\n\t// GetImageTag returns latest tag for input image id\n\tGetImageTag(ctx context.Context, imageName string) (string, error)\n\n\t// RunDockerDevContainer runs a docker devcontainer\n\tRunDockerDevContainer(\n\t\tctx context.Context,\n\t\tworkspaceId string,\n\t\toptions *RunOptions,\n\t\tparsedConfig *config.DevContainerConfig,\n\t\tinit *bool,\n\t\tide string,\n\t\tideOptions map[string]config2.OptionValue,\n\t) error\n\n\t// BuildDevContainer builds a devcontainer\n\tBuildDevContainer(\n\t\tctx context.Context,\n\t\tprebuildHash string,\n\t\tparsedConfig *config.SubstitutedConfig,\n\t\textendedBuildInfo *feature.ExtendedBuildInfo,\n\t\tdockerfilePath,\n\t\tdockerfileContent string,\n\t\tlocalWorkspaceFolder string,\n\t\toptions provider.BuildOptions,\n\t) (*config.BuildInfo, error)\n\n\t// PushDevContainer pushes the given image to a registry\n\tPushDevContainer(ctx context.Context, image string) error\n\n\tTagDevContainer(ctx context.Context, image, tag string) error\n\n\t// ComposeHelper returns the compose helper\n\tComposeHelper() (*compose.ComposeHelper, error)\n\n\t// DockerHellper returns the docker helper\n\tDockerHelper() (*docker.DockerHelper, error)\n}\n"
  },
  {
    "path": "pkg/driver/drivercreate/create.go",
    "content": "package drivercreate\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/loft-sh/devpod/pkg/driver/custom\"\n\t\"github.com/loft-sh/devpod/pkg/driver/docker\"\n\t\"github.com/loft-sh/devpod/pkg/driver/kubernetes\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc NewDriver(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (driver.Driver, error) {\n\tdriver := workspaceInfo.Agent.Driver\n\tif driver == \"\" || driver == provider2.DockerDriver {\n\t\treturn docker.NewDockerDriver(workspaceInfo, log)\n\t} else if driver == provider2.CustomDriver {\n\t\treturn custom.NewCustomDriver(workspaceInfo, log), nil\n\t} else if driver == provider2.KubernetesDriver {\n\t\treturn kubernetes.NewKubernetesDriver(workspaceInfo, log)\n\t}\n\n\treturn nil, fmt.Errorf(\"unrecognized driver '%s', possible values are %s, %s or %s\",\n\t\tdriver, provider2.DockerDriver, provider2.CustomDriver, provider2.KubernetesDriver)\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/client.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\tcorev1 \"k8s.io/api/core/v1\"\n\t\"k8s.io/client-go/kubernetes\"\n\t\"k8s.io/client-go/kubernetes/scheme\"\n\t\"k8s.io/client-go/rest\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n\t\"k8s.io/client-go/tools/remotecommand\"\n)\n\ntype Client struct {\n\tclient *kubernetes.Clientset\n\n\tconfig *rest.Config\n}\n\n// NewClient constructs a struct wrapping the kubernetes client that is used by the kubernetes driver\nfunc NewClient(kubeConfig, kubeContext string) (*Client, string, error) {\n\tif kubeConfig == \"\" {\n\t\tkubeConfig = os.Getenv(\"KUBECONFIG\")\n\t}\n\n\t// create client config loading rules\n\tvar clientConfigLoadingRules *clientcmd.ClientConfigLoadingRules\n\tif kubeConfig != \"\" {\n\t\tclientConfigLoadingRules = &clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfig}\n\t} else {\n\t\tclientConfigLoadingRules = clientcmd.NewDefaultClientConfigLoadingRules()\n\t}\n\n\t// load kubernetes config\n\tconfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(\n\t\tclientConfigLoadingRules,\n\t\t&clientcmd.ConfigOverrides{CurrentContext: kubeContext},\n\t)\n\n\tclientConfig, err := config.ClientConfig()\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"failed to load kubernetes config: %w\", err)\n\t}\n\n\tnamespace, _, err := config.Namespace()\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"failed to load kubernetes namespace from config: %w\", err)\n\t}\n\n\tkubeClient, err := kubernetes.NewForConfig(clientConfig)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\treturn &Client{\n\t\tclient: kubeClient,\n\t\tconfig: clientConfig,\n\t}, namespace, nil\n}\n\nfunc (c *Client) Client() *kubernetes.Clientset {\n\treturn c.client\n}\n\nfunc (c *Client) Config() *rest.Config {\n\treturn c.config\n}\n\nfunc (c *Client) FullLogs(ctx context.Context, namespace, pod, container string) ([]byte, error) {\n\tlogs, err := c.Logs(ctx, namespace, pod, container, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn io.ReadAll(logs)\n}\n\nfunc (c *Client) Logs(ctx context.Context, namespace, pod, container string, follow bool) (io.ReadCloser, error) {\n\treturn c.client.CoreV1().Pods(namespace).GetLogs(pod, &corev1.PodLogOptions{\n\t\tContainer: container,\n\t\tFollow:    follow,\n\t}).Stream(ctx)\n}\n\ntype ExecStreamOptions struct {\n\tStdin     io.Reader\n\tStdout    io.Writer\n\tStderr    io.Writer\n\tPod       string\n\tNamespace string\n\tContainer string\n\tCommand   []string\n}\n\n// Exec executes a kubectl exec with given transport round tripper and upgrader\nfunc (c *Client) Exec(ctx context.Context, options *ExecStreamOptions) error {\n\tclient, err := kubernetes.NewForConfig(c.config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\texecRequest := client.CoreV1().RESTClient().Post().\n\t\tResource(\"pods\").\n\t\tName(options.Pod).\n\t\tNamespace(options.Namespace).\n\t\tSubResource(string(\"exec\")).\n\t\tVersionedParams(&corev1.PodExecOptions{\n\t\t\tContainer: options.Container,\n\t\t\tCommand:   options.Command,\n\t\t\tStdin:     options.Stdin != nil,\n\t\t\tStdout:    options.Stdout != nil,\n\t\t\tStderr:    options.Stderr != nil,\n\t\t}, scheme.ParameterCodec)\n\n\texec, err := remotecommand.NewSPDYExecutor(c.config, \"POST\", execRequest.URL())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\terrChan <- exec.StreamWithContext(ctx, remotecommand.StreamOptions{\n\t\t\tStdin:  options.Stdin,\n\t\t\tStdout: options.Stdout,\n\t\t\tStderr: options.Stderr,\n\t\t})\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\t<-errChan\n\t\treturn nil\n\tcase err = <-errChan:\n\t\treturn err\n\t}\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/container_status.go",
    "content": "package kubernetes\n\nimport corev1 \"k8s.io/api/core/v1\"\n\nfunc IsReady(status *corev1.ContainerStatus) bool {\n\treturn status.Ready\n}\n\nfunc IsWaiting(status *corev1.ContainerStatus) bool {\n\treturn status.State.Waiting != nil\n}\n\nfunc IsTerminated(status *corev1.ContainerStatus) bool {\n\treturn status.State.Terminated != nil\n}\n\nfunc IsStarted(status *corev1.ContainerStatus) bool {\n\treturn status.Started != nil && *status.Started\n}\n\nfunc IsRunning(status *corev1.ContainerStatus) bool {\n\treturn status.State.Running != nil\n}\n\nfunc Succeeded(status *corev1.ContainerStatus) bool {\n\treturn status.State.Terminated != nil && status.State.Terminated.ExitCode == 0\n}\n\nfunc IsCritical(status *corev1.ContainerStatus) bool {\n\treturn criticalStatus[status.State.Waiting.Reason]\n}\n\nvar criticalStatus = map[string]bool{\n\t\"Error\":                      true,\n\t\"Unknown\":                    true,\n\t\"ImagePullBackOff\":           true,\n\t\"CrashLoopBackOff\":           true,\n\t\"RunContainerError\":          true,\n\t\"ErrImagePull\":               true,\n\t\"CreateContainerConfigError\": true,\n\t\"InvalidImageName\":           true,\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/daemonsecret.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tk8sv1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nconst DaemonConfigKey = \"daemon_config\"\n\nfunc (k *KubernetesDriver) EnsureDaemonConfigSecret(\n\tctx context.Context,\n\tsecretName string,\n\tdata string,\n) error {\n\tk.Log.Debugf(\"Ensure daemon config secret\")\n\n\tif k.secretExists(ctx, secretName) {\n\t\tif !k.shouldRecreateDaemonConfigSecret(ctx, data, secretName) {\n\t\t\tk.Log.Debugf(\"Daemon config secret '%s' already exists and is up to date\", secretName)\n\t\t\treturn nil\n\t\t}\n\n\t\tk.Log.Debugf(\"Daemon config secret '%s' already exists, but is outdated. Recreating...\", secretName)\n\t\terr := k.DeleteSecret(ctx, secretName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t_, err := k.client.Client().CoreV1().Secrets(k.namespace).Create(ctx, &k8sv1.Secret{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: secretName,\n\t\t},\n\t\tType: k8sv1.SecretTypeOpaque,\n\t\tData: map[string][]byte{DaemonConfigKey: []byte(data)},\n\t}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create daemon config secret: %w\", err)\n\t}\n\n\tk.Log.Infof(\"Daemon config secret '%s' created\", secretName)\n\treturn nil\n}\nfunc (k *KubernetesDriver) shouldRecreateDaemonConfigSecret(ctx context.Context, newData string, secretName string) bool {\n\tsecret, err := k.client.Client().CoreV1().Secrets(k.namespace).Get(ctx, secretName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn true\n\t}\n\n\tdaemonConfigBytes, ok := secret.Data[DaemonConfigKey]\n\tif !ok {\n\t\treturn true\n\t}\n\n\treturn string(daemonConfigBytes) != newData\n}\n\nfunc (k *KubernetesDriver) DeleteDaemonConfigSecret(\n\tctx context.Context,\n\tsecretName string) error {\n\tif !k.secretExists(ctx, secretName) {\n\t\treturn nil\n\t}\n\n\terr := k.client.Client().CoreV1().Secrets(k.namespace).Delete(ctx, secretName, metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn fmt.Errorf(\"delete daemon config secret: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/dockersecrets.go",
    "content": "package kubernetes\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tperrors \"github.com/pkg/errors\"\n\tk8sv1 \"k8s.io/api/core/v1\"\n)\n\n// DockerConfigJSON represents a local docker auth config file\n// for pulling images.\ntype DockerConfigJSON struct {\n\tAuths DockerConfig `json:\"auths\"`\n}\n\n// DockerConfig represents the config file used by the docker CLI.\n// This config that represents the credentials that should be used\n// when pulling images from specific image repositories.\ntype DockerConfig map[string]DockerConfigEntry\n\n// DockerConfigEntry holds the user information that grant the access to docker registry\ntype DockerConfigEntry struct {\n\tAuth  string `json:\"auth\"`\n\tEmail string `json:\"email\"`\n}\n\nfunc PreparePullSecretData(registryURL, authToken, email string) (string, error) {\n\tdockerConfig := &DockerConfigJSON{\n\t\tAuths: DockerConfig{\n\t\t\tregistryURL: newDockerConfigEntry(authToken, email),\n\t\t},\n\t}\n\n\tpullSecretData, err := toPullSecretData(dockerConfig)\n\tif err != nil {\n\t\treturn \"\", perrors.Wrap(err, \"new pull secret\")\n\t}\n\n\treturn pullSecretData, nil\n}\n\nfunc newDockerConfigEntry(authToken, email string) DockerConfigEntry {\n\treturn DockerConfigEntry{\n\t\tAuth:  base64.StdEncoding.EncodeToString([]byte(authToken)),\n\t\tEmail: email,\n\t}\n}\n\nfunc toPullSecretData(dockerConfig *DockerConfigJSON) (string, error) {\n\tdata, err := json.Marshal(dockerConfig)\n\tif err != nil {\n\t\treturn \"\", perrors.Wrap(err, \"marshal docker config\")\n\t}\n\n\treturn string(data), nil\n}\n\nfunc DecodeAuthTokenFromPullSecret(secret *k8sv1.Secret, host string) (string, error) {\n\tdockerConfigBytes, ok := secret.Data[k8sv1.DockerConfigJsonKey]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"could not find %s in secret data\", k8sv1.DockerConfigJsonKey)\n\t}\n\n\tvar dockerConfig DockerConfigJSON\n\terr := json.Unmarshal(dockerConfigBytes, &dockerConfig)\n\tif err != nil {\n\t\treturn \"\", perrors.Wrap(err, \"unmarshal docker config\")\n\t}\n\n\tauth, ok := dockerConfig.Auths[host]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"no auth found for host: %s\", host)\n\t}\n\n\tdecodedAuthToken, err := base64.StdEncoding.DecodeString(auth.Auth)\n\tif err != nil {\n\t\treturn \"\", perrors.Wrap(err, \"decode auth token\")\n\t}\n\n\treturn string(decodedAuthToken), nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/driver.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// NewKubernetesDriver constructs a struct capable of provisioning a workspace and it's resources using kubernetes\nfunc NewKubernetesDriver(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) (driver.ReprovisioningDriver, error) {\n\toptions := workspaceInfo.Agent.Kubernetes\n\tif options.KubernetesConfig != \"\" {\n\t\tlog.Debugf(\"Use Kubernetes Config '%s'\", options.KubernetesConfig)\n\t}\n\tif options.KubernetesContext != \"\" {\n\t\tlog.Debugf(\"Use Kubernetes Context '%s'\", options.KubernetesContext)\n\t}\n\n\tclient, namespace, err := NewClient(options.KubernetesConfig, options.KubernetesContext)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create kubernetes client: %w\", err)\n\t}\n\t// Namespace can be defined in many ways, we first check the kube config, then the provider options KUBERNETES_NAMESPACE, then failing that the default \"devpod\"\n\tif namespace == \"\" || namespace == \"default\" || options.KubernetesNamespace != \"\" {\n\t\tlog.Debugf(\"Using Explicit Kubernetes Namespace\")\n\t\tnamespace = options.KubernetesNamespace\n\t}\n\tlog.Debugf(\"Use Kubernetes Namespace '%s'\", namespace)\n\n\treturn &KubernetesDriver{\n\t\tclient:    client,\n\t\tnamespace: namespace,\n\n\t\toptions: &options,\n\t\tLog:     log,\n\t}, nil\n}\n\ntype KubernetesDriver struct {\n\tnamespace string\n\n\tclient *Client\n\n\toptions *provider2.ProviderKubernetesDriverConfig\n\tLog     log.Logger\n}\n\nfunc (k *KubernetesDriver) CanReprovision() bool {\n\treturn true\n}\n\nfunc (k *KubernetesDriver) getDevContainerPvc(ctx context.Context, id string) (*corev1.PersistentVolumeClaim, *DevContainerInfo, error) {\n\t// try to find pvc\n\tpvc, err := k.client.Client().CoreV1().PersistentVolumeClaims(k.namespace).Get(ctx, id, metav1.GetOptions{})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn nil, nil, nil\n\t\t}\n\n\t\treturn nil, nil, err\n\t} else if pvc.Annotations == nil || pvc.Annotations[DevPodInfoAnnotation] == \"\" {\n\t\treturn nil, nil, fmt.Errorf(\"pvc is missing dev container info annotation\")\n\t}\n\n\t// get container info\n\tcontainerInfo := &DevContainerInfo{}\n\terr = json.Unmarshal([]byte(pvc.GetAnnotations()[DevPodInfoAnnotation]), containerInfo)\n\tif err != nil {\n\t\treturn nil, nil, perrors.Wrap(err, \"decode dev container info\")\n\t}\n\n\treturn pvc, containerInfo, nil\n}\n\nfunc (k *KubernetesDriver) StopDevContainer(ctx context.Context, workspaceId string) error {\n\tk.Log.Debugf(\"Stopping devcontainer for workspace '%s'\", workspaceId)\n\tdefer k.Log.Debugf(\"Done stopping devcontainer for workspace '%s'\", workspaceId)\n\n\tworkspaceId = getID(workspaceId)\n\n\t// delete pod\n\terr := k.waitPodDeleted(ctx, workspaceId)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"delete pod\")\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) DeleteDevContainer(ctx context.Context, workspaceId string) error {\n\tk.Log.Debugf(\"Deleting devcontainer for workspace '%s'\", workspaceId)\n\tdefer k.Log.Debugf(\"Done deleting devcontainer for workspace '%s'\", workspaceId)\n\n\tworkspaceId = getID(workspaceId)\n\n\t// delete pod\n\tk.Log.Infof(\"Delete pod '%s'...\", workspaceId)\n\terr := k.waitPodDeleted(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// delete pvc\n\tk.Log.Infof(\"Delete persistent volume claim '%s'...\", workspaceId)\n\terr = k.client.Client().CoreV1().PersistentVolumeClaims(k.namespace).Delete(ctx, workspaceId, metav1.DeleteOptions{\n\t\tGracePeriodSeconds: &[]int64{5}[0],\n\t})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn perrors.Wrap(err, \"delete pvc\")\n\t}\n\n\t// delete role binding & service account\n\tif k.options.ClusterRole != \"\" {\n\t\tk.Log.Infof(\"Delete role binding '%s'...\", workspaceId)\n\t\terr = k.client.Client().RbacV1().RoleBindings(k.namespace).Delete(ctx, workspaceId, metav1.DeleteOptions{})\n\t\tif err != nil && !kerrors.IsNotFound(err) {\n\t\t\treturn perrors.Wrap(err, \"delete role binding\")\n\t\t}\n\t}\n\n\t// delete daemon config secret\n\tif k.secretExists(ctx, getDaemonSecretName(workspaceId)) {\n\t\tk.Log.Infof(\"Delete daemon config secret '%s'...\", workspaceId)\n\t\terr := k.DeleteSecret(ctx, getDaemonSecretName(workspaceId))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// delete pull secret\n\tif k.options.KubernetesPullSecretsEnabled != \"\" {\n\t\tk.Log.Infof(\"Delete pull secret '%s'...\", workspaceId)\n\t\terr := k.DeleteSecret(ctx, getPullSecretsName(workspaceId))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) CommandDevContainer(ctx context.Context, workspaceId, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\tworkspaceId = getID(workspaceId)\n\n\tvar args []string\n\tif user != \"\" && user != \"root\" {\n\t\targs = []string{\"su\", user, \"-c\", command}\n\t} else {\n\t\targs = []string{\"sh\", \"-c\", command}\n\t}\n\n\treturn k.client.Exec(ctx, &ExecStreamOptions{\n\t\tPod:       workspaceId,\n\t\tNamespace: k.namespace,\n\t\tContainer: \"devpod\",\n\t\tCommand:   args,\n\t\tStdin:     stdin,\n\t\tStdout:    stdout,\n\t\tStderr:    stderr,\n\t})\n}\n\nfunc (k *KubernetesDriver) GetDevContainerLogs(ctx context.Context, workspaceID string, stdout io.Writer, stderr io.Writer) error {\n\tworkspaceID = getID(workspaceID)\n\n\tlogs, err := k.client.Logs(ctx, k.namespace, workspaceID, \"devpod\", true)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"get logs\")\n\t}\n\n\t_, err = io.Copy(stdout, logs)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"copy logs\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/find.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tcorev1 \"k8s.io/api/core/v1\"\n)\n\nfunc (k *KubernetesDriver) FindDevContainer(ctx context.Context, workspaceId string) (*config.ContainerDetails, error) {\n\tk.Log.Debugf(\"Finding devcontainer for workspace '%s'\", workspaceId)\n\tdefer k.Log.Debugf(\"Done finding devcontainer for workspace '%s'\", workspaceId)\n\n\tworkspaceId = getID(workspaceId)\n\n\tpvc, containerInfo, err := k.getDevContainerPvc(ctx, workspaceId)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if pvc == nil {\n\t\treturn nil, nil\n\t}\n\n\t// check pod\n\tpod, err := k.getPod(ctx, pvc.Name)\n\tif err != nil {\n\t\tk.Log.Infof(\"Error finding pod: %v\", err)\n\t\tk.Log.Warn(\"If the pod does not come up automatically it is stuck in an error state. Recreate the workspace to recover from this\")\n\t\tpod = nil\n\t}\n\n\t// determine status\n\tstatus := \"exited\"\n\tif pod != nil && isPodRunning(pod) {\n\t\tstatus = \"running\"\n\t}\n\n\t// check started\n\tstartedAt := pvc.CreationTimestamp.String()\n\tif pod != nil {\n\t\tstartedAt = pod.CreationTimestamp.String()\n\t}\n\n\treturn &config.ContainerDetails{\n\t\tID:      pvc.Name,\n\t\tCreated: pvc.CreationTimestamp.String(),\n\t\tState: config.ContainerDetailsState{\n\t\t\tStatus:    status,\n\t\t\tStartedAt: startedAt,\n\t\t},\n\t\tConfig: config.ContainerDetailsConfig{\n\t\t\tLabels: config.ListToObject(containerInfo.Options.Labels),\n\t\t},\n\t}, nil\n}\n\nfunc isPodRunning(pod *corev1.Pod) bool {\n\treturn pod.Status.Phase == corev1.PodRunning\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/helper.go",
    "content": "package kubernetes\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/ghodss/yaml\"\n\t\"github.com/loft-sh/log\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/api/resource\"\n)\n\nconst (\n\tlimitsPrefix   = \"limits.\"\n\trequestsPrefix = \"requests.\"\n)\n\nfunc parseResources(resourceString string, log log.Logger) corev1.ResourceRequirements {\n\tresourcesSplitted := strings.Split(resourceString, \",\")\n\trequests := corev1.ResourceList{}\n\tlimits := corev1.ResourceList{}\n\tfor _, resourceName := range resourcesSplitted {\n\t\tresourceName = strings.TrimSpace(resourceName)\n\n\t\t// requests\n\t\tif strings.HasPrefix(resourceName, requestsPrefix) {\n\t\t\tstrippedResource := strings.TrimPrefix(resourceName, requestsPrefix)\n\t\t\tname, quantity, err := parseResource(strippedResource)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\trequests[corev1.ResourceName(name)] = quantity\n\t\t}\n\n\t\t// limits\n\t\tif strings.HasPrefix(resourceName, limitsPrefix) {\n\t\t\tstrippedResource := strings.TrimPrefix(resourceName, limitsPrefix)\n\t\t\tname, quantity, err := parseResource(strippedResource)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlimits[corev1.ResourceName(name)] = quantity\n\t\t}\n\t}\n\n\treturn corev1.ResourceRequirements{\n\t\tLimits:   limits,\n\t\tRequests: requests,\n\t}\n}\n\nfunc getPodTemplate(manifest string) (*corev1.Pod, error) {\n\t// check if manifest is inline yaml\n\tpod := &corev1.Pod{}\n\terrInline := yaml.Unmarshal([]byte(manifest), pod)\n\tif errInline == nil {\n\t\treturn pod, nil\n\t}\n\n\t// check if manifest is path\n\tp, err := filepath.Abs(manifest)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing pod tempate failed failed: %w (inline) or %w (file)\", errInline, err)\n\t}\n\tbody, err := os.ReadFile(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing pod tempate failed failed: %w (inline) or %w (file)\", errInline, err)\n\t}\n\terr = yaml.Unmarshal(body, pod)\n\tif err == nil {\n\t\treturn pod, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"parsing pod tempate failed failed: %w (inline) or %w (file)\", errInline, err)\n}\n\nfunc parseLabels(str string) (map[string]string, error) {\n\tif str == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tlabels := strings.Split(str, \",\")\n\tretMap := map[string]string{}\n\tfor _, label := range labels {\n\t\tlabel = strings.TrimSpace(label)\n\t\tsplitted := strings.SplitN(label, \"=\", 2)\n\t\tif len(splitted) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid label '%s', expected format label=value\", label)\n\t\t}\n\n\t\tretMap[splitted[0]] = splitted[1]\n\t}\n\n\treturn retMap, nil\n}\n\nfunc parseResource(resourceName string) (string, resource.Quantity, error) {\n\tsplittedResource := strings.SplitN(resourceName, \"=\", 2)\n\tif len(splittedResource) != 2 {\n\t\treturn \"\", resource.Quantity{}, fmt.Errorf(\"error parsing resource %s: expected form resource=quantity\", resourceName)\n\t}\n\n\tquantity, err := resource.ParseQuantity(splittedResource[1])\n\tif err != nil {\n\t\treturn \"\", resource.Quantity{}, fmt.Errorf(\"error parsing resource %s: %w\", resourceName, err)\n\t}\n\n\treturn splittedResource[0], quantity, nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/init_container.go",
    "content": "package kubernetes\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\tcorev1 \"k8s.io/api/core/v1\"\n)\n\nfunc (k *KubernetesDriver) getInitContainers(options *driver.RunOptions, pod *corev1.Pod, initialize bool) ([]corev1.Container, error) {\n\tif !initialize {\n\t\tretContainers := []corev1.Container{}\n\t\t// don't build init container and clean up existing one if defined\n\t\tfor _, container := range pod.Spec.InitContainers {\n\t\t\tif container.Name == InitContainerName {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tretContainers = append(retContainers, container)\n\t\t}\n\n\t\treturn retContainers, nil\n\t}\n\n\tcommands := []string{}\n\t// find the volume type mounts\n\tvolumeMounts := []corev1.VolumeMount{}\n\tfor idx, mount := range options.Mounts {\n\t\tif mount.Type != \"volume\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tvolumeMount := getVolumeMount(idx+1, mount)\n\t\tcopyFrom := volumeMount.MountPath\n\t\tvolumeMount.MountPath = \"/\" + volumeMount.SubPath\n\t\tvolumeMounts = append(volumeMounts, volumeMount)\n\t\tcommands = append(commands, fmt.Sprintf(`cp -a %s/. %s/ || true`, strings.TrimRight(copyFrom, \"/\"), strings.TrimRight(volumeMount.MountPath, \"/\")))\n\t}\n\n\tretContainers := []corev1.Container{}\n\n\t// merge with existing init container if it exists\n\tvar existingInitContainer *corev1.Container\n\tfor i, container := range pod.Spec.InitContainers {\n\t\tif container.Name == InitContainerName {\n\t\t\texistingInitContainer = &pod.Spec.InitContainers[i]\n\t\t} else {\n\t\t\tretContainers = append(retContainers, container)\n\t\t}\n\t}\n\n\t// check if there is at least one mount\n\tif len(volumeMounts) == 0 {\n\t\treturn retContainers, nil\n\t}\n\n\tsecurityContext := &corev1.SecurityContext{\n\t\tRunAsUser:    &[]int64{0}[0],\n\t\tRunAsGroup:   &[]int64{0}[0],\n\t\tRunAsNonRoot: &[]bool{false}[0],\n\t}\n\tif k.options.StrictSecurity == \"true\" {\n\t\tsecurityContext = nil\n\t}\n\n\tresources := corev1.ResourceRequirements{}\n\tif existingInitContainer != nil {\n\t\tresources = existingInitContainer.Resources\n\t}\n\n\tinitContainer := corev1.Container{\n\t\tName:            InitContainerName,\n\t\tImage:           options.Image,\n\t\tCommand:         []string{\"sh\"},\n\t\tArgs:            []string{\"-c\", strings.Join(commands, \"\\n\") + \"\\n\"},\n\t\tResources:       resources,\n\t\tVolumeMounts:    volumeMounts,\n\t\tSecurityContext: securityContext,\n\t}\n\n\tif existingInitContainer != nil {\n\t\tinitContainer.Env = append(existingInitContainer.Env, initContainer.Env...)\n\t\tinitContainer.EnvFrom = existingInitContainer.EnvFrom\n\t\tinitContainer.Ports = existingInitContainer.Ports\n\t\tinitContainer.VolumeMounts = append(existingInitContainer.VolumeMounts, initContainer.VolumeMounts...)\n\t\tinitContainer.ImagePullPolicy = existingInitContainer.ImagePullPolicy\n\n\t\tif initContainer.SecurityContext == nil && existingInitContainer.SecurityContext != nil {\n\t\t\tinitContainer.SecurityContext = existingInitContainer.SecurityContext\n\t\t}\n\t}\n\n\tretContainers = append(retContainers, initContainer)\n\treturn retContainers, nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/pullsecrets.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/dockercredentials\"\n\tperrors \"github.com/pkg/errors\"\n\tk8sv1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc (k *KubernetesDriver) EnsurePullSecret(\n\tctx context.Context,\n\tpullSecretName string,\n\tdockerImage string,\n) (bool, error) {\n\tk.Log.Debugf(\"Ensure pull secrets\")\n\n\thost, err := GetRegistryFromImageName(dockerImage)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"get registry from image name: %w\", err)\n\t}\n\n\tdockerCredentials, err := dockercredentials.GetAuthConfig(host)\n\tif err != nil || dockerCredentials == nil || dockerCredentials.Username == \"\" || dockerCredentials.Secret == \"\" {\n\t\tk.Log.Debugf(\"Couldn't retrieve credentials for registry: %s\", host)\n\t\treturn false, nil\n\t}\n\n\tif k.secretExists(ctx, pullSecretName) {\n\t\tif !k.shouldRecreateSecret(ctx, dockerCredentials, pullSecretName, host) {\n\t\t\tk.Log.Debugf(\"Pull secret '%s' already exists and is up to date\", pullSecretName)\n\t\t\treturn true, nil\n\t\t}\n\n\t\tk.Log.Debugf(\"Pull secret '%s' already exists, but is outdated. Recreating...\", pullSecretName)\n\t\terr := k.DeleteSecret(ctx, pullSecretName)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\terr = k.createPullSecret(ctx, pullSecretName, dockerCredentials)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tk.Log.Infof(\"Pull secret '%s' created\", pullSecretName)\n\treturn true, nil\n}\n\nfunc (k *KubernetesDriver) ReadSecretContents(\n\tctx context.Context,\n\tpullSecretName string,\n\thost string,\n) (string, error) {\n\tsecret, err := k.client.Client().CoreV1().Secrets(k.namespace).Get(ctx, pullSecretName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn \"\", perrors.Wrap(err, \"get secret\")\n\t}\n\n\treturn DecodeAuthTokenFromPullSecret(secret, host)\n}\n\nfunc (k *KubernetesDriver) DeleteSecret(\n\tctx context.Context,\n\tsecretName string) error {\n\tif !k.secretExists(ctx, secretName) {\n\t\treturn nil\n\t}\n\n\terr := k.client.Client().CoreV1().Secrets(k.namespace).Delete(ctx, secretName, metav1.DeleteOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn perrors.Wrap(err, \"delete secret\")\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) shouldRecreateSecret(ctx context.Context, dockerCredentials *dockercredentials.Credentials, pullSecretName, host string) bool {\n\texistingAuthToken, err := k.ReadSecretContents(ctx, pullSecretName, host)\n\tif err != nil {\n\t\treturn true\n\t}\n\treturn existingAuthToken != dockerCredentials.AuthToken()\n}\n\nfunc (k *KubernetesDriver) secretExists(\n\tctx context.Context,\n\tsecretName string,\n) bool {\n\t_, err := k.client.Client().CoreV1().Secrets(k.namespace).Get(ctx, secretName, metav1.GetOptions{})\n\treturn err == nil\n}\n\nfunc (k *KubernetesDriver) createPullSecret(\n\tctx context.Context,\n\tpullSecretName string,\n\tdockerCredentials *dockercredentials.Credentials,\n) error {\n\tauthToken := dockerCredentials.AuthToken()\n\temail := \"noreply@loft.sh\"\n\n\tencodedSecretData, err := PreparePullSecretData(dockerCredentials.ServerURL, authToken, email)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"prepare pull secret data\")\n\t}\n\n\t_, err = k.client.Client().CoreV1().Secrets(k.namespace).Create(ctx, &k8sv1.Secret{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: pullSecretName,\n\t\t},\n\t\tType: k8sv1.SecretTypeDockerConfigJson,\n\t\tData: map[string][]byte{\n\t\t\t\".dockerconfigjson\": []byte(encodedSecretData),\n\t\t},\n\t}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"create pull secret\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/pvc.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\t\"github.com/pkg/errors\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/api/resource\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc (k *KubernetesDriver) createPersistentVolumeClaim(\n\tctx context.Context,\n\tid string,\n\toptions *driver.RunOptions,\n) error {\n\tpvc, err := k.buildPersistentVolumeClaim(id, options)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tk.Log.Infof(\"Create Persistent Volume Claim '%s'\", id)\n\t_, err = k.client.Client().CoreV1().PersistentVolumeClaims(k.namespace).Create(ctx, pvc, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create pvc: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) buildPersistentVolumeClaim(\n\tid string,\n\toptions *driver.RunOptions,\n) (*corev1.PersistentVolumeClaim, error) {\n\tcontainerInfo, err := k.getDevContainerInformation(id, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsize := k.options.DiskSize\n\tquantity, err := resource.ParseQuantity(size)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"parse persistent volume size '%s'\", size)\n\t}\n\n\tvar storageClassName *string\n\tif k.options.StorageClass != \"\" {\n\t\tstorageClassName = &k.options.StorageClass\n\t}\n\taccessMode := []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}\n\tif k.options.PvcAccessMode != \"\" {\n\t\tswitch k.options.PvcAccessMode {\n\t\tcase \"RWO\":\n\t\t\taccessMode = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}\n\t\tcase \"ROX\":\n\t\t\taccessMode = []corev1.PersistentVolumeAccessMode{corev1.ReadOnlyMany}\n\t\tcase \"RWX\":\n\t\t\taccessMode = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany}\n\t\tcase \"RWOP\":\n\t\t\taccessMode = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOncePod}\n\t\tdefault:\n\t\t\taccessMode = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}\n\t\t}\n\t}\n\n\tlabels := map[string]string{}\n\tlabels[DevPodWorkspaceUIDLabel] = options.UID\n\tfor k, v := range ExtraDevPodLabels {\n\t\tlabels[k] = v\n\t}\n\n\tannotations := map[string]string{}\n\tannotations[DevPodInfoAnnotation] = containerInfo\n\textraAnnotations, err := parseLabels(k.options.PvcAnnotations)\n\tif err != nil {\n\t\tk.Log.Error(\"Failed to parse annotations from PVC_ANNOTATIONS option: %v\", err)\n\t}\n\tfor k, v := range extraAnnotations {\n\t\tannotations[k] = v\n\t}\n\n\treturn &corev1.PersistentVolumeClaim{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind:       \"PersistentVolumeClaim\",\n\t\t\tAPIVersion: corev1.SchemeGroupVersion.String(),\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName:        id,\n\t\t\tLabels:      labels,\n\t\t\tAnnotations: annotations,\n\t\t},\n\t\tSpec: corev1.PersistentVolumeClaimSpec{\n\t\t\tAccessModes: accessMode,\n\t\t\tResources: corev1.VolumeResourceRequirements{\n\t\t\t\tRequests: map[corev1.ResourceName]resource.Quantity{\n\t\t\t\t\tcorev1.ResourceStorage: quantity,\n\t\t\t\t},\n\t\t\t},\n\t\t\tStorageClassName: storageClassName,\n\t\t},\n\t}, nil\n}\n\nfunc (k *KubernetesDriver) getDevContainerInformation(\n\tid string,\n\toptions *driver.RunOptions,\n) (string, error) {\n\tcontainerInfo, err := json.Marshal(&DevContainerInfo{\n\t\tWorkspaceID: id,\n\t\tOptions:     options,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(containerInfo), nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/registry.go",
    "content": "package kubernetes\n\nimport (\n\t\"strings\"\n\n\t\"github.com/distribution/reference\"\n)\n\nconst OfficialDockerRegistry = \"https://index.docker.io/v1/\"\n\n// GetRegistryFromImageName retrieves the registry name from an imageName\nfunc GetRegistryFromImageName(imageName string) (string, error) {\n\tref, err := reference.ParseNormalizedNamed(imageName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trepoInfo, err := newIndexInfo(reference.Domain(ref))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif !strings.ContainsRune(reference.FamiliarName(ref), '/') || repoInfo == \"hub.docker.com\" || repoInfo == \"docker.io\" {\n\t\treturn OfficialDockerRegistry, nil\n\t}\n\n\treturn repoInfo, nil\n}\n\n// validateIndexName validates an index name. It is used by the daemon to\n// validate the daemon configuration.\nfunc validateIndexName(val string) (string, error) {\n\t// TODO: upstream this to check to reference package\n\tif val == \"index.docker.io\" {\n\t\tval = \"docker.io\"\n\t}\n\treturn val, nil\n}\n\n// newIndexInfo returns IndexInfo configuration from indexName\nfunc newIndexInfo(indexName string) (string, error) {\n\tvar err error\n\tindexName, err = validateIndexName(indexName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Construct a non-configured index info.\n\treturn indexName, nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/registry_test.go",
    "content": "package kubernetes\n\nimport \"testing\"\n\nfunc TestGetRegistryFromImageName(t *testing.T) {\n\ttype args struct {\n\t\timageName string\n\t}\n\ttests := []struct {\n\t\tname    string\n\t\targs    args\n\t\twant    string\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname: \"should return official docker registry\",\n\t\t\targs: args{\n\t\t\t\timageName: \"docker.io/loftsh/devpod\",\n\t\t\t},\n\t\t\twant:    OfficialDockerRegistry,\n\t\t\twantErr: false,\n\t\t},\n\t\t{\n\t\t\tname: \"should return official docker registry\",\n\t\t\targs: args{\n\t\t\t\timageName: \"hub.docker.com/loftsh/devpod\",\n\t\t\t},\n\t\t\twant:    OfficialDockerRegistry,\n\t\t\twantErr: false,\n\t\t},\n\t\t{\n\t\t\tname: \"should return official docker registry\",\n\t\t\targs: args{\n\t\t\t\timageName: \"nginx:latest\",\n\t\t\t},\n\t\t\twant:    OfficialDockerRegistry,\n\t\t\twantErr: false,\n\t\t},\n\t\t{\n\t\t\tname: \"should return github registry\",\n\t\t\targs: args{\n\t\t\t\timageName: \"ghcr.io/loftsh/devpod\",\n\t\t\t},\n\t\t\twant:    \"ghcr.io\",\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgot, err := GetRegistryFromImageName(tt.args.imageName)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"GetRegistryFromImageName() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif got != tt.want {\n\t\t\t\tt.Errorf(\"GetRegistryFromImageName() got = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/run.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/driver\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/utils/ptr\"\n)\n\nconst DevContainerName = \"devpod\"\nconst InitContainerName = \"devpod-init\"\n\nconst (\n\tDevPodCreatedLabel      = \"devpod.sh/created\"\n\tDevPodWorkspaceLabel    = \"devpod.sh/workspace\"\n\tDevPodWorkspaceUIDLabel = \"devpod.sh/workspace-uid\"\n\n\tDevPodInfoAnnotation                   = \"devpod.sh/info\"\n\tDevPodLastAppliedAnnotation            = \"devpod.sh/last-applied-configuration\"\n\tClusterAutoscalerSaveToEvictAnnotation = \"cluster-autoscaler.kubernetes.io/safe-to-evict\"\n)\n\nvar ExtraDevPodLabels = map[string]string{\n\tDevPodCreatedLabel: \"true\",\n}\n\ntype DevContainerInfo struct {\n\tWorkspaceID string\n\tOptions     *driver.RunOptions\n}\n\nfunc (k *KubernetesDriver) RunDevContainer(\n\tctx context.Context,\n\tworkspaceId string,\n\toptions *driver.RunOptions,\n) error {\n\tk.Log.Debugf(\"Running devcontainer for workspace '%s'\", workspaceId)\n\tworkspaceId = getID(workspaceId)\n\n\t// namespace\n\tif k.namespace != \"\" && k.options.CreateNamespace == \"true\" {\n\t\terr := k.createNamespace(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// check if persistent volume claim already exists\n\tinitialize := false\n\tpvc, containerInfo, err := k.getDevContainerPvc(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if pvc == nil {\n\t\tif options == nil {\n\t\t\treturn fmt.Errorf(\"no options provided and no persistent volume claim found for workspace '%s'\", workspaceId)\n\t\t}\n\n\t\t// create persistent volume claim\n\t\terr = k.createPersistentVolumeClaim(ctx, workspaceId, options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tinitialize = true\n\t}\n\n\t// reuse driver.RunOptions from existing workspace if none provided\n\tif options == nil && containerInfo != nil && containerInfo.Options != nil {\n\t\toptions = containerInfo.Options\n\t}\n\n\t// create dev container\n\terr = k.runContainer(ctx, workspaceId, options, initialize)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) runContainer(\n\tctx context.Context,\n\tid string,\n\toptions *driver.RunOptions,\n\tinitialize bool,\n) (err error) {\n\t// get workspace mount\n\tmount := options.WorkspaceMount\n\tif mount.Target == \"\" {\n\t\treturn fmt.Errorf(\"workspace mount target is empty\")\n\t}\n\tif k.options.WorkspaceVolumeMount != \"\" {\n\t\t// Ensure workspace volume mount option is parent or same dir as workspace mount\n\t\trel, err := filepath.Rel(k.options.WorkspaceVolumeMount, mount.Target)\n\t\tif err != nil {\n\t\t\tk.Log.Warn(\"Relative filepath: %v\", err)\n\t\t} else if strings.HasPrefix(rel, \"..\") {\n\t\t\tk.Log.Warnf(\"Workspace volume mount needs to be the same as the workspace mount or a parent, skipping option. WorkspaceVolumeMount: %s, MountTarget: %s\", k.options.WorkspaceVolumeMount, mount.Target)\n\t\t} else {\n\t\t\tmount.Target = k.options.WorkspaceVolumeMount\n\t\t\tk.Log.Debugf(\"Using workspace volume mount: %s\", k.options.WorkspaceVolumeMount)\n\t\t}\n\t}\n\n\t// read pod template\n\tpod := &corev1.Pod{\n\t\tSpec: corev1.PodSpec{\n\t\t\tRestartPolicy: corev1.RestartPolicyNever,\n\t\t},\n\t}\n\tif len(k.options.PodManifestTemplate) > 0 {\n\t\tk.Log.Debugf(\"trying to get pod template manifest from %s\", k.options.PodManifestTemplate)\n\t\tpod, err = getPodTemplate(k.options.PodManifestTemplate)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// get init containers\n\tinitContainers, err := k.getInitContainers(options, pod, initialize)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"build init container\")\n\t}\n\n\t// loop over volume mounts\n\tvolumeMounts := []corev1.VolumeMount{getVolumeMount(0, mount)}\n\tfor idx, mount := range options.Mounts {\n\t\tvolumeMount := getVolumeMount(idx+1, mount)\n\t\tif mount.Type == \"bind\" || mount.Type == \"volume\" {\n\t\t\tvolumeMounts = append(volumeMounts, volumeMount)\n\t\t} else {\n\t\t\tk.Log.Warnf(\"Unsupported mount type '%s' in mount '%s', will skip\", mount.Type, mount.String())\n\t\t}\n\t}\n\n\t// capabilities\n\tvar capabilities *corev1.Capabilities\n\tif len(options.CapAdd) > 0 {\n\t\tcapabilities = &corev1.Capabilities{}\n\t\tfor _, cap := range options.CapAdd {\n\t\t\tcapabilities.Add = append(capabilities.Add, corev1.Capability(cap))\n\t\t}\n\t}\n\n\t// env vars\n\tenvVars := []corev1.EnvVar{}\n\tdaemonConfig := \"\"\n\tfor k, v := range options.Env {\n\t\t// filter out daemon config, that's going to be mounted through a secret\n\t\tif k == config.WorkspaceDaemonConfigExtraEnvVar {\n\t\t\tdaemonConfig = v\n\t\t\tcontinue\n\t\t}\n\t\tenvVars = append(envVars, corev1.EnvVar{\n\t\t\tName:  k,\n\t\t\tValue: v,\n\t\t})\n\t}\n\n\t// service account\n\tserviceAccount := \"\"\n\tif k.options.ServiceAccount != \"\" {\n\t\tserviceAccount = k.options.ServiceAccount\n\n\t\t// create service account\n\t\terr = k.createServiceAccount(ctx, id, serviceAccount)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create service account: %w\", err)\n\t\t}\n\t}\n\n\t// labels\n\tlabels, err := getLabels(pod, k.options.Labels)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlabels[DevPodWorkspaceUIDLabel] = options.UID\n\n\t// node selector\n\tnodeSelector, err := getNodeSelector(pod, k.options.NodeSelector)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// parse resources\n\tresources := corev1.ResourceRequirements{}\n\tif len(pod.Spec.Containers) > 0 {\n\t\tresources = pod.Spec.Containers[0].Resources\n\t}\n\tif k.options.Resources != \"\" {\n\t\tresources = parseResources(k.options.Resources, k.Log)\n\t}\n\n\t// ensure daemon config secret\n\tdaemonConfigSecretName := \"\"\n\tif daemonConfig != \"\" {\n\t\tdaemonConfigSecretName = getDaemonSecretName(id)\n\t\terr = k.EnsureDaemonConfigSecret(ctx, daemonConfigSecretName, daemonConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// ensure pull secrets\n\tpullSecretsCreated := false\n\tif k.options.KubernetesPullSecretsEnabled == \"true\" {\n\t\tpullSecretsCreated, err = k.EnsurePullSecret(ctx, getPullSecretsName(id), options.Image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// create the pod manifest\n\tpod.ObjectMeta.Name = id\n\tpod.ObjectMeta.Labels = labels\n\n\tpod.Spec.ServiceAccountName = serviceAccount\n\tpod.Spec.NodeSelector = nodeSelector\n\tpod.Spec.InitContainers = initContainers\n\tpod.Spec.Containers = getContainers(pod, options.Image, options.Entrypoint, options.Cmd, envVars, volumeMounts, capabilities, resources, options.Privileged, k.options.StrictSecurity, daemonConfigSecretName)\n\tpod.Spec.Volumes = getVolumes(pod, id, daemonConfigSecretName)\n\t// avoids a problem where attaching volumes with large repositories would cause an extremely long pod startup time\n\t// because changing the ownership of all files takes longer than the kubelet expects it to\n\tif pod.Spec.SecurityContext == nil {\n\t\tpod.Spec.SecurityContext = &corev1.PodSecurityContext{\n\t\t\tFSGroupChangePolicy: ptr.To(corev1.FSGroupChangeOnRootMismatch),\n\t\t}\n\t}\n\tif k.options.KubernetesPullSecretsEnabled == \"true\" && pullSecretsCreated {\n\t\tpod.Spec.ImagePullSecrets = []corev1.LocalObjectReference{{Name: getPullSecretsName(id)}}\n\t}\n\tpod.Spec.RestartPolicy = corev1.RestartPolicyNever\n\t// try to get existing pod\n\texistingPod, err := k.getPod(ctx, id)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"get pod: %s\", id)\n\t}\n\n\tif existingPod != nil {\n\t\texistingOptions := &provider2.ProviderKubernetesDriverConfig{}\n\t\terr := json.Unmarshal([]byte(existingPod.GetAnnotations()[DevPodLastAppliedAnnotation]), existingOptions)\n\t\tif err != nil {\n\t\t\tk.Log.Errorf(\"Error unmarshalling existing provider options, continuing...: %s\", err)\n\t\t}\n\n\t\t// Nothing changed, can safely return\n\t\tif optionsEqual(existingOptions, k.options) {\n\t\t\tk.Log.Infof(\"Pod '%s' already exists and nothing changed, skipping update\", existingPod.Name)\n\t\t\treturn nil\n\t\t}\n\n\t\t// Stop the current pod\n\t\tk.Log.Debug(\"Provider options changed\")\n\t\terr = k.waitPodDeleted(ctx, id)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"stop devcontainer: %s\", id)\n\t\t}\n\t}\n\n\terr = k.runPod(ctx, id, pod)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (k *KubernetesDriver) runPod(ctx context.Context, id string, pod *corev1.Pod) error {\n\tvar err error\n\n\t// set configuration before creating the pod\n\tlastAppliedConfigRaw, err := json.Marshal(k.options)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"marshal last applied config\")\n\t}\n\n\tif pod.Annotations == nil {\n\t\tpod.Annotations = map[string]string{}\n\t}\n\tpod.Annotations[DevPodLastAppliedAnnotation] = string(lastAppliedConfigRaw)\n\tpod.Annotations[ClusterAutoscalerSaveToEvictAnnotation] = \"false\"\n\n\t// marshal the pod\n\tpodRaw, err := json.Marshal(pod)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tk.Log.Debugf(\"Create pod with: %s\", string(podRaw))\n\n\t// create the pod\n\tk.Log.Infof(\"Create Pod '%s'\", id)\n\t_, err = k.client.Client().CoreV1().Pods(k.namespace).Create(ctx, pod, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create pod: %w\", err)\n\t}\n\n\t// wait for pod running\n\tk.Log.Infof(\"Waiting for DevContainer Pod '%s' to come up...\", id)\n\t_, err = k.waitPodRunning(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc getContainers(\n\tpod *corev1.Pod,\n\timageName,\n\tentrypoint string,\n\targs []string,\n\tenvVars []corev1.EnvVar,\n\tvolumeMounts []corev1.VolumeMount,\n\tcapabilities *corev1.Capabilities,\n\tresources corev1.ResourceRequirements,\n\tprivileged *bool,\n\tstrictSecurity string,\n\tdaemonConfigSecretName string,\n) []corev1.Container {\n\tif daemonConfigSecretName != \"\" {\n\t\tvolumeMounts = append(volumeMounts, corev1.VolumeMount{\n\t\t\tName:      \"devpod-daemon-config\",\n\t\t\tMountPath: \"/var/run/secrets/devpod\",\n\t\t})\n\t}\n\tdevPodContainer := corev1.Container{\n\t\tName:         DevContainerName,\n\t\tImage:        imageName,\n\t\tCommand:      []string{entrypoint},\n\t\tArgs:         args,\n\t\tEnv:          envVars,\n\t\tResources:    resources,\n\t\tVolumeMounts: volumeMounts,\n\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\tCapabilities: capabilities,\n\t\t\tPrivileged:   privileged,\n\t\t\tRunAsUser:    &[]int64{0}[0],\n\t\t\tRunAsGroup:   &[]int64{0}[0],\n\t\t\tRunAsNonRoot: &[]bool{false}[0],\n\t\t},\n\t}\n\n\tif strictSecurity == \"true\" {\n\t\tdevPodContainer.SecurityContext = nil\n\t}\n\n\t// merge with existing container if it exists\n\tvar existingDevPodContainer *corev1.Container\n\tretContainers := []corev1.Container{}\n\tif pod != nil {\n\t\tfor i, container := range pod.Spec.Containers {\n\t\t\tif container.Name == DevContainerName {\n\t\t\t\texistingDevPodContainer = &pod.Spec.Containers[i]\n\t\t\t} else {\n\t\t\t\tretContainers = append(retContainers, container)\n\t\t\t}\n\t\t}\n\t}\n\n\tif existingDevPodContainer != nil {\n\t\tdevPodContainer.Env = append(existingDevPodContainer.Env, devPodContainer.Env...)\n\t\tdevPodContainer.EnvFrom = existingDevPodContainer.EnvFrom\n\t\tdevPodContainer.Ports = existingDevPodContainer.Ports\n\t\tdevPodContainer.VolumeMounts = append(existingDevPodContainer.VolumeMounts, devPodContainer.VolumeMounts...)\n\t\tdevPodContainer.ImagePullPolicy = existingDevPodContainer.ImagePullPolicy\n\n\t\tif devPodContainer.SecurityContext == nil && existingDevPodContainer.SecurityContext != nil {\n\t\t\tdevPodContainer.SecurityContext = existingDevPodContainer.SecurityContext\n\t\t}\n\t}\n\tretContainers = append(retContainers, devPodContainer)\n\n\treturn retContainers\n}\n\nfunc getVolumes(pod *corev1.Pod, id string, daemonConfigSecretName string) []corev1.Volume {\n\tvolumes := []corev1.Volume{\n\t\t{\n\t\t\tName: \"devpod\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tPersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{\n\t\t\t\t\tClaimName: id,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif daemonConfigSecretName != \"\" {\n\t\tvolumes = append(volumes, corev1.Volume{\n\t\t\tName: \"devpod-daemon-config\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tSecret: &corev1.SecretVolumeSource{\n\t\t\t\t\tSecretName: daemonConfigSecretName,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\n\tif pod.Spec.Volumes != nil {\n\t\tvolumes = append(volumes, pod.Spec.Volumes...)\n\t}\n\n\treturn volumes\n}\n\nfunc getVolumeMount(idx int, mount *config.Mount) corev1.VolumeMount {\n\tsubPath := strconv.Itoa(idx)\n\tif mount.Type == \"volume\" && mount.Source != \"\" {\n\t\tsubPath = strings.TrimPrefix(mount.Source, \"/\")\n\t}\n\n\treturn corev1.VolumeMount{\n\t\tName:      \"devpod\",\n\t\tMountPath: mount.Target,\n\t\tSubPath:   fmt.Sprintf(\"devpod/%s\", subPath),\n\t}\n}\n\nfunc getLabels(pod *corev1.Pod, rawLabels string) (map[string]string, error) {\n\tlabels := map[string]string{}\n\tif pod.ObjectMeta.Labels != nil {\n\t\tfor k, v := range pod.ObjectMeta.Labels {\n\t\t\tlabels[k] = v\n\t\t}\n\t}\n\tif rawLabels != \"\" {\n\t\textraLabels, err := parseLabels(rawLabels)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parse labels: %w\", err)\n\t\t}\n\t\tfor k, v := range extraLabels {\n\t\t\tlabels[k] = v\n\t\t}\n\t}\n\t// make sure we don't overwrite the devpod labels\n\tfor k, v := range ExtraDevPodLabels {\n\t\tlabels[k] = v\n\t}\n\n\treturn labels, nil\n}\n\nfunc getNodeSelector(pod *corev1.Pod, rawNodeSelector string) (map[string]string, error) {\n\tnodeSelector := map[string]string{}\n\tif pod.Spec.NodeSelector != nil {\n\t\tfor k, v := range pod.Spec.NodeSelector {\n\t\t\tnodeSelector[k] = v\n\t\t}\n\t}\n\n\tif rawNodeSelector != \"\" {\n\t\tselector, err := parseLabels(rawNodeSelector)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing node selector: %w\", err)\n\t\t}\n\t\tfor k, v := range selector {\n\t\t\tnodeSelector[k] = v\n\t\t}\n\t}\n\n\treturn nodeSelector, nil\n}\n\nfunc (k *KubernetesDriver) StartDevContainer(ctx context.Context, workspaceId string) error {\n\tk.Log.Debugf(\"Starting devcontainer for workspace '%s'\", workspaceId)\n\tdefer k.Log.Debugf(\"Done starting devcontainer for workspace '%s'\", workspaceId)\n\n\tworkspaceId = getID(workspaceId)\n\t_, containerInfo, err := k.getDevContainerPvc(ctx, workspaceId)\n\tif err != nil {\n\t\treturn err\n\t} else if containerInfo == nil {\n\t\treturn fmt.Errorf(\"persistent volume '%s' not found\", workspaceId)\n\t}\n\n\treturn k.runContainer(\n\t\tctx,\n\t\tworkspaceId,\n\t\tcontainerInfo.Options,\n\t\tfalse,\n\t)\n}\n\nfunc getID(workspaceID string) string {\n\treturn \"devpod-\" + workspaceID\n}\n\nfunc getPullSecretsName(workspaceID string) string {\n\treturn fmt.Sprintf(\"devpod-pull-secret-%s\", workspaceID)\n}\n\nfunc getDaemonSecretName(workspaceID string) string {\n\treturn fmt.Sprintf(\"devpod-daemon-secret-%s\", workspaceID)\n}\n\nfunc optionsEqual(a, b *provider2.ProviderKubernetesDriverConfig) bool {\n\t// copy a and b and the compare them without the context, config, namespace and podTimeout\n\taCopy := *a\n\taCopy.KubernetesContext = \"\"\n\taCopy.KubernetesConfig = \"\"\n\taCopy.KubernetesNamespace = \"\"\n\taCopy.PodTimeout = \"\"\n\n\tbCopy := *b\n\tbCopy.KubernetesContext = \"\"\n\tbCopy.KubernetesConfig = \"\"\n\tbCopy.KubernetesNamespace = \"\"\n\tbCopy.PodTimeout = \"\"\n\treturn aCopy == bCopy\n}\n\nfunc (k *KubernetesDriver) createNamespace(ctx context.Context) error {\n\t_, err := k.client.Client().CoreV1().Namespaces().Get(ctx, k.namespace, metav1.GetOptions{})\n\tif kerrors.IsNotFound(err) || kerrors.IsForbidden(err) {\n\t\tk.Log.Infof(\"Create namespace '%s'\", k.namespace)\n\t\t_, err := k.client.Client().CoreV1().Namespaces().Create(ctx, &corev1.Namespace{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: k.namespace,\n\t\t\t},\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil && !kerrors.IsAlreadyExists(err) && !kerrors.IsForbidden(err) {\n\t\t\treturn fmt.Errorf(\"create namespace: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/serviceaccount.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tcorev1 \"k8s.io/api/core/v1\"\n\trbacv1 \"k8s.io/api/rbac/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc (k *KubernetesDriver) createServiceAccount(ctx context.Context, id, serviceAccount string) error {\n\t// try to find pvc\n\t_, err := k.client.Client().CoreV1().ServiceAccounts(k.namespace).Get(ctx, serviceAccount, metav1.GetOptions{})\n\tif err != nil && !kerrors.IsNotFound(err) {\n\t\treturn fmt.Errorf(\"get service account: %w\", err)\n\t} else if kerrors.IsNotFound(err) {\n\t\t// create service account if it does not exist\n\t\tk.Log.Infof(\"Create Service Account '%s'\", serviceAccount)\n\t\t_, err := k.client.Client().CoreV1().ServiceAccounts(k.namespace).Create(ctx, &corev1.ServiceAccount{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName:   serviceAccount,\n\t\t\t\tLabels: ExtraDevPodLabels,\n\t\t\t},\n\t\t}, metav1.CreateOptions{})\n\t\tif err != nil && !kerrors.IsAlreadyExists(err) {\n\t\t\treturn fmt.Errorf(\"create service account: %w\", err)\n\t\t}\n\t}\n\n\t// try to find role binding\n\tif k.options.ClusterRole != \"\" {\n\t\t_, err := k.client.Client().RbacV1().RoleBindings(k.namespace).Get(ctx, id, metav1.GetOptions{})\n\t\tif err != nil && !kerrors.IsNotFound(err) {\n\t\t\treturn fmt.Errorf(\"get role binding: %w\", err)\n\t\t} else if kerrors.IsNotFound(err) {\n\t\t\t// create role binding\n\t\t\tk.Log.Infof(\"Create Role Binding '%s'\", serviceAccount)\n\t\t\t_, err := k.client.Client().RbacV1().RoleBindings(k.namespace).Create(ctx, &rbacv1.RoleBinding{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName:   id,\n\t\t\t\t\tLabels: ExtraDevPodLabels,\n\t\t\t\t},\n\t\t\t\tSubjects: []rbacv1.Subject{\n\t\t\t\t\t{\n\t\t\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\t\t\tName: serviceAccount,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRoleRef: rbacv1.RoleRef{\n\t\t\t\t\tAPIGroup: rbacv1.SchemeGroupVersion.Group,\n\t\t\t\t\tKind:     \"ClusterRole\",\n\t\t\t\t\tName:     k.options.ClusterRole,\n\t\t\t\t},\n\t\t\t}, metav1.CreateOptions{})\n\t\t\tif err != nil && !kerrors.IsAlreadyExists(err) {\n\t\t\t\treturn fmt.Errorf(\"create role binding: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/target_architecture.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc (k *KubernetesDriver) TargetArchitecture(ctx context.Context, workspaceId string) (string, error) {\n\tif k.options.Architecture != \"\" {\n\t\treturn k.options.Architecture, nil\n\t}\n\n\tk.Log.Debugf(\"Getting target architecture for workspace '%s'\", workspaceId)\n\tdefer k.Log.Debugf(\"Done getting target architecture for workspace '%s'\", workspaceId)\n\n\t// get all nodes\n\tnodes, err := k.client.Client().CoreV1().Nodes().List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tif kerrors.IsForbidden(err) {\n\t\t\treturn \"\", fmt.Errorf(\"you don't have permission to list nodes in the Kubernetes cluster, please set the cluster architecture manually via provider options\")\n\t\t}\n\n\t\treturn \"\", fmt.Errorf(\"list nodes: %w\", err)\n\t}\n\n\t// check if there are mixed architectures\n\tarchitecture := \"\"\n\tfor _, node := range nodes.Items {\n\t\tif architecture == \"\" {\n\t\t\tarchitecture = node.Status.NodeInfo.Architecture\n\t\t} else if architecture != node.Status.NodeInfo.Architecture {\n\t\t\treturn \"\", fmt.Errorf(\"mixed architectures in the Kubernetes cluster, please set the cluster architecture manually via provider options\")\n\t\t}\n\t}\n\n\treturn architecture, nil\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/throttledlogger/throttled_logger.go",
    "content": "package throttledlogger\n\nimport (\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n)\n\n// ThrottledLogger is a logger that throttles the output,\n// i.e. it only logs a message if a certain amount of time has passed since the last log message\ntype ThrottledLogger struct {\n\tlogger log.Logger\n\ttimer  *Timer\n}\n\nfunc NewThrottledLogger(logger log.Logger, throttlingInterval time.Duration) *ThrottledLogger {\n\treturn &ThrottledLogger{\n\t\tlogger: logger,\n\t\ttimer:  NewTimer(throttlingInterval),\n\t}\n}\n\nfunc (t *ThrottledLogger) Infof(format string, args ...interface{}) {\n\tt.log(t.logger.Infof, format, args...)\n}\n\nfunc (t *ThrottledLogger) Debugf(format string, args ...interface{}) {\n\tt.log(t.logger.Debugf, format, args...)\n}\n\ntype LoggingFunc func(string, ...interface{})\n\nfunc (t *ThrottledLogger) log(loggingFunc LoggingFunc, format string, args ...interface{}) {\n\tnow := time.Now()\n\tif t.timer.IntervalPassed(now) {\n\t\tloggingFunc(format, args...)\n\t\tt.timer.Tick(now)\n\t}\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/throttledlogger/timer.go",
    "content": "package throttledlogger\n\nimport \"time\"\n\ntype Timer struct {\n\tnextMessage  time.Time\n\ttickInterval time.Duration\n}\n\nfunc NewTimer(tickInterval time.Duration) *Timer {\n\treturn &Timer{\n\t\tnextMessage:  time.Now().Add(tickInterval),\n\t\ttickInterval: tickInterval,\n\t}\n}\n\nfunc (t *Timer) Tick(now time.Time) {\n\tt.nextMessage = now.Add(t.tickInterval)\n}\n\nfunc (t *Timer) IntervalPassed(now time.Time) bool {\n\treturn now.After(t.nextMessage)\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/throttledlogger/timer_test.go",
    "content": "package throttledlogger\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestTimer_TickAndIntervalPassed(t *testing.T) {\n\tinterval := time.Millisecond * 100\n\ttimer := NewTimer(interval)\n\n\t// Ensure initially the interval has not passed\n\tnow := time.Now()\n\tif timer.IntervalPassed(now) {\n\t\tt.Fatalf(\"expected interval not passed yet, got interval passed\")\n\t}\n\n\t// Move forward in time beyond the interval\n\tnow = now.Add(interval + time.Millisecond*10)\n\n\tif !timer.IntervalPassed(now) {\n\t\tt.Fatalf(\"expected interval passed, got interval not passed yet\")\n\t}\n\n\t// Call Tick method to shift the nextMessage time\n\ttimer.Tick(now)\n\n\t// After Tick, the interval should not have passed again\n\tif timer.IntervalPassed(now) {\n\t\tt.Fatalf(\"after tick, expected interval not passed yet, got interval passed\")\n\t}\n\n\t// Move forward in time beyond the interval again\n\tnow = now.Add(interval + time.Millisecond*10)\n\n\tif !timer.IntervalPassed(now) {\n\t\tt.Fatalf(\"after tick and waiting, expected interval passed, got interval not passed yet\")\n\t}\n}\n"
  },
  {
    "path": "pkg/driver/kubernetes/wait.go",
    "content": "package kubernetes\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/driver/kubernetes/throttledlogger\"\n\tperrors \"github.com/pkg/errors\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tkerrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n)\n\nfunc (k *KubernetesDriver) waitPodRunning(ctx context.Context, id string) (*corev1.Pod, error) {\n\tthrottledLogger := throttledlogger.NewThrottledLogger(k.Log, time.Second*5)\n\n\ttimeoutDuration, err := time.ParseDuration(k.options.PodTimeout)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"parse pod timeout\")\n\t}\n\n\tstarted := time.Now()\n\tvar pod *corev1.Pod\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, timeoutDuration, true, func(ctx context.Context) (bool, error) {\n\t\tvar err error\n\t\tpod, err = k.getPod(ctx, id)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t} else if pod == nil {\n\t\t\treturn true, nil\n\t\t}\n\n\t\t// check pod for problems\n\t\tif pod.DeletionTimestamp != nil {\n\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' is terminating\", id)\n\t\t\treturn false, nil\n\t\t}\n\n\t\t// Let's print all conditions that are false to help people troubleshoot infra issues\n\t\tcondMsg := \"\"\n\t\tif time.Since(started) > 45*time.Second { // start printing conditions after a delay\n\t\t\tfor _, cond := range pod.Status.Conditions {\n\t\t\t\tif cond.Status == corev1.ConditionFalse {\n\t\t\t\t\tcondMsg += fmt.Sprintf(\"Condition \\\"%s\\\" is %s\\n\", cond.Type, cond.Status)\n\t\t\t\t\tif cond.Reason != \"\" {\n\t\t\t\t\t\tcondMsg += fmt.Sprintf(\"%s Reason: %s\\n\", cond.Type, cond.Reason)\n\t\t\t\t\t}\n\t\t\t\t\tif cond.Message != \"\" {\n\t\t\t\t\t\tcondMsg += fmt.Sprintf(\"%s Message: %s\\n\", cond.Type, cond.Message)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check pod status\n\t\tif len(pod.Status.ContainerStatuses) < len(pod.Spec.Containers) {\n\t\t\tmsg := fmt.Sprintf(\"Waiting, since pod '%s' is starting\", id)\n\t\t\tif condMsg != \"\" {\n\t\t\t\tmsg += fmt.Sprintf(\"\\n%s\", strings.TrimSpace(condMsg))\n\t\t\t}\n\t\t\tthrottledLogger.Infof(\"%s\", msg)\n\t\t\treturn false, nil\n\t\t}\n\n\t\t// check init container status\n\t\tfor _, c := range pod.Status.InitContainerStatuses {\n\t\t\tcontainerStatus := &c\n\t\t\tif IsWaiting(containerStatus) {\n\t\t\t\tif IsCritical(containerStatus) {\n\t\t\t\t\treturn false, fmt.Errorf(\"pod '%s' init container '%s' is waiting to start: %s (%s)\", id, c.Name, c.State.Waiting.Message, c.State.Waiting.Reason)\n\t\t\t\t}\n\t\t\t\tif c.State.Waiting.Message == \"\" {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' init container '%s' is waiting to start: %s\", id, c.Name, c.State.Waiting.Reason)\n\t\t\t\t} else {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' init container '%s' is waiting to start: %s (%s)\", id, c.Name, c.State.Waiting.Message, c.State.Waiting.Reason)\n\t\t\t\t}\n\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\tif IsTerminated(containerStatus) && !Succeeded(containerStatus) {\n\t\t\t\treturn false, fmt.Errorf(\"pod '%s' init container '%s' is terminated: %s (%s)\", id, c.Name, c.State.Terminated.Message, c.State.Terminated.Reason)\n\t\t\t}\n\n\t\t\tcontainer, err := getContainer(pod.Spec.InitContainers, c.Name)\n\t\t\tif err != nil {\n\t\t\t\tthrottledLogger.Infof(\"Could not find container '%s'\", c.Name)\n\t\t\t\treturn false, err\n\t\t\t}\n\n\t\t\trestartable := restartableInitContainer(container.RestartPolicy)\n\t\t\tif restartable {\n\t\t\t\tif !IsStarted(containerStatus) || !IsReady(containerStatus) {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' init container '%s' is not ready yet\", id, c.Name)\n\t\t\t\t\treturn false, nil\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif IsRunning(containerStatus) {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' init container '%s' is running\", id, c.Name)\n\t\t\t\t\treturn false, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check container status\n\t\tfor _, c := range pod.Status.ContainerStatuses {\n\t\t\tcontainerStatus := &c\n\t\t\t// delete succeeded pods\n\t\t\tif IsTerminated(containerStatus) && Succeeded(containerStatus) {\n\t\t\t\t// delete pod that is succeeded\n\t\t\t\tk.Log.Debugf(\"Delete Pod '%s' because it is succeeded\", id)\n\t\t\t\terr = k.waitPodDeleted(ctx, id)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\tif IsWaiting(containerStatus) {\n\t\t\t\tif IsCritical(containerStatus) {\n\t\t\t\t\treturn false, fmt.Errorf(\"pod '%s' container '%s' is waiting to start: %s (%s)\", id, c.Name, c.State.Waiting.Message, c.State.Waiting.Reason)\n\t\t\t\t}\n\t\t\t\tif c.State.Waiting.Message == \"\" {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' container '%s' is waiting to start: %s\", id, c.Name, c.State.Waiting.Reason)\n\t\t\t\t} else {\n\t\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' container '%s' is waiting to start: %s (%s)\", id, c.Name, c.State.Waiting.Message, c.State.Waiting.Reason)\n\t\t\t\t}\n\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\tif IsTerminated(containerStatus) {\n\t\t\t\treturn false, fmt.Errorf(\"pod '%s' container '%s' is terminated: %s (%s)\", id, c.Name, c.State.Terminated.Message, c.State.Terminated.Reason)\n\t\t\t}\n\n\t\t\tif !IsReady(containerStatus) {\n\t\t\t\tthrottledLogger.Infof(\"Waiting, since pod '%s' container '%s' is not ready yet\", id, c.Name)\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t}\n\n\t\treturn true, nil\n\t})\n\n\treturn pod, err\n}\n\nfunc (k *KubernetesDriver) getPod(ctx context.Context, id string) (*corev1.Pod, error) {\n\t// try to find pod\n\tpod, err := k.client.Client().CoreV1().Pods(k.namespace).Get(ctx, id, metav1.GetOptions{})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn nil, nil\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"find container: %w\", err)\n\t}\n\n\treturn pod, nil\n}\n\nfunc getContainer(containers []corev1.Container, name string) (*corev1.Container, error) {\n\tfor _, c := range containers {\n\t\tif c.Name == name {\n\t\t\treturn &c, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"cannot find pod container with name %s\", name)\n}\n\nfunc restartableInitContainer(p *corev1.ContainerRestartPolicy) bool {\n\treturn p != nil && *p == corev1.ContainerRestartPolicyAlways\n}\n\nfunc (k *KubernetesDriver) waitPodDeleted(ctx context.Context, id string) error {\n\terr := k.client.Client().CoreV1().Pods(k.namespace).Delete(ctx, id, metav1.DeleteOptions{\n\t\tGracePeriodSeconds: &[]int64{10}[0],\n\t})\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn fmt.Errorf(\"delete pod: %w\", err)\n\t}\n\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, time.Minute*2, true, func(ctx context.Context) (bool, error) {\n\t\t_, err := k.client.Client().CoreV1().Pods(k.namespace).Get(ctx, id, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, nil\n\t})\n\tif err != nil {\n\t\treturn errors.New(\"timeout waiting for pod to be deleted\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/driver/types.go",
    "content": "package driver\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n)\n\n// Driver is the default interface for DevPod drivers\ntype Driver interface {\n\t// FindDevContainer returns a running devcontainer details\n\tFindDevContainer(ctx context.Context, workspaceID string) (*config.ContainerDetails, error)\n\n\t// CommandDevContainer runs the given command inside the devcontainer\n\tCommandDevContainer(ctx context.Context, workspaceID, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\n\t// RunDevContainer runs a devcontainer\n\tRunDevContainer(ctx context.Context, workspaceID string, options *RunOptions) error\n\n\t// TargetArchitecture returns the architecture of the container runtime. e.g. amd64 or arm64\n\tTargetArchitecture(ctx context.Context, workspaceID string) (string, error)\n\n\t// DeleteDevContainer deletes the devcontainer\n\tDeleteDevContainer(ctx context.Context, workspaceID string) error\n\n\t// StartDevContainer starts the devcontainer\n\tStartDevContainer(ctx context.Context, workspaceID string) error\n\n\t// StopDevContainer stops the devcontainer\n\tStopDevContainer(ctx context.Context, workspaceID string) error\n\n\t// GetContainerLogs returns the logs of the devcontainer\n\tGetDevContainerLogs(ctx context.Context, workspaceID string, stdout io.Writer, stderr io.Writer) error\n}\n\ntype ReprovisioningDriver interface {\n\tDriver\n\n\t// CanReprovision returns true if the driver can reprovision the devcontainer\n\tCanReprovision() bool\n}\n\n// RunOptions are the options for running a container\ntype RunOptions struct {\n\t// UID is a unique identifier for this workspace\n\tUID string `json:\"uid,omitempty\"`\n\n\t// Image is the image to run\n\tImage string `json:\"image,omitempty\"`\n\n\t// User is the user to run the container as\n\tUser string `json:\"user,omitempty\"`\n\n\t// Entrypoint is the entrypoint of the container\n\tEntrypoint string `json:\"entrypoint,omitempty\"`\n\n\t// Cmd are the cmd for the entrypoint\n\tCmd []string `json:\"cmd,omitempty\"`\n\n\t// Env are additional environment variables to set\n\tEnv map[string]string `json:\"env,omitempty\"`\n\n\t// CapAdd are additional capabilities for the container\n\tCapAdd []string `json:\"capAdd,omitempty\"`\n\n\t// SecurityOpt are additional security options\n\tSecurityOpt []string `json:\"securityOpt,omitempty\"`\n\n\t// Labels are labels to set on the container\n\tLabels []string `json:\"labels,omitempty\"`\n\n\t// Privileged indicates if the container should run with elevated permissions\n\tPrivileged *bool `json:\"privileged,omitempty\"`\n\n\t// WorkspaceMount is the mount where the workspace should get mounted\n\tWorkspaceMount *config.Mount `json:\"workspaceMount,omitempty\"`\n\n\t// Mounts are additional mounts on the container. Supported are volume and bind mounts.\n\t// Bind mounts are expected to get copied from local to remote once. Volume mounts are expected\n\t// to be persisted for the lifetime of the container.\n\tMounts []*config.Mount `json:\"mounts,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/encoding/encoding.go",
    "content": "package encoding\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/denisbrodbeck/machineid\"\n\t\"github.com/google/uuid\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\t// hashingKey is a random string used for hashing the UID.\n\t// It shouldn't be changed after the release.\n\thashingKey = \"2f1uR7n8ryzFEaAm87Ec\"\n)\n\nconst (\n\tWorkspaceUIDLength = 16\n\tMachineUIDLength   = 40\n)\n\nfunc CreateNewUID(context, id string) string {\n\t// this returns always a UID with length 16\n\tuid := strings.ReplaceAll(uuid.New().String()+uuid.New().String(), \"-\", \"\")\n\targs := []string{}\n\tif context != \"\" {\n\t\targs = append(args, context)\n\t}\n\tif id != \"\" {\n\t\targs = append(args, id)\n\t}\n\targs = append(args, uid)\n\treturn SafeConcatNameMax(args, WorkspaceUIDLength)\n}\n\nfunc CreateNewUIDShort(id string) string {\n\t// this returns always a UID with length 16\n\tuid := strings.ReplaceAll(uuid.New().String()+uuid.New().String(), \"-\", \"\")[0:5]\n\treturn SafeConcatNameMax([]string{id, uid}, WorkspaceUIDLength)\n}\n\nfunc IsLegacyUID(uid string) bool {\n\treturn len(uid) != WorkspaceUIDLength && len(uid) != MachineUIDLength\n}\n\nfunc SafeConcatNameMax(name []string, max int) string {\n\tfullPath := strings.Join(name, \"-\")\n\tif len(fullPath) > max {\n\t\tdigest := sha256.Sum256([]byte(fullPath))\n\t\tdigestEncoded := hex.EncodeToString(digest[0:])\n\t\ttrimmedPath := fullPath[0 : max-6]\n\t\tif strings.HasSuffix(trimmedPath, \"-\") {\n\t\t\ttrimmedPath += digestEncoded[0:6]\n\t\t} else {\n\t\t\ttrimmedPath += \"-\" + digestEncoded[0:5]\n\t\t}\n\n\t\treturn trimmedPath\n\t}\n\treturn fullPath\n}\n\nfunc GetMachineUIDShort(log log.Logger) string {\n\treturn GetMachineUID(log)[0:5]\n}\n\n// Gets machine ID and encodes it together with users $HOME path and extra key to protect privacy.\n// Returns a hex-encoded string.\nfunc GetMachineUID(log log.Logger) string {\n\tid, err := machineid.ID()\n\tif err != nil {\n\t\tid = \"error\"\n\t\tif log != nil {\n\t\t\tlog.Debugf(\"Error retrieving machine uid: %v\", err)\n\t\t}\n\t}\n\t// get $HOME to distinguish two users on the same machine\n\t// will be hashed later together with the ID\n\thome, err := util.UserHomeDir()\n\tif err != nil {\n\t\thome = \"error\"\n\t\tif log != nil {\n\t\t\tlog.Debugf(\"Error retrieving machine home: %v\", err)\n\t\t}\n\t}\n\tmac := hmac.New(sha256.New, []byte(id))\n\tmac.Write([]byte(hashingKey))\n\tmac.Write([]byte(home))\n\treturn fmt.Sprintf(\"%x\", mac.Sum(nil))\n}\n"
  },
  {
    "path": "pkg/encoding/encoding_test.go",
    "content": "package encoding\n\nimport (\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n)\n\ntype testCase struct {\n\tname string\n\tin   []string\n\tmax  int\n\n\texpected string\n}\n\nfunc Test(t *testing.T) {\n\ttestCases := []testCase{\n\t\t{\n\t\t\tname: \"simple\",\n\t\t\tin:   []string{\"test\", \"test2\", \"test3\"},\n\n\t\t\texpected: \"test-test2-test3\",\n\t\t},\n\t\t{\n\t\t\tname: \"minimal\",\n\t\t\tin:   []string{\"tes\", \"test2\", \"test3\"},\n\t\t\tmax:  10,\n\n\t\t\texpected: \"tes-0ce0f6\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tout := \"\"\n\t\tif testCase.max > 0 {\n\t\t\tout = SafeConcatNameMax(testCase.in, testCase.max)\n\t\t} else {\n\t\t\tout = SafeConcatNameMax(testCase.in, MachineUIDLength)\n\t\t}\n\n\t\tassert.Equal(t, testCase.expected, out, \"unequal in %s\", testCase.name)\n\t}\n}\n"
  },
  {
    "path": "pkg/envfile/envfile.go",
    "content": "package envfile\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\n\t\"github.com/loft-sh/log\"\n)\n\nvar location = \"/etc/envfile.json\"\n\ntype EnvFile struct {\n\t// Env holds the environment variables to set\n\tEnv map[string]string `json:\"env,omitempty\"`\n}\n\nfunc Apply(log log.Logger) {\n\tout, err := os.ReadFile(location)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\tlog.Debugf(\"Error reading envfile: %v\", err)\n\t\t}\n\n\t\treturn\n\t}\n\n\tenvFile := &EnvFile{}\n\terr = json.Unmarshal(out, envFile)\n\tif err != nil {\n\t\tlog.Debugf(\"Error parsing envfile: %v\", err)\n\t\treturn\n\t}\n\n\tfor k, v := range envFile.Env {\n\t\t_ = os.Setenv(k, v)\n\t}\n}\n\nfunc MergeAndApply(env map[string]string, log log.Logger) {\n\tif len(env) == 0 {\n\t\treturn\n\t}\n\n\tenvFile := &EnvFile{}\n\tout, err := os.ReadFile(location)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\tlog.Debugf(\"Error reading envfile: %v\", err)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\terr = json.Unmarshal(out, envFile)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error parsing envfile: %v\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif envFile.Env == nil {\n\t\tenvFile.Env = map[string]string{}\n\t}\n\tfor k, v := range env {\n\t\tenvFile.Env[k] = v\n\t}\n\n\tout, err = json.Marshal(envFile)\n\tif err != nil {\n\t\tlog.Debugf(\"Error marshalling envfile: %v\", err)\n\t\treturn\n\t}\n\n\terr = os.WriteFile(location, out, 0666)\n\tif err != nil {\n\t\tlog.Debugf(\"Error writing envfile: %v\", err)\n\t\treturn\n\t}\n\n\t// apply\n\tfor k, v := range envFile.Env {\n\t\t_ = os.Setenv(k, v)\n\t}\n}\n"
  },
  {
    "path": "pkg/extract/compress.go",
    "content": "package extract\n\nimport (\n\t\"archive/tar\"\n\t\"compress/gzip\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/pkg/errors\"\n)\n\nfunc WriteTarExclude(writer io.Writer, localPath string, compress bool, excludedPaths []string) error {\n\tabsolute, err := filepath.Abs(localPath)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"absolute\")\n\t}\n\n\t// Check if target is there\n\tstat, err := os.Stat(absolute)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stat\")\n\t}\n\n\t// Use compression\n\tgw := writer\n\tif compress {\n\t\tgwWriter := gzip.NewWriter(writer)\n\t\tdefer gwWriter.Close()\n\n\t\tgw = gwWriter\n\t}\n\n\t// Create tar writer\n\ttarWriter := tar.NewWriter(gw)\n\tdefer tarWriter.Close()\n\n\t// When its a file we copy the file to the toplevel of the tar\n\tif !stat.IsDir() {\n\t\treturn NewArchiver(filepath.Dir(absolute), tarWriter, excludedPaths).AddToArchive(filepath.Base(absolute))\n\t}\n\n\t// When its a folder we copy the contents and not the folder itself to the\n\t// toplevel of the tar\n\treturn NewArchiver(absolute, tarWriter, excludedPaths).AddToArchive(\"\")\n}\n\nfunc WriteTar(writer io.Writer, localPath string, compress bool) error {\n\treturn WriteTarExclude(writer, localPath, compress, nil)\n}\n\n// Archiver is responsible for compressing specific files and folders within a target directory\ntype Archiver struct {\n\tbasePath     string\n\twriter       *tar.Writer\n\twrittenFiles map[string]bool\n\n\texcludedPaths []string\n}\n\n// NewArchiver creates a new archiver\nfunc NewArchiver(basePath string, writer *tar.Writer, excludedPaths []string) *Archiver {\n\treturn &Archiver{\n\t\tbasePath:     basePath,\n\t\twriter:       writer,\n\t\twrittenFiles: map[string]bool{},\n\n\t\texcludedPaths: excludedPaths,\n\t}\n}\n\n// AddToArchive adds a new path to the archive\nfunc (a *Archiver) AddToArchive(relativePath string) error {\n\tif a.writtenFiles[relativePath] {\n\t\treturn nil\n\t}\n\n\t// We skip files that are suddenly not there anymore\n\tstat, err := os.Lstat(path.Join(a.basePath, relativePath))\n\tif err != nil {\n\t\t// config.Logf(\"[Upstream] Couldn't stat file %s: %s\\n\", absFilepath, err.Error())\n\t\treturn nil\n\t}\n\n\tif stat.IsDir() {\n\t\t// check if excluded\n\t\tif a.isExcluded(path.Clean(relativePath) + \"/\") {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Recursively tar folder\n\t\treturn a.tarFolder(relativePath, stat)\n\t}\n\n\t// check if excluded\n\tif a.isExcluded(path.Clean(relativePath)) {\n\t\treturn nil\n\t}\n\treturn a.tarFile(relativePath, stat)\n}\n\nfunc (a *Archiver) isExcluded(relativePath string) bool {\n\tfor _, excludePath := range a.excludedPaths {\n\t\tif strings.HasPrefix(relativePath, excludePath) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc (a *Archiver) tarFolder(target string, targetStat os.FileInfo) error {\n\tfilePath := path.Join(a.basePath, target)\n\tfiles, err := os.ReadDir(filePath)\n\tif err != nil {\n\t\t// config.Logf(\"[Upstream] Couldn't read dir %s: %s\\n\", filepath, err.Error())\n\t\treturn nil\n\t}\n\n\tif len(files) == 0 && target != \"\" {\n\t\t// Case empty directory\n\t\thdr, _ := tar.FileInfoHeader(targetStat, filePath)\n\t\thdr.Uid = 0\n\t\thdr.Gid = 0\n\t\thdr.Mode = fillGo18FileTypeBits(int64(chmodTarEntry(os.FileMode(hdr.Mode))), targetStat)\n\t\thdr.Name = target\n\t\tif err := a.writer.WriteHeader(hdr); err != nil {\n\t\t\treturn errors.Wrap(err, \"tar write header\")\n\t\t}\n\t\ta.writtenFiles[target] = true\n\t}\n\n\tfor _, dirEntry := range files {\n\t\tf, err := dirEntry.Info()\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err = a.AddToArchive(path.Join(target, f.Name())); err != nil {\n\t\t\treturn errors.Wrap(err, \"recursive tar \"+f.Name())\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (a *Archiver) tarFile(target string, targetStat os.FileInfo) error {\n\tvar err error\n\tfilepath := path.Join(a.basePath, target)\n\n\t// don't resolve symlinks\n\tlinkName := \"\"\n\tif targetStat.Mode()&os.ModeSymlink == os.ModeSymlink {\n\t\tlinkName, err = os.Readlink(filepath)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\thdr, err := tar.FileInfoHeader(targetStat, linkName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create tar file info header\")\n\t}\n\thdr.Name = target\n\thdr.Uid = 0\n\thdr.Gid = 0\n\thdr.Mode = fillGo18FileTypeBits(int64(chmodTarEntry(os.FileMode(hdr.Mode))), targetStat)\n\thdr.ModTime = time.Unix(targetStat.ModTime().Unix(), 0)\n\n\tif err := a.writer.WriteHeader(hdr); err != nil {\n\t\treturn errors.Wrap(err, \"tar write header\")\n\t}\n\n\t// nothing more to do for non-regular\n\tif !targetStat.Mode().IsRegular() {\n\t\ta.writtenFiles[target] = true\n\t\treturn nil\n\t}\n\n\t// Case regular file\n\tf, err := os.Open(filepath)\n\tif err != nil {\n\t\t// We ignore open file and just treat it as okay\n\t\treturn nil\n\t}\n\tdefer f.Close()\n\tcopied, err := io.CopyN(a.writer, f, targetStat.Size())\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"tar copy file\")\n\t} else if copied != targetStat.Size() {\n\t\treturn errors.New(\"tar: file truncated during read\")\n\t}\n\n\ta.writtenFiles[target] = true\n\treturn nil\n}\n\nconst (\n\tmodeISDIR  = 040000  // Directory\n\tmodeISFIFO = 010000  // FIFO\n\tmodeISREG  = 0100000 // Regular file\n\tmodeISLNK  = 0120000 // Symbolic link\n\tmodeISBLK  = 060000  // Block special file\n\tmodeISCHR  = 020000  // Character special file\n\tmodeISSOCK = 0140000 // Socket\n)\n\n// chmodTarEntry is used to adjust the file permissions used in tar header based\n// on the platform the archival is done.\nfunc chmodTarEntry(perm os.FileMode) os.FileMode {\n\tif runtime.GOOS != \"windows\" {\n\t\treturn perm\n\t}\n\n\t// perm &= 0755 // this 0-ed out tar flags (like link, regular file, directory marker etc.)\n\tpermPart := perm & os.ModePerm\n\tnoPermPart := perm &^ os.ModePerm\n\t// Add the x bit: make everything +x from windows\n\tpermPart |= 0111\n\tpermPart &= 0755\n\n\treturn noPermPart | permPart\n}\n\n// fillGo18FileTypeBits fills type bits which have been removed on Go 1.9 archive/tar\n// https://github.com/golang/go/commit/66b5a2f\nfunc fillGo18FileTypeBits(mode int64, fi os.FileInfo) int64 {\n\tfm := fi.Mode()\n\tswitch {\n\tcase fm.IsRegular():\n\t\tmode |= modeISREG\n\tcase fi.IsDir():\n\t\tmode |= modeISDIR\n\tcase fm&os.ModeSymlink != 0:\n\t\tmode |= modeISLNK\n\tcase fm&os.ModeDevice != 0:\n\t\tif fm&os.ModeCharDevice != 0 {\n\t\t\tmode |= modeISCHR\n\t\t} else {\n\t\t\tmode |= modeISBLK\n\t\t}\n\tcase fm&os.ModeNamedPipe != 0:\n\t\tmode |= modeISFIFO\n\tcase fm&os.ModeSocket != 0:\n\t\tmode |= modeISSOCK\n\t}\n\treturn mode\n}\n"
  },
  {
    "path": "pkg/extract/extract.go",
    "content": "package extract\n\nimport (\n\t\"archive/tar\"\n\t\"bufio\"\n\t\"compress/gzip\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\t\"time\"\n\n\tperrors \"github.com/pkg/errors\"\n)\n\ntype Options struct {\n\tStripLevels int\n\n\tPerm *os.FileMode\n\tUID  *int\n\tGID  *int\n}\n\ntype Option func(o *Options)\n\nfunc StripLevels(levels int) Option {\n\treturn func(o *Options) {\n\t\to.StripLevels = levels\n\t}\n}\n\nfunc Extract(origReader io.Reader, destFolder string, options ...Option) error {\n\textractOptions := &Options{}\n\tfor _, o := range options {\n\t\to(extractOptions)\n\t}\n\n\t// read ahead\n\tbufioReader := bufio.NewReaderSize(origReader, 1024*1024)\n\ttestBytes, err := bufioReader.Peek(2) // read 2 bytes\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// is gzipped?\n\tvar reader io.Reader\n\tif testBytes[0] == 31 && testBytes[1] == 139 {\n\t\tgzipReader, err := gzip.NewReader(bufioReader)\n\t\tif err != nil {\n\t\t\treturn perrors.Errorf(\"error decompressing: %v\", err)\n\t\t}\n\t\tdefer gzipReader.Close()\n\n\t\treader = gzipReader\n\t} else {\n\t\treader = bufioReader\n\t}\n\n\ttarReader := tar.NewReader(reader)\n\tfor {\n\t\tshouldContinue, err := extractNext(tarReader, destFolder, extractOptions)\n\t\tif err != nil {\n\t\t\treturn perrors.Wrap(err, \"decompress\")\n\t\t} else if !shouldContinue {\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\nfunc extractNext(tarReader *tar.Reader, destFolder string, options *Options) (bool, error) {\n\theader, err := tarReader.Next()\n\tif err != nil {\n\t\tif !errors.Is(err, io.EOF) {\n\t\t\treturn false, perrors.Wrap(err, \"tar reader next\")\n\t\t}\n\n\t\treturn false, nil\n\t}\n\n\trelativePath := getRelativeFromFullPath(\"/\"+header.Name, \"\")\n\tif options.StripLevels > 0 {\n\t\tfor i := 0; i < options.StripLevels; i++ {\n\t\t\trelativePath = strings.TrimPrefix(relativePath, \"/\")\n\t\t\tindex := strings.Index(relativePath, \"/\")\n\t\t\tif index == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\trelativePath = relativePath[index+1:]\n\t\t}\n\n\t\trelativePath = \"/\" + relativePath\n\t}\n\toutFileName := path.Join(destFolder, relativePath)\n\tbaseName := path.Dir(outFileName)\n\n\tdirPerm := os.ModePerm\n\tif options.Perm != nil {\n\t\tdirPerm = *options.Perm\n\t}\n\n\t// Check if newer file is there and then don't override?\n\tif err := os.MkdirAll(baseName, dirPerm); err != nil {\n\t\treturn false, err\n\t}\n\n\t// whats the file perm?\n\tfilePerm := os.FileMode(0644)\n\tif options.Perm != nil {\n\t\tfilePerm = *options.Perm\n\t}\n\n\t// Is dir?\n\tif header.Typeflag == tar.TypeDir {\n\t\tif err := os.MkdirAll(outFileName, dirPerm); err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn true, nil\n\t} else if header.Typeflag == tar.TypeSymlink {\n\t\terr := os.Symlink(header.Linkname, outFileName)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn true, nil\n\t} else if header.Typeflag == tar.TypeLink {\n\t\terr := os.Link(header.Linkname, outFileName)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn true, nil\n\t}\n\n\t// Create / Override file\n\toutFile, err := os.OpenFile(outFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, filePerm)\n\tif err != nil {\n\t\t// Try again after 5 seconds\n\t\ttime.Sleep(time.Second * 5)\n\t\toutFile, err = os.OpenFile(outFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, filePerm)\n\t\tif err != nil {\n\t\t\treturn false, perrors.Wrapf(err, \"create %s\", outFileName)\n\t\t}\n\t}\n\tdefer outFile.Close()\n\n\tif _, err := io.Copy(outFile, tarReader); err != nil {\n\t\treturn false, perrors.Wrapf(err, \"io copy tar reader %s\", outFileName)\n\t}\n\tif err := outFile.Close(); err != nil {\n\t\treturn false, perrors.Wrapf(err, \"out file close %s\", outFileName)\n\t}\n\n\t// Set permissions\n\tif options.Perm == nil {\n\t\t_ = os.Chmod(outFileName, header.FileInfo().Mode()|0600)\n\t}\n\n\t// Set mod time from tar header\n\t_ = os.Chtimes(outFileName, time.Now(), header.FileInfo().ModTime())\n\n\treturn true, nil\n}\n\nfunc getRelativeFromFullPath(fullpath string, prefix string) string {\n\treturn strings.TrimPrefix(strings.ReplaceAll(strings.ReplaceAll(fullpath[len(prefix):], \"\\\\\", \"/\"), \"//\", \"/\"), \".\")\n}\n"
  },
  {
    "path": "pkg/extract/zip.go",
    "content": "package extract\n\nimport (\n\t\"archive/zip\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nfunc UnzipFolder(source, destination string) error {\n\t// 1. Open the zip file\n\treader, err := zip.OpenReader(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer reader.Close()\n\n\t// 2. Get the absolute destination path\n\tdestination, err = filepath.Abs(destination)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// 3. Iterate over zip files inside the archive and unzip each of them\n\tfor _, f := range reader.File {\n\t\terr := unzipFile(f, destination)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc unzipFile(f *zip.File, destination string) error {\n\t// 4. Check if file paths are not vulnerable to Zip Slip\n\tfilePath := filepath.Join(destination, f.Name)\n\tif !strings.HasPrefix(filePath, filepath.Clean(destination)+string(os.PathSeparator)) {\n\t\treturn fmt.Errorf(\"invalid file path: %s\", filePath)\n\t}\n\n\t// 5. Create directory tree\n\tif f.FileInfo().IsDir() {\n\t\tif err := os.MkdirAll(filePath, os.ModePerm); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\tif err := os.MkdirAll(filepath.Dir(filePath), os.ModePerm); err != nil {\n\t\treturn err\n\t}\n\n\t// 6. Create a destination file for unzipped content\n\tdestinationFile, err := os.OpenFile(filePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer destinationFile.Close()\n\n\t// 7. Unzip the content of a file and copy it to the destination file\n\tzippedFile, err := f.Open()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer zippedFile.Close()\n\n\tif _, err := io.Copy(destinationFile, zippedFile); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/file/file.go",
    "content": "package file\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc Chown(userName string, target string) error {\n\treturn chown(userName, target)\n}\n\nfunc MkdirAll(userName string, dir string, perm os.FileMode) error {\n\t_, err := os.Stat(dir)\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\terr = os.MkdirAll(dir, perm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn chown(userName, dir)\n}\n\nfunc IsLocalDir(name string) (bool, string) {\n\t_, err := os.Stat(name)\n\tif err == nil {\n\t\tabsPath, _ := filepath.Abs(name)\n\t\tif absPath != \"\" {\n\t\t\treturn true, absPath\n\t\t}\n\t}\n\n\treturn false, name\n}\n"
  },
  {
    "path": "pkg/file/file_supported.go",
    "content": "//go:build linux || darwin || unix\n\npackage file\n\nimport (\n\t\"os\"\n\t\"os/user\"\n\t\"strconv\"\n)\n\nfunc chown(userName string, target string) error {\n\tif userName == \"\" {\n\t\treturn nil\n\t}\n\n\tu, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuid, _ := strconv.ParseInt(u.Uid, 10, 64)\n\tgid, _ := strconv.ParseInt(u.Gid, 10, 64)\n\tif uid < 0 {\n\t\treturn nil\n\t}\n\tif gid < 0 {\n\t\tgid = 0\n\t}\n\n\treturn os.Chown(target, int(uid), int(gid))\n}\n"
  },
  {
    "path": "pkg/file/file_unsupported.go",
    "content": "//go:build windows\n\npackage file\n\nfunc chown(userName string, target string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/git/clone.go",
    "content": "package git\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/pflag\"\n)\n\ntype CloneStrategy string\n\nconst (\n\tFullCloneStrategy     CloneStrategy = \"\"\n\tBloblessCloneStrategy CloneStrategy = \"blobless\"\n\tTreelessCloneStrategy CloneStrategy = \"treeless\"\n\tShallowCloneStrategy  CloneStrategy = \"shallow\"\n\tBareCloneStrategy     CloneStrategy = \"bare\"\n)\n\ntype Cloner interface {\n\tClone(ctx context.Context, repository string, targetDir string, extraArgs, extraEnv []string, log log.Logger) error\n}\n\ntype Option func(*cloner)\n\nfunc WithCloneStrategy(strategy CloneStrategy) Option {\n\treturn func(c *cloner) {\n\t\tif strategy == \"\" {\n\t\t\tstrategy = FullCloneStrategy\n\t\t}\n\t\tc.cloneStrategy = strategy\n\t}\n}\n\nfunc WithRecursiveSubmodules() Option {\n\treturn func(c *cloner) {\n\t\tc.extraArgs = append(c.extraArgs, \"--recurse-submodules\")\n\t}\n}\n\nfunc WithSkipLFS() Option {\n\treturn func(c *cloner) {\n\t\tc.skipLFS = true\n\t}\n}\n\nfunc NewClonerWithOpts(options ...Option) Cloner {\n\tcloner := &cloner{\n\t\tcloneStrategy: FullCloneStrategy,\n\t}\n\tfor _, opt := range options {\n\t\topt(cloner)\n\t}\n\treturn cloner\n}\n\nfunc NewCloner(strategy CloneStrategy) Cloner {\n\treturn NewClonerWithOpts(WithCloneStrategy(strategy))\n}\n\nvar _ pflag.Value = (*CloneStrategy)(nil)\n\nfunc (s *CloneStrategy) Set(v string) error {\n\tswitch v {\n\tcase string(FullCloneStrategy),\n\t\tstring(BloblessCloneStrategy),\n\t\tstring(TreelessCloneStrategy),\n\t\tstring(ShallowCloneStrategy),\n\t\tstring(BareCloneStrategy):\n\t\t{\n\t\t\t*s = CloneStrategy(v)\n\t\t\treturn nil\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"CloneStrategy %s not supported\", v)\n\t}\n}\n\nfunc (s *CloneStrategy) Type() string {\n\treturn \"cloneStrategy\"\n}\n\nfunc (s *CloneStrategy) String() string {\n\treturn string(*s)\n}\n\ntype cloner struct {\n\textraArgs     []string\n\tcloneStrategy CloneStrategy\n\tskipLFS       bool\n}\n\nvar _ Cloner = &cloner{}\n\nfunc (c *cloner) initialArgs() []string {\n\tswitch c.cloneStrategy {\n\tcase BloblessCloneStrategy:\n\t\treturn []string{\"clone\", \"--filter=blob:none\"}\n\tcase TreelessCloneStrategy:\n\t\treturn []string{\"clone\", \"--filter=tree:0\"}\n\tcase ShallowCloneStrategy:\n\t\treturn []string{\"clone\", \"--depth=1\"}\n\tcase BareCloneStrategy:\n\t\treturn []string{\"clone\", \"--bare\", \"--depth=1\"}\n\tcase FullCloneStrategy:\n\tdefault:\n\t}\n\treturn []string{\"clone\"}\n}\n\ntype progressWriter struct {\n\tlevel logrus.Level\n\tlog   log.Logger\n}\n\nfunc (w *progressWriter) Write(p []byte) (n int, err error) {\n\treturn w.log.WriteLevel(w.level, p)\n}\n\nfunc (c *cloner) Clone(ctx context.Context, repository string, targetDir string, extraArgs, extraEnv []string, log log.Logger) error {\n\targs := c.initialArgs()\n\targs = append(args, extraArgs...)\n\targs = append(args, c.extraArgs...)\n\targs = append(args, repository, targetDir)\n\targs = append(args, \"--progress\")\n\n\tif c.skipLFS {\n\t\textraEnv = append(extraEnv, \"GIT_LFS_SKIP_SMUDGE=1\")\n\t}\n\n\tw := &progressWriter{log: log, level: logrus.InfoLevel}\n\tgitCommand := CommandContext(ctx, extraEnv, args...)\n\tgitCommand.Stdout = w\n\tgitCommand.Stderr = w\n\n\treturn gitCommand.Run()\n}\n"
  },
  {
    "path": "pkg/git/git.go",
    "content": "package git\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tCommitDelimiter      string = \"@sha256:\"\n\tPullRequestReference string = \"pull/([0-9]+)/head\"\n\tSubPathDelimiter     string = \"@subpath:\"\n)\n\n// WARN: Make sure this matches the regex in /desktop/src/views/Workspaces/CreateWorkspace/CreateWorkspaceInput.tsx!\nvar (\n\t// Updated regex pattern to support SSH-style Git URLs\n\trepoBaseRegEx    = `((?:(?:https?|git|ssh|file):\\/\\/)?\\/?(?:[^@\\/\\n]+@)?(?:[^:\\/\\n]+)(?:[:\\/][^\\/\\n]+)+(?:\\.git)?)`\n\tbranchRegEx      = regexp.MustCompile(`^` + repoBaseRegEx + `@([a-zA-Z0-9\\./\\-\\_]+)$`)\n\tcommitRegEx      = regexp.MustCompile(`^` + repoBaseRegEx + regexp.QuoteMeta(CommitDelimiter) + `([a-zA-Z0-9]+)$`)\n\tprReferenceRegEx = regexp.MustCompile(`^` + repoBaseRegEx + `@(` + PullRequestReference + `)$`)\n\tsubPathRegEx     = regexp.MustCompile(`^` + repoBaseRegEx + regexp.QuoteMeta(SubPathDelimiter) + `([a-zA-Z0-9\\./\\-\\_]+)$`)\n)\n\nfunc NormalizeRepository(str string) (string, string, string, string, string) {\n\tif !strings.HasPrefix(str, \"ssh://\") &&\n\t\t!strings.HasPrefix(str, \"git@\") &&\n\t\t!strings.HasPrefix(str, \"http://\") &&\n\t\t!strings.HasPrefix(str, \"https://\") &&\n\t\t!strings.HasPrefix(str, \"file://\") {\n\t\tstr = \"https://\" + str\n\t}\n\n\t// resolve pull request reference\n\tprReference := \"\"\n\tif match := prReferenceRegEx.FindStringSubmatch(str); match != nil {\n\t\tstr = match[1]\n\t\tprReference = match[2]\n\n\t\treturn str, prReference, \"\", \"\", \"\"\n\t}\n\n\t// resolve subpath\n\tsubpath := \"\"\n\tif match := subPathRegEx.FindStringSubmatch(str); match != nil {\n\t\tstr = match[1]\n\t\tsubpath = strings.TrimSuffix(match[2], \"/\")\n\t}\n\n\t// resolve branch\n\tbranch := \"\"\n\tif match := branchRegEx.FindStringSubmatch(str); match != nil {\n\t\tstr = match[1]\n\t\tbranch = match[2]\n\t}\n\n\t// resolve commit hash\n\tcommit := \"\"\n\tif match := commitRegEx.FindStringSubmatch(str); match != nil {\n\t\tstr = match[1]\n\t\tcommit = match[2]\n\t}\n\n\treturn str, prReference, branch, commit, subpath\n}\n\nfunc CommandContext(ctx context.Context, extraEnv []string, args ...string) *exec.Cmd {\n\tcmd := exec.CommandContext(ctx, \"git\", args...)\n\tcmd.Env = append(os.Environ(), extraEnv...)\n\treturn cmd\n}\n\nfunc PingRepository(str string, extraEnv []string) bool {\n\tif !command.Exists(\"git\") {\n\t\treturn false\n\t}\n\n\ttimeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*10)\n\tdefer cancel()\n\n\t_, err := CommandContext(timeoutCtx, extraEnv, \"ls-remote\", \"--quiet\", str).CombinedOutput()\n\treturn err == nil\n}\n\nfunc GetBranchNameForPR(ref string) string {\n\tregex := regexp.MustCompile(PullRequestReference)\n\treturn regex.ReplaceAllString(ref, \"PR${1}\")\n}\n\nfunc GetIDForPR(ref string) string {\n\tregex := regexp.MustCompile(PullRequestReference)\n\treturn regex.ReplaceAllString(ref, \"pr${1}\")\n}\n\ntype GitInfo struct {\n\tRepository string\n\tBranch     string\n\tCommit     string\n\tPR         string\n\tSubPath    string\n}\n\nfunc NewGitInfo(repository, branch, commit, pr, subpath string) *GitInfo {\n\treturn &GitInfo{\n\t\tRepository: repository,\n\t\tBranch:     branch,\n\t\tCommit:     commit,\n\t\tPR:         pr,\n\t\tSubPath:    subpath,\n\t}\n}\n\nfunc NormalizeRepositoryGitInfo(str string) *GitInfo {\n\trepository, pr, branch, commit, subpath := NormalizeRepository(str)\n\treturn NewGitInfo(repository, branch, commit, pr, subpath)\n}\n\nfunc CloneRepository(ctx context.Context, gitInfo *GitInfo, targetDir string, helper string, strictHostKeyChecking bool, log log.Logger, cloneOptions ...Option) error {\n\treturn CloneRepositoryWithEnv(ctx, gitInfo, nil, targetDir, helper, strictHostKeyChecking, log, cloneOptions...)\n}\n\nfunc GetDefaultExtraEnv(strictHostKeyChecking bool) []string {\n\tnewExtraEnv := []string{\"GIT_TERMINAL_PROMPT=0\"}\n\tsshArgs := \"GIT_SSH_COMMAND=ssh -oBatchMode=yes -oStrictHostKeyChecking=\"\n\tif strictHostKeyChecking {\n\t\tsshArgs += \"yes\"\n\t} else {\n\t\tsshArgs += \"no\"\n\t}\n\treturn append(newExtraEnv, sshArgs)\n}\n\nfunc CloneRepositoryWithEnv(ctx context.Context, gitInfo *GitInfo, extraEnv []string, targetDir string, helper string, strictHostKeyChecking bool, log log.Logger, cloneOptions ...Option) error {\n\tcloner := NewClonerWithOpts(cloneOptions...)\n\n\t// make sure to append the extra env so that they override existing env vars if set\n\textraEnv = append(GetDefaultExtraEnv(strictHostKeyChecking), extraEnv...)\n\n\textraArgs := []string{}\n\tif helper != \"\" {\n\t\textraArgs = append(extraArgs, \"--config\", \"credential.helper=\"+helper)\n\t}\n\n\tif gitInfo.Branch != \"\" {\n\t\textraArgs = append(extraArgs, \"--branch\", gitInfo.Branch)\n\t}\n\n\tif err := cloner.Clone(ctx, gitInfo.Repository, targetDir, extraArgs, extraEnv, log); err != nil {\n\t\treturn err\n\t}\n\n\tif gitInfo.PR != \"\" {\n\t\treturn checkoutPR(ctx, gitInfo, extraEnv, targetDir, log)\n\t}\n\n\tif gitInfo.Commit != \"\" {\n\t\treturn checkoutCommit(ctx, gitInfo, extraEnv, targetDir, log)\n\t}\n\n\treturn nil\n}\n\nfunc checkoutPR(ctx context.Context, gitInfo *GitInfo, extraEnv []string, targetDir string, log log.Logger) error {\n\tlog.Debugf(\"Fetching pull request : %s\", gitInfo.PR)\n\n\tprBranch := GetBranchNameForPR(gitInfo.PR)\n\n\t// Try to fetch the pull request by\n\t// checking out the reference GitHub set up for it. Afterwards, switch to it.\n\t// See [this doc](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally#modifying-an-inactive-pull-request-locally)\n\t// Command args: `git fetch origin pull/996/head:PR996`\n\tfetchArgs := []string{\"fetch\", \"origin\", gitInfo.PR + \":\" + prBranch}\n\tfetchCmd := CommandContext(ctx, extraEnv, fetchArgs...)\n\tfetchCmd.Dir = targetDir\n\tif err := fetchCmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"fetch pull request reference: %w\", err)\n\t}\n\n\t// git switch PR996\n\tswitchArgs := []string{\"switch\", prBranch}\n\tswitchCmd := CommandContext(ctx, extraEnv, switchArgs...)\n\tswitchCmd.Dir = targetDir\n\tif err := switchCmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"switch to branch: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc checkoutCommit(ctx context.Context, gitInfo *GitInfo, extraEnv []string, targetDir string, log log.Logger) error {\n\tstdout := log.Writer(logrus.InfoLevel, false)\n\tstderr := log.Writer(logrus.ErrorLevel, false)\n\tdefer stdout.Close()\n\tdefer stderr.Close()\n\n\targs := []string{\"reset\", \"--hard\", gitInfo.Commit}\n\tgitCommand := CommandContext(ctx, extraEnv, args...)\n\tgitCommand.Dir = targetDir\n\tgitCommand.Stdout = stdout\n\tgitCommand.Stderr = stderr\n\tif err := gitCommand.Run(); err != nil {\n\t\treturn fmt.Errorf(\"reset head to commit: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/git/git_test.go",
    "content": "package git\n\nimport (\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n\t\"gotest.tools/assert/cmp\"\n)\n\ntype testCaseNormalizeRepository struct {\n\tin                  string\n\texpectedPRReference string\n\texpectedRepo        string\n\texpectedBranch      string\n\texpectedCommit      string\n\texpectedSubpath     string\n}\n\ntype testCaseGetBranchNameForPR struct {\n\tin             string\n\texpectedBranch string\n}\n\nfunc TestNormalizeRepository(t *testing.T) {\n\ttestCases := []testCaseNormalizeRepository{\n\t\t{\n\t\t\tin:                  \"ssh://github.com/loft-sh/devpod.git\",\n\t\t\texpectedRepo:        \"ssh://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"ssh://git@github.com/loft-sh/devpod.git\",\n\t\t\texpectedRepo:        \"ssh://git@github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod-without-branch.git\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod-without-branch.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod.git\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod.git@test-branch\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"test-branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod-with-branch.git@test-branch\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod-with-branch.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"test-branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod-with-branch.git@test_branch\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod-with-branch.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"test_branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"ssh://git@github.com:loft-sh/devpod.git@test_branch\",\n\t\t\texpectedRepo:        \"ssh://git@github.com:loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"test_branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod-without-protocol-with-slash.git@user/branch\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod-without-protocol-with-slash.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"user/branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod-with-slash.git@user/branch\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod-with-slash.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"user/branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod.git@sha256:905ffb0\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"905ffb0\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod.git@sha256:905ffb0\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"905ffb0\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod.git@pull/996/head\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"pull/996/head\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@github.com:loft-sh/devpod.git@pull/996/head\",\n\t\t\texpectedRepo:        \"git@github.com:loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"pull/996/head\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod-without-protocol-with-slash.git@subpath:/test/path\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod-without-protocol-with-slash.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"/test/path\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"github.com/loft-sh/devpod-without-protocol-with-slash.git@subpath:/test/path/\",\n\t\t\texpectedRepo:        \"https://github.com/loft-sh/devpod-without-protocol-with-slash.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"/test/path\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"https://my_prefix@github.com/loft-sh/devpod.git@test-branch\",\n\t\t\texpectedRepo:        \"https://my_prefix@github.com/loft-sh/devpod.git\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"test-branch\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"https://test@dev.azure.com/org/project/_git/repo@dev\",\n\t\t\texpectedRepo:        \"https://test@dev.azure.com/org/project/_git/repo\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"dev\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"https://test@dev.azure.com/org/project/_git/repo@sha256:905ffb0\",\n\t\t\texpectedRepo:        \"https://test@dev.azure.com/org/project/_git/repo\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"905ffb0\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"git@ssh.dev.azure.com:v3/org/project/repo@dev\",\n\t\t\texpectedRepo:        \"git@ssh.dev.azure.com:v3/org/project/repo\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"dev\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"file:///workspace/projects/project\",\n\t\t\texpectedRepo:        \"file:///workspace/projects/project\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"file:///workspace/projects/project@dev\",\n\t\t\texpectedRepo:        \"file:///workspace/projects/project\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"dev\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"file:///workspace/projects/project@sha256:905ffb0\",\n\t\t\texpectedRepo:        \"file:///workspace/projects/project\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"905ffb0\",\n\t\t\texpectedSubpath:     \"\",\n\t\t},\n\t\t{\n\t\t\tin:                  \"file:///workspace/projects/project@subpath:/test/path\",\n\t\t\texpectedRepo:        \"file:///workspace/projects/project\",\n\t\t\texpectedPRReference: \"\",\n\t\t\texpectedBranch:      \"\",\n\t\t\texpectedCommit:      \"\",\n\t\t\texpectedSubpath:     \"/test/path\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\toutRepo, outPRReference, outBranch, outCommit, outSubpath := NormalizeRepository(testCase.in)\n\t\tassert.Check(t, cmp.Equal(testCase.expectedRepo, outRepo))\n\t\tassert.Check(t, cmp.Equal(testCase.expectedPRReference, outPRReference))\n\t\tassert.Check(t, cmp.Equal(testCase.expectedBranch, outBranch))\n\t\tassert.Check(t, cmp.Equal(testCase.expectedCommit, outCommit))\n\t\tassert.Check(t, cmp.Equal(testCase.expectedSubpath, outSubpath))\n\t}\n}\n\nfunc TestGetBranchNameForPRReference(t *testing.T) {\n\ttestCases := []testCaseGetBranchNameForPR{\n\t\t{\n\t\t\tin:             \"pull/996/head\",\n\t\t\texpectedBranch: \"PR996\",\n\t\t},\n\t\t{\n\t\t\tin:             \"pull/abc/head\",\n\t\t\texpectedBranch: \"pull/abc/head\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\toutBranch := GetBranchNameForPR(testCase.in)\n\t\tassert.Check(t, cmp.Equal(testCase.expectedBranch, outBranch))\n\t}\n}\n"
  },
  {
    "path": "pkg/git/install.go",
    "content": "package git\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc InstallBinary(log log.Logger) error {\n\twriter := log.Writer(logrus.InfoLevel, false)\n\terrwriter := log.Writer(logrus.ErrorLevel, false)\n\tdefer writer.Close()\n\tdefer errwriter.Close()\n\n\t// try to install git via apt / apk\n\tif !command.Exists(\"apt\") && !command.Exists(\"apk\") {\n\t\t// TODO: use golang git implementation\n\t\treturn fmt.Errorf(\"couldn't find a package manager to install git\")\n\t}\n\n\tif command.Exists(\"apt\") {\n\t\tlog.Infof(\"Git command is missing, try to install git with apt...\")\n\t\tcmd := exec.Command(\"apt\", \"update\")\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\terr := cmd.Run()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"run apt update\")\n\t\t}\n\t\tcmd = exec.Command(\"apt\", \"-y\", \"install\", \"git\")\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\terr = cmd.Run()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"run apt install git -y\")\n\t\t}\n\t} else if command.Exists(\"apk\") {\n\t\tlog.Infof(\"Git command is missing, try to install git with apk...\")\n\t\tcmd := exec.Command(\"apk\", \"update\")\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\terr := cmd.Run()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"run apk update\")\n\t\t}\n\t\tcmd = exec.Command(\"apk\", \"add\", \"git\")\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\terr = cmd.Run()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"run apk add git\")\n\t\t}\n\t}\n\n\t// is git available now?\n\tif !command.Exists(\"git\") {\n\t\treturn fmt.Errorf(\"couldn't install git\")\n\t}\n\n\tlog.Donef(\"Successfully installed git\")\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/gitcredentials/gitcredentials.go",
    "content": "package gitcredentials\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tnetUrl \"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/pkg/errors\"\n)\n\ntype GitCredentials struct {\n\tProtocol string `json:\"protocol,omitempty\"`\n\tURL      string `json:\"url,omitempty\"`\n\tHost     string `json:\"host,omitempty\"`\n\tPath     string `json:\"path,omitempty\"`\n\tUsername string `json:\"username,omitempty\"`\n\tPassword string `json:\"password,omitempty\"`\n}\n\ntype GitUser struct {\n\tName  string `json:\"name,omitempty\"`\n\tEmail string `json:\"email,omitempty\"`\n}\n\nfunc ConfigureHelper(binaryPath, userName string, port int) error {\n\tgitConfigPath, err := getGlobalGitConfigPath(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := os.ReadFile(gitConfigPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\thelper := fmt.Sprintf(`helper = !'%s' agent git-credentials`, binaryPath)\n\tif port != -1 {\n\t\thelper += fmt.Sprintf(` --port %d`, port)\n\t}\n\n\tconfig := string(out)\n\tif !strings.Contains(config, helper) {\n\t\tcontent := removeCredentialHelper(config) + fmt.Sprintf(`\n[credential]\n        %s\n`, helper)\n\n\t\terr = os.WriteFile(gitConfigPath, []byte(content), 0600)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"write git config\")\n\t\t}\n\n\t\terr = file.Chown(userName, gitConfigPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc RemoveHelper(userName string) error {\n\tgitConfigPath, err := getGlobalGitConfigPath(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn RemoveHelperFromPath(gitConfigPath)\n}\n\nfunc RemoveHelperFromPath(gitConfigPath string) error {\n\tout, err := os.ReadFile(gitConfigPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif strings.Contains(string(out), \"[credential]\") {\n\t\terr = os.WriteFile(gitConfigPath, []byte(removeCredentialHelper(string(out))), 0600)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"write git config\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc Parse(raw string) (*GitCredentials, error) {\n\tcredentials := &GitCredentials{}\n\tlines := strings.Split(raw, \"\\n\")\n\tfor _, line := range lines {\n\t\tline = strings.TrimSpace(line)\n\t\tsplitted := strings.Split(line, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif splitted[0] == \"protocol\" {\n\t\t\tcredentials.Protocol = strings.Join(splitted[1:], \"=\")\n\t\t} else if splitted[0] == \"host\" {\n\t\t\tcredentials.Host = strings.Join(splitted[1:], \"=\")\n\t\t} else if splitted[0] == \"username\" {\n\t\t\tcredentials.Username = strings.Join(splitted[1:], \"=\")\n\t\t} else if splitted[0] == \"password\" {\n\t\t\tcredentials.Password = strings.Join(splitted[1:], \"=\")\n\t\t} else if splitted[0] == \"url\" {\n\t\t\tcredentials.URL = strings.Join(splitted[1:], \"=\")\n\t\t} else if splitted[0] == \"path\" {\n\t\t\tcredentials.Path = strings.Join(splitted[1:], \"=\")\n\t\t}\n\t}\n\n\treturn credentials, nil\n}\n\nfunc ToString(credentials *GitCredentials) string {\n\trequest := []string{}\n\tif credentials.Protocol != \"\" {\n\t\trequest = append(request, \"protocol=\"+credentials.Protocol)\n\t}\n\tif credentials.URL != \"\" {\n\t\trequest = append(request, \"url=\"+credentials.URL)\n\t}\n\tif credentials.Path != \"\" {\n\t\trequest = append(request, \"path=\"+credentials.Path)\n\t}\n\tif credentials.Host != \"\" {\n\t\trequest = append(request, \"host=\"+credentials.Host)\n\t}\n\tif credentials.Username != \"\" {\n\t\trequest = append(request, \"username=\"+credentials.Username)\n\t}\n\tif credentials.Password != \"\" {\n\t\trequest = append(request, \"password=\"+credentials.Password)\n\t}\n\n\treturn strings.Join(request, \"\\n\") + \"\\n\"\n}\n\nfunc SetUser(userName string, user *GitUser) error {\n\tif user.Name != \"\" {\n\t\tshellCommand := fmt.Sprintf(`git config --global user.name \"%s\"`, user.Name)\n\t\targs := []string{}\n\t\tif userName != \"\" {\n\t\t\targs = append(args, \"su\", userName, \"-c\", shellCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", shellCommand)\n\t\t}\n\n\t\tout, err := exec.Command(args[0], args[1:]...).CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"set user.name '%s': %w\", strings.Join(args, \" \"), command.WrapCommandError(out, err))\n\t\t}\n\t}\n\tif user.Email != \"\" {\n\t\tshellCommand := fmt.Sprintf(`git config --global user.email \"%s\"`, user.Email)\n\t\targs := []string{}\n\t\tif userName != \"\" {\n\t\t\targs = append(args, \"su\", userName, \"-c\", shellCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", shellCommand)\n\t\t}\n\n\t\tout, err := exec.Command(args[0], args[1:]...).CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"set user.email '%s': %w\", strings.Join(args, \" \"), command.WrapCommandError(out, err))\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc GetUser(userName string) (*GitUser, error) {\n\tgitUser := &GitUser{}\n\n\tscopeArgs := []string{\"config\"}\n\tif userName != \"\" {\n\t\tp, err := getGlobalGitConfigPath(userName)\n\t\tif err != nil {\n\t\t\treturn gitUser, fmt.Errorf(\"get git global dir for %s: %w\", userName, err)\n\t\t}\n\t\tscopeArgs = append(scopeArgs, \"--file\", p)\n\t} else {\n\t\tscopeArgs = append(scopeArgs, \"--global\")\n\t}\n\n\t// we ignore the error here, because if email is empty we don't care\n\tname, _ := exec.Command(\"git\", append(scopeArgs[:], \"user.name\")...).Output()\n\tgitUser.Name = strings.TrimSpace(string(name))\n\n\temail, _ := exec.Command(\"git\", append(scopeArgs[:], \"user.email\")...).Output()\n\tgitUser.Email = strings.TrimSpace(string(email))\n\n\treturn gitUser, nil\n}\n\nfunc GetCredentials(requestObj *GitCredentials) (*GitCredentials, error) {\n\t// run in git helper mode if we have a port\n\tgitHelperPort := os.Getenv(\"DEVPOD_GIT_HELPER_PORT\")\n\tif gitHelperPort != \"\" {\n\t\tbinaryPath, err := os.Executable()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tc := exec.Command(binaryPath, \"agent\", \"git-credentials\", \"--port\", gitHelperPort, \"get\")\n\n\t\tc.Stdin = strings.NewReader(ToString(requestObj))\n\t\tstdout, err := c.Output()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn Parse(string(stdout))\n\t}\n\n\t// use local credentials if not\n\tc := git.CommandContext(context.TODO(), git.GetDefaultExtraEnv(false), \"credential\", \"fill\")\n\tc.Stdin = strings.NewReader(ToString(requestObj))\n\tstdout, err := c.Output()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Parse(string(stdout))\n}\n\ntype GetHttpPathParameters struct {\n\tHost        string\n\tProtocol    string\n\tCurrentPath string\n\tRepository  string\n}\n\n// GetHTTPPath checks for gits `credential.useHttpPath` setting for a given host+protocol and returns the path component\n// of `GitCredential` if the setting is true\nfunc GetHTTPPath(ctx context.Context, params GetHttpPathParameters) (string, error) {\n\t// No need to look up the HTTP Path if we already have one\n\tif params.CurrentPath != \"\" {\n\t\treturn params.CurrentPath, nil\n\t}\n\n\t// Check if we need to respect gits `credential.useHttpPath`\n\t// The actual format for the key is `credential.$PROTOCOL://$HOST.useHttpPath`, i.e. `credential.https://github.com.useHttpPath`\n\t// We need to ignore the error as git will always exit with 1 if the key doesn't exist\n\tconfigKey := fmt.Sprintf(\"credential.%s://%s.useHttpPath\", params.Protocol, params.Host)\n\tout, _ := git.CommandContext(ctx, git.GetDefaultExtraEnv(false), \"config\", \"--get\", configKey).Output()\n\tif strings.TrimSpace(string(out)) != \"true\" {\n\t\treturn \"\", nil\n\t}\n\t// We can assume the GitRepository is always HTTP(S) based as otherwise we wouldn't\n\t// request credentials for it\n\turl, err := netUrl.Parse(params.Repository)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"parse workspace repository: %w\", err)\n\t}\n\n\treturn url.Path, nil\n}\n\nfunc SetupGpgGitKey(gitSignKey string) error {\n\tgitConfigCmd := exec.Command(\"git\", []string{\"config\", \"--global\", \"user.signingKey\", gitSignKey}...)\n\n\tout, err := gitConfigCmd.Output()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"git signkey: \"+string(out))\n\t}\n\n\treturn nil\n}\n\nfunc removeCredentialHelper(content string) string {\n\tscan := scanner.NewScanner(strings.NewReader(content))\n\n\tisCredential := false\n\tout := []string{}\n\tfor scan.Scan() {\n\t\tline := scan.Text()\n\t\tif strings.TrimSpace(line) == \"[credential]\" {\n\t\t\tisCredential = true\n\t\t\tcontinue\n\t\t} else if isCredential {\n\t\t\ttrimmed := strings.TrimSpace(line)\n\t\t\tif len(trimmed) > 0 && trimmed[0] == '[' {\n\t\t\t\tisCredential = false\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tout = append(out, line)\n\t}\n\n\treturn strings.Join(out, \"\\n\")\n}\n\n// getGlobalGitConfigPath resolves the global git config for the specified user according to\n// https://git-scm.com/docs/git-config/#Documentation/git-config.txt-XDGCONFIGHOMEgitconfig\nfunc getGlobalGitConfigPath(userName string) (string, error) {\n\tif xdgConfigHome := os.Getenv(\"XDG_CONFIG_HOME\"); xdgConfigHome != \"\" {\n\t\treturn filepath.Join(xdgConfigHome, \"git\", \"config\"), nil\n\t}\n\n\thome, err := command.GetHome(userName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get homedir for %s: %w\", userName, err)\n\t}\n\n\treturn filepath.Join(home, \".gitconfig\"), nil\n}\n\n// GetLocalGitConfigPath resolves the local git config for the specified repository path\nfunc GetLocalGitConfigPath(repoPath string) string {\n\treturn filepath.Join(repoPath, \".git\", \"config\")\n}\n"
  },
  {
    "path": "pkg/gitsshsigning/client.go",
    "content": "package gitsshsigning\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/log\"\n)\n\n// HandleGitSSHProgramCall implements logic handling call from git when signing a commit\nfunc HandleGitSSHProgramCall(certPath, namespace, bufferFile string, log log.Logger) error {\n\tcontent, err := extractContentFromGitBuffer(bufferFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsignature, err := requestContentSignature(content, certPath, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := writeSignatureToFile(signature, bufferFile, log); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// extractContentFromGitBuffer reads the content from the buffer file created by git\nfunc extractContentFromGitBuffer(bufferFile string) ([]byte, error) {\n\treturn os.ReadFile(bufferFile)\n}\n\n// requestContentSignature sends an HTTP request to the credentials server to sign the content\nfunc requestContentSignature(content []byte, certPath string, log log.Logger) ([]byte, error) {\n\trequestBody, err := createSignatureRequestBody(content, certPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponseBody, err := sendSignatureRequest(requestBody, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn parseSignatureResponse(responseBody, log)\n}\n\n// writeSignatureToFile writes the signed content to a .sig file\nfunc writeSignatureToFile(signature []byte, bufferFile string, log log.Logger) error {\n\tsigFile := bufferFile + \".sig\"\n\tif err := os.WriteFile(sigFile, signature, 0644); err != nil {\n\t\tlog.Errorf(\"Failed to write signature to file: %w\", err)\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc createSignatureRequestBody(content []byte, certPath string) ([]byte, error) {\n\trequest := &GitSSHSignatureRequest{\n\t\tContent: string(content),\n\t\tKeyPath: certPath,\n\t}\n\treturn json.Marshal(request)\n}\n\nfunc sendSignatureRequest(requestBody []byte, log log.Logger) ([]byte, error) {\n\tport, err := credentials.GetPort()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse, err := devpodhttp.GetHTTPClient().Post(\n\t\t\"http://localhost:\"+strconv.Itoa(port)+\"/git-ssh-signature\", // TODO: build the url, don't hardcode localhost\n\t\t\"application/json\",\n\t\tbytes.NewReader(requestBody),\n\t)\n\tif err != nil {\n\t\tlog.Errorf(\"Error retrieving git ssh signature: %w\", err)\n\t\treturn nil, err\n\t}\n\tdefer response.Body.Close()\n\n\treturn io.ReadAll(response.Body)\n}\n\nfunc parseSignatureResponse(responseBody []byte, log log.Logger) ([]byte, error) {\n\tsignatureResponse := &GitSSHSignatureResponse{}\n\tif err := json.Unmarshal(responseBody, signatureResponse); err != nil {\n\t\tlog.Errorf(\"Error decoding git ssh signature: %w\", err)\n\t\treturn nil, err\n\t}\n\n\treturn signatureResponse.Signature, nil\n}\n"
  },
  {
    "path": "pkg/gitsshsigning/helper.go",
    "content": "package gitsshsigning\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/pkg/errors\"\n)\n\nconst (\n\tHelperScript = `#!/bin/bash\n\ndevpod agent git-ssh-signature \"$@\"\n`\n\tHelperScriptPath  = \"/usr/local/bin/devpod-ssh-signature\"\n\tGitConfigTemplate = `\n[gpg \"ssh\"]\n\tprogram = devpod-ssh-signature\n[gpg]\n\tformat = ssh\n[user]\n\tsigningkey = %s\n`\n)\n\n// ConfigureHelper sets up the Git SSH signing helper script and updates the Git configuration for the specified user.\n//\n// This function:\n// - sets user.signingkey git config\n// - creates a wrapper script for calling git-ssh-signature\n// - users this script as gpg.ssh.program\n// This is needed since git expects `gpg.ssh.program` to be an executable.\nfunc ConfigureHelper(userName, gitSigningKey string, log log.Logger) error {\n\tlog.Debug(\"Creating helper script\")\n\tif err := createHelperScript(); err != nil {\n\t\treturn err\n\t}\n\tlog.Debugf(\"Helper script created. Making it executable.\")\n\tif err := makeScriptExecutable(); err != nil {\n\t\treturn err\n\t}\n\tlog.Debugf(\"Script executable. Getting config path.\")\n\tgitConfigPath, err := getGitConfigPath(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Debugf(\"Got config path: %v\", gitConfigPath)\n\tif err := updateGitConfig(gitConfigPath, userName, gitSigningKey); err != nil {\n\t\tlog.Errorf(\"Failed updating git configuration: %w\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// RemoveHelper removes the git SSH signing helper script and any related configuration.\nfunc RemoveHelper(userName string) error {\n\tif err := os.Remove(HelperScriptPath); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tgitConfigPath, err := getGitConfigPath(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := removeGitConfigHelper(gitConfigPath, userName); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc createHelperScript() error {\n\t// we do it this way instead of os.Create because we need sudo\n\tcmd := exec.Command(\"sudo\", \"bash\", \"-c\", fmt.Sprintf(\"echo '%s' > %s\", HelperScript, HelperScriptPath))\n\tif err := cmd.Run(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc makeScriptExecutable() error {\n\treturn exec.Command(\"sudo\", \"chmod\", \"+x\", HelperScriptPath).Run()\n}\n\nfunc getGitConfigPath(userName string) (string, error) {\n\thomeDir, err := command.GetHome(userName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.Join(homeDir, \".gitconfig\"), nil\n}\n\nfunc updateGitConfig(gitConfigPath, userName, gitSigningKey string) error {\n\tconfigContent, err := readGitConfig(gitConfigPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !strings.Contains(configContent, \"program = devpod-ssh-signature\") {\n\t\tnewConfig := fmt.Sprintf(GitConfigTemplate, gitSigningKey)\n\t\tnewContent := removeSignatureHelper(configContent) + newConfig\n\t\tif err := writeGitConfig(gitConfigPath, newContent, userName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc readGitConfig(gitConfigPath string) (string, error) {\n\tout, err := os.ReadFile(gitConfigPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn \"\", err\n\t}\n\treturn string(out), nil\n}\n\nfunc writeGitConfig(gitConfigPath, content, userName string) error {\n\tif err := os.WriteFile(gitConfigPath, []byte(content), 0600); err != nil {\n\t\treturn errors.Wrap(err, \"write git config\")\n\t}\n\treturn file.Chown(userName, gitConfigPath)\n}\n\nfunc removeGitConfigHelper(gitConfigPath, userName string) error {\n\tconfigContent, err := readGitConfig(gitConfigPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnewContent := removeSignatureHelper(configContent)\n\tif err := writeGitConfig(gitConfigPath, newContent, userName); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc removeSignatureHelper(content string) string {\n\tscan := scanner.NewScanner(strings.NewReader(content))\n\tisGpgSetup := false\n\tout := []string{}\n\n\tfor scan.Scan() {\n\t\tline := scan.Text()\n\t\tif strings.TrimSpace(line) == \"[gpg \\\"ssh\\\"]\" {\n\t\t\tisGpgSetup = true\n\t\t\tcontinue\n\t\t} else if strings.TrimSpace(line) == \"[gpg]\" {\n\t\t\tisGpgSetup = true\n\t\t} else if isGpgSetup {\n\t\t\ttrimmed := strings.TrimSpace(line)\n\t\t\tif len(trimmed) > 0 && trimmed[0] == '[' {\n\t\t\t\tisGpgSetup = false\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tout = append(out, line)\n\t}\n\n\treturn strings.Join(out, \"\\n\")\n}\n"
  },
  {
    "path": "pkg/gitsshsigning/server.go",
    "content": "package gitsshsigning\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os/exec\"\n)\n\ntype GitSSHSignatureRequest struct {\n\tContent string\n\tKeyPath string\n}\n\ntype GitSSHSignatureResponse struct {\n\tSignature []byte\n}\n\n// Sign signs the content using the private key and returns the signature.\n// This is intended to be a drop-in replacement for gpg.ssh.program for git,\n// so we simply execute ssh-keygen in the same way as git would do locally.\nfunc (req *GitSSHSignatureRequest) Sign() (*GitSSHSignatureResponse, error) {\n\t// Create a buffer to store the commit content\n\tvar commitBuffer bytes.Buffer\n\tcommitBuffer.WriteString(req.Content)\n\n\t// Create the command to run ssh-keygen\n\tcmd := exec.Command(\"ssh-keygen\", \"-Y\", \"sign\", \"-f\", req.KeyPath, \"-n\", \"git\")\n\tcmd.Stdin = &commitBuffer\n\n\t// Capture the output of the command\n\tvar out bytes.Buffer\n\tvar stderr bytes.Buffer\n\tcmd.Stdout = &out\n\tcmd.Stderr = &stderr\n\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to sign commit: %w, stderr: %s\", err, stderr.String())\n\t}\n\n\treturn &GitSSHSignatureResponse{\n\t\tSignature: out.Bytes(),\n\t}, nil\n}\n"
  },
  {
    "path": "pkg/gitsshsigning/utils.go",
    "content": "package gitsshsigning\n\nimport (\n\t\"os/exec\"\n\t\"strings\"\n)\n\nconst (\n\tGPGFormatConfigKey       = \"gpg.format\"\n\tUsersSigningKeyConfigKey = \"user.signingkey\"\n\tGPGFormatSSH             = \"ssh\"\n)\n\n// ExtractGitConfiguration is used for extracting values from users local .gitconfig\n// that are needed to setup devpod-ssh-signature helper inside the workspace.\nfunc ExtractGitConfiguration() (string, string, error) {\n\tformat, err := readGitConfigValue(GPGFormatConfigKey)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tsigningKey, err := readGitConfigValue(UsersSigningKeyConfigKey)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\treturn format, signingKey, nil\n}\n\nfunc readGitConfigValue(key string) (string, error) {\n\tcmd := exec.Command(\"git\", \"config\", \"--get\", key)\n\toutput, err := cmd.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(string(output)), nil\n}\n"
  },
  {
    "path": "pkg/gpg/gpg_forwarding.go",
    "content": "package gpg\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log\"\n\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype GPGConf struct {\n\tPublicKey  []byte\n\tOwnerTrust []byte\n\tSocketPath string\n\tGitKey     string\n}\n\nfunc IsGpgTunnelRunning(\n\tuser string,\n\tctx context.Context,\n\tclient *ssh.Client,\n\tlog log.Logger,\n) bool {\n\twriter := log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\tdefer writer.Close()\n\n\tcommand := \"gpg -K\"\n\tif user != \"\" && user != \"root\" {\n\t\tcommand = fmt.Sprintf(\"su -c \\\"%s\\\" '%s'\", command, user)\n\t}\n\n\t// capture the output, if it's empty it means we don't have gpg-forwarding\n\tvar out bytes.Buffer\n\terr := devssh.Run(ctx, client, command, nil, &out, writer, nil)\n\n\treturn err == nil && len(out.Bytes()) > 1\n}\n\nfunc GetHostPubKey() ([]byte, error) {\n\treturn exec.Command(\"gpg\", \"--armor\", \"--export\").Output()\n}\n\nfunc GetHostOwnerTrust() ([]byte, error) {\n\treturn exec.Command(\"gpg\", \"--export-ownertrust\").Output()\n}\n\nfunc (g *GPGConf) StopGpgAgent() error {\n\treturn exec.Command(\"gpgconf\", []string{\"--kill\", \"gpg-agent\"}...).Run()\n}\n\nfunc (g *GPGConf) ImportGpgKey() error {\n\tgpgImportCmd := exec.Command(\"gpg\", \"--import\")\n\n\tstdin, err := gpgImportCmd.StdinPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tdefer stdin.Close()\n\t\t_, _ = stdin.Write(g.PublicKey)\n\t}()\n\n\tout, err := gpgImportCmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"import gpg public key: %s %w\", out, err)\n\t}\n\n\treturn nil\n}\n\nfunc (g *GPGConf) ImportOwnerTrust() error {\n\tgpgOwnerTrustCmd := exec.Command(\"gpg\", \"--import-ownertrust\")\n\n\tstdin, err := gpgOwnerTrustCmd.StdinPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tdefer stdin.Close()\n\t\t_, _ = stdin.Write(g.OwnerTrust)\n\t}()\n\n\treturn gpgOwnerTrustCmd.Run()\n}\n\nfunc (g *GPGConf) SetupGpgConf() error {\n\t_, err := os.Stat(g.getConfigPath())\n\tif err != nil {\n\t\t_, err = os.Create(g.getConfigPath())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tgpgConfig, err := os.ReadFile(g.getConfigPath())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !strings.Contains(string(gpgConfig), \"use-agent\") {\n\t\tf, err := os.OpenFile(g.getConfigPath(),\n\t\t\tos.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o600)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer f.Close()\n\n\t\tif _, err := f.WriteString(\"use-agent\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (g *GPGConf) SetupRemoteSocketDirTree() error {\n\terr := exec.Command(\"sudo\", \"mkdir\", \"-p\", \"/run/user\", filepath.Dir(g.SocketPath)).Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn exec.Command(\"sudo\",\n\t\t\"chown\",\n\t\t\"-R\",\n\t\tstrconv.Itoa(os.Getuid())+\":\"+strconv.Itoa(os.Getgid()),\n\t\t\"/run/user\",\n\t\tfilepath.Dir(g.SocketPath),\n\t\tg.SocketPath,\n\t).Run()\n}\n\n// This function will normalize the location of the forwarded socket.\n// the forwarding that happens in pkg/ssh/forward.go will forward the socket in\n// the same path (eg. /Users/foo/.gnupg/S.gpg-agent)\n// This function will use hardlinks to normalize it to where linux usually\n// expects the socket to be.\nfunc (g *GPGConf) SetupRemoteSocketLink() error {\n\terr := os.MkdirAll(filepath.Join(os.Getenv(\"HOME\"), \".gnupg\"), 0o700)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = exec.Command(\"sudo\", \"ln\", \"-s\", \"-f\", g.SocketPath, \"/tmp/S.gpg-agent\").Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsymlinks := []string{\n\t\tfilepath.Join(os.Getenv(\"HOME\"), \".gnupg\", \"S.gpg-agent\"),\n\t\t\"/run/user/\" + strconv.Itoa(os.Getuid()) + \"/gnupg/S.gpg-agent\",\n\t}\n\n\tfor _, link := range symlinks {\n\t\t_ = os.Remove(link)\n\t\t_ = os.MkdirAll(filepath.Dir(link), 0o755)\n\n\t\terr = os.Symlink(\"/tmp/S.gpg-agent\", link)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (g *GPGConf) getConfigPath() string {\n\treturn filepath.Join(os.Getenv(\"HOME\"), \".gnupg\", \"gpg.conf\")\n}\n"
  },
  {
    "path": "pkg/http/http.go",
    "content": "package http\n\nimport (\n\t\"crypto/tls\"\n\t\"net/http\"\n\t\"sync\"\n)\n\nvar httpClient *http.Client\nvar httpClientOnce sync.Once\n\nfunc GetHTTPClient() *http.Client {\n\thttpClientOnce.Do(func() {\n\t\tcustomTransport := http.DefaultTransport.(*http.Transport).Clone()\n\t\tcustomTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}\n\t\thttpClient = &http.Client{Transport: customTransport}\n\t})\n\n\treturn httpClient\n}\n"
  },
  {
    "path": "pkg/id/id.go",
    "content": "package id\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar dockerImageNameRegEx = regexp.MustCompile(`[^a-z0-9\\-_]+`)\n\nfunc SafeConcatName(name ...string) string {\n\treturn SafeConcatNameMax(name, 63)\n}\n\nfunc SafeConcatNameMax(name []string, max int) string {\n\tfullPath := strings.Join(name, \"-\")\n\tif len(fullPath) > max {\n\t\tdigest := sha256.Sum256([]byte(fullPath))\n\t\treturn strings.ReplaceAll(fullPath[0:max-8]+\"-\"+hex.EncodeToString(digest[0:])[0:7], \".-\", \"-\")\n\t}\n\treturn fullPath\n}\n\nfunc ToDockerImageName(name string) string {\n\tname = strings.ToLower(name)\n\tname = dockerImageNameRegEx.ReplaceAllString(name, \"\")\n\treturn name\n}\n"
  },
  {
    "path": "pkg/ide/fleet/fleet.go",
    "content": "package fleet\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tcopy2 \"github.com/loft-sh/devpod/pkg/copy\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/pkg/errors\"\n)\n\nconst (\n\tFleetURLFile = \"/tmp/devpod-fleet.url.txt\"\n)\n\nconst (\n\tVersionOption       = \"VERSION\"\n\tDownloadAmd64Option = \"DOWNLOAD_AMD64\"\n\tDownloadArm64Option = \"DOWNLOAD_ARM64\"\n)\n\nvar Options = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version of fleet to install\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 install script\",\n\t\tDefault:     \"https://download.jetbrains.com/product?code=FLL&release.type=preview&release.type=eap&platform=linux_aarch64\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 install script\",\n\t\tDefault:     \"https://download.jetbrains.com/product?code=FLL&release.type=preview&release.type=eap&platform=linux_x64\",\n\t},\n}\n\nfunc NewFleetServer(userName string, values map[string]config.OptionValue, log log.Logger) *FleetServer {\n\treturn &FleetServer{\n\t\tvalues:   values,\n\t\tuserName: userName,\n\t\tlog:      log,\n\t}\n}\n\ntype FleetServer struct {\n\tvalues   map[string]config.OptionValue\n\tuserName string\n\tlog      log.Logger\n}\n\nfunc (o *FleetServer) Install(projectDir string) error {\n\tlocation, err := prepareFleetServerLocation(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// is installed\n\tfleetBinary := filepath.Join(location, \"fleet\")\n\t_, err = os.Stat(fleetBinary)\n\tif err == nil {\n\t\treturn o.Start(fleetBinary, location, projectDir)\n\t}\n\n\t// check what release we need to download\n\tvar url string\n\tif runtime.GOARCH == \"arm64\" {\n\t\turl = Options.GetValue(o.values, DownloadArm64Option)\n\t} else {\n\t\turl = Options.GetValue(o.values, DownloadAmd64Option)\n\t}\n\n\t// download binary\n\to.log.Infof(\"Downloading fleet...\")\n\tresp, err := devpodhttp.GetHTTPClient().Get(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"unexpected status code while trying to download fleet from %s: %d\", url, resp.StatusCode)\n\t}\n\n\tf, err := os.OpenFile(fleetBinary, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\t_, err = io.Copy(f, resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"download fleet: %w\", err)\n\t}\n\t_ = f.Close()\n\n\t// chown location\n\tif o.userName != \"\" {\n\t\terr = copy2.ChownR(location, o.userName)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"chown\")\n\t\t}\n\t}\n\n\to.log.Infof(\"Successfully downloaded fleet...\")\n\treturn o.Start(fleetBinary, location, projectDir)\n}\n\nfunc (o *FleetServer) Start(binaryPath, location, projectDir string) error {\n\twasStarted := false\n\tvar readCloser io.ReadCloser\n\tstderrBuffer := &bytes.Buffer{}\n\n\terr := single.Single(\"fleet.pid\", func() (*exec.Cmd, error) {\n\t\to.log.Infof(\"Starting fleet in background...\")\n\t\t// Determine version of fleet to use\n\t\tvar runCommand string\n\t\tversion := Options.GetValue(o.values, VersionOption)\n\t\tif version == \"latest\" {\n\t\t\trunCommand = fmt.Sprintf(\n\t\t\t\t\"%s launch workspace -- --projectDir '%s' --cache-path '%s' --auth=accept-everyone --publish --enableSmartMode\",\n\t\t\t\tbinaryPath, projectDir, location,\n\t\t\t)\n\t\t} else {\n\t\t\trunCommand = fmt.Sprintf(\n\t\t\t\t\"%s launch workspace --workspace-version %s -- --projectDir '%s' --cache-path '%s' --auth=accept-everyone --publish --enableSmartMode\",\n\t\t\t\tbinaryPath, version, projectDir, location,\n\t\t\t)\n\t\t}\n\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Dir = location\n\t\tvar err error\n\t\treadCloser, err = cmd.StdoutPipe()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcmd.Stderr = stderrBuffer\n\t\twasStarted = true\n\t\treturn cmd, nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t} else if !wasStarted {\n\t\treturn nil\n\t}\n\tdefer readCloser.Close()\n\n\t// wait for the jet brains url and then exit\n\to.log.Infof(\"Waiting for fleet to start...\")\n\ts := scanner.NewScanner(readCloser)\n\tstdoutBuffer := &bytes.Buffer{}\n\tfor s.Scan() {\n\t\ttext := s.Text()\n\t\tif strings.Contains(text, \"https://fleet.jetbrains.com/\") {\n\t\t\tindex := strings.Index(text, \"https://fleet.jetbrains.com/\")\n\t\t\terr = os.WriteFile(FleetURLFile, []byte(strings.TrimSpace(text[index:])), 0600)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\to.log.Infof(\"Fleet has successfully started\")\n\t\t\treturn o.startMonitor()\n\t\t} else {\n\t\t\t_, _ = stdoutBuffer.Write([]byte(text + \"\\n\"))\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"seems like there was an error starting up fleet: %s%s\", stdoutBuffer.String(), stderrBuffer.String())\n}\n\nfunc (o *FleetServer) startMonitor() error {\n\tself, err := os.Executable()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn single.Single(\"fleet-monitor.pid\", func() (*exec.Cmd, error) {\n\t\to.log.Infof(\"Starting fleet monitor in background...\")\n\t\trunCommand := fmt.Sprintf(\"%s helper fleet-server --workspaceid %s\", self, \"test\")\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\treturn cmd, nil\n\t})\n}\n\nfunc prepareFleetServerLocation(userName string) (string, error) {\n\tvar err error\n\thomeFolder := \"\"\n\tif userName != \"\" {\n\t\thomeFolder, err = command.GetHome(userName)\n\t} else {\n\t\thomeFolder, err = util.UserHomeDir()\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfolder := filepath.Join(homeFolder, \".fleet-server\")\n\terr = os.MkdirAll(folder, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn folder, nil\n}\n"
  },
  {
    "path": "pkg/ide/ideparse/parse.go",
    "content": "package ideparse\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/ide/fleet\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jetbrains\"\n\t\"github.com/loft-sh/devpod/pkg/ide/jupyter\"\n\t\"github.com/loft-sh/devpod/pkg/ide/openvscode\"\n\t\"github.com/loft-sh/devpod/pkg/ide/rstudio\"\n\t\"github.com/loft-sh/devpod/pkg/ide/vscode\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/pkg/errors\"\n)\n\ntype AllowedIDE struct {\n\t// Name of the IDE\n\tName config.IDE `json:\"name,omitempty\"`\n\t// DisplayName is the name to show to the user\n\tDisplayName string `json:\"displayName,omitempty\"`\n\t// Options of the IDE\n\tOptions ide.Options `json:\"options,omitempty\"`\n\t// Icon holds an image URL that will be displayed\n\tIcon string `json:\"icon,omitempty\"`\n\t// IconDark holds an image URL that will be displayed in dark mode\n\tIconDark string `json:\"iconDark,omitempty\"`\n\t// Experimental indicates that this IDE is experimental\n\tExperimental bool `json:\"experimental,omitempty\"`\n\t// Group this IDE belongs to, e.g. for navigation\n\tGroup config.IDEGroup `json:\"group,omitempty\"`\n}\n\nvar AllowedIDEs = []AllowedIDE{\n\t{\n\t\tName:        config.IDENone,\n\t\tDisplayName: \"None\",\n\t\tOptions:     map[string]ide.Option{},\n\t\tIcon:        \"https://devpod.sh/assets/none.svg\",\n\t\tIconDark:    \"https://devpod.sh/assets/none_dark.svg\",\n\t\tGroup:       config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:        config.IDEVSCode,\n\t\tDisplayName: \"VSCode\",\n\t\tOptions:     vscode.Options,\n\t\tIcon:        \"https://devpod.sh/assets/vscode.svg\",\n\t\tGroup:       config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:        config.IDEOpenVSCode,\n\t\tDisplayName: \"VSCode Browser\",\n\t\tOptions:     openvscode.Options,\n\t\tIcon:        \"https://devpod.sh/assets/vscodebrowser.svg\",\n\t\tGroup:       config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:         config.IDECursor,\n\t\tDisplayName:  \"Cursor\",\n\t\tOptions:      vscode.Options,\n\t\tIcon:         \"https://devpod.sh/assets/cursor.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:         config.IDEZed,\n\t\tDisplayName:  \"Zed\",\n\t\tOptions:      ide.Options{},\n\t\tIcon:         \"https://devpod.sh/assets/zed.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:         config.IDECodium,\n\t\tDisplayName:  \"Codium\",\n\t\tOptions:      vscode.Options,\n\t\tIcon:         \"https://devpod.sh/assets/codium.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupPrimary,\n\t},\n\t{\n\t\tName:        config.IDEIntellij,\n\t\tDisplayName: \"Intellij\",\n\t\tOptions:     jetbrains.IntellijOptions,\n\t\tIcon:        \"https://devpod.sh/assets/intellij.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDEPyCharm,\n\t\tDisplayName: \"PyCharm\",\n\t\tOptions:     jetbrains.PyCharmOptions,\n\t\tIcon:        \"https://devpod.sh/assets/pycharm.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDEPhpStorm,\n\t\tDisplayName: \"PhpStorm\",\n\t\tOptions:     jetbrains.PhpStormOptions,\n\t\tIcon:        \"https://devpod.sh/assets/phpstorm.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDERider,\n\t\tDisplayName: \"Rider\",\n\t\tOptions:     jetbrains.RiderOptions,\n\t\tIcon:        \"https://devpod.sh/assets/rider.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:         config.IDEFleet,\n\t\tDisplayName:  \"Fleet\",\n\t\tOptions:      fleet.Options,\n\t\tIcon:         \"https://devpod.sh/assets/fleet.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDEGoland,\n\t\tDisplayName: \"Goland\",\n\t\tOptions:     jetbrains.GolandOptions,\n\t\tIcon:        \"https://devpod.sh/assets/goland.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDEWebStorm,\n\t\tDisplayName: \"WebStorm\",\n\t\tOptions:     jetbrains.WebStormOptions,\n\t\tIcon:        \"https://devpod.sh/assets/webstorm.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDERustRover,\n\t\tDisplayName: \"RustRover\",\n\t\tOptions:     jetbrains.RustRoverOptions,\n\t\tIcon:        \"https://devpod.sh/assets/rustrover.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDERubyMine,\n\t\tDisplayName: \"RubyMine\",\n\t\tOptions:     jetbrains.RubyMineOptions,\n\t\tIcon:        \"https://devpod.sh/assets/rubymine.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDECLion,\n\t\tDisplayName: \"CLion\",\n\t\tOptions:     jetbrains.CLionOptions,\n\t\tIcon:        \"https://devpod.sh/assets/clion.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:        config.IDEDataSpell,\n\t\tDisplayName: \"DataSpell\",\n\t\tOptions:     jetbrains.DataSpellOptions,\n\t\tIcon:        \"https://devpod.sh/assets/dataspell.svg\",\n\t\tGroup:       config.IDEGroupJetBrains,\n\t},\n\t{\n\t\tName:         config.IDEJupyterNotebook,\n\t\tDisplayName:  \"Jupyter Notebook\",\n\t\tOptions:      jupyter.Options,\n\t\tIcon:         \"https://devpod.sh/assets/jupyter.svg\",\n\t\tIconDark:     \"https://devpod.sh/assets/jupyter_dark.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupOther,\n\t},\n\t{\n\t\tName:         config.IDEVSCodeInsiders,\n\t\tDisplayName:  \"VSCode Insiders\",\n\t\tOptions:      vscode.Options,\n\t\tIcon:         \"https://devpod.sh/assets/vscode_insiders.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupOther,\n\t},\n\t{\n\t\tName:         config.IDEPositron,\n\t\tDisplayName:  \"Positron\",\n\t\tOptions:      vscode.Options,\n\t\tIcon:         \"https://devpod.sh/assets/positron.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupOther,\n\t},\n\t{\n\t\tName:         config.IDERStudio,\n\t\tDisplayName:  \"RStudio Server\",\n\t\tOptions:      rstudio.Options,\n\t\tIcon:         \"https://devpod.sh/assets/rstudio.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupOther,\n\t},\n\t{\n\t\tName:         config.IDEWindsurf,\n\t\tDisplayName:  \"Windsurf\",\n\t\tOptions:      vscode.Options,\n\t\tIcon:         \"https://devpod.sh/assets/windsurf.svg\",\n\t\tExperimental: true,\n\t\tGroup:        config.IDEGroupPrimary,\n\t},\n}\n\nfunc RefreshIDEOptions(devPodConfig *config.Config, workspace *provider.Workspace, ide string, options []string) (*provider.Workspace, error) {\n\tide = strings.ToLower(ide)\n\tif ide == \"\" {\n\t\tif workspace.IDE.Name != \"\" {\n\t\t\tide = workspace.IDE.Name\n\t\t} else if devPodConfig.Current().DefaultIDE != \"\" {\n\t\t\tide = devPodConfig.Current().DefaultIDE\n\t\t} else {\n\t\t\tide = detect()\n\t\t}\n\t}\n\n\t// get ide options\n\tideOptions, err := GetIDEOptions(ide)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// get global options and set them as non user\n\t// provided.\n\tretValues := devPodConfig.IDEOptions(ide)\n\tfor k, v := range retValues {\n\t\tretValues[k] = config.OptionValue{\n\t\t\tValue: v.Value,\n\t\t}\n\t}\n\n\t// get existing options\n\tif ide == workspace.IDE.Name {\n\t\tfor k, v := range workspace.IDE.Options {\n\t\t\tif !v.UserProvided {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tretValues[k] = v\n\t\t}\n\t}\n\n\t// get user options\n\tvalues, err := ParseOptions(options, ideOptions)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse options\")\n\t}\n\tfor k, v := range values {\n\t\tretValues[k] = v\n\t}\n\n\t// check if we need to modify workspace\n\tif workspace.IDE.Name != ide || !reflect.DeepEqual(workspace.IDE.Options, retValues) {\n\t\tworkspace.IDE.Name = ide\n\t\tworkspace.IDE.Options = retValues\n\t\terr = provider.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"save workspace\")\n\t\t}\n\t}\n\n\treturn workspace, nil\n}\n\nfunc GetIDEOptions(ide string) (ide.Options, error) {\n\tvar match *AllowedIDE\n\tfor _, m := range AllowedIDEs {\n\t\tm := m\n\t\tif string(m.Name) == ide {\n\t\t\tmatch = &m\n\t\t\tbreak\n\t\t}\n\t}\n\tif match == nil {\n\t\tallowedIDEArray := []string{}\n\t\tfor _, a := range AllowedIDEs {\n\t\t\tallowedIDEArray = append(allowedIDEArray, string(a.Name))\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"unrecognized ide '%s', please use one of: %v\", ide, allowedIDEArray)\n\t}\n\n\treturn match.Options, nil\n}\n\nfunc ParseOptions(options []string, ideOptions ide.Options) (map[string]config.OptionValue, error) {\n\tif ideOptions == nil {\n\t\tideOptions = ide.Options{}\n\t}\n\n\tallowedOptions := []string{}\n\tfor optionName := range ideOptions {\n\t\tallowedOptions = append(allowedOptions, optionName)\n\t}\n\n\tretMap := map[string]config.OptionValue{}\n\tfor _, option := range options {\n\t\tsplitted := strings.Split(option, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\treturn nil, fmt.Errorf(\"invalid option '%s', expected format KEY=VALUE\", option)\n\t\t}\n\n\t\tkey := strings.ToUpper(strings.TrimSpace(splitted[0]))\n\t\tvalue := strings.Join(splitted[1:], \"=\")\n\t\tideOption, ok := ideOptions[key]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid option '%s', allowed options are: %v\", key, allowedOptions)\n\t\t}\n\n\t\tif ideOption.ValidationPattern != \"\" {\n\t\t\tmatcher, err := regexp.Compile(ideOption.ValidationPattern)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif !matcher.MatchString(value) {\n\t\t\t\tif ideOption.ValidationMessage != \"\" {\n\t\t\t\t\treturn nil, fmt.Errorf(\"%s\", ideOption.ValidationMessage)\n\t\t\t\t}\n\n\t\t\t\treturn nil, fmt.Errorf(\"invalid value '%s' for option '%s', has to match the following regEx: %s\", value, key, ideOption.ValidationPattern)\n\t\t\t}\n\t\t}\n\n\t\tif len(ideOption.Enum) > 0 {\n\t\t\tfound := false\n\t\t\tfor _, e := range ideOption.Enum {\n\t\t\t\tif value == e {\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid value '%s' for option '%s', has to match one of the following values: %v\", value, key, ideOption.Enum)\n\t\t\t}\n\t\t}\n\n\t\tretMap[key] = config.OptionValue{\n\t\t\tValue:        value,\n\t\t\tUserProvided: true,\n\t\t}\n\t}\n\n\treturn retMap, nil\n}\n\nfunc detect() string {\n\tif command.Exists(\"code\") {\n\t\treturn string(config.IDEVSCode)\n\t}\n\n\treturn string(config.IDEOpenVSCode)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/clion.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tCLionProductCode           = \"CL\"\n\tCLionDownloadAmd64Template = \"https://download.jetbrains.com/cpp/CLion-%s.tar.gz\"\n\tCLionDownloadArm64Template = \"https://download.jetbrains.com/cpp/CLion-%s-aarch64.tar.gz\"\n)\n\nvar CLionOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewCLionServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(CLionOptions, values, CLionProductCode, CLionDownloadAmd64Template, CLionDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"clion\",\n\t\tDisplayName:   \"CLion\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/dataspell.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tDataSpellProductCode           = \"DS\"\n\tDataSpellDownloadAmd64Template = \"https://download.jetbrains.com/ds/dataspell-%s.tar.gz\"\n\tDataSpellDownloadArm64Template = \"https://download.jetbrains.com/ds/dataspell-%s-aarch64.tar.gz\"\n)\n\nvar DataSpellOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewDataSpellServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(DataSpellOptions, values, DataSpellProductCode, DataSpellDownloadAmd64Template, DataSpellDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"dataspell\",\n\t\tDisplayName:   \"DataSpell\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/generic.go",
    "content": "package jetbrains\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tcopy2 \"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/skratchdot/open-golang/open\"\n)\n\nconst (\n\tVersionOption       = \"VERSION\"\n\tDownloadAmd64Option = \"DOWNLOAD_AMD64\"\n\tDownloadArm64Option = \"DOWNLOAD_ARM64\"\n)\n\nfunc getLatestDownloadURL(code string, platform string) string {\n\treturn fmt.Sprintf(\"https://download.jetbrains.com/product?code=%s&platform=%s\", code, platform)\n}\n\nfunc getDownloadURLs(options ide.Options, values map[string]config.OptionValue, productCode string, templateAmd64 string, templateArm64 string) (string, string) {\n\tversion := options.GetValue(values, VersionOption)\n\tvar amd64Download, arm64Download string\n\tif version == \"latest\" {\n\t\tamd64Download = getLatestDownloadURL(productCode, \"linux\")\n\t\tarm64Download = getLatestDownloadURL(productCode, \"linuxARM64\")\n\t} else {\n\t\tamd64Download = options.GetValue(values, DownloadAmd64Option)\n\t\tif amd64Download == \"\" {\n\t\t\tamd64Download = fmt.Sprintf(templateAmd64, version)\n\t\t}\n\t\tarm64Download = options.GetValue(values, DownloadArm64Option)\n\t\tif arm64Download == \"\" {\n\t\t\tarm64Download = fmt.Sprintf(templateArm64, version)\n\t\t}\n\t}\n\n\treturn amd64Download, arm64Download\n}\n\ntype GenericOptions struct {\n\tID          string\n\tDisplayName string\n\n\tDownloadAmd64 string\n\tDownloadArm64 string\n}\n\nfunc newGenericServer(userName string, options *GenericOptions, log log.Logger) *GenericJetBrainsServer {\n\treturn &GenericJetBrainsServer{\n\t\tuserName: userName,\n\t\toptions:  options,\n\t\tlog:      log,\n\t}\n}\n\ntype GenericJetBrainsServer struct {\n\tuserName string\n\toptions  *GenericOptions\n\tlog      log.Logger\n}\n\nfunc (o *GenericJetBrainsServer) OpenGateway(workspaceFolder, workspaceID string) error {\n\to.log.Infof(\"Starting %s through JetBrains Gateway...\", o.options.DisplayName)\n\terr := open.Run(`jetbrains-gateway://connect#idePath=` + url.QueryEscape(o.getDirectory(path.Join(\"/\", \"home\", o.userName))) + `&projectPath=` + url.QueryEscape(workspaceFolder) + `&host=` + workspaceID + `.devpod&port=22&user=` + url.QueryEscape(o.userName) + `&type=ssh&deploy=false`)\n\tif err != nil {\n\t\to.log.Debugf(\"Error opening jetbrains-gateway: %v\", err)\n\t\to.log.Errorf(\"Seems like you don't have JetBrains Gateway installed on your computer. Please install JetBrains Gateway via https://www.jetbrains.com/remote-development/gateway/\")\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (o *GenericJetBrainsServer) GetVolume() string {\n\treturn fmt.Sprintf(\"type=volume,src=devpod-%s,dst=%s\", o.options.ID, o.getDownloadFolder())\n}\n\nfunc (o *GenericJetBrainsServer) getDownloadFolder() string {\n\treturn fmt.Sprintf(\"/var/devpod/%s\", o.options.ID)\n}\n\nfunc (o *GenericJetBrainsServer) Install() error {\n\to.log.Debugf(\"Setup %s...\", o.options.DisplayName)\n\tbaseFolder, err := getBaseFolder(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttargetLocation := o.getDirectory(baseFolder)\n\n\t_, err = os.Stat(targetLocation)\n\tif err == nil {\n\t\to.log.Debugf(\"Goland already installed skip install\")\n\t\treturn nil\n\t}\n\n\to.log.Debugf(\"Download %s archive\", o.options.DisplayName)\n\tarchivePath, err := o.download(o.getDownloadFolder(), o.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\to.log.Infof(\"Extract %s...\", o.options.DisplayName)\n\terr = o.extractArchive(archivePath, targetLocation)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = copy2.ChownR(path.Join(baseFolder, \".cache\"), o.userName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"chown\")\n\t}\n\to.log.Infof(\"Successfully installed %s backend\", o.options.DisplayName)\n\treturn nil\n}\n\nfunc getBaseFolder(userName string) (string, error) {\n\tvar err error\n\thomeFolder := \"\"\n\tif userName != \"\" {\n\t\thomeFolder, err = command.GetHome(userName)\n\t} else {\n\t\thomeFolder, err = util.UserHomeDir()\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn homeFolder, nil\n}\n\nfunc (o *GenericJetBrainsServer) getDirectory(baseFolder string) string {\n\treturn path.Join(baseFolder, \".cache\", \"JetBrains\", \"RemoteDev\", \"dist\", o.options.ID)\n}\n\nfunc (o *GenericJetBrainsServer) extractArchive(fromPath string, toPath string) error {\n\tfile, err := os.Open(fromPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\treturn extract.Extract(file, toPath, extract.StripLevels(1))\n}\n\nfunc (o *GenericJetBrainsServer) download(targetFolder string, log log.Logger) (string, error) {\n\terr := os.MkdirAll(targetFolder, os.ModePerm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdownloadURL := o.options.DownloadAmd64\n\tif runtime.GOARCH == \"arm64\" {\n\t\tdownloadURL = o.options.DownloadArm64\n\t}\n\n\ttargetPath := path.Join(filepath.ToSlash(targetFolder), o.options.ID+\".tar.gz\")\n\n\t// initiate download\n\tlog.Infof(\"Download %s from %s\", o.options.DisplayName, downloadURL)\n\tdefer log.Debugf(\"Successfully downloaded %s\", o.options.DisplayName)\n\tresp, err := devpodhttp.GetHTTPClient().Get(downloadURL)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"download binary\")\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {\n\t\treturn \"\", errors.Wrapf(err, \"download binary returned status code %d\", resp.StatusCode)\n\t}\n\n\tstat, err := os.Stat(targetPath)\n\tif err == nil && stat.Size() == resp.ContentLength {\n\t\treturn targetPath, nil\n\t}\n\n\tfile, err := os.Create(targetPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, &ide.ProgressReader{\n\t\tReader:    resp.Body,\n\t\tTotalSize: resp.ContentLength,\n\t\tLog:       log,\n\t})\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"download file\")\n\t}\n\n\treturn targetPath, nil\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/goland.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tGolandProductCode           = \"GO\"\n\tGolandDownloadAmd64Template = \"https://download.jetbrains.com/go/goland-%s.tar.gz\"\n\tGolandDownloadArm64Template = \"https://download.jetbrains.com/go/goland-%s-aarch64.tar.gz\"\n)\n\nvar GolandOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewGolandServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(GolandOptions, values, GolandProductCode, GolandDownloadAmd64Template, GolandDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"goland\",\n\t\tDisplayName:   \"Goland\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/intellij.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tIntellijProductCode           = \"IU\"\n\tIntellijDownloadAmd64Template = \"https://download.jetbrains.com/idea/ideaIU-%s.tar.gz\"\n\tIntellijDownloadArm64Template = \"https://download.jetbrains.com/idea/ideaIU-%s-aarch64.tar.gz\"\n)\n\nvar IntellijOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewIntellij(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(IntellijOptions, values, IntellijProductCode, IntellijDownloadAmd64Template, IntellijDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"intellij\",\n\t\tDisplayName:   \"Intellij\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/phpstorm.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tPhpStormProductCode           = \"PS\"\n\tPhpStormDownloadAmd64Template = \"https://download.jetbrains.com/webide/PhpStorm-%s.tar.gz\"\n\tPhpStormDownloadArm64Template = \"https://download.jetbrains.com/webide/PhpStorm-%s-aarch64.tar.gz\"\n)\n\nvar PhpStormOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewPhpStorm(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(PhpStormOptions, values, PhpStormProductCode, PhpStormDownloadAmd64Template, PhpStormDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"phpstorm\",\n\t\tDisplayName:   \"PhpStorm\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/pycharm.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tPycharmProductCode           = \"PY\"\n\tPycharmDownloadAmd64Template = \"https://download.jetbrains.com/python/pycharm-professional-%s.tar.gz\"\n\tPycharmDownloadArm64Template = \"https://download.jetbrains.com/python/pycharm-professional-%s-aarch64.tar.gz\"\n)\n\nvar PyCharmOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewPyCharmServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(PyCharmOptions, values, PycharmProductCode, PycharmDownloadAmd64Template, PycharmDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"pycharm\",\n\t\tDisplayName:   \"PyCharm\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/rider.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tRiderProductCode           = \"RD\"\n\tRiderDownloadAmd64Template = \"https://download.jetbrains.com/rider/JetBrains.Rider-%s.tar.gz\"\n\tRiderDownloadArm64Template = \"https://download.jetbrains.com/rider/JetBrains.Rider-%s-aarch64.tar.gz\"\n)\n\nvar RiderOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewRiderServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(RiderOptions, values, RiderProductCode, RiderDownloadAmd64Template, RiderDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"rider\",\n\t\tDisplayName:   \"Rider\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/rubymine.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tRubyMineProductCode           = \"RM\"\n\tRubyMineDownloadAmd64Template = \"https://download.jetbrains.com/ruby/RubyMine-%s.tar.gz\"\n\tRubyMineDownloadArm64Template = \"https://download.jetbrains.com/ruby/RubyMine-%s-aarch64.tar.gz\"\n)\n\nvar RubyMineOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewRubyMineServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(RubyMineOptions, values, RubyMineProductCode, RubyMineDownloadAmd64Template, RubyMineDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"rubymine\",\n\t\tDisplayName:   \"RubyMine\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/rustrover.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tRustRoverProductCode           = \"RR\"\n\tRustRoverDownloadAmd64Template = \"https://download.jetbrains.com/rust/rustrover-%s.tar.gz\"\n\tRustRoverDownloadArm64Template = \"https://download.jetbrains.com/rust/rustrover-%s-aarch64.tar.gz\"\n)\n\nvar RustRoverOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewRustRoverServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(RustRoverOptions, values, RustRoverProductCode, RustRoverDownloadAmd64Template, RustRoverDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"rustrover\",\n\t\tDisplayName:   \"RustRover\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jetbrains/webstorm.go",
    "content": "package jetbrains\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tWebStormProductCode           = \"WS\"\n\tWebStormDownloadAmd64Template = \"https://download.jetbrains.com/webstorm/WebStorm-%s.tar.gz\"\n\tWebStormDownloadArm64Template = \"https://download.jetbrains.com/webstorm/WebStorm-%s-aarch64.tar.gz\"\n)\n\nvar WebStormOptions = ide.Options{\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the binary\",\n\t\tDefault:     \"latest\",\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 server binary\",\n\t},\n}\n\nfunc NewWebStormServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {\n\tamd64Download, arm64Download := getDownloadURLs(WebStormOptions, values, WebStormProductCode, WebStormDownloadAmd64Template, WebStormDownloadArm64Template)\n\treturn newGenericServer(userName, &GenericOptions{\n\t\tID:            \"webstorm\",\n\t\tDisplayName:   \"WebStorm\",\n\t\tDownloadAmd64: amd64Download,\n\t\tDownloadArm64: arm64Download,\n\t}, log)\n}\n"
  },
  {
    "path": "pkg/ide/jupyter/jupyter.go",
    "content": "package jupyter\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tOpenOption        = \"OPEN\"\n\tBindAddressOption = \"BIND_ADDRESS\"\n)\n\nvar Options = ide.Options{\n\tBindAddressOption: {\n\t\tName:        BindAddressOption,\n\t\tDescription: \"The address to bind the server to locally. E.g. 0.0.0.0:12345\",\n\t\tDefault:     \"\",\n\t},\n\tOpenOption: {\n\t\tName:        OpenOption,\n\t\tDescription: \"If DevPod should automatically open the browser\",\n\t\tDefault:     \"true\",\n\t\tEnum: []string{\n\t\t\t\"true\",\n\t\t\t\"false\",\n\t\t},\n\t},\n}\n\nconst DefaultServerPort = 10700\n\nfunc NewJupyterNotebookServer(workspaceFolder string, userName string, values map[string]config.OptionValue, log log.Logger) *JupyterNotbookServer {\n\treturn &JupyterNotbookServer{\n\t\tvalues:          values,\n\t\tworkspaceFolder: workspaceFolder,\n\t\tuserName:        userName,\n\t\tlog:             log,\n\t}\n}\n\ntype JupyterNotbookServer struct {\n\tvalues          map[string]config.OptionValue\n\tworkspaceFolder string\n\tuserName        string\n\tlog             log.Logger\n}\n\nfunc (o *JupyterNotbookServer) Install() error {\n\terr := o.installNotebook()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn o.Start()\n}\n\nfunc (o *JupyterNotbookServer) installNotebook() error {\n\tif command.ExistsForUser(\"jupyter\", o.userName) {\n\t\treturn nil\n\t}\n\n\t// check if pip3 exists\n\tbaseCommand := \"\"\n\tif command.ExistsForUser(\"pip3\", o.userName) {\n\t\tbaseCommand = \"pip3\"\n\t} else if command.ExistsForUser(\"pip\", o.userName) {\n\t\tbaseCommand = \"pip\"\n\t} else {\n\t\treturn fmt.Errorf(\"seems like neither pip3 nor pip exists, please make sure to install python correctly\")\n\t}\n\n\t// install notebook command\n\trunCommand := fmt.Sprintf(\"%s install notebook\", baseCommand)\n\targs := []string{}\n\tif o.userName != \"\" {\n\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t} else {\n\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t}\n\n\t// install\n\to.log.Infof(\"Installing jupyter notebook...\")\n\tout, err := exec.Command(args[0], args[1:]...).CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error installing jupyter notebook: %w\", command.WrapCommandError(out, err))\n\t}\n\n\to.log.Info(\"Successfully installed jupyter notebook\")\n\treturn nil\n}\n\nfunc (o *JupyterNotbookServer) Start() error {\n\treturn single.Single(\"jupyter.pid\", func() (*exec.Cmd, error) {\n\t\to.log.Infof(\"Starting jupyter notebook in background...\")\n\t\trunCommand := fmt.Sprintf(\"jupyter notebook --ip='*' --NotebookApp.notebook_dir='%s' --NotebookApp.token='' --NotebookApp.password='' --no-browser --port '%s' --allow-root\", o.workspaceFolder, strconv.Itoa(DefaultServerPort))\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-w\", \"SSH_AUTH_SOCK\", \"-l\", \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-l\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Dir = o.workspaceFolder\n\t\treturn cmd, nil\n\t})\n}\n"
  },
  {
    "path": "pkg/ide/openvscode/openvscode.go",
    "content": "package openvscode\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tcopy2 \"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/ide/vscode\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tDownloadAmd64Template = \"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-%s/openvscode-server-%s-linux-x64.tar.gz\"\n\tDownloadArm64Template = \"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-%s/openvscode-server-%s-linux-arm64.tar.gz\"\n)\n\nconst (\n\tForwardPortsOption  = \"FORWARD_PORTS\"\n\tOpenOption          = \"OPEN\"\n\tBindAddressOption   = \"BIND_ADDRESS\"\n\tVersionOption       = \"VERSION\"\n\tDownloadAmd64Option = \"DOWNLOAD_AMD64\"\n\tDownloadArm64Option = \"DOWNLOAD_ARM64\"\n)\n\nvar Options = ide.Options{\n\tForwardPortsOption: {\n\t\tName:        ForwardPortsOption,\n\t\tDescription: \"If DevPod should automatically do port-forwarding\",\n\t\tDefault:     \"true\",\n\t\tEnum: []string{\n\t\t\t\"true\",\n\t\t\t\"false\",\n\t\t},\n\t},\n\tBindAddressOption: {\n\t\tName:        BindAddressOption,\n\t\tDescription: \"The address to bind VSCode web to locally. E.g. 0.0.0.0:12345\",\n\t\tDefault:     \"\",\n\t},\n\tVersionOption: {\n\t\tName:        VersionOption,\n\t\tDescription: \"The version for the open vscode binary\",\n\t\tDefault:     \"v1.84.2\",\n\t},\n\tOpenOption: {\n\t\tName:        OpenOption,\n\t\tDescription: \"If DevPod should automatically open the browser\",\n\t\tDefault:     \"true\",\n\t\tEnum: []string{\n\t\t\t\"true\",\n\t\t\t\"false\",\n\t\t},\n\t},\n\tDownloadArm64Option: {\n\t\tName:        DownloadArm64Option,\n\t\tDescription: \"The download url for the arm64 vscode server binary\",\n\t},\n\tDownloadAmd64Option: {\n\t\tName:        DownloadAmd64Option,\n\t\tDescription: \"The download url for the amd64 vscode server binary\",\n\t},\n}\n\nconst DefaultVSCodePort = 10800\n\nfunc NewOpenVSCodeServer(extensions []string, settings string, userName string, host, port string, values map[string]config.OptionValue, log log.Logger) *OpenVSCodeServer {\n\treturn &OpenVSCodeServer{\n\t\tvalues:     values,\n\t\textensions: extensions,\n\t\tsettings:   settings,\n\t\tuserName:   userName,\n\t\thost:       host,\n\t\tport:       port,\n\t\tlog:        log,\n\t}\n}\n\ntype OpenVSCodeServer struct {\n\tvalues     map[string]config.OptionValue\n\textensions []string\n\tsettings   string\n\tuserName   string\n\thost       string\n\tport       string\n\tlog        log.Logger\n}\n\nfunc (o *OpenVSCodeServer) InstallExtensions() error {\n\t// install extensions\n\terr := o.installExtensions()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"install extensions\")\n\t}\n\n\treturn nil\n}\n\nfunc (o *OpenVSCodeServer) Install() error {\n\tlocation, err := prepareOpenVSCodeServerLocation(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// is installed\n\t_, err = os.Stat(filepath.Join(location, \"bin\"))\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\t// check what release we need to download\n\turl := o.getReleaseUrl()\n\n\tvscode.InstallAPKRequirements(o.log)\n\n\t// download tar\n\tresp, err := devpodhttp.GetHTTPClient().Get(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\terr = extract.Extract(resp.Body, location, extract.StripLevels(1))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"extract vscode\")\n\t}\n\n\t// chown location\n\tif o.userName != \"\" {\n\t\terr = copy2.ChownR(location, o.userName)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"chown\")\n\t\t}\n\t}\n\n\t// paste settings\n\terr = o.installSettings()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"install settings\")\n\t}\n\n\treturn nil\n}\n\nfunc (o *OpenVSCodeServer) getReleaseUrl() string {\n\tvar url string\n\tversion := Options.GetValue(o.values, VersionOption)\n\n\tif runtime.GOARCH == \"arm64\" {\n\t\turl = Options.GetValue(o.values, DownloadArm64Option)\n\t\tif url == \"\" {\n\t\t\turl = fmt.Sprintf(DownloadArm64Template, version, version)\n\t\t}\n\t} else {\n\t\turl = Options.GetValue(o.values, DownloadAmd64Option)\n\t\tif url == \"\" {\n\t\t\turl = fmt.Sprintf(DownloadAmd64Template, version, version)\n\t\t}\n\t}\n\n\treturn url\n}\n\nfunc (o *OpenVSCodeServer) installExtensions() error {\n\tif len(o.extensions) == 0 {\n\t\treturn nil\n\t}\n\n\tlocation, err := prepareOpenVSCodeServerLocation(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout := o.log.Writer(logrus.InfoLevel, false)\n\tdefer out.Close()\n\n\tbinaryPath := filepath.Join(location, \"bin\", \"openvscode-server\")\n\tfor _, extension := range o.extensions {\n\t\to.log.Info(\"Install extension \" + extension + \"...\")\n\t\trunCommand := fmt.Sprintf(\"%s --install-extension '%s'\", binaryPath, extension)\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Stdout = out\n\t\tcmd.Stderr = out\n\t\terr = cmd.Run()\n\t\tif err != nil {\n\t\t\to.log.Info(\"Failed installing extension \" + extension)\n\t\t} else {\n\t\t\to.log.Info(\"Successfully installed extension \" + extension)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (o *OpenVSCodeServer) installSettings() error {\n\tif len(o.settings) == 0 {\n\t\treturn nil\n\t}\n\n\tlocation, err := prepareOpenVSCodeServerLocation(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsettingsDir := filepath.Join(location, \"data\", \"Machine\")\n\terr = os.MkdirAll(settingsDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.WriteFile(filepath.Join(settingsDir, \"settings.json\"), []byte(o.settings), 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = copy2.ChownR(location, o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (o *OpenVSCodeServer) Start() error {\n\tlocation, err := prepareOpenVSCodeServerLocation(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif o.host == \"\" {\n\t\to.host = \"0.0.0.0\"\n\t}\n\tif o.port == \"\" {\n\t\to.port = strconv.Itoa(DefaultVSCodePort)\n\t}\n\n\tbinaryPath := filepath.Join(location, \"bin\", \"openvscode-server\")\n\t_, err = os.Stat(binaryPath)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find binary\")\n\t}\n\n\treturn single.Single(\"openvscode.pid\", func() (*exec.Cmd, error) {\n\t\to.log.Infof(\"Starting openvscode in background...\")\n\t\trunCommand := fmt.Sprintf(\"%s server-local --without-connection-token --host '%s' --port '%s'\", binaryPath, o.host, o.port)\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Dir = location\n\t\treturn cmd, nil\n\t})\n}\n\nfunc prepareOpenVSCodeServerLocation(userName string) (string, error) {\n\tvar err error\n\thomeFolder := \"\"\n\tif userName != \"\" {\n\t\thomeFolder, err = command.GetHome(userName)\n\t} else {\n\t\thomeFolder, err = util.UserHomeDir()\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfolder := filepath.Join(homeFolder, \".openvscode-server\")\n\terr = os.MkdirAll(folder, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn folder, nil\n}\n"
  },
  {
    "path": "pkg/ide/rstudio/rstudio.go",
    "content": "package rstudio\n\nimport (\n\t\"bytes\"\n\t_ \"embed\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tcopypkg \"github.com/loft-sh/devpod/pkg/copy\"\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/single\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\tOpenOption        = \"OPEN\"\n\tBindAddressOption = \"BIND_ADDRESS\"\n)\n\nvar Options = ide.Options{\n\tBindAddressOption: {\n\t\tName:        BindAddressOption,\n\t\tDescription: \"The address to bind the server to locally. E.g. 0.0.0.0:12345\",\n\t\tDefault:     \"\",\n\t},\n\tOpenOption: {\n\t\tName:        OpenOption,\n\t\tDescription: \"If DevPod should automatically open the browser\",\n\t\tDefault:     \"true\",\n\t\tEnum: []string{\n\t\t\t\"true\",\n\t\t\t\"false\",\n\t\t},\n\t},\n}\n\nconst (\n\tDefaultServerPort = 8787\n\n\tdownloadFolder = \"/var/devpod/rstudio-server\"\n\tdataFolder     = \"/usr/local/share/devpod/rstudio-server/data\"\n\t// rstudioConfigFolder is where RStudio expects configuration\n\trstudioConfigFolder = \"/etc/rstudio\"\n\tpreferencesFile     = \"rstudio-prefs.json\"\n\n\tdefaultBinaryPathRStudioServer = \"/usr/lib/rstudio-server/bin/rstudio-server\"\n\tdefaultBinaryPathRServer       = \"/usr/lib/rstudio-server/bin/rserver\"\n)\n\ntype preferences struct {\n\tInitialWorkingDirectory string `json:\"initial_working_directory,omitempty\"` // RStudio expects snake_case\n}\n\nfunc NewRStudioServer(workspaceFolder string, userName string, values map[string]config.OptionValue, log log.Logger) *RStudioServer {\n\treturn &RStudioServer{\n\t\tvalues:          values,\n\t\tworkspaceFolder: workspaceFolder,\n\t\tuserName:        userName,\n\t\tlog:             log,\n\t}\n}\n\ntype RStudioServer struct {\n\tvalues          map[string]config.OptionValue\n\tworkspaceFolder string\n\tuserName        string\n\tlog             log.Logger\n}\n\nvar codenameRegEx = regexp.MustCompile(`\\nUBUNTU_CODENAME=(.*)\\n`)\n\nfunc (o *RStudioServer) Install() error {\n\tdebPath := filepath.Join(filepath.ToSlash(downloadFolder), \"rstudio-server.deb\")\n\t// R has to be installed\n\tif !command.ExistsForUser(\"R\", o.userName) {\n\t\treturn fmt.Errorf(\"R has to be available in image to use RStudio\") //nolint:all\n\t}\n\n\t// Skip if already installed\n\tif command.ExistsForUser(\"rstudio-server\", o.userName) {\n\t\to.log.Debug(\"RStudio is already installed, skipping installation\")\n\t\treturn nil\n\t}\n\to.log.Info(\"Installing RStudio\")\n\n\terr := ensureGdebi(o.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Check if local file exists\n\tif _, err := os.Stat(debPath); os.IsNotExist(err) {\n\t\to.log.Info(\"Rstudio deb not file, downloading ...\")\n\t\tcodename, err := getDistroCodename(o.log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdebPath, err = downloadRStudioDeb(codename, o.log)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\terr = installDeb(debPath, o.log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = ensureConfigFolder(o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = setupSingleUserMode(dataFolder, o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = setupPreferences(o.workspaceFolder, o.userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\to.log.Done(\"Successfully installed RStudio\")\n\n\treturn o.Start()\n}\n\nfunc (o *RStudioServer) Start() error {\n\treturn single.Single(\"rstudio.pid\", func() (*exec.Cmd, error) {\n\t\to.log.Info(\"Starting RStudio...\")\n\t\trunCommand := \"rstudio-server start\"\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-w\", \"SSH_AUTH_SOCK\", \"-l\", \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-l\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Dir = o.workspaceFolder\n\t\treturn cmd, nil\n\t})\n}\n\nfunc ensureGdebi(log log.Logger) error {\n\tif !command.Exists(\"gdebi\") {\n\t\tlog.Info(\"Installing dependency gdebi-core\")\n\t\tout, err := exec.Command(\"apt\", \"update\").CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"apt update: %w: %s\", err, string(out))\n\t\t}\n\n\t\tout, err = exec.Command(\"apt\", \"-y\", \"install\", \"--no-install-recommends\", \"gdebi-core\").CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"install gdebi core: %w: %s\", err, string(out))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getDistroCodename(log log.Logger) (string, error) {\n\t// Base distro needs to be ubuntu\n\tall, err := os.ReadFile(\"/etc/os-release\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"read /etc/os-release: %w\", err)\n\t}\n\tif !bytes.Contains(all, []byte(\"ID=ubuntu\")) {\n\t\treturn \"\", fmt.Errorf(\"RStudio Server is only supported on ubuntu images, OS information is %s\", string(all))\n\t}\n\n\t// Find ubuntu release codename\n\tmatches := codenameRegEx.FindStringSubmatch(string(all))\n\tif len(matches) < 2 {\n\t\treturn \"\", fmt.Errorf(\"unable to find ubuntu release codename\")\n\t}\n\tubuntuCodename := strings.Trim(matches[1], `\"`)\n\tlog.Debug(\"Found ubuntu codename\", ubuntuCodename)\n\n\treturn ubuntuCodename, nil\n}\n\nfunc downloadRStudioDeb(ubuntuCodename string, log log.Logger) (string, error) {\n\tdownloadURL := getDownloadURL(\"stable\", ubuntuCodename, runtime.GOARCH) // the agent injection already handles the cpu architecture\n\tlog.Infof(\"Downloading RStudio from %s\", downloadURL)\n\n\t// Download .deb\n\tdebPath, err := download(downloadFolder, downloadURL, log)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download: %w\", err)\n\t}\n\tlog.Done(\"Successfully downloaded RStudio\")\n\n\treturn debPath, nil\n}\n\nfunc getDownloadURL(version, ubuntuCodename, architecture string) string {\n\treturn \"https://rstudio.org/download/latest/\" + version + \"/server/\" + ubuntuCodename + \"/rstudio-server-latest-\" + architecture + \".deb\"\n}\n\nfunc download(targetFolder, downloadURL string, log log.Logger) (string, error) {\n\terr := os.MkdirAll(targetFolder, os.ModePerm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttargetPath := filepath.Join(filepath.ToSlash(targetFolder), \"rstudio-server.deb\")\n\n\tresp, err := devpodhttp.GetHTTPClient().Get(downloadURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download deb: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {\n\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\treturn \"\", fmt.Errorf(\"RStudio version doesn't exist: %s\", downloadURL) //nolint:all\n\t\t}\n\n\t\treturn \"\", fmt.Errorf(\"download binary returned status code %d\", resp.StatusCode)\n\t}\n\n\tstat, err := os.Stat(targetPath)\n\tif err == nil && stat.Size() == resp.ContentLength {\n\t\treturn targetPath, nil\n\t}\n\n\tfile, err := os.Create(targetPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, &ide.ProgressReader{\n\t\tReader:    resp.Body,\n\t\tTotalSize: resp.ContentLength,\n\t\tLog:       log,\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download file: %w\", err)\n\t}\n\n\treturn targetPath, nil\n}\n\nfunc installDeb(debPath string, log log.Logger) error {\n\tlog.Info(\"Installing deb\")\n\n\tout, err := exec.Command(\"gdebi\", \"--non-interactive\", debPath).CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"install deb: %w: %s\", err, string(out))\n\t}\n\n\t// The installer unfortunately automatically starts a new rstudio process without reading the configuration.\n\t// We're stopping that so that our process can take over later on\n\tout, err = exec.Command(defaultBinaryPathRStudioServer, \"stop\").CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"stop initial RStudio process: %w: %s\", err, string(out))\n\t}\n\n\t// The RStudio deb installs into /usr/lib/rstudio-server/bin/rstudio-server by default\n\t// and symlinks the binaries to /usr/sbin.\n\t// We need to symlink to /usr/local/bin to ensure remoteUser has access later on\n\terr = os.Symlink(defaultBinaryPathRStudioServer, \"/usr/local/bin/rstudio-server\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"symlink rstudio-server: %w\", err)\n\t}\n\terr = os.Symlink(defaultBinaryPathRServer, \"/usr/local/bin/rserver\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"symlink rserver: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc ensureConfigFolder(userName string) error {\n\terr := os.MkdirAll(dataFolder, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = copypkg.ChownR(dataFolder, userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc setupSingleUserMode(configFolder, userName string) error {\n\t// Check out https://docs.posit.co/ide/server-pro/rstudio-server-configuration.html for details\n\tdbConf := fmt.Sprintf(`provider=sqlite\ndirectory=%s`, configFolder)\n\tdbConfPath := filepath.Join(configFolder, \"dbconf.conf\")\n\terr := os.WriteFile(dbConfPath, []byte(dbConf), os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save db conf: %w\", err)\n\t}\n\n\trServerConf := fmt.Sprintf(`# https://docs.posit.co/ide/server-pro/access_and_security/server_permissions.html#running-without-permissions\nserver-user=%s\nauth-none=1\nauth-minimum-user-id=0\n\nserver-data-dir=%s\ndatabase-config-file=%s/dbconf.conf\n`, userName, configFolder, configFolder)\n\tserverConfPath := filepath.Join(rstudioConfigFolder, \"rserver.conf\")\n\t// The RStudio installer automatically creates an empty file at destConfPath, let's try to remove that first\n\t_ = os.Remove(serverConfPath)\n\terr = os.WriteFile(serverConfPath, []byte(rServerConf), os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save rserver conf: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc setupPreferences(workspaceFolder, userName string) error {\n\thomeDir, err := command.GetHome(userName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get home dir\")\n\t}\n\tprefsDir := filepath.Join(homeDir, \".config\", \"rstudio\")\n\terr = os.MkdirAll(prefsDir, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = copypkg.ChownR(prefsDir, userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprefs := preferences{InitialWorkingDirectory: workspaceFolder}\n\toutPrefs, err := json.Marshal(prefs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprefsPath := filepath.Join(prefsDir, \"rstudio-prefs.json\")\n\terr = os.WriteFile(prefsPath, outPrefs, os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save preferences: %w\", err)\n\t}\n\terr = copypkg.Chown(prefsPath, userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ide/types.go",
    "content": "package ide\n\nimport (\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/log\"\n)\n\ntype IDE interface {\n\tInstall() error\n}\n\ntype Options map[string]Option\n\ntype Option struct {\n\t// Name is the name of the IDE option\n\tName string `json:\"name,omitempty\"`\n\n\t// Description is the description of the IDE option\n\tDescription string `json:\"description,omitempty\"`\n\n\t// Default is the default value for this option\n\tDefault string `json:\"default,omitempty\"`\n\n\t// Enum is the possible values for this option\n\tEnum []string `json:\"enum,omitempty\"`\n\n\t// ValidationPattern to use to validate this option\n\tValidationPattern string `json:\"validationPattern,omitempty\"`\n\n\t// ValidationMessage to print if validation fails\n\tValidationMessage string `json:\"validationMessage,omitempty\"`\n}\n\nfunc (o Options) GetValue(values map[string]config.OptionValue, key string) string {\n\tif values != nil && values[key].Value != \"\" {\n\t\treturn values[key].Value\n\t} else if o[key].Default != \"\" {\n\t\treturn o[key].Default\n\t}\n\n\treturn \"\"\n}\n\n// ReusesAuthSock determines if the --reuse-ssh-auth-sock flag should be passed to the ssh server helper based on the IDE.\n// Browser based IDEs use a browser tunnel to communicate with the remote server instead of an independent ssh connection\nfunc ReusesAuthSock(ide string) bool {\n\treturn ide == \"openvscode\" || ide == \"jupyternotebook\"\n}\n\ntype ProgressReader struct {\n\tReader    io.Reader\n\tTotalSize int64\n\tLog       log.Logger\n\n\tlastMessage time.Time\n\tbytesRead   int64\n}\n\nfunc (p *ProgressReader) Read(b []byte) (n int, err error) {\n\tn, err = p.Reader.Read(b)\n\tp.bytesRead += int64(n)\n\tif time.Since(p.lastMessage) > time.Second*1 {\n\t\tp.Log.Infof(\"Downloaded %.2f / %.2f MB\", float64(p.bytesRead)/1024/1024, float64(p.TotalSize/1024/1024))\n\t\tp.lastMessage = time.Now()\n\t}\n\n\treturn n, err\n}\n"
  },
  {
    "path": "pkg/ide/vscode/apk.go",
    "content": "package vscode\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n)\n\n// InstallAPKRequirements installs the requirements using apk.\n//\n// This is used by Alpine- and Wolfi-based images.\nfunc InstallAPKRequirements(logger log.Logger) {\n\tif !command.Exists(\"apk\") {\n\t\treturn\n\t}\n\n\tdependencies := []string{\"build-base\"}\n\tif all, err := os.ReadFile(\"/etc/os-release\"); err != nil {\n\t\tlogger.Errorf(\"Error reading /etc/os-release: %v\", err)\n\t\treturn\n\t} else if !bytes.Contains(all, []byte(\"ID=alpine\")) {\n\t\t// Alpine needs gcompat for compatibility with musl.\n\t\t// Wolfi-based distros don't need this, and Wolfi doesn't have it.\n\t\tdependencies = append(dependencies, \"gcompat\")\n\t}\n\tlogger.Debugf(\"Install apk requirements...\")\n\tif !command.Exists(\"git\") {\n\t\tdependencies = append(dependencies, \"git\")\n\t}\n\tif !command.Exists(\"bash\") {\n\t\tdependencies = append(dependencies, \"bash\")\n\t}\n\tif !command.Exists(\"curl\") {\n\t\tdependencies = append(dependencies, \"curl\")\n\t}\n\n\tout, err := exec.Command(\"sh\", \"-c\", \"apk update && apk add \"+strings.Join(dependencies, \" \")).CombinedOutput()\n\tif err != nil {\n\t\tlogger.Errorf(\"Error updating apk dependencies: %v\", command.WrapCommandError(out, err))\n\t}\n}\n"
  },
  {
    "path": "pkg/ide/vscode/open.go",
    "content": "package vscode\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/skratchdot/open-golang/open\"\n)\n\nfunc Open(ctx context.Context, workspace, folder string, newWindow bool, flavor Flavor, log log.Logger) error {\n\tlog.Infof(\"Starting %s...\", flavor.DisplayName())\n\tcliErr := openViaCLI(ctx, workspace, folder, newWindow, flavor, log)\n\tif cliErr == nil {\n\t\treturn nil\n\t}\n\n\tbrowserErr := openViaBrowser(workspace, folder, newWindow, flavor, log)\n\tif browserErr == nil {\n\t\treturn nil\n\t}\n\n\treturn errors.Join(cliErr, browserErr)\n}\n\nfunc openViaBrowser(workspace, folder string, newWindow bool, flavor Flavor, log log.Logger) error {\n\tvar protocol string\n\tswitch flavor {\n\tcase FlavorStable:\n\t\tprotocol = `vscode://`\n\tcase FlavorInsiders:\n\t\tprotocol = `vscode-insiders://`\n\tcase FlavorCursor:\n\t\tprotocol = `cursor://`\n\tcase FlavorPositron:\n\t\tprotocol = `positron://`\n\tcase FlavorCodium:\n\t\tprotocol = `codium://`\n\tcase FlavorWindsurf:\n\t\tprotocol = `windsurf://`\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown flavor %s\", flavor)\n\t}\n\n\topenURL := protocol + `vscode-remote/ssh-remote+` + workspace + `.devpod/` + folder\n\tif newWindow {\n\t\topenURL += \"?windowId=_blank\"\n\t}\n\n\terr := open.Run(openURL)\n\tif err != nil {\n\t\tlog.Debugf(\"Starting %s caused error: %v\", flavor, err)\n\t\tlog.Errorf(\"Seems like you don't have %s installed on your computer locally\", flavor.DisplayName())\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc openViaCLI(ctx context.Context, workspace, folder string, newWindow bool, flavor Flavor, log log.Logger) error {\n\t// try to find code cli\n\tcodePath := findCLI(flavor)\n\tif codePath == \"\" {\n\t\treturn fmt.Errorf(\"couldn't find the %s binary\", flavor)\n\t}\n\n\tsshExtension := \"ms-vscode-remote.remote-ssh\"\n\tif flavor == FlavorCodium {\n\t\tsshExtension = \"jeanp413.open-remote-ssh\"\n\t}\n\n\t// make sure ms-vscode-remote.remote-ssh is installed\n\tout, err := exec.Command(codePath, \"--list-extensions\").Output()\n\tif err != nil {\n\t\treturn command.WrapCommandError(out, err)\n\t}\n\tsplitted := strings.Split(string(out), \"\\n\")\n\tfound := false\n\tfoundContainers := false\n\tfor _, str := range splitted {\n\t\tif strings.TrimSpace(str) == sshExtension {\n\t\t\tfound = true\n\t\t} else if strings.TrimSpace(str) == \"ms-vscode-remote.remote-containers\" {\n\t\t\tfoundContainers = true\n\t\t}\n\t}\n\n\t// install remote-ssh extension\n\tif !found {\n\t\targs := []string{\"--install-extension\", sshExtension}\n\t\tlog.Debugf(\"Run vscode command %s %s\", codePath, strings.Join(args, \" \"))\n\t\tout, err := exec.CommandContext(ctx, codePath, args...).Output()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"install ssh extension: %w\", command.WrapCommandError(out, err))\n\t\t}\n\t}\n\n\t// open vscode via cli\n\targs := make([]string, 0, 5)\n\tif foundContainers {\n\t\targs = append(args, \"--disable-extension\", \"ms-vscode-remote.remote-containers\")\n\t}\n\tif newWindow {\n\t\targs = append(args, \"--new-window\")\n\t} else {\n\t\targs = append(args, \"--reuse-window\")\n\t}\n\t// Needs to be separated by `=` because of windows\n\tfolderUriArg := fmt.Sprintf(\"--folder-uri=vscode-remote://ssh-remote+%s.devpod/%s\", workspace, folder)\n\targs = append(args, folderUriArg)\n\tlog.Debugf(\"Run %s command %s %s\", flavor.DisplayName(), codePath, strings.Join(args, \" \"))\n\tout, err = exec.CommandContext(ctx, codePath, args...).CombinedOutput()\n\tif err != nil {\n\t\treturn command.WrapCommandError(out, err)\n\t}\n\n\treturn nil\n}\n\nfunc findCLI(flavor Flavor) string {\n\tif flavor == FlavorStable {\n\t\tif command.Exists(\"code\") {\n\t\t\treturn \"code\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\") {\n\t\t\treturn \"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\tif flavor == FlavorInsiders {\n\t\tif command.Exists(\"code-insiders\") {\n\t\t\treturn \"code-insiders\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code\") {\n\t\t\treturn \"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\tif flavor == FlavorCursor {\n\t\tif command.Exists(\"cursor\") {\n\t\t\treturn \"cursor\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Cursor.app/Contents/Resources/app/bin/cursor\") {\n\t\t\treturn \"/Applications/Cursor.app/Contents/Resources/app/bin/cursor\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\tif flavor == FlavorPositron {\n\t\tif command.Exists(\"positron\") {\n\t\t\treturn \"positron\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Positron.app/Contents/Resources/app/bin/positron\") {\n\t\t\treturn \"/Applications/Positron.app/Contents/Resources/app/bin/positron\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\tif flavor == FlavorCodium {\n\t\tif command.Exists(\"codium\") {\n\t\t\treturn \"codium\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Codium.app/Contents/Resources/app/bin/codium\") {\n\t\t\treturn \"/Applications/Codium.app/Contents/Resources/app/bin/codium\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\tif flavor == FlavorWindsurf {\n\t\tif command.Exists(\"windsurf\") {\n\t\t\treturn \"windsurf\"\n\t\t} else if runtime.GOOS == \"darwin\" && command.Exists(\"/Applications/Windsurf.app/Contents/Resources/app/bin/windsurf\") {\n\t\t\treturn \"/Applications/Windsurf.app/Contents/Resources/app/bin/windsurf\"\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\treturn \"\"\n}\n"
  },
  {
    "path": "pkg/ide/vscode/vscode.go",
    "content": "package vscode\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tcopy2 \"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/ide\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tOpenNewWindow = \"OPEN_NEW_WINDOW\"\n)\n\ntype Flavor string\n\nconst (\n\tFlavorStable   Flavor = \"stable\"\n\tFlavorInsiders Flavor = \"insiders\"\n\tFlavorCursor   Flavor = \"cursor\"\n\tFlavorPositron Flavor = \"positron\"\n\tFlavorCodium   Flavor = \"codium\"\n\tFlavorWindsurf Flavor = \"windsurf\"\n)\n\nfunc (f Flavor) DisplayName() string {\n\tswitch f {\n\tcase FlavorStable:\n\t\treturn \"VSCode\"\n\tcase FlavorInsiders:\n\t\treturn \"VSCode Insiders\"\n\tcase FlavorCursor:\n\t\treturn \"Cursor\"\n\tcase FlavorPositron:\n\t\treturn \"positron\"\n\tcase FlavorCodium:\n\t\treturn \"VSCodium\"\n\tcase FlavorWindsurf:\n\t\treturn \"Windsurf\"\n\tdefault:\n\t\treturn \"VSCode\"\n\t}\n}\n\nvar Options = ide.Options{\n\tOpenNewWindow: {\n\t\tName:        OpenNewWindow,\n\t\tDescription: \"If true, DevPod will open the project in a new window\",\n\t\tDefault:     \"true\",\n\t\tEnum: []string{\n\t\t\t\"false\",\n\t\t\t\"true\",\n\t\t},\n\t},\n}\n\nfunc NewVSCodeServer(extensions []string, settings string, userName string, values map[string]config.OptionValue, flavor Flavor, log log.Logger) *VsCodeServer {\n\tif flavor == \"\" {\n\t\tflavor = FlavorStable\n\t}\n\n\treturn &VsCodeServer{\n\t\tvalues:     values,\n\t\textensions: extensions,\n\t\tsettings:   settings,\n\t\tuserName:   userName,\n\t\tlog:        log,\n\t\tflavor:     flavor,\n\t}\n}\n\ntype VsCodeServer struct {\n\tvalues     map[string]config.OptionValue\n\textensions []string\n\tsettings   string\n\tuserName   string\n\tflavor     Flavor\n\tlog        log.Logger\n}\n\nfunc (o *VsCodeServer) InstallExtensions() error {\n\tlocation, err := prepareServerLocation(o.userName, false, o.flavor)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbinPath := o.findServerBinaryPath(location)\n\tif binPath == \"\" {\n\t\treturn fmt.Errorf(\"unable to locate server binary in workspace\")\n\t}\n\t// start log writer\n\twriter := o.log.Writer(logrus.InfoLevel, false)\n\terrwriter := o.log.Writer(logrus.ErrorLevel, false)\n\tdefer writer.Close()\n\tdefer errwriter.Close()\n\n\t// download extensions\n\tfor _, extension := range o.extensions {\n\t\to.log.Info(\"Install extension \" + extension + \"...\")\n\t\trunCommand := fmt.Sprintf(\"%s serve-local --accept-server-license-terms --install-extension '%s'\", binPath, extension)\n\t\targs := []string{}\n\t\tif o.userName != \"\" {\n\t\t\targs = append(args, \"su\", o.userName, \"-c\", runCommand)\n\t\t} else {\n\t\t\targs = append(args, \"sh\", \"-c\", runCommand)\n\t\t}\n\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\tcmd.Stdout = writer\n\t\tcmd.Stderr = errwriter\n\t\terr := cmd.Run()\n\t\tif err != nil {\n\t\t\to.log.Warn(\"Failed installing extension \" + extension)\n\t\t}\n\t\to.log.Info(\"Successfully installed extension \" + extension)\n\t}\n\n\treturn nil\n}\n\nfunc (o *VsCodeServer) Install() error {\n\tlocation, err := prepareServerLocation(o.userName, true, o.flavor)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsettingsDir := filepath.Join(location, \"data\", \"Machine\")\n\terr = os.MkdirAll(settingsDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// is installed\n\tsettingsFile := filepath.Join(settingsDir, \"settings.json\")\n\t_, err = os.Stat(settingsFile)\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tInstallAPKRequirements(o.log)\n\n\t// add settings\n\tif o.settings == \"\" {\n\t\to.settings = \"{}\"\n\t}\n\n\t// set settings\n\terr = os.WriteFile(settingsFile, []byte(o.settings), 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// chown location\n\tif o.userName != \"\" {\n\t\terr = copy2.ChownR(location, o.userName)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"chown\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (o *VsCodeServer) findServerBinaryPath(location string) string {\n\tbinPath := \"\"\n\t// Limit time we spend to look for code server binary.\n\t// Potentially expose as context option in the future if problems arise\n\tdeadline := time.Now().Add(time.Minute * 10)\n\n\tif o.flavor == FlavorStable {\n\t\t// check legacy location `$HOME/.vscode-server/bin`\n\t\tbinDir := filepath.Join(location, \"bin\")\n\t\tfor {\n\t\t\tif time.Now().After(deadline) {\n\t\t\t\to.log.Warn(\"Timed out installing vscode-server\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tentries, err := os.ReadDir(binDir)\n\t\t\tif err != nil || len(entries) == 0 {\n\t\t\t\to.log.Infof(\"Read dir %s: %v\", binDir, err)\n\t\t\t\to.log.Info(\"Wait until vscode-server is installed...\")\n\t\t\t\t// check new location `$HOME/.vscode-server/cli/servers/Stable-<version>/server/bin/code-server`\n\t\t\t\tnewBinPath, err := o.findCodeServerBinary(location)\n\t\t\t\tif err != nil {\n\t\t\t\t\to.log.Infof(\"Read new location %s: %v\", location, err)\n\t\t\t\t\to.log.Info(\"Wait until vscode-server-insiders is installed...\")\n\t\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tbinPath = newBinPath\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tbinPath = filepath.Join(binDir, entries[0].Name(), \"bin\", \"code-server\")\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\t\t\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\t\t\tcancel()\n\t\t\tif err != nil {\n\t\t\t\to.log.Infof(\"Execute %s: %v\", binPath, command.WrapCommandError(out, err))\n\t\t\t\to.log.Info(\"Wait until vscode-server is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\treturn binPath\n\t}\n\n\tif o.flavor == FlavorCursor {\n\t\t// check legacy location `$HOME/.cursor-server/bin`\n\t\tbinDir := filepath.Join(location, \"bin\")\n\t\tfor {\n\t\t\tif time.Now().After(deadline) {\n\t\t\t\to.log.Warn(\"Timed out installing cursor-server\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tentries, err := os.ReadDir(binDir)\n\t\t\tif err != nil || len(entries) == 0 {\n\t\t\t\to.log.Infof(\"Read dir %s: %v\", binDir, err)\n\t\t\t\to.log.Info(\"Wait until cursor-server is installed...\")\n\t\t\t\t// check new location `$HOME/.cursor-server/cli/servers/Stable-<version>/server/bin/cursor-server`\n\t\t\t\tnewBinPath, err := o.findCodeServerBinary(location)\n\t\t\t\tif err != nil {\n\t\t\t\t\to.log.Infof(\"Read new location %s: %v\", location, err)\n\t\t\t\t\to.log.Info(\"Wait until cursor-server is installed...\")\n\t\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tbinPath = newBinPath\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tbinPath = filepath.Join(binDir, entries[0].Name(), \"bin\", \"cursor-server\")\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\t\t\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\t\t\tcancel()\n\t\t\tif err != nil {\n\t\t\t\to.log.Infof(\"Execute %s: %v\", binPath, command.WrapCommandError(out, err))\n\t\t\t\to.log.Info(\"Wait until cursor-server is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\treturn binPath\n\t}\n\n\tif o.flavor == FlavorPositron {\n\t\t// check legacy location `$HOME/.positron-server/bin`\n\t\tbinDir := filepath.Join(location, \"bin\")\n\t\tfor {\n\t\t\tif time.Now().After(deadline) {\n\t\t\t\to.log.Warn(\"Timed out installing positron-server\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tentries, err := os.ReadDir(binDir)\n\t\t\tif err != nil || len(entries) == 0 {\n\t\t\t\to.log.Infof(\"Read dir %s: %v\", binDir, err)\n\t\t\t\to.log.Info(\"Wait until positron-server is installed...\")\n\t\t\t\t// check new location `$HOME/.positron-server/cli/servers/Stable-<version>/server/bin/positron-server`\n\t\t\t\tnewBinPath, err := o.findCodeServerBinary(location)\n\t\t\t\tif err != nil {\n\t\t\t\t\to.log.Infof(\"Read new location %s: %v\", location, err)\n\t\t\t\t\to.log.Info(\"Wait until positron-server is installed...\")\n\t\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tbinPath = newBinPath\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tbinPath = filepath.Join(binDir, entries[0].Name(), \"bin\", \"positron-server\")\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\t\t\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\t\t\tcancel()\n\t\t\tif err != nil {\n\t\t\t\to.log.Infof(\"Execute %s: %v\", binPath, command.WrapCommandError(out, err))\n\t\t\t\to.log.Info(\"Wait until positron-server is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\treturn binPath\n\t}\n\n\tif o.flavor == FlavorCodium {\n\t\t// check legacy location `$HOME/.vscodium-server/bin`\n\t\tbinDir := filepath.Join(location, \"bin\")\n\t\tfor {\n\t\t\tif time.Now().After(deadline) {\n\t\t\t\to.log.Warn(\"Timed out installing vscodium-server\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tentries, err := os.ReadDir(binDir)\n\t\t\tif err != nil || len(entries) == 0 {\n\t\t\t\to.log.Infof(\"Read dir %s: %v\", binDir, err)\n\t\t\t\to.log.Info(\"Wait until vscodium-server is installed...\")\n\t\t\t\t// check new location `$HOME/.vscodium-server/cli/servers/Stable-<version>/server/bin/code-server`\n\t\t\t\tnewBinPath, err := o.findCodeServerBinary(location)\n\t\t\t\tif err != nil {\n\t\t\t\t\to.log.Infof(\"Read new location %s: %v\", location, err)\n\t\t\t\t\to.log.Info(\"Wait until vscodium is installed...\")\n\t\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tbinPath = newBinPath\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tbinPath = filepath.Join(binDir, entries[0].Name(), \"bin\", \"codium-server\")\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\t\t\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\t\t\tcancel()\n\t\t\tif err != nil {\n\t\t\t\to.log.Infof(\"Execute %s: %v\", binPath, command.WrapCommandError(out, err))\n\t\t\t\to.log.Info(\"Wait until vscodium-server is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\treturn binPath\n\t}\n\n\tif o.flavor == FlavorInsiders {\n\t\tserversDir := filepath.Join(location, \"cli\", \"servers\")\n\t\tfor {\n\t\t\tif time.Now().After(deadline) {\n\t\t\t\to.log.Warn(\"Timed out installing vscode-server-insiders\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tentries, err := os.ReadDir(serversDir)\n\t\t\tif err != nil || len(entries) == 0 {\n\t\t\t\to.log.Infof(\"Read dir %s: %v\", serversDir, err)\n\t\t\t\to.log.Info(\"Wait until vscode-server-insiders is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tinsidersDir := \"\"\n\t\t\t// find first entry with `Insiders-` prefix\n\t\t\tfor _, entry := range entries {\n\t\t\t\tif !entry.IsDir() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif !strings.HasPrefix(entry.Name(), \"Insiders-\") {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tinsidersDir = filepath.Join(serversDir, entry.Name())\n\t\t\t}\n\n\t\t\tif insidersDir == \"\" {\n\t\t\t\to.log.Infof(\"Read dir %s: install dir is missing\", serversDir)\n\t\t\t\to.log.Infof(\"Wait until vscode-server-insiders is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbinPath = filepath.Join(insidersDir, \"server\", \"bin\", \"code-server-insiders\")\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\t\t\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\t\t\tcancel()\n\t\t\tif err != nil {\n\t\t\t\to.log.Infof(\"Execute %s: %v\", binPath, command.WrapCommandError(out, err))\n\t\t\t\to.log.Info(\"Wait until vscode-server-insiders  is installed...\")\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\treturn binPath\n\t}\n\n\treturn binPath\n}\n\nfunc (o *VsCodeServer) findCodeServerBinary(location string) (string, error) {\n\tserversDir := filepath.Join(location, \"cli\", \"servers\")\n\tentries, err := os.ReadDir(serversDir)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"read dir %s: %w\", serversDir, err)\n\t} else if len(entries) == 0 {\n\t\treturn \"\", fmt.Errorf(\"read dir %s: install dir is missing\", serversDir)\n\t}\n\n\tstableDir := \"\"\n\t// find first entry with `Stable-` prefix\n\tfor _, entry := range entries {\n\t\tif !entry.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\tif !strings.HasPrefix(entry.Name(), \"Stable-\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tstableDir = filepath.Join(serversDir, entry.Name())\n\t}\n\n\tif stableDir == \"\" {\n\t\treturn \"\", fmt.Errorf(\"read dir %s: install dir is missing\", serversDir)\n\t}\n\n\tbinPath := filepath.Join(stableDir, \"server\", \"bin\", \"code-server\")\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*4)\n\tout, err := exec.CommandContext(ctx, binPath, \"--help\").CombinedOutput()\n\tcancel()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"execute %s: %w\", binPath, command.WrapCommandError(out, err))\n\t}\n\n\treturn binPath, nil\n}\n\nfunc prepareServerLocation(userName string, create bool, flavor Flavor) (string, error) {\n\tvar err error\n\thomeFolder := \"\"\n\tif userName != \"\" {\n\t\thomeFolder, err = command.GetHome(userName)\n\t} else {\n\t\thomeFolder, err = util.UserHomeDir()\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfolderName := \".vscode-server\"\n\tswitch flavor {\n\tcase FlavorStable:\n\t\tfolderName = \".vscode-server\"\n\tcase FlavorInsiders:\n\t\tfolderName = \".vscode-server-insiders\"\n\tcase FlavorCursor:\n\t\tfolderName = \".cursor-server\"\n\tcase FlavorPositron:\n\t\tfolderName = \".positron-server\"\n\tcase FlavorCodium:\n\t\tfolderName = \".vscodium-server\"\n\tcase FlavorWindsurf:\n\t\tfolderName = \".windsurf-server\"\n\t}\n\n\tfolder := filepath.Join(homeFolder, folderName)\n\tif create {\n\t\terr = os.MkdirAll(folder, 0755)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\treturn folder, nil\n}\n"
  },
  {
    "path": "pkg/ide/zed/zed.go",
    "content": "//go:build !linux\n\npackage zed\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/skratchdot/open-golang/open\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n)\n\n// Open first finds the zed binary for the local platform and then opens the zed editor with the given workspace folder\nfunc Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {\n\tlog.Info(\"Opening Zed editor...\")\n\n\tif len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {\n\t\tworkspaceFolder = fmt.Sprintf(\"/%s\", workspaceFolder)\n\t}\n\n\tsshHost := fmt.Sprintf(\"%s.devpod%s\", workspaceID, workspaceFolder)\n\topenURL := fmt.Sprintf(\"zed://ssh/%s\", sshHost)\n\terr := open.Run(openURL)\n\tif err != nil {\n\t\tlog.Debugf(\"Starting Zed caused error: %v\", err)\n\t\tlog.Errorf(\"Seems like you don't have Zed installed on your computer locally\")\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ide/zed/zed_linux.go",
    "content": "//go:build !windows && !darwin\n\npackage zed\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/log\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n)\n\n// Open first finds the zed binary for the local platform and then opens the zed editor with the given workspace folder\nfunc Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {\n\tlog.Info(\"Opening Zed editor...\")\n\n\tif len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {\n\t\tworkspaceFolder = fmt.Sprintf(\"/%s\", workspaceFolder)\n\t}\n\n\tsshHost := fmt.Sprintf(\"%s.devpod%s\", workspaceID, workspaceFolder)\n\topenURL := fmt.Sprintf(\"zed://ssh/%s\", sshHost)\n\tout, err := exec.Command(\"xdg-open\", openURL).CombinedOutput()\n\tif err != nil {\n\t\tlog.Debugf(\"Starting Zed caused error: %v\", err)\n\t\tlog.Debugf(\"xdg-open %s output: %s\", err, openURL, string(out))\n\t\tlog.Errorf(\"Seems like you don't have Zed installed on your computer locally\")\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/image/auth.go",
    "content": "package image\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/awslabs/amazon-ecr-credential-helper/ecr-login\"\n\t\"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper\"\n\t\"github.com/google/go-containerregistry/pkg/authn\"\n\tkubernetesauth \"github.com/google/go-containerregistry/pkg/authn/kubernetes\"\n\t\"github.com/google/go-containerregistry/pkg/v1/google\"\n\t\"gopkg.in/square/go-jose.v2/jwt\"\n)\n\nvar (\n\tamazonKeychain authn.Keychain = authn.NewKeychainFromHelper(ecr.NewECRHelper(ecr.WithLogger(io.Discard)))\n\tazureKeychain  authn.Keychain = authn.NewKeychainFromHelper(credhelper.NewACRCredentialsHelper())\n)\n\nconst tokenFileLocation = \"/var/run/secrets/kubernetes.io/serviceaccount/token\"\n\n// See https://github.com/kubernetes/kubernetes/blob/30ae12d018697d3c5f04e225b11f242f5310e097/pkg/serviceaccount/claims.go#L55\ntype privateClaims struct {\n\tKubernetes kubernetesClaim `json:\"kubernetes.io,omitempty\"`\n}\n\ntype kubernetesClaim struct {\n\tNamespace string           `json:\"namespace,omitempty\"`\n\tSvcacct   ref              `json:\"serviceaccount,omitempty\"`\n\tPod       *ref             `json:\"pod,omitempty\"`\n\tSecret    *ref             `json:\"secret,omitempty\"`\n\tNode      *ref             `json:\"node,omitempty\"`\n\tWarnAfter *jwt.NumericDate `json:\"warnafter,omitempty\"`\n}\n\ntype ref struct {\n\tName string `json:\"name,omitempty\"`\n\tUID  string `json:\"uid,omitempty\"`\n}\n\nfunc GetKeychain(ctx context.Context) (authn.Keychain, error) {\n\ttokenBytes, err := os.ReadFile(tokenFileLocation)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t// we're not in a kubernetes pod, use default keychain\n\t\t\treturn authn.DefaultKeychain, nil\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"failed to read kubernetes service account token: %w\", err)\n\t}\n\n\t// in-cluster auth\n\tm, err := getPodMetadata(tokenBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tk8sKeychain, err := kubernetesauth.NewInCluster(ctx, kubernetesauth.Options{\n\t\tServiceAccountName: m.serviceAccountName,\n\t\tNamespace:          m.namespace,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// add default keychains\n\tkeyChains := []authn.Keychain{\n\t\tk8sKeychain,\n\t\tgoogle.Keychain,\n\t\tamazonKeychain,\n\t}\n\n\t// check if we should add azure keychain\n\tif os.Getenv(\"AZURE_CLIENT_ID\") != \"\" && os.Getenv(\"AZURE_TENANT_ID\") != \"\" {\n\t\tkeyChains = append(keyChains, azureKeychain)\n\t}\n\tkeyChains = append(keyChains, authn.DefaultKeychain)\n\n\t// Order matters here: We want to go through all of the cloud provider keychains before we hit the default keychain (docker config.json)\n\treturn authn.NewMultiKeychain(\n\t\tkeyChains...,\n\t), nil\n}\n\ntype podMetadata struct {\n\tserviceAccountName string\n\tnamespace          string\n}\n\nfunc getPodMetadata(token []byte) (podMetadata, error) {\n\tt, err := jwt.ParseSigned(string(token))\n\tif err != nil {\n\t\treturn podMetadata{}, fmt.Errorf(\"failed to parse kubernetes service account token: %w\", err)\n\t}\n\n\tprivateClaims := privateClaims{}\n\terr = t.UnsafeClaimsWithoutVerification(&privateClaims)\n\tif err != nil {\n\t\treturn podMetadata{}, fmt.Errorf(\"failed to get claims from kubernetes service account token: %w\", err)\n\t}\n\n\tkubeClaim := privateClaims.Kubernetes\n\t// get serviceaccount name and imagepullsecret\n\tif kubeClaim.Namespace == \"\" || kubeClaim.Svcacct.Name == \"\" {\n\t\treturn podMetadata{}, fmt.Errorf(\"failed to retrieve pod metadata from kubernetes service account token: %w\", err)\n\t}\n\n\treturn podMetadata{\n\t\tnamespace:          kubeClaim.Namespace,\n\t\tserviceAccountName: kubeClaim.Svcacct.Name,\n\t}, nil\n}\n"
  },
  {
    "path": "pkg/image/image.go",
    "content": "package image\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"regexp\"\n\n\t\"github.com/google/go-containerregistry/pkg/authn\"\n\t\"github.com/google/go-containerregistry/pkg/name\"\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nvar (\n\tdockerTagRegexp  = regexp.MustCompile(`^[\\w][\\w.-]*$`)\n\tDockerTagMaxSize = 128\n)\n\nfunc GetImage(ctx context.Context, image string) (v1.Image, error) {\n\tref, err := name.ParseReference(image)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkeychain, err := GetKeychain(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create authentication keychain: %w\", err)\n\t}\n\n\timg, err := remote.Image(ref, remote.WithAuthFromKeychain(keychain))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"retrieve image %s\", image)\n\t}\n\n\treturn img, err\n}\n\nfunc GetImageForArch(ctx context.Context, image, arch string) (v1.Image, error) {\n\tref, err := name.ParseReference(image)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkeychain, err := GetKeychain(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create authentication keychain: %w\", err)\n\t}\n\n\tremoteOptions := []remote.Option{\n\t\tremote.WithAuthFromKeychain(keychain),\n\t\tremote.WithPlatform(v1.Platform{Architecture: arch, OS: \"linux\"}),\n\t}\n\n\timg, err := remote.Image(ref, remoteOptions...)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"retrieve image %s\", image)\n\t}\n\n\treturn img, err\n}\nfunc CheckPushPermissions(image string) error {\n\tref, err := name.ParseReference(image)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = remote.CheckPushPermission(ref, authn.DefaultKeychain, http.DefaultTransport)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc GetImageConfig(ctx context.Context, image string, log log.Logger) (*v1.ConfigFile, v1.Image, error) {\n\tlog.Debugf(\"Getting image config for image '%s'\", image)\n\tdefer log.Debugf(\"Done getting image config for image '%s'\", image)\n\n\timg, err := GetImage(ctx, image)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tconfigFile, err := img.ConfigFile()\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"config file\")\n\t}\n\n\treturn configFile, img, nil\n}\n\nfunc ValidateTags(tags []string) error {\n\tfor _, tag := range tags {\n\t\tif !IsValidDockerTag(tag) {\n\t\t\treturn fmt.Errorf(`%q is not a valid docker tag`, tag)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc IsValidDockerTag(tag string) bool {\n\treturn shouldNotBeSlugged(tag, dockerTagRegexp, DockerTagMaxSize)\n}\n\nfunc shouldNotBeSlugged(data string, regexp *regexp.Regexp, maxSize int) bool {\n\treturn len(data) == 0 || regexp.Match([]byte(data)) && len(data) <= maxSize\n}\n"
  },
  {
    "path": "pkg/inject/delayed_writer.go",
    "content": "package inject\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"sync\"\n)\n\nfunc newDelayedWriter(writer io.Writer) *delayedWriter {\n\treturn &delayedWriter{writer: writer}\n}\n\ntype delayedWriter struct {\n\tm       sync.Mutex\n\tstarted bool\n\n\tbuffer bytes.Buffer\n\twriter io.Writer\n}\n\nfunc (d *delayedWriter) Buffer() []byte {\n\td.m.Lock()\n\tdefer d.m.Unlock()\n\n\treturn d.buffer.Bytes()\n}\n\nfunc (d *delayedWriter) Start() {\n\tif d.writer == nil {\n\t\treturn\n\t}\n\n\td.m.Lock()\n\tdefer d.m.Unlock()\n\n\tif d.started {\n\t\treturn\n\t}\n\n\td.started = true\n\tdata := d.buffer.Bytes()\n\tif len(data) == 0 {\n\t\treturn\n\t}\n\n\t_, _ = d.writer.Write(data)\n}\n\nfunc (d *delayedWriter) Write(p []byte) (n int, err error) {\n\tif d.writer == nil {\n\t\treturn len(p), nil\n\t}\n\n\td.m.Lock()\n\tdefer d.m.Unlock()\n\n\tif d.started {\n\t\treturn d.writer.Write(p)\n\t}\n\treturn d.buffer.Write(p)\n}\n"
  },
  {
    "path": "pkg/inject/download_urls.go",
    "content": "package inject\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n)\n\nconst AmdUrl = \"devpod-linux-amd64\"\nconst ArmUrl = \"devpod-linux-arm64\"\nconst BinNamePlaceholder = \"${BIN_NAME}\"\n\ntype DownloadURLs struct {\n\tBase string\n\tAmd  string\n\tArm  string\n}\n\nfunc NewDownloadURLs(baseUrl string) *DownloadURLs {\n\tvar amdUrl, armUrl string\n\n\t// replace ${BIN_NAME} with binary name\n\tif strings.Contains(baseUrl, BinNamePlaceholder) {\n\t\tbaseUrl = strings.TrimSuffix(baseUrl, \"/\")\n\t\tamdUrl = strings.Replace(baseUrl, BinNamePlaceholder, AmdUrl, 1)\n\t\tarmUrl = strings.Replace(baseUrl, BinNamePlaceholder, ArmUrl, 1)\n\t} else {\n\t\tamdUrl, _ = url.JoinPath(baseUrl, AmdUrl)\n\t\tarmUrl, _ = url.JoinPath(baseUrl, ArmUrl)\n\t}\n\n\treturn &DownloadURLs{\n\t\tBase: baseUrl,\n\t\tAmd:  amdUrl,\n\t\tArm:  armUrl,\n\t}\n}\n"
  },
  {
    "path": "pkg/inject/inject.go",
    "content": "package inject\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t_ \"embed\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n)\n\n//go:embed inject.sh\nvar Script string\n\ntype ExecFunc func(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error\n\ntype LocalFile func(arm bool) (io.ReadCloser, error)\n\ntype injectResult struct {\n\twasExecuted bool\n\terr         error\n}\n\nfunc InjectAndExecute(\n\tctx context.Context,\n\texec ExecFunc,\n\tlocalFile LocalFile,\n\tscriptParams *Params,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\tstderr io.Writer,\n\ttimeout time.Duration,\n\tlog log.Logger,\n) (bool, error) {\n\tscriptRawCode, err := GenerateScript(Script, scriptParams)\n\tif err != nil {\n\t\treturn true, err\n\t}\n\n\tlog.Debugf(\"execute inject script\")\n\tif scriptParams.PreferAgentDownload {\n\t\tlog.Debugf(\"download agent from %s\", scriptParams.DownloadURLs.Base)\n\t}\n\n\tdefer log.Debugf(\"done injecting\")\n\n\t// start script\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn true, err\n\t}\n\tdefer stdinWriter.Close()\n\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn true, err\n\t}\n\n\t// delayed stderr\n\tdelayedStderr := newDelayedWriter(stderr)\n\n\t// check if context is done\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn true, context.Canceled\n\tdefault:\n\t}\n\n\t// create cancel context\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// start execution of inject.sh\n\texecErrChan := make(chan error, 1)\n\tgo func() {\n\t\tdefer stdoutWriter.Close()\n\t\tdefer log.Debugf(\"done exec\")\n\n\t\terr := exec(cancelCtx, scriptRawCode, stdinReader, stdoutWriter, delayedStderr)\n\t\tif err != nil && !errors.Is(err, context.Canceled) && !strings.Contains(err.Error(), \"signal: \") {\n\t\t\texecErrChan <- command.WrapCommandError(delayedStderr.Buffer(), err)\n\t\t} else {\n\t\t\texecErrChan <- nil\n\t\t}\n\t}()\n\n\t// inject file\n\tinjectChan := make(chan injectResult, 1)\n\tgo func() {\n\t\tdefer stdinWriter.Close()\n\t\tdefer log.Debugf(\"done inject\")\n\n\t\twasExecuted, err := inject(localFile, stdinWriter, stdin, stdoutReader, stdout, delayedStderr, timeout, log)\n\t\tinjectChan <- injectResult{\n\t\t\twasExecuted: wasExecuted,\n\t\t\terr:         command.WrapCommandError(delayedStderr.Buffer(), err),\n\t\t}\n\t}()\n\n\t// wait here\n\tvar result injectResult\n\tselect {\n\tcase err = <-execErrChan:\n\t\tresult = <-injectChan\n\tcase result = <-injectChan:\n\t\t// we don't wait for the command termination here and will just retry on error\n\t}\n\n\t// prefer result error\n\tif result.err != nil {\n\t\treturn result.wasExecuted, result.err\n\t} else if err != nil {\n\t\treturn result.wasExecuted, err\n\t} else if result.wasExecuted || scriptParams.Command == \"\" {\n\t\treturn result.wasExecuted, nil\n\t}\n\n\tlog.Debugf(\"Rerun command as binary was injected\")\n\tdelayedStderr.Start()\n\treturn true, exec(ctx, scriptParams.Command, stdin, stdout, delayedStderr)\n}\n\nfunc inject(\n\tlocalFile LocalFile,\n\tstdin io.WriteCloser,\n\tstdinOut io.Reader,\n\tstdout io.ReadCloser,\n\tstdoutOut io.Writer,\n\tdelayedStderr *delayedWriter,\n\ttimeout time.Duration,\n\tlog log.Logger,\n) (bool, error) {\n\t// wait until we read start\n\tvar line string\n\terrChan := make(chan error)\n\tgo func() {\n\t\tvar err error\n\t\tline, err = readLine(stdout)\n\t\terrChan <- err\n\t}()\n\n\t// wait for line to be read\n\terr := waitForMessage(errChan, timeout)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\terr = performMutualHandshake(line, stdin)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// wait until we read something\n\tline, err = readLine(stdout)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tlog.Debugf(\"Received line after pong: %v\", line)\n\n\tlineStr := strings.TrimSpace(line)\n\tif isInjectingOfBinaryNeeded(lineStr) {\n\t\tlog.Debugf(\"Inject binary\")\n\t\tdefer log.Debugf(\"Done injecting binary\")\n\n\t\tfileReader, err := getFileReader(localFile, lineStr)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tdefer fileReader.Close()\n\t\terr = injectBinary(fileReader, stdin, stdout)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t_ = stdout.Close()\n\t\t// start exec with command\n\t\treturn false, nil\n\t} else if lineStr != \"done\" {\n\t\treturn false, fmt.Errorf(\"unexpected message during inject: %s\", lineStr)\n\t}\n\n\tif stdoutOut == nil {\n\t\tstdoutOut = io.Discard\n\t}\n\tif stdinOut == nil {\n\t\tstdinOut = bytes.NewReader(nil)\n\t}\n\n\t// now pipe reader into stdout\n\tdelayedStderr.Start()\n\treturn true, pipe(\n\t\tstdin, stdinOut,\n\t\tstdoutOut, stdout,\n\t)\n}\n\nfunc isInjectingOfBinaryNeeded(lineStr string) bool {\n\treturn strings.HasPrefix(lineStr, \"ARM-\")\n}\n\nfunc getFileReader(localFile LocalFile, lineStr string) (io.ReadCloser, error) {\n\tisArm := strings.TrimPrefix(lineStr, \"ARM-\") == \"true\"\n\treturn localFile(isArm)\n}\n\nfunc performMutualHandshake(line string, stdin io.WriteCloser) error {\n\t// check for string\n\tif strings.TrimSpace(line) != \"ping\" {\n\t\treturn fmt.Errorf(\"unexpected start line: %v\", line)\n\t}\n\n\t// send our response\n\t_, err := stdin.Write([]byte(\"pong\\n\"))\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"write to stdin\")\n\t}\n\n\t// successful handshake\n\treturn nil\n}\n\nfunc injectBinary(\n\tfileReader io.ReadCloser,\n\tstdin io.WriteCloser,\n\tstdout io.ReadCloser,\n) error {\n\t// copy into writer\n\t_, err := io.Copy(stdin, fileReader)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// close stdin\n\t_ = stdin.Close()\n\n\t// wait for done\n\tline, err := readLine(stdout)\n\tif err != nil {\n\t\treturn err\n\t} else if strings.TrimSpace(line) != \"done\" {\n\t\treturn fmt.Errorf(\"unexpected line during inject: %s\", line)\n\t}\n\treturn nil\n}\n\nfunc waitForMessage(errChannel chan error, timeout time.Duration) error {\n\tselect {\n\tcase err := <-errChannel:\n\t\treturn err\n\tcase <-time.After(timeout):\n\t\treturn context.DeadlineExceeded\n\t}\n}\n\nfunc readLine(reader io.Reader) (string, error) {\n\t// we always only read a single byte\n\tbuf := make([]byte, 1)\n\tstr := \"\"\n\tfor {\n\t\tn, err := reader.Read(buf)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t} else if n == 0 {\n\t\t\tcontinue\n\t\t} else if buf[0] == '\\n' {\n\t\t\treturn str, nil\n\t\t}\n\n\t\tstr += string(buf)\n\t}\n}\n\nfunc pipe(toStdin io.Writer, fromStdin io.Reader, toStdout io.Writer, fromStdout io.Reader) error {\n\terrChan := make(chan error, 2)\n\tgo func() {\n\t\t_, err := io.Copy(toStdout, fromStdout)\n\t\terrChan <- err\n\t}()\n\tgo func() {\n\t\t_, err := io.Copy(toStdin, fromStdin)\n\t\terrChan <- err\n\t}()\n\treturn <-errChan\n}\n"
  },
  {
    "path": "pkg/inject/inject.sh",
    "content": "#!/bin/sh\nset -e\n\n# Compatibility fix for zsh shells\nsetopt SH_WORD_SPLIT 2>/dev/null || :\n\nINSTALL_DIR=\"{{ .InstallDir }}\"\nINSTALL_FILENAME=\"{{ .InstallFilename }}\"\n\nINSTALL_PATH=\"$INSTALL_DIR/$INSTALL_FILENAME\"\nPREFER_DOWNLOAD=\"{{ .PreferDownload }}\"\nCHMOD_PATH=\"{{ .ChmodPath }}\"\n\n# start marker\necho \"ping\"\n\n# we don't want the script to do anything without us\nIFS='$\\n' read -r DEVPOD_PING\nif [ \"$DEVPOD_PING\" != \"pong\" ]; then\n  >&2 echo \"Received wrong answer for ping request $DEVPOD_PING\"\n  exit 1\nfi\n\ncommand_exists() {\n  command -v \"$@\" >/dev/null 2>&1\n}\n\nis_arm() {\n  case \"$(uname -a)\" in\n  *arm* ) true;;\n  *arm64* ) true;;\n  *aarch* ) true;;\n  *aarch64* ) true;;\n  * ) false;;\n  esac\n}\n\n# Detect if install_dir is noexec\n# We use this method instead of findmnt, as that command might not be present\n# on minimal images, like alpine\ncheck_noexec() {\n  # Find mountpoint of the install path\n  mount_path=\"$(df \"${INSTALL_DIR}\" | tail -n +2 | rev | cut -d' ' -f1 | rev)\"\n\n  # Check if mountpoint is noexec, fail early\n  if mount | grep \"on ${mount_path} \" | grep -q noexec; then\n    echo >&2 \"ERROR: installation directory $INSTALL_DIR is noexec, please choose another location\"\n    return 1\n  fi\n\n  return 0\n}\n\ninject() {\n  echo \"ARM-$(is_arm && echo -n 'true' || echo -n 'false')\"\n  $sh_c \"cat > $INSTALL_PATH.$$\"\n  $sh_c \"mv $INSTALL_PATH.$$ $INSTALL_PATH\"\n\n  if [ \"$CHMOD_PATH\" = \"true\" ]; then\n    $sh_c \"chmod +x $INSTALL_PATH\"\n  fi\n\n  echo \"done\"\n  exit 0\n}\n\ndownload() {\n  DOWNLOAD_URL=\"{{ .DownloadAmd }}\"\n  if is_arm; then\n    DOWNLOAD_URL=\"{{ .DownloadArm }}\"\n  fi\n  iteration=1\n  max_iteration=3\n\n  while :; do\n    if [ \"$iteration\" -gt \"$max_iteration\" ]; then\n      >&2 echo \"error: failed to download devpod\"\n      exit 1\n    fi\n\n    cmd_status=\"\"\n    if command_exists curl; then\n        $sh_c \"curl -fsSL $DOWNLOAD_URL -o $INSTALL_PATH.$$\" && break\n        cmd_status=$?\n    elif command_exists wget; then\n        $sh_c \"wget -q $DOWNLOAD_URL -O $INSTALL_PATH.$$\" && break\n        cmd_status=$?\n    else\n        echo \"error: no download tool found, please install curl or wget\"\n        exit 127\n    fi\n    >&2 echo \"error: failed to download devpod\"\n    >&2 echo \"       command returned: ${cmd_status}\"\n    >&2 echo \"Trying again in 10 seconds...\"\n    iteration=$((iteration+1))\n    sleep 10\n  done\n\n  $sh_c \"mv $INSTALL_PATH.$$ $INSTALL_PATH\"\n}\n\n\nif {{ .ExistsCheck }}; then\n  user=\"$(id -un || true)\"\n  sh_c='sh -c'\n\n  # Try to create the install dir, if we fail, we search for sudo\n  # else let's continue without sudo, we don't need it.\n  if (! mkdir -p $INSTALL_DIR 2>/dev/null || ! touch $INSTALL_PATH 2>/dev/null || ! chmod +x $INSTALL_PATH 2>/dev/null || ! rm -f $INSTALL_PATH 2>/dev/null); then\n    if command_exists sudo; then\n      # check if sudo requires a password\n      if ! sudo -nl >/dev/null 2>&1; then\n        >&2 echo Error: sudo requires a password and no password is available. Please ensure your user account is configured with NOPASSWD.\n        exit 1\n      fi\n      sh_c='sudo -E sh -c'\n    elif command_exists su; then\n      sh_c='su -c'\n    else\n      >&2 echo Error: this installer needs the ability to run commands as root.\n      >&2 echo We are unable to find either \"sudo\" or \"su\" available to make this happen.\n      exit 1\n    fi\n\n    # Now that we're sudo, try again\n    $sh_c \"mkdir -p $INSTALL_DIR\"\n  fi\n\n  if  ! check_noexec; then\n    echo >&2 Error: failed to install devpod, noexec filesystem detected\n    exit 1\n  fi\n\n  $sh_c \"rm -f $INSTALL_PATH 2>/dev/null || true\"\n  if [ \"$PREFER_DOWNLOAD\" = \"true\" ]; then\n    download || inject\n  else\n    inject || download\n  fi\n\n  if [ \"$CHMOD_PATH\" = \"true\" ]; then\n    $sh_c \"chmod +x $INSTALL_PATH\"\n  fi\n\n  if {{ .ExistsCheck }}; then\n    >&2 echo Error: failed to install devpod\n    exit 1\n  fi\nfi\n\n# send parent done stream\necho \"done\"\n\n# set download url\nexport DEVPOD_AGENT_URL={{ .DownloadBase }}\n\n# Execute command\n{{ .Command }}\n"
  },
  {
    "path": "pkg/inject/script.go",
    "content": "package inject\n\nimport (\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/template\"\n)\n\nfunc GenerateScript(script string, params *Params) (string, error) {\n\trawCode, err := template.FillTemplate(script, map[string]string{\n\t\t\"Command\":         params.Command,\n\t\t\"ExistsCheck\":     params.ExistsCheck,\n\t\t\"InstallDir\":      params.InstallDir(),\n\t\t\"InstallFilename\": params.InstallFilename(),\n\t\t\"PreferDownload\":  params.PreferDownload(),\n\t\t\"ChmodPath\":       params.ChmodPath(),\n\t\t\"DownloadBase\":    params.DownloadURLs.Base,\n\t\t\"DownloadAmd\":     params.DownloadURLs.Amd,\n\t\t\"DownloadArm\":     params.DownloadURLs.Arm,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn stripCarriageReturns(rawCode), nil\n}\n\ntype Params struct {\n\tCommand         string\n\tAgentRemotePath string\n\tDownloadURLs    *DownloadURLs\n\n\tExistsCheck         string\n\tPreferAgentDownload bool\n\tShouldChmodPath     bool\n}\n\nfunc (p *Params) InstallDir() string {\n\treturn path.Dir(p.AgentRemotePath)\n}\n\nfunc (p *Params) InstallFilename() string {\n\treturn path.Base(p.AgentRemotePath)\n}\n\nfunc (p *Params) PreferDownload() string {\n\treturn strconv.FormatBool(p.PreferAgentDownload)\n}\n\nfunc (p *Params) ChmodPath() string {\n\treturn strconv.FormatBool(p.ShouldChmodPath)\n}\n\nfunc stripCarriageReturns(script string) string {\n\treturn strings.ReplaceAll(script, \"\\r\", \"\")\n}\n"
  },
  {
    "path": "pkg/language/language.go",
    "content": "package language\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/log\"\n\n\tdetector \"github.com/loft-sh/programming-language-detection/pkg/detector\"\n)\n\ntype ProgrammingLanguage string\n\nconst (\n\tJavaScript ProgrammingLanguage = \"JavaScript\"\n\tTypeScript ProgrammingLanguage = \"TypeScript\"\n\tPython     ProgrammingLanguage = \"Python\"\n\tGo         ProgrammingLanguage = \"Go\"\n\tCpp        ProgrammingLanguage = \"C++\"\n\tC          ProgrammingLanguage = \"C\"\n\tDotNet     ProgrammingLanguage = \"C#\"\n\tPHP        ProgrammingLanguage = \"Php\"\n\tJava       ProgrammingLanguage = \"Java\"\n\tRust       ProgrammingLanguage = \"Rust\"\n\tRuby       ProgrammingLanguage = \"Ruby\"\n\tNone       ProgrammingLanguage = \"None\"\n)\n\nvar SupportedLanguages = map[ProgrammingLanguage]bool{\n\tJavaScript: true,\n\tTypeScript: true,\n\tPython:     true,\n\tC:          true,\n\tCpp:        true,\n\tDotNet:     true,\n\tGo:         true,\n\tPHP:        true,\n\tJava:       true,\n\tRust:       true,\n\tRuby:       true,\n\tNone:       true,\n}\n\nvar MapLanguages = map[ProgrammingLanguage]ProgrammingLanguage{\n\tTypeScript: JavaScript,\n\tC:          Cpp,\n}\n\nvar MapConfig = map[ProgrammingLanguage]*config.DevContainerConfig{\n\tNone: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/base:ubuntu\",\n\t\t},\n\t},\n\tJavaScript: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/javascript-node\",\n\t\t},\n\t},\n\tPython: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/python:3\",\n\t\t},\n\t},\n\tJava: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/java\",\n\t\t},\n\t},\n\tGo: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/go\",\n\t\t},\n\t},\n\tRust: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/rust:latest\",\n\t\t},\n\t},\n\tRuby: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/ruby\",\n\t\t},\n\t},\n\tPHP: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/php\",\n\t\t},\n\t},\n\tCpp: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/cpp\",\n\t\t},\n\t},\n\tDotNet: {\n\t\tImageContainer: config.ImageContainer{\n\t\t\tImage: \"mcr.microsoft.com/devcontainers/dotnet\",\n\t\t},\n\t},\n}\n\nfunc DefaultConfig(startPath string, log log.Logger) *config.DevContainerConfig {\n\tlanguage, err := DetectLanguage(startPath)\n\tif err != nil {\n\t\tlog.Errorf(\"Error detecting project language: %v\", err)\n\t\tlog.Infof(\"Couldn't detect project language, fallback to 'None'\")\n\t\treturn MapConfig[None]\n\t} else if MapConfig[language] == nil {\n\t\tlog.Infof(\"Couldn't detect project language, fallback to 'None'\")\n\t\treturn MapConfig[None]\n\t}\n\n\tlog.Infof(\"Detected project language '%s'\", language)\n\treturn MapConfig[language]\n}\n\nfunc DetectLanguage(startPath string) (ProgrammingLanguage, error) {\n\tmaxFiles := 5000\n\n\troot, err := filepath.Abs(startPath)\n\tif err != nil {\n\t\treturn None, err\n\t}\n\n\tfileInfo, err := os.Stat(root)\n\tif err != nil {\n\t\treturn None, err\n\t}\n\n\tif fileInfo.Mode().IsRegular() {\n\t\treturn None, err\n\t}\n\n\tlanguage := detector.GetLanguage(root, maxFiles)\n\tif !SupportedLanguages[ProgrammingLanguage(language)] {\n\t\treturn None, nil\n\t}\n\n\t// try to map language\n\tif MapLanguages[ProgrammingLanguage(language)] != \"\" {\n\t\tlanguage = string(MapLanguages[ProgrammingLanguage(language)])\n\t}\n\n\treturn ProgrammingLanguage(language), nil\n}\n"
  },
  {
    "path": "pkg/loftconfig/client.go",
    "content": "package loftconfig\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/credentials\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc GetLoftConfig(context, provider string, port int, logger log.Logger) (*client.Config, error) {\n\trequest := &LoftConfigRequest{\n\t\tContext:  context,\n\t\tProvider: provider,\n\t}\n\n\trawJson, err := json.Marshal(request)\n\tif err != nil {\n\t\tlogger.Errorf(\"Error parsing request: %w\", err)\n\t\treturn nil, err\n\t}\n\n\tconfigResponse := &LoftConfigResponse{}\n\tout, err := credentials.PostWithRetry(port, \"loft-platform-credentials\", bytes.NewReader(rawJson), logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = json.Unmarshal(out, configResponse)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"decode loft config %s: %w\", string(out), err)\n\t}\n\n\treturn configResponse.LoftConfig, nil\n}\n"
  },
  {
    "path": "pkg/loftconfig/config.go",
    "content": "package loftconfig\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc AuthDevpodCliToPlatform(config *client.Config, logger log.Logger) error {\n\tcmd := exec.Command(\"devpod\", \"pro\", \"login\", \"--access-key\", config.AccessKey, config.Host)\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogger.Debugf(\"Failed executing `devpod pro login`: %w, output: %s\", err, out)\n\t\treturn fmt.Errorf(\"error executing 'devpod pro login' command: %w, access key: %v, host: %v\", err, config.AccessKey, config.Host)\n\t}\n\n\treturn nil\n}\n\nfunc AuthVClusterCliToPlatform(config *client.Config, logger log.Logger) error {\n\t// Check if vcluster is available inside the workspace\n\tif _, err := exec.LookPath(\"vcluster\"); err != nil {\n\t\tlogger.Debugf(\"'vcluster' command is not available\")\n\t\treturn nil\n\t}\n\n\tcmd := exec.Command(\"vcluster\", \"login\", \"--access-key\", config.AccessKey, config.Host)\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogger.Debugf(\"Failed executing `vcluster login` : %w, output: %s\", err, out)\n\t\treturn fmt.Errorf(\"error executing 'vcluster login' command: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/loftconfig/server.go",
    "content": "package loftconfig\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n)\n\nconst (\n\tLoftPlatformConfigFileName = \"loft-config.json\" // TODO: move somewhere else, replace hardoced strings with usage of this const\n)\n\ntype LoftConfigRequest struct {\n\t// Deprecated. Do not use anymore\n\tContext string\n\t// Deprecated. Do not use anymore\n\tProvider string\n}\n\ntype LoftConfigResponse struct {\n\tLoftConfig *client.Config\n}\n\nfunc Read(request *LoftConfigRequest) (*LoftConfigResponse, error) {\n\tloftConfig, err := readConfig(request.Context, request.Provider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &LoftConfigResponse{LoftConfig: loftConfig}, nil\n}\n\nfunc ReadFromWorkspace(workspace *provider.Workspace) (*LoftConfigResponse, error) {\n\tloftConfig, err := readConfig(workspace.Context, workspace.Provider.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &LoftConfigResponse{LoftConfig: loftConfig}, nil\n}\n\nfunc readConfig(contextName string, providerName string) (*client.Config, error) {\n\tproviderDir, err := provider.GetProviderDir(contextName, providerName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigPath := filepath.Join(providerDir, LoftPlatformConfigFileName)\n\n\t// Check if given context and provider have Loft Platform configuration\n\tif _, err := os.Stat(configPath); os.IsNotExist(err) {\n\t\t// If not just return empty response\n\t\treturn &client.Config{}, nil\n\t}\n\n\tcontent, err := os.ReadFile(configPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tloftConfig := &client.Config{}\n\terr = json.Unmarshal(content, loftConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn loftConfig, nil\n}\n"
  },
  {
    "path": "pkg/log/jsonstream.go",
    "content": "package log\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc PipeJSONStream(logger log.Logger) (io.WriteCloser, chan struct{}) {\n\tdone := make(chan struct{})\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tReadJSONStream(reader, logger)\n\t\tclose(done)\n\t}()\n\n\treturn writer, done\n}\n\nfunc ReadJSONStream(reader io.Reader, logger log.Logger) {\n\tscan := scanner.NewScanner(reader)\n\tfor scan.Scan() {\n\t\tlineObject, err := Unmarshal(scan.Bytes())\n\t\tif err == nil && lineObject.Message != \"\" {\n\t\t\tswitch lineObject.Level {\n\t\t\tcase logrus.TraceLevel:\n\t\t\t\tlogger.Debug(lineObject.Message)\n\t\t\tcase logrus.DebugLevel:\n\t\t\t\tlogger.Debug(lineObject.Message)\n\t\t\tcase logrus.InfoLevel:\n\t\t\t\tlogger.Info(lineObject.Message)\n\t\t\tcase logrus.WarnLevel:\n\t\t\t\tlogger.Warn(lineObject.Message)\n\t\t\tcase logrus.ErrorLevel:\n\t\t\t\tlogger.Error(lineObject.Message)\n\t\t\tcase logrus.PanicLevel:\n\t\t\t\tlogger.Error(lineObject.Message)\n\t\t\tcase logrus.FatalLevel:\n\t\t\t\tlogger.Error(lineObject.Message)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc Unmarshal(line []byte) (*log.Line, error) {\n\tlineObject := &log.Line{}\n\terr := json.Unmarshal(line, lineObject)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn lineObject, nil\n}\n"
  },
  {
    "path": "pkg/log/log.go",
    "content": "package log\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"sync\"\n\n\t\"github.com/go-logr/logr\"\n\tlogLib \"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// CombinedLogger implements the Logger interface and delegates logging to multiple loggers\ntype CombinedLogger struct {\n\tloggers []logLib.Logger\n\tm       sync.Mutex\n\tlevel   logrus.Level\n}\n\n// NewCombinedLogger creates a new CombinedLogger\nfunc NewCombinedLogger(level logrus.Level, loggers ...logLib.Logger) *CombinedLogger {\n\treturn &CombinedLogger{\n\t\tloggers: loggers,\n\t\tlevel:   level,\n\t}\n}\n\n// log is a helper to execute a function for all loggers at the appropriate log level\nfunc (c *CombinedLogger) log(level logrus.Level, logFunc func(logLib.Logger)) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tif level > c.level {\n\t\treturn\n\t}\n\n\tfor _, logger := range c.loggers {\n\t\tlogFunc(logger)\n\t}\n}\n\nfunc (c *CombinedLogger) Debug(args ...interface{}) {\n\tc.log(logrus.DebugLevel, func(logger logLib.Logger) {\n\t\tlogger.Debug(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Debugf(format string, args ...interface{}) {\n\tc.log(logrus.DebugLevel, func(logger logLib.Logger) {\n\t\tlogger.Debugf(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Info(args ...interface{}) {\n\tc.log(logrus.InfoLevel, func(logger logLib.Logger) {\n\t\tlogger.Info(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Infof(format string, args ...interface{}) {\n\tc.log(logrus.InfoLevel, func(logger logLib.Logger) {\n\t\tlogger.Infof(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Warn(args ...interface{}) {\n\tc.log(logrus.WarnLevel, func(logger logLib.Logger) {\n\t\tlogger.Warn(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Warnf(format string, args ...interface{}) {\n\tc.log(logrus.WarnLevel, func(logger logLib.Logger) {\n\t\tlogger.Warnf(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Error(args ...interface{}) {\n\tc.log(logrus.ErrorLevel, func(logger logLib.Logger) {\n\t\tlogger.Error(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Errorf(format string, args ...interface{}) {\n\tc.log(logrus.ErrorLevel, func(logger logLib.Logger) {\n\t\tlogger.Errorf(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Fatal(args ...interface{}) {\n\tc.log(logrus.FatalLevel, func(logger logLib.Logger) {\n\t\tlogger.Fatal(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Fatalf(format string, args ...interface{}) {\n\tc.log(logrus.FatalLevel, func(logger logLib.Logger) {\n\t\tlogger.Fatalf(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Done(args ...interface{}) {\n\tc.log(logrus.InfoLevel, func(logger logLib.Logger) {\n\t\tlogger.Done(args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Donef(format string, args ...interface{}) {\n\tc.log(logrus.InfoLevel, func(logger logLib.Logger) {\n\t\tlogger.Donef(format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Print(level logrus.Level, args ...interface{}) {\n\tc.log(level, func(logger logLib.Logger) {\n\t\tlogger.Print(level, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) Printf(level logrus.Level, format string, args ...interface{}) {\n\tc.log(level, func(logger logLib.Logger) {\n\t\tlogger.Printf(level, format, args...)\n\t})\n}\n\nfunc (c *CombinedLogger) SetLevel(level logrus.Level) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tc.level = level\n\tfor _, logger := range c.loggers {\n\t\tlogger.SetLevel(level)\n\t}\n}\n\nfunc (c *CombinedLogger) GetLevel() logrus.Level {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\treturn c.level\n}\n\nfunc (c *CombinedLogger) WriteString(level logrus.Level, message string) {\n\tc.log(level, func(logger logLib.Logger) {\n\t\tlogger.WriteString(level, message)\n\t})\n}\n\nfunc (c *CombinedLogger) WriteLevel(level logrus.Level, message []byte) (int, error) {\n\tc.log(level, func(logger logLib.Logger) {\n\t\t_, _ = logger.WriteLevel(level, message)\n\t})\n\n\treturn len(message), nil\n}\n\nfunc (c *CombinedLogger) Question(params *survey.QuestionOptions) (string, error) {\n\treturn \"\", errors.New(\"questions in combined logger not supported\")\n}\n\nfunc (c *CombinedLogger) ErrorStreamOnly() logLib.Logger {\n\treturn nil\n}\n\nfunc (c *CombinedLogger) LogrLogSink() logr.LogSink {\n\treturn nil\n}\n\nfunc (c *CombinedLogger) Writer(level logrus.Level, raw bool) io.WriteCloser {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tvar writers []io.WriteCloser\n\tfor _, logger := range c.loggers {\n\t\twriter := logger.Writer(level, raw)\n\t\tif writer != nil {\n\t\t\twriters = append(writers, writer)\n\t\t}\n\t}\n\treturn &multiWriter{writers: writers}\n}\n\ntype multiWriter struct {\n\twriters []io.WriteCloser\n}\n\nfunc (m *multiWriter) Write(p []byte) (int, error) {\n\tfor _, w := range m.writers {\n\t\tif _, err := w.Write(p); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn len(p), nil\n}\n\nfunc (m *multiWriter) Close() error {\n\tfor _, w := range m.writers {\n\t\tif err := w.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/netstat/netstat.go",
    "content": "package netstat\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// SockAddr represents an ip:port pair\ntype SockAddr struct {\n\tIP   net.IP\n\tPort uint16\n}\n\nfunc (s *SockAddr) String() string {\n\treturn fmt.Sprintf(\"%v:%d\", s.IP, s.Port)\n}\n\n// SockTabEntry type represents each line of the /proc/net/[tcp|udp]\ntype SockTabEntry struct {\n\tino        string\n\tLocalAddr  *SockAddr\n\tRemoteAddr *SockAddr\n\tState      SkState\n\tUID        uint32\n\tProcess    *Process\n}\n\n// Process holds the PID and process name to which each socket belongs\ntype Process struct {\n\tPid  int\n\tName string\n}\n\nfunc (p *Process) String() string {\n\treturn fmt.Sprintf(\"%d/%s\", p.Pid, p.Name)\n}\n\n// SkState type represents socket connection state\ntype SkState uint8\n\nfunc (s SkState) String() string {\n\treturn skStates[s]\n}\n\n// AcceptFn is used to filter socket entries. The value returned indicates\n// whether the element is to be appended to the socket list.\ntype AcceptFn func(*SockTabEntry) bool\n\n// NoopFilter - a test function returning true for all elements\nfunc NoopFilter(*SockTabEntry) bool { return true }\n\n// TCPSocks returns a slice of active TCP sockets containing only those\n// elements that satisfy the accept function\nfunc TCPSocks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn osTCPSocks(accept)\n}\n\n// TCP6Socks returns a slice of active TCP IPv4 sockets containing only those\n// elements that satisfy the accept function\nfunc TCP6Socks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn osTCP6Socks(accept)\n}\n\n// UDPSocks returns a slice of active UDP sockets containing only those\n// elements that satisfy the accept function\nfunc UDPSocks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn osUDPSocks(accept)\n}\n\n// UDP6Socks returns a slice of active UDP IPv6 sockets containing only those\n// elements that satisfy the accept function\nfunc UDP6Socks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn osUDP6Socks(accept)\n}\n"
  },
  {
    "path": "pkg/netstat/netstat_util.go",
    "content": "// Package netstat provides primitives for getting socket information on a\n// Linux based operating system.\npackage netstat\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tpathTCPTab  = \"/proc/net/tcp\"\n\tpathTCP6Tab = \"/proc/net/tcp6\"\n\tpathUDPTab  = \"/proc/net/udp\"\n\tpathUDP6Tab = \"/proc/net/udp6\"\n\n\tipv4StrLen = 8\n\tipv6StrLen = 32\n)\n\n// Socket states\nconst (\n\tEstablished SkState = 0x01\n\tSynSent     SkState = 0x02\n\tSynRecv     SkState = 0x03\n\tFinWait1    SkState = 0x04\n\tFinWait2    SkState = 0x05\n\tTimeWait    SkState = 0x06\n\tClose       SkState = 0x07\n\tCloseWait   SkState = 0x08\n\tLastAck     SkState = 0x09\n\tListen      SkState = 0x0a\n\tClosing     SkState = 0x0b\n)\n\nvar skStates = [...]string{\n\t\"UNKNOWN\",\n\t\"ESTABLISHED\",\n\t\"SYN_SENT\",\n\t\"SYN_RECV\",\n\t\"FIN_WAIT1\",\n\t\"FIN_WAIT2\",\n\t\"TIME_WAIT\",\n\t\"\", // CLOSE\n\t\"CLOSE_WAIT\",\n\t\"LAST_ACK\",\n\t\"LISTEN\",\n\t\"CLOSING\",\n}\n\n// Errors returned by gonetstat\nvar (\n\tErrNotEnoughFields = errors.New(\"gonetstat: not enough fields in the line\")\n)\n\nfunc parseIPv4(s string) (net.IP, error) {\n\tv, err := strconv.ParseUint(s, 16, 32)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tip := make(net.IP, net.IPv4len)\n\tbinary.LittleEndian.PutUint32(ip, uint32(v))\n\treturn ip, nil\n}\n\nfunc parseIPv6(s string) (net.IP, error) {\n\tip := make(net.IP, net.IPv6len)\n\tconst grpLen = 4\n\ti, j := 0, 4\n\tfor len(s) != 0 {\n\t\tgrp := s[0:8]\n\t\tu, err := strconv.ParseUint(grp, 16, 32)\n\t\tbinary.LittleEndian.PutUint32(ip[i:j], uint32(u))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ti, j = i+grpLen, j+grpLen\n\t\ts = s[8:]\n\t}\n\treturn ip, nil\n}\n\nfunc parseAddr(s string) (*SockAddr, error) {\n\tfields := strings.Split(s, \":\")\n\tif len(fields) < 2 {\n\t\treturn nil, fmt.Errorf(\"netstat: not enough fields: %v\", s)\n\t}\n\tvar ip net.IP\n\tvar err error\n\tswitch len(fields[0]) {\n\tcase ipv4StrLen:\n\t\tip, err = parseIPv4(fields[0])\n\tcase ipv6StrLen:\n\t\tip, err = parseIPv6(fields[0])\n\tdefault:\n\t\terr = fmt.Errorf(\"netstat: bad formatted string: %v\", fields[0])\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv, err := strconv.ParseUint(fields[1], 16, 16)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SockAddr{IP: ip, Port: uint16(v)}, nil\n}\n\nfunc parseSocktab(r io.Reader, accept AcceptFn) ([]SockTabEntry, error) {\n\tbr := bufio.NewScanner(r)\n\ttab := make([]SockTabEntry, 0, 4)\n\n\t// Discard title\n\tbr.Scan()\n\n\tfor br.Scan() {\n\t\tvar e SockTabEntry\n\t\tline := br.Text()\n\t\t// Skip comments\n\t\tif i := strings.Index(line, \"#\"); i >= 0 {\n\t\t\tline = line[:i]\n\t\t}\n\t\tfields := strings.Fields(line)\n\t\tif len(fields) < 12 {\n\t\t\treturn nil, fmt.Errorf(\"netstat: not enough fields: %v, %v\", len(fields), fields)\n\t\t}\n\t\taddr, err := parseAddr(fields[1])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\te.LocalAddr = addr\n\t\taddr, err = parseAddr(fields[2])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\te.RemoteAddr = addr\n\t\tu, err := strconv.ParseUint(fields[3], 16, 8)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\te.State = SkState(u)\n\t\tu, err = strconv.ParseUint(fields[7], 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\te.UID = uint32(u)\n\t\te.ino = fields[9]\n\t\tif accept(&e) {\n\t\t\ttab = append(tab, e)\n\t\t}\n\t}\n\treturn tab, br.Err()\n}\n\ntype procFd struct {\n\tbase  string\n\tpid   int\n\tsktab []SockTabEntry\n\tp     *Process\n}\n\nconst sockPrefix = \"socket:[\"\n\nfunc getProcName(s []byte) string {\n\ti := bytes.Index(s, []byte(\"(\"))\n\tif i < 0 {\n\t\treturn \"\"\n\t}\n\tj := bytes.LastIndex(s, []byte(\")\"))\n\tif i < 0 {\n\t\treturn \"\"\n\t}\n\tif i > j {\n\t\treturn \"\"\n\t}\n\treturn string(s[i+1 : j])\n}\n\nfunc (p *procFd) iterFdDir() {\n\t// link name is of the form socket:[5860846]\n\tfddir := path.Join(p.base, \"/fd\")\n\tfi, err := os.ReadDir(fddir)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar buf [128]byte\n\n\tfor _, file := range fi {\n\t\tfd := path.Join(fddir, file.Name())\n\t\tlname, err := os.Readlink(fd)\n\t\tif err != nil || !strings.HasPrefix(lname, sockPrefix) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor i := range p.sktab {\n\t\t\tsk := &p.sktab[i]\n\t\t\tss := sockPrefix + sk.ino + \"]\"\n\t\t\tif ss != lname {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif p.p == nil {\n\t\t\t\tstat, err := os.Open(path.Join(p.base, \"stat\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tn, err := stat.Read(buf[:])\n\t\t\t\tstat.Close()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tz := bytes.SplitN(buf[:n], []byte(\" \"), 3)\n\t\t\t\tname := getProcName(z[1])\n\t\t\t\tp.p = &Process{p.pid, name}\n\t\t\t}\n\t\t\tsk.Process = p.p\n\t\t}\n\t}\n}\n\nfunc extractProcInfo(sktab []SockTabEntry) {\n\tconst basedir = \"/proc\"\n\tfi, err := os.ReadDir(basedir)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor _, file := range fi {\n\t\tif !file.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\tpid, err := strconv.Atoi(file.Name())\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tbase := path.Join(basedir, file.Name())\n\t\tproc := procFd{base: base, pid: pid, sktab: sktab}\n\t\tproc.iterFdDir()\n\t}\n}\n\n// doNetstat - collect information about network port status\nfunc doNetstat(path string, fn AcceptFn) ([]SockTabEntry, error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttabs, err := parseSocktab(f, fn)\n\tf.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\textractProcInfo(tabs)\n\treturn tabs, nil\n}\n\n// TCPSocks returns a slice of active TCP sockets containing only those\n// elements that satisfy the accept function\nfunc osTCPSocks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn doNetstat(pathTCPTab, accept)\n}\n\n// TCP6Socks returns a slice of active TCP IPv4 sockets containing only those\n// elements that satisfy the accept function\nfunc osTCP6Socks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn doNetstat(pathTCP6Tab, accept)\n}\n\n// UDPSocks returns a slice of active UDP sockets containing only those\n// elements that satisfy the accept function\nfunc osUDPSocks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn doNetstat(pathUDPTab, accept)\n}\n\n// UDP6Socks returns a slice of active UDP IPv6 sockets containing only those\n// elements that satisfy the accept function\nfunc osUDP6Socks(accept AcceptFn) ([]SockTabEntry, error) {\n\treturn doNetstat(pathUDP6Tab, accept)\n}\n"
  },
  {
    "path": "pkg/netstat/watcher.go",
    "content": "package netstat\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n)\n\ntype Forwarder interface {\n\tForward(port string) error\n\tStopForward(port string) error\n}\n\nfunc NewWatcher(forwarder Forwarder, log log.Logger) *Watcher {\n\treturn &Watcher{\n\t\tforwarder:      forwarder,\n\t\tforwardedPorts: map[string]bool{},\n\t\tlog:            log,\n\t}\n}\n\ntype Watcher struct {\n\tlog log.Logger\n\n\tforwarder      Forwarder\n\tforwardedPorts map[string]bool\n}\n\nfunc (w *Watcher) Run(ctx context.Context) error {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-time.After(time.Second * 3):\n\t\t\terr := w.runOnce()\n\t\t\tif err != nil {\n\t\t\t\tw.log.Errorf(\"Error watching ports: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (w *Watcher) runOnce() error {\n\tnewPorts, err := w.findPorts()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// stop ports that are not there anymore\n\tfor port := range w.forwardedPorts {\n\t\tif !newPorts[port] {\n\t\t\tw.log.Debugf(\"Stop port %s\", port)\n\t\t\terr = w.forwarder.StopForward(port)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error stop forwarding port %s: %w\", port, err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// start ports that were not there before\n\tfor port := range newPorts {\n\t\tif !w.forwardedPorts[port] {\n\t\t\tw.log.Debugf(\"Found open port %s ready to forward\", port)\n\t\t\terr = w.forwarder.Forward(port)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error forwarding port %s: %w\", port, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tw.forwardedPorts = newPorts\n\treturn nil\n}\n\nfunc (w *Watcher) findPorts() (map[string]bool, error) {\n\ttcpSocks, err := TCPSocks(func(s *SockTabEntry) bool {\n\t\treturn s.State == Listen\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttcp6Socks, err := TCP6Socks(func(s *SockTabEntry) bool {\n\t\treturn s.State == Listen\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttcpSocks = append(tcpSocks, tcp6Socks...)\n\n\t// we only return ports that are within range 1024-12000 that have a program assigned\n\tretSocks := map[string]bool{}\n\tfor _, sock := range tcpSocks {\n\t\tif sock.LocalAddr.Port < 1024 || sock.LocalAddr.Port > 12000 || sock.LocalAddr == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tretSocks[strconv.Itoa(int(sock.LocalAddr.Port))] = true\n\t}\n\n\treturn retSocks, nil\n}\n"
  },
  {
    "path": "pkg/open/open.go",
    "content": "package open\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os/exec\"\n\t\"time\"\n\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/skratchdot/open-golang/open\"\n)\n\n// Open opens the given url in the default application, retrying every second until the context is done\nfunc Open(ctx context.Context, url string, log log.Logger) error {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-time.After(time.Second):\n\t\t\terr := tryOpen(ctx, url, open.Start, log)\n\t\t\tif err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n}\n\n// JLabDesktop opens the given url in the JLab desktop application, retrying every second until the context is done\nfunc JLabDesktop(ctx context.Context, url string, log log.Logger) error {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-time.After(time.Second):\n\t\t\terr := tryOpen(ctx, url, jlabOpen, log)\n\t\t\tif err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc jlabOpen(url string) error {\n\treturn exec.Command(\"jlab\", url).Run()\n}\n\nfunc tryOpen(ctx context.Context, url string, fn func(string) error, log log.Logger) error {\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, time.Second)\n\tdefer cancel()\n\n\treq, err := http.NewRequestWithContext(timeoutCtx, \"GET\", url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := devpodhttp.GetHTTPClient().Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp != nil {\n\t\tdefer resp.Body.Close()\n\n\t\tif resp.StatusCode != http.StatusBadGateway && resp.StatusCode != http.StatusServiceUnavailable {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil\n\t\t\tcase <-time.After(time.Second):\n\t\t\t}\n\t\t\t_ = fn(url)\n\t\t\tlog.Donef(\"Successfully opened %s\", url)\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"not reachable\")\n}\n"
  },
  {
    "path": "pkg/options/resolve.go",
    "content": "package options\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/binaries\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/options/resolver\"\n\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc ResolveAndSaveOptionsMachine(\n\tctx context.Context,\n\tdevConfig *config.Config,\n\tprovider *provider2.ProviderConfig,\n\toriginalMachine *provider2.Machine,\n\tuserOptions map[string]string,\n\tlog log.Logger,\n) (*provider2.Machine, error) {\n\t// reload config\n\tmachine, err := provider2.LoadMachineConfig(originalMachine.Context, originalMachine.ID)\n\tif err != nil {\n\t\treturn originalMachine, err\n\t}\n\n\t// resolve devconfig options\n\tvar beforeConfigOptions map[string]config.OptionValue\n\tif machine != nil {\n\t\tbeforeConfigOptions = machine.Provider.Options\n\t}\n\n\t// get binary paths\n\tbinaryPaths, err := binaries.GetBinaries(devConfig.DefaultContext, provider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// resolve options\n\tresolvedOptions, _, err := resolver.New(\n\t\tuserOptions,\n\t\tprovider2.Merge(provider2.ToOptionsMachine(machine), binaryPaths),\n\t\tlog,\n\t\tresolver.WithResolveLocal(),\n\t).Resolve(\n\t\tctx,\n\t\tdevConfig.DynamicProviderOptionDefinitions(provider.Name),\n\t\tprovider.Options,\n\t\tprovider2.CombineOptions(nil, machine, devConfig.ProviderOptions(provider.Name)),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// remove global options\n\tfilterResolvedOptions(resolvedOptions, beforeConfigOptions, devConfig.ProviderOptions(provider.Name), provider.Options, userOptions)\n\n\t// save machine config\n\tif machine != nil {\n\t\tmachine.Provider.Options = resolvedOptions\n\n\t\tif !reflect.DeepEqual(beforeConfigOptions, machine.Provider.Options) {\n\t\t\terr = provider2.SaveMachineConfig(machine)\n\t\t\tif err != nil {\n\t\t\t\treturn machine, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn machine, nil\n}\n\nfunc ResolveAndSaveOptionsWorkspace(\n\tctx context.Context,\n\tdevConfig *config.Config,\n\tprovider *provider2.ProviderConfig,\n\toriginalWorkspace *provider2.Workspace,\n\tuserOptions map[string]string,\n\tlog log.Logger,\n\toptions ...resolver.Option,\n) (*provider2.Workspace, error) {\n\t// reload config\n\tworkspace, err := provider2.LoadWorkspaceConfig(originalWorkspace.Context, originalWorkspace.ID)\n\tif err != nil {\n\t\treturn originalWorkspace, err\n\t}\n\n\t// resolve devconfig options\n\tvar beforeConfigOptions map[string]config.OptionValue\n\tif workspace != nil {\n\t\tbeforeConfigOptions = workspace.Provider.Options\n\t}\n\n\t// get binary paths\n\tbinaryPaths, err := binaries.GetBinaries(devConfig.DefaultContext, provider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toptions = append(options, resolver.WithResolveLocal())\n\n\t// resolve options\n\tresolvedOptions, _, err := resolver.New(\n\t\tuserOptions,\n\t\tprovider2.Merge(provider2.ToOptionsWorkspace(workspace), binaryPaths),\n\t\tlog,\n\t\toptions...,\n\t).Resolve(\n\t\tctx,\n\t\tdevConfig.DynamicProviderOptionDefinitions(provider.Name),\n\t\tprovider.Options,\n\t\tprovider2.CombineOptions(workspace, nil, devConfig.ProviderOptions(provider.Name)),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// remove global options\n\tfilterResolvedOptions(resolvedOptions, beforeConfigOptions, devConfig.ProviderOptions(provider.Name), provider.Options, userOptions)\n\n\t// save workspace config\n\tif workspace != nil {\n\t\tworkspace.Provider.Options = resolvedOptions\n\n\t\tif !reflect.DeepEqual(beforeConfigOptions, workspace.Provider.Options) {\n\t\t\terr = provider2.SaveWorkspaceConfig(workspace)\n\t\t\tif err != nil {\n\t\t\t\treturn workspace, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn workspace, nil\n}\n\nfunc ResolveAndSaveOptionsProxy(\n\tctx context.Context,\n\tdevConfig *config.Config,\n\tprovider *provider2.ProviderConfig,\n\toriginalWorkspace *provider2.Workspace,\n\tuserOptions map[string]string,\n\tlog log.Logger,\n) (*provider2.Workspace, error) {\n\treturn ResolveAndSaveOptionsWorkspace(ctx, devConfig, provider, originalWorkspace, userOptions, log, resolver.WithResolveSubOptions())\n}\n\nfunc ResolveOptions(\n\tctx context.Context,\n\tdevConfig *config.Config,\n\tprovider *provider2.ProviderConfig,\n\tuserOptions map[string]string,\n\tskipRequired bool,\n\tskipSubOptions bool,\n\tsingleMachine *bool,\n\tlog log.Logger,\n) (*config.Config, error) {\n\t// get binary paths\n\tbinaryPaths, err := binaries.GetBinaries(devConfig.DefaultContext, provider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresolverOpts := []resolver.Option{\n\t\tresolver.WithResolveGlobal(),\n\t\tresolver.WithSkipRequired(skipRequired),\n\t}\n\tif !skipSubOptions {\n\t\tresolverOpts = append(resolverOpts, resolver.WithResolveSubOptions())\n\t}\n\n\t// create new resolver\n\tresolve := resolver.New(\n\t\tuserOptions,\n\t\tprovider2.Merge(provider2.GetBaseEnvironment(devConfig.DefaultContext, provider.Name), binaryPaths),\n\t\tlog,\n\t\tresolverOpts...,\n\t)\n\n\t// loop and resolve options, as soon as we encounter a new dynamic option it will get filled\n\tresolvedOptionValues, dynamicOptionDefinitions, err := resolve.Resolve(\n\t\tctx,\n\t\tnil,\n\t\tprovider.Options,\n\t\tdevConfig.ProviderOptions(provider.Name),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// save options in dev config\n\tif devConfig != nil {\n\t\tdevConfig = config.CloneConfig(devConfig)\n\t\tif devConfig.Current().Providers == nil {\n\t\t\tdevConfig.Current().Providers = map[string]*config.ProviderConfig{}\n\t\t}\n\t\tif devConfig.Current().Providers[provider.Name] == nil {\n\t\t\tdevConfig.Current().Providers[provider.Name] = &config.ProviderConfig{}\n\t\t}\n\t\tdevConfig.Current().Providers[provider.Name].Options = map[string]config.OptionValue{}\n\t\tfor k, v := range resolvedOptionValues {\n\t\t\tdevConfig.Current().Providers[provider.Name].Options[k] = v\n\t\t}\n\n\t\tdevConfig.Current().Providers[provider.Name].DynamicOptions = config.OptionDefinitions{}\n\t\tfor k, v := range dynamicOptionDefinitions {\n\t\t\tdevConfig.Current().Providers[provider.Name].DynamicOptions[k] = v\n\t\t}\n\t\tif singleMachine != nil {\n\t\t\tdevConfig.Current().Providers[provider.Name].SingleMachine = *singleMachine\n\t\t}\n\t}\n\n\treturn devConfig, nil\n}\n\nfunc ResolveAgentConfig(devConfig *config.Config, provider *provider2.ProviderConfig, workspace *provider2.Workspace, machine *provider2.Machine) provider2.ProviderAgentConfig {\n\t// fill in agent config\n\toptions := provider2.ToOptions(workspace, machine, devConfig.ProviderOptions(provider.Name))\n\tagentConfig := provider.Agent\n\tagentConfig.Dockerless.Image = resolver.ResolveDefaultValue(agentConfig.Dockerless.Image, options)\n\tagentConfig.Dockerless.Disabled = types.StrBool(resolver.ResolveDefaultValue(string(agentConfig.Dockerless.Disabled), options))\n\tagentConfig.Dockerless.IgnorePaths = resolver.ResolveDefaultValue(agentConfig.Dockerless.IgnorePaths, options)\n\tagentConfig.Dockerless.RegistryCache = devConfig.ContextOption(config.ContextOptionRegistryCache)\n\tagentConfig.Driver = resolver.ResolveDefaultValue(agentConfig.Driver, options)\n\tagentConfig.Local = types.StrBool(resolver.ResolveDefaultValue(string(agentConfig.Local), options))\n\n\t// docker driver\n\tagentConfig.Docker.Path = resolver.ResolveDefaultValue(agentConfig.Docker.Path, options)\n\tagentConfig.Docker.Builder = resolver.ResolveDefaultValue(agentConfig.Docker.Builder, options)\n\tagentConfig.Docker.Install = types.StrBool(resolver.ResolveDefaultValue(string(agentConfig.Docker.Install), options))\n\tagentConfig.Docker.Env = resolver.ResolveDefaultValues(agentConfig.Docker.Env, options)\n\n\t// kubernetes driver\n\tagentConfig.Kubernetes.KubernetesContext = resolver.ResolveDefaultValue(agentConfig.Kubernetes.KubernetesContext, options)\n\tagentConfig.Kubernetes.KubernetesConfig = resolver.ResolveDefaultValue(agentConfig.Kubernetes.KubernetesConfig, options)\n\tagentConfig.Kubernetes.KubernetesNamespace = resolver.ResolveDefaultValue(agentConfig.Kubernetes.KubernetesNamespace, options)\n\tagentConfig.Kubernetes.Architecture = resolver.ResolveDefaultValue(agentConfig.Kubernetes.Architecture, options)\n\tagentConfig.Kubernetes.InactivityTimeout = resolver.ResolveDefaultValue(agentConfig.Kubernetes.InactivityTimeout, options)\n\tagentConfig.Kubernetes.StorageClass = resolver.ResolveDefaultValue(agentConfig.Kubernetes.StorageClass, options)\n\tagentConfig.Kubernetes.PvcAccessMode = resolver.ResolveDefaultValue(agentConfig.Kubernetes.PvcAccessMode, options)\n\tagentConfig.Kubernetes.PvcAnnotations = resolver.ResolveDefaultValue(agentConfig.Kubernetes.PvcAnnotations, options)\n\tagentConfig.Kubernetes.NodeSelector = resolver.ResolveDefaultValue(agentConfig.Kubernetes.NodeSelector, options)\n\tagentConfig.Kubernetes.Resources = resolver.ResolveDefaultValue(agentConfig.Kubernetes.Resources, options)\n\tagentConfig.Kubernetes.WorkspaceVolumeMount = resolver.ResolveDefaultValue(agentConfig.Kubernetes.WorkspaceVolumeMount, options)\n\tagentConfig.Kubernetes.PodManifestTemplate = resolver.ResolveDefaultValue(agentConfig.Kubernetes.PodManifestTemplate, options)\n\tagentConfig.Kubernetes.Labels = resolver.ResolveDefaultValue(agentConfig.Kubernetes.Labels, options)\n\tagentConfig.Kubernetes.StrictSecurity = resolver.ResolveDefaultValue(agentConfig.Kubernetes.StrictSecurity, options)\n\tagentConfig.Kubernetes.CreateNamespace = resolver.ResolveDefaultValue(agentConfig.Kubernetes.CreateNamespace, options)\n\tagentConfig.Kubernetes.ClusterRole = resolver.ResolveDefaultValue(agentConfig.Kubernetes.ClusterRole, options)\n\tagentConfig.Kubernetes.ServiceAccount = resolver.ResolveDefaultValue(agentConfig.Kubernetes.ServiceAccount, options)\n\tagentConfig.Kubernetes.PodTimeout = resolver.ResolveDefaultValue(agentConfig.Kubernetes.PodTimeout, options)\n\tagentConfig.Kubernetes.KubernetesPullSecretsEnabled = resolver.ResolveDefaultValue(agentConfig.Kubernetes.KubernetesPullSecretsEnabled, options)\n\tagentConfig.Kubernetes.DiskSize = resolver.ResolveDefaultValue(agentConfig.Kubernetes.DiskSize, options)\n\n\tagentConfig.DataPath = resolver.ResolveDefaultValue(agentConfig.DataPath, options)\n\tagentConfig.Path = resolver.ResolveDefaultValue(agentConfig.Path, options)\n\tif agentConfig.Path == \"\" && agentConfig.Local == \"true\" {\n\t\tagentConfig.Path, _ = os.Executable()\n\t} else if agentConfig.Path == \"\" {\n\t\tagentConfig.Path = agent.RemoteDevPodHelperLocation\n\t}\n\tagentConfig.DownloadURL = resolver.ResolveDefaultValue(agentConfig.DownloadURL, options)\n\tif agentConfig.DownloadURL == \"\" {\n\t\tagentConfig.DownloadURL = resolveAgentDownloadURL(devConfig)\n\t}\n\tagentConfig.Timeout = resolver.ResolveDefaultValue(agentConfig.Timeout, options)\n\tagentConfig.ContainerTimeout = resolver.ResolveDefaultValue(agentConfig.ContainerTimeout, options)\n\tagentConfig.InjectGitCredentials = types.StrBool(resolver.ResolveDefaultValue(string(agentConfig.InjectGitCredentials), options))\n\tif devConfig.ContextOption(config.ContextOptionSSHInjectGitCredentials) != \"\" {\n\t\tagentConfig.InjectGitCredentials = types.StrBool(devConfig.ContextOption(config.ContextOptionSSHInjectGitCredentials))\n\t}\n\tagentConfig.InjectDockerCredentials = types.StrBool(resolver.ResolveDefaultValue(string(agentConfig.InjectDockerCredentials), options))\n\treturn agentConfig\n}\n\n// resolveAgentDownloadURL resolves the agent download URL (env -> context -> default)\nfunc resolveAgentDownloadURL(devConfig *config.Config) string {\n\tdevPodAgentURL := os.Getenv(agent.EnvDevPodAgentURL)\n\tif devPodAgentURL != \"\" {\n\t\treturn strings.TrimSuffix(devPodAgentURL, \"/\") + \"/\"\n\t}\n\n\tcontextAgentOption, ok := devConfig.Current().Options[config.ContextOptionAgentURL]\n\tif ok && contextAgentOption.Value != \"\" {\n\t\treturn strings.TrimSuffix(contextAgentOption.Value, \"/\") + \"/\"\n\t}\n\n\treturn agent.DefaultAgentDownloadURL()\n}\n\nfunc filterResolvedOptions(resolvedOptions, beforeConfigOptions, providerValues map[string]config.OptionValue, providerOptions map[string]*types.Option, userOptions map[string]string) {\n\tfor k := range resolvedOptions {\n\t\t// check if user supplied\n\t\tif userOptions != nil {\n\t\t\t_, ok := userOptions[k]\n\t\t\tif ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// check if it was there before\n\t\tif beforeConfigOptions != nil {\n\t\t\t_, ok := beforeConfigOptions[k]\n\t\t\tif ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// check if not available in the provider values\n\t\tif providerValues != nil {\n\t\t\t_, ok := providerValues[k]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// check if not global\n\t\tif providerOptions == nil || providerOptions[k] == nil || !providerOptions[k].Global {\n\t\t\tcontinue\n\t\t}\n\n\t\tdelete(resolvedOptions, k)\n\t}\n}\n"
  },
  {
    "path": "pkg/options/resolve_test.go",
    "content": "package options\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/options/resolver\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"gotest.tools/assert\"\n)\n\ntype testCase struct {\n\tName                       string\n\tProviderOptions            map[string]*types.Option\n\tUserValues                 map[string]string\n\tResolvedValues             map[string]config.OptionValue\n\tResolvedDynamicDefinitions config.OptionDefinitions\n\tExtraValues                map[string]string\n\tResolveGlobal              bool\n\tDontResolveLocal           bool\n\tSkipRequired               bool\n\n\tExpectErr              bool\n\tExpectedOptions        map[string]string\n\tExpectedDynamicOptions config.OptionDefinitions\n}\n\nfunc TestResolveOptions(t *testing.T) {\n\ttestCases := []testCase{\n\t\t{\n\t\t\tName: \"simple\",\n\t\t\tExtraValues: map[string]string{\n\t\t\t\t\"WORKSPACE_ID\": \"test\",\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"${WORKSPACE_ID}-test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\": \"test-test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"dependency\",\n\t\t\tExtraValues: map[string]string{\n\t\t\t\t\"WORKSPACE_ID\": \"test\",\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"${WORKSPACE_ID}-test-${COMMAND}-$COMMAND\",\n\t\t\t\t},\n\t\t\t\t\"COMMAND\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":    \"test-test-bar-bar\",\n\t\t\t\t\"COMMAND\": \"bar\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"No extra values\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"COMMAND1\": {\n\t\t\t\t\tCommand: \"echo ${COMMAND2}-test\",\n\t\t\t\t},\n\t\t\t\t\"COMMAND2\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"COMMAND1\": \"bar-test\",\n\t\t\t\t\"COMMAND2\": \"bar\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Cyclic dep\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"COMMAND1\": {\n\t\t\t\t\tCommand: \"echo ${COMMAND2}\",\n\t\t\t\t},\n\t\t\t\t\"COMMAND2\": {\n\t\t\t\t\tCommand: \"echo ${COMMAND1}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectErr: true,\n\t\t},\n\t\t{\n\t\t\tName: \"Override\",\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"COMMAND\": {\n\t\t\t\t\tValue:        \"foo\",\n\t\t\t\t\tUserProvided: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"COMMAND\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"COMMAND\": \"foo\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Override\",\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"COMMAND\": {\n\t\t\t\t\tValue:        \"foo\",\n\t\t\t\t\tUserProvided: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"COMMAND\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t},\n\t\t\t\t\"COMMAND1\": {\n\t\t\t\t\tCommand: \"echo ${COMMAND}-foo-${UNDEFINED}\",\n\t\t\t\t},\n\t\t\t\t\"DEFAULT1\": {\n\t\t\t\t\tDefault: \"${COMMAND}-foo-${UNDEFINED}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"COMMAND\":  \"foo\",\n\t\t\t\t\"COMMAND1\": \"foo-foo-\",\n\t\t\t\t\"DEFAULT1\": \"foo-foo-${UNDEFINED}\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Expire\",\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"EXPIRE\": {\n\t\t\t\t\tValue:  \"foo\",\n\t\t\t\t\tFilled: &[]types.Time{types.NewTime(time.Time{})}[0],\n\t\t\t\t},\n\t\t\t\t\"NOTEXPIRE\": {\n\t\t\t\t\tValue:  \"foo\",\n\t\t\t\t\tFilled: &[]types.Time{types.Now()}[0],\n\t\t\t\t},\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"EXPIRE\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t\tCache:   \"10m\",\n\t\t\t\t},\n\t\t\t\t\"NOTEXPIRE\": {\n\t\t\t\t\tCommand: \"echo bar\",\n\t\t\t\t\tCache:   \"10m\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"EXPIRE\":    \"bar\",\n\t\t\t\t\"NOTEXPIRE\": \"foo\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Ignore self\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"SELF\": {\n\t\t\t\t\tCommand: \"SELF=test; echo ${SELF}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"SELF\": \"test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Recompute children\",\n\t\t\tUserValues: map[string]string{\n\t\t\t\t\"PARENT\": \"foo\",\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tValue:        \"test\",\n\t\t\t\t\tUserProvided: true,\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tValue: \"test-child1\",\n\t\t\t\t},\n\t\t\t\t\"CHILD2\": {\n\t\t\t\t\tValue: \"test-child2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tCommand: \"echo ${PARENT}-child1\",\n\t\t\t\t},\n\t\t\t\t\"CHILD2\": {\n\t\t\t\t\tDefault: \"${PARENT}-child2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"PARENT\": \"foo\",\n\t\t\t\t\"CHILD1\": \"foo-child1\",\n\t\t\t\t\"CHILD2\": \"foo-child2\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Error local global\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tGlobal:  true,\n\t\t\t\t\tDefault: \"${PARENT}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectErr: true,\n\t\t},\n\t\t{\n\t\t\tName: \"Error local var\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tLocal:   true,\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tDefault: \"${PARENT}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectErr: true,\n\t\t},\n\t\t{\n\t\t\tName: \"Don't resolve local\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tDefault: \"${PARENT}\",\n\t\t\t\t\tLocal:   true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tDontResolveLocal: true,\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"PARENT\": \"test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Resolve\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tDefault: \"${PARENT}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tDontResolveLocal: true,\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"PARENT\": \"test\",\n\t\t\t\t\"CHILD1\": \"test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Skip Required\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"PARENT\": {\n\t\t\t\t\tRequired: true,\n\t\t\t\t},\n\t\t\t\t\"CHILD1\": {\n\t\t\t\t\tDefault: \"${PARENT}\",\n\t\t\t\t},\n\t\t\t\t\"PARENT2\": {\n\t\t\t\t\tRequired: true,\n\t\t\t\t\tDefault:  \"test\",\n\t\t\t\t},\n\t\t\t\t\"CHILD2\": {\n\t\t\t\t\tDefault: \"${PARENT2}\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tSkipRequired: true,\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"PARENT2\": \"test\",\n\t\t\t\t\"CHILD2\":  \"test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Nested dynamic options\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test\",\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Dynamic options don't update\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tResolvedDynamicDefinitions: map[string]*types.Option{\n\t\t\t\t\"TEST2\": {\n\t\t\t\t\tDefault: \"test5\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"TEST\":  {Value: \"test3\", Children: []string{\"TEST2\"}, UserProvided: true},\n\t\t\t\t\"TEST2\": {Value: \"test4\", UserProvided: true},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test3\",\n\t\t\t\t\"TEST2\": \"test4\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": {\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Dynamic options update\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tUserValues: map[string]string{\n\t\t\t\t\"TEST\": \"test1\",\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"TEST\":  {Value: \"test3\", Children: []string{\"TEST2\"}},\n\t\t\t\t\"TEST2\": {Value: \"test4\"},\n\t\t\t},\n\t\t\tResolvedDynamicDefinitions: map[string]*types.Option{\n\t\t\t\t\"TEST2\": {\n\t\t\t\t\tDefault: \"test5\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST3\": \"test2\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Nested dynamic options\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t\t\"TEST3\": \"test3\",\n\t\t\t\t\"TEST4\": \"test3-bar-4\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Nested dynamic options skip required\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tSkipRequired: true,\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\": \"test1\",\n\t\t\t\t\"FOO\":  \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tRequired: true,\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"${TEST3}-${FOO}-4\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Nested dynamic options use option\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\t\t\tDefault: \"${TEST2}-${FOO}-4\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tSkipRequired: true,\n\t\t\tUserValues: map[string]string{\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t\t\"TEST3\": \"test3\",\n\t\t\t\t\"TEST4\": \"test2-bar-4\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tRequired: true,\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"${TEST2}-${FOO}-4\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"${TEST2}-${FOO}-4\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"TEST4\": &types.Option{\n\t\t\t\t\tDefault: \"${TEST2}-${FOO}-4\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Nested dynamic options use option\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"TEST5\": {\n\t\t\t\t\tValue: \"test5\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t\t\"TEST3\": \"test3\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"TEST3\": &types.Option{\n\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Dynamic options unused option\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"TEST5\": {\n\t\t\t\t\tValue: \"test5\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tResolvedDynamicDefinitions: map[string]*types.Option{\n\t\t\t\t\"TEST5\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST2\": \"test2\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"Dynamic options update default\",\n\t\t\tProviderOptions: map[string]*types.Option{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tDefault: \"test1\",\n\t\t\t\t\tSubOptionsCommand: optionsToSubCommand(config.OptionDefinitions{\n\t\t\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t\"FOO\": {Command: \"echo bar\"},\n\t\t\t},\n\t\t\tResolvedValues: map[string]config.OptionValue{\n\t\t\t\t\"TEST\": {\n\t\t\t\t\tValue: \"test1\",\n\t\t\t\t},\n\t\t\t\t\"TEST2\": {\n\t\t\t\t\tValue: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tResolvedDynamicDefinitions: map[string]*types.Option{\n\t\t\t\t\"TEST2\": {\n\t\t\t\t\tDefault: \"test2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tExpectedOptions: map[string]string{\n\t\t\t\t\"TEST\":  \"test1\",\n\t\t\t\t\"TEST2\": \"test3\",\n\t\t\t\t\"FOO\":   \"bar\",\n\t\t\t},\n\t\t\tExpectedDynamicOptions: config.OptionDefinitions{\n\t\t\t\t\"TEST2\": &types.Option{\n\t\t\t\t\tDefault: \"test3\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tfmt.Println(testCase.Name)\n\t\tresolverOpts := []resolver.Option{resolver.WithSkipRequired(testCase.SkipRequired), resolver.WithResolveSubOptions()}\n\t\tif !testCase.DontResolveLocal {\n\t\t\tresolverOpts = append(resolverOpts, resolver.WithResolveLocal())\n\t\t}\n\t\tif testCase.ResolveGlobal {\n\t\t\tresolverOpts = append(resolverOpts, resolver.WithResolveGlobal())\n\t\t}\n\t\tr := resolver.New(testCase.UserValues, testCase.ExtraValues, log.Default, resolverOpts...)\n\t\toptions, dynamicOptions, err := r.Resolve(context.Background(), testCase.ResolvedDynamicDefinitions, testCase.ProviderOptions, testCase.ResolvedValues)\n\t\tif !testCase.ExpectErr {\n\t\t\tassert.NilError(t, err, testCase.Name)\n\t\t} else if testCase.ExpectErr {\n\t\t\tif err == nil {\n\t\t\t\tt.Fatalf(\"expected error, got nil error in test case %s\", testCase.Name)\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tstrOptions := map[string]string{}\n\t\tfor k, v := range options {\n\t\t\tstrOptions[k] = v.Value\n\t\t}\n\t\tif len(testCase.ExpectedOptions) > 0 {\n\t\t\tassert.DeepEqual(t, strOptions, testCase.ExpectedOptions)\n\t\t} else {\n\t\t\tassert.DeepEqual(t, strOptions, map[string]string{})\n\t\t}\n\n\t\tif len(testCase.ExpectedDynamicOptions) > 0 {\n\t\t\tassert.DeepEqual(t, dynamicOptions, testCase.ExpectedDynamicOptions)\n\t\t} else {\n\t\t\tassert.DeepEqual(t, dynamicOptions, config.OptionDefinitions{})\n\t\t}\n\t}\n}\n\nfunc optionsToSubCommand(optionDefinitions config.OptionDefinitions) string {\n\tout, _ := json.Marshal(&provider.SubOptions{\n\t\tOptions: optionDefinitions,\n\t})\n\treturn fmt.Sprintf(\"echo '%s' | base64 --decode\", base64.StdEncoding.EncodeToString(out))\n}\n"
  },
  {
    "path": "pkg/options/resolver/parse.go",
    "content": "package resolver\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc printUnusedUserValues(userValues map[string]string, options config.OptionDefinitions, log log.Logger) {\n\tallowedOptions := []string{}\n\tfor k := range options {\n\t\tallowedOptions = append(allowedOptions, k)\n\t}\n\n\tfor k := range userValues {\n\t\tif options[k] == nil {\n\t\t\tlog.Warnf(\"Option %s was specified but is not defined, allowed options are %v\", k, allowedOptions)\n\t\t}\n\t}\n}\n\nfunc validateUserValue(optionName, userValue string, option *types.Option) error {\n\tif option.ValidationPattern != \"\" {\n\t\tmatcher, err := regexp.Compile(option.ValidationPattern)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !matcher.MatchString(userValue) {\n\t\t\tif option.ValidationMessage != \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s\", option.ValidationMessage)\n\t\t\t}\n\n\t\t\treturn fmt.Errorf(\"invalid value '%s' for option '%s', has to match the following regEx: %s\", userValue, optionName, option.ValidationPattern)\n\t\t}\n\t}\n\n\tif len(option.Enum) > 0 {\n\t\tfound := false\n\t\tfor _, e := range option.Enum {\n\t\t\tif userValue == e.Value {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"invalid value '%s' for option '%s', has to match one of the following values: %v\", userValue, optionName, option.Enum)\n\t\t}\n\t}\n\n\tif option.Type != \"\" {\n\t\tif option.Type == \"number\" {\n\t\t\t_, err := strconv.ParseInt(userValue, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value '%s' for option '%s', must be a number\", userValue, optionName)\n\t\t\t}\n\t\t} else if option.Type == \"boolean\" {\n\t\t\t_, err := strconv.ParseBool(userValue)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value '%s' for option '%s', must be a boolean\", userValue, optionName)\n\t\t\t}\n\t\t} else if option.Type == \"duration\" {\n\t\t\t_, err := time.ParseDuration(userValue)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value '%s' for option '%s', must be a duration like 10s, 5m or 24h\", userValue, optionName)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/options/resolver/resolve.go",
    "content": "package resolver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/loft-sh/log/terminal\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc (r *Resolver) resolveOptions(\n\tctx context.Context,\n\toptionValues map[string]config.OptionValue,\n) (map[string]config.OptionValue, error) {\n\t// copy options\n\tresolvedOptionValues := map[string]config.OptionValue{}\n\tfor optionName, v := range optionValues {\n\t\tresolvedOptionValues[optionName] = v\n\t}\n\n\t// resolve options in reverse order and walk from top to bottom\n\tfor optionNode := r.graph.NextFromTop(); optionNode != nil; optionNode = r.graph.NextFromTop() {\n\t\t// resolve next option\n\t\terr := r.resolveOption(ctx, optionNode.ID, resolvedOptionValues)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"resolve option \"+optionNode.ID)\n\t\t}\n\n\t\t// resolve sub options\n\t\terr = r.refreshSubOptions(ctx, optionNode.ID, resolvedOptionValues)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"refresh sub options for %s: %w\", optionNode.ID, err)\n\t\t}\n\t}\n\n\treturn resolvedOptionValues, nil\n}\n\nfunc (r *Resolver) resolveOption(\n\tctx context.Context,\n\toptionName string,\n\tresolvedOptionValues map[string]config.OptionValue,\n) error {\n\t// get node from graph\n\tnode := r.graph.Nodes[optionName]\n\toption := node.Data\n\n\t// get existing values\n\tuserValue, userValueOk, beforeValue, beforeValueOk, err := r.getValue(optionName, option, resolvedOptionValues)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// find out options we need to resolve\n\tif !userValueOk {\n\t\t// check if value is already filled\n\t\tif beforeValueOk {\n\t\t\tif beforeValue.UserProvided || option.Cache == \"\" {\n\t\t\t\treturn nil\n\t\t\t} else if option.Cache != \"\" {\n\t\t\t\tduration, err := time.ParseDuration(option.Cache)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrapf(err, \"parse cache duration of option %s\", optionName)\n\t\t\t\t}\n\n\t\t\t\t// has value expired?\n\t\t\t\tif beforeValue.Filled != nil && beforeValue.Filled.Add(duration).After(time.Now()) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// make sure required is always resolved\n\t\tif !option.Required {\n\t\t\t// skip if global\n\t\t\tif !r.resolveGlobal && option.Global {\n\t\t\t\treturn nil\n\t\t\t} else if !r.resolveLocal && option.Local {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// resolve option\n\tif userValueOk {\n\t\tresolvedOptionValues[optionName] = config.OptionValue{\n\t\t\tValue:        userValue,\n\t\t\tChildren:     beforeValue.Children,\n\t\t\tUserProvided: true,\n\t\t}\n\t} else if option.Default != \"\" {\n\t\tresolvedOptionValues[optionName] = config.OptionValue{\n\t\t\tChildren: beforeValue.Children,\n\t\t\tValue:    ResolveDefaultValue(option.Default, combine(resolvedOptionValues, r.extraValues)),\n\t\t}\n\t} else if option.Command != \"\" {\n\t\toptionValue, err := resolveFromCommand(ctx, option, resolvedOptionValues, r.extraValues)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\toptionValue.Children = beforeValue.Children\n\t\tresolvedOptionValues[optionName] = optionValue\n\t} else if len(option.Enum) == 1 {\n\t\tresolvedOptionValues[optionName] = config.OptionValue{\n\t\t\tChildren: beforeValue.Children,\n\t\t\tValue:    option.Enum[0].Value,\n\t\t}\n\t} else {\n\t\tresolvedOptionValues[optionName] = config.OptionValue{\n\t\t\tChildren: beforeValue.Children,\n\t\t}\n\t}\n\n\t// is required?\n\tif !userValueOk && option.Required && resolvedOptionValues[optionName].Value == \"\" && !resolvedOptionValues[optionName].UserProvided {\n\t\tif r.skipRequired {\n\t\t\tdelete(resolvedOptionValues, optionName)\n\t\t\treturn deleteChildrenOf(r.graph, node)\n\t\t}\n\n\t\t// check if we can ask a question\n\t\tif !terminal.IsTerminalIn {\n\t\t\treturn fmt.Errorf(\"option %s is required, but no value provided\", optionName)\n\t\t}\n\n\t\tquestionOpts := []string{}\n\t\tfor _, enumOpt := range option.Enum {\n\t\t\tquestionOpts = append(questionOpts, enumOpt.Value)\n\t\t}\n\n\t\t// check if there is only one option\n\t\tr.log.Info(option.Description)\n\t\tanswer, err := r.log.Question(&survey.QuestionOptions{\n\t\t\tQuestion:               fmt.Sprintf(\"Please enter a value for %s\", optionName),\n\t\t\tOptions:                questionOpts,\n\t\t\tValidationRegexPattern: option.ValidationPattern,\n\t\t\tValidationMessage:      option.ValidationMessage,\n\t\t\tIsPassword:             option.Password,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tresolvedOptionValues[optionName] = config.OptionValue{\n\t\t\tValue:        answer,\n\t\t\tUserProvided: true,\n\t\t}\n\t}\n\n\t// check if value has changed\n\tif beforeValue.Value != resolvedOptionValues[optionName].Value {\n\t\t// resolve children again\n\t\tfor _, child := range node.Childs {\n\t\t\t// check if value is already there\n\t\t\toptionValue, ok := resolvedOptionValues[child.ID]\n\t\t\tif ok && !optionValue.UserProvided {\n\t\t\t\t// recompute children\n\t\t\t\tdelete(resolvedOptionValues, child.ID)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (r *Resolver) getValue(optionName string, option *types.Option, resolvedOptionValues map[string]config.OptionValue) (string, bool, config.OptionValue, bool, error) {\n\t// check if user value exists\n\tuserValue, userValueOk := r.userOptions[optionName]\n\n\t// get before value\n\tbeforeValue, beforeValueOk := resolvedOptionValues[optionName]\n\n\t// validate user value if we have one\n\tif userValueOk {\n\t\terr := validateUserValue(optionName, userValue, option)\n\t\tif err != nil {\n\t\t\treturn \"\", false, config.OptionValue{}, false, err\n\t\t}\n\t}\n\n\t// validate existing value\n\tif beforeValueOk {\n\t\terr := validateUserValue(optionName, beforeValue.Value, option)\n\t\tif err != nil {\n\t\t\t// strip before value\n\t\t\tdelete(resolvedOptionValues, optionName)\n\t\t\tbeforeValue = config.OptionValue{}\n\t\t\tbeforeValueOk = false\n\t\t}\n\t}\n\n\treturn userValue, userValueOk, beforeValue, beforeValueOk, nil\n}\n\nfunc (r *Resolver) refreshSubOptions(\n\tctx context.Context,\n\toptionName string,\n\tresolvedOptionValues map[string]config.OptionValue,\n) error {\n\t// get options\n\tnode, ok := r.graph.Nodes[optionName]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\t// re-fetch dynamic options\n\toption := node.Data\n\tif !r.resolveSubOptions || option.SubOptionsCommand == \"\" {\n\t\treturn nil\n\t}\n\n\t// only refetch if the option was resolved\n\t_, ok = resolvedOptionValues[optionName]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\t// execute the command\n\tnewDynamicOptions, err := resolveSubOptions(ctx, option, resolvedOptionValues, r.extraValues)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// remove before children from graph\n\tfor childID := range r.getChangedOptions(r.dynamicOptionsForNode(resolvedOptionValues[optionName].Children), newDynamicOptions, resolvedOptionValues) {\n\t\tdelete(resolvedOptionValues, childID)\n\t\terr := r.graph.RemoveSubGraph(childID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// remove invalid existing user values\n\tfor newOptionName, newOption := range newDynamicOptions {\n\t\tuserValue, ok := r.userOptions[newOptionName]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\terr := validateUserValue(newOptionName, userValue, newOption)\n\t\tif err != nil {\n\t\t\tdelete(r.userOptions, newOptionName)\n\t\t}\n\t}\n\n\t// set children on value\n\tval := resolvedOptionValues[optionName]\n\tval.Children = []string{}\n\tfor k := range newDynamicOptions {\n\t\tval.Children = append(val.Children, k)\n\t}\n\tresolvedOptionValues[optionName] = val\n\n\t// add options to graph\n\terr = addOptionsToGraph(r.graph, newDynamicOptions, resolvedOptionValues)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"add sub options: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (r *Resolver) getChangedOptions(oldOptions config.OptionDefinitions, newOptions config.OptionDefinitions, resolvedOptionValues map[string]config.OptionValue) config.OptionDefinitions {\n\tchangedOptions := config.OptionDefinitions{}\n\tfor oldK, oldV := range oldOptions {\n\t\t_, ok := newOptions[oldK]\n\t\tif !ok {\n\t\t\tchangedOptions[oldK] = oldV\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tfor newK, newV := range newOptions {\n\t\toldV, ok := oldOptions[newK]\n\t\tif !ok {\n\t\t\tchangedOptions[newK] = newV\n\t\t\tcontinue\n\t\t}\n\n\t\toldValue, oldValueOk := resolvedOptionValues[newK]\n\t\tif !oldValueOk {\n\t\t\tchangedOptions[newK] = newV\n\t\t\tcontinue\n\t\t}\n\n\t\tenumValues := []string{}\n\t\tfor _, o := range newV.Enum {\n\t\t\tenumValues = append(enumValues, o.Value)\n\t\t}\n\n\t\t// check if value still valid\n\t\tif len(newV.Enum) > 0 && !contains(enumValues, oldValue.Value) {\n\t\t\tchangedOptions[newK] = newV\n\t\t\tcontinue\n\t\t}\n\n\t\t// check if default has changed\n\t\tif !oldValue.UserProvided && oldV.Default != newV.Default {\n\t\t\tchangedOptions[newK] = newV\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn changedOptions\n}\n\nfunc (r *Resolver) dynamicOptionsForNode(children []string) config.OptionDefinitions {\n\tretValues := config.OptionDefinitions{}\n\tfor _, childID := range children {\n\t\tchild, ok := r.graph.Nodes[childID]\n\t\tif ok {\n\t\t\tretValues[child.ID] = child.Data\n\t\t}\n\t}\n\n\treturn retValues\n}\n\nfunc contains(stack []string, k string) bool {\n\tfor _, s := range stack {\n\t\tif s == k {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "pkg/options/resolver/resolver.go",
    "content": "package resolver\n\nimport (\n\t\"context\"\n\t\"regexp\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/graph\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n)\n\nconst (\n\trootID = \"root\"\n)\n\nvar variableExpression = regexp.MustCompile(`(?m)\\$\\{?([A-Z0-9_]+)(:(-|\\+)([^\\}]+))?\\}?`)\n\nfunc ResolveDefaultValue(val string, resolvedOptions map[string]string) string {\n\treturn variableExpression.ReplaceAllStringFunc(val, func(s string) string {\n\t\tsubmatch := variableExpression.FindStringSubmatch(s)\n\t\toptionVal, ok := resolvedOptions[submatch[1]]\n\t\tif ok {\n\t\t\treturn optionVal\n\t\t}\n\n\t\treturn s\n\t})\n}\n\nfunc ResolveDefaultValues(vals map[string]string, resolvedOptions map[string]string) map[string]string {\n\tret := make(map[string]string)\n\tfor k, v := range vals {\n\t\tresolvedValue := ResolveDefaultValue(v, resolvedOptions)\n\t\tif resolvedValue == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tret[k] = resolvedValue\n\t}\n\treturn ret\n}\n\ntype Resolver struct {\n\t// user provided\n\tuserOptions map[string]string\n\t// extra values\n\textraValues map[string]string\n\n\t// internal\n\tgraph *graph.Graph[*types.Option]\n\tlog   log.Logger\n\n\t// options\n\tresolveLocal      bool\n\tresolveGlobal     bool\n\tresolveSubOptions bool\n\tskipRequired      bool\n}\n\ntype Option func(r *Resolver)\n\nfunc New(userOptions map[string]string, extraValues map[string]string, logger log.Logger, opts ...Option) *Resolver {\n\tif userOptions == nil {\n\t\tuserOptions = map[string]string{}\n\t}\n\n\tresolver := &Resolver{\n\t\tuserOptions: userOptions,\n\t\textraValues: extraValues,\n\t\tlog:         logger,\n\t}\n\tfor _, o := range opts {\n\t\to(resolver)\n\t}\n\n\treturn resolver\n}\n\nfunc WithResolveLocal() Option {\n\treturn func(r *Resolver) {\n\t\tr.resolveLocal = true\n\t}\n}\n\nfunc WithResolveGlobal() Option {\n\treturn func(r *Resolver) {\n\t\tr.resolveGlobal = true\n\t}\n}\n\nfunc WithResolveSubOptions() Option {\n\treturn func(r *Resolver) {\n\t\tr.resolveSubOptions = true\n\t}\n}\n\nfunc WithSkipRequired(skip bool) Option {\n\treturn func(r *Resolver) {\n\t\tr.skipRequired = skip\n\t}\n}\n\nfunc (r *Resolver) Resolve(\n\tctx context.Context,\n\tdynamicDefinitions map[string]*types.Option,\n\toptionDefinitions map[string]*types.Option,\n\toptionValues map[string]config.OptionValue,\n) (map[string]config.OptionValue, config.OptionDefinitions, error) {\n\tif dynamicDefinitions == nil {\n\t\tdynamicDefinitions = map[string]*types.Option{}\n\t}\n\tif optionDefinitions == nil {\n\t\toptionDefinitions = map[string]*types.Option{}\n\t}\n\tmergedOptionDefinitions := mergeMaps(dynamicDefinitions, optionDefinitions)\n\n\t// create a new graph, which we resolve from top to bottom, where a child represents an\n\t// option that is dependent on the parent. Parents will be resolved first.\n\tr.graph = graph.NewGraphOf(graph.NewNode[*types.Option](rootID, nil), \"provider option\")\n\terr := addOptionsToGraph(r.graph, mergedOptionDefinitions, optionValues)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// resolve options\n\tresolvedOptions, err := r.resolveOptions(ctx, optionValues)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// find out new dynamic options\n\tnewDynamicDefinitions := config.OptionDefinitions{}\n\tfor k, node := range r.graph.Nodes {\n\t\tif k == rootID || optionDefinitions[k] != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// check if someone has the option as children\n\t\tfor _, v := range resolvedOptions {\n\t\t\tif contains(v.Children, k) {\n\t\t\t\tnewDynamicDefinitions[k] = node.Data\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove options that are not there anymore\n\tfor k := range resolvedOptions {\n\t\tif newDynamicDefinitions[k] == nil && optionDefinitions[k] == nil {\n\t\t\tdelete(resolvedOptions, k)\n\t\t}\n\t}\n\n\t// print unused user values\n\tif !r.skipRequired {\n\t\tprintUnusedUserValues(r.userOptions, mergeMaps(optionDefinitions, newDynamicDefinitions), r.log)\n\t}\n\n\treturn resolvedOptions, newDynamicDefinitions, nil\n}\n"
  },
  {
    "path": "pkg/options/resolver/sub_options.go",
    "content": "package resolver\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/ghodss/yaml\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc execOptionCommand(ctx context.Context, command string, resolvedOptions map[string]config.OptionValue, extraValues map[string]string) (*bytes.Buffer, error) {\n\tstdout := &bytes.Buffer{}\n\tstderr := &bytes.Buffer{}\n\tenv := os.Environ()\n\tfor k, v := range combine(resolvedOptions, extraValues) {\n\t\tenv = append(env, k+\"=\"+v)\n\t}\n\n\terr := shell.RunEmulatedShell(ctx, command, nil, stdout, stderr, env)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"exec command: %s%s\", stdout.String(), stderr.String())\n\t}\n\n\treturn stdout, nil\n}\n\nfunc resolveFromCommand(ctx context.Context, option *types.Option, resolvedOptions map[string]config.OptionValue, extraValues map[string]string) (config.OptionValue, error) {\n\tcmdOut, err := execOptionCommand(ctx, option.Command, resolvedOptions, extraValues)\n\tif err != nil {\n\t\treturn config.OptionValue{}, errors.Wrap(err, \"run command\")\n\t}\n\toptionValue := config.OptionValue{Value: strings.TrimSpace(cmdOut.String())}\n\texpire := types.NewTime(time.Now())\n\toptionValue.Filled = &expire\n\treturn optionValue, nil\n}\n\nfunc resolveSubOptions(ctx context.Context, option *types.Option, resolvedOptions map[string]config.OptionValue, extraValues map[string]string) (config.OptionDefinitions, error) {\n\tcmdOut, err := execOptionCommand(ctx, option.SubOptionsCommand, resolvedOptions, extraValues)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"run subOptionsCommand\")\n\t}\n\tsubOptions := provider.SubOptions{}\n\terr = yaml.Unmarshal(cmdOut.Bytes(), &subOptions)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"parse subOptionsCommand: %s\", cmdOut.String())\n\t}\n\n\t// prepare new options\n\t// need to look for option in graph. should be rather easy because we don't need to traverse the whole graph\n\tretOpts := config.OptionDefinitions{}\n\tfor k, v := range subOptions.Options {\n\t\tretOpts[k] = v\n\t}\n\n\treturn retOpts, nil\n}\n"
  },
  {
    "path": "pkg/options/resolver/util.go",
    "content": "package resolver\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/graph\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\nfunc combine(resolvedOptions map[string]config.OptionValue, extraValues map[string]string) map[string]string {\n\toptions := map[string]string{}\n\tfor k, v := range extraValues {\n\t\toptions[k] = v\n\t}\n\tfor k, v := range resolvedOptions {\n\t\toptions[k] = v.Value\n\t}\n\treturn options\n}\n\nfunc addDependencies(g *graph.Graph[*types.Option], options config.OptionDefinitions, optionValues map[string]config.OptionValue) error {\n\t// add options\n\tfor optionName := range options {\n\t\terr := addDependency(g, optionValues, optionName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// remove root parent if possible\n\tremoveRootParent(g)\n\treturn nil\n}\n\nfunc addDependency(g *graph.Graph[*types.Option], optionValues map[string]config.OptionValue, optionName string) error {\n\toption := g.Nodes[optionName].Data\n\n\t// Always add children as dependencies\n\tfor _, childName := range optionValues[optionName].Children {\n\t\tif g.Nodes[childName] == nil || childName == optionName {\n\t\t\tcontinue\n\t\t}\n\n\t\tif !option.Global && g.Nodes[childName].Data.Global {\n\t\t\treturn fmt.Errorf(\"cannot use a global option as a dependency of a non-global option. Option '%s' used in command of option '%s'\", childName, optionName)\n\t\t} else if option.Local && !g.Nodes[childName].Data.Local {\n\t\t\treturn fmt.Errorf(\"cannot use a non-local option as a dependency of a local option. Option '%s' used in default of option '%s'\", childName, optionName)\n\t\t}\n\n\t\terr := g.AddChild(optionName, childName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Find variables in default value\n\tfor _, dep := range findVariables(option.Default) {\n\t\tif g.Nodes[dep] == nil || dep == optionName {\n\t\t\tcontinue\n\t\t}\n\n\t\tif option.Global && !g.Nodes[dep].Data.Global {\n\t\t\treturn fmt.Errorf(\"cannot use a global option as a dependency of a non-global option. Option '%s' used in default of option '%s'\", dep, optionName)\n\t\t} else if !option.Local && g.Nodes[dep].Data.Local {\n\t\t\treturn fmt.Errorf(\"cannot use a non-local option as a dependency of a local option. Option '%s' used in default of option '%s'\", dep, optionName)\n\t\t}\n\n\t\terr := g.AddChild(dep, optionName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Find variables in command value\n\tfor _, dep := range findVariables(option.Command) {\n\t\tif g.Nodes[dep] == nil || dep == optionName {\n\t\t\tcontinue\n\t\t}\n\n\t\tif option.Global && !g.Nodes[dep].Data.Global {\n\t\t\treturn fmt.Errorf(\"cannot use a global option as a dependency of a non-global option. Option '%s' used in command of option '%s'\", dep, optionName)\n\t\t} else if !option.Local && g.Nodes[dep].Data.Local {\n\t\t\treturn fmt.Errorf(\"cannot use a non-local option as a dependency of a local option. Option '%s' used in default of option '%s'\", dep, optionName)\n\t\t}\n\n\t\terr := g.AddChild(dep, optionName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc addOptionsToGraph(g *graph.Graph[*types.Option], optionDefinitions config.OptionDefinitions, optionValues map[string]config.OptionValue) error {\n\tfor optionName, option := range optionDefinitions {\n\t\t_, ok := g.Nodes[optionName]\n\t\tif ok {\n\t\t\tg.Nodes[optionName].Data = option\n\t\t\tcontinue\n\t\t}\n\n\t\t_, err := g.InsertNodeAt(rootID, optionName, option)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// add dependencies\n\terr := addDependencies(g, optionDefinitions, optionValues)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc deleteChildrenOf(graph *graph.Graph[*types.Option], node *graph.Node[*types.Option]) error {\n\tfor _, child := range node.Childs {\n\t\terr := graph.RemoveSubGraph(child.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc removeRootParent(g *graph.Graph[*types.Option]) {\n\tfor optionName := range g.Nodes {\n\t\tnode := g.Nodes[optionName]\n\n\t\t// remove root parent\n\t\tif len(node.Parents) > 1 {\n\t\t\tnewParents := []*graph.Node[*types.Option]{}\n\t\t\tremoved := false\n\t\t\tfor _, parent := range node.Parents {\n\t\t\t\tif parent.ID == rootID {\n\t\t\t\t\tremoved = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tnewParents = append(newParents, parent)\n\t\t\t}\n\t\t\tnode.Parents = newParents\n\n\t\t\t// remove from root childs\n\t\t\tif removed {\n\t\t\t\tnewChilds := []*graph.Node[*types.Option]{}\n\t\t\t\tfor _, child := range g.Root.Childs {\n\t\t\t\t\tif child.ID == node.ID {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tnewChilds = append(newChilds, child)\n\t\t\t\t}\n\t\t\t\tg.Root.Childs = newChilds\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc findVariables(str string) []string {\n\tretVars := map[string]bool{}\n\tmatches := variableExpression.FindAllStringSubmatch(str, -1)\n\tfor _, match := range matches {\n\t\tif len(match) != 5 {\n\t\t\tcontinue\n\t\t}\n\n\t\tretVars[match[1]] = true\n\t}\n\n\tretVarsArr := []string{}\n\tfor k := range retVars {\n\t\tretVarsArr = append(retVarsArr, k)\n\t}\n\n\tsort.Strings(retVarsArr)\n\treturn retVarsArr\n}\n\nfunc mergeMaps[K comparable, V any](existing map[K]V, newOpts map[K]V) map[K]V {\n\tretOpts := map[K]V{}\n\tfor k, v := range existing {\n\t\tretOpts[k] = v\n\t}\n\tfor k, v := range newOpts {\n\t\tretOpts[k] = v\n\t}\n\n\treturn retOpts\n}\n"
  },
  {
    "path": "pkg/platform/annotations/annotations.go",
    "content": "package annotations\n\n// LoftDirectClusterEndpoint is a cluster annotation that tells clients to use this endpoint instead of\n// the default loft server address to connect to this cluster.\nconst LoftDirectClusterEndpoint = \"loft.sh/direct-cluster-endpoint\"\n"
  },
  {
    "path": "pkg/platform/client/client.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"crypto/x509\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/blang/semver\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/api/v4/pkg/auth\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/kube\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n\tperrors \"github.com/pkg/errors\"\n\t\"github.com/skratchdot/open-golang/open\"\n\t\"k8s.io/client-go/rest\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n\tclientcmdapi \"k8s.io/client-go/tools/clientcmd/api\"\n)\n\nvar CacheFolder = \".loft\"\n\n// DefaultCacheConfig is the path to the config\nvar DefaultCacheConfig = \"config.json\"\n\n// Copied from platform `pkg/authentication/registry.go`\nvar ErrAccessKeyNotFound = fmt.Errorf(\"platform access key not found. Please login again\")\n\nconst (\n\tVersionPath   = \"%s/version\"\n\tLoginPath     = \"%s/login?cli=true\"\n\tRedirectPath  = \"%s/spaces\"\n\tAccessKeyPath = \"%s/profile/access-keys\"\n\tRefreshToken  = time.Minute * 30\n)\n\nfunc init() {\n\thd, _ := util.UserHomeDir()\n\tif folder, ok := os.LookupEnv(\"LOFT_CACHE_FOLDER\"); ok {\n\t\tCacheFolder = filepath.Join(hd, folder)\n\t} else {\n\t\tCacheFolder = filepath.Join(hd, CacheFolder)\n\t}\n\tDefaultCacheConfig = filepath.Join(CacheFolder, DefaultCacheConfig)\n}\n\ntype Client interface {\n\tManagement() (kube.Interface, error)\n\tManagementConfig() (*rest.Config, error)\n\tRefreshSelf(ctx context.Context) error\n\tSelf() *managementv1.Self\n\n\tLogin(host string, insecure bool, log log.Logger) error\n\tLoginWithAccessKey(host, accessKey string, insecure bool, force bool) error\n\tLoginRaw(host, accessKey string, insecure bool) error\n\n\tLogout(ctx context.Context) error\n\n\tVersion() (*auth.Version, error)\n\tConfig() *Config\n\tSave() error\n}\n\nfunc NewClient() Client {\n\treturn &client{\n\t\tconfig: &Config{},\n\t}\n}\n\nfunc NewClientFromConfig(c *Config) Client {\n\treturn &client{\n\t\tconfig: c,\n\t}\n}\n\nfunc NewClientFromPath(path string) (Client, error) {\n\tc := &client{\n\t\tconfigPath: path,\n\t}\n\n\terr := c.initConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}\n\nfunc InitClientFromPath(ctx context.Context, path string) (Client, error) {\n\tc, err := NewClientFromPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.RefreshSelf(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}\n\ntype client struct {\n\tconfig     *Config\n\tconfigPath string\n\tconfigOnce sync.Once\n\n\tself *managementv1.Self\n}\n\nfunc (c *client) RefreshSelf(ctx context.Context) error {\n\tmanagementClient, err := c.Management()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create mangement client: %w\", err)\n\t}\n\n\tc.self, err = managementClient.Loft().ManagementV1().Selves().Create(ctx, &managementv1.Self{}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error trying to reach platform: %w. This usually indicates you either have no connection to the platform or are not authenticated\", err)\n\t}\n\n\tprojectNamespacePrefix := project.DefaultProjectNamespacePrefix\n\tif c.self.Status.ProjectNamespacePrefix != nil {\n\t\tprojectNamespacePrefix = *c.self.Status.ProjectNamespacePrefix\n\t}\n\n\tproject.SetProjectNamespacePrefix(projectNamespacePrefix)\n\n\treturn nil\n}\n\nfunc (c *client) Self() *managementv1.Self {\n\treturn c.self.DeepCopy()\n}\n\n// Logout implements Client.\nfunc (c *client) Logout(ctx context.Context) error {\n\tmanagementClient, err := c.Management()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create management client: %w\", err)\n\t}\n\n\tself, err := managementClient.Loft().ManagementV1().Selves().Create(ctx, &managementv1.Self{}, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get self: %w\", err)\n\t}\n\n\tif self.Status.AccessKey != \"\" && self.Status.AccessKeyType == storagev1.AccessKeyTypeLogin {\n\t\terr = managementClient.Loft().ManagementV1().OwnedAccessKeys().Delete(ctx, self.Status.AccessKey, metav1.DeleteOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"delete access key: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *client) initConfig() error {\n\tvar retErr error\n\tc.configOnce.Do(func() {\n\t\t// load the config or create new one if not found\n\t\tcontent, err := os.ReadFile(c.configPath)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tc.config = NewConfig()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tretErr = err\n\t\t\treturn\n\t\t}\n\n\t\tconfig := &Config{\n\t\t\tVirtualClusterAccessPointCertificates: make(map[string]VirtualClusterCertificatesEntry),\n\t\t}\n\t\terr = json.Unmarshal(content, config)\n\t\tif err != nil {\n\t\t\tretErr = err\n\t\t\treturn\n\t\t}\n\n\t\tc.config = config\n\t})\n\n\treturn retErr\n}\n\nfunc (c *client) Save() error {\n\tif c.configPath == \"\" {\n\t\treturn nil\n\t}\n\tif c.config == nil {\n\t\treturn perrors.New(\"no config to write\")\n\t}\n\tif c.config.Kind == \"\" {\n\t\tc.config.Kind = \"Config\"\n\t}\n\tif c.config.APIVersion == \"\" {\n\t\tc.config.APIVersion = \"storage.loft.sh/v1\"\n\t}\n\n\terr := os.MkdirAll(filepath.Dir(c.configPath), 0o755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := json.Marshal(c.config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn os.WriteFile(c.configPath, out, 0o660)\n}\n\nfunc (c *client) ManagementConfig() (*rest.Config, error) {\n\treturn c.restConfig(\"/kubernetes/management\")\n}\n\nfunc (c *client) Management() (kube.Interface, error) {\n\trestConfig, err := c.ManagementConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn kube.NewForConfig(restConfig)\n}\n\nfunc (c *client) Config() *Config {\n\treturn c.config\n}\n\ntype keyStruct struct {\n\tKey string\n}\n\nfunc verifyHost(host string) error {\n\tif !strings.HasPrefix(host, \"https\") {\n\t\treturn fmt.Errorf(\"cannot log into a non https loft instance '%s', please make sure you have TLS enabled\", host)\n\t}\n\n\treturn nil\n}\n\nfunc (c *client) Version() (*auth.Version, error) {\n\trestConfig, err := c.restConfig(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trestClient, err := kube.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\traw, err := restClient.CoreV1().RESTClient().Get().RequestURI(\"/version\").DoRaw(context.Background())\n\tif err != nil {\n\t\treturn nil, perrors.New(fmt.Sprintf(\"%s\\n\\nYou may need to login again via `%s login %s --insecure` to allow self-signed certificates\\n\", err.Error(), os.Args[0], restConfig.Host))\n\t}\n\n\tversion := &auth.Version{}\n\terr = json.Unmarshal(raw, version)\n\tif err != nil {\n\t\treturn nil, perrors.Wrap(err, \"parse version response\")\n\t}\n\n\treturn version, nil\n}\n\nfunc (c *client) Login(host string, insecure bool, log log.Logger) error {\n\tvar (\n\t\tloginUrl   = fmt.Sprintf(LoginPath, host)\n\t\tkey        keyStruct\n\t\tkeyChannel = make(chan keyStruct)\n\t)\n\n\terr := verifyHost(host)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tserver := startServer(fmt.Sprintf(RedirectPath, host), keyChannel, log)\n\terr = open.Run(fmt.Sprintf(LoginPath, host))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't open the login page in a browser: %w. Please use the --access-key flag for the login command. You can generate an access key here: %s\", err, fmt.Sprintf(AccessKeyPath, host))\n\t} else {\n\t\tlog.Infof(\"If the browser does not open automatically, please navigate to %s\", loginUrl)\n\t\tmsg := \"If you have problems logging in, please navigate to %s/profile/access-keys, click on 'Create Access Key' and then login via '%s %s --access-key ACCESS_KEY\"\n\t\tif insecure {\n\t\t\tmsg += \" --insecure\"\n\t\t}\n\t\tmsg += \"'\"\n\t\tlog.Infof(msg, host, \"devpod pro login\", host)\n\t\tlog.Infof(\"Logging into DevPod Pro...\")\n\n\t\tkey = <-keyChannel\n\t}\n\n\tgo func() {\n\t\terr = server.Shutdown(context.Background())\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error shutting down server: %v\", err)\n\t\t}\n\t}()\n\n\tclose(keyChannel)\n\treturn c.LoginWithAccessKey(host, key.Key, insecure, false)\n}\n\nfunc (c *client) LoginRaw(host, accessKey string, insecure bool) error {\n\tif c.config.Host == host && c.config.AccessKey == accessKey {\n\t\treturn nil\n\t}\n\n\tc.config.Host = host\n\tc.config.Insecure = insecure\n\tc.config.AccessKey = accessKey\n\treturn c.Save()\n}\n\nfunc (c *client) LoginWithAccessKey(host, accessKey string, insecure bool, force bool) error {\n\terr := verifyHost(host)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !force && c.config.Host == host && c.config.AccessKey == accessKey {\n\t\treturn nil\n\t}\n\n\t// delete old access key if were logged in before\n\tif !force && c.config.AccessKey != \"\" {\n\t\tmanagementClient, err := c.Management()\n\t\tif err == nil {\n\t\t\tself, err := managementClient.Loft().ManagementV1().Selves().Create(context.TODO(), &managementv1.Self{}, metav1.CreateOptions{})\n\t\t\tif err == nil && self.Status.AccessKey != \"\" && self.Status.AccessKeyType == storagev1.AccessKeyTypeLogin {\n\t\t\t\t_ = managementClient.Loft().ManagementV1().OwnedAccessKeys().Delete(context.TODO(), self.Status.AccessKey, metav1.DeleteOptions{})\n\t\t\t}\n\t\t}\n\t}\n\n\tc.config.Host = host\n\tc.config.Insecure = insecure\n\tc.config.AccessKey = accessKey\n\n\t// verify the connection works\n\tmanagementClient, err := c.Management()\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"create management client\")\n\t}\n\n\t// try to get self\n\t_, err = managementClient.Loft().ManagementV1().Selves().Create(context.TODO(), &managementv1.Self{}, metav1.CreateOptions{})\n\tif err != nil {\n\t\tvar urlError *url.Error\n\t\tif errors.As(err, &urlError) {\n\t\t\tvar err x509.UnknownAuthorityError\n\t\t\tif errors.As(urlError.Err, &err) {\n\t\t\t\treturn fmt.Errorf(\"unsafe login endpoint '%s', if you wish to login into an insecure loft endpoint run with the '--insecure' flag\", c.config.Host)\n\t\t\t}\n\t\t}\n\n\t\treturn perrors.Errorf(\"error logging in: %v\", err)\n\t}\n\n\treturn c.Save()\n}\n\n// VerifyVersion checks if the Loft version is compatible with this CLI version\nfunc VerifyVersion(baseClient Client) error {\n\tv, err := baseClient.Version()\n\tif err != nil {\n\t\treturn err\n\t} else if v.Version == \"v0.0.0\" {\n\t\treturn nil\n\t}\n\n\tbackendMajor, err := strconv.Atoi(v.Major)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"parse major version string\")\n\t}\n\n\tcliVersionStr := version.GetVersion()\n\tcliVersionStr = strings.TrimPrefix(cliVersionStr, \"v\")\n\tif cliVersionStr == \"\" {\n\t\treturn nil\n\t}\n\n\tcliVersion, err := semver.Parse(cliVersionStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif int(cliVersion.Major) > backendMajor {\n\t\treturn fmt.Errorf(\"unsupported %[1]s version %[2]s. Please downgrade your CLI to below v%[3]d.0.0 to support this version, as %[1]s v%[3]d.0.0 and newer versions are incompatible with v%[4]d.x.x\", \"DevPod Pro\", v.Version, cliVersion.Major, backendMajor)\n\t} else if int(cliVersion.Major) < backendMajor {\n\t\treturn fmt.Errorf(\"unsupported %[1]s version %[2]s. Please upgrade your CLI to v%[3]d.0.0 or above to support this version, as %[1]s v%[3]d.0.0 and newer versions are incompatible with v%[4]d.x.x\", \"DevPod Pro\", v.Version, backendMajor, cliVersion.Major)\n\t}\n\n\treturn nil\n}\n\nfunc (c *client) restConfig(hostSuffix string) (*rest.Config, error) {\n\tif c.config == nil {\n\t\treturn nil, perrors.New(\"no config loaded\")\n\t} else if c.config.Host == \"\" || c.config.AccessKey == \"\" {\n\t\treturn nil, perrors.New(fmt.Sprintf(\"not logged in, please make sure you have run '%s' to create one or '%s [%s]' if one already exists\", \"devpod pro start\", \"devpod pro login\", \"devpod-pro-url\"))\n\t}\n\n\t// build a rest config\n\tconfig, err := GetRestConfig(c.config.Host+hostSuffix, c.config.AccessKey, c.config.Insecure)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn config, err\n}\n\nfunc GetKubeConfig(host, token, namespace string, insecure bool) clientcmd.ClientConfig {\n\tcontextName := \"local\"\n\tkubeConfig := clientcmdapi.NewConfig()\n\tkubeConfig.Contexts = map[string]*clientcmdapi.Context{\n\t\tcontextName: {\n\t\t\tCluster:   contextName,\n\t\t\tAuthInfo:  contextName,\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n\tkubeConfig.Clusters = map[string]*clientcmdapi.Cluster{\n\t\tcontextName: {\n\t\t\tServer:                host,\n\t\t\tInsecureSkipTLSVerify: insecure,\n\t\t},\n\t}\n\tkubeConfig.AuthInfos = map[string]*clientcmdapi.AuthInfo{\n\t\tcontextName: {\n\t\t\tToken: token,\n\t\t},\n\t}\n\tkubeConfig.CurrentContext = contextName\n\treturn clientcmd.NewDefaultClientConfig(*kubeConfig, &clientcmd.ConfigOverrides{})\n}\n\nfunc GetRestConfig(host, token string, insecure bool) (*rest.Config, error) {\n\tconfig, err := GetKubeConfig(host, token, \"\", insecure).ClientConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig.UserAgent = \"devpod/\" + version.GetVersion()\n\n\treturn config, nil\n}\n\nfunc startServer(redirectURI string, keyChannel chan keyStruct, log log.Logger) *http.Server {\n\tsrv := &http.Server{Addr: \":25843\"}\n\n\thttp.HandleFunc(\"/login\", func(w http.ResponseWriter, r *http.Request) {\n\t\tkeys, ok := r.URL.Query()[\"key\"]\n\t\tif !ok || len(keys[0]) == 0 {\n\t\t\tlog.Warn(\"Login: the key used to login is not valid\")\n\t\t\treturn\n\t\t}\n\n\t\tkeyChannel <- keyStruct{\n\t\t\tKey: keys[0],\n\t\t}\n\t\thttp.Redirect(w, r, redirectURI, http.StatusSeeOther)\n\t})\n\n\tgo func() {\n\t\t// cannot panic, because this probably is an intentional close\n\t\t_ = srv.ListenAndServe()\n\t}()\n\n\t// returning reference so caller can call Shutdown()\n\treturn srv\n}\n"
  },
  {
    "path": "pkg/platform/client/config.go",
    "content": "package client\n\nimport (\n\t\"time\"\n\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\n// Config defines the client config structure\ntype Config struct {\n\tmetav1.TypeMeta `json:\",inline\"`\n\n\t// host is the http endpoint of how to access loft\n\t// +optional\n\tHost string `json:\"host,omitempty\"`\n\n\t// LastInstallContext is the last install context\n\t// +optional\n\tLastInstallContext string `json:\"lastInstallContext,omitempty\"`\n\n\t// insecure specifies if the loft instance is insecure\n\t// +optional\n\tInsecure bool `json:\"insecure,omitempty\"`\n\n\t// access key is the access key for the given loft host\n\t// +optional\n\tAccessKey string `json:\"accesskey,omitempty\"`\n\n\t// virtual cluster access key is the access key for the given loft host to create virtual clusters\n\t// +optional\n\tVirtualClusterAccessKey string `json:\"virtualClusterAccessKey,omitempty\"`\n\n\t// map of cached certificates for \"access point\" mode virtual clusters\n\t// +optional\n\tVirtualClusterAccessPointCertificates map[string]VirtualClusterCertificatesEntry\n}\n\ntype VirtualClusterCertificatesEntry struct {\n\tCertificateData string\n\tKeyData         string\n\tLastRequested   metav1.Time\n\tExpirationTime  time.Time\n}\n\n// NewConfig creates a new config\nfunc NewConfig() *Config {\n\treturn &Config{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind:       \"Config\",\n\t\t\tAPIVersion: \"storage.loft.sh/v1\",\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "pkg/platform/client.go",
    "content": "package platform\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc InitClientFromHost(ctx context.Context, devPodConfig *config.Config, devPodProHost string, log log.Logger) (client.Client, error) {\n\tprovider, err := ProviderFromHost(ctx, devPodConfig, devPodProHost, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"provider from pro instance: %w\", err)\n\t}\n\n\treturn InitClientFromProvider(ctx, devPodConfig, provider, log)\n}\n\nfunc InitClientFromProvider(ctx context.Context, devPodConfig *config.Config, providerName string, log log.Logger) (client.Client, error) {\n\tconfigPath, err := LoftConfigPath(devPodConfig.DefaultContext, providerName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loft config path: %w\", err)\n\t}\n\n\treturn client.InitClientFromPath(ctx, configPath)\n}\n\nfunc ProviderFromHost(ctx context.Context, devPodConfig *config.Config, devPodProHost string, log log.Logger) (string, error) {\n\tproInstanceConfig, err := provider.LoadProInstanceConfig(devPodConfig.DefaultContext, devPodProHost)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"load pro instance %s: %w\", devPodProHost, err)\n\t}\n\n\treturn proInstanceConfig.Provider, nil\n}\n\nfunc LoftConfigPath(context string, providerName string) (string, error) {\n\tproviderDir, err := provider.GetProviderDir(context, providerName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tconfigPath := filepath.Join(providerDir, \"loft-config.json\")\n\n\treturn configPath, nil\n}\n"
  },
  {
    "path": "pkg/platform/config.go",
    "content": "package platform\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n)\n\nconst (\n\tdefaultTimeout                    = 10 * time.Minute\n\tLoftPlatformConfigFileName string = \"loft-config.json\" // TODO: replace hardcoded strings with this\n)\n\nfunc Timeout() time.Duration {\n\tif timeout := os.Getenv(TimeoutEnv); timeout != \"\" {\n\t\tif parsedTimeout, err := time.ParseDuration(timeout); err == nil {\n\t\t\treturn parsedTimeout\n\t\t}\n\t}\n\n\treturn defaultTimeout\n}\n\n// ReadConfig reads client.Config for given context and provider\nfunc ReadConfig(contextName string, providerName string) (*client.Config, error) {\n\t// contextName is allowed to be empty\n\tproviderDir, err := provider.GetProviderDir(contextName, providerName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigPath := filepath.Join(providerDir, LoftPlatformConfigFileName)\n\n\t// Check if given context and provider have Loft Platform configuration\n\tif _, err := os.Stat(configPath); os.IsNotExist(err) {\n\t\t// If not just return empty response\n\t\treturn nil, err\n\t}\n\n\tcontent, err := os.ReadFile(configPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tloftConfig := &client.Config{}\n\terr = json.Unmarshal(content, loftConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn loftConfig, nil\n}\n"
  },
  {
    "path": "pkg/platform/deploy.go",
    "content": "package platform\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\t\"k8s.io/client-go/kubernetes\"\n)\n\n// CriticalStatus container status\nvar CriticalStatus = map[string]bool{\n\t\"Error\":                      true,\n\t\"Unknown\":                    true,\n\t\"ImagePullBackOff\":           true,\n\t\"CrashLoopBackOff\":           true,\n\t\"RunContainerError\":          true,\n\t\"ErrImagePull\":               true,\n\t\"CreateContainerConfigError\": true,\n\t\"InvalidImageName\":           true,\n}\n\nfunc WaitForPodReady(ctx context.Context, kubeClient kubernetes.Interface, namespace string, log log.Logger) (*corev1.Pod, error) {\n\t// wait until we have a running loft pod\n\tnow := time.Now()\n\tpod := &corev1.Pod{}\n\terr := wait.PollUntilContextTimeout(ctx, time.Second*2, Timeout(), true, func(ctx context.Context) (bool, error) {\n\t\tpods, err := kubeClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{\n\t\t\tLabelSelector: \"app=loft\",\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error trying to retrieve %s pod: %v\", \"DevPod Pro\", err)\n\t\t\treturn false, nil\n\t\t} else if len(pods.Items) == 0 {\n\t\t\tif time.Now().After(now.Add(time.Second * 10)) {\n\t\t\t\tlog.Infof(\"Still waiting for a %s pod...\", \"DevPod Pro\")\n\t\t\t\tnow = time.Now()\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\n\t\tsort.Slice(pods.Items, func(i, j int) bool {\n\t\t\treturn pods.Items[i].CreationTimestamp.After(pods.Items[j].CreationTimestamp.Time)\n\t\t})\n\n\t\tloftPod := &pods.Items[0]\n\t\tfound := false\n\t\tfor _, containerStatus := range loftPod.Status.ContainerStatuses {\n\t\t\tif containerStatus.State.Running != nil && containerStatus.Ready {\n\t\t\t\tif containerStatus.Name == \"manager\" {\n\t\t\t\t\tfound = true\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t} else if containerStatus.State.Terminated != nil || (containerStatus.State.Waiting != nil && CriticalStatus[containerStatus.State.Waiting.Reason]) {\n\t\t\t\treason := \"\"\n\t\t\t\tmessage := \"\"\n\t\t\t\tif containerStatus.State.Terminated != nil {\n\t\t\t\t\treason = containerStatus.State.Terminated.Reason\n\t\t\t\t\tmessage = containerStatus.State.Terminated.Message\n\t\t\t\t} else if containerStatus.State.Waiting != nil {\n\t\t\t\t\treason = containerStatus.State.Waiting.Reason\n\t\t\t\t\tmessage = containerStatus.State.Waiting.Message\n\t\t\t\t}\n\n\t\t\t\tout, err := kubeClient.CoreV1().Pods(namespace).GetLogs(loftPod.Name, &corev1.PodLogOptions{\n\t\t\t\t\tContainer: \"manager\",\n\t\t\t\t}).Do(context.Background()).Raw()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, fmt.Errorf(\"there seems to be an issue with %s starting up: %s (%s). Please reach out to our support at https://loft.sh/\", \"DevPod Pro\", message, reason)\n\t\t\t\t}\n\t\t\t\tif strings.Contains(string(out), \"register instance: Post \\\"https://license.loft.sh/register\\\": dial tcp\") {\n\t\t\t\t\treturn false, fmt.Errorf(\"%[1]s logs: \\n%[2]v \\nThere seems to be an issue with %[1]s starting up. Looks like you try to install %[1]s into an air-gapped environment, please reach out to our support at https://loft.sh/ for an offline license\", \"DevPod Pro\", string(out))\n\t\t\t\t}\n\n\t\t\t\treturn false, fmt.Errorf(\"%[1]s logs: \\n%v \\nThere seems to be an issue with %[1]s starting up: %[2]s (%[3]s). Please reach out to our support at https://loft.sh/\", \"DevPod Pro\", string(out), message, reason)\n\t\t\t} else if containerStatus.State.Waiting != nil && time.Now().After(now.Add(time.Second*10)) {\n\t\t\t\tif containerStatus.State.Waiting.Message != \"\" {\n\t\t\t\t\tlog.Infof(\"Please keep waiting, %s container is still starting up: %s (%s)\", \"DevPod Pro\", containerStatus.State.Waiting.Message, containerStatus.State.Waiting.Reason)\n\t\t\t\t} else if containerStatus.State.Waiting.Reason != \"\" {\n\t\t\t\t\tlog.Infof(\"Please keep waiting, %s container is still starting up: %s\", \"DevPod Pro\", containerStatus.State.Waiting.Reason)\n\t\t\t\t} else {\n\t\t\t\t\tlog.Infof(\"Please keep waiting, %s container is still starting up...\", \"DevPod Pro\")\n\t\t\t\t}\n\n\t\t\t\tnow = time.Now()\n\t\t\t}\n\n\t\t\treturn false, nil\n\t\t}\n\n\t\tpod = loftPod\n\t\treturn found, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn pod, nil\n}\n"
  },
  {
    "path": "pkg/platform/env.go",
    "content": "package platform\n\nconst (\n\tWorkspaceIDEnv       = \"WORKSPACE_ID\"\n\tWorkspaceUIDEnv      = \"WORKSPACE_UID\"\n\tWorkspaceContextEnv  = \"WORKSPACE_CONTEXT\"\n\tWorkspaceProviderEnv = \"WORKSPACE_PROVIDER\"\n\tWorkspaceInstanceEnv = \"WORKSPACE_INSTANCE\"\n\tWorkspacePictureEnv  = \"WORKSPACE_PICTURE\"\n\tWorkspaceSourceEnv   = \"WORKSPACE_SOURCE\"\n\n\tConfigEnv  = \"LOFT_CONFIG\"\n\tProjectEnv = \"LOFT_PROJECT\"\n\tClusterEnv = \"LOFT_CLUSTER\"\n\tRunnerEnv  = \"LOFT_RUNNER\"\n\n\tTemplateOptionEnv        = \"LOFT_TEMPLATE\"\n\tTemplateVersionOptionEnv = \"LOFT_TEMPLATE_VERSION\"\n\n\tTimeoutEnv        = \"LOFT_TIMEOUT\"\n\tProviderBinaryEnv = \"PRO_PROVIDER\"\n\n\tSpaceInstanceNameEnv          = \"LOFT_SPACE_INSTANCE_NAME\"\n\tVirtualClusterInstanceNameEnv = \"LOFT_VIRTUAL_CLUSTER_INSTANCE_NAME\"\n\tInstanceNamespaceEnv          = \"LOFT_INSTANCE_NAMESPACE\"\n\n\tDaemonFolderEnv = \"DAEMON_FOLDER\"\n)\n"
  },
  {
    "path": "pkg/platform/form/form.go",
    "content": "package form\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/huh\"\n\t\"github.com/ghodss/yaml\"\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/cmd/pro/provider/list\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/labels\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc CreateInstance(ctx context.Context, baseClient client.Client, id, uid, source, picture string, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tformCtx, cancelForm := context.WithCancel(ctx)\n\tdefer cancelForm()\n\n\tvar selectedCluster *managementv1.Cluster\n\tvar selectedProject *managementv1.Project\n\tvar selectedTemplate *managementv1.DevPodWorkspaceTemplate\n\tselectedTemplateVersion := \"\"\n\tprojectOptions, err := projectOptions(ctx, baseClient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = huh.NewForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewSelect[*managementv1.Project]().\n\t\t\t\tTitle(\"Project\").\n\t\t\t\tOptions(projectOptions...).\n\t\t\t\tValue(&selectedProject),\n\t\t\thuh.NewSelect[*managementv1.Cluster]().\n\t\t\t\tTitle(\"Cluster\").\n\t\t\t\tOptionsFunc(func() []huh.Option[*managementv1.Cluster] {\n\t\t\t\t\treturn getClusterOptions(ctx, baseClient, selectedProject, cancelForm, log)\n\t\t\t\t}, &selectedProject).\n\t\t\t\tValue(&selectedCluster).\n\t\t\t\tWithHeight(5),\n\t\t\thuh.NewSelect[*managementv1.DevPodWorkspaceTemplate]().\n\t\t\t\tTitle(\"Template\").\n\t\t\t\tOptionsFunc(func() []huh.Option[*managementv1.DevPodWorkspaceTemplate] {\n\t\t\t\t\treturn getTemplateOptions(ctx, baseClient, selectedProject, cancelForm, log)\n\t\t\t\t}, &selectedProject).\n\t\t\t\tValue(&selectedTemplate),\n\t\t\thuh.NewSelect[string]().\n\t\t\t\tTitle(\"Template Version\").\n\t\t\t\tOptionsFunc(func() []huh.Option[string] {\n\t\t\t\t\treturn getTemplateVersionOptions(selectedTemplate)\n\t\t\t\t}, &selectedTemplate).\n\t\t\t\tValue(&selectedTemplateVersion).\n\t\t\t\tWithHeight(8),\n\t\t),\n\t).RunWithContext(formCtx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparameters := selectedTemplate.Spec.Parameters\n\tif len(selectedTemplate.GetVersions()) > 0 {\n\t\tparameters, err = list.GetTemplateParameters(selectedTemplate, selectedTemplateVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trenderedParameters := \"\"\n\tif len(parameters) > 0 {\n\t\tfieldParameters := prepareParameters(parameters)\n\t\terr = huh.NewForm(\n\t\t\thuh.NewGroup(parameterFields(fieldParameters)...),\n\t\t).RunWithContext(formCtx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trenderedParameters, err = renderParameters(fieldParameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tinstance := &managementv1.DevPodWorkspaceInstance{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tGenerateName: encoding.SafeConcatNameMax([]string{id}, 53) + \"-\",\n\t\t\tNamespace:    project.ProjectNamespace(selectedProject.GetName()),\n\t\t\tLabels: map[string]string{\n\t\t\t\tstoragev1.DevPodWorkspaceIDLabel:  id,\n\t\t\t\tstoragev1.DevPodWorkspaceUIDLabel: uid,\n\t\t\t\tlabels.ProjectLabel:               selectedProject.GetName(),\n\t\t\t},\n\t\t\tAnnotations: map[string]string{\n\t\t\t\tstoragev1.DevPodWorkspacePictureAnnotation: picture,\n\t\t\t\tstoragev1.DevPodWorkspaceSourceAnnotation:  source,\n\t\t\t},\n\t\t},\n\t\tSpec: managementv1.DevPodWorkspaceInstanceSpec{\n\t\t\tDevPodWorkspaceInstanceSpec: storagev1.DevPodWorkspaceInstanceSpec{\n\t\t\t\tDisplayName: id,\n\t\t\t\tTemplateRef: &storagev1.TemplateRef{\n\t\t\t\t\tName:    selectedTemplate.GetName(),\n\t\t\t\t\tVersion: selectedTemplateVersion,\n\t\t\t\t},\n\t\t\t\t// FIXME: Bring back runner ref\n\t\t\t\t// ClusterRef: storagev1.ClusterRef{\n\t\t\t\t// \tCluster: selectedCluster.GetName(),\n\t\t\t\t// },\n\t\t\t\tParameters: renderedParameters,\n\t\t\t},\n\t\t},\n\t}\n\n\treturn instance, nil\n}\n\nfunc UpdateInstance(ctx context.Context, baseClient client.Client, instance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tformCtx, cancelForm := context.WithCancel(ctx)\n\tdefer cancelForm()\n\n\tprojectName := project.ProjectFromNamespace(instance.GetNamespace())\n\tprojectTemplates, err := list.Templates(ctx, baseClient, projectName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar selectedTemplate *managementv1.DevPodWorkspaceTemplate\n\ttemplateOptions := []TemplateOption{}\n\tfor _, template := range projectTemplates.DevPodWorkspaceTemplates {\n\t\tt := &template\n\t\ttemplateOptions = append(templateOptions, huh.Option[*managementv1.DevPodWorkspaceTemplate]{\n\t\t\tKey:   platform.DisplayName(template.GetName(), template.Spec.DisplayName),\n\t\t\tValue: t,\n\t\t})\n\n\t\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Name == template.GetName() {\n\t\t\tselectedTemplate = t\n\t\t}\n\t}\n\tif selectedTemplate == nil {\n\t\treturn nil, fmt.Errorf(\"template not found: %#v\", instance.Spec.TemplateRef)\n\t}\n\n\tvar selectedTemplateVersion string\n\tif instance.Spec.TemplateRef != nil {\n\t\tselectedTemplateVersion = instance.Spec.TemplateRef.Version\n\t}\n\n\terr = huh.NewForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewSelect[*managementv1.DevPodWorkspaceTemplate]().\n\t\t\t\tTitle(\"Template\").\n\t\t\t\tOptions(templateOptions...).\n\t\t\t\tValue(&selectedTemplate),\n\t\t\thuh.NewSelect[string]().\n\t\t\t\tTitle(\"Template Version\").\n\t\t\t\tOptionsFunc(func() []huh.Option[string] {\n\t\t\t\t\treturn getTemplateVersionOptions(selectedTemplate)\n\t\t\t\t}, &selectedTemplate).\n\t\t\t\tValue(&selectedTemplateVersion).\n\t\t\t\tWithHeight(8),\n\t\t),\n\t).RunWithContext(formCtx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparameters := selectedTemplate.Spec.Parameters\n\tif len(selectedTemplate.GetVersions()) > 0 {\n\t\tparameters, err = list.GetTemplateParameters(selectedTemplate, selectedTemplateVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trenderedParameters := \"\"\n\tif len(parameters) > 0 {\n\t\ttRef := instance.Spec.TemplateRef\n\t\tvar existingParameters map[string]interface{}\n\t\tif tRef != nil && tRef.Name == selectedTemplate.GetName() && tRef.Version == selectedTemplateVersion {\n\t\t\texistingParameters = map[string]interface{}{}\n\t\t\terr = yaml.Unmarshal([]byte(instance.Spec.Parameters), &existingParameters)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tfieldParameters := []*FieldParameter{}\n\t\t// reuse existing parameters as starting point\n\t\tfor _, p := range parameters {\n\t\t\tvar value interface{} = p.DefaultValue\n\t\t\tif existingParameters != nil {\n\t\t\t\tvalue = getDeepValue(existingParameters, p.Variable)\n\t\t\t}\n\t\t\tfieldParameter := FieldParameter{AppParameter: p}\n\n\t\t\tif p.Type == \"boolean\" && value != nil {\n\t\t\t\tv, err := strconv.ParseBool(value.(string))\n\t\t\t\tif err == nil {\n\t\t\t\t\tfieldParameter.BoolValue = v\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif value != nil {\n\t\t\t\t\tfieldParameter.StringValue = value.(string)\n\t\t\t\t} else {\n\t\t\t\t\tfieldParameter.StringValue = p.DefaultValue\n\t\t\t\t}\n\t\t\t}\n\t\t\tfieldParameters = append(fieldParameters, &fieldParameter)\n\t\t}\n\n\t\terr = huh.NewForm(\n\t\t\thuh.NewGroup(parameterFields(fieldParameters)...),\n\t\t).RunWithContext(formCtx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trenderedParameters, err = renderParameters(fieldParameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tnewInstance := instance.DeepCopy()\n\t// template\n\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Name != selectedTemplate.GetName() {\n\t\tnewInstance.Spec.TemplateRef.Name = selectedTemplate.GetName()\n\t}\n\t// version\n\tif instance.Spec.TemplateRef != nil && instance.Spec.TemplateRef.Version != selectedTemplateVersion {\n\t\tnewInstance.Spec.TemplateRef.Version = selectedTemplateVersion\n\t}\n\t// parameters\n\tif instance.Spec.Parameters != renderedParameters {\n\t\tnewInstance.Spec.Parameters = renderedParameters\n\t}\n\n\treturn newInstance, nil\n}\n\ntype ProjectOption = huh.Option[*managementv1.Project]\ntype TemplateOption = huh.Option[*managementv1.DevPodWorkspaceTemplate]\ntype CancelFunc = func()\n\nvar latestTemplateVersion = huh.Option[string]{\n\tKey:   \"latest\",\n\tValue: \"\",\n}\n\nfunc projectOptions(ctx context.Context, client client.Client) ([]ProjectOption, error) {\n\tprojects, err := list.Projects(ctx, client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprojectOptions := []ProjectOption{}\n\tfor _, project := range projects.Items {\n\t\tp := &project\n\t\tprojectOptions = append(projectOptions, ProjectOption{\n\t\t\tKey:   platform.DisplayName(project.GetName(), project.Spec.DisplayName),\n\t\t\tValue: p,\n\t\t})\n\t}\n\n\treturn projectOptions, nil\n}\n\nfunc getClusterOptions(ctx context.Context, client client.Client, project *managementv1.Project, cancel CancelFunc, log log.Logger) []huh.Option[*managementv1.Cluster] {\n\topts := []huh.Option[*managementv1.Cluster]{}\n\tif project == nil {\n\t\treturn opts\n\t}\n\n\tclusters, err := list.Clusters(ctx, client, project.GetName())\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tcancel()\n\n\t\treturn nil\n\t}\n\tfor _, cluster := range clusters.Clusters {\n\t\tr := &cluster\n\t\topts = append(opts, huh.Option[*managementv1.Cluster]{\n\t\t\tKey:   platform.DisplayName(cluster.GetName(), cluster.Spec.DisplayName),\n\t\t\tValue: r,\n\t\t})\n\t}\n\n\treturn opts\n}\n\nfunc getTemplateOptions(ctx context.Context, client client.Client, project *managementv1.Project, cancel CancelFunc, log log.Logger) []huh.Option[*managementv1.DevPodWorkspaceTemplate] {\n\topts := []huh.Option[*managementv1.DevPodWorkspaceTemplate]{}\n\tif project == nil {\n\t\treturn opts\n\t}\n\n\ttemplates, err := list.Templates(ctx, client, project.GetName())\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tcancel()\n\n\t\treturn nil\n\t}\n\n\tvar defaultOpt huh.Option[*managementv1.DevPodWorkspaceTemplate]\n\tfor _, template := range templates.DevPodWorkspaceTemplates {\n\t\tt := &template\n\t\topt := huh.Option[*managementv1.DevPodWorkspaceTemplate]{\n\t\t\tKey:   platform.DisplayName(template.GetName(), template.Spec.DisplayName),\n\t\t\tValue: t,\n\t\t}\n\t\tif t.GetName() == templates.DefaultDevPodWorkspaceTemplate {\n\t\t\tdefaultOpt = opt\n\t\t\tcontinue\n\t\t}\n\t\topts = append(opts, opt)\n\t}\n\tif defaultOpt.Key != \"\" {\n\t\t// make sure the default template is the first\n\t\topts = slices.Insert(opts, 0, defaultOpt)\n\t}\n\n\treturn opts\n}\n\nfunc getTemplateVersionOptions(template *managementv1.DevPodWorkspaceTemplate) []huh.Option[string] {\n\topts := []huh.Option[string]{latestTemplateVersion}\n\tif template == nil {\n\t\treturn opts\n\t}\n\n\tfor _, version := range template.GetVersions() {\n\t\topts = append(opts, huh.Option[string]{\n\t\t\tKey:   version.GetVersion(),\n\t\t\tValue: version.GetVersion(),\n\t\t})\n\t}\n\n\treturn opts\n}\n\ntype FieldParameter struct {\n\tstoragev1.AppParameter\n\n\tStringValue string\n\tBoolValue   bool\n}\n\nfunc prepareParameters(parameters []storagev1.AppParameter) []*FieldParameter {\n\tretParams := []*FieldParameter{}\n\tfor _, p := range parameters {\n\t\tfieldParameter := FieldParameter{AppParameter: p}\n\t\tif p.Type == \"boolean\" {\n\t\t\tv, err := strconv.ParseBool(p.DefaultValue)\n\t\t\tif err == nil {\n\t\t\t\tfieldParameter.BoolValue = v\n\t\t\t}\n\t\t} else {\n\t\t\tfieldParameter.StringValue = p.DefaultValue\n\t\t}\n\n\t\tretParams = append(retParams, &fieldParameter)\n\t}\n\n\treturn retParams\n}\n\nfunc parameterFields(fieldParameters []*FieldParameter) []huh.Field {\n\tfields := []huh.Field{}\n\tfor _, param := range fieldParameters {\n\t\ttitle := param.Label\n\t\tif title == \"\" {\n\t\t\ttitle = param.Variable\n\t\t}\n\n\t\tvar field huh.Field\n\t\tswitch param.Type {\n\t\tcase \"multiline\":\n\t\t\tfield = huh.NewText().\n\t\t\t\tTitle(title).\n\t\t\t\tDescription(param.Description).\n\t\t\t\tValue(&param.StringValue)\n\t\tcase \"password\":\n\t\t\tfallthrough\n\t\tcase \"number\":\n\t\t\tfallthrough\n\t\tcase \"string\":\n\t\t\t// display a select field if param has options\n\t\t\tif len(param.Options) > 0 {\n\t\t\t\topts := []huh.Option[string]{}\n\t\t\t\tfor _, o := range param.Options {\n\t\t\t\t\thuhOption := huh.Option[string]{\n\t\t\t\t\t\tKey:   o,\n\t\t\t\t\t\tValue: o,\n\t\t\t\t\t}\n\t\t\t\t\tif o == param.DefaultValue {\n\t\t\t\t\t\thuhOption = huhOption.Selected(true)\n\t\t\t\t\t}\n\t\t\t\t\topts = append(opts, huhOption)\n\t\t\t\t}\n\t\t\t\tfield = huh.NewSelect[string]().\n\t\t\t\t\tTitle(title).\n\t\t\t\t\tOptions(opts...).\n\t\t\t\t\tValue(&param.StringValue)\n\t\t\t} else {\n\t\t\t\tinput := huh.NewInput().Title(title).\n\t\t\t\t\tDescription(param.Description).\n\t\t\t\t\tValue(&param.StringValue)\n\n\t\t\t\tif param.Type == \"password\" {\n\t\t\t\t\tinput.EchoMode(huh.EchoModePassword)\n\t\t\t\t}\n\t\t\t\tif param.Type == \"number\" {\n\t\t\t\t\tinput.Validate(func(s string) error {\n\t\t\t\t\t\t_, err := strconv.ParseFloat(s, 64)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tfield = input\n\t\t\t}\n\t\tcase \"boolean\":\n\t\t\tfield = huh.NewConfirm().\n\t\t\t\tTitle(title).\n\t\t\t\tDescription(param.Description).\n\t\t\t\tValue(&param.BoolValue)\n\t\t}\n\n\t\tfields = append(fields, field)\n\t}\n\n\treturn fields\n}\n\nfunc renderParameters(fieldParameters []*FieldParameter) (string, error) {\n\tp := map[string]interface{}{}\n\tfor _, fp := range fieldParameters {\n\t\tif fp.StringValue != \"\" {\n\t\t\tp[fp.Variable] = fp.StringValue\n\t\t} else if fp.BoolValue {\n\t\t\tp[fp.Variable] = strconv.FormatBool(fp.BoolValue)\n\t\t}\n\t}\n\n\trawParameters, err := yaml.Marshal(p)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(rawParameters), nil\n}\n\nfunc getDeepValue(parameters interface{}, path string) interface{} {\n\tif parameters == nil {\n\t\treturn nil\n\t}\n\n\tpathSegments := strings.Split(path, \".\")\n\tswitch t := parameters.(type) {\n\tcase map[string]interface{}:\n\t\tval, ok := t[pathSegments[0]]\n\t\tif !ok {\n\t\t\treturn nil\n\t\t} else if len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn getDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\tcase []interface{}:\n\t\tindex, err := strconv.Atoi(pathSegments[0])\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t} else if index < 0 || index >= len(t) {\n\t\t\treturn nil\n\t\t}\n\n\t\tval := t[index]\n\t\tif len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn getDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/platform/instance.go",
    "content": "package platform\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\t\"github.com/loft-sh/log\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\tctrlclient \"sigs.k8s.io/controller-runtime/pkg/client\"\n)\n\ntype WorkspaceInfo struct {\n\tID          string\n\tUID         string\n\tProjectName string\n}\n\nfunc GetWorkspaceInfoFromEnv() (*WorkspaceInfo, error) {\n\tworkspaceInfo := &WorkspaceInfo{}\n\t// get workspace id\n\tworkspaceID := os.Getenv(WorkspaceIDEnv)\n\tif workspaceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s is missing in environment\", WorkspaceIDEnv)\n\t}\n\tworkspaceInfo.ID = workspaceID\n\n\t// get workspace uid\n\tworkspaceUID := os.Getenv(WorkspaceUIDEnv)\n\tif workspaceUID == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s is missing in environment\", WorkspaceUIDEnv)\n\t}\n\tworkspaceInfo.UID = workspaceUID\n\n\t// get project\n\tprojectName := os.Getenv(ProjectEnv)\n\tif projectName == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s is missing in environment\", ProjectEnv)\n\t}\n\tworkspaceInfo.ProjectName = projectName\n\n\treturn workspaceInfo, nil\n}\n\nfunc FindInstance(ctx context.Context, baseClient client.Client, uid string) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create management client: %w\", err)\n\t}\n\n\tworkspaceList, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(\"\").List(ctx, metav1.ListOptions{\n\t\tLabelSelector: storagev1.DevPodWorkspaceUIDLabel + \"=\" + uid,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(workspaceList.Items) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn &workspaceList.Items[0], nil\n}\nfunc FindInstanceInProject(ctx context.Context, baseClient client.Client, uid, projectName string) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create management client: %w\", err)\n\t}\n\n\tworkspaceList, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(projectName)).List(ctx, metav1.ListOptions{\n\t\tLabelSelector: storagev1.DevPodWorkspaceUIDLabel + \"=\" + uid,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(workspaceList.Items) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn &workspaceList.Items[0], nil\n}\n\nfunc FindInstanceByName(ctx context.Context, baseClient client.Client, name, projectName string) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create management client: %w\", err)\n\t}\n\n\tworkspace, err := managementClient.Loft().ManagementV1().DevPodWorkspaceInstances(project.ProjectNamespace(projectName)).Get(ctx, name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn workspace, nil\n}\n\nfunc OptionsFromEnv(name string) url.Values {\n\toptions := os.Getenv(name)\n\tif options != \"\" {\n\t\treturn url.Values{\n\t\t\t\"options\": []string{options},\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc URLOptions(options any) url.Values {\n\traw, _ := json.Marshal(options)\n\tif options != \"\" {\n\t\treturn url.Values{\n\t\t\t\"options\": []string{string(raw)},\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc DialInstance(baseClient client.Client, workspace *managementv1.DevPodWorkspaceInstance, subResource string, values url.Values, log log.Logger) (*websocket.Conn, error) {\n\trestConfig, err := baseClient.ManagementConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thost := restConfig.Host\n\tparsedURL, _ := url.Parse(host)\n\tif parsedURL != nil && parsedURL.Host != \"\" {\n\t\thost = parsedURL.Host\n\t}\n\tlog.Debugf(\"Connect to workspace using host: %s\", host)\n\n\tloftURL := \"wss://\" + host + \"/kubernetes/management/apis/management.loft.sh/v1/namespaces/\" + workspace.Namespace + \"/devpodworkspaceinstances/\" + workspace.Name + \"/\" + subResource\n\tif len(values) > 0 {\n\t\tloftURL += \"?\" + values.Encode()\n\t}\n\n\tdialer := websocket.Dialer{\n\t\tTLSClientConfig:  &tls.Config{InsecureSkipVerify: true},\n\t\tProxy:            http.ProxyFromEnvironment,\n\t\tHandshakeTimeout: 45 * time.Second,\n\t}\n\n\tconn, response, err := dialer.Dial(loftURL, map[string][]string{\n\t\t\"Authorization\": {\"Bearer \" + restConfig.BearerToken},\n\t})\n\tif err != nil {\n\t\tif response != nil {\n\t\t\tout, _ := io.ReadAll(response.Body)\n\t\t\theaders, _ := json.Marshal(response.Header)\n\t\t\treturn nil, fmt.Errorf(\"%s: error dialing websocket %s (code %d): headers - %s, error - %w\", string(out), loftURL, response.StatusCode, string(headers), err)\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"error dialing websocket %s: %w\", loftURL, err)\n\t}\n\n\treturn conn, nil\n}\n\n// UpdateInstance diffs two versions of a DevPodWorkspaceInstance, applies changes via a patch to reduce conflicts.\n// Afterwards it waits until the instance is ready to be used.\nfunc UpdateInstance(ctx context.Context, client client.Client, oldInstance *managementv1.DevPodWorkspaceInstance, newInstance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// we don't want to patch status or metadata\n\tnewInstance = newInstance.DeepCopy()\n\tnewInstance.Status = oldInstance.Status\n\tnewInstance.ObjectMeta = oldInstance.ObjectMeta\n\tnewInstance.TypeMeta = oldInstance.TypeMeta\n\n\t// create a patch from the old instance\n\tpatch := ctrlclient.MergeFrom(oldInstance)\n\tdata, err := patch.Data(newInstance)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(data) == 0 || string(data) == \"{}\" {\n\t\treturn newInstance, nil\n\t}\n\n\tres, err := managementClient.Loft().ManagementV1().\n\t\tDevPodWorkspaceInstances(oldInstance.GetNamespace()).\n\t\tPatch(ctx, oldInstance.GetName(), patch.Type(), data, metav1.PatchOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"patch workspace instance: %w (patch: %s)\", err, string(data))\n\t}\n\n\treturn WaitForInstance(ctx, client, res, log)\n}\n\nfunc WaitForInstance(ctx context.Context, client client.Client, instance *managementv1.DevPodWorkspaceInstance, log log.Logger) (*managementv1.DevPodWorkspaceInstance, error) {\n\tmanagementClient, err := client.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar updatedInstance *managementv1.DevPodWorkspaceInstance\n\t// we need to wait until instance is scheduled\n\terr = wait.PollUntilContextTimeout(ctx, time.Second, 30*time.Second, true, func(ctx context.Context) (done bool, err error) {\n\t\tupdatedInstance, err = managementClient.Loft().ManagementV1().\n\t\t\tDevPodWorkspaceInstances(instance.GetNamespace()).\n\t\t\tGet(ctx, instance.GetName(), metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tname := updatedInstance.GetName()\n\t\tstatus := updatedInstance.Status\n\n\t\tif !isReady(updatedInstance) {\n\t\t\tlog.Debugf(\"Workspace %s is in phase %s, waiting until its ready\", name, status.Phase)\n\t\t\treturn false, nil\n\t\t}\n\n\t\tif !isTemplateSynced(updatedInstance) {\n\t\t\tlog.Debugf(\"Workspace template is not ready yet\")\n\t\t\tfor _, cond := range updatedInstance.Status.Conditions {\n\t\t\t\tif cond.Status != corev1.ConditionTrue {\n\t\t\t\t\tlog.Debugf(\"%s is %s (%s): %s\", cond.Type, cond.Status, cond.Reason, cond.Message)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\n\t\tlog.Debugf(\"Workspace %s is ready\", name)\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\t// let's build a proper error message here\n\t\tmsg := \"Timed out waiting for workspace to get ready \\n\\n \"\n\t\t// basic status\n\t\tmsg += fmt.Sprintf(\"ready: %t\\n\", isReady(updatedInstance))\n\t\tmsg += fmt.Sprintf(\"template synced: %t\\n\", isTemplateSynced(updatedInstance))\n\t\tmsg += \"\\n\"\n\n\t\t// CRD conditions\n\t\tmsg += \"Conditions:\\n\"\n\t\tfor _, cond := range updatedInstance.Status.Conditions {\n\t\t\tmsg += fmt.Sprintf(\"%s is %s (%s): %s\\n\", cond.Type, cond.Status, cond.Reason, cond.Message)\n\t\t}\n\t\tmsg += \"\\n\"\n\n\t\t// error message, usually context timeout\n\t\tmsg += fmt.Sprintf(\"Error: %s\", err.Error())\n\n\t\treturn nil, errors.New(msg)\n\t}\n\n\treturn updatedInstance, nil\n}\n\nfunc isReady(workspace *managementv1.DevPodWorkspaceInstance) bool {\n\t// Sleeping is considered ready in this context. The workspace will be woken up as soon as we connect to it\n\tif workspace.Status.Phase == storagev1.InstanceSleeping {\n\t\treturn true\n\t}\n\n\treturn workspace.Status.Phase == storagev1.InstanceReady\n}\n\nfunc isTemplateSynced(workspace *managementv1.DevPodWorkspaceInstance) bool {\n\t// We're still waiting for the sync to happen\n\t// The controller will remove this field once it's done syncing\n\tif workspace.Spec.TemplateRef != nil && workspace.Spec.TemplateRef.SyncOnce {\n\t\treturn false\n\t}\n\n\tfor _, condition := range workspace.Status.Conditions {\n\t\tif condition.Type == storagev1.InstanceTemplateResolved {\n\t\t\treturn condition.Status == corev1.ConditionTrue\n\t\t}\n\t}\n\n\treturn false\n}\n"
  },
  {
    "path": "pkg/platform/kube/kube.go",
    "content": "package kube\n\nimport (\n\t\"fmt\"\n\n\tloftclient \"github.com/loft-sh/api/v4/pkg/clientset/versioned\"\n\n\t\"k8s.io/client-go/kubernetes\"\n\t\"k8s.io/client-go/rest\"\n)\n\ntype Interface interface {\n\tkubernetes.Interface\n\tLoft() loftclient.Interface\n}\n\nfunc NewForConfig(c *rest.Config) (Interface, error) {\n\tkubeClient, err := kubernetes.NewForConfig(c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create kube client: %w\", err)\n\t}\n\n\tloftClient, err := loftclient.NewForConfig(c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create loft client: %w\", err)\n\t}\n\n\treturn &client{\n\t\tInterface:  kubeClient,\n\t\tloftClient: loftClient,\n\t}, nil\n}\n\ntype client struct {\n\tkubernetes.Interface\n\tloftClient loftclient.Interface\n}\n\nfunc (c *client) Loft() loftclient.Interface {\n\treturn c.loftClient\n}\n"
  },
  {
    "path": "pkg/platform/kubeconfig.go",
    "content": "package platform\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/platform/annotations\"\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\t\"github.com/loft-sh/devpod/pkg/platform/project\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n\tclientcmdapi \"k8s.io/client-go/tools/clientcmd/api\"\n)\n\nvar configTTL time.Duration = time.Hour * 24 * 90 // 90 days\n\n// NewInstanceKubeConfig creates a KubeConfig (clientcmdapi.Config) based for either a space instance or virtual cluster instance.\n// We return the config as byte slice to ensure correct handling and formatting through the `clientcmd` methods.\nfunc NewInstanceKubeConfig(ctx context.Context, platformOptions *devpod.PlatformOptions) ([]byte, error) {\n\tif platformOptions == nil {\n\t\treturn nil, nil\n\t}\n\tkube := platformOptions.Kubernetes\n\tif kube == nil {\n\t\treturn nil, nil\n\t}\n\taccessKey := platformOptions.UserAccessKey\n\tif accessKey == \"\" {\n\t\treturn nil, fmt.Errorf(\"user access key missing\")\n\t}\n\thost := platformOptions.PlatformHost\n\tif host == \"\" {\n\t\treturn nil, fmt.Errorf(\"platform host is missing\")\n\t}\n\tif kube.SpaceName == \"\" && kube.VirtualClusterName == \"\" {\n\t\t// nothing to do here\n\t\treturn nil, nil\n\t}\n\tif kube.SpaceName != \"\" && kube.VirtualClusterName != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot use virtual cluster and space instance together\")\n\t}\n\tif kube.Namespace == \"\" {\n\t\treturn nil, fmt.Errorf(\"namespace missing\")\n\t}\n\n\tbaseClient := client.NewClientFromConfig(&client.Config{\n\t\tAccessKey: accessKey,\n\t\tHost:      \"https://\" + host,\n\t\tInsecure:  true,\n\t})\n\terr := baseClient.RefreshSelf(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"refresh self: %w\", err)\n\t}\n\n\tvar kubeConfig *clientcmdapi.Config\n\tif kube.SpaceName != \"\" {\n\t\tkubeConfig, err = kubeConfigForSpaceInstance(ctx, baseClient, kube.SpaceName, kube.Namespace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if kube.VirtualClusterName != \"\" {\n\t\tkubeConfig, err = kubeConfigForVirtualClusterInstance(ctx, baseClient, kube.VirtualClusterName, kube.Namespace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn clientcmd.Write(*kubeConfig)\n}\n\nfunc kubeConfigForSpaceInstance(ctx context.Context, baseClient client.Client, spaceInstanceName string, namespace string) (*clientcmdapi.Config, error) {\n\tprojectName := project.ProjectFromNamespace(namespace)\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tspaceInstance, err := managementClient.Loft().ManagementV1().SpaceInstances(namespace).Get(ctx, spaceInstanceName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get space instance: %w\", err)\n\t}\n\n\t// find cluster by clusterRef\n\thostCluster, err := findHostCluster(ctx, baseClient, projectName, spaceInstance.Spec.ClusterRef)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find host cluster: %w\", err)\n\t}\n\n\tscope := &storagev1.AccessKeyScope{\n\t\tSpaces: []storagev1.AccessKeyScopeSpace{{\n\t\t\tProject: projectName,\n\t\t\tSpace:   spaceInstance.Name,\n\t\t}},\n\t}\n\tttl := int64(configTTL.Seconds())\n\n\t// direct cluster access?\n\tif hostCluster.GetAnnotations()[annotations.LoftDirectClusterEndpoint] != \"\" {\n\t\ttok := &managementv1.DirectClusterEndpointToken{\n\t\t\tSpec: managementv1.DirectClusterEndpointTokenSpec{\n\t\t\t\tScope: scope,\n\t\t\t\tTTL:   ttl,\n\t\t\t},\n\t\t}\n\t\tdirectClusterEndpointToken, err := managementClient.Loft().ManagementV1().DirectClusterEndpointTokens().Create(ctx, tok, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create direct cluster endpoint token: %w\", err)\n\t\t}\n\n\t\tdirectClusterEndpoint := hostCluster.GetAnnotations()[annotations.LoftDirectClusterEndpoint]\n\t\thost := fmt.Sprintf(\"https://%s/kubernetes/project/%s/space/%s\", directClusterEndpoint, projectName, spaceInstance.Name)\n\n\t\treturn newKubeConfig(host, directClusterEndpointToken.Status.Token, spaceInstance.Spec.ClusterRef.Namespace, true), nil\n\t}\n\n\t// access through management cluster + access key\n\tkey := &managementv1.OwnedAccessKey{\n\t\tSpec: managementv1.OwnedAccessKeySpec{\n\t\t\tAccessKeySpec: storagev1.AccessKeySpec{\n\t\t\t\tUser:        baseClient.Self().Status.User.Name,\n\t\t\t\tScope:       scope,\n\t\t\t\tTTL:         ttl,\n\t\t\t\tDisplayName: fmt.Sprintf(\"Kube Config for Space %s/%s\", spaceInstance.Namespace, spaceInstance.Name),\n\t\t\t},\n\t\t},\n\t}\n\townedAccessKey, err := managementClient.Loft().ManagementV1().OwnedAccessKeys().Create(ctx, key, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create access key: %w\", err)\n\t}\n\thostName := strings.TrimPrefix(strings.TrimPrefix(baseClient.Config().Host, \"https://\"), \"https://\")\n\thost := fmt.Sprintf(\"https://%s/kubernetes/project/%s/space/%s\", hostName, projectName, spaceInstance.Name)\n\n\treturn newKubeConfig(host, ownedAccessKey.Spec.Key, spaceInstance.Spec.ClusterRef.Namespace, true), nil\n}\n\nfunc kubeConfigForVirtualClusterInstance(ctx context.Context, baseClient client.Client, virtualClusterInstanceName string, namespace string) (*clientcmdapi.Config, error) {\n\tprojectName := project.ProjectFromNamespace(namespace)\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvirtualClusterInstance, err := managementClient.Loft().ManagementV1().VirtualClusterInstances(namespace).Get(ctx, virtualClusterInstanceName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get virtual cluster instance: %w\", err)\n\t}\n\n\tscope := &storagev1.AccessKeyScope{\n\t\tVirtualClusters: []storagev1.AccessKeyScopeVirtualCluster{{\n\t\t\tProject:        projectName,\n\t\t\tVirtualCluster: virtualClusterInstance.Name,\n\t\t}},\n\t}\n\tttl := int64(configTTL.Seconds())\n\n\t// direct virtual cluster ingress access?\n\tvirtualCluster := virtualClusterInstance.Status.VirtualCluster\n\tif virtualCluster != nil && virtualCluster.AccessPoint.Ingress.Enabled {\n\t\tcertTTL := int32(ttl)\n\t\tconfig := &managementv1.VirtualClusterInstanceKubeConfig{\n\t\t\tSpec: managementv1.VirtualClusterInstanceKubeConfigSpec{\n\t\t\t\tCertificateTTL: &certTTL,\n\t\t\t},\n\t\t}\n\t\tdirectVirtualClusterKubeConfig, err := managementClient.Loft().ManagementV1().VirtualClusterInstances(namespace).\n\t\t\tGetKubeConfig(ctx, virtualClusterInstance.Name, config, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create direct cluster endpoint token: %w\", err)\n\t\t}\n\n\t\tkubeConfig, err := clientcmd.Load([]byte(directVirtualClusterKubeConfig.Status.KubeConfig))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn kubeConfig, nil\n\t}\n\n\t// find cluster by clusterRef\n\thostCluster, err := findHostCluster(ctx, baseClient, projectName, virtualClusterInstance.Spec.ClusterRef.ClusterRef)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find host cluster: %w\", err)\n\t}\n\n\t// direct cluster access?\n\tif hostCluster.GetAnnotations()[annotations.LoftDirectClusterEndpoint] != \"\" {\n\t\ttok := &managementv1.DirectClusterEndpointToken{\n\t\t\tSpec: managementv1.DirectClusterEndpointTokenSpec{\n\t\t\t\tScope: scope,\n\t\t\t\tTTL:   ttl,\n\t\t\t},\n\t\t}\n\t\tdirectClusterEndpointToken, err := managementClient.Loft().ManagementV1().DirectClusterEndpointTokens().Create(ctx, tok, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create direct cluster endpoint token: %w\", err)\n\t\t}\n\n\t\tdirectClusterEndpoint := hostCluster.GetAnnotations()[annotations.LoftDirectClusterEndpoint]\n\t\thost := fmt.Sprintf(\"https://%s/kubernetes/project/%s/virtualcluster/%s\", directClusterEndpoint, projectName, virtualClusterInstance.Name)\n\n\t\treturn newKubeConfig(host, directClusterEndpointToken.Status.Token, virtualClusterInstance.Spec.ClusterRef.Namespace, true), nil\n\t}\n\n\t// access through management cluster + access key\n\tkey := &managementv1.OwnedAccessKey{\n\t\tSpec: managementv1.OwnedAccessKeySpec{\n\t\t\tAccessKeySpec: storagev1.AccessKeySpec{\n\t\t\t\tUser:        baseClient.Self().Status.User.Name,\n\t\t\t\tScope:       scope,\n\t\t\t\tTTL:         ttl,\n\t\t\t\tDisplayName: fmt.Sprintf(\"Kube Config for Virtual Cluster %s/%s\", virtualClusterInstance.Namespace, virtualClusterInstance.Name),\n\t\t\t},\n\t\t},\n\t}\n\townedAccessKey, err := managementClient.Loft().ManagementV1().OwnedAccessKeys().Create(ctx, key, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create access key: %w\", err)\n\t}\n\thostName := strings.TrimPrefix(strings.TrimPrefix(baseClient.Config().Host, \"https://\"), \"https://\")\n\thost := fmt.Sprintf(\"https://%s/kubernetes/project/%s/virtualcluster/%s\", hostName, projectName, virtualClusterInstance.Name)\n\n\treturn newKubeConfig(host, ownedAccessKey.Spec.Key, virtualClusterInstance.Spec.ClusterRef.Namespace, true), nil\n}\n\nfunc findHostCluster(ctx context.Context, baseClient client.Client, projectName string, clusterRef storagev1.ClusterRef) (managementv1.Cluster, error) {\n\tmanagementClient, err := baseClient.Management()\n\tif err != nil {\n\t\treturn managementv1.Cluster{}, err\n\t}\n\tprojectClusters, err := managementClient.Loft().ManagementV1().Projects().ListClusters(ctx, projectName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn managementv1.Cluster{}, fmt.Errorf(\"get project clusters: %w\", err)\n\t}\n\n\tfor _, cluster := range projectClusters.Clusters {\n\t\tif clusterRef.Cluster == cluster.GetName() {\n\t\t\treturn cluster, nil\n\t\t}\n\t}\n\n\treturn managementv1.Cluster{}, nil\n}\n\nfunc newKubeConfig(host, token, namespace string, insecure bool) *clientcmdapi.Config {\n\tcontextName := \"loft\"\n\tkubeConfig := clientcmdapi.NewConfig()\n\tkubeConfig.Contexts = map[string]*clientcmdapi.Context{\n\t\tcontextName: {\n\t\t\tCluster:   contextName,\n\t\t\tAuthInfo:  contextName,\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n\tkubeConfig.Clusters = map[string]*clientcmdapi.Cluster{\n\t\tcontextName: {\n\t\t\tServer:                host,\n\t\t\tInsecureSkipTLSVerify: insecure,\n\t\t},\n\t}\n\tkubeConfig.AuthInfos = map[string]*clientcmdapi.AuthInfo{\n\t\tcontextName: {\n\t\t\tToken: token,\n\t\t},\n\t}\n\tkubeConfig.CurrentContext = contextName\n\n\treturn kubeConfig\n}\n"
  },
  {
    "path": "pkg/platform/labels/labels.go",
    "content": "package labels\n\n// ProjectLabel holds the project name\nconst ProjectLabel = \"loft.sh/project\"\n"
  },
  {
    "path": "pkg/platform/option.go",
    "content": "package platform\n\nfunc DisplayName(name string, displayName string) string {\n\tif displayName != \"\" {\n\t\treturn displayName\n\t}\n\n\treturn name\n}\n"
  },
  {
    "path": "pkg/platform/owner.go",
    "content": "package platform\n\nimport (\n\t\"fmt\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/spf13/pflag\"\n)\n\nfunc IsOwner(self *managementv1.Self, userOrTeam *storagev1.UserOrTeam) bool {\n\tif self == nil || userOrTeam == nil {\n\t\treturn false\n\t}\n\n\tif self.Status.User != nil {\n\t\t// is user owner?\n\t\tif self.Status.User.Name == userOrTeam.User {\n\t\t\treturn true\n\t\t}\n\n\t\t// is user in owning team?\n\t\tfor _, team := range self.Status.User.Teams {\n\t\t\tif team.Name == userOrTeam.Team {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\t// is user owning team?\n\tif self.Status.Team != nil && self.Status.Team.Name == userOrTeam.Team {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\ntype OwnerFilter string\n\nconst (\n\tSelfOwnerFilter OwnerFilter = \"self\"\n\tAllOwnerFilter  OwnerFilter = \"all\"\n)\n\nvar _ pflag.Value = (*OwnerFilter)(nil)\n\nfunc (s *OwnerFilter) Set(v string) error {\n\tswitch v {\n\tcase \"\":\n\t\t{\n\t\t\t*s = SelfOwnerFilter\n\t\t\treturn nil\n\t\t}\n\tcase string(SelfOwnerFilter),\n\t\tstring(AllOwnerFilter):\n\t\t{\n\t\t\t*s = OwnerFilter(v)\n\t\t\treturn nil\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"OwnerFilter %s not supported\", v)\n\t}\n}\n\nfunc (s *OwnerFilter) Type() string {\n\treturn \"ownerFilter\"\n}\n\nfunc (s *OwnerFilter) String() string {\n\treturn string(*s)\n}\n"
  },
  {
    "path": "pkg/platform/parameters/parameters.go",
    "content": "package parameters\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n)\n\nfunc VerifyValue(value string, parameter storagev1.AppParameter) (interface{}, error) {\n\tswitch parameter.Type {\n\tcase \"\":\n\t\tfallthrough\n\tcase \"password\":\n\t\tfallthrough\n\tcase \"string\":\n\t\tfallthrough\n\tcase \"multiline\":\n\t\tif parameter.DefaultValue != \"\" && value == \"\" {\n\t\t\tvalue = parameter.DefaultValue\n\t\t}\n\n\t\tif parameter.Required && value == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) is required\", parameter.Label, parameter.Variable)\n\t\t}\n\t\tfor _, option := range parameter.Options {\n\t\t\tif option == value {\n\t\t\t\treturn value, nil\n\t\t\t}\n\t\t}\n\t\tif parameter.Validation != \"\" {\n\t\t\tregEx, err := regexp.Compile(parameter.Validation)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"compile validation regex \"+parameter.Validation)\n\t\t\t}\n\n\t\t\tif !regEx.MatchString(value) {\n\t\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) needs to match regex %s\", parameter.Label, parameter.Variable, parameter.Validation)\n\t\t\t}\n\t\t}\n\t\tif parameter.Invalidation != \"\" {\n\t\t\tregEx, err := regexp.Compile(parameter.Invalidation)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"compile invalidation regex \"+parameter.Invalidation)\n\t\t\t}\n\n\t\t\tif regEx.MatchString(value) {\n\t\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) cannot match regex %s\", parameter.Label, parameter.Variable, parameter.Invalidation)\n\t\t\t}\n\t\t}\n\n\t\treturn value, nil\n\tcase \"boolean\":\n\t\tif parameter.DefaultValue != \"\" && value == \"\" {\n\t\t\tboolValue, err := strconv.ParseBool(parameter.DefaultValue)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"parse default value for parameter %s (%s)\", parameter.Label, parameter.Variable)\n\t\t\t}\n\n\t\t\treturn boolValue, nil\n\t\t}\n\t\tif parameter.Required && value == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) is required\", parameter.Label, parameter.Variable)\n\t\t}\n\n\t\tboolValue, err := strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"parse value for parameter %s (%s)\", parameter.Label, parameter.Variable)\n\t\t}\n\t\treturn boolValue, nil\n\tcase \"number\":\n\t\tif parameter.DefaultValue != \"\" && value == \"\" {\n\t\t\tintValue, err := strconv.Atoi(parameter.DefaultValue)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"parse default value for parameter %s (%s)\", parameter.Label, parameter.Variable)\n\t\t\t}\n\n\t\t\treturn intValue, nil\n\t\t}\n\t\tif parameter.Required && value == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) is required\", parameter.Label, parameter.Variable)\n\t\t}\n\t\tnum, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"parse value for parameter %s (%s)\", parameter.Label, parameter.Variable)\n\t\t}\n\t\tif parameter.Min != nil && num < *parameter.Min {\n\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) cannot be smaller than %d\", parameter.Label, parameter.Variable, *parameter.Min)\n\t\t}\n\t\tif parameter.Max != nil && num > *parameter.Max {\n\t\t\treturn nil, fmt.Errorf(\"parameter %s (%s) cannot be greater than %d\", parameter.Label, parameter.Variable, *parameter.Max)\n\t\t}\n\n\t\treturn num, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unrecognized type %s for parameter %s (%s)\", parameter.Type, parameter.Label, parameter.Variable)\n}\n\nfunc GetDeepValue(parameters interface{}, path string) interface{} {\n\tif parameters == nil {\n\t\treturn nil\n\t}\n\n\tpathSegments := strings.Split(path, \".\")\n\tswitch t := parameters.(type) {\n\tcase map[string]interface{}:\n\t\tval, ok := t[pathSegments[0]]\n\t\tif !ok {\n\t\t\treturn nil\n\t\t} else if len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn GetDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\tcase []interface{}:\n\t\tindex, err := strconv.Atoi(pathSegments[0])\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t} else if index < 0 || index >= len(t) {\n\t\t\treturn nil\n\t\t}\n\n\t\tval := t[index]\n\t\tif len(pathSegments) == 1 {\n\t\t\treturn val\n\t\t}\n\n\t\treturn GetDeepValue(val, strings.Join(pathSegments[1:], \".\"))\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/platform/platform.go",
    "content": "package platform\n"
  },
  {
    "path": "pkg/platform/project/project.go",
    "content": "package project\n\nimport (\n\t\"strings\"\n\t\"sync\"\n)\n\nvar DefaultProjectNamespacePrefix = \"loft-p-\"\n\n// having a nil value means the prefix is unset and things should panic and not fail silently\nvar prefix *string\nvar prefixMux sync.RWMutex\n\n// SetProjectNamespacePrefix sets the global project namespace prefix\n// Defaulting should be handled when reading the config via ParseProjectNamespacePrefix\nfunc SetProjectNamespacePrefix(newPrefix string) {\n\tprefixMux.Lock()\n\tdefer prefixMux.Unlock()\n\n\tprefix = &newPrefix\n}\n\nfunc GetProjectNamespacePrefix() string {\n\tprefixMux.Lock()\n\tdefer prefixMux.Unlock()\n\n\tif prefix == nil {\n\t\tpanic(\"Seems like you forgot to init the project namespace prefix. This is a requirement as otherwise resolving a project namespace is not possible.\")\n\t}\n\n\treturn *prefix\n}\n\n// ParseConfiguredProjectNSPrefix handles the defaulting for a configured prefix and returns the prefix to be used\nfunc ParseConfiguredProjectNSPrefix(configuredPrefix *string) string {\n\tif configuredPrefix == nil {\n\t\treturn DefaultProjectNamespacePrefix\n\t}\n\n\treturn *configuredPrefix\n}\n\n// ProjectFromNamespace returns the project associated with the namespace\nfunc ProjectFromNamespace(namespace string) string {\n\tprefixMux.RLock()\n\tdefer prefixMux.RUnlock()\n\n\tif prefix == nil {\n\t\tpanic(\"Seems like you forgot to init the project namespace prefix. This is a requirement as otherwise resolving a project namespace is not possible.\")\n\t}\n\n\treturn strings.TrimPrefix(namespace, *prefix)\n}\n\n// ProjectNamespace returns the namespace associated with the project\nfunc ProjectNamespace(projectName string) string {\n\tprefixMux.RLock()\n\tdefer prefixMux.RUnlock()\n\n\tif prefix == nil {\n\t\tpanic(\"Seems like you forgot to init the project namespace prefix. This is a requirement as otherwise resolving a project namespace is not possible.\")\n\t}\n\n\treturn *prefix + projectName\n}\n"
  },
  {
    "path": "pkg/platform/remotecommand/client.go",
    "content": "package remotecommand\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc ExecuteConn(ctx context.Context, rawConn *websocket.Conn, stdin io.Reader, stdout io.Writer, stderr io.Writer, log log.Logger) (int, error) {\n\tconn := NewWebsocketConn(rawConn)\n\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// close websocket connection\n\tdefer conn.Close()\n\tdefer func() {\n\t\terr := conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, \"\"))\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error write close: %v\", err)\n\t\t\treturn\n\t\t}\n\t}()\n\n\t// ping connection\n\tgo func() {\n\t\tPing(ctx, conn)\n\t}()\n\n\t// pipe stdout into websocket\n\tgo func() {\n\t\terr := NewStream(conn, StdinData, StdinClose).Read(stdin)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error pipe stdin: %v\", err)\n\t\t}\n\t}()\n\n\t// read messages\n\tfor {\n\t\t_, raw, err := conn.ReadMessage()\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error read message: %v\", err)\n\t\t\treturn 0, err\n\t\t}\n\n\t\tmessage, err := ParseMessage(bytes.NewReader(raw))\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error parse message: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif message.messageType == StdoutData {\n\t\t\tif _, err := io.Copy(stdout, message.data); err != nil {\n\t\t\t\tlog.Debugf(\"error read stdout: %v\", err)\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t} else if message.messageType == StderrData {\n\t\t\tif _, err := io.Copy(stderr, message.data); err != nil {\n\t\t\t\tlog.Debugf(\"error read stderr: %v\", err)\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t} else if message.messageType == ExitCode {\n\t\t\tlog.Debugf(\"exit code: %d\", message.exitCode)\n\t\t\treturn int(message.exitCode), nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/platform/remotecommand/protocol.go",
    "content": "package remotecommand\n\nimport (\n\t\"bufio\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n)\n\ntype MessageType byte\n\nconst (\n\tStdoutData  MessageType = 0\n\tStdoutClose MessageType = 1\n\tStderrData  MessageType = 2\n\tStderrClose MessageType = 3\n\tStdinData   MessageType = 4\n\tStdinClose  MessageType = 5\n\tExitCode    MessageType = 6\n)\n\ntype Message struct {\n\tmessageType MessageType\n\texitCode    int64\n\tdata        io.Reader\n\n\tbytes []byte\n}\n\nfunc newDataMessage(messageType MessageType, data []byte) *Message {\n\treturn &Message{\n\t\tmessageType: messageType,\n\t\tbytes:       data,\n\t}\n}\n\nfunc newCloseMessage(messageType MessageType) *Message {\n\treturn &Message{\n\t\tmessageType: messageType,\n\t}\n}\n\nfunc NewExitCodeMessage(exitCode int) *Message {\n\treturn &Message{\n\t\tmessageType: ExitCode,\n\t\tbytes:       binary.AppendVarint([]byte{}, int64(exitCode)),\n\t}\n}\n\nfunc ParseMessage(reader io.Reader) (*Message, error) {\n\tbuf := bufio.NewReader(reader)\n\tmessageTypeInt, err := buf.ReadByte()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch MessageType(messageTypeInt) {\n\tcase StdoutClose, StderrClose, StdinClose:\n\t\treturn &Message{\n\t\t\tmessageType: MessageType(messageTypeInt),\n\t\t}, nil\n\tcase StdoutData, StderrData, StdinData:\n\t\treturn &Message{\n\t\t\tmessageType: MessageType(messageTypeInt),\n\t\t\tdata:        buf,\n\t\t}, nil\n\tcase ExitCode:\n\t\texitCode, err := binary.ReadVarint(buf)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read exit code: %w\", err)\n\t\t}\n\n\t\treturn &Message{\n\t\t\tmessageType: ExitCode,\n\t\t\texitCode:    exitCode,\n\t\t}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized message type %b\", messageTypeInt)\n\t}\n}\n\nfunc (m *Message) Bytes() []byte {\n\treturn append([]byte{byte(m.messageType)}, m.bytes...)\n}\n"
  },
  {
    "path": "pkg/platform/remotecommand/remotecommand.go",
    "content": "package remotecommand\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"k8s.io/klog/v2\"\n)\n\nconst (\n\t// Maximum message size allowed from peer.\n\tMaxMessageSize = 2 << 14\n)\n\nfunc Ping(ctx context.Context, ws *WebsocketConn) {\n\tdefer ws.Close()\n\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(time.Second * 10):\n\t\t\tif err := ws.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(10*time.Second)); err != nil {\n\t\t\t\tklog.FromContext(ctx).Error(err, \"Error sending ping message\")\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/platform/remotecommand/stream.go",
    "content": "package remotecommand\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"k8s.io/klog/v2\"\n)\n\nfunc NewStream(ws *WebsocketConn, dataType, closeType MessageType) *Stream {\n\treturn &Stream{\n\t\tws:        ws,\n\t\tdataType:  dataType,\n\t\tcloseType: closeType,\n\t}\n}\n\ntype Stream struct {\n\tws *WebsocketConn\n\n\tdataType  MessageType\n\tcloseType MessageType\n}\n\nfunc (s *Stream) Write(ctx context.Context, writer io.WriteCloser) error {\n\tif writer == nil {\n\t\treturn nil\n\t}\n\n\tfor {\n\t\t_, raw, err := s.ws.ReadMessage()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tmessage, err := ParseMessage(bytes.NewReader(raw))\n\t\tif err != nil {\n\t\t\tklog.FromContext(ctx).Error(err, \"Unexpected message\")\n\t\t\tcontinue\n\t\t}\n\n\t\tif message.messageType == s.dataType {\n\t\t\tif _, err := io.Copy(writer, message.data); err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else if message.messageType == s.closeType {\n\t\t\treturn writer.Close()\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *Stream) Read(reader io.Reader) error {\n\tif reader == nil {\n\t\treturn s.ws.WriteMessage(websocket.BinaryMessage, newCloseMessage(s.closeType).Bytes())\n\t}\n\n\tbuf := make([]byte, MaxMessageSize-1)\n\tfor {\n\t\tn, err := reader.Read(buf)\n\t\tif n > 0 {\n\t\t\terr = s.ws.WriteMessage(websocket.BinaryMessage, newDataMessage(s.dataType, buf[:n]).Bytes())\n\t\t\tif err != nil {\n\t\t\t\t//nolint:all\n\t\t\t\tif err == websocket.ErrCloseSent {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t//nolint:all\n\t\tif err == io.EOF {\n\t\t\t_ = s.ws.WriteMessage(websocket.BinaryMessage, newCloseMessage(s.closeType).Bytes())\n\t\t\treturn nil\n\t\t} else if err != nil {\n\t\t\treturn fmt.Errorf(\"read reader: %w\", err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/platform/remotecommand/websocket.go",
    "content": "package remotecommand\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n)\n\nconst (\n\t// Time allowed to write a message to the peer.\n\twriteWait = 10 * time.Second\n\n\tPingWaitDuration = 60 * time.Second\n)\n\nfunc NewWebsocketConn(ws *websocket.Conn) *WebsocketConn {\n\tconn := &WebsocketConn{\n\t\tws: ws,\n\t}\n\tconn.setupDeadline()\n\treturn conn\n}\n\ntype WebsocketConn struct {\n\tm sync.Mutex\n\n\tws *websocket.Conn\n\n\tcloseOnce  sync.Once\n\tcloseError error\n}\n\nfunc (w *WebsocketConn) setupDeadline() {\n\t_ = w.ws.SetReadDeadline(time.Now().Add(PingWaitDuration))\n\tw.ws.SetPingHandler(func(string) error {\n\t\tw.m.Lock()\n\t\terr := w.ws.WriteControl(websocket.PongMessage, []byte(\"\"), time.Now().Add(PingWaitDuration))\n\t\tw.m.Unlock()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := w.ws.SetReadDeadline(time.Now().Add(PingWaitDuration)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn w.ws.SetWriteDeadline(time.Now().Add(PingWaitDuration))\n\t})\n\tw.ws.SetPongHandler(func(string) error {\n\t\tif err := w.ws.SetReadDeadline(time.Now().Add(PingWaitDuration)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn w.ws.SetWriteDeadline(time.Now().Add(PingWaitDuration))\n\t})\n}\n\nfunc (w *WebsocketConn) ReadMessage() (messageType int, p []byte, err error) {\n\treturn w.ws.ReadMessage()\n}\n\nfunc (w *WebsocketConn) WriteControl(messageType int, data []byte, deadline time.Time) error {\n\tw.m.Lock()\n\tdefer w.m.Unlock()\n\n\t_ = w.ws.SetWriteDeadline(time.Now().Add(writeWait))\n\treturn w.ws.WriteControl(messageType, data, deadline)\n}\n\nfunc (w *WebsocketConn) WriteMessage(messageType int, data []byte) error {\n\tw.m.Lock()\n\tdefer w.m.Unlock()\n\n\t_ = w.ws.SetWriteDeadline(time.Now().Add(writeWait))\n\treturn w.ws.WriteMessage(messageType, data)\n}\n\nfunc (w *WebsocketConn) Close() error {\n\tw.closeOnce.Do(func() {\n\t\tw.closeError = w.ws.Close()\n\t})\n\n\treturn w.closeError\n}\n"
  },
  {
    "path": "pkg/platform/user.go",
    "content": "package platform\n\nimport (\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n)\n\nfunc GetUserName(self *managementv1.Self) string {\n\tif self.Status.User != nil {\n\t\treturn self.Status.User.Name\n\t}\n\n\tif self.Status.Team != nil {\n\t\treturn self.Status.Team.Name\n\t}\n\n\treturn self.Status.Subject\n}\n"
  },
  {
    "path": "pkg/platform/version.go",
    "content": "package platform\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/http\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n)\n\ntype VersionObject struct {\n\t// Version is the server version\n\tVersion string `json:\"version,omitempty\"`\n\n\t// Version is the remote devpod version\n\tDevPodVersion string `json:\"devPodVersion,omitempty\"`\n}\n\nfunc GetProInstanceDevPodVersion(proInstance *provider.ProInstance) (string, error) {\n\turl := \"https://\" + proInstance.Host\n\treturn GetDevPodVersion(url)\n}\n\nfunc GetPlatformVersion(url string) (*VersionObject, error) {\n\tresp, err := http.GetHTTPClient().Get(url + \"/version\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get %s: %w\", url, err)\n\t} else if resp.StatusCode != 200 {\n\t\tout, _ := io.ReadAll(resp.Body)\n\t\treturn nil, fmt.Errorf(\"get %s: %s (Status: %d)\", url, string(out), resp.StatusCode)\n\t}\n\n\tversionRaw, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read %s: %w\", url, err)\n\t}\n\n\tversion := &VersionObject{}\n\terr = json.Unmarshal(versionRaw, version)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse %s: %w\", url, err)\n\t}\n\n\treturn version, nil\n}\n\nfunc GetDevPodVersion(url string) (string, error) {\n\tversion, err := GetPlatformVersion(url)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif version.DevPodVersion == \"\" {\n\t\treturn \"\", fmt.Errorf(\"unexpected version '%s', please use --version to define a provider version\", version.DevPodVersion)\n\t}\n\n\t// make sure it starts with a v\n\tif !strings.HasPrefix(version.DevPodVersion, \"v\") {\n\t\tversion.DevPodVersion = \"v\" + version.DevPodVersion\n\t}\n\n\treturn version.DevPodVersion, nil\n}\n"
  },
  {
    "path": "pkg/port/parse.go",
    "content": "package port\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Address struct {\n\tProtocol string\n\tAddress  string\n}\n\ntype Mapping struct {\n\tHost      Address\n\tContainer Address\n}\n\nfunc ParsePortSpec(port string) (Mapping, error) {\n\thostIP, hostPort, containerIP, containerPort, err := splitParts(port)\n\tif err != nil {\n\t\treturn Mapping{}, err\n\t}\n\n\thostAddress, err := toAddress(hostIP, hostPort)\n\tif err != nil {\n\t\treturn Mapping{}, fmt.Errorf(\"parse host address: %w\", err)\n\t}\n\n\tcontainerAddress, err := toAddress(containerIP, containerPort)\n\tif err != nil {\n\t\treturn Mapping{}, fmt.Errorf(\"parse container address: %w\", err)\n\t}\n\n\treturn Mapping{\n\t\tHost:      hostAddress,\n\t\tContainer: containerAddress,\n\t}, nil\n}\n\nfunc toAddress(ip, port string) (Address, error) {\n\t// check if port is integer\n\t_, err := strconv.Atoi(port)\n\tif err == nil {\n\t\tif ip == \"\" {\n\t\t\tip = \"localhost\"\n\t\t}\n\n\t\tif ip != \"localhost\" && net.ParseIP(ip) == nil {\n\t\t\treturn Address{}, fmt.Errorf(\"not an ip address %s\", ip)\n\t\t}\n\n\t\treturn Address{\n\t\t\tProtocol: \"tcp\",\n\t\t\tAddress:  ip + \":\" + port,\n\t\t}, nil\n\t}\n\n\tif ip != \"\" {\n\t\treturn Address{}, fmt.Errorf(\"unexpected ip address for unix socket: %s\", ip)\n\t}\n\n\treturn Address{\n\t\tProtocol: \"unix\",\n\t\tAddress:  port,\n\t}, nil\n}\n\nfunc splitParts(rawport string) (string, string, string, string, error) {\n\tparts := strings.Split(rawport, \":\")\n\tn := len(parts)\n\tcontainerport := parts[n-1]\n\n\tswitch n {\n\tcase 1:\n\t\treturn \"\", containerport, \"\", containerport, nil\n\tcase 2:\n\t\treturn \"\", parts[0], \"\", containerport, nil\n\tcase 3:\n\t\tif parts[1] == \"localhost\" || net.ParseIP(parts[1]) != nil {\n\t\t\treturn \"\", parts[0], parts[1], containerport, nil\n\t\t}\n\n\t\treturn parts[0], parts[1], \"\", containerport, nil\n\tcase 4:\n\t\treturn parts[0], parts[1], parts[2], parts[3], nil\n\tdefault:\n\t\treturn \"\", \"\", \"\", \"\", fmt.Errorf(\"unexpected port format: %s\", rawport)\n\t}\n}\n"
  },
  {
    "path": "pkg/port/port.go",
    "content": "package port\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"time\"\n)\n\nfunc FindAvailablePort(start int) (int, error) {\n\tfor i := start; i < start+1000; i++ {\n\t\tavailable, err := IsAvailable(\"localhost:\" + strconv.Itoa(i))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t} else if !available {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn i, nil\n\t}\n\n\treturn 0, fmt.Errorf(\"couldn't find an available port\")\n}\n\nfunc IsAvailable(addr string) (bool, error) {\n\ttimeout := time.Millisecond * 500\n\tconn, err := net.DialTimeout(\"tcp\", addr, timeout)\n\tif err != nil {\n\t\t// Try to create a server with the port\n\t\tserver, err := net.Listen(\"tcp\", addr)\n\n\t\t// if it fails then the port is likely taken\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// close the server\n\t\t_ = server.Close()\n\t\treturn true, nil\n\t}\n\t_ = conn.Close()\n\treturn false, nil\n}\n"
  },
  {
    "path": "pkg/provider/dir.go",
    "content": "package provider\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/id\"\n)\n\nconst (\n\tWorkspaceConfigFile   = \"workspace.json\"\n\tWorkspaceResultFile   = \"workspace_result.json\"\n\tMachineConfigFile     = \"machine.json\"\n\tProInstanceConfigFile = \"pro.json\"\n\tProviderConfigFile    = \"provider.json\"\n\n\tDaemonStateFile = \"devpod_ts.state\"\n)\n\nfunc GetProInstancesDir(context string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"pro\"), nil\n}\n\nfunc GetMachinesDir(context string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"machines\"), nil\n}\n\nfunc GetLocksDir(context string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"locks\"), nil\n}\n\nfunc GetWorkspacesDir(context string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"workspaces\"), nil\n}\n\nfunc GetProvidersDir(context string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"providers\"), nil\n}\n\nfunc GetProviderDir(context, providerName string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"providers\", providerName), nil\n}\n\nfunc GetDaemonDir(context, providerName string) (string, error) {\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"providers\", providerName, \"daemon\"), nil\n}\n\nfunc GetProviderBinariesDir(context, providerName string) (string, error) {\n\tproviderDir, err := GetProviderDir(context, providerName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(providerDir, \"binaries\"), nil\n}\n\nfunc GetMachineDir(context, machineID string) (string, error) {\n\tif machineID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"machine id is empty\")\n\t}\n\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"machines\", machineID), nil\n}\n\nfunc GetWorkspaceDir(context, workspaceID string) (string, error) {\n\tif workspaceID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"workspace id is empty\")\n\t}\n\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"workspaces\", workspaceID), nil\n}\n\nfunc GetProInstanceDir(context, proInstanceHost string) (string, error) {\n\tif proInstanceHost == \"\" {\n\t\treturn \"\", fmt.Errorf(\"pro instance host is empty\")\n\t}\n\n\tconfigDir, err := config.GetConfigDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(configDir, \"contexts\", context, \"pro\", ToProInstanceID(proInstanceHost)), nil\n}\n\nvar proInstanceIDRegEx1 = regexp.MustCompile(`[^\\w\\-]`)\nvar proInstanceIDRegEx2 = regexp.MustCompile(`[^0-9a-z\\-]+`)\n\nfunc ToProInstanceID(url string) string {\n\turl = strings.TrimPrefix(url, \"https://\")\n\turl = strings.ToLower(url)\n\turl = proInstanceIDRegEx2.ReplaceAllString(proInstanceIDRegEx1.ReplaceAllString(url, \"-\"), \"\")\n\turl = strings.Trim(url, \"-\")\n\treturn id.SafeConcatNameMax([]string{url}, 32)\n}\n\nfunc WorkspaceExists(context, workspaceID string) bool {\n\tworkspaceDir, err := GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t_, err = os.Stat(workspaceDir)\n\treturn err == nil\n}\n\nfunc ProInstanceExists(context, proInstanceID string) bool {\n\tproDir, err := GetProInstanceDir(context, proInstanceID)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t_, err = os.Stat(proDir)\n\treturn err == nil\n}\n\nfunc SaveProviderConfig(context string, provider *ProviderConfig) error {\n\tproviderDir, err := GetProviderDir(context, provider.Name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(providerDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderDirBytes, err := json.Marshal(provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproviderConfigFile := filepath.Join(providerDir, ProviderConfigFile)\n\terr = os.WriteFile(providerConfigFile, providerDirBytes, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc SaveProInstanceConfig(context string, proInstance *ProInstance) error {\n\tproviderDir, err := GetProInstanceDir(context, proInstance.Host)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(providerDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproInstanceBytes, err := json.Marshal(proInstance)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproInstanceConfigFile := filepath.Join(providerDir, ProInstanceConfigFile)\n\terr = os.WriteFile(proInstanceConfigFile, proInstanceBytes, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc SaveWorkspaceResult(workspace *Workspace, result *config2.Result) error {\n\tworkspaceDir, err := GetWorkspaceDir(workspace.Context, workspace.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(workspaceDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresultBytes, err := json.Marshal(result)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceResultFile := filepath.Join(workspaceDir, WorkspaceResultFile)\n\terr = os.WriteFile(workspaceResultFile, resultBytes, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc SaveWorkspaceConfig(workspace *Workspace) error {\n\tworkspaceDir, err := GetWorkspaceDir(workspace.Context, workspace.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(workspaceDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceConfigBytes, err := json.Marshal(workspace)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceConfigFile := filepath.Join(workspaceDir, WorkspaceConfigFile)\n\terr = os.WriteFile(workspaceConfigFile, workspaceConfigBytes, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc SaveMachineConfig(machine *Machine) error {\n\tmachineDir, err := GetMachineDir(machine.Context, machine.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(machineDir, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineConfigBytes, err := json.Marshal(machine)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmachineConfigFile := filepath.Join(machineDir, MachineConfigFile)\n\terr = os.WriteFile(machineConfigFile, machineConfigBytes, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc MachineExists(context, machineID string) bool {\n\tmachineDir, err := GetMachineDir(context, machineID)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t_, err = os.Stat(machineDir)\n\treturn err == nil\n}\n\nfunc ProviderExists(context, provider string) bool {\n\tproviderDir, err := GetProviderDir(context, provider)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t_, err = os.Stat(providerDir)\n\treturn err == nil\n}\n\nfunc LoadProviderConfig(context, provider string) (*ProviderConfig, error) {\n\tproviderDir, err := GetProviderDir(context, provider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproviderFile := filepath.Join(providerDir, ProviderConfigFile)\n\tproviderConfigBytes, err := os.ReadFile(providerFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproviderConfig, err := ParseProvider(bytes.NewReader(providerConfigBytes))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn providerConfig, nil\n}\n\nfunc LoadMachineConfig(context, machineID string) (*Machine, error) {\n\tmachineDir, err := GetMachineDir(context, machineID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmachineConfigFile := filepath.Join(machineDir, MachineConfigFile)\n\tmachineConfigBytes, err := os.ReadFile(machineConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmachineConfig := &Machine{}\n\terr = json.Unmarshal(machineConfigBytes, machineConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmachineConfig.Context = context\n\tmachineConfig.Origin = machineConfigFile\n\treturn machineConfig, nil\n}\n\nfunc LoadProInstanceConfig(context, proInstanceHost string) (*ProInstance, error) {\n\tproDir, err := GetProInstanceDir(context, proInstanceHost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproConfigFile := filepath.Join(proDir, ProInstanceConfigFile)\n\tproConfigBytes, err := os.ReadFile(proConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproInstanceConfig := &ProInstance{}\n\terr = json.Unmarshal(proConfigBytes, proInstanceConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn proInstanceConfig, nil\n}\n\nfunc LoadWorkspaceConfig(context, workspaceID string) (*Workspace, error) {\n\tworkspaceDir, err := GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceConfigFile := filepath.Join(workspaceDir, WorkspaceConfigFile)\n\tworkspaceConfigBytes, err := os.ReadFile(workspaceConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceConfig := &Workspace{}\n\terr = json.Unmarshal(workspaceConfigBytes, workspaceConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceConfig.Context = context\n\tworkspaceConfig.Origin = workspaceConfigFile\n\treturn workspaceConfig, nil\n}\n\nfunc LoadWorkspaceResult(context, workspaceID string) (*config2.Result, error) {\n\tworkspaceDir, err := GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceResultFile := filepath.Join(workspaceDir, WorkspaceResultFile)\n\tworkspaceResultBytes, err := os.ReadFile(workspaceResultFile)\n\tif os.IsNotExist(err) {\n\t\treturn nil, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceResult := &config2.Result{}\n\terr = json.Unmarshal(workspaceResultBytes, workspaceResult)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn workspaceResult, nil\n}\n"
  },
  {
    "path": "pkg/provider/env.go",
    "content": "package provider\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tlog2 \"github.com/loft-sh/log\"\n)\n\nconst (\n\t// general\n\tDEVPOD           = \"DEVPOD\"\n\tDEVPOD_OS        = \"DEVPOD_OS\"\n\tDEVPOD_ARCH      = \"DEVPOD_ARCH\"\n\tDEVPOD_LOG_LEVEL = \"DEVPOD_LOG_LEVEL\"\n\n\t// workspace\n\tWORKSPACE_ID       = \"WORKSPACE_ID\"\n\tWORKSPACE_UID      = \"WORKSPACE_UID\"\n\tWORKSPACE_PICTURE  = \"WORKSPACE_PICTURE\"\n\tWORKSPACE_FOLDER   = \"WORKSPACE_FOLDER\"\n\tWORKSPACE_CONTEXT  = \"WORKSPACE_CONTEXT\"\n\tWORKSPACE_ORIGIN   = \"WORKSPACE_ORIGIN\"\n\tWORKSPACE_SOURCE   = \"WORKSPACE_SOURCE\"\n\tWORKSPACE_PROVIDER = \"WORKSPACE_PROVIDER\"\n\n\t// machine\n\tMACHINE_ID       = \"MACHINE_ID\"\n\tMACHINE_CONTEXT  = \"MACHINE_CONTEXT\"\n\tMACHINE_FOLDER   = \"MACHINE_FOLDER\"\n\tMACHINE_PROVIDER = \"MACHINE_PROVIDER\"\n\n\t// provider\n\tPROVIDER_ID      = \"PROVIDER_ID\"\n\tPROVIDER_CONTEXT = \"PROVIDER_CONTEXT\"\n\tPROVIDER_FOLDER  = \"PROVIDER_FOLDER\"\n\n\t// pro\n\tLOFT_PROJECT         = \"LOFT_PROJECT\"\n\tLOFT_FILTER_BY_OWNER = \"LOFT_FILTER_BY_OWNER\"\n)\n\nconst (\n\tDEVCONTAINER_ID = \"DEVCONTAINER_ID\"\n)\n\nfunc combineOptions(resolvedOptions map[string]config.OptionValue, otherOptions map[string]config.OptionValue) map[string]config.OptionValue {\n\toptions := map[string]config.OptionValue{}\n\tfor k, v := range resolvedOptions {\n\t\toptions[k] = v\n\t}\n\tfor k, v := range otherOptions {\n\t\toptions[k] = v\n\t}\n\treturn options\n}\n\nfunc ToEnvironment(workspace *Workspace, machine *Machine, options map[string]config.OptionValue, extraEnv map[string]string) []string {\n\tenv := ToOptions(workspace, machine, options)\n\n\t// create environment variables for command\n\tosEnviron := os.Environ()\n\tfor k, v := range env {\n\t\tosEnviron = append(osEnviron, k+\"=\"+v)\n\t}\n\tfor k, v := range extraEnv {\n\t\tosEnviron = append(osEnviron, k+\"=\"+v)\n\t}\n\n\treturn osEnviron\n}\n\nfunc CombineOptions(workspace *Workspace, machine *Machine, options map[string]config.OptionValue) map[string]config.OptionValue {\n\tproviderOptions := map[string]config.OptionValue{}\n\tif options != nil {\n\t\tproviderOptions = combineOptions(providerOptions, options)\n\t}\n\tif workspace != nil {\n\t\tproviderOptions = combineOptions(providerOptions, workspace.Provider.Options)\n\t}\n\tif machine != nil {\n\t\tproviderOptions = combineOptions(providerOptions, machine.Provider.Options)\n\t}\n\treturn providerOptions\n}\n\nfunc ToOptionsWorkspace(workspace *Workspace) map[string]string {\n\tretVars := map[string]string{}\n\tif workspace != nil {\n\t\tif workspace.ID != \"\" {\n\t\t\tretVars[WORKSPACE_ID] = workspace.ID\n\t\t}\n\t\tif workspace.UID != \"\" {\n\t\t\tretVars[WORKSPACE_UID] = workspace.UID\n\t\t}\n\t\tretVars[WORKSPACE_FOLDER], _ = GetWorkspaceDir(workspace.Context, workspace.ID)\n\t\tretVars[WORKSPACE_FOLDER] = filepath.ToSlash(retVars[WORKSPACE_FOLDER])\n\t\tif workspace.Context != \"\" {\n\t\t\tretVars[WORKSPACE_CONTEXT] = workspace.Context\n\t\t\tretVars[MACHINE_CONTEXT] = workspace.Context\n\t\t}\n\t\tif workspace.Origin != \"\" {\n\t\t\tretVars[WORKSPACE_ORIGIN] = filepath.ToSlash(workspace.Origin)\n\t\t}\n\t\tif workspace.Picture != \"\" {\n\t\t\tretVars[WORKSPACE_PICTURE] = workspace.Picture\n\t\t}\n\t\tretVars[WORKSPACE_SOURCE] = workspace.Source.String()\n\t\tif workspace.Provider.Name != \"\" {\n\t\t\tretVars[WORKSPACE_PROVIDER] = workspace.Provider.Name\n\t\t}\n\t\tif workspace.Machine.ID != \"\" {\n\t\t\tretVars[MACHINE_ID] = workspace.Machine.ID\n\t\t\tmachineDir, _ := GetMachineDir(workspace.Context, workspace.Machine.ID)\n\t\t\tretVars[MACHINE_FOLDER] = filepath.ToSlash(machineDir)\n\t\t}\n\t\tif workspace.Pro != nil && workspace.Pro.Project != \"\" {\n\t\t\tretVars[LOFT_PROJECT] = workspace.Pro.Project\n\t\t}\n\t\tfor k, v := range GetBaseEnvironment(workspace.Context, workspace.Provider.Name) {\n\t\t\tretVars[k] = v\n\t\t}\n\t}\n\treturn retVars\n}\n\nfunc ToOptionsMachine(machine *Machine) map[string]string {\n\tretVars := map[string]string{}\n\tif machine != nil {\n\t\tif machine.ID != \"\" {\n\t\t\tretVars[MACHINE_ID] = machine.ID\n\t\t}\n\t\tretVars[MACHINE_FOLDER], _ = GetMachineDir(machine.Context, machine.ID)\n\t\tretVars[MACHINE_FOLDER] = filepath.ToSlash(retVars[MACHINE_FOLDER])\n\t\tif machine.Context != \"\" {\n\t\t\tretVars[MACHINE_CONTEXT] = machine.Context\n\t\t}\n\t\tif machine.Provider.Name != \"\" {\n\t\t\tretVars[MACHINE_PROVIDER] = machine.Provider.Name\n\t\t}\n\t\tfor k, v := range GetBaseEnvironment(machine.Context, machine.Provider.Name) {\n\t\t\tretVars[k] = v\n\t\t}\n\t}\n\treturn retVars\n}\n\nfunc ToOptions(workspace *Workspace, machine *Machine, options map[string]config.OptionValue) map[string]string {\n\tproviderOptions := CombineOptions(workspace, machine, options)\n\tretVars := map[string]string{}\n\tfor optionName, optionValue := range providerOptions {\n\t\tretVars[strings.ToUpper(optionName)] = optionValue.Value\n\t}\n\n\tretVars = Merge(retVars, ToOptionsWorkspace(workspace))\n\tretVars = Merge(retVars, ToOptionsMachine(machine))\n\treturn retVars\n}\n\nfunc Merge(m1 map[string]string, m2 map[string]string) map[string]string {\n\tretMap := map[string]string{}\n\tfor k, v := range m1 {\n\t\tretMap[k] = v\n\t}\n\tfor k, v := range m2 {\n\t\tretMap[k] = v\n\t}\n\n\treturn retMap\n}\n\nfunc GetBaseEnvironment(context, provider string) map[string]string {\n\tretVars := map[string]string{}\n\n\t// devpod binary\n\tdevPodBinary, _ := os.Executable()\n\tretVars[DEVPOD] = filepath.ToSlash(devPodBinary)\n\tretVars[DEVPOD_OS] = runtime.GOOS\n\tretVars[DEVPOD_ARCH] = runtime.GOARCH\n\tretVars[PROVIDER_ID] = provider\n\tretVars[PROVIDER_CONTEXT] = context\n\tproviderFolder, _ := GetProviderDir(context, provider)\n\tretVars[PROVIDER_FOLDER] = filepath.ToSlash(providerFolder)\n\tretVars[DEVPOD_LOG_LEVEL] = log2.Default.GetLevel().String()\n\treturn retVars\n}\n\nfunc GetProviderOptions(workspace *Workspace, server *Machine, devConfig *config.Config) map[string]config.OptionValue {\n\tretValues := map[string]config.OptionValue{}\n\tproviderName := \"\"\n\tif workspace != nil {\n\t\tproviderName = workspace.Provider.Name\n\t}\n\tif server != nil {\n\t\tproviderName = server.Provider.Name\n\t}\n\tif devConfig != nil && providerName != \"\" {\n\t\tfor k, v := range devConfig.Current().ProviderOptions(providerName) {\n\t\t\tretValues[k] = v\n\t\t}\n\t}\n\treturn retValues\n}\n\nfunc CloneAgentWorkspaceInfo(agentWorkspaceInfo *AgentWorkspaceInfo) *AgentWorkspaceInfo {\n\tif agentWorkspaceInfo == nil {\n\t\treturn nil\n\t}\n\tout, _ := json.Marshal(agentWorkspaceInfo)\n\tret := &AgentWorkspaceInfo{}\n\t_ = json.Unmarshal(out, ret)\n\tret.Origin = agentWorkspaceInfo.Origin\n\tret.Workspace = CloneWorkspace(agentWorkspaceInfo.Workspace)\n\tret.Machine = CloneMachine(agentWorkspaceInfo.Machine)\n\treturn ret\n}\n\nfunc CloneWorkspace(workspace *Workspace) *Workspace {\n\tif workspace == nil {\n\t\treturn nil\n\t}\n\tout, _ := json.Marshal(workspace)\n\tret := &Workspace{}\n\t_ = json.Unmarshal(out, ret)\n\tret.Origin = workspace.Origin\n\treturn ret\n}\n\nfunc CloneMachine(server *Machine) *Machine {\n\tif server == nil {\n\t\treturn nil\n\t}\n\tout, _ := json.Marshal(server)\n\tret := &Machine{}\n\t_ = json.Unmarshal(out, ret)\n\tret.Origin = server.Origin\n\treturn ret\n}\n"
  },
  {
    "path": "pkg/provider/export.go",
    "content": "package provider\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/extract\"\n)\n\nvar excludedPaths = []string{\n\t\".cache/\",\n\t\"cache/\",\n\t\"binaries/\",\n\t\"source/\",\n\t\".temp/\",\n\t\"temp/\",\n\t\".tmp/\",\n\t\"tmp/\",\n}\n\ntype ExportConfig struct {\n\t// Workspace is the workspace that was exported\n\tWorkspace *ExportWorkspaceConfig `json:\"workspace,omitempty\"`\n\n\t// Machine is the machine that was exported\n\tMachine *ExportMachineConfig `json:\"machine,omitempty\"`\n\n\t// Provider is the provider that was exported\n\tProvider *ExportProviderConfig `json:\"provider,omitempty\"`\n}\n\ntype ExportWorkspaceConfig struct {\n\t// ID is the workspace id\n\tID string `json:\"id,omitempty\"`\n\n\t// Context is the workspace context\n\tContext string `json:\"context,omitempty\"`\n\n\t// UID is used to identify this specific workspace\n\tUID string `json:\"uid,omitempty\"`\n\n\t// Data is the workspace folder data\n\tData string `json:\"data,omitempty\"`\n}\n\ntype ExportMachineConfig struct {\n\t// ID is the machine id\n\tID string `json:\"id,omitempty\"`\n\n\t// Context is the machine context\n\tContext string `json:\"context,omitempty\"`\n\n\t// Data is the machine folder data\n\tData string `json:\"data,omitempty\"`\n}\n\ntype ExportProviderConfig struct {\n\t// ID is the provider id\n\tID string `json:\"id,omitempty\"`\n\n\t// Context is the provider context\n\tContext string `json:\"context,omitempty\"`\n\n\t// Data is the provider folder data\n\tData string `json:\"data,omitempty\"`\n\n\t// Config is the provider config within the config.yaml\n\tConfig *config.ProviderConfig `json:\"config,omitempty\"`\n}\n\nfunc ExportWorkspace(context, workspaceID string) (*ExportWorkspaceConfig, error) {\n\tworkspaceDir, err := GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tworkspaceConfig, err := LoadWorkspaceConfig(context, workspaceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf := &bytes.Buffer{}\n\terr = extract.WriteTarExclude(buf, workspaceDir, true, excludedPaths)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"compress workspace dir: %w\", err)\n\t}\n\n\treturn &ExportWorkspaceConfig{\n\t\tID:      workspaceID,\n\t\tUID:     workspaceConfig.UID,\n\t\tContext: context,\n\t\tData:    base64.RawStdEncoding.EncodeToString(buf.Bytes()),\n\t}, nil\n}\n\nfunc ExportMachine(context, machineID string) (*ExportMachineConfig, error) {\n\tmachineDir, err := GetMachineDir(context, machineID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = LoadMachineConfig(context, machineID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf := &bytes.Buffer{}\n\terr = extract.WriteTarExclude(buf, machineDir, true, excludedPaths)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"compress machine dir: %w\", err)\n\t}\n\n\treturn &ExportMachineConfig{\n\t\tID:      machineID,\n\t\tContext: context,\n\t\tData:    base64.RawStdEncoding.EncodeToString(buf.Bytes()),\n\t}, nil\n}\n\nfunc ExportProvider(devPodConfig *config.Config, context, providerID string) (*ExportProviderConfig, error) {\n\tproviderDir, err := GetProviderDir(context, providerID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = LoadProviderConfig(context, providerID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf := &bytes.Buffer{}\n\terr = extract.WriteTarExclude(buf, providerDir, true, excludedPaths)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"compress provider dir: %w\", err)\n\t}\n\n\tvar providerConfig *config.ProviderConfig\n\tif devPodConfig != nil && devPodConfig.Contexts[context] != nil && devPodConfig.Contexts[context].Providers != nil && devPodConfig.Contexts[context].Providers[providerID] != nil {\n\t\tproviderConfig = devPodConfig.Contexts[context].Providers[providerID]\n\t}\n\n\treturn &ExportProviderConfig{\n\t\tID:      providerID,\n\t\tContext: context,\n\t\tData:    base64.RawStdEncoding.EncodeToString(buf.Bytes()),\n\t\tConfig:  providerConfig,\n\t}, nil\n}\n"
  },
  {
    "path": "pkg/provider/machine.go",
    "content": "package provider\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\ntype Machine struct {\n\t// ID is the machine id to use\n\tID string `json:\"id,omitempty\"`\n\n\t// Provider is the provider used to create this workspace\n\tProvider MachineProviderConfig `json:\"provider,omitempty\"`\n\n\t// CreationTimestamp is the timestamp when this workspace was created\n\tCreationTimestamp types.Time `json:\"creationTimestamp,omitempty\"`\n\n\t// Context is the context where this config file was loaded from\n\tContext string `json:\"context,omitempty\"`\n\n\t// Origin is the place where this config file was loaded from\n\tOrigin string `json:\"-\"`\n}\n\ntype MachineProviderConfig struct {\n\t// Name is the provider name used to deploy this machine\n\tName string `json:\"name,omitempty\"`\n\n\t// Options are the local options that override the global ones\n\tOptions map[string]config.OptionValue `json:\"options,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/provider/parse.go",
    "content": "package provider\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/blang/semver\"\n\t\"github.com/ghodss/yaml\"\n\t\"github.com/pkg/errors\"\n)\n\nvar ProviderNameRegEx = regexp.MustCompile(`[^a-z0-9\\-]+`)\n\nvar optionNameRegEx = regexp.MustCompile(`[^A-Z0-9_]+`)\n\nvar allowedTypes = []string{\n\t\"string\",\n\t\"multiline\",\n\t\"duration\",\n\t\"number\",\n\t\"boolean\",\n}\n\nfunc ParseProvider(reader io.Reader) (*ProviderConfig, error) {\n\tpayload, err := io.ReadAll(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparsedConfig := &ProviderConfig{}\n\terr = yaml.Unmarshal(payload, parsedConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse provider config\")\n\t}\n\n\terr = validate(parsedConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"validate\")\n\t}\n\n\treturn parsedConfig, nil\n}\n\nfunc validate(config *ProviderConfig) error {\n\t// validate name\n\tif config.Name == \"\" {\n\t\treturn fmt.Errorf(\"name is missing in provider.yaml\")\n\t}\n\tif ProviderNameRegEx.MatchString(config.Name) {\n\t\treturn fmt.Errorf(\"provider name can only include lowercase letters, numbers or dashes\")\n\t} else if len(config.Name) > 32 {\n\t\treturn fmt.Errorf(\"provider name cannot be longer than 32 characters\")\n\t}\n\n\t// validate version\n\tif config.Version != \"\" {\n\t\t_, err := semver.Parse(strings.TrimPrefix(config.Version, \"v\"))\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"parse provider version\")\n\t\t}\n\t}\n\n\t// validate option names\n\tfor optionName, optionValue := range config.Options {\n\t\tif optionNameRegEx.MatchString(optionName) {\n\t\t\treturn fmt.Errorf(\"provider option '%s' can only consist of upper case letters, numbers or underscores. E.g. MY_OPTION, MY_OTHER_OPTION\", optionName)\n\t\t}\n\n\t\t// validate option validation\n\t\tif optionValue.ValidationPattern != \"\" {\n\t\t\t_, err := regexp.Compile(optionValue.ValidationPattern)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error parsing validation pattern '%s' for option '%s': %w\", optionValue.ValidationPattern, optionName, err)\n\t\t\t}\n\t\t}\n\n\t\tif optionValue.Default != \"\" && optionValue.Command != \"\" {\n\t\t\treturn fmt.Errorf(\"default and command cannot be used together in option '%s'\", optionName)\n\t\t}\n\n\t\tif optionValue.Global && optionValue.Cache != \"\" {\n\t\t\treturn fmt.Errorf(\"global and cache cannot be used together in option '%s'\", optionName)\n\t\t}\n\n\t\tif optionValue.Global && optionValue.Mutable {\n\t\t\treturn fmt.Errorf(\"global and mutable cannot be used together in option '%s'\", optionName)\n\t\t}\n\n\t\tif optionValue.Cache != \"\" {\n\t\t\t_, err := time.ParseDuration(optionValue.Cache)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid cache value for option '%s': %w\", optionName, err)\n\t\t\t}\n\t\t}\n\n\t\tif optionValue.Type != \"\" && !contains(allowedTypes, optionValue.Type) {\n\t\t\treturn fmt.Errorf(\"type can only be one of in option '%s': %v\", optionName, allowedTypes)\n\t\t}\n\n\t\tif optionValue.Cache != \"\" && optionValue.Command == \"\" {\n\t\t\treturn fmt.Errorf(\"cache can only be used with command in option '%s'\", optionName)\n\t\t}\n\t}\n\n\t// validate provider binaries\n\terr := validateBinaries(\"binaries\", config.Binaries)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = validateProviderType(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = validateOptionGroups(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc validateProviderType(config *ProviderConfig) error {\n\tif config.IsProxyProvider() {\n\t\tif !reflect.DeepEqual(config.Agent, ProviderAgentConfig{}) {\n\t\t\treturn fmt.Errorf(\"agent config is not allowed for proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Command) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.command is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Create) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Start) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Stop) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Status) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Delete) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Proxy.Status) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.proxy.status is required for proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Proxy.Stop) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.proxy.stop is required for proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Proxy.Delete) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.proxy.delete is required for proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Proxy.Ssh) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.proxy.ssh is required for proxy providers\")\n\t\t}\n\t\tif len(config.Exec.Proxy.Up) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.proxy.up is required for proxy providers\")\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// daemon provider\n\tif config.IsDaemonProvider() {\n\t\tif !reflect.DeepEqual(config.Agent, ProviderAgentConfig{}) {\n\t\t\treturn fmt.Errorf(\"agent config is not allowed for daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Command) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.command is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Create) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Start) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Stop) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Status) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Delete) > 0 {\n\t\t\treturn fmt.Errorf(\"exec.create is not allowed in daemon providers\")\n\t\t}\n\t\tif len(config.Exec.Daemon.Start) == 0 {\n\t\t\treturn fmt.Errorf(\"exec.daemon.start is required for daemon providers\")\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// validate driver\n\tif config.Agent.Driver != \"\" && config.Agent.Driver != CustomDriver && config.Agent.Driver != DockerDriver && config.Agent.Driver != KubernetesDriver {\n\t\treturn fmt.Errorf(\"agent.driver can only be docker, kubernetes or custom\")\n\t}\n\n\t// validate custom driver\n\tif config.Agent.Driver == CustomDriver {\n\t\tif len(config.Agent.Custom.TargetArchitecture) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.targetArchitecture is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.StartDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.startDevContainer is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.StopDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.stopDevContainer is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.RunDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.runDevContainer is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.DeleteDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.deleteDevContainer is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.FindDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.findDevContainer is required\")\n\t\t}\n\t\tif len(config.Agent.Custom.CommandDevContainer) == 0 {\n\t\t\treturn fmt.Errorf(\"agent.custom.commandDevContainer is required\")\n\t\t}\n\t\t// TODO: Add config.Agent.Custom.GetDevContainerLogs validation\n\t\t// after we released a new version of the kubernetes provider and gave folks a chance to update\n\t}\n\n\t// agent binaries\n\terr := validateBinaries(\"agent.binaries\", config.Agent.Binaries)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// validate provider type\n\tif len(config.Exec.Command) == 0 {\n\t\treturn fmt.Errorf(\"exec.command is required\")\n\t}\n\tif len(config.Exec.Create) > 0 && len(config.Exec.Delete) == 0 {\n\t\treturn fmt.Errorf(\"exec.delete is required\")\n\t}\n\tif len(config.Exec.Create) == 0 && len(config.Exec.Delete) > 0 {\n\t\treturn fmt.Errorf(\"exec.create is required\")\n\t}\n\tif len(config.Exec.Start) == 0 && len(config.Exec.Stop) > 0 {\n\t\treturn fmt.Errorf(\"exec.start is required\")\n\t}\n\tif len(config.Exec.Stop) == 0 && len(config.Exec.Start) > 0 {\n\t\treturn fmt.Errorf(\"exec.start is required\")\n\t}\n\tif len(config.Exec.Status) == 0 && len(config.Exec.Start) > 0 {\n\t\treturn fmt.Errorf(\"exec.status is required\")\n\t}\n\tif len(config.Exec.Create) == 0 && len(config.Exec.Start) > 0 {\n\t\treturn fmt.Errorf(\"exec.create is required\")\n\t}\n\n\treturn nil\n}\n\nfunc validateOptionGroups(config *ProviderConfig) error {\n\tfor idx, group := range config.OptionGroups {\n\t\tif group.Name == \"\" {\n\t\t\treturn fmt.Errorf(\"optionGroups[%d].name cannot be empty\", idx)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateBinaries(prefix string, binaries map[string][]*ProviderBinary) error {\n\tfor binaryName, binaryArr := range binaries {\n\t\tif optionNameRegEx.MatchString(binaryName) {\n\t\t\treturn fmt.Errorf(\"binary name '%s' can only consist of upper case letters, numbers or underscores. E.g. MY_BINARY, KUBECTL\", binaryName)\n\t\t}\n\n\t\tfor _, binary := range binaryArr {\n\t\t\tif binary.OS != \"linux\" && binary.OS != \"darwin\" && binary.OS != \"windows\" {\n\t\t\t\treturn fmt.Errorf(\"unsupported binary operating system '%s', must be 'linux', 'darwin' or 'windows'\", binary.OS)\n\t\t\t}\n\t\t\tif binary.Path == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s.%s.path required binary path, cannot be empty\", prefix, binaryName)\n\t\t\t}\n\t\t\tif binary.ArchivePath == \"\" && (strings.HasSuffix(binary.Path, \".gz\") || strings.HasSuffix(binary.Path, \".tar\") || strings.HasSuffix(binary.Path, \".tgz\") || strings.HasSuffix(binary.Path, \".zip\")) {\n\t\t\t\treturn fmt.Errorf(\"%s.%s.archivePath required because binary path is an archive\", prefix, binaryName)\n\t\t\t}\n\t\t\tif binary.Arch == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s.%s.arch required, cannot be empty\", prefix, binaryName)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc ParseOptions(options []string) (map[string]string, error) {\n\tretMap := map[string]string{}\n\tfor _, option := range options {\n\t\tsplitted := strings.Split(option, \"=\")\n\t\tif len(splitted) == 1 {\n\t\t\treturn nil, fmt.Errorf(\"invalid option '%s', expected format KEY=VALUE\", option)\n\t\t}\n\n\t\tkey := strings.ToUpper(strings.TrimSpace(splitted[0]))\n\t\tvalue := strings.Join(splitted[1:], \"=\")\n\n\t\tretMap[key] = value\n\t}\n\n\treturn retMap, nil\n}\n\nfunc contains(haystack []string, needle string) bool {\n\tfor _, s := range haystack {\n\t\tif s == needle {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "pkg/provider/pro.go",
    "content": "package provider\n\nimport \"github.com/loft-sh/devpod/pkg/types\"\n\ntype ProInstance struct {\n\t// Provider is the provider name this pro instance belongs to\n\tProvider string `json:\"provider,omitempty\"`\n\n\t// Host is the Loft DevPod Pro host to use\n\tHost string `json:\"host,omitempty\"`\n\n\t// CreationTimestamp is the timestamp when this pro instance was created\n\tCreationTimestamp types.Time `json:\"creationTimestamp,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/provider/provider.go",
    "content": "package provider\n\nimport (\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\nconst (\n\tCommandEnv = \"COMMAND\"\n)\n\ntype ProviderConfig struct {\n\t// Name is the name of the provider\n\tName string `json:\"name,omitempty\"`\n\n\t// Version is the provider version\n\tVersion string `json:\"version,omitempty\"`\n\n\t// Icon holds an image URL that will be displayed\n\tIcon string `json:\"icon,omitempty\"`\n\n\t// IconDark holds an image URL that will be displayed in dark mode\n\tIconDark string `json:\"iconDark,omitempty\"`\n\n\t// Home holds the provider home URL\n\tHome string `json:\"home,omitempty\"`\n\n\t// Source is the source the provider was loaded from\n\tSource ProviderSource `json:\"source,omitempty\"`\n\n\t// Description is the provider description\n\tDescription string `json:\"description,omitempty\"`\n\n\t// OptionGroups holds information how to display options\n\tOptionGroups []ProviderOptionGroup `json:\"optionGroups,omitempty\"`\n\n\t// Options are the provider options.\n\tOptions map[string]*types.Option `json:\"options,omitempty\"`\n\n\t// Agent allows you to override agent configuration\n\tAgent ProviderAgentConfig `json:\"agent,omitempty\"`\n\n\t// Exec holds the provider commands\n\tExec ProviderCommands `json:\"exec,omitempty\"`\n\n\t// Binaries is an optional field to specify a binary to execute the commands\n\tBinaries map[string][]*ProviderBinary `json:\"binaries,omitempty\"`\n}\n\ntype ProviderOptionGroup struct {\n\t// Name is the display name of the option group\n\tName string `json:\"name,omitempty\"`\n\n\t// Options are the options that belong to this group\n\tOptions []string `json:\"options,omitempty\"`\n\n\t// DefaultVisible defines if the option group should be visible by default\n\tDefaultVisible bool `json:\"defaultVisible,omitempty\"`\n}\n\ntype ProviderSource struct {\n\t// Internal means provider was received internally\n\tInternal bool `json:\"internal,omitempty\"`\n\n\t// Github source for the provider\n\tGithub string `json:\"github,omitempty\"`\n\n\t// File source for the provider\n\tFile string `json:\"file,omitempty\"`\n\n\t// URL where the provider was downloaded from\n\tURL string `json:\"url,omitempty\"`\n\n\t// Raw is the exact string we used to load the provider\n\tRaw string `json:\"raw,omitempty\"`\n}\n\ntype ProviderAgentConfig struct {\n\t// Local defines if DevPod is running locally\n\tLocal types.StrBool `json:\"local,omitempty\"`\n\n\t// Path is the binary path inside the server devpod will expect the agent binary\n\tPath string `json:\"path,omitempty\"`\n\n\t// DataPath is the agent path where data is stored\n\tDataPath string `json:\"dataPath,omitempty\"`\n\n\t// DownloadURL is the base url where to download the agent from\n\tDownloadURL string `json:\"downloadURL,omitempty\"`\n\n\t// Timeout is the timeout in minutes to wait until the agent tries\n\t// to turn of the server.\n\tTimeout string `json:\"inactivityTimeout,omitempty\"`\n\n\t// ContainerTimeout is the timeout in minutes to wait until the agent tries\n\t// to delete the container.\n\tContainerTimeout string `json:\"containerInactivityTimeout,omitempty\"`\n\n\t// InjectGitCredentials signals DevPod if git credentials should get synced into\n\t// the remote machine for cloning the repository.\n\tInjectGitCredentials types.StrBool `json:\"injectGitCredentials,omitempty\"`\n\n\t// InjectDockerCredentials signals DevPod if docker credentials should get synced\n\t// into the remote machine for pulling and pushing images.\n\tInjectDockerCredentials types.StrBool `json:\"injectDockerCredentials,omitempty\"`\n\n\t// Exec commands that can be used on the remote\n\tExec ProviderAgentConfigExec `json:\"exec,omitempty\"`\n\n\t// Binaries is an optional field to specify a binary to execute the commands\n\tBinaries map[string][]*ProviderBinary `json:\"binaries,omitempty\"`\n\n\t// Dockerless holds custom dockerless configuration\n\tDockerless ProviderDockerlessOptions `json:\"dockerless,omitempty\"`\n\n\t// Driver is the driver to use for deploying the devcontainer. Currently supports\n\t// docker (default) or kubernetes (experimental)\n\tDriver string `json:\"driver,omitempty\"`\n\n\t// Docker holds docker specific configuration\n\tDocker ProviderDockerDriverConfig `json:\"docker,omitempty\"`\n\n\t// Custom holds custom driver specific configuration\n\tCustom ProviderCustomDriverConfig `json:\"custom,omitempty\"`\n\n\t// Kubernetes holds kubernetes specific configuration\n\tKubernetes ProviderKubernetesDriverConfig `json:\"kubernetes,omitempty\"`\n}\n\ntype ProviderDockerlessOptions struct {\n\t// Disabled signals if dockerless building is disabled\n\tDisabled types.StrBool `json:\"disabled,omitempty\"`\n\n\t// Image is the image of the dockerless container to start\n\tImage string `json:\"image,omitempty\"`\n\n\t// IgnorePaths are additional ignore paths that should be ignored during deletion\n\tIgnorePaths string `json:\"ignorePaths,omitempty\"`\n\n\t// Registry to use as remote cache\n\tRegistryCache string `json:\"registryCache,omitempty\"`\n\n\t// DisableDockerCredentials prevents docker credentials from getting injected\n\tDisableDockerCredentials types.StrBool `json:\"disableDockerCredentials,omitempty\"`\n}\n\nfunc (a ProviderAgentConfig) IsDockerDriver() bool {\n\treturn a.Driver == \"\" || a.Driver == DockerDriver\n}\n\nconst (\n\tDockerDriver     = \"docker\"\n\tKubernetesDriver = \"kubernetes\"\n\tCustomDriver     = \"custom\"\n)\n\ntype ProviderCustomDriverConfig struct {\n\t// FindDevContainer is used to find an existing devcontainer\n\tFindDevContainer types.StrArray `json:\"findDevContainer,omitempty\"`\n\n\t// CommandDevContainer is used to execute a command in the devcontainer\n\tCommandDevContainer types.StrArray `json:\"commandDevContainer,omitempty\"`\n\n\t// TargetArchitecture is used to find out the target architecture\n\tTargetArchitecture types.StrArray `json:\"targetArchitecture,omitempty\"`\n\n\t// RunDevContainer is used to actually run the devcontainer\n\tRunDevContainer types.StrArray `json:\"runDevContainer,omitempty\"`\n\n\t// StartDevContainer is used to start the devcontainer\n\tStartDevContainer types.StrArray `json:\"startDevContainer,omitempty\"`\n\n\t// StopDevContainer is used to stop the devcontainer\n\tStopDevContainer types.StrArray `json:\"stopDevContainer,omitempty\"`\n\n\t// DeleteDevContainer is used to delete the devcontainer\n\tDeleteDevContainer types.StrArray `json:\"deleteDevContainer,omitempty\"`\n\n\t// CanReprovision returns true if the driver can reprovision the devcontainer\n\tCanReprovision types.StrBool `json:\"canReprovision,omitempty\"`\n\n\t// GetDevContainerLogs returns the logs of the devcontainer\n\tGetDevContainerLogs types.StrArray `json:\"getDevContainerLogs,omitempty\"`\n}\n\ntype ProviderDockerDriverConfig struct {\n\t// Path where to find the docker binary, defaults to 'docker'\n\tPath string `json:\"path,omitempty\"`\n\n\t// If false, DevPod will not try to install docker into the machine.\n\tInstall types.StrBool `json:\"install,omitempty\"`\n\n\t// Builder to use with docker\n\tBuilder string `json:\"builder,omitempty\"`\n\n\t// Environment variables to set when running docker commands\n\tEnv map[string]string `json:\"env,omitempty\"`\n}\n\ntype ProviderKubernetesDriverConfig struct {\n\tKubernetesContext   string `json:\"kubernetesContext,omitempty\"`\n\tKubernetesConfig    string `json:\"kubernetesConfig,omitempty\"`\n\tKubernetesNamespace string `json:\"kubernetesNamespace,omitempty\"`\n\tPodTimeout          string `json:\"podTimeout,omitempty\"`\n\n\tKubernetesPullSecretsEnabled string `json:\"kubernetesPullSecretsEnabled,omitempty\"`\n\tCreateNamespace              string `json:\"createNamespace,omitempty\"`\n\tClusterRole                  string `json:\"clusterRole,omitempty\"`\n\tServiceAccount               string `json:\"serviceAccount,omitempty\"`\n\n\tArchitecture      string `json:\"architecture,omitempty\"`\n\tInactivityTimeout string `json:\"inactivityTimeout,omitempty\"`\n\tStorageClass      string `json:\"storageClass,omitempty\"`\n\n\tDiskSize             string `json:\"diskSize,omitempty\"`\n\tPvcAccessMode        string `json:\"pvcAccessMode,omitempty\"`\n\tPvcAnnotations       string `json:\"pvcAnnotations,omitempty\"`\n\tNodeSelector         string `json:\"nodeSelector,omitempty\"`\n\tResources            string `json:\"resources,omitempty\"`\n\tWorkspaceVolumeMount string `json:\"workspaceVolumeMount,omitempty\"`\n\n\tPodManifestTemplate string `json:\"podManifestTemplate,omitempty\"`\n\tLabels              string `json:\"labels,omitempty\"`\n\n\tStrictSecurity string `json:\"strictSecurity,omitempty\"`\n}\n\ntype ProviderAgentConfigExec struct {\n\t// Shutdown is the remote command to run when the remote machine\n\t// should shutdown.\n\tShutdown types.StrArray `json:\"shutdown,omitempty\"`\n}\n\ntype ProviderBinary struct {\n\t// The current OS\n\tOS string `json:\"os,omitempty\"`\n\n\t// The current Arch\n\tArch string `json:\"arch,omitempty\"`\n\n\t// Checksum is the sha256 hash of the binary\n\tChecksum string `json:\"checksum,omitempty\"`\n\n\t// Path is the binary url to download from or relative path to use\n\tPath string `json:\"path,omitempty\"`\n\n\t// ArchivePath is the path within the archive to extract\n\tArchivePath string `json:\"archivePath,omitempty\"`\n\n\t// Name is the name of the binary to store locally\n\tName string `json:\"name,omitempty\"`\n}\n\ntype ProviderCommands struct {\n\t// Init is run directly after `devpod provider use`\n\tInit types.StrArray `json:\"init,omitempty\"`\n\n\t// Command executes a command on the server\n\tCommand types.StrArray `json:\"command,omitempty\"`\n\n\t// Create creates a new server\n\tCreate types.StrArray `json:\"create,omitempty\"`\n\n\t// Delete destroys a server\n\tDelete types.StrArray `json:\"delete,omitempty\"`\n\n\t// Start starts a stopped server\n\tStart types.StrArray `json:\"start,omitempty\"`\n\n\t// Stop stops a running server\n\tStop types.StrArray `json:\"stop,omitempty\"`\n\n\t// Status retrieves the server status\n\tStatus types.StrArray `json:\"status,omitempty\"`\n\n\t// Proxy proxies commands\n\tProxy *ProxyCommands `json:\"proxy,omitempty\"`\n\n\t// Daemon commands\n\tDaemon *DaemonCommands `json:\"daemon,omitempty\"`\n}\n\ntype ProxyCommands struct {\n\t// Up proxies the up command\n\tUp types.StrArray `json:\"up,omitempty\"`\n\n\t// Stop proxies the stop command\n\tStop types.StrArray `json:\"stop,omitempty\"`\n\n\t// Delete proxies the delete command\n\tDelete types.StrArray `json:\"delete,omitempty\"`\n\n\t// Ssh proxies the ssh command\n\tSsh types.StrArray `json:\"ssh,omitempty\"`\n\n\t// Status proxies the status command\n\tStatus types.StrArray `json:\"status,omitempty\"`\n\n\t// Health checks the health of the platform\n\tHealth types.StrArray `json:\"health,omitempty\"`\n\n\t// Create creates entities associated with this provider\n\tCreate CreateProxyCommands `json:\"create,omitempty\"`\n\n\t// Get gets entities associated with this provider\n\tGet GetProxyCommands `json:\"get,omitempty\"`\n\n\t// List lists all entities associated with this provider\n\tList ListProxyCommands `json:\"list,omitempty\"`\n\n\t// Watch lists all entities associated with this provider and then watches for changes\n\tWatch WatchProxyCommands `json:\"watch,omitempty\"`\n\n\t// Update updates entities associated with this provider\n\tUpdate UpdateProxyCommands `json:\"update,omitempty\"`\n}\n\ntype ListProxyCommands struct {\n\t// Workspaces lists all workspaces\n\tWorkspaces types.StrArray `json:\"workspaces,omitempty\"`\n\n\t// Projects lists all projects\n\tProjects types.StrArray `json:\"projects,omitempty\"`\n\n\t// Templates lists all templates in a project\n\tTemplates types.StrArray `json:\"templates,omitempty\"`\n\n\t// Clusters lists all clusters and runners in a project\n\tClusters types.StrArray `json:\"clusters,omitempty\"`\n}\n\ntype WatchProxyCommands struct {\n\t// Workspaces watches all workspaces and updates on changes\n\tWorkspaces types.StrArray `json:\"workspaces,omitempty\"`\n}\n\ntype CreateProxyCommands struct {\n\t// Workspace creates a workspace instance\n\tWorkspace types.StrArray `json:\"workspace,omitempty\"`\n}\n\ntype GetProxyCommands struct {\n\t// Workspace gets a workspace instance\n\tWorkspace types.StrArray `json:\"workspace,omitempty\"`\n\n\t// Self gets self for this provider\n\tSelf types.StrArray `json:\"self,omitempty\"`\n\n\t// Version gets the for this pro instance\n\tVersion types.StrArray `json:\"version,omitempty\"`\n}\n\ntype UpdateProxyCommands struct {\n\t// Workspace updates a workspace instance\n\tWorkspace types.StrArray `json:\"workspace,omitempty\"`\n}\n\ntype DaemonCommands struct {\n\t// Start starts the daemon\n\tStart types.StrArray `json:\"start,omitempty\"`\n\t// Status gets the daemon status\n\tStatus types.StrArray `json:\"status,omitempty\"`\n}\n\ntype SubOptions struct {\n\tOptions map[string]*types.Option `json:\"options,omitempty\"`\n}\n\nfunc (c *ProviderConfig) IsMachineProvider() bool {\n\treturn len(c.Exec.Create) > 0\n}\n\nfunc (c *ProviderConfig) IsProxyProvider() bool {\n\treturn c.Exec.Proxy != nil\n}\n\nfunc (c *ProviderConfig) HasHealthCheck() bool {\n\treturn c.Exec.Proxy != nil && len(c.Exec.Proxy.Health) > 0\n}\n\nfunc (c *ProviderConfig) IsDaemonProvider() bool {\n\treturn c.Exec.Daemon != nil\n}\n"
  },
  {
    "path": "pkg/provider/workspace.go",
    "content": "package provider\n\nimport (\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdevcontainerconfig \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n)\n\nvar (\n\tWorkspaceSourceGit       = \"git:\"\n\tWorkspaceSourceLocal     = \"local:\"\n\tWorkspaceSourceImage     = \"image:\"\n\tWorkspaceSourceContainer = \"container:\"\n\tWorkspaceSourceUnknown   = \"unknown:\"\n)\n\ntype Workspace struct {\n\t// ID is the workspace id to use\n\tID string `json:\"id,omitempty\"`\n\n\t// UID is used to identify this specific workspace\n\tUID string `json:\"uid,omitempty\"`\n\n\t// Picture is the project social media image\n\tPicture string `json:\"picture,omitempty\"`\n\n\t// Provider is the provider used to create this workspace\n\tProvider WorkspaceProviderConfig `json:\"provider,omitempty\"`\n\n\t// Machine is the machine to use for this workspace\n\tMachine WorkspaceMachineConfig `json:\"machine,omitempty\"`\n\n\t// IDE holds IDE specific settings\n\tIDE WorkspaceIDEConfig `json:\"ide,omitempty\"`\n\n\t// Source is the source where this workspace will be created from\n\tSource WorkspaceSource `json:\"source,omitempty\"`\n\n\t// DevContainerImage is the container image to use, overriding whatever is in the devcontainer.json\n\tDevContainerImage string `json:\"devContainerImage,omitempty\"`\n\n\t// DevContainerPath is the relative path where the devcontainer.json is located.\n\tDevContainerPath string `json:\"devContainerPath,omitempty\"`\n\n\t// DevContainerConfig holds the config for the devcontainer.json.\n\tDevContainerConfig *devcontainerconfig.DevContainerConfig `json:\"devContainerConfig,omitempty\"`\n\n\t// CreationTimestamp is the timestamp when this workspace was created\n\tCreationTimestamp types.Time `json:\"creationTimestamp,omitempty\"`\n\n\t// LastUsedTimestamp holds the timestamp when this workspace was last accessed\n\tLastUsedTimestamp types.Time `json:\"lastUsed,omitempty\"`\n\n\t// Context is the context where this config file was loaded from\n\tContext string `json:\"context,omitempty\"`\n\n\t// Imported signals that this workspace was imported\n\tImported bool `json:\"imported,omitempty\"`\n\n\t// Origin is the place where this config file was loaded from\n\tOrigin string `json:\"-\"`\n\n\t// Pro signals this workspace is remote and doesn't necessarily exist locally. It also has more metadata about the pro workspace\n\tPro *ProMetadata `json:\"pro,omitempty\"`\n\n\t// Path to the file where the SSH config to access the workspace is stored\n\tSSHConfigPath string `json:\"sshConfigPath,omitempty\"`\n}\n\ntype ProMetadata struct {\n\t// InstanceName is the platform CRD name for this workspace\n\tInstanceName string `json:\"instanceName,omitempty\"`\n\n\t// Project is the platform project the workspace lives in\n\tProject string `json:\"project,omitempty\"`\n\n\t// DisplayName is the name intended to show users\n\tDisplayName string `json:\"displayName,omitempty\"`\n}\n\ntype WorkspaceIDEConfig struct {\n\t// Name is the name of the IDE\n\tName string `json:\"name,omitempty\"`\n\n\t// Options are the local options that override the global ones\n\tOptions map[string]config.OptionValue `json:\"options,omitempty\"`\n}\n\ntype WorkspaceMachineConfig struct {\n\t// ID is the machine ID to use for this workspace\n\tID string `json:\"machineId,omitempty\"`\n\n\t// AutoDelete specifies if the machine should get destroyed when\n\t// the workspace is destroyed\n\tAutoDelete bool `json:\"autoDelete,omitempty\"`\n}\n\ntype WorkspaceProviderConfig struct {\n\t// Name is the provider name\n\tName string `json:\"name,omitempty\"`\n\n\t// Options are the local options that override the global ones\n\tOptions map[string]config.OptionValue `json:\"options,omitempty\"`\n}\n\ntype WorkspaceSource struct {\n\t// GitRepository is the repository to clone\n\tGitRepository string `json:\"gitRepository,omitempty\"`\n\n\t// GitBranch is the branch to use\n\tGitBranch string `json:\"gitBranch,omitempty\"`\n\n\t// GitCommit is the commit SHA to checkout\n\tGitCommit string `json:\"gitCommit,omitempty\"`\n\n\t// GitPRReference is the pull request reference to checkout\n\tGitPRReference string `json:\"gitPRReference,omitempty\"`\n\n\t// GitSubPath is the subpath in the repo to use\n\tGitSubPath string `json:\"gitSubDir,omitempty\"`\n\n\t// LocalFolder is the local folder to use\n\tLocalFolder string `json:\"localFolder,omitempty\"`\n\n\t// Image is the docker image to use\n\tImage string `json:\"image,omitempty\"`\n\n\t// Container is the container to use\n\tContainer string `json:\"container,omitempty\"`\n}\n\ntype ContainerWorkspaceInfo struct {\n\t// IDE holds the ide config options\n\tIDE WorkspaceIDEConfig `json:\"ide,omitempty\"`\n\n\t// CLIOptions holds the cli options\n\tCLIOptions CLIOptions `json:\"cliOptions,omitempty\"`\n\n\t// Dockerless holds custom dockerless configuration\n\tDockerless ProviderDockerlessOptions `json:\"dockerless,omitempty\"`\n\n\t// ContainerTimeout is the timeout in minutes to wait until the agent tries\n\t// to delete the container.\n\tContainerTimeout string `json:\"containerInactivityTimeout,omitempty\"`\n\n\t// Source is a WorkspaceSource to be used inside the container\n\tSource WorkspaceSource `json:\"source,omitempty\"`\n\n\t// ContentFolder holds the folder where the content is stored\n\tContentFolder string `json:\"contentFolder,omitempty\"`\n\n\t// PullFromInsideContainer determines if project should be pulled from Source when container starts\n\tPullFromInsideContainer types.StrBool `json:\"pullFromInsideContainer,omitempty\"`\n\n\t// Agent holds the agent info\n\tAgent ProviderAgentConfig `json:\"agent,omitempty\"`\n}\n\ntype AgentWorkspaceInfo struct {\n\t// WorkspaceOrigin is the path where this workspace config originated from\n\tWorkspaceOrigin string `json:\"workspaceOrigin,omitempty\"`\n\n\t// Workspace holds the workspace info\n\tWorkspace *Workspace `json:\"workspace,omitempty\"`\n\n\t// LastDevContainerConfig can be used as a fallback if the workspace was already started\n\t// and we lost track of the devcontainer.json\n\tLastDevContainerConfig *devcontainerconfig.DevContainerConfigWithPath `json:\"lastDevContainerConfig,omitempty\"`\n\n\t// Machine holds the machine info\n\tMachine *Machine `json:\"machine,omitempty\"`\n\n\t// Agent holds the agent info\n\tAgent ProviderAgentConfig `json:\"agent,omitempty\"`\n\n\t// CLIOptions holds the cli options\n\tCLIOptions CLIOptions `json:\"cliOptions,omitempty\"`\n\n\t// Options holds the filled provider options for this workspace\n\tOptions map[string]config.OptionValue `json:\"options,omitempty\"`\n\n\t// ContentFolder holds the folder where the content is stored\n\tContentFolder string `json:\"contentFolder,omitempty\"`\n\n\t// Origin holds the folder where this config was loaded from\n\tOrigin string `json:\"-\"`\n\n\t// InjectTimeout specifies how long to wait for the agent to be injected into the dev container\n\tInjectTimeout time.Duration `json:\"injectTimeout,omitempty\"`\n\n\t// RegistryCache defines the registry to use for caching builds\n\tRegistryCache string `json:\"registryCache,omitempty\"`\n}\n\ntype CLIOptions struct {\n\t// Platform are the platform options\n\tPlatform devpod.PlatformOptions `json:\"platformOptions,omitempty\"`\n\n\t// up options\n\tID                          string            `json:\"id,omitempty\"`\n\tSource                      string            `json:\"source,omitempty\"`\n\tIDE                         string            `json:\"ide,omitempty\"`\n\tIDEOptions                  []string          `json:\"ideOptions,omitempty\"`\n\tPrebuildRepositories        []string          `json:\"prebuildRepositories,omitempty\"`\n\tDevContainerImage           string            `json:\"devContainerImage,omitempty\"`\n\tDevContainerPath            string            `json:\"devContainerPath,omitempty\"`\n\tWorkspaceEnv                []string          `json:\"workspaceEnv,omitempty\"`\n\tWorkspaceEnvFile            []string          `json:\"workspaceEnvFile,omitempty\"`\n\tInitEnv                     []string          `json:\"initEnv,omitempty\"`\n\tRecreate                    bool              `json:\"recreate,omitempty\"`\n\tReset                       bool              `json:\"reset,omitempty\"`\n\tDisableDaemon               bool              `json:\"disableDaemon,omitempty\"`\n\tDaemonInterval              string            `json:\"daemonInterval,omitempty\"`\n\tGitCloneStrategy            git.CloneStrategy `json:\"gitCloneStrategy,omitempty\"`\n\tGitCloneRecursiveSubmodules bool              `json:\"gitCloneRecursive,omitempty\"`\n\tFallbackImage               string            `json:\"fallbackImage,omitempty\"`\n\tGitSSHSigningKey            string            `json:\"gitSshSigningKey,omitempty\"`\n\tSSHAuthSockID               string            `json:\"sshAuthSockID,omitempty\"` // ID to use when looking for SSH_AUTH_SOCK, defaults to a new random ID if not set (only used for browser IDEs)\n\tStrictHostKeyChecking       bool              `json:\"strictHostKeyChecking,omitempty\"`\n\n\t// build options\n\tRepository string   `json:\"repository,omitempty\"`\n\tSkipPush   bool     `json:\"skipPush,omitempty\"`\n\tPlatforms  []string `json:\"platform,omitempty\"`\n\tTag        []string `json:\"tag,omitempty\"`\n\n\tForceBuild            bool `json:\"forceBuild,omitempty\"`\n\tForceDockerless       bool `json:\"forceDockerless,omitempty\"`\n\tForceInternalBuildKit bool `json:\"forceInternalBuildKit,omitempty\"`\n}\n\ntype BuildOptions struct {\n\tCLIOptions\n\n\tPlatform      string\n\tRegistryCache string\n\tExportCache   bool\n\tNoBuild       bool\n}\n\nfunc (w WorkspaceSource) String() string {\n\tif w.GitRepository != \"\" {\n\t\tif w.GitPRReference != \"\" {\n\t\t\treturn WorkspaceSourceGit + w.GitRepository + \"@\" + w.GitPRReference\n\t\t} else if w.GitBranch != \"\" {\n\t\t\treturn WorkspaceSourceGit + w.GitRepository + \"@\" + w.GitBranch\n\t\t} else if w.GitCommit != \"\" {\n\t\t\treturn WorkspaceSourceGit + w.GitRepository + git.CommitDelimiter + w.GitCommit\n\t\t}\n\n\t\treturn WorkspaceSourceGit + w.GitRepository\n\t} else if w.LocalFolder != \"\" {\n\t\treturn WorkspaceSourceLocal + w.LocalFolder\n\t} else if w.Image != \"\" {\n\t\treturn WorkspaceSourceImage + w.Image\n\t} else if w.Container != \"\" {\n\t\treturn WorkspaceSourceContainer + w.Container\n\t}\n\n\treturn \"\"\n}\n\nfunc (w WorkspaceSource) Type() string {\n\tif w.GitRepository != \"\" {\n\t\tif w.GitPRReference != \"\" {\n\t\t\treturn WorkspaceSourceGit + \"pr\"\n\t\t} else if w.GitBranch != \"\" {\n\t\t\treturn WorkspaceSourceGit + \"branch\"\n\t\t} else if w.GitCommit != \"\" {\n\t\t\treturn WorkspaceSourceGit + \"commit\"\n\t\t}\n\n\t\treturn WorkspaceSourceGit\n\t} else if w.LocalFolder != \"\" {\n\t\treturn WorkspaceSourceLocal\n\t} else if w.Image != \"\" {\n\t\treturn WorkspaceSourceImage\n\t} else if w.Container != \"\" {\n\t\treturn WorkspaceSourceContainer\n\t}\n\n\treturn WorkspaceSourceUnknown\n}\n\nfunc ParseWorkspaceSource(source string) *WorkspaceSource {\n\tif strings.HasPrefix(source, WorkspaceSourceGit) {\n\t\tgitRepo, gitPRReference, gitBranch, gitCommit, gitSubdir := git.NormalizeRepository(strings.TrimPrefix(source, WorkspaceSourceGit))\n\t\treturn &WorkspaceSource{\n\t\t\tGitRepository:  gitRepo,\n\t\t\tGitPRReference: gitPRReference,\n\t\t\tGitBranch:      gitBranch,\n\t\t\tGitCommit:      gitCommit,\n\t\t\tGitSubPath:     gitSubdir,\n\t\t}\n\t} else if strings.HasPrefix(source, WorkspaceSourceLocal) {\n\t\treturn &WorkspaceSource{\n\t\t\tLocalFolder: strings.TrimPrefix(source, WorkspaceSourceLocal),\n\t\t}\n\t} else if strings.HasPrefix(source, WorkspaceSourceImage) {\n\t\treturn &WorkspaceSource{\n\t\t\tImage: strings.TrimPrefix(source, WorkspaceSourceImage),\n\t\t}\n\t} else if strings.HasPrefix(source, WorkspaceSourceContainer) {\n\t\treturn &WorkspaceSource{\n\t\t\tContainer: strings.TrimPrefix(source, WorkspaceSourceContainer),\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (w *Workspace) IsPro() bool {\n\treturn w.Pro != nil\n}\n"
  },
  {
    "path": "pkg/random/random.go",
    "content": "package random\n\nimport \"math/rand\"\n\nvar letterRunes = []rune(\"abcdefghijklmnopqrstuvwxyz\")\n\n// String creates a new random string with the given length\nfunc String(length int) string {\n\tb := make([]rune, length)\n\tfor i := range b {\n\t\tb[i] = letterRunes[rand.Intn(len(letterRunes))]\n\t}\n\treturn string(b)\n}\n\nfunc InRange(min, max int) int {\n\treturn rand.Intn(max-min) + min\n}\n"
  },
  {
    "path": "pkg/shell/shell.go",
    "content": "package shell\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/pkg/errors\"\n\t\"mvdan.cc/sh/v3/expand\"\n\t\"mvdan.cc/sh/v3/interp\"\n\t\"mvdan.cc/sh/v3/syntax\"\n)\n\nfunc RunEmulatedShell(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, env []string) error {\n\tcommand = strings.ReplaceAll(command, \"\\r\", \"\")\n\n\t// Let's parse the complete command\n\tparsed, err := syntax.NewParser().Parse(strings.NewReader(command), \"\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"parse shell command\")\n\t}\n\n\t// use system default as environ if unspecified\n\tif env == nil {\n\t\tenv = []string{}\n\t\tenv = append(env, os.Environ()...)\n\t}\n\n\t// Get current working directory\n\tdir, err := os.Getwd()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create options\n\tdefaultOpenHandler := interp.DefaultOpenHandler()\n\tdefaultExecHandler := interp.DefaultExecHandler(2 * time.Second)\n\toptions := []interp.RunnerOption{\n\t\tinterp.StdIO(stdin, stdout, stderr),\n\t\tinterp.Env(expand.ListEnviron(env...)),\n\t\tinterp.Dir(dir),\n\t\tinterp.ExecHandler(func(ctx context.Context, args []string) error {\n\t\t\treturn defaultExecHandler(ctx, args)\n\t\t}),\n\t\tinterp.OpenHandler(func(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) {\n\t\t\tif path == \"/dev/null\" {\n\t\t\t\treturn devNull{}, nil\n\t\t\t}\n\n\t\t\treturn defaultOpenHandler(ctx, path, flag, perm)\n\t\t}),\n\t}\n\n\t// Create shell runner\n\tr, err := interp.New(options...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create shell runner\")\n\t}\n\n\t// Run command\n\terr = r.Run(ctx, parsed)\n\tif err != nil {\n\t\tif status, ok := interp.IsExitStatus(err); ok && status == 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nvar _ io.ReadWriteCloser = devNull{}\n\ntype devNull struct{}\n\nfunc (devNull) Read(_ []byte) (int, error) {\n\treturn 0, io.EOF\n}\n\nfunc (devNull) Write(p []byte) (int, error) {\n\treturn len(p), nil\n}\n\nfunc (devNull) Close() error {\n\treturn nil\n}\n\nfunc GetShell(userName string) ([]string, error) {\n\t// try to get a shell\n\tif runtime.GOOS != \"windows\" {\n\t\t// infere login shell from getent\n\t\tshell, err := getUserShell(userName)\n\t\tif err == nil {\n\t\t\treturn []string{shell}, nil\n\t\t}\n\n\t\t// fallback to $SHELL env var\n\t\tshell, ok := os.LookupEnv(\"SHELL\")\n\t\tif ok {\n\t\t\treturn []string{shell}, nil\n\t\t}\n\n\t\t// fallback to path discovery\n\t\t_, err = exec.LookPath(\"bash\")\n\t\tif err == nil {\n\t\t\treturn []string{\"bash\"}, nil\n\t\t}\n\n\t\t_, err = exec.LookPath(\"sh\")\n\t\tif err == nil {\n\t\t\treturn []string{\"sh\"}, nil\n\t\t}\n\t}\n\n\t// fallback to our in-built shell\n\texecutable, err := os.Executable()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn []string{executable, \"helper\", \"sh\"}, nil\n}\n\nfunc getUserShell(userName string) (string, error) {\n\tcurrentUser, err := findUser(userName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\toutput, err := exec.Command(\"getent\", \"passwd\", currentUser.Username).Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tshell := strings.Split(string(output), \":\")\n\tif len(shell) != 7 {\n\t\treturn \"\", fmt.Errorf(\"unexpected getent format: %s\", string(output))\n\t}\n\n\tloginShell := strings.TrimSpace(filepath.Base(shell[6]))\n\tif loginShell == \"nologin\" {\n\t\treturn \"\", fmt.Errorf(\"no login shell configured\")\n\t}\n\n\treturn loginShell, nil\n}\n\nfunc findUser(userName string) (*user.User, error) {\n\tif userName != \"\" {\n\t\tu, err := user.Lookup(userName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn u, nil\n\t}\n\n\treturn user.Current()\n}\n"
  },
  {
    "path": "pkg/single/single.go",
    "content": "package single\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/gofrs/flock\"\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/pkg/errors\"\n)\n\ntype CreateCommand func() (*exec.Cmd, error)\n\nfunc Single(file string, createCommand CreateCommand) error {\n\tfile = filepath.Join(os.TempDir(), file)\n\tfileLock := flock.New(file + \".lock\")\n\tlocked, err := fileLock.TryLock()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"acquire lock\")\n\t} else if !locked {\n\t\treturn nil\n\t}\n\tdefer func(fileLock *flock.Flock) {\n\t\t_ = fileLock.Unlock()\n\t}(fileLock)\n\n\t// check if marker file is there\n\tpid, err := os.ReadFile(file)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t// check if process id exists\n\t\tisRunning, err := command.IsRunning(string(pid))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if isRunning {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// create command\n\tcmd, err := createCommand()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// pipe streams into file.streams\n\tf, err := os.Create(file + \".streams\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif cmd.Stderr == nil {\n\t\tcmd.Stderr = f\n\t}\n\tif cmd.Stdout == nil {\n\t\tcmd.Stdout = f\n\t}\n\n\t// start process\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait until we have a process id\n\tfor cmd.Process.Pid < 0 {\n\t\ttime.Sleep(time.Millisecond)\n\t}\n\n\t// write pid to file\n\terr = os.WriteFile(file, []byte(strconv.Itoa(cmd.Process.Pid)), os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// release process resources\n\terr = cmd.Process.Release()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ssh/agent/agent_unix.go",
    "content": "//go:build !windows\n\npackage agent\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/crypto/ssh\"\n\tgosshagent \"golang.org/x/crypto/ssh/agent\"\n)\n\nfunc GetSSHAuthSocket() string {\n\tsshAuthSocket := os.Getenv(\"SSH_AUTH_SOCK\")\n\tif sshAuthSocket != \"\" {\n\t\treturn sshAuthSocket\n\t}\n\n\treturn \"\"\n}\n\nfunc ForwardToRemote(client *ssh.Client, addr string) error {\n\treturn gosshagent.ForwardToRemote(client, addr)\n}\n\nfunc RequestAgentForwarding(session *ssh.Session) error {\n\treturn gosshagent.RequestAgentForwarding(session)\n}\n"
  },
  {
    "path": "pkg/ssh/agent/agent_windows.go",
    "content": "package agent\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/pkg/errors\"\n\t\"golang.org/x/crypto/ssh\"\n\tgosshagent \"golang.org/x/crypto/ssh/agent\"\n\t\"gopkg.in/natefinch/npipe.v2\"\n)\n\nconst (\n\tchannelType      = \"auth-agent@openssh.com\"\n\tdefaultNamedPipe = \"\\\\\\\\.\\\\pipe\\\\openssh-ssh-agent\"\n)\n\n/*\n * Cygwin/MSYS2 `SSH_AUTH_SOCK` implementations from ssh-agent(1) are performed using an\n * emulated socket rather than a true AF_UNIX socket. As such, those implementations are\n * incompatible and a user should either utilize the Win32-OpenSSH implementation found\n * in Windows 10/11 or utilize another alternative that support valid AF_UNIX sockets.\n */\nfunc GetSSHAuthSocket() string {\n\tsshAuthSocket := os.Getenv(\"SSH_AUTH_SOCK\")\n\tif sshAuthSocket != \"\" {\n\t\treturn sshAuthSocket\n\t}\n\tif _, err := os.Stat(defaultNamedPipe); err == nil {\n\t\treturn defaultNamedPipe\n\t}\n\n\treturn \"\"\n}\n\nfunc ForwardToRemote(client *ssh.Client, addr string) error {\n\tif strings.Contains(addr, \"\\\\\\\\.\\\\pipe\\\\\") {\n\t\tchannels := client.HandleChannelOpen(channelType)\n\t\tif channels == nil {\n\t\t\treturn errors.New(\"agent: already have handler for \" + channelType)\n\t\t}\n\t\tconn, err := npipe.Dial(addr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tconn.Close()\n\n\t\tgo func() {\n\t\t\tfor ch := range channels {\n\t\t\t\tchannel, reqs, err := ch.Accept()\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tgo ssh.DiscardRequests(reqs)\n\t\t\t\tgo forwardNamedPipe(channel, addr)\n\t\t\t}\n\t\t}()\n\t\treturn nil\n\t}\n\treturn gosshagent.ForwardToRemote(client, addr)\n}\n\nfunc RequestAgentForwarding(session *ssh.Session) error {\n\treturn gosshagent.RequestAgentForwarding(session)\n}\n\nfunc forwardNamedPipe(channel ssh.Channel, addr string) {\n\tconn, err := npipe.Dial(addr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar wg sync.WaitGroup\n\twg.Add(2)\n\tgo func() {\n\t\tio.Copy(conn, channel)\n\t\twg.Done()\n\t}()\n\tgo func() {\n\t\tio.Copy(channel, conn)\n\t\tchannel.CloseWrite()\n\t\twg.Done()\n\t}()\n\n\twg.Wait()\n\tconn.Close()\n\tchannel.Close()\n}\n"
  },
  {
    "path": "pkg/ssh/config.go",
    "content": "package ssh\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/scanner\"\n\t\"github.com/pkg/errors\"\n)\n\nvar configLock sync.Mutex\n\nvar (\n\tMarkerStartPrefix = \"# DevPod Start \"\n\tMarkerEndPrefix   = \"# DevPod End \"\n)\n\nfunc ConfigureSSHConfig(sshConfigPath, context, workspace, user, workdir string, gpgagent bool, devPodHome string, log log.Logger) error {\n\treturn configureSSHConfigSameFile(sshConfigPath, context, workspace, user, workdir, \"\", gpgagent, devPodHome, log)\n}\n\nfunc configureSSHConfigSameFile(sshConfigPath, context, workspace, user, workdir, command string, gpgagent bool, devPodHome string, log log.Logger) error {\n\tconfigLock.Lock()\n\tdefer configLock.Unlock()\n\n\tnewFile, err := addHost(sshConfigPath, workspace+\".\"+\"devpod\", user, context, workspace, workdir, command, gpgagent, devPodHome)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"parse ssh config\")\n\t}\n\n\treturn writeSSHConfig(sshConfigPath, newFile, log)\n}\n\ntype DevPodSSHEntry struct {\n\tHost      string\n\tUser      string\n\tWorkspace string\n}\n\nfunc addHost(path, host, user, context, workspace, workdir, command string, gpgagent bool, devPodHome string) (string, error) {\n\tnewConfig, err := removeFromConfig(path, host)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// get path to executable\n\texecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn addHostSection(newConfig, execPath, host, user, context, workspace, workdir, command, gpgagent, devPodHome)\n}\n\nfunc addHostSection(config, execPath, host, user, context, workspace, workdir, command string, gpgagent bool, devPodHome string) (string, error) {\n\tnewLines := []string{}\n\t// add new section\n\tstartMarker := MarkerStartPrefix + host\n\tendMarker := MarkerEndPrefix + host\n\tnewLines = append(newLines, startMarker)\n\tnewLines = append(newLines, \"Host \"+host)\n\tnewLines = append(newLines, \"  ForwardAgent yes\")\n\tnewLines = append(newLines, \"  LogLevel error\")\n\tnewLines = append(newLines, \"  StrictHostKeyChecking no\")\n\tnewLines = append(newLines, \"  UserKnownHostsFile /dev/null\")\n\tnewLines = append(newLines, \"  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\")\n\n\tproxyCommand := \"\"\n\tif command != \"\" {\n\t\tproxyCommand = fmt.Sprintf(\"  ProxyCommand \\\"%s\\\"\", command)\n\t} else {\n\t\tproxyCommand = fmt.Sprintf(\"  ProxyCommand \\\"%s\\\" ssh --stdio --context %s --user %s %s\", execPath, context, user, workspace)\n\t}\n\n\tif devPodHome != \"\" {\n\t\tproxyCommand = fmt.Sprintf(\"%s --devpod-home \\\"%s\\\"\", proxyCommand, devPodHome)\n\t}\n\tif workdir != \"\" {\n\t\tproxyCommand = fmt.Sprintf(\"%s --workdir \\\"%s\\\"\", proxyCommand, workdir)\n\t}\n\tif gpgagent {\n\t\tproxyCommand = fmt.Sprintf(\"%s --gpg-agent-forwarding\", proxyCommand)\n\t}\n\tnewLines = append(newLines, proxyCommand)\n\tnewLines = append(newLines, \"  User \"+user)\n\tnewLines = append(newLines, endMarker)\n\n\t// now we append the original config\n\t// keep our blocks on top of the hosts for priority reasons, but below any includes\n\tlineNumber := 0\n\tfound := false\n\tlines := []string{}\n\tcommentLines := 0\n\tscanner := bufio.NewScanner(strings.NewReader(config))\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\t// Check `Host` keyword\n\t\tif strings.HasPrefix(strings.TrimSpace(line), \"Host\") && !found {\n\t\t\tfound = true\n\t\t\tlineNumber = max(lineNumber-commentLines, 0)\n\t\t}\n\n\t\t// Preserve comments\n\t\tif strings.HasPrefix(strings.TrimSpace(line), \"#\") {\n\t\t\tcommentLines++\n\t\t} else {\n\t\t\tcommentLines = 0\n\t\t}\n\n\t\tif !found {\n\t\t\tlineNumber++\n\t\t}\n\n\t\tlines = append(lines, line)\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn config, err\n\t}\n\n\tlines = slices.Insert(lines, lineNumber, newLines...)\n\n\tnewLineSep := \"\\n\"\n\tif runtime.GOOS == \"windows\" {\n\t\tnewLineSep = \"\\r\\n\"\n\t}\n\n\treturn strings.Join(lines, newLineSep), nil\n}\n\nfunc GetUser(workspaceID string, sshConfigPath string) (string, error) {\n\tpath, err := ResolveSSHConfigPath(sshConfigPath)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"Invalid ssh config path\")\n\t}\n\tsshConfigPath = path\n\n\tuser := \"root\"\n\t_, err = transformHostSection(sshConfigPath, workspaceID+\".\"+\"devpod\", func(line string) string {\n\t\tsplitted := strings.Split(strings.ToLower(strings.TrimSpace(line)), \" \")\n\t\tif len(splitted) == 2 && splitted[0] == \"user\" {\n\t\t\tuser = strings.Trim(splitted[1], \"\\\"\")\n\t\t}\n\n\t\treturn line\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn user, nil\n}\n\nfunc RemoveFromConfig(workspaceID string, sshConfigPath string, log log.Logger) error {\n\tconfigLock.Lock()\n\tdefer configLock.Unlock()\n\n\tnewFile, err := removeFromConfig(sshConfigPath, workspaceID+\".\"+\"devpod\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"parse ssh config\")\n\t}\n\n\treturn writeSSHConfig(sshConfigPath, newFile, log)\n}\n\nfunc writeSSHConfig(path, content string, log log.Logger) error {\n\terr := os.MkdirAll(filepath.Dir(path), 0755)\n\tif err != nil {\n\t\tlog.Debugf(\"error creating ssh directory: %v\", err)\n\t}\n\n\terr = os.WriteFile(path, []byte(content), 0600)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"write ssh config\")\n\t}\n\n\treturn nil\n}\n\nfunc ResolveSSHConfigPath(sshConfigPath string) (string, error) {\n\thomeDir, err := util.UserHomeDir()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"get home dir\")\n\t}\n\n\tif sshConfigPath == \"\" {\n\t\treturn filepath.Join(homeDir, \".ssh\", \"config\"), nil\n\t}\n\n\tif strings.HasPrefix(sshConfigPath, \"~/\") {\n\t\tsshConfigPath = strings.Replace(sshConfigPath, \"~\", homeDir, 1)\n\t}\n\n\treturn filepath.Abs(sshConfigPath)\n}\n\nfunc removeFromConfig(path, host string) (string, error) {\n\treturn transformHostSection(path, host, func(line string) string {\n\t\treturn \"\"\n\t})\n}\n\nfunc transformHostSection(path, host string, transform func(line string) string) (string, error) {\n\tvar reader io.Reader\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\treader = strings.NewReader(\"\")\n\t} else {\n\t\treader = f\n\t\tdefer f.Close()\n\t}\n\n\tconfigScanner := scanner.NewScanner(reader)\n\tnewLines := []string{}\n\tinSection := false\n\tstartMarker := MarkerStartPrefix + host\n\tendMarker := MarkerEndPrefix + host\n\tfor configScanner.Scan() {\n\t\ttext := configScanner.Text()\n\t\tif strings.HasPrefix(text, startMarker) {\n\t\t\tinSection = true\n\t\t} else if strings.HasPrefix(text, endMarker) {\n\t\t\tinSection = false\n\t\t} else if !inSection {\n\t\t\tnewLines = append(newLines, text)\n\t\t} else if inSection {\n\t\t\ttext = transform(text)\n\t\t\tif text != \"\" {\n\t\t\t\tnewLines = append(newLines, text)\n\t\t\t}\n\t\t}\n\t}\n\tif configScanner.Err() != nil {\n\t\treturn \"\", errors.Wrap(err, \"parse ssh config\")\n\t}\n\n\t// remove residual empty line at start file\n\tif len(newLines) > 0 && newLines[0] == \"\" {\n\t\tnewLines = newLines[1:]\n\t}\n\n\treturn strings.Join(newLines, \"\\n\"), nil\n}\n"
  },
  {
    "path": "pkg/ssh/config_test.go",
    "content": "package ssh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAddHostSection(t *testing.T) {\n\ttests := []struct {\n\t\tname       string\n\t\tconfig     string\n\t\texecPath   string\n\t\thost       string\n\t\tuser       string\n\t\tcontext    string\n\t\tworkspace  string\n\t\tworkdir    string\n\t\tcommand    string\n\t\tgpgagent   bool\n\t\tdevPodHome string\n\t\texpected   string\n\t}{\n\t\t{\n\t\t\tname:       \"Basic host addition\",\n\t\t\tconfig:     \"\",\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t\t{\n\t\t\tname:       \"Basic host addition with DEVPOD_HOME\",\n\t\t\tconfig:     \"\",\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"C:\\\\\\\\White Space\\\\devpod\\\\test\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace --devpod-home \"C:\\\\White Space\\devpod\\test\"\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t\t{\n\t\t\tname:       \"Host addition with workdir\",\n\t\t\tconfig:     \"\",\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"/path/to/workdir\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace --workdir \"/path/to/workdir\"\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t\t{\n\t\t\tname:       \"Host addition with gpg agent\",\n\t\t\tconfig:     \"\",\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   true,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace --gpg-agent-forwarding\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t\t{\n\t\t\tname:       \"Host addition with custom command\",\n\t\t\tconfig:     \"\",\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"ssh -W %h:%p bastion\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"ssh -W %h:%p bastion\"\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t\t{\n\t\t\tname: \"Host addition to existing config\",\n\t\t\tconfig: `Host existinghost\n  User existinguser`,\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost\nHost existinghost\n  User existinguser`,\n\t\t},\n\t\t{\n\t\t\tname: \"Host addition to existing config with DevPod host\",\n\t\t\tconfig: `# DevPod Start existingtesthost\nHost existingtesthost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost\n\nHost existinghost\n  User existinguser`,\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost\n# DevPod Start existingtesthost\nHost existingtesthost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost\n\nHost existinghost\n  User existinguser`,\n\t\t},\n\t\t{\n\t\t\tname: \"Host addition after top level includes\",\n\t\t\tconfig: `Include ~/config1 \n\nInclude ~/config2\n\n\n\nInclude ~/config3`,\n\t\t\texecPath:   \"/path/to/exec\",\n\t\t\thost:       \"testhost\",\n\t\t\tuser:       \"testuser\",\n\t\t\tcontext:    \"testcontext\",\n\t\t\tworkspace:  \"testworkspace\",\n\t\t\tworkdir:    \"\",\n\t\t\tcommand:    \"\",\n\t\t\tgpgagent:   false,\n\t\t\tdevPodHome: \"\",\n\t\t\texpected: `Include ~/config1 \n\nInclude ~/config2\n\n\n\nInclude ~/config3\n# DevPod Start testhost\nHost testhost\n  ForwardAgent yes\n  LogLevel error\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null\n  HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa\n  ProxyCommand \"/path/to/exec\" ssh --stdio --context testcontext --user testuser testworkspace\n  User testuser\n# DevPod End testhost`,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tresult, err := addHostSection(tt.config, tt.execPath, tt.host, tt.user, tt.context, tt.workspace, tt.workdir, tt.command, tt.gpgagent, tt.devPodHome)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Failed with err: %v\", err)\n\t\t\t}\n\n\t\t\tif result != tt.expected {\n\t\t\t\tt.Errorf(\"addHostSection result does not match expected.\\nGot:\\n%s\\nExpected:\\n%s\", result, tt.expected)\n\t\t\t\tt.Errorf(\"addHostSection result does not match expected:\\n%s\", cmp.Diff(result, tt.expected))\n\t\t\t}\n\n\t\t\tif !strings.Contains(result, MarkerEndPrefix+tt.host) {\n\t\t\t\tt.Errorf(\"Result does not contain the end marker: %s\", MarkerEndPrefix+tt.host)\n\t\t\t}\n\n\t\t\tif !strings.Contains(result, \"Host \"+tt.host) {\n\t\t\t\tt.Errorf(\"Result does not contain the Host line: Host %s\", tt.host)\n\t\t\t}\n\n\t\t\tif !strings.Contains(result, \"User \"+tt.user) {\n\t\t\t\tt.Errorf(\"Result does not contain the User line: User %s\", tt.user)\n\t\t\t}\n\n\t\t\tif tt.command != \"\" && !strings.Contains(result, fmt.Sprintf(\"ProxyCommand \\\"%s\\\"\", tt.command)) {\n\t\t\t\tt.Errorf(\"Result does not contain the custom ProxyCommand: %s\", tt.command)\n\t\t\t}\n\n\t\t\tif tt.workdir != \"\" && !strings.Contains(result, fmt.Sprintf(\"--workdir \\\"%s\\\"\", tt.workdir)) {\n\t\t\t\tt.Errorf(\"Result does not contain the workdir: %s\", tt.workdir)\n\t\t\t}\n\n\t\t\tif tt.gpgagent && !strings.Contains(result, \"--gpg-agent-forwarding\") {\n\t\t\t\tt.Errorf(\"Result does not contain gpg-agent-forwarding flag\")\n\t\t\t}\n\n\t\t\tif tt.config != \"\" && !strings.Contains(result, tt.config) {\n\t\t\t\tt.Errorf(\"Result does not contain the original config\")\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/ssh/connection_counter.go",
    "content": "package ssh\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n)\n\nfunc newConnectionCounter(ctx context.Context, timeout time.Duration, onTimeout func(), address string, log log.Logger) *connectionCounter {\n\treturn &connectionCounter{\n\t\tctx:       ctx,\n\t\taddress:   address,\n\t\ttimeout:   timeout,\n\t\tonTimeout: onTimeout,\n\t\tlog:       log,\n\t}\n}\n\ntype connectionCounter struct {\n\taddress string\n\n\tctx       context.Context\n\ttimeout   time.Duration\n\tonTimeout func()\n\tlog       log.Logger\n\n\tm           sync.Mutex\n\tconnections int\n\tgeneration  int\n}\n\nfunc (c *connectionCounter) Add() {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tc.connections++\n\tc.log.Debugf(\"New connection on %s (Total: %d)\", c.address, c.connections)\n}\n\nfunc (c *connectionCounter) Dec() {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tc.connections--\n\tc.log.Debugf(\"Closed connection on %s (Total: %d)\", c.address, c.connections)\n\tif c.connections <= 0 && c.timeout > 0 {\n\t\tc.generation++\n\n\t\tgo func(generation int) {\n\t\t\tselect {\n\t\t\tcase <-c.ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-time.After(c.timeout):\n\t\t\t\tc.m.Lock()\n\t\t\t\tdefer c.m.Unlock()\n\n\t\t\t\tif c.generation == generation && c.connections <= 0 {\n\t\t\t\t\tc.onTimeout()\n\t\t\t\t}\n\t\t\t}\n\t\t}(c.generation)\n\t}\n}\n"
  },
  {
    "path": "pkg/ssh/forward.go",
    "content": "package ssh\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype ForwardingFunction func(\n\tnet.Conn,\n\t*ssh.Client,\n\tstring,\n\tstring,\n\tlog.Logger,\n)\n\nfunc PortForward(\n\tctx context.Context,\n\tclient *ssh.Client,\n\tlocalNetwork, localAddr, remoteNetwork, remoteAddr string,\n\texitAfterTimeout time.Duration,\n\tlog log.Logger,\n) error {\n\tlistener, err := net.Listen(localNetwork, localAddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer listener.Close()\n\n\treturn portForwarding(\n\t\tctx, client, listener,\n\t\tlocalNetwork, localAddr, remoteNetwork, remoteAddr,\n\t\texitAfterTimeout, log, forward,\n\t)\n}\n\nfunc ReversePortForward(\n\tctx context.Context,\n\tclient *ssh.Client,\n\tremoteNetwork, remoteAddr, localNetwork, localAddr string,\n\texitAfterTimeout time.Duration,\n\tlog log.Logger,\n) error {\n\tlistener, err := client.Listen(remoteNetwork, remoteAddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer listener.Close()\n\n\treturn portForwarding(\n\t\tctx, client, listener,\n\t\tremoteNetwork, remoteAddr, localNetwork, localAddr,\n\t\texitAfterTimeout, log, reverseForward,\n\t)\n}\n\nfunc portForwarding(\n\tctx context.Context,\n\tclient *ssh.Client,\n\tlistener net.Listener,\n\tsrcNetwork, srcAddr, dstNetwork, dstAddr string,\n\texitAfterTimeout time.Duration,\n\tlog log.Logger,\n\tforwardFn ForwardingFunction,\n) error {\n\tdone := make(chan struct{})\n\tdefer close(done)\n\n\tgo func() {\n\t\tselect {\n\t\tcase <-done:\n\t\tcase <-ctx.Done():\n\t\t\t_ = listener.Close()\n\t\t}\n\t}()\n\n\tcounter := newConnectionCounter(ctx, exitAfterTimeout, func() {\n\t\tlog.Fatal(\"Stopping devpod up, because it stayed idle for a while. You can disable this via 'devpod context set-options -o EXIT_AFTER_TIMEOUT=false'\")\n\t}, srcAddr, log)\n\tfor {\n\t\t// waiting for a new connection\n\t\tconnection, err := listener.Accept()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// tell the counter there is a connection\n\t\tcounter.Add()\n\n\t\t// forward connection\n\t\tgo func() {\n\t\t\tdefer counter.Dec()\n\n\t\t\tforwardFn(connection, client, dstNetwork, dstAddr, log)\n\t\t}()\n\t}\n}\n\nfunc forward(\n\tlocalConn net.Conn,\n\tclient *ssh.Client,\n\tremoteNetwork, remoteAddr string,\n\tlog log.Logger,\n) {\n\t// Setup sshConn (type net.Conn)\n\tsshConn, err := client.Dial(remoteNetwork, remoteAddr)\n\tif err != nil {\n\t\tlog.Debugf(\"error dialing remote: %v\", err)\n\t\treturn\n\t}\n\tdefer sshConn.Close()\n\n\t// Copy localConn.Reader to sshConn.Writer\n\twaitGroup := sync.WaitGroup{}\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\t\tdefer sshConn.Close()\n\n\t\t_, err = io.Copy(sshConn, localConn)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error copying to remote: %v\", err)\n\t\t}\n\t}()\n\twaitGroup.Add(1)\n\n\t// Copy sshConn.Reader to localConn.Writer\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\t\tdefer localConn.Close()\n\n\t\t_, err = io.Copy(localConn, sshConn)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error copying to local: %v\", err)\n\t\t}\n\t}()\n\twaitGroup.Add(1)\n\twaitGroup.Wait()\n}\n\nfunc reverseForward(\n\tremoteConn net.Conn,\n\tclient *ssh.Client,\n\tlocalNetwork, localAddr string,\n\tlog log.Logger,\n) {\n\t// Setup localConn (type net.Conn)\n\tlocalConn, err := net.Dial(localNetwork, localAddr)\n\tif err != nil {\n\t\tlog.Debugf(\"error dialing remote: %v\", err)\n\t\treturn\n\t}\n\tdefer localConn.Close()\n\n\t// Copy localConn.Reader to sshConn.Writer\n\twaitGroup := sync.WaitGroup{}\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\t\tdefer localConn.Close()\n\n\t\t_, err = io.Copy(localConn, remoteConn)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error copying to local: %v\", err)\n\t\t}\n\t}()\n\twaitGroup.Add(1)\n\n\t// Copy sshConn.Reader to localConn.Writer\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\t\tdefer remoteConn.Close()\n\n\t\t_, err = io.Copy(remoteConn, localConn)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"error copying to remote: %v\", err)\n\t\t}\n\t}()\n\twaitGroup.Add(1)\n\twaitGroup.Wait()\n}\n"
  },
  {
    "path": "pkg/ssh/helper.go",
    "content": "package ssh\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/pkg/stdio\"\n\t\"github.com/pkg/errors\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc NewSSHPassClient(user, addr, password string) (*ssh.Client, error) {\n\tclientConfig := &ssh.ClientConfig{\n\t\tAuth:            []ssh.AuthMethod{},\n\t\tHostKeyCallback: ssh.InsecureIgnoreHostKey(),\n\t}\n\n\tclientConfig.Auth = append(clientConfig.Auth, ssh.Password(password))\n\n\tif user != \"\" {\n\t\tclientConfig.User = user\n\t}\n\n\tclient, err := ssh.Dial(\"tcp\", addr, clientConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dial to %v failed: %w\", addr, err)\n\t}\n\n\treturn client, nil\n}\n\nfunc NewSSHClient(user, addr string, keyBytes []byte) (*ssh.Client, error) {\n\tsshConfig, err := ConfigFromKeyBytes(keyBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif user != \"\" {\n\t\tsshConfig.User = user\n\t}\n\n\tclient, err := ssh.Dial(\"tcp\", addr, sshConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dial to %v failed: %w\", addr, err)\n\t}\n\n\treturn client, nil\n}\n\nfunc StdioClient(reader io.Reader, writer io.WriteCloser, exitOnClose bool) (*ssh.Client, error) {\n\treturn StdioClientFromKeyBytesWithUser(nil, reader, writer, \"\", exitOnClose)\n}\n\nfunc StdioClientWithUser(reader io.Reader, writer io.WriteCloser, user string, exitOnClose bool) (*ssh.Client, error) {\n\treturn StdioClientFromKeyBytesWithUser(nil, reader, writer, user, exitOnClose)\n}\n\nfunc StdioClientFromKeyBytesWithUser(keyBytes []byte, reader io.Reader, writer io.WriteCloser, user string, exitOnClose bool) (*ssh.Client, error) {\n\tconn := stdio.NewStdioStream(reader, writer, exitOnClose, 0)\n\tclientConfig, err := ConfigFromKeyBytes(keyBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclientConfig.User = user\n\tc, chans, req, err := ssh.NewClientConn(conn, \"stdio\", clientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ssh.NewClient(c, chans, req), nil\n}\n\nfunc ConfigFromKeyBytes(keyBytes []byte) (*ssh.ClientConfig, error) {\n\tclientConfig := &ssh.ClientConfig{\n\t\tAuth:            []ssh.AuthMethod{},\n\t\tHostKeyCallback: ssh.InsecureIgnoreHostKey(),\n\t}\n\n\t// key file authentication?\n\tif len(keyBytes) > 0 {\n\t\tsigner, err := ssh.ParsePrivateKey(keyBytes)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"parse private key\")\n\t\t}\n\n\t\tclientConfig.Auth = append(clientConfig.Auth, ssh.PublicKeys(signer))\n\t}\n\treturn clientConfig, nil\n}\n\nfunc Run(ctx context.Context, client *ssh.Client, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, envVars map[string]string) error {\n\tsess, err := client.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sess.Close()\n\n\tfor k, v := range envVars {\n\t\terr = sess.Setenv(k, v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\texit := make(chan struct{})\n\tdefer close(exit)\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\t_ = sess.Signal(ssh.SIGINT)\n\t\t\t_ = sess.Close()\n\t\tcase <-exit:\n\t\t}\n\t}()\n\n\tsess.Stdin = stdin\n\tsess.Stdout = stdout\n\tsess.Stderr = stderr\n\terr = sess.Run(command)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ssh/keys.go",
    "content": "package ssh\n\nimport (\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/base64\"\n\t\"encoding/pem\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\n\t\"github.com/pkg/errors\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nvar (\n\tDevPodSSHHostKeyFile    = \"id_devpod_rsa_host\"\n\tDevPodSSHPrivateKeyFile = \"id_devpod_rsa\"\n\tDevPodSSHPublicKeyFile  = \"id_devpod_rsa.pub\"\n)\n\nvar keyLock sync.Mutex\n\nfunc rsaKeyGen() (privateKey string, publicKey string, err error) {\n\tprivateKeyRaw, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn \"\", \"\", errors.Errorf(\"generate private key: %v\", err)\n\t}\n\n\treturn generateKeys(pem.Block{\n\t\tType:  \"RSA PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(privateKeyRaw),\n\t}, privateKeyRaw)\n}\n\nfunc generateKeys(block pem.Block, cp crypto.Signer) (privateKey string, publicKey string, err error) {\n\tpkBytes := pem.EncodeToMemory(&block)\n\tprivateKey = string(pkBytes)\n\n\tpublicKeyRaw := cp.Public()\n\tp, err := ssh.NewPublicKey(publicKeyRaw)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tpublicKey = string(ssh.MarshalAuthorizedKey(p))\n\n\treturn privateKey, publicKey, nil\n}\n\nfunc makeHostKey() (string, error) {\n\tprivKey, _, err := rsaKeyGen()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn privKey, err\n}\n\nfunc makeSSHKeyPair() (string, string, error) {\n\tprivKey, pubKey, err := rsaKeyGen()\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\treturn pubKey, privKey, err\n}\n\nfunc GetPrivateKeyRaw(context, workspaceID string) ([]byte, error) {\n\tworkspaceDir, err := provider.GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn GetPrivateKeyRawBase(workspaceDir)\n}\n\nfunc GetDevPodKeysDir() string {\n\tdir, err := util.UserHomeDir()\n\tif err == nil {\n\t\ttempDir := filepath.Join(dir, \".devpod\", \"keys\")\n\t\terr = os.MkdirAll(tempDir, 0755)\n\t\tif err == nil {\n\t\t\treturn tempDir\n\t\t}\n\t}\n\n\ttempDir := os.TempDir()\n\treturn filepath.Join(tempDir, \"devpod-ssh\")\n}\n\nfunc GetDevPodHostKey() (string, error) {\n\ttempDir := GetDevPodKeysDir()\n\treturn GetHostKeyBase(tempDir)\n}\n\nfunc GetDevPodPublicKey() (string, error) {\n\ttempDir := GetDevPodKeysDir()\n\treturn GetPublicKeyBase(tempDir)\n}\n\nfunc GetDevPodPrivateKeyRaw() ([]byte, error) {\n\ttempDir := GetDevPodKeysDir()\n\treturn GetPrivateKeyRawBase(tempDir)\n}\n\nfunc GetHostKey(context, workspaceID string) (string, error) {\n\tworkspaceDir, err := provider.GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn GetHostKeyBase(workspaceDir)\n}\n\nfunc GetPrivateKeyRawBase(dir string) ([]byte, error) {\n\tkeyLock.Lock()\n\tdefer keyLock.Unlock()\n\n\terr := os.MkdirAll(dir, 0755)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check if key pair exists\n\tprivateKeyFile := filepath.Join(dir, DevPodSSHPrivateKeyFile)\n\tpublicKeyFile := filepath.Join(dir, DevPodSSHPublicKeyFile)\n\t_, err = os.Stat(privateKeyFile)\n\tif err != nil {\n\t\tpubKey, privateKey, err := makeSSHKeyPair()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"generate key pair\")\n\t\t}\n\n\t\terr = os.WriteFile(publicKeyFile, []byte(pubKey), 0644)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"write public ssh key\")\n\t\t}\n\n\t\terr = os.WriteFile(privateKeyFile, []byte(privateKey), 0600)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"write private ssh key\")\n\t\t}\n\t}\n\n\t// read private key\n\tout, err := os.ReadFile(privateKeyFile)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"read private ssh key\")\n\t}\n\n\treturn out, nil\n}\n\nfunc GetHostKeyBase(dir string) (string, error) {\n\tkeyLock.Lock()\n\tdefer keyLock.Unlock()\n\n\terr := os.MkdirAll(dir, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// check if key pair exists\n\thostKeyFile := filepath.Join(dir, DevPodSSHHostKeyFile)\n\t_, err = os.Stat(hostKeyFile)\n\tif err != nil {\n\t\tprivateKey, err := makeHostKey()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"generate host key\")\n\t\t}\n\n\t\terr = os.WriteFile(hostKeyFile, []byte(privateKey), 0600)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"write host key\")\n\t\t}\n\t}\n\n\t// read public key\n\tout, err := os.ReadFile(hostKeyFile)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"read host ssh key\")\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(out), nil\n}\n\nfunc GetPublicKeyBase(dir string) (string, error) {\n\tkeyLock.Lock()\n\tdefer keyLock.Unlock()\n\n\terr := os.MkdirAll(dir, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// check if key pair exists\n\tprivateKeyFile := filepath.Join(dir, DevPodSSHPrivateKeyFile)\n\tpublicKeyFile := filepath.Join(dir, DevPodSSHPublicKeyFile)\n\t_, err = os.Stat(privateKeyFile)\n\tif err != nil {\n\t\tpubKey, privateKey, err := makeSSHKeyPair()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"generate key pair\")\n\t\t}\n\n\t\terr = os.WriteFile(publicKeyFile, []byte(pubKey), 0644)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"write public ssh key\")\n\t\t}\n\n\t\terr = os.WriteFile(privateKeyFile, []byte(privateKey), 0600)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"write private ssh key\")\n\t\t}\n\t}\n\n\t// read public key\n\tout, err := os.ReadFile(publicKeyFile)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"read public ssh key\")\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(out), nil\n}\n\nfunc GetPublicKey(context, workspaceID string) (string, error) {\n\tworkspaceDir, err := provider.GetWorkspaceDir(context, workspaceID)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn GetPublicKeyBase(workspaceDir)\n}\n"
  },
  {
    "path": "pkg/ssh/server/agent.go",
    "content": "package server\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/ssh\"\n)\n\nfunc setupAgentListener(sess ssh.Session, reuseSock string) (net.Listener, string, error) {\n\t// on some systems (like containers) /tmp may not exists, this ensures\n\t// that we have a compliant directory structure\n\terr := os.MkdirAll(\"/tmp\", 0o777)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"create /tmp dir: %w\", err)\n\t}\n\n\t// Check if we should create a \"shared\" socket to be reused by clients\n\t// used for browser tunnels such as openvscode, since the IDE itself doesn't create an SSH connection it uses a \"backhaul\" connection and uses the existing socket\n\tdir := \"\"\n\tif reuseSock != \"\" {\n\t\tdir = filepath.Join(os.TempDir(), fmt.Sprintf(\"auth-agent-%s\", reuseSock))\n\t\terr = os.MkdirAll(dir, 0777)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"creating SSH_AUTH_SOCK dir in /tmp: %w\", err)\n\t\t}\n\t}\n\n\tl, tmpDir, err := ssh.NewAgentListener(dir)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"new agent listener: %w\", err)\n\t}\n\n\treturn l, tmpDir, nil\n}\n"
  },
  {
    "path": "pkg/ssh/server/exec.go",
    "content": "package server\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n\tperrors \"github.com/pkg/errors\"\n)\n\nfunc execNonPTY(sess ssh.Session, cmd *exec.Cmd, log log.Logger) (err error) {\n\tlog.Debugf(\"Execute SSH server command: %s\", strings.Join(cmd.Args, \" \"))\n\t// init pipes\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// start the command\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"start command\")\n\t}\n\n\tgo func() {\n\t\tdefer stdin.Close()\n\n\t\t_, err := io.Copy(stdin, sess)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error piping stdin: %v\", err)\n\t\t}\n\t}()\n\n\twaitGroup := sync.WaitGroup{}\n\twaitGroup.Add(1)\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\n\t\t_, err := io.Copy(sess, stdout)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error piping stdout: %v\", err)\n\t\t}\n\t}()\n\n\twaitGroup.Add(1)\n\tgo func() {\n\t\tdefer waitGroup.Done()\n\n\t\t_, err := io.Copy(sess.Stderr(), stderr)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error piping stderr: %v\", err)\n\t\t}\n\t}()\n\n\twaitGroup.Wait()\n\terr = cmd.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc execPTY(\n\tsess ssh.Session,\n\tptyReq ssh.Pty,\n\twinCh <-chan ssh.Window,\n\tcmd *exec.Cmd,\n\tlog log.Logger,\n) (err error) {\n\tlog.Debugf(\"Execute SSH server PTY command: %s\", strings.Join(cmd.Args, \" \"))\n\n\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"TERM=%s\", ptyReq.Term))\n\tf, err := startPTY(cmd)\n\tif err != nil {\n\t\treturn perrors.Wrap(err, \"start pty\")\n\t}\n\tdefer f.Close()\n\n\tgo func() {\n\t\tfor win := range winCh {\n\t\t\tsetWinSize(f, win.Width, win.Height)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer f.Close()\n\n\t\t// copy stdin\n\t\t_, _ = io.Copy(f, sess)\n\t}()\n\n\tstdoutDoneChan := make(chan struct{})\n\tgo func() {\n\t\tdefer f.Close()\n\t\tdefer close(stdoutDoneChan)\n\n\t\t// copy stdout\n\t\t_, _ = io.Copy(sess, f)\n\t}()\n\n\terr = cmd.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tselect {\n\tcase <-stdoutDoneChan:\n\tcase <-time.After(time.Second):\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ssh/server/exit.go",
    "content": "package server\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n\tperrors \"github.com/pkg/errors\"\n)\n\nfunc exitWithError(sess ssh.Session, err error, log log.Logger) {\n\tif err != nil {\n\t\tvar exitError *exec.ExitError\n\t\tif !errors.As(perrors.Cause(err), &exitError) {\n\t\t\tlog.Errorf(\"Exit error: %v\", err)\n\t\t\tmsg := strings.TrimPrefix(err.Error(), \"exec: \")\n\t\t\tif _, err := sess.Stderr().Write([]byte(msg)); err != nil {\n\t\t\t\tlog.Errorf(\"failed to write error to session: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// always exit session\n\terr = sess.Exit(exitCode(err))\n\tif err != nil {\n\t\tlog.Errorf(\"session failed to exit: %v\", err)\n\t}\n}\n\nfunc exitCode(err error) int {\n\terr = perrors.Cause(err)\n\tif err == nil {\n\t\treturn 0\n\t}\n\n\tvar exitErr *exec.ExitError\n\tif !errors.As(err, &exitErr) {\n\t\treturn 1\n\t}\n\n\treturn exitErr.ExitCode()\n}\n"
  },
  {
    "path": "pkg/ssh/server/port/port.go",
    "content": "package port\n\nimport (\n\t\"net\"\n\t\"time\"\n)\n\nfunc IsAvailable(addr string) (bool, error) {\n\ttimeout := time.Millisecond * 500\n\tconn, err := net.DialTimeout(\"tcp\", addr, timeout)\n\tif err != nil {\n\t\t// Try to create a server with the port\n\t\tserver, err := net.Listen(\"tcp\", addr)\n\n\t\t// if it fails then the port is likely taken\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// close the server\n\t\t_ = server.Close()\n\t\treturn true, nil\n\t}\n\t_ = conn.Close()\n\treturn false, nil\n}\n"
  },
  {
    "path": "pkg/ssh/server/pty_supported.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage server\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/creack/pty\"\n)\n\nfunc startPTY(cmd *exec.Cmd) (*os.File, error) {\n\treturn pty.Start(cmd)\n}\n\nfunc setWinSize(f *os.File, w, h int) {\n\t_, _, _ = syscall.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(syscall.TIOCSWINSZ),\n\t\tuintptr(unsafe.Pointer(&struct{ h, w, x, y uint16 }{uint16(h), uint16(w), 0, 0})))\n}\n"
  },
  {
    "path": "pkg/ssh/server/pty_unsupported.go",
    "content": "//go:build windows\n// +build windows\n\npackage server\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc startPTY(cmd *exec.Cmd) (*os.File, error) {\n\treturn nil, fmt.Errorf(\"pty is currently not supported on windows\")\n}\n\nfunc setWinSize(f *os.File, w, h int) {\n\n}\n"
  },
  {
    "path": "pkg/ssh/server/sftp_handler.go",
    "content": "package server\n\nimport (\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n\t\"github.com/pkg/sftp\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc sftpHandler(sess ssh.Session, currentUser string, log log.Logger) {\n\twriter := log.Writer(logrus.DebugLevel, false)\n\tdefer writer.Close()\n\n\tuser := sess.User()\n\tif user == currentUser {\n\t\tuser = \"\"\n\t}\n\n\tworkingDir, _ := command.GetHome(user)\n\tserverOptions := []sftp.ServerOption{\n\t\tsftp.WithDebug(writer),\n\t\tsftp.WithServerWorkingDirectory(workingDir),\n\t}\n\tserver, err := sftp.NewServer(\n\t\tsess,\n\t\tserverOptions...,\n\t)\n\tif err != nil {\n\t\tlog.Debugf(\"sftp server init error: %s\\n\", err)\n\t\treturn\n\t}\n\tdefer server.Close()\n\n\t// serve\n\terr = server.Serve()\n\tif errors.Is(err, io.EOF) {\n\t\t_ = sess.Exit(0)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\tlog.Debugf(\"sftp server completed with error: %v\", err)\n\t}\n\t_ = sess.Exit(1)\n}\n"
  },
  {
    "path": "pkg/ssh/server/ssh.go",
    "content": "package server\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\n\t\"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n)\n\nconst (\n\tDefaultPort     int = 8022\n\tDefaultUserPort int = 12023\n)\n\ntype Server interface {\n\tServe(listener net.Listener) error\n\tListenAndServe() error\n}\n\ntype server struct {\n\tcurrentUser string\n\tshell       []string\n\tworkdir     string\n\treuseSock   string\n\tsshServer   ssh.Server\n\tlog         log.Logger\n}\n\nfunc NewServer(addr string, hostKey []byte, keys []ssh.PublicKey, workdir string, reuseSock string, log log.Logger) (Server, error) {\n\tsh, err := shell.GetShell(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcurrentUser, err := user.Current()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tforwardHandler := &ssh.ForwardedTCPHandler{}\n\tforwardedUnixHandler := &ssh.ForwardedUnixHandler{}\n\tserver := &server{\n\t\tshell:       sh,\n\t\tworkdir:     workdir,\n\t\treuseSock:   reuseSock,\n\t\tlog:         log,\n\t\tcurrentUser: currentUser.Username,\n\t\tsshServer: ssh.Server{\n\t\t\tAddr: addr,\n\t\t\tLocalPortForwardingCallback: func(ctx ssh.Context, dhost string, dport uint32) bool {\n\t\t\t\tlog.Debugf(\"Accepted forward: %s:%d\", dhost, dport)\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tReversePortForwardingCallback: func(ctx ssh.Context, host string, port uint32) bool {\n\t\t\t\tlog.Debugf(\"attempt to bind %s:%d - %s\", host, port, \"granted\")\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tReverseUnixForwardingCallback: func(ctx ssh.Context, socketPath string) bool {\n\t\t\t\tlog.Debugf(\"attempt to bind socket %s\", socketPath)\n\n\t\t\t\t_, err := os.Stat(socketPath)\n\t\t\t\tif err == nil {\n\t\t\t\t\tlog.Debugf(\"%s already exists, removing\", socketPath)\n\n\t\t\t\t\t_ = os.Remove(socketPath)\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tChannelHandlers: map[string]ssh.ChannelHandler{\n\t\t\t\t\"direct-tcpip\":                   ssh.DirectTCPIPHandler,\n\t\t\t\t\"direct-streamlocal@openssh.com\": ssh.DirectStreamLocalHandler,\n\t\t\t\t\"session\":                        ssh.DefaultSessionHandler,\n\t\t\t},\n\t\t\tRequestHandlers: map[string]ssh.RequestHandler{\n\t\t\t\t\"tcpip-forward\":                          forwardHandler.HandleSSHRequest,\n\t\t\t\t\"streamlocal-forward@openssh.com\":        forwardedUnixHandler.HandleSSHRequest,\n\t\t\t\t\"cancel-streamlocal-forward@openssh.com\": forwardedUnixHandler.HandleSSHRequest,\n\t\t\t\t\"cancel-tcpip-forward\":                   forwardHandler.HandleSSHRequest,\n\t\t\t},\n\t\t\tSubsystemHandlers: map[string]ssh.SubsystemHandler{\n\t\t\t\t\"sftp\": func(s ssh.Session) {\n\t\t\t\t\tsftpHandler(s, currentUser.Username, log)\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif len(keys) > 0 {\n\t\tserver.sshServer.PublicKeyHandler = func(ctx ssh.Context, key ssh.PublicKey) bool {\n\t\t\tfor _, k := range keys {\n\t\t\t\tif ssh.KeysEqual(k, key) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlog.Debugf(\"Declined public key\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif len(hostKey) > 0 {\n\t\terr = server.sshServer.SetOption(ssh.HostKeyPEM(hostKey))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tserver.sshServer.Handler = server.handler\n\treturn server, nil\n}\n\nfunc (s *server) handler(sess ssh.Session) {\n\tvar err error\n\tptyReq, winCh, isPty := sess.Pty()\n\tcmd := s.getCommand(sess, isPty)\n\n\tif ssh.AgentRequested(sess) {\n\t\tl, tmpDir, err := setupAgentListener(sess, s.reuseSock)\n\t\tif err != nil {\n\t\t\texitWithError(sess, err, s.log)\n\t\t\treturn\n\t\t}\n\t\tdefer l.Close()\n\t\tdefer os.RemoveAll(tmpDir)\n\n\t\tgo ssh.ForwardAgentConnections(l, sess)\n\n\t\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"%s=%s\", \"SSH_AUTH_SOCK\", l.Addr().String()))\n\t}\n\n\t// start shell session\n\tif isPty {\n\t\terr = execPTY(sess, ptyReq, winCh, cmd, s.log)\n\t} else {\n\t\terr = execNonPTY(sess, cmd, s.log)\n\t}\n\n\t// exit session\n\texitWithError(sess, err, s.log)\n}\n\nfunc (s *server) getCommand(sess ssh.Session, isPty bool) *exec.Cmd {\n\tvar cmd *exec.Cmd\n\tuser := sess.User()\n\tif user == s.currentUser {\n\t\tuser = \"\"\n\t}\n\n\t// has user set?\n\tif user != \"\" {\n\t\targs := []string{}\n\n\t\t// is pty?\n\t\tif isPty {\n\t\t\targs = append(args, \"-\")\n\t\t}\n\n\t\t// add user\n\t\targs = append(args, sess.User())\n\n\t\t// is there a command?\n\t\tif len(sess.RawCommand()) > 0 {\n\t\t\targs = append(args, \"-c\", sess.RawCommand())\n\t\t}\n\n\t\tcmd = exec.Command(\"su\", args...)\n\t} else {\n\t\targs := []string{}\n\t\targs = append(args, s.shell[1:]...)\n\t\tif isPty {\n\t\t\targs = append(args, \"-l\")\n\t\t}\n\n\t\tif len(sess.RawCommand()) == 0 {\n\t\t\tcmd = exec.Command(s.shell[0], args...)\n\t\t} else {\n\t\t\targs = append(args, \"-c\", sess.RawCommand())\n\t\t\tcmd = exec.Command(s.shell[0], args...)\n\t\t}\n\t}\n\n\tcmd.Dir = findWorkdir(s.workdir, user)\n\tcmd.Env = append(cmd.Env, os.Environ()...)\n\tcmd.Env = append(cmd.Env, sess.Environ()...)\n\treturn cmd\n}\n\nfunc (s *server) Serve(listener net.Listener) error {\n\treturn s.sshServer.Serve(listener)\n}\n\nfunc (s *server) ListenAndServe() error {\n\ts.log.Debugf(\"Start ssh server on %s\", s.sshServer.Addr)\n\treturn s.sshServer.ListenAndServe()\n}\n"
  },
  {
    "path": "pkg/ssh/server/ssh_container.go",
    "content": "package server\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\n\tcopypkg \"github.com/loft-sh/devpod/pkg/copy\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\tshellpkg \"github.com/loft-sh/devpod/pkg/shell\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/ssh\"\n)\n\nfunc NewContainerServer(addr string, workdir string, log log.Logger) (Server, error) {\n\tforwardHandler := &ssh.ForwardedTCPHandler{}\n\tforwardedUnixHandler := &ssh.ForwardedUnixHandler{}\n\tserver := &containerServer{\n\t\tworkdir: workdir,\n\t\tlog:     log,\n\t\tsshServer: ssh.Server{\n\t\t\tAddr: addr,\n\t\t\tLocalPortForwardingCallback: func(ctx ssh.Context, dhost string, dport uint32) bool {\n\t\t\t\tlog.Debugf(\"Accepted forward: %s:%d\", dhost, dport)\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tReversePortForwardingCallback: func(ctx ssh.Context, host string, port uint32) bool {\n\t\t\t\tlog.Debugf(\"attempt to bind %s:%d - %s\", host, port, \"granted\")\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tReverseUnixForwardingCallback: func(ctx ssh.Context, socketPath string) bool {\n\t\t\t\tlog.Debugf(\"attempt to bind socket %s\", socketPath)\n\n\t\t\t\t_, err := os.Stat(socketPath)\n\t\t\t\tif err == nil {\n\t\t\t\t\tlog.Debugf(\"%s already exists, removing\", socketPath)\n\n\t\t\t\t\t_ = os.Remove(socketPath)\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tChannelHandlers: map[string]ssh.ChannelHandler{\n\t\t\t\t\"direct-tcpip\":                   ssh.DirectTCPIPHandler,\n\t\t\t\t\"direct-streamlocal@openssh.com\": ssh.DirectStreamLocalHandler,\n\t\t\t\t\"session\":                        ssh.DefaultSessionHandler,\n\t\t\t},\n\t\t\tRequestHandlers: map[string]ssh.RequestHandler{\n\t\t\t\t\"tcpip-forward\":                          forwardHandler.HandleSSHRequest,\n\t\t\t\t\"streamlocal-forward@openssh.com\":        forwardedUnixHandler.HandleSSHRequest,\n\t\t\t\t\"cancel-streamlocal-forward@openssh.com\": forwardedUnixHandler.HandleSSHRequest,\n\t\t\t\t\"cancel-tcpip-forward\":                   forwardHandler.HandleSSHRequest,\n\t\t\t},\n\t\t\tSubsystemHandlers: map[string]ssh.SubsystemHandler{\n\t\t\t\t\"sftp\": func(s ssh.Session) {\n\t\t\t\t\tsftpHandler(s, \"\", log)\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tserver.sshServer.Handler = server.handler\n\treturn server, nil\n}\n\ntype containerServer struct {\n\tsshServer ssh.Server\n\tlog       log.Logger\n\tworkdir   string\n}\n\nfunc (s *containerServer) Serve(listener net.Listener) error {\n\treturn s.sshServer.Serve(listener)\n}\n\nfunc (s *containerServer) ListenAndServe() error {\n\ts.log.Debugf(\"Start ssh server on %s\", s.sshServer.Addr)\n\treturn s.sshServer.ListenAndServe()\n}\n\nfunc (s *containerServer) handler(sess ssh.Session) {\n\tvar err error\n\tptyReq, winCh, isPty := sess.Pty()\n\tcmd, err := s.getCommand(sess, isPty)\n\tif err != nil {\n\t\texitWithError(sess, fmt.Errorf(\"get command: %w\", err), s.log)\n\t\treturn\n\t}\n\n\tif ssh.AgentRequested(sess) {\n\t\tl, tmpDir, err := setupAgentListener(sess, \"\")\n\t\tif err != nil {\n\t\t\texitWithError(sess, err, s.log)\n\t\t\treturn\n\t\t}\n\t\tdefer l.Close()\n\t\tdefer os.RemoveAll(tmpDir)\n\n\t\terr = chownListener(l.Addr().String(), sess.User())\n\t\tif err != nil {\n\t\t\texitWithError(sess, fmt.Errorf(\"chown listener: %w\", err), s.log)\n\t\t\treturn\n\t\t}\n\n\t\tgo ssh.ForwardAgentConnections(l, sess)\n\n\t\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"%s=%s\", \"SSH_AUTH_SOCK\", l.Addr().String()))\n\t}\n\n\tif isPty {\n\t\terr = execPTY(sess, ptyReq, winCh, cmd, s.log)\n\t} else {\n\t\terr = execNonPTY(sess, cmd, s.log)\n\t}\n\n\texitWithError(sess, err, s.log)\n}\n\nfunc (s *containerServer) getCommand(sess ssh.Session, isPty bool) (*exec.Cmd, error) {\n\tvar cmd *exec.Cmd\n\tuser := sess.User()\n\n\t// get login shell for user\n\tshell, err := shellpkg.GetShell(user)\n\tif err != nil {\n\t\treturn cmd, fmt.Errorf(\"get shell for user %s: %w\", user, err)\n\t}\n\n\targs := []string{}\n\targs = append(args, shell[1:]...)\n\tif isPty {\n\t\targs = append(args, \"-l\")\n\t}\n\n\tif len(sess.RawCommand()) == 0 {\n\t\tcmd = exec.Command(shell[0], args...)\n\t} else {\n\t\targs = append(args, \"-c\", sess.RawCommand())\n\t\tcmd = exec.Command(shell[0], args...)\n\t}\n\n\terr = config.PrepareCmdUser(cmd, user)\n\tif err != nil {\n\t\treturn cmd, fmt.Errorf(\"prepare cmd env: %w\", err)\n\t}\n\tcmd.Dir = findWorkdir(s.workdir, user)\n\tcmd.Env = append(cmd.Env, sess.Environ()...)\n\treturn cmd, nil\n}\n\nfunc chownListener(listenerPath string, user string) error {\n\terr := copypkg.Chown(filepath.Dir(listenerPath), user)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\terr = copypkg.Chown(listenerPath, user)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/ssh/server/workdir.go",
    "content": "package server\n\nimport (\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n)\n\nfunc findWorkdir(workdir string, userName string) string {\n\t// check if requested workdir exists\n\tif workdir != \"\" {\n\t\t_, err := os.Stat(workdir)\n\t\tif err == nil {\n\t\t\treturn workdir\n\t\t}\n\t}\n\n\t// fall back to home directory\n\thome, _ := command.GetHome(userName)\n\tif _, err := os.Stat(home); err == nil {\n\t\tworkdir = home\n\t}\n\n\treturn workdir\n}\n"
  },
  {
    "path": "pkg/ssh/ssh_add.go",
    "content": "package ssh\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/command\"\n\tdevsshagent \"github.com/loft-sh/devpod/pkg/ssh/agent\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n\t\"github.com/loft-sh/log\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc AddPrivateKeysToAgent(ctx context.Context, log log.Logger) error {\n\tif devsshagent.GetSSHAuthSocket() == \"\" {\n\t\treturn fmt.Errorf(\"ssh-agent is not started\")\n\t} else if !command.Exists(\"ssh-add\") {\n\t\treturn fmt.Errorf(\"ssh-add couldn't be found\")\n\t}\n\n\tprivateKeys, err := FindPrivateKeys()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, privateKey := range privateKeys {\n\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, time.Second*2)\n\t\tlog.Debugf(\"Run ssh-add %s\", privateKey)\n\t\tout, err := exec.CommandContext(timeoutCtx, \"ssh-add\", privateKey).CombinedOutput()\n\t\tcancel()\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error adding key %s to agent: %v\", privateKey, command.WrapCommandError(out, err))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc FindPrivateKeys() ([]string, error) {\n\thomeDir, err := util.UserHomeDir()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsshDir := filepath.Join(homeDir, \".ssh\")\n\tentries, err := os.ReadDir(sshDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprivateKeys := []string{}\n\tfor _, entry := range entries {\n\t\tif entry.IsDir() {\n\t\t\tcontinue\n\t\t}\n\n\t\tkeyPath := filepath.Join(sshDir, entry.Name())\n\t\tout, err := os.ReadFile(keyPath)\n\t\tif err == nil {\n\t\t\t_, err = ssh.ParsePrivateKey(out)\n\t\t\tif err == nil {\n\t\t\t\tprivateKeys = append(privateKeys, keyPath)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn privateKeys, nil\n}\n"
  },
  {
    "path": "pkg/ssh/ssh_supported.go",
    "content": "//go:build !windows\n\npackage ssh\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"os/signal\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc WatchWindowSize(ctx context.Context) <-chan os.Signal {\n\twindowSize := make(chan os.Signal, 1)\n\tsignal.Notify(windowSize, unix.SIGWINCH)\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tsignal.Stop(windowSize)\n\t}()\n\treturn windowSize\n}\n"
  },
  {
    "path": "pkg/ssh/ssh_unsupported.go",
    "content": "//go:build windows\n\npackage ssh\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc WatchWindowSize(ctx context.Context) <-chan os.Signal {\n\twindowSize := make(chan os.Signal, 3)\n\tticker := time.NewTicker(time.Second)\n\tgo func() {\n\t\tdefer ticker.Stop()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-ticker.C:\n\t\t\t}\n\t\t\twindowSize <- nil\n\t\t}\n\t}()\n\treturn windowSize\n}\n"
  },
  {
    "path": "pkg/stdio/conn.go",
    "content": "package stdio\n\nimport (\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n)\n\n// StdioStream is the struct that implements the net.Conn interface\ntype StdioStream struct {\n\tin     io.Reader\n\tout    io.WriteCloser\n\tlocal  *StdinAddr\n\tremote *StdinAddr\n\n\texitOnClose bool\n\texitCode    int\n}\n\n// NewStdioStream is used to implement the connection interface\nfunc NewStdioStream(in io.Reader, out io.WriteCloser, exitOnClose bool, exitCode int) *StdioStream {\n\treturn &StdioStream{\n\t\tlocal:       NewStdinAddr(\"local\"),\n\t\tremote:      NewStdinAddr(\"remote\"),\n\t\tin:          in,\n\t\tout:         out,\n\t\texitOnClose: exitOnClose,\n\t\texitCode:    exitCode,\n\t}\n}\n\n// LocalAddr implements interface\nfunc (s *StdioStream) LocalAddr() net.Addr {\n\treturn s.local\n}\n\n// RemoteAddr implements interface\nfunc (s *StdioStream) RemoteAddr() net.Addr {\n\treturn s.remote\n}\n\n// Read implements interface\nfunc (s *StdioStream) Read(b []byte) (n int, err error) {\n\treturn s.in.Read(b)\n}\n\n// Write implements interface\nfunc (s *StdioStream) Write(b []byte) (n int, err error) {\n\treturn s.out.Write(b)\n}\n\n// Close implements interface\nfunc (s *StdioStream) Close() error {\n\tif s.exitOnClose {\n\t\t// We kill ourself here because the streams are closed\n\t\tos.Exit(s.exitCode)\n\t}\n\n\treturn s.out.Close()\n}\n\n// SetDeadline implements interface\nfunc (s *StdioStream) SetDeadline(t time.Time) error {\n\treturn nil\n}\n\n// SetReadDeadline implements interface\nfunc (s *StdioStream) SetReadDeadline(t time.Time) error {\n\treturn nil\n}\n\n// SetWriteDeadline implements interface\nfunc (s *StdioStream) SetWriteDeadline(t time.Time) error {\n\treturn nil\n}\n\n// StdinAddr is the struct for the stdi\ntype StdinAddr struct {\n\ts string\n}\n\n// NewStdinAddr creates a new StdinAddr\nfunc NewStdinAddr(s string) *StdinAddr {\n\treturn &StdinAddr{s}\n}\n\n// Network implements interface\nfunc (a *StdinAddr) Network() string {\n\treturn \"stdio\"\n}\n\nfunc (a *StdinAddr) String() string {\n\treturn a.s\n}\n"
  },
  {
    "path": "pkg/stdio/listener.go",
    "content": "package stdio\n\nimport (\n\t\"io\"\n\t\"net\"\n)\n\n// NewStdioListener creates a new stdio listener\nfunc NewStdioListener(reader io.Reader, writer io.WriteCloser, exitOnClose bool) *StdioListener {\n\tconn := NewStdioStream(reader, writer, exitOnClose, 0)\n\tconnChan := make(chan net.Conn)\n\tgo func() {\n\t\tconnChan <- conn\n\t}()\n\n\treturn &StdioListener{\n\t\tconnChan: connChan,\n\t}\n}\n\n// StdioListener implements the listener interface\ntype StdioListener struct {\n\tconnChan chan net.Conn\n}\n\n// Ready implements interface\nfunc (lis *StdioListener) Ready(conn net.Conn) {\n\n}\n\n// Accept implements interface\nfunc (lis *StdioListener) Accept() (net.Conn, error) {\n\treturn <-lis.connChan, nil\n}\n\n// Close implements interface\nfunc (lis *StdioListener) Close() error {\n\treturn nil\n}\n\n// Addr implements interface\nfunc (lis *StdioListener) Addr() net.Addr {\n\treturn NewStdinAddr(\"listener\")\n}\n"
  },
  {
    "path": "pkg/telemetry/collect.go",
    "content": "package telemetry\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/analytics-client/client\"\n\tdevpodclient \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/moby/term\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype ErrorSeverityType string\n\nconst (\n\tWarningSeverity ErrorSeverityType = \"warning\"\n\tErrorSeverity   ErrorSeverityType = \"error\"\n\tFatalSeverity   ErrorSeverityType = \"fatal\"\n\tPanicSeverity   ErrorSeverityType = \"panic\"\n)\n\nconst UIEnvVar = \"DEVPOD_UI\"\n\nvar UIEventsExceptions []string = []string{\n\t\"devpod list\",\n\t\"devpod status\",\n\t\"devpod provider list\",\n\t\"devpod pro list\",\n\t\"devpod pro check-health\",\n\t\"devpod pro check-update\",\n\t\"devpod ide list\",\n\t\"devpod ide use\",\n\t\"devpod provider use\",\n\t\"devpod version\",\n\t\"devpod context options\",\n}\n\n// skip everything in pro mode\nvar CollectorCLI CLICollector = &noopCollector{}\n\ntype CLICollector interface {\n\tRecordCLI(err error)\n\tSetClient(client devpodclient.BaseWorkspaceClient)\n\n\t// Flush makes sure all events are sent to the backend\n\tFlush()\n}\n\n// StartCLI starts collecting events and sending them to the backend from the CLI\nfunc StartCLI(devPodConfig *config.Config, cmd *cobra.Command) {\n\ttelemetryOpt := devPodConfig.ContextOption(config.ContextOptionTelemetry)\n\tif telemetryOpt == \"false\" || version.GetVersion() == version.DevVersion ||\n\t\tos.Getenv(\"DEVPOD_DISABLE_TELEMETRY\") == \"true\" {\n\t\treturn\n\t}\n\n\t// create a new default collector\n\tcollector, err := newCLICollector(cmd)\n\tif err != nil {\n\t\t// Log the problem but don't fail - use disabled Collector instead\n\t\tlog.Default.WithPrefix(\"telemetry\").Infof(\"%s\", err.Error())\n\t} else {\n\t\tCollectorCLI = collector\n\t}\n}\n\nfunc newCLICollector(cmd *cobra.Command) (*cliCollector, error) {\n\tdefaultCollector := &cliCollector{\n\t\tanalyticsClient: client.NewClient(),\n\t\tlog:             log.Default.WithPrefix(\"telemetry\"),\n\t\tcmd:             cmd,\n\t}\n\n\treturn defaultCollector, nil\n}\n\ntype cliCollector struct {\n\tanalyticsClient client.Client\n\tcmd             *cobra.Command\n\tclient          devpodclient.BaseWorkspaceClient\n\n\tlog log.Logger\n}\n\nfunc (d *cliCollector) SetClient(client devpodclient.BaseWorkspaceClient) {\n\td.client = client\n}\n\nfunc (d *cliCollector) Flush() {\n\td.analyticsClient.Flush()\n}\n\nfunc (d *cliCollector) RecordCLI(err error) {\n\tif d.cmd == nil {\n\t\td.log.Debug(\"no command found, skipping\")\n\t\treturn\n\t}\n\tcmd := d.cmd.CommandPath()\n\tisUI := false\n\tif os.Getenv(UIEnvVar) == \"true\" {\n\t\tisUI = true\n\t}\n\t// Ignore certain commands triggered by DevPod Desktop\n\tif isUI {\n\t\tfor _, exception := range UIEventsExceptions {\n\t\t\tif cmd == exception {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tisCI := false\n\tif !isUI {\n\t\tisCI = isCIEnvironment()\n\t}\n\n\tisInteractive := false\n\tif !isUI {\n\t\tisInteractive = isInteractiveShell()\n\t}\n\n\ttimezone, _ := time.Now().Zone()\n\teventProperties := map[string]interface{}{\n\t\t\"command\":        cmd,\n\t\t\"version\":        version.GetVersion(),\n\t\t\"desktop\":        isUI,\n\t\t\"is_ci\":          isCI,\n\t\t\"is_interactive\": isInteractive,\n\t}\n\tif d.client != nil {\n\t\teventProperties[\"provider\"] = d.client.Provider()\n\n\t\tif d.client.WorkspaceConfig() != nil {\n\t\t\teventProperties[\"source_type\"] = d.client.WorkspaceConfig().Source.Type()\n\t\t\teventProperties[\"ide\"] = d.client.WorkspaceConfig().IDE.Name\n\t\t}\n\t}\n\tuserProperties := map[string]interface{}{\n\t\t\"os_name\":  runtime.GOOS,\n\t\t\"os_arch\":  runtime.GOARCH,\n\t\t\"timezone\": timezone,\n\t}\n\tif err != nil {\n\t\teventProperties[\"error\"] = err.Error()\n\t}\n\n\t// Check if we're on the runner\n\tisPro := false\n\twd, wdErr := os.Getwd()\n\tif wdErr == nil {\n\t\tif strings.HasPrefix(wd, \"/var/lib/loft/devpod\") {\n\t\t\tisPro = true\n\t\t}\n\t}\n\teventType := \"devpod_cli\"\n\tif isPro {\n\t\teventType = \"devpod_cli_runner\"\n\t}\n\n\t// build the event and record\n\teventPropertiesRaw, _ := json.Marshal(eventProperties)\n\tuserPropertiesRaw, _ := json.Marshal(userProperties)\n\td.analyticsClient.RecordEvent(client.Event{\n\t\t\"event\": {\n\t\t\t\"type\":       eventType,\n\t\t\t\"machine_id\": GetMachineID(),\n\t\t\t\"properties\": string(eventPropertiesRaw),\n\t\t\t\"timestamp\":  time.Now().Unix(),\n\t\t},\n\t\t\"user\": {\n\t\t\t\"machine_id\": GetMachineID(),\n\t\t\t\"properties\": string(userPropertiesRaw),\n\t\t\t\"timestamp\":  time.Now().Unix(),\n\t\t},\n\t})\n}\n\n// isCIEnvironment looks up a couple of well-known CI env vars\nfunc isCIEnvironment() bool {\n\tciIndicators := []string{\n\t\t\"CI\",                     // Generic CI variable\n\t\t\"TRAVIS\",                 // Travis CI\n\t\t\"GITHUB_ACTIONS\",         // GitHub Actions\n\t\t\"GITLAB_CI\",              // GitLab CI\n\t\t\"CIRCLECI\",               // CircleCI\n\t\t\"TEAMCITY_VERSION\",       // TeamCity\n\t\t\"BITBUCKET_BUILD_NUMBER\", // Bitbucket\n\t}\n\n\tfor _, key := range ciIndicators {\n\t\tif _, exists := os.LookupEnv(key); exists {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// isInteractiveShell checks if the current shell is in interactive mode or not.\n// Can be combined with `isCi` to narrow down usage\nfunc isInteractiveShell() bool {\n\treturn term.IsTerminal(os.Stdin.Fd())\n}\n"
  },
  {
    "path": "pkg/telemetry/helpers.go",
    "content": "package telemetry\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n\t\"fmt\"\n\n\t\"github.com/denisbrodbeck/machineid\"\n\t\"github.com/loft-sh/devpod/pkg/util\"\n)\n\n// GetMachineID retrieves machine ID and encodes it together with users $HOME path and\n// extra key to protect privacy. Returns a hex-encoded string.\nfunc GetMachineID() string {\n\tid, err := machineid.ID()\n\tif err != nil {\n\t\tid = \"error\"\n\t}\n\n\t// get $HOME to distinguish two users on the same machine\n\t// will be hashed later together with the ID\n\thome, err := util.UserHomeDir()\n\tif err != nil {\n\t\thome = \"error\"\n\t}\n\n\tmac := hmac.New(sha256.New, []byte(id))\n\tmac.Write([]byte(home))\n\treturn fmt.Sprintf(\"%x\", mac.Sum(nil))\n}\n"
  },
  {
    "path": "pkg/telemetry/noop.go",
    "content": "package telemetry\n\nimport \"github.com/loft-sh/devpod/pkg/client\"\n\ntype noopCollector struct{}\n\nfunc (n *noopCollector) RecordCLI(err error)                         {}\nfunc (n *noopCollector) SetClient(client client.BaseWorkspaceClient) {}\n\nfunc (n *noopCollector) Flush() {}\n"
  },
  {
    "path": "pkg/template/fill.go",
    "content": "package template\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nfunc WriteFiles(folder string, files map[string]string) error {\n\tfor file, content := range files {\n\t\terr := os.WriteFile(filepath.Join(folder, file), []byte(content), 0600)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc FillTemplate(templateString string, vars interface{}) (string, error) {\n\tt, err := template.New(\"gotmpl\").Parse(templateString)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar buf strings.Builder\n\terr = t.Execute(&buf, vars)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn buf.String(), nil\n}\n"
  },
  {
    "path": "pkg/token/token.go",
    "content": "package token\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\n\t\"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/pkg/errors\"\n)\n\ntype Token struct {\n\tHostKey        string `json:\"hostKey,omitempty\"`\n\tAuthorizedKeys string `json:\"authorizedKeys,omitempty\"`\n}\n\nfunc GetDevPodToken() (string, error) {\n\t// get host key\n\thostKey, err := ssh.GetDevPodHostKey()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"generate host key\")\n\t}\n\n\t// get public key\n\tpublicKey, err := ssh.GetDevPodPublicKey()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"generate key pair\")\n\t}\n\n\treturn buildToken(hostKey, publicKey)\n}\n\nfunc buildToken(hostKey string, publicKey string) (string, error) {\n\tout, err := json.Marshal(&Token{\n\t\tHostKey:        hostKey,\n\t\tAuthorizedKeys: publicKey,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(out), nil\n}\n\nfunc ParseToken(token string) (*Token, error) {\n\tdecoded, err := base64.StdEncoding.DecodeString(token)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt := &Token{}\n\terr = json.Unmarshal(decoded, t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn t, nil\n}\n"
  },
  {
    "path": "pkg/ts/addr.go",
    "content": "package ts\n\nimport \"net\"\n\nvar _ net.Addr = Addr{}\n\ntype Addr struct {\n\thost string\n\tport int\n}\n\nfunc NewAddr(rawHost string, port int) Addr {\n\treturn Addr{host: rawHost, port: port}\n}\n\nfunc (a Addr) Network() string {\n\treturn \"tcp\"\n}\n\nfunc (a Addr) String() string {\n\treturn GetURL(a.host, a.port)\n}\n\nfunc (a Addr) Host() string {\n\treturn GetURL(a.host, 0)\n}\n\nfunc (a Addr) Port() int {\n\treturn a.port\n}\n"
  },
  {
    "path": "pkg/ts/derp.go",
    "content": "package ts\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype ConnTrackingFunc func(address string)\n\n// CheckDerpConnection validates the DERP connection\nfunc CheckDerpConnection(ctx context.Context, baseUrl *url.URL) error {\n\tnewTransport := http.DefaultTransport.(*http.Transport).Clone()\n\tnewTransport.TLSClientConfig = &tls.Config{\n\t\tInsecureSkipVerify: true,\n\t}\n\n\tclient := &http.Client{\n\t\tTransport: newTransport,\n\t\tTimeout:   5 * time.Second,\n\t}\n\n\tderpUrl := *baseUrl\n\tderpUrl.Path = \"/derp/probe\"\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, derpUrl.String(), nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create request: %w\", err)\n\t}\n\n\tres, err := client.Do(req)\n\tif err != nil || (res != nil && res.StatusCode != http.StatusOK) {\n\t\treturn fmt.Errorf(\"failed to reach the coordinator server: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// Utility function to get environment variable or default\nfunc GetEnvOrDefault(envVar, defaultVal string) string {\n\tif val := os.Getenv(envVar); val != \"\" {\n\t\treturn val\n\t}\n\treturn defaultVal\n}\n\n// RemoveProtocol removes protocol from URL\nfunc RemoveProtocol(hostPath string) string {\n\tif idx := strings.Index(hostPath, \"://\"); idx != -1 {\n\t\treturn hostPath[idx+3:]\n\t}\n\treturn hostPath\n}\n"
  },
  {
    "path": "pkg/ts/ssh.go",
    "content": "package ts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype Dialer func(ctx context.Context, network, address string) (net.Conn, error)\n\nfunc WaitForSSHClient(ctx context.Context, dialer Dialer, network, address string, user string, timeout time.Duration, log log.Logger) (*ssh.Client, error) {\n\tdeadline := time.Now().Add(timeout)\n\n\tvar (\n\t\tc   *ssh.Client\n\t\terr error\n\t)\n\tlog.Debugf(\"Attempting to establish SSH connection with %s as user %s\", address, user)\n\tfor time.Now().Before(deadline) {\n\t\tc, err = newSSHClient(ctx, dialer, network, address, user)\n\t\tif err == nil {\n\t\t\treturn c, nil\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn c, err\n\t\tdefault:\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t}\n\t}\n\tlog.Debugf(\"Failed to establish SSH connection %v\", err)\n\n\treturn c, err\n}\n\nfunc newSSHClient(ctx context.Context, dialer Dialer, network, address string, user string) (*ssh.Client, error) {\n\tconn, err := dialer(ctx, network, address)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dial %s: %w\", address, err)\n\t}\n\n\tclientConfig := &ssh.ClientConfig{\n\t\tUser:            user,\n\t\tAuth:            []ssh.AuthMethod{}, // The SSH server is only reachable through the tailnet\n\t\tHostKeyCallback: ssh.InsecureIgnoreHostKey(),\n\t}\n\n\tsshConn, channels, requests, err := ssh.NewClientConn(conn, address, clientConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"establish SSH connection: %w\", err)\n\t}\n\n\treturn ssh.NewClient(sshConn, channels, requests), nil\n}\n"
  },
  {
    "path": "pkg/ts/util.go",
    "content": "package ts\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/ipn\"\n\t\"tailscale.com/types/netmap\"\n)\n\nconst LoftTSNetDomain = \"ts.loft\"\n\nfunc GetClientHostname(userName string) (string, error) {\n\tosHostname, err := os.Hostname()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tosHostname = strings.ToLower(strings.ReplaceAll(osHostname, \".\", \"-\"))\n\treturn fmt.Sprintf(\"devpod.%s.%s.client\", osHostname, userName), nil\n}\n\nfunc GetWorkspaceHostname(name, namespace string) string {\n\treturn fmt.Sprintf(\"devpod.%s.%s.workspace\", name, namespace)\n}\n\nfunc ParseWorkspaceHostname(hostname string) (name string, project string, err error) {\n\tparts := strings.SplitN(hostname, \".\", 4)\n\tif len(parts) != 4 {\n\t\treturn name, project, fmt.Errorf(\"invalid hostname: %s\", hostname)\n\t}\n\n\tname = parts[1]\n\tproject = parts[2]\n\n\treturn name, project, nil\n}\n\nfunc GetURL(host string, port int) string {\n\tif port == 0 {\n\t\treturn fmt.Sprintf(\"%s.%s\", host, LoftTSNetDomain)\n\t}\n\treturn fmt.Sprintf(\"%s.%s:%d\", host, LoftTSNetDomain, port)\n}\n\n// WaitHostReachable polls until the given host is reachable via ts.\nfunc WaitHostReachable(ctx context.Context, lc *tailscale.LocalClient, addr Addr, maxRetries int, log log.Logger) error {\n\tfor i := 0; i < maxRetries; i++ {\n\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\t\tdefer cancel()\n\t\tconn, err := lc.DialTCP(timeoutCtx, addr.Host(), uint16(addr.Port()))\n\t\tif err == nil {\n\t\t\t_ = conn.Close()\n\t\t\treturn nil // Host is reachable\n\t\t}\n\t\tlog.Debugf(\"Host %s not reachable, retrying... (%d/%d)\", addr.String(), i+1, maxRetries)\n\t\ttime.Sleep(200 * time.Millisecond)\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tdefault:\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"host %s not reachable\", addr.String())\n}\n\nfunc WatchNetmap(ctx context.Context, lc *tailscale.LocalClient, netmapChangedFn func(nm *netmap.NetworkMap)) error {\n\twatcher, err := lc.WatchIPNBus(ctx, ipn.NotifyInitialNetMap|ipn.NotifyRateLimit|ipn.NotifyWatchEngineUpdates)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer watcher.Close()\n\n\tvar netMap *netmap.NetworkMap\n\tfor {\n\t\tn, err := watcher.Next()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"watch ipn: %w\", err)\n\t\t}\n\t\tif n.ErrMessage != nil {\n\t\t\treturn fmt.Errorf(\"tailscale error: %w\", errors.New(*n.ErrMessage))\n\t\t}\n\t\tif n.NetMap != nil {\n\t\t\tif n.NetMap != netMap {\n\t\t\t\tnetMap = n.NetMap\n\t\t\t\tnetmapChangedFn(netMap)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/ts/workspace_server.go",
    "content": "package ts\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/loft-sh/log\"\n\n\t\"github.com/loft-sh/devpod/pkg/platform/client\"\n\tsshServer \"github.com/loft-sh/devpod/pkg/ssh/server\"\n\t\"tailscale.com/client/tailscale\"\n\t\"tailscale.com/envknob\"\n\t\"tailscale.com/ipn/store/mem\"\n\t\"tailscale.com/tsnet\"\n\t\"tailscale.com/types/netmap\"\n)\n\nconst (\n\t// TSPortForwardPort is the fixed port on which the workspace WebSocket reverse proxy listens.\n\tTSPortForwardPort string = \"12051\"\n\n\tRunnerProxySocket string = \"runner-proxy.sock\"\n\n\tnetMapCooldown = 30 * time.Second\n)\n\n// WorkspaceServer holds the TSNet server and its listeners.\ntype WorkspaceServer struct {\n\ttsServer  *tsnet.Server\n\tlisteners []net.Listener\n\n\tconnectionCounter   int\n\tconnectionCounterMu sync.Mutex\n\n\tconfig *WorkspaceServerConfig\n\tlog    log.Logger\n}\n\n// WorkspaceServerConfig defines configuration for the TSNet instance.\ntype WorkspaceServerConfig struct {\n\tAccessKey     string\n\tPlatformHost  string\n\tWorkspaceHost string\n\tLogF          func(format string, args ...interface{})\n\tClient        client.Client\n\tRootDir       string\n}\n\n// NewWorkspaceServer creates a new TSNet server instance.\nfunc NewWorkspaceServer(config *WorkspaceServerConfig, logger log.Logger) *WorkspaceServer {\n\treturn &WorkspaceServer{\n\t\tconfig: config,\n\t\tlog:    logger,\n\t}\n}\n\n// Start initializes the TSNet server, sets up listeners for SSH and HTTP\n// reverse proxy traffic, and waits until the given context is canceled.\nfunc (s *WorkspaceServer) Start(ctx context.Context) error {\n\ts.log.Infof(\"Starting workspace server\")\n\n\t// Perform TSNet initialization (validation, control URL, server startup, hostname parsing)\n\tworkspaceName, projectName, err := s.setupTSNet(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlc, err := s.tsServer.LocalClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// send heartbeats\n\tgo s.sendHeartbeats(ctx, projectName, workspaceName, lc)\n\n\t// Start both SSH and HTTP reverse proxy listeners\n\tif err := s.startListeners(ctx, projectName, workspaceName, lc); err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tlastUpdate := time.Now()\n\t\tif err := WatchNetmap(ctx, lc, func(netMap *netmap.NetworkMap) {\n\t\t\tif time.Since(lastUpdate) < netMapCooldown {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlastUpdate = time.Now()\n\n\t\t\tnm, err := json.Marshal(netMap)\n\t\t\tif err != nil {\n\t\t\t\ts.log.Errorf(\"Failed to marshal netmap: %v\", err)\n\t\t\t} else {\n\t\t\t\t_ = os.WriteFile(filepath.Join(s.config.RootDir, \"netmap.json\"), nm, 0o644)\n\t\t\t}\n\t\t}); err != nil {\n\t\t\ts.log.Errorf(\"Failed to watch netmap: %v\", err)\n\t\t}\n\t}()\n\n\t// Wait until the context is canceled.\n\t<-ctx.Done()\n\treturn nil\n}\n\n// Stop shuts down all listeners and the TSNet server.\nfunc (s *WorkspaceServer) Stop() {\n\tfor _, listener := range s.listeners {\n\t\tif listener != nil {\n\t\t\tlistener.Close()\n\t\t}\n\t}\n\tif s.tsServer != nil {\n\t\ts.tsServer.Close()\n\t\ts.tsServer = nil\n\t}\n\ts.log.Info(\"Tailscale server stopped\")\n}\n\n// Dial dials the given address using the TSNet server.\nfunc (s *WorkspaceServer) Dial(ctx context.Context, network, addr string) (net.Conn, error) {\n\tif s.tsServer == nil {\n\t\treturn nil, fmt.Errorf(\"tailscale server is not running\")\n\t}\n\treturn s.tsServer.Dial(ctx, network, addr)\n}\n\n// setupTSNet validates configuration, sets up the control URL, starts the TSNet server,\n// and parses the hostname into workspace and project names.\nfunc (s *WorkspaceServer) setupTSNet(ctx context.Context) (workspace, project string, err error) {\n\tif err = s.validateConfig(); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tbaseURL, err := s.setupControlURL(ctx)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tif err = s.initTsServer(ctx, baseURL); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\treturn s.parseWorkspaceHostname()\n}\n\n// validateConfig ensures required configuration values are set.\nfunc (s *WorkspaceServer) validateConfig() error {\n\tif s.config.AccessKey == \"\" || s.config.PlatformHost == \"\" || s.config.WorkspaceHost == \"\" {\n\t\treturn fmt.Errorf(\"access key, host, or hostname cannot be empty\")\n\t}\n\treturn nil\n}\n\n// setupControlURL constructs the control URL and verifies DERP connection.\nfunc (s *WorkspaceServer) setupControlURL(ctx context.Context) (*url.URL, error) {\n\tbaseURL := &url.URL{\n\t\tScheme: GetEnvOrDefault(\"LOFT_TSNET_SCHEME\", \"https\"),\n\t\tHost:   s.config.PlatformHost,\n\t}\n\tif err := CheckDerpConnection(ctx, baseURL); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to verify DERP connection: %w\", err)\n\t}\n\treturn baseURL, nil\n}\n\n// initTsServer initializes the TSNet server.\nfunc (s *WorkspaceServer) initTsServer(ctx context.Context, controlURL *url.URL) error {\n\tstore, _ := mem.New(s.config.LogF, \"\")\n\tenvknob.Setenv(\"TS_DEBUG_TLS_DIAL_INSECURE_SKIP_VERIFY\", \"true\")\n\ts.log.Infof(\"Connecting to control URL - %s/coordinator/\", controlURL.String())\n\ts.tsServer = &tsnet.Server{\n\t\tHostname:   s.config.WorkspaceHost,\n\t\tLogf:       s.config.LogF,\n\t\tControlURL: controlURL.String() + \"/coordinator/\",\n\t\tAuthKey:    s.config.AccessKey,\n\t\tDir:        s.config.RootDir,\n\t\tEphemeral:  true,\n\t\tStore:      store,\n\t}\n\tif _, err := s.tsServer.Up(ctx); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// parseHostname extracts workspace and project names from the hostname.\nfunc (s *WorkspaceServer) parseWorkspaceHostname() (workspace, project string, err error) {\n\tparts := strings.Split(s.config.WorkspaceHost, \".\")\n\tif len(parts) < 4 {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid workspace hostname format: %s\", s.config.WorkspaceHost)\n\t}\n\treturn parts[1], parts[2], nil\n}\n\n// startListeners creates and starts the SSH and HTTP reverse proxy listeners.\nfunc (s *WorkspaceServer) startListeners(ctx context.Context, projectName, workspaceName string, lc *tailscale.LocalClient) error {\n\t// Create and start the SSH listener.\n\ts.log.Infof(\"Starting SSH listener\")\n\tsshListener, err := s.createListener(fmt.Sprintf(\":%d\", sshServer.DefaultUserPort))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create and start the HTTP reverse proxy listener.\n\ts.log.Infof(\"Starting HTTP reverse proxy listener on TSNet port %s\", TSPortForwardPort)\n\twsListener, err := s.createListener(fmt.Sprintf(\":%s\", TSPortForwardPort))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create listener on TS port %s: %w\", TSPortForwardPort, err)\n\t}\n\n\t// Create and start the platform HTTP git credentials listener\n\trunnerProxySocket := filepath.Join(s.config.RootDir, RunnerProxySocket)\n\ts.log.Infof(\"Starting runner proxy socket on %s\", runnerProxySocket)\n\t_ = os.Remove(runnerProxySocket)\n\trunnerProxyListener, err := net.Listen(\"unix\", runnerProxySocket)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create listener on TS port %s: %w\", TSPortForwardPort, err)\n\t}\n\n\t// make sure all users can access the socket\n\t_ = os.Chmod(runnerProxySocket, 0o777)\n\n\t// add all listeners to the list\n\ts.listeners = append(s.listeners, sshListener, wsListener, runnerProxyListener)\n\n\t// Setup HTTP handler for git credentials\n\tgo func() {\n\t\tmux := http.NewServeMux()\n\t\ttransport := &http.Transport{DialContext: s.tsServer.Dial}\n\t\tmux.HandleFunc(\"/git-credentials\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\ts.gitCredentialsHandler(w, r, lc, transport, projectName, workspaceName)\n\t\t})\n\t\tif err := http.Serve(runnerProxyListener, mux); err != nil && err != http.ErrServerClosed {\n\t\t\ts.log.Errorf(\"HTTP runner proxy server error: %v\", err)\n\t\t}\n\t}()\n\n\t// Setup HTTP handler for docker credentials.\n\tgo func() {\n\t\tmux := http.NewServeMux()\n\t\ttransport := &http.Transport{DialContext: s.tsServer.Dial}\n\t\tmux.HandleFunc(\"/docker-credentials\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\ts.dockerCredentialsHandler(w, r, lc, transport, projectName, workspaceName)\n\t\t})\n\t\tif err := http.Serve(runnerProxyListener, mux); err != nil && err != http.ErrServerClosed {\n\t\t\ts.log.Errorf(\"HTTP runner proxy server error: %v\", err)\n\t\t}\n\t}()\n\n\t// Setup HTTP handler for port forwarding.\n\tgo func() {\n\t\tmux := http.NewServeMux()\n\t\tmux.HandleFunc(\"/portforward\", s.httpPortForwardHandler)\n\t\tif err := http.Serve(wsListener, mux); err != nil && err != http.ErrServerClosed {\n\t\t\ts.log.Errorf(\"HTTP server error on TS port %s: %v\", TSPortForwardPort, err)\n\t\t}\n\t}()\n\n\t// Start handling SSH connections.\n\tgo s.handleSSHConnections(ctx, sshListener)\n\n\treturn nil\n}\n\n// createListener creates a raw listener and wraps it with connection tracking.\nfunc (s *WorkspaceServer) createListener(addr string) (net.Listener, error) {\n\tl, err := s.tsServer.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to listen on %s: %w\", addr, err)\n\t}\n\n\t// create a new tracked listener to track the number of connections\n\treturn l, nil\n}\n\nfunc (s *WorkspaceServer) addConnection() {\n\ts.connectionCounterMu.Lock()\n\tdefer s.connectionCounterMu.Unlock()\n\ts.connectionCounter++\n}\n\nfunc (s *WorkspaceServer) removeConnection() {\n\ts.connectionCounterMu.Lock()\n\tdefer s.connectionCounterMu.Unlock()\n\ts.connectionCounter--\n}\n\n// gitCredentialsHandler is the handler for git credentials requests for workspace.\nfunc (s *WorkspaceServer) gitCredentialsHandler(w http.ResponseWriter, r *http.Request, lc *tailscale.LocalClient, transport *http.Transport, projectName, workspaceName string) {\n\ts.log.Infof(\"Received git credentials request from %s\", r.RemoteAddr)\n\n\t// create a new http client with a custom transport\n\tdiscoveredRunner, err := s.discoverRunner(r.Context(), lc)\n\tif err != nil {\n\t\thttp.Error(w, \"failed to discover runner\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// build the runner URL\n\trunnerURL := fmt.Sprintf(\"http://%s.ts.loft/devpod/%s/%s/workspace-git-credentials\", discoveredRunner, projectName, workspaceName)\n\tparsedURL, err := url.Parse(runnerURL)\n\tif err != nil {\n\t\thttp.Error(w, \"failed to parse runner URL\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Build the reverse proxy with a custom Director.\n\tproxy := httputil.NewSingleHostReverseProxy(parsedURL)\n\tproxy.Director = func(req *http.Request) {\n\t\tdest := *parsedURL\n\t\treq.URL = &dest\n\t\treq.Host = dest.Host\n\t\treq.Header.Set(\"Authorization\", \"Bearer \"+s.config.AccessKey)\n\t}\n\tproxy.Transport = transport\n\tproxy.ServeHTTP(w, r)\n}\n\n// dockerCredentialsHandler is the handler for docker credentials requests for workspace.\nfunc (s *WorkspaceServer) dockerCredentialsHandler(w http.ResponseWriter, r *http.Request, lc *tailscale.LocalClient, transport *http.Transport, projectName, workspaceName string) {\n\ts.log.Infof(\"Received docker credentials request from %s\", r.RemoteAddr)\n\n\t// create a new http client with a custom transport\n\tdiscoveredRunner, err := s.discoverRunner(r.Context(), lc)\n\tif err != nil {\n\t\thttp.Error(w, \"failed to discover runner\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// build the runner URL\n\trunnerURL := fmt.Sprintf(\"http://%s.ts.loft/devpod/%s/%s/workspace-docker-credentials\", discoveredRunner, projectName, workspaceName)\n\tparsedURL, err := url.Parse(runnerURL)\n\tif err != nil {\n\t\thttp.Error(w, \"failed to parse runner URL\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Build the reverse proxy with a custom Director.\n\tproxy := httputil.NewSingleHostReverseProxy(parsedURL)\n\tproxy.Director = func(req *http.Request) {\n\t\tdest := *parsedURL\n\t\treq.URL = &dest\n\t\treq.Host = dest.Host\n\t\treq.Header.Set(\"Authorization\", \"Bearer \"+s.config.AccessKey)\n\t}\n\tproxy.Transport = transport\n\tproxy.ServeHTTP(w, r)\n}\n\n// httpPortForwardHandler is the HTTP reverse proxy handler for workspace.\n// It reconstructs the target URL using custom headers and forwards the request.\nfunc (s *WorkspaceServer) httpPortForwardHandler(w http.ResponseWriter, r *http.Request) {\n\ts.addConnection()\n\tdefer s.removeConnection()\n\ts.log.Debugf(\"httpPortForwardHandler: starting\")\n\n\t// Retrieve required custom headers.\n\ttargetPort := r.Header.Get(\"X-Loft-Forward-Port\")\n\tbaseForwardStr := r.Header.Get(\"X-Loft-Forward-Url\")\n\tif targetPort == \"\" || baseForwardStr == \"\" {\n\t\thttp.Error(w, \"missing required X-Loft headers\", http.StatusBadRequest)\n\t\treturn\n\t}\n\ts.log.Debugf(\"httpPortForwardHandler: received headers: X-Loft-Forward-Port=%s, X-Loft-Forward-Url=%s\", targetPort, baseForwardStr)\n\n\t// Parse and modify the URL to target the local endpoint.\n\tparsedURL, err := url.Parse(baseForwardStr)\n\tif err != nil {\n\t\ts.log.Errorf(\"httpPortForwardHandler: failed to parse base URL: %v\", err)\n\t\thttp.Error(w, \"invalid base forward URL\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tparsedURL.Scheme = \"http\"\n\tparsedURL.Host = \"127.0.0.1:\" + targetPort\n\ts.log.Debugf(\"httpPortForwardHandler: final target URL=%s\", parsedURL.String())\n\n\t// Build the reverse proxy with a custom Director.\n\tproxy := httputil.NewSingleHostReverseProxy(parsedURL)\n\tproxy.Director = func(req *http.Request) {\n\t\tdest := *parsedURL\n\t\treq.URL = &dest\n\t\treq.Host = dest.Host\n\t\t// Remove custom headers so they are not forwarded.\n\t\treq.Header.Del(\"X-Loft-Forward-Port\")\n\t\treq.Header.Del(\"X-Loft-Forward-Url\")\n\t\treq.Header.Del(\"X-Loft-Forward-Authorization\")\n\t}\n\tproxy.Transport = http.DefaultTransport\n\n\ts.log.Infof(\"httpPortForwardHandler: final proxied request: %s %s\", r.Method, parsedURL.String())\n\tproxy.ServeHTTP(w, r)\n}\n\n// handleSSHConnections continuously accepts SSH connections and handles each one.\nfunc (s *WorkspaceServer) handleSSHConnections(ctx context.Context, listener net.Listener) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\t\tclientConn, err := listener.Accept()\n\t\tif err != nil {\n\t\t\tif ctx.Err() != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ts.log.Errorf(\"Failed to accept connection: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tgo s.handleSSHConnection(clientConn)\n\t}\n}\n\n// handleSSHConnection proxies the SSH connection to the local backend.\nfunc (s *WorkspaceServer) handleSSHConnection(clientConn net.Conn) {\n\ts.addConnection()\n\tdefer s.removeConnection()\n\tdefer clientConn.Close()\n\n\tlocalAddr := fmt.Sprintf(\"127.0.0.1:%d\", sshServer.DefaultUserPort)\n\tbackendConn, err := net.Dial(\"tcp\", localAddr)\n\tif err != nil {\n\t\ts.log.Errorf(\"Failed to connect to local address %s: %v\", localAddr, err)\n\t\treturn\n\t}\n\tdefer backendConn.Close()\n\n\t// Start bidirectional copy between client and backend.\n\tgo func() {\n\t\tdefer clientConn.Close()\n\t\tdefer backendConn.Close()\n\t\t_, err = io.Copy(backendConn, clientConn)\n\t}()\n\t_, err = io.Copy(clientConn, backendConn)\n}\n\nfunc (s *WorkspaceServer) sendHeartbeats(ctx context.Context, projectName, workspaceName string, lc *tailscale.LocalClient) {\n\t// create a new http client with a custom transport\n\ttransport := &http.Transport{DialContext: s.tsServer.Dial}\n\tclient := &http.Client{Transport: transport, Timeout: 10 * time.Second}\n\n\t// create a ticker to send heartbeats every 10 seconds\n\tticker := time.NewTicker(10 * time.Second)\n\tdefer ticker.Stop()\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\t// get the current number of connections\n\t\t\ts.connectionCounterMu.Lock()\n\t\t\tconnections := s.connectionCounter\n\t\t\ts.connectionCounterMu.Unlock()\n\n\t\t\t// send a heartbeat if there are connections\n\t\t\tif connections > 0 {\n\t\t\t\terr := s.sendHeartbeat(ctx, client, projectName, workspaceName, lc, connections)\n\t\t\t\tif err != nil {\n\t\t\t\t\ts.log.Errorf(\"Failed to send heartbeat: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *WorkspaceServer) sendHeartbeat(ctx context.Context, client *http.Client, projectName, workspaceName string, lc *tailscale.LocalClient, connections int) error {\n\tctx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\tdefer cancel()\n\n\tdiscoveredRunner, err := s.discoverRunner(ctx, lc)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to discover runner: %w\", err)\n\t}\n\n\theartbeatURL := fmt.Sprintf(\"http://%s.ts.loft/devpod/%s/%s/heartbeat\", discoveredRunner, projectName, workspaceName)\n\ts.log.Infof(\"Sending heartbeat to %s, because there are %d active connections\", heartbeatURL, connections)\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", heartbeatURL, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create request for %s: %w\", heartbeatURL, err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer \"+s.config.AccessKey)\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"request to %s failed: %w\", heartbeatURL, err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"received response from %s - Status: %d\", heartbeatURL, resp.StatusCode)\n\t}\n\ts.log.Infof(\"received response from %s - Status: %d\", heartbeatURL, resp.StatusCode)\n\treturn nil\n}\n\n// discoverRunner attempts to find the runner peer from the TSNet status.\nfunc (s *WorkspaceServer) discoverRunner(ctx context.Context, lc *tailscale.LocalClient) (string, error) {\n\tstatus, err := lc.Status(ctx)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get status: %w\", err)\n\t}\n\n\tvar runner string\n\tfor _, peer := range status.Peer {\n\t\tif peer == nil || peer.HostName == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif strings.HasSuffix(peer.HostName, \"runner\") {\n\t\t\trunner = peer.HostName\n\t\t\tbreak\n\t\t}\n\t}\n\tif runner == \"\" {\n\t\treturn \"\", fmt.Errorf(\"no active runner found\")\n\t}\n\n\ts.log.Infof(\"discoverRunner: selected runner = %s\", runner)\n\treturn runner, nil\n}\n"
  },
  {
    "path": "pkg/tunnel/container.go",
    "content": "// Package tunnel provides the functions used by the CLI to tunnel into a container using either\n// a tunneled connection from the workspace client (using a machine provider) or a direct SSH connection\n// from the proxy client (Ssh, k8s or docker provider)\npackage tunnel\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// NewContainerTunnel constructs a ContainerTunnel using the workspace client, if proxy is True then\n// the workspace's agent config is not periodically updated\nfunc NewContainerTunnel(client client.WorkspaceClient, log log.Logger) *ContainerTunnel {\n\tupdateConfigInterval := time.Second * 30\n\treturn &ContainerTunnel{\n\t\tclient:               client,\n\t\tupdateConfigInterval: updateConfigInterval,\n\t\tlog:                  log,\n\t}\n}\n\n// ContainerTunnel manages the state of the tunnel to the container\ntype ContainerTunnel struct {\n\tclient               client.WorkspaceClient\n\tupdateConfigInterval time.Duration\n\tlog                  log.Logger\n}\n\n// Handler defines what to do once the tunnel has a client established\ntype Handler func(ctx context.Context, containerClient *ssh.Client) error\n\n// Run creates an \"outer\" tunnel to the host to start the SSH server so that the \"inner\" tunnel can connect to the container over SSH\nfunc (c *ContainerTunnel) Run(ctx context.Context, handler Handler, cfg *config.Config, envVars map[string]string) error {\n\tif handler == nil {\n\t\treturn nil\n\t}\n\n\t// create context\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// create readers\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\n\t// Get the timeout from the context options\n\ttimeout := config.ParseTimeOption(cfg, config.ContextOptionAgentInjectTimeout)\n\n\t// tunnel to host\n\ttunnelChan := make(chan error, 1)\n\tgo func() {\n\t\twriter := c.log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\t\tdefer c.log.Debugf(\"Tunnel to host closed\")\n\n\t\tcommand := fmt.Sprintf(\"'%s' helper ssh-server --stdio\", c.client.AgentPath())\n\t\tif c.log.GetLevel() == logrus.DebugLevel {\n\t\t\tcommand += \" --debug\"\n\t\t}\n\t\ttunnelChan <- agent.InjectAgentAndExecute(\n\t\t\tcancelCtx,\n\t\t\tfunc(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {\n\t\t\t\treturn c.client.Command(ctx, client.CommandOptions{\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tStdin:   stdin,\n\t\t\t\t\tStdout:  stdout,\n\t\t\t\t\tStderr:  stderr,\n\t\t\t\t})\n\t\t\t},\n\t\t\tc.client.AgentLocal(),\n\t\t\tc.client.AgentPath(),\n\t\t\tc.client.AgentURL(),\n\t\t\ttrue,\n\t\t\tcommand,\n\t\t\tstdinReader,\n\t\t\tstdoutWriter,\n\t\t\twriter,\n\t\t\tc.log.ErrorStreamOnly(),\n\t\t\ttimeout)\n\t}()\n\n\t// connect to container\n\tcontainerChan := make(chan error, 1)\n\tgo func() {\n\t\t// start ssh client as root / default user\n\t\tsshClient, err := devssh.StdioClient(stdoutReader, stdinWriter, false)\n\t\tif err != nil {\n\t\t\tcontainerChan <- errors.Wrap(err, \"create ssh client\")\n\t\t\treturn\n\t\t}\n\n\t\tdefer sshClient.Close()\n\t\tdefer cancel()\n\t\tdefer c.log.Debugf(\"Connection to container closed\")\n\t\tc.log.Debugf(\"Successfully connected to host\")\n\n\t\t// update workspace remotely\n\t\tif c.updateConfigInterval > 0 {\n\t\t\tgo func() {\n\t\t\t\tc.updateConfig(cancelCtx, sshClient)\n\t\t\t}()\n\t\t}\n\n\t\t// wait until we are done\n\t\tif err := c.runInContainer(cancelCtx, sshClient, handler, envVars); err != nil {\n\t\t\tcontainerChan <- fmt.Errorf(\"run in container: %w\", err)\n\t\t} else {\n\t\t\tcontainerChan <- nil\n\t\t}\n\t}()\n\n\t// wait for result\n\tselect {\n\tcase err := <-containerChan:\n\t\treturn errors.Wrap(err, \"tunnel to container\")\n\tcase err := <-tunnelChan:\n\t\treturn errors.Wrap(err, \"connect to server\")\n\t}\n}\n\n// updateConfig is called periodically to keep the workspace agent config up to date\nfunc (c *ContainerTunnel) updateConfig(ctx context.Context, sshClient *ssh.Client) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-time.After(c.updateConfigInterval):\n\t\t\tc.log.Debugf(\"Start refresh\")\n\n\t\t\t// update options\n\t\t\terr := c.client.RefreshOptions(ctx, nil, false)\n\t\t\tif err != nil {\n\t\t\t\tc.log.Errorf(\"Error refreshing workspace options: %v\", err)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// compress info\n\t\t\tworkspaceInfo, agentInfo, err := c.client.AgentInfo(provider.CLIOptions{})\n\t\t\tif err != nil {\n\t\t\t\tc.log.Errorf(\"Error compressing workspace info: %v\", err)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// update workspace remotely\n\t\t\tbuf := &bytes.Buffer{}\n\t\t\tcommand := fmt.Sprintf(\"'%s' agent workspace update-config --workspace-info '%s'\", c.client.AgentPath(), workspaceInfo)\n\t\t\tif agentInfo.Agent.DataPath != \"\" {\n\t\t\t\tcommand += fmt.Sprintf(\" --agent-dir '%s'\", agentInfo.Agent.DataPath)\n\t\t\t}\n\n\t\t\tc.log.Debugf(\"Run command in container: %s\", command)\n\t\t\terr = devssh.Run(ctx, sshClient, command, nil, buf, buf, nil)\n\t\t\tif err != nil {\n\t\t\t\tc.log.Errorf(\"Error updating remote workspace: %s%v\", buf.String(), err)\n\t\t\t} else {\n\t\t\t\tc.log.Debugf(\"Out: %s\", buf.String())\n\t\t\t}\n\t\t}\n\t}\n}\n\n// runInContainer uses the connected SSH client to execute handler on the remote\nfunc (c *ContainerTunnel) runInContainer(ctx context.Context, sshClient *ssh.Client, handler Handler, envVars map[string]string) error {\n\t// compress info\n\tworkspaceInfo, _, err := c.client.AgentInfo(provider.CLIOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create pipes\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\n\t// create cancel context\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// tunnel to container\n\tgo func() {\n\t\twriter := c.log.Writer(logrus.InfoLevel, false)\n\t\tdefer writer.Close()\n\t\tdefer stdoutWriter.Close()\n\t\tdefer cancel()\n\n\t\tc.log.Debugf(\"Run container tunnel\")\n\t\tdefer c.log.Debugf(\"Container tunnel exited\")\n\n\t\tcommand := fmt.Sprintf(\"'%s' agent container-tunnel --workspace-info '%s'\", c.client.AgentPath(), workspaceInfo)\n\t\tif c.log.GetLevel() == logrus.DebugLevel {\n\t\t\tcommand += \" --debug\"\n\t\t}\n\t\terr = devssh.Run(cancelCtx, sshClient, command, stdinReader, stdoutWriter, writer, envVars)\n\t\tif err != nil {\n\t\t\tc.log.Errorf(\"Error tunneling to container: %v\", err)\n\t\t\treturn\n\t\t}\n\t}()\n\n\t// start ssh client\n\tcontainerClient, err := devssh.StdioClient(stdoutReader, stdinWriter, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer containerClient.Close()\n\tc.log.Debugf(\"Successfully connected to container\")\n\n\t// start handler\n\treturn handler(cancelCtx, containerClient)\n}\n"
  },
  {
    "path": "pkg/tunnel/direct.go",
    "content": "package tunnel\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/pkg/errors\"\n)\n\n// Tunnel defines the function to create an \"outer\" tunnel\ntype Tunnel func(ctx context.Context, stdin io.Reader, stdout io.Writer) error\n\n// NewTunnel creates a tunnel to the devcontainer using generic functions to establish the \"outer\" and \"inner\" tunnel, used by proxy clients\n// Here the tunnel will be an SSH connection with it's STDIO as arguments and the handler will be the function to execute the command\n// using the connected SSH client.\nfunc NewTunnel(ctx context.Context, tunnel Tunnel, handler Handler) error {\n\t// create context\n\tcancelCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\t// create readers\n\tstdoutReader, stdoutWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstdinReader, stdinWriter, err := os.Pipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stdoutWriter.Close()\n\tdefer stdinWriter.Close()\n\n\t// start ssh proxy\n\touterTunnelChan := make(chan error, 1)\n\tgo func() {\n\t\touterTunnelChan <- tunnel(ctx, stdinReader, stdoutWriter)\n\t}()\n\n\t// start ssh client as root / default user\n\tinnerTunnelChan := make(chan error, 1)\n\tgo func() {\n\t\tsshClient, err := devssh.StdioClient(stdoutReader, stdinWriter, false)\n\t\tif err != nil {\n\t\t\tinnerTunnelChan <- err\n\t\t\treturn\n\t\t}\n\t\tdefer sshClient.Close()\n\t\tdefer cancel()\n\n\t\t// start ssh tunnel\n\t\tinnerTunnelChan <- handler(cancelCtx, sshClient)\n\t}()\n\n\t// wait for result\n\tselect {\n\tcase err := <-innerTunnelChan:\n\t\treturn errors.Wrap(err, \"inner tunnel\")\n\tcase err := <-outerTunnelChan:\n\t\treturn errors.Wrap(err, \"outer tunnel\")\n\t}\n}\n"
  },
  {
    "path": "pkg/tunnel/forwarder.go",
    "content": "package tunnel\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/loft-sh/devpod/pkg/netstat\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/log\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// newForwarder returns a new forwarder using an SSH client and list of ports to forward,\n// for each port a new go routine is used to manage the SSH channel\nfunc newForwarder(sshClient *ssh.Client, forwardedPorts []string, log log.Logger) netstat.Forwarder {\n\treturn &forwarder{\n\t\tsshClient:      sshClient,\n\t\tforwardedPorts: forwardedPorts,\n\t\tportMap:        map[string]context.CancelFunc{},\n\t\tlog:            log,\n\t}\n}\n\n// forwarder multiplexes a SSH client to forward ports to the remote container\ntype forwarder struct {\n\tsync.Mutex\n\n\tsshClient      *ssh.Client\n\tforwardedPorts []string\n\n\tportMap map[string]context.CancelFunc\n\tlog     log.Logger\n}\n\n// Forward opens an SSH channel in the existing connection with channel type \"direct-tcpip\" to forward the local port\nfunc (f *forwarder) Forward(port string) error {\n\tf.Lock()\n\tdefer f.Unlock()\n\n\tif f.isExcluded(port) || f.portMap[port] != nil {\n\t\treturn nil\n\t}\n\n\tcancelCtx, cancel := context.WithCancel(context.Background())\n\tf.portMap[port] = cancel\n\tf.log.Infof(\"Start port-forwarding on port %s\", port)\n\n\tgo func(port string) {\n\t\t// do the forward\n\t\terr := devssh.PortForward(cancelCtx, f.sshClient, \"tcp\", \"localhost:\"+port, \"tcp\", \"localhost:\"+port, 0, f.log)\n\t\tif err != nil {\n\t\t\tf.log.Errorf(\"Error port forwarding %s: %v\", port, err)\n\t\t}\n\t}(port)\n\n\treturn nil\n}\n\n// StopForward stops the port forwarding for the given port\nfunc (f *forwarder) StopForward(port string) error {\n\tf.Lock()\n\tdefer f.Unlock()\n\n\tif f.isExcluded(port) || f.portMap[port] == nil {\n\t\treturn nil\n\t}\n\n\tf.log.Infof(\"Stop port-forwarding on port %s\", port)\n\tf.portMap[port]()\n\tdelete(f.portMap, port)\n\n\treturn nil\n}\n\nfunc (f *forwarder) isExcluded(port string) bool {\n\tfor _, p := range f.forwardedPorts {\n\t\tif p == port {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n"
  },
  {
    "path": "pkg/tunnel/services.go",
    "content": "package tunnel\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/go-connections/nat\"\n\t\"github.com/loft-sh/api/v4/pkg/devpod\"\n\t\"github.com/loft-sh/devpod/pkg/agent\"\n\t\"github.com/loft-sh/devpod/pkg/agent/tunnelserver\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tconfig2 \"github.com/loft-sh/devpod/pkg/devcontainer/config\"\n\t\"github.com/loft-sh/devpod/pkg/devcontainer/setup\"\n\t\"github.com/loft-sh/devpod/pkg/gitsshsigning\"\n\t\"github.com/loft-sh/devpod/pkg/ide/openvscode\"\n\t\"github.com/loft-sh/devpod/pkg/netstat\"\n\t\"github.com/loft-sh/devpod/pkg/provider\"\n\tdevssh \"github.com/loft-sh/devpod/pkg/ssh\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/crypto/ssh\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\t\"k8s.io/client-go/util/retry\"\n)\n\n// RunServices forwards the ports for a given workspace and uses it's SSH client to run the credentials server remotely and the services server locally to communicate with the container\nfunc RunServices(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tcontainerClient *ssh.Client,\n\tuser string,\n\tforwardPorts bool,\n\textraPorts []string,\n\tplatformOptions *devpod.PlatformOptions,\n\tworkspace *provider.Workspace,\n\tconfigureDockerCredentials, configureGitCredentials, configureGitSSHSignatureHelper bool,\n\tlog log.Logger,\n) error {\n\t// calculate exit after timeout\n\texitAfterTimeout := time.Second * 5\n\tif devPodConfig.ContextOption(config.ContextOptionExitAfterTimeout) != \"true\" {\n\t\texitAfterTimeout = 0\n\t}\n\n\t// forward ports\n\tforwardedPorts, err := forwardDevContainerPorts(ctx, containerClient, extraPorts, exitAfterTimeout, log)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"forward ports\")\n\t}\n\n\treturn retry.OnError(wait.Backoff{\n\t\tSteps:    math.MaxInt,\n\t\tDuration: 500 * time.Millisecond,\n\t\tFactor:   1,\n\t\tJitter:   0.1,\n\t}, func(err error) bool {\n\t\t// Always allow to retry. Potentially add exceptions in the future.\n\t\treturn true\n\t}, func() error {\n\t\tstdoutReader, stdoutWriter, err := os.Pipe()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer stdoutWriter.Close()\n\n\t\tstdinReader, stdinWriter, err := os.Pipe()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// start server on stdio\n\t\tcancelCtx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\n\t\t// create a port forwarder\n\t\tvar forwarder netstat.Forwarder\n\t\tif forwardPorts {\n\t\t\tforwarder = newForwarder(containerClient, append(forwardedPorts, fmt.Sprintf(\"%d\", openvscode.DefaultVSCodePort)), log)\n\t\t}\n\n\t\terrChan := make(chan error, 1)\n\t\tgo func() {\n\t\t\tdefer cancel()\n\t\t\tdefer stdinWriter.Close()\n\t\t\t// forward credentials to container\n\t\t\terr := tunnelserver.RunServicesServer(\n\t\t\t\tcancelCtx,\n\t\t\t\tstdoutReader,\n\t\t\t\tstdinWriter,\n\t\t\t\tconfigureGitCredentials,\n\t\t\t\tconfigureDockerCredentials,\n\t\t\t\tforwarder,\n\t\t\t\tworkspace,\n\t\t\t\tlog,\n\t\t\t\ttunnelserver.WithPlatformOptions(platformOptions),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- errors.Wrap(err, \"run tunnel server\")\n\t\t\t}\n\t\t\tclose(errChan)\n\t\t}()\n\n\t\t// run credentials server\n\t\twriter := log.ErrorStreamOnly().Writer(logrus.DebugLevel, false)\n\t\tdefer writer.Close()\n\n\t\tcommand := fmt.Sprintf(\"'%s' agent container credentials-server --user '%s'\", agent.ContainerDevPodHelperLocation, user)\n\t\tif configureGitCredentials {\n\t\t\tcommand += \" --configure-git-helper\"\n\t\t}\n\t\tif configureGitSSHSignatureHelper {\n\t\t\tformat, userSigningKey, err := gitsshsigning.ExtractGitConfiguration()\n\t\t\tif err == nil && format == gitsshsigning.GPGFormatSSH && userSigningKey != \"\" {\n\t\t\t\tencodedKey := base64.StdEncoding.EncodeToString([]byte(userSigningKey))\n\t\t\t\tcommand += fmt.Sprintf(\" --git-user-signing-key %s\", encodedKey)\n\t\t\t}\n\t\t}\n\t\tif configureDockerCredentials {\n\t\t\tcommand += \" --configure-docker-helper\"\n\t\t}\n\t\tif forwardPorts {\n\t\t\tcommand += \" --forward-ports\"\n\t\t}\n\t\tif log.GetLevel() == logrus.DebugLevel {\n\t\t\tcommand += \" --debug\"\n\t\t}\n\n\t\terr = devssh.Run(cancelCtx, containerClient, command, stdinReader, stdoutWriter, writer, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = <-errChan\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n}\n\n// forwardDevContainerPorts forwards all the ports defined in the devcontainer.json\nfunc forwardDevContainerPorts(ctx context.Context, containerClient *ssh.Client, extraPorts []string, exitAfterTimeout time.Duration, log log.Logger) ([]string, error) {\n\tstdout := &bytes.Buffer{}\n\tstderr := &bytes.Buffer{}\n\terr := devssh.Run(ctx, containerClient, \"cat \"+setup.ResultLocation, nil, stdout, stderr, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"retrieve container result: %s\\n%s%w\", stdout.String(), stderr.String(), err)\n\t}\n\n\t// parse result\n\tresult := &config2.Result{}\n\terr = json.Unmarshal(stdout.Bytes(), result)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing container result %s: %w\", stdout.String(), err)\n\t}\n\tlog.Debugf(\"Successfully parsed result at %s\", setup.ResultLocation)\n\n\t// return forwarded ports\n\tforwardedPorts := []string{}\n\n\t// extra ports\n\tfor _, port := range extraPorts {\n\t\tforwardedPorts = append(forwardedPorts, forwardPort(ctx, containerClient, port, exitAfterTimeout, log)...)\n\t}\n\n\t// app ports\n\tfor _, port := range result.MergedConfig.AppPort {\n\t\tforwardedPorts = append(forwardedPorts, forwardPort(ctx, containerClient, port, 0, log)...)\n\t}\n\n\t// forward ports\n\tfor _, port := range result.MergedConfig.ForwardPorts {\n\t\t// convert port\n\t\thost, portNumber, err := parseForwardPort(port)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Error parsing forwardPort %s: %v\", port, err)\n\t\t}\n\n\t\t// try to forward\n\t\tgo func(port string) {\n\t\t\tlog.Debugf(\"Forward port %s\", port)\n\t\t\terr = devssh.PortForward(\n\t\t\t\tctx,\n\t\t\t\tcontainerClient,\n\t\t\t\t\"tcp\",\n\t\t\t\tfmt.Sprintf(\"localhost:%d\", portNumber),\n\t\t\t\t\"tcp\",\n\t\t\t\tfmt.Sprintf(\"%s:%d\", host, portNumber),\n\t\t\t\t0,\n\t\t\t\tlog,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Error port forwarding %s: %v\", port, err)\n\t\t\t}\n\t\t}(port)\n\n\t\tforwardedPorts = append(forwardedPorts, port)\n\t}\n\n\treturn forwardedPorts, nil\n}\n\nfunc forwardPort(ctx context.Context, containerClient *ssh.Client, port string, exitAfterTimeout time.Duration, log log.Logger) []string {\n\tparsed, err := nat.ParsePortSpec(port)\n\tif err != nil {\n\t\tlog.Debugf(\"Error parsing appPort %s: %v\", port, err)\n\t\treturn nil\n\t}\n\n\t// try to forward\n\tforwardedPorts := []string{}\n\tfor _, parsedPort := range parsed {\n\t\tif parsedPort.Binding.HostIP == \"\" {\n\t\t\tparsedPort.Binding.HostIP = \"localhost\"\n\t\t}\n\t\tif parsedPort.Binding.HostPort == \"\" {\n\t\t\tparsedPort.Binding.HostPort = parsedPort.Port.Port()\n\t\t}\n\t\tgo func(parsedPort nat.PortMapping) {\n\t\t\t// do the forward\n\t\t\tlog.Debugf(\"Forward port %s:%s\", parsedPort.Binding.HostIP+\":\"+parsedPort.Binding.HostPort, \"localhost:\"+parsedPort.Port.Port())\n\t\t\terr = devssh.PortForward(ctx, containerClient, \"tcp\", parsedPort.Binding.HostIP+\":\"+parsedPort.Binding.HostPort, \"tcp\", \"localhost:\"+parsedPort.Port.Port(), exitAfterTimeout, log)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Error port forwarding %s:%s:%s: %v\", parsedPort.Binding.HostIP, parsedPort.Binding.HostPort, parsedPort.Port.Port(), err)\n\t\t\t}\n\t\t}(parsedPort)\n\n\t\tforwardedPorts = append(forwardedPorts, parsedPort.Binding.HostPort)\n\t}\n\n\treturn forwardedPorts\n}\n\nfunc parseForwardPort(port string) (string, int64, error) {\n\ttokens := strings.Split(port, \":\")\n\n\tif len(tokens) == 1 {\n\t\tport, err := strconv.ParseInt(tokens[0], 10, 64)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\t\treturn \"localhost\", port, nil\n\t}\n\n\tif len(tokens) == 2 {\n\t\tport, err := strconv.ParseInt(tokens[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\t\treturn tokens[0], port, nil\n\t}\n\n\treturn \"\", 0, fmt.Errorf(\"invalid forwardPorts port\")\n}\n"
  },
  {
    "path": "pkg/types/option.go",
    "content": "package types\n\ntype Option struct {\n\t// DisplayName of the option, preferred over the option name by a supporting tool.\n\tDisplayName string `json:\"displayName,omitempty\"`\n\n\t// A description of the option displayed to the user by a supporting tool.\n\tDescription string `json:\"description,omitempty\"`\n\n\t// If required is true and the user doesn't supply a value, devpod will ask the user\n\tRequired bool `json:\"required,omitempty\"`\n\n\t// If true, will not show the value to the user\n\tPassword bool `json:\"password,omitempty\"`\n\n\t// Type is the provider option type. Can be one of: string, multiline, duration, number or boolean. Defaults to string\n\tType string `json:\"type,omitempty\"`\n\n\t// ValidationPattern is a regex pattern to validate the value\n\tValidationPattern string `json:\"validationPattern,omitempty\"`\n\n\t// ValidationMessage is the message that appears if the user enters an invalid option\n\tValidationMessage string `json:\"validationMessage,omitempty\"`\n\n\t// Suggestions are suggestions to show in the DevPod UI for this option\n\tSuggestions []string `json:\"suggestions,omitempty\"`\n\n\t// Allowed values for this option.\n\tEnum OptionEnumArray `json:\"enum,omitempty\"`\n\n\t// Hidden specifies if the option should be hidden\n\tHidden bool `json:\"hidden,omitempty\"`\n\n\t// Local means the variable is not resolved immediately and instead later when the workspace / machine was created.\n\tLocal bool `json:\"local,omitempty\"`\n\n\t// Global means the variable is stored globally. By default, option values will be\n\t// saved per machine or workspace instead.\n\tGlobal bool `json:\"global,omitempty\"`\n\n\t// Default value if the user omits this option from their configuration.\n\tDefault string `json:\"default,omitempty\"`\n\n\t// Cache is the duration to cache the value before rerunning the command\n\tCache string `json:\"cache,omitempty\"`\n\n\t// Command is the command to run to specify an option\n\tCommand string `json:\"command,omitempty\"`\n\n\t// SubOptionsCommand is the command to run to fetch sub options\n\tSubOptionsCommand string `json:\"subOptionsCommand,omitempty\"`\n\n\t// Mutable specifies if an option can be changed on the workspace or machine after creating it\n\tMutable bool `json:\"mutable,omitempty\"`\n}\n"
  },
  {
    "path": "pkg/types/streams.go",
    "content": "package types\n\nimport \"io\"\n\ntype Streams struct {\n\tStdin  io.Reader\n\tStdout io.Writer\n\tStderr io.Writer\n}\n"
  },
  {
    "path": "pkg/types/time.go",
    "content": "/*\nCopyright 2014 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n)\n\n// Time is a wrapper around time.Time which supports correct\n// marshaling to YAML and JSON.  Wrappers are provided for many\n// of the factory methods that the time package offers.\n//\n// +protobuf.options.marshal=false\n// +protobuf.as=Timestamp\n// +protobuf.options.(gogoproto.goproto_stringer)=false\ntype Time struct {\n\ttime.Time `protobuf:\"-\"`\n}\n\n// DeepCopyInto creates a deep-copy of the Time value.  The underlying time.Time\n// type is effectively immutable in the time API, so it is safe to\n// copy-by-assign, despite the presence of (unexported) Pointer fields.\nfunc (t *Time) DeepCopyInto(out *Time) {\n\t*out = *t\n}\n\n// NewTime returns a wrapped instance of the provided time\nfunc NewTime(time time.Time) Time {\n\treturn Time{time}\n}\n\n// Date returns the Time corresponding to the supplied parameters\n// by wrapping time.Date.\nfunc Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time {\n\treturn Time{time.Date(year, month, day, hour, min, sec, nsec, loc)}\n}\n\n// Now returns the current local time.\nfunc Now() Time {\n\treturn Time{time.Now()}\n}\n\n// IsZero returns true if the value is nil or time is zero.\nfunc (t *Time) IsZero() bool {\n\tif t == nil {\n\t\treturn true\n\t}\n\treturn t.Time.IsZero()\n}\n\n// Before reports whether the time instant t is before u.\nfunc (t *Time) Before(u *Time) bool {\n\tif t != nil && u != nil {\n\t\treturn t.Time.Before(u.Time)\n\t}\n\treturn false\n}\n\n// Equal reports whether the time instant t is equal to u.\nfunc (t *Time) Equal(u *Time) bool {\n\tif t == nil && u == nil {\n\t\treturn true\n\t}\n\tif t != nil && u != nil {\n\t\treturn t.Time.Equal(u.Time)\n\t}\n\treturn false\n}\n\n// Unix returns the local time corresponding to the given Unix time\n// by wrapping time.Unix.\nfunc Unix(sec int64, nsec int64) Time {\n\treturn Time{time.Unix(sec, nsec)}\n}\n\n// Rfc3339Copy returns a copy of the Time at second-level precision.\nfunc (t Time) Rfc3339Copy() Time {\n\tcopied, _ := time.Parse(time.RFC3339, t.Format(time.RFC3339))\n\treturn Time{copied}\n}\n\n// UnmarshalJSON implements the json.Unmarshaller interface.\nfunc (t *Time) UnmarshalJSON(b []byte) error {\n\tif len(b) == 4 && string(b) == \"null\" {\n\t\tt.Time = time.Time{}\n\t\treturn nil\n\t}\n\n\tvar str string\n\terr := json.Unmarshal(b, &str)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpt, err := time.Parse(time.RFC3339, str)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tt.Time = pt.Local()\n\treturn nil\n}\n\n// UnmarshalQueryParameter converts from a URL query parameter value to an object\nfunc (t *Time) UnmarshalQueryParameter(str string) error {\n\tif len(str) == 0 {\n\t\tt.Time = time.Time{}\n\t\treturn nil\n\t}\n\t// Tolerate requests from older clients that used JSON serialization to build query params\n\tif len(str) == 4 && str == \"null\" {\n\t\tt.Time = time.Time{}\n\t\treturn nil\n\t}\n\n\tpt, err := time.Parse(time.RFC3339, str)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tt.Time = pt.Local()\n\treturn nil\n}\n\n// MarshalJSON implements the json.Marshaler interface.\nfunc (t Time) MarshalJSON() ([]byte, error) {\n\tif t.IsZero() {\n\t\t// Encode unset/nil objects as JSON's \"null\".\n\t\treturn []byte(\"null\"), nil\n\t}\n\tbuf := make([]byte, 0, len(time.RFC3339)+2)\n\tbuf = append(buf, '\"')\n\t// time cannot contain non escapable JSON characters\n\tbuf = t.UTC().AppendFormat(buf, time.RFC3339)\n\tbuf = append(buf, '\"')\n\treturn buf, nil\n}\n\n// ToUnstructured implements the value.UnstructuredConverter interface.\nfunc (t Time) ToUnstructured() interface{} {\n\tif t.IsZero() {\n\t\treturn nil\n\t}\n\tbuf := make([]byte, 0, len(time.RFC3339))\n\tbuf = t.UTC().AppendFormat(buf, time.RFC3339)\n\treturn string(buf)\n}\n\n// OpenAPISchemaType is used by the kube-openapi generator when constructing\n// the OpenAPI spec of this type.\n//\n// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators\nfunc (Time) OpenAPISchemaType() []string { return []string{\"string\"} }\n\n// OpenAPISchemaFormat is used by the kube-openapi generator when constructing\n// the OpenAPI spec of this type.\nfunc (Time) OpenAPISchemaFormat() string { return \"date-time\" }\n\n// MarshalQueryParameter converts to a URL query parameter value\nfunc (t Time) MarshalQueryParameter() (string, error) {\n\tif t.IsZero() {\n\t\t// Encode unset/nil objects as an empty string\n\t\treturn \"\", nil\n\t}\n\n\treturn t.UTC().Format(time.RFC3339), nil\n}\n"
  },
  {
    "path": "pkg/types/types.go",
    "content": "package types\n\nimport (\n\t\"encoding/json\"\n\t\"strconv\"\n\n\t\"github.com/pkg/errors\"\n)\n\nvar (\n\t// ErrUnsupportedType is returned if the type is not implemented\n\tErrUnsupportedType = errors.New(\"unsupported type\")\n)\n\n// StrIntArray string array to be used on JSON UnmarshalJSON\ntype StrIntArray []string\n\n// UnmarshalJSON convert JSON object array of string or\n// a string format strings to a golang string array\nfunc (sa *StrIntArray) UnmarshalJSON(data []byte) error {\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unmarshal str int array\")\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase string:\n\t\t*sa = StrIntArray([]string{obj})\n\t\treturn nil\n\tcase int:\n\t\t*sa = StrIntArray([]string{strconv.Itoa(obj)})\n\t\treturn nil\n\tcase float64:\n\t\t*sa = StrIntArray([]string{strconv.Itoa(int(obj))})\n\t\treturn nil\n\tcase []interface{}:\n\t\ts := make([]string, 0, len(obj))\n\t\tfor _, v := range obj {\n\t\t\tswitch value := v.(type) {\n\t\t\tcase string:\n\t\t\t\ts = append(s, value)\n\t\t\tcase int:\n\t\t\t\ts = append(s, strconv.Itoa(value))\n\t\t\tcase float64:\n\t\t\t\ts = append(s, strconv.Itoa(int(value)))\n\t\t\tdefault:\n\t\t\t\treturn ErrUnsupportedType\n\t\t\t}\n\t\t}\n\t\t*sa = StrIntArray(s)\n\t\treturn nil\n\t}\n\treturn ErrUnsupportedType\n}\n\n// StrArray string array to be used on JSON UnmarshalJSON\ntype StrArray []string\n\n// UnmarshalJSON convert JSON object array of string or\n// a string format strings to a golang string array\nfunc (sa *StrArray) UnmarshalJSON(data []byte) error {\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase string:\n\t\t*sa = StrArray([]string{obj})\n\t\treturn nil\n\tcase []interface{}:\n\t\ts := make([]string, 0, len(obj))\n\t\tfor _, v := range obj {\n\t\t\tvalue, ok := v.(string)\n\t\t\tif !ok {\n\t\t\t\treturn ErrUnsupportedType\n\t\t\t}\n\t\t\ts = append(s, value)\n\t\t}\n\t\t*sa = StrArray(s)\n\t\treturn nil\n\t}\n\treturn ErrUnsupportedType\n}\n\ntype LifecycleHook map[string][]string\n\nfunc (l *LifecycleHook) UnmarshalJSON(data []byte) error {\n\t*l = make(map[string][]string)\n\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase string:\n\t\t// Anonymous string command\n\t\t(*l)[\"\"] = []string{obj}\n\t\treturn nil\n\tcase []interface{}:\n\t\t// Anonymous array of strings command\n\t\tcmd := make([]string, 0)\n\t\tfor _, v := range obj {\n\t\t\tvalue, ok := v.(string)\n\t\t\tif !ok {\n\t\t\t\treturn ErrUnsupportedType\n\t\t\t}\n\t\t\tcmd = append(cmd, value)\n\t\t}\n\t\t(*l)[\"\"] = cmd\n\t\treturn nil\n\tcase map[string]interface{}:\n\t\tfor k, v := range obj {\n\t\t\tvalue, ok := v.(string)\n\t\t\tif ok {\n\t\t\t\t// Named string command\n\t\t\t\t(*l)[k] = []string{value}\n\t\t\t} else {\n\t\t\t\t// Named array of strings command\n\t\t\t\tstringArrayValue, ok := v.([]interface{})\n\t\t\t\tif !ok {\n\t\t\t\t\treturn ErrUnsupportedType\n\t\t\t\t}\n\n\t\t\t\tcmd := make([]string, 0)\n\t\t\t\tfor _, v := range stringArrayValue {\n\t\t\t\t\tcmd = append(cmd, v.(string))\n\t\t\t\t}\n\t\t\t\t(*l)[k] = cmd\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn ErrUnsupportedType\n}\n\ntype StrBool string\n\n// UnmarshalJSON parses fields that may be numbers or booleans.\nfunc (s *StrBool) UnmarshalJSON(data []byte) error {\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase string:\n\t\t*s = StrBool(obj)\n\t\treturn nil\n\tcase bool:\n\t\t*s = StrBool(strconv.FormatBool(obj))\n\t\treturn nil\n\t}\n\treturn ErrUnsupportedType\n}\n\nfunc (s *StrBool) Bool() (bool, error) {\n\tif s == nil {\n\t\treturn false, nil\n\t}\n\n\treturn strconv.ParseBool(string(*s))\n}\n\ntype OptionEnum struct {\n\tValue       string `json:\"value,omitempty\"`\n\tDisplayName string `json:\"displayName,omitempty\"`\n}\n\ntype OptionEnumArray []OptionEnum\n\nfunc (e *OptionEnumArray) UnmarshalJSON(data []byte) error {\n\tvar jsonObj interface{}\n\terr := json.Unmarshal(data, &jsonObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch obj := jsonObj.(type) {\n\tcase []interface{}:\n\t\tif len(obj) == 0 {\n\t\t\t*e = OptionEnumArray{}\n\t\t\treturn nil\n\t\t}\n\t\tret := make([]OptionEnum, 0, len(obj))\n\t\tswitch obj[0].(type) {\n\t\tcase string:\n\t\t\tfor _, v := range obj {\n\t\t\t\tif s, ok := v.(string); ok {\n\t\t\t\t\tret = append(ret, OptionEnum{Value: s})\n\t\t\t\t}\n\t\t\t}\n\t\tcase map[string]interface{}:\n\t\t\tfor _, v := range obj {\n\t\t\t\tm, ok := v.(map[string]interface{})\n\t\t\t\tif !ok {\n\t\t\t\t\treturn ErrUnsupportedType\n\t\t\t\t}\n\t\t\t\tvalue := \"\"\n\t\t\t\tif s, ok := m[\"value\"].(string); ok {\n\t\t\t\t\tvalue = s\n\t\t\t\t}\n\t\t\t\tdisplayName := \"\"\n\t\t\t\tif s, ok := m[\"displayName\"].(string); ok {\n\t\t\t\t\tdisplayName = s\n\t\t\t\t}\n\t\t\t\tret = append(ret, OptionEnum{\n\t\t\t\t\tValue:       value,\n\t\t\t\t\tDisplayName: displayName,\n\t\t\t\t})\n\t\t\t}\n\t\tdefault:\n\t\t\treturn ErrUnsupportedType\n\t\t}\n\n\t\t*e = OptionEnumArray(ret)\n\t\treturn nil\n\t}\n\n\treturn ErrUnsupportedType\n}\n"
  },
  {
    "path": "pkg/types/types_test.go",
    "content": "package types_test\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"gotest.tools/assert\"\n)\n\nfunc TestLifecycleHookUnmarshalJSON(t *testing.T) {\n\ttype input struct {\n\t\tInput types.LifecycleHook `json:\"input,omitempty\"`\n\t}\n\n\ttestCases := []struct {\n\t\tName   string\n\t\tInput  string\n\t\tExpect input\n\t}{\n\t\t{\n\t\t\tName:  \"string\",\n\t\t\tInput: `{\"input\": \"some-string\"}`,\n\t\t\tExpect: input{\n\t\t\t\tInput: types.LifecycleHook{\n\t\t\t\t\t\"\": []string{\"some-string\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName:  \"array of strings\",\n\t\t\tInput: `{\"input\": [\"string1\", \"string2\"]}`,\n\t\t\tExpect: input{\n\t\t\t\tInput: types.LifecycleHook{\n\t\t\t\t\t\"\": []string{\n\t\t\t\t\t\t\"string1\",\n\t\t\t\t\t\t\"string2\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName:  \"object of strings\",\n\t\t\tInput: `{\"input\": {\"key1\": \"value1\", \"key2\": \"value2\"}}`,\n\t\t\tExpect: input{\n\t\t\t\tInput: types.LifecycleHook{\n\t\t\t\t\t\"key1\": []string{\n\t\t\t\t\t\t\"value1\",\n\t\t\t\t\t},\n\t\t\t\t\t\"key2\": []string{\n\t\t\t\t\t\t\"value2\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName:  \"object of array of strings\",\n\t\t\tInput: `{\"input\": {\"key1\": [\"value1\",\"value2\"], \"key2\": [\"value3\",\"value4\"]}}`,\n\t\t\tExpect: input{\n\t\t\t\tInput: types.LifecycleHook{\n\t\t\t\t\t\"key1\": []string{\n\t\t\t\t\t\t\"value1\",\n\t\t\t\t\t\t\"value2\",\n\t\t\t\t\t},\n\t\t\t\t\t\"key2\": []string{\n\t\t\t\t\t\t\"value3\",\n\t\t\t\t\t\t\"value4\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.Name, func(t *testing.T) {\n\t\t\tvar data input\n\n\t\t\terr := json.Unmarshal([]byte(testCase.Input), &data)\n\t\t\tassert.NilError(t, err, testCase.Name)\n\n\t\t\tassert.DeepEqual(t, testCase.Expect, data)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/upgrade/upgrade.go",
    "content": "package upgrade\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\n\tversionpkg \"github.com/loft-sh/devpod/pkg/version\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/blang/semver\"\n\t\"github.com/rhysd/go-github-selfupdate/selfupdate\"\n)\n\n// Version holds the current version tag\nvar version string = strings.TrimPrefix(versionpkg.GetVersion(), \"v\")\nvar devVersion string = strings.TrimPrefix(versionpkg.DevVersion, \"v\")\n\nvar githubSlug = \"loft-sh/devpod\"\n\nfunc PrintNewerVersionWarning() {\n\tif os.Getenv(\"DEVPOD_SKIP_VERSION_CHECK\") != \"true\" {\n\t\t// Get version of current binary\n\t\tlatestVersion := NewerVersionAvailable()\n\t\tif latestVersion != \"\" {\n\t\t\tlog.GetInstance().Warnf(\"There is a newer version of devpod: v%s. Run `devpod upgrade` to upgrade to the newest version.\\n\", latestVersion)\n\t\t}\n\t}\n}\n\nvar (\n\tlatestVersion     string\n\terrLatestVersion  error\n\tlatestVersionOnce sync.Once\n)\n\n// CheckForNewerVersion checks if there is a newer version on github and returns the newer version\nfunc CheckForNewerVersion() (string, error) {\n\tlatestVersionOnce.Do(func() {\n\t\tlatest, found, err := selfupdate.DetectLatest(githubSlug)\n\t\tif err != nil {\n\t\t\terrLatestVersion = err\n\t\t\treturn\n\t\t}\n\n\t\tv := semver.MustParse(version)\n\t\tif !found || latest.Version.Equals(v) {\n\t\t\treturn\n\t\t}\n\n\t\tlatestVersion = latest.Version.String()\n\t})\n\n\treturn latestVersion, errLatestVersion\n}\n\n// NewerVersionAvailable checks if there is a newer version of devpod\nfunc NewerVersionAvailable() string {\n\tif version == devVersion {\n\t\treturn \"\"\n\t}\n\n\tif version != \"\" {\n\t\tlatestStableVersion, err := CheckForNewerVersion()\n\t\tif latestStableVersion != \"\" && err == nil { // Check versions only if newest version could be determined without errors\n\t\t\tsemverVersion, err := semver.Parse(version)\n\t\t\tif err == nil { // Only compare version if version can be parsed\n\t\t\t\tsemverLatestStableVersion, err := semver.Parse(latestStableVersion)\n\t\t\t\tif err == nil { // Only compare version if latestStableVersion can be parsed\n\t\t\t\t\t// If latestStableVersion > version\n\t\t\t\t\tif semverLatestStableVersion.Compare(semverVersion) == 1 {\n\t\t\t\t\t\treturn latestStableVersion\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\n// Upgrade downloads the latest release from github and replaces devpod if a new version is found\nfunc Upgrade(flagVersion string, log log.Logger) error {\n\tupdater, err := selfupdate.NewUpdater(selfupdate.Config{\n\t\tFilters: []string{\"devpod\"},\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to initialize updater: %w\", err)\n\t}\n\tif flagVersion != \"\" {\n\t\trelease, found, err := updater.DetectVersion(githubSlug, flagVersion)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"find version\")\n\t\t} else if !found {\n\t\t\treturn fmt.Errorf(\"devpod version %s couldn't be found\", flagVersion)\n\t\t}\n\n\t\tcmdPath, err := os.Executable()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tlog.Infof(\"Downloading version %s...\", flagVersion)\n\t\terr = updater.UpdateTo(release, cmdPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tlog.Donef(\"Successfully updated devpod to version %s\", flagVersion)\n\t\treturn nil\n\t}\n\n\tnewerVersion, err := CheckForNewerVersion()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif newerVersion == \"\" {\n\t\tlog.Infof(\"Current binary is the latest version: %s\", version)\n\t\treturn nil\n\t}\n\n\tv := semver.MustParse(version)\n\n\tlog.Info(\"Downloading newest version...\")\n\tlatest, err := updater.UpdateSelf(v, githubSlug)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif latest.Version.Equals(v) {\n\t\t// latest version is the same as current version. It means current binary is up to date.\n\t\tlog.Infof(\"Current binary is the latest version: %s\", version)\n\t} else {\n\t\tlog.Donef(\"Successfully updated to version %s\", latest.Version)\n\t\tlog.Infof(\"Release note: \\n\\n%s\", latest.ReleaseNotes)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/util/hash/hash.go",
    "content": "package hash\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/longpath\"\n\t\"github.com/moby/patternmatcher\"\n\t\"github.com/pkg/errors\"\n)\n\nvar (\n\tmaxFilesToRead       = 5000\n\terrFileReadOverLimit = errors.New(\"read files over limit\")\n)\n\nfunc DirectoryHash(srcPath string, excludePatterns, includeFiles []string) (string, error) {\n\tsrcPath, err := filepath.Abs(srcPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Stat dir / file\n\thash := sha256.New()\n\tfileInfo, err := os.Stat(srcPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Hash file\n\tif !fileInfo.IsDir() {\n\t\treturn \"\", nil\n\t}\n\n\t// Fix the source path to work with long path names. This is a no-op\n\t// on platforms other than Windows.\n\tif runtime.GOOS == \"windows\" {\n\t\tsrcPath = longpath.AddPrefix(srcPath)\n\t}\n\n\tpm, err := patternmatcher.New(excludePatterns)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// In general we log errors here but ignore them because\n\t// during e.g. a diff operation the container can continue\n\t// mutating the filesystem and we can see transient errors\n\t// from this\n\tstat, err := os.Lstat(srcPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif !stat.IsDir() {\n\t\treturn \"\", errors.Errorf(\"Path %s is not a directory\", srcPath)\n\t}\n\n\tinclude := \".\"\n\tseen := make(map[string]bool)\n\n\tretFiles := []string{}\n\twalkRoot := filepath.Join(srcPath, include)\n\terr = filepath.Walk(walkRoot, func(filePath string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn errors.Errorf(\"Hash: Can't stat file %s to hash: %s\", srcPath, err)\n\t\t}\n\n\t\tif len(retFiles) >= maxFilesToRead {\n\t\t\treturn errFileReadOverLimit\n\t\t}\n\n\t\trelFilePath, err := filepath.Rel(srcPath, filePath)\n\t\tif err != nil {\n\t\t\t// Error getting relative path OR we are looking\n\t\t\t// at the source directory path. Skip in both situations.\n\t\t\treturn err\n\t\t}\n\t\trelFilePath = filepath.ToSlash(relFilePath)\n\n\t\t// Ensure file affects build context\n\t\tinclude := false\n\t\tfor _, f := range includeFiles {\n\t\t\tif strings.HasPrefix(relFilePath, f) {\n\t\t\t\tinclude = true\n\t\t\t}\n\t\t}\n\t\tif !include {\n\t\t\treturn nil\n\t\t}\n\n\t\tskip := false\n\n\t\t// If \"include\" is an exact match for the current file\n\t\t// then even if there's an \"excludePatterns\" pattern that\n\t\t// matches it, don't skip it. IOW, assume an explicit 'include'\n\t\t// is asking for that file no matter what - which is true\n\t\t// for some files, like .dockerignore and Dockerfile (sometimes)\n\t\tif relFilePath != \".\" {\n\t\t\tskip, err = pm.MatchesOrParentMatches(relFilePath)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Errorf(\"Error matching %s: %v\", relFilePath, err)\n\t\t\t}\n\t\t}\n\n\t\tif skip {\n\t\t\t// If we want to skip this file and its a directory\n\t\t\t// then we should first check to see if there's an\n\t\t\t// excludes pattern (e.g. !dir/file) that starts with this\n\t\t\t// dir. If so then we can't skip this dir.\n\n\t\t\t// Its not a dir then so we can just return/skip.\n\t\t\tif !f.IsDir() {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// No exceptions (!...) in patterns so just skip dir\n\t\t\tif !pm.Exclusions() {\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\tdirSlash := relFilePath + string(filepath.Separator)\n\t\t\tfor _, pat := range pm.Patterns() {\n\t\t\t\tif !pat.Exclusion() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif strings.HasPrefix(pat.String()+string(filepath.Separator), dirSlash) {\n\t\t\t\t\t// found a match - so can't skip this dir\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// No matching exclusion dir so just skip dir\n\t\t\treturn filepath.SkipDir\n\t\t}\n\n\t\tif seen[relFilePath] {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Path is enough\n\t\tseen[relFilePath] = true\n\t\tif !f.IsDir() {\n\t\t\t// Check file change\n\t\t\tchecksum, err := hashFileCRC32(filePath, 0xedb88320)\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tretFiles = append(retFiles, relFilePath+\";\"+checksum)\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil && !errors.Is(err, errFileReadOverLimit) {\n\t\treturn \"\", errors.Errorf(\"Error hashing %s: %v\", srcPath, err)\n\t}\n\n\t// add to hash\n\tsort.Strings(retFiles)\n\tfor _, f := range retFiles {\n\t\t_, _ = hash.Write([]byte(f))\n\t}\n\tif len(retFiles) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\treturn fmt.Sprintf(\"%x\", hash.Sum(nil)), nil\n}\n\nfunc hashFileCRC32(filePath string, polynomial uint32) (string, error) {\n\t//Initialize an empty return string now in case an error has to be returned\n\tvar returnCRC32String string\n\n\t//Open the fhe file located at the given path and check for errors\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn returnCRC32String, err\n\t}\n\n\t//Tell the program to close the file when the function returns\n\tdefer file.Close()\n\n\t//Create the table with the given polynomial\n\ttablePolynomial := crc32.MakeTable(polynomial)\n\n\t//Open a new hash interface to write the file to\n\thash := crc32.New(tablePolynomial)\n\n\t//Copy the file in the interface\n\tif _, err := io.Copy(hash, file); err != nil {\n\t\treturn returnCRC32String, err\n\t}\n\n\t//Generate the hash\n\thashInBytes := hash.Sum(nil)[:]\n\n\t//Encode the hash to a string\n\treturnCRC32String = hex.EncodeToString(hashInBytes)\n\n\t//Return the output\n\treturn returnCRC32String, nil\n}\n"
  },
  {
    "path": "pkg/util/homedir.go",
    "content": "package util\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// UserHomeDir returns the home directory for the executing user.\n//\n// This extends the logic of os.UserHomeDir() with the now archived package\n// github.com/mitchellh/go-homedir for compatibility.\nfunc UserHomeDir() (string, error) {\n\t// Always try the HOME environment variable first\n\thomeEnv := \"HOME\"\n\tif runtime.GOOS == \"plan9\" {\n\t\thomeEnv = \"home\"\n\t}\n\tif home := os.Getenv(homeEnv); home != \"\" {\n\t\treturn home, nil\n\t}\n\n\t// Rely on os.UserHomeDir() here, as it's the standard method moving forward\n\tif home, _ := os.UserHomeDir(); home != \"\" {\n\t\treturn home, nil\n\t}\n\n\tvar stdout bytes.Buffer\n\n\t// Finally, handle cases existed in go-homedir but not in the current\n\t// os.UserHomeDir() implementation\n\tswitch runtime.GOOS {\n\tcase \"windows\":\n\t\tdrive := os.Getenv(\"HOMEDRIVE\")\n\t\tpath := os.Getenv(\"HOMEPATH\")\n\t\tif drive == \"\" || path == \"\" {\n\t\t\treturn \"\", errors.New(\"HOMEDRIVE, HOMEPATH, or USERPROFILE are blank\")\n\t\t}\n\t\treturn drive + path, nil\n\tcase \"darwin\":\n\t\tcmd := exec.Command(\"sh\", \"-c\", `dscl -q . -read /Users/\"$(whoami)\" NFSHomeDirectory | sed 's/^[^ ]*: //'`)\n\t\tcmd.Stdout = &stdout\n\t\tif err := cmd.Run(); err == nil {\n\t\t\tresult := strings.TrimSpace(stdout.String())\n\t\t\tif result != \"\" {\n\t\t\t\treturn result, nil\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tcmd := exec.Command(\"getent\", \"passwd\", strconv.Itoa(os.Getuid()))\n\t\tcmd.Stdout = &stdout\n\t\tif err := cmd.Run(); err != nil {\n\t\t\t// If the error is ErrNotFound, we ignore it. Otherwise, return it.\n\t\t\tif errors.Is(err, exec.ErrNotFound) {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t} else {\n\t\t\tif passwd := strings.TrimSpace(stdout.String()); passwd != \"\" {\n\t\t\t\t// username:password:uid:gid:gecos:home:shell\n\t\t\t\tpasswdParts := strings.SplitN(passwd, \":\", 7)\n\t\t\t\tif len(passwdParts) > 5 {\n\t\t\t\t\treturn passwdParts[5], nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// If all else fails, try the shell\n\tif runtime.GOOS != \"windows\" {\n\t\tstdout.Reset()\n\t\tcmd := exec.Command(\"sh\", \"-c\", \"cd && pwd\")\n\t\tcmd.Stdout = &stdout\n\t\tif err := cmd.Run(); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tresult := strings.TrimSpace(stdout.String())\n\t\tif result == \"\" {\n\t\t\treturn \"\", errors.New(\"blank output when reading home directory\")\n\t\t}\n\n\t\treturn result, nil\n\t}\n\n\treturn \"\", errors.New(\"can't determine the home directory\")\n}\n"
  },
  {
    "path": "pkg/util/homedir_test.go",
    "content": "package util\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n)\n\nfunc TestUserHomeDir(t *testing.T) {\n\t// Remember to reset environment variables after the test\n\torigHome := os.Getenv(\"HOME\")\n\torigUserProfile := os.Getenv(\"USERPROFILE\")\n\tt.Cleanup(func() {\n\t\tos.Setenv(\"HOME\", origHome)\n\t\tos.Setenv(\"USERPROFILE\", origUserProfile)\n\t})\n\n\ttype input struct {\n\t\thome, userProfile string\n\t}\n\n\ttype testCase struct {\n\t\tName   string\n\t\tInput  input\n\t\tExpect string\n\t}\n\n\ttestCases := []testCase{\n\t\t{\n\t\t\t// $HOME is preferred on every platform\n\t\t\tName: \"both HOME and USERPROFILE are set\",\n\t\t\tInput: input{\n\t\t\t\thome:        \"home\",\n\t\t\t\tuserProfile: \"userProfile\",\n\t\t\t},\n\t\t\tExpect: \"home\",\n\t\t},\n\t}\n\tif runtime.GOOS == \"windows\" {\n\t\t// On Windows, after $HOME, %userprofile% value is checked\n\t\ttestCases = append(testCases, testCase{\n\t\t\tName: \"HOME is unset and USERPROFILE is set\",\n\t\t\tInput: input{\n\t\t\t\thome:        \"\",\n\t\t\t\tuserProfile: \"userProfile\",\n\t\t\t},\n\t\t\tExpect: \"userProfile\",\n\t\t})\n\t}\n\n\tfor _, test := range testCases {\n\t\tt.Run(test.Name, func(t *testing.T) {\n\t\t\tos.Setenv(\"HOME\", test.Input.home)\n\t\t\tos.Setenv(\"USERPROFILE\", test.Input.userProfile)\n\n\t\t\tgot, err := UserHomeDir()\n\t\t\tassert.NilError(t, err, test.Name)\n\t\t\tassert.Equal(t, test.Expect, got)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/util/rand.go",
    "content": "package util\n\nimport (\n\t\"math/rand\"\n)\n\nconst letterBytes = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfunc RandStringBytes(n int) string {\n\tb := make([]byte, n)\n\tfor i := range b {\n\t\tb[i] = letterBytes[rand.Intn(len(letterBytes))]\n\t}\n\treturn string(b)\n}\n"
  },
  {
    "path": "pkg/version/version.go",
    "content": "package version\n\nimport \"strings\"\n\nvar DevVersion = \"v0.0.0\"\n\nvar version = \"v0.0.0\"\n\nfunc GetVersion() string {\n\treturn version\n}\n\nfunc GetMajorVersion() string {\n\t// use golang.org/x/mod/semver instead?\n\ts := strings.Split(strings.TrimLeft(GetVersion(), \"v\"), \".\")\n\treturn s[0]\n}\n\nfunc GetMinorVersion() string {\n\ts := strings.Split(strings.TrimLeft(GetVersion(), \"v\"), \".\")\n\tif len(s) >= 2 {\n\t\treturn s[1]\n\t}\n\treturn \"\"\n}\n\nfunc GetPatchVersion() string {\n\ts := strings.Split(strings.TrimLeft(GetVersion(), \"v\"), \".\")\n\tif len(s) >= 3 {\n\t\treturn strings.SplitN(s[2], \"-\", 2)[0]\n\t}\n\treturn \"\"\n}\n\nfunc GetPrerelease() string {\n\ts := strings.SplitN(GetVersion(), \"-\", 2)\n\tif len(s) >= 2 {\n\t\t// remove build\n\t\treturn strings.Split(s[1], \"+\")[0]\n\t}\n\treturn \"\"\n}\n\nfunc GetBuild() string {\n\ts := strings.SplitN(GetVersion(), \"+\", 2)\n\tif len(s) >= 2 {\n\t\treturn s[1]\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "pkg/workspace/delete.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tclient2 \"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc Delete(ctx context.Context, devPodConfig *config.Config, args []string, ignoreNotFound, force bool, deleteOptions client2.DeleteOptions, owner platform.OwnerFilter, log log.Logger) (string, error) {\n\t// try to load workspace\n\tclient, err := Get(ctx, devPodConfig, args, false, owner, false, log)\n\tif err != nil {\n\t\tif len(args) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"cannot delete workspace because there was an error loading the workspace: %w. Please specify the id of the workspace you want to delete. E.g. 'devpod delete my-workspace --force'\", err)\n\t\t}\n\n\t\tworkspaceID := Exists(ctx, devPodConfig, args, \"\", owner, log)\n\t\tif workspaceID == \"\" {\n\t\t\tif ignoreNotFound {\n\t\t\t\treturn \"\", nil\n\t\t\t}\n\n\t\t\treturn \"\", fmt.Errorf(\"couldn't find workspace %s\", args[0])\n\t\t} else if !force {\n\t\t\tlog.Errorf(\"cannot delete workspace because there was an error loading the workspace. Run with --force to ignore this error\")\n\t\t\treturn \"\", err\n\t\t}\n\n\t\t// print error\n\t\tlog.Errorf(\"Error retrieving workspace: %v\", err)\n\n\t\t// delete workspace folder\n\t\terr = clientimplementation.DeleteWorkspaceFolder(devPodConfig.DefaultContext, workspaceID, \"\", log)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tlog.Donef(\"Successfully deleted workspace '%s'\", workspaceID)\n\t\treturn workspaceID, nil\n\t}\n\n\t// only remove local folder if workspace is imported or pro\n\tworkspaceConfig := client.WorkspaceConfig()\n\tif !force && workspaceConfig.Imported {\n\t\t// delete workspace folder\n\t\terr = clientimplementation.DeleteWorkspaceFolder(devPodConfig.DefaultContext, client.Workspace(), workspaceConfig.SSHConfigPath, log)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tlog.Donef(\"Skip remote deletion of workspace %s, if you really want to delete this workspace also remotely, run with --force\", client.Workspace())\n\t\treturn client.Workspace(), nil\n\t}\n\n\t// get instance status\n\tif !force {\n\t\t// lock workspace only if we don't force deletion\n\t\tif !deleteOptions.Platform.Enabled {\n\t\t\terr := client.Lock(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tdefer client.Unlock()\n\t\t}\n\n\t\t// retrieve instance status\n\t\tinstanceStatus, err := client.Status(ctx, client2.StatusOptions{})\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t} else if instanceStatus == client2.StatusNotFound {\n\t\t\treturn \"\", fmt.Errorf(\"cannot delete workspace because it couldn't be found. Run with --force to ignore this error\")\n\t\t}\n\t}\n\n\t// delete if single machine provider\n\twasDeleted, err := deleteSingleMachine(ctx, client, devPodConfig, deleteOptions, log)\n\tif err != nil {\n\t\treturn \"\", err\n\t} else if wasDeleted {\n\t\treturn client.Workspace(), nil\n\t}\n\n\t// destroy environment\n\terr = client.Delete(ctx, deleteOptions)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn client.Workspace(), nil\n}\n\nfunc deleteSingleMachine(ctx context.Context, client client2.BaseWorkspaceClient, devPodConfig *config.Config, deleteOptions client2.DeleteOptions, log log.Logger) (bool, error) {\n\t// check if single machine\n\tsingleMachineName := SingleMachineName(devPodConfig, client.Provider(), log)\n\tif !devPodConfig.Current().IsSingleMachine(client.Provider()) || client.WorkspaceConfig().Machine.ID != singleMachineName {\n\t\treturn false, nil\n\t}\n\n\t// try to find other workspace with same machine\n\tworkspaces, err := List(ctx, devPodConfig, false, platform.SelfOwnerFilter, log)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"list workspaces\")\n\t}\n\n\t// loop workspaces\n\tfoundOther := false\n\tfor _, workspace := range workspaces {\n\t\tif workspace.ID == client.Workspace() || workspace.Machine.ID != singleMachineName {\n\t\t\tcontinue\n\t\t}\n\n\t\tfoundOther = true\n\t\tbreak\n\t}\n\tif foundOther {\n\t\treturn false, nil\n\t}\n\n\t// if we haven't found another workspace on this machine, delete the whole machine\n\tmachineClient, err := GetMachine(devPodConfig, []string{singleMachineName}, log)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"get machine\")\n\t}\n\n\t// delete the machine\n\terr = machineClient.Delete(ctx, deleteOptions)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"delete machine\")\n\t}\n\n\t// delete workspace folder\n\terr = clientimplementation.DeleteWorkspaceFolder(client.Context(), client.Workspace(), client.WorkspaceConfig().SSHConfigPath, log)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tlog.Donef(\"Successfully deleted workspace '%s'\", client.Workspace())\n\treturn true, nil\n}\n"
  },
  {
    "path": "pkg/workspace/id.go",
    "content": "package workspace\n\nimport (\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/loft-sh/devpod/pkg/git\"\n)\n\nvar (\n\tworkspaceIDRegEx1 = regexp.MustCompile(`[^\\w\\-]`)\n\tworkspaceIDRegEx2 = regexp.MustCompile(`[^0-9a-z\\-]+`)\n\n\tbranchRegEx      = regexp.MustCompile(`[^a-zA-Z0-9\\.\\-]+`)\n\tprReferenceRegEx = regexp.MustCompile(git.PullRequestReference)\n)\n\nfunc ToID(str string) string {\n\tstr = strings.ToLower(filepath.ToSlash(str))\n\tsplitted := strings.Split(str, \"@\")\n\tif len(splitted) == 2 {\n\t\t// 1. Check if PR was specified\n\t\tif prReferenceRegEx.MatchString(str) {\n\t\t\tstr = prReferenceRegEx.ReplaceAllStringFunc(splitted[1], git.GetIDForPR)\n\t\t} else {\n\t\t\t// 2. Check if a branch name has been specified, if so use this for the ID\n\t\t\tstr = strings.TrimSuffix(splitted[1], \".git\")\n\t\t\t// Check if branch name matches expected regex\n\t\t\tif !branchRegEx.MatchString(str) {\n\t\t\t\tstr = splitted[0]\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Ensure we don't have a single trailing slash\n\t\tstr = strings.TrimSuffix(str, \"/\")\n\t\t// 3. If not, then parse the repo name as ID\n\t\tindex := strings.LastIndex(str, \"/\")\n\t\tif index != -1 {\n\t\t\tstr = str[index+1:]\n\n\t\t\t// remove a potential tag / branch name\n\t\t\tif len(splitted) == 2 && !branchRegEx.MatchString(splitted[1]) {\n\t\t\t\tstr = splitted[0]\n\t\t\t}\n\n\t\t\t// remove .git if there is it\n\t\t\tstr = strings.TrimSuffix(str, \".git\")\n\t\t}\n\t}\n\n\tstr = workspaceIDRegEx2.ReplaceAllString(workspaceIDRegEx1.ReplaceAllString(str, \"-\"), \"\")\n\tif len(str) > 48 {\n\t\tstr = str[:48]\n\t}\n\n\treturn strings.Trim(str, \"-\")\n}\n"
  },
  {
    "path": "pkg/workspace/id_test.go",
    "content": "package workspace\n\nimport (\n\t\"testing\"\n)\n\n// TestToID takes in a string which represents a workspace source and returns an appropriate\n// _human readable_ ID for it.\n// Note that these tests document the status quo and not the ideal state.\n// I've created follow up tickets to adjust the ToID function and update the tests but because\n// this is a potentially breaking change we'll have to wait for the next major version.\nfunc TestToID(t *testing.T) {\n\ttests := []struct {\n\t\tname  string\n\t\tinput string\n\t\twant  string\n\t}{\n\t\t{\n\t\t\tname:  \"Simple URL, no @, parse repo name\",\n\t\t\tinput: \"github.com/loft-sh/devpod\",\n\t\t\twant:  \"devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"URL with .git suffix\",\n\t\t\tinput: \"github.com/loft-sh/devpod.git\",\n\t\t\twant:  \"devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"URL with .git suffix and https prefix\",\n\t\t\tinput: \"https://github.com/loft-sh/devpod.git\",\n\t\t\twant:  \"devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"URL with trailing slash\",\n\t\t\tinput: \"github.com/loft-sh/devpod/\",\n\t\t\twant:  \"devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"Bare string with no slash\",\n\t\t\tinput: \"myrepo\",\n\t\t\twant:  \"myrepo\",\n\t\t},\n\t\t{\n\t\t\tname:  \"Local directory\",\n\t\t\tinput: \"/home/loft/devpod\",\n\t\t\twant:  \"devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"Branch with valid characters\",\n\t\t\tinput: \"github.com/loft-sh/devpod@feature1\",\n\t\t\twant:  \"github-com-loft-sh-devpod\",\n\t\t},\n\t\t{\n\t\t\tname:  \"Branch with valid characters and /\",\n\t\t\tinput: \"github.com/loft-sh/devpod@feat/feature1\",\n\t\t\twant:  \"feat-feature1\",\n\t\t},\n\t\t{\n\t\t\tname:  \"PR reference\",\n\t\t\tinput: \"github.com/loft-sh/devpod@pr/123\",\n\t\t\twant:  \"pr-123\",\n\t\t},\n\t\t{\n\t\t\tname:  \"Truncation beyond 48 characters\",\n\t\t\tinput: \"github.com/loft-sh/devpodreallylongreponame_that_exceeds_48_characters_total_length\",\n\t\t\twant:  \"devpodreallylongreponamethatexceeds48characterst\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgot := ToID(tt.input)\n\t\t\tif got != tt.want {\n\t\t\t\tt.Errorf(\"ToID(%q) = %q, want %q\", tt.input, got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/workspace/image.go",
    "content": "package workspace\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar contentRegEx = regexp.MustCompile(`content=\"([^\"]+)\"`)\n\nvar regexes = map[string]*regexp.Regexp{\n\t\"github.com\": regexp.MustCompile(`(<meta[^>]+property)=\"og:image\" content=\"([^\"]+)\"`),\n\t\"gitlab.com\": regexp.MustCompile(`(<meta[^>]+content)=\"([^\"]+)\" property=\"og:image\"`),\n}\n\nfunc getProjectImage(link string) string {\n\tif !strings.HasPrefix(link, \"http\") &&\n\t\t!strings.HasPrefix(link, \"https\") {\n\t\tlink = \"https://\" + link\n\t}\n\n\tbaseURL, err := url.Parse(link)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tres, err := http.Get(link)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tdefer res.Body.Close()\n\n\tcontent, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\thtml := string(content)\n\n\t// Find github social share image: https://css-tricks.com/essential-meta-tags-social-media/\n\tregEx := regexes[baseURL.Host]\n\tif regEx == nil {\n\t\treturn \"\"\n\t}\n\n\tmeta := regEx.FindString(html)\n\tparts := strings.Split(\n\t\tcontentRegEx.FindString(meta),\n\t\t`\"`,\n\t)\n\n\tif len(parts) >= 2 {\n\t\treturn parts[1]\n\t}\n\n\treturn \"\"\n}\n"
  },
  {
    "path": "pkg/workspace/list.go",
    "content": "package workspace\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\tmanagementv1 \"github.com/loft-sh/api/v4/pkg/apis/management/v1\"\n\tstoragev1 \"github.com/loft-sh/api/v4/pkg/apis/storage/v1\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tdaemon \"github.com/loft-sh/devpod/pkg/daemon/platform\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst ProjectLabel = \"loft.sh/project\"\n\nfunc List(ctx context.Context, devPodConfig *config.Config, skipPro bool, owner platform.OwnerFilter, log log.Logger) ([]*providerpkg.Workspace, error) {\n\t// list local workspaces\n\tlocalWorkspaces, err := ListLocalWorkspaces(devPodConfig.DefaultContext, skipPro, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproWorkspaces := []*providerpkg.Workspace{}\n\tif !skipPro {\n\t\t// list remote workspaces\n\t\tproWorkspaceResults, err := listProWorkspaces(ctx, devPodConfig, owner, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// extract pure workspace list first\n\t\tfor _, result := range proWorkspaceResults {\n\t\t\tproWorkspaces = append(proWorkspaces, result.workspaces...)\n\t\t}\n\n\t\t// Check if every local file based workspace has a remote counterpart\n\t\t// If not, delete it\n\t\t// However, we need to differentiate between workspaces that are legitimately not available anymore\n\t\t// and the ones where we were temporarily not able to reach the host\n\t\tcleanedLocalWorkspaces := []*providerpkg.Workspace{}\n\t\tfor _, localWorkspace := range localWorkspaces {\n\t\t\tif localWorkspace.IsPro() {\n\t\t\t\tif shouldDeleteLocalWorkspace(ctx, localWorkspace, proWorkspaceResults) {\n\t\t\t\t\terr = clientimplementation.DeleteWorkspaceFolder(devPodConfig.DefaultContext, localWorkspace.ID, \"\", log)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Debugf(\"failed to delete local workspace %s: %v\", localWorkspace.ID, err)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcleanedLocalWorkspaces = append(cleanedLocalWorkspaces, localWorkspaces...)\n\t\t}\n\t\tlocalWorkspaces = cleanedLocalWorkspaces\n\t}\n\n\t// Set indexed by UID for deduplication\n\tworkspaces := map[string]*providerpkg.Workspace{}\n\n\t// set local workspaces\n\tfor _, workspace := range localWorkspaces {\n\t\tworkspaces[workspace.UID] = workspace\n\t}\n\n\t// merge pro into local with pro taking precedence if UID matches\n\tfor _, proWorkspace := range proWorkspaces {\n\t\tlocalWorkspace, ok := workspaces[proWorkspace.UID]\n\t\tif ok {\n\t\t\t// we want to use the local workspace IDE configuration\n\t\t\tproWorkspace.IDE = localWorkspace.IDE\n\t\t}\n\n\t\tworkspaces[proWorkspace.UID] = proWorkspace\n\t}\n\n\tretWorkspaces := []*providerpkg.Workspace{}\n\tfor _, v := range workspaces {\n\t\tretWorkspaces = append(retWorkspaces, v)\n\t}\n\n\treturn retWorkspaces, nil\n}\n\nfunc ListLocalWorkspaces(contextName string, skipPro bool, log log.Logger) ([]*providerpkg.Workspace, error) {\n\tworkspaceDir, err := providerpkg.GetWorkspacesDir(contextName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries, err := os.ReadDir(workspaceDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\n\tretWorkspaces := []*providerpkg.Workspace{}\n\tfor _, entry := range entries {\n\t\tif strings.HasPrefix(entry.Name(), \".\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tworkspaceConfig, err := providerpkg.LoadWorkspaceConfig(contextName, entry.Name())\n\t\tif err != nil {\n\t\t\tlog.ErrorStreamOnly().Warnf(\"Couldn't load workspace %s: %v\", entry.Name(), err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif skipPro && workspaceConfig.IsPro() {\n\t\t\tcontinue\n\t\t}\n\n\t\tretWorkspaces = append(retWorkspaces, workspaceConfig)\n\t}\n\n\treturn retWorkspaces, nil\n}\n\ntype listProWorkspacesResult struct {\n\tworkspaces []*providerpkg.Workspace\n\terr        error\n}\n\nfunc listProWorkspaces(ctx context.Context, devPodConfig *config.Config, owner platform.OwnerFilter, log log.Logger) (map[string]listProWorkspacesResult, error) {\n\tresults := map[string]listProWorkspacesResult{}\n\n\t// lock around `results`\n\tvar mu sync.Mutex\n\twg := sync.WaitGroup{}\n\n\tfor provider, providerContextConfig := range devPodConfig.Current().Providers {\n\t\tif !providerContextConfig.Initialized {\n\t\t\tcontinue\n\t\t}\n\n\t\tl := log.ErrorStreamOnly()\n\t\tproviderConfig, err := providerpkg.LoadProviderConfig(devPodConfig.DefaultContext, provider)\n\t\tif err != nil {\n\t\t\tl.Warnf(\"load provider config for provider \\\"%s\\\": %v\", provider, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// only get pro providers\n\t\tif !providerConfig.IsProxyProvider() && !providerConfig.IsDaemonProvider() {\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tworkspaces, err := listProWorkspacesForProvider(ctx, devPodConfig, provider, providerConfig, owner, log)\n\t\t\tmu.Lock()\n\t\t\tdefer mu.Unlock()\n\t\t\tresults[provider] = listProWorkspacesResult{\n\t\t\t\tworkspaces: workspaces,\n\t\t\t\terr:        err,\n\t\t\t}\n\t\t}()\n\t}\n\twg.Wait()\n\n\treturn results, nil\n}\n\nfunc listProWorkspacesForProvider(ctx context.Context, devPodConfig *config.Config, provider string, providerConfig *providerpkg.ProviderConfig, owner platform.OwnerFilter, log log.Logger) ([]*providerpkg.Workspace, error) {\n\tvar (\n\t\tinstances []managementv1.DevPodWorkspaceInstance\n\t\terr       error\n\t)\n\tif providerConfig.IsProxyProvider() {\n\t\tinstances, err = listInstancesProxyProvider(ctx, devPodConfig, provider, providerConfig, log)\n\t} else if providerConfig.IsDaemonProvider() {\n\t\tinstances, err = listInstancesDaemonProvider(ctx, provider, owner, log)\n\t} else {\n\t\treturn nil, fmt.Errorf(\"cannot list pro workspaces with provider %s\", provider)\n\t}\n\tif err != nil {\n\t\tif log.GetLevel() >= logrus.DebugLevel {\n\t\t\tlog.Warnf(\"Failed to list pro workspaces for provider %s: %v\", provider, err)\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tretWorkspaces := []*providerpkg.Workspace{}\n\tfor _, instance := range instances {\n\t\tif instance.GetLabels() == nil {\n\t\t\tlog.Debugf(\"no labels for pro workspace \\\"%s\\\" found, skipping\", instance.GetName())\n\t\t\tcontinue\n\t\t}\n\n\t\t// id\n\t\tid := instance.GetLabels()[storagev1.DevPodWorkspaceIDLabel]\n\t\tif id == \"\" {\n\t\t\tlog.Debugf(\"no ID label for pro workspace \\\"%s\\\" found, skipping\", instance.GetName())\n\t\t\tcontinue\n\t\t}\n\n\t\t// uid\n\t\tuid := instance.GetLabels()[storagev1.DevPodWorkspaceUIDLabel]\n\t\tif uid == \"\" {\n\t\t\tlog.Debugf(\"no UID label for pro workspace \\\"%s\\\" found, skipping\", instance.GetName())\n\t\t\tcontinue\n\t\t}\n\n\t\t// project\n\t\tprojectName := instance.GetLabels()[ProjectLabel]\n\n\t\t// source\n\t\tsource := providerpkg.WorkspaceSource{}\n\t\tif instance.Annotations != nil && instance.Annotations[storagev1.DevPodWorkspaceSourceAnnotation] != \"\" {\n\t\t\t// source to workspace config source\n\t\t\trawSource := instance.Annotations[storagev1.DevPodWorkspaceSourceAnnotation]\n\t\t\ts := providerpkg.ParseWorkspaceSource(rawSource)\n\t\t\tif s == nil {\n\t\t\t\tlog.ErrorStreamOnly().Warnf(\"unable to parse workspace source \\\"%s\\\": %v\", rawSource)\n\t\t\t} else {\n\t\t\t\tsource = *s\n\t\t\t}\n\t\t}\n\n\t\t// last used timestamp\n\t\tvar lastUsedTimestamp types.Time\n\t\tsleepModeConfig := instance.Status.SleepModeConfig\n\t\tif sleepModeConfig != nil {\n\t\t\tlastUsedTimestamp = types.Unix(sleepModeConfig.Status.LastActivity, 0)\n\t\t} else {\n\t\t\tvar ts int64\n\t\t\tif instance.Annotations != nil {\n\t\t\t\tif val, ok := instance.Annotations[\"sleepmode.loft.sh/last-activity\"]; ok {\n\t\t\t\t\tvar err error\n\t\t\t\t\tif ts, err = strconv.ParseInt(val, 10, 64); err != nil {\n\t\t\t\t\t\tlog.Warn(\"received invalid sleepmode.loft.sh/last-activity from \", instance.GetName())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlastUsedTimestamp = types.Unix(ts, 0)\n\t\t}\n\n\t\t// creation timestamp\n\t\tcreationTimestamp := types.Time{}\n\t\tif !instance.CreationTimestamp.IsZero() {\n\t\t\tcreationTimestamp = types.NewTime(instance.CreationTimestamp.Time)\n\t\t}\n\n\t\tworkspace := providerpkg.Workspace{\n\t\t\tID:      id,\n\t\t\tUID:     uid,\n\t\t\tContext: devPodConfig.DefaultContext,\n\t\t\tSource:  source,\n\t\t\tProvider: providerpkg.WorkspaceProviderConfig{\n\t\t\t\tName: provider,\n\t\t\t},\n\t\t\tLastUsedTimestamp: lastUsedTimestamp,\n\t\t\tCreationTimestamp: creationTimestamp,\n\t\t\tPro: &providerpkg.ProMetadata{\n\t\t\t\tInstanceName: instance.GetName(),\n\t\t\t\tProject:      projectName,\n\t\t\t\tDisplayName:  instance.Spec.DisplayName,\n\t\t\t},\n\t\t}\n\t\tretWorkspaces = append(retWorkspaces, &workspace)\n\t}\n\n\treturn retWorkspaces, nil\n}\n\nfunc shouldDeleteLocalWorkspace(ctx context.Context, localWorkspace *providerpkg.Workspace, proWorkspaceResults map[string]listProWorkspacesResult) bool {\n\t// get the correct result for this local workspace\n\tres, ok := proWorkspaceResults[localWorkspace.Provider.Name]\n\tif !ok {\n\t\treturn false\n\t}\n\t// Don't delete the workspace if we encountered any error fetching the remote workspaces.\n\t// This could potentially be destructive so we err or the side of caution and only allow\n\t// deletion if fetching the remote workspace was successful\n\tif res.err != nil {\n\t\treturn false\n\t}\n\n\tif localWorkspace.Imported {\n\t\t// does remote still exist?\n\t\tif ok := checkInstanceExists(ctx, localWorkspace); ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\thasProCounterpart := slices.ContainsFunc(res.workspaces, func(w *providerpkg.Workspace) bool {\n\t\treturn localWorkspace.UID == w.UID\n\t})\n\treturn !hasProCounterpart\n}\n\nfunc listInstancesProxyProvider(ctx context.Context, devPodConfig *config.Config, provider string, providerConfig *providerpkg.ProviderConfig, log log.Logger) ([]managementv1.DevPodWorkspaceInstance, error) {\n\topts := devPodConfig.ProviderOptions(provider)\n\topts[providerpkg.LOFT_FILTER_BY_OWNER] = config.OptionValue{Value: \"true\"}\n\tvar stdout bytes.Buffer\n\tvar stderr bytes.Buffer\n\n\tif err := clientimplementation.RunCommandWithBinaries(\n\t\tctx,\n\t\t\"listWorkspaces\",\n\t\tproviderConfig.Exec.Proxy.List.Workspaces,\n\t\tdevPodConfig.DefaultContext,\n\t\tnil,\n\t\tnil,\n\t\topts,\n\t\tproviderConfig,\n\t\tnil, nil, &stdout, &stderr, log,\n\t); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list pro workspaces: %s %w\", stderr.String(), err)\n\t}\n\tif stdout.Len() == 0 {\n\t\treturn nil, nil\n\t}\n\n\tinstances := []managementv1.DevPodWorkspaceInstance{}\n\tif err := json.Unmarshal(stdout.Bytes(), &instances); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn instances, nil\n}\n\nfunc listInstancesDaemonProvider(ctx context.Context, provider string, owner platform.OwnerFilter, log log.Logger) ([]managementv1.DevPodWorkspaceInstance, error) {\n\treturn daemon.NewLocalClient(provider).ListWorkspaces(ctx, owner)\n}\n\nfunc checkInstanceExists(ctx context.Context, workspace *providerpkg.Workspace) bool {\n\tinstance, err := daemon.NewLocalClient(workspace.Provider.Name).GetWorkspace(ctx, workspace.UID)\n\tif err != nil || instance == nil {\n\t\treturn false\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "pkg/workspace/machine.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/survey\"\n\t\"github.com/loft-sh/log/terminal\"\n)\n\nfunc listMachines(devPodConfig *config.Config, log log.Logger) ([]*providerpkg.Machine, error) {\n\tmachineDir, err := providerpkg.GetMachinesDir(devPodConfig.DefaultContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries, err := os.ReadDir(machineDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\n\tretMachines := []*providerpkg.Machine{}\n\tfor _, entry := range entries {\n\t\tmachineConfig, err := providerpkg.LoadMachineConfig(devPodConfig.DefaultContext, entry.Name())\n\t\tif err != nil {\n\t\t\tlog.ErrorStreamOnly().Warnf(\"Couldn't load machine %s: %v\", entry.Name(), err)\n\t\t\tcontinue\n\t\t}\n\n\t\tretMachines = append(retMachines, machineConfig)\n\t}\n\n\treturn retMachines, nil\n}\n\nfunc ResolveMachine(devPodConfig *config.Config, args []string, userOptions []string, log log.Logger) (client.Client, error) {\n\tmachineClient, err := resolveMachine(devPodConfig, args, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// refresh options\n\terr = machineClient.RefreshOptions(context.TODO(), userOptions, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn machineClient, nil\n}\n\nfunc resolveMachine(devPodConfig *config.Config, args []string, log log.Logger) (client.Client, error) {\n\t// check if we have no args\n\tif len(args) == 0 {\n\t\treturn nil, fmt.Errorf(\"please specify the machine name\")\n\t}\n\n\t// convert to id\n\tmachineID := ToID(args[0])\n\n\t// check if desired id already exists\n\tif providerpkg.MachineExists(devPodConfig.DefaultContext, machineID) {\n\t\tlog.Infof(\"Machine %s already exists\", machineID)\n\t\treturn loadExistingMachine(machineID, devPodConfig, log)\n\t}\n\n\t// get default provider\n\tdefaultProvider, _, err := LoadProviders(devPodConfig, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// resolve workspace\n\tmachineObj, err := createMachine(devPodConfig.DefaultContext, machineID, defaultProvider.Config.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create a new client\n\tmachineClient, err := clientimplementation.NewMachineClient(devPodConfig, defaultProvider.Config, machineObj, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(filepath.Dir(machineObj.Origin))\n\t\treturn nil, err\n\t}\n\n\treturn machineClient, nil\n}\n\n// MachineExists checks if the given workspace already exists\nfunc MachineExists(devPodConfig *config.Config, args []string) string {\n\tif len(args) == 0 {\n\t\treturn \"\"\n\t}\n\n\t// check if workspace already exists\n\t_, name := file.IsLocalDir(args[0])\n\n\t// convert to id\n\tmachineID := ToID(name)\n\n\t// already exists?\n\tif !providerpkg.MachineExists(devPodConfig.DefaultContext, machineID) {\n\t\treturn \"\"\n\t}\n\n\treturn machineID\n}\n\n// GetMachine creates a machine client\nfunc GetMachine(devPodConfig *config.Config, args []string, log log.Logger) (client.MachineClient, error) {\n\t// check if we have no args\n\tif len(args) == 0 {\n\t\treturn selectMachine(devPodConfig, log)\n\t}\n\n\t// check if workspace already exists\n\t_, name := file.IsLocalDir(args[0])\n\n\t// convert to id\n\tmachineID := ToID(name)\n\n\t// already exists?\n\tif !providerpkg.MachineExists(devPodConfig.DefaultContext, machineID) {\n\t\treturn nil, fmt.Errorf(\"machine %s doesn't exist\", machineID)\n\t}\n\n\t// load workspace config\n\treturn loadExistingMachine(machineID, devPodConfig, log)\n}\n\nfunc selectMachine(devPodConfig *config.Config, log log.Logger) (client.MachineClient, error) {\n\tif !terminal.IsTerminalIn {\n\t\treturn nil, errProvideWorkspaceArg\n\t}\n\n\t// ask which machine to use\n\tmachinesDir, err := providerpkg.GetMachinesDir(devPodConfig.DefaultContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmachineIDs := []string{}\n\tseversDirs, err := os.ReadDir(machinesDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, workspace := range seversDirs {\n\t\tmachineIDs = append(machineIDs, workspace.Name())\n\t}\n\tif len(machineIDs) == 0 {\n\t\treturn nil, errProvideWorkspaceArg\n\t}\n\n\tanswer, err := log.Question(&survey.QuestionOptions{\n\t\tQuestion:     \"Please select a machine from the list below\",\n\t\tDefaultValue: machineIDs[0],\n\t\tOptions:      machineIDs,\n\t\tSort:         true,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// load workspace\n\treturn loadExistingMachine(answer, devPodConfig, log)\n}\n\nfunc loadExistingMachine(machineID string, devPodConfig *config.Config, log log.Logger) (client.MachineClient, error) {\n\tmachineConfig, err := providerpkg.LoadMachineConfig(devPodConfig.DefaultContext, machineID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproviderWithOptions, err := FindProvider(devPodConfig, machineConfig.Provider.Name, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn clientimplementation.NewMachineClient(devPodConfig, providerWithOptions.Config, machineConfig, log)\n}\n\nfunc createMachine(context, machineID, providerName string) (*providerpkg.Machine, error) {\n\t// get the machine dir\n\tmachineDir, err := providerpkg.GetMachineDir(context, machineID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// save machine config\n\tmachine := &providerpkg.Machine{\n\t\tID:      machineID,\n\t\tContext: context,\n\t\tProvider: providerpkg.MachineProviderConfig{\n\t\t\tName: providerName,\n\t\t},\n\t\tCreationTimestamp: types.Now(),\n\t\tOrigin:            filepath.Join(machineDir, providerpkg.MachineConfigFile),\n\t}\n\n\t// create machine folder\n\terr = providerpkg.SaveMachineConfig(machine)\n\tif err != nil {\n\t\t_ = os.RemoveAll(machineDir)\n\t\treturn nil, err\n\t}\n\n\treturn machine, nil\n}\n\nfunc SingleMachineName(devPodConfig *config.Config, provider string, log log.Logger) string {\n\tlegacyMachineName := \"devpod-shared-\" + provider\n\tmachines, err := listMachines(devPodConfig, log)\n\tif err == nil {\n\t\tfor _, machine := range machines {\n\t\t\tif machine.Provider.Name == provider && machine.ID == legacyMachineName {\n\t\t\t\treturn legacyMachineName\n\t\t\t}\n\t\t}\n\t}\n\n\treturn encoding.SafeConcatNameMax([]string{\"devpod-shared\", provider, encoding.GetMachineUIDShort(log)}, encoding.MachineUIDLength)\n}\n"
  },
  {
    "path": "pkg/workspace/pro.go",
    "content": "package workspace\n\nimport (\n\t\"os\"\n\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\tprovider2 \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/log\"\n)\n\nfunc ListProInstances(devPodConfig *config.Config, log log.Logger) ([]*provider2.ProInstance, error) {\n\tproInstanceDir, err := provider2.GetProInstancesDir(devPodConfig.DefaultContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries, err := os.ReadDir(proInstanceDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\n\tretProInstances := []*provider2.ProInstance{}\n\tfor _, entry := range entries {\n\t\tproInstanceConfig, err := provider2.LoadProInstanceConfig(devPodConfig.DefaultContext, entry.Name())\n\t\tif err != nil {\n\t\t\tlog.ErrorStreamOnly().Warnf(\"Couldn't load pro instance %s: %v\", entry.Name(), err)\n\t\t\tcontinue\n\t\t}\n\n\t\tretProInstances = append(retProInstances, proInstanceConfig)\n\t}\n\n\treturn retProInstances, nil\n}\n\nfunc FindProviderProInstance(proInstances []*provider2.ProInstance, providerName string) (*provider2.ProInstance, bool) {\n\tfor _, instance := range proInstances {\n\t\tif instance.Provider == providerName {\n\t\t\treturn instance, true\n\t\t}\n\t}\n\n\treturn nil, false\n}\n"
  },
  {
    "path": "pkg/workspace/provider.go",
    "content": "package workspace\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tdevpodhttp \"github.com/loft-sh/devpod/pkg/http\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/devpod/providers\"\n\n\t\"github.com/loft-sh/devpod/pkg/binaries\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/download\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/pkg/errors\"\n)\n\nvar (\n\tErrNoWorkspaceFound    = errors.New(\"no workspace found\")\n\terrProvideWorkspaceArg = errors.New(\"please provide a workspace name. E.g. 'devpod up ./my-folder', 'devpod up github.com/my-org/my-repo' or 'devpod up ubuntu'\")\n)\n\ntype ProviderWithOptions struct {\n\tConfig *providerpkg.ProviderConfig `json:\"config,omitempty\"`\n\tState  *config.ProviderConfig      `json:\"state,omitempty\"`\n}\n\n// LoadProviders loads all known providers for the given context and\nfunc LoadProviders(devPodConfig *config.Config, log log.Logger) (*ProviderWithOptions, map[string]*ProviderWithOptions, error) {\n\tdefaultContext := devPodConfig.Current()\n\tretProviders, err := LoadAllProviders(devPodConfig, log)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// get default provider\n\tif defaultContext.DefaultProvider == \"\" {\n\t\treturn nil, nil, fmt.Errorf(\"no default provider found. Please make sure to run 'devpod provider use'\")\n\t} else if retProviders[defaultContext.DefaultProvider] == nil {\n\t\treturn nil, nil, fmt.Errorf(\"couldn't find default provider %s. Please make sure to add the provider via 'devpod provider add'\", defaultContext.DefaultProvider)\n\t}\n\n\treturn retProviders[defaultContext.DefaultProvider], retProviders, nil\n}\n\nfunc CloneProvider(devPodConfig *config.Config, providerName, providerSourceRaw string, log log.Logger) (*ProviderWithOptions, error) {\n\tproviderWithOptions, err := FindProvider(devPodConfig, providerSourceRaw, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproviderConfig, err := installProvider(devPodConfig, providerWithOptions.Config, providerName, &providerWithOptions.Config.Source, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproviderWithOptions.Config = providerConfig\n\n\treturn providerWithOptions, nil\n}\n\nfunc AddProviderRaw(devPodConfig *config.Config, providerName string, providerSource *providerpkg.ProviderSource, providerRaw []byte, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproviderConfig, err := installRawProvider(devPodConfig, providerName, providerRaw, providerSource, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif devPodConfig.Current().Providers == nil {\n\t\tdevPodConfig.Current().Providers = map[string]*config.ProviderConfig{}\n\t}\n\tif devPodConfig.Current().Providers[providerConfig.Name] == nil {\n\t\tdevPodConfig.Current().Providers[providerConfig.Name] = &config.ProviderConfig{\n\t\t\tCreationTimestamp: types.Now(),\n\t\t}\n\t}\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"save config\")\n\t}\n\n\treturn providerConfig, nil\n}\n\nfunc AddProvider(devPodConfig *config.Config, providerName, providerSourceRaw string, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproviderRaw, providerSource, err := ResolveProvider(providerSourceRaw, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn AddProviderRaw(devPodConfig, providerName, providerSource, providerRaw, log)\n}\n\nfunc UpdateProvider(devPodConfig *config.Config, providerName, providerSourceRaw string, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tif devPodConfig.Current().Providers[providerName] == nil {\n\t\treturn nil, fmt.Errorf(\"provider %s doesn't exist. Please run 'devpod provider add %s' instead\", providerName, providerSourceRaw)\n\t}\n\n\tif providerSourceRaw == \"\" {\n\t\ts, err := ResolveProviderSource(devPodConfig, providerName, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tproviderSourceRaw = s\n\t}\n\n\tproviderRaw, providerSource, err := ResolveProvider(providerSourceRaw, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn updateProvider(devPodConfig, providerName, providerRaw, providerSource, log)\n}\n\nfunc ResolveProviderSource(devPodConfig *config.Config, providerName string, log log.Logger) (string, error) {\n\tsource := \"\"\n\n\tproviderConfig, err := FindProvider(devPodConfig, providerName, log)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"find provider\")\n\t}\n\n\tif providerConfig.Config.Source.Internal {\n\t\t// Name could also be overridden if initial name was already taken, so prefer the raw source if available\n\t\tif providerConfig.Config.Source.Raw == \"\" {\n\t\t\tsource = providerConfig.Config.Name\n\t\t} else {\n\t\t\tsource = providerConfig.Config.Source.Raw\n\t\t}\n\t} else if providerConfig.Config.Source.URL != \"\" {\n\t\tsource = providerConfig.Config.Source.URL\n\t} else if providerConfig.Config.Source.File != \"\" {\n\t\tsource = providerConfig.Config.Source.File\n\t} else if providerConfig.Config.Source.Github != \"\" {\n\t\tsource = providerConfig.Config.Source.Github\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"provider %s is missing a source. Please run `devpod provider update %s SOURCE`\", providerName, providerName)\n\t}\n\n\treturn source, nil\n}\n\nfunc ResolveProvider(providerSource string, log log.Logger) ([]byte, *providerpkg.ProviderSource, error) {\n\tretSource := &providerpkg.ProviderSource{Raw: strings.TrimSpace(providerSource)}\n\n\t// in-built?\n\tinternalProviders := providers.GetBuiltInProviders()\n\tif internalProviders[providerSource] != \"\" {\n\t\tretSource.Internal = true\n\t\treturn []byte(internalProviders[providerSource]), retSource, nil\n\t}\n\n\t// url?\n\tif strings.HasPrefix(providerSource, \"http://\") || strings.HasPrefix(providerSource, \"https://\") {\n\t\tlog.Infof(\"Download provider %s...\", providerSource)\n\t\tout, err := downloadProvider(providerSource)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tretSource.URL = providerSource\n\n\t\treturn out, retSource, nil\n\t}\n\n\t// local file?\n\tif strings.HasSuffix(providerSource, \".yaml\") || strings.HasSuffix(providerSource, \".yml\") {\n\t\t_, err := os.Stat(providerSource)\n\t\tif err == nil {\n\t\t\tout, err := os.ReadFile(providerSource)\n\t\t\tif err == nil {\n\t\t\t\tabsPath, err := filepath.Abs(providerSource)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, nil, err\n\t\t\t\t}\n\t\t\t\tretSource.File = absPath\n\n\t\t\t\treturn out, retSource, nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// check if github\n\tout, source, err := DownloadProviderGithub(providerSource, log)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"download github\")\n\t} else if len(out) > 0 {\n\t\treturn out, source, nil\n\t}\n\n\treturn nil, nil, fmt.Errorf(\"unrecognized provider type, please specify either a local file, url or github repository\")\n}\n\nfunc DownloadProviderGithub(originalPath string, log log.Logger) ([]byte, *providerpkg.ProviderSource, error) {\n\tpath := strings.TrimPrefix(originalPath, \"github.com/\")\n\n\t// resolve release\n\trelease := \"\"\n\tindex := strings.LastIndex(path, \"@\")\n\tif index != -1 {\n\t\trelease = path[index+1:]\n\t\tpath = path[:index]\n\t}\n\n\t// split by separator\n\tsplitted := strings.Split(strings.TrimSuffix(path, \"/\"), \"/\")\n\tif len(splitted) == 1 {\n\t\tpath = \"loft-sh/devpod-provider-\" + path\n\t} else if len(splitted) != 2 {\n\t\treturn nil, nil, nil\n\t}\n\n\t// get latest release\n\trequestURL := \"\"\n\tif release == \"\" {\n\t\trequestURL = fmt.Sprintf(\"https://github.com/%s/releases/latest/download/provider.yaml\", path)\n\t} else {\n\t\trequestURL = fmt.Sprintf(\"https://github.com/%s/releases/download/%s/provider.yaml\", path, release)\n\t}\n\n\t// download\n\tbody, err := download.File(requestURL, log)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"download\")\n\t}\n\tdefer body.Close()\n\n\t// read body\n\tout, err := io.ReadAll(body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn out, &providerpkg.ProviderSource{\n\t\tRaw:    originalPath,\n\t\tGithub: path,\n\t}, nil\n}\n\nfunc downloadProvider(url string) ([]byte, error) {\n\t// initiate download\n\tresp, err := devpodhttp.GetHTTPClient().Get(url)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"download binary\")\n\t}\n\tdefer resp.Body.Close()\n\n\treturn io.ReadAll(resp.Body)\n}\n\nfunc updateProvider(devPodConfig *config.Config, providerName string, raw []byte, source *providerpkg.ProviderSource, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproviderConfig, err := providerpkg.ParseProvider(bytes.NewReader(raw))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproviderConfig.Source = *source\n\tif providerName != \"\" {\n\t\tproviderConfig.Name = providerName\n\t}\n\tif providerConfig.Options == nil {\n\t\tproviderConfig.Options = map[string]*types.Option{}\n\t}\n\n\t// update options\n\tfor optionName := range devPodConfig.Current().Providers[providerConfig.Name].Options {\n\t\t_, ok := providerConfig.Options[optionName]\n\t\tif !ok {\n\t\t\tdelete(devPodConfig.Current().Providers[providerConfig.Name].Options, optionName)\n\t\t}\n\t}\n\n\terr = config.SaveConfig(devPodConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbinariesDir, err := providerpkg.GetProviderBinariesDir(devPodConfig.DefaultContext, providerConfig.Name)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get binaries dir\")\n\t}\n\n\t_, err = binaries.DownloadBinaries(providerConfig.Binaries, binariesDir, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(binariesDir)\n\t\treturn nil, errors.Wrap(err, \"download binaries\")\n\t}\n\n\terr = providerpkg.SaveProviderConfig(devPodConfig.DefaultContext, providerConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn providerConfig, nil\n}\n\nfunc installRawProvider(devPodConfig *config.Config, providerName string, raw []byte, source *providerpkg.ProviderSource, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproviderConfig, err := providerpkg.ParseProvider(bytes.NewReader(raw))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn installProvider(devPodConfig, providerConfig, providerName, source, log)\n}\n\nfunc installProvider(devPodConfig *config.Config, providerConfig *providerpkg.ProviderConfig, providerName string, source *providerpkg.ProviderSource, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproviderConfig.Source = *source\n\tif providerName != \"\" {\n\t\tproviderConfig.Name = providerName\n\t}\n\tif devPodConfig.Current().Providers[providerConfig.Name] != nil {\n\t\treturn nil, fmt.Errorf(\"provider %s already exists. Please run 'devpod provider delete %s' before adding the provider\", providerConfig.Name, providerConfig.Name)\n\t}\n\n\tproviderDir, err := providerpkg.GetProviderDir(devPodConfig.DefaultContext, providerConfig.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = os.Stat(providerDir)\n\tif err == nil {\n\t\treturn nil, fmt.Errorf(\"provider %s already exists. Please run 'devpod provider delete %s' before adding the provider\", providerConfig.Name, providerConfig.Name)\n\t}\n\n\tbinariesDir, err := providerpkg.GetProviderBinariesDir(devPodConfig.DefaultContext, providerConfig.Name)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get binaries dir\")\n\t}\n\n\t_, err = binaries.DownloadBinaries(providerConfig.Binaries, binariesDir, log)\n\tif err != nil {\n\t\t_ = os.RemoveAll(providerDir)\n\t\treturn nil, errors.Wrap(err, \"download binaries\")\n\t}\n\n\terr = providerpkg.SaveProviderConfig(devPodConfig.DefaultContext, providerConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn providerConfig, nil\n}\n\nfunc FindProvider(devPodConfig *config.Config, name string, log log.Logger) (*ProviderWithOptions, error) {\n\tretProviders, err := LoadAllProviders(devPodConfig, log)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if retProviders[name] == nil {\n\t\treturn nil, fmt.Errorf(\"couldn't find provider with name %s. Please make sure to add the provider via 'devpod provider add'\", name)\n\t}\n\n\treturn retProviders[name], nil\n}\n\nfunc LoadAllProviders(devPodConfig *config.Config, log log.Logger) (map[string]*ProviderWithOptions, error) {\n\tretProviders := map[string]*ProviderWithOptions{}\n\tdefaultContext := devPodConfig.Current()\n\tfor providerName, providerState := range defaultContext.Providers {\n\t\tif retProviders[providerName] != nil {\n\t\t\tretProviders[providerName].State = providerState\n\t\t\tcontinue\n\t\t}\n\n\t\t// try to load provider config\n\t\tproviderConfig, err := providerpkg.LoadProviderConfig(devPodConfig.DefaultContext, providerName)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error loading provider '%s': %v\", providerName, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tretProviders[providerName] = &ProviderWithOptions{\n\t\t\tConfig: providerConfig,\n\t\t\tState:  providerState,\n\t\t}\n\t}\n\n\t// list providers from the dir that are currently not configured\n\tproviderDir, err := providerpkg.GetProvidersDir(devPodConfig.DefaultContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries, err := os.ReadDir(providerDir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\n\tfor _, entry := range entries {\n\t\tif retProviders[entry.Name()] != nil || !entry.IsDir() || strings.HasPrefix(entry.Name(), \".DS_Store\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tproviderConfig, err := providerpkg.LoadProviderConfig(devPodConfig.DefaultContext, entry.Name())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tretProviders[providerConfig.Name] = &ProviderWithOptions{\n\t\t\tConfig: providerConfig,\n\t\t}\n\t}\n\n\treturn retProviders, nil\n}\n\nfunc ProviderFromHost(ctx context.Context, devPodConfig *config.Config, proHost string, log log.Logger) (*providerpkg.ProviderConfig, error) {\n\tproInstanceConfig, err := providerpkg.LoadProInstanceConfig(devPodConfig.DefaultContext, proHost)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"load pro instance %s: %w\", proHost, err)\n\t}\n\n\tprovider, err := FindProvider(devPodConfig, proInstanceConfig.Provider, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"find provider: %w\", err)\n\t} else if !provider.Config.IsProxyProvider() && !provider.Config.IsDaemonProvider() {\n\t\treturn nil, fmt.Errorf(\"provider is not a pro provider\")\n\t}\n\n\treturn provider.Config, nil\n}\n"
  },
  {
    "path": "pkg/workspace/workspace.go",
    "content": "package workspace\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/huh\"\n\t\"github.com/loft-sh/devpod/pkg/client\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation\"\n\t\"github.com/loft-sh/devpod/pkg/client/clientimplementation/daemonclient\"\n\t\"github.com/loft-sh/devpod/pkg/config\"\n\t\"github.com/loft-sh/devpod/pkg/encoding\"\n\t\"github.com/loft-sh/devpod/pkg/file\"\n\t\"github.com/loft-sh/devpod/pkg/git\"\n\t\"github.com/loft-sh/devpod/pkg/ide/ideparse\"\n\t\"github.com/loft-sh/devpod/pkg/image\"\n\t\"github.com/loft-sh/devpod/pkg/platform\"\n\tproviderpkg \"github.com/loft-sh/devpod/pkg/provider\"\n\t\"github.com/loft-sh/devpod/pkg/types\"\n\t\"github.com/loft-sh/log\"\n\t\"github.com/loft-sh/log/terminal\"\n)\n\n// Resolve takes the `devpod up|build` CLI input and either finds an existing workspace or creates a new one\nfunc Resolve(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tide string,\n\tideOptions []string,\n\targs []string,\n\tdesiredID,\n\tdesiredMachine string,\n\tproviderUserOptions []string,\n\treconfigureProvider bool,\n\tdevContainerImage string,\n\tdevContainerPath string,\n\tsshConfigPath string,\n\tsource *providerpkg.WorkspaceSource,\n\tuid string,\n\tchangeLastUsed bool,\n\towner platform.OwnerFilter,\n\tlog log.Logger,\n) (client.BaseWorkspaceClient, error) {\n\t// verify desired id\n\tif desiredID != \"\" {\n\t\tif providerpkg.ProviderNameRegEx.MatchString(desiredID) {\n\t\t\treturn nil, fmt.Errorf(\"workspace name can only include smaller case letters, numbers or dashes\")\n\t\t} else if len(desiredID) > 48 {\n\t\t\treturn nil, fmt.Errorf(\"workspace name cannot be longer than 48 characters\")\n\t\t}\n\t}\n\n\t// resolve workspace\n\tprovider, workspace, machine, err := resolveWorkspace(\n\t\tctx,\n\t\tdevPodConfig,\n\t\targs,\n\t\tdesiredID,\n\t\tdesiredMachine,\n\t\tproviderUserOptions,\n\t\tsshConfigPath,\n\t\tsource,\n\t\tuid,\n\t\tchangeLastUsed,\n\t\towner,\n\t\tlog,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// configure ide\n\tworkspace, err = ideparse.RefreshIDEOptions(devPodConfig, workspace, ide, ideOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// configure dev container source\n\tif devContainerImage != \"\" && workspace.DevContainerImage != devContainerImage {\n\t\tworkspace.DevContainerImage = devContainerImage\n\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"save workspace: %w\", err)\n\t\t}\n\t}\n\n\t// configure dev container source\n\tif devContainerPath != \"\" && workspace.DevContainerPath != devContainerPath {\n\t\tworkspace.DevContainerPath = devContainerPath\n\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"save workspace: %w\", err)\n\t\t}\n\t}\n\n\t// configure dev container source\n\tif workspace.Source.Container != \"\" {\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"save workspace: %w\", err)\n\t\t}\n\t}\n\n\t// create workspace client\n\tclient, err := getWorkspaceClient(devPodConfig, provider, workspace, machine, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// refresh provider options\n\terr = client.RefreshOptions(ctx, providerUserOptions, reconfigureProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}\n\nfunc getWorkspaceClient(devPodConfig *config.Config, provider *providerpkg.ProviderConfig, workspace *providerpkg.Workspace, machine *providerpkg.Machine, log log.Logger) (client.BaseWorkspaceClient, error) {\n\tif provider.IsProxyProvider() {\n\t\treturn clientimplementation.NewProxyClient(devPodConfig, provider, workspace, log)\n\t} else if provider.IsDaemonProvider() {\n\t\treturn daemonclient.New(devPodConfig, provider, workspace, log)\n\t} else {\n\t\treturn clientimplementation.NewWorkspaceClient(devPodConfig, provider, workspace, machine, log)\n\t}\n}\n\n// Get tries to retrieve an already existing workspace\nfunc Get(ctx context.Context, devPodConfig *config.Config, args []string, changeLastUsed bool, owner platform.OwnerFilter, localOnly bool, log log.Logger) (client.BaseWorkspaceClient, error) {\n\tvar (\n\t\tprovider  *providerpkg.ProviderConfig\n\t\tworkspace *providerpkg.Workspace\n\t\tmachine   *providerpkg.Machine\n\t\terr       error\n\t)\n\n\t// check if we have no args\n\tif len(args) == 0 {\n\t\tprovider, workspace, machine, err = selectWorkspace(ctx, devPodConfig, changeLastUsed, \"\", owner, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif localOnly {\n\t\t\tworkspace = findLocalWorkspace(ctx, devPodConfig, args, \"\", log)\n\t\t} else {\n\t\t\tworkspace = findWorkspace(ctx, devPodConfig, args, \"\", owner, log)\n\t\t}\n\t\tif workspace == nil {\n\t\t\treturn nil, fmt.Errorf(\"workspace %s doesn't exist\", args[0])\n\t\t}\n\n\t\tprovider, workspace, machine, err = loadExistingWorkspace(devPodConfig, workspace.ID, changeLastUsed, log)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tclient, err := getWorkspaceClient(devPodConfig, provider, workspace, machine, log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}\n\n// Exists checks if the given workspace already exists\nfunc Exists(ctx context.Context, devPodConfig *config.Config, args []string, workspaceID string, owner platform.OwnerFilter, log log.Logger) string {\n\tworkspace := findWorkspace(ctx, devPodConfig, args, workspaceID, owner, log)\n\tif workspace == nil {\n\t\treturn \"\"\n\t}\n\n\treturn workspace.ID\n}\n\nfunc resolveWorkspace(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\targs []string,\n\tdesiredID,\n\tdesiredMachine string,\n\tproviderUserOptions []string,\n\tsshConfigPath string,\n\tsource *providerpkg.WorkspaceSource,\n\tuid string,\n\tchangeLastUsed bool,\n\towner platform.OwnerFilter,\n\tlog log.Logger,\n) (*providerpkg.ProviderConfig, *providerpkg.Workspace, *providerpkg.Machine, error) {\n\t// check if we have no args\n\tif len(args) == 0 {\n\t\tif desiredID != \"\" {\n\t\t\tworkspace := findWorkspace(ctx, devPodConfig, nil, desiredID, owner, log)\n\t\t\tif workspace == nil {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"workspace %s doesn't exist\", desiredID)\n\t\t\t}\n\t\t\treturn loadExistingWorkspace(devPodConfig, workspace.ID, changeLastUsed, log)\n\t\t}\n\n\t\treturn selectWorkspace(ctx, devPodConfig, changeLastUsed, sshConfigPath, owner, log)\n\t}\n\n\t// check if workspace already exists\n\tisLocalPath, name := file.IsLocalDir(args[0])\n\n\t// convert to id\n\tworkspaceID := ToID(name)\n\n\t// check if desired id already exists\n\tif desiredID != \"\" {\n\t\tif Exists(ctx, devPodConfig, nil, desiredID, owner, log) != \"\" {\n\t\t\tlog.Debugf(\"Workspace %s already exists\", desiredID)\n\t\t\treturn loadExistingWorkspace(devPodConfig, desiredID, changeLastUsed, log)\n\t\t}\n\n\t\t// set desired id\n\t\tworkspaceID = desiredID\n\t} else if Exists(ctx, devPodConfig, nil, workspaceID, owner, log) != \"\" {\n\t\tlog.Debugf(\"Workspace %s already exists\", workspaceID)\n\t\treturn loadExistingWorkspace(devPodConfig, workspaceID, changeLastUsed, log)\n\t}\n\n\t// create workspace\n\tprovider, workspace, machine, err := createWorkspace(\n\t\tctx,\n\t\tdevPodConfig,\n\t\tworkspaceID,\n\t\tname,\n\t\tdesiredMachine,\n\t\tproviderUserOptions,\n\t\tsshConfigPath,\n\t\tsource,\n\t\tisLocalPath,\n\t\tuid,\n\t\tlog,\n\t)\n\tif err != nil {\n\t\t_ = clientimplementation.DeleteWorkspaceFolder(devPodConfig.DefaultContext, workspaceID, sshConfigPath, log)\n\t\treturn nil, nil, nil, err\n\t}\n\n\treturn provider, workspace, machine, nil\n}\n\nfunc createWorkspace(\n\tctx context.Context,\n\tdevPodConfig *config.Config,\n\tworkspaceID,\n\tname,\n\tdesiredMachine string,\n\tproviderUserOptions []string,\n\tsshConfigPath string,\n\tsource *providerpkg.WorkspaceSource,\n\tisLocalPath bool,\n\tuid string,\n\tlog log.Logger,\n) (*providerpkg.ProviderConfig, *providerpkg.Workspace, *providerpkg.Machine, error) {\n\t// get default provider\n\tprovider, _, err := LoadProviders(devPodConfig, log)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t} else if provider.State == nil || !provider.State.Initialized {\n\t\treturn nil, nil, nil, fmt.Errorf(\"provider '%s' is not initialized, please make sure to run 'devpod provider use %s' at least once before using this provider\", provider.Config.Name, provider.Config.Name)\n\t}\n\n\t// resolve workspace\n\tworkspace, err := resolveWorkspaceConfig(ctx, provider, devPodConfig, name, workspaceID, source, isLocalPath, sshConfigPath, uid)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\n\t// set server\n\tif desiredMachine != \"\" {\n\t\tif !provider.Config.IsMachineProvider() {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"provider %s cannot create servers and cannot be used\", provider.Config.Name)\n\t\t}\n\n\t\t// check if server exists\n\t\tif !providerpkg.MachineExists(workspace.Context, desiredMachine) {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"server %s doesn't exist and cannot be used\", desiredMachine)\n\t\t}\n\n\t\t// configure server for workspace\n\t\tworkspace.Machine = providerpkg.WorkspaceMachineConfig{\n\t\t\tID: desiredMachine,\n\t\t}\n\t}\n\n\t// create a new machine\n\tvar machineConfig *providerpkg.Machine\n\tif provider.Config.IsMachineProvider() && workspace.Machine.ID == \"\" {\n\t\t// create a new machine\n\t\tif provider.State != nil && provider.State.SingleMachine {\n\t\t\tworkspace.Machine.ID = SingleMachineName(devPodConfig, provider.Config.Name, log)\n\t\t} else {\n\t\t\tworkspace.Machine.ID = encoding.CreateNewUIDShort(workspace.ID)\n\t\t\tworkspace.Machine.AutoDelete = true\n\t\t}\n\n\t\t// save workspace config\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"save config: %w\", err)\n\t\t}\n\n\t\t// only create machine if it does not exist yet\n\t\tif !providerpkg.MachineExists(devPodConfig.DefaultContext, workspace.Machine.ID) {\n\t\t\t// create machine folder\n\t\t\tmachineConfig, err = createMachine(workspace.Context, workspace.Machine.ID, provider.Config.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, nil, err\n\t\t\t}\n\n\t\t\t// create machine\n\t\t\tmachineClient, err := clientimplementation.NewMachineClient(devPodConfig, provider.Config, machineConfig, log)\n\t\t\tif err != nil {\n\t\t\t\t_ = clientimplementation.DeleteMachineFolder(machineConfig.Context, machineConfig.ID)\n\t\t\t\treturn nil, nil, nil, err\n\t\t\t}\n\n\t\t\t// refresh options\n\t\t\terr = machineClient.RefreshOptions(ctx, providerUserOptions, false)\n\t\t\tif err != nil {\n\t\t\t\t_ = clientimplementation.DeleteMachineFolder(machineConfig.Context, machineConfig.ID)\n\t\t\t\treturn nil, nil, nil, err\n\t\t\t}\n\n\t\t\t// create machine\n\t\t\terr = machineClient.Create(ctx, client.CreateOptions{})\n\t\t\tif err != nil {\n\t\t\t\t_ = clientimplementation.DeleteMachineFolder(machineConfig.Context, machineConfig.ID)\n\t\t\t\treturn nil, nil, nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Infof(\"Reuse existing machine '%s' for workspace '%s'\", workspace.Machine.ID, workspace.ID)\n\n\t\t\t// load machine config\n\t\t\tmachineConfig, err = providerpkg.LoadMachineConfig(workspace.Context, workspace.Machine.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"load machine config: %w\", err)\n\t\t\t}\n\t\t}\n\t} else if provider.Config.IsProxyProvider() || provider.Config.IsDaemonProvider() {\n\t\t// We'll do have to do a bit of mumbo jumbo here because the pro process can't communicate with us directly.\n\t\t// It needs os i/o to render the form in CLI mode so we can't go with our typical setup.\n\t\t// Instead we first save the config, tell the provider where it lives, it updates it,\n\t\t// then we read it again and update to workspace state here\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"save config: %w\", err)\n\t\t}\n\n\t\terr := resolveProInstance(ctx, devPodConfig, provider.Config.Name, workspace, log)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\n\t\tworkspace, err = providerpkg.LoadWorkspaceConfig(workspace.Context, workspace.ID)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t} else {\n\t\t// save workspace config\n\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"save config: %w\", err)\n\t\t}\n\n\t\t// load machine config\n\t\tif provider.Config.IsMachineProvider() && workspace.Machine.ID != \"\" {\n\t\t\tmachineConfig, err = providerpkg.LoadMachineConfig(workspace.Context, workspace.Machine.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"load machine config: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn provider.Config, workspace, machineConfig, nil\n}\n\nfunc resolveWorkspaceConfig(\n\tctx context.Context,\n\tdefaultProvider *ProviderWithOptions,\n\tdevPodConfig *config.Config,\n\tname,\n\tworkspaceID string,\n\tsource *providerpkg.WorkspaceSource,\n\tisLocalPath bool,\n\tsshConfigPath string,\n\tuid string,\n) (*providerpkg.Workspace, error) {\n\tnow := types.Now()\n\tif uid == \"\" {\n\t\tuid = encoding.CreateNewUID(devPodConfig.DefaultContext, workspaceID)\n\t}\n\tworkspace := &providerpkg.Workspace{\n\t\tID:      workspaceID,\n\t\tUID:     uid,\n\t\tContext: devPodConfig.DefaultContext,\n\t\tProvider: providerpkg.WorkspaceProviderConfig{\n\t\t\tName: defaultProvider.Config.Name,\n\t\t},\n\t\tCreationTimestamp: now,\n\t\tLastUsedTimestamp: now,\n\t\tSSHConfigPath:     sshConfigPath,\n\t}\n\n\t// outside source set?\n\tif source != nil {\n\t\tworkspace.Source = *source\n\t\treturn workspace, nil\n\t}\n\n\t// is local folder?\n\tif isLocalPath {\n\t\tworkspace.Source = providerpkg.WorkspaceSource{\n\t\t\tLocalFolder: name,\n\t\t}\n\t\treturn workspace, nil\n\t}\n\n\t// is git?\n\tgitRepository, gitPRReference, gitBranch, gitCommit, gitSubdir := git.NormalizeRepository(name)\n\tif strings.HasSuffix(name, \".git\") || git.PingRepository(gitRepository, git.GetDefaultExtraEnv(false)) {\n\t\tworkspace.Picture = getProjectImage(name)\n\t\tworkspace.Source = providerpkg.WorkspaceSource{\n\t\t\tGitRepository:  gitRepository,\n\t\t\tGitPRReference: gitPRReference,\n\t\t\tGitBranch:      gitBranch,\n\t\t\tGitCommit:      gitCommit,\n\t\t\tGitSubPath:     gitSubdir,\n\t\t}\n\n\t\treturn workspace, nil\n\t}\n\n\t// is image?\n\t_, err := image.GetImage(ctx, name)\n\tif err == nil {\n\t\tworkspace.Source = providerpkg.WorkspaceSource{\n\t\t\tImage: name,\n\t\t}\n\t\treturn workspace, nil\n\t}\n\n\t// fall back to git repository\n\tworkspace.Source = providerpkg.WorkspaceSource{GitRepository: name}\n\tif gitRepository != \"\" {\n\t\tworkspace.Source.GitRepository = gitRepository\n\t}\n\tif gitPRReference != \"\" {\n\t\tworkspace.Source.GitPRReference = gitPRReference\n\t}\n\tif gitBranch != \"\" {\n\t\tworkspace.Source.GitBranch = gitBranch\n\t}\n\tif gitCommit != \"\" {\n\t\tworkspace.Source.GitCommit = gitCommit\n\t}\n\tif gitSubdir != \"\" {\n\t\tworkspace.Source.GitSubPath = gitSubdir\n\t}\n\n\treturn workspace, nil\n}\n\nfunc ensureWorkspaceID(args []string, workspaceID string) string {\n\tif len(args) == 0 && workspaceID == \"\" {\n\t\treturn \"\"\n\t}\n\n\tif workspaceID == \"\" {\n\t\t// check if workspace already exists\n\t\t_, name := file.IsLocalDir(args[0])\n\n\t\t// convert to id\n\t\tworkspaceID = ToID(name)\n\t}\n\n\treturn workspaceID\n}\n\nfunc findLocalWorkspace(ctx context.Context, devPodConfig *config.Config, args []string, workspaceID string, log log.Logger) *providerpkg.Workspace {\n\tworkspaceID = ensureWorkspaceID(args, workspaceID)\n\tif workspaceID == \"\" {\n\t\treturn nil\n\t}\n\n\tallWorkspaces, err := ListLocalWorkspaces(devPodConfig.DefaultContext, false, log)\n\tif err != nil {\n\t\tlog.Debugf(\"failed to list workspaces: %v\", err)\n\t\treturn nil\n\t}\n\n\tfor _, workspace := range allWorkspaces {\n\t\tif workspace.ID != workspaceID {\n\t\t\tcontinue\n\t\t}\n\t\treturn workspace\n\t}\n\n\treturn nil\n}\n\nfunc findWorkspace(ctx context.Context, devPodConfig *config.Config, args []string, workspaceID string, owner platform.OwnerFilter, log log.Logger) *providerpkg.Workspace {\n\tworkspaceID = ensureWorkspaceID(args, workspaceID)\n\tif workspaceID == \"\" {\n\t\treturn nil\n\t}\n\n\tallWorkspaces, err := List(ctx, devPodConfig, false, owner, log)\n\tif err != nil {\n\t\tlog.Debugf(\"failed to list workspaces: %v\", err)\n\t\treturn nil\n\t}\n\n\tvar retWorkspace *providerpkg.Workspace\n\t// already exists in all workspaces (including remote)?\n\tfor _, workspace := range allWorkspaces {\n\t\tif workspace.ID != workspaceID {\n\t\t\tcontinue\n\t\t}\n\n\t\tif workspace.IsPro() {\n\t\t\tworkspace.Imported = true\n\t\t\terr = providerpkg.SaveWorkspaceConfig(workspace)\n\t\t\tif err != nil {\n\t\t\t\tlog.Debugf(\"failed to save workspace config for workspace \\\"%s\\\" with provider \\\"%s\\\": %v\", workspace.ID, workspace.Provider.Name, err)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tretWorkspace = workspace\n\t\tbreak\n\t}\n\n\treturn retWorkspace\n}\n\nfunc selectWorkspace(ctx context.Context, devPodConfig *config.Config, changeLastUsed bool, sshConfigPath string, owner platform.OwnerFilter, log log.Logger) (*providerpkg.ProviderConfig, *providerpkg.Workspace, *providerpkg.Machine, error) {\n\tif !terminal.IsTerminalIn {\n\t\treturn nil, nil, nil, errProvideWorkspaceArg\n\t}\n\n\tworkspaces, err := List(ctx, devPodConfig, false, owner, log)\n\tif err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"list workspaces: %w\", err)\n\t}\n\n\t// sort by last used\n\tsort.SliceStable(workspaces, func(i, j int) bool {\n\t\treturn workspaces[i].LastUsedTimestamp.Time.Unix() > workspaces[j].LastUsedTimestamp.Time.Unix()\n\t})\n\n\t// prepare form options\n\toptions := []huh.Option[*providerpkg.Workspace]{}\n\tfor _, workspace := range workspaces {\n\t\tkey := workspace.ID\n\t\tif workspace.IsPro() && workspace.Pro.DisplayName != \"\" {\n\t\t\tkey = fmt.Sprintf(\"%s (%s)\", workspace.Pro.DisplayName, workspace.ID)\n\t\t}\n\t\toptions = append(options, huh.NewOption(key, workspace))\n\t}\n\tif len(workspaces) == 0 {\n\t\treturn nil, nil, nil, errors.Join(ErrNoWorkspaceFound, errProvideWorkspaceArg)\n\t}\n\n\t// create terminal form\n\tvar selectedWorkspace *providerpkg.Workspace\n\tform := huh.NewForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewSelect[*providerpkg.Workspace]().\n\t\t\t\tTitle(\"Please select a workspace from the list below\").\n\t\t\t\tOptions(options...).\n\t\t\t\tValue(&selectedWorkspace),\n\t\t),\n\t)\n\tif err := form.Run(); err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tif selectedWorkspace == nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"no workspace selected\")\n\t}\n\n\t// if selected workspace is pro, save config locally\n\tfor _, workspace := range workspaces {\n\t\tif workspace.ID == selectedWorkspace.ID && workspace.IsPro() {\n\t\t\tif workspace.SSHConfigPath == \"\" && sshConfigPath != \"\" {\n\t\t\t\tworkspace.SSHConfigPath = sshConfigPath\n\t\t\t}\n\t\t\tworkspace.Imported = true\n\t\t\tif err := providerpkg.SaveWorkspaceConfig(workspace); err != nil {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"save workspace config for workspace \\\"%s\\\": %w\", workspace.ID, err)\n\t\t\t}\n\n\t\t\tproviderConfig, err := providerpkg.LoadProviderConfig(devPodConfig.DefaultContext, workspace.Provider.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"load provider config for workspace \\\"%s\\\" with provider \\\"%s\\\": %w\", workspace.ID, workspace.Provider.Name, err)\n\t\t\t}\n\n\t\t\treturn providerConfig, workspace, nil, nil\n\t\t}\n\t}\n\n\t// load workspace\n\treturn loadExistingWorkspace(devPodConfig, selectedWorkspace.ID, changeLastUsed, log)\n}\n\nfunc loadExistingWorkspace(devPodConfig *config.Config, workspaceID string, changeLastUsed bool, log log.Logger) (*providerpkg.ProviderConfig, *providerpkg.Workspace, *providerpkg.Machine, error) {\n\tworkspaceConfig, err := providerpkg.LoadWorkspaceConfig(devPodConfig.DefaultContext, workspaceID)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\n\tproviderWithOptions, err := FindProvider(devPodConfig, workspaceConfig.Provider.Name, log)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\n\t// save workspace config\n\tif changeLastUsed {\n\t\tworkspaceConfig.LastUsedTimestamp = types.Now()\n\t\terr = providerpkg.SaveWorkspaceConfig(workspaceConfig)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t}\n\n\t// load machine config\n\tvar machineConfig *providerpkg.Machine\n\tif workspaceConfig.Machine.ID != \"\" {\n\t\tmachineConfig, err = providerpkg.LoadMachineConfig(workspaceConfig.Context, workspaceConfig.Machine.ID)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"load machine config: %w\", err)\n\t\t}\n\t}\n\n\t// create client\n\treturn providerWithOptions.Config, workspaceConfig, machineConfig, nil\n}\n\nfunc resolveProInstance(ctx context.Context, devPodConfig *config.Config, providerName string, workspace *providerpkg.Workspace, log log.Logger) error {\n\tprovider, err := FindProvider(devPodConfig, providerName, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkspaceClient, err := getWorkspaceClient(devPodConfig, provider.Config, workspace, nil, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch c := workspaceClient.(type) {\n\tcase client.ProxyClient:\n\t\treturn c.Create(ctx, os.Stdin, os.Stdout, os.Stderr)\n\tcase client.DaemonClient:\n\t\treturn c.Create(ctx, os.Stdin, os.Stdout, os.Stderr)\n\tdefault:\n\t\treturn fmt.Errorf(\"client does not support remote workspaces\")\n\t}\n}\n"
  },
  {
    "path": "providers/docker/provider.yaml",
    "content": "name: docker\nversion: v0.0.1\nicon: https://devpod.sh/assets/docker.svg\nhome: https://github.com/loft-sh/devpod\ndescription: |-\n  DevPod on Docker\noptionGroups:\n  - options:\n      - DOCKER_PATH\n      - DOCKER_HOST\n      - INACTIVITY_TIMEOUT\n      - DOCKER_BUILDER\n    name: \"Advanced Options\"\noptions:\n  INACTIVITY_TIMEOUT:\n    description: \"If defined, will automatically stop the container after the inactivity period. Examples: 10m, 1h\"\n  DOCKER_PATH:\n    description: The path where to find the docker binary.\n    default: docker\n  DOCKER_HOST:\n    global: true\n    description: The docker host to use.\n  DOCKER_BUILDER:\n    global: true\n    description: The docker builder to use.\nagent:\n  containerInactivityTimeout: ${INACTIVITY_TIMEOUT}\n  local: true\n  docker:\n    path: ${DOCKER_PATH}\n    builder: ${DOCKER_BUILDER}\n    install: false\n    env:\n      DOCKER_HOST: ${DOCKER_HOST}\nexec:\n  command: |-\n    \"${DEVPOD}\" helper sh -c \"${COMMAND}\"\n"
  },
  {
    "path": "providers/kubernetes/provider.yaml",
    "content": "name: kubernetes\nversion: v0.0.1\nicon: https://devpod.sh/assets/kubernetes.svg\nhome: https://github.com/loft-sh/devpod\ndescription: |-\n  DevPod on Kubernetes\noptionGroups:\n  - options:\n      - KUBERNETES_NAMESPACE\n      - DISK_SIZE\n    name: \"Options\"\n    defaultVisible: true\n  - options:\n      - KUBERNETES_CONTEXT\n      - KUBERNETES_CONFIG\n    name: \"Kubernetes Config\"\n  - options:\n      - CLUSTER_ROLE\n      - SERVICE_ACCOUNT\n      - CREATE_NAMESPACE\n      - INACTIVITY_TIMEOUT\n      - STORAGE_CLASS\n      - PVC_ACCESS_MODE\n      - PVC_ANNOTATIONS\n      - RESOURCES\n      - POD_MANIFEST_TEMPLATE\n      - NODE_SELECTOR\n      - LABELS\n      - DOCKERLESS_DISABLED\n      - DOCKERLESS_IMAGE\n    name: \"Advanced Options\"\noptions:\n  DISK_SIZE:\n    description: The default size for the persistent volume to use.\n    default: 10Gi\n    global: true\n  KUBERNETES_CONTEXT:\n    description: The kubernetes context to use. E.g. my-kube-context\n  KUBERNETES_CONFIG:\n    description: The kubernetes config to use. E.g. /path/to/my/kube/config.yaml\n  KUBERNETES_PULL_SECRETS_ENABLED:\n    description: If true, DevPod will try to use the pull secrets from the current context.\n    default: \"true\"\n    type: boolean\n    global: true\n  KUBERNETES_NAMESPACE:\n    description: The kubernetes namespace to use. Defaults to devpod.\n    default: \"devpod\"\n  CREATE_NAMESPACE:\n    description: If true, DevPod will try to create the namespace.\n    default: \"true\"\n    type: boolean\n    global: true\n  CLUSTER_ROLE:\n    description: If defined, DevPod will create a role binding for the given cluster role.\n    global: true\n  SERVICE_ACCOUNT:\n    description: If defined, DevPod will use the given service account for the dev container.\n    global: true\n  INACTIVITY_TIMEOUT:\n    description: \"If defined, will automatically stop the pod after the inactivity period. Examples: 10m, 1h\"\n  POD_TIMEOUT:\n    description: \"Determines how long the provider waits for the workspace pod to come up. Examples: 10m, 1h\"\n    default: 10m\n  STORAGE_CLASS:\n    description: If defined, DevPod will use the given storage class to create the persistent volume claim. You will need to ensure the storage class exists in your cluster!\n    global: true\n  PVC_ACCESS_MODE:\n    description: If defined, DevPod will use the given access mode to create the persistent volume claim. You will need to ensure the storage class support the given access mode!. E.g. RWO or ROX or RWX or RWOP\n    global: true\n  PVC_ANNOTATIONS:\n    description: If defined, DevPod will use add the given annotations to the main workspace pvc\n    global: true\n  NODE_SELECTOR:\n    description: The node selector to use for the workspace pod. E.g. my-label=value,my-label-2=value-2\n    global: true\n  RESOURCES:\n    description: The resources to use for the workspace container. E.g. requests.cpu=500m,limits.memory=5Gi,limits.gpu-vendor.example/example-gpu=1\n    global: true\n  POD_MANIFEST_TEMPLATE:\n    description: Pod manifest template file path used as template to build the devpod pod. E.g. /path/pod_manifest.yaml. Alternatively can be an inline yaml string.\n    global: true\n    type: multiline\n  LABELS:\n    description: The labels to use for the workspace pod. E.g. devpod.sh/example=value,devpod.sh/example2=value2\n    global: true\n  DOCKERLESS_IMAGE:\n    description: The dockerless image to use.\n    global: true\n  DOCKERLESS_DISABLED:\n    description: If dockerless should be disabled. Dockerless is the way DevPod uses to build images directly within Kubernetes. If dockerless is disabled and no image is specified, DevPod will fail instead.\n    global: true\n    default: \"false\"\n  STRICT_SECURITY:\n    description: \"EXPERIMENTAL! Use at your own risk. Removes the default security context and merges the one from POD_MANIFEST_TEMPLATE if specified.\"\n    type: boolean\n    default: false\n  WORKSPACE_VOLUME_MOUNT:\n    description: Sets the path of the workspace volume mount. By default it is the root of your workspace source code, usually /workspaces/$WORKSPACE_ID. If you intend to create multi-repo workspaces or need additional files throughout the lifecycle of the workspace, set this option to a parent directory of the workspace mount.\n    type: string\n  ARCHITECTURE:\n    description: The cpu architecture to use for the workspace pod. E.g. amd64, arm64, etc.\n    type: string\nagent:\n  containerInactivityTimeout: ${INACTIVITY_TIMEOUT}\n  local: true\n  dockerless:\n    disabled: ${DOCKERLESS_DISABLED}\n    image: ${DOCKERLESS_IMAGE}\n  driver: kubernetes\n  kubernetes:\n    kubernetesContext: ${KUBERNETES_CONTEXT}\n    kubernetesConfig: ${KUBERNETES_CONFIG}\n    kubernetesNamespace: ${KUBERNETES_NAMESPACE}\n    podTimeout: ${POD_TIMEOUT}\n    diskSize: ${DISK_SIZE}\n    kubernetesPullSecretsEnabled: ${KUBERNETES_PULL_SECRETS_ENABLED}\n    createNamespace: ${CREATE_NAMESPACE}\n    clusterRole: ${CLUSTER_ROLE}\n    serviceAccount: ${SERVICE_ACCOUNT}\n    architecture: ${ARCHITECTURE}\n    inactivityTimeout: ${INACTIVITY_TIMEOUT}\n    storageClass: ${STORAGE_CLASS}\n    pvcAccessMode: ${PVC_ACCESS_MODE}\n    pvcAnnotations: ${PVC_ANNOTATIONS}\n    nodeSelector: ${NODE_SELECTOR}\n    resources: ${RESOURCES}\n    workspaceVolumeMount: ${WORKSPACE_VOLUME_MOUNT}\n    podManifestTemplate: ${POD_MANIFEST_TEMPLATE}\n    labels: ${LABELS}\n    strictSecurity: ${STRICT_SECURITY}\nexec:\n  command: |-\n    \"${DEVPOD}\" helper sh -c \"${COMMAND}\"\n"
  },
  {
    "path": "providers/pro/provider.yaml",
    "content": "name: devpod-pro\nversion: v0.0.1\nicon: https://devpod.sh/assets/devpod.svg\nhome: https://github.com/loft-sh/devpod\ndescription: DevPod Pro\noptions:\n  LOFT_CONFIG:\n    global: true\n    hidden: true\n    required: true\n    default: \"${PROVIDER_FOLDER}/loft-config.json\"\nexec:\n  daemon:\n    start: ${DEVPOD} pro daemon start\n    status: ${DEVPOD} pro daemon status\n"
  },
  {
    "path": "providers/providers.go",
    "content": "package providers\n\nimport (\n\t_ \"embed\"\n)\n\n//go:embed docker/provider.yaml\nvar DockerProvider string\n\n//go:embed kubernetes/provider.yaml\nvar KubernetesProvider string\n\n//go:embed pro/provider.yaml\nvar ProProvider string\n\n// GetBuiltInProviders retrieves the built in providers\nfunc GetBuiltInProviders() map[string]string {\n\treturn map[string]string{\n\t\t\"docker\":     DockerProvider,\n\t\t\"kubernetes\": KubernetesProvider,\n\t\t\"pro\":        ProProvider,\n\t}\n}\n"
  },
  {
    "path": "scripts/install_docker.sh",
    "content": "#!/bin/sh\nset -e\n# Docker CE for Linux installation script\n#\n# See https://docs.docker.com/engine/install/ for the installation steps.\n#\n# This script is meant for quick & easy install via:\n#   $ curl -fsSL https://get.docker.com -o get-docker.sh\n#   $ sh get-docker.sh\n#\n# For test builds (ie. release candidates):\n#   $ curl -fsSL https://test.docker.com -o test-docker.sh\n#   $ sh test-docker.sh\n#\n# NOTE: Make sure to verify the contents of the script\n#       you downloaded matches the contents of install.sh\n#       located at https://github.com/docker/docker-install\n#       before executing.\n#\n# Git commit from https://github.com/docker/docker-install when\n# the script was uploaded (Should only be modified by upload job):\nSCRIPT_COMMIT_SHA=\"1d97565eca92bb523082b7d4f530c74104e05d35\"\n\n# strip \"v\" prefix if present\nVERSION=\"${VERSION#v}\"\n\n# The channel to install from:\n#   * nightly\n#   * test\n#   * stable\n#   * edge (deprecated)\nDEFAULT_CHANNEL_VALUE=\"stable\"\nif [ -z \"$CHANNEL\" ]; then\n\tCHANNEL=$DEFAULT_CHANNEL_VALUE\nfi\n\nDEFAULT_DOWNLOAD_URL=\"https://download.docker.com\"\nif [ -z \"$DOWNLOAD_URL\" ]; then\n\tDOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL\nfi\n\nDEFAULT_REPO_FILE=\"docker-ce.repo\"\nif [ -z \"$REPO_FILE\" ]; then\n\tREPO_FILE=\"$DEFAULT_REPO_FILE\"\nfi\n\nmirror=''\nDRY_RUN=${DRY_RUN:-}\nwhile [ $# -gt 0 ]; do\n\tcase \"$1\" in\n\t\t--mirror)\n\t\t\tmirror=\"$2\"\n\t\t\tshift\n\t\t\t;;\n\t\t--dry-run)\n\t\t\tDRY_RUN=1\n\t\t\t;;\n\t\t--*)\n\t\t\techo \"Illegal option $1\"\n\t\t\t;;\n\tesac\n\tshift $(( $# > 0 ? 1 : 0 ))\ndone\n\ncase \"$mirror\" in\n\tAliyun)\n\t\tDOWNLOAD_URL=\"https://mirrors.aliyun.com/docker-ce\"\n\t\t;;\n\tAzureChinaCloud)\n\t\tDOWNLOAD_URL=\"https://mirror.azure.cn/docker-ce\"\n\t\t;;\nesac\n\ncommand_exists() {\n\tcommand -v \"$@\" > /dev/null 2>&1\n}\n\n# version_gte checks if the version specified in $VERSION is at least\n# the given CalVer (YY.MM) version. returns 0 (success) if $VERSION is either\n# unset (=latest) or newer or equal than the specified version. Returns 1 (fail)\n# otherwise.\n#\n# examples:\n#\n# VERSION=20.10\n# version_gte 20.10 // 0 (success)\n# version_gte 19.03 // 0 (success)\n# version_gte 21.10 // 1 (fail)\nversion_gte() {\n\tif [ -z \"$VERSION\" ]; then\n\t\t\treturn 0\n\tfi\n\teval calver_compare \"$VERSION\" \"$1\"\n}\n\n# calver_compare compares two CalVer (YY.MM) version strings. returns 0 (success)\n# if version A is newer or equal than version B, or 1 (fail) otherwise. Patch\n# releases and pre-release (-alpha/-beta) are not taken into account\n#\n# examples:\n#\n# calver_compare 20.10 19.03 // 0 (success)\n# calver_compare 20.10 20.10 // 0 (success)\n# calver_compare 19.03 20.10 // 1 (fail)\ncalver_compare() (\n\tset +x\n\n\tyy_a=\"$(echo \"$1\" | cut -d'.' -f1)\"\n\tyy_b=\"$(echo \"$2\" | cut -d'.' -f1)\"\n\tif [ \"$yy_a\" -lt \"$yy_b\" ]; then\n\t\treturn 1\n\tfi\n\tif [ \"$yy_a\" -gt \"$yy_b\" ]; then\n\t\treturn 0\n\tfi\n\tmm_a=\"$(echo \"$1\" | cut -d'.' -f2)\"\n\tmm_b=\"$(echo \"$2\" | cut -d'.' -f2)\"\n\tif [ \"${mm_a#0}\" -lt \"${mm_b#0}\" ]; then\n\t\treturn 1\n\tfi\n\n\treturn 0\n)\n\nis_dry_run() {\n\tif [ -z \"$DRY_RUN\" ]; then\n\t\treturn 1\n\telse\n\t\treturn 0\n\tfi\n}\n\nis_wsl() {\n\tcase \"$(uname -r)\" in\n\t*microsoft* ) true ;; # WSL 2\n\t*Microsoft* ) true ;; # WSL 1\n\t* ) false;;\n\tesac\n}\n\nis_darwin() {\n\tcase \"$(uname -s)\" in\n\t*darwin* ) true ;;\n\t*Darwin* ) true ;;\n\t* ) false;;\n\tesac\n}\n\ndeprecation_notice() {\n\tdistro=$1\n\tdistro_version=$2\n\techo\n\tprintf \"\\033[91;1mDEPRECATION WARNING\\033[0m\\n\"\n\tprintf \"    This Linux distribution (\\033[1m%s %s\\033[0m) reached end-of-life and is no longer supported by this script.\\n\" \"$distro\" \"$distro_version\"\n\techo   \"    No updates or security fixes will be released for this distribution, and users are recommended\"\n\techo   \"    to upgrade to a currently maintained version of $distro.\"\n\techo\n\tprintf   \"Press \\033[1mCtrl+C\\033[0m now to abort this script, or wait for the installation to continue.\"\n\techo\n\tsleep 10\n}\n\nget_distribution() {\n\tlsb_dist=\"\"\n\t# Every system that we officially support has /etc/os-release\n\tif [ -r /etc/os-release ]; then\n\t\tlsb_dist=\"$(. /etc/os-release && echo \"$ID\")\"\n\tfi\n\t# Returning an empty string here should be alright since the\n\t# case statements don't act unless you provide an actual value\n\techo \"$lsb_dist\"\n}\n\necho_docker_as_nonroot() {\n\tif is_dry_run; then\n\t\treturn\n\tfi\n\tif command_exists docker && [ -e /var/run/docker.sock ]; then\n\t\t(\n\t\t\tset -x\n\t\t\t$sh_c 'docker version'\n\t\t) || true\n\tfi\n\n\t# intentionally mixed spaces and tabs here -- tabs are stripped by \"<<-EOF\", spaces are kept in the output\n\techo\n\techo \"================================================================================\"\n\techo\n\tif version_gte \"20.10\"; then\n\t\techo \"To run Docker as a non-privileged user, consider setting up the\"\n\t\techo \"Docker daemon in rootless mode for your user:\"\n\t\techo\n\t\techo \"    dockerd-rootless-setuptool.sh install\"\n\t\techo\n\t\techo \"Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.\"\n\t\techo\n\tfi\n\techo\n\techo \"To run the Docker daemon as a fully privileged service, but granting non-root\"\n\techo \"users access, refer to https://docs.docker.com/go/daemon-access/\"\n\techo\n\techo \"WARNING: Access to the remote API on a privileged Docker daemon is equivalent\"\n\techo \"         to root access on the host. Refer to the 'Docker daemon attack surface'\"\n\techo \"         documentation for details: https://docs.docker.com/go/attack-surface/\"\n\techo\n\techo \"================================================================================\"\n\techo\n}\n\n# Check if this is a forked Linux distro\ncheck_forked() {\n\n\t# Check for lsb_release command existence, it usually exists in forked distros\n\tif command_exists lsb_release; then\n\t\t# Check if the `-u` option is supported\n\t\tset +e\n\t\tlsb_release -a -u > /dev/null 2>&1\n\t\tlsb_release_exit_code=$?\n\t\tset -e\n\n\t\t# Check if the command has exited successfully, it means we're in a forked distro\n\t\tif [ \"$lsb_release_exit_code\" = \"0\" ]; then\n\t\t\t# Print info about current distro\n\t\t\tcat <<-EOF\n\t\t\tYou're using '$lsb_dist' version '$dist_version'.\n\t\t\tEOF\n\n\t\t\t# Get the upstream release info\n\t\t\tlsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]')\n\t\t\tdist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[:space:]')\n\n\t\t\t# Print info about upstream distro\n\t\t\tcat <<-EOF\n\t\t\tUpstream release is '$lsb_dist' version '$dist_version'.\n\t\t\tEOF\n\t\telse\n\t\t\tif [ -r /etc/debian_version ] && [ \"$lsb_dist\" != \"ubuntu\" ] && [ \"$lsb_dist\" != \"raspbian\" ]; then\n\t\t\t\tif [ \"$lsb_dist\" = \"osmc\" ]; then\n\t\t\t\t\t# OSMC runs Raspbian\n\t\t\t\t\tlsb_dist=raspbian\n\t\t\t\telse\n\t\t\t\t\t# We're Debian and don't even know it!\n\t\t\t\t\tlsb_dist=debian\n\t\t\t\tfi\n\t\t\t\tdist_version=\"$(sed 's/\\/.*//' /etc/debian_version | sed 's/\\..*//')\"\n\t\t\t\tcase \"$dist_version\" in\n\t\t\t\t\t11)\n\t\t\t\t\t\tdist_version=\"bullseye\"\n\t\t\t\t\t;;\n\t\t\t\t\t10)\n\t\t\t\t\t\tdist_version=\"buster\"\n\t\t\t\t\t;;\n\t\t\t\t\t9)\n\t\t\t\t\t\tdist_version=\"stretch\"\n\t\t\t\t\t;;\n\t\t\t\t\t8)\n\t\t\t\t\t\tdist_version=\"jessie\"\n\t\t\t\t\t;;\n\t\t\t\tesac\n\t\t\tfi\n\t\tfi\n\tfi\n}\n\ndo_install() {\n\techo \"# Executing docker install script, commit: $SCRIPT_COMMIT_SHA\"\n\n\tif command_exists docker; then\n\t\tcat >&2 <<-'EOF'\n\t\t\tWarning: the \"docker\" command appears to already exist on this system.\n\n\t\t\tIf you already have Docker installed, this script can cause trouble, which is\n\t\t\twhy we're displaying this warning and provide the opportunity to cancel the\n\t\t\tinstallation.\n\n\t\t\tIf you installed the current Docker package using this script and are using it\n\t\t\tagain to update Docker, you can safely ignore this message.\n\n\t\t\tYou may press Ctrl+C now to abort this script.\n\t\tEOF\n\t\t( set -x; sleep 20 )\n\tfi\n\n\tuser=\"$(id -un 2>/dev/null || true)\"\n\n\tsh_c='sh -c'\n\tif [ \"$user\" != 'root' ]; then\n\t\tif command_exists sudo; then\n\t\t\tsh_c='sudo -E sh -c'\n\t\telif command_exists su; then\n\t\t\tsh_c='su -c'\n\t\telse\n\t\t\tcat >&2 <<-'EOF'\n\t\t\tError: this installer needs the ability to run commands as root.\n\t\t\tWe are unable to find either \"sudo\" or \"su\" available to make this happen.\n\t\t\tEOF\n\t\t\texit 1\n\t\tfi\n\tfi\n\n\tif is_dry_run; then\n\t\tsh_c=\"echo\"\n\tfi\n\n\t# perform some very rudimentary platform detection\n\tlsb_dist=$( get_distribution )\n\tlsb_dist=\"$(echo \"$lsb_dist\" | tr '[:upper:]' '[:lower:]')\"\n\n\tif is_wsl; then\n\t\techo\n\t\techo \"WSL DETECTED: We recommend using Docker Desktop for Windows.\"\n\t\techo \"Please get Docker Desktop from https://www.docker.com/products/docker-desktop\"\n\t\techo\n\t\tcat >&2 <<-'EOF'\n\n\t\t\tYou may press Ctrl+C now to abort this script.\n\t\tEOF\n\t\t( set -x; sleep 20 )\n\tfi\n\n\tcase \"$lsb_dist\" in\n\n\t\tubuntu)\n\t\t\tif command_exists lsb_release; then\n\t\t\t\tdist_version=\"$(lsb_release --codename | cut -f2)\"\n\t\t\tfi\n\t\t\tif [ -z \"$dist_version\" ] && [ -r /etc/lsb-release ]; then\n\t\t\t\tdist_version=\"$(. /etc/lsb-release && echo \"$DISTRIB_CODENAME\")\"\n\t\t\tfi\n\t\t;;\n\n\t\tdebian|raspbian)\n\t\t\tdist_version=\"$(sed 's/\\/.*//' /etc/debian_version | sed 's/\\..*//')\"\n\t\t\tcase \"$dist_version\" in\n\t\t\t\t11)\n\t\t\t\t\tdist_version=\"bullseye\"\n\t\t\t\t;;\n\t\t\t\t10)\n\t\t\t\t\tdist_version=\"buster\"\n\t\t\t\t;;\n\t\t\t\t9)\n\t\t\t\t\tdist_version=\"stretch\"\n\t\t\t\t;;\n\t\t\t\t8)\n\t\t\t\t\tdist_version=\"jessie\"\n\t\t\t\t;;\n\t\t\tesac\n\t\t;;\n\n\t\tcentos|rhel|sles)\n\t\t\tif [ -z \"$dist_version\" ] && [ -r /etc/os-release ]; then\n\t\t\t\tdist_version=\"$(. /etc/os-release && echo \"$VERSION_ID\")\"\n\t\t\tfi\n\t\t;;\n\n\t\t*)\n\t\t\tif command_exists lsb_release; then\n\t\t\t\tdist_version=\"$(lsb_release --release | cut -f2)\"\n\t\t\tfi\n\t\t\tif [ -z \"$dist_version\" ] && [ -r /etc/os-release ]; then\n\t\t\t\tdist_version=\"$(. /etc/os-release && echo \"$VERSION_ID\")\"\n\t\t\tfi\n\t\t;;\n\n\tesac\n\n\t# Check if this is a forked Linux distro\n\tcheck_forked\n\n\t# Print deprecation warnings for distro versions that recently reached EOL,\n\t# but may still be commonly used (especially LTS versions).\n\tcase \"$lsb_dist.$dist_version\" in\n\t\tdebian.stretch|debian.jessie)\n\t\t\tdeprecation_notice \"$lsb_dist\" \"$dist_version\"\n\t\t\t;;\n\t\traspbian.stretch|raspbian.jessie)\n\t\t\tdeprecation_notice \"$lsb_dist\" \"$dist_version\"\n\t\t\t;;\n\t\tubuntu.xenial|ubuntu.trusty)\n\t\t\tdeprecation_notice \"$lsb_dist\" \"$dist_version\"\n\t\t\t;;\n\t\tfedora.*)\n\t\t\tif [ \"$dist_version\" -lt 33 ]; then\n\t\t\t\tdeprecation_notice \"$lsb_dist\" \"$dist_version\"\n\t\t\tfi\n\t\t\t;;\n\tesac\n\n\t# Run setup for each distro accordingly\n\tcase \"$lsb_dist\" in\n\t\tubuntu|debian|raspbian)\n\t\t\tpre_reqs=\"apt-transport-https ca-certificates curl\"\n\t\t\tif ! command -v gpg > /dev/null; then\n\t\t\t\tpre_reqs=\"$pre_reqs gnupg\"\n\t\t\tfi\n\t\t\tapt_repo=\"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL\"\n\t\t\t(\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c 'apt-get update -qq >/dev/null'\n\t\t\t\t$sh_c \"DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pre_reqs >/dev/null\"\n\t\t\t\t$sh_c 'mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings'\n\t\t\t\t$sh_c \"curl -fsSL \\\"$DOWNLOAD_URL/linux/$lsb_dist/gpg\\\" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg\"\n\t\t\t\t$sh_c \"chmod a+r /etc/apt/keyrings/docker.gpg\"\n\t\t\t\t$sh_c \"echo \\\"$apt_repo\\\" > /etc/apt/sources.list.d/docker.list\"\n\t\t\t\t$sh_c 'apt-get update -qq >/dev/null'\n\t\t\t)\n\t\t\tpkg_version=\"\"\n\t\t\tif [ -n \"$VERSION\" ]; then\n\t\t\t\tif is_dry_run; then\n\t\t\t\t\techo \"# WARNING: VERSION pinning is not supported in DRY_RUN\"\n\t\t\t\telse\n\t\t\t\t\t# Will work for incomplete versions IE (17.12), but may not actually grab the \"latest\" if in the test channel\n\t\t\t\t\tpkg_pattern=\"$(echo \"$VERSION\" | sed \"s/-ce-/~ce~.*/g\" | sed \"s/-/.*/g\")\"\n\t\t\t\t\tsearch_command=\"apt-cache madison 'docker-ce' | grep '$pkg_pattern' | head -1 | awk '{\\$1=\\$1};1' | cut -d' ' -f 3\"\n\t\t\t\t\tpkg_version=\"$($sh_c \"$search_command\")\"\n\t\t\t\t\techo \"INFO: Searching repository for VERSION '$VERSION'\"\n\t\t\t\t\techo \"INFO: $search_command\"\n\t\t\t\t\tif [ -z \"$pkg_version\" ]; then\n\t\t\t\t\t\techo\n\t\t\t\t\t\techo \"ERROR: '$VERSION' not found amongst apt-cache madison results\"\n\t\t\t\t\t\techo\n\t\t\t\t\t\texit 1\n\t\t\t\t\tfi\n\t\t\t\t\tif version_gte \"18.09\"; then\n\t\t\t\t\t\t\tsearch_command=\"apt-cache madison 'docker-ce-cli' | grep '$pkg_pattern' | head -1 | awk '{\\$1=\\$1};1' | cut -d' ' -f 3\"\n\t\t\t\t\t\t\techo \"INFO: $search_command\"\n\t\t\t\t\t\t\tcli_pkg_version=\"=$($sh_c \"$search_command\")\"\n\t\t\t\t\tfi\n\t\t\t\t\tpkg_version=\"=$pkg_version\"\n\t\t\t\tfi\n\t\t\tfi\n\t\t\t(\n\t\t\t\tpkgs=\"docker-ce${pkg_version%=}\"\n\t\t\t\tif version_gte \"18.09\"; then\n\t\t\t\t\t\t# older versions didn't ship the cli and containerd as separate packages\n\t\t\t\t\t\tpkgs=\"$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io\"\n\t\t\t\tfi\n\t\t\t\tif version_gte \"20.10\"; then\n\t\t\t\t\t\tpkgs=\"$pkgs docker-compose-plugin\"\n\t\t\t\tfi\n\t\t\t\tif version_gte \"23.0\"; then\n\t\t\t\t\t\tpkgs=\"$pkgs docker-buildx-plugin\"\n\t\t\t\tfi\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c \"DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends $pkgs >/dev/null\"\n\t\t\t)\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\t\tcentos|fedora|rhel)\n\t\t\tif [ \"$(uname -m)\" != \"s390x\" ] && [ \"$lsb_dist\" = \"rhel\" ]; then\n\t\t\t\techo \"Packages for RHEL are currently only available for s390x.\"\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\tif [ \"$lsb_dist\" = \"fedora\" ]; then\n\t\t\t\tpkg_manager=\"dnf\"\n\t\t\t\tconfig_manager=\"dnf config-manager\"\n\t\t\t\tenable_channel_flag=\"--set-enabled\"\n\t\t\t\tdisable_channel_flag=\"--set-disabled\"\n\t\t\t\tpre_reqs=\"dnf-plugins-core\"\n\t\t\t\tpkg_suffix=\"fc$dist_version\"\n\t\t\telse\n\t\t\t\tpkg_manager=\"yum\"\n\t\t\t\tconfig_manager=\"yum-config-manager\"\n\t\t\t\tenable_channel_flag=\"--enable\"\n\t\t\t\tdisable_channel_flag=\"--disable\"\n\t\t\t\tpre_reqs=\"yum-utils\"\n\t\t\t\tpkg_suffix=\"el\"\n\t\t\tfi\n\t\t\trepo_file_url=\"$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE\"\n\t\t\t(\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c \"$pkg_manager install -y -q $pre_reqs\"\n\t\t\t\t$sh_c \"$config_manager --add-repo $repo_file_url\"\n\n\t\t\t\tif [ \"$CHANNEL\" != \"stable\" ]; then\n\t\t\t\t\t$sh_c \"$config_manager $disable_channel_flag docker-ce-*\"\n\t\t\t\t\t$sh_c \"$config_manager $enable_channel_flag docker-ce-$CHANNEL\"\n\t\t\t\tfi\n\t\t\t\t$sh_c \"$pkg_manager makecache\"\n\t\t\t)\n\t\t\tpkg_version=\"\"\n\t\t\tif [ -n \"$VERSION\" ]; then\n\t\t\t\tif is_dry_run; then\n\t\t\t\t\techo \"# WARNING: VERSION pinning is not supported in DRY_RUN\"\n\t\t\t\telse\n\t\t\t\t\tpkg_pattern=\"$(echo \"$VERSION\" | sed \"s/-ce-/\\\\\\\\.ce.*/g\" | sed \"s/-/.*/g\").*$pkg_suffix\"\n\t\t\t\t\tsearch_command=\"$pkg_manager list --showduplicates 'docker-ce' | grep '$pkg_pattern' | tail -1 | awk '{print \\$2}'\"\n\t\t\t\t\tpkg_version=\"$($sh_c \"$search_command\")\"\n\t\t\t\t\techo \"INFO: Searching repository for VERSION '$VERSION'\"\n\t\t\t\t\techo \"INFO: $search_command\"\n\t\t\t\t\tif [ -z \"$pkg_version\" ]; then\n\t\t\t\t\t\techo\n\t\t\t\t\t\techo \"ERROR: '$VERSION' not found amongst $pkg_manager list results\"\n\t\t\t\t\t\techo\n\t\t\t\t\t\texit 1\n\t\t\t\t\tfi\n\t\t\t\t\tif version_gte \"18.09\"; then\n\t\t\t\t\t\t# older versions don't support a cli package\n\t\t\t\t\t\tsearch_command=\"$pkg_manager list --showduplicates 'docker-ce-cli' | grep '$pkg_pattern' | tail -1 | awk '{print \\$2}'\"\n\t\t\t\t\t\tcli_pkg_version=\"$($sh_c \"$search_command\" | cut -d':' -f 2)\"\n\t\t\t\t\tfi\n\t\t\t\t\t# Cut out the epoch and prefix with a '-'\n\t\t\t\t\tpkg_version=\"-$(echo \"$pkg_version\" | cut -d':' -f 2)\"\n\t\t\t\tfi\n\t\t\tfi\n\t\t\t(\n\t\t\t\tpkgs=\"docker-ce$pkg_version\"\n\t\t\t\tif version_gte \"18.09\"; then\n\t\t\t\t\t# older versions didn't ship the cli and containerd as separate packages\n\t\t\t\t\tif [ -n \"$cli_pkg_version\" ]; then\n\t\t\t\t\t\tpkgs=\"$pkgs docker-ce-cli-$cli_pkg_version containerd.io\"\n\t\t\t\t\telse\n\t\t\t\t\t\tpkgs=\"$pkgs docker-ce-cli containerd.io\"\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\tif version_gte \"20.10\" && [ \"$(uname -m)\" = \"x86_64\" ]; then\n\t\t\t\t\t\t# also install the latest version of the \"docker scan\" cli-plugin (only supported on x86 currently)\n\t\t\t\t\t\tpkgs=\"$pkgs docker-scan-plugin\"\n\t\t\t\tfi\n\t\t\t\tif version_gte \"20.10\"; then\n\t\t\t\t\tpkgs=\"$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version\"\n\t\t\t\tfi\n\t\t\t\tif version_gte \"23.0\"; then\n\t\t\t\t\t\tpkgs=\"$pkgs docker-buildx-plugin\"\n\t\t\t\tfi\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c \"$pkg_manager install -y -q $pkgs\"\n\t\t\t)\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\t\tsles)\n\t\t\tif [ \"$(uname -m)\" != \"s390x\" ]; then\n\t\t\t\techo \"Packages for SLES are currently only available for s390x\"\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\tif [ \"$dist_version\" = \"15.3\" ]; then\n\t\t\t\tsles_version=\"SLE_15_SP3\"\n\t\t\telse\n\t\t\t\tsles_minor_version=\"${dist_version##*.}\"\n\t\t\t\tsles_version=\"15.$sles_minor_version\"\n\t\t\tfi\n\t\t\topensuse_repo=\"https://download.opensuse.org/repositories/security:SELinux/$sles_version/security:SELinux.repo\"\n\t\t\trepo_file_url=\"$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE\"\n\t\t\tpre_reqs=\"ca-certificates curl libseccomp2 awk\"\n\t\t\t(\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c \"zypper install -y $pre_reqs\"\n\t\t\t\t$sh_c \"zypper addrepo $repo_file_url\"\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\t\tcat >&2 <<-'EOF'\n\t\t\t\t\t\tWARNING!!\n\t\t\t\t\t\topenSUSE repository (https://download.opensuse.org/repositories/security:SELinux) will be enabled now.\n\t\t\t\t\t\tDo you wish to continue?\n\t\t\t\t\t\tYou may press Ctrl+C now to abort this script.\n\t\t\t\t\t\tEOF\n\t\t\t\t\t\t( set -x; sleep 30 )\n\t\t\t\tfi\n\t\t\t\t$sh_c \"zypper addrepo $opensuse_repo\"\n\t\t\t\t$sh_c \"zypper --gpg-auto-import-keys refresh\"\n\t\t\t\t$sh_c \"zypper lr -d\"\n\t\t\t)\n\t\t\tpkg_version=\"\"\n\t\t\tif [ -n \"$VERSION\" ]; then\n\t\t\t\tif is_dry_run; then\n\t\t\t\t\techo \"# WARNING: VERSION pinning is not supported in DRY_RUN\"\n\t\t\t\telse\n\t\t\t\t\tpkg_pattern=\"$(echo \"$VERSION\" | sed \"s/-ce-/\\\\\\\\.ce.*/g\" | sed \"s/-/.*/g\")\"\n\t\t\t\t\tsearch_command=\"zypper search -s --match-exact 'docker-ce' | grep '$pkg_pattern' | tail -1 | awk '{print \\$6}'\"\n\t\t\t\t\tpkg_version=\"$($sh_c \"$search_command\")\"\n\t\t\t\t\techo \"INFO: Searching repository for VERSION '$VERSION'\"\n\t\t\t\t\techo \"INFO: $search_command\"\n\t\t\t\t\tif [ -z \"$pkg_version\" ]; then\n\t\t\t\t\t\techo\n\t\t\t\t\t\techo \"ERROR: '$VERSION' not found amongst zypper list results\"\n\t\t\t\t\t\techo\n\t\t\t\t\t\texit 1\n\t\t\t\t\tfi\n\t\t\t\t\tsearch_command=\"zypper search -s --match-exact 'docker-ce-cli' | grep '$pkg_pattern' | tail -1 | awk '{print \\$6}'\"\n\t\t\t\t\t# It's okay for cli_pkg_version to be blank, since older versions don't support a cli package\n\t\t\t\t\tcli_pkg_version=\"$($sh_c \"$search_command\")\"\n\t\t\t\t\tpkg_version=\"-$pkg_version\"\n\n\t\t\t\t\tsearch_command=\"zypper search -s --match-exact 'docker-ce-rootless-extras' | grep '$pkg_pattern' | tail -1 | awk '{print \\$6}'\"\n\t\t\t\t\trootless_pkg_version=\"$($sh_c \"$search_command\")\"\n\t\t\t\t\trootless_pkg_version=\"-$rootless_pkg_version\"\n\t\t\t\tfi\n\t\t\tfi\n\t\t\t(\n\t\t\t\tpkgs=\"docker-ce$pkg_version\"\n\t\t\t\tif version_gte \"18.09\"; then\n\t\t\t\t\tif [ -n \"$cli_pkg_version\" ]; then\n\t\t\t\t\t\t# older versions didn't ship the cli and containerd as separate packages\n\t\t\t\t\t\tpkgs=\"$pkgs docker-ce-cli-$cli_pkg_version containerd.io\"\n\t\t\t\t\telse\n\t\t\t\t\t\tpkgs=\"$pkgs docker-ce-cli containerd.io\"\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\tif version_gte \"20.10\"; then\n\t\t\t\t\tpkgs=\"$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version\"\n\t\t\t\tfi\n\t\t\t\tif version_gte \"23.0\"; then\n\t\t\t\t\tpkgs=\"$pkgs docker-buildx-plugin\"\n\t\t\t\tfi\n\t\t\t\tif ! is_dry_run; then\n\t\t\t\t\tset -x\n\t\t\t\tfi\n\t\t\t\t$sh_c \"zypper -q install -y $pkgs\"\n\t\t\t)\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\t\t*)\n\t\t\tif [ -z \"$lsb_dist\" ]; then\n\t\t\t\tif is_darwin; then\n\t\t\t\t\techo\n\t\t\t\t\techo \"ERROR: Unsupported operating system 'macOS'\"\n\t\t\t\t\techo \"Please get Docker Desktop from https://www.docker.com/products/docker-desktop\"\n\t\t\t\t\techo\n\t\t\t\t\texit 1\n\t\t\t\tfi\n\t\t\tfi\n\t\t\techo\n\t\t\techo \"ERROR: Unsupported distribution '$lsb_dist'\"\n\t\t\techo\n\t\t\texit 1\n\t\t\t;;\n\tesac\n\texit 1\n}\n\n# wrapped up in a function so that we have some protection against only getting\n# half the file during \"curl | sh\"\ndo_install"
  },
  {
    "path": "scripts/scripts.go",
    "content": "package scripts\n\nimport _ \"embed\"\n\n//go:embed install_docker.sh\nvar InstallDocker string\n"
  },
  {
    "path": "vendor/cel.dev/expr/.bazelversion",
    "content": "7.0.1\n# Keep this pinned version in parity with cel-go\n"
  },
  {
    "path": "vendor/cel.dev/expr/.gitattributes",
    "content": "*.pb.go linguist-generated=true\n*.pb.go -diff -merge\n"
  },
  {
    "path": "vendor/cel.dev/expr/.gitignore",
    "content": "bazel-*\nMODULE.bazel.lock\n"
  },
  {
    "path": "vendor/cel.dev/expr/BUILD.bazel",
    "content": "load(\"@io_bazel_rules_go//go:def.bzl\", \"go_library\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nlicenses([\"notice\"])  # Apache 2.0\n\ngo_library(\n    name = \"expr\",\n    srcs = [\n        \"checked.pb.go\",\n        \"eval.pb.go\",\n        \"explain.pb.go\",\n        \"syntax.pb.go\",\n        \"value.pb.go\",\n    ],\n    importpath = \"cel.dev/expr\",\n    visibility = [\"//visibility:public\"],\n    deps = [\n        \"@org_golang_google_genproto_googleapis_rpc//status:go_default_library\",\n        \"@org_golang_google_protobuf//reflect/protoreflect\",\n        \"@org_golang_google_protobuf//runtime/protoimpl\",\n        \"@org_golang_google_protobuf//types/known/anypb\",\n        \"@org_golang_google_protobuf//types/known/durationpb\",\n        \"@org_golang_google_protobuf//types/known/emptypb\",\n        \"@org_golang_google_protobuf//types/known/structpb\",\n        \"@org_golang_google_protobuf//types/known/timestamppb\",\n    ],\n)\n\nalias(\n    name = \"go_default_library\",\n    actual = \":expr\",\n    visibility = [\"//visibility:public\"],\n)\n"
  },
  {
    "path": "vendor/cel.dev/expr/CODE_OF_CONDUCT.md",
    "content": "# Contributor Code of Conduct\n## Version 0.1.1 (adapted from 0.3b-angular)\n\nAs contributors and maintainers of the Common Expression Language\n(CEL) project, we pledge to respect everyone who contributes by\nposting issues, updating documentation, submitting pull requests,\nproviding feedback in comments, and any other activities.\n\nCommunication through any of CEL's channels (GitHub, Gitter, IRC,\nmailing lists, Google+, Twitter, etc.) must be constructive and never\nresort to personal attacks, trolling, public or private harassment,\ninsults, or other unprofessional conduct.\n\nWe promise to extend courtesy and respect to everyone involved in this\nproject regardless of gender, gender identity, sexual orientation,\ndisability, age, race, ethnicity, religion, or level of experience. We\nexpect anyone contributing to the project to do the same.\n\nIf any member of the community violates this code of conduct, the\nmaintainers of the CEL project may take action, removing issues,\ncomments, and PRs or blocking accounts as deemed appropriate.\n\nIf you are subject to or witness unacceptable behavior, or have any\nother concerns, please email us at\n[cel-conduct@google.com](mailto:cel-conduct@google.com).\n"
  },
  {
    "path": "vendor/cel.dev/expr/CONTRIBUTING.md",
    "content": "# How to Contribute\n\nWe'd love to accept your patches and contributions to this project. There are a\nfew guidelines you need to follow.\n\n## Contributor License Agreement\n\nContributions to this project must be accompanied by a Contributor License\nAgreement. You (or your employer) retain the copyright to your contribution,\nthis simply gives us permission to use and redistribute your contributions as\npart of the project. Head over to <https://cla.developers.google.com/> to see\nyour current agreements on file or to sign a new one.\n\nYou generally only need to submit a CLA once, so if you've already submitted one\n(even if it was for a different project), you probably don't need to do it\nagain.\n\n## Code reviews\n\nAll submissions, including submissions by project members, require review. We\nuse GitHub pull requests for this purpose. Consult\n[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more\ninformation on using pull requests.\n\n## What to expect from maintainers\n\nExpect maintainers to respond to new issues or pull requests within a week.\nFor outstanding and ongoing issues and particularly for long-running\npull requests, expect the maintainers to review within a week of a\ncontributor asking for a new review. There is no commitment to resolution --\nmerging or closing a pull request, or fixing or closing an issue -- because some\nissues will require more discussion than others.\n"
  },
  {
    "path": "vendor/cel.dev/expr/GOVERNANCE.md",
    "content": "# Project Governance\n\nThis document defines the governance process for the CEL language. CEL is\nGoogle-developed, but openly governed. Major contributors to the CEL\nspecification and its corresponding implementations constitute the CEL\nLanguage Council. New members may be added by a unanimous vote of the\nCouncil.\n\nThe MAINTAINERS.md file lists the members of the CEL Language Council, and\nunofficially indicates the \"areas of expertise\" of each member with respect\nto the publicly available CEL repos.\n\n## Code Changes\n\nCode changes must follow the standard pull request (PR) model documented in the\nCONTRIBUTING.md for each CEL repo. All fixes and features must be reviewed by a\nmaintainer. The maintainer reserves the right to request that any feature\nrequest (FR) or PR be reviewed by the language council.\n\n## Syntax and Semantic Changes\n\nSyntactic and semantic changes must be reviewed by the CEL Language Council.\nMaintainers may also request language council review at their discretion.\n\nThe review process is as follows:\n\n- Create a Feature Request in the CEL-Spec repo. The feature description will\n  serve as an abstract for the detailed design document.\n- Co-develop a design document with the Language Council.\n- Once the proposer gives the design document approval, the document will be\n  linked to the FR in the CEL-Spec repo and opened for comments to members of\n  the cel-lang-discuss@googlegroups.com.\n- The Language Council will review the design doc at the next council meeting\n  (once every three weeks) and the council decision included in the document.\n\nIf the proposal is approved, the spec will be updated by a maintainer (if\napplicable) and a rationale will be included in the CEL-Spec wiki to ensure\nfuture developers may follow CEL's growth and direction over time.\n\nApproved proposals may be implemented by the proposer or by the maintainers as\nthe parties see fit. At the discretion of the maintainer, changes from the\napproved design are permitted during implementation if they improve the user\nexperience and clarity of the feature.\n"
  },
  {
    "path": "vendor/cel.dev/expr/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/cel.dev/expr/MAINTAINERS.md",
    "content": "# CEL Language Council\n\n| Name            | Company      | Area of Expertise |\n|-----------------|--------------|-------------------|\n| Alfred Fuller   | Facebook     | cel-cpp, cel-spec |\n| Jim Larson      | Google       | cel-go, cel-spec  |\n| Matthais Blume  | Google       | cel-spec          |\n| Tristan Swadell | Google       | cel-go, cel-spec  |\n\n## Emeritus\n\n* Sanjay Ghemawat (Google)\n* Wolfgang Grieskamp (Facebook)\n"
  },
  {
    "path": "vendor/cel.dev/expr/MODULE.bazel",
    "content": "module(\n    name = \"cel-spec\",\n)\n\nbazel_dep(\n    name = \"bazel_skylib\",\n    version = \"1.7.1\",\n)\nbazel_dep(\n    name = \"gazelle\",\n    version = \"0.36.0\",\n    repo_name = \"bazel_gazelle\",\n)\nbazel_dep(\n    name = \"googleapis\",\n    version = \"0.0.0-20240819-fe8ba054a\",\n    repo_name = \"com_google_googleapis\",\n)\nbazel_dep(\n    name = \"protobuf\",\n    version = \"26.0\",\n    repo_name = \"com_google_protobuf\",\n)\nbazel_dep(\n    name = \"rules_cc\",\n    version = \"0.0.9\",\n)\nbazel_dep(\n    name = \"rules_go\",\n    version = \"0.49.0\",\n    repo_name = \"io_bazel_rules_go\",\n)\nbazel_dep(\n    name = \"rules_java\",\n    version = \"7.6.5\",\n)\nbazel_dep(\n    name = \"rules_proto\",\n    version = \"6.0.0\",\n)\nbazel_dep(\n    name = \"rules_python\",\n    version = \"0.35.0\",\n)\n\n### PYTHON ###\npython = use_extension(\"@rules_python//python/extensions:python.bzl\", \"python\")\npython.toolchain(\n    ignore_root_user_error = True,\n    python_version = \"3.11\",\n)\n\nswitched_rules = use_extension(\"@com_google_googleapis//:extensions.bzl\", \"switched_rules\")\nswitched_rules.use_languages(\n    cc = True,\n    go = True,\n    java = True,\n)\nuse_repo(switched_rules, \"com_google_googleapis_imports\")\n\ngo_sdk = use_extension(\"@io_bazel_rules_go//go:extensions.bzl\", \"go_sdk\")\ngo_sdk.download(version = \"1.21.1\")\n\ngo_deps = use_extension(\"@bazel_gazelle//:extensions.bzl\", \"go_deps\")\ngo_deps.from_file(go_mod = \"//:go.mod\")\nuse_repo(\n    go_deps,\n    \"org_golang_google_genproto_googleapis_rpc\",\n    \"org_golang_google_protobuf\",\n)\n"
  },
  {
    "path": "vendor/cel.dev/expr/README.md",
    "content": "# Common Expression Language\n\nThe Common Expression Language (CEL) implements common semantics for expression\nevaluation, enabling different applications to more easily interoperate.\n\nKey Applications\n\n*   Security policy: organizations have complex infrastructure and need common\n    tooling to reason about the system as a whole\n*   Protocols: expressions are a useful data type and require interoperability\n    across programming languages and platforms.\n\n\nGuiding philosophy:\n\n1.  Keep it small & fast.\n    *   CEL evaluates in linear time, is mutation free, and not Turing-complete.\n        This limitation is a feature of the language design, which allows the\n        implementation to evaluate orders of magnitude faster than equivalently\n        sandboxed JavaScript.\n2.  Make it extensible.\n    *   CEL is designed to be embedded in applications, and allows for\n        extensibility via its context which allows for functions and data to be\n        provided by the software that embeds it.\n3.  Developer-friendly.\n    *   The language is approachable to developers. The initial spec was based\n        on the experience of developing Firebase Rules and usability testing\n        many prior iterations.\n    *   The library itself and accompanying toolings should be easy to adopt by\n        teams that seek to integrate CEL into their platforms.\n\nThe required components of a system that supports CEL are:\n\n*   The textual representation of an expression as written by a developer. It is\n    of similar syntax to expressions in C/C++/Java/JavaScript\n*   A representation of the program's abstract syntax tree (AST).\n*   A compiler library that converts the textual representation to the binary\n    representation. This can be done ahead of time (in the control plane) or\n    just before evaluation (in the data plane).\n*   A context containing one or more typed variables, often protobuf messages.\n    Most use-cases will use `attribute_context.proto`\n*   An evaluator library that takes the binary format in the context and\n    produces a result, usually a Boolean.\n\nFor use cases which require persistence or cross-process communcation, it is\nhighly recommended to serialize the type-checked expression as a protocol\nbuffer. The CEL team will maintains canonical protocol buffers for ASTs and\nwill keep these versions identical and wire-compatible in perpetuity:\n\n*  [CEL canonical](https://github.com/google/cel-spec/tree/master/proto/cel/expr)\n*  [CEL v1alpha1](https://github.com/googleapis/googleapis/tree/master/google/api/expr/v1alpha1)\n\n\nExample of boolean conditions and object construction:\n\n``` c\n// Condition\naccount.balance >= transaction.withdrawal\n    || (account.overdraftProtection\n    && account.overdraftLimit >= transaction.withdrawal  - account.balance)\n\n// Object construction\ncommon.GeoPoint{ latitude: 10.0, longitude: -5.5 }\n```\n\nFor more detail, see:\n\n*   [Introduction](doc/intro.md)\n*   [Language Definition](doc/langdef.md)\n\nReleased under the [Apache License](LICENSE).\n\nDisclaimer: This is not an official Google product.\n"
  },
  {
    "path": "vendor/cel.dev/expr/WORKSPACE",
    "content": "load(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"io_bazel_rules_go\",\n    sha256 = \"099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip\",\n        \"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip\",\n    ],\n)\n\nhttp_archive(\n    name = \"bazel_gazelle\",\n    sha256 = \"ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz\",\n        \"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz\",\n    ],\n)\n\nhttp_archive(\n    name = \"rules_proto\",\n    sha256 = \"e017528fd1c91c5a33f15493e3a398181a9e821a804eb7ff5acdd1d2d6c2b18d\",\n    strip_prefix = \"rules_proto-4.0.0-3.20.0\",\n    urls = [\n        \"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0-3.20.0.tar.gz\",\n    ],\n)\n\n# googleapis as of 09/16/2024\nhttp_archive(\n    name = \"com_google_googleapis\",\n    strip_prefix = \"googleapis-4082d5e51e8481f6ccc384cacd896f4e78f19dee\",\n    sha256 = \"57319889d47578b3c89bf1b3f34888d796a8913d63b32d750a4cd12ed303c4e8\",\n    urls = [\n        \"https://github.com/googleapis/googleapis/archive/4082d5e51e8481f6ccc384cacd896f4e78f19dee.tar.gz\",\n    ],\n)\n\n# protobuf\nhttp_archive(\n    name = \"com_google_protobuf\",\n    sha256 = \"8242327e5df8c80ba49e4165250b8f79a76bd11765facefaaecfca7747dc8da2\",\n    strip_prefix = \"protobuf-3.21.5\",\n    urls = [\"https://github.com/protocolbuffers/protobuf/archive/v3.21.5.zip\"],\n)\n\n# googletest\nhttp_archive(\n     name = \"com_google_googletest\",\n     urls = [\"https://github.com/google/googletest/archive/master.zip\"],\n     strip_prefix = \"googletest-master\",\n)\n\n# gflags\nhttp_archive(\n    name = \"com_github_gflags_gflags\",\n    sha256 = \"6e16c8bc91b1310a44f3965e616383dbda48f83e8c1eaa2370a215057b00cabe\",\n    strip_prefix = \"gflags-77592648e3f3be87d6c7123eb81cbad75f9aef5a\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz\",\n        \"https://github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz\",\n    ],\n)\n\n# glog\nhttp_archive(\n    name = \"com_google_glog\",\n    sha256 = \"1ee310e5d0a19b9d584a855000434bb724aa744745d5b8ab1855c85bff8a8e21\",\n    strip_prefix = \"glog-028d37889a1e80e8a07da1b8945ac706259e5fd8\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz\",\n        \"https://github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz\",\n    ],\n)\n\n# absl\nhttp_archive(\n    name = \"com_google_absl\",\n    strip_prefix = \"abseil-cpp-master\",\n    urls = [\"https://github.com/abseil/abseil-cpp/archive/master.zip\"],\n)\n\nload(\"@io_bazel_rules_go//go:deps.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\nload(\"@bazel_gazelle//:deps.bzl\", \"gazelle_dependencies\", \"go_repository\")\nload(\"@com_google_googleapis//:repository_rules.bzl\", \"switched_rules_by_language\")\nload(\"@rules_proto//proto:repositories.bzl\", \"rules_proto_dependencies\", \"rules_proto_toolchains\")\nload(\"@com_google_protobuf//:protobuf_deps.bzl\", \"protobuf_deps\")\n\nswitched_rules_by_language(\n    name = \"com_google_googleapis_imports\",\n    cc = True,\n)\n\n# Do *not* call *_dependencies(), etc, yet.  See comment at the end.\n\n# Generated Google APIs protos for Golang\n# Generated Google APIs protos for Golang 08/26/2024\ngo_repository(\n    name = \"org_golang_google_genproto_googleapis_api\",\n    build_file_proto_mode = \"disable_global\",\n    importpath = \"google.golang.org/genproto/googleapis/api\",\n    sum = \"h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=\",\n    version = \"v0.0.0-20240826202546-f6391c0de4c7\",\n)\n\n# Generated Google APIs protos for Golang 08/26/2024\ngo_repository(\n    name = \"org_golang_google_genproto_googleapis_rpc\",\n    build_file_proto_mode = \"disable_global\",\n    importpath = \"google.golang.org/genproto/googleapis/rpc\",\n    sum = \"h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=\",\n    version = \"v0.0.0-20240826202546-f6391c0de4c7\",\n)\n\n# gRPC deps\ngo_repository(\n    name = \"org_golang_google_grpc\",\n    build_file_proto_mode = \"disable_global\",\n    importpath = \"google.golang.org/grpc\",\n    tag = \"v1.49.0\",\n)\n\ngo_repository(\n    name = \"org_golang_x_net\",\n    importpath = \"golang.org/x/net\",\n    sum = \"h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=\",\n    version = \"v0.0.0-20190311183353-d8887717615a\",\n)\n\ngo_repository(\n    name = \"org_golang_x_text\",\n    importpath = \"golang.org/x/text\",\n    sum = \"h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=\",\n    version = \"v0.3.2\",\n)\n\n# Run the dependencies at the end.  These will silently try to import some\n# of the above repositories but at different versions, so ours must come first.\ngo_rules_dependencies()\ngo_register_toolchains(version = \"1.19.1\")\ngazelle_dependencies()\nrules_proto_dependencies()\nrules_proto_toolchains()\nprotobuf_deps()\n"
  },
  {
    "path": "vendor/cel.dev/expr/WORKSPACE.bzlmod",
    "content": ""
  },
  {
    "path": "vendor/cel.dev/expr/checked.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.21.5\n// source: cel/expr/checked.proto\n\npackage expr\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\temptypb \"google.golang.org/protobuf/types/known/emptypb\"\n\tstructpb \"google.golang.org/protobuf/types/known/structpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Type_PrimitiveType int32\n\nconst (\n\tType_PRIMITIVE_TYPE_UNSPECIFIED Type_PrimitiveType = 0\n\tType_BOOL                       Type_PrimitiveType = 1\n\tType_INT64                      Type_PrimitiveType = 2\n\tType_UINT64                     Type_PrimitiveType = 3\n\tType_DOUBLE                     Type_PrimitiveType = 4\n\tType_STRING                     Type_PrimitiveType = 5\n\tType_BYTES                      Type_PrimitiveType = 6\n)\n\n// Enum value maps for Type_PrimitiveType.\nvar (\n\tType_PrimitiveType_name = map[int32]string{\n\t\t0: \"PRIMITIVE_TYPE_UNSPECIFIED\",\n\t\t1: \"BOOL\",\n\t\t2: \"INT64\",\n\t\t3: \"UINT64\",\n\t\t4: \"DOUBLE\",\n\t\t5: \"STRING\",\n\t\t6: \"BYTES\",\n\t}\n\tType_PrimitiveType_value = map[string]int32{\n\t\t\"PRIMITIVE_TYPE_UNSPECIFIED\": 0,\n\t\t\"BOOL\":                       1,\n\t\t\"INT64\":                      2,\n\t\t\"UINT64\":                     3,\n\t\t\"DOUBLE\":                     4,\n\t\t\"STRING\":                     5,\n\t\t\"BYTES\":                      6,\n\t}\n)\n\nfunc (x Type_PrimitiveType) Enum() *Type_PrimitiveType {\n\tp := new(Type_PrimitiveType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Type_PrimitiveType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Type_PrimitiveType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_cel_expr_checked_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Type_PrimitiveType) Type() protoreflect.EnumType {\n\treturn &file_cel_expr_checked_proto_enumTypes[0]\n}\n\nfunc (x Type_PrimitiveType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Type_PrimitiveType.Descriptor instead.\nfunc (Type_PrimitiveType) EnumDescriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0}\n}\n\ntype Type_WellKnownType int32\n\nconst (\n\tType_WELL_KNOWN_TYPE_UNSPECIFIED Type_WellKnownType = 0\n\tType_ANY                         Type_WellKnownType = 1\n\tType_TIMESTAMP                   Type_WellKnownType = 2\n\tType_DURATION                    Type_WellKnownType = 3\n)\n\n// Enum value maps for Type_WellKnownType.\nvar (\n\tType_WellKnownType_name = map[int32]string{\n\t\t0: \"WELL_KNOWN_TYPE_UNSPECIFIED\",\n\t\t1: \"ANY\",\n\t\t2: \"TIMESTAMP\",\n\t\t3: \"DURATION\",\n\t}\n\tType_WellKnownType_value = map[string]int32{\n\t\t\"WELL_KNOWN_TYPE_UNSPECIFIED\": 0,\n\t\t\"ANY\":                         1,\n\t\t\"TIMESTAMP\":                   2,\n\t\t\"DURATION\":                    3,\n\t}\n)\n\nfunc (x Type_WellKnownType) Enum() *Type_WellKnownType {\n\tp := new(Type_WellKnownType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Type_WellKnownType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Type_WellKnownType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_cel_expr_checked_proto_enumTypes[1].Descriptor()\n}\n\nfunc (Type_WellKnownType) Type() protoreflect.EnumType {\n\treturn &file_cel_expr_checked_proto_enumTypes[1]\n}\n\nfunc (x Type_WellKnownType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Type_WellKnownType.Descriptor instead.\nfunc (Type_WellKnownType) EnumDescriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1}\n}\n\ntype CheckedExpr struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tReferenceMap map[int64]*Reference `protobuf:\"bytes,2,rep,name=reference_map,json=referenceMap,proto3\" json:\"reference_map,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n\tTypeMap      map[int64]*Type      `protobuf:\"bytes,3,rep,name=type_map,json=typeMap,proto3\" json:\"type_map,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n\tSourceInfo   *SourceInfo          `protobuf:\"bytes,5,opt,name=source_info,json=sourceInfo,proto3\" json:\"source_info,omitempty\"`\n\tExprVersion  string               `protobuf:\"bytes,6,opt,name=expr_version,json=exprVersion,proto3\" json:\"expr_version,omitempty\"`\n\tExpr         *Expr                `protobuf:\"bytes,4,opt,name=expr,proto3\" json:\"expr,omitempty\"`\n}\n\nfunc (x *CheckedExpr) Reset() {\n\t*x = CheckedExpr{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *CheckedExpr) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CheckedExpr) ProtoMessage() {}\n\nfunc (x *CheckedExpr) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use CheckedExpr.ProtoReflect.Descriptor instead.\nfunc (*CheckedExpr) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *CheckedExpr) GetReferenceMap() map[int64]*Reference {\n\tif x != nil {\n\t\treturn x.ReferenceMap\n\t}\n\treturn nil\n}\n\nfunc (x *CheckedExpr) GetTypeMap() map[int64]*Type {\n\tif x != nil {\n\t\treturn x.TypeMap\n\t}\n\treturn nil\n}\n\nfunc (x *CheckedExpr) GetSourceInfo() *SourceInfo {\n\tif x != nil {\n\t\treturn x.SourceInfo\n\t}\n\treturn nil\n}\n\nfunc (x *CheckedExpr) GetExprVersion() string {\n\tif x != nil {\n\t\treturn x.ExprVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *CheckedExpr) GetExpr() *Expr {\n\tif x != nil {\n\t\treturn x.Expr\n\t}\n\treturn nil\n}\n\ntype Type struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Types that are assignable to TypeKind:\n\t//\n\t//\t*Type_Dyn\n\t//\t*Type_Null\n\t//\t*Type_Primitive\n\t//\t*Type_Wrapper\n\t//\t*Type_WellKnown\n\t//\t*Type_ListType_\n\t//\t*Type_MapType_\n\t//\t*Type_Function\n\t//\t*Type_MessageType\n\t//\t*Type_TypeParam\n\t//\t*Type_Type\n\t//\t*Type_Error\n\t//\t*Type_AbstractType_\n\tTypeKind isType_TypeKind `protobuf_oneof:\"type_kind\"`\n}\n\nfunc (x *Type) Reset() {\n\t*x = Type{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Type) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Type) ProtoMessage() {}\n\nfunc (x *Type) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Type.ProtoReflect.Descriptor instead.\nfunc (*Type) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (m *Type) GetTypeKind() isType_TypeKind {\n\tif m != nil {\n\t\treturn m.TypeKind\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetDyn() *emptypb.Empty {\n\tif x, ok := x.GetTypeKind().(*Type_Dyn); ok {\n\t\treturn x.Dyn\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetNull() structpb.NullValue {\n\tif x, ok := x.GetTypeKind().(*Type_Null); ok {\n\t\treturn x.Null\n\t}\n\treturn structpb.NullValue(0)\n}\n\nfunc (x *Type) GetPrimitive() Type_PrimitiveType {\n\tif x, ok := x.GetTypeKind().(*Type_Primitive); ok {\n\t\treturn x.Primitive\n\t}\n\treturn Type_PRIMITIVE_TYPE_UNSPECIFIED\n}\n\nfunc (x *Type) GetWrapper() Type_PrimitiveType {\n\tif x, ok := x.GetTypeKind().(*Type_Wrapper); ok {\n\t\treturn x.Wrapper\n\t}\n\treturn Type_PRIMITIVE_TYPE_UNSPECIFIED\n}\n\nfunc (x *Type) GetWellKnown() Type_WellKnownType {\n\tif x, ok := x.GetTypeKind().(*Type_WellKnown); ok {\n\t\treturn x.WellKnown\n\t}\n\treturn Type_WELL_KNOWN_TYPE_UNSPECIFIED\n}\n\nfunc (x *Type) GetListType() *Type_ListType {\n\tif x, ok := x.GetTypeKind().(*Type_ListType_); ok {\n\t\treturn x.ListType\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetMapType() *Type_MapType {\n\tif x, ok := x.GetTypeKind().(*Type_MapType_); ok {\n\t\treturn x.MapType\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetFunction() *Type_FunctionType {\n\tif x, ok := x.GetTypeKind().(*Type_Function); ok {\n\t\treturn x.Function\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetMessageType() string {\n\tif x, ok := x.GetTypeKind().(*Type_MessageType); ok {\n\t\treturn x.MessageType\n\t}\n\treturn \"\"\n}\n\nfunc (x *Type) GetTypeParam() string {\n\tif x, ok := x.GetTypeKind().(*Type_TypeParam); ok {\n\t\treturn x.TypeParam\n\t}\n\treturn \"\"\n}\n\nfunc (x *Type) GetType() *Type {\n\tif x, ok := x.GetTypeKind().(*Type_Type); ok {\n\t\treturn x.Type\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetError() *emptypb.Empty {\n\tif x, ok := x.GetTypeKind().(*Type_Error); ok {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\nfunc (x *Type) GetAbstractType() *Type_AbstractType {\n\tif x, ok := x.GetTypeKind().(*Type_AbstractType_); ok {\n\t\treturn x.AbstractType\n\t}\n\treturn nil\n}\n\ntype isType_TypeKind interface {\n\tisType_TypeKind()\n}\n\ntype Type_Dyn struct {\n\tDyn *emptypb.Empty `protobuf:\"bytes,1,opt,name=dyn,proto3,oneof\"`\n}\n\ntype Type_Null struct {\n\tNull structpb.NullValue `protobuf:\"varint,2,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof\"`\n}\n\ntype Type_Primitive struct {\n\tPrimitive Type_PrimitiveType `protobuf:\"varint,3,opt,name=primitive,proto3,enum=cel.expr.Type_PrimitiveType,oneof\"`\n}\n\ntype Type_Wrapper struct {\n\tWrapper Type_PrimitiveType `protobuf:\"varint,4,opt,name=wrapper,proto3,enum=cel.expr.Type_PrimitiveType,oneof\"`\n}\n\ntype Type_WellKnown struct {\n\tWellKnown Type_WellKnownType `protobuf:\"varint,5,opt,name=well_known,json=wellKnown,proto3,enum=cel.expr.Type_WellKnownType,oneof\"`\n}\n\ntype Type_ListType_ struct {\n\tListType *Type_ListType `protobuf:\"bytes,6,opt,name=list_type,json=listType,proto3,oneof\"`\n}\n\ntype Type_MapType_ struct {\n\tMapType *Type_MapType `protobuf:\"bytes,7,opt,name=map_type,json=mapType,proto3,oneof\"`\n}\n\ntype Type_Function struct {\n\tFunction *Type_FunctionType `protobuf:\"bytes,8,opt,name=function,proto3,oneof\"`\n}\n\ntype Type_MessageType struct {\n\tMessageType string `protobuf:\"bytes,9,opt,name=message_type,json=messageType,proto3,oneof\"`\n}\n\ntype Type_TypeParam struct {\n\tTypeParam string `protobuf:\"bytes,10,opt,name=type_param,json=typeParam,proto3,oneof\"`\n}\n\ntype Type_Type struct {\n\tType *Type `protobuf:\"bytes,11,opt,name=type,proto3,oneof\"`\n}\n\ntype Type_Error struct {\n\tError *emptypb.Empty `protobuf:\"bytes,12,opt,name=error,proto3,oneof\"`\n}\n\ntype Type_AbstractType_ struct {\n\tAbstractType *Type_AbstractType `protobuf:\"bytes,14,opt,name=abstract_type,json=abstractType,proto3,oneof\"`\n}\n\nfunc (*Type_Dyn) isType_TypeKind() {}\n\nfunc (*Type_Null) isType_TypeKind() {}\n\nfunc (*Type_Primitive) isType_TypeKind() {}\n\nfunc (*Type_Wrapper) isType_TypeKind() {}\n\nfunc (*Type_WellKnown) isType_TypeKind() {}\n\nfunc (*Type_ListType_) isType_TypeKind() {}\n\nfunc (*Type_MapType_) isType_TypeKind() {}\n\nfunc (*Type_Function) isType_TypeKind() {}\n\nfunc (*Type_MessageType) isType_TypeKind() {}\n\nfunc (*Type_TypeParam) isType_TypeKind() {}\n\nfunc (*Type_Type) isType_TypeKind() {}\n\nfunc (*Type_Error) isType_TypeKind() {}\n\nfunc (*Type_AbstractType_) isType_TypeKind() {}\n\ntype Decl struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tName string `protobuf:\"bytes,1,opt,name=name,proto3\" json:\"name,omitempty\"`\n\t// Types that are assignable to DeclKind:\n\t//\n\t//\t*Decl_Ident\n\t//\t*Decl_Function\n\tDeclKind isDecl_DeclKind `protobuf_oneof:\"decl_kind\"`\n}\n\nfunc (x *Decl) Reset() {\n\t*x = Decl{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Decl) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Decl) ProtoMessage() {}\n\nfunc (x *Decl) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Decl.ProtoReflect.Descriptor instead.\nfunc (*Decl) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *Decl) GetName() string {\n\tif x != nil {\n\t\treturn x.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *Decl) GetDeclKind() isDecl_DeclKind {\n\tif m != nil {\n\t\treturn m.DeclKind\n\t}\n\treturn nil\n}\n\nfunc (x *Decl) GetIdent() *Decl_IdentDecl {\n\tif x, ok := x.GetDeclKind().(*Decl_Ident); ok {\n\t\treturn x.Ident\n\t}\n\treturn nil\n}\n\nfunc (x *Decl) GetFunction() *Decl_FunctionDecl {\n\tif x, ok := x.GetDeclKind().(*Decl_Function); ok {\n\t\treturn x.Function\n\t}\n\treturn nil\n}\n\ntype isDecl_DeclKind interface {\n\tisDecl_DeclKind()\n}\n\ntype Decl_Ident struct {\n\tIdent *Decl_IdentDecl `protobuf:\"bytes,2,opt,name=ident,proto3,oneof\"`\n}\n\ntype Decl_Function struct {\n\tFunction *Decl_FunctionDecl `protobuf:\"bytes,3,opt,name=function,proto3,oneof\"`\n}\n\nfunc (*Decl_Ident) isDecl_DeclKind() {}\n\nfunc (*Decl_Function) isDecl_DeclKind() {}\n\ntype Reference struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tName       string    `protobuf:\"bytes,1,opt,name=name,proto3\" json:\"name,omitempty\"`\n\tOverloadId []string  `protobuf:\"bytes,3,rep,name=overload_id,json=overloadId,proto3\" json:\"overload_id,omitempty\"`\n\tValue      *Constant `protobuf:\"bytes,4,opt,name=value,proto3\" json:\"value,omitempty\"`\n}\n\nfunc (x *Reference) Reset() {\n\t*x = Reference{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Reference) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Reference) ProtoMessage() {}\n\nfunc (x *Reference) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Reference.ProtoReflect.Descriptor instead.\nfunc (*Reference) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *Reference) GetName() string {\n\tif x != nil {\n\t\treturn x.Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Reference) GetOverloadId() []string {\n\tif x != nil {\n\t\treturn x.OverloadId\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetValue() *Constant {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn nil\n}\n\ntype Type_ListType struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tElemType *Type `protobuf:\"bytes,1,opt,name=elem_type,json=elemType,proto3\" json:\"elem_type,omitempty\"`\n}\n\nfunc (x *Type_ListType) Reset() {\n\t*x = Type_ListType{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[6]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Type_ListType) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Type_ListType) ProtoMessage() {}\n\nfunc (x *Type_ListType) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[6]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Type_ListType.ProtoReflect.Descriptor instead.\nfunc (*Type_ListType) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0}\n}\n\nfunc (x *Type_ListType) GetElemType() *Type {\n\tif x != nil {\n\t\treturn x.ElemType\n\t}\n\treturn nil\n}\n\ntype Type_MapType struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tKeyType   *Type `protobuf:\"bytes,1,opt,name=key_type,json=keyType,proto3\" json:\"key_type,omitempty\"`\n\tValueType *Type `protobuf:\"bytes,2,opt,name=value_type,json=valueType,proto3\" json:\"value_type,omitempty\"`\n}\n\nfunc (x *Type_MapType) Reset() {\n\t*x = Type_MapType{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[7]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Type_MapType) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Type_MapType) ProtoMessage() {}\n\nfunc (x *Type_MapType) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[7]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Type_MapType.ProtoReflect.Descriptor instead.\nfunc (*Type_MapType) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1}\n}\n\nfunc (x *Type_MapType) GetKeyType() *Type {\n\tif x != nil {\n\t\treturn x.KeyType\n\t}\n\treturn nil\n}\n\nfunc (x *Type_MapType) GetValueType() *Type {\n\tif x != nil {\n\t\treturn x.ValueType\n\t}\n\treturn nil\n}\n\ntype Type_FunctionType struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tResultType *Type   `protobuf:\"bytes,1,opt,name=result_type,json=resultType,proto3\" json:\"result_type,omitempty\"`\n\tArgTypes   []*Type `protobuf:\"bytes,2,rep,name=arg_types,json=argTypes,proto3\" json:\"arg_types,omitempty\"`\n}\n\nfunc (x *Type_FunctionType) Reset() {\n\t*x = Type_FunctionType{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[8]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Type_FunctionType) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Type_FunctionType) ProtoMessage() {}\n\nfunc (x *Type_FunctionType) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[8]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Type_FunctionType.ProtoReflect.Descriptor instead.\nfunc (*Type_FunctionType) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 2}\n}\n\nfunc (x *Type_FunctionType) GetResultType() *Type {\n\tif x != nil {\n\t\treturn x.ResultType\n\t}\n\treturn nil\n}\n\nfunc (x *Type_FunctionType) GetArgTypes() []*Type {\n\tif x != nil {\n\t\treturn x.ArgTypes\n\t}\n\treturn nil\n}\n\ntype Type_AbstractType struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tName           string  `protobuf:\"bytes,1,opt,name=name,proto3\" json:\"name,omitempty\"`\n\tParameterTypes []*Type `protobuf:\"bytes,2,rep,name=parameter_types,json=parameterTypes,proto3\" json:\"parameter_types,omitempty\"`\n}\n\nfunc (x *Type_AbstractType) Reset() {\n\t*x = Type_AbstractType{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[9]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Type_AbstractType) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Type_AbstractType) ProtoMessage() {}\n\nfunc (x *Type_AbstractType) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[9]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Type_AbstractType.ProtoReflect.Descriptor instead.\nfunc (*Type_AbstractType) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 3}\n}\n\nfunc (x *Type_AbstractType) GetName() string {\n\tif x != nil {\n\t\treturn x.Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Type_AbstractType) GetParameterTypes() []*Type {\n\tif x != nil {\n\t\treturn x.ParameterTypes\n\t}\n\treturn nil\n}\n\ntype Decl_IdentDecl struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tType  *Type     `protobuf:\"bytes,1,opt,name=type,proto3\" json:\"type,omitempty\"`\n\tValue *Constant `protobuf:\"bytes,2,opt,name=value,proto3\" json:\"value,omitempty\"`\n\tDoc   string    `protobuf:\"bytes,3,opt,name=doc,proto3\" json:\"doc,omitempty\"`\n}\n\nfunc (x *Decl_IdentDecl) Reset() {\n\t*x = Decl_IdentDecl{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[10]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Decl_IdentDecl) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Decl_IdentDecl) ProtoMessage() {}\n\nfunc (x *Decl_IdentDecl) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[10]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Decl_IdentDecl.ProtoReflect.Descriptor instead.\nfunc (*Decl_IdentDecl) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 0}\n}\n\nfunc (x *Decl_IdentDecl) GetType() *Type {\n\tif x != nil {\n\t\treturn x.Type\n\t}\n\treturn nil\n}\n\nfunc (x *Decl_IdentDecl) GetValue() *Constant {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn nil\n}\n\nfunc (x *Decl_IdentDecl) GetDoc() string {\n\tif x != nil {\n\t\treturn x.Doc\n\t}\n\treturn \"\"\n}\n\ntype Decl_FunctionDecl struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tOverloads []*Decl_FunctionDecl_Overload `protobuf:\"bytes,1,rep,name=overloads,proto3\" json:\"overloads,omitempty\"`\n}\n\nfunc (x *Decl_FunctionDecl) Reset() {\n\t*x = Decl_FunctionDecl{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[11]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Decl_FunctionDecl) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Decl_FunctionDecl) ProtoMessage() {}\n\nfunc (x *Decl_FunctionDecl) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[11]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Decl_FunctionDecl.ProtoReflect.Descriptor instead.\nfunc (*Decl_FunctionDecl) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1}\n}\n\nfunc (x *Decl_FunctionDecl) GetOverloads() []*Decl_FunctionDecl_Overload {\n\tif x != nil {\n\t\treturn x.Overloads\n\t}\n\treturn nil\n}\n\ntype Decl_FunctionDecl_Overload struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tOverloadId         string   `protobuf:\"bytes,1,opt,name=overload_id,json=overloadId,proto3\" json:\"overload_id,omitempty\"`\n\tParams             []*Type  `protobuf:\"bytes,2,rep,name=params,proto3\" json:\"params,omitempty\"`\n\tTypeParams         []string `protobuf:\"bytes,3,rep,name=type_params,json=typeParams,proto3\" json:\"type_params,omitempty\"`\n\tResultType         *Type    `protobuf:\"bytes,4,opt,name=result_type,json=resultType,proto3\" json:\"result_type,omitempty\"`\n\tIsInstanceFunction bool     `protobuf:\"varint,5,opt,name=is_instance_function,json=isInstanceFunction,proto3\" json:\"is_instance_function,omitempty\"`\n\tDoc                string   `protobuf:\"bytes,6,opt,name=doc,proto3\" json:\"doc,omitempty\"`\n}\n\nfunc (x *Decl_FunctionDecl_Overload) Reset() {\n\t*x = Decl_FunctionDecl_Overload{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_checked_proto_msgTypes[12]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Decl_FunctionDecl_Overload) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Decl_FunctionDecl_Overload) ProtoMessage() {}\n\nfunc (x *Decl_FunctionDecl_Overload) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_checked_proto_msgTypes[12]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Decl_FunctionDecl_Overload.ProtoReflect.Descriptor instead.\nfunc (*Decl_FunctionDecl_Overload) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1, 0}\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetOverloadId() string {\n\tif x != nil {\n\t\treturn x.OverloadId\n\t}\n\treturn \"\"\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetParams() []*Type {\n\tif x != nil {\n\t\treturn x.Params\n\t}\n\treturn nil\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetTypeParams() []string {\n\tif x != nil {\n\t\treturn x.TypeParams\n\t}\n\treturn nil\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetResultType() *Type {\n\tif x != nil {\n\t\treturn x.ResultType\n\t}\n\treturn nil\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetIsInstanceFunction() bool {\n\tif x != nil {\n\t\treturn x.IsInstanceFunction\n\t}\n\treturn false\n}\n\nfunc (x *Decl_FunctionDecl_Overload) GetDoc() string {\n\tif x != nil {\n\t\treturn x.Doc\n\t}\n\treturn \"\"\n}\n\nvar File_cel_expr_checked_proto protoreflect.FileDescriptor\n\nvar file_cel_expr_checked_proto_rawDesc = []byte{\n\t0x0a, 0x16, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b,\n\t0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78,\n\t0x70, 0x72, 0x1a, 0x15, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x73, 0x79, 0x6e,\n\t0x74, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c,\n\t0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x03, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64,\n\t0x45, 0x78, 0x70, 0x72, 0x12, 0x4c, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,\n\t0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x78,\n\t0x70, 0x72, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x45,\n\t0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x4d,\n\t0x61, 0x70, 0x12, 0x3d, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03,\n\t0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65,\n\t0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x4d, 0x61,\n\t0x70, 0x12, 0x35, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f,\n\t0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x6f,\n\t0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x72,\n\t0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,\n\t0x65, 0x78, 0x70, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x65,\n\t0x78, 0x70, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x1a,\n\t0x54, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x45,\n\t0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,\n\t0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72,\n\t0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4a, 0x0a, 0x0c, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x61, 0x70,\n\t0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,\n\t0x01, 0x22, 0xe6, 0x09, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x03, 0x64, 0x79,\n\t0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48,\n\t0x00, 0x52, 0x03, 0x64, 0x79, 0x6e, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65,\n\t0x48, 0x00, 0x52, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6d,\n\t0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x72, 0x69, 0x6d,\n\t0x69, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x09, 0x70, 0x72, 0x69,\n\t0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,\n\t0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78,\n\t0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76,\n\t0x65, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72,\n\t0x12, 0x3d, 0x0a, 0x0a, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x05,\n\t0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x54, 0x79, 0x70, 0x65, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79,\n\t0x70, 0x65, 0x48, 0x00, 0x52, 0x09, 0x77, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x12,\n\t0x36, 0x0a, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79,\n\t0x70, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6c,\n\t0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x61, 0x70, 0x5f, 0x74,\n\t0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x54, 0x79, 0x70,\n\t0x65, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x08,\n\t0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,\n\t0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x46,\n\t0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x66,\n\t0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,\n\t0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0a,\n\t0x74, 0x79, 0x70, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,\n\t0x48, 0x00, 0x52, 0x09, 0x74, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x24, 0x0a,\n\t0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74,\n\t0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72,\n\t0x72, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f,\n\t0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x41, 0x62, 0x73, 0x74, 0x72,\n\t0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x72,\n\t0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x37, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54,\n\t0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65,\n\t0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65,\n\t0x1a, 0x63, 0x0a, 0x07, 0x4d, 0x61, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6b,\n\t0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,\n\t0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b,\n\t0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,\n\t0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x6c, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,\n\t0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f,\n\t0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x75,\n\t0x6c, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x5f, 0x74, 0x79,\n\t0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x72, 0x67, 0x54, 0x79,\n\t0x70, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x0c, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54,\n\t0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x61, 0x6d,\n\t0x65, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,\n\t0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65,\n\t0x52, 0x0e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73,\n\t0x22, 0x73, 0x0a, 0x0d, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70,\n\t0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x52, 0x49, 0x4d, 0x49, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x54,\n\t0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,\n\t0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49,\n\t0x4e, 0x54, 0x36, 0x34, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34,\n\t0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x0a,\n\t0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x59,\n\t0x54, 0x45, 0x53, 0x10, 0x06, 0x22, 0x56, 0x0a, 0x0d, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f,\n\t0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x57, 0x45, 0x4c, 0x4c, 0x5f, 0x4b,\n\t0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,\n\t0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x01,\n\t0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x12,\n\t0x0c, 0x0a, 0x08, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x42, 0x0b, 0x0a,\n\t0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xc2, 0x04, 0x0a, 0x04, 0x44,\n\t0x65, 0x63, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x69, 0x64, 0x65, 0x6e, 0x74,\n\t0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x63, 0x6c,\n\t0x48, 0x00, 0x52, 0x05, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x66, 0x75, 0x6e,\n\t0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x2e, 0x46, 0x75, 0x6e, 0x63,\n\t0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, 0x6c, 0x48, 0x00, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63,\n\t0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6b, 0x0a, 0x09, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x63,\n\t0x6c, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,\n\t0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,\n\t0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12,\n\t0x10, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x6f,\n\t0x63, 0x1a, 0xbe, 0x02, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65,\n\t0x63, 0x6c, 0x12, 0x42, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18,\n\t0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72,\n\t0x2e, 0x44, 0x65, 0x63, 0x6c, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65,\n\t0x63, 0x6c, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x09, 0x6f, 0x76, 0x65,\n\t0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x6c,\n\t0x6f, 0x61, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x5f,\n\t0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f,\n\t0x61, 0x64, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02,\n\t0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x0b,\n\t0x74, 0x79, 0x70, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,\n\t0x09, 0x52, 0x0a, 0x74, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2f, 0x0a,\n\t0x0b, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79,\n\t0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30,\n\t0x0a, 0x14, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x66, 0x75,\n\t0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x73,\n\t0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,\n\t0x12, 0x10, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64,\n\t0x6f, 0x63, 0x42, 0x0b, 0x0a, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22,\n\t0x6a, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04,\n\t0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,\n\t0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18,\n\t0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x49,\n\t0x64, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73,\n\t0x74, 0x61, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x2c, 0x0a, 0x0c, 0x64,\n\t0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x09, 0x44, 0x65, 0x63,\n\t0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64, 0x65,\n\t0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x33,\n}\n\nvar (\n\tfile_cel_expr_checked_proto_rawDescOnce sync.Once\n\tfile_cel_expr_checked_proto_rawDescData = file_cel_expr_checked_proto_rawDesc\n)\n\nfunc file_cel_expr_checked_proto_rawDescGZIP() []byte {\n\tfile_cel_expr_checked_proto_rawDescOnce.Do(func() {\n\t\tfile_cel_expr_checked_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_checked_proto_rawDescData)\n\t})\n\treturn file_cel_expr_checked_proto_rawDescData\n}\n\nvar file_cel_expr_checked_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_cel_expr_checked_proto_msgTypes = make([]protoimpl.MessageInfo, 13)\nvar file_cel_expr_checked_proto_goTypes = []interface{}{\n\t(Type_PrimitiveType)(0),            // 0: cel.expr.Type.PrimitiveType\n\t(Type_WellKnownType)(0),            // 1: cel.expr.Type.WellKnownType\n\t(*CheckedExpr)(nil),                // 2: cel.expr.CheckedExpr\n\t(*Type)(nil),                       // 3: cel.expr.Type\n\t(*Decl)(nil),                       // 4: cel.expr.Decl\n\t(*Reference)(nil),                  // 5: cel.expr.Reference\n\tnil,                                // 6: cel.expr.CheckedExpr.ReferenceMapEntry\n\tnil,                                // 7: cel.expr.CheckedExpr.TypeMapEntry\n\t(*Type_ListType)(nil),              // 8: cel.expr.Type.ListType\n\t(*Type_MapType)(nil),               // 9: cel.expr.Type.MapType\n\t(*Type_FunctionType)(nil),          // 10: cel.expr.Type.FunctionType\n\t(*Type_AbstractType)(nil),          // 11: cel.expr.Type.AbstractType\n\t(*Decl_IdentDecl)(nil),             // 12: cel.expr.Decl.IdentDecl\n\t(*Decl_FunctionDecl)(nil),          // 13: cel.expr.Decl.FunctionDecl\n\t(*Decl_FunctionDecl_Overload)(nil), // 14: cel.expr.Decl.FunctionDecl.Overload\n\t(*SourceInfo)(nil),                 // 15: cel.expr.SourceInfo\n\t(*Expr)(nil),                       // 16: cel.expr.Expr\n\t(*emptypb.Empty)(nil),              // 17: google.protobuf.Empty\n\t(structpb.NullValue)(0),            // 18: google.protobuf.NullValue\n\t(*Constant)(nil),                   // 19: cel.expr.Constant\n}\nvar file_cel_expr_checked_proto_depIdxs = []int32{\n\t6,  // 0: cel.expr.CheckedExpr.reference_map:type_name -> cel.expr.CheckedExpr.ReferenceMapEntry\n\t7,  // 1: cel.expr.CheckedExpr.type_map:type_name -> cel.expr.CheckedExpr.TypeMapEntry\n\t15, // 2: cel.expr.CheckedExpr.source_info:type_name -> cel.expr.SourceInfo\n\t16, // 3: cel.expr.CheckedExpr.expr:type_name -> cel.expr.Expr\n\t17, // 4: cel.expr.Type.dyn:type_name -> google.protobuf.Empty\n\t18, // 5: cel.expr.Type.null:type_name -> google.protobuf.NullValue\n\t0,  // 6: cel.expr.Type.primitive:type_name -> cel.expr.Type.PrimitiveType\n\t0,  // 7: cel.expr.Type.wrapper:type_name -> cel.expr.Type.PrimitiveType\n\t1,  // 8: cel.expr.Type.well_known:type_name -> cel.expr.Type.WellKnownType\n\t8,  // 9: cel.expr.Type.list_type:type_name -> cel.expr.Type.ListType\n\t9,  // 10: cel.expr.Type.map_type:type_name -> cel.expr.Type.MapType\n\t10, // 11: cel.expr.Type.function:type_name -> cel.expr.Type.FunctionType\n\t3,  // 12: cel.expr.Type.type:type_name -> cel.expr.Type\n\t17, // 13: cel.expr.Type.error:type_name -> google.protobuf.Empty\n\t11, // 14: cel.expr.Type.abstract_type:type_name -> cel.expr.Type.AbstractType\n\t12, // 15: cel.expr.Decl.ident:type_name -> cel.expr.Decl.IdentDecl\n\t13, // 16: cel.expr.Decl.function:type_name -> cel.expr.Decl.FunctionDecl\n\t19, // 17: cel.expr.Reference.value:type_name -> cel.expr.Constant\n\t5,  // 18: cel.expr.CheckedExpr.ReferenceMapEntry.value:type_name -> cel.expr.Reference\n\t3,  // 19: cel.expr.CheckedExpr.TypeMapEntry.value:type_name -> cel.expr.Type\n\t3,  // 20: cel.expr.Type.ListType.elem_type:type_name -> cel.expr.Type\n\t3,  // 21: cel.expr.Type.MapType.key_type:type_name -> cel.expr.Type\n\t3,  // 22: cel.expr.Type.MapType.value_type:type_name -> cel.expr.Type\n\t3,  // 23: cel.expr.Type.FunctionType.result_type:type_name -> cel.expr.Type\n\t3,  // 24: cel.expr.Type.FunctionType.arg_types:type_name -> cel.expr.Type\n\t3,  // 25: cel.expr.Type.AbstractType.parameter_types:type_name -> cel.expr.Type\n\t3,  // 26: cel.expr.Decl.IdentDecl.type:type_name -> cel.expr.Type\n\t19, // 27: cel.expr.Decl.IdentDecl.value:type_name -> cel.expr.Constant\n\t14, // 28: cel.expr.Decl.FunctionDecl.overloads:type_name -> cel.expr.Decl.FunctionDecl.Overload\n\t3,  // 29: cel.expr.Decl.FunctionDecl.Overload.params:type_name -> cel.expr.Type\n\t3,  // 30: cel.expr.Decl.FunctionDecl.Overload.result_type:type_name -> cel.expr.Type\n\t31, // [31:31] is the sub-list for method output_type\n\t31, // [31:31] is the sub-list for method input_type\n\t31, // [31:31] is the sub-list for extension type_name\n\t31, // [31:31] is the sub-list for extension extendee\n\t0,  // [0:31] is the sub-list for field type_name\n}\n\nfunc init() { file_cel_expr_checked_proto_init() }\nfunc file_cel_expr_checked_proto_init() {\n\tif File_cel_expr_checked_proto != nil {\n\t\treturn\n\t}\n\tfile_cel_expr_syntax_proto_init()\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_cel_expr_checked_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*CheckedExpr); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Type); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Decl); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Reference); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Type_ListType); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Type_MapType); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Type_FunctionType); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Type_AbstractType); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Decl_IdentDecl); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Decl_FunctionDecl); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_checked_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Decl_FunctionDecl_Overload); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\tfile_cel_expr_checked_proto_msgTypes[1].OneofWrappers = []interface{}{\n\t\t(*Type_Dyn)(nil),\n\t\t(*Type_Null)(nil),\n\t\t(*Type_Primitive)(nil),\n\t\t(*Type_Wrapper)(nil),\n\t\t(*Type_WellKnown)(nil),\n\t\t(*Type_ListType_)(nil),\n\t\t(*Type_MapType_)(nil),\n\t\t(*Type_Function)(nil),\n\t\t(*Type_MessageType)(nil),\n\t\t(*Type_TypeParam)(nil),\n\t\t(*Type_Type)(nil),\n\t\t(*Type_Error)(nil),\n\t\t(*Type_AbstractType_)(nil),\n\t}\n\tfile_cel_expr_checked_proto_msgTypes[2].OneofWrappers = []interface{}{\n\t\t(*Decl_Ident)(nil),\n\t\t(*Decl_Function)(nil),\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_cel_expr_checked_proto_rawDesc,\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   13,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_cel_expr_checked_proto_goTypes,\n\t\tDependencyIndexes: file_cel_expr_checked_proto_depIdxs,\n\t\tEnumInfos:         file_cel_expr_checked_proto_enumTypes,\n\t\tMessageInfos:      file_cel_expr_checked_proto_msgTypes,\n\t}.Build()\n\tFile_cel_expr_checked_proto = out.File\n\tfile_cel_expr_checked_proto_rawDesc = nil\n\tfile_cel_expr_checked_proto_goTypes = nil\n\tfile_cel_expr_checked_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/cel.dev/expr/cloudbuild.yaml",
    "content": "steps:\n- name: 'gcr.io/cloud-builders/bazel:7.0.1'\n  entrypoint: bazel\n  args: ['build', '...']\n  id: bazel-build\n  waitFor: ['-']\ntimeout: 15m\noptions:\n  machineType: 'N1_HIGHCPU_32'\n"
  },
  {
    "path": "vendor/cel.dev/expr/eval.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.21.5\n// source: cel/expr/eval.proto\n\npackage expr\n\nimport (\n\tstatus \"google.golang.org/genproto/googleapis/rpc/status\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype EvalState struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tValues  []*ExprValue        `protobuf:\"bytes,1,rep,name=values,proto3\" json:\"values,omitempty\"`\n\tResults []*EvalState_Result `protobuf:\"bytes,3,rep,name=results,proto3\" json:\"results,omitempty\"`\n}\n\nfunc (x *EvalState) Reset() {\n\t*x = EvalState{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_eval_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *EvalState) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EvalState) ProtoMessage() {}\n\nfunc (x *EvalState) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_eval_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use EvalState.ProtoReflect.Descriptor instead.\nfunc (*EvalState) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_eval_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *EvalState) GetValues() []*ExprValue {\n\tif x != nil {\n\t\treturn x.Values\n\t}\n\treturn nil\n}\n\nfunc (x *EvalState) GetResults() []*EvalState_Result {\n\tif x != nil {\n\t\treturn x.Results\n\t}\n\treturn nil\n}\n\ntype ExprValue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Types that are assignable to Kind:\n\t//\n\t//\t*ExprValue_Value\n\t//\t*ExprValue_Error\n\t//\t*ExprValue_Unknown\n\tKind isExprValue_Kind `protobuf_oneof:\"kind\"`\n}\n\nfunc (x *ExprValue) Reset() {\n\t*x = ExprValue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_eval_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ExprValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ExprValue) ProtoMessage() {}\n\nfunc (x *ExprValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_eval_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ExprValue.ProtoReflect.Descriptor instead.\nfunc (*ExprValue) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_eval_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (m *ExprValue) GetKind() isExprValue_Kind {\n\tif m != nil {\n\t\treturn m.Kind\n\t}\n\treturn nil\n}\n\nfunc (x *ExprValue) GetValue() *Value {\n\tif x, ok := x.GetKind().(*ExprValue_Value); ok {\n\t\treturn x.Value\n\t}\n\treturn nil\n}\n\nfunc (x *ExprValue) GetError() *ErrorSet {\n\tif x, ok := x.GetKind().(*ExprValue_Error); ok {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\nfunc (x *ExprValue) GetUnknown() *UnknownSet {\n\tif x, ok := x.GetKind().(*ExprValue_Unknown); ok {\n\t\treturn x.Unknown\n\t}\n\treturn nil\n}\n\ntype isExprValue_Kind interface {\n\tisExprValue_Kind()\n}\n\ntype ExprValue_Value struct {\n\tValue *Value `protobuf:\"bytes,1,opt,name=value,proto3,oneof\"`\n}\n\ntype ExprValue_Error struct {\n\tError *ErrorSet `protobuf:\"bytes,2,opt,name=error,proto3,oneof\"`\n}\n\ntype ExprValue_Unknown struct {\n\tUnknown *UnknownSet `protobuf:\"bytes,3,opt,name=unknown,proto3,oneof\"`\n}\n\nfunc (*ExprValue_Value) isExprValue_Kind() {}\n\nfunc (*ExprValue_Error) isExprValue_Kind() {}\n\nfunc (*ExprValue_Unknown) isExprValue_Kind() {}\n\ntype ErrorSet struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tErrors []*status.Status `protobuf:\"bytes,1,rep,name=errors,proto3\" json:\"errors,omitempty\"`\n}\n\nfunc (x *ErrorSet) Reset() {\n\t*x = ErrorSet{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_eval_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ErrorSet) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorSet) ProtoMessage() {}\n\nfunc (x *ErrorSet) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_eval_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ErrorSet.ProtoReflect.Descriptor instead.\nfunc (*ErrorSet) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_eval_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *ErrorSet) GetErrors() []*status.Status {\n\tif x != nil {\n\t\treturn x.Errors\n\t}\n\treturn nil\n}\n\ntype UnknownSet struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tExprs []int64 `protobuf:\"varint,1,rep,packed,name=exprs,proto3\" json:\"exprs,omitempty\"`\n}\n\nfunc (x *UnknownSet) Reset() {\n\t*x = UnknownSet{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_eval_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *UnknownSet) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UnknownSet) ProtoMessage() {}\n\nfunc (x *UnknownSet) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_eval_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use UnknownSet.ProtoReflect.Descriptor instead.\nfunc (*UnknownSet) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_eval_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *UnknownSet) GetExprs() []int64 {\n\tif x != nil {\n\t\treturn x.Exprs\n\t}\n\treturn nil\n}\n\ntype EvalState_Result struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tExpr  int64 `protobuf:\"varint,1,opt,name=expr,proto3\" json:\"expr,omitempty\"`\n\tValue int64 `protobuf:\"varint,2,opt,name=value,proto3\" json:\"value,omitempty\"`\n}\n\nfunc (x *EvalState_Result) Reset() {\n\t*x = EvalState_Result{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_eval_proto_msgTypes[4]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *EvalState_Result) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EvalState_Result) ProtoMessage() {}\n\nfunc (x *EvalState_Result) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_eval_proto_msgTypes[4]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use EvalState_Result.ProtoReflect.Descriptor instead.\nfunc (*EvalState_Result) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_eval_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *EvalState_Result) GetExpr() int64 {\n\tif x != nil {\n\t\treturn x.Expr\n\t}\n\treturn 0\n}\n\nfunc (x *EvalState_Result) GetValue() int64 {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn 0\n}\n\nvar File_cel_expr_eval_proto protoreflect.FileDescriptor\n\nvar file_cel_expr_eval_proto_rawDesc = []byte{\n\t0x0a, 0x13, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x1a,\n\t0x14, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70,\n\t0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2,\n\t0x01, 0x0a, 0x09, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x06,\n\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63,\n\t0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x73,\n\t0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e,\n\t0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a,\n\t0x32, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70,\n\t0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x12, 0x14, 0x0a,\n\t0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61,\n\t0x6c, 0x75, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72,\n\t0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52,\n\t0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77,\n\t0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78,\n\t0x70, 0x72, 0x2e, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52,\n\t0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64,\n\t0x22, 0x36, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x06,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67,\n\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,\n\t0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x22, 0x0a, 0x0a, 0x55, 0x6e, 0x6b, 0x6e,\n\t0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x70, 0x72, 0x73, 0x18,\n\t0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x65, 0x78, 0x70, 0x72, 0x73, 0x42, 0x2c, 0x0a, 0x0c,\n\t0x64, 0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x09, 0x45, 0x76,\n\t0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64,\n\t0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x33,\n}\n\nvar (\n\tfile_cel_expr_eval_proto_rawDescOnce sync.Once\n\tfile_cel_expr_eval_proto_rawDescData = file_cel_expr_eval_proto_rawDesc\n)\n\nfunc file_cel_expr_eval_proto_rawDescGZIP() []byte {\n\tfile_cel_expr_eval_proto_rawDescOnce.Do(func() {\n\t\tfile_cel_expr_eval_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_eval_proto_rawDescData)\n\t})\n\treturn file_cel_expr_eval_proto_rawDescData\n}\n\nvar file_cel_expr_eval_proto_msgTypes = make([]protoimpl.MessageInfo, 5)\nvar file_cel_expr_eval_proto_goTypes = []interface{}{\n\t(*EvalState)(nil),        // 0: cel.expr.EvalState\n\t(*ExprValue)(nil),        // 1: cel.expr.ExprValue\n\t(*ErrorSet)(nil),         // 2: cel.expr.ErrorSet\n\t(*UnknownSet)(nil),       // 3: cel.expr.UnknownSet\n\t(*EvalState_Result)(nil), // 4: cel.expr.EvalState.Result\n\t(*Value)(nil),            // 5: cel.expr.Value\n\t(*status.Status)(nil),    // 6: google.rpc.Status\n}\nvar file_cel_expr_eval_proto_depIdxs = []int32{\n\t1, // 0: cel.expr.EvalState.values:type_name -> cel.expr.ExprValue\n\t4, // 1: cel.expr.EvalState.results:type_name -> cel.expr.EvalState.Result\n\t5, // 2: cel.expr.ExprValue.value:type_name -> cel.expr.Value\n\t2, // 3: cel.expr.ExprValue.error:type_name -> cel.expr.ErrorSet\n\t3, // 4: cel.expr.ExprValue.unknown:type_name -> cel.expr.UnknownSet\n\t6, // 5: cel.expr.ErrorSet.errors:type_name -> google.rpc.Status\n\t6, // [6:6] is the sub-list for method output_type\n\t6, // [6:6] is the sub-list for method input_type\n\t6, // [6:6] is the sub-list for extension type_name\n\t6, // [6:6] is the sub-list for extension extendee\n\t0, // [0:6] is the sub-list for field type_name\n}\n\nfunc init() { file_cel_expr_eval_proto_init() }\nfunc file_cel_expr_eval_proto_init() {\n\tif File_cel_expr_eval_proto != nil {\n\t\treturn\n\t}\n\tfile_cel_expr_value_proto_init()\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_cel_expr_eval_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*EvalState); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_eval_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ExprValue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_eval_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ErrorSet); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_eval_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*UnknownSet); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_eval_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*EvalState_Result); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\tfile_cel_expr_eval_proto_msgTypes[1].OneofWrappers = []interface{}{\n\t\t(*ExprValue_Value)(nil),\n\t\t(*ExprValue_Error)(nil),\n\t\t(*ExprValue_Unknown)(nil),\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_cel_expr_eval_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   5,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_cel_expr_eval_proto_goTypes,\n\t\tDependencyIndexes: file_cel_expr_eval_proto_depIdxs,\n\t\tMessageInfos:      file_cel_expr_eval_proto_msgTypes,\n\t}.Build()\n\tFile_cel_expr_eval_proto = out.File\n\tfile_cel_expr_eval_proto_rawDesc = nil\n\tfile_cel_expr_eval_proto_goTypes = nil\n\tfile_cel_expr_eval_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/cel.dev/expr/explain.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.21.5\n// source: cel/expr/explain.proto\n\npackage expr\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// Deprecated: Do not use.\ntype Explain struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tValues    []*Value            `protobuf:\"bytes,1,rep,name=values,proto3\" json:\"values,omitempty\"`\n\tExprSteps []*Explain_ExprStep `protobuf:\"bytes,2,rep,name=expr_steps,json=exprSteps,proto3\" json:\"expr_steps,omitempty\"`\n}\n\nfunc (x *Explain) Reset() {\n\t*x = Explain{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_explain_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Explain) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Explain) ProtoMessage() {}\n\nfunc (x *Explain) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_explain_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Explain.ProtoReflect.Descriptor instead.\nfunc (*Explain) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_explain_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Explain) GetValues() []*Value {\n\tif x != nil {\n\t\treturn x.Values\n\t}\n\treturn nil\n}\n\nfunc (x *Explain) GetExprSteps() []*Explain_ExprStep {\n\tif x != nil {\n\t\treturn x.ExprSteps\n\t}\n\treturn nil\n}\n\ntype Explain_ExprStep struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tId         int64 `protobuf:\"varint,1,opt,name=id,proto3\" json:\"id,omitempty\"`\n\tValueIndex int32 `protobuf:\"varint,2,opt,name=value_index,json=valueIndex,proto3\" json:\"value_index,omitempty\"`\n}\n\nfunc (x *Explain_ExprStep) Reset() {\n\t*x = Explain_ExprStep{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_explain_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Explain_ExprStep) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Explain_ExprStep) ProtoMessage() {}\n\nfunc (x *Explain_ExprStep) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_explain_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Explain_ExprStep.ProtoReflect.Descriptor instead.\nfunc (*Explain_ExprStep) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_explain_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *Explain_ExprStep) GetId() int64 {\n\tif x != nil {\n\t\treturn x.Id\n\t}\n\treturn 0\n}\n\nfunc (x *Explain_ExprStep) GetValueIndex() int32 {\n\tif x != nil {\n\t\treturn x.ValueIndex\n\t}\n\treturn 0\n}\n\nvar File_cel_expr_explain_proto protoreflect.FileDescriptor\n\nvar file_cel_expr_explain_proto_rawDesc = []byte{\n\t0x0a, 0x16, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x65, 0x78, 0x70, 0x6c, 0x61,\n\t0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78,\n\t0x70, 0x72, 0x1a, 0x14, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c,\n\t0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x07, 0x45, 0x78, 0x70,\n\t0x6c, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01,\n\t0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a,\n\t0x0a, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,\n\t0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70,\n\t0x6c, 0x61, 0x69, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x53, 0x74, 0x65, 0x70, 0x52, 0x09, 0x65,\n\t0x78, 0x70, 0x72, 0x53, 0x74, 0x65, 0x70, 0x73, 0x1a, 0x3b, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x72,\n\t0x53, 0x74, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,\n\t0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x69, 0x6e,\n\t0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x2f, 0x0a, 0x0c, 0x64, 0x65, 0x76,\n\t0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x61,\n\t0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64,\n\t0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x33,\n}\n\nvar (\n\tfile_cel_expr_explain_proto_rawDescOnce sync.Once\n\tfile_cel_expr_explain_proto_rawDescData = file_cel_expr_explain_proto_rawDesc\n)\n\nfunc file_cel_expr_explain_proto_rawDescGZIP() []byte {\n\tfile_cel_expr_explain_proto_rawDescOnce.Do(func() {\n\t\tfile_cel_expr_explain_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_explain_proto_rawDescData)\n\t})\n\treturn file_cel_expr_explain_proto_rawDescData\n}\n\nvar file_cel_expr_explain_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_cel_expr_explain_proto_goTypes = []interface{}{\n\t(*Explain)(nil),          // 0: cel.expr.Explain\n\t(*Explain_ExprStep)(nil), // 1: cel.expr.Explain.ExprStep\n\t(*Value)(nil),            // 2: cel.expr.Value\n}\nvar file_cel_expr_explain_proto_depIdxs = []int32{\n\t2, // 0: cel.expr.Explain.values:type_name -> cel.expr.Value\n\t1, // 1: cel.expr.Explain.expr_steps:type_name -> cel.expr.Explain.ExprStep\n\t2, // [2:2] is the sub-list for method output_type\n\t2, // [2:2] is the sub-list for method input_type\n\t2, // [2:2] is the sub-list for extension type_name\n\t2, // [2:2] is the sub-list for extension extendee\n\t0, // [0:2] is the sub-list for field type_name\n}\n\nfunc init() { file_cel_expr_explain_proto_init() }\nfunc file_cel_expr_explain_proto_init() {\n\tif File_cel_expr_explain_proto != nil {\n\t\treturn\n\t}\n\tfile_cel_expr_value_proto_init()\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_cel_expr_explain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Explain); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_explain_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Explain_ExprStep); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_cel_expr_explain_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_cel_expr_explain_proto_goTypes,\n\t\tDependencyIndexes: file_cel_expr_explain_proto_depIdxs,\n\t\tMessageInfos:      file_cel_expr_explain_proto_msgTypes,\n\t}.Build()\n\tFile_cel_expr_explain_proto = out.File\n\tfile_cel_expr_explain_proto_rawDesc = nil\n\tfile_cel_expr_explain_proto_goTypes = nil\n\tfile_cel_expr_explain_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/cel.dev/expr/regen_go_proto.sh",
    "content": "#!/bin/sh\nbazel build //proto/cel/expr/conformance/...\nfiles=($(bazel aquery 'kind(proto, //proto/cel/expr/conformance/...)' | grep Outputs | grep \"[.]pb[.]go\" | sed 's/Outputs: \\[//' | sed 's/\\]//' | tr \",\" \"\\n\"))\nfor src in ${files[@]};\ndo\n  dst=$(echo $src | sed 's/\\(.*\\/cel.dev\\/expr\\/\\(.*\\)\\)/\\2/')\n  echo \"copying $dst\"\n  $(cp $src $dst)\ndone\n"
  },
  {
    "path": "vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh",
    "content": "#!/usr/bin/env bash\nbazel build //proto/cel/expr:all\n\nrm -vf ./*.pb.go\n\nfiles=( $(bazel cquery //proto/cel/expr:expr_go_proto --output=starlark --starlark:expr=\"'\\n'.join([f.path for f in target.output_groups.go_generated_srcs.to_list()])\") )\nfor src in \"${files[@]}\";\ndo\n  cp -v \"${src}\" ./\ndone\n"
  },
  {
    "path": "vendor/cel.dev/expr/syntax.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.21.5\n// source: cel/expr/syntax.proto\n\npackage expr\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdurationpb \"google.golang.org/protobuf/types/known/durationpb\"\n\tstructpb \"google.golang.org/protobuf/types/known/structpb\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype SourceInfo_Extension_Component int32\n\nconst (\n\tSourceInfo_Extension_COMPONENT_UNSPECIFIED  SourceInfo_Extension_Component = 0\n\tSourceInfo_Extension_COMPONENT_PARSER       SourceInfo_Extension_Component = 1\n\tSourceInfo_Extension_COMPONENT_TYPE_CHECKER SourceInfo_Extension_Component = 2\n\tSourceInfo_Extension_COMPONENT_RUNTIME      SourceInfo_Extension_Component = 3\n)\n\n// Enum value maps for SourceInfo_Extension_Component.\nvar (\n\tSourceInfo_Extension_Component_name = map[int32]string{\n\t\t0: \"COMPONENT_UNSPECIFIED\",\n\t\t1: \"COMPONENT_PARSER\",\n\t\t2: \"COMPONENT_TYPE_CHECKER\",\n\t\t3: \"COMPONENT_RUNTIME\",\n\t}\n\tSourceInfo_Extension_Component_value = map[string]int32{\n\t\t\"COMPONENT_UNSPECIFIED\":  0,\n\t\t\"COMPONENT_PARSER\":       1,\n\t\t\"COMPONENT_TYPE_CHECKER\": 2,\n\t\t\"COMPONENT_RUNTIME\":      3,\n\t}\n)\n\nfunc (x SourceInfo_Extension_Component) Enum() *SourceInfo_Extension_Component {\n\tp := new(SourceInfo_Extension_Component)\n\t*p = x\n\treturn p\n}\n\nfunc (x SourceInfo_Extension_Component) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (SourceInfo_Extension_Component) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_cel_expr_syntax_proto_enumTypes[0].Descriptor()\n}\n\nfunc (SourceInfo_Extension_Component) Type() protoreflect.EnumType {\n\treturn &file_cel_expr_syntax_proto_enumTypes[0]\n}\n\nfunc (x SourceInfo_Extension_Component) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use SourceInfo_Extension_Component.Descriptor instead.\nfunc (SourceInfo_Extension_Component) EnumDescriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0}\n}\n\ntype ParsedExpr struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tExpr       *Expr       `protobuf:\"bytes,2,opt,name=expr,proto3\" json:\"expr,omitempty\"`\n\tSourceInfo *SourceInfo `protobuf:\"bytes,3,opt,name=source_info,json=sourceInfo,proto3\" json:\"source_info,omitempty\"`\n}\n\nfunc (x *ParsedExpr) Reset() {\n\t*x = ParsedExpr{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ParsedExpr) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ParsedExpr) ProtoMessage() {}\n\nfunc (x *ParsedExpr) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ParsedExpr.ProtoReflect.Descriptor instead.\nfunc (*ParsedExpr) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *ParsedExpr) GetExpr() *Expr {\n\tif x != nil {\n\t\treturn x.Expr\n\t}\n\treturn nil\n}\n\nfunc (x *ParsedExpr) GetSourceInfo() *SourceInfo {\n\tif x != nil {\n\t\treturn x.SourceInfo\n\t}\n\treturn nil\n}\n\ntype Expr struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tId int64 `protobuf:\"varint,2,opt,name=id,proto3\" json:\"id,omitempty\"`\n\t// Types that are assignable to ExprKind:\n\t//\n\t//\t*Expr_ConstExpr\n\t//\t*Expr_IdentExpr\n\t//\t*Expr_SelectExpr\n\t//\t*Expr_CallExpr\n\t//\t*Expr_ListExpr\n\t//\t*Expr_StructExpr\n\t//\t*Expr_ComprehensionExpr\n\tExprKind isExpr_ExprKind `protobuf_oneof:\"expr_kind\"`\n}\n\nfunc (x *Expr) Reset() {\n\t*x = Expr{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr) ProtoMessage() {}\n\nfunc (x *Expr) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr.ProtoReflect.Descriptor instead.\nfunc (*Expr) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *Expr) GetId() int64 {\n\tif x != nil {\n\t\treturn x.Id\n\t}\n\treturn 0\n}\n\nfunc (m *Expr) GetExprKind() isExpr_ExprKind {\n\tif m != nil {\n\t\treturn m.ExprKind\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetConstExpr() *Constant {\n\tif x, ok := x.GetExprKind().(*Expr_ConstExpr); ok {\n\t\treturn x.ConstExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetIdentExpr() *Expr_Ident {\n\tif x, ok := x.GetExprKind().(*Expr_IdentExpr); ok {\n\t\treturn x.IdentExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetSelectExpr() *Expr_Select {\n\tif x, ok := x.GetExprKind().(*Expr_SelectExpr); ok {\n\t\treturn x.SelectExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetCallExpr() *Expr_Call {\n\tif x, ok := x.GetExprKind().(*Expr_CallExpr); ok {\n\t\treturn x.CallExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetListExpr() *Expr_CreateList {\n\tif x, ok := x.GetExprKind().(*Expr_ListExpr); ok {\n\t\treturn x.ListExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetStructExpr() *Expr_CreateStruct {\n\tif x, ok := x.GetExprKind().(*Expr_StructExpr); ok {\n\t\treturn x.StructExpr\n\t}\n\treturn nil\n}\n\nfunc (x *Expr) GetComprehensionExpr() *Expr_Comprehension {\n\tif x, ok := x.GetExprKind().(*Expr_ComprehensionExpr); ok {\n\t\treturn x.ComprehensionExpr\n\t}\n\treturn nil\n}\n\ntype isExpr_ExprKind interface {\n\tisExpr_ExprKind()\n}\n\ntype Expr_ConstExpr struct {\n\tConstExpr *Constant `protobuf:\"bytes,3,opt,name=const_expr,json=constExpr,proto3,oneof\"`\n}\n\ntype Expr_IdentExpr struct {\n\tIdentExpr *Expr_Ident `protobuf:\"bytes,4,opt,name=ident_expr,json=identExpr,proto3,oneof\"`\n}\n\ntype Expr_SelectExpr struct {\n\tSelectExpr *Expr_Select `protobuf:\"bytes,5,opt,name=select_expr,json=selectExpr,proto3,oneof\"`\n}\n\ntype Expr_CallExpr struct {\n\tCallExpr *Expr_Call `protobuf:\"bytes,6,opt,name=call_expr,json=callExpr,proto3,oneof\"`\n}\n\ntype Expr_ListExpr struct {\n\tListExpr *Expr_CreateList `protobuf:\"bytes,7,opt,name=list_expr,json=listExpr,proto3,oneof\"`\n}\n\ntype Expr_StructExpr struct {\n\tStructExpr *Expr_CreateStruct `protobuf:\"bytes,8,opt,name=struct_expr,json=structExpr,proto3,oneof\"`\n}\n\ntype Expr_ComprehensionExpr struct {\n\tComprehensionExpr *Expr_Comprehension `protobuf:\"bytes,9,opt,name=comprehension_expr,json=comprehensionExpr,proto3,oneof\"`\n}\n\nfunc (*Expr_ConstExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_IdentExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_SelectExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_CallExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_ListExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_StructExpr) isExpr_ExprKind() {}\n\nfunc (*Expr_ComprehensionExpr) isExpr_ExprKind() {}\n\ntype Constant struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Types that are assignable to ConstantKind:\n\t//\n\t//\t*Constant_NullValue\n\t//\t*Constant_BoolValue\n\t//\t*Constant_Int64Value\n\t//\t*Constant_Uint64Value\n\t//\t*Constant_DoubleValue\n\t//\t*Constant_StringValue\n\t//\t*Constant_BytesValue\n\t//\t*Constant_DurationValue\n\t//\t*Constant_TimestampValue\n\tConstantKind isConstant_ConstantKind `protobuf_oneof:\"constant_kind\"`\n}\n\nfunc (x *Constant) Reset() {\n\t*x = Constant{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Constant) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Constant) ProtoMessage() {}\n\nfunc (x *Constant) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Constant.ProtoReflect.Descriptor instead.\nfunc (*Constant) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (m *Constant) GetConstantKind() isConstant_ConstantKind {\n\tif m != nil {\n\t\treturn m.ConstantKind\n\t}\n\treturn nil\n}\n\nfunc (x *Constant) GetNullValue() structpb.NullValue {\n\tif x, ok := x.GetConstantKind().(*Constant_NullValue); ok {\n\t\treturn x.NullValue\n\t}\n\treturn structpb.NullValue(0)\n}\n\nfunc (x *Constant) GetBoolValue() bool {\n\tif x, ok := x.GetConstantKind().(*Constant_BoolValue); ok {\n\t\treturn x.BoolValue\n\t}\n\treturn false\n}\n\nfunc (x *Constant) GetInt64Value() int64 {\n\tif x, ok := x.GetConstantKind().(*Constant_Int64Value); ok {\n\t\treturn x.Int64Value\n\t}\n\treturn 0\n}\n\nfunc (x *Constant) GetUint64Value() uint64 {\n\tif x, ok := x.GetConstantKind().(*Constant_Uint64Value); ok {\n\t\treturn x.Uint64Value\n\t}\n\treturn 0\n}\n\nfunc (x *Constant) GetDoubleValue() float64 {\n\tif x, ok := x.GetConstantKind().(*Constant_DoubleValue); ok {\n\t\treturn x.DoubleValue\n\t}\n\treturn 0\n}\n\nfunc (x *Constant) GetStringValue() string {\n\tif x, ok := x.GetConstantKind().(*Constant_StringValue); ok {\n\t\treturn x.StringValue\n\t}\n\treturn \"\"\n}\n\nfunc (x *Constant) GetBytesValue() []byte {\n\tif x, ok := x.GetConstantKind().(*Constant_BytesValue); ok {\n\t\treturn x.BytesValue\n\t}\n\treturn nil\n}\n\n// Deprecated: Do not use.\nfunc (x *Constant) GetDurationValue() *durationpb.Duration {\n\tif x, ok := x.GetConstantKind().(*Constant_DurationValue); ok {\n\t\treturn x.DurationValue\n\t}\n\treturn nil\n}\n\n// Deprecated: Do not use.\nfunc (x *Constant) GetTimestampValue() *timestamppb.Timestamp {\n\tif x, ok := x.GetConstantKind().(*Constant_TimestampValue); ok {\n\t\treturn x.TimestampValue\n\t}\n\treturn nil\n}\n\ntype isConstant_ConstantKind interface {\n\tisConstant_ConstantKind()\n}\n\ntype Constant_NullValue struct {\n\tNullValue structpb.NullValue `protobuf:\"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof\"`\n}\n\ntype Constant_BoolValue struct {\n\tBoolValue bool `protobuf:\"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof\"`\n}\n\ntype Constant_Int64Value struct {\n\tInt64Value int64 `protobuf:\"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof\"`\n}\n\ntype Constant_Uint64Value struct {\n\tUint64Value uint64 `protobuf:\"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof\"`\n}\n\ntype Constant_DoubleValue struct {\n\tDoubleValue float64 `protobuf:\"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof\"`\n}\n\ntype Constant_StringValue struct {\n\tStringValue string `protobuf:\"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof\"`\n}\n\ntype Constant_BytesValue struct {\n\tBytesValue []byte `protobuf:\"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof\"`\n}\n\ntype Constant_DurationValue struct {\n\t// Deprecated: Do not use.\n\tDurationValue *durationpb.Duration `protobuf:\"bytes,8,opt,name=duration_value,json=durationValue,proto3,oneof\"`\n}\n\ntype Constant_TimestampValue struct {\n\t// Deprecated: Do not use.\n\tTimestampValue *timestamppb.Timestamp `protobuf:\"bytes,9,opt,name=timestamp_value,json=timestampValue,proto3,oneof\"`\n}\n\nfunc (*Constant_NullValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_BoolValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_Int64Value) isConstant_ConstantKind() {}\n\nfunc (*Constant_Uint64Value) isConstant_ConstantKind() {}\n\nfunc (*Constant_DoubleValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_StringValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_BytesValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_DurationValue) isConstant_ConstantKind() {}\n\nfunc (*Constant_TimestampValue) isConstant_ConstantKind() {}\n\ntype SourceInfo struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tSyntaxVersion string                  `protobuf:\"bytes,1,opt,name=syntax_version,json=syntaxVersion,proto3\" json:\"syntax_version,omitempty\"`\n\tLocation      string                  `protobuf:\"bytes,2,opt,name=location,proto3\" json:\"location,omitempty\"`\n\tLineOffsets   []int32                 `protobuf:\"varint,3,rep,packed,name=line_offsets,json=lineOffsets,proto3\" json:\"line_offsets,omitempty\"`\n\tPositions     map[int64]int32         `protobuf:\"bytes,4,rep,name=positions,proto3\" json:\"positions,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"varint,2,opt,name=value,proto3\"`\n\tMacroCalls    map[int64]*Expr         `protobuf:\"bytes,5,rep,name=macro_calls,json=macroCalls,proto3\" json:\"macro_calls,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n\tExtensions    []*SourceInfo_Extension `protobuf:\"bytes,6,rep,name=extensions,proto3\" json:\"extensions,omitempty\"`\n}\n\nfunc (x *SourceInfo) Reset() {\n\t*x = SourceInfo{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *SourceInfo) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SourceInfo) ProtoMessage() {}\n\nfunc (x *SourceInfo) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use SourceInfo.ProtoReflect.Descriptor instead.\nfunc (*SourceInfo) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *SourceInfo) GetSyntaxVersion() string {\n\tif x != nil {\n\t\treturn x.SyntaxVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *SourceInfo) GetLocation() string {\n\tif x != nil {\n\t\treturn x.Location\n\t}\n\treturn \"\"\n}\n\nfunc (x *SourceInfo) GetLineOffsets() []int32 {\n\tif x != nil {\n\t\treturn x.LineOffsets\n\t}\n\treturn nil\n}\n\nfunc (x *SourceInfo) GetPositions() map[int64]int32 {\n\tif x != nil {\n\t\treturn x.Positions\n\t}\n\treturn nil\n}\n\nfunc (x *SourceInfo) GetMacroCalls() map[int64]*Expr {\n\tif x != nil {\n\t\treturn x.MacroCalls\n\t}\n\treturn nil\n}\n\nfunc (x *SourceInfo) GetExtensions() []*SourceInfo_Extension {\n\tif x != nil {\n\t\treturn x.Extensions\n\t}\n\treturn nil\n}\n\ntype Expr_Ident struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tName string `protobuf:\"bytes,1,opt,name=name,proto3\" json:\"name,omitempty\"`\n}\n\nfunc (x *Expr_Ident) Reset() {\n\t*x = Expr_Ident{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[4]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_Ident) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_Ident) ProtoMessage() {}\n\nfunc (x *Expr_Ident) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[4]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_Ident.ProtoReflect.Descriptor instead.\nfunc (*Expr_Ident) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 0}\n}\n\nfunc (x *Expr_Ident) GetName() string {\n\tif x != nil {\n\t\treturn x.Name\n\t}\n\treturn \"\"\n}\n\ntype Expr_Select struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tOperand  *Expr  `protobuf:\"bytes,1,opt,name=operand,proto3\" json:\"operand,omitempty\"`\n\tField    string `protobuf:\"bytes,2,opt,name=field,proto3\" json:\"field,omitempty\"`\n\tTestOnly bool   `protobuf:\"varint,3,opt,name=test_only,json=testOnly,proto3\" json:\"test_only,omitempty\"`\n}\n\nfunc (x *Expr_Select) Reset() {\n\t*x = Expr_Select{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[5]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_Select) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_Select) ProtoMessage() {}\n\nfunc (x *Expr_Select) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[5]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_Select.ProtoReflect.Descriptor instead.\nfunc (*Expr_Select) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 1}\n}\n\nfunc (x *Expr_Select) GetOperand() *Expr {\n\tif x != nil {\n\t\treturn x.Operand\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Select) GetField() string {\n\tif x != nil {\n\t\treturn x.Field\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_Select) GetTestOnly() bool {\n\tif x != nil {\n\t\treturn x.TestOnly\n\t}\n\treturn false\n}\n\ntype Expr_Call struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tTarget   *Expr   `protobuf:\"bytes,1,opt,name=target,proto3\" json:\"target,omitempty\"`\n\tFunction string  `protobuf:\"bytes,2,opt,name=function,proto3\" json:\"function,omitempty\"`\n\tArgs     []*Expr `protobuf:\"bytes,3,rep,name=args,proto3\" json:\"args,omitempty\"`\n}\n\nfunc (x *Expr_Call) Reset() {\n\t*x = Expr_Call{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[6]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_Call) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_Call) ProtoMessage() {}\n\nfunc (x *Expr_Call) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[6]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_Call.ProtoReflect.Descriptor instead.\nfunc (*Expr_Call) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 2}\n}\n\nfunc (x *Expr_Call) GetTarget() *Expr {\n\tif x != nil {\n\t\treturn x.Target\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Call) GetFunction() string {\n\tif x != nil {\n\t\treturn x.Function\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_Call) GetArgs() []*Expr {\n\tif x != nil {\n\t\treturn x.Args\n\t}\n\treturn nil\n}\n\ntype Expr_CreateList struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tElements        []*Expr `protobuf:\"bytes,1,rep,name=elements,proto3\" json:\"elements,omitempty\"`\n\tOptionalIndices []int32 `protobuf:\"varint,2,rep,packed,name=optional_indices,json=optionalIndices,proto3\" json:\"optional_indices,omitempty\"`\n}\n\nfunc (x *Expr_CreateList) Reset() {\n\t*x = Expr_CreateList{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[7]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_CreateList) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_CreateList) ProtoMessage() {}\n\nfunc (x *Expr_CreateList) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[7]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_CreateList.ProtoReflect.Descriptor instead.\nfunc (*Expr_CreateList) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 3}\n}\n\nfunc (x *Expr_CreateList) GetElements() []*Expr {\n\tif x != nil {\n\t\treturn x.Elements\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_CreateList) GetOptionalIndices() []int32 {\n\tif x != nil {\n\t\treturn x.OptionalIndices\n\t}\n\treturn nil\n}\n\ntype Expr_CreateStruct struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tMessageName string                     `protobuf:\"bytes,1,opt,name=message_name,json=messageName,proto3\" json:\"message_name,omitempty\"`\n\tEntries     []*Expr_CreateStruct_Entry `protobuf:\"bytes,2,rep,name=entries,proto3\" json:\"entries,omitempty\"`\n}\n\nfunc (x *Expr_CreateStruct) Reset() {\n\t*x = Expr_CreateStruct{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[8]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_CreateStruct) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_CreateStruct) ProtoMessage() {}\n\nfunc (x *Expr_CreateStruct) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[8]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_CreateStruct.ProtoReflect.Descriptor instead.\nfunc (*Expr_CreateStruct) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4}\n}\n\nfunc (x *Expr_CreateStruct) GetMessageName() string {\n\tif x != nil {\n\t\treturn x.MessageName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry {\n\tif x != nil {\n\t\treturn x.Entries\n\t}\n\treturn nil\n}\n\ntype Expr_Comprehension struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tIterVar       string `protobuf:\"bytes,1,opt,name=iter_var,json=iterVar,proto3\" json:\"iter_var,omitempty\"`\n\tIterRange     *Expr  `protobuf:\"bytes,2,opt,name=iter_range,json=iterRange,proto3\" json:\"iter_range,omitempty\"`\n\tAccuVar       string `protobuf:\"bytes,3,opt,name=accu_var,json=accuVar,proto3\" json:\"accu_var,omitempty\"`\n\tAccuInit      *Expr  `protobuf:\"bytes,4,opt,name=accu_init,json=accuInit,proto3\" json:\"accu_init,omitempty\"`\n\tLoopCondition *Expr  `protobuf:\"bytes,5,opt,name=loop_condition,json=loopCondition,proto3\" json:\"loop_condition,omitempty\"`\n\tLoopStep      *Expr  `protobuf:\"bytes,6,opt,name=loop_step,json=loopStep,proto3\" json:\"loop_step,omitempty\"`\n\tResult        *Expr  `protobuf:\"bytes,7,opt,name=result,proto3\" json:\"result,omitempty\"`\n}\n\nfunc (x *Expr_Comprehension) Reset() {\n\t*x = Expr_Comprehension{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[9]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_Comprehension) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_Comprehension) ProtoMessage() {}\n\nfunc (x *Expr_Comprehension) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[9]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_Comprehension.ProtoReflect.Descriptor instead.\nfunc (*Expr_Comprehension) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 5}\n}\n\nfunc (x *Expr_Comprehension) GetIterVar() string {\n\tif x != nil {\n\t\treturn x.IterVar\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_Comprehension) GetIterRange() *Expr {\n\tif x != nil {\n\t\treturn x.IterRange\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Comprehension) GetAccuVar() string {\n\tif x != nil {\n\t\treturn x.AccuVar\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_Comprehension) GetAccuInit() *Expr {\n\tif x != nil {\n\t\treturn x.AccuInit\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Comprehension) GetLoopCondition() *Expr {\n\tif x != nil {\n\t\treturn x.LoopCondition\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Comprehension) GetLoopStep() *Expr {\n\tif x != nil {\n\t\treturn x.LoopStep\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_Comprehension) GetResult() *Expr {\n\tif x != nil {\n\t\treturn x.Result\n\t}\n\treturn nil\n}\n\ntype Expr_CreateStruct_Entry struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tId int64 `protobuf:\"varint,1,opt,name=id,proto3\" json:\"id,omitempty\"`\n\t// Types that are assignable to KeyKind:\n\t//\n\t//\t*Expr_CreateStruct_Entry_FieldKey\n\t//\t*Expr_CreateStruct_Entry_MapKey\n\tKeyKind       isExpr_CreateStruct_Entry_KeyKind `protobuf_oneof:\"key_kind\"`\n\tValue         *Expr                             `protobuf:\"bytes,4,opt,name=value,proto3\" json:\"value,omitempty\"`\n\tOptionalEntry bool                              `protobuf:\"varint,5,opt,name=optional_entry,json=optionalEntry,proto3\" json:\"optional_entry,omitempty\"`\n}\n\nfunc (x *Expr_CreateStruct_Entry) Reset() {\n\t*x = Expr_CreateStruct_Entry{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[10]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Expr_CreateStruct_Entry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Expr_CreateStruct_Entry) ProtoMessage() {}\n\nfunc (x *Expr_CreateStruct_Entry) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[10]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Expr_CreateStruct_Entry.ProtoReflect.Descriptor instead.\nfunc (*Expr_CreateStruct_Entry) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4, 0}\n}\n\nfunc (x *Expr_CreateStruct_Entry) GetId() int64 {\n\tif x != nil {\n\t\treturn x.Id\n\t}\n\treturn 0\n}\n\nfunc (m *Expr_CreateStruct_Entry) GetKeyKind() isExpr_CreateStruct_Entry_KeyKind {\n\tif m != nil {\n\t\treturn m.KeyKind\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_CreateStruct_Entry) GetFieldKey() string {\n\tif x, ok := x.GetKeyKind().(*Expr_CreateStruct_Entry_FieldKey); ok {\n\t\treturn x.FieldKey\n\t}\n\treturn \"\"\n}\n\nfunc (x *Expr_CreateStruct_Entry) GetMapKey() *Expr {\n\tif x, ok := x.GetKeyKind().(*Expr_CreateStruct_Entry_MapKey); ok {\n\t\treturn x.MapKey\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_CreateStruct_Entry) GetValue() *Expr {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn nil\n}\n\nfunc (x *Expr_CreateStruct_Entry) GetOptionalEntry() bool {\n\tif x != nil {\n\t\treturn x.OptionalEntry\n\t}\n\treturn false\n}\n\ntype isExpr_CreateStruct_Entry_KeyKind interface {\n\tisExpr_CreateStruct_Entry_KeyKind()\n}\n\ntype Expr_CreateStruct_Entry_FieldKey struct {\n\tFieldKey string `protobuf:\"bytes,2,opt,name=field_key,json=fieldKey,proto3,oneof\"`\n}\n\ntype Expr_CreateStruct_Entry_MapKey struct {\n\tMapKey *Expr `protobuf:\"bytes,3,opt,name=map_key,json=mapKey,proto3,oneof\"`\n}\n\nfunc (*Expr_CreateStruct_Entry_FieldKey) isExpr_CreateStruct_Entry_KeyKind() {}\n\nfunc (*Expr_CreateStruct_Entry_MapKey) isExpr_CreateStruct_Entry_KeyKind() {}\n\ntype SourceInfo_Extension struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tId                 string                           `protobuf:\"bytes,1,opt,name=id,proto3\" json:\"id,omitempty\"`\n\tAffectedComponents []SourceInfo_Extension_Component `protobuf:\"varint,2,rep,packed,name=affected_components,json=affectedComponents,proto3,enum=cel.expr.SourceInfo_Extension_Component\" json:\"affected_components,omitempty\"`\n\tVersion            *SourceInfo_Extension_Version    `protobuf:\"bytes,3,opt,name=version,proto3\" json:\"version,omitempty\"`\n}\n\nfunc (x *SourceInfo_Extension) Reset() {\n\t*x = SourceInfo_Extension{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[13]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *SourceInfo_Extension) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SourceInfo_Extension) ProtoMessage() {}\n\nfunc (x *SourceInfo_Extension) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[13]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use SourceInfo_Extension.ProtoReflect.Descriptor instead.\nfunc (*SourceInfo_Extension) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2}\n}\n\nfunc (x *SourceInfo_Extension) GetId() string {\n\tif x != nil {\n\t\treturn x.Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *SourceInfo_Extension) GetAffectedComponents() []SourceInfo_Extension_Component {\n\tif x != nil {\n\t\treturn x.AffectedComponents\n\t}\n\treturn nil\n}\n\nfunc (x *SourceInfo_Extension) GetVersion() *SourceInfo_Extension_Version {\n\tif x != nil {\n\t\treturn x.Version\n\t}\n\treturn nil\n}\n\ntype SourceInfo_Extension_Version struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tMajor int64 `protobuf:\"varint,1,opt,name=major,proto3\" json:\"major,omitempty\"`\n\tMinor int64 `protobuf:\"varint,2,opt,name=minor,proto3\" json:\"minor,omitempty\"`\n}\n\nfunc (x *SourceInfo_Extension_Version) Reset() {\n\t*x = SourceInfo_Extension_Version{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_syntax_proto_msgTypes[14]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *SourceInfo_Extension_Version) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SourceInfo_Extension_Version) ProtoMessage() {}\n\nfunc (x *SourceInfo_Extension_Version) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_syntax_proto_msgTypes[14]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use SourceInfo_Extension_Version.ProtoReflect.Descriptor instead.\nfunc (*SourceInfo_Extension_Version) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0}\n}\n\nfunc (x *SourceInfo_Extension_Version) GetMajor() int64 {\n\tif x != nil {\n\t\treturn x.Major\n\t}\n\treturn 0\n}\n\nfunc (x *SourceInfo_Extension_Version) GetMinor() int64 {\n\tif x != nil {\n\t\treturn x.Minor\n\t}\n\treturn 0\n}\n\nvar File_cel_expr_syntax_proto protoreflect.FileDescriptor\n\nvar file_cel_expr_syntax_proto_rawDesc = []byte{\n\t0x0a, 0x15, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61,\n\t0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,\n\t0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x22, 0x67, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x12, 0x22,\n\t0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63,\n\t0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x65, 0x78,\n\t0x70, 0x72, 0x12, 0x35, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66,\n\t0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78,\n\t0x70, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73,\n\t0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xfd, 0x0a, 0x0a, 0x04, 0x45, 0x78,\n\t0x70, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,\n\t0x69, 0x64, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72,\n\t0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f,\n\t0x6e, 0x73, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74,\n\t0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x2e, 0x49, 0x64, 0x65, 0x6e,\n\t0x74, 0x48, 0x00, 0x52, 0x09, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x38,\n\t0x0a, 0x0b, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x05, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45,\n\t0x78, 0x70, 0x72, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65,\n\t0x6c, 0x65, 0x63, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c,\n\t0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x2e, 0x43, 0x61, 0x6c, 0x6c,\n\t0x48, 0x00, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x12, 0x38, 0x0a, 0x09,\n\t0x6c, 0x69, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,\n\t0x19, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x2e,\n\t0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x69,\n\t0x73, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,\n\t0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x65,\n\t0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61,\n\t0x74, 0x65, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x75,\n\t0x63, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65,\n\t0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x09, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78,\n\t0x70, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t0x48, 0x00, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f,\n\t0x6e, 0x45, 0x78, 0x70, 0x72, 0x1a, 0x1b, 0x0a, 0x05, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x12,\n\t0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,\n\t0x6d, 0x65, 0x1a, 0x65, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x28, 0x0a, 0x07,\n\t0x6f, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,\n\t0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x07, 0x6f,\n\t0x70, 0x65, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18,\n\t0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1b, 0x0a, 0x09,\n\t0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,\n\t0x08, 0x74, 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x1a, 0x6e, 0x0a, 0x04, 0x43, 0x61, 0x6c,\n\t0x6c, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70,\n\t0x72, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e,\n\t0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e,\n\t0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45,\n\t0x78, 0x70, 0x72, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x1a, 0x63, 0x0a, 0x0a, 0x43, 0x72, 0x65,\n\t0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65,\n\t0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65,\n\t0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,\n\t0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x6f,\n\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0xab,\n\t0x02, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12,\n\t0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x61,\n\t0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45,\n\t0x78, 0x70, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,\n\t0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x1a,\n\t0xba, 0x01, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x09, 0x66, 0x69, 0x65,\n\t0x6c, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08,\n\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x5f,\n\t0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e,\n\t0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x61, 0x70,\n\t0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78,\n\t0x70, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x74,\n\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,\n\t0x08, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79,\n\t0x42, 0x0a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x1a, 0xad, 0x02, 0x0a,\n\t0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19,\n\t0x0a, 0x08, 0x69, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x07, 0x69, 0x74, 0x65, 0x72, 0x56, 0x61, 0x72, 0x12, 0x2d, 0x0a, 0x0a, 0x69, 0x74, 0x65,\n\t0x72, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,\n\t0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x69,\n\t0x74, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x75,\n\t0x5f, 0x76, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x75,\n\t0x56, 0x61, 0x72, 0x12, 0x2b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x75, 0x5f, 0x69, 0x6e, 0x69, 0x74,\n\t0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70,\n\t0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x61, 0x63, 0x63, 0x75, 0x49, 0x6e, 0x69, 0x74,\n\t0x12, 0x35, 0x0a, 0x0e, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,\n\t0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65,\n\t0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0d, 0x6c, 0x6f, 0x6f, 0x70, 0x43, 0x6f,\n\t0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x09, 0x6c, 0x6f, 0x6f, 0x70, 0x5f,\n\t0x73, 0x74, 0x65, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x6c, 0x6f, 0x6f, 0x70,\n\t0x53, 0x74, 0x65, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x07,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x45, 0x78, 0x70, 0x72, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x0b, 0x0a, 0x09,\n\t0x65, 0x78, 0x70, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xc1, 0x03, 0x0a, 0x08, 0x43, 0x6f,\n\t0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c,\n\t0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56,\n\t0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61,\n\t0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74,\n\t0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36,\n\t0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52,\n\t0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c,\n\t0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01,\n\t0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f,\n\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62,\n\t0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,\n\t0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, 0x01,\n\t0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x12, 0x49, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,\n\t0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x69,\n\t0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x0a, 0x0d,\n\t0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xac, 0x06,\n\t0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e,\n\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x56, 0x65, 0x72, 0x73,\n\t0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,\n\t0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,\n\t0x21, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18,\n\t0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65,\n\t0x74, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,\n\t0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72,\n\t0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69,\n\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x69,\n\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x5f, 0x63,\n\t0x61, 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,\n\t0x2e, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,\n\t0x52, 0x0a, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x3e, 0x0a, 0x0a,\n\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b,\n\t0x32, 0x1e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72,\n\t0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3c, 0x0a, 0x0e,\n\t0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,\n\t0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79,\n\t0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,\n\t0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4d, 0x0a, 0x0f, 0x4d, 0x61,\n\t0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,\n\t0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,\n\t0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,\n\t0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05,\n\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xe0, 0x02, 0x0a, 0x09, 0x45, 0x78,\n\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,\n\t0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x59, 0x0a, 0x13, 0x61, 0x66, 0x66, 0x65, 0x63,\n\t0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02,\n\t0x20, 0x03, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e,\n\t0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x12,\n\t0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e,\n\t0x74, 0x73, 0x12, 0x40, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x53,\n\t0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,\n\t0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72,\n\t0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,\n\t0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,\n\t0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x43,\n\t0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4d, 0x50,\n\t0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,\n\t0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54,\n\t0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4d,\n\t0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x48, 0x45, 0x43,\n\t0x4b, 0x45, 0x52, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45,\n\t0x4e, 0x54, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x42, 0x2e, 0x0a, 0x0c,\n\t0x64, 0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x0b, 0x53, 0x79,\n\t0x6e, 0x74, 0x61, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c,\n\t0x2e, 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_cel_expr_syntax_proto_rawDescOnce sync.Once\n\tfile_cel_expr_syntax_proto_rawDescData = file_cel_expr_syntax_proto_rawDesc\n)\n\nfunc file_cel_expr_syntax_proto_rawDescGZIP() []byte {\n\tfile_cel_expr_syntax_proto_rawDescOnce.Do(func() {\n\t\tfile_cel_expr_syntax_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_syntax_proto_rawDescData)\n\t})\n\treturn file_cel_expr_syntax_proto_rawDescData\n}\n\nvar file_cel_expr_syntax_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_cel_expr_syntax_proto_msgTypes = make([]protoimpl.MessageInfo, 15)\nvar file_cel_expr_syntax_proto_goTypes = []interface{}{\n\t(SourceInfo_Extension_Component)(0),  // 0: cel.expr.SourceInfo.Extension.Component\n\t(*ParsedExpr)(nil),                   // 1: cel.expr.ParsedExpr\n\t(*Expr)(nil),                         // 2: cel.expr.Expr\n\t(*Constant)(nil),                     // 3: cel.expr.Constant\n\t(*SourceInfo)(nil),                   // 4: cel.expr.SourceInfo\n\t(*Expr_Ident)(nil),                   // 5: cel.expr.Expr.Ident\n\t(*Expr_Select)(nil),                  // 6: cel.expr.Expr.Select\n\t(*Expr_Call)(nil),                    // 7: cel.expr.Expr.Call\n\t(*Expr_CreateList)(nil),              // 8: cel.expr.Expr.CreateList\n\t(*Expr_CreateStruct)(nil),            // 9: cel.expr.Expr.CreateStruct\n\t(*Expr_Comprehension)(nil),           // 10: cel.expr.Expr.Comprehension\n\t(*Expr_CreateStruct_Entry)(nil),      // 11: cel.expr.Expr.CreateStruct.Entry\n\tnil,                                  // 12: cel.expr.SourceInfo.PositionsEntry\n\tnil,                                  // 13: cel.expr.SourceInfo.MacroCallsEntry\n\t(*SourceInfo_Extension)(nil),         // 14: cel.expr.SourceInfo.Extension\n\t(*SourceInfo_Extension_Version)(nil), // 15: cel.expr.SourceInfo.Extension.Version\n\t(structpb.NullValue)(0),              // 16: google.protobuf.NullValue\n\t(*durationpb.Duration)(nil),          // 17: google.protobuf.Duration\n\t(*timestamppb.Timestamp)(nil),        // 18: google.protobuf.Timestamp\n}\nvar file_cel_expr_syntax_proto_depIdxs = []int32{\n\t2,  // 0: cel.expr.ParsedExpr.expr:type_name -> cel.expr.Expr\n\t4,  // 1: cel.expr.ParsedExpr.source_info:type_name -> cel.expr.SourceInfo\n\t3,  // 2: cel.expr.Expr.const_expr:type_name -> cel.expr.Constant\n\t5,  // 3: cel.expr.Expr.ident_expr:type_name -> cel.expr.Expr.Ident\n\t6,  // 4: cel.expr.Expr.select_expr:type_name -> cel.expr.Expr.Select\n\t7,  // 5: cel.expr.Expr.call_expr:type_name -> cel.expr.Expr.Call\n\t8,  // 6: cel.expr.Expr.list_expr:type_name -> cel.expr.Expr.CreateList\n\t9,  // 7: cel.expr.Expr.struct_expr:type_name -> cel.expr.Expr.CreateStruct\n\t10, // 8: cel.expr.Expr.comprehension_expr:type_name -> cel.expr.Expr.Comprehension\n\t16, // 9: cel.expr.Constant.null_value:type_name -> google.protobuf.NullValue\n\t17, // 10: cel.expr.Constant.duration_value:type_name -> google.protobuf.Duration\n\t18, // 11: cel.expr.Constant.timestamp_value:type_name -> google.protobuf.Timestamp\n\t12, // 12: cel.expr.SourceInfo.positions:type_name -> cel.expr.SourceInfo.PositionsEntry\n\t13, // 13: cel.expr.SourceInfo.macro_calls:type_name -> cel.expr.SourceInfo.MacroCallsEntry\n\t14, // 14: cel.expr.SourceInfo.extensions:type_name -> cel.expr.SourceInfo.Extension\n\t2,  // 15: cel.expr.Expr.Select.operand:type_name -> cel.expr.Expr\n\t2,  // 16: cel.expr.Expr.Call.target:type_name -> cel.expr.Expr\n\t2,  // 17: cel.expr.Expr.Call.args:type_name -> cel.expr.Expr\n\t2,  // 18: cel.expr.Expr.CreateList.elements:type_name -> cel.expr.Expr\n\t11, // 19: cel.expr.Expr.CreateStruct.entries:type_name -> cel.expr.Expr.CreateStruct.Entry\n\t2,  // 20: cel.expr.Expr.Comprehension.iter_range:type_name -> cel.expr.Expr\n\t2,  // 21: cel.expr.Expr.Comprehension.accu_init:type_name -> cel.expr.Expr\n\t2,  // 22: cel.expr.Expr.Comprehension.loop_condition:type_name -> cel.expr.Expr\n\t2,  // 23: cel.expr.Expr.Comprehension.loop_step:type_name -> cel.expr.Expr\n\t2,  // 24: cel.expr.Expr.Comprehension.result:type_name -> cel.expr.Expr\n\t2,  // 25: cel.expr.Expr.CreateStruct.Entry.map_key:type_name -> cel.expr.Expr\n\t2,  // 26: cel.expr.Expr.CreateStruct.Entry.value:type_name -> cel.expr.Expr\n\t2,  // 27: cel.expr.SourceInfo.MacroCallsEntry.value:type_name -> cel.expr.Expr\n\t0,  // 28: cel.expr.SourceInfo.Extension.affected_components:type_name -> cel.expr.SourceInfo.Extension.Component\n\t15, // 29: cel.expr.SourceInfo.Extension.version:type_name -> cel.expr.SourceInfo.Extension.Version\n\t30, // [30:30] is the sub-list for method output_type\n\t30, // [30:30] is the sub-list for method input_type\n\t30, // [30:30] is the sub-list for extension type_name\n\t30, // [30:30] is the sub-list for extension extendee\n\t0,  // [0:30] is the sub-list for field type_name\n}\n\nfunc init() { file_cel_expr_syntax_proto_init() }\nfunc file_cel_expr_syntax_proto_init() {\n\tif File_cel_expr_syntax_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_cel_expr_syntax_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ParsedExpr); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Constant); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*SourceInfo); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_Ident); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_Select); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_Call); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_CreateList); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_CreateStruct); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_Comprehension); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Expr_CreateStruct_Entry); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*SourceInfo_Extension); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_syntax_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*SourceInfo_Extension_Version); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\tfile_cel_expr_syntax_proto_msgTypes[1].OneofWrappers = []interface{}{\n\t\t(*Expr_ConstExpr)(nil),\n\t\t(*Expr_IdentExpr)(nil),\n\t\t(*Expr_SelectExpr)(nil),\n\t\t(*Expr_CallExpr)(nil),\n\t\t(*Expr_ListExpr)(nil),\n\t\t(*Expr_StructExpr)(nil),\n\t\t(*Expr_ComprehensionExpr)(nil),\n\t}\n\tfile_cel_expr_syntax_proto_msgTypes[2].OneofWrappers = []interface{}{\n\t\t(*Constant_NullValue)(nil),\n\t\t(*Constant_BoolValue)(nil),\n\t\t(*Constant_Int64Value)(nil),\n\t\t(*Constant_Uint64Value)(nil),\n\t\t(*Constant_DoubleValue)(nil),\n\t\t(*Constant_StringValue)(nil),\n\t\t(*Constant_BytesValue)(nil),\n\t\t(*Constant_DurationValue)(nil),\n\t\t(*Constant_TimestampValue)(nil),\n\t}\n\tfile_cel_expr_syntax_proto_msgTypes[10].OneofWrappers = []interface{}{\n\t\t(*Expr_CreateStruct_Entry_FieldKey)(nil),\n\t\t(*Expr_CreateStruct_Entry_MapKey)(nil),\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_cel_expr_syntax_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   15,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_cel_expr_syntax_proto_goTypes,\n\t\tDependencyIndexes: file_cel_expr_syntax_proto_depIdxs,\n\t\tEnumInfos:         file_cel_expr_syntax_proto_enumTypes,\n\t\tMessageInfos:      file_cel_expr_syntax_proto_msgTypes,\n\t}.Build()\n\tFile_cel_expr_syntax_proto = out.File\n\tfile_cel_expr_syntax_proto_rawDesc = nil\n\tfile_cel_expr_syntax_proto_goTypes = nil\n\tfile_cel_expr_syntax_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/cel.dev/expr/value.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.21.5\n// source: cel/expr/value.proto\n\npackage expr\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tanypb \"google.golang.org/protobuf/types/known/anypb\"\n\tstructpb \"google.golang.org/protobuf/types/known/structpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Value struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Types that are assignable to Kind:\n\t//\n\t//\t*Value_NullValue\n\t//\t*Value_BoolValue\n\t//\t*Value_Int64Value\n\t//\t*Value_Uint64Value\n\t//\t*Value_DoubleValue\n\t//\t*Value_StringValue\n\t//\t*Value_BytesValue\n\t//\t*Value_EnumValue\n\t//\t*Value_ObjectValue\n\t//\t*Value_MapValue\n\t//\t*Value_ListValue\n\t//\t*Value_TypeValue\n\tKind isValue_Kind `protobuf_oneof:\"kind\"`\n}\n\nfunc (x *Value) Reset() {\n\t*x = Value{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_value_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Value) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Value) ProtoMessage() {}\n\nfunc (x *Value) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_value_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Value.ProtoReflect.Descriptor instead.\nfunc (*Value) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_value_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (m *Value) GetKind() isValue_Kind {\n\tif m != nil {\n\t\treturn m.Kind\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetNullValue() structpb.NullValue {\n\tif x, ok := x.GetKind().(*Value_NullValue); ok {\n\t\treturn x.NullValue\n\t}\n\treturn structpb.NullValue(0)\n}\n\nfunc (x *Value) GetBoolValue() bool {\n\tif x, ok := x.GetKind().(*Value_BoolValue); ok {\n\t\treturn x.BoolValue\n\t}\n\treturn false\n}\n\nfunc (x *Value) GetInt64Value() int64 {\n\tif x, ok := x.GetKind().(*Value_Int64Value); ok {\n\t\treturn x.Int64Value\n\t}\n\treturn 0\n}\n\nfunc (x *Value) GetUint64Value() uint64 {\n\tif x, ok := x.GetKind().(*Value_Uint64Value); ok {\n\t\treturn x.Uint64Value\n\t}\n\treturn 0\n}\n\nfunc (x *Value) GetDoubleValue() float64 {\n\tif x, ok := x.GetKind().(*Value_DoubleValue); ok {\n\t\treturn x.DoubleValue\n\t}\n\treturn 0\n}\n\nfunc (x *Value) GetStringValue() string {\n\tif x, ok := x.GetKind().(*Value_StringValue); ok {\n\t\treturn x.StringValue\n\t}\n\treturn \"\"\n}\n\nfunc (x *Value) GetBytesValue() []byte {\n\tif x, ok := x.GetKind().(*Value_BytesValue); ok {\n\t\treturn x.BytesValue\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetEnumValue() *EnumValue {\n\tif x, ok := x.GetKind().(*Value_EnumValue); ok {\n\t\treturn x.EnumValue\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetObjectValue() *anypb.Any {\n\tif x, ok := x.GetKind().(*Value_ObjectValue); ok {\n\t\treturn x.ObjectValue\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetMapValue() *MapValue {\n\tif x, ok := x.GetKind().(*Value_MapValue); ok {\n\t\treturn x.MapValue\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetListValue() *ListValue {\n\tif x, ok := x.GetKind().(*Value_ListValue); ok {\n\t\treturn x.ListValue\n\t}\n\treturn nil\n}\n\nfunc (x *Value) GetTypeValue() string {\n\tif x, ok := x.GetKind().(*Value_TypeValue); ok {\n\t\treturn x.TypeValue\n\t}\n\treturn \"\"\n}\n\ntype isValue_Kind interface {\n\tisValue_Kind()\n}\n\ntype Value_NullValue struct {\n\tNullValue structpb.NullValue `protobuf:\"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof\"`\n}\n\ntype Value_BoolValue struct {\n\tBoolValue bool `protobuf:\"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof\"`\n}\n\ntype Value_Int64Value struct {\n\tInt64Value int64 `protobuf:\"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof\"`\n}\n\ntype Value_Uint64Value struct {\n\tUint64Value uint64 `protobuf:\"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof\"`\n}\n\ntype Value_DoubleValue struct {\n\tDoubleValue float64 `protobuf:\"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof\"`\n}\n\ntype Value_StringValue struct {\n\tStringValue string `protobuf:\"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof\"`\n}\n\ntype Value_BytesValue struct {\n\tBytesValue []byte `protobuf:\"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof\"`\n}\n\ntype Value_EnumValue struct {\n\tEnumValue *EnumValue `protobuf:\"bytes,9,opt,name=enum_value,json=enumValue,proto3,oneof\"`\n}\n\ntype Value_ObjectValue struct {\n\tObjectValue *anypb.Any `protobuf:\"bytes,10,opt,name=object_value,json=objectValue,proto3,oneof\"`\n}\n\ntype Value_MapValue struct {\n\tMapValue *MapValue `protobuf:\"bytes,11,opt,name=map_value,json=mapValue,proto3,oneof\"`\n}\n\ntype Value_ListValue struct {\n\tListValue *ListValue `protobuf:\"bytes,12,opt,name=list_value,json=listValue,proto3,oneof\"`\n}\n\ntype Value_TypeValue struct {\n\tTypeValue string `protobuf:\"bytes,15,opt,name=type_value,json=typeValue,proto3,oneof\"`\n}\n\nfunc (*Value_NullValue) isValue_Kind() {}\n\nfunc (*Value_BoolValue) isValue_Kind() {}\n\nfunc (*Value_Int64Value) isValue_Kind() {}\n\nfunc (*Value_Uint64Value) isValue_Kind() {}\n\nfunc (*Value_DoubleValue) isValue_Kind() {}\n\nfunc (*Value_StringValue) isValue_Kind() {}\n\nfunc (*Value_BytesValue) isValue_Kind() {}\n\nfunc (*Value_EnumValue) isValue_Kind() {}\n\nfunc (*Value_ObjectValue) isValue_Kind() {}\n\nfunc (*Value_MapValue) isValue_Kind() {}\n\nfunc (*Value_ListValue) isValue_Kind() {}\n\nfunc (*Value_TypeValue) isValue_Kind() {}\n\ntype EnumValue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tType  string `protobuf:\"bytes,1,opt,name=type,proto3\" json:\"type,omitempty\"`\n\tValue int32  `protobuf:\"varint,2,opt,name=value,proto3\" json:\"value,omitempty\"`\n}\n\nfunc (x *EnumValue) Reset() {\n\t*x = EnumValue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_value_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *EnumValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EnumValue) ProtoMessage() {}\n\nfunc (x *EnumValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_value_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use EnumValue.ProtoReflect.Descriptor instead.\nfunc (*EnumValue) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_value_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *EnumValue) GetType() string {\n\tif x != nil {\n\t\treturn x.Type\n\t}\n\treturn \"\"\n}\n\nfunc (x *EnumValue) GetValue() int32 {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn 0\n}\n\ntype ListValue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tValues []*Value `protobuf:\"bytes,1,rep,name=values,proto3\" json:\"values,omitempty\"`\n}\n\nfunc (x *ListValue) Reset() {\n\t*x = ListValue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_value_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ListValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListValue) ProtoMessage() {}\n\nfunc (x *ListValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_value_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ListValue.ProtoReflect.Descriptor instead.\nfunc (*ListValue) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_value_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *ListValue) GetValues() []*Value {\n\tif x != nil {\n\t\treturn x.Values\n\t}\n\treturn nil\n}\n\ntype MapValue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEntries []*MapValue_Entry `protobuf:\"bytes,1,rep,name=entries,proto3\" json:\"entries,omitempty\"`\n}\n\nfunc (x *MapValue) Reset() {\n\t*x = MapValue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_value_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MapValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MapValue) ProtoMessage() {}\n\nfunc (x *MapValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_value_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MapValue.ProtoReflect.Descriptor instead.\nfunc (*MapValue) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_value_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *MapValue) GetEntries() []*MapValue_Entry {\n\tif x != nil {\n\t\treturn x.Entries\n\t}\n\treturn nil\n}\n\ntype MapValue_Entry struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tKey   *Value `protobuf:\"bytes,1,opt,name=key,proto3\" json:\"key,omitempty\"`\n\tValue *Value `protobuf:\"bytes,2,opt,name=value,proto3\" json:\"value,omitempty\"`\n}\n\nfunc (x *MapValue_Entry) Reset() {\n\t*x = MapValue_Entry{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_cel_expr_value_proto_msgTypes[4]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MapValue_Entry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MapValue_Entry) ProtoMessage() {}\n\nfunc (x *MapValue_Entry) ProtoReflect() protoreflect.Message {\n\tmi := &file_cel_expr_value_proto_msgTypes[4]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MapValue_Entry.ProtoReflect.Descriptor instead.\nfunc (*MapValue_Entry) Descriptor() ([]byte, []int) {\n\treturn file_cel_expr_value_proto_rawDescGZIP(), []int{3, 0}\n}\n\nfunc (x *MapValue_Entry) GetKey() *Value {\n\tif x != nil {\n\t\treturn x.Key\n\t}\n\treturn nil\n}\n\nfunc (x *MapValue_Entry) GetValue() *Value {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn nil\n}\n\nvar File_cel_expr_value_proto protoreflect.FileDescriptor\n\nvar file_cel_expr_value_proto_rawDesc = []byte{\n\t0x0a, 0x14, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72,\n\t0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,\n\t0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72,\n\t0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x04, 0x0a, 0x05, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65,\n\t0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56,\n\t0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69,\n\t0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75,\n\t0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x48,\n\t0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23,\n\t0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06,\n\t0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c,\n\t0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65,\n\t0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48,\n\t0x00, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c,\n\t0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x6f, 0x62, 0x6a, 0x65,\n\t0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c,\n\t0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00,\n\t0x52, 0x08, 0x6d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x6c, 0x69,\n\t0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13,\n\t0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65,\n\t0x12, 0x1f, 0x0a, 0x0a, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f,\n\t0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x74, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x09, 0x45, 0x6e, 0x75,\n\t0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,\n\t0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t0x22, 0x34, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a,\n\t0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e,\n\t0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06,\n\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01,\n\t0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,\n\t0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07,\n\t0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x51, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79,\n\t0x12, 0x21, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e,\n\t0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03,\n\t0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x2d, 0x0a, 0x0c, 0x64, 0x65,\n\t0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x0a, 0x56, 0x61, 0x6c, 0x75,\n\t0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64, 0x65,\n\t0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x33,\n}\n\nvar (\n\tfile_cel_expr_value_proto_rawDescOnce sync.Once\n\tfile_cel_expr_value_proto_rawDescData = file_cel_expr_value_proto_rawDesc\n)\n\nfunc file_cel_expr_value_proto_rawDescGZIP() []byte {\n\tfile_cel_expr_value_proto_rawDescOnce.Do(func() {\n\t\tfile_cel_expr_value_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_value_proto_rawDescData)\n\t})\n\treturn file_cel_expr_value_proto_rawDescData\n}\n\nvar file_cel_expr_value_proto_msgTypes = make([]protoimpl.MessageInfo, 5)\nvar file_cel_expr_value_proto_goTypes = []interface{}{\n\t(*Value)(nil),           // 0: cel.expr.Value\n\t(*EnumValue)(nil),       // 1: cel.expr.EnumValue\n\t(*ListValue)(nil),       // 2: cel.expr.ListValue\n\t(*MapValue)(nil),        // 3: cel.expr.MapValue\n\t(*MapValue_Entry)(nil),  // 4: cel.expr.MapValue.Entry\n\t(structpb.NullValue)(0), // 5: google.protobuf.NullValue\n\t(*anypb.Any)(nil),       // 6: google.protobuf.Any\n}\nvar file_cel_expr_value_proto_depIdxs = []int32{\n\t5, // 0: cel.expr.Value.null_value:type_name -> google.protobuf.NullValue\n\t1, // 1: cel.expr.Value.enum_value:type_name -> cel.expr.EnumValue\n\t6, // 2: cel.expr.Value.object_value:type_name -> google.protobuf.Any\n\t3, // 3: cel.expr.Value.map_value:type_name -> cel.expr.MapValue\n\t2, // 4: cel.expr.Value.list_value:type_name -> cel.expr.ListValue\n\t0, // 5: cel.expr.ListValue.values:type_name -> cel.expr.Value\n\t4, // 6: cel.expr.MapValue.entries:type_name -> cel.expr.MapValue.Entry\n\t0, // 7: cel.expr.MapValue.Entry.key:type_name -> cel.expr.Value\n\t0, // 8: cel.expr.MapValue.Entry.value:type_name -> cel.expr.Value\n\t9, // [9:9] is the sub-list for method output_type\n\t9, // [9:9] is the sub-list for method input_type\n\t9, // [9:9] is the sub-list for extension type_name\n\t9, // [9:9] is the sub-list for extension extendee\n\t0, // [0:9] is the sub-list for field type_name\n}\n\nfunc init() { file_cel_expr_value_proto_init() }\nfunc file_cel_expr_value_proto_init() {\n\tif File_cel_expr_value_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_cel_expr_value_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Value); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_value_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*EnumValue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_value_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ListValue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_value_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MapValue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_cel_expr_value_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MapValue_Entry); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\tfile_cel_expr_value_proto_msgTypes[0].OneofWrappers = []interface{}{\n\t\t(*Value_NullValue)(nil),\n\t\t(*Value_BoolValue)(nil),\n\t\t(*Value_Int64Value)(nil),\n\t\t(*Value_Uint64Value)(nil),\n\t\t(*Value_DoubleValue)(nil),\n\t\t(*Value_StringValue)(nil),\n\t\t(*Value_BytesValue)(nil),\n\t\t(*Value_EnumValue)(nil),\n\t\t(*Value_ObjectValue)(nil),\n\t\t(*Value_MapValue)(nil),\n\t\t(*Value_ListValue)(nil),\n\t\t(*Value_TypeValue)(nil),\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_cel_expr_value_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   5,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_cel_expr_value_proto_goTypes,\n\t\tDependencyIndexes: file_cel_expr_value_proto_depIdxs,\n\t\tMessageInfos:      file_cel_expr_value_proto_msgTypes,\n\t}.Build()\n\tFile_cel_expr_value_proto = out.File\n\tfile_cel_expr_value_proto_rawDesc = nil\n\tfile_cel_expr_value_proto_goTypes = nil\n\tfile_cel_expr_value_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/CHANGES.md",
    "content": "# Changes\n\n## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.1...compute/metadata/v0.5.2) (2024-09-20)\n\n\n### Bug Fixes\n\n* **compute/metadata:** Close Response Body for failed request ([#10891](https://github.com/googleapis/google-cloud-go/issues/10891)) ([e91d45e](https://github.com/googleapis/google-cloud-go/commit/e91d45e4757a9e354114509ba9800085d9e0ff1f))\n\n## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.0...compute/metadata/v0.5.1) (2024-09-12)\n\n\n### Bug Fixes\n\n* **compute/metadata:** Check error chain for retryable error ([#10840](https://github.com/googleapis/google-cloud-go/issues/10840)) ([2bdedef](https://github.com/googleapis/google-cloud-go/commit/2bdedeff621b223d63cebc4355fcf83bc68412cd))\n\n## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10)\n\n\n### Features\n\n* **compute/metadata:** Add sys check for windows OnGCE ([#10521](https://github.com/googleapis/google-cloud-go/issues/10521)) ([3b9a830](https://github.com/googleapis/google-cloud-go/commit/3b9a83063960d2a2ac20beb47cc15818a68bd302))\n\n## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.3.0...compute/metadata/v0.4.0) (2024-07-01)\n\n\n### Features\n\n* **compute/metadata:** Add context for all functions/methods ([#10370](https://github.com/googleapis/google-cloud-go/issues/10370)) ([66b8efe](https://github.com/googleapis/google-cloud-go/commit/66b8efe7ad877e052b2987bb4475477e38c67bb3))\n\n\n### Documentation\n\n* **compute/metadata:** Update OnGCE description ([#10408](https://github.com/googleapis/google-cloud-go/issues/10408)) ([6a46dca](https://github.com/googleapis/google-cloud-go/commit/6a46dca4eae4f88ec6f88822e01e5bf8aeca787f))\n\n## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.3...compute/metadata/v0.3.0) (2024-04-15)\n\n\n### Features\n\n* **compute/metadata:** Add context aware functions  ([#9733](https://github.com/googleapis/google-cloud-go/issues/9733)) ([e4eb5b4](https://github.com/googleapis/google-cloud-go/commit/e4eb5b46ee2aec9d2fc18300bfd66015e25a0510))\n\n## [0.2.3](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.2...compute/metadata/v0.2.3) (2022-12-15)\n\n\n### Bug Fixes\n\n* **compute/metadata:** Switch DNS lookup to an absolute lookup ([119b410](https://github.com/googleapis/google-cloud-go/commit/119b41060c7895e45e48aee5621ad35607c4d021)), refs [#7165](https://github.com/googleapis/google-cloud-go/issues/7165)\n\n## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.1...compute/metadata/v0.2.2) (2022-12-01)\n\n\n### Bug Fixes\n\n* **compute/metadata:** Set IdleConnTimeout for http.Client ([#7084](https://github.com/googleapis/google-cloud-go/issues/7084)) ([766516a](https://github.com/googleapis/google-cloud-go/commit/766516aaf3816bfb3159efeea65aa3d1d205a3e2)), refs [#5430](https://github.com/googleapis/google-cloud-go/issues/5430)\n\n## [0.1.0] (2022-10-26)\n\nInitial release of metadata being it's own module.\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/README.md",
    "content": "# Compute API\n\n[![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/compute.svg)](https://pkg.go.dev/cloud.google.com/go/compute/metadata)\n\nThis is a utility library for communicating with Google Cloud metadata service\non Google Cloud.\n\n## Install\n\n```bash\ngo get cloud.google.com/go/compute/metadata\n```\n\n## Go Version Support\n\nSee the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported)\nsection in the root directory's README.\n\n## Contributing\n\nContributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md)\ndocument for details.\n\nPlease note that this project is released with a Contributor Code of Conduct.\nBy participating in this project you agree to abide by its terms. See\n[Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct)\nfor more information.\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/metadata.go",
    "content": "// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package metadata provides access to Google Compute Engine (GCE)\n// metadata and API service accounts.\n//\n// This package is a wrapper around the GCE metadata service,\n// as documented at https://cloud.google.com/compute/docs/metadata/overview.\npackage metadata // import \"cloud.google.com/go/compute/metadata\"\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\nconst (\n\t// metadataIP is the documented metadata server IP address.\n\tmetadataIP = \"169.254.169.254\"\n\n\t// metadataHostEnv is the environment variable specifying the\n\t// GCE metadata hostname.  If empty, the default value of\n\t// metadataIP (\"169.254.169.254\") is used instead.\n\t// This is variable name is not defined by any spec, as far as\n\t// I know; it was made up for the Go package.\n\tmetadataHostEnv = \"GCE_METADATA_HOST\"\n\n\tuserAgent = \"gcloud-golang/0.1\"\n)\n\ntype cachedValue struct {\n\tk    string\n\ttrim bool\n\tmu   sync.Mutex\n\tv    string\n}\n\nvar (\n\tprojID  = &cachedValue{k: \"project/project-id\", trim: true}\n\tprojNum = &cachedValue{k: \"project/numeric-project-id\", trim: true}\n\tinstID  = &cachedValue{k: \"instance/id\", trim: true}\n)\n\nvar defaultClient = &Client{hc: newDefaultHTTPClient()}\n\nfunc newDefaultHTTPClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tDial: (&net.Dialer{\n\t\t\t\tTimeout:   2 * time.Second,\n\t\t\t\tKeepAlive: 30 * time.Second,\n\t\t\t}).Dial,\n\t\t\tIdleConnTimeout: 60 * time.Second,\n\t\t},\n\t\tTimeout: 5 * time.Second,\n\t}\n}\n\n// NotDefinedError is returned when requested metadata is not defined.\n//\n// The underlying string is the suffix after \"/computeMetadata/v1/\".\n//\n// This error is not returned if the value is defined to be the empty\n// string.\ntype NotDefinedError string\n\nfunc (suffix NotDefinedError) Error() string {\n\treturn fmt.Sprintf(\"metadata: GCE metadata %q not defined\", string(suffix))\n}\n\nfunc (c *cachedValue) get(ctx context.Context, cl *Client) (v string, err error) {\n\tdefer c.mu.Unlock()\n\tc.mu.Lock()\n\tif c.v != \"\" {\n\t\treturn c.v, nil\n\t}\n\tif c.trim {\n\t\tv, err = cl.getTrimmed(ctx, c.k)\n\t} else {\n\t\tv, err = cl.GetWithContext(ctx, c.k)\n\t}\n\tif err == nil {\n\t\tc.v = v\n\t}\n\treturn\n}\n\nvar (\n\tonGCEOnce sync.Once\n\tonGCE     bool\n)\n\n// OnGCE reports whether this process is running on Google Compute Platforms.\n// NOTE: True returned from `OnGCE` does not guarantee that the metadata server\n// is accessible from this process and have all the metadata defined.\nfunc OnGCE() bool {\n\tonGCEOnce.Do(initOnGCE)\n\treturn onGCE\n}\n\nfunc initOnGCE() {\n\tonGCE = testOnGCE()\n}\n\nfunc testOnGCE() bool {\n\t// The user explicitly said they're on GCE, so trust them.\n\tif os.Getenv(metadataHostEnv) != \"\" {\n\t\treturn true\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tresc := make(chan bool, 2)\n\n\t// Try two strategies in parallel.\n\t// See https://github.com/googleapis/google-cloud-go/issues/194\n\tgo func() {\n\t\treq, _ := http.NewRequest(\"GET\", \"http://\"+metadataIP, nil)\n\t\treq.Header.Set(\"User-Agent\", userAgent)\n\t\tres, err := newDefaultHTTPClient().Do(req.WithContext(ctx))\n\t\tif err != nil {\n\t\t\tresc <- false\n\t\t\treturn\n\t\t}\n\t\tdefer res.Body.Close()\n\t\tresc <- res.Header.Get(\"Metadata-Flavor\") == \"Google\"\n\t}()\n\n\tgo func() {\n\t\tresolver := &net.Resolver{}\n\t\taddrs, err := resolver.LookupHost(ctx, \"metadata.google.internal.\")\n\t\tif err != nil || len(addrs) == 0 {\n\t\t\tresc <- false\n\t\t\treturn\n\t\t}\n\t\tresc <- strsContains(addrs, metadataIP)\n\t}()\n\n\ttryHarder := systemInfoSuggestsGCE()\n\tif tryHarder {\n\t\tres := <-resc\n\t\tif res {\n\t\t\t// The first strategy succeeded, so let's use it.\n\t\t\treturn true\n\t\t}\n\t\t// Wait for either the DNS or metadata server probe to\n\t\t// contradict the other one and say we are running on\n\t\t// GCE. Give it a lot of time to do so, since the system\n\t\t// info already suggests we're running on a GCE BIOS.\n\t\ttimer := time.NewTimer(5 * time.Second)\n\t\tdefer timer.Stop()\n\t\tselect {\n\t\tcase res = <-resc:\n\t\t\treturn res\n\t\tcase <-timer.C:\n\t\t\t// Too slow. Who knows what this system is.\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// There's no hint from the system info that we're running on\n\t// GCE, so use the first probe's result as truth, whether it's\n\t// true or false. The goal here is to optimize for speed for\n\t// users who are NOT running on GCE. We can't assume that\n\t// either a DNS lookup or an HTTP request to a blackholed IP\n\t// address is fast. Worst case this should return when the\n\t// metaClient's Transport.ResponseHeaderTimeout or\n\t// Transport.Dial.Timeout fires (in two seconds).\n\treturn <-resc\n}\n\n// Subscribe calls Client.SubscribeWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [SubscribeWithContext].\nfunc Subscribe(suffix string, fn func(v string, ok bool) error) error {\n\treturn defaultClient.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })\n}\n\n// SubscribeWithContext calls Client.SubscribeWithContext on the default client.\nfunc SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error {\n\treturn defaultClient.SubscribeWithContext(ctx, suffix, fn)\n}\n\n// Get calls Client.GetWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [GetWithContext].\nfunc Get(suffix string) (string, error) {\n\treturn defaultClient.GetWithContext(context.Background(), suffix)\n}\n\n// GetWithContext calls Client.GetWithContext on the default client.\nfunc GetWithContext(ctx context.Context, suffix string) (string, error) {\n\treturn defaultClient.GetWithContext(ctx, suffix)\n}\n\n// ProjectID returns the current instance's project ID string.\n//\n// Deprecated: Please use the context aware variant [ProjectIDWithContext].\nfunc ProjectID() (string, error) {\n\treturn defaultClient.ProjectIDWithContext(context.Background())\n}\n\n// ProjectIDWithContext returns the current instance's project ID string.\nfunc ProjectIDWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.ProjectIDWithContext(ctx)\n}\n\n// NumericProjectID returns the current instance's numeric project ID.\n//\n// Deprecated: Please use the context aware variant [NumericProjectIDWithContext].\nfunc NumericProjectID() (string, error) {\n\treturn defaultClient.NumericProjectIDWithContext(context.Background())\n}\n\n// NumericProjectIDWithContext returns the current instance's numeric project ID.\nfunc NumericProjectIDWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.NumericProjectIDWithContext(ctx)\n}\n\n// InternalIP returns the instance's primary internal IP address.\n//\n// Deprecated: Please use the context aware variant [InternalIPWithContext].\nfunc InternalIP() (string, error) {\n\treturn defaultClient.InternalIPWithContext(context.Background())\n}\n\n// InternalIPWithContext returns the instance's primary internal IP address.\nfunc InternalIPWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.InternalIPWithContext(ctx)\n}\n\n// ExternalIP returns the instance's primary external (public) IP address.\n//\n// Deprecated: Please use the context aware variant [ExternalIPWithContext].\nfunc ExternalIP() (string, error) {\n\treturn defaultClient.ExternalIPWithContext(context.Background())\n}\n\n// ExternalIPWithContext returns the instance's primary external (public) IP address.\nfunc ExternalIPWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.ExternalIPWithContext(ctx)\n}\n\n// Email calls Client.EmailWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [EmailWithContext].\nfunc Email(serviceAccount string) (string, error) {\n\treturn defaultClient.EmailWithContext(context.Background(), serviceAccount)\n}\n\n// EmailWithContext calls Client.EmailWithContext on the default client.\nfunc EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {\n\treturn defaultClient.EmailWithContext(ctx, serviceAccount)\n}\n\n// Hostname returns the instance's hostname. This will be of the form\n// \"<instanceID>.c.<projID>.internal\".\n//\n// Deprecated: Please use the context aware variant [HostnameWithContext].\nfunc Hostname() (string, error) {\n\treturn defaultClient.HostnameWithContext(context.Background())\n}\n\n// HostnameWithContext returns the instance's hostname. This will be of the form\n// \"<instanceID>.c.<projID>.internal\".\nfunc HostnameWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.HostnameWithContext(ctx)\n}\n\n// InstanceTags returns the list of user-defined instance tags,\n// assigned when initially creating a GCE instance.\n//\n// Deprecated: Please use the context aware variant [InstanceTagsWithContext].\nfunc InstanceTags() ([]string, error) {\n\treturn defaultClient.InstanceTagsWithContext(context.Background())\n}\n\n// InstanceTagsWithContext returns the list of user-defined instance tags,\n// assigned when initially creating a GCE instance.\nfunc InstanceTagsWithContext(ctx context.Context) ([]string, error) {\n\treturn defaultClient.InstanceTagsWithContext(ctx)\n}\n\n// InstanceID returns the current VM's numeric instance ID.\n//\n// Deprecated: Please use the context aware variant [InstanceIDWithContext].\nfunc InstanceID() (string, error) {\n\treturn defaultClient.InstanceIDWithContext(context.Background())\n}\n\n// InstanceIDWithContext returns the current VM's numeric instance ID.\nfunc InstanceIDWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.InstanceIDWithContext(ctx)\n}\n\n// InstanceName returns the current VM's instance ID string.\n//\n// Deprecated: Please use the context aware variant [InstanceNameWithContext].\nfunc InstanceName() (string, error) {\n\treturn defaultClient.InstanceNameWithContext(context.Background())\n}\n\n// InstanceNameWithContext returns the current VM's instance ID string.\nfunc InstanceNameWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.InstanceNameWithContext(ctx)\n}\n\n// Zone returns the current VM's zone, such as \"us-central1-b\".\n//\n// Deprecated: Please use the context aware variant [ZoneWithContext].\nfunc Zone() (string, error) {\n\treturn defaultClient.ZoneWithContext(context.Background())\n}\n\n// ZoneWithContext returns the current VM's zone, such as \"us-central1-b\".\nfunc ZoneWithContext(ctx context.Context) (string, error) {\n\treturn defaultClient.ZoneWithContext(ctx)\n}\n\n// InstanceAttributes calls Client.InstanceAttributesWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [InstanceAttributesWithContext.\nfunc InstanceAttributes() ([]string, error) {\n\treturn defaultClient.InstanceAttributesWithContext(context.Background())\n}\n\n// InstanceAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.\nfunc InstanceAttributesWithContext(ctx context.Context) ([]string, error) {\n\treturn defaultClient.InstanceAttributesWithContext(ctx)\n}\n\n// ProjectAttributes calls Client.ProjectAttributesWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [ProjectAttributesWithContext].\nfunc ProjectAttributes() ([]string, error) {\n\treturn defaultClient.ProjectAttributesWithContext(context.Background())\n}\n\n// ProjectAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.\nfunc ProjectAttributesWithContext(ctx context.Context) ([]string, error) {\n\treturn defaultClient.ProjectAttributesWithContext(ctx)\n}\n\n// InstanceAttributeValue calls Client.InstanceAttributeValueWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [InstanceAttributeValueWithContext].\nfunc InstanceAttributeValue(attr string) (string, error) {\n\treturn defaultClient.InstanceAttributeValueWithContext(context.Background(), attr)\n}\n\n// InstanceAttributeValueWithContext calls Client.InstanceAttributeValueWithContext on the default client.\nfunc InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {\n\treturn defaultClient.InstanceAttributeValueWithContext(ctx, attr)\n}\n\n// ProjectAttributeValue calls Client.ProjectAttributeValueWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [ProjectAttributeValueWithContext].\nfunc ProjectAttributeValue(attr string) (string, error) {\n\treturn defaultClient.ProjectAttributeValueWithContext(context.Background(), attr)\n}\n\n// ProjectAttributeValueWithContext calls Client.ProjectAttributeValueWithContext on the default client.\nfunc ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {\n\treturn defaultClient.ProjectAttributeValueWithContext(ctx, attr)\n}\n\n// Scopes calls Client.ScopesWithContext on the default client.\n//\n// Deprecated: Please use the context aware variant [ScopesWithContext].\nfunc Scopes(serviceAccount string) ([]string, error) {\n\treturn defaultClient.ScopesWithContext(context.Background(), serviceAccount)\n}\n\n// ScopesWithContext calls Client.ScopesWithContext on the default client.\nfunc ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {\n\treturn defaultClient.ScopesWithContext(ctx, serviceAccount)\n}\n\nfunc strsContains(ss []string, s string) bool {\n\tfor _, v := range ss {\n\t\tif v == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// A Client provides metadata.\ntype Client struct {\n\thc *http.Client\n}\n\n// NewClient returns a Client that can be used to fetch metadata.\n// Returns the client that uses the specified http.Client for HTTP requests.\n// If nil is specified, returns the default client.\nfunc NewClient(c *http.Client) *Client {\n\tif c == nil {\n\t\treturn defaultClient\n\t}\n\treturn &Client{hc: c}\n}\n\n// getETag returns a value from the metadata service as well as the associated ETag.\n// This func is otherwise equivalent to Get.\nfunc (c *Client) getETag(ctx context.Context, suffix string) (value, etag string, err error) {\n\t// Using a fixed IP makes it very difficult to spoof the metadata service in\n\t// a container, which is an important use-case for local testing of cloud\n\t// deployments. To enable spoofing of the metadata service, the environment\n\t// variable GCE_METADATA_HOST is first inspected to decide where metadata\n\t// requests shall go.\n\thost := os.Getenv(metadataHostEnv)\n\tif host == \"\" {\n\t\t// Using 169.254.169.254 instead of \"metadata\" here because Go\n\t\t// binaries built with the \"netgo\" tag and without cgo won't\n\t\t// know the search suffix for \"metadata\" is\n\t\t// \".google.internal\", and this IP address is documented as\n\t\t// being stable anyway.\n\t\thost = metadataIP\n\t}\n\tsuffix = strings.TrimLeft(suffix, \"/\")\n\tu := \"http://\" + host + \"/computeMetadata/v1/\" + suffix\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treq.Header.Set(\"Metadata-Flavor\", \"Google\")\n\treq.Header.Set(\"User-Agent\", userAgent)\n\tvar res *http.Response\n\tvar reqErr error\n\tretryer := newRetryer()\n\tfor {\n\t\tres, reqErr = c.hc.Do(req)\n\t\tvar code int\n\t\tif res != nil {\n\t\t\tcode = res.StatusCode\n\t\t}\n\t\tif delay, shouldRetry := retryer.Retry(code, reqErr); shouldRetry {\n\t\t\tif res != nil && res.Body != nil {\n\t\t\t\tres.Body.Close()\n\t\t\t}\n\t\t\tif err := sleep(ctx, delay); err != nil {\n\t\t\t\treturn \"\", \"\", err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\tif reqErr != nil {\n\t\treturn \"\", \"\", reqErr\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode == http.StatusNotFound {\n\t\treturn \"\", \"\", NotDefinedError(suffix)\n\t}\n\tall, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif res.StatusCode != 200 {\n\t\treturn \"\", \"\", &Error{Code: res.StatusCode, Message: string(all)}\n\t}\n\treturn string(all), res.Header.Get(\"Etag\"), nil\n}\n\n// Get returns a value from the metadata service.\n// The suffix is appended to \"http://${GCE_METADATA_HOST}/computeMetadata/v1/\".\n//\n// If the GCE_METADATA_HOST environment variable is not defined, a default of\n// 169.254.169.254 will be used instead.\n//\n// If the requested metadata is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// Deprecated: Please use the context aware variant [Client.GetWithContext].\nfunc (c *Client) Get(suffix string) (string, error) {\n\treturn c.GetWithContext(context.Background(), suffix)\n}\n\n// GetWithContext returns a value from the metadata service.\n// The suffix is appended to \"http://${GCE_METADATA_HOST}/computeMetadata/v1/\".\n//\n// If the GCE_METADATA_HOST environment variable is not defined, a default of\n// 169.254.169.254 will be used instead.\n//\n// If the requested metadata is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// NOTE: Without an extra deadline in the context this call can take in the\n// worst case, with internal backoff retries, up to 15 seconds (e.g. when server\n// is responding slowly). Pass context with additional timeouts when needed.\nfunc (c *Client) GetWithContext(ctx context.Context, suffix string) (string, error) {\n\tval, _, err := c.getETag(ctx, suffix)\n\treturn val, err\n}\n\nfunc (c *Client) getTrimmed(ctx context.Context, suffix string) (s string, err error) {\n\ts, err = c.GetWithContext(ctx, suffix)\n\ts = strings.TrimSpace(s)\n\treturn\n}\n\nfunc (c *Client) lines(ctx context.Context, suffix string) ([]string, error) {\n\tj, err := c.GetWithContext(ctx, suffix)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts := strings.Split(strings.TrimSpace(j), \"\\n\")\n\tfor i := range s {\n\t\ts[i] = strings.TrimSpace(s[i])\n\t}\n\treturn s, nil\n}\n\n// ProjectID returns the current instance's project ID string.\n//\n// Deprecated: Please use the context aware variant [Client.ProjectIDWithContext].\nfunc (c *Client) ProjectID() (string, error) { return c.ProjectIDWithContext(context.Background()) }\n\n// ProjectIDWithContext returns the current instance's project ID string.\nfunc (c *Client) ProjectIDWithContext(ctx context.Context) (string, error) { return projID.get(ctx, c) }\n\n// NumericProjectID returns the current instance's numeric project ID.\n//\n// Deprecated: Please use the context aware variant [Client.NumericProjectIDWithContext].\nfunc (c *Client) NumericProjectID() (string, error) {\n\treturn c.NumericProjectIDWithContext(context.Background())\n}\n\n// NumericProjectIDWithContext returns the current instance's numeric project ID.\nfunc (c *Client) NumericProjectIDWithContext(ctx context.Context) (string, error) {\n\treturn projNum.get(ctx, c)\n}\n\n// InstanceID returns the current VM's numeric instance ID.\n//\n// Deprecated: Please use the context aware variant [Client.InstanceIDWithContext].\nfunc (c *Client) InstanceID() (string, error) {\n\treturn c.InstanceIDWithContext(context.Background())\n}\n\n// InstanceIDWithContext returns the current VM's numeric instance ID.\nfunc (c *Client) InstanceIDWithContext(ctx context.Context) (string, error) {\n\treturn instID.get(ctx, c)\n}\n\n// InternalIP returns the instance's primary internal IP address.\n//\n// Deprecated: Please use the context aware variant [Client.InternalIPWithContext].\nfunc (c *Client) InternalIP() (string, error) {\n\treturn c.InternalIPWithContext(context.Background())\n}\n\n// InternalIPWithContext returns the instance's primary internal IP address.\nfunc (c *Client) InternalIPWithContext(ctx context.Context) (string, error) {\n\treturn c.getTrimmed(ctx, \"instance/network-interfaces/0/ip\")\n}\n\n// Email returns the email address associated with the service account.\n//\n// Deprecated: Please use the context aware variant [Client.EmailWithContext].\nfunc (c *Client) Email(serviceAccount string) (string, error) {\n\treturn c.EmailWithContext(context.Background(), serviceAccount)\n}\n\n// EmailWithContext returns the email address associated with the service account.\n// The serviceAccount parameter default value (empty string or \"default\" value)\n// will use the instance's main account.\nfunc (c *Client) EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {\n\tif serviceAccount == \"\" {\n\t\tserviceAccount = \"default\"\n\t}\n\treturn c.getTrimmed(ctx, \"instance/service-accounts/\"+serviceAccount+\"/email\")\n}\n\n// ExternalIP returns the instance's primary external (public) IP address.\n//\n// Deprecated: Please use the context aware variant [Client.ExternalIPWithContext].\nfunc (c *Client) ExternalIP() (string, error) {\n\treturn c.ExternalIPWithContext(context.Background())\n}\n\n// ExternalIPWithContext returns the instance's primary external (public) IP address.\nfunc (c *Client) ExternalIPWithContext(ctx context.Context) (string, error) {\n\treturn c.getTrimmed(ctx, \"instance/network-interfaces/0/access-configs/0/external-ip\")\n}\n\n// Hostname returns the instance's hostname. This will be of the form\n// \"<instanceID>.c.<projID>.internal\".\n//\n// Deprecated: Please use the context aware variant [Client.HostnameWithContext].\nfunc (c *Client) Hostname() (string, error) {\n\treturn c.HostnameWithContext(context.Background())\n}\n\n// HostnameWithContext returns the instance's hostname. This will be of the form\n// \"<instanceID>.c.<projID>.internal\".\nfunc (c *Client) HostnameWithContext(ctx context.Context) (string, error) {\n\treturn c.getTrimmed(ctx, \"instance/hostname\")\n}\n\n// InstanceTags returns the list of user-defined instance tags.\n//\n// Deprecated: Please use the context aware variant [Client.InstanceTagsWithContext].\nfunc (c *Client) InstanceTags() ([]string, error) {\n\treturn c.InstanceTagsWithContext(context.Background())\n}\n\n// InstanceTagsWithContext returns the list of user-defined instance tags,\n// assigned when initially creating a GCE instance.\nfunc (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) {\n\tvar s []string\n\tj, err := c.GetWithContext(ctx, \"instance/tags\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn s, nil\n}\n\n// InstanceName returns the current VM's instance ID string.\n//\n// Deprecated: Please use the context aware variant [Client.InstanceNameWithContext].\nfunc (c *Client) InstanceName() (string, error) {\n\treturn c.InstanceNameWithContext(context.Background())\n}\n\n// InstanceNameWithContext returns the current VM's instance ID string.\nfunc (c *Client) InstanceNameWithContext(ctx context.Context) (string, error) {\n\treturn c.getTrimmed(ctx, \"instance/name\")\n}\n\n// Zone returns the current VM's zone, such as \"us-central1-b\".\n//\n// Deprecated: Please use the context aware variant [Client.ZoneWithContext].\nfunc (c *Client) Zone() (string, error) {\n\treturn c.ZoneWithContext(context.Background())\n}\n\n// ZoneWithContext returns the current VM's zone, such as \"us-central1-b\".\nfunc (c *Client) ZoneWithContext(ctx context.Context) (string, error) {\n\tzone, err := c.getTrimmed(ctx, \"instance/zone\")\n\t// zone is of the form \"projects/<projNum>/zones/<zoneName>\".\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn zone[strings.LastIndex(zone, \"/\")+1:], nil\n}\n\n// InstanceAttributes returns the list of user-defined attributes,\n// assigned when initially creating a GCE VM instance. The value of an\n// attribute can be obtained with InstanceAttributeValue.\n//\n// Deprecated: Please use the context aware variant [Client.InstanceAttributesWithContext].\nfunc (c *Client) InstanceAttributes() ([]string, error) {\n\treturn c.InstanceAttributesWithContext(context.Background())\n}\n\n// InstanceAttributesWithContext returns the list of user-defined attributes,\n// assigned when initially creating a GCE VM instance. The value of an\n// attribute can be obtained with InstanceAttributeValue.\nfunc (c *Client) InstanceAttributesWithContext(ctx context.Context) ([]string, error) {\n\treturn c.lines(ctx, \"instance/attributes/\")\n}\n\n// ProjectAttributes returns the list of user-defined attributes\n// applying to the project as a whole, not just this VM.  The value of\n// an attribute can be obtained with ProjectAttributeValue.\n//\n// Deprecated: Please use the context aware variant [Client.ProjectAttributesWithContext].\nfunc (c *Client) ProjectAttributes() ([]string, error) {\n\treturn c.ProjectAttributesWithContext(context.Background())\n}\n\n// ProjectAttributesWithContext returns the list of user-defined attributes\n// applying to the project as a whole, not just this VM.  The value of\n// an attribute can be obtained with ProjectAttributeValue.\nfunc (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, error) {\n\treturn c.lines(ctx, \"project/attributes/\")\n}\n\n// InstanceAttributeValue returns the value of the provided VM\n// instance attribute.\n//\n// If the requested attribute is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// InstanceAttributeValue may return (\"\", nil) if the attribute was\n// defined to be the empty string.\n//\n// Deprecated: Please use the context aware variant [Client.InstanceAttributeValueWithContext].\nfunc (c *Client) InstanceAttributeValue(attr string) (string, error) {\n\treturn c.InstanceAttributeValueWithContext(context.Background(), attr)\n}\n\n// InstanceAttributeValueWithContext returns the value of the provided VM\n// instance attribute.\n//\n// If the requested attribute is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// InstanceAttributeValue may return (\"\", nil) if the attribute was\n// defined to be the empty string.\nfunc (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {\n\treturn c.GetWithContext(ctx, \"instance/attributes/\"+attr)\n}\n\n// ProjectAttributeValue returns the value of the provided\n// project attribute.\n//\n// If the requested attribute is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// ProjectAttributeValue may return (\"\", nil) if the attribute was\n// defined to be the empty string.\n//\n// Deprecated: Please use the context aware variant [Client.ProjectAttributeValueWithContext].\nfunc (c *Client) ProjectAttributeValue(attr string) (string, error) {\n\treturn c.ProjectAttributeValueWithContext(context.Background(), attr)\n}\n\n// ProjectAttributeValueWithContext returns the value of the provided\n// project attribute.\n//\n// If the requested attribute is not defined, the returned error will\n// be of type NotDefinedError.\n//\n// ProjectAttributeValue may return (\"\", nil) if the attribute was\n// defined to be the empty string.\nfunc (c *Client) ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {\n\treturn c.GetWithContext(ctx, \"project/attributes/\"+attr)\n}\n\n// Scopes returns the service account scopes for the given account.\n// The account may be empty or the string \"default\" to use the instance's\n// main account.\n//\n// Deprecated: Please use the context aware variant [Client.ScopesWithContext].\nfunc (c *Client) Scopes(serviceAccount string) ([]string, error) {\n\treturn c.ScopesWithContext(context.Background(), serviceAccount)\n}\n\n// ScopesWithContext returns the service account scopes for the given account.\n// The account may be empty or the string \"default\" to use the instance's\n// main account.\nfunc (c *Client) ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {\n\tif serviceAccount == \"\" {\n\t\tserviceAccount = \"default\"\n\t}\n\treturn c.lines(ctx, \"instance/service-accounts/\"+serviceAccount+\"/scopes\")\n}\n\n// Subscribe subscribes to a value from the metadata service.\n// The suffix is appended to \"http://${GCE_METADATA_HOST}/computeMetadata/v1/\".\n// The suffix may contain query parameters.\n//\n// Deprecated: Please use the context aware variant [Client.SubscribeWithContext].\nfunc (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error {\n\treturn c.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })\n}\n\n// SubscribeWithContext subscribes to a value from the metadata service.\n// The suffix is appended to \"http://${GCE_METADATA_HOST}/computeMetadata/v1/\".\n// The suffix may contain query parameters.\n//\n// SubscribeWithContext calls fn with the latest metadata value indicated by the\n// provided suffix. If the metadata value is deleted, fn is called with the\n// empty string and ok false. Subscribe blocks until fn returns a non-nil error\n// or the value is deleted. Subscribe returns the error value returned from the\n// last call to fn, which may be nil when ok == false.\nfunc (c *Client) SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error {\n\tconst failedSubscribeSleep = time.Second * 5\n\n\t// First check to see if the metadata value exists at all.\n\tval, lastETag, err := c.getETag(ctx, suffix)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := fn(ctx, val, true); err != nil {\n\t\treturn err\n\t}\n\n\tok := true\n\tif strings.ContainsRune(suffix, '?') {\n\t\tsuffix += \"&wait_for_change=true&last_etag=\"\n\t} else {\n\t\tsuffix += \"?wait_for_change=true&last_etag=\"\n\t}\n\tfor {\n\t\tval, etag, err := c.getETag(ctx, suffix+url.QueryEscape(lastETag))\n\t\tif err != nil {\n\t\t\tif _, deleted := err.(NotDefinedError); !deleted {\n\t\t\t\ttime.Sleep(failedSubscribeSleep)\n\t\t\t\tcontinue // Retry on other errors.\n\t\t\t}\n\t\t\tok = false\n\t\t}\n\t\tlastETag = etag\n\n\t\tif err := fn(ctx, val, ok); err != nil || !ok {\n\t\t\treturn err\n\t\t}\n\t}\n}\n\n// Error contains an error response from the server.\ntype Error struct {\n\t// Code is the HTTP response status code.\n\tCode int\n\t// Message is the server response message.\n\tMessage string\n}\n\nfunc (e *Error) Error() string {\n\treturn fmt.Sprintf(\"compute: Received %d `%s`\", e.Code, e.Message)\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/retry.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage metadata\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"math/rand\"\n\t\"net/http\"\n\t\"time\"\n)\n\nconst (\n\tmaxRetryAttempts = 5\n)\n\nvar (\n\tsyscallRetryable = func(error) bool { return false }\n)\n\n// defaultBackoff is basically equivalent to gax.Backoff without the need for\n// the dependency.\ntype defaultBackoff struct {\n\tmax time.Duration\n\tmul float64\n\tcur time.Duration\n}\n\nfunc (b *defaultBackoff) Pause() time.Duration {\n\td := time.Duration(1 + rand.Int63n(int64(b.cur)))\n\tb.cur = time.Duration(float64(b.cur) * b.mul)\n\tif b.cur > b.max {\n\t\tb.cur = b.max\n\t}\n\treturn d\n}\n\n// sleep is the equivalent of gax.Sleep without the need for the dependency.\nfunc sleep(ctx context.Context, d time.Duration) error {\n\tt := time.NewTimer(d)\n\tselect {\n\tcase <-ctx.Done():\n\t\tt.Stop()\n\t\treturn ctx.Err()\n\tcase <-t.C:\n\t\treturn nil\n\t}\n}\n\nfunc newRetryer() *metadataRetryer {\n\treturn &metadataRetryer{bo: &defaultBackoff{\n\t\tcur: 100 * time.Millisecond,\n\t\tmax: 30 * time.Second,\n\t\tmul: 2,\n\t}}\n}\n\ntype backoff interface {\n\tPause() time.Duration\n}\n\ntype metadataRetryer struct {\n\tbo       backoff\n\tattempts int\n}\n\nfunc (r *metadataRetryer) Retry(status int, err error) (time.Duration, bool) {\n\tif status == http.StatusOK {\n\t\treturn 0, false\n\t}\n\tretryOk := shouldRetry(status, err)\n\tif !retryOk {\n\t\treturn 0, false\n\t}\n\tif r.attempts == maxRetryAttempts {\n\t\treturn 0, false\n\t}\n\tr.attempts++\n\treturn r.bo.Pause(), true\n}\n\nfunc shouldRetry(status int, err error) bool {\n\tif 500 <= status && status <= 599 {\n\t\treturn true\n\t}\n\tif err == io.ErrUnexpectedEOF {\n\t\treturn true\n\t}\n\t// Transient network errors should be retried.\n\tif syscallRetryable(err) {\n\t\treturn true\n\t}\n\tif err, ok := err.(interface{ Temporary() bool }); ok {\n\t\tif err.Temporary() {\n\t\t\treturn true\n\t\t}\n\t}\n\tif err, ok := err.(interface{ Unwrap() error }); ok {\n\t\treturn shouldRetry(status, err.Unwrap())\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/retry_linux.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//go:build linux\n// +build linux\n\npackage metadata\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n)\n\nfunc init() {\n\t// Initialize syscallRetryable to return true on transient socket-level\n\t// errors. These errors are specific to Linux.\n\tsyscallRetryable = func(err error) bool {\n\t\treturn errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.ECONNREFUSED)\n\t}\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/syscheck.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//go:build !windows && !linux\n\npackage metadata\n\n// systemInfoSuggestsGCE reports whether the local system (without\n// doing network requests) suggests that we're running on GCE. If this\n// returns true, testOnGCE tries a bit harder to reach its metadata\n// server.\nfunc systemInfoSuggestsGCE() bool {\n\t// We don't currently have checks for other GOOS\n\treturn false\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//go:build linux\n\npackage metadata\n\nimport (\n\t\"os\"\n\t\"strings\"\n)\n\nfunc systemInfoSuggestsGCE() bool {\n\tb, _ := os.ReadFile(\"/sys/class/dmi/id/product_name\")\n\tname := strings.TrimSpace(string(b))\n\treturn name == \"Google\" || name == \"Google Compute Engine\"\n}\n"
  },
  {
    "path": "vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//go:build windows\n\npackage metadata\n\nimport (\n\t\"strings\"\n\n\t\"golang.org/x/sys/windows/registry\"\n)\n\nfunc systemInfoSuggestsGCE() bool {\n\tk, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\\HardwareConfig\\Current`, registry.QUERY_VALUE)\n\tif err != nil {\n\t\treturn false\n\t}\n\tdefer k.Close()\n\n\ts, _, err := k.GetStringValue(\"SystemProductName\")\n\tif err != nil {\n\t\treturn false\n\t}\n\ts = strings.TrimSpace(s)\n\treturn strings.HasPrefix(s, \"Google\")\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/README.md",
    "content": "# filippo.io/edwards25519\n\n```\nimport \"filippo.io/edwards25519\"\n```\n\nThis library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives.\nRead the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519).\n\nThe code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality.\n\nMost users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative.\n\nSince this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements.\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/doc.go",
    "content": "// Copyright (c) 2021 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package edwards25519 implements group logic for the twisted Edwards curve\n//\n//\t-x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2\n//\n// This is better known as the Edwards curve equivalent to Curve25519, and is\n// the curve used by the Ed25519 signature scheme.\n//\n// Most users don't need this package, and should instead use crypto/ed25519 for\n// signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or\n// github.com/gtank/ristretto255 for prime order group logic.\n//\n// However, developers who do need to interact with low-level edwards25519\n// operations can use this package, which is an extended version of\n// crypto/internal/edwards25519 from the standard library repackaged as\n// an importable module.\npackage edwards25519\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/edwards25519.go",
    "content": "// Copyright (c) 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage edwards25519\n\nimport (\n\t\"errors\"\n\n\t\"filippo.io/edwards25519/field\"\n)\n\n// Point types.\n\ntype projP1xP1 struct {\n\tX, Y, Z, T field.Element\n}\n\ntype projP2 struct {\n\tX, Y, Z field.Element\n}\n\n// Point represents a point on the edwards25519 curve.\n//\n// This type works similarly to math/big.Int, and all arguments and receivers\n// are allowed to alias.\n//\n// The zero value is NOT valid, and it may be used only as a receiver.\ntype Point struct {\n\t// Make the type not comparable (i.e. used with == or as a map key), as\n\t// equivalent points can be represented by different Go values.\n\t_ incomparable\n\n\t// The point is internally represented in extended coordinates (X, Y, Z, T)\n\t// where x = X/Z, y = Y/Z, and xy = T/Z per https://eprint.iacr.org/2008/522.\n\tx, y, z, t field.Element\n}\n\ntype incomparable [0]func()\n\nfunc checkInitialized(points ...*Point) {\n\tfor _, p := range points {\n\t\tif p.x == (field.Element{}) && p.y == (field.Element{}) {\n\t\t\tpanic(\"edwards25519: use of uninitialized Point\")\n\t\t}\n\t}\n}\n\ntype projCached struct {\n\tYplusX, YminusX, Z, T2d field.Element\n}\n\ntype affineCached struct {\n\tYplusX, YminusX, T2d field.Element\n}\n\n// Constructors.\n\nfunc (v *projP2) Zero() *projP2 {\n\tv.X.Zero()\n\tv.Y.One()\n\tv.Z.One()\n\treturn v\n}\n\n// identity is the point at infinity.\nvar identity, _ = new(Point).SetBytes([]byte{\n\t1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})\n\n// NewIdentityPoint returns a new Point set to the identity.\nfunc NewIdentityPoint() *Point {\n\treturn new(Point).Set(identity)\n}\n\n// generator is the canonical curve basepoint. See TestGenerator for the\n// correspondence of this encoding with the values in RFC 8032.\nvar generator, _ = new(Point).SetBytes([]byte{\n\t0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,\n\t0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,\n\t0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,\n\t0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66})\n\n// NewGeneratorPoint returns a new Point set to the canonical generator.\nfunc NewGeneratorPoint() *Point {\n\treturn new(Point).Set(generator)\n}\n\nfunc (v *projCached) Zero() *projCached {\n\tv.YplusX.One()\n\tv.YminusX.One()\n\tv.Z.One()\n\tv.T2d.Zero()\n\treturn v\n}\n\nfunc (v *affineCached) Zero() *affineCached {\n\tv.YplusX.One()\n\tv.YminusX.One()\n\tv.T2d.Zero()\n\treturn v\n}\n\n// Assignments.\n\n// Set sets v = u, and returns v.\nfunc (v *Point) Set(u *Point) *Point {\n\t*v = *u\n\treturn v\n}\n\n// Encoding.\n\n// Bytes returns the canonical 32-byte encoding of v, according to RFC 8032,\n// Section 5.1.2.\nfunc (v *Point) Bytes() []byte {\n\t// This function is outlined to make the allocations inline in the caller\n\t// rather than happen on the heap.\n\tvar buf [32]byte\n\treturn v.bytes(&buf)\n}\n\nfunc (v *Point) bytes(buf *[32]byte) []byte {\n\tcheckInitialized(v)\n\n\tvar zInv, x, y field.Element\n\tzInv.Invert(&v.z)       // zInv = 1 / Z\n\tx.Multiply(&v.x, &zInv) // x = X / Z\n\ty.Multiply(&v.y, &zInv) // y = Y / Z\n\n\tout := copyFieldElement(buf, &y)\n\tout[31] |= byte(x.IsNegative() << 7)\n\treturn out\n}\n\nvar feOne = new(field.Element).One()\n\n// SetBytes sets v = x, where x is a 32-byte encoding of v. If x does not\n// represent a valid point on the curve, SetBytes returns nil and an error and\n// the receiver is unchanged. Otherwise, SetBytes returns v.\n//\n// Note that SetBytes accepts all non-canonical encodings of valid points.\n// That is, it follows decoding rules that match most implementations in\n// the ecosystem rather than RFC 8032.\nfunc (v *Point) SetBytes(x []byte) (*Point, error) {\n\t// Specifically, the non-canonical encodings that are accepted are\n\t//   1) the ones where the field element is not reduced (see the\n\t//      (*field.Element).SetBytes docs) and\n\t//   2) the ones where the x-coordinate is zero and the sign bit is set.\n\t//\n\t// Read more at https://hdevalence.ca/blog/2020-10-04-its-25519am,\n\t// specifically the \"Canonical A, R\" section.\n\n\ty, err := new(field.Element).SetBytes(x)\n\tif err != nil {\n\t\treturn nil, errors.New(\"edwards25519: invalid point encoding length\")\n\t}\n\n\t// -x² + y² = 1 + dx²y²\n\t// x² + dx²y² = x²(dy² + 1) = y² - 1\n\t// x² = (y² - 1) / (dy² + 1)\n\n\t// u = y² - 1\n\ty2 := new(field.Element).Square(y)\n\tu := new(field.Element).Subtract(y2, feOne)\n\n\t// v = dy² + 1\n\tvv := new(field.Element).Multiply(y2, d)\n\tvv = vv.Add(vv, feOne)\n\n\t// x = +√(u/v)\n\txx, wasSquare := new(field.Element).SqrtRatio(u, vv)\n\tif wasSquare == 0 {\n\t\treturn nil, errors.New(\"edwards25519: invalid point encoding\")\n\t}\n\n\t// Select the negative square root if the sign bit is set.\n\txxNeg := new(field.Element).Negate(xx)\n\txx = xx.Select(xxNeg, xx, int(x[31]>>7))\n\n\tv.x.Set(xx)\n\tv.y.Set(y)\n\tv.z.One()\n\tv.t.Multiply(xx, y) // xy = T / Z\n\n\treturn v, nil\n}\n\nfunc copyFieldElement(buf *[32]byte, v *field.Element) []byte {\n\tcopy(buf[:], v.Bytes())\n\treturn buf[:]\n}\n\n// Conversions.\n\nfunc (v *projP2) FromP1xP1(p *projP1xP1) *projP2 {\n\tv.X.Multiply(&p.X, &p.T)\n\tv.Y.Multiply(&p.Y, &p.Z)\n\tv.Z.Multiply(&p.Z, &p.T)\n\treturn v\n}\n\nfunc (v *projP2) FromP3(p *Point) *projP2 {\n\tv.X.Set(&p.x)\n\tv.Y.Set(&p.y)\n\tv.Z.Set(&p.z)\n\treturn v\n}\n\nfunc (v *Point) fromP1xP1(p *projP1xP1) *Point {\n\tv.x.Multiply(&p.X, &p.T)\n\tv.y.Multiply(&p.Y, &p.Z)\n\tv.z.Multiply(&p.Z, &p.T)\n\tv.t.Multiply(&p.X, &p.Y)\n\treturn v\n}\n\nfunc (v *Point) fromP2(p *projP2) *Point {\n\tv.x.Multiply(&p.X, &p.Z)\n\tv.y.Multiply(&p.Y, &p.Z)\n\tv.z.Square(&p.Z)\n\tv.t.Multiply(&p.X, &p.Y)\n\treturn v\n}\n\n// d is a constant in the curve equation.\nvar d, _ = new(field.Element).SetBytes([]byte{\n\t0xa3, 0x78, 0x59, 0x13, 0xca, 0x4d, 0xeb, 0x75,\n\t0xab, 0xd8, 0x41, 0x41, 0x4d, 0x0a, 0x70, 0x00,\n\t0x98, 0xe8, 0x79, 0x77, 0x79, 0x40, 0xc7, 0x8c,\n\t0x73, 0xfe, 0x6f, 0x2b, 0xee, 0x6c, 0x03, 0x52})\nvar d2 = new(field.Element).Add(d, d)\n\nfunc (v *projCached) FromP3(p *Point) *projCached {\n\tv.YplusX.Add(&p.y, &p.x)\n\tv.YminusX.Subtract(&p.y, &p.x)\n\tv.Z.Set(&p.z)\n\tv.T2d.Multiply(&p.t, d2)\n\treturn v\n}\n\nfunc (v *affineCached) FromP3(p *Point) *affineCached {\n\tv.YplusX.Add(&p.y, &p.x)\n\tv.YminusX.Subtract(&p.y, &p.x)\n\tv.T2d.Multiply(&p.t, d2)\n\n\tvar invZ field.Element\n\tinvZ.Invert(&p.z)\n\tv.YplusX.Multiply(&v.YplusX, &invZ)\n\tv.YminusX.Multiply(&v.YminusX, &invZ)\n\tv.T2d.Multiply(&v.T2d, &invZ)\n\treturn v\n}\n\n// (Re)addition and subtraction.\n\n// Add sets v = p + q, and returns v.\nfunc (v *Point) Add(p, q *Point) *Point {\n\tcheckInitialized(p, q)\n\tqCached := new(projCached).FromP3(q)\n\tresult := new(projP1xP1).Add(p, qCached)\n\treturn v.fromP1xP1(result)\n}\n\n// Subtract sets v = p - q, and returns v.\nfunc (v *Point) Subtract(p, q *Point) *Point {\n\tcheckInitialized(p, q)\n\tqCached := new(projCached).FromP3(q)\n\tresult := new(projP1xP1).Sub(p, qCached)\n\treturn v.fromP1xP1(result)\n}\n\nfunc (v *projP1xP1) Add(p *Point, q *projCached) *projP1xP1 {\n\tvar YplusX, YminusX, PP, MM, TT2d, ZZ2 field.Element\n\n\tYplusX.Add(&p.y, &p.x)\n\tYminusX.Subtract(&p.y, &p.x)\n\n\tPP.Multiply(&YplusX, &q.YplusX)\n\tMM.Multiply(&YminusX, &q.YminusX)\n\tTT2d.Multiply(&p.t, &q.T2d)\n\tZZ2.Multiply(&p.z, &q.Z)\n\n\tZZ2.Add(&ZZ2, &ZZ2)\n\n\tv.X.Subtract(&PP, &MM)\n\tv.Y.Add(&PP, &MM)\n\tv.Z.Add(&ZZ2, &TT2d)\n\tv.T.Subtract(&ZZ2, &TT2d)\n\treturn v\n}\n\nfunc (v *projP1xP1) Sub(p *Point, q *projCached) *projP1xP1 {\n\tvar YplusX, YminusX, PP, MM, TT2d, ZZ2 field.Element\n\n\tYplusX.Add(&p.y, &p.x)\n\tYminusX.Subtract(&p.y, &p.x)\n\n\tPP.Multiply(&YplusX, &q.YminusX) // flipped sign\n\tMM.Multiply(&YminusX, &q.YplusX) // flipped sign\n\tTT2d.Multiply(&p.t, &q.T2d)\n\tZZ2.Multiply(&p.z, &q.Z)\n\n\tZZ2.Add(&ZZ2, &ZZ2)\n\n\tv.X.Subtract(&PP, &MM)\n\tv.Y.Add(&PP, &MM)\n\tv.Z.Subtract(&ZZ2, &TT2d) // flipped sign\n\tv.T.Add(&ZZ2, &TT2d)      // flipped sign\n\treturn v\n}\n\nfunc (v *projP1xP1) AddAffine(p *Point, q *affineCached) *projP1xP1 {\n\tvar YplusX, YminusX, PP, MM, TT2d, Z2 field.Element\n\n\tYplusX.Add(&p.y, &p.x)\n\tYminusX.Subtract(&p.y, &p.x)\n\n\tPP.Multiply(&YplusX, &q.YplusX)\n\tMM.Multiply(&YminusX, &q.YminusX)\n\tTT2d.Multiply(&p.t, &q.T2d)\n\n\tZ2.Add(&p.z, &p.z)\n\n\tv.X.Subtract(&PP, &MM)\n\tv.Y.Add(&PP, &MM)\n\tv.Z.Add(&Z2, &TT2d)\n\tv.T.Subtract(&Z2, &TT2d)\n\treturn v\n}\n\nfunc (v *projP1xP1) SubAffine(p *Point, q *affineCached) *projP1xP1 {\n\tvar YplusX, YminusX, PP, MM, TT2d, Z2 field.Element\n\n\tYplusX.Add(&p.y, &p.x)\n\tYminusX.Subtract(&p.y, &p.x)\n\n\tPP.Multiply(&YplusX, &q.YminusX) // flipped sign\n\tMM.Multiply(&YminusX, &q.YplusX) // flipped sign\n\tTT2d.Multiply(&p.t, &q.T2d)\n\n\tZ2.Add(&p.z, &p.z)\n\n\tv.X.Subtract(&PP, &MM)\n\tv.Y.Add(&PP, &MM)\n\tv.Z.Subtract(&Z2, &TT2d) // flipped sign\n\tv.T.Add(&Z2, &TT2d)      // flipped sign\n\treturn v\n}\n\n// Doubling.\n\nfunc (v *projP1xP1) Double(p *projP2) *projP1xP1 {\n\tvar XX, YY, ZZ2, XplusYsq field.Element\n\n\tXX.Square(&p.X)\n\tYY.Square(&p.Y)\n\tZZ2.Square(&p.Z)\n\tZZ2.Add(&ZZ2, &ZZ2)\n\tXplusYsq.Add(&p.X, &p.Y)\n\tXplusYsq.Square(&XplusYsq)\n\n\tv.Y.Add(&YY, &XX)\n\tv.Z.Subtract(&YY, &XX)\n\n\tv.X.Subtract(&XplusYsq, &v.Y)\n\tv.T.Subtract(&ZZ2, &v.Z)\n\treturn v\n}\n\n// Negation.\n\n// Negate sets v = -p, and returns v.\nfunc (v *Point) Negate(p *Point) *Point {\n\tcheckInitialized(p)\n\tv.x.Negate(&p.x)\n\tv.y.Set(&p.y)\n\tv.z.Set(&p.z)\n\tv.t.Negate(&p.t)\n\treturn v\n}\n\n// Equal returns 1 if v is equivalent to u, and 0 otherwise.\nfunc (v *Point) Equal(u *Point) int {\n\tcheckInitialized(v, u)\n\n\tvar t1, t2, t3, t4 field.Element\n\tt1.Multiply(&v.x, &u.z)\n\tt2.Multiply(&u.x, &v.z)\n\tt3.Multiply(&v.y, &u.z)\n\tt4.Multiply(&u.y, &v.z)\n\n\treturn t1.Equal(&t2) & t3.Equal(&t4)\n}\n\n// Constant-time operations\n\n// Select sets v to a if cond == 1 and to b if cond == 0.\nfunc (v *projCached) Select(a, b *projCached, cond int) *projCached {\n\tv.YplusX.Select(&a.YplusX, &b.YplusX, cond)\n\tv.YminusX.Select(&a.YminusX, &b.YminusX, cond)\n\tv.Z.Select(&a.Z, &b.Z, cond)\n\tv.T2d.Select(&a.T2d, &b.T2d, cond)\n\treturn v\n}\n\n// Select sets v to a if cond == 1 and to b if cond == 0.\nfunc (v *affineCached) Select(a, b *affineCached, cond int) *affineCached {\n\tv.YplusX.Select(&a.YplusX, &b.YplusX, cond)\n\tv.YminusX.Select(&a.YminusX, &b.YminusX, cond)\n\tv.T2d.Select(&a.T2d, &b.T2d, cond)\n\treturn v\n}\n\n// CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0.\nfunc (v *projCached) CondNeg(cond int) *projCached {\n\tv.YplusX.Swap(&v.YminusX, cond)\n\tv.T2d.Select(new(field.Element).Negate(&v.T2d), &v.T2d, cond)\n\treturn v\n}\n\n// CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0.\nfunc (v *affineCached) CondNeg(cond int) *affineCached {\n\tv.YplusX.Swap(&v.YminusX, cond)\n\tv.T2d.Select(new(field.Element).Negate(&v.T2d), &v.T2d, cond)\n\treturn v\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/extra.go",
    "content": "// Copyright (c) 2021 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage edwards25519\n\n// This file contains additional functionality that is not included in the\n// upstream crypto/internal/edwards25519 package.\n\nimport (\n\t\"errors\"\n\n\t\"filippo.io/edwards25519/field\"\n)\n\n// ExtendedCoordinates returns v in extended coordinates (X:Y:Z:T) where\n// x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522.\nfunc (v *Point) ExtendedCoordinates() (X, Y, Z, T *field.Element) {\n\t// This function is outlined to make the allocations inline in the caller\n\t// rather than happen on the heap. Don't change the style without making\n\t// sure it doesn't increase the inliner cost.\n\tvar e [4]field.Element\n\tX, Y, Z, T = v.extendedCoordinates(&e)\n\treturn\n}\n\nfunc (v *Point) extendedCoordinates(e *[4]field.Element) (X, Y, Z, T *field.Element) {\n\tcheckInitialized(v)\n\tX = e[0].Set(&v.x)\n\tY = e[1].Set(&v.y)\n\tZ = e[2].Set(&v.z)\n\tT = e[3].Set(&v.t)\n\treturn\n}\n\n// SetExtendedCoordinates sets v = (X:Y:Z:T) in extended coordinates where\n// x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522.\n//\n// If the coordinates are invalid or don't represent a valid point on the curve,\n// SetExtendedCoordinates returns nil and an error and the receiver is\n// unchanged. Otherwise, SetExtendedCoordinates returns v.\nfunc (v *Point) SetExtendedCoordinates(X, Y, Z, T *field.Element) (*Point, error) {\n\tif !isOnCurve(X, Y, Z, T) {\n\t\treturn nil, errors.New(\"edwards25519: invalid point coordinates\")\n\t}\n\tv.x.Set(X)\n\tv.y.Set(Y)\n\tv.z.Set(Z)\n\tv.t.Set(T)\n\treturn v, nil\n}\n\nfunc isOnCurve(X, Y, Z, T *field.Element) bool {\n\tvar lhs, rhs field.Element\n\tXX := new(field.Element).Square(X)\n\tYY := new(field.Element).Square(Y)\n\tZZ := new(field.Element).Square(Z)\n\tTT := new(field.Element).Square(T)\n\t// -x² + y² = 1 + dx²y²\n\t// -(X/Z)² + (Y/Z)² = 1 + d(T/Z)²\n\t// -X² + Y² = Z² + dT²\n\tlhs.Subtract(YY, XX)\n\trhs.Multiply(d, TT).Add(&rhs, ZZ)\n\tif lhs.Equal(&rhs) != 1 {\n\t\treturn false\n\t}\n\t// xy = T/Z\n\t// XY/Z² = T/Z\n\t// XY = TZ\n\tlhs.Multiply(X, Y)\n\trhs.Multiply(T, Z)\n\treturn lhs.Equal(&rhs) == 1\n}\n\n// BytesMontgomery converts v to a point on the birationally-equivalent\n// Curve25519 Montgomery curve, and returns its canonical 32 bytes encoding\n// according to RFC 7748.\n//\n// Note that BytesMontgomery only encodes the u-coordinate, so v and -v encode\n// to the same value. If v is the identity point, BytesMontgomery returns 32\n// zero bytes, analogously to the X25519 function.\n//\n// The lack of an inverse operation (such as SetMontgomeryBytes) is deliberate:\n// while every valid edwards25519 point has a unique u-coordinate Montgomery\n// encoding, X25519 accepts inputs on the quadratic twist, which don't correspond\n// to any edwards25519 point, and every other X25519 input corresponds to two\n// edwards25519 points.\nfunc (v *Point) BytesMontgomery() []byte {\n\t// This function is outlined to make the allocations inline in the caller\n\t// rather than happen on the heap.\n\tvar buf [32]byte\n\treturn v.bytesMontgomery(&buf)\n}\n\nfunc (v *Point) bytesMontgomery(buf *[32]byte) []byte {\n\tcheckInitialized(v)\n\n\t// RFC 7748, Section 4.1 provides the bilinear map to calculate the\n\t// Montgomery u-coordinate\n\t//\n\t//              u = (1 + y) / (1 - y)\n\t//\n\t// where y = Y / Z.\n\n\tvar y, recip, u field.Element\n\n\ty.Multiply(&v.y, y.Invert(&v.z))        // y = Y / Z\n\trecip.Invert(recip.Subtract(feOne, &y)) // r = 1/(1 - y)\n\tu.Multiply(u.Add(feOne, &y), &recip)    // u = (1 + y)*r\n\n\treturn copyFieldElement(buf, &u)\n}\n\n// MultByCofactor sets v = 8 * p, and returns v.\nfunc (v *Point) MultByCofactor(p *Point) *Point {\n\tcheckInitialized(p)\n\tresult := projP1xP1{}\n\tpp := (&projP2{}).FromP3(p)\n\tresult.Double(pp)\n\tpp.FromP1xP1(&result)\n\tresult.Double(pp)\n\tpp.FromP1xP1(&result)\n\tresult.Double(pp)\n\treturn v.fromP1xP1(&result)\n}\n\n// Given k > 0, set s = s**(2*i).\nfunc (s *Scalar) pow2k(k int) {\n\tfor i := 0; i < k; i++ {\n\t\ts.Multiply(s, s)\n\t}\n}\n\n// Invert sets s to the inverse of a nonzero scalar v, and returns s.\n//\n// If t is zero, Invert returns zero.\nfunc (s *Scalar) Invert(t *Scalar) *Scalar {\n\t// Uses a hardcoded sliding window of width 4.\n\tvar table [8]Scalar\n\tvar tt Scalar\n\ttt.Multiply(t, t)\n\ttable[0] = *t\n\tfor i := 0; i < 7; i++ {\n\t\ttable[i+1].Multiply(&table[i], &tt)\n\t}\n\t// Now table = [t**1, t**3, t**5, t**7, t**9, t**11, t**13, t**15]\n\t// so t**k = t[k/2] for odd k\n\n\t// To compute the sliding window digits, use the following Sage script:\n\n\t// sage: import itertools\n\t// sage: def sliding_window(w,k):\n\t// ....:     digits = []\n\t// ....:     while k > 0:\n\t// ....:         if k % 2 == 1:\n\t// ....:             kmod = k % (2**w)\n\t// ....:             digits.append(kmod)\n\t// ....:             k = k - kmod\n\t// ....:         else:\n\t// ....:             digits.append(0)\n\t// ....:         k = k // 2\n\t// ....:     return digits\n\n\t// Now we can compute s roughly as follows:\n\n\t// sage: s = 1\n\t// sage: for coeff in reversed(sliding_window(4,l-2)):\n\t// ....:     s = s*s\n\t// ....:     if coeff > 0 :\n\t// ....:         s = s*t**coeff\n\n\t// This works on one bit at a time, with many runs of zeros.\n\t// The digits can be collapsed into [(count, coeff)] as follows:\n\n\t// sage: [(len(list(group)),d) for d,group in itertools.groupby(sliding_window(4,l-2))]\n\n\t// Entries of the form (k, 0) turn into pow2k(k)\n\t// Entries of the form (1, coeff) turn into a squaring and then a table lookup.\n\t// We can fold the squaring into the previous pow2k(k) as pow2k(k+1).\n\n\t*s = table[1/2]\n\ts.pow2k(127 + 1)\n\ts.Multiply(s, &table[1/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[9/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[11/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[13/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[15/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[7/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[15/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[5/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[1/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[15/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[15/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[7/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[3/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[11/2])\n\ts.pow2k(5 + 1)\n\ts.Multiply(s, &table[11/2])\n\ts.pow2k(9 + 1)\n\ts.Multiply(s, &table[9/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[3/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[3/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[3/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[9/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[7/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[3/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[13/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[7/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[9/2])\n\ts.pow2k(3 + 1)\n\ts.Multiply(s, &table[15/2])\n\ts.pow2k(4 + 1)\n\ts.Multiply(s, &table[11/2])\n\n\treturn s\n}\n\n// MultiScalarMult sets v = sum(scalars[i] * points[i]), and returns v.\n//\n// Execution time depends only on the lengths of the two slices, which must match.\nfunc (v *Point) MultiScalarMult(scalars []*Scalar, points []*Point) *Point {\n\tif len(scalars) != len(points) {\n\t\tpanic(\"edwards25519: called MultiScalarMult with different size inputs\")\n\t}\n\tcheckInitialized(points...)\n\n\t// Proceed as in the single-base case, but share doublings\n\t// between each point in the multiscalar equation.\n\n\t// Build lookup tables for each point\n\ttables := make([]projLookupTable, len(points))\n\tfor i := range tables {\n\t\ttables[i].FromP3(points[i])\n\t}\n\t// Compute signed radix-16 digits for each scalar\n\tdigits := make([][64]int8, len(scalars))\n\tfor i := range digits {\n\t\tdigits[i] = scalars[i].signedRadix16()\n\t}\n\n\t// Unwrap first loop iteration to save computing 16*identity\n\tmultiple := &projCached{}\n\ttmp1 := &projP1xP1{}\n\ttmp2 := &projP2{}\n\t// Lookup-and-add the appropriate multiple of each input point\n\tfor j := range tables {\n\t\ttables[j].SelectInto(multiple, digits[j][63])\n\t\ttmp1.Add(v, multiple) // tmp1 = v + x_(j,63)*Q in P1xP1 coords\n\t\tv.fromP1xP1(tmp1)     // update v\n\t}\n\ttmp2.FromP3(v) // set up tmp2 = v in P2 coords for next iteration\n\tfor i := 62; i >= 0; i-- {\n\t\ttmp1.Double(tmp2)    // tmp1 =  2*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  2*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 =  4*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  4*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 =  8*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  8*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 = 16*(prev) in P1xP1 coords\n\t\tv.fromP1xP1(tmp1)    //    v = 16*(prev) in P3 coords\n\t\t// Lookup-and-add the appropriate multiple of each input point\n\t\tfor j := range tables {\n\t\t\ttables[j].SelectInto(multiple, digits[j][i])\n\t\t\ttmp1.Add(v, multiple) // tmp1 = v + x_(j,i)*Q in P1xP1 coords\n\t\t\tv.fromP1xP1(tmp1)     // update v\n\t\t}\n\t\ttmp2.FromP3(v) // set up tmp2 = v in P2 coords for next iteration\n\t}\n\treturn v\n}\n\n// VarTimeMultiScalarMult sets v = sum(scalars[i] * points[i]), and returns v.\n//\n// Execution time depends on the inputs.\nfunc (v *Point) VarTimeMultiScalarMult(scalars []*Scalar, points []*Point) *Point {\n\tif len(scalars) != len(points) {\n\t\tpanic(\"edwards25519: called VarTimeMultiScalarMult with different size inputs\")\n\t}\n\tcheckInitialized(points...)\n\n\t// Generalize double-base NAF computation to arbitrary sizes.\n\t// Here all the points are dynamic, so we only use the smaller\n\t// tables.\n\n\t// Build lookup tables for each point\n\ttables := make([]nafLookupTable5, len(points))\n\tfor i := range tables {\n\t\ttables[i].FromP3(points[i])\n\t}\n\t// Compute a NAF for each scalar\n\tnafs := make([][256]int8, len(scalars))\n\tfor i := range nafs {\n\t\tnafs[i] = scalars[i].nonAdjacentForm(5)\n\t}\n\n\tmultiple := &projCached{}\n\ttmp1 := &projP1xP1{}\n\ttmp2 := &projP2{}\n\ttmp2.Zero()\n\n\t// Move from high to low bits, doubling the accumulator\n\t// at each iteration and checking whether there is a nonzero\n\t// coefficient to look up a multiple of.\n\t//\n\t// Skip trying to find the first nonzero coefficent, because\n\t// searching might be more work than a few extra doublings.\n\tfor i := 255; i >= 0; i-- {\n\t\ttmp1.Double(tmp2)\n\n\t\tfor j := range nafs {\n\t\t\tif nafs[j][i] > 0 {\n\t\t\t\tv.fromP1xP1(tmp1)\n\t\t\t\ttables[j].SelectInto(multiple, nafs[j][i])\n\t\t\t\ttmp1.Add(v, multiple)\n\t\t\t} else if nafs[j][i] < 0 {\n\t\t\t\tv.fromP1xP1(tmp1)\n\t\t\t\ttables[j].SelectInto(multiple, -nafs[j][i])\n\t\t\t\ttmp1.Sub(v, multiple)\n\t\t\t}\n\t\t}\n\n\t\ttmp2.FromP1xP1(tmp1)\n\t}\n\n\tv.fromP2(tmp2)\n\treturn v\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe.go",
    "content": "// Copyright (c) 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package field implements fast arithmetic modulo 2^255-19.\npackage field\n\nimport (\n\t\"crypto/subtle\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"math/bits\"\n)\n\n// Element represents an element of the field GF(2^255-19). Note that this\n// is not a cryptographically secure group, and should only be used to interact\n// with edwards25519.Point coordinates.\n//\n// This type works similarly to math/big.Int, and all arguments and receivers\n// are allowed to alias.\n//\n// The zero value is a valid zero element.\ntype Element struct {\n\t// An element t represents the integer\n\t//     t.l0 + t.l1*2^51 + t.l2*2^102 + t.l3*2^153 + t.l4*2^204\n\t//\n\t// Between operations, all limbs are expected to be lower than 2^52.\n\tl0 uint64\n\tl1 uint64\n\tl2 uint64\n\tl3 uint64\n\tl4 uint64\n}\n\nconst maskLow51Bits uint64 = (1 << 51) - 1\n\nvar feZero = &Element{0, 0, 0, 0, 0}\n\n// Zero sets v = 0, and returns v.\nfunc (v *Element) Zero() *Element {\n\t*v = *feZero\n\treturn v\n}\n\nvar feOne = &Element{1, 0, 0, 0, 0}\n\n// One sets v = 1, and returns v.\nfunc (v *Element) One() *Element {\n\t*v = *feOne\n\treturn v\n}\n\n// reduce reduces v modulo 2^255 - 19 and returns it.\nfunc (v *Element) reduce() *Element {\n\tv.carryPropagate()\n\n\t// After the light reduction we now have a field element representation\n\t// v < 2^255 + 2^13 * 19, but need v < 2^255 - 19.\n\n\t// If v >= 2^255 - 19, then v + 19 >= 2^255, which would overflow 2^255 - 1,\n\t// generating a carry. That is, c will be 0 if v < 2^255 - 19, and 1 otherwise.\n\tc := (v.l0 + 19) >> 51\n\tc = (v.l1 + c) >> 51\n\tc = (v.l2 + c) >> 51\n\tc = (v.l3 + c) >> 51\n\tc = (v.l4 + c) >> 51\n\n\t// If v < 2^255 - 19 and c = 0, this will be a no-op. Otherwise, it's\n\t// effectively applying the reduction identity to the carry.\n\tv.l0 += 19 * c\n\n\tv.l1 += v.l0 >> 51\n\tv.l0 = v.l0 & maskLow51Bits\n\tv.l2 += v.l1 >> 51\n\tv.l1 = v.l1 & maskLow51Bits\n\tv.l3 += v.l2 >> 51\n\tv.l2 = v.l2 & maskLow51Bits\n\tv.l4 += v.l3 >> 51\n\tv.l3 = v.l3 & maskLow51Bits\n\t// no additional carry\n\tv.l4 = v.l4 & maskLow51Bits\n\n\treturn v\n}\n\n// Add sets v = a + b, and returns v.\nfunc (v *Element) Add(a, b *Element) *Element {\n\tv.l0 = a.l0 + b.l0\n\tv.l1 = a.l1 + b.l1\n\tv.l2 = a.l2 + b.l2\n\tv.l3 = a.l3 + b.l3\n\tv.l4 = a.l4 + b.l4\n\t// Using the generic implementation here is actually faster than the\n\t// assembly. Probably because the body of this function is so simple that\n\t// the compiler can figure out better optimizations by inlining the carry\n\t// propagation.\n\treturn v.carryPropagateGeneric()\n}\n\n// Subtract sets v = a - b, and returns v.\nfunc (v *Element) Subtract(a, b *Element) *Element {\n\t// We first add 2 * p, to guarantee the subtraction won't underflow, and\n\t// then subtract b (which can be up to 2^255 + 2^13 * 19).\n\tv.l0 = (a.l0 + 0xFFFFFFFFFFFDA) - b.l0\n\tv.l1 = (a.l1 + 0xFFFFFFFFFFFFE) - b.l1\n\tv.l2 = (a.l2 + 0xFFFFFFFFFFFFE) - b.l2\n\tv.l3 = (a.l3 + 0xFFFFFFFFFFFFE) - b.l3\n\tv.l4 = (a.l4 + 0xFFFFFFFFFFFFE) - b.l4\n\treturn v.carryPropagate()\n}\n\n// Negate sets v = -a, and returns v.\nfunc (v *Element) Negate(a *Element) *Element {\n\treturn v.Subtract(feZero, a)\n}\n\n// Invert sets v = 1/z mod p, and returns v.\n//\n// If z == 0, Invert returns v = 0.\nfunc (v *Element) Invert(z *Element) *Element {\n\t// Inversion is implemented as exponentiation with exponent p − 2. It uses the\n\t// same sequence of 255 squarings and 11 multiplications as [Curve25519].\n\tvar z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element\n\n\tz2.Square(z)             // 2\n\tt.Square(&z2)            // 4\n\tt.Square(&t)             // 8\n\tz9.Multiply(&t, z)       // 9\n\tz11.Multiply(&z9, &z2)   // 11\n\tt.Square(&z11)           // 22\n\tz2_5_0.Multiply(&t, &z9) // 31 = 2^5 - 2^0\n\n\tt.Square(&z2_5_0) // 2^6 - 2^1\n\tfor i := 0; i < 4; i++ {\n\t\tt.Square(&t) // 2^10 - 2^5\n\t}\n\tz2_10_0.Multiply(&t, &z2_5_0) // 2^10 - 2^0\n\n\tt.Square(&z2_10_0) // 2^11 - 2^1\n\tfor i := 0; i < 9; i++ {\n\t\tt.Square(&t) // 2^20 - 2^10\n\t}\n\tz2_20_0.Multiply(&t, &z2_10_0) // 2^20 - 2^0\n\n\tt.Square(&z2_20_0) // 2^21 - 2^1\n\tfor i := 0; i < 19; i++ {\n\t\tt.Square(&t) // 2^40 - 2^20\n\t}\n\tt.Multiply(&t, &z2_20_0) // 2^40 - 2^0\n\n\tt.Square(&t) // 2^41 - 2^1\n\tfor i := 0; i < 9; i++ {\n\t\tt.Square(&t) // 2^50 - 2^10\n\t}\n\tz2_50_0.Multiply(&t, &z2_10_0) // 2^50 - 2^0\n\n\tt.Square(&z2_50_0) // 2^51 - 2^1\n\tfor i := 0; i < 49; i++ {\n\t\tt.Square(&t) // 2^100 - 2^50\n\t}\n\tz2_100_0.Multiply(&t, &z2_50_0) // 2^100 - 2^0\n\n\tt.Square(&z2_100_0) // 2^101 - 2^1\n\tfor i := 0; i < 99; i++ {\n\t\tt.Square(&t) // 2^200 - 2^100\n\t}\n\tt.Multiply(&t, &z2_100_0) // 2^200 - 2^0\n\n\tt.Square(&t) // 2^201 - 2^1\n\tfor i := 0; i < 49; i++ {\n\t\tt.Square(&t) // 2^250 - 2^50\n\t}\n\tt.Multiply(&t, &z2_50_0) // 2^250 - 2^0\n\n\tt.Square(&t) // 2^251 - 2^1\n\tt.Square(&t) // 2^252 - 2^2\n\tt.Square(&t) // 2^253 - 2^3\n\tt.Square(&t) // 2^254 - 2^4\n\tt.Square(&t) // 2^255 - 2^5\n\n\treturn v.Multiply(&t, &z11) // 2^255 - 21\n}\n\n// Set sets v = a, and returns v.\nfunc (v *Element) Set(a *Element) *Element {\n\t*v = *a\n\treturn v\n}\n\n// SetBytes sets v to x, where x is a 32-byte little-endian encoding. If x is\n// not of the right length, SetBytes returns nil and an error, and the\n// receiver is unchanged.\n//\n// Consistent with RFC 7748, the most significant bit (the high bit of the\n// last byte) is ignored, and non-canonical values (2^255-19 through 2^255-1)\n// are accepted. Note that this is laxer than specified by RFC 8032, but\n// consistent with most Ed25519 implementations.\nfunc (v *Element) SetBytes(x []byte) (*Element, error) {\n\tif len(x) != 32 {\n\t\treturn nil, errors.New(\"edwards25519: invalid field element input size\")\n\t}\n\n\t// Bits 0:51 (bytes 0:8, bits 0:64, shift 0, mask 51).\n\tv.l0 = binary.LittleEndian.Uint64(x[0:8])\n\tv.l0 &= maskLow51Bits\n\t// Bits 51:102 (bytes 6:14, bits 48:112, shift 3, mask 51).\n\tv.l1 = binary.LittleEndian.Uint64(x[6:14]) >> 3\n\tv.l1 &= maskLow51Bits\n\t// Bits 102:153 (bytes 12:20, bits 96:160, shift 6, mask 51).\n\tv.l2 = binary.LittleEndian.Uint64(x[12:20]) >> 6\n\tv.l2 &= maskLow51Bits\n\t// Bits 153:204 (bytes 19:27, bits 152:216, shift 1, mask 51).\n\tv.l3 = binary.LittleEndian.Uint64(x[19:27]) >> 1\n\tv.l3 &= maskLow51Bits\n\t// Bits 204:255 (bytes 24:32, bits 192:256, shift 12, mask 51).\n\t// Note: not bytes 25:33, shift 4, to avoid overread.\n\tv.l4 = binary.LittleEndian.Uint64(x[24:32]) >> 12\n\tv.l4 &= maskLow51Bits\n\n\treturn v, nil\n}\n\n// Bytes returns the canonical 32-byte little-endian encoding of v.\nfunc (v *Element) Bytes() []byte {\n\t// This function is outlined to make the allocations inline in the caller\n\t// rather than happen on the heap.\n\tvar out [32]byte\n\treturn v.bytes(&out)\n}\n\nfunc (v *Element) bytes(out *[32]byte) []byte {\n\tt := *v\n\tt.reduce()\n\n\tvar buf [8]byte\n\tfor i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} {\n\t\tbitsOffset := i * 51\n\t\tbinary.LittleEndian.PutUint64(buf[:], l<<uint(bitsOffset%8))\n\t\tfor i, bb := range buf {\n\t\t\toff := bitsOffset/8 + i\n\t\t\tif off >= len(out) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tout[off] |= bb\n\t\t}\n\t}\n\n\treturn out[:]\n}\n\n// Equal returns 1 if v and u are equal, and 0 otherwise.\nfunc (v *Element) Equal(u *Element) int {\n\tsa, sv := u.Bytes(), v.Bytes()\n\treturn subtle.ConstantTimeCompare(sa, sv)\n}\n\n// mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise.\nfunc mask64Bits(cond int) uint64 { return ^(uint64(cond) - 1) }\n\n// Select sets v to a if cond == 1, and to b if cond == 0.\nfunc (v *Element) Select(a, b *Element, cond int) *Element {\n\tm := mask64Bits(cond)\n\tv.l0 = (m & a.l0) | (^m & b.l0)\n\tv.l1 = (m & a.l1) | (^m & b.l1)\n\tv.l2 = (m & a.l2) | (^m & b.l2)\n\tv.l3 = (m & a.l3) | (^m & b.l3)\n\tv.l4 = (m & a.l4) | (^m & b.l4)\n\treturn v\n}\n\n// Swap swaps v and u if cond == 1 or leaves them unchanged if cond == 0, and returns v.\nfunc (v *Element) Swap(u *Element, cond int) {\n\tm := mask64Bits(cond)\n\tt := m & (v.l0 ^ u.l0)\n\tv.l0 ^= t\n\tu.l0 ^= t\n\tt = m & (v.l1 ^ u.l1)\n\tv.l1 ^= t\n\tu.l1 ^= t\n\tt = m & (v.l2 ^ u.l2)\n\tv.l2 ^= t\n\tu.l2 ^= t\n\tt = m & (v.l3 ^ u.l3)\n\tv.l3 ^= t\n\tu.l3 ^= t\n\tt = m & (v.l4 ^ u.l4)\n\tv.l4 ^= t\n\tu.l4 ^= t\n}\n\n// IsNegative returns 1 if v is negative, and 0 otherwise.\nfunc (v *Element) IsNegative() int {\n\treturn int(v.Bytes()[0] & 1)\n}\n\n// Absolute sets v to |u|, and returns v.\nfunc (v *Element) Absolute(u *Element) *Element {\n\treturn v.Select(new(Element).Negate(u), u, u.IsNegative())\n}\n\n// Multiply sets v = x * y, and returns v.\nfunc (v *Element) Multiply(x, y *Element) *Element {\n\tfeMul(v, x, y)\n\treturn v\n}\n\n// Square sets v = x * x, and returns v.\nfunc (v *Element) Square(x *Element) *Element {\n\tfeSquare(v, x)\n\treturn v\n}\n\n// Mult32 sets v = x * y, and returns v.\nfunc (v *Element) Mult32(x *Element, y uint32) *Element {\n\tx0lo, x0hi := mul51(x.l0, y)\n\tx1lo, x1hi := mul51(x.l1, y)\n\tx2lo, x2hi := mul51(x.l2, y)\n\tx3lo, x3hi := mul51(x.l3, y)\n\tx4lo, x4hi := mul51(x.l4, y)\n\tv.l0 = x0lo + 19*x4hi // carried over per the reduction identity\n\tv.l1 = x1lo + x0hi\n\tv.l2 = x2lo + x1hi\n\tv.l3 = x3lo + x2hi\n\tv.l4 = x4lo + x3hi\n\t// The hi portions are going to be only 32 bits, plus any previous excess,\n\t// so we can skip the carry propagation.\n\treturn v\n}\n\n// mul51 returns lo + hi * 2⁵¹ = a * b.\nfunc mul51(a uint64, b uint32) (lo uint64, hi uint64) {\n\tmh, ml := bits.Mul64(a, uint64(b))\n\tlo = ml & maskLow51Bits\n\thi = (mh << 13) | (ml >> 51)\n\treturn\n}\n\n// Pow22523 set v = x^((p-5)/8), and returns v. (p-5)/8 is 2^252-3.\nfunc (v *Element) Pow22523(x *Element) *Element {\n\tvar t0, t1, t2 Element\n\n\tt0.Square(x)             // x^2\n\tt1.Square(&t0)           // x^4\n\tt1.Square(&t1)           // x^8\n\tt1.Multiply(x, &t1)      // x^9\n\tt0.Multiply(&t0, &t1)    // x^11\n\tt0.Square(&t0)           // x^22\n\tt0.Multiply(&t1, &t0)    // x^31\n\tt1.Square(&t0)           // x^62\n\tfor i := 1; i < 5; i++ { // x^992\n\t\tt1.Square(&t1)\n\t}\n\tt0.Multiply(&t1, &t0)     // x^1023 -> 1023 = 2^10 - 1\n\tt1.Square(&t0)            // 2^11 - 2\n\tfor i := 1; i < 10; i++ { // 2^20 - 2^10\n\t\tt1.Square(&t1)\n\t}\n\tt1.Multiply(&t1, &t0)     // 2^20 - 1\n\tt2.Square(&t1)            // 2^21 - 2\n\tfor i := 1; i < 20; i++ { // 2^40 - 2^20\n\t\tt2.Square(&t2)\n\t}\n\tt1.Multiply(&t2, &t1)     // 2^40 - 1\n\tt1.Square(&t1)            // 2^41 - 2\n\tfor i := 1; i < 10; i++ { // 2^50 - 2^10\n\t\tt1.Square(&t1)\n\t}\n\tt0.Multiply(&t1, &t0)     // 2^50 - 1\n\tt1.Square(&t0)            // 2^51 - 2\n\tfor i := 1; i < 50; i++ { // 2^100 - 2^50\n\t\tt1.Square(&t1)\n\t}\n\tt1.Multiply(&t1, &t0)      // 2^100 - 1\n\tt2.Square(&t1)             // 2^101 - 2\n\tfor i := 1; i < 100; i++ { // 2^200 - 2^100\n\t\tt2.Square(&t2)\n\t}\n\tt1.Multiply(&t2, &t1)     // 2^200 - 1\n\tt1.Square(&t1)            // 2^201 - 2\n\tfor i := 1; i < 50; i++ { // 2^250 - 2^50\n\t\tt1.Square(&t1)\n\t}\n\tt0.Multiply(&t1, &t0)     // 2^250 - 1\n\tt0.Square(&t0)            // 2^251 - 2\n\tt0.Square(&t0)            // 2^252 - 4\n\treturn v.Multiply(&t0, x) // 2^252 - 3 -> x^(2^252-3)\n}\n\n// sqrtM1 is 2^((p-1)/4), which squared is equal to -1 by Euler's Criterion.\nvar sqrtM1 = &Element{1718705420411056, 234908883556509,\n\t2233514472574048, 2117202627021982, 765476049583133}\n\n// SqrtRatio sets r to the non-negative square root of the ratio of u and v.\n//\n// If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio\n// sets r according to Section 4.3 of draft-irtf-cfrg-ristretto255-decaf448-00,\n// and returns r and 0.\nfunc (r *Element) SqrtRatio(u, v *Element) (R *Element, wasSquare int) {\n\tt0 := new(Element)\n\n\t// r = (u * v3) * (u * v7)^((p-5)/8)\n\tv2 := new(Element).Square(v)\n\tuv3 := new(Element).Multiply(u, t0.Multiply(v2, v))\n\tuv7 := new(Element).Multiply(uv3, t0.Square(v2))\n\trr := new(Element).Multiply(uv3, t0.Pow22523(uv7))\n\n\tcheck := new(Element).Multiply(v, t0.Square(rr)) // check = v * r^2\n\n\tuNeg := new(Element).Negate(u)\n\tcorrectSignSqrt := check.Equal(u)\n\tflippedSignSqrt := check.Equal(uNeg)\n\tflippedSignSqrtI := check.Equal(t0.Multiply(uNeg, sqrtM1))\n\n\trPrime := new(Element).Multiply(rr, sqrtM1) // r_prime = SQRT_M1 * r\n\t// r = CT_SELECT(r_prime IF flipped_sign_sqrt | flipped_sign_sqrt_i ELSE r)\n\trr.Select(rPrime, rr, flippedSignSqrt|flippedSignSqrtI)\n\n\tr.Absolute(rr) // Choose the nonnegative square root.\n\treturn r, correctSignSqrt | flippedSignSqrt\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_amd64.go",
    "content": "// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT.\n\n//go:build amd64 && gc && !purego\n// +build amd64,gc,!purego\n\npackage field\n\n// feMul sets out = a * b. It works like feMulGeneric.\n//\n//go:noescape\nfunc feMul(out *Element, a *Element, b *Element)\n\n// feSquare sets out = a * a. It works like feSquareGeneric.\n//\n//go:noescape\nfunc feSquare(out *Element, a *Element)\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_amd64.s",
    "content": "// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT.\n\n//go:build amd64 && gc && !purego\n// +build amd64,gc,!purego\n\n#include \"textflag.h\"\n\n// func feMul(out *Element, a *Element, b *Element)\nTEXT ·feMul(SB), NOSPLIT, $0-24\n\tMOVQ a+8(FP), CX\n\tMOVQ b+16(FP), BX\n\n\t// r0 = a0×b0\n\tMOVQ (CX), AX\n\tMULQ (BX)\n\tMOVQ AX, DI\n\tMOVQ DX, SI\n\n\t// r0 += 19×a1×b4\n\tMOVQ   8(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   32(BX)\n\tADDQ   AX, DI\n\tADCQ   DX, SI\n\n\t// r0 += 19×a2×b3\n\tMOVQ   16(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   24(BX)\n\tADDQ   AX, DI\n\tADCQ   DX, SI\n\n\t// r0 += 19×a3×b2\n\tMOVQ   24(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   16(BX)\n\tADDQ   AX, DI\n\tADCQ   DX, SI\n\n\t// r0 += 19×a4×b1\n\tMOVQ   32(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   8(BX)\n\tADDQ   AX, DI\n\tADCQ   DX, SI\n\n\t// r1 = a0×b1\n\tMOVQ (CX), AX\n\tMULQ 8(BX)\n\tMOVQ AX, R9\n\tMOVQ DX, R8\n\n\t// r1 += a1×b0\n\tMOVQ 8(CX), AX\n\tMULQ (BX)\n\tADDQ AX, R9\n\tADCQ DX, R8\n\n\t// r1 += 19×a2×b4\n\tMOVQ   16(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   32(BX)\n\tADDQ   AX, R9\n\tADCQ   DX, R8\n\n\t// r1 += 19×a3×b3\n\tMOVQ   24(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   24(BX)\n\tADDQ   AX, R9\n\tADCQ   DX, R8\n\n\t// r1 += 19×a4×b2\n\tMOVQ   32(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   16(BX)\n\tADDQ   AX, R9\n\tADCQ   DX, R8\n\n\t// r2 = a0×b2\n\tMOVQ (CX), AX\n\tMULQ 16(BX)\n\tMOVQ AX, R11\n\tMOVQ DX, R10\n\n\t// r2 += a1×b1\n\tMOVQ 8(CX), AX\n\tMULQ 8(BX)\n\tADDQ AX, R11\n\tADCQ DX, R10\n\n\t// r2 += a2×b0\n\tMOVQ 16(CX), AX\n\tMULQ (BX)\n\tADDQ AX, R11\n\tADCQ DX, R10\n\n\t// r2 += 19×a3×b4\n\tMOVQ   24(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   32(BX)\n\tADDQ   AX, R11\n\tADCQ   DX, R10\n\n\t// r2 += 19×a4×b3\n\tMOVQ   32(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   24(BX)\n\tADDQ   AX, R11\n\tADCQ   DX, R10\n\n\t// r3 = a0×b3\n\tMOVQ (CX), AX\n\tMULQ 24(BX)\n\tMOVQ AX, R13\n\tMOVQ DX, R12\n\n\t// r3 += a1×b2\n\tMOVQ 8(CX), AX\n\tMULQ 16(BX)\n\tADDQ AX, R13\n\tADCQ DX, R12\n\n\t// r3 += a2×b1\n\tMOVQ 16(CX), AX\n\tMULQ 8(BX)\n\tADDQ AX, R13\n\tADCQ DX, R12\n\n\t// r3 += a3×b0\n\tMOVQ 24(CX), AX\n\tMULQ (BX)\n\tADDQ AX, R13\n\tADCQ DX, R12\n\n\t// r3 += 19×a4×b4\n\tMOVQ   32(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   32(BX)\n\tADDQ   AX, R13\n\tADCQ   DX, R12\n\n\t// r4 = a0×b4\n\tMOVQ (CX), AX\n\tMULQ 32(BX)\n\tMOVQ AX, R15\n\tMOVQ DX, R14\n\n\t// r4 += a1×b3\n\tMOVQ 8(CX), AX\n\tMULQ 24(BX)\n\tADDQ AX, R15\n\tADCQ DX, R14\n\n\t// r4 += a2×b2\n\tMOVQ 16(CX), AX\n\tMULQ 16(BX)\n\tADDQ AX, R15\n\tADCQ DX, R14\n\n\t// r4 += a3×b1\n\tMOVQ 24(CX), AX\n\tMULQ 8(BX)\n\tADDQ AX, R15\n\tADCQ DX, R14\n\n\t// r4 += a4×b0\n\tMOVQ 32(CX), AX\n\tMULQ (BX)\n\tADDQ AX, R15\n\tADCQ DX, R14\n\n\t// First reduction chain\n\tMOVQ   $0x0007ffffffffffff, AX\n\tSHLQ   $0x0d, DI, SI\n\tSHLQ   $0x0d, R9, R8\n\tSHLQ   $0x0d, R11, R10\n\tSHLQ   $0x0d, R13, R12\n\tSHLQ   $0x0d, R15, R14\n\tANDQ   AX, DI\n\tIMUL3Q $0x13, R14, R14\n\tADDQ   R14, DI\n\tANDQ   AX, R9\n\tADDQ   SI, R9\n\tANDQ   AX, R11\n\tADDQ   R8, R11\n\tANDQ   AX, R13\n\tADDQ   R10, R13\n\tANDQ   AX, R15\n\tADDQ   R12, R15\n\n\t// Second reduction chain (carryPropagate)\n\tMOVQ   DI, SI\n\tSHRQ   $0x33, SI\n\tMOVQ   R9, R8\n\tSHRQ   $0x33, R8\n\tMOVQ   R11, R10\n\tSHRQ   $0x33, R10\n\tMOVQ   R13, R12\n\tSHRQ   $0x33, R12\n\tMOVQ   R15, R14\n\tSHRQ   $0x33, R14\n\tANDQ   AX, DI\n\tIMUL3Q $0x13, R14, R14\n\tADDQ   R14, DI\n\tANDQ   AX, R9\n\tADDQ   SI, R9\n\tANDQ   AX, R11\n\tADDQ   R8, R11\n\tANDQ   AX, R13\n\tADDQ   R10, R13\n\tANDQ   AX, R15\n\tADDQ   R12, R15\n\n\t// Store output\n\tMOVQ out+0(FP), AX\n\tMOVQ DI, (AX)\n\tMOVQ R9, 8(AX)\n\tMOVQ R11, 16(AX)\n\tMOVQ R13, 24(AX)\n\tMOVQ R15, 32(AX)\n\tRET\n\n// func feSquare(out *Element, a *Element)\nTEXT ·feSquare(SB), NOSPLIT, $0-16\n\tMOVQ a+8(FP), CX\n\n\t// r0 = l0×l0\n\tMOVQ (CX), AX\n\tMULQ (CX)\n\tMOVQ AX, SI\n\tMOVQ DX, BX\n\n\t// r0 += 38×l1×l4\n\tMOVQ   8(CX), AX\n\tIMUL3Q $0x26, AX, AX\n\tMULQ   32(CX)\n\tADDQ   AX, SI\n\tADCQ   DX, BX\n\n\t// r0 += 38×l2×l3\n\tMOVQ   16(CX), AX\n\tIMUL3Q $0x26, AX, AX\n\tMULQ   24(CX)\n\tADDQ   AX, SI\n\tADCQ   DX, BX\n\n\t// r1 = 2×l0×l1\n\tMOVQ (CX), AX\n\tSHLQ $0x01, AX\n\tMULQ 8(CX)\n\tMOVQ AX, R8\n\tMOVQ DX, DI\n\n\t// r1 += 38×l2×l4\n\tMOVQ   16(CX), AX\n\tIMUL3Q $0x26, AX, AX\n\tMULQ   32(CX)\n\tADDQ   AX, R8\n\tADCQ   DX, DI\n\n\t// r1 += 19×l3×l3\n\tMOVQ   24(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   24(CX)\n\tADDQ   AX, R8\n\tADCQ   DX, DI\n\n\t// r2 = 2×l0×l2\n\tMOVQ (CX), AX\n\tSHLQ $0x01, AX\n\tMULQ 16(CX)\n\tMOVQ AX, R10\n\tMOVQ DX, R9\n\n\t// r2 += l1×l1\n\tMOVQ 8(CX), AX\n\tMULQ 8(CX)\n\tADDQ AX, R10\n\tADCQ DX, R9\n\n\t// r2 += 38×l3×l4\n\tMOVQ   24(CX), AX\n\tIMUL3Q $0x26, AX, AX\n\tMULQ   32(CX)\n\tADDQ   AX, R10\n\tADCQ   DX, R9\n\n\t// r3 = 2×l0×l3\n\tMOVQ (CX), AX\n\tSHLQ $0x01, AX\n\tMULQ 24(CX)\n\tMOVQ AX, R12\n\tMOVQ DX, R11\n\n\t// r3 += 2×l1×l2\n\tMOVQ   8(CX), AX\n\tIMUL3Q $0x02, AX, AX\n\tMULQ   16(CX)\n\tADDQ   AX, R12\n\tADCQ   DX, R11\n\n\t// r3 += 19×l4×l4\n\tMOVQ   32(CX), AX\n\tIMUL3Q $0x13, AX, AX\n\tMULQ   32(CX)\n\tADDQ   AX, R12\n\tADCQ   DX, R11\n\n\t// r4 = 2×l0×l4\n\tMOVQ (CX), AX\n\tSHLQ $0x01, AX\n\tMULQ 32(CX)\n\tMOVQ AX, R14\n\tMOVQ DX, R13\n\n\t// r4 += 2×l1×l3\n\tMOVQ   8(CX), AX\n\tIMUL3Q $0x02, AX, AX\n\tMULQ   24(CX)\n\tADDQ   AX, R14\n\tADCQ   DX, R13\n\n\t// r4 += l2×l2\n\tMOVQ 16(CX), AX\n\tMULQ 16(CX)\n\tADDQ AX, R14\n\tADCQ DX, R13\n\n\t// First reduction chain\n\tMOVQ   $0x0007ffffffffffff, AX\n\tSHLQ   $0x0d, SI, BX\n\tSHLQ   $0x0d, R8, DI\n\tSHLQ   $0x0d, R10, R9\n\tSHLQ   $0x0d, R12, R11\n\tSHLQ   $0x0d, R14, R13\n\tANDQ   AX, SI\n\tIMUL3Q $0x13, R13, R13\n\tADDQ   R13, SI\n\tANDQ   AX, R8\n\tADDQ   BX, R8\n\tANDQ   AX, R10\n\tADDQ   DI, R10\n\tANDQ   AX, R12\n\tADDQ   R9, R12\n\tANDQ   AX, R14\n\tADDQ   R11, R14\n\n\t// Second reduction chain (carryPropagate)\n\tMOVQ   SI, BX\n\tSHRQ   $0x33, BX\n\tMOVQ   R8, DI\n\tSHRQ   $0x33, DI\n\tMOVQ   R10, R9\n\tSHRQ   $0x33, R9\n\tMOVQ   R12, R11\n\tSHRQ   $0x33, R11\n\tMOVQ   R14, R13\n\tSHRQ   $0x33, R13\n\tANDQ   AX, SI\n\tIMUL3Q $0x13, R13, R13\n\tADDQ   R13, SI\n\tANDQ   AX, R8\n\tADDQ   BX, R8\n\tANDQ   AX, R10\n\tADDQ   DI, R10\n\tANDQ   AX, R12\n\tADDQ   R9, R12\n\tANDQ   AX, R14\n\tADDQ   R11, R14\n\n\t// Store output\n\tMOVQ out+0(FP), AX\n\tMOVQ SI, (AX)\n\tMOVQ R8, 8(AX)\n\tMOVQ R10, 16(AX)\n\tMOVQ R12, 24(AX)\n\tMOVQ R14, 32(AX)\n\tRET\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go",
    "content": "// Copyright (c) 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build !amd64 || !gc || purego\n// +build !amd64 !gc purego\n\npackage field\n\nfunc feMul(v, x, y *Element) { feMulGeneric(v, x, y) }\n\nfunc feSquare(v, x *Element) { feSquareGeneric(v, x) }\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_arm64.go",
    "content": "// Copyright (c) 2020 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build arm64 && gc && !purego\n// +build arm64,gc,!purego\n\npackage field\n\n//go:noescape\nfunc carryPropagate(v *Element)\n\nfunc (v *Element) carryPropagate() *Element {\n\tcarryPropagate(v)\n\treturn v\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_arm64.s",
    "content": "// Copyright (c) 2020 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build arm64 && gc && !purego\n\n#include \"textflag.h\"\n\n// carryPropagate works exactly like carryPropagateGeneric and uses the\n// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but\n// avoids loading R0-R4 twice and uses LDP and STP.\n//\n// See https://golang.org/issues/43145 for the main compiler issue.\n//\n// func carryPropagate(v *Element)\nTEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8\n\tMOVD v+0(FP), R20\n\n\tLDP 0(R20), (R0, R1)\n\tLDP 16(R20), (R2, R3)\n\tMOVD 32(R20), R4\n\n\tAND $0x7ffffffffffff, R0, R10\n\tAND $0x7ffffffffffff, R1, R11\n\tAND $0x7ffffffffffff, R2, R12\n\tAND $0x7ffffffffffff, R3, R13\n\tAND $0x7ffffffffffff, R4, R14\n\n\tADD R0>>51, R11, R11\n\tADD R1>>51, R12, R12\n\tADD R2>>51, R13, R13\n\tADD R3>>51, R14, R14\n\t// R4>>51 * 19 + R10 -> R10\n\tLSR $51, R4, R21\n\tMOVD $19, R22\n\tMADD R22, R10, R21, R10\n\n\tSTP (R10, R11), 0(R20)\n\tSTP (R12, R13), 16(R20)\n\tMOVD R14, 32(R20)\n\n\tRET\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go",
    "content": "// Copyright (c) 2021 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build !arm64 || !gc || purego\n// +build !arm64 !gc purego\n\npackage field\n\nfunc (v *Element) carryPropagate() *Element {\n\treturn v.carryPropagateGeneric()\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_extra.go",
    "content": "// Copyright (c) 2021 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage field\n\nimport \"errors\"\n\n// This file contains additional functionality that is not included in the\n// upstream crypto/ed25519/edwards25519/field package.\n\n// SetWideBytes sets v to x, where x is a 64-byte little-endian encoding, which\n// is reduced modulo the field order. If x is not of the right length,\n// SetWideBytes returns nil and an error, and the receiver is unchanged.\n//\n// SetWideBytes is not necessary to select a uniformly distributed value, and is\n// only provided for compatibility: SetBytes can be used instead as the chance\n// of bias is less than 2⁻²⁵⁰.\nfunc (v *Element) SetWideBytes(x []byte) (*Element, error) {\n\tif len(x) != 64 {\n\t\treturn nil, errors.New(\"edwards25519: invalid SetWideBytes input size\")\n\t}\n\n\t// Split the 64 bytes into two elements, and extract the most significant\n\t// bit of each, which is ignored by SetBytes.\n\tlo, _ := new(Element).SetBytes(x[:32])\n\tloMSB := uint64(x[31] >> 7)\n\thi, _ := new(Element).SetBytes(x[32:])\n\thiMSB := uint64(x[63] >> 7)\n\n\t// The output we want is\n\t//\n\t//   v = lo + loMSB * 2²⁵⁵ + hi * 2²⁵⁶ + hiMSB * 2⁵¹¹\n\t//\n\t// which applying the reduction identity comes out to\n\t//\n\t//   v = lo + loMSB * 19 + hi * 2 * 19 + hiMSB * 2 * 19²\n\t//\n\t// l0 will be the sum of a 52 bits value (lo.l0), plus a 5 bits value\n\t// (loMSB * 19), a 6 bits value (hi.l0 * 2 * 19), and a 10 bits value\n\t// (hiMSB * 2 * 19²), so it fits in a uint64.\n\n\tv.l0 = lo.l0 + loMSB*19 + hi.l0*2*19 + hiMSB*2*19*19\n\tv.l1 = lo.l1 + hi.l1*2*19\n\tv.l2 = lo.l2 + hi.l2*2*19\n\tv.l3 = lo.l3 + hi.l3*2*19\n\tv.l4 = lo.l4 + hi.l4*2*19\n\n\treturn v.carryPropagate(), nil\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/field/fe_generic.go",
    "content": "// Copyright (c) 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage field\n\nimport \"math/bits\"\n\n// uint128 holds a 128-bit number as two 64-bit limbs, for use with the\n// bits.Mul64 and bits.Add64 intrinsics.\ntype uint128 struct {\n\tlo, hi uint64\n}\n\n// mul64 returns a * b.\nfunc mul64(a, b uint64) uint128 {\n\thi, lo := bits.Mul64(a, b)\n\treturn uint128{lo, hi}\n}\n\n// addMul64 returns v + a * b.\nfunc addMul64(v uint128, a, b uint64) uint128 {\n\thi, lo := bits.Mul64(a, b)\n\tlo, c := bits.Add64(lo, v.lo, 0)\n\thi, _ = bits.Add64(hi, v.hi, c)\n\treturn uint128{lo, hi}\n}\n\n// shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits.\nfunc shiftRightBy51(a uint128) uint64 {\n\treturn (a.hi << (64 - 51)) | (a.lo >> 51)\n}\n\nfunc feMulGeneric(v, a, b *Element) {\n\ta0 := a.l0\n\ta1 := a.l1\n\ta2 := a.l2\n\ta3 := a.l3\n\ta4 := a.l4\n\n\tb0 := b.l0\n\tb1 := b.l1\n\tb2 := b.l2\n\tb3 := b.l3\n\tb4 := b.l4\n\n\t// Limb multiplication works like pen-and-paper columnar multiplication, but\n\t// with 51-bit limbs instead of digits.\n\t//\n\t//                          a4   a3   a2   a1   a0  x\n\t//                          b4   b3   b2   b1   b0  =\n\t//                         ------------------------\n\t//                        a4b0 a3b0 a2b0 a1b0 a0b0  +\n\t//                   a4b1 a3b1 a2b1 a1b1 a0b1       +\n\t//              a4b2 a3b2 a2b2 a1b2 a0b2            +\n\t//         a4b3 a3b3 a2b3 a1b3 a0b3                 +\n\t//    a4b4 a3b4 a2b4 a1b4 a0b4                      =\n\t//   ----------------------------------------------\n\t//      r8   r7   r6   r5   r4   r3   r2   r1   r0\n\t//\n\t// We can then use the reduction identity (a * 2²⁵⁵ + b = a * 19 + b) to\n\t// reduce the limbs that would overflow 255 bits. r5 * 2²⁵⁵ becomes 19 * r5,\n\t// r6 * 2³⁰⁶ becomes 19 * r6 * 2⁵¹, etc.\n\t//\n\t// Reduction can be carried out simultaneously to multiplication. For\n\t// example, we do not compute r5: whenever the result of a multiplication\n\t// belongs to r5, like a1b4, we multiply it by 19 and add the result to r0.\n\t//\n\t//            a4b0    a3b0    a2b0    a1b0    a0b0  +\n\t//            a3b1    a2b1    a1b1    a0b1 19×a4b1  +\n\t//            a2b2    a1b2    a0b2 19×a4b2 19×a3b2  +\n\t//            a1b3    a0b3 19×a4b3 19×a3b3 19×a2b3  +\n\t//            a0b4 19×a4b4 19×a3b4 19×a2b4 19×a1b4  =\n\t//           --------------------------------------\n\t//              r4      r3      r2      r1      r0\n\t//\n\t// Finally we add up the columns into wide, overlapping limbs.\n\n\ta1_19 := a1 * 19\n\ta2_19 := a2 * 19\n\ta3_19 := a3 * 19\n\ta4_19 := a4 * 19\n\n\t// r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1)\n\tr0 := mul64(a0, b0)\n\tr0 = addMul64(r0, a1_19, b4)\n\tr0 = addMul64(r0, a2_19, b3)\n\tr0 = addMul64(r0, a3_19, b2)\n\tr0 = addMul64(r0, a4_19, b1)\n\n\t// r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2)\n\tr1 := mul64(a0, b1)\n\tr1 = addMul64(r1, a1, b0)\n\tr1 = addMul64(r1, a2_19, b4)\n\tr1 = addMul64(r1, a3_19, b3)\n\tr1 = addMul64(r1, a4_19, b2)\n\n\t// r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3)\n\tr2 := mul64(a0, b2)\n\tr2 = addMul64(r2, a1, b1)\n\tr2 = addMul64(r2, a2, b0)\n\tr2 = addMul64(r2, a3_19, b4)\n\tr2 = addMul64(r2, a4_19, b3)\n\n\t// r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4\n\tr3 := mul64(a0, b3)\n\tr3 = addMul64(r3, a1, b2)\n\tr3 = addMul64(r3, a2, b1)\n\tr3 = addMul64(r3, a3, b0)\n\tr3 = addMul64(r3, a4_19, b4)\n\n\t// r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0\n\tr4 := mul64(a0, b4)\n\tr4 = addMul64(r4, a1, b3)\n\tr4 = addMul64(r4, a2, b2)\n\tr4 = addMul64(r4, a3, b1)\n\tr4 = addMul64(r4, a4, b0)\n\n\t// After the multiplication, we need to reduce (carry) the five coefficients\n\t// to obtain a result with limbs that are at most slightly larger than 2⁵¹,\n\t// to respect the Element invariant.\n\t//\n\t// Overall, the reduction works the same as carryPropagate, except with\n\t// wider inputs: we take the carry for each coefficient by shifting it right\n\t// by 51, and add it to the limb above it. The top carry is multiplied by 19\n\t// according to the reduction identity and added to the lowest limb.\n\t//\n\t// The largest coefficient (r0) will be at most 111 bits, which guarantees\n\t// that all carries are at most 111 - 51 = 60 bits, which fits in a uint64.\n\t//\n\t//     r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1)\n\t//     r0 < 2⁵²×2⁵² + 19×(2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵²)\n\t//     r0 < (1 + 19 × 4) × 2⁵² × 2⁵²\n\t//     r0 < 2⁷ × 2⁵² × 2⁵²\n\t//     r0 < 2¹¹¹\n\t//\n\t// Moreover, the top coefficient (r4) is at most 107 bits, so c4 is at most\n\t// 56 bits, and c4 * 19 is at most 61 bits, which again fits in a uint64 and\n\t// allows us to easily apply the reduction identity.\n\t//\n\t//     r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0\n\t//     r4 < 5 × 2⁵² × 2⁵²\n\t//     r4 < 2¹⁰⁷\n\t//\n\n\tc0 := shiftRightBy51(r0)\n\tc1 := shiftRightBy51(r1)\n\tc2 := shiftRightBy51(r2)\n\tc3 := shiftRightBy51(r3)\n\tc4 := shiftRightBy51(r4)\n\n\trr0 := r0.lo&maskLow51Bits + c4*19\n\trr1 := r1.lo&maskLow51Bits + c0\n\trr2 := r2.lo&maskLow51Bits + c1\n\trr3 := r3.lo&maskLow51Bits + c2\n\trr4 := r4.lo&maskLow51Bits + c3\n\n\t// Now all coefficients fit into 64-bit registers but are still too large to\n\t// be passed around as an Element. We therefore do one last carry chain,\n\t// where the carries will be small enough to fit in the wiggle room above 2⁵¹.\n\t*v = Element{rr0, rr1, rr2, rr3, rr4}\n\tv.carryPropagate()\n}\n\nfunc feSquareGeneric(v, a *Element) {\n\tl0 := a.l0\n\tl1 := a.l1\n\tl2 := a.l2\n\tl3 := a.l3\n\tl4 := a.l4\n\n\t// Squaring works precisely like multiplication above, but thanks to its\n\t// symmetry we get to group a few terms together.\n\t//\n\t//                          l4   l3   l2   l1   l0  x\n\t//                          l4   l3   l2   l1   l0  =\n\t//                         ------------------------\n\t//                        l4l0 l3l0 l2l0 l1l0 l0l0  +\n\t//                   l4l1 l3l1 l2l1 l1l1 l0l1       +\n\t//              l4l2 l3l2 l2l2 l1l2 l0l2            +\n\t//         l4l3 l3l3 l2l3 l1l3 l0l3                 +\n\t//    l4l4 l3l4 l2l4 l1l4 l0l4                      =\n\t//   ----------------------------------------------\n\t//      r8   r7   r6   r5   r4   r3   r2   r1   r0\n\t//\n\t//            l4l0    l3l0    l2l0    l1l0    l0l0  +\n\t//            l3l1    l2l1    l1l1    l0l1 19×l4l1  +\n\t//            l2l2    l1l2    l0l2 19×l4l2 19×l3l2  +\n\t//            l1l3    l0l3 19×l4l3 19×l3l3 19×l2l3  +\n\t//            l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4  =\n\t//           --------------------------------------\n\t//              r4      r3      r2      r1      r0\n\t//\n\t// With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with\n\t// only three Mul64 and four Add64, instead of five and eight.\n\n\tl0_2 := l0 * 2\n\tl1_2 := l1 * 2\n\n\tl1_38 := l1 * 38\n\tl2_38 := l2 * 38\n\tl3_38 := l3 * 38\n\n\tl3_19 := l3 * 19\n\tl4_19 := l4 * 19\n\n\t// r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3)\n\tr0 := mul64(l0, l0)\n\tr0 = addMul64(r0, l1_38, l4)\n\tr0 = addMul64(r0, l2_38, l3)\n\n\t// r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3\n\tr1 := mul64(l0_2, l1)\n\tr1 = addMul64(r1, l2_38, l4)\n\tr1 = addMul64(r1, l3_19, l3)\n\n\t// r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4\n\tr2 := mul64(l0_2, l2)\n\tr2 = addMul64(r2, l1, l1)\n\tr2 = addMul64(r2, l3_38, l4)\n\n\t// r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4\n\tr3 := mul64(l0_2, l3)\n\tr3 = addMul64(r3, l1_2, l2)\n\tr3 = addMul64(r3, l4_19, l4)\n\n\t// r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2\n\tr4 := mul64(l0_2, l4)\n\tr4 = addMul64(r4, l1_2, l3)\n\tr4 = addMul64(r4, l2, l2)\n\n\tc0 := shiftRightBy51(r0)\n\tc1 := shiftRightBy51(r1)\n\tc2 := shiftRightBy51(r2)\n\tc3 := shiftRightBy51(r3)\n\tc4 := shiftRightBy51(r4)\n\n\trr0 := r0.lo&maskLow51Bits + c4*19\n\trr1 := r1.lo&maskLow51Bits + c0\n\trr2 := r2.lo&maskLow51Bits + c1\n\trr3 := r3.lo&maskLow51Bits + c2\n\trr4 := r4.lo&maskLow51Bits + c3\n\n\t*v = Element{rr0, rr1, rr2, rr3, rr4}\n\tv.carryPropagate()\n}\n\n// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction\n// identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry.\nfunc (v *Element) carryPropagateGeneric() *Element {\n\tc0 := v.l0 >> 51\n\tc1 := v.l1 >> 51\n\tc2 := v.l2 >> 51\n\tc3 := v.l3 >> 51\n\tc4 := v.l4 >> 51\n\n\t// c4 is at most 64 - 51 = 13 bits, so c4*19 is at most 18 bits, and\n\t// the final l0 will be at most 52 bits. Similarly for the rest.\n\tv.l0 = v.l0&maskLow51Bits + c4*19\n\tv.l1 = v.l1&maskLow51Bits + c0\n\tv.l2 = v.l2&maskLow51Bits + c1\n\tv.l3 = v.l3&maskLow51Bits + c2\n\tv.l4 = v.l4&maskLow51Bits + c3\n\n\treturn v\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/scalar.go",
    "content": "// Copyright (c) 2016 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage edwards25519\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n)\n\n// A Scalar is an integer modulo\n//\n//\tl = 2^252 + 27742317777372353535851937790883648493\n//\n// which is the prime order of the edwards25519 group.\n//\n// This type works similarly to math/big.Int, and all arguments and\n// receivers are allowed to alias.\n//\n// The zero value is a valid zero element.\ntype Scalar struct {\n\t// s is the scalar in the Montgomery domain, in the format of the\n\t// fiat-crypto implementation.\n\ts fiatScalarMontgomeryDomainFieldElement\n}\n\n// The field implementation in scalar_fiat.go is generated by the fiat-crypto\n// project (https://github.com/mit-plv/fiat-crypto) at version v0.0.9 (23d2dbc)\n// from a formally verified model.\n//\n// fiat-crypto code comes under the following license.\n//\n//     Copyright (c) 2015-2020 The fiat-crypto Authors. All rights reserved.\n//\n//     Redistribution and use in source and binary forms, with or without\n//     modification, are permitted provided that the following conditions are\n//     met:\n//\n//         1. Redistributions of source code must retain the above copyright\n//         notice, this list of conditions and the following disclaimer.\n//\n//     THIS SOFTWARE IS PROVIDED BY the fiat-crypto authors \"AS IS\"\n//     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n//     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n//     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design,\n//     Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n//     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n//     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n//     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n//     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n\n// NewScalar returns a new zero Scalar.\nfunc NewScalar() *Scalar {\n\treturn &Scalar{}\n}\n\n// MultiplyAdd sets s = x * y + z mod l, and returns s. It is equivalent to\n// using Multiply and then Add.\nfunc (s *Scalar) MultiplyAdd(x, y, z *Scalar) *Scalar {\n\t// Make a copy of z in case it aliases s.\n\tzCopy := new(Scalar).Set(z)\n\treturn s.Multiply(x, y).Add(s, zCopy)\n}\n\n// Add sets s = x + y mod l, and returns s.\nfunc (s *Scalar) Add(x, y *Scalar) *Scalar {\n\t// s = 1 * x + y mod l\n\tfiatScalarAdd(&s.s, &x.s, &y.s)\n\treturn s\n}\n\n// Subtract sets s = x - y mod l, and returns s.\nfunc (s *Scalar) Subtract(x, y *Scalar) *Scalar {\n\t// s = -1 * y + x mod l\n\tfiatScalarSub(&s.s, &x.s, &y.s)\n\treturn s\n}\n\n// Negate sets s = -x mod l, and returns s.\nfunc (s *Scalar) Negate(x *Scalar) *Scalar {\n\t// s = -1 * x + 0 mod l\n\tfiatScalarOpp(&s.s, &x.s)\n\treturn s\n}\n\n// Multiply sets s = x * y mod l, and returns s.\nfunc (s *Scalar) Multiply(x, y *Scalar) *Scalar {\n\t// s = x * y + 0 mod l\n\tfiatScalarMul(&s.s, &x.s, &y.s)\n\treturn s\n}\n\n// Set sets s = x, and returns s.\nfunc (s *Scalar) Set(x *Scalar) *Scalar {\n\t*s = *x\n\treturn s\n}\n\n// SetUniformBytes sets s = x mod l, where x is a 64-byte little-endian integer.\n// If x is not of the right length, SetUniformBytes returns nil and an error,\n// and the receiver is unchanged.\n//\n// SetUniformBytes can be used to set s to a uniformly distributed value given\n// 64 uniformly distributed random bytes.\nfunc (s *Scalar) SetUniformBytes(x []byte) (*Scalar, error) {\n\tif len(x) != 64 {\n\t\treturn nil, errors.New(\"edwards25519: invalid SetUniformBytes input length\")\n\t}\n\n\t// We have a value x of 512 bits, but our fiatScalarFromBytes function\n\t// expects an input lower than l, which is a little over 252 bits.\n\t//\n\t// Instead of writing a reduction function that operates on wider inputs, we\n\t// can interpret x as the sum of three shorter values a, b, and c.\n\t//\n\t//    x = a + b * 2^168 + c * 2^336  mod l\n\t//\n\t// We then precompute 2^168 and 2^336 modulo l, and perform the reduction\n\t// with two multiplications and two additions.\n\n\ts.setShortBytes(x[:21])\n\tt := new(Scalar).setShortBytes(x[21:42])\n\ts.Add(s, t.Multiply(t, scalarTwo168))\n\tt.setShortBytes(x[42:])\n\ts.Add(s, t.Multiply(t, scalarTwo336))\n\n\treturn s, nil\n}\n\n// scalarTwo168 and scalarTwo336 are 2^168 and 2^336 modulo l, encoded as a\n// fiatScalarMontgomeryDomainFieldElement, which is a little-endian 4-limb value\n// in the 2^256 Montgomery domain.\nvar scalarTwo168 = &Scalar{s: [4]uint64{0x5b8ab432eac74798, 0x38afddd6de59d5d7,\n\t0xa2c131b399411b7c, 0x6329a7ed9ce5a30}}\nvar scalarTwo336 = &Scalar{s: [4]uint64{0xbd3d108e2b35ecc5, 0x5c3a3718bdf9c90b,\n\t0x63aa97a331b4f2ee, 0x3d217f5be65cb5c}}\n\n// setShortBytes sets s = x mod l, where x is a little-endian integer shorter\n// than 32 bytes.\nfunc (s *Scalar) setShortBytes(x []byte) *Scalar {\n\tif len(x) >= 32 {\n\t\tpanic(\"edwards25519: internal error: setShortBytes called with a long string\")\n\t}\n\tvar buf [32]byte\n\tcopy(buf[:], x)\n\tfiatScalarFromBytes((*[4]uint64)(&s.s), &buf)\n\tfiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s))\n\treturn s\n}\n\n// SetCanonicalBytes sets s = x, where x is a 32-byte little-endian encoding of\n// s, and returns s. If x is not a canonical encoding of s, SetCanonicalBytes\n// returns nil and an error, and the receiver is unchanged.\nfunc (s *Scalar) SetCanonicalBytes(x []byte) (*Scalar, error) {\n\tif len(x) != 32 {\n\t\treturn nil, errors.New(\"invalid scalar length\")\n\t}\n\tif !isReduced(x) {\n\t\treturn nil, errors.New(\"invalid scalar encoding\")\n\t}\n\n\tfiatScalarFromBytes((*[4]uint64)(&s.s), (*[32]byte)(x))\n\tfiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s))\n\n\treturn s, nil\n}\n\n// scalarMinusOneBytes is l - 1 in little endian.\nvar scalarMinusOneBytes = [32]byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}\n\n// isReduced returns whether the given scalar in 32-byte little endian encoded\n// form is reduced modulo l.\nfunc isReduced(s []byte) bool {\n\tif len(s) != 32 {\n\t\treturn false\n\t}\n\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tswitch {\n\t\tcase s[i] > scalarMinusOneBytes[i]:\n\t\t\treturn false\n\t\tcase s[i] < scalarMinusOneBytes[i]:\n\t\t\treturn true\n\t\t}\n\t}\n\treturn true\n}\n\n// SetBytesWithClamping applies the buffer pruning described in RFC 8032,\n// Section 5.1.5 (also known as clamping) and sets s to the result. The input\n// must be 32 bytes, and it is not modified. If x is not of the right length,\n// SetBytesWithClamping returns nil and an error, and the receiver is unchanged.\n//\n// Note that since Scalar values are always reduced modulo the prime order of\n// the curve, the resulting value will not preserve any of the cofactor-clearing\n// properties that clamping is meant to provide. It will however work as\n// expected as long as it is applied to points on the prime order subgroup, like\n// in Ed25519. In fact, it is lost to history why RFC 8032 adopted the\n// irrelevant RFC 7748 clamping, but it is now required for compatibility.\nfunc (s *Scalar) SetBytesWithClamping(x []byte) (*Scalar, error) {\n\t// The description above omits the purpose of the high bits of the clamping\n\t// for brevity, but those are also lost to reductions, and are also\n\t// irrelevant to edwards25519 as they protect against a specific\n\t// implementation bug that was once observed in a generic Montgomery ladder.\n\tif len(x) != 32 {\n\t\treturn nil, errors.New(\"edwards25519: invalid SetBytesWithClamping input length\")\n\t}\n\n\t// We need to use the wide reduction from SetUniformBytes, since clamping\n\t// sets the 2^254 bit, making the value higher than the order.\n\tvar wideBytes [64]byte\n\tcopy(wideBytes[:], x[:])\n\twideBytes[0] &= 248\n\twideBytes[31] &= 63\n\twideBytes[31] |= 64\n\treturn s.SetUniformBytes(wideBytes[:])\n}\n\n// Bytes returns the canonical 32-byte little-endian encoding of s.\nfunc (s *Scalar) Bytes() []byte {\n\t// This function is outlined to make the allocations inline in the caller\n\t// rather than happen on the heap.\n\tvar encoded [32]byte\n\treturn s.bytes(&encoded)\n}\n\nfunc (s *Scalar) bytes(out *[32]byte) []byte {\n\tvar ss fiatScalarNonMontgomeryDomainFieldElement\n\tfiatScalarFromMontgomery(&ss, &s.s)\n\tfiatScalarToBytes(out, (*[4]uint64)(&ss))\n\treturn out[:]\n}\n\n// Equal returns 1 if s and t are equal, and 0 otherwise.\nfunc (s *Scalar) Equal(t *Scalar) int {\n\tvar diff fiatScalarMontgomeryDomainFieldElement\n\tfiatScalarSub(&diff, &s.s, &t.s)\n\tvar nonzero uint64\n\tfiatScalarNonzero(&nonzero, (*[4]uint64)(&diff))\n\tnonzero |= nonzero >> 32\n\tnonzero |= nonzero >> 16\n\tnonzero |= nonzero >> 8\n\tnonzero |= nonzero >> 4\n\tnonzero |= nonzero >> 2\n\tnonzero |= nonzero >> 1\n\treturn int(^nonzero) & 1\n}\n\n// nonAdjacentForm computes a width-w non-adjacent form for this scalar.\n//\n// w must be between 2 and 8, or nonAdjacentForm will panic.\nfunc (s *Scalar) nonAdjacentForm(w uint) [256]int8 {\n\t// This implementation is adapted from the one\n\t// in curve25519-dalek and is documented there:\n\t// https://github.com/dalek-cryptography/curve25519-dalek/blob/f630041af28e9a405255f98a8a93adca18e4315b/src/scalar.rs#L800-L871\n\tb := s.Bytes()\n\tif b[31] > 127 {\n\t\tpanic(\"scalar has high bit set illegally\")\n\t}\n\tif w < 2 {\n\t\tpanic(\"w must be at least 2 by the definition of NAF\")\n\t} else if w > 8 {\n\t\tpanic(\"NAF digits must fit in int8\")\n\t}\n\n\tvar naf [256]int8\n\tvar digits [5]uint64\n\n\tfor i := 0; i < 4; i++ {\n\t\tdigits[i] = binary.LittleEndian.Uint64(b[i*8:])\n\t}\n\n\twidth := uint64(1 << w)\n\twindowMask := uint64(width - 1)\n\n\tpos := uint(0)\n\tcarry := uint64(0)\n\tfor pos < 256 {\n\t\tindexU64 := pos / 64\n\t\tindexBit := pos % 64\n\t\tvar bitBuf uint64\n\t\tif indexBit < 64-w {\n\t\t\t// This window's bits are contained in a single u64\n\t\t\tbitBuf = digits[indexU64] >> indexBit\n\t\t} else {\n\t\t\t// Combine the current 64 bits with bits from the next 64\n\t\t\tbitBuf = (digits[indexU64] >> indexBit) | (digits[1+indexU64] << (64 - indexBit))\n\t\t}\n\n\t\t// Add carry into the current window\n\t\twindow := carry + (bitBuf & windowMask)\n\n\t\tif window&1 == 0 {\n\t\t\t// If the window value is even, preserve the carry and continue.\n\t\t\t// Why is the carry preserved?\n\t\t\t// If carry == 0 and window & 1 == 0,\n\t\t\t//    then the next carry should be 0\n\t\t\t// If carry == 1 and window & 1 == 0,\n\t\t\t//    then bit_buf & 1 == 1 so the next carry should be 1\n\t\t\tpos += 1\n\t\t\tcontinue\n\t\t}\n\n\t\tif window < width/2 {\n\t\t\tcarry = 0\n\t\t\tnaf[pos] = int8(window)\n\t\t} else {\n\t\t\tcarry = 1\n\t\t\tnaf[pos] = int8(window) - int8(width)\n\t\t}\n\n\t\tpos += w\n\t}\n\treturn naf\n}\n\nfunc (s *Scalar) signedRadix16() [64]int8 {\n\tb := s.Bytes()\n\tif b[31] > 127 {\n\t\tpanic(\"scalar has high bit set illegally\")\n\t}\n\n\tvar digits [64]int8\n\n\t// Compute unsigned radix-16 digits:\n\tfor i := 0; i < 32; i++ {\n\t\tdigits[2*i] = int8(b[i] & 15)\n\t\tdigits[2*i+1] = int8((b[i] >> 4) & 15)\n\t}\n\n\t// Recenter coefficients:\n\tfor i := 0; i < 63; i++ {\n\t\tcarry := (digits[i] + 8) >> 4\n\t\tdigits[i] -= carry << 4\n\t\tdigits[i+1] += carry\n\t}\n\n\treturn digits\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/scalar_fiat.go",
    "content": "// Code generated by Fiat Cryptography. DO NOT EDIT.\n//\n// Autogenerated: word_by_word_montgomery --lang Go --cmovznz-by-mul --relax-primitive-carry-to-bitwidth 32,64 --public-function-case camelCase --public-type-case camelCase --private-function-case camelCase --private-type-case camelCase --doc-text-before-function-name '' --doc-newline-before-package-declaration --doc-prepend-header 'Code generated by Fiat Cryptography. DO NOT EDIT.' --package-name edwards25519 Scalar 64 '2^252 + 27742317777372353535851937790883648493' mul add sub opp nonzero from_montgomery to_montgomery to_bytes from_bytes\n//\n// curve description: Scalar\n//\n// machine_wordsize = 64 (from \"64\")\n//\n// requested operations: mul, add, sub, opp, nonzero, from_montgomery, to_montgomery, to_bytes, from_bytes\n//\n// m = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed (from \"2^252 + 27742317777372353535851937790883648493\")\n//\n//\n//\n// NOTE: In addition to the bounds specified above each function, all\n//\n//   functions synthesized for this Montgomery arithmetic require the\n//\n//   input to be strictly less than the prime modulus (m), and also\n//\n//   require the input to be in the unique saturated representation.\n//\n//   All functions also ensure that these two properties are true of\n//\n//   return values.\n//\n//\n//\n// Computed values:\n//\n//   eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192)\n//\n//   bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248)\n//\n//   twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) in\n//\n//                            if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256\n\npackage edwards25519\n\nimport \"math/bits\"\n\ntype fiatScalarUint1 uint64 // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927\ntype fiatScalarInt1 int64   // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927\n\n// The type fiatScalarMontgomeryDomainFieldElement is a field element in the Montgomery domain.\n//\n// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]\ntype fiatScalarMontgomeryDomainFieldElement [4]uint64\n\n// The type fiatScalarNonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.\n//\n// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]\ntype fiatScalarNonMontgomeryDomainFieldElement [4]uint64\n\n// fiatScalarCmovznzU64 is a single-word conditional move.\n//\n// Postconditions:\n//\n//\tout1 = (if arg1 = 0 then arg2 else arg3)\n//\n// Input Bounds:\n//\n//\targ1: [0x0 ~> 0x1]\n//\targ2: [0x0 ~> 0xffffffffffffffff]\n//\targ3: [0x0 ~> 0xffffffffffffffff]\n//\n// Output Bounds:\n//\n//\tout1: [0x0 ~> 0xffffffffffffffff]\nfunc fiatScalarCmovznzU64(out1 *uint64, arg1 fiatScalarUint1, arg2 uint64, arg3 uint64) {\n\tx1 := (uint64(arg1) * 0xffffffffffffffff)\n\tx2 := ((x1 & arg3) | ((^x1) & arg2))\n\t*out1 = x2\n}\n\n// fiatScalarMul multiplies two field elements in the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\t0 ≤ eval arg2 < m\n//\n// Postconditions:\n//\n//\teval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarMul(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) {\n\tx1 := arg1[1]\n\tx2 := arg1[2]\n\tx3 := arg1[3]\n\tx4 := arg1[0]\n\tvar x5 uint64\n\tvar x6 uint64\n\tx6, x5 = bits.Mul64(x4, arg2[3])\n\tvar x7 uint64\n\tvar x8 uint64\n\tx8, x7 = bits.Mul64(x4, arg2[2])\n\tvar x9 uint64\n\tvar x10 uint64\n\tx10, x9 = bits.Mul64(x4, arg2[1])\n\tvar x11 uint64\n\tvar x12 uint64\n\tx12, x11 = bits.Mul64(x4, arg2[0])\n\tvar x13 uint64\n\tvar x14 uint64\n\tx13, x14 = bits.Add64(x12, x9, uint64(0x0))\n\tvar x15 uint64\n\tvar x16 uint64\n\tx15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14)))\n\tvar x17 uint64\n\tvar x18 uint64\n\tx17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16)))\n\tx19 := (uint64(fiatScalarUint1(x18)) + x6)\n\tvar x20 uint64\n\t_, x20 = bits.Mul64(x11, 0xd2b51da312547e1b)\n\tvar x22 uint64\n\tvar x23 uint64\n\tx23, x22 = bits.Mul64(x20, 0x1000000000000000)\n\tvar x24 uint64\n\tvar x25 uint64\n\tx25, x24 = bits.Mul64(x20, 0x14def9dea2f79cd6)\n\tvar x26 uint64\n\tvar x27 uint64\n\tx27, x26 = bits.Mul64(x20, 0x5812631a5cf5d3ed)\n\tvar x28 uint64\n\tvar x29 uint64\n\tx28, x29 = bits.Add64(x27, x24, uint64(0x0))\n\tx30 := (uint64(fiatScalarUint1(x29)) + x25)\n\tvar x32 uint64\n\t_, x32 = bits.Add64(x11, x26, uint64(0x0))\n\tvar x33 uint64\n\tvar x34 uint64\n\tx33, x34 = bits.Add64(x13, x28, uint64(fiatScalarUint1(x32)))\n\tvar x35 uint64\n\tvar x36 uint64\n\tx35, x36 = bits.Add64(x15, x30, uint64(fiatScalarUint1(x34)))\n\tvar x37 uint64\n\tvar x38 uint64\n\tx37, x38 = bits.Add64(x17, x22, uint64(fiatScalarUint1(x36)))\n\tvar x39 uint64\n\tvar x40 uint64\n\tx39, x40 = bits.Add64(x19, x23, uint64(fiatScalarUint1(x38)))\n\tvar x41 uint64\n\tvar x42 uint64\n\tx42, x41 = bits.Mul64(x1, arg2[3])\n\tvar x43 uint64\n\tvar x44 uint64\n\tx44, x43 = bits.Mul64(x1, arg2[2])\n\tvar x45 uint64\n\tvar x46 uint64\n\tx46, x45 = bits.Mul64(x1, arg2[1])\n\tvar x47 uint64\n\tvar x48 uint64\n\tx48, x47 = bits.Mul64(x1, arg2[0])\n\tvar x49 uint64\n\tvar x50 uint64\n\tx49, x50 = bits.Add64(x48, x45, uint64(0x0))\n\tvar x51 uint64\n\tvar x52 uint64\n\tx51, x52 = bits.Add64(x46, x43, uint64(fiatScalarUint1(x50)))\n\tvar x53 uint64\n\tvar x54 uint64\n\tx53, x54 = bits.Add64(x44, x41, uint64(fiatScalarUint1(x52)))\n\tx55 := (uint64(fiatScalarUint1(x54)) + x42)\n\tvar x56 uint64\n\tvar x57 uint64\n\tx56, x57 = bits.Add64(x33, x47, uint64(0x0))\n\tvar x58 uint64\n\tvar x59 uint64\n\tx58, x59 = bits.Add64(x35, x49, uint64(fiatScalarUint1(x57)))\n\tvar x60 uint64\n\tvar x61 uint64\n\tx60, x61 = bits.Add64(x37, x51, uint64(fiatScalarUint1(x59)))\n\tvar x62 uint64\n\tvar x63 uint64\n\tx62, x63 = bits.Add64(x39, x53, uint64(fiatScalarUint1(x61)))\n\tvar x64 uint64\n\tvar x65 uint64\n\tx64, x65 = bits.Add64(uint64(fiatScalarUint1(x40)), x55, uint64(fiatScalarUint1(x63)))\n\tvar x66 uint64\n\t_, x66 = bits.Mul64(x56, 0xd2b51da312547e1b)\n\tvar x68 uint64\n\tvar x69 uint64\n\tx69, x68 = bits.Mul64(x66, 0x1000000000000000)\n\tvar x70 uint64\n\tvar x71 uint64\n\tx71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6)\n\tvar x72 uint64\n\tvar x73 uint64\n\tx73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed)\n\tvar x74 uint64\n\tvar x75 uint64\n\tx74, x75 = bits.Add64(x73, x70, uint64(0x0))\n\tx76 := (uint64(fiatScalarUint1(x75)) + x71)\n\tvar x78 uint64\n\t_, x78 = bits.Add64(x56, x72, uint64(0x0))\n\tvar x79 uint64\n\tvar x80 uint64\n\tx79, x80 = bits.Add64(x58, x74, uint64(fiatScalarUint1(x78)))\n\tvar x81 uint64\n\tvar x82 uint64\n\tx81, x82 = bits.Add64(x60, x76, uint64(fiatScalarUint1(x80)))\n\tvar x83 uint64\n\tvar x84 uint64\n\tx83, x84 = bits.Add64(x62, x68, uint64(fiatScalarUint1(x82)))\n\tvar x85 uint64\n\tvar x86 uint64\n\tx85, x86 = bits.Add64(x64, x69, uint64(fiatScalarUint1(x84)))\n\tx87 := (uint64(fiatScalarUint1(x86)) + uint64(fiatScalarUint1(x65)))\n\tvar x88 uint64\n\tvar x89 uint64\n\tx89, x88 = bits.Mul64(x2, arg2[3])\n\tvar x90 uint64\n\tvar x91 uint64\n\tx91, x90 = bits.Mul64(x2, arg2[2])\n\tvar x92 uint64\n\tvar x93 uint64\n\tx93, x92 = bits.Mul64(x2, arg2[1])\n\tvar x94 uint64\n\tvar x95 uint64\n\tx95, x94 = bits.Mul64(x2, arg2[0])\n\tvar x96 uint64\n\tvar x97 uint64\n\tx96, x97 = bits.Add64(x95, x92, uint64(0x0))\n\tvar x98 uint64\n\tvar x99 uint64\n\tx98, x99 = bits.Add64(x93, x90, uint64(fiatScalarUint1(x97)))\n\tvar x100 uint64\n\tvar x101 uint64\n\tx100, x101 = bits.Add64(x91, x88, uint64(fiatScalarUint1(x99)))\n\tx102 := (uint64(fiatScalarUint1(x101)) + x89)\n\tvar x103 uint64\n\tvar x104 uint64\n\tx103, x104 = bits.Add64(x79, x94, uint64(0x0))\n\tvar x105 uint64\n\tvar x106 uint64\n\tx105, x106 = bits.Add64(x81, x96, uint64(fiatScalarUint1(x104)))\n\tvar x107 uint64\n\tvar x108 uint64\n\tx107, x108 = bits.Add64(x83, x98, uint64(fiatScalarUint1(x106)))\n\tvar x109 uint64\n\tvar x110 uint64\n\tx109, x110 = bits.Add64(x85, x100, uint64(fiatScalarUint1(x108)))\n\tvar x111 uint64\n\tvar x112 uint64\n\tx111, x112 = bits.Add64(x87, x102, uint64(fiatScalarUint1(x110)))\n\tvar x113 uint64\n\t_, x113 = bits.Mul64(x103, 0xd2b51da312547e1b)\n\tvar x115 uint64\n\tvar x116 uint64\n\tx116, x115 = bits.Mul64(x113, 0x1000000000000000)\n\tvar x117 uint64\n\tvar x118 uint64\n\tx118, x117 = bits.Mul64(x113, 0x14def9dea2f79cd6)\n\tvar x119 uint64\n\tvar x120 uint64\n\tx120, x119 = bits.Mul64(x113, 0x5812631a5cf5d3ed)\n\tvar x121 uint64\n\tvar x122 uint64\n\tx121, x122 = bits.Add64(x120, x117, uint64(0x0))\n\tx123 := (uint64(fiatScalarUint1(x122)) + x118)\n\tvar x125 uint64\n\t_, x125 = bits.Add64(x103, x119, uint64(0x0))\n\tvar x126 uint64\n\tvar x127 uint64\n\tx126, x127 = bits.Add64(x105, x121, uint64(fiatScalarUint1(x125)))\n\tvar x128 uint64\n\tvar x129 uint64\n\tx128, x129 = bits.Add64(x107, x123, uint64(fiatScalarUint1(x127)))\n\tvar x130 uint64\n\tvar x131 uint64\n\tx130, x131 = bits.Add64(x109, x115, uint64(fiatScalarUint1(x129)))\n\tvar x132 uint64\n\tvar x133 uint64\n\tx132, x133 = bits.Add64(x111, x116, uint64(fiatScalarUint1(x131)))\n\tx134 := (uint64(fiatScalarUint1(x133)) + uint64(fiatScalarUint1(x112)))\n\tvar x135 uint64\n\tvar x136 uint64\n\tx136, x135 = bits.Mul64(x3, arg2[3])\n\tvar x137 uint64\n\tvar x138 uint64\n\tx138, x137 = bits.Mul64(x3, arg2[2])\n\tvar x139 uint64\n\tvar x140 uint64\n\tx140, x139 = bits.Mul64(x3, arg2[1])\n\tvar x141 uint64\n\tvar x142 uint64\n\tx142, x141 = bits.Mul64(x3, arg2[0])\n\tvar x143 uint64\n\tvar x144 uint64\n\tx143, x144 = bits.Add64(x142, x139, uint64(0x0))\n\tvar x145 uint64\n\tvar x146 uint64\n\tx145, x146 = bits.Add64(x140, x137, uint64(fiatScalarUint1(x144)))\n\tvar x147 uint64\n\tvar x148 uint64\n\tx147, x148 = bits.Add64(x138, x135, uint64(fiatScalarUint1(x146)))\n\tx149 := (uint64(fiatScalarUint1(x148)) + x136)\n\tvar x150 uint64\n\tvar x151 uint64\n\tx150, x151 = bits.Add64(x126, x141, uint64(0x0))\n\tvar x152 uint64\n\tvar x153 uint64\n\tx152, x153 = bits.Add64(x128, x143, uint64(fiatScalarUint1(x151)))\n\tvar x154 uint64\n\tvar x155 uint64\n\tx154, x155 = bits.Add64(x130, x145, uint64(fiatScalarUint1(x153)))\n\tvar x156 uint64\n\tvar x157 uint64\n\tx156, x157 = bits.Add64(x132, x147, uint64(fiatScalarUint1(x155)))\n\tvar x158 uint64\n\tvar x159 uint64\n\tx158, x159 = bits.Add64(x134, x149, uint64(fiatScalarUint1(x157)))\n\tvar x160 uint64\n\t_, x160 = bits.Mul64(x150, 0xd2b51da312547e1b)\n\tvar x162 uint64\n\tvar x163 uint64\n\tx163, x162 = bits.Mul64(x160, 0x1000000000000000)\n\tvar x164 uint64\n\tvar x165 uint64\n\tx165, x164 = bits.Mul64(x160, 0x14def9dea2f79cd6)\n\tvar x166 uint64\n\tvar x167 uint64\n\tx167, x166 = bits.Mul64(x160, 0x5812631a5cf5d3ed)\n\tvar x168 uint64\n\tvar x169 uint64\n\tx168, x169 = bits.Add64(x167, x164, uint64(0x0))\n\tx170 := (uint64(fiatScalarUint1(x169)) + x165)\n\tvar x172 uint64\n\t_, x172 = bits.Add64(x150, x166, uint64(0x0))\n\tvar x173 uint64\n\tvar x174 uint64\n\tx173, x174 = bits.Add64(x152, x168, uint64(fiatScalarUint1(x172)))\n\tvar x175 uint64\n\tvar x176 uint64\n\tx175, x176 = bits.Add64(x154, x170, uint64(fiatScalarUint1(x174)))\n\tvar x177 uint64\n\tvar x178 uint64\n\tx177, x178 = bits.Add64(x156, x162, uint64(fiatScalarUint1(x176)))\n\tvar x179 uint64\n\tvar x180 uint64\n\tx179, x180 = bits.Add64(x158, x163, uint64(fiatScalarUint1(x178)))\n\tx181 := (uint64(fiatScalarUint1(x180)) + uint64(fiatScalarUint1(x159)))\n\tvar x182 uint64\n\tvar x183 uint64\n\tx182, x183 = bits.Sub64(x173, 0x5812631a5cf5d3ed, uint64(0x0))\n\tvar x184 uint64\n\tvar x185 uint64\n\tx184, x185 = bits.Sub64(x175, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x183)))\n\tvar x186 uint64\n\tvar x187 uint64\n\tx186, x187 = bits.Sub64(x177, uint64(0x0), uint64(fiatScalarUint1(x185)))\n\tvar x188 uint64\n\tvar x189 uint64\n\tx188, x189 = bits.Sub64(x179, 0x1000000000000000, uint64(fiatScalarUint1(x187)))\n\tvar x191 uint64\n\t_, x191 = bits.Sub64(x181, uint64(0x0), uint64(fiatScalarUint1(x189)))\n\tvar x192 uint64\n\tfiatScalarCmovznzU64(&x192, fiatScalarUint1(x191), x182, x173)\n\tvar x193 uint64\n\tfiatScalarCmovznzU64(&x193, fiatScalarUint1(x191), x184, x175)\n\tvar x194 uint64\n\tfiatScalarCmovznzU64(&x194, fiatScalarUint1(x191), x186, x177)\n\tvar x195 uint64\n\tfiatScalarCmovznzU64(&x195, fiatScalarUint1(x191), x188, x179)\n\tout1[0] = x192\n\tout1[1] = x193\n\tout1[2] = x194\n\tout1[3] = x195\n}\n\n// fiatScalarAdd adds two field elements in the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\t0 ≤ eval arg2 < m\n//\n// Postconditions:\n//\n//\teval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarAdd(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) {\n\tvar x1 uint64\n\tvar x2 uint64\n\tx1, x2 = bits.Add64(arg1[0], arg2[0], uint64(0x0))\n\tvar x3 uint64\n\tvar x4 uint64\n\tx3, x4 = bits.Add64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2)))\n\tvar x5 uint64\n\tvar x6 uint64\n\tx5, x6 = bits.Add64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4)))\n\tvar x7 uint64\n\tvar x8 uint64\n\tx7, x8 = bits.Add64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6)))\n\tvar x9 uint64\n\tvar x10 uint64\n\tx9, x10 = bits.Sub64(x1, 0x5812631a5cf5d3ed, uint64(0x0))\n\tvar x11 uint64\n\tvar x12 uint64\n\tx11, x12 = bits.Sub64(x3, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x10)))\n\tvar x13 uint64\n\tvar x14 uint64\n\tx13, x14 = bits.Sub64(x5, uint64(0x0), uint64(fiatScalarUint1(x12)))\n\tvar x15 uint64\n\tvar x16 uint64\n\tx15, x16 = bits.Sub64(x7, 0x1000000000000000, uint64(fiatScalarUint1(x14)))\n\tvar x18 uint64\n\t_, x18 = bits.Sub64(uint64(fiatScalarUint1(x8)), uint64(0x0), uint64(fiatScalarUint1(x16)))\n\tvar x19 uint64\n\tfiatScalarCmovznzU64(&x19, fiatScalarUint1(x18), x9, x1)\n\tvar x20 uint64\n\tfiatScalarCmovznzU64(&x20, fiatScalarUint1(x18), x11, x3)\n\tvar x21 uint64\n\tfiatScalarCmovznzU64(&x21, fiatScalarUint1(x18), x13, x5)\n\tvar x22 uint64\n\tfiatScalarCmovznzU64(&x22, fiatScalarUint1(x18), x15, x7)\n\tout1[0] = x19\n\tout1[1] = x20\n\tout1[2] = x21\n\tout1[3] = x22\n}\n\n// fiatScalarSub subtracts two field elements in the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\t0 ≤ eval arg2 < m\n//\n// Postconditions:\n//\n//\teval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarSub(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) {\n\tvar x1 uint64\n\tvar x2 uint64\n\tx1, x2 = bits.Sub64(arg1[0], arg2[0], uint64(0x0))\n\tvar x3 uint64\n\tvar x4 uint64\n\tx3, x4 = bits.Sub64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2)))\n\tvar x5 uint64\n\tvar x6 uint64\n\tx5, x6 = bits.Sub64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4)))\n\tvar x7 uint64\n\tvar x8 uint64\n\tx7, x8 = bits.Sub64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6)))\n\tvar x9 uint64\n\tfiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff)\n\tvar x10 uint64\n\tvar x11 uint64\n\tx10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0))\n\tvar x12 uint64\n\tvar x13 uint64\n\tx12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11)))\n\tvar x14 uint64\n\tvar x15 uint64\n\tx14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13)))\n\tvar x16 uint64\n\tx16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15)))\n\tout1[0] = x10\n\tout1[1] = x12\n\tout1[2] = x14\n\tout1[3] = x16\n}\n\n// fiatScalarOpp negates a field element in the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\n// Postconditions:\n//\n//\teval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarOpp(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) {\n\tvar x1 uint64\n\tvar x2 uint64\n\tx1, x2 = bits.Sub64(uint64(0x0), arg1[0], uint64(0x0))\n\tvar x3 uint64\n\tvar x4 uint64\n\tx3, x4 = bits.Sub64(uint64(0x0), arg1[1], uint64(fiatScalarUint1(x2)))\n\tvar x5 uint64\n\tvar x6 uint64\n\tx5, x6 = bits.Sub64(uint64(0x0), arg1[2], uint64(fiatScalarUint1(x4)))\n\tvar x7 uint64\n\tvar x8 uint64\n\tx7, x8 = bits.Sub64(uint64(0x0), arg1[3], uint64(fiatScalarUint1(x6)))\n\tvar x9 uint64\n\tfiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff)\n\tvar x10 uint64\n\tvar x11 uint64\n\tx10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0))\n\tvar x12 uint64\n\tvar x13 uint64\n\tx12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11)))\n\tvar x14 uint64\n\tvar x15 uint64\n\tx14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13)))\n\tvar x16 uint64\n\tx16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15)))\n\tout1[0] = x10\n\tout1[1] = x12\n\tout1[2] = x14\n\tout1[3] = x16\n}\n\n// fiatScalarNonzero outputs a single non-zero word if the input is non-zero and zero otherwise.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\n// Postconditions:\n//\n//\tout1 = 0 ↔ eval (from_montgomery arg1) mod m = 0\n//\n// Input Bounds:\n//\n//\targ1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]\n//\n// Output Bounds:\n//\n//\tout1: [0x0 ~> 0xffffffffffffffff]\nfunc fiatScalarNonzero(out1 *uint64, arg1 *[4]uint64) {\n\tx1 := (arg1[0] | (arg1[1] | (arg1[2] | arg1[3])))\n\t*out1 = x1\n}\n\n// fiatScalarFromMontgomery translates a field element out of the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\n// Postconditions:\n//\n//\teval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarFromMontgomery(out1 *fiatScalarNonMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) {\n\tx1 := arg1[0]\n\tvar x2 uint64\n\t_, x2 = bits.Mul64(x1, 0xd2b51da312547e1b)\n\tvar x4 uint64\n\tvar x5 uint64\n\tx5, x4 = bits.Mul64(x2, 0x1000000000000000)\n\tvar x6 uint64\n\tvar x7 uint64\n\tx7, x6 = bits.Mul64(x2, 0x14def9dea2f79cd6)\n\tvar x8 uint64\n\tvar x9 uint64\n\tx9, x8 = bits.Mul64(x2, 0x5812631a5cf5d3ed)\n\tvar x10 uint64\n\tvar x11 uint64\n\tx10, x11 = bits.Add64(x9, x6, uint64(0x0))\n\tvar x13 uint64\n\t_, x13 = bits.Add64(x1, x8, uint64(0x0))\n\tvar x14 uint64\n\tvar x15 uint64\n\tx14, x15 = bits.Add64(uint64(0x0), x10, uint64(fiatScalarUint1(x13)))\n\tvar x16 uint64\n\tvar x17 uint64\n\tx16, x17 = bits.Add64(x14, arg1[1], uint64(0x0))\n\tvar x18 uint64\n\t_, x18 = bits.Mul64(x16, 0xd2b51da312547e1b)\n\tvar x20 uint64\n\tvar x21 uint64\n\tx21, x20 = bits.Mul64(x18, 0x1000000000000000)\n\tvar x22 uint64\n\tvar x23 uint64\n\tx23, x22 = bits.Mul64(x18, 0x14def9dea2f79cd6)\n\tvar x24 uint64\n\tvar x25 uint64\n\tx25, x24 = bits.Mul64(x18, 0x5812631a5cf5d3ed)\n\tvar x26 uint64\n\tvar x27 uint64\n\tx26, x27 = bits.Add64(x25, x22, uint64(0x0))\n\tvar x29 uint64\n\t_, x29 = bits.Add64(x16, x24, uint64(0x0))\n\tvar x30 uint64\n\tvar x31 uint64\n\tx30, x31 = bits.Add64((uint64(fiatScalarUint1(x17)) + (uint64(fiatScalarUint1(x15)) + (uint64(fiatScalarUint1(x11)) + x7))), x26, uint64(fiatScalarUint1(x29)))\n\tvar x32 uint64\n\tvar x33 uint64\n\tx32, x33 = bits.Add64(x4, (uint64(fiatScalarUint1(x27)) + x23), uint64(fiatScalarUint1(x31)))\n\tvar x34 uint64\n\tvar x35 uint64\n\tx34, x35 = bits.Add64(x5, x20, uint64(fiatScalarUint1(x33)))\n\tvar x36 uint64\n\tvar x37 uint64\n\tx36, x37 = bits.Add64(x30, arg1[2], uint64(0x0))\n\tvar x38 uint64\n\tvar x39 uint64\n\tx38, x39 = bits.Add64(x32, uint64(0x0), uint64(fiatScalarUint1(x37)))\n\tvar x40 uint64\n\tvar x41 uint64\n\tx40, x41 = bits.Add64(x34, uint64(0x0), uint64(fiatScalarUint1(x39)))\n\tvar x42 uint64\n\t_, x42 = bits.Mul64(x36, 0xd2b51da312547e1b)\n\tvar x44 uint64\n\tvar x45 uint64\n\tx45, x44 = bits.Mul64(x42, 0x1000000000000000)\n\tvar x46 uint64\n\tvar x47 uint64\n\tx47, x46 = bits.Mul64(x42, 0x14def9dea2f79cd6)\n\tvar x48 uint64\n\tvar x49 uint64\n\tx49, x48 = bits.Mul64(x42, 0x5812631a5cf5d3ed)\n\tvar x50 uint64\n\tvar x51 uint64\n\tx50, x51 = bits.Add64(x49, x46, uint64(0x0))\n\tvar x53 uint64\n\t_, x53 = bits.Add64(x36, x48, uint64(0x0))\n\tvar x54 uint64\n\tvar x55 uint64\n\tx54, x55 = bits.Add64(x38, x50, uint64(fiatScalarUint1(x53)))\n\tvar x56 uint64\n\tvar x57 uint64\n\tx56, x57 = bits.Add64(x40, (uint64(fiatScalarUint1(x51)) + x47), uint64(fiatScalarUint1(x55)))\n\tvar x58 uint64\n\tvar x59 uint64\n\tx58, x59 = bits.Add64((uint64(fiatScalarUint1(x41)) + (uint64(fiatScalarUint1(x35)) + x21)), x44, uint64(fiatScalarUint1(x57)))\n\tvar x60 uint64\n\tvar x61 uint64\n\tx60, x61 = bits.Add64(x54, arg1[3], uint64(0x0))\n\tvar x62 uint64\n\tvar x63 uint64\n\tx62, x63 = bits.Add64(x56, uint64(0x0), uint64(fiatScalarUint1(x61)))\n\tvar x64 uint64\n\tvar x65 uint64\n\tx64, x65 = bits.Add64(x58, uint64(0x0), uint64(fiatScalarUint1(x63)))\n\tvar x66 uint64\n\t_, x66 = bits.Mul64(x60, 0xd2b51da312547e1b)\n\tvar x68 uint64\n\tvar x69 uint64\n\tx69, x68 = bits.Mul64(x66, 0x1000000000000000)\n\tvar x70 uint64\n\tvar x71 uint64\n\tx71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6)\n\tvar x72 uint64\n\tvar x73 uint64\n\tx73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed)\n\tvar x74 uint64\n\tvar x75 uint64\n\tx74, x75 = bits.Add64(x73, x70, uint64(0x0))\n\tvar x77 uint64\n\t_, x77 = bits.Add64(x60, x72, uint64(0x0))\n\tvar x78 uint64\n\tvar x79 uint64\n\tx78, x79 = bits.Add64(x62, x74, uint64(fiatScalarUint1(x77)))\n\tvar x80 uint64\n\tvar x81 uint64\n\tx80, x81 = bits.Add64(x64, (uint64(fiatScalarUint1(x75)) + x71), uint64(fiatScalarUint1(x79)))\n\tvar x82 uint64\n\tvar x83 uint64\n\tx82, x83 = bits.Add64((uint64(fiatScalarUint1(x65)) + (uint64(fiatScalarUint1(x59)) + x45)), x68, uint64(fiatScalarUint1(x81)))\n\tx84 := (uint64(fiatScalarUint1(x83)) + x69)\n\tvar x85 uint64\n\tvar x86 uint64\n\tx85, x86 = bits.Sub64(x78, 0x5812631a5cf5d3ed, uint64(0x0))\n\tvar x87 uint64\n\tvar x88 uint64\n\tx87, x88 = bits.Sub64(x80, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x86)))\n\tvar x89 uint64\n\tvar x90 uint64\n\tx89, x90 = bits.Sub64(x82, uint64(0x0), uint64(fiatScalarUint1(x88)))\n\tvar x91 uint64\n\tvar x92 uint64\n\tx91, x92 = bits.Sub64(x84, 0x1000000000000000, uint64(fiatScalarUint1(x90)))\n\tvar x94 uint64\n\t_, x94 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x92)))\n\tvar x95 uint64\n\tfiatScalarCmovznzU64(&x95, fiatScalarUint1(x94), x85, x78)\n\tvar x96 uint64\n\tfiatScalarCmovznzU64(&x96, fiatScalarUint1(x94), x87, x80)\n\tvar x97 uint64\n\tfiatScalarCmovznzU64(&x97, fiatScalarUint1(x94), x89, x82)\n\tvar x98 uint64\n\tfiatScalarCmovznzU64(&x98, fiatScalarUint1(x94), x91, x84)\n\tout1[0] = x95\n\tout1[1] = x96\n\tout1[2] = x97\n\tout1[3] = x98\n}\n\n// fiatScalarToMontgomery translates a field element into the Montgomery domain.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\n// Postconditions:\n//\n//\teval (from_montgomery out1) mod m = eval arg1 mod m\n//\t0 ≤ eval out1 < m\nfunc fiatScalarToMontgomery(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarNonMontgomeryDomainFieldElement) {\n\tx1 := arg1[1]\n\tx2 := arg1[2]\n\tx3 := arg1[3]\n\tx4 := arg1[0]\n\tvar x5 uint64\n\tvar x6 uint64\n\tx6, x5 = bits.Mul64(x4, 0x399411b7c309a3d)\n\tvar x7 uint64\n\tvar x8 uint64\n\tx8, x7 = bits.Mul64(x4, 0xceec73d217f5be65)\n\tvar x9 uint64\n\tvar x10 uint64\n\tx10, x9 = bits.Mul64(x4, 0xd00e1ba768859347)\n\tvar x11 uint64\n\tvar x12 uint64\n\tx12, x11 = bits.Mul64(x4, 0xa40611e3449c0f01)\n\tvar x13 uint64\n\tvar x14 uint64\n\tx13, x14 = bits.Add64(x12, x9, uint64(0x0))\n\tvar x15 uint64\n\tvar x16 uint64\n\tx15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14)))\n\tvar x17 uint64\n\tvar x18 uint64\n\tx17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16)))\n\tvar x19 uint64\n\t_, x19 = bits.Mul64(x11, 0xd2b51da312547e1b)\n\tvar x21 uint64\n\tvar x22 uint64\n\tx22, x21 = bits.Mul64(x19, 0x1000000000000000)\n\tvar x23 uint64\n\tvar x24 uint64\n\tx24, x23 = bits.Mul64(x19, 0x14def9dea2f79cd6)\n\tvar x25 uint64\n\tvar x26 uint64\n\tx26, x25 = bits.Mul64(x19, 0x5812631a5cf5d3ed)\n\tvar x27 uint64\n\tvar x28 uint64\n\tx27, x28 = bits.Add64(x26, x23, uint64(0x0))\n\tvar x30 uint64\n\t_, x30 = bits.Add64(x11, x25, uint64(0x0))\n\tvar x31 uint64\n\tvar x32 uint64\n\tx31, x32 = bits.Add64(x13, x27, uint64(fiatScalarUint1(x30)))\n\tvar x33 uint64\n\tvar x34 uint64\n\tx33, x34 = bits.Add64(x15, (uint64(fiatScalarUint1(x28)) + x24), uint64(fiatScalarUint1(x32)))\n\tvar x35 uint64\n\tvar x36 uint64\n\tx35, x36 = bits.Add64(x17, x21, uint64(fiatScalarUint1(x34)))\n\tvar x37 uint64\n\tvar x38 uint64\n\tx38, x37 = bits.Mul64(x1, 0x399411b7c309a3d)\n\tvar x39 uint64\n\tvar x40 uint64\n\tx40, x39 = bits.Mul64(x1, 0xceec73d217f5be65)\n\tvar x41 uint64\n\tvar x42 uint64\n\tx42, x41 = bits.Mul64(x1, 0xd00e1ba768859347)\n\tvar x43 uint64\n\tvar x44 uint64\n\tx44, x43 = bits.Mul64(x1, 0xa40611e3449c0f01)\n\tvar x45 uint64\n\tvar x46 uint64\n\tx45, x46 = bits.Add64(x44, x41, uint64(0x0))\n\tvar x47 uint64\n\tvar x48 uint64\n\tx47, x48 = bits.Add64(x42, x39, uint64(fiatScalarUint1(x46)))\n\tvar x49 uint64\n\tvar x50 uint64\n\tx49, x50 = bits.Add64(x40, x37, uint64(fiatScalarUint1(x48)))\n\tvar x51 uint64\n\tvar x52 uint64\n\tx51, x52 = bits.Add64(x31, x43, uint64(0x0))\n\tvar x53 uint64\n\tvar x54 uint64\n\tx53, x54 = bits.Add64(x33, x45, uint64(fiatScalarUint1(x52)))\n\tvar x55 uint64\n\tvar x56 uint64\n\tx55, x56 = bits.Add64(x35, x47, uint64(fiatScalarUint1(x54)))\n\tvar x57 uint64\n\tvar x58 uint64\n\tx57, x58 = bits.Add64(((uint64(fiatScalarUint1(x36)) + (uint64(fiatScalarUint1(x18)) + x6)) + x22), x49, uint64(fiatScalarUint1(x56)))\n\tvar x59 uint64\n\t_, x59 = bits.Mul64(x51, 0xd2b51da312547e1b)\n\tvar x61 uint64\n\tvar x62 uint64\n\tx62, x61 = bits.Mul64(x59, 0x1000000000000000)\n\tvar x63 uint64\n\tvar x64 uint64\n\tx64, x63 = bits.Mul64(x59, 0x14def9dea2f79cd6)\n\tvar x65 uint64\n\tvar x66 uint64\n\tx66, x65 = bits.Mul64(x59, 0x5812631a5cf5d3ed)\n\tvar x67 uint64\n\tvar x68 uint64\n\tx67, x68 = bits.Add64(x66, x63, uint64(0x0))\n\tvar x70 uint64\n\t_, x70 = bits.Add64(x51, x65, uint64(0x0))\n\tvar x71 uint64\n\tvar x72 uint64\n\tx71, x72 = bits.Add64(x53, x67, uint64(fiatScalarUint1(x70)))\n\tvar x73 uint64\n\tvar x74 uint64\n\tx73, x74 = bits.Add64(x55, (uint64(fiatScalarUint1(x68)) + x64), uint64(fiatScalarUint1(x72)))\n\tvar x75 uint64\n\tvar x76 uint64\n\tx75, x76 = bits.Add64(x57, x61, uint64(fiatScalarUint1(x74)))\n\tvar x77 uint64\n\tvar x78 uint64\n\tx78, x77 = bits.Mul64(x2, 0x399411b7c309a3d)\n\tvar x79 uint64\n\tvar x80 uint64\n\tx80, x79 = bits.Mul64(x2, 0xceec73d217f5be65)\n\tvar x81 uint64\n\tvar x82 uint64\n\tx82, x81 = bits.Mul64(x2, 0xd00e1ba768859347)\n\tvar x83 uint64\n\tvar x84 uint64\n\tx84, x83 = bits.Mul64(x2, 0xa40611e3449c0f01)\n\tvar x85 uint64\n\tvar x86 uint64\n\tx85, x86 = bits.Add64(x84, x81, uint64(0x0))\n\tvar x87 uint64\n\tvar x88 uint64\n\tx87, x88 = bits.Add64(x82, x79, uint64(fiatScalarUint1(x86)))\n\tvar x89 uint64\n\tvar x90 uint64\n\tx89, x90 = bits.Add64(x80, x77, uint64(fiatScalarUint1(x88)))\n\tvar x91 uint64\n\tvar x92 uint64\n\tx91, x92 = bits.Add64(x71, x83, uint64(0x0))\n\tvar x93 uint64\n\tvar x94 uint64\n\tx93, x94 = bits.Add64(x73, x85, uint64(fiatScalarUint1(x92)))\n\tvar x95 uint64\n\tvar x96 uint64\n\tx95, x96 = bits.Add64(x75, x87, uint64(fiatScalarUint1(x94)))\n\tvar x97 uint64\n\tvar x98 uint64\n\tx97, x98 = bits.Add64(((uint64(fiatScalarUint1(x76)) + (uint64(fiatScalarUint1(x58)) + (uint64(fiatScalarUint1(x50)) + x38))) + x62), x89, uint64(fiatScalarUint1(x96)))\n\tvar x99 uint64\n\t_, x99 = bits.Mul64(x91, 0xd2b51da312547e1b)\n\tvar x101 uint64\n\tvar x102 uint64\n\tx102, x101 = bits.Mul64(x99, 0x1000000000000000)\n\tvar x103 uint64\n\tvar x104 uint64\n\tx104, x103 = bits.Mul64(x99, 0x14def9dea2f79cd6)\n\tvar x105 uint64\n\tvar x106 uint64\n\tx106, x105 = bits.Mul64(x99, 0x5812631a5cf5d3ed)\n\tvar x107 uint64\n\tvar x108 uint64\n\tx107, x108 = bits.Add64(x106, x103, uint64(0x0))\n\tvar x110 uint64\n\t_, x110 = bits.Add64(x91, x105, uint64(0x0))\n\tvar x111 uint64\n\tvar x112 uint64\n\tx111, x112 = bits.Add64(x93, x107, uint64(fiatScalarUint1(x110)))\n\tvar x113 uint64\n\tvar x114 uint64\n\tx113, x114 = bits.Add64(x95, (uint64(fiatScalarUint1(x108)) + x104), uint64(fiatScalarUint1(x112)))\n\tvar x115 uint64\n\tvar x116 uint64\n\tx115, x116 = bits.Add64(x97, x101, uint64(fiatScalarUint1(x114)))\n\tvar x117 uint64\n\tvar x118 uint64\n\tx118, x117 = bits.Mul64(x3, 0x399411b7c309a3d)\n\tvar x119 uint64\n\tvar x120 uint64\n\tx120, x119 = bits.Mul64(x3, 0xceec73d217f5be65)\n\tvar x121 uint64\n\tvar x122 uint64\n\tx122, x121 = bits.Mul64(x3, 0xd00e1ba768859347)\n\tvar x123 uint64\n\tvar x124 uint64\n\tx124, x123 = bits.Mul64(x3, 0xa40611e3449c0f01)\n\tvar x125 uint64\n\tvar x126 uint64\n\tx125, x126 = bits.Add64(x124, x121, uint64(0x0))\n\tvar x127 uint64\n\tvar x128 uint64\n\tx127, x128 = bits.Add64(x122, x119, uint64(fiatScalarUint1(x126)))\n\tvar x129 uint64\n\tvar x130 uint64\n\tx129, x130 = bits.Add64(x120, x117, uint64(fiatScalarUint1(x128)))\n\tvar x131 uint64\n\tvar x132 uint64\n\tx131, x132 = bits.Add64(x111, x123, uint64(0x0))\n\tvar x133 uint64\n\tvar x134 uint64\n\tx133, x134 = bits.Add64(x113, x125, uint64(fiatScalarUint1(x132)))\n\tvar x135 uint64\n\tvar x136 uint64\n\tx135, x136 = bits.Add64(x115, x127, uint64(fiatScalarUint1(x134)))\n\tvar x137 uint64\n\tvar x138 uint64\n\tx137, x138 = bits.Add64(((uint64(fiatScalarUint1(x116)) + (uint64(fiatScalarUint1(x98)) + (uint64(fiatScalarUint1(x90)) + x78))) + x102), x129, uint64(fiatScalarUint1(x136)))\n\tvar x139 uint64\n\t_, x139 = bits.Mul64(x131, 0xd2b51da312547e1b)\n\tvar x141 uint64\n\tvar x142 uint64\n\tx142, x141 = bits.Mul64(x139, 0x1000000000000000)\n\tvar x143 uint64\n\tvar x144 uint64\n\tx144, x143 = bits.Mul64(x139, 0x14def9dea2f79cd6)\n\tvar x145 uint64\n\tvar x146 uint64\n\tx146, x145 = bits.Mul64(x139, 0x5812631a5cf5d3ed)\n\tvar x147 uint64\n\tvar x148 uint64\n\tx147, x148 = bits.Add64(x146, x143, uint64(0x0))\n\tvar x150 uint64\n\t_, x150 = bits.Add64(x131, x145, uint64(0x0))\n\tvar x151 uint64\n\tvar x152 uint64\n\tx151, x152 = bits.Add64(x133, x147, uint64(fiatScalarUint1(x150)))\n\tvar x153 uint64\n\tvar x154 uint64\n\tx153, x154 = bits.Add64(x135, (uint64(fiatScalarUint1(x148)) + x144), uint64(fiatScalarUint1(x152)))\n\tvar x155 uint64\n\tvar x156 uint64\n\tx155, x156 = bits.Add64(x137, x141, uint64(fiatScalarUint1(x154)))\n\tx157 := ((uint64(fiatScalarUint1(x156)) + (uint64(fiatScalarUint1(x138)) + (uint64(fiatScalarUint1(x130)) + x118))) + x142)\n\tvar x158 uint64\n\tvar x159 uint64\n\tx158, x159 = bits.Sub64(x151, 0x5812631a5cf5d3ed, uint64(0x0))\n\tvar x160 uint64\n\tvar x161 uint64\n\tx160, x161 = bits.Sub64(x153, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x159)))\n\tvar x162 uint64\n\tvar x163 uint64\n\tx162, x163 = bits.Sub64(x155, uint64(0x0), uint64(fiatScalarUint1(x161)))\n\tvar x164 uint64\n\tvar x165 uint64\n\tx164, x165 = bits.Sub64(x157, 0x1000000000000000, uint64(fiatScalarUint1(x163)))\n\tvar x167 uint64\n\t_, x167 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x165)))\n\tvar x168 uint64\n\tfiatScalarCmovznzU64(&x168, fiatScalarUint1(x167), x158, x151)\n\tvar x169 uint64\n\tfiatScalarCmovznzU64(&x169, fiatScalarUint1(x167), x160, x153)\n\tvar x170 uint64\n\tfiatScalarCmovznzU64(&x170, fiatScalarUint1(x167), x162, x155)\n\tvar x171 uint64\n\tfiatScalarCmovznzU64(&x171, fiatScalarUint1(x167), x164, x157)\n\tout1[0] = x168\n\tout1[1] = x169\n\tout1[2] = x170\n\tout1[3] = x171\n}\n\n// fiatScalarToBytes serializes a field element NOT in the Montgomery domain to bytes in little-endian order.\n//\n// Preconditions:\n//\n//\t0 ≤ eval arg1 < m\n//\n// Postconditions:\n//\n//\tout1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..31]\n//\n// Input Bounds:\n//\n//\targ1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]]\n//\n// Output Bounds:\n//\n//\tout1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]]\nfunc fiatScalarToBytes(out1 *[32]uint8, arg1 *[4]uint64) {\n\tx1 := arg1[3]\n\tx2 := arg1[2]\n\tx3 := arg1[1]\n\tx4 := arg1[0]\n\tx5 := (uint8(x4) & 0xff)\n\tx6 := (x4 >> 8)\n\tx7 := (uint8(x6) & 0xff)\n\tx8 := (x6 >> 8)\n\tx9 := (uint8(x8) & 0xff)\n\tx10 := (x8 >> 8)\n\tx11 := (uint8(x10) & 0xff)\n\tx12 := (x10 >> 8)\n\tx13 := (uint8(x12) & 0xff)\n\tx14 := (x12 >> 8)\n\tx15 := (uint8(x14) & 0xff)\n\tx16 := (x14 >> 8)\n\tx17 := (uint8(x16) & 0xff)\n\tx18 := uint8((x16 >> 8))\n\tx19 := (uint8(x3) & 0xff)\n\tx20 := (x3 >> 8)\n\tx21 := (uint8(x20) & 0xff)\n\tx22 := (x20 >> 8)\n\tx23 := (uint8(x22) & 0xff)\n\tx24 := (x22 >> 8)\n\tx25 := (uint8(x24) & 0xff)\n\tx26 := (x24 >> 8)\n\tx27 := (uint8(x26) & 0xff)\n\tx28 := (x26 >> 8)\n\tx29 := (uint8(x28) & 0xff)\n\tx30 := (x28 >> 8)\n\tx31 := (uint8(x30) & 0xff)\n\tx32 := uint8((x30 >> 8))\n\tx33 := (uint8(x2) & 0xff)\n\tx34 := (x2 >> 8)\n\tx35 := (uint8(x34) & 0xff)\n\tx36 := (x34 >> 8)\n\tx37 := (uint8(x36) & 0xff)\n\tx38 := (x36 >> 8)\n\tx39 := (uint8(x38) & 0xff)\n\tx40 := (x38 >> 8)\n\tx41 := (uint8(x40) & 0xff)\n\tx42 := (x40 >> 8)\n\tx43 := (uint8(x42) & 0xff)\n\tx44 := (x42 >> 8)\n\tx45 := (uint8(x44) & 0xff)\n\tx46 := uint8((x44 >> 8))\n\tx47 := (uint8(x1) & 0xff)\n\tx48 := (x1 >> 8)\n\tx49 := (uint8(x48) & 0xff)\n\tx50 := (x48 >> 8)\n\tx51 := (uint8(x50) & 0xff)\n\tx52 := (x50 >> 8)\n\tx53 := (uint8(x52) & 0xff)\n\tx54 := (x52 >> 8)\n\tx55 := (uint8(x54) & 0xff)\n\tx56 := (x54 >> 8)\n\tx57 := (uint8(x56) & 0xff)\n\tx58 := (x56 >> 8)\n\tx59 := (uint8(x58) & 0xff)\n\tx60 := uint8((x58 >> 8))\n\tout1[0] = x5\n\tout1[1] = x7\n\tout1[2] = x9\n\tout1[3] = x11\n\tout1[4] = x13\n\tout1[5] = x15\n\tout1[6] = x17\n\tout1[7] = x18\n\tout1[8] = x19\n\tout1[9] = x21\n\tout1[10] = x23\n\tout1[11] = x25\n\tout1[12] = x27\n\tout1[13] = x29\n\tout1[14] = x31\n\tout1[15] = x32\n\tout1[16] = x33\n\tout1[17] = x35\n\tout1[18] = x37\n\tout1[19] = x39\n\tout1[20] = x41\n\tout1[21] = x43\n\tout1[22] = x45\n\tout1[23] = x46\n\tout1[24] = x47\n\tout1[25] = x49\n\tout1[26] = x51\n\tout1[27] = x53\n\tout1[28] = x55\n\tout1[29] = x57\n\tout1[30] = x59\n\tout1[31] = x60\n}\n\n// fiatScalarFromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order.\n//\n// Preconditions:\n//\n//\t0 ≤ bytes_eval arg1 < m\n//\n// Postconditions:\n//\n//\teval out1 mod m = bytes_eval arg1 mod m\n//\t0 ≤ eval out1 < m\n//\n// Input Bounds:\n//\n//\targ1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]]\n//\n// Output Bounds:\n//\n//\tout1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]]\nfunc fiatScalarFromBytes(out1 *[4]uint64, arg1 *[32]uint8) {\n\tx1 := (uint64(arg1[31]) << 56)\n\tx2 := (uint64(arg1[30]) << 48)\n\tx3 := (uint64(arg1[29]) << 40)\n\tx4 := (uint64(arg1[28]) << 32)\n\tx5 := (uint64(arg1[27]) << 24)\n\tx6 := (uint64(arg1[26]) << 16)\n\tx7 := (uint64(arg1[25]) << 8)\n\tx8 := arg1[24]\n\tx9 := (uint64(arg1[23]) << 56)\n\tx10 := (uint64(arg1[22]) << 48)\n\tx11 := (uint64(arg1[21]) << 40)\n\tx12 := (uint64(arg1[20]) << 32)\n\tx13 := (uint64(arg1[19]) << 24)\n\tx14 := (uint64(arg1[18]) << 16)\n\tx15 := (uint64(arg1[17]) << 8)\n\tx16 := arg1[16]\n\tx17 := (uint64(arg1[15]) << 56)\n\tx18 := (uint64(arg1[14]) << 48)\n\tx19 := (uint64(arg1[13]) << 40)\n\tx20 := (uint64(arg1[12]) << 32)\n\tx21 := (uint64(arg1[11]) << 24)\n\tx22 := (uint64(arg1[10]) << 16)\n\tx23 := (uint64(arg1[9]) << 8)\n\tx24 := arg1[8]\n\tx25 := (uint64(arg1[7]) << 56)\n\tx26 := (uint64(arg1[6]) << 48)\n\tx27 := (uint64(arg1[5]) << 40)\n\tx28 := (uint64(arg1[4]) << 32)\n\tx29 := (uint64(arg1[3]) << 24)\n\tx30 := (uint64(arg1[2]) << 16)\n\tx31 := (uint64(arg1[1]) << 8)\n\tx32 := arg1[0]\n\tx33 := (x31 + uint64(x32))\n\tx34 := (x30 + x33)\n\tx35 := (x29 + x34)\n\tx36 := (x28 + x35)\n\tx37 := (x27 + x36)\n\tx38 := (x26 + x37)\n\tx39 := (x25 + x38)\n\tx40 := (x23 + uint64(x24))\n\tx41 := (x22 + x40)\n\tx42 := (x21 + x41)\n\tx43 := (x20 + x42)\n\tx44 := (x19 + x43)\n\tx45 := (x18 + x44)\n\tx46 := (x17 + x45)\n\tx47 := (x15 + uint64(x16))\n\tx48 := (x14 + x47)\n\tx49 := (x13 + x48)\n\tx50 := (x12 + x49)\n\tx51 := (x11 + x50)\n\tx52 := (x10 + x51)\n\tx53 := (x9 + x52)\n\tx54 := (x7 + uint64(x8))\n\tx55 := (x6 + x54)\n\tx56 := (x5 + x55)\n\tx57 := (x4 + x56)\n\tx58 := (x3 + x57)\n\tx59 := (x2 + x58)\n\tx60 := (x1 + x59)\n\tout1[0] = x39\n\tout1[1] = x46\n\tout1[2] = x53\n\tout1[3] = x60\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/scalarmult.go",
    "content": "// Copyright (c) 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage edwards25519\n\nimport \"sync\"\n\n// basepointTable is a set of 32 affineLookupTables, where table i is generated\n// from 256i * basepoint. It is precomputed the first time it's used.\nfunc basepointTable() *[32]affineLookupTable {\n\tbasepointTablePrecomp.initOnce.Do(func() {\n\t\tp := NewGeneratorPoint()\n\t\tfor i := 0; i < 32; i++ {\n\t\t\tbasepointTablePrecomp.table[i].FromP3(p)\n\t\t\tfor j := 0; j < 8; j++ {\n\t\t\t\tp.Add(p, p)\n\t\t\t}\n\t\t}\n\t})\n\treturn &basepointTablePrecomp.table\n}\n\nvar basepointTablePrecomp struct {\n\ttable    [32]affineLookupTable\n\tinitOnce sync.Once\n}\n\n// ScalarBaseMult sets v = x * B, where B is the canonical generator, and\n// returns v.\n//\n// The scalar multiplication is done in constant time.\nfunc (v *Point) ScalarBaseMult(x *Scalar) *Point {\n\tbasepointTable := basepointTable()\n\n\t// Write x = sum(x_i * 16^i) so  x*B = sum( B*x_i*16^i )\n\t// as described in the Ed25519 paper\n\t//\n\t// Group even and odd coefficients\n\t// x*B     = x_0*16^0*B + x_2*16^2*B + ... + x_62*16^62*B\n\t//         + x_1*16^1*B + x_3*16^3*B + ... + x_63*16^63*B\n\t// x*B     = x_0*16^0*B + x_2*16^2*B + ... + x_62*16^62*B\n\t//    + 16*( x_1*16^0*B + x_3*16^2*B + ... + x_63*16^62*B)\n\t//\n\t// We use a lookup table for each i to get x_i*16^(2*i)*B\n\t// and do four doublings to multiply by 16.\n\tdigits := x.signedRadix16()\n\n\tmultiple := &affineCached{}\n\ttmp1 := &projP1xP1{}\n\ttmp2 := &projP2{}\n\n\t// Accumulate the odd components first\n\tv.Set(NewIdentityPoint())\n\tfor i := 1; i < 64; i += 2 {\n\t\tbasepointTable[i/2].SelectInto(multiple, digits[i])\n\t\ttmp1.AddAffine(v, multiple)\n\t\tv.fromP1xP1(tmp1)\n\t}\n\n\t// Multiply by 16\n\ttmp2.FromP3(v)       // tmp2 =    v in P2 coords\n\ttmp1.Double(tmp2)    // tmp1 =  2*v in P1xP1 coords\n\ttmp2.FromP1xP1(tmp1) // tmp2 =  2*v in P2 coords\n\ttmp1.Double(tmp2)    // tmp1 =  4*v in P1xP1 coords\n\ttmp2.FromP1xP1(tmp1) // tmp2 =  4*v in P2 coords\n\ttmp1.Double(tmp2)    // tmp1 =  8*v in P1xP1 coords\n\ttmp2.FromP1xP1(tmp1) // tmp2 =  8*v in P2 coords\n\ttmp1.Double(tmp2)    // tmp1 = 16*v in P1xP1 coords\n\tv.fromP1xP1(tmp1)    // now v = 16*(odd components)\n\n\t// Accumulate the even components\n\tfor i := 0; i < 64; i += 2 {\n\t\tbasepointTable[i/2].SelectInto(multiple, digits[i])\n\t\ttmp1.AddAffine(v, multiple)\n\t\tv.fromP1xP1(tmp1)\n\t}\n\n\treturn v\n}\n\n// ScalarMult sets v = x * q, and returns v.\n//\n// The scalar multiplication is done in constant time.\nfunc (v *Point) ScalarMult(x *Scalar, q *Point) *Point {\n\tcheckInitialized(q)\n\n\tvar table projLookupTable\n\ttable.FromP3(q)\n\n\t// Write x = sum(x_i * 16^i)\n\t// so  x*Q = sum( Q*x_i*16^i )\n\t//         = Q*x_0 + 16*(Q*x_1 + 16*( ... + Q*x_63) ... )\n\t//           <------compute inside out---------\n\t//\n\t// We use the lookup table to get the x_i*Q values\n\t// and do four doublings to compute 16*Q\n\tdigits := x.signedRadix16()\n\n\t// Unwrap first loop iteration to save computing 16*identity\n\tmultiple := &projCached{}\n\ttmp1 := &projP1xP1{}\n\ttmp2 := &projP2{}\n\ttable.SelectInto(multiple, digits[63])\n\n\tv.Set(NewIdentityPoint())\n\ttmp1.Add(v, multiple) // tmp1 = x_63*Q in P1xP1 coords\n\tfor i := 62; i >= 0; i-- {\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =    (prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 =  2*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  2*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 =  4*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  4*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 =  8*(prev) in P1xP1 coords\n\t\ttmp2.FromP1xP1(tmp1) // tmp2 =  8*(prev) in P2 coords\n\t\ttmp1.Double(tmp2)    // tmp1 = 16*(prev) in P1xP1 coords\n\t\tv.fromP1xP1(tmp1)    //    v = 16*(prev) in P3 coords\n\t\ttable.SelectInto(multiple, digits[i])\n\t\ttmp1.Add(v, multiple) // tmp1 = x_i*Q + 16*(prev) in P1xP1 coords\n\t}\n\tv.fromP1xP1(tmp1)\n\treturn v\n}\n\n// basepointNafTable is the nafLookupTable8 for the basepoint.\n// It is precomputed the first time it's used.\nfunc basepointNafTable() *nafLookupTable8 {\n\tbasepointNafTablePrecomp.initOnce.Do(func() {\n\t\tbasepointNafTablePrecomp.table.FromP3(NewGeneratorPoint())\n\t})\n\treturn &basepointNafTablePrecomp.table\n}\n\nvar basepointNafTablePrecomp struct {\n\ttable    nafLookupTable8\n\tinitOnce sync.Once\n}\n\n// VarTimeDoubleScalarBaseMult sets v = a * A + b * B, where B is the canonical\n// generator, and returns v.\n//\n// Execution time depends on the inputs.\nfunc (v *Point) VarTimeDoubleScalarBaseMult(a *Scalar, A *Point, b *Scalar) *Point {\n\tcheckInitialized(A)\n\n\t// Similarly to the single variable-base approach, we compute\n\t// digits and use them with a lookup table.  However, because\n\t// we are allowed to do variable-time operations, we don't\n\t// need constant-time lookups or constant-time digit\n\t// computations.\n\t//\n\t// So we use a non-adjacent form of some width w instead of\n\t// radix 16.  This is like a binary representation (one digit\n\t// for each binary place) but we allow the digits to grow in\n\t// magnitude up to 2^{w-1} so that the nonzero digits are as\n\t// sparse as possible.  Intuitively, this \"condenses\" the\n\t// \"mass\" of the scalar onto sparse coefficients (meaning\n\t// fewer additions).\n\n\tbasepointNafTable := basepointNafTable()\n\tvar aTable nafLookupTable5\n\taTable.FromP3(A)\n\t// Because the basepoint is fixed, we can use a wider NAF\n\t// corresponding to a bigger table.\n\taNaf := a.nonAdjacentForm(5)\n\tbNaf := b.nonAdjacentForm(8)\n\n\t// Find the first nonzero coefficient.\n\ti := 255\n\tfor j := i; j >= 0; j-- {\n\t\tif aNaf[j] != 0 || bNaf[j] != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tmultA := &projCached{}\n\tmultB := &affineCached{}\n\ttmp1 := &projP1xP1{}\n\ttmp2 := &projP2{}\n\ttmp2.Zero()\n\n\t// Move from high to low bits, doubling the accumulator\n\t// at each iteration and checking whether there is a nonzero\n\t// coefficient to look up a multiple of.\n\tfor ; i >= 0; i-- {\n\t\ttmp1.Double(tmp2)\n\n\t\t// Only update v if we have a nonzero coeff to add in.\n\t\tif aNaf[i] > 0 {\n\t\t\tv.fromP1xP1(tmp1)\n\t\t\taTable.SelectInto(multA, aNaf[i])\n\t\t\ttmp1.Add(v, multA)\n\t\t} else if aNaf[i] < 0 {\n\t\t\tv.fromP1xP1(tmp1)\n\t\t\taTable.SelectInto(multA, -aNaf[i])\n\t\t\ttmp1.Sub(v, multA)\n\t\t}\n\n\t\tif bNaf[i] > 0 {\n\t\t\tv.fromP1xP1(tmp1)\n\t\t\tbasepointNafTable.SelectInto(multB, bNaf[i])\n\t\t\ttmp1.AddAffine(v, multB)\n\t\t} else if bNaf[i] < 0 {\n\t\t\tv.fromP1xP1(tmp1)\n\t\t\tbasepointNafTable.SelectInto(multB, -bNaf[i])\n\t\t\ttmp1.SubAffine(v, multB)\n\t\t}\n\n\t\ttmp2.FromP1xP1(tmp1)\n\t}\n\n\tv.fromP2(tmp2)\n\treturn v\n}\n"
  },
  {
    "path": "vendor/filippo.io/edwards25519/tables.go",
    "content": "// Copyright (c) 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage edwards25519\n\nimport (\n\t\"crypto/subtle\"\n)\n\n// A dynamic lookup table for variable-base, constant-time scalar muls.\ntype projLookupTable struct {\n\tpoints [8]projCached\n}\n\n// A precomputed lookup table for fixed-base, constant-time scalar muls.\ntype affineLookupTable struct {\n\tpoints [8]affineCached\n}\n\n// A dynamic lookup table for variable-base, variable-time scalar muls.\ntype nafLookupTable5 struct {\n\tpoints [8]projCached\n}\n\n// A precomputed lookup table for fixed-base, variable-time scalar muls.\ntype nafLookupTable8 struct {\n\tpoints [64]affineCached\n}\n\n// Constructors.\n\n// Builds a lookup table at runtime. Fast.\nfunc (v *projLookupTable) FromP3(q *Point) {\n\t// Goal: v.points[i] = (i+1)*Q, i.e., Q, 2Q, ..., 8Q\n\t// This allows lookup of -8Q, ..., -Q, 0, Q, ..., 8Q\n\tv.points[0].FromP3(q)\n\ttmpP3 := Point{}\n\ttmpP1xP1 := projP1xP1{}\n\tfor i := 0; i < 7; i++ {\n\t\t// Compute (i+1)*Q as Q + i*Q and convert to a projCached\n\t\t// This is needlessly complicated because the API has explicit\n\t\t// receivers instead of creating stack objects and relying on RVO\n\t\tv.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(q, &v.points[i])))\n\t}\n}\n\n// This is not optimised for speed; fixed-base tables should be precomputed.\nfunc (v *affineLookupTable) FromP3(q *Point) {\n\t// Goal: v.points[i] = (i+1)*Q, i.e., Q, 2Q, ..., 8Q\n\t// This allows lookup of -8Q, ..., -Q, 0, Q, ..., 8Q\n\tv.points[0].FromP3(q)\n\ttmpP3 := Point{}\n\ttmpP1xP1 := projP1xP1{}\n\tfor i := 0; i < 7; i++ {\n\t\t// Compute (i+1)*Q as Q + i*Q and convert to affineCached\n\t\tv.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(q, &v.points[i])))\n\t}\n}\n\n// Builds a lookup table at runtime. Fast.\nfunc (v *nafLookupTable5) FromP3(q *Point) {\n\t// Goal: v.points[i] = (2*i+1)*Q, i.e., Q, 3Q, 5Q, ..., 15Q\n\t// This allows lookup of -15Q, ..., -3Q, -Q, 0, Q, 3Q, ..., 15Q\n\tv.points[0].FromP3(q)\n\tq2 := Point{}\n\tq2.Add(q, q)\n\ttmpP3 := Point{}\n\ttmpP1xP1 := projP1xP1{}\n\tfor i := 0; i < 7; i++ {\n\t\tv.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(&q2, &v.points[i])))\n\t}\n}\n\n// This is not optimised for speed; fixed-base tables should be precomputed.\nfunc (v *nafLookupTable8) FromP3(q *Point) {\n\tv.points[0].FromP3(q)\n\tq2 := Point{}\n\tq2.Add(q, q)\n\ttmpP3 := Point{}\n\ttmpP1xP1 := projP1xP1{}\n\tfor i := 0; i < 63; i++ {\n\t\tv.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(&q2, &v.points[i])))\n\t}\n}\n\n// Selectors.\n\n// Set dest to x*Q, where -8 <= x <= 8, in constant time.\nfunc (v *projLookupTable) SelectInto(dest *projCached, x int8) {\n\t// Compute xabs = |x|\n\txmask := x >> 7\n\txabs := uint8((x + xmask) ^ xmask)\n\n\tdest.Zero()\n\tfor j := 1; j <= 8; j++ {\n\t\t// Set dest = j*Q if |x| = j\n\t\tcond := subtle.ConstantTimeByteEq(xabs, uint8(j))\n\t\tdest.Select(&v.points[j-1], dest, cond)\n\t}\n\t// Now dest = |x|*Q, conditionally negate to get x*Q\n\tdest.CondNeg(int(xmask & 1))\n}\n\n// Set dest to x*Q, where -8 <= x <= 8, in constant time.\nfunc (v *affineLookupTable) SelectInto(dest *affineCached, x int8) {\n\t// Compute xabs = |x|\n\txmask := x >> 7\n\txabs := uint8((x + xmask) ^ xmask)\n\n\tdest.Zero()\n\tfor j := 1; j <= 8; j++ {\n\t\t// Set dest = j*Q if |x| = j\n\t\tcond := subtle.ConstantTimeByteEq(xabs, uint8(j))\n\t\tdest.Select(&v.points[j-1], dest, cond)\n\t}\n\t// Now dest = |x|*Q, conditionally negate to get x*Q\n\tdest.CondNeg(int(xmask & 1))\n}\n\n// Given odd x with 0 < x < 2^4, return x*Q (in variable time).\nfunc (v *nafLookupTable5) SelectInto(dest *projCached, x int8) {\n\t*dest = v.points[x/2]\n}\n\n// Given odd x with 0 < x < 2^7, return x*Q (in variable time).\nfunc (v *nafLookupTable8) SelectInto(dest *affineCached, x int8) {\n\t*dest = v.points[x/2]\n}\n"
  },
  {
    "path": "vendor/github.com/AdaLogics/go-fuzz-headers/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/AdaLogics/go-fuzz-headers/README.md",
    "content": "# go-fuzz-headers\nThis repository contains various helper functions for go fuzzing. It is mostly used in combination with [go-fuzz](https://github.com/dvyukov/go-fuzz), but compatibility with fuzzing in the standard library will also be supported. Any coverage guided fuzzing engine that provides an array or slice of bytes can be used with go-fuzz-headers.\n\n\n## Usage\nUsing go-fuzz-headers is easy. First create a new consumer with the bytes provided by the fuzzing engine:\n\n```go\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\ndata := []byte{'R', 'a', 'n', 'd', 'o', 'm'}\nf := fuzz.NewConsumer(data)\n\n```\n\nThis creates a `Consumer` that consumes the bytes of the input as it uses them to fuzz different types.\n\nAfter that, `f` can be used to easily create fuzzed instances of different types. Below are some examples:\n\n### Structs\nOne of the most useful features of go-fuzz-headers is its ability to fill structs with the data provided by the fuzzing engine. This is done with a single line:\n```go\ntype Person struct {\n    Name string\n    Age  int\n}\np := Person{}\n// Fill p with values based on the data provided by the fuzzing engine:\nerr := f.GenerateStruct(&p)\n```\n\nThis includes nested structs too. In this example, the fuzz Consumer will also insert values in `p.BestFriend`:\n```go\ntype PersonI struct {\n    Name       string\n    Age        int\n    BestFriend PersonII\n}\ntype PersonII struct {\n    Name string\n    Age  int\n}\np := PersonI{}\nerr := f.GenerateStruct(&p)\n```\n\nIf the consumer should insert values for unexported fields as well as exported, this can be enabled with:\n\n```go\nf.AllowUnexportedFields()\n```\n\n...and disabled with:\n\n```go\nf.DisallowUnexportedFields()\n```\n\n### Other types:\n\nOther useful APIs:\n\n```go\ncreatedString, err := f.GetString() // Gets a string\ncreatedInt, err := f.GetInt() // Gets an integer\ncreatedByte, err := f.GetByte() // Gets a byte\ncreatedBytes, err := f.GetBytes() // Gets a byte slice\ncreatedBool, err := f.GetBool() // Gets a boolean\nerr := f.FuzzMap(target_map) // Fills a map\ncreatedTarBytes, err := f.TarBytes() // Gets bytes of a valid tar archive\nerr := f.CreateFiles(inThisDir) // Fills inThisDir with files\ncreatedString, err := f.GetStringFrom(\"anyCharInThisString\", ofThisLength) // Gets a string that consists of chars from \"anyCharInThisString\" and has the exact length \"ofThisLength\"\n```\n\nMost APIs are added as they are needed.\n\n## Projects that use go-fuzz-headers\n- [runC](https://github.com/opencontainers/runc)\n- [Istio](https://github.com/istio/istio)\n- [Vitess](https://github.com/vitessio/vitess)\n- [Containerd](https://github.com/containerd/containerd)\n\nFeel free to add your own project to the list, if you use go-fuzz-headers to fuzz it.\n\n\n \n\n## Status\nThe project is under development and will be updated regularly.\n\n## References\ngo-fuzz-headers' approach to fuzzing structs is strongly inspired by [gofuzz](https://github.com/google/gofuzz)."
  },
  {
    "path": "vendor/github.com/AdaLogics/go-fuzz-headers/consumer.go",
    "content": "// Copyright 2023 The go-fuzz-headers Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage gofuzzheaders\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\t\"unsafe\"\n)\n\nvar (\n\tMaxTotalLen uint32 = 2000000\n\tmaxDepth           = 100\n)\n\nfunc SetMaxTotalLen(newLen uint32) {\n\tMaxTotalLen = newLen\n}\n\ntype ConsumeFuzzer struct {\n\tdata                 []byte\n\tdataTotal            uint32\n\tCommandPart          []byte\n\tRestOfArray          []byte\n\tNumberOfCalls        int\n\tposition             uint32\n\tfuzzUnexportedFields bool\n\tforceUTF8Strings     bool\n\tcurDepth             int\n\tFuncs                map[reflect.Type]reflect.Value\n}\n\nfunc IsDivisibleBy(n int, divisibleby int) bool {\n\treturn (n % divisibleby) == 0\n}\n\nfunc NewConsumer(fuzzData []byte) *ConsumeFuzzer {\n\treturn &ConsumeFuzzer{\n\t\tdata:      fuzzData,\n\t\tdataTotal: uint32(len(fuzzData)),\n\t\tFuncs:     make(map[reflect.Type]reflect.Value),\n\t\tcurDepth:  0,\n\t}\n}\n\nfunc (f *ConsumeFuzzer) Split(minCalls, maxCalls int) error {\n\tif f.dataTotal == 0 {\n\t\treturn errors.New(\"could not split\")\n\t}\n\tnumberOfCalls := int(f.data[0])\n\tif numberOfCalls < minCalls || numberOfCalls > maxCalls {\n\t\treturn errors.New(\"bad number of calls\")\n\t}\n\tif int(f.dataTotal) < numberOfCalls+numberOfCalls+1 {\n\t\treturn errors.New(\"length of data does not match required parameters\")\n\t}\n\n\t// Define part 2 and 3 of the data array\n\tcommandPart := f.data[1 : numberOfCalls+1]\n\trestOfArray := f.data[numberOfCalls+1:]\n\n\t// Just a small check. It is necessary\n\tif len(commandPart) != numberOfCalls {\n\t\treturn errors.New(\"length of commandPart does not match number of calls\")\n\t}\n\n\t// Check if restOfArray is divisible by numberOfCalls\n\tif !IsDivisibleBy(len(restOfArray), numberOfCalls) {\n\t\treturn errors.New(\"length of commandPart does not match number of calls\")\n\t}\n\tf.CommandPart = commandPart\n\tf.RestOfArray = restOfArray\n\tf.NumberOfCalls = numberOfCalls\n\treturn nil\n}\n\nfunc (f *ConsumeFuzzer) AllowUnexportedFields() {\n\tf.fuzzUnexportedFields = true\n}\n\nfunc (f *ConsumeFuzzer) DisallowUnexportedFields() {\n\tf.fuzzUnexportedFields = false\n}\n\nfunc (f *ConsumeFuzzer) AllowNonUTF8Strings() {\n\tf.forceUTF8Strings = false\n}\n\nfunc (f *ConsumeFuzzer) DisallowNonUTF8Strings() {\n\tf.forceUTF8Strings = true\n}\n\nfunc (f *ConsumeFuzzer) GenerateStruct(targetStruct interface{}) error {\n\te := reflect.ValueOf(targetStruct).Elem()\n\treturn f.fuzzStruct(e, false)\n}\n\nfunc (f *ConsumeFuzzer) setCustom(v reflect.Value) error {\n\t// First: see if we have a fuzz function for it.\n\tdoCustom, ok := f.Funcs[v.Type()]\n\tif !ok {\n\t\treturn fmt.Errorf(\"could not find a custom function\")\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Ptr:\n\t\tif v.IsNil() {\n\t\t\tif !v.CanSet() {\n\t\t\t\treturn fmt.Errorf(\"could not use a custom function\")\n\t\t\t}\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t}\n\tcase reflect.Map:\n\t\tif v.IsNil() {\n\t\t\tif !v.CanSet() {\n\t\t\t\treturn fmt.Errorf(\"could not use a custom function\")\n\t\t\t}\n\t\t\tv.Set(reflect.MakeMap(v.Type()))\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"could not use a custom function\")\n\t}\n\n\tverr := doCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{\n\t\tF: f,\n\t})})\n\n\t// check if we return an error\n\tif verr[0].IsNil() {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"could not use a custom function\")\n}\n\nfunc (f *ConsumeFuzzer) fuzzStruct(e reflect.Value, customFunctions bool) error {\n\tif f.curDepth >= maxDepth {\n\t\t// return err or nil here?\n\t\treturn nil\n\t}\n\tf.curDepth++\n\tdefer func() { f.curDepth-- }()\n\n\t// We check if we should check for custom functions\n\tif customFunctions && e.IsValid() && e.CanAddr() {\n\t\terr := f.setCustom(e.Addr())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tswitch e.Kind() {\n\tcase reflect.Struct:\n\t\tfor i := 0; i < e.NumField(); i++ {\n\t\t\tvar v reflect.Value\n\t\t\tif !e.Field(i).CanSet() {\n\t\t\t\tif f.fuzzUnexportedFields {\n\t\t\t\t\tv = reflect.NewAt(e.Field(i).Type(), unsafe.Pointer(e.Field(i).UnsafeAddr())).Elem()\n\t\t\t\t}\n\t\t\t\tif err := f.fuzzStruct(v, customFunctions); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tv = e.Field(i)\n\t\t\t\tif err := f.fuzzStruct(v, customFunctions); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase reflect.String:\n\t\tstr, err := f.GetString()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetString(str)\n\t\t}\n\tcase reflect.Slice:\n\t\tvar maxElements uint32\n\t\t// Byte slices should not be restricted\n\t\tif e.Type().String() == \"[]uint8\" {\n\t\t\tmaxElements = 10000000\n\t\t} else {\n\t\t\tmaxElements = 50\n\t\t}\n\n\t\trandQty, err := f.GetUint32()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tnumOfElements := randQty % maxElements\n\t\tif (f.dataTotal - f.position) < numOfElements {\n\t\t\tnumOfElements = f.dataTotal - f.position\n\t\t}\n\n\t\tuu := reflect.MakeSlice(e.Type(), int(numOfElements), int(numOfElements))\n\n\t\tfor i := 0; i < int(numOfElements); i++ {\n\t\t\t// If we have more than 10, then we can proceed with that.\n\t\t\tif err := f.fuzzStruct(uu.Index(i), customFunctions); err != nil {\n\t\t\t\tif i >= 10 {\n\t\t\t\t\tif e.CanSet() {\n\t\t\t\t\t\te.Set(uu)\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t} else {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.Set(uu)\n\t\t}\n\tcase reflect.Uint:\n\t\tnewInt, err := f.GetUint()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetUint(uint64(newInt))\n\t\t}\n\tcase reflect.Uint16:\n\t\tnewInt, err := f.GetUint16()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetUint(uint64(newInt))\n\t\t}\n\tcase reflect.Uint32:\n\t\tnewInt, err := f.GetUint32()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetUint(uint64(newInt))\n\t\t}\n\tcase reflect.Uint64:\n\t\tnewInt, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetUint(uint64(newInt))\n\t\t}\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tnewInt, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetInt(int64(newInt))\n\t\t}\n\tcase reflect.Float32:\n\t\tnewFloat, err := f.GetFloat32()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetFloat(float64(newFloat))\n\t\t}\n\tcase reflect.Float64:\n\t\tnewFloat, err := f.GetFloat64()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetFloat(float64(newFloat))\n\t\t}\n\tcase reflect.Map:\n\t\tif e.CanSet() {\n\t\t\te.Set(reflect.MakeMap(e.Type()))\n\t\t\tconst maxElements = 50\n\t\t\trandQty, err := f.GetInt()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tnumOfElements := randQty % maxElements\n\t\t\tfor i := 0; i < numOfElements; i++ {\n\t\t\t\tkey := reflect.New(e.Type().Key()).Elem()\n\t\t\t\tif err := f.fuzzStruct(key, customFunctions); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tval := reflect.New(e.Type().Elem()).Elem()\n\t\t\t\tif err = f.fuzzStruct(val, customFunctions); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\te.SetMapIndex(key, val)\n\t\t\t}\n\t\t}\n\tcase reflect.Ptr:\n\t\tif e.CanSet() {\n\t\t\te.Set(reflect.New(e.Type().Elem()))\n\t\t\tif err := f.fuzzStruct(e.Elem(), customFunctions); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\tcase reflect.Uint8:\n\t\tb, err := f.GetByte()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetUint(uint64(b))\n\t\t}\n\tcase reflect.Bool:\n\t\tb, err := f.GetBool()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e.CanSet() {\n\t\t\te.SetBool(b)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (f *ConsumeFuzzer) GetStringArray() (reflect.Value, error) {\n\t// The max size of the array:\n\tconst max uint32 = 20\n\n\tarraySize := f.position\n\tif arraySize > max {\n\t\tarraySize = max\n\t}\n\tstringArray := reflect.MakeSlice(reflect.SliceOf(reflect.TypeOf(\"string\")), int(arraySize), int(arraySize))\n\tif f.position+arraySize >= f.dataTotal {\n\t\treturn stringArray, errors.New(\"could not make string array\")\n\t}\n\n\tfor i := 0; i < int(arraySize); i++ {\n\t\tstringSize := uint32(f.data[f.position])\n\t\tif f.position+stringSize >= f.dataTotal {\n\t\t\treturn stringArray, nil\n\t\t}\n\t\tstringToAppend := string(f.data[f.position : f.position+stringSize])\n\t\tstrVal := reflect.ValueOf(stringToAppend)\n\t\tstringArray = reflect.Append(stringArray, strVal)\n\t\tf.position += stringSize\n\t}\n\treturn stringArray, nil\n}\n\nfunc (f *ConsumeFuzzer) GetInt() (int, error) {\n\tif f.position >= f.dataTotal {\n\t\treturn 0, errors.New(\"not enough bytes to create int\")\n\t}\n\treturnInt := int(f.data[f.position])\n\tf.position++\n\treturn returnInt, nil\n}\n\nfunc (f *ConsumeFuzzer) GetByte() (byte, error) {\n\tif f.position >= f.dataTotal {\n\t\treturn 0x00, errors.New(\"not enough bytes to get byte\")\n\t}\n\treturnByte := f.data[f.position]\n\tf.position++\n\treturn returnByte, nil\n}\n\nfunc (f *ConsumeFuzzer) GetNBytes(numberOfBytes int) ([]byte, error) {\n\tif f.position >= f.dataTotal {\n\t\treturn nil, errors.New(\"not enough bytes to get byte\")\n\t}\n\treturnBytes := make([]byte, 0, numberOfBytes)\n\tfor i := 0; i < numberOfBytes; i++ {\n\t\tnewByte, err := f.GetByte()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturnBytes = append(returnBytes, newByte)\n\t}\n\treturn returnBytes, nil\n}\n\nfunc (f *ConsumeFuzzer) GetUint16() (uint16, error) {\n\tu16, err := f.GetNBytes(2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tlittleEndian, err := f.GetBool()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif littleEndian {\n\t\treturn binary.LittleEndian.Uint16(u16), nil\n\t}\n\treturn binary.BigEndian.Uint16(u16), nil\n}\n\nfunc (f *ConsumeFuzzer) GetUint32() (uint32, error) {\n\tu32, err := f.GetNBytes(4)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn binary.BigEndian.Uint32(u32), nil\n}\n\nfunc (f *ConsumeFuzzer) GetUint64() (uint64, error) {\n\tu64, err := f.GetNBytes(8)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tlittleEndian, err := f.GetBool()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif littleEndian {\n\t\treturn binary.LittleEndian.Uint64(u64), nil\n\t}\n\treturn binary.BigEndian.Uint64(u64), nil\n}\n\nfunc (f *ConsumeFuzzer) GetUint() (uint, error) {\n\tvar zero uint\n\tsize := int(unsafe.Sizeof(zero))\n\tif size == 8 {\n\t\tu64, err := f.GetUint64()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\treturn uint(u64), nil\n\t}\n\tu32, err := f.GetUint32()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint(u32), nil\n}\n\nfunc (f *ConsumeFuzzer) GetBytes() ([]byte, error) {\n\tvar length uint32\n\tvar err error\n\tlength, err = f.GetUint32()\n\tif err != nil {\n\t\treturn nil, errors.New(\"not enough bytes to create byte array\")\n\t}\n\n\tif length == 0 {\n\t\tlength = 30\n\t}\n\tbytesLeft := f.dataTotal - f.position\n\tif bytesLeft <= 0 {\n\t\treturn nil, errors.New(\"not enough bytes to create byte array\")\n\t}\n\n\t// If the length is the same as bytes left, we will not overflow\n\t// the remaining bytes.\n\tif length != bytesLeft {\n\t\tlength = length % bytesLeft\n\t}\n\tbyteBegin := f.position\n\tif byteBegin+length < byteBegin {\n\t\treturn nil, errors.New(\"numbers overflow\")\n\t}\n\tf.position = byteBegin + length\n\treturn f.data[byteBegin:f.position], nil\n}\n\nfunc (f *ConsumeFuzzer) GetString() (string, error) {\n\tif f.position >= f.dataTotal {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tlength, err := f.GetUint32()\n\tif err != nil {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tif f.position > MaxTotalLen {\n\t\treturn \"nil\", errors.New(\"created too large a string\")\n\t}\n\tbyteBegin := f.position\n\tif byteBegin >= f.dataTotal {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tif byteBegin+length > f.dataTotal {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tif byteBegin > byteBegin+length {\n\t\treturn \"nil\", errors.New(\"numbers overflow\")\n\t}\n\tf.position = byteBegin + length\n\ts := string(f.data[byteBegin:f.position])\n\tif f.forceUTF8Strings {\n\t\ts = strings.ToValidUTF8(s, \"\")\n\t}\n\treturn s, nil\n}\n\nfunc (f *ConsumeFuzzer) GetBool() (bool, error) {\n\tif f.position >= f.dataTotal {\n\t\treturn false, errors.New(\"not enough bytes to create bool\")\n\t}\n\tif IsDivisibleBy(int(f.data[f.position]), 2) {\n\t\tf.position++\n\t\treturn true, nil\n\t} else {\n\t\tf.position++\n\t\treturn false, nil\n\t}\n}\n\nfunc (f *ConsumeFuzzer) FuzzMap(m interface{}) error {\n\treturn f.GenerateStruct(m)\n}\n\nfunc returnTarBytes(buf []byte) ([]byte, error) {\n\treturn buf, nil\n\t// Count files\n\tvar fileCounter int\n\ttr := tar.NewReader(bytes.NewReader(buf))\n\tfor {\n\t\t_, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfileCounter++\n\t}\n\tif fileCounter >= 1 {\n\t\treturn buf, nil\n\t}\n\treturn nil, fmt.Errorf(\"not enough files were created\\n\")\n}\n\nfunc setTarHeaderFormat(hdr *tar.Header, f *ConsumeFuzzer) error {\n\tind, err := f.GetInt()\n\tif err != nil {\n\t\thdr.Format = tar.FormatGNU\n\t\t//return nil\n\t}\n\tswitch ind % 4 {\n\tcase 0:\n\t\thdr.Format = tar.FormatUnknown\n\tcase 1:\n\t\thdr.Format = tar.FormatUSTAR\n\tcase 2:\n\t\thdr.Format = tar.FormatPAX\n\tcase 3:\n\t\thdr.Format = tar.FormatGNU\n\t}\n\treturn nil\n}\n\nfunc setTarHeaderTypeflag(hdr *tar.Header, f *ConsumeFuzzer) error {\n\tind, err := f.GetInt()\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch ind % 13 {\n\tcase 0:\n\t\thdr.Typeflag = tar.TypeReg\n\tcase 1:\n\t\thdr.Typeflag = tar.TypeLink\n\t\tlinkname, err := f.GetString()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thdr.Linkname = linkname\n\tcase 2:\n\t\thdr.Typeflag = tar.TypeSymlink\n\t\tlinkname, err := f.GetString()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thdr.Linkname = linkname\n\tcase 3:\n\t\thdr.Typeflag = tar.TypeChar\n\tcase 4:\n\t\thdr.Typeflag = tar.TypeBlock\n\tcase 5:\n\t\thdr.Typeflag = tar.TypeDir\n\tcase 6:\n\t\thdr.Typeflag = tar.TypeFifo\n\tcase 7:\n\t\thdr.Typeflag = tar.TypeCont\n\tcase 8:\n\t\thdr.Typeflag = tar.TypeXHeader\n\tcase 9:\n\t\thdr.Typeflag = tar.TypeXGlobalHeader\n\tcase 10:\n\t\thdr.Typeflag = tar.TypeGNUSparse\n\tcase 11:\n\t\thdr.Typeflag = tar.TypeGNULongName\n\tcase 12:\n\t\thdr.Typeflag = tar.TypeGNULongLink\n\t}\n\treturn nil\n}\n\nfunc (f *ConsumeFuzzer) createTarFileBody() ([]byte, error) {\n\treturn f.GetBytes()\n\t/*length, err := f.GetUint32()\n\tif err != nil {\n\t\treturn nil, errors.New(\"not enough bytes to create byte array\")\n\t}\n\n\t// A bit of optimization to attempt to create a file body\n\t// when we don't have as many bytes left as \"length\"\n\tremainingBytes := f.dataTotal - f.position\n\tif remainingBytes <= 0 {\n\t\treturn nil, errors.New(\"created too large a string\")\n\t}\n\tif f.position+length > MaxTotalLen {\n\t\treturn nil, errors.New(\"created too large a string\")\n\t}\n\tbyteBegin := f.position\n\tif byteBegin >= f.dataTotal {\n\t\treturn nil, errors.New(\"not enough bytes to create byte array\")\n\t}\n\tif length == 0 {\n\t\treturn nil, errors.New(\"zero-length is not supported\")\n\t}\n\tif byteBegin+length >= f.dataTotal {\n\t\treturn nil, errors.New(\"not enough bytes to create byte array\")\n\t}\n\tif byteBegin+length < byteBegin {\n\t\treturn nil, errors.New(\"numbers overflow\")\n\t}\n\tf.position = byteBegin + length\n\treturn f.data[byteBegin:f.position], nil*/\n}\n\n// getTarFileName is similar to GetString(), but creates string based\n// on the length of f.data to reduce the likelihood of overflowing\n// f.data.\nfunc (f *ConsumeFuzzer) getTarFilename() (string, error) {\n\treturn f.GetString()\n\t/*length, err := f.GetUint32()\n\tif err != nil {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\n\t// A bit of optimization to attempt to create a file name\n\t// when we don't have as many bytes left as \"length\"\n\tremainingBytes := f.dataTotal - f.position\n\tif remainingBytes <= 0 {\n\t\treturn \"nil\", errors.New(\"created too large a string\")\n\t}\n\tif f.position > MaxTotalLen {\n\t\treturn \"nil\", errors.New(\"created too large a string\")\n\t}\n\tbyteBegin := f.position\n\tif byteBegin >= f.dataTotal {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tif byteBegin+length > f.dataTotal {\n\t\treturn \"nil\", errors.New(\"not enough bytes to create string\")\n\t}\n\tif byteBegin > byteBegin+length {\n\t\treturn \"nil\", errors.New(\"numbers overflow\")\n\t}\n\tf.position = byteBegin + length\n\treturn string(f.data[byteBegin:f.position]), nil*/\n}\n\ntype TarFile struct {\n\tHdr  *tar.Header\n\tBody []byte\n}\n\n// TarBytes returns valid bytes for a tar archive\nfunc (f *ConsumeFuzzer) TarBytes() ([]byte, error) {\n\tnumberOfFiles, err := f.GetInt()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar tarFiles []*TarFile\n\ttarFiles = make([]*TarFile, 0)\n\n\tconst maxNoOfFiles = 100\n\tfor i := 0; i < numberOfFiles%maxNoOfFiles; i++ {\n\t\tvar filename string\n\t\tvar filebody []byte\n\t\tvar sec, nsec int\n\t\tvar err error\n\n\t\tfilename, err = f.getTarFilename()\n\t\tif err != nil {\n\t\t\tvar sb strings.Builder\n\t\t\tsb.WriteString(\"file-\")\n\t\t\tsb.WriteString(strconv.Itoa(i))\n\t\t\tfilename = sb.String()\n\t\t}\n\t\tfilebody, err = f.createTarFileBody()\n\t\tif err != nil {\n\t\t\tvar sb strings.Builder\n\t\t\tsb.WriteString(\"filebody-\")\n\t\t\tsb.WriteString(strconv.Itoa(i))\n\t\t\tfilebody = []byte(sb.String())\n\t\t}\n\n\t\tsec, err = f.GetInt()\n\t\tif err != nil {\n\t\t\tsec = 1672531200 // beginning of 2023\n\t\t}\n\t\tnsec, err = f.GetInt()\n\t\tif err != nil {\n\t\t\tnsec = 1703980800 // end of 2023\n\t\t}\n\n\t\thdr := &tar.Header{\n\t\t\tName:    filename,\n\t\t\tSize:    int64(len(filebody)),\n\t\t\tMode:    0o600,\n\t\t\tModTime: time.Unix(int64(sec), int64(nsec)),\n\t\t}\n\t\tif err := setTarHeaderTypeflag(hdr, f); err != nil {\n\t\t\treturn []byte(\"\"), err\n\t\t}\n\t\tif err := setTarHeaderFormat(hdr, f); err != nil {\n\t\t\treturn []byte(\"\"), err\n\t\t}\n\t\ttf := &TarFile{\n\t\t\tHdr:  hdr,\n\t\t\tBody: filebody,\n\t\t}\n\t\ttarFiles = append(tarFiles, tf)\n\t}\n\n\tvar buf bytes.Buffer\n\ttw := tar.NewWriter(&buf)\n\tdefer tw.Close()\n\n\tfor _, tf := range tarFiles {\n\t\ttw.WriteHeader(tf.Hdr)\n\t\ttw.Write(tf.Body)\n\t}\n\treturn buf.Bytes(), nil\n}\n\n// This is similar to TarBytes, but it returns a series of\n// files instead of raw tar bytes. The advantage of this\n// api is that it is cheaper in terms of cpu power to\n// modify or check the files in the fuzzer with TarFiles()\n// because it avoids creating a tar reader.\nfunc (f *ConsumeFuzzer) TarFiles() ([]*TarFile, error) {\n\tnumberOfFiles, err := f.GetInt()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar tarFiles []*TarFile\n\ttarFiles = make([]*TarFile, 0)\n\n\tconst maxNoOfFiles = 100\n\tfor i := 0; i < numberOfFiles%maxNoOfFiles; i++ {\n\t\tfilename, err := f.getTarFilename()\n\t\tif err != nil {\n\t\t\treturn tarFiles, err\n\t\t}\n\t\tfilebody, err := f.createTarFileBody()\n\t\tif err != nil {\n\t\t\treturn tarFiles, err\n\t\t}\n\n\t\tsec, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn tarFiles, err\n\t\t}\n\t\tnsec, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn tarFiles, err\n\t\t}\n\n\t\thdr := &tar.Header{\n\t\t\tName:    filename,\n\t\t\tSize:    int64(len(filebody)),\n\t\t\tMode:    0o600,\n\t\t\tModTime: time.Unix(int64(sec), int64(nsec)),\n\t\t}\n\t\tif err := setTarHeaderTypeflag(hdr, f); err != nil {\n\t\t\thdr.Typeflag = tar.TypeReg\n\t\t}\n\t\tif err := setTarHeaderFormat(hdr, f); err != nil {\n\t\t\treturn tarFiles, err // should not happend\n\t\t}\n\t\ttf := &TarFile{\n\t\t\tHdr:  hdr,\n\t\t\tBody: filebody,\n\t\t}\n\t\ttarFiles = append(tarFiles, tf)\n\t}\n\treturn tarFiles, nil\n}\n\n// CreateFiles creates pseudo-random files in rootDir.\n// It creates subdirs and places the files there.\n// It is the callers responsibility to ensure that\n// rootDir exists.\nfunc (f *ConsumeFuzzer) CreateFiles(rootDir string) error {\n\tnumberOfFiles, err := f.GetInt()\n\tif err != nil {\n\t\treturn err\n\t}\n\tmaxNumberOfFiles := numberOfFiles % 4000 // This is completely arbitrary\n\tif maxNumberOfFiles == 0 {\n\t\treturn errors.New(\"maxNumberOfFiles is nil\")\n\t}\n\n\tvar noOfCreatedFiles int\n\tfor i := 0; i < maxNumberOfFiles; i++ {\n\t\t// The file to create:\n\t\tfileName, err := f.GetString()\n\t\tif err != nil {\n\t\t\tif noOfCreatedFiles > 0 {\n\t\t\t\t// If files have been created, we don't return an error.\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\treturn errors.New(\"could not get fileName\")\n\t\t\t}\n\t\t}\n\t\tif strings.Contains(fileName, \"..\") || (len(fileName) > 0 && fileName[0] == 47) || strings.Contains(fileName, \"\\\\\") {\n\t\t\tcontinue\n\t\t}\n\t\tfullFilePath := filepath.Join(rootDir, fileName)\n\n\t\t// Find the subdirectory of the file\n\t\tif subDir := filepath.Dir(fileName); subDir != \"\" && subDir != \".\" {\n\t\t\t// create the dir first; avoid going outside the root dir\n\t\t\tif strings.Contains(subDir, \"../\") || (len(subDir) > 0 && subDir[0] == 47) || strings.Contains(subDir, \"\\\\\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdirPath := filepath.Join(rootDir, subDir)\n\t\t\tif _, err := os.Stat(dirPath); os.IsNotExist(err) {\n\t\t\t\terr2 := os.MkdirAll(dirPath, 0o777)\n\t\t\t\tif err2 != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tfullFilePath = filepath.Join(dirPath, fileName)\n\t\t} else {\n\t\t\t// Create symlink\n\t\t\tcreateSymlink, err := f.GetBool()\n\t\t\tif err != nil {\n\t\t\t\tif noOfCreatedFiles > 0 {\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\treturn errors.New(\"could not create the symlink\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif createSymlink {\n\t\t\t\tsymlinkTarget, err := f.GetString()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\terr = os.Symlink(symlinkTarget, fullFilePath)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// stop loop here, since a symlink needs no further action\n\t\t\t\tnoOfCreatedFiles++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// We create a normal file\n\t\t\tfileContents, err := f.GetBytes()\n\t\t\tif err != nil {\n\t\t\t\tif noOfCreatedFiles > 0 {\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\treturn errors.New(\"could not create the file\")\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = os.WriteFile(fullFilePath, fileContents, 0o666)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnoOfCreatedFiles++\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetStringFrom returns a string that can only consist of characters\n// included in possibleChars. It returns an error if the created string\n// does not have the specified length.\nfunc (f *ConsumeFuzzer) GetStringFrom(possibleChars string, length int) (string, error) {\n\tif (f.dataTotal - f.position) < uint32(length) {\n\t\treturn \"\", errors.New(\"not enough bytes to create a string\")\n\t}\n\toutput := make([]byte, 0, length)\n\tfor i := 0; i < length; i++ {\n\t\tcharIndex, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn string(output), err\n\t\t}\n\t\toutput = append(output, possibleChars[charIndex%len(possibleChars)])\n\t}\n\treturn string(output), nil\n}\n\nfunc (f *ConsumeFuzzer) GetRune() ([]rune, error) {\n\tstringToConvert, err := f.GetString()\n\tif err != nil {\n\t\treturn []rune(\"nil\"), err\n\t}\n\treturn []rune(stringToConvert), nil\n}\n\nfunc (f *ConsumeFuzzer) GetFloat32() (float32, error) {\n\tu32, err := f.GetNBytes(4)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tlittleEndian, err := f.GetBool()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif littleEndian {\n\t\tu32LE := binary.LittleEndian.Uint32(u32)\n\t\treturn math.Float32frombits(u32LE), nil\n\t}\n\tu32BE := binary.BigEndian.Uint32(u32)\n\treturn math.Float32frombits(u32BE), nil\n}\n\nfunc (f *ConsumeFuzzer) GetFloat64() (float64, error) {\n\tu64, err := f.GetNBytes(8)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tlittleEndian, err := f.GetBool()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif littleEndian {\n\t\tu64LE := binary.LittleEndian.Uint64(u64)\n\t\treturn math.Float64frombits(u64LE), nil\n\t}\n\tu64BE := binary.BigEndian.Uint64(u64)\n\treturn math.Float64frombits(u64BE), nil\n}\n\nfunc (f *ConsumeFuzzer) CreateSlice(targetSlice interface{}) error {\n\treturn f.GenerateStruct(targetSlice)\n}\n"
  },
  {
    "path": "vendor/github.com/AdaLogics/go-fuzz-headers/funcs.go",
    "content": "// Copyright 2023 The go-fuzz-headers Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage gofuzzheaders\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\ntype Continue struct {\n\tF *ConsumeFuzzer\n}\n\nfunc (f *ConsumeFuzzer) AddFuncs(fuzzFuncs []interface{}) {\n\tfor i := range fuzzFuncs {\n\t\tv := reflect.ValueOf(fuzzFuncs[i])\n\t\tif v.Kind() != reflect.Func {\n\t\t\tpanic(\"Need only funcs!\")\n\t\t}\n\t\tt := v.Type()\n\t\tif t.NumIn() != 2 || t.NumOut() != 1 {\n\t\t\tfmt.Println(t.NumIn(), t.NumOut())\n\n\t\t\tpanic(\"Need 2 in and 1 out params. In must be the type. Out must be an error\")\n\t\t}\n\t\targT := t.In(0)\n\t\tswitch argT.Kind() {\n\t\tcase reflect.Ptr, reflect.Map:\n\t\tdefault:\n\t\t\tpanic(\"fuzzFunc must take pointer or map type\")\n\t\t}\n\t\tif t.In(1) != reflect.TypeOf(Continue{}) {\n\t\t\tpanic(\"fuzzFunc's second parameter must be type Continue\")\n\t\t}\n\t\tf.Funcs[argT] = v\n\t}\n}\n\nfunc (f *ConsumeFuzzer) GenerateWithCustom(targetStruct interface{}) error {\n\te := reflect.ValueOf(targetStruct).Elem()\n\treturn f.fuzzStruct(e, true)\n}\n\nfunc (c Continue) GenerateStruct(targetStruct interface{}) error {\n\treturn c.F.GenerateStruct(targetStruct)\n}\n\nfunc (c Continue) GenerateStructWithCustom(targetStruct interface{}) error {\n\treturn c.F.GenerateWithCustom(targetStruct)\n}\n"
  },
  {
    "path": "vendor/github.com/AdaLogics/go-fuzz-headers/sql.go",
    "content": "// Copyright 2023 The go-fuzz-headers Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage gofuzzheaders\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// returns a keyword by index\nfunc getKeyword(f *ConsumeFuzzer) (string, error) {\n\tindex, err := f.GetInt()\n\tif err != nil {\n\t\treturn keywords[0], err\n\t}\n\tfor i, k := range keywords {\n\t\tif i == index {\n\t\t\treturn k, nil\n\t\t}\n\t}\n\treturn keywords[0], fmt.Errorf(\"could not get a kw\")\n}\n\n// Simple utility function to check if a string\n// slice contains a string.\nfunc containsString(s []string, e string) bool {\n\tfor _, a := range s {\n\t\tif a == e {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// These keywords are used specifically for fuzzing Vitess\nvar keywords = []string{\n\t\"accessible\", \"action\", \"add\", \"after\", \"against\", \"algorithm\",\n\t\"all\", \"alter\", \"always\", \"analyze\", \"and\", \"as\", \"asc\", \"asensitive\",\n\t\"auto_increment\", \"avg_row_length\", \"before\", \"begin\", \"between\",\n\t\"bigint\", \"binary\", \"_binary\", \"_utf8mb4\", \"_utf8\", \"_latin1\", \"bit\",\n\t\"blob\", \"bool\", \"boolean\", \"both\", \"by\", \"call\", \"cancel\", \"cascade\",\n\t\"cascaded\", \"case\", \"cast\", \"channel\", \"change\", \"char\", \"character\",\n\t\"charset\", \"check\", \"checksum\", \"coalesce\", \"code\", \"collate\", \"collation\",\n\t\"column\", \"columns\", \"comment\", \"committed\", \"commit\", \"compact\", \"complete\",\n\t\"compressed\", \"compression\", \"condition\", \"connection\", \"constraint\", \"continue\",\n\t\"convert\", \"copy\", \"cume_dist\", \"substr\", \"substring\", \"create\", \"cross\",\n\t\"csv\", \"current_date\", \"current_time\", \"current_timestamp\", \"current_user\",\n\t\"cursor\", \"data\", \"database\", \"databases\", \"day\", \"day_hour\", \"day_microsecond\",\n\t\"day_minute\", \"day_second\", \"date\", \"datetime\", \"dec\", \"decimal\", \"declare\",\n\t\"default\", \"definer\", \"delay_key_write\", \"delayed\", \"delete\", \"dense_rank\",\n\t\"desc\", \"describe\", \"deterministic\", \"directory\", \"disable\", \"discard\",\n\t\"disk\", \"distinct\", \"distinctrow\", \"div\", \"double\", \"do\", \"drop\", \"dumpfile\",\n\t\"duplicate\", \"dynamic\", \"each\", \"else\", \"elseif\", \"empty\", \"enable\",\n\t\"enclosed\", \"encryption\", \"end\", \"enforced\", \"engine\", \"engines\", \"enum\",\n\t\"error\", \"escape\", \"escaped\", \"event\", \"exchange\", \"exclusive\", \"exists\",\n\t\"exit\", \"explain\", \"expansion\", \"export\", \"extended\", \"extract\", \"false\",\n\t\"fetch\", \"fields\", \"first\", \"first_value\", \"fixed\", \"float\", \"float4\",\n\t\"float8\", \"flush\", \"for\", \"force\", \"foreign\", \"format\", \"from\", \"full\",\n\t\"fulltext\", \"function\", \"general\", \"generated\", \"geometry\", \"geometrycollection\",\n\t\"get\", \"global\", \"gtid_executed\", \"grant\", \"group\", \"grouping\", \"groups\",\n\t\"group_concat\", \"having\", \"header\", \"high_priority\", \"hosts\", \"hour\", \"hour_microsecond\",\n\t\"hour_minute\", \"hour_second\", \"if\", \"ignore\", \"import\", \"in\", \"index\", \"indexes\",\n\t\"infile\", \"inout\", \"inner\", \"inplace\", \"insensitive\", \"insert\", \"insert_method\",\n\t\"int\", \"int1\", \"int2\", \"int3\", \"int4\", \"int8\", \"integer\", \"interval\",\n\t\"into\", \"io_after_gtids\", \"is\", \"isolation\", \"iterate\", \"invoker\", \"join\",\n\t\"json\", \"json_table\", \"key\", \"keys\", \"keyspaces\", \"key_block_size\", \"kill\", \"lag\",\n\t\"language\", \"last\", \"last_value\", \"last_insert_id\", \"lateral\", \"lead\", \"leading\",\n\t\"leave\", \"left\", \"less\", \"level\", \"like\", \"limit\", \"linear\", \"lines\",\n\t\"linestring\", \"load\", \"local\", \"localtime\", \"localtimestamp\", \"lock\", \"logs\",\n\t\"long\", \"longblob\", \"longtext\", \"loop\", \"low_priority\", \"manifest\",\n\t\"master_bind\", \"match\", \"max_rows\", \"maxvalue\", \"mediumblob\", \"mediumint\",\n\t\"mediumtext\", \"memory\", \"merge\", \"microsecond\", \"middleint\", \"min_rows\", \"minute\",\n\t\"minute_microsecond\", \"minute_second\", \"mod\", \"mode\", \"modify\", \"modifies\",\n\t\"multilinestring\", \"multipoint\", \"multipolygon\", \"month\", \"name\",\n\t\"names\", \"natural\", \"nchar\", \"next\", \"no\", \"none\", \"not\", \"no_write_to_binlog\",\n\t\"nth_value\", \"ntile\", \"null\", \"numeric\", \"of\", \"off\", \"offset\", \"on\",\n\t\"only\", \"open\", \"optimize\", \"optimizer_costs\", \"option\", \"optionally\",\n\t\"or\", \"order\", \"out\", \"outer\", \"outfile\", \"over\", \"overwrite\", \"pack_keys\",\n\t\"parser\", \"partition\", \"partitioning\", \"password\", \"percent_rank\", \"plugins\",\n\t\"point\", \"polygon\", \"precision\", \"primary\", \"privileges\", \"processlist\",\n\t\"procedure\", \"query\", \"quarter\", \"range\", \"rank\", \"read\", \"reads\", \"read_write\",\n\t\"real\", \"rebuild\", \"recursive\", \"redundant\", \"references\", \"regexp\", \"relay\",\n\t\"release\", \"remove\", \"rename\", \"reorganize\", \"repair\", \"repeat\", \"repeatable\",\n\t\"replace\", \"require\", \"resignal\", \"restrict\", \"return\", \"retry\", \"revert\",\n\t\"revoke\", \"right\", \"rlike\", \"rollback\", \"row\", \"row_format\", \"row_number\",\n\t\"rows\", \"s3\", \"savepoint\", \"schema\", \"schemas\", \"second\", \"second_microsecond\",\n\t\"security\", \"select\", \"sensitive\", \"separator\", \"sequence\", \"serializable\",\n\t\"session\", \"set\", \"share\", \"shared\", \"show\", \"signal\", \"signed\", \"slow\",\n\t\"smallint\", \"spatial\", \"specific\", \"sql\", \"sqlexception\", \"sqlstate\",\n\t\"sqlwarning\", \"sql_big_result\", \"sql_cache\", \"sql_calc_found_rows\",\n\t\"sql_no_cache\", \"sql_small_result\", \"ssl\", \"start\", \"starting\",\n\t\"stats_auto_recalc\", \"stats_persistent\", \"stats_sample_pages\", \"status\",\n\t\"storage\", \"stored\", \"straight_join\", \"stream\", \"system\", \"vstream\",\n\t\"table\", \"tables\", \"tablespace\", \"temporary\", \"temptable\", \"terminated\",\n\t\"text\", \"than\", \"then\", \"time\", \"timestamp\", \"timestampadd\", \"timestampdiff\",\n\t\"tinyblob\", \"tinyint\", \"tinytext\", \"to\", \"trailing\", \"transaction\", \"tree\",\n\t\"traditional\", \"trigger\", \"triggers\", \"true\", \"truncate\", \"uncommitted\",\n\t\"undefined\", \"undo\", \"union\", \"unique\", \"unlock\", \"unsigned\", \"update\",\n\t\"upgrade\", \"usage\", \"use\", \"user\", \"user_resources\", \"using\", \"utc_date\",\n\t\"utc_time\", \"utc_timestamp\", \"validation\", \"values\", \"variables\", \"varbinary\",\n\t\"varchar\", \"varcharacter\", \"varying\", \"vgtid_executed\", \"virtual\", \"vindex\",\n\t\"vindexes\", \"view\", \"vitess\", \"vitess_keyspaces\", \"vitess_metadata\",\n\t\"vitess_migration\", \"vitess_migrations\", \"vitess_replication_status\",\n\t\"vitess_shards\", \"vitess_tablets\", \"vschema\", \"warnings\", \"when\",\n\t\"where\", \"while\", \"window\", \"with\", \"without\", \"work\", \"write\", \"xor\",\n\t\"year\", \"year_month\", \"zerofill\",\n}\n\n// Keywords that could get an additional keyword\nvar needCustomString = []string{\n\t\"DISTINCTROW\", \"FROM\", // Select keywords:\n\t\"GROUP BY\", \"HAVING\", \"WINDOW\",\n\t\"FOR\",\n\t\"ORDER BY\", \"LIMIT\",\n\t\"INTO\", \"PARTITION\", \"AS\", // Insert Keywords:\n\t\"ON DUPLICATE KEY UPDATE\",\n\t\"WHERE\", \"LIMIT\", // Delete keywords\n\t\"INFILE\", \"INTO TABLE\", \"CHARACTER SET\", // Load keywords\n\t\"TERMINATED BY\", \"ENCLOSED BY\",\n\t\"ESCAPED BY\", \"STARTING BY\",\n\t\"TERMINATED BY\", \"STARTING BY\",\n\t\"IGNORE\",\n\t\"VALUE\", \"VALUES\", // Replace tokens\n\t\"SET\",                                   // Update tokens\n\t\"ENGINE =\",                              // Drop tokens\n\t\"DEFINER =\", \"ON SCHEDULE\", \"RENAME TO\", // Alter tokens\n\t\"COMMENT\", \"DO\", \"INITIAL_SIZE = \", \"OPTIONS\",\n}\n\nvar alterTableTokens = [][]string{\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"CUSTOM_ALTTER_TABLE_OPTIONS\"},\n\t{\"PARTITION_OPTIONS_FOR_ALTER_TABLE\"},\n}\n\nvar alterTokens = [][]string{\n\t{\n\t\t\"DATABASE\", \"SCHEMA\", \"DEFINER = \", \"EVENT\", \"FUNCTION\", \"INSTANCE\",\n\t\t\"LOGFILE GROUP\", \"PROCEDURE\", \"SERVER\",\n\t},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\n\t\t\"ON SCHEDULE\", \"ON COMPLETION PRESERVE\", \"ON COMPLETION NOT PRESERVE\",\n\t\t\"ADD UNDOFILE\", \"OPTIONS\",\n\t},\n\t{\"RENAME TO\", \"INITIAL_SIZE = \"},\n\t{\"ENABLE\", \"DISABLE\", \"DISABLE ON SLAVE\", \"ENGINE\"},\n\t{\"COMMENT\"},\n\t{\"DO\"},\n}\n\nvar setTokens = [][]string{\n\t{\"CHARACTER SET\", \"CHARSET\", \"CUSTOM_FUZZ_STRING\", \"NAMES\"},\n\t{\"CUSTOM_FUZZ_STRING\", \"DEFAULT\", \"=\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n}\n\nvar dropTokens = [][]string{\n\t{\"TEMPORARY\", \"UNDO\"},\n\t{\n\t\t\"DATABASE\", \"SCHEMA\", \"EVENT\", \"INDEX\", \"LOGFILE GROUP\",\n\t\t\"PROCEDURE\", \"FUNCTION\", \"SERVER\", \"SPATIAL REFERENCE SYSTEM\",\n\t\t\"TABLE\", \"TABLESPACE\", \"TRIGGER\", \"VIEW\",\n\t},\n\t{\"IF EXISTS\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"ON\", \"ENGINE = \", \"RESTRICT\", \"CASCADE\"},\n}\n\nvar renameTokens = [][]string{\n\t{\"TABLE\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"TO\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n}\n\nvar truncateTokens = [][]string{\n\t{\"TABLE\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n}\n\nvar createTokens = [][]string{\n\t{\"OR REPLACE\", \"TEMPORARY\", \"UNDO\"}, // For create spatial reference system\n\t{\n\t\t\"UNIQUE\", \"FULLTEXT\", \"SPATIAL\", \"ALGORITHM = UNDEFINED\", \"ALGORITHM = MERGE\",\n\t\t\"ALGORITHM = TEMPTABLE\",\n\t},\n\t{\n\t\t\"DATABASE\", \"SCHEMA\", \"EVENT\", \"FUNCTION\", \"INDEX\", \"LOGFILE GROUP\",\n\t\t\"PROCEDURE\", \"SERVER\", \"SPATIAL REFERENCE SYSTEM\", \"TABLE\", \"TABLESPACE\",\n\t\t\"TRIGGER\", \"VIEW\",\n\t},\n\t{\"IF NOT EXISTS\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n}\n\n/*\n// For future use.\nvar updateTokens = [][]string{\n\t{\"LOW_PRIORITY\"},\n\t{\"IGNORE\"},\n\t{\"SET\"},\n\t{\"WHERE\"},\n\t{\"ORDER BY\"},\n\t{\"LIMIT\"},\n}\n*/\n\nvar replaceTokens = [][]string{\n\t{\"LOW_PRIORITY\", \"DELAYED\"},\n\t{\"INTO\"},\n\t{\"PARTITION\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"VALUES\", \"VALUE\"},\n}\n\nvar loadTokens = [][]string{\n\t{\"DATA\"},\n\t{\"LOW_PRIORITY\", \"CONCURRENT\", \"LOCAL\"},\n\t{\"INFILE\"},\n\t{\"REPLACE\", \"IGNORE\"},\n\t{\"INTO TABLE\"},\n\t{\"PARTITION\"},\n\t{\"CHARACTER SET\"},\n\t{\"FIELDS\", \"COLUMNS\"},\n\t{\"TERMINATED BY\"},\n\t{\"OPTIONALLY\"},\n\t{\"ENCLOSED BY\"},\n\t{\"ESCAPED BY\"},\n\t{\"LINES\"},\n\t{\"STARTING BY\"},\n\t{\"TERMINATED BY\"},\n\t{\"IGNORE\"},\n\t{\"LINES\", \"ROWS\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n}\n\n// These Are everything that comes after \"INSERT\"\nvar insertTokens = [][]string{\n\t{\"LOW_PRIORITY\", \"DELAYED\", \"HIGH_PRIORITY\", \"IGNORE\"},\n\t{\"INTO\"},\n\t{\"PARTITION\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"AS\"},\n\t{\"ON DUPLICATE KEY UPDATE\"},\n}\n\n// These are everything that comes after \"SELECT\"\nvar selectTokens = [][]string{\n\t{\"*\", \"CUSTOM_FUZZ_STRING\", \"DISTINCTROW\"},\n\t{\"HIGH_PRIORITY\"},\n\t{\"STRAIGHT_JOIN\"},\n\t{\"SQL_SMALL_RESULT\", \"SQL_BIG_RESULT\", \"SQL_BUFFER_RESULT\"},\n\t{\"SQL_NO_CACHE\", \"SQL_CALC_FOUND_ROWS\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"FROM\"},\n\t{\"WHERE\"},\n\t{\"GROUP BY\"},\n\t{\"HAVING\"},\n\t{\"WINDOW\"},\n\t{\"ORDER BY\"},\n\t{\"LIMIT\"},\n\t{\"CUSTOM_FUZZ_STRING\"},\n\t{\"FOR\"},\n}\n\n// These are everything that comes after \"DELETE\"\nvar deleteTokens = [][]string{\n\t{\"LOW_PRIORITY\", \"QUICK\", \"IGNORE\", \"FROM\", \"AS\"},\n\t{\"PARTITION\"},\n\t{\"WHERE\"},\n\t{\"ORDER BY\"},\n\t{\"LIMIT\"},\n}\n\nvar alter_table_options = []string{\n\t\"ADD\", \"COLUMN\", \"FIRST\", \"AFTER\", \"INDEX\", \"KEY\", \"FULLTEXT\", \"SPATIAL\",\n\t\"CONSTRAINT\", \"UNIQUE\", \"FOREIGN KEY\", \"CHECK\", \"ENFORCED\", \"DROP\", \"ALTER\",\n\t\"NOT\", \"INPLACE\", \"COPY\", \"SET\", \"VISIBLE\", \"INVISIBLE\", \"DEFAULT\", \"CHANGE\",\n\t\"CHARACTER SET\", \"COLLATE\", \"DISABLE\", \"ENABLE\", \"KEYS\", \"TABLESPACE\", \"LOCK\",\n\t\"FORCE\", \"MODIFY\", \"SHARED\", \"EXCLUSIVE\", \"NONE\", \"ORDER BY\", \"RENAME COLUMN\",\n\t\"AS\", \"=\", \"ASC\", \"DESC\", \"WITH\", \"WITHOUT\", \"VALIDATION\", \"ADD PARTITION\",\n\t\"DROP PARTITION\", \"DISCARD PARTITION\", \"IMPORT PARTITION\", \"TRUNCATE PARTITION\",\n\t\"COALESCE PARTITION\", \"REORGANIZE PARTITION\", \"EXCHANGE PARTITION\",\n\t\"ANALYZE PARTITION\", \"CHECK PARTITION\", \"OPTIMIZE PARTITION\", \"REBUILD PARTITION\",\n\t\"REPAIR PARTITION\", \"REMOVE PARTITIONING\", \"USING\", \"BTREE\", \"HASH\", \"COMMENT\",\n\t\"KEY_BLOCK_SIZE\", \"WITH PARSER\", \"AUTOEXTEND_SIZE\", \"AUTO_INCREMENT\", \"AVG_ROW_LENGTH\",\n\t\"CHECKSUM\", \"INSERT_METHOD\", \"ROW_FORMAT\", \"DYNAMIC\", \"FIXED\", \"COMPRESSED\", \"REDUNDANT\",\n\t\"COMPACT\", \"SECONDARY_ENGINE_ATTRIBUTE\", \"STATS_AUTO_RECALC\", \"STATS_PERSISTENT\",\n\t\"STATS_SAMPLE_PAGES\", \"ZLIB\", \"LZ4\", \"ENGINE_ATTRIBUTE\", \"KEY_BLOCK_SIZE\", \"MAX_ROWS\",\n\t\"MIN_ROWS\", \"PACK_KEYS\", \"PASSWORD\", \"COMPRESSION\", \"CONNECTION\", \"DIRECTORY\",\n\t\"DELAY_KEY_WRITE\", \"ENCRYPTION\", \"STORAGE\", \"DISK\", \"MEMORY\", \"UNION\",\n}\n\n// Creates an 'alter table' statement. 'alter table' is an exception\n// in that it has its own function. The majority of statements\n// are created by 'createStmt()'.\nfunc createAlterTableStmt(f *ConsumeFuzzer) (string, error) {\n\tmaxArgs, err := f.GetInt()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tmaxArgs = maxArgs % 30\n\tif maxArgs == 0 {\n\t\treturn \"\", fmt.Errorf(\"could not create alter table stmt\")\n\t}\n\n\tvar stmt strings.Builder\n\tstmt.WriteString(\"ALTER TABLE \")\n\tfor i := 0; i < maxArgs; i++ {\n\t\t// Calculate if we get existing token or custom string\n\t\ttokenType, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif tokenType%4 == 1 {\n\t\t\tcustomString, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tstmt.WriteString(\" \" + customString)\n\t\t} else {\n\t\t\ttokenIndex, err := f.GetInt()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tstmt.WriteString(\" \" + alter_table_options[tokenIndex%len(alter_table_options)])\n\t\t}\n\t}\n\treturn stmt.String(), nil\n}\n\nfunc chooseToken(tokens []string, f *ConsumeFuzzer) (string, error) {\n\tindex, err := f.GetInt()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvar token strings.Builder\n\ttoken.WriteString(tokens[index%len(tokens)])\n\tif token.String() == \"CUSTOM_FUZZ_STRING\" {\n\t\tcustomFuzzString, err := f.GetString()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn customFuzzString, nil\n\t}\n\n\t// Check if token requires an argument\n\tif containsString(needCustomString, token.String()) {\n\t\tcustomFuzzString, err := f.GetString()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\ttoken.WriteString(\" \" + customFuzzString)\n\t}\n\treturn token.String(), nil\n}\n\nvar stmtTypes = map[string][][]string{\n\t\"DELETE\":      deleteTokens,\n\t\"INSERT\":      insertTokens,\n\t\"SELECT\":      selectTokens,\n\t\"LOAD\":        loadTokens,\n\t\"REPLACE\":     replaceTokens,\n\t\"CREATE\":      createTokens,\n\t\"DROP\":        dropTokens,\n\t\"RENAME\":      renameTokens,\n\t\"TRUNCATE\":    truncateTokens,\n\t\"SET\":         setTokens,\n\t\"ALTER\":       alterTokens,\n\t\"ALTER TABLE\": alterTableTokens, // ALTER TABLE has its own set of tokens\n}\n\nvar stmtTypeEnum = map[int]string{\n\t0:  \"DELETE\",\n\t1:  \"INSERT\",\n\t2:  \"SELECT\",\n\t3:  \"LOAD\",\n\t4:  \"REPLACE\",\n\t5:  \"CREATE\",\n\t6:  \"DROP\",\n\t7:  \"RENAME\",\n\t8:  \"TRUNCATE\",\n\t9:  \"SET\",\n\t10: \"ALTER\",\n\t11: \"ALTER TABLE\",\n}\n\nfunc createStmt(f *ConsumeFuzzer) (string, error) {\n\tstmtIndex, err := f.GetInt()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tstmtIndex = stmtIndex % len(stmtTypes)\n\n\tqueryType := stmtTypeEnum[stmtIndex]\n\ttokens := stmtTypes[queryType]\n\n\t// We have custom creator for ALTER TABLE\n\tif queryType == \"ALTER TABLE\" {\n\t\tquery, err := createAlterTableStmt(f)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn query, nil\n\t}\n\n\t// Here we are creating a query that is not\n\t// an 'alter table' query. For available\n\t// queries, see \"stmtTypes\"\n\n\t// First specify the first query keyword:\n\tvar query strings.Builder\n\tquery.WriteString(queryType)\n\n\t// Next create the args for the\n\tqueryArgs, err := createStmtArgs(tokens, f)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tquery.WriteString(\" \" + queryArgs)\n\treturn query.String(), nil\n}\n\n// Creates the arguments of a statements. In a select statement\n// that would be everything after \"select\".\nfunc createStmtArgs(tokenslice [][]string, f *ConsumeFuzzer) (string, error) {\n\tvar query, token strings.Builder\n\n\t// We go through the tokens in the tokenslice,\n\t// create the respective token and add it to\n\t// \"query\"\n\tfor _, tokens := range tokenslice {\n\t\t// For extra randomization, the fuzzer can\n\t\t// choose to not include this token.\n\t\tincludeThisToken, err := f.GetBool()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif !includeThisToken {\n\t\t\tcontinue\n\t\t}\n\n\t\t// There may be several tokens to choose from:\n\t\tif len(tokens) > 1 {\n\t\t\tchosenToken, err := chooseToken(tokens, f)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tquery.WriteString(\" \" + chosenToken)\n\t\t} else {\n\t\t\ttoken.WriteString(tokens[0])\n\n\t\t\t// In case the token is \"CUSTOM_FUZZ_STRING\"\n\t\t\t// we will then create a non-structured string\n\t\t\tif token.String() == \"CUSTOM_FUZZ_STRING\" {\n\t\t\t\tcustomFuzzString, err := f.GetString()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t\tquery.WriteString(\" \" + customFuzzString)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Check if token requires an argument.\n\t\t\t// Tokens that take an argument can be found\n\t\t\t// in 'needCustomString'. If so, we add a\n\t\t\t// non-structured string to the token.\n\t\t\tif containsString(needCustomString, token.String()) {\n\t\t\t\tcustomFuzzString, err := f.GetString()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t\ttoken.WriteString(fmt.Sprintf(\" %s\", customFuzzString))\n\t\t\t}\n\t\t\tquery.WriteString(fmt.Sprintf(\" %s\", token.String()))\n\t\t}\n\t}\n\treturn query.String(), nil\n}\n\n// Creates a semi-structured query. It creates a string\n// that is a combination of the keywords and random strings.\nfunc createQuery(f *ConsumeFuzzer) (string, error) {\n\tqueryLen, err := f.GetInt()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tmaxLen := queryLen % 60\n\tif maxLen == 0 {\n\t\treturn \"\", fmt.Errorf(\"could not create a query\")\n\t}\n\tvar query strings.Builder\n\tfor i := 0; i < maxLen; i++ {\n\t\t// Get a new token:\n\t\tuseKeyword, err := f.GetBool()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif useKeyword {\n\t\t\tkeyword, err := getKeyword(f)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tquery.WriteString(\" \" + keyword)\n\t\t} else {\n\t\t\tcustomString, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tquery.WriteString(\" \" + customString)\n\t\t}\n\t}\n\tif query.String() == \"\" {\n\t\treturn \"\", fmt.Errorf(\"could not create a query\")\n\t}\n\treturn query.String(), nil\n}\n\n// GetSQLString is the API that users interact with.\n//\n// Usage:\n//\n//\tf := NewConsumer(data)\n//\tsqlString, err := f.GetSQLString()\nfunc (f *ConsumeFuzzer) GetSQLString() (string, error) {\n\tvar query string\n\tveryStructured, err := f.GetBool()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif veryStructured {\n\t\tquery, err = createStmt(f)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t} else {\n\t\tquery, err = createQuery(f)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\treturn query, nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/CONTRIBUTING.md",
    "content": "# Contributing to Survey\n\n🎉🎉 First off, thanks for the interest in contributing to `survey`! 🎉🎉\n\nThe following is a set of guidelines to follow when contributing to this package. These are not hard rules, please use common sense and feel free to propose changes to this document in a pull request.\n\n## Code of Conduct\n\nThis project and its contibutors are expected to uphold the [Go Community Code of Conduct](https://golang.org/conduct). By participating, you are expected to follow these guidelines.\n\n## Getting help\n\n* [Open an issue](https://github.com/AlecAivazis/survey/issues/new/choose)\n* Reach out to `@AlecAivazis` or `@mislav` in the Gophers slack (please use only when urgent)\n\n## Submitting a contribution\n\nWhen submitting a contribution,\n\n- Try to make a series of smaller changes instead of one large change\n- Provide a description of each change that you are proposing\n- Reference the issue addressed by your pull request (if there is one)\n- Document all new exported Go APIs\n- Update the project's README when applicable\n- Include unit tests if possible\n- Contributions with visual ramifications or interaction changes should be accompanied with an integration test—see below for details.\n\n## Writing and running tests\n\nWhen submitting features, please add as many units tests as necessary to test both positive and negative cases.\n\nIntegration tests for survey uses [go-expect](https://github.com/Netflix/go-expect) to expect a match on stdout and respond on stdin. Since `os.Stdout` in a `go test` process is not a TTY, you need a way to interpret terminal / ANSI escape sequences for things like `CursorLocation`. The stdin/stdout handled by `go-expect` is also multiplexed to a [virtual terminal](https://github.com/hinshun/vt10x).\n\nFor example, you can extend the tests for Input by specifying the following test case:\n\n```go\n{\n  \"Test Input prompt interaction\",       // Name of the test.\n  &Input{                                // An implementation of the survey.Prompt interface.\n    Message: \"What is your name?\",\n  },\n  func(c *expect.Console) {              // An expect procedure. You can expect strings / regexps and\n    c.ExpectString(\"What is your name?\") // write back strings / bytes to its psuedoterminal for survey.\n    c.SendLine(\"Johnny Appleseed\")\n    c.ExpectEOF()                        // Nothing is read from the tty without an expect, and once an\n                                         // expectation is met, no further bytes are read. End your\n                                         // procedure with `c.ExpectEOF()` to read until survey finishes.\n  },\n  \"Johnny Appleseed\",                    // The expected result.\n}\n```\n\nIf you want to write your own `go-expect` test from scratch, you'll need to instantiate a virtual terminal,\nmultiplex it into an `*expect.Console`, and hook up its tty with survey's optional stdio. Please see `go-expect`\n[documentation](https://godoc.org/github.com/Netflix/go-expect) for more detail.\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Alec Aivazis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/README.md",
    "content": "# Survey\n\n[![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg)](https://pkg.go.dev/github.com/AlecAivazis/survey/v2)\n\nA library for building interactive and accessible prompts on terminals supporting ANSI escape sequences.\n\n<img width=\"550\" src=\"https://thumbs.gfycat.com/VillainousGraciousKouprey-size_restricted.gif\"/>\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/AlecAivazis/survey/v2\"\n)\n\n// the questions to ask\nvar qs = []*survey.Question{\n    {\n        Name:     \"name\",\n        Prompt:   &survey.Input{Message: \"What is your name?\"},\n        Validate: survey.Required,\n        Transform: survey.Title,\n    },\n    {\n        Name: \"color\",\n        Prompt: &survey.Select{\n            Message: \"Choose a color:\",\n            Options: []string{\"red\", \"blue\", \"green\"},\n            Default: \"red\",\n        },\n    },\n    {\n        Name: \"age\",\n        Prompt:   &survey.Input{Message: \"How old are you?\"},\n    },\n}\n\nfunc main() {\n    // the answers will be written to this struct\n    answers := struct {\n        Name          string                  // survey will match the question and field names\n        FavoriteColor string `survey:\"color\"` // or you can tag fields to match a specific name\n        Age           int                     // if the types don't match, survey will convert it\n    }{}\n\n    // perform the questions\n    err := survey.Ask(qs, &answers)\n    if err != nil {\n        fmt.Println(err.Error())\n        return\n    }\n\n    fmt.Printf(\"%s chose %s.\", answers.Name, answers.FavoriteColor)\n}\n```\n\n## Examples\n\nExamples can be found in the `examples/` directory. Run them\nto see basic behavior:\n\n```bash\ngo run examples/simple.go\ngo run examples/validation.go\n```\n\n## Running the Prompts\n\nThere are two primary ways to execute prompts and start collecting information from your users: `Ask` and\n`AskOne`. The primary difference is whether you are interested in collecting a single piece of information\nor if you have a list of questions to ask whose answers should be collected in a single struct.\nFor most basic usecases, `Ask` should be enough. However, for surveys with complicated branching logic,\nwe recommend that you break out your questions into multiple calls to both of these functions to fit your needs.\n\n### Configuring the Prompts\n\nMost prompts take fine-grained configuration through fields on the structs you instantiate. It is also\npossible to change survey's default behaviors by passing `AskOpts` to either `Ask` or `AskOne`. Examples\nin this document will do both interchangeably:\n\n```golang\nprompt := &Select{\n    Message: \"Choose a color:\",\n    Options: []string{\"red\", \"blue\", \"green\"},\n    // can pass a validator directly\n    Validate: survey.Required,\n}\n\n// or define a default for the single call to `AskOne`\n// the answer will get written to the color variable\nsurvey.AskOne(prompt, &color, survey.WithValidator(survey.Required))\n\n// or define a default for every entry in a list of questions\n// the answer will get copied into the matching field of the struct as shown above\nsurvey.Ask(questions, &answers, survey.WithValidator(survey.Required))\n```\n\n## Prompts\n\n### Input\n\n<img src=\"https://thumbs.gfycat.com/LankyBlindAmericanpainthorse-size_restricted.gif\" width=\"400px\"/>\n\n```golang\nname := \"\"\nprompt := &survey.Input{\n    Message: \"ping\",\n}\nsurvey.AskOne(prompt, &name)\n```\n\n#### Suggestion Options\n\n<img src=\"https://i.imgur.com/Q7POpA1.gif\" width=\"800px\"/>\n\n```golang\nfile := \"\"\nprompt := &survey.Input{\n    Message: \"inform a file to save:\",\n    Suggest: func (toComplete string) []string {\n        files, _ := filepath.Glob(toComplete + \"*\")\n        return files\n    },\n}\n}\nsurvey.AskOne(prompt, &file)\n```\n\n### Multiline\n\n<img src=\"https://thumbs.gfycat.com/ImperfectShimmeringBeagle-size_restricted.gif\" width=\"400px\"/>\n\n```golang\ntext := \"\"\nprompt := &survey.Multiline{\n    Message: \"ping\",\n}\nsurvey.AskOne(prompt, &text)\n```\n\n### Password\n\n<img src=\"https://thumbs.gfycat.com/CompassionateSevereHypacrosaurus-size_restricted.gif\" width=\"400px\" />\n\n```golang\npassword := \"\"\nprompt := &survey.Password{\n    Message: \"Please type your password\",\n}\nsurvey.AskOne(prompt, &password)\n```\n\n### Confirm\n\n<img src=\"https://thumbs.gfycat.com/UnkemptCarefulGermanpinscher-size_restricted.gif\" width=\"400px\"/>\n\n```golang\nname := false\nprompt := &survey.Confirm{\n    Message: \"Do you like pie?\",\n}\nsurvey.AskOne(prompt, &name)\n```\n\n### Select\n\n<img src=\"https://thumbs.gfycat.com/GrimFilthyAmazonparrot-size_restricted.gif\" width=\"450px\"/>\n\n```golang\ncolor := \"\"\nprompt := &survey.Select{\n    Message: \"Choose a color:\",\n    Options: []string{\"red\", \"blue\", \"green\"},\n}\nsurvey.AskOne(prompt, &color)\n```\n\nFields and values that come from a `Select` prompt can be one of two different things. If you pass an `int`\nthe field will have the value of the selected index. If you instead pass a string, the string value selected\nwill be written to the field.\n\nThe user can also press `esc` to toggle the ability cycle through the options with the j and k keys to do down and up respectively.\n\nBy default, the select prompt is limited to showing 7 options at a time\nand will paginate lists of options longer than that. This can be changed a number of ways:\n\n```golang\n// as a field on a single select\nprompt := &survey.MultiSelect{..., PageSize: 10}\n\n// or as an option to Ask or AskOne\nsurvey.AskOne(prompt, &days, survey.WithPageSize(10))\n```\n\n#### Select options description\n\nThe optional description text can be used to add extra information to each option listed in the select prompt:\n\n```golang\ncolor := \"\"\nprompt := &survey.Select{\n    Message: \"Choose a color:\",\n    Options: []string{\"red\", \"blue\", \"green\"},\n    Description: func(value string, index int) string {\n        if value == \"red\" {\n            return \"My favorite color\"\n        }\n        return \"\"\n    },\n}\nsurvey.AskOne(prompt, &color)\n\n// Assuming that the user chose \"red - My favorite color\":\nfmt.Println(color) //=> \"red\"\n```\n\n### MultiSelect\n\n![Example](img/multi-select-all-none.gif)\n\n```golang\ndays := []string{}\nprompt := &survey.MultiSelect{\n    Message: \"What days do you prefer:\",\n    Options: []string{\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"},\n}\nsurvey.AskOne(prompt, &days)\n```\n\nFields and values that come from a `MultiSelect` prompt can be one of two different things. If you pass an `int`\nthe field will have a slice of the selected indices. If you instead pass a string, a slice of the string values\nselected will be written to the field.\n\nThe user can also press `esc` to toggle the ability cycle through the options with the j and k keys to do down and up respectively.\n\nBy default, the MultiSelect prompt is limited to showing 7 options at a time\nand will paginate lists of options longer than that. This can be changed a number of ways:\n\n```golang\n// as a field on a single select\nprompt := &survey.MultiSelect{..., PageSize: 10}\n\n// or as an option to Ask or AskOne\nsurvey.AskOne(prompt, &days, survey.WithPageSize(10))\n```\n\n### Editor\n\nLaunches the user's preferred editor (defined by the \\$VISUAL or \\$EDITOR environment variables) on a\ntemporary file. Once the user exits their editor, the contents of the temporary file are read in as\nthe result. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used.\n\nYou can also specify a [pattern](https://golang.org/pkg/io/ioutil/#TempFile) for the name of the temporary file. This\ncan be useful for ensuring syntax highlighting matches your usecase.\n\n```golang\nprompt := &survey.Editor{\n    Message: \"Shell code snippet\",\n    FileName: \"*.sh\",\n}\n\nsurvey.AskOne(prompt, &content)\n```\n\n## Filtering Options\n\nBy default, the user can filter for options in Select and MultiSelects by typing while the prompt\nis active. This will filter out all options that don't contain the typed string anywhere in their name, ignoring case.\n\nA custom filter function can also be provided to change this behavior:\n\n```golang\nfunc myFilter(filterValue string, optValue string, optIndex int) bool {\n    // only include the option if it includes the filter and has length greater than 5\n    return strings.Contains(optValue, filterValue) && len(optValue) >= 5\n}\n\n// configure it for a specific prompt\n&Select{\n    Message: \"Choose a color:\",\n    Options: []string{\"red\", \"blue\", \"green\"},\n    Filter: myFilter,\n}\n\n// or define a default for all of the questions\nsurvey.AskOne(prompt, &color, survey.WithFilter(myFilter))\n```\n\n## Keeping the filter active\n\nBy default the filter will disappear if the user selects one of the filtered elements. Once the user selects one element the filter setting is gone.\n\nHowever the user can prevent this from happening and keep the filter active for multiple selections in a e.g. MultiSelect:\n\n```golang\n// configure it for a specific prompt\n&Select{\n    Message:    \"Choose a color:\",\n    Options:    []string{\"light-green\", \"green\", \"dark-green\", \"red\"},\n    KeepFilter: true,\n}\n\n// or define a default for all of the questions\nsurvey.AskOne(prompt, &color, survey.WithKeepFilter(true))\n```\n\n## Validation\n\nValidating individual responses for a particular question can be done by defining a\n`Validate` field on the `survey.Question` to be validated. This function takes an\n`interface{}` type and returns an error to show to the user, prompting them for another\nresponse. Like usual, validators can be provided directly to the prompt or with `survey.WithValidator`:\n\n```golang\nq := &survey.Question{\n    Prompt: &survey.Input{Message: \"Hello world validation\"},\n    Validate: func (val interface{}) error {\n        // since we are validating an Input, the assertion will always succeed\n        if str, ok := val.(string) ; !ok || len(str) > 10 {\n            return errors.New(\"This response cannot be longer than 10 characters.\")\n        }\n\treturn nil\n    },\n}\n\ncolor := \"\"\nprompt := &survey.Input{ Message: \"Whats your name?\" }\n\n// you can pass multiple validators here and survey will make sure each one passes\nsurvey.AskOne(prompt, &color, survey.WithValidator(survey.Required))\n```\n\n### Built-in Validators\n\n`survey` comes prepackaged with a few validators to fit common situations. Currently these\nvalidators include:\n\n| name         | valid types    | description                                                      | notes                                                                                 |\n| ------------ | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------- |\n| Required     | any            | Rejects zero values of the response type                         | Boolean values pass straight through since the zero value (false) is a valid response |\n| MinLength(n) | string         | Enforces that a response is at least the given length            |                                                                                       |\n| MaxLength(n) | string         | Enforces that a response is no longer than the given length      |                                                                                       |\n| MaxItems(n)  | []OptionAnswer | Enforces that a response has no more selections of the indicated |                                                                                       |\n| MinItems(n)  | []OptionAnswer | Enforces that a response has no less selections of the indicated |                                                                                       |\n\n## Help Text\n\nAll of the prompts have a `Help` field which can be defined to provide more information to your users:\n\n<img src=\"https://thumbs.gfycat.com/CloudyRemorsefulFossa-size_restricted.gif\" width=\"400px\" style=\"margin-top: 8px\"/>\n\n```golang\n&survey.Input{\n    Message: \"What is your phone number:\",\n    Help:    \"Phone number should include the area code\",\n}\n```\n\n## Removing the \"Select All\" and \"Select None\" options\n\nBy default, users can select all of the multi-select options using the right arrow key. To prevent users from being able to do this (and remove the `<right> to all` message from the prompt), use the option `WithRemoveSelectAll`:\n\n```golang\nimport (\n    \"github.com/AlecAivazis/survey/v2\"\n)\n\nnumber := \"\"\nprompt := &survey.Input{\n    Message: \"This question has the select all option removed\",\n}\n\nsurvey.AskOne(prompt, &number, survey.WithRemoveSelectAll())\n```\n\nAlso by default, users can use the left arrow key to unselect all of the options. To prevent users from being able to do this (and remove the `<left> to none` message from the prompt), use the option `WithRemoveSelectNone`:\n\n```golang\nimport (\n    \"github.com/AlecAivazis/survey/v2\"\n)\n\nnumber := \"\"\nprompt := &survey.Input{\n    Message: \"This question has the select all option removed\",\n}\n\nsurvey.AskOne(prompt, &number, survey.WithRemoveSelectNone())\n```\n\n\n### Changing the input rune\n\nIn some situations, `?` is a perfectly valid response. To handle this, you can change the rune that survey\nlooks for with `WithHelpInput`:\n\n```golang\nimport (\n    \"github.com/AlecAivazis/survey/v2\"\n)\n\nnumber := \"\"\nprompt := &survey.Input{\n    Message: \"If you have this need, please give me a reasonable message.\",\n    Help:    \"I couldn't come up with one.\",\n}\n\nsurvey.AskOne(prompt, &number, survey.WithHelpInput('^'))\n```\n\n## Changing the Icons\n\nChanging the icons and their color/format can be done by passing the `WithIcons` option. The format\nfollows the patterns outlined [here](https://github.com/mgutz/ansi#style-format). For example:\n\n```golang\nimport (\n    \"github.com/AlecAivazis/survey/v2\"\n)\n\nnumber := \"\"\nprompt := &survey.Input{\n    Message: \"If you have this need, please give me a reasonable message.\",\n    Help:    \"I couldn't come up with one.\",\n}\n\nsurvey.AskOne(prompt, &number, survey.WithIcons(func(icons *survey.IconSet) {\n    // you can set any icons\n    icons.Question.Text = \"⁇\"\n    // for more information on formatting the icons, see here: https://github.com/mgutz/ansi#style-format\n    icons.Question.Format = \"yellow+hb\"\n}))\n```\n\nThe icons and their default text and format are summarized below:\n\n| name           | text | format     | description                                                   |\n| -------------- | ---- | ---------- | ------------------------------------------------------------- |\n| Error          | X    | red        | Before an error                                               |\n| Help           | i    | cyan       | Before help text                                              |\n| Question       | ?    | green+hb   | Before the message of a prompt                                |\n| SelectFocus    | >    | green      | Marks the current focus in `Select` and `MultiSelect` prompts |\n| UnmarkedOption | [ ]  | default+hb | Marks an unselected option in a `MultiSelect` prompt          |\n| MarkedOption   | [x]  | cyan+b     | Marks a chosen selection in a `MultiSelect` prompt            |\n\n## Custom Types\n\nsurvey will assign prompt answers to your custom types if they implement this interface:\n\n```golang\ntype Settable interface {\n    WriteAnswer(field string, value interface{}) error\n}\n```\n\nHere is an example how to use them:\n\n```golang\ntype MyValue struct {\n    value string\n}\nfunc (my *MyValue) WriteAnswer(name string, value interface{}) error {\n     my.value = value.(string)\n}\n\nmyval := MyValue{}\nsurvey.AskOne(\n    &survey.Input{\n        Message: \"Enter something:\",\n    },\n    &myval\n)\n```\n\n## Testing\n\nYou can test your program's interactive prompts using [go-expect](https://github.com/Netflix/go-expect). The library\ncan be used to expect a match on stdout and respond on stdin. Since `os.Stdout` in a `go test` process is not a TTY,\nif you are manipulating the cursor or using `survey`, you will need a way to interpret terminal / ANSI escape sequences\nfor things like `CursorLocation`. `vt10x.NewVT10XConsole` will create a `go-expect` console that also multiplexes\nstdio to an in-memory [virtual terminal](https://github.com/hinshun/vt10x).\n\nFor some examples, you can see any of the tests in this repo.\n\n## FAQ\n\n### What kinds of IO are supported by `survey`?\n\nsurvey aims to support most terminal emulators; it expects support for ANSI escape sequences.\nThis means that reading from piped stdin or writing to piped stdout is **not supported**,\nand likely to break your application in these situations. See [#337](https://github.com/AlecAivazis/survey/pull/337#issue-581351617)\n\n### Why isn't Ctrl-C working?\n\nOrdinarily, when you type Ctrl-C, the terminal recognizes this as the QUIT button and delivers a SIGINT signal to the process, which terminates it.\nHowever, Survey temporarily configures the terminal to deliver control codes as ordinary input bytes.\nWhen Survey reads a ^C byte (ASCII \\x03, \"end of text\"), it interrupts the current survey and returns a\n`github.com/AlecAivazis/survey/v2/terminal.InterruptErr` from `Ask` or `AskOne`.\nIf you want to stop the process, handle the returned error in your code:\n\n```go\nerr := survey.AskOne(prompt, &myVar)\nif err != nil {\n\tif err == terminal.InterruptErr {\n\t\tlog.Fatal(\"interrupted\")\n\t}\n\t...\n}\n```\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/confirm.go",
    "content": "package survey\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\n// Confirm is a regular text input that accept yes/no answers. Response type is a bool.\ntype Confirm struct {\n\tRenderer\n\tMessage string\n\tDefault bool\n\tHelp    string\n}\n\n// data available to the templates when processing\ntype ConfirmTemplateData struct {\n\tConfirm\n\tAnswer   string\n\tShowHelp bool\n\tConfig   *PromptConfig\n}\n\n// Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\nvar ConfirmQuestionTemplate = `\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }} {{color \"reset\"}}\n{{- if .Answer}}\n  {{- color \"cyan\"}}{{.Answer}}{{color \"reset\"}}{{\"\\n\"}}\n{{- else }}\n  {{- if and .Help (not .ShowHelp)}}{{color \"cyan\"}}[{{ .Config.HelpInput }} for help]{{color \"reset\"}} {{end}}\n  {{- color \"white\"}}{{if .Default}}(Y/n) {{else}}(y/N) {{end}}{{color \"reset\"}}\n{{- end}}`\n\n// the regex for answers\nvar (\n\tyesRx = regexp.MustCompile(\"^(?i:y(?:es)?)$\")\n\tnoRx  = regexp.MustCompile(\"^(?i:n(?:o)?)$\")\n)\n\nfunc yesNo(t bool) string {\n\tif t {\n\t\treturn \"Yes\"\n\t}\n\treturn \"No\"\n}\n\nfunc (c *Confirm) getBool(showHelp bool, config *PromptConfig) (bool, error) {\n\tcursor := c.NewCursor()\n\trr := c.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\t// start waiting for input\n\tfor {\n\t\tline, err := rr.ReadLine(0)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t// move back up a line to compensate for the \\n echoed from terminal\n\t\tcursor.PreviousLine(1)\n\t\tval := string(line)\n\n\t\t// get the answer that matches the\n\t\tvar answer bool\n\t\tswitch {\n\t\tcase yesRx.Match([]byte(val)):\n\t\t\tanswer = true\n\t\tcase noRx.Match([]byte(val)):\n\t\t\tanswer = false\n\t\tcase val == \"\":\n\t\t\tanswer = c.Default\n\t\tcase val == config.HelpInput && c.Help != \"\":\n\t\t\terr := c.Render(\n\t\t\t\tConfirmQuestionTemplate,\n\t\t\t\tConfirmTemplateData{\n\t\t\t\t\tConfirm:  *c,\n\t\t\t\t\tShowHelp: true,\n\t\t\t\t\tConfig:   config,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// use the default value and bubble up\n\t\t\t\treturn c.Default, err\n\t\t\t}\n\t\t\tshowHelp = true\n\t\t\tcontinue\n\t\tdefault:\n\t\t\t// we didnt get a valid answer, so print error and prompt again\n\t\t\t//lint:ignore ST1005 it should be fine for this error message to have punctuation\n\t\t\tif err := c.Error(config, fmt.Errorf(\"%q is not a valid answer, please try again.\", val)); err != nil {\n\t\t\t\treturn c.Default, err\n\t\t\t}\n\t\t\terr := c.Render(\n\t\t\t\tConfirmQuestionTemplate,\n\t\t\t\tConfirmTemplateData{\n\t\t\t\t\tConfirm:  *c,\n\t\t\t\t\tShowHelp: showHelp,\n\t\t\t\t\tConfig:   config,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// use the default value and bubble up\n\t\t\t\treturn c.Default, err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\treturn answer, nil\n\t}\n}\n\n/*\nPrompt prompts the user with a simple text field and expects a reply followed\nby a carriage return.\n\n\tlikesPie := false\n\tprompt := &survey.Confirm{ Message: \"What is your name?\" }\n\tsurvey.AskOne(prompt, &likesPie)\n*/\nfunc (c *Confirm) Prompt(config *PromptConfig) (interface{}, error) {\n\t// render the question template\n\terr := c.Render(\n\t\tConfirmQuestionTemplate,\n\t\tConfirmTemplateData{\n\t\t\tConfirm: *c,\n\t\t\tConfig:  config,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// get input and return\n\treturn c.getBool(false, config)\n}\n\n// Cleanup overwrite the line with the finalized formatted version\nfunc (c *Confirm) Cleanup(config *PromptConfig, val interface{}) error {\n\t// if the value was previously true\n\tans := yesNo(val.(bool))\n\n\t// render the template\n\treturn c.Render(\n\t\tConfirmQuestionTemplate,\n\t\tConfirmTemplateData{\n\t\t\tConfirm: *c,\n\t\t\tAnswer:  ans,\n\t\t\tConfig:  config,\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/core/template.go",
    "content": "package core\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"sync\"\n\t\"text/template\"\n\n\t\"github.com/mgutz/ansi\"\n)\n\n// DisableColor can be used to make testing reliable\nvar DisableColor = false\n\nvar TemplateFuncsWithColor = map[string]interface{}{\n\t// Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\n\t\"color\": ansi.ColorCode,\n}\n\nvar TemplateFuncsNoColor = map[string]interface{}{\n\t// Templates without Color formatting. For layout/ testing.\n\t\"color\": func(color string) string {\n\t\treturn \"\"\n\t},\n}\n\n// envColorDisabled returns if output colors are forbid by environment variables\nfunc envColorDisabled() bool {\n\treturn os.Getenv(\"NO_COLOR\") != \"\" || os.Getenv(\"CLICOLOR\") == \"0\"\n}\n\n// envColorForced returns if output colors are forced from environment variables\nfunc envColorForced() bool {\n\tval, ok := os.LookupEnv(\"CLICOLOR_FORCE\")\n\treturn ok && val != \"0\"\n}\n\n// RunTemplate returns two formatted strings given a template and\n// the data it requires. The first string returned is generated for\n// user-facing output and may or may not contain ANSI escape codes\n// for colored output. The second string does not contain escape codes\n// and can be used by the renderer for layout purposes.\nfunc RunTemplate(tmpl string, data interface{}) (string, string, error) {\n\ttPair, err := GetTemplatePair(tmpl)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tuserBuf := bytes.NewBufferString(\"\")\n\terr = tPair[0].Execute(userBuf, data)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tlayoutBuf := bytes.NewBufferString(\"\")\n\terr = tPair[1].Execute(layoutBuf, data)\n\tif err != nil {\n\t\treturn userBuf.String(), \"\", err\n\t}\n\treturn userBuf.String(), layoutBuf.String(), err\n}\n\nvar (\n\tmemoizedGetTemplate = map[string][2]*template.Template{}\n\n\tmemoMutex = &sync.RWMutex{}\n)\n\n// GetTemplatePair returns a pair of compiled templates where the\n// first template is generated for user-facing output and the\n// second is generated for use by the renderer. The second\n// template does not contain any color escape codes, whereas\n// the first template may or may not depending on DisableColor.\nfunc GetTemplatePair(tmpl string) ([2]*template.Template, error) {\n\tmemoMutex.RLock()\n\tif t, ok := memoizedGetTemplate[tmpl]; ok {\n\t\tmemoMutex.RUnlock()\n\t\treturn t, nil\n\t}\n\tmemoMutex.RUnlock()\n\n\ttemplatePair := [2]*template.Template{nil, nil}\n\n\ttemplateNoColor, err := template.New(\"prompt\").Funcs(TemplateFuncsNoColor).Parse(tmpl)\n\tif err != nil {\n\t\treturn [2]*template.Template{}, err\n\t}\n\n\ttemplatePair[1] = templateNoColor\n\n\tenvColorHide := envColorDisabled() && !envColorForced()\n\tif DisableColor || envColorHide {\n\t\ttemplatePair[0] = templatePair[1]\n\t} else {\n\t\ttemplateWithColor, err := template.New(\"prompt\").Funcs(TemplateFuncsWithColor).Parse(tmpl)\n\t\ttemplatePair[0] = templateWithColor\n\t\tif err != nil {\n\t\t\treturn [2]*template.Template{}, err\n\t\t}\n\t}\n\n\tmemoMutex.Lock()\n\tmemoizedGetTemplate[tmpl] = templatePair\n\tmemoMutex.Unlock()\n\treturn templatePair, nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/core/write.go",
    "content": "package core\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// the tag used to denote the name of the question\nconst tagName = \"survey\"\n\n// Settable allow for configuration when assigning answers\ntype Settable interface {\n\tWriteAnswer(field string, value interface{}) error\n}\n\n// OptionAnswer is the return type of Selects/MultiSelects that lets the appropriate information\n// get copied to the user's struct\ntype OptionAnswer struct {\n\tValue string\n\tIndex int\n}\n\ntype reflectField struct {\n\tvalue     reflect.Value\n\tfieldType reflect.StructField\n}\n\nfunc OptionAnswerList(incoming []string) []OptionAnswer {\n\tlist := []OptionAnswer{}\n\tfor i, opt := range incoming {\n\t\tlist = append(list, OptionAnswer{Value: opt, Index: i})\n\t}\n\treturn list\n}\n\nfunc WriteAnswer(t interface{}, name string, v interface{}) (err error) {\n\t// if the field is a custom type\n\tif s, ok := t.(Settable); ok {\n\t\t// use the interface method\n\t\treturn s.WriteAnswer(name, v)\n\t}\n\n\t// the target to write to\n\ttarget := reflect.ValueOf(t)\n\t// the value to write from\n\tvalue := reflect.ValueOf(v)\n\n\t// make sure we are writing to a pointer\n\tif target.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"you must pass a pointer as the target of a Write operation\")\n\t}\n\t// the object \"inside\" of the target pointer\n\telem := target.Elem()\n\n\t// handle the special types\n\tswitch elem.Kind() {\n\t// if we are writing to a struct\n\tcase reflect.Struct:\n\t\t// if we are writing to an option answer than we want to treat\n\t\t// it like a single thing and not a place to deposit answers\n\t\tif elem.Type().Name() == \"OptionAnswer\" {\n\t\t\t// copy the value over to the normal struct\n\t\t\treturn copy(elem, value)\n\t\t}\n\n\t\t// get the name of the field that matches the string we  were given\n\t\tfield, _, err := findField(elem, name)\n\t\t// if something went wrong\n\t\tif err != nil {\n\t\t\t// bubble up\n\t\t\treturn err\n\t\t}\n\t\t// handle references to the Settable interface aswell\n\t\tif s, ok := field.Interface().(Settable); ok {\n\t\t\t// use the interface method\n\t\t\treturn s.WriteAnswer(name, v)\n\t\t}\n\t\tif field.CanAddr() {\n\t\t\tif s, ok := field.Addr().Interface().(Settable); ok {\n\t\t\t\t// use the interface method\n\t\t\t\treturn s.WriteAnswer(name, v)\n\t\t\t}\n\t\t}\n\n\t\t// copy the value over to the normal struct\n\t\treturn copy(field, value)\n\tcase reflect.Map:\n\t\tmapType := reflect.TypeOf(t).Elem()\n\t\tif mapType.Key().Kind() != reflect.String {\n\t\t\treturn errors.New(\"answer maps key must be of type string\")\n\t\t}\n\n\t\t// copy only string value/index value to map if,\n\t\t// map is not of type interface and is 'OptionAnswer'\n\t\tif value.Type().Name() == \"OptionAnswer\" {\n\t\t\tif kval := mapType.Elem().Kind(); kval == reflect.String {\n\t\t\t\tmt := *t.(*map[string]string)\n\t\t\t\tmt[name] = value.FieldByName(\"Value\").String()\n\t\t\t\treturn nil\n\t\t\t} else if kval == reflect.Int {\n\t\t\t\tmt := *t.(*map[string]int)\n\t\t\t\tmt[name] = int(value.FieldByName(\"Index\").Int())\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif mapType.Elem().Kind() != reflect.Interface {\n\t\t\treturn errors.New(\"answer maps must be of type map[string]interface\")\n\t\t}\n\t\tmt := *t.(*map[string]interface{})\n\t\tmt[name] = value.Interface()\n\t\treturn nil\n\t}\n\t// otherwise just copy the value to the target\n\treturn copy(elem, value)\n}\n\ntype errFieldNotMatch struct {\n\tquestionName string\n}\n\nfunc (err errFieldNotMatch) Error() string {\n\treturn fmt.Sprintf(\"could not find field matching %v\", err.questionName)\n}\n\nfunc (err errFieldNotMatch) Is(target error) bool { // implements the dynamic errors.Is interface.\n\tif target != nil {\n\t\tif name, ok := IsFieldNotMatch(target); ok {\n\t\t\t// if have a filled questionName then perform \"deeper\" comparison.\n\t\t\treturn name == \"\" || err.questionName == \"\" || name == err.questionName\n\t\t}\n\t}\n\n\treturn false\n}\n\n// IsFieldNotMatch reports whether an \"err\" is caused by a non matching field.\n// It returns the Question.Name that couldn't be matched with a destination field.\n//\n// Usage:\n//\n//\tif err := survey.Ask(qs, &v); err != nil {\n//\t\tif name, ok := core.IsFieldNotMatch(err); ok {\n//\t\t\t// name is the question name that did not match a field\n//\t\t}\n//\t}\nfunc IsFieldNotMatch(err error) (string, bool) {\n\tif err != nil {\n\t\tif v, ok := err.(errFieldNotMatch); ok {\n\t\t\treturn v.questionName, true\n\t\t}\n\t}\n\n\treturn \"\", false\n}\n\n// BUG(AlecAivazis): the current implementation might cause weird conflicts if there are\n// two fields with same name that only differ by casing.\nfunc findField(s reflect.Value, name string) (reflect.Value, reflect.StructField, error) {\n\n\tfields := flattenFields(s)\n\n\t// first look for matching tags so we can overwrite matching field names\n\tfor _, f := range fields {\n\t\t// the value of the survey tag\n\t\ttag := f.fieldType.Tag.Get(tagName)\n\t\t// if the tag matches the name we are looking for\n\t\tif tag != \"\" && tag == name {\n\t\t\t// then we found our index\n\t\t\treturn f.value, f.fieldType, nil\n\t\t}\n\t}\n\n\t// then look for matching names\n\tfor _, f := range fields {\n\t\t// if the name of the field matches what we're looking for\n\t\tif strings.EqualFold(f.fieldType.Name, name) {\n\t\t\treturn f.value, f.fieldType, nil\n\t\t}\n\t}\n\n\t// we didn't find the field\n\treturn reflect.Value{}, reflect.StructField{}, errFieldNotMatch{name}\n}\n\nfunc flattenFields(s reflect.Value) []reflectField {\n\tsType := s.Type()\n\tnumField := sType.NumField()\n\tfields := make([]reflectField, 0, numField)\n\tfor i := 0; i < numField; i++ {\n\t\tfieldType := sType.Field(i)\n\t\tfield := s.Field(i)\n\n\t\tif field.Kind() == reflect.Struct && fieldType.Anonymous {\n\t\t\t// field is a promoted structure\n\t\t\tfields = append(fields, flattenFields(field)...)\n\t\t\tcontinue\n\t\t}\n\t\tfields = append(fields, reflectField{field, fieldType})\n\t}\n\treturn fields\n}\n\n// isList returns true if the element is something we can Len()\nfunc isList(v reflect.Value) bool {\n\tswitch v.Type().Kind() {\n\tcase reflect.Array, reflect.Slice:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// Write takes a value and copies it to the target\nfunc copy(t reflect.Value, v reflect.Value) (err error) {\n\t// if something ends up panicing we need to catch it in a deferred func\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\t// if we paniced with an error\n\t\t\tif _, ok := r.(error); ok {\n\t\t\t\t// cast the result to an error object\n\t\t\t\terr = r.(error)\n\t\t\t} else if _, ok := r.(string); ok {\n\t\t\t\t// otherwise we could have paniced with a string so wrap it in an error\n\t\t\t\terr = errors.New(r.(string))\n\t\t\t}\n\t\t}\n\t}()\n\n\t// if we are copying from a string result to something else\n\tif v.Kind() == reflect.String && v.Type() != t.Type() {\n\t\tvar castVal interface{}\n\t\tvar casterr error\n\t\tvString := v.Interface().(string)\n\n\t\tswitch t.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tcastVal, casterr = strconv.ParseBool(vString)\n\t\tcase reflect.Int:\n\t\t\tcastVal, casterr = strconv.Atoi(vString)\n\t\tcase reflect.Int8:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int8(val64)\n\t\t\t}\n\t\tcase reflect.Int16:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 16)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int16(val64)\n\t\t\t}\n\t\tcase reflect.Int32:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int32(val64)\n\t\t\t}\n\t\tcase reflect.Int64:\n\t\t\tif t.Type() == reflect.TypeOf(time.Duration(0)) {\n\t\t\t\tcastVal, casterr = time.ParseDuration(vString)\n\t\t\t} else {\n\t\t\t\tcastVal, casterr = strconv.ParseInt(vString, 10, 64)\n\t\t\t}\n\t\tcase reflect.Uint:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint(val64)\n\t\t\t}\n\t\tcase reflect.Uint8:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint8(val64)\n\t\t\t}\n\t\tcase reflect.Uint16:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 16)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint16(val64)\n\t\t\t}\n\t\tcase reflect.Uint32:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint32(val64)\n\t\t\t}\n\t\tcase reflect.Uint64:\n\t\t\tcastVal, casterr = strconv.ParseUint(vString, 10, 64)\n\t\tcase reflect.Float32:\n\t\t\tvar val64 float64\n\t\t\tval64, casterr = strconv.ParseFloat(vString, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = float32(val64)\n\t\t\t}\n\t\tcase reflect.Float64:\n\t\t\tcastVal, casterr = strconv.ParseFloat(vString, 64)\n\t\tdefault:\n\t\t\t//lint:ignore ST1005 allow this error message to be capitalized\n\t\t\treturn fmt.Errorf(\"Unable to convert from string to type %s\", t.Kind())\n\t\t}\n\n\t\tif casterr != nil {\n\t\t\treturn casterr\n\t\t}\n\n\t\tt.Set(reflect.ValueOf(castVal))\n\t\treturn\n\t}\n\n\t// if we are copying from an OptionAnswer to something\n\tif v.Type().Name() == \"OptionAnswer\" {\n\t\t// copying an option answer to a string\n\t\tif t.Kind() == reflect.String {\n\t\t\t// copies the Value field of the struct\n\t\t\tt.Set(reflect.ValueOf(v.FieldByName(\"Value\").Interface()))\n\t\t\treturn\n\t\t}\n\n\t\t// copying an option answer to an int\n\t\tif t.Kind() == reflect.Int {\n\t\t\t// copies the Index field of the struct\n\t\t\tt.Set(reflect.ValueOf(v.FieldByName(\"Index\").Interface()))\n\t\t\treturn\n\t\t}\n\n\t\t// copying an OptionAnswer to an OptionAnswer\n\t\tif t.Type().Name() == \"OptionAnswer\" {\n\t\t\tt.Set(v)\n\t\t\treturn\n\t\t}\n\n\t\t// we're copying an option answer to an incorrect type\n\t\t//lint:ignore ST1005 allow this error message to be capitalized\n\t\treturn fmt.Errorf(\"Unable to convert from OptionAnswer to type %s\", t.Kind())\n\t}\n\n\t// if we are copying from one slice or array to another\n\tif isList(v) && isList(t) {\n\t\t// loop over every item in the desired value\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\t// write to the target given its kind\n\t\t\tswitch t.Kind() {\n\t\t\t// if its a slice\n\t\t\tcase reflect.Slice:\n\t\t\t\t// an object of the correct type\n\t\t\t\tobj := reflect.Indirect(reflect.New(t.Type().Elem()))\n\n\t\t\t\t// write the appropriate value to the obj and catch any errors\n\t\t\t\tif err := copy(obj, v.Index(i)); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\t// just append the value to the end\n\t\t\t\tt.Set(reflect.Append(t, obj))\n\t\t\t// otherwise it could be an array\n\t\t\tcase reflect.Array:\n\t\t\t\t// set the index to the appropriate value\n\t\t\t\tif err := copy(t.Slice(i, i+1).Index(0), v.Index(i)); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// set the value to the target\n\t\tt.Set(v)\n\t}\n\n\t// we're done\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/editor.go",
    "content": "package survey\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n\tshellquote \"github.com/kballard/go-shellquote\"\n)\n\n/*\nEditor launches an instance of the users preferred editor on a temporary file.\nThe editor to use is determined by reading the $VISUAL or $EDITOR environment\nvariables. If neither of those are present, notepad (on Windows) or vim\n(others) is used.\nThe launch of the editor is triggered by the enter key. Since the response may\nbe long, it will not be echoed as Input does, instead, it print <Received>.\nResponse type is a string.\n\n\tmessage := \"\"\n\tprompt := &survey.Editor{ Message: \"What is your commit message?\" }\n\tsurvey.AskOne(prompt, &message)\n*/\ntype Editor struct {\n\tRenderer\n\tMessage       string\n\tDefault       string\n\tHelp          string\n\tEditor        string\n\tHideDefault   bool\n\tAppendDefault bool\n\tFileName      string\n}\n\n// data available to the templates when processing\ntype EditorTemplateData struct {\n\tEditor\n\tAnswer     string\n\tShowAnswer bool\n\tShowHelp   bool\n\tConfig     *PromptConfig\n}\n\n// Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\nvar EditorQuestionTemplate = `\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }} {{color \"reset\"}}\n{{- if .ShowAnswer}}\n  {{- color \"cyan\"}}{{.Answer}}{{color \"reset\"}}{{\"\\n\"}}\n{{- else }}\n  {{- if and .Help (not .ShowHelp)}}{{color \"cyan\"}}[{{ .Config.HelpInput }} for help]{{color \"reset\"}} {{end}}\n  {{- if and .Default (not .HideDefault)}}{{color \"white\"}}({{.Default}}) {{color \"reset\"}}{{end}}\n  {{- color \"cyan\"}}[Enter to launch editor] {{color \"reset\"}}\n{{- end}}`\n\nvar (\n\tbom    = []byte{0xef, 0xbb, 0xbf}\n\teditor = \"vim\"\n)\n\nfunc init() {\n\tif runtime.GOOS == \"windows\" {\n\t\teditor = \"notepad\"\n\t}\n\tif v := os.Getenv(\"VISUAL\"); v != \"\" {\n\t\teditor = v\n\t} else if e := os.Getenv(\"EDITOR\"); e != \"\" {\n\t\teditor = e\n\t}\n}\n\nfunc (e *Editor) PromptAgain(config *PromptConfig, invalid interface{}, err error) (interface{}, error) {\n\tinitialValue := invalid.(string)\n\treturn e.prompt(initialValue, config)\n}\n\nfunc (e *Editor) Prompt(config *PromptConfig) (interface{}, error) {\n\tinitialValue := \"\"\n\tif e.Default != \"\" && e.AppendDefault {\n\t\tinitialValue = e.Default\n\t}\n\treturn e.prompt(initialValue, config)\n}\n\nfunc (e *Editor) prompt(initialValue string, config *PromptConfig) (interface{}, error) {\n\t// render the template\n\terr := e.Render(\n\t\tEditorQuestionTemplate,\n\t\tEditorTemplateData{\n\t\t\tEditor: *e,\n\t\t\tConfig: config,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// start reading runes from the standard in\n\trr := e.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\tcursor := e.NewCursor()\n\tcursor.Hide()\n\tdefer cursor.Show()\n\n\tfor {\n\t\tr, _, err := rr.ReadRune()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif r == '\\r' || r == '\\n' {\n\t\t\tbreak\n\t\t}\n\t\tif r == terminal.KeyInterrupt {\n\t\t\treturn \"\", terminal.InterruptErr\n\t\t}\n\t\tif r == terminal.KeyEndTransmission {\n\t\t\tbreak\n\t\t}\n\t\tif string(r) == config.HelpInput && e.Help != \"\" {\n\t\t\terr = e.Render(\n\t\t\t\tEditorQuestionTemplate,\n\t\t\t\tEditorTemplateData{\n\t\t\t\t\tEditor:   *e,\n\t\t\t\t\tShowHelp: true,\n\t\t\t\t\tConfig:   config,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t}\n\t\tcontinue\n\t}\n\n\t// prepare the temp file\n\tpattern := e.FileName\n\tif pattern == \"\" {\n\t\tpattern = \"survey*.txt\"\n\t}\n\tf, err := ioutil.TempFile(\"\", pattern)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer func() {\n\t\t_ = os.Remove(f.Name())\n\t}()\n\n\t// write utf8 BOM header\n\t// The reason why we do this is because notepad.exe on Windows determines the\n\t// encoding of an \"empty\" text file by the locale, for example, GBK in China,\n\t// while golang string only handles utf8 well. However, a text file with utf8\n\t// BOM header is not considered \"empty\" on Windows, and the encoding will then\n\t// be determined utf8 by notepad.exe, instead of GBK or other encodings.\n\tif _, err := f.Write(bom); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// write initial value\n\tif _, err := f.WriteString(initialValue); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// close the fd to prevent the editor unable to save file\n\tif err := f.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// check is input editor exist\n\tif e.Editor != \"\" {\n\t\teditor = e.Editor\n\t}\n\n\tstdio := e.Stdio()\n\n\targs, err := shellquote.Split(editor)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\targs = append(args, f.Name())\n\n\t// open the editor\n\tcmd := exec.Command(args[0], args[1:]...)\n\tcmd.Stdin = stdio.In\n\tcmd.Stdout = stdio.Out\n\tcmd.Stderr = stdio.Err\n\tcursor.Show()\n\tif err := cmd.Run(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// raw is a BOM-unstripped UTF8 byte slice\n\traw, err := ioutil.ReadFile(f.Name())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// strip BOM header\n\ttext := string(bytes.TrimPrefix(raw, bom))\n\n\t// check length, return default value on empty\n\tif len(text) == 0 && !e.AppendDefault {\n\t\treturn e.Default, nil\n\t}\n\n\treturn text, nil\n}\n\nfunc (e *Editor) Cleanup(config *PromptConfig, val interface{}) error {\n\treturn e.Render(\n\t\tEditorQuestionTemplate,\n\t\tEditorTemplateData{\n\t\t\tEditor:     *e,\n\t\t\tAnswer:     \"<Received>\",\n\t\t\tShowAnswer: true,\n\t\t\tConfig:     config,\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/filter.go",
    "content": "package survey\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/input.go",
    "content": "package survey\n\nimport (\n\t\"errors\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\n/*\nInput is a regular text input that prints each character the user types on the screen\nand accepts the input with the enter key. Response type is a string.\n\n\tname := \"\"\n\tprompt := &survey.Input{ Message: \"What is your name?\" }\n\tsurvey.AskOne(prompt, &name)\n*/\ntype Input struct {\n\tRenderer\n\tMessage       string\n\tDefault       string\n\tHelp          string\n\tSuggest       func(toComplete string) []string\n\tanswer        string\n\ttypedAnswer   string\n\toptions       []core.OptionAnswer\n\tselectedIndex int\n\tshowingHelp   bool\n}\n\n// data available to the templates when processing\ntype InputTemplateData struct {\n\tInput\n\tShowAnswer    bool\n\tShowHelp      bool\n\tAnswer        string\n\tPageEntries   []core.OptionAnswer\n\tSelectedIndex int\n\tConfig        *PromptConfig\n}\n\n// Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\nvar InputQuestionTemplate = `\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }} {{color \"reset\"}}\n{{- if .ShowAnswer}}\n  {{- color \"cyan\"}}{{.Answer}}{{color \"reset\"}}{{\"\\n\"}}\n{{- else if .PageEntries -}}\n  {{- .Answer}} [Use arrows to move, enter to select, type to continue]\n  {{- \"\\n\"}}\n  {{- range $ix, $choice := .PageEntries}}\n    {{- if eq $ix $.SelectedIndex }}{{color $.Config.Icons.SelectFocus.Format }}{{ $.Config.Icons.SelectFocus.Text }} {{else}}{{color \"default\"}}  {{end}}\n    {{- $choice.Value}}\n    {{- color \"reset\"}}{{\"\\n\"}}\n  {{- end}}\n{{- else }}\n  {{- if or (and .Help (not .ShowHelp)) .Suggest }}{{color \"cyan\"}}[\n    {{- if and .Help (not .ShowHelp)}}{{ print .Config.HelpInput }} for help {{- if and .Suggest}}, {{end}}{{end -}}\n    {{- if and .Suggest }}{{color \"cyan\"}}{{ print .Config.SuggestInput }} for suggestions{{end -}}\n  ]{{color \"reset\"}} {{end}}\n  {{- if .Default}}{{color \"white\"}}({{.Default}}) {{color \"reset\"}}{{end}}\n{{- end}}`\n\nfunc (i *Input) onRune(config *PromptConfig) terminal.OnRuneFn {\n\treturn terminal.OnRuneFn(func(key rune, line []rune) ([]rune, bool, error) {\n\t\tif i.options != nil && (key == terminal.KeyEnter || key == '\\n') {\n\t\t\treturn []rune(i.answer), true, nil\n\t\t} else if i.options != nil && key == terminal.KeyEscape {\n\t\t\ti.answer = i.typedAnswer\n\t\t\ti.options = nil\n\t\t} else if key == terminal.KeyArrowUp && len(i.options) > 0 {\n\t\t\tif i.selectedIndex == 0 {\n\t\t\t\ti.selectedIndex = len(i.options) - 1\n\t\t\t} else {\n\t\t\t\ti.selectedIndex--\n\t\t\t}\n\t\t\ti.answer = i.options[i.selectedIndex].Value\n\t\t} else if (key == terminal.KeyArrowDown || key == terminal.KeyTab) && len(i.options) > 0 {\n\t\t\tif i.selectedIndex == len(i.options)-1 {\n\t\t\t\ti.selectedIndex = 0\n\t\t\t} else {\n\t\t\t\ti.selectedIndex++\n\t\t\t}\n\t\t\ti.answer = i.options[i.selectedIndex].Value\n\t\t} else if key == terminal.KeyTab && i.Suggest != nil {\n\t\t\ti.answer = string(line)\n\t\t\ti.typedAnswer = i.answer\n\t\t\toptions := i.Suggest(i.answer)\n\t\t\ti.selectedIndex = 0\n\t\t\tif len(options) == 0 {\n\t\t\t\treturn line, false, nil\n\t\t\t}\n\n\t\t\ti.answer = options[0]\n\t\t\tif len(options) == 1 {\n\t\t\t\ti.typedAnswer = i.answer\n\t\t\t\ti.options = nil\n\t\t\t} else {\n\t\t\t\ti.options = core.OptionAnswerList(options)\n\t\t\t}\n\t\t} else {\n\t\t\tif i.options == nil {\n\t\t\t\treturn line, false, nil\n\t\t\t}\n\n\t\t\tif key >= terminal.KeySpace {\n\t\t\t\ti.answer += string(key)\n\t\t\t}\n\t\t\ti.typedAnswer = i.answer\n\n\t\t\ti.options = nil\n\t\t}\n\n\t\tpageSize := config.PageSize\n\t\topts, idx := paginate(pageSize, i.options, i.selectedIndex)\n\t\terr := i.Render(\n\t\t\tInputQuestionTemplate,\n\t\t\tInputTemplateData{\n\t\t\t\tInput:         *i,\n\t\t\t\tAnswer:        i.answer,\n\t\t\t\tShowHelp:      i.showingHelp,\n\t\t\t\tSelectedIndex: idx,\n\t\t\t\tPageEntries:   opts,\n\t\t\t\tConfig:        config,\n\t\t\t},\n\t\t)\n\n\t\tif err == nil {\n\t\t\terr = errReadLineAgain\n\t\t}\n\n\t\treturn []rune(i.typedAnswer), true, err\n\t})\n}\n\nvar errReadLineAgain = errors.New(\"read line again\")\n\nfunc (i *Input) Prompt(config *PromptConfig) (interface{}, error) {\n\t// render the template\n\terr := i.Render(\n\t\tInputQuestionTemplate,\n\t\tInputTemplateData{\n\t\t\tInput:    *i,\n\t\t\tConfig:   config,\n\t\t\tShowHelp: i.showingHelp,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// start reading runes from the standard in\n\trr := i.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\tcursor := i.NewCursor()\n\tif !config.ShowCursor {\n\t\tcursor.Hide()       // hide the cursor\n\t\tdefer cursor.Show() // show the cursor when we're done\n\t}\n\n\tvar line []rune\n\n\tfor {\n\t\tif i.options != nil {\n\t\t\tline = []rune{}\n\t\t}\n\n\t\tline, err = rr.ReadLineWithDefault(0, line, i.onRune(config))\n\t\tif err == errReadLineAgain {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tbreak\n\t}\n\n\ti.answer = string(line)\n\t// readline print an empty line, go up before we render the follow up\n\tcursor.Up(1)\n\n\t// if we ran into the help string\n\tif i.answer == config.HelpInput && i.Help != \"\" {\n\t\t// show the help and prompt again\n\t\ti.showingHelp = true\n\t\treturn i.Prompt(config)\n\t}\n\n\t// if the line is empty\n\tif len(i.answer) == 0 {\n\t\t// use the default value\n\t\treturn i.Default, err\n\t}\n\n\tlineStr := i.answer\n\n\ti.AppendRenderedText(lineStr)\n\n\t// we're done\n\treturn lineStr, err\n}\n\nfunc (i *Input) Cleanup(config *PromptConfig, val interface{}) error {\n\treturn i.Render(\n\t\tInputQuestionTemplate,\n\t\tInputTemplateData{\n\t\t\tInput:      *i,\n\t\t\tShowAnswer: true,\n\t\t\tConfig:     config,\n\t\t\tAnswer:     val.(string),\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/multiline.go",
    "content": "package survey\n\nimport (\n\t\"strings\"\n\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\ntype Multiline struct {\n\tRenderer\n\tMessage string\n\tDefault string\n\tHelp    string\n}\n\n// data available to the templates when processing\ntype MultilineTemplateData struct {\n\tMultiline\n\tAnswer     string\n\tShowAnswer bool\n\tShowHelp   bool\n\tConfig     *PromptConfig\n}\n\n// Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\nvar MultilineQuestionTemplate = `\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }} {{color \"reset\"}}\n{{- if .ShowAnswer}}\n  {{- \"\\n\"}}{{color \"cyan\"}}{{.Answer}}{{color \"reset\"}}\n  {{- if .Answer }}{{ \"\\n\" }}{{ end }}\n{{- else }}\n  {{- if .Default}}{{color \"white\"}}({{.Default}}) {{color \"reset\"}}{{end}}\n  {{- color \"cyan\"}}[Enter 2 empty lines to finish]{{color \"reset\"}}\n{{- end}}`\n\nfunc (i *Multiline) Prompt(config *PromptConfig) (interface{}, error) {\n\t// render the template\n\terr := i.Render(\n\t\tMultilineQuestionTemplate,\n\t\tMultilineTemplateData{\n\t\t\tMultiline: *i,\n\t\t\tConfig:    config,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// start reading runes from the standard in\n\trr := i.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\tcursor := i.NewCursor()\n\n\tmultiline := make([]string, 0)\n\n\temptyOnce := false\n\t// get the next line\n\tfor {\n\t\tvar line []rune\n\t\tline, err = rr.ReadLine(0)\n\t\tif err != nil {\n\t\t\treturn string(line), err\n\t\t}\n\n\t\tif string(line) == \"\" {\n\t\t\tif emptyOnce {\n\t\t\t\tnumLines := len(multiline) + 2\n\t\t\t\tcursor.PreviousLine(numLines)\n\t\t\t\tfor j := 0; j < numLines; j++ {\n\t\t\t\t\tterminal.EraseLine(i.Stdio().Out, terminal.ERASE_LINE_ALL)\n\t\t\t\t\tcursor.NextLine(1)\n\t\t\t\t}\n\t\t\t\tcursor.PreviousLine(numLines)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\temptyOnce = true\n\t\t} else {\n\t\t\temptyOnce = false\n\t\t}\n\t\tmultiline = append(multiline, string(line))\n\t}\n\n\tval := strings.Join(multiline, \"\\n\")\n\tval = strings.TrimSpace(val)\n\n\t// if the line is empty\n\tif len(val) == 0 {\n\t\t// use the default value\n\t\treturn i.Default, err\n\t}\n\n\ti.AppendRenderedText(val)\n\treturn val, err\n}\n\nfunc (i *Multiline) Cleanup(config *PromptConfig, val interface{}) error {\n\treturn i.Render(\n\t\tMultilineQuestionTemplate,\n\t\tMultilineTemplateData{\n\t\t\tMultiline:  *i,\n\t\t\tAnswer:     val.(string),\n\t\t\tShowAnswer: true,\n\t\t\tConfig:     config,\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/multiselect.go",
    "content": "package survey\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\n/*\nMultiSelect is a prompt that presents a list of various options to the user\nfor them to select using the arrow keys and enter. Response type is a slice of strings.\n\n\tdays := []string{}\n\tprompt := &survey.MultiSelect{\n\t\tMessage: \"What days do you prefer:\",\n\t\tOptions: []string{\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"},\n\t}\n\tsurvey.AskOne(prompt, &days)\n*/\ntype MultiSelect struct {\n\tRenderer\n\tMessage       string\n\tOptions       []string\n\tDefault       interface{}\n\tHelp          string\n\tPageSize      int\n\tVimMode       bool\n\tFilterMessage string\n\tFilter        func(filter string, value string, index int) bool\n\tDescription   func(value string, index int) string\n\tfilter        string\n\tselectedIndex int\n\tchecked       map[int]bool\n\tshowingHelp   bool\n}\n\n// data available to the templates when processing\ntype MultiSelectTemplateData struct {\n\tMultiSelect\n\tAnswer        string\n\tShowAnswer    bool\n\tChecked       map[int]bool\n\tSelectedIndex int\n\tShowHelp      bool\n\tDescription   func(value string, index int) string\n\tPageEntries   []core.OptionAnswer\n\tConfig        *PromptConfig\n\n\t// These fields are used when rendering an individual option\n\tCurrentOpt   core.OptionAnswer\n\tCurrentIndex int\n}\n\n// IterateOption sets CurrentOpt and CurrentIndex appropriately so a multiselect option can be rendered individually\nfunc (m MultiSelectTemplateData) IterateOption(ix int, opt core.OptionAnswer) interface{} {\n\tcopy := m\n\tcopy.CurrentIndex = ix\n\tcopy.CurrentOpt = opt\n\treturn copy\n}\n\nfunc (m MultiSelectTemplateData) GetDescription(opt core.OptionAnswer) string {\n\tif m.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn m.Description(opt.Value, opt.Index)\n}\n\nvar MultiSelectQuestionTemplate = `\n{{- define \"option\"}}\n    {{- if eq .SelectedIndex .CurrentIndex }}{{color .Config.Icons.SelectFocus.Format }}{{ .Config.Icons.SelectFocus.Text }}{{color \"reset\"}}{{else}} {{end}}\n    {{- if index .Checked .CurrentOpt.Index }}{{color .Config.Icons.MarkedOption.Format }} {{ .Config.Icons.MarkedOption.Text }} {{else}}{{color .Config.Icons.UnmarkedOption.Format }} {{ .Config.Icons.UnmarkedOption.Text }} {{end}}\n    {{- color \"reset\"}}\n    {{- \" \"}}{{- .CurrentOpt.Value}}{{ if ne ($.GetDescription .CurrentOpt) \"\" }} - {{color \"cyan\"}}{{ $.GetDescription .CurrentOpt }}{{color \"reset\"}}{{end}}\n{{end}}\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }}{{ .FilterMessage }}{{color \"reset\"}}\n{{- if .ShowAnswer}}{{color \"cyan\"}} {{.Answer}}{{color \"reset\"}}{{\"\\n\"}}\n{{- else }}\n\t{{- \"  \"}}{{- color \"cyan\"}}[Use arrows to move, space to select,{{- if not .Config.RemoveSelectAll }} <right> to all,{{end}}{{- if not .Config.RemoveSelectNone }} <left> to none,{{end}} type to filter{{- if and .Help (not .ShowHelp)}}, {{ .Config.HelpInput }} for more help{{end}}]{{color \"reset\"}}\n  {{- \"\\n\"}}\n  {{- range $ix, $option := .PageEntries}}\n    {{- template \"option\" $.IterateOption $ix $option}}\n  {{- end}}\n{{- end}}`\n\n// OnChange is called on every keypress.\nfunc (m *MultiSelect) OnChange(key rune, config *PromptConfig) {\n\toptions := m.filterOptions(config)\n\toldFilter := m.filter\n\n\tif key == terminal.KeyArrowUp || (m.VimMode && key == 'k') {\n\t\t// if we are at the top of the list\n\t\tif m.selectedIndex == 0 {\n\t\t\t// go to the bottom\n\t\t\tm.selectedIndex = len(options) - 1\n\t\t} else {\n\t\t\t// decrement the selected index\n\t\t\tm.selectedIndex--\n\t\t}\n\t} else if key == terminal.KeyTab || key == terminal.KeyArrowDown || (m.VimMode && key == 'j') {\n\t\t// if we are at the bottom of the list\n\t\tif m.selectedIndex == len(options)-1 {\n\t\t\t// start at the top\n\t\t\tm.selectedIndex = 0\n\t\t} else {\n\t\t\t// increment the selected index\n\t\t\tm.selectedIndex++\n\t\t}\n\t\t// if the user pressed down and there is room to move\n\t} else if key == terminal.KeySpace {\n\t\t// the option they have selected\n\t\tif m.selectedIndex < len(options) {\n\t\t\tselectedOpt := options[m.selectedIndex]\n\n\t\t\t// if we haven't seen this index before\n\t\t\tif old, ok := m.checked[selectedOpt.Index]; !ok {\n\t\t\t\t// set the value to true\n\t\t\t\tm.checked[selectedOpt.Index] = true\n\t\t\t} else {\n\t\t\t\t// otherwise just invert the current value\n\t\t\t\tm.checked[selectedOpt.Index] = !old\n\t\t\t}\n\t\t\tif !config.KeepFilter {\n\t\t\t\tm.filter = \"\"\n\t\t\t}\n\t\t}\n\t\t// only show the help message if we have one to show\n\t} else if string(key) == config.HelpInput && m.Help != \"\" {\n\t\tm.showingHelp = true\n\t} else if key == terminal.KeyEscape {\n\t\tm.VimMode = !m.VimMode\n\t} else if key == terminal.KeyDeleteWord || key == terminal.KeyDeleteLine {\n\t\tm.filter = \"\"\n\t} else if key == terminal.KeyDelete || key == terminal.KeyBackspace {\n\t\tif m.filter != \"\" {\n\t\t\truneFilter := []rune(m.filter)\n\t\t\tm.filter = string(runeFilter[0 : len(runeFilter)-1])\n\t\t}\n\t} else if key >= terminal.KeySpace {\n\t\tm.filter += string(key)\n\t\tm.VimMode = false\n\t} else if !config.RemoveSelectAll && key == terminal.KeyArrowRight {\n\t\tfor _, v := range options {\n\t\t\tm.checked[v.Index] = true\n\t\t}\n\t\tif !config.KeepFilter {\n\t\t\tm.filter = \"\"\n\t\t}\n\t} else if !config.RemoveSelectNone && key == terminal.KeyArrowLeft {\n\t\tfor _, v := range options {\n\t\t\tm.checked[v.Index] = false\n\t\t}\n\t\tif !config.KeepFilter {\n\t\t\tm.filter = \"\"\n\t\t}\n\t}\n\n\tm.FilterMessage = \"\"\n\tif m.filter != \"\" {\n\t\tm.FilterMessage = \" \" + m.filter\n\t}\n\tif oldFilter != m.filter {\n\t\t// filter changed\n\t\toptions = m.filterOptions(config)\n\t\tif len(options) > 0 && len(options) <= m.selectedIndex {\n\t\t\tm.selectedIndex = len(options) - 1\n\t\t}\n\t}\n\t// paginate the options\n\t// figure out the page size\n\tpageSize := m.PageSize\n\t// if we dont have a specific one\n\tif pageSize == 0 {\n\t\t// grab the global value\n\t\tpageSize = config.PageSize\n\t}\n\n\t// TODO if we have started filtering and were looking at the end of a list\n\t// and we have modified the filter then we should move the page back!\n\topts, idx := paginate(pageSize, options, m.selectedIndex)\n\n\ttmplData := MultiSelectTemplateData{\n\t\tMultiSelect:   *m,\n\t\tSelectedIndex: idx,\n\t\tChecked:       m.checked,\n\t\tShowHelp:      m.showingHelp,\n\t\tDescription:   m.Description,\n\t\tPageEntries:   opts,\n\t\tConfig:        config,\n\t}\n\n\t// render the options\n\t_ = m.RenderWithCursorOffset(MultiSelectQuestionTemplate, tmplData, opts, idx)\n}\n\nfunc (m *MultiSelect) filterOptions(config *PromptConfig) []core.OptionAnswer {\n\t// the filtered list\n\tanswers := []core.OptionAnswer{}\n\n\t// if there is no filter applied\n\tif m.filter == \"\" {\n\t\t// return all of the options\n\t\treturn core.OptionAnswerList(m.Options)\n\t}\n\n\t// the filter to apply\n\tfilter := m.Filter\n\tif filter == nil {\n\t\tfilter = config.Filter\n\t}\n\n\t// apply the filter to each option\n\tfor i, opt := range m.Options {\n\t\t// i the filter says to include the option\n\t\tif filter(m.filter, opt, i) {\n\t\t\tanswers = append(answers, core.OptionAnswer{\n\t\t\t\tIndex: i,\n\t\t\t\tValue: opt,\n\t\t\t})\n\t\t}\n\t}\n\n\t// we're done here\n\treturn answers\n}\n\nfunc (m *MultiSelect) Prompt(config *PromptConfig) (interface{}, error) {\n\t// compute the default state\n\tm.checked = make(map[int]bool)\n\t// if there is a default\n\tif m.Default != nil {\n\t\t// if the default is string values\n\t\tif defaultValues, ok := m.Default.([]string); ok {\n\t\t\tfor _, dflt := range defaultValues {\n\t\t\t\tfor i, opt := range m.Options {\n\t\t\t\t\t// if the option corresponds to the default\n\t\t\t\t\tif opt == dflt {\n\t\t\t\t\t\t// we found our initial value\n\t\t\t\t\t\tm.checked[i] = true\n\t\t\t\t\t\t// stop looking\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if the default value is index values\n\t\t} else if defaultIndices, ok := m.Default.([]int); ok {\n\t\t\t// go over every index we need to enable by default\n\t\t\tfor _, idx := range defaultIndices {\n\t\t\t\t// and enable it\n\t\t\t\tm.checked[idx] = true\n\t\t\t}\n\t\t}\n\t}\n\n\t// if there are no options to render\n\tif len(m.Options) == 0 {\n\t\t// we failed\n\t\treturn \"\", errors.New(\"please provide options to select from\")\n\t}\n\n\t// figure out the page size\n\tpageSize := m.PageSize\n\t// if we dont have a specific one\n\tif pageSize == 0 {\n\t\t// grab the global value\n\t\tpageSize = config.PageSize\n\t}\n\t// paginate the options\n\t// build up a list of option answers\n\topts, idx := paginate(pageSize, core.OptionAnswerList(m.Options), m.selectedIndex)\n\n\tcursor := m.NewCursor()\n\tcursor.Save()          // for proper cursor placement during selection\n\tcursor.Hide()          // hide the cursor\n\tdefer cursor.Show()    // show the cursor when we're done\n\tdefer cursor.Restore() // clear any accessibility offsetting on exit\n\n\ttmplData := MultiSelectTemplateData{\n\t\tMultiSelect:   *m,\n\t\tSelectedIndex: idx,\n\t\tDescription:   m.Description,\n\t\tChecked:       m.checked,\n\t\tPageEntries:   opts,\n\t\tConfig:        config,\n\t}\n\n\t// ask the question\n\terr := m.RenderWithCursorOffset(MultiSelectQuestionTemplate, tmplData, opts, idx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trr := m.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\t// start waiting for input\n\tfor {\n\t\tr, _, err := rr.ReadRune()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif r == '\\r' || r == '\\n' {\n\t\t\tbreak\n\t\t}\n\t\tif r == terminal.KeyInterrupt {\n\t\t\treturn \"\", terminal.InterruptErr\n\t\t}\n\t\tif r == terminal.KeyEndTransmission {\n\t\t\tbreak\n\t\t}\n\t\tm.OnChange(r, config)\n\t}\n\tm.filter = \"\"\n\tm.FilterMessage = \"\"\n\n\tanswers := []core.OptionAnswer{}\n\tfor i, option := range m.Options {\n\t\tif val, ok := m.checked[i]; ok && val {\n\t\t\tanswers = append(answers, core.OptionAnswer{Value: option, Index: i})\n\t\t}\n\t}\n\n\treturn answers, nil\n}\n\n// Cleanup removes the options section, and renders the ask like a normal question.\nfunc (m *MultiSelect) Cleanup(config *PromptConfig, val interface{}) error {\n\t// the answer to show\n\tanswer := \"\"\n\tfor _, ans := range val.([]core.OptionAnswer) {\n\t\tanswer = fmt.Sprintf(\"%s, %s\", answer, ans.Value)\n\t}\n\n\t// if we answered anything\n\tif len(answer) > 2 {\n\t\t// remove the precending commas\n\t\tanswer = answer[2:]\n\t}\n\n\t// execute the output summary template with the answer\n\treturn m.Render(\n\t\tMultiSelectQuestionTemplate,\n\t\tMultiSelectTemplateData{\n\t\t\tMultiSelect:   *m,\n\t\t\tSelectedIndex: m.selectedIndex,\n\t\t\tChecked:       m.checked,\n\t\t\tAnswer:        answer,\n\t\t\tShowAnswer:    true,\n\t\t\tDescription:   m.Description,\n\t\t\tConfig:        config,\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/password.go",
    "content": "package survey\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\n/*\nPassword is like a normal Input but the text shows up as *'s and there is no default. Response\ntype is a string.\n\n\tpassword := \"\"\n\tprompt := &survey.Password{ Message: \"Please type your password\" }\n\tsurvey.AskOne(prompt, &password)\n*/\ntype Password struct {\n\tRenderer\n\tMessage string\n\tHelp    string\n}\n\ntype PasswordTemplateData struct {\n\tPassword\n\tShowHelp bool\n\tConfig   *PromptConfig\n}\n\n// PasswordQuestionTemplate is a template with color formatting. See Documentation: https://github.com/mgutz/ansi#style-format\nvar PasswordQuestionTemplate = `\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }} {{color \"reset\"}}\n{{- if and .Help (not .ShowHelp)}}{{color \"cyan\"}}[{{ .Config.HelpInput }} for help]{{color \"reset\"}} {{end}}`\n\nfunc (p *Password) Prompt(config *PromptConfig) (interface{}, error) {\n\t// render the question template\n\tuserOut, _, err := core.RunTemplate(\n\t\tPasswordQuestionTemplate,\n\t\tPasswordTemplateData{\n\t\t\tPassword: *p,\n\t\t\tConfig:   config,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif _, err := fmt.Fprint(terminal.NewAnsiStdout(p.Stdio().Out), userOut); err != nil {\n\t\treturn \"\", err\n\t}\n\n\trr := p.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\t// no help msg?  Just return any response\n\tif p.Help == \"\" {\n\t\tline, err := rr.ReadLine(config.HideCharacter)\n\t\treturn string(line), err\n\t}\n\n\tcursor := p.NewCursor()\n\n\tvar line []rune\n\t// process answers looking for help prompt answer\n\tfor {\n\t\tline, err = rr.ReadLine(config.HideCharacter)\n\t\tif err != nil {\n\t\t\treturn string(line), err\n\t\t}\n\n\t\tif string(line) == config.HelpInput {\n\t\t\t// terminal will echo the \\n so we need to jump back up one row\n\t\t\tcursor.PreviousLine(1)\n\n\t\t\terr = p.Render(\n\t\t\t\tPasswordQuestionTemplate,\n\t\t\t\tPasswordTemplateData{\n\t\t\t\t\tPassword: *p,\n\t\t\t\t\tShowHelp: true,\n\t\t\t\t\tConfig:   config,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\tlineStr := string(line)\n\tp.AppendRenderedText(strings.Repeat(string(config.HideCharacter), len(lineStr)))\n\treturn lineStr, err\n}\n\n// Cleanup hides the string with a fixed number of characters.\nfunc (prompt *Password) Cleanup(config *PromptConfig, val interface{}) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/renderer.go",
    "content": "package survey\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n\t\"golang.org/x/term\"\n)\n\ntype Renderer struct {\n\tstdio          terminal.Stdio\n\trenderedErrors bytes.Buffer\n\trenderedText   bytes.Buffer\n}\n\ntype ErrorTemplateData struct {\n\tError error\n\tIcon  Icon\n}\n\nvar ErrorTemplate = `{{color .Icon.Format }}{{ .Icon.Text }} Sorry, your reply was invalid: {{ .Error.Error }}{{color \"reset\"}}\n`\n\nfunc (r *Renderer) WithStdio(stdio terminal.Stdio) {\n\tr.stdio = stdio\n}\n\nfunc (r *Renderer) Stdio() terminal.Stdio {\n\treturn r.stdio\n}\n\nfunc (r *Renderer) NewRuneReader() *terminal.RuneReader {\n\treturn terminal.NewRuneReader(r.stdio)\n}\n\nfunc (r *Renderer) NewCursor() *terminal.Cursor {\n\treturn &terminal.Cursor{\n\t\tIn:  r.stdio.In,\n\t\tOut: r.stdio.Out,\n\t}\n}\n\nfunc (r *Renderer) Error(config *PromptConfig, invalid error) error {\n\t// cleanup the currently rendered errors\n\tr.resetPrompt(r.countLines(r.renderedErrors))\n\tr.renderedErrors.Reset()\n\n\t// cleanup the rest of the prompt\n\tr.resetPrompt(r.countLines(r.renderedText))\n\tr.renderedText.Reset()\n\n\tuserOut, layoutOut, err := core.RunTemplate(ErrorTemplate, &ErrorTemplateData{\n\t\tError: invalid,\n\t\tIcon:  config.Icons.Error,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// send the message to the user\n\tif _, err := fmt.Fprint(terminal.NewAnsiStdout(r.stdio.Out), userOut); err != nil {\n\t\treturn err\n\t}\n\n\t// add the printed text to the rendered error buffer so we can cleanup later\n\tr.appendRenderedError(layoutOut)\n\n\treturn nil\n}\n\nfunc (r *Renderer) OffsetCursor(offset int) {\n\tcursor := r.NewCursor()\n\tfor offset > 0 {\n\t\tcursor.PreviousLine(1)\n\t\toffset--\n\t}\n}\n\nfunc (r *Renderer) Render(tmpl string, data interface{}) error {\n\t// cleanup the currently rendered text\n\tlineCount := r.countLines(r.renderedText)\n\tr.resetPrompt(lineCount)\n\tr.renderedText.Reset()\n\n\t// render the template summarizing the current state\n\tuserOut, layoutOut, err := core.RunTemplate(tmpl, data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// print the summary\n\tif _, err := fmt.Fprint(terminal.NewAnsiStdout(r.stdio.Out), userOut); err != nil {\n\t\treturn err\n\t}\n\n\t// add the printed text to the rendered text buffer so we can cleanup later\n\tr.AppendRenderedText(layoutOut)\n\n\t// nothing went wrong\n\treturn nil\n}\n\nfunc (r *Renderer) RenderWithCursorOffset(tmpl string, data IterableOpts, opts []core.OptionAnswer, idx int) error {\n\tcursor := r.NewCursor()\n\tcursor.Restore() // clear any accessibility offsetting\n\n\tif err := r.Render(tmpl, data); err != nil {\n\t\treturn err\n\t}\n\tcursor.Save()\n\n\toffset := computeCursorOffset(MultiSelectQuestionTemplate, data, opts, idx, r.termWidthSafe())\n\tr.OffsetCursor(offset)\n\n\treturn nil\n}\n\n// appendRenderedError appends text to the renderer's error buffer\n// which is used to track what has been printed. It is not exported\n// as errors should only be displayed via Error(config, error).\nfunc (r *Renderer) appendRenderedError(text string) {\n\tr.renderedErrors.WriteString(text)\n}\n\n// AppendRenderedText appends text to the renderer's text buffer\n// which is used to track of what has been printed. The buffer is used\n// to calculate how many lines to erase before updating the prompt.\nfunc (r *Renderer) AppendRenderedText(text string) {\n\tr.renderedText.WriteString(text)\n}\n\nfunc (r *Renderer) resetPrompt(lines int) {\n\t// clean out current line in case tmpl didnt end in newline\n\tcursor := r.NewCursor()\n\tcursor.HorizontalAbsolute(0)\n\tterminal.EraseLine(r.stdio.Out, terminal.ERASE_LINE_ALL)\n\t// clean up what we left behind last time\n\tfor i := 0; i < lines; i++ {\n\t\tcursor.PreviousLine(1)\n\t\tterminal.EraseLine(r.stdio.Out, terminal.ERASE_LINE_ALL)\n\t}\n}\n\nfunc (r *Renderer) termWidth() (int, error) {\n\tfd := int(r.stdio.Out.Fd())\n\ttermWidth, _, err := term.GetSize(fd)\n\treturn termWidth, err\n}\n\nfunc (r *Renderer) termWidthSafe() int {\n\tw, err := r.termWidth()\n\tif err != nil || w == 0 {\n\t\t// if we got an error due to terminal.GetSize not being supported\n\t\t// on current platform then just assume a very wide terminal\n\t\tw = 10000\n\t}\n\treturn w\n}\n\n// countLines will return the count of `\\n` with the addition of any\n// lines that have wrapped due to narrow terminal width\nfunc (r *Renderer) countLines(buf bytes.Buffer) int {\n\tw := r.termWidthSafe()\n\n\tbufBytes := buf.Bytes()\n\n\tcount := 0\n\tcurr := 0\n\tfor curr < len(bufBytes) {\n\t\tvar delim int\n\t\t// read until the next newline or the end of the string\n\t\trelDelim := bytes.IndexRune(bufBytes[curr:], '\\n')\n\t\tif relDelim != -1 {\n\t\t\tcount += 1 // new line found, add it to the count\n\t\t\tdelim = curr + relDelim\n\t\t} else {\n\t\t\tdelim = len(bufBytes) // no new line found, read rest of text\n\t\t}\n\n\t\tstr := string(bufBytes[curr:delim])\n\t\tif lineWidth := terminal.StringWidth(str); lineWidth > w {\n\t\t\t// account for word wrapping\n\t\t\tcount += lineWidth / w\n\t\t\tif (lineWidth % w) == 0 {\n\t\t\t\t// content whose width is exactly a multiplier of available width should not\n\t\t\t\t// count as having wrapped on the last line\n\t\t\t\tcount -= 1\n\t\t\t}\n\t\t}\n\t\tcurr = delim + 1\n\t}\n\n\treturn count\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/select.go",
    "content": "package survey\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\n/*\nSelect is a prompt that presents a list of various options to the user\nfor them to select using the arrow keys and enter. Response type is a string.\n\n\tcolor := \"\"\n\tprompt := &survey.Select{\n\t\tMessage: \"Choose a color:\",\n\t\tOptions: []string{\"red\", \"blue\", \"green\"},\n\t}\n\tsurvey.AskOne(prompt, &color)\n*/\ntype Select struct {\n\tRenderer\n\tMessage       string\n\tOptions       []string\n\tDefault       interface{}\n\tHelp          string\n\tPageSize      int\n\tVimMode       bool\n\tFilterMessage string\n\tFilter        func(filter string, value string, index int) bool\n\tDescription   func(value string, index int) string\n\tfilter        string\n\tselectedIndex int\n\tshowingHelp   bool\n}\n\n// SelectTemplateData is the data available to the templates when processing\ntype SelectTemplateData struct {\n\tSelect\n\tPageEntries   []core.OptionAnswer\n\tSelectedIndex int\n\tAnswer        string\n\tShowAnswer    bool\n\tShowHelp      bool\n\tDescription   func(value string, index int) string\n\tConfig        *PromptConfig\n\n\t// These fields are used when rendering an individual option\n\tCurrentOpt   core.OptionAnswer\n\tCurrentIndex int\n}\n\n// IterateOption sets CurrentOpt and CurrentIndex appropriately so a select option can be rendered individually\nfunc (s SelectTemplateData) IterateOption(ix int, opt core.OptionAnswer) interface{} {\n\tcopy := s\n\tcopy.CurrentIndex = ix\n\tcopy.CurrentOpt = opt\n\treturn copy\n}\n\nfunc (s SelectTemplateData) GetDescription(opt core.OptionAnswer) string {\n\tif s.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Description(opt.Value, opt.Index)\n}\n\nvar SelectQuestionTemplate = `\n{{- define \"option\"}}\n    {{- if eq .SelectedIndex .CurrentIndex }}{{color .Config.Icons.SelectFocus.Format }}{{ .Config.Icons.SelectFocus.Text }} {{else}}{{color \"default\"}}  {{end}}\n    {{- .CurrentOpt.Value}}{{ if ne ($.GetDescription .CurrentOpt) \"\" }} - {{color \"cyan\"}}{{ $.GetDescription .CurrentOpt }}{{end}}\n    {{- color \"reset\"}}\n{{end}}\n{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color \"reset\"}}{{\"\\n\"}}{{end}}\n{{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color \"reset\"}}\n{{- color \"default+hb\"}}{{ .Message }}{{ .FilterMessage }}{{color \"reset\"}}\n{{- if .ShowAnswer}}{{color \"cyan\"}} {{.Answer}}{{color \"reset\"}}{{\"\\n\"}}\n{{- else}}\n  {{- \"  \"}}{{- color \"cyan\"}}[Use arrows to move, type to filter{{- if and .Help (not .ShowHelp)}}, {{ .Config.HelpInput }} for more help{{end}}]{{color \"reset\"}}\n  {{- \"\\n\"}}\n  {{- range $ix, $option := .PageEntries}}\n    {{- template \"option\" $.IterateOption $ix $option}}\n  {{- end}}\n{{- end}}`\n\n// OnChange is called on every keypress.\nfunc (s *Select) OnChange(key rune, config *PromptConfig) bool {\n\toptions := s.filterOptions(config)\n\toldFilter := s.filter\n\n\t// if the user pressed the enter key and the index is a valid option\n\tif key == terminal.KeyEnter || key == '\\n' {\n\t\t// if the selected index is a valid option\n\t\tif len(options) > 0 && s.selectedIndex < len(options) {\n\n\t\t\t// we're done (stop prompting the user)\n\t\t\treturn true\n\t\t}\n\n\t\t// we're not done (keep prompting)\n\t\treturn false\n\n\t\t// if the user pressed the up arrow or 'k' to emulate vim\n\t} else if (key == terminal.KeyArrowUp || (s.VimMode && key == 'k')) && len(options) > 0 {\n\t\t// if we are at the top of the list\n\t\tif s.selectedIndex == 0 {\n\t\t\t// start from the button\n\t\t\ts.selectedIndex = len(options) - 1\n\t\t} else {\n\t\t\t// otherwise we are not at the top of the list so decrement the selected index\n\t\t\ts.selectedIndex--\n\t\t}\n\n\t\t// if the user pressed down or 'j' to emulate vim\n\t} else if (key == terminal.KeyTab || key == terminal.KeyArrowDown || (s.VimMode && key == 'j')) && len(options) > 0 {\n\t\t// if we are at the bottom of the list\n\t\tif s.selectedIndex == len(options)-1 {\n\t\t\t// start from the top\n\t\t\ts.selectedIndex = 0\n\t\t} else {\n\t\t\t// increment the selected index\n\t\t\ts.selectedIndex++\n\t\t}\n\t\t// only show the help message if we have one\n\t} else if string(key) == config.HelpInput && s.Help != \"\" {\n\t\ts.showingHelp = true\n\t\t// if the user wants to toggle vim mode on/off\n\t} else if key == terminal.KeyEscape {\n\t\ts.VimMode = !s.VimMode\n\t\t// if the user hits any of the keys that clear the filter\n\t} else if key == terminal.KeyDeleteWord || key == terminal.KeyDeleteLine {\n\t\ts.filter = \"\"\n\t\t// if the user is deleting a character in the filter\n\t} else if key == terminal.KeyDelete || key == terminal.KeyBackspace {\n\t\t// if there is content in the filter to delete\n\t\tif s.filter != \"\" {\n\t\t\truneFilter := []rune(s.filter)\n\t\t\t// subtract a line from the current filter\n\t\t\ts.filter = string(runeFilter[0 : len(runeFilter)-1])\n\t\t\t// we removed the last value in the filter\n\t\t}\n\t} else if key >= terminal.KeySpace {\n\t\ts.filter += string(key)\n\t\t// make sure vim mode is disabled\n\t\ts.VimMode = false\n\t}\n\n\ts.FilterMessage = \"\"\n\tif s.filter != \"\" {\n\t\ts.FilterMessage = \" \" + s.filter\n\t}\n\tif oldFilter != s.filter {\n\t\t// filter changed\n\t\toptions = s.filterOptions(config)\n\t\tif len(options) > 0 && len(options) <= s.selectedIndex {\n\t\t\ts.selectedIndex = len(options) - 1\n\t\t}\n\t}\n\n\t// figure out the options and index to render\n\t// figure out the page size\n\tpageSize := s.PageSize\n\t// if we dont have a specific one\n\tif pageSize == 0 {\n\t\t// grab the global value\n\t\tpageSize = config.PageSize\n\t}\n\n\t// TODO if we have started filtering and were looking at the end of a list\n\t// and we have modified the filter then we should move the page back!\n\topts, idx := paginate(pageSize, options, s.selectedIndex)\n\n\ttmplData := SelectTemplateData{\n\t\tSelect:        *s,\n\t\tSelectedIndex: idx,\n\t\tShowHelp:      s.showingHelp,\n\t\tDescription:   s.Description,\n\t\tPageEntries:   opts,\n\t\tConfig:        config,\n\t}\n\n\t// render the options\n\t_ = s.RenderWithCursorOffset(SelectQuestionTemplate, tmplData, opts, idx)\n\n\t// keep prompting\n\treturn false\n}\n\nfunc (s *Select) filterOptions(config *PromptConfig) []core.OptionAnswer {\n\t// the filtered list\n\tanswers := []core.OptionAnswer{}\n\n\t// if there is no filter applied\n\tif s.filter == \"\" {\n\t\treturn core.OptionAnswerList(s.Options)\n\t}\n\n\t// the filter to apply\n\tfilter := s.Filter\n\tif filter == nil {\n\t\tfilter = config.Filter\n\t}\n\n\tfor i, opt := range s.Options {\n\t\t// i the filter says to include the option\n\t\tif filter(s.filter, opt, i) {\n\t\t\tanswers = append(answers, core.OptionAnswer{\n\t\t\t\tIndex: i,\n\t\t\t\tValue: opt,\n\t\t\t})\n\t\t}\n\t}\n\n\t// return the list of answers\n\treturn answers\n}\n\nfunc (s *Select) Prompt(config *PromptConfig) (interface{}, error) {\n\t// if there are no options to render\n\tif len(s.Options) == 0 {\n\t\t// we failed\n\t\treturn \"\", errors.New(\"please provide options to select from\")\n\t}\n\n\ts.selectedIndex = 0\n\tif s.Default != nil {\n\t\tswitch defaultValue := s.Default.(type) {\n\t\tcase string:\n\t\t\tvar found bool\n\t\t\tfor i, opt := range s.Options {\n\t\t\t\tif opt == defaultValue {\n\t\t\t\t\ts.selectedIndex = i\n\t\t\t\t\tfound = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\treturn \"\", fmt.Errorf(\"default value %q not found in options\", defaultValue)\n\t\t\t}\n\t\tcase int:\n\t\t\tif defaultValue >= len(s.Options) {\n\t\t\t\treturn \"\", fmt.Errorf(\"default index %d exceeds the number of options\", defaultValue)\n\t\t\t}\n\t\t\ts.selectedIndex = defaultValue\n\t\tdefault:\n\t\t\treturn \"\", errors.New(\"default value of select must be an int or string\")\n\t\t}\n\t}\n\n\t// figure out the page size\n\tpageSize := s.PageSize\n\t// if we dont have a specific one\n\tif pageSize == 0 {\n\t\t// grab the global value\n\t\tpageSize = config.PageSize\n\t}\n\n\t// figure out the options and index to render\n\topts, idx := paginate(pageSize, core.OptionAnswerList(s.Options), s.selectedIndex)\n\n\tcursor := s.NewCursor()\n\tcursor.Save()          // for proper cursor placement during selection\n\tcursor.Hide()          // hide the cursor\n\tdefer cursor.Show()    // show the cursor when we're done\n\tdefer cursor.Restore() // clear any accessibility offsetting on exit\n\n\ttmplData := SelectTemplateData{\n\t\tSelect:        *s,\n\t\tSelectedIndex: idx,\n\t\tDescription:   s.Description,\n\t\tShowHelp:      s.showingHelp,\n\t\tPageEntries:   opts,\n\t\tConfig:        config,\n\t}\n\n\t// ask the question\n\terr := s.RenderWithCursorOffset(SelectQuestionTemplate, tmplData, opts, idx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trr := s.NewRuneReader()\n\t_ = rr.SetTermMode()\n\tdefer func() {\n\t\t_ = rr.RestoreTermMode()\n\t}()\n\n\t// start waiting for input\n\tfor {\n\t\tr, _, err := rr.ReadRune()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif r == terminal.KeyInterrupt {\n\t\t\treturn \"\", terminal.InterruptErr\n\t\t}\n\t\tif r == terminal.KeyEndTransmission {\n\t\t\tbreak\n\t\t}\n\t\tif s.OnChange(r, config) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\toptions := s.filterOptions(config)\n\ts.filter = \"\"\n\ts.FilterMessage = \"\"\n\n\tif s.selectedIndex < len(options) {\n\t\treturn options[s.selectedIndex], err\n\t}\n\n\treturn options[0], err\n}\n\nfunc (s *Select) Cleanup(config *PromptConfig, val interface{}) error {\n\tcursor := s.NewCursor()\n\tcursor.Restore()\n\treturn s.Render(\n\t\tSelectQuestionTemplate,\n\t\tSelectTemplateData{\n\t\t\tSelect:      *s,\n\t\t\tAnswer:      val.(core.OptionAnswer).Value,\n\t\t\tShowAnswer:  true,\n\t\t\tDescription: s.Description,\n\t\t\tConfig:      config,\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/survey.go",
    "content": "package survey\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n\t\"github.com/AlecAivazis/survey/v2/terminal\"\n)\n\n// DefaultAskOptions is the default options on ask, using the OS stdio.\nfunc defaultAskOptions() *AskOptions {\n\treturn &AskOptions{\n\t\tStdio: terminal.Stdio{\n\t\t\tIn:  os.Stdin,\n\t\t\tOut: os.Stdout,\n\t\t\tErr: os.Stderr,\n\t\t},\n\t\tPromptConfig: PromptConfig{\n\t\t\tPageSize:     7,\n\t\t\tHelpInput:    \"?\",\n\t\t\tSuggestInput: \"tab\",\n\t\t\tIcons: IconSet{\n\t\t\t\tError: Icon{\n\t\t\t\t\tText:   \"X\",\n\t\t\t\t\tFormat: \"red\",\n\t\t\t\t},\n\t\t\t\tHelp: Icon{\n\t\t\t\t\tText:   \"?\",\n\t\t\t\t\tFormat: \"cyan\",\n\t\t\t\t},\n\t\t\t\tQuestion: Icon{\n\t\t\t\t\tText:   \"?\",\n\t\t\t\t\tFormat: \"green+hb\",\n\t\t\t\t},\n\t\t\t\tMarkedOption: Icon{\n\t\t\t\t\tText:   \"[x]\",\n\t\t\t\t\tFormat: \"green\",\n\t\t\t\t},\n\t\t\t\tUnmarkedOption: Icon{\n\t\t\t\t\tText:   \"[ ]\",\n\t\t\t\t\tFormat: \"default+hb\",\n\t\t\t\t},\n\t\t\t\tSelectFocus: Icon{\n\t\t\t\t\tText:   \">\",\n\t\t\t\t\tFormat: \"cyan+b\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tFilter: func(filter string, value string, index int) (include bool) {\n\t\t\t\tfilter = strings.ToLower(filter)\n\n\t\t\t\t// include this option if it matches\n\t\t\t\treturn strings.Contains(strings.ToLower(value), filter)\n\t\t\t},\n\t\t\tKeepFilter:       false,\n\t\t\tShowCursor:       false,\n\t\t\tRemoveSelectAll:  false,\n\t\t\tRemoveSelectNone: false,\n\t\t\tHideCharacter:    '*',\n\t\t},\n\t}\n}\nfunc defaultPromptConfig() *PromptConfig {\n\treturn &defaultAskOptions().PromptConfig\n}\n\nfunc defaultIcons() *IconSet {\n\treturn &defaultPromptConfig().Icons\n}\n\n// OptionAnswer is an ergonomic alias for core.OptionAnswer\ntype OptionAnswer = core.OptionAnswer\n\n// Icon holds the text and format to show for a particular icon\ntype Icon struct {\n\tText   string\n\tFormat string\n}\n\n// IconSet holds the icons to use for various prompts\ntype IconSet struct {\n\tHelpInput      Icon\n\tError          Icon\n\tHelp           Icon\n\tQuestion       Icon\n\tMarkedOption   Icon\n\tUnmarkedOption Icon\n\tSelectFocus    Icon\n}\n\n// Validator is a function passed to a Question after a user has provided a response.\n// If the function returns an error, then the user will be prompted again for another\n// response.\ntype Validator func(ans interface{}) error\n\n// Transformer is a function passed to a Question after a user has provided a response.\n// The function can be used to implement a custom logic that will result to return\n// a different representation of the given answer.\n//\n// Look `TransformString`, `ToLower` `Title` and `ComposeTransformers` for more.\ntype Transformer func(ans interface{}) (newAns interface{})\n\n// Question is the core data structure for a survey questionnaire.\ntype Question struct {\n\tName      string\n\tPrompt    Prompt\n\tValidate  Validator\n\tTransform Transformer\n}\n\n// PromptConfig holds the global configuration for a prompt\ntype PromptConfig struct {\n\tPageSize         int\n\tIcons            IconSet\n\tHelpInput        string\n\tSuggestInput     string\n\tFilter           func(filter string, option string, index int) bool\n\tKeepFilter       bool\n\tShowCursor       bool\n\tRemoveSelectAll  bool\n\tRemoveSelectNone bool\n\tHideCharacter    rune\n}\n\n// Prompt is the primary interface for the objects that can take user input\n// and return a response.\ntype Prompt interface {\n\tPrompt(config *PromptConfig) (interface{}, error)\n\tCleanup(*PromptConfig, interface{}) error\n\tError(*PromptConfig, error) error\n}\n\n// PromptAgainer Interface for Prompts that support prompting again after invalid input\ntype PromptAgainer interface {\n\tPromptAgain(config *PromptConfig, invalid interface{}, err error) (interface{}, error)\n}\n\n// AskOpt allows setting optional ask options.\ntype AskOpt func(options *AskOptions) error\n\n// AskOptions provides additional options on ask.\ntype AskOptions struct {\n\tStdio        terminal.Stdio\n\tValidators   []Validator\n\tPromptConfig PromptConfig\n}\n\n// WithStdio specifies the standard input, output and error files survey\n// interacts with. By default, these are os.Stdin, os.Stdout, and os.Stderr.\nfunc WithStdio(in terminal.FileReader, out terminal.FileWriter, err io.Writer) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\toptions.Stdio.In = in\n\t\toptions.Stdio.Out = out\n\t\toptions.Stdio.Err = err\n\t\treturn nil\n\t}\n}\n\n// WithFilter specifies the default filter to use when asking questions.\nfunc WithFilter(filter func(filter string, value string, index int) (include bool)) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// save the filter internally\n\t\toptions.PromptConfig.Filter = filter\n\n\t\treturn nil\n\t}\n}\n\n// WithKeepFilter sets the if the filter is kept after selections\nfunc WithKeepFilter(KeepFilter bool) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// set the page size\n\t\toptions.PromptConfig.KeepFilter = KeepFilter\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n// WithRemoveSelectAll remove the select all option in Multiselect\nfunc WithRemoveSelectAll() AskOpt {\n\treturn func(options *AskOptions) error {\n\t\toptions.PromptConfig.RemoveSelectAll = true\n\t\treturn nil\n\t}\n}\n\n// WithRemoveSelectNone remove the select none/unselect all in Multiselect\nfunc WithRemoveSelectNone() AskOpt {\n\treturn func(options *AskOptions) error {\n\t\toptions.PromptConfig.RemoveSelectNone = true\n\t\treturn nil\n\t}\n}\n\n// WithValidator specifies a validator to use while prompting the user\nfunc WithValidator(v Validator) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// add the provided validator to the list\n\t\toptions.Validators = append(options.Validators, v)\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\ntype wantsStdio interface {\n\tWithStdio(terminal.Stdio)\n}\n\n// WithPageSize sets the default page size used by prompts\nfunc WithPageSize(pageSize int) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// set the page size\n\t\toptions.PromptConfig.PageSize = pageSize\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n// WithHelpInput changes the character that prompts look for to give the user helpful information.\nfunc WithHelpInput(r rune) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// set the input character\n\t\toptions.PromptConfig.HelpInput = string(r)\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n// WithIcons sets the icons that will be used when prompting the user\nfunc WithIcons(setIcons func(*IconSet)) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// update the default icons with whatever the user says\n\t\tsetIcons(&options.PromptConfig.Icons)\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n// WithShowCursor sets the show cursor behavior when prompting the user\nfunc WithShowCursor(ShowCursor bool) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// set the page size\n\t\toptions.PromptConfig.ShowCursor = ShowCursor\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n// WithHideCharacter sets the default character shown instead of the password for password inputs\nfunc WithHideCharacter(char rune) AskOpt {\n\treturn func(options *AskOptions) error {\n\t\t// set the hide character\n\t\toptions.PromptConfig.HideCharacter = char\n\n\t\t// nothing went wrong\n\t\treturn nil\n\t}\n}\n\n/*\nAskOne performs the prompt for a single prompt and asks for validation if required.\nResponse types should be something that can be casted from the response type designated\nin the documentation. For example:\n\n\tname := \"\"\n\tprompt := &survey.Input{\n\t\tMessage: \"name\",\n\t}\n\n\tsurvey.AskOne(prompt, &name)\n*/\nfunc AskOne(p Prompt, response interface{}, opts ...AskOpt) error {\n\terr := Ask([]*Question{{Prompt: p}}, response, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n/*\nAsk performs the prompt loop, asking for validation when appropriate. The response\ntype can be one of two options. If a struct is passed, the answer will be written to\nthe field whose name matches the Name field on the corresponding question. Field types\nshould be something that can be casted from the response type designated in the\ndocumentation. Note, a survey tag can also be used to identify a Otherwise, a\nmap[string]interface{} can be passed, responses will be written to the key with the\nmatching name. For example:\n\n\tqs := []*survey.Question{\n\t\t{\n\t\t\tName:     \"name\",\n\t\t\tPrompt:   &survey.Input{Message: \"What is your name?\"},\n\t\t\tValidate: survey.Required,\n\t\t\tTransform: survey.Title,\n\t\t},\n\t}\n\n\tanswers := struct{ Name string }{}\n\n\n\terr := survey.Ask(qs, &answers)\n*/\nfunc Ask(qs []*Question, response interface{}, opts ...AskOpt) error {\n\t// build up the configuration options\n\toptions := defaultAskOptions()\n\tfor _, opt := range opts {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := opt(options); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// if we weren't passed a place to record the answers\n\tif response == nil {\n\t\t// we can't go any further\n\t\treturn errors.New(\"cannot call Ask() with a nil reference to record the answers\")\n\t}\n\n\tvalidate := func(q *Question, val interface{}) error {\n\t\tif q.Validate != nil {\n\t\t\tif err := q.Validate(val); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, v := range options.Validators {\n\t\t\tif err := v(val); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\t// go over every question\n\tfor _, q := range qs {\n\t\t// If Prompt implements controllable stdio, pass in specified stdio.\n\t\tif p, ok := q.Prompt.(wantsStdio); ok {\n\t\t\tp.WithStdio(options.Stdio)\n\t\t}\n\n\t\tvar ans interface{}\n\t\tvar validationErr error\n\t\t// prompt and validation loop\n\t\tfor {\n\t\t\tif validationErr != nil {\n\t\t\t\tif err := q.Prompt.Error(&options.PromptConfig, validationErr); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar err error\n\t\t\tif promptAgainer, ok := q.Prompt.(PromptAgainer); ok && validationErr != nil {\n\t\t\t\tans, err = promptAgainer.PromptAgain(&options.PromptConfig, ans, validationErr)\n\t\t\t} else {\n\t\t\t\tans, err = q.Prompt.Prompt(&options.PromptConfig)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvalidationErr = validate(q, ans)\n\t\t\tif validationErr == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif q.Transform != nil {\n\t\t\t// check if we have a transformer available, if so\n\t\t\t// then try to acquire the new representation of the\n\t\t\t// answer, if the resulting answer is not nil.\n\t\t\tif newAns := q.Transform(ans); newAns != nil {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\n\t\t// tell the prompt to cleanup with the validated value\n\t\tif err := q.Prompt.Cleanup(&options.PromptConfig, ans); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// add it to the map\n\t\tif err := core.WriteAnswer(response, q.Name, ans); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// return the response\n\treturn nil\n}\n\n// paginate returns a single page of choices given the page size, the total list of\n// possible choices, and the current selected index in the total list.\nfunc paginate(pageSize int, choices []core.OptionAnswer, sel int) ([]core.OptionAnswer, int) {\n\tvar start, end, cursor int\n\n\tif len(choices) < pageSize {\n\t\t// if we dont have enough options to fill a page\n\t\tstart = 0\n\t\tend = len(choices)\n\t\tcursor = sel\n\n\t} else if sel < pageSize/2 {\n\t\t// if we are in the first half page\n\t\tstart = 0\n\t\tend = pageSize\n\t\tcursor = sel\n\n\t} else if len(choices)-sel-1 < pageSize/2 {\n\t\t// if we are in the last half page\n\t\tstart = len(choices) - pageSize\n\t\tend = len(choices)\n\t\tcursor = sel - start\n\n\t} else {\n\t\t// somewhere in the middle\n\t\tabove := pageSize / 2\n\t\tbelow := pageSize - above\n\n\t\tcursor = pageSize / 2\n\t\tstart = sel - above\n\t\tend = sel + below\n\t}\n\n\t// return the subset we care about and the index\n\treturn choices[start:end], cursor\n}\n\ntype IterableOpts interface {\n\tIterateOption(int, core.OptionAnswer) interface{}\n}\n\nfunc computeCursorOffset(tmpl string, data IterableOpts, opts []core.OptionAnswer, idx, tWidth int) int {\n\ttmpls, err := core.GetTemplatePair(tmpl)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tt := tmpls[0]\n\n\trenderOpt := func(ix int, opt core.OptionAnswer) string {\n\t\tvar buf bytes.Buffer\n\t\t_ = t.ExecuteTemplate(&buf, \"option\", data.IterateOption(ix, opt))\n\t\treturn buf.String()\n\t}\n\n\toffset := len(opts) - idx\n\n\tfor i, o := range opts {\n\t\tif i < idx {\n\t\t\tcontinue\n\t\t}\n\t\trenderedOpt := renderOpt(i, o)\n\t\tvalWidth := utf8.RuneCount([]byte(renderedOpt))\n\t\tif valWidth > tWidth {\n\t\t\tsplitCount := valWidth / tWidth\n\t\t\tif valWidth%tWidth == 0 {\n\t\t\t\tsplitCount -= 1\n\t\t\t}\n\t\t\toffset += splitCount\n\t\t}\n\t}\n\n\treturn offset\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/LICENSE.txt",
    "content": "Copyright (c) 2014 Takashi Kokubun\r\n\r\nMIT License\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/README.md",
    "content": "# survey/terminal\n\nThis package started as a copy of [kokuban/go-ansi](http://github.com/k0kubun/go-ansi) but has since been modified to fit survey's specific needs.\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/buffered_reader.go",
    "content": "package terminal\n\nimport (\n\t\"bytes\"\n\t\"io\"\n)\n\ntype BufferedReader struct {\n\tIn     io.Reader\n\tBuffer *bytes.Buffer\n}\n\nfunc (br *BufferedReader) Read(p []byte) (int, error) {\n\tn, err := br.Buffer.Read(p)\n\tif err != nil && err != io.EOF {\n\t\treturn n, err\n\t} else if err == nil {\n\t\treturn n, nil\n\t}\n\n\treturn br.In.Read(p[n:])\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/cursor.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage terminal\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nvar COORDINATE_SYSTEM_BEGIN Short = 1\n\nvar dsrPattern = regexp.MustCompile(`\\x1b\\[(\\d+);(\\d+)R$`)\n\ntype Cursor struct {\n\tIn  FileReader\n\tOut FileWriter\n}\n\n// Up moves the cursor n cells to up.\nfunc (c *Cursor) Up(n int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%dA\", n)\n\treturn err\n}\n\n// Down moves the cursor n cells to down.\nfunc (c *Cursor) Down(n int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%dB\", n)\n\treturn err\n}\n\n// Forward moves the cursor n cells to right.\nfunc (c *Cursor) Forward(n int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%dC\", n)\n\treturn err\n}\n\n// Back moves the cursor n cells to left.\nfunc (c *Cursor) Back(n int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%dD\", n)\n\treturn err\n}\n\n// NextLine moves cursor to beginning of the line n lines down.\nfunc (c *Cursor) NextLine(n int) error {\n\tif err := c.Down(1); err != nil {\n\t\treturn err\n\t}\n\treturn c.HorizontalAbsolute(0)\n}\n\n// PreviousLine moves cursor to beginning of the line n lines up.\nfunc (c *Cursor) PreviousLine(n int) error {\n\tif err := c.Up(1); err != nil {\n\t\treturn err\n\t}\n\treturn c.HorizontalAbsolute(0)\n}\n\n// HorizontalAbsolute moves cursor horizontally to x.\nfunc (c *Cursor) HorizontalAbsolute(x int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%dG\", x)\n\treturn err\n}\n\n// Show shows the cursor.\nfunc (c *Cursor) Show() error {\n\t_, err := fmt.Fprint(c.Out, \"\\x1b[?25h\")\n\treturn err\n}\n\n// Hide hide the cursor.\nfunc (c *Cursor) Hide() error {\n\t_, err := fmt.Fprint(c.Out, \"\\x1b[?25l\")\n\treturn err\n}\n\n// move moves the cursor to a specific x,y location.\nfunc (c *Cursor) move(x int, y int) error {\n\t_, err := fmt.Fprintf(c.Out, \"\\x1b[%d;%df\", x, y)\n\treturn err\n}\n\n// Save saves the current position\nfunc (c *Cursor) Save() error {\n\t_, err := fmt.Fprint(c.Out, \"\\x1b7\")\n\treturn err\n}\n\n// Restore restores the saved position of the cursor\nfunc (c *Cursor) Restore() error {\n\t_, err := fmt.Fprint(c.Out, \"\\x1b8\")\n\treturn err\n}\n\n// for comparability purposes between windows\n// in unix we need to print out a new line on some terminals\nfunc (c *Cursor) MoveNextLine(cur *Coord, terminalSize *Coord) error {\n\tif cur.Y == terminalSize.Y {\n\t\tif _, err := fmt.Fprintln(c.Out); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn c.NextLine(1)\n}\n\n// Location returns the current location of the cursor in the terminal\nfunc (c *Cursor) Location(buf *bytes.Buffer) (*Coord, error) {\n\t// ANSI escape sequence for DSR - Device Status Report\n\t// https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_sequences\n\tif _, err := fmt.Fprint(c.Out, \"\\x1b[6n\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// There may be input in Stdin prior to CursorLocation so make sure we don't\n\t// drop those bytes.\n\tvar loc []int\n\tvar match string\n\tfor loc == nil {\n\t\t// Reports the cursor position (CPR) to the application as (as though typed at\n\t\t// the keyboard) ESC[n;mR, where n is the row and m is the column.\n\t\treader := bufio.NewReader(c.In)\n\t\ttext, err := reader.ReadSlice(byte('R'))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tloc = dsrPattern.FindStringIndex(string(text))\n\t\tif loc == nil {\n\t\t\t// After reading slice to byte 'R', the bufio Reader may have read more\n\t\t\t// bytes into its internal buffer which will be discarded on next ReadSlice.\n\t\t\t// We create a temporary buffer to read the remaining buffered slice and\n\t\t\t// write them to output buffer.\n\t\t\tbuffered := make([]byte, reader.Buffered())\n\t\t\t_, err = io.ReadFull(reader, buffered)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// Stdin contains R that doesn't match DSR, so pass the bytes along to\n\t\t\t// output buffer.\n\t\t\tbuf.Write(text)\n\t\t\tbuf.Write(buffered)\n\t\t} else {\n\t\t\t// Write the non-matching leading bytes to output buffer.\n\t\t\tbuf.Write(text[:loc[0]])\n\n\t\t\t// Save the matching bytes to extract the row and column of the cursor.\n\t\t\tmatch = string(text[loc[0]:loc[1]])\n\t\t}\n\t}\n\n\tmatches := dsrPattern.FindStringSubmatch(string(match))\n\tif len(matches) != 3 {\n\t\treturn nil, fmt.Errorf(\"incorrect number of matches: %d\", len(matches))\n\t}\n\n\tcol, err := strconv.Atoi(matches[2])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trow, err := strconv.Atoi(matches[1])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Coord{Short(col), Short(row)}, nil\n}\n\nfunc (cur Coord) CursorIsAtLineEnd(size *Coord) bool {\n\treturn cur.X == size.X\n}\n\nfunc (cur Coord) CursorIsAtLineBegin() bool {\n\treturn cur.X == COORDINATE_SYSTEM_BEGIN\n}\n\n// Size returns the height and width of the terminal.\nfunc (c *Cursor) Size(buf *bytes.Buffer) (*Coord, error) {\n\t// the general approach here is to move the cursor to the very bottom\n\t// of the terminal, ask for the current location and then move the\n\t// cursor back where we started\n\n\t// hide the cursor (so it doesn't blink when getting the size of the terminal)\n\tc.Hide()\n\tdefer c.Show()\n\n\t// save the current location of the cursor\n\tc.Save()\n\tdefer c.Restore()\n\n\t// move the cursor to the very bottom of the terminal\n\tc.move(999, 999)\n\n\t// ask for the current location\n\tbottom, err := c.Location(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// since the bottom was calculated in the lower right corner, it\n\t// is the dimensions we are looking for\n\treturn bottom, nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/cursor_windows.go",
    "content": "package terminal\n\nimport (\n\t\"bytes\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar COORDINATE_SYSTEM_BEGIN Short = 0\n\n// shared variable to save the cursor location from CursorSave()\nvar cursorLoc Coord\n\ntype Cursor struct {\n\tIn  FileReader\n\tOut FileWriter\n}\n\nfunc (c *Cursor) Up(n int) error {\n\treturn c.cursorMove(0, n)\n}\n\nfunc (c *Cursor) Down(n int) error {\n\treturn c.cursorMove(0, -1*n)\n}\n\nfunc (c *Cursor) Forward(n int) error {\n\treturn c.cursorMove(n, 0)\n}\n\nfunc (c *Cursor) Back(n int) error {\n\treturn c.cursorMove(-1*n, 0)\n}\n\n// save the cursor location\nfunc (c *Cursor) Save() error {\n\tloc, err := c.Location(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcursorLoc = *loc\n\treturn nil\n}\n\nfunc (c *Cursor) Restore() error {\n\thandle := syscall.Handle(c.Out.Fd())\n\t// restore it to the original position\n\t_, _, err := procSetConsoleCursorPosition.Call(uintptr(handle), uintptr(*(*int32)(unsafe.Pointer(&cursorLoc))))\n\treturn normalizeError(err)\n}\n\nfunc (cur Coord) CursorIsAtLineEnd(size *Coord) bool {\n\treturn cur.X == size.X\n}\n\nfunc (cur Coord) CursorIsAtLineBegin() bool {\n\treturn cur.X == 0\n}\n\nfunc (c *Cursor) cursorMove(x int, y int) error {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\n\tvar cursor Coord\n\tcursor.X = csbi.cursorPosition.X + Short(x)\n\tcursor.Y = csbi.cursorPosition.Y + Short(y)\n\n\t_, _, err := procSetConsoleCursorPosition.Call(uintptr(handle), uintptr(*(*int32)(unsafe.Pointer(&cursor))))\n\treturn normalizeError(err)\n}\n\nfunc (c *Cursor) NextLine(n int) error {\n\tif err := c.Up(n); err != nil {\n\t\treturn err\n\t}\n\treturn c.HorizontalAbsolute(0)\n}\n\nfunc (c *Cursor) PreviousLine(n int) error {\n\tif err := c.Down(n); err != nil {\n\t\treturn err\n\t}\n\treturn c.HorizontalAbsolute(0)\n}\n\n// for comparability purposes between windows\n// in windows we don't have to print out a new line\nfunc (c *Cursor) MoveNextLine(cur *Coord, terminalSize *Coord) error {\n\treturn c.NextLine(1)\n}\n\nfunc (c *Cursor) HorizontalAbsolute(x int) error {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\n\tvar cursor Coord\n\tcursor.X = Short(x)\n\tcursor.Y = csbi.cursorPosition.Y\n\n\tif csbi.size.X < cursor.X {\n\t\tcursor.X = csbi.size.X\n\t}\n\n\t_, _, err := procSetConsoleCursorPosition.Call(uintptr(handle), uintptr(*(*int32)(unsafe.Pointer(&cursor))))\n\treturn normalizeError(err)\n}\n\nfunc (c *Cursor) Show() error {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar cci consoleCursorInfo\n\tif _, _, err := procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\tcci.visible = 1\n\n\t_, _, err := procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci)))\n\treturn normalizeError(err)\n}\n\nfunc (c *Cursor) Hide() error {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar cci consoleCursorInfo\n\tif _, _, err := procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\tcci.visible = 0\n\n\t_, _, err := procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci)))\n\treturn normalizeError(err)\n}\n\nfunc (c *Cursor) Location(buf *bytes.Buffer) (*Coord, error) {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &csbi.cursorPosition, nil\n}\n\nfunc (c *Cursor) Size(buf *bytes.Buffer) (*Coord, error) {\n\thandle := syscall.Handle(c.Out.Fd())\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn nil, err\n\t}\n\t// windows' coordinate system begins at (0, 0)\n\tcsbi.size.X--\n\tcsbi.size.Y--\n\treturn &csbi.size, nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/display.go",
    "content": "package terminal\n\ntype EraseLineMode int\n\nconst (\n\tERASE_LINE_END EraseLineMode = iota\n\tERASE_LINE_START\n\tERASE_LINE_ALL\n)\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/display_posix.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage terminal\n\nimport (\n\t\"fmt\"\n)\n\nfunc EraseLine(out FileWriter, mode EraseLineMode) error {\n\t_, err := fmt.Fprintf(out, \"\\x1b[%dK\", mode)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/display_windows.go",
    "content": "package terminal\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc EraseLine(out FileWriter, mode EraseLineMode) error {\n\thandle := syscall.Handle(out.Fd())\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\n\tvar w uint32\n\tvar x Short\n\tcursor := csbi.cursorPosition\n\tswitch mode {\n\tcase ERASE_LINE_END:\n\t\tx = csbi.size.X\n\tcase ERASE_LINE_START:\n\t\tx = 0\n\tcase ERASE_LINE_ALL:\n\t\tcursor.X = 0\n\t\tx = csbi.size.X\n\t}\n\n\t_, _, err := procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(x), uintptr(*(*int32)(unsafe.Pointer(&cursor))), uintptr(unsafe.Pointer(&w)))\n\treturn normalizeError(err)\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/error.go",
    "content": "package terminal\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\t//lint:ignore ST1012 keeping old name for backwards compatibility\n\tInterruptErr = errors.New(\"interrupt\")\n)\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/output.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage terminal\n\nimport (\n\t\"io\"\n)\n\n// NewAnsiStdout returns special stdout, which converts escape sequences to Windows API calls\n// on Windows environment.\nfunc NewAnsiStdout(out FileWriter) io.Writer {\n\treturn out\n}\n\n// NewAnsiStderr returns special stderr, which converts escape sequences to Windows API calls\n// on Windows environment.\nfunc NewAnsiStderr(out FileWriter) io.Writer {\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/output_windows.go",
    "content": "package terminal\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/mattn/go-isatty\"\n)\n\nconst (\n\tforegroundBlue      = 0x1\n\tforegroundGreen     = 0x2\n\tforegroundRed       = 0x4\n\tforegroundIntensity = 0x8\n\tforegroundMask      = (foregroundRed | foregroundBlue | foregroundGreen | foregroundIntensity)\n\tbackgroundBlue      = 0x10\n\tbackgroundGreen     = 0x20\n\tbackgroundRed       = 0x40\n\tbackgroundIntensity = 0x80\n\tbackgroundMask      = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)\n)\n\ntype Writer struct {\n\tout     FileWriter\n\thandle  syscall.Handle\n\torgAttr word\n}\n\nfunc NewAnsiStdout(out FileWriter) io.Writer {\n\tvar csbi consoleScreenBufferInfo\n\tif !isatty.IsTerminal(out.Fd()) {\n\t\treturn out\n\t}\n\thandle := syscall.Handle(out.Fd())\n\tprocGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))\n\treturn &Writer{out: out, handle: handle, orgAttr: csbi.attributes}\n}\n\nfunc NewAnsiStderr(out FileWriter) io.Writer {\n\tvar csbi consoleScreenBufferInfo\n\tif !isatty.IsTerminal(out.Fd()) {\n\t\treturn out\n\t}\n\thandle := syscall.Handle(out.Fd())\n\tprocGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))\n\treturn &Writer{out: out, handle: handle, orgAttr: csbi.attributes}\n}\n\nfunc (w *Writer) Write(data []byte) (n int, err error) {\n\tr := bytes.NewReader(data)\n\n\tfor {\n\t\tvar ch rune\n\t\tvar size int\n\t\tch, size, err = r.ReadRune()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tn += size\n\n\t\tswitch ch {\n\t\tcase '\\x1b':\n\t\t\tsize, err = w.handleEscape(r)\n\t\t\tn += size\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\tdefault:\n\t\t\t_, err = fmt.Fprint(w.out, string(ch))\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (w *Writer) handleEscape(r *bytes.Reader) (n int, err error) {\n\tbuf := make([]byte, 0, 10)\n\tbuf = append(buf, \"\\x1b\"...)\n\n\tvar ch rune\n\tvar size int\n\t// Check '[' continues after \\x1b\n\tch, size, err = r.ReadRune()\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\terr = nil\n\t\t}\n\t\tfmt.Fprint(w.out, string(buf))\n\t\treturn\n\t}\n\tn += size\n\tif ch != '[' {\n\t\tfmt.Fprint(w.out, string(buf))\n\t\treturn\n\t}\n\n\t// Parse escape code\n\tvar code rune\n\targBuf := make([]byte, 0, 10)\n\tfor {\n\t\tch, size, err = r.ReadRune()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\tfmt.Fprint(w.out, string(buf))\n\t\t\treturn\n\t\t}\n\t\tn += size\n\t\tif ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') {\n\t\t\tcode = ch\n\t\t\tbreak\n\t\t}\n\t\targBuf = append(argBuf, string(ch)...)\n\t}\n\n\terr = w.applyEscapeCode(buf, string(argBuf), code)\n\treturn\n}\n\nfunc (w *Writer) applyEscapeCode(buf []byte, arg string, code rune) error {\n\tc := &Cursor{Out: w.out}\n\n\tswitch arg + string(code) {\n\tcase \"?25h\":\n\t\treturn c.Show()\n\tcase \"?25l\":\n\t\treturn c.Hide()\n\t}\n\n\tif code >= 'A' && code <= 'G' {\n\t\tif n, err := strconv.Atoi(arg); err == nil {\n\t\t\tswitch code {\n\t\t\tcase 'A':\n\t\t\t\treturn c.Up(n)\n\t\t\tcase 'B':\n\t\t\t\treturn c.Down(n)\n\t\t\tcase 'C':\n\t\t\t\treturn c.Forward(n)\n\t\t\tcase 'D':\n\t\t\t\treturn c.Back(n)\n\t\t\tcase 'E':\n\t\t\t\treturn c.NextLine(n)\n\t\t\tcase 'F':\n\t\t\t\treturn c.PreviousLine(n)\n\t\t\tcase 'G':\n\t\t\t\treturn c.HorizontalAbsolute(n)\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch code {\n\tcase 'm':\n\t\treturn w.applySelectGraphicRendition(arg)\n\tdefault:\n\t\tbuf = append(buf, string(code)...)\n\t\t_, err := fmt.Fprint(w.out, string(buf))\n\t\treturn err\n\t}\n}\n\n// Original implementation: https://github.com/mattn/go-colorable\nfunc (w *Writer) applySelectGraphicRendition(arg string) error {\n\tif arg == \"\" {\n\t\t_, _, err := procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(w.orgAttr))\n\t\treturn normalizeError(err)\n\t}\n\n\tvar csbi consoleScreenBufferInfo\n\tif _, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))); normalizeError(err) != nil {\n\t\treturn err\n\t}\n\tattr := csbi.attributes\n\n\tfor _, param := range strings.Split(arg, \";\") {\n\t\tn, err := strconv.Atoi(param)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch {\n\t\tcase n == 0 || n == 100:\n\t\t\tattr = w.orgAttr\n\t\tcase 1 <= n && n <= 5:\n\t\t\tattr |= foregroundIntensity\n\t\tcase 30 <= n && n <= 37:\n\t\t\tattr = (attr & backgroundMask)\n\t\t\tif (n-30)&1 != 0 {\n\t\t\t\tattr |= foregroundRed\n\t\t\t}\n\t\t\tif (n-30)&2 != 0 {\n\t\t\t\tattr |= foregroundGreen\n\t\t\t}\n\t\t\tif (n-30)&4 != 0 {\n\t\t\t\tattr |= foregroundBlue\n\t\t\t}\n\t\tcase 40 <= n && n <= 47:\n\t\t\tattr = (attr & foregroundMask)\n\t\t\tif (n-40)&1 != 0 {\n\t\t\t\tattr |= backgroundRed\n\t\t\t}\n\t\t\tif (n-40)&2 != 0 {\n\t\t\t\tattr |= backgroundGreen\n\t\t\t}\n\t\t\tif (n-40)&4 != 0 {\n\t\t\t\tattr |= backgroundBlue\n\t\t\t}\n\t\tcase 90 <= n && n <= 97:\n\t\t\tattr = (attr & backgroundMask)\n\t\t\tattr |= foregroundIntensity\n\t\t\tif (n-90)&1 != 0 {\n\t\t\t\tattr |= foregroundRed\n\t\t\t}\n\t\t\tif (n-90)&2 != 0 {\n\t\t\t\tattr |= foregroundGreen\n\t\t\t}\n\t\t\tif (n-90)&4 != 0 {\n\t\t\t\tattr |= foregroundBlue\n\t\t\t}\n\t\tcase 100 <= n && n <= 107:\n\t\t\tattr = (attr & foregroundMask)\n\t\t\tattr |= backgroundIntensity\n\t\t\tif (n-100)&1 != 0 {\n\t\t\t\tattr |= backgroundRed\n\t\t\t}\n\t\t\tif (n-100)&2 != 0 {\n\t\t\t\tattr |= backgroundGreen\n\t\t\t}\n\t\t\tif (n-100)&4 != 0 {\n\t\t\t\tattr |= backgroundBlue\n\t\t\t}\n\t\t}\n\t}\n\n\t_, _, err := procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr))\n\treturn normalizeError(err)\n}\n\nfunc normalizeError(err error) error {\n\tif syserr, ok := err.(syscall.Errno); ok && syserr == 0 {\n\t\treturn nil\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader.go",
    "content": "package terminal\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n\n\t\"golang.org/x/text/width\"\n)\n\ntype RuneReader struct {\n\tstdio Stdio\n\tstate runeReaderState\n}\n\nfunc NewRuneReader(stdio Stdio) *RuneReader {\n\treturn &RuneReader{\n\t\tstdio: stdio,\n\t\tstate: newRuneReaderState(stdio.In),\n\t}\n}\n\nfunc (rr *RuneReader) printChar(char rune, mask rune) error {\n\t// if we don't need to mask the input\n\tif mask == 0 {\n\t\t// just print the character the user pressed\n\t\t_, err := fmt.Fprintf(rr.stdio.Out, \"%c\", char)\n\t\treturn err\n\t}\n\t// otherwise print the mask we were given\n\t_, err := fmt.Fprintf(rr.stdio.Out, \"%c\", mask)\n\treturn err\n}\n\ntype OnRuneFn func(rune, []rune) ([]rune, bool, error)\n\nfunc (rr *RuneReader) ReadLine(mask rune, onRunes ...OnRuneFn) ([]rune, error) {\n\treturn rr.ReadLineWithDefault(mask, []rune{}, onRunes...)\n}\n\nfunc (rr *RuneReader) ReadLineWithDefault(mask rune, d []rune, onRunes ...OnRuneFn) ([]rune, error) {\n\tline := []rune{}\n\t// we only care about horizontal displacements from the origin so start counting at 0\n\tindex := 0\n\n\tcursor := &Cursor{\n\t\tIn:  rr.stdio.In,\n\t\tOut: rr.stdio.Out,\n\t}\n\n\tonRune := func(r rune, line []rune) ([]rune, bool, error) {\n\t\treturn line, false, nil\n\t}\n\n\t// if the user pressed a key the caller was interested in capturing\n\tif len(onRunes) > 0 {\n\t\tonRune = onRunes[0]\n\t}\n\n\t// we get the terminal width and height (if resized after this point the property might become invalid)\n\tterminalSize, _ := cursor.Size(rr.Buffer())\n\t// we set the current location of the cursor once\n\tcursorCurrent, _ := cursor.Location(rr.Buffer())\n\n\tincrement := func() {\n\t\tif cursorCurrent.CursorIsAtLineEnd(terminalSize) {\n\t\t\tcursorCurrent.X = COORDINATE_SYSTEM_BEGIN\n\t\t\tcursorCurrent.Y++\n\t\t} else {\n\t\t\tcursorCurrent.X++\n\t\t}\n\t}\n\tdecrement := func() {\n\t\tif cursorCurrent.CursorIsAtLineBegin() {\n\t\t\tcursorCurrent.X = terminalSize.X\n\t\t\tcursorCurrent.Y--\n\t\t} else {\n\t\t\tcursorCurrent.X--\n\t\t}\n\t}\n\n\tif len(d) > 0 {\n\t\tindex = len(d)\n\t\tif _, err := fmt.Fprint(rr.stdio.Out, string(d)); err != nil {\n\t\t\treturn d, err\n\t\t}\n\t\tline = d\n\t\tfor range d {\n\t\t\tincrement()\n\t\t}\n\t}\n\n\tfor {\n\t\t// wait for some input\n\t\tr, _, err := rr.ReadRune()\n\t\tif err != nil {\n\t\t\treturn line, err\n\t\t}\n\n\t\tif l, stop, err := onRune(r, line); stop || err != nil {\n\t\t\treturn l, err\n\t\t}\n\n\t\t// if the user pressed enter or some other newline/termination like ctrl+d\n\t\tif r == '\\r' || r == '\\n' || r == KeyEndTransmission {\n\t\t\t// delete what's printed out on the console screen (cleanup)\n\t\t\tfor index > 0 {\n\t\t\t\tif cursorCurrent.CursorIsAtLineBegin() {\n\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t\tcursor.PreviousLine(1)\n\t\t\t\t\tcursor.Forward(int(terminalSize.X))\n\t\t\t\t} else {\n\t\t\t\t\tcursor.Back(1)\n\t\t\t\t}\n\t\t\t\tdecrement()\n\t\t\t\tindex--\n\t\t\t}\n\t\t\t// move the cursor the a new line\n\t\t\tcursor.MoveNextLine(cursorCurrent, terminalSize)\n\n\t\t\t// we're done processing the input\n\t\t\treturn line, nil\n\t\t}\n\t\t// if the user interrupts (ie with ctrl+c)\n\t\tif r == KeyInterrupt {\n\t\t\t// go to the beginning of the next line\n\t\t\tif _, err := fmt.Fprint(rr.stdio.Out, \"\\r\\n\"); err != nil {\n\t\t\t\treturn line, err\n\t\t\t}\n\n\t\t\t// we're done processing the input, and treat interrupt like an error\n\t\t\treturn line, InterruptErr\n\t\t}\n\n\t\t// allow for backspace/delete editing of inputs\n\t\tif r == KeyBackspace || r == KeyDelete {\n\t\t\t// and we're not at the beginning of the line\n\t\t\tif index > 0 && len(line) > 0 {\n\t\t\t\t// if we are at the end of the word\n\t\t\t\tif index == len(line) {\n\t\t\t\t\t// just remove the last letter from the internal representation\n\t\t\t\t\t// also count the number of cells the rune before the cursor occupied\n\t\t\t\t\tcells := runeWidth(line[len(line)-1])\n\t\t\t\t\tline = line[:len(line)-1]\n\t\t\t\t\t// go back one\n\t\t\t\t\tif cursorCurrent.X == 1 {\n\t\t\t\t\t\tcursor.PreviousLine(1)\n\t\t\t\t\t\tcursor.Forward(int(terminalSize.X))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcursor.Back(cells)\n\t\t\t\t\t}\n\n\t\t\t\t\t// clear the rest of the line\n\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t} else {\n\t\t\t\t\t// we need to remove a character from the middle of the word\n\n\t\t\t\t\tcells := runeWidth(line[index-1])\n\n\t\t\t\t\t// remove the current index from the list\n\t\t\t\t\tline = append(line[:index-1], line[index:]...)\n\n\t\t\t\t\t// save the current position of the cursor, as we have to move the cursor one back to erase the current symbol\n\t\t\t\t\t// and then move the cursor for each symbol in line[index-1:] to print it out, afterwards we want to restore\n\t\t\t\t\t// the cursor to its previous location.\n\t\t\t\t\tcursor.Save()\n\n\t\t\t\t\t// clear the rest of the line\n\t\t\t\t\tcursor.Back(cells)\n\n\t\t\t\t\t// print what comes after\n\t\t\t\t\tfor _, char := range line[index-1:] {\n\t\t\t\t\t\t//Erase symbols which are left over from older print\n\t\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t\t\t// print characters to the new line appropriately\n\t\t\t\t\t\tif err := rr.printChar(char, mask); err != nil {\n\t\t\t\t\t\t\treturn line, err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// erase what's left over from last print\n\t\t\t\t\tif cursorCurrent.Y < terminalSize.Y {\n\t\t\t\t\t\tcursor.NextLine(1)\n\t\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t\t}\n\t\t\t\t\t// restore cursor\n\t\t\t\t\tcursor.Restore()\n\t\t\t\t\tif cursorCurrent.CursorIsAtLineBegin() {\n\t\t\t\t\t\tcursor.PreviousLine(1)\n\t\t\t\t\t\tcursor.Forward(int(terminalSize.X))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcursor.Back(cells)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// decrement the index\n\t\t\t\tindex--\n\t\t\t\tdecrement()\n\t\t\t} else {\n\t\t\t\t// otherwise the user pressed backspace while at the beginning of the line\n\t\t\t\t_ = soundBell(rr.stdio.Out)\n\t\t\t}\n\n\t\t\t// we're done processing this key\n\t\t\tcontinue\n\t\t}\n\n\t\t// if the left arrow is pressed\n\t\tif r == KeyArrowLeft {\n\t\t\t// if we have space to the left\n\t\t\tif index > 0 {\n\t\t\t\t//move the cursor to the prev line if necessary\n\t\t\t\tif cursorCurrent.CursorIsAtLineBegin() {\n\t\t\t\t\tcursor.PreviousLine(1)\n\t\t\t\t\tcursor.Forward(int(terminalSize.X))\n\t\t\t\t} else {\n\t\t\t\t\tcursor.Back(runeWidth(line[index-1]))\n\t\t\t\t}\n\t\t\t\t//decrement the index\n\t\t\t\tindex--\n\t\t\t\tdecrement()\n\n\t\t\t} else {\n\t\t\t\t// otherwise we are at the beginning of where we started reading lines\n\t\t\t\t// sound the bell\n\t\t\t\t_ = soundBell(rr.stdio.Out)\n\t\t\t}\n\n\t\t\t// we're done processing this key press\n\t\t\tcontinue\n\t\t}\n\n\t\t// if the right arrow is pressed\n\t\tif r == KeyArrowRight {\n\t\t\t// if we have space to the right\n\t\t\tif index < len(line) {\n\t\t\t\t// move the cursor to the next line if necessary\n\t\t\t\tif cursorCurrent.CursorIsAtLineEnd(terminalSize) {\n\t\t\t\t\tcursor.NextLine(1)\n\t\t\t\t} else {\n\t\t\t\t\tcursor.Forward(runeWidth(line[index]))\n\t\t\t\t}\n\t\t\t\tindex++\n\t\t\t\tincrement()\n\n\t\t\t} else {\n\t\t\t\t// otherwise we are at the end of the word and can't go past\n\t\t\t\t// sound the bell\n\t\t\t\t_ = soundBell(rr.stdio.Out)\n\t\t\t}\n\n\t\t\t// we're done processing this key press\n\t\t\tcontinue\n\t\t}\n\t\t// the user pressed one of the special keys\n\t\tif r == SpecialKeyHome {\n\t\t\tfor index > 0 {\n\t\t\t\tif cursorCurrent.CursorIsAtLineBegin() {\n\t\t\t\t\tcursor.PreviousLine(1)\n\t\t\t\t\tcursor.Forward(int(terminalSize.X))\n\t\t\t\t\tcursorCurrent.Y--\n\t\t\t\t\tcursorCurrent.X = terminalSize.X\n\t\t\t\t} else {\n\t\t\t\t\tcursor.Back(runeWidth(line[index-1]))\n\t\t\t\t\tcursorCurrent.X -= Short(runeWidth(line[index-1]))\n\t\t\t\t}\n\t\t\t\tindex--\n\t\t\t}\n\t\t\tcontinue\n\t\t\t// user pressed end\n\t\t} else if r == SpecialKeyEnd {\n\t\t\tfor index != len(line) {\n\t\t\t\tif cursorCurrent.CursorIsAtLineEnd(terminalSize) {\n\t\t\t\t\tcursor.NextLine(1)\n\t\t\t\t\tcursorCurrent.Y++\n\t\t\t\t\tcursorCurrent.X = COORDINATE_SYSTEM_BEGIN\n\t\t\t\t} else {\n\t\t\t\t\tcursor.Forward(runeWidth(line[index]))\n\t\t\t\t\tcursorCurrent.X += Short(runeWidth(line[index]))\n\t\t\t\t}\n\t\t\t\tindex++\n\t\t\t}\n\t\t\tcontinue\n\t\t\t// user pressed forward delete key\n\t\t} else if r == SpecialKeyDelete {\n\t\t\t// if index at the end of the line nothing to delete\n\t\t\tif index != len(line) {\n\t\t\t\t// save the current position of the cursor, as we have to  erase the current symbol\n\t\t\t\t// and then move the cursor for each symbol in line[index:] to print it out, afterwards we want to restore\n\t\t\t\t// the cursor to its previous location.\n\t\t\t\tcursor.Save()\n\t\t\t\t// remove the symbol after the cursor\n\t\t\t\tline = append(line[:index], line[index+1:]...)\n\t\t\t\t// print the updated line\n\t\t\t\tfor _, char := range line[index:] {\n\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t\t// print out the character\n\t\t\t\t\tif err := rr.printChar(char, mask); err != nil {\n\t\t\t\t\t\treturn line, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// erase what's left on last line\n\t\t\t\tif cursorCurrent.Y < terminalSize.Y {\n\t\t\t\t\tcursor.NextLine(1)\n\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t}\n\t\t\t\t// restore cursor\n\t\t\t\tcursor.Restore()\n\t\t\t\tif len(line) == 0 || index == len(line) {\n\t\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// if the letter is another escape sequence\n\t\tif unicode.IsControl(r) || r == IgnoreKey {\n\t\t\t// ignore it\n\t\t\tcontinue\n\t\t}\n\n\t\t// the user pressed a regular key\n\n\t\t// if we are at the end of the line\n\t\tif index == len(line) {\n\t\t\t// just append the character at the end of the line\n\t\t\tline = append(line, r)\n\t\t\t// save the location of the cursor\n\t\t\tindex++\n\t\t\tincrement()\n\t\t\t// print out the character\n\t\t\tif err := rr.printChar(r, mask); err != nil {\n\t\t\t\treturn line, err\n\t\t\t}\n\t\t} else {\n\t\t\t// we are in the middle of the word so we need to insert the character the user pressed\n\t\t\tline = append(line[:index], append([]rune{r}, line[index:]...)...)\n\t\t\t// save the current position of the cursor, as we have to move the cursor back to erase the current symbol\n\t\t\t// and then move for each symbol in line[index:] to print it out, afterwards we want to restore\n\t\t\t// cursor's location to its previous one.\n\t\t\tcursor.Save()\n\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t// remove the symbol after the cursor\n\t\t\t// print the updated line\n\t\t\tfor _, char := range line[index:] {\n\t\t\t\tEraseLine(rr.stdio.Out, ERASE_LINE_END)\n\t\t\t\t// print out the character\n\t\t\t\tif err := rr.printChar(char, mask); err != nil {\n\t\t\t\t\treturn line, err\n\t\t\t\t}\n\t\t\t\tincrement()\n\t\t\t}\n\t\t\t// if we are at the last line, we want to visually insert a new line and append to it.\n\t\t\tif cursorCurrent.CursorIsAtLineEnd(terminalSize) && cursorCurrent.Y == terminalSize.Y {\n\t\t\t\t// add a new line to the terminal\n\t\t\t\tif _, err := fmt.Fprintln(rr.stdio.Out); err != nil {\n\t\t\t\t\treturn line, err\n\t\t\t\t}\n\t\t\t\t// restore the position of the cursor horizontally\n\t\t\t\tcursor.Restore()\n\t\t\t\t// restore the position of the cursor vertically\n\t\t\t\tcursor.PreviousLine(1)\n\t\t\t} else {\n\t\t\t\t// restore cursor\n\t\t\t\tcursor.Restore()\n\t\t\t}\n\t\t\t// check if cursor needs to move to next line\n\t\t\tcursorCurrent, _ = cursor.Location(rr.Buffer())\n\t\t\tif cursorCurrent.CursorIsAtLineEnd(terminalSize) {\n\t\t\t\tcursor.NextLine(1)\n\t\t\t} else {\n\t\t\t\tcursor.Forward(runeWidth(r))\n\t\t\t}\n\t\t\t// increment the index\n\t\t\tindex++\n\t\t\tincrement()\n\n\t\t}\n\t}\n}\n\n// runeWidth returns the number of columns spanned by a rune when printed to the terminal\nfunc runeWidth(r rune) int {\n\tswitch width.LookupRune(r).Kind() {\n\tcase width.EastAsianWide, width.EastAsianFullwidth:\n\t\treturn 2\n\t}\n\n\tif !unicode.IsPrint(r) {\n\t\treturn 0\n\t}\n\treturn 1\n}\n\n// isAnsiMarker returns if a rune denotes the start of an ANSI sequence\nfunc isAnsiMarker(r rune) bool {\n\treturn r == '\\x1B'\n}\n\n// isAnsiTerminator returns if a rune denotes the end of an ANSI sequence\nfunc isAnsiTerminator(r rune) bool {\n\treturn (r >= 0x40 && r <= 0x5a) || (r == 0x5e) || (r >= 0x60 && r <= 0x7e)\n}\n\n// StringWidth returns the visible width of a string when printed to the terminal\nfunc StringWidth(str string) int {\n\tw := 0\n\tansi := false\n\n\tfor _, r := range str {\n\t\t// increase width only when outside of ANSI escape sequences\n\t\tif ansi || isAnsiMarker(r) {\n\t\t\tansi = !isAnsiTerminator(r)\n\t\t} else {\n\t\t\tw += runeWidth(r)\n\t\t}\n\t}\n\treturn w\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_bsd.go",
    "content": "// copied from: https://github.com/golang/crypto/blob/master/ssh/terminal/util_bsd.go\n// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build darwin || dragonfly || freebsd || netbsd || openbsd\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage terminal\n\nimport \"syscall\"\n\nconst ioctlReadTermios = syscall.TIOCGETA\nconst ioctlWriteTermios = syscall.TIOCSETA\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_linux.go",
    "content": "// copied from https://github.com/golang/crypto/blob/master/ssh/terminal/util_linux.go\n// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n//go:build linux && !ppc64le\n// +build linux,!ppc64le\n\npackage terminal\n\n// These constants are declared here, rather than importing\n// them from the syscall package as some syscall packages, even\n// on linux, for example gccgo, do not declare them.\nconst ioctlReadTermios = 0x5401  // syscall.TCGETS\nconst ioctlWriteTermios = 0x5402 // syscall.TCSETS\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_posix.go",
    "content": "//go:build !windows\n// +build !windows\n\n// The terminal mode manipulation code is derived heavily from:\n// https://github.com/golang/crypto/blob/master/ssh/terminal/util.go:\n// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage terminal\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tnormalKeypad      = '['\n\tapplicationKeypad = 'O'\n)\n\ntype runeReaderState struct {\n\tterm   syscall.Termios\n\treader *bufio.Reader\n\tbuf    *bytes.Buffer\n}\n\nfunc newRuneReaderState(input FileReader) runeReaderState {\n\tbuf := new(bytes.Buffer)\n\treturn runeReaderState{\n\t\treader: bufio.NewReader(&BufferedReader{\n\t\t\tIn:     input,\n\t\t\tBuffer: buf,\n\t\t}),\n\t\tbuf: buf,\n\t}\n}\n\nfunc (rr *RuneReader) Buffer() *bytes.Buffer {\n\treturn rr.state.buf\n}\n\n// For reading runes we just want to disable echo.\nfunc (rr *RuneReader) SetTermMode() error {\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(rr.stdio.In.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&rr.state.term)), 0, 0, 0); err != 0 {\n\t\treturn err\n\t}\n\n\tnewState := rr.state.term\n\tnewState.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG\n\t// Because we are clearing canonical mode, we need to ensure VMIN & VTIME are\n\t// set to the values we expect. This combination puts things in standard\n\t// \"blocking read\" mode (see termios(3)).\n\tnewState.Cc[syscall.VMIN] = 1\n\tnewState.Cc[syscall.VTIME] = 0\n\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(rr.stdio.In.Fd()), ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (rr *RuneReader) RestoreTermMode() error {\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(rr.stdio.In.Fd()), ioctlWriteTermios, uintptr(unsafe.Pointer(&rr.state.term)), 0, 0, 0); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ReadRune Parse escape sequences such as ESC [ A for arrow keys.\n// See https://vt100.net/docs/vt102-ug/appendixc.html\nfunc (rr *RuneReader) ReadRune() (rune, int, error) {\n\tr, size, err := rr.state.reader.ReadRune()\n\tif err != nil {\n\t\treturn r, size, err\n\t}\n\n\tif r != KeyEscape {\n\t\treturn r, size, err\n\t}\n\n\tif rr.state.reader.Buffered() == 0 {\n\t\t// no more characters so must be `Esc` key\n\t\treturn KeyEscape, 1, nil\n\t}\n\n\tr, size, err = rr.state.reader.ReadRune()\n\tif err != nil {\n\t\treturn r, size, err\n\t}\n\n\t// ESC O ... or ESC [ ...?\n\tif r != normalKeypad && r != applicationKeypad {\n\t\treturn r, size, fmt.Errorf(\"unexpected escape sequence from terminal: %q\", []rune{KeyEscape, r})\n\t}\n\n\tkeypad := r\n\n\tr, size, err = rr.state.reader.ReadRune()\n\tif err != nil {\n\t\treturn r, size, err\n\t}\n\n\tswitch r {\n\tcase 'A': // ESC [ A or ESC O A\n\t\treturn KeyArrowUp, 1, nil\n\tcase 'B': // ESC [ B or ESC O B\n\t\treturn KeyArrowDown, 1, nil\n\tcase 'C': // ESC [ C or ESC O C\n\t\treturn KeyArrowRight, 1, nil\n\tcase 'D': // ESC [ D or ESC O D\n\t\treturn KeyArrowLeft, 1, nil\n\tcase 'F': // ESC [ F or ESC O F\n\t\treturn SpecialKeyEnd, 1, nil\n\tcase 'H': // ESC [ H or ESC O H\n\t\treturn SpecialKeyHome, 1, nil\n\tcase '3': // ESC [ 3\n\t\tif keypad == normalKeypad {\n\t\t\t// discard the following '~' key from buffer\n\t\t\t_, _ = rr.state.reader.Discard(1)\n\t\t\treturn SpecialKeyDelete, 1, nil\n\t\t}\n\t}\n\n\t// discard the following '~' key from buffer\n\t_, _ = rr.state.reader.Discard(1)\n\treturn IgnoreKey, 1, nil\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_ppc64le.go",
    "content": "//go:build ppc64le && linux\n// +build ppc64le,linux\n\npackage terminal\n\n// Used syscall numbers from https://github.com/golang/go/blob/master/src/syscall/ztypes_linux_ppc64le.go\nconst ioctlReadTermios = 0x402c7413  // syscall.TCGETS\nconst ioctlWriteTermios = 0x802c7414 // syscall.TCSETS\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_windows.go",
    "content": "package terminal\n\nimport (\n\t\"bytes\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tdll              = syscall.NewLazyDLL(\"kernel32.dll\")\n\tsetConsoleMode   = dll.NewProc(\"SetConsoleMode\")\n\tgetConsoleMode   = dll.NewProc(\"GetConsoleMode\")\n\treadConsoleInput = dll.NewProc(\"ReadConsoleInputW\")\n)\n\nconst (\n\tEVENT_KEY = 0x0001\n\n\t// key codes for arrow keys\n\t// https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n\tVK_DELETE = 0x2E\n\tVK_END    = 0x23\n\tVK_HOME   = 0x24\n\tVK_LEFT   = 0x25\n\tVK_UP     = 0x26\n\tVK_RIGHT  = 0x27\n\tVK_DOWN   = 0x28\n\n\tRIGHT_CTRL_PRESSED = 0x0004\n\tLEFT_CTRL_PRESSED  = 0x0008\n\n\tENABLE_ECHO_INPUT      uint32 = 0x0004\n\tENABLE_LINE_INPUT      uint32 = 0x0002\n\tENABLE_PROCESSED_INPUT uint32 = 0x0001\n)\n\ntype inputRecord struct {\n\teventType uint16\n\tpadding   uint16\n\tevent     [16]byte\n}\n\ntype keyEventRecord struct {\n\tbKeyDown          int32\n\twRepeatCount      uint16\n\twVirtualKeyCode   uint16\n\twVirtualScanCode  uint16\n\tunicodeChar       uint16\n\twdControlKeyState uint32\n}\n\ntype runeReaderState struct {\n\tterm uint32\n}\n\nfunc newRuneReaderState(input FileReader) runeReaderState {\n\treturn runeReaderState{}\n}\n\nfunc (rr *RuneReader) Buffer() *bytes.Buffer {\n\treturn nil\n}\n\nfunc (rr *RuneReader) SetTermMode() error {\n\tr, _, err := getConsoleMode.Call(uintptr(rr.stdio.In.Fd()), uintptr(unsafe.Pointer(&rr.state.term)))\n\t// windows return 0 on error\n\tif r == 0 {\n\t\treturn err\n\t}\n\n\tnewState := rr.state.term\n\tnewState &^= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT\n\tr, _, err = setConsoleMode.Call(uintptr(rr.stdio.In.Fd()), uintptr(newState))\n\t// windows return 0 on error\n\tif r == 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (rr *RuneReader) RestoreTermMode() error {\n\tr, _, err := setConsoleMode.Call(uintptr(rr.stdio.In.Fd()), uintptr(rr.state.term))\n\t// windows return 0 on error\n\tif r == 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (rr *RuneReader) ReadRune() (rune, int, error) {\n\tir := &inputRecord{}\n\tbytesRead := 0\n\tfor {\n\t\trv, _, e := readConsoleInput.Call(rr.stdio.In.Fd(), uintptr(unsafe.Pointer(ir)), 1, uintptr(unsafe.Pointer(&bytesRead)))\n\t\t// windows returns non-zero to indicate success\n\t\tif rv == 0 && e != nil {\n\t\t\treturn 0, 0, e\n\t\t}\n\n\t\tif ir.eventType != EVENT_KEY {\n\t\t\tcontinue\n\t\t}\n\n\t\t// the event data is really a c struct union, so here we have to do an usafe\n\t\t// cast to put the data into the keyEventRecord (since we have already verified\n\t\t// above that this event does correspond to a key event\n\t\tkey := (*keyEventRecord)(unsafe.Pointer(&ir.event[0]))\n\t\t// we only care about key down events\n\t\tif key.bKeyDown == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif key.wdControlKeyState&(LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED) != 0 && key.unicodeChar == 'C' {\n\t\t\treturn KeyInterrupt, bytesRead, nil\n\t\t}\n\t\t// not a normal character so look up the input sequence from the\n\t\t// virtual key code mappings (VK_*)\n\t\tif key.unicodeChar == 0 {\n\t\t\tswitch key.wVirtualKeyCode {\n\t\t\tcase VK_DOWN:\n\t\t\t\treturn KeyArrowDown, bytesRead, nil\n\t\t\tcase VK_LEFT:\n\t\t\t\treturn KeyArrowLeft, bytesRead, nil\n\t\t\tcase VK_RIGHT:\n\t\t\t\treturn KeyArrowRight, bytesRead, nil\n\t\t\tcase VK_UP:\n\t\t\t\treturn KeyArrowUp, bytesRead, nil\n\t\t\tcase VK_DELETE:\n\t\t\t\treturn SpecialKeyDelete, bytesRead, nil\n\t\t\tcase VK_HOME:\n\t\t\t\treturn SpecialKeyHome, bytesRead, nil\n\t\t\tcase VK_END:\n\t\t\t\treturn SpecialKeyEnd, bytesRead, nil\n\t\t\tdefault:\n\t\t\t\t// not a virtual key that we care about so just continue on to\n\t\t\t\t// the next input key\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tr := rune(key.unicodeChar)\n\t\treturn r, bytesRead, nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/sequences.go",
    "content": "package terminal\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nconst (\n\tKeyArrowLeft       = '\\x02'\n\tKeyArrowRight      = '\\x06'\n\tKeyArrowUp         = '\\x10'\n\tKeyArrowDown       = '\\x0e'\n\tKeySpace           = ' '\n\tKeyEnter           = '\\r'\n\tKeyBackspace       = '\\b'\n\tKeyDelete          = '\\x7f'\n\tKeyInterrupt       = '\\x03'\n\tKeyEndTransmission = '\\x04'\n\tKeyEscape          = '\\x1b'\n\tKeyDeleteWord      = '\\x17' // Ctrl+W\n\tKeyDeleteLine      = '\\x18' // Ctrl+X\n\tSpecialKeyHome     = '\\x01'\n\tSpecialKeyEnd      = '\\x11'\n\tSpecialKeyDelete   = '\\x12'\n\tIgnoreKey          = '\\000'\n\tKeyTab             = '\\t'\n)\n\nfunc soundBell(out io.Writer) error {\n\t_, err := fmt.Fprint(out, \"\\a\")\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/stdio.go",
    "content": "package terminal\n\nimport (\n\t\"io\"\n)\n\n// Stdio is the standard input/output the terminal reads/writes with.\ntype Stdio struct {\n\tIn  FileReader\n\tOut FileWriter\n\tErr io.Writer\n}\n\n// FileWriter provides a minimal interface for Stdin.\ntype FileWriter interface {\n\tio.Writer\n\tFd() uintptr\n}\n\n// FileReader provides a minimal interface for Stdout.\ntype FileReader interface {\n\tio.Reader\n\tFd() uintptr\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/syscall_windows.go",
    "content": "package terminal\n\nimport (\n\t\"syscall\"\n)\n\nvar (\n\tkernel32                       = syscall.NewLazyDLL(\"kernel32.dll\")\n\tprocGetConsoleScreenBufferInfo = kernel32.NewProc(\"GetConsoleScreenBufferInfo\")\n\tprocSetConsoleTextAttribute    = kernel32.NewProc(\"SetConsoleTextAttribute\")\n\tprocSetConsoleCursorPosition   = kernel32.NewProc(\"SetConsoleCursorPosition\")\n\tprocFillConsoleOutputCharacter = kernel32.NewProc(\"FillConsoleOutputCharacterW\")\n\tprocGetConsoleCursorInfo       = kernel32.NewProc(\"GetConsoleCursorInfo\")\n\tprocSetConsoleCursorInfo       = kernel32.NewProc(\"SetConsoleCursorInfo\")\n)\n\ntype wchar uint16\ntype dword uint32\ntype word uint16\n\ntype smallRect struct {\n\tleft   Short\n\ttop    Short\n\tright  Short\n\tbottom Short\n}\n\ntype consoleScreenBufferInfo struct {\n\tsize              Coord\n\tcursorPosition    Coord\n\tattributes        word\n\twindow            smallRect\n\tmaximumWindowSize Coord\n}\n\ntype consoleCursorInfo struct {\n\tsize    dword\n\tvisible int32\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/terminal/terminal.go",
    "content": "package terminal\n\ntype Short int16\n\ntype Coord struct {\n\tX Short\n\tY Short\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/transform.go",
    "content": "package survey\n\nimport (\n\t\"reflect\"\n\t\"strings\"\n\n\t\"golang.org/x/text/cases\"\n\t\"golang.org/x/text/language\"\n)\n\n// TransformString returns a `Transformer` based on the \"f\"\n// function which accepts a string representation of the answer\n// and returns a new one, transformed, answer.\n// Take for example the functions inside the std `strings` package,\n// they can be converted to a compatible `Transformer` by using this function,\n// i.e: `TransformString(strings.Title)`, `TransformString(strings.ToUpper)`.\n//\n// Note that `TransformString` is just a helper, `Transformer` can be used\n// to transform any type of answer.\nfunc TransformString(f func(s string) string) Transformer {\n\treturn func(ans interface{}) interface{} {\n\t\t// if the answer value passed in is the zero value of the appropriate type\n\t\tif isZero(reflect.ValueOf(ans)) {\n\t\t\t// skip this `Transformer` by returning a zero value of string.\n\t\t\t// The original answer will be not affected,\n\t\t\t// see survey.go#L125.\n\t\t\t// A zero value of string should be returned to be handled by\n\t\t\t// next Transformer in a composed Tranformer,\n\t\t\t// see tranform.go#L75\n\t\t\treturn \"\"\n\t\t}\n\n\t\t// \"ans\" is never nil here, so we don't have to check that\n\t\t// see survey.go#L338 for more.\n\t\t// Make sure that the the answer's value was a typeof string.\n\t\ts, ok := ans.(string)\n\t\tif !ok {\n\t\t\treturn \"\"\n\t\t}\n\n\t\treturn f(s)\n\t}\n}\n\n// ToLower is a `Transformer`.\n// It receives an answer value\n// and returns a copy of the \"ans\"\n// with all Unicode letters mapped to their lower case.\n//\n// Note that if \"ans\" is not a string then it will\n// return a nil value, meaning that the above answer\n// will not be affected by this call at all.\nfunc ToLower(ans interface{}) interface{} {\n\ttransformer := TransformString(strings.ToLower)\n\treturn transformer(ans)\n}\n\n// Title is a `Transformer`.\n// It receives an answer value\n// and returns a copy of the \"ans\"\n// with all Unicode letters that begin words\n// mapped to their title case.\n//\n// Note that if \"ans\" is not a string then it will\n// return a nil value, meaning that the above answer\n// will not be affected by this call at all.\nfunc Title(ans interface{}) interface{} {\n\ttransformer := TransformString(cases.Title(language.English).String)\n\treturn transformer(ans)\n}\n\n// ComposeTransformers is a variadic function used to create one transformer from many.\nfunc ComposeTransformers(transformers ...Transformer) Transformer {\n\t// return a transformer that calls each one sequentially\n\treturn func(ans interface{}) interface{} {\n\t\t// execute each transformer\n\t\tfor _, t := range transformers {\n\t\t\tans = t(ans)\n\t\t}\n\t\treturn ans\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/AlecAivazis/survey/v2/validate.go",
    "content": "package survey\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\n\t\"github.com/AlecAivazis/survey/v2/core\"\n)\n\n// Required does not allow an empty value\nfunc Required(val interface{}) error {\n\t// the reflect value of the result\n\tvalue := reflect.ValueOf(val)\n\n\t// if the value passed in is the zero value of the appropriate type\n\tif isZero(value) && value.Kind() != reflect.Bool {\n\t\t//lint:ignore ST1005 this error message should render as capitalized\n\t\treturn errors.New(\"Value is required\")\n\t}\n\treturn nil\n}\n\n// MaxLength requires that the string is no longer than the specified value\nfunc MaxLength(length int) Validator {\n\t// return a validator that checks the length of the string\n\treturn func(val interface{}) error {\n\t\tif str, ok := val.(string); ok {\n\t\t\t// if the string is longer than the given value\n\t\t\tif len([]rune(str)) > length {\n\t\t\t\t// yell loudly\n\t\t\t\treturn fmt.Errorf(\"value is too long. Max length is %v\", length)\n\t\t\t}\n\t\t} else {\n\t\t\t// otherwise we cannot convert the value into a string and cannot enforce length\n\t\t\treturn fmt.Errorf(\"cannot enforce length on response of type %v\", reflect.TypeOf(val).Name())\n\t\t}\n\n\t\t// the input is fine\n\t\treturn nil\n\t}\n}\n\n// MinLength requires that the string is longer or equal in length to the specified value\nfunc MinLength(length int) Validator {\n\t// return a validator that checks the length of the string\n\treturn func(val interface{}) error {\n\t\tif str, ok := val.(string); ok {\n\t\t\t// if the string is shorter than the given value\n\t\t\tif len([]rune(str)) < length {\n\t\t\t\t// yell loudly\n\t\t\t\treturn fmt.Errorf(\"value is too short. Min length is %v\", length)\n\t\t\t}\n\t\t} else {\n\t\t\t// otherwise we cannot convert the value into a string and cannot enforce length\n\t\t\treturn fmt.Errorf(\"cannot enforce length on response of type %v\", reflect.TypeOf(val).Name())\n\t\t}\n\n\t\t// the input is fine\n\t\treturn nil\n\t}\n}\n\n// MaxItems requires that the list is no longer than the specified value\nfunc MaxItems(numberItems int) Validator {\n\t// return a validator that checks the length of the list\n\treturn func(val interface{}) error {\n\t\tif list, ok := val.([]core.OptionAnswer); ok {\n\t\t\t// if the list is longer than the given value\n\t\t\tif len(list) > numberItems {\n\t\t\t\t// yell loudly\n\t\t\t\treturn fmt.Errorf(\"value is too long. Max items is %v\", numberItems)\n\t\t\t}\n\t\t} else {\n\t\t\t// otherwise we cannot convert the value into a list of answer and cannot enforce length\n\t\t\treturn fmt.Errorf(\"cannot impose the length on something other than a list of answers\")\n\t\t}\n\t\t// the input is fine\n\t\treturn nil\n\t}\n}\n\n// MinItems requires that the list is longer or equal in length to the specified value\nfunc MinItems(numberItems int) Validator {\n\t// return a validator that checks the length of the list\n\treturn func(val interface{}) error {\n\t\tif list, ok := val.([]core.OptionAnswer); ok {\n\t\t\t// if the list is shorter than the given value\n\t\t\tif len(list) < numberItems {\n\t\t\t\t// yell loudly\n\t\t\t\treturn fmt.Errorf(\"value is too short. Min items is %v\", numberItems)\n\t\t\t}\n\t\t} else {\n\t\t\t// otherwise we cannot convert the value into a list of answer and cannot enforce length\n\t\t\treturn fmt.Errorf(\"cannot impose the length on something other than a list of answers\")\n\t\t}\n\t\t// the input is fine\n\t\treturn nil\n\t}\n}\n\n// ComposeValidators is a variadic function used to create one validator from many.\nfunc ComposeValidators(validators ...Validator) Validator {\n\t// return a validator that calls each one sequentially\n\treturn func(val interface{}) error {\n\t\t// execute each validator\n\t\tfor _, validator := range validators {\n\t\t\t// if the answer's value is not valid\n\t\t\tif err := validator(val); err != nil {\n\t\t\t\t// return the error\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// we passed all validators, the answer is valid\n\t\treturn nil\n\t}\n}\n\n// isZero returns true if the passed value is the zero object\nfunc isZero(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Slice, reflect.Map:\n\t\treturn v.Len() == 0\n\t}\n\n\t// compare the types directly with more general coverage\n\treturn reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt",
    "content": "The MIT License (MIT)\n\nCopyright (c) Microsoft Corporation.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/NOTICE.txt",
    "content": "NOTICES AND INFORMATION\nDo Not Translate or Localize\n\nThis software incorporates material from third parties. Microsoft makes certain\nopen source code available at https://3rdpartysource.microsoft.com, or you may\nsend a check or money order for US $5.00, including the product name, the open\nsource component name, and version number, to:\n\nSource Code Compliance Team\nMicrosoft Corporation\nOne Microsoft Way\nRedmond, WA 98052\nUSA\n\nNotwithstanding any other terms, you may reverse engineer this software to the\nextent required to debug changes to any libraries licensed under the GNU Lesser\nGeneral Public License.\n\n------------------------------------------------------------------------------\n\nAzure SDK for Go uses third-party libraries or other resources that may be\ndistributed under licenses different than the Azure SDK for Go software.\n\nIn the event that we accidentally failed to list a required notice, please\nbring it to our attention. Post an issue or email us:\n\n           azgosdkhelp@microsoft.com\n\nThe attached notices are provided for information only.\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/CHANGELOG.md",
    "content": "# Change History\n\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/accesstokens.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// AccessTokensClient is the metadata API definition for the Azure Container Registry runtime\ntype AccessTokensClient struct {\n\tBaseClient\n}\n\n// NewAccessTokensClient creates an instance of the AccessTokensClient client.\nfunc NewAccessTokensClient(loginURI string) AccessTokensClient {\n\treturn AccessTokensClient{New(loginURI)}\n}\n\n// Get exchange ACR Refresh token for an ACR Access Token\n// Parameters:\n// service - indicates the name of your Azure container registry.\n// scope - which is expected to be a valid scope, and can be specified more than once for multiple scope\n// requests. You obtained this from the Www-Authenticate response header from the challenge.\n// refreshToken - must be a valid ACR refresh token\nfunc (client AccessTokensClient) Get(ctx context.Context, service string, scope string, refreshToken string) (result AccessToken, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AccessTokensClient.Get\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetPreparer(ctx, service, scope, refreshToken)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"Get\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"Get\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"Get\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetPreparer prepares the Get request.\nfunc (client AccessTokensClient) GetPreparer(ctx context.Context, service string, scope string, refreshToken string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tformDataParameters := map[string]interface{}{\n\t\t\"grant_type\":    \"refresh_token\",\n\t\t\"refresh_token\": refreshToken,\n\t\t\"scope\":         scope,\n\t\t\"service\":       service,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsPost(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPath(\"/oauth2/token\"),\n\t\tautorest.WithFormData(autorest.MapToValues(formDataParameters)))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetSender sends the Get request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client AccessTokensClient) GetSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetResponder handles the response to the Get request. The method always\n// closes the http.Response Body.\nfunc (client AccessTokensClient) GetResponder(resp *http.Response) (result AccessToken, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetFromLogin exchange Username, Password and Scope an ACR Access Token\n// Parameters:\n// service - indicates the name of your Azure container registry.\n// scope - expected to be a valid scope, and can be specified more than once for multiple scope requests. You\n// can obtain this from the Www-Authenticate response header from the challenge.\nfunc (client AccessTokensClient) GetFromLogin(ctx context.Context, service string, scope string) (result AccessToken, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AccessTokensClient.GetFromLogin\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetFromLoginPreparer(ctx, service, scope)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"GetFromLogin\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetFromLoginSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"GetFromLogin\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetFromLoginResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.AccessTokensClient\", \"GetFromLogin\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetFromLoginPreparer prepares the GetFromLogin request.\nfunc (client AccessTokensClient) GetFromLoginPreparer(ctx context.Context, service string, scope string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tqueryParameters := map[string]interface{}{\n\t\t\"scope\":   autorest.Encode(\"query\", scope),\n\t\t\"service\": autorest.Encode(\"query\", service),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPath(\"/oauth2/token\"),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetFromLoginSender sends the GetFromLogin request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client AccessTokensClient) GetFromLoginSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetFromLoginResponder handles the response to the GetFromLogin request. The method always\n// closes the http.Response Body.\nfunc (client AccessTokensClient) GetFromLoginResponder(resp *http.Response) (result AccessToken, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/blob.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"io\"\n\t\"net/http\"\n)\n\n// BlobClient is the metadata API definition for the Azure Container Registry runtime\ntype BlobClient struct {\n\tBaseClient\n}\n\n// NewBlobClient creates an instance of the BlobClient client.\nfunc NewBlobClient(loginURI string) BlobClient {\n\treturn BlobClient{New(loginURI)}\n}\n\n// CancelUpload cancel outstanding upload processes, releasing associated resources. If this is not called, the\n// unfinished uploads will eventually timeout.\n// Parameters:\n// location - link acquired from upload start or previous chunk. Note, do not include initial / (must do\n// substring(1) )\nfunc (client BlobClient) CancelUpload(ctx context.Context, location string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.CancelUpload\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.CancelUploadPreparer(ctx, location)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CancelUpload\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CancelUploadSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CancelUpload\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CancelUploadResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CancelUpload\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// CancelUploadPreparer prepares the CancelUpload request.\nfunc (client BlobClient) CancelUploadPreparer(ctx context.Context, location string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"nextBlobUuidLink\": location,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/{nextBlobUuidLink}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// CancelUploadSender sends the CancelUpload request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) CancelUploadSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// CancelUploadResponder handles the response to the CancelUpload request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) CancelUploadResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Check same as GET, except only the headers are returned.\n// Parameters:\n// name - name of the image (including the namespace)\n// digest - digest of a BLOB\nfunc (client BlobClient) Check(ctx context.Context, name string, digest string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.Check\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.CheckPreparer(ctx, name, digest)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Check\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CheckSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Check\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CheckResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Check\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// CheckPreparer prepares the Check request.\nfunc (client BlobClient) CheckPreparer(ctx context.Context, name string, digest string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"path\", digest),\n\t\t\"name\":   autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsHead(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/{digest}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// CheckSender sends the Check request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) CheckSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// CheckResponder handles the response to the Check request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) CheckResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusTemporaryRedirect),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// CheckChunk same as GET, except only the headers are returned.\n// Parameters:\n// name - name of the image (including the namespace)\n// digest - digest of a BLOB\n// rangeParameter - format : bytes=<start>-<end>,  HTTP Range header specifying blob chunk.\nfunc (client BlobClient) CheckChunk(ctx context.Context, name string, digest string, rangeParameter string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.CheckChunk\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.CheckChunkPreparer(ctx, name, digest, rangeParameter)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CheckChunk\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CheckChunkSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CheckChunk\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CheckChunkResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"CheckChunk\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// CheckChunkPreparer prepares the CheckChunk request.\nfunc (client BlobClient) CheckChunkPreparer(ctx context.Context, name string, digest string, rangeParameter string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"path\", digest),\n\t\t\"name\":   autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsHead(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/{digest}\", pathParameters),\n\t\tautorest.WithHeader(\"Range\", autorest.String(rangeParameter)))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// CheckChunkSender sends the CheckChunk request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) CheckChunkSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// CheckChunkResponder handles the response to the CheckChunk request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) CheckChunkResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Delete removes an already uploaded blob.\n// Parameters:\n// name - name of the image (including the namespace)\n// digest - digest of a BLOB\nfunc (client BlobClient) Delete(ctx context.Context, name string, digest string) (result ReadCloser, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.Delete\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.DeletePreparer(ctx, name, digest)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Delete\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Delete\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Delete\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// DeletePreparer prepares the Delete request.\nfunc (client BlobClient) DeletePreparer(ctx context.Context, name string, digest string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"path\", digest),\n\t\t\"name\":   autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/{digest}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// DeleteSender sends the Delete request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) DeleteSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// DeleteResponder handles the response to the Delete request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) DeleteResponder(resp *http.Response) (result ReadCloser, err error) {\n\tresult.Value = &resp.Body\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// EndUpload complete the upload, providing all the data in the body, if necessary. A request without a body will just\n// complete the upload with previously uploaded content.\n// Parameters:\n// digest - digest of a BLOB\n// location - link acquired from upload start or previous chunk. Note, do not include initial / (must do\n// substring(1) )\n// value - optional raw data of blob\nfunc (client BlobClient) EndUpload(ctx context.Context, digest string, location string, value io.ReadCloser) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.EndUpload\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.EndUploadPreparer(ctx, digest, location, value)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"EndUpload\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.EndUploadSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"EndUpload\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.EndUploadResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"EndUpload\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// EndUploadPreparer prepares the EndUpload request.\nfunc (client BlobClient) EndUploadPreparer(ctx context.Context, digest string, location string, value io.ReadCloser) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"nextBlobUuidLink\": location,\n\t}\n\n\tqueryParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"query\", digest),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/octet-stream\"),\n\t\tautorest.AsPut(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/{nextBlobUuidLink}\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\tif value != nil {\n\t\tpreparer = autorest.DecoratePreparer(preparer,\n\t\t\tautorest.WithFile(value))\n\t}\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// EndUploadSender sends the EndUpload request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) EndUploadSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// EndUploadResponder handles the response to the EndUpload request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) EndUploadResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Get retrieve the blob from the registry identified by digest.\n// Parameters:\n// name - name of the image (including the namespace)\n// digest - digest of a BLOB\nfunc (client BlobClient) Get(ctx context.Context, name string, digest string) (result ReadCloser, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.Get\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetPreparer(ctx, name, digest)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Get\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Get\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Get\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetPreparer prepares the Get request.\nfunc (client BlobClient) GetPreparer(ctx context.Context, name string, digest string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"path\", digest),\n\t\t\"name\":   autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/{digest}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetSender sends the Get request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) GetSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetResponder handles the response to the Get request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) GetResponder(resp *http.Response) (result ReadCloser, err error) {\n\tresult.Value = &resp.Body\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusTemporaryRedirect))\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetChunk retrieve the blob from the registry identified by `digest`. This endpoint may also support RFC7233\n// compliant range requests. Support can be detected by issuing a HEAD request. If the header `Accept-Range: bytes` is\n// returned, range requests can be used to fetch partial content.\n// Parameters:\n// name - name of the image (including the namespace)\n// digest - digest of a BLOB\n// rangeParameter - format : bytes=<start>-<end>,  HTTP Range header specifying blob chunk.\nfunc (client BlobClient) GetChunk(ctx context.Context, name string, digest string, rangeParameter string) (result ReadCloser, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.GetChunk\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetChunkPreparer(ctx, name, digest, rangeParameter)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetChunk\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetChunkSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetChunk\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetChunkResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetChunk\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetChunkPreparer prepares the GetChunk request.\nfunc (client BlobClient) GetChunkPreparer(ctx context.Context, name string, digest string, rangeParameter string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"digest\": autorest.Encode(\"path\", digest),\n\t\t\"name\":   autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/{digest}\", pathParameters),\n\t\tautorest.WithHeader(\"Range\", autorest.String(rangeParameter)))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetChunkSender sends the GetChunk request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) GetChunkSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetChunkResponder handles the response to the GetChunk request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) GetChunkResponder(resp *http.Response) (result ReadCloser, err error) {\n\tresult.Value = &resp.Body\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusPartialContent))\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetStatus retrieve status of upload identified by uuid. The primary purpose of this endpoint is to resolve the\n// current status of a resumable upload.\n// Parameters:\n// location - link acquired from upload start or previous chunk. Note, do not include initial / (must do\n// substring(1) )\nfunc (client BlobClient) GetStatus(ctx context.Context, location string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.GetStatus\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetStatusPreparer(ctx, location)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetStatus\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetStatusSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetStatus\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetStatusResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"GetStatus\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetStatusPreparer prepares the GetStatus request.\nfunc (client BlobClient) GetStatusPreparer(ctx context.Context, location string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"nextBlobUuidLink\": location,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/{nextBlobUuidLink}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetStatusSender sends the GetStatus request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) GetStatusSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetStatusResponder handles the response to the GetStatus request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) GetStatusResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Mount mount a blob identified by the `mount` parameter from another repository.\n// Parameters:\n// name - name of the image (including the namespace)\n// from - name of the source repository.\n// mount - digest of blob to mount from the source repository.\nfunc (client BlobClient) Mount(ctx context.Context, name string, from string, mount string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.Mount\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.MountPreparer(ctx, name, from, mount)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Mount\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.MountSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Mount\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.MountResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Mount\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// MountPreparer prepares the Mount request.\nfunc (client BlobClient) MountPreparer(ctx context.Context, name string, from string, mount string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tqueryParameters := map[string]interface{}{\n\t\t\"from\":  autorest.Encode(\"query\", from),\n\t\t\"mount\": autorest.Encode(\"query\", mount),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsPost(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/uploads/\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// MountSender sends the Mount request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) MountSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// MountResponder handles the response to the Mount request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) MountResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// StartUpload initiate a resumable blob upload with an empty request body.\n// Parameters:\n// name - name of the image (including the namespace)\nfunc (client BlobClient) StartUpload(ctx context.Context, name string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.StartUpload\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.StartUploadPreparer(ctx, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"StartUpload\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.StartUploadSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"StartUpload\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.StartUploadResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"StartUpload\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// StartUploadPreparer prepares the StartUpload request.\nfunc (client BlobClient) StartUploadPreparer(ctx context.Context, name string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsPost(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/blobs/uploads/\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// StartUploadSender sends the StartUpload request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) StartUploadSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// StartUploadResponder handles the response to the StartUpload request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) StartUploadResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Upload upload a stream of data without completing the upload.\n// Parameters:\n// value - raw data of blob\n// location - link acquired from upload start or previous chunk. Note, do not include initial / (must do\n// substring(1) )\nfunc (client BlobClient) Upload(ctx context.Context, value io.ReadCloser, location string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BlobClient.Upload\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.UploadPreparer(ctx, value, location)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Upload\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.UploadSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Upload\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.UploadResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.BlobClient\", \"Upload\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// UploadPreparer prepares the Upload request.\nfunc (client BlobClient) UploadPreparer(ctx context.Context, value io.ReadCloser, location string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"nextBlobUuidLink\": location,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/octet-stream\"),\n\t\tautorest.AsPatch(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/{nextBlobUuidLink}\", pathParameters),\n\t\tautorest.WithFile(value))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// UploadSender sends the Upload request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client BlobClient) UploadSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// UploadResponder handles the response to the Upload request. The method always\n// closes the http.Response Body.\nfunc (client BlobClient) UploadResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/client.go",
    "content": "// Package containerregistry implements the Azure ARM Containerregistry service API version 2019-08-15-preview.\n//\n// Metadata API definition for the Azure Container Registry runtime\npackage containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"github.com/Azure/go-autorest/autorest\"\n)\n\n// BaseClient is the base client for Containerregistry.\ntype BaseClient struct {\n\tautorest.Client\n\tLoginURI string\n}\n\n// New creates an instance of the BaseClient client.\nfunc New(loginURI string) BaseClient {\n\treturn NewWithoutDefaults(loginURI)\n}\n\n// NewWithoutDefaults creates an instance of the BaseClient client.\nfunc NewWithoutDefaults(loginURI string) BaseClient {\n\treturn BaseClient{\n\t\tClient:   autorest.NewClientWithUserAgent(UserAgent()),\n\t\tLoginURI: loginURI,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/dataplane_meta.json",
    "content": "{\n  \"commit\": \"3c764635e7d442b3e74caf593029fcd440b3ef82\",\n  \"readme\": \"/_/azure-rest-api-specs/specification/containerregistry/data-plane/readme.md\",\n  \"tag\": \"package-2019-08\",\n  \"use\": \"@microsoft.azure/autorest.go@2.1.183\",\n  \"repository_url\": \"https://github.com/Azure/azure-rest-api-specs.git\",\n  \"autorest_command\": \"autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2019-08 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/containerregistry/data-plane/readme.md\",\n  \"additional_properties\": {\n    \"additional_options\": \"--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION\"\n  }\n}"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/manifests.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// ManifestsClient is the metadata API definition for the Azure Container Registry runtime\ntype ManifestsClient struct {\n\tBaseClient\n}\n\n// NewManifestsClient creates an instance of the ManifestsClient client.\nfunc NewManifestsClient(loginURI string) ManifestsClient {\n\treturn ManifestsClient{New(loginURI)}\n}\n\n// Create put the manifest identified by `name` and `reference` where `reference` can be a tag or digest.\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - a tag or a digest, pointing to a specific image\n// payload - manifest body, can take v1 or v2 values depending on accept header\nfunc (client ManifestsClient) Create(ctx context.Context, name string, reference string, payload Manifest) (result SetObject, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.Create\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.CreatePreparer(ctx, name, reference, payload)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Create\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CreateSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Create\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CreateResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Create\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// CreatePreparer prepares the Create request.\nfunc (client ManifestsClient) CreatePreparer(ctx context.Context, name string, reference string, payload Manifest) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/vnd.docker.distribution.manifest.v2+json\"),\n\t\tautorest.AsPut(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/manifests/{reference}\", pathParameters),\n\t\tautorest.WithJSON(payload))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// CreateSender sends the Create request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) CreateSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// CreateResponder handles the response to the Create request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) CreateResponder(resp *http.Response) (result SetObject, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),\n\t\tautorest.ByUnmarshallingJSON(&result.Value),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// Delete delete the manifest identified by `name` and `reference`. Note that a manifest can _only_ be deleted by\n// `digest`.\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - a tag or a digest, pointing to a specific image\nfunc (client ManifestsClient) Delete(ctx context.Context, name string, reference string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.Delete\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.DeletePreparer(ctx, name, reference)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Delete\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Delete\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Delete\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// DeletePreparer prepares the Delete request.\nfunc (client ManifestsClient) DeletePreparer(ctx context.Context, name string, reference string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/manifests/{reference}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// DeleteSender sends the Delete request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) DeleteSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// DeleteResponder handles the response to the Delete request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// Get get the manifest identified by `name` and `reference` where `reference` can be a tag or digest.\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - a tag or a digest, pointing to a specific image\n// accept - accept header string delimited by comma. For example,\n// application/vnd.docker.distribution.manifest.v2+json\nfunc (client ManifestsClient) Get(ctx context.Context, name string, reference string, accept string) (result ManifestWrapper, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.Get\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetPreparer(ctx, name, reference, accept)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Get\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Get\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"Get\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetPreparer prepares the Get request.\nfunc (client ManifestsClient) GetPreparer(ctx context.Context, name string, reference string, accept string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/v2/{name}/manifests/{reference}\", pathParameters))\n\tif len(accept) > 0 {\n\t\tpreparer = autorest.DecoratePreparer(preparer,\n\t\t\tautorest.WithHeader(\"accept\", autorest.String(accept)))\n\t}\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetSender sends the Get request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) GetSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetResponder handles the response to the Get request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) GetResponder(resp *http.Response) (result ManifestWrapper, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetAttributes get manifest attributes\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - a tag or a digest, pointing to a specific image\nfunc (client ManifestsClient) GetAttributes(ctx context.Context, name string, reference string) (result ManifestAttributes, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.GetAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetAttributesPreparer(ctx, name, reference)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetAttributesPreparer prepares the GetAttributes request.\nfunc (client ManifestsClient) GetAttributesPreparer(ctx context.Context, name string, reference string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_manifests/{reference}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetAttributesSender sends the GetAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) GetAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetAttributesResponder handles the response to the GetAttributes request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) GetAttributesResponder(resp *http.Response) (result ManifestAttributes, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetList list manifests of a repository\n// Parameters:\n// name - name of the image (including the namespace)\n// last - query parameter for the last item in previous query. Result set will include values lexically after\n// last.\n// n - query parameter for max number of items\n// orderby - orderby query parameter\nfunc (client ManifestsClient) GetList(ctx context.Context, name string, last string, n *int32, orderby string) (result AcrManifests, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.GetList\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetListPreparer(ctx, name, last, n, orderby)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetList\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetListSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetList\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetListResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"GetList\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetListPreparer prepares the GetList request.\nfunc (client ManifestsClient) GetListPreparer(ctx context.Context, name string, last string, n *int32, orderby string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tqueryParameters := map[string]interface{}{}\n\tif len(last) > 0 {\n\t\tqueryParameters[\"last\"] = autorest.Encode(\"query\", last)\n\t}\n\tif n != nil {\n\t\tqueryParameters[\"n\"] = autorest.Encode(\"query\", *n)\n\t}\n\tif len(orderby) > 0 {\n\t\tqueryParameters[\"orderby\"] = autorest.Encode(\"query\", orderby)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_manifests\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetListSender sends the GetList request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) GetListSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetListResponder handles the response to the GetList request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) GetListResponder(resp *http.Response) (result AcrManifests, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// UpdateAttributes update attributes of a manifest\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - a tag or a digest, pointing to a specific image\n// value - repository attribute value\nfunc (client ManifestsClient) UpdateAttributes(ctx context.Context, name string, reference string, value *ChangeableAttributes) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ManifestsClient.UpdateAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.UpdateAttributesPreparer(ctx, name, reference, value)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"UpdateAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.UpdateAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"UpdateAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.UpdateAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.ManifestsClient\", \"UpdateAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// UpdateAttributesPreparer prepares the UpdateAttributes request.\nfunc (client ManifestsClient) UpdateAttributesPreparer(ctx context.Context, name string, reference string, value *ChangeableAttributes) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/json; charset=utf-8\"),\n\t\tautorest.AsPatch(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_manifests/{reference}\", pathParameters))\n\tif value != nil {\n\t\tpreparer = autorest.DecoratePreparer(preparer,\n\t\t\tautorest.WithJSON(value))\n\t}\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// UpdateAttributesSender sends the UpdateAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client ManifestsClient) UpdateAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// UpdateAttributesResponder handles the response to the UpdateAttributes request. The method always\n// closes the http.Response Body.\nfunc (client ManifestsClient) UpdateAttributesResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/models.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/date\"\n\t\"io\"\n)\n\n// The package's fully qualified name.\nconst fqdn = \"github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry\"\n\n// AccessToken ...\ntype AccessToken struct {\n\tautorest.Response `json:\"-\"`\n\t// AccessToken - The access token for performing authenticated requests\n\tAccessToken *string `json:\"access_token,omitempty\"`\n}\n\n// AcrErrorInfo error information\ntype AcrErrorInfo struct {\n\t// Code - Error code\n\tCode *string `json:\"code,omitempty\"`\n\t// Message - Error message\n\tMessage *string `json:\"message,omitempty\"`\n\t// Detail - Error details\n\tDetail interface{} `json:\"detail,omitempty\"`\n}\n\n// AcrErrors acr error response describing why the operation failed\ntype AcrErrors struct {\n\t// Errors - Array of detailed error\n\tErrors *[]AcrErrorInfo `json:\"errors,omitempty\"`\n}\n\n// AcrManifests manifest attributes\ntype AcrManifests struct {\n\tautorest.Response `json:\"-\"`\n\t// Registry - Registry name\n\tRegistry *string `json:\"registry,omitempty\"`\n\t// ImageName - Image name\n\tImageName *string `json:\"imageName,omitempty\"`\n\t// ManifestsAttributes - List of manifests\n\tManifestsAttributes *[]ManifestAttributesBase `json:\"manifests,omitempty\"`\n}\n\n// Annotations additional information provided through arbitrary metadata.\ntype Annotations struct {\n\t// AdditionalProperties - Unmatched properties from the message are deserialized this collection\n\tAdditionalProperties map[string]interface{} `json:\"\"`\n\t// Created - Date and time on which the image was built (string, date-time as defined by https://tools.ietf.org/html/rfc3339#section-5.6)\n\tCreated *date.Time `json:\"org.opencontainers.image.created,omitempty\"`\n\t// Authors - Contact details of the people or organization responsible for the image.\n\tAuthors *string `json:\"org.opencontainers.image.authors,omitempty\"`\n\t// URL - URL to find more information on the image.\n\tURL *string `json:\"org.opencontainers.image.url,omitempty\"`\n\t// Documentation - URL to get documentation on the image.\n\tDocumentation *string `json:\"org.opencontainers.image.documentation,omitempty\"`\n\t// Source - URL to get source code for building the image.\n\tSource *string `json:\"org.opencontainers.image.source,omitempty\"`\n\t// Version - Version of the packaged software. The version MAY match a label or tag in the source code repository, may also be Semantic versioning-compatible\n\tVersion *string `json:\"org.opencontainers.image.version,omitempty\"`\n\t// Revision - Source control revision identifier for the packaged software.\n\tRevision *string `json:\"org.opencontainers.image.revision,omitempty\"`\n\t// Vendor - Name of the distributing entity, organization or individual.\n\tVendor *string `json:\"org.opencontainers.image.vendor,omitempty\"`\n\t// Licenses - License(s) under which contained software is distributed as an SPDX License Expression.\n\tLicenses *string `json:\"org.opencontainers.image.licenses,omitempty\"`\n\t// Name - Name of the reference for a target.\n\tName *string `json:\"org.opencontainers.image.ref.name,omitempty\"`\n\t// Title - Human-readable title of the image\n\tTitle *string `json:\"org.opencontainers.image.title,omitempty\"`\n\t// Description - Human-readable description of the software packaged in the image\n\tDescription *string `json:\"org.opencontainers.image.description,omitempty\"`\n}\n\n// MarshalJSON is the custom marshaler for Annotations.\nfunc (a Annotations) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tif a.Created != nil {\n\t\tobjectMap[\"org.opencontainers.image.created\"] = a.Created\n\t}\n\tif a.Authors != nil {\n\t\tobjectMap[\"org.opencontainers.image.authors\"] = a.Authors\n\t}\n\tif a.URL != nil {\n\t\tobjectMap[\"org.opencontainers.image.url\"] = a.URL\n\t}\n\tif a.Documentation != nil {\n\t\tobjectMap[\"org.opencontainers.image.documentation\"] = a.Documentation\n\t}\n\tif a.Source != nil {\n\t\tobjectMap[\"org.opencontainers.image.source\"] = a.Source\n\t}\n\tif a.Version != nil {\n\t\tobjectMap[\"org.opencontainers.image.version\"] = a.Version\n\t}\n\tif a.Revision != nil {\n\t\tobjectMap[\"org.opencontainers.image.revision\"] = a.Revision\n\t}\n\tif a.Vendor != nil {\n\t\tobjectMap[\"org.opencontainers.image.vendor\"] = a.Vendor\n\t}\n\tif a.Licenses != nil {\n\t\tobjectMap[\"org.opencontainers.image.licenses\"] = a.Licenses\n\t}\n\tif a.Name != nil {\n\t\tobjectMap[\"org.opencontainers.image.ref.name\"] = a.Name\n\t}\n\tif a.Title != nil {\n\t\tobjectMap[\"org.opencontainers.image.title\"] = a.Title\n\t}\n\tif a.Description != nil {\n\t\tobjectMap[\"org.opencontainers.image.description\"] = a.Description\n\t}\n\tfor k, v := range a.AdditionalProperties {\n\t\tobjectMap[k] = v\n\t}\n\treturn json.Marshal(objectMap)\n}\n\n// UnmarshalJSON is the custom unmarshaler for Annotations struct.\nfunc (a *Annotations) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tdefault:\n\t\t\tif v != nil {\n\t\t\t\tvar additionalProperties interface{}\n\t\t\t\terr = json.Unmarshal(*v, &additionalProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif a.AdditionalProperties == nil {\n\t\t\t\t\ta.AdditionalProperties = make(map[string]interface{})\n\t\t\t\t}\n\t\t\t\ta.AdditionalProperties[k] = additionalProperties\n\t\t\t}\n\t\tcase \"org.opencontainers.image.created\":\n\t\t\tif v != nil {\n\t\t\t\tvar created date.Time\n\t\t\t\terr = json.Unmarshal(*v, &created)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Created = &created\n\t\t\t}\n\t\tcase \"org.opencontainers.image.authors\":\n\t\t\tif v != nil {\n\t\t\t\tvar authors string\n\t\t\t\terr = json.Unmarshal(*v, &authors)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Authors = &authors\n\t\t\t}\n\t\tcase \"org.opencontainers.image.url\":\n\t\t\tif v != nil {\n\t\t\t\tvar URL string\n\t\t\t\terr = json.Unmarshal(*v, &URL)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.URL = &URL\n\t\t\t}\n\t\tcase \"org.opencontainers.image.documentation\":\n\t\t\tif v != nil {\n\t\t\t\tvar documentation string\n\t\t\t\terr = json.Unmarshal(*v, &documentation)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Documentation = &documentation\n\t\t\t}\n\t\tcase \"org.opencontainers.image.source\":\n\t\t\tif v != nil {\n\t\t\t\tvar source string\n\t\t\t\terr = json.Unmarshal(*v, &source)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Source = &source\n\t\t\t}\n\t\tcase \"org.opencontainers.image.version\":\n\t\t\tif v != nil {\n\t\t\t\tvar version string\n\t\t\t\terr = json.Unmarshal(*v, &version)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Version = &version\n\t\t\t}\n\t\tcase \"org.opencontainers.image.revision\":\n\t\t\tif v != nil {\n\t\t\t\tvar revision string\n\t\t\t\terr = json.Unmarshal(*v, &revision)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Revision = &revision\n\t\t\t}\n\t\tcase \"org.opencontainers.image.vendor\":\n\t\t\tif v != nil {\n\t\t\t\tvar vendor string\n\t\t\t\terr = json.Unmarshal(*v, &vendor)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Vendor = &vendor\n\t\t\t}\n\t\tcase \"org.opencontainers.image.licenses\":\n\t\t\tif v != nil {\n\t\t\t\tvar licenses string\n\t\t\t\terr = json.Unmarshal(*v, &licenses)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Licenses = &licenses\n\t\t\t}\n\t\tcase \"org.opencontainers.image.ref.name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Name = &name\n\t\t\t}\n\t\tcase \"org.opencontainers.image.title\":\n\t\t\tif v != nil {\n\t\t\t\tvar title string\n\t\t\t\terr = json.Unmarshal(*v, &title)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Title = &title\n\t\t\t}\n\t\tcase \"org.opencontainers.image.description\":\n\t\t\tif v != nil {\n\t\t\t\tvar description string\n\t\t\t\terr = json.Unmarshal(*v, &description)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ta.Description = &description\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// ChangeableAttributes ...\ntype ChangeableAttributes struct {\n\t// DeleteEnabled - Delete enabled\n\tDeleteEnabled *bool `json:\"deleteEnabled,omitempty\"`\n\t// WriteEnabled - Write enabled\n\tWriteEnabled *bool `json:\"writeEnabled,omitempty\"`\n\t// ListEnabled - List enabled\n\tListEnabled *bool `json:\"listEnabled,omitempty\"`\n\t// ReadEnabled - Read enabled\n\tReadEnabled *bool `json:\"readEnabled,omitempty\"`\n}\n\n// DeletedRepository deleted repository\ntype DeletedRepository struct {\n\tautorest.Response `json:\"-\"`\n\t// ManifestsDeleted - SHA of the deleted image\n\tManifestsDeleted *[]string `json:\"manifestsDeleted,omitempty\"`\n\t// TagsDeleted - Tag of the deleted image\n\tTagsDeleted *[]string `json:\"tagsDeleted,omitempty\"`\n}\n\n// Descriptor docker V2 image layer descriptor including config and layers\ntype Descriptor struct {\n\t// MediaType - Layer media type\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// Size - Layer size\n\tSize *int64 `json:\"size,omitempty\"`\n\t// Digest - Layer digest\n\tDigest *string `json:\"digest,omitempty\"`\n\t// Urls - Specifies a list of URIs from which this object may be downloaded.\n\tUrls        *[]string    `json:\"urls,omitempty\"`\n\tAnnotations *Annotations `json:\"annotations,omitempty\"`\n}\n\n// FsLayer image layer information\ntype FsLayer struct {\n\t// BlobSum - SHA of an image layer\n\tBlobSum *string `json:\"blobSum,omitempty\"`\n}\n\n// History a list of unstructured historical data for v1 compatibility\ntype History struct {\n\t// V1Compatibility - The raw v1 compatibility information\n\tV1Compatibility *string `json:\"v1Compatibility,omitempty\"`\n}\n\n// ImageSignature signature of a signed manifest\ntype ImageSignature struct {\n\t// Header - A JSON web signature\n\tHeader *JWK `json:\"header,omitempty\"`\n\t// Signature - A signature for the image manifest, signed by a libtrust private key\n\tSignature *string `json:\"signature,omitempty\"`\n\t// Protected - The signed protected header\n\tProtected *string `json:\"protected,omitempty\"`\n}\n\n// JWK a JSON web signature\ntype JWK struct {\n\tJwk *JWKHeader `json:\"jwk,omitempty\"`\n\t// Alg - The algorithm used to sign or encrypt the JWT\n\tAlg *string `json:\"alg,omitempty\"`\n}\n\n// JWKHeader JSON web key parameter\ntype JWKHeader struct {\n\t// Crv - crv value\n\tCrv *string `json:\"crv,omitempty\"`\n\t// Kid - kid value\n\tKid *string `json:\"kid,omitempty\"`\n\t// Kty - kty value\n\tKty *string `json:\"kty,omitempty\"`\n\t// X - x value\n\tX *string `json:\"x,omitempty\"`\n\t// Y - y value\n\tY *string `json:\"y,omitempty\"`\n}\n\n// Manifest returns the requested manifest file\ntype Manifest struct {\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// ManifestAttributes manifest attributes details\ntype ManifestAttributes struct {\n\tautorest.Response `json:\"-\"`\n\t// Registry - Registry name\n\tRegistry *string `json:\"registry,omitempty\"`\n\t// ImageName - Image name\n\tImageName *string `json:\"imageName,omitempty\"`\n\t// Attributes - Manifest attributes\n\tAttributes *ManifestAttributesBase `json:\"manifest,omitempty\"`\n}\n\n// ManifestAttributesBase manifest details\ntype ManifestAttributesBase struct {\n\t// Digest - Manifest\n\tDigest *string `json:\"digest,omitempty\"`\n\t// ImageSize - Image size\n\tImageSize *int64 `json:\"imageSize,omitempty\"`\n\t// CreatedTime - Created time\n\tCreatedTime *string `json:\"createdTime,omitempty\"`\n\t// LastUpdateTime - Last update time\n\tLastUpdateTime *string `json:\"lastUpdateTime,omitempty\"`\n\t// Architecture - CPU architecture\n\tArchitecture *string `json:\"architecture,omitempty\"`\n\t// Os - Operating system\n\tOs *string `json:\"os,omitempty\"`\n\t// MediaType - Media type\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// ConfigMediaType - Config blob media type\n\tConfigMediaType *string `json:\"configMediaType,omitempty\"`\n\t// Tags - List of tags\n\tTags *[]string `json:\"tags,omitempty\"`\n\t// ChangeableAttributes - Changeable attributes\n\tChangeableAttributes *ChangeableAttributes `json:\"changeableAttributes,omitempty\"`\n}\n\n// ManifestAttributesManifest list of manifest attributes\ntype ManifestAttributesManifest struct {\n\t// References - List of manifest attributes details\n\tReferences *[]ManifestAttributesManifestReferences `json:\"references,omitempty\"`\n\t// QuarantineTag - Quarantine tag name\n\tQuarantineTag *string `json:\"quarantineTag,omitempty\"`\n}\n\n// ManifestAttributesManifestReferences manifest attributes details\ntype ManifestAttributesManifestReferences struct {\n\t// Digest - Manifest digest\n\tDigest *string `json:\"digest,omitempty\"`\n\t// Architecture - CPU architecture\n\tArchitecture *string `json:\"architecture,omitempty\"`\n\t// Os - Operating system\n\tOs *string `json:\"os,omitempty\"`\n}\n\n// ManifestChangeableAttributes changeable attributes\ntype ManifestChangeableAttributes struct {\n\t// DeleteEnabled - Delete enabled\n\tDeleteEnabled *bool `json:\"deleteEnabled,omitempty\"`\n\t// WriteEnabled - Write enabled\n\tWriteEnabled *bool `json:\"writeEnabled,omitempty\"`\n\t// ListEnabled - List enabled\n\tListEnabled *bool `json:\"listEnabled,omitempty\"`\n\t// ReadEnabled - Read enabled\n\tReadEnabled *bool `json:\"readEnabled,omitempty\"`\n\t// QuarantineState - Quarantine state\n\tQuarantineState *string `json:\"quarantineState,omitempty\"`\n\t// QuarantineDetails - Quarantine details\n\tQuarantineDetails *string `json:\"quarantineDetails,omitempty\"`\n}\n\n// ManifestList returns the requested Docker multi-arch-manifest file\ntype ManifestList struct {\n\t// MediaType - Media type for this Manifest\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// Manifests - List of V2 image layer information\n\tManifests *[]ManifestListAttributes `json:\"manifests,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// ManifestListAttributes ...\ntype ManifestListAttributes struct {\n\t// MediaType - The MIME type of the referenced object. This will generally be application/vnd.docker.image.manifest.v2+json, but it could also be application/vnd.docker.image.manifest.v1+json\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// Size - The size in bytes of the object\n\tSize *int64 `json:\"size,omitempty\"`\n\t// Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification\n\tDigest   *string   `json:\"digest,omitempty\"`\n\tPlatform *Platform `json:\"platform,omitempty\"`\n}\n\n// ManifestWrapper returns the requested manifest file\ntype ManifestWrapper struct {\n\tautorest.Response `json:\"-\"`\n\t// MediaType - Media type for this Manifest\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// Manifests - (ManifestList, OCIIndex) List of V2 image layer information\n\tManifests *[]ManifestListAttributes `json:\"manifests,omitempty\"`\n\t// Config - (V2, OCI) Image config descriptor\n\tConfig *Descriptor `json:\"config,omitempty\"`\n\t// Layers - (V2, OCI) List of V2 image layer information\n\tLayers *[]Descriptor `json:\"layers,omitempty\"`\n\t// Annotations - (OCI, OCIIndex) Additional metadata\n\tAnnotations *Annotations `json:\"annotations,omitempty\"`\n\t// Architecture - (V1) CPU architecture\n\tArchitecture *string `json:\"architecture,omitempty\"`\n\t// Name - (V1) Image name\n\tName *string `json:\"name,omitempty\"`\n\t// Tag - (V1) Image tag\n\tTag *string `json:\"tag,omitempty\"`\n\t// FsLayers - (V1) List of layer information\n\tFsLayers *[]FsLayer `json:\"fsLayers,omitempty\"`\n\t// History - (V1) Image history\n\tHistory *[]History `json:\"history,omitempty\"`\n\t// Signatures - (V1) Image signature\n\tSignatures *[]ImageSignature `json:\"signatures,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// OCIIndex returns the requested OCI index file\ntype OCIIndex struct {\n\t// Manifests - List of OCI image layer information\n\tManifests   *[]ManifestListAttributes `json:\"manifests,omitempty\"`\n\tAnnotations *Annotations              `json:\"annotations,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// OCIManifest returns the requested OCI Manifest file\ntype OCIManifest struct {\n\t// Config - V2 image config descriptor\n\tConfig *Descriptor `json:\"config,omitempty\"`\n\t// Layers - List of V2 image layer information\n\tLayers      *[]Descriptor `json:\"layers,omitempty\"`\n\tAnnotations *Annotations  `json:\"annotations,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// Platform the platform object describes the platform which the image in the manifest runs on. A full list\n// of valid operating system and architecture values are listed in the Go language documentation for $GOOS\n// and $GOARCH\ntype Platform struct {\n\t// Architecture - Specifies the CPU architecture, for example amd64 or ppc64le.\n\tArchitecture *string `json:\"architecture,omitempty\"`\n\t// Os - The os field specifies the operating system, for example linux or windows.\n\tOs *string `json:\"os,omitempty\"`\n\t// OsVersion - The optional os.version field specifies the operating system version, for example 10.0.10586.\n\tOsVersion *string `json:\"os.version,omitempty\"`\n\t// OsFeatures - The optional os.features field specifies an array of strings, each listing a required OS feature (for example on Windows win32k\n\tOsFeatures *[]string `json:\"os.features,omitempty\"`\n\t// Variant - The optional variant field specifies a variant of the CPU, for example armv6l to specify a particular CPU variant of the ARM CPU.\n\tVariant *string `json:\"variant,omitempty\"`\n\t// Features - The optional features field specifies an array of strings, each listing a required CPU feature (for example sse4 or aes\n\tFeatures *[]string `json:\"features,omitempty\"`\n}\n\n// ReadCloser ...\ntype ReadCloser struct {\n\tautorest.Response `json:\"-\"`\n\tValue             *io.ReadCloser `json:\"value,omitempty\"`\n}\n\n// RefreshToken ...\ntype RefreshToken struct {\n\tautorest.Response `json:\"-\"`\n\t// RefreshToken - The refresh token to be used for generating access tokens\n\tRefreshToken *string `json:\"refresh_token,omitempty\"`\n}\n\n// Repositories list of repositories\ntype Repositories struct {\n\tautorest.Response `json:\"-\"`\n\t// Names - Repository names\n\tNames *[]string `json:\"repositories,omitempty\"`\n}\n\n// RepositoryAttributes repository attributes\ntype RepositoryAttributes struct {\n\tautorest.Response `json:\"-\"`\n\t// Registry - Registry name\n\tRegistry *string `json:\"registry,omitempty\"`\n\t// ImageName - Image name\n\tImageName *string `json:\"imageName,omitempty\"`\n\t// CreatedTime - Image created time\n\tCreatedTime *string `json:\"createdTime,omitempty\"`\n\t// LastUpdateTime - Image last update time\n\tLastUpdateTime *string `json:\"lastUpdateTime,omitempty\"`\n\t// ManifestCount - Number of the manifests\n\tManifestCount *int32 `json:\"manifestCount,omitempty\"`\n\t// TagCount - Number of the tags\n\tTagCount *int32 `json:\"tagCount,omitempty\"`\n\t// ChangeableAttributes - Changeable attributes\n\tChangeableAttributes *ChangeableAttributes `json:\"changeableAttributes,omitempty\"`\n}\n\n// RepositoryTags result of the request to list tags of the image\ntype RepositoryTags struct {\n\t// Name - Name of the image\n\tName *string `json:\"name,omitempty\"`\n\t// Tags - List of tags\n\tTags *[]string `json:\"tags,omitempty\"`\n}\n\n// SetObject ...\ntype SetObject struct {\n\tautorest.Response `json:\"-\"`\n\tValue             interface{} `json:\"value,omitempty\"`\n}\n\n// TagAttributes tag attributes\ntype TagAttributes struct {\n\tautorest.Response `json:\"-\"`\n\t// Registry - Registry name\n\tRegistry *string `json:\"registry,omitempty\"`\n\t// ImageName - Image name\n\tImageName *string `json:\"imageName,omitempty\"`\n\t// Attributes - List of tag attribute details\n\tAttributes *TagAttributesBase `json:\"tag,omitempty\"`\n}\n\n// TagAttributesBase tag attribute details\ntype TagAttributesBase struct {\n\t// Name - Tag name\n\tName *string `json:\"name,omitempty\"`\n\t// Digest - Tag digest\n\tDigest *string `json:\"digest,omitempty\"`\n\t// CreatedTime - Tag created time\n\tCreatedTime *string `json:\"createdTime,omitempty\"`\n\t// LastUpdateTime - Tag last update time\n\tLastUpdateTime *string `json:\"lastUpdateTime,omitempty\"`\n\t// Signed - Is signed\n\tSigned *bool `json:\"signed,omitempty\"`\n\t// ChangeableAttributes - Changeable attributes\n\tChangeableAttributes *ChangeableAttributes `json:\"changeableAttributes,omitempty\"`\n}\n\n// TagAttributesTag tag\ntype TagAttributesTag struct {\n\t// SignatureRecord - SignatureRecord value\n\tSignatureRecord *string `json:\"signatureRecord,omitempty\"`\n}\n\n// TagList list of tag details\ntype TagList struct {\n\tautorest.Response `json:\"-\"`\n\t// Registry - Registry name\n\tRegistry *string `json:\"registry,omitempty\"`\n\t// ImageName - Image name\n\tImageName *string `json:\"imageName,omitempty\"`\n\t// Tags - List of tag attribute details\n\tTags *[]TagAttributesBase `json:\"tags,omitempty\"`\n}\n\n// V1Manifest returns the requested V1 manifest file\ntype V1Manifest struct {\n\t// Architecture - CPU architecture\n\tArchitecture *string `json:\"architecture,omitempty\"`\n\t// Name - Image name\n\tName *string `json:\"name,omitempty\"`\n\t// Tag - Image tag\n\tTag *string `json:\"tag,omitempty\"`\n\t// FsLayers - List of layer information\n\tFsLayers *[]FsLayer `json:\"fsLayers,omitempty\"`\n\t// History - Image history\n\tHistory *[]History `json:\"history,omitempty\"`\n\t// Signatures - Image signature\n\tSignatures *[]ImageSignature `json:\"signatures,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n\n// V2Manifest returns the requested Docker V2 Manifest file\ntype V2Manifest struct {\n\t// MediaType - Media type for this Manifest\n\tMediaType *string `json:\"mediaType,omitempty\"`\n\t// Config - V2 image config descriptor\n\tConfig *Descriptor `json:\"config,omitempty\"`\n\t// Layers - List of V2 image layer information\n\tLayers *[]Descriptor `json:\"layers,omitempty\"`\n\t// SchemaVersion - Schema version\n\tSchemaVersion *int32 `json:\"schemaVersion,omitempty\"`\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/refreshtokens.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// RefreshTokensClient is the metadata API definition for the Azure Container Registry runtime\ntype RefreshTokensClient struct {\n\tBaseClient\n}\n\n// NewRefreshTokensClient creates an instance of the RefreshTokensClient client.\nfunc NewRefreshTokensClient(loginURI string) RefreshTokensClient {\n\treturn RefreshTokensClient{New(loginURI)}\n}\n\n// GetFromExchange exchange AAD tokens for an ACR refresh Token\n// Parameters:\n// grantType - can take a value of access_token_refresh_token, or access_token, or refresh_token\n// service - indicates the name of your Azure container registry.\n// tenant - AAD tenant associated to the AAD credentials.\n// refreshToken - AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token\n// accessToken - AAD access token, mandatory when grant_type is access_token_refresh_token or access_token.\nfunc (client RefreshTokensClient) GetFromExchange(ctx context.Context, grantType string, service string, tenant string, refreshToken string, accessToken string) (result RefreshToken, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/RefreshTokensClient.GetFromExchange\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetFromExchangePreparer(ctx, grantType, service, tenant, refreshToken, accessToken)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RefreshTokensClient\", \"GetFromExchange\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetFromExchangeSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RefreshTokensClient\", \"GetFromExchange\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetFromExchangeResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RefreshTokensClient\", \"GetFromExchange\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetFromExchangePreparer prepares the GetFromExchange request.\nfunc (client RefreshTokensClient) GetFromExchangePreparer(ctx context.Context, grantType string, service string, tenant string, refreshToken string, accessToken string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tformDataParameters := map[string]interface{}{\n\t\t\"grant_type\": grantType,\n\t\t\"service\":    service,\n\t}\n\tif len(tenant) > 0 {\n\t\tformDataParameters[\"tenant\"] = tenant\n\t}\n\tif len(refreshToken) > 0 {\n\t\tformDataParameters[\"refresh_token\"] = refreshToken\n\t}\n\tif len(accessToken) > 0 {\n\t\tformDataParameters[\"access_token\"] = accessToken\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsPost(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPath(\"/oauth2/exchange\"),\n\t\tautorest.WithFormData(autorest.MapToValues(formDataParameters)))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetFromExchangeSender sends the GetFromExchange request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client RefreshTokensClient) GetFromExchangeSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetFromExchangeResponder handles the response to the GetFromExchange request. The method always\n// closes the http.Response Body.\nfunc (client RefreshTokensClient) GetFromExchangeResponder(resp *http.Response) (result RefreshToken, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/repository.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// RepositoryClient is the metadata API definition for the Azure Container Registry runtime\ntype RepositoryClient struct {\n\tBaseClient\n}\n\n// NewRepositoryClient creates an instance of the RepositoryClient client.\nfunc NewRepositoryClient(loginURI string) RepositoryClient {\n\treturn RepositoryClient{New(loginURI)}\n}\n\n// Delete delete the repository identified by `name`\n// Parameters:\n// name - name of the image (including the namespace)\nfunc (client RepositoryClient) Delete(ctx context.Context, name string) (result DeletedRepository, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/RepositoryClient.Delete\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.DeletePreparer(ctx, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"Delete\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"Delete\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"Delete\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// DeletePreparer prepares the Delete request.\nfunc (client RepositoryClient) DeletePreparer(ctx context.Context, name string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// DeleteSender sends the Delete request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client RepositoryClient) DeleteSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// DeleteResponder handles the response to the Delete request. The method always\n// closes the http.Response Body.\nfunc (client RepositoryClient) DeleteResponder(resp *http.Response) (result DeletedRepository, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetAttributes get repository attributes\n// Parameters:\n// name - name of the image (including the namespace)\nfunc (client RepositoryClient) GetAttributes(ctx context.Context, name string) (result RepositoryAttributes, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/RepositoryClient.GetAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetAttributesPreparer(ctx, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetAttributesPreparer prepares the GetAttributes request.\nfunc (client RepositoryClient) GetAttributesPreparer(ctx context.Context, name string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetAttributesSender sends the GetAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client RepositoryClient) GetAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetAttributesResponder handles the response to the GetAttributes request. The method always\n// closes the http.Response Body.\nfunc (client RepositoryClient) GetAttributesResponder(resp *http.Response) (result RepositoryAttributes, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetList list repositories\n// Parameters:\n// last - query parameter for the last item in previous query. Result set will include values lexically after\n// last.\n// n - query parameter for max number of items\nfunc (client RepositoryClient) GetList(ctx context.Context, last string, n *int32) (result Repositories, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/RepositoryClient.GetList\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetListPreparer(ctx, last, n)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetList\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetListSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetList\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetListResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"GetList\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetListPreparer prepares the GetList request.\nfunc (client RepositoryClient) GetListPreparer(ctx context.Context, last string, n *int32) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tqueryParameters := map[string]interface{}{}\n\tif len(last) > 0 {\n\t\tqueryParameters[\"last\"] = autorest.Encode(\"query\", last)\n\t}\n\tif n != nil {\n\t\tqueryParameters[\"n\"] = autorest.Encode(\"query\", *n)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPath(\"/acr/v1/_catalog\"),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetListSender sends the GetList request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client RepositoryClient) GetListSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetListResponder handles the response to the GetList request. The method always\n// closes the http.Response Body.\nfunc (client RepositoryClient) GetListResponder(resp *http.Response) (result Repositories, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// UpdateAttributes update the attribute identified by `name` where `reference` is the name of the repository.\n// Parameters:\n// name - name of the image (including the namespace)\n// value - repository attribute value\nfunc (client RepositoryClient) UpdateAttributes(ctx context.Context, name string, value *ChangeableAttributes) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/RepositoryClient.UpdateAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.UpdateAttributesPreparer(ctx, name, value)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"UpdateAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.UpdateAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"UpdateAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.UpdateAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.RepositoryClient\", \"UpdateAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// UpdateAttributesPreparer prepares the UpdateAttributes request.\nfunc (client RepositoryClient) UpdateAttributesPreparer(ctx context.Context, name string, value *ChangeableAttributes) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/json; charset=utf-8\"),\n\t\tautorest.AsPatch(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}\", pathParameters))\n\tif value != nil {\n\t\tpreparer = autorest.DecoratePreparer(preparer,\n\t\t\tautorest.WithJSON(value))\n\t}\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// UpdateAttributesSender sends the UpdateAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client RepositoryClient) UpdateAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// UpdateAttributesResponder handles the response to the UpdateAttributes request. The method always\n// closes the http.Response Body.\nfunc (client RepositoryClient) UpdateAttributesResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/tag.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// TagClient is the metadata API definition for the Azure Container Registry runtime\ntype TagClient struct {\n\tBaseClient\n}\n\n// NewTagClient creates an instance of the TagClient client.\nfunc NewTagClient(loginURI string) TagClient {\n\treturn TagClient{New(loginURI)}\n}\n\n// Delete delete tag\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - tag name\nfunc (client TagClient) Delete(ctx context.Context, name string, reference string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/TagClient.Delete\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.DeletePreparer(ctx, name, reference)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"Delete\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"Delete\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"Delete\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// DeletePreparer prepares the Delete request.\nfunc (client TagClient) DeletePreparer(ctx context.Context, name string, reference string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_tags/{reference}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// DeleteSender sends the Delete request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client TagClient) DeleteSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// DeleteResponder handles the response to the Delete request. The method always\n// closes the http.Response Body.\nfunc (client TagClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n\n// GetAttributes get tag attributes by tag\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - tag name\nfunc (client TagClient) GetAttributes(ctx context.Context, name string, reference string) (result TagAttributes, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/TagClient.GetAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetAttributesPreparer(ctx, name, reference)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetAttributesPreparer prepares the GetAttributes request.\nfunc (client TagClient) GetAttributesPreparer(ctx context.Context, name string, reference string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_tags/{reference}\", pathParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetAttributesSender sends the GetAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client TagClient) GetAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetAttributesResponder handles the response to the GetAttributes request. The method always\n// closes the http.Response Body.\nfunc (client TagClient) GetAttributesResponder(resp *http.Response) (result TagAttributes, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// GetList list tags of a repository\n// Parameters:\n// name - name of the image (including the namespace)\n// last - query parameter for the last item in previous query. Result set will include values lexically after\n// last.\n// n - query parameter for max number of items\n// orderby - orderby query parameter\n// digest - filter by digest\nfunc (client TagClient) GetList(ctx context.Context, name string, last string, n *int32, orderby string, digest string) (result TagList, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/TagClient.GetList\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetListPreparer(ctx, name, last, n, orderby, digest)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetList\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetListSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetList\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetListResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"GetList\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// GetListPreparer prepares the GetList request.\nfunc (client TagClient) GetListPreparer(ctx context.Context, name string, last string, n *int32, orderby string, digest string) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t}\n\n\tqueryParameters := map[string]interface{}{}\n\tif len(last) > 0 {\n\t\tqueryParameters[\"last\"] = autorest.Encode(\"query\", last)\n\t}\n\tif n != nil {\n\t\tqueryParameters[\"n\"] = autorest.Encode(\"query\", *n)\n\t}\n\tif len(orderby) > 0 {\n\t\tqueryParameters[\"orderby\"] = autorest.Encode(\"query\", orderby)\n\t}\n\tif len(digest) > 0 {\n\t\tqueryParameters[\"digest\"] = autorest.Encode(\"query\", digest)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_tags\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// GetListSender sends the GetList request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client TagClient) GetListSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// GetListResponder handles the response to the GetList request. The method always\n// closes the http.Response Body.\nfunc (client TagClient) GetListResponder(resp *http.Response) (result TagList, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}\n\n// UpdateAttributes update tag attributes\n// Parameters:\n// name - name of the image (including the namespace)\n// reference - tag name\n// value - repository attribute value\nfunc (client TagClient) UpdateAttributes(ctx context.Context, name string, reference string, value *ChangeableAttributes) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/TagClient.UpdateAttributes\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.UpdateAttributesPreparer(ctx, name, reference, value)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"UpdateAttributes\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.UpdateAttributesSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"UpdateAttributes\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.UpdateAttributesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.TagClient\", \"UpdateAttributes\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// UpdateAttributesPreparer prepares the UpdateAttributes request.\nfunc (client TagClient) UpdateAttributesPreparer(ctx context.Context, name string, reference string, value *ChangeableAttributes) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpathParameters := map[string]interface{}{\n\t\t\"name\":      autorest.Encode(\"path\", name),\n\t\t\"reference\": autorest.Encode(\"path\", reference),\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/json; charset=utf-8\"),\n\t\tautorest.AsPatch(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPathParameters(\"/acr/v1/{name}/_tags/{reference}\", pathParameters))\n\tif value != nil {\n\t\tpreparer = autorest.DecoratePreparer(preparer,\n\t\t\tautorest.WithJSON(value))\n\t}\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// UpdateAttributesSender sends the UpdateAttributes request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client TagClient) UpdateAttributesSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// UpdateAttributesResponder handles the response to the UpdateAttributes request. The method always\n// closes the http.Response Body.\nfunc (client TagClient) UpdateAttributesResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/v2support.go",
    "content": "package containerregistry\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"context\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/Azure/go-autorest/tracing\"\n\t\"net/http\"\n)\n\n// V2SupportClient is the metadata API definition for the Azure Container Registry runtime\ntype V2SupportClient struct {\n\tBaseClient\n}\n\n// NewV2SupportClient creates an instance of the V2SupportClient client.\nfunc NewV2SupportClient(loginURI string) V2SupportClient {\n\treturn V2SupportClient{New(loginURI)}\n}\n\n// Check tells whether this Docker Registry instance supports Docker Registry HTTP API v2\nfunc (client V2SupportClient) Check(ctx context.Context) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/V2SupportClient.Check\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.CheckPreparer(ctx)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.V2SupportClient\", \"Check\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CheckSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.V2SupportClient\", \"Check\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CheckResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"containerregistry.V2SupportClient\", \"Check\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// CheckPreparer prepares the Check request.\nfunc (client V2SupportClient) CheckPreparer(ctx context.Context) (*http.Request, error) {\n\turlParameters := map[string]interface{}{\n\t\t\"url\": client.LoginURI,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithCustomBaseURL(\"{url}\", urlParameters),\n\t\tautorest.WithPath(\"/v2/\"))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}\n\n// CheckSender sends the Check request. The method will close the\n// http.Response Body if it receives an error.\nfunc (client V2SupportClient) CheckSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}\n\n// CheckResponder handles the response to the Check request. The method always\n// closes the http.Response Body.\nfunc (client V2SupportClient) CheckResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/version.go",
    "content": "package containerregistry\n\nimport \"github.com/Azure/azure-sdk-for-go/version\"\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\n// UserAgent returns the UserAgent string to use when sending http.Requests.\nfunc UserAgent() string {\n\treturn \"Azure-SDK-For-Go/\" + Version() + \" containerregistry/2019-08-15-preview\"\n}\n\n// Version returns the semantic version (see http://semver.org) of the client.\nfunc Version() string {\n\treturn version.Number\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/azure-sdk-for-go/version/version.go",
    "content": "package version\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\n// Number contains the semantic version of this SDK.\nconst Number = \"v68.0.0\"\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 Microsoft Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/README.md",
    "content": "# go-ansiterm\n\nThis is a cross platform Ansi Terminal Emulation library.  It reads a stream of Ansi characters and produces the appropriate function calls.  The results of the function calls are platform dependent.\n\nFor example the parser might receive \"ESC, [, A\" as a stream of three characters.  This is the code for Cursor Up (http://www.vt100.net/docs/vt510-rm/CUU).  The parser then calls the cursor up function (CUU()) on an event handler.  The event handler determines what platform specific work must be done to cause the cursor to move up one position.\n\nThe parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png).  There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go).\n\nSee parser_test.go for examples exercising the state machine and generating appropriate function calls.\n\n-----\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/SECURITY.md",
    "content": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->\n\n## Security\n\nMicrosoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n\nIf you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n\n## Reporting Security Issues\n\n**Please do not report security vulnerabilities through public GitHub issues.**\n\nInstead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n\nIf you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n\nYou should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n\nPlease include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n\n  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n  * Full paths of source file(s) related to the manifestation of the issue\n  * The location of the affected source code (tag/branch/commit or direct URL)\n  * Any special configuration required to reproduce the issue\n  * Step-by-step instructions to reproduce the issue\n  * Proof-of-concept or exploit code (if possible)\n  * Impact of the issue, including how an attacker might exploit the issue\n\nThis information will help us triage your report more quickly.\n\nIf you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n\n## Preferred Languages\n\nWe prefer all communications to be in English.\n\n## Policy\n\nMicrosoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n\n<!-- END MICROSOFT SECURITY.MD BLOCK -->\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/constants.go",
    "content": "package ansiterm\n\nconst LogEnv = \"DEBUG_TERMINAL\"\n\n// ANSI constants\n// References:\n// -- http://www.ecma-international.org/publications/standards/Ecma-048.htm\n// -- http://man7.org/linux/man-pages/man4/console_codes.4.html\n// -- http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html\n// -- http://en.wikipedia.org/wiki/ANSI_escape_code\n// -- http://vt100.net/emu/dec_ansi_parser\n// -- http://vt100.net/emu/vt500_parser.svg\n// -- http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n// -- http://www.inwap.com/pdp10/ansicode.txt\nconst (\n\t// ECMA-48 Set Graphics Rendition\n\t// Note:\n\t// -- Constants leading with an underscore (e.g., _ANSI_xxx) are unsupported or reserved\n\t// -- Fonts could possibly be supported via SetCurrentConsoleFontEx\n\t// -- Windows does not expose the per-window cursor (i.e., caret) blink times\n\tANSI_SGR_RESET              = 0\n\tANSI_SGR_BOLD               = 1\n\tANSI_SGR_DIM                = 2\n\t_ANSI_SGR_ITALIC            = 3\n\tANSI_SGR_UNDERLINE          = 4\n\t_ANSI_SGR_BLINKSLOW         = 5\n\t_ANSI_SGR_BLINKFAST         = 6\n\tANSI_SGR_REVERSE            = 7\n\t_ANSI_SGR_INVISIBLE         = 8\n\t_ANSI_SGR_LINETHROUGH       = 9\n\t_ANSI_SGR_FONT_00           = 10\n\t_ANSI_SGR_FONT_01           = 11\n\t_ANSI_SGR_FONT_02           = 12\n\t_ANSI_SGR_FONT_03           = 13\n\t_ANSI_SGR_FONT_04           = 14\n\t_ANSI_SGR_FONT_05           = 15\n\t_ANSI_SGR_FONT_06           = 16\n\t_ANSI_SGR_FONT_07           = 17\n\t_ANSI_SGR_FONT_08           = 18\n\t_ANSI_SGR_FONT_09           = 19\n\t_ANSI_SGR_FONT_10           = 20\n\t_ANSI_SGR_DOUBLEUNDERLINE   = 21\n\tANSI_SGR_BOLD_DIM_OFF       = 22\n\t_ANSI_SGR_ITALIC_OFF        = 23\n\tANSI_SGR_UNDERLINE_OFF      = 24\n\t_ANSI_SGR_BLINK_OFF         = 25\n\t_ANSI_SGR_RESERVED_00       = 26\n\tANSI_SGR_REVERSE_OFF        = 27\n\t_ANSI_SGR_INVISIBLE_OFF     = 28\n\t_ANSI_SGR_LINETHROUGH_OFF   = 29\n\tANSI_SGR_FOREGROUND_BLACK   = 30\n\tANSI_SGR_FOREGROUND_RED     = 31\n\tANSI_SGR_FOREGROUND_GREEN   = 32\n\tANSI_SGR_FOREGROUND_YELLOW  = 33\n\tANSI_SGR_FOREGROUND_BLUE    = 34\n\tANSI_SGR_FOREGROUND_MAGENTA = 35\n\tANSI_SGR_FOREGROUND_CYAN    = 36\n\tANSI_SGR_FOREGROUND_WHITE   = 37\n\t_ANSI_SGR_RESERVED_01       = 38\n\tANSI_SGR_FOREGROUND_DEFAULT = 39\n\tANSI_SGR_BACKGROUND_BLACK   = 40\n\tANSI_SGR_BACKGROUND_RED     = 41\n\tANSI_SGR_BACKGROUND_GREEN   = 42\n\tANSI_SGR_BACKGROUND_YELLOW  = 43\n\tANSI_SGR_BACKGROUND_BLUE    = 44\n\tANSI_SGR_BACKGROUND_MAGENTA = 45\n\tANSI_SGR_BACKGROUND_CYAN    = 46\n\tANSI_SGR_BACKGROUND_WHITE   = 47\n\t_ANSI_SGR_RESERVED_02       = 48\n\tANSI_SGR_BACKGROUND_DEFAULT = 49\n\t// 50 - 65: Unsupported\n\n\tANSI_MAX_CMD_LENGTH = 4096\n\n\tMAX_INPUT_EVENTS = 128\n\tDEFAULT_WIDTH    = 80\n\tDEFAULT_HEIGHT   = 24\n\n\tANSI_BEL              = 0x07\n\tANSI_BACKSPACE        = 0x08\n\tANSI_TAB              = 0x09\n\tANSI_LINE_FEED        = 0x0A\n\tANSI_VERTICAL_TAB     = 0x0B\n\tANSI_FORM_FEED        = 0x0C\n\tANSI_CARRIAGE_RETURN  = 0x0D\n\tANSI_ESCAPE_PRIMARY   = 0x1B\n\tANSI_ESCAPE_SECONDARY = 0x5B\n\tANSI_OSC_STRING_ENTRY = 0x5D\n\tANSI_COMMAND_FIRST    = 0x40\n\tANSI_COMMAND_LAST     = 0x7E\n\tDCS_ENTRY             = 0x90\n\tCSI_ENTRY             = 0x9B\n\tOSC_STRING            = 0x9D\n\tANSI_PARAMETER_SEP    = \";\"\n\tANSI_CMD_G0           = '('\n\tANSI_CMD_G1           = ')'\n\tANSI_CMD_G2           = '*'\n\tANSI_CMD_G3           = '+'\n\tANSI_CMD_DECPNM       = '>'\n\tANSI_CMD_DECPAM       = '='\n\tANSI_CMD_OSC          = ']'\n\tANSI_CMD_STR_TERM     = '\\\\'\n\n\tKEY_CONTROL_PARAM_2 = \";2\"\n\tKEY_CONTROL_PARAM_3 = \";3\"\n\tKEY_CONTROL_PARAM_4 = \";4\"\n\tKEY_CONTROL_PARAM_5 = \";5\"\n\tKEY_CONTROL_PARAM_6 = \";6\"\n\tKEY_CONTROL_PARAM_7 = \";7\"\n\tKEY_CONTROL_PARAM_8 = \";8\"\n\tKEY_ESC_CSI         = \"\\x1B[\"\n\tKEY_ESC_N           = \"\\x1BN\"\n\tKEY_ESC_O           = \"\\x1BO\"\n\n\tFILL_CHARACTER = ' '\n)\n\nfunc getByteRange(start byte, end byte) []byte {\n\tbytes := make([]byte, 0, 32)\n\tfor i := start; i <= end; i++ {\n\t\tbytes = append(bytes, byte(i))\n\t}\n\n\treturn bytes\n}\n\nvar toGroundBytes = getToGroundBytes()\nvar executors = getExecuteBytes()\n\n// SPACE\t\t  20+A0 hex  Always and everywhere a blank space\n// Intermediate\t  20-2F hex   !\"#$%&'()*+,-./\nvar intermeds = getByteRange(0x20, 0x2F)\n\n// Parameters\t  30-3F hex  0123456789:;<=>?\n// CSI Parameters 30-39, 3B hex 0123456789;\nvar csiParams = getByteRange(0x30, 0x3F)\n\nvar csiCollectables = append(getByteRange(0x30, 0x39), getByteRange(0x3B, 0x3F)...)\n\n// Uppercase\t  40-5F hex  @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\nvar upperCase = getByteRange(0x40, 0x5F)\n\n// Lowercase\t  60-7E hex  `abcdefghijlkmnopqrstuvwxyz{|}~\nvar lowerCase = getByteRange(0x60, 0x7E)\n\n// Alphabetics\t  40-7E hex  (all of upper and lower case)\nvar alphabetics = append(upperCase, lowerCase...)\n\nvar printables = getByteRange(0x20, 0x7F)\n\nvar escapeIntermediateToGroundBytes = getByteRange(0x30, 0x7E)\nvar escapeToGroundBytes = getEscapeToGroundBytes()\n\n// See http://www.vt100.net/emu/vt500_parser.png for description of the complex\n// byte ranges below\n\nfunc getEscapeToGroundBytes() []byte {\n\tescapeToGroundBytes := getByteRange(0x30, 0x4F)\n\tescapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x51, 0x57)...)\n\tescapeToGroundBytes = append(escapeToGroundBytes, 0x59)\n\tescapeToGroundBytes = append(escapeToGroundBytes, 0x5A)\n\tescapeToGroundBytes = append(escapeToGroundBytes, 0x5C)\n\tescapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x60, 0x7E)...)\n\treturn escapeToGroundBytes\n}\n\nfunc getExecuteBytes() []byte {\n\texecuteBytes := getByteRange(0x00, 0x17)\n\texecuteBytes = append(executeBytes, 0x19)\n\texecuteBytes = append(executeBytes, getByteRange(0x1C, 0x1F)...)\n\treturn executeBytes\n}\n\nfunc getToGroundBytes() []byte {\n\tgroundBytes := []byte{0x18}\n\tgroundBytes = append(groundBytes, 0x1A)\n\tgroundBytes = append(groundBytes, getByteRange(0x80, 0x8F)...)\n\tgroundBytes = append(groundBytes, getByteRange(0x91, 0x97)...)\n\tgroundBytes = append(groundBytes, 0x99)\n\tgroundBytes = append(groundBytes, 0x9A)\n\tgroundBytes = append(groundBytes, 0x9C)\n\treturn groundBytes\n}\n\n// Delete\t\t     7F hex  Always and everywhere ignored\n// C1 Control\t  80-9F hex  32 additional control characters\n// G1 Displayable A1-FE hex  94 additional displayable characters\n// Special\t\t  A0+FF hex  Same as SPACE and DELETE\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/context.go",
    "content": "package ansiterm\n\ntype ansiContext struct {\n\tcurrentChar byte\n\tparamBuffer []byte\n\tinterBuffer []byte\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/csi_entry_state.go",
    "content": "package ansiterm\n\ntype csiEntryState struct {\n\tbaseState\n}\n\nfunc (csiState csiEntryState) Handle(b byte) (s state, e error) {\n\tcsiState.parser.logf(\"CsiEntry::Handle %#x\", b)\n\n\tnextState, err := csiState.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\tswitch {\n\tcase sliceContains(alphabetics, b):\n\t\treturn csiState.parser.ground, nil\n\tcase sliceContains(csiCollectables, b):\n\t\treturn csiState.parser.csiParam, nil\n\tcase sliceContains(executors, b):\n\t\treturn csiState, csiState.parser.execute()\n\t}\n\n\treturn csiState, nil\n}\n\nfunc (csiState csiEntryState) Transition(s state) error {\n\tcsiState.parser.logf(\"CsiEntry::Transition %s --> %s\", csiState.Name(), s.Name())\n\tcsiState.baseState.Transition(s)\n\n\tswitch s {\n\tcase csiState.parser.ground:\n\t\treturn csiState.parser.csiDispatch()\n\tcase csiState.parser.csiParam:\n\t\tswitch {\n\t\tcase sliceContains(csiParams, csiState.parser.context.currentChar):\n\t\t\tcsiState.parser.collectParam()\n\t\tcase sliceContains(intermeds, csiState.parser.context.currentChar):\n\t\t\tcsiState.parser.collectInter()\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (csiState csiEntryState) Enter() error {\n\tcsiState.parser.clear()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/csi_param_state.go",
    "content": "package ansiterm\n\ntype csiParamState struct {\n\tbaseState\n}\n\nfunc (csiState csiParamState) Handle(b byte) (s state, e error) {\n\tcsiState.parser.logf(\"CsiParam::Handle %#x\", b)\n\n\tnextState, err := csiState.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\tswitch {\n\tcase sliceContains(alphabetics, b):\n\t\treturn csiState.parser.ground, nil\n\tcase sliceContains(csiCollectables, b):\n\t\tcsiState.parser.collectParam()\n\t\treturn csiState, nil\n\tcase sliceContains(executors, b):\n\t\treturn csiState, csiState.parser.execute()\n\t}\n\n\treturn csiState, nil\n}\n\nfunc (csiState csiParamState) Transition(s state) error {\n\tcsiState.parser.logf(\"CsiParam::Transition %s --> %s\", csiState.Name(), s.Name())\n\tcsiState.baseState.Transition(s)\n\n\tswitch s {\n\tcase csiState.parser.ground:\n\t\treturn csiState.parser.csiDispatch()\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go",
    "content": "package ansiterm\n\ntype escapeIntermediateState struct {\n\tbaseState\n}\n\nfunc (escState escapeIntermediateState) Handle(b byte) (s state, e error) {\n\tescState.parser.logf(\"escapeIntermediateState::Handle %#x\", b)\n\tnextState, err := escState.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\tswitch {\n\tcase sliceContains(intermeds, b):\n\t\treturn escState, escState.parser.collectInter()\n\tcase sliceContains(executors, b):\n\t\treturn escState, escState.parser.execute()\n\tcase sliceContains(escapeIntermediateToGroundBytes, b):\n\t\treturn escState.parser.ground, nil\n\t}\n\n\treturn escState, nil\n}\n\nfunc (escState escapeIntermediateState) Transition(s state) error {\n\tescState.parser.logf(\"escapeIntermediateState::Transition %s --> %s\", escState.Name(), s.Name())\n\tescState.baseState.Transition(s)\n\n\tswitch s {\n\tcase escState.parser.ground:\n\t\treturn escState.parser.escDispatch()\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/escape_state.go",
    "content": "package ansiterm\n\ntype escapeState struct {\n\tbaseState\n}\n\nfunc (escState escapeState) Handle(b byte) (s state, e error) {\n\tescState.parser.logf(\"escapeState::Handle %#x\", b)\n\tnextState, err := escState.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\tswitch {\n\tcase b == ANSI_ESCAPE_SECONDARY:\n\t\treturn escState.parser.csiEntry, nil\n\tcase b == ANSI_OSC_STRING_ENTRY:\n\t\treturn escState.parser.oscString, nil\n\tcase sliceContains(executors, b):\n\t\treturn escState, escState.parser.execute()\n\tcase sliceContains(escapeToGroundBytes, b):\n\t\treturn escState.parser.ground, nil\n\tcase sliceContains(intermeds, b):\n\t\treturn escState.parser.escapeIntermediate, nil\n\t}\n\n\treturn escState, nil\n}\n\nfunc (escState escapeState) Transition(s state) error {\n\tescState.parser.logf(\"Escape::Transition %s --> %s\", escState.Name(), s.Name())\n\tescState.baseState.Transition(s)\n\n\tswitch s {\n\tcase escState.parser.ground:\n\t\treturn escState.parser.escDispatch()\n\tcase escState.parser.escapeIntermediate:\n\t\treturn escState.parser.collectInter()\n\t}\n\n\treturn nil\n}\n\nfunc (escState escapeState) Enter() error {\n\tescState.parser.clear()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/event_handler.go",
    "content": "package ansiterm\n\ntype AnsiEventHandler interface {\n\t// Print\n\tPrint(b byte) error\n\n\t// Execute C0 commands\n\tExecute(b byte) error\n\n\t// CUrsor Up\n\tCUU(int) error\n\n\t// CUrsor Down\n\tCUD(int) error\n\n\t// CUrsor Forward\n\tCUF(int) error\n\n\t// CUrsor Backward\n\tCUB(int) error\n\n\t// Cursor to Next Line\n\tCNL(int) error\n\n\t// Cursor to Previous Line\n\tCPL(int) error\n\n\t// Cursor Horizontal position Absolute\n\tCHA(int) error\n\n\t// Vertical line Position Absolute\n\tVPA(int) error\n\n\t// CUrsor Position\n\tCUP(int, int) error\n\n\t// Horizontal and Vertical Position (depends on PUM)\n\tHVP(int, int) error\n\n\t// Text Cursor Enable Mode\n\tDECTCEM(bool) error\n\n\t// Origin Mode\n\tDECOM(bool) error\n\n\t// 132 Column Mode\n\tDECCOLM(bool) error\n\n\t// Erase in Display\n\tED(int) error\n\n\t// Erase in Line\n\tEL(int) error\n\n\t// Insert Line\n\tIL(int) error\n\n\t// Delete Line\n\tDL(int) error\n\n\t// Insert Character\n\tICH(int) error\n\n\t// Delete Character\n\tDCH(int) error\n\n\t// Set Graphics Rendition\n\tSGR([]int) error\n\n\t// Pan Down\n\tSU(int) error\n\n\t// Pan Up\n\tSD(int) error\n\n\t// Device Attributes\n\tDA([]string) error\n\n\t// Set Top and Bottom Margins\n\tDECSTBM(int, int) error\n\n\t// Index\n\tIND() error\n\n\t// Reverse Index\n\tRI() error\n\n\t// Flush updates from previous commands\n\tFlush() error\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/ground_state.go",
    "content": "package ansiterm\n\ntype groundState struct {\n\tbaseState\n}\n\nfunc (gs groundState) Handle(b byte) (s state, e error) {\n\tgs.parser.context.currentChar = b\n\n\tnextState, err := gs.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\tswitch {\n\tcase sliceContains(printables, b):\n\t\treturn gs, gs.parser.print()\n\n\tcase sliceContains(executors, b):\n\t\treturn gs, gs.parser.execute()\n\t}\n\n\treturn gs, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/osc_string_state.go",
    "content": "package ansiterm\n\ntype oscStringState struct {\n\tbaseState\n}\n\nfunc (oscState oscStringState) Handle(b byte) (s state, e error) {\n\toscState.parser.logf(\"OscString::Handle %#x\", b)\n\tnextState, err := oscState.baseState.Handle(b)\n\tif nextState != nil || err != nil {\n\t\treturn nextState, err\n\t}\n\n\t// There are several control characters and sequences which can\n\t// terminate an OSC string. Most of them are handled by the baseState\n\t// handler. The ANSI_BEL character is a special case which behaves as a\n\t// terminator only for an OSC string.\n\tif b == ANSI_BEL {\n\t\treturn oscState.parser.ground, nil\n\t}\n\n\treturn oscState, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/parser.go",
    "content": "package ansiterm\n\nimport (\n\t\"errors\"\n\t\"log\"\n\t\"os\"\n)\n\ntype AnsiParser struct {\n\tcurrState          state\n\teventHandler       AnsiEventHandler\n\tcontext            *ansiContext\n\tcsiEntry           state\n\tcsiParam           state\n\tdcsEntry           state\n\tescape             state\n\tescapeIntermediate state\n\terror              state\n\tground             state\n\toscString          state\n\tstateMap           []state\n\n\tlogf func(string, ...interface{})\n}\n\ntype Option func(*AnsiParser)\n\nfunc WithLogf(f func(string, ...interface{})) Option {\n\treturn func(ap *AnsiParser) {\n\t\tap.logf = f\n\t}\n}\n\nfunc CreateParser(initialState string, evtHandler AnsiEventHandler, opts ...Option) *AnsiParser {\n\tap := &AnsiParser{\n\t\teventHandler: evtHandler,\n\t\tcontext:      &ansiContext{},\n\t}\n\tfor _, o := range opts {\n\t\to(ap)\n\t}\n\n\tif isDebugEnv := os.Getenv(LogEnv); isDebugEnv == \"1\" {\n\t\tlogFile, _ := os.Create(\"ansiParser.log\")\n\t\tlogger := log.New(logFile, \"\", log.LstdFlags)\n\t\tif ap.logf != nil {\n\t\t\tl := ap.logf\n\t\t\tap.logf = func(s string, v ...interface{}) {\n\t\t\t\tl(s, v...)\n\t\t\t\tlogger.Printf(s, v...)\n\t\t\t}\n\t\t} else {\n\t\t\tap.logf = logger.Printf\n\t\t}\n\t}\n\n\tif ap.logf == nil {\n\t\tap.logf = func(string, ...interface{}) {}\n\t}\n\n\tap.csiEntry = csiEntryState{baseState{name: \"CsiEntry\", parser: ap}}\n\tap.csiParam = csiParamState{baseState{name: \"CsiParam\", parser: ap}}\n\tap.dcsEntry = dcsEntryState{baseState{name: \"DcsEntry\", parser: ap}}\n\tap.escape = escapeState{baseState{name: \"Escape\", parser: ap}}\n\tap.escapeIntermediate = escapeIntermediateState{baseState{name: \"EscapeIntermediate\", parser: ap}}\n\tap.error = errorState{baseState{name: \"Error\", parser: ap}}\n\tap.ground = groundState{baseState{name: \"Ground\", parser: ap}}\n\tap.oscString = oscStringState{baseState{name: \"OscString\", parser: ap}}\n\n\tap.stateMap = []state{\n\t\tap.csiEntry,\n\t\tap.csiParam,\n\t\tap.dcsEntry,\n\t\tap.escape,\n\t\tap.escapeIntermediate,\n\t\tap.error,\n\t\tap.ground,\n\t\tap.oscString,\n\t}\n\n\tap.currState = getState(initialState, ap.stateMap)\n\n\tap.logf(\"CreateParser: parser %p\", ap)\n\treturn ap\n}\n\nfunc getState(name string, states []state) state {\n\tfor _, el := range states {\n\t\tif el.Name() == name {\n\t\t\treturn el\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (ap *AnsiParser) Parse(bytes []byte) (int, error) {\n\tfor i, b := range bytes {\n\t\tif err := ap.handle(b); err != nil {\n\t\t\treturn i, err\n\t\t}\n\t}\n\n\treturn len(bytes), ap.eventHandler.Flush()\n}\n\nfunc (ap *AnsiParser) handle(b byte) error {\n\tap.context.currentChar = b\n\tnewState, err := ap.currState.Handle(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif newState == nil {\n\t\tap.logf(\"WARNING: newState is nil\")\n\t\treturn errors.New(\"New state of 'nil' is invalid.\")\n\t}\n\n\tif newState != ap.currState {\n\t\tif err := ap.changeState(newState); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (ap *AnsiParser) changeState(newState state) error {\n\tap.logf(\"ChangeState %s --> %s\", ap.currState.Name(), newState.Name())\n\n\t// Exit old state\n\tif err := ap.currState.Exit(); err != nil {\n\t\tap.logf(\"Exit state '%s' failed with : '%v'\", ap.currState.Name(), err)\n\t\treturn err\n\t}\n\n\t// Perform transition action\n\tif err := ap.currState.Transition(newState); err != nil {\n\t\tap.logf(\"Transition from '%s' to '%s' failed with: '%v'\", ap.currState.Name(), newState.Name, err)\n\t\treturn err\n\t}\n\n\t// Enter new state\n\tif err := newState.Enter(); err != nil {\n\t\tap.logf(\"Enter state '%s' failed with: '%v'\", newState.Name(), err)\n\t\treturn err\n\t}\n\n\tap.currState = newState\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go",
    "content": "package ansiterm\n\nimport (\n\t\"strconv\"\n)\n\nfunc parseParams(bytes []byte) ([]string, error) {\n\tparamBuff := make([]byte, 0, 0)\n\tparams := []string{}\n\n\tfor _, v := range bytes {\n\t\tif v == ';' {\n\t\t\tif len(paramBuff) > 0 {\n\t\t\t\t// Completed parameter, append it to the list\n\t\t\t\ts := string(paramBuff)\n\t\t\t\tparams = append(params, s)\n\t\t\t\tparamBuff = make([]byte, 0, 0)\n\t\t\t}\n\t\t} else {\n\t\t\tparamBuff = append(paramBuff, v)\n\t\t}\n\t}\n\n\t// Last parameter may not be terminated with ';'\n\tif len(paramBuff) > 0 {\n\t\ts := string(paramBuff)\n\t\tparams = append(params, s)\n\t}\n\n\treturn params, nil\n}\n\nfunc parseCmd(context ansiContext) (string, error) {\n\treturn string(context.currentChar), nil\n}\n\nfunc getInt(params []string, dflt int) int {\n\ti := getInts(params, 1, dflt)[0]\n\treturn i\n}\n\nfunc getInts(params []string, minCount int, dflt int) []int {\n\tints := []int{}\n\n\tfor _, v := range params {\n\t\ti, _ := strconv.Atoi(v)\n\t\t// Zero is mapped to the default value in VT100.\n\t\tif i == 0 {\n\t\t\ti = dflt\n\t\t}\n\t\tints = append(ints, i)\n\t}\n\n\tif len(ints) < minCount {\n\t\tremaining := minCount - len(ints)\n\t\tfor i := 0; i < remaining; i++ {\n\t\t\tints = append(ints, dflt)\n\t\t}\n\t}\n\n\treturn ints\n}\n\nfunc (ap *AnsiParser) modeDispatch(param string, set bool) error {\n\tswitch param {\n\tcase \"?3\":\n\t\treturn ap.eventHandler.DECCOLM(set)\n\tcase \"?6\":\n\t\treturn ap.eventHandler.DECOM(set)\n\tcase \"?25\":\n\t\treturn ap.eventHandler.DECTCEM(set)\n\t}\n\treturn nil\n}\n\nfunc (ap *AnsiParser) hDispatch(params []string) error {\n\tif len(params) == 1 {\n\t\treturn ap.modeDispatch(params[0], true)\n\t}\n\n\treturn nil\n}\n\nfunc (ap *AnsiParser) lDispatch(params []string) error {\n\tif len(params) == 1 {\n\t\treturn ap.modeDispatch(params[0], false)\n\t}\n\n\treturn nil\n}\n\nfunc getEraseParam(params []string) int {\n\tparam := getInt(params, 0)\n\tif param < 0 || 3 < param {\n\t\tparam = 0\n\t}\n\n\treturn param\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/parser_actions.go",
    "content": "package ansiterm\n\nfunc (ap *AnsiParser) collectParam() error {\n\tcurrChar := ap.context.currentChar\n\tap.logf(\"collectParam %#x\", currChar)\n\tap.context.paramBuffer = append(ap.context.paramBuffer, currChar)\n\treturn nil\n}\n\nfunc (ap *AnsiParser) collectInter() error {\n\tcurrChar := ap.context.currentChar\n\tap.logf(\"collectInter %#x\", currChar)\n\tap.context.paramBuffer = append(ap.context.interBuffer, currChar)\n\treturn nil\n}\n\nfunc (ap *AnsiParser) escDispatch() error {\n\tcmd, _ := parseCmd(*ap.context)\n\tintermeds := ap.context.interBuffer\n\tap.logf(\"escDispatch currentChar: %#x\", ap.context.currentChar)\n\tap.logf(\"escDispatch: %v(%v)\", cmd, intermeds)\n\n\tswitch cmd {\n\tcase \"D\": // IND\n\t\treturn ap.eventHandler.IND()\n\tcase \"E\": // NEL, equivalent to CRLF\n\t\terr := ap.eventHandler.Execute(ANSI_CARRIAGE_RETURN)\n\t\tif err == nil {\n\t\t\terr = ap.eventHandler.Execute(ANSI_LINE_FEED)\n\t\t}\n\t\treturn err\n\tcase \"M\": // RI\n\t\treturn ap.eventHandler.RI()\n\t}\n\n\treturn nil\n}\n\nfunc (ap *AnsiParser) csiDispatch() error {\n\tcmd, _ := parseCmd(*ap.context)\n\tparams, _ := parseParams(ap.context.paramBuffer)\n\tap.logf(\"Parsed params: %v with length: %d\", params, len(params))\n\n\tap.logf(\"csiDispatch: %v(%v)\", cmd, params)\n\n\tswitch cmd {\n\tcase \"@\":\n\t\treturn ap.eventHandler.ICH(getInt(params, 1))\n\tcase \"A\":\n\t\treturn ap.eventHandler.CUU(getInt(params, 1))\n\tcase \"B\":\n\t\treturn ap.eventHandler.CUD(getInt(params, 1))\n\tcase \"C\":\n\t\treturn ap.eventHandler.CUF(getInt(params, 1))\n\tcase \"D\":\n\t\treturn ap.eventHandler.CUB(getInt(params, 1))\n\tcase \"E\":\n\t\treturn ap.eventHandler.CNL(getInt(params, 1))\n\tcase \"F\":\n\t\treturn ap.eventHandler.CPL(getInt(params, 1))\n\tcase \"G\":\n\t\treturn ap.eventHandler.CHA(getInt(params, 1))\n\tcase \"H\":\n\t\tints := getInts(params, 2, 1)\n\t\tx, y := ints[0], ints[1]\n\t\treturn ap.eventHandler.CUP(x, y)\n\tcase \"J\":\n\t\tparam := getEraseParam(params)\n\t\treturn ap.eventHandler.ED(param)\n\tcase \"K\":\n\t\tparam := getEraseParam(params)\n\t\treturn ap.eventHandler.EL(param)\n\tcase \"L\":\n\t\treturn ap.eventHandler.IL(getInt(params, 1))\n\tcase \"M\":\n\t\treturn ap.eventHandler.DL(getInt(params, 1))\n\tcase \"P\":\n\t\treturn ap.eventHandler.DCH(getInt(params, 1))\n\tcase \"S\":\n\t\treturn ap.eventHandler.SU(getInt(params, 1))\n\tcase \"T\":\n\t\treturn ap.eventHandler.SD(getInt(params, 1))\n\tcase \"c\":\n\t\treturn ap.eventHandler.DA(params)\n\tcase \"d\":\n\t\treturn ap.eventHandler.VPA(getInt(params, 1))\n\tcase \"f\":\n\t\tints := getInts(params, 2, 1)\n\t\tx, y := ints[0], ints[1]\n\t\treturn ap.eventHandler.HVP(x, y)\n\tcase \"h\":\n\t\treturn ap.hDispatch(params)\n\tcase \"l\":\n\t\treturn ap.lDispatch(params)\n\tcase \"m\":\n\t\treturn ap.eventHandler.SGR(getInts(params, 1, 0))\n\tcase \"r\":\n\t\tints := getInts(params, 2, 1)\n\t\ttop, bottom := ints[0], ints[1]\n\t\treturn ap.eventHandler.DECSTBM(top, bottom)\n\tdefault:\n\t\tap.logf(\"ERROR: Unsupported CSI command: '%s', with full context:  %v\", cmd, ap.context)\n\t\treturn nil\n\t}\n\n}\n\nfunc (ap *AnsiParser) print() error {\n\treturn ap.eventHandler.Print(ap.context.currentChar)\n}\n\nfunc (ap *AnsiParser) clear() error {\n\tap.context = &ansiContext{}\n\treturn nil\n}\n\nfunc (ap *AnsiParser) execute() error {\n\treturn ap.eventHandler.Execute(ap.context.currentChar)\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/states.go",
    "content": "package ansiterm\n\ntype stateID int\n\ntype state interface {\n\tEnter() error\n\tExit() error\n\tHandle(byte) (state, error)\n\tName() string\n\tTransition(state) error\n}\n\ntype baseState struct {\n\tname   string\n\tparser *AnsiParser\n}\n\nfunc (base baseState) Enter() error {\n\treturn nil\n}\n\nfunc (base baseState) Exit() error {\n\treturn nil\n}\n\nfunc (base baseState) Handle(b byte) (s state, e error) {\n\n\tswitch {\n\tcase b == CSI_ENTRY:\n\t\treturn base.parser.csiEntry, nil\n\tcase b == DCS_ENTRY:\n\t\treturn base.parser.dcsEntry, nil\n\tcase b == ANSI_ESCAPE_PRIMARY:\n\t\treturn base.parser.escape, nil\n\tcase b == OSC_STRING:\n\t\treturn base.parser.oscString, nil\n\tcase sliceContains(toGroundBytes, b):\n\t\treturn base.parser.ground, nil\n\t}\n\n\treturn nil, nil\n}\n\nfunc (base baseState) Name() string {\n\treturn base.name\n}\n\nfunc (base baseState) Transition(s state) error {\n\tif s == base.parser.ground {\n\t\texecBytes := []byte{0x18}\n\t\texecBytes = append(execBytes, 0x1A)\n\t\texecBytes = append(execBytes, getByteRange(0x80, 0x8F)...)\n\t\texecBytes = append(execBytes, getByteRange(0x91, 0x97)...)\n\t\texecBytes = append(execBytes, 0x99)\n\t\texecBytes = append(execBytes, 0x9A)\n\n\t\tif sliceContains(execBytes, base.parser.context.currentChar) {\n\t\t\treturn base.parser.execute()\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype dcsEntryState struct {\n\tbaseState\n}\n\ntype errorState struct {\n\tbaseState\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/utilities.go",
    "content": "package ansiterm\n\nimport (\n\t\"strconv\"\n)\n\nfunc sliceContains(bytes []byte, b byte) bool {\n\tfor _, v := range bytes {\n\t\tif v == b {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc convertBytesToInteger(bytes []byte) int {\n\ts := string(bytes)\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/ansi.go",
    "content": "// +build windows\n\npackage winterm\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Azure/go-ansiterm\"\n\twindows \"golang.org/x/sys/windows\"\n)\n\n// Windows keyboard constants\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx.\nconst (\n\tVK_PRIOR    = 0x21 // PAGE UP key\n\tVK_NEXT     = 0x22 // PAGE DOWN key\n\tVK_END      = 0x23 // END key\n\tVK_HOME     = 0x24 // HOME key\n\tVK_LEFT     = 0x25 // LEFT ARROW key\n\tVK_UP       = 0x26 // UP ARROW key\n\tVK_RIGHT    = 0x27 // RIGHT ARROW key\n\tVK_DOWN     = 0x28 // DOWN ARROW key\n\tVK_SELECT   = 0x29 // SELECT key\n\tVK_PRINT    = 0x2A // PRINT key\n\tVK_EXECUTE  = 0x2B // EXECUTE key\n\tVK_SNAPSHOT = 0x2C // PRINT SCREEN key\n\tVK_INSERT   = 0x2D // INS key\n\tVK_DELETE   = 0x2E // DEL key\n\tVK_HELP     = 0x2F // HELP key\n\tVK_F1       = 0x70 // F1 key\n\tVK_F2       = 0x71 // F2 key\n\tVK_F3       = 0x72 // F3 key\n\tVK_F4       = 0x73 // F4 key\n\tVK_F5       = 0x74 // F5 key\n\tVK_F6       = 0x75 // F6 key\n\tVK_F7       = 0x76 // F7 key\n\tVK_F8       = 0x77 // F8 key\n\tVK_F9       = 0x78 // F9 key\n\tVK_F10      = 0x79 // F10 key\n\tVK_F11      = 0x7A // F11 key\n\tVK_F12      = 0x7B // F12 key\n\n\tRIGHT_ALT_PRESSED  = 0x0001\n\tLEFT_ALT_PRESSED   = 0x0002\n\tRIGHT_CTRL_PRESSED = 0x0004\n\tLEFT_CTRL_PRESSED  = 0x0008\n\tSHIFT_PRESSED      = 0x0010\n\tNUMLOCK_ON         = 0x0020\n\tSCROLLLOCK_ON      = 0x0040\n\tCAPSLOCK_ON        = 0x0080\n\tENHANCED_KEY       = 0x0100\n)\n\ntype ansiCommand struct {\n\tCommandBytes []byte\n\tCommand      string\n\tParameters   []string\n\tIsSpecial    bool\n}\n\nfunc newAnsiCommand(command []byte) *ansiCommand {\n\n\tif isCharacterSelectionCmdChar(command[1]) {\n\t\t// Is Character Set Selection commands\n\t\treturn &ansiCommand{\n\t\t\tCommandBytes: command,\n\t\t\tCommand:      string(command),\n\t\t\tIsSpecial:    true,\n\t\t}\n\t}\n\n\t// last char is command character\n\tlastCharIndex := len(command) - 1\n\n\tac := &ansiCommand{\n\t\tCommandBytes: command,\n\t\tCommand:      string(command[lastCharIndex]),\n\t\tIsSpecial:    false,\n\t}\n\n\t// more than a single escape\n\tif lastCharIndex != 0 {\n\t\tstart := 1\n\t\t// skip if double char escape sequence\n\t\tif command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_ESCAPE_SECONDARY {\n\t\t\tstart++\n\t\t}\n\t\t// convert this to GetNextParam method\n\t\tac.Parameters = strings.Split(string(command[start:lastCharIndex]), ansiterm.ANSI_PARAMETER_SEP)\n\t}\n\n\treturn ac\n}\n\nfunc (ac *ansiCommand) paramAsSHORT(index int, defaultValue int16) int16 {\n\tif index < 0 || index >= len(ac.Parameters) {\n\t\treturn defaultValue\n\t}\n\n\tparam, err := strconv.ParseInt(ac.Parameters[index], 10, 16)\n\tif err != nil {\n\t\treturn defaultValue\n\t}\n\n\treturn int16(param)\n}\n\nfunc (ac *ansiCommand) String() string {\n\treturn fmt.Sprintf(\"0x%v \\\"%v\\\" (\\\"%v\\\")\",\n\t\tbytesToHex(ac.CommandBytes),\n\t\tac.Command,\n\t\tstrings.Join(ac.Parameters, \"\\\",\\\"\"))\n}\n\n// isAnsiCommandChar returns true if the passed byte falls within the range of ANSI commands.\n// See http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html.\nfunc isAnsiCommandChar(b byte) bool {\n\tswitch {\n\tcase ansiterm.ANSI_COMMAND_FIRST <= b && b <= ansiterm.ANSI_COMMAND_LAST && b != ansiterm.ANSI_ESCAPE_SECONDARY:\n\t\treturn true\n\tcase b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_OSC || b == ansiterm.ANSI_CMD_DECPAM || b == ansiterm.ANSI_CMD_DECPNM:\n\t\t// non-CSI escape sequence terminator\n\t\treturn true\n\tcase b == ansiterm.ANSI_CMD_STR_TERM || b == ansiterm.ANSI_BEL:\n\t\t// String escape sequence terminator\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc isXtermOscSequence(command []byte, current byte) bool {\n\treturn (len(command) >= 2 && command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_CMD_OSC && current != ansiterm.ANSI_BEL)\n}\n\nfunc isCharacterSelectionCmdChar(b byte) bool {\n\treturn (b == ansiterm.ANSI_CMD_G0 || b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_G2 || b == ansiterm.ANSI_CMD_G3)\n}\n\n// bytesToHex converts a slice of bytes to a human-readable string.\nfunc bytesToHex(b []byte) string {\n\thex := make([]string, len(b))\n\tfor i, ch := range b {\n\t\thex[i] = fmt.Sprintf(\"%X\", ch)\n\t}\n\treturn strings.Join(hex, \"\")\n}\n\n// ensureInRange adjusts the passed value, if necessary, to ensure it is within\n// the passed min / max range.\nfunc ensureInRange(n int16, min int16, max int16) int16 {\n\tif n < min {\n\t\treturn min\n\t} else if n > max {\n\t\treturn max\n\t} else {\n\t\treturn n\n\t}\n}\n\nfunc GetStdFile(nFile int) (*os.File, uintptr) {\n\tvar file *os.File\n\n\t// syscall uses negative numbers\n\t// windows package uses very big uint32\n\t// Keep these switches split so we don't have to convert ints too much.\n\tswitch uint32(nFile) {\n\tcase windows.STD_INPUT_HANDLE:\n\t\tfile = os.Stdin\n\tcase windows.STD_OUTPUT_HANDLE:\n\t\tfile = os.Stdout\n\tcase windows.STD_ERROR_HANDLE:\n\t\tfile = os.Stderr\n\tdefault:\n\t\tswitch nFile {\n\t\tcase syscall.STD_INPUT_HANDLE:\n\t\t\tfile = os.Stdin\n\t\tcase syscall.STD_OUTPUT_HANDLE:\n\t\t\tfile = os.Stdout\n\t\tcase syscall.STD_ERROR_HANDLE:\n\t\t\tfile = os.Stderr\n\t\tdefault:\n\t\t\tpanic(fmt.Errorf(\"Invalid standard handle identifier: %v\", nFile))\n\t\t}\n\t}\n\n\tfd, err := syscall.GetStdHandle(nFile)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"Invalid standard handle identifier: %v -- %v\", nFile, err))\n\t}\n\n\treturn file, uintptr(fd)\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/api.go",
    "content": "// +build windows\n\npackage winterm\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n//===========================================================================================================\n// IMPORTANT NOTE:\n//\n//\tThe methods below make extensive use of the \"unsafe\" package to obtain the required pointers.\n//\tBeginning in Go 1.3, the garbage collector may release local variables (e.g., incoming arguments, stack\n//\tvariables) the pointers reference *before* the API completes.\n//\n//  As a result, in those cases, the code must hint that the variables remain in active by invoking the\n//\tdummy method \"use\" (see below). Newer versions of Go are planned to change the mechanism to no longer\n//\trequire unsafe pointers.\n//\n//\tIf you add or modify methods, ENSURE protection of local variables through the \"use\" builtin to inform\n//\tthe garbage collector the variables remain in use if:\n//\n//\t-- The value is not a pointer (e.g., int32, struct)\n//\t-- The value is not referenced by the method after passing the pointer to Windows\n//\n//\tSee http://golang.org/doc/go1.3.\n//===========================================================================================================\n\nvar (\n\tkernel32DLL = syscall.NewLazyDLL(\"kernel32.dll\")\n\n\tgetConsoleCursorInfoProc       = kernel32DLL.NewProc(\"GetConsoleCursorInfo\")\n\tsetConsoleCursorInfoProc       = kernel32DLL.NewProc(\"SetConsoleCursorInfo\")\n\tsetConsoleCursorPositionProc   = kernel32DLL.NewProc(\"SetConsoleCursorPosition\")\n\tsetConsoleModeProc             = kernel32DLL.NewProc(\"SetConsoleMode\")\n\tgetConsoleScreenBufferInfoProc = kernel32DLL.NewProc(\"GetConsoleScreenBufferInfo\")\n\tsetConsoleScreenBufferSizeProc = kernel32DLL.NewProc(\"SetConsoleScreenBufferSize\")\n\tscrollConsoleScreenBufferProc  = kernel32DLL.NewProc(\"ScrollConsoleScreenBufferA\")\n\tsetConsoleTextAttributeProc    = kernel32DLL.NewProc(\"SetConsoleTextAttribute\")\n\tsetConsoleWindowInfoProc       = kernel32DLL.NewProc(\"SetConsoleWindowInfo\")\n\twriteConsoleOutputProc         = kernel32DLL.NewProc(\"WriteConsoleOutputW\")\n\treadConsoleInputProc           = kernel32DLL.NewProc(\"ReadConsoleInputW\")\n\twaitForSingleObjectProc        = kernel32DLL.NewProc(\"WaitForSingleObject\")\n)\n\n// Windows Console constants\nconst (\n\t// Console modes\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx.\n\tENABLE_PROCESSED_INPUT        = 0x0001\n\tENABLE_LINE_INPUT             = 0x0002\n\tENABLE_ECHO_INPUT             = 0x0004\n\tENABLE_WINDOW_INPUT           = 0x0008\n\tENABLE_MOUSE_INPUT            = 0x0010\n\tENABLE_INSERT_MODE            = 0x0020\n\tENABLE_QUICK_EDIT_MODE        = 0x0040\n\tENABLE_EXTENDED_FLAGS         = 0x0080\n\tENABLE_AUTO_POSITION          = 0x0100\n\tENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200\n\n\tENABLE_PROCESSED_OUTPUT            = 0x0001\n\tENABLE_WRAP_AT_EOL_OUTPUT          = 0x0002\n\tENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004\n\tDISABLE_NEWLINE_AUTO_RETURN        = 0x0008\n\tENABLE_LVB_GRID_WORLDWIDE          = 0x0010\n\n\t// Character attributes\n\t// Note:\n\t// -- The attributes are combined to produce various colors (e.g., Blue + Green will create Cyan).\n\t//    Clearing all foreground or background colors results in black; setting all creates white.\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes.\n\tFOREGROUND_BLUE      uint16 = 0x0001\n\tFOREGROUND_GREEN     uint16 = 0x0002\n\tFOREGROUND_RED       uint16 = 0x0004\n\tFOREGROUND_INTENSITY uint16 = 0x0008\n\tFOREGROUND_MASK      uint16 = 0x000F\n\n\tBACKGROUND_BLUE      uint16 = 0x0010\n\tBACKGROUND_GREEN     uint16 = 0x0020\n\tBACKGROUND_RED       uint16 = 0x0040\n\tBACKGROUND_INTENSITY uint16 = 0x0080\n\tBACKGROUND_MASK      uint16 = 0x00F0\n\n\tCOMMON_LVB_MASK          uint16 = 0xFF00\n\tCOMMON_LVB_REVERSE_VIDEO uint16 = 0x4000\n\tCOMMON_LVB_UNDERSCORE    uint16 = 0x8000\n\n\t// Input event types\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx.\n\tKEY_EVENT                = 0x0001\n\tMOUSE_EVENT              = 0x0002\n\tWINDOW_BUFFER_SIZE_EVENT = 0x0004\n\tMENU_EVENT               = 0x0008\n\tFOCUS_EVENT              = 0x0010\n\n\t// WaitForSingleObject return codes\n\tWAIT_ABANDONED = 0x00000080\n\tWAIT_FAILED    = 0xFFFFFFFF\n\tWAIT_SIGNALED  = 0x0000000\n\tWAIT_TIMEOUT   = 0x00000102\n\n\t// WaitForSingleObject wait duration\n\tWAIT_INFINITE       = 0xFFFFFFFF\n\tWAIT_ONE_SECOND     = 1000\n\tWAIT_HALF_SECOND    = 500\n\tWAIT_QUARTER_SECOND = 250\n)\n\n// Windows API Console types\n// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682101(v=vs.85).aspx for Console specific types (e.g., COORD)\n// -- See https://msdn.microsoft.com/en-us/library/aa296569(v=vs.60).aspx for comments on alignment\ntype (\n\tCHAR_INFO struct {\n\t\tUnicodeChar uint16\n\t\tAttributes  uint16\n\t}\n\n\tCONSOLE_CURSOR_INFO struct {\n\t\tSize    uint32\n\t\tVisible int32\n\t}\n\n\tCONSOLE_SCREEN_BUFFER_INFO struct {\n\t\tSize              COORD\n\t\tCursorPosition    COORD\n\t\tAttributes        uint16\n\t\tWindow            SMALL_RECT\n\t\tMaximumWindowSize COORD\n\t}\n\n\tCOORD struct {\n\t\tX int16\n\t\tY int16\n\t}\n\n\tSMALL_RECT struct {\n\t\tLeft   int16\n\t\tTop    int16\n\t\tRight  int16\n\t\tBottom int16\n\t}\n\n\t// INPUT_RECORD is a C/C++ union of which KEY_EVENT_RECORD is one case, it is also the largest\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx.\n\tINPUT_RECORD struct {\n\t\tEventType uint16\n\t\tKeyEvent  KEY_EVENT_RECORD\n\t}\n\n\tKEY_EVENT_RECORD struct {\n\t\tKeyDown         int32\n\t\tRepeatCount     uint16\n\t\tVirtualKeyCode  uint16\n\t\tVirtualScanCode uint16\n\t\tUnicodeChar     uint16\n\t\tControlKeyState uint32\n\t}\n\n\tWINDOW_BUFFER_SIZE struct {\n\t\tSize COORD\n\t}\n)\n\n// boolToBOOL converts a Go bool into a Windows int32.\nfunc boolToBOOL(f bool) int32 {\n\tif f {\n\t\treturn int32(1)\n\t} else {\n\t\treturn int32(0)\n\t}\n}\n\n// GetConsoleCursorInfo retrieves information about the size and visiblity of the console cursor.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683163(v=vs.85).aspx.\nfunc GetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error {\n\tr1, r2, err := getConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)\n\treturn checkError(r1, r2, err)\n}\n\n// SetConsoleCursorInfo sets the size and visiblity of the console cursor.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx.\nfunc SetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error {\n\tr1, r2, err := setConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)\n\treturn checkError(r1, r2, err)\n}\n\n// SetConsoleCursorPosition location of the console cursor.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686025(v=vs.85).aspx.\nfunc SetConsoleCursorPosition(handle uintptr, coord COORD) error {\n\tr1, r2, err := setConsoleCursorPositionProc.Call(handle, coordToPointer(coord))\n\tuse(coord)\n\treturn checkError(r1, r2, err)\n}\n\n// GetConsoleMode gets the console mode for given file descriptor\n// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx.\nfunc GetConsoleMode(handle uintptr) (mode uint32, err error) {\n\terr = syscall.GetConsoleMode(syscall.Handle(handle), &mode)\n\treturn mode, err\n}\n\n// SetConsoleMode sets the console mode for given file descriptor\n// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx.\nfunc SetConsoleMode(handle uintptr, mode uint32) error {\n\tr1, r2, err := setConsoleModeProc.Call(handle, uintptr(mode), 0)\n\tuse(mode)\n\treturn checkError(r1, r2, err)\n}\n\n// GetConsoleScreenBufferInfo retrieves information about the specified console screen buffer.\n// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx.\nfunc GetConsoleScreenBufferInfo(handle uintptr) (*CONSOLE_SCREEN_BUFFER_INFO, error) {\n\tinfo := CONSOLE_SCREEN_BUFFER_INFO{}\n\terr := checkError(getConsoleScreenBufferInfoProc.Call(handle, uintptr(unsafe.Pointer(&info)), 0))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &info, nil\n}\n\nfunc ScrollConsoleScreenBuffer(handle uintptr, scrollRect SMALL_RECT, clipRect SMALL_RECT, destOrigin COORD, char CHAR_INFO) error {\n\tr1, r2, err := scrollConsoleScreenBufferProc.Call(handle, uintptr(unsafe.Pointer(&scrollRect)), uintptr(unsafe.Pointer(&clipRect)), coordToPointer(destOrigin), uintptr(unsafe.Pointer(&char)))\n\tuse(scrollRect)\n\tuse(clipRect)\n\tuse(destOrigin)\n\tuse(char)\n\treturn checkError(r1, r2, err)\n}\n\n// SetConsoleScreenBufferSize sets the size of the console screen buffer.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686044(v=vs.85).aspx.\nfunc SetConsoleScreenBufferSize(handle uintptr, coord COORD) error {\n\tr1, r2, err := setConsoleScreenBufferSizeProc.Call(handle, coordToPointer(coord))\n\tuse(coord)\n\treturn checkError(r1, r2, err)\n}\n\n// SetConsoleTextAttribute sets the attributes of characters written to the\n// console screen buffer by the WriteFile or WriteConsole function.\n// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx.\nfunc SetConsoleTextAttribute(handle uintptr, attribute uint16) error {\n\tr1, r2, err := setConsoleTextAttributeProc.Call(handle, uintptr(attribute), 0)\n\tuse(attribute)\n\treturn checkError(r1, r2, err)\n}\n\n// SetConsoleWindowInfo sets the size and position of the console screen buffer's window.\n// Note that the size and location must be within and no larger than the backing console screen buffer.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686125(v=vs.85).aspx.\nfunc SetConsoleWindowInfo(handle uintptr, isAbsolute bool, rect SMALL_RECT) error {\n\tr1, r2, err := setConsoleWindowInfoProc.Call(handle, uintptr(boolToBOOL(isAbsolute)), uintptr(unsafe.Pointer(&rect)))\n\tuse(isAbsolute)\n\tuse(rect)\n\treturn checkError(r1, r2, err)\n}\n\n// WriteConsoleOutput writes the CHAR_INFOs from the provided buffer to the active console buffer.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687404(v=vs.85).aspx.\nfunc WriteConsoleOutput(handle uintptr, buffer []CHAR_INFO, bufferSize COORD, bufferCoord COORD, writeRegion *SMALL_RECT) error {\n\tr1, r2, err := writeConsoleOutputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), coordToPointer(bufferSize), coordToPointer(bufferCoord), uintptr(unsafe.Pointer(writeRegion)))\n\tuse(buffer)\n\tuse(bufferSize)\n\tuse(bufferCoord)\n\treturn checkError(r1, r2, err)\n}\n\n// ReadConsoleInput reads (and removes) data from the console input buffer.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms684961(v=vs.85).aspx.\nfunc ReadConsoleInput(handle uintptr, buffer []INPUT_RECORD, count *uint32) error {\n\tr1, r2, err := readConsoleInputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), uintptr(len(buffer)), uintptr(unsafe.Pointer(count)))\n\tuse(buffer)\n\treturn checkError(r1, r2, err)\n}\n\n// WaitForSingleObject waits for the passed handle to be signaled.\n// It returns true if the handle was signaled; false otherwise.\n// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx.\nfunc WaitForSingleObject(handle uintptr, msWait uint32) (bool, error) {\n\tr1, _, err := waitForSingleObjectProc.Call(handle, uintptr(uint32(msWait)))\n\tswitch r1 {\n\tcase WAIT_ABANDONED, WAIT_TIMEOUT:\n\t\treturn false, nil\n\tcase WAIT_SIGNALED:\n\t\treturn true, nil\n\t}\n\tuse(msWait)\n\treturn false, err\n}\n\n// String helpers\nfunc (info CONSOLE_SCREEN_BUFFER_INFO) String() string {\n\treturn fmt.Sprintf(\"Size(%v) Cursor(%v) Window(%v) Max(%v)\", info.Size, info.CursorPosition, info.Window, info.MaximumWindowSize)\n}\n\nfunc (coord COORD) String() string {\n\treturn fmt.Sprintf(\"%v,%v\", coord.X, coord.Y)\n}\n\nfunc (rect SMALL_RECT) String() string {\n\treturn fmt.Sprintf(\"(%v,%v),(%v,%v)\", rect.Left, rect.Top, rect.Right, rect.Bottom)\n}\n\n// checkError evaluates the results of a Windows API call and returns the error if it failed.\nfunc checkError(r1, r2 uintptr, err error) error {\n\t// Windows APIs return non-zero to indicate success\n\tif r1 != 0 {\n\t\treturn nil\n\t}\n\n\t// Return the error if provided, otherwise default to EINVAL\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn syscall.EINVAL\n}\n\n// coordToPointer converts a COORD into a uintptr (by fooling the type system).\nfunc coordToPointer(c COORD) uintptr {\n\t// Note: This code assumes the two SHORTs are correctly laid out; the \"cast\" to uint32 is just to get a pointer to pass.\n\treturn uintptr(*((*uint32)(unsafe.Pointer(&c))))\n}\n\n// use is a no-op, but the compiler cannot see that it is.\n// Calling use(p) ensures that p is kept live until that point.\nfunc use(p interface{}) {}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go",
    "content": "// +build windows\n\npackage winterm\n\nimport \"github.com/Azure/go-ansiterm\"\n\nconst (\n\tFOREGROUND_COLOR_MASK = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE\n\tBACKGROUND_COLOR_MASK = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE\n)\n\n// collectAnsiIntoWindowsAttributes modifies the passed Windows text mode flags to reflect the\n// request represented by the passed ANSI mode.\nfunc collectAnsiIntoWindowsAttributes(windowsMode uint16, inverted bool, baseMode uint16, ansiMode int16) (uint16, bool) {\n\tswitch ansiMode {\n\n\t// Mode styles\n\tcase ansiterm.ANSI_SGR_BOLD:\n\t\twindowsMode = windowsMode | FOREGROUND_INTENSITY\n\n\tcase ansiterm.ANSI_SGR_DIM, ansiterm.ANSI_SGR_BOLD_DIM_OFF:\n\t\twindowsMode &^= FOREGROUND_INTENSITY\n\n\tcase ansiterm.ANSI_SGR_UNDERLINE:\n\t\twindowsMode = windowsMode | COMMON_LVB_UNDERSCORE\n\n\tcase ansiterm.ANSI_SGR_REVERSE:\n\t\tinverted = true\n\n\tcase ansiterm.ANSI_SGR_REVERSE_OFF:\n\t\tinverted = false\n\n\tcase ansiterm.ANSI_SGR_UNDERLINE_OFF:\n\t\twindowsMode &^= COMMON_LVB_UNDERSCORE\n\n\t\t// Foreground colors\n\tcase ansiterm.ANSI_SGR_FOREGROUND_DEFAULT:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_MASK) | (baseMode & FOREGROUND_MASK)\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_BLACK:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK)\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_RED:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_GREEN:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_YELLOW:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_BLUE:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_MAGENTA:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_CYAN:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN | FOREGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_FOREGROUND_WHITE:\n\t\twindowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE\n\n\t\t// Background colors\n\tcase ansiterm.ANSI_SGR_BACKGROUND_DEFAULT:\n\t\t// Black with no intensity\n\t\twindowsMode = (windowsMode &^ BACKGROUND_MASK) | (baseMode & BACKGROUND_MASK)\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_BLACK:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK)\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_RED:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_GREEN:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_YELLOW:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_BLUE:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_MAGENTA:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_CYAN:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN | BACKGROUND_BLUE\n\n\tcase ansiterm.ANSI_SGR_BACKGROUND_WHITE:\n\t\twindowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE\n\t}\n\n\treturn windowsMode, inverted\n}\n\n// invertAttributes inverts the foreground and background colors of a Windows attributes value\nfunc invertAttributes(windowsMode uint16) uint16 {\n\treturn (COMMON_LVB_MASK & windowsMode) | ((FOREGROUND_MASK & windowsMode) << 4) | ((BACKGROUND_MASK & windowsMode) >> 4)\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go",
    "content": "// +build windows\n\npackage winterm\n\nconst (\n\thorizontal = iota\n\tvertical\n)\n\nfunc (h *windowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_INFO) SMALL_RECT {\n\tif h.originMode {\n\t\tsr := h.effectiveSr(info.Window)\n\t\treturn SMALL_RECT{\n\t\t\tTop:    sr.top,\n\t\t\tBottom: sr.bottom,\n\t\t\tLeft:   0,\n\t\t\tRight:  info.Size.X - 1,\n\t\t}\n\t} else {\n\t\treturn SMALL_RECT{\n\t\t\tTop:    info.Window.Top,\n\t\t\tBottom: info.Window.Bottom,\n\t\t\tLeft:   0,\n\t\t\tRight:  info.Size.X - 1,\n\t\t}\n\t}\n}\n\n// setCursorPosition sets the cursor to the specified position, bounded to the screen size\nfunc (h *windowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL_RECT) error {\n\tposition.X = ensureInRange(position.X, window.Left, window.Right)\n\tposition.Y = ensureInRange(position.Y, window.Top, window.Bottom)\n\terr := SetConsoleCursorPosition(h.fd, position)\n\tif err != nil {\n\t\treturn err\n\t}\n\th.logf(\"Cursor position set: (%d, %d)\", position.X, position.Y)\n\treturn err\n}\n\nfunc (h *windowsAnsiEventHandler) moveCursorVertical(param int) error {\n\treturn h.moveCursor(vertical, param)\n}\n\nfunc (h *windowsAnsiEventHandler) moveCursorHorizontal(param int) error {\n\treturn h.moveCursor(horizontal, param)\n}\n\nfunc (h *windowsAnsiEventHandler) moveCursor(moveMode int, param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tposition := info.CursorPosition\n\tswitch moveMode {\n\tcase horizontal:\n\t\tposition.X += int16(param)\n\tcase vertical:\n\t\tposition.Y += int16(param)\n\t}\n\n\tif err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) moveCursorLine(param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tposition := info.CursorPosition\n\tposition.X = 0\n\tposition.Y += int16(param)\n\n\tif err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) moveCursorColumn(param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tposition := info.CursorPosition\n\tposition.X = int16(param) - 1\n\n\tif err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go",
    "content": "// +build windows\n\npackage winterm\n\nimport \"github.com/Azure/go-ansiterm\"\n\nfunc (h *windowsAnsiEventHandler) clearRange(attributes uint16, fromCoord COORD, toCoord COORD) error {\n\t// Ignore an invalid (negative area) request\n\tif toCoord.Y < fromCoord.Y {\n\t\treturn nil\n\t}\n\n\tvar err error\n\n\tvar coordStart = COORD{}\n\tvar coordEnd = COORD{}\n\n\txCurrent, yCurrent := fromCoord.X, fromCoord.Y\n\txEnd, yEnd := toCoord.X, toCoord.Y\n\n\t// Clear any partial initial line\n\tif xCurrent > 0 {\n\t\tcoordStart.X, coordStart.Y = xCurrent, yCurrent\n\t\tcoordEnd.X, coordEnd.Y = xEnd, yCurrent\n\n\t\terr = h.clearRect(attributes, coordStart, coordEnd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\txCurrent = 0\n\t\tyCurrent += 1\n\t}\n\n\t// Clear intervening rectangular section\n\tif yCurrent < yEnd {\n\t\tcoordStart.X, coordStart.Y = xCurrent, yCurrent\n\t\tcoordEnd.X, coordEnd.Y = xEnd, yEnd-1\n\n\t\terr = h.clearRect(attributes, coordStart, coordEnd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\txCurrent = 0\n\t\tyCurrent = yEnd\n\t}\n\n\t// Clear remaining partial ending line\n\tcoordStart.X, coordStart.Y = xCurrent, yCurrent\n\tcoordEnd.X, coordEnd.Y = xEnd, yEnd\n\n\terr = h.clearRect(attributes, coordStart, coordEnd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) clearRect(attributes uint16, fromCoord COORD, toCoord COORD) error {\n\tregion := SMALL_RECT{Top: fromCoord.Y, Left: fromCoord.X, Bottom: toCoord.Y, Right: toCoord.X}\n\twidth := toCoord.X - fromCoord.X + 1\n\theight := toCoord.Y - fromCoord.Y + 1\n\tsize := uint32(width) * uint32(height)\n\n\tif size <= 0 {\n\t\treturn nil\n\t}\n\n\tbuffer := make([]CHAR_INFO, size)\n\n\tchar := CHAR_INFO{ansiterm.FILL_CHARACTER, attributes}\n\tfor i := 0; i < int(size); i++ {\n\t\tbuffer[i] = char\n\t}\n\n\terr := WriteConsoleOutput(h.fd, buffer, COORD{X: width, Y: height}, COORD{X: 0, Y: 0}, &region)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go",
    "content": "// +build windows\n\npackage winterm\n\n// effectiveSr gets the current effective scroll region in buffer coordinates\nfunc (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion {\n\ttop := addInRange(window.Top, h.sr.top, window.Top, window.Bottom)\n\tbottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom)\n\tif top >= bottom {\n\t\ttop = window.Top\n\t\tbottom = window.Bottom\n\t}\n\treturn scrollRegion{top: top, bottom: bottom}\n}\n\nfunc (h *windowsAnsiEventHandler) scrollUp(param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsr := h.effectiveSr(info.Window)\n\treturn h.scroll(param, sr, info)\n}\n\nfunc (h *windowsAnsiEventHandler) scrollDown(param int) error {\n\treturn h.scrollUp(-param)\n}\n\nfunc (h *windowsAnsiEventHandler) deleteLines(param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstart := info.CursorPosition.Y\n\tsr := h.effectiveSr(info.Window)\n\t// Lines cannot be inserted or deleted outside the scrolling region.\n\tif start >= sr.top && start <= sr.bottom {\n\t\tsr.top = start\n\t\treturn h.scroll(param, sr, info)\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc (h *windowsAnsiEventHandler) insertLines(param int) error {\n\treturn h.deleteLines(-param)\n}\n\n// scroll scrolls the provided scroll region by param lines. The scroll region is in buffer coordinates.\nfunc (h *windowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSOLE_SCREEN_BUFFER_INFO) error {\n\th.logf(\"scroll: scrollTop: %d, scrollBottom: %d\", sr.top, sr.bottom)\n\th.logf(\"scroll: windowTop: %d, windowBottom: %d\", info.Window.Top, info.Window.Bottom)\n\n\t// Copy from and clip to the scroll region (full buffer width)\n\tscrollRect := SMALL_RECT{\n\t\tTop:    sr.top,\n\t\tBottom: sr.bottom,\n\t\tLeft:   0,\n\t\tRight:  info.Size.X - 1,\n\t}\n\n\t// Origin to which area should be copied\n\tdestOrigin := COORD{\n\t\tX: 0,\n\t\tY: sr.top - int16(param),\n\t}\n\n\tchar := CHAR_INFO{\n\t\tUnicodeChar: ' ',\n\t\tAttributes:  h.attributes,\n\t}\n\n\tif err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) deleteCharacters(param int) error {\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn h.scrollLine(param, info.CursorPosition, info)\n}\n\nfunc (h *windowsAnsiEventHandler) insertCharacters(param int) error {\n\treturn h.deleteCharacters(-param)\n}\n\n// scrollLine scrolls a line horizontally starting at the provided position by a number of columns.\nfunc (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error {\n\t// Copy from and clip to the scroll region (full buffer width)\n\tscrollRect := SMALL_RECT{\n\t\tTop:    position.Y,\n\t\tBottom: position.Y,\n\t\tLeft:   position.X,\n\t\tRight:  info.Size.X - 1,\n\t}\n\n\t// Origin to which area should be copied\n\tdestOrigin := COORD{\n\t\tX: position.X - int16(columns),\n\t\tY: position.Y,\n\t}\n\n\tchar := CHAR_INFO{\n\t\tUnicodeChar: ' ',\n\t\tAttributes:  h.attributes,\n\t}\n\n\tif err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/utilities.go",
    "content": "// +build windows\n\npackage winterm\n\n// AddInRange increments a value by the passed quantity while ensuring the values\n// always remain within the supplied min / max range.\nfunc addInRange(n int16, increment int16, min int16, max int16) int16 {\n\treturn ensureInRange(n+increment, min, max)\n}\n"
  },
  {
    "path": "vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go",
    "content": "// +build windows\n\npackage winterm\n\nimport (\n\t\"bytes\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/Azure/go-ansiterm\"\n)\n\ntype windowsAnsiEventHandler struct {\n\tfd             uintptr\n\tfile           *os.File\n\tinfoReset      *CONSOLE_SCREEN_BUFFER_INFO\n\tsr             scrollRegion\n\tbuffer         bytes.Buffer\n\tattributes     uint16\n\tinverted       bool\n\twrapNext       bool\n\tdrewMarginByte bool\n\toriginMode     bool\n\tmarginByte     byte\n\tcurInfo        *CONSOLE_SCREEN_BUFFER_INFO\n\tcurPos         COORD\n\tlogf           func(string, ...interface{})\n}\n\ntype Option func(*windowsAnsiEventHandler)\n\nfunc WithLogf(f func(string, ...interface{})) Option {\n\treturn func(w *windowsAnsiEventHandler) {\n\t\tw.logf = f\n\t}\n}\n\nfunc CreateWinEventHandler(fd uintptr, file *os.File, opts ...Option) ansiterm.AnsiEventHandler {\n\tinfoReset, err := GetConsoleScreenBufferInfo(fd)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\th := &windowsAnsiEventHandler{\n\t\tfd:         fd,\n\t\tfile:       file,\n\t\tinfoReset:  infoReset,\n\t\tattributes: infoReset.Attributes,\n\t}\n\tfor _, o := range opts {\n\t\to(h)\n\t}\n\n\tif isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == \"1\" {\n\t\tlogFile, _ := os.Create(\"winEventHandler.log\")\n\t\tlogger := log.New(logFile, \"\", log.LstdFlags)\n\t\tif h.logf != nil {\n\t\t\tl := h.logf\n\t\t\th.logf = func(s string, v ...interface{}) {\n\t\t\t\tl(s, v...)\n\t\t\t\tlogger.Printf(s, v...)\n\t\t\t}\n\t\t} else {\n\t\t\th.logf = logger.Printf\n\t\t}\n\t}\n\n\tif h.logf == nil {\n\t\th.logf = func(string, ...interface{}) {}\n\t}\n\n\treturn h\n}\n\ntype scrollRegion struct {\n\ttop    int16\n\tbottom int16\n}\n\n// simulateLF simulates a LF or CR+LF by scrolling if necessary to handle the\n// current cursor position and scroll region settings, in which case it returns\n// true. If no special handling is necessary, then it does nothing and returns\n// false.\n//\n// In the false case, the caller should ensure that a carriage return\n// and line feed are inserted or that the text is otherwise wrapped.\nfunc (h *windowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) {\n\tif h.wrapNext {\n\t\tif err := h.Flush(); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\th.clearWrap()\n\t}\n\tpos, info, err := h.getCurrentInfo()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tsr := h.effectiveSr(info.Window)\n\tif pos.Y == sr.bottom {\n\t\t// Scrolling is necessary. Let Windows automatically scroll if the scrolling region\n\t\t// is the full window.\n\t\tif sr.top == info.Window.Top && sr.bottom == info.Window.Bottom {\n\t\t\tif includeCR {\n\t\t\t\tpos.X = 0\n\t\t\t\th.updatePos(pos)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\n\t\t// A custom scroll region is active. Scroll the window manually to simulate\n\t\t// the LF.\n\t\tif err := h.Flush(); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\th.logf(\"Simulating LF inside scroll region\")\n\t\tif err := h.scrollUp(1); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif includeCR {\n\t\t\tpos.X = 0\n\t\t\tif err := SetConsoleCursorPosition(h.fd, pos); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t\treturn true, nil\n\n\t} else if pos.Y < info.Window.Bottom {\n\t\t// Let Windows handle the LF.\n\t\tpos.Y++\n\t\tif includeCR {\n\t\t\tpos.X = 0\n\t\t}\n\t\th.updatePos(pos)\n\t\treturn false, nil\n\t} else {\n\t\t// The cursor is at the bottom of the screen but outside the scroll\n\t\t// region. Skip the LF.\n\t\th.logf(\"Simulating LF outside scroll region\")\n\t\tif includeCR {\n\t\t\tif err := h.Flush(); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tpos.X = 0\n\t\t\tif err := SetConsoleCursorPosition(h.fd, pos); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t\treturn true, nil\n\t}\n}\n\n// executeLF executes a LF without a CR.\nfunc (h *windowsAnsiEventHandler) executeLF() error {\n\thandled, err := h.simulateLF(false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !handled {\n\t\t// Windows LF will reset the cursor column position. Write the LF\n\t\t// and restore the cursor position.\n\t\tpos, _, err := h.getCurrentInfo()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\th.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)\n\t\tif pos.X != 0 {\n\t\t\tif err := h.Flush(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\th.logf(\"Resetting cursor position for LF without CR\")\n\t\t\tif err := SetConsoleCursorPosition(h.fd, pos); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) Print(b byte) error {\n\tif h.wrapNext {\n\t\th.buffer.WriteByte(h.marginByte)\n\t\th.clearWrap()\n\t\tif _, err := h.simulateLF(true); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tpos, info, err := h.getCurrentInfo()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif pos.X == info.Size.X-1 {\n\t\th.wrapNext = true\n\t\th.marginByte = b\n\t} else {\n\t\tpos.X++\n\t\th.updatePos(pos)\n\t\th.buffer.WriteByte(b)\n\t}\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) Execute(b byte) error {\n\tswitch b {\n\tcase ansiterm.ANSI_TAB:\n\t\th.logf(\"Execute(TAB)\")\n\t\t// Move to the next tab stop, but preserve auto-wrap if already set.\n\t\tif !h.wrapNext {\n\t\t\tpos, info, err := h.getCurrentInfo()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpos.X = (pos.X + 8) - pos.X%8\n\t\t\tif pos.X >= info.Size.X {\n\t\t\t\tpos.X = info.Size.X - 1\n\t\t\t}\n\t\t\tif err := h.Flush(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := SetConsoleCursorPosition(h.fd, pos); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\n\tcase ansiterm.ANSI_BEL:\n\t\th.buffer.WriteByte(ansiterm.ANSI_BEL)\n\t\treturn nil\n\n\tcase ansiterm.ANSI_BACKSPACE:\n\t\tif h.wrapNext {\n\t\t\tif err := h.Flush(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\th.clearWrap()\n\t\t}\n\t\tpos, _, err := h.getCurrentInfo()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif pos.X > 0 {\n\t\t\tpos.X--\n\t\t\th.updatePos(pos)\n\t\t\th.buffer.WriteByte(ansiterm.ANSI_BACKSPACE)\n\t\t}\n\t\treturn nil\n\n\tcase ansiterm.ANSI_VERTICAL_TAB, ansiterm.ANSI_FORM_FEED:\n\t\t// Treat as true LF.\n\t\treturn h.executeLF()\n\n\tcase ansiterm.ANSI_LINE_FEED:\n\t\t// Simulate a CR and LF for now since there is no way in go-ansiterm\n\t\t// to tell if the LF should include CR (and more things break when it's\n\t\t// missing than when it's incorrectly added).\n\t\thandled, err := h.simulateLF(true)\n\t\tif handled || err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)\n\n\tcase ansiterm.ANSI_CARRIAGE_RETURN:\n\t\tif h.wrapNext {\n\t\t\tif err := h.Flush(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\th.clearWrap()\n\t\t}\n\t\tpos, _, err := h.getCurrentInfo()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif pos.X != 0 {\n\t\t\tpos.X = 0\n\t\t\th.updatePos(pos)\n\t\t\th.buffer.WriteByte(ansiterm.ANSI_CARRIAGE_RETURN)\n\t\t}\n\t\treturn nil\n\n\tdefault:\n\t\treturn nil\n\t}\n}\n\nfunc (h *windowsAnsiEventHandler) CUU(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CUU: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorVertical(-param)\n}\n\nfunc (h *windowsAnsiEventHandler) CUD(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CUD: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorVertical(param)\n}\n\nfunc (h *windowsAnsiEventHandler) CUF(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CUF: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorHorizontal(param)\n}\n\nfunc (h *windowsAnsiEventHandler) CUB(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CUB: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorHorizontal(-param)\n}\n\nfunc (h *windowsAnsiEventHandler) CNL(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CNL: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorLine(param)\n}\n\nfunc (h *windowsAnsiEventHandler) CPL(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CPL: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorLine(-param)\n}\n\nfunc (h *windowsAnsiEventHandler) CHA(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CHA: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.moveCursorColumn(param)\n}\n\nfunc (h *windowsAnsiEventHandler) VPA(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"VPA: [[%d]]\", param)\n\th.clearWrap()\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\twindow := h.getCursorWindow(info)\n\tposition := info.CursorPosition\n\tposition.Y = window.Top + int16(param) - 1\n\treturn h.setCursorPosition(position, window)\n}\n\nfunc (h *windowsAnsiEventHandler) CUP(row int, col int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"CUP: [[%d %d]]\", row, col)\n\th.clearWrap()\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twindow := h.getCursorWindow(info)\n\tposition := COORD{window.Left + int16(col) - 1, window.Top + int16(row) - 1}\n\treturn h.setCursorPosition(position, window)\n}\n\nfunc (h *windowsAnsiEventHandler) HVP(row int, col int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"HVP: [[%d %d]]\", row, col)\n\th.clearWrap()\n\treturn h.CUP(row, col)\n}\n\nfunc (h *windowsAnsiEventHandler) DECTCEM(visible bool) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DECTCEM: [%v]\", []string{strconv.FormatBool(visible)})\n\th.clearWrap()\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) DECOM(enable bool) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DECOM: [%v]\", []string{strconv.FormatBool(enable)})\n\th.clearWrap()\n\th.originMode = enable\n\treturn h.CUP(1, 1)\n}\n\nfunc (h *windowsAnsiEventHandler) DECCOLM(use132 bool) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DECCOLM: [%v]\", []string{strconv.FormatBool(use132)})\n\th.clearWrap()\n\tif err := h.ED(2); err != nil {\n\t\treturn err\n\t}\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttargetWidth := int16(80)\n\tif use132 {\n\t\ttargetWidth = 132\n\t}\n\tif info.Size.X < targetWidth {\n\t\tif err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil {\n\t\t\th.logf(\"set buffer failed: %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\twindow := info.Window\n\twindow.Left = 0\n\twindow.Right = targetWidth - 1\n\tif err := SetConsoleWindowInfo(h.fd, true, window); err != nil {\n\t\th.logf(\"set window failed: %v\", err)\n\t\treturn err\n\t}\n\tif info.Size.X > targetWidth {\n\t\tif err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil {\n\t\t\th.logf(\"set buffer failed: %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\treturn SetConsoleCursorPosition(h.fd, COORD{0, 0})\n}\n\nfunc (h *windowsAnsiEventHandler) ED(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"ED: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\n\t// [J  -- Erases from the cursor to the end of the screen, including the cursor position.\n\t// [1J -- Erases from the beginning of the screen to the cursor, including the cursor position.\n\t// [2J -- Erases the complete display. The cursor does not move.\n\t// Notes:\n\t// -- Clearing the entire buffer, versus just the Window, works best for Windows Consoles\n\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar start COORD\n\tvar end COORD\n\n\tswitch param {\n\tcase 0:\n\t\tstart = info.CursorPosition\n\t\tend = COORD{info.Size.X - 1, info.Size.Y - 1}\n\n\tcase 1:\n\t\tstart = COORD{0, 0}\n\t\tend = info.CursorPosition\n\n\tcase 2:\n\t\tstart = COORD{0, 0}\n\t\tend = COORD{info.Size.X - 1, info.Size.Y - 1}\n\t}\n\n\terr = h.clearRange(h.attributes, start, end)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If the whole buffer was cleared, move the window to the top while preserving\n\t// the window-relative cursor position.\n\tif param == 2 {\n\t\tpos := info.CursorPosition\n\t\twindow := info.Window\n\t\tpos.Y -= window.Top\n\t\twindow.Bottom -= window.Top\n\t\twindow.Top = 0\n\t\tif err := SetConsoleCursorPosition(h.fd, pos); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := SetConsoleWindowInfo(h.fd, true, window); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) EL(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"EL: [%v]\", strconv.Itoa(param))\n\th.clearWrap()\n\n\t// [K  -- Erases from the cursor to the end of the line, including the cursor position.\n\t// [1K -- Erases from the beginning of the line to the cursor, including the cursor position.\n\t// [2K -- Erases the complete line.\n\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar start COORD\n\tvar end COORD\n\n\tswitch param {\n\tcase 0:\n\t\tstart = info.CursorPosition\n\t\tend = COORD{info.Size.X, info.CursorPosition.Y}\n\n\tcase 1:\n\t\tstart = COORD{0, info.CursorPosition.Y}\n\t\tend = info.CursorPosition\n\n\tcase 2:\n\t\tstart = COORD{0, info.CursorPosition.Y}\n\t\tend = COORD{info.Size.X, info.CursorPosition.Y}\n\t}\n\n\terr = h.clearRange(h.attributes, start, end)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) IL(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"IL: [%v]\", strconv.Itoa(param))\n\th.clearWrap()\n\treturn h.insertLines(param)\n}\n\nfunc (h *windowsAnsiEventHandler) DL(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DL: [%v]\", strconv.Itoa(param))\n\th.clearWrap()\n\treturn h.deleteLines(param)\n}\n\nfunc (h *windowsAnsiEventHandler) ICH(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"ICH: [%v]\", strconv.Itoa(param))\n\th.clearWrap()\n\treturn h.insertCharacters(param)\n}\n\nfunc (h *windowsAnsiEventHandler) DCH(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DCH: [%v]\", strconv.Itoa(param))\n\th.clearWrap()\n\treturn h.deleteCharacters(param)\n}\n\nfunc (h *windowsAnsiEventHandler) SGR(params []int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\tstrings := []string{}\n\tfor _, v := range params {\n\t\tstrings = append(strings, strconv.Itoa(v))\n\t}\n\n\th.logf(\"SGR: [%v]\", strings)\n\n\tif len(params) <= 0 {\n\t\th.attributes = h.infoReset.Attributes\n\t\th.inverted = false\n\t} else {\n\t\tfor _, attr := range params {\n\n\t\t\tif attr == ansiterm.ANSI_SGR_RESET {\n\t\t\t\th.attributes = h.infoReset.Attributes\n\t\t\t\th.inverted = false\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\th.attributes, h.inverted = collectAnsiIntoWindowsAttributes(h.attributes, h.inverted, h.infoReset.Attributes, int16(attr))\n\t\t}\n\t}\n\n\tattributes := h.attributes\n\tif h.inverted {\n\t\tattributes = invertAttributes(attributes)\n\t}\n\terr := SetConsoleTextAttribute(h.fd, attributes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) SU(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"SU: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.scrollUp(param)\n}\n\nfunc (h *windowsAnsiEventHandler) SD(param int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"SD: [%v]\", []string{strconv.Itoa(param)})\n\th.clearWrap()\n\treturn h.scrollDown(param)\n}\n\nfunc (h *windowsAnsiEventHandler) DA(params []string) error {\n\th.logf(\"DA: [%v]\", params)\n\t// DA cannot be implemented because it must send data on the VT100 input stream,\n\t// which is not available to go-ansiterm.\n\treturn nil\n}\n\nfunc (h *windowsAnsiEventHandler) DECSTBM(top int, bottom int) error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"DECSTBM: [%d, %d]\", top, bottom)\n\n\t// Windows is 0 indexed, Linux is 1 indexed\n\th.sr.top = int16(top - 1)\n\th.sr.bottom = int16(bottom - 1)\n\n\t// This command also moves the cursor to the origin.\n\th.clearWrap()\n\treturn h.CUP(1, 1)\n}\n\nfunc (h *windowsAnsiEventHandler) RI() error {\n\tif err := h.Flush(); err != nil {\n\t\treturn err\n\t}\n\th.logf(\"RI: []\")\n\th.clearWrap()\n\n\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsr := h.effectiveSr(info.Window)\n\tif info.CursorPosition.Y == sr.top {\n\t\treturn h.scrollDown(1)\n\t}\n\n\treturn h.moveCursorVertical(-1)\n}\n\nfunc (h *windowsAnsiEventHandler) IND() error {\n\th.logf(\"IND: []\")\n\treturn h.executeLF()\n}\n\nfunc (h *windowsAnsiEventHandler) Flush() error {\n\th.curInfo = nil\n\tif h.buffer.Len() > 0 {\n\t\th.logf(\"Flush: [%s]\", h.buffer.Bytes())\n\t\tif _, err := h.buffer.WriteTo(h.file); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif h.wrapNext && !h.drewMarginByte {\n\t\th.logf(\"Flush: drawing margin byte '%c'\", h.marginByte)\n\n\t\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcharInfo := []CHAR_INFO{{UnicodeChar: uint16(h.marginByte), Attributes: info.Attributes}}\n\t\tsize := COORD{1, 1}\n\t\tposition := COORD{0, 0}\n\t\tregion := SMALL_RECT{Left: info.CursorPosition.X, Top: info.CursorPosition.Y, Right: info.CursorPosition.X, Bottom: info.CursorPosition.Y}\n\t\tif err := WriteConsoleOutput(h.fd, charInfo, size, position, &region); err != nil {\n\t\t\treturn err\n\t\t}\n\t\th.drewMarginByte = true\n\t}\n\treturn nil\n}\n\n// cacheConsoleInfo ensures that the current console screen information has been queried\n// since the last call to Flush(). It must be called before accessing h.curInfo or h.curPos.\nfunc (h *windowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFER_INFO, error) {\n\tif h.curInfo == nil {\n\t\tinfo, err := GetConsoleScreenBufferInfo(h.fd)\n\t\tif err != nil {\n\t\t\treturn COORD{}, nil, err\n\t\t}\n\t\th.curInfo = info\n\t\th.curPos = info.CursorPosition\n\t}\n\treturn h.curPos, h.curInfo, nil\n}\n\nfunc (h *windowsAnsiEventHandler) updatePos(pos COORD) {\n\tif h.curInfo == nil {\n\t\tpanic(\"failed to call getCurrentInfo before calling updatePos\")\n\t}\n\th.curPos = pos\n}\n\n// clearWrap clears the state where the cursor is in the margin\n// waiting for the next character before wrapping the line. This must\n// be done before most operations that act on the cursor.\nfunc (h *windowsAnsiEventHandler) clearWrap() {\n\th.wrapNext = false\n\th.drewMarginByte = false\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/.gitignore",
    "content": "/toml.test\n/toml-test\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/COPYING",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 TOML authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/README.md",
    "content": "TOML stands for Tom's Obvious, Minimal Language. This Go package provides a\nreflection interface similar to Go's standard library `json` and `xml` packages.\n\nCompatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0).\n\nDocumentation: https://godocs.io/github.com/BurntSushi/toml\n\nSee the [releases page](https://github.com/BurntSushi/toml/releases) for a\nchangelog; this information is also in the git tag annotations (e.g. `git show\nv0.4.0`).\n\nThis library requires Go 1.18 or newer; add it to your go.mod with:\n\n    % go get github.com/BurntSushi/toml@latest\n\nIt also comes with a TOML validator CLI tool:\n\n    % go install github.com/BurntSushi/toml/cmd/tomlv@latest\n    % tomlv some-toml-file.toml\n\n### Examples\nFor the simplest example, consider some TOML file as just a list of keys and\nvalues:\n\n```toml\nAge = 25\nCats = [ \"Cauchy\", \"Plato\" ]\nPi = 3.14\nPerfection = [ 6, 28, 496, 8128 ]\nDOB = 1987-07-05T05:45:00Z\n```\n\nWhich can be decoded with:\n\n```go\ntype Config struct {\n\tAge        int\n\tCats       []string\n\tPi         float64\n\tPerfection []int\n\tDOB        time.Time\n}\n\nvar conf Config\n_, err := toml.Decode(tomlData, &conf)\n```\n\nYou can also use struct tags if your struct field name doesn't map to a TOML key\nvalue directly:\n\n```toml\nsome_key_NAME = \"wat\"\n```\n\n```go\ntype TOML struct {\n    ObscureKey string `toml:\"some_key_NAME\"`\n}\n```\n\nBeware that like other decoders **only exported fields** are considered when\nencoding and decoding; private fields are silently ignored.\n\n### Using the `Marshaler` and `encoding.TextUnmarshaler` interfaces\nHere's an example that automatically parses values in a `mail.Address`:\n\n```toml\ncontacts = [\n    \"Donald Duck <donald@duckburg.com>\",\n    \"Scrooge McDuck <scrooge@duckburg.com>\",\n]\n```\n\nCan be decoded with:\n\n```go\n// Create address type which satisfies the encoding.TextUnmarshaler interface.\ntype address struct {\n\t*mail.Address\n}\n\nfunc (a *address) UnmarshalText(text []byte) error {\n\tvar err error\n\ta.Address, err = mail.ParseAddress(string(text))\n\treturn err\n}\n\n// Decode it.\nfunc decode() {\n\tblob := `\n\t\tcontacts = [\n\t\t\t\"Donald Duck <donald@duckburg.com>\",\n\t\t\t\"Scrooge McDuck <scrooge@duckburg.com>\",\n\t\t]\n\t`\n\n\tvar contacts struct {\n\t\tContacts []address\n\t}\n\n\t_, err := toml.Decode(blob, &contacts)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor _, c := range contacts.Contacts {\n\t\tfmt.Printf(\"%#v\\n\", c.Address)\n\t}\n\n\t// Output:\n\t// &mail.Address{Name:\"Donald Duck\", Address:\"donald@duckburg.com\"}\n\t// &mail.Address{Name:\"Scrooge McDuck\", Address:\"scrooge@duckburg.com\"}\n}\n```\n\nTo target TOML specifically you can implement `UnmarshalTOML` TOML interface in\na similar way.\n\n### More complex usage\nSee the [`_example/`](/_example) directory for a more complex example.\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/decode.go",
    "content": "package toml\n\nimport (\n\t\"bytes\"\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Unmarshaler is the interface implemented by objects that can unmarshal a\n// TOML description of themselves.\ntype Unmarshaler interface {\n\tUnmarshalTOML(any) error\n}\n\n// Unmarshal decodes the contents of data in TOML format into a pointer v.\n//\n// See [Decoder] for a description of the decoding process.\nfunc Unmarshal(data []byte, v any) error {\n\t_, err := NewDecoder(bytes.NewReader(data)).Decode(v)\n\treturn err\n}\n\n// Decode the TOML data in to the pointer v.\n//\n// See [Decoder] for a description of the decoding process.\nfunc Decode(data string, v any) (MetaData, error) {\n\treturn NewDecoder(strings.NewReader(data)).Decode(v)\n}\n\n// DecodeFile reads the contents of a file and decodes it with [Decode].\nfunc DecodeFile(path string, v any) (MetaData, error) {\n\tfp, err := os.Open(path)\n\tif err != nil {\n\t\treturn MetaData{}, err\n\t}\n\tdefer fp.Close()\n\treturn NewDecoder(fp).Decode(v)\n}\n\n// DecodeFS reads the contents of a file from [fs.FS] and decodes it with\n// [Decode].\nfunc DecodeFS(fsys fs.FS, path string, v any) (MetaData, error) {\n\tfp, err := fsys.Open(path)\n\tif err != nil {\n\t\treturn MetaData{}, err\n\t}\n\tdefer fp.Close()\n\treturn NewDecoder(fp).Decode(v)\n}\n\n// Primitive is a TOML value that hasn't been decoded into a Go value.\n//\n// This type can be used for any value, which will cause decoding to be delayed.\n// You can use [PrimitiveDecode] to \"manually\" decode these values.\n//\n// NOTE: The underlying representation of a `Primitive` value is subject to\n// change. Do not rely on it.\n//\n// NOTE: Primitive values are still parsed, so using them will only avoid the\n// overhead of reflection. They can be useful when you don't know the exact type\n// of TOML data until runtime.\ntype Primitive struct {\n\tundecoded any\n\tcontext   Key\n}\n\n// The significand precision for float32 and float64 is 24 and 53 bits; this is\n// the range a natural number can be stored in a float without loss of data.\nconst (\n\tmaxSafeFloat32Int = 16777215                // 2^24-1\n\tmaxSafeFloat64Int = int64(9007199254740991) // 2^53-1\n)\n\n// Decoder decodes TOML data.\n//\n// TOML tables correspond to Go structs or maps; they can be used\n// interchangeably, but structs offer better type safety.\n//\n// TOML table arrays correspond to either a slice of structs or a slice of maps.\n//\n// TOML datetimes correspond to [time.Time]. Local datetimes are parsed in the\n// local timezone.\n//\n// [time.Duration] types are treated as nanoseconds if the TOML value is an\n// integer, or they're parsed with time.ParseDuration() if they're strings.\n//\n// All other TOML types (float, string, int, bool and array) correspond to the\n// obvious Go types.\n//\n// An exception to the above rules is if a type implements the TextUnmarshaler\n// interface, in which case any primitive TOML value (floats, strings, integers,\n// booleans, datetimes) will be converted to a []byte and given to the value's\n// UnmarshalText method. See the Unmarshaler example for a demonstration with\n// email addresses.\n//\n// # Key mapping\n//\n// TOML keys can map to either keys in a Go map or field names in a Go struct.\n// The special `toml` struct tag can be used to map TOML keys to struct fields\n// that don't match the key name exactly (see the example). A case insensitive\n// match to struct names will be tried if an exact match can't be found.\n//\n// The mapping between TOML values and Go values is loose. That is, there may\n// exist TOML values that cannot be placed into your representation, and there\n// may be parts of your representation that do not correspond to TOML values.\n// This loose mapping can be made stricter by using the IsDefined and/or\n// Undecoded methods on the MetaData returned.\n//\n// This decoder does not handle cyclic types. Decode will not terminate if a\n// cyclic type is passed.\ntype Decoder struct {\n\tr io.Reader\n}\n\n// NewDecoder creates a new Decoder.\nfunc NewDecoder(r io.Reader) *Decoder {\n\treturn &Decoder{r: r}\n}\n\nvar (\n\tunmarshalToml = reflect.TypeOf((*Unmarshaler)(nil)).Elem()\n\tunmarshalText = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()\n\tprimitiveType = reflect.TypeOf((*Primitive)(nil)).Elem()\n)\n\n// Decode TOML data in to the pointer `v`.\nfunc (dec *Decoder) Decode(v any) (MetaData, error) {\n\trv := reflect.ValueOf(v)\n\tif rv.Kind() != reflect.Ptr {\n\t\ts := \"%q\"\n\t\tif reflect.TypeOf(v) == nil {\n\t\t\ts = \"%v\"\n\t\t}\n\n\t\treturn MetaData{}, fmt.Errorf(\"toml: cannot decode to non-pointer \"+s, reflect.TypeOf(v))\n\t}\n\tif rv.IsNil() {\n\t\treturn MetaData{}, fmt.Errorf(\"toml: cannot decode to nil value of %q\", reflect.TypeOf(v))\n\t}\n\n\t// Check if this is a supported type: struct, map, any, or something that\n\t// implements UnmarshalTOML or UnmarshalText.\n\trv = indirect(rv)\n\trt := rv.Type()\n\tif rv.Kind() != reflect.Struct && rv.Kind() != reflect.Map &&\n\t\t!(rv.Kind() == reflect.Interface && rv.NumMethod() == 0) &&\n\t\t!rt.Implements(unmarshalToml) && !rt.Implements(unmarshalText) {\n\t\treturn MetaData{}, fmt.Errorf(\"toml: cannot decode to type %s\", rt)\n\t}\n\n\t// TODO: parser should read from io.Reader? Or at the very least, make it\n\t// read from []byte rather than string\n\tdata, err := io.ReadAll(dec.r)\n\tif err != nil {\n\t\treturn MetaData{}, err\n\t}\n\n\tp, err := parse(string(data))\n\tif err != nil {\n\t\treturn MetaData{}, err\n\t}\n\n\tmd := MetaData{\n\t\tmapping: p.mapping,\n\t\tkeyInfo: p.keyInfo,\n\t\tkeys:    p.ordered,\n\t\tdecoded: make(map[string]struct{}, len(p.ordered)),\n\t\tcontext: nil,\n\t\tdata:    data,\n\t}\n\treturn md, md.unify(p.mapping, rv)\n}\n\n// PrimitiveDecode is just like the other Decode* functions, except it decodes a\n// TOML value that has already been parsed. Valid primitive values can *only* be\n// obtained from values filled by the decoder functions, including this method.\n// (i.e., v may contain more [Primitive] values.)\n//\n// Meta data for primitive values is included in the meta data returned by the\n// Decode* functions with one exception: keys returned by the Undecoded method\n// will only reflect keys that were decoded. Namely, any keys hidden behind a\n// Primitive will be considered undecoded. Executing this method will update the\n// undecoded keys in the meta data. (See the example.)\nfunc (md *MetaData) PrimitiveDecode(primValue Primitive, v any) error {\n\tmd.context = primValue.context\n\tdefer func() { md.context = nil }()\n\treturn md.unify(primValue.undecoded, rvalue(v))\n}\n\n// unify performs a sort of type unification based on the structure of `rv`,\n// which is the client representation.\n//\n// Any type mismatch produces an error. Finding a type that we don't know\n// how to handle produces an unsupported type error.\nfunc (md *MetaData) unify(data any, rv reflect.Value) error {\n\t// Special case. Look for a `Primitive` value.\n\t// TODO: #76 would make this superfluous after implemented.\n\tif rv.Type() == primitiveType {\n\t\t// Save the undecoded data and the key context into the primitive\n\t\t// value.\n\t\tcontext := make(Key, len(md.context))\n\t\tcopy(context, md.context)\n\t\trv.Set(reflect.ValueOf(Primitive{\n\t\t\tundecoded: data,\n\t\t\tcontext:   context,\n\t\t}))\n\t\treturn nil\n\t}\n\n\trvi := rv.Interface()\n\tif v, ok := rvi.(Unmarshaler); ok {\n\t\terr := v.UnmarshalTOML(data)\n\t\tif err != nil {\n\t\t\treturn md.parseErr(err)\n\t\t}\n\t\treturn nil\n\t}\n\tif v, ok := rvi.(encoding.TextUnmarshaler); ok {\n\t\treturn md.unifyText(data, v)\n\t}\n\n\t// TODO:\n\t// The behavior here is incorrect whenever a Go type satisfies the\n\t// encoding.TextUnmarshaler interface but also corresponds to a TOML hash or\n\t// array. In particular, the unmarshaler should only be applied to primitive\n\t// TOML values. But at this point, it will be applied to all kinds of values\n\t// and produce an incorrect error whenever those values are hashes or arrays\n\t// (including arrays of tables).\n\n\tk := rv.Kind()\n\n\tif k >= reflect.Int && k <= reflect.Uint64 {\n\t\treturn md.unifyInt(data, rv)\n\t}\n\tswitch k {\n\tcase reflect.Struct:\n\t\treturn md.unifyStruct(data, rv)\n\tcase reflect.Map:\n\t\treturn md.unifyMap(data, rv)\n\tcase reflect.Array:\n\t\treturn md.unifyArray(data, rv)\n\tcase reflect.Slice:\n\t\treturn md.unifySlice(data, rv)\n\tcase reflect.String:\n\t\treturn md.unifyString(data, rv)\n\tcase reflect.Bool:\n\t\treturn md.unifyBool(data, rv)\n\tcase reflect.Interface:\n\t\tif rv.NumMethod() > 0 { /// Only empty interfaces are supported.\n\t\t\treturn md.e(\"unsupported type %s\", rv.Type())\n\t\t}\n\t\treturn md.unifyAnything(data, rv)\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn md.unifyFloat64(data, rv)\n\t}\n\treturn md.e(\"unsupported type %s\", rv.Kind())\n}\n\nfunc (md *MetaData) unifyStruct(mapping any, rv reflect.Value) error {\n\ttmap, ok := mapping.(map[string]any)\n\tif !ok {\n\t\tif mapping == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn md.e(\"type mismatch for %s: expected table but found %s\", rv.Type().String(), fmtType(mapping))\n\t}\n\n\tfor key, datum := range tmap {\n\t\tvar f *field\n\t\tfields := cachedTypeFields(rv.Type())\n\t\tfor i := range fields {\n\t\t\tff := &fields[i]\n\t\t\tif ff.name == key {\n\t\t\t\tf = ff\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif f == nil && strings.EqualFold(ff.name, key) {\n\t\t\t\tf = ff\n\t\t\t}\n\t\t}\n\t\tif f != nil {\n\t\t\tsubv := rv\n\t\t\tfor _, i := range f.index {\n\t\t\t\tsubv = indirect(subv.Field(i))\n\t\t\t}\n\n\t\t\tif isUnifiable(subv) {\n\t\t\t\tmd.decoded[md.context.add(key).String()] = struct{}{}\n\t\t\t\tmd.context = append(md.context, key)\n\n\t\t\t\terr := md.unify(datum, subv)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tmd.context = md.context[0 : len(md.context)-1]\n\t\t\t} else if f.name != \"\" {\n\t\t\t\treturn md.e(\"cannot write unexported field %s.%s\", rv.Type().String(), f.name)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (md *MetaData) unifyMap(mapping any, rv reflect.Value) error {\n\tkeyType := rv.Type().Key().Kind()\n\tif keyType != reflect.String && keyType != reflect.Interface {\n\t\treturn fmt.Errorf(\"toml: cannot decode to a map with non-string key type (%s in %q)\",\n\t\t\tkeyType, rv.Type())\n\t}\n\n\ttmap, ok := mapping.(map[string]any)\n\tif !ok {\n\t\tif tmap == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn md.badtype(\"map\", mapping)\n\t}\n\tif rv.IsNil() {\n\t\trv.Set(reflect.MakeMap(rv.Type()))\n\t}\n\tfor k, v := range tmap {\n\t\tmd.decoded[md.context.add(k).String()] = struct{}{}\n\t\tmd.context = append(md.context, k)\n\n\t\trvval := reflect.Indirect(reflect.New(rv.Type().Elem()))\n\n\t\terr := md.unify(v, indirect(rvval))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmd.context = md.context[0 : len(md.context)-1]\n\n\t\trvkey := indirect(reflect.New(rv.Type().Key()))\n\n\t\tswitch keyType {\n\t\tcase reflect.Interface:\n\t\t\trvkey.Set(reflect.ValueOf(k))\n\t\tcase reflect.String:\n\t\t\trvkey.SetString(k)\n\t\t}\n\n\t\trv.SetMapIndex(rvkey, rvval)\n\t}\n\treturn nil\n}\n\nfunc (md *MetaData) unifyArray(data any, rv reflect.Value) error {\n\tdatav := reflect.ValueOf(data)\n\tif datav.Kind() != reflect.Slice {\n\t\tif !datav.IsValid() {\n\t\t\treturn nil\n\t\t}\n\t\treturn md.badtype(\"slice\", data)\n\t}\n\tif l := datav.Len(); l != rv.Len() {\n\t\treturn md.e(\"expected array length %d; got TOML array of length %d\", rv.Len(), l)\n\t}\n\treturn md.unifySliceArray(datav, rv)\n}\n\nfunc (md *MetaData) unifySlice(data any, rv reflect.Value) error {\n\tdatav := reflect.ValueOf(data)\n\tif datav.Kind() != reflect.Slice {\n\t\tif !datav.IsValid() {\n\t\t\treturn nil\n\t\t}\n\t\treturn md.badtype(\"slice\", data)\n\t}\n\tn := datav.Len()\n\tif rv.IsNil() || rv.Cap() < n {\n\t\trv.Set(reflect.MakeSlice(rv.Type(), n, n))\n\t}\n\trv.SetLen(n)\n\treturn md.unifySliceArray(datav, rv)\n}\n\nfunc (md *MetaData) unifySliceArray(data, rv reflect.Value) error {\n\tl := data.Len()\n\tfor i := 0; i < l; i++ {\n\t\terr := md.unify(data.Index(i).Interface(), indirect(rv.Index(i)))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (md *MetaData) unifyString(data any, rv reflect.Value) error {\n\t_, ok := rv.Interface().(json.Number)\n\tif ok {\n\t\tif i, ok := data.(int64); ok {\n\t\t\trv.SetString(strconv.FormatInt(i, 10))\n\t\t} else if f, ok := data.(float64); ok {\n\t\t\trv.SetString(strconv.FormatFloat(f, 'f', -1, 64))\n\t\t} else {\n\t\t\treturn md.badtype(\"string\", data)\n\t\t}\n\t\treturn nil\n\t}\n\n\tif s, ok := data.(string); ok {\n\t\trv.SetString(s)\n\t\treturn nil\n\t}\n\treturn md.badtype(\"string\", data)\n}\n\nfunc (md *MetaData) unifyFloat64(data any, rv reflect.Value) error {\n\trvk := rv.Kind()\n\n\tif num, ok := data.(float64); ok {\n\t\tswitch rvk {\n\t\tcase reflect.Float32:\n\t\t\tif num < -math.MaxFloat32 || num > math.MaxFloat32 {\n\t\t\t\treturn md.parseErr(errParseRange{i: num, size: rvk.String()})\n\t\t\t}\n\t\t\tfallthrough\n\t\tcase reflect.Float64:\n\t\t\trv.SetFloat(num)\n\t\tdefault:\n\t\t\tpanic(\"bug\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tif num, ok := data.(int64); ok {\n\t\tif (rvk == reflect.Float32 && (num < -maxSafeFloat32Int || num > maxSafeFloat32Int)) ||\n\t\t\t(rvk == reflect.Float64 && (num < -maxSafeFloat64Int || num > maxSafeFloat64Int)) {\n\t\t\treturn md.parseErr(errUnsafeFloat{i: num, size: rvk.String()})\n\t\t}\n\t\trv.SetFloat(float64(num))\n\t\treturn nil\n\t}\n\n\treturn md.badtype(\"float\", data)\n}\n\nfunc (md *MetaData) unifyInt(data any, rv reflect.Value) error {\n\t_, ok := rv.Interface().(time.Duration)\n\tif ok {\n\t\t// Parse as string duration, and fall back to regular integer parsing\n\t\t// (as nanosecond) if this is not a string.\n\t\tif s, ok := data.(string); ok {\n\t\t\tdur, err := time.ParseDuration(s)\n\t\t\tif err != nil {\n\t\t\t\treturn md.parseErr(errParseDuration{s})\n\t\t\t}\n\t\t\trv.SetInt(int64(dur))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tnum, ok := data.(int64)\n\tif !ok {\n\t\treturn md.badtype(\"integer\", data)\n\t}\n\n\trvk := rv.Kind()\n\tswitch {\n\tcase rvk >= reflect.Int && rvk <= reflect.Int64:\n\t\tif (rvk == reflect.Int8 && (num < math.MinInt8 || num > math.MaxInt8)) ||\n\t\t\t(rvk == reflect.Int16 && (num < math.MinInt16 || num > math.MaxInt16)) ||\n\t\t\t(rvk == reflect.Int32 && (num < math.MinInt32 || num > math.MaxInt32)) {\n\t\t\treturn md.parseErr(errParseRange{i: num, size: rvk.String()})\n\t\t}\n\t\trv.SetInt(num)\n\tcase rvk >= reflect.Uint && rvk <= reflect.Uint64:\n\t\tunum := uint64(num)\n\t\tif rvk == reflect.Uint8 && (num < 0 || unum > math.MaxUint8) ||\n\t\t\trvk == reflect.Uint16 && (num < 0 || unum > math.MaxUint16) ||\n\t\t\trvk == reflect.Uint32 && (num < 0 || unum > math.MaxUint32) {\n\t\t\treturn md.parseErr(errParseRange{i: num, size: rvk.String()})\n\t\t}\n\t\trv.SetUint(unum)\n\tdefault:\n\t\tpanic(\"unreachable\")\n\t}\n\treturn nil\n}\n\nfunc (md *MetaData) unifyBool(data any, rv reflect.Value) error {\n\tif b, ok := data.(bool); ok {\n\t\trv.SetBool(b)\n\t\treturn nil\n\t}\n\treturn md.badtype(\"boolean\", data)\n}\n\nfunc (md *MetaData) unifyAnything(data any, rv reflect.Value) error {\n\trv.Set(reflect.ValueOf(data))\n\treturn nil\n}\n\nfunc (md *MetaData) unifyText(data any, v encoding.TextUnmarshaler) error {\n\tvar s string\n\tswitch sdata := data.(type) {\n\tcase Marshaler:\n\t\ttext, err := sdata.MarshalTOML()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ts = string(text)\n\tcase encoding.TextMarshaler:\n\t\ttext, err := sdata.MarshalText()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ts = string(text)\n\tcase fmt.Stringer:\n\t\ts = sdata.String()\n\tcase string:\n\t\ts = sdata\n\tcase bool:\n\t\ts = fmt.Sprintf(\"%v\", sdata)\n\tcase int64:\n\t\ts = fmt.Sprintf(\"%d\", sdata)\n\tcase float64:\n\t\ts = fmt.Sprintf(\"%f\", sdata)\n\tdefault:\n\t\treturn md.badtype(\"primitive (string-like)\", data)\n\t}\n\tif err := v.UnmarshalText([]byte(s)); err != nil {\n\t\treturn md.parseErr(err)\n\t}\n\treturn nil\n}\n\nfunc (md *MetaData) badtype(dst string, data any) error {\n\treturn md.e(\"incompatible types: TOML value has type %s; destination has type %s\", fmtType(data), dst)\n}\n\nfunc (md *MetaData) parseErr(err error) error {\n\tk := md.context.String()\n\td := string(md.data)\n\treturn ParseError{\n\t\tMessage:  err.Error(),\n\t\terr:      err,\n\t\tLastKey:  k,\n\t\tPosition: md.keyInfo[k].pos.withCol(d),\n\t\tLine:     md.keyInfo[k].pos.Line,\n\t\tinput:    d,\n\t}\n}\n\nfunc (md *MetaData) e(format string, args ...any) error {\n\tf := \"toml: \"\n\tif len(md.context) > 0 {\n\t\tf = fmt.Sprintf(\"toml: (last key %q): \", md.context)\n\t\tp := md.keyInfo[md.context.String()].pos\n\t\tif p.Line > 0 {\n\t\t\tf = fmt.Sprintf(\"toml: line %d (last key %q): \", p.Line, md.context)\n\t\t}\n\t}\n\treturn fmt.Errorf(f+format, args...)\n}\n\n// rvalue returns a reflect.Value of `v`. All pointers are resolved.\nfunc rvalue(v any) reflect.Value {\n\treturn indirect(reflect.ValueOf(v))\n}\n\n// indirect returns the value pointed to by a pointer.\n//\n// Pointers are followed until the value is not a pointer. New values are\n// allocated for each nil pointer.\n//\n// An exception to this rule is if the value satisfies an interface of interest\n// to us (like encoding.TextUnmarshaler).\nfunc indirect(v reflect.Value) reflect.Value {\n\tif v.Kind() != reflect.Ptr {\n\t\tif v.CanSet() {\n\t\t\tpv := v.Addr()\n\t\t\tpvi := pv.Interface()\n\t\t\tif _, ok := pvi.(encoding.TextUnmarshaler); ok {\n\t\t\t\treturn pv\n\t\t\t}\n\t\t\tif _, ok := pvi.(Unmarshaler); ok {\n\t\t\t\treturn pv\n\t\t\t}\n\t\t}\n\t\treturn v\n\t}\n\tif v.IsNil() {\n\t\tv.Set(reflect.New(v.Type().Elem()))\n\t}\n\treturn indirect(reflect.Indirect(v))\n}\n\nfunc isUnifiable(rv reflect.Value) bool {\n\tif rv.CanSet() {\n\t\treturn true\n\t}\n\trvi := rv.Interface()\n\tif _, ok := rvi.(encoding.TextUnmarshaler); ok {\n\t\treturn true\n\t}\n\tif _, ok := rvi.(Unmarshaler); ok {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// fmt %T with \"interface {}\" replaced with \"any\", which is far more readable.\nfunc fmtType(t any) string {\n\treturn strings.ReplaceAll(fmt.Sprintf(\"%T\", t), \"interface {}\", \"any\")\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/deprecated.go",
    "content": "package toml\n\nimport (\n\t\"encoding\"\n\t\"io\"\n)\n\n// TextMarshaler is an alias for encoding.TextMarshaler.\n//\n// Deprecated: use encoding.TextMarshaler\ntype TextMarshaler encoding.TextMarshaler\n\n// TextUnmarshaler is an alias for encoding.TextUnmarshaler.\n//\n// Deprecated: use encoding.TextUnmarshaler\ntype TextUnmarshaler encoding.TextUnmarshaler\n\n// DecodeReader is an alias for NewDecoder(r).Decode(v).\n//\n// Deprecated: use NewDecoder(reader).Decode(&value).\nfunc DecodeReader(r io.Reader, v any) (MetaData, error) { return NewDecoder(r).Decode(v) }\n\n// PrimitiveDecode is an alias for MetaData.PrimitiveDecode().\n//\n// Deprecated: use MetaData.PrimitiveDecode.\nfunc PrimitiveDecode(primValue Primitive, v any) error {\n\tmd := MetaData{decoded: make(map[string]struct{})}\n\treturn md.unify(primValue.undecoded, rvalue(v))\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/doc.go",
    "content": "// Package toml implements decoding and encoding of TOML files.\n//\n// This package supports TOML v1.0.0, as specified at https://toml.io\n//\n// The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator,\n// and can be used to verify if TOML document is valid. It can also be used to\n// print the type of each key.\npackage toml\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/encode.go",
    "content": "package toml\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/BurntSushi/toml/internal\"\n)\n\ntype tomlEncodeError struct{ error }\n\nvar (\n\terrArrayNilElement = errors.New(\"toml: cannot encode array with nil element\")\n\terrNonString       = errors.New(\"toml: cannot encode a map with non-string key type\")\n\terrNoKey           = errors.New(\"toml: top-level values must be Go maps or structs\")\n\terrAnything        = errors.New(\"\") // used in testing\n)\n\nvar dblQuotedReplacer = strings.NewReplacer(\n\t\"\\\"\", \"\\\\\\\"\",\n\t\"\\\\\", \"\\\\\\\\\",\n\t\"\\x00\", `\\u0000`,\n\t\"\\x01\", `\\u0001`,\n\t\"\\x02\", `\\u0002`,\n\t\"\\x03\", `\\u0003`,\n\t\"\\x04\", `\\u0004`,\n\t\"\\x05\", `\\u0005`,\n\t\"\\x06\", `\\u0006`,\n\t\"\\x07\", `\\u0007`,\n\t\"\\b\", `\\b`,\n\t\"\\t\", `\\t`,\n\t\"\\n\", `\\n`,\n\t\"\\x0b\", `\\u000b`,\n\t\"\\f\", `\\f`,\n\t\"\\r\", `\\r`,\n\t\"\\x0e\", `\\u000e`,\n\t\"\\x0f\", `\\u000f`,\n\t\"\\x10\", `\\u0010`,\n\t\"\\x11\", `\\u0011`,\n\t\"\\x12\", `\\u0012`,\n\t\"\\x13\", `\\u0013`,\n\t\"\\x14\", `\\u0014`,\n\t\"\\x15\", `\\u0015`,\n\t\"\\x16\", `\\u0016`,\n\t\"\\x17\", `\\u0017`,\n\t\"\\x18\", `\\u0018`,\n\t\"\\x19\", `\\u0019`,\n\t\"\\x1a\", `\\u001a`,\n\t\"\\x1b\", `\\u001b`,\n\t\"\\x1c\", `\\u001c`,\n\t\"\\x1d\", `\\u001d`,\n\t\"\\x1e\", `\\u001e`,\n\t\"\\x1f\", `\\u001f`,\n\t\"\\x7f\", `\\u007f`,\n)\n\nvar (\n\tmarshalToml = reflect.TypeOf((*Marshaler)(nil)).Elem()\n\tmarshalText = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()\n\ttimeType    = reflect.TypeOf((*time.Time)(nil)).Elem()\n)\n\n// Marshaler is the interface implemented by types that can marshal themselves\n// into valid TOML.\ntype Marshaler interface {\n\tMarshalTOML() ([]byte, error)\n}\n\n// Marshal returns a TOML representation of the Go value.\n//\n// See [Encoder] for a description of the encoding process.\nfunc Marshal(v any) ([]byte, error) {\n\tbuff := new(bytes.Buffer)\n\tif err := NewEncoder(buff).Encode(v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// Encoder encodes a Go to a TOML document.\n//\n// The mapping between Go values and TOML values should be precisely the same as\n// for [Decode].\n//\n// time.Time is encoded as a RFC 3339 string, and time.Duration as its string\n// representation.\n//\n// The [Marshaler] and [encoding.TextMarshaler] interfaces are supported to\n// encoding the value as custom TOML.\n//\n// If you want to write arbitrary binary data then you will need to use\n// something like base64 since TOML does not have any binary types.\n//\n// When encoding TOML hashes (Go maps or structs), keys without any sub-hashes\n// are encoded first.\n//\n// Go maps will be sorted alphabetically by key for deterministic output.\n//\n// The toml struct tag can be used to provide the key name; if omitted the\n// struct field name will be used. If the \"omitempty\" option is present the\n// following value will be skipped:\n//\n//   - arrays, slices, maps, and string with len of 0\n//   - struct with all zero values\n//   - bool false\n//\n// If omitzero is given all int and float types with a value of 0 will be\n// skipped.\n//\n// Encoding Go values without a corresponding TOML representation will return an\n// error. Examples of this includes maps with non-string keys, slices with nil\n// elements, embedded non-struct types, and nested slices containing maps or\n// structs. (e.g. [][]map[string]string is not allowed but []map[string]string\n// is okay, as is []map[string][]string).\n//\n// NOTE: only exported keys are encoded due to the use of reflection. Unexported\n// keys are silently discarded.\ntype Encoder struct {\n\tIndent     string // string for a single indentation level; default is two spaces.\n\thasWritten bool   // written any output to w yet?\n\tw          *bufio.Writer\n}\n\n// NewEncoder create a new Encoder.\nfunc NewEncoder(w io.Writer) *Encoder {\n\treturn &Encoder{w: bufio.NewWriter(w), Indent: \"  \"}\n}\n\n// Encode writes a TOML representation of the Go value to the [Encoder]'s writer.\n//\n// An error is returned if the value given cannot be encoded to a valid TOML\n// document.\nfunc (enc *Encoder) Encode(v any) error {\n\trv := eindirect(reflect.ValueOf(v))\n\terr := enc.safeEncode(Key([]string{}), rv)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn enc.w.Flush()\n}\n\nfunc (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif terr, ok := r.(tomlEncodeError); ok {\n\t\t\t\terr = terr.error\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\tenc.encode(key, rv)\n\treturn nil\n}\n\nfunc (enc *Encoder) encode(key Key, rv reflect.Value) {\n\t// If we can marshal the type to text, then we use that. This prevents the\n\t// encoder for handling these types as generic structs (or whatever the\n\t// underlying type of a TextMarshaler is).\n\tswitch {\n\tcase isMarshaler(rv):\n\t\tenc.writeKeyValue(key, rv, false)\n\t\treturn\n\tcase rv.Type() == primitiveType: // TODO: #76 would make this superfluous after implemented.\n\t\tenc.encode(key, reflect.ValueOf(rv.Interface().(Primitive).undecoded))\n\t\treturn\n\t}\n\n\tk := rv.Kind()\n\tswitch k {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,\n\t\treflect.Int64,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,\n\t\treflect.Uint64,\n\t\treflect.Float32, reflect.Float64, reflect.String, reflect.Bool:\n\t\tenc.writeKeyValue(key, rv, false)\n\tcase reflect.Array, reflect.Slice:\n\t\tif typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) {\n\t\t\tenc.eArrayOfTables(key, rv)\n\t\t} else {\n\t\t\tenc.writeKeyValue(key, rv, false)\n\t\t}\n\tcase reflect.Interface:\n\t\tif rv.IsNil() {\n\t\t\treturn\n\t\t}\n\t\tenc.encode(key, rv.Elem())\n\tcase reflect.Map:\n\t\tif rv.IsNil() {\n\t\t\treturn\n\t\t}\n\t\tenc.eTable(key, rv)\n\tcase reflect.Ptr:\n\t\tif rv.IsNil() {\n\t\t\treturn\n\t\t}\n\t\tenc.encode(key, rv.Elem())\n\tcase reflect.Struct:\n\t\tenc.eTable(key, rv)\n\tdefault:\n\t\tencPanic(fmt.Errorf(\"unsupported type for key '%s': %s\", key, k))\n\t}\n}\n\n// eElement encodes any value that can be an array element.\nfunc (enc *Encoder) eElement(rv reflect.Value) {\n\tswitch v := rv.Interface().(type) {\n\tcase time.Time: // Using TextMarshaler adds extra quotes, which we don't want.\n\t\tformat := time.RFC3339Nano\n\t\tswitch v.Location() {\n\t\tcase internal.LocalDatetime:\n\t\t\tformat = \"2006-01-02T15:04:05.999999999\"\n\t\tcase internal.LocalDate:\n\t\t\tformat = \"2006-01-02\"\n\t\tcase internal.LocalTime:\n\t\t\tformat = \"15:04:05.999999999\"\n\t\t}\n\t\tswitch v.Location() {\n\t\tdefault:\n\t\t\tenc.wf(v.Format(format))\n\t\tcase internal.LocalDatetime, internal.LocalDate, internal.LocalTime:\n\t\t\tenc.wf(v.In(time.UTC).Format(format))\n\t\t}\n\t\treturn\n\tcase Marshaler:\n\t\ts, err := v.MarshalTOML()\n\t\tif err != nil {\n\t\t\tencPanic(err)\n\t\t}\n\t\tif s == nil {\n\t\t\tencPanic(errors.New(\"MarshalTOML returned nil and no error\"))\n\t\t}\n\t\tenc.w.Write(s)\n\t\treturn\n\tcase encoding.TextMarshaler:\n\t\ts, err := v.MarshalText()\n\t\tif err != nil {\n\t\t\tencPanic(err)\n\t\t}\n\t\tif s == nil {\n\t\t\tencPanic(errors.New(\"MarshalText returned nil and no error\"))\n\t\t}\n\t\tenc.writeQuoted(string(s))\n\t\treturn\n\tcase time.Duration:\n\t\tenc.writeQuoted(v.String())\n\t\treturn\n\tcase json.Number:\n\t\tn, _ := rv.Interface().(json.Number)\n\n\t\tif n == \"\" { /// Useful zero value.\n\t\t\tenc.w.WriteByte('0')\n\t\t\treturn\n\t\t} else if v, err := n.Int64(); err == nil {\n\t\t\tenc.eElement(reflect.ValueOf(v))\n\t\t\treturn\n\t\t} else if v, err := n.Float64(); err == nil {\n\t\t\tenc.eElement(reflect.ValueOf(v))\n\t\t\treturn\n\t\t}\n\t\tencPanic(fmt.Errorf(\"unable to convert %q to int64 or float64\", n))\n\t}\n\n\tswitch rv.Kind() {\n\tcase reflect.Ptr:\n\t\tenc.eElement(rv.Elem())\n\t\treturn\n\tcase reflect.String:\n\t\tenc.writeQuoted(rv.String())\n\tcase reflect.Bool:\n\t\tenc.wf(strconv.FormatBool(rv.Bool()))\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tenc.wf(strconv.FormatInt(rv.Int(), 10))\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tenc.wf(strconv.FormatUint(rv.Uint(), 10))\n\tcase reflect.Float32:\n\t\tf := rv.Float()\n\t\tif math.IsNaN(f) {\n\t\t\tif math.Signbit(f) {\n\t\t\t\tenc.wf(\"-\")\n\t\t\t}\n\t\t\tenc.wf(\"nan\")\n\t\t} else if math.IsInf(f, 0) {\n\t\t\tif math.Signbit(f) {\n\t\t\t\tenc.wf(\"-\")\n\t\t\t}\n\t\t\tenc.wf(\"inf\")\n\t\t} else {\n\t\t\tenc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 32)))\n\t\t}\n\tcase reflect.Float64:\n\t\tf := rv.Float()\n\t\tif math.IsNaN(f) {\n\t\t\tif math.Signbit(f) {\n\t\t\t\tenc.wf(\"-\")\n\t\t\t}\n\t\t\tenc.wf(\"nan\")\n\t\t} else if math.IsInf(f, 0) {\n\t\t\tif math.Signbit(f) {\n\t\t\t\tenc.wf(\"-\")\n\t\t\t}\n\t\t\tenc.wf(\"inf\")\n\t\t} else {\n\t\t\tenc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 64)))\n\t\t}\n\tcase reflect.Array, reflect.Slice:\n\t\tenc.eArrayOrSliceElement(rv)\n\tcase reflect.Struct:\n\t\tenc.eStruct(nil, rv, true)\n\tcase reflect.Map:\n\t\tenc.eMap(nil, rv, true)\n\tcase reflect.Interface:\n\t\tenc.eElement(rv.Elem())\n\tdefault:\n\t\tencPanic(fmt.Errorf(\"unexpected type: %s\", fmtType(rv.Interface())))\n\t}\n}\n\n// By the TOML spec, all floats must have a decimal with at least one number on\n// either side.\nfunc floatAddDecimal(fstr string) string {\n\tif !strings.Contains(fstr, \".\") {\n\t\treturn fstr + \".0\"\n\t}\n\treturn fstr\n}\n\nfunc (enc *Encoder) writeQuoted(s string) {\n\tenc.wf(\"\\\"%s\\\"\", dblQuotedReplacer.Replace(s))\n}\n\nfunc (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) {\n\tlength := rv.Len()\n\tenc.wf(\"[\")\n\tfor i := 0; i < length; i++ {\n\t\telem := eindirect(rv.Index(i))\n\t\tenc.eElement(elem)\n\t\tif i != length-1 {\n\t\t\tenc.wf(\", \")\n\t\t}\n\t}\n\tenc.wf(\"]\")\n}\n\nfunc (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) {\n\tif len(key) == 0 {\n\t\tencPanic(errNoKey)\n\t}\n\tfor i := 0; i < rv.Len(); i++ {\n\t\ttrv := eindirect(rv.Index(i))\n\t\tif isNil(trv) {\n\t\t\tcontinue\n\t\t}\n\t\tenc.newline()\n\t\tenc.wf(\"%s[[%s]]\", enc.indentStr(key), key)\n\t\tenc.newline()\n\t\tenc.eMapOrStruct(key, trv, false)\n\t}\n}\n\nfunc (enc *Encoder) eTable(key Key, rv reflect.Value) {\n\tif len(key) == 1 {\n\t\t// Output an extra newline between top-level tables.\n\t\t// (The newline isn't written if nothing else has been written though.)\n\t\tenc.newline()\n\t}\n\tif len(key) > 0 {\n\t\tenc.wf(\"%s[%s]\", enc.indentStr(key), key)\n\t\tenc.newline()\n\t}\n\tenc.eMapOrStruct(key, rv, false)\n}\n\nfunc (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value, inline bool) {\n\tswitch rv.Kind() {\n\tcase reflect.Map:\n\t\tenc.eMap(key, rv, inline)\n\tcase reflect.Struct:\n\t\tenc.eStruct(key, rv, inline)\n\tdefault:\n\t\t// Should never happen?\n\t\tpanic(\"eTable: unhandled reflect.Value Kind: \" + rv.Kind().String())\n\t}\n}\n\nfunc (enc *Encoder) eMap(key Key, rv reflect.Value, inline bool) {\n\trt := rv.Type()\n\tif rt.Key().Kind() != reflect.String {\n\t\tencPanic(errNonString)\n\t}\n\n\t// Sort keys so that we have deterministic output. And write keys directly\n\t// underneath this key first, before writing sub-structs or sub-maps.\n\tvar mapKeysDirect, mapKeysSub []string\n\tfor _, mapKey := range rv.MapKeys() {\n\t\tk := mapKey.String()\n\t\tif typeIsTable(tomlTypeOfGo(eindirect(rv.MapIndex(mapKey)))) {\n\t\t\tmapKeysSub = append(mapKeysSub, k)\n\t\t} else {\n\t\t\tmapKeysDirect = append(mapKeysDirect, k)\n\t\t}\n\t}\n\n\tvar writeMapKeys = func(mapKeys []string, trailC bool) {\n\t\tsort.Strings(mapKeys)\n\t\tfor i, mapKey := range mapKeys {\n\t\t\tval := eindirect(rv.MapIndex(reflect.ValueOf(mapKey)))\n\t\t\tif isNil(val) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif inline {\n\t\t\t\tenc.writeKeyValue(Key{mapKey}, val, true)\n\t\t\t\tif trailC || i != len(mapKeys)-1 {\n\t\t\t\t\tenc.wf(\", \")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tenc.encode(key.add(mapKey), val)\n\t\t\t}\n\t\t}\n\t}\n\n\tif inline {\n\t\tenc.wf(\"{\")\n\t}\n\twriteMapKeys(mapKeysDirect, len(mapKeysSub) > 0)\n\twriteMapKeys(mapKeysSub, false)\n\tif inline {\n\t\tenc.wf(\"}\")\n\t}\n}\n\nconst is32Bit = (32 << (^uint(0) >> 63)) == 32\n\nfunc pointerTo(t reflect.Type) reflect.Type {\n\tif t.Kind() == reflect.Ptr {\n\t\treturn pointerTo(t.Elem())\n\t}\n\treturn t\n}\n\nfunc (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) {\n\t// Write keys for fields directly under this key first, because if we write\n\t// a field that creates a new table then all keys under it will be in that\n\t// table (not the one we're writing here).\n\t//\n\t// Fields is a [][]int: for fieldsDirect this always has one entry (the\n\t// struct index). For fieldsSub it contains two entries: the parent field\n\t// index from tv, and the field indexes for the fields of the sub.\n\tvar (\n\t\trt                      = rv.Type()\n\t\tfieldsDirect, fieldsSub [][]int\n\t\taddFields               func(rt reflect.Type, rv reflect.Value, start []int)\n\t)\n\taddFields = func(rt reflect.Type, rv reflect.Value, start []int) {\n\t\tfor i := 0; i < rt.NumField(); i++ {\n\t\t\tf := rt.Field(i)\n\t\t\tisEmbed := f.Anonymous && pointerTo(f.Type).Kind() == reflect.Struct\n\t\t\tif f.PkgPath != \"\" && !isEmbed { /// Skip unexported fields.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\topts := getOptions(f.Tag)\n\t\t\tif opts.skip {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfrv := eindirect(rv.Field(i))\n\n\t\t\tif is32Bit {\n\t\t\t\t// Copy so it works correct on 32bit archs; not clear why this\n\t\t\t\t// is needed. See #314, and https://www.reddit.com/r/golang/comments/pnx8v4\n\t\t\t\t// This also works fine on 64bit, but 32bit archs are somewhat\n\t\t\t\t// rare and this is a wee bit faster.\n\t\t\t\tcopyStart := make([]int, len(start))\n\t\t\t\tcopy(copyStart, start)\n\t\t\t\tstart = copyStart\n\t\t\t}\n\n\t\t\t// Treat anonymous struct fields with tag names as though they are\n\t\t\t// not anonymous, like encoding/json does.\n\t\t\t//\n\t\t\t// Non-struct anonymous fields use the normal encoding logic.\n\t\t\tif isEmbed {\n\t\t\t\tif getOptions(f.Tag).name == \"\" && frv.Kind() == reflect.Struct {\n\t\t\t\t\taddFields(frv.Type(), frv, append(start, f.Index...))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif typeIsTable(tomlTypeOfGo(frv)) {\n\t\t\t\tfieldsSub = append(fieldsSub, append(start, f.Index...))\n\t\t\t} else {\n\t\t\t\tfieldsDirect = append(fieldsDirect, append(start, f.Index...))\n\t\t\t}\n\t\t}\n\t}\n\taddFields(rt, rv, nil)\n\n\twriteFields := func(fields [][]int) {\n\t\tfor _, fieldIndex := range fields {\n\t\t\tfieldType := rt.FieldByIndex(fieldIndex)\n\t\t\tfieldVal := rv.FieldByIndex(fieldIndex)\n\n\t\t\topts := getOptions(fieldType.Tag)\n\t\t\tif opts.skip {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif opts.omitempty && isEmpty(fieldVal) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfieldVal = eindirect(fieldVal)\n\n\t\t\tif isNil(fieldVal) { /// Don't write anything for nil fields.\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tkeyName := fieldType.Name\n\t\t\tif opts.name != \"\" {\n\t\t\t\tkeyName = opts.name\n\t\t\t}\n\n\t\t\tif opts.omitzero && isZero(fieldVal) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif inline {\n\t\t\t\tenc.writeKeyValue(Key{keyName}, fieldVal, true)\n\t\t\t\tif fieldIndex[0] != len(fields)-1 {\n\t\t\t\t\tenc.wf(\", \")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tenc.encode(key.add(keyName), fieldVal)\n\t\t\t}\n\t\t}\n\t}\n\n\tif inline {\n\t\tenc.wf(\"{\")\n\t}\n\twriteFields(fieldsDirect)\n\twriteFields(fieldsSub)\n\tif inline {\n\t\tenc.wf(\"}\")\n\t}\n}\n\n// tomlTypeOfGo returns the TOML type name of the Go value's type.\n//\n// It is used to determine whether the types of array elements are mixed (which\n// is forbidden). If the Go value is nil, then it is illegal for it to be an\n// array element, and valueIsNil is returned as true.\n//\n// The type may be `nil`, which means no concrete TOML type could be found.\nfunc tomlTypeOfGo(rv reflect.Value) tomlType {\n\tif isNil(rv) || !rv.IsValid() {\n\t\treturn nil\n\t}\n\n\tif rv.Kind() == reflect.Struct {\n\t\tif rv.Type() == timeType {\n\t\t\treturn tomlDatetime\n\t\t}\n\t\tif isMarshaler(rv) {\n\t\t\treturn tomlString\n\t\t}\n\t\treturn tomlHash\n\t}\n\n\tif isMarshaler(rv) {\n\t\treturn tomlString\n\t}\n\n\tswitch rv.Kind() {\n\tcase reflect.Bool:\n\t\treturn tomlBool\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,\n\t\treflect.Int64,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,\n\t\treflect.Uint64:\n\t\treturn tomlInteger\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn tomlFloat\n\tcase reflect.Array, reflect.Slice:\n\t\tif isTableArray(rv) {\n\t\t\treturn tomlArrayHash\n\t\t}\n\t\treturn tomlArray\n\tcase reflect.Ptr, reflect.Interface:\n\t\treturn tomlTypeOfGo(rv.Elem())\n\tcase reflect.String:\n\t\treturn tomlString\n\tcase reflect.Map:\n\t\treturn tomlHash\n\tdefault:\n\t\tencPanic(errors.New(\"unsupported type: \" + rv.Kind().String()))\n\t\tpanic(\"unreachable\")\n\t}\n}\n\nfunc isMarshaler(rv reflect.Value) bool {\n\treturn rv.Type().Implements(marshalText) || rv.Type().Implements(marshalToml)\n}\n\n// isTableArray reports if all entries in the array or slice are a table.\nfunc isTableArray(arr reflect.Value) bool {\n\tif isNil(arr) || !arr.IsValid() || arr.Len() == 0 {\n\t\treturn false\n\t}\n\n\tret := true\n\tfor i := 0; i < arr.Len(); i++ {\n\t\ttt := tomlTypeOfGo(eindirect(arr.Index(i)))\n\t\t// Don't allow nil.\n\t\tif tt == nil {\n\t\t\tencPanic(errArrayNilElement)\n\t\t}\n\n\t\tif ret && !typeEqual(tomlHash, tt) {\n\t\t\tret = false\n\t\t}\n\t}\n\treturn ret\n}\n\ntype tagOptions struct {\n\tskip      bool // \"-\"\n\tname      string\n\tomitempty bool\n\tomitzero  bool\n}\n\nfunc getOptions(tag reflect.StructTag) tagOptions {\n\tt := tag.Get(\"toml\")\n\tif t == \"-\" {\n\t\treturn tagOptions{skip: true}\n\t}\n\tvar opts tagOptions\n\tparts := strings.Split(t, \",\")\n\topts.name = parts[0]\n\tfor _, s := range parts[1:] {\n\t\tswitch s {\n\t\tcase \"omitempty\":\n\t\t\topts.omitempty = true\n\t\tcase \"omitzero\":\n\t\t\topts.omitzero = true\n\t\t}\n\t}\n\treturn opts\n}\n\nfunc isZero(rv reflect.Value) bool {\n\tswitch rv.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn rv.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn rv.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn rv.Float() == 0.0\n\t}\n\treturn false\n}\n\nfunc isEmpty(rv reflect.Value) bool {\n\tswitch rv.Kind() {\n\tcase reflect.Array, reflect.Slice, reflect.Map, reflect.String:\n\t\treturn rv.Len() == 0\n\tcase reflect.Struct:\n\t\tif rv.Type().Comparable() {\n\t\t\treturn reflect.Zero(rv.Type()).Interface() == rv.Interface()\n\t\t}\n\t\t// Need to also check if all the fields are empty, otherwise something\n\t\t// like this with uncomparable types will always return true:\n\t\t//\n\t\t//   type a struct{ field b }\n\t\t//   type b struct{ s []string }\n\t\t//   s := a{field: b{s: []string{\"AAA\"}}}\n\t\tfor i := 0; i < rv.NumField(); i++ {\n\t\t\tif !isEmpty(rv.Field(i)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tcase reflect.Bool:\n\t\treturn !rv.Bool()\n\tcase reflect.Ptr:\n\t\treturn rv.IsNil()\n\t}\n\treturn false\n}\n\nfunc (enc *Encoder) newline() {\n\tif enc.hasWritten {\n\t\tenc.wf(\"\\n\")\n\t}\n}\n\n// Write a key/value pair:\n//\n//\tkey = <any value>\n//\n// This is also used for \"k = v\" in inline tables; so something like this will\n// be written in three calls:\n//\n//\t┌───────────────────┐\n//\t│      ┌───┐  ┌────┐│\n//\tv      v   v  v    vv\n//\tkey = {k = 1, k2 = 2}\nfunc (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) {\n\t/// Marshaler used on top-level document; call eElement() to just call\n\t/// Marshal{TOML,Text}.\n\tif len(key) == 0 {\n\t\tenc.eElement(val)\n\t\treturn\n\t}\n\tenc.wf(\"%s%s = \", enc.indentStr(key), key.maybeQuoted(len(key)-1))\n\tenc.eElement(val)\n\tif !inline {\n\t\tenc.newline()\n\t}\n}\n\nfunc (enc *Encoder) wf(format string, v ...any) {\n\t_, err := fmt.Fprintf(enc.w, format, v...)\n\tif err != nil {\n\t\tencPanic(err)\n\t}\n\tenc.hasWritten = true\n}\n\nfunc (enc *Encoder) indentStr(key Key) string {\n\treturn strings.Repeat(enc.Indent, len(key)-1)\n}\n\nfunc encPanic(err error) {\n\tpanic(tomlEncodeError{err})\n}\n\n// Resolve any level of pointers to the actual value (e.g. **string → string).\nfunc eindirect(v reflect.Value) reflect.Value {\n\tif v.Kind() != reflect.Ptr && v.Kind() != reflect.Interface {\n\t\tif isMarshaler(v) {\n\t\t\treturn v\n\t\t}\n\t\tif v.CanAddr() { /// Special case for marshalers; see #358.\n\t\t\tif pv := v.Addr(); isMarshaler(pv) {\n\t\t\t\treturn pv\n\t\t\t}\n\t\t}\n\t\treturn v\n\t}\n\n\tif v.IsNil() {\n\t\treturn v\n\t}\n\n\treturn eindirect(v.Elem())\n}\n\nfunc isNil(rv reflect.Value) bool {\n\tswitch rv.Kind() {\n\tcase reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:\n\t\treturn rv.IsNil()\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/error.go",
    "content": "package toml\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// ParseError is returned when there is an error parsing the TOML syntax such as\n// invalid syntax, duplicate keys, etc.\n//\n// In addition to the error message itself, you can also print detailed location\n// information with context by using [ErrorWithPosition]:\n//\n//\ttoml: error: Key 'fruit' was already created and cannot be used as an array.\n//\n//\tAt line 4, column 2-7:\n//\n//\t      2 | fruit = []\n//\t      3 |\n//\t      4 | [[fruit]] # Not allowed\n//\t            ^^^^^\n//\n// [ErrorWithUsage] can be used to print the above with some more detailed usage\n// guidance:\n//\n//\ttoml: error: newlines not allowed within inline tables\n//\n//\tAt line 1, column 18:\n//\n//\t      1 | x = [{ key = 42 #\n//\t                           ^\n//\n//\tError help:\n//\n//\t  Inline tables must always be on a single line:\n//\n//\t      table = {key = 42, second = 43}\n//\n//\t  It is invalid to split them over multiple lines like so:\n//\n//\t      # INVALID\n//\t      table = {\n//\t          key    = 42,\n//\t          second = 43\n//\t      }\n//\n//\t  Use regular for this:\n//\n//\t      [table]\n//\t      key    = 42\n//\t      second = 43\ntype ParseError struct {\n\tMessage  string   // Short technical message.\n\tUsage    string   // Longer message with usage guidance; may be blank.\n\tPosition Position // Position of the error\n\tLastKey  string   // Last parsed key, may be blank.\n\n\t// Line the error occurred.\n\t//\n\t// Deprecated: use [Position].\n\tLine int\n\n\terr   error\n\tinput string\n}\n\n// Position of an error.\ntype Position struct {\n\tLine  int // Line number, starting at 1.\n\tCol   int // Error column, starting at 1.\n\tStart int // Start of error, as byte offset starting at 0.\n\tLen   int // Lenght of the error in bytes.\n}\n\nfunc (p Position) withCol(tomlFile string) Position {\n\tvar (\n\t\tpos   int\n\t\tlines = strings.Split(tomlFile, \"\\n\")\n\t)\n\tfor i := range lines {\n\t\tll := len(lines[i]) + 1 // +1 for the removed newline\n\t\tif pos+ll >= p.Start {\n\t\t\tp.Col = p.Start - pos + 1\n\t\t\tif p.Col < 1 { // Should never happen, but just in case.\n\t\t\t\tp.Col = 1\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tpos += ll\n\t}\n\treturn p\n}\n\nfunc (pe ParseError) Error() string {\n\tif pe.LastKey == \"\" {\n\t\treturn fmt.Sprintf(\"toml: line %d: %s\", pe.Position.Line, pe.Message)\n\t}\n\treturn fmt.Sprintf(\"toml: line %d (last key %q): %s\",\n\t\tpe.Position.Line, pe.LastKey, pe.Message)\n}\n\n// ErrorWithPosition returns the error with detailed location context.\n//\n// See the documentation on [ParseError].\nfunc (pe ParseError) ErrorWithPosition() string {\n\tif pe.input == \"\" { // Should never happen, but just in case.\n\t\treturn pe.Error()\n\t}\n\n\t// TODO: don't show control characters as literals? This may not show up\n\t// well everywhere.\n\n\tvar (\n\t\tlines = strings.Split(pe.input, \"\\n\")\n\t\tb     = new(strings.Builder)\n\t)\n\tif pe.Position.Len == 1 {\n\t\tfmt.Fprintf(b, \"toml: error: %s\\n\\nAt line %d, column %d:\\n\\n\",\n\t\t\tpe.Message, pe.Position.Line, pe.Position.Col)\n\t} else {\n\t\tfmt.Fprintf(b, \"toml: error: %s\\n\\nAt line %d, column %d-%d:\\n\\n\",\n\t\t\tpe.Message, pe.Position.Line, pe.Position.Col, pe.Position.Col+pe.Position.Len-1)\n\t}\n\tif pe.Position.Line > 2 {\n\t\tfmt.Fprintf(b, \"% 7d | %s\\n\", pe.Position.Line-2, expandTab(lines[pe.Position.Line-3]))\n\t}\n\tif pe.Position.Line > 1 {\n\t\tfmt.Fprintf(b, \"% 7d | %s\\n\", pe.Position.Line-1, expandTab(lines[pe.Position.Line-2]))\n\t}\n\n\t/// Expand tabs, so that the ^^^s are at the correct position, but leave\n\t/// \"column 10-13\" intact. Adjusting this to the visual column would be\n\t/// better, but we don't know the tabsize of the user in their editor, which\n\t/// can be 8, 4, 2, or something else. We can't know. So leaving it as the\n\t/// character index is probably the \"most correct\".\n\texpanded := expandTab(lines[pe.Position.Line-1])\n\tdiff := len(expanded) - len(lines[pe.Position.Line-1])\n\n\tfmt.Fprintf(b, \"% 7d | %s\\n\", pe.Position.Line, expanded)\n\tfmt.Fprintf(b, \"% 10s%s%s\\n\", \"\", strings.Repeat(\" \", pe.Position.Col-1+diff), strings.Repeat(\"^\", pe.Position.Len))\n\treturn b.String()\n}\n\n// ErrorWithUsage returns the error with detailed location context and usage\n// guidance.\n//\n// See the documentation on [ParseError].\nfunc (pe ParseError) ErrorWithUsage() string {\n\tm := pe.ErrorWithPosition()\n\tif u, ok := pe.err.(interface{ Usage() string }); ok && u.Usage() != \"\" {\n\t\tlines := strings.Split(strings.TrimSpace(u.Usage()), \"\\n\")\n\t\tfor i := range lines {\n\t\t\tif lines[i] != \"\" {\n\t\t\t\tlines[i] = \"    \" + lines[i]\n\t\t\t}\n\t\t}\n\t\treturn m + \"Error help:\\n\\n\" + strings.Join(lines, \"\\n\") + \"\\n\"\n\t}\n\treturn m\n}\n\nfunc expandTab(s string) string {\n\tvar (\n\t\tb    strings.Builder\n\t\tl    int\n\t\tfill = func(n int) string {\n\t\t\tb := make([]byte, n)\n\t\t\tfor i := range b {\n\t\t\t\tb[i] = ' '\n\t\t\t}\n\t\t\treturn string(b)\n\t\t}\n\t)\n\tb.Grow(len(s))\n\tfor _, r := range s {\n\t\tswitch r {\n\t\tcase '\\t':\n\t\t\ttw := 8 - l%8\n\t\t\tb.WriteString(fill(tw))\n\t\t\tl += tw\n\t\tdefault:\n\t\t\tb.WriteRune(r)\n\t\t\tl += 1\n\t\t}\n\t}\n\treturn b.String()\n}\n\ntype (\n\terrLexControl       struct{ r rune }\n\terrLexEscape        struct{ r rune }\n\terrLexUTF8          struct{ b byte }\n\terrParseDate        struct{ v string }\n\terrLexInlineTableNL struct{}\n\terrLexStringNL      struct{}\n\terrParseRange       struct {\n\t\ti    any    // int or float\n\t\tsize string // \"int64\", \"uint16\", etc.\n\t}\n\terrUnsafeFloat struct {\n\t\ti    interface{} // float32 or float64\n\t\tsize string      // \"float32\" or \"float64\"\n\t}\n\terrParseDuration struct{ d string }\n)\n\nfunc (e errLexControl) Error() string {\n\treturn fmt.Sprintf(\"TOML files cannot contain control characters: '0x%02x'\", e.r)\n}\nfunc (e errLexControl) Usage() string { return \"\" }\n\nfunc (e errLexEscape) Error() string        { return fmt.Sprintf(`invalid escape in string '\\%c'`, e.r) }\nfunc (e errLexEscape) Usage() string        { return usageEscape }\nfunc (e errLexUTF8) Error() string          { return fmt.Sprintf(\"invalid UTF-8 byte: 0x%02x\", e.b) }\nfunc (e errLexUTF8) Usage() string          { return \"\" }\nfunc (e errParseDate) Error() string        { return fmt.Sprintf(\"invalid datetime: %q\", e.v) }\nfunc (e errParseDate) Usage() string        { return usageDate }\nfunc (e errLexInlineTableNL) Error() string { return \"newlines not allowed within inline tables\" }\nfunc (e errLexInlineTableNL) Usage() string { return usageInlineNewline }\nfunc (e errLexStringNL) Error() string      { return \"strings cannot contain newlines\" }\nfunc (e errLexStringNL) Usage() string      { return usageStringNewline }\nfunc (e errParseRange) Error() string       { return fmt.Sprintf(\"%v is out of range for %s\", e.i, e.size) }\nfunc (e errParseRange) Usage() string       { return usageIntOverflow }\nfunc (e errUnsafeFloat) Error() string {\n\treturn fmt.Sprintf(\"%v is out of the safe %s range\", e.i, e.size)\n}\nfunc (e errUnsafeFloat) Usage() string   { return usageUnsafeFloat }\nfunc (e errParseDuration) Error() string { return fmt.Sprintf(\"invalid duration: %q\", e.d) }\nfunc (e errParseDuration) Usage() string { return usageDuration }\n\nconst usageEscape = `\nA '\\' inside a \"-delimited string is interpreted as an escape character.\n\nThe following escape sequences are supported:\n\\b, \\t, \\n, \\f, \\r, \\\", \\\\, \\uXXXX, and \\UXXXXXXXX\n\nTo prevent a '\\' from being recognized as an escape character, use either:\n\n- a ' or '''-delimited string; escape characters aren't processed in them; or\n- write two backslashes to get a single backslash: '\\\\'.\n\nIf you're trying to add a Windows path (e.g. \"C:\\Users\\martin\") then using '/'\ninstead of '\\' will usually also work: \"C:/Users/martin\".\n`\n\nconst usageInlineNewline = `\nInline tables must always be on a single line:\n\n    table = {key = 42, second = 43}\n\nIt is invalid to split them over multiple lines like so:\n\n    # INVALID\n    table = {\n        key    = 42,\n        second = 43\n    }\n\nUse regular for this:\n\n    [table]\n    key    = 42\n    second = 43\n`\n\nconst usageStringNewline = `\nStrings must always be on a single line, and cannot span more than one line:\n\n    # INVALID\n    string = \"Hello,\n    world!\"\n\nInstead use \"\"\" or ''' to split strings over multiple lines:\n\n    string = \"\"\"Hello,\n    world!\"\"\"\n`\n\nconst usageIntOverflow = `\nThis number is too large; this may be an error in the TOML, but it can also be a\nbug in the program that uses too small of an integer.\n\nThe maximum and minimum values are:\n\n    size   │ lowest         │ highest\n    ───────┼────────────────┼──────────────\n    int8   │ -128           │ 127\n    int16  │ -32,768        │ 32,767\n    int32  │ -2,147,483,648 │ 2,147,483,647\n    int64  │ -9.2 × 10¹⁷    │ 9.2 × 10¹⁷\n    uint8  │ 0              │ 255\n    uint16 │ 0              │ 65,535\n    uint32 │ 0              │ 4,294,967,295\n    uint64 │ 0              │ 1.8 × 10¹⁸\n\nint refers to int32 on 32-bit systems and int64 on 64-bit systems.\n`\n\nconst usageUnsafeFloat = `\nThis number is outside of the \"safe\" range for floating point numbers; whole\n(non-fractional) numbers outside the below range can not always be represented\naccurately in a float, leading to some loss of accuracy.\n\nExplicitly mark a number as a fractional unit by adding \".0\", which will incur\nsome loss of accuracy; for example:\n\n\tf = 2_000_000_000.0\n\nAccuracy ranges:\n\n\tfloat32 =            16,777,215\n\tfloat64 = 9,007,199,254,740,991\n`\n\nconst usageDuration = `\nA duration must be as \"number<unit>\", without any spaces. Valid units are:\n\n    ns         nanoseconds (billionth of a second)\n    us, µs     microseconds (millionth of a second)\n    ms         milliseconds (thousands of a second)\n    s          seconds\n    m          minutes\n    h          hours\n\nYou can combine multiple units; for example \"5m10s\" for 5 minutes and 10\nseconds.\n`\n\nconst usageDate = `\nA TOML datetime must be in one of the following formats:\n\n    2006-01-02T15:04:05Z07:00   Date and time, with timezone.\n    2006-01-02T15:04:05         Date and time, but without timezone.\n    2006-01-02                  Date without a time or timezone.\n    15:04:05                    Just a time, without any timezone.\n\nSeconds may optionally have a fraction, up to nanosecond precision:\n\n    15:04:05.123\n    15:04:05.856018510\n`\n\n// TOML 1.1:\n// The seconds part in times is optional, and may be omitted:\n//     2006-01-02T15:04Z07:00\n//     2006-01-02T15:04\n//     15:04\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/internal/tz.go",
    "content": "package internal\n\nimport \"time\"\n\n// Timezones used for local datetime, date, and time TOML types.\n//\n// The exact way times and dates without a timezone should be interpreted is not\n// well-defined in the TOML specification and left to the implementation. These\n// defaults to current local timezone offset of the computer, but this can be\n// changed by changing these variables before decoding.\n//\n// TODO:\n// Ideally we'd like to offer people the ability to configure the used timezone\n// by setting Decoder.Timezone and Encoder.Timezone; however, this is a bit\n// tricky: the reason we use three different variables for this is to support\n// round-tripping – without these specific TZ names we wouldn't know which\n// format to use.\n//\n// There isn't a good way to encode this right now though, and passing this sort\n// of information also ties in to various related issues such as string format\n// encoding, encoding of comments, etc.\n//\n// So, for the time being, just put this in internal until we can write a good\n// comprehensive API for doing all of this.\n//\n// The reason they're exported is because they're referred from in e.g.\n// internal/tag.\n//\n// Note that this behaviour is valid according to the TOML spec as the exact\n// behaviour is left up to implementations.\nvar (\n\tlocalOffset   = func() int { _, o := time.Now().Zone(); return o }()\n\tLocalDatetime = time.FixedZone(\"datetime-local\", localOffset)\n\tLocalDate     = time.FixedZone(\"date-local\", localOffset)\n\tLocalTime     = time.FixedZone(\"time-local\", localOffset)\n)\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/lex.go",
    "content": "package toml\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\ntype itemType int\n\nconst (\n\titemError itemType = iota\n\titemNIL            // used in the parser to indicate no type\n\titemEOF\n\titemText\n\titemString\n\titemStringEsc\n\titemRawString\n\titemMultilineString\n\titemRawMultilineString\n\titemBool\n\titemInteger\n\titemFloat\n\titemDatetime\n\titemArray // the start of an array\n\titemArrayEnd\n\titemTableStart\n\titemTableEnd\n\titemArrayTableStart\n\titemArrayTableEnd\n\titemKeyStart\n\titemKeyEnd\n\titemCommentStart\n\titemInlineTableStart\n\titemInlineTableEnd\n)\n\nconst eof = 0\n\ntype stateFn func(lx *lexer) stateFn\n\nfunc (p Position) String() string {\n\treturn fmt.Sprintf(\"at line %d; start %d; length %d\", p.Line, p.Start, p.Len)\n}\n\ntype lexer struct {\n\tinput    string\n\tstart    int\n\tpos      int\n\tline     int\n\tstate    stateFn\n\titems    chan item\n\ttomlNext bool\n\tesc      bool\n\n\t// Allow for backing up up to 4 runes. This is necessary because TOML\n\t// contains 3-rune tokens (\"\"\" and ''').\n\tprevWidths [4]int\n\tnprev      int  // how many of prevWidths are in use\n\tatEOF      bool // If we emit an eof, we can still back up, but it is not OK to call next again.\n\n\t// A stack of state functions used to maintain context.\n\t//\n\t// The idea is to reuse parts of the state machine in various places. For\n\t// example, values can appear at the top level or within arbitrarily nested\n\t// arrays. The last state on the stack is used after a value has been lexed.\n\t// Similarly for comments.\n\tstack []stateFn\n}\n\ntype item struct {\n\ttyp itemType\n\tval string\n\terr error\n\tpos Position\n}\n\nfunc (lx *lexer) nextItem() item {\n\tfor {\n\t\tselect {\n\t\tcase item := <-lx.items:\n\t\t\treturn item\n\t\tdefault:\n\t\t\tlx.state = lx.state(lx)\n\t\t\t//fmt.Printf(\"     STATE %-24s  current: %-10s\tstack: %s\\n\", lx.state, lx.current(), lx.stack)\n\t\t}\n\t}\n}\n\nfunc lex(input string, tomlNext bool) *lexer {\n\tlx := &lexer{\n\t\tinput:    input,\n\t\tstate:    lexTop,\n\t\titems:    make(chan item, 10),\n\t\tstack:    make([]stateFn, 0, 10),\n\t\tline:     1,\n\t\ttomlNext: tomlNext,\n\t}\n\treturn lx\n}\n\nfunc (lx *lexer) push(state stateFn) {\n\tlx.stack = append(lx.stack, state)\n}\n\nfunc (lx *lexer) pop() stateFn {\n\tif len(lx.stack) == 0 {\n\t\treturn lx.errorf(\"BUG in lexer: no states to pop\")\n\t}\n\tlast := lx.stack[len(lx.stack)-1]\n\tlx.stack = lx.stack[0 : len(lx.stack)-1]\n\treturn last\n}\n\nfunc (lx *lexer) current() string {\n\treturn lx.input[lx.start:lx.pos]\n}\n\nfunc (lx lexer) getPos() Position {\n\tp := Position{\n\t\tLine:  lx.line,\n\t\tStart: lx.start,\n\t\tLen:   lx.pos - lx.start,\n\t}\n\tif p.Len <= 0 {\n\t\tp.Len = 1\n\t}\n\treturn p\n}\n\nfunc (lx *lexer) emit(typ itemType) {\n\t// Needed for multiline strings ending with an incomplete UTF-8 sequence.\n\tif lx.start > lx.pos {\n\t\tlx.error(errLexUTF8{lx.input[lx.pos]})\n\t\treturn\n\t}\n\tlx.items <- item{typ: typ, pos: lx.getPos(), val: lx.current()}\n\tlx.start = lx.pos\n}\n\nfunc (lx *lexer) emitTrim(typ itemType) {\n\tlx.items <- item{typ: typ, pos: lx.getPos(), val: strings.TrimSpace(lx.current())}\n\tlx.start = lx.pos\n}\n\nfunc (lx *lexer) next() (r rune) {\n\tif lx.atEOF {\n\t\tpanic(\"BUG in lexer: next called after EOF\")\n\t}\n\tif lx.pos >= len(lx.input) {\n\t\tlx.atEOF = true\n\t\treturn eof\n\t}\n\n\tif lx.input[lx.pos] == '\\n' {\n\t\tlx.line++\n\t}\n\tlx.prevWidths[3] = lx.prevWidths[2]\n\tlx.prevWidths[2] = lx.prevWidths[1]\n\tlx.prevWidths[1] = lx.prevWidths[0]\n\tif lx.nprev < 4 {\n\t\tlx.nprev++\n\t}\n\n\tr, w := utf8.DecodeRuneInString(lx.input[lx.pos:])\n\tif r == utf8.RuneError && w == 1 {\n\t\tlx.error(errLexUTF8{lx.input[lx.pos]})\n\t\treturn utf8.RuneError\n\t}\n\n\t// Note: don't use peek() here, as this calls next().\n\tif isControl(r) || (r == '\\r' && (len(lx.input)-1 == lx.pos || lx.input[lx.pos+1] != '\\n')) {\n\t\tlx.errorControlChar(r)\n\t\treturn utf8.RuneError\n\t}\n\n\tlx.prevWidths[0] = w\n\tlx.pos += w\n\treturn r\n}\n\n// ignore skips over the pending input before this point.\nfunc (lx *lexer) ignore() {\n\tlx.start = lx.pos\n}\n\n// backup steps back one rune. Can be called 4 times between calls to next.\nfunc (lx *lexer) backup() {\n\tif lx.atEOF {\n\t\tlx.atEOF = false\n\t\treturn\n\t}\n\tif lx.nprev < 1 {\n\t\tpanic(\"BUG in lexer: backed up too far\")\n\t}\n\tw := lx.prevWidths[0]\n\tlx.prevWidths[0] = lx.prevWidths[1]\n\tlx.prevWidths[1] = lx.prevWidths[2]\n\tlx.prevWidths[2] = lx.prevWidths[3]\n\tlx.nprev--\n\n\tlx.pos -= w\n\tif lx.pos < len(lx.input) && lx.input[lx.pos] == '\\n' {\n\t\tlx.line--\n\t}\n}\n\n// accept consumes the next rune if it's equal to `valid`.\nfunc (lx *lexer) accept(valid rune) bool {\n\tif lx.next() == valid {\n\t\treturn true\n\t}\n\tlx.backup()\n\treturn false\n}\n\n// peek returns but does not consume the next rune in the input.\nfunc (lx *lexer) peek() rune {\n\tr := lx.next()\n\tlx.backup()\n\treturn r\n}\n\n// skip ignores all input that matches the given predicate.\nfunc (lx *lexer) skip(pred func(rune) bool) {\n\tfor {\n\t\tr := lx.next()\n\t\tif pred(r) {\n\t\t\tcontinue\n\t\t}\n\t\tlx.backup()\n\t\tlx.ignore()\n\t\treturn\n\t}\n}\n\n// error stops all lexing by emitting an error and returning `nil`.\n//\n// Note that any value that is a character is escaped if it's a special\n// character (newlines, tabs, etc.).\nfunc (lx *lexer) error(err error) stateFn {\n\tif lx.atEOF {\n\t\treturn lx.errorPrevLine(err)\n\t}\n\tlx.items <- item{typ: itemError, pos: lx.getPos(), err: err}\n\treturn nil\n}\n\n// errorfPrevline is like error(), but sets the position to the last column of\n// the previous line.\n//\n// This is so that unexpected EOF or NL errors don't show on a new blank line.\nfunc (lx *lexer) errorPrevLine(err error) stateFn {\n\tpos := lx.getPos()\n\tpos.Line--\n\tpos.Len = 1\n\tpos.Start = lx.pos - 1\n\tlx.items <- item{typ: itemError, pos: pos, err: err}\n\treturn nil\n}\n\n// errorPos is like error(), but allows explicitly setting the position.\nfunc (lx *lexer) errorPos(start, length int, err error) stateFn {\n\tpos := lx.getPos()\n\tpos.Start = start\n\tpos.Len = length\n\tlx.items <- item{typ: itemError, pos: pos, err: err}\n\treturn nil\n}\n\n// errorf is like error, and creates a new error.\nfunc (lx *lexer) errorf(format string, values ...any) stateFn {\n\tif lx.atEOF {\n\t\tpos := lx.getPos()\n\t\tpos.Line--\n\t\tpos.Len = 1\n\t\tpos.Start = lx.pos - 1\n\t\tlx.items <- item{typ: itemError, pos: pos, err: fmt.Errorf(format, values...)}\n\t\treturn nil\n\t}\n\tlx.items <- item{typ: itemError, pos: lx.getPos(), err: fmt.Errorf(format, values...)}\n\treturn nil\n}\n\nfunc (lx *lexer) errorControlChar(cc rune) stateFn {\n\treturn lx.errorPos(lx.pos-1, 1, errLexControl{cc})\n}\n\n// lexTop consumes elements at the top level of TOML data.\nfunc lexTop(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isWhitespace(r) || isNL(r) {\n\t\treturn lexSkip(lx, lexTop)\n\t}\n\tswitch r {\n\tcase '#':\n\t\tlx.push(lexTop)\n\t\treturn lexCommentStart\n\tcase '[':\n\t\treturn lexTableStart\n\tcase eof:\n\t\tif lx.pos > lx.start {\n\t\t\treturn lx.errorf(\"unexpected EOF\")\n\t\t}\n\t\tlx.emit(itemEOF)\n\t\treturn nil\n\t}\n\n\t// At this point, the only valid item can be a key, so we back up\n\t// and let the key lexer do the rest.\n\tlx.backup()\n\tlx.push(lexTopEnd)\n\treturn lexKeyStart\n}\n\n// lexTopEnd is entered whenever a top-level item has been consumed. (A value\n// or a table.) It must see only whitespace, and will turn back to lexTop\n// upon a newline. If it sees EOF, it will quit the lexer successfully.\nfunc lexTopEnd(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase r == '#':\n\t\t// a comment will read to a newline for us.\n\t\tlx.push(lexTop)\n\t\treturn lexCommentStart\n\tcase isWhitespace(r):\n\t\treturn lexTopEnd\n\tcase isNL(r):\n\t\tlx.ignore()\n\t\treturn lexTop\n\tcase r == eof:\n\t\tlx.emit(itemEOF)\n\t\treturn nil\n\t}\n\treturn lx.errorf(\"expected a top-level item to end with a newline, comment, or EOF, but got %q instead\", r)\n}\n\n// lexTable lexes the beginning of a table. Namely, it makes sure that\n// it starts with a character other than '.' and ']'.\n// It assumes that '[' has already been consumed.\n// It also handles the case that this is an item in an array of tables.\n// e.g., '[[name]]'.\nfunc lexTableStart(lx *lexer) stateFn {\n\tif lx.peek() == '[' {\n\t\tlx.next()\n\t\tlx.emit(itemArrayTableStart)\n\t\tlx.push(lexArrayTableEnd)\n\t} else {\n\t\tlx.emit(itemTableStart)\n\t\tlx.push(lexTableEnd)\n\t}\n\treturn lexTableNameStart\n}\n\nfunc lexTableEnd(lx *lexer) stateFn {\n\tlx.emit(itemTableEnd)\n\treturn lexTopEnd\n}\n\nfunc lexArrayTableEnd(lx *lexer) stateFn {\n\tif r := lx.next(); r != ']' {\n\t\treturn lx.errorf(\"expected end of table array name delimiter ']', but got %q instead\", r)\n\t}\n\tlx.emit(itemArrayTableEnd)\n\treturn lexTopEnd\n}\n\nfunc lexTableNameStart(lx *lexer) stateFn {\n\tlx.skip(isWhitespace)\n\tswitch r := lx.peek(); {\n\tcase r == ']' || r == eof:\n\t\treturn lx.errorf(\"unexpected end of table name (table names cannot be empty)\")\n\tcase r == '.':\n\t\treturn lx.errorf(\"unexpected table separator (table names cannot be empty)\")\n\tcase r == '\"' || r == '\\'':\n\t\tlx.ignore()\n\t\tlx.push(lexTableNameEnd)\n\t\treturn lexQuotedName\n\tdefault:\n\t\tlx.push(lexTableNameEnd)\n\t\treturn lexBareName\n\t}\n}\n\n// lexTableNameEnd reads the end of a piece of a table name, optionally\n// consuming whitespace.\nfunc lexTableNameEnd(lx *lexer) stateFn {\n\tlx.skip(isWhitespace)\n\tswitch r := lx.next(); {\n\tcase isWhitespace(r):\n\t\treturn lexTableNameEnd\n\tcase r == '.':\n\t\tlx.ignore()\n\t\treturn lexTableNameStart\n\tcase r == ']':\n\t\treturn lx.pop()\n\tdefault:\n\t\treturn lx.errorf(\"expected '.' or ']' to end table name, but got %q instead\", r)\n\t}\n}\n\n// lexBareName lexes one part of a key or table.\n//\n// It assumes that at least one valid character for the table has already been\n// read.\n//\n// Lexes only one part, e.g. only 'a' inside 'a.b'.\nfunc lexBareName(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isBareKeyChar(r, lx.tomlNext) {\n\t\treturn lexBareName\n\t}\n\tlx.backup()\n\tlx.emit(itemText)\n\treturn lx.pop()\n}\n\n// lexBareName lexes one part of a key or table.\n//\n// It assumes that at least one valid character for the table has already been\n// read.\n//\n// Lexes only one part, e.g. only '\"a\"' inside '\"a\".b'.\nfunc lexQuotedName(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase isWhitespace(r):\n\t\treturn lexSkip(lx, lexValue)\n\tcase r == '\"':\n\t\tlx.ignore() // ignore the '\"'\n\t\treturn lexString\n\tcase r == '\\'':\n\t\tlx.ignore() // ignore the \"'\"\n\t\treturn lexRawString\n\tcase r == eof:\n\t\treturn lx.errorf(\"unexpected EOF; expected value\")\n\tdefault:\n\t\treturn lx.errorf(\"expected value but found %q instead\", r)\n\t}\n}\n\n// lexKeyStart consumes all key parts until a '='.\nfunc lexKeyStart(lx *lexer) stateFn {\n\tlx.skip(isWhitespace)\n\tswitch r := lx.peek(); {\n\tcase r == '=' || r == eof:\n\t\treturn lx.errorf(\"unexpected '=': key name appears blank\")\n\tcase r == '.':\n\t\treturn lx.errorf(\"unexpected '.': keys cannot start with a '.'\")\n\tcase r == '\"' || r == '\\'':\n\t\tlx.ignore()\n\t\tfallthrough\n\tdefault: // Bare key\n\t\tlx.emit(itemKeyStart)\n\t\treturn lexKeyNameStart\n\t}\n}\n\nfunc lexKeyNameStart(lx *lexer) stateFn {\n\tlx.skip(isWhitespace)\n\tswitch r := lx.peek(); {\n\tcase r == '=' || r == eof:\n\t\treturn lx.errorf(\"unexpected '='\")\n\tcase r == '.':\n\t\treturn lx.errorf(\"unexpected '.'\")\n\tcase r == '\"' || r == '\\'':\n\t\tlx.ignore()\n\t\tlx.push(lexKeyEnd)\n\t\treturn lexQuotedName\n\tdefault:\n\t\tlx.push(lexKeyEnd)\n\t\treturn lexBareName\n\t}\n}\n\n// lexKeyEnd consumes the end of a key and trims whitespace (up to the key\n// separator).\nfunc lexKeyEnd(lx *lexer) stateFn {\n\tlx.skip(isWhitespace)\n\tswitch r := lx.next(); {\n\tcase isWhitespace(r):\n\t\treturn lexSkip(lx, lexKeyEnd)\n\tcase r == eof:\n\t\treturn lx.errorf(\"unexpected EOF; expected key separator '='\")\n\tcase r == '.':\n\t\tlx.ignore()\n\t\treturn lexKeyNameStart\n\tcase r == '=':\n\t\tlx.emit(itemKeyEnd)\n\t\treturn lexSkip(lx, lexValue)\n\tdefault:\n\t\tif r == '\\n' {\n\t\t\treturn lx.errorPrevLine(fmt.Errorf(\"expected '.' or '=', but got %q instead\", r))\n\t\t}\n\t\treturn lx.errorf(\"expected '.' or '=', but got %q instead\", r)\n\t}\n}\n\n// lexValue starts the consumption of a value anywhere a value is expected.\n// lexValue will ignore whitespace.\n// After a value is lexed, the last state on the next is popped and returned.\nfunc lexValue(lx *lexer) stateFn {\n\t// We allow whitespace to precede a value, but NOT newlines.\n\t// In array syntax, the array states are responsible for ignoring newlines.\n\tr := lx.next()\n\tswitch {\n\tcase isWhitespace(r):\n\t\treturn lexSkip(lx, lexValue)\n\tcase isDigit(r):\n\t\tlx.backup() // avoid an extra state and use the same as above\n\t\treturn lexNumberOrDateStart\n\t}\n\tswitch r {\n\tcase '[':\n\t\tlx.ignore()\n\t\tlx.emit(itemArray)\n\t\treturn lexArrayValue\n\tcase '{':\n\t\tlx.ignore()\n\t\tlx.emit(itemInlineTableStart)\n\t\treturn lexInlineTableValue\n\tcase '\"':\n\t\tif lx.accept('\"') {\n\t\t\tif lx.accept('\"') {\n\t\t\t\tlx.ignore() // Ignore \"\"\"\n\t\t\t\treturn lexMultilineString\n\t\t\t}\n\t\t\tlx.backup()\n\t\t}\n\t\tlx.ignore() // ignore the '\"'\n\t\treturn lexString\n\tcase '\\'':\n\t\tif lx.accept('\\'') {\n\t\t\tif lx.accept('\\'') {\n\t\t\t\tlx.ignore() // Ignore \"\"\"\n\t\t\t\treturn lexMultilineRawString\n\t\t\t}\n\t\t\tlx.backup()\n\t\t}\n\t\tlx.ignore() // ignore the \"'\"\n\t\treturn lexRawString\n\tcase '.': // special error case, be kind to users\n\t\treturn lx.errorf(\"floats must start with a digit, not '.'\")\n\tcase 'i', 'n':\n\t\tif (lx.accept('n') && lx.accept('f')) || (lx.accept('a') && lx.accept('n')) {\n\t\t\tlx.emit(itemFloat)\n\t\t\treturn lx.pop()\n\t\t}\n\tcase '-', '+':\n\t\treturn lexDecimalNumberStart\n\t}\n\tif unicode.IsLetter(r) {\n\t\t// Be permissive here; lexBool will give a nice error if the\n\t\t// user wrote something like\n\t\t//   x = foo\n\t\t// (i.e. not 'true' or 'false' but is something else word-like.)\n\t\tlx.backup()\n\t\treturn lexBool\n\t}\n\tif r == eof {\n\t\treturn lx.errorf(\"unexpected EOF; expected value\")\n\t}\n\tif r == '\\n' {\n\t\treturn lx.errorPrevLine(fmt.Errorf(\"expected value but found %q instead\", r))\n\t}\n\treturn lx.errorf(\"expected value but found %q instead\", r)\n}\n\n// lexArrayValue consumes one value in an array. It assumes that '[' or ','\n// have already been consumed. All whitespace and newlines are ignored.\nfunc lexArrayValue(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase isWhitespace(r) || isNL(r):\n\t\treturn lexSkip(lx, lexArrayValue)\n\tcase r == '#':\n\t\tlx.push(lexArrayValue)\n\t\treturn lexCommentStart\n\tcase r == ',':\n\t\treturn lx.errorf(\"unexpected comma\")\n\tcase r == ']':\n\t\treturn lexArrayEnd\n\t}\n\n\tlx.backup()\n\tlx.push(lexArrayValueEnd)\n\treturn lexValue\n}\n\n// lexArrayValueEnd consumes everything between the end of an array value and\n// the next value (or the end of the array): it ignores whitespace and newlines\n// and expects either a ',' or a ']'.\nfunc lexArrayValueEnd(lx *lexer) stateFn {\n\tswitch r := lx.next(); {\n\tcase isWhitespace(r) || isNL(r):\n\t\treturn lexSkip(lx, lexArrayValueEnd)\n\tcase r == '#':\n\t\tlx.push(lexArrayValueEnd)\n\t\treturn lexCommentStart\n\tcase r == ',':\n\t\tlx.ignore()\n\t\treturn lexArrayValue // move on to the next value\n\tcase r == ']':\n\t\treturn lexArrayEnd\n\tdefault:\n\t\treturn lx.errorf(\"expected a comma (',') or array terminator (']'), but got %s\", runeOrEOF(r))\n\t}\n}\n\n// lexArrayEnd finishes the lexing of an array.\n// It assumes that a ']' has just been consumed.\nfunc lexArrayEnd(lx *lexer) stateFn {\n\tlx.ignore()\n\tlx.emit(itemArrayEnd)\n\treturn lx.pop()\n}\n\n// lexInlineTableValue consumes one key/value pair in an inline table.\n// It assumes that '{' or ',' have already been consumed. Whitespace is ignored.\nfunc lexInlineTableValue(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase isWhitespace(r):\n\t\treturn lexSkip(lx, lexInlineTableValue)\n\tcase isNL(r):\n\t\tif lx.tomlNext {\n\t\t\treturn lexSkip(lx, lexInlineTableValue)\n\t\t}\n\t\treturn lx.errorPrevLine(errLexInlineTableNL{})\n\tcase r == '#':\n\t\tlx.push(lexInlineTableValue)\n\t\treturn lexCommentStart\n\tcase r == ',':\n\t\treturn lx.errorf(\"unexpected comma\")\n\tcase r == '}':\n\t\treturn lexInlineTableEnd\n\t}\n\tlx.backup()\n\tlx.push(lexInlineTableValueEnd)\n\treturn lexKeyStart\n}\n\n// lexInlineTableValueEnd consumes everything between the end of an inline table\n// key/value pair and the next pair (or the end of the table):\n// it ignores whitespace and expects either a ',' or a '}'.\nfunc lexInlineTableValueEnd(lx *lexer) stateFn {\n\tswitch r := lx.next(); {\n\tcase isWhitespace(r):\n\t\treturn lexSkip(lx, lexInlineTableValueEnd)\n\tcase isNL(r):\n\t\tif lx.tomlNext {\n\t\t\treturn lexSkip(lx, lexInlineTableValueEnd)\n\t\t}\n\t\treturn lx.errorPrevLine(errLexInlineTableNL{})\n\tcase r == '#':\n\t\tlx.push(lexInlineTableValueEnd)\n\t\treturn lexCommentStart\n\tcase r == ',':\n\t\tlx.ignore()\n\t\tlx.skip(isWhitespace)\n\t\tif lx.peek() == '}' {\n\t\t\tif lx.tomlNext {\n\t\t\t\treturn lexInlineTableValueEnd\n\t\t\t}\n\t\t\treturn lx.errorf(\"trailing comma not allowed in inline tables\")\n\t\t}\n\t\treturn lexInlineTableValue\n\tcase r == '}':\n\t\treturn lexInlineTableEnd\n\tdefault:\n\t\treturn lx.errorf(\"expected a comma or an inline table terminator '}', but got %s instead\", runeOrEOF(r))\n\t}\n}\n\nfunc runeOrEOF(r rune) string {\n\tif r == eof {\n\t\treturn \"end of file\"\n\t}\n\treturn \"'\" + string(r) + \"'\"\n}\n\n// lexInlineTableEnd finishes the lexing of an inline table.\n// It assumes that a '}' has just been consumed.\nfunc lexInlineTableEnd(lx *lexer) stateFn {\n\tlx.ignore()\n\tlx.emit(itemInlineTableEnd)\n\treturn lx.pop()\n}\n\n// lexString consumes the inner contents of a string. It assumes that the\n// beginning '\"' has already been consumed and ignored.\nfunc lexString(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase r == eof:\n\t\treturn lx.errorf(`unexpected EOF; expected '\"'`)\n\tcase isNL(r):\n\t\treturn lx.errorPrevLine(errLexStringNL{})\n\tcase r == '\\\\':\n\t\tlx.push(lexString)\n\t\treturn lexStringEscape\n\tcase r == '\"':\n\t\tlx.backup()\n\t\tif lx.esc {\n\t\t\tlx.esc = false\n\t\t\tlx.emit(itemStringEsc)\n\t\t} else {\n\t\t\tlx.emit(itemString)\n\t\t}\n\t\tlx.next()\n\t\tlx.ignore()\n\t\treturn lx.pop()\n\t}\n\treturn lexString\n}\n\n// lexMultilineString consumes the inner contents of a string. It assumes that\n// the beginning '\"\"\"' has already been consumed and ignored.\nfunc lexMultilineString(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch r {\n\tdefault:\n\t\treturn lexMultilineString\n\tcase eof:\n\t\treturn lx.errorf(`unexpected EOF; expected '\"\"\"'`)\n\tcase '\\\\':\n\t\treturn lexMultilineStringEscape\n\tcase '\"':\n\t\t/// Found \" → try to read two more \"\".\n\t\tif lx.accept('\"') {\n\t\t\tif lx.accept('\"') {\n\t\t\t\t/// Peek ahead: the string can contain \" and \"\", including at the\n\t\t\t\t/// end: \"\"\"str\"\"\"\"\"\n\t\t\t\t/// 6 or more at the end, however, is an error.\n\t\t\t\tif lx.peek() == '\"' {\n\t\t\t\t\t/// Check if we already lexed 5 's; if so we have 6 now, and\n\t\t\t\t\t/// that's just too many man!\n\t\t\t\t\t///\n\t\t\t\t\t/// Second check is for the edge case:\n\t\t\t\t\t///\n\t\t\t\t\t///            two quotes allowed.\n\t\t\t\t\t///            vv\n\t\t\t\t\t///   \"\"\"lol \\\"\"\"\"\"\"\n\t\t\t\t\t///          ^^  ^^^---- closing three\n\t\t\t\t\t///     escaped\n\t\t\t\t\t///\n\t\t\t\t\t/// But ugly, but it works\n\t\t\t\t\tif strings.HasSuffix(lx.current(), `\"\"\"\"\"`) && !strings.HasSuffix(lx.current(), `\\\"\"\"\"\"`) {\n\t\t\t\t\t\treturn lx.errorf(`unexpected '\"\"\"\"\"\"'`)\n\t\t\t\t\t}\n\t\t\t\t\tlx.backup()\n\t\t\t\t\tlx.backup()\n\t\t\t\t\treturn lexMultilineString\n\t\t\t\t}\n\n\t\t\t\tlx.backup() /// backup: don't include the \"\"\" in the item.\n\t\t\t\tlx.backup()\n\t\t\t\tlx.backup()\n\t\t\t\tlx.esc = false\n\t\t\t\tlx.emit(itemMultilineString)\n\t\t\t\tlx.next() /// Read over ''' again and discard it.\n\t\t\t\tlx.next()\n\t\t\t\tlx.next()\n\t\t\t\tlx.ignore()\n\t\t\t\treturn lx.pop()\n\t\t\t}\n\t\t\tlx.backup()\n\t\t}\n\t\treturn lexMultilineString\n\t}\n}\n\n// lexRawString consumes a raw string. Nothing can be escaped in such a string.\n// It assumes that the beginning \"'\" has already been consumed and ignored.\nfunc lexRawString(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tdefault:\n\t\treturn lexRawString\n\tcase r == eof:\n\t\treturn lx.errorf(`unexpected EOF; expected \"'\"`)\n\tcase isNL(r):\n\t\treturn lx.errorPrevLine(errLexStringNL{})\n\tcase r == '\\'':\n\t\tlx.backup()\n\t\tlx.emit(itemRawString)\n\t\tlx.next()\n\t\tlx.ignore()\n\t\treturn lx.pop()\n\t}\n}\n\n// lexMultilineRawString consumes a raw string. Nothing can be escaped in such a\n// string. It assumes that the beginning triple-' has already been consumed and\n// ignored.\nfunc lexMultilineRawString(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch r {\n\tdefault:\n\t\treturn lexMultilineRawString\n\tcase eof:\n\t\treturn lx.errorf(`unexpected EOF; expected \"'''\"`)\n\tcase '\\'':\n\t\t/// Found ' → try to read two more ''.\n\t\tif lx.accept('\\'') {\n\t\t\tif lx.accept('\\'') {\n\t\t\t\t/// Peek ahead: the string can contain ' and '', including at the\n\t\t\t\t/// end: '''str'''''\n\t\t\t\t/// 6 or more at the end, however, is an error.\n\t\t\t\tif lx.peek() == '\\'' {\n\t\t\t\t\t/// Check if we already lexed 5 's; if so we have 6 now, and\n\t\t\t\t\t/// that's just too many man!\n\t\t\t\t\tif strings.HasSuffix(lx.current(), \"'''''\") {\n\t\t\t\t\t\treturn lx.errorf(`unexpected \"''''''\"`)\n\t\t\t\t\t}\n\t\t\t\t\tlx.backup()\n\t\t\t\t\tlx.backup()\n\t\t\t\t\treturn lexMultilineRawString\n\t\t\t\t}\n\n\t\t\t\tlx.backup() /// backup: don't include the ''' in the item.\n\t\t\t\tlx.backup()\n\t\t\t\tlx.backup()\n\t\t\t\tlx.emit(itemRawMultilineString)\n\t\t\t\tlx.next() /// Read over ''' again and discard it.\n\t\t\t\tlx.next()\n\t\t\t\tlx.next()\n\t\t\t\tlx.ignore()\n\t\t\t\treturn lx.pop()\n\t\t\t}\n\t\t\tlx.backup()\n\t\t}\n\t\treturn lexMultilineRawString\n\t}\n}\n\n// lexMultilineStringEscape consumes an escaped character. It assumes that the\n// preceding '\\\\' has already been consumed.\nfunc lexMultilineStringEscape(lx *lexer) stateFn {\n\tif isNL(lx.next()) { /// \\ escaping newline.\n\t\treturn lexMultilineString\n\t}\n\tlx.backup()\n\tlx.push(lexMultilineString)\n\treturn lexStringEscape(lx)\n}\n\nfunc lexStringEscape(lx *lexer) stateFn {\n\tlx.esc = true\n\tr := lx.next()\n\tswitch r {\n\tcase 'e':\n\t\tif !lx.tomlNext {\n\t\t\treturn lx.error(errLexEscape{r})\n\t\t}\n\t\tfallthrough\n\tcase 'b':\n\t\tfallthrough\n\tcase 't':\n\t\tfallthrough\n\tcase 'n':\n\t\tfallthrough\n\tcase 'f':\n\t\tfallthrough\n\tcase 'r':\n\t\tfallthrough\n\tcase '\"':\n\t\tfallthrough\n\tcase ' ', '\\t':\n\t\t// Inside \"\"\" .. \"\"\" strings you can use \\ to escape newlines, and any\n\t\t// amount of whitespace can be between the \\ and \\n.\n\t\tfallthrough\n\tcase '\\\\':\n\t\treturn lx.pop()\n\tcase 'x':\n\t\tif !lx.tomlNext {\n\t\t\treturn lx.error(errLexEscape{r})\n\t\t}\n\t\treturn lexHexEscape\n\tcase 'u':\n\t\treturn lexShortUnicodeEscape\n\tcase 'U':\n\t\treturn lexLongUnicodeEscape\n\t}\n\treturn lx.error(errLexEscape{r})\n}\n\nfunc lexHexEscape(lx *lexer) stateFn {\n\tvar r rune\n\tfor i := 0; i < 2; i++ {\n\t\tr = lx.next()\n\t\tif !isHex(r) {\n\t\t\treturn lx.errorf(`expected two hexadecimal digits after '\\x', but got %q instead`, lx.current())\n\t\t}\n\t}\n\treturn lx.pop()\n}\n\nfunc lexShortUnicodeEscape(lx *lexer) stateFn {\n\tvar r rune\n\tfor i := 0; i < 4; i++ {\n\t\tr = lx.next()\n\t\tif !isHex(r) {\n\t\t\treturn lx.errorf(`expected four hexadecimal digits after '\\u', but got %q instead`, lx.current())\n\t\t}\n\t}\n\treturn lx.pop()\n}\n\nfunc lexLongUnicodeEscape(lx *lexer) stateFn {\n\tvar r rune\n\tfor i := 0; i < 8; i++ {\n\t\tr = lx.next()\n\t\tif !isHex(r) {\n\t\t\treturn lx.errorf(`expected eight hexadecimal digits after '\\U', but got %q instead`, lx.current())\n\t\t}\n\t}\n\treturn lx.pop()\n}\n\n// lexNumberOrDateStart processes the first character of a value which begins\n// with a digit. It exists to catch values starting with '0', so that\n// lexBaseNumberOrDate can differentiate base prefixed integers from other\n// types.\nfunc lexNumberOrDateStart(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch r {\n\tcase '0':\n\t\treturn lexBaseNumberOrDate\n\t}\n\n\tif !isDigit(r) {\n\t\t// The only way to reach this state is if the value starts\n\t\t// with a digit, so specifically treat anything else as an\n\t\t// error.\n\t\treturn lx.errorf(\"expected a digit but got %q\", r)\n\t}\n\n\treturn lexNumberOrDate\n}\n\n// lexNumberOrDate consumes either an integer, float or datetime.\nfunc lexNumberOrDate(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isDigit(r) {\n\t\treturn lexNumberOrDate\n\t}\n\tswitch r {\n\tcase '-', ':':\n\t\treturn lexDatetime\n\tcase '_':\n\t\treturn lexDecimalNumber\n\tcase '.', 'e', 'E':\n\t\treturn lexFloat\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexDatetime consumes a Datetime, to a first approximation.\n// The parser validates that it matches one of the accepted formats.\nfunc lexDatetime(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isDigit(r) {\n\t\treturn lexDatetime\n\t}\n\tswitch r {\n\tcase '-', ':', 'T', 't', ' ', '.', 'Z', 'z', '+':\n\t\treturn lexDatetime\n\t}\n\n\tlx.backup()\n\tlx.emitTrim(itemDatetime)\n\treturn lx.pop()\n}\n\n// lexHexInteger consumes a hexadecimal integer after seeing the '0x' prefix.\nfunc lexHexInteger(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isHex(r) {\n\t\treturn lexHexInteger\n\t}\n\tswitch r {\n\tcase '_':\n\t\treturn lexHexInteger\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexOctalInteger consumes an octal integer after seeing the '0o' prefix.\nfunc lexOctalInteger(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isOctal(r) {\n\t\treturn lexOctalInteger\n\t}\n\tswitch r {\n\tcase '_':\n\t\treturn lexOctalInteger\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexBinaryInteger consumes a binary integer after seeing the '0b' prefix.\nfunc lexBinaryInteger(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isBinary(r) {\n\t\treturn lexBinaryInteger\n\t}\n\tswitch r {\n\tcase '_':\n\t\treturn lexBinaryInteger\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexDecimalNumber consumes a decimal float or integer.\nfunc lexDecimalNumber(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isDigit(r) {\n\t\treturn lexDecimalNumber\n\t}\n\tswitch r {\n\tcase '.', 'e', 'E':\n\t\treturn lexFloat\n\tcase '_':\n\t\treturn lexDecimalNumber\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexDecimalNumber consumes the first digit of a number beginning with a sign.\n// It assumes the sign has already been consumed. Values which start with a sign\n// are only allowed to be decimal integers or floats.\n//\n// The special \"nan\" and \"inf\" values are also recognized.\nfunc lexDecimalNumberStart(lx *lexer) stateFn {\n\tr := lx.next()\n\n\t// Special error cases to give users better error messages\n\tswitch r {\n\tcase 'i':\n\t\tif !lx.accept('n') || !lx.accept('f') {\n\t\t\treturn lx.errorf(\"invalid float: '%s'\", lx.current())\n\t\t}\n\t\tlx.emit(itemFloat)\n\t\treturn lx.pop()\n\tcase 'n':\n\t\tif !lx.accept('a') || !lx.accept('n') {\n\t\t\treturn lx.errorf(\"invalid float: '%s'\", lx.current())\n\t\t}\n\t\tlx.emit(itemFloat)\n\t\treturn lx.pop()\n\tcase '0':\n\t\tp := lx.peek()\n\t\tswitch p {\n\t\tcase 'b', 'o', 'x':\n\t\t\treturn lx.errorf(\"cannot use sign with non-decimal numbers: '%s%c'\", lx.current(), p)\n\t\t}\n\tcase '.':\n\t\treturn lx.errorf(\"floats must start with a digit, not '.'\")\n\t}\n\n\tif isDigit(r) {\n\t\treturn lexDecimalNumber\n\t}\n\n\treturn lx.errorf(\"expected a digit but got %q\", r)\n}\n\n// lexBaseNumberOrDate differentiates between the possible values which\n// start with '0'. It assumes that before reaching this state, the initial '0'\n// has been consumed.\nfunc lexBaseNumberOrDate(lx *lexer) stateFn {\n\tr := lx.next()\n\t// Note: All datetimes start with at least two digits, so we don't\n\t// handle date characters (':', '-', etc.) here.\n\tif isDigit(r) {\n\t\treturn lexNumberOrDate\n\t}\n\tswitch r {\n\tcase '_':\n\t\t// Can only be decimal, because there can't be an underscore\n\t\t// between the '0' and the base designator, and dates can't\n\t\t// contain underscores.\n\t\treturn lexDecimalNumber\n\tcase '.', 'e', 'E':\n\t\treturn lexFloat\n\tcase 'b':\n\t\tr = lx.peek()\n\t\tif !isBinary(r) {\n\t\t\tlx.errorf(\"not a binary number: '%s%c'\", lx.current(), r)\n\t\t}\n\t\treturn lexBinaryInteger\n\tcase 'o':\n\t\tr = lx.peek()\n\t\tif !isOctal(r) {\n\t\t\tlx.errorf(\"not an octal number: '%s%c'\", lx.current(), r)\n\t\t}\n\t\treturn lexOctalInteger\n\tcase 'x':\n\t\tr = lx.peek()\n\t\tif !isHex(r) {\n\t\t\tlx.errorf(\"not a hexidecimal number: '%s%c'\", lx.current(), r)\n\t\t}\n\t\treturn lexHexInteger\n\t}\n\n\tlx.backup()\n\tlx.emit(itemInteger)\n\treturn lx.pop()\n}\n\n// lexFloat consumes the elements of a float. It allows any sequence of\n// float-like characters, so floats emitted by the lexer are only a first\n// approximation and must be validated by the parser.\nfunc lexFloat(lx *lexer) stateFn {\n\tr := lx.next()\n\tif isDigit(r) {\n\t\treturn lexFloat\n\t}\n\tswitch r {\n\tcase '_', '.', '-', '+', 'e', 'E':\n\t\treturn lexFloat\n\t}\n\n\tlx.backup()\n\tlx.emit(itemFloat)\n\treturn lx.pop()\n}\n\n// lexBool consumes a bool string: 'true' or 'false.\nfunc lexBool(lx *lexer) stateFn {\n\tvar rs []rune\n\tfor {\n\t\tr := lx.next()\n\t\tif !unicode.IsLetter(r) {\n\t\t\tlx.backup()\n\t\t\tbreak\n\t\t}\n\t\trs = append(rs, r)\n\t}\n\ts := string(rs)\n\tswitch s {\n\tcase \"true\", \"false\":\n\t\tlx.emit(itemBool)\n\t\treturn lx.pop()\n\t}\n\treturn lx.errorf(\"expected value but found %q instead\", s)\n}\n\n// lexCommentStart begins the lexing of a comment. It will emit\n// itemCommentStart and consume no characters, passing control to lexComment.\nfunc lexCommentStart(lx *lexer) stateFn {\n\tlx.ignore()\n\tlx.emit(itemCommentStart)\n\treturn lexComment\n}\n\n// lexComment lexes an entire comment. It assumes that '#' has been consumed.\n// It will consume *up to* the first newline character, and pass control\n// back to the last state on the stack.\nfunc lexComment(lx *lexer) stateFn {\n\tswitch r := lx.next(); {\n\tcase isNL(r) || r == eof:\n\t\tlx.backup()\n\t\tlx.emit(itemText)\n\t\treturn lx.pop()\n\tdefault:\n\t\treturn lexComment\n\t}\n}\n\n// lexSkip ignores all slurped input and moves on to the next state.\nfunc lexSkip(lx *lexer, nextState stateFn) stateFn {\n\tlx.ignore()\n\treturn nextState\n}\n\nfunc (s stateFn) String() string {\n\tname := runtime.FuncForPC(reflect.ValueOf(s).Pointer()).Name()\n\tif i := strings.LastIndexByte(name, '.'); i > -1 {\n\t\tname = name[i+1:]\n\t}\n\tif s == nil {\n\t\tname = \"<nil>\"\n\t}\n\treturn name + \"()\"\n}\n\nfunc (itype itemType) String() string {\n\tswitch itype {\n\tcase itemError:\n\t\treturn \"Error\"\n\tcase itemNIL:\n\t\treturn \"NIL\"\n\tcase itemEOF:\n\t\treturn \"EOF\"\n\tcase itemText:\n\t\treturn \"Text\"\n\tcase itemString, itemStringEsc, itemRawString, itemMultilineString, itemRawMultilineString:\n\t\treturn \"String\"\n\tcase itemBool:\n\t\treturn \"Bool\"\n\tcase itemInteger:\n\t\treturn \"Integer\"\n\tcase itemFloat:\n\t\treturn \"Float\"\n\tcase itemDatetime:\n\t\treturn \"DateTime\"\n\tcase itemTableStart:\n\t\treturn \"TableStart\"\n\tcase itemTableEnd:\n\t\treturn \"TableEnd\"\n\tcase itemKeyStart:\n\t\treturn \"KeyStart\"\n\tcase itemKeyEnd:\n\t\treturn \"KeyEnd\"\n\tcase itemArray:\n\t\treturn \"Array\"\n\tcase itemArrayEnd:\n\t\treturn \"ArrayEnd\"\n\tcase itemCommentStart:\n\t\treturn \"CommentStart\"\n\tcase itemInlineTableStart:\n\t\treturn \"InlineTableStart\"\n\tcase itemInlineTableEnd:\n\t\treturn \"InlineTableEnd\"\n\t}\n\tpanic(fmt.Sprintf(\"BUG: Unknown type '%d'.\", int(itype)))\n}\n\nfunc (item item) String() string {\n\treturn fmt.Sprintf(\"(%s, %s)\", item.typ, item.val)\n}\n\nfunc isWhitespace(r rune) bool { return r == '\\t' || r == ' ' }\nfunc isNL(r rune) bool         { return r == '\\n' || r == '\\r' }\nfunc isControl(r rune) bool { // Control characters except \\t, \\r, \\n\n\tswitch r {\n\tcase '\\t', '\\r', '\\n':\n\t\treturn false\n\tdefault:\n\t\treturn (r >= 0x00 && r <= 0x1f) || r == 0x7f\n\t}\n}\nfunc isDigit(r rune) bool  { return r >= '0' && r <= '9' }\nfunc isBinary(r rune) bool { return r == '0' || r == '1' }\nfunc isOctal(r rune) bool  { return r >= '0' && r <= '7' }\nfunc isHex(r rune) bool    { return (r >= '0' && r <= '9') || (r|0x20 >= 'a' && r|0x20 <= 'f') }\nfunc isBareKeyChar(r rune, tomlNext bool) bool {\n\tif tomlNext {\n\t\treturn (r >= 'A' && r <= 'Z') ||\n\t\t\t(r >= 'a' && r <= 'z') ||\n\t\t\t(r >= '0' && r <= '9') ||\n\t\t\tr == '_' || r == '-' ||\n\t\t\tr == 0xb2 || r == 0xb3 || r == 0xb9 || (r >= 0xbc && r <= 0xbe) ||\n\t\t\t(r >= 0xc0 && r <= 0xd6) || (r >= 0xd8 && r <= 0xf6) || (r >= 0xf8 && r <= 0x037d) ||\n\t\t\t(r >= 0x037f && r <= 0x1fff) ||\n\t\t\t(r >= 0x200c && r <= 0x200d) || (r >= 0x203f && r <= 0x2040) ||\n\t\t\t(r >= 0x2070 && r <= 0x218f) || (r >= 0x2460 && r <= 0x24ff) ||\n\t\t\t(r >= 0x2c00 && r <= 0x2fef) || (r >= 0x3001 && r <= 0xd7ff) ||\n\t\t\t(r >= 0xf900 && r <= 0xfdcf) || (r >= 0xfdf0 && r <= 0xfffd) ||\n\t\t\t(r >= 0x10000 && r <= 0xeffff)\n\t}\n\n\treturn (r >= 'A' && r <= 'Z') ||\n\t\t(r >= 'a' && r <= 'z') ||\n\t\t(r >= '0' && r <= '9') ||\n\t\tr == '_' || r == '-'\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/meta.go",
    "content": "package toml\n\nimport (\n\t\"strings\"\n)\n\n// MetaData allows access to meta information about TOML data that's not\n// accessible otherwise.\n//\n// It allows checking if a key is defined in the TOML data, whether any keys\n// were undecoded, and the TOML type of a key.\ntype MetaData struct {\n\tcontext Key // Used only during decoding.\n\n\tkeyInfo map[string]keyInfo\n\tmapping map[string]any\n\tkeys    []Key\n\tdecoded map[string]struct{}\n\tdata    []byte // Input file; for errors.\n}\n\n// IsDefined reports if the key exists in the TOML data.\n//\n// The key should be specified hierarchically, for example to access the TOML\n// key \"a.b.c\" you would use IsDefined(\"a\", \"b\", \"c\"). Keys are case sensitive.\n//\n// Returns false for an empty key.\nfunc (md *MetaData) IsDefined(key ...string) bool {\n\tif len(key) == 0 {\n\t\treturn false\n\t}\n\n\tvar (\n\t\thash      map[string]any\n\t\tok        bool\n\t\thashOrVal any = md.mapping\n\t)\n\tfor _, k := range key {\n\t\tif hash, ok = hashOrVal.(map[string]any); !ok {\n\t\t\treturn false\n\t\t}\n\t\tif hashOrVal, ok = hash[k]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Type returns a string representation of the type of the key specified.\n//\n// Type will return the empty string if given an empty key or a key that does\n// not exist. Keys are case sensitive.\nfunc (md *MetaData) Type(key ...string) string {\n\tif ki, ok := md.keyInfo[Key(key).String()]; ok {\n\t\treturn ki.tomlType.typeString()\n\t}\n\treturn \"\"\n}\n\n// Keys returns a slice of every key in the TOML data, including key groups.\n//\n// Each key is itself a slice, where the first element is the top of the\n// hierarchy and the last is the most specific. The list will have the same\n// order as the keys appeared in the TOML data.\n//\n// All keys returned are non-empty.\nfunc (md *MetaData) Keys() []Key {\n\treturn md.keys\n}\n\n// Undecoded returns all keys that have not been decoded in the order in which\n// they appear in the original TOML document.\n//\n// This includes keys that haven't been decoded because of a [Primitive] value.\n// Once the Primitive value is decoded, the keys will be considered decoded.\n//\n// Also note that decoding into an empty interface will result in no decoding,\n// and so no keys will be considered decoded.\n//\n// In this sense, the Undecoded keys correspond to keys in the TOML document\n// that do not have a concrete type in your representation.\nfunc (md *MetaData) Undecoded() []Key {\n\tundecoded := make([]Key, 0, len(md.keys))\n\tfor _, key := range md.keys {\n\t\tif _, ok := md.decoded[key.String()]; !ok {\n\t\t\tundecoded = append(undecoded, key)\n\t\t}\n\t}\n\treturn undecoded\n}\n\n// Key represents any TOML key, including key groups. Use [MetaData.Keys] to get\n// values of this type.\ntype Key []string\n\nfunc (k Key) String() string {\n\t// This is called quite often, so it's a bit funky to make it faster.\n\tvar b strings.Builder\n\tb.Grow(len(k) * 25)\nouter:\n\tfor i, kk := range k {\n\t\tif i > 0 {\n\t\t\tb.WriteByte('.')\n\t\t}\n\t\tif kk == \"\" {\n\t\t\tb.WriteString(`\"\"`)\n\t\t} else {\n\t\t\tfor _, r := range kk {\n\t\t\t\t// \"Inline\" isBareKeyChar\n\t\t\t\tif !((r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-') {\n\t\t\t\t\tb.WriteByte('\"')\n\t\t\t\t\tb.WriteString(dblQuotedReplacer.Replace(kk))\n\t\t\t\t\tb.WriteByte('\"')\n\t\t\t\t\tcontinue outer\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.WriteString(kk)\n\t\t}\n\t}\n\treturn b.String()\n}\n\nfunc (k Key) maybeQuoted(i int) string {\n\tif k[i] == \"\" {\n\t\treturn `\"\"`\n\t}\n\tfor _, r := range k[i] {\n\t\tif (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-' {\n\t\t\tcontinue\n\t\t}\n\t\treturn `\"` + dblQuotedReplacer.Replace(k[i]) + `\"`\n\t}\n\treturn k[i]\n}\n\n// Like append(), but only increase the cap by 1.\nfunc (k Key) add(piece string) Key {\n\tif cap(k) > len(k) {\n\t\treturn append(k, piece)\n\t}\n\tnewKey := make(Key, len(k)+1)\n\tcopy(newKey, k)\n\tnewKey[len(k)] = piece\n\treturn newKey\n}\n\nfunc (k Key) parent() Key  { return k[:len(k)-1] } // all except the last piece.\nfunc (k Key) last() string { return k[len(k)-1] }  // last piece of this key.\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/parse.go",
    "content": "package toml\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\t\"unicode/utf8\"\n\n\t\"github.com/BurntSushi/toml/internal\"\n)\n\ntype parser struct {\n\tlx         *lexer\n\tcontext    Key      // Full key for the current hash in scope.\n\tcurrentKey string   // Base key name for everything except hashes.\n\tpos        Position // Current position in the TOML file.\n\ttomlNext   bool\n\n\tordered []Key // List of keys in the order that they appear in the TOML data.\n\n\tkeyInfo   map[string]keyInfo  // Map keyname → info about the TOML key.\n\tmapping   map[string]any      // Map keyname → key value.\n\timplicits map[string]struct{} // Record implicit keys (e.g. \"key.group.names\").\n}\n\ntype keyInfo struct {\n\tpos      Position\n\ttomlType tomlType\n}\n\nfunc parse(data string) (p *parser, err error) {\n\t_, tomlNext := os.LookupEnv(\"BURNTSUSHI_TOML_110\")\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif pErr, ok := r.(ParseError); ok {\n\t\t\t\tpErr.input = data\n\t\t\t\terr = pErr\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\t// Read over BOM; do this here as the lexer calls utf8.DecodeRuneInString()\n\t// which mangles stuff. UTF-16 BOM isn't strictly valid, but some tools add\n\t// it anyway.\n\tif strings.HasPrefix(data, \"\\xff\\xfe\") || strings.HasPrefix(data, \"\\xfe\\xff\") { // UTF-16\n\t\tdata = data[2:]\n\t\t//lint:ignore S1017 https://github.com/dominikh/go-tools/issues/1447\n\t} else if strings.HasPrefix(data, \"\\xef\\xbb\\xbf\") { // UTF-8\n\t\tdata = data[3:]\n\t}\n\n\t// Examine first few bytes for NULL bytes; this probably means it's a UTF-16\n\t// file (second byte in surrogate pair being NULL). Again, do this here to\n\t// avoid having to deal with UTF-8/16 stuff in the lexer.\n\tex := 6\n\tif len(data) < 6 {\n\t\tex = len(data)\n\t}\n\tif i := strings.IndexRune(data[:ex], 0); i > -1 {\n\t\treturn nil, ParseError{\n\t\t\tMessage:  \"files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8\",\n\t\t\tPosition: Position{Line: 1, Col: 1, Start: i, Len: 1},\n\t\t\tLine:     1,\n\t\t\tinput:    data,\n\t\t}\n\t}\n\n\tp = &parser{\n\t\tkeyInfo:   make(map[string]keyInfo),\n\t\tmapping:   make(map[string]any),\n\t\tlx:        lex(data, tomlNext),\n\t\tordered:   make([]Key, 0),\n\t\timplicits: make(map[string]struct{}),\n\t\ttomlNext:  tomlNext,\n\t}\n\tfor {\n\t\titem := p.next()\n\t\tif item.typ == itemEOF {\n\t\t\tbreak\n\t\t}\n\t\tp.topLevel(item)\n\t}\n\n\treturn p, nil\n}\n\nfunc (p *parser) panicErr(it item, err error) {\n\tpanic(ParseError{\n\t\tMessage:  err.Error(),\n\t\terr:      err,\n\t\tPosition: it.pos.withCol(p.lx.input),\n\t\tLine:     it.pos.Len,\n\t\tLastKey:  p.current(),\n\t})\n}\n\nfunc (p *parser) panicItemf(it item, format string, v ...any) {\n\tpanic(ParseError{\n\t\tMessage:  fmt.Sprintf(format, v...),\n\t\tPosition: it.pos.withCol(p.lx.input),\n\t\tLine:     it.pos.Len,\n\t\tLastKey:  p.current(),\n\t})\n}\n\nfunc (p *parser) panicf(format string, v ...any) {\n\tpanic(ParseError{\n\t\tMessage:  fmt.Sprintf(format, v...),\n\t\tPosition: p.pos.withCol(p.lx.input),\n\t\tLine:     p.pos.Line,\n\t\tLastKey:  p.current(),\n\t})\n}\n\nfunc (p *parser) next() item {\n\tit := p.lx.nextItem()\n\t//fmt.Printf(\"ITEM %-18s line %-3d │ %q\\n\", it.typ, it.pos.Line, it.val)\n\tif it.typ == itemError {\n\t\tif it.err != nil {\n\t\t\tpanic(ParseError{\n\t\t\t\tMessage:  it.err.Error(),\n\t\t\t\terr:      it.err,\n\t\t\t\tPosition: it.pos.withCol(p.lx.input),\n\t\t\t\tLine:     it.pos.Line,\n\t\t\t\tLastKey:  p.current(),\n\t\t\t})\n\t\t}\n\n\t\tp.panicItemf(it, \"%s\", it.val)\n\t}\n\treturn it\n}\n\nfunc (p *parser) nextPos() item {\n\tit := p.next()\n\tp.pos = it.pos\n\treturn it\n}\n\nfunc (p *parser) bug(format string, v ...any) {\n\tpanic(fmt.Sprintf(\"BUG: \"+format+\"\\n\\n\", v...))\n}\n\nfunc (p *parser) expect(typ itemType) item {\n\tit := p.next()\n\tp.assertEqual(typ, it.typ)\n\treturn it\n}\n\nfunc (p *parser) assertEqual(expected, got itemType) {\n\tif expected != got {\n\t\tp.bug(\"Expected '%s' but got '%s'.\", expected, got)\n\t}\n}\n\nfunc (p *parser) topLevel(item item) {\n\tswitch item.typ {\n\tcase itemCommentStart: // # ..\n\t\tp.expect(itemText)\n\tcase itemTableStart: // [ .. ]\n\t\tname := p.nextPos()\n\n\t\tvar key Key\n\t\tfor ; name.typ != itemTableEnd && name.typ != itemEOF; name = p.next() {\n\t\t\tkey = append(key, p.keyString(name))\n\t\t}\n\t\tp.assertEqual(itemTableEnd, name.typ)\n\n\t\tp.addContext(key, false)\n\t\tp.setType(\"\", tomlHash, item.pos)\n\t\tp.ordered = append(p.ordered, key)\n\tcase itemArrayTableStart: // [[ .. ]]\n\t\tname := p.nextPos()\n\n\t\tvar key Key\n\t\tfor ; name.typ != itemArrayTableEnd && name.typ != itemEOF; name = p.next() {\n\t\t\tkey = append(key, p.keyString(name))\n\t\t}\n\t\tp.assertEqual(itemArrayTableEnd, name.typ)\n\n\t\tp.addContext(key, true)\n\t\tp.setType(\"\", tomlArrayHash, item.pos)\n\t\tp.ordered = append(p.ordered, key)\n\tcase itemKeyStart: // key = ..\n\t\touterContext := p.context\n\t\t/// Read all the key parts (e.g. 'a' and 'b' in 'a.b')\n\t\tk := p.nextPos()\n\t\tvar key Key\n\t\tfor ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() {\n\t\t\tkey = append(key, p.keyString(k))\n\t\t}\n\t\tp.assertEqual(itemKeyEnd, k.typ)\n\n\t\t/// The current key is the last part.\n\t\tp.currentKey = key.last()\n\n\t\t/// All the other parts (if any) are the context; need to set each part\n\t\t/// as implicit.\n\t\tcontext := key.parent()\n\t\tfor i := range context {\n\t\t\tp.addImplicitContext(append(p.context, context[i:i+1]...))\n\t\t}\n\t\tp.ordered = append(p.ordered, p.context.add(p.currentKey))\n\n\t\t/// Set value.\n\t\tvItem := p.next()\n\t\tval, typ := p.value(vItem, false)\n\t\tp.setValue(p.currentKey, val)\n\t\tp.setType(p.currentKey, typ, vItem.pos)\n\n\t\t/// Remove the context we added (preserving any context from [tbl] lines).\n\t\tp.context = outerContext\n\t\tp.currentKey = \"\"\n\tdefault:\n\t\tp.bug(\"Unexpected type at top level: %s\", item.typ)\n\t}\n}\n\n// Gets a string for a key (or part of a key in a table name).\nfunc (p *parser) keyString(it item) string {\n\tswitch it.typ {\n\tcase itemText:\n\t\treturn it.val\n\tcase itemString, itemStringEsc, itemMultilineString,\n\t\titemRawString, itemRawMultilineString:\n\t\ts, _ := p.value(it, false)\n\t\treturn s.(string)\n\tdefault:\n\t\tp.bug(\"Unexpected key type: %s\", it.typ)\n\t}\n\tpanic(\"unreachable\")\n}\n\nvar datetimeRepl = strings.NewReplacer(\n\t\"z\", \"Z\",\n\t\"t\", \"T\",\n\t\" \", \"T\")\n\n// value translates an expected value from the lexer into a Go value wrapped\n// as an empty interface.\nfunc (p *parser) value(it item, parentIsArray bool) (any, tomlType) {\n\tswitch it.typ {\n\tcase itemString:\n\t\treturn it.val, p.typeOfPrimitive(it)\n\tcase itemStringEsc:\n\t\treturn p.replaceEscapes(it, it.val), p.typeOfPrimitive(it)\n\tcase itemMultilineString:\n\t\treturn p.replaceEscapes(it, p.stripEscapedNewlines(stripFirstNewline(it.val))), p.typeOfPrimitive(it)\n\tcase itemRawString:\n\t\treturn it.val, p.typeOfPrimitive(it)\n\tcase itemRawMultilineString:\n\t\treturn stripFirstNewline(it.val), p.typeOfPrimitive(it)\n\tcase itemInteger:\n\t\treturn p.valueInteger(it)\n\tcase itemFloat:\n\t\treturn p.valueFloat(it)\n\tcase itemBool:\n\t\tswitch it.val {\n\t\tcase \"true\":\n\t\t\treturn true, p.typeOfPrimitive(it)\n\t\tcase \"false\":\n\t\t\treturn false, p.typeOfPrimitive(it)\n\t\tdefault:\n\t\t\tp.bug(\"Expected boolean value, but got '%s'.\", it.val)\n\t\t}\n\tcase itemDatetime:\n\t\treturn p.valueDatetime(it)\n\tcase itemArray:\n\t\treturn p.valueArray(it)\n\tcase itemInlineTableStart:\n\t\treturn p.valueInlineTable(it, parentIsArray)\n\tdefault:\n\t\tp.bug(\"Unexpected value type: %s\", it.typ)\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc (p *parser) valueInteger(it item) (any, tomlType) {\n\tif !numUnderscoresOK(it.val) {\n\t\tp.panicItemf(it, \"Invalid integer %q: underscores must be surrounded by digits\", it.val)\n\t}\n\tif numHasLeadingZero(it.val) {\n\t\tp.panicItemf(it, \"Invalid integer %q: cannot have leading zeroes\", it.val)\n\t}\n\n\tnum, err := strconv.ParseInt(it.val, 0, 64)\n\tif err != nil {\n\t\t// Distinguish integer values. Normally, it'd be a bug if the lexer\n\t\t// provides an invalid integer, but it's possible that the number is\n\t\t// out of range of valid values (which the lexer cannot determine).\n\t\t// So mark the former as a bug but the latter as a legitimate user\n\t\t// error.\n\t\tif e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange {\n\t\t\tp.panicErr(it, errParseRange{i: it.val, size: \"int64\"})\n\t\t} else {\n\t\t\tp.bug(\"Expected integer value, but got '%s'.\", it.val)\n\t\t}\n\t}\n\treturn num, p.typeOfPrimitive(it)\n}\n\nfunc (p *parser) valueFloat(it item) (any, tomlType) {\n\tparts := strings.FieldsFunc(it.val, func(r rune) bool {\n\t\tswitch r {\n\t\tcase '.', 'e', 'E':\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\tfor _, part := range parts {\n\t\tif !numUnderscoresOK(part) {\n\t\t\tp.panicItemf(it, \"Invalid float %q: underscores must be surrounded by digits\", it.val)\n\t\t}\n\t}\n\tif len(parts) > 0 && numHasLeadingZero(parts[0]) {\n\t\tp.panicItemf(it, \"Invalid float %q: cannot have leading zeroes\", it.val)\n\t}\n\tif !numPeriodsOK(it.val) {\n\t\t// As a special case, numbers like '123.' or '1.e2',\n\t\t// which are valid as far as Go/strconv are concerned,\n\t\t// must be rejected because TOML says that a fractional\n\t\t// part consists of '.' followed by 1+ digits.\n\t\tp.panicItemf(it, \"Invalid float %q: '.' must be followed by one or more digits\", it.val)\n\t}\n\tval := strings.Replace(it.val, \"_\", \"\", -1)\n\tsignbit := false\n\tif val == \"+nan\" || val == \"-nan\" {\n\t\tsignbit = val == \"-nan\"\n\t\tval = \"nan\"\n\t}\n\tnum, err := strconv.ParseFloat(val, 64)\n\tif err != nil {\n\t\tif e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange {\n\t\t\tp.panicErr(it, errParseRange{i: it.val, size: \"float64\"})\n\t\t} else {\n\t\t\tp.panicItemf(it, \"Invalid float value: %q\", it.val)\n\t\t}\n\t}\n\tif signbit {\n\t\tnum = math.Copysign(num, -1)\n\t}\n\treturn num, p.typeOfPrimitive(it)\n}\n\nvar dtTypes = []struct {\n\tfmt  string\n\tzone *time.Location\n\tnext bool\n}{\n\t{time.RFC3339Nano, time.Local, false},\n\t{\"2006-01-02T15:04:05.999999999\", internal.LocalDatetime, false},\n\t{\"2006-01-02\", internal.LocalDate, false},\n\t{\"15:04:05.999999999\", internal.LocalTime, false},\n\n\t// tomlNext\n\t{\"2006-01-02T15:04Z07:00\", time.Local, true},\n\t{\"2006-01-02T15:04\", internal.LocalDatetime, true},\n\t{\"15:04\", internal.LocalTime, true},\n}\n\nfunc (p *parser) valueDatetime(it item) (any, tomlType) {\n\tit.val = datetimeRepl.Replace(it.val)\n\tvar (\n\t\tt   time.Time\n\t\tok  bool\n\t\terr error\n\t)\n\tfor _, dt := range dtTypes {\n\t\tif dt.next && !p.tomlNext {\n\t\t\tcontinue\n\t\t}\n\t\tt, err = time.ParseInLocation(dt.fmt, it.val, dt.zone)\n\t\tif err == nil {\n\t\t\tif missingLeadingZero(it.val, dt.fmt) {\n\t\t\t\tp.panicErr(it, errParseDate{it.val})\n\t\t\t}\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !ok {\n\t\tp.panicErr(it, errParseDate{it.val})\n\t}\n\treturn t, p.typeOfPrimitive(it)\n}\n\n// Go's time.Parse() will accept numbers without a leading zero; there isn't any\n// way to require it. https://github.com/golang/go/issues/29911\n//\n// Depend on the fact that the separators (- and :) should always be at the same\n// location.\nfunc missingLeadingZero(d, l string) bool {\n\tfor i, c := range []byte(l) {\n\t\tif c == '.' || c == 'Z' {\n\t\t\treturn false\n\t\t}\n\t\tif (c < '0' || c > '9') && d[i] != c {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (p *parser) valueArray(it item) (any, tomlType) {\n\tp.setType(p.currentKey, tomlArray, it.pos)\n\n\tvar (\n\t\t// Initialize to a non-nil slice to make it consistent with how S = []\n\t\t// decodes into a non-nil slice inside something like struct { S\n\t\t// []string }. See #338\n\t\tarray = make([]any, 0, 2)\n\t)\n\tfor it = p.next(); it.typ != itemArrayEnd; it = p.next() {\n\t\tif it.typ == itemCommentStart {\n\t\t\tp.expect(itemText)\n\t\t\tcontinue\n\t\t}\n\n\t\tval, typ := p.value(it, true)\n\t\tarray = append(array, val)\n\n\t\t// XXX: type isn't used here, we need it to record the accurate type\n\t\t// information.\n\t\t//\n\t\t// Not entirely sure how to best store this; could use \"key[0]\",\n\t\t// \"key[1]\" notation, or maybe store it on the Array type?\n\t\t_ = typ\n\t}\n\treturn array, tomlArray\n}\n\nfunc (p *parser) valueInlineTable(it item, parentIsArray bool) (any, tomlType) {\n\tvar (\n\t\ttopHash      = make(map[string]any)\n\t\touterContext = p.context\n\t\touterKey     = p.currentKey\n\t)\n\n\tp.context = append(p.context, p.currentKey)\n\tprevContext := p.context\n\tp.currentKey = \"\"\n\n\tp.addImplicit(p.context)\n\tp.addContext(p.context, parentIsArray)\n\n\t/// Loop over all table key/value pairs.\n\tfor it := p.next(); it.typ != itemInlineTableEnd; it = p.next() {\n\t\tif it.typ == itemCommentStart {\n\t\t\tp.expect(itemText)\n\t\t\tcontinue\n\t\t}\n\n\t\t/// Read all key parts.\n\t\tk := p.nextPos()\n\t\tvar key Key\n\t\tfor ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() {\n\t\t\tkey = append(key, p.keyString(k))\n\t\t}\n\t\tp.assertEqual(itemKeyEnd, k.typ)\n\n\t\t/// The current key is the last part.\n\t\tp.currentKey = key.last()\n\n\t\t/// All the other parts (if any) are the context; need to set each part\n\t\t/// as implicit.\n\t\tcontext := key.parent()\n\t\tfor i := range context {\n\t\t\tp.addImplicitContext(append(p.context, context[i:i+1]...))\n\t\t}\n\t\tp.ordered = append(p.ordered, p.context.add(p.currentKey))\n\n\t\t/// Set the value.\n\t\tval, typ := p.value(p.next(), false)\n\t\tp.setValue(p.currentKey, val)\n\t\tp.setType(p.currentKey, typ, it.pos)\n\n\t\thash := topHash\n\t\tfor _, c := range context {\n\t\t\th, ok := hash[c]\n\t\t\tif !ok {\n\t\t\t\th = make(map[string]any)\n\t\t\t\thash[c] = h\n\t\t\t}\n\t\t\thash, ok = h.(map[string]any)\n\t\t\tif !ok {\n\t\t\t\tp.panicf(\"%q is not a table\", p.context)\n\t\t\t}\n\t\t}\n\t\thash[p.currentKey] = val\n\n\t\t/// Restore context.\n\t\tp.context = prevContext\n\t}\n\tp.context = outerContext\n\tp.currentKey = outerKey\n\treturn topHash, tomlHash\n}\n\n// numHasLeadingZero checks if this number has leading zeroes, allowing for '0',\n// +/- signs, and base prefixes.\nfunc numHasLeadingZero(s string) bool {\n\tif len(s) > 1 && s[0] == '0' && !(s[1] == 'b' || s[1] == 'o' || s[1] == 'x') { // Allow 0b, 0o, 0x\n\t\treturn true\n\t}\n\tif len(s) > 2 && (s[0] == '-' || s[0] == '+') && s[1] == '0' {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// numUnderscoresOK checks whether each underscore in s is surrounded by\n// characters that are not underscores.\nfunc numUnderscoresOK(s string) bool {\n\tswitch s {\n\tcase \"nan\", \"+nan\", \"-nan\", \"inf\", \"-inf\", \"+inf\":\n\t\treturn true\n\t}\n\taccept := false\n\tfor _, r := range s {\n\t\tif r == '_' {\n\t\t\tif !accept {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// isHexis a superset of all the permissable characters surrounding an\n\t\t// underscore.\n\t\taccept = isHex(r)\n\t}\n\treturn accept\n}\n\n// numPeriodsOK checks whether every period in s is followed by a digit.\nfunc numPeriodsOK(s string) bool {\n\tperiod := false\n\tfor _, r := range s {\n\t\tif period && !isDigit(r) {\n\t\t\treturn false\n\t\t}\n\t\tperiod = r == '.'\n\t}\n\treturn !period\n}\n\n// Set the current context of the parser, where the context is either a hash or\n// an array of hashes, depending on the value of the `array` parameter.\n//\n// Establishing the context also makes sure that the key isn't a duplicate, and\n// will create implicit hashes automatically.\nfunc (p *parser) addContext(key Key, array bool) {\n\t/// Always start at the top level and drill down for our context.\n\thashContext := p.mapping\n\tkeyContext := make(Key, 0, len(key)-1)\n\n\t/// We only need implicit hashes for the parents.\n\tfor _, k := range key.parent() {\n\t\t_, ok := hashContext[k]\n\t\tkeyContext = append(keyContext, k)\n\n\t\t// No key? Make an implicit hash and move on.\n\t\tif !ok {\n\t\t\tp.addImplicit(keyContext)\n\t\t\thashContext[k] = make(map[string]any)\n\t\t}\n\n\t\t// If the hash context is actually an array of tables, then set\n\t\t// the hash context to the last element in that array.\n\t\t//\n\t\t// Otherwise, it better be a table, since this MUST be a key group (by\n\t\t// virtue of it not being the last element in a key).\n\t\tswitch t := hashContext[k].(type) {\n\t\tcase []map[string]any:\n\t\t\thashContext = t[len(t)-1]\n\t\tcase map[string]any:\n\t\t\thashContext = t\n\t\tdefault:\n\t\t\tp.panicf(\"Key '%s' was already created as a hash.\", keyContext)\n\t\t}\n\t}\n\n\tp.context = keyContext\n\tif array {\n\t\t// If this is the first element for this array, then allocate a new\n\t\t// list of tables for it.\n\t\tk := key.last()\n\t\tif _, ok := hashContext[k]; !ok {\n\t\t\thashContext[k] = make([]map[string]any, 0, 4)\n\t\t}\n\n\t\t// Add a new table. But make sure the key hasn't already been used\n\t\t// for something else.\n\t\tif hash, ok := hashContext[k].([]map[string]any); ok {\n\t\t\thashContext[k] = append(hash, make(map[string]any))\n\t\t} else {\n\t\t\tp.panicf(\"Key '%s' was already created and cannot be used as an array.\", key)\n\t\t}\n\t} else {\n\t\tp.setValue(key.last(), make(map[string]any))\n\t}\n\tp.context = append(p.context, key.last())\n}\n\n// setValue sets the given key to the given value in the current context.\n// It will make sure that the key hasn't already been defined, account for\n// implicit key groups.\nfunc (p *parser) setValue(key string, value any) {\n\tvar (\n\t\ttmpHash    any\n\t\tok         bool\n\t\thash       = p.mapping\n\t\tkeyContext = make(Key, 0, len(p.context)+1)\n\t)\n\tfor _, k := range p.context {\n\t\tkeyContext = append(keyContext, k)\n\t\tif tmpHash, ok = hash[k]; !ok {\n\t\t\tp.bug(\"Context for key '%s' has not been established.\", keyContext)\n\t\t}\n\t\tswitch t := tmpHash.(type) {\n\t\tcase []map[string]any:\n\t\t\t// The context is a table of hashes. Pick the most recent table\n\t\t\t// defined as the current hash.\n\t\t\thash = t[len(t)-1]\n\t\tcase map[string]any:\n\t\t\thash = t\n\t\tdefault:\n\t\t\tp.panicf(\"Key '%s' has already been defined.\", keyContext)\n\t\t}\n\t}\n\tkeyContext = append(keyContext, key)\n\n\tif _, ok := hash[key]; ok {\n\t\t// Normally redefining keys isn't allowed, but the key could have been\n\t\t// defined implicitly and it's allowed to be redefined concretely. (See\n\t\t// the `valid/implicit-and-explicit-after.toml` in toml-test)\n\t\t//\n\t\t// But we have to make sure to stop marking it as an implicit. (So that\n\t\t// another redefinition provokes an error.)\n\t\t//\n\t\t// Note that since it has already been defined (as a hash), we don't\n\t\t// want to overwrite it. So our business is done.\n\t\tif p.isArray(keyContext) {\n\t\t\tp.removeImplicit(keyContext)\n\t\t\thash[key] = value\n\t\t\treturn\n\t\t}\n\t\tif p.isImplicit(keyContext) {\n\t\t\tp.removeImplicit(keyContext)\n\t\t\treturn\n\t\t}\n\t\t// Otherwise, we have a concrete key trying to override a previous key,\n\t\t// which is *always* wrong.\n\t\tp.panicf(\"Key '%s' has already been defined.\", keyContext)\n\t}\n\n\thash[key] = value\n}\n\n// setType sets the type of a particular value at a given key. It should be\n// called immediately AFTER setValue.\n//\n// Note that if `key` is empty, then the type given will be applied to the\n// current context (which is either a table or an array of tables).\nfunc (p *parser) setType(key string, typ tomlType, pos Position) {\n\tkeyContext := make(Key, 0, len(p.context)+1)\n\tkeyContext = append(keyContext, p.context...)\n\tif len(key) > 0 { // allow type setting for hashes\n\t\tkeyContext = append(keyContext, key)\n\t}\n\t// Special case to make empty keys (\"\" = 1) work.\n\t// Without it it will set \"\" rather than `\"\"`.\n\t// TODO: why is this needed? And why is this only needed here?\n\tif len(keyContext) == 0 {\n\t\tkeyContext = Key{\"\"}\n\t}\n\tp.keyInfo[keyContext.String()] = keyInfo{tomlType: typ, pos: pos}\n}\n\n// Implicit keys need to be created when tables are implied in \"a.b.c.d = 1\" and\n// \"[a.b.c]\" (the \"a\", \"b\", and \"c\" hashes are never created explicitly).\nfunc (p *parser) addImplicit(key Key)        { p.implicits[key.String()] = struct{}{} }\nfunc (p *parser) removeImplicit(key Key)     { delete(p.implicits, key.String()) }\nfunc (p *parser) isImplicit(key Key) bool    { _, ok := p.implicits[key.String()]; return ok }\nfunc (p *parser) isArray(key Key) bool       { return p.keyInfo[key.String()].tomlType == tomlArray }\nfunc (p *parser) addImplicitContext(key Key) { p.addImplicit(key); p.addContext(key, false) }\n\n// current returns the full key name of the current context.\nfunc (p *parser) current() string {\n\tif len(p.currentKey) == 0 {\n\t\treturn p.context.String()\n\t}\n\tif len(p.context) == 0 {\n\t\treturn p.currentKey\n\t}\n\treturn fmt.Sprintf(\"%s.%s\", p.context, p.currentKey)\n}\n\nfunc stripFirstNewline(s string) string {\n\tif len(s) > 0 && s[0] == '\\n' {\n\t\treturn s[1:]\n\t}\n\tif len(s) > 1 && s[0] == '\\r' && s[1] == '\\n' {\n\t\treturn s[2:]\n\t}\n\treturn s\n}\n\n// stripEscapedNewlines removes whitespace after line-ending backslashes in\n// multiline strings.\n//\n// A line-ending backslash is an unescaped \\ followed only by whitespace until\n// the next newline. After a line-ending backslash, all whitespace is removed\n// until the next non-whitespace character.\nfunc (p *parser) stripEscapedNewlines(s string) string {\n\tvar (\n\t\tb strings.Builder\n\t\ti int\n\t)\n\tb.Grow(len(s))\n\tfor {\n\t\tix := strings.Index(s[i:], `\\`)\n\t\tif ix < 0 {\n\t\t\tb.WriteString(s)\n\t\t\treturn b.String()\n\t\t}\n\t\ti += ix\n\n\t\tif len(s) > i+1 && s[i+1] == '\\\\' {\n\t\t\t// Escaped backslash.\n\t\t\ti += 2\n\t\t\tcontinue\n\t\t}\n\t\t// Scan until the next non-whitespace.\n\t\tj := i + 1\n\twhitespaceLoop:\n\t\tfor ; j < len(s); j++ {\n\t\t\tswitch s[j] {\n\t\t\tcase ' ', '\\t', '\\r', '\\n':\n\t\t\tdefault:\n\t\t\t\tbreak whitespaceLoop\n\t\t\t}\n\t\t}\n\t\tif j == i+1 {\n\t\t\t// Not a whitespace escape.\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tif !strings.Contains(s[i:j], \"\\n\") {\n\t\t\t// This is not a line-ending backslash. (It's a bad escape sequence,\n\t\t\t// but we can let replaceEscapes catch it.)\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tb.WriteString(s[:i])\n\t\ts = s[j:]\n\t\ti = 0\n\t}\n}\n\nfunc (p *parser) replaceEscapes(it item, str string) string {\n\tvar (\n\t\tb    strings.Builder\n\t\tskip = 0\n\t)\n\tb.Grow(len(str))\n\tfor i, c := range str {\n\t\tif skip > 0 {\n\t\t\tskip--\n\t\t\tcontinue\n\t\t}\n\t\tif c != '\\\\' {\n\t\t\tb.WriteRune(c)\n\t\t\tcontinue\n\t\t}\n\n\t\tif i >= len(str) {\n\t\t\tp.bug(\"Escape sequence at end of string.\")\n\t\t\treturn \"\"\n\t\t}\n\t\tswitch str[i+1] {\n\t\tdefault:\n\t\t\tp.bug(\"Expected valid escape code after \\\\, but got %q.\", str[i+1])\n\t\tcase ' ', '\\t':\n\t\t\tp.panicItemf(it, \"invalid escape: '\\\\%c'\", str[i+1])\n\t\tcase 'b':\n\t\t\tb.WriteByte(0x08)\n\t\t\tskip = 1\n\t\tcase 't':\n\t\t\tb.WriteByte(0x09)\n\t\t\tskip = 1\n\t\tcase 'n':\n\t\t\tb.WriteByte(0x0a)\n\t\t\tskip = 1\n\t\tcase 'f':\n\t\t\tb.WriteByte(0x0c)\n\t\t\tskip = 1\n\t\tcase 'r':\n\t\t\tb.WriteByte(0x0d)\n\t\t\tskip = 1\n\t\tcase 'e':\n\t\t\tif p.tomlNext {\n\t\t\t\tb.WriteByte(0x1b)\n\t\t\t\tskip = 1\n\t\t\t}\n\t\tcase '\"':\n\t\t\tb.WriteByte(0x22)\n\t\t\tskip = 1\n\t\tcase '\\\\':\n\t\t\tb.WriteByte(0x5c)\n\t\t\tskip = 1\n\t\t// The lexer guarantees the correct number of characters are present;\n\t\t// don't need to check here.\n\t\tcase 'x':\n\t\t\tif p.tomlNext {\n\t\t\t\tescaped := p.asciiEscapeToUnicode(it, str[i+2:i+4])\n\t\t\t\tb.WriteRune(escaped)\n\t\t\t\tskip = 3\n\t\t\t}\n\t\tcase 'u':\n\t\t\tescaped := p.asciiEscapeToUnicode(it, str[i+2:i+6])\n\t\t\tb.WriteRune(escaped)\n\t\t\tskip = 5\n\t\tcase 'U':\n\t\t\tescaped := p.asciiEscapeToUnicode(it, str[i+2:i+10])\n\t\t\tb.WriteRune(escaped)\n\t\t\tskip = 9\n\t\t}\n\t}\n\treturn b.String()\n}\n\nfunc (p *parser) asciiEscapeToUnicode(it item, s string) rune {\n\thex, err := strconv.ParseUint(strings.ToLower(s), 16, 32)\n\tif err != nil {\n\t\tp.bug(\"Could not parse '%s' as a hexadecimal number, but the lexer claims it's OK: %s\", s, err)\n\t}\n\tif !utf8.ValidRune(rune(hex)) {\n\t\tp.panicItemf(it, \"Escaped character '\\\\u%s' is not valid UTF-8.\", s)\n\t}\n\treturn rune(hex)\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/type_fields.go",
    "content": "package toml\n\n// Struct field handling is adapted from code in encoding/json:\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the Go distribution.\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n\t\"sync\"\n)\n\n// A field represents a single field found in a struct.\ntype field struct {\n\tname  string       // the name of the field (`toml` tag included)\n\ttag   bool         // whether field has a `toml` tag\n\tindex []int        // represents the depth of an anonymous field\n\ttyp   reflect.Type // the type of the field\n}\n\n// byName sorts field by name, breaking ties with depth,\n// then breaking ties with \"name came from toml tag\", then\n// breaking ties with index sequence.\ntype byName []field\n\nfunc (x byName) Len() int      { return len(x) }\nfunc (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\nfunc (x byName) Less(i, j int) bool {\n\tif x[i].name != x[j].name {\n\t\treturn x[i].name < x[j].name\n\t}\n\tif len(x[i].index) != len(x[j].index) {\n\t\treturn len(x[i].index) < len(x[j].index)\n\t}\n\tif x[i].tag != x[j].tag {\n\t\treturn x[i].tag\n\t}\n\treturn byIndex(x).Less(i, j)\n}\n\n// byIndex sorts field by index sequence.\ntype byIndex []field\n\nfunc (x byIndex) Len() int      { return len(x) }\nfunc (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\nfunc (x byIndex) Less(i, j int) bool {\n\tfor k, xik := range x[i].index {\n\t\tif k >= len(x[j].index) {\n\t\t\treturn false\n\t\t}\n\t\tif xik != x[j].index[k] {\n\t\t\treturn xik < x[j].index[k]\n\t\t}\n\t}\n\treturn len(x[i].index) < len(x[j].index)\n}\n\n// typeFields returns a list of fields that TOML should recognize for the given\n// type. The algorithm is breadth-first search over the set of structs to\n// include - the top struct and then any reachable anonymous structs.\nfunc typeFields(t reflect.Type) []field {\n\t// Anonymous fields to explore at the current level and the next.\n\tcurrent := []field{}\n\tnext := []field{{typ: t}}\n\n\t// Count of queued names for current level and the next.\n\tvar count map[reflect.Type]int\n\tvar nextCount map[reflect.Type]int\n\n\t// Types already visited at an earlier level.\n\tvisited := map[reflect.Type]bool{}\n\n\t// Fields found.\n\tvar fields []field\n\n\tfor len(next) > 0 {\n\t\tcurrent, next = next, current[:0]\n\t\tcount, nextCount = nextCount, map[reflect.Type]int{}\n\n\t\tfor _, f := range current {\n\t\t\tif visited[f.typ] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvisited[f.typ] = true\n\n\t\t\t// Scan f.typ for fields to include.\n\t\t\tfor i := 0; i < f.typ.NumField(); i++ {\n\t\t\t\tsf := f.typ.Field(i)\n\t\t\t\tif sf.PkgPath != \"\" && !sf.Anonymous { // unexported\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\topts := getOptions(sf.Tag)\n\t\t\t\tif opts.skip {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tindex := make([]int, len(f.index)+1)\n\t\t\t\tcopy(index, f.index)\n\t\t\t\tindex[len(f.index)] = i\n\n\t\t\t\tft := sf.Type\n\t\t\t\tif ft.Name() == \"\" && ft.Kind() == reflect.Ptr {\n\t\t\t\t\t// Follow pointer.\n\t\t\t\t\tft = ft.Elem()\n\t\t\t\t}\n\n\t\t\t\t// Record found field and index sequence.\n\t\t\t\tif opts.name != \"\" || !sf.Anonymous || ft.Kind() != reflect.Struct {\n\t\t\t\t\ttagged := opts.name != \"\"\n\t\t\t\t\tname := opts.name\n\t\t\t\t\tif name == \"\" {\n\t\t\t\t\t\tname = sf.Name\n\t\t\t\t\t}\n\t\t\t\t\tfields = append(fields, field{name, tagged, index, ft})\n\t\t\t\t\tif count[f.typ] > 1 {\n\t\t\t\t\t\t// If there were multiple instances, add a second,\n\t\t\t\t\t\t// so that the annihilation code will see a duplicate.\n\t\t\t\t\t\t// It only cares about the distinction between 1 or 2,\n\t\t\t\t\t\t// so don't bother generating any more copies.\n\t\t\t\t\t\tfields = append(fields, fields[len(fields)-1])\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Record new anonymous struct to explore in next round.\n\t\t\t\tnextCount[ft]++\n\t\t\t\tif nextCount[ft] == 1 {\n\t\t\t\t\tf := field{name: ft.Name(), index: index, typ: ft}\n\t\t\t\t\tnext = append(next, f)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Sort(byName(fields))\n\n\t// Delete all fields that are hidden by the Go rules for embedded fields,\n\t// except that fields with TOML tags are promoted.\n\n\t// The fields are sorted in primary order of name, secondary order\n\t// of field index length. Loop over names; for each name, delete\n\t// hidden fields by choosing the one dominant field that survives.\n\tout := fields[:0]\n\tfor advance, i := 0, 0; i < len(fields); i += advance {\n\t\t// One iteration per name.\n\t\t// Find the sequence of fields with the name of this first field.\n\t\tfi := fields[i]\n\t\tname := fi.name\n\t\tfor advance = 1; i+advance < len(fields); advance++ {\n\t\t\tfj := fields[i+advance]\n\t\t\tif fj.name != name {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif advance == 1 { // Only one field with this name\n\t\t\tout = append(out, fi)\n\t\t\tcontinue\n\t\t}\n\t\tdominant, ok := dominantField(fields[i : i+advance])\n\t\tif ok {\n\t\t\tout = append(out, dominant)\n\t\t}\n\t}\n\n\tfields = out\n\tsort.Sort(byIndex(fields))\n\n\treturn fields\n}\n\n// dominantField looks through the fields, all of which are known to\n// have the same name, to find the single field that dominates the\n// others using Go's embedding rules, modified by the presence of\n// TOML tags. If there are multiple top-level fields, the boolean\n// will be false: This condition is an error in Go and we skip all\n// the fields.\nfunc dominantField(fields []field) (field, bool) {\n\t// The fields are sorted in increasing index-length order. The winner\n\t// must therefore be one with the shortest index length. Drop all\n\t// longer entries, which is easy: just truncate the slice.\n\tlength := len(fields[0].index)\n\ttagged := -1 // Index of first tagged field.\n\tfor i, f := range fields {\n\t\tif len(f.index) > length {\n\t\t\tfields = fields[:i]\n\t\t\tbreak\n\t\t}\n\t\tif f.tag {\n\t\t\tif tagged >= 0 {\n\t\t\t\t// Multiple tagged fields at the same level: conflict.\n\t\t\t\t// Return no field.\n\t\t\t\treturn field{}, false\n\t\t\t}\n\t\t\ttagged = i\n\t\t}\n\t}\n\tif tagged >= 0 {\n\t\treturn fields[tagged], true\n\t}\n\t// All remaining fields have the same length. If there's more than one,\n\t// we have a conflict (two fields named \"X\" at the same level) and we\n\t// return no field.\n\tif len(fields) > 1 {\n\t\treturn field{}, false\n\t}\n\treturn fields[0], true\n}\n\nvar fieldCache struct {\n\tsync.RWMutex\n\tm map[reflect.Type][]field\n}\n\n// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.\nfunc cachedTypeFields(t reflect.Type) []field {\n\tfieldCache.RLock()\n\tf := fieldCache.m[t]\n\tfieldCache.RUnlock()\n\tif f != nil {\n\t\treturn f\n\t}\n\n\t// Compute fields without lock.\n\t// Might duplicate effort but won't hold other computations back.\n\tf = typeFields(t)\n\tif f == nil {\n\t\tf = []field{}\n\t}\n\n\tfieldCache.Lock()\n\tif fieldCache.m == nil {\n\t\tfieldCache.m = map[reflect.Type][]field{}\n\t}\n\tfieldCache.m[t] = f\n\tfieldCache.Unlock()\n\treturn f\n}\n"
  },
  {
    "path": "vendor/github.com/BurntSushi/toml/type_toml.go",
    "content": "package toml\n\n// tomlType represents any Go type that corresponds to a TOML type.\n// While the first draft of the TOML spec has a simplistic type system that\n// probably doesn't need this level of sophistication, we seem to be militating\n// toward adding real composite types.\ntype tomlType interface {\n\ttypeString() string\n}\n\n// typeEqual accepts any two types and returns true if they are equal.\nfunc typeEqual(t1, t2 tomlType) bool {\n\tif t1 == nil || t2 == nil {\n\t\treturn false\n\t}\n\treturn t1.typeString() == t2.typeString()\n}\n\nfunc typeIsTable(t tomlType) bool {\n\treturn typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash)\n}\n\ntype tomlBaseType string\n\nfunc (btype tomlBaseType) typeString() string { return string(btype) }\nfunc (btype tomlBaseType) String() string     { return btype.typeString() }\n\nvar (\n\ttomlInteger   tomlBaseType = \"Integer\"\n\ttomlFloat     tomlBaseType = \"Float\"\n\ttomlDatetime  tomlBaseType = \"Datetime\"\n\ttomlString    tomlBaseType = \"String\"\n\ttomlBool      tomlBaseType = \"Bool\"\n\ttomlArray     tomlBaseType = \"Array\"\n\ttomlHash      tomlBaseType = \"Hash\"\n\ttomlArrayHash tomlBaseType = \"ArrayHash\"\n)\n\n// typeOfPrimitive returns a tomlType of any primitive value in TOML.\n// Primitive values are: Integer, Float, Datetime, String and Bool.\n//\n// Passing a lexer item other than the following will cause a BUG message\n// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime.\nfunc (p *parser) typeOfPrimitive(lexItem item) tomlType {\n\tswitch lexItem.typ {\n\tcase itemInteger:\n\t\treturn tomlInteger\n\tcase itemFloat:\n\t\treturn tomlFloat\n\tcase itemDatetime:\n\t\treturn tomlDatetime\n\tcase itemString, itemStringEsc:\n\t\treturn tomlString\n\tcase itemMultilineString:\n\t\treturn tomlString\n\tcase itemRawString:\n\t\treturn tomlString\n\tcase itemRawMultilineString:\n\t\treturn tomlString\n\tcase itemBool:\n\t\treturn tomlBool\n\t}\n\tp.bug(\"Cannot infer primitive type of lex item '%s'.\", lexItem)\n\tpanic(\"unreachable\")\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.gitattributes",
    "content": "* text=auto eol=lf"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.gitignore",
    "content": ".vscode/\n\n*.exe\n\n# testing\ntestdata\n\n# go workspaces\ngo.work\ngo.work.sum\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.golangci.yml",
    "content": "linters:\n  enable:\n    # style\n    - containedctx # struct contains a context\n    - dupl # duplicate code\n    - errname # erorrs are named correctly\n    - nolintlint # \"//nolint\" directives are properly explained\n    - revive # golint replacement\n    - unconvert # unnecessary conversions\n    - wastedassign\n\n    # bugs, performance, unused, etc ...\n    - contextcheck # function uses a non-inherited context\n    - errorlint # errors not wrapped for 1.13\n    - exhaustive # check exhaustiveness of enum switch statements\n    - gofmt # files are gofmt'ed\n    - gosec # security\n    - nilerr # returns nil even with non-nil error\n    - thelper #  test helpers without t.Helper()\n    - unparam # unused function params\n\nissues:\n  exclude-dirs:\n    - pkg/etw/sample\n\n  exclude-rules:\n    # err is very often shadowed in nested scopes\n    - linters:\n        - govet\n      text: '^shadow: declaration of \"err\" shadows declaration'\n\n    # ignore long lines for skip autogen directives\n    - linters:\n        - revive\n      text: \"^line-length-limit: \"\n      source: \"^//(go:generate|sys) \"\n\n    #TODO: remove after upgrading to go1.18\n    # ignore comment spacing for nolint and sys directives\n    - linters:\n        - revive\n      text: \"^comment-spacings: no space between comment delimiter and comment text\"\n      source: \"//(cspell:|nolint:|sys |todo)\"\n\n    # not on go 1.18 yet, so no any\n    - linters:\n        - revive\n      text: \"^use-any: since GO 1.18 'interface{}' can be replaced by 'any'\"\n\n    # allow unjustified ignores of error checks in defer statements\n    - linters:\n        - nolintlint\n      text: \"^directive `//nolint:errcheck` should provide explanation\"\n      source: '^\\s*defer '\n\n    # allow unjustified ignores of error lints for io.EOF\n    - linters:\n        - nolintlint\n      text: \"^directive `//nolint:errorlint` should provide explanation\"\n      source: '[=|!]= io.EOF'\n\n\nlinters-settings:\n  exhaustive:\n    default-signifies-exhaustive: true\n  govet:\n    enable-all: true\n    disable:\n      # struct order is often for Win32 compat\n      # also, ignore pointer bytes/GC issues for now until performance becomes an issue\n      - fieldalignment\n  nolintlint:\n    require-explanation: true\n    require-specific: true\n  revive:\n    # revive is more configurable than static check, so likely the preferred alternative to static-check\n    # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997)\n    enable-all-rules:\n      true\n      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md\n    rules:\n      # rules with required arguments\n      - name: argument-limit\n        disabled: true\n      - name: banned-characters\n        disabled: true\n      - name: cognitive-complexity\n        disabled: true\n      - name: cyclomatic\n        disabled: true\n      - name: file-header\n        disabled: true\n      - name: function-length\n        disabled: true\n      - name: function-result-limit\n        disabled: true\n      - name: max-public-structs\n        disabled: true\n      # geneally annoying rules\n      - name: add-constant # complains about any and all strings and integers\n        disabled: true\n      - name: confusing-naming # we frequently use \"Foo()\" and \"foo()\" together\n        disabled: true\n      - name: flag-parameter # excessive, and a common idiom we use\n        disabled: true\n      - name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead\n        disabled: true\n      # general config\n      - name: line-length-limit\n        arguments:\n          - 140\n      - name: var-naming\n        arguments:\n          - []\n          - - CID\n            - CRI\n            - CTRD\n            - DACL\n            - DLL\n            - DOS\n            - ETW\n            - FSCTL\n            - GCS\n            - GMSA\n            - HCS\n            - HV\n            - IO\n            - LCOW\n            - LDAP\n            - LPAC\n            - LTSC\n            - MMIO\n            - NT\n            - OCI\n            - PMEM\n            - PWSH\n            - RX\n            - SACl\n            - SID\n            - SMB\n            - TX\n            - VHD\n            - VHDX\n            - VMID\n            - VPCI\n            - WCOW\n            - WIM\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/CODEOWNERS",
    "content": "  * @microsoft/containerplat\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 Microsoft\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/README.md",
    "content": "# go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml)\n\nThis repository contains utilities for efficiently performing Win32 IO operations in\nGo. Currently, this is focused on accessing named pipes and other file handles, and\nfor using named pipes as a net transport.\n\nThis code relies on IO completion ports to avoid blocking IO on system threads, allowing Go\nto reuse the thread to schedule another goroutine. This limits support to Windows Vista and\nnewer operating systems. This is similar to the implementation of network sockets in Go's net\npackage.\n\nPlease see the LICENSE file for licensing information.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.\nMost contributions require you to agree to a Contributor License Agreement (CLA) declaring that\nyou have the right to, and actually do, grant us the rights to use your contribution.\nFor details, visit [Microsoft CLA](https://cla.microsoft.com).\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to\nprovide a CLA and decorate the PR appropriately (e.g., label, comment).\nSimply follow the instructions provided by the bot.\nYou will only need to do this once across all repos using our CLA.\n\nAdditionally, the pull request pipeline requires the following steps to be performed before\nmergining.\n\n### Code Sign-Off\n\nWe require that contributors sign their commits using [`git commit --signoff`][git-commit-s]\nto certify they either authored the work themselves or otherwise have permission to use it in this project.\n\nA range of commits can be signed off using [`git rebase --signoff`][git-rebase-s].\n\nPlease see [the developer certificate](https://developercertificate.org) for more info,\nas well as to make sure that you can attest to the rules listed.\nOur CI uses the DCO Github app to ensure that all commits in a given PR are signed-off.\n\n### Linting\n\nCode must pass a linting stage, which uses [`golangci-lint`][lint].\nThe linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run\nautomatically with VSCode by adding the following to your workspace or folder settings:\n\n```json\n    \"go.lintTool\": \"golangci-lint\",\n    \"go.lintOnSave\": \"package\",\n```\n\nAdditional editor [integrations options are also available][lint-ide].\n\nAlternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root:\n\n```shell\n# use . or specify a path to only lint a package\n# to show all lint errors, use flags \"--max-issues-per-linter=0 --max-same-issues=0\"\n> golangci-lint run ./...\n```\n\n### Go Generate\n\nThe pipeline checks that auto-generated code, via `go generate`, are up to date.\n\nThis can be done for the entire repo:\n\n```shell\n> go generate ./...\n```\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Special Thanks\n\nThanks to [natefinch][natefinch] for the inspiration for this library.\nSee [npipe](https://github.com/natefinch/npipe) for another named pipe implementation.\n\n[lint]: https://golangci-lint.run/\n[lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration\n[lint-install]: https://golangci-lint.run/usage/install/#local-installation\n\n[git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s\n[git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff\n\n[natefinch]: https://github.com/natefinch\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/SECURITY.md",
    "content": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->\n\n## Security\n\nMicrosoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n\nIf you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n\n## Reporting Security Issues\n\n**Please do not report security vulnerabilities through public GitHub issues.**\n\nInstead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n\nIf you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n\nYou should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n\nPlease include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n\n  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n  * Full paths of source file(s) related to the manifestation of the issue\n  * The location of the affected source code (tag/branch/commit or direct URL)\n  * Any special configuration required to reproduce the issue\n  * Step-by-step instructions to reproduce the issue\n  * Proof-of-concept or exploit code (if possible)\n  * Impact of the issue, including how an attacker might exploit the issue\n\nThis information will help us triage your report more quickly.\n\nIf you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n\n## Preferred Languages\n\nWe prefer all communications to be in English.\n\n## Policy\n\nMicrosoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n\n<!-- END MICROSOFT SECURITY.MD BLOCK -->\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/backup.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"runtime\"\n\t\"unicode/utf16\"\n\n\t\"github.com/Microsoft/go-winio/internal/fs\"\n\t\"golang.org/x/sys/windows\"\n)\n\n//sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead\n//sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite\n\nconst (\n\tBackupData = uint32(iota + 1)\n\tBackupEaData\n\tBackupSecurity\n\tBackupAlternateData\n\tBackupLink\n\tBackupPropertyData\n\tBackupObjectId //revive:disable-line:var-naming ID, not Id\n\tBackupReparseData\n\tBackupSparseBlock\n\tBackupTxfsData\n)\n\nconst (\n\tStreamSparseAttributes = uint32(8)\n)\n\n//nolint:revive // var-naming: ALL_CAPS\nconst (\n\tWRITE_DAC              = windows.WRITE_DAC\n\tWRITE_OWNER            = windows.WRITE_OWNER\n\tACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY\n)\n\n// BackupHeader represents a backup stream of a file.\ntype BackupHeader struct {\n\t//revive:disable-next-line:var-naming ID, not Id\n\tId         uint32 // The backup stream ID\n\tAttributes uint32 // Stream attributes\n\tSize       int64  // The size of the stream in bytes\n\tName       string // The name of the stream (for BackupAlternateData only).\n\tOffset     int64  // The offset of the stream in the file (for BackupSparseBlock only).\n}\n\ntype win32StreamID struct {\n\tStreamID   uint32\n\tAttributes uint32\n\tSize       uint64\n\tNameSize   uint32\n}\n\n// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series\n// of BackupHeader values.\ntype BackupStreamReader struct {\n\tr         io.Reader\n\tbytesLeft int64\n}\n\n// NewBackupStreamReader produces a BackupStreamReader from any io.Reader.\nfunc NewBackupStreamReader(r io.Reader) *BackupStreamReader {\n\treturn &BackupStreamReader{r, 0}\n}\n\n// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if\n// it was not completely read.\nfunc (r *BackupStreamReader) Next() (*BackupHeader, error) {\n\tif r.bytesLeft > 0 { //nolint:nestif // todo: flatten this\n\t\tif s, ok := r.r.(io.Seeker); ok {\n\t\t\t// Make sure Seek on io.SeekCurrent sometimes succeeds\n\t\t\t// before trying the actual seek.\n\t\t\tif _, err := s.Seek(0, io.SeekCurrent); err == nil {\n\t\t\t\tif _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tr.bytesLeft = 0\n\t\t\t}\n\t\t}\n\t\tif _, err := io.Copy(io.Discard, r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar wsi win32StreamID\n\tif err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil {\n\t\treturn nil, err\n\t}\n\thdr := &BackupHeader{\n\t\tId:         wsi.StreamID,\n\t\tAttributes: wsi.Attributes,\n\t\tSize:       int64(wsi.Size),\n\t}\n\tif wsi.NameSize != 0 {\n\t\tname := make([]uint16, int(wsi.NameSize/2))\n\t\tif err := binary.Read(r.r, binary.LittleEndian, name); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thdr.Name = windows.UTF16ToString(name)\n\t}\n\tif wsi.StreamID == BackupSparseBlock {\n\t\tif err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thdr.Size -= 8\n\t}\n\tr.bytesLeft = hdr.Size\n\treturn hdr, nil\n}\n\n// Read reads from the current backup stream.\nfunc (r *BackupStreamReader) Read(b []byte) (int, error) {\n\tif r.bytesLeft == 0 {\n\t\treturn 0, io.EOF\n\t}\n\tif int64(len(b)) > r.bytesLeft {\n\t\tb = b[:r.bytesLeft]\n\t}\n\tn, err := r.r.Read(b)\n\tr.bytesLeft -= int64(n)\n\tif err == io.EOF {\n\t\terr = io.ErrUnexpectedEOF\n\t} else if r.bytesLeft == 0 && err == nil {\n\t\terr = io.EOF\n\t}\n\treturn n, err\n}\n\n// BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API.\ntype BackupStreamWriter struct {\n\tw         io.Writer\n\tbytesLeft int64\n}\n\n// NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer.\nfunc NewBackupStreamWriter(w io.Writer) *BackupStreamWriter {\n\treturn &BackupStreamWriter{w, 0}\n}\n\n// WriteHeader writes the next backup stream header and prepares for calls to Write().\nfunc (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error {\n\tif w.bytesLeft != 0 {\n\t\treturn fmt.Errorf(\"missing %d bytes\", w.bytesLeft)\n\t}\n\tname := utf16.Encode([]rune(hdr.Name))\n\twsi := win32StreamID{\n\t\tStreamID:   hdr.Id,\n\t\tAttributes: hdr.Attributes,\n\t\tSize:       uint64(hdr.Size),\n\t\tNameSize:   uint32(len(name) * 2),\n\t}\n\tif hdr.Id == BackupSparseBlock {\n\t\t// Include space for the int64 block offset\n\t\twsi.Size += 8\n\t}\n\tif err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil {\n\t\treturn err\n\t}\n\tif len(name) != 0 {\n\t\tif err := binary.Write(w.w, binary.LittleEndian, name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif hdr.Id == BackupSparseBlock {\n\t\tif err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tw.bytesLeft = hdr.Size\n\treturn nil\n}\n\n// Write writes to the current backup stream.\nfunc (w *BackupStreamWriter) Write(b []byte) (int, error) {\n\tif w.bytesLeft < int64(len(b)) {\n\t\treturn 0, fmt.Errorf(\"too many bytes by %d\", int64(len(b))-w.bytesLeft)\n\t}\n\tn, err := w.w.Write(b)\n\tw.bytesLeft -= int64(n)\n\treturn n, err\n}\n\n// BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API.\ntype BackupFileReader struct {\n\tf               *os.File\n\tincludeSecurity bool\n\tctx             uintptr\n}\n\n// NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true,\n// Read will attempt to read the security descriptor of the file.\nfunc NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader {\n\tr := &BackupFileReader{f, includeSecurity, 0}\n\treturn r\n}\n\n// Read reads a backup stream from the file by calling the Win32 API BackupRead().\nfunc (r *BackupFileReader) Read(b []byte) (int, error) {\n\tvar bytesRead uint32\n\terr := backupRead(windows.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx)\n\tif err != nil {\n\t\treturn 0, &os.PathError{Op: \"BackupRead\", Path: r.f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(r.f)\n\tif bytesRead == 0 {\n\t\treturn 0, io.EOF\n\t}\n\treturn int(bytesRead), nil\n}\n\n// Close frees Win32 resources associated with the BackupFileReader. It does not close\n// the underlying file.\nfunc (r *BackupFileReader) Close() error {\n\tif r.ctx != 0 {\n\t\t_ = backupRead(windows.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)\n\t\truntime.KeepAlive(r.f)\n\t\tr.ctx = 0\n\t}\n\treturn nil\n}\n\n// BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API.\ntype BackupFileWriter struct {\n\tf               *os.File\n\tincludeSecurity bool\n\tctx             uintptr\n}\n\n// NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true,\n// Write() will attempt to restore the security descriptor from the stream.\nfunc NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter {\n\tw := &BackupFileWriter{f, includeSecurity, 0}\n\treturn w\n}\n\n// Write restores a portion of the file using the provided backup stream.\nfunc (w *BackupFileWriter) Write(b []byte) (int, error) {\n\tvar bytesWritten uint32\n\terr := backupWrite(windows.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx)\n\tif err != nil {\n\t\treturn 0, &os.PathError{Op: \"BackupWrite\", Path: w.f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(w.f)\n\tif int(bytesWritten) != len(b) {\n\t\treturn int(bytesWritten), errors.New(\"not all bytes could be written\")\n\t}\n\treturn len(b), nil\n}\n\n// Close frees Win32 resources associated with the BackupFileWriter. It does not\n// close the underlying file.\nfunc (w *BackupFileWriter) Close() error {\n\tif w.ctx != 0 {\n\t\t_ = backupWrite(windows.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)\n\t\truntime.KeepAlive(w.f)\n\t\tw.ctx = 0\n\t}\n\treturn nil\n}\n\n// OpenForBackup opens a file or directory, potentially skipping access checks if the backup\n// or restore privileges have been acquired.\n//\n// If the file opened was a directory, it cannot be used with Readdir().\nfunc OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) {\n\th, err := fs.CreateFile(path,\n\t\tfs.AccessMask(access),\n\t\tfs.FileShareMode(share),\n\t\tnil,\n\t\tfs.FileCreationDisposition(createmode),\n\t\tfs.FILE_FLAG_BACKUP_SEMANTICS|fs.FILE_FLAG_OPEN_REPARSE_POINT,\n\t\t0,\n\t)\n\tif err != nil {\n\t\terr = &os.PathError{Op: \"open\", Path: path, Err: err}\n\t\treturn nil, err\n\t}\n\treturn os.NewFile(uintptr(h), path), nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/doc.go",
    "content": "// This package provides utilities for efficiently performing Win32 IO operations in Go.\n// Currently, this package is provides support for genreal IO and management of\n//   - named pipes\n//   - files\n//   - [Hyper-V sockets]\n//\n// This code is similar to Go's [net] package, and uses IO completion ports to avoid\n// blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines.\n//\n// This limits support to Windows Vista and newer operating systems.\n//\n// Additionally, this package provides support for:\n//   - creating and managing GUIDs\n//   - writing to [ETW]\n//   - opening and manageing VHDs\n//   - parsing [Windows Image files]\n//   - auto-generating Win32 API code\n//\n// [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service\n// [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-\n// [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images\npackage winio\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/ea.go",
    "content": "package winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n)\n\ntype fileFullEaInformation struct {\n\tNextEntryOffset uint32\n\tFlags           uint8\n\tNameLength      uint8\n\tValueLength     uint16\n}\n\nvar (\n\tfileFullEaInformationSize = binary.Size(&fileFullEaInformation{})\n\n\terrInvalidEaBuffer = errors.New(\"invalid extended attribute buffer\")\n\terrEaNameTooLarge  = errors.New(\"extended attribute name too large\")\n\terrEaValueTooLarge = errors.New(\"extended attribute value too large\")\n)\n\n// ExtendedAttribute represents a single Windows EA.\ntype ExtendedAttribute struct {\n\tName  string\n\tValue []byte\n\tFlags uint8\n}\n\nfunc parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {\n\tvar info fileFullEaInformation\n\terr = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info)\n\tif err != nil {\n\t\terr = errInvalidEaBuffer\n\t\treturn ea, nb, err\n\t}\n\n\tnameOffset := fileFullEaInformationSize\n\tnameLen := int(info.NameLength)\n\tvalueOffset := nameOffset + int(info.NameLength) + 1\n\tvalueLen := int(info.ValueLength)\n\tnextOffset := int(info.NextEntryOffset)\n\tif valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) {\n\t\terr = errInvalidEaBuffer\n\t\treturn ea, nb, err\n\t}\n\n\tea.Name = string(b[nameOffset : nameOffset+nameLen])\n\tea.Value = b[valueOffset : valueOffset+valueLen]\n\tea.Flags = info.Flags\n\tif info.NextEntryOffset != 0 {\n\t\tnb = b[info.NextEntryOffset:]\n\t}\n\treturn ea, nb, err\n}\n\n// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION\n// buffer retrieved from BackupRead, ZwQueryEaFile, etc.\nfunc DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) {\n\tfor len(b) != 0 {\n\t\tea, nb, err := parseEa(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\teas = append(eas, ea)\n\t\tb = nb\n\t}\n\treturn eas, err\n}\n\nfunc writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error {\n\tif int(uint8(len(ea.Name))) != len(ea.Name) {\n\t\treturn errEaNameTooLarge\n\t}\n\tif int(uint16(len(ea.Value))) != len(ea.Value) {\n\t\treturn errEaValueTooLarge\n\t}\n\tentrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value))\n\twithPadding := (entrySize + 3) &^ 3\n\tnextOffset := uint32(0)\n\tif !last {\n\t\tnextOffset = withPadding\n\t}\n\tinfo := fileFullEaInformation{\n\t\tNextEntryOffset: nextOffset,\n\t\tFlags:           ea.Flags,\n\t\tNameLength:      uint8(len(ea.Name)),\n\t\tValueLength:     uint16(len(ea.Value)),\n\t}\n\n\terr := binary.Write(buf, binary.LittleEndian, &info)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = buf.Write([]byte(ea.Name))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = buf.WriteByte(0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = buf.Write(ea.Value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION\n// buffer for use with BackupWrite, ZwSetEaFile, etc.\nfunc EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {\n\tvar buf bytes.Buffer\n\tfor i := range eas {\n\t\tlast := false\n\t\tif i == len(eas)-1 {\n\t\t\tlast = true\n\t\t}\n\n\t\terr := writeEa(&buf, &eas[i], last)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn buf.Bytes(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/file.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"runtime\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n//sys cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) = CancelIoEx\n//sys createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) = CreateIoCompletionPort\n//sys getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus\n//sys setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes\n//sys wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult\n\nvar (\n\tErrFileClosed = errors.New(\"file has already been closed\")\n\tErrTimeout    = &timeoutError{}\n)\n\ntype timeoutError struct{}\n\nfunc (*timeoutError) Error() string   { return \"i/o timeout\" }\nfunc (*timeoutError) Timeout() bool   { return true }\nfunc (*timeoutError) Temporary() bool { return true }\n\ntype timeoutChan chan struct{}\n\nvar ioInitOnce sync.Once\nvar ioCompletionPort windows.Handle\n\n// ioResult contains the result of an asynchronous IO operation.\ntype ioResult struct {\n\tbytes uint32\n\terr   error\n}\n\n// ioOperation represents an outstanding asynchronous Win32 IO.\ntype ioOperation struct {\n\to  windows.Overlapped\n\tch chan ioResult\n}\n\nfunc initIO() {\n\th, err := createIoCompletionPort(windows.InvalidHandle, 0, 0, 0xffffffff)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tioCompletionPort = h\n\tgo ioCompletionProcessor(h)\n}\n\n// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall.\n// It takes ownership of this handle and will close it if it is garbage collected.\ntype win32File struct {\n\thandle        windows.Handle\n\twg            sync.WaitGroup\n\twgLock        sync.RWMutex\n\tclosing       atomic.Bool\n\tsocket        bool\n\treadDeadline  deadlineHandler\n\twriteDeadline deadlineHandler\n}\n\ntype deadlineHandler struct {\n\tsetLock     sync.Mutex\n\tchannel     timeoutChan\n\tchannelLock sync.RWMutex\n\ttimer       *time.Timer\n\ttimedout    atomic.Bool\n}\n\n// makeWin32File makes a new win32File from an existing file handle.\nfunc makeWin32File(h windows.Handle) (*win32File, error) {\n\tf := &win32File{handle: h}\n\tioInitOnce.Do(initIO)\n\t_, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = setFileCompletionNotificationModes(h, windows.FILE_SKIP_COMPLETION_PORT_ON_SUCCESS|windows.FILE_SKIP_SET_EVENT_ON_HANDLE)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tf.readDeadline.channel = make(timeoutChan)\n\tf.writeDeadline.channel = make(timeoutChan)\n\treturn f, nil\n}\n\n// Deprecated: use NewOpenFile instead.\nfunc MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) {\n\treturn NewOpenFile(windows.Handle(h))\n}\n\nfunc NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) {\n\t// If we return the result of makeWin32File directly, it can result in an\n\t// interface-wrapped nil, rather than a nil interface value.\n\tf, err := makeWin32File(h)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}\n\n// closeHandle closes the resources associated with a Win32 handle.\nfunc (f *win32File) closeHandle() {\n\tf.wgLock.Lock()\n\t// Atomically set that we are closing, releasing the resources only once.\n\tif !f.closing.Swap(true) {\n\t\tf.wgLock.Unlock()\n\t\t// cancel all IO and wait for it to complete\n\t\t_ = cancelIoEx(f.handle, nil)\n\t\tf.wg.Wait()\n\t\t// at this point, no new IO can start\n\t\twindows.Close(f.handle)\n\t\tf.handle = 0\n\t} else {\n\t\tf.wgLock.Unlock()\n\t}\n}\n\n// Close closes a win32File.\nfunc (f *win32File) Close() error {\n\tf.closeHandle()\n\treturn nil\n}\n\n// IsClosed checks if the file has been closed.\nfunc (f *win32File) IsClosed() bool {\n\treturn f.closing.Load()\n}\n\n// prepareIO prepares for a new IO operation.\n// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning.\nfunc (f *win32File) prepareIO() (*ioOperation, error) {\n\tf.wgLock.RLock()\n\tif f.closing.Load() {\n\t\tf.wgLock.RUnlock()\n\t\treturn nil, ErrFileClosed\n\t}\n\tf.wg.Add(1)\n\tf.wgLock.RUnlock()\n\tc := &ioOperation{}\n\tc.ch = make(chan ioResult)\n\treturn c, nil\n}\n\n// ioCompletionProcessor processes completed async IOs forever.\nfunc ioCompletionProcessor(h windows.Handle) {\n\tfor {\n\t\tvar bytes uint32\n\t\tvar key uintptr\n\t\tvar op *ioOperation\n\t\terr := getQueuedCompletionStatus(h, &bytes, &key, &op, windows.INFINITE)\n\t\tif op == nil {\n\t\t\tpanic(err)\n\t\t}\n\t\top.ch <- ioResult{bytes, err}\n\t}\n}\n\n// todo: helsaawy - create an asyncIO version that takes a context\n\n// asyncIO processes the return value from ReadFile or WriteFile, blocking until\n// the operation has actually completed.\nfunc (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) {\n\tif err != windows.ERROR_IO_PENDING { //nolint:errorlint // err is Errno\n\t\treturn int(bytes), err\n\t}\n\n\tif f.closing.Load() {\n\t\t_ = cancelIoEx(f.handle, &c.o)\n\t}\n\n\tvar timeout timeoutChan\n\tif d != nil {\n\t\td.channelLock.Lock()\n\t\ttimeout = d.channel\n\t\td.channelLock.Unlock()\n\t}\n\n\tvar r ioResult\n\tselect {\n\tcase r = <-c.ch:\n\t\terr = r.err\n\t\tif err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno\n\t\t\tif f.closing.Load() {\n\t\t\t\terr = ErrFileClosed\n\t\t\t}\n\t\t} else if err != nil && f.socket {\n\t\t\t// err is from Win32. Query the overlapped structure to get the winsock error.\n\t\t\tvar bytes, flags uint32\n\t\t\terr = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags)\n\t\t}\n\tcase <-timeout:\n\t\t_ = cancelIoEx(f.handle, &c.o)\n\t\tr = <-c.ch\n\t\terr = r.err\n\t\tif err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno\n\t\t\terr = ErrTimeout\n\t\t}\n\t}\n\n\t// runtime.KeepAlive is needed, as c is passed via native\n\t// code to ioCompletionProcessor, c must remain alive\n\t// until the channel read is complete.\n\t// todo: (de)allocate *ioOperation via win32 heap functions, instead of needing to KeepAlive?\n\truntime.KeepAlive(c)\n\treturn int(r.bytes), err\n}\n\n// Read reads from a file handle.\nfunc (f *win32File) Read(b []byte) (int, error) {\n\tc, err := f.prepareIO()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer f.wg.Done()\n\n\tif f.readDeadline.timedout.Load() {\n\t\treturn 0, ErrTimeout\n\t}\n\n\tvar bytes uint32\n\terr = windows.ReadFile(f.handle, b, &bytes, &c.o)\n\tn, err := f.asyncIO(c, &f.readDeadline, bytes, err)\n\truntime.KeepAlive(b)\n\n\t// Handle EOF conditions.\n\tif err == nil && n == 0 && len(b) != 0 {\n\t\treturn 0, io.EOF\n\t} else if err == windows.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno\n\t\treturn 0, io.EOF\n\t}\n\treturn n, err\n}\n\n// Write writes to a file handle.\nfunc (f *win32File) Write(b []byte) (int, error) {\n\tc, err := f.prepareIO()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer f.wg.Done()\n\n\tif f.writeDeadline.timedout.Load() {\n\t\treturn 0, ErrTimeout\n\t}\n\n\tvar bytes uint32\n\terr = windows.WriteFile(f.handle, b, &bytes, &c.o)\n\tn, err := f.asyncIO(c, &f.writeDeadline, bytes, err)\n\truntime.KeepAlive(b)\n\treturn n, err\n}\n\nfunc (f *win32File) SetReadDeadline(deadline time.Time) error {\n\treturn f.readDeadline.set(deadline)\n}\n\nfunc (f *win32File) SetWriteDeadline(deadline time.Time) error {\n\treturn f.writeDeadline.set(deadline)\n}\n\nfunc (f *win32File) Flush() error {\n\treturn windows.FlushFileBuffers(f.handle)\n}\n\nfunc (f *win32File) Fd() uintptr {\n\treturn uintptr(f.handle)\n}\n\nfunc (d *deadlineHandler) set(deadline time.Time) error {\n\td.setLock.Lock()\n\tdefer d.setLock.Unlock()\n\n\tif d.timer != nil {\n\t\tif !d.timer.Stop() {\n\t\t\t<-d.channel\n\t\t}\n\t\td.timer = nil\n\t}\n\td.timedout.Store(false)\n\n\tselect {\n\tcase <-d.channel:\n\t\td.channelLock.Lock()\n\t\td.channel = make(chan struct{})\n\t\td.channelLock.Unlock()\n\tdefault:\n\t}\n\n\tif deadline.IsZero() {\n\t\treturn nil\n\t}\n\n\ttimeoutIO := func() {\n\t\td.timedout.Store(true)\n\t\tclose(d.channel)\n\t}\n\n\tnow := time.Now()\n\tduration := deadline.Sub(now)\n\tif deadline.After(now) {\n\t\t// Deadline is in the future, set a timer to wait\n\t\td.timer = time.AfterFunc(duration, timeoutIO)\n\t} else {\n\t\t// Deadline is in the past. Cancel all pending IO now.\n\t\ttimeoutIO()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/fileinfo.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// FileBasicInfo contains file access time and file attributes information.\ntype FileBasicInfo struct {\n\tCreationTime, LastAccessTime, LastWriteTime, ChangeTime windows.Filetime\n\tFileAttributes                                          uint32\n\t_                                                       uint32 // padding\n}\n\n// alignedFileBasicInfo is a FileBasicInfo, but aligned to uint64 by containing\n// uint64 rather than windows.Filetime. Filetime contains two uint32s. uint64\n// alignment is necessary to pass this as FILE_BASIC_INFO.\ntype alignedFileBasicInfo struct {\n\tCreationTime, LastAccessTime, LastWriteTime, ChangeTime uint64\n\tFileAttributes                                          uint32\n\t_                                                       uint32 // padding\n}\n\n// GetFileBasicInfo retrieves times and attributes for a file.\nfunc GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) {\n\tbi := &alignedFileBasicInfo{}\n\tif err := windows.GetFileInformationByHandleEx(\n\t\twindows.Handle(f.Fd()),\n\t\twindows.FileBasicInfo,\n\t\t(*byte)(unsafe.Pointer(bi)),\n\t\tuint32(unsafe.Sizeof(*bi)),\n\t); err != nil {\n\t\treturn nil, &os.PathError{Op: \"GetFileInformationByHandleEx\", Path: f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(f)\n\t// Reinterpret the alignedFileBasicInfo as a FileBasicInfo so it matches the\n\t// public API of this module. The data may be unnecessarily aligned.\n\treturn (*FileBasicInfo)(unsafe.Pointer(bi)), nil\n}\n\n// SetFileBasicInfo sets times and attributes for a file.\nfunc SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error {\n\t// Create an alignedFileBasicInfo based on a FileBasicInfo. The copy is\n\t// suitable to pass to GetFileInformationByHandleEx.\n\tbiAligned := *(*alignedFileBasicInfo)(unsafe.Pointer(bi))\n\tif err := windows.SetFileInformationByHandle(\n\t\twindows.Handle(f.Fd()),\n\t\twindows.FileBasicInfo,\n\t\t(*byte)(unsafe.Pointer(&biAligned)),\n\t\tuint32(unsafe.Sizeof(biAligned)),\n\t); err != nil {\n\t\treturn &os.PathError{Op: \"SetFileInformationByHandle\", Path: f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(f)\n\treturn nil\n}\n\n// FileStandardInfo contains extended information for the file.\n// FILE_STANDARD_INFO in WinBase.h\n// https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_standard_info\ntype FileStandardInfo struct {\n\tAllocationSize, EndOfFile int64\n\tNumberOfLinks             uint32\n\tDeletePending, Directory  bool\n}\n\n// GetFileStandardInfo retrieves ended information for the file.\nfunc GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) {\n\tsi := &FileStandardInfo{}\n\tif err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()),\n\t\twindows.FileStandardInfo,\n\t\t(*byte)(unsafe.Pointer(si)),\n\t\tuint32(unsafe.Sizeof(*si))); err != nil {\n\t\treturn nil, &os.PathError{Op: \"GetFileInformationByHandleEx\", Path: f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(f)\n\treturn si, nil\n}\n\n// FileIDInfo contains the volume serial number and file ID for a file. This pair should be\n// unique on a system.\ntype FileIDInfo struct {\n\tVolumeSerialNumber uint64\n\tFileID             [16]byte\n}\n\n// GetFileID retrieves the unique (volume, file ID) pair for a file.\nfunc GetFileID(f *os.File) (*FileIDInfo, error) {\n\tfileID := &FileIDInfo{}\n\tif err := windows.GetFileInformationByHandleEx(\n\t\twindows.Handle(f.Fd()),\n\t\twindows.FileIdInfo,\n\t\t(*byte)(unsafe.Pointer(fileID)),\n\t\tuint32(unsafe.Sizeof(*fileID)),\n\t); err != nil {\n\t\treturn nil, &os.PathError{Op: \"GetFileInformationByHandleEx\", Path: f.Name(), Err: err}\n\t}\n\truntime.KeepAlive(f)\n\treturn fileID, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/hvsock.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n\n\t\"github.com/Microsoft/go-winio/internal/socket\"\n\t\"github.com/Microsoft/go-winio/pkg/guid\"\n)\n\nconst afHVSock = 34 // AF_HYPERV\n\n// Well known Service and VM IDs\n// https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service#vmid-wildcards\n\n// HvsockGUIDWildcard is the wildcard VmId for accepting connections from all partitions.\nfunc HvsockGUIDWildcard() guid.GUID { // 00000000-0000-0000-0000-000000000000\n\treturn guid.GUID{}\n}\n\n// HvsockGUIDBroadcast is the wildcard VmId for broadcasting sends to all partitions.\nfunc HvsockGUIDBroadcast() guid.GUID { // ffffffff-ffff-ffff-ffff-ffffffffffff\n\treturn guid.GUID{\n\t\tData1: 0xffffffff,\n\t\tData2: 0xffff,\n\t\tData3: 0xffff,\n\t\tData4: [8]uint8{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n\t}\n}\n\n// HvsockGUIDLoopback is the Loopback VmId for accepting connections to the same partition as the connector.\nfunc HvsockGUIDLoopback() guid.GUID { // e0e16197-dd56-4a10-9195-5ee7a155a838\n\treturn guid.GUID{\n\t\tData1: 0xe0e16197,\n\t\tData2: 0xdd56,\n\t\tData3: 0x4a10,\n\t\tData4: [8]uint8{0x91, 0x95, 0x5e, 0xe7, 0xa1, 0x55, 0xa8, 0x38},\n\t}\n}\n\n// HvsockGUIDSiloHost is the address of a silo's host partition:\n//   - The silo host of a hosted silo is the utility VM.\n//   - The silo host of a silo on a physical host is the physical host.\nfunc HvsockGUIDSiloHost() guid.GUID { // 36bd0c5c-7276-4223-88ba-7d03b654c568\n\treturn guid.GUID{\n\t\tData1: 0x36bd0c5c,\n\t\tData2: 0x7276,\n\t\tData3: 0x4223,\n\t\tData4: [8]byte{0x88, 0xba, 0x7d, 0x03, 0xb6, 0x54, 0xc5, 0x68},\n\t}\n}\n\n// HvsockGUIDChildren is the wildcard VmId for accepting connections from the connector's child partitions.\nfunc HvsockGUIDChildren() guid.GUID { // 90db8b89-0d35-4f79-8ce9-49ea0ac8b7cd\n\treturn guid.GUID{\n\t\tData1: 0x90db8b89,\n\t\tData2: 0xd35,\n\t\tData3: 0x4f79,\n\t\tData4: [8]uint8{0x8c, 0xe9, 0x49, 0xea, 0xa, 0xc8, 0xb7, 0xcd},\n\t}\n}\n\n// HvsockGUIDParent is the wildcard VmId for accepting connections from the connector's parent partition.\n// Listening on this VmId accepts connection from:\n//   - Inside silos: silo host partition.\n//   - Inside hosted silo: host of the VM.\n//   - Inside VM: VM host.\n//   - Physical host: Not supported.\nfunc HvsockGUIDParent() guid.GUID { // a42e7cda-d03f-480c-9cc2-a4de20abb878\n\treturn guid.GUID{\n\t\tData1: 0xa42e7cda,\n\t\tData2: 0xd03f,\n\t\tData3: 0x480c,\n\t\tData4: [8]uint8{0x9c, 0xc2, 0xa4, 0xde, 0x20, 0xab, 0xb8, 0x78},\n\t}\n}\n\n// hvsockVsockServiceTemplate is the Service GUID used for the VSOCK protocol.\nfunc hvsockVsockServiceTemplate() guid.GUID { // 00000000-facb-11e6-bd58-64006a7986d3\n\treturn guid.GUID{\n\t\tData2: 0xfacb,\n\t\tData3: 0x11e6,\n\t\tData4: [8]uint8{0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3},\n\t}\n}\n\n// An HvsockAddr is an address for a AF_HYPERV socket.\ntype HvsockAddr struct {\n\tVMID      guid.GUID\n\tServiceID guid.GUID\n}\n\ntype rawHvsockAddr struct {\n\tFamily    uint16\n\t_         uint16\n\tVMID      guid.GUID\n\tServiceID guid.GUID\n}\n\nvar _ socket.RawSockaddr = &rawHvsockAddr{}\n\n// Network returns the address's network name, \"hvsock\".\nfunc (*HvsockAddr) Network() string {\n\treturn \"hvsock\"\n}\n\nfunc (addr *HvsockAddr) String() string {\n\treturn fmt.Sprintf(\"%s:%s\", &addr.VMID, &addr.ServiceID)\n}\n\n// VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port.\nfunc VsockServiceID(port uint32) guid.GUID {\n\tg := hvsockVsockServiceTemplate() // make a copy\n\tg.Data1 = port\n\treturn g\n}\n\nfunc (addr *HvsockAddr) raw() rawHvsockAddr {\n\treturn rawHvsockAddr{\n\t\tFamily:    afHVSock,\n\t\tVMID:      addr.VMID,\n\t\tServiceID: addr.ServiceID,\n\t}\n}\n\nfunc (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) {\n\taddr.VMID = raw.VMID\n\taddr.ServiceID = raw.ServiceID\n}\n\n// Sockaddr returns a pointer to and the size of this struct.\n//\n// Implements the [socket.RawSockaddr] interface, and allows use in\n// [socket.Bind] and [socket.ConnectEx].\nfunc (r *rawHvsockAddr) Sockaddr() (unsafe.Pointer, int32, error) {\n\treturn unsafe.Pointer(r), int32(unsafe.Sizeof(rawHvsockAddr{})), nil\n}\n\n// Sockaddr interface allows use with `sockets.Bind()` and `.ConnectEx()`.\nfunc (r *rawHvsockAddr) FromBytes(b []byte) error {\n\tn := int(unsafe.Sizeof(rawHvsockAddr{}))\n\n\tif len(b) < n {\n\t\treturn fmt.Errorf(\"got %d, want %d: %w\", len(b), n, socket.ErrBufferSize)\n\t}\n\n\tcopy(unsafe.Slice((*byte)(unsafe.Pointer(r)), n), b[:n])\n\tif r.Family != afHVSock {\n\t\treturn fmt.Errorf(\"got %d, want %d: %w\", r.Family, afHVSock, socket.ErrAddrFamily)\n\t}\n\n\treturn nil\n}\n\n// HvsockListener is a socket listener for the AF_HYPERV address family.\ntype HvsockListener struct {\n\tsock *win32File\n\taddr HvsockAddr\n}\n\nvar _ net.Listener = &HvsockListener{}\n\n// HvsockConn is a connected socket of the AF_HYPERV address family.\ntype HvsockConn struct {\n\tsock          *win32File\n\tlocal, remote HvsockAddr\n}\n\nvar _ net.Conn = &HvsockConn{}\n\nfunc newHVSocket() (*win32File, error) {\n\tfd, err := windows.Socket(afHVSock, windows.SOCK_STREAM, 1)\n\tif err != nil {\n\t\treturn nil, os.NewSyscallError(\"socket\", err)\n\t}\n\tf, err := makeWin32File(fd)\n\tif err != nil {\n\t\twindows.Close(fd)\n\t\treturn nil, err\n\t}\n\tf.socket = true\n\treturn f, nil\n}\n\n// ListenHvsock listens for connections on the specified hvsock address.\nfunc ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) {\n\tl := &HvsockListener{addr: *addr}\n\n\tvar sock *win32File\n\tsock, err = newHVSocket()\n\tif err != nil {\n\t\treturn nil, l.opErr(\"listen\", err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t_ = sock.Close()\n\t\t}\n\t}()\n\n\tsa := addr.raw()\n\terr = socket.Bind(sock.handle, &sa)\n\tif err != nil {\n\t\treturn nil, l.opErr(\"listen\", os.NewSyscallError(\"socket\", err))\n\t}\n\terr = windows.Listen(sock.handle, 16)\n\tif err != nil {\n\t\treturn nil, l.opErr(\"listen\", os.NewSyscallError(\"listen\", err))\n\t}\n\treturn &HvsockListener{sock: sock, addr: *addr}, nil\n}\n\nfunc (l *HvsockListener) opErr(op string, err error) error {\n\treturn &net.OpError{Op: op, Net: \"hvsock\", Addr: &l.addr, Err: err}\n}\n\n// Addr returns the listener's network address.\nfunc (l *HvsockListener) Addr() net.Addr {\n\treturn &l.addr\n}\n\n// Accept waits for the next connection and returns it.\nfunc (l *HvsockListener) Accept() (_ net.Conn, err error) {\n\tsock, err := newHVSocket()\n\tif err != nil {\n\t\treturn nil, l.opErr(\"accept\", err)\n\t}\n\tdefer func() {\n\t\tif sock != nil {\n\t\t\tsock.Close()\n\t\t}\n\t}()\n\tc, err := l.sock.prepareIO()\n\tif err != nil {\n\t\treturn nil, l.opErr(\"accept\", err)\n\t}\n\tdefer l.sock.wg.Done()\n\n\t// AcceptEx, per documentation, requires an extra 16 bytes per address.\n\t//\n\t// https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-acceptex\n\tconst addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{}))\n\tvar addrbuf [addrlen * 2]byte\n\n\tvar bytes uint32\n\terr = windows.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o)\n\tif _, err = l.sock.asyncIO(c, nil, bytes, err); err != nil {\n\t\treturn nil, l.opErr(\"accept\", os.NewSyscallError(\"acceptex\", err))\n\t}\n\n\tconn := &HvsockConn{\n\t\tsock: sock,\n\t}\n\t// The local address returned in the AcceptEx buffer is the same as the Listener socket's\n\t// address. However, the service GUID reported by GetSockName is different from the Listeners\n\t// socket, and is sometimes the same as the local address of the socket that dialed the\n\t// address, with the service GUID.Data1 incremented, but othertimes is different.\n\t// todo: does the local address matter? is the listener's address or the actual address appropriate?\n\tconn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0])))\n\tconn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen])))\n\n\t// initialize the accepted socket and update its properties with those of the listening socket\n\tif err = windows.Setsockopt(sock.handle,\n\t\twindows.SOL_SOCKET, windows.SO_UPDATE_ACCEPT_CONTEXT,\n\t\t(*byte)(unsafe.Pointer(&l.sock.handle)), int32(unsafe.Sizeof(l.sock.handle))); err != nil {\n\t\treturn nil, conn.opErr(\"accept\", os.NewSyscallError(\"setsockopt\", err))\n\t}\n\n\tsock = nil\n\treturn conn, nil\n}\n\n// Close closes the listener, causing any pending Accept calls to fail.\nfunc (l *HvsockListener) Close() error {\n\treturn l.sock.Close()\n}\n\n// HvsockDialer configures and dials a Hyper-V Socket (ie, [HvsockConn]).\ntype HvsockDialer struct {\n\t// Deadline is the time the Dial operation must connect before erroring.\n\tDeadline time.Time\n\n\t// Retries is the number of additional connects to try if the connection times out, is refused,\n\t// or the host is unreachable\n\tRetries uint\n\n\t// RetryWait is the time to wait after a connection error to retry\n\tRetryWait time.Duration\n\n\trt *time.Timer // redial wait timer\n}\n\n// Dial the Hyper-V socket at addr.\n//\n// See [HvsockDialer.Dial] for more information.\nfunc Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) {\n\treturn (&HvsockDialer{}).Dial(ctx, addr)\n}\n\n// Dial attempts to connect to the Hyper-V socket at addr, and returns a connection if successful.\n// Will attempt (HvsockDialer).Retries if dialing fails, waiting (HvsockDialer).RetryWait between\n// retries.\n//\n// Dialing can be cancelled either by providing (HvsockDialer).Deadline, or cancelling ctx.\nfunc (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) {\n\top := \"dial\"\n\t// create the conn early to use opErr()\n\tconn = &HvsockConn{\n\t\tremote: *addr,\n\t}\n\n\tif !d.Deadline.IsZero() {\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithDeadline(ctx, d.Deadline)\n\t\tdefer cancel()\n\t}\n\n\t// preemptive timeout/cancellation check\n\tif err = ctx.Err(); err != nil {\n\t\treturn nil, conn.opErr(op, err)\n\t}\n\n\tsock, err := newHVSocket()\n\tif err != nil {\n\t\treturn nil, conn.opErr(op, err)\n\t}\n\tdefer func() {\n\t\tif sock != nil {\n\t\t\tsock.Close()\n\t\t}\n\t}()\n\n\tsa := addr.raw()\n\terr = socket.Bind(sock.handle, &sa)\n\tif err != nil {\n\t\treturn nil, conn.opErr(op, os.NewSyscallError(\"bind\", err))\n\t}\n\n\tc, err := sock.prepareIO()\n\tif err != nil {\n\t\treturn nil, conn.opErr(op, err)\n\t}\n\tdefer sock.wg.Done()\n\tvar bytes uint32\n\tfor i := uint(0); i <= d.Retries; i++ {\n\t\terr = socket.ConnectEx(\n\t\t\tsock.handle,\n\t\t\t&sa,\n\t\t\tnil, // sendBuf\n\t\t\t0,   // sendDataLen\n\t\t\t&bytes,\n\t\t\t(*windows.Overlapped)(unsafe.Pointer(&c.o)))\n\t\t_, err = sock.asyncIO(c, nil, bytes, err)\n\t\tif i < d.Retries && canRedial(err) {\n\t\t\tif err = d.redialWait(ctx); err == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\tif err != nil {\n\t\treturn nil, conn.opErr(op, os.NewSyscallError(\"connectex\", err))\n\t}\n\n\t// update the connection properties, so shutdown can be used\n\tif err = windows.Setsockopt(\n\t\tsock.handle,\n\t\twindows.SOL_SOCKET,\n\t\twindows.SO_UPDATE_CONNECT_CONTEXT,\n\t\tnil, // optvalue\n\t\t0,   // optlen\n\t); err != nil {\n\t\treturn nil, conn.opErr(op, os.NewSyscallError(\"setsockopt\", err))\n\t}\n\n\t// get the local name\n\tvar sal rawHvsockAddr\n\terr = socket.GetSockName(sock.handle, &sal)\n\tif err != nil {\n\t\treturn nil, conn.opErr(op, os.NewSyscallError(\"getsockname\", err))\n\t}\n\tconn.local.fromRaw(&sal)\n\n\t// one last check for timeout, since asyncIO doesn't check the context\n\tif err = ctx.Err(); err != nil {\n\t\treturn nil, conn.opErr(op, err)\n\t}\n\n\tconn.sock = sock\n\tsock = nil\n\n\treturn conn, nil\n}\n\n// redialWait waits before attempting to redial, resetting the timer as appropriate.\nfunc (d *HvsockDialer) redialWait(ctx context.Context) (err error) {\n\tif d.RetryWait == 0 {\n\t\treturn nil\n\t}\n\n\tif d.rt == nil {\n\t\td.rt = time.NewTimer(d.RetryWait)\n\t} else {\n\t\t// should already be stopped and drained\n\t\td.rt.Reset(d.RetryWait)\n\t}\n\n\tselect {\n\tcase <-ctx.Done():\n\tcase <-d.rt.C:\n\t\treturn nil\n\t}\n\n\t// stop and drain the timer\n\tif !d.rt.Stop() {\n\t\t<-d.rt.C\n\t}\n\treturn ctx.Err()\n}\n\n// assumes error is a plain, unwrapped windows.Errno provided by direct syscall.\nfunc canRedial(err error) bool {\n\t//nolint:errorlint // guaranteed to be an Errno\n\tswitch err {\n\tcase windows.WSAECONNREFUSED, windows.WSAENETUNREACH, windows.WSAETIMEDOUT,\n\t\twindows.ERROR_CONNECTION_REFUSED, windows.ERROR_CONNECTION_UNAVAIL:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (conn *HvsockConn) opErr(op string, err error) error {\n\t// translate from \"file closed\" to \"socket closed\"\n\tif errors.Is(err, ErrFileClosed) {\n\t\terr = socket.ErrSocketClosed\n\t}\n\treturn &net.OpError{Op: op, Net: \"hvsock\", Source: &conn.local, Addr: &conn.remote, Err: err}\n}\n\nfunc (conn *HvsockConn) Read(b []byte) (int, error) {\n\tc, err := conn.sock.prepareIO()\n\tif err != nil {\n\t\treturn 0, conn.opErr(\"read\", err)\n\t}\n\tdefer conn.sock.wg.Done()\n\tbuf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))}\n\tvar flags, bytes uint32\n\terr = windows.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil)\n\tn, err := conn.sock.asyncIO(c, &conn.sock.readDeadline, bytes, err)\n\tif err != nil {\n\t\tvar eno windows.Errno\n\t\tif errors.As(err, &eno) {\n\t\t\terr = os.NewSyscallError(\"wsarecv\", eno)\n\t\t}\n\t\treturn 0, conn.opErr(\"read\", err)\n\t} else if n == 0 {\n\t\terr = io.EOF\n\t}\n\treturn n, err\n}\n\nfunc (conn *HvsockConn) Write(b []byte) (int, error) {\n\tt := 0\n\tfor len(b) != 0 {\n\t\tn, err := conn.write(b)\n\t\tif err != nil {\n\t\t\treturn t + n, err\n\t\t}\n\t\tt += n\n\t\tb = b[n:]\n\t}\n\treturn t, nil\n}\n\nfunc (conn *HvsockConn) write(b []byte) (int, error) {\n\tc, err := conn.sock.prepareIO()\n\tif err != nil {\n\t\treturn 0, conn.opErr(\"write\", err)\n\t}\n\tdefer conn.sock.wg.Done()\n\tbuf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))}\n\tvar bytes uint32\n\terr = windows.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil)\n\tn, err := conn.sock.asyncIO(c, &conn.sock.writeDeadline, bytes, err)\n\tif err != nil {\n\t\tvar eno windows.Errno\n\t\tif errors.As(err, &eno) {\n\t\t\terr = os.NewSyscallError(\"wsasend\", eno)\n\t\t}\n\t\treturn 0, conn.opErr(\"write\", err)\n\t}\n\treturn n, err\n}\n\n// Close closes the socket connection, failing any pending read or write calls.\nfunc (conn *HvsockConn) Close() error {\n\treturn conn.sock.Close()\n}\n\nfunc (conn *HvsockConn) IsClosed() bool {\n\treturn conn.sock.IsClosed()\n}\n\n// shutdown disables sending or receiving on a socket.\nfunc (conn *HvsockConn) shutdown(how int) error {\n\tif conn.IsClosed() {\n\t\treturn socket.ErrSocketClosed\n\t}\n\n\terr := windows.Shutdown(conn.sock.handle, how)\n\tif err != nil {\n\t\t// If the connection was closed, shutdowns fail with \"not connected\"\n\t\tif errors.Is(err, windows.WSAENOTCONN) ||\n\t\t\terrors.Is(err, windows.WSAESHUTDOWN) {\n\t\t\terr = socket.ErrSocketClosed\n\t\t}\n\t\treturn os.NewSyscallError(\"shutdown\", err)\n\t}\n\treturn nil\n}\n\n// CloseRead shuts down the read end of the socket, preventing future read operations.\nfunc (conn *HvsockConn) CloseRead() error {\n\terr := conn.shutdown(windows.SHUT_RD)\n\tif err != nil {\n\t\treturn conn.opErr(\"closeread\", err)\n\t}\n\treturn nil\n}\n\n// CloseWrite shuts down the write end of the socket, preventing future write operations and\n// notifying the other endpoint that no more data will be written.\nfunc (conn *HvsockConn) CloseWrite() error {\n\terr := conn.shutdown(windows.SHUT_WR)\n\tif err != nil {\n\t\treturn conn.opErr(\"closewrite\", err)\n\t}\n\treturn nil\n}\n\n// LocalAddr returns the local address of the connection.\nfunc (conn *HvsockConn) LocalAddr() net.Addr {\n\treturn &conn.local\n}\n\n// RemoteAddr returns the remote address of the connection.\nfunc (conn *HvsockConn) RemoteAddr() net.Addr {\n\treturn &conn.remote\n}\n\n// SetDeadline implements the net.Conn SetDeadline method.\nfunc (conn *HvsockConn) SetDeadline(t time.Time) error {\n\t// todo: implement `SetDeadline` for `win32File`\n\tif err := conn.SetReadDeadline(t); err != nil {\n\t\treturn fmt.Errorf(\"set read deadline: %w\", err)\n\t}\n\tif err := conn.SetWriteDeadline(t); err != nil {\n\t\treturn fmt.Errorf(\"set write deadline: %w\", err)\n\t}\n\treturn nil\n}\n\n// SetReadDeadline implements the net.Conn SetReadDeadline method.\nfunc (conn *HvsockConn) SetReadDeadline(t time.Time) error {\n\treturn conn.sock.SetReadDeadline(t)\n}\n\n// SetWriteDeadline implements the net.Conn SetWriteDeadline method.\nfunc (conn *HvsockConn) SetWriteDeadline(t time.Time) error {\n\treturn conn.sock.SetWriteDeadline(t)\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/doc.go",
    "content": "// This package contains Win32 filesystem functionality.\npackage fs\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/fs.go",
    "content": "//go:build windows\n\npackage fs\n\nimport (\n\t\"golang.org/x/sys/windows\"\n\n\t\"github.com/Microsoft/go-winio/internal/stringbuffer\"\n)\n\n//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go fs.go\n\n// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew\n//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW\n\nconst NullHandle windows.Handle = 0\n\n// AccessMask defines standard, specific, and generic rights.\n//\n// Used with CreateFile and NtCreateFile (and co.).\n//\n//\tBitmask:\n//\t 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\n//\t 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\n//\t+---------------+---------------+-------------------------------+\n//\t|G|G|G|G|Resvd|A| StandardRights|         SpecificRights        |\n//\t|R|W|E|A|     |S|               |                               |\n//\t+-+-------------+---------------+-------------------------------+\n//\n//\tGR     Generic Read\n//\tGW     Generic Write\n//\tGE     Generic Exectue\n//\tGA     Generic All\n//\tResvd  Reserved\n//\tAS     Access Security System\n//\n// https://learn.microsoft.com/en-us/windows/win32/secauthz/access-mask\n//\n// https://learn.microsoft.com/en-us/windows/win32/secauthz/generic-access-rights\n//\n// https://learn.microsoft.com/en-us/windows/win32/fileio/file-access-rights-constants\ntype AccessMask = windows.ACCESS_MASK\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// Not actually any.\n\t//\n\t// For CreateFile: \"query certain metadata such as file, directory, or device attributes without accessing that file or device\"\n\t// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#parameters\n\tFILE_ANY_ACCESS AccessMask = 0\n\n\tGENERIC_READ           AccessMask = 0x8000_0000\n\tGENERIC_WRITE          AccessMask = 0x4000_0000\n\tGENERIC_EXECUTE        AccessMask = 0x2000_0000\n\tGENERIC_ALL            AccessMask = 0x1000_0000\n\tACCESS_SYSTEM_SECURITY AccessMask = 0x0100_0000\n\n\t// Specific Object Access\n\t// from ntioapi.h\n\n\tFILE_READ_DATA      AccessMask = (0x0001) // file & pipe\n\tFILE_LIST_DIRECTORY AccessMask = (0x0001) // directory\n\n\tFILE_WRITE_DATA AccessMask = (0x0002) // file & pipe\n\tFILE_ADD_FILE   AccessMask = (0x0002) // directory\n\n\tFILE_APPEND_DATA          AccessMask = (0x0004) // file\n\tFILE_ADD_SUBDIRECTORY     AccessMask = (0x0004) // directory\n\tFILE_CREATE_PIPE_INSTANCE AccessMask = (0x0004) // named pipe\n\n\tFILE_READ_EA         AccessMask = (0x0008) // file & directory\n\tFILE_READ_PROPERTIES AccessMask = FILE_READ_EA\n\n\tFILE_WRITE_EA         AccessMask = (0x0010) // file & directory\n\tFILE_WRITE_PROPERTIES AccessMask = FILE_WRITE_EA\n\n\tFILE_EXECUTE  AccessMask = (0x0020) // file\n\tFILE_TRAVERSE AccessMask = (0x0020) // directory\n\n\tFILE_DELETE_CHILD AccessMask = (0x0040) // directory\n\n\tFILE_READ_ATTRIBUTES AccessMask = (0x0080) // all\n\n\tFILE_WRITE_ATTRIBUTES AccessMask = (0x0100) // all\n\n\tFILE_ALL_ACCESS      AccessMask = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF)\n\tFILE_GENERIC_READ    AccessMask = (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE)\n\tFILE_GENERIC_WRITE   AccessMask = (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE)\n\tFILE_GENERIC_EXECUTE AccessMask = (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE)\n\n\tSPECIFIC_RIGHTS_ALL AccessMask = 0x0000FFFF\n\n\t// Standard Access\n\t// from ntseapi.h\n\n\tDELETE       AccessMask = 0x0001_0000\n\tREAD_CONTROL AccessMask = 0x0002_0000\n\tWRITE_DAC    AccessMask = 0x0004_0000\n\tWRITE_OWNER  AccessMask = 0x0008_0000\n\tSYNCHRONIZE  AccessMask = 0x0010_0000\n\n\tSTANDARD_RIGHTS_REQUIRED AccessMask = 0x000F_0000\n\n\tSTANDARD_RIGHTS_READ    AccessMask = READ_CONTROL\n\tSTANDARD_RIGHTS_WRITE   AccessMask = READ_CONTROL\n\tSTANDARD_RIGHTS_EXECUTE AccessMask = READ_CONTROL\n\n\tSTANDARD_RIGHTS_ALL AccessMask = 0x001F_0000\n)\n\ntype FileShareMode uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\tFILE_SHARE_NONE        FileShareMode = 0x00\n\tFILE_SHARE_READ        FileShareMode = 0x01\n\tFILE_SHARE_WRITE       FileShareMode = 0x02\n\tFILE_SHARE_DELETE      FileShareMode = 0x04\n\tFILE_SHARE_VALID_FLAGS FileShareMode = 0x07\n)\n\ntype FileCreationDisposition uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// from winbase.h\n\n\tCREATE_NEW        FileCreationDisposition = 0x01\n\tCREATE_ALWAYS     FileCreationDisposition = 0x02\n\tOPEN_EXISTING     FileCreationDisposition = 0x03\n\tOPEN_ALWAYS       FileCreationDisposition = 0x04\n\tTRUNCATE_EXISTING FileCreationDisposition = 0x05\n)\n\n// Create disposition values for NtCreate*\ntype NTFileCreationDisposition uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// From ntioapi.h\n\n\tFILE_SUPERSEDE           NTFileCreationDisposition = 0x00\n\tFILE_OPEN                NTFileCreationDisposition = 0x01\n\tFILE_CREATE              NTFileCreationDisposition = 0x02\n\tFILE_OPEN_IF             NTFileCreationDisposition = 0x03\n\tFILE_OVERWRITE           NTFileCreationDisposition = 0x04\n\tFILE_OVERWRITE_IF        NTFileCreationDisposition = 0x05\n\tFILE_MAXIMUM_DISPOSITION NTFileCreationDisposition = 0x05\n)\n\n// CreateFile and co. take flags or attributes together as one parameter.\n// Define alias until we can use generics to allow both\n//\n// https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants\ntype FileFlagOrAttribute uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// from winnt.h\n\n\tFILE_FLAG_WRITE_THROUGH       FileFlagOrAttribute = 0x8000_0000\n\tFILE_FLAG_OVERLAPPED          FileFlagOrAttribute = 0x4000_0000\n\tFILE_FLAG_NO_BUFFERING        FileFlagOrAttribute = 0x2000_0000\n\tFILE_FLAG_RANDOM_ACCESS       FileFlagOrAttribute = 0x1000_0000\n\tFILE_FLAG_SEQUENTIAL_SCAN     FileFlagOrAttribute = 0x0800_0000\n\tFILE_FLAG_DELETE_ON_CLOSE     FileFlagOrAttribute = 0x0400_0000\n\tFILE_FLAG_BACKUP_SEMANTICS    FileFlagOrAttribute = 0x0200_0000\n\tFILE_FLAG_POSIX_SEMANTICS     FileFlagOrAttribute = 0x0100_0000\n\tFILE_FLAG_OPEN_REPARSE_POINT  FileFlagOrAttribute = 0x0020_0000\n\tFILE_FLAG_OPEN_NO_RECALL      FileFlagOrAttribute = 0x0010_0000\n\tFILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000\n)\n\n// NtCreate* functions take a dedicated CreateOptions parameter.\n//\n// https://learn.microsoft.com/en-us/windows/win32/api/Winternl/nf-winternl-ntcreatefile\n//\n// https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file\ntype NTCreateOptions uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// From ntioapi.h\n\n\tFILE_DIRECTORY_FILE            NTCreateOptions = 0x0000_0001\n\tFILE_WRITE_THROUGH             NTCreateOptions = 0x0000_0002\n\tFILE_SEQUENTIAL_ONLY           NTCreateOptions = 0x0000_0004\n\tFILE_NO_INTERMEDIATE_BUFFERING NTCreateOptions = 0x0000_0008\n\n\tFILE_SYNCHRONOUS_IO_ALERT    NTCreateOptions = 0x0000_0010\n\tFILE_SYNCHRONOUS_IO_NONALERT NTCreateOptions = 0x0000_0020\n\tFILE_NON_DIRECTORY_FILE      NTCreateOptions = 0x0000_0040\n\tFILE_CREATE_TREE_CONNECTION  NTCreateOptions = 0x0000_0080\n\n\tFILE_COMPLETE_IF_OPLOCKED NTCreateOptions = 0x0000_0100\n\tFILE_NO_EA_KNOWLEDGE      NTCreateOptions = 0x0000_0200\n\tFILE_DISABLE_TUNNELING    NTCreateOptions = 0x0000_0400\n\tFILE_RANDOM_ACCESS        NTCreateOptions = 0x0000_0800\n\n\tFILE_DELETE_ON_CLOSE        NTCreateOptions = 0x0000_1000\n\tFILE_OPEN_BY_FILE_ID        NTCreateOptions = 0x0000_2000\n\tFILE_OPEN_FOR_BACKUP_INTENT NTCreateOptions = 0x0000_4000\n\tFILE_NO_COMPRESSION         NTCreateOptions = 0x0000_8000\n)\n\ntype FileSQSFlag = FileFlagOrAttribute\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\t// from winbase.h\n\n\tSECURITY_ANONYMOUS      FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16)\n\tSECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification << 16)\n\tSECURITY_IMPERSONATION  FileSQSFlag = FileSQSFlag(SecurityImpersonation << 16)\n\tSECURITY_DELEGATION     FileSQSFlag = FileSQSFlag(SecurityDelegation << 16)\n\n\tSECURITY_SQOS_PRESENT     FileSQSFlag = 0x0010_0000\n\tSECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F_0000\n)\n\n// GetFinalPathNameByHandle flags\n//\n// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew#parameters\ntype GetFinalPathFlag uint32\n\n//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API.\nconst (\n\tGetFinalPathDefaultFlag GetFinalPathFlag = 0x0\n\n\tFILE_NAME_NORMALIZED GetFinalPathFlag = 0x0\n\tFILE_NAME_OPENED     GetFinalPathFlag = 0x8\n\n\tVOLUME_NAME_DOS  GetFinalPathFlag = 0x0\n\tVOLUME_NAME_GUID GetFinalPathFlag = 0x1\n\tVOLUME_NAME_NT   GetFinalPathFlag = 0x2\n\tVOLUME_NAME_NONE GetFinalPathFlag = 0x4\n)\n\n// getFinalPathNameByHandle facilitates calling the Windows API GetFinalPathNameByHandle\n// with the given handle and flags. It transparently takes care of creating a buffer of the\n// correct size for the call.\n//\n// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew\nfunc GetFinalPathNameByHandle(h windows.Handle, flags GetFinalPathFlag) (string, error) {\n\tb := stringbuffer.NewWString()\n\t//TODO: can loop infinitely if Win32 keeps returning the same (or a larger) n?\n\tfor {\n\t\tn, err := windows.GetFinalPathNameByHandle(h, b.Pointer(), b.Cap(), uint32(flags))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\t// If the buffer wasn't large enough, n will be the total size needed (including null terminator).\n\t\t// Resize and try again.\n\t\tif n > b.Cap() {\n\t\t\tb.ResizeTo(n)\n\t\t\tcontinue\n\t\t}\n\t\t// If the buffer is large enough, n will be the size not including the null terminator.\n\t\t// Convert to a Go string and return.\n\t\treturn b.String(), nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/security.go",
    "content": "package fs\n\n// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level\ntype SecurityImpersonationLevel int32 // C default enums underlying type is `int`, which is Go `int32`\n\n// Impersonation levels\nconst (\n\tSecurityAnonymous      SecurityImpersonationLevel = 0\n\tSecurityIdentification SecurityImpersonationLevel = 1\n\tSecurityImpersonation  SecurityImpersonationLevel = 2\n\tSecurityDelegation     SecurityImpersonationLevel = 3\n)\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go",
    "content": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT EDIT.\n\npackage fs\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nvar _ unsafe.Pointer\n\n// Do the interface allocations only once for common\n// Errno values.\nconst (\n\terrnoERROR_IO_PENDING = 997\n)\n\nvar (\n\terrERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)\n\terrERROR_EINVAL     error = syscall.EINVAL\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn errERROR_EINVAL\n\tcase errnoERROR_IO_PENDING:\n\t\treturn errERROR_IO_PENDING\n\t}\n\treturn e\n}\n\nvar (\n\tmodkernel32 = windows.NewLazySystemDLL(\"kernel32.dll\")\n\n\tprocCreateFileW = modkernel32.NewProc(\"CreateFileW\")\n)\n\nfunc CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _CreateFile(_p0, access, mode, sa, createmode, attrs, templatefile)\n}\n\nfunc _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) {\n\tr0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile))\n\thandle = windows.Handle(r0)\n\tif handle == windows.InvalidHandle {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go",
    "content": "package socket\n\nimport (\n\t\"unsafe\"\n)\n\n// RawSockaddr allows structs to be used with [Bind] and [ConnectEx]. The\n// struct must meet the Win32 sockaddr requirements specified here:\n// https://docs.microsoft.com/en-us/windows/win32/winsock/sockaddr-2\n//\n// Specifically, the struct size must be least larger than an int16 (unsigned short)\n// for the address family.\ntype RawSockaddr interface {\n\t// Sockaddr returns a pointer to the RawSockaddr and its struct size, allowing\n\t// for the RawSockaddr's data to be overwritten by syscalls (if necessary).\n\t//\n\t// It is the callers responsibility to validate that the values are valid; invalid\n\t// pointers or size can cause a panic.\n\tSockaddr() (unsafe.Pointer, int32, error)\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/socket.go",
    "content": "//go:build windows\n\npackage socket\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/Microsoft/go-winio/pkg/guid\"\n\t\"golang.org/x/sys/windows\"\n)\n\n//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go socket.go\n\n//sys getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getsockname\n//sys getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getpeername\n//sys bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind\n\nconst socketError = uintptr(^uint32(0))\n\nvar (\n\t// todo(helsaawy): create custom error types to store the desired vs actual size and addr family?\n\n\tErrBufferSize     = errors.New(\"buffer size\")\n\tErrAddrFamily     = errors.New(\"address family\")\n\tErrInvalidPointer = errors.New(\"invalid pointer\")\n\tErrSocketClosed   = fmt.Errorf(\"socket closed: %w\", net.ErrClosed)\n)\n\n// todo(helsaawy): replace these with generics, ie: GetSockName[S RawSockaddr](s windows.Handle) (S, error)\n\n// GetSockName writes the local address of socket s to the [RawSockaddr] rsa.\n// If rsa is not large enough, the [windows.WSAEFAULT] is returned.\nfunc GetSockName(s windows.Handle, rsa RawSockaddr) error {\n\tptr, l, err := rsa.Sockaddr()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not retrieve socket pointer and size: %w\", err)\n\t}\n\n\t// although getsockname returns WSAEFAULT if the buffer is too small, it does not set\n\t// &l to the correct size, so--apart from doubling the buffer repeatedly--there is no remedy\n\treturn getsockname(s, ptr, &l)\n}\n\n// GetPeerName returns the remote address the socket is connected to.\n//\n// See [GetSockName] for more information.\nfunc GetPeerName(s windows.Handle, rsa RawSockaddr) error {\n\tptr, l, err := rsa.Sockaddr()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not retrieve socket pointer and size: %w\", err)\n\t}\n\n\treturn getpeername(s, ptr, &l)\n}\n\nfunc Bind(s windows.Handle, rsa RawSockaddr) (err error) {\n\tptr, l, err := rsa.Sockaddr()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not retrieve socket pointer and size: %w\", err)\n\t}\n\n\treturn bind(s, ptr, l)\n}\n\n// \"golang.org/x/sys/windows\".ConnectEx and .Bind only accept internal implementations of the\n// their sockaddr interface, so they cannot be used with HvsockAddr\n// Replicate functionality here from\n// https://cs.opensource.google/go/x/sys/+/master:windows/syscall_windows.go\n\n// The function pointers to `AcceptEx`, `ConnectEx` and `GetAcceptExSockaddrs` must be loaded at\n// runtime via a WSAIoctl call:\n// https://docs.microsoft.com/en-us/windows/win32/api/Mswsock/nc-mswsock-lpfn_connectex#remarks\n\ntype runtimeFunc struct {\n\tid   guid.GUID\n\tonce sync.Once\n\taddr uintptr\n\terr  error\n}\n\nfunc (f *runtimeFunc) Load() error {\n\tf.once.Do(func() {\n\t\tvar s windows.Handle\n\t\ts, f.err = windows.Socket(windows.AF_INET, windows.SOCK_STREAM, windows.IPPROTO_TCP)\n\t\tif f.err != nil {\n\t\t\treturn\n\t\t}\n\t\tdefer windows.CloseHandle(s) //nolint:errcheck\n\n\t\tvar n uint32\n\t\tf.err = windows.WSAIoctl(s,\n\t\t\twindows.SIO_GET_EXTENSION_FUNCTION_POINTER,\n\t\t\t(*byte)(unsafe.Pointer(&f.id)),\n\t\t\tuint32(unsafe.Sizeof(f.id)),\n\t\t\t(*byte)(unsafe.Pointer(&f.addr)),\n\t\t\tuint32(unsafe.Sizeof(f.addr)),\n\t\t\t&n,\n\t\t\tnil, // overlapped\n\t\t\t0,   // completionRoutine\n\t\t)\n\t})\n\treturn f.err\n}\n\nvar (\n\t// todo: add `AcceptEx` and `GetAcceptExSockaddrs`\n\tWSAID_CONNECTEX = guid.GUID{ //revive:disable-line:var-naming ALL_CAPS\n\t\tData1: 0x25a207b9,\n\t\tData2: 0xddf3,\n\t\tData3: 0x4660,\n\t\tData4: [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e},\n\t}\n\n\tconnectExFunc = runtimeFunc{id: WSAID_CONNECTEX}\n)\n\nfunc ConnectEx(\n\tfd windows.Handle,\n\trsa RawSockaddr,\n\tsendBuf *byte,\n\tsendDataLen uint32,\n\tbytesSent *uint32,\n\toverlapped *windows.Overlapped,\n) error {\n\tif err := connectExFunc.Load(); err != nil {\n\t\treturn fmt.Errorf(\"failed to load ConnectEx function pointer: %w\", err)\n\t}\n\tptr, n, err := rsa.Sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped)\n}\n\n// BOOL LpfnConnectex(\n//   [in]           SOCKET s,\n//   [in]           const sockaddr *name,\n//   [in]           int namelen,\n//   [in, optional] PVOID lpSendBuffer,\n//   [in]           DWORD dwSendDataLength,\n//   [out]          LPDWORD lpdwBytesSent,\n//   [in]           LPOVERLAPPED lpOverlapped\n// )\n\nfunc connectEx(\n\ts windows.Handle,\n\tname unsafe.Pointer,\n\tnamelen int32,\n\tsendBuf *byte,\n\tsendDataLen uint32,\n\tbytesSent *uint32,\n\toverlapped *windows.Overlapped,\n) (err error) {\n\tr1, _, e1 := syscall.SyscallN(connectExFunc.addr,\n\t\tuintptr(s),\n\t\tuintptr(name),\n\t\tuintptr(namelen),\n\t\tuintptr(unsafe.Pointer(sendBuf)),\n\t\tuintptr(sendDataLen),\n\t\tuintptr(unsafe.Pointer(bytesSent)),\n\t\tuintptr(unsafe.Pointer(overlapped)),\n\t)\n\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go",
    "content": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT EDIT.\n\npackage socket\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nvar _ unsafe.Pointer\n\n// Do the interface allocations only once for common\n// Errno values.\nconst (\n\terrnoERROR_IO_PENDING = 997\n)\n\nvar (\n\terrERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)\n\terrERROR_EINVAL     error = syscall.EINVAL\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn errERROR_EINVAL\n\tcase errnoERROR_IO_PENDING:\n\t\treturn errERROR_IO_PENDING\n\t}\n\treturn e\n}\n\nvar (\n\tmodws2_32 = windows.NewLazySystemDLL(\"ws2_32.dll\")\n\n\tprocbind        = modws2_32.NewProc(\"bind\")\n\tprocgetpeername = modws2_32.NewProc(\"getpeername\")\n\tprocgetsockname = modws2_32.NewProc(\"getsockname\")\n)\n\nfunc bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen))\n\tif r1 == socketError {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen)))\n\tif r1 == socketError {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen)))\n\tif r1 == socketError {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go",
    "content": "package stringbuffer\n\nimport (\n\t\"sync\"\n\t\"unicode/utf16\"\n)\n\n// TODO: worth exporting and using in mkwinsyscall?\n\n// Uint16BufferSize is the buffer size in the pool, chosen somewhat arbitrarily to accommodate\n// large path strings:\n// MAX_PATH (260) + size of volume GUID prefix (49) + null terminator = 310.\nconst MinWStringCap = 310\n\n// use *[]uint16 since []uint16 creates an extra allocation where the slice header\n// is copied to heap and then referenced via pointer in the interface header that sync.Pool\n// stores.\nvar pathPool = sync.Pool{ // if go1.18+ adds Pool[T], use that to store []uint16 directly\n\tNew: func() interface{} {\n\t\tb := make([]uint16, MinWStringCap)\n\t\treturn &b\n\t},\n}\n\nfunc newBuffer() []uint16 { return *(pathPool.Get().(*[]uint16)) }\n\n// freeBuffer copies the slice header data, and puts a pointer to that in the pool.\n// This avoids taking a pointer to the slice header in WString, which can be set to nil.\nfunc freeBuffer(b []uint16) { pathPool.Put(&b) }\n\n// WString is a wide string buffer ([]uint16) meant for storing UTF-16 encoded strings\n// for interacting with Win32 APIs.\n// Sizes are specified as uint32 and not int.\n//\n// It is not thread safe.\ntype WString struct {\n\t// type-def allows casting to []uint16 directly, use struct to prevent that and allow adding fields in the future.\n\n\t// raw buffer\n\tb []uint16\n}\n\n// NewWString returns a [WString] allocated from a shared pool with an\n// initial capacity of at least [MinWStringCap].\n// Since the buffer may have been previously used, its contents are not guaranteed to be empty.\n//\n// The buffer should be freed via [WString.Free]\nfunc NewWString() *WString {\n\treturn &WString{\n\t\tb: newBuffer(),\n\t}\n}\n\nfunc (b *WString) Free() {\n\tif b.empty() {\n\t\treturn\n\t}\n\tfreeBuffer(b.b)\n\tb.b = nil\n}\n\n// ResizeTo grows the buffer to at least c and returns the new capacity, freeing the\n// previous buffer back into pool.\nfunc (b *WString) ResizeTo(c uint32) uint32 {\n\t// already sufficient (or n is 0)\n\tif c <= b.Cap() {\n\t\treturn b.Cap()\n\t}\n\n\tif c <= MinWStringCap {\n\t\tc = MinWStringCap\n\t}\n\t// allocate at-least double buffer size, as is done in [bytes.Buffer] and other places\n\tif c <= 2*b.Cap() {\n\t\tc = 2 * b.Cap()\n\t}\n\n\tb2 := make([]uint16, c)\n\tif !b.empty() {\n\t\tcopy(b2, b.b)\n\t\tfreeBuffer(b.b)\n\t}\n\tb.b = b2\n\treturn c\n}\n\n// Buffer returns the underlying []uint16 buffer.\nfunc (b *WString) Buffer() []uint16 {\n\tif b.empty() {\n\t\treturn nil\n\t}\n\treturn b.b\n}\n\n// Pointer returns a pointer to the first uint16 in the buffer.\n// If the [WString.Free] has already been called, the pointer will be nil.\nfunc (b *WString) Pointer() *uint16 {\n\tif b.empty() {\n\t\treturn nil\n\t}\n\treturn &b.b[0]\n}\n\n// String returns the returns the UTF-8 encoding of the UTF-16 string in the buffer.\n//\n// It assumes that the data is null-terminated.\nfunc (b *WString) String() string {\n\t// Using [windows.UTF16ToString] would require importing \"golang.org/x/sys/windows\"\n\t// and would make this code Windows-only, which makes no sense.\n\t// So copy UTF16ToString code into here.\n\t// If other windows-specific code is added, switch to [windows.UTF16ToString]\n\n\ts := b.b\n\tfor i, v := range s {\n\t\tif v == 0 {\n\t\t\ts = s[:i]\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(utf16.Decode(s))\n}\n\n// Cap returns the underlying buffer capacity.\nfunc (b *WString) Cap() uint32 {\n\tif b.empty() {\n\t\treturn 0\n\t}\n\treturn b.cap()\n}\n\nfunc (b *WString) cap() uint32 { return uint32(cap(b.b)) }\nfunc (b *WString) empty() bool { return b == nil || b.cap() == 0 }\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pipe.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n\n\t\"github.com/Microsoft/go-winio/internal/fs\"\n)\n\n//sys connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) = ConnectNamedPipe\n//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error)  [failretval==windows.InvalidHandle] = CreateNamedPipeW\n//sys disconnectNamedPipe(pipe windows.Handle) (err error) = DisconnectNamedPipe\n//sys getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo\n//sys getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW\n//sys ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile\n//sys rtlNtStatusToDosError(status ntStatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb\n//sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) = ntdll.RtlDosPathNameToNtPathName_U\n//sys rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) = ntdll.RtlDefaultNpAcl\n\ntype PipeConn interface {\n\tnet.Conn\n\tDisconnect() error\n\tFlush() error\n}\n\n// type aliases for mkwinsyscall code\ntype (\n\tntAccessMask              = fs.AccessMask\n\tntFileShareMode           = fs.FileShareMode\n\tntFileCreationDisposition = fs.NTFileCreationDisposition\n\tntFileOptions             = fs.NTCreateOptions\n)\n\ntype ioStatusBlock struct {\n\tStatus, Information uintptr\n}\n\n//\ttypedef struct _OBJECT_ATTRIBUTES {\n//\t  ULONG           Length;\n//\t  HANDLE          RootDirectory;\n//\t  PUNICODE_STRING ObjectName;\n//\t  ULONG           Attributes;\n//\t  PVOID           SecurityDescriptor;\n//\t  PVOID           SecurityQualityOfService;\n//\t} OBJECT_ATTRIBUTES;\n//\n// https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes\ntype objectAttributes struct {\n\tLength             uintptr\n\tRootDirectory      uintptr\n\tObjectName         *unicodeString\n\tAttributes         uintptr\n\tSecurityDescriptor *securityDescriptor\n\tSecurityQoS        uintptr\n}\n\ntype unicodeString struct {\n\tLength        uint16\n\tMaximumLength uint16\n\tBuffer        uintptr\n}\n\n//\ttypedef struct _SECURITY_DESCRIPTOR {\n//\t  BYTE                        Revision;\n//\t  BYTE                        Sbz1;\n//\t  SECURITY_DESCRIPTOR_CONTROL Control;\n//\t  PSID                        Owner;\n//\t  PSID                        Group;\n//\t  PACL                        Sacl;\n//\t  PACL                        Dacl;\n//\t} SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;\n//\n// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-security_descriptor\ntype securityDescriptor struct {\n\tRevision byte\n\tSbz1     byte\n\tControl  uint16\n\tOwner    uintptr\n\tGroup    uintptr\n\tSacl     uintptr //revive:disable-line:var-naming SACL, not Sacl\n\tDacl     uintptr //revive:disable-line:var-naming DACL, not Dacl\n}\n\ntype ntStatus int32\n\nfunc (status ntStatus) Err() error {\n\tif status >= 0 {\n\t\treturn nil\n\t}\n\treturn rtlNtStatusToDosError(status)\n}\n\nvar (\n\t// ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed.\n\tErrPipeListenerClosed = net.ErrClosed\n\n\terrPipeWriteClosed = errors.New(\"pipe has been closed for write\")\n)\n\ntype win32Pipe struct {\n\t*win32File\n\tpath string\n}\n\nvar _ PipeConn = (*win32Pipe)(nil)\n\ntype win32MessageBytePipe struct {\n\twin32Pipe\n\twriteClosed bool\n\treadEOF     bool\n}\n\ntype pipeAddress string\n\nfunc (f *win32Pipe) LocalAddr() net.Addr {\n\treturn pipeAddress(f.path)\n}\n\nfunc (f *win32Pipe) RemoteAddr() net.Addr {\n\treturn pipeAddress(f.path)\n}\n\nfunc (f *win32Pipe) SetDeadline(t time.Time) error {\n\tif err := f.SetReadDeadline(t); err != nil {\n\t\treturn err\n\t}\n\treturn f.SetWriteDeadline(t)\n}\n\nfunc (f *win32Pipe) Disconnect() error {\n\treturn disconnectNamedPipe(f.win32File.handle)\n}\n\n// CloseWrite closes the write side of a message pipe in byte mode.\nfunc (f *win32MessageBytePipe) CloseWrite() error {\n\tif f.writeClosed {\n\t\treturn errPipeWriteClosed\n\t}\n\terr := f.win32File.Flush()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = f.win32File.Write(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.writeClosed = true\n\treturn nil\n}\n\n// Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since\n// they are used to implement CloseWrite().\nfunc (f *win32MessageBytePipe) Write(b []byte) (int, error) {\n\tif f.writeClosed {\n\t\treturn 0, errPipeWriteClosed\n\t}\n\tif len(b) == 0 {\n\t\treturn 0, nil\n\t}\n\treturn f.win32File.Write(b)\n}\n\n// Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message\n// mode pipe will return io.EOF, as will all subsequent reads.\nfunc (f *win32MessageBytePipe) Read(b []byte) (int, error) {\n\tif f.readEOF {\n\t\treturn 0, io.EOF\n\t}\n\tn, err := f.win32File.Read(b)\n\tif err == io.EOF { //nolint:errorlint\n\t\t// If this was the result of a zero-byte read, then\n\t\t// it is possible that the read was due to a zero-size\n\t\t// message. Since we are simulating CloseWrite with a\n\t\t// zero-byte message, ensure that all future Read() calls\n\t\t// also return EOF.\n\t\tf.readEOF = true\n\t} else if err == windows.ERROR_MORE_DATA { //nolint:errorlint // err is Errno\n\t\t// ERROR_MORE_DATA indicates that the pipe's read mode is message mode\n\t\t// and the message still has more bytes. Treat this as a success, since\n\t\t// this package presents all named pipes as byte streams.\n\t\terr = nil\n\t}\n\treturn n, err\n}\n\nfunc (pipeAddress) Network() string {\n\treturn \"pipe\"\n}\n\nfunc (s pipeAddress) String() string {\n\treturn string(s)\n}\n\n// tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout.\nfunc tryDialPipe(ctx context.Context, path *string, access fs.AccessMask, impLevel PipeImpLevel) (windows.Handle, error) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn windows.Handle(0), ctx.Err()\n\t\tdefault:\n\t\t\th, err := fs.CreateFile(*path,\n\t\t\t\taccess,\n\t\t\t\t0,   // mode\n\t\t\t\tnil, // security attributes\n\t\t\t\tfs.OPEN_EXISTING,\n\t\t\t\tfs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.FileSQSFlag(impLevel),\n\t\t\t\t0, // template file handle\n\t\t\t)\n\t\t\tif err == nil {\n\t\t\t\treturn h, nil\n\t\t\t}\n\t\t\tif err != windows.ERROR_PIPE_BUSY { //nolint:errorlint // err is Errno\n\t\t\t\treturn h, &os.PathError{Err: err, Op: \"open\", Path: *path}\n\t\t\t}\n\t\t\t// Wait 10 msec and try again. This is a rather simplistic\n\t\t\t// view, as we always try each 10 milliseconds.\n\t\t\ttime.Sleep(10 * time.Millisecond)\n\t\t}\n\t}\n}\n\n// DialPipe connects to a named pipe by path, timing out if the connection\n// takes longer than the specified duration. If timeout is nil, then we use\n// a default timeout of 2 seconds.  (We do not use WaitNamedPipe.)\nfunc DialPipe(path string, timeout *time.Duration) (net.Conn, error) {\n\tvar absTimeout time.Time\n\tif timeout != nil {\n\t\tabsTimeout = time.Now().Add(*timeout)\n\t} else {\n\t\tabsTimeout = time.Now().Add(2 * time.Second)\n\t}\n\tctx, cancel := context.WithDeadline(context.Background(), absTimeout)\n\tdefer cancel()\n\tconn, err := DialPipeContext(ctx, path)\n\tif errors.Is(err, context.DeadlineExceeded) {\n\t\treturn nil, ErrTimeout\n\t}\n\treturn conn, err\n}\n\n// DialPipeContext attempts to connect to a named pipe by `path` until `ctx`\n// cancellation or timeout.\nfunc DialPipeContext(ctx context.Context, path string) (net.Conn, error) {\n\treturn DialPipeAccess(ctx, path, uint32(fs.GENERIC_READ|fs.GENERIC_WRITE))\n}\n\n// PipeImpLevel is an enumeration of impersonation levels that may be set\n// when calling DialPipeAccessImpersonation.\ntype PipeImpLevel uint32\n\nconst (\n\tPipeImpLevelAnonymous      = PipeImpLevel(fs.SECURITY_ANONYMOUS)\n\tPipeImpLevelIdentification = PipeImpLevel(fs.SECURITY_IDENTIFICATION)\n\tPipeImpLevelImpersonation  = PipeImpLevel(fs.SECURITY_IMPERSONATION)\n\tPipeImpLevelDelegation     = PipeImpLevel(fs.SECURITY_DELEGATION)\n)\n\n// DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx`\n// cancellation or timeout.\nfunc DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) {\n\treturn DialPipeAccessImpLevel(ctx, path, access, PipeImpLevelAnonymous)\n}\n\n// DialPipeAccessImpLevel attempts to connect to a named pipe by `path` with\n// `access` at `impLevel` until `ctx` cancellation or timeout. The other\n// DialPipe* implementations use PipeImpLevelAnonymous.\nfunc DialPipeAccessImpLevel(ctx context.Context, path string, access uint32, impLevel PipeImpLevel) (net.Conn, error) {\n\tvar err error\n\tvar h windows.Handle\n\th, err = tryDialPipe(ctx, &path, fs.AccessMask(access), impLevel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar flags uint32\n\terr = getNamedPipeInfo(h, &flags, nil, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf, err := makeWin32File(h)\n\tif err != nil {\n\t\twindows.Close(h)\n\t\treturn nil, err\n\t}\n\n\t// If the pipe is in message mode, return a message byte pipe, which\n\t// supports CloseWrite().\n\tif flags&windows.PIPE_TYPE_MESSAGE != 0 {\n\t\treturn &win32MessageBytePipe{\n\t\t\twin32Pipe: win32Pipe{win32File: f, path: path},\n\t\t}, nil\n\t}\n\treturn &win32Pipe{win32File: f, path: path}, nil\n}\n\ntype acceptResponse struct {\n\tf   *win32File\n\terr error\n}\n\ntype win32PipeListener struct {\n\tfirstHandle windows.Handle\n\tpath        string\n\tconfig      PipeConfig\n\tacceptCh    chan (chan acceptResponse)\n\tcloseCh     chan int\n\tdoneCh      chan int\n}\n\nfunc makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (windows.Handle, error) {\n\tpath16, err := windows.UTF16FromString(path)\n\tif err != nil {\n\t\treturn 0, &os.PathError{Op: \"open\", Path: path, Err: err}\n\t}\n\n\tvar oa objectAttributes\n\toa.Length = unsafe.Sizeof(oa)\n\n\tvar ntPath unicodeString\n\tif err := rtlDosPathNameToNtPathName(&path16[0],\n\t\t&ntPath,\n\t\t0,\n\t\t0,\n\t).Err(); err != nil {\n\t\treturn 0, &os.PathError{Op: \"open\", Path: path, Err: err}\n\t}\n\tdefer windows.LocalFree(windows.Handle(ntPath.Buffer)) //nolint:errcheck\n\toa.ObjectName = &ntPath\n\toa.Attributes = windows.OBJ_CASE_INSENSITIVE\n\n\t// The security descriptor is only needed for the first pipe.\n\tif first {\n\t\tif sd != nil {\n\t\t\t//todo: does `sdb` need to be allocated on the heap, or can go allocate it?\n\t\t\tl := uint32(len(sd))\n\t\t\tsdb, err := windows.LocalAlloc(0, l)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, fmt.Errorf(\"LocalAlloc for security descriptor with of length %d: %w\", l, err)\n\t\t\t}\n\t\t\tdefer windows.LocalFree(windows.Handle(sdb)) //nolint:errcheck\n\t\t\tcopy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd)\n\t\t\toa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb))\n\t\t} else {\n\t\t\t// Construct the default named pipe security descriptor.\n\t\t\tvar dacl uintptr\n\t\t\tif err := rtlDefaultNpAcl(&dacl).Err(); err != nil {\n\t\t\t\treturn 0, fmt.Errorf(\"getting default named pipe ACL: %w\", err)\n\t\t\t}\n\t\t\tdefer windows.LocalFree(windows.Handle(dacl)) //nolint:errcheck\n\n\t\t\tsdb := &securityDescriptor{\n\t\t\t\tRevision: 1,\n\t\t\t\tControl:  windows.SE_DACL_PRESENT,\n\t\t\t\tDacl:     dacl,\n\t\t\t}\n\t\t\toa.SecurityDescriptor = sdb\n\t\t}\n\t}\n\n\ttyp := uint32(windows.FILE_PIPE_REJECT_REMOTE_CLIENTS)\n\tif c.MessageMode {\n\t\ttyp |= windows.FILE_PIPE_MESSAGE_TYPE\n\t}\n\n\tdisposition := fs.FILE_OPEN\n\taccess := fs.GENERIC_READ | fs.GENERIC_WRITE | fs.SYNCHRONIZE\n\tif first {\n\t\tdisposition = fs.FILE_CREATE\n\t\t// By not asking for read or write access, the named pipe file system\n\t\t// will put this pipe into an initially disconnected state, blocking\n\t\t// client connections until the next call with first == false.\n\t\taccess = fs.SYNCHRONIZE\n\t}\n\n\ttimeout := int64(-50 * 10000) // 50ms\n\n\tvar (\n\t\th    windows.Handle\n\t\tiosb ioStatusBlock\n\t)\n\terr = ntCreateNamedPipeFile(&h,\n\t\taccess,\n\t\t&oa,\n\t\t&iosb,\n\t\tfs.FILE_SHARE_READ|fs.FILE_SHARE_WRITE,\n\t\tdisposition,\n\t\t0,\n\t\ttyp,\n\t\t0,\n\t\t0,\n\t\t0xffffffff,\n\t\tuint32(c.InputBufferSize),\n\t\tuint32(c.OutputBufferSize),\n\t\t&timeout).Err()\n\tif err != nil {\n\t\treturn 0, &os.PathError{Op: \"open\", Path: path, Err: err}\n\t}\n\n\truntime.KeepAlive(ntPath)\n\treturn h, nil\n}\n\nfunc (l *win32PipeListener) makeServerPipe() (*win32File, error) {\n\th, err := makeServerPipeHandle(l.path, nil, &l.config, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tf, err := makeWin32File(h)\n\tif err != nil {\n\t\twindows.Close(h)\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}\n\nfunc (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) {\n\tp, err := l.makeServerPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait for the client to connect.\n\tch := make(chan error)\n\tgo func(p *win32File) {\n\t\tch <- connectPipe(p)\n\t}(p)\n\n\tselect {\n\tcase err = <-ch:\n\t\tif err != nil {\n\t\t\tp.Close()\n\t\t\tp = nil\n\t\t}\n\tcase <-l.closeCh:\n\t\t// Abort the connect request by closing the handle.\n\t\tp.Close()\n\t\tp = nil\n\t\terr = <-ch\n\t\tif err == nil || err == ErrFileClosed { //nolint:errorlint // err is Errno\n\t\t\terr = ErrPipeListenerClosed\n\t\t}\n\t}\n\treturn p, err\n}\n\nfunc (l *win32PipeListener) listenerRoutine() {\n\tclosed := false\n\tfor !closed {\n\t\tselect {\n\t\tcase <-l.closeCh:\n\t\t\tclosed = true\n\t\tcase responseCh := <-l.acceptCh:\n\t\t\tvar (\n\t\t\t\tp   *win32File\n\t\t\t\terr error\n\t\t\t)\n\t\t\tfor {\n\t\t\t\tp, err = l.makeConnectedServerPipe()\n\t\t\t\t// If the connection was immediately closed by the client, try\n\t\t\t\t// again.\n\t\t\t\tif err != windows.ERROR_NO_DATA { //nolint:errorlint // err is Errno\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tresponseCh <- acceptResponse{p, err}\n\t\t\tclosed = err == ErrPipeListenerClosed //nolint:errorlint // err is Errno\n\t\t}\n\t}\n\twindows.Close(l.firstHandle)\n\tl.firstHandle = 0\n\t// Notify Close() and Accept() callers that the handle has been closed.\n\tclose(l.doneCh)\n}\n\n// PipeConfig contain configuration for the pipe listener.\ntype PipeConfig struct {\n\t// SecurityDescriptor contains a Windows security descriptor in SDDL format.\n\tSecurityDescriptor string\n\n\t// MessageMode determines whether the pipe is in byte or message mode. In either\n\t// case the pipe is read in byte mode by default. The only practical difference in\n\t// this implementation is that CloseWrite() is only supported for message mode pipes;\n\t// CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only\n\t// transferred to the reader (and returned as io.EOF in this implementation)\n\t// when the pipe is in message mode.\n\tMessageMode bool\n\n\t// InputBufferSize specifies the size of the input buffer, in bytes.\n\tInputBufferSize int32\n\n\t// OutputBufferSize specifies the size of the output buffer, in bytes.\n\tOutputBufferSize int32\n}\n\n// ListenPipe creates a listener on a Windows named pipe path, e.g. \\\\.\\pipe\\mypipe.\n// The pipe must not already exist.\nfunc ListenPipe(path string, c *PipeConfig) (net.Listener, error) {\n\tvar (\n\t\tsd  []byte\n\t\terr error\n\t)\n\tif c == nil {\n\t\tc = &PipeConfig{}\n\t}\n\tif c.SecurityDescriptor != \"\" {\n\t\tsd, err = SddlToSecurityDescriptor(c.SecurityDescriptor)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\th, err := makeServerPipeHandle(path, sd, c, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tl := &win32PipeListener{\n\t\tfirstHandle: h,\n\t\tpath:        path,\n\t\tconfig:      *c,\n\t\tacceptCh:    make(chan (chan acceptResponse)),\n\t\tcloseCh:     make(chan int),\n\t\tdoneCh:      make(chan int),\n\t}\n\tgo l.listenerRoutine()\n\treturn l, nil\n}\n\nfunc connectPipe(p *win32File) error {\n\tc, err := p.prepareIO()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer p.wg.Done()\n\n\terr = connectNamedPipe(p.handle, &c.o)\n\t_, err = p.asyncIO(c, nil, 0, err)\n\tif err != nil && err != windows.ERROR_PIPE_CONNECTED { //nolint:errorlint // err is Errno\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (l *win32PipeListener) Accept() (net.Conn, error) {\n\tch := make(chan acceptResponse)\n\tselect {\n\tcase l.acceptCh <- ch:\n\t\tresponse := <-ch\n\t\terr := response.err\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif l.config.MessageMode {\n\t\t\treturn &win32MessageBytePipe{\n\t\t\t\twin32Pipe: win32Pipe{win32File: response.f, path: l.path},\n\t\t\t}, nil\n\t\t}\n\t\treturn &win32Pipe{win32File: response.f, path: l.path}, nil\n\tcase <-l.doneCh:\n\t\treturn nil, ErrPipeListenerClosed\n\t}\n}\n\nfunc (l *win32PipeListener) Close() error {\n\tselect {\n\tcase l.closeCh <- 1:\n\t\t<-l.doneCh\n\tcase <-l.doneCh:\n\t}\n\treturn nil\n}\n\nfunc (l *win32PipeListener) Addr() net.Addr {\n\treturn pipeAddress(l.path)\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go",
    "content": "// Package guid provides a GUID type. The backing structure for a GUID is\n// identical to that used by the golang.org/x/sys/windows GUID type.\n// There are two main binary encodings used for a GUID, the big-endian encoding,\n// and the Windows (mixed-endian) encoding. See here for details:\n// https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding\npackage guid\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/sha1\" //nolint:gosec // not used for secure application\n\t\"encoding\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//go:generate go run golang.org/x/tools/cmd/stringer -type=Variant -trimprefix=Variant -linecomment\n\n// Variant specifies which GUID variant (or \"type\") of the GUID. It determines\n// how the entirety of the rest of the GUID is interpreted.\ntype Variant uint8\n\n// The variants specified by RFC 4122 section 4.1.1.\nconst (\n\t// VariantUnknown specifies a GUID variant which does not conform to one of\n\t// the variant encodings specified in RFC 4122.\n\tVariantUnknown Variant = iota\n\tVariantNCS\n\tVariantRFC4122 // RFC 4122\n\tVariantMicrosoft\n\tVariantFuture\n)\n\n// Version specifies how the bits in the GUID were generated. For instance, a\n// version 4 GUID is randomly generated, and a version 5 is generated from the\n// hash of an input string.\ntype Version uint8\n\nfunc (v Version) String() string {\n\treturn strconv.FormatUint(uint64(v), 10)\n}\n\nvar _ = (encoding.TextMarshaler)(GUID{})\nvar _ = (encoding.TextUnmarshaler)(&GUID{})\n\n// NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122.\nfunc NewV4() (GUID, error) {\n\tvar b [16]byte\n\tif _, err := rand.Read(b[:]); err != nil {\n\t\treturn GUID{}, err\n\t}\n\n\tg := FromArray(b)\n\tg.setVersion(4) // Version 4 means randomly generated.\n\tg.setVariant(VariantRFC4122)\n\n\treturn g, nil\n}\n\n// NewV5 returns a new version 5 (generated from a string via SHA-1 hashing)\n// GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name,\n// and the sample code treats it as a series of bytes, so we do the same here.\n//\n// Some implementations, such as those found on Windows, treat the name as a\n// big-endian UTF16 stream of bytes. If that is desired, the string can be\n// encoded as such before being passed to this function.\nfunc NewV5(namespace GUID, name []byte) (GUID, error) {\n\tb := sha1.New() //nolint:gosec // not used for secure application\n\tnamespaceBytes := namespace.ToArray()\n\tb.Write(namespaceBytes[:])\n\tb.Write(name)\n\n\ta := [16]byte{}\n\tcopy(a[:], b.Sum(nil))\n\n\tg := FromArray(a)\n\tg.setVersion(5) // Version 5 means generated from a string.\n\tg.setVariant(VariantRFC4122)\n\n\treturn g, nil\n}\n\nfunc fromArray(b [16]byte, order binary.ByteOrder) GUID {\n\tvar g GUID\n\tg.Data1 = order.Uint32(b[0:4])\n\tg.Data2 = order.Uint16(b[4:6])\n\tg.Data3 = order.Uint16(b[6:8])\n\tcopy(g.Data4[:], b[8:16])\n\treturn g\n}\n\nfunc (g GUID) toArray(order binary.ByteOrder) [16]byte {\n\tb := [16]byte{}\n\torder.PutUint32(b[0:4], g.Data1)\n\torder.PutUint16(b[4:6], g.Data2)\n\torder.PutUint16(b[6:8], g.Data3)\n\tcopy(b[8:16], g.Data4[:])\n\treturn b\n}\n\n// FromArray constructs a GUID from a big-endian encoding array of 16 bytes.\nfunc FromArray(b [16]byte) GUID {\n\treturn fromArray(b, binary.BigEndian)\n}\n\n// ToArray returns an array of 16 bytes representing the GUID in big-endian\n// encoding.\nfunc (g GUID) ToArray() [16]byte {\n\treturn g.toArray(binary.BigEndian)\n}\n\n// FromWindowsArray constructs a GUID from a Windows encoding array of bytes.\nfunc FromWindowsArray(b [16]byte) GUID {\n\treturn fromArray(b, binary.LittleEndian)\n}\n\n// ToWindowsArray returns an array of 16 bytes representing the GUID in Windows\n// encoding.\nfunc (g GUID) ToWindowsArray() [16]byte {\n\treturn g.toArray(binary.LittleEndian)\n}\n\nfunc (g GUID) String() string {\n\treturn fmt.Sprintf(\n\t\t\"%08x-%04x-%04x-%04x-%012x\",\n\t\tg.Data1,\n\t\tg.Data2,\n\t\tg.Data3,\n\t\tg.Data4[:2],\n\t\tg.Data4[2:])\n}\n\n// FromString parses a string containing a GUID and returns the GUID. The only\n// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`\n// format.\nfunc FromString(s string) (GUID, error) {\n\tif len(s) != 36 {\n\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t}\n\tif s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {\n\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t}\n\n\tvar g GUID\n\n\tdata1, err := strconv.ParseUint(s[0:8], 16, 32)\n\tif err != nil {\n\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t}\n\tg.Data1 = uint32(data1)\n\n\tdata2, err := strconv.ParseUint(s[9:13], 16, 16)\n\tif err != nil {\n\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t}\n\tg.Data2 = uint16(data2)\n\n\tdata3, err := strconv.ParseUint(s[14:18], 16, 16)\n\tif err != nil {\n\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t}\n\tg.Data3 = uint16(data3)\n\n\tfor i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} {\n\t\tv, err := strconv.ParseUint(s[x:x+2], 16, 8)\n\t\tif err != nil {\n\t\t\treturn GUID{}, fmt.Errorf(\"invalid GUID %q\", s)\n\t\t}\n\t\tg.Data4[i] = uint8(v)\n\t}\n\n\treturn g, nil\n}\n\nfunc (g *GUID) setVariant(v Variant) {\n\td := g.Data4[0]\n\tswitch v {\n\tcase VariantNCS:\n\t\td = (d & 0x7f)\n\tcase VariantRFC4122:\n\t\td = (d & 0x3f) | 0x80\n\tcase VariantMicrosoft:\n\t\td = (d & 0x1f) | 0xc0\n\tcase VariantFuture:\n\t\td = (d & 0x0f) | 0xe0\n\tcase VariantUnknown:\n\t\tfallthrough\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"invalid variant: %d\", v))\n\t}\n\tg.Data4[0] = d\n}\n\n// Variant returns the GUID variant, as defined in RFC 4122.\nfunc (g GUID) Variant() Variant {\n\tb := g.Data4[0]\n\tif b&0x80 == 0 {\n\t\treturn VariantNCS\n\t} else if b&0xc0 == 0x80 {\n\t\treturn VariantRFC4122\n\t} else if b&0xe0 == 0xc0 {\n\t\treturn VariantMicrosoft\n\t} else if b&0xe0 == 0xe0 {\n\t\treturn VariantFuture\n\t}\n\treturn VariantUnknown\n}\n\nfunc (g *GUID) setVersion(v Version) {\n\tg.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12)\n}\n\n// Version returns the GUID version, as defined in RFC 4122.\nfunc (g GUID) Version() Version {\n\treturn Version((g.Data3 & 0xF000) >> 12)\n}\n\n// MarshalText returns the textual representation of the GUID.\nfunc (g GUID) MarshalText() ([]byte, error) {\n\treturn []byte(g.String()), nil\n}\n\n// UnmarshalText takes the textual representation of a GUID, and unmarhals it\n// into this GUID.\nfunc (g *GUID) UnmarshalText(text []byte) error {\n\tg2, err := FromString(string(text))\n\tif err != nil {\n\t\treturn err\n\t}\n\t*g = g2\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage guid\n\n// GUID represents a GUID/UUID. It has the same structure as\n// golang.org/x/sys/windows.GUID so that it can be used with functions expecting\n// that type. It is defined as its own type as that is only available to builds\n// targeted at `windows`. The representation matches that used by native Windows\n// code.\ntype GUID struct {\n\tData1 uint32\n\tData2 uint16\n\tData3 uint16\n\tData4 [8]byte\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage guid\n\nimport \"golang.org/x/sys/windows\"\n\n// GUID represents a GUID/UUID. It has the same structure as\n// golang.org/x/sys/windows.GUID so that it can be used with functions expecting\n// that type. It is defined as its own type so that stringification and\n// marshaling can be supported. The representation matches that used by native\n// Windows code.\ntype GUID windows.GUID\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go",
    "content": "// Code generated by \"stringer -type=Variant -trimprefix=Variant -linecomment\"; DO NOT EDIT.\n\npackage guid\n\nimport \"strconv\"\n\nfunc _() {\n\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n\t// Re-run the stringer command to generate them again.\n\tvar x [1]struct{}\n\t_ = x[VariantUnknown-0]\n\t_ = x[VariantNCS-1]\n\t_ = x[VariantRFC4122-2]\n\t_ = x[VariantMicrosoft-3]\n\t_ = x[VariantFuture-4]\n}\n\nconst _Variant_name = \"UnknownNCSRFC 4122MicrosoftFuture\"\n\nvar _Variant_index = [...]uint8{0, 7, 10, 18, 27, 33}\n\nfunc (i Variant) String() string {\n\tif i >= Variant(len(_Variant_index)-1) {\n\t\treturn \"Variant(\" + strconv.FormatInt(int64(i), 10) + \")\"\n\t}\n\treturn _Variant_name[_Variant_index[i]:_Variant_index[i+1]]\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/privilege.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"sync\"\n\t\"unicode/utf16\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n//sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges\n//sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf\n//sys revertToSelf() (err error) = advapi32.RevertToSelf\n//sys openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken\n//sys getCurrentThread() (h windows.Handle) = GetCurrentThread\n//sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW\n//sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW\n//sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW\n\nconst (\n\t//revive:disable-next-line:var-naming ALL_CAPS\n\tSE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED\n\n\t//revive:disable-next-line:var-naming ALL_CAPS\n\tERROR_NOT_ALL_ASSIGNED windows.Errno = windows.ERROR_NOT_ALL_ASSIGNED\n\n\tSeBackupPrivilege   = \"SeBackupPrivilege\"\n\tSeRestorePrivilege  = \"SeRestorePrivilege\"\n\tSeSecurityPrivilege = \"SeSecurityPrivilege\"\n)\n\nvar (\n\tprivNames     = make(map[string]uint64)\n\tprivNameMutex sync.Mutex\n)\n\n// PrivilegeError represents an error enabling privileges.\ntype PrivilegeError struct {\n\tprivileges []uint64\n}\n\nfunc (e *PrivilegeError) Error() string {\n\ts := \"Could not enable privilege \"\n\tif len(e.privileges) > 1 {\n\t\ts = \"Could not enable privileges \"\n\t}\n\tfor i, p := range e.privileges {\n\t\tif i != 0 {\n\t\t\ts += \", \"\n\t\t}\n\t\ts += `\"`\n\t\ts += getPrivilegeName(p)\n\t\ts += `\"`\n\t}\n\treturn s\n}\n\n// RunWithPrivilege enables a single privilege for a function call.\nfunc RunWithPrivilege(name string, fn func() error) error {\n\treturn RunWithPrivileges([]string{name}, fn)\n}\n\n// RunWithPrivileges enables privileges for a function call.\nfunc RunWithPrivileges(names []string, fn func() error) error {\n\tprivileges, err := mapPrivileges(names)\n\tif err != nil {\n\t\treturn err\n\t}\n\truntime.LockOSThread()\n\tdefer runtime.UnlockOSThread()\n\ttoken, err := newThreadToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer releaseThreadToken(token)\n\terr = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn fn()\n}\n\nfunc mapPrivileges(names []string) ([]uint64, error) {\n\tprivileges := make([]uint64, 0, len(names))\n\tprivNameMutex.Lock()\n\tdefer privNameMutex.Unlock()\n\tfor _, name := range names {\n\t\tp, ok := privNames[name]\n\t\tif !ok {\n\t\t\terr := lookupPrivilegeValue(\"\", name, &p)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprivNames[name] = p\n\t\t}\n\t\tprivileges = append(privileges, p)\n\t}\n\treturn privileges, nil\n}\n\n// EnableProcessPrivileges enables privileges globally for the process.\nfunc EnableProcessPrivileges(names []string) error {\n\treturn enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED)\n}\n\n// DisableProcessPrivileges disables privileges globally for the process.\nfunc DisableProcessPrivileges(names []string) error {\n\treturn enableDisableProcessPrivilege(names, 0)\n}\n\nfunc enableDisableProcessPrivilege(names []string, action uint32) error {\n\tprivileges, err := mapPrivileges(names)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp := windows.CurrentProcess()\n\tvar token windows.Token\n\terr = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer token.Close()\n\treturn adjustPrivileges(token, privileges, action)\n}\n\nfunc adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error {\n\tvar b bytes.Buffer\n\t_ = binary.Write(&b, binary.LittleEndian, uint32(len(privileges)))\n\tfor _, p := range privileges {\n\t\t_ = binary.Write(&b, binary.LittleEndian, p)\n\t\t_ = binary.Write(&b, binary.LittleEndian, action)\n\t}\n\tprevState := make([]byte, b.Len())\n\treqSize := uint32(0)\n\tsuccess, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize)\n\tif !success {\n\t\treturn err\n\t}\n\tif err == ERROR_NOT_ALL_ASSIGNED { //nolint:errorlint // err is Errno\n\t\treturn &PrivilegeError{privileges}\n\t}\n\treturn nil\n}\n\nfunc getPrivilegeName(luid uint64) string {\n\tvar nameBuffer [256]uint16\n\tbufSize := uint32(len(nameBuffer))\n\terr := lookupPrivilegeName(\"\", &luid, &nameBuffer[0], &bufSize)\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"<unknown privilege %d>\", luid)\n\t}\n\n\tvar displayNameBuffer [256]uint16\n\tdisplayBufSize := uint32(len(displayNameBuffer))\n\tvar langID uint32\n\terr = lookupPrivilegeDisplayName(\"\", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID)\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"<unknown privilege %s>\", string(utf16.Decode(nameBuffer[:bufSize])))\n\t}\n\n\treturn string(utf16.Decode(displayNameBuffer[:displayBufSize]))\n}\n\nfunc newThreadToken() (windows.Token, error) {\n\terr := impersonateSelf(windows.SecurityImpersonation)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tvar token windows.Token\n\terr = openThreadToken(getCurrentThread(), windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, false, &token)\n\tif err != nil {\n\t\trerr := revertToSelf()\n\t\tif rerr != nil {\n\t\t\tpanic(rerr)\n\t\t}\n\t\treturn 0, err\n\t}\n\treturn token, nil\n}\n\nfunc releaseThreadToken(h windows.Token) {\n\terr := revertToSelf()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\th.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/reparse.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\nconst (\n\treparseTagMountPoint = 0xA0000003\n\treparseTagSymlink    = 0xA000000C\n)\n\ntype reparseDataBuffer struct {\n\tReparseTag           uint32\n\tReparseDataLength    uint16\n\tReserved             uint16\n\tSubstituteNameOffset uint16\n\tSubstituteNameLength uint16\n\tPrintNameOffset      uint16\n\tPrintNameLength      uint16\n}\n\n// ReparsePoint describes a Win32 symlink or mount point.\ntype ReparsePoint struct {\n\tTarget       string\n\tIsMountPoint bool\n}\n\n// UnsupportedReparsePointError is returned when trying to decode a non-symlink or\n// mount point reparse point.\ntype UnsupportedReparsePointError struct {\n\tTag uint32\n}\n\nfunc (e *UnsupportedReparsePointError) Error() string {\n\treturn fmt.Sprintf(\"unsupported reparse point %x\", e.Tag)\n}\n\n// DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink\n// or a mount point.\nfunc DecodeReparsePoint(b []byte) (*ReparsePoint, error) {\n\ttag := binary.LittleEndian.Uint32(b[0:4])\n\treturn DecodeReparsePointData(tag, b[8:])\n}\n\nfunc DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) {\n\tisMountPoint := false\n\tswitch tag {\n\tcase reparseTagMountPoint:\n\t\tisMountPoint = true\n\tcase reparseTagSymlink:\n\tdefault:\n\t\treturn nil, &UnsupportedReparsePointError{tag}\n\t}\n\tnameOffset := 8 + binary.LittleEndian.Uint16(b[4:6])\n\tif !isMountPoint {\n\t\tnameOffset += 4\n\t}\n\tnameLength := binary.LittleEndian.Uint16(b[6:8])\n\tname := make([]uint16, nameLength/2)\n\terr := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil\n}\n\nfunc isDriveLetter(c byte) bool {\n\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')\n}\n\n// EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or\n// mount point.\nfunc EncodeReparsePoint(rp *ReparsePoint) []byte {\n\t// Generate an NT path and determine if this is a relative path.\n\tvar ntTarget string\n\trelative := false\n\tif strings.HasPrefix(rp.Target, `\\\\?\\`) {\n\t\tntTarget = `\\??\\` + rp.Target[4:]\n\t} else if strings.HasPrefix(rp.Target, `\\\\`) {\n\t\tntTarget = `\\??\\UNC\\` + rp.Target[2:]\n\t} else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' {\n\t\tntTarget = `\\??\\` + rp.Target\n\t} else {\n\t\tntTarget = rp.Target\n\t\trelative = true\n\t}\n\n\t// The paths must be NUL-terminated even though they are counted strings.\n\ttarget16 := utf16.Encode([]rune(rp.Target + \"\\x00\"))\n\tntTarget16 := utf16.Encode([]rune(ntTarget + \"\\x00\"))\n\n\tsize := int(unsafe.Sizeof(reparseDataBuffer{})) - 8\n\tsize += len(ntTarget16)*2 + len(target16)*2\n\n\ttag := uint32(reparseTagMountPoint)\n\tif !rp.IsMountPoint {\n\t\ttag = reparseTagSymlink\n\t\tsize += 4 // Add room for symlink flags\n\t}\n\n\tdata := reparseDataBuffer{\n\t\tReparseTag:           tag,\n\t\tReparseDataLength:    uint16(size),\n\t\tSubstituteNameOffset: 0,\n\t\tSubstituteNameLength: uint16((len(ntTarget16) - 1) * 2),\n\t\tPrintNameOffset:      uint16(len(ntTarget16) * 2),\n\t\tPrintNameLength:      uint16((len(target16) - 1) * 2),\n\t}\n\n\tvar b bytes.Buffer\n\t_ = binary.Write(&b, binary.LittleEndian, &data)\n\tif !rp.IsMountPoint {\n\t\tflags := uint32(0)\n\t\tif relative {\n\t\t\tflags |= 1\n\t\t}\n\t\t_ = binary.Write(&b, binary.LittleEndian, flags)\n\t}\n\n\t_ = binary.Write(&b, binary.LittleEndian, ntTarget16)\n\t_ = binary.Write(&b, binary.LittleEndian, target16)\n\treturn b.Bytes()\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/sd.go",
    "content": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW\n//sys lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountSidW\n//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW\n//sys convertStringSidToSid(str *uint16, sid **byte) (err error) = advapi32.ConvertStringSidToSidW\n\ntype AccountLookupError struct {\n\tName string\n\tErr  error\n}\n\nfunc (e *AccountLookupError) Error() string {\n\tif e.Name == \"\" {\n\t\treturn \"lookup account: empty account name specified\"\n\t}\n\tvar s string\n\tswitch {\n\tcase errors.Is(e.Err, windows.ERROR_INVALID_SID):\n\t\ts = \"the security ID structure is invalid\"\n\tcase errors.Is(e.Err, windows.ERROR_NONE_MAPPED):\n\t\ts = \"not found\"\n\tdefault:\n\t\ts = e.Err.Error()\n\t}\n\treturn \"lookup account \" + e.Name + \": \" + s\n}\n\nfunc (e *AccountLookupError) Unwrap() error { return e.Err }\n\ntype SddlConversionError struct {\n\tSddl string\n\tErr  error\n}\n\nfunc (e *SddlConversionError) Error() string {\n\treturn \"convert \" + e.Sddl + \": \" + e.Err.Error()\n}\n\nfunc (e *SddlConversionError) Unwrap() error { return e.Err }\n\n// LookupSidByName looks up the SID of an account by name\n//\n//revive:disable-next-line:var-naming SID, not Sid\nfunc LookupSidByName(name string) (sid string, err error) {\n\tif name == \"\" {\n\t\treturn \"\", &AccountLookupError{name, windows.ERROR_NONE_MAPPED}\n\t}\n\n\tvar sidSize, sidNameUse, refDomainSize uint32\n\terr = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse)\n\tif err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno\n\t\treturn \"\", &AccountLookupError{name, err}\n\t}\n\tsidBuffer := make([]byte, sidSize)\n\trefDomainBuffer := make([]uint16, refDomainSize)\n\terr = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse)\n\tif err != nil {\n\t\treturn \"\", &AccountLookupError{name, err}\n\t}\n\tvar strBuffer *uint16\n\terr = convertSidToStringSid(&sidBuffer[0], &strBuffer)\n\tif err != nil {\n\t\treturn \"\", &AccountLookupError{name, err}\n\t}\n\tsid = windows.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:])\n\t_, _ = windows.LocalFree(windows.Handle(unsafe.Pointer(strBuffer)))\n\treturn sid, nil\n}\n\n// LookupNameBySid looks up the name of an account by SID\n//\n//revive:disable-next-line:var-naming SID, not Sid\nfunc LookupNameBySid(sid string) (name string, err error) {\n\tif sid == \"\" {\n\t\treturn \"\", &AccountLookupError{sid, windows.ERROR_NONE_MAPPED}\n\t}\n\n\tsidBuffer, err := windows.UTF16PtrFromString(sid)\n\tif err != nil {\n\t\treturn \"\", &AccountLookupError{sid, err}\n\t}\n\n\tvar sidPtr *byte\n\tif err = convertStringSidToSid(sidBuffer, &sidPtr); err != nil {\n\t\treturn \"\", &AccountLookupError{sid, err}\n\t}\n\tdefer windows.LocalFree(windows.Handle(unsafe.Pointer(sidPtr))) //nolint:errcheck\n\n\tvar nameSize, refDomainSize, sidNameUse uint32\n\terr = lookupAccountSid(nil, sidPtr, nil, &nameSize, nil, &refDomainSize, &sidNameUse)\n\tif err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno\n\t\treturn \"\", &AccountLookupError{sid, err}\n\t}\n\n\tnameBuffer := make([]uint16, nameSize)\n\trefDomainBuffer := make([]uint16, refDomainSize)\n\terr = lookupAccountSid(nil, sidPtr, &nameBuffer[0], &nameSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse)\n\tif err != nil {\n\t\treturn \"\", &AccountLookupError{sid, err}\n\t}\n\n\tname = windows.UTF16ToString(nameBuffer)\n\treturn name, nil\n}\n\nfunc SddlToSecurityDescriptor(sddl string) ([]byte, error) {\n\tsd, err := windows.SecurityDescriptorFromString(sddl)\n\tif err != nil {\n\t\treturn nil, &SddlConversionError{Sddl: sddl, Err: err}\n\t}\n\tb := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length())\n\treturn b, nil\n}\n\nfunc SecurityDescriptorToSddl(sd []byte) (string, error) {\n\tif l := int(unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{})); len(sd) < l {\n\t\treturn \"\", fmt.Errorf(\"SecurityDescriptor (%d) smaller than expected (%d): %w\", len(sd), l, windows.ERROR_INCORRECT_SIZE)\n\t}\n\ts := (*windows.SECURITY_DESCRIPTOR)(unsafe.Pointer(&sd[0]))\n\treturn s.String(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/syscall.go",
    "content": "//go:build windows\n\npackage winio\n\n//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go ./*.go\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/zsyscall_windows.go",
    "content": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT EDIT.\n\npackage winio\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nvar _ unsafe.Pointer\n\n// Do the interface allocations only once for common\n// Errno values.\nconst (\n\terrnoERROR_IO_PENDING = 997\n)\n\nvar (\n\terrERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)\n\terrERROR_EINVAL     error = syscall.EINVAL\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn errERROR_EINVAL\n\tcase errnoERROR_IO_PENDING:\n\t\treturn errERROR_IO_PENDING\n\t}\n\treturn e\n}\n\nvar (\n\tmodadvapi32 = windows.NewLazySystemDLL(\"advapi32.dll\")\n\tmodkernel32 = windows.NewLazySystemDLL(\"kernel32.dll\")\n\tmodntdll    = windows.NewLazySystemDLL(\"ntdll.dll\")\n\tmodws2_32   = windows.NewLazySystemDLL(\"ws2_32.dll\")\n\n\tprocAdjustTokenPrivileges              = modadvapi32.NewProc(\"AdjustTokenPrivileges\")\n\tprocConvertSidToStringSidW             = modadvapi32.NewProc(\"ConvertSidToStringSidW\")\n\tprocConvertStringSidToSidW             = modadvapi32.NewProc(\"ConvertStringSidToSidW\")\n\tprocImpersonateSelf                    = modadvapi32.NewProc(\"ImpersonateSelf\")\n\tprocLookupAccountNameW                 = modadvapi32.NewProc(\"LookupAccountNameW\")\n\tprocLookupAccountSidW                  = modadvapi32.NewProc(\"LookupAccountSidW\")\n\tprocLookupPrivilegeDisplayNameW        = modadvapi32.NewProc(\"LookupPrivilegeDisplayNameW\")\n\tprocLookupPrivilegeNameW               = modadvapi32.NewProc(\"LookupPrivilegeNameW\")\n\tprocLookupPrivilegeValueW              = modadvapi32.NewProc(\"LookupPrivilegeValueW\")\n\tprocOpenThreadToken                    = modadvapi32.NewProc(\"OpenThreadToken\")\n\tprocRevertToSelf                       = modadvapi32.NewProc(\"RevertToSelf\")\n\tprocBackupRead                         = modkernel32.NewProc(\"BackupRead\")\n\tprocBackupWrite                        = modkernel32.NewProc(\"BackupWrite\")\n\tprocCancelIoEx                         = modkernel32.NewProc(\"CancelIoEx\")\n\tprocConnectNamedPipe                   = modkernel32.NewProc(\"ConnectNamedPipe\")\n\tprocCreateIoCompletionPort             = modkernel32.NewProc(\"CreateIoCompletionPort\")\n\tprocCreateNamedPipeW                   = modkernel32.NewProc(\"CreateNamedPipeW\")\n\tprocDisconnectNamedPipe                = modkernel32.NewProc(\"DisconnectNamedPipe\")\n\tprocGetCurrentThread                   = modkernel32.NewProc(\"GetCurrentThread\")\n\tprocGetNamedPipeHandleStateW           = modkernel32.NewProc(\"GetNamedPipeHandleStateW\")\n\tprocGetNamedPipeInfo                   = modkernel32.NewProc(\"GetNamedPipeInfo\")\n\tprocGetQueuedCompletionStatus          = modkernel32.NewProc(\"GetQueuedCompletionStatus\")\n\tprocSetFileCompletionNotificationModes = modkernel32.NewProc(\"SetFileCompletionNotificationModes\")\n\tprocNtCreateNamedPipeFile              = modntdll.NewProc(\"NtCreateNamedPipeFile\")\n\tprocRtlDefaultNpAcl                    = modntdll.NewProc(\"RtlDefaultNpAcl\")\n\tprocRtlDosPathNameToNtPathName_U       = modntdll.NewProc(\"RtlDosPathNameToNtPathName_U\")\n\tprocRtlNtStatusToDosErrorNoTeb         = modntdll.NewProc(\"RtlNtStatusToDosErrorNoTeb\")\n\tprocWSAGetOverlappedResult             = modws2_32.NewProc(\"WSAGetOverlappedResult\")\n)\n\nfunc adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) {\n\tvar _p0 uint32\n\tif releaseAll {\n\t\t_p0 = 1\n\t}\n\tr0, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize)))\n\tsuccess = r0 != 0\n\tif true {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc convertSidToStringSid(sid *byte, str **uint16) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc convertStringSidToSid(str *uint16, sid **byte) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc impersonateSelf(level uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(level))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(accountName)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse)\n}\n\nfunc _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(systemName)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId)\n}\n\nfunc _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procLookupPrivilegeDisplayNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(systemName)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _lookupPrivilegeName(_p0, luid, buffer, size)\n}\n\nfunc _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procLookupPrivilegeNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(systemName)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *uint16\n\t_p1, err = syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _lookupPrivilegeValue(_p0, _p1, luid)\n}\n\nfunc _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) {\n\tvar _p0 uint32\n\tif openAsSelf {\n\t\t_p0 = 1\n\t}\n\tr1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc revertToSelf() (err error) {\n\tr1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr())\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 uint32\n\tif abort {\n\t\t_p1 = 1\n\t}\n\tvar _p2 uint32\n\tif processSecurity {\n\t\t_p2 = 1\n\t}\n\tr1, _, e1 := syscall.SyscallN(procBackupRead.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 uint32\n\tif abort {\n\t\t_p1 = 1\n\t}\n\tvar _p2 uint32\n\tif processSecurity {\n\t\t_p2 = 1\n\t}\n\tr1, _, e1 := syscall.SyscallN(procBackupWrite.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(file), uintptr(unsafe.Pointer(o)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(o)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) {\n\tr0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount))\n\tnewport = windows.Handle(r0)\n\tif newport == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa)\n}\n\nfunc _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) {\n\tr0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)))\n\thandle = windows.Handle(r0)\n\tif handle == windows.InvalidHandle {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc disconnectNamedPipe(pipe windows.Handle) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc getCurrentThread() (h windows.Handle) {\n\tr0, _, _ := syscall.SyscallN(procGetCurrentThread.Addr())\n\th = windows.Handle(r0)\n\treturn\n}\n\nfunc getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) {\n\tr1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(h), uintptr(flags))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\nfunc ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) {\n\tr0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)))\n\tstatus = ntStatus(r0)\n\treturn\n}\n\nfunc rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) {\n\tr0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(dacl)))\n\tstatus = ntStatus(r0)\n\treturn\n}\n\nfunc rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) {\n\tr0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved))\n\tstatus = ntStatus(r0)\n\treturn\n}\n\nfunc rtlNtStatusToDosError(status ntStatus) (winerr error) {\n\tr0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(status))\n\tif r0 != 0 {\n\t\twinerr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) {\n\tvar _p0 uint32\n\tif wait {\n\t\t_p0 = 1\n\t}\n\tr1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)))\n\tif r1 == 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/.gitignore",
    "content": "*.swp\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/.travis.yml",
    "content": "language: go\ngo:\n  - 1.x\n  - tip\nenv:\n  - GO111MODULE=on\ninstall:\n  - go mod download\nscript:\n  - go test -race -v\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md",
    "content": "---\nlayout: code-of-conduct\nversion: v1.0\n---\n\nThis code of conduct outlines our expectations for participants within the **NYTimes/gziphandler** community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.\n\nOur open source community strives to:\n\n* **Be friendly and patient.**\n* **Be welcoming**: We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.\n* **Be considerate**: Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.\n* **Be respectful**:  Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one.\n* **Be careful in the words that we choose**: we are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable.\n* **Try to understand why we disagree**: Disagreements, both social and technical, happen all the time. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of our community comes from its diversity, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.\n\n## Definitions\n\nHarassment includes, but is not limited to:\n\n- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, age, regional discrimination, political or religious affiliation\n- Unwelcome comments regarding a person’s lifestyle choices and practices, including those related to food, health, parenting, drugs, and employment\n- Deliberate misgendering. This includes deadnaming or persistently using a pronoun that does not correctly reflect a person's gender identity. You must address people by the name they give you when not addressing them by their username or handle\n- Physical contact and simulated physical contact (eg, textual descriptions like “*hug*” or “*backrub*”) without consent or after a request to stop\n- Threats of violence, both physical and psychological\n- Incitement of violence towards any individual, including encouraging a person to commit suicide or to engage in self-harm\n- Deliberate intimidation\n- Stalking or following\n- Harassing photography or recording, including logging online activity for harassment purposes\n- Sustained disruption of discussion\n- Unwelcome sexual attention, including gratuitous or off-topic sexual images or behaviour\n- Pattern of inappropriate social contact, such as requesting/assuming inappropriate levels of intimacy with others\n- Continued one-on-one communication after requests to cease\n- Deliberate “outing” of any aspect of a person’s identity without their consent except as necessary to protect others from intentional abuse\n- Publication of non-harassing private communication\n\nOur open source community prioritizes marginalized people’s safety over privileged people’s comfort. We will not act on complaints regarding:\n\n- ‘Reverse’ -isms, including ‘reverse racism,’ ‘reverse sexism,’ and ‘cisphobia’\n- Reasonable communication of boundaries, such as “leave me alone,” “go away,” or “I’m not discussing this with you”\n- Refusal to explain or debate social justice concepts\n- Communicating in a ‘tone’ you don’t find congenial\n- Criticizing racist, sexist, cissexist, or otherwise oppressive behavior or assumptions\n\n\n### Diversity Statement\n\nWe encourage everyone to participate and are committed to building a community for all. Although we will fail at times, we seek to treat everyone both as fairly and equally as possible. Whenever a participant has made a mistake, we expect them to take responsibility for it. If someone has been harmed or offended, it is our responsibility to listen carefully and respectfully, and do our best to right the wrong.\n\nAlthough this list cannot be exhaustive, we explicitly honor diversity in age, gender, gender identity or expression, culture, ethnicity, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected\ncharacteristics above, including participants with disabilities.\n\n### Reporting Issues\n\nIf you experience or witness unacceptable behavior—or have any other concerns—please report it by contacting us via **code@nytimes.com**. All reports will be handled with discretion. In your report please include:\n\n- Your contact information.\n- Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional witnesses, please\ninclude them as well. Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public IRC logger), please include a link.\n- Any additional information that may be helpful.\n\nAfter filing a report, a representative will contact you personally, review the incident, follow up with any additional questions, and make a decision as to how to respond. If the person who is harassing you is part of the response team, they will recuse themselves from handling your incident. If the complaint originates from a member of the response team, it will be handled by a different member of the response team. We will respect confidentiality requests for the purpose of protecting victims of abuse.\n\n### Attribution & Acknowledgements\n\nWe all stand on the shoulders of giants across many open source communities.  We'd like to thank the communities and projects that established code of conducts and diversity statements as our inspiration:\n\n* [Django](https://www.djangoproject.com/conduct/reporting/)\n* [Python](https://www.python.org/community/diversity/)\n* [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct)\n* [Contributor Covenant](http://contributor-covenant.org/)\n* [Geek Feminism](http://geekfeminism.org/about/code-of-conduct/)\n* [Citizen Code of Conduct](http://citizencodeofconduct.org/)\n\nThis Code of Conduct was based on https://github.com/todogroup/opencodeofconduct\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md",
    "content": "# Contributing to NYTimes/gziphandler\n\nThis is an open source project started by handful of developers at The New York Times and open to the entire Go community.\n\nWe really appreciate your help!\n\n## Filing issues\n\nWhen filing an issue, make sure to answer these five questions:\n\n1. What version of Go are you using (`go version`)?\n2. What operating system and processor architecture are you using?\n3. What did you do?\n4. What did you expect to see?\n5. What did you see instead?\n\n## Contributing code\n\nBefore submitting changes, please follow these guidelines:\n\n1. Check the open issues and pull requests for existing discussions.\n2. Open an issue to discuss a new feature.\n3. Write tests.\n4. Make sure code follows the ['Go Code Review Comments'](https://github.com/golang/go/wiki/CodeReviewComments).\n5. Make sure your changes pass `go test`.\n6. Make sure the entire test suite passes locally and on Travis CI.\n7. Open a Pull Request.\n8. [Squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) after receiving feedback and add a [great commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).\n\nUnless otherwise noted, the gziphandler source files are distributed under the Apache 2.0-style license found in the LICENSE.md file.\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2016-2017 The New York Times Company\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/README.md",
    "content": "Gzip Handler\n============\n\nThis is a tiny Go package which wraps HTTP handlers to transparently gzip the\nresponse body, for clients which support it. Although it's usually simpler to\nleave that to a reverse proxy (like nginx or Varnish), this package is useful\nwhen that's undesirable.\n\n## Install\n```bash\ngo get -u github.com/NYTimes/gziphandler\n```\n\n## Usage\n\nCall `GzipHandler` with any handler (an object which implements the\n`http.Handler` interface), and it'll return a new handler which gzips the\nresponse. For example:\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"github.com/NYTimes/gziphandler\"\n)\n\nfunc main() {\n\twithoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tio.WriteString(w, \"Hello, World\")\n\t})\n\n\twithGz := gziphandler.GzipHandler(withoutGz)\n\n\thttp.Handle(\"/\", withGz)\n\thttp.ListenAndServe(\"0.0.0.0:8000\", nil)\n}\n```\n\n\n## Documentation\n\nThe docs can be found at [godoc.org][docs], as usual.\n\n\n## License\n\n[Apache 2.0][license].\n\n\n\n\n[docs]:     https://godoc.org/github.com/NYTimes/gziphandler\n[license]:  https://github.com/NYTimes/gziphandler/blob/master/LICENSE\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/gzip.go",
    "content": "package gziphandler // import \"github.com/NYTimes/gziphandler\"\n\nimport (\n\t\"bufio\"\n\t\"compress/gzip\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n)\n\nconst (\n\tvary            = \"Vary\"\n\tacceptEncoding  = \"Accept-Encoding\"\n\tcontentEncoding = \"Content-Encoding\"\n\tcontentType     = \"Content-Type\"\n\tcontentLength   = \"Content-Length\"\n)\n\ntype codings map[string]float64\n\nconst (\n\t// DefaultQValue is the default qvalue to assign to an encoding if no explicit qvalue is set.\n\t// This is actually kind of ambiguous in RFC 2616, so hopefully it's correct.\n\t// The examples seem to indicate that it is.\n\tDefaultQValue = 1.0\n\n\t// DefaultMinSize is the default minimum size until we enable gzip compression.\n\t// 1500 bytes is the MTU size for the internet since that is the largest size allowed at the network layer.\n\t// If you take a file that is 1300 bytes and compress it to 800 bytes, it’s still transmitted in that same 1500 byte packet regardless, so you’ve gained nothing.\n\t// That being the case, you should restrict the gzip compression to files with a size greater than a single packet, 1400 bytes (1.4KB) is a safe value.\n\tDefaultMinSize = 1400\n)\n\n// gzipWriterPools stores a sync.Pool for each compression level for reuse of\n// gzip.Writers. Use poolIndex to covert a compression level to an index into\n// gzipWriterPools.\nvar gzipWriterPools [gzip.BestCompression - gzip.BestSpeed + 2]*sync.Pool\n\nfunc init() {\n\tfor i := gzip.BestSpeed; i <= gzip.BestCompression; i++ {\n\t\taddLevelPool(i)\n\t}\n\taddLevelPool(gzip.DefaultCompression)\n}\n\n// poolIndex maps a compression level to its index into gzipWriterPools. It\n// assumes that level is a valid gzip compression level.\nfunc poolIndex(level int) int {\n\t// gzip.DefaultCompression == -1, so we need to treat it special.\n\tif level == gzip.DefaultCompression {\n\t\treturn gzip.BestCompression - gzip.BestSpeed + 1\n\t}\n\treturn level - gzip.BestSpeed\n}\n\nfunc addLevelPool(level int) {\n\tgzipWriterPools[poolIndex(level)] = &sync.Pool{\n\t\tNew: func() interface{} {\n\t\t\t// NewWriterLevel only returns error on a bad level, we are guaranteeing\n\t\t\t// that this will be a valid level so it is okay to ignore the returned\n\t\t\t// error.\n\t\t\tw, _ := gzip.NewWriterLevel(nil, level)\n\t\t\treturn w\n\t\t},\n\t}\n}\n\n// GzipResponseWriter provides an http.ResponseWriter interface, which gzips\n// bytes before writing them to the underlying response. This doesn't close the\n// writers, so don't forget to do that.\n// It can be configured to skip response smaller than minSize.\ntype GzipResponseWriter struct {\n\thttp.ResponseWriter\n\tindex int // Index for gzipWriterPools.\n\tgw    *gzip.Writer\n\n\tcode int // Saves the WriteHeader value.\n\n\tminSize int    // Specifed the minimum response size to gzip. If the response length is bigger than this value, it is compressed.\n\tbuf     []byte // Holds the first part of the write before reaching the minSize or the end of the write.\n\tignore  bool   // If true, then we immediately passthru writes to the underlying ResponseWriter.\n\n\tcontentTypes []parsedContentType // Only compress if the response is one of these content-types. All are accepted if empty.\n}\n\ntype GzipResponseWriterWithCloseNotify struct {\n\t*GzipResponseWriter\n}\n\nfunc (w GzipResponseWriterWithCloseNotify) CloseNotify() <-chan bool {\n\treturn w.ResponseWriter.(http.CloseNotifier).CloseNotify()\n}\n\n// Write appends data to the gzip writer.\nfunc (w *GzipResponseWriter) Write(b []byte) (int, error) {\n\t// GZIP responseWriter is initialized. Use the GZIP responseWriter.\n\tif w.gw != nil {\n\t\treturn w.gw.Write(b)\n\t}\n\n\t// If we have already decided not to use GZIP, immediately passthrough.\n\tif w.ignore {\n\t\treturn w.ResponseWriter.Write(b)\n\t}\n\n\t// Save the write into a buffer for later use in GZIP responseWriter (if content is long enough) or at close with regular responseWriter.\n\t// On the first write, w.buf changes from nil to a valid slice\n\tw.buf = append(w.buf, b...)\n\n\tvar (\n\t\tcl, _ = strconv.Atoi(w.Header().Get(contentLength))\n\t\tct    = w.Header().Get(contentType)\n\t\tce    = w.Header().Get(contentEncoding)\n\t)\n\t// Only continue if they didn't already choose an encoding or a known unhandled content length or type.\n\tif ce == \"\" && (cl == 0 || cl >= w.minSize) && (ct == \"\" || handleContentType(w.contentTypes, ct)) {\n\t\t// If the current buffer is less than minSize and a Content-Length isn't set, then wait until we have more data.\n\t\tif len(w.buf) < w.minSize && cl == 0 {\n\t\t\treturn len(b), nil\n\t\t}\n\t\t// If the Content-Length is larger than minSize or the current buffer is larger than minSize, then continue.\n\t\tif cl >= w.minSize || len(w.buf) >= w.minSize {\n\t\t\t// If a Content-Type wasn't specified, infer it from the current buffer.\n\t\t\tif ct == \"\" {\n\t\t\t\tct = http.DetectContentType(w.buf)\n\t\t\t\tw.Header().Set(contentType, ct)\n\t\t\t}\n\t\t\t// If the Content-Type is acceptable to GZIP, initialize the GZIP writer.\n\t\t\tif handleContentType(w.contentTypes, ct) {\n\t\t\t\tif err := w.startGzip(); err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\treturn len(b), nil\n\t\t\t}\n\t\t}\n\t}\n\t// If we got here, we should not GZIP this response.\n\tif err := w.startPlain(); err != nil {\n\t\treturn 0, err\n\t}\n\treturn len(b), nil\n}\n\n// startGzip initializes a GZIP writer and writes the buffer.\nfunc (w *GzipResponseWriter) startGzip() error {\n\t// Set the GZIP header.\n\tw.Header().Set(contentEncoding, \"gzip\")\n\n\t// if the Content-Length is already set, then calls to Write on gzip\n\t// will fail to set the Content-Length header since its already set\n\t// See: https://github.com/golang/go/issues/14975.\n\tw.Header().Del(contentLength)\n\n\t// Write the header to gzip response.\n\tif w.code != 0 {\n\t\tw.ResponseWriter.WriteHeader(w.code)\n\t\t// Ensure that no other WriteHeader's happen\n\t\tw.code = 0\n\t}\n\n\t// Initialize and flush the buffer into the gzip response if there are any bytes.\n\t// If there aren't any, we shouldn't initialize it yet because on Close it will\n\t// write the gzip header even if nothing was ever written.\n\tif len(w.buf) > 0 {\n\t\t// Initialize the GZIP response.\n\t\tw.init()\n\t\tn, err := w.gw.Write(w.buf)\n\n\t\t// This should never happen (per io.Writer docs), but if the write didn't\n\t\t// accept the entire buffer but returned no specific error, we have no clue\n\t\t// what's going on, so abort just to be safe.\n\t\tif err == nil && n < len(w.buf) {\n\t\t\terr = io.ErrShortWrite\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// startPlain writes to sent bytes and buffer the underlying ResponseWriter without gzip.\nfunc (w *GzipResponseWriter) startPlain() error {\n\tif w.code != 0 {\n\t\tw.ResponseWriter.WriteHeader(w.code)\n\t\t// Ensure that no other WriteHeader's happen\n\t\tw.code = 0\n\t}\n\tw.ignore = true\n\t// If Write was never called then don't call Write on the underlying ResponseWriter.\n\tif w.buf == nil {\n\t\treturn nil\n\t}\n\tn, err := w.ResponseWriter.Write(w.buf)\n\tw.buf = nil\n\t// This should never happen (per io.Writer docs), but if the write didn't\n\t// accept the entire buffer but returned no specific error, we have no clue\n\t// what's going on, so abort just to be safe.\n\tif err == nil && n < len(w.buf) {\n\t\terr = io.ErrShortWrite\n\t}\n\treturn err\n}\n\n// WriteHeader just saves the response code until close or GZIP effective writes.\nfunc (w *GzipResponseWriter) WriteHeader(code int) {\n\tif w.code == 0 {\n\t\tw.code = code\n\t}\n}\n\n// init graps a new gzip writer from the gzipWriterPool and writes the correct\n// content encoding header.\nfunc (w *GzipResponseWriter) init() {\n\t// Bytes written during ServeHTTP are redirected to this gzip writer\n\t// before being written to the underlying response.\n\tgzw := gzipWriterPools[w.index].Get().(*gzip.Writer)\n\tgzw.Reset(w.ResponseWriter)\n\tw.gw = gzw\n}\n\n// Close will close the gzip.Writer and will put it back in the gzipWriterPool.\nfunc (w *GzipResponseWriter) Close() error {\n\tif w.ignore {\n\t\treturn nil\n\t}\n\n\tif w.gw == nil {\n\t\t// GZIP not triggered yet, write out regular response.\n\t\terr := w.startPlain()\n\t\t// Returns the error if any at write.\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"gziphandler: write to regular responseWriter at close gets error: %q\", err.Error())\n\t\t}\n\t\treturn err\n\t}\n\n\terr := w.gw.Close()\n\tgzipWriterPools[w.index].Put(w.gw)\n\tw.gw = nil\n\treturn err\n}\n\n// Flush flushes the underlying *gzip.Writer and then the underlying\n// http.ResponseWriter if it is an http.Flusher. This makes GzipResponseWriter\n// an http.Flusher.\nfunc (w *GzipResponseWriter) Flush() {\n\tif w.gw == nil && !w.ignore {\n\t\t// Only flush once startGzip or startPlain has been called.\n\t\t//\n\t\t// Flush is thus a no-op until we're certain whether a plain\n\t\t// or gzipped response will be served.\n\t\treturn\n\t}\n\n\tif w.gw != nil {\n\t\tw.gw.Flush()\n\t}\n\n\tif fw, ok := w.ResponseWriter.(http.Flusher); ok {\n\t\tfw.Flush()\n\t}\n}\n\n// Hijack implements http.Hijacker. If the underlying ResponseWriter is a\n// Hijacker, its Hijack method is returned. Otherwise an error is returned.\nfunc (w *GzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\tif hj, ok := w.ResponseWriter.(http.Hijacker); ok {\n\t\treturn hj.Hijack()\n\t}\n\treturn nil, nil, fmt.Errorf(\"http.Hijacker interface is not supported\")\n}\n\n// verify Hijacker interface implementation\nvar _ http.Hijacker = &GzipResponseWriter{}\n\n// MustNewGzipLevelHandler behaves just like NewGzipLevelHandler except that in\n// an error case it panics rather than returning an error.\nfunc MustNewGzipLevelHandler(level int) func(http.Handler) http.Handler {\n\twrap, err := NewGzipLevelHandler(level)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn wrap\n}\n\n// NewGzipLevelHandler returns a wrapper function (often known as middleware)\n// which can be used to wrap an HTTP handler to transparently gzip the response\n// body if the client supports it (via the Accept-Encoding header). Responses will\n// be encoded at the given gzip compression level. An error will be returned only\n// if an invalid gzip compression level is given, so if one can ensure the level\n// is valid, the returned error can be safely ignored.\nfunc NewGzipLevelHandler(level int) (func(http.Handler) http.Handler, error) {\n\treturn NewGzipLevelAndMinSize(level, DefaultMinSize)\n}\n\n// NewGzipLevelAndMinSize behave as NewGzipLevelHandler except it let the caller\n// specify the minimum size before compression.\nfunc NewGzipLevelAndMinSize(level, minSize int) (func(http.Handler) http.Handler, error) {\n\treturn GzipHandlerWithOpts(CompressionLevel(level), MinSize(minSize))\n}\n\nfunc GzipHandlerWithOpts(opts ...option) (func(http.Handler) http.Handler, error) {\n\tc := &config{\n\t\tlevel:   gzip.DefaultCompression,\n\t\tminSize: DefaultMinSize,\n\t}\n\n\tfor _, o := range opts {\n\t\to(c)\n\t}\n\n\tif err := c.validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn func(h http.Handler) http.Handler {\n\t\tindex := poolIndex(c.level)\n\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Add(vary, acceptEncoding)\n\t\t\tif acceptsGzip(r) {\n\t\t\t\tgw := &GzipResponseWriter{\n\t\t\t\t\tResponseWriter: w,\n\t\t\t\t\tindex:          index,\n\t\t\t\t\tminSize:        c.minSize,\n\t\t\t\t\tcontentTypes:   c.contentTypes,\n\t\t\t\t}\n\t\t\t\tdefer gw.Close()\n\n\t\t\t\tif _, ok := w.(http.CloseNotifier); ok {\n\t\t\t\t\tgwcn := GzipResponseWriterWithCloseNotify{gw}\n\t\t\t\t\th.ServeHTTP(gwcn, r)\n\t\t\t\t} else {\n\t\t\t\t\th.ServeHTTP(gw, r)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\th.ServeHTTP(w, r)\n\t\t\t}\n\t\t})\n\t}, nil\n}\n\n// Parsed representation of one of the inputs to ContentTypes.\n// See https://golang.org/pkg/mime/#ParseMediaType\ntype parsedContentType struct {\n\tmediaType string\n\tparams    map[string]string\n}\n\n// equals returns whether this content type matches another content type.\nfunc (pct parsedContentType) equals(mediaType string, params map[string]string) bool {\n\tif pct.mediaType != mediaType {\n\t\treturn false\n\t}\n\t// if pct has no params, don't care about other's params\n\tif len(pct.params) == 0 {\n\t\treturn true\n\t}\n\n\t// if pct has any params, they must be identical to other's.\n\tif len(pct.params) != len(params) {\n\t\treturn false\n\t}\n\tfor k, v := range pct.params {\n\t\tif w, ok := params[k]; !ok || v != w {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Used for functional configuration.\ntype config struct {\n\tminSize      int\n\tlevel        int\n\tcontentTypes []parsedContentType\n}\n\nfunc (c *config) validate() error {\n\tif c.level != gzip.DefaultCompression && (c.level < gzip.BestSpeed || c.level > gzip.BestCompression) {\n\t\treturn fmt.Errorf(\"invalid compression level requested: %d\", c.level)\n\t}\n\n\tif c.minSize < 0 {\n\t\treturn fmt.Errorf(\"minimum size must be more than zero\")\n\t}\n\n\treturn nil\n}\n\ntype option func(c *config)\n\nfunc MinSize(size int) option {\n\treturn func(c *config) {\n\t\tc.minSize = size\n\t}\n}\n\nfunc CompressionLevel(level int) option {\n\treturn func(c *config) {\n\t\tc.level = level\n\t}\n}\n\n// ContentTypes specifies a list of content types to compare\n// the Content-Type header to before compressing. If none\n// match, the response will be returned as-is.\n//\n// Content types are compared in a case-insensitive, whitespace-ignored\n// manner.\n//\n// A MIME type without any other directive will match a content type\n// that has the same MIME type, regardless of that content type's other\n// directives. I.e., \"text/html\" will match both \"text/html\" and\n// \"text/html; charset=utf-8\".\n//\n// A MIME type with any other directive will only match a content type\n// that has the same MIME type and other directives. I.e.,\n// \"text/html; charset=utf-8\" will only match \"text/html; charset=utf-8\".\n//\n// By default, responses are gzipped regardless of\n// Content-Type.\nfunc ContentTypes(types []string) option {\n\treturn func(c *config) {\n\t\tc.contentTypes = []parsedContentType{}\n\t\tfor _, v := range types {\n\t\t\tmediaType, params, err := mime.ParseMediaType(v)\n\t\t\tif err == nil {\n\t\t\t\tc.contentTypes = append(c.contentTypes, parsedContentType{mediaType, params})\n\t\t\t}\n\t\t}\n\t}\n}\n\n// GzipHandler wraps an HTTP handler, to transparently gzip the response body if\n// the client supports it (via the Accept-Encoding header). This will compress at\n// the default compression level.\nfunc GzipHandler(h http.Handler) http.Handler {\n\twrapper, _ := NewGzipLevelHandler(gzip.DefaultCompression)\n\treturn wrapper(h)\n}\n\n// acceptsGzip returns true if the given HTTP request indicates that it will\n// accept a gzipped response.\nfunc acceptsGzip(r *http.Request) bool {\n\tacceptedEncodings, _ := parseEncodings(r.Header.Get(acceptEncoding))\n\treturn acceptedEncodings[\"gzip\"] > 0.0\n}\n\n// returns true if we've been configured to compress the specific content type.\nfunc handleContentType(contentTypes []parsedContentType, ct string) bool {\n\t// If contentTypes is empty we handle all content types.\n\tif len(contentTypes) == 0 {\n\t\treturn true\n\t}\n\n\tmediaType, params, err := mime.ParseMediaType(ct)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tfor _, c := range contentTypes {\n\t\tif c.equals(mediaType, params) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// parseEncodings attempts to parse a list of codings, per RFC 2616, as might\n// appear in an Accept-Encoding header. It returns a map of content-codings to\n// quality values, and an error containing the errors encountered. It's probably\n// safe to ignore those, because silently ignoring errors is how the internet\n// works.\n//\n// See: http://tools.ietf.org/html/rfc2616#section-14.3.\nfunc parseEncodings(s string) (codings, error) {\n\tc := make(codings)\n\tvar e []string\n\n\tfor _, ss := range strings.Split(s, \",\") {\n\t\tcoding, qvalue, err := parseCoding(ss)\n\n\t\tif err != nil {\n\t\t\te = append(e, err.Error())\n\t\t} else {\n\t\t\tc[coding] = qvalue\n\t\t}\n\t}\n\n\t// TODO (adammck): Use a proper multi-error struct, so the individual errors\n\t//                 can be extracted if anyone cares.\n\tif len(e) > 0 {\n\t\treturn c, fmt.Errorf(\"errors while parsing encodings: %s\", strings.Join(e, \", \"))\n\t}\n\n\treturn c, nil\n}\n\n// parseCoding parses a single conding (content-coding with an optional qvalue),\n// as might appear in an Accept-Encoding header. It attempts to forgive minor\n// formatting errors.\nfunc parseCoding(s string) (coding string, qvalue float64, err error) {\n\tfor n, part := range strings.Split(s, \";\") {\n\t\tpart = strings.TrimSpace(part)\n\t\tqvalue = DefaultQValue\n\n\t\tif n == 0 {\n\t\t\tcoding = strings.ToLower(part)\n\t\t} else if strings.HasPrefix(part, \"q=\") {\n\t\t\tqvalue, err = strconv.ParseFloat(strings.TrimPrefix(part, \"q=\"), 64)\n\n\t\t\tif qvalue < 0.0 {\n\t\t\t\tqvalue = 0.0\n\t\t\t} else if qvalue > 1.0 {\n\t\t\t\tqvalue = 1.0\n\t\t\t}\n\t\t}\n\t}\n\n\tif coding == \"\" {\n\t\terr = fmt.Errorf(\"empty content-coding\")\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/gzip_go18.go",
    "content": "// +build go1.8\n\npackage gziphandler\n\nimport \"net/http\"\n\n// Push initiates an HTTP/2 server push.\n// Push returns ErrNotSupported if the client has disabled push or if push\n// is not supported on the underlying connection.\nfunc (w *GzipResponseWriter) Push(target string, opts *http.PushOptions) error {\n\tpusher, ok := w.ResponseWriter.(http.Pusher)\n\tif ok && pusher != nil {\n\t\treturn pusher.Push(target, setAcceptEncodingForPushOptions(opts))\n\t}\n\treturn http.ErrNotSupported\n}\n\n// setAcceptEncodingForPushOptions sets \"Accept-Encoding\" : \"gzip\" for PushOptions without overriding existing headers.\nfunc setAcceptEncodingForPushOptions(opts *http.PushOptions) *http.PushOptions {\n\n\tif opts == nil {\n\t\topts = &http.PushOptions{\n\t\t\tHeader: http.Header{\n\t\t\t\tacceptEncoding: []string{\"gzip\"},\n\t\t\t},\n\t\t}\n\t\treturn opts\n\t}\n\n\tif opts.Header == nil {\n\t\topts.Header = http.Header{\n\t\t\tacceptEncoding: []string{\"gzip\"},\n\t\t}\n\t\treturn opts\n\t}\n\n\tif encoding := opts.Header.Get(acceptEncoding); encoding == \"\" {\n\t\topts.Header.Add(acceptEncoding, \"gzip\")\n\t\treturn opts\n\t}\n\n\treturn opts\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\ncoverage.out\n\nmanual_test.go\n*.out\n*.err\n\n.vscode"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/.travis.yml",
    "content": "language: go\n\nbefore_install:\n  - go get golang.org/x/tools/cmd/cover\n  - go get github.com/mattn/goveralls\n\nscript:\n- go test -bench=. -benchmem -timeout 10m -coverprofile coverage.out\n- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN\n- go test -bench=Random -benchtime 5m -timeout 30m -benchmem -coverprofile coverage.out\n\ngo: \"1.11\"\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/LICENSE",
    "content": "Copyright (c) 2017, Paessler AG <support@paessler.com>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/README.md",
    "content": "# Gval\n\n[![Godoc](https://godoc.org/github.com/PaesslerAG/gval?status.png)](https://godoc.org/github.com/PaesslerAG/gval)\n[![Build Status](https://api.travis-ci.org/PaesslerAG/gval.svg?branch=master)](https://travis-ci.org/PaesslerAG/gval)\n[![Coverage Status](https://coveralls.io/repos/github/PaesslerAG/gval/badge.svg?branch=master)](https://coveralls.io/github/PaesslerAG/gval?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/PaesslerAG/gval)](https://goreportcard.com/report/github.com/PaesslerAG/gval)\n\nGval (Go eVALuate) provides support for evaluating arbitrary expressions, in particular Go-like expressions.\n\n![gopher](./prtg-batmin-gopher.png)\n\n## Evaluate\n\nGval can evaluate expressions with parameters, arimethetic, logical, and string operations:\n\n- basic expression: [10 > 0](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Basic)\n- parameterized expression: [foo > 0](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Parameter)\n- nested parameterized expression: [foo.bar > 0](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--NestedParameter)\n- arithmetic expression: [(requests_made * requests_succeeded / 100) >= 90](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Arithmetic)\n- string expression: [http_response_body == \"service is ok\"](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--String)\n- float64 expression: [(mem_used / total_mem) * 100](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Float64)\n\nIt can easily be extended with custom functions or operators:\n\n- custom date comparator: [date(\\`2014-01-02\\`) > date(\\`2014-01-01 23:59:59\\`)](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--DateComparison)\n- string length: [strlen(\"someReallyLongInputString\") <= 16](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Strlen)\n\nYou can parse gval.Expressions once and re-use them multiple times. Parsing is the compute-intensive phase of the process, so if you intend to use the same expression with different parameters, just parse it once:\n\n- [Parsing and Evaluation](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluable)\n\nThe normal Go-standard order of operators is respected. When writing an expression, be sure that you either order the operators correctly, or use parentheses to clarify which portions of an expression should be run first.\n\nStrings, numbers, and booleans can be used like in Go:\n\n- [(7 < \"47\" == true ? \"hello world!\\n\\u263a\") + \\` more text\\`](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Encoding)\n\n## Parameter\n\nVariables can be accessed via string literals. They can be used for values with string keys if the parameter is a `map[string]interface{}` or `map[interface{}]interface{}` and for fields or methods if the parameter is a struct.\n\n- [foo > 0](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Parameter)\n\n### Bracket Selector\n\nMap and array elements and Struct Field can be accessed via `[]`.\n\n- [foo[0]](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Array)\n- [foo[\"b\" + \"a\" + \"r\"]](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--ExampleEvaluate_ComplexAccessor)\n\n### Dot Selector\n\nA nested variable with a name containing only letters and underscores can be accessed via a dot selector.\n\n- [foo.bar > 0](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--NestedParameter)\n\n### Custom Selector\n\nParameter names like `response-time` will be interpreted as `response` minus `time`. While gval doesn't support these parameter names directly, you can easily access them via a custom extension like [JSON Path](https://github.com/PaesslerAG/jsonpath):\n\n- [$[\"response-time\"]](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Jsonpath)\n\nJsonpath is also suitable for accessing array elements.\n\n### Fields and Methods\n\nIf you have structs in your parameters, you can access their fields and methods in the usual way:\n\n- [foo.Hello + foo.World()](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--FlatAccessor)\n\nIt also works if the parameter is a struct directly\n[Hello + World()](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--Accessor)\nor if the fields are nested\n[foo.Hello + foo.World()](https://godoc.org/github.com/PaesslerAG/gval/#example-Evaluate--NestedAccessor)\n\nThis may be convenient but note that using accessors on strucs makes the expression about four times slower than just using a parameter (consult the benchmarks for more precise measurements on your system). If there are functions you want to use, it's faster (and probably cleaner) to define them as functions (see the Evaluate section). These approaches use no reflection, and are designed to be fast and clean.\n\n## Default Language\n\nThe default language is in serveral sub languages like text, arithmetic or propositional logic defined. See [Godoc](https://godoc.org/github.com/PaesslerAG/gval/#Gval) for details. All sub languages are merged into gval.Full which contains the following elements:\n\n- Modifiers: `+` `-` `/` `*` `&` `|` `^` `**` `%` `>>` `<<`\n- Comparators: `>` `>=` `<` `<=` `==` `!=` `=~` `!~`\n- Logical ops: `||` `&&`\n- Numeric constants, as 64-bit floating point (`12345.678`)\n- String constants (double quotes: `\"foobar\"`)\n- Date function 'Date(x)', using any permutation of RFC3339, ISO8601, ruby date, or unix date\n- Boolean constants: `true` `false`\n- Parentheses to control order of evaluation `(` `)`\n- Json Arrays : `[1, 2, \"foo\"]`\n- Json Objects : `{\"a\":1, \"b\":2, \"c\":\"foo\"}`\n- Prefixes: `!` `-` `~`\n- Ternary conditional: `?` `:`\n- Null coalescence: `??`\n\n## Customize\n\nGval is completly customizable. Every constant, function or operator can be defined separately and existing expression languages can be reused:\n\n- [foo.Hello + foo.World()](https://godoc.org/github.com/PaesslerAG/gval/#example-Language)\n\nFor details see [Godoc](https://godoc.org/github.com/PaesslerAG/gval).\n\n### External gval Languages\n\nA list of external libraries for gval. Feel free to add your own library.\n\n- [gvalstrings](https://github.com/generikvault/gvalstrings) parse single quoted strings in gval.\n- [jsonpath](https://github.com/PaesslerAG/jsonpath) full support for jsonpath in gval.\n\n## Performance\n\nThe library is built with the intention of being quick but has not been aggressively profiled and optimized. For most applications, though, it is completely fine.\nIf performance is an issue, make sure to create your expression language with all functions, constants and operators only once. Evaluating an expression like gval.Evaluate(\"expression, const1, func1, func2, ...) creates a new gval.Language everytime it is called and slows execution.\n\nThe library comes with a bunch of benchmarks to measure the performance of parsing and evaluating expressions. You can run them with `go test -bench=.`.\n\nFor a very rough idea of performance, here are the results from a benchmark run on a Dell Latitude E7470 Win 10 i5-6300U.\n\n``` text\nBenchmarkGval/const_evaluation-4                               500000000                 3.57 ns/op\nBenchmarkGval/const_parsing-4                                    1000000              1144 ns/op\nBenchmarkGval/single_parameter_evaluation-4                     10000000               165 ns/op\nBenchmarkGval/single_parameter_parsing-4                         1000000              1648 ns/op\nBenchmarkGval/parameter_evaluation-4                             5000000               352 ns/op\nBenchmarkGval/parameter_parsing-4                                 500000              2773 ns/op\nBenchmarkGval/common_evaluation-4                                3000000               434 ns/op\nBenchmarkGval/common_parsing-4                                    300000              4419 ns/op\nBenchmarkGval/complex_evaluation-4                             100000000                11.6 ns/op\nBenchmarkGval/complex_parsing-4                                   100000             17936 ns/op\nBenchmarkGval/literal_evaluation-4                             300000000                 3.84 ns/op\nBenchmarkGval/literal_parsing-4                                   500000              2559 ns/op\nBenchmarkGval/modifier_evaluation-4                            500000000                 3.54 ns/op\nBenchmarkGval/modifier_parsing-4                                  500000              3755 ns/op\nBenchmarkGval/regex_evaluation-4                                   50000             21347 ns/op\nBenchmarkGval/regex_parsing-4                                     200000              6480 ns/op\nBenchmarkGval/constant_regex_evaluation-4                        1000000              1000 ns/op\nBenchmarkGval/constant_regex_parsing-4                            200000              9417 ns/op\nBenchmarkGval/accessors_evaluation-4                             3000000               417 ns/op\nBenchmarkGval/accessors_parsing-4                                1000000              1778 ns/op\nBenchmarkGval/accessors_method_evaluation-4                      1000000              1931 ns/op\nBenchmarkGval/accessors_method_parsing-4                         1000000              1729 ns/op\nBenchmarkGval/accessors_method_parameter_evaluation-4            1000000              2162 ns/op\nBenchmarkGval/accessors_method_parameter_parsing-4                500000              2618 ns/op\nBenchmarkGval/nested_accessors_evaluation-4                      2000000               681 ns/op\nBenchmarkGval/nested_accessors_parsing-4                         1000000              2115 ns/op\nBenchmarkRandom-4                                                 500000              3631 ns/op\nok\n```\n\n## API Breaks\n\nGval is designed with easy expandability in mind and API breaks will be avoided if possible. If API breaks are unavoidable they wil be explicitly stated via an increased major version number.\n\n-------------------------------------\nCredits to Reene French for the gophers.\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/evaluable.go",
    "content": "package gval\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Evaluable evaluates given parameter\ntype Evaluable func(c context.Context, parameter interface{}) (interface{}, error)\n\n//EvalInt evaluates given parameter to an int\nfunc (e Evaluable) EvalInt(c context.Context, parameter interface{}) (int, error) {\n\tv, err := e(c, parameter)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tf, ok := convertToFloat(v)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected number but got %v (%T)\", v, v)\n\t}\n\treturn int(f), nil\n}\n\n//EvalFloat64 evaluates given parameter to an int\nfunc (e Evaluable) EvalFloat64(c context.Context, parameter interface{}) (float64, error) {\n\tv, err := e(c, parameter)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tf, ok := convertToFloat(v)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected number but got %v (%T)\", v, v)\n\t}\n\treturn f, nil\n}\n\n//EvalBool evaluates given parameter to a bool\nfunc (e Evaluable) EvalBool(c context.Context, parameter interface{}) (bool, error) {\n\tv, err := e(c, parameter)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tb, ok := convertToBool(v)\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"expected bool but got %v (%T)\", v, v)\n\t}\n\treturn b, nil\n}\n\n//EvalString evaluates given parameter to a string\nfunc (e Evaluable) EvalString(c context.Context, parameter interface{}) (string, error) {\n\to, err := e(c, parameter)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"%v\", o), nil\n}\n\n//Const Evaluable represents given constant\nfunc (*Parser) Const(value interface{}) Evaluable {\n\treturn constant(value)\n}\n\nfunc constant(value interface{}) Evaluable {\n\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\treturn value, nil\n\t}\n}\n\n//Var Evaluable represents value at given path.\n//It supports with default language VariableSelector:\n//\tmap[interface{}]interface{},\n//\tmap[string]interface{} and\n// \t[]interface{} and via reflect\n//\tstruct fields,\n//\tstruct methods,\n//\tslices and\n//  map with int or string key.\nfunc (p *Parser) Var(path ...Evaluable) Evaluable {\n\tif p.Language.selector == nil {\n\t\treturn variable(path)\n\t}\n\treturn p.Language.selector(path)\n}\n\n// Evaluables is a slice of Evaluable.\ntype Evaluables []Evaluable\n\n// EvalStrings evaluates given parameter to a string slice\nfunc (evs Evaluables) EvalStrings(c context.Context, parameter interface{}) ([]string, error) {\n\tstrs := make([]string, len(evs))\n\tfor i, p := range evs {\n\t\tk, err := p.EvalString(c, parameter)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tstrs[i] = k\n\t}\n\treturn strs, nil\n}\n\nfunc variable(path Evaluables) Evaluable {\n\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\tkeys, err := path.EvalStrings(c, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor i, k := range keys {\n\t\t\tswitch o := v.(type) {\n\t\t\tcase map[interface{}]interface{}:\n\t\t\t\tv = o[k]\n\t\t\t\tcontinue\n\t\t\tcase map[string]interface{}:\n\t\t\t\tv = o[k]\n\t\t\t\tcontinue\n\t\t\tcase []interface{}:\n\t\t\t\tif i, err := strconv.Atoi(k); err == nil && i >= 0 && len(o) > i {\n\t\t\t\t\tv = o[i]\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tvar ok bool\n\t\t\t\tv, ok = reflectSelect(k, o)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unknown parameter %s\", strings.Join(keys[:i+1], \".\"))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn v, nil\n\t}\n}\n\nfunc reflectSelect(key string, value interface{}) (selection interface{}, ok bool) {\n\tvv := reflect.ValueOf(value)\n\tvvElem := resolvePotentialPointer(vv)\n\n\tswitch vvElem.Kind() {\n\tcase reflect.Map:\n\t\tmapKey, ok := reflectConvertTo(vv.Type().Key().Kind(), key)\n\t\tif !ok {\n\t\t\treturn nil, false\n\t\t}\n\n\t\tvvElem = vv.MapIndex(reflect.ValueOf(mapKey))\n\t\tvvElem = resolvePotentialPointer(vvElem)\n\n\t\tif vvElem.IsValid() {\n\t\t\treturn vvElem.Interface(), true\n\t\t}\n\tcase reflect.Slice:\n\t\tif i, err := strconv.Atoi(key); err == nil && i >= 0 && vv.Len() > i {\n\t\t\tvvElem = resolvePotentialPointer(vv.Index(i))\n\t\t\treturn vvElem.Interface(), true\n\t\t}\n\tcase reflect.Struct:\n\t\tfield := vvElem.FieldByName(key)\n\t\tif field.IsValid() {\n\t\t\treturn field.Interface(), true\n\t\t}\n\n\t\tmethod := vv.MethodByName(key)\n\t\tif method.IsValid() {\n\t\t\treturn method.Interface(), true\n\t\t}\n\t}\n\treturn nil, false\n}\n\nfunc resolvePotentialPointer(value reflect.Value) reflect.Value {\n\tif value.Kind() == reflect.Ptr {\n\t\treturn value.Elem()\n\t}\n\treturn value\n}\n\nfunc reflectConvertTo(k reflect.Kind, value string) (interface{}, bool) {\n\tswitch k {\n\tcase reflect.String:\n\t\treturn value, true\n\tcase reflect.Int:\n\t\tif i, err := strconv.Atoi(value); err == nil {\n\t\t\treturn i, true\n\t\t}\n\t}\n\treturn nil, false\n}\n\nfunc (*Parser) callFunc(fun function, args ...Evaluable) Evaluable {\n\treturn func(c context.Context, v interface{}) (ret interface{}, err error) {\n\t\ta := make([]interface{}, len(args))\n\t\tfor i, arg := range args {\n\t\t\tai, err := arg(c, v)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ta[i] = ai\n\t\t}\n\t\treturn fun(a...)\n\t}\n}\n\nfunc (*Parser) callEvaluable(fullname string, fun Evaluable, args ...Evaluable) Evaluable {\n\treturn func(c context.Context, v interface{}) (ret interface{}, err error) {\n\t\tf, err := fun(c, v)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not call function: %v\", err)\n\t\t}\n\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t\terr = fmt.Errorf(\"failed to execute function '%s': %s\", fullname, r)\n\t\t\t\tret = nil\n\t\t\t}\n\t\t}()\n\n\t\tff := reflect.ValueOf(f)\n\n\t\tif ff.Kind() != reflect.Func {\n\t\t\treturn nil, fmt.Errorf(\"could not call '%s' type %T\", fullname, f)\n\t\t}\n\n\t\ta := make([]reflect.Value, len(args))\n\t\tfor i := range args {\n\t\t\targ, err := args[i](c, v)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ta[i] = reflect.ValueOf(arg)\n\t\t}\n\n\t\trr := ff.Call(a)\n\n\t\tr := make([]interface{}, len(rr))\n\t\tfor i, e := range rr {\n\t\t\tr[i] = e.Interface()\n\t\t}\n\n\t\terrorInterface := reflect.TypeOf((*error)(nil)).Elem()\n\t\tif len(r) > 0 && ff.Type().Out(len(r)-1).Implements(errorInterface) {\n\t\t\tif r[len(r)-1] != nil {\n\t\t\t\terr = r[len(r)-1].(error)\n\t\t\t}\n\t\t\tr = r[0 : len(r)-1]\n\t\t}\n\n\t\tswitch len(r) {\n\t\tcase 0:\n\t\t\treturn err, nil\n\t\tcase 1:\n\t\t\treturn r[0], err\n\t\tdefault:\n\t\t\treturn r, err\n\t\t}\n\t}\n}\n\n//IsConst returns if the Evaluable is a Parser.Const() value\nfunc (e Evaluable) IsConst() bool {\n\tpc := reflect.ValueOf(constant(nil)).Pointer()\n\tpe := reflect.ValueOf(e).Pointer()\n\treturn pc == pe\n}\n\nfunc regEx(a, b Evaluable) (Evaluable, error) {\n\tif !b.IsConst() {\n\t\treturn func(c context.Context, o interface{}) (interface{}, error) {\n\t\t\ta, err := a.EvalString(c, o)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tb, err := b.EvalString(c, o)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmatched, err := regexp.MatchString(b, a)\n\t\t\treturn matched, err\n\t\t}, nil\n\t}\n\ts, err := b.EvalString(nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregex, err := regexp.Compile(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\ts, err := a.EvalString(c, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn regex.MatchString(s), nil\n\t}, nil\n}\n\nfunc notRegEx(a, b Evaluable) (Evaluable, error) {\n\tif !b.IsConst() {\n\t\treturn func(c context.Context, o interface{}) (interface{}, error) {\n\t\t\ta, err := a.EvalString(c, o)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tb, err := b.EvalString(c, o)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmatched, err := regexp.MatchString(b, a)\n\t\t\treturn !matched, err\n\t\t}, nil\n\t}\n\ts, err := b.EvalString(nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregex, err := regexp.Compile(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\ts, err := a.EvalString(c, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn !regex.MatchString(s), nil\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/functions.go",
    "content": "package gval\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\ntype function func(arguments ...interface{}) (interface{}, error)\n\nfunc toFunc(f interface{}) function {\n\tif f, ok := f.(func(arguments ...interface{}) (interface{}, error)); ok {\n\t\treturn function(f)\n\t}\n\treturn func(args ...interface{}) (interface{}, error) {\n\t\tfun := reflect.ValueOf(f)\n\t\tt := fun.Type()\n\n\t\tin, err := createCallArguments(t, args)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout := fun.Call(in)\n\n\t\tr := make([]interface{}, len(out))\n\t\tfor i, e := range out {\n\t\t\tr[i] = e.Interface()\n\t\t}\n\n\t\terr = nil\n\t\terrorInterface := reflect.TypeOf((*error)(nil)).Elem()\n\t\tif len(r) > 0 && t.Out(len(r)-1).Implements(errorInterface) {\n\t\t\tif r[len(r)-1] != nil {\n\t\t\t\terr = r[len(r)-1].(error)\n\t\t\t}\n\t\t\tr = r[0 : len(r)-1]\n\t\t}\n\n\t\tswitch len(r) {\n\t\tcase 0:\n\t\t\treturn nil, err\n\t\tcase 1:\n\t\t\treturn r[0], err\n\t\tdefault:\n\t\t\treturn r, err\n\t\t}\n\t}\n}\n\nfunc createCallArguments(t reflect.Type, args []interface{}) ([]reflect.Value, error) {\n\tvariadic := t.IsVariadic()\n\tnumIn := t.NumIn()\n\n\tif (!variadic && len(args) != numIn) || (variadic && len(args) < numIn-1) {\n\t\treturn nil, fmt.Errorf(\"invalid number of parameters\")\n\t}\n\n\tin := make([]reflect.Value, len(args))\n\tvar inType reflect.Type\n\tfor i, arg := range args {\n\t\tif !variadic || i < numIn-1 {\n\t\t\tinType = t.In(i)\n\t\t} else if i == numIn-1 {\n\t\t\tinType = t.In(numIn - 1).Elem()\n\t\t}\n\t\targVal := reflect.ValueOf(arg)\n\t\tif arg == nil || !argVal.Type().AssignableTo(inType) {\n\t\t\treturn nil, fmt.Errorf(\"expected type %s for parameter %d but got %T\",\n\t\t\t\tinType.String(), i, arg)\n\t\t}\n\t\tin[i] = argVal\n\t}\n\treturn in, nil\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/gval.go",
    "content": "// Package gval provides a generic expression language.\n// All functions, infix and prefix operators can be replaced by composing languages into a new one.\n//\n// The package contains concrete expression languages for common application in text, arithmetic, propositional logic and so on.\n// They can be used as basis for a custom expression language or to evaluate expressions directly.\npackage gval\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"text/scanner\"\n\t\"time\"\n)\n\n//Evaluate given parameter with given expression in gval full language\nfunc Evaluate(expression string, parameter interface{}, opts ...Language) (interface{}, error) {\n\tl := full\n\tif len(opts) > 0 {\n\t\tl = NewLanguage(append([]Language{l}, opts...)...)\n\t}\n\treturn l.Evaluate(expression, parameter)\n}\n\n// Full is the union of Arithmetic, Bitmask, Text, PropositionalLogic, and Json\n// \t\tOperator in: a in b is true iff value a is an element of array b\n// \t\tOperator ??: a ?? b returns a if a is not false or nil, otherwise n\n// \t\tOperator ?: a ? b : c returns b if bool a is true, otherwise b\n//\n// Function Date: Date(a) parses string a. a must match RFC3339, ISO8601, ruby date, or unix date\nfunc Full(extensions ...Language) Language {\n\tif len(extensions) == 0 {\n\t\treturn full\n\t}\n\treturn NewLanguage(append([]Language{full}, extensions...)...)\n}\n\n// Arithmetic contains base, plus(+), minus(-), divide(/), power(**), negative(-)\n// and numerical order (<=,<,>,>=)\n//\n// Arithmetic operators expect float64 operands.\n// Called with unfitting input, they try to convert the input to float64.\n// They can parse strings and convert any type of int or float.\nfunc Arithmetic() Language {\n\treturn arithmetic\n}\n\n// Bitmask contains base, bitwise and(&), bitwise or(|) and bitwise not(^).\n//\n// Bitmask operators expect float64 operands.\n// Called with unfitting input they try to convert the input to float64.\n// They can parse strings and convert any type of int or float.\nfunc Bitmask() Language {\n\treturn bitmask\n}\n\n// Text contains base, lexical order on strings (<=,<,>,>=),\n// regex match (=~) and regex not match (!~)\nfunc Text() Language {\n\treturn text\n}\n\n// PropositionalLogic contains base, not(!), and (&&), or (||) and Base.\n//\n// Propositional operator expect bool operands.\n// Called with unfitting input they try to convert the input to bool.\n// Numbers other than 0 and the strings \"TRUE\" and \"true\" are interpreted as true.\n// 0 and the strings \"FALSE\" and \"false\" are interpreted as false.\nfunc PropositionalLogic() Language {\n\treturn propositionalLogic\n}\n\n// JSON contains json objects ({string:expression,...})\n// and json arrays ([expression, ...])\nfunc JSON() Language {\n\treturn ljson\n}\n\n// Base contains equal (==) and not equal (!=), perentheses and general support for variables, constants and functions\n// It contains true, false, (floating point) number, string  (\"\" or ``) and char ('') constants\nfunc Base() Language {\n\treturn base\n}\n\nvar full = NewLanguage(arithmetic, bitmask, text, propositionalLogic, ljson,\n\n\tInfixOperator(\"in\", inArray),\n\n\tInfixShortCircuit(\"??\", func(a interface{}) (interface{}, bool) {\n\t\treturn a, a != false && a != nil\n\t}),\n\tInfixOperator(\"??\", func(a, b interface{}) (interface{}, error) {\n\t\tif a == false || a == nil {\n\t\t\treturn b, nil\n\t\t}\n\t\treturn a, nil\n\t}),\n\n\tPostfixOperator(\"?\", parseIf),\n\n\tFunction(\"date\", func(arguments ...interface{}) (interface{}, error) {\n\t\tif len(arguments) != 1 {\n\t\t\treturn nil, fmt.Errorf(\"date() expects exactly one string argument\")\n\t\t}\n\t\ts, ok := arguments[0].(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"date() expects exactly one string argument\")\n\t\t}\n\t\tfor _, format := range [...]string{\n\t\t\ttime.ANSIC,\n\t\t\ttime.UnixDate,\n\t\t\ttime.RubyDate,\n\t\t\ttime.Kitchen,\n\t\t\ttime.RFC3339,\n\t\t\ttime.RFC3339Nano,\n\t\t\t\"2006-01-02\",                         // RFC 3339\n\t\t\t\"2006-01-02 15:04\",                   // RFC 3339 with minutes\n\t\t\t\"2006-01-02 15:04:05\",                // RFC 3339 with seconds\n\t\t\t\"2006-01-02 15:04:05-07:00\",          // RFC 3339 with seconds and timezone\n\t\t\t\"2006-01-02T15Z0700\",                 // ISO8601 with hour\n\t\t\t\"2006-01-02T15:04Z0700\",              // ISO8601 with minutes\n\t\t\t\"2006-01-02T15:04:05Z0700\",           // ISO8601 with seconds\n\t\t\t\"2006-01-02T15:04:05.999999999Z0700\", // ISO8601 with nanoseconds\n\t\t} {\n\t\t\tret, err := time.ParseInLocation(format, s, time.Local)\n\t\t\tif err == nil {\n\t\t\t\treturn ret, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"date() could not parse %s\", s)\n\t}),\n)\n\nvar ljson = NewLanguage(\n\tPrefixExtension('[', parseJSONArray),\n\tPrefixExtension('{', parseJSONObject),\n)\n\nvar arithmetic = NewLanguage(\n\tInfixNumberOperator(\"+\", func(a, b float64) (interface{}, error) { return a + b, nil }),\n\tInfixNumberOperator(\"-\", func(a, b float64) (interface{}, error) { return a - b, nil }),\n\tInfixNumberOperator(\"*\", func(a, b float64) (interface{}, error) { return a * b, nil }),\n\tInfixNumberOperator(\"/\", func(a, b float64) (interface{}, error) { return a / b, nil }),\n\tInfixNumberOperator(\"%\", func(a, b float64) (interface{}, error) { return math.Mod(a, b), nil }),\n\tInfixNumberOperator(\"**\", func(a, b float64) (interface{}, error) { return math.Pow(a, b), nil }),\n\n\tInfixNumberOperator(\">\", func(a, b float64) (interface{}, error) { return a > b, nil }),\n\tInfixNumberOperator(\">=\", func(a, b float64) (interface{}, error) { return a >= b, nil }),\n\tInfixNumberOperator(\"<\", func(a, b float64) (interface{}, error) { return a < b, nil }),\n\tInfixNumberOperator(\"<=\", func(a, b float64) (interface{}, error) { return a <= b, nil }),\n\n\tInfixNumberOperator(\"==\", func(a, b float64) (interface{}, error) { return a == b, nil }),\n\tInfixNumberOperator(\"!=\", func(a, b float64) (interface{}, error) { return a != b, nil }),\n\n\tbase,\n)\n\nvar bitmask = NewLanguage(\n\tInfixNumberOperator(\"^\", func(a, b float64) (interface{}, error) { return float64(int64(a) ^ int64(b)), nil }),\n\tInfixNumberOperator(\"&\", func(a, b float64) (interface{}, error) { return float64(int64(a) & int64(b)), nil }),\n\tInfixNumberOperator(\"|\", func(a, b float64) (interface{}, error) { return float64(int64(a) | int64(b)), nil }),\n\tInfixNumberOperator(\"<<\", func(a, b float64) (interface{}, error) { return float64(int64(a) << uint64(b)), nil }),\n\tInfixNumberOperator(\">>\", func(a, b float64) (interface{}, error) { return float64(int64(a) >> uint64(b)), nil }),\n\n\tPrefixOperator(\"~\", func(c context.Context, v interface{}) (interface{}, error) {\n\t\ti, ok := convertToFloat(v)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unexpected %T expected number\", v)\n\t\t}\n\t\treturn float64(^int64(i)), nil\n\t}),\n)\n\nvar text = NewLanguage(\n\tInfixTextOperator(\"+\", func(a, b string) (interface{}, error) { return fmt.Sprintf(\"%v%v\", a, b), nil }),\n\n\tInfixTextOperator(\"<\", func(a, b string) (interface{}, error) { return a < b, nil }),\n\tInfixTextOperator(\"<=\", func(a, b string) (interface{}, error) { return a <= b, nil }),\n\tInfixTextOperator(\">\", func(a, b string) (interface{}, error) { return a > b, nil }),\n\tInfixTextOperator(\">=\", func(a, b string) (interface{}, error) { return a >= b, nil }),\n\n\tInfixEvalOperator(\"=~\", regEx),\n\tInfixEvalOperator(\"!~\", notRegEx),\n\tbase,\n)\n\nvar propositionalLogic = NewLanguage(\n\tPrefixOperator(\"!\", func(c context.Context, v interface{}) (interface{}, error) {\n\t\tb, ok := convertToBool(v)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unexpected %T expected bool\", v)\n\t\t}\n\t\treturn !b, nil\n\t}),\n\n\tInfixShortCircuit(\"&&\", func(a interface{}) (interface{}, bool) { return false, a == false }),\n\tInfixBoolOperator(\"&&\", func(a, b bool) (interface{}, error) { return a && b, nil }),\n\tInfixShortCircuit(\"||\", func(a interface{}) (interface{}, bool) { return true, a == true }),\n\tInfixBoolOperator(\"||\", func(a, b bool) (interface{}, error) { return a || b, nil }),\n\n\tInfixBoolOperator(\"==\", func(a, b bool) (interface{}, error) { return a == b, nil }),\n\tInfixBoolOperator(\"!=\", func(a, b bool) (interface{}, error) { return a != b, nil }),\n\n\tbase,\n)\n\nvar base = NewLanguage(\n\tPrefixExtension(scanner.Int, parseNumber),\n\tPrefixExtension(scanner.Float, parseNumber),\n\tPrefixOperator(\"-\", func(c context.Context, v interface{}) (interface{}, error) {\n\t\ti, ok := convertToFloat(v)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unexpected %v(%T) expected number\", v, v)\n\t\t}\n\t\treturn -i, nil\n\t}),\n\n\tPrefixExtension(scanner.String, parseString),\n\tPrefixExtension(scanner.Char, parseString),\n\tPrefixExtension(scanner.RawString, parseString),\n\n\tConstant(\"true\", true),\n\tConstant(\"false\", false),\n\n\tInfixOperator(\"==\", func(a, b interface{}) (interface{}, error) { return reflect.DeepEqual(a, b), nil }),\n\tInfixOperator(\"!=\", func(a, b interface{}) (interface{}, error) { return !reflect.DeepEqual(a, b), nil }),\n\tPrefixExtension('(', parseParentheses),\n\n\tPrecedence(\"??\", 0),\n\n\tPrecedence(\"||\", 20),\n\tPrecedence(\"&&\", 21),\n\n\tPrecedence(\"==\", 40),\n\tPrecedence(\"!=\", 40),\n\tPrecedence(\">\", 40),\n\tPrecedence(\">=\", 40),\n\tPrecedence(\"<\", 40),\n\tPrecedence(\"<=\", 40),\n\tPrecedence(\"=~\", 40),\n\tPrecedence(\"!~\", 40),\n\tPrecedence(\"in\", 40),\n\n\tPrecedence(\"^\", 60),\n\tPrecedence(\"&\", 60),\n\tPrecedence(\"|\", 60),\n\n\tPrecedence(\"<<\", 90),\n\tPrecedence(\">>\", 90),\n\n\tPrecedence(\"+\", 120),\n\tPrecedence(\"-\", 120),\n\n\tPrecedence(\"*\", 150),\n\tPrecedence(\"/\", 150),\n\tPrecedence(\"%\", 150),\n\n\tPrecedence(\"**\", 200),\n\n\tPrefixMetaPrefix(scanner.Ident, parseIdent),\n)\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/language.go",
    "content": "package gval\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"text/scanner\"\n\t\"unicode\"\n)\n\n// Language is an expression language\ntype Language struct {\n\tprefixes        map[interface{}]prefix\n\toperators       map[string]operator\n\toperatorSymbols map[rune]struct{}\n\tselector        func(Evaluables) Evaluable\n}\n\n// NewLanguage returns the union of given Languages as new Language.\nfunc NewLanguage(bases ...Language) Language {\n\tl := newLanguage()\n\tfor _, base := range bases {\n\t\tfor i, e := range base.prefixes {\n\t\t\tl.prefixes[i] = e\n\t\t}\n\t\tfor i, e := range base.operators {\n\t\t\tl.operators[i] = e.merge(l.operators[i])\n\t\t\tl.operators[i].initiate(i)\n\t\t}\n\t\tfor i := range base.operatorSymbols {\n\t\t\tl.operatorSymbols[i] = struct{}{}\n\t\t}\n\t\tif base.selector != nil {\n\t\t\tl.selector = base.selector\n\t\t}\n\t}\n\treturn l\n}\n\nfunc newLanguage() Language {\n\treturn Language{\n\t\tprefixes:        map[interface{}]prefix{},\n\t\toperators:       map[string]operator{},\n\t\toperatorSymbols: map[rune]struct{}{},\n\t}\n}\n\n// NewEvaluable returns an Evaluable for given expression in the specified language\nfunc (l Language) NewEvaluable(expression string) (Evaluable, error) {\n\tp := newParser(expression, l)\n\n\teval, err := p.ParseExpression(context.Background())\n\n\tif err == nil && p.isCamouflaged() && p.lastScan != scanner.EOF {\n\t\terr = p.camouflage\n\t}\n\n\tif err != nil {\n\t\tpos := p.scanner.Pos()\n\t\treturn nil, fmt.Errorf(\"parsing error: %s - %d:%d %s\", p.scanner.Position, pos.Line, pos.Column, err)\n\t}\n\treturn eval, nil\n}\n\n// Evaluate given parameter with given expression\nfunc (l Language) Evaluate(expression string, parameter interface{}) (interface{}, error) {\n\teval, err := l.NewEvaluable(expression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv, err := eval(context.Background(), parameter)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"can not evaluate %s: %v\", expression, err)\n\t}\n\treturn v, nil\n}\n\n// Function returns a Language with given function.\n// Function has no conversion for input types.\n//\n// If the function returns an error it must be the last return parameter.\n//\n// If the function has (without the error) more then one return parameter,\n// it returns them as []interface{}.\nfunc Function(name string, function interface{}) Language {\n\tl := newLanguage()\n\tl.prefixes[name] = func(c context.Context, p *Parser) (eval Evaluable, err error) {\n\t\targs := []Evaluable{}\n\t\tscan := p.Scan()\n\t\tswitch scan {\n\t\tcase '(':\n\t\t\targs, err = p.parseArguments(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tdefault:\n\t\t\tp.Camouflage(\"function call\", '(')\n\t\t}\n\t\treturn p.callFunc(toFunc(function), args...), nil\n\t}\n\treturn l\n}\n\n// Constant returns a Language with given constant\nfunc Constant(name string, value interface{}) Language {\n\tl := newLanguage()\n\tl.prefixes[l.makePrefixKey(name)] = func(c context.Context, p *Parser) (eval Evaluable, err error) {\n\t\treturn p.Const(value), nil\n\t}\n\treturn l\n}\n\n// PrefixExtension extends a Language\nfunc PrefixExtension(r rune, ext func(context.Context, *Parser) (Evaluable, error)) Language {\n\tl := newLanguage()\n\tl.prefixes[r] = ext\n\treturn l\n}\n\n// PrefixMetaPrefix chooses a Prefix to be executed\nfunc PrefixMetaPrefix(r rune, ext func(context.Context, *Parser) (call string, alternative func() (Evaluable, error), err error)) Language {\n\tl := newLanguage()\n\tl.prefixes[r] = func(c context.Context, p *Parser) (Evaluable, error) {\n\t\tcall, alternative, err := ext(c, p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif prefix, ok := p.prefixes[l.makePrefixKey(call)]; ok {\n\t\t\treturn prefix(c, p)\n\t\t}\n\t\treturn alternative()\n\t}\n\treturn l\n}\n\n//PrefixOperator returns a Language with given prefix\nfunc PrefixOperator(name string, e Evaluable) Language {\n\tl := newLanguage()\n\tl.prefixes[l.makePrefixKey(name)] = func(c context.Context, p *Parser) (Evaluable, error) {\n\t\teval, err := p.ParseNextExpression(c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprefix := func(c context.Context, v interface{}) (interface{}, error) {\n\t\t\ta, err := eval(c, v)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn e(c, a)\n\t\t}\n\t\tif eval.IsConst() {\n\t\t\tv, err := prefix(context.Background(), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprefix = p.Const(v)\n\t\t}\n\t\treturn prefix, nil\n\t}\n\treturn l\n}\n\n// PostfixOperator extends a Language.\nfunc PostfixOperator(name string, ext func(context.Context, *Parser, Evaluable) (Evaluable, error)) Language {\n\tl := newLanguage()\n\tl.operators[l.makeInfixKey(name)] = postfix{\n\t\tf: func(c context.Context, p *Parser, eval Evaluable, pre operatorPrecedence) (Evaluable, error) {\n\t\t\treturn ext(c, p, eval)\n\t\t},\n\t}\n\treturn l\n}\n\n// InfixOperator for two arbitrary values.\nfunc InfixOperator(name string, f func(a, b interface{}) (interface{}, error)) Language {\n\treturn newLanguageOperator(name, &infix{arbitrary: f})\n}\n\n// InfixShortCircuit operator is called after the left operand is evaluated.\nfunc InfixShortCircuit(name string, f func(a interface{}) (interface{}, bool)) Language {\n\treturn newLanguageOperator(name, &infix{shortCircuit: f})\n}\n\n// InfixTextOperator for two text values.\nfunc InfixTextOperator(name string, f func(a, b string) (interface{}, error)) Language {\n\treturn newLanguageOperator(name, &infix{text: f})\n}\n\n// InfixNumberOperator for two number values.\nfunc InfixNumberOperator(name string, f func(a, b float64) (interface{}, error)) Language {\n\treturn newLanguageOperator(name, &infix{number: f})\n}\n\n// InfixBoolOperator for two bool values.\nfunc InfixBoolOperator(name string, f func(a, b bool) (interface{}, error)) Language {\n\treturn newLanguageOperator(name, &infix{boolean: f})\n}\n\n// Precedence of operator. The Operator with higher operatorPrecedence is evaluated first.\nfunc Precedence(name string, operatorPrecendence uint8) Language {\n\treturn newLanguageOperator(name, operatorPrecedence(operatorPrecendence))\n}\n\n// InfixEvalOperator operates on the raw operands.\n// Therefore it cannot be combined with operators for other operand types.\nfunc InfixEvalOperator(name string, f func(a, b Evaluable) (Evaluable, error)) Language {\n\treturn newLanguageOperator(name, directInfix{infixBuilder: f})\n}\n\nfunc newLanguageOperator(name string, op operator) Language {\n\top.initiate(name)\n\tl := newLanguage()\n\tl.operators[l.makeInfixKey(name)] = op\n\treturn l\n}\n\nfunc (l *Language) makePrefixKey(key string) interface{} {\n\trunes := []rune(key)\n\tif len(runes) == 1 && !unicode.IsLetter(runes[0]) {\n\t\treturn runes[0]\n\t}\n\treturn key\n}\n\nfunc (l *Language) makeInfixKey(key string) string {\n\trunes := []rune(key)\n\tfor _, r := range runes {\n\t\tl.operatorSymbols[r] = struct{}{}\n\t}\n\treturn key\n}\n\n// VariableSelector returns a Language which uses given variable selector.\n// It must be combined with a Language that uses the vatiable selector. E.g. gval.Base().\nfunc VariableSelector(selector func(path Evaluables) Evaluable) Language {\n\tl := newLanguage()\n\tl.selector = selector\n\treturn l\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/operator.go",
    "content": "package gval\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\ntype stage struct {\n\tEvaluable\n\tinfixBuilder\n\toperatorPrecedence\n}\n\ntype stageStack []stage //operatorPrecedence in stacktStage is continuously, monotone ascending\n\nfunc (s *stageStack) push(b stage) error {\n\tfor len(*s) > 0 && s.peek().operatorPrecedence >= b.operatorPrecedence {\n\t\ta := s.pop()\n\t\teval, err := a.infixBuilder(a.Evaluable, b.Evaluable)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif a.IsConst() && b.IsConst() {\n\t\t\tv, err := eval(nil, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tb.Evaluable = constant(v)\n\t\t\tcontinue\n\t\t}\n\t\tb.Evaluable = eval\n\t}\n\t*s = append(*s, b)\n\treturn nil\n}\n\nfunc (s *stageStack) peek() stage {\n\treturn (*s)[len(*s)-1]\n}\n\nfunc (s *stageStack) pop() stage {\n\ta := s.peek()\n\t(*s) = (*s)[:len(*s)-1]\n\treturn a\n}\n\ntype infixBuilder func(a, b Evaluable) (Evaluable, error)\n\nfunc (l Language) isSymbolOperation(r rune) bool {\n\t_, in := l.operatorSymbols[r]\n\treturn in\n}\n\nfunc (op *infix) initiate(name string) {\n\tf := func(a, b interface{}) (interface{}, error) {\n\t\treturn nil, fmt.Errorf(\"invalid operation (%T) %s (%T)\", a, name, b)\n\t}\n\tif op.arbitrary != nil {\n\t\tf = op.arbitrary\n\t}\n\tfor _, typeConvertion := range []bool{true, false} {\n\t\tif op.text != nil && (!typeConvertion || op.arbitrary == nil) {\n\t\t\tf = getStringOpFunc(op.text, f, typeConvertion)\n\t\t}\n\t\tif op.boolean != nil {\n\t\t\tf = getBoolOpFunc(op.boolean, f, typeConvertion)\n\t\t}\n\t\tif op.number != nil {\n\t\t\tf = getFloatOpFunc(op.number, f, typeConvertion)\n\t\t}\n\t}\n\tif op.shortCircuit == nil {\n\t\top.builder = func(a, b Evaluable) (Evaluable, error) {\n\t\t\treturn func(c context.Context, x interface{}) (interface{}, error) {\n\t\t\t\ta, err := a(c, x)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tb, err := b(c, x)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn f(a, b)\n\t\t\t}, nil\n\t\t}\n\t\treturn\n\t}\n\tshortF := op.shortCircuit\n\top.builder = func(a, b Evaluable) (Evaluable, error) {\n\t\treturn func(c context.Context, x interface{}) (interface{}, error) {\n\t\t\ta, err := a(c, x)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif r, ok := shortF(a); ok {\n\t\t\t\treturn r, nil\n\t\t\t}\n\t\t\tb, err := b(c, x)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn f(a, b)\n\t\t}, nil\n\t}\n\treturn\n}\n\ntype opFunc func(a, b interface{}) (interface{}, error)\n\nfunc getStringOpFunc(s func(a, b string) (interface{}, error), f opFunc, typeConversion bool) opFunc {\n\tif typeConversion {\n\t\treturn func(a, b interface{}) (interface{}, error) {\n\t\t\tif a != nil && b != nil {\n\t\t\t\treturn s(fmt.Sprintf(\"%v\", a), fmt.Sprintf(\"%v\", b))\n\t\t\t}\n\t\t\treturn f(a, b)\n\t\t}\n\t}\n\treturn func(a, b interface{}) (interface{}, error) {\n\t\ts1, k := a.(string)\n\t\ts2, l := b.(string)\n\t\tif k && l {\n\t\t\treturn s(s1, s2)\n\t\t}\n\t\treturn f(a, b)\n\t}\n}\nfunc convertToBool(o interface{}) (bool, bool) {\n\tif b, ok := o.(bool); ok {\n\t\treturn b, true\n\t}\n\tv := reflect.ValueOf(o)\n\tfor o != nil && v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t\to = v.Interface()\n\t}\n\tif o == false || o == nil || o == \"false\" || o == \"FALSE\" {\n\t\treturn false, true\n\t}\n\tif o == true || o == \"true\" || o == \"TRUE\" {\n\t\treturn true, true\n\t}\n\tif f, ok := convertToFloat(o); ok {\n\t\treturn f != 0., true\n\t}\n\treturn false, false\n}\nfunc getBoolOpFunc(o func(a, b bool) (interface{}, error), f opFunc, typeConversion bool) opFunc {\n\tif typeConversion {\n\t\treturn func(a, b interface{}) (interface{}, error) {\n\t\t\tx, k := convertToBool(a)\n\t\t\ty, l := convertToBool(b)\n\t\t\tif k && l {\n\t\t\t\treturn o(x, y)\n\t\t\t}\n\t\t\treturn f(a, b)\n\t\t}\n\t}\n\treturn func(a, b interface{}) (interface{}, error) {\n\t\tx, k := a.(bool)\n\t\ty, l := b.(bool)\n\t\tif k && l {\n\t\t\treturn o(x, y)\n\t\t}\n\t\treturn f(a, b)\n\t}\n}\nfunc convertToFloat(o interface{}) (float64, bool) {\n\tif i, ok := o.(float64); ok {\n\t\treturn i, true\n\t}\n\tv := reflect.ValueOf(o)\n\tfor o != nil && v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t\to = v.Interface()\n\t}\n\tswitch v.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn float64(v.Int()), true\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn float64(v.Uint()), true\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float(), true\n\t}\n\tif s, ok := o.(string); ok {\n\t\tf, err := strconv.ParseFloat(s, 64)\n\t\tif err == nil {\n\t\t\treturn f, true\n\t\t}\n\t}\n\treturn 0, false\n}\nfunc getFloatOpFunc(o func(a, b float64) (interface{}, error), f opFunc, typeConversion bool) opFunc {\n\tif typeConversion {\n\t\treturn func(a, b interface{}) (interface{}, error) {\n\t\t\tx, k := convertToFloat(a)\n\t\t\ty, l := convertToFloat(b)\n\t\t\tif k && l {\n\t\t\t\treturn o(x, y)\n\t\t\t}\n\n\t\t\treturn f(a, b)\n\t\t}\n\t}\n\treturn func(a, b interface{}) (interface{}, error) {\n\t\tx, k := a.(float64)\n\t\ty, l := b.(float64)\n\t\tif k && l {\n\t\t\treturn o(x, y)\n\t\t}\n\n\t\treturn f(a, b)\n\t}\n}\n\ntype operator interface {\n\tmerge(operator) operator\n\tprecedence() operatorPrecedence\n\tinitiate(name string)\n}\n\ntype operatorPrecedence uint8\n\nfunc (pre operatorPrecedence) merge(op operator) operator {\n\tif op, ok := op.(operatorPrecedence); ok {\n\t\tif op > pre {\n\t\t\treturn op\n\t\t}\n\t\treturn pre\n\t}\n\tif op == nil {\n\t\treturn pre\n\t}\n\treturn op.merge(pre)\n}\n\nfunc (pre operatorPrecedence) precedence() operatorPrecedence {\n\treturn pre\n}\n\nfunc (pre operatorPrecedence) initiate(name string) {}\n\ntype infix struct {\n\toperatorPrecedence\n\tnumber       func(a, b float64) (interface{}, error)\n\tboolean      func(a, b bool) (interface{}, error)\n\ttext         func(a, b string) (interface{}, error)\n\tarbitrary    func(a, b interface{}) (interface{}, error)\n\tshortCircuit func(a interface{}) (interface{}, bool)\n\tbuilder      infixBuilder\n}\n\nfunc (op infix) merge(op2 operator) operator {\n\tswitch op2 := op2.(type) {\n\tcase *infix:\n\t\tif op2.number != nil {\n\t\t\top.number = op2.number\n\t\t}\n\t\tif op2.boolean != nil {\n\t\t\top.boolean = op2.boolean\n\t\t}\n\t\tif op2.text != nil {\n\t\t\top.text = op2.text\n\t\t}\n\t\tif op2.arbitrary != nil {\n\t\t\top.arbitrary = op2.arbitrary\n\t\t}\n\t\tif op2.shortCircuit != nil {\n\t\t\top.shortCircuit = op2.shortCircuit\n\t\t}\n\t}\n\tif op2 != nil && op2.precedence() > op.operatorPrecedence {\n\t\top.operatorPrecedence = op2.precedence()\n\t}\n\treturn &op\n}\n\ntype directInfix struct {\n\toperatorPrecedence\n\tinfixBuilder\n}\n\nfunc (op directInfix) merge(op2 operator) operator {\n\tswitch op2 := op2.(type) {\n\tcase operatorPrecedence:\n\t\top.operatorPrecedence = op2\n\t}\n\tif op2 != nil && op2.precedence() > op.operatorPrecedence {\n\t\top.operatorPrecedence = op2.precedence()\n\t}\n\treturn op\n}\n\ntype prefix func(context.Context, *Parser) (Evaluable, error)\n\ntype postfix struct {\n\toperatorPrecedence\n\tf func(context.Context, *Parser, Evaluable, operatorPrecedence) (Evaluable, error)\n}\n\nfunc (op postfix) merge(op2 operator) operator {\n\tswitch op2 := op2.(type) {\n\tcase postfix:\n\t\tif op2.f != nil {\n\t\t\top.f = op2.f\n\t\t}\n\t}\n\tif op2 != nil && op2.precedence() > op.operatorPrecedence {\n\t\top.operatorPrecedence = op2.precedence()\n\t}\n\treturn op\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/parse.go",
    "content": "package gval\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"text/scanner\"\n)\n\n//ParseExpression scans an expression into an Evaluable.\nfunc (p *Parser) ParseExpression(c context.Context) (eval Evaluable, err error) {\n\tstack := stageStack{}\n\tfor {\n\t\teval, err = p.ParseNextExpression(c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif stage, err := p.parseOperator(c, &stack, eval); err != nil {\n\t\t\treturn nil, err\n\t\t} else if err = stack.push(stage); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif stack.peek().infixBuilder == nil {\n\t\t\treturn stack.pop().Evaluable, nil\n\t\t}\n\t}\n}\n\n//ParseNextExpression scans the expression ignoring following operators\nfunc (p *Parser) ParseNextExpression(c context.Context) (eval Evaluable, err error) {\n\tscan := p.Scan()\n\tex, ok := p.prefixes[scan]\n\tif !ok {\n\t\treturn nil, p.Expected(\"extensions\")\n\t}\n\treturn ex(c, p)\n}\n\nfunc parseString(c context.Context, p *Parser) (Evaluable, error) {\n\ts, err := strconv.Unquote(p.TokenText())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse string: %s\", err)\n\t}\n\treturn p.Const(s), nil\n}\n\nfunc parseNumber(c context.Context, p *Parser) (Evaluable, error) {\n\tn, err := strconv.ParseFloat(p.TokenText(), 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.Const(n), nil\n}\n\nfunc parseParentheses(c context.Context, p *Parser) (Evaluable, error) {\n\teval, err := p.ParseExpression(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch p.Scan() {\n\tcase ')':\n\t\treturn eval, nil\n\tdefault:\n\t\treturn nil, p.Expected(\"parentheses\", ')')\n\t}\n}\n\nfunc (p *Parser) parseOperator(c context.Context, stack *stageStack, eval Evaluable) (st stage, err error) {\n\tfor {\n\t\tscan := p.Scan()\n\t\top := p.TokenText()\n\t\tmustOp := false\n\t\tif p.isSymbolOperation(scan) {\n\t\t\tscan = p.Peek()\n\t\t\tfor p.isSymbolOperation(scan) {\n\t\t\t\tmustOp = true\n\t\t\t\top += string(scan)\n\t\t\t\tp.Next()\n\t\t\t\tscan = p.Peek()\n\t\t\t}\n\t\t} else if scan != scanner.Ident {\n\t\t\tp.Camouflage(\"operator\")\n\t\t\treturn stage{Evaluable: eval}, nil\n\t\t}\n\t\toperator, _ := p.operators[op]\n\t\tswitch operator := operator.(type) {\n\t\tcase *infix:\n\t\t\treturn stage{\n\t\t\t\tEvaluable:          eval,\n\t\t\t\tinfixBuilder:       operator.builder,\n\t\t\t\toperatorPrecedence: operator.operatorPrecedence,\n\t\t\t}, nil\n\t\tcase directInfix:\n\t\t\treturn stage{\n\t\t\t\tEvaluable:          eval,\n\t\t\t\tinfixBuilder:       operator.infixBuilder,\n\t\t\t\toperatorPrecedence: operator.operatorPrecedence,\n\t\t\t}, nil\n\t\tcase postfix:\n\t\t\tif err = stack.push(stage{\n\t\t\t\toperatorPrecedence: operator.operatorPrecedence,\n\t\t\t\tEvaluable:          eval,\n\t\t\t}); err != nil {\n\t\t\t\treturn stage{}, err\n\t\t\t}\n\t\t\teval, err = operator.f(c, p, stack.pop().Evaluable, operator.operatorPrecedence)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif !mustOp {\n\t\t\tp.Camouflage(\"operator\")\n\t\t\treturn stage{Evaluable: eval}, nil\n\t\t}\n\t\treturn stage{}, fmt.Errorf(\"unknown operator %s\", op)\n\t}\n}\n\nfunc parseIdent(c context.Context, p *Parser) (call string, alternative func() (Evaluable, error), err error) {\n\ttoken := p.TokenText()\n\treturn token,\n\t\tfunc() (Evaluable, error) {\n\t\t\tfullname := token\n\n\t\t\tkeys := []Evaluable{p.Const(token)}\n\t\t\tfor {\n\t\t\t\tscan := p.Scan()\n\t\t\t\tswitch scan {\n\t\t\t\tcase '.':\n\t\t\t\t\tscan = p.Scan()\n\t\t\t\t\tswitch scan {\n\t\t\t\t\tcase scanner.Ident:\n\t\t\t\t\t\ttoken = p.TokenText()\n\t\t\t\t\t\tkeys = append(keys, p.Const(token))\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn nil, p.Expected(\"field\", scanner.Ident)\n\t\t\t\t\t}\n\t\t\t\tcase '(':\n\t\t\t\t\targs, err := p.parseArguments(c)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\treturn p.callEvaluable(fullname, p.Var(keys...), args...), nil\n\t\t\t\tcase '[':\n\t\t\t\t\tkey, err := p.ParseExpression(c)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tswitch p.Scan() {\n\t\t\t\t\tcase ']':\n\t\t\t\t\t\tkeys = append(keys, key)\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn nil, p.Expected(\"array key\", ']')\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tp.Camouflage(\"variable\", '.', '(', '[')\n\t\t\t\t\treturn p.Var(keys...), nil\n\t\t\t\t}\n\t\t\t}\n\t\t}, nil\n\n}\n\nfunc (p *Parser) parseArguments(c context.Context) (args []Evaluable, err error) {\n\tif p.Scan() == ')' {\n\t\treturn\n\t}\n\tp.Camouflage(\"scan arguments\", ')')\n\tfor {\n\t\targ, err := p.ParseExpression(c)\n\t\targs = append(args, arg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch p.Scan() {\n\t\tcase ')':\n\t\t\treturn args, nil\n\t\tcase ',':\n\t\tdefault:\n\t\t\treturn nil, p.Expected(\"arguments\", ')', ',')\n\t\t}\n\t}\n}\n\nfunc inArray(a, b interface{}) (interface{}, error) {\n\tcol, ok := b.([]interface{})\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected type []interface{} for in operator but got %T\", b)\n\t}\n\tfor _, value := range col {\n\t\tif reflect.DeepEqual(a, value) {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\nfunc parseIf(c context.Context, p *Parser, e Evaluable) (Evaluable, error) {\n\ta, err := p.ParseExpression(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb := p.Const(nil)\n\tswitch p.Scan() {\n\tcase ':':\n\t\tb, err = p.ParseExpression(c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase scanner.EOF:\n\tdefault:\n\t\treturn nil, p.Expected(\"<> ? <> : <>\", ':', scanner.EOF)\n\t}\n\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\tx, err := e(c, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif x == false || x == nil {\n\t\t\treturn b(c, v)\n\t\t}\n\t\treturn a(c, v)\n\t}, nil\n}\n\nfunc parseJSONArray(c context.Context, p *Parser) (Evaluable, error) {\n\tevals := []Evaluable{}\n\tfor {\n\t\tswitch p.Scan() {\n\t\tdefault:\n\t\t\tp.Camouflage(\"array\", ',', ']')\n\t\t\teval, err := p.ParseExpression(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tevals = append(evals, eval)\n\t\tcase ',':\n\t\tcase ']':\n\t\t\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\t\t\tvs := make([]interface{}, len(evals))\n\t\t\t\tfor i, e := range evals {\n\t\t\t\t\teval, err := e(c, v)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tvs[i] = eval\n\t\t\t\t}\n\n\t\t\t\treturn vs, nil\n\t\t\t}, nil\n\t\t}\n\t}\n}\n\nfunc parseJSONObject(c context.Context, p *Parser) (Evaluable, error) {\n\ttype kv struct {\n\t\tkey   Evaluable\n\t\tvalue Evaluable\n\t}\n\tevals := []kv{}\n\tfor {\n\t\tswitch p.Scan() {\n\t\tdefault:\n\t\t\tp.Camouflage(\"object\", ',', '}')\n\t\t\tkey, err := p.ParseExpression(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif p.Scan() != ':' {\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, p.Expected(\"object\", ':')\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue, err := p.ParseExpression(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tevals = append(evals, kv{key, value})\n\t\tcase ',':\n\t\tcase '}':\n\t\t\treturn func(c context.Context, v interface{}) (interface{}, error) {\n\t\t\t\tvs := map[string]interface{}{}\n\t\t\t\tfor _, e := range evals {\n\t\t\t\t\tvalue, err := e.value(c, v)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tkey, err := e.key.EvalString(c, v)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tvs[key] = value\n\t\t\t\t}\n\t\t\t\treturn vs, nil\n\t\t\t}, nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/gval/parser.go",
    "content": "package gval\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"text/scanner\"\n\t\"unicode\"\n)\n\n//Parser parses expressions in a Language into an Evaluable\ntype Parser struct {\n\tscanner scanner.Scanner\n\tLanguage\n\tlastScan   rune\n\tcamouflage error\n}\n\nfunc newParser(expression string, l Language) *Parser {\n\tsc := scanner.Scanner{}\n\tsc.Init(strings.NewReader(expression))\n\tsc.Error = func(*scanner.Scanner, string) { return }\n\tsc.IsIdentRune = func(r rune, pos int) bool { return unicode.IsLetter(r) || r == '_' || (pos > 0 && unicode.IsDigit(r)) }\n\tsc.Filename = expression + \"\\t\"\n\treturn &Parser{scanner: sc, Language: l}\n}\n\n// Scan reads the next token or Unicode character from source and returns it.\n// It only recognizes tokens t for which the respective Mode bit (1<<-t) is set.\n// It returns scanner.EOF at the end of the source.\nfunc (p *Parser) Scan() rune {\n\tif p.isCamouflaged() {\n\t\tp.camouflage = nil\n\t\treturn p.lastScan\n\t}\n\tp.camouflage = nil\n\tp.lastScan = p.scanner.Scan()\n\treturn p.lastScan\n}\n\nfunc (p *Parser) isCamouflaged() bool {\n\treturn p.camouflage != nil && p.camouflage != errCamouflageAfterNext\n}\n\n// Camouflage rewind the last Scan(). The Parser holds the camouflage error until\n// the next Scan()\n// Do not call Rewind() on a camouflaged Parser\nfunc (p *Parser) Camouflage(unit string, expected ...rune) {\n\tif p.isCamouflaged() {\n\t\tpanic(fmt.Errorf(\"can only Camouflage() after Scan(): %v\", p.camouflage))\n\t}\n\tp.camouflage = p.Expected(unit, expected...)\n\treturn\n}\n\n// Peek returns the next Unicode character in the source without advancing\n// the scanner. It returns EOF if the scanner's position is at the last\n// character of the source.\n// Do not call Peek() on a camouflaged Parser\nfunc (p *Parser) Peek() rune {\n\tif p.isCamouflaged() {\n\t\tpanic(\"can not Peek() on camouflaged Parser\")\n\t}\n\treturn p.scanner.Peek()\n}\n\nvar errCamouflageAfterNext = fmt.Errorf(\"Camouflage() after Next()\")\n\n// Next reads and returns the next Unicode character.\n// It returns EOF at the end of the source.\n// Do not call Next() on a camouflaged Parser\nfunc (p *Parser) Next() rune {\n\tif p.isCamouflaged() {\n\t\tpanic(\"can not Next() on camouflaged Parser\")\n\t}\n\tp.camouflage = errCamouflageAfterNext\n\treturn p.scanner.Next()\n}\n\n// TokenText returns the string corresponding to the most recently scanned token.\n// Valid after calling Scan().\nfunc (p *Parser) TokenText() string {\n\treturn p.scanner.TokenText()\n}\n\n//Expected returns an error signaling an unexpected Scan() result\nfunc (p *Parser) Expected(unit string, expected ...rune) error {\n\treturn unexpectedRune{unit, expected, p.lastScan}\n}\n\ntype unexpectedRune struct {\n\tunit     string\n\texpected []rune\n\tgot      rune\n}\n\nfunc (err unexpectedRune) Error() string {\n\texp := bytes.Buffer{}\n\trunes := err.expected\n\tswitch len(runes) {\n\tdefault:\n\t\tfor _, r := range runes[:len(runes)-2] {\n\t\t\texp.WriteString(scanner.TokenString(r))\n\t\t\texp.WriteString(\", \")\n\t\t}\n\t\tfallthrough\n\tcase 2:\n\t\texp.WriteString(scanner.TokenString(runes[len(runes)-2]))\n\t\texp.WriteString(\" or \")\n\t\tfallthrough\n\tcase 1:\n\t\texp.WriteString(scanner.TokenString(runes[len(runes)-1]))\n\tcase 0:\n\t\treturn fmt.Sprintf(\"unexpected %s while scanning %s\", scanner.TokenString(err.got), err.unit)\n\t}\n\treturn fmt.Sprintf(\"unexpected %s while scanning %s expected %s\", scanner.TokenString(err.got), err.unit, exp.String())\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\ncoverage.out\n\nmanual_test.go\n*.out\n*.err\n\n.vscode"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/.travis.yml",
    "content": "language: go\n\nscript: ./test.sh\n\ngo:\n  - 1.9\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/LICENSE",
    "content": "Copyright (c) 2017, Paessler AG <support@paessler.com>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/README.md",
    "content": "JSONPath\n====\n\n[![Build Status](https://api.travis-ci.org/PaesslerAG/jsonpath.svg?branch=master)](https://travis-ci.org/PaesslerAG/jsonpath)\n[![Godoc](https://godoc.org/github.com/PaesslerAG/jsonpath?status.png)](https://godoc.org/github.com/PaesslerAG/jsonpath)\n\nJSONPath is a complete implementation of [http://goessner.net/articles/JsonPath/](http://goessner.net/articles/JsonPath/).\nJSONPath can be combined with a script language. In many web samples it's combined with javascript. This framework comes without a script language but can be easily extended with one. See [example](https://godoc.org/github.com/PaesslerAG/jsonpath#example-package--Gval).\n\nIt is based on [Gval](https://github.com/PaesslerAG/gval) and can be combined with the modular expression languages based on gval.\nSo for script features like multiply, length, regex or many more take a look at the documentation in the [GoDoc](https://godoc.org/github.com/PaesslerAG/jsonpath)."
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/jsonpath.go",
    "content": "// Package jsonpath is an implementation of http://goessner.net/articles/JsonPath/\n// If a JSONPath contains one of\n// [key1, key2 ...], .., *, [min:max], [min:max:step], (? expression)\n// all matchs are listed in an []interface{}\n//\n// The package comes with an extension of JSONPath to access the wildcard values of a match.\n// If the JSONPath is used inside of a JSON object, you can use placeholder '#' or '#i' with natural number i\n// to access all wildcards values or the ith wildcard\n//\n// This package can be extended with gval modules for script features like multiply, length, regex or many more.\n// So take a look at github.com/PaesslerAG/gval.\npackage jsonpath\n\nimport (\n\t\"context\"\n\n\t\"github.com/PaesslerAG/gval\"\n)\n\n// New returns an selector for given JSONPath\nfunc New(path string) (gval.Evaluable, error) {\n\treturn lang.NewEvaluable(path)\n}\n\n//Get executes given JSONPath on given value\nfunc Get(path string, value interface{}) (interface{}, error) {\n\teval, err := lang.NewEvaluable(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn eval(context.Background(), value)\n}\n\nvar lang = gval.NewLanguage(\n\tgval.Base(),\n\tgval.PrefixExtension('$', parseRootPath),\n\tgval.PrefixExtension('@', parseCurrentPath),\n)\n\n//Language is the JSONPath Language\nfunc Language() gval.Language {\n\treturn lang\n}\n\nvar placeholderExtension = gval.NewLanguage(\n\tlang,\n\tgval.PrefixExtension('{', parseJSONObject),\n\tgval.PrefixExtension('#', parsePlaceholder),\n)\n\n//PlaceholderExtension is the JSONPath Language with placeholder\nfunc PlaceholderExtension() gval.Language {\n\treturn placeholderExtension\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/parse.go",
    "content": "package jsonpath\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"text/scanner\"\n\n\t\"github.com/PaesslerAG/gval\"\n)\n\ntype parser struct {\n\t*gval.Parser\n\tpath path\n}\n\nfunc parseRootPath(ctx context.Context, gParser *gval.Parser) (r gval.Evaluable, err error) {\n\tp := newParser(gParser)\n\treturn p.parse(ctx)\n}\n\nfunc parseCurrentPath(ctx context.Context, gParser *gval.Parser) (r gval.Evaluable, err error) {\n\tp := newParser(gParser)\n\tp.appendPlainSelector(currentElementSelector())\n\treturn p.parse(ctx)\n}\n\nfunc newParser(p *gval.Parser) *parser {\n\treturn &parser{Parser: p, path: plainPath{}}\n}\n\nfunc (p *parser) parse(c context.Context) (r gval.Evaluable, err error) {\n\terr = p.parsePath(c)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.path.evaluate, nil\n}\n\nfunc (p *parser) parsePath(c context.Context) error {\n\tswitch p.Scan() {\n\tcase '.':\n\t\treturn p.parseSelect(c)\n\tcase '[':\n\t\tkeys, seperator, err := p.parseBracket(c)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch seperator {\n\t\tcase ':':\n\t\t\tif len(keys) > 3 {\n\t\t\t\treturn fmt.Errorf(\"range query has at least the parameter [min:max:step]\")\n\t\t\t}\n\t\t\tkeys = append(keys, []gval.Evaluable{\n\t\t\t\tp.Const(0), p.Const(float64(math.MaxInt32)), p.Const(1)}[len(keys):]...)\n\t\t\tp.appendAmbiguousSelector(rangeSelector(keys[0], keys[1], keys[2]))\n\t\tcase '?':\n\t\t\tif len(keys) != 1 {\n\t\t\t\treturn fmt.Errorf(\"filter needs exactly one key\")\n\t\t\t}\n\t\t\tp.appendAmbiguousSelector(filterSelector(keys[0]))\n\t\tdefault:\n\t\t\tif len(keys) == 1 {\n\t\t\t\tp.appendPlainSelector(directSelector(keys[0]))\n\t\t\t} else {\n\t\t\t\tp.appendAmbiguousSelector(multiSelector(keys))\n\t\t\t}\n\t\t}\n\t\treturn p.parsePath(c)\n\tcase '(':\n\t\treturn p.parseScript(c)\n\tdefault:\n\t\tp.Camouflage(\"jsonpath\", '.', '[', '(')\n\t\treturn nil\n\t}\n}\n\nfunc (p *parser) parseSelect(c context.Context) error {\n\tscan := p.Scan()\n\tswitch scan {\n\tcase scanner.Ident:\n\t\tp.appendPlainSelector(directSelector(p.Const(p.TokenText())))\n\t\treturn p.parsePath(c)\n\tcase '.':\n\t\tp.appendAmbiguousSelector(mapperSelector())\n\t\treturn p.parseMapper(c)\n\tcase '*':\n\t\tp.appendAmbiguousSelector(starSelector())\n\t\treturn p.parsePath(c)\n\tdefault:\n\t\treturn p.Expected(\"JSON select\", scanner.Ident, '.', '*')\n\t}\n}\n\nfunc (p *parser) parseBracket(c context.Context) (keys []gval.Evaluable, seperator rune, err error) {\n\tfor {\n\t\tscan := p.Scan()\n\t\tskipScan := false\n\t\tswitch scan {\n\t\tcase '?':\n\t\t\tskipScan = true\n\t\tcase ':':\n\t\t\ti := float64(0)\n\t\t\tif len(keys) == 1 {\n\t\t\t\ti = math.MaxInt32\n\t\t\t}\n\t\t\tkeys = append(keys, p.Const(i))\n\t\t\tskipScan = true\n\t\tcase '*':\n\t\t\tif p.Scan() != ']' {\n\t\t\t\treturn nil, 0, p.Expected(\"JSON bracket star\", ']')\n\t\t\t}\n\t\t\treturn []gval.Evaluable{}, 0, nil\n\t\tcase ']':\n\t\t\tif seperator == ':' {\n\t\t\t\tskipScan = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\tp.Camouflage(\"jsonpath brackets\")\n\t\t\tkey, err := p.ParseExpression(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, 0, err\n\t\t\t}\n\t\t\tkeys = append(keys, key)\n\t\t}\n\t\tif !skipScan {\n\t\t\tscan = p.Scan()\n\t\t}\n\t\tif seperator == 0 {\n\t\t\tseperator = scan\n\t\t}\n\t\tswitch scan {\n\t\tcase ':', ',':\n\t\tcase ']':\n\t\t\treturn\n\t\tcase '?':\n\t\t\tif len(keys) != 0 {\n\t\t\t\treturn nil, 0, p.Expected(\"JSON filter\", ']')\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, 0, p.Expected(\"JSON bracket separator\", ':', ',')\n\t\t}\n\t\tif seperator != scan {\n\t\t\treturn nil, 0, fmt.Errorf(\"mixed %v and %v in JSON bracket\", seperator, scan)\n\t\t}\n\t}\n}\n\nfunc (p *parser) parseMapper(c context.Context) error {\n\tscan := p.Scan()\n\tswitch scan {\n\tcase scanner.Ident:\n\t\tp.appendPlainSelector(directSelector(p.Const(p.TokenText())))\n\tcase '[':\n\t\tkeys, seperator, err := p.parseBracket(c)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch seperator {\n\t\tcase ':':\n\t\t\treturn fmt.Errorf(\"mapper can not be combined with range query\")\n\t\tcase '?':\n\t\t\tif len(keys) != 1 {\n\t\t\t\treturn fmt.Errorf(\"filter needs exactly one key\")\n\t\t\t}\n\t\t\tp.appendAmbiguousSelector(filterSelector(keys[0]))\n\t\tdefault:\n\t\t\tp.appendAmbiguousSelector(multiSelector(keys))\n\t\t}\n\tcase '*':\n\t\tp.appendAmbiguousSelector(starSelector())\n\tcase '(':\n\t\treturn p.parseScript(c)\n\tdefault:\n\t\treturn p.Expected(\"JSON mapper\", '[', scanner.Ident, '*')\n\t}\n\treturn p.parsePath(c)\n}\n\nfunc (p *parser) parseScript(c context.Context) error {\n\tscript, err := p.ParseExpression(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif p.Scan() != ')' {\n\t\treturn p.Expected(\"jsnopath script\", ')')\n\t}\n\tp.appendPlainSelector(newScript(script))\n\treturn p.parsePath(c)\n}\n\nfunc (p *parser) appendPlainSelector(next plainSelector) {\n\tp.path = p.path.withPlainSelector(next)\n}\n\nfunc (p *parser) appendAmbiguousSelector(next ambiguousSelector) {\n\tp.path = p.path.withAmbiguousSelector(next)\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/path.go",
    "content": "package jsonpath\r\n\r\nimport \"context\"\r\n\r\ntype path interface {\r\n\tevaluate(c context.Context, parameter interface{}) (interface{}, error)\r\n\tvisitMatchs(c context.Context, r interface{}, visit pathMatcher)\r\n\twithPlainSelector(plainSelector) path\r\n\twithAmbiguousSelector(ambiguousSelector) path\r\n}\r\n\r\ntype plainPath []plainSelector\r\n\r\ntype ambiguousMatcher func(key, v interface{})\r\n\r\nfunc (p plainPath) evaluate(ctx context.Context, root interface{}) (interface{}, error) {\r\n\treturn p.evaluatePath(ctx, root, root)\r\n}\r\n\r\nfunc (p plainPath) evaluatePath(ctx context.Context, root, value interface{}) (interface{}, error) {\r\n\tvar err error\r\n\tfor _, sel := range p {\r\n\t\tvalue, err = sel(ctx, root, value)\r\n\t\tif err != nil {\r\n\t\t\treturn nil, err\r\n\t\t}\r\n\t}\r\n\treturn value, nil\r\n}\r\n\r\nfunc (p plainPath) matcher(ctx context.Context, r interface{}, match ambiguousMatcher) ambiguousMatcher {\r\n\tif len(p) == 0 {\r\n\t\treturn match\r\n\t}\r\n\treturn func(k, v interface{}) {\r\n\t\tres, err := p.evaluatePath(ctx, r, v)\r\n\t\tif err == nil {\r\n\t\t\tmatch(k, res)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc (p plainPath) visitMatchs(ctx context.Context, r interface{}, visit pathMatcher) {\r\n\tres, err := p.evaluatePath(ctx, r, r)\r\n\tif err == nil {\r\n\t\tvisit(nil, res)\r\n\t}\r\n}\r\n\r\nfunc (p plainPath) withPlainSelector(selector plainSelector) path {\r\n\treturn append(p, selector)\r\n}\r\nfunc (p plainPath) withAmbiguousSelector(selector ambiguousSelector) path {\r\n\treturn &ambiguousPath{\r\n\t\tparent: p,\r\n\t\tbranch: selector,\r\n\t}\r\n}\r\n\r\ntype ambiguousPath struct {\r\n\tparent path\r\n\tbranch ambiguousSelector\r\n\tending plainPath\r\n}\r\n\r\nfunc (p *ambiguousPath) evaluate(ctx context.Context, parameter interface{}) (interface{}, error) {\r\n\tmatchs := []interface{}{}\r\n\tp.visitMatchs(ctx, parameter, func(keys []interface{}, match interface{}) {\r\n\t\tmatchs = append(matchs, match)\r\n\t})\r\n\treturn matchs, nil\r\n}\r\n\r\nfunc (p *ambiguousPath) visitMatchs(ctx context.Context, r interface{}, visit pathMatcher) {\r\n\tp.parent.visitMatchs(ctx, r, func(keys []interface{}, v interface{}) {\r\n\t\tp.branch(ctx, r, v, p.ending.matcher(ctx, r, visit.matcher(keys)))\r\n\t})\r\n}\r\n\r\nfunc (p *ambiguousPath) branchMatcher(ctx context.Context, r interface{}, m ambiguousMatcher) ambiguousMatcher {\r\n\treturn func(k, v interface{}) {\r\n\t\tp.branch(ctx, r, v, m)\r\n\t}\r\n}\r\n\r\nfunc (p *ambiguousPath) withPlainSelector(selector plainSelector) path {\r\n\tp.ending = append(p.ending, selector)\r\n\treturn p\r\n}\r\nfunc (p *ambiguousPath) withAmbiguousSelector(selector ambiguousSelector) path {\r\n\treturn &ambiguousPath{\r\n\t\tparent: p,\r\n\t\tbranch: selector,\r\n\t}\r\n}\r\n\r\ntype pathMatcher func(keys []interface{}, match interface{})\r\n\r\nfunc (m pathMatcher) matcher(keys []interface{}) ambiguousMatcher {\r\n\treturn func(key, match interface{}) {\r\n\t\tm(append(keys, key), match)\r\n\t}\r\n}\r\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/placeholder.go",
    "content": "package jsonpath\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"text/scanner\"\n\n\t\"github.com/PaesslerAG/gval\"\n)\n\ntype keyValueVisitor func(key string, value interface{})\n\ntype jsonObject interface {\n\tvisitElements(c context.Context, v interface{}, visit keyValueVisitor) error\n}\n\ntype jsonObjectSlice []jsonObject\n\ntype keyValuePair struct {\n\tkey   gval.Evaluable\n\tvalue gval.Evaluable\n}\n\ntype keyValueMatcher struct {\n\tkey     gval.Evaluable\n\tmatcher func(c context.Context, r interface{}, visit pathMatcher)\n}\n\nfunc parseJSONObject(ctx context.Context, p *gval.Parser) (gval.Evaluable, error) {\n\tevals := jsonObjectSlice{}\n\tfor {\n\t\tswitch p.Scan() {\n\t\tdefault:\n\t\t\thasWildcard := false\n\n\t\t\tp.Camouflage(\"object\", ',', '}')\n\t\t\tkey, err := p.ParseExpression(context.WithValue(ctx, hasPlaceholdersContextKey{}, &hasWildcard))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif p.Scan() != ':' {\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, p.Expected(\"object\", ':')\n\t\t\t\t}\n\t\t\t}\n\t\t\te, err := parseJSONObjectElement(ctx, p, hasWildcard, key)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tevals.addElements(e)\n\t\tcase ',':\n\t\tcase '}':\n\t\t\treturn evals.evaluable, nil\n\t\t}\n\t}\n}\n\nfunc parseJSONObjectElement(ctx context.Context, gParser *gval.Parser, hasWildcard bool, key gval.Evaluable) (jsonObject, error) {\n\tif hasWildcard {\n\t\tp := newParser(gParser)\n\t\tswitch gParser.Scan() {\n\t\tcase '$':\n\t\tcase '@':\n\t\t\tp.appendPlainSelector(currentElementSelector())\n\t\tdefault:\n\t\t\treturn nil, p.Expected(\"JSONPath key and value\")\n\t\t}\n\n\t\tif err := p.parsePath(ctx); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn keyValueMatcher{key, p.path.visitMatchs}, nil\n\t}\n\tvalue, err := gParser.ParseExpression(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn keyValuePair{key, value}, nil\n}\n\nfunc (kv keyValuePair) visitElements(c context.Context, v interface{}, visit keyValueVisitor) error {\n\tvalue, err := kv.value(c, v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tkey, err := kv.key.EvalString(c, v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvisit(key, value)\n\treturn nil\n}\n\nfunc (kv keyValueMatcher) visitElements(c context.Context, v interface{}, visit keyValueVisitor) (err error) {\n\tkv.matcher(c, v, func(keys []interface{}, match interface{}) {\n\t\tkey, er := kv.key.EvalString(context.WithValue(c, placeholdersContextKey{}, keys), v)\n\t\tif er != nil {\n\t\t\terr = er\n\t\t}\n\t\tvisit(key, match)\n\t})\n\treturn\n}\n\nfunc (j *jsonObjectSlice) addElements(e jsonObject) {\n\t*j = append(*j, e)\n}\n\nfunc (j jsonObjectSlice) evaluable(c context.Context, v interface{}) (interface{}, error) {\n\tvs := map[string]interface{}{}\n\n\terr := j.visitElements(c, v, func(key string, value interface{}) { vs[key] = value })\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn vs, nil\n}\n\nfunc (j jsonObjectSlice) visitElements(ctx context.Context, v interface{}, visit keyValueVisitor) (err error) {\n\tfor _, e := range j {\n\t\tif err := e.visitElements(ctx, v, visit); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc parsePlaceholder(c context.Context, p *gval.Parser) (gval.Evaluable, error) {\n\thasWildcard := c.Value(hasPlaceholdersContextKey{})\n\tif hasWildcard == nil {\n\t\treturn nil, fmt.Errorf(\"JSONPath placeholder must only be used in an JSON object key\")\n\t}\n\t*(hasWildcard.(*bool)) = true\n\tswitch p.Scan() {\n\tcase scanner.Int:\n\t\tid, err := strconv.Atoi(p.TokenText())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn placeholder(id).evaluable, nil\n\tdefault:\n\t\tp.Camouflage(\"JSONPath placeholder\")\n\t\treturn allPlaceholders.evaluable, nil\n\t}\n}\n\ntype hasPlaceholdersContextKey struct{}\n\ntype placeholdersContextKey struct{}\n\ntype placeholder int\n\nconst allPlaceholders = placeholder(-1)\n\nfunc (key placeholder) evaluable(c context.Context, v interface{}) (interface{}, error) {\n\twildcards, ok := c.Value(placeholdersContextKey{}).([]interface{})\n\tif !ok || len(wildcards) <= int(key) {\n\t\treturn nil, fmt.Errorf(\"JSONPath placeholder #%d is not available\", key)\n\t}\n\tif key == allPlaceholders {\n\t\tsb := bytes.Buffer{}\n\t\tsb.WriteString(\"$\")\n\t\tquoteWildcardValues(&sb, wildcards)\n\t\treturn sb.String(), nil\n\t}\n\treturn wildcards[int(key)], nil\n}\n\nfunc quoteWildcardValues(sb *bytes.Buffer, wildcards []interface{}) {\n\tfor _, w := range wildcards {\n\t\tif wildcards, ok := w.([]interface{}); ok {\n\t\t\tquoteWildcardValues(sb, wildcards)\n\t\t\tcontinue\n\t\t}\n\t\tsb.WriteString(fmt.Sprintf(\"[%v]\",\n\t\t\tstrconv.Quote(fmt.Sprint(w)),\n\t\t))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/selector.go",
    "content": "package jsonpath\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/PaesslerAG/gval\"\n)\n\n//plainSelector evaluate exactly one result\ntype plainSelector func(c context.Context, r, v interface{}) (interface{}, error)\n\n//ambiguousSelector evaluate wildcard\ntype ambiguousSelector func(c context.Context, r, v interface{}, match ambiguousMatcher)\n\n//@\nfunc currentElementSelector() plainSelector {\n\treturn func(c context.Context, r, v interface{}) (interface{}, error) {\n\t\treturn c.Value(currentElement{}), nil\n\t}\n}\n\ntype currentElement struct{}\n\nfunc currentContext(c context.Context, v interface{}) context.Context {\n\treturn context.WithValue(c, currentElement{}, v)\n}\n\n//.x, [x]\nfunc directSelector(key gval.Evaluable) plainSelector {\n\treturn func(c context.Context, r, v interface{}) (interface{}, error) {\n\n\t\te, _, err := selectValue(c, key, r, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn e, nil\n\t}\n}\n\n// * / [*]\nfunc starSelector() ambiguousSelector {\n\treturn func(c context.Context, r, v interface{}, match ambiguousMatcher) {\n\t\tvisitAll(v, func(key string, val interface{}) { match(key, val) })\n\t}\n}\n\n// [x, ...]\nfunc multiSelector(keys []gval.Evaluable) ambiguousSelector {\n\tif len(keys) == 0 {\n\t\treturn starSelector()\n\t}\n\treturn func(c context.Context, r, v interface{}, match ambiguousMatcher) {\n\t\tfor _, k := range keys {\n\t\t\te, wildcard, err := selectValue(c, k, r, v)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmatch(wildcard, e)\n\t\t}\n\t}\n}\n\nfunc selectValue(c context.Context, key gval.Evaluable, r, v interface{}) (value interface{}, jkey string, err error) {\n\tc = currentContext(c, v)\n\tswitch o := v.(type) {\n\tcase []interface{}:\n\t\ti, err := key.EvalInt(c, r)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"could not select value, invalid key: %s\", err)\n\t\t}\n\t\tif i < 0 || i >= len(o) {\n\t\t\treturn nil, \"\", fmt.Errorf(\"index %d out of bounds\", i)\n\t\t}\n\t\treturn o[i], strconv.Itoa(i), nil\n\tcase map[string]interface{}:\n\t\tk, err := key.EvalString(c, r)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"could not select value, invalid key: %s\", err)\n\t\t}\n\n\t\tif r, ok := o[k]; ok {\n\t\t\treturn r, k, nil\n\t\t}\n\t\treturn nil, \"\", fmt.Errorf(\"unknown key %s\", k)\n\n\tdefault:\n\t\treturn nil, \"\", fmt.Errorf(\"unsupported value type %T for select, expected map[string]interface{} or []interface{}\", o)\n\t}\n}\n\n//..\nfunc mapperSelector() ambiguousSelector {\n\treturn mapper\n}\n\nfunc mapper(c context.Context, r, v interface{}, match ambiguousMatcher) {\n\tmatch([]interface{}{}, v)\n\tvisitAll(v, func(wildcard string, v interface{}) {\n\t\tmapper(c, r, v, func(key interface{}, v interface{}) {\n\t\t\tmatch(append([]interface{}{wildcard}, key.([]interface{})...), v)\n\t\t})\n\t})\n}\n\nfunc visitAll(v interface{}, visit func(key string, v interface{})) {\n\tswitch v := v.(type) {\n\tcase []interface{}:\n\t\tfor i, e := range v {\n\t\t\tk := strconv.Itoa(i)\n\t\t\tvisit(k, e)\n\t\t}\n\tcase map[string]interface{}:\n\t\tfor k, e := range v {\n\t\t\tvisit(k, e)\n\t\t}\n\t}\n\n}\n\n//[? ]\nfunc filterSelector(filter gval.Evaluable) ambiguousSelector {\n\treturn func(c context.Context, r, v interface{}, match ambiguousMatcher) {\n\t\tvisitAll(v, func(wildcard string, v interface{}) {\n\t\t\tcondition, err := filter.EvalBool(currentContext(c, v), r)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif condition {\n\t\t\t\tmatch(wildcard, v)\n\t\t\t}\n\t\t})\n\t}\n}\n\n//[::]\nfunc rangeSelector(min, max, step gval.Evaluable) ambiguousSelector {\n\treturn func(c context.Context, r, v interface{}, match ambiguousMatcher) {\n\t\tcs, ok := v.([]interface{})\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\n\t\tc = currentContext(c, v)\n\n\t\tmin, err := min.EvalInt(c, r)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tmax, err := max.EvalInt(c, r)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tstep, err := step.EvalInt(c, r)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif min > max {\n\t\t\treturn\n\t\t}\n\n\t\tn := len(cs)\n\t\tmin = negmax(min, n)\n\t\tmax = negmax(max, n)\n\n\t\tif step == 0 {\n\t\t\tstep = 1\n\t\t}\n\n\t\tif step > 0 {\n\t\t\tfor i := min; i < max; i += step {\n\t\t\t\tmatch(strconv.Itoa(i), cs[i])\n\t\t\t}\n\t\t} else {\n\t\t\tfor i := max - 1; i >= min; i += step {\n\t\t\t\tmatch(strconv.Itoa(i), cs[i])\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nfunc negmax(n, max int) int {\n\tif n < 0 {\n\t\tn = max + n\n\t\tif n < 0 {\n\t\t\tn = 0\n\t\t}\n\t} else if n > max {\n\t\treturn max\n\t}\n\treturn n\n}\n\n// ()\nfunc newScript(script gval.Evaluable) plainSelector {\n\treturn func(c context.Context, r, v interface{}) (interface{}, error) {\n\t\treturn script(currentContext(c, v), r)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/PaesslerAG/jsonpath/test.sh",
    "content": "#!/bin/bash\n\n# Script that runs tests, code coverage, and benchmarks all at once.\n\nJSONPath_PATH=$HOME/gopath/src/github.com/PaesslerAG/jsonpath\n\n# run the actual tests.\ncd \"${JSONPath_PATH}\"\ngo test -bench=. -benchmem -coverprofile coverage.out\nstatus=$?\n\nif [ \"${status}\" != 0 ];\nthen\n\texit $status\nfi\n"
  },
  {
    "path": "vendor/github.com/acarl005/stripansi/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Andrew Carlson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/acarl005/stripansi/README.md",
    "content": "Strip ANSI\n==========\n\nThis Go package removes ANSI escape codes from strings.\n\nIdeally, we would prevent these from appearing in any text we want to process.\nHowever, sometimes this can't be helped, and we need to be able to deal with that noise.\nThis will use a regexp to remove those unwanted escape codes.\n\n\n## Install\n\n```sh\n$ go get -u github.com/acarl005/stripansi\n```\n\n## Usage\n\n```go\nimport (\n\t\"fmt\"\n\t\"github.com/acarl005/stripansi\"\n)\n\nfunc main() {\n\tmsg := \"\\x1b[38;5;140m foo\\x1b[0m bar\"\n\tcleanMsg := stripansi.Strip(msg)\n\tfmt.Println(cleanMsg) // \" foo bar\"\n}\n```\n"
  },
  {
    "path": "vendor/github.com/acarl005/stripansi/stripansi.go",
    "content": "package stripansi\n\nimport (\n\t\"regexp\"\n)\n\nconst ansi = \"[\\u001B\\u009B][[\\\\]()#;?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[a-zA-Z\\\\d]*)*)?\\u0007)|(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))\"\n\nvar re = regexp.MustCompile(ansi)\n\nfunc Strip(str string) string {\n\treturn re.ReplaceAllString(str, \"\")\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/.gitignore",
    "content": "*.a\n*.out\n*.test\n*.stderr\n*.stdout\n*.log\n.vscode/\n\n# Created by https://www.gitignore.io\n\n### Windows ###\n# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Windows Installer files\n*.cab\n*.msi\n*.msm\n*.msp\n\n# Windows shortcuts\n*.lnk\n\n\n### OSX ###\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon must end with two \\r\nIcon\n\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n\n### Eclipse ###\n*.pydevproject\n.metadata\n.gradle\nbin/\ntmp/\n*.tmp\n*.bak\n*.swp\n*~.nib\nlocal.properties\n.settings/\n.loadpath\n\n# Eclipse Core\n.project\n\n# External tool builders\n.externalToolBuilders/\n\n# Locally stored \"Eclipse launch configurations\"\n*.launch\n\n# CDT-specific\n.cproject\n\n# JDT-specific (Eclipse Java Development Tools)\n.classpath\n\n# PDT-specific\n.buildpath\n\n# sbteclipse plugin\n.target\n\n# TeXlipse plugin\n.texlipse\n\n\n### Go ###\n# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n\n\n### SublimeText ###\n# cache files for sublime text\n*.tmlanguage.cache\n*.tmPreferences.cache\n*.stTheme.cache\n\n# workspace files are user-specific\n*.sublime-workspace\n\n# project files should be checked into the repository, unless a significant\n# proportion of contributors will probably not be using SublimeText\n# *.sublime-project\n\n# sftp configuration file\nsftp-config.json\n\n\n### VisualStudio ###\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\nbuild/\nbld/\n[Bb]in/\n[Oo]bj/\n\n# Visual Studo 2015 cache/options directory\n.vs/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUNIT\n*.VisualState.xml\nTestResult.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n*_i.c\n*_p.c\n*_i.h\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n*.cachefile\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# JustCode is a .NET coding addin-in\n.JustCode\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# TODO: Comment the next line if you want to checkin your web deploy settings\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# NuGet Packages\n*.nupkg\n# The packages folder can be ignored because of Package Restore\n**/packages/*\n# except build/, which is used as an MSBuild target.\n!**/packages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/packages/repositories.config\n\n# Windows Azure Build Output\ncsx/\n*.build.csdef\n\n# Windows Store app package directory\nAppPackages/\n\n# Others\n*.[Cc]ache\nClientBin/\n[Ss]tyle[Cc]op.*\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.pfx\n*.publishsettings\nnode_modules/\nbower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\n*.mdf\n*.ldf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n\n### Maven ###\ntarget/\npom.xml.tag\npom.xml.releaseBackup\npom.xml.versionsBackup\npom.xml.next\nrelease.properties\ndependency-reduced-pom.xml\nbuildNumber.properties\n\n\n### Java ###\n*.class\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n# Package Files #\n*.jar\n*.war\n*.ear\n\n# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml\nhs_err_pid*\n\n\n### Intellij ###\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm\n\n*.iml\n\n## Directory-based project format:\n.idea/\n# if you remove the above rule, at least ignore the following:\n\n# User-specific stuff:\n# .idea/workspace.xml\n# .idea/tasks.xml\n# .idea/dictionaries\n\n# Sensitive or high-churn files:\n# .idea/dataSources.ids\n# .idea/dataSources.xml\n# .idea/sqlDataSources.xml\n# .idea/dynamic.xml\n# .idea/uiDesigner.xml\n\n# Gradle:\n# .idea/gradle.xml\n# .idea/libraries\n\n# Mongo Explorer plugin:\n# .idea/mongoSettings.xml\n\n## File-based project format:\n*.ipr\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/.travis.yml",
    "content": "# Setting \"sudo\" to false forces Travis-CI to use its\n# container-based build infrastructure, which has shorter\n# queue times.\nsudo: false\n\n# Use the newer Travis-CI build templates based on the\n# Debian Linux distribution \"Trusty\" release.\ndist: trusty\n\n# Select Go as the language used to run the buid.\nlanguage: go\ngo:\n  - 1.8.x\n  - 1.9.x\n  - 1.10.x\ngo_import_path: github.com/akutz/memconn\n\ninstall: true\nscript:\n  - make test\n  - make benchmark\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/LICENSE",
    "content": "                                Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/Makefile",
    "content": "SHELL := /bin/bash\n\nall: build\n\nbuild: memconn.a\nmemconn.a: $(filter-out %_test.go, $(wildcard *.go))\n\tgo build -o $@\n\nGO_VERSION ?= 1.9.4\nIMPORT_PATH := github.com/akutz/memconn\n\ndocker-run:\n\tdocker run --rm -it \\\n      -v $$(pwd):/go/src/$(IMPORT_PATH) \\\n      golang:$(GO_VERSION) \\\n      make -C /go/src/$(IMPORT_PATH) $(MAKE_TARGET)\n\nBENCH ?= .\n\nbenchmark:\n\tgo test -bench $(BENCH) -run Bench -benchmem .\n\nbenchmark-go1.9:\n\tMAKE_TARGET=benchmark $(MAKE) docker-run\n\ntest:\n\tgo test\n\tgo test -race -run 'Race$$'\n\ntest-go1.9:\n\tMAKE_TARGET=test $(MAKE) docker-run"
  },
  {
    "path": "vendor/github.com/akutz/memconn/README.md",
    "content": "# MemConn [![GoDoc](https://godoc.org/github.com/akutz/memconn?status.svg)](http://godoc.org/github.com/akutz/memconn) [![Build Status](http://travis-ci.org/akutz/memconn.svg?branch=master)](https://travis-ci.org/akutz/memconn) [![Go Report Card](http://goreportcard.com/badge/akutz/memconn)](http://goreportcard.com/report/akutz/memconn)\nMemConn provides named, in-memory network connections for Go.\n\n## Create a Server\nA new `net.Listener` used to serve HTTP, gRPC, etc. is created with\n`memconn.Listen`:\n\n```go\nlis, err := memconn.Listen(\"memu\", \"UniqueName\")\n```\n\n## Creating a Client (Dial)\nClients can dial any named connection:\n\n```go\nclient, err := memconn.Dial(\"memu\", \"UniqueName\")\n```\n\n## Network Types\nMemCon supports the following network types:\n\n| Network | Description |\n|---------|-------------|\n| `memb`  | A buffered, in-memory implementation of `net.Conn` |\n| `memu`  | An unbuffered, in-memory implementation of `net.Conn` |\n\n## Performance\nThe benchmark results illustrate MemConn's performance versus TCP\nand UNIX domain sockets:\n\n![ops](https://imgur.com/o8mXla6.png \"Ops (Larger is Better)\")\n![ns/op](https://imgur.com/8YvPmMU.png \"Nanoseconds/Op (Smaller is Better)\")\n![B/op](https://imgur.com/vQSfIR2.png \"Bytes/Op (Smaller is Better)\")\n![allocs/op](https://imgur.com/k263257.png \"Allocs/Op (Smaller is Better)\")\n\nMemConn is more performant than TCP and UNIX domain sockets with respect\nto the CPU. While MemConn does allocate more memory, this is to be expected\nsince MemConn is an in-memory implementation of the `net.Conn` interface.\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/VERSION",
    "content": "0.1.0\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn.go",
    "content": "package memconn\n\nimport (\n\t\"context\"\n\t\"net\"\n)\n\nconst (\n\t// networkMemb is a buffered network connection. Write operations\n\t// do not block as they are are buffered instead of waiting on a\n\t// matching Read operation.\n\tnetworkMemb = \"memb\"\n\n\t// networkMemu is an unbuffered network connection. Write operations\n\t// block until they are matched by a Read operation on the other side\n\t// of the connected pipe.\n\tnetworkMemu = \"memu\"\n\n\t// addrLocalhost is a reserved address name. It is used when a\n\t// Listen variant omits the local address or a Dial variant omits\n\t// the remote address.\n\taddrLocalhost = \"localhost\"\n)\n\n// provider is the package's default provider instance. All of the\n// package-level functions interact with this object.\nvar provider Provider\n\n// MapNetwork enables mapping the network value provided to this Provider's\n// Dial and Listen functions from the specified \"from\" value to the\n// specified \"to\" value.\n//\n// For example, calling MapNetwork(\"tcp\", \"memu\") means a subsequent\n// Dial(\"tcp\", \"address\") gets translated to Dial(\"memu\", \"address\").\n//\n// Calling MapNetwork(\"tcp\", \"\") removes any previous translation for\n// the \"tcp\" network.\nfunc MapNetwork(from, to string) {\n\tprovider.MapNetwork(from, to)\n}\n\n// Listen begins listening at address for the specified network.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// When the specified address is already in use on the specified\n// network an error is returned.\n//\n// When the provided network is unknown the operation defers to\n// net.Dial.\nfunc Listen(network, address string) (net.Listener, error) {\n\treturn provider.Listen(network, address)\n}\n\n// ListenMem begins listening at laddr.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// If laddr is nil then ListenMem listens on \"localhost\" on the\n// specified network.\nfunc ListenMem(network string, laddr *Addr) (*Listener, error) {\n\treturn provider.ListenMem(network, laddr)\n}\n\n// Dial dials a named connection.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// When the provided network is unknown the operation defers to\n// net.Dial.\nfunc Dial(network, address string) (net.Conn, error) {\n\treturn provider.Dial(network, address)\n}\n\n// DialContext dials a named connection using a\n// Go context to provide timeout behavior.\n//\n// Please see Dial for more information.\nfunc DialContext(\n\tctx context.Context,\n\tnetwork, address string) (net.Conn, error) {\n\n\treturn provider.DialContext(ctx, network, address)\n}\n\n// DialMem dials a named connection.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// If laddr is nil then a new address is generated using\n// time.Now().UnixNano(). Please note that client addresses are\n// not required to be unique.\n//\n// If raddr is nil then the \"localhost\" endpoint is used on the\n// specified network.\nfunc DialMem(network string, laddr, raddr *Addr) (*Conn, error) {\n\treturn provider.DialMem(network, laddr, raddr)\n}\n\n// DialMemContext dials a named connection using a\n// Go context to provide timeout behavior.\n//\n// Please see DialMem for more information.\nfunc DialMemContext(\n\tctx context.Context,\n\tnetwork string,\n\tladdr, raddr *Addr) (*Conn, error) {\n\n\treturn provider.DialMemContext(ctx, network, laddr, raddr)\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn_addr.go",
    "content": "package memconn\n\n// Addr represents the address of an in-memory endpoint.\ntype Addr struct {\n\t// Name is the name of the endpoint.\n\tName string\n\n\tnetwork string\n}\n\n// Buffered indicates whether or not the address refers to a buffered\n// network type.\nfunc (a Addr) Buffered() bool {\n\treturn a.network == networkMemb\n}\n\n// Network returns the address's network.\nfunc (a Addr) Network() string {\n\treturn a.network\n}\n\n// String returns the address's name.\nfunc (a Addr) String() string {\n\treturn a.Name\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn_conn.go",
    "content": "package memconn\n\nimport (\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Conn is an in-memory implementation of Golang's \"net.Conn\" interface.\ntype Conn struct {\n\tpipe\n\n\tladdr Addr\n\traddr Addr\n\n\t// buf contains information about the connection's buffer state if\n\t// the connection is buffered. Otherwise this field is nil.\n\tbuf *bufConn\n}\n\ntype bufConn struct {\n\t// Please see the SetCopyOnWrite function for more information.\n\tcow bool\n\n\t// Please see the SetBufferSize function for more information.\n\tmax uint64\n\n\t// cur is the amount of buffered, pending Write data\n\tcur uint64\n\n\t// cond is a condition used to wait when writing buffered data\n\tcond sync.Cond\n\n\t// mu is the mutex used by the condition. The mutex is exposed\n\t// directly in order to access RLock and RUnlock for getting the\n\t// buffer size.\n\tmu sync.RWMutex\n\n\t// errs is the error channel returned by the Errs() function and\n\t// used to report erros that occur as a result of buffered write\n\t// operations. If the pipe does not use buffered writes then this\n\t// field will always be nil.\n\terrs chan error\n\n\t// Please see the SetCloseTimeout function for more information.\n\tcloseTimeout time.Duration\n}\n\nfunc makeNewConns(network string, laddr, raddr Addr) (*Conn, *Conn) {\n\t// This code is duplicated from the Pipe() function from the file\n\t// \"memconn_pipe.go\". The reason for the duplication is to optimize\n\t// the performance by removing the need to wrap the *pipe values as\n\t// interface{} objects out of the Pipe() function and assert them\n\t// back as *pipe* objects in this function.\n\tcb1 := make(chan []byte)\n\tcb2 := make(chan []byte)\n\tcn1 := make(chan int)\n\tcn2 := make(chan int)\n\tdone1 := make(chan struct{})\n\tdone2 := make(chan struct{})\n\n\t// Wrap the pipes with Conn to support:\n\t//\n\t//   * The correct address information for the functions LocalAddr()\n\t//     and RemoteAddr() return the\n\t//   * Errors returns from the internal pipe are checked and\n\t//     have their internal OpError addr information replaced with\n\t//     the correct address information.\n\t//   * A channel can be setup to cause the event of the Listener\n\t//     closing closes the remoteConn immediately.\n\t//   * Buffered writes\n\tlocal := &Conn{\n\t\tpipe: pipe{\n\t\t\trdRx: cb1, rdTx: cn1,\n\t\t\twrTx: cb2, wrRx: cn2,\n\t\t\tlocalDone: done1, remoteDone: done2,\n\t\t\treadDeadline:  makePipeDeadline(),\n\t\t\twriteDeadline: makePipeDeadline(),\n\t\t},\n\t\tladdr: laddr,\n\t\traddr: raddr,\n\t}\n\tremote := &Conn{\n\t\tpipe: pipe{\n\t\t\trdRx: cb2, rdTx: cn2,\n\t\t\twrTx: cb1, wrRx: cn1,\n\t\t\tlocalDone: done2, remoteDone: done1,\n\t\t\treadDeadline:  makePipeDeadline(),\n\t\t\twriteDeadline: makePipeDeadline(),\n\t\t},\n\t\tladdr: raddr,\n\t\traddr: laddr,\n\t}\n\n\tif laddr.Buffered() {\n\t\tlocal.buf = &bufConn{\n\t\t\terrs:         make(chan error),\n\t\t\tcloseTimeout: 10 * time.Second,\n\t\t}\n\t\tlocal.buf.cond.L = &local.buf.mu\n\t}\n\n\tif raddr.Buffered() {\n\t\tremote.buf = &bufConn{\n\t\t\terrs:         make(chan error),\n\t\t\tcloseTimeout: 10 * time.Second,\n\t\t}\n\t\tremote.buf.cond.L = &remote.buf.mu\n\t}\n\n\treturn local, remote\n}\n\n// LocalBuffered returns a flag indicating whether or not the local side\n// of the connection is buffered.\nfunc (c *Conn) LocalBuffered() bool {\n\treturn c.laddr.Buffered()\n}\n\n// RemoteBuffered returns a flag indicating whether or not the remote side\n// of the connection is buffered.\nfunc (c *Conn) RemoteBuffered() bool {\n\treturn c.raddr.Buffered()\n}\n\n// BufferSize gets the number of bytes allowed to be queued for\n// asynchrnous Write operations.\n//\n// Please note that this function will always return zero for unbuffered\n// connections.\n//\n// Please see the function SetBufferSize for more information.\nfunc (c *Conn) BufferSize() uint64 {\n\tif c.laddr.Buffered() {\n\t\tc.buf.mu.RLock()\n\t\tdefer c.buf.mu.RUnlock()\n\t\treturn c.buf.max\n\t}\n\treturn 0\n}\n\n// SetBufferSize sets the number of bytes allowed to be queued for\n// asynchronous Write operations. Once the amount of data pending a Write\n// operation exceeds the specified size, subsequent Writes will\n// block until the queued data no longer exceeds the allowed ceiling.\n//\n// A value of zero means no maximum is defined.\n//\n// If a Write operation's payload length exceeds the buffer size\n// (except for zero) then the Write operation is handled synchronously.\n//\n// Please note that setting the buffer size has no effect on unbuffered\n// connections.\nfunc (c *Conn) SetBufferSize(i uint64) {\n\tif c.laddr.Buffered() {\n\t\tc.buf.cond.L.Lock()\n\t\tdefer c.buf.cond.L.Unlock()\n\t\tc.buf.max = i\n\t}\n}\n\n// CloseTimeout gets the time.Duration value used when closing buffered\n// connections.\n//\n// Please note that this function will always return zero for\n// unbuffered connections.\n//\n// Please see the function SetCloseTimeout for more information.\nfunc (c *Conn) CloseTimeout() time.Duration {\n\tif c.laddr.Buffered() {\n\t\tc.buf.mu.RLock()\n\t\tdefer c.buf.mu.RUnlock()\n\t\treturn c.buf.closeTimeout\n\t}\n\treturn 0\n}\n\n// SetCloseTimeout sets a time.Duration value used by the Close function\n// to determine the amount of time to wait for pending, buffered Writes\n// to complete before closing the connection.\n//\n// The default timeout value is 10 seconds. A zero value does not\n// mean there is no timeout, rather it means the timeout is immediate.\n//\n// Please note that setting this value has no effect on unbuffered\n// connections.\nfunc (c *Conn) SetCloseTimeout(duration time.Duration) {\n\tif c.laddr.Buffered() {\n\t\tc.buf.cond.L.Lock()\n\t\tdefer c.buf.cond.L.Unlock()\n\t\tc.buf.closeTimeout = duration\n\t}\n}\n\n// CopyOnWrite gets a flag indicating whether or not copy-on-write is\n// enabled for this connection.\n//\n// Please note that this function will always return false for\n// unbuffered connections.\n//\n// Please see the function SetCopyOnWrite for more information.\nfunc (c *Conn) CopyOnWrite() bool {\n\tif c.laddr.Buffered() {\n\t\tc.buf.mu.RLock()\n\t\tdefer c.buf.mu.RUnlock()\n\t\treturn c.buf.cow\n\t}\n\treturn false\n}\n\n// SetCopyOnWrite sets a flag indicating whether or not copy-on-write\n// is enabled for this connection.\n//\n// When a connection is buffered, data submitted to a Write operation\n// is processed in a goroutine and the function returns control to the\n// caller immediately. Because of this, it's possible to modify the\n// data provided to the Write function before or during the actual\n// Write operation. Enabling copy-on-write causes the payload to be\n// copied to a new buffer before control is returned to the caller.\n//\n// Please note that enabling copy-on-write will double the amount of\n// memory required for all Write operations.\n//\n// Please note that enabling copy-on-write has no effect on unbuffered\n// connections.\nfunc (c *Conn) SetCopyOnWrite(enabled bool) {\n\tif c.laddr.Buffered() {\n\t\tc.buf.cond.L.Lock()\n\t\tdefer c.buf.cond.L.Unlock()\n\t\tc.buf.cow = enabled\n\t}\n}\n\n// LocalAddr implements the net.Conn LocalAddr method.\nfunc (c *Conn) LocalAddr() net.Addr {\n\treturn c.laddr\n}\n\n// RemoteAddr implements the net.Conn RemoteAddr method.\nfunc (c *Conn) RemoteAddr() net.Addr {\n\treturn c.raddr\n}\n\n// Close implements the net.Conn Close method.\nfunc (c *Conn) Close() error {\n\tc.pipe.once.Do(func() {\n\n\t\t// Buffered connections will attempt to wait until all\n\t\t// pending Writes are completed, until the specified\n\t\t// timeout value has elapsed, or until the remote side\n\t\t// of the connection is closed.\n\t\tif c.laddr.Buffered() {\n\t\t\tc.buf.mu.RLock()\n\t\t\ttimeout := c.buf.closeTimeout\n\t\t\tc.buf.mu.RUnlock()\n\n\t\t\t// Set up a channel that is closed when the specified\n\t\t\t// timer elapses.\n\t\t\ttimeoutDone := make(chan struct{})\n\t\t\tif timeout == 0 {\n\t\t\t\tclose(timeoutDone)\n\t\t\t} else {\n\t\t\t\ttime.AfterFunc(timeout, func() { close(timeoutDone) })\n\t\t\t}\n\n\t\t\t// Set up a channel that is closed when the number of\n\t\t\t// pending bytes is zero.\n\t\t\twritesDone := make(chan struct{})\n\t\t\tgo func() {\n\t\t\t\tc.buf.cond.L.Lock()\n\t\t\t\tfor c.buf.cur > 0 {\n\t\t\t\t\tc.buf.cond.Wait()\n\t\t\t\t}\n\t\t\t\tclose(writesDone)\n\t\t\t\tc.buf.cond.L.Unlock()\n\t\t\t}()\n\n\t\t\t// Wait to close the connection.\n\t\t\tselect {\n\t\t\tcase <-writesDone:\n\t\t\tcase <-timeoutDone:\n\t\t\tcase <-c.pipe.remoteDone:\n\t\t\t}\n\t\t}\n\n\t\tclose(c.pipe.localDone)\n\t})\n\treturn nil\n}\n\n// Errs returns a channel that receives errors that may occur as the\n// result of buffered write operations.\n//\n// This function will always return nil for unbuffered connections.\n//\n// Please note that the channel returned by this function is not closed\n// when the connection is closed. This is because errors may continue\n// to be sent over this channel as the result of asynchronous writes\n// occurring after the connection is closed. Therefore this channel\n// should not be used to determine when the connection is closed.\nfunc (c *Conn) Errs() <-chan error {\n\treturn c.buf.errs\n}\n\n// Read implements the net.Conn Read method.\nfunc (c *Conn) Read(b []byte) (int, error) {\n\tn, err := c.pipe.Read(b)\n\tif err != nil {\n\t\tif e, ok := err.(*net.OpError); ok {\n\t\t\te.Addr = c.raddr\n\t\t\te.Source = c.laddr\n\t\t\treturn n, e\n\t\t}\n\t\treturn n, &net.OpError{\n\t\t\tOp:     \"read\",\n\t\t\tAddr:   c.raddr,\n\t\t\tSource: c.laddr,\n\t\t\tNet:    c.raddr.Network(),\n\t\t\tErr:    err,\n\t\t}\n\t}\n\treturn n, nil\n}\n\n// Write implements the net.Conn Write method.\nfunc (c *Conn) Write(b []byte) (int, error) {\n\tif c.laddr.Buffered() {\n\t\treturn c.writeAsync(b)\n\t}\n\treturn c.writeSync(b)\n}\n\nfunc (c *Conn) writeSync(b []byte) (int, error) {\n\tn, err := c.pipe.Write(b)\n\tif err != nil {\n\t\tif e, ok := err.(*net.OpError); ok {\n\t\t\te.Addr = c.raddr\n\t\t\te.Source = c.laddr\n\t\t\treturn n, e\n\t\t}\n\t\treturn n, &net.OpError{\n\t\t\tOp:     \"write\",\n\t\t\tAddr:   c.raddr,\n\t\t\tSource: c.laddr,\n\t\t\tNet:    c.raddr.Network(),\n\t\t\tErr:    err,\n\t\t}\n\t}\n\treturn n, nil\n}\n\n// writeAsync performs the Write operation in a goroutine. This\n// behavior means the Write operation is not blocking, but also means\n// that when Write operations fail the associated error is not returned\n// from this function.\nfunc (c *Conn) writeAsync(b []byte) (int, error) {\n\t// Perform a synchronous Write if the connection has a non-zero\n\t// value for the maximum allowed buffer size and if the size of\n\t// the payload exceeds that maximum value.\n\tif c.buf.max > 0 && uint64(len(b)) > c.buf.max {\n\t\treturn c.writeSync(b)\n\t}\n\n\t// Block the operation from proceeding until there is available\n\t// buffer space.\n\tc.buf.cond.L.Lock()\n\tfor c.buf.max > 0 && uint64(len(b))+c.buf.cur > c.buf.max {\n\t\tc.buf.cond.Wait()\n\t}\n\n\t// Copy the buffer if the connection uses copy-on-write.\n\tcb := b\n\tif c.buf.cow {\n\t\tcb = make([]byte, len(b))\n\t\tcopy(cb, b)\n\t}\n\n\t// Update the amount of active data being written.\n\tc.buf.cur = c.buf.cur + uint64(len(cb))\n\n\tc.buf.cond.L.Unlock()\n\n\tgo func() {\n\t\tif _, err := c.writeSync(cb); err != nil {\n\t\t\tgo func() { c.buf.errs <- err }()\n\t\t}\n\n\t\t// Decrement the enqueued buffer size and signal a blocked\n\t\t// goroutine that it may proceed\n\t\tc.buf.cond.L.Lock()\n\t\tc.buf.cur = c.buf.cur - uint64(len(cb))\n\t\tc.buf.cond.L.Unlock()\n\t\tc.buf.cond.Signal()\n\t}()\n\treturn len(cb), nil\n}\n\n// SetReadDeadline implements the net.Conn SetReadDeadline method.\nfunc (c *Conn) SetReadDeadline(t time.Time) error {\n\tif err := c.pipe.SetReadDeadline(t); err != nil {\n\t\tif e, ok := err.(*net.OpError); ok {\n\t\t\te.Addr = c.laddr\n\t\t\te.Source = c.laddr\n\t\t\treturn e\n\t\t}\n\t\treturn &net.OpError{\n\t\t\tOp:     \"setReadDeadline\",\n\t\t\tAddr:   c.laddr,\n\t\t\tSource: c.laddr,\n\t\t\tNet:    c.laddr.Network(),\n\t\t\tErr:    err,\n\t\t}\n\t}\n\treturn nil\n}\n\n// SetWriteDeadline implements the net.Conn SetWriteDeadline method.\nfunc (c *Conn) SetWriteDeadline(t time.Time) error {\n\tif err := c.pipe.SetWriteDeadline(t); err != nil {\n\t\tif e, ok := err.(*net.OpError); ok {\n\t\t\te.Addr = c.laddr\n\t\t\te.Source = c.laddr\n\t\t\treturn e\n\t\t}\n\t\treturn &net.OpError{\n\t\t\tOp:     \"setWriteDeadline\",\n\t\t\tAddr:   c.laddr,\n\t\t\tSource: c.laddr,\n\t\t\tNet:    c.laddr.Network(),\n\t\t\tErr:    err,\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn_listener.go",
    "content": "package memconn\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"net\"\n\t\"sync\"\n)\n\n// Listener implements the net.Listener interface.\ntype Listener struct {\n\taddr Addr\n\tonce sync.Once\n\trcvr chan *Conn\n\tdone chan struct{}\n\trmvd chan struct{}\n}\n\nfunc (l *Listener) dial(\n\tctx context.Context,\n\tnetwork string,\n\tladdr, raddr Addr) (*Conn, error) {\n\n\tlocal, remote := makeNewConns(network, laddr, raddr)\n\n\t// TODO Figure out if this logic is valid.\n\t//\n\t// Start a goroutine that closes the remote side of the connection\n\t// as soon as the listener's done channel is no longer blocked.\n\t//go func() {\n\t//\t<-l.done\n\t//\tremoteConn.Close()\n\t//}()\n\n\t// If the provided context is nill then announce a new connection\n\t// by placing the new remoteConn onto the rcvr channel. An Accept\n\t// call from this listener will remove the remoteConn from the channel.\n\tif ctx == nil {\n\t\tl.rcvr <- remote\n\t\treturn local, nil\n\t}\n\n\t// Announce a new connection by placing the new remoteConn\n\t// onto the rcvr channel. An Accept call from this listener will\n\t// remove the remoteConn from the channel. However, if that does\n\t// not occur by the time the context times out / is cancelled, then\n\t// an error is returned.\n\tselect {\n\tcase l.rcvr <- remote:\n\t\treturn local, nil\n\tcase <-ctx.Done():\n\t\tlocal.Close()\n\t\tremote.Close()\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   raddr,\n\t\t\tSource: laddr,\n\t\t\tNet:    network,\n\t\t\tOp:     \"dial\",\n\t\t\tErr:    ctx.Err(),\n\t\t}\n\t}\n}\n\n// Accept implements the net.Listener Accept method.\nfunc (l *Listener) Accept() (net.Conn, error) {\n\treturn l.AcceptMemConn()\n}\n\n// AcceptMemConn implements the net.Listener Accept method logic and\n// returns a *memconn.Conn object.\nfunc (l *Listener) AcceptMemConn() (*Conn, error) {\n\tselect {\n\tcase remoteConn, ok := <-l.rcvr:\n\t\tif ok {\n\t\t\treturn remoteConn, nil\n\t\t}\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   l.addr,\n\t\t\tSource: l.addr,\n\t\t\tNet:    l.addr.Network(),\n\t\t\tErr:    errors.New(\"listener closed\"),\n\t\t}\n\tcase <-l.done:\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   l.addr,\n\t\t\tSource: l.addr,\n\t\t\tNet:    l.addr.Network(),\n\t\t\tErr:    errors.New(\"listener closed\"),\n\t\t}\n\t}\n}\n\n// Close implements the net.Listener Close method.\nfunc (l *Listener) Close() error {\n\tl.once.Do(func() {\n\t\tclose(l.done)\n\t\t<-l.rmvd\n\t})\n\treturn nil\n}\n\n// Addr implements the net.Listener Addr method.\nfunc (l *Listener) Addr() net.Addr {\n\treturn l.addr\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn_pipe.go",
    "content": "// This file was copied from Go stdlib \"net/pipe.go\"\n// and modified in order to optimally support:\n//\n//     * Buffered writes\n//     * Custom local and remote address values\n//     * Error values that follow net.Conn's rules regarding\n//       net.OpError\n//\n// The above features could be implemented using the \"net.Conn\" values\n// returned from the function \"net.Pipe\", but much of the same code\n// would need to be duplicated regarding deadlines, done semantics, etc.\n// Using the private \"pipe\" struct as the basis of a new, composite type\n// is much more performant.\n//\n// FYI, the reason a new, composite type is used instead of modifying\n// the existing type, \"pipe\", is to make it easier to replace this\n// file with whatever changes Go stdlib make make to \"net/pipe.go\" in\n// the future.\n//\n// This file is a Golang stdlib type and so the Go license is included:\n//\n//     Copyright 2010 The Go Authors. All rights reserved.\n//     Use of this source code is governed by a BSD-style\n//     license that can be found in the LICENSE file.\n\npackage memconn\n\nimport (\n\t\"io\"\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n)\n\n// pipeDeadline is an abstraction for handling timeouts.\ntype pipeDeadline struct {\n\tmu     sync.Mutex // Guards timer and cancel\n\ttimer  *time.Timer\n\tcancel chan struct{} // Must be non-nil\n}\n\nfunc makePipeDeadline() pipeDeadline {\n\treturn pipeDeadline{cancel: make(chan struct{})}\n}\n\n// set sets the point in time when the deadline will time out.\n// A timeout event is signaled by closing the channel returned by waiter.\n// Once a timeout has occurred, the deadline can be refreshed by specifying a\n// t value in the future.\n//\n// A zero value for t prevents timeout.\nfunc (d *pipeDeadline) set(t time.Time) {\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\n\tif d.timer != nil && !d.timer.Stop() {\n\t\t<-d.cancel // Wait for the timer callback to finish and close cancel\n\t}\n\td.timer = nil\n\n\t// Time is zero, then there is no deadline.\n\tclosed := isClosedChan(d.cancel)\n\tif t.IsZero() {\n\t\tif closed {\n\t\t\td.cancel = make(chan struct{})\n\t\t}\n\t\treturn\n\t}\n\n\t// Time in the future, setup a timer to cancel in the future.\n\tif dur := time.Until(t); dur > 0 {\n\t\tif closed {\n\t\t\td.cancel = make(chan struct{})\n\t\t}\n\t\td.timer = time.AfterFunc(dur, func() {\n\t\t\tclose(d.cancel)\n\t\t})\n\t\treturn\n\t}\n\n\t// Time in the past, so close immediately.\n\tif !closed {\n\t\tclose(d.cancel)\n\t}\n}\n\n// wait returns a channel that is closed when the deadline is exceeded.\nfunc (d *pipeDeadline) wait() chan struct{} {\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\treturn d.cancel\n}\n\nfunc isClosedChan(c <-chan struct{}) bool {\n\tselect {\n\tcase <-c:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\ntype timeoutError struct{}\n\nfunc (timeoutError) Error() string   { return \"deadline exceeded\" }\nfunc (timeoutError) Timeout() bool   { return true }\nfunc (timeoutError) Temporary() bool { return true }\n\ntype pipeAddr struct{}\n\nfunc (pipeAddr) Network() string { return \"pipe\" }\nfunc (pipeAddr) String() string  { return \"pipe\" }\n\ntype pipe struct {\n\twrMu sync.Mutex // Serialize Write operations\n\n\t// Used by local Read to interact with remote Write.\n\t// Successful receive on rdRx is always followed by send on rdTx.\n\trdRx <-chan []byte\n\trdTx chan<- int\n\n\t// Used by local Write to interact with remote Read.\n\t// Successful send on wrTx is always followed by receive on wrRx.\n\twrTx chan<- []byte\n\twrRx <-chan int\n\n\tonce       sync.Once // Protects closing localDone\n\tlocalDone  chan struct{}\n\tremoteDone <-chan struct{}\n\n\treadDeadline  pipeDeadline\n\twriteDeadline pipeDeadline\n}\n\n// Pipe creates a synchronous, in-memory, full duplex\n// network connection; both ends implement the Conn interface.\n// Reads on one end are matched with writes on the other,\n// copying data directly between the two; there is no internal\n// buffering.\nfunc Pipe() (net.Conn, net.Conn) {\n\tcb1 := make(chan []byte)\n\tcb2 := make(chan []byte)\n\tcn1 := make(chan int)\n\tcn2 := make(chan int)\n\tdone1 := make(chan struct{})\n\tdone2 := make(chan struct{})\n\n\tp1 := &pipe{\n\t\trdRx: cb1, rdTx: cn1,\n\t\twrTx: cb2, wrRx: cn2,\n\t\tlocalDone: done1, remoteDone: done2,\n\t\treadDeadline:  makePipeDeadline(),\n\t\twriteDeadline: makePipeDeadline(),\n\t}\n\tp2 := &pipe{\n\t\trdRx: cb2, rdTx: cn2,\n\t\twrTx: cb1, wrRx: cn1,\n\t\tlocalDone: done2, remoteDone: done1,\n\t\treadDeadline:  makePipeDeadline(),\n\t\twriteDeadline: makePipeDeadline(),\n\t}\n\treturn p1, p2\n}\n\nfunc (*pipe) LocalAddr() net.Addr  { return pipeAddr{} }\nfunc (*pipe) RemoteAddr() net.Addr { return pipeAddr{} }\n\nfunc (p *pipe) Read(b []byte) (int, error) {\n\tn, err := p.read(b)\n\tif err != nil && err != io.EOF && err != io.ErrClosedPipe {\n\t\terr = &net.OpError{Op: \"read\", Net: \"pipe\", Err: err}\n\t}\n\treturn n, err\n}\n\nfunc (p *pipe) read(b []byte) (n int, err error) {\n\tswitch {\n\tcase isClosedChan(p.localDone):\n\t\treturn 0, io.ErrClosedPipe\n\tcase isClosedChan(p.remoteDone):\n\t\treturn 0, io.EOF\n\tcase isClosedChan(p.readDeadline.wait()):\n\t\treturn 0, timeoutError{}\n\t}\n\n\tselect {\n\tcase bw := <-p.rdRx:\n\t\tnr := copy(b, bw)\n\t\tp.rdTx <- nr\n\t\treturn nr, nil\n\tcase <-p.localDone:\n\t\treturn 0, io.ErrClosedPipe\n\tcase <-p.remoteDone:\n\t\treturn 0, io.EOF\n\tcase <-p.readDeadline.wait():\n\t\treturn 0, timeoutError{}\n\t}\n}\n\nfunc (p *pipe) Write(b []byte) (int, error) {\n\tn, err := p.write(b)\n\tif err != nil && err != io.ErrClosedPipe {\n\t\terr = &net.OpError{Op: \"write\", Net: \"pipe\", Err: err}\n\t}\n\treturn n, err\n}\n\nfunc (p *pipe) write(b []byte) (n int, err error) {\n\tswitch {\n\tcase isClosedChan(p.localDone):\n\t\treturn 0, io.ErrClosedPipe\n\tcase isClosedChan(p.remoteDone):\n\t\treturn 0, io.ErrClosedPipe\n\tcase isClosedChan(p.writeDeadline.wait()):\n\t\treturn 0, timeoutError{}\n\t}\n\n\tp.wrMu.Lock() // Ensure entirety of b is written together\n\tdefer p.wrMu.Unlock()\n\tfor once := true; once || len(b) > 0; once = false {\n\t\tselect {\n\t\tcase p.wrTx <- b:\n\t\t\tnw := <-p.wrRx\n\t\t\tb = b[nw:]\n\t\t\tn += nw\n\t\tcase <-p.localDone:\n\t\t\treturn n, io.ErrClosedPipe\n\t\tcase <-p.remoteDone:\n\t\t\treturn n, io.ErrClosedPipe\n\t\tcase <-p.writeDeadline.wait():\n\t\t\treturn n, timeoutError{}\n\t\t}\n\t}\n\treturn n, nil\n}\n\nfunc (p *pipe) SetDeadline(t time.Time) error {\n\tif isClosedChan(p.localDone) || isClosedChan(p.remoteDone) {\n\t\treturn io.ErrClosedPipe\n\t}\n\tp.readDeadline.set(t)\n\tp.writeDeadline.set(t)\n\treturn nil\n}\n\nfunc (p *pipe) SetReadDeadline(t time.Time) error {\n\tif isClosedChan(p.localDone) || isClosedChan(p.remoteDone) {\n\t\treturn io.ErrClosedPipe\n\t}\n\tp.readDeadline.set(t)\n\treturn nil\n}\n\nfunc (p *pipe) SetWriteDeadline(t time.Time) error {\n\tif isClosedChan(p.localDone) || isClosedChan(p.remoteDone) {\n\t\treturn io.ErrClosedPipe\n\t}\n\tp.writeDeadline.set(t)\n\treturn nil\n}\n\nfunc (p *pipe) Close() error {\n\tp.once.Do(func() { close(p.localDone) })\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/akutz/memconn/memconn_provider.go",
    "content": "package memconn\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Provider is used to track named MemConn objects.\ntype Provider struct {\n\tnets      networkMap\n\tlisteners listenerCache\n}\n\ntype listenerCache struct {\n\tsync.RWMutex\n\tcache map[string]*Listener\n}\n\ntype networkMap struct {\n\tsync.RWMutex\n\tcache map[string]string\n}\n\n// MapNetwork enables mapping the network value provided to this Provider's\n// Dial and Listen functions from the specified \"from\" value to the\n// specified \"to\" value.\n//\n// For example, calling MapNetwork(\"tcp\", \"memu\") means a subsequent\n// Dial(\"tcp\", \"address\") gets translated to Dial(\"memu\", \"address\").\n//\n// Calling MapNetwork(\"tcp\", \"\") removes any previous translation for\n// the \"tcp\" network.\nfunc (p *Provider) MapNetwork(from, to string) {\n\tp.nets.Lock()\n\tdefer p.nets.Unlock()\n\tif p.nets.cache == nil {\n\t\tp.nets.cache = map[string]string{}\n\t}\n\tif to == \"\" {\n\t\tdelete(p.nets.cache, from)\n\t\treturn\n\t}\n\tp.nets.cache[from] = to\n}\n\nfunc (p *Provider) mapNetwork(network string) string {\n\tp.nets.RLock()\n\tdefer p.nets.RUnlock()\n\tif to, ok := p.nets.cache[network]; ok {\n\t\treturn to\n\t}\n\treturn network\n}\n\n// Listen begins listening at address for the specified network.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// When the specified address is already in use on the specified\n// network an error is returned.\n//\n// When the provided network is unknown the operation defers to\n// net.Dial.\nfunc (p *Provider) Listen(network, address string) (net.Listener, error) {\n\tswitch p.mapNetwork(network) {\n\tcase networkMemb, networkMemu:\n\t\treturn p.ListenMem(\n\t\t\tnetwork, &Addr{Name: address, network: network})\n\tdefault:\n\t\treturn net.Listen(network, address)\n\t}\n}\n\n// ListenMem begins listening at laddr.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// If laddr is nil then ListenMem listens on \"localhost\" on the\n// specified network.\nfunc (p *Provider) ListenMem(network string, laddr *Addr) (*Listener, error) {\n\n\tswitch p.mapNetwork(network) {\n\tcase networkMemb, networkMemu:\n\t\t// If laddr is not specified then set it to the reserved name\n\t\t// \"localhost\".\n\t\tif laddr == nil {\n\t\t\tladdr = &Addr{Name: addrLocalhost, network: network}\n\t\t} else {\n\t\t\tladdr.network = network\n\t\t}\n\tdefault:\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   laddr,\n\t\t\tSource: laddr,\n\t\t\tNet:    network,\n\t\t\tOp:     \"listen\",\n\t\t\tErr:    errors.New(\"unknown network\"),\n\t\t}\n\t}\n\n\tp.listeners.Lock()\n\tdefer p.listeners.Unlock()\n\n\tif p.listeners.cache == nil {\n\t\tp.listeners.cache = map[string]*Listener{}\n\t}\n\n\tif _, ok := p.listeners.cache[laddr.Name]; ok {\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   laddr,\n\t\t\tSource: laddr,\n\t\t\tNet:    network,\n\t\t\tOp:     \"listen\",\n\t\t\tErr:    errors.New(\"addr unavailable\"),\n\t\t}\n\t}\n\n\tl := &Listener{\n\t\taddr: *laddr,\n\t\tdone: make(chan struct{}),\n\t\trmvd: make(chan struct{}),\n\t\trcvr: make(chan *Conn, 1),\n\t}\n\n\t// Start a goroutine that removes the listener from\n\t// the cache once the listener is closed.\n\tgo func() {\n\t\t<-l.done\n\t\tp.listeners.Lock()\n\t\tdefer p.listeners.Unlock()\n\t\tdelete(p.listeners.cache, laddr.Name)\n\t\tclose(l.rmvd)\n\t}()\n\n\tp.listeners.cache[laddr.Name] = l\n\treturn l, nil\n}\n\n// Dial dials a named connection.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// When the provided network is unknown the operation defers to\n// net.Dial.\nfunc (p *Provider) Dial(network, address string) (net.Conn, error) {\n\treturn p.DialContext(nil, network, address)\n}\n\n// DialMem dials a named connection.\n//\n// Known networks are \"memb\" (memconn buffered) and \"memu\" (memconn unbuffered).\n//\n// If laddr is nil then a new address is generated using\n// time.Now().UnixNano(). Please note that client addresses are\n// not required to be unique.\n//\n// If raddr is nil then the \"localhost\" endpoint is used on the\n// specified network.\nfunc (p *Provider) DialMem(\n\tnetwork string, laddr, raddr *Addr) (*Conn, error) {\n\n\treturn p.DialMemContext(nil, network, laddr, raddr)\n}\n\n// DialContext dials a named connection using a\n// Go context to provide timeout behavior.\n//\n// Please see Dial for more information.\nfunc (p *Provider) DialContext(\n\tctx context.Context,\n\tnetwork, address string) (net.Conn, error) {\n\n\tswitch p.mapNetwork(network) {\n\tcase networkMemb, networkMemu:\n\t\treturn p.DialMemContext(\n\t\t\tctx, network, nil, &Addr{\n\t\t\t\tName:    address,\n\t\t\t\tnetwork: network,\n\t\t\t})\n\tdefault:\n\t\tif ctx == nil {\n\t\t\treturn net.Dial(network, address)\n\t\t}\n\t\treturn (&net.Dialer{}).DialContext(ctx, network, address)\n\t}\n}\n\n// DialMemContext dials a named connection using a\n// Go context to provide timeout behavior.\n//\n// Please see DialMem for more information.\nfunc (p *Provider) DialMemContext(\n\tctx context.Context,\n\tnetwork string,\n\tladdr, raddr *Addr) (*Conn, error) {\n\n\tswitch p.mapNetwork(network) {\n\tcase networkMemb, networkMemu:\n\t\t// If laddr is not specified then create one with the current\n\t\t// epoch in nanoseconds. This value need not be unique.\n\t\tif laddr == nil {\n\t\t\tladdr = &Addr{\n\t\t\t\tName:    fmt.Sprintf(\"%d\", time.Now().UnixNano()),\n\t\t\t\tnetwork: network,\n\t\t\t}\n\t\t} else {\n\t\t\tladdr.network = network\n\t\t}\n\t\tif raddr == nil {\n\t\t\traddr = &Addr{Name: addrLocalhost, network: network}\n\t\t} else {\n\t\t\traddr.network = network\n\t\t}\n\tdefault:\n\t\treturn nil, &net.OpError{\n\t\t\tAddr:   raddr,\n\t\t\tSource: laddr,\n\t\t\tNet:    network,\n\t\t\tOp:     \"dial\",\n\t\t\tErr:    errors.New(\"unknown network\"),\n\t\t}\n\t}\n\n\tp.listeners.RLock()\n\tdefer p.listeners.RUnlock()\n\n\tif l, ok := p.listeners.cache[raddr.Name]; ok {\n\t\t// Update the provided raddr with the actual network type used\n\t\t// by the listener.\n\t\traddr.network = l.addr.network\n\t\treturn l.dial(ctx, network, *laddr, *raddr)\n\t}\n\n\treturn nil, &net.OpError{\n\t\tAddr:   raddr,\n\t\tSource: laddr,\n\t\tNet:    network,\n\t\tOp:     \"dial\",\n\t\tErr:    errors.New(\"unknown remote address\"),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n\n.idea/\n\nescargs\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/.golangci.yml",
    "content": "# run:\n#   # timeout for analysis, e.g. 30s, 5m, default is 1m\n#   timeout: 5m\n\nlinters:\n  disable-all: true\n  enable:\n    - bodyclose\n    - deadcode\n    - depguard\n    - dogsled\n    - goconst\n    - gocritic\n    - gofmt\n    - goimports\n    - golint\n    - gosec\n    - gosimple\n    - govet\n    - ineffassign\n    - interfacer\n    - maligned\n    - misspell\n    - prealloc\n    - scopelint\n    - staticcheck\n    - structcheck\n    - stylecheck\n    - typecheck\n    - unconvert\n    - unparam\n    - unused\n    - misspell\n    - wsl\n\nissues:\n  exclude-rules:\n    - text: \"Use of weak random number generator\"\n      linters:\n        - gosec\n    - text: \"comment on exported var\"\n      linters:\n        - golint\n    - text: \"don't use an underscore in package name\"\n      linters:\n        - golint\n    - text: \"ST1003:\"\n      linters:\n        - stylecheck\n    # FIXME: Disabled until golangci-lint updates stylecheck with this fix:\n    # https://github.com/dominikh/go-tools/issues/389\n    - text: \"ST1016:\"\n      linters:\n        - stylecheck\n\nlinters-settings:\n  dogsled:\n    max-blank-identifiers: 3\n  maligned:\n    # print struct with more effective memory layout or not, false by default\n    suggest-new: true\n\nrun:\n  tests: false\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/.goreleaser.yml",
    "content": "# This is an example goreleaser.yaml file with some sane defaults.\n# Make sure to check the documentation at http://goreleaser.com\nbefore:\n  hooks:\n    # You may remove this if you don't use go modules.\n    - go mod download\n    # you may remove this if you don't need go generate\n    - go generate ./...\nbuilds:\n  - env:\n      - CGO_ENABLED=0\n    main: ./cmd/escargs\n    goos:\n      - linux\n      - windows\n      - darwin\narchives:\n  - replacements:\n      darwin: Darwin\n      linux: Linux\n      windows: Windows\n      386: i386\n      amd64: x86_64\nchecksum:\n  name_template: 'checksums.txt'\nsnapshot:\n  name_template: \"{{ .Tag }}-next\"\nchangelog:\n  sort: asc\n  filters:\n    exclude:\n      - '^docs:'\n      - '^test:'\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/AUTHORS",
    "content": "Alessio Treglia <alessio@debian.org>\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at alessio@debian.org. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Alessio Treglia\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/README.md",
    "content": "![Build](https://github.com/alessio/shellescape/workflows/Build/badge.svg)\n[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/alessio/shellescape?tab=overview)\n[![sourcegraph](https://sourcegraph.com/github.com/alessio/shellescape/-/badge.svg)](https://sourcegraph.com/github.com/alessio/shellescape)\n[![codecov](https://codecov.io/gh/alessio/shellescape/branch/master/graph/badge.svg)](https://codecov.io/gh/alessio/shellescape)\n[![Coverage](https://gocover.io/_badge/github.com/alessio/shellescape)](https://gocover.io/github.com/alessio/shellescape)\n[![Go Report Card](https://goreportcard.com/badge/github.com/alessio/shellescape)](https://goreportcard.com/report/github.com/alessio/shellescape)\n\n# shellescape\nEscape arbitrary strings for safe use as command line arguments.\n## Contents of the package\n\nThis package provides the `shellescape.Quote()` function that returns a\nshell-escaped copy of a string. This functionality could be helpful\nin those cases where it is known that the output of a Go program will\nbe appended to/used in the context of shell programs' command line arguments.\n\nThis work was inspired by the Python original package\n[shellescape](https://pypi.python.org/pypi/shellescape).\n\n## Usage\n\nThe following snippet shows a typical unsafe idiom:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tfmt.Printf(\"ls -l %s\\n\", os.Args[1])\n}\n```\n_[See in Go Playground](https://play.golang.org/p/Wj2WoUfH_d)_\n\nEspecially when creating pipeline of commands which might end up being\nexecuted by a shell interpreter, it is particularly unsafe to not\nescape arguments.\n\n`shellescape.Quote()` comes in handy and to safely escape strings:\n\n```go\npackage main\n\nimport (\n        \"fmt\"\n        \"os\"\n\n        \"gopkg.in/alessio/shellescape.v1\"\n)\n\nfunc main() {\n        fmt.Printf(\"ls -l %s\\n\", shellescape.Quote(os.Args[1]))\n}\n```\n_[See in Go Playground](https://play.golang.org/p/HJ_CXgSrmp)_\n\n## The escargs utility\n__escargs__ reads lines from the standard input and prints shell-escaped versions. Unlinke __xargs__, blank lines on the standard input are not discarded.\n"
  },
  {
    "path": "vendor/github.com/alessio/shellescape/shellescape.go",
    "content": "/*\nPackage shellescape provides the shellescape.Quote to escape arbitrary\nstrings for a safe use as command line arguments in the most common\nPOSIX shells.\n\nThe original Python package which this work was inspired by can be found\nat https://pypi.python.org/pypi/shellescape.\n*/\npackage shellescape // \"import gopkg.in/alessio/shellescape.v1\"\n\n/*\nThe functionality provided by shellescape.Quote could be helpful\nin those cases where it is known that the output of a Go program will\nbe appended to/used in the context of shell programs' command line arguments.\n*/\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar pattern *regexp.Regexp\n\nfunc init() {\n\tpattern = regexp.MustCompile(`[^\\w@%+=:,./-]`)\n}\n\n// Quote returns a shell-escaped version of the string s. The returned value\n// is a string that can safely be used as one token in a shell command line.\nfunc Quote(s string) string {\n\tif len(s) == 0 {\n\t\treturn \"''\"\n\t}\n\n\tif pattern.MatchString(s) {\n\t\treturn \"'\" + strings.ReplaceAll(s, \"'\", \"'\\\"'\\\"'\") + \"'\"\n\t}\n\n\treturn s\n}\n\n// QuoteCommand returns a shell-escaped version of the slice of strings.\n// The returned value is a string that can safely be used as shell command arguments.\nfunc QuoteCommand(args []string) string {\n\tl := make([]string, len(args))\n\n\tfor i, s := range args {\n\t\tl[i] = Quote(s)\n\t}\n\n\treturn strings.Join(l, \" \")\n}\n\n// StripUnsafe remove non-printable runes, e.g. control characters in\n// a string that is meant  for consumption by terminals that support\n// control characters.\nfunc StripUnsafe(s string) string {\n\treturn strings.Map(func(r rune) rune {\n\t\tif unicode.IsPrint(r) {\n\t\t\treturn r\n\t\t}\n\n\t\treturn -1\n\t}, s)\n}\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/LICENSE",
    "content": "Copyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/README.md",
    "content": "This repository holds Go packages for accessing Security Support Provider Interface on Windows. \n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/buffer.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage sspi\n\nimport (\n\t\"io\"\n\t\"unsafe\"\n)\n\nfunc (b *SecBuffer) Set(buftype uint32, data []byte) {\n\tb.BufferType = buftype\n\tif len(data) > 0 {\n\t\tb.Buffer = &data[0]\n\t\tb.BufferSize = uint32(len(data))\n\t} else {\n\t\tb.Buffer = nil\n\t\tb.BufferSize = 0\n\t}\n}\n\nfunc (b *SecBuffer) Free() error {\n\tif b.Buffer == nil {\n\t\treturn nil\n\t}\n\treturn FreeContextBuffer((*byte)(unsafe.Pointer(b.Buffer)))\n}\n\nfunc (b *SecBuffer) Bytes() []byte {\n\tif b.Buffer == nil || b.BufferSize <= 0 {\n\t\treturn nil\n\t}\n\treturn (*[(1 << 31) - 1]byte)(unsafe.Pointer(b.Buffer))[:b.BufferSize]\n}\n\nfunc (b *SecBuffer) WriteAll(w io.Writer) (int, error) {\n\tif b.BufferSize == 0 || b.Buffer == nil {\n\t\treturn 0, nil\n\t}\n\tdata := b.Bytes()\n\ttotal := 0\n\tfor {\n\t\tn, err := w.Write(data)\n\t\ttotal += n\n\t\tif err != nil {\n\t\t\treturn total, err\n\t\t}\n\t\tif n >= len(data) {\n\t\t\tbreak\n\t\t}\n\t\tdata = data[n:]\n\t}\n\treturn total, nil\n}\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/internal/common/common.go",
    "content": "// Copyright 2021 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage common\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\n\t\"github.com/alexbrainman/sspi\"\n)\n\nfunc BuildAuthIdentity(domain, username, password string) (*sspi.SEC_WINNT_AUTH_IDENTITY, error) {\n\tif len(username) == 0 {\n\t\treturn nil, errors.New(\"username parameter cannot be empty\")\n\t}\n\td, err := syscall.UTF16FromString(domain)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tu, err := syscall.UTF16FromString(username)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp, err := syscall.UTF16FromString(password)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &sspi.SEC_WINNT_AUTH_IDENTITY{\n\t\tUser:           &u[0],\n\t\tUserLength:     uint32(len(u) - 1), // do not count terminating 0\n\t\tDomain:         &d[0],\n\t\tDomainLength:   uint32(len(d) - 1), // do not count terminating 0\n\t\tPassword:       &p[0],\n\t\tPasswordLength: uint32(len(p) - 1), // do not count terminating 0\n\t\tFlags:          sspi.SEC_WINNT_AUTH_IDENTITY_UNICODE,\n\t}, nil\n}\n\nfunc UpdateContext(c *sspi.Context, dst, src []byte, targetName *uint16) (authCompleted bool, n int, err error) {\n\tvar inBuf, outBuf [1]sspi.SecBuffer\n\tinBuf[0].Set(sspi.SECBUFFER_TOKEN, src)\n\tinBufs := &sspi.SecBufferDesc{\n\t\tVersion:      sspi.SECBUFFER_VERSION,\n\t\tBuffersCount: 1,\n\t\tBuffers:      &inBuf[0],\n\t}\n\toutBuf[0].Set(sspi.SECBUFFER_TOKEN, dst)\n\toutBufs := &sspi.SecBufferDesc{\n\t\tVersion:      sspi.SECBUFFER_VERSION,\n\t\tBuffersCount: 1,\n\t\tBuffers:      &outBuf[0],\n\t}\n\tret := c.Update(targetName, outBufs, inBufs)\n\tswitch ret {\n\tcase sspi.SEC_E_OK:\n\t\t// session established -> return success\n\t\treturn true, int(outBuf[0].BufferSize), nil\n\tcase sspi.SEC_I_COMPLETE_NEEDED, sspi.SEC_I_COMPLETE_AND_CONTINUE:\n\t\tret = sspi.CompleteAuthToken(c.Handle, outBufs)\n\t\tif ret != sspi.SEC_E_OK {\n\t\t\treturn false, 0, ret\n\t\t}\n\tcase sspi.SEC_I_CONTINUE_NEEDED:\n\tdefault:\n\t\treturn false, 0, ret\n\t}\n\treturn false, int(outBuf[0].BufferSize), nil\n}\n\nfunc MakeSignature(c *sspi.Context, msg []byte, qop, seqno uint32) ([]byte, error) {\n\t_, maxSignature, _, _, err := c.Sizes()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif maxSignature == 0 {\n\t\treturn nil, errors.New(\"integrity services are not requested or unavailable\")\n\t}\n\n\tvar b [2]sspi.SecBuffer\n\tb[0].Set(sspi.SECBUFFER_DATA, msg)\n\tb[1].Set(sspi.SECBUFFER_TOKEN, make([]byte, maxSignature))\n\n\tret := sspi.MakeSignature(c.Handle, qop, sspi.NewSecBufferDesc(b[:]), seqno)\n\tif ret != sspi.SEC_E_OK {\n\t\treturn nil, ret\n\t}\n\n\treturn b[1].Bytes(), nil\n}\n\nfunc EncryptMessage(c *sspi.Context, msg []byte, qop, seqno uint32) ([]byte, error) {\n\t_ /*maxToken*/, maxSignature, cBlockSize, cSecurityTrailer, err := c.Sizes()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif maxSignature == 0 {\n\t\treturn nil, errors.New(\"integrity services are not requested or unavailable\")\n\t}\n\n\tvar b [3]sspi.SecBuffer\n\tb[0].Set(sspi.SECBUFFER_TOKEN, make([]byte, cSecurityTrailer))\n\tb[1].Set(sspi.SECBUFFER_DATA, msg)\n\tb[2].Set(sspi.SECBUFFER_PADDING, make([]byte, cBlockSize))\n\n\tret := sspi.EncryptMessage(c.Handle, qop, sspi.NewSecBufferDesc(b[:]), seqno)\n\tif ret != sspi.SEC_E_OK {\n\t\treturn nil, ret\n\t}\n\n\tr0, r1, r2 := b[0].Bytes(), b[1].Bytes(), b[2].Bytes()\n\tres := make([]byte, 0, len(r0)+len(r1)+len(r2))\n\tres = append(res, r0...)\n\tres = append(res, r1...)\n\tres = append(res, r2...)\n\n\treturn res, nil\n}\n\nfunc DecryptMessage(c *sspi.Context, msg []byte, seqno uint32) (uint32, []byte, error) {\n\tvar b [2]sspi.SecBuffer\n\tb[0].Set(sspi.SECBUFFER_STREAM, msg)\n\tb[1].Set(sspi.SECBUFFER_DATA, []byte{})\n\n\tvar qop uint32\n\tret := sspi.DecryptMessage(c.Handle, sspi.NewSecBufferDesc(b[:]), seqno, &qop)\n\tif ret != sspi.SEC_E_OK {\n\t\treturn qop, nil, ret\n\t}\n\n\treturn qop, b[1].Bytes(), nil\n}\n\nfunc VerifySignature(c *sspi.Context, msg, token []byte, seqno uint32) (uint32, error) {\n\tvar b [2]sspi.SecBuffer\n\tb[0].Set(sspi.SECBUFFER_DATA, msg)\n\tb[1].Set(sspi.SECBUFFER_TOKEN, token)\n\n\tvar qop uint32\n\n\tret := sspi.VerifySignature(c.Handle, sspi.NewSecBufferDesc(b[:]), seqno, &qop)\n\tif ret != sspi.SEC_E_OK {\n\t\treturn 0, ret\n\t}\n\n\treturn qop, nil\n}\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/mksyscall.go",
    "content": "// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sspi\n\n//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -systemdll=false -output=zsyscall_windows.go syscall.go\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/negotiate/negotiate.go",
    "content": "// Copyright 2016 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build windows\n// +build windows\n\n// Package negotiate provides access to the Microsoft Negotiate SSP Package.\npackage negotiate\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/alexbrainman/sspi\"\n\t\"github.com/alexbrainman/sspi/internal/common\"\n)\n\n// TODO: maybe (if possible) move all winapi related out of sspi and into sspi/internal/winapi\n\n// PackageInfo contains the Negotiate SSP package description.\n//\n// It's initialized best-effort during init. During early boot it may not\n// yet be loaded & available and thus this will be nil.\n//\n// Deprecated: use GetPackageInfo instead.\nvar PackageInfo *sspi.PackageInfo\n\nfunc init() {\n\tPackageInfo, _ = GetPackageInfo()\n}\n\nvar (\n\tpkgInfoMu sync.Mutex\n\tpkgInfo   *sspi.PackageInfo\n)\n\n// GetPackageInfo returns the Negotiate SSP package description.\nfunc GetPackageInfo() (*sspi.PackageInfo, error) {\n\tpkgInfoMu.Lock()\n\tdefer pkgInfoMu.Unlock()\n\tif pkgInfo != nil {\n\t\treturn pkgInfo, nil\n\t}\n\tv, err := sspi.QueryPackageInfo(sspi.NEGOSSP_NAME)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpkgInfo = v\n\treturn v, nil\n}\n\nfunc acquireCredentials(principalName string, creduse uint32, ai *sspi.SEC_WINNT_AUTH_IDENTITY) (*sspi.Credentials, error) {\n\tc, err := sspi.AcquireCredentials(principalName, sspi.NEGOSSP_NAME, creduse, (*byte)(unsafe.Pointer(ai)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}\n\n// AcquireCurrentUserCredentials acquires credentials of currently\n// logged on user. These will be used by the client to authenticate\n// itself to the server. It will also be used by the server\n// to impersonate the user.\nfunc AcquireCurrentUserCredentials() (*sspi.Credentials, error) {\n\treturn acquireCredentials(\"\", sspi.SECPKG_CRED_OUTBOUND, nil)\n}\n\n// AcquireUserCredentials acquires credentials of user described by\n// domain, username and password. These will be used by the client to\n// authenticate itself to the server. It will also be used by the\n// server to impersonate the user.\nfunc AcquireUserCredentials(domain, username, password string) (*sspi.Credentials, error) {\n\tai, err := common.BuildAuthIdentity(domain, username, password)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn acquireCredentials(\"\", sspi.SECPKG_CRED_OUTBOUND, ai)\n}\n\n// AcquireServerCredentials acquires server credentials that will\n// be used to authenticate clients.\n// The principalName parameter is passed to the underlying call to\n// the winapi AcquireCredentialsHandle function (and specifies the\n// name of the principal whose credentials the underlying handle\n// will reference).\n// As a special case, using an empty string for the principal name\n// will require the credential of the user under whose security context\n// the current process is running.\nfunc AcquireServerCredentials(principalName string) (*sspi.Credentials, error) {\n\treturn acquireCredentials(principalName, sspi.SECPKG_CRED_INBOUND, nil)\n}\n\n// ClientContext is used by the client to manage all steps of Negotiate negotiation.\ntype ClientContext struct {\n\tsctxt      *sspi.Context\n\ttargetName *uint16\n}\n\n// NewClientContext creates a new client context. It uses client\n// credentials cred generated by AcquireCurrentUserCredentials or\n// AcquireUserCredentials and SPN to start a client Negotiate\n// negotiation sequence. targetName is the service principal name\n// (SPN) or the security context of the destination server.\n// NewClientContext returns a new token to be sent to the server.\nfunc NewClientContext(cred *sspi.Credentials, targetName string) (cc *ClientContext, outputToken []byte, err error) {\n\treturn NewClientContextWithFlags(cred, targetName, sspi.ISC_REQ_CONNECTION)\n}\n\n// NewClientContextWithFlags creates a new client context. It uses client\n// credentials cred generated by AcquireCurrentUserCredentials or\n// AcquireUserCredentials and SPN to start a client Negotiate\n// negotiation sequence. targetName is the service principal name\n// (SPN) or the security context of the destination server.\n// The flags parameter is used to indicate requests for the context\n// (for example sspi.ISC_REQ_CONFIDENTIALITY|sspi.ISC_REQ_REPLAY_DETECT)\n// NewClientContextWithFlags returns a new token to be sent to the server.\nfunc NewClientContextWithFlags(cred *sspi.Credentials, targetName string, flags uint32) (cc *ClientContext, outputToken []byte, err error) {\n\tvar tname *uint16\n\tif len(targetName) > 0 {\n\t\tp, err2 := syscall.UTF16FromString(targetName)\n\t\tif err2 != nil {\n\t\t\treturn nil, nil, err2\n\t\t}\n\t\tif len(p) > 0 {\n\t\t\ttname = &p[0]\n\t\t}\n\t}\n\tpkgInfo, err := GetPackageInfo()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\totoken := make([]byte, pkgInfo.MaxToken)\n\tc := sspi.NewClientContext(cred, flags)\n\n\tauthCompleted, n, err2 := common.UpdateContext(c, otoken, nil, tname)\n\tif err2 != nil {\n\t\treturn nil, nil, err2\n\t}\n\tif authCompleted {\n\t\tc.Release()\n\t\treturn nil, nil, errors.New(\"negotiate authentication should not be completed yet\")\n\t}\n\tif n == 0 {\n\t\tc.Release()\n\t\treturn nil, nil, errors.New(\"negotiate token should not be empty\")\n\t}\n\totoken = otoken[:n]\n\treturn &ClientContext{sctxt: c, targetName: tname}, otoken, nil\n}\n\n// Release free up resources associated with client context c.\nfunc (c *ClientContext) Release() error {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.sctxt.Release()\n}\n\n// Expiry returns c expiry time.\nfunc (c *ClientContext) Expiry() time.Time {\n\treturn c.sctxt.Expiry()\n}\n\n// Update advances client part of Negotiate negotiation c. It uses\n// token received from the server and returns true if client part\n// of authentication is complete. It also returns new token to be\n// sent to the server.\nfunc (c *ClientContext) Update(token []byte) (authCompleted bool, outputToken []byte, err error) {\n\tpkgInfo, err := GetPackageInfo()\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\totoken := make([]byte, pkgInfo.MaxToken)\n\tauthDone, n, err2 := common.UpdateContext(c.sctxt, otoken, token, c.targetName)\n\tif err2 != nil {\n\t\treturn false, nil, err2\n\t}\n\tif n == 0 && !authDone {\n\t\treturn false, nil, errors.New(\"negotiate token should not be empty\")\n\t}\n\totoken = otoken[:n]\n\treturn authDone, otoken, nil\n}\n\n// Sizes queries the client context for the sizes used in per-message\n// functions. It returns the maximum token size used in authentication\n// exchanges, the maximum signature size, the preferred integral size of\n// messages, the size of any security trailer, and any error.\nfunc (c *ClientContext) Sizes() (uint32, uint32, uint32, uint32, error) {\n\treturn c.sctxt.Sizes()\n}\n\n// MakeSignature uses the established client context to create a signature\n// for the given message using the provided quality of protection flags and\n// sequence number. It returns the signature token in addition to any error.\nfunc (c *ClientContext) MakeSignature(msg []byte, qop, seqno uint32) ([]byte, error) {\n\treturn common.MakeSignature(c.sctxt, msg, qop, seqno)\n}\n\n// VerifySignature uses the established client context and signature token\n// to check that the provided message hasn't been tampered or received out\n// of sequence. It returns any quality of protection flags and any error\n// that occurred.\nfunc (c *ClientContext) VerifySignature(msg, token []byte, seqno uint32) (uint32, error) {\n\treturn common.VerifySignature(c.sctxt, msg, token, seqno)\n}\n\n// EncryptMessage uses the established client context to encrypt a message\n// using the provided quality of protection flags and sequence number.\n// It returns the signature token in addition to any error.\n// IMPORTANT: the input msg parameter is updated in place by the low-level windows api\n// so must be copied if the initial content should not be modified.\nfunc (c *ClientContext) EncryptMessage(msg []byte, qop, seqno uint32) ([]byte, error) {\n\treturn common.EncryptMessage(c.sctxt, msg, qop, seqno)\n}\n\n// DecryptMessage uses the established client context to decrypt a message\n// using the provided sequence number.\n// It returns the quality of protection flag and the decrypted message in addition to any error.\nfunc (c *ClientContext) DecryptMessage(msg []byte, seqno uint32) (uint32, []byte, error) {\n\treturn common.DecryptMessage(c.sctxt, msg, seqno)\n}\n\n// VerifyFlags determines if all flags used to construct the client context\n// were honored (see NewClientContextWithFlags).  It should be called after c.Update.\nfunc (c *ClientContext) VerifyFlags() error {\n\treturn c.sctxt.VerifyFlags()\n}\n\n// VerifySelectiveFlags determines if the given flags were honored (see NewClientContextWithFlags).\n// It should be called after c.Update.\nfunc (c *ClientContext) VerifySelectiveFlags(flags uint32) error {\n\treturn c.sctxt.VerifySelectiveFlags(flags)\n}\n\n// ServerContext is used by the server to manage all steps of Negotiate\n// negotiation. Once authentication is completed the context can be\n// used to impersonate client.\ntype ServerContext struct {\n\tsctxt *sspi.Context\n}\n\n// NewServerContext creates new server context. It uses server\n// credentials created by AcquireServerCredentials and token from\n// the client to start server Negotiate negotiation sequence.\n// It also returns new token to be sent to the client.\nfunc NewServerContext(cred *sspi.Credentials, token []byte) (sc *ServerContext, authDone bool, outputToken []byte, err error) {\n\tpkgInfo, err := GetPackageInfo()\n\tif err != nil {\n\t\treturn nil, false, nil, err\n\t}\n\totoken := make([]byte, pkgInfo.MaxToken)\n\tc := sspi.NewServerContext(cred, sspi.ASC_REQ_CONNECTION)\n\tauthDone, n, err2 := common.UpdateContext(c, otoken, token, nil)\n\tif err2 != nil {\n\t\treturn nil, false, nil, err2\n\t}\n\totoken = otoken[:n]\n\treturn &ServerContext{sctxt: c}, authDone, otoken, nil\n}\n\n// Release free up resources associated with server context c.\nfunc (c *ServerContext) Release() error {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.sctxt.Release()\n}\n\n// Expiry returns c expiry time.\nfunc (c *ServerContext) Expiry() time.Time {\n\treturn c.sctxt.Expiry()\n}\n\n// Update advances server part of Negotiate negotiation c. It uses\n// token received from the client and returns true if server part\n// of authentication is complete. It also returns new token to be\n// sent to the client.\nfunc (c *ServerContext) Update(token []byte) (authCompleted bool, outputToken []byte, err error) {\n\tpkgInfo, err := GetPackageInfo()\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\totoken := make([]byte, pkgInfo.MaxToken)\n\tauthDone, n, err2 := common.UpdateContext(c.sctxt, otoken, token, nil)\n\tif err2 != nil {\n\t\treturn false, nil, err2\n\t}\n\tif n == 0 && !authDone {\n\t\treturn false, nil, errors.New(\"negotiate token should not be empty\")\n\t}\n\totoken = otoken[:n]\n\treturn authDone, otoken, nil\n}\n\nconst _SECPKG_ATTR_NATIVE_NAMES = 13\n\ntype _SecPkgContext_NativeNames struct {\n\tClientName *uint16\n\tServerName *uint16\n}\n\n// GetUsername returns the username corresponding to the authenticated client\nfunc (c *ServerContext) GetUsername() (string, error) {\n\tvar ns _SecPkgContext_NativeNames\n\tret := sspi.QueryContextAttributes(c.sctxt.Handle, _SECPKG_ATTR_NATIVE_NAMES, (*byte)(unsafe.Pointer(&ns)))\n\tif ret != sspi.SEC_E_OK {\n\t\treturn \"\", ret\n\t}\n\tsspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ServerName)))\n\tdefer sspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ClientName)))\n\treturn syscall.UTF16ToString((*[2 << 20]uint16)(unsafe.Pointer(ns.ClientName))[:]), nil\n}\n\n// ImpersonateUser changes current OS thread user. New user is\n// the user as specified by client credentials.\nfunc (c *ServerContext) ImpersonateUser() error {\n\treturn c.sctxt.ImpersonateUser()\n}\n\n// RevertToSelf stops impersonation. It changes current OS thread\n// user to what it was before ImpersonateUser was executed.\nfunc (c *ServerContext) RevertToSelf() error {\n\treturn c.sctxt.RevertToSelf()\n}\n\n// Sizes queries the server context for the sizes used in per-message\n// functions. It returns the maximum token size used in authentication\n// exchanges, the maximum signature size, the preferred integral size of\n// messages, the size of any security trailer, and any error.\nfunc (c *ServerContext) Sizes() (uint32, uint32, uint32, uint32, error) {\n\treturn c.sctxt.Sizes()\n}\n\n// MakeSignature uses the established server context to create a signature\n// for the given message using the provided quality of protection flags and\n// sequence number. It returns the signature token in addition to any error.\nfunc (c *ServerContext) MakeSignature(msg []byte, qop, seqno uint32) ([]byte, error) {\n\treturn common.MakeSignature(c.sctxt, msg, qop, seqno)\n}\n\n// VerifySignature uses the established server context and signature token\n// to check that the provided message hasn't been tampered or received out\n// of sequence. It returns any quality of protection flags and any error\n// that occurred.\nfunc (c *ServerContext) VerifySignature(msg, token []byte, seqno uint32) (uint32, error) {\n\treturn common.VerifySignature(c.sctxt, msg, token, seqno)\n}\n\n// EncryptMessage uses the established server context to encrypt a message\n// using the provided quality of protection flags and sequence number.\n// It returns the signature token in addition to any error.\n// IMPORTANT: the input msg parameter is updated in place by the low-level windows api\n// so must be copied if the initial content should not be modified.\nfunc (c *ServerContext) EncryptMessage(msg []byte, qop, seqno uint32) ([]byte, error) {\n\treturn common.EncryptMessage(c.sctxt, msg, qop, seqno)\n}\n\n// DecryptMessage uses the established server context to decrypt a message\n// using the provided sequence number.\n// It returns the quality of protection flag and the decrypted message in addition to any error.\nfunc (c *ServerContext) DecryptMessage(msg []byte, seqno uint32) (uint32, []byte, error) {\n\treturn common.DecryptMessage(c.sctxt, msg, seqno)\n}\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/sspi.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage sspi\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// TODO: add documentation\n\ntype PackageInfo struct {\n\tCapabilities uint32\n\tVersion      uint16\n\tRPCID        uint16\n\tMaxToken     uint32\n\tName         string\n\tComment      string\n}\n\nfunc QueryPackageInfo(pkgname string) (*PackageInfo, error) {\n\tname, err := syscall.UTF16PtrFromString(pkgname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar pi *SecPkgInfo\n\tret := QuerySecurityPackageInfo(name, &pi)\n\tif ret != SEC_E_OK {\n\t\treturn nil, ret\n\t}\n\tdefer FreeContextBuffer((*byte)(unsafe.Pointer(pi)))\n\n\treturn &PackageInfo{\n\t\tCapabilities: pi.Capabilities,\n\t\tVersion:      pi.Version,\n\t\tRPCID:        pi.RPCID,\n\t\tMaxToken:     pi.MaxToken,\n\t\tName:         syscall.UTF16ToString((*[2 << 12]uint16)(unsafe.Pointer(pi.Name))[:]),\n\t\tComment:      syscall.UTF16ToString((*[2 << 12]uint16)(unsafe.Pointer(pi.Comment))[:]),\n\t}, nil\n}\n\ntype Credentials struct {\n\tHandle CredHandle\n\texpiry syscall.Filetime\n}\n\n// AcquireCredentials calls the windows AcquireCredentialsHandle function and\n// returns Credentials containing a security handle that can be used for\n// InitializeSecurityContext or AcceptSecurityContext operations.\n// As a special case, passing an empty string as the principal parameter will\n// pass a null string to the underlying function.\nfunc AcquireCredentials(principal string, pkgname string, creduse uint32, authdata *byte) (*Credentials, error) {\n\tvar principalName *uint16\n\tif principal != \"\" {\n\t\tvar err error\n\t\tprincipalName, err = syscall.UTF16PtrFromString(principal)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tname, err := syscall.UTF16PtrFromString(pkgname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar c Credentials\n\tret := AcquireCredentialsHandle(principalName, name, creduse, nil, authdata, 0, 0, &c.Handle, &c.expiry)\n\tif ret != SEC_E_OK {\n\t\treturn nil, ret\n\t}\n\treturn &c, nil\n}\n\nfunc (c *Credentials) Release() error {\n\tif c == nil {\n\t\treturn nil\n\t}\n\tret := FreeCredentialsHandle(&c.Handle)\n\tif ret != SEC_E_OK {\n\t\treturn ret\n\t}\n\treturn nil\n}\n\nfunc (c *Credentials) Expiry() time.Time {\n\treturn time.Unix(0, c.expiry.Nanoseconds())\n}\n\n// TODO: add functions to display and manage RequestedFlags and EstablishedFlags fields.\n// TODO: maybe get rid of RequestedFlags and EstablishedFlags fields, and replace them with input parameter for New...Context and return value of Update (instead of current bool parameter).\n\ntype updateFunc func(c *Context, targname *uint16, h, newh *CtxtHandle, out, in *SecBufferDesc) syscall.Errno\n\ntype Context struct {\n\tCred             *Credentials\n\tHandle           *CtxtHandle\n\thandle           CtxtHandle\n\tupdFn            updateFunc\n\texpiry           syscall.Filetime\n\tRequestedFlags   uint32\n\tEstablishedFlags uint32\n}\n\nfunc NewClientContext(cred *Credentials, flags uint32) *Context {\n\treturn &Context{\n\t\tCred:           cred,\n\t\tupdFn:          initialize,\n\t\tRequestedFlags: flags,\n\t}\n}\n\nfunc NewServerContext(cred *Credentials, flags uint32) *Context {\n\treturn &Context{\n\t\tCred:           cred,\n\t\tupdFn:          accept,\n\t\tRequestedFlags: flags,\n\t}\n}\n\nfunc initialize(c *Context, targname *uint16, h, newh *CtxtHandle, out, in *SecBufferDesc) syscall.Errno {\n\treturn InitializeSecurityContext(&c.Cred.Handle, h, targname, c.RequestedFlags,\n\t\t0, SECURITY_NATIVE_DREP, in, 0, newh, out, &c.EstablishedFlags, &c.expiry)\n}\n\nfunc accept(c *Context, targname *uint16, h, newh *CtxtHandle, out, in *SecBufferDesc) syscall.Errno {\n\treturn AcceptSecurityContext(&c.Cred.Handle, h, in, c.RequestedFlags,\n\t\tSECURITY_NATIVE_DREP, newh, out, &c.EstablishedFlags, &c.expiry)\n}\n\nfunc (c *Context) Update(targname *uint16, out, in *SecBufferDesc) syscall.Errno {\n\th := c.Handle\n\tif c.Handle == nil {\n\t\tc.Handle = &c.handle\n\t}\n\treturn c.updFn(c, targname, h, c.Handle, out, in)\n}\n\nfunc (c *Context) Release() error {\n\tif c == nil {\n\t\treturn nil\n\t}\n\tret := DeleteSecurityContext(c.Handle)\n\tif ret != SEC_E_OK {\n\t\treturn ret\n\t}\n\treturn nil\n}\n\nfunc (c *Context) Expiry() time.Time {\n\treturn time.Unix(0, c.expiry.Nanoseconds())\n}\n\n// TODO: add comment to function doco that this \"impersonation\" is applied to current OS thread.\nfunc (c *Context) ImpersonateUser() error {\n\tret := ImpersonateSecurityContext(c.Handle)\n\tif ret != SEC_E_OK {\n\t\treturn ret\n\t}\n\treturn nil\n}\n\nfunc (c *Context) RevertToSelf() error {\n\tret := RevertSecurityContext(c.Handle)\n\tif ret != SEC_E_OK {\n\t\treturn ret\n\t}\n\treturn nil\n}\n\n// Sizes queries the context for the sizes used in per-message functions.\n// It returns the maximum token size used in authentication exchanges, the\n// maximum signature size, the preferred integral size of messages, the\n// size of any security trailer, and any error.\nfunc (c *Context) Sizes() (uint32, uint32, uint32, uint32, error) {\n\tvar s _SecPkgContext_Sizes\n\tret := QueryContextAttributes(c.Handle, _SECPKG_ATTR_SIZES, (*byte)(unsafe.Pointer(&s)))\n\tif ret != SEC_E_OK {\n\t\treturn 0, 0, 0, 0, ret\n\t}\n\treturn s.MaxToken, s.MaxSignature, s.BlockSize, s.SecurityTrailer, nil\n}\n\n// VerifyFlags determines if all flags used to construct the context\n// were honored (see NewClientContext).  It should be called after c.Update.\nfunc (c *Context) VerifyFlags() error {\n\treturn c.VerifySelectiveFlags(c.RequestedFlags)\n}\n\n// VerifySelectiveFlags determines if the given flags were honored (see NewClientContext).\n// It should be called after c.Update.\nfunc (c *Context) VerifySelectiveFlags(flags uint32) error {\n\tif valid, missing, extra := verifySelectiveFlags(flags, c.RequestedFlags); !valid {\n\t\treturn fmt.Errorf(\"sspi: invalid flags check: desired=%b requested=%b missing=%b extra=%b\", flags, c.RequestedFlags, missing, extra)\n\t}\n\tif valid, missing, extra := verifySelectiveFlags(flags, c.EstablishedFlags); !valid {\n\t\treturn fmt.Errorf(\"sspi: invalid flags: desired=%b established=%b missing=%b extra=%b\", flags, c.EstablishedFlags, missing, extra)\n\t}\n\treturn nil\n}\n\n// verifySelectiveFlags determines if all bits requested in flags are set in establishedFlags.\n// missing represents the bits set in flags that are not set in establishedFlags.\n// extra represents the bits set in establishedFlags that are not set in flags.\n// valid is true and missing is zero when establishedFlags has all of the requested flags.\nfunc verifySelectiveFlags(flags, establishedFlags uint32) (valid bool, missing, extra uint32) {\n\tmissing = flags&establishedFlags ^ flags\n\textra = flags | establishedFlags ^ flags\n\tvalid = missing == 0\n\treturn valid, missing, extra\n}\n\n// NewSecBufferDesc returns an initialized SecBufferDesc describing the\n// provided SecBuffer.\nfunc NewSecBufferDesc(b []SecBuffer) *SecBufferDesc {\n\treturn &SecBufferDesc{\n\t\tVersion:      SECBUFFER_VERSION,\n\t\tBuffersCount: uint32(len(b)),\n\t\tBuffers:      &b[0],\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/syscall.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage sspi\n\nimport (\n\t\"syscall\"\n)\n\nconst (\n\tSEC_E_OK = syscall.Errno(0)\n\n\tSEC_I_COMPLETE_AND_CONTINUE = syscall.Errno(590612)\n\tSEC_I_COMPLETE_NEEDED       = syscall.Errno(590611)\n\tSEC_I_CONTINUE_NEEDED       = syscall.Errno(590610)\n\n\tSEC_E_LOGON_DENIED       = syscall.Errno(0x8009030c)\n\tSEC_E_CONTEXT_EXPIRED    = syscall.Errno(0x80090317) // not sure if the value is valid\n\tSEC_E_INCOMPLETE_MESSAGE = syscall.Errno(0x80090318)\n\n\tNTLMSP_NAME             = \"NTLM\"\n\tMICROSOFT_KERBEROS_NAME = \"Kerberos\"\n\tNEGOSSP_NAME            = \"Negotiate\"\n\tUNISP_NAME              = \"Microsoft Unified Security Protocol Provider\"\n\n\t_SECPKG_ATTR_SIZES            = 0\n\t_SECPKG_ATTR_NAMES            = 1\n\t_SECPKG_ATTR_LIFESPAN         = 2\n\t_SECPKG_ATTR_DCE_INFO         = 3\n\t_SECPKG_ATTR_STREAM_SIZES     = 4\n\t_SECPKG_ATTR_KEY_INFO         = 5\n\t_SECPKG_ATTR_AUTHORITY        = 6\n\t_SECPKG_ATTR_PROTO_INFO       = 7\n\t_SECPKG_ATTR_PASSWORD_EXPIRY  = 8\n\t_SECPKG_ATTR_SESSION_KEY      = 9\n\t_SECPKG_ATTR_PACKAGE_INFO     = 10\n\t_SECPKG_ATTR_USER_FLAGS       = 11\n\t_SECPKG_ATTR_NEGOTIATION_INFO = 12\n\t_SECPKG_ATTR_NATIVE_NAMES     = 13\n\t_SECPKG_ATTR_FLAGS            = 14\n)\n\ntype SecPkgInfo struct {\n\tCapabilities uint32\n\tVersion      uint16\n\tRPCID        uint16\n\tMaxToken     uint32\n\tName         *uint16\n\tComment      *uint16\n}\n\ntype _SecPkgContext_Sizes struct {\n\tMaxToken        uint32\n\tMaxSignature    uint32\n\tBlockSize       uint32\n\tSecurityTrailer uint32\n}\n\n//sys\tQuerySecurityPackageInfo(pkgname *uint16, pkginfo **SecPkgInfo) (ret syscall.Errno) = secur32.QuerySecurityPackageInfoW\n//sys\tFreeContextBuffer(buf *byte) (ret syscall.Errno) = secur32.FreeContextBuffer\n\nconst (\n\tSECPKG_CRED_INBOUND  = 1\n\tSECPKG_CRED_OUTBOUND = 2\n\tSECPKG_CRED_BOTH     = (SECPKG_CRED_OUTBOUND | SECPKG_CRED_INBOUND)\n\n\tSEC_WINNT_AUTH_IDENTITY_UNICODE = 0x2\n)\n\ntype SEC_WINNT_AUTH_IDENTITY struct {\n\tUser           *uint16\n\tUserLength     uint32\n\tDomain         *uint16\n\tDomainLength   uint32\n\tPassword       *uint16\n\tPasswordLength uint32\n\tFlags          uint32\n}\n\ntype LUID struct {\n\tLowPart  uint32\n\tHighPart int32\n}\n\ntype CredHandle struct {\n\tLower uintptr\n\tUpper uintptr\n}\n\n//sys\tAcquireCredentialsHandle(principal *uint16, pkgname *uint16, creduse uint32, logonid *LUID, authdata *byte, getkeyfn uintptr, getkeyarg uintptr, handle *CredHandle, expiry *syscall.Filetime) (ret syscall.Errno) = secur32.AcquireCredentialsHandleW\n//sys\tFreeCredentialsHandle(handle *CredHandle) (ret syscall.Errno) = secur32.FreeCredentialsHandle\n\nconst (\n\tSECURITY_NATIVE_DREP = 16\n\n\tSECBUFFER_DATA           = 1\n\tSECBUFFER_TOKEN          = 2\n\tSECBUFFER_PKG_PARAMS     = 3\n\tSECBUFFER_MISSING        = 4\n\tSECBUFFER_EXTRA          = 5\n\tSECBUFFER_STREAM_TRAILER = 6\n\tSECBUFFER_STREAM_HEADER  = 7\n\tSECBUFFER_PADDING        = 9\n\tSECBUFFER_STREAM         = 10\n\tSECBUFFER_READONLY       = 0x80000000\n\tSECBUFFER_ATTRMASK       = 0xf0000000\n\tSECBUFFER_VERSION        = 0\n\tSECBUFFER_EMPTY          = 0\n\n\tISC_REQ_DELEGATE               = 1\n\tISC_REQ_MUTUAL_AUTH            = 2\n\tISC_REQ_REPLAY_DETECT          = 4\n\tISC_REQ_SEQUENCE_DETECT        = 8\n\tISC_REQ_CONFIDENTIALITY        = 16\n\tISC_REQ_USE_SESSION_KEY        = 32\n\tISC_REQ_PROMPT_FOR_CREDS       = 64\n\tISC_REQ_USE_SUPPLIED_CREDS     = 128\n\tISC_REQ_ALLOCATE_MEMORY        = 256\n\tISC_REQ_USE_DCE_STYLE          = 512\n\tISC_REQ_DATAGRAM               = 1024\n\tISC_REQ_CONNECTION             = 2048\n\tISC_REQ_EXTENDED_ERROR         = 16384\n\tISC_REQ_STREAM                 = 32768\n\tISC_REQ_INTEGRITY              = 65536\n\tISC_REQ_MANUAL_CRED_VALIDATION = 524288\n\tISC_REQ_HTTP                   = 268435456\n\n\tASC_REQ_DELEGATE        = 1\n\tASC_REQ_MUTUAL_AUTH     = 2\n\tASC_REQ_REPLAY_DETECT   = 4\n\tASC_REQ_SEQUENCE_DETECT = 8\n\tASC_REQ_CONFIDENTIALITY = 16\n\tASC_REQ_USE_SESSION_KEY = 32\n\tASC_REQ_ALLOCATE_MEMORY = 256\n\tASC_REQ_USE_DCE_STYLE   = 512\n\tASC_REQ_DATAGRAM        = 1024\n\tASC_REQ_CONNECTION      = 2048\n\tASC_REQ_EXTENDED_ERROR  = 32768\n\tASC_REQ_STREAM          = 65536\n\tASC_REQ_INTEGRITY       = 131072\n)\n\ntype CtxtHandle struct {\n\tLower uintptr\n\tUpper uintptr\n}\n\ntype SecBuffer struct {\n\tBufferSize uint32\n\tBufferType uint32\n\tBuffer     *byte\n}\n\ntype SecBufferDesc struct {\n\tVersion      uint32\n\tBuffersCount uint32\n\tBuffers      *SecBuffer\n}\n\n//sys\tInitializeSecurityContext(credential *CredHandle, context *CtxtHandle, targname *uint16, contextreq uint32, reserved1 uint32, targdatarep uint32, input *SecBufferDesc, reserved2 uint32, newcontext *CtxtHandle, output *SecBufferDesc, contextattr *uint32, expiry *syscall.Filetime) (ret syscall.Errno) = secur32.InitializeSecurityContextW\n//sys\tAcceptSecurityContext(credential *CredHandle, context *CtxtHandle, input *SecBufferDesc, contextreq uint32, targdatarep uint32, newcontext *CtxtHandle, output *SecBufferDesc, contextattr *uint32, expiry *syscall.Filetime) (ret syscall.Errno) = secur32.AcceptSecurityContext\n//sys\tCompleteAuthToken(context *CtxtHandle, token *SecBufferDesc) (ret syscall.Errno) = secur32.CompleteAuthToken\n//sys\tDeleteSecurityContext(context *CtxtHandle) (ret syscall.Errno) = secur32.DeleteSecurityContext\n//sys\tImpersonateSecurityContext(context *CtxtHandle) (ret syscall.Errno) = secur32.ImpersonateSecurityContext\n//sys\tRevertSecurityContext(context *CtxtHandle) (ret syscall.Errno) = secur32.RevertSecurityContext\n//sys\tQueryContextAttributes(context *CtxtHandle, attribute uint32, buf *byte) (ret syscall.Errno) = secur32.QueryContextAttributesW\n//sys\tEncryptMessage(context *CtxtHandle, qop uint32, message *SecBufferDesc, messageseqno uint32) (ret syscall.Errno) = secur32.EncryptMessage\n//sys\tDecryptMessage(context *CtxtHandle, message *SecBufferDesc, messageseqno uint32, qop *uint32) (ret syscall.Errno) = secur32.DecryptMessage\n//sys\tApplyControlToken(context *CtxtHandle, input *SecBufferDesc) (ret syscall.Errno) = secur32.ApplyControlToken\n//sys\tMakeSignature(context *CtxtHandle, qop uint32, message *SecBufferDesc, messageseqno uint32) (ret syscall.Errno) = secur32.MakeSignature\n//sys\tVerifySignature(context *CtxtHandle, message *SecBufferDesc, messageseqno uint32, qop *uint32) (ret syscall.Errno) = secur32.VerifySignature\n"
  },
  {
    "path": "vendor/github.com/alexbrainman/sspi/zsyscall_windows.go",
    "content": "// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT\n\npackage sspi\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ unsafe.Pointer\n\n// Do the interface allocations only once for common\n// Errno values.\nconst (\n\terrnoERROR_IO_PENDING = 997\n)\n\nvar (\n\terrERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn nil\n\tcase errnoERROR_IO_PENDING:\n\t\treturn errERROR_IO_PENDING\n\t}\n\t// TODO: add more here, after collecting data on the common\n\t// error values see on Windows. (perhaps when running\n\t// all.bat?)\n\treturn e\n}\n\nvar (\n\tmodsecur32 = syscall.NewLazyDLL(\"secur32.dll\")\n\n\tprocQuerySecurityPackageInfoW  = modsecur32.NewProc(\"QuerySecurityPackageInfoW\")\n\tprocFreeContextBuffer          = modsecur32.NewProc(\"FreeContextBuffer\")\n\tprocAcquireCredentialsHandleW  = modsecur32.NewProc(\"AcquireCredentialsHandleW\")\n\tprocFreeCredentialsHandle      = modsecur32.NewProc(\"FreeCredentialsHandle\")\n\tprocInitializeSecurityContextW = modsecur32.NewProc(\"InitializeSecurityContextW\")\n\tprocAcceptSecurityContext      = modsecur32.NewProc(\"AcceptSecurityContext\")\n\tprocCompleteAuthToken          = modsecur32.NewProc(\"CompleteAuthToken\")\n\tprocDeleteSecurityContext      = modsecur32.NewProc(\"DeleteSecurityContext\")\n\tprocImpersonateSecurityContext = modsecur32.NewProc(\"ImpersonateSecurityContext\")\n\tprocRevertSecurityContext      = modsecur32.NewProc(\"RevertSecurityContext\")\n\tprocQueryContextAttributesW    = modsecur32.NewProc(\"QueryContextAttributesW\")\n\tprocEncryptMessage             = modsecur32.NewProc(\"EncryptMessage\")\n\tprocDecryptMessage             = modsecur32.NewProc(\"DecryptMessage\")\n\tprocApplyControlToken          = modsecur32.NewProc(\"ApplyControlToken\")\n\tprocMakeSignature              = modsecur32.NewProc(\"MakeSignature\")\n\tprocVerifySignature            = modsecur32.NewProc(\"VerifySignature\")\n)\n\nfunc QuerySecurityPackageInfo(pkgname *uint16, pkginfo **SecPkgInfo) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procQuerySecurityPackageInfoW.Addr(), 2, uintptr(unsafe.Pointer(pkgname)), uintptr(unsafe.Pointer(pkginfo)), 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc FreeContextBuffer(buf *byte) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procFreeContextBuffer.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc AcquireCredentialsHandle(principal *uint16, pkgname *uint16, creduse uint32, logonid *LUID, authdata *byte, getkeyfn uintptr, getkeyarg uintptr, handle *CredHandle, expiry *syscall.Filetime) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall9(procAcquireCredentialsHandleW.Addr(), 9, uintptr(unsafe.Pointer(principal)), uintptr(unsafe.Pointer(pkgname)), uintptr(creduse), uintptr(unsafe.Pointer(logonid)), uintptr(unsafe.Pointer(authdata)), uintptr(getkeyfn), uintptr(getkeyarg), uintptr(unsafe.Pointer(handle)), uintptr(unsafe.Pointer(expiry)))\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc FreeCredentialsHandle(handle *CredHandle) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procFreeCredentialsHandle.Addr(), 1, uintptr(unsafe.Pointer(handle)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc InitializeSecurityContext(credential *CredHandle, context *CtxtHandle, targname *uint16, contextreq uint32, reserved1 uint32, targdatarep uint32, input *SecBufferDesc, reserved2 uint32, newcontext *CtxtHandle, output *SecBufferDesc, contextattr *uint32, expiry *syscall.Filetime) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall12(procInitializeSecurityContextW.Addr(), 12, uintptr(unsafe.Pointer(credential)), uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(targname)), uintptr(contextreq), uintptr(reserved1), uintptr(targdatarep), uintptr(unsafe.Pointer(input)), uintptr(reserved2), uintptr(unsafe.Pointer(newcontext)), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(contextattr)), uintptr(unsafe.Pointer(expiry)))\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc AcceptSecurityContext(credential *CredHandle, context *CtxtHandle, input *SecBufferDesc, contextreq uint32, targdatarep uint32, newcontext *CtxtHandle, output *SecBufferDesc, contextattr *uint32, expiry *syscall.Filetime) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall9(procAcceptSecurityContext.Addr(), 9, uintptr(unsafe.Pointer(credential)), uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(input)), uintptr(contextreq), uintptr(targdatarep), uintptr(unsafe.Pointer(newcontext)), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(contextattr)), uintptr(unsafe.Pointer(expiry)))\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc CompleteAuthToken(context *CtxtHandle, token *SecBufferDesc) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procCompleteAuthToken.Addr(), 2, uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(token)), 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc DeleteSecurityContext(context *CtxtHandle) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procDeleteSecurityContext.Addr(), 1, uintptr(unsafe.Pointer(context)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc ImpersonateSecurityContext(context *CtxtHandle) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procImpersonateSecurityContext.Addr(), 1, uintptr(unsafe.Pointer(context)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc RevertSecurityContext(context *CtxtHandle) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procRevertSecurityContext.Addr(), 1, uintptr(unsafe.Pointer(context)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc QueryContextAttributes(context *CtxtHandle, attribute uint32, buf *byte) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procQueryContextAttributesW.Addr(), 3, uintptr(unsafe.Pointer(context)), uintptr(attribute), uintptr(unsafe.Pointer(buf)))\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc EncryptMessage(context *CtxtHandle, qop uint32, message *SecBufferDesc, messageseqno uint32) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall6(procEncryptMessage.Addr(), 4, uintptr(unsafe.Pointer(context)), uintptr(qop), uintptr(unsafe.Pointer(message)), uintptr(messageseqno), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc DecryptMessage(context *CtxtHandle, message *SecBufferDesc, messageseqno uint32, qop *uint32) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall6(procDecryptMessage.Addr(), 4, uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(message)), uintptr(messageseqno), uintptr(unsafe.Pointer(qop)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc ApplyControlToken(context *CtxtHandle, input *SecBufferDesc) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall(procApplyControlToken.Addr(), 2, uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(input)), 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc MakeSignature(context *CtxtHandle, qop uint32, message *SecBufferDesc, messageseqno uint32) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall6(procMakeSignature.Addr(), 4, uintptr(unsafe.Pointer(context)), uintptr(qop), uintptr(unsafe.Pointer(message)), uintptr(messageseqno), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n\nfunc VerifySignature(context *CtxtHandle, message *SecBufferDesc, messageseqno uint32, qop *uint32) (ret syscall.Errno) {\n\tr0, _, _ := syscall.Syscall6(procVerifySignature.Addr(), 4, uintptr(unsafe.Pointer(context)), uintptr(unsafe.Pointer(message)), uintptr(messageseqno), uintptr(unsafe.Pointer(qop)), 0, 0)\n\tret = syscall.Errno(r0)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/anmitsu/go-shlex/.gitignore",
    "content": "shlex.test\n"
  },
  {
    "path": "vendor/github.com/anmitsu/go-shlex/LICENSE",
    "content": "Copyright (c) anmitsu <anmitsu.s@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/anmitsu/go-shlex/README.md",
    "content": "# go-shlex\n\ngo-shlex is a library to make a lexical analyzer like Unix shell for\nGo.\n\n## Install\n\n    go get -u \"github.com/anmitsu/go-shlex\"\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/anmitsu/go-shlex\"\n)\n\nfunc main() {\n    cmd := `cp -Rdp \"file name\" 'file name2' dir\\ name`\n    words, err := shlex.Split(cmd, true)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    for _, w := range words {\n        fmt.Println(w)\n    }\n}\n```\noutput\n\n    cp\n    -Rdp\n    file name\n    file name2\n    dir name\n\n## Documentation\n\nhttp://godoc.org/github.com/anmitsu/go-shlex\n\n"
  },
  {
    "path": "vendor/github.com/anmitsu/go-shlex/shlex.go",
    "content": "// Package shlex provides a simple lexical analysis like Unix shell.\npackage shlex\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar (\n\tErrNoClosing = errors.New(\"No closing quotation\")\n\tErrNoEscaped = errors.New(\"No escaped character\")\n)\n\n// Tokenizer is the interface that classifies a token according to\n// words, whitespaces, quotations, escapes and escaped quotations.\ntype Tokenizer interface {\n\tIsWord(rune) bool\n\tIsWhitespace(rune) bool\n\tIsQuote(rune) bool\n\tIsEscape(rune) bool\n\tIsEscapedQuote(rune) bool\n}\n\n// DefaultTokenizer implements a simple tokenizer like Unix shell.\ntype DefaultTokenizer struct{}\n\nfunc (t *DefaultTokenizer) IsWord(r rune) bool {\n\treturn r == '_' || unicode.IsLetter(r) || unicode.IsNumber(r)\n}\nfunc (t *DefaultTokenizer) IsQuote(r rune) bool {\n\tswitch r {\n\tcase '\\'', '\"':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc (t *DefaultTokenizer) IsWhitespace(r rune) bool {\n\treturn unicode.IsSpace(r)\n}\nfunc (t *DefaultTokenizer) IsEscape(r rune) bool {\n\treturn r == '\\\\'\n}\nfunc (t *DefaultTokenizer) IsEscapedQuote(r rune) bool {\n\treturn r == '\"'\n}\n\n// Lexer represents a lexical analyzer.\ntype Lexer struct {\n\treader          *bufio.Reader\n\ttokenizer       Tokenizer\n\tposix           bool\n\twhitespacesplit bool\n}\n\n// NewLexer creates a new Lexer reading from io.Reader.  This Lexer\n// has a DefaultTokenizer according to posix and whitespacesplit\n// rules.\nfunc NewLexer(r io.Reader, posix, whitespacesplit bool) *Lexer {\n\treturn &Lexer{\n\t\treader:          bufio.NewReader(r),\n\t\ttokenizer:       &DefaultTokenizer{},\n\t\tposix:           posix,\n\t\twhitespacesplit: whitespacesplit,\n\t}\n}\n\n// NewLexerString creates a new Lexer reading from a string.  This\n// Lexer has a DefaultTokenizer according to posix and whitespacesplit\n// rules.\nfunc NewLexerString(s string, posix, whitespacesplit bool) *Lexer {\n\treturn NewLexer(strings.NewReader(s), posix, whitespacesplit)\n}\n\n// Split splits a string according to posix or non-posix rules.\nfunc Split(s string, posix bool) ([]string, error) {\n\treturn NewLexerString(s, posix, true).Split()\n}\n\n// SetTokenizer sets a Tokenizer.\nfunc (l *Lexer) SetTokenizer(t Tokenizer) {\n\tl.tokenizer = t\n}\n\nfunc (l *Lexer) Split() ([]string, error) {\n\tresult := make([]string, 0)\n\tfor {\n\t\ttoken, err := l.readToken()\n\t\tif token != \"\" {\n\t\t\tresult = append(result, token)\n\t\t}\n\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn result, err\n\t\t}\n\t}\n\treturn result, nil\n}\n\nfunc (l *Lexer) readToken() (string, error) {\n\tt := l.tokenizer\n\ttoken := \"\"\n\tquoted := false\n\tstate := ' '\n\tescapedstate := ' '\nscanning:\n\tfor {\n\t\tnext, _, err := l.reader.ReadRune()\n\t\tif err != nil {\n\t\t\tif t.IsQuote(state) {\n\t\t\t\treturn token, ErrNoClosing\n\t\t\t} else if t.IsEscape(state) {\n\t\t\t\treturn token, ErrNoEscaped\n\t\t\t}\n\t\t\treturn token, err\n\t\t}\n\n\t\tswitch {\n\t\tcase t.IsWhitespace(state):\n\t\t\tswitch {\n\t\t\tcase t.IsWhitespace(next):\n\t\t\t\tbreak scanning\n\t\t\tcase l.posix && t.IsEscape(next):\n\t\t\t\tescapedstate = 'a'\n\t\t\t\tstate = next\n\t\t\tcase t.IsWord(next):\n\t\t\t\ttoken += string(next)\n\t\t\t\tstate = 'a'\n\t\t\tcase t.IsQuote(next):\n\t\t\t\tif !l.posix {\n\t\t\t\t\ttoken += string(next)\n\t\t\t\t}\n\t\t\t\tstate = next\n\t\t\tdefault:\n\t\t\t\ttoken = string(next)\n\t\t\t\tif l.whitespacesplit {\n\t\t\t\t\tstate = 'a'\n\t\t\t\t} else if token != \"\" || (l.posix && quoted) {\n\t\t\t\t\tbreak scanning\n\t\t\t\t}\n\t\t\t}\n\t\tcase t.IsQuote(state):\n\t\t\tquoted = true\n\t\t\tswitch {\n\t\t\tcase next == state:\n\t\t\t\tif !l.posix {\n\t\t\t\t\ttoken += string(next)\n\t\t\t\t\tbreak scanning\n\t\t\t\t} else {\n\t\t\t\t\tstate = 'a'\n\t\t\t\t}\n\t\t\tcase l.posix && t.IsEscape(next) && t.IsEscapedQuote(state):\n\t\t\t\tescapedstate = state\n\t\t\t\tstate = next\n\t\t\tdefault:\n\t\t\t\ttoken += string(next)\n\t\t\t}\n\t\tcase t.IsEscape(state):\n\t\t\tif t.IsQuote(escapedstate) && next != state && next != escapedstate {\n\t\t\t\ttoken += string(state)\n\t\t\t}\n\t\t\ttoken += string(next)\n\t\t\tstate = escapedstate\n\t\tcase t.IsWord(state):\n\t\t\tswitch {\n\t\t\tcase t.IsWhitespace(next):\n\t\t\t\tif token != \"\" || (l.posix && quoted) {\n\t\t\t\t\tbreak scanning\n\t\t\t\t}\n\t\t\tcase l.posix && t.IsQuote(next):\n\t\t\t\tstate = next\n\t\t\tcase l.posix && t.IsEscape(next):\n\t\t\t\tescapedstate = 'a'\n\t\t\t\tstate = next\n\t\t\tcase t.IsWord(next) || t.IsQuote(next):\n\t\t\t\ttoken += string(next)\n\t\t\tdefault:\n\t\t\t\tif l.whitespacesplit {\n\t\t\t\t\ttoken += string(next)\n\t\t\t\t} else if token != \"\" {\n\t\t\t\t\tl.reader.UnreadRune()\n\t\t\t\t\tbreak scanning\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn token, nil\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/.gitignore",
    "content": "### Go template\n\n# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, built with `go test -c`\n*.test\n\n\n# Go workspace file\ngo.work\n\n# No Goland stuff in this repo\n.idea\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/LICENSE",
    "content": "Copyright (c) 2012-2023 The ANTLR Project. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. Neither name of copyright holders nor the names of its contributors\nmay be used to endorse or promote products derived from this software\nwithout specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/README.md",
    "content": "[![Go Report Card](https://goreportcard.com/badge/github.com/antlr4-go/antlr?style=flat-square)](https://goreportcard.com/report/github.com/antlr4-go/antlr)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/github.com/antlr4-go/antlr)](https://pkg.go.dev/github.com/antlr4-go/antlr)\n[![Release](https://img.shields.io/github/v/release/antlr4-go/antlr?sort=semver&style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest)\n[![Release](https://img.shields.io/github/go-mod/go-version/antlr4-go/antlr?style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=flat-square)](https://github.com/antlr4-go/antlr/commit-activity)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![GitHub stars](https://img.shields.io/github/stars/antlr4-go/antlr?style=flat-square&label=Star&maxAge=2592000)](https://GitHub.com/Naereen/StrapDown.js/stargazers/)\n# ANTLR4 Go Runtime Module Repo\n\nIMPORTANT: Please submit PRs via a clone of the https://github.com/antlr/antlr4 repo, and not here.\n\n  - Do not submit PRs or any change requests to this repo\n  - This repo is read only and is updated by the ANTLR team to create a new release of the Go Runtime for ANTLR\n  - This repo contains the Go runtime that your generated projects should import\n\n## Introduction\n\nThis repo contains the official modules for the Go Runtime for ANTLR. It is a copy of the runtime maintained\nat: https://github.com/antlr/antlr4/tree/master/runtime/Go/antlr and is automatically updated by the ANTLR team to create\nthe official Go runtime release only. No development work is carried out in this repo and PRs are not accepted here.\n\nThe dev branch of this repo is kept in sync with the dev branch of the main ANTLR repo and is updated periodically.\n\n### Why?\n\nThe `go get` command is unable to retrieve the Go runtime when it is embedded so\ndeeply in the main repo. A `go get` against the `antlr/antlr4` repo, while retrieving the correct source code for the runtime,\ndoes not correctly resolve tags and will create a reference in your `go.mod` file that is unclear, will not upgrade smoothly and\ncauses confusion.\n\nFor instance, the current Go runtime release, which is tagged with v4.13.0 in `antlr/antlr4` is retrieved by go get as:\n\n```sh\nrequire (\n\tgithub.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc\n)\n```\n\nWhere you would expect to see:\n\n```sh\nrequire (\n    github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.13.0\n)\n```\n\nThe decision was taken to create a separate org in a separate repo to hold the official Go runtime for ANTLR and\nfrom whence users can expect `go get` to behave as expected.\n\n\n# Documentation\nPlease read the official documentation at: https://github.com/antlr/antlr4/blob/master/doc/index.md for tips on\nmigrating existing projects to use the new module location and for information on how to use the Go runtime in\ngeneral.\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go",
    "content": "/*\nPackage antlr implements the Go version of the ANTLR 4 runtime.\n\n# The ANTLR Tool\n\nANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing,\nor translating structured text or binary files. It's widely used to build languages, tools, and frameworks.\nFrom a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface\n(or visitor) that makes it easy to respond to the recognition of phrases of interest.\n\n# Go Runtime\n\nAt version 4.11.x and prior, the Go runtime was not properly versioned for go modules. After this point, the runtime\nsource code to be imported was held in the `runtime/Go/antlr/v4` directory, and the go.mod file was updated to reflect the version of\nANTLR4 that it is compatible with (I.E. uses the /v4 path).\n\nHowever, this was found to be problematic, as it meant that with the runtime embedded so far underneath the root\nof the repo, the `go get` and related commands could not properly resolve the location of the go runtime source code.\nThis meant that the reference to the runtime in your `go.mod` file would refer to the correct source code, but would not\nlist the release tag such as @4.13.1 - this was confusing, to say the least.\n\nAs of 4.13.0, the runtime is now available as a go module in its own repo, and can be imported as `github.com/antlr4-go/antlr`\n(the go get command should also be used with this path). See the main documentation for the ANTLR4 project for more information,\nwhich is available at [ANTLR docs]. The documentation for using the Go runtime is available at [Go runtime docs].\n\nThis means that if you are using the source code without modules, you should also use the source code in the [new repo].\nThough we highly recommend that you use go modules, as they are now idiomatic for Go.\n\nI am aware that this change will prove Hyrum's Law, but am prepared to live with it for the common good.\n\nGo runtime author: [Jim Idle] jimi@idle.ws\n\n# Code Generation\n\nANTLR supports the generation of code in a number of [target languages], and the generated code is supported by a\nruntime library, written specifically to support the generated code in the target language. This library is the\nruntime for the Go target.\n\nTo generate code for the go target, it is generally recommended to place the source grammar files in a package of\ntheir own, and use the `.sh` script method of generating code, using the go generate directive. In that same directory\nit is usual, though not required, to place the antlr tool that should be used to generate the code. That does mean\nthat the antlr tool JAR file will be checked in to your source code control though, so you are, of course, free to use any other\nway of specifying the version of the ANTLR tool to use, such as aliasing in `.zshrc` or equivalent, or a profile in\nyour IDE, or configuration in your CI system. Checking in the jar does mean that it is easy to reproduce the build as\nit was at any point in its history.\n\nHere is a general/recommended template for an ANTLR based recognizer in Go:\n\n\t.\n\t├── parser\n\t│     ├── mygrammar.g4\n\t│     ├── antlr-4.13.1-complete.jar\n\t│     ├── generate.go\n\t│     └── generate.sh\n\t├── parsing   - generated code goes here\n\t│     └── error_listeners.go\n\t├── go.mod\n\t├── go.sum\n\t├── main.go\n\t└── main_test.go\n\nMake sure that the package statement in your grammar file(s) reflects the go package the generated code will exist in.\n\nThe generate.go file then looks like this:\n\n\tpackage parser\n\n\t//go:generate ./generate.sh\n\nAnd the generate.sh file will look similar to this:\n\n\t#!/bin/sh\n\n\talias antlr4='java -Xmx500M -cp \"./antlr4-4.13.1-complete.jar:$CLASSPATH\" org.antlr.v4.Tool'\n\tantlr4 -Dlanguage=Go -no-visitor -package parsing *.g4\n\ndepending on whether you want visitors or listeners or any other ANTLR options. Not that another option here\nis to generate the code into a\n\nFrom the command line at the root of your source package (location of go.mo)d) you can then simply issue the command:\n\n\tgo generate ./...\n\nWhich will generate the code for the parser, and place it in the parsing package. You can then use the generated code\nby importing the parsing package.\n\nThere are no hard and fast rules on this. It is just a recommendation. You can generate the code in any way and to anywhere you like.\n\n# Copyright Notice\n\nCopyright (c) 2012-2023 The ANTLR Project. All rights reserved.\n\nUse of this file is governed by the BSD 3-clause license, which can be found in the [LICENSE.txt] file in the project root.\n\n[target languages]: https://github.com/antlr/antlr4/tree/master/runtime\n[LICENSE.txt]: https://github.com/antlr/antlr4/blob/master/LICENSE.txt\n[ANTLR docs]: https://github.com/antlr/antlr4/blob/master/doc/index.md\n[new repo]: https://github.com/antlr4-go/antlr\n[Jim Idle]: https://github.com/jimidle\n[Go runtime docs]: https://github.com/antlr/antlr4/blob/master/doc/go-target.md\n*/\npackage antlr\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// ATNInvalidAltNumber is used to represent an ALT number that has yet to be calculated or\n// which is invalid for a particular struct such as [*antlr.BaseRuleContext]\nvar ATNInvalidAltNumber int\n\n// ATN represents an “[Augmented Transition Network]”, though general in ANTLR the term\n// “Augmented Recursive Transition Network” though there are some descriptions of “[Recursive Transition Network]”\n// in existence.\n//\n// ATNs represent the main networks in the system and are serialized by the code generator and support [ALL(*)].\n//\n// [Augmented Transition Network]: https://en.wikipedia.org/wiki/Augmented_transition_network\n// [ALL(*)]: https://www.antlr.org/papers/allstar-techreport.pdf\n// [Recursive Transition Network]: https://en.wikipedia.org/wiki/Recursive_transition_network\ntype ATN struct {\n\n\t// DecisionToState is the decision points for all rules, sub-rules, optional\n\t// blocks, ()+, ()*, etc. Each sub-rule/rule is a decision point, and we must track them, so we\n\t// can go back later and build DFA predictors for them.  This includes\n\t// all the rules, sub-rules, optional blocks, ()+, ()* etc...\n\tDecisionToState []DecisionState\n\n\t// grammarType is the ATN type and is used for deserializing ATNs from strings.\n\tgrammarType int\n\n\t// lexerActions is referenced by action transitions in the ATN for lexer ATNs.\n\tlexerActions []LexerAction\n\n\t// maxTokenType is the maximum value for any symbol recognized by a transition in the ATN.\n\tmaxTokenType int\n\n\tmodeNameToStartState map[string]*TokensStartState\n\n\tmodeToStartState []*TokensStartState\n\n\t// ruleToStartState maps from rule index to starting state number.\n\truleToStartState []*RuleStartState\n\n\t// ruleToStopState maps from rule index to stop state number.\n\truleToStopState []*RuleStopState\n\n\t// ruleToTokenType maps the rule index to the resulting token type for lexer\n\t// ATNs. For parser ATNs, it maps the rule index to the generated bypass token\n\t// type if ATNDeserializationOptions.isGenerateRuleBypassTransitions was\n\t// specified, and otherwise is nil.\n\truleToTokenType []int\n\n\t// ATNStates is a list of all states in the ATN, ordered by state number.\n\t//\n\tstates []ATNState\n\n\tmu      Mutex\n\tstateMu RWMutex\n\tedgeMu  RWMutex\n}\n\n// NewATN returns a new ATN struct representing the given grammarType and is used\n// for runtime deserialization of ATNs from the code generated by the ANTLR tool\nfunc NewATN(grammarType int, maxTokenType int) *ATN {\n\treturn &ATN{\n\t\tgrammarType:          grammarType,\n\t\tmaxTokenType:         maxTokenType,\n\t\tmodeNameToStartState: make(map[string]*TokensStartState),\n\t}\n}\n\n// NextTokensInContext computes and returns the set of valid tokens that can occur starting\n// in state s. If ctx is nil, the set of tokens will not include what can follow\n// the rule surrounding s. In other words, the set will be restricted to tokens\n// reachable staying within the rule of s.\nfunc (a *ATN) NextTokensInContext(s ATNState, ctx RuleContext) *IntervalSet {\n\treturn NewLL1Analyzer(a).Look(s, nil, ctx)\n}\n\n// NextTokensNoContext computes and returns the set of valid tokens that can occur starting\n// in state s and staying in same rule. [antlr.Token.EPSILON] is in set if we reach end of\n// rule.\nfunc (a *ATN) NextTokensNoContext(s ATNState) *IntervalSet {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tiset := s.GetNextTokenWithinRule()\n\tif iset == nil {\n\t\tiset = a.NextTokensInContext(s, nil)\n\t\tiset.readOnly = true\n\t\ts.SetNextTokenWithinRule(iset)\n\t}\n\treturn iset\n}\n\n// NextTokens computes and returns the set of valid tokens starting in state s, by\n// calling either [NextTokensNoContext] (ctx == nil)  or [NextTokensInContext] (ctx != nil).\nfunc (a *ATN) NextTokens(s ATNState, ctx RuleContext) *IntervalSet {\n\tif ctx == nil {\n\t\treturn a.NextTokensNoContext(s)\n\t}\n\n\treturn a.NextTokensInContext(s, ctx)\n}\n\nfunc (a *ATN) addState(state ATNState) {\n\tif state != nil {\n\t\tstate.SetATN(a)\n\t\tstate.SetStateNumber(len(a.states))\n\t}\n\n\ta.states = append(a.states, state)\n}\n\nfunc (a *ATN) removeState(state ATNState) {\n\ta.states[state.GetStateNumber()] = nil // Just free the memory; don't shift states in the slice\n}\n\nfunc (a *ATN) defineDecisionState(s DecisionState) int {\n\ta.DecisionToState = append(a.DecisionToState, s)\n\ts.setDecision(len(a.DecisionToState) - 1)\n\n\treturn s.getDecision()\n}\n\nfunc (a *ATN) getDecisionState(decision int) DecisionState {\n\tif len(a.DecisionToState) == 0 {\n\t\treturn nil\n\t}\n\n\treturn a.DecisionToState[decision]\n}\n\n// getExpectedTokens computes the set of input symbols which could follow ATN\n// state number stateNumber in the specified full parse context ctx and returns\n// the set of potentially valid input symbols which could follow the specified\n// state in the specified context. This method considers the complete parser\n// context, but does not evaluate semantic predicates (i.e. all predicates\n// encountered during the calculation are assumed true). If a path in the ATN\n// exists from the starting state to the RuleStopState of the outermost context\n// without Matching any symbols, Token.EOF is added to the returned set.\n//\n// A nil ctx defaults to ParserRuleContext.EMPTY.\n//\n// It panics if the ATN does not contain state stateNumber.\nfunc (a *ATN) getExpectedTokens(stateNumber int, ctx RuleContext) *IntervalSet {\n\tif stateNumber < 0 || stateNumber >= len(a.states) {\n\t\tpanic(\"Invalid state number.\")\n\t}\n\n\ts := a.states[stateNumber]\n\tfollowing := a.NextTokens(s, nil)\n\n\tif !following.contains(TokenEpsilon) {\n\t\treturn following\n\t}\n\n\texpected := NewIntervalSet()\n\n\texpected.addSet(following)\n\texpected.removeOne(TokenEpsilon)\n\n\tfor ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) {\n\t\tinvokingState := a.states[ctx.GetInvokingState()]\n\t\trt := invokingState.GetTransitions()[0]\n\n\t\tfollowing = a.NextTokens(rt.(*RuleTransition).followState, nil)\n\t\texpected.addSet(following)\n\t\texpected.removeOne(TokenEpsilon)\n\t\tctx = ctx.GetParent().(RuleContext)\n\t}\n\n\tif following.contains(TokenEpsilon) {\n\t\texpected.addOne(TokenEOF)\n\t}\n\n\treturn expected\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_config.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\tlexerConfig  = iota // Indicates that this ATNConfig is for a lexer\n\tparserConfig        // Indicates that this ATNConfig is for a parser\n)\n\n// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic\n// context). The syntactic context is a graph-structured stack node whose\n// path(s) to the root is the rule invocation(s) chain used to arrive in the\n// state. The semantic context is the tree of semantic predicates encountered\n// before reaching an ATN state.\ntype ATNConfig struct {\n\tprecedenceFilterSuppressed     bool\n\tstate                          ATNState\n\talt                            int\n\tcontext                        *PredictionContext\n\tsemanticContext                SemanticContext\n\treachesIntoOuterContext        int\n\tcType                          int // lexerConfig or parserConfig\n\tlexerActionExecutor            *LexerActionExecutor\n\tpassedThroughNonGreedyDecision bool\n}\n\n// NewATNConfig6 creates a new ATNConfig instance given a state, alt and context only\nfunc NewATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig {\n\treturn NewATNConfig5(state, alt, context, SemanticContextNone)\n}\n\n// NewATNConfig5 creates a new ATNConfig instance given a state, alt, context and semantic context\nfunc NewATNConfig5(state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) *ATNConfig {\n\tif semanticContext == nil {\n\t\tpanic(\"semanticContext cannot be nil\") // TODO: Necessary?\n\t}\n\n\tpac := &ATNConfig{}\n\tpac.state = state\n\tpac.alt = alt\n\tpac.context = context\n\tpac.semanticContext = semanticContext\n\tpac.cType = parserConfig\n\treturn pac\n}\n\n// NewATNConfig4 creates a new ATNConfig instance given an existing config, and a state only\nfunc NewATNConfig4(c *ATNConfig, state ATNState) *ATNConfig {\n\treturn NewATNConfig(c, state, c.GetContext(), c.GetSemanticContext())\n}\n\n// NewATNConfig3 creates a new ATNConfig instance given an existing config, a state and a semantic context\nfunc NewATNConfig3(c *ATNConfig, state ATNState, semanticContext SemanticContext) *ATNConfig {\n\treturn NewATNConfig(c, state, c.GetContext(), semanticContext)\n}\n\n// NewATNConfig2 creates a new ATNConfig instance given an existing config, and a context only\nfunc NewATNConfig2(c *ATNConfig, semanticContext SemanticContext) *ATNConfig {\n\treturn NewATNConfig(c, c.GetState(), c.GetContext(), semanticContext)\n}\n\n// NewATNConfig1 creates a new ATNConfig instance given an existing config, a state, and a context only\nfunc NewATNConfig1(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig {\n\treturn NewATNConfig(c, state, context, c.GetSemanticContext())\n}\n\n// NewATNConfig creates a new ATNConfig instance given an existing config, a state, a context and a semantic context, other 'constructors'\n// are just wrappers around this one.\nfunc NewATNConfig(c *ATNConfig, state ATNState, context *PredictionContext, semanticContext SemanticContext) *ATNConfig {\n\tb := &ATNConfig{}\n\tb.InitATNConfig(c, state, c.GetAlt(), context, semanticContext)\n\tb.cType = parserConfig\n\treturn b\n}\n\nfunc (a *ATNConfig) InitATNConfig(c *ATNConfig, state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) {\n\n\ta.state = state\n\ta.alt = alt\n\ta.context = context\n\ta.semanticContext = semanticContext\n\ta.reachesIntoOuterContext = c.GetReachesIntoOuterContext()\n\ta.precedenceFilterSuppressed = c.getPrecedenceFilterSuppressed()\n}\n\nfunc (a *ATNConfig) getPrecedenceFilterSuppressed() bool {\n\treturn a.precedenceFilterSuppressed\n}\n\nfunc (a *ATNConfig) setPrecedenceFilterSuppressed(v bool) {\n\ta.precedenceFilterSuppressed = v\n}\n\n// GetState returns the ATN state associated with this configuration\nfunc (a *ATNConfig) GetState() ATNState {\n\treturn a.state\n}\n\n// GetAlt returns the alternative associated with this configuration\nfunc (a *ATNConfig) GetAlt() int {\n\treturn a.alt\n}\n\n// SetContext sets the rule invocation stack associated with this configuration\nfunc (a *ATNConfig) SetContext(v *PredictionContext) {\n\ta.context = v\n}\n\n// GetContext returns the rule invocation stack associated with this configuration\nfunc (a *ATNConfig) GetContext() *PredictionContext {\n\treturn a.context\n}\n\n// GetSemanticContext returns the semantic context associated with this configuration\nfunc (a *ATNConfig) GetSemanticContext() SemanticContext {\n\treturn a.semanticContext\n}\n\n// GetReachesIntoOuterContext returns the count of references to an outer context from this configuration\nfunc (a *ATNConfig) GetReachesIntoOuterContext() int {\n\treturn a.reachesIntoOuterContext\n}\n\n// SetReachesIntoOuterContext sets the count of references to an outer context from this configuration\nfunc (a *ATNConfig) SetReachesIntoOuterContext(v int) {\n\ta.reachesIntoOuterContext = v\n}\n\n// Equals is the default comparison function for an ATNConfig when no specialist implementation is required\n// for a collection.\n//\n// An ATN configuration is equal to another if both have the same state, they\n// predict the same alternative, and syntactic/semantic contexts are the same.\nfunc (a *ATNConfig) Equals(o Collectable[*ATNConfig]) bool {\n\tswitch a.cType {\n\tcase lexerConfig:\n\t\treturn a.LEquals(o)\n\tcase parserConfig:\n\t\treturn a.PEquals(o)\n\tdefault:\n\t\tpanic(\"Invalid ATNConfig type\")\n\t}\n}\n\n// PEquals is the default comparison function for a Parser ATNConfig when no specialist implementation is required\n// for a collection.\n//\n// An ATN configuration is equal to another if both have the same state, they\n// predict the same alternative, and syntactic/semantic contexts are the same.\nfunc (a *ATNConfig) PEquals(o Collectable[*ATNConfig]) bool {\n\tvar other, ok = o.(*ATNConfig)\n\n\tif !ok {\n\t\treturn false\n\t}\n\tif a == other {\n\t\treturn true\n\t} else if other == nil {\n\t\treturn false\n\t}\n\n\tvar equal bool\n\n\tif a.context == nil {\n\t\tequal = other.context == nil\n\t} else {\n\t\tequal = a.context.Equals(other.context)\n\t}\n\n\tvar (\n\t\tnums = a.state.GetStateNumber() == other.state.GetStateNumber()\n\t\talts = a.alt == other.alt\n\t\tcons = a.semanticContext.Equals(other.semanticContext)\n\t\tsups = a.precedenceFilterSuppressed == other.precedenceFilterSuppressed\n\t)\n\n\treturn nums && alts && cons && sups && equal\n}\n\n// Hash is the default hash function for a parser ATNConfig, when no specialist hash function\n// is required for a collection\nfunc (a *ATNConfig) Hash() int {\n\tswitch a.cType {\n\tcase lexerConfig:\n\t\treturn a.LHash()\n\tcase parserConfig:\n\t\treturn a.PHash()\n\tdefault:\n\t\tpanic(\"Invalid ATNConfig type\")\n\t}\n}\n\n// PHash is the default hash function for a parser ATNConfig, when no specialist hash function\n// is required for a collection\nfunc (a *ATNConfig) PHash() int {\n\tvar c int\n\tif a.context != nil {\n\t\tc = a.context.Hash()\n\t}\n\n\th := murmurInit(7)\n\th = murmurUpdate(h, a.state.GetStateNumber())\n\th = murmurUpdate(h, a.alt)\n\th = murmurUpdate(h, c)\n\th = murmurUpdate(h, a.semanticContext.Hash())\n\treturn murmurFinish(h, 4)\n}\n\n// String returns a string representation of the ATNConfig, usually used for debugging purposes\nfunc (a *ATNConfig) String() string {\n\tvar s1, s2, s3 string\n\n\tif a.context != nil {\n\t\ts1 = \",[\" + fmt.Sprint(a.context) + \"]\"\n\t}\n\n\tif a.semanticContext != SemanticContextNone {\n\t\ts2 = \",\" + fmt.Sprint(a.semanticContext)\n\t}\n\n\tif a.reachesIntoOuterContext > 0 {\n\t\ts3 = \",up=\" + fmt.Sprint(a.reachesIntoOuterContext)\n\t}\n\n\treturn fmt.Sprintf(\"(%v,%v%v%v%v)\", a.state, a.alt, s1, s2, s3)\n}\n\nfunc NewLexerATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig {\n\tlac := &ATNConfig{}\n\tlac.state = state\n\tlac.alt = alt\n\tlac.context = context\n\tlac.semanticContext = SemanticContextNone\n\tlac.cType = lexerConfig\n\treturn lac\n}\n\nfunc NewLexerATNConfig4(c *ATNConfig, state ATNState) *ATNConfig {\n\tlac := &ATNConfig{}\n\tlac.lexerActionExecutor = c.lexerActionExecutor\n\tlac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)\n\tlac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext())\n\tlac.cType = lexerConfig\n\treturn lac\n}\n\nfunc NewLexerATNConfig3(c *ATNConfig, state ATNState, lexerActionExecutor *LexerActionExecutor) *ATNConfig {\n\tlac := &ATNConfig{}\n\tlac.lexerActionExecutor = lexerActionExecutor\n\tlac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)\n\tlac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext())\n\tlac.cType = lexerConfig\n\treturn lac\n}\n\nfunc NewLexerATNConfig2(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig {\n\tlac := &ATNConfig{}\n\tlac.lexerActionExecutor = c.lexerActionExecutor\n\tlac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)\n\tlac.InitATNConfig(c, state, c.GetAlt(), context, c.GetSemanticContext())\n\tlac.cType = lexerConfig\n\treturn lac\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewLexerATNConfig1(state ATNState, alt int, context *PredictionContext) *ATNConfig {\n\tlac := &ATNConfig{}\n\tlac.state = state\n\tlac.alt = alt\n\tlac.context = context\n\tlac.semanticContext = SemanticContextNone\n\tlac.cType = lexerConfig\n\treturn lac\n}\n\n// LHash is the default hash function for Lexer ATNConfig objects, it can be used directly or via\n// the default comparator [ObjEqComparator].\nfunc (a *ATNConfig) LHash() int {\n\tvar f int\n\tif a.passedThroughNonGreedyDecision {\n\t\tf = 1\n\t} else {\n\t\tf = 0\n\t}\n\th := murmurInit(7)\n\th = murmurUpdate(h, a.state.GetStateNumber())\n\th = murmurUpdate(h, a.alt)\n\th = murmurUpdate(h, a.context.Hash())\n\th = murmurUpdate(h, a.semanticContext.Hash())\n\th = murmurUpdate(h, f)\n\th = murmurUpdate(h, a.lexerActionExecutor.Hash())\n\th = murmurFinish(h, 6)\n\treturn h\n}\n\n// LEquals is the default comparison function for Lexer ATNConfig objects, it can be used directly or via\n// the default comparator [ObjEqComparator].\nfunc (a *ATNConfig) LEquals(other Collectable[*ATNConfig]) bool {\n\tvar otherT, ok = other.(*ATNConfig)\n\tif !ok {\n\t\treturn false\n\t} else if a == otherT {\n\t\treturn true\n\t} else if a.passedThroughNonGreedyDecision != otherT.passedThroughNonGreedyDecision {\n\t\treturn false\n\t}\n\n\tswitch {\n\tcase a.lexerActionExecutor == nil && otherT.lexerActionExecutor == nil:\n\t\treturn true\n\tcase a.lexerActionExecutor != nil && otherT.lexerActionExecutor != nil:\n\t\tif !a.lexerActionExecutor.Equals(otherT.lexerActionExecutor) {\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\treturn false // One but not both, are nil\n\t}\n\n\treturn a.PEquals(otherT)\n}\n\nfunc checkNonGreedyDecision(source *ATNConfig, target ATNState) bool {\n\tvar ds, ok = target.(DecisionState)\n\n\treturn source.passedThroughNonGreedyDecision || (ok && ds.getNonGreedy())\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n)\n\n// ATNConfigSet is a specialized set of ATNConfig that tracks information\n// about its elements and can combine similar configurations using a\n// graph-structured stack.\ntype ATNConfigSet struct {\n\tcachedHash int\n\n\t// configLookup is used to determine whether two ATNConfigSets are equal. We\n\t// need all configurations with the same (s, i, _, semctx) to be equal. A key\n\t// effectively doubles the number of objects associated with ATNConfigs. All\n\t// keys are hashed by (s, i, _, pi), not including the context. Wiped out when\n\t// read-only because a set becomes a DFA state.\n\tconfigLookup *JStore[*ATNConfig, Comparator[*ATNConfig]]\n\n\t// configs is the added elements that did not match an existing key in configLookup\n\tconfigs []*ATNConfig\n\n\t// TODO: These fields make me pretty uncomfortable, but it is nice to pack up\n\t// info together because it saves re-computation. Can we track conflicts as they\n\t// are added to save scanning configs later?\n\tconflictingAlts *BitSet\n\n\t// dipsIntoOuterContext is used by parsers and lexers. In a lexer, it indicates\n\t// we hit a pred while computing a closure operation. Do not make a DFA state\n\t// from the ATNConfigSet in this case. TODO: How is this used by parsers?\n\tdipsIntoOuterContext bool\n\n\t// fullCtx is whether it is part of a full context LL prediction. Used to\n\t// determine how to merge $. It is a wildcard with SLL, but not for an LL\n\t// context merge.\n\tfullCtx bool\n\n\t// Used in parser and lexer. In lexer, it indicates we hit a pred\n\t// while computing a closure operation. Don't make a DFA state from this set.\n\thasSemanticContext bool\n\n\t// readOnly is whether it is read-only. Do not\n\t// allow any code to manipulate the set if true because DFA states will point at\n\t// sets and those must not change. It not, protect other fields; conflictingAlts\n\t// in particular, which is assigned after readOnly.\n\treadOnly bool\n\n\t// TODO: These fields make me pretty uncomfortable, but it is nice to pack up\n\t// info together because it saves re-computation. Can we track conflicts as they\n\t// are added to save scanning configs later?\n\tuniqueAlt int\n}\n\n// Alts returns the combined set of alts for all the configurations in this set.\nfunc (b *ATNConfigSet) Alts() *BitSet {\n\talts := NewBitSet()\n\tfor _, it := range b.configs {\n\t\talts.add(it.GetAlt())\n\t}\n\treturn alts\n}\n\n// NewATNConfigSet creates a new ATNConfigSet instance.\nfunc NewATNConfigSet(fullCtx bool) *ATNConfigSet {\n\treturn &ATNConfigSet{\n\t\tcachedHash:   -1,\n\t\tconfigLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, \"NewATNConfigSet()\"),\n\t\tfullCtx:      fullCtx,\n\t}\n}\n\n// Add merges contexts with existing configs for (s, i, pi, _),\n// where 's' is the ATNConfig.state, 'i' is the ATNConfig.alt, and\n// 'pi' is the [ATNConfig].semanticContext.\n//\n// We use (s,i,pi) as the key.\n// Updates dipsIntoOuterContext and hasSemanticContext when necessary.\nfunc (b *ATNConfigSet) Add(config *ATNConfig, mergeCache *JPCMap) bool {\n\tif b.readOnly {\n\t\tpanic(\"set is read-only\")\n\t}\n\n\tif config.GetSemanticContext() != SemanticContextNone {\n\t\tb.hasSemanticContext = true\n\t}\n\n\tif config.GetReachesIntoOuterContext() > 0 {\n\t\tb.dipsIntoOuterContext = true\n\t}\n\n\texisting, present := b.configLookup.Put(config)\n\n\t// The config was not already in the set\n\t//\n\tif !present {\n\t\tb.cachedHash = -1\n\t\tb.configs = append(b.configs, config) // Track order here\n\t\treturn true\n\t}\n\n\t// Merge a previous (s, i, pi, _) with it and save the result\n\trootIsWildcard := !b.fullCtx\n\tmerged := merge(existing.GetContext(), config.GetContext(), rootIsWildcard, mergeCache)\n\n\t// No need to check for existing.context because config.context is in the cache,\n\t// since the only way to create new graphs is the \"call rule\" and here. We cache\n\t// at both places.\n\texisting.SetReachesIntoOuterContext(intMax(existing.GetReachesIntoOuterContext(), config.GetReachesIntoOuterContext()))\n\n\t// Preserve the precedence filter suppression during the merge\n\tif config.getPrecedenceFilterSuppressed() {\n\t\texisting.setPrecedenceFilterSuppressed(true)\n\t}\n\n\t// Replace the context because there is no need to do alt mapping\n\texisting.SetContext(merged)\n\n\treturn true\n}\n\n// GetStates returns the set of states represented by all configurations in this config set\nfunc (b *ATNConfigSet) GetStates() *JStore[ATNState, Comparator[ATNState]] {\n\n\t// states uses the standard comparator and Hash() provided by the ATNState instance\n\t//\n\tstates := NewJStore[ATNState, Comparator[ATNState]](aStateEqInst, ATNStateCollection, \"ATNConfigSet.GetStates()\")\n\n\tfor i := 0; i < len(b.configs); i++ {\n\t\tstates.Put(b.configs[i].GetState())\n\t}\n\n\treturn states\n}\n\nfunc (b *ATNConfigSet) GetPredicates() []SemanticContext {\n\tpredicates := make([]SemanticContext, 0)\n\n\tfor i := 0; i < len(b.configs); i++ {\n\t\tc := b.configs[i].GetSemanticContext()\n\n\t\tif c != SemanticContextNone {\n\t\t\tpredicates = append(predicates, c)\n\t\t}\n\t}\n\n\treturn predicates\n}\n\nfunc (b *ATNConfigSet) OptimizeConfigs(interpreter *BaseATNSimulator) {\n\tif b.readOnly {\n\t\tpanic(\"set is read-only\")\n\t}\n\n\t// Empty indicate no optimization is possible\n\tif b.configLookup == nil || b.configLookup.Len() == 0 {\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(b.configs); i++ {\n\t\tconfig := b.configs[i]\n\t\tconfig.SetContext(interpreter.getCachedContext(config.GetContext()))\n\t}\n}\n\nfunc (b *ATNConfigSet) AddAll(coll []*ATNConfig) bool {\n\tfor i := 0; i < len(coll); i++ {\n\t\tb.Add(coll[i], nil)\n\t}\n\n\treturn false\n}\n\n// Compare The configs are only equal if they are in the same order and their Equals function returns true.\n// Java uses ArrayList.equals(), which requires the same order.\nfunc (b *ATNConfigSet) Compare(bs *ATNConfigSet) bool {\n\tif len(b.configs) != len(bs.configs) {\n\t\treturn false\n\t}\n\tfor i := 0; i < len(b.configs); i++ {\n\t\tif !b.configs[i].Equals(bs.configs[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (b *ATNConfigSet) Equals(other Collectable[ATNConfig]) bool {\n\tif b == other {\n\t\treturn true\n\t} else if _, ok := other.(*ATNConfigSet); !ok {\n\t\treturn false\n\t}\n\n\tother2 := other.(*ATNConfigSet)\n\tvar eca bool\n\tswitch {\n\tcase b.conflictingAlts == nil && other2.conflictingAlts == nil:\n\t\teca = true\n\tcase b.conflictingAlts != nil && other2.conflictingAlts != nil:\n\t\teca = b.conflictingAlts.equals(other2.conflictingAlts)\n\t}\n\treturn b.configs != nil &&\n\t\tb.fullCtx == other2.fullCtx &&\n\t\tb.uniqueAlt == other2.uniqueAlt &&\n\t\teca &&\n\t\tb.hasSemanticContext == other2.hasSemanticContext &&\n\t\tb.dipsIntoOuterContext == other2.dipsIntoOuterContext &&\n\t\tb.Compare(other2)\n}\n\nfunc (b *ATNConfigSet) Hash() int {\n\tif b.readOnly {\n\t\tif b.cachedHash == -1 {\n\t\t\tb.cachedHash = b.hashCodeConfigs()\n\t\t}\n\n\t\treturn b.cachedHash\n\t}\n\n\treturn b.hashCodeConfigs()\n}\n\nfunc (b *ATNConfigSet) hashCodeConfigs() int {\n\th := 1\n\tfor _, config := range b.configs {\n\t\th = 31*h + config.Hash()\n\t}\n\treturn h\n}\n\nfunc (b *ATNConfigSet) Contains(item *ATNConfig) bool {\n\tif b.readOnly {\n\t\tpanic(\"not implemented for read-only sets\")\n\t}\n\tif b.configLookup == nil {\n\t\treturn false\n\t}\n\treturn b.configLookup.Contains(item)\n}\n\nfunc (b *ATNConfigSet) ContainsFast(item *ATNConfig) bool {\n\treturn b.Contains(item)\n}\n\nfunc (b *ATNConfigSet) Clear() {\n\tif b.readOnly {\n\t\tpanic(\"set is read-only\")\n\t}\n\tb.configs = make([]*ATNConfig, 0)\n\tb.cachedHash = -1\n\tb.configLookup = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, \"NewATNConfigSet()\")\n}\n\nfunc (b *ATNConfigSet) String() string {\n\n\ts := \"[\"\n\n\tfor i, c := range b.configs {\n\t\ts += c.String()\n\n\t\tif i != len(b.configs)-1 {\n\t\t\ts += \", \"\n\t\t}\n\t}\n\n\ts += \"]\"\n\n\tif b.hasSemanticContext {\n\t\ts += \",hasSemanticContext=\" + fmt.Sprint(b.hasSemanticContext)\n\t}\n\n\tif b.uniqueAlt != ATNInvalidAltNumber {\n\t\ts += \",uniqueAlt=\" + fmt.Sprint(b.uniqueAlt)\n\t}\n\n\tif b.conflictingAlts != nil {\n\t\ts += \",conflictingAlts=\" + b.conflictingAlts.String()\n\t}\n\n\tif b.dipsIntoOuterContext {\n\t\ts += \",dipsIntoOuterContext\"\n\t}\n\n\treturn s\n}\n\n// NewOrderedATNConfigSet creates a config set with a slightly different Hash/Equal pair\n// for use in lexers.\nfunc NewOrderedATNConfigSet() *ATNConfigSet {\n\treturn &ATNConfigSet{\n\t\tcachedHash: -1,\n\t\t// This set uses the standard Hash() and Equals() from ATNConfig\n\t\tconfigLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ATNConfigCollection, \"ATNConfigSet.NewOrderedATNConfigSet()\"),\n\t\tfullCtx:      false,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport \"errors\"\n\nvar defaultATNDeserializationOptions = ATNDeserializationOptions{true, true, false}\n\ntype ATNDeserializationOptions struct {\n\treadOnly                      bool\n\tverifyATN                     bool\n\tgenerateRuleBypassTransitions bool\n}\n\nfunc (opts *ATNDeserializationOptions) ReadOnly() bool {\n\treturn opts.readOnly\n}\n\nfunc (opts *ATNDeserializationOptions) SetReadOnly(readOnly bool) {\n\tif opts.readOnly {\n\t\tpanic(errors.New(\"cannot mutate read only ATNDeserializationOptions\"))\n\t}\n\topts.readOnly = readOnly\n}\n\nfunc (opts *ATNDeserializationOptions) VerifyATN() bool {\n\treturn opts.verifyATN\n}\n\nfunc (opts *ATNDeserializationOptions) SetVerifyATN(verifyATN bool) {\n\tif opts.readOnly {\n\t\tpanic(errors.New(\"cannot mutate read only ATNDeserializationOptions\"))\n\t}\n\topts.verifyATN = verifyATN\n}\n\nfunc (opts *ATNDeserializationOptions) GenerateRuleBypassTransitions() bool {\n\treturn opts.generateRuleBypassTransitions\n}\n\nfunc (opts *ATNDeserializationOptions) SetGenerateRuleBypassTransitions(generateRuleBypassTransitions bool) {\n\tif opts.readOnly {\n\t\tpanic(errors.New(\"cannot mutate read only ATNDeserializationOptions\"))\n\t}\n\topts.generateRuleBypassTransitions = generateRuleBypassTransitions\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc DefaultATNDeserializationOptions() *ATNDeserializationOptions {\n\treturn NewATNDeserializationOptions(&defaultATNDeserializationOptions)\n}\n\nfunc NewATNDeserializationOptions(other *ATNDeserializationOptions) *ATNDeserializationOptions {\n\to := new(ATNDeserializationOptions)\n\tif other != nil {\n\t\t*o = *other\n\t\to.readOnly = false\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nconst serializedVersion = 4\n\ntype loopEndStateIntPair struct {\n\titem0 *LoopEndState\n\titem1 int\n}\n\ntype blockStartStateIntPair struct {\n\titem0 BlockStartState\n\titem1 int\n}\n\ntype ATNDeserializer struct {\n\toptions *ATNDeserializationOptions\n\tdata    []int32\n\tpos     int\n}\n\nfunc NewATNDeserializer(options *ATNDeserializationOptions) *ATNDeserializer {\n\tif options == nil {\n\t\toptions = &defaultATNDeserializationOptions\n\t}\n\n\treturn &ATNDeserializer{options: options}\n}\n\n//goland:noinspection GoUnusedFunction\nfunc stringInSlice(a string, list []string) int {\n\tfor i, b := range list {\n\t\tif b == a {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}\n\nfunc (a *ATNDeserializer) Deserialize(data []int32) *ATN {\n\ta.data = data\n\ta.pos = 0\n\ta.checkVersion()\n\n\tatn := a.readATN()\n\n\ta.readStates(atn)\n\ta.readRules(atn)\n\ta.readModes(atn)\n\n\tsets := a.readSets(atn, nil)\n\n\ta.readEdges(atn, sets)\n\ta.readDecisions(atn)\n\ta.readLexerActions(atn)\n\ta.markPrecedenceDecisions(atn)\n\ta.verifyATN(atn)\n\n\tif a.options.GenerateRuleBypassTransitions() && atn.grammarType == ATNTypeParser {\n\t\ta.generateRuleBypassTransitions(atn)\n\t\t// Re-verify after modification\n\t\ta.verifyATN(atn)\n\t}\n\n\treturn atn\n\n}\n\nfunc (a *ATNDeserializer) checkVersion() {\n\tversion := a.readInt()\n\n\tif version != serializedVersion {\n\t\tpanic(\"Could not deserialize ATN with version \" + strconv.Itoa(version) + \" (expected \" + strconv.Itoa(serializedVersion) + \").\")\n\t}\n}\n\nfunc (a *ATNDeserializer) readATN() *ATN {\n\tgrammarType := a.readInt()\n\tmaxTokenType := a.readInt()\n\n\treturn NewATN(grammarType, maxTokenType)\n}\n\nfunc (a *ATNDeserializer) readStates(atn *ATN) {\n\tnstates := a.readInt()\n\n\t// Allocate worst case size.\n\tloopBackStateNumbers := make([]loopEndStateIntPair, 0, nstates)\n\tendStateNumbers := make([]blockStartStateIntPair, 0, nstates)\n\n\t// Preallocate states slice.\n\tatn.states = make([]ATNState, 0, nstates)\n\n\tfor i := 0; i < nstates; i++ {\n\t\tstype := a.readInt()\n\n\t\t// Ignore bad types of states\n\t\tif stype == ATNStateInvalidType {\n\t\t\tatn.addState(nil)\n\t\t\tcontinue\n\t\t}\n\n\t\truleIndex := a.readInt()\n\n\t\ts := a.stateFactory(stype, ruleIndex)\n\n\t\tif stype == ATNStateLoopEnd {\n\t\t\tloopBackStateNumber := a.readInt()\n\n\t\t\tloopBackStateNumbers = append(loopBackStateNumbers, loopEndStateIntPair{s.(*LoopEndState), loopBackStateNumber})\n\t\t} else if s2, ok := s.(BlockStartState); ok {\n\t\t\tendStateNumber := a.readInt()\n\n\t\t\tendStateNumbers = append(endStateNumbers, blockStartStateIntPair{s2, endStateNumber})\n\t\t}\n\n\t\tatn.addState(s)\n\t}\n\n\t// Delay the assignment of loop back and end states until we know all the state\n\t// instances have been initialized\n\tfor _, pair := range loopBackStateNumbers {\n\t\tpair.item0.loopBackState = atn.states[pair.item1]\n\t}\n\n\tfor _, pair := range endStateNumbers {\n\t\tpair.item0.setEndState(atn.states[pair.item1].(*BlockEndState))\n\t}\n\n\tnumNonGreedyStates := a.readInt()\n\tfor j := 0; j < numNonGreedyStates; j++ {\n\t\tstateNumber := a.readInt()\n\n\t\tatn.states[stateNumber].(DecisionState).setNonGreedy(true)\n\t}\n\n\tnumPrecedenceStates := a.readInt()\n\tfor j := 0; j < numPrecedenceStates; j++ {\n\t\tstateNumber := a.readInt()\n\n\t\tatn.states[stateNumber].(*RuleStartState).isPrecedenceRule = true\n\t}\n}\n\nfunc (a *ATNDeserializer) readRules(atn *ATN) {\n\tnrules := a.readInt()\n\n\tif atn.grammarType == ATNTypeLexer {\n\t\tatn.ruleToTokenType = make([]int, nrules)\n\t}\n\n\tatn.ruleToStartState = make([]*RuleStartState, nrules)\n\n\tfor i := range atn.ruleToStartState {\n\t\ts := a.readInt()\n\t\tstartState := atn.states[s].(*RuleStartState)\n\n\t\tatn.ruleToStartState[i] = startState\n\n\t\tif atn.grammarType == ATNTypeLexer {\n\t\t\ttokenType := a.readInt()\n\n\t\t\tatn.ruleToTokenType[i] = tokenType\n\t\t}\n\t}\n\n\tatn.ruleToStopState = make([]*RuleStopState, nrules)\n\n\tfor _, state := range atn.states {\n\t\tif s2, ok := state.(*RuleStopState); ok {\n\t\t\tatn.ruleToStopState[s2.ruleIndex] = s2\n\t\t\tatn.ruleToStartState[s2.ruleIndex].stopState = s2\n\t\t}\n\t}\n}\n\nfunc (a *ATNDeserializer) readModes(atn *ATN) {\n\tnmodes := a.readInt()\n\tatn.modeToStartState = make([]*TokensStartState, nmodes)\n\n\tfor i := range atn.modeToStartState {\n\t\ts := a.readInt()\n\n\t\tatn.modeToStartState[i] = atn.states[s].(*TokensStartState)\n\t}\n}\n\nfunc (a *ATNDeserializer) readSets(_ *ATN, sets []*IntervalSet) []*IntervalSet {\n\tm := a.readInt()\n\n\t// Preallocate the needed capacity.\n\tif cap(sets)-len(sets) < m {\n\t\tisets := make([]*IntervalSet, len(sets), len(sets)+m)\n\t\tcopy(isets, sets)\n\t\tsets = isets\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tiset := NewIntervalSet()\n\n\t\tsets = append(sets, iset)\n\n\t\tn := a.readInt()\n\t\tcontainsEOF := a.readInt()\n\n\t\tif containsEOF != 0 {\n\t\t\tiset.addOne(-1)\n\t\t}\n\n\t\tfor j := 0; j < n; j++ {\n\t\t\ti1 := a.readInt()\n\t\t\ti2 := a.readInt()\n\n\t\t\tiset.addRange(i1, i2)\n\t\t}\n\t}\n\n\treturn sets\n}\n\nfunc (a *ATNDeserializer) readEdges(atn *ATN, sets []*IntervalSet) {\n\tnedges := a.readInt()\n\n\tfor i := 0; i < nedges; i++ {\n\t\tvar (\n\t\t\tsrc      = a.readInt()\n\t\t\ttrg      = a.readInt()\n\t\t\tttype    = a.readInt()\n\t\t\targ1     = a.readInt()\n\t\t\targ2     = a.readInt()\n\t\t\targ3     = a.readInt()\n\t\t\ttrans    = a.edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets)\n\t\t\tsrcState = atn.states[src]\n\t\t)\n\n\t\tsrcState.AddTransition(trans, -1)\n\t}\n\n\t// Edges for rule stop states can be derived, so they are not serialized\n\tfor _, state := range atn.states {\n\t\tfor _, t := range state.GetTransitions() {\n\t\t\tvar rt, ok = t.(*RuleTransition)\n\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\toutermostPrecedenceReturn := -1\n\n\t\t\tif atn.ruleToStartState[rt.getTarget().GetRuleIndex()].isPrecedenceRule {\n\t\t\t\tif rt.precedence == 0 {\n\t\t\t\t\toutermostPrecedenceReturn = rt.getTarget().GetRuleIndex()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrans := NewEpsilonTransition(rt.followState, outermostPrecedenceReturn)\n\n\t\t\tatn.ruleToStopState[rt.getTarget().GetRuleIndex()].AddTransition(trans, -1)\n\t\t}\n\t}\n\n\tfor _, state := range atn.states {\n\t\tif s2, ok := state.(BlockStartState); ok {\n\t\t\t// We need to know the end state to set its start state\n\t\t\tif s2.getEndState() == nil {\n\t\t\t\tpanic(\"IllegalState\")\n\t\t\t}\n\n\t\t\t// Block end states can only be associated to a single block start state\n\t\t\tif s2.getEndState().startState != nil {\n\t\t\t\tpanic(\"IllegalState\")\n\t\t\t}\n\n\t\t\ts2.getEndState().startState = state\n\t\t}\n\n\t\tif s2, ok := state.(*PlusLoopbackState); ok {\n\t\t\tfor _, t := range s2.GetTransitions() {\n\t\t\t\tif t2, ok := t.getTarget().(*PlusBlockStartState); ok {\n\t\t\t\t\tt2.loopBackState = state\n\t\t\t\t}\n\t\t\t}\n\t\t} else if s2, ok := state.(*StarLoopbackState); ok {\n\t\t\tfor _, t := range s2.GetTransitions() {\n\t\t\t\tif t2, ok := t.getTarget().(*StarLoopEntryState); ok {\n\t\t\t\t\tt2.loopBackState = state\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (a *ATNDeserializer) readDecisions(atn *ATN) {\n\tndecisions := a.readInt()\n\n\tfor i := 0; i < ndecisions; i++ {\n\t\ts := a.readInt()\n\t\tdecState := atn.states[s].(DecisionState)\n\n\t\tatn.DecisionToState = append(atn.DecisionToState, decState)\n\t\tdecState.setDecision(i)\n\t}\n}\n\nfunc (a *ATNDeserializer) readLexerActions(atn *ATN) {\n\tif atn.grammarType == ATNTypeLexer {\n\t\tcount := a.readInt()\n\n\t\tatn.lexerActions = make([]LexerAction, count)\n\n\t\tfor i := range atn.lexerActions {\n\t\t\tactionType := a.readInt()\n\t\t\tdata1 := a.readInt()\n\t\t\tdata2 := a.readInt()\n\t\t\tatn.lexerActions[i] = a.lexerActionFactory(actionType, data1, data2)\n\t\t}\n\t}\n}\n\nfunc (a *ATNDeserializer) generateRuleBypassTransitions(atn *ATN) {\n\tcount := len(atn.ruleToStartState)\n\n\tfor i := 0; i < count; i++ {\n\t\tatn.ruleToTokenType[i] = atn.maxTokenType + i + 1\n\t}\n\n\tfor i := 0; i < count; i++ {\n\t\ta.generateRuleBypassTransition(atn, i)\n\t}\n}\n\nfunc (a *ATNDeserializer) generateRuleBypassTransition(atn *ATN, idx int) {\n\tbypassStart := NewBasicBlockStartState()\n\n\tbypassStart.ruleIndex = idx\n\tatn.addState(bypassStart)\n\n\tbypassStop := NewBlockEndState()\n\n\tbypassStop.ruleIndex = idx\n\tatn.addState(bypassStop)\n\n\tbypassStart.endState = bypassStop\n\n\tatn.defineDecisionState(&bypassStart.BaseDecisionState)\n\n\tbypassStop.startState = bypassStart\n\n\tvar excludeTransition Transition\n\tvar endState ATNState\n\n\tif atn.ruleToStartState[idx].isPrecedenceRule {\n\t\t// Wrap from the beginning of the rule to the StarLoopEntryState\n\t\tendState = nil\n\n\t\tfor i := 0; i < len(atn.states); i++ {\n\t\t\tstate := atn.states[i]\n\n\t\t\tif a.stateIsEndStateFor(state, idx) != nil {\n\t\t\t\tendState = state\n\t\t\t\texcludeTransition = state.(*StarLoopEntryState).loopBackState.GetTransitions()[0]\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif excludeTransition == nil {\n\t\t\tpanic(\"Couldn't identify final state of the precedence rule prefix section.\")\n\t\t}\n\t} else {\n\t\tendState = atn.ruleToStopState[idx]\n\t}\n\n\t// All non-excluded transitions that currently target end state need to target\n\t// blockEnd instead\n\tfor i := 0; i < len(atn.states); i++ {\n\t\tstate := atn.states[i]\n\n\t\tfor j := 0; j < len(state.GetTransitions()); j++ {\n\t\t\ttransition := state.GetTransitions()[j]\n\n\t\t\tif transition == excludeTransition {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif transition.getTarget() == endState {\n\t\t\t\ttransition.setTarget(bypassStop)\n\t\t\t}\n\t\t}\n\t}\n\n\t// All transitions leaving the rule start state need to leave blockStart instead\n\truleToStartState := atn.ruleToStartState[idx]\n\tcount := len(ruleToStartState.GetTransitions())\n\n\tfor count > 0 {\n\t\tbypassStart.AddTransition(ruleToStartState.GetTransitions()[count-1], -1)\n\t\truleToStartState.SetTransitions([]Transition{ruleToStartState.GetTransitions()[len(ruleToStartState.GetTransitions())-1]})\n\t}\n\n\t// Link the new states\n\tatn.ruleToStartState[idx].AddTransition(NewEpsilonTransition(bypassStart, -1), -1)\n\tbypassStop.AddTransition(NewEpsilonTransition(endState, -1), -1)\n\n\tMatchState := NewBasicState()\n\n\tatn.addState(MatchState)\n\tMatchState.AddTransition(NewAtomTransition(bypassStop, atn.ruleToTokenType[idx]), -1)\n\tbypassStart.AddTransition(NewEpsilonTransition(MatchState, -1), -1)\n}\n\nfunc (a *ATNDeserializer) stateIsEndStateFor(state ATNState, idx int) ATNState {\n\tif state.GetRuleIndex() != idx {\n\t\treturn nil\n\t}\n\n\tif _, ok := state.(*StarLoopEntryState); !ok {\n\t\treturn nil\n\t}\n\n\tmaybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget()\n\n\tif _, ok := maybeLoopEndState.(*LoopEndState); !ok {\n\t\treturn nil\n\t}\n\n\tvar _, ok = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState)\n\n\tif maybeLoopEndState.(*LoopEndState).epsilonOnlyTransitions && ok {\n\t\treturn state\n\t}\n\n\treturn nil\n}\n\n// markPrecedenceDecisions analyzes the StarLoopEntryState states in the\n// specified ATN to set the StarLoopEntryState.precedenceRuleDecision field to\n// the correct value.\nfunc (a *ATNDeserializer) markPrecedenceDecisions(atn *ATN) {\n\tfor _, state := range atn.states {\n\t\tif _, ok := state.(*StarLoopEntryState); !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\t// We analyze the [ATN] to determine if an ATN decision state is the\n\t\t// decision for the closure block that determines whether a\n\t\t// precedence rule should continue or complete.\n\t\tif atn.ruleToStartState[state.GetRuleIndex()].isPrecedenceRule {\n\t\t\tmaybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget()\n\n\t\t\tif s3, ok := maybeLoopEndState.(*LoopEndState); ok {\n\t\t\t\tvar _, ok2 = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState)\n\n\t\t\t\tif s3.epsilonOnlyTransitions && ok2 {\n\t\t\t\t\tstate.(*StarLoopEntryState).precedenceRuleDecision = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (a *ATNDeserializer) verifyATN(atn *ATN) {\n\tif !a.options.VerifyATN() {\n\t\treturn\n\t}\n\n\t// Verify assumptions\n\tfor _, state := range atn.states {\n\t\tif state == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\ta.checkCondition(state.GetEpsilonOnlyTransitions() || len(state.GetTransitions()) <= 1, \"\")\n\n\t\tswitch s2 := state.(type) {\n\t\tcase *PlusBlockStartState:\n\t\t\ta.checkCondition(s2.loopBackState != nil, \"\")\n\n\t\tcase *StarLoopEntryState:\n\t\t\ta.checkCondition(s2.loopBackState != nil, \"\")\n\t\t\ta.checkCondition(len(s2.GetTransitions()) == 2, \"\")\n\n\t\t\tswitch s2.transitions[0].getTarget().(type) {\n\t\t\tcase *StarBlockStartState:\n\t\t\t\t_, ok := s2.transitions[1].getTarget().(*LoopEndState)\n\n\t\t\t\ta.checkCondition(ok, \"\")\n\t\t\t\ta.checkCondition(!s2.nonGreedy, \"\")\n\n\t\t\tcase *LoopEndState:\n\t\t\t\tvar _, ok = s2.transitions[1].getTarget().(*StarBlockStartState)\n\n\t\t\t\ta.checkCondition(ok, \"\")\n\t\t\t\ta.checkCondition(s2.nonGreedy, \"\")\n\n\t\t\tdefault:\n\t\t\t\tpanic(\"IllegalState\")\n\t\t\t}\n\n\t\tcase *StarLoopbackState:\n\t\t\ta.checkCondition(len(state.GetTransitions()) == 1, \"\")\n\n\t\t\tvar _, ok = state.GetTransitions()[0].getTarget().(*StarLoopEntryState)\n\n\t\t\ta.checkCondition(ok, \"\")\n\n\t\tcase *LoopEndState:\n\t\t\ta.checkCondition(s2.loopBackState != nil, \"\")\n\n\t\tcase *RuleStartState:\n\t\t\ta.checkCondition(s2.stopState != nil, \"\")\n\n\t\tcase BlockStartState:\n\t\t\ta.checkCondition(s2.getEndState() != nil, \"\")\n\n\t\tcase *BlockEndState:\n\t\t\ta.checkCondition(s2.startState != nil, \"\")\n\n\t\tcase DecisionState:\n\t\t\ta.checkCondition(len(s2.GetTransitions()) <= 1 || s2.getDecision() >= 0, \"\")\n\n\t\tdefault:\n\t\t\tvar _, ok = s2.(*RuleStopState)\n\n\t\t\ta.checkCondition(len(s2.GetTransitions()) <= 1 || ok, \"\")\n\t\t}\n\t}\n}\n\nfunc (a *ATNDeserializer) checkCondition(condition bool, message string) {\n\tif !condition {\n\t\tif message == \"\" {\n\t\t\tmessage = \"IllegalState\"\n\t\t}\n\n\t\tpanic(message)\n\t}\n}\n\nfunc (a *ATNDeserializer) readInt() int {\n\tv := a.data[a.pos]\n\n\ta.pos++\n\n\treturn int(v) // data is 32 bits but int is at least that big\n}\n\nfunc (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, _, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition {\n\ttarget := atn.states[trg]\n\n\tswitch typeIndex {\n\tcase TransitionEPSILON:\n\t\treturn NewEpsilonTransition(target, -1)\n\n\tcase TransitionRANGE:\n\t\tif arg3 != 0 {\n\t\t\treturn NewRangeTransition(target, TokenEOF, arg2)\n\t\t}\n\n\t\treturn NewRangeTransition(target, arg1, arg2)\n\n\tcase TransitionRULE:\n\t\treturn NewRuleTransition(atn.states[arg1], arg2, arg3, target)\n\n\tcase TransitionPREDICATE:\n\t\treturn NewPredicateTransition(target, arg1, arg2, arg3 != 0)\n\n\tcase TransitionPRECEDENCE:\n\t\treturn NewPrecedencePredicateTransition(target, arg1)\n\n\tcase TransitionATOM:\n\t\tif arg3 != 0 {\n\t\t\treturn NewAtomTransition(target, TokenEOF)\n\t\t}\n\n\t\treturn NewAtomTransition(target, arg1)\n\n\tcase TransitionACTION:\n\t\treturn NewActionTransition(target, arg1, arg2, arg3 != 0)\n\n\tcase TransitionSET:\n\t\treturn NewSetTransition(target, sets[arg1])\n\n\tcase TransitionNOTSET:\n\t\treturn NewNotSetTransition(target, sets[arg1])\n\n\tcase TransitionWILDCARD:\n\t\treturn NewWildcardTransition(target)\n\t}\n\n\tpanic(\"The specified transition type is not valid.\")\n}\n\nfunc (a *ATNDeserializer) stateFactory(typeIndex, ruleIndex int) ATNState {\n\tvar s ATNState\n\n\tswitch typeIndex {\n\tcase ATNStateInvalidType:\n\t\treturn nil\n\n\tcase ATNStateBasic:\n\t\ts = NewBasicState()\n\n\tcase ATNStateRuleStart:\n\t\ts = NewRuleStartState()\n\n\tcase ATNStateBlockStart:\n\t\ts = NewBasicBlockStartState()\n\n\tcase ATNStatePlusBlockStart:\n\t\ts = NewPlusBlockStartState()\n\n\tcase ATNStateStarBlockStart:\n\t\ts = NewStarBlockStartState()\n\n\tcase ATNStateTokenStart:\n\t\ts = NewTokensStartState()\n\n\tcase ATNStateRuleStop:\n\t\ts = NewRuleStopState()\n\n\tcase ATNStateBlockEnd:\n\t\ts = NewBlockEndState()\n\n\tcase ATNStateStarLoopBack:\n\t\ts = NewStarLoopbackState()\n\n\tcase ATNStateStarLoopEntry:\n\t\ts = NewStarLoopEntryState()\n\n\tcase ATNStatePlusLoopBack:\n\t\ts = NewPlusLoopbackState()\n\n\tcase ATNStateLoopEnd:\n\t\ts = NewLoopEndState()\n\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"state type %d is invalid\", typeIndex))\n\t}\n\n\ts.SetRuleIndex(ruleIndex)\n\n\treturn s\n}\n\nfunc (a *ATNDeserializer) lexerActionFactory(typeIndex, data1, data2 int) LexerAction {\n\tswitch typeIndex {\n\tcase LexerActionTypeChannel:\n\t\treturn NewLexerChannelAction(data1)\n\n\tcase LexerActionTypeCustom:\n\t\treturn NewLexerCustomAction(data1, data2)\n\n\tcase LexerActionTypeMode:\n\t\treturn NewLexerModeAction(data1)\n\n\tcase LexerActionTypeMore:\n\t\treturn LexerMoreActionINSTANCE\n\n\tcase LexerActionTypePopMode:\n\t\treturn LexerPopModeActionINSTANCE\n\n\tcase LexerActionTypePushMode:\n\t\treturn NewLexerPushModeAction(data1)\n\n\tcase LexerActionTypeSkip:\n\t\treturn LexerSkipActionINSTANCE\n\n\tcase LexerActionTypeType:\n\t\treturn NewLexerTypeAction(data1)\n\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"lexer action %d is invalid\", typeIndex))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nvar ATNSimulatorError = NewDFAState(0x7FFFFFFF, NewATNConfigSet(false))\n\ntype IATNSimulator interface {\n\tSharedContextCache() *PredictionContextCache\n\tATN() *ATN\n\tDecisionToDFA() []*DFA\n}\n\ntype BaseATNSimulator struct {\n\tatn                *ATN\n\tsharedContextCache *PredictionContextCache\n\tdecisionToDFA      []*DFA\n}\n\nfunc (b *BaseATNSimulator) getCachedContext(context *PredictionContext) *PredictionContext {\n\tif b.sharedContextCache == nil {\n\t\treturn context\n\t}\n\n\t//visited := NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionVisitedCollection, \"Visit map in getCachedContext()\")\n\tvisited := NewVisitRecord()\n\treturn getCachedBasePredictionContext(context, b.sharedContextCache, visited)\n}\n\nfunc (b *BaseATNSimulator) SharedContextCache() *PredictionContextCache {\n\treturn b.sharedContextCache\n}\n\nfunc (b *BaseATNSimulator) ATN() *ATN {\n\treturn b.atn\n}\n\nfunc (b *BaseATNSimulator) DecisionToDFA() []*DFA {\n\treturn b.decisionToDFA\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_state.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// Constants for serialization.\nconst (\n\tATNStateInvalidType    = 0\n\tATNStateBasic          = 1\n\tATNStateRuleStart      = 2\n\tATNStateBlockStart     = 3\n\tATNStatePlusBlockStart = 4\n\tATNStateStarBlockStart = 5\n\tATNStateTokenStart     = 6\n\tATNStateRuleStop       = 7\n\tATNStateBlockEnd       = 8\n\tATNStateStarLoopBack   = 9\n\tATNStateStarLoopEntry  = 10\n\tATNStatePlusLoopBack   = 11\n\tATNStateLoopEnd        = 12\n\n\tATNStateInvalidStateNumber = -1\n)\n\n//goland:noinspection GoUnusedGlobalVariable\nvar ATNStateInitialNumTransitions = 4\n\ntype ATNState interface {\n\tGetEpsilonOnlyTransitions() bool\n\n\tGetRuleIndex() int\n\tSetRuleIndex(int)\n\n\tGetNextTokenWithinRule() *IntervalSet\n\tSetNextTokenWithinRule(*IntervalSet)\n\n\tGetATN() *ATN\n\tSetATN(*ATN)\n\n\tGetStateType() int\n\n\tGetStateNumber() int\n\tSetStateNumber(int)\n\n\tGetTransitions() []Transition\n\tSetTransitions([]Transition)\n\tAddTransition(Transition, int)\n\n\tString() string\n\tHash() int\n\tEquals(Collectable[ATNState]) bool\n}\n\ntype BaseATNState struct {\n\t// NextTokenWithinRule caches lookahead during parsing. Not used during construction.\n\tNextTokenWithinRule *IntervalSet\n\n\t// atn is the current ATN.\n\tatn *ATN\n\n\tepsilonOnlyTransitions bool\n\n\t// ruleIndex tracks the Rule index because there are no Rule objects at runtime.\n\truleIndex int\n\n\tstateNumber int\n\n\tstateType int\n\n\t// Track the transitions emanating from this ATN state.\n\ttransitions []Transition\n}\n\nfunc NewATNState() *BaseATNState {\n\treturn &BaseATNState{stateNumber: ATNStateInvalidStateNumber, stateType: ATNStateInvalidType}\n}\n\nfunc (as *BaseATNState) GetRuleIndex() int {\n\treturn as.ruleIndex\n}\n\nfunc (as *BaseATNState) SetRuleIndex(v int) {\n\tas.ruleIndex = v\n}\nfunc (as *BaseATNState) GetEpsilonOnlyTransitions() bool {\n\treturn as.epsilonOnlyTransitions\n}\n\nfunc (as *BaseATNState) GetATN() *ATN {\n\treturn as.atn\n}\n\nfunc (as *BaseATNState) SetATN(atn *ATN) {\n\tas.atn = atn\n}\n\nfunc (as *BaseATNState) GetTransitions() []Transition {\n\treturn as.transitions\n}\n\nfunc (as *BaseATNState) SetTransitions(t []Transition) {\n\tas.transitions = t\n}\n\nfunc (as *BaseATNState) GetStateType() int {\n\treturn as.stateType\n}\n\nfunc (as *BaseATNState) GetStateNumber() int {\n\treturn as.stateNumber\n}\n\nfunc (as *BaseATNState) SetStateNumber(stateNumber int) {\n\tas.stateNumber = stateNumber\n}\n\nfunc (as *BaseATNState) GetNextTokenWithinRule() *IntervalSet {\n\treturn as.NextTokenWithinRule\n}\n\nfunc (as *BaseATNState) SetNextTokenWithinRule(v *IntervalSet) {\n\tas.NextTokenWithinRule = v\n}\n\nfunc (as *BaseATNState) Hash() int {\n\treturn as.stateNumber\n}\n\nfunc (as *BaseATNState) String() string {\n\treturn strconv.Itoa(as.stateNumber)\n}\n\nfunc (as *BaseATNState) Equals(other Collectable[ATNState]) bool {\n\tif ot, ok := other.(ATNState); ok {\n\t\treturn as.stateNumber == ot.GetStateNumber()\n\t}\n\n\treturn false\n}\n\nfunc (as *BaseATNState) isNonGreedyExitState() bool {\n\treturn false\n}\n\nfunc (as *BaseATNState) AddTransition(trans Transition, index int) {\n\tif len(as.transitions) == 0 {\n\t\tas.epsilonOnlyTransitions = trans.getIsEpsilon()\n\t} else if as.epsilonOnlyTransitions != trans.getIsEpsilon() {\n\t\t_, _ = fmt.Fprintf(os.Stdin, \"ATN state %d has both epsilon and non-epsilon transitions.\\n\", as.stateNumber)\n\t\tas.epsilonOnlyTransitions = false\n\t}\n\n\t// TODO: Check code for already present compared to the Java equivalent\n\t//alreadyPresent := false\n\t//for _, t := range as.transitions {\n\t//\tif t.getTarget().GetStateNumber() == trans.getTarget().GetStateNumber() {\n\t//\t\tif t.getLabel() != nil && trans.getLabel() != nil && trans.getLabel().Equals(t.getLabel()) {\n\t//\t\t\talreadyPresent = true\n\t//\t\t\tbreak\n\t//\t\t}\n\t//\t} else if t.getIsEpsilon() && trans.getIsEpsilon() {\n\t//\t\talreadyPresent = true\n\t//\t\tbreak\n\t//\t}\n\t//}\n\t//if !alreadyPresent {\n\tif index == -1 {\n\t\tas.transitions = append(as.transitions, trans)\n\t} else {\n\t\tas.transitions = append(as.transitions[:index], append([]Transition{trans}, as.transitions[index:]...)...)\n\t\t// TODO: as.transitions.splice(index, 1, trans)\n\t}\n\t//} else {\n\t//\t_, _ = fmt.Fprintf(os.Stderr, \"Transition already present in state %d\\n\", as.stateNumber)\n\t//}\n}\n\ntype BasicState struct {\n\tBaseATNState\n}\n\nfunc NewBasicState() *BasicState {\n\treturn &BasicState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateBasic,\n\t\t},\n\t}\n}\n\ntype DecisionState interface {\n\tATNState\n\n\tgetDecision() int\n\tsetDecision(int)\n\n\tgetNonGreedy() bool\n\tsetNonGreedy(bool)\n}\n\ntype BaseDecisionState struct {\n\tBaseATNState\n\tdecision  int\n\tnonGreedy bool\n}\n\nfunc NewBaseDecisionState() *BaseDecisionState {\n\treturn &BaseDecisionState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateBasic,\n\t\t},\n\t\tdecision: -1,\n\t}\n}\n\nfunc (s *BaseDecisionState) getDecision() int {\n\treturn s.decision\n}\n\nfunc (s *BaseDecisionState) setDecision(b int) {\n\ts.decision = b\n}\n\nfunc (s *BaseDecisionState) getNonGreedy() bool {\n\treturn s.nonGreedy\n}\n\nfunc (s *BaseDecisionState) setNonGreedy(b bool) {\n\ts.nonGreedy = b\n}\n\ntype BlockStartState interface {\n\tDecisionState\n\n\tgetEndState() *BlockEndState\n\tsetEndState(*BlockEndState)\n}\n\n// BaseBlockStartState is the start of a regular (...) block.\ntype BaseBlockStartState struct {\n\tBaseDecisionState\n\tendState *BlockEndState\n}\n\nfunc NewBlockStartState() *BaseBlockStartState {\n\treturn &BaseBlockStartState{\n\t\tBaseDecisionState: BaseDecisionState{\n\t\t\tBaseATNState: BaseATNState{\n\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\tstateType:   ATNStateBasic,\n\t\t\t},\n\t\t\tdecision: -1,\n\t\t},\n\t}\n}\n\nfunc (s *BaseBlockStartState) getEndState() *BlockEndState {\n\treturn s.endState\n}\n\nfunc (s *BaseBlockStartState) setEndState(b *BlockEndState) {\n\ts.endState = b\n}\n\ntype BasicBlockStartState struct {\n\tBaseBlockStartState\n}\n\nfunc NewBasicBlockStartState() *BasicBlockStartState {\n\treturn &BasicBlockStartState{\n\t\tBaseBlockStartState: BaseBlockStartState{\n\t\t\tBaseDecisionState: BaseDecisionState{\n\t\t\t\tBaseATNState: BaseATNState{\n\t\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\t\tstateType:   ATNStateBlockStart,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nvar _ BlockStartState = &BasicBlockStartState{}\n\n// BlockEndState is a terminal node of a simple (a|b|c) block.\ntype BlockEndState struct {\n\tBaseATNState\n\tstartState ATNState\n}\n\nfunc NewBlockEndState() *BlockEndState {\n\treturn &BlockEndState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateBlockEnd,\n\t\t},\n\t\tstartState: nil,\n\t}\n}\n\n// RuleStopState is the last node in the ATN for a rule, unless that rule is the\n// start symbol. In that case, there is one transition to EOF. Later, we might\n// encode references to all calls to this rule to compute FOLLOW sets for error\n// handling.\ntype RuleStopState struct {\n\tBaseATNState\n}\n\nfunc NewRuleStopState() *RuleStopState {\n\treturn &RuleStopState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateRuleStop,\n\t\t},\n\t}\n}\n\ntype RuleStartState struct {\n\tBaseATNState\n\tstopState        ATNState\n\tisPrecedenceRule bool\n}\n\nfunc NewRuleStartState() *RuleStartState {\n\treturn &RuleStartState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateRuleStart,\n\t\t},\n\t}\n}\n\n// PlusLoopbackState is a decision state for A+ and (A|B)+. It has two\n// transitions: one to the loop back to start of the block, and one to exit.\ntype PlusLoopbackState struct {\n\tBaseDecisionState\n}\n\nfunc NewPlusLoopbackState() *PlusLoopbackState {\n\treturn &PlusLoopbackState{\n\t\tBaseDecisionState: BaseDecisionState{\n\t\t\tBaseATNState: BaseATNState{\n\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\tstateType:   ATNStatePlusLoopBack,\n\t\t\t},\n\t\t},\n\t}\n}\n\n// PlusBlockStartState is the start of a (A|B|...)+ loop. Technically it is a\n// decision state; we don't use it for code generation. Somebody might need it,\n// it is included for completeness. In reality, PlusLoopbackState is the real\n// decision-making node for A+.\ntype PlusBlockStartState struct {\n\tBaseBlockStartState\n\tloopBackState ATNState\n}\n\nfunc NewPlusBlockStartState() *PlusBlockStartState {\n\treturn &PlusBlockStartState{\n\t\tBaseBlockStartState: BaseBlockStartState{\n\t\t\tBaseDecisionState: BaseDecisionState{\n\t\t\t\tBaseATNState: BaseATNState{\n\t\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\t\tstateType:   ATNStatePlusBlockStart,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nvar _ BlockStartState = &PlusBlockStartState{}\n\n// StarBlockStartState is the block that begins a closure loop.\ntype StarBlockStartState struct {\n\tBaseBlockStartState\n}\n\nfunc NewStarBlockStartState() *StarBlockStartState {\n\treturn &StarBlockStartState{\n\t\tBaseBlockStartState: BaseBlockStartState{\n\t\t\tBaseDecisionState: BaseDecisionState{\n\t\t\t\tBaseATNState: BaseATNState{\n\t\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\t\tstateType:   ATNStateStarBlockStart,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nvar _ BlockStartState = &StarBlockStartState{}\n\ntype StarLoopbackState struct {\n\tBaseATNState\n}\n\nfunc NewStarLoopbackState() *StarLoopbackState {\n\treturn &StarLoopbackState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateStarLoopBack,\n\t\t},\n\t}\n}\n\ntype StarLoopEntryState struct {\n\tBaseDecisionState\n\tloopBackState          ATNState\n\tprecedenceRuleDecision bool\n}\n\nfunc NewStarLoopEntryState() *StarLoopEntryState {\n\t// False precedenceRuleDecision indicates whether s state can benefit from a precedence DFA during SLL decision making.\n\treturn &StarLoopEntryState{\n\t\tBaseDecisionState: BaseDecisionState{\n\t\t\tBaseATNState: BaseATNState{\n\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\tstateType:   ATNStateStarLoopEntry,\n\t\t\t},\n\t\t},\n\t}\n}\n\n// LoopEndState marks the end of a * or + loop.\ntype LoopEndState struct {\n\tBaseATNState\n\tloopBackState ATNState\n}\n\nfunc NewLoopEndState() *LoopEndState {\n\treturn &LoopEndState{\n\t\tBaseATNState: BaseATNState{\n\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\tstateType:   ATNStateLoopEnd,\n\t\t},\n\t}\n}\n\n// TokensStartState is the Tokens rule start state linking to each lexer rule start state.\ntype TokensStartState struct {\n\tBaseDecisionState\n}\n\nfunc NewTokensStartState() *TokensStartState {\n\treturn &TokensStartState{\n\t\tBaseDecisionState: BaseDecisionState{\n\t\t\tBaseATNState: BaseATNState{\n\t\t\t\tstateNumber: ATNStateInvalidStateNumber,\n\t\t\t\tstateType:   ATNStateTokenStart,\n\t\t\t},\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/atn_type.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// Represent the type of recognizer an ATN applies to.\nconst (\n\tATNTypeLexer  = 0\n\tATNTypeParser = 1\n)\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/char_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\ntype CharStream interface {\n\tIntStream\n\tGetText(int, int) string\n\tGetTextFromTokens(start, end Token) string\n\tGetTextFromInterval(Interval) string\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// TokenFactory creates CommonToken objects.\ntype TokenFactory interface {\n\tCreate(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token\n}\n\n// CommonTokenFactory is the default TokenFactory implementation.\ntype CommonTokenFactory struct {\n\t// copyText indicates whether CommonToken.setText should be called after\n\t// constructing tokens to explicitly set the text. This is useful for cases\n\t// where the input stream might not be able to provide arbitrary substrings of\n\t// text from the input after the lexer creates a token (e.g. the\n\t// implementation of CharStream.GetText in UnbufferedCharStream panics an\n\t// UnsupportedOperationException). Explicitly setting the token text allows\n\t// Token.GetText to be called at any time regardless of the input stream\n\t// implementation.\n\t//\n\t// The default value is false to avoid the performance and memory overhead of\n\t// copying text for every token unless explicitly requested.\n\tcopyText bool\n}\n\nfunc NewCommonTokenFactory(copyText bool) *CommonTokenFactory {\n\treturn &CommonTokenFactory{copyText: copyText}\n}\n\n// CommonTokenFactoryDEFAULT is the default CommonTokenFactory. It does not\n// explicitly copy token text when constructing tokens.\nvar CommonTokenFactoryDEFAULT = NewCommonTokenFactory(false)\n\nfunc (c *CommonTokenFactory) Create(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token {\n\tt := NewCommonToken(source, ttype, channel, start, stop)\n\n\tt.line = line\n\tt.column = column\n\n\tif text != \"\" {\n\t\tt.SetText(text)\n\t} else if c.copyText && source.charStream != nil {\n\t\tt.SetText(source.charStream.GetTextFromInterval(NewInterval(start, stop)))\n\t}\n\n\treturn t\n}\n\nfunc (c *CommonTokenFactory) createThin(ttype int, text string) Token {\n\tt := NewCommonToken(nil, ttype, TokenDefaultChannel, -1, -1)\n\tt.SetText(text)\n\n\treturn t\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"strconv\"\n)\n\n// CommonTokenStream is an implementation of TokenStream that loads tokens from\n// a TokenSource on-demand and places the tokens in a buffer to provide access\n// to any previous token by index. This token stream ignores the value of\n// Token.getChannel. If your parser requires the token stream filter tokens to\n// only those on a particular channel, such as Token.DEFAULT_CHANNEL or\n// Token.HIDDEN_CHANNEL, use a filtering token stream such a CommonTokenStream.\ntype CommonTokenStream struct {\n\tchannel int\n\n\t// fetchedEOF indicates whether the Token.EOF token has been fetched from\n\t// tokenSource and added to tokens. This field improves performance for the\n\t// following cases:\n\t//\n\t// consume: The lookahead check in consume to preven consuming the EOF symbol is\n\t// optimized by checking the values of fetchedEOF and p instead of calling LA.\n\t//\n\t// fetch: The check to prevent adding multiple EOF symbols into tokens is\n\t// trivial with bt field.\n\tfetchedEOF bool\n\n\t// index into [tokens] of the current token (next token to consume).\n\t// tokens[p] should be LT(1). It is set to -1 when the stream is first\n\t// constructed or when SetTokenSource is called, indicating that the first token\n\t// has not yet been fetched from the token source. For additional information,\n\t// see the documentation of [IntStream] for a description of initializing methods.\n\tindex int\n\n\t// tokenSource is the [TokenSource] from which tokens for the bt stream are\n\t// fetched.\n\ttokenSource TokenSource\n\n\t// tokens contains all tokens fetched from the token source. The list is considered a\n\t// complete view of the input once fetchedEOF is set to true.\n\ttokens []Token\n}\n\n// NewCommonTokenStream creates a new CommonTokenStream instance using the supplied lexer to produce\n// tokens and will pull tokens from the given lexer channel.\nfunc NewCommonTokenStream(lexer Lexer, channel int) *CommonTokenStream {\n\treturn &CommonTokenStream{\n\t\tchannel:     channel,\n\t\tindex:       -1,\n\t\ttokenSource: lexer,\n\t\ttokens:      make([]Token, 0),\n\t}\n}\n\n// GetAllTokens returns all tokens currently pulled from the token source.\nfunc (c *CommonTokenStream) GetAllTokens() []Token {\n\treturn c.tokens\n}\n\nfunc (c *CommonTokenStream) Mark() int {\n\treturn 0\n}\n\nfunc (c *CommonTokenStream) Release(_ int) {}\n\nfunc (c *CommonTokenStream) Reset() {\n\tc.fetchedEOF = false\n\tc.tokens = make([]Token, 0)\n\tc.Seek(0)\n}\n\nfunc (c *CommonTokenStream) Seek(index int) {\n\tc.lazyInit()\n\tc.index = c.adjustSeekIndex(index)\n}\n\nfunc (c *CommonTokenStream) Get(index int) Token {\n\tc.lazyInit()\n\n\treturn c.tokens[index]\n}\n\nfunc (c *CommonTokenStream) Consume() {\n\tSkipEOFCheck := false\n\n\tif c.index >= 0 {\n\t\tif c.fetchedEOF {\n\t\t\t// The last token in tokens is EOF. Skip the check if p indexes any fetched.\n\t\t\t// token except the last.\n\t\t\tSkipEOFCheck = c.index < len(c.tokens)-1\n\t\t} else {\n\t\t\t// No EOF token in tokens. Skip the check if p indexes a fetched token.\n\t\t\tSkipEOFCheck = c.index < len(c.tokens)\n\t\t}\n\t} else {\n\t\t// Not yet initialized\n\t\tSkipEOFCheck = false\n\t}\n\n\tif !SkipEOFCheck && c.LA(1) == TokenEOF {\n\t\tpanic(\"cannot consume EOF\")\n\t}\n\n\tif c.Sync(c.index + 1) {\n\t\tc.index = c.adjustSeekIndex(c.index + 1)\n\t}\n}\n\n// Sync makes sure index i in tokens has a token and returns true if a token is\n// located at index i and otherwise false.\nfunc (c *CommonTokenStream) Sync(i int) bool {\n\tn := i - len(c.tokens) + 1 // How many more elements do we need?\n\n\tif n > 0 {\n\t\tfetched := c.fetch(n)\n\t\treturn fetched >= n\n\t}\n\n\treturn true\n}\n\n// fetch adds n elements to buffer and returns the actual number of elements\n// added to the buffer.\nfunc (c *CommonTokenStream) fetch(n int) int {\n\tif c.fetchedEOF {\n\t\treturn 0\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tt := c.tokenSource.NextToken()\n\n\t\tt.SetTokenIndex(len(c.tokens))\n\t\tc.tokens = append(c.tokens, t)\n\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\tc.fetchedEOF = true\n\n\t\t\treturn i + 1\n\t\t}\n\t}\n\n\treturn n\n}\n\n// GetTokens gets all tokens from start to stop inclusive.\nfunc (c *CommonTokenStream) GetTokens(start int, stop int, types *IntervalSet) []Token {\n\tif start < 0 || stop < 0 {\n\t\treturn nil\n\t}\n\n\tc.lazyInit()\n\n\tsubset := make([]Token, 0)\n\n\tif stop >= len(c.tokens) {\n\t\tstop = len(c.tokens) - 1\n\t}\n\n\tfor i := start; i < stop; i++ {\n\t\tt := c.tokens[i]\n\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\tbreak\n\t\t}\n\n\t\tif types == nil || types.contains(t.GetTokenType()) {\n\t\t\tsubset = append(subset, t)\n\t\t}\n\t}\n\n\treturn subset\n}\n\nfunc (c *CommonTokenStream) LA(i int) int {\n\treturn c.LT(i).GetTokenType()\n}\n\nfunc (c *CommonTokenStream) lazyInit() {\n\tif c.index == -1 {\n\t\tc.setup()\n\t}\n}\n\nfunc (c *CommonTokenStream) setup() {\n\tc.Sync(0)\n\tc.index = c.adjustSeekIndex(0)\n}\n\nfunc (c *CommonTokenStream) GetTokenSource() TokenSource {\n\treturn c.tokenSource\n}\n\n// SetTokenSource resets the c token stream by setting its token source.\nfunc (c *CommonTokenStream) SetTokenSource(tokenSource TokenSource) {\n\tc.tokenSource = tokenSource\n\tc.tokens = make([]Token, 0)\n\tc.index = -1\n\tc.fetchedEOF = false\n}\n\n// NextTokenOnChannel returns the index of the next token on channel given a\n// starting index. Returns i if tokens[i] is on channel. Returns -1 if there are\n// no tokens on channel between 'i' and [TokenEOF].\nfunc (c *CommonTokenStream) NextTokenOnChannel(i, _ int) int {\n\tc.Sync(i)\n\n\tif i >= len(c.tokens) {\n\t\treturn -1\n\t}\n\n\ttoken := c.tokens[i]\n\n\tfor token.GetChannel() != c.channel {\n\t\tif token.GetTokenType() == TokenEOF {\n\t\t\treturn -1\n\t\t}\n\n\t\ti++\n\t\tc.Sync(i)\n\t\ttoken = c.tokens[i]\n\t}\n\n\treturn i\n}\n\n// previousTokenOnChannel returns the index of the previous token on channel\n// given a starting index. Returns i if tokens[i] is on channel. Returns -1 if\n// there are no tokens on channel between i and 0.\nfunc (c *CommonTokenStream) previousTokenOnChannel(i, channel int) int {\n\tfor i >= 0 && c.tokens[i].GetChannel() != channel {\n\t\ti--\n\t}\n\n\treturn i\n}\n\n// GetHiddenTokensToRight collects all tokens on a specified channel to the\n// right of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL\n// or EOF. If channel is -1, it finds any non-default channel token.\nfunc (c *CommonTokenStream) GetHiddenTokensToRight(tokenIndex, channel int) []Token {\n\tc.lazyInit()\n\n\tif tokenIndex < 0 || tokenIndex >= len(c.tokens) {\n\t\tpanic(strconv.Itoa(tokenIndex) + \" not in 0..\" + strconv.Itoa(len(c.tokens)-1))\n\t}\n\n\tnextOnChannel := c.NextTokenOnChannel(tokenIndex+1, LexerDefaultTokenChannel)\n\tfrom := tokenIndex + 1\n\n\t// If no onChannel to the right, then nextOnChannel == -1, so set 'to' to the last token\n\tvar to int\n\n\tif nextOnChannel == -1 {\n\t\tto = len(c.tokens) - 1\n\t} else {\n\t\tto = nextOnChannel\n\t}\n\n\treturn c.filterForChannel(from, to, channel)\n}\n\n// GetHiddenTokensToLeft collects all tokens on channel to the left of the\n// current token until we see a token on DEFAULT_TOKEN_CHANNEL. If channel is\n// -1, it finds any non default channel token.\nfunc (c *CommonTokenStream) GetHiddenTokensToLeft(tokenIndex, channel int) []Token {\n\tc.lazyInit()\n\n\tif tokenIndex < 0 || tokenIndex >= len(c.tokens) {\n\t\tpanic(strconv.Itoa(tokenIndex) + \" not in 0..\" + strconv.Itoa(len(c.tokens)-1))\n\t}\n\n\tprevOnChannel := c.previousTokenOnChannel(tokenIndex-1, LexerDefaultTokenChannel)\n\n\tif prevOnChannel == tokenIndex-1 {\n\t\treturn nil\n\t}\n\n\t// If there are none on channel to the left and prevOnChannel == -1 then from = 0\n\tfrom := prevOnChannel + 1\n\tto := tokenIndex - 1\n\n\treturn c.filterForChannel(from, to, channel)\n}\n\nfunc (c *CommonTokenStream) filterForChannel(left, right, channel int) []Token {\n\thidden := make([]Token, 0)\n\n\tfor i := left; i < right+1; i++ {\n\t\tt := c.tokens[i]\n\n\t\tif channel == -1 {\n\t\t\tif t.GetChannel() != LexerDefaultTokenChannel {\n\t\t\t\thidden = append(hidden, t)\n\t\t\t}\n\t\t} else if t.GetChannel() == channel {\n\t\t\thidden = append(hidden, t)\n\t\t}\n\t}\n\n\tif len(hidden) == 0 {\n\t\treturn nil\n\t}\n\n\treturn hidden\n}\n\nfunc (c *CommonTokenStream) GetSourceName() string {\n\treturn c.tokenSource.GetSourceName()\n}\n\nfunc (c *CommonTokenStream) Size() int {\n\treturn len(c.tokens)\n}\n\nfunc (c *CommonTokenStream) Index() int {\n\treturn c.index\n}\n\nfunc (c *CommonTokenStream) GetAllText() string {\n\tc.Fill()\n\treturn c.GetTextFromInterval(NewInterval(0, len(c.tokens)-1))\n}\n\nfunc (c *CommonTokenStream) GetTextFromTokens(start, end Token) string {\n\tif start == nil || end == nil {\n\t\treturn \"\"\n\t}\n\n\treturn c.GetTextFromInterval(NewInterval(start.GetTokenIndex(), end.GetTokenIndex()))\n}\n\nfunc (c *CommonTokenStream) GetTextFromRuleContext(interval RuleContext) string {\n\treturn c.GetTextFromInterval(interval.GetSourceInterval())\n}\n\nfunc (c *CommonTokenStream) GetTextFromInterval(interval Interval) string {\n\tc.lazyInit()\n\tc.Sync(interval.Stop)\n\n\tstart := interval.Start\n\tstop := interval.Stop\n\n\tif start < 0 || stop < 0 {\n\t\treturn \"\"\n\t}\n\n\tif stop >= len(c.tokens) {\n\t\tstop = len(c.tokens) - 1\n\t}\n\n\ts := \"\"\n\n\tfor i := start; i < stop+1; i++ {\n\t\tt := c.tokens[i]\n\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\tbreak\n\t\t}\n\n\t\ts += t.GetText()\n\t}\n\n\treturn s\n}\n\n// Fill gets all tokens from the lexer until EOF.\nfunc (c *CommonTokenStream) Fill() {\n\tc.lazyInit()\n\n\tfor c.fetch(1000) == 1000 {\n\t\tcontinue\n\t}\n}\n\nfunc (c *CommonTokenStream) adjustSeekIndex(i int) int {\n\treturn c.NextTokenOnChannel(i, c.channel)\n}\n\nfunc (c *CommonTokenStream) LB(k int) Token {\n\tif k == 0 || c.index-k < 0 {\n\t\treturn nil\n\t}\n\n\ti := c.index\n\tn := 1\n\n\t// Find k good tokens looking backward\n\tfor n <= k {\n\t\t// Skip off-channel tokens\n\t\ti = c.previousTokenOnChannel(i-1, c.channel)\n\t\tn++\n\t}\n\n\tif i < 0 {\n\t\treturn nil\n\t}\n\n\treturn c.tokens[i]\n}\n\nfunc (c *CommonTokenStream) LT(k int) Token {\n\tc.lazyInit()\n\n\tif k == 0 {\n\t\treturn nil\n\t}\n\n\tif k < 0 {\n\t\treturn c.LB(-k)\n\t}\n\n\ti := c.index\n\tn := 1 // We know tokens[n] is valid\n\n\t// Find k good tokens\n\tfor n < k {\n\t\t// Skip off-channel tokens, but make sure to not look past EOF\n\t\tif c.Sync(i + 1) {\n\t\t\ti = c.NextTokenOnChannel(i+1, c.channel)\n\t\t}\n\n\t\tn++\n\t}\n\n\treturn c.tokens[i]\n}\n\n// getNumberOfOnChannelTokens counts EOF once.\nfunc (c *CommonTokenStream) getNumberOfOnChannelTokens() int {\n\tvar n int\n\n\tc.Fill()\n\n\tfor i := 0; i < len(c.tokens); i++ {\n\t\tt := c.tokens[i]\n\n\t\tif t.GetChannel() == c.channel {\n\t\t\tn++\n\t\t}\n\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn n\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/comparators.go",
    "content": "package antlr\n\n// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\n// This file contains all the implementations of custom comparators used for generic collections when the\n// Hash() and Equals() funcs supplied by the struct objects themselves need to be overridden. Normally, we would\n// put the comparators in the source file for the struct themselves, but given the organization of this code is\n// sorta kinda based upon the Java code, I found it confusing trying to find out which comparator was where and used by\n// which instantiation of a collection. For instance, an Array2DHashSet in the Java source, when used with ATNConfig\n// collections requires three different comparators depending on what the collection is being used for. Collecting - pun intended -\n// all the comparators here, makes it much easier to see which implementation of hash and equals is used by which collection.\n// It also makes it easy to verify that the Hash() and Equals() functions marry up with the Java implementations.\n\n// ObjEqComparator is the equivalent of the Java ObjectEqualityComparator, which is the default instance of\n// Equality comparator. We do not have inheritance in Go, only interfaces, so we use generics to enforce some\n// type safety and avoid having to implement this for every type that we want to perform comparison on.\n//\n// This comparator works by using the standard Hash() and Equals() methods of the type T that is being compared. Which\n// allows us to use it in any collection instance that does not require a special hash or equals implementation.\ntype ObjEqComparator[T Collectable[T]] struct{}\n\nvar (\n\taStateEqInst = &ObjEqComparator[ATNState]{}\n\taConfEqInst  = &ObjEqComparator[*ATNConfig]{}\n\n\t// aConfCompInst is the comparator used for the ATNConfigSet for the configLookup cache\n\taConfCompInst   = &ATNConfigComparator[*ATNConfig]{}\n\tatnConfCompInst = &BaseATNConfigComparator[*ATNConfig]{}\n\tdfaStateEqInst  = &ObjEqComparator[*DFAState]{}\n\tsemctxEqInst    = &ObjEqComparator[SemanticContext]{}\n\tatnAltCfgEqInst = &ATNAltConfigComparator[*ATNConfig]{}\n\tpContextEqInst  = &ObjEqComparator[*PredictionContext]{}\n)\n\n// Equals2 delegates to the Equals() method of type T\nfunc (c *ObjEqComparator[T]) Equals2(o1, o2 T) bool {\n\treturn o1.Equals(o2)\n}\n\n// Hash1 delegates to the Hash() method of type T\nfunc (c *ObjEqComparator[T]) Hash1(o T) int {\n\n\treturn o.Hash()\n}\n\ntype SemCComparator[T Collectable[T]] struct{}\n\n// ATNConfigComparator is used as the comparator for the configLookup field of an ATNConfigSet\n// and has a custom Equals() and Hash() implementation, because equality is not based on the\n// standard Hash() and Equals() methods of the ATNConfig type.\ntype ATNConfigComparator[T Collectable[T]] struct {\n}\n\n// Equals2 is a custom comparator for ATNConfigs specifically for configLookup\nfunc (c *ATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {\n\n\t// Same pointer, must be equal, even if both nil\n\t//\n\tif o1 == o2 {\n\t\treturn true\n\n\t}\n\n\t// If either are nil, but not both, then the result is false\n\t//\n\tif o1 == nil || o2 == nil {\n\t\treturn false\n\t}\n\n\treturn o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() &&\n\t\to1.GetAlt() == o2.GetAlt() &&\n\t\to1.GetSemanticContext().Equals(o2.GetSemanticContext())\n}\n\n// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup\nfunc (c *ATNConfigComparator[T]) Hash1(o *ATNConfig) int {\n\n\thash := 7\n\thash = 31*hash + o.GetState().GetStateNumber()\n\thash = 31*hash + o.GetAlt()\n\thash = 31*hash + o.GetSemanticContext().Hash()\n\treturn hash\n}\n\n// ATNAltConfigComparator is used as the comparator for mapping configs to Alt Bitsets\ntype ATNAltConfigComparator[T Collectable[T]] struct {\n}\n\n// Equals2 is a custom comparator for ATNConfigs specifically for configLookup\nfunc (c *ATNAltConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {\n\n\t// Same pointer, must be equal, even if both nil\n\t//\n\tif o1 == o2 {\n\t\treturn true\n\n\t}\n\n\t// If either are nil, but not both, then the result is false\n\t//\n\tif o1 == nil || o2 == nil {\n\t\treturn false\n\t}\n\n\treturn o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() &&\n\t\to1.GetContext().Equals(o2.GetContext())\n}\n\n// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup\nfunc (c *ATNAltConfigComparator[T]) Hash1(o *ATNConfig) int {\n\th := murmurInit(7)\n\th = murmurUpdate(h, o.GetState().GetStateNumber())\n\th = murmurUpdate(h, o.GetContext().Hash())\n\treturn murmurFinish(h, 2)\n}\n\n// BaseATNConfigComparator is used as the comparator for the configLookup field of a ATNConfigSet\n// and has a custom Equals() and Hash() implementation, because equality is not based on the\n// standard Hash() and Equals() methods of the ATNConfig type.\ntype BaseATNConfigComparator[T Collectable[T]] struct {\n}\n\n// Equals2 is a custom comparator for ATNConfigs specifically for baseATNConfigSet\nfunc (c *BaseATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {\n\n\t// Same pointer, must be equal, even if both nil\n\t//\n\tif o1 == o2 {\n\t\treturn true\n\n\t}\n\n\t// If either are nil, but not both, then the result is false\n\t//\n\tif o1 == nil || o2 == nil {\n\t\treturn false\n\t}\n\n\treturn o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() &&\n\t\to1.GetAlt() == o2.GetAlt() &&\n\t\to1.GetSemanticContext().Equals(o2.GetSemanticContext())\n}\n\n// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup, but in fact just\n// delegates to the standard Hash() method of the ATNConfig type.\nfunc (c *BaseATNConfigComparator[T]) Hash1(o *ATNConfig) int {\n\treturn o.Hash()\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/configuration.go",
    "content": "package antlr\n\ntype runtimeConfiguration struct {\n\tstatsTraceStacks              bool\n\tlexerATNSimulatorDebug        bool\n\tlexerATNSimulatorDFADebug     bool\n\tparserATNSimulatorDebug       bool\n\tparserATNSimulatorTraceATNSim bool\n\tparserATNSimulatorDFADebug    bool\n\tparserATNSimulatorRetryDebug  bool\n\tlRLoopEntryBranchOpt          bool\n\tmemoryManager                 bool\n}\n\n// Global runtime configuration\nvar runtimeConfig = runtimeConfiguration{\n\tlRLoopEntryBranchOpt: true,\n}\n\ntype runtimeOption func(*runtimeConfiguration) error\n\n// ConfigureRuntime allows the runtime to be configured globally setting things like trace and statistics options.\n// It uses the functional options pattern for go. This is a package global function as it operates on the runtime\n// configuration regardless of the instantiation of anything higher up such as a parser or lexer. Generally this is\n// used for debugging/tracing/statistics options, which are usually used by the runtime maintainers (or rather the\n// only maintainer). However, it is possible that you might want to use this to set a global option concerning the\n// memory allocation type used by the runtime such as sync.Pool or not.\n//\n// The options are applied in the order they are passed in, so the last option will override any previous options.\n//\n// For example, if you want to turn on the collection create point stack flag to true, you can do:\n//\n//\tantlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true))\n//\n// If you want to turn it off, you can do:\n//\n//\tantlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false))\nfunc ConfigureRuntime(options ...runtimeOption) error {\n\tfor _, option := range options {\n\t\terr := option(&runtimeConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// WithStatsTraceStacks sets the global flag indicating whether to collect stack traces at the create-point of\n// certain structs, such as collections, or the use point of certain methods such as Put().\n// Because this can be expensive, it is turned off by default. However, it\n// can be useful to track down exactly where memory is being created and used.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false))\nfunc WithStatsTraceStacks(trace bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.statsTraceStacks = trace\n\t\treturn nil\n\t}\n}\n\n// WithLexerATNSimulatorDebug sets the global flag indicating whether to log debug information from the lexer [ATN]\n// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful\n// to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(false))\nfunc WithLexerATNSimulatorDebug(debug bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.lexerATNSimulatorDebug = debug\n\t\treturn nil\n\t}\n}\n\n// WithLexerATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the lexer [ATN] [DFA]\n// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful\n// to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(false))\nfunc WithLexerATNSimulatorDFADebug(debug bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.lexerATNSimulatorDFADebug = debug\n\t\treturn nil\n\t}\n}\n\n// WithParserATNSimulatorDebug sets the global flag indicating whether to log debug information from the parser [ATN]\n// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful\n// to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(false))\nfunc WithParserATNSimulatorDebug(debug bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.parserATNSimulatorDebug = debug\n\t\treturn nil\n\t}\n}\n\n// WithParserATNSimulatorTraceATNSim sets the global flag indicating whether to log trace information from the parser [ATN] simulator\n// [DFA]. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful\n// to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(false))\nfunc WithParserATNSimulatorTraceATNSim(trace bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.parserATNSimulatorTraceATNSim = trace\n\t\treturn nil\n\t}\n}\n\n// WithParserATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA]\n// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful\n// to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(false))\nfunc WithParserATNSimulatorDFADebug(debug bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.parserATNSimulatorDFADebug = debug\n\t\treturn nil\n\t}\n}\n\n// WithParserATNSimulatorRetryDebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA]\n// simulator when retrying a decision. This is useful for debugging parser issues by comparing the output with the Java runtime.\n// Only useful to the runtime maintainers.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(false))\nfunc WithParserATNSimulatorRetryDebug(debug bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.parserATNSimulatorRetryDebug = debug\n\t\treturn nil\n\t}\n}\n\n// WithLRLoopEntryBranchOpt sets the global flag indicating whether let recursive loop operations should be\n// optimized or not. This is useful for debugging parser issues by comparing the output with the Java runtime.\n// It turns off the functionality of [canDropLoopEntryEdgeInLeftRecursiveRule] in [ParserATNSimulator].\n//\n// Note that default is to use this optimization.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(true))\n//\n// You can turn it off at any time using:\n//\n//\tantlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(false))\nfunc WithLRLoopEntryBranchOpt(off bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.lRLoopEntryBranchOpt = off\n\t\treturn nil\n\t}\n}\n\n// WithMemoryManager sets the global flag indicating whether to use the memory manager or not. This is useful\n// for poorly constructed grammars that create a lot of garbage. It turns on the functionality of [memoryManager], which\n// will intercept garbage collection and cause available memory to be reused. At the end of the day, this is no substitute\n// for fixing your grammar by ridding yourself of extreme ambiguity. BUt if you are just trying to reuse an opensource\n// grammar, this may help make it more practical.\n//\n// Note that default is to use normal Go memory allocation and not pool memory.\n//\n// Use:\n//\n//\tantlr.ConfigureRuntime(antlr.WithMemoryManager(true))\n//\n// Note that if you turn this on, you should probably leave it on. You should use only one memory strategy or the other\n// and should remember to nil out any references to the parser or lexer when you are done with them.\nfunc WithMemoryManager(use bool) runtimeOption {\n\treturn func(config *runtimeConfiguration) error {\n\t\tconfig.memoryManager = use\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/dfa.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// DFA represents the Deterministic Finite Automaton used by the recognizer, including all the states it can\n// reach and the transitions between them.\ntype DFA struct {\n\t// atnStartState is the ATN state in which this was created\n\tatnStartState DecisionState\n\n\tdecision int\n\n\t// states is all the DFA states. Use Map to get the old state back; Set can only\n\t// indicate whether it is there. Go maps implement key hash collisions and so on and are very\n\t// good, but the DFAState is an object and can't be used directly as the key as it can in say Java\n\t// amd C#, whereby if the hashcode is the same for two objects, then Equals() is called against them\n\t// to see if they really are the same object. Hence, we have our own map storage.\n\t//\n\tstates *JStore[*DFAState, *ObjEqComparator[*DFAState]]\n\n\tnumstates int\n\n\ts0 *DFAState\n\n\t// precedenceDfa is the backing field for isPrecedenceDfa and setPrecedenceDfa.\n\t// True if the DFA is for a precedence decision and false otherwise.\n\tprecedenceDfa bool\n}\n\nfunc NewDFA(atnStartState DecisionState, decision int) *DFA {\n\tdfa := &DFA{\n\t\tatnStartState: atnStartState,\n\t\tdecision:      decision,\n\t\tstates:        nil, // Lazy initialize\n\t}\n\tif s, ok := atnStartState.(*StarLoopEntryState); ok && s.precedenceRuleDecision {\n\t\tdfa.precedenceDfa = true\n\t\tdfa.s0 = NewDFAState(-1, NewATNConfigSet(false))\n\t\tdfa.s0.isAcceptState = false\n\t\tdfa.s0.requiresFullContext = false\n\t}\n\treturn dfa\n}\n\n// getPrecedenceStartState gets the start state for the current precedence and\n// returns the start state corresponding to the specified precedence if a start\n// state exists for the specified precedence and nil otherwise. d must be a\n// precedence DFA. See also isPrecedenceDfa.\nfunc (d *DFA) getPrecedenceStartState(precedence int) *DFAState {\n\tif !d.getPrecedenceDfa() {\n\t\tpanic(\"only precedence DFAs may contain a precedence start state\")\n\t}\n\n\t// s0.edges is never nil for a precedence DFA\n\tif precedence < 0 || precedence >= len(d.getS0().getEdges()) {\n\t\treturn nil\n\t}\n\n\treturn d.getS0().getIthEdge(precedence)\n}\n\n// setPrecedenceStartState sets the start state for the current precedence. d\n// must be a precedence DFA. See also isPrecedenceDfa.\nfunc (d *DFA) setPrecedenceStartState(precedence int, startState *DFAState) {\n\tif !d.getPrecedenceDfa() {\n\t\tpanic(\"only precedence DFAs may contain a precedence start state\")\n\t}\n\n\tif precedence < 0 {\n\t\treturn\n\t}\n\n\t// Synchronization on s0 here is ok. When the DFA is turned into a\n\t// precedence DFA, s0 will be initialized once and not updated again. s0.edges\n\t// is never nil for a precedence DFA.\n\ts0 := d.getS0()\n\tif precedence >= s0.numEdges() {\n\t\tedges := append(s0.getEdges(), make([]*DFAState, precedence+1-s0.numEdges())...)\n\t\ts0.setEdges(edges)\n\t\td.setS0(s0)\n\t}\n\n\ts0.setIthEdge(precedence, startState)\n}\n\nfunc (d *DFA) getPrecedenceDfa() bool {\n\treturn d.precedenceDfa\n}\n\n// setPrecedenceDfa sets whether d is a precedence DFA. If precedenceDfa differs\n// from the current DFA configuration, then d.states is cleared, the initial\n// state s0 is set to a new DFAState with an empty outgoing DFAState.edges to\n// store the start states for individual precedence values if precedenceDfa is\n// true or nil otherwise, and d.precedenceDfa is updated.\nfunc (d *DFA) setPrecedenceDfa(precedenceDfa bool) {\n\tif d.getPrecedenceDfa() != precedenceDfa {\n\t\td.states = nil // Lazy initialize\n\t\td.numstates = 0\n\n\t\tif precedenceDfa {\n\t\t\tprecedenceState := NewDFAState(-1, NewATNConfigSet(false))\n\t\t\tprecedenceState.setEdges(make([]*DFAState, 0))\n\t\t\tprecedenceState.isAcceptState = false\n\t\t\tprecedenceState.requiresFullContext = false\n\t\t\td.setS0(precedenceState)\n\t\t} else {\n\t\t\td.setS0(nil)\n\t\t}\n\n\t\td.precedenceDfa = precedenceDfa\n\t}\n}\n\n// Len returns the number of states in d. We use this instead of accessing states directly so that we can implement lazy\n// instantiation of the states JMap.\nfunc (d *DFA) Len() int {\n\tif d.states == nil {\n\t\treturn 0\n\t}\n\treturn d.states.Len()\n}\n\n// Get returns a state that matches s if it is present in the DFA state set. We defer to this\n// function instead of accessing states directly so that we can implement lazy instantiation of the states JMap.\nfunc (d *DFA) Get(s *DFAState) (*DFAState, bool) {\n\tif d.states == nil {\n\t\treturn nil, false\n\t}\n\treturn d.states.Get(s)\n}\n\nfunc (d *DFA) Put(s *DFAState) (*DFAState, bool) {\n\tif d.states == nil {\n\t\td.states = NewJStore[*DFAState, *ObjEqComparator[*DFAState]](dfaStateEqInst, DFAStateCollection, \"DFA via DFA.Put\")\n\t}\n\treturn d.states.Put(s)\n}\n\nfunc (d *DFA) getS0() *DFAState {\n\treturn d.s0\n}\n\nfunc (d *DFA) setS0(s *DFAState) {\n\td.s0 = s\n}\n\n// sortedStates returns the states in d sorted by their state number, or an empty set if d.states is nil.\nfunc (d *DFA) sortedStates() []*DFAState {\n\tif d.states == nil {\n\t\treturn []*DFAState{}\n\t}\n\tvs := d.states.SortedSlice(func(i, j *DFAState) bool {\n\t\treturn i.stateNumber < j.stateNumber\n\t})\n\n\treturn vs\n}\n\nfunc (d *DFA) String(literalNames []string, symbolicNames []string) string {\n\tif d.getS0() == nil {\n\t\treturn \"\"\n\t}\n\n\treturn NewDFASerializer(d, literalNames, symbolicNames).String()\n}\n\nfunc (d *DFA) ToLexerString() string {\n\tif d.getS0() == nil {\n\t\treturn \"\"\n\t}\n\n\treturn NewLexerDFASerializer(d).String()\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// DFASerializer is a DFA walker that knows how to dump the DFA states to serialized\n// strings.\ntype DFASerializer struct {\n\tdfa           *DFA\n\tliteralNames  []string\n\tsymbolicNames []string\n}\n\nfunc NewDFASerializer(dfa *DFA, literalNames, symbolicNames []string) *DFASerializer {\n\tif literalNames == nil {\n\t\tliteralNames = make([]string, 0)\n\t}\n\n\tif symbolicNames == nil {\n\t\tsymbolicNames = make([]string, 0)\n\t}\n\n\treturn &DFASerializer{\n\t\tdfa:           dfa,\n\t\tliteralNames:  literalNames,\n\t\tsymbolicNames: symbolicNames,\n\t}\n}\n\nfunc (d *DFASerializer) String() string {\n\tif d.dfa.getS0() == nil {\n\t\treturn \"\"\n\t}\n\n\tbuf := \"\"\n\tstates := d.dfa.sortedStates()\n\n\tfor _, s := range states {\n\t\tif s.edges != nil {\n\t\t\tn := len(s.edges)\n\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tt := s.edges[j]\n\n\t\t\t\tif t != nil && t.stateNumber != 0x7FFFFFFF {\n\t\t\t\t\tbuf += d.GetStateString(s)\n\t\t\t\t\tbuf += \"-\"\n\t\t\t\t\tbuf += d.getEdgeLabel(j)\n\t\t\t\t\tbuf += \"->\"\n\t\t\t\t\tbuf += d.GetStateString(t)\n\t\t\t\t\tbuf += \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(buf) == 0 {\n\t\treturn \"\"\n\t}\n\n\treturn buf\n}\n\nfunc (d *DFASerializer) getEdgeLabel(i int) string {\n\tif i == 0 {\n\t\treturn \"EOF\"\n\t} else if d.literalNames != nil && i-1 < len(d.literalNames) {\n\t\treturn d.literalNames[i-1]\n\t} else if d.symbolicNames != nil && i-1 < len(d.symbolicNames) {\n\t\treturn d.symbolicNames[i-1]\n\t}\n\n\treturn strconv.Itoa(i - 1)\n}\n\nfunc (d *DFASerializer) GetStateString(s *DFAState) string {\n\tvar a, b string\n\n\tif s.isAcceptState {\n\t\ta = \":\"\n\t}\n\n\tif s.requiresFullContext {\n\t\tb = \"^\"\n\t}\n\n\tbaseStateStr := a + \"s\" + strconv.Itoa(s.stateNumber) + b\n\n\tif s.isAcceptState {\n\t\tif s.predicates != nil {\n\t\t\treturn baseStateStr + \"=>\" + fmt.Sprint(s.predicates)\n\t\t}\n\n\t\treturn baseStateStr + \"=>\" + fmt.Sprint(s.prediction)\n\t}\n\n\treturn baseStateStr\n}\n\ntype LexerDFASerializer struct {\n\t*DFASerializer\n}\n\nfunc NewLexerDFASerializer(dfa *DFA) *LexerDFASerializer {\n\treturn &LexerDFASerializer{DFASerializer: NewDFASerializer(dfa, nil, nil)}\n}\n\nfunc (l *LexerDFASerializer) getEdgeLabel(i int) string {\n\tvar sb strings.Builder\n\tsb.Grow(6)\n\tsb.WriteByte('\\'')\n\tsb.WriteRune(rune(i))\n\tsb.WriteByte('\\'')\n\treturn sb.String()\n}\n\nfunc (l *LexerDFASerializer) String() string {\n\tif l.dfa.getS0() == nil {\n\t\treturn \"\"\n\t}\n\n\tbuf := \"\"\n\tstates := l.dfa.sortedStates()\n\n\tfor i := 0; i < len(states); i++ {\n\t\ts := states[i]\n\n\t\tif s.edges != nil {\n\t\t\tn := len(s.edges)\n\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tt := s.edges[j]\n\n\t\t\t\tif t != nil && t.stateNumber != 0x7FFFFFFF {\n\t\t\t\t\tbuf += l.GetStateString(s)\n\t\t\t\t\tbuf += \"-\"\n\t\t\t\t\tbuf += l.getEdgeLabel(j)\n\t\t\t\t\tbuf += \"->\"\n\t\t\t\t\tbuf += l.GetStateString(t)\n\t\t\t\t\tbuf += \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(buf) == 0 {\n\t\treturn \"\"\n\t}\n\n\treturn buf\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/dfa_state.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n)\n\n// PredPrediction maps a predicate to a predicted alternative.\ntype PredPrediction struct {\n\talt  int\n\tpred SemanticContext\n}\n\nfunc NewPredPrediction(pred SemanticContext, alt int) *PredPrediction {\n\treturn &PredPrediction{alt: alt, pred: pred}\n}\n\nfunc (p *PredPrediction) String() string {\n\treturn \"(\" + fmt.Sprint(p.pred) + \", \" + fmt.Sprint(p.alt) + \")\"\n}\n\n// DFAState represents a set of possible [ATN] configurations. As Aho, Sethi,\n// Ullman p. 117 says: \"The DFA uses its state to keep track of all possible\n// states the ATN can be in after reading each input symbol. That is to say,\n// after reading input a1, a2,..an, the DFA is in a state that represents the\n// subset T of the states of the ATN that are reachable from the ATN's start\n// state along some path labeled a1a2..an.\"\n//\n// In conventional NFA-to-DFA conversion, therefore, the subset T would be a bitset representing the set of\n// states the [ATN] could be in. We need to track the alt predicted by each state\n// as well, however. More importantly, we need to maintain a stack of states,\n// tracking the closure operations as they jump from rule to rule, emulating\n// rule invocations (method calls). I have to add a stack to simulate the proper\n// lookahead sequences for the underlying LL grammar from which the ATN was\n// derived.\n//\n// I use a set of [ATNConfig] objects, not simple states. An [ATNConfig] is both a\n// state (ala normal conversion) and a [RuleContext] describing the chain of rules\n// (if any) followed to arrive at that state.\n//\n// A [DFAState] may have multiple references to a particular state, but with\n// different [ATN] contexts (with same or different alts) meaning that state was\n// reached via a different set of rule invocations.\ntype DFAState struct {\n\tstateNumber int\n\tconfigs     *ATNConfigSet\n\n\t// edges elements point to the target of the symbol. Shift up by 1 so (-1)\n\t// Token.EOF maps to the first element.\n\tedges []*DFAState\n\n\tisAcceptState bool\n\n\t// prediction is the 'ttype' we match or alt we predict if the state is 'accept'.\n\t// Set to ATN.INVALID_ALT_NUMBER when predicates != nil or\n\t// requiresFullContext.\n\tprediction int\n\n\tlexerActionExecutor *LexerActionExecutor\n\n\t// requiresFullContext indicates it was created during an SLL prediction that\n\t// discovered a conflict between the configurations in the state. Future\n\t// ParserATNSimulator.execATN invocations immediately jump doing\n\t// full context prediction if true.\n\trequiresFullContext bool\n\n\t// predicates is the predicates associated with the ATN configurations of the\n\t// DFA state during SLL parsing. When we have predicates, requiresFullContext\n\t// is false, since full context prediction evaluates predicates on-the-fly. If\n\t// d is\n\t// not nil, then prediction is ATN.INVALID_ALT_NUMBER.\n\t//\n\t// We only use these for non-requiresFullContext but conflicting states. That\n\t// means we know from the context (it's $ or we don't dip into outer context)\n\t// that it's an ambiguity not a conflict.\n\t//\n\t// This list is computed by\n\t// ParserATNSimulator.predicateDFAState.\n\tpredicates []*PredPrediction\n}\n\nfunc NewDFAState(stateNumber int, configs *ATNConfigSet) *DFAState {\n\tif configs == nil {\n\t\tconfigs = NewATNConfigSet(false)\n\t}\n\n\treturn &DFAState{configs: configs, stateNumber: stateNumber}\n}\n\n// GetAltSet gets the set of all alts mentioned by all ATN configurations in d.\nfunc (d *DFAState) GetAltSet() []int {\n\tvar alts []int\n\n\tif d.configs != nil {\n\t\tfor _, c := range d.configs.configs {\n\t\t\talts = append(alts, c.GetAlt())\n\t\t}\n\t}\n\n\tif len(alts) == 0 {\n\t\treturn nil\n\t}\n\n\treturn alts\n}\n\nfunc (d *DFAState) getEdges() []*DFAState {\n\treturn d.edges\n}\n\nfunc (d *DFAState) numEdges() int {\n\treturn len(d.edges)\n}\n\nfunc (d *DFAState) getIthEdge(i int) *DFAState {\n\treturn d.edges[i]\n}\n\nfunc (d *DFAState) setEdges(newEdges []*DFAState) {\n\td.edges = newEdges\n}\n\nfunc (d *DFAState) setIthEdge(i int, edge *DFAState) {\n\td.edges[i] = edge\n}\n\nfunc (d *DFAState) setPrediction(v int) {\n\td.prediction = v\n}\n\nfunc (d *DFAState) String() string {\n\tvar s string\n\tif d.isAcceptState {\n\t\tif d.predicates != nil {\n\t\t\ts = \"=>\" + fmt.Sprint(d.predicates)\n\t\t} else {\n\t\t\ts = \"=>\" + fmt.Sprint(d.prediction)\n\t\t}\n\t}\n\n\treturn fmt.Sprintf(\"%d:%s%s\", d.stateNumber, fmt.Sprint(d.configs), s)\n}\n\nfunc (d *DFAState) Hash() int {\n\th := murmurInit(7)\n\th = murmurUpdate(h, d.configs.Hash())\n\treturn murmurFinish(h, 1)\n}\n\n// Equals returns whether d equals other. Two DFAStates are equal if their ATN\n// configuration sets are the same. This method is used to see if a state\n// already exists.\n//\n// Because the number of alternatives and number of ATN configurations are\n// finite, there is a finite number of DFA states that can be processed. This is\n// necessary to show that the algorithm terminates.\n//\n// Cannot test the DFA state numbers here because in\n// ParserATNSimulator.addDFAState we need to know if any other state exists that\n// has d exact set of ATN configurations. The stateNumber is irrelevant.\nfunc (d *DFAState) Equals(o Collectable[*DFAState]) bool {\n\tif d == o {\n\t\treturn true\n\t}\n\n\treturn d.configs.Equals(o.(*DFAState).configs)\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"strconv\"\n)\n\n//\n// This implementation of {@link ANTLRErrorListener} can be used to identify\n// certain potential correctness and performance problems in grammars. \"reports\"\n// are made by calling {@link Parser//NotifyErrorListeners} with the appropriate\n// message.\n//\n// <ul>\n// <li><b>Ambiguities</b>: These are cases where more than one path through the\n// grammar can Match the input.</li>\n// <li><b>Weak context sensitivity</b>: These are cases where full-context\n// prediction resolved an SLL conflict to a unique alternative which equaled the\n// minimum alternative of the SLL conflict.</li>\n// <li><b>Strong (forced) context sensitivity</b>: These are cases where the\n// full-context prediction resolved an SLL conflict to a unique alternative,\n// <em>and</em> the minimum alternative of the SLL conflict was found to not be\n// a truly viable alternative. Two-stage parsing cannot be used for inputs where\n// d situation occurs.</li>\n// </ul>\n\ntype DiagnosticErrorListener struct {\n\t*DefaultErrorListener\n\n\texactOnly bool\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewDiagnosticErrorListener(exactOnly bool) *DiagnosticErrorListener {\n\n\tn := new(DiagnosticErrorListener)\n\n\t// whether all ambiguities or only exact ambiguities are Reported.\n\tn.exactOnly = exactOnly\n\treturn n\n}\n\nfunc (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) {\n\tif d.exactOnly && !exact {\n\t\treturn\n\t}\n\tmsg := \"reportAmbiguity d=\" +\n\t\td.getDecisionDescription(recognizer, dfa) +\n\t\t\": ambigAlts=\" +\n\t\td.getConflictingAlts(ambigAlts, configs).String() +\n\t\t\", input='\" +\n\t\trecognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + \"'\"\n\trecognizer.NotifyErrorListeners(msg, nil, nil)\n}\n\nfunc (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, _ *BitSet, _ *ATNConfigSet) {\n\n\tmsg := \"reportAttemptingFullContext d=\" +\n\t\td.getDecisionDescription(recognizer, dfa) +\n\t\t\", input='\" +\n\t\trecognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + \"'\"\n\trecognizer.NotifyErrorListeners(msg, nil, nil)\n}\n\nfunc (d *DiagnosticErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, _ int, _ *ATNConfigSet) {\n\tmsg := \"reportContextSensitivity d=\" +\n\t\td.getDecisionDescription(recognizer, dfa) +\n\t\t\", input='\" +\n\t\trecognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + \"'\"\n\trecognizer.NotifyErrorListeners(msg, nil, nil)\n}\n\nfunc (d *DiagnosticErrorListener) getDecisionDescription(recognizer Parser, dfa *DFA) string {\n\tdecision := dfa.decision\n\truleIndex := dfa.atnStartState.GetRuleIndex()\n\n\truleNames := recognizer.GetRuleNames()\n\tif ruleIndex < 0 || ruleIndex >= len(ruleNames) {\n\t\treturn strconv.Itoa(decision)\n\t}\n\truleName := ruleNames[ruleIndex]\n\tif ruleName == \"\" {\n\t\treturn strconv.Itoa(decision)\n\t}\n\treturn strconv.Itoa(decision) + \" (\" + ruleName + \")\"\n}\n\n// Computes the set of conflicting or ambiguous alternatives from a\n// configuration set, if that information was not already provided by the\n// parser.\n//\n// @param ReportedAlts The set of conflicting or ambiguous alternatives, as\n// Reported by the parser.\n// @param configs The conflicting or ambiguous configuration set.\n// @return Returns {@code ReportedAlts} if it is not {@code nil}, otherwise\n// returns the set of alternatives represented in {@code configs}.\nfunc (d *DiagnosticErrorListener) getConflictingAlts(ReportedAlts *BitSet, set *ATNConfigSet) *BitSet {\n\tif ReportedAlts != nil {\n\t\treturn ReportedAlts\n\t}\n\tresult := NewBitSet()\n\tfor _, c := range set.configs {\n\t\tresult.add(c.GetAlt())\n\t}\n\n\treturn result\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/error_listener.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// Provides an empty default implementation of {@link ANTLRErrorListener}. The\n// default implementation of each method does nothing, but can be overridden as\n// necessary.\n\ntype ErrorListener interface {\n\tSyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException)\n\tReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet)\n\tReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet)\n\tReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet)\n}\n\ntype DefaultErrorListener struct {\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewDefaultErrorListener() *DefaultErrorListener {\n\treturn new(DefaultErrorListener)\n}\n\nfunc (d *DefaultErrorListener) SyntaxError(_ Recognizer, _ interface{}, _, _ int, _ string, _ RecognitionException) {\n}\n\nfunc (d *DefaultErrorListener) ReportAmbiguity(_ Parser, _ *DFA, _, _ int, _ bool, _ *BitSet, _ *ATNConfigSet) {\n}\n\nfunc (d *DefaultErrorListener) ReportAttemptingFullContext(_ Parser, _ *DFA, _, _ int, _ *BitSet, _ *ATNConfigSet) {\n}\n\nfunc (d *DefaultErrorListener) ReportContextSensitivity(_ Parser, _ *DFA, _, _, _ int, _ *ATNConfigSet) {\n}\n\ntype ConsoleErrorListener struct {\n\t*DefaultErrorListener\n}\n\nfunc NewConsoleErrorListener() *ConsoleErrorListener {\n\treturn new(ConsoleErrorListener)\n}\n\n// ConsoleErrorListenerINSTANCE provides a default instance of {@link ConsoleErrorListener}.\nvar ConsoleErrorListenerINSTANCE = NewConsoleErrorListener()\n\n// SyntaxError prints messages to System.err containing the\n// values of line, charPositionInLine, and msg using\n// the following format:\n//\n//\tline <line>:<charPositionInLine> <msg>\nfunc (c *ConsoleErrorListener) SyntaxError(_ Recognizer, _ interface{}, line, column int, msg string, _ RecognitionException) {\n\t_, _ = fmt.Fprintln(os.Stderr, \"line \"+strconv.Itoa(line)+\":\"+strconv.Itoa(column)+\" \"+msg)\n}\n\ntype ProxyErrorListener struct {\n\t*DefaultErrorListener\n\tdelegates []ErrorListener\n}\n\nfunc NewProxyErrorListener(delegates []ErrorListener) *ProxyErrorListener {\n\tif delegates == nil {\n\t\tpanic(\"delegates is not provided\")\n\t}\n\tl := new(ProxyErrorListener)\n\tl.delegates = delegates\n\treturn l\n}\n\nfunc (p *ProxyErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {\n\tfor _, d := range p.delegates {\n\t\td.SyntaxError(recognizer, offendingSymbol, line, column, msg, e)\n\t}\n}\n\nfunc (p *ProxyErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) {\n\tfor _, d := range p.delegates {\n\t\td.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs)\n\t}\n}\n\nfunc (p *ProxyErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet) {\n\tfor _, d := range p.delegates {\n\t\td.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs)\n\t}\n}\n\nfunc (p *ProxyErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet) {\n\tfor _, d := range p.delegates {\n\t\td.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/error_strategy.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype ErrorStrategy interface {\n\treset(Parser)\n\tRecoverInline(Parser) Token\n\tRecover(Parser, RecognitionException)\n\tSync(Parser)\n\tInErrorRecoveryMode(Parser) bool\n\tReportError(Parser, RecognitionException)\n\tReportMatch(Parser)\n}\n\n// DefaultErrorStrategy is the default implementation of ANTLRErrorStrategy used for\n// error reporting and recovery in ANTLR parsers.\ntype DefaultErrorStrategy struct {\n\terrorRecoveryMode bool\n\tlastErrorIndex    int\n\tlastErrorStates   *IntervalSet\n}\n\nvar _ ErrorStrategy = &DefaultErrorStrategy{}\n\nfunc NewDefaultErrorStrategy() *DefaultErrorStrategy {\n\n\td := new(DefaultErrorStrategy)\n\n\t// Indicates whether the error strategy is currently \"recovering from an\n\t// error\". This is used to suppress Reporting multiple error messages while\n\t// attempting to recover from a detected syntax error.\n\t//\n\t// @see //InErrorRecoveryMode\n\t//\n\td.errorRecoveryMode = false\n\n\t// The index into the input stream where the last error occurred.\n\t// This is used to prevent infinite loops where an error is found\n\t// but no token is consumed during recovery...another error is found,\n\t// ad nauseam. This is a failsafe mechanism to guarantee that at least\n\t// one token/tree node is consumed for two errors.\n\t//\n\td.lastErrorIndex = -1\n\td.lastErrorStates = nil\n\treturn d\n}\n\n// <p>The default implementation simply calls {@link //endErrorCondition} to\n// ensure that the handler is not in error recovery mode.</p>\nfunc (d *DefaultErrorStrategy) reset(recognizer Parser) {\n\td.endErrorCondition(recognizer)\n}\n\n// This method is called to enter error recovery mode when a recognition\n// exception is Reported.\nfunc (d *DefaultErrorStrategy) beginErrorCondition(_ Parser) {\n\td.errorRecoveryMode = true\n}\n\nfunc (d *DefaultErrorStrategy) InErrorRecoveryMode(_ Parser) bool {\n\treturn d.errorRecoveryMode\n}\n\n// This method is called to leave error recovery mode after recovering from\n// a recognition exception.\nfunc (d *DefaultErrorStrategy) endErrorCondition(_ Parser) {\n\td.errorRecoveryMode = false\n\td.lastErrorStates = nil\n\td.lastErrorIndex = -1\n}\n\n// ReportMatch is the default implementation of error matching and simply calls endErrorCondition.\nfunc (d *DefaultErrorStrategy) ReportMatch(recognizer Parser) {\n\td.endErrorCondition(recognizer)\n}\n\n// ReportError is the default implementation of error reporting.\n// It returns immediately if the handler is already\n// in error recovery mode. Otherwise, it calls [beginErrorCondition]\n// and dispatches the Reporting task based on the runtime type of e\n// according to the following table.\n//\n//\t\t [NoViableAltException]     : Dispatches the call to [ReportNoViableAlternative]\n//\t\t [InputMisMatchException]   : Dispatches the call to [ReportInputMisMatch]\n//\t  [FailedPredicateException] : Dispatches the call to [ReportFailedPredicate]\n//\t  All other types            : Calls [NotifyErrorListeners] to Report the exception\nfunc (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionException) {\n\t// if we've already Reported an error and have not Matched a token\n\t// yet successfully, don't Report any errors.\n\tif d.InErrorRecoveryMode(recognizer) {\n\t\treturn // don't Report spurious errors\n\t}\n\td.beginErrorCondition(recognizer)\n\n\tswitch t := e.(type) {\n\tdefault:\n\t\tfmt.Println(\"unknown recognition error type: \" + reflect.TypeOf(e).Name())\n\t\t//            fmt.Println(e.stack)\n\t\trecognizer.NotifyErrorListeners(e.GetMessage(), e.GetOffendingToken(), e)\n\tcase *NoViableAltException:\n\t\td.ReportNoViableAlternative(recognizer, t)\n\tcase *InputMisMatchException:\n\t\td.ReportInputMisMatch(recognizer, t)\n\tcase *FailedPredicateException:\n\t\td.ReportFailedPredicate(recognizer, t)\n\t}\n}\n\n// Recover is the default recovery implementation.\n// It reSynchronizes the parser by consuming tokens until we find one in the reSynchronization set -\n// loosely the set of tokens that can follow the current rule.\nfunc (d *DefaultErrorStrategy) Recover(recognizer Parser, _ RecognitionException) {\n\n\tif d.lastErrorIndex == recognizer.GetInputStream().Index() &&\n\t\td.lastErrorStates != nil && d.lastErrorStates.contains(recognizer.GetState()) {\n\t\t// uh oh, another error at same token index and previously-Visited\n\t\t// state in ATN must be a case where LT(1) is in the recovery\n\t\t// token set so nothing got consumed. Consume a single token\n\t\t// at least to prevent an infinite loop d is a failsafe.\n\t\trecognizer.Consume()\n\t}\n\td.lastErrorIndex = recognizer.GetInputStream().Index()\n\tif d.lastErrorStates == nil {\n\t\td.lastErrorStates = NewIntervalSet()\n\t}\n\td.lastErrorStates.addOne(recognizer.GetState())\n\tfollowSet := d.GetErrorRecoverySet(recognizer)\n\td.consumeUntil(recognizer, followSet)\n}\n\n// Sync is the default implementation of error strategy synchronization.\n//\n// This Sync makes sure that the current lookahead symbol is consistent with what were expecting\n// at this point in the [ATN]. You can call this anytime but ANTLR only\n// generates code to check before sub-rules/loops and each iteration.\n//\n// Implements [Jim Idle]'s magic Sync mechanism in closures and optional\n// sub-rules. E.g.:\n//\n//\ta    : Sync ( stuff Sync )*\n//\tSync : {consume to what can follow Sync}\n//\n// At the start of a sub-rule upon error, Sync performs single\n// token deletion, if possible. If it can't do that, it bails on the current\n// rule and uses the default error recovery, which consumes until the\n// reSynchronization set of the current rule.\n//\n// If the sub-rule is optional\n//\n//\t({@code (...)?}, {@code (...)*},\n//\n// or a block with an empty alternative), then the expected set includes what follows\n// the sub-rule.\n//\n// During loop iteration, it consumes until it sees a token that can start a\n// sub-rule or what follows loop. Yes, that is pretty aggressive. We opt to\n// stay in the loop as long as possible.\n//\n// # Origins\n//\n// Previous versions of ANTLR did a poor job of their recovery within loops.\n// A single mismatch token or missing token would force the parser to bail\n// out of the entire rules surrounding the loop. So, for rule:\n//\n//\tclassfunc : 'class' ID '{' member* '}'\n//\n// input with an extra token between members would force the parser to\n// consume until it found the next class definition rather than the next\n// member definition of the current class.\n//\n// This functionality cost a bit of effort because the parser has to\n// compare the token set at the start of the loop and at each iteration. If for\n// some reason speed is suffering for you, you can turn off this\n// functionality by simply overriding this method as empty:\n//\n//\t{ }\n//\n// [Jim Idle]: https://github.com/jimidle\nfunc (d *DefaultErrorStrategy) Sync(recognizer Parser) {\n\t// If already recovering, don't try to Sync\n\tif d.InErrorRecoveryMode(recognizer) {\n\t\treturn\n\t}\n\n\ts := recognizer.GetInterpreter().atn.states[recognizer.GetState()]\n\tla := recognizer.GetTokenStream().LA(1)\n\n\t// try cheaper subset first might get lucky. seems to shave a wee bit off\n\tnextTokens := recognizer.GetATN().NextTokens(s, nil)\n\tif nextTokens.contains(TokenEpsilon) || nextTokens.contains(la) {\n\t\treturn\n\t}\n\n\tswitch s.GetStateType() {\n\tcase ATNStateBlockStart, ATNStateStarBlockStart, ATNStatePlusBlockStart, ATNStateStarLoopEntry:\n\t\t// Report error and recover if possible\n\t\tif d.SingleTokenDeletion(recognizer) != nil {\n\t\t\treturn\n\t\t}\n\t\trecognizer.SetError(NewInputMisMatchException(recognizer))\n\tcase ATNStatePlusLoopBack, ATNStateStarLoopBack:\n\t\td.ReportUnwantedToken(recognizer)\n\t\texpecting := NewIntervalSet()\n\t\texpecting.addSet(recognizer.GetExpectedTokens())\n\t\twhatFollowsLoopIterationOrRule := expecting.addSet(d.GetErrorRecoverySet(recognizer))\n\t\td.consumeUntil(recognizer, whatFollowsLoopIterationOrRule)\n\tdefault:\n\t\t// do nothing if we can't identify the exact kind of ATN state\n\t}\n}\n\n// ReportNoViableAlternative is called by [ReportError] when the exception is a [NoViableAltException].\n//\n// See also [ReportError]\nfunc (d *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e *NoViableAltException) {\n\ttokens := recognizer.GetTokenStream()\n\tvar input string\n\tif tokens != nil {\n\t\tif e.startToken.GetTokenType() == TokenEOF {\n\t\t\tinput = \"<EOF>\"\n\t\t} else {\n\t\t\tinput = tokens.GetTextFromTokens(e.startToken, e.offendingToken)\n\t\t}\n\t} else {\n\t\tinput = \"<unknown input>\"\n\t}\n\tmsg := \"no viable alternative at input \" + d.escapeWSAndQuote(input)\n\trecognizer.NotifyErrorListeners(msg, e.offendingToken, e)\n}\n\n// ReportInputMisMatch is called by [ReportError] when the exception is an [InputMisMatchException]\n//\n// See also: [ReportError]\nfunc (d *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) {\n\tmsg := \"mismatched input \" + d.GetTokenErrorDisplay(e.offendingToken) +\n\t\t\" expecting \" + e.getExpectedTokens().StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)\n\trecognizer.NotifyErrorListeners(msg, e.offendingToken, e)\n}\n\n// ReportFailedPredicate is called by [ReportError] when the exception is a [FailedPredicateException].\n//\n// See also: [ReportError]\nfunc (d *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *FailedPredicateException) {\n\truleName := recognizer.GetRuleNames()[recognizer.GetParserRuleContext().GetRuleIndex()]\n\tmsg := \"rule \" + ruleName + \" \" + e.message\n\trecognizer.NotifyErrorListeners(msg, e.offendingToken, e)\n}\n\n// ReportUnwantedToken is called to report a syntax error that requires the removal\n// of a token from the input stream. At the time d method is called, the\n// erroneous symbol is the current LT(1) symbol and has not yet been\n// removed from the input stream. When this method returns,\n// recognizer is in error recovery mode.\n//\n// This method is called when singleTokenDeletion identifies\n// single-token deletion as a viable recovery strategy for a mismatched\n// input error.\n//\n// The default implementation simply returns if the handler is already in\n// error recovery mode. Otherwise, it calls beginErrorCondition to\n// enter error recovery mode, followed by calling\n// [NotifyErrorListeners]\nfunc (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) {\n\tif d.InErrorRecoveryMode(recognizer) {\n\t\treturn\n\t}\n\td.beginErrorCondition(recognizer)\n\tt := recognizer.GetCurrentToken()\n\ttokenName := d.GetTokenErrorDisplay(t)\n\texpecting := d.GetExpectedTokens(recognizer)\n\tmsg := \"extraneous input \" + tokenName + \" expecting \" +\n\t\texpecting.StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)\n\trecognizer.NotifyErrorListeners(msg, t, nil)\n}\n\n// ReportMissingToken is called to report a syntax error which requires the\n// insertion of a missing token into the input stream. At the time this\n// method is called, the missing token has not yet been inserted. When this\n// method returns, recognizer is in error recovery mode.\n//\n// This method is called when singleTokenInsertion identifies\n// single-token insertion as a viable recovery strategy for a mismatched\n// input error.\n//\n// The default implementation simply returns if the handler is already in\n// error recovery mode. Otherwise, it calls beginErrorCondition to\n// enter error recovery mode, followed by calling [NotifyErrorListeners]\nfunc (d *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) {\n\tif d.InErrorRecoveryMode(recognizer) {\n\t\treturn\n\t}\n\td.beginErrorCondition(recognizer)\n\tt := recognizer.GetCurrentToken()\n\texpecting := d.GetExpectedTokens(recognizer)\n\tmsg := \"missing \" + expecting.StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false) +\n\t\t\" at \" + d.GetTokenErrorDisplay(t)\n\trecognizer.NotifyErrorListeners(msg, t, nil)\n}\n\n// The RecoverInline default implementation attempts to recover from the mismatched input\n// by using single token insertion and deletion as described below. If the\n// recovery attempt fails, this method panics with [InputMisMatchException}.\n// TODO: Not sure that panic() is the right thing to do here - JI\n//\n// # EXTRA TOKEN (single token deletion)\n//\n// LA(1) is not what we are looking for. If LA(2) has the\n// right token, however, then assume LA(1) is some extra spurious\n// token and delete it. Then consume and return the next token (which was\n// the LA(2) token) as the successful result of the Match operation.\n//\n// # This recovery strategy is implemented by singleTokenDeletion\n//\n// # MISSING TOKEN (single token insertion)\n//\n// If current token  -at LA(1) - is consistent with what could come\n// after the expected LA(1) token, then assume the token is missing\n// and use the parser's [TokenFactory] to create it on the fly. The\n// “insertion” is performed by returning the created token as the successful\n// result of the Match operation.\n//\n// This recovery strategy is implemented by [SingleTokenInsertion].\n//\n// # Example\n//\n// For example, Input i=(3 is clearly missing the ')'. When\n// the parser returns from the nested call to expr, it will have\n// call the chain:\n//\n//\tstat → expr → atom\n//\n// and it will be trying to Match the ')' at this point in the\n// derivation:\n//\n//\t  : ID '=' '(' INT ')' ('+' atom)* ';'\n//\t\t                ^\n//\n// The attempt to [Match] ')' will fail when it sees ';' and\n// call [RecoverInline]. To recover, it sees that LA(1)==';'\n// is in the set of tokens that can follow the ')' token reference\n// in rule atom. It can assume that you forgot the ')'.\nfunc (d *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {\n\t// SINGLE TOKEN DELETION\n\tMatchedSymbol := d.SingleTokenDeletion(recognizer)\n\tif MatchedSymbol != nil {\n\t\t// we have deleted the extra token.\n\t\t// now, move past ttype token as if all were ok\n\t\trecognizer.Consume()\n\t\treturn MatchedSymbol\n\t}\n\t// SINGLE TOKEN INSERTION\n\tif d.SingleTokenInsertion(recognizer) {\n\t\treturn d.GetMissingSymbol(recognizer)\n\t}\n\t// even that didn't work must panic the exception\n\trecognizer.SetError(NewInputMisMatchException(recognizer))\n\treturn nil\n}\n\n// SingleTokenInsertion implements the single-token insertion inline error recovery\n// strategy. It is called by [RecoverInline] if the single-token\n// deletion strategy fails to recover from the mismatched input. If this\n// method returns {@code true}, {@code recognizer} will be in error recovery\n// mode.\n//\n// This method determines whether single-token insertion is viable by\n// checking if the LA(1) input symbol could be successfully Matched\n// if it were instead the LA(2) symbol. If this method returns\n// {@code true}, the caller is responsible for creating and inserting a\n// token with the correct type to produce this behavior.</p>\n//\n// This func returns true if single-token insertion is a viable recovery\n// strategy for the current mismatched input.\nfunc (d *DefaultErrorStrategy) SingleTokenInsertion(recognizer Parser) bool {\n\tcurrentSymbolType := recognizer.GetTokenStream().LA(1)\n\t// if current token is consistent with what could come after current\n\t// ATN state, then we know we're missing a token error recovery\n\t// is free to conjure up and insert the missing token\n\tatn := recognizer.GetInterpreter().atn\n\tcurrentState := atn.states[recognizer.GetState()]\n\tnext := currentState.GetTransitions()[0].getTarget()\n\texpectingAtLL2 := atn.NextTokens(next, recognizer.GetParserRuleContext())\n\tif expectingAtLL2.contains(currentSymbolType) {\n\t\td.ReportMissingToken(recognizer)\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// SingleTokenDeletion implements the single-token deletion inline error recovery\n// strategy. It is called by [RecoverInline] to attempt to recover\n// from mismatched input. If this method returns nil, the parser and error\n// handler state will not have changed. If this method returns non-nil,\n// recognizer will not be in error recovery mode since the\n// returned token was a successful Match.\n//\n// If the single-token deletion is successful, this method calls\n// [ReportUnwantedToken] to Report the error, followed by\n// [Consume] to actually “delete” the extraneous token. Then,\n// before returning, [ReportMatch] is called to signal a successful\n// Match.\n//\n// The func returns the successfully Matched [Token] instance if single-token\n// deletion successfully recovers from the mismatched input, otherwise nil.\nfunc (d *DefaultErrorStrategy) SingleTokenDeletion(recognizer Parser) Token {\n\tNextTokenType := recognizer.GetTokenStream().LA(2)\n\texpecting := d.GetExpectedTokens(recognizer)\n\tif expecting.contains(NextTokenType) {\n\t\td.ReportUnwantedToken(recognizer)\n\t\t// print(\"recoverFromMisMatchedToken deleting \" \\\n\t\t// + str(recognizer.GetTokenStream().LT(1)) \\\n\t\t// + \" since \" + str(recognizer.GetTokenStream().LT(2)) \\\n\t\t// + \" is what we want\", file=sys.stderr)\n\t\trecognizer.Consume() // simply delete extra token\n\t\t// we want to return the token we're actually Matching\n\t\tMatchedSymbol := recognizer.GetCurrentToken()\n\t\td.ReportMatch(recognizer) // we know current token is correct\n\t\treturn MatchedSymbol\n\t}\n\n\treturn nil\n}\n\n// GetMissingSymbol conjures up a missing token during error recovery.\n//\n// The recognizer attempts to recover from single missing\n// symbols. But, actions might refer to that missing symbol.\n// For example:\n//\n//\tx=ID {f($x)}.\n//\n// The action clearly assumes\n// that there has been an identifier Matched previously and that\n// $x points at that token. If that token is missing, but\n// the next token in the stream is what we want we assume that\n// this token is missing, and we keep going. Because we\n// have to return some token to replace the missing token,\n// we have to conjure one up. This method gives the user control\n// over the tokens returned for missing tokens. Mostly,\n// you will want to create something special for identifier\n// tokens. For literals such as '{' and ',', the default\n// action in the parser or tree parser works. It simply creates\n// a [CommonToken] of the appropriate type. The text will be the token name.\n// If you need to change which tokens must be created by the lexer,\n// override this method to create the appropriate tokens.\nfunc (d *DefaultErrorStrategy) GetMissingSymbol(recognizer Parser) Token {\n\tcurrentSymbol := recognizer.GetCurrentToken()\n\texpecting := d.GetExpectedTokens(recognizer)\n\texpectedTokenType := expecting.first()\n\tvar tokenText string\n\n\tif expectedTokenType == TokenEOF {\n\t\ttokenText = \"<missing EOF>\"\n\t} else {\n\t\tln := recognizer.GetLiteralNames()\n\t\tif expectedTokenType > 0 && expectedTokenType < len(ln) {\n\t\t\ttokenText = \"<missing \" + recognizer.GetLiteralNames()[expectedTokenType] + \">\"\n\t\t} else {\n\t\t\ttokenText = \"<missing undefined>\" // TODO: matches the JS impl\n\t\t}\n\t}\n\tcurrent := currentSymbol\n\tlookback := recognizer.GetTokenStream().LT(-1)\n\tif current.GetTokenType() == TokenEOF && lookback != nil {\n\t\tcurrent = lookback\n\t}\n\n\ttf := recognizer.GetTokenFactory()\n\n\treturn tf.Create(current.GetSource(), expectedTokenType, tokenText, TokenDefaultChannel, -1, -1, current.GetLine(), current.GetColumn())\n}\n\nfunc (d *DefaultErrorStrategy) GetExpectedTokens(recognizer Parser) *IntervalSet {\n\treturn recognizer.GetExpectedTokens()\n}\n\n// GetTokenErrorDisplay determines how  a token should be displayed in an error message.\n// The default is to display just the text, but during development you might\n// want to have a lot of information spit out. Override this func in that case\n// to use t.String() (which, for [CommonToken], dumps everything about\n// the token). This is better than forcing you to override a method in\n// your token objects because you don't have to go modify your lexer\n// so that it creates a new type.\nfunc (d *DefaultErrorStrategy) GetTokenErrorDisplay(t Token) string {\n\tif t == nil {\n\t\treturn \"<no token>\"\n\t}\n\ts := t.GetText()\n\tif s == \"\" {\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\ts = \"<EOF>\"\n\t\t} else {\n\t\t\ts = \"<\" + strconv.Itoa(t.GetTokenType()) + \">\"\n\t\t}\n\t}\n\treturn d.escapeWSAndQuote(s)\n}\n\nfunc (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string {\n\ts = strings.Replace(s, \"\\t\", \"\\\\t\", -1)\n\ts = strings.Replace(s, \"\\n\", \"\\\\n\", -1)\n\ts = strings.Replace(s, \"\\r\", \"\\\\r\", -1)\n\treturn \"'\" + s + \"'\"\n}\n\n// GetErrorRecoverySet computes the error recovery set for the current rule. During\n// rule invocation, the parser pushes the set of tokens that can\n// follow that rule reference on the stack. This amounts to\n// computing FIRST of what follows the rule reference in the\n// enclosing rule. See LinearApproximator.FIRST().\n//\n// This local follow set only includes tokens\n// from within the rule i.e., the FIRST computation done by\n// ANTLR stops at the end of a rule.\n//\n// # Example\n//\n// When you find a \"no viable alt exception\", the input is not\n// consistent with any of the alternatives for rule r. The best\n// thing to do is to consume tokens until you see something that\n// can legally follow a call to r or any rule that called r.\n// You don't want the exact set of viable next tokens because the\n// input might just be missing a token--you might consume the\n// rest of the input looking for one of the missing tokens.\n//\n// Consider the grammar:\n//\n//\t\ta : '[' b ']'\n//\t\t  | '(' b ')'\n//\t\t  ;\n//\n//\t\tb : c '^' INT\n//\t      ;\n//\n//\t\tc : ID\n//\t\t  | INT\n//\t\t  ;\n//\n// At each rule invocation, the set of tokens that could follow\n// that rule is pushed on a stack. Here are the various\n// context-sensitive follow sets:\n//\n//\tFOLLOW(b1_in_a) = FIRST(']') = ']'\n//\tFOLLOW(b2_in_a) = FIRST(')') = ')'\n//\tFOLLOW(c_in_b)  = FIRST('^') = '^'\n//\n// Upon erroneous input “[]”, the call chain is\n//\n//\ta → b → c\n//\n// and, hence, the follow context stack is:\n//\n//\tDepth Follow set   Start of rule execution\n//\t  0   <EOF>        a (from main())\n//\t  1   ']'          b\n//\t  2   '^'          c\n//\n// Notice that ')' is not included, because b would have to have\n// been called from a different context in rule a for ')' to be\n// included.\n//\n// For error recovery, we cannot consider FOLLOW(c)\n// (context-sensitive or otherwise). We need the combined set of\n// all context-sensitive FOLLOW sets - the set of all tokens that\n// could follow any reference in the call chain. We need to\n// reSync to one of those tokens. Note that FOLLOW(c)='^' and if\n// we reSync'd to that token, we'd consume until EOF. We need to\n// Sync to context-sensitive FOLLOWs for a, b, and c:\n//\n//\t{']','^'}\n//\n// In this case, for input \"[]\", LA(1) is ']' and in the set, so we would\n// not consume anything. After printing an error, rule c would\n// return normally. Rule b would not find the required '^' though.\n// At this point, it gets a mismatched token error and panics an\n// exception (since LA(1) is not in the viable following token\n// set). The rule exception handler tries to recover, but finds\n// the same recovery set and doesn't consume anything. Rule b\n// exits normally returning to rule a. Now it finds the ']' (and\n// with the successful Match exits errorRecovery mode).\n//\n// So, you can see that the parser walks up the call chain looking\n// for the token that was a member of the recovery set.\n//\n// Errors are not generated in errorRecovery mode.\n//\n// ANTLR's error recovery mechanism is based upon original ideas:\n//\n// [Algorithms + Data Structures = Programs] by Niklaus Wirth and\n// [A note on error recovery in recursive descent parsers].\n//\n// Later, Josef Grosch had some good ideas in [Efficient and Comfortable Error Recovery in Recursive Descent\n// Parsers]\n//\n// Like Grosch I implement context-sensitive FOLLOW sets that are combined  at run-time upon error to avoid overhead\n// during parsing. Later, the runtime Sync was improved for loops/sub-rules see [Sync] docs\n//\n// [A note on error recovery in recursive descent parsers]: http://portal.acm.org/citation.cfm?id=947902.947905\n// [Algorithms + Data Structures = Programs]: https://t.ly/5QzgE\n// [Efficient and Comfortable Error Recovery in Recursive Descent Parsers]: ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip\nfunc (d *DefaultErrorStrategy) GetErrorRecoverySet(recognizer Parser) *IntervalSet {\n\tatn := recognizer.GetInterpreter().atn\n\tctx := recognizer.GetParserRuleContext()\n\trecoverSet := NewIntervalSet()\n\tfor ctx != nil && ctx.GetInvokingState() >= 0 {\n\t\t// compute what follows who invoked us\n\t\tinvokingState := atn.states[ctx.GetInvokingState()]\n\t\trt := invokingState.GetTransitions()[0]\n\t\tfollow := atn.NextTokens(rt.(*RuleTransition).followState, nil)\n\t\trecoverSet.addSet(follow)\n\t\tctx = ctx.GetParent().(ParserRuleContext)\n\t}\n\trecoverSet.removeOne(TokenEpsilon)\n\treturn recoverSet\n}\n\n// Consume tokens until one Matches the given token set.//\nfunc (d *DefaultErrorStrategy) consumeUntil(recognizer Parser, set *IntervalSet) {\n\tttype := recognizer.GetTokenStream().LA(1)\n\tfor ttype != TokenEOF && !set.contains(ttype) {\n\t\trecognizer.Consume()\n\t\tttype = recognizer.GetTokenStream().LA(1)\n\t}\n}\n\n// The BailErrorStrategy implementation of ANTLRErrorStrategy responds to syntax errors\n// by immediately canceling the parse operation with a\n// [ParseCancellationException]. The implementation ensures that the\n// [ParserRuleContext//exception] field is set for all parse tree nodes\n// that were not completed prior to encountering the error.\n//\n// This error strategy is useful in the following scenarios.\n//\n//   - Two-stage parsing: This error strategy allows the first\n//     stage of two-stage parsing to immediately terminate if an error is\n//     encountered, and immediately fall back to the second stage. In addition to\n//     avoiding wasted work by attempting to recover from errors here, the empty\n//     implementation of [BailErrorStrategy.Sync] improves the performance of\n//     the first stage.\n//\n//   - Silent validation: When syntax errors are not being\n//     Reported or logged, and the parse result is simply ignored if errors occur,\n//     the [BailErrorStrategy] avoids wasting work on recovering from errors\n//     when the result will be ignored either way.\n//\n//     myparser.SetErrorHandler(NewBailErrorStrategy())\n//\n// See also: [Parser.SetErrorHandler(ANTLRErrorStrategy)]\ntype BailErrorStrategy struct {\n\t*DefaultErrorStrategy\n}\n\nvar _ ErrorStrategy = &BailErrorStrategy{}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewBailErrorStrategy() *BailErrorStrategy {\n\n\tb := new(BailErrorStrategy)\n\n\tb.DefaultErrorStrategy = NewDefaultErrorStrategy()\n\n\treturn b\n}\n\n// Recover Instead of recovering from exception e, re-panic it wrapped\n// in a [ParseCancellationException] so it is not caught by the\n// rule func catches. Use Exception.GetCause() to get the\n// original [RecognitionException].\nfunc (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) {\n\tcontext := recognizer.GetParserRuleContext()\n\tfor context != nil {\n\t\tcontext.SetException(e)\n\t\tif parent, ok := context.GetParent().(ParserRuleContext); ok {\n\t\t\tcontext = parent\n\t\t} else {\n\t\t\tcontext = nil\n\t\t}\n\t}\n\trecognizer.SetError(NewParseCancellationException()) // TODO: we don't emit e properly\n}\n\n// RecoverInline makes sure we don't attempt to recover inline if the parser\n// successfully recovers, it won't panic an exception.\nfunc (b *BailErrorStrategy) RecoverInline(recognizer Parser) Token {\n\tb.Recover(recognizer, NewInputMisMatchException(recognizer))\n\n\treturn nil\n}\n\n// Sync makes sure we don't attempt to recover from problems in sub-rules.\nfunc (b *BailErrorStrategy) Sync(_ Parser) {\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/errors.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// The root of the ANTLR exception hierarchy. In general, ANTLR tracks just\n//  3 kinds of errors: prediction errors, failed predicate errors, and\n//  mismatched input errors. In each case, the parser knows where it is\n//  in the input, where it is in the ATN, the rule invocation stack,\n//  and what kind of problem occurred.\n\ntype RecognitionException interface {\n\tGetOffendingToken() Token\n\tGetMessage() string\n\tGetInputStream() IntStream\n}\n\ntype BaseRecognitionException struct {\n\tmessage        string\n\trecognizer     Recognizer\n\toffendingToken Token\n\toffendingState int\n\tctx            RuleContext\n\tinput          IntStream\n}\n\nfunc NewBaseRecognitionException(message string, recognizer Recognizer, input IntStream, ctx RuleContext) *BaseRecognitionException {\n\n\t// todo\n\t//\tError.call(this)\n\t//\n\t//\tif (!!Error.captureStackTrace) {\n\t//        Error.captureStackTrace(this, RecognitionException)\n\t//\t} else {\n\t//\t\tstack := NewError().stack\n\t//\t}\n\t// TODO: may be able to use - \"runtime\" func Stack(buf []byte, all bool) int\n\n\tt := new(BaseRecognitionException)\n\n\tt.message = message\n\tt.recognizer = recognizer\n\tt.input = input\n\tt.ctx = ctx\n\n\t// The current Token when an error occurred. Since not all streams\n\t// support accessing symbols by index, we have to track the {@link Token}\n\t// instance itself.\n\t//\n\tt.offendingToken = nil\n\n\t// Get the ATN state number the parser was in at the time the error\n\t// occurred. For NoViableAltException and LexerNoViableAltException exceptions, this is the\n\t// DecisionState number. For others, it is the state whose outgoing edge we couldn't Match.\n\t//\n\tt.offendingState = -1\n\tif t.recognizer != nil {\n\t\tt.offendingState = t.recognizer.GetState()\n\t}\n\n\treturn t\n}\n\nfunc (b *BaseRecognitionException) GetMessage() string {\n\treturn b.message\n}\n\nfunc (b *BaseRecognitionException) GetOffendingToken() Token {\n\treturn b.offendingToken\n}\n\nfunc (b *BaseRecognitionException) GetInputStream() IntStream {\n\treturn b.input\n}\n\n// <p>If the state number is not known, b method returns -1.</p>\n\n// getExpectedTokens gets the set of input symbols which could potentially follow the\n// previously Matched symbol at the time this exception was raised.\n//\n// If the set of expected tokens is not known and could not be computed,\n// this method returns nil.\n//\n// The func returns the set of token types that could potentially follow the current\n// state in the {ATN}, or nil if the information is not available.\n\nfunc (b *BaseRecognitionException) getExpectedTokens() *IntervalSet {\n\tif b.recognizer != nil {\n\t\treturn b.recognizer.GetATN().getExpectedTokens(b.offendingState, b.ctx)\n\t}\n\n\treturn nil\n}\n\nfunc (b *BaseRecognitionException) String() string {\n\treturn b.message\n}\n\ntype LexerNoViableAltException struct {\n\t*BaseRecognitionException\n\n\tstartIndex     int\n\tdeadEndConfigs *ATNConfigSet\n}\n\nfunc NewLexerNoViableAltException(lexer Lexer, input CharStream, startIndex int, deadEndConfigs *ATNConfigSet) *LexerNoViableAltException {\n\n\tl := new(LexerNoViableAltException)\n\n\tl.BaseRecognitionException = NewBaseRecognitionException(\"\", lexer, input, nil)\n\n\tl.startIndex = startIndex\n\tl.deadEndConfigs = deadEndConfigs\n\n\treturn l\n}\n\nfunc (l *LexerNoViableAltException) String() string {\n\tsymbol := \"\"\n\tif l.startIndex >= 0 && l.startIndex < l.input.Size() {\n\t\tsymbol = l.input.(CharStream).GetTextFromInterval(NewInterval(l.startIndex, l.startIndex))\n\t}\n\treturn \"LexerNoViableAltException\" + symbol\n}\n\ntype NoViableAltException struct {\n\t*BaseRecognitionException\n\n\tstartToken     Token\n\toffendingToken Token\n\tctx            ParserRuleContext\n\tdeadEndConfigs *ATNConfigSet\n}\n\n// NewNoViableAltException creates an exception indicating that the parser could not decide which of two or more paths\n// to take based upon the remaining input. It tracks the starting token\n// of the offending input and also knows where the parser was\n// in the various paths when the error.\n//\n// Reported by [ReportNoViableAlternative]\nfunc NewNoViableAltException(recognizer Parser, input TokenStream, startToken Token, offendingToken Token, deadEndConfigs *ATNConfigSet, ctx ParserRuleContext) *NoViableAltException {\n\n\tif ctx == nil {\n\t\tctx = recognizer.GetParserRuleContext()\n\t}\n\n\tif offendingToken == nil {\n\t\toffendingToken = recognizer.GetCurrentToken()\n\t}\n\n\tif startToken == nil {\n\t\tstartToken = recognizer.GetCurrentToken()\n\t}\n\n\tif input == nil {\n\t\tinput = recognizer.GetInputStream().(TokenStream)\n\t}\n\n\tn := new(NoViableAltException)\n\tn.BaseRecognitionException = NewBaseRecognitionException(\"\", recognizer, input, ctx)\n\n\t// Which configurations did we try at input.Index() that couldn't Match\n\t// input.LT(1)\n\tn.deadEndConfigs = deadEndConfigs\n\n\t// The token object at the start index the input stream might\n\t// not be buffering tokens so get a reference to it.\n\t//\n\t// At the time the error occurred, of course the stream needs to keep a\n\t// buffer of all the tokens, but later we might not have access to those.\n\tn.startToken = startToken\n\tn.offendingToken = offendingToken\n\n\treturn n\n}\n\ntype InputMisMatchException struct {\n\t*BaseRecognitionException\n}\n\n// NewInputMisMatchException creates an exception that signifies any kind of mismatched input exceptions such as\n// when the current input does not Match the expected token.\nfunc NewInputMisMatchException(recognizer Parser) *InputMisMatchException {\n\n\ti := new(InputMisMatchException)\n\ti.BaseRecognitionException = NewBaseRecognitionException(\"\", recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext())\n\n\ti.offendingToken = recognizer.GetCurrentToken()\n\n\treturn i\n\n}\n\n// FailedPredicateException indicates that a semantic predicate failed during validation. Validation of predicates\n// occurs when normally parsing the alternative just like Matching a token.\n// Disambiguating predicate evaluation occurs when we test a predicate during\n// prediction.\ntype FailedPredicateException struct {\n\t*BaseRecognitionException\n\n\truleIndex      int\n\tpredicateIndex int\n\tpredicate      string\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewFailedPredicateException(recognizer Parser, predicate string, message string) *FailedPredicateException {\n\n\tf := new(FailedPredicateException)\n\n\tf.BaseRecognitionException = NewBaseRecognitionException(f.formatMessage(predicate, message), recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext())\n\n\ts := recognizer.GetInterpreter().atn.states[recognizer.GetState()]\n\ttrans := s.GetTransitions()[0]\n\tif trans2, ok := trans.(*PredicateTransition); ok {\n\t\tf.ruleIndex = trans2.ruleIndex\n\t\tf.predicateIndex = trans2.predIndex\n\t} else {\n\t\tf.ruleIndex = 0\n\t\tf.predicateIndex = 0\n\t}\n\tf.predicate = predicate\n\tf.offendingToken = recognizer.GetCurrentToken()\n\n\treturn f\n}\n\nfunc (f *FailedPredicateException) formatMessage(predicate, message string) string {\n\tif message != \"\" {\n\t\treturn message\n\t}\n\n\treturn \"failed predicate: {\" + predicate + \"}?\"\n}\n\ntype ParseCancellationException struct {\n}\n\nfunc (p ParseCancellationException) GetOffendingToken() Token {\n\t//TODO implement me\n\tpanic(\"implement me\")\n}\n\nfunc (p ParseCancellationException) GetMessage() string {\n\t//TODO implement me\n\tpanic(\"implement me\")\n}\n\nfunc (p ParseCancellationException) GetInputStream() IntStream {\n\t//TODO implement me\n\tpanic(\"implement me\")\n}\n\nfunc NewParseCancellationException() *ParseCancellationException {\n\t//\tError.call(this)\n\t//\tError.captureStackTrace(this, ParseCancellationException)\n\treturn new(ParseCancellationException)\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/file_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\n//  This is an InputStream that is loaded from a file all at once\n//  when you construct the object.\n\ntype FileStream struct {\n\tInputStream\n\tfilename string\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewFileStream(fileName string) (*FileStream, error) {\n\n\tf, err := os.Open(fileName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer func(f *os.File) {\n\t\terrF := f.Close()\n\t\tif errF != nil {\n\t\t}\n\t}(f)\n\n\treader := bufio.NewReader(f)\n\tfInfo, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfs := &FileStream{\n\t\tInputStream: InputStream{\n\t\t\tindex: 0,\n\t\t\tname:  fileName,\n\t\t},\n\t\tfilename: fileName,\n\t}\n\n\t// Pre-build the buffer and read runes efficiently\n\t//\n\tfs.data = make([]rune, 0, fInfo.Size())\n\tfor {\n\t\tr, _, err := reader.ReadRune()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tfs.data = append(fs.data, r)\n\t}\n\tfs.size = len(fs.data) // Size in runes\n\n\t// All done.\n\t//\n\treturn fs, nil\n}\n\nfunc (f *FileStream) GetSourceName() string {\n\treturn f.filename\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/input_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"bufio\"\n\t\"io\"\n)\n\ntype InputStream struct {\n\tname  string\n\tindex int\n\tdata  []rune\n\tsize  int\n}\n\n// NewIoStream creates a new input stream from the given io.Reader reader.\n// Note that the reader is read completely into memory and so it must actually\n// have a stopping point - you cannot pass in a reader on an open-ended source such\n// as a socket for instance.\nfunc NewIoStream(reader io.Reader) *InputStream {\n\n\trReader := bufio.NewReader(reader)\n\n\tis := &InputStream{\n\t\tname:  \"<empty>\",\n\t\tindex: 0,\n\t}\n\n\t// Pre-build the buffer and read runes reasonably efficiently given that\n\t// we don't exactly know how big the input is.\n\t//\n\tis.data = make([]rune, 0, 512)\n\tfor {\n\t\tr, _, err := rReader.ReadRune()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tis.data = append(is.data, r)\n\t}\n\tis.size = len(is.data) // number of runes\n\treturn is\n}\n\n// NewInputStream creates a new input stream from the given string\nfunc NewInputStream(data string) *InputStream {\n\n\tis := &InputStream{\n\t\tname:  \"<empty>\",\n\t\tindex: 0,\n\t\tdata:  []rune(data), // This is actually the most efficient way\n\t}\n\tis.size = len(is.data) // number of runes, but we could also use len(data), which is efficient too\n\treturn is\n}\n\nfunc (is *InputStream) reset() {\n\tis.index = 0\n}\n\n// Consume moves the input pointer to the next character in the input stream\nfunc (is *InputStream) Consume() {\n\tif is.index >= is.size {\n\t\t// assert is.LA(1) == TokenEOF\n\t\tpanic(\"cannot consume EOF\")\n\t}\n\tis.index++\n}\n\n// LA returns the character at the given offset from the start of the input stream\nfunc (is *InputStream) LA(offset int) int {\n\n\tif offset == 0 {\n\t\treturn 0 // nil\n\t}\n\tif offset < 0 {\n\t\toffset++ // e.g., translate LA(-1) to use offset=0\n\t}\n\tpos := is.index + offset - 1\n\n\tif pos < 0 || pos >= is.size { // invalid\n\t\treturn TokenEOF\n\t}\n\n\treturn int(is.data[pos])\n}\n\n// LT returns the character at the given offset from the start of the input stream\nfunc (is *InputStream) LT(offset int) int {\n\treturn is.LA(offset)\n}\n\n// Index returns the current offset in to the input stream\nfunc (is *InputStream) Index() int {\n\treturn is.index\n}\n\n// Size returns the total number of characters in the input stream\nfunc (is *InputStream) Size() int {\n\treturn is.size\n}\n\n// Mark does nothing here as we have entire buffer\nfunc (is *InputStream) Mark() int {\n\treturn -1\n}\n\n// Release does nothing here as we have entire buffer\nfunc (is *InputStream) Release(_ int) {\n}\n\n// Seek the input point to the provided index offset\nfunc (is *InputStream) Seek(index int) {\n\tif index <= is.index {\n\t\tis.index = index // just jump don't update stream state (line,...)\n\t\treturn\n\t}\n\t// seek forward\n\tis.index = intMin(index, is.size)\n}\n\n// GetText returns the text from the input stream from the start to the stop index\nfunc (is *InputStream) GetText(start int, stop int) string {\n\tif stop >= is.size {\n\t\tstop = is.size - 1\n\t}\n\tif start >= is.size {\n\t\treturn \"\"\n\t}\n\n\treturn string(is.data[start : stop+1])\n}\n\n// GetTextFromTokens returns the text from the input stream from the first character of the start token to the last\n// character of the stop token\nfunc (is *InputStream) GetTextFromTokens(start, stop Token) string {\n\tif start != nil && stop != nil {\n\t\treturn is.GetTextFromInterval(NewInterval(start.GetTokenIndex(), stop.GetTokenIndex()))\n\t}\n\n\treturn \"\"\n}\n\nfunc (is *InputStream) GetTextFromInterval(i Interval) string {\n\treturn is.GetText(i.Start, i.Stop)\n}\n\nfunc (*InputStream) GetSourceName() string {\n\treturn \"Obtained from string\"\n}\n\n// String returns the entire input stream as a string\nfunc (is *InputStream) String() string {\n\treturn string(is.data)\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/int_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\ntype IntStream interface {\n\tConsume()\n\tLA(int) int\n\tMark() int\n\tRelease(marker int)\n\tIndex() int\n\tSeek(index int)\n\tSize() int\n\tGetSourceName() string\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/interval_set.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Interval struct {\n\tStart int\n\tStop  int\n}\n\n// NewInterval creates a new interval with the given start and stop values.\nfunc NewInterval(start, stop int) Interval {\n\treturn Interval{\n\t\tStart: start,\n\t\tStop:  stop,\n\t}\n}\n\n// Contains returns true if the given item is contained within the interval.\nfunc (i Interval) Contains(item int) bool {\n\treturn item >= i.Start && item < i.Stop\n}\n\n// String generates a string representation of the interval.\nfunc (i Interval) String() string {\n\tif i.Start == i.Stop-1 {\n\t\treturn strconv.Itoa(i.Start)\n\t}\n\n\treturn strconv.Itoa(i.Start) + \"..\" + strconv.Itoa(i.Stop-1)\n}\n\n// Length returns the length of the interval.\nfunc (i Interval) Length() int {\n\treturn i.Stop - i.Start\n}\n\n// IntervalSet represents a collection of [Intervals], which may be read-only.\ntype IntervalSet struct {\n\tintervals []Interval\n\treadOnly  bool\n}\n\n// NewIntervalSet creates a new empty, writable, interval set.\nfunc NewIntervalSet() *IntervalSet {\n\n\ti := new(IntervalSet)\n\n\ti.intervals = nil\n\ti.readOnly = false\n\n\treturn i\n}\n\nfunc (i *IntervalSet) Equals(other *IntervalSet) bool {\n\tif len(i.intervals) != len(other.intervals) {\n\t\treturn false\n\t}\n\n\tfor k, v := range i.intervals {\n\t\tif v.Start != other.intervals[k].Start || v.Stop != other.intervals[k].Stop {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (i *IntervalSet) first() int {\n\tif len(i.intervals) == 0 {\n\t\treturn TokenInvalidType\n\t}\n\n\treturn i.intervals[0].Start\n}\n\nfunc (i *IntervalSet) addOne(v int) {\n\ti.addInterval(NewInterval(v, v+1))\n}\n\nfunc (i *IntervalSet) addRange(l, h int) {\n\ti.addInterval(NewInterval(l, h+1))\n}\n\nfunc (i *IntervalSet) addInterval(v Interval) {\n\tif i.intervals == nil {\n\t\ti.intervals = make([]Interval, 0)\n\t\ti.intervals = append(i.intervals, v)\n\t} else {\n\t\t// find insert pos\n\t\tfor k, interval := range i.intervals {\n\t\t\t// distinct range -> insert\n\t\t\tif v.Stop < interval.Start {\n\t\t\t\ti.intervals = append(i.intervals[0:k], append([]Interval{v}, i.intervals[k:]...)...)\n\t\t\t\treturn\n\t\t\t} else if v.Stop == interval.Start {\n\t\t\t\ti.intervals[k].Start = v.Start\n\t\t\t\treturn\n\t\t\t} else if v.Start <= interval.Stop {\n\t\t\t\ti.intervals[k] = NewInterval(intMin(interval.Start, v.Start), intMax(interval.Stop, v.Stop))\n\n\t\t\t\t// if not applying to end, merge potential overlaps\n\t\t\t\tif k < len(i.intervals)-1 {\n\t\t\t\t\tl := i.intervals[k]\n\t\t\t\t\tr := i.intervals[k+1]\n\t\t\t\t\t// if r contained in l\n\t\t\t\t\tif l.Stop >= r.Stop {\n\t\t\t\t\t\ti.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...)\n\t\t\t\t\t} else if l.Stop >= r.Start { // partial overlap\n\t\t\t\t\t\ti.intervals[k] = NewInterval(l.Start, r.Stop)\n\t\t\t\t\t\ti.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t// greater than any exiting\n\t\ti.intervals = append(i.intervals, v)\n\t}\n}\n\nfunc (i *IntervalSet) addSet(other *IntervalSet) *IntervalSet {\n\tif other.intervals != nil {\n\t\tfor k := 0; k < len(other.intervals); k++ {\n\t\t\ti2 := other.intervals[k]\n\t\t\ti.addInterval(NewInterval(i2.Start, i2.Stop))\n\t\t}\n\t}\n\treturn i\n}\n\nfunc (i *IntervalSet) complement(start int, stop int) *IntervalSet {\n\tresult := NewIntervalSet()\n\tresult.addInterval(NewInterval(start, stop+1))\n\tfor j := 0; j < len(i.intervals); j++ {\n\t\tresult.removeRange(i.intervals[j])\n\t}\n\treturn result\n}\n\nfunc (i *IntervalSet) contains(item int) bool {\n\tif i.intervals == nil {\n\t\treturn false\n\t}\n\tfor k := 0; k < len(i.intervals); k++ {\n\t\tif i.intervals[k].Contains(item) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (i *IntervalSet) length() int {\n\tiLen := 0\n\n\tfor _, v := range i.intervals {\n\t\tiLen += v.Length()\n\t}\n\n\treturn iLen\n}\n\nfunc (i *IntervalSet) removeRange(v Interval) {\n\tif v.Start == v.Stop-1 {\n\t\ti.removeOne(v.Start)\n\t} else if i.intervals != nil {\n\t\tk := 0\n\t\tfor n := 0; n < len(i.intervals); n++ {\n\t\t\tni := i.intervals[k]\n\t\t\t// intervals are ordered\n\t\t\tif v.Stop <= ni.Start {\n\t\t\t\treturn\n\t\t\t} else if v.Start > ni.Start && v.Stop < ni.Stop {\n\t\t\t\ti.intervals[k] = NewInterval(ni.Start, v.Start)\n\t\t\t\tx := NewInterval(v.Stop, ni.Stop)\n\t\t\t\t// i.intervals.splice(k, 0, x)\n\t\t\t\ti.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...)\n\t\t\t\treturn\n\t\t\t} else if v.Start <= ni.Start && v.Stop >= ni.Stop {\n\t\t\t\t//                i.intervals.splice(k, 1)\n\t\t\t\ti.intervals = append(i.intervals[0:k], i.intervals[k+1:]...)\n\t\t\t\tk = k - 1 // need another pass\n\t\t\t} else if v.Start < ni.Stop {\n\t\t\t\ti.intervals[k] = NewInterval(ni.Start, v.Start)\n\t\t\t} else if v.Stop < ni.Stop {\n\t\t\t\ti.intervals[k] = NewInterval(v.Stop, ni.Stop)\n\t\t\t}\n\t\t\tk++\n\t\t}\n\t}\n}\n\nfunc (i *IntervalSet) removeOne(v int) {\n\tif i.intervals != nil {\n\t\tfor k := 0; k < len(i.intervals); k++ {\n\t\t\tki := i.intervals[k]\n\t\t\t// intervals i ordered\n\t\t\tif v < ki.Start {\n\t\t\t\treturn\n\t\t\t} else if v == ki.Start && v == ki.Stop-1 {\n\t\t\t\t//\t\t\t\ti.intervals.splice(k, 1)\n\t\t\t\ti.intervals = append(i.intervals[0:k], i.intervals[k+1:]...)\n\t\t\t\treturn\n\t\t\t} else if v == ki.Start {\n\t\t\t\ti.intervals[k] = NewInterval(ki.Start+1, ki.Stop)\n\t\t\t\treturn\n\t\t\t} else if v == ki.Stop-1 {\n\t\t\t\ti.intervals[k] = NewInterval(ki.Start, ki.Stop-1)\n\t\t\t\treturn\n\t\t\t} else if v < ki.Stop-1 {\n\t\t\t\tx := NewInterval(ki.Start, v)\n\t\t\t\tki.Start = v + 1\n\t\t\t\t//\t\t\t\ti.intervals.splice(k, 0, x)\n\t\t\t\ti.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (i *IntervalSet) String() string {\n\treturn i.StringVerbose(nil, nil, false)\n}\n\nfunc (i *IntervalSet) StringVerbose(literalNames []string, symbolicNames []string, elemsAreChar bool) string {\n\n\tif i.intervals == nil {\n\t\treturn \"{}\"\n\t} else if literalNames != nil || symbolicNames != nil {\n\t\treturn i.toTokenString(literalNames, symbolicNames)\n\t} else if elemsAreChar {\n\t\treturn i.toCharString()\n\t}\n\n\treturn i.toIndexString()\n}\n\nfunc (i *IntervalSet) GetIntervals() []Interval {\n\treturn i.intervals\n}\n\nfunc (i *IntervalSet) toCharString() string {\n\tnames := make([]string, len(i.intervals))\n\n\tvar sb strings.Builder\n\n\tfor j := 0; j < len(i.intervals); j++ {\n\t\tv := i.intervals[j]\n\t\tif v.Stop == v.Start+1 {\n\t\t\tif v.Start == TokenEOF {\n\t\t\t\tnames = append(names, \"<EOF>\")\n\t\t\t} else {\n\t\t\t\tsb.WriteByte('\\'')\n\t\t\t\tsb.WriteRune(rune(v.Start))\n\t\t\t\tsb.WriteByte('\\'')\n\t\t\t\tnames = append(names, sb.String())\n\t\t\t\tsb.Reset()\n\t\t\t}\n\t\t} else {\n\t\t\tsb.WriteByte('\\'')\n\t\t\tsb.WriteRune(rune(v.Start))\n\t\t\tsb.WriteString(\"'..'\")\n\t\t\tsb.WriteRune(rune(v.Stop - 1))\n\t\t\tsb.WriteByte('\\'')\n\t\t\tnames = append(names, sb.String())\n\t\t\tsb.Reset()\n\t\t}\n\t}\n\tif len(names) > 1 {\n\t\treturn \"{\" + strings.Join(names, \", \") + \"}\"\n\t}\n\n\treturn names[0]\n}\n\nfunc (i *IntervalSet) toIndexString() string {\n\n\tnames := make([]string, 0)\n\tfor j := 0; j < len(i.intervals); j++ {\n\t\tv := i.intervals[j]\n\t\tif v.Stop == v.Start+1 {\n\t\t\tif v.Start == TokenEOF {\n\t\t\t\tnames = append(names, \"<EOF>\")\n\t\t\t} else {\n\t\t\t\tnames = append(names, strconv.Itoa(v.Start))\n\t\t\t}\n\t\t} else {\n\t\t\tnames = append(names, strconv.Itoa(v.Start)+\"..\"+strconv.Itoa(v.Stop-1))\n\t\t}\n\t}\n\tif len(names) > 1 {\n\t\treturn \"{\" + strings.Join(names, \", \") + \"}\"\n\t}\n\n\treturn names[0]\n}\n\nfunc (i *IntervalSet) toTokenString(literalNames []string, symbolicNames []string) string {\n\tnames := make([]string, 0)\n\tfor _, v := range i.intervals {\n\t\tfor j := v.Start; j < v.Stop; j++ {\n\t\t\tnames = append(names, i.elementName(literalNames, symbolicNames, j))\n\t\t}\n\t}\n\tif len(names) > 1 {\n\t\treturn \"{\" + strings.Join(names, \", \") + \"}\"\n\t}\n\n\treturn names[0]\n}\n\nfunc (i *IntervalSet) elementName(literalNames []string, symbolicNames []string, a int) string {\n\tif a == TokenEOF {\n\t\treturn \"<EOF>\"\n\t} else if a == TokenEpsilon {\n\t\treturn \"<EPSILON>\"\n\t} else {\n\t\tif a < len(literalNames) && literalNames[a] != \"\" {\n\t\t\treturn literalNames[a]\n\t\t}\n\n\t\treturn symbolicNames[a]\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/jcollect.go",
    "content": "package antlr\n\n// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\nimport (\n\t\"container/list\"\n\t\"runtime/debug\"\n\t\"sort\"\n)\n\n// Collectable is an interface that a struct should implement if it is to be\n// usable as a key in these collections.\ntype Collectable[T any] interface {\n\tHash() int\n\tEquals(other Collectable[T]) bool\n}\n\ntype Comparator[T any] interface {\n\tHash1(o T) int\n\tEquals2(T, T) bool\n}\n\ntype CollectionSource int\ntype CollectionDescriptor struct {\n\tSybolicName string\n\tDescription string\n}\n\nconst (\n\tUnknownCollection CollectionSource = iota\n\tATNConfigLookupCollection\n\tATNStateCollection\n\tDFAStateCollection\n\tATNConfigCollection\n\tPredictionContextCollection\n\tSemanticContextCollection\n\tClosureBusyCollection\n\tPredictionVisitedCollection\n\tMergeCacheCollection\n\tPredictionContextCacheCollection\n\tAltSetCollection\n\tReachSetCollection\n)\n\nvar CollectionDescriptors = map[CollectionSource]CollectionDescriptor{\n\tUnknownCollection: {\n\t\tSybolicName: \"UnknownCollection\",\n\t\tDescription: \"Unknown collection type. Only used if the target author thought it was an unimportant collection.\",\n\t},\n\tATNConfigCollection: {\n\t\tSybolicName: \"ATNConfigCollection\",\n\t\tDescription: \"ATNConfig collection. Used to store the ATNConfigs for a particular state in the ATN.\" +\n\t\t\t\"For instance, it is used to store the results of the closure() operation in the ATN.\",\n\t},\n\tATNConfigLookupCollection: {\n\t\tSybolicName: \"ATNConfigLookupCollection\",\n\t\tDescription: \"ATNConfigLookup collection. Used to store the ATNConfigs for a particular state in the ATN.\" +\n\t\t\t\"This is used to prevent duplicating equivalent states in an ATNConfigurationSet.\",\n\t},\n\tATNStateCollection: {\n\t\tSybolicName: \"ATNStateCollection\",\n\t\tDescription: \"ATNState collection. This is used to store the states of the ATN.\",\n\t},\n\tDFAStateCollection: {\n\t\tSybolicName: \"DFAStateCollection\",\n\t\tDescription: \"DFAState collection. This is used to store the states of the DFA.\",\n\t},\n\tPredictionContextCollection: {\n\t\tSybolicName: \"PredictionContextCollection\",\n\t\tDescription: \"PredictionContext collection. This is used to store the prediction contexts of the ATN and cache computes.\",\n\t},\n\tSemanticContextCollection: {\n\t\tSybolicName: \"SemanticContextCollection\",\n\t\tDescription: \"SemanticContext collection. This is used to store the semantic contexts of the ATN.\",\n\t},\n\tClosureBusyCollection: {\n\t\tSybolicName: \"ClosureBusyCollection\",\n\t\tDescription: \"ClosureBusy collection. This is used to check and prevent infinite recursion right recursive rules.\" +\n\t\t\t\"It stores ATNConfigs that are currently being processed in the closure() operation.\",\n\t},\n\tPredictionVisitedCollection: {\n\t\tSybolicName: \"PredictionVisitedCollection\",\n\t\tDescription: \"A map that records whether we have visited a particular context when searching through cached entries.\",\n\t},\n\tMergeCacheCollection: {\n\t\tSybolicName: \"MergeCacheCollection\",\n\t\tDescription: \"A map that records whether we have already merged two particular contexts and can save effort by not repeating it.\",\n\t},\n\tPredictionContextCacheCollection: {\n\t\tSybolicName: \"PredictionContextCacheCollection\",\n\t\tDescription: \"A map that records whether we have already created a particular context and can save effort by not computing it again.\",\n\t},\n\tAltSetCollection: {\n\t\tSybolicName: \"AltSetCollection\",\n\t\tDescription: \"Used to eliminate duplicate alternatives in an ATN config set.\",\n\t},\n\tReachSetCollection: {\n\t\tSybolicName: \"ReachSetCollection\",\n\t\tDescription: \"Used as merge cache to prevent us needing to compute the merge of two states if we have already done it.\",\n\t},\n}\n\n// JStore implements a container that allows the use of a struct to calculate the key\n// for a collection of values akin to map. This is not meant to be a full-blown HashMap but just\n// serve the needs of the ANTLR Go runtime.\n//\n// For ease of porting the logic of the runtime from the master target (Java), this collection\n// operates in a similar way to Java, in that it can use any struct that supplies a Hash() and Equals()\n// function as the key. The values are stored in a standard go map which internally is a form of hashmap\n// itself, the key for the go map is the hash supplied by the key object. The collection is able to deal with\n// hash conflicts by using a simple slice of values associated with the hash code indexed bucket. That isn't\n// particularly efficient, but it is simple, and it works. As this is specifically for the ANTLR runtime, and\n// we understand the requirements, then this is fine - this is not a general purpose collection.\ntype JStore[T any, C Comparator[T]] struct {\n\tstore      map[int][]T\n\tlen        int\n\tcomparator Comparator[T]\n\tstats      *JStatRec\n}\n\nfunc NewJStore[T any, C Comparator[T]](comparator Comparator[T], cType CollectionSource, desc string) *JStore[T, C] {\n\n\tif comparator == nil {\n\t\tpanic(\"comparator cannot be nil\")\n\t}\n\n\ts := &JStore[T, C]{\n\t\tstore:      make(map[int][]T, 1),\n\t\tcomparator: comparator,\n\t}\n\tif collectStats {\n\t\ts.stats = &JStatRec{\n\t\t\tSource:      cType,\n\t\t\tDescription: desc,\n\t\t}\n\n\t\t// Track where we created it from  if we are being asked to do so\n\t\tif runtimeConfig.statsTraceStacks {\n\t\t\ts.stats.CreateStack = debug.Stack()\n\t\t}\n\t\tStatistics.AddJStatRec(s.stats)\n\t}\n\treturn s\n}\n\n// Put will store given value in the collection. Note that the key for storage is generated from\n// the value itself - this is specifically because that is what ANTLR needs - this would not be useful\n// as any kind of general collection.\n//\n// If the key has a hash conflict, then the value will be added to the slice of values associated with the\n// hash, unless the value is already in the slice, in which case the existing value is returned. Value equivalence is\n// tested by calling the equals() method on the key.\n//\n// # If the given value is already present in the store, then the existing value is returned as v and exists is set to true\n//\n// If the given value is not present in the store, then the value is added to the store and returned as v and exists is set to false.\nfunc (s *JStore[T, C]) Put(value T) (v T, exists bool) {\n\n\tif collectStats {\n\t\ts.stats.Puts++\n\t}\n\tkh := s.comparator.Hash1(value)\n\n\tvar hClash bool\n\tfor _, v1 := range s.store[kh] {\n\t\thClash = true\n\t\tif s.comparator.Equals2(value, v1) {\n\t\t\tif collectStats {\n\t\t\t\ts.stats.PutHits++\n\t\t\t\ts.stats.PutHashConflicts++\n\t\t\t}\n\t\t\treturn v1, true\n\t\t}\n\t\tif collectStats {\n\t\t\ts.stats.PutMisses++\n\t\t}\n\t}\n\tif collectStats && hClash {\n\t\ts.stats.PutHashConflicts++\n\t}\n\ts.store[kh] = append(s.store[kh], value)\n\n\tif collectStats {\n\t\tif len(s.store[kh]) > s.stats.MaxSlotSize {\n\t\t\ts.stats.MaxSlotSize = len(s.store[kh])\n\t\t}\n\t}\n\ts.len++\n\tif collectStats {\n\t\ts.stats.CurSize = s.len\n\t\tif s.len > s.stats.MaxSize {\n\t\t\ts.stats.MaxSize = s.len\n\t\t}\n\t}\n\treturn value, false\n}\n\n// Get will return the value associated with the key - the type of the key is the same type as the value\n// which would not generally be useful, but this is a specific thing for ANTLR where the key is\n// generated using the object we are going to store.\nfunc (s *JStore[T, C]) Get(key T) (T, bool) {\n\tif collectStats {\n\t\ts.stats.Gets++\n\t}\n\tkh := s.comparator.Hash1(key)\n\tvar hClash bool\n\tfor _, v := range s.store[kh] {\n\t\thClash = true\n\t\tif s.comparator.Equals2(key, v) {\n\t\t\tif collectStats {\n\t\t\t\ts.stats.GetHits++\n\t\t\t\ts.stats.GetHashConflicts++\n\t\t\t}\n\t\t\treturn v, true\n\t\t}\n\t\tif collectStats {\n\t\t\ts.stats.GetMisses++\n\t\t}\n\t}\n\tif collectStats {\n\t\tif hClash {\n\t\t\ts.stats.GetHashConflicts++\n\t\t}\n\t\ts.stats.GetNoEnt++\n\t}\n\treturn key, false\n}\n\n// Contains returns true if the given key is present in the store\nfunc (s *JStore[T, C]) Contains(key T) bool {\n\t_, present := s.Get(key)\n\treturn present\n}\n\nfunc (s *JStore[T, C]) SortedSlice(less func(i, j T) bool) []T {\n\tvs := make([]T, 0, len(s.store))\n\tfor _, v := range s.store {\n\t\tvs = append(vs, v...)\n\t}\n\tsort.Slice(vs, func(i, j int) bool {\n\t\treturn less(vs[i], vs[j])\n\t})\n\n\treturn vs\n}\n\nfunc (s *JStore[T, C]) Each(f func(T) bool) {\n\tfor _, e := range s.store {\n\t\tfor _, v := range e {\n\t\t\tf(v)\n\t\t}\n\t}\n}\n\nfunc (s *JStore[T, C]) Len() int {\n\treturn s.len\n}\n\nfunc (s *JStore[T, C]) Values() []T {\n\tvs := make([]T, 0, len(s.store))\n\tfor _, e := range s.store {\n\t\tvs = append(vs, e...)\n\t}\n\treturn vs\n}\n\ntype entry[K, V any] struct {\n\tkey K\n\tval V\n}\n\ntype JMap[K, V any, C Comparator[K]] struct {\n\tstore      map[int][]*entry[K, V]\n\tlen        int\n\tcomparator Comparator[K]\n\tstats      *JStatRec\n}\n\nfunc NewJMap[K, V any, C Comparator[K]](comparator Comparator[K], cType CollectionSource, desc string) *JMap[K, V, C] {\n\tm := &JMap[K, V, C]{\n\t\tstore:      make(map[int][]*entry[K, V], 1),\n\t\tcomparator: comparator,\n\t}\n\tif collectStats {\n\t\tm.stats = &JStatRec{\n\t\t\tSource:      cType,\n\t\t\tDescription: desc,\n\t\t}\n\t\t// Track where we created it from  if we are being asked to do so\n\t\tif runtimeConfig.statsTraceStacks {\n\t\t\tm.stats.CreateStack = debug.Stack()\n\t\t}\n\t\tStatistics.AddJStatRec(m.stats)\n\t}\n\treturn m\n}\n\nfunc (m *JMap[K, V, C]) Put(key K, val V) (V, bool) {\n\tif collectStats {\n\t\tm.stats.Puts++\n\t}\n\tkh := m.comparator.Hash1(key)\n\n\tvar hClash bool\n\tfor _, e := range m.store[kh] {\n\t\thClash = true\n\t\tif m.comparator.Equals2(e.key, key) {\n\t\t\tif collectStats {\n\t\t\t\tm.stats.PutHits++\n\t\t\t\tm.stats.PutHashConflicts++\n\t\t\t}\n\t\t\treturn e.val, true\n\t\t}\n\t\tif collectStats {\n\t\t\tm.stats.PutMisses++\n\t\t}\n\t}\n\tif collectStats {\n\t\tif hClash {\n\t\t\tm.stats.PutHashConflicts++\n\t\t}\n\t}\n\tm.store[kh] = append(m.store[kh], &entry[K, V]{key, val})\n\tif collectStats {\n\t\tif len(m.store[kh]) > m.stats.MaxSlotSize {\n\t\t\tm.stats.MaxSlotSize = len(m.store[kh])\n\t\t}\n\t}\n\tm.len++\n\tif collectStats {\n\t\tm.stats.CurSize = m.len\n\t\tif m.len > m.stats.MaxSize {\n\t\t\tm.stats.MaxSize = m.len\n\t\t}\n\t}\n\treturn val, false\n}\n\nfunc (m *JMap[K, V, C]) Values() []V {\n\tvs := make([]V, 0, len(m.store))\n\tfor _, e := range m.store {\n\t\tfor _, v := range e {\n\t\t\tvs = append(vs, v.val)\n\t\t}\n\t}\n\treturn vs\n}\n\nfunc (m *JMap[K, V, C]) Get(key K) (V, bool) {\n\tif collectStats {\n\t\tm.stats.Gets++\n\t}\n\tvar none V\n\tkh := m.comparator.Hash1(key)\n\tvar hClash bool\n\tfor _, e := range m.store[kh] {\n\t\thClash = true\n\t\tif m.comparator.Equals2(e.key, key) {\n\t\t\tif collectStats {\n\t\t\t\tm.stats.GetHits++\n\t\t\t\tm.stats.GetHashConflicts++\n\t\t\t}\n\t\t\treturn e.val, true\n\t\t}\n\t\tif collectStats {\n\t\t\tm.stats.GetMisses++\n\t\t}\n\t}\n\tif collectStats {\n\t\tif hClash {\n\t\t\tm.stats.GetHashConflicts++\n\t\t}\n\t\tm.stats.GetNoEnt++\n\t}\n\treturn none, false\n}\n\nfunc (m *JMap[K, V, C]) Len() int {\n\treturn m.len\n}\n\nfunc (m *JMap[K, V, C]) Delete(key K) {\n\tkh := m.comparator.Hash1(key)\n\tfor i, e := range m.store[kh] {\n\t\tif m.comparator.Equals2(e.key, key) {\n\t\t\tm.store[kh] = append(m.store[kh][:i], m.store[kh][i+1:]...)\n\t\t\tm.len--\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (m *JMap[K, V, C]) Clear() {\n\tm.store = make(map[int][]*entry[K, V])\n}\n\ntype JPCMap struct {\n\tstore *JMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]]\n\tsize  int\n\tstats *JStatRec\n}\n\nfunc NewJPCMap(cType CollectionSource, desc string) *JPCMap {\n\tm := &JPCMap{\n\t\tstore: NewJMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]](pContextEqInst, cType, desc),\n\t}\n\tif collectStats {\n\t\tm.stats = &JStatRec{\n\t\t\tSource:      cType,\n\t\t\tDescription: desc,\n\t\t}\n\t\t// Track where we created it from  if we are being asked to do so\n\t\tif runtimeConfig.statsTraceStacks {\n\t\t\tm.stats.CreateStack = debug.Stack()\n\t\t}\n\t\tStatistics.AddJStatRec(m.stats)\n\t}\n\treturn m\n}\n\nfunc (pcm *JPCMap) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) {\n\tif collectStats {\n\t\tpcm.stats.Gets++\n\t}\n\t// Do we have a map stored by k1?\n\t//\n\tm2, present := pcm.store.Get(k1)\n\tif present {\n\t\tif collectStats {\n\t\t\tpcm.stats.GetHits++\n\t\t}\n\t\t// We found a map of values corresponding to k1, so now we need to look up k2 in that map\n\t\t//\n\t\treturn m2.Get(k2)\n\t}\n\tif collectStats {\n\t\tpcm.stats.GetMisses++\n\t}\n\treturn nil, false\n}\n\nfunc (pcm *JPCMap) Put(k1, k2, v *PredictionContext) {\n\n\tif collectStats {\n\t\tpcm.stats.Puts++\n\t}\n\t// First does a map already exist for k1?\n\t//\n\tif m2, present := pcm.store.Get(k1); present {\n\t\tif collectStats {\n\t\t\tpcm.stats.PutHits++\n\t\t}\n\t\t_, present = m2.Put(k2, v)\n\t\tif !present {\n\t\t\tpcm.size++\n\t\t\tif collectStats {\n\t\t\t\tpcm.stats.CurSize = pcm.size\n\t\t\t\tif pcm.size > pcm.stats.MaxSize {\n\t\t\t\t\tpcm.stats.MaxSize = pcm.size\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// No map found for k1, so we create it, add in our value, then store is\n\t\t//\n\t\tif collectStats {\n\t\t\tpcm.stats.PutMisses++\n\t\t\tm2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, pcm.stats.Source, pcm.stats.Description+\" map entry\")\n\t\t} else {\n\t\t\tm2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, \"map entry\")\n\t\t}\n\n\t\tm2.Put(k2, v)\n\t\tpcm.store.Put(k1, m2)\n\t\tpcm.size++\n\t}\n}\n\ntype JPCMap2 struct {\n\tstore map[int][]JPCEntry\n\tsize  int\n\tstats *JStatRec\n}\n\ntype JPCEntry struct {\n\tk1, k2, v *PredictionContext\n}\n\nfunc NewJPCMap2(cType CollectionSource, desc string) *JPCMap2 {\n\tm := &JPCMap2{\n\t\tstore: make(map[int][]JPCEntry, 1000),\n\t}\n\tif collectStats {\n\t\tm.stats = &JStatRec{\n\t\t\tSource:      cType,\n\t\t\tDescription: desc,\n\t\t}\n\t\t// Track where we created it from  if we are being asked to do so\n\t\tif runtimeConfig.statsTraceStacks {\n\t\t\tm.stats.CreateStack = debug.Stack()\n\t\t}\n\t\tStatistics.AddJStatRec(m.stats)\n\t}\n\treturn m\n}\n\nfunc dHash(k1, k2 *PredictionContext) int {\n\treturn k1.cachedHash*31 + k2.cachedHash\n}\n\nfunc (pcm *JPCMap2) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) {\n\tif collectStats {\n\t\tpcm.stats.Gets++\n\t}\n\n\th := dHash(k1, k2)\n\tvar hClash bool\n\tfor _, e := range pcm.store[h] {\n\t\thClash = true\n\t\tif e.k1.Equals(k1) && e.k2.Equals(k2) {\n\t\t\tif collectStats {\n\t\t\t\tpcm.stats.GetHits++\n\t\t\t\tpcm.stats.GetHashConflicts++\n\t\t\t}\n\t\t\treturn e.v, true\n\t\t}\n\t\tif collectStats {\n\t\t\tpcm.stats.GetMisses++\n\t\t}\n\t}\n\tif collectStats {\n\t\tif hClash {\n\t\t\tpcm.stats.GetHashConflicts++\n\t\t}\n\t\tpcm.stats.GetNoEnt++\n\t}\n\treturn nil, false\n}\n\nfunc (pcm *JPCMap2) Put(k1, k2, v *PredictionContext) (*PredictionContext, bool) {\n\tif collectStats {\n\t\tpcm.stats.Puts++\n\t}\n\th := dHash(k1, k2)\n\tvar hClash bool\n\tfor _, e := range pcm.store[h] {\n\t\thClash = true\n\t\tif e.k1.Equals(k1) && e.k2.Equals(k2) {\n\t\t\tif collectStats {\n\t\t\t\tpcm.stats.PutHits++\n\t\t\t\tpcm.stats.PutHashConflicts++\n\t\t\t}\n\t\t\treturn e.v, true\n\t\t}\n\t\tif collectStats {\n\t\t\tpcm.stats.PutMisses++\n\t\t}\n\t}\n\tif collectStats {\n\t\tif hClash {\n\t\t\tpcm.stats.PutHashConflicts++\n\t\t}\n\t}\n\tpcm.store[h] = append(pcm.store[h], JPCEntry{k1, k2, v})\n\tpcm.size++\n\tif collectStats {\n\t\tpcm.stats.CurSize = pcm.size\n\t\tif pcm.size > pcm.stats.MaxSize {\n\t\t\tpcm.stats.MaxSize = pcm.size\n\t\t}\n\t}\n\treturn nil, false\n}\n\ntype VisitEntry struct {\n\tk *PredictionContext\n\tv *PredictionContext\n}\ntype VisitRecord struct {\n\tstore map[*PredictionContext]*PredictionContext\n\tlen   int\n\tstats *JStatRec\n}\n\ntype VisitList struct {\n\tcache *list.List\n\tlock  RWMutex\n}\n\nvar visitListPool = VisitList{\n\tcache: list.New(),\n\tlock:  RWMutex{},\n}\n\n// NewVisitRecord returns a new VisitRecord instance from the pool if available.\n// Note that this \"map\" uses a pointer as a key because we are emulating the behavior of\n// IdentityHashMap in Java, which uses the `==` operator to compare whether the keys are equal,\n// which means is the key the same reference to an object rather than is it .equals() to another\n// object.\nfunc NewVisitRecord() *VisitRecord {\n\tvisitListPool.lock.Lock()\n\tel := visitListPool.cache.Front()\n\tdefer visitListPool.lock.Unlock()\n\tvar vr *VisitRecord\n\tif el == nil {\n\t\tvr = &VisitRecord{\n\t\t\tstore: make(map[*PredictionContext]*PredictionContext),\n\t\t}\n\t\tif collectStats {\n\t\t\tvr.stats = &JStatRec{\n\t\t\t\tSource:      PredictionContextCacheCollection,\n\t\t\t\tDescription: \"VisitRecord\",\n\t\t\t}\n\t\t\t// Track where we created it from  if we are being asked to do so\n\t\t\tif runtimeConfig.statsTraceStacks {\n\t\t\t\tvr.stats.CreateStack = debug.Stack()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tvr = el.Value.(*VisitRecord)\n\t\tvisitListPool.cache.Remove(el)\n\t\tvr.store = make(map[*PredictionContext]*PredictionContext)\n\t}\n\tif collectStats {\n\t\tStatistics.AddJStatRec(vr.stats)\n\t}\n\treturn vr\n}\n\nfunc (vr *VisitRecord) Release() {\n\tvr.len = 0\n\tvr.store = nil\n\tif collectStats {\n\t\tvr.stats.MaxSize = 0\n\t\tvr.stats.CurSize = 0\n\t\tvr.stats.Gets = 0\n\t\tvr.stats.GetHits = 0\n\t\tvr.stats.GetMisses = 0\n\t\tvr.stats.GetHashConflicts = 0\n\t\tvr.stats.GetNoEnt = 0\n\t\tvr.stats.Puts = 0\n\t\tvr.stats.PutHits = 0\n\t\tvr.stats.PutMisses = 0\n\t\tvr.stats.PutHashConflicts = 0\n\t\tvr.stats.MaxSlotSize = 0\n\t}\n\tvisitListPool.lock.Lock()\n\tvisitListPool.cache.PushBack(vr)\n\tvisitListPool.lock.Unlock()\n}\n\nfunc (vr *VisitRecord) Get(k *PredictionContext) (*PredictionContext, bool) {\n\tif collectStats {\n\t\tvr.stats.Gets++\n\t}\n\tv := vr.store[k]\n\tif v != nil {\n\t\tif collectStats {\n\t\t\tvr.stats.GetHits++\n\t\t}\n\t\treturn v, true\n\t}\n\tif collectStats {\n\t\tvr.stats.GetNoEnt++\n\t}\n\treturn nil, false\n}\n\nfunc (vr *VisitRecord) Put(k, v *PredictionContext) (*PredictionContext, bool) {\n\tif collectStats {\n\t\tvr.stats.Puts++\n\t}\n\tvr.store[k] = v\n\tvr.len++\n\tif collectStats {\n\t\tvr.stats.CurSize = vr.len\n\t\tif vr.len > vr.stats.MaxSize {\n\t\t\tvr.stats.MaxSize = vr.len\n\t\t}\n\t}\n\treturn v, false\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/lexer.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// A lexer is recognizer that draws input symbols from a character stream.\n//  lexer grammars result in a subclass of this object. A Lexer object\n//  uses simplified Match() and error recovery mechanisms in the interest\n//  of speed.\n///\n\ntype Lexer interface {\n\tTokenSource\n\tRecognizer\n\n\tEmit() Token\n\n\tSetChannel(int)\n\tPushMode(int)\n\tPopMode() int\n\tSetType(int)\n\tSetMode(int)\n}\n\ntype BaseLexer struct {\n\t*BaseRecognizer\n\n\tInterpreter         ILexerATNSimulator\n\tTokenStartCharIndex int\n\tTokenStartLine      int\n\tTokenStartColumn    int\n\tActionType          int\n\tVirt                Lexer // The most derived lexer implementation. Allows virtual method calls.\n\n\tinput                  CharStream\n\tfactory                TokenFactory\n\ttokenFactorySourcePair *TokenSourceCharStreamPair\n\ttoken                  Token\n\thitEOF                 bool\n\tchannel                int\n\tthetype                int\n\tmodeStack              IntStack\n\tmode                   int\n\ttext                   string\n}\n\nfunc NewBaseLexer(input CharStream) *BaseLexer {\n\n\tlexer := new(BaseLexer)\n\n\tlexer.BaseRecognizer = NewBaseRecognizer()\n\n\tlexer.input = input\n\tlexer.factory = CommonTokenFactoryDEFAULT\n\tlexer.tokenFactorySourcePair = &TokenSourceCharStreamPair{lexer, input}\n\n\tlexer.Virt = lexer\n\n\tlexer.Interpreter = nil // child classes must populate it\n\n\t// The goal of all lexer rules/methods is to create a token object.\n\t// l is an instance variable as multiple rules may collaborate to\n\t// create a single token. NextToken will return l object after\n\t// Matching lexer rule(s). If you subclass to allow multiple token\n\t// emissions, then set l to the last token to be Matched or\n\t// something non nil so that the auto token emit mechanism will not\n\t// emit another token.\n\tlexer.token = nil\n\n\t// What character index in the stream did the current token start at?\n\t// Needed, for example, to get the text for current token. Set at\n\t// the start of NextToken.\n\tlexer.TokenStartCharIndex = -1\n\n\t// The line on which the first character of the token resides///\n\tlexer.TokenStartLine = -1\n\n\t// The character position of first character within the line///\n\tlexer.TokenStartColumn = -1\n\n\t// Once we see EOF on char stream, next token will be EOF.\n\t// If you have DONE : EOF  then you see DONE EOF.\n\tlexer.hitEOF = false\n\n\t// The channel number for the current token///\n\tlexer.channel = TokenDefaultChannel\n\n\t// The token type for the current token///\n\tlexer.thetype = TokenInvalidType\n\n\tlexer.modeStack = make([]int, 0)\n\tlexer.mode = LexerDefaultMode\n\n\t// You can set the text for the current token to override what is in\n\t// the input char buffer. Use setText() or can set l instance var.\n\t// /\n\tlexer.text = \"\"\n\n\treturn lexer\n}\n\nconst (\n\tLexerDefaultMode = 0\n\tLexerMore        = -2\n\tLexerSkip        = -3\n)\n\n//goland:noinspection GoUnusedConst\nconst (\n\tLexerDefaultTokenChannel = TokenDefaultChannel\n\tLexerHidden              = TokenHiddenChannel\n\tLexerMinCharValue        = 0x0000\n\tLexerMaxCharValue        = 0x10FFFF\n)\n\nfunc (b *BaseLexer) Reset() {\n\t// wack Lexer state variables\n\tif b.input != nil {\n\t\tb.input.Seek(0) // rewind the input\n\t}\n\tb.token = nil\n\tb.thetype = TokenInvalidType\n\tb.channel = TokenDefaultChannel\n\tb.TokenStartCharIndex = -1\n\tb.TokenStartColumn = -1\n\tb.TokenStartLine = -1\n\tb.text = \"\"\n\n\tb.hitEOF = false\n\tb.mode = LexerDefaultMode\n\tb.modeStack = make([]int, 0)\n\n\tb.Interpreter.reset()\n}\n\nfunc (b *BaseLexer) GetInterpreter() ILexerATNSimulator {\n\treturn b.Interpreter\n}\n\nfunc (b *BaseLexer) GetInputStream() CharStream {\n\treturn b.input\n}\n\nfunc (b *BaseLexer) GetSourceName() string {\n\treturn b.GrammarFileName\n}\n\nfunc (b *BaseLexer) SetChannel(v int) {\n\tb.channel = v\n}\n\nfunc (b *BaseLexer) GetTokenFactory() TokenFactory {\n\treturn b.factory\n}\n\nfunc (b *BaseLexer) setTokenFactory(f TokenFactory) {\n\tb.factory = f\n}\n\nfunc (b *BaseLexer) safeMatch() (ret int) {\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tif re, ok := e.(RecognitionException); ok {\n\t\t\t\tb.notifyListeners(re) // Report error\n\t\t\t\tb.Recover(re)\n\t\t\t\tret = LexerSkip // default\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn b.Interpreter.Match(b.input, b.mode)\n}\n\n// NextToken returns a token from the lexer input source i.e., Match a token on the source char stream.\nfunc (b *BaseLexer) NextToken() Token {\n\tif b.input == nil {\n\t\tpanic(\"NextToken requires a non-nil input stream.\")\n\t}\n\n\ttokenStartMarker := b.input.Mark()\n\n\t// previously in finally block\n\tdefer func() {\n\t\t// make sure we release marker after Match or\n\t\t// unbuffered char stream will keep buffering\n\t\tb.input.Release(tokenStartMarker)\n\t}()\n\n\tfor {\n\t\tif b.hitEOF {\n\t\t\tb.EmitEOF()\n\t\t\treturn b.token\n\t\t}\n\t\tb.token = nil\n\t\tb.channel = TokenDefaultChannel\n\t\tb.TokenStartCharIndex = b.input.Index()\n\t\tb.TokenStartColumn = b.Interpreter.GetCharPositionInLine()\n\t\tb.TokenStartLine = b.Interpreter.GetLine()\n\t\tb.text = \"\"\n\t\tcontinueOuter := false\n\t\tfor {\n\t\t\tb.thetype = TokenInvalidType\n\n\t\t\tttype := b.safeMatch() // Defaults to LexerSkip\n\n\t\t\tif b.input.LA(1) == TokenEOF {\n\t\t\t\tb.hitEOF = true\n\t\t\t}\n\t\t\tif b.thetype == TokenInvalidType {\n\t\t\t\tb.thetype = ttype\n\t\t\t}\n\t\t\tif b.thetype == LexerSkip {\n\t\t\t\tcontinueOuter = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif b.thetype != LexerMore {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif continueOuter {\n\t\t\tcontinue\n\t\t}\n\t\tif b.token == nil {\n\t\t\tb.Virt.Emit()\n\t\t}\n\t\treturn b.token\n\t}\n}\n\n// Skip instructs the lexer to Skip creating a token for current lexer rule\n// and look for another token. [NextToken] knows to keep looking when\n// a lexer rule finishes with token set to [SKIPTOKEN]. Recall that\n// if token==nil at end of any token rule, it creates one for you\n// and emits it.\nfunc (b *BaseLexer) Skip() {\n\tb.thetype = LexerSkip\n}\n\nfunc (b *BaseLexer) More() {\n\tb.thetype = LexerMore\n}\n\n// SetMode changes the lexer to a new mode. The lexer will use this mode from hereon in and the rules for that mode\n// will be in force.\nfunc (b *BaseLexer) SetMode(m int) {\n\tb.mode = m\n}\n\n// PushMode saves the current lexer mode so that it can be restored later. See [PopMode], then sets the\n// current lexer mode to the supplied mode m.\nfunc (b *BaseLexer) PushMode(m int) {\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"pushMode \" + strconv.Itoa(m))\n\t}\n\tb.modeStack.Push(b.mode)\n\tb.mode = m\n}\n\n// PopMode restores the lexer mode saved by a call to [PushMode]. It is a panic error if there is no saved mode to\n// return to.\nfunc (b *BaseLexer) PopMode() int {\n\tif len(b.modeStack) == 0 {\n\t\tpanic(\"Empty Stack\")\n\t}\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"popMode back to \" + fmt.Sprint(b.modeStack[0:len(b.modeStack)-1]))\n\t}\n\ti, _ := b.modeStack.Pop()\n\tb.mode = i\n\treturn b.mode\n}\n\nfunc (b *BaseLexer) inputStream() CharStream {\n\treturn b.input\n}\n\n// SetInputStream resets the lexer input stream and associated lexer state.\nfunc (b *BaseLexer) SetInputStream(input CharStream) {\n\tb.input = nil\n\tb.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}\n\tb.Reset()\n\tb.input = input\n\tb.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}\n}\n\nfunc (b *BaseLexer) GetTokenSourceCharStreamPair() *TokenSourceCharStreamPair {\n\treturn b.tokenFactorySourcePair\n}\n\n// EmitToken by default does not support multiple emits per [NextToken] invocation\n// for efficiency reasons. Subclass and override this func, [NextToken],\n// and [GetToken] (to push tokens into a list and pull from that list\n// rather than a single variable as this implementation does).\nfunc (b *BaseLexer) EmitToken(token Token) {\n\tb.token = token\n}\n\n// Emit is the standard method called to automatically emit a token at the\n// outermost lexical rule. The token object should point into the\n// char buffer start..stop. If there is a text override in 'text',\n// use that to set the token's text. Override this method to emit\n// custom [Token] objects or provide a new factory.\n// /\nfunc (b *BaseLexer) Emit() Token {\n\tt := b.factory.Create(b.tokenFactorySourcePair, b.thetype, b.text, b.channel, b.TokenStartCharIndex, b.GetCharIndex()-1, b.TokenStartLine, b.TokenStartColumn)\n\tb.EmitToken(t)\n\treturn t\n}\n\n// EmitEOF emits an EOF token. By default, this is the last token emitted\nfunc (b *BaseLexer) EmitEOF() Token {\n\tcpos := b.GetCharPositionInLine()\n\tlpos := b.GetLine()\n\teof := b.factory.Create(b.tokenFactorySourcePair, TokenEOF, \"\", TokenDefaultChannel, b.input.Index(), b.input.Index()-1, lpos, cpos)\n\tb.EmitToken(eof)\n\treturn eof\n}\n\n// GetCharPositionInLine returns the current position in the current line as far as the lexer is concerned.\nfunc (b *BaseLexer) GetCharPositionInLine() int {\n\treturn b.Interpreter.GetCharPositionInLine()\n}\n\nfunc (b *BaseLexer) GetLine() int {\n\treturn b.Interpreter.GetLine()\n}\n\nfunc (b *BaseLexer) GetType() int {\n\treturn b.thetype\n}\n\nfunc (b *BaseLexer) SetType(t int) {\n\tb.thetype = t\n}\n\n// GetCharIndex returns the index of the current character of lookahead\nfunc (b *BaseLexer) GetCharIndex() int {\n\treturn b.input.Index()\n}\n\n// GetText returns the text Matched so far for the current token or any text override.\nfunc (b *BaseLexer) GetText() string {\n\tif b.text != \"\" {\n\t\treturn b.text\n\t}\n\n\treturn b.Interpreter.GetText(b.input)\n}\n\n// SetText sets the complete text of this token; it wipes any previous changes to the text.\nfunc (b *BaseLexer) SetText(text string) {\n\tb.text = text\n}\n\n// GetATN returns the ATN used by the lexer.\nfunc (b *BaseLexer) GetATN() *ATN {\n\treturn b.Interpreter.ATN()\n}\n\n// GetAllTokens returns a list of all [Token] objects in input char stream.\n// Forces a load of all tokens that can be made from the input char stream.\n//\n// Does not include EOF token.\nfunc (b *BaseLexer) GetAllTokens() []Token {\n\tvl := b.Virt\n\ttokens := make([]Token, 0)\n\tt := vl.NextToken()\n\tfor t.GetTokenType() != TokenEOF {\n\t\ttokens = append(tokens, t)\n\t\tt = vl.NextToken()\n\t}\n\treturn tokens\n}\n\nfunc (b *BaseLexer) notifyListeners(e RecognitionException) {\n\tstart := b.TokenStartCharIndex\n\tstop := b.input.Index()\n\ttext := b.input.GetTextFromInterval(NewInterval(start, stop))\n\tmsg := \"token recognition error at: '\" + text + \"'\"\n\tlistener := b.GetErrorListenerDispatch()\n\tlistener.SyntaxError(b, nil, b.TokenStartLine, b.TokenStartColumn, msg, e)\n}\n\nfunc (b *BaseLexer) getErrorDisplayForChar(c rune) string {\n\tif c == TokenEOF {\n\t\treturn \"<EOF>\"\n\t} else if c == '\\n' {\n\t\treturn \"\\\\n\"\n\t} else if c == '\\t' {\n\t\treturn \"\\\\t\"\n\t} else if c == '\\r' {\n\t\treturn \"\\\\r\"\n\t} else {\n\t\treturn string(c)\n\t}\n}\n\nfunc (b *BaseLexer) getCharErrorDisplay(c rune) string {\n\treturn \"'\" + b.getErrorDisplayForChar(c) + \"'\"\n}\n\n// Recover can normally Match any char in its vocabulary after Matching\n// a token, so here we do the easy thing and just kill a character and hope\n// it all works out. You can instead use the rule invocation stack\n// to do sophisticated error recovery if you are in a fragment rule.\n//\n// In general, lexers should not need to recover and should have rules that cover any eventuality, such as\n// a character that makes no sense to the recognizer.\nfunc (b *BaseLexer) Recover(re RecognitionException) {\n\tif b.input.LA(1) != TokenEOF {\n\t\tif _, ok := re.(*LexerNoViableAltException); ok {\n\t\t\t// Skip a char and try again\n\t\t\tb.Interpreter.Consume(b.input)\n\t\t} else {\n\t\t\t// TODO: Do we lose character or line position information?\n\t\t\tb.input.Consume()\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/lexer_action.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport \"strconv\"\n\nconst (\n\t// LexerActionTypeChannel represents a [LexerChannelAction] action.\n\tLexerActionTypeChannel = 0\n\n\t// LexerActionTypeCustom represents a [LexerCustomAction] action.\n\tLexerActionTypeCustom = 1\n\n\t// LexerActionTypeMode represents a [LexerModeAction] action.\n\tLexerActionTypeMode = 2\n\n\t// LexerActionTypeMore represents a [LexerMoreAction] action.\n\tLexerActionTypeMore = 3\n\n\t// LexerActionTypePopMode represents a [LexerPopModeAction] action.\n\tLexerActionTypePopMode = 4\n\n\t// LexerActionTypePushMode represents a [LexerPushModeAction] action.\n\tLexerActionTypePushMode = 5\n\n\t// LexerActionTypeSkip represents a [LexerSkipAction] action.\n\tLexerActionTypeSkip = 6\n\n\t// LexerActionTypeType represents a [LexerTypeAction] action.\n\tLexerActionTypeType = 7\n)\n\ntype LexerAction interface {\n\tgetActionType() int\n\tgetIsPositionDependent() bool\n\texecute(lexer Lexer)\n\tHash() int\n\tEquals(other LexerAction) bool\n}\n\ntype BaseLexerAction struct {\n\tactionType          int\n\tisPositionDependent bool\n}\n\nfunc NewBaseLexerAction(action int) *BaseLexerAction {\n\tla := new(BaseLexerAction)\n\n\tla.actionType = action\n\tla.isPositionDependent = false\n\n\treturn la\n}\n\nfunc (b *BaseLexerAction) execute(_ Lexer) {\n\tpanic(\"Not implemented\")\n}\n\nfunc (b *BaseLexerAction) getActionType() int {\n\treturn b.actionType\n}\n\nfunc (b *BaseLexerAction) getIsPositionDependent() bool {\n\treturn b.isPositionDependent\n}\n\nfunc (b *BaseLexerAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, b.actionType)\n\treturn murmurFinish(h, 1)\n}\n\nfunc (b *BaseLexerAction) Equals(other LexerAction) bool {\n\treturn b.actionType == other.getActionType()\n}\n\n// LexerSkipAction implements the [BaseLexerAction.Skip] lexer action by calling [Lexer.Skip].\n//\n// The Skip command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by the [LexerSkipActionINSTANCE].\ntype LexerSkipAction struct {\n\t*BaseLexerAction\n}\n\nfunc NewLexerSkipAction() *LexerSkipAction {\n\tla := new(LexerSkipAction)\n\tla.BaseLexerAction = NewBaseLexerAction(LexerActionTypeSkip)\n\treturn la\n}\n\n// LexerSkipActionINSTANCE provides a singleton instance of this parameterless lexer action.\nvar LexerSkipActionINSTANCE = NewLexerSkipAction()\n\nfunc (l *LexerSkipAction) execute(lexer Lexer) {\n\tlexer.Skip()\n}\n\n// String returns a string representation of the current [LexerSkipAction].\nfunc (l *LexerSkipAction) String() string {\n\treturn \"skip\"\n}\n\nfunc (b *LexerSkipAction) Equals(other LexerAction) bool {\n\treturn other.getActionType() == LexerActionTypeSkip\n}\n\n//\tImplements the {@code type} lexer action by calling {@link Lexer//setType}\n//\n// with the assigned type.\ntype LexerTypeAction struct {\n\t*BaseLexerAction\n\n\tthetype int\n}\n\nfunc NewLexerTypeAction(thetype int) *LexerTypeAction {\n\tl := new(LexerTypeAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypeType)\n\tl.thetype = thetype\n\treturn l\n}\n\nfunc (l *LexerTypeAction) execute(lexer Lexer) {\n\tlexer.SetType(l.thetype)\n}\n\nfunc (l *LexerTypeAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.actionType)\n\th = murmurUpdate(h, l.thetype)\n\treturn murmurFinish(h, 2)\n}\n\nfunc (l *LexerTypeAction) Equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerTypeAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.thetype == other.(*LexerTypeAction).thetype\n\t}\n}\n\nfunc (l *LexerTypeAction) String() string {\n\treturn \"actionType(\" + strconv.Itoa(l.thetype) + \")\"\n}\n\n// LexerPushModeAction implements the pushMode lexer action by calling\n// [Lexer.pushMode] with the assigned mode.\ntype LexerPushModeAction struct {\n\t*BaseLexerAction\n\tmode int\n}\n\nfunc NewLexerPushModeAction(mode int) *LexerPushModeAction {\n\n\tl := new(LexerPushModeAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypePushMode)\n\n\tl.mode = mode\n\treturn l\n}\n\n// <p>This action is implemented by calling {@link Lexer//pushMode} with the\n// value provided by {@link //getMode}.</p>\nfunc (l *LexerPushModeAction) execute(lexer Lexer) {\n\tlexer.PushMode(l.mode)\n}\n\nfunc (l *LexerPushModeAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.actionType)\n\th = murmurUpdate(h, l.mode)\n\treturn murmurFinish(h, 2)\n}\n\nfunc (l *LexerPushModeAction) Equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerPushModeAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.mode == other.(*LexerPushModeAction).mode\n\t}\n}\n\nfunc (l *LexerPushModeAction) String() string {\n\treturn \"pushMode(\" + strconv.Itoa(l.mode) + \")\"\n}\n\n// LexerPopModeAction implements the popMode lexer action by calling [Lexer.popMode].\n//\n// The popMode command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by [LexerPopModeActionINSTANCE]\ntype LexerPopModeAction struct {\n\t*BaseLexerAction\n}\n\nfunc NewLexerPopModeAction() *LexerPopModeAction {\n\n\tl := new(LexerPopModeAction)\n\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypePopMode)\n\n\treturn l\n}\n\nvar LexerPopModeActionINSTANCE = NewLexerPopModeAction()\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nfunc (l *LexerPopModeAction) execute(lexer Lexer) {\n\tlexer.PopMode()\n}\n\nfunc (l *LexerPopModeAction) String() string {\n\treturn \"popMode\"\n}\n\n// Implements the {@code more} lexer action by calling {@link Lexer//more}.\n//\n// <p>The {@code more} command does not have any parameters, so l action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\n\ntype LexerMoreAction struct {\n\t*BaseLexerAction\n}\n\nfunc NewLexerMoreAction() *LexerMoreAction {\n\tl := new(LexerMoreAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypeMore)\n\n\treturn l\n}\n\nvar LexerMoreActionINSTANCE = NewLexerMoreAction()\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nfunc (l *LexerMoreAction) execute(lexer Lexer) {\n\tlexer.More()\n}\n\nfunc (l *LexerMoreAction) String() string {\n\treturn \"more\"\n}\n\n// LexerModeAction implements the mode lexer action by calling [Lexer.mode] with\n// the assigned mode.\ntype LexerModeAction struct {\n\t*BaseLexerAction\n\tmode int\n}\n\nfunc NewLexerModeAction(mode int) *LexerModeAction {\n\tl := new(LexerModeAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypeMode)\n\tl.mode = mode\n\treturn l\n}\n\n// <p>This action is implemented by calling {@link Lexer//mode} with the\n// value provided by {@link //getMode}.</p>\nfunc (l *LexerModeAction) execute(lexer Lexer) {\n\tlexer.SetMode(l.mode)\n}\n\nfunc (l *LexerModeAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.actionType)\n\th = murmurUpdate(h, l.mode)\n\treturn murmurFinish(h, 2)\n}\n\nfunc (l *LexerModeAction) Equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerModeAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.mode == other.(*LexerModeAction).mode\n\t}\n}\n\nfunc (l *LexerModeAction) String() string {\n\treturn \"mode(\" + strconv.Itoa(l.mode) + \")\"\n}\n\n// Executes a custom lexer action by calling {@link Recognizer//action} with the\n// rule and action indexes assigned to the custom action. The implementation of\n// a custom action is added to the generated code for the lexer in an override\n// of {@link Recognizer//action} when the grammar is compiled.\n//\n// <p>This class may represent embedded actions created with the <code>{...}</code>\n// syntax in ANTLR 4, as well as actions created for lexer commands where the\n// command argument could not be evaluated when the grammar was compiled.</p>\n\n// Constructs a custom lexer action with the specified rule and action\n// indexes.\n//\n// @param ruleIndex The rule index to use for calls to\n// {@link Recognizer//action}.\n// @param actionIndex The action index to use for calls to\n// {@link Recognizer//action}.\n\ntype LexerCustomAction struct {\n\t*BaseLexerAction\n\truleIndex, actionIndex int\n}\n\nfunc NewLexerCustomAction(ruleIndex, actionIndex int) *LexerCustomAction {\n\tl := new(LexerCustomAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypeCustom)\n\tl.ruleIndex = ruleIndex\n\tl.actionIndex = actionIndex\n\tl.isPositionDependent = true\n\treturn l\n}\n\n// <p>Custom actions are implemented by calling {@link Lexer//action} with the\n// appropriate rule and action indexes.</p>\nfunc (l *LexerCustomAction) execute(lexer Lexer) {\n\tlexer.Action(nil, l.ruleIndex, l.actionIndex)\n}\n\nfunc (l *LexerCustomAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.actionType)\n\th = murmurUpdate(h, l.ruleIndex)\n\th = murmurUpdate(h, l.actionIndex)\n\treturn murmurFinish(h, 3)\n}\n\nfunc (l *LexerCustomAction) Equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerCustomAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.ruleIndex == other.(*LexerCustomAction).ruleIndex &&\n\t\t\tl.actionIndex == other.(*LexerCustomAction).actionIndex\n\t}\n}\n\n// LexerChannelAction implements the channel lexer action by calling\n// [Lexer.setChannel] with the assigned channel.\n//\n// Constructs a new channel action with the specified channel value.\ntype LexerChannelAction struct {\n\t*BaseLexerAction\n\tchannel int\n}\n\n// NewLexerChannelAction creates a channel lexer action by calling\n// [Lexer.setChannel] with the assigned channel.\n//\n// Constructs a new channel action with the specified channel value.\nfunc NewLexerChannelAction(channel int) *LexerChannelAction {\n\tl := new(LexerChannelAction)\n\tl.BaseLexerAction = NewBaseLexerAction(LexerActionTypeChannel)\n\tl.channel = channel\n\treturn l\n}\n\n// <p>This action is implemented by calling {@link Lexer//setChannel} with the\n// value provided by {@link //getChannel}.</p>\nfunc (l *LexerChannelAction) execute(lexer Lexer) {\n\tlexer.SetChannel(l.channel)\n}\n\nfunc (l *LexerChannelAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.actionType)\n\th = murmurUpdate(h, l.channel)\n\treturn murmurFinish(h, 2)\n}\n\nfunc (l *LexerChannelAction) Equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerChannelAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.channel == other.(*LexerChannelAction).channel\n\t}\n}\n\nfunc (l *LexerChannelAction) String() string {\n\treturn \"channel(\" + strconv.Itoa(l.channel) + \")\"\n}\n\n// This implementation of {@link LexerAction} is used for tracking input offsets\n// for position-dependent actions within a {@link LexerActionExecutor}.\n//\n// <p>This action is not serialized as part of the ATN, and is only required for\n// position-dependent lexer actions which appear at a location other than the\n// end of a rule. For more information about DFA optimizations employed for\n// lexer actions, see {@link LexerActionExecutor//append} and\n// {@link LexerActionExecutor//fixOffsetBeforeMatch}.</p>\n\ntype LexerIndexedCustomAction struct {\n\t*BaseLexerAction\n\toffset              int\n\tlexerAction         LexerAction\n\tisPositionDependent bool\n}\n\n// NewLexerIndexedCustomAction constructs a new indexed custom action by associating a character offset\n// with a [LexerAction].\n//\n// Note: This class is only required for lexer actions for which\n// [LexerAction.isPositionDependent] returns true.\n//\n// The offset points into the input [CharStream], relative to\n// the token start index, at which the specified lexerAction should be\n// executed.\nfunc NewLexerIndexedCustomAction(offset int, lexerAction LexerAction) *LexerIndexedCustomAction {\n\n\tl := new(LexerIndexedCustomAction)\n\tl.BaseLexerAction = NewBaseLexerAction(lexerAction.getActionType())\n\n\tl.offset = offset\n\tl.lexerAction = lexerAction\n\tl.isPositionDependent = true\n\n\treturn l\n}\n\n// <p>This method calls {@link //execute} on the result of {@link //getAction}\n// using the provided {@code lexer}.</p>\nfunc (l *LexerIndexedCustomAction) execute(lexer Lexer) {\n\t// assume the input stream position was properly set by the calling code\n\tl.lexerAction.execute(lexer)\n}\n\nfunc (l *LexerIndexedCustomAction) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, l.offset)\n\th = murmurUpdate(h, l.lexerAction.Hash())\n\treturn murmurFinish(h, 2)\n}\n\nfunc (l *LexerIndexedCustomAction) equals(other LexerAction) bool {\n\tif l == other {\n\t\treturn true\n\t} else if _, ok := other.(*LexerIndexedCustomAction); !ok {\n\t\treturn false\n\t} else {\n\t\treturn l.offset == other.(*LexerIndexedCustomAction).offset &&\n\t\t\tl.lexerAction.Equals(other.(*LexerIndexedCustomAction).lexerAction)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport \"golang.org/x/exp/slices\"\n\n// Represents an executor for a sequence of lexer actions which traversed during\n// the Matching operation of a lexer rule (token).\n//\n// <p>The executor tracks position information for position-dependent lexer actions\n// efficiently, ensuring that actions appearing only at the end of the rule do\n// not cause bloating of the {@link DFA} created for the lexer.</p>\n\ntype LexerActionExecutor struct {\n\tlexerActions []LexerAction\n\tcachedHash   int\n}\n\nfunc NewLexerActionExecutor(lexerActions []LexerAction) *LexerActionExecutor {\n\n\tif lexerActions == nil {\n\t\tlexerActions = make([]LexerAction, 0)\n\t}\n\n\tl := new(LexerActionExecutor)\n\n\tl.lexerActions = lexerActions\n\n\t// Caches the result of {@link //hashCode} since the hash code is an element\n\t// of the performance-critical {@link ATNConfig//hashCode} operation.\n\tl.cachedHash = murmurInit(0)\n\tfor _, a := range lexerActions {\n\t\tl.cachedHash = murmurUpdate(l.cachedHash, a.Hash())\n\t}\n\tl.cachedHash = murmurFinish(l.cachedHash, len(lexerActions))\n\n\treturn l\n}\n\n// LexerActionExecutorappend creates a [LexerActionExecutor] which executes the actions for\n// the input [LexerActionExecutor] followed by a specified\n// [LexerAction].\n// TODO: This does not match the Java code\nfunc LexerActionExecutorappend(lexerActionExecutor *LexerActionExecutor, lexerAction LexerAction) *LexerActionExecutor {\n\tif lexerActionExecutor == nil {\n\t\treturn NewLexerActionExecutor([]LexerAction{lexerAction})\n\t}\n\n\treturn NewLexerActionExecutor(append(lexerActionExecutor.lexerActions, lexerAction))\n}\n\n// fixOffsetBeforeMatch creates a [LexerActionExecutor] which encodes the current offset\n// for position-dependent lexer actions.\n//\n// Normally, when the executor encounters lexer actions where\n// [LexerAction.isPositionDependent] returns true, it calls\n// [IntStream.Seek] on the input [CharStream] to set the input\n// position to the end of the current token. This behavior provides\n// for efficient [DFA] representation of lexer actions which appear at the end\n// of a lexer rule, even when the lexer rule Matches a variable number of\n// characters.\n//\n// Prior to traversing a Match transition in the [ATN], the current offset\n// from the token start index is assigned to all position-dependent lexer\n// actions which have not already been assigned a fixed offset. By storing\n// the offsets relative to the token start index, the [DFA] representation of\n// lexer actions which appear in the middle of tokens remains efficient due\n// to sharing among tokens of the same Length, regardless of their absolute\n// position in the input stream.\n//\n// If the current executor already has offsets assigned to all\n// position-dependent lexer actions, the method returns this instance.\n//\n// The offset is assigned to all position-dependent\n// lexer actions which do not already have offsets assigned.\n//\n// The func returns a [LexerActionExecutor] that stores input stream offsets\n// for all position-dependent lexer actions.\nfunc (l *LexerActionExecutor) fixOffsetBeforeMatch(offset int) *LexerActionExecutor {\n\tvar updatedLexerActions []LexerAction\n\tfor i := 0; i < len(l.lexerActions); i++ {\n\t\t_, ok := l.lexerActions[i].(*LexerIndexedCustomAction)\n\t\tif l.lexerActions[i].getIsPositionDependent() && !ok {\n\t\t\tif updatedLexerActions == nil {\n\t\t\t\tupdatedLexerActions = make([]LexerAction, 0, len(l.lexerActions))\n\t\t\t\tupdatedLexerActions = append(updatedLexerActions, l.lexerActions...)\n\t\t\t}\n\t\t\tupdatedLexerActions[i] = NewLexerIndexedCustomAction(offset, l.lexerActions[i])\n\t\t}\n\t}\n\tif updatedLexerActions == nil {\n\t\treturn l\n\t}\n\n\treturn NewLexerActionExecutor(updatedLexerActions)\n}\n\n// Execute the actions encapsulated by l executor within the context of a\n// particular {@link Lexer}.\n//\n// <p>This method calls {@link IntStream//seek} to set the position of the\n// {@code input} {@link CharStream} prior to calling\n// {@link LexerAction//execute} on a position-dependent action. Before the\n// method returns, the input position will be restored to the same position\n// it was in when the method was invoked.</p>\n//\n// @param lexer The lexer instance.\n// @param input The input stream which is the source for the current token.\n// When l method is called, the current {@link IntStream//index} for\n// {@code input} should be the start of the following token, i.e. 1\n// character past the end of the current token.\n// @param startIndex The token start index. This value may be passed to\n// {@link IntStream//seek} to set the {@code input} position to the beginning\n// of the token.\n// /\nfunc (l *LexerActionExecutor) execute(lexer Lexer, input CharStream, startIndex int) {\n\trequiresSeek := false\n\tstopIndex := input.Index()\n\n\tdefer func() {\n\t\tif requiresSeek {\n\t\t\tinput.Seek(stopIndex)\n\t\t}\n\t}()\n\n\tfor i := 0; i < len(l.lexerActions); i++ {\n\t\tlexerAction := l.lexerActions[i]\n\t\tif la, ok := lexerAction.(*LexerIndexedCustomAction); ok {\n\t\t\toffset := la.offset\n\t\t\tinput.Seek(startIndex + offset)\n\t\t\tlexerAction = la.lexerAction\n\t\t\trequiresSeek = (startIndex + offset) != stopIndex\n\t\t} else if lexerAction.getIsPositionDependent() {\n\t\t\tinput.Seek(stopIndex)\n\t\t\trequiresSeek = false\n\t\t}\n\t\tlexerAction.execute(lexer)\n\t}\n}\n\nfunc (l *LexerActionExecutor) Hash() int {\n\tif l == nil {\n\t\t// TODO: Why is this here? l should not be nil\n\t\treturn 61\n\t}\n\n\t// TODO: This is created from the action itself when the struct is created - will this be an issue at some point? Java uses the runtime assign hashcode\n\treturn l.cachedHash\n}\n\nfunc (l *LexerActionExecutor) Equals(other interface{}) bool {\n\tif l == other {\n\t\treturn true\n\t}\n\tothert, ok := other.(*LexerActionExecutor)\n\tif !ok {\n\t\treturn false\n\t}\n\tif othert == nil {\n\t\treturn false\n\t}\n\tif l.cachedHash != othert.cachedHash {\n\t\treturn false\n\t}\n\tif len(l.lexerActions) != len(othert.lexerActions) {\n\t\treturn false\n\t}\n\treturn slices.EqualFunc(l.lexerActions, othert.lexerActions, func(i, j LexerAction) bool {\n\t\treturn i.Equals(j)\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n//goland:noinspection GoUnusedGlobalVariable\nvar (\n\tLexerATNSimulatorMinDFAEdge = 0\n\tLexerATNSimulatorMaxDFAEdge = 127 // forces unicode to stay in ATN\n\n\tLexerATNSimulatorMatchCalls = 0\n)\n\ntype ILexerATNSimulator interface {\n\tIATNSimulator\n\n\treset()\n\tMatch(input CharStream, mode int) int\n\tGetCharPositionInLine() int\n\tGetLine() int\n\tGetText(input CharStream) string\n\tConsume(input CharStream)\n}\n\ntype LexerATNSimulator struct {\n\tBaseATNSimulator\n\n\trecog              Lexer\n\tpredictionMode     int\n\tmergeCache         *JPCMap2\n\tstartIndex         int\n\tLine               int\n\tCharPositionInLine int\n\tmode               int\n\tprevAccept         *SimState\n\tMatchCalls         int\n}\n\nfunc NewLexerATNSimulator(recog Lexer, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *LexerATNSimulator {\n\tl := &LexerATNSimulator{\n\t\tBaseATNSimulator: BaseATNSimulator{\n\t\t\tatn:                atn,\n\t\t\tsharedContextCache: sharedContextCache,\n\t\t},\n\t}\n\n\tl.decisionToDFA = decisionToDFA\n\tl.recog = recog\n\n\t// The current token's starting index into the character stream.\n\t// Shared across DFA to ATN simulation in case the ATN fails and the\n\t// DFA did not have a previous accept state. In l case, we use the\n\t// ATN-generated exception object.\n\tl.startIndex = -1\n\n\t// line number 1..n within the input\n\tl.Line = 1\n\n\t// The index of the character relative to the beginning of the line\n\t// 0..n-1\n\tl.CharPositionInLine = 0\n\n\tl.mode = LexerDefaultMode\n\n\t// Used during DFA/ATN exec to record the most recent accept configuration\n\t// info\n\tl.prevAccept = NewSimState()\n\n\treturn l\n}\n\nfunc (l *LexerATNSimulator) copyState(simulator *LexerATNSimulator) {\n\tl.CharPositionInLine = simulator.CharPositionInLine\n\tl.Line = simulator.Line\n\tl.mode = simulator.mode\n\tl.startIndex = simulator.startIndex\n}\n\nfunc (l *LexerATNSimulator) Match(input CharStream, mode int) int {\n\tl.MatchCalls++\n\tl.mode = mode\n\tmark := input.Mark()\n\n\tdefer func() {\n\t\tinput.Release(mark)\n\t}()\n\n\tl.startIndex = input.Index()\n\tl.prevAccept.reset()\n\n\tdfa := l.decisionToDFA[mode]\n\n\tvar s0 *DFAState\n\tl.atn.stateMu.RLock()\n\ts0 = dfa.getS0()\n\tl.atn.stateMu.RUnlock()\n\n\tif s0 == nil {\n\t\treturn l.MatchATN(input)\n\t}\n\n\treturn l.execATN(input, s0)\n}\n\nfunc (l *LexerATNSimulator) reset() {\n\tl.prevAccept.reset()\n\tl.startIndex = -1\n\tl.Line = 1\n\tl.CharPositionInLine = 0\n\tl.mode = LexerDefaultMode\n}\n\nfunc (l *LexerATNSimulator) MatchATN(input CharStream) int {\n\tstartState := l.atn.modeToStartState[l.mode]\n\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"MatchATN mode \" + strconv.Itoa(l.mode) + \" start: \" + startState.String())\n\t}\n\toldMode := l.mode\n\ts0Closure := l.computeStartState(input, startState)\n\tsuppressEdge := s0Closure.hasSemanticContext\n\ts0Closure.hasSemanticContext = false\n\n\tnext := l.addDFAState(s0Closure, suppressEdge)\n\n\tpredict := l.execATN(input, next)\n\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"DFA after MatchATN: \" + l.decisionToDFA[oldMode].ToLexerString())\n\t}\n\treturn predict\n}\n\nfunc (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int {\n\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"start state closure=\" + ds0.configs.String())\n\t}\n\tif ds0.isAcceptState {\n\t\t// allow zero-Length tokens\n\t\tl.captureSimState(l.prevAccept, input, ds0)\n\t}\n\tt := input.LA(1)\n\ts := ds0 // s is current/from DFA state\n\n\tfor { // while more work\n\t\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\t\tfmt.Println(\"execATN loop starting closure: \" + s.configs.String())\n\t\t}\n\n\t\t// As we move src->trg, src->trg, we keep track of the previous trg to\n\t\t// avoid looking up the DFA state again, which is expensive.\n\t\t// If the previous target was already part of the DFA, we might\n\t\t// be able to avoid doing a reach operation upon t. If s!=nil,\n\t\t// it means that semantic predicates didn't prevent us from\n\t\t// creating a DFA state. Once we know s!=nil, we check to see if\n\t\t// the DFA state has an edge already for t. If so, we can just reuse\n\t\t// it's configuration set there's no point in re-computing it.\n\t\t// This is kind of like doing DFA simulation within the ATN\n\t\t// simulation because DFA simulation is really just a way to avoid\n\t\t// computing reach/closure sets. Technically, once we know that\n\t\t// we have a previously added DFA state, we could jump over to\n\t\t// the DFA simulator. But, that would mean popping back and forth\n\t\t// a lot and making things more complicated algorithmically.\n\t\t// This optimization makes a lot of sense for loops within DFA.\n\t\t// A character will take us back to an existing DFA state\n\t\t// that already has lots of edges out of it. e.g., .* in comments.\n\t\ttarget := l.getExistingTargetState(s, t)\n\t\tif target == nil {\n\t\t\ttarget = l.computeTargetState(input, s, t)\n\t\t\t// print(\"Computed:\" + str(target))\n\t\t}\n\t\tif target == ATNSimulatorError {\n\t\t\tbreak\n\t\t}\n\t\t// If l is a consumable input element, make sure to consume before\n\t\t// capturing the accept state so the input index, line, and char\n\t\t// position accurately reflect the state of the interpreter at the\n\t\t// end of the token.\n\t\tif t != TokenEOF {\n\t\t\tl.Consume(input)\n\t\t}\n\t\tif target.isAcceptState {\n\t\t\tl.captureSimState(l.prevAccept, input, target)\n\t\t\tif t == TokenEOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tt = input.LA(1)\n\t\ts = target // flip current DFA target becomes new src/from state\n\t}\n\n\treturn l.failOrAccept(l.prevAccept, input, s.configs, t)\n}\n\n// Get an existing target state for an edge in the DFA. If the target state\n// for the edge has not yet been computed or is otherwise not available,\n// l method returns {@code nil}.\n//\n// @param s The current DFA state\n// @param t The next input symbol\n// @return The existing target DFA state for the given input symbol\n// {@code t}, or {@code nil} if the target state for l edge is not\n// already cached\nfunc (l *LexerATNSimulator) getExistingTargetState(s *DFAState, t int) *DFAState {\n\tif t < LexerATNSimulatorMinDFAEdge || t > LexerATNSimulatorMaxDFAEdge {\n\t\treturn nil\n\t}\n\n\tl.atn.edgeMu.RLock()\n\tdefer l.atn.edgeMu.RUnlock()\n\tif s.getEdges() == nil {\n\t\treturn nil\n\t}\n\ttarget := s.getIthEdge(t - LexerATNSimulatorMinDFAEdge)\n\tif runtimeConfig.lexerATNSimulatorDebug && target != nil {\n\t\tfmt.Println(\"reuse state \" + strconv.Itoa(s.stateNumber) + \" edge to \" + strconv.Itoa(target.stateNumber))\n\t}\n\treturn target\n}\n\n// computeTargetState computes a target state for an edge in the [DFA], and attempt to add the\n// computed state and corresponding edge to the [DFA].\n//\n// The func returns the computed target [DFA] state for the given input symbol t.\n// If this does not lead to a valid [DFA] state, this method\n// returns ATNSimulatorError.\nfunc (l *LexerATNSimulator) computeTargetState(input CharStream, s *DFAState, t int) *DFAState {\n\treach := NewOrderedATNConfigSet()\n\n\t// if we don't find an existing DFA state\n\t// Fill reach starting from closure, following t transitions\n\tl.getReachableConfigSet(input, s.configs, reach, t)\n\n\tif len(reach.configs) == 0 { // we got nowhere on t from s\n\t\tif !reach.hasSemanticContext {\n\t\t\t// we got nowhere on t, don't panic out l knowledge it'd\n\t\t\t// cause a fail-over from DFA later.\n\t\t\tl.addDFAEdge(s, t, ATNSimulatorError, nil)\n\t\t}\n\t\t// stop when we can't Match any more char\n\t\treturn ATNSimulatorError\n\t}\n\t// Add an edge from s to target DFA found/created for reach\n\treturn l.addDFAEdge(s, t, nil, reach)\n}\n\nfunc (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream, reach *ATNConfigSet, t int) int {\n\tif l.prevAccept.dfaState != nil {\n\t\tlexerActionExecutor := prevAccept.dfaState.lexerActionExecutor\n\t\tl.accept(input, lexerActionExecutor, l.startIndex, prevAccept.index, prevAccept.line, prevAccept.column)\n\t\treturn prevAccept.dfaState.prediction\n\t}\n\n\t// if no accept and EOF is first char, return EOF\n\tif t == TokenEOF && input.Index() == l.startIndex {\n\t\treturn TokenEOF\n\t}\n\n\tpanic(NewLexerNoViableAltException(l.recog, input, l.startIndex, reach))\n}\n\n// getReachableConfigSet when given a starting configuration set, figures out all [ATN] configurations\n// we can reach upon input t.\n//\n// Parameter reach is a return parameter.\nfunc (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure *ATNConfigSet, reach *ATNConfigSet, t int) {\n\t// l is used to Skip processing for configs which have a lower priority\n\t// than a runtimeConfig that already reached an accept state for the same rule\n\tSkipAlt := ATNInvalidAltNumber\n\n\tfor _, cfg := range closure.configs {\n\t\tcurrentAltReachedAcceptState := cfg.GetAlt() == SkipAlt\n\t\tif currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision {\n\t\t\tcontinue\n\t\t}\n\n\t\tif runtimeConfig.lexerATNSimulatorDebug {\n\n\t\t\tfmt.Printf(\"testing %s at %s\\n\", l.GetTokenName(t), cfg.String())\n\t\t}\n\n\t\tfor _, trans := range cfg.GetState().GetTransitions() {\n\t\t\ttarget := l.getReachableTarget(trans, t)\n\t\t\tif target != nil {\n\t\t\t\tlexerActionExecutor := cfg.lexerActionExecutor\n\t\t\t\tif lexerActionExecutor != nil {\n\t\t\t\t\tlexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.Index() - l.startIndex)\n\t\t\t\t}\n\t\t\t\ttreatEOFAsEpsilon := t == TokenEOF\n\t\t\t\tconfig := NewLexerATNConfig3(cfg, target, lexerActionExecutor)\n\t\t\t\tif l.closure(input, config, reach,\n\t\t\t\t\tcurrentAltReachedAcceptState, true, treatEOFAsEpsilon) {\n\t\t\t\t\t// any remaining configs for l alt have a lower priority\n\t\t\t\t\t// than the one that just reached an accept state.\n\t\t\t\t\tSkipAlt = cfg.GetAlt()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (l *LexerATNSimulator) accept(input CharStream, lexerActionExecutor *LexerActionExecutor, startIndex, index, line, charPos int) {\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Printf(\"ACTION %v\\n\", lexerActionExecutor)\n\t}\n\t// seek to after last char in token\n\tinput.Seek(index)\n\tl.Line = line\n\tl.CharPositionInLine = charPos\n\tif lexerActionExecutor != nil && l.recog != nil {\n\t\tlexerActionExecutor.execute(l.recog, input, startIndex)\n\t}\n}\n\nfunc (l *LexerATNSimulator) getReachableTarget(trans Transition, t int) ATNState {\n\tif trans.Matches(t, 0, LexerMaxCharValue) {\n\t\treturn trans.getTarget()\n\t}\n\n\treturn nil\n}\n\nfunc (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *ATNConfigSet {\n\tconfigs := NewOrderedATNConfigSet()\n\tfor i := 0; i < len(p.GetTransitions()); i++ {\n\t\ttarget := p.GetTransitions()[i].getTarget()\n\t\tcfg := NewLexerATNConfig6(target, i+1, BasePredictionContextEMPTY)\n\t\tl.closure(input, cfg, configs, false, false, false)\n\t}\n\n\treturn configs\n}\n\n// closure since the alternatives within any lexer decision are ordered by\n// preference, this method stops pursuing the closure as soon as an accept\n// state is reached. After the first accept state is reached by depth-first\n// search from runtimeConfig, all other (potentially reachable) states for\n// this rule would have a lower priority.\n//\n// The func returns true if an accept state is reached.\nfunc (l *LexerATNSimulator) closure(input CharStream, config *ATNConfig, configs *ATNConfigSet,\n\tcurrentAltReachedAcceptState, speculative, treatEOFAsEpsilon bool) bool {\n\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"closure(\" + config.String() + \")\")\n\t}\n\n\t_, ok := config.state.(*RuleStopState)\n\tif ok {\n\n\t\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\t\tif l.recog != nil {\n\t\t\t\tfmt.Printf(\"closure at %s rule stop %s\\n\", l.recog.GetRuleNames()[config.state.GetRuleIndex()], config)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"closure at rule stop %s\\n\", config)\n\t\t\t}\n\t\t}\n\n\t\tif config.context == nil || config.context.hasEmptyPath() {\n\t\t\tif config.context == nil || config.context.isEmpty() {\n\t\t\t\tconfigs.Add(config, nil)\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tconfigs.Add(NewLexerATNConfig2(config, config.state, BasePredictionContextEMPTY), nil)\n\t\t\tcurrentAltReachedAcceptState = true\n\t\t}\n\t\tif config.context != nil && !config.context.isEmpty() {\n\t\t\tfor i := 0; i < config.context.length(); i++ {\n\t\t\t\tif config.context.getReturnState(i) != BasePredictionContextEmptyReturnState {\n\t\t\t\t\tnewContext := config.context.GetParent(i) // \"pop\" return state\n\t\t\t\t\treturnState := l.atn.states[config.context.getReturnState(i)]\n\t\t\t\t\tcfg := NewLexerATNConfig2(config, returnState, newContext)\n\t\t\t\t\tcurrentAltReachedAcceptState = l.closure(input, cfg, configs, currentAltReachedAcceptState, speculative, treatEOFAsEpsilon)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentAltReachedAcceptState\n\t}\n\t// optimization\n\tif !config.state.GetEpsilonOnlyTransitions() {\n\t\tif !currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision {\n\t\t\tconfigs.Add(config, nil)\n\t\t}\n\t}\n\tfor j := 0; j < len(config.state.GetTransitions()); j++ {\n\t\ttrans := config.state.GetTransitions()[j]\n\t\tcfg := l.getEpsilonTarget(input, config, trans, configs, speculative, treatEOFAsEpsilon)\n\t\tif cfg != nil {\n\t\t\tcurrentAltReachedAcceptState = l.closure(input, cfg, configs,\n\t\t\t\tcurrentAltReachedAcceptState, speculative, treatEOFAsEpsilon)\n\t\t}\n\t}\n\treturn currentAltReachedAcceptState\n}\n\n// side-effect: can alter configs.hasSemanticContext\nfunc (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *ATNConfig, trans Transition,\n\tconfigs *ATNConfigSet, speculative, treatEOFAsEpsilon bool) *ATNConfig {\n\n\tvar cfg *ATNConfig\n\n\tif trans.getSerializationType() == TransitionRULE {\n\n\t\trt := trans.(*RuleTransition)\n\t\tnewContext := SingletonBasePredictionContextCreate(config.context, rt.followState.GetStateNumber())\n\t\tcfg = NewLexerATNConfig2(config, trans.getTarget(), newContext)\n\n\t} else if trans.getSerializationType() == TransitionPRECEDENCE {\n\t\tpanic(\"Precedence predicates are not supported in lexers.\")\n\t} else if trans.getSerializationType() == TransitionPREDICATE {\n\t\t// Track traversing semantic predicates. If we traverse,\n\t\t// we cannot add a DFA state for l \"reach\" computation\n\t\t// because the DFA would not test the predicate again in the\n\t\t// future. Rather than creating collections of semantic predicates\n\t\t// like v3 and testing them on prediction, v4 will test them on the\n\t\t// fly all the time using the ATN not the DFA. This is slower but\n\t\t// semantically it's not used that often. One of the key elements to\n\t\t// l predicate mechanism is not adding DFA states that see\n\t\t// predicates immediately afterwards in the ATN. For example,\n\n\t\t// a : ID {p1}? | ID {p2}?\n\n\t\t// should create the start state for rule 'a' (to save start state\n\t\t// competition), but should not create target of ID state. The\n\t\t// collection of ATN states the following ID references includes\n\t\t// states reached by traversing predicates. Since l is when we\n\t\t// test them, we cannot cash the DFA state target of ID.\n\n\t\tpt := trans.(*PredicateTransition)\n\n\t\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\t\tfmt.Println(\"EVAL rule \" + strconv.Itoa(trans.(*PredicateTransition).ruleIndex) + \":\" + strconv.Itoa(pt.predIndex))\n\t\t}\n\t\tconfigs.hasSemanticContext = true\n\t\tif l.evaluatePredicate(input, pt.ruleIndex, pt.predIndex, speculative) {\n\t\t\tcfg = NewLexerATNConfig4(config, trans.getTarget())\n\t\t}\n\t} else if trans.getSerializationType() == TransitionACTION {\n\t\tif config.context == nil || config.context.hasEmptyPath() {\n\t\t\t// execute actions anywhere in the start rule for a token.\n\t\t\t//\n\t\t\t// TODO: if the entry rule is invoked recursively, some\n\t\t\t// actions may be executed during the recursive call. The\n\t\t\t// problem can appear when hasEmptyPath() is true but\n\t\t\t// isEmpty() is false. In this case, the config needs to be\n\t\t\t// split into two contexts - one with just the empty path\n\t\t\t// and another with everything but the empty path.\n\t\t\t// Unfortunately, the current algorithm does not allow\n\t\t\t// getEpsilonTarget to return two configurations, so\n\t\t\t// additional modifications are needed before we can support\n\t\t\t// the split operation.\n\t\t\tlexerActionExecutor := LexerActionExecutorappend(config.lexerActionExecutor, l.atn.lexerActions[trans.(*ActionTransition).actionIndex])\n\t\t\tcfg = NewLexerATNConfig3(config, trans.getTarget(), lexerActionExecutor)\n\t\t} else {\n\t\t\t// ignore actions in referenced rules\n\t\t\tcfg = NewLexerATNConfig4(config, trans.getTarget())\n\t\t}\n\t} else if trans.getSerializationType() == TransitionEPSILON {\n\t\tcfg = NewLexerATNConfig4(config, trans.getTarget())\n\t} else if trans.getSerializationType() == TransitionATOM ||\n\t\ttrans.getSerializationType() == TransitionRANGE ||\n\t\ttrans.getSerializationType() == TransitionSET {\n\t\tif treatEOFAsEpsilon {\n\t\t\tif trans.Matches(TokenEOF, 0, LexerMaxCharValue) {\n\t\t\t\tcfg = NewLexerATNConfig4(config, trans.getTarget())\n\t\t\t}\n\t\t}\n\t}\n\treturn cfg\n}\n\n// evaluatePredicate eEvaluates a predicate specified in the lexer.\n//\n// If speculative is true, this method was called before\n// [consume] for the Matched character. This method should call\n// [consume] before evaluating the predicate to ensure position\n// sensitive values, including [GetText], [GetLine],\n// and [GetColumn], properly reflect the current\n// lexer state. This method should restore input and the simulator\n// to the original state before returning, i.e. undo the actions made by the\n// call to [Consume].\n//\n// The func returns true if the specified predicate evaluates to true.\nfunc (l *LexerATNSimulator) evaluatePredicate(input CharStream, ruleIndex, predIndex int, speculative bool) bool {\n\t// assume true if no recognizer was provided\n\tif l.recog == nil {\n\t\treturn true\n\t}\n\tif !speculative {\n\t\treturn l.recog.Sempred(nil, ruleIndex, predIndex)\n\t}\n\tsavedcolumn := l.CharPositionInLine\n\tsavedLine := l.Line\n\tindex := input.Index()\n\tmarker := input.Mark()\n\n\tdefer func() {\n\t\tl.CharPositionInLine = savedcolumn\n\t\tl.Line = savedLine\n\t\tinput.Seek(index)\n\t\tinput.Release(marker)\n\t}()\n\n\tl.Consume(input)\n\treturn l.recog.Sempred(nil, ruleIndex, predIndex)\n}\n\nfunc (l *LexerATNSimulator) captureSimState(settings *SimState, input CharStream, dfaState *DFAState) {\n\tsettings.index = input.Index()\n\tsettings.line = l.Line\n\tsettings.column = l.CharPositionInLine\n\tsettings.dfaState = dfaState\n}\n\nfunc (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfgs *ATNConfigSet) *DFAState {\n\tif to == nil && cfgs != nil {\n\t\t// leading to l call, ATNConfigSet.hasSemanticContext is used as a\n\t\t// marker indicating dynamic predicate evaluation makes l edge\n\t\t// dependent on the specific input sequence, so the static edge in the\n\t\t// DFA should be omitted. The target DFAState is still created since\n\t\t// execATN has the ability to reSynchronize with the DFA state cache\n\t\t// following the predicate evaluation step.\n\t\t//\n\t\t// TJP notes: next time through the DFA, we see a pred again and eval.\n\t\t// If that gets us to a previously created (but dangling) DFA\n\t\t// state, we can continue in pure DFA mode from there.\n\t\t//\n\t\tsuppressEdge := cfgs.hasSemanticContext\n\t\tcfgs.hasSemanticContext = false\n\t\tto = l.addDFAState(cfgs, true)\n\n\t\tif suppressEdge {\n\t\t\treturn to\n\t\t}\n\t}\n\t// add the edge\n\tif tk < LexerATNSimulatorMinDFAEdge || tk > LexerATNSimulatorMaxDFAEdge {\n\t\t// Only track edges within the DFA bounds\n\t\treturn to\n\t}\n\tif runtimeConfig.lexerATNSimulatorDebug {\n\t\tfmt.Println(\"EDGE \" + from.String() + \" -> \" + to.String() + \" upon \" + strconv.Itoa(tk))\n\t}\n\tl.atn.edgeMu.Lock()\n\tdefer l.atn.edgeMu.Unlock()\n\tif from.getEdges() == nil {\n\t\t// make room for tokens 1..n and -1 masquerading as index 0\n\t\tfrom.setEdges(make([]*DFAState, LexerATNSimulatorMaxDFAEdge-LexerATNSimulatorMinDFAEdge+1))\n\t}\n\tfrom.setIthEdge(tk-LexerATNSimulatorMinDFAEdge, to) // connect\n\n\treturn to\n}\n\n// Add a NewDFA state if there isn't one with l set of\n// configurations already. This method also detects the first\n// configuration containing an ATN rule stop state. Later, when\n// traversing the DFA, we will know which rule to accept.\nfunc (l *LexerATNSimulator) addDFAState(configs *ATNConfigSet, suppressEdge bool) *DFAState {\n\n\tproposed := NewDFAState(-1, configs)\n\tvar firstConfigWithRuleStopState *ATNConfig\n\n\tfor _, cfg := range configs.configs {\n\t\t_, ok := cfg.GetState().(*RuleStopState)\n\n\t\tif ok {\n\t\t\tfirstConfigWithRuleStopState = cfg\n\t\t\tbreak\n\t\t}\n\t}\n\tif firstConfigWithRuleStopState != nil {\n\t\tproposed.isAcceptState = true\n\t\tproposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor\n\t\tproposed.setPrediction(l.atn.ruleToTokenType[firstConfigWithRuleStopState.GetState().GetRuleIndex()])\n\t}\n\tdfa := l.decisionToDFA[l.mode]\n\n\tl.atn.stateMu.Lock()\n\tdefer l.atn.stateMu.Unlock()\n\texisting, present := dfa.Get(proposed)\n\tif present {\n\n\t\t// This state was already present, so just return it.\n\t\t//\n\t\tproposed = existing\n\t} else {\n\n\t\t// We need to add the new state\n\t\t//\n\t\tproposed.stateNumber = dfa.Len()\n\t\tconfigs.readOnly = true\n\t\tconfigs.configLookup = nil // Not needed now\n\t\tproposed.configs = configs\n\t\tdfa.Put(proposed)\n\t}\n\tif !suppressEdge {\n\t\tdfa.setS0(proposed)\n\t}\n\treturn proposed\n}\n\nfunc (l *LexerATNSimulator) getDFA(mode int) *DFA {\n\treturn l.decisionToDFA[mode]\n}\n\n// GetText returns the text [Match]ed so far for the current token.\nfunc (l *LexerATNSimulator) GetText(input CharStream) string {\n\t// index is first lookahead char, don't include.\n\treturn input.GetTextFromInterval(NewInterval(l.startIndex, input.Index()-1))\n}\n\nfunc (l *LexerATNSimulator) Consume(input CharStream) {\n\tcurChar := input.LA(1)\n\tif curChar == int('\\n') {\n\t\tl.Line++\n\t\tl.CharPositionInLine = 0\n\t} else {\n\t\tl.CharPositionInLine++\n\t}\n\tinput.Consume()\n}\n\nfunc (l *LexerATNSimulator) GetCharPositionInLine() int {\n\treturn l.CharPositionInLine\n}\n\nfunc (l *LexerATNSimulator) GetLine() int {\n\treturn l.Line\n}\n\nfunc (l *LexerATNSimulator) GetTokenName(tt int) string {\n\tif tt == -1 {\n\t\treturn \"EOF\"\n\t}\n\n\tvar sb strings.Builder\n\tsb.Grow(6)\n\tsb.WriteByte('\\'')\n\tsb.WriteRune(rune(tt))\n\tsb.WriteByte('\\'')\n\n\treturn sb.String()\n}\n\nfunc resetSimState(sim *SimState) {\n\tsim.index = -1\n\tsim.line = 0\n\tsim.column = -1\n\tsim.dfaState = nil\n}\n\ntype SimState struct {\n\tindex    int\n\tline     int\n\tcolumn   int\n\tdfaState *DFAState\n}\n\nfunc NewSimState() *SimState {\n\ts := new(SimState)\n\tresetSimState(s)\n\treturn s\n}\n\nfunc (s *SimState) reset() {\n\tresetSimState(s)\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\ntype LL1Analyzer struct {\n\tatn *ATN\n}\n\nfunc NewLL1Analyzer(atn *ATN) *LL1Analyzer {\n\tla := new(LL1Analyzer)\n\tla.atn = atn\n\treturn la\n}\n\nconst (\n\t// LL1AnalyzerHitPred is a special value added to the lookahead sets to indicate that we hit\n\t// a predicate during analysis if\n\t//\n\t//   seeThruPreds==false\n\tLL1AnalyzerHitPred = TokenInvalidType\n)\n\n// *\n// Calculates the SLL(1) expected lookahead set for each outgoing transition\n// of an {@link ATNState}. The returned array has one element for each\n// outgoing transition in {@code s}. If the closure from transition\n// <em>i</em> leads to a semantic predicate before Matching a symbol, the\n// element at index <em>i</em> of the result will be {@code nil}.\n//\n// @param s the ATN state\n// @return the expected symbols for each outgoing transition of {@code s}.\nfunc (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet {\n\tif s == nil {\n\t\treturn nil\n\t}\n\tcount := len(s.GetTransitions())\n\tlook := make([]*IntervalSet, count)\n\tfor alt := 0; alt < count; alt++ {\n\n\t\tlook[alt] = NewIntervalSet()\n\t\t// TODO: This is one of the reasons that ATNConfigs are allocated and freed all the time - fix this tomorrow jim!\n\t\tlookBusy := NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, \"LL1Analyzer.getDecisionLookahead for lookBusy\")\n\t\tla.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), false, false)\n\n\t\t// Wipe out lookahead for la alternative if we found nothing,\n\t\t// or we had a predicate when we !seeThruPreds\n\t\tif look[alt].length() == 0 || look[alt].contains(LL1AnalyzerHitPred) {\n\t\t\tlook[alt] = nil\n\t\t}\n\t}\n\treturn look\n}\n\n// Look computes the set of tokens that can follow s in the [ATN] in the\n// specified ctx.\n//\n// If ctx is nil and the end of the rule containing\n// s is reached, [EPSILON] is added to the result set.\n//\n// If ctx is not nil and the end of the outermost rule is\n// reached, [EOF] is added to the result set.\n//\n// Parameter s the ATN state, and stopState is the ATN state to stop at. This can be a\n// [BlockEndState] to detect epsilon paths through a closure.\n//\n// Parameter ctx is the complete parser context, or nil if the context\n// should be ignored\n//\n// The func returns the set of tokens that can follow s in the [ATN] in the\n// specified ctx.\nfunc (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet {\n\tr := NewIntervalSet()\n\tvar lookContext *PredictionContext\n\tif ctx != nil {\n\t\tlookContext = predictionContextFromRuleContext(s.GetATN(), ctx)\n\t}\n\tla.look1(s, stopState, lookContext, r, NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, \"LL1Analyzer.Look for la.look1()\"),\n\t\tNewBitSet(), true, true)\n\treturn r\n}\n\n//*\n// Compute set of tokens that can follow {@code s} in the ATN in the\n// specified {@code ctx}.\n//\n// <p>If {@code ctx} is {@code nil} and {@code stopState} or the end of the\n// rule containing {@code s} is reached, {@link Token//EPSILON} is added to\n// the result set. If {@code ctx} is not {@code nil} and {@code addEOF} is\n// {@code true} and {@code stopState} or the end of the outermost rule is\n// reached, {@link Token//EOF} is added to the result set.</p>\n//\n// @param s the ATN state.\n// @param stopState the ATN state to stop at. This can be a\n// {@link BlockEndState} to detect epsilon paths through a closure.\n// @param ctx The outer context, or {@code nil} if the outer context should\n// not be used.\n// @param look The result lookahead set.\n// @param lookBusy A set used for preventing epsilon closures in the ATN\n// from causing a stack overflow. Outside code should pass\n// {@code NewSet<ATNConfig>} for la argument.\n// @param calledRuleStack A set used for preventing left recursion in the\n// ATN from causing a stack overflow. Outside code should pass\n// {@code NewBitSet()} for la argument.\n// @param seeThruPreds {@code true} to true semantic predicates as\n// implicitly {@code true} and \"see through them\", otherwise {@code false}\n// to treat semantic predicates as opaque and add {@link //HitPred} to the\n// result if one is encountered.\n// @param addEOF Add {@link Token//EOF} to the result if the end of the\n// outermost context is reached. This parameter has no effect if {@code ctx}\n// is {@code nil}.\n\nfunc (la *LL1Analyzer) look2(_, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]],\n\tcalledRuleStack *BitSet, seeThruPreds, addEOF bool, i int) {\n\n\treturnState := la.atn.states[ctx.getReturnState(i)]\n\tla.look1(returnState, stopState, ctx.GetParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF)\n\n}\n\nfunc (la *LL1Analyzer) look1(s, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool) {\n\n\tc := NewATNConfig6(s, 0, ctx)\n\n\tif lookBusy.Contains(c) {\n\t\treturn\n\t}\n\n\t_, present := lookBusy.Put(c)\n\tif present {\n\t\treturn\n\n\t}\n\tif s == stopState {\n\t\tif ctx == nil {\n\t\t\tlook.addOne(TokenEpsilon)\n\t\t\treturn\n\t\t} else if ctx.isEmpty() && addEOF {\n\t\t\tlook.addOne(TokenEOF)\n\t\t\treturn\n\t\t}\n\t}\n\n\t_, ok := s.(*RuleStopState)\n\n\tif ok {\n\t\tif ctx == nil {\n\t\t\tlook.addOne(TokenEpsilon)\n\t\t\treturn\n\t\t} else if ctx.isEmpty() && addEOF {\n\t\t\tlook.addOne(TokenEOF)\n\t\t\treturn\n\t\t}\n\n\t\tif ctx.pcType != PredictionContextEmpty {\n\t\t\tremoved := calledRuleStack.contains(s.GetRuleIndex())\n\t\t\tdefer func() {\n\t\t\t\tif removed {\n\t\t\t\t\tcalledRuleStack.add(s.GetRuleIndex())\n\t\t\t\t}\n\t\t\t}()\n\t\t\tcalledRuleStack.remove(s.GetRuleIndex())\n\t\t\t// run thru all possible stack tops in ctx\n\t\t\tfor i := 0; i < ctx.length(); i++ {\n\t\t\t\treturnState := la.atn.states[ctx.getReturnState(i)]\n\t\t\t\tla.look2(returnState, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, i)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\tn := len(s.GetTransitions())\n\n\tfor i := 0; i < n; i++ {\n\t\tt := s.GetTransitions()[i]\n\n\t\tif t1, ok := t.(*RuleTransition); ok {\n\t\t\tif calledRuleStack.contains(t1.getTarget().GetRuleIndex()) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnewContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber())\n\t\t\tla.look3(stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, t1)\n\t\t} else if t2, ok := t.(AbstractPredicateTransition); ok {\n\t\t\tif seeThruPreds {\n\t\t\t\tla.look1(t2.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)\n\t\t\t} else {\n\t\t\t\tlook.addOne(LL1AnalyzerHitPred)\n\t\t\t}\n\t\t} else if t.getIsEpsilon() {\n\t\t\tla.look1(t.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)\n\t\t} else if _, ok := t.(*WildcardTransition); ok {\n\t\t\tlook.addRange(TokenMinUserTokenType, la.atn.maxTokenType)\n\t\t} else {\n\t\t\tset := t.getLabel()\n\t\t\tif set != nil {\n\t\t\t\tif _, ok := t.(*NotSetTransition); ok {\n\t\t\t\t\tset = set.complement(TokenMinUserTokenType, la.atn.maxTokenType)\n\t\t\t\t}\n\t\t\t\tlook.addSet(set)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (la *LL1Analyzer) look3(stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]],\n\tcalledRuleStack *BitSet, seeThruPreds, addEOF bool, t1 *RuleTransition) {\n\n\tnewContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber())\n\n\tdefer func() {\n\t\tcalledRuleStack.remove(t1.getTarget().GetRuleIndex())\n\t}()\n\n\tcalledRuleStack.add(t1.getTarget().GetRuleIndex())\n\tla.look1(t1.getTarget(), stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)\n\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/mutex.go",
    "content": "//go:build !antlr.nomutex\n// +build !antlr.nomutex\n\npackage antlr\n\nimport \"sync\"\n\n// Mutex is a simple mutex implementation which just delegates to sync.Mutex, it\n// is used to provide a mutex implementation for the antlr package, which users\n// can turn off with the build tag -tags antlr.nomutex\ntype Mutex struct {\n\tmu sync.Mutex\n}\n\nfunc (m *Mutex) Lock() {\n\tm.mu.Lock()\n}\n\nfunc (m *Mutex) Unlock() {\n\tm.mu.Unlock()\n}\n\ntype RWMutex struct {\n\tmu sync.RWMutex\n}\n\nfunc (m *RWMutex) Lock() {\n\tm.mu.Lock()\n}\n\nfunc (m *RWMutex) Unlock() {\n\tm.mu.Unlock()\n}\n\nfunc (m *RWMutex) RLock() {\n\tm.mu.RLock()\n}\n\nfunc (m *RWMutex) RUnlock() {\n\tm.mu.RUnlock()\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/mutex_nomutex.go",
    "content": "//go:build antlr.nomutex\n// +build antlr.nomutex\n\npackage antlr\n\ntype Mutex struct{}\n\nfunc (m *Mutex) Lock() {\n\t// No-op\n}\n\nfunc (m *Mutex) Unlock() {\n\t// No-op\n}\n\ntype RWMutex struct{}\n\nfunc (m *RWMutex) Lock() {\n\t// No-op\n}\n\nfunc (m *RWMutex) Unlock() {\n\t// No-op\n}\n\nfunc (m *RWMutex) RLock() {\n\t// No-op\n}\n\nfunc (m *RWMutex) RUnlock() {\n\t// No-op\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/nostatistics.go",
    "content": "//go:build !antlr.stats\n\npackage antlr\n\n// This file is compiled when the build configuration antlr.stats is not enabled.\n// which then allows the compiler to optimize out all the code that is not used.\nconst collectStats = false\n\n// goRunStats is a dummy struct used when build configuration antlr.stats is not enabled.\ntype goRunStats struct {\n}\n\nvar Statistics = &goRunStats{}\n\nfunc (s *goRunStats) AddJStatRec(_ *JStatRec) {\n\t// Do nothing - compiler will optimize this out (hopefully)\n}\n\nfunc (s *goRunStats) CollectionAnomalies() {\n\t// Do nothing - compiler will optimize this out (hopefully)\n}\n\nfunc (s *goRunStats) Reset() {\n\t// Do nothing - compiler will optimize this out (hopefully)\n}\n\nfunc (s *goRunStats) Report(dir string, prefix string) error {\n\t// Do nothing - compiler will optimize this out (hopefully)\n\treturn nil\n}\n\nfunc (s *goRunStats) Analyze() {\n\t// Do nothing - compiler will optimize this out (hopefully)\n}\n\ntype statsOption func(*goRunStats) error\n\nfunc (s *goRunStats) Configure(options ...statsOption) error {\n\t// Do nothing - compiler will optimize this out (hopefully)\n\treturn nil\n}\n\nfunc WithTopN(topN int) statsOption {\n\treturn func(s *goRunStats) error {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/parser.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype Parser interface {\n\tRecognizer\n\n\tGetInterpreter() *ParserATNSimulator\n\n\tGetTokenStream() TokenStream\n\tGetTokenFactory() TokenFactory\n\tGetParserRuleContext() ParserRuleContext\n\tSetParserRuleContext(ParserRuleContext)\n\tConsume() Token\n\tGetParseListeners() []ParseTreeListener\n\n\tGetErrorHandler() ErrorStrategy\n\tSetErrorHandler(ErrorStrategy)\n\tGetInputStream() IntStream\n\tGetCurrentToken() Token\n\tGetExpectedTokens() *IntervalSet\n\tNotifyErrorListeners(string, Token, RecognitionException)\n\tIsExpectedToken(int) bool\n\tGetPrecedence() int\n\tGetRuleInvocationStack(ParserRuleContext) []string\n}\n\ntype BaseParser struct {\n\t*BaseRecognizer\n\n\tInterpreter     *ParserATNSimulator\n\tBuildParseTrees bool\n\n\tinput           TokenStream\n\terrHandler      ErrorStrategy\n\tprecedenceStack IntStack\n\tctx             ParserRuleContext\n\n\ttracer         *TraceListener\n\tparseListeners []ParseTreeListener\n\t_SyntaxErrors  int\n}\n\n// NewBaseParser contains all the parsing support code to embed in parsers. Essentially most of it is error\n// recovery stuff.\n//\n//goland:noinspection GoUnusedExportedFunction\nfunc NewBaseParser(input TokenStream) *BaseParser {\n\n\tp := new(BaseParser)\n\n\tp.BaseRecognizer = NewBaseRecognizer()\n\n\t// The input stream.\n\tp.input = nil\n\n\t// The error handling strategy for the parser. The default value is a new\n\t// instance of {@link DefaultErrorStrategy}.\n\tp.errHandler = NewDefaultErrorStrategy()\n\tp.precedenceStack = make([]int, 0)\n\tp.precedenceStack.Push(0)\n\n\t// The ParserRuleContext object for the currently executing rule.\n\t// p.is always non-nil during the parsing process.\n\tp.ctx = nil\n\n\t// Specifies whether the parser should construct a parse tree during\n\t// the parsing process. The default value is {@code true}.\n\tp.BuildParseTrees = true\n\n\t// When setTrace(true) is called, a reference to the\n\t// TraceListener is stored here, so it can be easily removed in a\n\t// later call to setTrace(false). The listener itself is\n\t// implemented as a parser listener so p.field is not directly used by\n\t// other parser methods.\n\tp.tracer = nil\n\n\t// The list of ParseTreeListener listeners registered to receive\n\t// events during the parse.\n\tp.parseListeners = nil\n\n\t// The number of syntax errors Reported during parsing. p.value is\n\t// incremented each time NotifyErrorListeners is called.\n\tp._SyntaxErrors = 0\n\tp.SetInputStream(input)\n\n\treturn p\n}\n\n// This field maps from the serialized ATN string to the deserialized [ATN] with\n// bypass alternatives.\n//\n// [ATNDeserializationOptions.isGenerateRuleBypassTransitions]\n//\n//goland:noinspection GoUnusedGlobalVariable\nvar bypassAltsAtnCache = make(map[string]int)\n\n// reset the parser's state//\nfunc (p *BaseParser) reset() {\n\tif p.input != nil {\n\t\tp.input.Seek(0)\n\t}\n\tp.errHandler.reset(p)\n\tp.ctx = nil\n\tp._SyntaxErrors = 0\n\tp.SetTrace(nil)\n\tp.precedenceStack = make([]int, 0)\n\tp.precedenceStack.Push(0)\n\tif p.Interpreter != nil {\n\t\tp.Interpreter.reset()\n\t}\n}\n\nfunc (p *BaseParser) GetErrorHandler() ErrorStrategy {\n\treturn p.errHandler\n}\n\nfunc (p *BaseParser) SetErrorHandler(e ErrorStrategy) {\n\tp.errHandler = e\n}\n\n// Match current input symbol against {@code ttype}. If the symbol type\n// Matches, {@link ANTLRErrorStrategy//ReportMatch} and {@link //consume} are\n// called to complete the Match process.\n//\n// <p>If the symbol type does not Match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} is\n// {@code true} and the token index of the symbol returned by\n// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n// the parse tree by calling {@link ParserRuleContext//addErrorNode}.</p>\n//\n// @param ttype the token type to Match\n// @return the Matched symbol\n// @panics RecognitionException if the current input symbol did not Match\n// {@code ttype} and the error strategy could not recover from the\n// mismatched symbol\n\nfunc (p *BaseParser) Match(ttype int) Token {\n\n\tt := p.GetCurrentToken()\n\n\tif t.GetTokenType() == ttype {\n\t\tp.errHandler.ReportMatch(p)\n\t\tp.Consume()\n\t} else {\n\t\tt = p.errHandler.RecoverInline(p)\n\t\tif p.HasError() {\n\t\t\treturn nil\n\t\t}\n\t\tif p.BuildParseTrees && t.GetTokenIndex() == -1 {\n\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion if it's not the current symbol\n\t\t\tp.ctx.AddErrorNode(t)\n\t\t}\n\t}\n\n\treturn t\n}\n\n// Match current input symbol as a wildcard. If the symbol type Matches\n// (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//ReportMatch}\n// and {@link //consume} are called to complete the Match process.\n//\n// <p>If the symbol type does not Match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} is\n// {@code true} and the token index of the symbol returned by\n// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n// the parse tree by calling {@link ParserRuleContext//addErrorNode}.</p>\n//\n// @return the Matched symbol\n// @panics RecognitionException if the current input symbol did not Match\n// a wildcard and the error strategy could not recover from the mismatched\n// symbol\n\nfunc (p *BaseParser) MatchWildcard() Token {\n\tt := p.GetCurrentToken()\n\tif t.GetTokenType() > 0 {\n\t\tp.errHandler.ReportMatch(p)\n\t\tp.Consume()\n\t} else {\n\t\tt = p.errHandler.RecoverInline(p)\n\t\tif p.BuildParseTrees && t.GetTokenIndex() == -1 {\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion if it's not the current symbol\n\t\t\tp.ctx.AddErrorNode(t)\n\t\t}\n\t}\n\treturn t\n}\n\nfunc (p *BaseParser) GetParserRuleContext() ParserRuleContext {\n\treturn p.ctx\n}\n\nfunc (p *BaseParser) SetParserRuleContext(v ParserRuleContext) {\n\tp.ctx = v\n}\n\nfunc (p *BaseParser) GetParseListeners() []ParseTreeListener {\n\tif p.parseListeners == nil {\n\t\treturn make([]ParseTreeListener, 0)\n\t}\n\treturn p.parseListeners\n}\n\n// AddParseListener registers listener to receive events during the parsing process.\n//\n// To support output-preserving grammar transformations (including but not\n// limited to left-recursion removal, automated left-factoring, and\n// optimized code generation), calls to listener methods during the parse\n// may differ substantially from calls made by\n// [ParseTreeWalker.DEFAULT] used after the parse is complete. In\n// particular, rule entry and exit events may occur in a different order\n// during the parse than after the parser. In addition, calls to certain\n// rule entry methods may be omitted.\n//\n// With the following specific exceptions, calls to listener events are\n// deterministic, i.e. for identical input the calls to listener\n// methods will be the same.\n//\n//   - Alterations to the grammar used to generate code may change the\n//     behavior of the listener calls.\n//   - Alterations to the command line options passed to ANTLR 4 when\n//     generating the parser may change the behavior of the listener calls.\n//   - Changing the version of the ANTLR Tool used to generate the parser\n//     may change the behavior of the listener calls.\nfunc (p *BaseParser) AddParseListener(listener ParseTreeListener) {\n\tif listener == nil {\n\t\tpanic(\"listener\")\n\t}\n\tif p.parseListeners == nil {\n\t\tp.parseListeners = make([]ParseTreeListener, 0)\n\t}\n\tp.parseListeners = append(p.parseListeners, listener)\n}\n\n// RemoveParseListener removes listener from the list of parse listeners.\n//\n// If listener is nil or has not been added as a parse\n// listener, this func does nothing.\nfunc (p *BaseParser) RemoveParseListener(listener ParseTreeListener) {\n\n\tif p.parseListeners != nil {\n\n\t\tidx := -1\n\t\tfor i, v := range p.parseListeners {\n\t\t\tif v == listener {\n\t\t\t\tidx = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif idx == -1 {\n\t\t\treturn\n\t\t}\n\n\t\t// remove the listener from the slice\n\t\tp.parseListeners = append(p.parseListeners[0:idx], p.parseListeners[idx+1:]...)\n\n\t\tif len(p.parseListeners) == 0 {\n\t\t\tp.parseListeners = nil\n\t\t}\n\t}\n}\n\n// Remove all parse listeners.\nfunc (p *BaseParser) removeParseListeners() {\n\tp.parseListeners = nil\n}\n\n// TriggerEnterRuleEvent notifies all parse listeners of an enter rule event.\nfunc (p *BaseParser) TriggerEnterRuleEvent() {\n\tif p.parseListeners != nil {\n\t\tctx := p.ctx\n\t\tfor _, listener := range p.parseListeners {\n\t\t\tlistener.EnterEveryRule(ctx)\n\t\t\tctx.EnterRule(listener)\n\t\t}\n\t}\n}\n\n// TriggerExitRuleEvent notifies any parse listeners of an exit rule event.\nfunc (p *BaseParser) TriggerExitRuleEvent() {\n\tif p.parseListeners != nil {\n\t\t// reverse order walk of listeners\n\t\tctx := p.ctx\n\t\tl := len(p.parseListeners) - 1\n\n\t\tfor i := range p.parseListeners {\n\t\t\tlistener := p.parseListeners[l-i]\n\t\t\tctx.ExitRule(listener)\n\t\t\tlistener.ExitEveryRule(ctx)\n\t\t}\n\t}\n}\n\nfunc (p *BaseParser) GetInterpreter() *ParserATNSimulator {\n\treturn p.Interpreter\n}\n\nfunc (p *BaseParser) GetATN() *ATN {\n\treturn p.Interpreter.atn\n}\n\nfunc (p *BaseParser) GetTokenFactory() TokenFactory {\n\treturn p.input.GetTokenSource().GetTokenFactory()\n}\n\n// setTokenFactory is used to tell our token source and error strategy about a new way to create tokens.\nfunc (p *BaseParser) setTokenFactory(factory TokenFactory) {\n\tp.input.GetTokenSource().setTokenFactory(factory)\n}\n\n// GetATNWithBypassAlts - the ATN with bypass alternatives is expensive to create, so we create it\n// lazily.\nfunc (p *BaseParser) GetATNWithBypassAlts() {\n\n\t// TODO - Implement this?\n\tpanic(\"Not implemented!\")\n\n\t//\tserializedAtn := p.getSerializedATN()\n\t//\tif (serializedAtn == nil) {\n\t//\t\tpanic(\"The current parser does not support an ATN with bypass alternatives.\")\n\t//\t}\n\t//\tresult := p.bypassAltsAtnCache[serializedAtn]\n\t//\tif (result == nil) {\n\t//\t\tdeserializationOptions := NewATNDeserializationOptions(nil)\n\t//\t\tdeserializationOptions.generateRuleBypassTransitions = true\n\t//\t\tresult = NewATNDeserializer(deserializationOptions).deserialize(serializedAtn)\n\t//\t\tp.bypassAltsAtnCache[serializedAtn] = result\n\t//\t}\n\t//\treturn result\n}\n\n// The preferred method of getting a tree pattern. For example, here's a\n// sample use:\n//\n// <pre>\n// ParseTree t = parser.expr()\n// ParseTreePattern p = parser.compileParseTreePattern(\"&ltID&gt+0\",\n// MyParser.RULE_expr)\n// ParseTreeMatch m = p.Match(t)\n// String id = m.Get(\"ID\")\n// </pre>\n\n//goland:noinspection GoUnusedParameter\nfunc (p *BaseParser) compileParseTreePattern(pattern, patternRuleIndex, lexer Lexer) {\n\n\tpanic(\"NewParseTreePatternMatcher not implemented!\")\n\t//\n\t//\tif (lexer == nil) {\n\t//\t\tif (p.GetTokenStream() != nil) {\n\t//\t\t\ttokenSource := p.GetTokenStream().GetTokenSource()\n\t//\t\t\tif _, ok := tokenSource.(ILexer); ok {\n\t//\t\t\t\tlexer = tokenSource\n\t//\t\t\t}\n\t//\t\t}\n\t//\t}\n\t//\tif (lexer == nil) {\n\t//\t\tpanic(\"Parser can't discover a lexer to use\")\n\t//\t}\n\n\t//\tm := NewParseTreePatternMatcher(lexer, p)\n\t//\treturn m.compile(pattern, patternRuleIndex)\n}\n\nfunc (p *BaseParser) GetInputStream() IntStream {\n\treturn p.GetTokenStream()\n}\n\nfunc (p *BaseParser) SetInputStream(input TokenStream) {\n\tp.SetTokenStream(input)\n}\n\nfunc (p *BaseParser) GetTokenStream() TokenStream {\n\treturn p.input\n}\n\n// SetTokenStream installs input as the token stream and resets the parser.\nfunc (p *BaseParser) SetTokenStream(input TokenStream) {\n\tp.input = nil\n\tp.reset()\n\tp.input = input\n}\n\n// GetCurrentToken returns the current token at LT(1).\n//\n// [Match] needs to return the current input symbol, which gets put\n// into the label for the associated token ref e.g., x=ID.\nfunc (p *BaseParser) GetCurrentToken() Token {\n\treturn p.input.LT(1)\n}\n\nfunc (p *BaseParser) NotifyErrorListeners(msg string, offendingToken Token, err RecognitionException) {\n\tif offendingToken == nil {\n\t\toffendingToken = p.GetCurrentToken()\n\t}\n\tp._SyntaxErrors++\n\tline := offendingToken.GetLine()\n\tcolumn := offendingToken.GetColumn()\n\tlistener := p.GetErrorListenerDispatch()\n\tlistener.SyntaxError(p, offendingToken, line, column, msg, err)\n}\n\nfunc (p *BaseParser) Consume() Token {\n\to := p.GetCurrentToken()\n\tif o.GetTokenType() != TokenEOF {\n\t\tp.GetInputStream().Consume()\n\t}\n\thasListener := p.parseListeners != nil && len(p.parseListeners) > 0\n\tif p.BuildParseTrees || hasListener {\n\t\tif p.errHandler.InErrorRecoveryMode(p) {\n\t\t\tnode := p.ctx.AddErrorNode(o)\n\t\t\tif p.parseListeners != nil {\n\t\t\t\tfor _, l := range p.parseListeners {\n\t\t\t\t\tl.VisitErrorNode(node)\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\tnode := p.ctx.AddTokenNode(o)\n\t\t\tif p.parseListeners != nil {\n\t\t\t\tfor _, l := range p.parseListeners {\n\t\t\t\t\tl.VisitTerminal(node)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//        node.invokingState = p.state\n\t}\n\n\treturn o\n}\n\nfunc (p *BaseParser) addContextToParseTree() {\n\t// add current context to parent if we have a parent\n\tif p.ctx.GetParent() != nil {\n\t\tp.ctx.GetParent().(ParserRuleContext).AddChild(p.ctx)\n\t}\n}\n\nfunc (p *BaseParser) EnterRule(localctx ParserRuleContext, state, _ int) {\n\tp.SetState(state)\n\tp.ctx = localctx\n\tp.ctx.SetStart(p.input.LT(1))\n\tif p.BuildParseTrees {\n\t\tp.addContextToParseTree()\n\t}\n\tif p.parseListeners != nil {\n\t\tp.TriggerEnterRuleEvent()\n\t}\n}\n\nfunc (p *BaseParser) ExitRule() {\n\tp.ctx.SetStop(p.input.LT(-1))\n\t// trigger event on ctx, before it reverts to parent\n\tif p.parseListeners != nil {\n\t\tp.TriggerExitRuleEvent()\n\t}\n\tp.SetState(p.ctx.GetInvokingState())\n\tif p.ctx.GetParent() != nil {\n\t\tp.ctx = p.ctx.GetParent().(ParserRuleContext)\n\t} else {\n\t\tp.ctx = nil\n\t}\n}\n\nfunc (p *BaseParser) EnterOuterAlt(localctx ParserRuleContext, altNum int) {\n\tlocalctx.SetAltNumber(altNum)\n\t// if we have a new localctx, make sure we replace existing ctx\n\t// that is previous child of parse tree\n\tif p.BuildParseTrees && p.ctx != localctx {\n\t\tif p.ctx.GetParent() != nil {\n\t\t\tp.ctx.GetParent().(ParserRuleContext).RemoveLastChild()\n\t\t\tp.ctx.GetParent().(ParserRuleContext).AddChild(localctx)\n\t\t}\n\t}\n\tp.ctx = localctx\n}\n\n// Get the precedence level for the top-most precedence rule.\n//\n// @return The precedence level for the top-most precedence rule, or -1 if\n// the parser context is not nested within a precedence rule.\n\nfunc (p *BaseParser) GetPrecedence() int {\n\tif len(p.precedenceStack) == 0 {\n\t\treturn -1\n\t}\n\n\treturn p.precedenceStack[len(p.precedenceStack)-1]\n}\n\nfunc (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, _, precedence int) {\n\tp.SetState(state)\n\tp.precedenceStack.Push(precedence)\n\tp.ctx = localctx\n\tp.ctx.SetStart(p.input.LT(1))\n\tif p.parseListeners != nil {\n\t\tp.TriggerEnterRuleEvent() // simulates rule entry for\n\t\t// left-recursive rules\n\t}\n}\n\n//\n// Like {@link //EnterRule} but for recursive rules.\n\nfunc (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state, _ int) {\n\tprevious := p.ctx\n\tprevious.SetParent(localctx)\n\tprevious.SetInvokingState(state)\n\tprevious.SetStop(p.input.LT(-1))\n\n\tp.ctx = localctx\n\tp.ctx.SetStart(previous.GetStart())\n\tif p.BuildParseTrees {\n\t\tp.ctx.AddChild(previous)\n\t}\n\tif p.parseListeners != nil {\n\t\tp.TriggerEnterRuleEvent() // simulates rule entry for\n\t\t// left-recursive rules\n\t}\n}\n\nfunc (p *BaseParser) UnrollRecursionContexts(parentCtx ParserRuleContext) {\n\t_, _ = p.precedenceStack.Pop()\n\tp.ctx.SetStop(p.input.LT(-1))\n\tretCtx := p.ctx // save current ctx (return value)\n\t// unroll so ctx is as it was before call to recursive method\n\tif p.parseListeners != nil {\n\t\tfor p.ctx != parentCtx {\n\t\t\tp.TriggerExitRuleEvent()\n\t\t\tp.ctx = p.ctx.GetParent().(ParserRuleContext)\n\t\t}\n\t} else {\n\t\tp.ctx = parentCtx\n\t}\n\t// hook into tree\n\tretCtx.SetParent(parentCtx)\n\tif p.BuildParseTrees && parentCtx != nil {\n\t\t// add return ctx into invoking rule's tree\n\t\tparentCtx.AddChild(retCtx)\n\t}\n}\n\nfunc (p *BaseParser) GetInvokingContext(ruleIndex int) ParserRuleContext {\n\tctx := p.ctx\n\tfor ctx != nil {\n\t\tif ctx.GetRuleIndex() == ruleIndex {\n\t\t\treturn ctx\n\t\t}\n\t\tctx = ctx.GetParent().(ParserRuleContext)\n\t}\n\treturn nil\n}\n\nfunc (p *BaseParser) Precpred(_ RuleContext, precedence int) bool {\n\treturn precedence >= p.precedenceStack[len(p.precedenceStack)-1]\n}\n\n//goland:noinspection GoUnusedParameter\nfunc (p *BaseParser) inContext(context ParserRuleContext) bool {\n\t// TODO: useful in parser?\n\treturn false\n}\n\n// IsExpectedToken checks whether symbol can follow the current state in the\n// {ATN}. The behavior of p.method is equivalent to the following, but is\n// implemented such that the complete context-sensitive follow set does not\n// need to be explicitly constructed.\n//\n//\treturn getExpectedTokens().contains(symbol)\nfunc (p *BaseParser) IsExpectedToken(symbol int) bool {\n\tatn := p.Interpreter.atn\n\tctx := p.ctx\n\ts := atn.states[p.state]\n\tfollowing := atn.NextTokens(s, nil)\n\tif following.contains(symbol) {\n\t\treturn true\n\t}\n\tif !following.contains(TokenEpsilon) {\n\t\treturn false\n\t}\n\tfor ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) {\n\t\tinvokingState := atn.states[ctx.GetInvokingState()]\n\t\trt := invokingState.GetTransitions()[0]\n\t\tfollowing = atn.NextTokens(rt.(*RuleTransition).followState, nil)\n\t\tif following.contains(symbol) {\n\t\t\treturn true\n\t\t}\n\t\tctx = ctx.GetParent().(ParserRuleContext)\n\t}\n\tif following.contains(TokenEpsilon) && symbol == TokenEOF {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// GetExpectedTokens and returns the set of input symbols which could follow the current parser\n// state and context, as given by [GetState] and [GetContext],\n// respectively.\nfunc (p *BaseParser) GetExpectedTokens() *IntervalSet {\n\treturn p.Interpreter.atn.getExpectedTokens(p.state, p.ctx)\n}\n\nfunc (p *BaseParser) GetExpectedTokensWithinCurrentRule() *IntervalSet {\n\tatn := p.Interpreter.atn\n\ts := atn.states[p.state]\n\treturn atn.NextTokens(s, nil)\n}\n\n// GetRuleIndex get a rule's index (i.e., RULE_ruleName field) or -1 if not found.\nfunc (p *BaseParser) GetRuleIndex(ruleName string) int {\n\tvar ruleIndex, ok = p.GetRuleIndexMap()[ruleName]\n\tif ok {\n\t\treturn ruleIndex\n\t}\n\n\treturn -1\n}\n\n// GetRuleInvocationStack returns a list of the rule names in your parser instance\n// leading up to a call to the current rule. You could override if\n// you want more details such as the file/line info of where\n// in the ATN a rule is invoked.\nfunc (p *BaseParser) GetRuleInvocationStack(c ParserRuleContext) []string {\n\tif c == nil {\n\t\tc = p.ctx\n\t}\n\tstack := make([]string, 0)\n\tfor c != nil {\n\t\t// compute what follows who invoked us\n\t\truleIndex := c.GetRuleIndex()\n\t\tif ruleIndex < 0 {\n\t\t\tstack = append(stack, \"n/a\")\n\t\t} else {\n\t\t\tstack = append(stack, p.GetRuleNames()[ruleIndex])\n\t\t}\n\n\t\tvp := c.GetParent()\n\n\t\tif vp == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tc = vp.(ParserRuleContext)\n\t}\n\treturn stack\n}\n\n// GetDFAStrings returns a list of all DFA states used for debugging purposes\nfunc (p *BaseParser) GetDFAStrings() string {\n\treturn fmt.Sprint(p.Interpreter.decisionToDFA)\n}\n\n// DumpDFA prints the whole of the DFA for debugging\nfunc (p *BaseParser) DumpDFA() {\n\tseenOne := false\n\tfor _, dfa := range p.Interpreter.decisionToDFA {\n\t\tif dfa.Len() > 0 {\n\t\t\tif seenOne {\n\t\t\t\tfmt.Println()\n\t\t\t}\n\t\t\tfmt.Println(\"Decision \" + strconv.Itoa(dfa.decision) + \":\")\n\t\t\tfmt.Print(dfa.String(p.LiteralNames, p.SymbolicNames))\n\t\t\tseenOne = true\n\t\t}\n\t}\n}\n\nfunc (p *BaseParser) GetSourceName() string {\n\treturn p.GrammarFileName\n}\n\n// SetTrace installs a trace listener for the parse.\n//\n// During a parse it is sometimes useful to listen in on the rule entry and exit\n// events as well as token Matches. This is for quick and dirty debugging.\nfunc (p *BaseParser) SetTrace(trace *TraceListener) {\n\tif trace == nil {\n\t\tp.RemoveParseListener(p.tracer)\n\t\tp.tracer = nil\n\t} else {\n\t\tif p.tracer != nil {\n\t\t\tp.RemoveParseListener(p.tracer)\n\t\t}\n\t\tp.tracer = NewTraceListener(p)\n\t\tp.AddParseListener(p.tracer)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// ClosureBusy is a store of ATNConfigs and is a tiny abstraction layer over\n// a standard JStore so that we can use Lazy instantiation of the JStore, mostly\n// to avoid polluting the stats module with a ton of JStore instances with nothing in them.\ntype ClosureBusy struct {\n\tbMap *JStore[*ATNConfig, Comparator[*ATNConfig]]\n\tdesc string\n}\n\n// NewClosureBusy creates a new ClosureBusy instance used to avoid infinite recursion for right-recursive rules\nfunc NewClosureBusy(desc string) *ClosureBusy {\n\treturn &ClosureBusy{\n\t\tdesc: desc,\n\t}\n}\n\nfunc (c *ClosureBusy) Put(config *ATNConfig) (*ATNConfig, bool) {\n\tif c.bMap == nil {\n\t\tc.bMap = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, c.desc)\n\t}\n\treturn c.bMap.Put(config)\n}\n\ntype ParserATNSimulator struct {\n\tBaseATNSimulator\n\n\tparser         Parser\n\tpredictionMode int\n\tinput          TokenStream\n\tstartIndex     int\n\tdfa            *DFA\n\tmergeCache     *JPCMap\n\touterContext   ParserRuleContext\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewParserATNSimulator(parser Parser, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *ParserATNSimulator {\n\n\tp := &ParserATNSimulator{\n\t\tBaseATNSimulator: BaseATNSimulator{\n\t\t\tatn:                atn,\n\t\t\tsharedContextCache: sharedContextCache,\n\t\t},\n\t}\n\n\tp.parser = parser\n\tp.decisionToDFA = decisionToDFA\n\t// SLL, LL, or LL + exact ambig detection?//\n\tp.predictionMode = PredictionModeLL\n\t// LAME globals to avoid parameters!!!!! I need these down deep in predTransition\n\tp.input = nil\n\tp.startIndex = 0\n\tp.outerContext = nil\n\tp.dfa = nil\n\t// Each prediction operation uses a cache for merge of prediction contexts.\n\t// Don't keep around as it wastes huge amounts of memory. [JPCMap]\n\t// isn't Synchronized, but we're ok since two threads shouldn't reuse same\n\t// parser/atn-simulator object because it can only handle one input at a time.\n\t// This maps graphs a and b to merged result c. (a,b) -> c. We can avoid\n\t// the merge if we ever see a and b again.  Note that (b,a) -> c should\n\t// also be examined during cache lookup.\n\t//\n\tp.mergeCache = nil\n\n\treturn p\n}\n\nfunc (p *ParserATNSimulator) GetPredictionMode() int {\n\treturn p.predictionMode\n}\n\nfunc (p *ParserATNSimulator) SetPredictionMode(v int) {\n\tp.predictionMode = v\n}\n\nfunc (p *ParserATNSimulator) reset() {\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) AdaptivePredict(parser *BaseParser, input TokenStream, decision int, outerContext ParserRuleContext) int {\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"adaptivePredict decision \" + strconv.Itoa(decision) +\n\t\t\t\" exec LA(1)==\" + p.getLookaheadName(input) +\n\t\t\t\" line \" + strconv.Itoa(input.LT(1).GetLine()) + \":\" +\n\t\t\tstrconv.Itoa(input.LT(1).GetColumn()))\n\t}\n\tp.input = input\n\tp.startIndex = input.Index()\n\tp.outerContext = outerContext\n\n\tdfa := p.decisionToDFA[decision]\n\tp.dfa = dfa\n\tm := input.Mark()\n\tindex := input.Index()\n\n\tdefer func() {\n\t\tp.dfa = nil\n\t\tp.mergeCache = nil // whack cache after each prediction\n\t\t// Do not attempt to run a GC now that we're done with the cache as makes the\n\t\t// GC overhead terrible for badly formed grammars and has little effect on well formed\n\t\t// grammars.\n\t\t// I have made some extra effort to try and reduce memory pressure by reusing allocations when\n\t\t// possible. However, it can only have a limited effect. The real solution is to encourage grammar\n\t\t// authors to think more carefully about their grammar and to use the new antlr.stats tag to inspect\n\t\t// what is happening at runtime, along with using the error listener to report ambiguities.\n\n\t\tinput.Seek(index)\n\t\tinput.Release(m)\n\t}()\n\n\t// Now we are certain to have a specific decision's DFA\n\t// But, do we still need an initial state?\n\tvar s0 *DFAState\n\tp.atn.stateMu.RLock()\n\tif dfa.getPrecedenceDfa() {\n\t\tp.atn.edgeMu.RLock()\n\t\t// the start state for a precedence DFA depends on the current\n\t\t// parser precedence, and is provided by a DFA method.\n\t\ts0 = dfa.getPrecedenceStartState(p.parser.GetPrecedence())\n\t\tp.atn.edgeMu.RUnlock()\n\t} else {\n\t\t// the start state for a \"regular\" DFA is just s0\n\t\ts0 = dfa.getS0()\n\t}\n\tp.atn.stateMu.RUnlock()\n\n\tif s0 == nil {\n\t\tif outerContext == nil {\n\t\t\touterContext = ParserRuleContextEmpty\n\t\t}\n\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\tfmt.Println(\"predictATN decision \" + strconv.Itoa(dfa.decision) +\n\t\t\t\t\" exec LA(1)==\" + p.getLookaheadName(input) +\n\t\t\t\t\", outerContext=\" + outerContext.String(p.parser.GetRuleNames(), nil))\n\t\t}\n\t\tfullCtx := false\n\t\ts0Closure := p.computeStartState(dfa.atnStartState, ParserRuleContextEmpty, fullCtx)\n\n\t\tp.atn.stateMu.Lock()\n\t\tif dfa.getPrecedenceDfa() {\n\t\t\t// If p is a precedence DFA, we use applyPrecedenceFilter\n\t\t\t// to convert the computed start state to a precedence start\n\t\t\t// state. We then use DFA.setPrecedenceStartState to set the\n\t\t\t// appropriate start state for the precedence level rather\n\t\t\t// than simply setting DFA.s0.\n\t\t\t//\n\t\t\tdfa.s0.configs = s0Closure\n\t\t\ts0Closure = p.applyPrecedenceFilter(s0Closure)\n\t\t\ts0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure))\n\t\t\tp.atn.edgeMu.Lock()\n\t\t\tdfa.setPrecedenceStartState(p.parser.GetPrecedence(), s0)\n\t\t\tp.atn.edgeMu.Unlock()\n\t\t} else {\n\t\t\ts0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure))\n\t\t\tdfa.setS0(s0)\n\t\t}\n\t\tp.atn.stateMu.Unlock()\n\t}\n\n\talt, re := p.execATN(dfa, s0, input, index, outerContext)\n\tparser.SetError(re)\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"DFA after predictATN: \" + dfa.String(p.parser.GetLiteralNames(), nil))\n\t}\n\treturn alt\n\n}\n\n// execATN performs ATN simulation to compute a predicted alternative based\n// upon the remaining input, but also updates the DFA cache to avoid\n// having to traverse the ATN again for the same input sequence.\n//\n// There are some key conditions we're looking for after computing a new\n// set of ATN configs (proposed DFA state):\n//\n//   - If the set is empty, there is no viable alternative for current symbol\n//   - Does the state uniquely predict an alternative?\n//   - Does the state have a conflict that would prevent us from\n//     putting it on the work list?\n//\n// We also have some key operations to do:\n//\n//   - Add an edge from previous DFA state to potentially NewDFA state, D,\n//   - Upon current symbol but only if adding to work list, which means in all\n//     cases except no viable alternative (and possibly non-greedy decisions?)\n//   - Collecting predicates and adding semantic context to DFA accept states\n//   - adding rule context to context-sensitive DFA accept states\n//   - Consuming an input symbol\n//   - Reporting a conflict\n//   - Reporting an ambiguity\n//   - Reporting a context sensitivity\n//   - Reporting insufficient predicates\n//\n// Cover these cases:\n//\n//   - dead end\n//   - single alt\n//   - single alt + predicates\n//   - conflict\n//   - conflict + predicates\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) {\n\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"execATN decision \" + strconv.Itoa(dfa.decision) +\n\t\t\t\", DFA state \" + s0.String() +\n\t\t\t\", LA(1)==\" + p.getLookaheadName(input) +\n\t\t\t\" line \" + strconv.Itoa(input.LT(1).GetLine()) + \":\" + strconv.Itoa(input.LT(1).GetColumn()))\n\t}\n\n\tpreviousD := s0\n\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"s0 = \" + s0.String())\n\t}\n\tt := input.LA(1)\n\tfor { // for more work\n\t\tD := p.getExistingTargetState(previousD, t)\n\t\tif D == nil {\n\t\t\tD = p.computeTargetState(dfa, previousD, t)\n\t\t}\n\t\tif D == ATNSimulatorError {\n\t\t\t// if any configs in previous dipped into outer context, that\n\t\t\t// means that input up to t actually finished entry rule\n\t\t\t// at least for SLL decision. Full LL doesn't dip into outer\n\t\t\t// so don't need special case.\n\t\t\t// We will get an error no matter what so delay until after\n\t\t\t// decision better error message. Also, no reachable target\n\t\t\t// ATN states in SLL implies LL will also get nowhere.\n\t\t\t// If conflict in states that dip out, choose min since we\n\t\t\t// will get error no matter what.\n\t\t\te := p.noViableAlt(input, outerContext, previousD.configs, startIndex)\n\t\t\tinput.Seek(startIndex)\n\t\t\talt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext)\n\t\t\tif alt != ATNInvalidAltNumber {\n\t\t\t\treturn alt, nil\n\t\t\t}\n\t\t\tp.parser.SetError(e)\n\t\t\treturn ATNInvalidAltNumber, e\n\t\t}\n\t\tif D.requiresFullContext && p.predictionMode != PredictionModeSLL {\n\t\t\t// IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)\n\t\t\tconflictingAlts := D.configs.conflictingAlts\n\t\t\tif D.predicates != nil {\n\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\tfmt.Println(\"DFA state has preds in DFA sim LL fail-over\")\n\t\t\t\t}\n\t\t\t\tconflictIndex := input.Index()\n\t\t\t\tif conflictIndex != startIndex {\n\t\t\t\t\tinput.Seek(startIndex)\n\t\t\t\t}\n\t\t\t\tconflictingAlts = p.evalSemanticContext(D.predicates, outerContext, true)\n\t\t\t\tif conflictingAlts.length() == 1 {\n\t\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\t\tfmt.Println(\"Full LL avoided\")\n\t\t\t\t\t}\n\t\t\t\t\treturn conflictingAlts.minValue(), nil\n\t\t\t\t}\n\t\t\t\tif conflictIndex != startIndex {\n\t\t\t\t\t// restore the index so Reporting the fallback to full\n\t\t\t\t\t// context occurs with the index at the correct spot\n\t\t\t\t\tinput.Seek(conflictIndex)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif runtimeConfig.parserATNSimulatorDFADebug {\n\t\t\t\tfmt.Println(\"ctx sensitive state \" + outerContext.String(nil, nil) + \" in \" + D.String())\n\t\t\t}\n\t\t\tfullCtx := true\n\t\t\ts0Closure := p.computeStartState(dfa.atnStartState, outerContext, fullCtx)\n\t\t\tp.ReportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.Index())\n\t\t\talt, re := p.execATNWithFullContext(dfa, D, s0Closure, input, startIndex, outerContext)\n\t\t\treturn alt, re\n\t\t}\n\t\tif D.isAcceptState {\n\t\t\tif D.predicates == nil {\n\t\t\t\treturn D.prediction, nil\n\t\t\t}\n\t\t\tstopIndex := input.Index()\n\t\t\tinput.Seek(startIndex)\n\t\t\talts := p.evalSemanticContext(D.predicates, outerContext, true)\n\n\t\t\tswitch alts.length() {\n\t\t\tcase 0:\n\t\t\t\treturn ATNInvalidAltNumber, p.noViableAlt(input, outerContext, D.configs, startIndex)\n\t\t\tcase 1:\n\t\t\t\treturn alts.minValue(), nil\n\t\t\tdefault:\n\t\t\t\t// Report ambiguity after predicate evaluation to make sure the correct set of ambig alts is Reported.\n\t\t\t\tp.ReportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs)\n\t\t\t\treturn alts.minValue(), nil\n\t\t\t}\n\t\t}\n\t\tpreviousD = D\n\n\t\tif t != TokenEOF {\n\t\t\tinput.Consume()\n\t\t\tt = input.LA(1)\n\t\t}\n\t}\n}\n\n// Get an existing target state for an edge in the DFA. If the target state\n// for the edge has not yet been computed or is otherwise not available,\n// p method returns {@code nil}.\n//\n// @param previousD The current DFA state\n// @param t The next input symbol\n// @return The existing target DFA state for the given input symbol\n// {@code t}, or {@code nil} if the target state for p edge is not\n// already cached\n\nfunc (p *ParserATNSimulator) getExistingTargetState(previousD *DFAState, t int) *DFAState {\n\tif t+1 < 0 {\n\t\treturn nil\n\t}\n\n\tp.atn.edgeMu.RLock()\n\tdefer p.atn.edgeMu.RUnlock()\n\tedges := previousD.getEdges()\n\tif edges == nil || t+1 >= len(edges) {\n\t\treturn nil\n\t}\n\treturn previousD.getIthEdge(t + 1)\n}\n\n// Compute a target state for an edge in the DFA, and attempt to add the\n// computed state and corresponding edge to the DFA.\n//\n// @param dfa The DFA\n// @param previousD The current DFA state\n// @param t The next input symbol\n//\n// @return The computed target DFA state for the given input symbol\n// {@code t}. If {@code t} does not lead to a valid DFA state, p method\n// returns {@link //ERROR}.\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t int) *DFAState {\n\treach := p.computeReachSet(previousD.configs, t, false)\n\n\tif reach == nil {\n\t\tp.addDFAEdge(dfa, previousD, t, ATNSimulatorError)\n\t\treturn ATNSimulatorError\n\t}\n\t// create new target state we'll add to DFA after it's complete\n\tD := NewDFAState(-1, reach)\n\n\tpredictedAlt := p.getUniqueAlt(reach)\n\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\taltSubSets := PredictionModegetConflictingAltSubsets(reach)\n\t\tfmt.Println(\"SLL altSubSets=\" + fmt.Sprint(altSubSets) +\n\t\t\t\", previous=\" + previousD.configs.String() +\n\t\t\t\", configs=\" + reach.String() +\n\t\t\t\", predict=\" + strconv.Itoa(predictedAlt) +\n\t\t\t\", allSubsetsConflict=\" +\n\t\t\tfmt.Sprint(PredictionModeallSubsetsConflict(altSubSets)) +\n\t\t\t\", conflictingAlts=\" + p.getConflictingAlts(reach).String())\n\t}\n\tif predictedAlt != ATNInvalidAltNumber {\n\t\t// NO CONFLICT, UNIQUELY PREDICTED ALT\n\t\tD.isAcceptState = true\n\t\tD.configs.uniqueAlt = predictedAlt\n\t\tD.setPrediction(predictedAlt)\n\t} else if PredictionModehasSLLConflictTerminatingPrediction(p.predictionMode, reach) {\n\t\t// MORE THAN ONE VIABLE ALTERNATIVE\n\t\tD.configs.conflictingAlts = p.getConflictingAlts(reach)\n\t\tD.requiresFullContext = true\n\t\t// in SLL-only mode, we will stop at p state and return the minimum alt\n\t\tD.isAcceptState = true\n\t\tD.setPrediction(D.configs.conflictingAlts.minValue())\n\t}\n\tif D.isAcceptState && D.configs.hasSemanticContext {\n\t\tp.predicateDFAState(D, p.atn.getDecisionState(dfa.decision))\n\t\tif D.predicates != nil {\n\t\t\tD.setPrediction(ATNInvalidAltNumber)\n\t\t}\n\t}\n\t// all adds to dfa are done after we've created full D state\n\tD = p.addDFAEdge(dfa, previousD, t, D)\n\treturn D\n}\n\nfunc (p *ParserATNSimulator) predicateDFAState(dfaState *DFAState, decisionState DecisionState) {\n\t// We need to test all predicates, even in DFA states that\n\t// uniquely predict alternative.\n\tnalts := len(decisionState.GetTransitions())\n\t// Update DFA so reach becomes accept state with (predicate,alt)\n\t// pairs if preds found for conflicting alts\n\taltsToCollectPredsFrom := p.getConflictingAltsOrUniqueAlt(dfaState.configs)\n\taltToPred := p.getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState.configs, nalts)\n\tif altToPred != nil {\n\t\tdfaState.predicates = p.getPredicatePredictions(altsToCollectPredsFrom, altToPred)\n\t\tdfaState.setPrediction(ATNInvalidAltNumber) // make sure we use preds\n\t} else {\n\t\t// There are preds in configs but they might go away\n\t\t// when OR'd together like {p}? || NONE == NONE. If neither\n\t\t// alt has preds, resolve to min alt\n\t\tdfaState.setPrediction(altsToCollectPredsFrom.minValue())\n\t}\n}\n\n// comes back with reach.uniqueAlt set to a valid alt\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 *ATNConfigSet, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) {\n\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"execATNWithFullContext \" + s0.String())\n\t}\n\n\tfullCtx := true\n\tfoundExactAmbig := false\n\tvar reach *ATNConfigSet\n\tprevious := s0\n\tinput.Seek(startIndex)\n\tt := input.LA(1)\n\tpredictedAlt := -1\n\n\tfor { // for more work\n\t\treach = p.computeReachSet(previous, t, fullCtx)\n\t\tif reach == nil {\n\t\t\t// if any configs in previous dipped into outer context, that\n\t\t\t// means that input up to t actually finished entry rule\n\t\t\t// at least for LL decision. Full LL doesn't dip into outer\n\t\t\t// so don't need special case.\n\t\t\t// We will get an error no matter what so delay until after\n\t\t\t// decision better error message. Also, no reachable target\n\t\t\t// ATN states in SLL implies LL will also get nowhere.\n\t\t\t// If conflict in states that dip out, choose min since we\n\t\t\t// will get error no matter what.\n\t\t\tinput.Seek(startIndex)\n\t\t\talt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext)\n\t\t\tif alt != ATNInvalidAltNumber {\n\t\t\t\treturn alt, nil\n\t\t\t}\n\t\t\treturn alt, p.noViableAlt(input, outerContext, previous, startIndex)\n\t\t}\n\t\taltSubSets := PredictionModegetConflictingAltSubsets(reach)\n\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\tfmt.Println(\"LL altSubSets=\" + fmt.Sprint(altSubSets) + \", predict=\" +\n\t\t\t\tstrconv.Itoa(PredictionModegetUniqueAlt(altSubSets)) + \", resolvesToJustOneViableAlt=\" +\n\t\t\t\tfmt.Sprint(PredictionModeresolvesToJustOneViableAlt(altSubSets)))\n\t\t}\n\t\treach.uniqueAlt = p.getUniqueAlt(reach)\n\t\t// unique prediction?\n\t\tif reach.uniqueAlt != ATNInvalidAltNumber {\n\t\t\tpredictedAlt = reach.uniqueAlt\n\t\t\tbreak\n\t\t}\n\t\tif p.predictionMode != PredictionModeLLExactAmbigDetection {\n\t\t\tpredictedAlt = PredictionModeresolvesToJustOneViableAlt(altSubSets)\n\t\t\tif predictedAlt != ATNInvalidAltNumber {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\t// In exact ambiguity mode, we never try to terminate early.\n\t\t\t// Just keeps scarfing until we know what the conflict is\n\t\t\tif PredictionModeallSubsetsConflict(altSubSets) && PredictionModeallSubsetsEqual(altSubSets) {\n\t\t\t\tfoundExactAmbig = true\n\t\t\t\tpredictedAlt = PredictionModegetSingleViableAlt(altSubSets)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// else there are multiple non-conflicting subsets or\n\t\t\t// we're not sure what the ambiguity is yet.\n\t\t\t// So, keep going.\n\t\t}\n\t\tprevious = reach\n\t\tif t != TokenEOF {\n\t\t\tinput.Consume()\n\t\t\tt = input.LA(1)\n\t\t}\n\t}\n\t// If the configuration set uniquely predicts an alternative,\n\t// without conflict, then we know that it's a full LL decision\n\t// not SLL.\n\tif reach.uniqueAlt != ATNInvalidAltNumber {\n\t\tp.ReportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.Index())\n\t\treturn predictedAlt, nil\n\t}\n\t// We do not check predicates here because we have checked them\n\t// on-the-fly when doing full context prediction.\n\n\t//\n\t// In non-exact ambiguity detection mode, we might\tactually be able to\n\t// detect an exact ambiguity, but I'm not going to spend the cycles\n\t// needed to check. We only emit ambiguity warnings in exact ambiguity\n\t// mode.\n\t//\n\t// For example, we might know that we have conflicting configurations.\n\t// But, that does not mean that there is no way forward without a\n\t// conflict. It's possible to have non-conflicting alt subsets as in:\n\t//\n\t// altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}]\n\t//\n\t// from\n\t//\n\t//    [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]),\n\t//     (13,2,[5 10 $]), (21,2,[5 10 $]), (11,2,[$])]\n\t//\n\t// In p case, (17,1,[5 $]) indicates there is some next sequence that\n\t// would resolve p without conflict to alternative 1. Any other viable\n\t// next sequence, however, is associated with a conflict.  We stop\n\t// looking for input because no amount of further lookahead will alter\n\t// the fact that we should predict alternative 1.  We just can't say for\n\t// sure that there is an ambiguity without looking further.\n\n\tp.ReportAmbiguity(dfa, D, startIndex, input.Index(), foundExactAmbig, reach.Alts(), reach)\n\n\treturn predictedAlt, nil\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) computeReachSet(closure *ATNConfigSet, t int, fullCtx bool) *ATNConfigSet {\n\tif p.mergeCache == nil {\n\t\tp.mergeCache = NewJPCMap(ReachSetCollection, \"Merge cache for computeReachSet()\")\n\t}\n\tintermediate := NewATNConfigSet(fullCtx)\n\n\t// Configurations already in a rule stop state indicate reaching the end\n\t// of the decision rule (local context) or end of the start rule (full\n\t// context). Once reached, these configurations are never updated by a\n\t// closure operation, so they are handled separately for the performance\n\t// advantage of having a smaller intermediate set when calling closure.\n\t//\n\t// For full-context reach operations, separate handling is required to\n\t// ensure that the alternative Matching the longest overall sequence is\n\t// chosen when multiple such configurations can Match the input.\n\n\tvar skippedStopStates []*ATNConfig\n\n\t// First figure out where we can reach on input t\n\tfor _, c := range closure.configs {\n\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\tfmt.Println(\"testing \" + p.GetTokenName(t) + \" at \" + c.String())\n\t\t}\n\n\t\tif _, ok := c.GetState().(*RuleStopState); ok {\n\t\t\tif fullCtx || t == TokenEOF {\n\t\t\t\tskippedStopStates = append(skippedStopStates, c)\n\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\tfmt.Println(\"added \" + c.String() + \" to SkippedStopStates\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, trans := range c.GetState().GetTransitions() {\n\t\t\ttarget := p.getReachableTarget(trans, t)\n\t\t\tif target != nil {\n\t\t\t\tcfg := NewATNConfig4(c, target)\n\t\t\t\tintermediate.Add(cfg, p.mergeCache)\n\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\tfmt.Println(\"added \" + cfg.String() + \" to intermediate\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Now figure out where the reach operation can take us...\n\tvar reach *ATNConfigSet\n\n\t// This block optimizes the reach operation for intermediate sets which\n\t// trivially indicate a termination state for the overall\n\t// AdaptivePredict operation.\n\t//\n\t// The conditions assume that intermediate\n\t// contains all configurations relevant to the reach set, but p\n\t// condition is not true when one or more configurations have been\n\t// withheld in SkippedStopStates, or when the current symbol is EOF.\n\t//\n\tif skippedStopStates == nil && t != TokenEOF {\n\t\tif len(intermediate.configs) == 1 {\n\t\t\t// Don't pursue the closure if there is just one state.\n\t\t\t// It can only have one alternative just add to result\n\t\t\t// Also don't pursue the closure if there is unique alternative\n\t\t\t// among the configurations.\n\t\t\treach = intermediate\n\t\t} else if p.getUniqueAlt(intermediate) != ATNInvalidAltNumber {\n\t\t\t// Also don't pursue the closure if there is unique alternative\n\t\t\t// among the configurations.\n\t\t\treach = intermediate\n\t\t}\n\t}\n\t// If the reach set could not be trivially determined, perform a closure\n\t// operation on the intermediate set to compute its initial value.\n\t//\n\tif reach == nil {\n\t\treach = NewATNConfigSet(fullCtx)\n\t\tclosureBusy := NewClosureBusy(\"ParserATNSimulator.computeReachSet() make a closureBusy\")\n\t\ttreatEOFAsEpsilon := t == TokenEOF\n\t\tamount := len(intermediate.configs)\n\t\tfor k := 0; k < amount; k++ {\n\t\t\tp.closure(intermediate.configs[k], reach, closureBusy, false, fullCtx, treatEOFAsEpsilon)\n\t\t}\n\t}\n\tif t == TokenEOF {\n\t\t// After consuming EOF no additional input is possible, so we are\n\t\t// only interested in configurations which reached the end of the\n\t\t// decision rule (local context) or end of the start rule (full\n\t\t// context). Update reach to contain only these configurations. This\n\t\t// handles both explicit EOF transitions in the grammar and implicit\n\t\t// EOF transitions following the end of the decision or start rule.\n\t\t//\n\t\t// When reach==intermediate, no closure operation was performed. In\n\t\t// p case, removeAllConfigsNotInRuleStopState needs to check for\n\t\t// reachable rule stop states as well as configurations already in\n\t\t// a rule stop state.\n\t\t//\n\t\t// This is handled before the configurations in SkippedStopStates,\n\t\t// because any configurations potentially added from that list are\n\t\t// already guaranteed to meet this condition whether it's\n\t\t// required.\n\t\t//\n\t\treach = p.removeAllConfigsNotInRuleStopState(reach, reach.Equals(intermediate))\n\t}\n\t// If SkippedStopStates!=nil, then it contains at least one\n\t// configuration. For full-context reach operations, these\n\t// configurations reached the end of the start rule, in which case we\n\t// only add them back to reach if no configuration during the current\n\t// closure operation reached such a state. This ensures AdaptivePredict\n\t// chooses an alternative Matching the longest overall sequence when\n\t// multiple alternatives are viable.\n\t//\n\tif skippedStopStates != nil && ((!fullCtx) || (!PredictionModehasConfigInRuleStopState(reach))) {\n\t\tfor l := 0; l < len(skippedStopStates); l++ {\n\t\t\treach.Add(skippedStopStates[l], p.mergeCache)\n\t\t}\n\t}\n\n\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"computeReachSet \" + closure.String() + \" -> \" + reach.String())\n\t}\n\n\tif len(reach.configs) == 0 {\n\t\treturn nil\n\t}\n\n\treturn reach\n}\n\n// removeAllConfigsNotInRuleStopState returns a configuration set containing only the configurations from\n// configs which are in a [RuleStopState]. If all\n// configurations in configs are already in a rule stop state, this\n// method simply returns configs.\n//\n// When lookToEndOfRule is true, this method uses\n// [ATN].[NextTokens] for each configuration in configs which is\n// not already in a rule stop state to see if a rule stop state is reachable\n// from the configuration via epsilon-only transitions.\n//\n// When lookToEndOfRule is true, this method checks for rule stop states\n// reachable by epsilon-only transitions from each configuration in\n// configs.\n//\n// The func returns configs if all configurations in configs are in a\n// rule stop state, otherwise it returns a new configuration set containing only\n// the configurations from configs which are in a rule stop state\nfunc (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs *ATNConfigSet, lookToEndOfRule bool) *ATNConfigSet {\n\tif PredictionModeallConfigsInRuleStopStates(configs) {\n\t\treturn configs\n\t}\n\tresult := NewATNConfigSet(configs.fullCtx)\n\tfor _, config := range configs.configs {\n\t\tif _, ok := config.GetState().(*RuleStopState); ok {\n\t\t\tresult.Add(config, p.mergeCache)\n\t\t\tcontinue\n\t\t}\n\t\tif lookToEndOfRule && config.GetState().GetEpsilonOnlyTransitions() {\n\t\t\tNextTokens := p.atn.NextTokens(config.GetState(), nil)\n\t\t\tif NextTokens.contains(TokenEpsilon) {\n\t\t\t\tendOfRuleState := p.atn.ruleToStopState[config.GetState().GetRuleIndex()]\n\t\t\t\tresult.Add(NewATNConfig4(config, endOfRuleState), p.mergeCache)\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, fullCtx bool) *ATNConfigSet {\n\t// always at least the implicit call to start rule\n\tinitialContext := predictionContextFromRuleContext(p.atn, ctx)\n\tconfigs := NewATNConfigSet(fullCtx)\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"computeStartState from ATN state \" + a.String() +\n\t\t\t\" initialContext=\" + initialContext.String())\n\t}\n\n\tfor i := 0; i < len(a.GetTransitions()); i++ {\n\t\ttarget := a.GetTransitions()[i].getTarget()\n\t\tc := NewATNConfig6(target, i+1, initialContext)\n\t\tclosureBusy := NewClosureBusy(\"ParserATNSimulator.computeStartState() make a closureBusy\")\n\t\tp.closure(c, configs, closureBusy, true, fullCtx, false)\n\t}\n\treturn configs\n}\n\n// applyPrecedenceFilter transforms the start state computed by\n// [computeStartState] to the special start state used by a\n// precedence [DFA] for a particular precedence value. The transformation\n// process applies the following changes to the start state's configuration\n// set.\n//\n//  1. Evaluate the precedence predicates for each configuration using\n//     [SemanticContext].evalPrecedence.\n//  2. Remove all configurations which predict an alternative greater than\n//     1, for which another configuration that predicts alternative 1 is in the\n//     same ATN state with the same prediction context.\n//\n// Transformation 2 is valid for the following reasons:\n//\n//   - The closure block cannot contain any epsilon transitions which bypass\n//     the body of the closure, so all states reachable via alternative 1 are\n//     part of the precedence alternatives of the transformed left-recursive\n//     rule.\n//   - The \"primary\" portion of a left recursive rule cannot contain an\n//     epsilon transition, so the only way an alternative other than 1 can exist\n//     in a state that is also reachable via alternative 1 is by nesting calls\n//     to the left-recursive rule, with the outer calls not being at the\n//     preferred precedence level.\n//\n// The prediction context must be considered by this filter to address\n// situations like the following:\n//\n//\tgrammar TA\n//\tprog: statement* EOF\n//\tstatement: letterA | statement letterA 'b'\n//\tletterA: 'a'\n//\n// In the above grammar, the [ATN] state immediately before the token\n// reference 'a' in letterA is reachable from the left edge\n// of both the primary and closure blocks of the left-recursive rule\n// statement. The prediction context associated with each of these\n// configurations distinguishes between them, and prevents the alternative\n// which stepped out to prog, and then back in to statement\n// from being eliminated by the filter.\n//\n// The func returns the transformed configuration set representing the start state\n// for a precedence [DFA] at a particular precedence level (determined by\n// calling [Parser].getPrecedence).\nfunc (p *ParserATNSimulator) applyPrecedenceFilter(configs *ATNConfigSet) *ATNConfigSet {\n\n\tstatesFromAlt1 := make(map[int]*PredictionContext)\n\tconfigSet := NewATNConfigSet(configs.fullCtx)\n\n\tfor _, config := range configs.configs {\n\t\t// handle alt 1 first\n\t\tif config.GetAlt() != 1 {\n\t\t\tcontinue\n\t\t}\n\t\tupdatedContext := config.GetSemanticContext().evalPrecedence(p.parser, p.outerContext)\n\t\tif updatedContext == nil {\n\t\t\t// the configuration was eliminated\n\t\t\tcontinue\n\t\t}\n\t\tstatesFromAlt1[config.GetState().GetStateNumber()] = config.GetContext()\n\t\tif updatedContext != config.GetSemanticContext() {\n\t\t\tconfigSet.Add(NewATNConfig2(config, updatedContext), p.mergeCache)\n\t\t} else {\n\t\t\tconfigSet.Add(config, p.mergeCache)\n\t\t}\n\t}\n\tfor _, config := range configs.configs {\n\n\t\tif config.GetAlt() == 1 {\n\t\t\t// already handled\n\t\t\tcontinue\n\t\t}\n\t\t// In the future, p elimination step could be updated to also\n\t\t// filter the prediction context for alternatives predicting alt>1\n\t\t// (basically a graph subtraction algorithm).\n\t\tif !config.getPrecedenceFilterSuppressed() {\n\t\t\tcontext := statesFromAlt1[config.GetState().GetStateNumber()]\n\t\t\tif context != nil && context.Equals(config.GetContext()) {\n\t\t\t\t// eliminated\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tconfigSet.Add(config, p.mergeCache)\n\t}\n\treturn configSet\n}\n\nfunc (p *ParserATNSimulator) getReachableTarget(trans Transition, ttype int) ATNState {\n\tif trans.Matches(ttype, 0, p.atn.maxTokenType) {\n\t\treturn trans.getTarget()\n\t}\n\n\treturn nil\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs *ATNConfigSet, nalts int) []SemanticContext {\n\n\taltToPred := make([]SemanticContext, nalts+1)\n\tfor _, c := range configs.configs {\n\t\tif ambigAlts.contains(c.GetAlt()) {\n\t\t\taltToPred[c.GetAlt()] = SemanticContextorContext(altToPred[c.GetAlt()], c.GetSemanticContext())\n\t\t}\n\t}\n\tnPredAlts := 0\n\tfor i := 1; i <= nalts; i++ {\n\t\tpred := altToPred[i]\n\t\tif pred == nil {\n\t\t\taltToPred[i] = SemanticContextNone\n\t\t} else if pred != SemanticContextNone {\n\t\t\tnPredAlts++\n\t\t}\n\t}\n\t// unambiguous alts are nil in altToPred\n\tif nPredAlts == 0 {\n\t\taltToPred = nil\n\t}\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"getPredsForAmbigAlts result \" + fmt.Sprint(altToPred))\n\t}\n\treturn altToPred\n}\n\nfunc (p *ParserATNSimulator) getPredicatePredictions(ambigAlts *BitSet, altToPred []SemanticContext) []*PredPrediction {\n\tpairs := make([]*PredPrediction, 0)\n\tcontainsPredicate := false\n\tfor i := 1; i < len(altToPred); i++ {\n\t\tpred := altToPred[i]\n\t\t// un-predicated is indicated by SemanticContextNONE\n\t\tif ambigAlts != nil && ambigAlts.contains(i) {\n\t\t\tpairs = append(pairs, NewPredPrediction(pred, i))\n\t\t}\n\t\tif pred != SemanticContextNone {\n\t\t\tcontainsPredicate = true\n\t\t}\n\t}\n\tif !containsPredicate {\n\t\treturn nil\n\t}\n\treturn pairs\n}\n\n// getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule is used to improve the localization of error messages by\n// choosing an alternative rather than panic a NoViableAltException in particular prediction scenarios where the\n// Error state was reached during [ATN] simulation.\n//\n// The default implementation of this method uses the following\n// algorithm to identify an [ATN] configuration which successfully parsed the\n// decision entry rule. Choosing such an alternative ensures that the\n// [ParserRuleContext] returned by the calling rule will be complete\n// and valid, and the syntax error will be Reported later at a more\n// localized location.\n//\n//   - If a syntactically valid path or paths reach the end of the decision rule, and\n//     they are semantically valid if predicated, return the min associated alt.\n//   - Else, if a semantically invalid but syntactically valid path exist\n//     or paths exist, return the minimum associated alt.\n//   - Otherwise, return [ATNInvalidAltNumber].\n//\n// In some scenarios, the algorithm described above could predict an\n// alternative which will result in a [FailedPredicateException] in\n// the parser. Specifically, this could occur if the only configuration\n// capable of successfully parsing to the end of the decision rule is\n// blocked by a semantic predicate. By choosing this alternative within\n// [AdaptivePredict] instead of panic a [NoViableAltException], the resulting\n// [FailedPredicateException] in the parser will identify the specific\n// predicate which is preventing the parser from successfully parsing the\n// decision rule, which helps developers identify and correct logic errors\n// in semantic predicates.\n//\n// pass in the configs holding ATN configurations which were valid immediately before\n// the ERROR state was reached, outerContext as the initial parser context from the paper\n// or the parser stack at the instant before prediction commences.\n//\n// The func returns the value to return from [AdaptivePredict], or\n// [ATNInvalidAltNumber] if a suitable alternative was not\n// identified and [AdaptivePredict] should report an error instead.\nfunc (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs *ATNConfigSet, outerContext ParserRuleContext) int {\n\tcfgs := p.splitAccordingToSemanticValidity(configs, outerContext)\n\tsemValidConfigs := cfgs[0]\n\tsemInvalidConfigs := cfgs[1]\n\talt := p.GetAltThatFinishedDecisionEntryRule(semValidConfigs)\n\tif alt != ATNInvalidAltNumber { // semantically/syntactically viable path exists\n\t\treturn alt\n\t}\n\t// Is there a syntactically valid path with a failed pred?\n\tif len(semInvalidConfigs.configs) > 0 {\n\t\talt = p.GetAltThatFinishedDecisionEntryRule(semInvalidConfigs)\n\t\tif alt != ATNInvalidAltNumber { // syntactically viable path exists\n\t\t\treturn alt\n\t\t}\n\t}\n\treturn ATNInvalidAltNumber\n}\n\nfunc (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs *ATNConfigSet) int {\n\talts := NewIntervalSet()\n\n\tfor _, c := range configs.configs {\n\t\t_, ok := c.GetState().(*RuleStopState)\n\n\t\tif c.GetReachesIntoOuterContext() > 0 || (ok && c.GetContext().hasEmptyPath()) {\n\t\t\talts.addOne(c.GetAlt())\n\t\t}\n\t}\n\tif alts.length() == 0 {\n\t\treturn ATNInvalidAltNumber\n\t}\n\n\treturn alts.first()\n}\n\n// Walk the list of configurations and split them according to\n//  those that have preds evaluating to true/false.  If no pred, assume\n//  true pred and include in succeeded set.  Returns Pair of sets.\n//\n//  Create a NewSet so as not to alter the incoming parameter.\n//\n//  Assumption: the input stream has been restored to the starting point\n//  prediction, which is where predicates need to evaluate.\n\ntype ATNConfigSetPair struct {\n\titem0, item1 *ATNConfigSet\n}\n\nfunc (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs *ATNConfigSet, outerContext ParserRuleContext) []*ATNConfigSet {\n\tsucceeded := NewATNConfigSet(configs.fullCtx)\n\tfailed := NewATNConfigSet(configs.fullCtx)\n\n\tfor _, c := range configs.configs {\n\t\tif c.GetSemanticContext() != SemanticContextNone {\n\t\t\tpredicateEvaluationResult := c.GetSemanticContext().evaluate(p.parser, outerContext)\n\t\t\tif predicateEvaluationResult {\n\t\t\t\tsucceeded.Add(c, nil)\n\t\t\t} else {\n\t\t\t\tfailed.Add(c, nil)\n\t\t\t}\n\t\t} else {\n\t\t\tsucceeded.Add(c, nil)\n\t\t}\n\t}\n\treturn []*ATNConfigSet{succeeded, failed}\n}\n\n// evalSemanticContext looks through a list of predicate/alt pairs, returning alts for the\n// pairs that win. A [SemanticContextNone] predicate indicates an alt containing an\n// un-predicated runtimeConfig which behaves as \"always true.\" If !complete\n// then we stop at the first predicate that evaluates to true. This\n// includes pairs with nil predicates.\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPrediction, outerContext ParserRuleContext, complete bool) *BitSet {\n\tpredictions := NewBitSet()\n\tfor i := 0; i < len(predPredictions); i++ {\n\t\tpair := predPredictions[i]\n\t\tif pair.pred == SemanticContextNone {\n\t\t\tpredictions.add(pair.alt)\n\t\t\tif !complete {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tpredicateEvaluationResult := pair.pred.evaluate(p.parser, outerContext)\n\t\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug {\n\t\t\tfmt.Println(\"eval pred \" + pair.String() + \"=\" + fmt.Sprint(predicateEvaluationResult))\n\t\t}\n\t\tif predicateEvaluationResult {\n\t\t\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug {\n\t\t\t\tfmt.Println(\"PREDICT \" + fmt.Sprint(pair.alt))\n\t\t\t}\n\t\t\tpredictions.add(pair.alt)\n\t\t\tif !complete {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn predictions\n}\n\nfunc (p *ParserATNSimulator) closure(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx, treatEOFAsEpsilon bool) {\n\tinitialDepth := 0\n\tp.closureCheckingStopState(config, configs, closureBusy, collectPredicates,\n\t\tfullCtx, initialDepth, treatEOFAsEpsilon)\n}\n\nfunc (p *ParserATNSimulator) closureCheckingStopState(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {\n\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"closure(\" + config.String() + \")\")\n\t}\n\n\tvar stack []*ATNConfig\n\tvisited := make(map[*ATNConfig]bool)\n\n\tstack = append(stack, config)\n\n\tfor len(stack) > 0 {\n\t\tcurrConfig := stack[len(stack)-1]\n\t\tstack = stack[:len(stack)-1]\n\n\t\tif _, ok := visited[currConfig]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tvisited[currConfig] = true\n\n\t\tif _, ok := currConfig.GetState().(*RuleStopState); ok {\n\t\t\t// We hit rule end. If we have context info, use it\n\t\t\t// run thru all possible stack tops in ctx\n\t\t\tif !currConfig.GetContext().isEmpty() {\n\t\t\t\tfor i := 0; i < currConfig.GetContext().length(); i++ {\n\t\t\t\t\tif currConfig.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState {\n\t\t\t\t\t\tif fullCtx {\n\t\t\t\t\t\t\tnb := NewATNConfig1(currConfig, currConfig.GetState(), BasePredictionContextEMPTY)\n\t\t\t\t\t\t\tconfigs.Add(nb, p.mergeCache)\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we have no context info, just chase follow links (if greedy)\n\t\t\t\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\t\t\t\tfmt.Println(\"FALLING off rule \" + p.getRuleName(currConfig.GetState().GetRuleIndex()))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tp.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\treturnState := p.atn.states[currConfig.GetContext().getReturnState(i)]\n\t\t\t\t\tnewContext := currConfig.GetContext().GetParent(i) // \"pop\" return state\n\n\t\t\t\t\tc := NewATNConfig5(returnState, currConfig.GetAlt(), newContext, currConfig.GetSemanticContext())\n\t\t\t\t\t// While we have context to pop back from, we may have\n\t\t\t\t\t// gotten that context AFTER having falling off a rule.\n\t\t\t\t\t// Make sure we track that we are now out of context.\n\t\t\t\t\tc.SetReachesIntoOuterContext(currConfig.GetReachesIntoOuterContext())\n\n\t\t\t\t\tstack = append(stack, c)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t} else if fullCtx {\n\t\t\t\t// reached end of start rule\n\t\t\t\tconfigs.Add(currConfig, p.mergeCache)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t// else if we have no context info, just chase follow links (if greedy)\n\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\tfmt.Println(\"FALLING off rule \" + p.getRuleName(currConfig.GetState().GetRuleIndex()))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tp.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)\n\t}\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) closureCheckingStopStateRecursive(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {\n\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"closure(\" + config.String() + \")\")\n\t}\n\n\tif _, ok := config.GetState().(*RuleStopState); ok {\n\t\t// We hit rule end. If we have context info, use it\n\t\t// run thru all possible stack tops in ctx\n\t\tif !config.GetContext().isEmpty() {\n\t\t\tfor i := 0; i < config.GetContext().length(); i++ {\n\t\t\t\tif config.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState {\n\t\t\t\t\tif fullCtx {\n\t\t\t\t\t\tnb := NewATNConfig1(config, config.GetState(), BasePredictionContextEMPTY)\n\t\t\t\t\t\tconfigs.Add(nb, p.mergeCache)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// we have no context info, just chase follow links (if greedy)\n\t\t\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\t\t\tfmt.Println(\"FALLING off rule \" + p.getRuleName(config.GetState().GetRuleIndex()))\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturnState := p.atn.states[config.GetContext().getReturnState(i)]\n\t\t\t\tnewContext := config.GetContext().GetParent(i) // \"pop\" return state\n\n\t\t\t\tc := NewATNConfig5(returnState, config.GetAlt(), newContext, config.GetSemanticContext())\n\t\t\t\t// While we have context to pop back from, we may have\n\t\t\t\t// gotten that context AFTER having falling off a rule.\n\t\t\t\t// Make sure we track that we are now out of context.\n\t\t\t\tc.SetReachesIntoOuterContext(config.GetReachesIntoOuterContext())\n\t\t\t\tp.closureCheckingStopState(c, configs, closureBusy, collectPredicates, fullCtx, depth-1, treatEOFAsEpsilon)\n\t\t\t}\n\t\t\treturn\n\t\t} else if fullCtx {\n\t\t\t// reached end of start rule\n\t\t\tconfigs.Add(config, p.mergeCache)\n\t\t\treturn\n\t\t} else {\n\t\t\t// else if we have no context info, just chase follow links (if greedy)\n\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\tfmt.Println(\"FALLING off rule \" + p.getRuleName(config.GetState().GetRuleIndex()))\n\t\t\t}\n\t\t}\n\t}\n\tp.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)\n}\n\n// Do the actual work of walking epsilon edges\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) closureWork(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {\n\tstate := config.GetState()\n\t// optimization\n\tif !state.GetEpsilonOnlyTransitions() {\n\t\tconfigs.Add(config, p.mergeCache)\n\t\t// make sure to not return here, because EOF transitions can act as\n\t\t// both epsilon transitions and non-epsilon transitions.\n\t}\n\tfor i := 0; i < len(state.GetTransitions()); i++ {\n\t\tif i == 0 && p.canDropLoopEntryEdgeInLeftRecursiveRule(config) {\n\t\t\tcontinue\n\t\t}\n\n\t\tt := state.GetTransitions()[i]\n\t\t_, ok := t.(*ActionTransition)\n\t\tcontinueCollecting := collectPredicates && !ok\n\t\tc := p.getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEOFAsEpsilon)\n\t\tif c != nil {\n\t\t\tnewDepth := depth\n\n\t\t\tif _, ok := config.GetState().(*RuleStopState); ok {\n\t\t\t\t// target fell off end of rule mark resulting c as having dipped into outer context\n\t\t\t\t// We can't get here if incoming config was rule stop and we had context\n\t\t\t\t// track how far we dip into outer context.  Might\n\t\t\t\t// come in handy and we avoid evaluating context dependent\n\t\t\t\t// preds if this is > 0.\n\n\t\t\t\tif p.dfa != nil && p.dfa.getPrecedenceDfa() {\n\t\t\t\t\tif t.(*EpsilonTransition).outermostPrecedenceReturn == p.dfa.atnStartState.GetRuleIndex() {\n\t\t\t\t\t\tc.setPrecedenceFilterSuppressed(true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tc.SetReachesIntoOuterContext(c.GetReachesIntoOuterContext() + 1)\n\n\t\t\t\t_, present := closureBusy.Put(c)\n\t\t\t\tif present {\n\t\t\t\t\t// avoid infinite recursion for right-recursive rules\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tconfigs.dipsIntoOuterContext = true // TODO: can remove? only care when we add to set per middle of this method\n\t\t\t\tnewDepth--\n\t\t\t\tif runtimeConfig.parserATNSimulatorDebug {\n\t\t\t\t\tfmt.Println(\"dips into outer ctx: \" + c.String())\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\tif !t.getIsEpsilon() {\n\t\t\t\t\t_, present := closureBusy.Put(c)\n\t\t\t\t\tif present {\n\t\t\t\t\t\t// avoid infinite recursion for EOF* and EOF+\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif _, ok := t.(*RuleTransition); ok {\n\t\t\t\t\t// latch when newDepth goes negative - once we step out of the entry context we can't return\n\t\t\t\t\tif newDepth >= 0 {\n\t\t\t\t\t\tnewDepth++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEOFAsEpsilon)\n\t\t}\n\t}\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) canDropLoopEntryEdgeInLeftRecursiveRule(config *ATNConfig) bool {\n\tif !runtimeConfig.lRLoopEntryBranchOpt {\n\t\treturn false\n\t}\n\n\t_p := config.GetState()\n\n\t// First check to see if we are in StarLoopEntryState generated during\n\t// left-recursion elimination. For efficiency, also check if\n\t// the context has an empty stack case. If so, it would mean\n\t// global FOLLOW so we can't perform optimization\n\tif _p.GetStateType() != ATNStateStarLoopEntry {\n\t\treturn false\n\t}\n\tstartLoop, ok := _p.(*StarLoopEntryState)\n\tif !ok {\n\t\treturn false\n\t}\n\tif !startLoop.precedenceRuleDecision ||\n\t\tconfig.GetContext().isEmpty() ||\n\t\tconfig.GetContext().hasEmptyPath() {\n\t\treturn false\n\t}\n\n\t// Require all return states to return back to the same rule\n\t// that p is in.\n\tnumCtxs := config.GetContext().length()\n\tfor i := 0; i < numCtxs; i++ {\n\t\treturnState := p.atn.states[config.GetContext().getReturnState(i)]\n\t\tif returnState.GetRuleIndex() != _p.GetRuleIndex() {\n\t\t\treturn false\n\t\t}\n\t}\n\tx := _p.GetTransitions()[0].getTarget()\n\tdecisionStartState := x.(BlockStartState)\n\tblockEndStateNum := decisionStartState.getEndState().stateNumber\n\tblockEndState := p.atn.states[blockEndStateNum].(*BlockEndState)\n\n\t// Verify that the top of each stack context leads to loop entry/exit\n\t// state through epsilon edges and w/o leaving rule.\n\n\tfor i := 0; i < numCtxs; i++ { // for each stack context\n\t\treturnStateNumber := config.GetContext().getReturnState(i)\n\t\treturnState := p.atn.states[returnStateNumber]\n\n\t\t// all states must have single outgoing epsilon edge\n\t\tif len(returnState.GetTransitions()) != 1 || !returnState.GetTransitions()[0].getIsEpsilon() {\n\t\t\treturn false\n\t\t}\n\n\t\t// Look for prefix op case like 'not expr', (' type ')' expr\n\t\treturnStateTarget := returnState.GetTransitions()[0].getTarget()\n\t\tif returnState.GetStateType() == ATNStateBlockEnd && returnStateTarget == _p {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Look for 'expr op expr' or case where expr's return state is block end\n\t\t// of (...)* internal block; the block end points to loop back\n\t\t// which points to p but we don't need to check that\n\t\tif returnState == blockEndState {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Look for ternary expr ? expr : expr. The return state points at block end,\n\t\t// which points at loop entry state\n\t\tif returnStateTarget == blockEndState {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Look for complex prefix 'between expr and expr' case where 2nd expr's\n\t\t// return state points at block end state of (...)* internal block\n\t\tif returnStateTarget.GetStateType() == ATNStateBlockEnd &&\n\t\t\tlen(returnStateTarget.GetTransitions()) == 1 &&\n\t\t\treturnStateTarget.GetTransitions()[0].getIsEpsilon() &&\n\t\t\treturnStateTarget.GetTransitions()[0].getTarget() == _p {\n\t\t\tcontinue\n\t\t}\n\n\t\t// anything else ain't conforming\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (p *ParserATNSimulator) getRuleName(index int) string {\n\tif p.parser != nil && index >= 0 {\n\t\treturn p.parser.GetRuleNames()[index]\n\t}\n\tvar sb strings.Builder\n\tsb.Grow(32)\n\n\tsb.WriteString(\"<rule \")\n\tsb.WriteString(strconv.FormatInt(int64(index), 10))\n\tsb.WriteByte('>')\n\treturn sb.String()\n}\n\nfunc (p *ParserATNSimulator) getEpsilonTarget(config *ATNConfig, t Transition, collectPredicates, inContext, fullCtx, treatEOFAsEpsilon bool) *ATNConfig {\n\n\tswitch t.getSerializationType() {\n\tcase TransitionRULE:\n\t\treturn p.ruleTransition(config, t.(*RuleTransition))\n\tcase TransitionPRECEDENCE:\n\t\treturn p.precedenceTransition(config, t.(*PrecedencePredicateTransition), collectPredicates, inContext, fullCtx)\n\tcase TransitionPREDICATE:\n\t\treturn p.predTransition(config, t.(*PredicateTransition), collectPredicates, inContext, fullCtx)\n\tcase TransitionACTION:\n\t\treturn p.actionTransition(config, t.(*ActionTransition))\n\tcase TransitionEPSILON:\n\t\treturn NewATNConfig4(config, t.getTarget())\n\tcase TransitionATOM, TransitionRANGE, TransitionSET:\n\t\t// EOF transitions act like epsilon transitions after the first EOF\n\t\t// transition is traversed\n\t\tif treatEOFAsEpsilon {\n\t\t\tif t.Matches(TokenEOF, 0, 1) {\n\t\t\t\treturn NewATNConfig4(config, t.getTarget())\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn nil\n\t}\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) actionTransition(config *ATNConfig, t *ActionTransition) *ATNConfig {\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"ACTION edge \" + strconv.Itoa(t.ruleIndex) + \":\" + strconv.Itoa(t.actionIndex))\n\t}\n\treturn NewATNConfig4(config, t.getTarget())\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) precedenceTransition(config *ATNConfig,\n\tpt *PrecedencePredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig {\n\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"PRED (collectPredicates=\" + fmt.Sprint(collectPredicates) + \") \" +\n\t\t\tstrconv.Itoa(pt.precedence) + \">=_p, ctx dependent=true\")\n\t\tif p.parser != nil {\n\t\t\tfmt.Println(\"context surrounding pred is \" + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))\n\t\t}\n\t}\n\tvar c *ATNConfig\n\tif collectPredicates && inContext {\n\t\tif fullCtx {\n\t\t\t// In full context mode, we can evaluate predicates on-the-fly\n\t\t\t// during closure, which dramatically reduces the size of\n\t\t\t// the runtimeConfig sets. It also obviates the need to test predicates\n\t\t\t// later during conflict resolution.\n\t\t\tcurrentPosition := p.input.Index()\n\t\t\tp.input.Seek(p.startIndex)\n\t\t\tpredSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)\n\t\t\tp.input.Seek(currentPosition)\n\t\t\tif predSucceeds {\n\t\t\t\tc = NewATNConfig4(config, pt.getTarget()) // no pred context\n\t\t\t}\n\t\t} else {\n\t\t\tnewSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())\n\t\t\tc = NewATNConfig3(config, pt.getTarget(), newSemCtx)\n\t\t}\n\t} else {\n\t\tc = NewATNConfig4(config, pt.getTarget())\n\t}\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"runtimeConfig from pred transition=\" + c.String())\n\t}\n\treturn c\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) predTransition(config *ATNConfig, pt *PredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig {\n\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"PRED (collectPredicates=\" + fmt.Sprint(collectPredicates) + \") \" + strconv.Itoa(pt.ruleIndex) +\n\t\t\t\":\" + strconv.Itoa(pt.predIndex) + \", ctx dependent=\" + fmt.Sprint(pt.isCtxDependent))\n\t\tif p.parser != nil {\n\t\t\tfmt.Println(\"context surrounding pred is \" + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))\n\t\t}\n\t}\n\tvar c *ATNConfig\n\tif collectPredicates && (!pt.isCtxDependent || inContext) {\n\t\tif fullCtx {\n\t\t\t// In full context mode, we can evaluate predicates on-the-fly\n\t\t\t// during closure, which dramatically reduces the size of\n\t\t\t// the config sets. It also obviates the need to test predicates\n\t\t\t// later during conflict resolution.\n\t\t\tcurrentPosition := p.input.Index()\n\t\t\tp.input.Seek(p.startIndex)\n\t\t\tpredSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)\n\t\t\tp.input.Seek(currentPosition)\n\t\t\tif predSucceeds {\n\t\t\t\tc = NewATNConfig4(config, pt.getTarget()) // no pred context\n\t\t\t}\n\t\t} else {\n\t\t\tnewSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())\n\t\t\tc = NewATNConfig3(config, pt.getTarget(), newSemCtx)\n\t\t}\n\t} else {\n\t\tc = NewATNConfig4(config, pt.getTarget())\n\t}\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"config from pred transition=\" + c.String())\n\t}\n\treturn c\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) ruleTransition(config *ATNConfig, t *RuleTransition) *ATNConfig {\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"CALL rule \" + p.getRuleName(t.getTarget().GetRuleIndex()) + \", ctx=\" + config.GetContext().String())\n\t}\n\treturnState := t.followState\n\tnewContext := SingletonBasePredictionContextCreate(config.GetContext(), returnState.GetStateNumber())\n\treturn NewATNConfig1(config, t.getTarget(), newContext)\n}\n\nfunc (p *ParserATNSimulator) getConflictingAlts(configs *ATNConfigSet) *BitSet {\n\taltsets := PredictionModegetConflictingAltSubsets(configs)\n\treturn PredictionModeGetAlts(altsets)\n}\n\n// getConflictingAltsOrUniqueAlt Sam pointed out a problem with the previous definition, v3, of\n// ambiguous states. If we have another state associated with conflicting\n// alternatives, we should keep going. For example, the following grammar\n//\n//\ts : (ID | ID ID?) ;\n//\n// When the [ATN] simulation reaches the state before ;, it has a [DFA]\n// state that looks like:\n//\n//\t[12|1|[], 6|2|[], 12|2|[]].\n//\n// Naturally\n//\n//\t12|1|[] and 12|2|[]\n//\n// conflict, but we cannot stop processing this node\n// because alternative to has another way to continue, via\n//\n//\t[6|2|[]].\n//\n// The key is that we have a single state that has config's only associated\n// with a single alternative, 2, and crucially the state transitions\n// among the configurations are all non-epsilon transitions. That means\n// we don't consider any conflicts that include alternative 2. So, we\n// ignore the conflict between alts 1 and 2. We ignore a set of\n// conflicting alts when there is an intersection with an alternative\n// associated with a single alt state in the state config-list map.\n//\n// It's also the case that we might have two conflicting configurations but\n// also a 3rd non-conflicting configuration for a different alternative:\n//\n//\t[1|1|[], 1|2|[], 8|3|[]].\n//\n// This can come about from grammar:\n//\n//\ta : A | A | A B\n//\n// After Matching input A, we reach the stop state for rule A, state 1.\n// State 8 is the state right before B. Clearly alternatives 1 and 2\n// conflict and no amount of further lookahead will separate the two.\n// However, alternative 3 will be able to continue, so we do not\n// stop working on this state.\n//\n// In the previous example, we're concerned\n// with states associated with the conflicting alternatives. Here alt\n// 3 is not associated with the conflicting configs, but since we can continue\n// looking for input reasonably, I don't declare the state done. We\n// ignore a set of conflicting alts when we have an alternative\n// that we still need to pursue.\nfunc (p *ParserATNSimulator) getConflictingAltsOrUniqueAlt(configs *ATNConfigSet) *BitSet {\n\tvar conflictingAlts *BitSet\n\tif configs.uniqueAlt != ATNInvalidAltNumber {\n\t\tconflictingAlts = NewBitSet()\n\t\tconflictingAlts.add(configs.uniqueAlt)\n\t} else {\n\t\tconflictingAlts = configs.conflictingAlts\n\t}\n\treturn conflictingAlts\n}\n\nfunc (p *ParserATNSimulator) GetTokenName(t int) string {\n\tif t == TokenEOF {\n\t\treturn \"EOF\"\n\t}\n\n\tif p.parser != nil && p.parser.GetLiteralNames() != nil && t < len(p.parser.GetLiteralNames()) {\n\t\treturn p.parser.GetLiteralNames()[t] + \"<\" + strconv.Itoa(t) + \">\"\n\t}\n\n\tif p.parser != nil && p.parser.GetLiteralNames() != nil && t < len(p.parser.GetSymbolicNames()) {\n\t\treturn p.parser.GetSymbolicNames()[t] + \"<\" + strconv.Itoa(t) + \">\"\n\t}\n\n\treturn strconv.Itoa(t)\n}\n\nfunc (p *ParserATNSimulator) getLookaheadName(input TokenStream) string {\n\treturn p.GetTokenName(input.LA(1))\n}\n\n// Used for debugging in [AdaptivePredict] around [execATN], but I cut\n// it out for clarity now that alg. works well. We can leave this\n// \"dead\" code for a bit.\nfunc (p *ParserATNSimulator) dumpDeadEndConfigs(_ *NoViableAltException) {\n\n\tpanic(\"Not implemented\")\n\n\t//    fmt.Println(\"dead end configs: \")\n\t//    var decs = nvae.deadEndConfigs\n\t//\n\t//    for i:=0; i<len(decs); i++ {\n\t//\n\t//    \tc := decs[i]\n\t//        var trans = \"no edges\"\n\t//        if (len(c.state.GetTransitions())>0) {\n\t//            var t = c.state.GetTransitions()[0]\n\t//            if t2, ok := t.(*AtomTransition); ok {\n\t//                trans = \"Atom \"+ p.GetTokenName(t2.label)\n\t//            } else if t3, ok := t.(SetTransition); ok {\n\t//                _, ok := t.(*NotSetTransition)\n\t//\n\t//                var s string\n\t//                if (ok){\n\t//                    s = \"~\"\n\t//                }\n\t//\n\t//                trans = s + \"Set \" + t3.set\n\t//            }\n\t//        }\n\t//        fmt.Errorf(c.String(p.parser, true) + \":\" + trans)\n\t//    }\n}\n\nfunc (p *ParserATNSimulator) noViableAlt(input TokenStream, outerContext ParserRuleContext, configs *ATNConfigSet, startIndex int) *NoViableAltException {\n\treturn NewNoViableAltException(p.parser, input, input.Get(startIndex), input.LT(1), configs, outerContext)\n}\n\nfunc (p *ParserATNSimulator) getUniqueAlt(configs *ATNConfigSet) int {\n\talt := ATNInvalidAltNumber\n\tfor _, c := range configs.configs {\n\t\tif alt == ATNInvalidAltNumber {\n\t\t\talt = c.GetAlt() // found first alt\n\t\t} else if c.GetAlt() != alt {\n\t\t\treturn ATNInvalidAltNumber\n\t\t}\n\t}\n\treturn alt\n}\n\n// Add an edge to the DFA, if possible. This method calls\n// {@link //addDFAState} to ensure the {@code to} state is present in the\n// DFA. If {@code from} is {@code nil}, or if {@code t} is outside the\n// range of edges that can be represented in the DFA tables, p method\n// returns without adding the edge to the DFA.\n//\n// <p>If {@code to} is {@code nil}, p method returns {@code nil}.\n// Otherwise, p method returns the {@link DFAState} returned by calling\n// {@link //addDFAState} for the {@code to} state.</p>\n//\n// @param dfa The DFA\n// @param from The source state for the edge\n// @param t The input symbol\n// @param to The target state for the edge\n//\n// @return If {@code to} is {@code nil}, p method returns {@code nil}\n// otherwise p method returns the result of calling {@link //addDFAState}\n// on {@code to}\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFAState) *DFAState {\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tfmt.Println(\"EDGE \" + from.String() + \" -> \" + to.String() + \" upon \" + p.GetTokenName(t))\n\t}\n\tif to == nil {\n\t\treturn nil\n\t}\n\tp.atn.stateMu.Lock()\n\tto = p.addDFAState(dfa, to) // used existing if possible not incoming\n\tp.atn.stateMu.Unlock()\n\tif from == nil || t < -1 || t > p.atn.maxTokenType {\n\t\treturn to\n\t}\n\tp.atn.edgeMu.Lock()\n\tif from.getEdges() == nil {\n\t\tfrom.setEdges(make([]*DFAState, p.atn.maxTokenType+1+1))\n\t}\n\tfrom.setIthEdge(t+1, to) // connect\n\tp.atn.edgeMu.Unlock()\n\n\tif runtimeConfig.parserATNSimulatorDebug {\n\t\tvar names []string\n\t\tif p.parser != nil {\n\t\t\tnames = p.parser.GetLiteralNames()\n\t\t}\n\n\t\tfmt.Println(\"DFA=\\n\" + dfa.String(names, nil))\n\t}\n\treturn to\n}\n\n// addDFAState adds state D to the [DFA] if it is not already present, and returns\n// the actual instance stored in the [DFA]. If a state equivalent to D\n// is already in the [DFA], the existing state is returned. Otherwise, this\n// method returns D after adding it to the [DFA].\n//\n// If D is [ATNSimulatorError], this method returns [ATNSimulatorError] and\n// does not change the DFA.\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) addDFAState(dfa *DFA, d *DFAState) *DFAState {\n\tif d == ATNSimulatorError {\n\t\treturn d\n\t}\n\n\texisting, present := dfa.Get(d)\n\tif present {\n\t\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\t\tfmt.Print(\"addDFAState \" + d.String() + \" exists\")\n\t\t}\n\t\treturn existing\n\t}\n\n\t// The state will be added if not already there or we will be given back the existing state struct\n\t// if it is present.\n\t//\n\td.stateNumber = dfa.Len()\n\tif !d.configs.readOnly {\n\t\td.configs.OptimizeConfigs(&p.BaseATNSimulator)\n\t\td.configs.readOnly = true\n\t\td.configs.configLookup = nil\n\t}\n\tdfa.Put(d)\n\n\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"addDFAState new \" + d.String())\n\t}\n\n\treturn d\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAlts *BitSet, configs *ATNConfigSet, startIndex, stopIndex int) {\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {\n\t\tinterval := NewInterval(startIndex, stopIndex+1)\n\t\tfmt.Println(\"ReportAttemptingFullContext decision=\" + strconv.Itoa(dfa.decision) + \":\" + configs.String() +\n\t\t\t\", input=\" + p.parser.GetTokenStream().GetTextFromInterval(interval))\n\t}\n\tif p.parser != nil {\n\t\tp.parser.GetErrorListenerDispatch().ReportAttemptingFullContext(p.parser, dfa, startIndex, stopIndex, conflictingAlts, configs)\n\t}\n}\n\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int, configs *ATNConfigSet, startIndex, stopIndex int) {\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {\n\t\tinterval := NewInterval(startIndex, stopIndex+1)\n\t\tfmt.Println(\"ReportContextSensitivity decision=\" + strconv.Itoa(dfa.decision) + \":\" + configs.String() +\n\t\t\t\", input=\" + p.parser.GetTokenStream().GetTextFromInterval(interval))\n\t}\n\tif p.parser != nil {\n\t\tp.parser.GetErrorListenerDispatch().ReportContextSensitivity(p.parser, dfa, startIndex, stopIndex, prediction, configs)\n\t}\n}\n\n// ReportAmbiguity reports and ambiguity in the parse, which shows that the parser will explore a different route.\n//\n// If context-sensitive parsing, we know it's an ambiguity not a conflict or error, but we can report it to the developer\n// so that they can see that this is happening and can take action if they want to.\n//\n//goland:noinspection GoBoolExpressions\nfunc (p *ParserATNSimulator) ReportAmbiguity(dfa *DFA, _ *DFAState, startIndex, stopIndex int,\n\texact bool, ambigAlts *BitSet, configs *ATNConfigSet) {\n\tif runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {\n\t\tinterval := NewInterval(startIndex, stopIndex+1)\n\t\tfmt.Println(\"ReportAmbiguity \" + ambigAlts.String() + \":\" + configs.String() +\n\t\t\t\", input=\" + p.parser.GetTokenStream().GetTextFromInterval(interval))\n\t}\n\tif p.parser != nil {\n\t\tp.parser.GetErrorListenerDispatch().ReportAmbiguity(p.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"reflect\"\n\t\"strconv\"\n)\n\ntype ParserRuleContext interface {\n\tRuleContext\n\n\tSetException(RecognitionException)\n\n\tAddTokenNode(token Token) *TerminalNodeImpl\n\tAddErrorNode(badToken Token) *ErrorNodeImpl\n\n\tEnterRule(listener ParseTreeListener)\n\tExitRule(listener ParseTreeListener)\n\n\tSetStart(Token)\n\tGetStart() Token\n\n\tSetStop(Token)\n\tGetStop() Token\n\n\tAddChild(child RuleContext) RuleContext\n\tRemoveLastChild()\n}\n\ntype BaseParserRuleContext struct {\n\tparentCtx     RuleContext\n\tinvokingState int\n\tRuleIndex     int\n\n\tstart, stop Token\n\texception   RecognitionException\n\tchildren    []Tree\n}\n\nfunc NewBaseParserRuleContext(parent ParserRuleContext, invokingStateNumber int) *BaseParserRuleContext {\n\tprc := new(BaseParserRuleContext)\n\tInitBaseParserRuleContext(prc, parent, invokingStateNumber)\n\treturn prc\n}\n\nfunc InitBaseParserRuleContext(prc *BaseParserRuleContext, parent ParserRuleContext, invokingStateNumber int) {\n\t// What context invoked b rule?\n\tprc.parentCtx = parent\n\n\t// What state invoked the rule associated with b context?\n\t// The \"return address\" is the followState of invokingState\n\t// If parent is nil, b should be -1.\n\tif parent == nil {\n\t\tprc.invokingState = -1\n\t} else {\n\t\tprc.invokingState = invokingStateNumber\n\t}\n\n\tprc.RuleIndex = -1\n\t// * If we are debugging or building a parse tree for a Visitor,\n\t// we need to track all of the tokens and rule invocations associated\n\t// with prc rule's context. This is empty for parsing w/o tree constr.\n\t// operation because we don't the need to track the details about\n\t// how we parse prc rule.\n\t// /\n\tprc.children = nil\n\tprc.start = nil\n\tprc.stop = nil\n\t// The exception that forced prc rule to return. If the rule successfully\n\t// completed, prc is {@code nil}.\n\tprc.exception = nil\n}\n\nfunc (prc *BaseParserRuleContext) SetException(e RecognitionException) {\n\tprc.exception = e\n}\n\nfunc (prc *BaseParserRuleContext) GetChildren() []Tree {\n\treturn prc.children\n}\n\nfunc (prc *BaseParserRuleContext) CopyFrom(ctx *BaseParserRuleContext) {\n\t// from RuleContext\n\tprc.parentCtx = ctx.parentCtx\n\tprc.invokingState = ctx.invokingState\n\tprc.children = nil\n\tprc.start = ctx.start\n\tprc.stop = ctx.stop\n}\n\nfunc (prc *BaseParserRuleContext) GetText() string {\n\tif prc.GetChildCount() == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar s string\n\tfor _, child := range prc.children {\n\t\ts += child.(ParseTree).GetText()\n\t}\n\n\treturn s\n}\n\n// EnterRule is called when any rule is entered.\nfunc (prc *BaseParserRuleContext) EnterRule(_ ParseTreeListener) {\n}\n\n// ExitRule is called when any rule is exited.\nfunc (prc *BaseParserRuleContext) ExitRule(_ ParseTreeListener) {\n}\n\n// * Does not set parent link other add methods do that\nfunc (prc *BaseParserRuleContext) addTerminalNodeChild(child TerminalNode) TerminalNode {\n\tif prc.children == nil {\n\t\tprc.children = make([]Tree, 0)\n\t}\n\tif child == nil {\n\t\tpanic(\"Child may not be null\")\n\t}\n\tprc.children = append(prc.children, child)\n\treturn child\n}\n\nfunc (prc *BaseParserRuleContext) AddChild(child RuleContext) RuleContext {\n\tif prc.children == nil {\n\t\tprc.children = make([]Tree, 0)\n\t}\n\tif child == nil {\n\t\tpanic(\"Child may not be null\")\n\t}\n\tprc.children = append(prc.children, child)\n\treturn child\n}\n\n// RemoveLastChild is used by [EnterOuterAlt] to toss out a [RuleContext] previously added as\n// we entered a rule. If we have a label, we will need to remove\n// the generic ruleContext object.\nfunc (prc *BaseParserRuleContext) RemoveLastChild() {\n\tif prc.children != nil && len(prc.children) > 0 {\n\t\tprc.children = prc.children[0 : len(prc.children)-1]\n\t}\n}\n\nfunc (prc *BaseParserRuleContext) AddTokenNode(token Token) *TerminalNodeImpl {\n\n\tnode := NewTerminalNodeImpl(token)\n\tprc.addTerminalNodeChild(node)\n\tnode.parentCtx = prc\n\treturn node\n\n}\n\nfunc (prc *BaseParserRuleContext) AddErrorNode(badToken Token) *ErrorNodeImpl {\n\tnode := NewErrorNodeImpl(badToken)\n\tprc.addTerminalNodeChild(node)\n\tnode.parentCtx = prc\n\treturn node\n}\n\nfunc (prc *BaseParserRuleContext) GetChild(i int) Tree {\n\tif prc.children != nil && len(prc.children) >= i {\n\t\treturn prc.children[i]\n\t}\n\n\treturn nil\n}\n\nfunc (prc *BaseParserRuleContext) GetChildOfType(i int, childType reflect.Type) RuleContext {\n\tif childType == nil {\n\t\treturn prc.GetChild(i).(RuleContext)\n\t}\n\n\tfor j := 0; j < len(prc.children); j++ {\n\t\tchild := prc.children[j]\n\t\tif reflect.TypeOf(child) == childType {\n\t\t\tif i == 0 {\n\t\t\t\treturn child.(RuleContext)\n\t\t\t}\n\n\t\t\ti--\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (prc *BaseParserRuleContext) ToStringTree(ruleNames []string, recog Recognizer) string {\n\treturn TreesStringTree(prc, ruleNames, recog)\n}\n\nfunc (prc *BaseParserRuleContext) GetRuleContext() RuleContext {\n\treturn prc\n}\n\nfunc (prc *BaseParserRuleContext) Accept(visitor ParseTreeVisitor) interface{} {\n\treturn visitor.VisitChildren(prc)\n}\n\nfunc (prc *BaseParserRuleContext) SetStart(t Token) {\n\tprc.start = t\n}\n\nfunc (prc *BaseParserRuleContext) GetStart() Token {\n\treturn prc.start\n}\n\nfunc (prc *BaseParserRuleContext) SetStop(t Token) {\n\tprc.stop = t\n}\n\nfunc (prc *BaseParserRuleContext) GetStop() Token {\n\treturn prc.stop\n}\n\nfunc (prc *BaseParserRuleContext) GetToken(ttype int, i int) TerminalNode {\n\n\tfor j := 0; j < len(prc.children); j++ {\n\t\tchild := prc.children[j]\n\t\tif c2, ok := child.(TerminalNode); ok {\n\t\t\tif c2.GetSymbol().GetTokenType() == ttype {\n\t\t\t\tif i == 0 {\n\t\t\t\t\treturn c2\n\t\t\t\t}\n\n\t\t\t\ti--\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (prc *BaseParserRuleContext) GetTokens(ttype int) []TerminalNode {\n\tif prc.children == nil {\n\t\treturn make([]TerminalNode, 0)\n\t}\n\n\ttokens := make([]TerminalNode, 0)\n\n\tfor j := 0; j < len(prc.children); j++ {\n\t\tchild := prc.children[j]\n\t\tif tchild, ok := child.(TerminalNode); ok {\n\t\t\tif tchild.GetSymbol().GetTokenType() == ttype {\n\t\t\t\ttokens = append(tokens, tchild)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn tokens\n}\n\nfunc (prc *BaseParserRuleContext) GetPayload() interface{} {\n\treturn prc\n}\n\nfunc (prc *BaseParserRuleContext) getChild(ctxType reflect.Type, i int) RuleContext {\n\tif prc.children == nil || i < 0 || i >= len(prc.children) {\n\t\treturn nil\n\t}\n\n\tj := -1 // what element have we found with ctxType?\n\tfor _, o := range prc.children {\n\n\t\tchildType := reflect.TypeOf(o)\n\n\t\tif childType.Implements(ctxType) {\n\t\t\tj++\n\t\t\tif j == i {\n\t\t\t\treturn o.(RuleContext)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// Go lacks generics, so it's not possible for us to return the child with the correct type, but we do\n// check for convertibility\n\nfunc (prc *BaseParserRuleContext) GetTypedRuleContext(ctxType reflect.Type, i int) RuleContext {\n\treturn prc.getChild(ctxType, i)\n}\n\nfunc (prc *BaseParserRuleContext) GetTypedRuleContexts(ctxType reflect.Type) []RuleContext {\n\tif prc.children == nil {\n\t\treturn make([]RuleContext, 0)\n\t}\n\n\tcontexts := make([]RuleContext, 0)\n\n\tfor _, child := range prc.children {\n\t\tchildType := reflect.TypeOf(child)\n\n\t\tif childType.ConvertibleTo(ctxType) {\n\t\t\tcontexts = append(contexts, child.(RuleContext))\n\t\t}\n\t}\n\treturn contexts\n}\n\nfunc (prc *BaseParserRuleContext) GetChildCount() int {\n\tif prc.children == nil {\n\t\treturn 0\n\t}\n\n\treturn len(prc.children)\n}\n\nfunc (prc *BaseParserRuleContext) GetSourceInterval() Interval {\n\tif prc.start == nil || prc.stop == nil {\n\t\treturn TreeInvalidInterval\n\t}\n\n\treturn NewInterval(prc.start.GetTokenIndex(), prc.stop.GetTokenIndex())\n}\n\n//need to manage circular dependencies, so export now\n\n// Print out a whole tree, not just a node, in LISP format\n// (root child1 .. childN). Print just a node if b is a leaf.\n//\n\nfunc (prc *BaseParserRuleContext) String(ruleNames []string, stop RuleContext) string {\n\n\tvar p ParserRuleContext = prc\n\ts := \"[\"\n\tfor p != nil && p != stop {\n\t\tif ruleNames == nil {\n\t\t\tif !p.IsEmpty() {\n\t\t\t\ts += strconv.Itoa(p.GetInvokingState())\n\t\t\t}\n\t\t} else {\n\t\t\tri := p.GetRuleIndex()\n\t\t\tvar ruleName string\n\t\t\tif ri >= 0 && ri < len(ruleNames) {\n\t\t\t\truleName = ruleNames[ri]\n\t\t\t} else {\n\t\t\t\truleName = strconv.Itoa(ri)\n\t\t\t}\n\t\t\ts += ruleName\n\t\t}\n\t\tif p.GetParent() != nil && (ruleNames != nil || !p.GetParent().(ParserRuleContext).IsEmpty()) {\n\t\t\ts += \" \"\n\t\t}\n\t\tpi := p.GetParent()\n\t\tif pi != nil {\n\t\t\tp = pi.(ParserRuleContext)\n\t\t} else {\n\t\t\tp = nil\n\t\t}\n\t}\n\ts += \"]\"\n\treturn s\n}\n\nfunc (prc *BaseParserRuleContext) SetParent(v Tree) {\n\tif v == nil {\n\t\tprc.parentCtx = nil\n\t} else {\n\t\tprc.parentCtx = v.(RuleContext)\n\t}\n}\n\nfunc (prc *BaseParserRuleContext) GetInvokingState() int {\n\treturn prc.invokingState\n}\n\nfunc (prc *BaseParserRuleContext) SetInvokingState(t int) {\n\tprc.invokingState = t\n}\n\nfunc (prc *BaseParserRuleContext) GetRuleIndex() int {\n\treturn prc.RuleIndex\n}\n\nfunc (prc *BaseParserRuleContext) GetAltNumber() int {\n\treturn ATNInvalidAltNumber\n}\n\nfunc (prc *BaseParserRuleContext) SetAltNumber(_ int) {}\n\n// IsEmpty returns true if the context of b is empty.\n//\n// A context is empty if there is no invoking state, meaning nobody calls\n// current context.\nfunc (prc *BaseParserRuleContext) IsEmpty() bool {\n\treturn prc.invokingState == -1\n}\n\n// GetParent returns the combined text of all child nodes. This method only considers\n// tokens which have been added to the parse tree.\n//\n// Since tokens on hidden channels (e.g. whitespace or comments) are not\n// added to the parse trees, they will not appear in the output of this\n// method.\nfunc (prc *BaseParserRuleContext) GetParent() Tree {\n\treturn prc.parentCtx\n}\n\nvar ParserRuleContextEmpty = NewBaseParserRuleContext(nil, -1)\n\ntype InterpreterRuleContext interface {\n\tParserRuleContext\n}\n\ntype BaseInterpreterRuleContext struct {\n\t*BaseParserRuleContext\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewBaseInterpreterRuleContext(parent BaseInterpreterRuleContext, invokingStateNumber, ruleIndex int) *BaseInterpreterRuleContext {\n\n\tprc := new(BaseInterpreterRuleContext)\n\n\tprc.BaseParserRuleContext = NewBaseParserRuleContext(parent, invokingStateNumber)\n\n\tprc.RuleIndex = ruleIndex\n\n\treturn prc\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/prediction_context.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nvar _emptyPredictionContextHash int\n\nfunc init() {\n\t_emptyPredictionContextHash = murmurInit(1)\n\t_emptyPredictionContextHash = murmurFinish(_emptyPredictionContextHash, 0)\n}\n\nfunc calculateEmptyHash() int {\n\treturn _emptyPredictionContextHash\n}\n\nconst (\n\t// BasePredictionContextEmptyReturnState represents {@code $} in an array in full context mode, $\n\t// doesn't mean wildcard:\n\t//\n\t//   $ + x = [$,x]\n\t//\n\t// Here,\n\t//\n\t//   $ = EmptyReturnState\n\tBasePredictionContextEmptyReturnState = 0x7FFFFFFF\n)\n\n// TODO: JI These are meant to be atomics - this does not seem to match the Java runtime here\n//\n//goland:noinspection GoUnusedGlobalVariable\nvar (\n\tBasePredictionContextglobalNodeCount = 1\n\tBasePredictionContextid              = BasePredictionContextglobalNodeCount\n)\n\nconst (\n\tPredictionContextEmpty = iota\n\tPredictionContextSingleton\n\tPredictionContextArray\n)\n\n// PredictionContext is a go idiomatic implementation of PredictionContext that does not rty to\n// emulate inheritance from Java, and can be used without an interface definition. An interface\n// is not required because no user code will ever need to implement this interface.\ntype PredictionContext struct {\n\tcachedHash   int\n\tpcType       int\n\tparentCtx    *PredictionContext\n\treturnState  int\n\tparents      []*PredictionContext\n\treturnStates []int\n}\n\nfunc NewEmptyPredictionContext() *PredictionContext {\n\tnep := &PredictionContext{}\n\tnep.cachedHash = calculateEmptyHash()\n\tnep.pcType = PredictionContextEmpty\n\tnep.returnState = BasePredictionContextEmptyReturnState\n\treturn nep\n}\n\nfunc NewBaseSingletonPredictionContext(parent *PredictionContext, returnState int) *PredictionContext {\n\tpc := &PredictionContext{}\n\tpc.pcType = PredictionContextSingleton\n\tpc.returnState = returnState\n\tpc.parentCtx = parent\n\tif parent != nil {\n\t\tpc.cachedHash = calculateHash(parent, returnState)\n\t} else {\n\t\tpc.cachedHash = calculateEmptyHash()\n\t}\n\treturn pc\n}\n\nfunc SingletonBasePredictionContextCreate(parent *PredictionContext, returnState int) *PredictionContext {\n\tif returnState == BasePredictionContextEmptyReturnState && parent == nil {\n\t\t// someone can pass in the bits of an array ctx that mean $\n\t\treturn BasePredictionContextEMPTY\n\t}\n\treturn NewBaseSingletonPredictionContext(parent, returnState)\n}\n\nfunc NewArrayPredictionContext(parents []*PredictionContext, returnStates []int) *PredictionContext {\n\t// Parent can be nil only if full ctx mode and we make an array\n\t// from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using\n\t// nil parent and\n\t// returnState == {@link //EmptyReturnState}.\n\thash := murmurInit(1)\n\tfor _, parent := range parents {\n\t\thash = murmurUpdate(hash, parent.Hash())\n\t}\n\tfor _, returnState := range returnStates {\n\t\thash = murmurUpdate(hash, returnState)\n\t}\n\thash = murmurFinish(hash, len(parents)<<1)\n\n\tnec := &PredictionContext{}\n\tnec.cachedHash = hash\n\tnec.pcType = PredictionContextArray\n\tnec.parents = parents\n\tnec.returnStates = returnStates\n\treturn nec\n}\n\nfunc (p *PredictionContext) Hash() int {\n\treturn p.cachedHash\n}\n\nfunc (p *PredictionContext) Equals(other Collectable[*PredictionContext]) bool {\n\tif p == other {\n\t\treturn true\n\t}\n\tswitch p.pcType {\n\tcase PredictionContextEmpty:\n\t\totherP := other.(*PredictionContext)\n\t\treturn other == nil || otherP == nil || otherP.isEmpty()\n\tcase PredictionContextSingleton:\n\t\treturn p.SingletonEquals(other)\n\tcase PredictionContextArray:\n\t\treturn p.ArrayEquals(other)\n\t}\n\treturn false\n}\n\nfunc (p *PredictionContext) ArrayEquals(o Collectable[*PredictionContext]) bool {\n\tif o == nil {\n\t\treturn false\n\t}\n\tother := o.(*PredictionContext)\n\tif other == nil || other.pcType != PredictionContextArray {\n\t\treturn false\n\t}\n\tif p.cachedHash != other.Hash() {\n\t\treturn false // can't be same if hash is different\n\t}\n\n\t// Must compare the actual array elements and not just the array address\n\t//\n\treturn intSlicesEqual(p.returnStates, other.returnStates) &&\n\t\tpcSliceEqual(p.parents, other.parents)\n}\n\nfunc (p *PredictionContext) SingletonEquals(other Collectable[*PredictionContext]) bool {\n\tif other == nil {\n\t\treturn false\n\t}\n\totherP := other.(*PredictionContext)\n\tif otherP == nil || otherP.pcType != PredictionContextSingleton {\n\t\treturn false\n\t}\n\n\tif p.cachedHash != otherP.Hash() {\n\t\treturn false // Can't be same if hash is different\n\t}\n\n\tif p.returnState != otherP.getReturnState(0) {\n\t\treturn false\n\t}\n\n\t// Both parents must be nil if one is\n\tif p.parentCtx == nil {\n\t\treturn otherP.parentCtx == nil\n\t}\n\n\treturn p.parentCtx.Equals(otherP.parentCtx)\n}\n\nfunc (p *PredictionContext) GetParent(i int) *PredictionContext {\n\tswitch p.pcType {\n\tcase PredictionContextEmpty:\n\t\treturn nil\n\tcase PredictionContextSingleton:\n\t\treturn p.parentCtx\n\tcase PredictionContextArray:\n\t\treturn p.parents[i]\n\t}\n\treturn nil\n}\n\nfunc (p *PredictionContext) getReturnState(i int) int {\n\tswitch p.pcType {\n\tcase PredictionContextArray:\n\t\treturn p.returnStates[i]\n\tdefault:\n\t\treturn p.returnState\n\t}\n}\n\nfunc (p *PredictionContext) GetReturnStates() []int {\n\tswitch p.pcType {\n\tcase PredictionContextArray:\n\t\treturn p.returnStates\n\tdefault:\n\t\treturn []int{p.returnState}\n\t}\n}\n\nfunc (p *PredictionContext) length() int {\n\tswitch p.pcType {\n\tcase PredictionContextArray:\n\t\treturn len(p.returnStates)\n\tdefault:\n\t\treturn 1\n\t}\n}\n\nfunc (p *PredictionContext) hasEmptyPath() bool {\n\tswitch p.pcType {\n\tcase PredictionContextSingleton:\n\t\treturn p.returnState == BasePredictionContextEmptyReturnState\n\t}\n\treturn p.getReturnState(p.length()-1) == BasePredictionContextEmptyReturnState\n}\n\nfunc (p *PredictionContext) String() string {\n\tswitch p.pcType {\n\tcase PredictionContextEmpty:\n\t\treturn \"$\"\n\tcase PredictionContextSingleton:\n\t\tvar up string\n\n\t\tif p.parentCtx == nil {\n\t\t\tup = \"\"\n\t\t} else {\n\t\t\tup = p.parentCtx.String()\n\t\t}\n\n\t\tif len(up) == 0 {\n\t\t\tif p.returnState == BasePredictionContextEmptyReturnState {\n\t\t\t\treturn \"$\"\n\t\t\t}\n\n\t\t\treturn strconv.Itoa(p.returnState)\n\t\t}\n\n\t\treturn strconv.Itoa(p.returnState) + \" \" + up\n\tcase PredictionContextArray:\n\t\tif p.isEmpty() {\n\t\t\treturn \"[]\"\n\t\t}\n\n\t\ts := \"[\"\n\t\tfor i := 0; i < len(p.returnStates); i++ {\n\t\t\tif i > 0 {\n\t\t\t\ts = s + \", \"\n\t\t\t}\n\t\t\tif p.returnStates[i] == BasePredictionContextEmptyReturnState {\n\t\t\t\ts = s + \"$\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ts = s + strconv.Itoa(p.returnStates[i])\n\t\t\tif !p.parents[i].isEmpty() {\n\t\t\t\ts = s + \" \" + p.parents[i].String()\n\t\t\t} else {\n\t\t\t\ts = s + \"nil\"\n\t\t\t}\n\t\t}\n\t\treturn s + \"]\"\n\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\nfunc (p *PredictionContext) isEmpty() bool {\n\tswitch p.pcType {\n\tcase PredictionContextEmpty:\n\t\treturn true\n\tcase PredictionContextArray:\n\t\t// since EmptyReturnState can only appear in the last position, we\n\t\t// don't need to verify that size==1\n\t\treturn p.returnStates[0] == BasePredictionContextEmptyReturnState\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (p *PredictionContext) Type() int {\n\treturn p.pcType\n}\n\nfunc calculateHash(parent *PredictionContext, returnState int) int {\n\th := murmurInit(1)\n\th = murmurUpdate(h, parent.Hash())\n\th = murmurUpdate(h, returnState)\n\treturn murmurFinish(h, 2)\n}\n\n// Convert a {@link RuleContext} tree to a {@link BasePredictionContext} graph.\n// Return {@link //EMPTY} if {@code outerContext} is empty or nil.\n// /\nfunc predictionContextFromRuleContext(a *ATN, outerContext RuleContext) *PredictionContext {\n\tif outerContext == nil {\n\t\touterContext = ParserRuleContextEmpty\n\t}\n\t// if we are in RuleContext of start rule, s, then BasePredictionContext\n\t// is EMPTY. Nobody called us. (if we are empty, return empty)\n\tif outerContext.GetParent() == nil || outerContext == ParserRuleContextEmpty {\n\t\treturn BasePredictionContextEMPTY\n\t}\n\t// If we have a parent, convert it to a BasePredictionContext graph\n\tparent := predictionContextFromRuleContext(a, outerContext.GetParent().(RuleContext))\n\tstate := a.states[outerContext.GetInvokingState()]\n\ttransition := state.GetTransitions()[0]\n\n\treturn SingletonBasePredictionContextCreate(parent, transition.(*RuleTransition).followState.GetStateNumber())\n}\n\nfunc merge(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {\n\n\t// Share same graph if both same\n\t//\n\tif a == b || a.Equals(b) {\n\t\treturn a\n\t}\n\n\tif a.pcType == PredictionContextSingleton && b.pcType == PredictionContextSingleton {\n\t\treturn mergeSingletons(a, b, rootIsWildcard, mergeCache)\n\t}\n\t// At least one of a or b is array\n\t// If one is $ and rootIsWildcard, return $ as wildcard\n\tif rootIsWildcard {\n\t\tif a.isEmpty() {\n\t\t\treturn a\n\t\t}\n\t\tif b.isEmpty() {\n\t\t\treturn b\n\t\t}\n\t}\n\n\t// Convert either Singleton or Empty to arrays, so that we can merge them\n\t//\n\tara := convertToArray(a)\n\tarb := convertToArray(b)\n\treturn mergeArrays(ara, arb, rootIsWildcard, mergeCache)\n}\n\nfunc convertToArray(pc *PredictionContext) *PredictionContext {\n\tswitch pc.Type() {\n\tcase PredictionContextEmpty:\n\t\treturn NewArrayPredictionContext([]*PredictionContext{}, []int{})\n\tcase PredictionContextSingleton:\n\t\treturn NewArrayPredictionContext([]*PredictionContext{pc.GetParent(0)}, []int{pc.getReturnState(0)})\n\tdefault:\n\t\t// Already an array\n\t}\n\treturn pc\n}\n\n// mergeSingletons merges two Singleton [PredictionContext] instances.\n//\n// Stack tops equal, parents merge is same return left graph.\n// <embed src=\"images/SingletonMerge_SameRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Same stack top, parents differ merge parents giving array node, then\n// remainders of those graphs. A new root node is created to point to the\n// merged parents.<br>\n// <embed src=\"images/SingletonMerge_SameRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Different stack tops pointing to same parent. Make array node for the\n// root where both element in the root point to the same (original)\n// parent.<br>\n// <embed src=\"images/SingletonMerge_DiffRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Different stack tops pointing to different parents. Make array node for\n// the root where each element points to the corresponding original\n// parent.<br>\n// <embed src=\"images/SingletonMerge_DiffRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// @param a the first {@link SingletonBasePredictionContext}\n// @param b the second {@link SingletonBasePredictionContext}\n// @param rootIsWildcard {@code true} if this is a local-context merge,\n// otherwise false to indicate a full-context merge\n// @param mergeCache\n// /\nfunc mergeSingletons(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {\n\tif mergeCache != nil {\n\t\tprevious, present := mergeCache.Get(a, b)\n\t\tif present {\n\t\t\treturn previous\n\t\t}\n\t\tprevious, present = mergeCache.Get(b, a)\n\t\tif present {\n\t\t\treturn previous\n\t\t}\n\t}\n\n\trootMerge := mergeRoot(a, b, rootIsWildcard)\n\tif rootMerge != nil {\n\t\tif mergeCache != nil {\n\t\t\tmergeCache.Put(a, b, rootMerge)\n\t\t}\n\t\treturn rootMerge\n\t}\n\tif a.returnState == b.returnState {\n\t\tparent := merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache)\n\t\t// if parent is same as existing a or b parent or reduced to a parent,\n\t\t// return it\n\t\tif parent.Equals(a.parentCtx) {\n\t\t\treturn a // ax + bx = ax, if a=b\n\t\t}\n\t\tif parent.Equals(b.parentCtx) {\n\t\t\treturn b // ax + bx = bx, if a=b\n\t\t}\n\t\t// else: ax + ay = a'[x,y]\n\t\t// merge parents x and y, giving array node with x,y then remainders\n\t\t// of those graphs. dup a, a' points at merged array.\n\t\t// New joined parent so create a new singleton pointing to it, a'\n\t\tspc := SingletonBasePredictionContextCreate(parent, a.returnState)\n\t\tif mergeCache != nil {\n\t\t\tmergeCache.Put(a, b, spc)\n\t\t}\n\t\treturn spc\n\t}\n\t// a != b payloads differ\n\t// see if we can collapse parents due to $+x parents if local ctx\n\tvar singleParent *PredictionContext\n\tif a.Equals(b) || (a.parentCtx != nil && a.parentCtx.Equals(b.parentCtx)) { // ax +\n\t\t// bx =\n\t\t// [a,b]x\n\t\tsingleParent = a.parentCtx\n\t}\n\tif singleParent != nil { // parents are same\n\t\t// sort payloads and use same parent\n\t\tpayloads := []int{a.returnState, b.returnState}\n\t\tif a.returnState > b.returnState {\n\t\t\tpayloads[0] = b.returnState\n\t\t\tpayloads[1] = a.returnState\n\t\t}\n\t\tparents := []*PredictionContext{singleParent, singleParent}\n\t\tapc := NewArrayPredictionContext(parents, payloads)\n\t\tif mergeCache != nil {\n\t\t\tmergeCache.Put(a, b, apc)\n\t\t}\n\t\treturn apc\n\t}\n\t// parents differ and can't merge them. Just pack together\n\t// into array can't merge.\n\t// ax + by = [ax,by]\n\tpayloads := []int{a.returnState, b.returnState}\n\tparents := []*PredictionContext{a.parentCtx, b.parentCtx}\n\tif a.returnState > b.returnState { // sort by payload\n\t\tpayloads[0] = b.returnState\n\t\tpayloads[1] = a.returnState\n\t\tparents = []*PredictionContext{b.parentCtx, a.parentCtx}\n\t}\n\tapc := NewArrayPredictionContext(parents, payloads)\n\tif mergeCache != nil {\n\t\tmergeCache.Put(a, b, apc)\n\t}\n\treturn apc\n}\n\n// Handle case where at least one of {@code a} or {@code b} is\n// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used\n// to represent {@link //EMPTY}.\n//\n// <h2>Local-Context Merges</h2>\n//\n// <p>These local-context merge operations are used when {@code rootIsWildcard}\n// is true.</p>\n//\n// <p>{@link //EMPTY} is superset of any graph return {@link //EMPTY}.<br>\n// <embed src=\"images/LocalMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is\n// {@code //EMPTY} return left graph.<br>\n// <embed src=\"images/LocalMerge_EmptyParent.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Special case of last merge if local context.<br>\n// <embed src=\"images/LocalMerge_DiffRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <h2>Full-Context Merges</h2>\n//\n// <p>These full-context merge operations are used when {@code rootIsWildcard}\n// is false.</p>\n//\n// <p><embed src=\"images/FullMerge_EmptyRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Must keep all contexts {@link //EMPTY} in array is a special value (and\n// nil parent).<br>\n// <embed src=\"images/FullMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p><embed src=\"images/FullMerge_SameRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// @param a the first {@link SingletonBasePredictionContext}\n// @param b the second {@link SingletonBasePredictionContext}\n// @param rootIsWildcard {@code true} if this is a local-context merge,\n// otherwise false to indicate a full-context merge\n// /\nfunc mergeRoot(a, b *PredictionContext, rootIsWildcard bool) *PredictionContext {\n\tif rootIsWildcard {\n\t\tif a.pcType == PredictionContextEmpty {\n\t\t\treturn BasePredictionContextEMPTY // // + b =//\n\t\t}\n\t\tif b.pcType == PredictionContextEmpty {\n\t\t\treturn BasePredictionContextEMPTY // a +// =//\n\t\t}\n\t} else {\n\t\tif a.isEmpty() && b.isEmpty() {\n\t\t\treturn BasePredictionContextEMPTY // $ + $ = $\n\t\t} else if a.isEmpty() { // $ + x = [$,x]\n\t\t\tpayloads := []int{b.getReturnState(-1), BasePredictionContextEmptyReturnState}\n\t\t\tparents := []*PredictionContext{b.GetParent(-1), nil}\n\t\t\treturn NewArrayPredictionContext(parents, payloads)\n\t\t} else if b.isEmpty() { // x + $ = [$,x] ($ is always first if present)\n\t\t\tpayloads := []int{a.getReturnState(-1), BasePredictionContextEmptyReturnState}\n\t\t\tparents := []*PredictionContext{a.GetParent(-1), nil}\n\t\t\treturn NewArrayPredictionContext(parents, payloads)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Merge two {@link ArrayBasePredictionContext} instances.\n//\n// <p>Different tops, different parents.<br>\n// <embed src=\"images/ArrayMerge_DiffTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, same parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSamePar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, different parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, all shared parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSharePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Equal tops, merge parents and reduce top to\n// {@link SingletonBasePredictionContext}.<br>\n// <embed src=\"images/ArrayMerge_EqualTop.svg\" type=\"image/svg+xml\"/></p>\n//\n//goland:noinspection GoBoolExpressions\nfunc mergeArrays(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {\n\tif mergeCache != nil {\n\t\tprevious, present := mergeCache.Get(a, b)\n\t\tif present {\n\t\t\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\t\t\tfmt.Println(\"mergeArrays a=\" + a.String() + \",b=\" + b.String() + \" -> previous\")\n\t\t\t}\n\t\t\treturn previous\n\t\t}\n\t\tprevious, present = mergeCache.Get(b, a)\n\t\tif present {\n\t\t\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\t\t\tfmt.Println(\"mergeArrays a=\" + a.String() + \",b=\" + b.String() + \" -> previous\")\n\t\t\t}\n\t\t\treturn previous\n\t\t}\n\t}\n\t// merge sorted payloads a + b => M\n\ti := 0 // walks a\n\tj := 0 // walks b\n\tk := 0 // walks target M array\n\n\tmergedReturnStates := make([]int, len(a.returnStates)+len(b.returnStates))\n\tmergedParents := make([]*PredictionContext, len(a.returnStates)+len(b.returnStates))\n\t// walk and merge to yield mergedParents, mergedReturnStates\n\tfor i < len(a.returnStates) && j < len(b.returnStates) {\n\t\taParent := a.parents[i]\n\t\tbParent := b.parents[j]\n\t\tif a.returnStates[i] == b.returnStates[j] {\n\t\t\t// same payload (stack tops are equal), must yield merged singleton\n\t\t\tpayload := a.returnStates[i]\n\t\t\t// $+$ = $\n\t\t\tbothDollars := payload == BasePredictionContextEmptyReturnState && aParent == nil && bParent == nil\n\t\t\taxAX := aParent != nil && bParent != nil && aParent.Equals(bParent) // ax+ax\n\t\t\t// ->\n\t\t\t// ax\n\t\t\tif bothDollars || axAX {\n\t\t\t\tmergedParents[k] = aParent // choose left\n\t\t\t\tmergedReturnStates[k] = payload\n\t\t\t} else { // ax+ay -> a'[x,y]\n\t\t\t\tmergedParent := merge(aParent, bParent, rootIsWildcard, mergeCache)\n\t\t\t\tmergedParents[k] = mergedParent\n\t\t\t\tmergedReturnStates[k] = payload\n\t\t\t}\n\t\t\ti++ // hop over left one as usual\n\t\t\tj++ // but also Skip one in right side since we merge\n\t\t} else if a.returnStates[i] < b.returnStates[j] { // copy a[i] to M\n\t\t\tmergedParents[k] = aParent\n\t\t\tmergedReturnStates[k] = a.returnStates[i]\n\t\t\ti++\n\t\t} else { // b > a, copy b[j] to M\n\t\t\tmergedParents[k] = bParent\n\t\t\tmergedReturnStates[k] = b.returnStates[j]\n\t\t\tj++\n\t\t}\n\t\tk++\n\t}\n\t// copy over any payloads remaining in either array\n\tif i < len(a.returnStates) {\n\t\tfor p := i; p < len(a.returnStates); p++ {\n\t\t\tmergedParents[k] = a.parents[p]\n\t\t\tmergedReturnStates[k] = a.returnStates[p]\n\t\t\tk++\n\t\t}\n\t} else {\n\t\tfor p := j; p < len(b.returnStates); p++ {\n\t\t\tmergedParents[k] = b.parents[p]\n\t\t\tmergedReturnStates[k] = b.returnStates[p]\n\t\t\tk++\n\t\t}\n\t}\n\t// trim merged if we combined a few that had same stack tops\n\tif k < len(mergedParents) { // write index < last position trim\n\t\tif k == 1 { // for just one merged element, return singleton top\n\t\t\tpc := SingletonBasePredictionContextCreate(mergedParents[0], mergedReturnStates[0])\n\t\t\tif mergeCache != nil {\n\t\t\t\tmergeCache.Put(a, b, pc)\n\t\t\t}\n\t\t\treturn pc\n\t\t}\n\t\tmergedParents = mergedParents[0:k]\n\t\tmergedReturnStates = mergedReturnStates[0:k]\n\t}\n\n\tM := NewArrayPredictionContext(mergedParents, mergedReturnStates)\n\n\t// if we created same array as a or b, return that instead\n\t// TODO: JI track whether this is possible above during merge sort for speed and possibly avoid an allocation\n\tif M.Equals(a) {\n\t\tif mergeCache != nil {\n\t\t\tmergeCache.Put(a, b, a)\n\t\t}\n\t\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\t\tfmt.Println(\"mergeArrays a=\" + a.String() + \",b=\" + b.String() + \" -> a\")\n\t\t}\n\t\treturn a\n\t}\n\tif M.Equals(b) {\n\t\tif mergeCache != nil {\n\t\t\tmergeCache.Put(a, b, b)\n\t\t}\n\t\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\t\tfmt.Println(\"mergeArrays a=\" + a.String() + \",b=\" + b.String() + \" -> b\")\n\t\t}\n\t\treturn b\n\t}\n\tcombineCommonParents(&mergedParents)\n\n\tif mergeCache != nil {\n\t\tmergeCache.Put(a, b, M)\n\t}\n\tif runtimeConfig.parserATNSimulatorTraceATNSim {\n\t\tfmt.Println(\"mergeArrays a=\" + a.String() + \",b=\" + b.String() + \" -> \" + M.String())\n\t}\n\treturn M\n}\n\n// Make pass over all M parents and merge any Equals() ones.\n// Note that we pass a pointer to the slice as we want to modify it in place.\n//\n//goland:noinspection GoUnusedFunction\nfunc combineCommonParents(parents *[]*PredictionContext) {\n\tuniqueParents := NewJStore[*PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCollection, \"combineCommonParents for PredictionContext\")\n\n\tfor p := 0; p < len(*parents); p++ {\n\t\tparent := (*parents)[p]\n\t\t_, _ = uniqueParents.Put(parent)\n\t}\n\tfor q := 0; q < len(*parents); q++ {\n\t\tpc, _ := uniqueParents.Get((*parents)[q])\n\t\t(*parents)[q] = pc\n\t}\n}\n\nfunc getCachedBasePredictionContext(context *PredictionContext, contextCache *PredictionContextCache, visited *VisitRecord) *PredictionContext {\n\tif context.isEmpty() {\n\t\treturn context\n\t}\n\texisting, present := visited.Get(context)\n\tif present {\n\t\treturn existing\n\t}\n\n\texisting, present = contextCache.Get(context)\n\tif present {\n\t\tvisited.Put(context, existing)\n\t\treturn existing\n\t}\n\tchanged := false\n\tparents := make([]*PredictionContext, context.length())\n\tfor i := 0; i < len(parents); i++ {\n\t\tparent := getCachedBasePredictionContext(context.GetParent(i), contextCache, visited)\n\t\tif changed || !parent.Equals(context.GetParent(i)) {\n\t\t\tif !changed {\n\t\t\t\tparents = make([]*PredictionContext, context.length())\n\t\t\t\tfor j := 0; j < context.length(); j++ {\n\t\t\t\t\tparents[j] = context.GetParent(j)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tparents[i] = parent\n\t\t}\n\t}\n\tif !changed {\n\t\tcontextCache.add(context)\n\t\tvisited.Put(context, context)\n\t\treturn context\n\t}\n\tvar updated *PredictionContext\n\tif len(parents) == 0 {\n\t\tupdated = BasePredictionContextEMPTY\n\t} else if len(parents) == 1 {\n\t\tupdated = SingletonBasePredictionContextCreate(parents[0], context.getReturnState(0))\n\t} else {\n\t\tupdated = NewArrayPredictionContext(parents, context.GetReturnStates())\n\t}\n\tcontextCache.add(updated)\n\tvisited.Put(updated, updated)\n\tvisited.Put(context, updated)\n\n\treturn updated\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go",
    "content": "package antlr\n\nvar BasePredictionContextEMPTY = &PredictionContext{\n\tcachedHash:  calculateEmptyHash(),\n\tpcType:      PredictionContextEmpty,\n\treturnState: BasePredictionContextEmptyReturnState,\n}\n\n// PredictionContextCache is Used to cache [PredictionContext] objects. It is used for the shared\n// context cash associated with contexts in DFA states. This cache\n// can be used for both lexers and parsers.\ntype PredictionContextCache struct {\n\tcache *JMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]]\n}\n\nfunc NewPredictionContextCache() *PredictionContextCache {\n\treturn &PredictionContextCache{\n\t\tcache: NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, \"NewPredictionContextCache()\"),\n\t}\n}\n\n// Add a context to the cache and return it. If the context already exists,\n// return that one instead and do not add a new context to the cache.\n// Protect shared cache from unsafe thread access.\nfunc (p *PredictionContextCache) add(ctx *PredictionContext) *PredictionContext {\n\tif ctx.isEmpty() {\n\t\treturn BasePredictionContextEMPTY\n\t}\n\n\t// Put will return the existing entry if it is present (note this is done via Equals, not whether it is\n\t// the same pointer), otherwise it will add the new entry and return that.\n\t//\n\texisting, present := p.cache.Get(ctx)\n\tif present {\n\t\treturn existing\n\t}\n\tp.cache.Put(ctx, ctx)\n\treturn ctx\n}\n\nfunc (p *PredictionContextCache) Get(ctx *PredictionContext) (*PredictionContext, bool) {\n\tpc, exists := p.cache.Get(ctx)\n\treturn pc, exists\n}\n\nfunc (p *PredictionContextCache) length() int {\n\treturn p.cache.Len()\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// This enumeration defines the prediction modes available in ANTLR 4 along with\n// utility methods for analyzing configuration sets for conflicts and/or\n// ambiguities.\n\nconst (\n\t// PredictionModeSLL represents the SLL(*) prediction mode.\n\t// This prediction mode ignores the current\n\t// parser context when making predictions. This is the fastest prediction\n\t// mode, and provides correct results for many grammars. This prediction\n\t// mode is more powerful than the prediction mode provided by ANTLR 3, but\n\t// may result in syntax errors for grammar and input combinations which are\n\t// not SLL.\n\t//\n\t// When using this prediction mode, the parser will either return a correct\n\t// parse tree (i.e. the same parse tree that would be returned with the\n\t// [PredictionModeLL] prediction mode), or it will Report a syntax error. If a\n\t// syntax error is encountered when using the SLL prediction mode,\n\t// it may be due to either an actual syntax error in the input or indicate\n\t// that the particular combination of grammar and input requires the more\n\t// powerful LL prediction abilities to complete successfully.\n\t//\n\t// This prediction mode does not provide any guarantees for prediction\n\t// behavior for syntactically-incorrect inputs.\n\t//\n\tPredictionModeSLL = 0\n\n\t// PredictionModeLL represents the LL(*) prediction mode.\n\t// This prediction mode allows the current parser\n\t// context to be used for resolving SLL conflicts that occur during\n\t// prediction. This is the fastest prediction mode that guarantees correct\n\t// parse results for all combinations of grammars with syntactically correct\n\t// inputs.\n\t//\n\t// When using this prediction mode, the parser will make correct decisions\n\t// for all syntactically-correct grammar and input combinations. However, in\n\t// cases where the grammar is truly ambiguous this prediction mode might not\n\t// report a precise answer for exactly which alternatives are\n\t// ambiguous.\n\t//\n\t// This prediction mode does not provide any guarantees for prediction\n\t// behavior for syntactically-incorrect inputs.\n\t//\n\tPredictionModeLL = 1\n\n\t// PredictionModeLLExactAmbigDetection represents the LL(*) prediction mode\n\t// with exact ambiguity detection.\n\t//\n\t// In addition to the correctness guarantees provided by the [PredictionModeLL] prediction mode,\n\t// this prediction mode instructs the prediction algorithm to determine the\n\t// complete and exact set of ambiguous alternatives for every ambiguous\n\t// decision encountered while parsing.\n\t//\n\t// This prediction mode may be used for diagnosing ambiguities during\n\t// grammar development. Due to the performance overhead of calculating sets\n\t// of ambiguous alternatives, this prediction mode should be avoided when\n\t// the exact results are not necessary.\n\t//\n\t// This prediction mode does not provide any guarantees for prediction\n\t// behavior for syntactically-incorrect inputs.\n\t//\n\tPredictionModeLLExactAmbigDetection = 2\n)\n\n// PredictionModehasSLLConflictTerminatingPrediction computes the SLL prediction termination condition.\n//\n// This method computes the SLL prediction termination condition for both of\n// the following cases:\n//\n//   - The usual SLL+LL fallback upon SLL conflict\n//   - Pure SLL without LL fallback\n//\n// # Combined SLL+LL Parsing\n//\n// When LL-fallback is enabled upon SLL conflict, correct predictions are\n// ensured regardless of how the termination condition is computed by this\n// method. Due to the substantially higher cost of LL prediction, the\n// prediction should only fall back to LL when the additional lookahead\n// cannot lead to a unique SLL prediction.\n//\n// Assuming combined SLL+LL parsing, an SLL configuration set with only\n// conflicting subsets should fall back to full LL, even if the\n// configuration sets don't resolve to the same alternative, e.g.\n//\n//\t{1,2} and {3,4}\n//\n// If there is at least one non-conflicting\n// configuration, SLL could continue with the hopes that more lookahead will\n// resolve via one of those non-conflicting configurations.\n//\n// Here's the prediction termination rule them: SLL (for SLL+LL parsing)\n// stops when it sees only conflicting configuration subsets. In contrast,\n// full LL keeps going when there is uncertainty.\n//\n// # Heuristic\n//\n// As a heuristic, we stop prediction when we see any conflicting subset\n// unless we see a state that only has one alternative associated with it.\n// The single-alt-state thing lets prediction continue upon rules like\n// (otherwise, it would admit defeat too soon):\n//\n//\t[12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ;\n//\n// When the [ATN] simulation reaches the state before ';', it has a\n// [DFA] state that looks like:\n//\n//\t[12|1|[], 6|2|[], 12|2|[]]\n//\n// Naturally\n//\n//\t12|1|[] and  12|2|[]\n//\n// conflict, but we cannot stop processing this node because alternative to has another way to continue,\n// via\n//\n//\t[6|2|[]]\n//\n// It also let's us continue for this rule:\n//\n//\t[1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ;\n//\n// After Matching input A, we reach the stop state for rule A, state 1.\n// State 8 is the state immediately before B. Clearly alternatives 1 and 2\n// conflict and no amount of further lookahead will separate the two.\n// However, alternative 3 will be able to continue, and so we do not stop\n// working on this state. In the previous example, we're concerned with\n// states associated with the conflicting alternatives. Here alt 3 is not\n// associated with the conflicting configs, but since we can continue\n// looking for input reasonably, don't declare the state done.\n//\n// # Pure SLL Parsing\n//\n// To handle pure SLL parsing, all we have to do is make sure that we\n// combine stack contexts for configurations that differ only by semantic\n// predicate. From there, we can do the usual SLL termination heuristic.\n//\n// # Predicates in SLL+LL Parsing\n//\n// SLL decisions don't evaluate predicates until after they reach [DFA] stop\n// states because they need to create the [DFA] cache that works in all\n// semantic situations. In contrast, full LL evaluates predicates collected\n// during start state computation, so it can ignore predicates thereafter.\n// This means that SLL termination detection can totally ignore semantic\n// predicates.\n//\n// Implementation-wise, [ATNConfigSet] combines stack contexts but not\n// semantic predicate contexts, so we might see two configurations like the\n// following:\n//\n//\t(s, 1, x, {}), (s, 1, x', {p})\n//\n// Before testing these configurations against others, we have to merge\n// x and x' (without modifying the existing configurations).\n// For example, we test (x+x')==x” when looking for conflicts in\n// the following configurations:\n//\n//\t(s, 1, x, {}), (s, 1, x', {p}), (s, 2, x”, {})\n//\n// If the configuration set has predicates (as indicated by\n// [ATNConfigSet.hasSemanticContext]), this algorithm makes a copy of\n// the configurations to strip out all the predicates so that a standard\n// [ATNConfigSet] will merge everything ignoring predicates.\nfunc PredictionModehasSLLConflictTerminatingPrediction(mode int, configs *ATNConfigSet) bool {\n\n\t// Configs in rule stop states indicate reaching the end of the decision\n\t// rule (local context) or end of start rule (full context). If all\n\t// configs meet this condition, then none of the configurations is able\n\t// to Match additional input, so we terminate prediction.\n\t//\n\tif PredictionModeallConfigsInRuleStopStates(configs) {\n\t\treturn true\n\t}\n\n\t// pure SLL mode parsing\n\tif mode == PredictionModeSLL {\n\t\t// Don't bother with combining configs from different semantic\n\t\t// contexts if we can fail over to full LL costs more time\n\t\t// since we'll often fail over anyway.\n\t\tif configs.hasSemanticContext {\n\t\t\t// dup configs, tossing out semantic predicates\n\t\t\tdup := NewATNConfigSet(false)\n\t\t\tfor _, c := range configs.configs {\n\n\t\t\t\t//\t\t\t\tNewATNConfig({semanticContext:}, c)\n\t\t\t\tc = NewATNConfig2(c, SemanticContextNone)\n\t\t\t\tdup.Add(c, nil)\n\t\t\t}\n\t\t\tconfigs = dup\n\t\t}\n\t\t// now we have combined contexts for configs with dissimilar predicates\n\t}\n\t// pure SLL or combined SLL+LL mode parsing\n\taltsets := PredictionModegetConflictingAltSubsets(configs)\n\treturn PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs)\n}\n\n// PredictionModehasConfigInRuleStopState checks if any configuration in the given configs is in a\n// [RuleStopState]. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// The func returns true if any configuration in the supplied configs is in a [RuleStopState]\nfunc PredictionModehasConfigInRuleStopState(configs *ATNConfigSet) bool {\n\tfor _, c := range configs.configs {\n\t\tif _, ok := c.GetState().(*RuleStopState); ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// PredictionModeallConfigsInRuleStopStates checks if all configurations in configs are in a\n// [RuleStopState]. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// the func returns true if all configurations in configs are in a\n// [RuleStopState]\nfunc PredictionModeallConfigsInRuleStopStates(configs *ATNConfigSet) bool {\n\n\tfor _, c := range configs.configs {\n\t\tif _, ok := c.GetState().(*RuleStopState); !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// PredictionModeresolvesToJustOneViableAlt checks full LL prediction termination.\n//\n// Can we stop looking ahead during [ATN] simulation or is there some\n// uncertainty as to which alternative we will ultimately pick, after\n// consuming more input? Even if there are partial conflicts, we might know\n// that everything is going to resolve to the same minimum alternative. That\n// means we can stop since no more lookahead will change that fact. On the\n// other hand, there might be multiple conflicts that resolve to different\n// minimums. That means we need more look ahead to decide which of those\n// alternatives we should predict.\n//\n// The basic idea is to split the set of configurations 'C', into\n// conflicting subsets (s, _, ctx, _) and singleton subsets with\n// non-conflicting configurations. Two configurations conflict if they have\n// identical [ATNConfig].state and [ATNConfig].context values\n// but a different [ATNConfig].alt value, e.g.\n//\n//\t(s, i, ctx, _)\n//\n// and\n//\n//\t(s, j, ctx, _) ; for i != j\n//\n// Reduce these configuration subsets to the set of possible alternatives.\n// You can compute the alternative subsets in one pass as follows:\n//\n//\tA_s,ctx = {i | (s, i, ctx, _)}\n//\n// for each configuration in C holding s and ctx fixed.\n//\n// Or in pseudo-code:\n//\n//\t for each configuration c in  C:\n//\t\t  map[c] U = c.ATNConfig.alt alt  // map hash/equals uses s and x, not alt and not pred\n//\n// The values in map are the set of\n//\n//\tA_s,ctx\n//\n// sets.\n//\n// If\n//\n//\t|A_s,ctx| = 1\n//\n// then there is no conflict associated with s and ctx.\n//\n// Reduce the subsets to singletons by choosing a minimum of each subset. If\n// the union of these alternative subsets is a singleton, then no amount of\n// further lookahead will help us. We will always pick that alternative. If,\n// however, there is more than one alternative, then we are uncertain which\n// alternative to predict and must continue looking for resolution. We may\n// or may not discover an ambiguity in the future, even if there are no\n// conflicting subsets this round.\n//\n// The biggest sin is to terminate early because it means we've made a\n// decision but were uncertain as to the eventual outcome. We haven't used\n// enough lookahead. On the other hand, announcing a conflict too late is no\n// big deal; you will still have the conflict. It's just inefficient. It\n// might even look until the end of file.\n//\n// No special consideration for semantic predicates is required because\n// predicates are evaluated on-the-fly for full LL prediction, ensuring that\n// no configuration contains a semantic context during the termination\n// check.\n//\n// # Conflicting Configs\n//\n// Two configurations:\n//\n//\t(s, i, x) and (s, j, x')\n//\n// conflict when i != j  but x = x'. Because we merge all\n// (s, i, _) configurations together, that means that there are at\n// most n configurations associated with state s for\n// n possible alternatives in the decision. The merged stacks\n// complicate the comparison of configuration contexts x and x'.\n//\n// Sam checks to see if one is a subset of the other by calling\n// merge and checking to see if the merged result is either x or x'.\n// If the x associated with lowest alternative i\n// is the superset, then i is the only possible prediction since the\n// others resolve to min(i) as well. However, if x is\n// associated with j > i then at least one stack configuration for\n// j is not in conflict with alternative i. The algorithm\n// should keep going, looking for more lookahead due to the uncertainty.\n//\n// For simplicity, I'm doing an equality check between x and\n// x', which lets the algorithm continue to consume lookahead longer\n// than necessary. The reason I like the equality is of course the\n// simplicity but also because that is the test you need to detect the\n// alternatives that are actually in conflict.\n//\n// # Continue/Stop Rule\n//\n// Continue if the union of resolved alternative sets from non-conflicting and\n// conflicting alternative subsets has more than one alternative. We are\n// uncertain about which alternative to predict.\n//\n// The complete set of alternatives,\n//\n//\t[i for (_, i, _)]\n//\n// tells us which alternatives are still in the running for the amount of input we've\n// consumed at this point. The conflicting sets let us to strip away\n// configurations that won't lead to more states because we resolve\n// conflicts to the configuration with a minimum alternate for the\n// conflicting set.\n//\n// Cases\n//\n//   - no conflicts and more than 1 alternative in set => continue\n//   - (s, 1, x), (s, 2, x), (s, 3, z), (s', 1, y), (s', 2, y) yields non-conflicting set\n//     {3} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1,3} => continue\n//   - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y), (s”, 1, z) yields non-conflicting set\n//     {1} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1} => stop and predict 1\n//   - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y) yields conflicting, reduced sets\n//     {1} ∪ {1} = {1} => stop and predict 1, can announce ambiguity {1,2}\n//   - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets\n//     {1} ∪ {2} = {1,2} => continue\n//   - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets\n//     {1} ∪ {2} = {1,2} => continue\n//   - (s, 1, x), (s, 2, x), (s', 3, y), (s', 4, y) yields conflicting, reduced sets\n//     {1} ∪ {3} = {1,3} => continue\n//\n// # Exact Ambiguity Detection\n//\n// If all states report the same conflicting set of alternatives, then we\n// know we have the exact ambiguity set:\n//\n//\t|A_i| > 1\n//\n// and\n//\n//\tA_i = A_j ; for all i, j\n//\n// In other words, we continue examining lookahead until all A_i\n// have more than one alternative and all A_i are the same. If\n//\n//\tA={{1,2}, {1,3}}\n//\n// then regular LL prediction would terminate because the resolved set is {1}.\n// To determine what the real ambiguity is, we have to know whether the ambiguity is between one and\n// two or one and three so we keep going. We can only stop prediction when\n// we need exact ambiguity detection when the sets look like:\n//\n//\tA={{1,2}}\n//\n// or\n//\n//\t{{1,2},{1,2}}, etc...\nfunc PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int {\n\treturn PredictionModegetSingleViableAlt(altsets)\n}\n\n// PredictionModeallSubsetsConflict determines if every alternative subset in altsets contains more\n// than one alternative.\n//\n// The func returns true if every [BitSet] in altsets has\n// [BitSet].cardinality cardinality > 1\nfunc PredictionModeallSubsetsConflict(altsets []*BitSet) bool {\n\treturn !PredictionModehasNonConflictingAltSet(altsets)\n}\n\n// PredictionModehasNonConflictingAltSet determines if any single alternative subset in altsets contains\n// exactly one alternative.\n//\n// The func returns true if altsets contains at least one [BitSet] with\n// [BitSet].cardinality cardinality 1\nfunc PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool {\n\tfor i := 0; i < len(altsets); i++ {\n\t\talts := altsets[i]\n\t\tif alts.length() == 1 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// PredictionModehasConflictingAltSet determines if any single alternative subset in altsets contains\n// more than one alternative.\n//\n// The func returns true if altsets contains a [BitSet] with\n// [BitSet].cardinality cardinality > 1, otherwise false\nfunc PredictionModehasConflictingAltSet(altsets []*BitSet) bool {\n\tfor i := 0; i < len(altsets); i++ {\n\t\talts := altsets[i]\n\t\tif alts.length() > 1 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// PredictionModeallSubsetsEqual determines if every alternative subset in altsets is equivalent.\n//\n// The func returns true if every member of altsets is equal to the others.\nfunc PredictionModeallSubsetsEqual(altsets []*BitSet) bool {\n\tvar first *BitSet\n\n\tfor i := 0; i < len(altsets); i++ {\n\t\talts := altsets[i]\n\t\tif first == nil {\n\t\t\tfirst = alts\n\t\t} else if alts != first {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// PredictionModegetUniqueAlt returns the unique alternative predicted by all alternative subsets in\n// altsets. If no such alternative exists, this method returns\n// [ATNInvalidAltNumber].\n//\n// @param altsets a collection of alternative subsets\nfunc PredictionModegetUniqueAlt(altsets []*BitSet) int {\n\tall := PredictionModeGetAlts(altsets)\n\tif all.length() == 1 {\n\t\treturn all.minValue()\n\t}\n\n\treturn ATNInvalidAltNumber\n}\n\n// PredictionModeGetAlts returns the complete set of represented alternatives for a collection of\n// alternative subsets. This method returns the union of each [BitSet]\n// in altsets, being the set of represented alternatives in altsets.\nfunc PredictionModeGetAlts(altsets []*BitSet) *BitSet {\n\tall := NewBitSet()\n\tfor _, alts := range altsets {\n\t\tall.or(alts)\n\t}\n\treturn all\n}\n\n// PredictionModegetConflictingAltSubsets gets the conflicting alt subsets from a configuration set.\n//\n//\tfor each configuration c in configs:\n//\t   map[c] U= c.ATNConfig.alt // map hash/equals uses s and x, not alt and not pred\nfunc PredictionModegetConflictingAltSubsets(configs *ATNConfigSet) []*BitSet {\n\tconfigToAlts := NewJMap[*ATNConfig, *BitSet, *ATNAltConfigComparator[*ATNConfig]](atnAltCfgEqInst, AltSetCollection, \"PredictionModegetConflictingAltSubsets()\")\n\n\tfor _, c := range configs.configs {\n\n\t\talts, ok := configToAlts.Get(c)\n\t\tif !ok {\n\t\t\talts = NewBitSet()\n\t\t\tconfigToAlts.Put(c, alts)\n\t\t}\n\t\talts.add(c.GetAlt())\n\t}\n\n\treturn configToAlts.Values()\n}\n\n// PredictionModeGetStateToAltMap gets a map from state to alt subset from a configuration set.\n//\n//\tfor each configuration c in configs:\n//\t   map[c.ATNConfig.state] U= c.ATNConfig.alt}\nfunc PredictionModeGetStateToAltMap(configs *ATNConfigSet) *AltDict {\n\tm := NewAltDict()\n\n\tfor _, c := range configs.configs {\n\t\talts := m.Get(c.GetState().String())\n\t\tif alts == nil {\n\t\t\talts = NewBitSet()\n\t\t\tm.put(c.GetState().String(), alts)\n\t\t}\n\t\talts.(*BitSet).add(c.GetAlt())\n\t}\n\treturn m\n}\n\nfunc PredictionModehasStateAssociatedWithOneAlt(configs *ATNConfigSet) bool {\n\tvalues := PredictionModeGetStateToAltMap(configs).values()\n\tfor i := 0; i < len(values); i++ {\n\t\tif values[i].(*BitSet).length() == 1 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// PredictionModegetSingleViableAlt gets the single alternative predicted by all alternative subsets in altsets\n// if there is one.\n//\n// TODO: JI - Review this code - it does not seem to do the same thing as the Java code - maybe because [BitSet] is not like the Java utils BitSet\nfunc PredictionModegetSingleViableAlt(altsets []*BitSet) int {\n\tresult := ATNInvalidAltNumber\n\n\tfor i := 0; i < len(altsets); i++ {\n\t\talts := altsets[i]\n\t\tminAlt := alts.minValue()\n\t\tif result == ATNInvalidAltNumber {\n\t\t\tresult = minAlt\n\t\t} else if result != minAlt { // more than 1 viable alt\n\t\t\treturn ATNInvalidAltNumber\n\t\t}\n\t}\n\treturn result\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/recognizer.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"strconv\"\n)\n\ntype Recognizer interface {\n\tGetLiteralNames() []string\n\tGetSymbolicNames() []string\n\tGetRuleNames() []string\n\n\tSempred(RuleContext, int, int) bool\n\tPrecpred(RuleContext, int) bool\n\n\tGetState() int\n\tSetState(int)\n\tAction(RuleContext, int, int)\n\tAddErrorListener(ErrorListener)\n\tRemoveErrorListeners()\n\tGetATN() *ATN\n\tGetErrorListenerDispatch() ErrorListener\n\tHasError() bool\n\tGetError() RecognitionException\n\tSetError(RecognitionException)\n}\n\ntype BaseRecognizer struct {\n\tlisteners []ErrorListener\n\tstate     int\n\n\tRuleNames       []string\n\tLiteralNames    []string\n\tSymbolicNames   []string\n\tGrammarFileName string\n\tSynErr          RecognitionException\n}\n\nfunc NewBaseRecognizer() *BaseRecognizer {\n\trec := new(BaseRecognizer)\n\trec.listeners = []ErrorListener{ConsoleErrorListenerINSTANCE}\n\trec.state = -1\n\treturn rec\n}\n\n//goland:noinspection GoUnusedGlobalVariable\nvar tokenTypeMapCache = make(map[string]int)\n\n//goland:noinspection GoUnusedGlobalVariable\nvar ruleIndexMapCache = make(map[string]int)\n\nfunc (b *BaseRecognizer) checkVersion(toolVersion string) {\n\truntimeVersion := \"4.13.1\"\n\tif runtimeVersion != toolVersion {\n\t\tfmt.Println(\"ANTLR runtime and generated code versions disagree: \" + runtimeVersion + \"!=\" + toolVersion)\n\t}\n}\n\nfunc (b *BaseRecognizer) SetError(err RecognitionException) {\n\tb.SynErr = err\n}\n\nfunc (b *BaseRecognizer) HasError() bool {\n\treturn b.SynErr != nil\n}\n\nfunc (b *BaseRecognizer) GetError() RecognitionException {\n\treturn b.SynErr\n}\n\nfunc (b *BaseRecognizer) Action(_ RuleContext, _, _ int) {\n\tpanic(\"action not implemented on Recognizer!\")\n}\n\nfunc (b *BaseRecognizer) AddErrorListener(listener ErrorListener) {\n\tb.listeners = append(b.listeners, listener)\n}\n\nfunc (b *BaseRecognizer) RemoveErrorListeners() {\n\tb.listeners = make([]ErrorListener, 0)\n}\n\nfunc (b *BaseRecognizer) GetRuleNames() []string {\n\treturn b.RuleNames\n}\n\nfunc (b *BaseRecognizer) GetTokenNames() []string {\n\treturn b.LiteralNames\n}\n\nfunc (b *BaseRecognizer) GetSymbolicNames() []string {\n\treturn b.SymbolicNames\n}\n\nfunc (b *BaseRecognizer) GetLiteralNames() []string {\n\treturn b.LiteralNames\n}\n\nfunc (b *BaseRecognizer) GetState() int {\n\treturn b.state\n}\n\nfunc (b *BaseRecognizer) SetState(v int) {\n\tb.state = v\n}\n\n//func (b *Recognizer) GetTokenTypeMap() {\n//    var tokenNames = b.GetTokenNames()\n//    if (tokenNames==nil) {\n//        panic(\"The current recognizer does not provide a list of token names.\")\n//    }\n//    var result = tokenTypeMapCache[tokenNames]\n//    if(result==nil) {\n//        result = tokenNames.reduce(function(o, k, i) { o[k] = i })\n//        result.EOF = TokenEOF\n//        tokenTypeMapCache[tokenNames] = result\n//    }\n//    return result\n//}\n\n// GetRuleIndexMap Get a map from rule names to rule indexes.\n//\n// Used for XPath and tree pattern compilation.\n//\n// TODO: JI This is not yet implemented in the Go runtime. Maybe not needed.\nfunc (b *BaseRecognizer) GetRuleIndexMap() map[string]int {\n\n\tpanic(\"Method not defined!\")\n\t//    var ruleNames = b.GetRuleNames()\n\t//    if (ruleNames==nil) {\n\t//        panic(\"The current recognizer does not provide a list of rule names.\")\n\t//    }\n\t//\n\t//    var result = ruleIndexMapCache[ruleNames]\n\t//    if(result==nil) {\n\t//        result = ruleNames.reduce(function(o, k, i) { o[k] = i })\n\t//        ruleIndexMapCache[ruleNames] = result\n\t//    }\n\t//    return result\n}\n\n// GetTokenType get the token type based upon its name\nfunc (b *BaseRecognizer) GetTokenType(_ string) int {\n\tpanic(\"Method not defined!\")\n\t//    var ttype = b.GetTokenTypeMap()[tokenName]\n\t//    if (ttype !=nil) {\n\t//        return ttype\n\t//    } else {\n\t//        return TokenInvalidType\n\t//    }\n}\n\n//func (b *Recognizer) GetTokenTypeMap() map[string]int {\n//    Vocabulary vocabulary = getVocabulary()\n//\n//    Synchronized (tokenTypeMapCache) {\n//        Map<String, Integer> result = tokenTypeMapCache.Get(vocabulary)\n//        if (result == null) {\n//            result = new HashMap<String, Integer>()\n//            for (int i = 0; i < GetATN().maxTokenType; i++) {\n//                String literalName = vocabulary.getLiteralName(i)\n//                if (literalName != null) {\n//                    result.put(literalName, i)\n//                }\n//\n//                String symbolicName = vocabulary.GetSymbolicName(i)\n//                if (symbolicName != null) {\n//                    result.put(symbolicName, i)\n//                }\n//            }\n//\n//            result.put(\"EOF\", Token.EOF)\n//            result = Collections.unmodifiableMap(result)\n//            tokenTypeMapCache.put(vocabulary, result)\n//        }\n//\n//        return result\n//    }\n//}\n\n// GetErrorHeader returns the error header, normally line/character position information.\n//\n// Can be overridden in sub structs embedding BaseRecognizer.\nfunc (b *BaseRecognizer) GetErrorHeader(e RecognitionException) string {\n\tline := e.GetOffendingToken().GetLine()\n\tcolumn := e.GetOffendingToken().GetColumn()\n\treturn \"line \" + strconv.Itoa(line) + \":\" + strconv.Itoa(column)\n}\n\n// GetTokenErrorDisplay shows how a token should be displayed in an error message.\n//\n// The default is to display just the text, but during development you might\n// want to have a lot of information spit out.  Override in that case\n// to use t.String() (which, for CommonToken, dumps everything about\n// the token). This is better than forcing you to override a method in\n// your token objects because you don't have to go modify your lexer\n// so that it creates a NewJava type.\n//\n// Deprecated: This method is not called by the ANTLR 4 Runtime. Specific\n// implementations of [ANTLRErrorStrategy] may provide a similar\n// feature when necessary. For example, see [DefaultErrorStrategy].GetTokenErrorDisplay()\nfunc (b *BaseRecognizer) GetTokenErrorDisplay(t Token) string {\n\tif t == nil {\n\t\treturn \"<no token>\"\n\t}\n\ts := t.GetText()\n\tif s == \"\" {\n\t\tif t.GetTokenType() == TokenEOF {\n\t\t\ts = \"<EOF>\"\n\t\t} else {\n\t\t\ts = \"<\" + strconv.Itoa(t.GetTokenType()) + \">\"\n\t\t}\n\t}\n\ts = strings.Replace(s, \"\\t\", \"\\\\t\", -1)\n\ts = strings.Replace(s, \"\\n\", \"\\\\n\", -1)\n\ts = strings.Replace(s, \"\\r\", \"\\\\r\", -1)\n\n\treturn \"'\" + s + \"'\"\n}\n\nfunc (b *BaseRecognizer) GetErrorListenerDispatch() ErrorListener {\n\treturn NewProxyErrorListener(b.listeners)\n}\n\n// Sempred embedding structs need to override this if there are sempreds or actions\n// that the ATN interpreter needs to execute\nfunc (b *BaseRecognizer) Sempred(_ RuleContext, _ int, _ int) bool {\n\treturn true\n}\n\n// Precpred embedding structs need to override this if there are preceding predicates\n// that the ATN interpreter needs to execute\nfunc (b *BaseRecognizer) Precpred(_ RuleContext, _ int) bool {\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/rule_context.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// RuleContext is a record of a single rule invocation. It knows\n// which context invoked it, if any. If there is no parent context, then\n// naturally the invoking state is not valid.  The parent link\n// provides a chain upwards from the current rule invocation to the root\n// of the invocation tree, forming a stack.\n//\n// We actually carry no information about the rule associated with this context (except\n// when parsing). We keep only the state number of the invoking state from\n// the [ATN] submachine that invoked this. Contrast this with the s\n// pointer inside [ParserRuleContext] that tracks the current state\n// being \"executed\" for the current rule.\n//\n// The parent contexts are useful for computing lookahead sets and\n// getting error information.\n//\n// These objects are used during parsing and prediction.\n// For the special case of parsers, we use the struct\n// [ParserRuleContext], which embeds a RuleContext.\n//\n// @see ParserRuleContext\ntype RuleContext interface {\n\tRuleNode\n\n\tGetInvokingState() int\n\tSetInvokingState(int)\n\n\tGetRuleIndex() int\n\tIsEmpty() bool\n\n\tGetAltNumber() int\n\tSetAltNumber(altNumber int)\n\n\tString([]string, RuleContext) string\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/semantic_context.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// SemanticContext is a tree structure used to record the semantic context in which\n//\n//\tan ATN configuration is valid.  It's either a single predicate,\n//\ta conjunction p1 && p2, or a sum of products p1 || p2.\n//\n//\tI have scoped the AND, OR, and Predicate subclasses of\n//\t[SemanticContext] within the scope of this outer ``class''\ntype SemanticContext interface {\n\tEquals(other Collectable[SemanticContext]) bool\n\tHash() int\n\n\tevaluate(parser Recognizer, outerContext RuleContext) bool\n\tevalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext\n\n\tString() string\n}\n\nfunc SemanticContextandContext(a, b SemanticContext) SemanticContext {\n\tif a == nil || a == SemanticContextNone {\n\t\treturn b\n\t}\n\tif b == nil || b == SemanticContextNone {\n\t\treturn a\n\t}\n\tresult := NewAND(a, b)\n\tif len(result.opnds) == 1 {\n\t\treturn result.opnds[0]\n\t}\n\n\treturn result\n}\n\nfunc SemanticContextorContext(a, b SemanticContext) SemanticContext {\n\tif a == nil {\n\t\treturn b\n\t}\n\tif b == nil {\n\t\treturn a\n\t}\n\tif a == SemanticContextNone || b == SemanticContextNone {\n\t\treturn SemanticContextNone\n\t}\n\tresult := NewOR(a, b)\n\tif len(result.opnds) == 1 {\n\t\treturn result.opnds[0]\n\t}\n\n\treturn result\n}\n\ntype Predicate struct {\n\truleIndex      int\n\tpredIndex      int\n\tisCtxDependent bool\n}\n\nfunc NewPredicate(ruleIndex, predIndex int, isCtxDependent bool) *Predicate {\n\tp := new(Predicate)\n\n\tp.ruleIndex = ruleIndex\n\tp.predIndex = predIndex\n\tp.isCtxDependent = isCtxDependent // e.g., $i ref in pred\n\treturn p\n}\n\n//The default {@link SemanticContext}, which is semantically equivalent to\n//a predicate of the form {@code {true}?}.\n\nvar SemanticContextNone = NewPredicate(-1, -1, false)\n\nfunc (p *Predicate) evalPrecedence(_ Recognizer, _ RuleContext) SemanticContext {\n\treturn p\n}\n\nfunc (p *Predicate) evaluate(parser Recognizer, outerContext RuleContext) bool {\n\n\tvar localctx RuleContext\n\n\tif p.isCtxDependent {\n\t\tlocalctx = outerContext\n\t}\n\n\treturn parser.Sempred(localctx, p.ruleIndex, p.predIndex)\n}\n\nfunc (p *Predicate) Equals(other Collectable[SemanticContext]) bool {\n\tif p == other {\n\t\treturn true\n\t} else if _, ok := other.(*Predicate); !ok {\n\t\treturn false\n\t} else {\n\t\treturn p.ruleIndex == other.(*Predicate).ruleIndex &&\n\t\t\tp.predIndex == other.(*Predicate).predIndex &&\n\t\t\tp.isCtxDependent == other.(*Predicate).isCtxDependent\n\t}\n}\n\nfunc (p *Predicate) Hash() int {\n\th := murmurInit(0)\n\th = murmurUpdate(h, p.ruleIndex)\n\th = murmurUpdate(h, p.predIndex)\n\tif p.isCtxDependent {\n\t\th = murmurUpdate(h, 1)\n\t} else {\n\t\th = murmurUpdate(h, 0)\n\t}\n\treturn murmurFinish(h, 3)\n}\n\nfunc (p *Predicate) String() string {\n\treturn \"{\" + strconv.Itoa(p.ruleIndex) + \":\" + strconv.Itoa(p.predIndex) + \"}?\"\n}\n\ntype PrecedencePredicate struct {\n\tprecedence int\n}\n\nfunc NewPrecedencePredicate(precedence int) *PrecedencePredicate {\n\n\tp := new(PrecedencePredicate)\n\tp.precedence = precedence\n\n\treturn p\n}\n\nfunc (p *PrecedencePredicate) evaluate(parser Recognizer, outerContext RuleContext) bool {\n\treturn parser.Precpred(outerContext, p.precedence)\n}\n\nfunc (p *PrecedencePredicate) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {\n\tif parser.Precpred(outerContext, p.precedence) {\n\t\treturn SemanticContextNone\n\t}\n\n\treturn nil\n}\n\nfunc (p *PrecedencePredicate) compareTo(other *PrecedencePredicate) int {\n\treturn p.precedence - other.precedence\n}\n\nfunc (p *PrecedencePredicate) Equals(other Collectable[SemanticContext]) bool {\n\n\tvar op *PrecedencePredicate\n\tvar ok bool\n\tif op, ok = other.(*PrecedencePredicate); !ok {\n\t\treturn false\n\t}\n\n\tif p == op {\n\t\treturn true\n\t}\n\n\treturn p.precedence == other.(*PrecedencePredicate).precedence\n}\n\nfunc (p *PrecedencePredicate) Hash() int {\n\th := uint32(1)\n\th = 31*h + uint32(p.precedence)\n\treturn int(h)\n}\n\nfunc (p *PrecedencePredicate) String() string {\n\treturn \"{\" + strconv.Itoa(p.precedence) + \">=prec}?\"\n}\n\nfunc PrecedencePredicatefilterPrecedencePredicates(set *JStore[SemanticContext, Comparator[SemanticContext]]) []*PrecedencePredicate {\n\tresult := make([]*PrecedencePredicate, 0)\n\n\tset.Each(func(v SemanticContext) bool {\n\t\tif c2, ok := v.(*PrecedencePredicate); ok {\n\t\t\tresult = append(result, c2)\n\t\t}\n\t\treturn true\n\t})\n\n\treturn result\n}\n\n// A semantic context which is true whenever none of the contained contexts\n// is false.`\n\ntype AND struct {\n\topnds []SemanticContext\n}\n\nfunc NewAND(a, b SemanticContext) *AND {\n\n\toperands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, \"NewAND() operands\")\n\tif aa, ok := a.(*AND); ok {\n\t\tfor _, o := range aa.opnds {\n\t\t\toperands.Put(o)\n\t\t}\n\t} else {\n\t\toperands.Put(a)\n\t}\n\n\tif ba, ok := b.(*AND); ok {\n\t\tfor _, o := range ba.opnds {\n\t\t\toperands.Put(o)\n\t\t}\n\t} else {\n\t\toperands.Put(b)\n\t}\n\tprecedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands)\n\tif len(precedencePredicates) > 0 {\n\t\t// interested in the transition with the lowest precedence\n\t\tvar reduced *PrecedencePredicate\n\n\t\tfor _, p := range precedencePredicates {\n\t\t\tif reduced == nil || p.precedence < reduced.precedence {\n\t\t\t\treduced = p\n\t\t\t}\n\t\t}\n\n\t\toperands.Put(reduced)\n\t}\n\n\tvs := operands.Values()\n\topnds := make([]SemanticContext, len(vs))\n\tcopy(opnds, vs)\n\n\tand := new(AND)\n\tand.opnds = opnds\n\n\treturn and\n}\n\nfunc (a *AND) Equals(other Collectable[SemanticContext]) bool {\n\tif a == other {\n\t\treturn true\n\t}\n\tif _, ok := other.(*AND); !ok {\n\t\treturn false\n\t} else {\n\t\tfor i, v := range other.(*AND).opnds {\n\t\t\tif !a.opnds[i].Equals(v) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n}\n\n// {@inheritDoc}\n//\n// <p>\n// The evaluation of predicates by a context is short-circuiting, but\n// unordered.</p>\nfunc (a *AND) evaluate(parser Recognizer, outerContext RuleContext) bool {\n\tfor i := 0; i < len(a.opnds); i++ {\n\t\tif !a.opnds[i].evaluate(parser, outerContext) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (a *AND) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {\n\tdiffers := false\n\toperands := make([]SemanticContext, 0)\n\n\tfor i := 0; i < len(a.opnds); i++ {\n\t\tcontext := a.opnds[i]\n\t\tevaluated := context.evalPrecedence(parser, outerContext)\n\t\tdiffers = differs || (evaluated != context)\n\t\tif evaluated == nil {\n\t\t\t// The AND context is false if any element is false\n\t\t\treturn nil\n\t\t} else if evaluated != SemanticContextNone {\n\t\t\t// Reduce the result by Skipping true elements\n\t\t\toperands = append(operands, evaluated)\n\t\t}\n\t}\n\tif !differs {\n\t\treturn a\n\t}\n\n\tif len(operands) == 0 {\n\t\t// all elements were true, so the AND context is true\n\t\treturn SemanticContextNone\n\t}\n\n\tvar result SemanticContext\n\n\tfor _, o := range operands {\n\t\tif result == nil {\n\t\t\tresult = o\n\t\t} else {\n\t\t\tresult = SemanticContextandContext(result, o)\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (a *AND) Hash() int {\n\th := murmurInit(37) // Init with a value different from OR\n\tfor _, op := range a.opnds {\n\t\th = murmurUpdate(h, op.Hash())\n\t}\n\treturn murmurFinish(h, len(a.opnds))\n}\n\nfunc (o *OR) Hash() int {\n\th := murmurInit(41) // Init with o value different from AND\n\tfor _, op := range o.opnds {\n\t\th = murmurUpdate(h, op.Hash())\n\t}\n\treturn murmurFinish(h, len(o.opnds))\n}\n\nfunc (a *AND) String() string {\n\ts := \"\"\n\n\tfor _, o := range a.opnds {\n\t\ts += \"&& \" + fmt.Sprint(o)\n\t}\n\n\tif len(s) > 3 {\n\t\treturn s[0:3]\n\t}\n\n\treturn s\n}\n\n//\n// A semantic context which is true whenever at least one of the contained\n// contexts is true.\n//\n\ntype OR struct {\n\topnds []SemanticContext\n}\n\nfunc NewOR(a, b SemanticContext) *OR {\n\n\toperands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, \"NewOR() operands\")\n\tif aa, ok := a.(*OR); ok {\n\t\tfor _, o := range aa.opnds {\n\t\t\toperands.Put(o)\n\t\t}\n\t} else {\n\t\toperands.Put(a)\n\t}\n\n\tif ba, ok := b.(*OR); ok {\n\t\tfor _, o := range ba.opnds {\n\t\t\toperands.Put(o)\n\t\t}\n\t} else {\n\t\toperands.Put(b)\n\t}\n\tprecedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands)\n\tif len(precedencePredicates) > 0 {\n\t\t// interested in the transition with the lowest precedence\n\t\tvar reduced *PrecedencePredicate\n\n\t\tfor _, p := range precedencePredicates {\n\t\t\tif reduced == nil || p.precedence > reduced.precedence {\n\t\t\t\treduced = p\n\t\t\t}\n\t\t}\n\n\t\toperands.Put(reduced)\n\t}\n\n\tvs := operands.Values()\n\n\topnds := make([]SemanticContext, len(vs))\n\tcopy(opnds, vs)\n\n\to := new(OR)\n\to.opnds = opnds\n\n\treturn o\n}\n\nfunc (o *OR) Equals(other Collectable[SemanticContext]) bool {\n\tif o == other {\n\t\treturn true\n\t} else if _, ok := other.(*OR); !ok {\n\t\treturn false\n\t} else {\n\t\tfor i, v := range other.(*OR).opnds {\n\t\t\tif !o.opnds[i].Equals(v) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n}\n\n// <p>\n// The evaluation of predicates by o context is short-circuiting, but\n// unordered.</p>\nfunc (o *OR) evaluate(parser Recognizer, outerContext RuleContext) bool {\n\tfor i := 0; i < len(o.opnds); i++ {\n\t\tif o.opnds[i].evaluate(parser, outerContext) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (o *OR) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {\n\tdiffers := false\n\toperands := make([]SemanticContext, 0)\n\tfor i := 0; i < len(o.opnds); i++ {\n\t\tcontext := o.opnds[i]\n\t\tevaluated := context.evalPrecedence(parser, outerContext)\n\t\tdiffers = differs || (evaluated != context)\n\t\tif evaluated == SemanticContextNone {\n\t\t\t// The OR context is true if any element is true\n\t\t\treturn SemanticContextNone\n\t\t} else if evaluated != nil {\n\t\t\t// Reduce the result by Skipping false elements\n\t\t\toperands = append(operands, evaluated)\n\t\t}\n\t}\n\tif !differs {\n\t\treturn o\n\t}\n\tif len(operands) == 0 {\n\t\t// all elements were false, so the OR context is false\n\t\treturn nil\n\t}\n\tvar result SemanticContext\n\n\tfor _, o := range operands {\n\t\tif result == nil {\n\t\t\tresult = o\n\t\t} else {\n\t\t\tresult = SemanticContextorContext(result, o)\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (o *OR) String() string {\n\ts := \"\"\n\n\tfor _, o := range o.opnds {\n\t\ts += \"|| \" + fmt.Sprint(o)\n\t}\n\n\tif len(s) > 3 {\n\t\treturn s[0:3]\n\t}\n\n\treturn s\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/statistics.go",
    "content": "//go:build antlr.stats\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// This file allows the user to collect statistics about the runtime of the ANTLR runtime. It is not enabled by default\n// and so incurs no time penalty. To enable it, you must build the runtime with the antlr.stats build tag.\n//\n\n// Tells various components to collect statistics - because it is only true when this file is included, it will\n// allow the compiler to completely eliminate all the code that is only used when collecting statistics.\nconst collectStats = true\n\n// goRunStats is a collection of all the various data the ANTLR runtime has collected about a particular run.\n// It is exported so that it can be used by others to look for things that are not already looked for in the\n// runtime statistics.\ntype goRunStats struct {\n\n\t// jStats is a slice of all the [JStatRec] records that have been created, which is one for EVERY collection created\n\t// during a run. It is exported so that it can be used by others to look for things that are not already looked for\n\t// within this package.\n\t//\n\tjStats            []*JStatRec\n\tjStatsLock        RWMutex\n\ttopN              int\n\ttopNByMax         []*JStatRec\n\ttopNByUsed        []*JStatRec\n\tunusedCollections map[CollectionSource]int\n\tcounts            map[CollectionSource]int\n}\n\nconst (\n\tcollectionsFile = \"collections\"\n)\n\nvar (\n\tStatistics = &goRunStats{\n\t\ttopN: 10,\n\t}\n)\n\ntype statsOption func(*goRunStats) error\n\n// Configure allows the statistics system to be configured as the user wants and override the defaults\nfunc (s *goRunStats) Configure(options ...statsOption) error {\n\tfor _, option := range options {\n\t\terr := option(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// WithTopN sets the number of things to list in the report when we are concerned with the top N things.\n//\n// For example, if you want to see the top 20 collections by size, you can do:\n//\n//\tantlr.Statistics.Configure(antlr.WithTopN(20))\nfunc WithTopN(topN int) statsOption {\n\treturn func(s *goRunStats) error {\n\t\ts.topN = topN\n\t\treturn nil\n\t}\n}\n\n// Analyze looks through all the statistical records and computes all the outputs that might be useful to the user.\n//\n// The function gathers and analyzes a number of statistics about any particular run of\n// an ANTLR generated recognizer. In the vast majority of cases, the statistics are only\n// useful to maintainers of ANTLR itself, but they can be useful to users as well. They may be\n// especially useful in tracking down bugs or performance problems when an ANTLR user could\n// supply the output from this package, but cannot supply the grammar file(s) they are using, even\n// privately to the maintainers.\n//\n// The statistics are gathered by the runtime itself, and are not gathered by the parser or lexer, but the user\n// must call this function their selves to analyze the statistics. This is because none of the infrastructure is\n// extant unless the calling program is built with the antlr.stats tag like so:\n//\n// go build -tags antlr.stats .\n//\n// When a program is built with the antlr.stats tag, the Statistics object is created and available outside\n// the package. The user can then call the [Statistics.Analyze] function to analyze the statistics and then call the\n// [Statistics.Report] function to report the statistics.\n//\n// Please forward any questions about this package to the ANTLR discussion groups on GitHub or send to them to\n// me [Jim Idle] directly at jimi@idle.ws\n//\n// [Jim Idle]: https:://github.com/jim-idle\nfunc (s *goRunStats) Analyze() {\n\n\t// Look for anything that looks strange and record it in our local maps etc for the report to present it\n\t//\n\ts.CollectionAnomalies()\n\ts.TopNCollections()\n}\n\n// TopNCollections looks through all the statistical records and gathers the top ten collections by size.\nfunc (s *goRunStats) TopNCollections() {\n\n\t// Let's sort the stat records by MaxSize\n\t//\n\tsort.Slice(s.jStats, func(i, j int) bool {\n\t\treturn s.jStats[i].MaxSize > s.jStats[j].MaxSize\n\t})\n\n\tfor i := 0; i < len(s.jStats) && i < s.topN; i++ {\n\t\ts.topNByMax = append(s.topNByMax, s.jStats[i])\n\t}\n\n\t// Sort by the number of times used\n\t//\n\tsort.Slice(s.jStats, func(i, j int) bool {\n\t\treturn s.jStats[i].Gets+s.jStats[i].Puts > s.jStats[j].Gets+s.jStats[j].Puts\n\t})\n\tfor i := 0; i < len(s.jStats) && i < s.topN; i++ {\n\t\ts.topNByUsed = append(s.topNByUsed, s.jStats[i])\n\t}\n}\n\n// Report dumps a markdown formatted report of all the statistics collected during a run to the given dir output\n// path, which should represent a directory. Generated files will be prefixed with the given prefix and will be\n// given a type name such as `anomalies` and a time stamp such as `2021-09-01T12:34:56` and a .md suffix.\nfunc (s *goRunStats) Report(dir string, prefix string) error {\n\n\tisDir, err := isDirectory(dir)\n\tswitch {\n\tcase err != nil:\n\t\treturn err\n\tcase !isDir:\n\t\treturn fmt.Errorf(\"output directory `%s` is not a directory\", dir)\n\t}\n\ts.reportCollections(dir, prefix)\n\n\t// Clean out any old data in case the user forgets\n\t//\n\ts.Reset()\n\treturn nil\n}\n\nfunc (s *goRunStats) Reset() {\n\ts.jStats = nil\n\ts.topNByUsed = nil\n\ts.topNByMax = nil\n}\n\nfunc (s *goRunStats) reportCollections(dir, prefix string) {\n\tcname := filepath.Join(dir, \".asciidoctor\")\n\t// If the file doesn't exist, create it, or append to the file\n\tf, err := os.OpenFile(cname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t_, _ = f.WriteString(`// .asciidoctorconfig\n++++\n<style>\nbody {\nfont-family: \"Quicksand\", \"Montserrat\", \"Helvetica\";\nbackground-color: black;\n}\n</style>\n++++`)\n\t_ = f.Close()\n\n\tfname := filepath.Join(dir, prefix+\"_\"+\"_\"+collectionsFile+\"_\"+\".adoc\")\n\t// If the file doesn't exist, create it, or append to the file\n\tf, err = os.OpenFile(fname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer func(f *os.File) {\n\t\terr := f.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}(f)\n\t_, _ = f.WriteString(\"= Collections for \" + prefix + \"\\n\\n\")\n\n\t_, _ = f.WriteString(\"== Summary\\n\")\n\n\tif s.unusedCollections != nil {\n\t\t_, _ = f.WriteString(\"=== Unused Collections\\n\")\n\t\t_, _ = f.WriteString(\"Unused collections incur a penalty for allocation that makes them a candidate for either\\n\")\n\t\t_, _ = f.WriteString(\" removal or optimization. If you are using a collection that is not used, you should\\n\")\n\t\t_, _ = f.WriteString(\" consider removing it. If you are using a collection that is used, but not very often,\\n\")\n\t\t_, _ = f.WriteString(\" you should consider using lazy initialization to defer the allocation until it is\\n\")\n\t\t_, _ = f.WriteString(\" actually needed.\\n\\n\")\n\n\t\t_, _ = f.WriteString(\"\\n.Unused collections\\n\")\n\t\t_, _ = f.WriteString(`[cols=\"<3,>1\"]` + \"\\n\\n\")\n\t\t_, _ = f.WriteString(\"|===\\n\")\n\t\t_, _ = f.WriteString(\"| Type | Count\\n\")\n\n\t\tfor k, v := range s.unusedCollections {\n\t\t\t_, _ = f.WriteString(\"| \" + CollectionDescriptors[k].SybolicName + \" | \" + strconv.Itoa(v) + \"\\n\")\n\t\t}\n\t\tf.WriteString(\"|===\\n\\n\")\n\t}\n\n\t_, _ = f.WriteString(\"\\n.Summary of Collections\\n\")\n\t_, _ = f.WriteString(`[cols=\"<3,>1\"]` + \"\\n\\n\")\n\t_, _ = f.WriteString(\"|===\\n\")\n\t_, _ = f.WriteString(\"| Type | Count\\n\")\n\tfor k, v := range s.counts {\n\t\t_, _ = f.WriteString(\"| \" + CollectionDescriptors[k].SybolicName + \" | \" + strconv.Itoa(v) + \"\\n\")\n\t}\n\t_, _ = f.WriteString(\"| Total | \" + strconv.Itoa(len(s.jStats)) + \"\\n\")\n\t_, _ = f.WriteString(\"|===\\n\\n\")\n\n\t_, _ = f.WriteString(\"\\n.Summary of Top \" + strconv.Itoa(s.topN) + \" Collections by MaxSize\\n\")\n\t_, _ = f.WriteString(`[cols=\"<1,<3,>1,>1,>1,>1\"]` + \"\\n\\n\")\n\t_, _ = f.WriteString(\"|===\\n\")\n\t_, _ = f.WriteString(\"| Source | Description | MaxSize | EndSize | Puts | Gets\\n\")\n\tfor _, c := range s.topNByMax {\n\t\t_, _ = f.WriteString(\"| \" + CollectionDescriptors[c.Source].SybolicName + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + c.Description + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.MaxSize) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.CurSize) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.Puts) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.Gets) + \"\\n\")\n\t\t_, _ = f.WriteString(\"\\n\")\n\t}\n\t_, _ = f.WriteString(\"|===\\n\\n\")\n\n\t_, _ = f.WriteString(\"\\n.Summary of Top \" + strconv.Itoa(s.topN) + \" Collections by Access\\n\")\n\t_, _ = f.WriteString(`[cols=\"<1,<3,>1,>1,>1,>1,>1\"]` + \"\\n\\n\")\n\t_, _ = f.WriteString(\"|===\\n\")\n\t_, _ = f.WriteString(\"| Source | Description | MaxSize | EndSize | Puts | Gets | P+G\\n\")\n\tfor _, c := range s.topNByUsed {\n\t\t_, _ = f.WriteString(\"| \" + CollectionDescriptors[c.Source].SybolicName + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + c.Description + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.MaxSize) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.CurSize) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.Puts) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.Gets) + \"\\n\")\n\t\t_, _ = f.WriteString(\"| \" + strconv.Itoa(c.Gets+c.Puts) + \"\\n\")\n\t\t_, _ = f.WriteString(\"\\n\")\n\t}\n\t_, _ = f.WriteString(\"|===\\n\\n\")\n}\n\n// AddJStatRec adds a [JStatRec] record to the [goRunStats] collection when build runtimeConfig antlr.stats is enabled.\nfunc (s *goRunStats) AddJStatRec(rec *JStatRec) {\n\ts.jStatsLock.Lock()\n\tdefer s.jStatsLock.Unlock()\n\ts.jStats = append(s.jStats, rec)\n}\n\n// CollectionAnomalies looks through all the statistical records and gathers any anomalies that have been found.\nfunc (s *goRunStats) CollectionAnomalies() {\n\ts.jStatsLock.RLock()\n\tdefer s.jStatsLock.RUnlock()\n\ts.counts = make(map[CollectionSource]int, len(s.jStats))\n\tfor _, c := range s.jStats {\n\n\t\t// Accumlate raw counts\n\t\t//\n\t\ts.counts[c.Source]++\n\n\t\t// Look for allocated but unused collections and count them\n\t\tif c.MaxSize == 0 && c.Puts == 0 {\n\t\t\tif s.unusedCollections == nil {\n\t\t\t\ts.unusedCollections = make(map[CollectionSource]int)\n\t\t\t}\n\t\t\ts.unusedCollections[c.Source]++\n\t\t}\n\t\tif c.MaxSize > 6000 {\n\t\t\tfmt.Println(\"Collection \", c.Description, \"accumulated a max size of \", c.MaxSize, \" - this is probably too large and indicates a poorly formed grammar\")\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/stats_data.go",
    "content": "package antlr\n\n// A JStatRec is a record of a particular use of a [JStore], [JMap] or JPCMap] collection. Typically, it will be\n// used to look for unused collections that wre allocated anyway, problems with hash bucket clashes, and anomalies\n// such as huge numbers of Gets with no entries found GetNoEnt. You can refer to the CollectionAnomalies() function\n// for ideas on what can be gleaned from these statistics about collections.\ntype JStatRec struct {\n\tSource           CollectionSource\n\tMaxSize          int\n\tCurSize          int\n\tGets             int\n\tGetHits          int\n\tGetMisses        int\n\tGetHashConflicts int\n\tGetNoEnt         int\n\tPuts             int\n\tPutHits          int\n\tPutMisses        int\n\tPutHashConflicts int\n\tMaxSlotSize      int\n\tDescription      string\n\tCreateStack      []byte\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/token.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype TokenSourceCharStreamPair struct {\n\ttokenSource TokenSource\n\tcharStream  CharStream\n}\n\n// A token has properties: text, type, line, character position in the line\n// (so we can ignore tabs), token channel, index, and source from which\n// we obtained this token.\n\ntype Token interface {\n\tGetSource() *TokenSourceCharStreamPair\n\tGetTokenType() int\n\tGetChannel() int\n\tGetStart() int\n\tGetStop() int\n\tGetLine() int\n\tGetColumn() int\n\n\tGetText() string\n\tSetText(s string)\n\n\tGetTokenIndex() int\n\tSetTokenIndex(v int)\n\n\tGetTokenSource() TokenSource\n\tGetInputStream() CharStream\n\n\tString() string\n}\n\ntype BaseToken struct {\n\tsource     *TokenSourceCharStreamPair\n\ttokenType  int    // token type of the token\n\tchannel    int    // The parser ignores everything not on DEFAULT_CHANNEL\n\tstart      int    // optional return -1 if not implemented.\n\tstop       int    // optional return -1 if not implemented.\n\ttokenIndex int    // from 0..n-1 of the token object in the input stream\n\tline       int    // line=1..n of the 1st character\n\tcolumn     int    // beginning of the line at which it occurs, 0..n-1\n\ttext       string // text of the token.\n\treadOnly   bool\n}\n\nconst (\n\tTokenInvalidType = 0\n\n\t// TokenEpsilon  - during lookahead operations, this \"token\" signifies we hit the rule end [ATN] state\n\t// and did not follow it despite needing to.\n\tTokenEpsilon = -2\n\n\tTokenMinUserTokenType = 1\n\n\tTokenEOF = -1\n\n\t// TokenDefaultChannel is the default channel upon which tokens are sent to the parser.\n\t//\n\t// All tokens go to the parser (unless [Skip] is called in the lexer rule)\n\t// on a particular \"channel\". The parser tunes to a particular channel\n\t// so that whitespace etc... can go to the parser on a \"hidden\" channel.\n\tTokenDefaultChannel = 0\n\n\t// TokenHiddenChannel defines the normal hidden channel - the parser wil not see tokens that are not on [TokenDefaultChannel].\n\t//\n\t// Anything on a different channel than TokenDefaultChannel is not parsed by parser.\n\tTokenHiddenChannel = 1\n)\n\nfunc (b *BaseToken) GetChannel() int {\n\treturn b.channel\n}\n\nfunc (b *BaseToken) GetStart() int {\n\treturn b.start\n}\n\nfunc (b *BaseToken) GetStop() int {\n\treturn b.stop\n}\n\nfunc (b *BaseToken) GetLine() int {\n\treturn b.line\n}\n\nfunc (b *BaseToken) GetColumn() int {\n\treturn b.column\n}\n\nfunc (b *BaseToken) GetTokenType() int {\n\treturn b.tokenType\n}\n\nfunc (b *BaseToken) GetSource() *TokenSourceCharStreamPair {\n\treturn b.source\n}\n\nfunc (b *BaseToken) GetText() string {\n\tif b.text != \"\" {\n\t\treturn b.text\n\t}\n\tinput := b.GetInputStream()\n\tif input == nil {\n\t\treturn \"\"\n\t}\n\tn := input.Size()\n\tif b.GetStart() < n && b.GetStop() < n {\n\t\treturn input.GetTextFromInterval(NewInterval(b.GetStart(), b.GetStop()))\n\t}\n\treturn \"<EOF>\"\n}\n\nfunc (b *BaseToken) SetText(text string) {\n\tb.text = text\n}\n\nfunc (b *BaseToken) GetTokenIndex() int {\n\treturn b.tokenIndex\n}\n\nfunc (b *BaseToken) SetTokenIndex(v int) {\n\tb.tokenIndex = v\n}\n\nfunc (b *BaseToken) GetTokenSource() TokenSource {\n\treturn b.source.tokenSource\n}\n\nfunc (b *BaseToken) GetInputStream() CharStream {\n\treturn b.source.charStream\n}\n\nfunc (b *BaseToken) String() string {\n\ttxt := b.GetText()\n\tif txt != \"\" {\n\t\ttxt = strings.Replace(txt, \"\\n\", \"\\\\n\", -1)\n\t\ttxt = strings.Replace(txt, \"\\r\", \"\\\\r\", -1)\n\t\ttxt = strings.Replace(txt, \"\\t\", \"\\\\t\", -1)\n\t} else {\n\t\ttxt = \"<no text>\"\n\t}\n\n\tvar ch string\n\tif b.GetChannel() > 0 {\n\t\tch = \",channel=\" + strconv.Itoa(b.GetChannel())\n\t} else {\n\t\tch = \"\"\n\t}\n\n\treturn \"[@\" + strconv.Itoa(b.GetTokenIndex()) + \",\" + strconv.Itoa(b.GetStart()) + \":\" + strconv.Itoa(b.GetStop()) + \"='\" +\n\t\ttxt + \"',<\" + strconv.Itoa(b.GetTokenType()) + \">\" +\n\t\tch + \",\" + strconv.Itoa(b.GetLine()) + \":\" + strconv.Itoa(b.GetColumn()) + \"]\"\n}\n\ntype CommonToken struct {\n\tBaseToken\n}\n\nfunc NewCommonToken(source *TokenSourceCharStreamPair, tokenType, channel, start, stop int) *CommonToken {\n\n\tt := &CommonToken{\n\t\tBaseToken: BaseToken{\n\t\t\tsource:     source,\n\t\t\ttokenType:  tokenType,\n\t\t\tchannel:    channel,\n\t\t\tstart:      start,\n\t\t\tstop:       stop,\n\t\t\ttokenIndex: -1,\n\t\t},\n\t}\n\n\tif t.source.tokenSource != nil {\n\t\tt.line = source.tokenSource.GetLine()\n\t\tt.column = source.tokenSource.GetCharPositionInLine()\n\t} else {\n\t\tt.column = -1\n\t}\n\treturn t\n}\n\n// An empty {@link Pair} which is used as the default value of\n// {@link //source} for tokens that do not have a source.\n\n//CommonToken.EMPTY_SOURCE = [ nil, nil ]\n\n// Constructs a New{@link CommonToken} as a copy of another {@link Token}.\n//\n// <p>\n// If {@code oldToken} is also a {@link CommonToken} instance, the newly\n// constructed token will share a reference to the {@link //text} field and\n// the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will\n// be assigned the result of calling {@link //GetText}, and {@link //source}\n// will be constructed from the result of {@link Token//GetTokenSource} and\n// {@link Token//GetInputStream}.</p>\n//\n// @param oldToken The token to copy.\nfunc (c *CommonToken) clone() *CommonToken {\n\tt := NewCommonToken(c.source, c.tokenType, c.channel, c.start, c.stop)\n\tt.tokenIndex = c.GetTokenIndex()\n\tt.line = c.GetLine()\n\tt.column = c.GetColumn()\n\tt.text = c.GetText()\n\treturn t\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/token_source.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\ntype TokenSource interface {\n\tNextToken() Token\n\tSkip()\n\tMore()\n\tGetLine() int\n\tGetCharPositionInLine() int\n\tGetInputStream() CharStream\n\tGetSourceName() string\n\tsetTokenFactory(factory TokenFactory)\n\tGetTokenFactory() TokenFactory\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/token_stream.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\ntype TokenStream interface {\n\tIntStream\n\n\tLT(k int) Token\n\tReset()\n\n\tGet(index int) Token\n\tGetTokenSource() TokenSource\n\tSetTokenSource(TokenSource)\n\n\tGetAllText() string\n\tGetTextFromInterval(Interval) string\n\tGetTextFromRuleContext(RuleContext) string\n\tGetTextFromTokens(Token, Token) string\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\n//\n// Useful for rewriting out a buffered input token stream after doing some\n// augmentation or other manipulations on it.\n\n// <p>\n// You can insert stuff, replace, and delete chunks. Note that the operations\n// are done lazily--only if you convert the buffer to a {@link String} with\n// {@link TokenStream#getText()}. This is very efficient because you are not\n// moving data around all the time. As the buffer of tokens is converted to\n// strings, the {@link #getText()} method(s) scan the input token stream and\n// check to see if there is an operation at the current index. If so, the\n// operation is done and then normal {@link String} rendering continues on the\n// buffer. This is like having multiple Turing machine instruction streams\n// (programs) operating on a single input tape. :)</p>\n// <p>\n\n// This rewriter makes no modifications to the token stream. It does not ask the\n// stream to fill itself up nor does it advance the input cursor. The token\n// stream {@link TokenStream#index()} will return the same value before and\n// after any {@link #getText()} call.</p>\n\n// <p>\n// The rewriter only works on tokens that you have in the buffer and ignores the\n// current input cursor. If you are buffering tokens on-demand, calling\n// {@link #getText()} halfway through the input will only do rewrites for those\n// tokens in the first half of the file.</p>\n\n// <p>\n// Since the operations are done lazily at {@link #getText}-time, operations do\n// not screw up the token index values. That is, an insert operation at token\n// index {@code i} does not change the index values for tokens\n// {@code i}+1..n-1.</p>\n\n// <p>\n// Because operations never actually alter the buffer, you may always get the\n// original token stream back without undoing anything. Since the instructions\n// are queued up, you can easily simulate transactions and roll back any changes\n// if there is an error just by removing instructions. For example,</p>\n\n// <pre>\n// CharStream input = new ANTLRFileStream(\"input\");\n// TLexer lex = new TLexer(input);\n// CommonTokenStream tokens = new CommonTokenStream(lex);\n// T parser = new T(tokens);\n// TokenStreamRewriter rewriter = new TokenStreamRewriter(tokens);\n// parser.startRule();\n// </pre>\n\n// <p>\n// Then in the rules, you can execute (assuming rewriter is visible):</p>\n\n// <pre>\n// Token t,u;\n// ...\n// rewriter.insertAfter(t, \"text to put after t\");}\n// rewriter.insertAfter(u, \"text after u\");}\n// System.out.println(rewriter.getText());\n// </pre>\n\n// <p>\n// You can also have multiple \"instruction streams\" and get multiple rewrites\n// from a single pass over the input. Just name the instruction streams and use\n// that name again when printing the buffer. This could be useful for generating\n// a C file and also its header file--all from the same buffer:</p>\n\n// <pre>\n// rewriter.insertAfter(\"pass1\", t, \"text to put after t\");}\n// rewriter.insertAfter(\"pass2\", u, \"text after u\");}\n// System.out.println(rewriter.getText(\"pass1\"));\n// System.out.println(rewriter.getText(\"pass2\"));\n// </pre>\n\n// <p>\n// If you don't use named rewrite streams, a \"default\" stream is used as the\n// first example shows.</p>\n\nconst (\n\tDefaultProgramName = \"default\"\n\tProgramInitSize    = 100\n\tMinTokenIndex      = 0\n)\n\n// Define the rewrite operation hierarchy\n\ntype RewriteOperation interface {\n\n\t// Execute the rewrite operation by possibly adding to the buffer.\n\t// Return the index of the next token to operate on.\n\tExecute(buffer *bytes.Buffer) int\n\tString() string\n\tGetInstructionIndex() int\n\tGetIndex() int\n\tGetText() string\n\tGetOpName() string\n\tGetTokens() TokenStream\n\tSetInstructionIndex(val int)\n\tSetIndex(int)\n\tSetText(string)\n\tSetOpName(string)\n\tSetTokens(TokenStream)\n}\n\ntype BaseRewriteOperation struct {\n\t//Current index of rewrites list\n\tinstructionIndex int\n\t//Token buffer index\n\tindex int\n\t//Substitution text\n\ttext string\n\t//Actual operation name\n\topName string\n\t//Pointer to token steam\n\ttokens TokenStream\n}\n\nfunc (op *BaseRewriteOperation) GetInstructionIndex() int {\n\treturn op.instructionIndex\n}\n\nfunc (op *BaseRewriteOperation) GetIndex() int {\n\treturn op.index\n}\n\nfunc (op *BaseRewriteOperation) GetText() string {\n\treturn op.text\n}\n\nfunc (op *BaseRewriteOperation) GetOpName() string {\n\treturn op.opName\n}\n\nfunc (op *BaseRewriteOperation) GetTokens() TokenStream {\n\treturn op.tokens\n}\n\nfunc (op *BaseRewriteOperation) SetInstructionIndex(val int) {\n\top.instructionIndex = val\n}\n\nfunc (op *BaseRewriteOperation) SetIndex(val int) {\n\top.index = val\n}\n\nfunc (op *BaseRewriteOperation) SetText(val string) {\n\top.text = val\n}\n\nfunc (op *BaseRewriteOperation) SetOpName(val string) {\n\top.opName = val\n}\n\nfunc (op *BaseRewriteOperation) SetTokens(val TokenStream) {\n\top.tokens = val\n}\n\nfunc (op *BaseRewriteOperation) Execute(_ *bytes.Buffer) int {\n\treturn op.index\n}\n\nfunc (op *BaseRewriteOperation) String() string {\n\treturn fmt.Sprintf(\"<%s@%d:\\\"%s\\\">\",\n\t\top.opName,\n\t\top.tokens.Get(op.GetIndex()),\n\t\top.text,\n\t)\n\n}\n\ntype InsertBeforeOp struct {\n\tBaseRewriteOperation\n}\n\nfunc NewInsertBeforeOp(index int, text string, stream TokenStream) *InsertBeforeOp {\n\treturn &InsertBeforeOp{BaseRewriteOperation: BaseRewriteOperation{\n\t\tindex:  index,\n\t\ttext:   text,\n\t\topName: \"InsertBeforeOp\",\n\t\ttokens: stream,\n\t}}\n}\n\nfunc (op *InsertBeforeOp) Execute(buffer *bytes.Buffer) int {\n\tbuffer.WriteString(op.text)\n\tif op.tokens.Get(op.index).GetTokenType() != TokenEOF {\n\t\tbuffer.WriteString(op.tokens.Get(op.index).GetText())\n\t}\n\treturn op.index + 1\n}\n\nfunc (op *InsertBeforeOp) String() string {\n\treturn op.BaseRewriteOperation.String()\n}\n\n// InsertAfterOp distinguishes between insert after/before to do the \"insert after\" instructions\n// first and then the \"insert before\" instructions at same index. Implementation\n// of \"insert after\" is \"insert before index+1\".\ntype InsertAfterOp struct {\n\tBaseRewriteOperation\n}\n\nfunc NewInsertAfterOp(index int, text string, stream TokenStream) *InsertAfterOp {\n\treturn &InsertAfterOp{\n\t\tBaseRewriteOperation: BaseRewriteOperation{\n\t\t\tindex:  index + 1,\n\t\t\ttext:   text,\n\t\t\ttokens: stream,\n\t\t},\n\t}\n}\n\nfunc (op *InsertAfterOp) Execute(buffer *bytes.Buffer) int {\n\tbuffer.WriteString(op.text)\n\tif op.tokens.Get(op.index).GetTokenType() != TokenEOF {\n\t\tbuffer.WriteString(op.tokens.Get(op.index).GetText())\n\t}\n\treturn op.index + 1\n}\n\nfunc (op *InsertAfterOp) String() string {\n\treturn op.BaseRewriteOperation.String()\n}\n\n// ReplaceOp tries to replace range from x..y with (y-x)+1 ReplaceOp\n// instructions.\ntype ReplaceOp struct {\n\tBaseRewriteOperation\n\tLastIndex int\n}\n\nfunc NewReplaceOp(from, to int, text string, stream TokenStream) *ReplaceOp {\n\treturn &ReplaceOp{\n\t\tBaseRewriteOperation: BaseRewriteOperation{\n\t\t\tindex:  from,\n\t\t\ttext:   text,\n\t\t\topName: \"ReplaceOp\",\n\t\t\ttokens: stream,\n\t\t},\n\t\tLastIndex: to,\n\t}\n}\n\nfunc (op *ReplaceOp) Execute(buffer *bytes.Buffer) int {\n\tif op.text != \"\" {\n\t\tbuffer.WriteString(op.text)\n\t}\n\treturn op.LastIndex + 1\n}\n\nfunc (op *ReplaceOp) String() string {\n\tif op.text == \"\" {\n\t\treturn fmt.Sprintf(\"<DeleteOP@%d..%d>\",\n\t\t\top.tokens.Get(op.index), op.tokens.Get(op.LastIndex))\n\t}\n\treturn fmt.Sprintf(\"<ReplaceOp@%d..%d:\\\"%s\\\">\",\n\t\top.tokens.Get(op.index), op.tokens.Get(op.LastIndex), op.text)\n}\n\ntype TokenStreamRewriter struct {\n\t//Our source stream\n\ttokens TokenStream\n\t// You may have multiple, named streams of rewrite operations.\n\t//  I'm calling these things \"programs.\"\n\t//  Maps String (name) &rarr; rewrite (List)\n\tprograms                map[string][]RewriteOperation\n\tlastRewriteTokenIndexes map[string]int\n}\n\nfunc NewTokenStreamRewriter(tokens TokenStream) *TokenStreamRewriter {\n\treturn &TokenStreamRewriter{\n\t\ttokens: tokens,\n\t\tprograms: map[string][]RewriteOperation{\n\t\t\tDefaultProgramName: make([]RewriteOperation, 0, ProgramInitSize),\n\t\t},\n\t\tlastRewriteTokenIndexes: map[string]int{},\n\t}\n}\n\nfunc (tsr *TokenStreamRewriter) GetTokenStream() TokenStream {\n\treturn tsr.tokens\n}\n\n// Rollback the instruction stream for a program so that\n// the indicated instruction (via instructionIndex) is no\n// longer in the stream. UNTESTED!\nfunc (tsr *TokenStreamRewriter) Rollback(programName string, instructionIndex int) {\n\tis, ok := tsr.programs[programName]\n\tif ok {\n\t\ttsr.programs[programName] = is[MinTokenIndex:instructionIndex]\n\t}\n}\n\nfunc (tsr *TokenStreamRewriter) RollbackDefault(instructionIndex int) {\n\ttsr.Rollback(DefaultProgramName, instructionIndex)\n}\n\n// DeleteProgram Reset the program so that no instructions exist\nfunc (tsr *TokenStreamRewriter) DeleteProgram(programName string) {\n\ttsr.Rollback(programName, MinTokenIndex) //TODO: double test on that cause lower bound is not included\n}\n\nfunc (tsr *TokenStreamRewriter) DeleteProgramDefault() {\n\ttsr.DeleteProgram(DefaultProgramName)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertAfter(programName string, index int, text string) {\n\t// to insert after, just insert before next index (even if past end)\n\tvar op RewriteOperation = NewInsertAfterOp(index, text, tsr.tokens)\n\trewrites := tsr.GetProgram(programName)\n\top.SetInstructionIndex(len(rewrites))\n\ttsr.AddToProgram(programName, op)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertAfterDefault(index int, text string) {\n\ttsr.InsertAfter(DefaultProgramName, index, text)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertAfterToken(programName string, token Token, text string) {\n\ttsr.InsertAfter(programName, token.GetTokenIndex(), text)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertBefore(programName string, index int, text string) {\n\tvar op RewriteOperation = NewInsertBeforeOp(index, text, tsr.tokens)\n\trewrites := tsr.GetProgram(programName)\n\top.SetInstructionIndex(len(rewrites))\n\ttsr.AddToProgram(programName, op)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertBeforeDefault(index int, text string) {\n\ttsr.InsertBefore(DefaultProgramName, index, text)\n}\n\nfunc (tsr *TokenStreamRewriter) InsertBeforeToken(programName string, token Token, text string) {\n\ttsr.InsertBefore(programName, token.GetTokenIndex(), text)\n}\n\nfunc (tsr *TokenStreamRewriter) Replace(programName string, from, to int, text string) {\n\tif from > to || from < 0 || to < 0 || to >= tsr.tokens.Size() {\n\t\tpanic(fmt.Sprintf(\"replace: range invalid: %d..%d(size=%d)\",\n\t\t\tfrom, to, tsr.tokens.Size()))\n\t}\n\tvar op RewriteOperation = NewReplaceOp(from, to, text, tsr.tokens)\n\trewrites := tsr.GetProgram(programName)\n\top.SetInstructionIndex(len(rewrites))\n\ttsr.AddToProgram(programName, op)\n}\n\nfunc (tsr *TokenStreamRewriter) ReplaceDefault(from, to int, text string) {\n\ttsr.Replace(DefaultProgramName, from, to, text)\n}\n\nfunc (tsr *TokenStreamRewriter) ReplaceDefaultPos(index int, text string) {\n\ttsr.ReplaceDefault(index, index, text)\n}\n\nfunc (tsr *TokenStreamRewriter) ReplaceToken(programName string, from, to Token, text string) {\n\ttsr.Replace(programName, from.GetTokenIndex(), to.GetTokenIndex(), text)\n}\n\nfunc (tsr *TokenStreamRewriter) ReplaceTokenDefault(from, to Token, text string) {\n\ttsr.ReplaceToken(DefaultProgramName, from, to, text)\n}\n\nfunc (tsr *TokenStreamRewriter) ReplaceTokenDefaultPos(index Token, text string) {\n\ttsr.ReplaceTokenDefault(index, index, text)\n}\n\nfunc (tsr *TokenStreamRewriter) Delete(programName string, from, to int) {\n\ttsr.Replace(programName, from, to, \"\")\n}\n\nfunc (tsr *TokenStreamRewriter) DeleteDefault(from, to int) {\n\ttsr.Delete(DefaultProgramName, from, to)\n}\n\nfunc (tsr *TokenStreamRewriter) DeleteDefaultPos(index int) {\n\ttsr.DeleteDefault(index, index)\n}\n\nfunc (tsr *TokenStreamRewriter) DeleteToken(programName string, from, to Token) {\n\ttsr.ReplaceToken(programName, from, to, \"\")\n}\n\nfunc (tsr *TokenStreamRewriter) DeleteTokenDefault(from, to Token) {\n\ttsr.DeleteToken(DefaultProgramName, from, to)\n}\n\nfunc (tsr *TokenStreamRewriter) GetLastRewriteTokenIndex(programName string) int {\n\ti, ok := tsr.lastRewriteTokenIndexes[programName]\n\tif !ok {\n\t\treturn -1\n\t}\n\treturn i\n}\n\nfunc (tsr *TokenStreamRewriter) GetLastRewriteTokenIndexDefault() int {\n\treturn tsr.GetLastRewriteTokenIndex(DefaultProgramName)\n}\n\nfunc (tsr *TokenStreamRewriter) SetLastRewriteTokenIndex(programName string, i int) {\n\ttsr.lastRewriteTokenIndexes[programName] = i\n}\n\nfunc (tsr *TokenStreamRewriter) InitializeProgram(name string) []RewriteOperation {\n\tis := make([]RewriteOperation, 0, ProgramInitSize)\n\ttsr.programs[name] = is\n\treturn is\n}\n\nfunc (tsr *TokenStreamRewriter) AddToProgram(name string, op RewriteOperation) {\n\tis := tsr.GetProgram(name)\n\tis = append(is, op)\n\ttsr.programs[name] = is\n}\n\nfunc (tsr *TokenStreamRewriter) GetProgram(name string) []RewriteOperation {\n\tis, ok := tsr.programs[name]\n\tif !ok {\n\t\tis = tsr.InitializeProgram(name)\n\t}\n\treturn is\n}\n\n// GetTextDefault returns the text from the original tokens altered per the\n// instructions given to this rewriter.\nfunc (tsr *TokenStreamRewriter) GetTextDefault() string {\n\treturn tsr.GetText(\n\t\tDefaultProgramName,\n\t\tNewInterval(0, tsr.tokens.Size()-1))\n}\n\n// GetText returns the text from the original tokens altered per the\n// instructions given to this rewriter.\nfunc (tsr *TokenStreamRewriter) GetText(programName string, interval Interval) string {\n\trewrites := tsr.programs[programName]\n\tstart := interval.Start\n\tstop := interval.Stop\n\t// ensure start/end are in range\n\tstop = min(stop, tsr.tokens.Size()-1)\n\tstart = max(start, 0)\n\tif len(rewrites) == 0 {\n\t\treturn tsr.tokens.GetTextFromInterval(interval) // no instructions to execute\n\t}\n\tbuf := bytes.Buffer{}\n\t// First, optimize instruction stream\n\tindexToOp := reduceToSingleOperationPerIndex(rewrites)\n\t// Walk buffer, executing instructions and emitting tokens\n\tfor i := start; i <= stop && i < tsr.tokens.Size(); {\n\t\top := indexToOp[i]\n\t\tdelete(indexToOp, i) // remove so any left have index size-1\n\t\tt := tsr.tokens.Get(i)\n\t\tif op == nil {\n\t\t\t// no operation at that index, just dump token\n\t\t\tif t.GetTokenType() != TokenEOF {\n\t\t\t\tbuf.WriteString(t.GetText())\n\t\t\t}\n\t\t\ti++ // move to next token\n\t\t} else {\n\t\t\ti = op.Execute(&buf) // execute operation and skip\n\t\t}\n\t}\n\t// include stuff after end if it's last index in buffer\n\t// So, if they did an insertAfter(lastValidIndex, \"foo\"), include\n\t// foo if end==lastValidIndex.\n\tif stop == tsr.tokens.Size()-1 {\n\t\t// Scan any remaining operations after last token\n\t\t// should be included (they will be inserts).\n\t\tfor _, op := range indexToOp {\n\t\t\tif op.GetIndex() >= tsr.tokens.Size()-1 {\n\t\t\t\tbuf.WriteString(op.GetText())\n\t\t\t}\n\t\t}\n\t}\n\treturn buf.String()\n}\n\n// reduceToSingleOperationPerIndex combines operations and report invalid operations (like\n// overlapping replaces that are not completed nested). Inserts to\n// same index need to be combined etc...\n//\n// Here are the cases:\n//\n//\t I.i.u I.j.v\t\t\t\t\t\t\t\tleave alone, non-overlapping\n//\t I.i.u I.i.v\t\t\t\t\t\t\t\tcombine: Iivu\n//\n//\t R.i-j.u R.x-y.v\t| i-j in x-y\t\t\tdelete first R\n//\t R.i-j.u R.i-j.v\t\t\t\t\t\t\tdelete first R\n//\t R.i-j.u R.x-y.v\t| x-y in i-j\t\t\tERROR\n//\t R.i-j.u R.x-y.v\t| boundaries overlap\tERROR\n//\n//\t Delete special case of replace (text==null):\n//\t D.i-j.u D.x-y.v\t| boundaries overlap\tcombine to max(min)..max(right)\n//\n//\t I.i.u R.x-y.v | i in (x+1)-y\t\t\tdelete I (since insert before\n//\t\t\t\t\t\t\t\t\t\t\t\t\twe're not deleting i)\n//\t I.i.u R.x-y.v | i not in (x+1)-y\t\tleave alone, non-overlapping\n//\t R.x-y.v I.i.u | i in x-y\t\t\t\tERROR\n//\t R.x-y.v I.x.u \t\t\t\t\t\t\tR.x-y.uv (combine, delete I)\n//\t R.x-y.v I.i.u | i not in x-y\t\t\tleave alone, non-overlapping\n//\n//\t I.i.u = insert u before op @ index i\n//\t R.x-y.u = replace x-y indexed tokens with u\n//\n// First we need to examine replaces. For any replace op:\n//\n//  1. wipe out any insertions before op within that range.\n//  2. Drop any replace op before that is contained completely within\n//     that range.\n//  3. Throw exception upon boundary overlap with any previous replace.\n//\n// Then we can deal with inserts:\n//\n//  1. for any inserts to same index, combine even if not adjacent.\n//  2. for any prior replace with same left boundary, combine this\n//     insert with replace and delete this 'replace'.\n//  3. throw exception if index in same range as previous replace\n//\n// Don't actually delete; make op null in list. Easier to walk list.\n// Later we can throw as we add to index &rarr; op map.\n//\n// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the\n// inserted stuff would be before the 'replace' range. But, if you\n// add tokens in front of a method body '{' and then delete the method\n// body, I think the stuff before the '{' you added should disappear too.\n//\n// The func returns a map from token index to operation.\nfunc reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]RewriteOperation {\n\t// WALK REPLACES\n\tfor i := 0; i < len(rewrites); i++ {\n\t\top := rewrites[i]\n\t\tif op == nil {\n\t\t\tcontinue\n\t\t}\n\t\trop, ok := op.(*ReplaceOp)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\t// Wipe prior inserts within range\n\t\tfor j := 0; j < i && j < len(rewrites); j++ {\n\t\t\tif iop, ok := rewrites[j].(*InsertBeforeOp); ok {\n\t\t\t\tif iop.index == rop.index {\n\t\t\t\t\t// E.g., insert before 2, delete 2..2; update replace\n\t\t\t\t\t// text to include insert before, kill insert\n\t\t\t\t\trewrites[iop.instructionIndex] = nil\n\t\t\t\t\tif rop.text != \"\" {\n\t\t\t\t\t\trop.text = iop.text + rop.text\n\t\t\t\t\t} else {\n\t\t\t\t\t\trop.text = iop.text\n\t\t\t\t\t}\n\t\t\t\t} else if iop.index > rop.index && iop.index <= rop.LastIndex {\n\t\t\t\t\t// delete insert as it's a no-op.\n\t\t\t\t\trewrites[iop.instructionIndex] = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Drop any prior replaces contained within\n\t\tfor j := 0; j < i && j < len(rewrites); j++ {\n\t\t\tif prevop, ok := rewrites[j].(*ReplaceOp); ok {\n\t\t\t\tif prevop.index >= rop.index && prevop.LastIndex <= rop.LastIndex {\n\t\t\t\t\t// delete replace as it's a no-op.\n\t\t\t\t\trewrites[prevop.instructionIndex] = nil\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// throw exception unless disjoint or identical\n\t\t\t\tdisjoint := prevop.LastIndex < rop.index || prevop.index > rop.LastIndex\n\t\t\t\t// Delete special case of replace (text==null):\n\t\t\t\t// D.i-j.u D.x-y.v\t| boundaries overlap\tcombine to max(min)..max(right)\n\t\t\t\tif prevop.text == \"\" && rop.text == \"\" && !disjoint {\n\t\t\t\t\trewrites[prevop.instructionIndex] = nil\n\t\t\t\t\trop.index = min(prevop.index, rop.index)\n\t\t\t\t\trop.LastIndex = max(prevop.LastIndex, rop.LastIndex)\n\t\t\t\t} else if !disjoint {\n\t\t\t\t\tpanic(\"replace op boundaries of \" + rop.String() + \" overlap with previous \" + prevop.String())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// WALK INSERTS\n\tfor i := 0; i < len(rewrites); i++ {\n\t\top := rewrites[i]\n\t\tif op == nil {\n\t\t\tcontinue\n\t\t}\n\t\t//hack to replicate inheritance in composition\n\t\t_, iok := rewrites[i].(*InsertBeforeOp)\n\t\t_, aok := rewrites[i].(*InsertAfterOp)\n\t\tif !iok && !aok {\n\t\t\tcontinue\n\t\t}\n\t\tiop := rewrites[i]\n\t\t// combine current insert with prior if any at same index\n\t\t// deviating a bit from TokenStreamRewriter.java - hard to incorporate inheritance logic\n\t\tfor j := 0; j < i && j < len(rewrites); j++ {\n\t\t\tif nextIop, ok := rewrites[j].(*InsertAfterOp); ok {\n\t\t\t\tif nextIop.index == iop.GetIndex() {\n\t\t\t\t\tiop.SetText(nextIop.text + iop.GetText())\n\t\t\t\t\trewrites[j] = nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tif prevIop, ok := rewrites[j].(*InsertBeforeOp); ok {\n\t\t\t\tif prevIop.index == iop.GetIndex() {\n\t\t\t\t\tiop.SetText(iop.GetText() + prevIop.text)\n\t\t\t\t\trewrites[prevIop.instructionIndex] = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// look for replaces where iop.index is in range; error\n\t\tfor j := 0; j < i && j < len(rewrites); j++ {\n\t\t\tif rop, ok := rewrites[j].(*ReplaceOp); ok {\n\t\t\t\tif iop.GetIndex() == rop.index {\n\t\t\t\t\trop.text = iop.GetText() + rop.text\n\t\t\t\t\trewrites[i] = nil\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif iop.GetIndex() >= rop.index && iop.GetIndex() <= rop.LastIndex {\n\t\t\t\t\tpanic(\"insert op \" + iop.String() + \" within boundaries of previous \" + rop.String())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tm := map[int]RewriteOperation{}\n\tfor i := 0; i < len(rewrites); i++ {\n\t\top := rewrites[i]\n\t\tif op == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := m[op.GetIndex()]; ok {\n\t\t\tpanic(\"should only be one op per index\")\n\t\t}\n\t\tm[op.GetIndex()] = op\n\t}\n\treturn m\n}\n\n/*\n\tQuick fixing Go lack of overloads\n*/\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/trace_listener.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport \"fmt\"\n\ntype TraceListener struct {\n\tparser *BaseParser\n}\n\nfunc NewTraceListener(parser *BaseParser) *TraceListener {\n\ttl := new(TraceListener)\n\ttl.parser = parser\n\treturn tl\n}\n\nfunc (t *TraceListener) VisitErrorNode(_ ErrorNode) {\n}\n\nfunc (t *TraceListener) EnterEveryRule(ctx ParserRuleContext) {\n\tfmt.Println(\"enter   \" + t.parser.GetRuleNames()[ctx.GetRuleIndex()] + \", LT(1)=\" + t.parser.input.LT(1).GetText())\n}\n\nfunc (t *TraceListener) VisitTerminal(node TerminalNode) {\n\tfmt.Println(\"consume \" + fmt.Sprint(node.GetSymbol()) + \" rule \" + t.parser.GetRuleNames()[t.parser.ctx.GetRuleIndex()])\n}\n\nfunc (t *TraceListener) ExitEveryRule(ctx ParserRuleContext) {\n\tfmt.Println(\"exit    \" + t.parser.GetRuleNames()[ctx.GetRuleIndex()] + \", LT(1)=\" + t.parser.input.LT(1).GetText())\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/transition.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n//  atom, set, epsilon, action, predicate, rule transitions.\n//\n//  <p>This is a one way link.  It emanates from a state (usually via a list of\n//  transitions) and has a target state.</p>\n//\n//  <p>Since we never have to change the ATN transitions once we construct it,\n//  the states. We'll use the term Edge for the DFA to distinguish them from\n//  ATN transitions.</p>\n\ntype Transition interface {\n\tgetTarget() ATNState\n\tsetTarget(ATNState)\n\tgetIsEpsilon() bool\n\tgetLabel() *IntervalSet\n\tgetSerializationType() int\n\tMatches(int, int, int) bool\n}\n\ntype BaseTransition struct {\n\ttarget            ATNState\n\tisEpsilon         bool\n\tlabel             int\n\tintervalSet       *IntervalSet\n\tserializationType int\n}\n\nfunc NewBaseTransition(target ATNState) *BaseTransition {\n\n\tif target == nil {\n\t\tpanic(\"target cannot be nil.\")\n\t}\n\n\tt := new(BaseTransition)\n\n\tt.target = target\n\t// Are we epsilon, action, sempred?\n\tt.isEpsilon = false\n\tt.intervalSet = nil\n\n\treturn t\n}\n\nfunc (t *BaseTransition) getTarget() ATNState {\n\treturn t.target\n}\n\nfunc (t *BaseTransition) setTarget(s ATNState) {\n\tt.target = s\n}\n\nfunc (t *BaseTransition) getIsEpsilon() bool {\n\treturn t.isEpsilon\n}\n\nfunc (t *BaseTransition) getLabel() *IntervalSet {\n\treturn t.intervalSet\n}\n\nfunc (t *BaseTransition) getSerializationType() int {\n\treturn t.serializationType\n}\n\nfunc (t *BaseTransition) Matches(_, _, _ int) bool {\n\tpanic(\"Not implemented\")\n}\n\nconst (\n\tTransitionEPSILON    = 1\n\tTransitionRANGE      = 2\n\tTransitionRULE       = 3\n\tTransitionPREDICATE  = 4 // e.g., {isType(input.LT(1))}?\n\tTransitionATOM       = 5\n\tTransitionACTION     = 6\n\tTransitionSET        = 7 // ~(A|B) or ~atom, wildcard, which convert to next 2\n\tTransitionNOTSET     = 8\n\tTransitionWILDCARD   = 9\n\tTransitionPRECEDENCE = 10\n)\n\n//goland:noinspection GoUnusedGlobalVariable\nvar TransitionserializationNames = []string{\n\t\"INVALID\",\n\t\"EPSILON\",\n\t\"RANGE\",\n\t\"RULE\",\n\t\"PREDICATE\",\n\t\"ATOM\",\n\t\"ACTION\",\n\t\"SET\",\n\t\"NOT_SET\",\n\t\"WILDCARD\",\n\t\"PRECEDENCE\",\n}\n\n//var TransitionserializationTypes struct {\n//\tEpsilonTransition int\n//\tRangeTransition int\n//\tRuleTransition int\n//\tPredicateTransition int\n//\tAtomTransition int\n//\tActionTransition int\n//\tSetTransition int\n//\tNotSetTransition int\n//\tWildcardTransition int\n//\tPrecedencePredicateTransition int\n//}{\n//\tTransitionEPSILON,\n//\tTransitionRANGE,\n//\tTransitionRULE,\n//\tTransitionPREDICATE,\n//\tTransitionATOM,\n//\tTransitionACTION,\n//\tTransitionSET,\n//\tTransitionNOTSET,\n//\tTransitionWILDCARD,\n//\tTransitionPRECEDENCE\n//}\n\n// AtomTransition\n// TODO: make all transitions sets? no, should remove set edges\ntype AtomTransition struct {\n\tBaseTransition\n}\n\nfunc NewAtomTransition(target ATNState, intervalSet int) *AtomTransition {\n\tt := &AtomTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionATOM,\n\t\t\tlabel:             intervalSet,\n\t\t\tisEpsilon:         false,\n\t\t},\n\t}\n\tt.intervalSet = t.makeLabel()\n\n\treturn t\n}\n\nfunc (t *AtomTransition) makeLabel() *IntervalSet {\n\ts := NewIntervalSet()\n\ts.addOne(t.label)\n\treturn s\n}\n\nfunc (t *AtomTransition) Matches(symbol, _, _ int) bool {\n\treturn t.label == symbol\n}\n\nfunc (t *AtomTransition) String() string {\n\treturn strconv.Itoa(t.label)\n}\n\ntype RuleTransition struct {\n\tBaseTransition\n\tfollowState           ATNState\n\truleIndex, precedence int\n}\n\nfunc NewRuleTransition(ruleStart ATNState, ruleIndex, precedence int, followState ATNState) *RuleTransition {\n\treturn &RuleTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            ruleStart,\n\t\t\tisEpsilon:         true,\n\t\t\tserializationType: TransitionRULE,\n\t\t},\n\t\truleIndex:   ruleIndex,\n\t\tprecedence:  precedence,\n\t\tfollowState: followState,\n\t}\n}\n\nfunc (t *RuleTransition) Matches(_, _, _ int) bool {\n\treturn false\n}\n\ntype EpsilonTransition struct {\n\tBaseTransition\n\toutermostPrecedenceReturn int\n}\n\nfunc NewEpsilonTransition(target ATNState, outermostPrecedenceReturn int) *EpsilonTransition {\n\treturn &EpsilonTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionEPSILON,\n\t\t\tisEpsilon:         true,\n\t\t},\n\t\toutermostPrecedenceReturn: outermostPrecedenceReturn,\n\t}\n}\n\nfunc (t *EpsilonTransition) Matches(_, _, _ int) bool {\n\treturn false\n}\n\nfunc (t *EpsilonTransition) String() string {\n\treturn \"epsilon\"\n}\n\ntype RangeTransition struct {\n\tBaseTransition\n\tstart, stop int\n}\n\nfunc NewRangeTransition(target ATNState, start, stop int) *RangeTransition {\n\tt := &RangeTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionRANGE,\n\t\t\tisEpsilon:         false,\n\t\t},\n\t\tstart: start,\n\t\tstop:  stop,\n\t}\n\tt.intervalSet = t.makeLabel()\n\treturn t\n}\n\nfunc (t *RangeTransition) makeLabel() *IntervalSet {\n\ts := NewIntervalSet()\n\ts.addRange(t.start, t.stop)\n\treturn s\n}\n\nfunc (t *RangeTransition) Matches(symbol, _, _ int) bool {\n\treturn symbol >= t.start && symbol <= t.stop\n}\n\nfunc (t *RangeTransition) String() string {\n\tvar sb strings.Builder\n\tsb.WriteByte('\\'')\n\tsb.WriteRune(rune(t.start))\n\tsb.WriteString(\"'..'\")\n\tsb.WriteRune(rune(t.stop))\n\tsb.WriteByte('\\'')\n\treturn sb.String()\n}\n\ntype AbstractPredicateTransition interface {\n\tTransition\n\tIAbstractPredicateTransitionFoo()\n}\n\ntype BaseAbstractPredicateTransition struct {\n\tBaseTransition\n}\n\nfunc NewBasePredicateTransition(target ATNState) *BaseAbstractPredicateTransition {\n\treturn &BaseAbstractPredicateTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget: target,\n\t\t},\n\t}\n}\n\nfunc (a *BaseAbstractPredicateTransition) IAbstractPredicateTransitionFoo() {}\n\ntype PredicateTransition struct {\n\tBaseAbstractPredicateTransition\n\tisCtxDependent       bool\n\truleIndex, predIndex int\n}\n\nfunc NewPredicateTransition(target ATNState, ruleIndex, predIndex int, isCtxDependent bool) *PredicateTransition {\n\treturn &PredicateTransition{\n\t\tBaseAbstractPredicateTransition: BaseAbstractPredicateTransition{\n\t\t\tBaseTransition: BaseTransition{\n\t\t\t\ttarget:            target,\n\t\t\t\tserializationType: TransitionPREDICATE,\n\t\t\t\tisEpsilon:         true,\n\t\t\t},\n\t\t},\n\t\tisCtxDependent: isCtxDependent,\n\t\truleIndex:      ruleIndex,\n\t\tpredIndex:      predIndex,\n\t}\n}\n\nfunc (t *PredicateTransition) Matches(_, _, _ int) bool {\n\treturn false\n}\n\nfunc (t *PredicateTransition) getPredicate() *Predicate {\n\treturn NewPredicate(t.ruleIndex, t.predIndex, t.isCtxDependent)\n}\n\nfunc (t *PredicateTransition) String() string {\n\treturn \"pred_\" + strconv.Itoa(t.ruleIndex) + \":\" + strconv.Itoa(t.predIndex)\n}\n\ntype ActionTransition struct {\n\tBaseTransition\n\tisCtxDependent                    bool\n\truleIndex, actionIndex, predIndex int\n}\n\nfunc NewActionTransition(target ATNState, ruleIndex, actionIndex int, isCtxDependent bool) *ActionTransition {\n\treturn &ActionTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionACTION,\n\t\t\tisEpsilon:         true,\n\t\t},\n\t\tisCtxDependent: isCtxDependent,\n\t\truleIndex:      ruleIndex,\n\t\tactionIndex:    actionIndex,\n\t}\n}\n\nfunc (t *ActionTransition) Matches(_, _, _ int) bool {\n\treturn false\n}\n\nfunc (t *ActionTransition) String() string {\n\treturn \"action_\" + strconv.Itoa(t.ruleIndex) + \":\" + strconv.Itoa(t.actionIndex)\n}\n\ntype SetTransition struct {\n\tBaseTransition\n}\n\nfunc NewSetTransition(target ATNState, set *IntervalSet) *SetTransition {\n\tt := &SetTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionSET,\n\t\t},\n\t}\n\n\tif set != nil {\n\t\tt.intervalSet = set\n\t} else {\n\t\tt.intervalSet = NewIntervalSet()\n\t\tt.intervalSet.addOne(TokenInvalidType)\n\t}\n\treturn t\n}\n\nfunc (t *SetTransition) Matches(symbol, _, _ int) bool {\n\treturn t.intervalSet.contains(symbol)\n}\n\nfunc (t *SetTransition) String() string {\n\treturn t.intervalSet.String()\n}\n\ntype NotSetTransition struct {\n\tSetTransition\n}\n\nfunc NewNotSetTransition(target ATNState, set *IntervalSet) *NotSetTransition {\n\tt := &NotSetTransition{\n\t\tSetTransition: SetTransition{\n\t\t\tBaseTransition: BaseTransition{\n\t\t\t\ttarget:            target,\n\t\t\t\tserializationType: TransitionNOTSET,\n\t\t\t},\n\t\t},\n\t}\n\tif set != nil {\n\t\tt.intervalSet = set\n\t} else {\n\t\tt.intervalSet = NewIntervalSet()\n\t\tt.intervalSet.addOne(TokenInvalidType)\n\t}\n\n\treturn t\n}\n\nfunc (t *NotSetTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol && !t.intervalSet.contains(symbol)\n}\n\nfunc (t *NotSetTransition) String() string {\n\treturn \"~\" + t.intervalSet.String()\n}\n\ntype WildcardTransition struct {\n\tBaseTransition\n}\n\nfunc NewWildcardTransition(target ATNState) *WildcardTransition {\n\treturn &WildcardTransition{\n\t\tBaseTransition: BaseTransition{\n\t\t\ttarget:            target,\n\t\t\tserializationType: TransitionWILDCARD,\n\t\t},\n\t}\n}\n\nfunc (t *WildcardTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol\n}\n\nfunc (t *WildcardTransition) String() string {\n\treturn \".\"\n}\n\ntype PrecedencePredicateTransition struct {\n\tBaseAbstractPredicateTransition\n\tprecedence int\n}\n\nfunc NewPrecedencePredicateTransition(target ATNState, precedence int) *PrecedencePredicateTransition {\n\treturn &PrecedencePredicateTransition{\n\t\tBaseAbstractPredicateTransition: BaseAbstractPredicateTransition{\n\t\t\tBaseTransition: BaseTransition{\n\t\t\t\ttarget:            target,\n\t\t\t\tserializationType: TransitionPRECEDENCE,\n\t\t\t\tisEpsilon:         true,\n\t\t\t},\n\t\t},\n\t\tprecedence: precedence,\n\t}\n}\n\nfunc (t *PrecedencePredicateTransition) Matches(_, _, _ int) bool {\n\treturn false\n}\n\nfunc (t *PrecedencePredicateTransition) getPredicate() *PrecedencePredicate {\n\treturn NewPrecedencePredicate(t.precedence)\n}\n\nfunc (t *PrecedencePredicateTransition) String() string {\n\treturn fmt.Sprint(t.precedence) + \" >= _p\"\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/tree.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\n// The basic notion of a tree has a parent, a payload, and a list of children.\n//  It is the most abstract interface for all the trees used by ANTLR.\n///\n\nvar TreeInvalidInterval = NewInterval(-1, -2)\n\ntype Tree interface {\n\tGetParent() Tree\n\tSetParent(Tree)\n\tGetPayload() interface{}\n\tGetChild(i int) Tree\n\tGetChildCount() int\n\tGetChildren() []Tree\n}\n\ntype SyntaxTree interface {\n\tTree\n\tGetSourceInterval() Interval\n}\n\ntype ParseTree interface {\n\tSyntaxTree\n\tAccept(Visitor ParseTreeVisitor) interface{}\n\tGetText() string\n\tToStringTree([]string, Recognizer) string\n}\n\ntype RuleNode interface {\n\tParseTree\n\tGetRuleContext() RuleContext\n}\n\ntype TerminalNode interface {\n\tParseTree\n\tGetSymbol() Token\n}\n\ntype ErrorNode interface {\n\tTerminalNode\n\n\terrorNode()\n}\n\ntype ParseTreeVisitor interface {\n\tVisit(tree ParseTree) interface{}\n\tVisitChildren(node RuleNode) interface{}\n\tVisitTerminal(node TerminalNode) interface{}\n\tVisitErrorNode(node ErrorNode) interface{}\n}\n\ntype BaseParseTreeVisitor struct{}\n\nvar _ ParseTreeVisitor = &BaseParseTreeVisitor{}\n\nfunc (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{}         { return tree.Accept(v) }\nfunc (v *BaseParseTreeVisitor) VisitChildren(_ RuleNode) interface{}     { return nil }\nfunc (v *BaseParseTreeVisitor) VisitTerminal(_ TerminalNode) interface{} { return nil }\nfunc (v *BaseParseTreeVisitor) VisitErrorNode(_ ErrorNode) interface{}   { return nil }\n\n// TODO: Implement this?\n//func (this ParseTreeVisitor) Visit(ctx) {\n//\tif (Utils.isArray(ctx)) {\n//\t\tself := this\n//\t\treturn ctx.map(function(child) { return VisitAtom(self, child)})\n//\t} else {\n//\t\treturn VisitAtom(this, ctx)\n//\t}\n//}\n//\n//func VisitAtom(Visitor, ctx) {\n//\tif (ctx.parser == nil) { //is terminal\n//\t\treturn\n//\t}\n//\n//\tname := ctx.parser.ruleNames[ctx.ruleIndex]\n//\tfuncName := \"Visit\" + Utils.titleCase(name)\n//\n//\treturn Visitor[funcName](ctx)\n//}\n\ntype ParseTreeListener interface {\n\tVisitTerminal(node TerminalNode)\n\tVisitErrorNode(node ErrorNode)\n\tEnterEveryRule(ctx ParserRuleContext)\n\tExitEveryRule(ctx ParserRuleContext)\n}\n\ntype BaseParseTreeListener struct{}\n\nvar _ ParseTreeListener = &BaseParseTreeListener{}\n\nfunc (l *BaseParseTreeListener) VisitTerminal(_ TerminalNode)       {}\nfunc (l *BaseParseTreeListener) VisitErrorNode(_ ErrorNode)         {}\nfunc (l *BaseParseTreeListener) EnterEveryRule(_ ParserRuleContext) {}\nfunc (l *BaseParseTreeListener) ExitEveryRule(_ ParserRuleContext)  {}\n\ntype TerminalNodeImpl struct {\n\tparentCtx RuleContext\n\tsymbol    Token\n}\n\nvar _ TerminalNode = &TerminalNodeImpl{}\n\nfunc NewTerminalNodeImpl(symbol Token) *TerminalNodeImpl {\n\ttn := new(TerminalNodeImpl)\n\n\ttn.parentCtx = nil\n\ttn.symbol = symbol\n\n\treturn tn\n}\n\nfunc (t *TerminalNodeImpl) GetChild(_ int) Tree {\n\treturn nil\n}\n\nfunc (t *TerminalNodeImpl) GetChildren() []Tree {\n\treturn nil\n}\n\nfunc (t *TerminalNodeImpl) SetChildren(_ []Tree) {\n\tpanic(\"Cannot set children on terminal node\")\n}\n\nfunc (t *TerminalNodeImpl) GetSymbol() Token {\n\treturn t.symbol\n}\n\nfunc (t *TerminalNodeImpl) GetParent() Tree {\n\treturn t.parentCtx\n}\n\nfunc (t *TerminalNodeImpl) SetParent(tree Tree) {\n\tt.parentCtx = tree.(RuleContext)\n}\n\nfunc (t *TerminalNodeImpl) GetPayload() interface{} {\n\treturn t.symbol\n}\n\nfunc (t *TerminalNodeImpl) GetSourceInterval() Interval {\n\tif t.symbol == nil {\n\t\treturn TreeInvalidInterval\n\t}\n\ttokenIndex := t.symbol.GetTokenIndex()\n\treturn NewInterval(tokenIndex, tokenIndex)\n}\n\nfunc (t *TerminalNodeImpl) GetChildCount() int {\n\treturn 0\n}\n\nfunc (t *TerminalNodeImpl) Accept(v ParseTreeVisitor) interface{} {\n\treturn v.VisitTerminal(t)\n}\n\nfunc (t *TerminalNodeImpl) GetText() string {\n\treturn t.symbol.GetText()\n}\n\nfunc (t *TerminalNodeImpl) String() string {\n\tif t.symbol.GetTokenType() == TokenEOF {\n\t\treturn \"<EOF>\"\n\t}\n\n\treturn t.symbol.GetText()\n}\n\nfunc (t *TerminalNodeImpl) ToStringTree(_ []string, _ Recognizer) string {\n\treturn t.String()\n}\n\n// Represents a token that was consumed during reSynchronization\n// rather than during a valid Match operation. For example,\n// we will create this kind of a node during single token insertion\n// and deletion as well as during \"consume until error recovery set\"\n// upon no viable alternative exceptions.\n\ntype ErrorNodeImpl struct {\n\t*TerminalNodeImpl\n}\n\nvar _ ErrorNode = &ErrorNodeImpl{}\n\nfunc NewErrorNodeImpl(token Token) *ErrorNodeImpl {\n\ten := new(ErrorNodeImpl)\n\ten.TerminalNodeImpl = NewTerminalNodeImpl(token)\n\treturn en\n}\n\nfunc (e *ErrorNodeImpl) errorNode() {}\n\nfunc (e *ErrorNodeImpl) Accept(v ParseTreeVisitor) interface{} {\n\treturn v.VisitErrorNode(e)\n}\n\ntype ParseTreeWalker struct {\n}\n\nfunc NewParseTreeWalker() *ParseTreeWalker {\n\treturn new(ParseTreeWalker)\n}\n\n// Walk performs a walk on the given parse tree starting at the root and going down recursively\n// with depth-first search. On each node, [EnterRule] is called before\n// recursively walking down into child nodes, then [ExitRule] is called after the recursive call to wind up.\nfunc (p *ParseTreeWalker) Walk(listener ParseTreeListener, t Tree) {\n\tswitch tt := t.(type) {\n\tcase ErrorNode:\n\t\tlistener.VisitErrorNode(tt)\n\tcase TerminalNode:\n\t\tlistener.VisitTerminal(tt)\n\tdefault:\n\t\tp.EnterRule(listener, t.(RuleNode))\n\t\tfor i := 0; i < t.GetChildCount(); i++ {\n\t\t\tchild := t.GetChild(i)\n\t\t\tp.Walk(listener, child)\n\t\t}\n\t\tp.ExitRule(listener, t.(RuleNode))\n\t}\n}\n\n// EnterRule enters a grammar rule by first triggering the generic event [ParseTreeListener].[EnterEveryRule]\n// then by triggering the event specific to the given parse tree node\nfunc (p *ParseTreeWalker) EnterRule(listener ParseTreeListener, r RuleNode) {\n\tctx := r.GetRuleContext().(ParserRuleContext)\n\tlistener.EnterEveryRule(ctx)\n\tctx.EnterRule(listener)\n}\n\n// ExitRule exits a grammar rule by first triggering the event specific to the given parse tree node\n// then by triggering the generic event [ParseTreeListener].ExitEveryRule\nfunc (p *ParseTreeWalker) ExitRule(listener ParseTreeListener, r RuleNode) {\n\tctx := r.GetRuleContext().(ParserRuleContext)\n\tctx.ExitRule(listener)\n\tlistener.ExitEveryRule(ctx)\n}\n\n//goland:noinspection GoUnusedGlobalVariable\nvar ParseTreeWalkerDefault = NewParseTreeWalker()\n\ntype IterativeParseTreeWalker struct {\n\t*ParseTreeWalker\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc NewIterativeParseTreeWalker() *IterativeParseTreeWalker {\n\treturn new(IterativeParseTreeWalker)\n}\n\nfunc (i *IterativeParseTreeWalker) Walk(listener ParseTreeListener, t Tree) {\n\tvar stack []Tree\n\tvar indexStack []int\n\tcurrentNode := t\n\tcurrentIndex := 0\n\n\tfor currentNode != nil {\n\t\t// pre-order visit\n\t\tswitch tt := currentNode.(type) {\n\t\tcase ErrorNode:\n\t\t\tlistener.VisitErrorNode(tt)\n\t\tcase TerminalNode:\n\t\t\tlistener.VisitTerminal(tt)\n\t\tdefault:\n\t\t\ti.EnterRule(listener, currentNode.(RuleNode))\n\t\t}\n\t\t// Move down to first child, if exists\n\t\tif currentNode.GetChildCount() > 0 {\n\t\t\tstack = append(stack, currentNode)\n\t\t\tindexStack = append(indexStack, currentIndex)\n\t\t\tcurrentIndex = 0\n\t\t\tcurrentNode = currentNode.GetChild(0)\n\t\t\tcontinue\n\t\t}\n\n\t\tfor {\n\t\t\t// post-order visit\n\t\t\tif ruleNode, ok := currentNode.(RuleNode); ok {\n\t\t\t\ti.ExitRule(listener, ruleNode)\n\t\t\t}\n\t\t\t// No parent, so no siblings\n\t\t\tif len(stack) == 0 {\n\t\t\t\tcurrentNode = nil\n\t\t\t\tcurrentIndex = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Move to next sibling if possible\n\t\t\tcurrentIndex++\n\t\t\tif stack[len(stack)-1].GetChildCount() > currentIndex {\n\t\t\t\tcurrentNode = stack[len(stack)-1].GetChild(currentIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// No next, sibling, so move up\n\t\t\tcurrentNode, stack = stack[len(stack)-1], stack[:len(stack)-1]\n\t\t\tcurrentIndex, indexStack = indexStack[len(indexStack)-1], indexStack[:len(indexStack)-1]\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/trees.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport \"fmt\"\n\n/** A set of utility routines useful for all kinds of ANTLR trees. */\n\n// TreesStringTree prints out a whole tree in LISP form. [getNodeText] is used on the\n// node payloads to get the text for the nodes. Detects parse trees and extracts data appropriately.\nfunc TreesStringTree(tree Tree, ruleNames []string, recog Recognizer) string {\n\n\tif recog != nil {\n\t\truleNames = recog.GetRuleNames()\n\t}\n\n\ts := TreesGetNodeText(tree, ruleNames, nil)\n\n\ts = EscapeWhitespace(s, false)\n\tc := tree.GetChildCount()\n\tif c == 0 {\n\t\treturn s\n\t}\n\tres := \"(\" + s + \" \"\n\tif c > 0 {\n\t\ts = TreesStringTree(tree.GetChild(0), ruleNames, nil)\n\t\tres += s\n\t}\n\tfor i := 1; i < c; i++ {\n\t\ts = TreesStringTree(tree.GetChild(i), ruleNames, nil)\n\t\tres += \" \" + s\n\t}\n\tres += \")\"\n\treturn res\n}\n\nfunc TreesGetNodeText(t Tree, ruleNames []string, recog Parser) string {\n\tif recog != nil {\n\t\truleNames = recog.GetRuleNames()\n\t}\n\n\tif ruleNames != nil {\n\t\tswitch t2 := t.(type) {\n\t\tcase RuleNode:\n\t\t\tt3 := t2.GetRuleContext()\n\t\t\taltNumber := t3.GetAltNumber()\n\n\t\t\tif altNumber != ATNInvalidAltNumber {\n\t\t\t\treturn fmt.Sprintf(\"%s:%d\", ruleNames[t3.GetRuleIndex()], altNumber)\n\t\t\t}\n\t\t\treturn ruleNames[t3.GetRuleIndex()]\n\t\tcase ErrorNode:\n\t\t\treturn fmt.Sprint(t2)\n\t\tcase TerminalNode:\n\t\t\tif t2.GetSymbol() != nil {\n\t\t\t\treturn t2.GetSymbol().GetText()\n\t\t\t}\n\t\t}\n\t}\n\n\t// no recognition for rule names\n\tpayload := t.GetPayload()\n\tif p2, ok := payload.(Token); ok {\n\t\treturn p2.GetText()\n\t}\n\n\treturn fmt.Sprint(t.GetPayload())\n}\n\n// TreesGetChildren returns am ordered list of all children of this node\n//\n//goland:noinspection GoUnusedExportedFunction\nfunc TreesGetChildren(t Tree) []Tree {\n\tlist := make([]Tree, 0)\n\tfor i := 0; i < t.GetChildCount(); i++ {\n\t\tlist = append(list, t.GetChild(i))\n\t}\n\treturn list\n}\n\n// TreesgetAncestors returns a list of all ancestors of this node.  The first node of list is the root\n// and the last node is the parent of this node.\n//\n//goland:noinspection GoUnusedExportedFunction\nfunc TreesgetAncestors(t Tree) []Tree {\n\tancestors := make([]Tree, 0)\n\tt = t.GetParent()\n\tfor t != nil {\n\t\tf := []Tree{t}\n\t\tancestors = append(f, ancestors...)\n\t\tt = t.GetParent()\n\t}\n\treturn ancestors\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc TreesFindAllTokenNodes(t ParseTree, ttype int) []ParseTree {\n\treturn TreesfindAllNodes(t, ttype, true)\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc TreesfindAllRuleNodes(t ParseTree, ruleIndex int) []ParseTree {\n\treturn TreesfindAllNodes(t, ruleIndex, false)\n}\n\nfunc TreesfindAllNodes(t ParseTree, index int, findTokens bool) []ParseTree {\n\tnodes := make([]ParseTree, 0)\n\ttreesFindAllNodes(t, index, findTokens, &nodes)\n\treturn nodes\n}\n\nfunc treesFindAllNodes(t ParseTree, index int, findTokens bool, nodes *[]ParseTree) {\n\t// check this node (the root) first\n\n\tt2, ok := t.(TerminalNode)\n\tt3, ok2 := t.(ParserRuleContext)\n\n\tif findTokens && ok {\n\t\tif t2.GetSymbol().GetTokenType() == index {\n\t\t\t*nodes = append(*nodes, t2)\n\t\t}\n\t} else if !findTokens && ok2 {\n\t\tif t3.GetRuleIndex() == index {\n\t\t\t*nodes = append(*nodes, t3)\n\t\t}\n\t}\n\t// check children\n\tfor i := 0; i < t.GetChildCount(); i++ {\n\t\ttreesFindAllNodes(t.GetChild(i).(ParseTree), index, findTokens, nodes)\n\t}\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc TreesDescendants(t ParseTree) []ParseTree {\n\tnodes := []ParseTree{t}\n\tfor i := 0; i < t.GetChildCount(); i++ {\n\t\tnodes = append(nodes, TreesDescendants(t.GetChild(i).(ParseTree))...)\n\t}\n\treturn nodes\n}\n"
  },
  {
    "path": "vendor/github.com/antlr4-go/antlr/v4/utils.go",
    "content": "// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n// Use of this file is governed by the BSD 3-clause license that\n// can be found in the LICENSE.txt file in the project root.\n\npackage antlr\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math/bits\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// A simple integer stack\n\ntype IntStack []int\n\nvar ErrEmptyStack = errors.New(\"stack is empty\")\n\nfunc (s *IntStack) Pop() (int, error) {\n\tl := len(*s) - 1\n\tif l < 0 {\n\t\treturn 0, ErrEmptyStack\n\t}\n\tv := (*s)[l]\n\t*s = (*s)[0:l]\n\treturn v, nil\n}\n\nfunc (s *IntStack) Push(e int) {\n\t*s = append(*s, e)\n}\n\nconst bitsPerWord = 64\n\nfunc indexForBit(bit int) int {\n\treturn bit / bitsPerWord\n}\n\n//goland:noinspection GoUnusedExportedFunction,GoUnusedFunction\nfunc wordForBit(data []uint64, bit int) uint64 {\n\tidx := indexForBit(bit)\n\tif idx >= len(data) {\n\t\treturn 0\n\t}\n\treturn data[idx]\n}\n\nfunc maskForBit(bit int) uint64 {\n\treturn uint64(1) << (bit % bitsPerWord)\n}\n\nfunc wordsNeeded(bit int) int {\n\treturn indexForBit(bit) + 1\n}\n\ntype BitSet struct {\n\tdata []uint64\n}\n\n// NewBitSet creates a new bitwise set\n// TODO: See if we can replace with the standard library's BitSet\nfunc NewBitSet() *BitSet {\n\treturn &BitSet{}\n}\n\nfunc (b *BitSet) add(value int) {\n\tidx := indexForBit(value)\n\tif idx >= len(b.data) {\n\t\tsize := wordsNeeded(value)\n\t\tdata := make([]uint64, size)\n\t\tcopy(data, b.data)\n\t\tb.data = data\n\t}\n\tb.data[idx] |= maskForBit(value)\n}\n\nfunc (b *BitSet) clear(index int) {\n\tidx := indexForBit(index)\n\tif idx >= len(b.data) {\n\t\treturn\n\t}\n\tb.data[idx] &= ^maskForBit(index)\n}\n\nfunc (b *BitSet) or(set *BitSet) {\n\t// Get min size necessary to represent the bits in both sets.\n\tbLen := b.minLen()\n\tsetLen := set.minLen()\n\tmaxLen := intMax(bLen, setLen)\n\tif maxLen > len(b.data) {\n\t\t// Increase the size of len(b.data) to represent the bits in both sets.\n\t\tdata := make([]uint64, maxLen)\n\t\tcopy(data, b.data)\n\t\tb.data = data\n\t}\n\t// len(b.data) is at least setLen.\n\tfor i := 0; i < setLen; i++ {\n\t\tb.data[i] |= set.data[i]\n\t}\n}\n\nfunc (b *BitSet) remove(value int) {\n\tb.clear(value)\n}\n\nfunc (b *BitSet) contains(value int) bool {\n\tidx := indexForBit(value)\n\tif idx >= len(b.data) {\n\t\treturn false\n\t}\n\treturn (b.data[idx] & maskForBit(value)) != 0\n}\n\nfunc (b *BitSet) minValue() int {\n\tfor i, v := range b.data {\n\t\tif v == 0 {\n\t\t\tcontinue\n\t\t}\n\t\treturn i*bitsPerWord + bits.TrailingZeros64(v)\n\t}\n\treturn 2147483647\n}\n\nfunc (b *BitSet) equals(other interface{}) bool {\n\totherBitSet, ok := other.(*BitSet)\n\tif !ok {\n\t\treturn false\n\t}\n\n\tif b == otherBitSet {\n\t\treturn true\n\t}\n\n\t// We only compare set bits, so we cannot rely on the two slices having the same size. Its\n\t// possible for two BitSets to have different slice lengths but the same set bits. So we only\n\t// compare the relevant words and ignore the trailing zeros.\n\tbLen := b.minLen()\n\totherLen := otherBitSet.minLen()\n\n\tif bLen != otherLen {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < bLen; i++ {\n\t\tif b.data[i] != otherBitSet.data[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (b *BitSet) minLen() int {\n\tfor i := len(b.data); i > 0; i-- {\n\t\tif b.data[i-1] != 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc (b *BitSet) length() int {\n\tcnt := 0\n\tfor _, val := range b.data {\n\t\tcnt += bits.OnesCount64(val)\n\t}\n\treturn cnt\n}\n\nfunc (b *BitSet) String() string {\n\tvals := make([]string, 0, b.length())\n\n\tfor i, v := range b.data {\n\t\tfor v != 0 {\n\t\t\tn := bits.TrailingZeros64(v)\n\t\t\tvals = append(vals, strconv.Itoa(i*bitsPerWord+n))\n\t\t\tv &= ^(uint64(1) << n)\n\t\t}\n\t}\n\n\treturn \"{\" + strings.Join(vals, \", \") + \"}\"\n}\n\ntype AltDict struct {\n\tdata map[string]interface{}\n}\n\nfunc NewAltDict() *AltDict {\n\td := new(AltDict)\n\td.data = make(map[string]interface{})\n\treturn d\n}\n\nfunc (a *AltDict) Get(key string) interface{} {\n\tkey = \"k-\" + key\n\treturn a.data[key]\n}\n\nfunc (a *AltDict) put(key string, value interface{}) {\n\tkey = \"k-\" + key\n\ta.data[key] = value\n}\n\nfunc (a *AltDict) values() []interface{} {\n\tvs := make([]interface{}, len(a.data))\n\ti := 0\n\tfor _, v := range a.data {\n\t\tvs[i] = v\n\t\ti++\n\t}\n\treturn vs\n}\n\nfunc EscapeWhitespace(s string, escapeSpaces bool) string {\n\n\ts = strings.Replace(s, \"\\t\", \"\\\\t\", -1)\n\ts = strings.Replace(s, \"\\n\", \"\\\\n\", -1)\n\ts = strings.Replace(s, \"\\r\", \"\\\\r\", -1)\n\tif escapeSpaces {\n\t\ts = strings.Replace(s, \" \", \"\\u00B7\", -1)\n\t}\n\treturn s\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc TerminalNodeToStringArray(sa []TerminalNode) []string {\n\tst := make([]string, len(sa))\n\n\tfor i, s := range sa {\n\t\tst[i] = fmt.Sprintf(\"%v\", s)\n\t}\n\n\treturn st\n}\n\n//goland:noinspection GoUnusedExportedFunction\nfunc PrintArrayJavaStyle(sa []string) string {\n\tvar buffer bytes.Buffer\n\n\tbuffer.WriteString(\"[\")\n\n\tfor i, s := range sa {\n\t\tbuffer.WriteString(s)\n\t\tif i != len(sa)-1 {\n\t\t\tbuffer.WriteString(\", \")\n\t\t}\n\t}\n\n\tbuffer.WriteString(\"]\")\n\n\treturn buffer.String()\n}\n\n// murmur hash\nfunc murmurInit(seed int) int {\n\treturn seed\n}\n\nfunc murmurUpdate(h int, value int) int {\n\tconst c1 uint32 = 0xCC9E2D51\n\tconst c2 uint32 = 0x1B873593\n\tconst r1 uint32 = 15\n\tconst r2 uint32 = 13\n\tconst m uint32 = 5\n\tconst n uint32 = 0xE6546B64\n\n\tk := uint32(value)\n\tk *= c1\n\tk = (k << r1) | (k >> (32 - r1))\n\tk *= c2\n\n\thash := uint32(h) ^ k\n\thash = (hash << r2) | (hash >> (32 - r2))\n\thash = hash*m + n\n\treturn int(hash)\n}\n\nfunc murmurFinish(h int, numberOfWords int) int {\n\tvar hash = uint32(h)\n\thash ^= uint32(numberOfWords) << 2\n\thash ^= hash >> 16\n\thash *= 0x85ebca6b\n\thash ^= hash >> 13\n\thash *= 0xc2b2ae35\n\thash ^= hash >> 16\n\n\treturn int(hash)\n}\n\nfunc isDirectory(dir string) (bool, error) {\n\tfileInfo, err := os.Stat(dir)\n\tif err != nil {\n\t\tswitch {\n\t\tcase errors.Is(err, syscall.ENOENT):\n\t\t\t// The given directory does not exist, so we will try to create it\n\t\t\t//\n\t\t\terr = os.MkdirAll(dir, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\n\t\t\treturn true, nil\n\t\tcase err != nil:\n\t\t\treturn false, err\n\t\tdefault:\n\t\t}\n\t}\n\treturn fileInfo.IsDir(), err\n}\n\n// intSlicesEqual returns true if the two slices of ints are equal, and is a little\n// faster than slices.Equal.\nfunc intSlicesEqual(s1, s2 []int) bool {\n\tif s1 == nil && s2 == nil {\n\t\treturn true\n\t}\n\tif s1 == nil || s2 == nil {\n\t\treturn false\n\t}\n\tif len(s1) == 0 && len(s2) == 0 {\n\t\treturn true\n\t}\n\n\tif len(s1) == 0 || len(s2) == 0 || len(s1) != len(s2) {\n\t\treturn false\n\t}\n\t// If the slices are using the same memory, then they are the same slice\n\tif &s1[0] == &s2[0] {\n\t\treturn true\n\t}\n\tfor i, v := range s1 {\n\t\tif v != s2[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc pcSliceEqual(s1, s2 []*PredictionContext) bool {\n\tif s1 == nil && s2 == nil {\n\t\treturn true\n\t}\n\tif s1 == nil || s2 == nil {\n\t\treturn false\n\t}\n\tif len(s1) == 0 && len(s2) == 0 {\n\t\treturn true\n\t}\n\tif len(s1) == 0 || len(s2) == 0 || len(s1) != len(s2) {\n\t\treturn false\n\t}\n\t// If the slices are using the same memory, then they are the same slice\n\tif &s1[0] == &s2[0] {\n\t\treturn true\n\t}\n\tfor i, v := range s1 {\n\t\tif !v.Equals(s2[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/.gitignore",
    "content": "bin/\n.idea/\n# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, built with `go test -c`\n*.test\n\n# Output of the go coverage tool, specifically when used with LiteIDE\n*.out\n\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/.travis.yml",
    "content": "language: go\ndist: xenial\ngo:\n  - '1.10'\n  - '1.11'\n  - '1.12'\n  - '1.13'\n  - 'tip'\n\nscript:\n     - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s\n     - bash <(curl -s https://codecov.io/bash)\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md",
    "content": "# Contributor Code of Conduct\n\nThis project adheres to [The Code Manifesto](http://codemanifesto.com)\nas its guidelines for contributor interactions.\n\n## The Code Manifesto\n\nWe want to work in an ecosystem that empowers developers to reach their\npotential — one that encourages growth and effective collaboration. A space\nthat is safe for all.\n\nA space such as this benefits everyone that participates in it. It encourages\nnew developers to enter our field. It is through discussion and collaboration\nthat we grow, and through growth that we improve.\n\nIn the effort to create such a place, we hold to these values:\n\n1. **Discrimination limits us.** This includes discrimination on the basis of\n   race, gender, sexual orientation, gender identity, age, nationality,\n   technology and any other arbitrary exclusion of a group of people.\n2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort\n   levels. Remember that, and if brought to your attention, heed it.\n3. **We are our biggest assets.** None of us were born masters of our trade.\n   Each of us has been helped along the way. Return that favor, when and where\n   you can.\n4. **We are resources for the future.** As an extension of #3, share what you\n   know. Make yourself a resource to help those that come after you.\n5. **Respect defines us.** Treat others as you wish to be treated. Make your\n   discussions, criticisms and debates from a position of respectfulness. Ask\n   yourself, is it true? Is it necessary? Is it constructive? Anything less is\n   unacceptable.\n6. **Reactions require grace.** Angry responses are valid, but abusive language\n   and vindictive actions are toxic. When something happens that offends you,\n   handle it assertively, but be respectful. Escalate reasonably, and try to\n   allow the offender an opportunity to explain themselves, and possibly\n   correct the issue.\n7. **Opinions are just that: opinions.** Each and every one of us, due to our\n   background and upbringing, have varying opinions. That is perfectly\n   acceptable. Remember this: if you respect your own opinions, you should\n   respect the opinions of others.\n8. **To err is human.** You might not intend it, but mistakes do happen and\n   contribute to build experience. Tolerate honest mistakes, and don't\n   hesitate to apologize if you make one yourself.\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md",
    "content": "#### Support\nIf you do have a contribution to the package, feel free to create a Pull Request or an Issue.\n\n#### What to contribute\nIf you don't know what to do, there are some features and functions that need to be done\n\n- [ ] Refactor code\n- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check\n- [ ] Create actual list of contributors and projects that currently using this package\n- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)\n- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)\n- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new\n- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc\n- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)\n- [ ] Implement fuzzing testing\n- [ ] Implement some struct/map/array utilities\n- [ ] Implement map/array validation\n- [ ] Implement benchmarking\n- [ ] Implement batch of examples\n- [ ] Look at forks for new features and fixes\n\n#### Advice\nFeel free to create what you want, but keep in mind when you implement new features:\n- Code must be clear and readable, names of variables/constants clearly describes what they are doing\n- Public functions must be documented and described in source file and added to README.md to the list of available functions\n- There are must be unit-tests for any new functions and improvements\n\n## Financial contributions\n\nWe also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator).\nAnyone can file an expense. If the expense makes sense for the development of the community, it will be \"merged\" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.\n\n\n## Credits\n\n\n### Contributors\n\nThank you to all the people who have already contributed to govalidator!\n<a href=\"https://github.com/asaskevich/govalidator/graphs/contributors\"><img src=\"https://opencollective.com/govalidator/contributors.svg?width=890\" /></a>\n\n\n### Backers\n\nThank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)]\n\n<a href=\"https://opencollective.com/govalidator#backers\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/backers.svg?width=890\"></a>\n\n\n### Sponsors\n\nThank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor))\n\n<a href=\"https://opencollective.com/govalidator/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/9/avatar.svg\"></a>"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014-2020 Alex Saskevich\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/README.md",
    "content": "govalidator\n===========\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator)\n[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator)\n[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield)\n\nA package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js).\n\n#### Installation\nMake sure that Go is installed on your computer.\nType the following command in your terminal:\n\n\tgo get github.com/asaskevich/govalidator\n\nor you can get specified release of the package with `gopkg.in`:\n\n\tgo get gopkg.in/asaskevich/govalidator.v10\n\nAfter it the package is ready to use.\n\n\n#### Import package in your project\nAdd following line in your `*.go` file:\n```go\nimport \"github.com/asaskevich/govalidator\"\n```\nIf you are unhappy to use long `govalidator`, you can do something like this:\n```go\nimport (\n  valid \"github.com/asaskevich/govalidator\"\n)\n```\n\n#### Activate behavior to require all fields have a validation tag by default\n`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:\"-\"` or `valid:\"email,optional\"`). A good place to activate this is a package init function or the main() function.\n\n`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors.\n\n```go\nimport \"github.com/asaskevich/govalidator\"\n\nfunc init() {\n  govalidator.SetFieldsRequiredByDefault(true)\n}\n```\n\nHere's some code to explain it:\n```go\n// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):\ntype exampleStruct struct {\n  Name  string ``\n  Email string `valid:\"email\"`\n}\n\n// this, however, will only fail when Email is empty or an invalid email address:\ntype exampleStruct2 struct {\n  Name  string `valid:\"-\"`\n  Email string `valid:\"email\"`\n}\n\n// lastly, this will only fail when Email is an invalid email address but not when it's empty:\ntype exampleStruct2 struct {\n  Name  string `valid:\"-\"`\n  Email string `valid:\"email,optional\"`\n}\n```\n\n#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123))\n##### Custom validator function signature\nA context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible.\n```go\nimport \"github.com/asaskevich/govalidator\"\n\n// old signature\nfunc(i interface{}) bool\n\n// new signature\nfunc(i interface{}, o interface{}) bool\n```\n\n##### Adding a custom validator\nThis was changed to prevent data races when accessing custom validators.\n```go\nimport \"github.com/asaskevich/govalidator\"\n\n// before\ngovalidator.CustomTypeTagMap[\"customByteArrayValidator\"] = func(i interface{}, o interface{}) bool {\n  // ...\n}\n\n// after\ngovalidator.CustomTypeTagMap.Set(\"customByteArrayValidator\", func(i interface{}, o interface{}) bool {\n  // ...\n})\n```\n\n#### List of functions:\n```go\nfunc Abs(value float64) float64\nfunc BlackList(str, chars string) string\nfunc ByteLength(str string, params ...string) bool\nfunc CamelCaseToUnderscore(str string) string\nfunc Contains(str, substring string) bool\nfunc Count(array []interface{}, iterator ConditionIterator) int\nfunc Each(array []interface{}, iterator Iterator)\nfunc ErrorByField(e error, field string) string\nfunc ErrorsByField(e error) map[string]string\nfunc Filter(array []interface{}, iterator ConditionIterator) []interface{}\nfunc Find(array []interface{}, iterator ConditionIterator) interface{}\nfunc GetLine(s string, index int) (string, error)\nfunc GetLines(s string) []string\nfunc HasLowerCase(str string) bool\nfunc HasUpperCase(str string) bool\nfunc HasWhitespace(str string) bool\nfunc HasWhitespaceOnly(str string) bool\nfunc InRange(value interface{}, left interface{}, right interface{}) bool\nfunc InRangeFloat32(value, left, right float32) bool\nfunc InRangeFloat64(value, left, right float64) bool\nfunc InRangeInt(value, left, right interface{}) bool\nfunc IsASCII(str string) bool\nfunc IsAlpha(str string) bool\nfunc IsAlphanumeric(str string) bool\nfunc IsBase64(str string) bool\nfunc IsByteLength(str string, min, max int) bool\nfunc IsCIDR(str string) bool\nfunc IsCRC32(str string) bool\nfunc IsCRC32b(str string) bool\nfunc IsCreditCard(str string) bool\nfunc IsDNSName(str string) bool\nfunc IsDataURI(str string) bool\nfunc IsDialString(str string) bool\nfunc IsDivisibleBy(str, num string) bool\nfunc IsEmail(str string) bool\nfunc IsExistingEmail(email string) bool\nfunc IsFilePath(str string) (bool, int)\nfunc IsFloat(str string) bool\nfunc IsFullWidth(str string) bool\nfunc IsHalfWidth(str string) bool\nfunc IsHash(str string, algorithm string) bool\nfunc IsHexadecimal(str string) bool\nfunc IsHexcolor(str string) bool\nfunc IsHost(str string) bool\nfunc IsIP(str string) bool\nfunc IsIPv4(str string) bool\nfunc IsIPv6(str string) bool\nfunc IsISBN(str string, version int) bool\nfunc IsISBN10(str string) bool\nfunc IsISBN13(str string) bool\nfunc IsISO3166Alpha2(str string) bool\nfunc IsISO3166Alpha3(str string) bool\nfunc IsISO4217(str string) bool\nfunc IsISO693Alpha2(str string) bool\nfunc IsISO693Alpha3b(str string) bool\nfunc IsIn(str string, params ...string) bool\nfunc IsInRaw(str string, params ...string) bool\nfunc IsInt(str string) bool\nfunc IsJSON(str string) bool\nfunc IsLatitude(str string) bool\nfunc IsLongitude(str string) bool\nfunc IsLowerCase(str string) bool\nfunc IsMAC(str string) bool\nfunc IsMD4(str string) bool\nfunc IsMD5(str string) bool\nfunc IsMagnetURI(str string) bool\nfunc IsMongoID(str string) bool\nfunc IsMultibyte(str string) bool\nfunc IsNatural(value float64) bool\nfunc IsNegative(value float64) bool\nfunc IsNonNegative(value float64) bool\nfunc IsNonPositive(value float64) bool\nfunc IsNotNull(str string) bool\nfunc IsNull(str string) bool\nfunc IsNumeric(str string) bool\nfunc IsPort(str string) bool\nfunc IsPositive(value float64) bool\nfunc IsPrintableASCII(str string) bool\nfunc IsRFC3339(str string) bool\nfunc IsRFC3339WithoutZone(str string) bool\nfunc IsRGBcolor(str string) bool\nfunc IsRegex(str string) bool\nfunc IsRequestURI(rawurl string) bool\nfunc IsRequestURL(rawurl string) bool\nfunc IsRipeMD128(str string) bool\nfunc IsRipeMD160(str string) bool\nfunc IsRsaPub(str string, params ...string) bool\nfunc IsRsaPublicKey(str string, keylen int) bool\nfunc IsSHA1(str string) bool\nfunc IsSHA256(str string) bool\nfunc IsSHA384(str string) bool\nfunc IsSHA512(str string) bool\nfunc IsSSN(str string) bool\nfunc IsSemver(str string) bool\nfunc IsTiger128(str string) bool\nfunc IsTiger160(str string) bool\nfunc IsTiger192(str string) bool\nfunc IsTime(str string, format string) bool\nfunc IsType(v interface{}, params ...string) bool\nfunc IsURL(str string) bool\nfunc IsUTFDigit(str string) bool\nfunc IsUTFLetter(str string) bool\nfunc IsUTFLetterNumeric(str string) bool\nfunc IsUTFNumeric(str string) bool\nfunc IsUUID(str string) bool\nfunc IsUUIDv3(str string) bool\nfunc IsUUIDv4(str string) bool\nfunc IsUUIDv5(str string) bool\nfunc IsULID(str string) bool\nfunc IsUnixTime(str string) bool\nfunc IsUpperCase(str string) bool\nfunc IsVariableWidth(str string) bool\nfunc IsWhole(value float64) bool\nfunc LeftTrim(str, chars string) string\nfunc Map(array []interface{}, iterator ResultIterator) []interface{}\nfunc Matches(str, pattern string) bool\nfunc MaxStringLength(str string, params ...string) bool\nfunc MinStringLength(str string, params ...string) bool\nfunc NormalizeEmail(str string) (string, error)\nfunc PadBoth(str string, padStr string, padLen int) string\nfunc PadLeft(str string, padStr string, padLen int) string\nfunc PadRight(str string, padStr string, padLen int) string\nfunc PrependPathToErrors(err error, path string) error\nfunc Range(str string, params ...string) bool\nfunc RemoveTags(s string) string\nfunc ReplacePattern(str, pattern, replace string) string\nfunc Reverse(s string) string\nfunc RightTrim(str, chars string) string\nfunc RuneLength(str string, params ...string) bool\nfunc SafeFileName(str string) string\nfunc SetFieldsRequiredByDefault(value bool)\nfunc SetNilPtrAllowedByRequired(value bool)\nfunc Sign(value float64) float64\nfunc StringLength(str string, params ...string) bool\nfunc StringMatches(s string, params ...string) bool\nfunc StripLow(str string, keepNewLines bool) string\nfunc ToBoolean(str string) (bool, error)\nfunc ToFloat(str string) (float64, error)\nfunc ToInt(value interface{}) (res int64, err error)\nfunc ToJSON(obj interface{}) (string, error)\nfunc ToString(obj interface{}) string\nfunc Trim(str, chars string) string\nfunc Truncate(str string, length int, ending string) string\nfunc TruncatingErrorf(str string, args ...interface{}) error\nfunc UnderscoreToCamelCase(s string) string\nfunc ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error)\nfunc ValidateStruct(s interface{}) (bool, error)\nfunc WhiteList(str, chars string) string\ntype ConditionIterator\ntype CustomTypeValidator\ntype Error\nfunc (e Error) Error() string\ntype Errors\nfunc (es Errors) Error() string\nfunc (es Errors) Errors() []error\ntype ISO3166Entry\ntype ISO693Entry\ntype InterfaceParamValidator\ntype Iterator\ntype ParamValidator\ntype ResultIterator\ntype UnsupportedTypeError\nfunc (e *UnsupportedTypeError) Error() string\ntype Validator\n```\n\n#### Examples\n###### IsURL\n```go\nprintln(govalidator.IsURL(`http://user@pass:domain.com/path/page`))\n```\n###### IsType\n```go\nprintln(govalidator.IsType(\"Bob\", \"string\"))\nprintln(govalidator.IsType(1, \"int\"))\ni := 1\nprintln(govalidator.IsType(&i, \"*int\"))\n```\n\nIsType can be used through the tag `type` which is essential for map validation:\n```go\ntype User\tstruct {\n  Name string      `valid:\"type(string)\"`\n  Age  int         `valid:\"type(int)\"`\n  Meta interface{} `valid:\"type(string)\"`\n}\nresult, err := govalidator.ValidateStruct(User{\"Bob\", 20, \"meta\"})\nif err != nil {\n\tprintln(\"error: \" + err.Error())\n}\nprintln(result)\n```\n###### ToString\n```go\ntype User struct {\n\tFirstName string\n\tLastName string\n}\n\nstr := govalidator.ToString(&User{\"John\", \"Juan\"})\nprintln(str)\n```\n###### Each, Map, Filter, Count for slices\nEach iterates over the slice/array and calls Iterator for every item\n```go\ndata := []interface{}{1, 2, 3, 4, 5}\nvar fn govalidator.Iterator = func(value interface{}, index int) {\n\tprintln(value.(int))\n}\ngovalidator.Each(data, fn)\n```\n```go\ndata := []interface{}{1, 2, 3, 4, 5}\nvar fn govalidator.ResultIterator = func(value interface{}, index int) interface{} {\n\treturn value.(int) * 3\n}\n_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15}\n```\n```go\ndata := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\nvar fn govalidator.ConditionIterator = func(value interface{}, index int) bool {\n\treturn value.(int)%2 == 0\n}\n_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10}\n_ = govalidator.Count(data, fn) // result = 5\n```\n###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2)\nIf you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this:\n```go\ngovalidator.TagMap[\"duck\"] = govalidator.Validator(func(str string) bool {\n\treturn str == \"duck\"\n})\n```\nFor completely custom validators (interface-based), see below.\n\nHere is a list of available validators for struct fields (validator - used function):\n```go\n\"email\":              IsEmail,\n\"url\":                IsURL,\n\"dialstring\":         IsDialString,\n\"requrl\":             IsRequestURL,\n\"requri\":             IsRequestURI,\n\"alpha\":              IsAlpha,\n\"utfletter\":          IsUTFLetter,\n\"alphanum\":           IsAlphanumeric,\n\"utfletternum\":       IsUTFLetterNumeric,\n\"numeric\":            IsNumeric,\n\"utfnumeric\":         IsUTFNumeric,\n\"utfdigit\":           IsUTFDigit,\n\"hexadecimal\":        IsHexadecimal,\n\"hexcolor\":           IsHexcolor,\n\"rgbcolor\":           IsRGBcolor,\n\"lowercase\":          IsLowerCase,\n\"uppercase\":          IsUpperCase,\n\"int\":                IsInt,\n\"float\":              IsFloat,\n\"null\":               IsNull,\n\"uuid\":               IsUUID,\n\"uuidv3\":             IsUUIDv3,\n\"uuidv4\":             IsUUIDv4,\n\"uuidv5\":             IsUUIDv5,\n\"creditcard\":         IsCreditCard,\n\"isbn10\":             IsISBN10,\n\"isbn13\":             IsISBN13,\n\"json\":               IsJSON,\n\"multibyte\":          IsMultibyte,\n\"ascii\":              IsASCII,\n\"printableascii\":     IsPrintableASCII,\n\"fullwidth\":          IsFullWidth,\n\"halfwidth\":          IsHalfWidth,\n\"variablewidth\":      IsVariableWidth,\n\"base64\":             IsBase64,\n\"datauri\":            IsDataURI,\n\"ip\":                 IsIP,\n\"port\":               IsPort,\n\"ipv4\":               IsIPv4,\n\"ipv6\":               IsIPv6,\n\"dns\":                IsDNSName,\n\"host\":               IsHost,\n\"mac\":                IsMAC,\n\"latitude\":           IsLatitude,\n\"longitude\":          IsLongitude,\n\"ssn\":                IsSSN,\n\"semver\":             IsSemver,\n\"rfc3339\":            IsRFC3339,\n\"rfc3339WithoutZone\": IsRFC3339WithoutZone,\n\"ISO3166Alpha2\":      IsISO3166Alpha2,\n\"ISO3166Alpha3\":      IsISO3166Alpha3,\n\"ulid\":               IsULID,\n```\nValidators with parameters\n\n```go\n\"range(min|max)\": Range,\n\"length(min|max)\": ByteLength,\n\"runelength(min|max)\": RuneLength,\n\"stringlength(min|max)\": StringLength,\n\"matches(pattern)\": StringMatches,\n\"in(string1|string2|...|stringN)\": IsIn,\n\"rsapub(keylength)\" : IsRsaPub,\n\"minstringlength(int): MinStringLength,\n\"maxstringlength(int): MaxStringLength,\n```\nValidators with parameters for any type\n\n```go\n\"type(type)\": IsType,\n```\n\nAnd here is small example of usage:\n```go\ntype Post struct {\n\tTitle    string `valid:\"alphanum,required\"`\n\tMessage  string `valid:\"duck,ascii\"`\n\tMessage2 string `valid:\"animal(dog)\"`\n\tAuthorIP string `valid:\"ipv4\"`\n\tDate     string `valid:\"-\"`\n}\npost := &Post{\n\tTitle:   \"My Example Post\",\n\tMessage: \"duck\",\n\tMessage2: \"dog\",\n\tAuthorIP: \"123.234.54.3\",\n}\n\n// Add your own struct validation tags\ngovalidator.TagMap[\"duck\"] = govalidator.Validator(func(str string) bool {\n\treturn str == \"duck\"\n})\n\n// Add your own struct validation tags with parameter\ngovalidator.ParamTagMap[\"animal\"] = govalidator.ParamValidator(func(str string, params ...string) bool {\n    species := params[0]\n    return str == species\n})\ngovalidator.ParamTagRegexMap[\"animal\"] = regexp.MustCompile(\"^animal\\\\((\\\\w+)\\\\)$\")\n\nresult, err := govalidator.ValidateStruct(post)\nif err != nil {\n\tprintln(\"error: \" + err.Error())\n}\nprintln(result)\n```\n###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338)\nIf you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}`\n\nSo here is small example of usage:\n```go\nvar mapTemplate = map[string]interface{}{\n\t\"name\":\"required,alpha\",\n\t\"family\":\"required,alpha\",\n\t\"email\":\"required,email\",\n\t\"cell-phone\":\"numeric\",\n\t\"address\":map[string]interface{}{\n\t\t\"line1\":\"required,alphanum\",\n\t\t\"line2\":\"alphanum\",\n\t\t\"postal-code\":\"numeric\",\n\t},\n}\n\nvar inputMap = map[string]interface{}{\n\t\"name\":\"Bob\",\n\t\"family\":\"Smith\",\n\t\"email\":\"foo@bar.baz\",\n\t\"address\":map[string]interface{}{\n\t\t\"line1\":\"\",\n\t\t\"line2\":\"\",\n\t\t\"postal-code\":\"\",\n\t},\n}\n\nresult, err := govalidator.ValidateMap(inputMap, mapTemplate)\nif err != nil {\n\tprintln(\"error: \" + err.Error())\n}\nprintln(result)\n```\n\n###### WhiteList\n```go\n// Remove all characters from string ignoring characters between \"a\" and \"z\"\nprintln(govalidator.WhiteList(\"a3a43a5a4a3a2a23a4a5a4a3a4\", \"a-z\") == \"aaaaaaaaaaaa\")\n```\n\n###### Custom validation functions\nCustom validation using your own domain specific validators is also available - here's an example of how to use it:\n```go\nimport \"github.com/asaskevich/govalidator\"\n\ntype CustomByteArray [6]byte // custom types are supported and can be validated\n\ntype StructWithCustomByteArray struct {\n  ID              CustomByteArray `valid:\"customByteArrayValidator,customMinLengthValidator\"` // multiple custom validators are possible as well and will be evaluated in sequence\n  Email           string          `valid:\"email\"`\n  CustomMinLength int             `valid:\"-\"`\n}\n\ngovalidator.CustomTypeTagMap.Set(\"customByteArrayValidator\", func(i interface{}, context interface{}) bool {\n  switch v := context.(type) { // you can type switch on the context interface being validated\n  case StructWithCustomByteArray:\n    // you can check and validate against some other field in the context,\n    // return early or not validate against the context at all – your choice\n  case SomeOtherType:\n    // ...\n  default:\n    // expecting some other type? Throw/panic here or continue\n  }\n\n  switch v := i.(type) { // type switch on the struct field being validated\n  case CustomByteArray:\n    for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes\n      if e != 0 {\n        return true\n      }\n    }\n  }\n  return false\n})\ngovalidator.CustomTypeTagMap.Set(\"customMinLengthValidator\", func(i interface{}, context interface{}) bool {\n  switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation\n  case StructWithCustomByteArray:\n    return len(v.ID) >= v.CustomMinLength\n  }\n  return false\n})\n```\n\n###### Loop over Error()\nBy default .Error() returns all errors in a single String. To access each error you can do this:\n```go\n  if err != nil {\n    errs := err.(govalidator.Errors).Errors()\n    for _, e := range errs {\n      fmt.Println(e.Error())\n    }\n  }\n```\n\n###### Custom error messages\nCustom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it:\n```go\ntype Ticket struct {\n  Id        int64     `json:\"id\"`\n  FirstName string    `json:\"firstname\" valid:\"required~First name is blank\"`\n}\n```\n\n#### Notes\nDocumentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator).\nFull information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator).\n\n#### Support\nIf you do have a contribution to the package, feel free to create a Pull Request or an Issue.\n\n#### What to contribute\nIf you don't know what to do, there are some features and functions that need to be done\n\n- [ ] Refactor code\n- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check\n- [ ] Create actual list of contributors and projects that currently using this package\n- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)\n- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)\n- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new\n- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc\n- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)\n- [ ] Implement fuzzing testing\n- [ ] Implement some struct/map/array utilities\n- [ ] Implement map/array validation\n- [ ] Implement benchmarking\n- [ ] Implement batch of examples\n- [ ] Look at forks for new features and fixes\n\n#### Advice\nFeel free to create what you want, but keep in mind when you implement new features:\n- Code must be clear and readable, names of variables/constants clearly describes what they are doing\n- Public functions must be documented and described in source file and added to README.md to the list of available functions\n- There are must be unit-tests for any new functions and improvements\n\n## Credits\n### Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors)\n* [Daniel Lohse](https://github.com/annismckenzie)\n* [Attila Oláh](https://github.com/attilaolah)\n* [Daniel Korner](https://github.com/Dadie)\n* [Steven Wilkin](https://github.com/stevenwilkin)\n* [Deiwin Sarjas](https://github.com/deiwin)\n* [Noah Shibley](https://github.com/slugmobile)\n* [Nathan Davies](https://github.com/nathj07)\n* [Matt Sanford](https://github.com/mzsanford)\n* [Simon ccl1115](https://github.com/ccl1115)\n\n<a href=\"https://github.com/asaskevich/govalidator/graphs/contributors\"><img src=\"https://opencollective.com/govalidator/contributors.svg?width=890\" /></a>\n\n\n### Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)]\n\n<a href=\"https://opencollective.com/govalidator#backers\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/backers.svg?width=890\"></a>\n\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)]\n\n<a href=\"https://opencollective.com/govalidator/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/govalidator/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/govalidator/sponsor/9/avatar.svg\"></a>\n\n\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large)\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/arrays.go",
    "content": "package govalidator\n\n// Iterator is the function that accepts element of slice/array and its index\ntype Iterator func(interface{}, int)\n\n// ResultIterator is the function that accepts element of slice/array and its index and returns any result\ntype ResultIterator func(interface{}, int) interface{}\n\n// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean\ntype ConditionIterator func(interface{}, int) bool\n\n// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values\ntype ReduceIterator func(interface{}, interface{}) interface{}\n\n// Some validates that any item of array corresponds to ConditionIterator. Returns boolean.\nfunc Some(array []interface{}, iterator ConditionIterator) bool {\n\tres := false\n\tfor index, data := range array {\n\t\tres = res || iterator(data, index)\n\t}\n\treturn res\n}\n\n// Every validates that every item of array corresponds to ConditionIterator. Returns boolean.\nfunc Every(array []interface{}, iterator ConditionIterator) bool {\n\tres := true\n\tfor index, data := range array {\n\t\tres = res && iterator(data, index)\n\t}\n\treturn res\n}\n\n// Reduce boils down a list of values into a single value by ReduceIterator\nfunc Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} {\n\tfor _, data := range array {\n\t\tinitialValue = iterator(initialValue, data)\n\t}\n\treturn initialValue\n}\n\n// Each iterates over the slice and apply Iterator to every item\nfunc Each(array []interface{}, iterator Iterator) {\n\tfor index, data := range array {\n\t\titerator(data, index)\n\t}\n}\n\n// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result.\nfunc Map(array []interface{}, iterator ResultIterator) []interface{} {\n\tvar result = make([]interface{}, len(array))\n\tfor index, data := range array {\n\t\tresult[index] = iterator(data, index)\n\t}\n\treturn result\n}\n\n// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise.\nfunc Find(array []interface{}, iterator ConditionIterator) interface{} {\n\tfor index, data := range array {\n\t\tif iterator(data, index) {\n\t\t\treturn data\n\t\t}\n\t}\n\treturn nil\n}\n\n// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice.\nfunc Filter(array []interface{}, iterator ConditionIterator) []interface{} {\n\tvar result = make([]interface{}, 0)\n\tfor index, data := range array {\n\t\tif iterator(data, index) {\n\t\t\tresult = append(result, data)\n\t\t}\n\t}\n\treturn result\n}\n\n// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator.\nfunc Count(array []interface{}, iterator ConditionIterator) int {\n\tcount := 0\n\tfor index, data := range array {\n\t\tif iterator(data, index) {\n\t\t\tcount = count + 1\n\t\t}\n\t}\n\treturn count\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/converter.go",
    "content": "package govalidator\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\n// ToString convert the input to a string.\nfunc ToString(obj interface{}) string {\n\tres := fmt.Sprintf(\"%v\", obj)\n\treturn res\n}\n\n// ToJSON convert the input to a valid JSON string\nfunc ToJSON(obj interface{}) (string, error) {\n\tres, err := json.Marshal(obj)\n\tif err != nil {\n\t\tres = []byte(\"\")\n\t}\n\treturn string(res), err\n}\n\n// ToFloat convert the input string to a float, or 0.0 if the input is not a float.\nfunc ToFloat(value interface{}) (res float64, err error) {\n\tval := reflect.ValueOf(value)\n\n\tswitch value.(type) {\n\tcase int, int8, int16, int32, int64:\n\t\tres = float64(val.Int())\n\tcase uint, uint8, uint16, uint32, uint64:\n\t\tres = float64(val.Uint())\n\tcase float32, float64:\n\t\tres = val.Float()\n\tcase string:\n\t\tres, err = strconv.ParseFloat(val.String(), 64)\n\t\tif err != nil {\n\t\t\tres = 0\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"ToInt: unknown interface type %T\", value)\n\t\tres = 0\n\t}\n\n\treturn\n}\n\n// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer.\nfunc ToInt(value interface{}) (res int64, err error) {\n\tval := reflect.ValueOf(value)\n\n\tswitch value.(type) {\n\tcase int, int8, int16, int32, int64:\n\t\tres = val.Int()\n\tcase uint, uint8, uint16, uint32, uint64:\n\t\tres = int64(val.Uint())\n\tcase float32, float64:\n\t\tres = int64(val.Float())\n\tcase string:\n\t\tif IsInt(val.String()) {\n\t\t\tres, err = strconv.ParseInt(val.String(), 0, 64)\n\t\t\tif err != nil {\n\t\t\t\tres = 0\n\t\t\t}\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"ToInt: invalid numeric format %g\", value)\n\t\t\tres = 0\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"ToInt: unknown interface type %T\", value)\n\t\tres = 0\n\t}\n\n\treturn\n}\n\n// ToBoolean convert the input string to a boolean.\nfunc ToBoolean(str string) (bool, error) {\n\treturn strconv.ParseBool(str)\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/doc.go",
    "content": "package govalidator\n\n// A package of validators and sanitizers for strings, structures and collections.\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/error.go",
    "content": "package govalidator\n\nimport (\n\t\"sort\"\n\t\"strings\"\n)\n\n// Errors is an array of multiple errors and conforms to the error interface.\ntype Errors []error\n\n// Errors returns itself.\nfunc (es Errors) Errors() []error {\n\treturn es\n}\n\nfunc (es Errors) Error() string {\n\tvar errs []string\n\tfor _, e := range es {\n\t\terrs = append(errs, e.Error())\n\t}\n\tsort.Strings(errs)\n\treturn strings.Join(errs, \";\")\n}\n\n// Error encapsulates a name, an error and whether there's a custom error message or not.\ntype Error struct {\n\tName                     string\n\tErr                      error\n\tCustomErrorMessageExists bool\n\n\t// Validator indicates the name of the validator that failed\n\tValidator string\n\tPath      []string\n}\n\nfunc (e Error) Error() string {\n\tif e.CustomErrorMessageExists {\n\t\treturn e.Err.Error()\n\t}\n\n\terrName := e.Name\n\tif len(e.Path) > 0 {\n\t\terrName = strings.Join(append(e.Path, e.Name), \".\")\n\t}\n\n\treturn errName + \": \" + e.Err.Error()\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/numerics.go",
    "content": "package govalidator\n\nimport (\n\t\"math\"\n)\n\n// Abs returns absolute value of number\nfunc Abs(value float64) float64 {\n\treturn math.Abs(value)\n}\n\n// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise\nfunc Sign(value float64) float64 {\n\tif value > 0 {\n\t\treturn 1\n\t} else if value < 0 {\n\t\treturn -1\n\t} else {\n\t\treturn 0\n\t}\n}\n\n// IsNegative returns true if value < 0\nfunc IsNegative(value float64) bool {\n\treturn value < 0\n}\n\n// IsPositive returns true if value > 0\nfunc IsPositive(value float64) bool {\n\treturn value > 0\n}\n\n// IsNonNegative returns true if value >= 0\nfunc IsNonNegative(value float64) bool {\n\treturn value >= 0\n}\n\n// IsNonPositive returns true if value <= 0\nfunc IsNonPositive(value float64) bool {\n\treturn value <= 0\n}\n\n// InRangeInt returns true if value lies between left and right border\nfunc InRangeInt(value, left, right interface{}) bool {\n\tvalue64, _ := ToInt(value)\n\tleft64, _ := ToInt(left)\n\tright64, _ := ToInt(right)\n\tif left64 > right64 {\n\t\tleft64, right64 = right64, left64\n\t}\n\treturn value64 >= left64 && value64 <= right64\n}\n\n// InRangeFloat32 returns true if value lies between left and right border\nfunc InRangeFloat32(value, left, right float32) bool {\n\tif left > right {\n\t\tleft, right = right, left\n\t}\n\treturn value >= left && value <= right\n}\n\n// InRangeFloat64 returns true if value lies between left and right border\nfunc InRangeFloat64(value, left, right float64) bool {\n\tif left > right {\n\t\tleft, right = right, left\n\t}\n\treturn value >= left && value <= right\n}\n\n// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string.\n// All types must the same type.\n// False if value doesn't lie in range or if it incompatible or not comparable\nfunc InRange(value interface{}, left interface{}, right interface{}) bool {\n\tswitch value.(type) {\n\tcase int:\n\t\tintValue, _ := ToInt(value)\n\t\tintLeft, _ := ToInt(left)\n\t\tintRight, _ := ToInt(right)\n\t\treturn InRangeInt(intValue, intLeft, intRight)\n\tcase float32, float64:\n\t\tintValue, _ := ToFloat(value)\n\t\tintLeft, _ := ToFloat(left)\n\t\tintRight, _ := ToFloat(right)\n\t\treturn InRangeFloat64(intValue, intLeft, intRight)\n\tcase string:\n\t\treturn value.(string) >= left.(string) && value.(string) <= right.(string)\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// IsWhole returns true if value is whole number\nfunc IsWhole(value float64) bool {\n\treturn math.Remainder(value, 1) == 0\n}\n\n// IsNatural returns true if value is natural number (positive and whole)\nfunc IsNatural(value float64) bool {\n\treturn IsWhole(value) && IsPositive(value)\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/patterns.go",
    "content": "package govalidator\n\nimport \"regexp\"\n\n// Basic regular expressions for validating strings\nconst (\n\tEmail             string = \"^(((([a-zA-Z]|\\\\d|[!#\\\\$%&'\\\\*\\\\+\\\\-\\\\/=\\\\?\\\\^_`{\\\\|}~]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])+(\\\\.([a-zA-Z]|\\\\d|[!#\\\\$%&'\\\\*\\\\+\\\\-\\\\/=\\\\?\\\\^_`{\\\\|}~]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])+)*)|((\\\\x22)((((\\\\x20|\\\\x09)*(\\\\x0d\\\\x0a))?(\\\\x20|\\\\x09)+)?(([\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x7f]|\\\\x21|[\\\\x23-\\\\x5b]|[\\\\x5d-\\\\x7e]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])|(\\\\([\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0d-\\\\x7f]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}]))))*(((\\\\x20|\\\\x09)*(\\\\x0d\\\\x0a))?(\\\\x20|\\\\x09)+)?(\\\\x22)))@((([a-zA-Z]|\\\\d|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])|(([a-zA-Z]|\\\\d|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])([a-zA-Z]|\\\\d|-|\\\\.|_|~|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])*([a-zA-Z]|\\\\d|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])))\\\\.)+(([a-zA-Z]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])|(([a-zA-Z]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])([a-zA-Z]|\\\\d|-|_|~|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])*([a-zA-Z]|[\\\\x{00A0}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFEF}])))\\\\.?$\"\n\tCreditCard        string = \"^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\\\d{3})\\\\d{11}|6[27][0-9]{14})$\"\n\tISBN10            string = \"^(?:[0-9]{9}X|[0-9]{10})$\"\n\tISBN13            string = \"^(?:[0-9]{13})$\"\n\tUUID3             string = \"^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$\"\n\tUUID4             string = \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"\n\tUUID5             string = \"^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"\n\tUUID              string = \"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\"\n\tAlpha             string = \"^[a-zA-Z]+$\"\n\tAlphanumeric      string = \"^[a-zA-Z0-9]+$\"\n\tNumeric           string = \"^[0-9]+$\"\n\tInt               string = \"^(?:[-+]?(?:0|[1-9][0-9]*))$\"\n\tFloat             string = \"^(?:[-+]?(?:[0-9]+))?(?:\\\\.[0-9]*)?(?:[eE][\\\\+\\\\-]?(?:[0-9]+))?$\"\n\tHexadecimal       string = \"^[0-9a-fA-F]+$\"\n\tHexcolor          string = \"^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$\"\n\tRGBcolor          string = \"^rgb\\\\(\\\\s*(0|[1-9]\\\\d?|1\\\\d\\\\d?|2[0-4]\\\\d|25[0-5])\\\\s*,\\\\s*(0|[1-9]\\\\d?|1\\\\d\\\\d?|2[0-4]\\\\d|25[0-5])\\\\s*,\\\\s*(0|[1-9]\\\\d?|1\\\\d\\\\d?|2[0-4]\\\\d|25[0-5])\\\\s*\\\\)$\"\n\tASCII             string = \"^[\\x00-\\x7F]+$\"\n\tMultibyte         string = \"[^\\x00-\\x7F]\"\n\tFullWidth         string = \"[^\\u0020-\\u007E\\uFF61-\\uFF9F\\uFFA0-\\uFFDC\\uFFE8-\\uFFEE0-9a-zA-Z]\"\n\tHalfWidth         string = \"[\\u0020-\\u007E\\uFF61-\\uFF9F\\uFFA0-\\uFFDC\\uFFE8-\\uFFEE0-9a-zA-Z]\"\n\tBase64            string = \"^(?:[A-Za-z0-9+\\\\/]{4})*(?:[A-Za-z0-9+\\\\/]{2}==|[A-Za-z0-9+\\\\/]{3}=|[A-Za-z0-9+\\\\/]{4})$\"\n\tPrintableASCII    string = \"^[\\x20-\\x7E]+$\"\n\tDataURI           string = \"^data:.+\\\\/(.+);base64$\"\n\tMagnetURI         string = \"^magnet:\\\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$\"\n\tLatitude          string = \"^[-+]?([1-8]?\\\\d(\\\\.\\\\d+)?|90(\\\\.0+)?)$\"\n\tLongitude         string = \"^[-+]?(180(\\\\.0+)?|((1[0-7]\\\\d)|([1-9]?\\\\d))(\\\\.\\\\d+)?)$\"\n\tDNSName           string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\\._]?$`\n\tIP                string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))`\n\tURLSchema         string = `((ftp|tcp|udp|wss?|https?):\\/\\/)`\n\tURLUsername       string = `(\\S+(:\\S*)?@)`\n\tURLPath           string = `((\\/|\\?|#)[^\\s]*)`\n\tURLPort           string = `(:(\\d{1,5}))`\n\tURLIP             string = `([1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3]|24\\d|25[0-5])(\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])){2}(?:\\.([0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-5]))`\n\tURLSubdomain      string = `((www\\.)|([a-zA-Z0-9]+([-_\\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\\.[a-zA-Z0-9]+))`\n\tURL                      = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\\[` + IP + `\\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\\x{00a1}-\\x{ffff}0-9]+-?-?)*[a-zA-Z\\x{00a1}-\\x{ffff}0-9]+)(?:\\.([a-zA-Z\\x{00a1}-\\x{ffff}]{1,}))?))\\.?` + URLPort + `?` + URLPath + `?$`\n\tSSN               string = `^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$`\n\tWinPath           string = `^[a-zA-Z]:\\\\(?:[^\\\\/:*?\"<>|\\r\\n]+\\\\)*[^\\\\/:*?\"<>|\\r\\n]*$`\n\tUnixPath          string = `^(/[^/\\x00]*)+/?$`\n\tWinARPath         string = `^(?:(?:[a-zA-Z]:|\\\\\\\\[a-z0-9_.$●-]+\\\\[a-z0-9_.$●-]+)\\\\|\\\\?[^\\\\/:*?\"<>|\\r\\n]+\\\\?)(?:[^\\\\/:*?\"<>|\\r\\n]+\\\\)*[^\\\\/:*?\"<>|\\r\\n]*$`\n\tUnixARPath        string = `^((\\.{0,2}/)?([^/\\x00]*))+/?$`\n\tSemver            string = \"^v?(?:0|[1-9]\\\\d*)\\\\.(?:0|[1-9]\\\\d*)\\\\.(?:0|[1-9]\\\\d*)(-(0|[1-9]\\\\d*|\\\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\\\.(0|[1-9]\\\\d*|\\\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\\\+[0-9a-zA-Z-]+(\\\\.[0-9a-zA-Z-]+)*)?$\"\n\ttagName           string = \"valid\"\n\thasLowerCase      string = \".*[[:lower:]]\"\n\thasUpperCase      string = \".*[[:upper:]]\"\n\thasWhitespace     string = \".*[[:space:]]\"\n\thasWhitespaceOnly string = \"^[[:space:]]+$\"\n\tIMEI              string = \"^[0-9a-f]{14}$|^\\\\d{15}$|^\\\\d{18}$\"\n\tIMSI              string = \"^\\\\d{14,15}$\"\n\tE164              string = `^\\+?[1-9]\\d{1,14}$`\n)\n\n// Used by IsFilePath func\nconst (\n\t// Unknown is unresolved OS type\n\tUnknown = iota\n\t// Win is Windows type\n\tWin\n\t// Unix is *nix OS types\n\tUnix\n)\n\nvar (\n\tuserRegexp          = regexp.MustCompile(\"^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$\")\n\thostRegexp          = regexp.MustCompile(\"^[^\\\\s]+\\\\.[^\\\\s]+$\")\n\tuserDotRegexp       = regexp.MustCompile(\"(^[.]{1})|([.]{1}$)|([.]{2,})\")\n\trxEmail             = regexp.MustCompile(Email)\n\trxCreditCard        = regexp.MustCompile(CreditCard)\n\trxISBN10            = regexp.MustCompile(ISBN10)\n\trxISBN13            = regexp.MustCompile(ISBN13)\n\trxUUID3             = regexp.MustCompile(UUID3)\n\trxUUID4             = regexp.MustCompile(UUID4)\n\trxUUID5             = regexp.MustCompile(UUID5)\n\trxUUID              = regexp.MustCompile(UUID)\n\trxAlpha             = regexp.MustCompile(Alpha)\n\trxAlphanumeric      = regexp.MustCompile(Alphanumeric)\n\trxNumeric           = regexp.MustCompile(Numeric)\n\trxInt               = regexp.MustCompile(Int)\n\trxFloat             = regexp.MustCompile(Float)\n\trxHexadecimal       = regexp.MustCompile(Hexadecimal)\n\trxHexcolor          = regexp.MustCompile(Hexcolor)\n\trxRGBcolor          = regexp.MustCompile(RGBcolor)\n\trxASCII             = regexp.MustCompile(ASCII)\n\trxPrintableASCII    = regexp.MustCompile(PrintableASCII)\n\trxMultibyte         = regexp.MustCompile(Multibyte)\n\trxFullWidth         = regexp.MustCompile(FullWidth)\n\trxHalfWidth         = regexp.MustCompile(HalfWidth)\n\trxBase64            = regexp.MustCompile(Base64)\n\trxDataURI           = regexp.MustCompile(DataURI)\n\trxMagnetURI         = regexp.MustCompile(MagnetURI)\n\trxLatitude          = regexp.MustCompile(Latitude)\n\trxLongitude         = regexp.MustCompile(Longitude)\n\trxDNSName           = regexp.MustCompile(DNSName)\n\trxURL               = regexp.MustCompile(URL)\n\trxSSN               = regexp.MustCompile(SSN)\n\trxWinPath           = regexp.MustCompile(WinPath)\n\trxUnixPath          = regexp.MustCompile(UnixPath)\n\trxARWinPath         = regexp.MustCompile(WinARPath)\n\trxARUnixPath        = regexp.MustCompile(UnixARPath)\n\trxSemver            = regexp.MustCompile(Semver)\n\trxHasLowerCase      = regexp.MustCompile(hasLowerCase)\n\trxHasUpperCase      = regexp.MustCompile(hasUpperCase)\n\trxHasWhitespace     = regexp.MustCompile(hasWhitespace)\n\trxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly)\n\trxIMEI              = regexp.MustCompile(IMEI)\n\trxIMSI              = regexp.MustCompile(IMSI)\n\trxE164              = regexp.MustCompile(E164)\n)\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/types.go",
    "content": "package govalidator\n\nimport (\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"sync\"\n)\n\n// Validator is a wrapper for a validator function that returns bool and accepts string.\ntype Validator func(str string) bool\n\n// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type.\n// The second parameter should be the context (in the case of validating a struct: the whole object being validated).\ntype CustomTypeValidator func(i interface{}, o interface{}) bool\n\n// ParamValidator is a wrapper for validator functions that accept additional parameters.\ntype ParamValidator func(str string, params ...string) bool\n\n// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value\ntype InterfaceParamValidator func(in interface{}, params ...string) bool\ntype tagOptionsMap map[string]tagOption\n\nfunc (t tagOptionsMap) orderedKeys() []string {\n\tvar keys []string\n\tfor k := range t {\n\t\tkeys = append(keys, k)\n\t}\n\n\tsort.Slice(keys, func(a, b int) bool {\n\t\treturn t[keys[a]].order < t[keys[b]].order\n\t})\n\n\treturn keys\n}\n\ntype tagOption struct {\n\tname               string\n\tcustomErrorMessage string\n\torder              int\n}\n\n// UnsupportedTypeError is a wrapper for reflect.Type\ntype UnsupportedTypeError struct {\n\tType reflect.Type\n}\n\n// stringValues is a slice of reflect.Value holding *reflect.StringValue.\n// It implements the methods to sort by string.\ntype stringValues []reflect.Value\n\n// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value\nvar InterfaceParamTagMap = map[string]InterfaceParamValidator{\n\t\"type\": IsType,\n}\n\n// InterfaceParamTagRegexMap maps interface param tags to their respective regexes.\nvar InterfaceParamTagRegexMap = map[string]*regexp.Regexp{\n\t\"type\": regexp.MustCompile(`^type\\((.*)\\)$`),\n}\n\n// ParamTagMap is a map of functions accept variants parameters\nvar ParamTagMap = map[string]ParamValidator{\n\t\"length\":          ByteLength,\n\t\"range\":           Range,\n\t\"runelength\":      RuneLength,\n\t\"stringlength\":    StringLength,\n\t\"matches\":         StringMatches,\n\t\"in\":              IsInRaw,\n\t\"rsapub\":          IsRsaPub,\n\t\"minstringlength\": MinStringLength,\n\t\"maxstringlength\": MaxStringLength,\n}\n\n// ParamTagRegexMap maps param tags to their respective regexes.\nvar ParamTagRegexMap = map[string]*regexp.Regexp{\n\t\"range\":           regexp.MustCompile(\"^range\\\\((\\\\d+)\\\\|(\\\\d+)\\\\)$\"),\n\t\"length\":          regexp.MustCompile(\"^length\\\\((\\\\d+)\\\\|(\\\\d+)\\\\)$\"),\n\t\"runelength\":      regexp.MustCompile(\"^runelength\\\\((\\\\d+)\\\\|(\\\\d+)\\\\)$\"),\n\t\"stringlength\":    regexp.MustCompile(\"^stringlength\\\\((\\\\d+)\\\\|(\\\\d+)\\\\)$\"),\n\t\"in\":              regexp.MustCompile(`^in\\((.*)\\)`),\n\t\"matches\":         regexp.MustCompile(`^matches\\((.+)\\)$`),\n\t\"rsapub\":          regexp.MustCompile(\"^rsapub\\\\((\\\\d+)\\\\)$\"),\n\t\"minstringlength\": regexp.MustCompile(\"^minstringlength\\\\((\\\\d+)\\\\)$\"),\n\t\"maxstringlength\": regexp.MustCompile(\"^maxstringlength\\\\((\\\\d+)\\\\)$\"),\n}\n\ntype customTypeTagMap struct {\n\tvalidators map[string]CustomTypeValidator\n\n\tsync.RWMutex\n}\n\nfunc (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) {\n\ttm.RLock()\n\tdefer tm.RUnlock()\n\tv, ok := tm.validators[name]\n\treturn v, ok\n}\n\nfunc (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) {\n\ttm.Lock()\n\tdefer tm.Unlock()\n\ttm.validators[name] = ctv\n}\n\n// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function.\n// Use this to validate compound or custom types that need to be handled as a whole, e.g.\n// `type UUID [16]byte` (this would be handled as an array of bytes).\nvar CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)}\n\n// TagMap is a map of functions, that can be used as tags for ValidateStruct function.\nvar TagMap = map[string]Validator{\n\t\"email\":              IsEmail,\n\t\"url\":                IsURL,\n\t\"dialstring\":         IsDialString,\n\t\"requrl\":             IsRequestURL,\n\t\"requri\":             IsRequestURI,\n\t\"alpha\":              IsAlpha,\n\t\"utfletter\":          IsUTFLetter,\n\t\"alphanum\":           IsAlphanumeric,\n\t\"utfletternum\":       IsUTFLetterNumeric,\n\t\"numeric\":            IsNumeric,\n\t\"utfnumeric\":         IsUTFNumeric,\n\t\"utfdigit\":           IsUTFDigit,\n\t\"hexadecimal\":        IsHexadecimal,\n\t\"hexcolor\":           IsHexcolor,\n\t\"rgbcolor\":           IsRGBcolor,\n\t\"lowercase\":          IsLowerCase,\n\t\"uppercase\":          IsUpperCase,\n\t\"int\":                IsInt,\n\t\"float\":              IsFloat,\n\t\"null\":               IsNull,\n\t\"notnull\":            IsNotNull,\n\t\"uuid\":               IsUUID,\n\t\"uuidv3\":             IsUUIDv3,\n\t\"uuidv4\":             IsUUIDv4,\n\t\"uuidv5\":             IsUUIDv5,\n\t\"creditcard\":         IsCreditCard,\n\t\"isbn10\":             IsISBN10,\n\t\"isbn13\":             IsISBN13,\n\t\"json\":               IsJSON,\n\t\"multibyte\":          IsMultibyte,\n\t\"ascii\":              IsASCII,\n\t\"printableascii\":     IsPrintableASCII,\n\t\"fullwidth\":          IsFullWidth,\n\t\"halfwidth\":          IsHalfWidth,\n\t\"variablewidth\":      IsVariableWidth,\n\t\"base64\":             IsBase64,\n\t\"datauri\":            IsDataURI,\n\t\"ip\":                 IsIP,\n\t\"port\":               IsPort,\n\t\"ipv4\":               IsIPv4,\n\t\"ipv6\":               IsIPv6,\n\t\"dns\":                IsDNSName,\n\t\"host\":               IsHost,\n\t\"mac\":                IsMAC,\n\t\"latitude\":           IsLatitude,\n\t\"longitude\":          IsLongitude,\n\t\"ssn\":                IsSSN,\n\t\"semver\":             IsSemver,\n\t\"rfc3339\":            IsRFC3339,\n\t\"rfc3339WithoutZone\": IsRFC3339WithoutZone,\n\t\"ISO3166Alpha2\":      IsISO3166Alpha2,\n\t\"ISO3166Alpha3\":      IsISO3166Alpha3,\n\t\"ISO4217\":            IsISO4217,\n\t\"IMEI\":               IsIMEI,\n\t\"ulid\":               IsULID,\n}\n\n// ISO3166Entry stores country codes\ntype ISO3166Entry struct {\n\tEnglishShortName string\n\tFrenchShortName  string\n\tAlpha2Code       string\n\tAlpha3Code       string\n\tNumeric          string\n}\n\n//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type \"Officially Assigned Codes\"\nvar ISO3166List = []ISO3166Entry{\n\t{\"Afghanistan\", \"Afghanistan (l')\", \"AF\", \"AFG\", \"004\"},\n\t{\"Albania\", \"Albanie (l')\", \"AL\", \"ALB\", \"008\"},\n\t{\"Antarctica\", \"Antarctique (l')\", \"AQ\", \"ATA\", \"010\"},\n\t{\"Algeria\", \"Algérie (l')\", \"DZ\", \"DZA\", \"012\"},\n\t{\"American Samoa\", \"Samoa américaines (les)\", \"AS\", \"ASM\", \"016\"},\n\t{\"Andorra\", \"Andorre (l')\", \"AD\", \"AND\", \"020\"},\n\t{\"Angola\", \"Angola (l')\", \"AO\", \"AGO\", \"024\"},\n\t{\"Antigua and Barbuda\", \"Antigua-et-Barbuda\", \"AG\", \"ATG\", \"028\"},\n\t{\"Azerbaijan\", \"Azerbaïdjan (l')\", \"AZ\", \"AZE\", \"031\"},\n\t{\"Argentina\", \"Argentine (l')\", \"AR\", \"ARG\", \"032\"},\n\t{\"Australia\", \"Australie (l')\", \"AU\", \"AUS\", \"036\"},\n\t{\"Austria\", \"Autriche (l')\", \"AT\", \"AUT\", \"040\"},\n\t{\"Bahamas (the)\", \"Bahamas (les)\", \"BS\", \"BHS\", \"044\"},\n\t{\"Bahrain\", \"Bahreïn\", \"BH\", \"BHR\", \"048\"},\n\t{\"Bangladesh\", \"Bangladesh (le)\", \"BD\", \"BGD\", \"050\"},\n\t{\"Armenia\", \"Arménie (l')\", \"AM\", \"ARM\", \"051\"},\n\t{\"Barbados\", \"Barbade (la)\", \"BB\", \"BRB\", \"052\"},\n\t{\"Belgium\", \"Belgique (la)\", \"BE\", \"BEL\", \"056\"},\n\t{\"Bermuda\", \"Bermudes (les)\", \"BM\", \"BMU\", \"060\"},\n\t{\"Bhutan\", \"Bhoutan (le)\", \"BT\", \"BTN\", \"064\"},\n\t{\"Bolivia (Plurinational State of)\", \"Bolivie (État plurinational de)\", \"BO\", \"BOL\", \"068\"},\n\t{\"Bosnia and Herzegovina\", \"Bosnie-Herzégovine (la)\", \"BA\", \"BIH\", \"070\"},\n\t{\"Botswana\", \"Botswana (le)\", \"BW\", \"BWA\", \"072\"},\n\t{\"Bouvet Island\", \"Bouvet (l'Île)\", \"BV\", \"BVT\", \"074\"},\n\t{\"Brazil\", \"Brésil (le)\", \"BR\", \"BRA\", \"076\"},\n\t{\"Belize\", \"Belize (le)\", \"BZ\", \"BLZ\", \"084\"},\n\t{\"British Indian Ocean Territory (the)\", \"Indien (le Territoire britannique de l'océan)\", \"IO\", \"IOT\", \"086\"},\n\t{\"Solomon Islands\", \"Salomon (Îles)\", \"SB\", \"SLB\", \"090\"},\n\t{\"Virgin Islands (British)\", \"Vierges britanniques (les Îles)\", \"VG\", \"VGB\", \"092\"},\n\t{\"Brunei Darussalam\", \"Brunéi Darussalam (le)\", \"BN\", \"BRN\", \"096\"},\n\t{\"Bulgaria\", \"Bulgarie (la)\", \"BG\", \"BGR\", \"100\"},\n\t{\"Myanmar\", \"Myanmar (le)\", \"MM\", \"MMR\", \"104\"},\n\t{\"Burundi\", \"Burundi (le)\", \"BI\", \"BDI\", \"108\"},\n\t{\"Belarus\", \"Bélarus (le)\", \"BY\", \"BLR\", \"112\"},\n\t{\"Cambodia\", \"Cambodge (le)\", \"KH\", \"KHM\", \"116\"},\n\t{\"Cameroon\", \"Cameroun (le)\", \"CM\", \"CMR\", \"120\"},\n\t{\"Canada\", \"Canada (le)\", \"CA\", \"CAN\", \"124\"},\n\t{\"Cabo Verde\", \"Cabo Verde\", \"CV\", \"CPV\", \"132\"},\n\t{\"Cayman Islands (the)\", \"Caïmans (les Îles)\", \"KY\", \"CYM\", \"136\"},\n\t{\"Central African Republic (the)\", \"République centrafricaine (la)\", \"CF\", \"CAF\", \"140\"},\n\t{\"Sri Lanka\", \"Sri Lanka\", \"LK\", \"LKA\", \"144\"},\n\t{\"Chad\", \"Tchad (le)\", \"TD\", \"TCD\", \"148\"},\n\t{\"Chile\", \"Chili (le)\", \"CL\", \"CHL\", \"152\"},\n\t{\"China\", \"Chine (la)\", \"CN\", \"CHN\", \"156\"},\n\t{\"Taiwan (Province of China)\", \"Taïwan (Province de Chine)\", \"TW\", \"TWN\", \"158\"},\n\t{\"Christmas Island\", \"Christmas (l'Île)\", \"CX\", \"CXR\", \"162\"},\n\t{\"Cocos (Keeling) Islands (the)\", \"Cocos (les Îles)/ Keeling (les Îles)\", \"CC\", \"CCK\", \"166\"},\n\t{\"Colombia\", \"Colombie (la)\", \"CO\", \"COL\", \"170\"},\n\t{\"Comoros (the)\", \"Comores (les)\", \"KM\", \"COM\", \"174\"},\n\t{\"Mayotte\", \"Mayotte\", \"YT\", \"MYT\", \"175\"},\n\t{\"Congo (the)\", \"Congo (le)\", \"CG\", \"COG\", \"178\"},\n\t{\"Congo (the Democratic Republic of the)\", \"Congo (la République démocratique du)\", \"CD\", \"COD\", \"180\"},\n\t{\"Cook Islands (the)\", \"Cook (les Îles)\", \"CK\", \"COK\", \"184\"},\n\t{\"Costa Rica\", \"Costa Rica (le)\", \"CR\", \"CRI\", \"188\"},\n\t{\"Croatia\", \"Croatie (la)\", \"HR\", \"HRV\", \"191\"},\n\t{\"Cuba\", \"Cuba\", \"CU\", \"CUB\", \"192\"},\n\t{\"Cyprus\", \"Chypre\", \"CY\", \"CYP\", \"196\"},\n\t{\"Czech Republic (the)\", \"tchèque (la République)\", \"CZ\", \"CZE\", \"203\"},\n\t{\"Benin\", \"Bénin (le)\", \"BJ\", \"BEN\", \"204\"},\n\t{\"Denmark\", \"Danemark (le)\", \"DK\", \"DNK\", \"208\"},\n\t{\"Dominica\", \"Dominique (la)\", \"DM\", \"DMA\", \"212\"},\n\t{\"Dominican Republic (the)\", \"dominicaine (la République)\", \"DO\", \"DOM\", \"214\"},\n\t{\"Ecuador\", \"Équateur (l')\", \"EC\", \"ECU\", \"218\"},\n\t{\"El Salvador\", \"El Salvador\", \"SV\", \"SLV\", \"222\"},\n\t{\"Equatorial Guinea\", \"Guinée équatoriale (la)\", \"GQ\", \"GNQ\", \"226\"},\n\t{\"Ethiopia\", \"Éthiopie (l')\", \"ET\", \"ETH\", \"231\"},\n\t{\"Eritrea\", \"Érythrée (l')\", \"ER\", \"ERI\", \"232\"},\n\t{\"Estonia\", \"Estonie (l')\", \"EE\", \"EST\", \"233\"},\n\t{\"Faroe Islands (the)\", \"Féroé (les Îles)\", \"FO\", \"FRO\", \"234\"},\n\t{\"Falkland Islands (the) [Malvinas]\", \"Falkland (les Îles)/Malouines (les Îles)\", \"FK\", \"FLK\", \"238\"},\n\t{\"South Georgia and the South Sandwich Islands\", \"Géorgie du Sud-et-les Îles Sandwich du Sud (la)\", \"GS\", \"SGS\", \"239\"},\n\t{\"Fiji\", \"Fidji (les)\", \"FJ\", \"FJI\", \"242\"},\n\t{\"Finland\", \"Finlande (la)\", \"FI\", \"FIN\", \"246\"},\n\t{\"Åland Islands\", \"Åland(les Îles)\", \"AX\", \"ALA\", \"248\"},\n\t{\"France\", \"France (la)\", \"FR\", \"FRA\", \"250\"},\n\t{\"French Guiana\", \"Guyane française (la )\", \"GF\", \"GUF\", \"254\"},\n\t{\"French Polynesia\", \"Polynésie française (la)\", \"PF\", \"PYF\", \"258\"},\n\t{\"French Southern Territories (the)\", \"Terres australes françaises (les)\", \"TF\", \"ATF\", \"260\"},\n\t{\"Djibouti\", \"Djibouti\", \"DJ\", \"DJI\", \"262\"},\n\t{\"Gabon\", \"Gabon (le)\", \"GA\", \"GAB\", \"266\"},\n\t{\"Georgia\", \"Géorgie (la)\", \"GE\", \"GEO\", \"268\"},\n\t{\"Gambia (the)\", \"Gambie (la)\", \"GM\", \"GMB\", \"270\"},\n\t{\"Palestine, State of\", \"Palestine, État de\", \"PS\", \"PSE\", \"275\"},\n\t{\"Germany\", \"Allemagne (l')\", \"DE\", \"DEU\", \"276\"},\n\t{\"Ghana\", \"Ghana (le)\", \"GH\", \"GHA\", \"288\"},\n\t{\"Gibraltar\", \"Gibraltar\", \"GI\", \"GIB\", \"292\"},\n\t{\"Kiribati\", \"Kiribati\", \"KI\", \"KIR\", \"296\"},\n\t{\"Greece\", \"Grèce (la)\", \"GR\", \"GRC\", \"300\"},\n\t{\"Greenland\", \"Groenland (le)\", \"GL\", \"GRL\", \"304\"},\n\t{\"Grenada\", \"Grenade (la)\", \"GD\", \"GRD\", \"308\"},\n\t{\"Guadeloupe\", \"Guadeloupe (la)\", \"GP\", \"GLP\", \"312\"},\n\t{\"Guam\", \"Guam\", \"GU\", \"GUM\", \"316\"},\n\t{\"Guatemala\", \"Guatemala (le)\", \"GT\", \"GTM\", \"320\"},\n\t{\"Guinea\", \"Guinée (la)\", \"GN\", \"GIN\", \"324\"},\n\t{\"Guyana\", \"Guyana (le)\", \"GY\", \"GUY\", \"328\"},\n\t{\"Haiti\", \"Haïti\", \"HT\", \"HTI\", \"332\"},\n\t{\"Heard Island and McDonald Islands\", \"Heard-et-Îles MacDonald (l'Île)\", \"HM\", \"HMD\", \"334\"},\n\t{\"Holy See (the)\", \"Saint-Siège (le)\", \"VA\", \"VAT\", \"336\"},\n\t{\"Honduras\", \"Honduras (le)\", \"HN\", \"HND\", \"340\"},\n\t{\"Hong Kong\", \"Hong Kong\", \"HK\", \"HKG\", \"344\"},\n\t{\"Hungary\", \"Hongrie (la)\", \"HU\", \"HUN\", \"348\"},\n\t{\"Iceland\", \"Islande (l')\", \"IS\", \"ISL\", \"352\"},\n\t{\"India\", \"Inde (l')\", \"IN\", \"IND\", \"356\"},\n\t{\"Indonesia\", \"Indonésie (l')\", \"ID\", \"IDN\", \"360\"},\n\t{\"Iran (Islamic Republic of)\", \"Iran (République Islamique d')\", \"IR\", \"IRN\", \"364\"},\n\t{\"Iraq\", \"Iraq (l')\", \"IQ\", \"IRQ\", \"368\"},\n\t{\"Ireland\", \"Irlande (l')\", \"IE\", \"IRL\", \"372\"},\n\t{\"Israel\", \"Israël\", \"IL\", \"ISR\", \"376\"},\n\t{\"Italy\", \"Italie (l')\", \"IT\", \"ITA\", \"380\"},\n\t{\"Côte d'Ivoire\", \"Côte d'Ivoire (la)\", \"CI\", \"CIV\", \"384\"},\n\t{\"Jamaica\", \"Jamaïque (la)\", \"JM\", \"JAM\", \"388\"},\n\t{\"Japan\", \"Japon (le)\", \"JP\", \"JPN\", \"392\"},\n\t{\"Kazakhstan\", \"Kazakhstan (le)\", \"KZ\", \"KAZ\", \"398\"},\n\t{\"Jordan\", \"Jordanie (la)\", \"JO\", \"JOR\", \"400\"},\n\t{\"Kenya\", \"Kenya (le)\", \"KE\", \"KEN\", \"404\"},\n\t{\"Korea (the Democratic People's Republic of)\", \"Corée (la République populaire démocratique de)\", \"KP\", \"PRK\", \"408\"},\n\t{\"Korea (the Republic of)\", \"Corée (la République de)\", \"KR\", \"KOR\", \"410\"},\n\t{\"Kuwait\", \"Koweït (le)\", \"KW\", \"KWT\", \"414\"},\n\t{\"Kyrgyzstan\", \"Kirghizistan (le)\", \"KG\", \"KGZ\", \"417\"},\n\t{\"Lao People's Democratic Republic (the)\", \"Lao, République démocratique populaire\", \"LA\", \"LAO\", \"418\"},\n\t{\"Lebanon\", \"Liban (le)\", \"LB\", \"LBN\", \"422\"},\n\t{\"Lesotho\", \"Lesotho (le)\", \"LS\", \"LSO\", \"426\"},\n\t{\"Latvia\", \"Lettonie (la)\", \"LV\", \"LVA\", \"428\"},\n\t{\"Liberia\", \"Libéria (le)\", \"LR\", \"LBR\", \"430\"},\n\t{\"Libya\", \"Libye (la)\", \"LY\", \"LBY\", \"434\"},\n\t{\"Liechtenstein\", \"Liechtenstein (le)\", \"LI\", \"LIE\", \"438\"},\n\t{\"Lithuania\", \"Lituanie (la)\", \"LT\", \"LTU\", \"440\"},\n\t{\"Luxembourg\", \"Luxembourg (le)\", \"LU\", \"LUX\", \"442\"},\n\t{\"Macao\", \"Macao\", \"MO\", \"MAC\", \"446\"},\n\t{\"Madagascar\", \"Madagascar\", \"MG\", \"MDG\", \"450\"},\n\t{\"Malawi\", \"Malawi (le)\", \"MW\", \"MWI\", \"454\"},\n\t{\"Malaysia\", \"Malaisie (la)\", \"MY\", \"MYS\", \"458\"},\n\t{\"Maldives\", \"Maldives (les)\", \"MV\", \"MDV\", \"462\"},\n\t{\"Mali\", \"Mali (le)\", \"ML\", \"MLI\", \"466\"},\n\t{\"Malta\", \"Malte\", \"MT\", \"MLT\", \"470\"},\n\t{\"Martinique\", \"Martinique (la)\", \"MQ\", \"MTQ\", \"474\"},\n\t{\"Mauritania\", \"Mauritanie (la)\", \"MR\", \"MRT\", \"478\"},\n\t{\"Mauritius\", \"Maurice\", \"MU\", \"MUS\", \"480\"},\n\t{\"Mexico\", \"Mexique (le)\", \"MX\", \"MEX\", \"484\"},\n\t{\"Monaco\", \"Monaco\", \"MC\", \"MCO\", \"492\"},\n\t{\"Mongolia\", \"Mongolie (la)\", \"MN\", \"MNG\", \"496\"},\n\t{\"Moldova (the Republic of)\", \"Moldova , République de\", \"MD\", \"MDA\", \"498\"},\n\t{\"Montenegro\", \"Monténégro (le)\", \"ME\", \"MNE\", \"499\"},\n\t{\"Montserrat\", \"Montserrat\", \"MS\", \"MSR\", \"500\"},\n\t{\"Morocco\", \"Maroc (le)\", \"MA\", \"MAR\", \"504\"},\n\t{\"Mozambique\", \"Mozambique (le)\", \"MZ\", \"MOZ\", \"508\"},\n\t{\"Oman\", \"Oman\", \"OM\", \"OMN\", \"512\"},\n\t{\"Namibia\", \"Namibie (la)\", \"NA\", \"NAM\", \"516\"},\n\t{\"Nauru\", \"Nauru\", \"NR\", \"NRU\", \"520\"},\n\t{\"Nepal\", \"Népal (le)\", \"NP\", \"NPL\", \"524\"},\n\t{\"Netherlands (the)\", \"Pays-Bas (les)\", \"NL\", \"NLD\", \"528\"},\n\t{\"Curaçao\", \"Curaçao\", \"CW\", \"CUW\", \"531\"},\n\t{\"Aruba\", \"Aruba\", \"AW\", \"ABW\", \"533\"},\n\t{\"Sint Maarten (Dutch part)\", \"Saint-Martin (partie néerlandaise)\", \"SX\", \"SXM\", \"534\"},\n\t{\"Bonaire, Sint Eustatius and Saba\", \"Bonaire, Saint-Eustache et Saba\", \"BQ\", \"BES\", \"535\"},\n\t{\"New Caledonia\", \"Nouvelle-Calédonie (la)\", \"NC\", \"NCL\", \"540\"},\n\t{\"Vanuatu\", \"Vanuatu (le)\", \"VU\", \"VUT\", \"548\"},\n\t{\"New Zealand\", \"Nouvelle-Zélande (la)\", \"NZ\", \"NZL\", \"554\"},\n\t{\"Nicaragua\", \"Nicaragua (le)\", \"NI\", \"NIC\", \"558\"},\n\t{\"Niger (the)\", \"Niger (le)\", \"NE\", \"NER\", \"562\"},\n\t{\"Nigeria\", \"Nigéria (le)\", \"NG\", \"NGA\", \"566\"},\n\t{\"Niue\", \"Niue\", \"NU\", \"NIU\", \"570\"},\n\t{\"Norfolk Island\", \"Norfolk (l'Île)\", \"NF\", \"NFK\", \"574\"},\n\t{\"Norway\", \"Norvège (la)\", \"NO\", \"NOR\", \"578\"},\n\t{\"Northern Mariana Islands (the)\", \"Mariannes du Nord (les Îles)\", \"MP\", \"MNP\", \"580\"},\n\t{\"United States Minor Outlying Islands (the)\", \"Îles mineures éloignées des États-Unis (les)\", \"UM\", \"UMI\", \"581\"},\n\t{\"Micronesia (Federated States of)\", \"Micronésie (États fédérés de)\", \"FM\", \"FSM\", \"583\"},\n\t{\"Marshall Islands (the)\", \"Marshall (Îles)\", \"MH\", \"MHL\", \"584\"},\n\t{\"Palau\", \"Palaos (les)\", \"PW\", \"PLW\", \"585\"},\n\t{\"Pakistan\", \"Pakistan (le)\", \"PK\", \"PAK\", \"586\"},\n\t{\"Panama\", \"Panama (le)\", \"PA\", \"PAN\", \"591\"},\n\t{\"Papua New Guinea\", \"Papouasie-Nouvelle-Guinée (la)\", \"PG\", \"PNG\", \"598\"},\n\t{\"Paraguay\", \"Paraguay (le)\", \"PY\", \"PRY\", \"600\"},\n\t{\"Peru\", \"Pérou (le)\", \"PE\", \"PER\", \"604\"},\n\t{\"Philippines (the)\", \"Philippines (les)\", \"PH\", \"PHL\", \"608\"},\n\t{\"Pitcairn\", \"Pitcairn\", \"PN\", \"PCN\", \"612\"},\n\t{\"Poland\", \"Pologne (la)\", \"PL\", \"POL\", \"616\"},\n\t{\"Portugal\", \"Portugal (le)\", \"PT\", \"PRT\", \"620\"},\n\t{\"Guinea-Bissau\", \"Guinée-Bissau (la)\", \"GW\", \"GNB\", \"624\"},\n\t{\"Timor-Leste\", \"Timor-Leste (le)\", \"TL\", \"TLS\", \"626\"},\n\t{\"Puerto Rico\", \"Porto Rico\", \"PR\", \"PRI\", \"630\"},\n\t{\"Qatar\", \"Qatar (le)\", \"QA\", \"QAT\", \"634\"},\n\t{\"Réunion\", \"Réunion (La)\", \"RE\", \"REU\", \"638\"},\n\t{\"Romania\", \"Roumanie (la)\", \"RO\", \"ROU\", \"642\"},\n\t{\"Russian Federation (the)\", \"Russie (la Fédération de)\", \"RU\", \"RUS\", \"643\"},\n\t{\"Rwanda\", \"Rwanda (le)\", \"RW\", \"RWA\", \"646\"},\n\t{\"Saint Barthélemy\", \"Saint-Barthélemy\", \"BL\", \"BLM\", \"652\"},\n\t{\"Saint Helena, Ascension and Tristan da Cunha\", \"Sainte-Hélène, Ascension et Tristan da Cunha\", \"SH\", \"SHN\", \"654\"},\n\t{\"Saint Kitts and Nevis\", \"Saint-Kitts-et-Nevis\", \"KN\", \"KNA\", \"659\"},\n\t{\"Anguilla\", \"Anguilla\", \"AI\", \"AIA\", \"660\"},\n\t{\"Saint Lucia\", \"Sainte-Lucie\", \"LC\", \"LCA\", \"662\"},\n\t{\"Saint Martin (French part)\", \"Saint-Martin (partie française)\", \"MF\", \"MAF\", \"663\"},\n\t{\"Saint Pierre and Miquelon\", \"Saint-Pierre-et-Miquelon\", \"PM\", \"SPM\", \"666\"},\n\t{\"Saint Vincent and the Grenadines\", \"Saint-Vincent-et-les Grenadines\", \"VC\", \"VCT\", \"670\"},\n\t{\"San Marino\", \"Saint-Marin\", \"SM\", \"SMR\", \"674\"},\n\t{\"Sao Tome and Principe\", \"Sao Tomé-et-Principe\", \"ST\", \"STP\", \"678\"},\n\t{\"Saudi Arabia\", \"Arabie saoudite (l')\", \"SA\", \"SAU\", \"682\"},\n\t{\"Senegal\", \"Sénégal (le)\", \"SN\", \"SEN\", \"686\"},\n\t{\"Serbia\", \"Serbie (la)\", \"RS\", \"SRB\", \"688\"},\n\t{\"Seychelles\", \"Seychelles (les)\", \"SC\", \"SYC\", \"690\"},\n\t{\"Sierra Leone\", \"Sierra Leone (la)\", \"SL\", \"SLE\", \"694\"},\n\t{\"Singapore\", \"Singapour\", \"SG\", \"SGP\", \"702\"},\n\t{\"Slovakia\", \"Slovaquie (la)\", \"SK\", \"SVK\", \"703\"},\n\t{\"Viet Nam\", \"Viet Nam (le)\", \"VN\", \"VNM\", \"704\"},\n\t{\"Slovenia\", \"Slovénie (la)\", \"SI\", \"SVN\", \"705\"},\n\t{\"Somalia\", \"Somalie (la)\", \"SO\", \"SOM\", \"706\"},\n\t{\"South Africa\", \"Afrique du Sud (l')\", \"ZA\", \"ZAF\", \"710\"},\n\t{\"Zimbabwe\", \"Zimbabwe (le)\", \"ZW\", \"ZWE\", \"716\"},\n\t{\"Spain\", \"Espagne (l')\", \"ES\", \"ESP\", \"724\"},\n\t{\"South Sudan\", \"Soudan du Sud (le)\", \"SS\", \"SSD\", \"728\"},\n\t{\"Sudan (the)\", \"Soudan (le)\", \"SD\", \"SDN\", \"729\"},\n\t{\"Western Sahara*\", \"Sahara occidental (le)*\", \"EH\", \"ESH\", \"732\"},\n\t{\"Suriname\", \"Suriname (le)\", \"SR\", \"SUR\", \"740\"},\n\t{\"Svalbard and Jan Mayen\", \"Svalbard et l'Île Jan Mayen (le)\", \"SJ\", \"SJM\", \"744\"},\n\t{\"Swaziland\", \"Swaziland (le)\", \"SZ\", \"SWZ\", \"748\"},\n\t{\"Sweden\", \"Suède (la)\", \"SE\", \"SWE\", \"752\"},\n\t{\"Switzerland\", \"Suisse (la)\", \"CH\", \"CHE\", \"756\"},\n\t{\"Syrian Arab Republic\", \"République arabe syrienne (la)\", \"SY\", \"SYR\", \"760\"},\n\t{\"Tajikistan\", \"Tadjikistan (le)\", \"TJ\", \"TJK\", \"762\"},\n\t{\"Thailand\", \"Thaïlande (la)\", \"TH\", \"THA\", \"764\"},\n\t{\"Togo\", \"Togo (le)\", \"TG\", \"TGO\", \"768\"},\n\t{\"Tokelau\", \"Tokelau (les)\", \"TK\", \"TKL\", \"772\"},\n\t{\"Tonga\", \"Tonga (les)\", \"TO\", \"TON\", \"776\"},\n\t{\"Trinidad and Tobago\", \"Trinité-et-Tobago (la)\", \"TT\", \"TTO\", \"780\"},\n\t{\"United Arab Emirates (the)\", \"Émirats arabes unis (les)\", \"AE\", \"ARE\", \"784\"},\n\t{\"Tunisia\", \"Tunisie (la)\", \"TN\", \"TUN\", \"788\"},\n\t{\"Turkey\", \"Turquie (la)\", \"TR\", \"TUR\", \"792\"},\n\t{\"Turkmenistan\", \"Turkménistan (le)\", \"TM\", \"TKM\", \"795\"},\n\t{\"Turks and Caicos Islands (the)\", \"Turks-et-Caïcos (les Îles)\", \"TC\", \"TCA\", \"796\"},\n\t{\"Tuvalu\", \"Tuvalu (les)\", \"TV\", \"TUV\", \"798\"},\n\t{\"Uganda\", \"Ouganda (l')\", \"UG\", \"UGA\", \"800\"},\n\t{\"Ukraine\", \"Ukraine (l')\", \"UA\", \"UKR\", \"804\"},\n\t{\"Macedonia (the former Yugoslav Republic of)\", \"Macédoine (l'ex‑République yougoslave de)\", \"MK\", \"MKD\", \"807\"},\n\t{\"Egypt\", \"Égypte (l')\", \"EG\", \"EGY\", \"818\"},\n\t{\"United Kingdom of Great Britain and Northern Ireland (the)\", \"Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)\", \"GB\", \"GBR\", \"826\"},\n\t{\"Guernsey\", \"Guernesey\", \"GG\", \"GGY\", \"831\"},\n\t{\"Jersey\", \"Jersey\", \"JE\", \"JEY\", \"832\"},\n\t{\"Isle of Man\", \"Île de Man\", \"IM\", \"IMN\", \"833\"},\n\t{\"Tanzania, United Republic of\", \"Tanzanie, République-Unie de\", \"TZ\", \"TZA\", \"834\"},\n\t{\"United States of America (the)\", \"États-Unis d'Amérique (les)\", \"US\", \"USA\", \"840\"},\n\t{\"Virgin Islands (U.S.)\", \"Vierges des États-Unis (les Îles)\", \"VI\", \"VIR\", \"850\"},\n\t{\"Burkina Faso\", \"Burkina Faso (le)\", \"BF\", \"BFA\", \"854\"},\n\t{\"Uruguay\", \"Uruguay (l')\", \"UY\", \"URY\", \"858\"},\n\t{\"Uzbekistan\", \"Ouzbékistan (l')\", \"UZ\", \"UZB\", \"860\"},\n\t{\"Venezuela (Bolivarian Republic of)\", \"Venezuela (République bolivarienne du)\", \"VE\", \"VEN\", \"862\"},\n\t{\"Wallis and Futuna\", \"Wallis-et-Futuna\", \"WF\", \"WLF\", \"876\"},\n\t{\"Samoa\", \"Samoa (le)\", \"WS\", \"WSM\", \"882\"},\n\t{\"Yemen\", \"Yémen (le)\", \"YE\", \"YEM\", \"887\"},\n\t{\"Zambia\", \"Zambie (la)\", \"ZM\", \"ZMB\", \"894\"},\n}\n\n// ISO4217List is the list of ISO currency codes\nvar ISO4217List = []string{\n\t\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\",\n\t\"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYN\", \"BZD\",\n\t\"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\",\n\t\"DJF\", \"DKK\", \"DOP\", \"DZD\",\n\t\"EGP\", \"ERN\", \"ETB\", \"EUR\",\n\t\"FJD\", \"FKP\",\n\t\"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\",\n\t\"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\",\n\t\"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\",\n\t\"JMD\", \"JOD\", \"JPY\",\n\t\"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\",\n\t\"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LYD\",\n\t\"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\",\n\t\"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\",\n\t\"OMR\",\n\t\"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\",\n\t\"QAR\",\n\t\"RON\", \"RSD\", \"RUB\", \"RWF\",\n\t\"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"STN\", \"SVC\", \"SYP\", \"SZL\",\n\t\"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\",\n\t\"UAH\", \"UGX\", \"USD\", \"USN\", \"UYI\", \"UYU\", \"UYW\", \"UZS\",\n\t\"VEF\", \"VES\", \"VND\", \"VUV\",\n\t\"WST\",\n\t\"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XSU\", \"XTS\", \"XUA\", \"XXX\",\n\t\"YER\",\n\t\"ZAR\", \"ZMW\", \"ZWL\",\n}\n\n// ISO693Entry stores ISO language codes\ntype ISO693Entry struct {\n\tAlpha3bCode string\n\tAlpha2Code  string\n\tEnglish     string\n}\n\n//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json\nvar ISO693List = []ISO693Entry{\n\t{Alpha3bCode: \"aar\", Alpha2Code: \"aa\", English: \"Afar\"},\n\t{Alpha3bCode: \"abk\", Alpha2Code: \"ab\", English: \"Abkhazian\"},\n\t{Alpha3bCode: \"afr\", Alpha2Code: \"af\", English: \"Afrikaans\"},\n\t{Alpha3bCode: \"aka\", Alpha2Code: \"ak\", English: \"Akan\"},\n\t{Alpha3bCode: \"alb\", Alpha2Code: \"sq\", English: \"Albanian\"},\n\t{Alpha3bCode: \"amh\", Alpha2Code: \"am\", English: \"Amharic\"},\n\t{Alpha3bCode: \"ara\", Alpha2Code: \"ar\", English: \"Arabic\"},\n\t{Alpha3bCode: \"arg\", Alpha2Code: \"an\", English: \"Aragonese\"},\n\t{Alpha3bCode: \"arm\", Alpha2Code: \"hy\", English: \"Armenian\"},\n\t{Alpha3bCode: \"asm\", Alpha2Code: \"as\", English: \"Assamese\"},\n\t{Alpha3bCode: \"ava\", Alpha2Code: \"av\", English: \"Avaric\"},\n\t{Alpha3bCode: \"ave\", Alpha2Code: \"ae\", English: \"Avestan\"},\n\t{Alpha3bCode: \"aym\", Alpha2Code: \"ay\", English: \"Aymara\"},\n\t{Alpha3bCode: \"aze\", Alpha2Code: \"az\", English: \"Azerbaijani\"},\n\t{Alpha3bCode: \"bak\", Alpha2Code: \"ba\", English: \"Bashkir\"},\n\t{Alpha3bCode: \"bam\", Alpha2Code: \"bm\", English: \"Bambara\"},\n\t{Alpha3bCode: \"baq\", Alpha2Code: \"eu\", English: \"Basque\"},\n\t{Alpha3bCode: \"bel\", Alpha2Code: \"be\", English: \"Belarusian\"},\n\t{Alpha3bCode: \"ben\", Alpha2Code: \"bn\", English: \"Bengali\"},\n\t{Alpha3bCode: \"bih\", Alpha2Code: \"bh\", English: \"Bihari languages\"},\n\t{Alpha3bCode: \"bis\", Alpha2Code: \"bi\", English: \"Bislama\"},\n\t{Alpha3bCode: \"bos\", Alpha2Code: \"bs\", English: \"Bosnian\"},\n\t{Alpha3bCode: \"bre\", Alpha2Code: \"br\", English: \"Breton\"},\n\t{Alpha3bCode: \"bul\", Alpha2Code: \"bg\", English: \"Bulgarian\"},\n\t{Alpha3bCode: \"bur\", Alpha2Code: \"my\", English: \"Burmese\"},\n\t{Alpha3bCode: \"cat\", Alpha2Code: \"ca\", English: \"Catalan; Valencian\"},\n\t{Alpha3bCode: \"cha\", Alpha2Code: \"ch\", English: \"Chamorro\"},\n\t{Alpha3bCode: \"che\", Alpha2Code: \"ce\", English: \"Chechen\"},\n\t{Alpha3bCode: \"chi\", Alpha2Code: \"zh\", English: \"Chinese\"},\n\t{Alpha3bCode: \"chu\", Alpha2Code: \"cu\", English: \"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic\"},\n\t{Alpha3bCode: \"chv\", Alpha2Code: \"cv\", English: \"Chuvash\"},\n\t{Alpha3bCode: \"cor\", Alpha2Code: \"kw\", English: \"Cornish\"},\n\t{Alpha3bCode: \"cos\", Alpha2Code: \"co\", English: \"Corsican\"},\n\t{Alpha3bCode: \"cre\", Alpha2Code: \"cr\", English: \"Cree\"},\n\t{Alpha3bCode: \"cze\", Alpha2Code: \"cs\", English: \"Czech\"},\n\t{Alpha3bCode: \"dan\", Alpha2Code: \"da\", English: \"Danish\"},\n\t{Alpha3bCode: \"div\", Alpha2Code: \"dv\", English: \"Divehi; Dhivehi; Maldivian\"},\n\t{Alpha3bCode: \"dut\", Alpha2Code: \"nl\", English: \"Dutch; Flemish\"},\n\t{Alpha3bCode: \"dzo\", Alpha2Code: \"dz\", English: \"Dzongkha\"},\n\t{Alpha3bCode: \"eng\", Alpha2Code: \"en\", English: \"English\"},\n\t{Alpha3bCode: \"epo\", Alpha2Code: \"eo\", English: \"Esperanto\"},\n\t{Alpha3bCode: \"est\", Alpha2Code: \"et\", English: \"Estonian\"},\n\t{Alpha3bCode: \"ewe\", Alpha2Code: \"ee\", English: \"Ewe\"},\n\t{Alpha3bCode: \"fao\", Alpha2Code: \"fo\", English: \"Faroese\"},\n\t{Alpha3bCode: \"fij\", Alpha2Code: \"fj\", English: \"Fijian\"},\n\t{Alpha3bCode: \"fin\", Alpha2Code: \"fi\", English: \"Finnish\"},\n\t{Alpha3bCode: \"fre\", Alpha2Code: \"fr\", English: \"French\"},\n\t{Alpha3bCode: \"fry\", Alpha2Code: \"fy\", English: \"Western Frisian\"},\n\t{Alpha3bCode: \"ful\", Alpha2Code: \"ff\", English: \"Fulah\"},\n\t{Alpha3bCode: \"geo\", Alpha2Code: \"ka\", English: \"Georgian\"},\n\t{Alpha3bCode: \"ger\", Alpha2Code: \"de\", English: \"German\"},\n\t{Alpha3bCode: \"gla\", Alpha2Code: \"gd\", English: \"Gaelic; Scottish Gaelic\"},\n\t{Alpha3bCode: \"gle\", Alpha2Code: \"ga\", English: \"Irish\"},\n\t{Alpha3bCode: \"glg\", Alpha2Code: \"gl\", English: \"Galician\"},\n\t{Alpha3bCode: \"glv\", Alpha2Code: \"gv\", English: \"Manx\"},\n\t{Alpha3bCode: \"gre\", Alpha2Code: \"el\", English: \"Greek, Modern (1453-)\"},\n\t{Alpha3bCode: \"grn\", Alpha2Code: \"gn\", English: \"Guarani\"},\n\t{Alpha3bCode: \"guj\", Alpha2Code: \"gu\", English: \"Gujarati\"},\n\t{Alpha3bCode: \"hat\", Alpha2Code: \"ht\", English: \"Haitian; Haitian Creole\"},\n\t{Alpha3bCode: \"hau\", Alpha2Code: \"ha\", English: \"Hausa\"},\n\t{Alpha3bCode: \"heb\", Alpha2Code: \"he\", English: \"Hebrew\"},\n\t{Alpha3bCode: \"her\", Alpha2Code: \"hz\", English: \"Herero\"},\n\t{Alpha3bCode: \"hin\", Alpha2Code: \"hi\", English: \"Hindi\"},\n\t{Alpha3bCode: \"hmo\", Alpha2Code: \"ho\", English: \"Hiri Motu\"},\n\t{Alpha3bCode: \"hrv\", Alpha2Code: \"hr\", English: \"Croatian\"},\n\t{Alpha3bCode: \"hun\", Alpha2Code: \"hu\", English: \"Hungarian\"},\n\t{Alpha3bCode: \"ibo\", Alpha2Code: \"ig\", English: \"Igbo\"},\n\t{Alpha3bCode: \"ice\", Alpha2Code: \"is\", English: \"Icelandic\"},\n\t{Alpha3bCode: \"ido\", Alpha2Code: \"io\", English: \"Ido\"},\n\t{Alpha3bCode: \"iii\", Alpha2Code: \"ii\", English: \"Sichuan Yi; Nuosu\"},\n\t{Alpha3bCode: \"iku\", Alpha2Code: \"iu\", English: \"Inuktitut\"},\n\t{Alpha3bCode: \"ile\", Alpha2Code: \"ie\", English: \"Interlingue; Occidental\"},\n\t{Alpha3bCode: \"ina\", Alpha2Code: \"ia\", English: \"Interlingua (International Auxiliary Language Association)\"},\n\t{Alpha3bCode: \"ind\", Alpha2Code: \"id\", English: \"Indonesian\"},\n\t{Alpha3bCode: \"ipk\", Alpha2Code: \"ik\", English: \"Inupiaq\"},\n\t{Alpha3bCode: \"ita\", Alpha2Code: \"it\", English: \"Italian\"},\n\t{Alpha3bCode: \"jav\", Alpha2Code: \"jv\", English: \"Javanese\"},\n\t{Alpha3bCode: \"jpn\", Alpha2Code: \"ja\", English: \"Japanese\"},\n\t{Alpha3bCode: \"kal\", Alpha2Code: \"kl\", English: \"Kalaallisut; Greenlandic\"},\n\t{Alpha3bCode: \"kan\", Alpha2Code: \"kn\", English: \"Kannada\"},\n\t{Alpha3bCode: \"kas\", Alpha2Code: \"ks\", English: \"Kashmiri\"},\n\t{Alpha3bCode: \"kau\", Alpha2Code: \"kr\", English: \"Kanuri\"},\n\t{Alpha3bCode: \"kaz\", Alpha2Code: \"kk\", English: \"Kazakh\"},\n\t{Alpha3bCode: \"khm\", Alpha2Code: \"km\", English: \"Central Khmer\"},\n\t{Alpha3bCode: \"kik\", Alpha2Code: \"ki\", English: \"Kikuyu; Gikuyu\"},\n\t{Alpha3bCode: \"kin\", Alpha2Code: \"rw\", English: \"Kinyarwanda\"},\n\t{Alpha3bCode: \"kir\", Alpha2Code: \"ky\", English: \"Kirghiz; Kyrgyz\"},\n\t{Alpha3bCode: \"kom\", Alpha2Code: \"kv\", English: \"Komi\"},\n\t{Alpha3bCode: \"kon\", Alpha2Code: \"kg\", English: \"Kongo\"},\n\t{Alpha3bCode: \"kor\", Alpha2Code: \"ko\", English: \"Korean\"},\n\t{Alpha3bCode: \"kua\", Alpha2Code: \"kj\", English: \"Kuanyama; Kwanyama\"},\n\t{Alpha3bCode: \"kur\", Alpha2Code: \"ku\", English: \"Kurdish\"},\n\t{Alpha3bCode: \"lao\", Alpha2Code: \"lo\", English: \"Lao\"},\n\t{Alpha3bCode: \"lat\", Alpha2Code: \"la\", English: \"Latin\"},\n\t{Alpha3bCode: \"lav\", Alpha2Code: \"lv\", English: \"Latvian\"},\n\t{Alpha3bCode: \"lim\", Alpha2Code: \"li\", English: \"Limburgan; Limburger; Limburgish\"},\n\t{Alpha3bCode: \"lin\", Alpha2Code: \"ln\", English: \"Lingala\"},\n\t{Alpha3bCode: \"lit\", Alpha2Code: \"lt\", English: \"Lithuanian\"},\n\t{Alpha3bCode: \"ltz\", Alpha2Code: \"lb\", English: \"Luxembourgish; Letzeburgesch\"},\n\t{Alpha3bCode: \"lub\", Alpha2Code: \"lu\", English: \"Luba-Katanga\"},\n\t{Alpha3bCode: \"lug\", Alpha2Code: \"lg\", English: \"Ganda\"},\n\t{Alpha3bCode: \"mac\", Alpha2Code: \"mk\", English: \"Macedonian\"},\n\t{Alpha3bCode: \"mah\", Alpha2Code: \"mh\", English: \"Marshallese\"},\n\t{Alpha3bCode: \"mal\", Alpha2Code: \"ml\", English: \"Malayalam\"},\n\t{Alpha3bCode: \"mao\", Alpha2Code: \"mi\", English: \"Maori\"},\n\t{Alpha3bCode: \"mar\", Alpha2Code: \"mr\", English: \"Marathi\"},\n\t{Alpha3bCode: \"may\", Alpha2Code: \"ms\", English: \"Malay\"},\n\t{Alpha3bCode: \"mlg\", Alpha2Code: \"mg\", English: \"Malagasy\"},\n\t{Alpha3bCode: \"mlt\", Alpha2Code: \"mt\", English: \"Maltese\"},\n\t{Alpha3bCode: \"mon\", Alpha2Code: \"mn\", English: \"Mongolian\"},\n\t{Alpha3bCode: \"nau\", Alpha2Code: \"na\", English: \"Nauru\"},\n\t{Alpha3bCode: \"nav\", Alpha2Code: \"nv\", English: \"Navajo; Navaho\"},\n\t{Alpha3bCode: \"nbl\", Alpha2Code: \"nr\", English: \"Ndebele, South; South Ndebele\"},\n\t{Alpha3bCode: \"nde\", Alpha2Code: \"nd\", English: \"Ndebele, North; North Ndebele\"},\n\t{Alpha3bCode: \"ndo\", Alpha2Code: \"ng\", English: \"Ndonga\"},\n\t{Alpha3bCode: \"nep\", Alpha2Code: \"ne\", English: \"Nepali\"},\n\t{Alpha3bCode: \"nno\", Alpha2Code: \"nn\", English: \"Norwegian Nynorsk; Nynorsk, Norwegian\"},\n\t{Alpha3bCode: \"nob\", Alpha2Code: \"nb\", English: \"Bokmål, Norwegian; Norwegian Bokmål\"},\n\t{Alpha3bCode: \"nor\", Alpha2Code: \"no\", English: \"Norwegian\"},\n\t{Alpha3bCode: \"nya\", Alpha2Code: \"ny\", English: \"Chichewa; Chewa; Nyanja\"},\n\t{Alpha3bCode: \"oci\", Alpha2Code: \"oc\", English: \"Occitan (post 1500); Provençal\"},\n\t{Alpha3bCode: \"oji\", Alpha2Code: \"oj\", English: \"Ojibwa\"},\n\t{Alpha3bCode: \"ori\", Alpha2Code: \"or\", English: \"Oriya\"},\n\t{Alpha3bCode: \"orm\", Alpha2Code: \"om\", English: \"Oromo\"},\n\t{Alpha3bCode: \"oss\", Alpha2Code: \"os\", English: \"Ossetian; Ossetic\"},\n\t{Alpha3bCode: \"pan\", Alpha2Code: \"pa\", English: \"Panjabi; Punjabi\"},\n\t{Alpha3bCode: \"per\", Alpha2Code: \"fa\", English: \"Persian\"},\n\t{Alpha3bCode: \"pli\", Alpha2Code: \"pi\", English: \"Pali\"},\n\t{Alpha3bCode: \"pol\", Alpha2Code: \"pl\", English: \"Polish\"},\n\t{Alpha3bCode: \"por\", Alpha2Code: \"pt\", English: \"Portuguese\"},\n\t{Alpha3bCode: \"pus\", Alpha2Code: \"ps\", English: \"Pushto; Pashto\"},\n\t{Alpha3bCode: \"que\", Alpha2Code: \"qu\", English: \"Quechua\"},\n\t{Alpha3bCode: \"roh\", Alpha2Code: \"rm\", English: \"Romansh\"},\n\t{Alpha3bCode: \"rum\", Alpha2Code: \"ro\", English: \"Romanian; Moldavian; Moldovan\"},\n\t{Alpha3bCode: \"run\", Alpha2Code: \"rn\", English: \"Rundi\"},\n\t{Alpha3bCode: \"rus\", Alpha2Code: \"ru\", English: \"Russian\"},\n\t{Alpha3bCode: \"sag\", Alpha2Code: \"sg\", English: \"Sango\"},\n\t{Alpha3bCode: \"san\", Alpha2Code: \"sa\", English: \"Sanskrit\"},\n\t{Alpha3bCode: \"sin\", Alpha2Code: \"si\", English: \"Sinhala; Sinhalese\"},\n\t{Alpha3bCode: \"slo\", Alpha2Code: \"sk\", English: \"Slovak\"},\n\t{Alpha3bCode: \"slv\", Alpha2Code: \"sl\", English: \"Slovenian\"},\n\t{Alpha3bCode: \"sme\", Alpha2Code: \"se\", English: \"Northern Sami\"},\n\t{Alpha3bCode: \"smo\", Alpha2Code: \"sm\", English: \"Samoan\"},\n\t{Alpha3bCode: \"sna\", Alpha2Code: \"sn\", English: \"Shona\"},\n\t{Alpha3bCode: \"snd\", Alpha2Code: \"sd\", English: \"Sindhi\"},\n\t{Alpha3bCode: \"som\", Alpha2Code: \"so\", English: \"Somali\"},\n\t{Alpha3bCode: \"sot\", Alpha2Code: \"st\", English: \"Sotho, Southern\"},\n\t{Alpha3bCode: \"spa\", Alpha2Code: \"es\", English: \"Spanish; Castilian\"},\n\t{Alpha3bCode: \"srd\", Alpha2Code: \"sc\", English: \"Sardinian\"},\n\t{Alpha3bCode: \"srp\", Alpha2Code: \"sr\", English: \"Serbian\"},\n\t{Alpha3bCode: \"ssw\", Alpha2Code: \"ss\", English: \"Swati\"},\n\t{Alpha3bCode: \"sun\", Alpha2Code: \"su\", English: \"Sundanese\"},\n\t{Alpha3bCode: \"swa\", Alpha2Code: \"sw\", English: \"Swahili\"},\n\t{Alpha3bCode: \"swe\", Alpha2Code: \"sv\", English: \"Swedish\"},\n\t{Alpha3bCode: \"tah\", Alpha2Code: \"ty\", English: \"Tahitian\"},\n\t{Alpha3bCode: \"tam\", Alpha2Code: \"ta\", English: \"Tamil\"},\n\t{Alpha3bCode: \"tat\", Alpha2Code: \"tt\", English: \"Tatar\"},\n\t{Alpha3bCode: \"tel\", Alpha2Code: \"te\", English: \"Telugu\"},\n\t{Alpha3bCode: \"tgk\", Alpha2Code: \"tg\", English: \"Tajik\"},\n\t{Alpha3bCode: \"tgl\", Alpha2Code: \"tl\", English: \"Tagalog\"},\n\t{Alpha3bCode: \"tha\", Alpha2Code: \"th\", English: \"Thai\"},\n\t{Alpha3bCode: \"tib\", Alpha2Code: \"bo\", English: \"Tibetan\"},\n\t{Alpha3bCode: \"tir\", Alpha2Code: \"ti\", English: \"Tigrinya\"},\n\t{Alpha3bCode: \"ton\", Alpha2Code: \"to\", English: \"Tonga (Tonga Islands)\"},\n\t{Alpha3bCode: \"tsn\", Alpha2Code: \"tn\", English: \"Tswana\"},\n\t{Alpha3bCode: \"tso\", Alpha2Code: \"ts\", English: \"Tsonga\"},\n\t{Alpha3bCode: \"tuk\", Alpha2Code: \"tk\", English: \"Turkmen\"},\n\t{Alpha3bCode: \"tur\", Alpha2Code: \"tr\", English: \"Turkish\"},\n\t{Alpha3bCode: \"twi\", Alpha2Code: \"tw\", English: \"Twi\"},\n\t{Alpha3bCode: \"uig\", Alpha2Code: \"ug\", English: \"Uighur; Uyghur\"},\n\t{Alpha3bCode: \"ukr\", Alpha2Code: \"uk\", English: \"Ukrainian\"},\n\t{Alpha3bCode: \"urd\", Alpha2Code: \"ur\", English: \"Urdu\"},\n\t{Alpha3bCode: \"uzb\", Alpha2Code: \"uz\", English: \"Uzbek\"},\n\t{Alpha3bCode: \"ven\", Alpha2Code: \"ve\", English: \"Venda\"},\n\t{Alpha3bCode: \"vie\", Alpha2Code: \"vi\", English: \"Vietnamese\"},\n\t{Alpha3bCode: \"vol\", Alpha2Code: \"vo\", English: \"Volapük\"},\n\t{Alpha3bCode: \"wel\", Alpha2Code: \"cy\", English: \"Welsh\"},\n\t{Alpha3bCode: \"wln\", Alpha2Code: \"wa\", English: \"Walloon\"},\n\t{Alpha3bCode: \"wol\", Alpha2Code: \"wo\", English: \"Wolof\"},\n\t{Alpha3bCode: \"xho\", Alpha2Code: \"xh\", English: \"Xhosa\"},\n\t{Alpha3bCode: \"yid\", Alpha2Code: \"yi\", English: \"Yiddish\"},\n\t{Alpha3bCode: \"yor\", Alpha2Code: \"yo\", English: \"Yoruba\"},\n\t{Alpha3bCode: \"zha\", Alpha2Code: \"za\", English: \"Zhuang; Chuang\"},\n\t{Alpha3bCode: \"zul\", Alpha2Code: \"zu\", English: \"Zulu\"},\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/utils.go",
    "content": "package govalidator\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"html\"\n\t\"math\"\n\t\"path\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n// Contains checks if the string contains the substring.\nfunc Contains(str, substring string) bool {\n\treturn strings.Contains(str, substring)\n}\n\n// Matches checks if string matches the pattern (pattern is regular expression)\n// In case of error return false\nfunc Matches(str, pattern string) bool {\n\tmatch, _ := regexp.MatchString(pattern, str)\n\treturn match\n}\n\n// LeftTrim trims characters from the left side of the input.\n// If second argument is empty, it will remove leading spaces.\nfunc LeftTrim(str, chars string) string {\n\tif chars == \"\" {\n\t\treturn strings.TrimLeftFunc(str, unicode.IsSpace)\n\t}\n\tr, _ := regexp.Compile(\"^[\" + chars + \"]+\")\n\treturn r.ReplaceAllString(str, \"\")\n}\n\n// RightTrim trims characters from the right side of the input.\n// If second argument is empty, it will remove trailing spaces.\nfunc RightTrim(str, chars string) string {\n\tif chars == \"\" {\n\t\treturn strings.TrimRightFunc(str, unicode.IsSpace)\n\t}\n\tr, _ := regexp.Compile(\"[\" + chars + \"]+$\")\n\treturn r.ReplaceAllString(str, \"\")\n}\n\n// Trim trims characters from both sides of the input.\n// If second argument is empty, it will remove spaces.\nfunc Trim(str, chars string) string {\n\treturn LeftTrim(RightTrim(str, chars), chars)\n}\n\n// WhiteList removes characters that do not appear in the whitelist.\nfunc WhiteList(str, chars string) string {\n\tpattern := \"[^\" + chars + \"]+\"\n\tr, _ := regexp.Compile(pattern)\n\treturn r.ReplaceAllString(str, \"\")\n}\n\n// BlackList removes characters that appear in the blacklist.\nfunc BlackList(str, chars string) string {\n\tpattern := \"[\" + chars + \"]+\"\n\tr, _ := regexp.Compile(pattern)\n\treturn r.ReplaceAllString(str, \"\")\n}\n\n// StripLow removes characters with a numerical value < 32 and 127, mostly control characters.\n// If keep_new_lines is true, newline characters are preserved (\\n and \\r, hex 0xA and 0xD).\nfunc StripLow(str string, keepNewLines bool) string {\n\tchars := \"\"\n\tif keepNewLines {\n\t\tchars = \"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F\"\n\t} else {\n\t\tchars = \"\\x00-\\x1F\\x7F\"\n\t}\n\treturn BlackList(str, chars)\n}\n\n// ReplacePattern replaces regular expression pattern in string\nfunc ReplacePattern(str, pattern, replace string) string {\n\tr, _ := regexp.Compile(pattern)\n\treturn r.ReplaceAllString(str, replace)\n}\n\n// Escape replaces <, >, & and \" with HTML entities.\nvar Escape = html.EscapeString\n\nfunc addSegment(inrune, segment []rune) []rune {\n\tif len(segment) == 0 {\n\t\treturn inrune\n\t}\n\tif len(inrune) != 0 {\n\t\tinrune = append(inrune, '_')\n\t}\n\tinrune = append(inrune, segment...)\n\treturn inrune\n}\n\n// UnderscoreToCamelCase converts from underscore separated form to camel case form.\n// Ex.: my_func => MyFunc\nfunc UnderscoreToCamelCase(s string) string {\n\treturn strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), \"_\", \" \", -1)), \" \", \"\", -1)\n}\n\n// CamelCaseToUnderscore converts from camel case form to underscore separated form.\n// Ex.: MyFunc => my_func\nfunc CamelCaseToUnderscore(str string) string {\n\tvar output []rune\n\tvar segment []rune\n\tfor _, r := range str {\n\n\t\t// not treat number as separate segment\n\t\tif !unicode.IsLower(r) && string(r) != \"_\" && !unicode.IsNumber(r) {\n\t\t\toutput = addSegment(output, segment)\n\t\t\tsegment = nil\n\t\t}\n\t\tsegment = append(segment, unicode.ToLower(r))\n\t}\n\toutput = addSegment(output, segment)\n\treturn string(output)\n}\n\n// Reverse returns reversed string\nfunc Reverse(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// GetLines splits string by \"\\n\" and return array of lines\nfunc GetLines(s string) []string {\n\treturn strings.Split(s, \"\\n\")\n}\n\n// GetLine returns specified line of multiline string\nfunc GetLine(s string, index int) (string, error) {\n\tlines := GetLines(s)\n\tif index < 0 || index >= len(lines) {\n\t\treturn \"\", errors.New(\"line index out of bounds\")\n\t}\n\treturn lines[index], nil\n}\n\n// RemoveTags removes all tags from HTML string\nfunc RemoveTags(s string) string {\n\treturn ReplacePattern(s, \"<[^>]*>\", \"\")\n}\n\n// SafeFileName returns safe string that can be used in file names\nfunc SafeFileName(str string) string {\n\tname := strings.ToLower(str)\n\tname = path.Clean(path.Base(name))\n\tname = strings.Trim(name, \" \")\n\tseparators, err := regexp.Compile(`[ &_=+:]`)\n\tif err == nil {\n\t\tname = separators.ReplaceAllString(name, \"-\")\n\t}\n\tlegal, err := regexp.Compile(`[^[:alnum:]-.]`)\n\tif err == nil {\n\t\tname = legal.ReplaceAllString(name, \"\")\n\t}\n\tfor strings.Contains(name, \"--\") {\n\t\tname = strings.Replace(name, \"--\", \"-\", -1)\n\t}\n\treturn name\n}\n\n// NormalizeEmail canonicalize an email address.\n// The local part of the email address is lowercased for all domains; the hostname is always lowercased and\n// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail).\n// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and\n// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are\n// normalized to @gmail.com.\nfunc NormalizeEmail(str string) (string, error) {\n\tif !IsEmail(str) {\n\t\treturn \"\", fmt.Errorf(\"%s is not an email\", str)\n\t}\n\tparts := strings.Split(str, \"@\")\n\tparts[0] = strings.ToLower(parts[0])\n\tparts[1] = strings.ToLower(parts[1])\n\tif parts[1] == \"gmail.com\" || parts[1] == \"googlemail.com\" {\n\t\tparts[1] = \"gmail.com\"\n\t\tparts[0] = strings.Split(ReplacePattern(parts[0], `\\.`, \"\"), \"+\")[0]\n\t}\n\treturn strings.Join(parts, \"@\"), nil\n}\n\n// Truncate a string to the closest length without breaking words.\nfunc Truncate(str string, length int, ending string) string {\n\tvar aftstr, befstr string\n\tif len(str) > length {\n\t\twords := strings.Fields(str)\n\t\tbefore, present := 0, 0\n\t\tfor i := range words {\n\t\t\tbefstr = aftstr\n\t\t\tbefore = present\n\t\t\taftstr = aftstr + words[i] + \" \"\n\t\t\tpresent = len(aftstr)\n\t\t\tif present > length && i != 0 {\n\t\t\t\tif (length - before) < (present - length) {\n\t\t\t\t\treturn Trim(befstr, \" /\\\\.,\\\"'#!?&@+-\") + ending\n\t\t\t\t}\n\t\t\t\treturn Trim(aftstr, \" /\\\\.,\\\"'#!?&@+-\") + ending\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str\n}\n\n// PadLeft pads left side of a string if size of string is less then indicated pad length\nfunc PadLeft(str string, padStr string, padLen int) string {\n\treturn buildPadStr(str, padStr, padLen, true, false)\n}\n\n// PadRight pads right side of a string if size of string is less then indicated pad length\nfunc PadRight(str string, padStr string, padLen int) string {\n\treturn buildPadStr(str, padStr, padLen, false, true)\n}\n\n// PadBoth pads both sides of a string if size of string is less then indicated pad length\nfunc PadBoth(str string, padStr string, padLen int) string {\n\treturn buildPadStr(str, padStr, padLen, true, true)\n}\n\n// PadString either left, right or both sides.\n// Note that padding string can be unicode and more then one character\nfunc buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string {\n\n\t// When padded length is less then the current string size\n\tif padLen < utf8.RuneCountInString(str) {\n\t\treturn str\n\t}\n\n\tpadLen -= utf8.RuneCountInString(str)\n\n\ttargetLen := padLen\n\n\ttargetLenLeft := targetLen\n\ttargetLenRight := targetLen\n\tif padLeft && padRight {\n\t\ttargetLenLeft = padLen / 2\n\t\ttargetLenRight = padLen - targetLenLeft\n\t}\n\n\tstrToRepeatLen := utf8.RuneCountInString(padStr)\n\n\trepeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen)))\n\trepeatedString := strings.Repeat(padStr, repeatTimes)\n\n\tleftSide := \"\"\n\tif padLeft {\n\t\tleftSide = repeatedString[0:targetLenLeft]\n\t}\n\n\trightSide := \"\"\n\tif padRight {\n\t\trightSide = repeatedString[0:targetLenRight]\n\t}\n\n\treturn leftSide + str + rightSide\n}\n\n// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object\nfunc TruncatingErrorf(str string, args ...interface{}) error {\n\tn := strings.Count(str, \"%s\")\n\treturn fmt.Errorf(str, args[:n]...)\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/validator.go",
    "content": "// Package govalidator is package of validators and sanitizers for strings, structs and collections.\npackage govalidator\n\nimport (\n\t\"bytes\"\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"encoding/pem\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nvar (\n\tfieldsRequiredByDefault bool\n\tnilPtrAllowedByRequired = false\n\tnotNumberRegexp         = regexp.MustCompile(\"[^0-9]+\")\n\twhiteSpacesAndMinus     = regexp.MustCompile(`[\\s-]+`)\n\tparamsRegexp            = regexp.MustCompile(`\\(.*\\)$`)\n)\n\nconst maxURLRuneCount = 2083\nconst minURLRuneCount = 3\nconst rfc3339WithoutZone = \"2006-01-02T15:04:05\"\n\n// SetFieldsRequiredByDefault causes validation to fail when struct fields\n// do not include validations or are not explicitly marked as exempt (using `valid:\"-\"` or `valid:\"email,optional\"`).\n// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):\n//     type exampleStruct struct {\n//         Name  string ``\n//         Email string `valid:\"email\"`\n// This, however, will only fail when Email is empty or an invalid email address:\n//     type exampleStruct2 struct {\n//         Name  string `valid:\"-\"`\n//         Email string `valid:\"email\"`\n// Lastly, this will only fail when Email is an invalid email address but not when it's empty:\n//     type exampleStruct2 struct {\n//         Name  string `valid:\"-\"`\n//         Email string `valid:\"email,optional\"`\nfunc SetFieldsRequiredByDefault(value bool) {\n\tfieldsRequiredByDefault = value\n}\n\n// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required.\n// The validation will still reject ptr fields in their zero value state. Example with this enabled:\n//     type exampleStruct struct {\n//         Name  *string `valid:\"required\"`\n// With `Name` set to \"\", this will be considered invalid input and will cause a validation error.\n// With `Name` set to nil, this will be considered valid by validation.\n// By default this is disabled.\nfunc SetNilPtrAllowedByRequired(value bool) {\n\tnilPtrAllowedByRequired = value\n}\n\n// IsEmail checks if the string is an email.\nfunc IsEmail(str string) bool {\n\t// TODO uppercase letters are not supported\n\treturn rxEmail.MatchString(str)\n}\n\n// IsExistingEmail checks if the string is an email of existing domain\nfunc IsExistingEmail(email string) bool {\n\n\tif len(email) < 6 || len(email) > 254 {\n\t\treturn false\n\t}\n\tat := strings.LastIndex(email, \"@\")\n\tif at <= 0 || at > len(email)-3 {\n\t\treturn false\n\t}\n\tuser := email[:at]\n\thost := email[at+1:]\n\tif len(user) > 64 {\n\t\treturn false\n\t}\n\tswitch host {\n\tcase \"localhost\", \"example.com\":\n\t\treturn true\n\t}\n\tif userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) {\n\t\treturn false\n\t}\n\tif _, err := net.LookupMX(host); err != nil {\n\t\tif _, err := net.LookupIP(host); err != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// IsURL checks if the string is an URL.\nfunc IsURL(str string) bool {\n\tif str == \"\" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, \".\") {\n\t\treturn false\n\t}\n\tstrTemp := str\n\tif strings.Contains(str, \":\") && !strings.Contains(str, \"://\") {\n\t\t// support no indicated urlscheme but with colon for port number\n\t\t// http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString\n\t\tstrTemp = \"http://\" + str\n\t}\n\tu, err := url.Parse(strTemp)\n\tif err != nil {\n\t\treturn false\n\t}\n\tif strings.HasPrefix(u.Host, \".\") {\n\t\treturn false\n\t}\n\tif u.Host == \"\" && (u.Path != \"\" && !strings.Contains(u.Path, \".\")) {\n\t\treturn false\n\t}\n\treturn rxURL.MatchString(str)\n}\n\n// IsRequestURL checks if the string rawurl, assuming\n// it was received in an HTTP request, is a valid\n// URL confirm to RFC 3986\nfunc IsRequestURL(rawurl string) bool {\n\turl, err := url.ParseRequestURI(rawurl)\n\tif err != nil {\n\t\treturn false //Couldn't even parse the rawurl\n\t}\n\tif len(url.Scheme) == 0 {\n\t\treturn false //No Scheme found\n\t}\n\treturn true\n}\n\n// IsRequestURI checks if the string rawurl, assuming\n// it was received in an HTTP request, is an\n// absolute URI or an absolute path.\nfunc IsRequestURI(rawurl string) bool {\n\t_, err := url.ParseRequestURI(rawurl)\n\treturn err == nil\n}\n\n// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid.\nfunc IsAlpha(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxAlpha.MatchString(str)\n}\n\n//IsUTFLetter checks if the string contains only unicode letter characters.\n//Similar to IsAlpha but for all languages. Empty string is valid.\nfunc IsUTFLetter(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\n\tfor _, c := range str {\n\t\tif !unicode.IsLetter(c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\n}\n\n// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid.\nfunc IsAlphanumeric(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxAlphanumeric.MatchString(str)\n}\n\n// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid.\nfunc IsUTFLetterNumeric(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\tfor _, c := range str {\n\t\tif !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\n}\n\n// IsNumeric checks if the string contains only numbers. Empty string is valid.\nfunc IsNumeric(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxNumeric.MatchString(str)\n}\n\n// IsUTFNumeric checks if the string contains only unicode numbers of any kind.\n// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid.\nfunc IsUTFNumeric(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\tif strings.IndexAny(str, \"+-\") > 0 {\n\t\treturn false\n\t}\n\tif len(str) > 1 {\n\t\tstr = strings.TrimPrefix(str, \"-\")\n\t\tstr = strings.TrimPrefix(str, \"+\")\n\t}\n\tfor _, c := range str {\n\t\tif !unicode.IsNumber(c) { //numbers && minus sign are ok\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\n}\n\n// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid.\nfunc IsUTFDigit(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\tif strings.IndexAny(str, \"+-\") > 0 {\n\t\treturn false\n\t}\n\tif len(str) > 1 {\n\t\tstr = strings.TrimPrefix(str, \"-\")\n\t\tstr = strings.TrimPrefix(str, \"+\")\n\t}\n\tfor _, c := range str {\n\t\tif !unicode.IsDigit(c) { //digits && minus sign are ok\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\n}\n\n// IsHexadecimal checks if the string is a hexadecimal number.\nfunc IsHexadecimal(str string) bool {\n\treturn rxHexadecimal.MatchString(str)\n}\n\n// IsHexcolor checks if the string is a hexadecimal color.\nfunc IsHexcolor(str string) bool {\n\treturn rxHexcolor.MatchString(str)\n}\n\n// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB).\nfunc IsRGBcolor(str string) bool {\n\treturn rxRGBcolor.MatchString(str)\n}\n\n// IsLowerCase checks if the string is lowercase. Empty string is valid.\nfunc IsLowerCase(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn str == strings.ToLower(str)\n}\n\n// IsUpperCase checks if the string is uppercase. Empty string is valid.\nfunc IsUpperCase(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn str == strings.ToUpper(str)\n}\n\n// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid.\nfunc HasLowerCase(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxHasLowerCase.MatchString(str)\n}\n\n// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid.\nfunc HasUpperCase(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxHasUpperCase.MatchString(str)\n}\n\n// IsInt checks if the string is an integer. Empty string is valid.\nfunc IsInt(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxInt.MatchString(str)\n}\n\n// IsFloat checks if the string is a float.\nfunc IsFloat(str string) bool {\n\treturn str != \"\" && rxFloat.MatchString(str)\n}\n\n// IsDivisibleBy checks if the string is a number that's divisible by another.\n// If second argument is not valid integer or zero, it's return false.\n// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero).\nfunc IsDivisibleBy(str, num string) bool {\n\tf, _ := ToFloat(str)\n\tp := int64(f)\n\tq, _ := ToInt(num)\n\tif q == 0 {\n\t\treturn false\n\t}\n\treturn (p == 0) || (p%q == 0)\n}\n\n// IsNull checks if the string is null.\nfunc IsNull(str string) bool {\n\treturn len(str) == 0\n}\n\n// IsNotNull checks if the string is not null.\nfunc IsNotNull(str string) bool {\n\treturn !IsNull(str)\n}\n\n// HasWhitespaceOnly checks the string only contains whitespace\nfunc HasWhitespaceOnly(str string) bool {\n\treturn len(str) > 0 && rxHasWhitespaceOnly.MatchString(str)\n}\n\n// HasWhitespace checks if the string contains any whitespace\nfunc HasWhitespace(str string) bool {\n\treturn len(str) > 0 && rxHasWhitespace.MatchString(str)\n}\n\n// IsByteLength checks if the string's length (in bytes) falls in a range.\nfunc IsByteLength(str string, min, max int) bool {\n\treturn len(str) >= min && len(str) <= max\n}\n\n// IsUUIDv3 checks if the string is a UUID version 3.\nfunc IsUUIDv3(str string) bool {\n\treturn rxUUID3.MatchString(str)\n}\n\n// IsUUIDv4 checks if the string is a UUID version 4.\nfunc IsUUIDv4(str string) bool {\n\treturn rxUUID4.MatchString(str)\n}\n\n// IsUUIDv5 checks if the string is a UUID version 5.\nfunc IsUUIDv5(str string) bool {\n\treturn rxUUID5.MatchString(str)\n}\n\n// IsUUID checks if the string is a UUID (version 3, 4 or 5).\nfunc IsUUID(str string) bool {\n\treturn rxUUID.MatchString(str)\n}\n\n// Byte to index table for O(1) lookups when unmarshaling.\n// We use 0xFF as sentinel value for invalid indexes.\nvar ulidDec = [...]byte{\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01,\n\t0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,\n\t0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF,\n\t0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E,\n\t0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C,\n\t0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14,\n\t0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C,\n\t0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n}\n\n// EncodedSize is the length of a text encoded ULID.\nconst ulidEncodedSize = 26\n\n// IsULID checks if the string is a ULID.\n//\n// Implementation got from:\n//   https://github.com/oklog/ulid (Apache-2.0 License)\n//\nfunc IsULID(str string) bool {\n\t// Check if a base32 encoded ULID is the right length.\n\tif len(str) != ulidEncodedSize {\n\t\treturn false\n\t}\n\n\t// Check if all the characters in a base32 encoded ULID are part of the\n\t// expected base32 character set.\n\tif ulidDec[str[0]] == 0xFF ||\n\t\tulidDec[str[1]] == 0xFF ||\n\t\tulidDec[str[2]] == 0xFF ||\n\t\tulidDec[str[3]] == 0xFF ||\n\t\tulidDec[str[4]] == 0xFF ||\n\t\tulidDec[str[5]] == 0xFF ||\n\t\tulidDec[str[6]] == 0xFF ||\n\t\tulidDec[str[7]] == 0xFF ||\n\t\tulidDec[str[8]] == 0xFF ||\n\t\tulidDec[str[9]] == 0xFF ||\n\t\tulidDec[str[10]] == 0xFF ||\n\t\tulidDec[str[11]] == 0xFF ||\n\t\tulidDec[str[12]] == 0xFF ||\n\t\tulidDec[str[13]] == 0xFF ||\n\t\tulidDec[str[14]] == 0xFF ||\n\t\tulidDec[str[15]] == 0xFF ||\n\t\tulidDec[str[16]] == 0xFF ||\n\t\tulidDec[str[17]] == 0xFF ||\n\t\tulidDec[str[18]] == 0xFF ||\n\t\tulidDec[str[19]] == 0xFF ||\n\t\tulidDec[str[20]] == 0xFF ||\n\t\tulidDec[str[21]] == 0xFF ||\n\t\tulidDec[str[22]] == 0xFF ||\n\t\tulidDec[str[23]] == 0xFF ||\n\t\tulidDec[str[24]] == 0xFF ||\n\t\tulidDec[str[25]] == 0xFF {\n\t\treturn false\n\t}\n\n\t// Check if the first character in a base32 encoded ULID will overflow. This\n\t// happens because the base32 representation encodes 130 bits, while the\n\t// ULID is only 128 bits.\n\t//\n\t// See https://github.com/oklog/ulid/issues/9 for details.\n\tif str[0] > '7' {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// IsCreditCard checks if the string is a credit card.\nfunc IsCreditCard(str string) bool {\n\tsanitized := whiteSpacesAndMinus.ReplaceAllString(str, \"\")\n\tif !rxCreditCard.MatchString(sanitized) {\n\t\treturn false\n\t}\n\t\n\tnumber, _ := ToInt(sanitized)\n\tnumber, lastDigit := number / 10, number % 10\t\n\n\tvar sum int64\n\tfor i:=0; number > 0; i++ {\n\t\tdigit := number % 10\n\t\t\n\t\tif i % 2 == 0 {\n\t\t\tdigit *= 2\n\t\t\tif digit > 9 {\n\t\t\t\tdigit -= 9\n\t\t\t}\n\t\t}\n\t\t\n\t\tsum += digit\n\t\tnumber = number / 10\n\t}\n\t\n\treturn (sum + lastDigit) % 10 == 0\n}\n\n// IsISBN10 checks if the string is an ISBN version 10.\nfunc IsISBN10(str string) bool {\n\treturn IsISBN(str, 10)\n}\n\n// IsISBN13 checks if the string is an ISBN version 13.\nfunc IsISBN13(str string) bool {\n\treturn IsISBN(str, 13)\n}\n\n// IsISBN checks if the string is an ISBN (version 10 or 13).\n// If version value is not equal to 10 or 13, it will be checks both variants.\nfunc IsISBN(str string, version int) bool {\n\tsanitized := whiteSpacesAndMinus.ReplaceAllString(str, \"\")\n\tvar checksum int32\n\tvar i int32\n\tif version == 10 {\n\t\tif !rxISBN10.MatchString(sanitized) {\n\t\t\treturn false\n\t\t}\n\t\tfor i = 0; i < 9; i++ {\n\t\t\tchecksum += (i + 1) * int32(sanitized[i]-'0')\n\t\t}\n\t\tif sanitized[9] == 'X' {\n\t\t\tchecksum += 10 * 10\n\t\t} else {\n\t\t\tchecksum += 10 * int32(sanitized[9]-'0')\n\t\t}\n\t\tif checksum%11 == 0 {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if version == 13 {\n\t\tif !rxISBN13.MatchString(sanitized) {\n\t\t\treturn false\n\t\t}\n\t\tfactor := []int32{1, 3}\n\t\tfor i = 0; i < 12; i++ {\n\t\t\tchecksum += factor[i%2] * int32(sanitized[i]-'0')\n\t\t}\n\t\treturn (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0\n\t}\n\treturn IsISBN(str, 10) || IsISBN(str, 13)\n}\n\n// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal).\nfunc IsJSON(str string) bool {\n\tvar js json.RawMessage\n\treturn json.Unmarshal([]byte(str), &js) == nil\n}\n\n// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid.\nfunc IsMultibyte(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxMultibyte.MatchString(str)\n}\n\n// IsASCII checks if the string contains ASCII chars only. Empty string is valid.\nfunc IsASCII(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxASCII.MatchString(str)\n}\n\n// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid.\nfunc IsPrintableASCII(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxPrintableASCII.MatchString(str)\n}\n\n// IsFullWidth checks if the string contains any full-width chars. Empty string is valid.\nfunc IsFullWidth(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxFullWidth.MatchString(str)\n}\n\n// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid.\nfunc IsHalfWidth(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxHalfWidth.MatchString(str)\n}\n\n// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid.\nfunc IsVariableWidth(str string) bool {\n\tif IsNull(str) {\n\t\treturn true\n\t}\n\treturn rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str)\n}\n\n// IsBase64 checks if a string is base64 encoded.\nfunc IsBase64(str string) bool {\n\treturn rxBase64.MatchString(str)\n}\n\n// IsFilePath checks is a string is Win or Unix file path and returns it's type.\nfunc IsFilePath(str string) (bool, int) {\n\tif rxWinPath.MatchString(str) {\n\t\t//check windows path limit see:\n\t\t//  http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath\n\t\tif len(str[3:]) > 32767 {\n\t\t\treturn false, Win\n\t\t}\n\t\treturn true, Win\n\t} else if rxUnixPath.MatchString(str) {\n\t\treturn true, Unix\n\t}\n\treturn false, Unknown\n}\n\n//IsWinFilePath checks both relative & absolute paths in Windows\nfunc IsWinFilePath(str string) bool {\n\tif rxARWinPath.MatchString(str) {\n\t\t//check windows path limit see:\n\t\t//  http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath\n\t\tif len(str[3:]) > 32767 {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\n//IsUnixFilePath checks both relative & absolute paths in Unix\nfunc IsUnixFilePath(str string) bool {\n\tif rxARUnixPath.MatchString(str) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// IsDataURI checks if a string is base64 encoded data URI such as an image\nfunc IsDataURI(str string) bool {\n\tdataURI := strings.Split(str, \",\")\n\tif !rxDataURI.MatchString(dataURI[0]) {\n\t\treturn false\n\t}\n\treturn IsBase64(dataURI[1])\n}\n\n// IsMagnetURI checks if a string is valid magnet URI\nfunc IsMagnetURI(str string) bool {\n\treturn rxMagnetURI.MatchString(str)\n}\n\n// IsISO3166Alpha2 checks if a string is valid two-letter country code\nfunc IsISO3166Alpha2(str string) bool {\n\tfor _, entry := range ISO3166List {\n\t\tif str == entry.Alpha2Code {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IsISO3166Alpha3 checks if a string is valid three-letter country code\nfunc IsISO3166Alpha3(str string) bool {\n\tfor _, entry := range ISO3166List {\n\t\tif str == entry.Alpha3Code {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IsISO693Alpha2 checks if a string is valid two-letter language code\nfunc IsISO693Alpha2(str string) bool {\n\tfor _, entry := range ISO693List {\n\t\tif str == entry.Alpha2Code {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IsISO693Alpha3b checks if a string is valid three-letter language code\nfunc IsISO693Alpha3b(str string) bool {\n\tfor _, entry := range ISO693List {\n\t\tif str == entry.Alpha3bCode {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IsDNSName will validate the given string as a DNS name\nfunc IsDNSName(str string) bool {\n\tif str == \"\" || len(strings.Replace(str, \".\", \"\", -1)) > 255 {\n\t\t// constraints already violated\n\t\treturn false\n\t}\n\treturn !IsIP(str) && rxDNSName.MatchString(str)\n}\n\n// IsHash checks if a string is a hash of type algorithm.\n// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b']\nfunc IsHash(str string, algorithm string) bool {\n\tvar len string\n\talgo := strings.ToLower(algorithm)\n\n\tif algo == \"crc32\" || algo == \"crc32b\" {\n\t\tlen = \"8\"\n\t} else if algo == \"md5\" || algo == \"md4\" || algo == \"ripemd128\" || algo == \"tiger128\" {\n\t\tlen = \"32\"\n\t} else if algo == \"sha1\" || algo == \"ripemd160\" || algo == \"tiger160\" {\n\t\tlen = \"40\"\n\t} else if algo == \"tiger192\" {\n\t\tlen = \"48\"\n\t} else if algo == \"sha3-224\" {\n\t\tlen = \"56\"\n\t} else if algo == \"sha256\" || algo == \"sha3-256\" {\n\t\tlen = \"64\"\n\t} else if algo == \"sha384\" || algo == \"sha3-384\" {\n\t\tlen = \"96\"\n\t} else if algo == \"sha512\" || algo == \"sha3-512\" {\n\t\tlen = \"128\"\n\t} else {\n\t\treturn false\n\t}\n\n\treturn Matches(str, \"^[a-f0-9]{\"+len+\"}$\")\n}\n\n// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, \"sha3-224\")`\nfunc IsSHA3224(str string) bool {\n\treturn IsHash(str, \"sha3-224\")\n}\n\n// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, \"sha3-256\")`\nfunc IsSHA3256(str string) bool {\n\treturn IsHash(str, \"sha3-256\")\n}\n\n// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, \"sha3-384\")`\nfunc IsSHA3384(str string) bool {\n\treturn IsHash(str, \"sha3-384\")\n}\n\n// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, \"sha3-512\")`\nfunc IsSHA3512(str string) bool {\n\treturn IsHash(str, \"sha3-512\")\n}\n\n// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, \"sha512\")`\nfunc IsSHA512(str string) bool {\n\treturn IsHash(str, \"sha512\")\n}\n\n// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, \"sha384\")`\nfunc IsSHA384(str string) bool {\n\treturn IsHash(str, \"sha384\")\n}\n\n// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, \"sha256\")`\nfunc IsSHA256(str string) bool {\n\treturn IsHash(str, \"sha256\")\n}\n\n// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, \"tiger192\")`\nfunc IsTiger192(str string) bool {\n\treturn IsHash(str, \"tiger192\")\n}\n\n// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, \"tiger160\")`\nfunc IsTiger160(str string) bool {\n\treturn IsHash(str, \"tiger160\")\n}\n\n// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, \"ripemd160\")`\nfunc IsRipeMD160(str string) bool {\n\treturn IsHash(str, \"ripemd160\")\n}\n\n// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, \"sha1\")`\nfunc IsSHA1(str string) bool {\n\treturn IsHash(str, \"sha1\")\n}\n\n// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, \"tiger128\")`\nfunc IsTiger128(str string) bool {\n\treturn IsHash(str, \"tiger128\")\n}\n\n// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, \"ripemd128\")`\nfunc IsRipeMD128(str string) bool {\n\treturn IsHash(str, \"ripemd128\")\n}\n\n// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, \"crc32\")`\nfunc IsCRC32(str string) bool {\n\treturn IsHash(str, \"crc32\")\n}\n\n// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, \"crc32b\")`\nfunc IsCRC32b(str string) bool {\n\treturn IsHash(str, \"crc32b\")\n}\n\n// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, \"md5\")`\nfunc IsMD5(str string) bool {\n\treturn IsHash(str, \"md5\")\n}\n\n// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, \"md4\")`\nfunc IsMD4(str string) bool {\n\treturn IsHash(str, \"md4\")\n}\n\n// IsDialString validates the given string for usage with the various Dial() functions\nfunc IsDialString(str string) bool {\n\tif h, p, err := net.SplitHostPort(str); err == nil && h != \"\" && p != \"\" && (IsDNSName(h) || IsIP(h)) && IsPort(p) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP`\nfunc IsIP(str string) bool {\n\treturn net.ParseIP(str) != nil\n}\n\n// IsPort checks if a string represents a valid port\nfunc IsPort(str string) bool {\n\tif i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// IsIPv4 checks if the string is an IP version 4.\nfunc IsIPv4(str string) bool {\n\tip := net.ParseIP(str)\n\treturn ip != nil && strings.Contains(str, \".\")\n}\n\n// IsIPv6 checks if the string is an IP version 6.\nfunc IsIPv6(str string) bool {\n\tip := net.ParseIP(str)\n\treturn ip != nil && strings.Contains(str, \":\")\n}\n\n// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6)\nfunc IsCIDR(str string) bool {\n\t_, _, err := net.ParseCIDR(str)\n\treturn err == nil\n}\n\n// IsMAC checks if a string is valid MAC address.\n// Possible MAC formats:\n// 01:23:45:67:89:ab\n// 01:23:45:67:89:ab:cd:ef\n// 01-23-45-67-89-ab\n// 01-23-45-67-89-ab-cd-ef\n// 0123.4567.89ab\n// 0123.4567.89ab.cdef\nfunc IsMAC(str string) bool {\n\t_, err := net.ParseMAC(str)\n\treturn err == nil\n}\n\n// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name\nfunc IsHost(str string) bool {\n\treturn IsIP(str) || IsDNSName(str)\n}\n\n// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.\nfunc IsMongoID(str string) bool {\n\treturn rxHexadecimal.MatchString(str) && (len(str) == 24)\n}\n\n// IsLatitude checks if a string is valid latitude.\nfunc IsLatitude(str string) bool {\n\treturn rxLatitude.MatchString(str)\n}\n\n// IsLongitude checks if a string is valid longitude.\nfunc IsLongitude(str string) bool {\n\treturn rxLongitude.MatchString(str)\n}\n\n// IsIMEI checks if a string is valid IMEI\nfunc IsIMEI(str string) bool {\n\treturn rxIMEI.MatchString(str)\n}\n\n// IsIMSI checks if a string is valid IMSI\nfunc IsIMSI(str string) bool {\n\tif !rxIMSI.MatchString(str) {\n\t\treturn false\n\t}\n\n\tmcc, err := strconv.ParseInt(str[0:3], 10, 32)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tswitch mcc {\n\tcase 202, 204, 206, 208, 212, 213, 214, 216, 218, 219:\n\tcase 220, 221, 222, 226, 228, 230, 231, 232, 234, 235:\n\tcase 238, 240, 242, 244, 246, 247, 248, 250, 255, 257:\n\tcase 259, 260, 262, 266, 268, 270, 272, 274, 276, 278:\n\tcase 280, 282, 283, 284, 286, 288, 289, 290, 292, 293:\n\tcase 294, 295, 297, 302, 308, 310, 311, 312, 313, 314:\n\tcase 315, 316, 330, 332, 334, 338, 340, 342, 344, 346:\n\tcase 348, 350, 352, 354, 356, 358, 360, 362, 363, 364:\n\tcase 365, 366, 368, 370, 372, 374, 376, 400, 401, 402:\n\tcase 404, 405, 406, 410, 412, 413, 414, 415, 416, 417:\n\tcase 418, 419, 420, 421, 422, 424, 425, 426, 427, 428:\n\tcase 429, 430, 431, 432, 434, 436, 437, 438, 440, 441:\n\tcase 450, 452, 454, 455, 456, 457, 460, 461, 466, 467:\n\tcase 470, 472, 502, 505, 510, 514, 515, 520, 525, 528:\n\tcase 530, 536, 537, 539, 540, 541, 542, 543, 544, 545:\n\tcase 546, 547, 548, 549, 550, 551, 552, 553, 554, 555:\n\tcase 602, 603, 604, 605, 606, 607, 608, 609, 610, 611:\n\tcase 612, 613, 614, 615, 616, 617, 618, 619, 620, 621:\n\tcase 622, 623, 624, 625, 626, 627, 628, 629, 630, 631:\n\tcase 632, 633, 634, 635, 636, 637, 638, 639, 640, 641:\n\tcase 642, 643, 645, 646, 647, 648, 649, 650, 651, 652:\n\tcase 653, 654, 655, 657, 658, 659, 702, 704, 706, 708:\n\tcase 710, 712, 714, 716, 722, 724, 730, 732, 734, 736:\n\tcase 738, 740, 742, 744, 746, 748, 750, 995:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n\treturn true\n}\n\n// IsRsaPublicKey checks if a string is valid public key with provided length\nfunc IsRsaPublicKey(str string, keylen int) bool {\n\tbb := bytes.NewBufferString(str)\n\tpemBytes, err := ioutil.ReadAll(bb)\n\tif err != nil {\n\t\treturn false\n\t}\n\tblock, _ := pem.Decode(pemBytes)\n\tif block != nil && block.Type != \"PUBLIC KEY\" {\n\t\treturn false\n\t}\n\tvar der []byte\n\n\tif block != nil {\n\t\tder = block.Bytes\n\t} else {\n\t\tder, err = base64.StdEncoding.DecodeString(str)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tkey, err := x509.ParsePKIXPublicKey(der)\n\tif err != nil {\n\t\treturn false\n\t}\n\tpubkey, ok := key.(*rsa.PublicKey)\n\tif !ok {\n\t\treturn false\n\t}\n\tbitlen := len(pubkey.N.Bytes()) * 8\n\treturn bitlen == int(keylen)\n}\n\n// IsRegex checks if a give string is a valid regex with RE2 syntax or not\nfunc IsRegex(str string) bool {\n\tif _, err := regexp.Compile(str); err == nil {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc toJSONName(tag string) string {\n\tif tag == \"\" {\n\t\treturn \"\"\n\t}\n\n\t// JSON name always comes first. If there's no options then split[0] is\n\t// JSON name, if JSON name is not set, then split[0] is an empty string.\n\tsplit := strings.SplitN(tag, \",\", 2)\n\n\tname := split[0]\n\n\t// However it is possible that the field is skipped when\n\t// (de-)serializing from/to JSON, in which case assume that there is no\n\t// tag name to use\n\tif name == \"-\" {\n\t\treturn \"\"\n\t}\n\treturn name\n}\n\nfunc prependPathToErrors(err error, path string) error {\n\tswitch err2 := err.(type) {\n\tcase Error:\n\t\terr2.Path = append([]string{path}, err2.Path...)\n\t\treturn err2\n\tcase Errors:\n\t\terrors := err2.Errors()\n\t\tfor i, err3 := range errors {\n\t\t\terrors[i] = prependPathToErrors(err3, path)\n\t\t}\n\t\treturn err2\n\t}\n\treturn err\n}\n\n// ValidateArray performs validation according to condition iterator that validates every element of the array\nfunc ValidateArray(array []interface{}, iterator ConditionIterator) bool {\n\treturn Every(array, iterator)\n}\n\n// ValidateMap use validation map for fields.\n// result will be equal to `false` if there are any errors.\n// s is the map containing the data to be validated.\n// m is the validation map in the form:\n//   map[string]interface{}{\"name\":\"required,alpha\",\"address\":map[string]interface{}{\"line1\":\"required,alphanum\"}}\nfunc ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) {\n\tif s == nil {\n\t\treturn true, nil\n\t}\n\tresult := true\n\tvar err error\n\tvar errs Errors\n\tvar index int\n\tval := reflect.ValueOf(s)\n\tfor key, value := range s {\n\t\tpresentResult := true\n\t\tvalidator, ok := m[key]\n\t\tif !ok {\n\t\t\tpresentResult = false\n\t\t\tvar err error\n\t\t\terr = fmt.Errorf(\"all map keys has to be present in the validation map; got %s\", key)\n\t\t\terr = prependPathToErrors(err, key)\n\t\t\terrs = append(errs, err)\n\t\t}\n\t\tvalueField := reflect.ValueOf(value)\n\t\tmapResult := true\n\t\ttypeResult := true\n\t\tstructResult := true\n\t\tresultField := true\n\t\tswitch subValidator := validator.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tvar err error\n\t\t\tif v, ok := value.(map[string]interface{}); !ok {\n\t\t\t\tmapResult = false\n\t\t\t\terr = fmt.Errorf(\"map validator has to be for the map type only; got %s\", valueField.Type().String())\n\t\t\t\terr = prependPathToErrors(err, key)\n\t\t\t\terrs = append(errs, err)\n\t\t\t} else {\n\t\t\t\tmapResult, err = ValidateMap(v, subValidator)\n\t\t\t\tif err != nil {\n\t\t\t\t\tmapResult = false\n\t\t\t\t\terr = prependPathToErrors(err, key)\n\t\t\t\t\terrs = append(errs, err)\n\t\t\t\t}\n\t\t\t}\n\t\tcase string:\n\t\t\tif (valueField.Kind() == reflect.Struct ||\n\t\t\t\t(valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&\n\t\t\t\tsubValidator != \"-\" {\n\t\t\t\tvar err error\n\t\t\t\tstructResult, err = ValidateStruct(valueField.Interface())\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = prependPathToErrors(err, key)\n\t\t\t\t\terrs = append(errs, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tresultField, err = typeCheck(valueField, reflect.StructField{\n\t\t\t\tName:      key,\n\t\t\t\tPkgPath:   \"\",\n\t\t\t\tType:      val.Type(),\n\t\t\t\tTag:       reflect.StructTag(fmt.Sprintf(\"%s:%q\", tagName, subValidator)),\n\t\t\t\tOffset:    0,\n\t\t\t\tIndex:     []int{index},\n\t\t\t\tAnonymous: false,\n\t\t\t}, val, nil)\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\tcase nil:\n\t\t\t// already handlerd when checked before\n\t\tdefault:\n\t\t\ttypeResult = false\n\t\t\terr = fmt.Errorf(\"map validator has to be either map[string]interface{} or string; got %s\", valueField.Type().String())\n\t\t\terr = prependPathToErrors(err, key)\n\t\t\terrs = append(errs, err)\n\t\t}\n\t\tresult = result && presentResult && typeResult && resultField && structResult && mapResult\n\t\tindex++\n\t}\n\t// checks required keys\n\trequiredResult := true\n\tfor key, value := range m {\n\t\tif schema, ok := value.(string); ok {\n\t\t\ttags := parseTagIntoMap(schema)\n\t\t\tif required, ok := tags[\"required\"]; ok {\n\t\t\t\tif _, ok := s[key]; !ok {\n\t\t\t\t\trequiredResult = false\n\t\t\t\t\tif required.customErrorMessage != \"\" {\n\t\t\t\t\t\terr = Error{key, fmt.Errorf(required.customErrorMessage), true, \"required\", []string{}}\n\t\t\t\t\t} else {\n\t\t\t\t\t\terr = Error{key, fmt.Errorf(\"required field missing\"), false, \"required\", []string{}}\n\t\t\t\t\t}\n\t\t\t\t\terrs = append(errs, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(errs) > 0 {\n\t\terr = errs\n\t}\n\treturn result && requiredResult, err\n}\n\n// ValidateStruct use tags for fields.\n// result will be equal to `false` if there are any errors.\n// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail)\nfunc ValidateStruct(s interface{}) (bool, error) {\n\tif s == nil {\n\t\treturn true, nil\n\t}\n\tresult := true\n\tvar err error\n\tval := reflect.ValueOf(s)\n\tif val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {\n\t\tval = val.Elem()\n\t}\n\t// we only accept structs\n\tif val.Kind() != reflect.Struct {\n\t\treturn false, fmt.Errorf(\"function only accepts structs; got %s\", val.Kind())\n\t}\n\tvar errs Errors\n\tfor i := 0; i < val.NumField(); i++ {\n\t\tvalueField := val.Field(i)\n\t\ttypeField := val.Type().Field(i)\n\t\tif typeField.PkgPath != \"\" {\n\t\t\tcontinue // Private field\n\t\t}\n\t\tstructResult := true\n\t\tif valueField.Kind() == reflect.Interface {\n\t\t\tvalueField = valueField.Elem()\n\t\t}\n\t\tif (valueField.Kind() == reflect.Struct ||\n\t\t\t(valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&\n\t\t\ttypeField.Tag.Get(tagName) != \"-\" {\n\t\t\tvar err error\n\t\t\tstructResult, err = ValidateStruct(valueField.Interface())\n\t\t\tif err != nil {\n\t\t\t\terr = prependPathToErrors(err, typeField.Name)\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t}\n\t\tresultField, err2 := typeCheck(valueField, typeField, val, nil)\n\t\tif err2 != nil {\n\n\t\t\t// Replace structure name with JSON name if there is a tag on the variable\n\t\t\tjsonTag := toJSONName(typeField.Tag.Get(\"json\"))\n\t\t\tif jsonTag != \"\" {\n\t\t\t\tswitch jsonError := err2.(type) {\n\t\t\t\tcase Error:\n\t\t\t\t\tjsonError.Name = jsonTag\n\t\t\t\t\terr2 = jsonError\n\t\t\t\tcase Errors:\n\t\t\t\t\tfor i2, err3 := range jsonError {\n\t\t\t\t\t\tswitch customErr := err3.(type) {\n\t\t\t\t\t\tcase Error:\n\t\t\t\t\t\t\tcustomErr.Name = jsonTag\n\t\t\t\t\t\t\tjsonError[i2] = customErr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\terr2 = jsonError\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terrs = append(errs, err2)\n\t\t}\n\t\tresult = result && resultField && structResult\n\t}\n\tif len(errs) > 0 {\n\t\terr = errs\n\t}\n\treturn result, err\n}\n\n// ValidateStructAsync performs async validation of the struct and returns results through the channels\nfunc ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) {\n\tres := make(chan bool)\n\terrors := make(chan error)\n\n\tgo func() {\n\t\tdefer close(res)\n\t\tdefer close(errors)\n\n\t\tisValid, isFailed := ValidateStruct(s)\n\n\t\tres <- isValid\n\t\terrors <- isFailed\n\t}()\n\n\treturn res, errors\n}\n\n// ValidateMapAsync performs async validation of the map and returns results through the channels\nfunc ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) {\n\tres := make(chan bool)\n\terrors := make(chan error)\n\n\tgo func() {\n\t\tdefer close(res)\n\t\tdefer close(errors)\n\n\t\tisValid, isFailed := ValidateMap(s, m)\n\n\t\tres <- isValid\n\t\terrors <- isFailed\n\t}()\n\n\treturn res, errors\n}\n\n// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{\"required\": \"Some error message\", \"length(2|3)\": \"\"}\nfunc parseTagIntoMap(tag string) tagOptionsMap {\n\toptionsMap := make(tagOptionsMap)\n\toptions := strings.Split(tag, \",\")\n\n\tfor i, option := range options {\n\t\toption = strings.TrimSpace(option)\n\n\t\tvalidationOptions := strings.Split(option, \"~\")\n\t\tif !isValidTag(validationOptions[0]) {\n\t\t\tcontinue\n\t\t}\n\t\tif len(validationOptions) == 2 {\n\t\t\toptionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i}\n\t\t} else {\n\t\t\toptionsMap[validationOptions[0]] = tagOption{validationOptions[0], \"\", i}\n\t\t}\n\t}\n\treturn optionsMap\n}\n\nfunc isValidTag(s string) bool {\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tfor _, c := range s {\n\t\tswitch {\n\t\tcase strings.ContainsRune(\"\\\\'\\\"!#$%&()*+-./:<=>?@[]^_{|}~ \", c):\n\t\t\t// Backslash and quote chars are reserved, but\n\t\t\t// otherwise any punctuation chars are allowed\n\t\t\t// in a tag name.\n\t\tdefault:\n\t\t\tif !unicode.IsLetter(c) && !unicode.IsDigit(c) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// IsSSN will validate the given string as a U.S. Social Security Number\nfunc IsSSN(str string) bool {\n\tif str == \"\" || len(str) != 11 {\n\t\treturn false\n\t}\n\treturn rxSSN.MatchString(str)\n}\n\n// IsSemver checks if string is valid semantic version\nfunc IsSemver(str string) bool {\n\treturn rxSemver.MatchString(str)\n}\n\n// IsType checks if interface is of some type\nfunc IsType(v interface{}, params ...string) bool {\n\tif len(params) == 1 {\n\t\ttyp := params[0]\n\t\treturn strings.Replace(reflect.TypeOf(v).String(), \" \", \"\", -1) == strings.Replace(typ, \" \", \"\", -1)\n\t}\n\treturn false\n}\n\n// IsTime checks if string is valid according to given format\nfunc IsTime(str string, format string) bool {\n\t_, err := time.Parse(format, str)\n\treturn err == nil\n}\n\n// IsUnixTime checks if string is valid unix timestamp value\nfunc IsUnixTime(str string) bool {\n\tif _, err := strconv.Atoi(str); err == nil {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// IsRFC3339 checks if string is valid timestamp value according to RFC3339\nfunc IsRFC3339(str string) bool {\n\treturn IsTime(str, time.RFC3339)\n}\n\n// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone.\nfunc IsRFC3339WithoutZone(str string) bool {\n\treturn IsTime(str, rfc3339WithoutZone)\n}\n\n// IsISO4217 checks if string is valid ISO currency code\nfunc IsISO4217(str string) bool {\n\tfor _, currency := range ISO4217List {\n\t\tif str == currency {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// ByteLength checks string's length\nfunc ByteLength(str string, params ...string) bool {\n\tif len(params) == 2 {\n\t\tmin, _ := ToInt(params[0])\n\t\tmax, _ := ToInt(params[1])\n\t\treturn len(str) >= int(min) && len(str) <= int(max)\n\t}\n\n\treturn false\n}\n\n// RuneLength checks string's length\n// Alias for StringLength\nfunc RuneLength(str string, params ...string) bool {\n\treturn StringLength(str, params...)\n}\n\n// IsRsaPub checks whether string is valid RSA key\n// Alias for IsRsaPublicKey\nfunc IsRsaPub(str string, params ...string) bool {\n\tif len(params) == 1 {\n\t\tlen, _ := ToInt(params[0])\n\t\treturn IsRsaPublicKey(str, int(len))\n\t}\n\n\treturn false\n}\n\n// StringMatches checks if a string matches a given pattern.\nfunc StringMatches(s string, params ...string) bool {\n\tif len(params) == 1 {\n\t\tpattern := params[0]\n\t\treturn Matches(s, pattern)\n\t}\n\treturn false\n}\n\n// StringLength checks string's length (including multi byte strings)\nfunc StringLength(str string, params ...string) bool {\n\n\tif len(params) == 2 {\n\t\tstrLength := utf8.RuneCountInString(str)\n\t\tmin, _ := ToInt(params[0])\n\t\tmax, _ := ToInt(params[1])\n\t\treturn strLength >= int(min) && strLength <= int(max)\n\t}\n\n\treturn false\n}\n\n// MinStringLength checks string's minimum length (including multi byte strings)\nfunc MinStringLength(str string, params ...string) bool {\n\n\tif len(params) == 1 {\n\t\tstrLength := utf8.RuneCountInString(str)\n\t\tmin, _ := ToInt(params[0])\n\t\treturn strLength >= int(min)\n\t}\n\n\treturn false\n}\n\n// MaxStringLength checks string's maximum length (including multi byte strings)\nfunc MaxStringLength(str string, params ...string) bool {\n\n\tif len(params) == 1 {\n\t\tstrLength := utf8.RuneCountInString(str)\n\t\tmax, _ := ToInt(params[0])\n\t\treturn strLength <= int(max)\n\t}\n\n\treturn false\n}\n\n// Range checks string's length\nfunc Range(str string, params ...string) bool {\n\tif len(params) == 2 {\n\t\tvalue, _ := ToFloat(str)\n\t\tmin, _ := ToFloat(params[0])\n\t\tmax, _ := ToFloat(params[1])\n\t\treturn InRange(value, min, max)\n\t}\n\n\treturn false\n}\n\n// IsInRaw checks if string is in list of allowed values\nfunc IsInRaw(str string, params ...string) bool {\n\tif len(params) == 1 {\n\t\trawParams := params[0]\n\n\t\tparsedParams := strings.Split(rawParams, \"|\")\n\n\t\treturn IsIn(str, parsedParams...)\n\t}\n\n\treturn false\n}\n\n// IsIn checks if string str is a member of the set of strings params\nfunc IsIn(str string, params ...string) bool {\n\tfor _, param := range params {\n\t\tif str == param {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) {\n\tif nilPtrAllowedByRequired {\n\t\tk := v.Kind()\n\t\tif (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\tif requiredOption, isRequired := options[\"required\"]; isRequired {\n\t\tif len(requiredOption.customErrorMessage) > 0 {\n\t\t\treturn false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, \"required\", []string{}}\n\t\t}\n\t\treturn false, Error{t.Name, fmt.Errorf(\"non zero value required\"), false, \"required\", []string{}}\n\t} else if _, isOptional := options[\"optional\"]; fieldsRequiredByDefault && !isOptional {\n\t\treturn false, Error{t.Name, fmt.Errorf(\"Missing required field\"), false, \"required\", []string{}}\n\t}\n\t// not required and empty is valid\n\treturn true, nil\n}\n\nfunc typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) {\n\tif !v.IsValid() {\n\t\treturn false, nil\n\t}\n\n\ttag := t.Tag.Get(tagName)\n\n\t// checks if the field should be ignored\n\tswitch tag {\n\tcase \"\":\n\t\tif v.Kind() != reflect.Slice && v.Kind() != reflect.Map {\n\t\t\tif !fieldsRequiredByDefault {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\treturn false, Error{t.Name, fmt.Errorf(\"All fields are required to at least have one validation defined\"), false, \"required\", []string{}}\n\t\t}\n\tcase \"-\":\n\t\treturn true, nil\n\t}\n\n\tisRootType := false\n\tif options == nil {\n\t\tisRootType = true\n\t\toptions = parseTagIntoMap(tag)\n\t}\n\n\tif isEmptyValue(v) {\n\t\t// an empty value is not validated, checks only required\n\t\tisValid, resultErr = checkRequired(v, t, options)\n\t\tfor key := range options {\n\t\t\tdelete(options, key)\n\t\t}\n\t\treturn isValid, resultErr\n\t}\n\n\tvar customTypeErrors Errors\n\toptionsOrder := options.orderedKeys()\n\tfor _, validatorName := range optionsOrder {\n\t\tvalidatorStruct := options[validatorName]\n\t\tif validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok {\n\t\t\tdelete(options, validatorName)\n\n\t\t\tif result := validatefunc(v.Interface(), o.Interface()); !result {\n\t\t\t\tif len(validatorStruct.customErrorMessage) > 0 {\n\t\t\t\t\tcustomTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)})\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcustomTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf(\"%s does not validate as %s\", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)})\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(customTypeErrors.Errors()) > 0 {\n\t\treturn false, customTypeErrors\n\t}\n\n\tif isRootType {\n\t\t// Ensure that we've checked the value by all specified validators before report that the value is valid\n\t\tdefer func() {\n\t\t\tdelete(options, \"optional\")\n\t\t\tdelete(options, \"required\")\n\n\t\t\tif isValid && resultErr == nil && len(options) != 0 {\n\t\t\t\toptionsOrder := options.orderedKeys()\n\t\t\t\tfor _, validator := range optionsOrder {\n\t\t\t\t\tisValid = false\n\t\t\t\t\tresultErr = Error{t.Name, fmt.Errorf(\n\t\t\t\t\t\t\"The following validator is invalid or can't be applied to the field: %q\", validator), false, stripParams(validator), []string{}}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tfor _, validatorSpec := range optionsOrder {\n\t\tvalidatorStruct := options[validatorSpec]\n\t\tvar negate bool\n\t\tvalidator := validatorSpec\n\t\tcustomMsgExists := len(validatorStruct.customErrorMessage) > 0\n\n\t\t// checks whether the tag looks like '!something' or 'something'\n\t\tif validator[0] == '!' {\n\t\t\tvalidator = validator[1:]\n\t\t\tnegate = true\n\t\t}\n\n\t\t// checks for interface param validators\n\t\tfor key, value := range InterfaceParamTagRegexMap {\n\t\t\tps := value.FindStringSubmatch(validator)\n\t\t\tif len(ps) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvalidatefunc, ok := InterfaceParamTagMap[key]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tdelete(options, validatorSpec)\n\n\t\t\tfield := fmt.Sprint(v)\n\t\t\tif result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) {\n\t\t\t\tif customMsgExists {\n\t\t\t\t\treturn false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t}\n\t\t\t\tif negate {\n\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t}\n\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does not validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Bool,\n\t\treflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr,\n\t\treflect.Float32, reflect.Float64,\n\t\treflect.String:\n\t\t// for each tag option checks the map of validator functions\n\t\tfor _, validatorSpec := range optionsOrder {\n\t\t\tvalidatorStruct := options[validatorSpec]\n\t\t\tvar negate bool\n\t\t\tvalidator := validatorSpec\n\t\t\tcustomMsgExists := len(validatorStruct.customErrorMessage) > 0\n\n\t\t\t// checks whether the tag looks like '!something' or 'something'\n\t\t\tif validator[0] == '!' {\n\t\t\t\tvalidator = validator[1:]\n\t\t\t\tnegate = true\n\t\t\t}\n\n\t\t\t// checks for param validators\n\t\t\tfor key, value := range ParamTagRegexMap {\n\t\t\t\tps := value.FindStringSubmatch(validator)\n\t\t\t\tif len(ps) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvalidatefunc, ok := ParamTagMap[key]\n\t\t\t\tif !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tdelete(options, validatorSpec)\n\n\t\t\t\tswitch v.Kind() {\n\t\t\t\tcase reflect.String,\n\t\t\t\t\treflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\t\t\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,\n\t\t\t\t\treflect.Float32, reflect.Float64:\n\n\t\t\t\t\tfield := fmt.Sprint(v) // make value into string, then validate with regex\n\t\t\t\t\tif result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) {\n\t\t\t\t\t\tif customMsgExists {\n\t\t\t\t\t\t\treturn false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif negate {\n\t\t\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does not validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\t// type not yet supported, fail\n\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"Validator %s doesn't support kind %s\", validator, v.Kind()), false, stripParams(validatorSpec), []string{}}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif validatefunc, ok := TagMap[validator]; ok {\n\t\t\t\tdelete(options, validatorSpec)\n\n\t\t\t\tswitch v.Kind() {\n\t\t\t\tcase reflect.String,\n\t\t\t\t\treflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\t\t\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,\n\t\t\t\t\treflect.Float32, reflect.Float64:\n\t\t\t\t\tfield := fmt.Sprint(v) // make value into string, then validate with regex\n\t\t\t\t\tif result := validatefunc(field); !result && !negate || result && negate {\n\t\t\t\t\t\tif customMsgExists {\n\t\t\t\t\t\t\treturn false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif negate {\n\t\t\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false, Error{t.Name, fmt.Errorf(\"%s does not validate as %s\", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\t//Not Yet Supported Types (Fail here!)\n\t\t\t\t\terr := fmt.Errorf(\"Validator %s doesn't support kind %s for value %v\", validator, v.Kind(), v)\n\t\t\t\t\treturn false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true, nil\n\tcase reflect.Map:\n\t\tif v.Type().Key().Kind() != reflect.String {\n\t\t\treturn false, &UnsupportedTypeError{v.Type()}\n\t\t}\n\t\tvar sv stringValues\n\t\tsv = v.MapKeys()\n\t\tsort.Sort(sv)\n\t\tresult := true\n\t\tfor i, k := range sv {\n\t\t\tvar resultItem bool\n\t\t\tvar err error\n\t\t\tif v.MapIndex(k).Kind() != reflect.Struct {\n\t\t\t\tresultItem, err = typeCheck(v.MapIndex(k), t, o, options)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresultItem, err = ValidateStruct(v.MapIndex(k).Interface())\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = prependPathToErrors(err, t.Name+\".\"+sv[i].Interface().(string))\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = result && resultItem\n\t\t}\n\t\treturn result, nil\n\tcase reflect.Slice, reflect.Array:\n\t\tresult := true\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tvar resultItem bool\n\t\t\tvar err error\n\t\t\tif v.Index(i).Kind() != reflect.Struct {\n\t\t\t\tresultItem, err = typeCheck(v.Index(i), t, o, options)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresultItem, err = ValidateStruct(v.Index(i).Interface())\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = prependPathToErrors(err, t.Name+\".\"+strconv.Itoa(i))\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = result && resultItem\n\t\t}\n\t\treturn result, nil\n\tcase reflect.Interface:\n\t\t// If the value is an interface then encode its element\n\t\tif v.IsNil() {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn ValidateStruct(v.Interface())\n\tcase reflect.Ptr:\n\t\t// If the value is a pointer then checks its element\n\t\tif v.IsNil() {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn typeCheck(v.Elem(), t, o, options)\n\tcase reflect.Struct:\n\t\treturn true, nil\n\tdefault:\n\t\treturn false, &UnsupportedTypeError{v.Type()}\n\t}\n}\n\nfunc stripParams(validatorString string) string {\n\treturn paramsRegexp.ReplaceAllString(validatorString, \"\")\n}\n\n// isEmptyValue checks whether value empty or not\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.String, reflect.Array:\n\t\treturn v.Len() == 0\n\tcase reflect.Map, reflect.Slice:\n\t\treturn v.Len() == 0 || v.IsNil()\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\n\treturn reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())\n}\n\n// ErrorByField returns error for specified field of the struct\n// validated by ValidateStruct or empty string if there are no errors\n// or this field doesn't exists or doesn't have any errors.\nfunc ErrorByField(e error, field string) string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn ErrorsByField(e)[field]\n}\n\n// ErrorsByField returns map of errors of the struct validated\n// by ValidateStruct or empty map if there are no errors.\nfunc ErrorsByField(e error) map[string]string {\n\tm := make(map[string]string)\n\tif e == nil {\n\t\treturn m\n\t}\n\t// prototype for ValidateStruct\n\n\tswitch e := e.(type) {\n\tcase Error:\n\t\tm[e.Name] = e.Err.Error()\n\tcase Errors:\n\t\tfor _, item := range e.Errors() {\n\t\t\tn := ErrorsByField(item)\n\t\t\tfor k, v := range n {\n\t\t\t\tm[k] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn m\n}\n\n// Error returns string equivalent for reflect.Type\nfunc (e *UnsupportedTypeError) Error() string {\n\treturn \"validator: unsupported type: \" + e.Type.String()\n}\n\nfunc (sv stringValues) Len() int           { return len(sv) }\nfunc (sv stringValues) Swap(i, j int)      { sv[i], sv[j] = sv[j], sv[i] }\nfunc (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) }\nfunc (sv stringValues) get(i int) string   { return sv[i].String() }\n\nfunc IsE164(str string) bool {\n\treturn rxE164.MatchString(str)\n}\n"
  },
  {
    "path": "vendor/github.com/asaskevich/govalidator/wercker.yml",
    "content": "box: golang\nbuild:\n  steps:\n    - setup-go-workspace\n\n    - script:\n        name: go get\n        code: |\n          go version\n          go get -t ./...\n\n    - script:\n        name: go test\n        code: |\n          go test -race -v ./...\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/.travis.yml",
    "content": "language: go\n\nos:\n - linux\n - osx\n - windows\n\ngo:\n - go1.13.x\n - go1.x\n\nservices:\n - xvfb\n\nbefore_install:\n - export DISPLAY=:99.0\n\nscript:\n - if [ \"$TRAVIS_OS_NAME\" = \"linux\" ]; then sudo apt-get install xsel; fi\n - go test -v .\n - if [ \"$TRAVIS_OS_NAME\" = \"linux\" ]; then sudo apt-get install xclip; fi\n - go test -v .\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/LICENSE",
    "content": "Copyright (c) 2013 Ato Araki. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of @atotto. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/README.md",
    "content": "[![Build Status](https://travis-ci.org/atotto/clipboard.svg?branch=master)](https://travis-ci.org/atotto/clipboard)\n\n[![GoDoc](https://godoc.org/github.com/atotto/clipboard?status.svg)](http://godoc.org/github.com/atotto/clipboard)\n\n# Clipboard for Go\n\nProvide copying and pasting to the Clipboard for Go.\n\nBuild:\n\n    $ go get github.com/atotto/clipboard\n\nPlatforms:\n\n* OSX\n* Windows 7 (probably work on other Windows)\n* Linux, Unix (requires 'xclip' or 'xsel' command to be installed)\n\n\nDocument: \n\n* http://godoc.org/github.com/atotto/clipboard\n\nNotes:\n\n* Text string only\n* UTF-8 text encoding only (no conversion)\n\nTODO:\n\n* Clipboard watcher(?)\n\n## Commands:\n\npaste shell command:\n\n    $ go get github.com/atotto/clipboard/cmd/gopaste\n    $ # example:\n    $ gopaste > document.txt\n\ncopy shell command:\n\n    $ go get github.com/atotto/clipboard/cmd/gocopy\n    $ # example:\n    $ cat document.txt | gocopy\n\n\n\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/clipboard.go",
    "content": "// Copyright 2013 @atotto. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package clipboard read/write on clipboard\npackage clipboard\n\n// ReadAll read string from clipboard\nfunc ReadAll() (string, error) {\n\treturn readAll()\n}\n\n// WriteAll write string to clipboard\nfunc WriteAll(text string) error {\n\treturn writeAll(text)\n}\n\n// Unsupported might be set true during clipboard init, to help callers decide\n// whether or not to offer clipboard options.\nvar Unsupported bool\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/clipboard_darwin.go",
    "content": "// Copyright 2013 @atotto. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin\n\npackage clipboard\n\nimport (\n\t\"os/exec\"\n)\n\nvar (\n\tpasteCmdArgs = \"pbpaste\"\n\tcopyCmdArgs  = \"pbcopy\"\n)\n\nfunc getPasteCommand() *exec.Cmd {\n\treturn exec.Command(pasteCmdArgs)\n}\n\nfunc getCopyCommand() *exec.Cmd {\n\treturn exec.Command(copyCmdArgs)\n}\n\nfunc readAll() (string, error) {\n\tpasteCmd := getPasteCommand()\n\tout, err := pasteCmd.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(out), nil\n}\n\nfunc writeAll(text string) error {\n\tcopyCmd := getCopyCommand()\n\tin, err := copyCmd.StdinPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := copyCmd.Start(); err != nil {\n\t\treturn err\n\t}\n\tif _, err := in.Write([]byte(text)); err != nil {\n\t\treturn err\n\t}\n\tif err := in.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn copyCmd.Wait()\n}\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/clipboard_plan9.go",
    "content": "// Copyright 2013 @atotto. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9\n\npackage clipboard\n\nimport (\n\t\"os\"\n\t\"io/ioutil\"\n)\n\nfunc readAll() (string, error) {\n\tf, err := os.Open(\"/dev/snarf\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer f.Close()\n\n\tstr, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t\n\treturn string(str), nil\n}\n\nfunc writeAll(text string) error {\n\tf, err := os.OpenFile(\"/dev/snarf\", os.O_WRONLY, 0666)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\t\n\t_, err = f.Write([]byte(text))\n\tif err != nil {\n\t\treturn err\n\t}\n\t\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/clipboard_unix.go",
    "content": "// Copyright 2013 @atotto. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build freebsd linux netbsd openbsd solaris dragonfly\n\npackage clipboard\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nconst (\n\txsel               = \"xsel\"\n\txclip              = \"xclip\"\n\tpowershellExe      = \"powershell.exe\"\n\tclipExe            = \"clip.exe\"\n\twlcopy             = \"wl-copy\"\n\twlpaste            = \"wl-paste\"\n\ttermuxClipboardGet = \"termux-clipboard-get\"\n\ttermuxClipboardSet = \"termux-clipboard-set\"\n)\n\nvar (\n\tPrimary bool\n\ttrimDos bool\n\n\tpasteCmdArgs []string\n\tcopyCmdArgs  []string\n\n\txselPasteArgs = []string{xsel, \"--output\", \"--clipboard\"}\n\txselCopyArgs  = []string{xsel, \"--input\", \"--clipboard\"}\n\n\txclipPasteArgs = []string{xclip, \"-out\", \"-selection\", \"clipboard\"}\n\txclipCopyArgs  = []string{xclip, \"-in\", \"-selection\", \"clipboard\"}\n\n\tpowershellExePasteArgs = []string{powershellExe, \"Get-Clipboard\"}\n\tclipExeCopyArgs        = []string{clipExe}\n\n\twlpasteArgs = []string{wlpaste, \"--no-newline\"}\n\twlcopyArgs  = []string{wlcopy}\n\n\ttermuxPasteArgs = []string{termuxClipboardGet}\n\ttermuxCopyArgs  = []string{termuxClipboardSet}\n\n\tmissingCommands = errors.New(\"No clipboard utilities available. Please install xsel, xclip, wl-clipboard or Termux:API add-on for termux-clipboard-get/set.\")\n)\n\nfunc init() {\n\tif os.Getenv(\"WAYLAND_DISPLAY\") != \"\" {\n\t\tpasteCmdArgs = wlpasteArgs\n\t\tcopyCmdArgs = wlcopyArgs\n\n\t\tif _, err := exec.LookPath(wlcopy); err == nil {\n\t\t\tif _, err := exec.LookPath(wlpaste); err == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tpasteCmdArgs = xclipPasteArgs\n\tcopyCmdArgs = xclipCopyArgs\n\n\tif _, err := exec.LookPath(xclip); err == nil {\n\t\treturn\n\t}\n\n\tpasteCmdArgs = xselPasteArgs\n\tcopyCmdArgs = xselCopyArgs\n\n\tif _, err := exec.LookPath(xsel); err == nil {\n\t\treturn\n\t}\n\n\tpasteCmdArgs = termuxPasteArgs\n\tcopyCmdArgs = termuxCopyArgs\n\n\tif _, err := exec.LookPath(termuxClipboardSet); err == nil {\n\t\tif _, err := exec.LookPath(termuxClipboardGet); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tpasteCmdArgs = powershellExePasteArgs\n\tcopyCmdArgs = clipExeCopyArgs\n\ttrimDos = true\n\n\tif _, err := exec.LookPath(clipExe); err == nil {\n\t\tif _, err := exec.LookPath(powershellExe); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tUnsupported = true\n}\n\nfunc getPasteCommand() *exec.Cmd {\n\tif Primary {\n\t\tpasteCmdArgs = pasteCmdArgs[:1]\n\t}\n\treturn exec.Command(pasteCmdArgs[0], pasteCmdArgs[1:]...)\n}\n\nfunc getCopyCommand() *exec.Cmd {\n\tif Primary {\n\t\tcopyCmdArgs = copyCmdArgs[:1]\n\t}\n\treturn exec.Command(copyCmdArgs[0], copyCmdArgs[1:]...)\n}\n\nfunc readAll() (string, error) {\n\tif Unsupported {\n\t\treturn \"\", missingCommands\n\t}\n\tpasteCmd := getPasteCommand()\n\tout, err := pasteCmd.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresult := string(out)\n\tif trimDos && len(result) > 1 {\n\t\tresult = result[:len(result)-2]\n\t}\n\treturn result, nil\n}\n\nfunc writeAll(text string) error {\n\tif Unsupported {\n\t\treturn missingCommands\n\t}\n\tcopyCmd := getCopyCommand()\n\tin, err := copyCmd.StdinPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := copyCmd.Start(); err != nil {\n\t\treturn err\n\t}\n\tif _, err := in.Write([]byte(text)); err != nil {\n\t\treturn err\n\t}\n\tif err := in.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn copyCmd.Wait()\n}\n"
  },
  {
    "path": "vendor/github.com/atotto/clipboard/clipboard_windows.go",
    "content": "// Copyright 2013 @atotto. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage clipboard\n\nimport (\n\t\"runtime\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\nconst (\n\tcfUnicodetext = 13\n\tgmemMoveable  = 0x0002\n)\n\nvar (\n\tuser32                     = syscall.MustLoadDLL(\"user32\")\n\tisClipboardFormatAvailable = user32.MustFindProc(\"IsClipboardFormatAvailable\")\n\topenClipboard              = user32.MustFindProc(\"OpenClipboard\")\n\tcloseClipboard             = user32.MustFindProc(\"CloseClipboard\")\n\temptyClipboard             = user32.MustFindProc(\"EmptyClipboard\")\n\tgetClipboardData           = user32.MustFindProc(\"GetClipboardData\")\n\tsetClipboardData           = user32.MustFindProc(\"SetClipboardData\")\n\n\tkernel32     = syscall.NewLazyDLL(\"kernel32\")\n\tglobalAlloc  = kernel32.NewProc(\"GlobalAlloc\")\n\tglobalFree   = kernel32.NewProc(\"GlobalFree\")\n\tglobalLock   = kernel32.NewProc(\"GlobalLock\")\n\tglobalUnlock = kernel32.NewProc(\"GlobalUnlock\")\n\tlstrcpy      = kernel32.NewProc(\"lstrcpyW\")\n)\n\n// waitOpenClipboard opens the clipboard, waiting for up to a second to do so.\nfunc waitOpenClipboard() error {\n\tstarted := time.Now()\n\tlimit := started.Add(time.Second)\n\tvar r uintptr\n\tvar err error\n\tfor time.Now().Before(limit) {\n\t\tr, _, err = openClipboard.Call(0)\n\t\tif r != 0 {\n\t\t\treturn nil\n\t\t}\n\t\ttime.Sleep(time.Millisecond)\n\t}\n\treturn err\n}\n\nfunc readAll() (string, error) {\n\t// LockOSThread ensure that the whole method will keep executing on the same thread from begin to end (it actually locks the goroutine thread attribution).\n\t// Otherwise if the goroutine switch thread during execution (which is a common practice), the OpenClipboard and CloseClipboard will happen on two different threads, and it will result in a clipboard deadlock.\n\truntime.LockOSThread()\n\tdefer runtime.UnlockOSThread()\n\tif formatAvailable, _, err := isClipboardFormatAvailable.Call(cfUnicodetext); formatAvailable == 0 {\n\t\treturn \"\", err\n\t}\n\terr := waitOpenClipboard()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\th, _, err := getClipboardData.Call(cfUnicodetext)\n\tif h == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn \"\", err\n\t}\n\n\tl, _, err := globalLock.Call(h)\n\tif l == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn \"\", err\n\t}\n\n\ttext := syscall.UTF16ToString((*[1 << 20]uint16)(unsafe.Pointer(l))[:])\n\n\tr, _, err := globalUnlock.Call(h)\n\tif r == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn \"\", err\n\t}\n\n\tclosed, _, err := closeClipboard.Call()\n\tif closed == 0 {\n\t\treturn \"\", err\n\t}\n\treturn text, nil\n}\n\nfunc writeAll(text string) error {\n\t// LockOSThread ensure that the whole method will keep executing on the same thread from begin to end (it actually locks the goroutine thread attribution).\n\t// Otherwise if the goroutine switch thread during execution (which is a common practice), the OpenClipboard and CloseClipboard will happen on two different threads, and it will result in a clipboard deadlock.\n\truntime.LockOSThread()\n\tdefer runtime.UnlockOSThread()\n\n\terr := waitOpenClipboard()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tr, _, err := emptyClipboard.Call(0)\n\tif r == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn err\n\t}\n\n\tdata := syscall.StringToUTF16(text)\n\n\t// \"If the hMem parameter identifies a memory object, the object must have\n\t// been allocated using the function with the GMEM_MOVEABLE flag.\"\n\th, _, err := globalAlloc.Call(gmemMoveable, uintptr(len(data)*int(unsafe.Sizeof(data[0]))))\n\tif h == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif h != 0 {\n\t\t\tglobalFree.Call(h)\n\t\t}\n\t}()\n\n\tl, _, err := globalLock.Call(h)\n\tif l == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn err\n\t}\n\n\tr, _, err = lstrcpy.Call(l, uintptr(unsafe.Pointer(&data[0])))\n\tif r == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn err\n\t}\n\n\tr, _, err = globalUnlock.Call(h)\n\tif r == 0 {\n\t\tif err.(syscall.Errno) != 0 {\n\t\t\t_, _, _ = closeClipboard.Call()\n\t\t\treturn err\n\t\t}\n\t}\n\n\tr, _, err = setClipboardData.Call(cfUnicodetext, h)\n\tif r == 0 {\n\t\t_, _, _ = closeClipboard.Call()\n\t\treturn err\n\t}\n\th = 0 // suppress deferred cleanup\n\tclosed, _, err := closeClipboard.Call()\n\tif closed == 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt",
    "content": "AWS SDK for Go\nCopyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\nCopyright 2014-2015 Stripe, Inc.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go",
    "content": "package aws\n\n// AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing.\ntype AccountIDEndpointMode string\n\nconst (\n\t// AccountIDEndpointModeUnset indicates the AWS account ID will not be used for endpoint routing\n\tAccountIDEndpointModeUnset AccountIDEndpointMode = \"\"\n\n\t// AccountIDEndpointModePreferred indicates the AWS account ID will be used for endpoint routing if present\n\tAccountIDEndpointModePreferred = \"preferred\"\n\n\t// AccountIDEndpointModeRequired indicates an error will be returned if the AWS account ID is not resolved from identity\n\tAccountIDEndpointModeRequired = \"required\"\n\n\t// AccountIDEndpointModeDisabled indicates the AWS account ID will be ignored during endpoint routing\n\tAccountIDEndpointModeDisabled = \"disabled\"\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/arn/arn.go",
    "content": "// Package arn provides a parser for interacting with Amazon Resource Names.\npackage arn\n\nimport (\n\t\"errors\"\n\t\"strings\"\n)\n\nconst (\n\tarnDelimiter = \":\"\n\tarnSections  = 6\n\tarnPrefix    = \"arn:\"\n\n\t// zero-indexed\n\tsectionPartition = 1\n\tsectionService   = 2\n\tsectionRegion    = 3\n\tsectionAccountID = 4\n\tsectionResource  = 5\n\n\t// errors\n\tinvalidPrefix   = \"arn: invalid prefix\"\n\tinvalidSections = \"arn: not enough sections\"\n)\n\n// ARN captures the individual fields of an Amazon Resource Name.\n// See http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information.\ntype ARN struct {\n\t// The partition that the resource is in. For standard AWS regions, the partition is \"aws\". If you have resources in\n\t// other partitions, the partition is \"aws-partitionname\". For example, the partition for resources in the China\n\t// (Beijing) region is \"aws-cn\".\n\tPartition string\n\n\t// The service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS). For a list of\n\t// namespaces, see\n\t// http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces.\n\tService string\n\n\t// The region the resource resides in. Note that the ARNs for some resources do not require a region, so this\n\t// component might be omitted.\n\tRegion string\n\n\t// The ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. Note that the\n\t// ARNs for some resources don't require an account number, so this component might be omitted.\n\tAccountID string\n\n\t// The content of this part of the ARN varies by service. It often includes an indicator of the type of resource —\n\t// for example, an IAM user or Amazon RDS database - followed by a slash (/) or a colon (:), followed by the\n\t// resource name itself. Some services allows paths for resource names, as described in\n\t// http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-paths.\n\tResource string\n}\n\n// Parse parses an ARN into its constituent parts.\n//\n// Some example ARNs:\n// arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment\n// arn:aws:iam::123456789012:user/David\n// arn:aws:rds:eu-west-1:123456789012:db:mysql-db\n// arn:aws:s3:::my_corporate_bucket/exampleobject.png\nfunc Parse(arn string) (ARN, error) {\n\tif !strings.HasPrefix(arn, arnPrefix) {\n\t\treturn ARN{}, errors.New(invalidPrefix)\n\t}\n\tsections := strings.SplitN(arn, arnDelimiter, arnSections)\n\tif len(sections) != arnSections {\n\t\treturn ARN{}, errors.New(invalidSections)\n\t}\n\treturn ARN{\n\t\tPartition: sections[sectionPartition],\n\t\tService:   sections[sectionService],\n\t\tRegion:    sections[sectionRegion],\n\t\tAccountID: sections[sectionAccountID],\n\t\tResource:  sections[sectionResource],\n\t}, nil\n}\n\n// IsARN returns whether the given string is an arn\n// by looking for whether the string starts with arn:\nfunc IsARN(arn string) bool {\n\treturn strings.HasPrefix(arn, arnPrefix) && strings.Count(arn, \":\") >= arnSections-1\n}\n\n// String returns the canonical representation of the ARN\nfunc (arn ARN) String() string {\n\treturn arnPrefix +\n\t\tarn.Partition + arnDelimiter +\n\t\tarn.Service + arnDelimiter +\n\t\tarn.Region + arnDelimiter +\n\t\tarn.AccountID + arnDelimiter +\n\t\tarn.Resource\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/config.go",
    "content": "package aws\n\nimport (\n\t\"net/http\"\n\n\tsmithybearer \"github.com/aws/smithy-go/auth/bearer\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// HTTPClient provides the interface to provide custom HTTPClients. Generally\n// *http.Client is sufficient for most use cases. The HTTPClient should not\n// follow 301 or 302 redirects.\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// A Config provides service configuration for service clients.\ntype Config struct {\n\t// The region to send requests to. This parameter is required and must\n\t// be configured globally or on a per-client basis unless otherwise\n\t// noted. A full list of regions is found in the \"Regions and Endpoints\"\n\t// document.\n\t//\n\t// See http://docs.aws.amazon.com/general/latest/gr/rande.html for\n\t// information on AWS regions.\n\tRegion string\n\n\t// The credentials object to use when signing requests.\n\t// Use the LoadDefaultConfig to load configuration from all the SDK's supported\n\t// sources, and resolve credentials using the SDK's default credential chain.\n\tCredentials CredentialsProvider\n\n\t// The Bearer Authentication token provider to use for authenticating API\n\t// operation calls with a Bearer Authentication token. The API clients and\n\t// operation must support Bearer Authentication scheme in order for the\n\t// token provider to be used. API clients created with NewFromConfig will\n\t// automatically be configured with this option, if the API client support\n\t// Bearer Authentication.\n\t//\n\t// The SDK's config.LoadDefaultConfig can automatically populate this\n\t// option for external configuration options such as SSO session.\n\t// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html\n\tBearerAuthTokenProvider smithybearer.TokenProvider\n\n\t// The HTTP Client the SDK's API clients will use to invoke HTTP requests.\n\t// The SDK defaults to a BuildableClient allowing API clients to create\n\t// copies of the HTTP Client for service specific customizations.\n\t//\n\t// Use a (*http.Client) for custom behavior. Using a custom http.Client\n\t// will prevent the SDK from modifying the HTTP client.\n\tHTTPClient HTTPClient\n\n\t// An endpoint resolver that can be used to provide or override an endpoint\n\t// for the given service and region.\n\t//\n\t// See the `aws.EndpointResolver` documentation for additional usage\n\t// information.\n\t//\n\t// Deprecated: See Config.EndpointResolverWithOptions\n\tEndpointResolver EndpointResolver\n\n\t// An endpoint resolver that can be used to provide or override an endpoint\n\t// for the given service and region.\n\t//\n\t// When EndpointResolverWithOptions is specified, it will be used by a\n\t// service client rather than using EndpointResolver if also specified.\n\t//\n\t// See the `aws.EndpointResolverWithOptions` documentation for additional\n\t// usage information.\n\t//\n\t// Deprecated: with the release of endpoint resolution v2 in API clients,\n\t// EndpointResolver and EndpointResolverWithOptions are deprecated.\n\t// Providing a value for this field will likely prevent you from using\n\t// newer endpoint-related service features. See API client options\n\t// EndpointResolverV2 and BaseEndpoint.\n\tEndpointResolverWithOptions EndpointResolverWithOptions\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client\n\t// will call an operation that fails with a retryable error.\n\t//\n\t// API Clients will only use this value to construct a retryer if the\n\t// Config.Retryer member is not nil. This value will be ignored if\n\t// Retryer is not nil.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry model the API client will be created with.\n\t//\n\t// API Clients will only use this value to construct a retryer if the\n\t// Config.Retryer member is not nil. This value will be ignored if\n\t// Retryer is not nil.\n\tRetryMode RetryMode\n\n\t// Retryer is a function that provides a Retryer implementation. A Retryer\n\t// guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer.\n\t//\n\t// In general, the provider function should return a new instance of a\n\t// Retryer if you are attempting to provide a consistent Retryer\n\t// configuration across all clients. This will ensure that each client will\n\t// be provided a new instance of the Retryer implementation, and will avoid\n\t// issues such as sharing the same retry token bucket across services.\n\t//\n\t// If not nil, RetryMaxAttempts, and RetryMode will be ignored by API\n\t// clients.\n\tRetryer func() Retryer\n\n\t// ConfigSources are the sources that were used to construct the Config.\n\t// Allows for additional configuration to be loaded by clients.\n\tConfigSources []interface{}\n\n\t// APIOptions provides the set of middleware mutations modify how the API\n\t// client requests will be handled. This is useful for adding additional\n\t// tracing data to a request, or changing behavior of the SDK's client.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// The logger writer interface to write logging messages to. Defaults to\n\t// standard error.\n\tLogger logging.Logger\n\n\t// Configures the events that will be sent to the configured logger. This\n\t// can be used to configure the logging of signing, retries, request, and\n\t// responses of the SDK clients.\n\t//\n\t// See the ClientLogMode type documentation for the complete set of logging\n\t// modes and available configuration.\n\tClientLogMode ClientLogMode\n\n\t// The configured DefaultsMode. If not specified, service clients will\n\t// default to legacy.\n\t//\n\t// Supported modes are: auto, cross-region, in-region, legacy, mobile,\n\t// standard\n\tDefaultsMode DefaultsMode\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode\n\t// is set to DefaultsModeAuto and is initialized by\n\t// `config.LoadDefaultConfig`. You should not populate this structure\n\t// programmatically, or rely on the values here within your applications.\n\tRuntimeEnvironment RuntimeEnvironment\n\n\t// AppId is an optional application specific identifier that can be set.\n\t// When set it will be appended to the User-Agent header of every request\n\t// in the form of App/{AppId}. This variable is sourced from environment\n\t// variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.\n\t// See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for\n\t// more information on environment variables and shared config settings.\n\tAppID string\n\n\t// BaseEndpoint is an intermediary transfer location to a service specific\n\t// BaseEndpoint on a service's Options.\n\tBaseEndpoint *string\n\n\t// DisableRequestCompression toggles if an operation request could be\n\t// compressed or not. Will be set to false by default. This variable is sourced from\n\t// environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute\n\t// disable_request_compression\n\tDisableRequestCompression bool\n\n\t// RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be\n\t// compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively.\n\t// This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or\n\t// the shared config profile attribute request_min_compression_size_bytes\n\tRequestMinCompressSizeBytes int64\n\n\t// Controls how a resolved AWS account ID is handled for endpoint routing.\n\tAccountIDEndpointMode AccountIDEndpointMode\n}\n\n// NewConfig returns a new Config pointer that can be chained with builder\n// methods to set multiple configuration values inline without using pointers.\nfunc NewConfig() *Config {\n\treturn &Config{}\n}\n\n// Copy will return a shallow copy of the Config object.\nfunc (c Config) Copy() Config {\n\tcp := c\n\treturn cp\n}\n\n// EndpointDiscoveryEnableState indicates if endpoint discovery is\n// enabled, disabled, auto or unset state.\n//\n// Default behavior (Auto or Unset) indicates operations that require endpoint\n// discovery will use Endpoint Discovery by default. Operations that\n// optionally use Endpoint Discovery will not use Endpoint Discovery\n// unless EndpointDiscovery is explicitly enabled.\ntype EndpointDiscoveryEnableState uint\n\n// Enumeration values for EndpointDiscoveryEnableState\nconst (\n\t// EndpointDiscoveryUnset represents EndpointDiscoveryEnableState is unset.\n\t// Users do not need to use this value explicitly. The behavior for unset\n\t// is the same as for EndpointDiscoveryAuto.\n\tEndpointDiscoveryUnset EndpointDiscoveryEnableState = iota\n\n\t// EndpointDiscoveryAuto represents an AUTO state that allows endpoint\n\t// discovery only when required by the api. This is the default\n\t// configuration resolved by the client if endpoint discovery is neither\n\t// enabled or disabled.\n\tEndpointDiscoveryAuto // default state\n\n\t// EndpointDiscoveryDisabled indicates client MUST not perform endpoint\n\t// discovery even when required.\n\tEndpointDiscoveryDisabled\n\n\t// EndpointDiscoveryEnabled indicates client MUST always perform endpoint\n\t// discovery if supported for the operation.\n\tEndpointDiscoveryEnabled\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/context.go",
    "content": "package aws\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\ntype suppressedContext struct {\n\tcontext.Context\n}\n\nfunc (s *suppressedContext) Deadline() (deadline time.Time, ok bool) {\n\treturn time.Time{}, false\n}\n\nfunc (s *suppressedContext) Done() <-chan struct{} {\n\treturn nil\n}\n\nfunc (s *suppressedContext) Err() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go",
    "content": "package aws\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\tsdkrand \"github.com/aws/aws-sdk-go-v2/internal/rand\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sync/singleflight\"\n)\n\n// CredentialsCacheOptions are the options\ntype CredentialsCacheOptions struct {\n\n\t// ExpiryWindow will allow the credentials to trigger refreshing prior to\n\t// the credentials actually expiring. This is beneficial so race conditions\n\t// with expiring credentials do not cause request to fail unexpectedly\n\t// due to ExpiredTokenException exceptions.\n\t//\n\t// An ExpiryWindow of 10s would cause calls to IsExpired() to return true\n\t// 10 seconds before the credentials are actually expired. This can cause an\n\t// increased number of requests to refresh the credentials to occur.\n\t//\n\t// If ExpiryWindow is 0 or less it will be ignored.\n\tExpiryWindow time.Duration\n\n\t// ExpiryWindowJitterFrac provides a mechanism for randomizing the\n\t// expiration of credentials within the configured ExpiryWindow by a random\n\t// percentage. Valid values are between 0.0 and 1.0.\n\t//\n\t// As an example if ExpiryWindow is 60 seconds and ExpiryWindowJitterFrac\n\t// is 0.5 then credentials will be set to expire between 30 to 60 seconds\n\t// prior to their actual expiration time.\n\t//\n\t// If ExpiryWindow is 0 or less then ExpiryWindowJitterFrac is ignored.\n\t// If ExpiryWindowJitterFrac is 0 then no randomization will be applied to the window.\n\t// If ExpiryWindowJitterFrac < 0 the value will be treated as 0.\n\t// If ExpiryWindowJitterFrac > 1 the value will be treated as 1.\n\tExpiryWindowJitterFrac float64\n}\n\n// CredentialsCache provides caching and concurrency safe credentials retrieval\n// via the provider's retrieve method.\n//\n// CredentialsCache will look for optional interfaces on the Provider to adjust\n// how the credential cache handles credentials caching.\n//\n//   - HandleFailRefreshCredentialsCacheStrategy - Allows provider to handle\n//     credential refresh failures. This could return an updated Credentials\n//     value, or attempt another means of retrieving credentials.\n//\n//   - AdjustExpiresByCredentialsCacheStrategy - Allows provider to adjust how\n//     credentials Expires is modified. This could modify how the Credentials\n//     Expires is adjusted based on the CredentialsCache ExpiryWindow option.\n//     Such as providing a floor not to reduce the Expires below.\ntype CredentialsCache struct {\n\tprovider CredentialsProvider\n\n\toptions CredentialsCacheOptions\n\tcreds   atomic.Value\n\tsf      singleflight.Group\n}\n\n// NewCredentialsCache returns a CredentialsCache that wraps provider. Provider\n// is expected to not be nil. A variadic list of one or more functions can be\n// provided to modify the CredentialsCache configuration. This allows for\n// configuration of credential expiry window and jitter.\nfunc NewCredentialsCache(provider CredentialsProvider, optFns ...func(options *CredentialsCacheOptions)) *CredentialsCache {\n\toptions := CredentialsCacheOptions{}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.ExpiryWindow < 0 {\n\t\toptions.ExpiryWindow = 0\n\t}\n\n\tif options.ExpiryWindowJitterFrac < 0 {\n\t\toptions.ExpiryWindowJitterFrac = 0\n\t} else if options.ExpiryWindowJitterFrac > 1 {\n\t\toptions.ExpiryWindowJitterFrac = 1\n\t}\n\n\treturn &CredentialsCache{\n\t\tprovider: provider,\n\t\toptions:  options,\n\t}\n}\n\n// Retrieve returns the credentials. If the credentials have already been\n// retrieved, and not expired the cached credentials will be returned. If the\n// credentials have not been retrieved yet, or expired the provider's Retrieve\n// method will be called.\n//\n// Returns and error if the provider's retrieve method returns an error.\nfunc (p *CredentialsCache) Retrieve(ctx context.Context) (Credentials, error) {\n\tif creds, ok := p.getCreds(); ok && !creds.Expired() {\n\t\treturn creds, nil\n\t}\n\n\tresCh := p.sf.DoChan(\"\", func() (interface{}, error) {\n\t\treturn p.singleRetrieve(&suppressedContext{ctx})\n\t})\n\tselect {\n\tcase res := <-resCh:\n\t\treturn res.Val.(Credentials), res.Err\n\tcase <-ctx.Done():\n\t\treturn Credentials{}, &RequestCanceledError{Err: ctx.Err()}\n\t}\n}\n\nfunc (p *CredentialsCache) singleRetrieve(ctx context.Context) (interface{}, error) {\n\tcurrCreds, ok := p.getCreds()\n\tif ok && !currCreds.Expired() {\n\t\treturn currCreds, nil\n\t}\n\n\tnewCreds, err := p.provider.Retrieve(ctx)\n\tif err != nil {\n\t\thandleFailToRefresh := defaultHandleFailToRefresh\n\t\tif cs, ok := p.provider.(HandleFailRefreshCredentialsCacheStrategy); ok {\n\t\t\thandleFailToRefresh = cs.HandleFailToRefresh\n\t\t}\n\t\tnewCreds, err = handleFailToRefresh(ctx, currCreds, err)\n\t\tif err != nil {\n\t\t\treturn Credentials{}, fmt.Errorf(\"failed to refresh cached credentials, %w\", err)\n\t\t}\n\t}\n\n\tif newCreds.CanExpire && p.options.ExpiryWindow > 0 {\n\t\tadjustExpiresBy := defaultAdjustExpiresBy\n\t\tif cs, ok := p.provider.(AdjustExpiresByCredentialsCacheStrategy); ok {\n\t\t\tadjustExpiresBy = cs.AdjustExpiresBy\n\t\t}\n\n\t\trandFloat64, err := sdkrand.CryptoRandFloat64()\n\t\tif err != nil {\n\t\t\treturn Credentials{}, fmt.Errorf(\"failed to get random provider, %w\", err)\n\t\t}\n\n\t\tvar jitter time.Duration\n\t\tif p.options.ExpiryWindowJitterFrac > 0 {\n\t\t\tjitter = time.Duration(randFloat64 *\n\t\t\t\tp.options.ExpiryWindowJitterFrac * float64(p.options.ExpiryWindow))\n\t\t}\n\n\t\tnewCreds, err = adjustExpiresBy(newCreds, -(p.options.ExpiryWindow - jitter))\n\t\tif err != nil {\n\t\t\treturn Credentials{}, fmt.Errorf(\"failed to adjust credentials expires, %w\", err)\n\t\t}\n\t}\n\n\tp.creds.Store(&newCreds)\n\treturn newCreds, nil\n}\n\n// getCreds returns the currently stored credentials and true. Returning false\n// if no credentials were stored.\nfunc (p *CredentialsCache) getCreds() (Credentials, bool) {\n\tv := p.creds.Load()\n\tif v == nil {\n\t\treturn Credentials{}, false\n\t}\n\n\tc := v.(*Credentials)\n\tif c == nil || !c.HasKeys() {\n\t\treturn Credentials{}, false\n\t}\n\n\treturn *c, true\n}\n\n// Invalidate will invalidate the cached credentials. The next call to Retrieve\n// will cause the provider's Retrieve method to be called.\nfunc (p *CredentialsCache) Invalidate() {\n\tp.creds.Store((*Credentials)(nil))\n}\n\n// IsCredentialsProvider returns whether credential provider wrapped by CredentialsCache\n// matches the target provider type.\nfunc (p *CredentialsCache) IsCredentialsProvider(target CredentialsProvider) bool {\n\treturn IsCredentialsProvider(p.provider, target)\n}\n\n// HandleFailRefreshCredentialsCacheStrategy is an interface for\n// CredentialsCache to allow CredentialsProvider  how failed to refresh\n// credentials is handled.\ntype HandleFailRefreshCredentialsCacheStrategy interface {\n\t// Given the previously cached Credentials, if any, and refresh error, may\n\t// returns new or modified set of Credentials, or error.\n\t//\n\t// Credential caches may use default implementation if nil.\n\tHandleFailToRefresh(context.Context, Credentials, error) (Credentials, error)\n}\n\n// defaultHandleFailToRefresh returns the passed in error.\nfunc defaultHandleFailToRefresh(ctx context.Context, _ Credentials, err error) (Credentials, error) {\n\treturn Credentials{}, err\n}\n\n// AdjustExpiresByCredentialsCacheStrategy is an interface for CredentialCache\n// to allow CredentialsProvider to intercept adjustments to Credentials expiry\n// based on expectations and use cases of CredentialsProvider.\n//\n// Credential caches may use default implementation if nil.\ntype AdjustExpiresByCredentialsCacheStrategy interface {\n\t// Given a Credentials as input, applying any mutations and\n\t// returning the potentially updated Credentials, or error.\n\tAdjustExpiresBy(Credentials, time.Duration) (Credentials, error)\n}\n\n// defaultAdjustExpiresBy adds the duration to the passed in credentials Expires,\n// and returns the updated credentials value. If Credentials value's CanExpire\n// is false, the passed in credentials are returned unchanged.\nfunc defaultAdjustExpiresBy(creds Credentials, dur time.Duration) (Credentials, error) {\n\tif !creds.CanExpire {\n\t\treturn creds, nil\n\t}\n\n\tcreds.Expires = creds.Expires.Add(dur)\n\treturn creds, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go",
    "content": "package aws\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n)\n\n// AnonymousCredentials provides a sentinel CredentialsProvider that should be\n// used to instruct the SDK's signing middleware to not sign the request.\n//\n// Using `nil` credentials when configuring an API client will achieve the same\n// result. The AnonymousCredentials type allows you to configure the SDK's\n// external config loading to not attempt to source credentials from the shared\n// config or environment.\n//\n// For example you can use this CredentialsProvider with an API client's\n// Options to instruct the client not to sign a request for accessing public\n// S3 bucket objects.\n//\n// The following example demonstrates using the AnonymousCredentials to prevent\n// SDK's external config loading attempt to resolve credentials.\n//\n//\tcfg, err := config.LoadDefaultConfig(context.TODO(),\n//\t     config.WithCredentialsProvider(aws.AnonymousCredentials{}),\n//\t)\n//\tif err != nil {\n//\t     log.Fatalf(\"failed to load config, %v\", err)\n//\t}\n//\n//\tclient := s3.NewFromConfig(cfg)\n//\n// Alternatively you can leave the API client Option's `Credential` member to\n// nil. If using the `NewFromConfig` constructor you'll need to explicitly set\n// the `Credentials` member to nil, if the external config resolved a\n// credential provider.\n//\n//\tclient := s3.New(s3.Options{\n//\t     // Credentials defaults to a nil value.\n//\t})\n//\n// This can also be configured for specific operations calls too.\n//\n//\tcfg, err := config.LoadDefaultConfig(context.TODO())\n//\tif err != nil {\n//\t     log.Fatalf(\"failed to load config, %v\", err)\n//\t}\n//\n//\tclient := s3.NewFromConfig(config)\n//\n//\tresult, err := client.GetObject(context.TODO(), s3.GetObject{\n//\t     Bucket: aws.String(\"example-bucket\"),\n//\t     Key: aws.String(\"example-key\"),\n//\t}, func(o *s3.Options) {\n//\t     o.Credentials = nil\n//\t     // Or\n//\t     o.Credentials = aws.AnonymousCredentials{}\n//\t})\ntype AnonymousCredentials struct{}\n\n// Retrieve implements the CredentialsProvider interface, but will always\n// return error, and cannot be used to sign a request. The AnonymousCredentials\n// type is used as a sentinel type instructing the AWS request signing\n// middleware to not sign a request.\nfunc (AnonymousCredentials) Retrieve(context.Context) (Credentials, error) {\n\treturn Credentials{Source: \"AnonymousCredentials\"},\n\t\tfmt.Errorf(\"the AnonymousCredentials is not a valid credential provider, and cannot be used to sign AWS requests with\")\n}\n\n// A Credentials is the AWS credentials value for individual credential fields.\ntype Credentials struct {\n\t// AWS Access key ID\n\tAccessKeyID string\n\n\t// AWS Secret Access Key\n\tSecretAccessKey string\n\n\t// AWS Session Token\n\tSessionToken string\n\n\t// Source of the credentials\n\tSource string\n\n\t// States if the credentials can expire or not.\n\tCanExpire bool\n\n\t// The time the credentials will expire at. Should be ignored if CanExpire\n\t// is false.\n\tExpires time.Time\n\n\t// The ID of the account for the credentials.\n\tAccountID string\n}\n\n// Expired returns if the credentials have expired.\nfunc (v Credentials) Expired() bool {\n\tif v.CanExpire {\n\t\t// Calling Round(0) on the current time will truncate the monotonic\n\t\t// reading only. Ensures credential expiry time is always based on\n\t\t// reported wall-clock time.\n\t\treturn !v.Expires.After(sdk.NowTime().Round(0))\n\t}\n\n\treturn false\n}\n\n// HasKeys returns if the credentials keys are set.\nfunc (v Credentials) HasKeys() bool {\n\treturn len(v.AccessKeyID) > 0 && len(v.SecretAccessKey) > 0\n}\n\n// A CredentialsProvider is the interface for any component which will provide\n// credentials Credentials. A CredentialsProvider is required to manage its own\n// Expired state, and what to be expired means.\n//\n// A credentials provider implementation can be wrapped with a CredentialCache\n// to cache the credential value retrieved. Without the cache the SDK will\n// attempt to retrieve the credentials for every request.\ntype CredentialsProvider interface {\n\t// Retrieve returns nil if it successfully retrieved the value.\n\t// Error is returned if the value were not obtainable, or empty.\n\tRetrieve(ctx context.Context) (Credentials, error)\n}\n\n// CredentialsProviderFunc provides a helper wrapping a function value to\n// satisfy the CredentialsProvider interface.\ntype CredentialsProviderFunc func(context.Context) (Credentials, error)\n\n// Retrieve delegates to the function value the CredentialsProviderFunc wraps.\nfunc (fn CredentialsProviderFunc) Retrieve(ctx context.Context) (Credentials, error) {\n\treturn fn(ctx)\n}\n\ntype isCredentialsProvider interface {\n\tIsCredentialsProvider(CredentialsProvider) bool\n}\n\n// IsCredentialsProvider returns whether the target CredentialProvider is the same type as provider when comparing the\n// implementation type.\n//\n// If provider has a method IsCredentialsProvider(CredentialsProvider) bool it will be responsible for validating\n// whether target matches the credential provider type.\n//\n// When comparing the CredentialProvider implementations provider and target for equality, the following rules are used:\n//\n//\tIf provider is of type T and target is of type V, true if type *T is the same as type *V, otherwise false\n//\tIf provider is of type *T and target is of type V, true if type *T is the same as type *V, otherwise false\n//\tIf provider is of type T and target is of type *V, true if type *T is the same as type *V, otherwise false\n//\tIf provider is of type *T and target is of type *V,true if type *T is the same as type *V, otherwise false\nfunc IsCredentialsProvider(provider, target CredentialsProvider) bool {\n\tif target == nil || provider == nil {\n\t\treturn provider == target\n\t}\n\n\tif x, ok := provider.(isCredentialsProvider); ok {\n\t\treturn x.IsCredentialsProvider(target)\n\t}\n\n\ttargetType := reflect.TypeOf(target)\n\tif targetType.Kind() != reflect.Ptr {\n\t\ttargetType = reflect.PtrTo(targetType)\n\t}\n\n\tproviderType := reflect.TypeOf(provider)\n\tif providerType.Kind() != reflect.Ptr {\n\t\tproviderType = reflect.PtrTo(providerType)\n\t}\n\n\treturn targetType.AssignableTo(providerType)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go",
    "content": "package defaults\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nvar getGOOS = func() string {\n\treturn runtime.GOOS\n}\n\n// ResolveDefaultsModeAuto is used to determine the effective aws.DefaultsMode when the mode\n// is set to aws.DefaultsModeAuto.\nfunc ResolveDefaultsModeAuto(region string, environment aws.RuntimeEnvironment) aws.DefaultsMode {\n\tgoos := getGOOS()\n\tif goos == \"android\" || goos == \"ios\" {\n\t\treturn aws.DefaultsModeMobile\n\t}\n\n\tvar currentRegion string\n\tif len(environment.EnvironmentIdentifier) > 0 {\n\t\tcurrentRegion = environment.Region\n\t}\n\n\tif len(currentRegion) == 0 && len(environment.EC2InstanceMetadataRegion) > 0 {\n\t\tcurrentRegion = environment.EC2InstanceMetadataRegion\n\t}\n\n\tif len(region) > 0 && len(currentRegion) > 0 {\n\t\tif strings.EqualFold(region, currentRegion) {\n\t\t\treturn aws.DefaultsModeInRegion\n\t\t}\n\t\treturn aws.DefaultsModeCrossRegion\n\t}\n\n\treturn aws.DefaultsModeStandard\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go",
    "content": "package defaults\n\nimport (\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// Configuration is the set of SDK configuration options that are determined based\n// on the configured DefaultsMode.\ntype Configuration struct {\n\t// RetryMode is the configuration's default retry mode API clients should\n\t// use for constructing a Retryer.\n\tRetryMode aws.RetryMode\n\n\t// ConnectTimeout is the maximum amount of time a dial will wait for\n\t// a connect to complete.\n\t//\n\t// See https://pkg.go.dev/net#Dialer.Timeout\n\tConnectTimeout *time.Duration\n\n\t// TLSNegotiationTimeout specifies the maximum amount of time waiting to\n\t// wait for a TLS handshake.\n\t//\n\t// See https://pkg.go.dev/net/http#Transport.TLSHandshakeTimeout\n\tTLSNegotiationTimeout *time.Duration\n}\n\n// GetConnectTimeout returns the ConnectTimeout value, returns false if the value is not set.\nfunc (c *Configuration) GetConnectTimeout() (time.Duration, bool) {\n\tif c.ConnectTimeout == nil {\n\t\treturn 0, false\n\t}\n\treturn *c.ConnectTimeout, true\n}\n\n// GetTLSNegotiationTimeout returns the TLSNegotiationTimeout value, returns false if the value is not set.\nfunc (c *Configuration) GetTLSNegotiationTimeout() (time.Duration, bool) {\n\tif c.TLSNegotiationTimeout == nil {\n\t\treturn 0, false\n\t}\n\treturn *c.TLSNegotiationTimeout, true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go",
    "content": "// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsconfig. DO NOT EDIT.\n\npackage defaults\n\nimport (\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"time\"\n)\n\n// GetModeConfiguration returns the default Configuration descriptor for the given mode.\n//\n// Supports the following modes: cross-region, in-region, mobile, standard\nfunc GetModeConfiguration(mode aws.DefaultsMode) (Configuration, error) {\n\tvar mv aws.DefaultsMode\n\tmv.SetFromString(string(mode))\n\n\tswitch mv {\n\tcase aws.DefaultsModeCrossRegion:\n\t\tsettings := Configuration{\n\t\t\tConnectTimeout:        aws.Duration(3100 * time.Millisecond),\n\t\t\tRetryMode:             aws.RetryMode(\"standard\"),\n\t\t\tTLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond),\n\t\t}\n\t\treturn settings, nil\n\tcase aws.DefaultsModeInRegion:\n\t\tsettings := Configuration{\n\t\t\tConnectTimeout:        aws.Duration(1100 * time.Millisecond),\n\t\t\tRetryMode:             aws.RetryMode(\"standard\"),\n\t\t\tTLSNegotiationTimeout: aws.Duration(1100 * time.Millisecond),\n\t\t}\n\t\treturn settings, nil\n\tcase aws.DefaultsModeMobile:\n\t\tsettings := Configuration{\n\t\t\tConnectTimeout:        aws.Duration(30000 * time.Millisecond),\n\t\t\tRetryMode:             aws.RetryMode(\"standard\"),\n\t\t\tTLSNegotiationTimeout: aws.Duration(30000 * time.Millisecond),\n\t\t}\n\t\treturn settings, nil\n\tcase aws.DefaultsModeStandard:\n\t\tsettings := Configuration{\n\t\t\tConnectTimeout:        aws.Duration(3100 * time.Millisecond),\n\t\t\tRetryMode:             aws.RetryMode(\"standard\"),\n\t\t\tTLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond),\n\t\t}\n\t\treturn settings, nil\n\tdefault:\n\t\treturn Configuration{}, fmt.Errorf(\"unsupported defaults mode: %v\", mode)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go",
    "content": "// Package defaults provides recommended configuration values for AWS SDKs and CLIs.\npackage defaults\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go",
    "content": "// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsmode. DO NOT EDIT.\n\npackage aws\n\nimport (\n\t\"strings\"\n)\n\n// DefaultsMode is the SDK defaults mode setting.\ntype DefaultsMode string\n\n// The DefaultsMode constants.\nconst (\n\t// DefaultsModeAuto is an experimental mode that builds on the standard mode.\n\t// The SDK will attempt to discover the execution environment to determine the\n\t// appropriate settings automatically.\n\t//\n\t// Note that the auto detection is heuristics-based and does not guarantee 100%\n\t// accuracy. STANDARD mode will be used if the execution environment cannot\n\t// be determined. The auto detection might query EC2 Instance Metadata service\n\t// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html),\n\t// which might introduce latency. Therefore we recommend choosing an explicit\n\t// defaults_mode instead if startup latency is critical to your application\n\tDefaultsModeAuto DefaultsMode = \"auto\"\n\n\t// DefaultsModeCrossRegion builds on the standard mode and includes optimization\n\t// tailored for applications which call AWS services in a different region\n\t//\n\t// Note that the default values vended from this mode might change as best practices\n\t// may evolve. As a result, it is encouraged to perform tests when upgrading\n\t// the SDK\n\tDefaultsModeCrossRegion DefaultsMode = \"cross-region\"\n\n\t// DefaultsModeInRegion builds on the standard mode and includes optimization\n\t// tailored for applications which call AWS services from within the same AWS\n\t// region\n\t//\n\t// Note that the default values vended from this mode might change as best practices\n\t// may evolve. As a result, it is encouraged to perform tests when upgrading\n\t// the SDK\n\tDefaultsModeInRegion DefaultsMode = \"in-region\"\n\n\t// DefaultsModeLegacy provides default settings that vary per SDK and were used\n\t// prior to establishment of defaults_mode\n\tDefaultsModeLegacy DefaultsMode = \"legacy\"\n\n\t// DefaultsModeMobile builds on the standard mode and includes optimization\n\t// tailored for mobile applications\n\t//\n\t// Note that the default values vended from this mode might change as best practices\n\t// may evolve. As a result, it is encouraged to perform tests when upgrading\n\t// the SDK\n\tDefaultsModeMobile DefaultsMode = \"mobile\"\n\n\t// DefaultsModeStandard provides the latest recommended default values that\n\t// should be safe to run in most scenarios\n\t//\n\t// Note that the default values vended from this mode might change as best practices\n\t// may evolve. As a result, it is encouraged to perform tests when upgrading\n\t// the SDK\n\tDefaultsModeStandard DefaultsMode = \"standard\"\n)\n\n// SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches\n// the provided string when compared using EqualFold. If the value does not match a known\n// constant it will be set to as-is and the function will return false. As a special case, if the\n// provided value is a zero-length string, the mode will be set to LegacyDefaultsMode.\nfunc (d *DefaultsMode) SetFromString(v string) (ok bool) {\n\tswitch {\n\tcase strings.EqualFold(v, string(DefaultsModeAuto)):\n\t\t*d = DefaultsModeAuto\n\t\tok = true\n\tcase strings.EqualFold(v, string(DefaultsModeCrossRegion)):\n\t\t*d = DefaultsModeCrossRegion\n\t\tok = true\n\tcase strings.EqualFold(v, string(DefaultsModeInRegion)):\n\t\t*d = DefaultsModeInRegion\n\t\tok = true\n\tcase strings.EqualFold(v, string(DefaultsModeLegacy)):\n\t\t*d = DefaultsModeLegacy\n\t\tok = true\n\tcase strings.EqualFold(v, string(DefaultsModeMobile)):\n\t\t*d = DefaultsModeMobile\n\t\tok = true\n\tcase strings.EqualFold(v, string(DefaultsModeStandard)):\n\t\t*d = DefaultsModeStandard\n\t\tok = true\n\tcase len(v) == 0:\n\t\t*d = DefaultsModeLegacy\n\t\tok = true\n\tdefault:\n\t\t*d = DefaultsMode(v)\n\t}\n\treturn ok\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go",
    "content": "// Package aws provides the core SDK's utilities and shared types. Use this package's\n// utilities to simplify setting and reading API operations parameters.\n//\n// # Value and Pointer Conversion Utilities\n//\n// This package includes a helper conversion utility for each scalar type the SDK's\n// API use. These utilities make getting a pointer of the scalar, and dereferencing\n// a pointer easier.\n//\n// Each conversion utility comes in two forms. Value to Pointer and Pointer to Value.\n// The Pointer to value will safely dereference the pointer and return its value.\n// If the pointer was nil, the scalar's zero value will be returned.\n//\n// The value to pointer functions will be named after the scalar type. So get a\n// *string from a string value use the \"String\" function. This makes it easy to\n// to get pointer of a literal string value, because getting the address of a\n// literal requires assigning the value to a variable first.\n//\n//\tvar strPtr *string\n//\n//\t// Without the SDK's conversion functions\n//\tstr := \"my string\"\n//\tstrPtr = &str\n//\n//\t// With the SDK's conversion functions\n//\tstrPtr = aws.String(\"my string\")\n//\n//\t// Convert *string to string value\n//\tstr = aws.ToString(strPtr)\n//\n// In addition to scalars the aws package also includes conversion utilities for\n// map and slice for commonly types used in API parameters. The map and slice\n// conversion functions use similar naming pattern as the scalar conversion\n// functions.\n//\n//\tvar strPtrs []*string\n//\tvar strs []string = []string{\"Go\", \"Gophers\", \"Go\"}\n//\n//\t// Convert []string to []*string\n//\tstrPtrs = aws.StringSlice(strs)\n//\n//\t// Convert []*string to []string\n//\tstrs = aws.ToStringSlice(strPtrs)\n//\n// # SDK Default HTTP Client\n//\n// The SDK will use the http.DefaultClient if a HTTP client is not provided to\n// the SDK's Session, or service client constructor. This means that if the\n// http.DefaultClient is modified by other components of your application the\n// modifications will be picked up by the SDK as well.\n//\n// In some cases this might be intended, but it is a better practice to create\n// a custom HTTP Client to share explicitly through your application. You can\n// configure the SDK to use the custom HTTP Client by setting the HTTPClient\n// value of the SDK's Config type when creating a Session or service client.\npackage aws\n\n// generate.go uses a build tag of \"ignore\", go run doesn't need to specify\n// this because go run ignores all build flags when running a go file directly.\n//go:generate go run -tags codegen generate.go\n//go:generate go run -tags codegen logging_generate.go\n//go:generate gofmt -w -s .\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go",
    "content": "package aws\n\nimport (\n\t\"fmt\"\n)\n\n// DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior.\ntype DualStackEndpointState uint\n\nconst (\n\t// DualStackEndpointStateUnset is the default value behavior for dual-stack endpoint resolution.\n\tDualStackEndpointStateUnset DualStackEndpointState = iota\n\n\t// DualStackEndpointStateEnabled enables dual-stack endpoint resolution for service endpoints.\n\tDualStackEndpointStateEnabled\n\n\t// DualStackEndpointStateDisabled disables dual-stack endpoint resolution for endpoints.\n\tDualStackEndpointStateDisabled\n)\n\n// GetUseDualStackEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value.\n// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState.\nfunc GetUseDualStackEndpoint(options ...interface{}) (value DualStackEndpointState, found bool) {\n\ttype iface interface {\n\t\tGetUseDualStackEndpoint() DualStackEndpointState\n\t}\n\tfor _, option := range options {\n\t\tif i, ok := option.(iface); ok {\n\t\t\tvalue = i.GetUseDualStackEndpoint()\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value, found\n}\n\n// FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior.\ntype FIPSEndpointState uint\n\nconst (\n\t// FIPSEndpointStateUnset is the default value behavior for FIPS endpoint resolution.\n\tFIPSEndpointStateUnset FIPSEndpointState = iota\n\n\t// FIPSEndpointStateEnabled enables FIPS endpoint resolution for service endpoints.\n\tFIPSEndpointStateEnabled\n\n\t// FIPSEndpointStateDisabled disables FIPS endpoint resolution for endpoints.\n\tFIPSEndpointStateDisabled\n)\n\n// GetUseFIPSEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value.\n// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState.\nfunc GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found bool) {\n\ttype iface interface {\n\t\tGetUseFIPSEndpoint() FIPSEndpointState\n\t}\n\tfor _, option := range options {\n\t\tif i, ok := option.(iface); ok {\n\t\t\tvalue = i.GetUseFIPSEndpoint()\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value, found\n}\n\n// Endpoint represents the endpoint a service client should make API operation\n// calls to.\n//\n// The SDK will automatically resolve these endpoints per API client using an\n// internal endpoint resolvers. If you'd like to provide custom endpoint\n// resolving behavior you can implement the EndpointResolver interface.\n//\n// Deprecated: This structure was used with the global [EndpointResolver]\n// interface, which has been deprecated in favor of service-specific endpoint\n// resolution. See the deprecation docs on that interface for more information.\ntype Endpoint struct {\n\t// The base URL endpoint the SDK API clients will use to make API calls to.\n\t// The SDK will suffix URI path and query elements to this endpoint.\n\tURL string\n\n\t// Specifies if the endpoint's hostname can be modified by the SDK's API\n\t// client.\n\t//\n\t// If the hostname is mutable the SDK API clients may modify any part of\n\t// the hostname based on the requirements of the API, (e.g. adding, or\n\t// removing content in the hostname). Such as, Amazon S3 API client\n\t// prefixing \"bucketname\" to the hostname, or changing the\n\t// hostname service name component from \"s3.\" to \"s3-accesspoint.dualstack.\"\n\t// for the dualstack endpoint of an S3 Accesspoint resource.\n\t//\n\t// Care should be taken when providing a custom endpoint for an API. If the\n\t// endpoint hostname is mutable, and the client cannot modify the endpoint\n\t// correctly, the operation call will most likely fail, or have undefined\n\t// behavior.\n\t//\n\t// If hostname is immutable, the SDK API clients will not modify the\n\t// hostname of the URL. This may cause the API client not to function\n\t// correctly if the API requires the operation specific hostname values\n\t// to be used by the client.\n\t//\n\t// This flag does not modify the API client's behavior if this endpoint\n\t// will be used instead of Endpoint Discovery, or if the endpoint will be\n\t// used to perform Endpoint Discovery. That behavior is configured via the\n\t// API Client's Options.\n\tHostnameImmutable bool\n\n\t// The AWS partition the endpoint belongs to.\n\tPartitionID string\n\n\t// The service name that should be used for signing the requests to the\n\t// endpoint.\n\tSigningName string\n\n\t// The region that should be used for signing the request to the endpoint.\n\tSigningRegion string\n\n\t// The signing method that should be used for signing the requests to the\n\t// endpoint.\n\tSigningMethod string\n\n\t// The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata.\n\t// When providing a custom endpoint, you should set the source as EndpointSourceCustom.\n\t// If source is not provided when providing a custom endpoint, the SDK may not\n\t// perform required host mutations correctly. Source should be used along with\n\t// HostnameImmutable property as per the usage requirement.\n\tSource EndpointSource\n}\n\n// EndpointSource is the endpoint source type.\n//\n// Deprecated: The global [Endpoint] structure is deprecated.\ntype EndpointSource int\n\nconst (\n\t// EndpointSourceServiceMetadata denotes service modeled endpoint metadata is used as Endpoint Source.\n\tEndpointSourceServiceMetadata EndpointSource = iota\n\n\t// EndpointSourceCustom denotes endpoint is a custom endpoint. This source should be used when\n\t// user provides a custom endpoint to be used by the SDK.\n\tEndpointSourceCustom\n)\n\n// EndpointNotFoundError is a sentinel error to indicate that the\n// EndpointResolver implementation was unable to resolve an endpoint for the\n// given service and region. Resolvers should use this to indicate that an API\n// client should fallback and attempt to use it's internal default resolver to\n// resolve the endpoint.\ntype EndpointNotFoundError struct {\n\tErr error\n}\n\n// Error is the error message.\nfunc (e *EndpointNotFoundError) Error() string {\n\treturn fmt.Sprintf(\"endpoint not found, %v\", e.Err)\n}\n\n// Unwrap returns the underlying error.\nfunc (e *EndpointNotFoundError) Unwrap() error {\n\treturn e.Err\n}\n\n// EndpointResolver is an endpoint resolver that can be used to provide or\n// override an endpoint for the given service and region. API clients will\n// attempt to use the EndpointResolver first to resolve an endpoint if\n// available. If the EndpointResolver returns an EndpointNotFoundError error,\n// API clients will fallback to attempting to resolve the endpoint using its\n// internal default endpoint resolver.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. The API\n// for endpoint resolution is now unique to each service and is set via the\n// EndpointResolverV2 field on service client options. Setting a value for\n// EndpointResolver on aws.Config or service client options will prevent you\n// from using any endpoint-related service features released after the\n// introduction of EndpointResolverV2. You may also encounter broken or\n// unexpected behavior when using the old global interface with services that\n// use many endpoint-related customizations such as S3.\ntype EndpointResolver interface {\n\tResolveEndpoint(service, region string) (Endpoint, error)\n}\n\n// EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. See\n// deprecation docs on [EndpointResolver].\ntype EndpointResolverFunc func(service, region string) (Endpoint, error)\n\n// ResolveEndpoint calls the wrapped function and returns the results.\nfunc (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) {\n\treturn e(service, region)\n}\n\n// EndpointResolverWithOptions is an endpoint resolver that can be used to provide or\n// override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will\n// attempt to use the EndpointResolverWithOptions first to resolve an endpoint if\n// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error,\n// API clients will fallback to attempting to resolve the endpoint using its\n// internal default endpoint resolver.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. See\n// deprecation docs on [EndpointResolver].\ntype EndpointResolverWithOptions interface {\n\tResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error)\n}\n\n// EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. See\n// deprecation docs on [EndpointResolver].\ntype EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error)\n\n// ResolveEndpoint calls the wrapped function and returns the results.\nfunc (e EndpointResolverWithOptionsFunc) ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) {\n\treturn e(service, region, options...)\n}\n\n// GetDisableHTTPS takes a service's EndpointResolverOptions and returns the DisableHTTPS value.\n// Returns boolean false if the provided options does not have a method to retrieve the DisableHTTPS.\nfunc GetDisableHTTPS(options ...interface{}) (value bool, found bool) {\n\ttype iface interface {\n\t\tGetDisableHTTPS() bool\n\t}\n\tfor _, option := range options {\n\t\tif i, ok := option.(iface); ok {\n\t\t\tvalue = i.GetDisableHTTPS()\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value, found\n}\n\n// GetResolvedRegion takes a service's EndpointResolverOptions and returns the ResolvedRegion value.\n// Returns boolean false if the provided options does not have a method to retrieve the ResolvedRegion.\nfunc GetResolvedRegion(options ...interface{}) (value string, found bool) {\n\ttype iface interface {\n\t\tGetResolvedRegion() string\n\t}\n\tfor _, option := range options {\n\t\tif i, ok := option.(iface); ok {\n\t\t\tvalue = i.GetResolvedRegion()\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value, found\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/errors.go",
    "content": "package aws\n\n// MissingRegionError is an error that is returned if region configuration\n// value was not found.\ntype MissingRegionError struct{}\n\nfunc (*MissingRegionError) Error() string {\n\treturn \"an AWS region is required, but was not found\"\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go",
    "content": "// Code generated by aws/generate.go DO NOT EDIT.\n\npackage aws\n\nimport (\n\t\"github.com/aws/smithy-go/ptr\"\n\t\"time\"\n)\n\n// ToBool returns bool value dereferenced if the passed\n// in pointer was not nil. Returns a bool zero value if the\n// pointer was nil.\nfunc ToBool(p *bool) (v bool) {\n\treturn ptr.ToBool(p)\n}\n\n// ToBoolSlice returns a slice of bool values, that are\n// dereferenced if the passed in pointer was not nil. Returns a bool\n// zero value if the pointer was nil.\nfunc ToBoolSlice(vs []*bool) []bool {\n\treturn ptr.ToBoolSlice(vs)\n}\n\n// ToBoolMap returns a map of bool values, that are\n// dereferenced if the passed in pointer was not nil. The bool\n// zero value is used if the pointer was nil.\nfunc ToBoolMap(vs map[string]*bool) map[string]bool {\n\treturn ptr.ToBoolMap(vs)\n}\n\n// ToByte returns byte value dereferenced if the passed\n// in pointer was not nil. Returns a byte zero value if the\n// pointer was nil.\nfunc ToByte(p *byte) (v byte) {\n\treturn ptr.ToByte(p)\n}\n\n// ToByteSlice returns a slice of byte values, that are\n// dereferenced if the passed in pointer was not nil. Returns a byte\n// zero value if the pointer was nil.\nfunc ToByteSlice(vs []*byte) []byte {\n\treturn ptr.ToByteSlice(vs)\n}\n\n// ToByteMap returns a map of byte values, that are\n// dereferenced if the passed in pointer was not nil. The byte\n// zero value is used if the pointer was nil.\nfunc ToByteMap(vs map[string]*byte) map[string]byte {\n\treturn ptr.ToByteMap(vs)\n}\n\n// ToString returns string value dereferenced if the passed\n// in pointer was not nil. Returns a string zero value if the\n// pointer was nil.\nfunc ToString(p *string) (v string) {\n\treturn ptr.ToString(p)\n}\n\n// ToStringSlice returns a slice of string values, that are\n// dereferenced if the passed in pointer was not nil. Returns a string\n// zero value if the pointer was nil.\nfunc ToStringSlice(vs []*string) []string {\n\treturn ptr.ToStringSlice(vs)\n}\n\n// ToStringMap returns a map of string values, that are\n// dereferenced if the passed in pointer was not nil. The string\n// zero value is used if the pointer was nil.\nfunc ToStringMap(vs map[string]*string) map[string]string {\n\treturn ptr.ToStringMap(vs)\n}\n\n// ToInt returns int value dereferenced if the passed\n// in pointer was not nil. Returns a int zero value if the\n// pointer was nil.\nfunc ToInt(p *int) (v int) {\n\treturn ptr.ToInt(p)\n}\n\n// ToIntSlice returns a slice of int values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int\n// zero value if the pointer was nil.\nfunc ToIntSlice(vs []*int) []int {\n\treturn ptr.ToIntSlice(vs)\n}\n\n// ToIntMap returns a map of int values, that are\n// dereferenced if the passed in pointer was not nil. The int\n// zero value is used if the pointer was nil.\nfunc ToIntMap(vs map[string]*int) map[string]int {\n\treturn ptr.ToIntMap(vs)\n}\n\n// ToInt8 returns int8 value dereferenced if the passed\n// in pointer was not nil. Returns a int8 zero value if the\n// pointer was nil.\nfunc ToInt8(p *int8) (v int8) {\n\treturn ptr.ToInt8(p)\n}\n\n// ToInt8Slice returns a slice of int8 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int8\n// zero value if the pointer was nil.\nfunc ToInt8Slice(vs []*int8) []int8 {\n\treturn ptr.ToInt8Slice(vs)\n}\n\n// ToInt8Map returns a map of int8 values, that are\n// dereferenced if the passed in pointer was not nil. The int8\n// zero value is used if the pointer was nil.\nfunc ToInt8Map(vs map[string]*int8) map[string]int8 {\n\treturn ptr.ToInt8Map(vs)\n}\n\n// ToInt16 returns int16 value dereferenced if the passed\n// in pointer was not nil. Returns a int16 zero value if the\n// pointer was nil.\nfunc ToInt16(p *int16) (v int16) {\n\treturn ptr.ToInt16(p)\n}\n\n// ToInt16Slice returns a slice of int16 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int16\n// zero value if the pointer was nil.\nfunc ToInt16Slice(vs []*int16) []int16 {\n\treturn ptr.ToInt16Slice(vs)\n}\n\n// ToInt16Map returns a map of int16 values, that are\n// dereferenced if the passed in pointer was not nil. The int16\n// zero value is used if the pointer was nil.\nfunc ToInt16Map(vs map[string]*int16) map[string]int16 {\n\treturn ptr.ToInt16Map(vs)\n}\n\n// ToInt32 returns int32 value dereferenced if the passed\n// in pointer was not nil. Returns a int32 zero value if the\n// pointer was nil.\nfunc ToInt32(p *int32) (v int32) {\n\treturn ptr.ToInt32(p)\n}\n\n// ToInt32Slice returns a slice of int32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int32\n// zero value if the pointer was nil.\nfunc ToInt32Slice(vs []*int32) []int32 {\n\treturn ptr.ToInt32Slice(vs)\n}\n\n// ToInt32Map returns a map of int32 values, that are\n// dereferenced if the passed in pointer was not nil. The int32\n// zero value is used if the pointer was nil.\nfunc ToInt32Map(vs map[string]*int32) map[string]int32 {\n\treturn ptr.ToInt32Map(vs)\n}\n\n// ToInt64 returns int64 value dereferenced if the passed\n// in pointer was not nil. Returns a int64 zero value if the\n// pointer was nil.\nfunc ToInt64(p *int64) (v int64) {\n\treturn ptr.ToInt64(p)\n}\n\n// ToInt64Slice returns a slice of int64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int64\n// zero value if the pointer was nil.\nfunc ToInt64Slice(vs []*int64) []int64 {\n\treturn ptr.ToInt64Slice(vs)\n}\n\n// ToInt64Map returns a map of int64 values, that are\n// dereferenced if the passed in pointer was not nil. The int64\n// zero value is used if the pointer was nil.\nfunc ToInt64Map(vs map[string]*int64) map[string]int64 {\n\treturn ptr.ToInt64Map(vs)\n}\n\n// ToUint returns uint value dereferenced if the passed\n// in pointer was not nil. Returns a uint zero value if the\n// pointer was nil.\nfunc ToUint(p *uint) (v uint) {\n\treturn ptr.ToUint(p)\n}\n\n// ToUintSlice returns a slice of uint values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint\n// zero value if the pointer was nil.\nfunc ToUintSlice(vs []*uint) []uint {\n\treturn ptr.ToUintSlice(vs)\n}\n\n// ToUintMap returns a map of uint values, that are\n// dereferenced if the passed in pointer was not nil. The uint\n// zero value is used if the pointer was nil.\nfunc ToUintMap(vs map[string]*uint) map[string]uint {\n\treturn ptr.ToUintMap(vs)\n}\n\n// ToUint8 returns uint8 value dereferenced if the passed\n// in pointer was not nil. Returns a uint8 zero value if the\n// pointer was nil.\nfunc ToUint8(p *uint8) (v uint8) {\n\treturn ptr.ToUint8(p)\n}\n\n// ToUint8Slice returns a slice of uint8 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint8\n// zero value if the pointer was nil.\nfunc ToUint8Slice(vs []*uint8) []uint8 {\n\treturn ptr.ToUint8Slice(vs)\n}\n\n// ToUint8Map returns a map of uint8 values, that are\n// dereferenced if the passed in pointer was not nil. The uint8\n// zero value is used if the pointer was nil.\nfunc ToUint8Map(vs map[string]*uint8) map[string]uint8 {\n\treturn ptr.ToUint8Map(vs)\n}\n\n// ToUint16 returns uint16 value dereferenced if the passed\n// in pointer was not nil. Returns a uint16 zero value if the\n// pointer was nil.\nfunc ToUint16(p *uint16) (v uint16) {\n\treturn ptr.ToUint16(p)\n}\n\n// ToUint16Slice returns a slice of uint16 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint16\n// zero value if the pointer was nil.\nfunc ToUint16Slice(vs []*uint16) []uint16 {\n\treturn ptr.ToUint16Slice(vs)\n}\n\n// ToUint16Map returns a map of uint16 values, that are\n// dereferenced if the passed in pointer was not nil. The uint16\n// zero value is used if the pointer was nil.\nfunc ToUint16Map(vs map[string]*uint16) map[string]uint16 {\n\treturn ptr.ToUint16Map(vs)\n}\n\n// ToUint32 returns uint32 value dereferenced if the passed\n// in pointer was not nil. Returns a uint32 zero value if the\n// pointer was nil.\nfunc ToUint32(p *uint32) (v uint32) {\n\treturn ptr.ToUint32(p)\n}\n\n// ToUint32Slice returns a slice of uint32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint32\n// zero value if the pointer was nil.\nfunc ToUint32Slice(vs []*uint32) []uint32 {\n\treturn ptr.ToUint32Slice(vs)\n}\n\n// ToUint32Map returns a map of uint32 values, that are\n// dereferenced if the passed in pointer was not nil. The uint32\n// zero value is used if the pointer was nil.\nfunc ToUint32Map(vs map[string]*uint32) map[string]uint32 {\n\treturn ptr.ToUint32Map(vs)\n}\n\n// ToUint64 returns uint64 value dereferenced if the passed\n// in pointer was not nil. Returns a uint64 zero value if the\n// pointer was nil.\nfunc ToUint64(p *uint64) (v uint64) {\n\treturn ptr.ToUint64(p)\n}\n\n// ToUint64Slice returns a slice of uint64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint64\n// zero value if the pointer was nil.\nfunc ToUint64Slice(vs []*uint64) []uint64 {\n\treturn ptr.ToUint64Slice(vs)\n}\n\n// ToUint64Map returns a map of uint64 values, that are\n// dereferenced if the passed in pointer was not nil. The uint64\n// zero value is used if the pointer was nil.\nfunc ToUint64Map(vs map[string]*uint64) map[string]uint64 {\n\treturn ptr.ToUint64Map(vs)\n}\n\n// ToFloat32 returns float32 value dereferenced if the passed\n// in pointer was not nil. Returns a float32 zero value if the\n// pointer was nil.\nfunc ToFloat32(p *float32) (v float32) {\n\treturn ptr.ToFloat32(p)\n}\n\n// ToFloat32Slice returns a slice of float32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a float32\n// zero value if the pointer was nil.\nfunc ToFloat32Slice(vs []*float32) []float32 {\n\treturn ptr.ToFloat32Slice(vs)\n}\n\n// ToFloat32Map returns a map of float32 values, that are\n// dereferenced if the passed in pointer was not nil. The float32\n// zero value is used if the pointer was nil.\nfunc ToFloat32Map(vs map[string]*float32) map[string]float32 {\n\treturn ptr.ToFloat32Map(vs)\n}\n\n// ToFloat64 returns float64 value dereferenced if the passed\n// in pointer was not nil. Returns a float64 zero value if the\n// pointer was nil.\nfunc ToFloat64(p *float64) (v float64) {\n\treturn ptr.ToFloat64(p)\n}\n\n// ToFloat64Slice returns a slice of float64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a float64\n// zero value if the pointer was nil.\nfunc ToFloat64Slice(vs []*float64) []float64 {\n\treturn ptr.ToFloat64Slice(vs)\n}\n\n// ToFloat64Map returns a map of float64 values, that are\n// dereferenced if the passed in pointer was not nil. The float64\n// zero value is used if the pointer was nil.\nfunc ToFloat64Map(vs map[string]*float64) map[string]float64 {\n\treturn ptr.ToFloat64Map(vs)\n}\n\n// ToTime returns time.Time value dereferenced if the passed\n// in pointer was not nil. Returns a time.Time zero value if the\n// pointer was nil.\nfunc ToTime(p *time.Time) (v time.Time) {\n\treturn ptr.ToTime(p)\n}\n\n// ToTimeSlice returns a slice of time.Time values, that are\n// dereferenced if the passed in pointer was not nil. Returns a time.Time\n// zero value if the pointer was nil.\nfunc ToTimeSlice(vs []*time.Time) []time.Time {\n\treturn ptr.ToTimeSlice(vs)\n}\n\n// ToTimeMap returns a map of time.Time values, that are\n// dereferenced if the passed in pointer was not nil. The time.Time\n// zero value is used if the pointer was nil.\nfunc ToTimeMap(vs map[string]*time.Time) map[string]time.Time {\n\treturn ptr.ToTimeMap(vs)\n}\n\n// ToDuration returns time.Duration value dereferenced if the passed\n// in pointer was not nil. Returns a time.Duration zero value if the\n// pointer was nil.\nfunc ToDuration(p *time.Duration) (v time.Duration) {\n\treturn ptr.ToDuration(p)\n}\n\n// ToDurationSlice returns a slice of time.Duration values, that are\n// dereferenced if the passed in pointer was not nil. Returns a time.Duration\n// zero value if the pointer was nil.\nfunc ToDurationSlice(vs []*time.Duration) []time.Duration {\n\treturn ptr.ToDurationSlice(vs)\n}\n\n// ToDurationMap returns a map of time.Duration values, that are\n// dereferenced if the passed in pointer was not nil. The time.Duration\n// zero value is used if the pointer was nil.\nfunc ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration {\n\treturn ptr.ToDurationMap(vs)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage aws\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.30.3\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go",
    "content": "// Code generated by aws/logging_generate.go DO NOT EDIT.\n\npackage aws\n\n// ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where\n// each bit is a flag that describes the logging behavior for one or more client components.\n// The entire 64-bit group is reserved for later expansion by the SDK.\n//\n// Example: Setting ClientLogMode to enable logging of retries and requests\n//\n//\tclientLogMode := aws.LogRetries | aws.LogRequest\n//\n// Example: Adding an additional log mode to an existing ClientLogMode value\n//\n//\tclientLogMode |= aws.LogResponse\ntype ClientLogMode uint64\n\n// Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events.\nconst (\n\tLogSigning ClientLogMode = 1 << (64 - 1 - iota)\n\tLogRetries\n\tLogRequest\n\tLogRequestWithBody\n\tLogResponse\n\tLogResponseWithBody\n\tLogDeprecatedUsage\n\tLogRequestEventMessage\n\tLogResponseEventMessage\n)\n\n// IsSigning returns whether the Signing logging mode bit is set\nfunc (m ClientLogMode) IsSigning() bool {\n\treturn m&LogSigning != 0\n}\n\n// IsRetries returns whether the Retries logging mode bit is set\nfunc (m ClientLogMode) IsRetries() bool {\n\treturn m&LogRetries != 0\n}\n\n// IsRequest returns whether the Request logging mode bit is set\nfunc (m ClientLogMode) IsRequest() bool {\n\treturn m&LogRequest != 0\n}\n\n// IsRequestWithBody returns whether the RequestWithBody logging mode bit is set\nfunc (m ClientLogMode) IsRequestWithBody() bool {\n\treturn m&LogRequestWithBody != 0\n}\n\n// IsResponse returns whether the Response logging mode bit is set\nfunc (m ClientLogMode) IsResponse() bool {\n\treturn m&LogResponse != 0\n}\n\n// IsResponseWithBody returns whether the ResponseWithBody logging mode bit is set\nfunc (m ClientLogMode) IsResponseWithBody() bool {\n\treturn m&LogResponseWithBody != 0\n}\n\n// IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set\nfunc (m ClientLogMode) IsDeprecatedUsage() bool {\n\treturn m&LogDeprecatedUsage != 0\n}\n\n// IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set\nfunc (m ClientLogMode) IsRequestEventMessage() bool {\n\treturn m&LogRequestEventMessage != 0\n}\n\n// IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set\nfunc (m ClientLogMode) IsResponseEventMessage() bool {\n\treturn m&LogResponseEventMessage != 0\n}\n\n// ClearSigning clears the Signing logging mode bit\nfunc (m *ClientLogMode) ClearSigning() {\n\t*m &^= LogSigning\n}\n\n// ClearRetries clears the Retries logging mode bit\nfunc (m *ClientLogMode) ClearRetries() {\n\t*m &^= LogRetries\n}\n\n// ClearRequest clears the Request logging mode bit\nfunc (m *ClientLogMode) ClearRequest() {\n\t*m &^= LogRequest\n}\n\n// ClearRequestWithBody clears the RequestWithBody logging mode bit\nfunc (m *ClientLogMode) ClearRequestWithBody() {\n\t*m &^= LogRequestWithBody\n}\n\n// ClearResponse clears the Response logging mode bit\nfunc (m *ClientLogMode) ClearResponse() {\n\t*m &^= LogResponse\n}\n\n// ClearResponseWithBody clears the ResponseWithBody logging mode bit\nfunc (m *ClientLogMode) ClearResponseWithBody() {\n\t*m &^= LogResponseWithBody\n}\n\n// ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit\nfunc (m *ClientLogMode) ClearDeprecatedUsage() {\n\t*m &^= LogDeprecatedUsage\n}\n\n// ClearRequestEventMessage clears the RequestEventMessage logging mode bit\nfunc (m *ClientLogMode) ClearRequestEventMessage() {\n\t*m &^= LogRequestEventMessage\n}\n\n// ClearResponseEventMessage clears the ResponseEventMessage logging mode bit\nfunc (m *ClientLogMode) ClearResponseEventMessage() {\n\t*m &^= LogResponseEventMessage\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go",
    "content": "//go:build clientlogmode\n// +build clientlogmode\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nvar config = struct {\n\tModeBits []string\n}{\n\t// Items should be appended only to keep bit-flag positions stable\n\tModeBits: []string{\n\t\t\"Signing\",\n\t\t\"Retries\",\n\t\t\"Request\",\n\t\t\"RequestWithBody\",\n\t\t\"Response\",\n\t\t\"ResponseWithBody\",\n\t\t\"DeprecatedUsage\",\n\t\t\"RequestEventMessage\",\n\t\t\"ResponseEventMessage\",\n\t},\n}\n\nfunc bitName(name string) string {\n\treturn strings.ToUpper(name[:1]) + name[1:]\n}\n\nvar tmpl = template.Must(template.New(\"ClientLogMode\").Funcs(map[string]interface{}{\n\t\"symbolName\": func(name string) string {\n\t\treturn \"Log\" + bitName(name)\n\t},\n\t\"bitName\": bitName,\n}).Parse(`// Code generated by aws/logging_generate.go DO NOT EDIT.\n\npackage aws\n\n// ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where\n// each bit is a flag that describes the logging behavior for one or more client components.\n// The entire 64-bit group is reserved for later expansion by the SDK.\n//\n// Example: Setting ClientLogMode to enable logging of retries and requests\n//  clientLogMode := aws.LogRetries | aws.LogRequest\n//\n// Example: Adding an additional log mode to an existing ClientLogMode value\n//  clientLogMode |= aws.LogResponse\ntype ClientLogMode uint64\n\n// Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events.\nconst (\n{{- range $index, $field := .ModeBits }}\n\t{{ (symbolName $field) }}{{- if (eq 0 $index) }} ClientLogMode = 1 << (64 - 1 - iota){{- end }}\n{{- end }}\n)\n{{ range $_, $field := .ModeBits }}\n// Is{{- bitName $field }} returns whether the {{ bitName $field }} logging mode bit is set\nfunc (m ClientLogMode) Is{{- bitName $field }}() bool {\n\treturn m&{{- (symbolName $field) }} != 0\n}\n{{ end }}\n{{- range $_, $field := .ModeBits }}\n// Clear{{- bitName $field }} clears the {{ bitName $field }} logging mode bit\nfunc (m *ClientLogMode) Clear{{- bitName $field }}() {\n\t*m &^= {{ (symbolName $field) }}\n}\n{{ end -}}\n`))\n\nfunc main() {\n\tuniqueBitFields := make(map[string]struct{})\n\n\tfor _, bitName := range config.ModeBits {\n\t\tif _, ok := uniqueBitFields[strings.ToLower(bitName)]; ok {\n\t\t\tpanic(fmt.Sprintf(\"duplicate bit field: %s\", bitName))\n\t\t}\n\t\tuniqueBitFields[bitName] = struct{}{}\n\t}\n\n\tfile, err := os.Create(\"logging.go\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\terr = tmpl.Execute(file, config)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// RegisterServiceMetadata registers metadata about the service and operation into the middleware context\n// so that it is available at runtime for other middleware to introspect.\ntype RegisterServiceMetadata struct {\n\tServiceID     string\n\tSigningName   string\n\tRegion        string\n\tOperationName string\n}\n\n// ID returns the middleware identifier.\nfunc (s *RegisterServiceMetadata) ID() string {\n\treturn \"RegisterServiceMetadata\"\n}\n\n// HandleInitialize registers service metadata information into the middleware context, allowing for introspection.\nfunc (s RegisterServiceMetadata) HandleInitialize(\n\tctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,\n) (out middleware.InitializeOutput, metadata middleware.Metadata, err error) {\n\tif len(s.ServiceID) > 0 {\n\t\tctx = SetServiceID(ctx, s.ServiceID)\n\t}\n\tif len(s.SigningName) > 0 {\n\t\tctx = SetSigningName(ctx, s.SigningName)\n\t}\n\tif len(s.Region) > 0 {\n\t\tctx = setRegion(ctx, s.Region)\n\t}\n\tif len(s.OperationName) > 0 {\n\t\tctx = setOperationName(ctx, s.OperationName)\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\n// service metadata keys for storing and lookup of runtime stack information.\ntype (\n\tserviceIDKey               struct{}\n\tsigningNameKey             struct{}\n\tsigningRegionKey           struct{}\n\tregionKey                  struct{}\n\toperationNameKey           struct{}\n\tpartitionIDKey             struct{}\n\trequiresLegacyEndpointsKey struct{}\n)\n\n// GetServiceID retrieves the service id from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetServiceID(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, serviceIDKey{}).(string)\n\treturn v\n}\n\n// GetSigningName retrieves the service signing name from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\n//\n// Deprecated: This value is unstable. The resolved signing name is available\n// in the signer properties object passed to the signer.\nfunc GetSigningName(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, signingNameKey{}).(string)\n\treturn v\n}\n\n// GetSigningRegion retrieves the region from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\n//\n// Deprecated: This value is unstable. The resolved signing region is available\n// in the signer properties object passed to the signer.\nfunc GetSigningRegion(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, signingRegionKey{}).(string)\n\treturn v\n}\n\n// GetRegion retrieves the endpoint region from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetRegion(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, regionKey{}).(string)\n\treturn v\n}\n\n// GetOperationName retrieves the service operation metadata from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetOperationName(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, operationNameKey{}).(string)\n\treturn v\n}\n\n// GetPartitionID retrieves the endpoint partition id from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetPartitionID(ctx context.Context) string {\n\tv, _ := middleware.GetStackValue(ctx, partitionIDKey{}).(string)\n\treturn v\n}\n\n// GetRequiresLegacyEndpoints the flag used to indicate if legacy endpoint\n// customizations need to be executed.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetRequiresLegacyEndpoints(ctx context.Context) bool {\n\tv, _ := middleware.GetStackValue(ctx, requiresLegacyEndpointsKey{}).(bool)\n\treturn v\n}\n\n// SetRequiresLegacyEndpoints set or modifies the flag indicated that\n// legacy endpoint customizations are needed.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc SetRequiresLegacyEndpoints(ctx context.Context, value bool) context.Context {\n\treturn middleware.WithStackValue(ctx, requiresLegacyEndpointsKey{}, value)\n}\n\n// SetSigningName set or modifies the sigv4 or sigv4a signing name on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\n//\n// Deprecated: This value is unstable. Use WithSigV4SigningName client option\n// funcs instead.\nfunc SetSigningName(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, signingNameKey{}, value)\n}\n\n// SetSigningRegion sets or modifies the region on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\n//\n// Deprecated: This value is unstable. Use WithSigV4SigningRegion client option\n// funcs instead.\nfunc SetSigningRegion(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, signingRegionKey{}, value)\n}\n\n// SetServiceID sets the service id on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc SetServiceID(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, serviceIDKey{}, value)\n}\n\n// setRegion sets the endpoint region on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc setRegion(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, regionKey{}, value)\n}\n\n// setOperationName sets the service operation on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc setOperationName(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, operationNameKey{}, value)\n}\n\n// SetPartitionID sets the partition id of a resolved region on the context\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc SetPartitionID(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, partitionIDKey{}, value)\n}\n\n// EndpointSource key\ntype endpointSourceKey struct{}\n\n// GetEndpointSource returns an endpoint source if set on context\nfunc GetEndpointSource(ctx context.Context) (v aws.EndpointSource) {\n\tv, _ = middleware.GetStackValue(ctx, endpointSourceKey{}).(aws.EndpointSource)\n\treturn v\n}\n\n// SetEndpointSource sets endpoint source on context\nfunc SetEndpointSource(ctx context.Context, value aws.EndpointSource) context.Context {\n\treturn middleware.WithStackValue(ctx, endpointSourceKey{}, value)\n}\n\ntype signingCredentialsKey struct{}\n\n// GetSigningCredentials returns the credentials that were used for signing if set on context.\nfunc GetSigningCredentials(ctx context.Context) (v aws.Credentials) {\n\tv, _ = middleware.GetStackValue(ctx, signingCredentialsKey{}).(aws.Credentials)\n\treturn v\n}\n\n// SetSigningCredentials sets the credentails used for signing on the context.\nfunc SetSigningCredentials(ctx context.Context, value aws.Credentials) context.Context {\n\treturn middleware.WithStackValue(ctx, signingCredentialsKey{}, value)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/internal/rand\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyrand \"github.com/aws/smithy-go/rand\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ClientRequestID is a Smithy BuildMiddleware that will generate a unique ID for logical API operation\n// invocation.\ntype ClientRequestID struct{}\n\n// ID the identifier for the ClientRequestID\nfunc (r *ClientRequestID) ID() string {\n\treturn \"ClientRequestID\"\n}\n\n// HandleBuild attaches a unique operation invocation id for the operation to the request\nfunc (r ClientRequestID) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", req)\n\t}\n\n\tinvocationID, err := smithyrand.NewUUID(rand.Reader).GetUUID()\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tconst invocationIDHeader = \"Amz-Sdk-Invocation-Id\"\n\treq.Header[invocationIDHeader] = append(req.Header[invocationIDHeader][:0], invocationID)\n\n\treturn next.HandleBuild(ctx, in)\n}\n\n// RecordResponseTiming records the response timing for the SDK client requests.\ntype RecordResponseTiming struct{}\n\n// ID is the middleware identifier\nfunc (a *RecordResponseTiming) ID() string {\n\treturn \"RecordResponseTiming\"\n}\n\n// HandleDeserialize calculates response metadata and clock skew\nfunc (a RecordResponseTiming) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tresponseAt := sdk.NowTime()\n\tsetResponseAt(&metadata, responseAt)\n\n\tvar serverTime time.Time\n\n\tswitch resp := out.RawResponse.(type) {\n\tcase *smithyhttp.Response:\n\t\trespDateHeader := resp.Header.Get(\"Date\")\n\t\tif len(respDateHeader) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tvar parseErr error\n\t\tserverTime, parseErr = smithyhttp.ParseTime(respDateHeader)\n\t\tif parseErr != nil {\n\t\t\tlogger := middleware.GetLogger(ctx)\n\t\t\tlogger.Logf(logging.Warn, \"failed to parse response Date header value, got %v\",\n\t\t\t\tparseErr.Error())\n\t\t\tbreak\n\t\t}\n\t\tsetServerTime(&metadata, serverTime)\n\t}\n\n\tif !serverTime.IsZero() {\n\t\tattemptSkew := serverTime.Sub(responseAt)\n\t\tsetAttemptSkew(&metadata, attemptSkew)\n\t}\n\n\treturn out, metadata, err\n}\n\ntype responseAtKey struct{}\n\n// GetResponseAt returns the time response was received at.\nfunc GetResponseAt(metadata middleware.Metadata) (v time.Time, ok bool) {\n\tv, ok = metadata.Get(responseAtKey{}).(time.Time)\n\treturn v, ok\n}\n\n// setResponseAt sets the response time on the metadata.\nfunc setResponseAt(metadata *middleware.Metadata, v time.Time) {\n\tmetadata.Set(responseAtKey{}, v)\n}\n\ntype serverTimeKey struct{}\n\n// GetServerTime returns the server time for response.\nfunc GetServerTime(metadata middleware.Metadata) (v time.Time, ok bool) {\n\tv, ok = metadata.Get(serverTimeKey{}).(time.Time)\n\treturn v, ok\n}\n\n// setServerTime sets the server time on the metadata.\nfunc setServerTime(metadata *middleware.Metadata, v time.Time) {\n\tmetadata.Set(serverTimeKey{}, v)\n}\n\ntype attemptSkewKey struct{}\n\n// GetAttemptSkew returns Attempt clock skew for response from metadata.\nfunc GetAttemptSkew(metadata middleware.Metadata) (v time.Duration, ok bool) {\n\tv, ok = metadata.Get(attemptSkewKey{}).(time.Duration)\n\treturn v, ok\n}\n\n// setAttemptSkew sets the attempt clock skew on the metadata.\nfunc setAttemptSkew(metadata *middleware.Metadata, v time.Duration) {\n\tmetadata.Set(attemptSkewKey{}, v)\n}\n\n// AddClientRequestIDMiddleware adds ClientRequestID to the middleware stack\nfunc AddClientRequestIDMiddleware(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&ClientRequestID{}, middleware.After)\n}\n\n// AddRecordResponseTiming adds RecordResponseTiming middleware to the\n// middleware stack.\nfunc AddRecordResponseTiming(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&RecordResponseTiming{}, middleware.After)\n}\n\n// rawResponseKey is the accessor key used to store and access the\n// raw response within the response metadata.\ntype rawResponseKey struct{}\n\n// AddRawResponse middleware adds raw response on to the metadata\ntype AddRawResponse struct{}\n\n// ID the identifier for the ClientRequestID\nfunc (m *AddRawResponse) ID() string {\n\treturn \"AddRawResponseToMetadata\"\n}\n\n// HandleDeserialize adds raw response on the middleware metadata\nfunc (m AddRawResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tmetadata.Set(rawResponseKey{}, out.RawResponse)\n\treturn out, metadata, err\n}\n\n// AddRawResponseToMetadata adds middleware to the middleware stack that\n// store raw response on to the metadata.\nfunc AddRawResponseToMetadata(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&AddRawResponse{}, middleware.Before)\n}\n\n// GetRawResponse returns raw response set on metadata\nfunc GetRawResponse(metadata middleware.Metadata) interface{} {\n\treturn metadata.Get(rawResponseKey{})\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go",
    "content": "//go:build go1.16\n// +build go1.16\n\npackage middleware\n\nimport \"runtime\"\n\nfunc getNormalizedOSName() (os string) {\n\tswitch runtime.GOOS {\n\tcase \"android\":\n\t\tos = \"android\"\n\tcase \"linux\":\n\t\tos = \"linux\"\n\tcase \"windows\":\n\t\tos = \"windows\"\n\tcase \"darwin\":\n\t\tos = \"macos\"\n\tcase \"ios\":\n\t\tos = \"ios\"\n\tdefault:\n\t\tos = \"other\"\n\t}\n\treturn os\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go",
    "content": "//go:build !go1.16\n// +build !go1.16\n\npackage middleware\n\nimport \"runtime\"\n\nfunc getNormalizedOSName() (os string) {\n\tswitch runtime.GOOS {\n\tcase \"android\":\n\t\tos = \"android\"\n\tcase \"linux\":\n\t\tos = \"linux\"\n\tcase \"windows\":\n\t\tos = \"windows\"\n\tcase \"darwin\":\n\t\t// Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64\n\t\t// For now declare this as \"other\" until we have a better detection mechanism.\n\t\tfallthrough\n\tdefault:\n\t\tos = \"other\"\n\t}\n\treturn os\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go",
    "content": "// Package metrics implements metrics gathering for SDK development purposes.\n//\n// This package is designated as private and is intended for use only by the\n// AWS client runtime. The exported API therein is not considered stable and\n// is subject to breaking changes without notice.\npackage metrics\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\nconst (\n\t// ServiceIDKey is the key for the service ID metric.\n\tServiceIDKey = \"ServiceId\"\n\t// OperationNameKey is the key for the operation name metric.\n\tOperationNameKey = \"OperationName\"\n\t// ClientRequestIDKey is the key for the client request ID metric.\n\tClientRequestIDKey = \"ClientRequestId\"\n\t// APICallDurationKey is the key for the API call duration metric.\n\tAPICallDurationKey = \"ApiCallDuration\"\n\t// APICallSuccessfulKey is the key for the API call successful metric.\n\tAPICallSuccessfulKey = \"ApiCallSuccessful\"\n\t// MarshallingDurationKey is the key for the marshalling duration metric.\n\tMarshallingDurationKey = \"MarshallingDuration\"\n\t// InThroughputKey is the key for the input throughput metric.\n\tInThroughputKey = \"InThroughput\"\n\t// OutThroughputKey is the key for the output throughput metric.\n\tOutThroughputKey = \"OutThroughput\"\n\t// RetryCountKey is the key for the retry count metric.\n\tRetryCountKey = \"RetryCount\"\n\t// HTTPStatusCodeKey is the key for the HTTP status code metric.\n\tHTTPStatusCodeKey = \"HttpStatusCode\"\n\t// AWSExtendedRequestIDKey is the key for the AWS extended request ID metric.\n\tAWSExtendedRequestIDKey = \"AwsExtendedRequestId\"\n\t// AWSRequestIDKey is the key for the AWS request ID metric.\n\tAWSRequestIDKey = \"AwsRequestId\"\n\t// BackoffDelayDurationKey is the key for the backoff delay duration metric.\n\tBackoffDelayDurationKey = \"BackoffDelayDuration\"\n\t// StreamThroughputKey is the key for the stream throughput metric.\n\tStreamThroughputKey = \"Throughput\"\n\t// ConcurrencyAcquireDurationKey is the key for the concurrency acquire duration metric.\n\tConcurrencyAcquireDurationKey = \"ConcurrencyAcquireDuration\"\n\t// PendingConcurrencyAcquiresKey is the key for the pending concurrency acquires metric.\n\tPendingConcurrencyAcquiresKey = \"PendingConcurrencyAcquires\"\n\t// SigningDurationKey is the key for the signing duration metric.\n\tSigningDurationKey = \"SigningDuration\"\n\t// UnmarshallingDurationKey is the key for the unmarshalling duration metric.\n\tUnmarshallingDurationKey = \"UnmarshallingDuration\"\n\t// TimeToFirstByteKey is the key for the time to first byte metric.\n\tTimeToFirstByteKey = \"TimeToFirstByte\"\n\t// ServiceCallDurationKey is the key for the service call duration metric.\n\tServiceCallDurationKey = \"ServiceCallDuration\"\n\t// EndpointResolutionDurationKey is the key for the endpoint resolution duration metric.\n\tEndpointResolutionDurationKey = \"EndpointResolutionDuration\"\n\t// AttemptNumberKey is the key for the attempt number metric.\n\tAttemptNumberKey = \"AttemptNumber\"\n\t// MaxConcurrencyKey is the key for the max concurrency metric.\n\tMaxConcurrencyKey = \"MaxConcurrency\"\n\t// AvailableConcurrencyKey is the key for the available concurrency metric.\n\tAvailableConcurrencyKey = \"AvailableConcurrency\"\n)\n\n// MetricPublisher provides the interface to provide custom MetricPublishers.\n// PostRequestMetrics will be invoked by the MetricCollection middleware to post request.\n// PostStreamMetrics will be invoked by ReadCloserWithMetrics to post stream metrics.\ntype MetricPublisher interface {\n\tPostRequestMetrics(*MetricData) error\n\tPostStreamMetrics(*MetricData) error\n}\n\n// Serializer provides the interface to provide custom Serializers.\n// Serialize will transform any input object in its corresponding string representation.\ntype Serializer interface {\n\tSerialize(obj interface{}) (string, error)\n}\n\n// DefaultSerializer is an implementation of the Serializer interface.\ntype DefaultSerializer struct{}\n\n// Serialize uses the default JSON serializer to obtain the string representation of an object.\nfunc (DefaultSerializer) Serialize(obj interface{}) (string, error) {\n\tbytes, err := json.Marshal(obj)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(bytes), nil\n}\n\ntype metricContextKey struct{}\n\n// MetricContext contains fields to store metric-related information.\ntype MetricContext struct {\n\tconnectionCounter *SharedConnectionCounter\n\tpublisher         MetricPublisher\n\tdata              *MetricData\n}\n\n// MetricData stores the collected metric data.\ntype MetricData struct {\n\tRequestStartTime           time.Time\n\tRequestEndTime             time.Time\n\tAPICallDuration            time.Duration\n\tSerializeStartTime         time.Time\n\tSerializeEndTime           time.Time\n\tMarshallingDuration        time.Duration\n\tResolveEndpointStartTime   time.Time\n\tResolveEndpointEndTime     time.Time\n\tEndpointResolutionDuration time.Duration\n\tGetIdentityStartTime       time.Time\n\tGetIdentityEndTime         time.Time\n\tInThroughput               float64\n\tOutThroughput              float64\n\tRetryCount                 int\n\tSuccess                    uint8\n\tStatusCode                 int\n\tClientRequestID            string\n\tServiceID                  string\n\tOperationName              string\n\tPartitionID                string\n\tRegion                     string\n\tUserAgent                  string\n\tRequestContentLength       int64\n\tStream                     StreamMetrics\n\tAttempts                   []AttemptMetrics\n}\n\n// StreamMetrics stores metrics related to streaming data.\ntype StreamMetrics struct {\n\tReadDuration time.Duration\n\tReadBytes    int64\n\tThroughput   float64\n}\n\n// AttemptMetrics stores metrics related to individual attempts.\ntype AttemptMetrics struct {\n\tServiceCallStart           time.Time\n\tServiceCallEnd             time.Time\n\tServiceCallDuration        time.Duration\n\tFirstByteTime              time.Time\n\tTimeToFirstByte            time.Duration\n\tConnRequestedTime          time.Time\n\tConnObtainedTime           time.Time\n\tConcurrencyAcquireDuration time.Duration\n\tSignStartTime              time.Time\n\tSignEndTime                time.Time\n\tSigningDuration            time.Duration\n\tDeserializeStartTime       time.Time\n\tDeserializeEndTime         time.Time\n\tUnMarshallingDuration      time.Duration\n\tRetryDelay                 time.Duration\n\tResponseContentLength      int64\n\tStatusCode                 int\n\tRequestID                  string\n\tExtendedRequestID          string\n\tHTTPClient                 string\n\tMaxConcurrency             int\n\tPendingConnectionAcquires  int\n\tAvailableConcurrency       int\n\tActiveRequests             int\n\tReusedConnection           bool\n}\n\n// Data returns the MetricData associated with the MetricContext.\nfunc (mc *MetricContext) Data() *MetricData {\n\treturn mc.data\n}\n\n// ConnectionCounter returns the SharedConnectionCounter associated with the MetricContext.\nfunc (mc *MetricContext) ConnectionCounter() *SharedConnectionCounter {\n\treturn mc.connectionCounter\n}\n\n// Publisher returns the MetricPublisher associated with the MetricContext.\nfunc (mc *MetricContext) Publisher() MetricPublisher {\n\treturn mc.publisher\n}\n\n// ComputeRequestMetrics calculates and populates derived metrics based on the collected data.\nfunc (md *MetricData) ComputeRequestMetrics() {\n\n\tfor idx := range md.Attempts {\n\t\tattempt := &md.Attempts[idx]\n\t\tattempt.ConcurrencyAcquireDuration = attempt.ConnObtainedTime.Sub(attempt.ConnRequestedTime)\n\t\tattempt.SigningDuration = attempt.SignEndTime.Sub(attempt.SignStartTime)\n\t\tattempt.UnMarshallingDuration = attempt.DeserializeEndTime.Sub(attempt.DeserializeStartTime)\n\t\tattempt.TimeToFirstByte = attempt.FirstByteTime.Sub(attempt.ServiceCallStart)\n\t\tattempt.ServiceCallDuration = attempt.ServiceCallEnd.Sub(attempt.ServiceCallStart)\n\t}\n\n\tmd.APICallDuration = md.RequestEndTime.Sub(md.RequestStartTime)\n\tmd.MarshallingDuration = md.SerializeEndTime.Sub(md.SerializeStartTime)\n\tmd.EndpointResolutionDuration = md.ResolveEndpointEndTime.Sub(md.ResolveEndpointStartTime)\n\n\tmd.RetryCount = len(md.Attempts) - 1\n\n\tlatestAttempt, err := md.LatestAttempt()\n\n\tif err != nil {\n\t\tfmt.Printf(\"error retrieving attempts data due to: %s. Skipping Throughput metrics\", err.Error())\n\t} else {\n\n\t\tmd.StatusCode = latestAttempt.StatusCode\n\n\t\tif md.Success == 1 {\n\t\t\tif latestAttempt.ResponseContentLength > 0 && latestAttempt.ServiceCallDuration > 0 {\n\t\t\t\tmd.InThroughput = float64(latestAttempt.ResponseContentLength) / latestAttempt.ServiceCallDuration.Seconds()\n\t\t\t}\n\t\t\tif md.RequestContentLength > 0 && latestAttempt.ServiceCallDuration > 0 {\n\t\t\t\tmd.OutThroughput = float64(md.RequestContentLength) / latestAttempt.ServiceCallDuration.Seconds()\n\t\t\t}\n\t\t}\n\t}\n}\n\n// LatestAttempt returns the latest attempt metrics.\n// It returns an error if no attempts are initialized.\nfunc (md *MetricData) LatestAttempt() (*AttemptMetrics, error) {\n\tif md.Attempts == nil || len(md.Attempts) == 0 {\n\t\treturn nil, fmt.Errorf(\"no attempts initialized. NewAttempt() should be called first\")\n\t}\n\treturn &md.Attempts[len(md.Attempts)-1], nil\n}\n\n// NewAttempt initializes new attempt metrics.\nfunc (md *MetricData) NewAttempt() {\n\tif md.Attempts == nil {\n\t\tmd.Attempts = []AttemptMetrics{}\n\t}\n\tmd.Attempts = append(md.Attempts, AttemptMetrics{})\n}\n\n// SharedConnectionCounter is a counter shared across API calls.\ntype SharedConnectionCounter struct {\n\tmu sync.Mutex\n\n\tactiveRequests           int\n\tpendingConnectionAcquire int\n}\n\n// ActiveRequests returns the count of active requests.\nfunc (cc *SharedConnectionCounter) ActiveRequests() int {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\treturn cc.activeRequests\n}\n\n// PendingConnectionAcquire returns the count of pending connection acquires.\nfunc (cc *SharedConnectionCounter) PendingConnectionAcquire() int {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\treturn cc.pendingConnectionAcquire\n}\n\n// AddActiveRequest increments the count of active requests.\nfunc (cc *SharedConnectionCounter) AddActiveRequest() {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\tcc.activeRequests++\n}\n\n// RemoveActiveRequest decrements the count of active requests.\nfunc (cc *SharedConnectionCounter) RemoveActiveRequest() {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\tcc.activeRequests--\n}\n\n// AddPendingConnectionAcquire increments the count of pending connection acquires.\nfunc (cc *SharedConnectionCounter) AddPendingConnectionAcquire() {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\tcc.pendingConnectionAcquire++\n}\n\n// RemovePendingConnectionAcquire decrements the count of pending connection acquires.\nfunc (cc *SharedConnectionCounter) RemovePendingConnectionAcquire() {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\n\tcc.pendingConnectionAcquire--\n}\n\n// InitMetricContext initializes the metric context with the provided counter and publisher.\n// It returns the updated context.\nfunc InitMetricContext(\n\tctx context.Context, counter *SharedConnectionCounter, publisher MetricPublisher,\n) context.Context {\n\tif middleware.GetStackValue(ctx, metricContextKey{}) == nil {\n\t\tctx = middleware.WithStackValue(ctx, metricContextKey{}, &MetricContext{\n\t\t\tconnectionCounter: counter,\n\t\t\tpublisher:         publisher,\n\t\t\tdata: &MetricData{\n\t\t\t\tAttempts: []AttemptMetrics{},\n\t\t\t\tStream:   StreamMetrics{},\n\t\t\t},\n\t\t})\n\t}\n\treturn ctx\n}\n\n// Context returns the metric context from the given context.\n// It returns nil if the metric context is not found.\nfunc Context(ctx context.Context) *MetricContext {\n\tmctx := middleware.GetStackValue(ctx, metricContextKey{})\n\tif mctx == nil {\n\t\treturn nil\n\t}\n\treturn mctx.(*MetricContext)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"os\"\n)\n\nconst envAwsLambdaFunctionName = \"AWS_LAMBDA_FUNCTION_NAME\"\nconst envAmznTraceID = \"_X_AMZN_TRACE_ID\"\nconst amznTraceIDHeader = \"X-Amzn-Trace-Id\"\n\n// AddRecursionDetection adds recursionDetection to the middleware stack\nfunc AddRecursionDetection(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&RecursionDetection{}, middleware.After)\n}\n\n// RecursionDetection detects Lambda environment and sets its X-Ray trace ID to request header if absent\n// to avoid recursion invocation in Lambda\ntype RecursionDetection struct{}\n\n// ID returns the middleware identifier\nfunc (m *RecursionDetection) ID() string {\n\treturn \"RecursionDetection\"\n}\n\n// HandleBuild detects Lambda environment and adds its trace ID to request header if absent\nfunc (m *RecursionDetection) HandleBuild(\n\tctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,\n) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown request type %T\", req)\n\t}\n\n\t_, hasLambdaEnv := os.LookupEnv(envAwsLambdaFunctionName)\n\txAmznTraceID, hasTraceID := os.LookupEnv(envAmznTraceID)\n\tvalue := req.Header.Get(amznTraceIDHeader)\n\t// only set the X-Amzn-Trace-Id header when it is not set initially, the\n\t// current environment is Lambda and the _X_AMZN_TRACE_ID env variable exists\n\tif value != \"\" || !hasLambdaEnv || !hasTraceID {\n\t\treturn next.HandleBuild(ctx, in)\n\t}\n\n\treq.Header.Set(amznTraceIDHeader, percentEncode(xAmznTraceID))\n\treturn next.HandleBuild(ctx, in)\n}\n\nfunc percentEncode(s string) string {\n\tupperhex := \"0123456789ABCDEF\"\n\thexCount := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tc := s[i]\n\t\tif shouldEncode(c) {\n\t\t\thexCount++\n\t\t}\n\t}\n\n\tif hexCount == 0 {\n\t\treturn s\n\t}\n\n\trequired := len(s) + 2*hexCount\n\tt := make([]byte, required)\n\tj := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif c := s[i]; shouldEncode(c) {\n\t\t\tt[j] = '%'\n\t\t\tt[j+1] = upperhex[c>>4]\n\t\t\tt[j+2] = upperhex[c&15]\n\t\t\tj += 3\n\t\t} else {\n\t\t\tt[j] = c\n\t\t\tj++\n\t\t}\n\t}\n\treturn string(t)\n}\n\nfunc shouldEncode(c byte) bool {\n\tif 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' {\n\t\treturn false\n\t}\n\tswitch c {\n\tcase '-', '=', ';', ':', '+', '&', '[', ']', '{', '}', '\"', '\\'', ',':\n\t\treturn false\n\tdefault:\n\t\treturn true\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.go",
    "content": "package middleware\n\nimport (\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// requestIDKey is used to retrieve request id from response metadata\ntype requestIDKey struct{}\n\n// SetRequestIDMetadata sets the provided request id over middleware metadata\nfunc SetRequestIDMetadata(metadata *middleware.Metadata, id string) {\n\tmetadata.Set(requestIDKey{}, id)\n}\n\n// GetRequestIDMetadata retrieves the request id from middleware metadata\n// returns string and bool indicating value of request id, whether request id was set.\nfunc GetRequestIDMetadata(metadata middleware.Metadata) (string, bool) {\n\tif !metadata.Has(requestIDKey{}) {\n\t\treturn \"\", false\n\t}\n\n\tv, ok := metadata.Get(requestIDKey{}).(string)\n\tif !ok {\n\t\treturn \"\", true\n\t}\n\treturn v, true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// AddRequestIDRetrieverMiddleware adds request id retriever middleware\nfunc AddRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\t// add error wrapper middleware before operation deserializers so that it can wrap the error response\n\t// returned by operation deserializers\n\treturn stack.Deserialize.Insert(&RequestIDRetriever{}, \"OperationDeserializer\", middleware.Before)\n}\n\n// RequestIDRetriever middleware captures the AWS service request ID from the\n// raw response.\ntype RequestIDRetriever struct {\n}\n\n// ID returns the middleware identifier\nfunc (m *RequestIDRetriever) ID() string {\n\treturn \"RequestIDRetriever\"\n}\n\n// HandleDeserialize pulls the AWS request ID from the response, storing it in\n// operation metadata.\nfunc (m *RequestIDRetriever) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\n\tresp, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\t// No raw response to wrap with.\n\t\treturn out, metadata, err\n\t}\n\n\t// Different header which can map to request id\n\trequestIDHeaderList := []string{\"X-Amzn-Requestid\", \"X-Amz-RequestId\"}\n\n\tfor _, h := range requestIDHeaderList {\n\t\t// check for headers known to contain Request id\n\t\tif v := resp.Header.Get(h); len(v) != 0 {\n\t\t\t// set reqID on metadata for successful responses.\n\t\t\tSetRequestIDMetadata(&metadata, v)\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nvar languageVersion = strings.TrimPrefix(runtime.Version(), \"go\")\n\n// SDKAgentKeyType is the metadata type to add to the SDK agent string\ntype SDKAgentKeyType int\n\n// The set of valid SDKAgentKeyType constants. If an unknown value is assigned for SDKAgentKeyType it will\n// be mapped to AdditionalMetadata.\nconst (\n\t_ SDKAgentKeyType = iota\n\tAPIMetadata\n\tOperatingSystemMetadata\n\tLanguageMetadata\n\tEnvironmentMetadata\n\tFeatureMetadata\n\tConfigMetadata\n\tFrameworkMetadata\n\tAdditionalMetadata\n\tApplicationIdentifier\n\tFeatureMetadata2\n)\n\nfunc (k SDKAgentKeyType) string() string {\n\tswitch k {\n\tcase APIMetadata:\n\t\treturn \"api\"\n\tcase OperatingSystemMetadata:\n\t\treturn \"os\"\n\tcase LanguageMetadata:\n\t\treturn \"lang\"\n\tcase EnvironmentMetadata:\n\t\treturn \"exec-env\"\n\tcase FeatureMetadata:\n\t\treturn \"ft\"\n\tcase ConfigMetadata:\n\t\treturn \"cfg\"\n\tcase FrameworkMetadata:\n\t\treturn \"lib\"\n\tcase ApplicationIdentifier:\n\t\treturn \"app\"\n\tcase FeatureMetadata2:\n\t\treturn \"m\"\n\tcase AdditionalMetadata:\n\t\tfallthrough\n\tdefault:\n\t\treturn \"md\"\n\t}\n}\n\nconst execEnvVar = `AWS_EXECUTION_ENV`\n\nvar validChars = map[rune]bool{\n\t'!': true, '#': true, '$': true, '%': true, '&': true, '\\'': true, '*': true, '+': true,\n\t'-': true, '.': true, '^': true, '_': true, '`': true, '|': true, '~': true,\n}\n\n// UserAgentFeature enumerates tracked SDK features.\ntype UserAgentFeature string\n\n// Enumerates UserAgentFeature.\nconst (\n\tUserAgentFeatureResourceModel          UserAgentFeature = \"A\" // n/a (we don't generate separate resource types)\n\tUserAgentFeatureWaiter                                  = \"B\"\n\tUserAgentFeaturePaginator                               = \"C\"\n\tUserAgentFeatureRetryModeLegacy                         = \"D\" // n/a (equivalent to standard)\n\tUserAgentFeatureRetryModeStandard                       = \"E\"\n\tUserAgentFeatureRetryModeAdaptive                       = \"F\"\n\tUserAgentFeatureS3Transfer                              = \"G\"\n\tUserAgentFeatureS3CryptoV1N                             = \"H\" // n/a (crypto client is external)\n\tUserAgentFeatureS3CryptoV2                              = \"I\" // n/a\n\tUserAgentFeatureS3ExpressBucket                         = \"J\"\n\tUserAgentFeatureS3AccessGrants                          = \"K\" // not yet implemented\n\tUserAgentFeatureGZIPRequestCompression                  = \"L\"\n)\n\n// RequestUserAgent is a build middleware that set the User-Agent for the request.\ntype RequestUserAgent struct {\n\tsdkAgent, userAgent *smithyhttp.UserAgentBuilder\n\tfeatures            map[UserAgentFeature]struct{}\n}\n\n// NewRequestUserAgent returns a new requestUserAgent which will set the User-Agent and X-Amz-User-Agent for the\n// request.\n//\n// User-Agent example:\n//\n//\taws-sdk-go-v2/1.2.3\n//\n// X-Amz-User-Agent example:\n//\n//\taws-sdk-go-v2/1.2.3 md/GOOS/linux md/GOARCH/amd64 lang/go/1.15\nfunc NewRequestUserAgent() *RequestUserAgent {\n\tuserAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder()\n\taddProductName(userAgent)\n\taddProductName(sdkAgent)\n\n\tr := &RequestUserAgent{\n\t\tsdkAgent:  sdkAgent,\n\t\tuserAgent: userAgent,\n\t\tfeatures:  map[UserAgentFeature]struct{}{},\n\t}\n\n\taddSDKMetadata(r)\n\n\treturn r\n}\n\nfunc addSDKMetadata(r *RequestUserAgent) {\n\tr.AddSDKAgentKey(OperatingSystemMetadata, getNormalizedOSName())\n\tr.AddSDKAgentKeyValue(LanguageMetadata, \"go\", languageVersion)\n\tr.AddSDKAgentKeyValue(AdditionalMetadata, \"GOOS\", runtime.GOOS)\n\tr.AddSDKAgentKeyValue(AdditionalMetadata, \"GOARCH\", runtime.GOARCH)\n\tif ev := os.Getenv(execEnvVar); len(ev) > 0 {\n\t\tr.AddSDKAgentKey(EnvironmentMetadata, ev)\n\t}\n}\n\nfunc addProductName(builder *smithyhttp.UserAgentBuilder) {\n\tbuilder.AddKeyValue(aws.SDKName, aws.SDKVersion)\n}\n\n// AddUserAgentKey retrieves a requestUserAgent from the provided stack, or initializes one.\nfunc AddUserAgentKey(key string) func(*middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\trequestUserAgent, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trequestUserAgent.AddUserAgentKey(key)\n\t\treturn nil\n\t}\n}\n\n// AddUserAgentKeyValue retrieves a requestUserAgent from the provided stack, or initializes one.\nfunc AddUserAgentKeyValue(key, value string) func(*middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\trequestUserAgent, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trequestUserAgent.AddUserAgentKeyValue(key, value)\n\t\treturn nil\n\t}\n}\n\n// AddSDKAgentKey retrieves a requestUserAgent from the provided stack, or initializes one.\nfunc AddSDKAgentKey(keyType SDKAgentKeyType, key string) func(*middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\trequestUserAgent, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trequestUserAgent.AddSDKAgentKey(keyType, key)\n\t\treturn nil\n\t}\n}\n\n// AddSDKAgentKeyValue retrieves a requestUserAgent from the provided stack, or initializes one.\nfunc AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) func(*middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\trequestUserAgent, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trequestUserAgent.AddSDKAgentKeyValue(keyType, key, value)\n\t\treturn nil\n\t}\n}\n\n// AddRequestUserAgentMiddleware registers a requestUserAgent middleware on the stack if not present.\nfunc AddRequestUserAgentMiddleware(stack *middleware.Stack) error {\n\t_, err := getOrAddRequestUserAgent(stack)\n\treturn err\n}\n\nfunc getOrAddRequestUserAgent(stack *middleware.Stack) (*RequestUserAgent, error) {\n\tid := (*RequestUserAgent)(nil).ID()\n\tbm, ok := stack.Build.Get(id)\n\tif !ok {\n\t\tbm = NewRequestUserAgent()\n\t\terr := stack.Build.Add(bm, middleware.After)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trequestUserAgent, ok := bm.(*RequestUserAgent)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%T for %s middleware did not match expected type\", bm, id)\n\t}\n\n\treturn requestUserAgent, nil\n}\n\n// AddUserAgentKey adds the component identified by name to the User-Agent string.\nfunc (u *RequestUserAgent) AddUserAgentKey(key string) {\n\tu.userAgent.AddKey(strings.Map(rules, key))\n}\n\n// AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string.\nfunc (u *RequestUserAgent) AddUserAgentKeyValue(key, value string) {\n\tu.userAgent.AddKeyValue(strings.Map(rules, key), strings.Map(rules, value))\n}\n\n// AddUserAgentFeature adds the feature ID to the tracking list to be emitted\n// in the final User-Agent string.\nfunc (u *RequestUserAgent) AddUserAgentFeature(feature UserAgentFeature) {\n\tu.features[feature] = struct{}{}\n}\n\n// AddSDKAgentKey adds the component identified by name to the User-Agent string.\nfunc (u *RequestUserAgent) AddSDKAgentKey(keyType SDKAgentKeyType, key string) {\n\t// TODO: should target sdkAgent\n\tu.userAgent.AddKey(keyType.string() + \"/\" + strings.Map(rules, key))\n}\n\n// AddSDKAgentKeyValue adds the key identified by the given name and value to the User-Agent string.\nfunc (u *RequestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) {\n\t// TODO: should target sdkAgent\n\tu.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+\"#\"+strings.Map(rules, value))\n}\n\n// ID the name of the middleware.\nfunc (u *RequestUserAgent) ID() string {\n\treturn \"UserAgent\"\n}\n\n// HandleBuild adds or appends the constructed user agent to the request.\nfunc (u *RequestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\tswitch req := in.Request.(type) {\n\tcase *smithyhttp.Request:\n\t\tu.addHTTPUserAgent(req)\n\t\t// TODO: To be re-enabled\n\t\t// u.addHTTPSDKAgent(req)\n\tdefault:\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in)\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n\nfunc (u *RequestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) {\n\tconst userAgent = \"User-Agent\"\n\tupdateHTTPHeader(request, userAgent, u.userAgent.Build())\n\tif len(u.features) > 0 {\n\t\tupdateHTTPHeader(request, userAgent, buildFeatureMetrics(u.features))\n\t}\n}\n\nfunc (u *RequestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) {\n\tconst sdkAgent = \"X-Amz-User-Agent\"\n\tupdateHTTPHeader(request, sdkAgent, u.sdkAgent.Build())\n}\n\nfunc updateHTTPHeader(request *smithyhttp.Request, header string, value string) {\n\tvar current string\n\tif v := request.Header[header]; len(v) > 0 {\n\t\tcurrent = v[0]\n\t}\n\tif len(current) > 0 {\n\t\tcurrent = value + \" \" + current\n\t} else {\n\t\tcurrent = value\n\t}\n\trequest.Header[header] = append(request.Header[header][:0], current)\n}\n\nfunc rules(r rune) rune {\n\tswitch {\n\tcase r >= '0' && r <= '9':\n\t\treturn r\n\tcase r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z':\n\t\treturn r\n\tcase validChars[r]:\n\t\treturn r\n\tdefault:\n\t\treturn '-'\n\t}\n}\n\nfunc buildFeatureMetrics(features map[UserAgentFeature]struct{}) string {\n\tfs := make([]string, 0, len(features))\n\tfor f := range features {\n\t\tfs = append(fs, string(f))\n\t}\n\n\tsort.Strings(fs)\n\treturn fmt.Sprintf(\"%s/%s\", FeatureMetadata2.string(), strings.Join(fs, \",\"))\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go",
    "content": "package query\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// Array represents the encoding of Query lists and sets. A Query array is a\n// representation of a list of values of a fixed type. A serialized array might\n// look like the following:\n//\n//\tListName.member.1=foo\n//\t&ListName.member.2=bar\n//\t&Listname.member.3=baz\ntype Array struct {\n\t// The query values to add the array to.\n\tvalues url.Values\n\t// The array's prefix, which includes the names of all parent structures\n\t// and ends with the name of the list. For example, the prefix might be\n\t// \"ParentStructure.ListName\". This prefix will be used to form the full\n\t// keys for each element in the list. For example, an entry might have the\n\t// key \"ParentStructure.ListName.member.MemberName.1\".\n\t//\n\t// While this is currently represented as a string that gets added to, it\n\t// could also be represented as a stack that only gets condensed into a\n\t// string when a finalized key is created. This could potentially reduce\n\t// allocations.\n\tprefix string\n\t// Whether the list is flat or not. A list that is not flat will produce the\n\t// following entry to the url.Values for a given entry:\n\t//     ListName.MemberName.1=value\n\t// A list that is flat will produce the following:\n\t//     ListName.1=value\n\tflat bool\n\t// The location name of the member. In most cases this should be \"member\".\n\tmemberName string\n\t// Elements are stored in values, so we keep track of the list size here.\n\tsize int32\n\t// Empty lists are encoded as \"<prefix>=\", if we add a value later we will\n\t// remove this encoding\n\temptyValue Value\n}\n\nfunc newArray(values url.Values, prefix string, flat bool, memberName string) *Array {\n\temptyValue := newValue(values, prefix, flat)\n\temptyValue.String(\"\")\n\n\treturn &Array{\n\t\tvalues:     values,\n\t\tprefix:     prefix,\n\t\tflat:       flat,\n\t\tmemberName: memberName,\n\t\temptyValue: emptyValue,\n\t}\n}\n\n// Value adds a new element to the Query Array. Returns a Value type used to\n// encode the array element.\nfunc (a *Array) Value() Value {\n\tif a.size == 0 {\n\t\tdelete(a.values, a.emptyValue.key)\n\t}\n\n\t// Query lists start a 1, so adjust the size first\n\ta.size++\n\tprefix := a.prefix\n\tif !a.flat {\n\t\tprefix = fmt.Sprintf(\"%s.%s\", prefix, a.memberName)\n\t}\n\t// Lists can't have flat members\n\treturn newValue(a.values, fmt.Sprintf(\"%s.%d\", prefix, a.size), false)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go",
    "content": "package query\n\nimport (\n\t\"io\"\n\t\"net/url\"\n\t\"sort\"\n)\n\n// Encoder is a Query encoder that supports construction of Query body\n// values using methods.\ntype Encoder struct {\n\t// The query values that will be built up to manage encoding.\n\tvalues url.Values\n\t// The writer that the encoded body will be written to.\n\twriter io.Writer\n\tValue\n}\n\n// NewEncoder returns a new Query body encoder\nfunc NewEncoder(writer io.Writer) *Encoder {\n\tvalues := url.Values{}\n\treturn &Encoder{\n\t\tvalues: values,\n\t\twriter: writer,\n\t\tValue:  newBaseValue(values),\n\t}\n}\n\n// Encode returns the []byte slice representing the current\n// state of the Query encoder.\nfunc (e Encoder) Encode() error {\n\tws, ok := e.writer.(interface{ WriteString(string) (int, error) })\n\tif !ok {\n\t\t// Fall back to less optimal byte slice casting if WriteString isn't available.\n\t\tws = &wrapWriteString{writer: e.writer}\n\t}\n\n\t// Get the keys and sort them to have a stable output\n\tkeys := make([]string, 0, len(e.values))\n\tfor k := range e.values {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\tisFirstEntry := true\n\tfor _, key := range keys {\n\t\tqueryValues := e.values[key]\n\t\tescapedKey := url.QueryEscape(key)\n\t\tfor _, value := range queryValues {\n\t\t\tif !isFirstEntry {\n\t\t\t\tif _, err := ws.WriteString(`&`); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisFirstEntry = false\n\t\t\t}\n\t\t\tif _, err := ws.WriteString(escapedKey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := ws.WriteString(`=`); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := ws.WriteString(url.QueryEscape(value)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// wrapWriteString wraps an io.Writer to provide a WriteString method\n// where one is not available.\ntype wrapWriteString struct {\n\twriter io.Writer\n}\n\n// WriteString writes a string to the wrapped writer by casting it to\n// a byte array first.\nfunc (w wrapWriteString) WriteString(v string) (int, error) {\n\treturn w.writer.Write([]byte(v))\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go",
    "content": "package query\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// Map represents the encoding of Query maps. A Query map is a representation\n// of a mapping of arbitrary string keys to arbitrary values of a fixed type.\n// A Map differs from an Object in that the set of keys is not fixed, in that\n// the values must all be of the same type, and that map entries are ordered.\n// A serialized map might look like the following:\n//\n//\tMapName.entry.1.key=Foo\n//\t&MapName.entry.1.value=spam\n//\t&MapName.entry.2.key=Bar\n//\t&MapName.entry.2.value=eggs\ntype Map struct {\n\t// The query values to add the map to.\n\tvalues url.Values\n\t// The map's prefix, which includes the names of all parent structures\n\t// and ends with the name of the object. For example, the prefix might be\n\t// \"ParentStructure.MapName\". This prefix will be used to form the full\n\t// keys for each key-value pair of the map. For example, a value might have\n\t// the key \"ParentStructure.MapName.1.value\".\n\t//\n\t// While this is currently represented as a string that gets added to, it\n\t// could also be represented as a stack that only gets condensed into a\n\t// string when a finalized key is created. This could potentially reduce\n\t// allocations.\n\tprefix string\n\t// Whether the map is flat or not. A map that is not flat will produce the\n\t// following entries to the url.Values for a given key-value pair:\n\t//     MapName.entry.1.KeyLocationName=mykey\n\t//     MapName.entry.1.ValueLocationName=myvalue\n\t// A map that is flat will produce the following:\n\t//     MapName.1.KeyLocationName=mykey\n\t//     MapName.1.ValueLocationName=myvalue\n\tflat bool\n\t// The location name of the key. In most cases this should be \"key\".\n\tkeyLocationName string\n\t// The location name of the value. In most cases this should be \"value\".\n\tvalueLocationName string\n\t// Elements are stored in values, so we keep track of the list size here.\n\tsize int32\n}\n\nfunc newMap(values url.Values, prefix string, flat bool, keyLocationName string, valueLocationName string) *Map {\n\treturn &Map{\n\t\tvalues:            values,\n\t\tprefix:            prefix,\n\t\tflat:              flat,\n\t\tkeyLocationName:   keyLocationName,\n\t\tvalueLocationName: valueLocationName,\n\t}\n}\n\n// Key adds the given named key to the Query map.\n// Returns a Value encoder that should be used to encode a Query value type.\nfunc (m *Map) Key(name string) Value {\n\t// Query lists start a 1, so adjust the size first\n\tm.size++\n\tvar key string\n\tvar value string\n\tif m.flat {\n\t\tkey = fmt.Sprintf(\"%s.%d.%s\", m.prefix, m.size, m.keyLocationName)\n\t\tvalue = fmt.Sprintf(\"%s.%d.%s\", m.prefix, m.size, m.valueLocationName)\n\t} else {\n\t\tkey = fmt.Sprintf(\"%s.entry.%d.%s\", m.prefix, m.size, m.keyLocationName)\n\t\tvalue = fmt.Sprintf(\"%s.entry.%d.%s\", m.prefix, m.size, m.valueLocationName)\n\t}\n\n\t// The key can only be a string, so we just go ahead and set it here\n\tnewValue(m.values, key, false).String(name)\n\n\t// Maps can't have flat members\n\treturn newValue(m.values, value, false)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go",
    "content": "package query\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// AddAsGetRequestMiddleware adds a middleware to the Serialize stack after the\n// operation serializer that will convert the query request body to a GET\n// operation with the query message in the HTTP request querystring.\nfunc AddAsGetRequestMiddleware(stack *middleware.Stack) error {\n\treturn stack.Serialize.Insert(&asGetRequest{}, \"OperationSerializer\", middleware.After)\n}\n\ntype asGetRequest struct{}\n\nfunc (*asGetRequest) ID() string { return \"Query:AsGetRequest\" }\n\nfunc (m *asGetRequest) HandleSerialize(\n\tctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := input.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expect smithy HTTP Request, got %T\", input.Request)\n\t}\n\n\treq.Method = \"GET\"\n\n\t// If the stream is not set, nothing else to do.\n\tstream := req.GetStream()\n\tif stream == nil {\n\t\treturn next.HandleSerialize(ctx, input)\n\t}\n\n\t// Clear the stream since there will not be any body.\n\treq.Header.Del(\"Content-Type\")\n\treq, err = req.SetStream(nil)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"unable update request body %w\", err)\n\t}\n\tinput.Request = req\n\n\t// Update request query with the body's query string value.\n\tdelim := \"\"\n\tif len(req.URL.RawQuery) != 0 {\n\t\tdelim = \"&\"\n\t}\n\n\tb, err := ioutil.ReadAll(stream)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"unable to get request body %w\", err)\n\t}\n\treq.URL.RawQuery += delim + string(b)\n\n\treturn next.HandleSerialize(ctx, input)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go",
    "content": "package query\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// Object represents the encoding of Query structures and unions. A Query\n// object is a representation of a mapping of string keys to arbitrary\n// values where there is a fixed set of keys whose values each have their\n// own known type. A serialized object might look like the following:\n//\n//\tObjectName.Foo=value\n//\t&ObjectName.Bar=5\ntype Object struct {\n\t// The query values to add the object to.\n\tvalues url.Values\n\t// The object's prefix, which includes the names of all parent structures\n\t// and ends with the name of the object. For example, the prefix might be\n\t// \"ParentStructure.ObjectName\". This prefix will be used to form the full\n\t// keys for each member of the object. For example, a member might have the\n\t// key \"ParentStructure.ObjectName.MemberName\".\n\t//\n\t// While this is currently represented as a string that gets added to, it\n\t// could also be represented as a stack that only gets condensed into a\n\t// string when a finalized key is created. This could potentially reduce\n\t// allocations.\n\tprefix string\n}\n\nfunc newObject(values url.Values, prefix string) *Object {\n\treturn &Object{\n\t\tvalues: values,\n\t\tprefix: prefix,\n\t}\n}\n\n// Key adds the given named key to the Query object.\n// Returns a Value encoder that should be used to encode a Query value type.\nfunc (o *Object) Key(name string) Value {\n\treturn o.key(name, false)\n}\n\n// KeyWithValues adds the given named key to the Query object.\n// Returns a Value encoder that should be used to encode a Query list of values.\nfunc (o *Object) KeyWithValues(name string) Value {\n\treturn o.keyWithValues(name, false)\n}\n\n// FlatKey adds the given named key to the Query object.\n// Returns a Value encoder that should be used to encode a Query value type. The\n// value will be flattened if it is a map or array.\nfunc (o *Object) FlatKey(name string) Value {\n\treturn o.key(name, true)\n}\n\nfunc (o *Object) key(name string, flatValue bool) Value {\n\tif o.prefix != \"\" {\n\t\treturn newValue(o.values, fmt.Sprintf(\"%s.%s\", o.prefix, name), flatValue)\n\t}\n\treturn newValue(o.values, name, flatValue)\n}\n\nfunc (o *Object) keyWithValues(name string, flatValue bool) Value {\n\tif o.prefix != \"\" {\n\t\treturn newAppendValue(o.values, fmt.Sprintf(\"%s.%s\", o.prefix, name), flatValue)\n\t}\n\treturn newAppendValue(o.values, name, flatValue)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go",
    "content": "package query\n\nimport (\n\t\"math/big\"\n\t\"net/url\"\n\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n)\n\n// Value represents a Query Value type.\ntype Value struct {\n\t// The query values to add the value to.\n\tvalues url.Values\n\t// The value's key, which will form the prefix for complex types.\n\tkey string\n\t// Whether the value should be flattened or not if it's a flattenable type.\n\tflat       bool\n\tqueryValue httpbinding.QueryValue\n}\n\nfunc newValue(values url.Values, key string, flat bool) Value {\n\treturn Value{\n\t\tvalues:     values,\n\t\tkey:        key,\n\t\tflat:       flat,\n\t\tqueryValue: httpbinding.NewQueryValue(values, key, false),\n\t}\n}\n\nfunc newAppendValue(values url.Values, key string, flat bool) Value {\n\treturn Value{\n\t\tvalues:     values,\n\t\tkey:        key,\n\t\tflat:       flat,\n\t\tqueryValue: httpbinding.NewQueryValue(values, key, true),\n\t}\n}\n\nfunc newBaseValue(values url.Values) Value {\n\treturn Value{\n\t\tvalues:     values,\n\t\tqueryValue: httpbinding.NewQueryValue(nil, \"\", false),\n\t}\n}\n\n// Array returns a new Array encoder.\nfunc (qv Value) Array(locationName string) *Array {\n\treturn newArray(qv.values, qv.key, qv.flat, locationName)\n}\n\n// Object returns a new Object encoder.\nfunc (qv Value) Object() *Object {\n\treturn newObject(qv.values, qv.key)\n}\n\n// Map returns a new Map encoder.\nfunc (qv Value) Map(keyLocationName string, valueLocationName string) *Map {\n\treturn newMap(qv.values, qv.key, qv.flat, keyLocationName, valueLocationName)\n}\n\n// Base64EncodeBytes encodes v as a base64 query string value.\n// This is intended to enable compatibility with the JSON encoder.\nfunc (qv Value) Base64EncodeBytes(v []byte) {\n\tqv.queryValue.Blob(v)\n}\n\n// Boolean encodes v as a query string value\nfunc (qv Value) Boolean(v bool) {\n\tqv.queryValue.Boolean(v)\n}\n\n// String encodes v as a query string value\nfunc (qv Value) String(v string) {\n\tqv.queryValue.String(v)\n}\n\n// Byte encodes v as a query string value\nfunc (qv Value) Byte(v int8) {\n\tqv.queryValue.Byte(v)\n}\n\n// Short encodes v as a query string value\nfunc (qv Value) Short(v int16) {\n\tqv.queryValue.Short(v)\n}\n\n// Integer encodes v as a query string value\nfunc (qv Value) Integer(v int32) {\n\tqv.queryValue.Integer(v)\n}\n\n// Long encodes v as a query string value\nfunc (qv Value) Long(v int64) {\n\tqv.queryValue.Long(v)\n}\n\n// Float encodes v as a query string value\nfunc (qv Value) Float(v float32) {\n\tqv.queryValue.Float(v)\n}\n\n// Double encodes v as a query string value\nfunc (qv Value) Double(v float64) {\n\tqv.queryValue.Double(v)\n}\n\n// BigInteger encodes v as a query string value\nfunc (qv Value) BigInteger(v *big.Int) {\n\tqv.queryValue.BigInteger(v)\n}\n\n// BigDecimal encodes v as a query string value\nfunc (qv Value) BigDecimal(v *big.Float) {\n\tqv.queryValue.BigDecimal(v)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go",
    "content": "package restjson\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/aws/smithy-go\"\n)\n\n// GetErrorInfo util looks for code, __type, and message members in the\n// json body. These members are optionally available, and the function\n// returns the value of member if it is available. This function is useful to\n// identify the error code, msg in a REST JSON error response.\nfunc GetErrorInfo(decoder *json.Decoder) (errorType string, message string, err error) {\n\tvar errInfo struct {\n\t\tCode    string\n\t\tType    string `json:\"__type\"`\n\t\tMessage string\n\t}\n\n\terr = decoder.Decode(&errInfo)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\treturn errorType, message, nil\n\t\t}\n\t\treturn errorType, message, err\n\t}\n\n\t// assign error type\n\tif len(errInfo.Code) != 0 {\n\t\terrorType = errInfo.Code\n\t} else if len(errInfo.Type) != 0 {\n\t\terrorType = errInfo.Type\n\t}\n\n\t// assign error message\n\tif len(errInfo.Message) != 0 {\n\t\tmessage = errInfo.Message\n\t}\n\n\t// sanitize error\n\tif len(errorType) != 0 {\n\t\terrorType = SanitizeErrorCode(errorType)\n\t}\n\n\treturn errorType, message, nil\n}\n\n// SanitizeErrorCode sanitizes the errorCode string .\n// The rule for sanitizing is if a `:` character is present, then take only the\n// contents before the first : character in the value.\n// If a # character is present, then take only the contents after the\n// first # character in the value.\nfunc SanitizeErrorCode(errorCode string) string {\n\tif strings.ContainsAny(errorCode, \":\") {\n\t\terrorCode = strings.SplitN(errorCode, \":\", 2)[0]\n\t}\n\n\tif strings.ContainsAny(errorCode, \"#\") {\n\t\terrorCode = strings.SplitN(errorCode, \"#\", 2)[1]\n\t}\n\n\treturn errorCode\n}\n\n// GetSmithyGenericAPIError returns smithy generic api error and an error interface.\n// Takes in json decoder, and error Code string as args. The function retrieves error message\n// and error code from the decoder body. If errorCode of length greater than 0 is passed in as\n// an argument, it is used instead.\nfunc GetSmithyGenericAPIError(decoder *json.Decoder, errorCode string) (*smithy.GenericAPIError, error) {\n\terrorType, message, err := GetErrorInfo(decoder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(errorCode) == 0 {\n\t\terrorCode = errorType\n\t}\n\n\treturn &smithy.GenericAPIError{\n\t\tCode:    errorCode,\n\t\tMessage: message,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go",
    "content": "package xml\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// ErrorComponents represents the error response fields\n// that will be deserialized from an xml error response body\ntype ErrorComponents struct {\n\tCode      string\n\tMessage   string\n\tRequestID string\n}\n\n// GetErrorResponseComponents returns the error fields from an xml error response body\nfunc GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error) {\n\tif noErrorWrapping {\n\t\tvar errResponse noWrappedErrorResponse\n\t\tif err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF {\n\t\t\treturn ErrorComponents{}, fmt.Errorf(\"error while deserializing xml error response: %w\", err)\n\t\t}\n\t\treturn ErrorComponents(errResponse), nil\n\t}\n\n\tvar errResponse wrappedErrorResponse\n\tif err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF {\n\t\treturn ErrorComponents{}, fmt.Errorf(\"error while deserializing xml error response: %w\", err)\n\t}\n\treturn ErrorComponents(errResponse), nil\n}\n\n// noWrappedErrorResponse represents the error response body with\n// no internal Error wrapping\ntype noWrappedErrorResponse struct {\n\tCode      string `xml:\"Code\"`\n\tMessage   string `xml:\"Message\"`\n\tRequestID string `xml:\"RequestId\"`\n}\n\n// wrappedErrorResponse represents the error response body\n// wrapped within Error\ntype wrappedErrorResponse struct {\n\tCode      string `xml:\"Error>Code\"`\n\tMessage   string `xml:\"Error>Message\"`\n\tRequestID string `xml:\"RequestId\"`\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go",
    "content": "package ratelimit\n\nimport \"context\"\n\n// None implements a no-op rate limiter which effectively disables client-side\n// rate limiting (also known as \"retry quotas\").\n//\n// GetToken does nothing and always returns a nil error. The returned\n// token-release function does nothing, and always returns a nil error.\n//\n// AddTokens does nothing and always returns a nil error.\nvar None = &none{}\n\ntype none struct{}\n\nfunc (*none) GetToken(ctx context.Context, cost uint) (func() error, error) {\n\treturn func() error { return nil }, nil\n}\n\nfunc (*none) AddTokens(v uint) error { return nil }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go",
    "content": "package ratelimit\n\nimport (\n\t\"sync\"\n)\n\n// TokenBucket provides a concurrency safe utility for adding and removing\n// tokens from the available token bucket.\ntype TokenBucket struct {\n\tremainingTokens uint\n\tmaxCapacity     uint\n\tminCapacity     uint\n\tmu              sync.Mutex\n}\n\n// NewTokenBucket returns an initialized TokenBucket with the capacity\n// specified.\nfunc NewTokenBucket(i uint) *TokenBucket {\n\treturn &TokenBucket{\n\t\tremainingTokens: i,\n\t\tmaxCapacity:     i,\n\t\tminCapacity:     1,\n\t}\n}\n\n// Retrieve attempts to reduce the available tokens by the amount requested. If\n// there are tokens available true will be returned along with the number of\n// available tokens remaining. If amount requested is larger than the available\n// capacity, false will be returned along with the available capacity. If the\n// amount is less than the available capacity, the capacity will be reduced by\n// that amount, and the remaining capacity and true will be returned.\nfunc (t *TokenBucket) Retrieve(amount uint) (available uint, retrieved bool) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tif amount > t.remainingTokens {\n\t\treturn t.remainingTokens, false\n\t}\n\n\tt.remainingTokens -= amount\n\treturn t.remainingTokens, true\n}\n\n// Refund returns the amount of tokens back to the available token bucket, up\n// to the initial capacity.\nfunc (t *TokenBucket) Refund(amount uint) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\t// Capacity cannot exceed max capacity.\n\tt.remainingTokens = uintMin(t.remainingTokens+amount, t.maxCapacity)\n}\n\n// Capacity returns the maximum capacity of tokens that the bucket could\n// contain.\nfunc (t *TokenBucket) Capacity() uint {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\treturn t.maxCapacity\n}\n\n// Remaining returns the number of tokens that remaining in the bucket.\nfunc (t *TokenBucket) Remaining() uint {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\treturn t.remainingTokens\n}\n\n// Resize adjusts the size of the token bucket. Returns the capacity remaining.\nfunc (t *TokenBucket) Resize(size uint) uint {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tt.maxCapacity = uintMax(size, t.minCapacity)\n\n\t// Capacity needs to be capped at max capacity, if max size reduced.\n\tt.remainingTokens = uintMin(t.remainingTokens, t.maxCapacity)\n\n\treturn t.remainingTokens\n}\n\nfunc uintMin(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc uintMax(a, b uint) uint {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go",
    "content": "package ratelimit\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\ntype rateToken struct {\n\ttokenCost uint\n\tbucket    *TokenBucket\n}\n\nfunc (t rateToken) release() error {\n\tt.bucket.Refund(t.tokenCost)\n\treturn nil\n}\n\n// TokenRateLimit provides a Token Bucket RateLimiter implementation\n// that limits the overall number of retry attempts that can be made across\n// operation invocations.\ntype TokenRateLimit struct {\n\tbucket *TokenBucket\n}\n\n// NewTokenRateLimit returns an TokenRateLimit with default values.\n// Functional options can configure the retry rate limiter.\nfunc NewTokenRateLimit(tokens uint) *TokenRateLimit {\n\treturn &TokenRateLimit{\n\t\tbucket: NewTokenBucket(tokens),\n\t}\n}\n\ntype canceledError struct {\n\tErr error\n}\n\nfunc (c canceledError) CanceledError() bool { return true }\nfunc (c canceledError) Unwrap() error       { return c.Err }\nfunc (c canceledError) Error() string {\n\treturn fmt.Sprintf(\"canceled, %v\", c.Err)\n}\n\n// GetToken may cause a available pool of retry quota to be\n// decremented. Will return an error if the decremented value can not be\n// reduced from the retry quota.\nfunc (l *TokenRateLimit) GetToken(ctx context.Context, cost uint) (func() error, error) {\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn nil, canceledError{Err: ctx.Err()}\n\tdefault:\n\t}\n\tif avail, ok := l.bucket.Retrieve(cost); !ok {\n\t\treturn nil, QuotaExceededError{Available: avail, Requested: cost}\n\t}\n\n\treturn rateToken{\n\t\ttokenCost: cost,\n\t\tbucket:    l.bucket,\n\t}.release, nil\n}\n\n// AddTokens increments the token bucket by a fixed amount.\nfunc (l *TokenRateLimit) AddTokens(v uint) error {\n\tl.bucket.Refund(v)\n\treturn nil\n}\n\n// Remaining returns the number of remaining tokens in the bucket.\nfunc (l *TokenRateLimit) Remaining() uint {\n\treturn l.bucket.Remaining()\n}\n\n// QuotaExceededError provides the SDK error when the retries for a given\n// token bucket have been exhausted.\ntype QuotaExceededError struct {\n\tAvailable uint\n\tRequested uint\n}\n\nfunc (e QuotaExceededError) Error() string {\n\treturn fmt.Sprintf(\"retry quota exceeded, %d available, %d requested\",\n\t\te.Available, e.Requested)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/request.go",
    "content": "package aws\n\nimport (\n\t\"fmt\"\n)\n\n// TODO remove replace with smithy.CanceledError\n\n// RequestCanceledError is the error that will be returned by an API request\n// that was canceled. Requests given a Context may return this error when\n// canceled.\ntype RequestCanceledError struct {\n\tErr error\n}\n\n// CanceledError returns true to satisfy interfaces checking for canceled errors.\nfunc (*RequestCanceledError) CanceledError() bool { return true }\n\n// Unwrap returns the underlying error, if there was one.\nfunc (e *RequestCanceledError) Unwrap() error {\n\treturn e.Err\n}\nfunc (e *RequestCanceledError) Error() string {\n\treturn fmt.Sprintf(\"request canceled, %v\", e.Err)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go",
    "content": "package retry\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n)\n\nconst (\n\t// DefaultRequestCost is the cost of a single request from the adaptive\n\t// rate limited token bucket.\n\tDefaultRequestCost uint = 1\n)\n\n// DefaultThrottles provides the set of errors considered throttle errors that\n// are checked by default.\nvar DefaultThrottles = []IsErrorThrottle{\n\tThrottleErrorCode{\n\t\tCodes: DefaultThrottleErrorCodes,\n\t},\n}\n\n// AdaptiveModeOptions provides the functional options for configuring the\n// adaptive retry mode, and delay behavior.\ntype AdaptiveModeOptions struct {\n\t// If the adaptive token bucket is empty, when an attempt will be made\n\t// AdaptiveMode will sleep until a token is available. This can occur when\n\t// attempts fail with throttle errors. Use this option to disable the sleep\n\t// until token is available, and return error immediately.\n\tFailOnNoAttemptTokens bool\n\n\t// The cost of an attempt from the AdaptiveMode's adaptive token bucket.\n\tRequestCost uint\n\n\t// Set of strategies to determine if the attempt failed due to a throttle\n\t// error.\n\t//\n\t// It is safe to append to this list in NewAdaptiveMode's functional options.\n\tThrottles []IsErrorThrottle\n\n\t// Set of options for standard retry mode that AdaptiveMode is built on top\n\t// of. AdaptiveMode may apply its own defaults to Standard retry mode that\n\t// are different than the defaults of NewStandard. Use these options to\n\t// override the default options.\n\tStandardOptions []func(*StandardOptions)\n}\n\n// AdaptiveMode provides an experimental retry strategy that expands on the\n// Standard retry strategy, adding client attempt rate limits. The attempt rate\n// limit is initially unrestricted, but becomes restricted when the attempt\n// fails with for a throttle error. When restricted AdaptiveMode may need to\n// sleep before an attempt is made, if too many throttles have been received.\n// AdaptiveMode's sleep can be canceled with context cancel. Set\n// AdaptiveModeOptions FailOnNoAttemptTokens to change the behavior from sleep,\n// to fail fast.\n//\n// Eventually unrestricted attempt rate limit will be restored once attempts no\n// longer are failing due to throttle errors.\ntype AdaptiveMode struct {\n\toptions   AdaptiveModeOptions\n\tthrottles IsErrorThrottles\n\n\tretryer   aws.RetryerV2\n\trateLimit *adaptiveRateLimit\n}\n\n// NewAdaptiveMode returns an initialized AdaptiveMode retry strategy.\nfunc NewAdaptiveMode(optFns ...func(*AdaptiveModeOptions)) *AdaptiveMode {\n\to := AdaptiveModeOptions{\n\t\tRequestCost: DefaultRequestCost,\n\t\tThrottles:   append([]IsErrorThrottle{}, DefaultThrottles...),\n\t}\n\tfor _, fn := range optFns {\n\t\tfn(&o)\n\t}\n\n\treturn &AdaptiveMode{\n\t\toptions:   o,\n\t\tthrottles: IsErrorThrottles(o.Throttles),\n\t\tretryer:   NewStandard(o.StandardOptions...),\n\t\trateLimit: newAdaptiveRateLimit(),\n\t}\n}\n\n// IsErrorRetryable returns if the failed attempt is retryable. This check\n// should determine if the error can be retried, or if the error is\n// terminal.\nfunc (a *AdaptiveMode) IsErrorRetryable(err error) bool {\n\treturn a.retryer.IsErrorRetryable(err)\n}\n\n// MaxAttempts returns the maximum number of attempts that can be made for\n// an attempt before failing. A value of 0 implies that the attempt should\n// be retried until it succeeds if the errors are retryable.\nfunc (a *AdaptiveMode) MaxAttempts() int {\n\treturn a.retryer.MaxAttempts()\n}\n\n// RetryDelay returns the delay that should be used before retrying the\n// attempt. Will return error if the if the delay could not be determined.\nfunc (a *AdaptiveMode) RetryDelay(attempt int, opErr error) (\n\ttime.Duration, error,\n) {\n\treturn a.retryer.RetryDelay(attempt, opErr)\n}\n\n// GetRetryToken attempts to deduct the retry cost from the retry token pool.\n// Returning the token release function, or error.\nfunc (a *AdaptiveMode) GetRetryToken(ctx context.Context, opErr error) (\n\treleaseToken func(error) error, err error,\n) {\n\treturn a.retryer.GetRetryToken(ctx, opErr)\n}\n\n// GetInitialToken returns the initial attempt token that can increment the\n// retry token pool if the attempt is successful.\n//\n// Deprecated: This method does not provide a way to block using Context,\n// nor can it return an error. Use RetryerV2, and GetAttemptToken instead. Only\n// present to implement Retryer interface.\nfunc (a *AdaptiveMode) GetInitialToken() (releaseToken func(error) error) {\n\treturn nopRelease\n}\n\n// GetAttemptToken returns the attempt token that can be used to rate limit\n// attempt calls. Will be used by the SDK's retry package's Attempt\n// middleware to get an attempt token prior to calling the temp and releasing\n// the attempt token after the attempt has been made.\nfunc (a *AdaptiveMode) GetAttemptToken(ctx context.Context) (func(error) error, error) {\n\tfor {\n\t\tacquiredToken, waitTryAgain := a.rateLimit.AcquireToken(a.options.RequestCost)\n\t\tif acquiredToken {\n\t\t\tbreak\n\t\t}\n\t\tif a.options.FailOnNoAttemptTokens {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"unable to get attempt token, and FailOnNoAttemptTokens enables\")\n\t\t}\n\n\t\tif err := sdk.SleepWithContext(ctx, waitTryAgain); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to wait for token to be available, %w\", err)\n\t\t}\n\t}\n\n\treturn a.handleResponse, nil\n}\n\nfunc (a *AdaptiveMode) handleResponse(opErr error) error {\n\tthrottled := a.throttles.IsErrorThrottle(opErr).Bool()\n\n\ta.rateLimit.Update(throttled)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go",
    "content": "package retry\n\nimport (\n\t\"math\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n)\n\ntype adaptiveRateLimit struct {\n\ttokenBucketEnabled bool\n\n\tsmooth        float64\n\tbeta          float64\n\tscaleConstant float64\n\tminFillRate   float64\n\n\tfillRate         float64\n\tcalculatedRate   float64\n\tlastRefilled     time.Time\n\tmeasuredTxRate   float64\n\tlastTxRateBucket float64\n\trequestCount     int64\n\tlastMaxRate      float64\n\tlastThrottleTime time.Time\n\ttimeWindow       float64\n\n\ttokenBucket *adaptiveTokenBucket\n\n\tmu sync.Mutex\n}\n\nfunc newAdaptiveRateLimit() *adaptiveRateLimit {\n\tnow := sdk.NowTime()\n\treturn &adaptiveRateLimit{\n\t\tsmooth:        0.8,\n\t\tbeta:          0.7,\n\t\tscaleConstant: 0.4,\n\n\t\tminFillRate: 0.5,\n\n\t\tlastTxRateBucket: math.Floor(timeFloat64Seconds(now)),\n\t\tlastThrottleTime: now,\n\n\t\ttokenBucket: newAdaptiveTokenBucket(0),\n\t}\n}\n\nfunc (a *adaptiveRateLimit) Enable(v bool) {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\n\ta.tokenBucketEnabled = v\n}\n\nfunc (a *adaptiveRateLimit) AcquireToken(amount uint) (\n\ttokenAcquired bool, waitTryAgain time.Duration,\n) {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\n\tif !a.tokenBucketEnabled {\n\t\treturn true, 0\n\t}\n\n\ta.tokenBucketRefill()\n\n\tavailable, ok := a.tokenBucket.Retrieve(float64(amount))\n\tif !ok {\n\t\twaitDur := float64Seconds((float64(amount) - available) / a.fillRate)\n\t\treturn false, waitDur\n\t}\n\n\treturn true, 0\n}\n\nfunc (a *adaptiveRateLimit) Update(throttled bool) {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\n\ta.updateMeasuredRate()\n\n\tif throttled {\n\t\trateToUse := a.measuredTxRate\n\t\tif a.tokenBucketEnabled {\n\t\t\trateToUse = math.Min(a.measuredTxRate, a.fillRate)\n\t\t}\n\n\t\ta.lastMaxRate = rateToUse\n\t\ta.calculateTimeWindow()\n\t\ta.lastThrottleTime = sdk.NowTime()\n\t\ta.calculatedRate = a.cubicThrottle(rateToUse)\n\t\ta.tokenBucketEnabled = true\n\t} else {\n\t\ta.calculateTimeWindow()\n\t\ta.calculatedRate = a.cubicSuccess(sdk.NowTime())\n\t}\n\n\tnewRate := math.Min(a.calculatedRate, 2*a.measuredTxRate)\n\ta.tokenBucketUpdateRate(newRate)\n}\n\nfunc (a *adaptiveRateLimit) cubicSuccess(t time.Time) float64 {\n\tdt := secondsFloat64(t.Sub(a.lastThrottleTime))\n\treturn (a.scaleConstant * math.Pow(dt-a.timeWindow, 3)) + a.lastMaxRate\n}\n\nfunc (a *adaptiveRateLimit) cubicThrottle(rateToUse float64) float64 {\n\treturn rateToUse * a.beta\n}\n\nfunc (a *adaptiveRateLimit) calculateTimeWindow() {\n\ta.timeWindow = math.Pow((a.lastMaxRate*(1.-a.beta))/a.scaleConstant, 1./3.)\n}\n\nfunc (a *adaptiveRateLimit) tokenBucketUpdateRate(newRPS float64) {\n\ta.tokenBucketRefill()\n\ta.fillRate = math.Max(newRPS, a.minFillRate)\n\ta.tokenBucket.Resize(newRPS)\n}\n\nfunc (a *adaptiveRateLimit) updateMeasuredRate() {\n\tnow := sdk.NowTime()\n\ttimeBucket := math.Floor(timeFloat64Seconds(now)*2.) / 2.\n\ta.requestCount++\n\n\tif timeBucket > a.lastTxRateBucket {\n\t\tcurrentRate := float64(a.requestCount) / (timeBucket - a.lastTxRateBucket)\n\t\ta.measuredTxRate = (currentRate * a.smooth) + (a.measuredTxRate * (1. - a.smooth))\n\t\ta.requestCount = 0\n\t\ta.lastTxRateBucket = timeBucket\n\t}\n}\n\nfunc (a *adaptiveRateLimit) tokenBucketRefill() {\n\tnow := sdk.NowTime()\n\tif a.lastRefilled.IsZero() {\n\t\ta.lastRefilled = now\n\t\treturn\n\t}\n\n\tfillAmount := secondsFloat64(now.Sub(a.lastRefilled)) * a.fillRate\n\ta.tokenBucket.Refund(fillAmount)\n\ta.lastRefilled = now\n}\n\nfunc float64Seconds(v float64) time.Duration {\n\treturn time.Duration(v * float64(time.Second))\n}\n\nfunc secondsFloat64(v time.Duration) float64 {\n\treturn float64(v) / float64(time.Second)\n}\n\nfunc timeFloat64Seconds(v time.Time) float64 {\n\treturn float64(v.UnixNano()) / float64(time.Second)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go",
    "content": "package retry\n\nimport (\n\t\"math\"\n\t\"sync\"\n)\n\n// adaptiveTokenBucket provides a concurrency safe utility for adding and\n// removing tokens from the available token bucket.\ntype adaptiveTokenBucket struct {\n\tremainingTokens float64\n\tmaxCapacity     float64\n\tminCapacity     float64\n\tmu              sync.Mutex\n}\n\n// newAdaptiveTokenBucket returns an initialized adaptiveTokenBucket with the\n// capacity specified.\nfunc newAdaptiveTokenBucket(i float64) *adaptiveTokenBucket {\n\treturn &adaptiveTokenBucket{\n\t\tremainingTokens: i,\n\t\tmaxCapacity:     i,\n\t\tminCapacity:     1,\n\t}\n}\n\n// Retrieve attempts to reduce the available tokens by the amount requested. If\n// there are tokens available true will be returned along with the number of\n// available tokens remaining. If amount requested is larger than the available\n// capacity, false will be returned along with the available capacity. If the\n// amount is less than the available capacity, the capacity will be reduced by\n// that amount, and the remaining capacity and true will be returned.\nfunc (t *adaptiveTokenBucket) Retrieve(amount float64) (available float64, retrieved bool) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tif amount > t.remainingTokens {\n\t\treturn t.remainingTokens, false\n\t}\n\n\tt.remainingTokens -= amount\n\treturn t.remainingTokens, true\n}\n\n// Refund returns the amount of tokens back to the available token bucket, up\n// to the initial capacity.\nfunc (t *adaptiveTokenBucket) Refund(amount float64) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\t// Capacity cannot exceed max capacity.\n\tt.remainingTokens = math.Min(t.remainingTokens+amount, t.maxCapacity)\n}\n\n// Capacity returns the maximum capacity of tokens that the bucket could\n// contain.\nfunc (t *adaptiveTokenBucket) Capacity() float64 {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\treturn t.maxCapacity\n}\n\n// Remaining returns the number of tokens that remaining in the bucket.\nfunc (t *adaptiveTokenBucket) Remaining() float64 {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\treturn t.remainingTokens\n}\n\n// Resize adjusts the size of the token bucket. Returns the capacity remaining.\nfunc (t *adaptiveTokenBucket) Resize(size float64) float64 {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tt.maxCapacity = math.Max(size, t.minCapacity)\n\n\t// Capacity needs to be capped at max capacity, if max size reduced.\n\tt.remainingTokens = math.Min(t.remainingTokens, t.maxCapacity)\n\n\treturn t.remainingTokens\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go",
    "content": "// Package retry provides interfaces and implementations for SDK request retry behavior.\n//\n// # Retryer Interface and Implementations\n//\n// This package defines Retryer interface that is used to either implement custom retry behavior\n// or to extend the existing retry implementations provided by the SDK. This package provides a single\n// retry implementation: Standard.\n//\n// # Standard\n//\n// Standard is the default retryer implementation used by service clients. The standard retryer is a rate limited\n// retryer that has a configurable max attempts to limit the number of retry attempts when a retryable error occurs.\n// In addition, the retryer uses a configurable token bucket to rate limit the retry attempts across the client,\n// and uses an additional delay policy to limit the time between a requests subsequent attempts.\n//\n// By default the standard retryer uses the DefaultRetryables slice of IsErrorRetryable types to determine whether\n// a given error is retryable. By default this list of retryables includes the following:\n//   - Retrying errors that implement the RetryableError method, and return true.\n//   - Connection Errors\n//   - Errors that implement a ConnectionError, Temporary, or Timeout method that return true.\n//   - Connection Reset Errors.\n//   - net.OpErr types that are dialing errors or are temporary.\n//   - HTTP Status Codes: 500, 502, 503, and 504.\n//   - API Error Codes\n//   - RequestTimeout, RequestTimeoutException\n//   - Throttling, ThrottlingException, ThrottledException, RequestThrottledException, TooManyRequestsException,\n//     RequestThrottled, SlowDown, EC2ThrottledException\n//   - ProvisionedThroughputExceededException, RequestLimitExceeded, BandwidthLimitExceeded, LimitExceededException\n//   - TransactionInProgressException, PriorRequestNotComplete\n//\n// The standard retryer will not retry a request in the event if the context associated with the request\n// has been cancelled. Applications must handle this case explicitly if they wish to retry with a different context\n// value.\n//\n// You can configure the standard retryer implementation to fit your applications by constructing a standard retryer\n// using the NewStandard function, and providing one more functional argument that mutate the StandardOptions\n// structure. StandardOptions provides the ability to modify the token bucket rate limiter, retryable error conditions,\n// and the retry delay policy.\n//\n// For example to modify the default retry attempts for the standard retryer:\n//\n//\t// configure the custom retryer\n//\tcustomRetry := retry.NewStandard(func(o *retry.StandardOptions) {\n//\t    o.MaxAttempts = 5\n//\t})\n//\n//\t// create a service client with the retryer\n//\ts3.NewFromConfig(cfg, func(o *s3.Options) {\n//\t    o.Retryer = customRetry\n//\t})\n//\n// # Utilities\n//\n// A number of package functions have been provided to easily wrap retryer implementations in an implementation agnostic\n// way. These are:\n//\n//\tAddWithErrorCodes      - Provides the ability to add additional API error codes that should be considered retryable\n//\t                        in addition to those considered retryable by the provided retryer.\n//\n//\tAddWithMaxAttempts     - Provides the ability to set the max number of attempts for retrying a request by wrapping\n//\t                         a retryer implementation.\n//\n//\tAddWithMaxBackoffDelay - Provides the ability to set the max back off delay that can occur before retrying a\n//\t                         request by wrapping a retryer implementation.\n//\n// The following package functions have been provided to easily satisfy different retry interfaces to further customize\n// a given retryer's behavior:\n//\n//\tBackoffDelayerFunc   - Can be used to wrap a function to satisfy the BackoffDelayer interface. For example,\n//\t                       you can use this method to easily create custom back off policies to be used with the\n//\t                       standard retryer.\n//\n//\tIsErrorRetryableFunc - Can be used to wrap a function to satisfy the IsErrorRetryable interface. For example,\n//\t                       this can be used to extend the standard retryer to add additional logic to determine if an\n//\t                       error should be retried.\n//\n//\tIsErrorTimeoutFunc   - Can be used to wrap a function to satisfy IsErrorTimeout interface. For example,\n//\t                       this can be used to extend the standard retryer to add additional logic to determine if an\n//\t                        error should be considered a timeout.\npackage retry\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.go",
    "content": "package retry\n\nimport \"fmt\"\n\n// MaxAttemptsError provides the error when the maximum number of attempts have\n// been exceeded.\ntype MaxAttemptsError struct {\n\tAttempt int\n\tErr     error\n}\n\nfunc (e *MaxAttemptsError) Error() string {\n\treturn fmt.Sprintf(\"exceeded maximum number of attempts, %d, %v\", e.Attempt, e.Err)\n}\n\n// Unwrap returns the nested error causing the max attempts error. Provides the\n// implementation for errors.Is and errors.As to unwrap nested errors.\nfunc (e *MaxAttemptsError) Unwrap() error {\n\treturn e.Err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.go",
    "content": "package retry\n\nimport (\n\t\"math\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/internal/rand\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/timeconv\"\n)\n\n// ExponentialJitterBackoff provides backoff delays with jitter based on the\n// number of attempts.\ntype ExponentialJitterBackoff struct {\n\tmaxBackoff time.Duration\n\t// precomputed number of attempts needed to reach max backoff.\n\tmaxBackoffAttempts float64\n\n\trandFloat64 func() (float64, error)\n}\n\n// NewExponentialJitterBackoff returns an ExponentialJitterBackoff configured\n// for the max backoff.\nfunc NewExponentialJitterBackoff(maxBackoff time.Duration) *ExponentialJitterBackoff {\n\treturn &ExponentialJitterBackoff{\n\t\tmaxBackoff: maxBackoff,\n\t\tmaxBackoffAttempts: math.Log2(\n\t\t\tfloat64(maxBackoff) / float64(time.Second)),\n\t\trandFloat64: rand.CryptoRandFloat64,\n\t}\n}\n\n// BackoffDelay returns the duration to wait before the next attempt should be\n// made. Returns an error if unable get a duration.\nfunc (j *ExponentialJitterBackoff) BackoffDelay(attempt int, err error) (time.Duration, error) {\n\tif attempt > int(j.maxBackoffAttempts) {\n\t\treturn j.maxBackoff, nil\n\t}\n\n\tb, err := j.randFloat64()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// [0.0, 1.0) * 2 ^ attempts\n\tri := int64(1 << uint64(attempt))\n\tdelaySeconds := b * float64(ri)\n\n\treturn timeconv.FloatSecondsDur(delaySeconds), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.go",
    "content": "package retry\n\nimport (\n\tawsmiddle \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// attemptResultsKey is a metadata accessor key to retrieve metadata\n// for all request attempts.\ntype attemptResultsKey struct {\n}\n\n// GetAttemptResults retrieves attempts results from middleware metadata.\nfunc GetAttemptResults(metadata middleware.Metadata) (AttemptResults, bool) {\n\tm, ok := metadata.Get(attemptResultsKey{}).(AttemptResults)\n\treturn m, ok\n}\n\n// AttemptResults represents struct containing metadata returned by all request attempts.\ntype AttemptResults struct {\n\n\t// Results is a slice consisting attempt result from all request attempts.\n\t// Results are stored in order request attempt is made.\n\tResults []AttemptResult\n}\n\n// AttemptResult represents attempt result returned by a single request attempt.\ntype AttemptResult struct {\n\n\t// Err is the error if received for the request attempt.\n\tErr error\n\n\t// Retryable denotes if request may be retried. This states if an\n\t// error is considered retryable.\n\tRetryable bool\n\n\t// Retried indicates if this request was retried.\n\tRetried bool\n\n\t// ResponseMetadata is any existing metadata passed via the response middlewares.\n\tResponseMetadata middleware.Metadata\n}\n\n// addAttemptResults adds attempt results to middleware metadata\nfunc addAttemptResults(metadata *middleware.Metadata, v AttemptResults) {\n\tmetadata.Set(attemptResultsKey{}, v)\n}\n\n// GetRawResponse returns raw response recorded for the attempt result\nfunc (a AttemptResult) GetRawResponse() interface{} {\n\treturn awsmiddle.GetRawResponse(a.ResponseMetadata)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go",
    "content": "package retry\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics\"\n\tinternalcontext \"github.com/aws/aws-sdk-go-v2/internal/context\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddle \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go/logging\"\n\tsmithymiddle \"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/transport/http\"\n)\n\n// RequestCloner is a function that can take an input request type and clone\n// the request for use in a subsequent retry attempt.\ntype RequestCloner func(interface{}) interface{}\n\ntype retryMetadata struct {\n\tAttemptNum       int\n\tAttemptTime      time.Time\n\tMaxAttempts      int\n\tAttemptClockSkew time.Duration\n}\n\n// Attempt is a Smithy Finalize middleware that handles retry attempts using\n// the provided Retryer implementation.\ntype Attempt struct {\n\t// Enable the logging of retry attempts performed by the SDK. This will\n\t// include logging retry attempts, unretryable errors, and when max\n\t// attempts are reached.\n\tLogAttempts bool\n\n\tretryer       aws.RetryerV2\n\trequestCloner RequestCloner\n}\n\n// define the threshold at which we will consider certain kind of errors to be probably\n// caused by clock skew\nconst skewThreshold = 4 * time.Minute\n\n// NewAttemptMiddleware returns a new Attempt retry middleware.\nfunc NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt {\n\tm := &Attempt{\n\t\tretryer:       wrapAsRetryerV2(retryer),\n\t\trequestCloner: requestCloner,\n\t}\n\tfor _, fn := range optFns {\n\t\tfn(m)\n\t}\n\treturn m\n}\n\n// ID returns the middleware identifier\nfunc (r *Attempt) ID() string { return \"Retry\" }\n\nfunc (r Attempt) logf(logger logging.Logger, classification logging.Classification, format string, v ...interface{}) {\n\tif !r.LogAttempts {\n\t\treturn\n\t}\n\tlogger.Logf(classification, format, v...)\n}\n\n// HandleFinalize utilizes the provider Retryer implementation to attempt\n// retries over the next handler\nfunc (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) (\n\tout smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error,\n) {\n\tvar attemptNum int\n\tvar attemptClockSkew time.Duration\n\tvar attemptResults AttemptResults\n\n\tmaxAttempts := r.retryer.MaxAttempts()\n\treleaseRetryToken := nopRelease\n\n\tfor {\n\t\tattemptNum++\n\t\tattemptInput := in\n\t\tattemptInput.Request = r.requestCloner(attemptInput.Request)\n\n\t\t// Record the metadata for the for attempt being started.\n\t\tattemptCtx := setRetryMetadata(ctx, retryMetadata{\n\t\t\tAttemptNum:       attemptNum,\n\t\t\tAttemptTime:      sdk.NowTime().UTC(),\n\t\t\tMaxAttempts:      maxAttempts,\n\t\t\tAttemptClockSkew: attemptClockSkew,\n\t\t})\n\n\t\t// Setting clock skew to be used on other context (like signing)\n\t\tctx = internalcontext.SetAttemptSkewContext(ctx, attemptClockSkew)\n\n\t\tvar attemptResult AttemptResult\n\t\tout, attemptResult, releaseRetryToken, err = r.handleAttempt(attemptCtx, attemptInput, releaseRetryToken, next)\n\t\tattemptClockSkew, _ = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata)\n\n\t\t// AttemptResult Retried states that the attempt was not successful, and\n\t\t// should be retried.\n\t\tshouldRetry := attemptResult.Retried\n\n\t\t// Add attempt metadata to list of all attempt metadata\n\t\tattemptResults.Results = append(attemptResults.Results, attemptResult)\n\n\t\tif !shouldRetry {\n\t\t\t// Ensure the last response's metadata is used as the bases for result\n\t\t\t// metadata returned by the stack. The Slice of attempt results\n\t\t\t// will be added to this cloned metadata.\n\t\t\tmetadata = attemptResult.ResponseMetadata.Clone()\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\taddAttemptResults(&metadata, attemptResults)\n\treturn out, metadata, err\n}\n\n// handleAttempt handles an individual request attempt.\nfunc (r *Attempt) handleAttempt(\n\tctx context.Context, in smithymiddle.FinalizeInput, releaseRetryToken func(error) error, next smithymiddle.FinalizeHandler,\n) (\n\tout smithymiddle.FinalizeOutput, attemptResult AttemptResult, _ func(error) error, err error,\n) {\n\tdefer func() {\n\t\tattemptResult.Err = err\n\t}()\n\n\t// Short circuit if this attempt never can succeed because the context is\n\t// canceled. This reduces the chance of token pools being modified for\n\t// attempts that will not be made\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn out, attemptResult, nopRelease, ctx.Err()\n\tdefault:\n\t}\n\n\t//------------------------------\n\t// Get Attempt Token\n\t//------------------------------\n\treleaseAttemptToken, err := r.retryer.GetAttemptToken(ctx)\n\tif err != nil {\n\t\treturn out, attemptResult, nopRelease, fmt.Errorf(\n\t\t\t\"failed to get retry Send token, %w\", err)\n\t}\n\n\t//------------------------------\n\t// Send Attempt\n\t//------------------------------\n\tlogger := smithymiddle.GetLogger(ctx)\n\tservice, operation := awsmiddle.GetServiceID(ctx), awsmiddle.GetOperationName(ctx)\n\tretryMetadata, _ := getRetryMetadata(ctx)\n\tattemptNum := retryMetadata.AttemptNum\n\tmaxAttempts := retryMetadata.MaxAttempts\n\n\t// Following attempts must ensure the request payload stream starts in a\n\t// rewound state.\n\tif attemptNum > 1 {\n\t\tif rewindable, ok := in.Request.(interface{ RewindStream() error }); ok {\n\t\t\tif rewindErr := rewindable.RewindStream(); rewindErr != nil {\n\t\t\t\treturn out, attemptResult, nopRelease, fmt.Errorf(\n\t\t\t\t\t\"failed to rewind transport stream for retry, %w\", rewindErr)\n\t\t\t}\n\t\t}\n\n\t\tr.logf(logger, logging.Debug, \"retrying request %s/%s, attempt %d\",\n\t\t\tservice, operation, attemptNum)\n\t}\n\n\tvar metadata smithymiddle.Metadata\n\tout, metadata, err = next.HandleFinalize(ctx, in)\n\tattemptResult.ResponseMetadata = metadata\n\n\t//------------------------------\n\t// Bookkeeping\n\t//------------------------------\n\t// Release the retry token based on the state of the attempt's error (if any).\n\tif releaseError := releaseRetryToken(err); releaseError != nil && err != nil {\n\t\treturn out, attemptResult, nopRelease, fmt.Errorf(\n\t\t\t\"failed to release retry token after request error, %w\", err)\n\t}\n\t// Release the attempt token based on the state of the attempt's error (if any).\n\tif releaseError := releaseAttemptToken(err); releaseError != nil && err != nil {\n\t\treturn out, attemptResult, nopRelease, fmt.Errorf(\n\t\t\t\"failed to release initial token after request error, %w\", err)\n\t}\n\t// If there was no error making the attempt, nothing further to do. There\n\t// will be nothing to retry.\n\tif err == nil {\n\t\treturn out, attemptResult, nopRelease, err\n\t}\n\n\terr = wrapAsClockSkew(ctx, err)\n\n\t//------------------------------\n\t// Is Retryable and Should Retry\n\t//------------------------------\n\t// If the attempt failed with an unretryable error, nothing further to do\n\t// but return, and inform the caller about the terminal failure.\n\tretryable := r.retryer.IsErrorRetryable(err)\n\tif !retryable {\n\t\tr.logf(logger, logging.Debug, \"request failed with unretryable error %v\", err)\n\t\treturn out, attemptResult, nopRelease, err\n\t}\n\n\t// set retryable to true\n\tattemptResult.Retryable = true\n\n\t// Once the maximum number of attempts have been exhausted there is nothing\n\t// further to do other than inform the caller about the terminal failure.\n\tif maxAttempts > 0 && attemptNum >= maxAttempts {\n\t\tr.logf(logger, logging.Debug, \"max retry attempts exhausted, max %d\", maxAttempts)\n\t\terr = &MaxAttemptsError{\n\t\t\tAttempt: attemptNum,\n\t\t\tErr:     err,\n\t\t}\n\t\treturn out, attemptResult, nopRelease, err\n\t}\n\n\t//------------------------------\n\t// Get Retry (aka Retry Quota) Token\n\t//------------------------------\n\t// Get a retry token that will be released after the\n\treleaseRetryToken, retryTokenErr := r.retryer.GetRetryToken(ctx, err)\n\tif retryTokenErr != nil {\n\t\treturn out, attemptResult, nopRelease, retryTokenErr\n\t}\n\n\t//------------------------------\n\t// Retry Delay and Sleep\n\t//------------------------------\n\t// Get the retry delay before another attempt can be made, and sleep for\n\t// that time. Potentially early exist if the sleep is canceled via the\n\t// context.\n\tretryDelay, reqErr := r.retryer.RetryDelay(attemptNum, err)\n\tmctx := metrics.Context(ctx)\n\tif mctx != nil {\n\t\tattempt, err := mctx.Data().LatestAttempt()\n\t\tif err != nil {\n\t\t\tattempt.RetryDelay = retryDelay\n\t\t}\n\t}\n\tif reqErr != nil {\n\t\treturn out, attemptResult, releaseRetryToken, reqErr\n\t}\n\tif reqErr = sdk.SleepWithContext(ctx, retryDelay); reqErr != nil {\n\t\terr = &aws.RequestCanceledError{Err: reqErr}\n\t\treturn out, attemptResult, releaseRetryToken, err\n\t}\n\n\t// The request should be re-attempted.\n\tattemptResult.Retried = true\n\n\treturn out, attemptResult, releaseRetryToken, err\n}\n\n// errors that, if detected when we know there's a clock skew,\n// can be retried and have a high chance of success\nvar possibleSkewCodes = map[string]struct{}{\n\t\"InvalidSignatureException\": {},\n\t\"SignatureDoesNotMatch\":     {},\n\t\"AuthFailure\":               {},\n}\n\nvar definiteSkewCodes = map[string]struct{}{\n\t\"RequestExpired\":       {},\n\t\"RequestInTheFuture\":   {},\n\t\"RequestTimeTooSkewed\": {},\n}\n\n// wrapAsClockSkew checks if this error could be related to a clock skew\n// error and if so, wrap the error.\nfunc wrapAsClockSkew(ctx context.Context, err error) error {\n\tvar v interface{ ErrorCode() string }\n\tif !errors.As(err, &v) {\n\t\treturn err\n\t}\n\tif _, ok := definiteSkewCodes[v.ErrorCode()]; ok {\n\t\treturn &retryableClockSkewError{Err: err}\n\t}\n\t_, isPossibleSkewCode := possibleSkewCodes[v.ErrorCode()]\n\tif skew := internalcontext.GetAttemptSkewContext(ctx); skew > skewThreshold && isPossibleSkewCode {\n\t\treturn &retryableClockSkewError{Err: err}\n\t}\n\treturn err\n}\n\n// MetricsHeader attaches SDK request metric header for retries to the transport\ntype MetricsHeader struct{}\n\n// ID returns the middleware identifier\nfunc (r *MetricsHeader) ID() string {\n\treturn \"RetryMetricsHeader\"\n}\n\n// HandleFinalize attaches the SDK request metric header to the transport layer\nfunc (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) (\n\tout smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error,\n) {\n\tretryMetadata, _ := getRetryMetadata(ctx)\n\n\tconst retryMetricHeader = \"Amz-Sdk-Request\"\n\tvar parts []string\n\n\tparts = append(parts, \"attempt=\"+strconv.Itoa(retryMetadata.AttemptNum))\n\tif retryMetadata.MaxAttempts != 0 {\n\t\tparts = append(parts, \"max=\"+strconv.Itoa(retryMetadata.MaxAttempts))\n\t}\n\n\tvar ttl time.Time\n\tif deadline, ok := ctx.Deadline(); ok {\n\t\tttl = deadline\n\t}\n\n\t// Only append the TTL if it can be determined.\n\tif !ttl.IsZero() && retryMetadata.AttemptClockSkew > 0 {\n\t\tconst unixTimeFormat = \"20060102T150405Z\"\n\t\tttl = ttl.Add(retryMetadata.AttemptClockSkew)\n\t\tparts = append(parts, \"ttl=\"+ttl.Format(unixTimeFormat))\n\t}\n\n\tswitch req := in.Request.(type) {\n\tcase *http.Request:\n\t\treq.Header[retryMetricHeader] = append(req.Header[retryMetricHeader][:0], strings.Join(parts, \"; \"))\n\tdefault:\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", req)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype retryMetadataKey struct{}\n\n// getRetryMetadata retrieves retryMetadata from the context and a bool\n// indicating if it was set.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc getRetryMetadata(ctx context.Context) (metadata retryMetadata, ok bool) {\n\tmetadata, ok = smithymiddle.GetStackValue(ctx, retryMetadataKey{}).(retryMetadata)\n\treturn metadata, ok\n}\n\n// setRetryMetadata sets the retryMetadata on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc setRetryMetadata(ctx context.Context, metadata retryMetadata) context.Context {\n\treturn smithymiddle.WithStackValue(ctx, retryMetadataKey{}, metadata)\n}\n\n// AddRetryMiddlewaresOptions is the set of options that can be passed to\n// AddRetryMiddlewares for configuring retry associated middleware.\ntype AddRetryMiddlewaresOptions struct {\n\tRetryer aws.Retryer\n\n\t// Enable the logging of retry attempts performed by the SDK. This will\n\t// include logging retry attempts, unretryable errors, and when max\n\t// attempts are reached.\n\tLogRetryAttempts bool\n}\n\n// AddRetryMiddlewares adds retry middleware to operation middleware stack\nfunc AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresOptions) error {\n\tattempt := NewAttemptMiddleware(options.Retryer, http.RequestCloner, func(middleware *Attempt) {\n\t\tmiddleware.LogAttempts = options.LogRetryAttempts\n\t})\n\n\t// index retry to before signing, if signing exists\n\tif err := stack.Finalize.Insert(attempt, \"Signing\", smithymiddle.Before); err != nil {\n\t\treturn err\n\t}\n\n\tif err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go",
    "content": "package retry\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// AddWithErrorCodes returns a Retryer with additional error codes considered\n// for determining if the error should be retried.\nfunc AddWithErrorCodes(r aws.Retryer, codes ...string) aws.Retryer {\n\tretryable := &RetryableErrorCode{\n\t\tCodes: map[string]struct{}{},\n\t}\n\tfor _, c := range codes {\n\t\tretryable.Codes[c] = struct{}{}\n\t}\n\n\treturn &withIsErrorRetryable{\n\t\tRetryerV2: wrapAsRetryerV2(r),\n\t\tRetryable: retryable,\n\t}\n}\n\ntype withIsErrorRetryable struct {\n\taws.RetryerV2\n\tRetryable IsErrorRetryable\n}\n\nfunc (r *withIsErrorRetryable) IsErrorRetryable(err error) bool {\n\tif v := r.Retryable.IsErrorRetryable(err); v != aws.UnknownTernary {\n\t\treturn v.Bool()\n\t}\n\treturn r.RetryerV2.IsErrorRetryable(err)\n}\n\n// AddWithMaxAttempts returns a Retryer with MaxAttempts set to the value\n// specified.\nfunc AddWithMaxAttempts(r aws.Retryer, max int) aws.Retryer {\n\treturn &withMaxAttempts{\n\t\tRetryerV2: wrapAsRetryerV2(r),\n\t\tMax:       max,\n\t}\n}\n\ntype withMaxAttempts struct {\n\taws.RetryerV2\n\tMax int\n}\n\nfunc (w *withMaxAttempts) MaxAttempts() int {\n\treturn w.Max\n}\n\n// AddWithMaxBackoffDelay returns a retryer wrapping the passed in retryer\n// overriding the RetryDelay behavior for a alternate minimum initial backoff\n// delay.\nfunc AddWithMaxBackoffDelay(r aws.Retryer, delay time.Duration) aws.Retryer {\n\treturn &withMaxBackoffDelay{\n\t\tRetryerV2: wrapAsRetryerV2(r),\n\t\tbackoff:   NewExponentialJitterBackoff(delay),\n\t}\n}\n\ntype withMaxBackoffDelay struct {\n\taws.RetryerV2\n\tbackoff *ExponentialJitterBackoff\n}\n\nfunc (r *withMaxBackoffDelay) RetryDelay(attempt int, err error) (time.Duration, error) {\n\treturn r.backoff.BackoffDelay(attempt, err)\n}\n\ntype wrappedAsRetryerV2 struct {\n\taws.Retryer\n}\n\nfunc wrapAsRetryerV2(r aws.Retryer) aws.RetryerV2 {\n\tv, ok := r.(aws.RetryerV2)\n\tif !ok {\n\t\tv = wrappedAsRetryerV2{Retryer: r}\n\t}\n\n\treturn v\n}\n\nfunc (w wrappedAsRetryerV2) GetAttemptToken(context.Context) (func(error) error, error) {\n\treturn w.Retryer.GetInitialToken(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go",
    "content": "package retry\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// IsErrorRetryable provides the interface of an implementation to determine if\n// a error as the result of an operation is retryable.\ntype IsErrorRetryable interface {\n\tIsErrorRetryable(error) aws.Ternary\n}\n\n// IsErrorRetryables is a collection of checks to determine of the error is\n// retryable.  Iterates through the checks and returns the state of retryable\n// if any check returns something other than unknown.\ntype IsErrorRetryables []IsErrorRetryable\n\n// IsErrorRetryable returns if the error is retryable if any of the checks in\n// the list return a value other than unknown.\nfunc (r IsErrorRetryables) IsErrorRetryable(err error) aws.Ternary {\n\tfor _, re := range r {\n\t\tif v := re.IsErrorRetryable(err); v != aws.UnknownTernary {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn aws.UnknownTernary\n}\n\n// IsErrorRetryableFunc wraps a function with the IsErrorRetryable interface.\ntype IsErrorRetryableFunc func(error) aws.Ternary\n\n// IsErrorRetryable returns if the error is retryable.\nfunc (fn IsErrorRetryableFunc) IsErrorRetryable(err error) aws.Ternary {\n\treturn fn(err)\n}\n\n// RetryableError is an IsErrorRetryable implementation which uses the\n// optional interface Retryable on the error value to determine if the error is\n// retryable.\ntype RetryableError struct{}\n\n// IsErrorRetryable returns if the error is retryable if it satisfies the\n// Retryable interface, and returns if the attempt should be retried.\nfunc (RetryableError) IsErrorRetryable(err error) aws.Ternary {\n\tvar v interface{ RetryableError() bool }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.BoolTernary(v.RetryableError())\n}\n\n// NoRetryCanceledError detects if the error was an request canceled error and\n// returns if so.\ntype NoRetryCanceledError struct{}\n\n// IsErrorRetryable returns the error is not retryable if the request was\n// canceled.\nfunc (NoRetryCanceledError) IsErrorRetryable(err error) aws.Ternary {\n\tvar v interface{ CanceledError() bool }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\tif v.CanceledError() {\n\t\treturn aws.FalseTernary\n\t}\n\treturn aws.UnknownTernary\n}\n\n// RetryableConnectionError determines if the underlying error is an HTTP\n// connection and returns if it should be retried.\n//\n// Includes errors such as connection reset, connection refused, net dial,\n// temporary, and timeout errors.\ntype RetryableConnectionError struct{}\n\n// IsErrorRetryable returns if the error is caused by and HTTP connection\n// error, and should be retried.\nfunc (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary {\n\tif err == nil {\n\t\treturn aws.UnknownTernary\n\t}\n\tvar retryable bool\n\n\tvar conErr interface{ ConnectionError() bool }\n\tvar tempErr interface{ Temporary() bool }\n\tvar timeoutErr interface{ Timeout() bool }\n\tvar urlErr *url.Error\n\tvar netOpErr *net.OpError\n\tvar dnsError *net.DNSError\n\n\tif errors.As(err, &dnsError) {\n\t\t// NXDOMAIN errors should not be retried\n\t\tif dnsError.IsNotFound {\n\t\t\treturn aws.BoolTernary(false)\n\t\t}\n\n\t\t// if !dnsError.Temporary(), error may or may not be temporary,\n\t\t// (i.e. !Temporary() =/=> !retryable) so we should fall through to\n\t\t// remaining checks\n\t\tif dnsError.Temporary() {\n\t\t\treturn aws.BoolTernary(true)\n\t\t}\n\t}\n\n\tswitch {\n\tcase errors.As(err, &conErr) && conErr.ConnectionError():\n\t\tretryable = true\n\n\tcase strings.Contains(err.Error(), \"connection reset\"):\n\t\tretryable = true\n\n\tcase errors.As(err, &urlErr):\n\t\t// Refused connections should be retried as the service may not yet be\n\t\t// running on the port. Go TCP dial considers refused connections as\n\t\t// not temporary.\n\t\tif strings.Contains(urlErr.Error(), \"connection refused\") {\n\t\t\tretryable = true\n\t\t} else {\n\t\t\treturn r.IsErrorRetryable(errors.Unwrap(urlErr))\n\t\t}\n\n\tcase errors.As(err, &netOpErr):\n\t\t// Network dial, or temporary network errors are always retryable.\n\t\tif strings.EqualFold(netOpErr.Op, \"dial\") || netOpErr.Temporary() {\n\t\t\tretryable = true\n\t\t} else {\n\t\t\treturn r.IsErrorRetryable(errors.Unwrap(netOpErr))\n\t\t}\n\n\tcase errors.As(err, &tempErr) && tempErr.Temporary():\n\t\t// Fallback to the generic temporary check, with temporary errors\n\t\t// retryable.\n\t\tretryable = true\n\n\tcase errors.As(err, &timeoutErr) && timeoutErr.Timeout():\n\t\t// Fallback to the generic timeout check, with timeout errors\n\t\t// retryable.\n\t\tretryable = true\n\n\tdefault:\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.BoolTernary(retryable)\n\n}\n\n// RetryableHTTPStatusCode provides a IsErrorRetryable based on HTTP status\n// codes.\ntype RetryableHTTPStatusCode struct {\n\tCodes map[int]struct{}\n}\n\n// IsErrorRetryable return if the passed in error is retryable based on the\n// HTTP status code.\nfunc (r RetryableHTTPStatusCode) IsErrorRetryable(err error) aws.Ternary {\n\tvar v interface{ HTTPStatusCode() int }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\t_, ok := r.Codes[v.HTTPStatusCode()]\n\tif !ok {\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.TrueTernary\n}\n\n// RetryableErrorCode determines if an attempt should be retried based on the\n// API error code.\ntype RetryableErrorCode struct {\n\tCodes map[string]struct{}\n}\n\n// IsErrorRetryable return if the error is retryable based on the error codes.\n// Returns unknown if the error doesn't have a code or it is unknown.\nfunc (r RetryableErrorCode) IsErrorRetryable(err error) aws.Ternary {\n\tvar v interface{ ErrorCode() string }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\t_, ok := r.Codes[v.ErrorCode()]\n\tif !ok {\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.TrueTernary\n}\n\n// retryableClockSkewError marks errors that can be caused by clock skew\n// (difference between server time and client time).\n// This is returned when there's certain confidence that adjusting the client time\n// could allow a retry to succeed\ntype retryableClockSkewError struct{ Err error }\n\nfunc (e *retryableClockSkewError) Error() string {\n\treturn fmt.Sprintf(\"Probable clock skew error: %v\", e.Err)\n}\n\n// Unwrap returns the wrapped error.\nfunc (e *retryableClockSkewError) Unwrap() error {\n\treturn e.Err\n}\n\n// RetryableError allows the retryer to retry this request\nfunc (e *retryableClockSkewError) RetryableError() bool {\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go",
    "content": "package retry\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws/ratelimit\"\n)\n\n// BackoffDelayer provides the interface for determining the delay to before\n// another request attempt, that previously failed.\ntype BackoffDelayer interface {\n\tBackoffDelay(attempt int, err error) (time.Duration, error)\n}\n\n// BackoffDelayerFunc provides a wrapper around a function to determine the\n// backoff delay of an attempt retry.\ntype BackoffDelayerFunc func(int, error) (time.Duration, error)\n\n// BackoffDelay returns the delay before attempt to retry a request.\nfunc (fn BackoffDelayerFunc) BackoffDelay(attempt int, err error) (time.Duration, error) {\n\treturn fn(attempt, err)\n}\n\nconst (\n\t// DefaultMaxAttempts is the maximum of attempts for an API request\n\tDefaultMaxAttempts int = 3\n\n\t// DefaultMaxBackoff is the maximum back off delay between attempts\n\tDefaultMaxBackoff time.Duration = 20 * time.Second\n)\n\n// Default retry token quota values.\nconst (\n\tDefaultRetryRateTokens  uint = 500\n\tDefaultRetryCost        uint = 5\n\tDefaultRetryTimeoutCost uint = 10\n\tDefaultNoRetryIncrement uint = 1\n)\n\n// DefaultRetryableHTTPStatusCodes is the default set of HTTP status codes the SDK\n// should consider as retryable errors.\nvar DefaultRetryableHTTPStatusCodes = map[int]struct{}{\n\t500: {},\n\t502: {},\n\t503: {},\n\t504: {},\n}\n\n// DefaultRetryableErrorCodes provides the set of API error codes that should\n// be retried.\nvar DefaultRetryableErrorCodes = map[string]struct{}{\n\t\"RequestTimeout\":          {},\n\t\"RequestTimeoutException\": {},\n}\n\n// DefaultThrottleErrorCodes provides the set of API error codes that are\n// considered throttle errors.\nvar DefaultThrottleErrorCodes = map[string]struct{}{\n\t\"Throttling\":                             {},\n\t\"ThrottlingException\":                    {},\n\t\"ThrottledException\":                     {},\n\t\"RequestThrottledException\":              {},\n\t\"TooManyRequestsException\":               {},\n\t\"ProvisionedThroughputExceededException\": {},\n\t\"TransactionInProgressException\":         {},\n\t\"RequestLimitExceeded\":                   {},\n\t\"BandwidthLimitExceeded\":                 {},\n\t\"LimitExceededException\":                 {},\n\t\"RequestThrottled\":                       {},\n\t\"SlowDown\":                               {},\n\t\"PriorRequestNotComplete\":                {},\n\t\"EC2ThrottledException\":                  {},\n}\n\n// DefaultRetryables provides the set of retryable checks that are used by\n// default.\nvar DefaultRetryables = []IsErrorRetryable{\n\tNoRetryCanceledError{},\n\tRetryableError{},\n\tRetryableConnectionError{},\n\tRetryableHTTPStatusCode{\n\t\tCodes: DefaultRetryableHTTPStatusCodes,\n\t},\n\tRetryableErrorCode{\n\t\tCodes: DefaultRetryableErrorCodes,\n\t},\n\tRetryableErrorCode{\n\t\tCodes: DefaultThrottleErrorCodes,\n\t},\n}\n\n// DefaultTimeouts provides the set of timeout checks that are used by default.\nvar DefaultTimeouts = []IsErrorTimeout{\n\tTimeouterError{},\n}\n\n// StandardOptions provides the functional options for configuring the standard\n// retryable, and delay behavior.\ntype StandardOptions struct {\n\t// Maximum number of attempts that should be made.\n\tMaxAttempts int\n\n\t// MaxBackoff duration between retried attempts.\n\tMaxBackoff time.Duration\n\n\t// Provides the backoff strategy the retryer will use to determine the\n\t// delay between retry attempts.\n\tBackoff BackoffDelayer\n\n\t// Set of strategies to determine if the attempt should be retried based on\n\t// the error response received.\n\t//\n\t// It is safe to append to this list in NewStandard's functional options.\n\tRetryables []IsErrorRetryable\n\n\t// Set of strategies to determine if the attempt failed due to a timeout\n\t// error.\n\t//\n\t// It is safe to append to this list in NewStandard's functional options.\n\tTimeouts []IsErrorTimeout\n\n\t// Provides the rate limiting strategy for rate limiting attempt retries\n\t// across all attempts the retryer is being used with.\n\t//\n\t// A RateLimiter operates as a token bucket with a set capacity, where\n\t// attempt failures events consume tokens. A retry attempt that attempts to\n\t// consume more tokens than what's available results in operation failure.\n\t// The default implementation is parameterized as follows:\n\t//   - a capacity of 500 (DefaultRetryRateTokens)\n\t//   - a retry caused by a timeout costs 10 tokens (DefaultRetryCost)\n\t//   - a retry caused by other errors costs 5 tokens (DefaultRetryTimeoutCost)\n\t//   - an operation that succeeds on the 1st attempt adds 1 token (DefaultNoRetryIncrement)\n\t//\n\t// You can disable rate limiting by setting this field to ratelimit.None.\n\tRateLimiter RateLimiter\n\n\t// The cost to deduct from the RateLimiter's token bucket per retry.\n\tRetryCost uint\n\n\t// The cost to deduct from the RateLimiter's token bucket per retry caused\n\t// by timeout error.\n\tRetryTimeoutCost uint\n\n\t// The cost to payback to the RateLimiter's token bucket for successful\n\t// attempts.\n\tNoRetryIncrement uint\n}\n\n// RateLimiter provides the interface for limiting the rate of attempt retries\n// allowed by the retryer.\ntype RateLimiter interface {\n\tGetToken(ctx context.Context, cost uint) (releaseToken func() error, err error)\n\tAddTokens(uint) error\n}\n\n// Standard is the standard retry pattern for the SDK. It uses a set of\n// retryable checks to determine of the failed attempt should be retried, and\n// what retry delay should be used.\ntype Standard struct {\n\toptions StandardOptions\n\n\ttimeout   IsErrorTimeout\n\tretryable IsErrorRetryable\n\tbackoff   BackoffDelayer\n}\n\n// NewStandard initializes a standard retry behavior with defaults that can be\n// overridden via functional options.\nfunc NewStandard(fnOpts ...func(*StandardOptions)) *Standard {\n\to := StandardOptions{\n\t\tMaxAttempts: DefaultMaxAttempts,\n\t\tMaxBackoff:  DefaultMaxBackoff,\n\t\tRetryables:  append([]IsErrorRetryable{}, DefaultRetryables...),\n\t\tTimeouts:    append([]IsErrorTimeout{}, DefaultTimeouts...),\n\n\t\tRateLimiter:      ratelimit.NewTokenRateLimit(DefaultRetryRateTokens),\n\t\tRetryCost:        DefaultRetryCost,\n\t\tRetryTimeoutCost: DefaultRetryTimeoutCost,\n\t\tNoRetryIncrement: DefaultNoRetryIncrement,\n\t}\n\tfor _, fn := range fnOpts {\n\t\tfn(&o)\n\t}\n\tif o.MaxAttempts <= 0 {\n\t\to.MaxAttempts = DefaultMaxAttempts\n\t}\n\n\tbackoff := o.Backoff\n\tif backoff == nil {\n\t\tbackoff = NewExponentialJitterBackoff(o.MaxBackoff)\n\t}\n\n\treturn &Standard{\n\t\toptions:   o,\n\t\tbackoff:   backoff,\n\t\tretryable: IsErrorRetryables(o.Retryables),\n\t\ttimeout:   IsErrorTimeouts(o.Timeouts),\n\t}\n}\n\n// MaxAttempts returns the maximum number of attempts that can be made for a\n// request before failing.\nfunc (s *Standard) MaxAttempts() int {\n\treturn s.options.MaxAttempts\n}\n\n// IsErrorRetryable returns if the error is can be retried or not. Should not\n// consider the number of attempts made.\nfunc (s *Standard) IsErrorRetryable(err error) bool {\n\treturn s.retryable.IsErrorRetryable(err).Bool()\n}\n\n// RetryDelay returns the delay to use before another request attempt is made.\nfunc (s *Standard) RetryDelay(attempt int, err error) (time.Duration, error) {\n\treturn s.backoff.BackoffDelay(attempt, err)\n}\n\n// GetAttemptToken returns the token to be released after then attempt completes.\n// The release token will add NoRetryIncrement to the RateLimiter token pool if\n// the attempt was successful. If the attempt failed, nothing will be done.\nfunc (s *Standard) GetAttemptToken(context.Context) (func(error) error, error) {\n\treturn s.GetInitialToken(), nil\n}\n\n// GetInitialToken returns a token for adding the NoRetryIncrement to the\n// RateLimiter token if the attempt completed successfully without error.\n//\n// InitialToken applies to result of the each attempt, including the first.\n// Whereas the RetryToken applies to the result of subsequent attempts.\n//\n// Deprecated: use GetAttemptToken instead.\nfunc (s *Standard) GetInitialToken() func(error) error {\n\treturn releaseToken(s.noRetryIncrement).release\n}\n\nfunc (s *Standard) noRetryIncrement() error {\n\treturn s.options.RateLimiter.AddTokens(s.options.NoRetryIncrement)\n}\n\n// GetRetryToken attempts to deduct the retry cost from the retry token pool.\n// Returning the token release function, or error.\nfunc (s *Standard) GetRetryToken(ctx context.Context, opErr error) (func(error) error, error) {\n\tcost := s.options.RetryCost\n\n\tif s.timeout.IsErrorTimeout(opErr).Bool() {\n\t\tcost = s.options.RetryTimeoutCost\n\t}\n\n\tfn, err := s.options.RateLimiter.GetToken(ctx, cost)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get rate limit token, %w\", err)\n\t}\n\n\treturn releaseToken(fn).release, nil\n}\n\nfunc nopRelease(error) error { return nil }\n\ntype releaseToken func() error\n\nfunc (f releaseToken) release(err error) error {\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn f()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go",
    "content": "package retry\n\nimport (\n\t\"errors\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// IsErrorThrottle provides the interface of an implementation to determine if\n// a error response from an operation is a throttling error.\ntype IsErrorThrottle interface {\n\tIsErrorThrottle(error) aws.Ternary\n}\n\n// IsErrorThrottles is a collection of checks to determine of the error a\n// throttle error. Iterates through the checks and returns the state of\n// throttle if any check returns something other than unknown.\ntype IsErrorThrottles []IsErrorThrottle\n\n// IsErrorThrottle returns if the error is a throttle error if any of the\n// checks in the list return a value other than unknown.\nfunc (r IsErrorThrottles) IsErrorThrottle(err error) aws.Ternary {\n\tfor _, re := range r {\n\t\tif v := re.IsErrorThrottle(err); v != aws.UnknownTernary {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn aws.UnknownTernary\n}\n\n// IsErrorThrottleFunc wraps a function with the IsErrorThrottle interface.\ntype IsErrorThrottleFunc func(error) aws.Ternary\n\n// IsErrorThrottle returns if the error is a throttle error.\nfunc (fn IsErrorThrottleFunc) IsErrorThrottle(err error) aws.Ternary {\n\treturn fn(err)\n}\n\n// ThrottleErrorCode determines if an attempt should be retried based on the\n// API error code.\ntype ThrottleErrorCode struct {\n\tCodes map[string]struct{}\n}\n\n// IsErrorThrottle return if the error is a throttle error based on the error\n// codes. Returns unknown if the error doesn't have a code or it is unknown.\nfunc (r ThrottleErrorCode) IsErrorThrottle(err error) aws.Ternary {\n\tvar v interface{ ErrorCode() string }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\t_, ok := r.Codes[v.ErrorCode()]\n\tif !ok {\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.TrueTernary\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.go",
    "content": "package retry\n\nimport (\n\t\"errors\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// IsErrorTimeout provides the interface of an implementation to determine if\n// a error matches.\ntype IsErrorTimeout interface {\n\tIsErrorTimeout(err error) aws.Ternary\n}\n\n// IsErrorTimeouts is a collection of checks to determine of the error is\n// retryable. Iterates through the checks and returns the state of retryable\n// if any check returns something other than unknown.\ntype IsErrorTimeouts []IsErrorTimeout\n\n// IsErrorTimeout returns if the error is retryable if any of the checks in\n// the list return a value other than unknown.\nfunc (ts IsErrorTimeouts) IsErrorTimeout(err error) aws.Ternary {\n\tfor _, t := range ts {\n\t\tif v := t.IsErrorTimeout(err); v != aws.UnknownTernary {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn aws.UnknownTernary\n}\n\n// IsErrorTimeoutFunc wraps a function with the IsErrorTimeout interface.\ntype IsErrorTimeoutFunc func(error) aws.Ternary\n\n// IsErrorTimeout returns if the error is retryable.\nfunc (fn IsErrorTimeoutFunc) IsErrorTimeout(err error) aws.Ternary {\n\treturn fn(err)\n}\n\n// TimeouterError provides the IsErrorTimeout implementation for determining if\n// an error is a timeout based on type with the Timeout method.\ntype TimeouterError struct{}\n\n// IsErrorTimeout returns if the error is a timeout error.\nfunc (t TimeouterError) IsErrorTimeout(err error) aws.Ternary {\n\tvar v interface{ Timeout() bool }\n\n\tif !errors.As(err, &v) {\n\t\treturn aws.UnknownTernary\n\t}\n\n\treturn aws.BoolTernary(v.Timeout())\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go",
    "content": "package aws\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// RetryMode provides the mode the API client will use to create a retryer\n// based on.\ntype RetryMode string\n\nconst (\n\t// RetryModeStandard model provides rate limited retry attempts with\n\t// exponential backoff delay.\n\tRetryModeStandard RetryMode = \"standard\"\n\n\t// RetryModeAdaptive model provides attempt send rate limiting on throttle\n\t// responses in addition to standard mode's retry rate limiting.\n\t//\n\t// Adaptive retry mode is experimental and is subject to change in the\n\t// future.\n\tRetryModeAdaptive RetryMode = \"adaptive\"\n)\n\n// ParseRetryMode attempts to parse a RetryMode from the given string.\n// Returning error if the value is not a known RetryMode.\nfunc ParseRetryMode(v string) (mode RetryMode, err error) {\n\tswitch v {\n\tcase \"standard\":\n\t\treturn RetryModeStandard, nil\n\tcase \"adaptive\":\n\t\treturn RetryModeAdaptive, nil\n\tdefault:\n\t\treturn mode, fmt.Errorf(\"unknown RetryMode, %v\", v)\n\t}\n}\n\nfunc (m RetryMode) String() string { return string(m) }\n\n// Retryer is an interface to determine if a given error from a\n// attempt should be retried, and if so what backoff delay to apply. The\n// default implementation used by most services is the retry package's Standard\n// type. Which contains basic retry logic using exponential backoff.\ntype Retryer interface {\n\t// IsErrorRetryable returns if the failed attempt is retryable. This check\n\t// should determine if the error can be retried, or if the error is\n\t// terminal.\n\tIsErrorRetryable(error) bool\n\n\t// MaxAttempts returns the maximum number of attempts that can be made for\n\t// an attempt before failing. A value of 0 implies that the attempt should\n\t// be retried until it succeeds if the errors are retryable.\n\tMaxAttempts() int\n\n\t// RetryDelay returns the delay that should be used before retrying the\n\t// attempt. Will return error if the delay could not be determined.\n\tRetryDelay(attempt int, opErr error) (time.Duration, error)\n\n\t// GetRetryToken attempts to deduct the retry cost from the retry token pool.\n\t// Returning the token release function, or error.\n\tGetRetryToken(ctx context.Context, opErr error) (releaseToken func(error) error, err error)\n\n\t// GetInitialToken returns the initial attempt token that can increment the\n\t// retry token pool if the attempt is successful.\n\tGetInitialToken() (releaseToken func(error) error)\n}\n\n// RetryerV2 is an interface to determine if a given error from an attempt\n// should be retried, and if so what backoff delay to apply. The default\n// implementation used by most services is the retry package's Standard type.\n// Which contains basic retry logic using exponential backoff.\n//\n// RetryerV2 replaces the Retryer interface, deprecating the GetInitialToken\n// method in favor of GetAttemptToken which takes a context, and can return an error.\n//\n// The SDK's retry package's Attempt middleware, and utilities will always\n// wrap a Retryer as a RetryerV2. Delegating to GetInitialToken, only if\n// GetAttemptToken is not implemented.\ntype RetryerV2 interface {\n\tRetryer\n\n\t// GetInitialToken returns the initial attempt token that can increment the\n\t// retry token pool if the attempt is successful.\n\t//\n\t// Deprecated: This method does not provide a way to block using Context,\n\t// nor can it return an error. Use RetryerV2, and GetAttemptToken instead.\n\tGetInitialToken() (releaseToken func(error) error)\n\n\t// GetAttemptToken returns the send token that can be used to rate limit\n\t// attempt calls. Will be used by the SDK's retry package's Attempt\n\t// middleware to get a send token prior to calling the temp and releasing\n\t// the send token after the attempt has been made.\n\tGetAttemptToken(context.Context) (func(error) error, error)\n}\n\n// NopRetryer provides a RequestRetryDecider implementation that will flag\n// all attempt errors as not retryable, with a max attempts of 1.\ntype NopRetryer struct{}\n\n// IsErrorRetryable returns false for all error values.\nfunc (NopRetryer) IsErrorRetryable(error) bool { return false }\n\n// MaxAttempts always returns 1 for the original attempt.\nfunc (NopRetryer) MaxAttempts() int { return 1 }\n\n// RetryDelay is not valid for the NopRetryer. Will always return error.\nfunc (NopRetryer) RetryDelay(int, error) (time.Duration, error) {\n\treturn 0, fmt.Errorf(\"not retrying any attempt errors\")\n}\n\n// GetRetryToken returns a stub function that does nothing.\nfunc (NopRetryer) GetRetryToken(context.Context, error) (func(error) error, error) {\n\treturn nopReleaseToken, nil\n}\n\n// GetInitialToken returns a stub function that does nothing.\nfunc (NopRetryer) GetInitialToken() func(error) error {\n\treturn nopReleaseToken\n}\n\n// GetAttemptToken returns a stub function that does nothing.\nfunc (NopRetryer) GetAttemptToken(context.Context) (func(error) error, error) {\n\treturn nopReleaseToken, nil\n}\n\nfunc nopReleaseToken(error) error { return nil }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go",
    "content": "package aws\n\n// ExecutionEnvironmentID is the AWS execution environment runtime identifier.\ntype ExecutionEnvironmentID string\n\n// RuntimeEnvironment is a collection of values that are determined at runtime\n// based on the environment that the SDK is executing in. Some of these values\n// may or may not be present based on the executing environment and certain SDK\n// configuration properties that drive whether these values are populated..\ntype RuntimeEnvironment struct {\n\tEnvironmentIdentifier     ExecutionEnvironmentID\n\tRegion                    string\n\tEC2InstanceMetadataRegion string\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.go",
    "content": "package v4\n\nimport (\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\nfunc lookupKey(service, region string) string {\n\tvar s strings.Builder\n\ts.Grow(len(region) + len(service) + 3)\n\ts.WriteString(region)\n\ts.WriteRune('/')\n\ts.WriteString(service)\n\treturn s.String()\n}\n\ntype derivedKey struct {\n\tAccessKey  string\n\tDate       time.Time\n\tCredential []byte\n}\n\ntype derivedKeyCache struct {\n\tvalues map[string]derivedKey\n\tmutex  sync.RWMutex\n}\n\nfunc newDerivedKeyCache() derivedKeyCache {\n\treturn derivedKeyCache{\n\t\tvalues: make(map[string]derivedKey),\n\t}\n}\n\nfunc (s *derivedKeyCache) Get(credentials aws.Credentials, service, region string, signingTime SigningTime) []byte {\n\tkey := lookupKey(service, region)\n\ts.mutex.RLock()\n\tif cred, ok := s.get(key, credentials, signingTime.Time); ok {\n\t\ts.mutex.RUnlock()\n\t\treturn cred\n\t}\n\ts.mutex.RUnlock()\n\n\ts.mutex.Lock()\n\tif cred, ok := s.get(key, credentials, signingTime.Time); ok {\n\t\ts.mutex.Unlock()\n\t\treturn cred\n\t}\n\tcred := deriveKey(credentials.SecretAccessKey, service, region, signingTime)\n\tentry := derivedKey{\n\t\tAccessKey:  credentials.AccessKeyID,\n\t\tDate:       signingTime.Time,\n\t\tCredential: cred,\n\t}\n\ts.values[key] = entry\n\ts.mutex.Unlock()\n\n\treturn cred\n}\n\nfunc (s *derivedKeyCache) get(key string, credentials aws.Credentials, signingTime time.Time) ([]byte, bool) {\n\tcacheEntry, ok := s.retrieveFromCache(key)\n\tif ok && cacheEntry.AccessKey == credentials.AccessKeyID && isSameDay(signingTime, cacheEntry.Date) {\n\t\treturn cacheEntry.Credential, true\n\t}\n\treturn nil, false\n}\n\nfunc (s *derivedKeyCache) retrieveFromCache(key string) (derivedKey, bool) {\n\tif v, ok := s.values[key]; ok {\n\t\treturn v, true\n\t}\n\treturn derivedKey{}, false\n}\n\n// SigningKeyDeriver derives a signing key from a set of credentials\ntype SigningKeyDeriver struct {\n\tcache derivedKeyCache\n}\n\n// NewSigningKeyDeriver returns a new SigningKeyDeriver\nfunc NewSigningKeyDeriver() *SigningKeyDeriver {\n\treturn &SigningKeyDeriver{\n\t\tcache: newDerivedKeyCache(),\n\t}\n}\n\n// DeriveKey returns a derived signing key from the given credentials to be used with SigV4 signing.\nfunc (k *SigningKeyDeriver) DeriveKey(credential aws.Credentials, service, region string, signingTime SigningTime) []byte {\n\treturn k.cache.Get(credential, service, region, signingTime)\n}\n\nfunc deriveKey(secret, service, region string, t SigningTime) []byte {\n\thmacDate := HMACSHA256([]byte(\"AWS4\"+secret), []byte(t.ShortTimeFormat()))\n\thmacRegion := HMACSHA256(hmacDate, []byte(region))\n\thmacService := HMACSHA256(hmacRegion, []byte(service))\n\treturn HMACSHA256(hmacService, []byte(\"aws4_request\"))\n}\n\nfunc isSameDay(x, y time.Time) bool {\n\txYear, xMonth, xDay := x.Date()\n\tyYear, yMonth, yDay := y.Date()\n\n\tif xYear != yYear {\n\t\treturn false\n\t}\n\n\tif xMonth != yMonth {\n\t\treturn false\n\t}\n\n\treturn xDay == yDay\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go",
    "content": "package v4\n\n// Signature Version 4 (SigV4) Constants\nconst (\n\t// EmptyStringSHA256 is the hex encoded sha256 value of an empty string\n\tEmptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`\n\n\t// UnsignedPayload indicates that the request payload body is unsigned\n\tUnsignedPayload = \"UNSIGNED-PAYLOAD\"\n\n\t// AmzAlgorithmKey indicates the signing algorithm\n\tAmzAlgorithmKey = \"X-Amz-Algorithm\"\n\n\t// AmzSecurityTokenKey indicates the security token to be used with temporary credentials\n\tAmzSecurityTokenKey = \"X-Amz-Security-Token\"\n\n\t// AmzDateKey is the UTC timestamp for the request in the format YYYYMMDD'T'HHMMSS'Z'\n\tAmzDateKey = \"X-Amz-Date\"\n\n\t// AmzCredentialKey is the access key ID and credential scope\n\tAmzCredentialKey = \"X-Amz-Credential\"\n\n\t// AmzSignedHeadersKey is the set of headers signed for the request\n\tAmzSignedHeadersKey = \"X-Amz-SignedHeaders\"\n\n\t// AmzSignatureKey is the query parameter to store the SigV4 signature\n\tAmzSignatureKey = \"X-Amz-Signature\"\n\n\t// TimeFormat is the time format to be used in the X-Amz-Date header or query parameter\n\tTimeFormat = \"20060102T150405Z\"\n\n\t// ShortTimeFormat is the shorten time format used in the credential scope\n\tShortTimeFormat = \"20060102\"\n\n\t// ContentSHAKey is the SHA256 of request body\n\tContentSHAKey = \"X-Amz-Content-Sha256\"\n\n\t// StreamingEventsPayload indicates that the request payload body is a signed event stream.\n\tStreamingEventsPayload = \"STREAMING-AWS4-HMAC-SHA256-EVENTS\"\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go",
    "content": "package v4\n\nimport (\n\tsdkstrings \"github.com/aws/aws-sdk-go-v2/internal/strings\"\n)\n\n// Rules houses a set of Rule needed for validation of a\n// string value\ntype Rules []Rule\n\n// Rule interface allows for more flexible rules and just simply\n// checks whether or not a value adheres to that Rule\ntype Rule interface {\n\tIsValid(value string) bool\n}\n\n// IsValid will iterate through all rules and see if any rules\n// apply to the value and supports nested rules\nfunc (r Rules) IsValid(value string) bool {\n\tfor _, rule := range r {\n\t\tif rule.IsValid(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// MapRule generic Rule for maps\ntype MapRule map[string]struct{}\n\n// IsValid for the map Rule satisfies whether it exists in the map\nfunc (m MapRule) IsValid(value string) bool {\n\t_, ok := m[value]\n\treturn ok\n}\n\n// AllowList is a generic Rule for include listing\ntype AllowList struct {\n\tRule\n}\n\n// IsValid for AllowList checks if the value is within the AllowList\nfunc (w AllowList) IsValid(value string) bool {\n\treturn w.Rule.IsValid(value)\n}\n\n// ExcludeList is a generic Rule for exclude listing\ntype ExcludeList struct {\n\tRule\n}\n\n// IsValid for AllowList checks if the value is within the AllowList\nfunc (b ExcludeList) IsValid(value string) bool {\n\treturn !b.Rule.IsValid(value)\n}\n\n// Patterns is a list of strings to match against\ntype Patterns []string\n\n// IsValid for Patterns checks each pattern and returns if a match has\n// been found\nfunc (p Patterns) IsValid(value string) bool {\n\tfor _, pattern := range p {\n\t\tif sdkstrings.HasPrefixFold(value, pattern) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// InclusiveRules rules allow for rules to depend on one another\ntype InclusiveRules []Rule\n\n// IsValid will return true if all rules are true\nfunc (r InclusiveRules) IsValid(value string) bool {\n\tfor _, rule := range r {\n\t\tif !rule.IsValid(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go",
    "content": "package v4\n\n// IgnoredHeaders is a list of headers that are ignored during signing\nvar IgnoredHeaders = Rules{\n\tExcludeList{\n\t\tMapRule{\n\t\t\t\"Authorization\":   struct{}{},\n\t\t\t\"User-Agent\":      struct{}{},\n\t\t\t\"X-Amzn-Trace-Id\": struct{}{},\n\t\t\t\"Expect\":          struct{}{},\n\t\t},\n\t},\n}\n\n// RequiredSignedHeaders is a allow list for Build canonical headers.\nvar RequiredSignedHeaders = Rules{\n\tAllowList{\n\t\tMapRule{\n\t\t\t\"Cache-Control\":                         struct{}{},\n\t\t\t\"Content-Disposition\":                   struct{}{},\n\t\t\t\"Content-Encoding\":                      struct{}{},\n\t\t\t\"Content-Language\":                      struct{}{},\n\t\t\t\"Content-Md5\":                           struct{}{},\n\t\t\t\"Content-Type\":                          struct{}{},\n\t\t\t\"Expires\":                               struct{}{},\n\t\t\t\"If-Match\":                              struct{}{},\n\t\t\t\"If-Modified-Since\":                     struct{}{},\n\t\t\t\"If-None-Match\":                         struct{}{},\n\t\t\t\"If-Unmodified-Since\":                   struct{}{},\n\t\t\t\"Range\":                                 struct{}{},\n\t\t\t\"X-Amz-Acl\":                             struct{}{},\n\t\t\t\"X-Amz-Copy-Source\":                     struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Match\":            struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Modified-Since\":   struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-None-Match\":       struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Unmodified-Since\": struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Range\":               struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm\": struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key\":       struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5\":   struct{}{},\n\t\t\t\"X-Amz-Grant-Full-control\":                                    struct{}{},\n\t\t\t\"X-Amz-Grant-Read\":                                            struct{}{},\n\t\t\t\"X-Amz-Grant-Read-Acp\":                                        struct{}{},\n\t\t\t\"X-Amz-Grant-Write\":                                           struct{}{},\n\t\t\t\"X-Amz-Grant-Write-Acp\":                                       struct{}{},\n\t\t\t\"X-Amz-Metadata-Directive\":                                    struct{}{},\n\t\t\t\"X-Amz-Mfa\":                                                   struct{}{},\n\t\t\t\"X-Amz-Request-Payer\":                                         struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption\":                                struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id\":                 struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Context\":                        struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Algorithm\":             struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Key\":                   struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Key-Md5\":               struct{}{},\n\t\t\t\"X-Amz-Storage-Class\":                                         struct{}{},\n\t\t\t\"X-Amz-Website-Redirect-Location\":                             struct{}{},\n\t\t\t\"X-Amz-Content-Sha256\":                                        struct{}{},\n\t\t\t\"X-Amz-Tagging\":                                               struct{}{},\n\t\t},\n\t},\n\tPatterns{\"X-Amz-Object-Lock-\"},\n\tPatterns{\"X-Amz-Meta-\"},\n}\n\n// AllowedQueryHoisting is a allowed list for Build query headers. The boolean value\n// represents whether or not it is a pattern.\nvar AllowedQueryHoisting = InclusiveRules{\n\tExcludeList{RequiredSignedHeaders},\n\tPatterns{\"X-Amz-\"},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.go",
    "content": "package v4\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n)\n\n// HMACSHA256 computes a HMAC-SHA256 of data given the provided key.\nfunc HMACSHA256(key []byte, data []byte) []byte {\n\thash := hmac.New(sha256.New, key)\n\thash.Write(data)\n\treturn hash.Sum(nil)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.go",
    "content": "package v4\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// SanitizeHostForHeader removes default port from host and updates request.Host\nfunc SanitizeHostForHeader(r *http.Request) {\n\thost := getHost(r)\n\tport := portOnly(host)\n\tif port != \"\" && isDefaultPort(r.URL.Scheme, port) {\n\t\tr.Host = stripPort(host)\n\t}\n}\n\n// Returns host from request\nfunc getHost(r *http.Request) string {\n\tif r.Host != \"\" {\n\t\treturn r.Host\n\t}\n\n\treturn r.URL.Host\n}\n\n// Hostname returns u.Host, without any port number.\n//\n// If Host is an IPv6 literal with a port number, Hostname returns the\n// IPv6 literal without the square brackets. IPv6 literals may include\n// a zone identifier.\n//\n// Copied from the Go 1.8 standard library (net/url)\nfunc stripPort(hostport string) string {\n\tcolon := strings.IndexByte(hostport, ':')\n\tif colon == -1 {\n\t\treturn hostport\n\t}\n\tif i := strings.IndexByte(hostport, ']'); i != -1 {\n\t\treturn strings.TrimPrefix(hostport[:i], \"[\")\n\t}\n\treturn hostport[:colon]\n}\n\n// Port returns the port part of u.Host, without the leading colon.\n// If u.Host doesn't contain a port, Port returns an empty string.\n//\n// Copied from the Go 1.8 standard library (net/url)\nfunc portOnly(hostport string) string {\n\tcolon := strings.IndexByte(hostport, ':')\n\tif colon == -1 {\n\t\treturn \"\"\n\t}\n\tif i := strings.Index(hostport, \"]:\"); i != -1 {\n\t\treturn hostport[i+len(\"]:\"):]\n\t}\n\tif strings.Contains(hostport, \"]\") {\n\t\treturn \"\"\n\t}\n\treturn hostport[colon+len(\":\"):]\n}\n\n// Returns true if the specified URI is using the standard port\n// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs)\nfunc isDefaultPort(scheme, port string) bool {\n\tif port == \"\" {\n\t\treturn true\n\t}\n\n\tlowerCaseScheme := strings.ToLower(scheme)\n\tif (lowerCaseScheme == \"http\" && port == \"80\") || (lowerCaseScheme == \"https\" && port == \"443\") {\n\t\treturn true\n\t}\n\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go",
    "content": "package v4\n\nimport \"strings\"\n\n// BuildCredentialScope builds the Signature Version 4 (SigV4) signing scope\nfunc BuildCredentialScope(signingTime SigningTime, region, service string) string {\n\treturn strings.Join([]string{\n\t\tsigningTime.ShortTimeFormat(),\n\t\tregion,\n\t\tservice,\n\t\t\"aws4_request\",\n\t}, \"/\")\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.go",
    "content": "package v4\n\nimport \"time\"\n\n// SigningTime provides a wrapper around a time.Time which provides cached values for SigV4 signing.\ntype SigningTime struct {\n\ttime.Time\n\ttimeFormat      string\n\tshortTimeFormat string\n}\n\n// NewSigningTime creates a new SigningTime given a time.Time\nfunc NewSigningTime(t time.Time) SigningTime {\n\treturn SigningTime{\n\t\tTime: t,\n\t}\n}\n\n// TimeFormat provides a time formatted in the X-Amz-Date format.\nfunc (m *SigningTime) TimeFormat() string {\n\treturn m.format(&m.timeFormat, TimeFormat)\n}\n\n// ShortTimeFormat provides a time formatted of 20060102.\nfunc (m *SigningTime) ShortTimeFormat() string {\n\treturn m.format(&m.shortTimeFormat, ShortTimeFormat)\n}\n\nfunc (m *SigningTime) format(target *string, format string) string {\n\tif len(*target) > 0 {\n\t\treturn *target\n\t}\n\tv := m.Time.Format(format)\n\t*target = v\n\treturn v\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go",
    "content": "package v4\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n)\n\nconst doubleSpace = \"  \"\n\n// StripExcessSpaces will rewrite the passed in slice's string values to not\n// contain multiple side-by-side spaces.\nfunc StripExcessSpaces(str string) string {\n\tvar j, k, l, m, spaces int\n\t// Trim trailing spaces\n\tfor j = len(str) - 1; j >= 0 && str[j] == ' '; j-- {\n\t}\n\n\t// Trim leading spaces\n\tfor k = 0; k < j && str[k] == ' '; k++ {\n\t}\n\tstr = str[k : j+1]\n\n\t// Strip multiple spaces.\n\tj = strings.Index(str, doubleSpace)\n\tif j < 0 {\n\t\treturn str\n\t}\n\n\tbuf := []byte(str)\n\tfor k, m, l = j, j, len(buf); k < l; k++ {\n\t\tif buf[k] == ' ' {\n\t\t\tif spaces == 0 {\n\t\t\t\t// First space.\n\t\t\t\tbuf[m] = buf[k]\n\t\t\t\tm++\n\t\t\t}\n\t\t\tspaces++\n\t\t} else {\n\t\t\t// End of multiple spaces.\n\t\t\tspaces = 0\n\t\t\tbuf[m] = buf[k]\n\t\t\tm++\n\t\t}\n\t}\n\n\treturn string(buf[:m])\n}\n\n// GetURIPath returns the escaped URI component from the provided URL.\nfunc GetURIPath(u *url.URL) string {\n\tvar uriPath string\n\n\tif len(u.Opaque) > 0 {\n\t\tconst schemeSep, pathSep, queryStart = \"//\", \"/\", \"?\"\n\n\t\topaque := u.Opaque\n\t\t// Cut off the query string if present.\n\t\tif idx := strings.Index(opaque, queryStart); idx >= 0 {\n\t\t\topaque = opaque[:idx]\n\t\t}\n\n\t\t// Cutout the scheme separator if present.\n\t\tif strings.Index(opaque, schemeSep) == 0 {\n\t\t\topaque = opaque[len(schemeSep):]\n\t\t}\n\n\t\t// capture URI path starting with first path separator.\n\t\tif idx := strings.Index(opaque, pathSep); idx >= 0 {\n\t\t\turiPath = opaque[idx:]\n\t\t}\n\t} else {\n\t\turiPath = u.EscapedPath()\n\t}\n\n\tif len(uriPath) == 0 {\n\t\turiPath = \"/\"\n\t}\n\n\treturn uriPath\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go",
    "content": "package v4\n\nimport (\n\t\"context\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tv4Internal \"github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4\"\n\tinternalauth \"github.com/aws/aws-sdk-go-v2/internal/auth\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst computePayloadHashMiddlewareID = \"ComputePayloadHash\"\n\n// HashComputationError indicates an error occurred while computing the signing hash\ntype HashComputationError struct {\n\tErr error\n}\n\n// Error is the error message\nfunc (e *HashComputationError) Error() string {\n\treturn fmt.Sprintf(\"failed to compute payload hash: %v\", e.Err)\n}\n\n// Unwrap returns the underlying error if one is set\nfunc (e *HashComputationError) Unwrap() error {\n\treturn e.Err\n}\n\n// SigningError indicates an error condition occurred while performing SigV4 signing\ntype SigningError struct {\n\tErr error\n}\n\nfunc (e *SigningError) Error() string {\n\treturn fmt.Sprintf(\"failed to sign request: %v\", e.Err)\n}\n\n// Unwrap returns the underlying error cause\nfunc (e *SigningError) Unwrap() error {\n\treturn e.Err\n}\n\n// UseDynamicPayloadSigningMiddleware swaps the compute payload sha256 middleware with a resolver middleware that\n// switches between unsigned and signed payload based on TLS state for request.\n// This middleware should not be used for AWS APIs that do not support unsigned payload signing auth.\n// By default, SDK uses this middleware for known AWS APIs that support such TLS based auth selection .\n//\n// Usage example -\n// S3 PutObject API allows unsigned payload signing auth usage when TLS is enabled, and uses this middleware to\n// dynamically switch between unsigned and signed payload based on TLS state for request.\nfunc UseDynamicPayloadSigningMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &dynamicPayloadSigningMiddleware{})\n\treturn err\n}\n\n// dynamicPayloadSigningMiddleware dynamically resolves the middleware that computes and set payload sha256 middleware.\ntype dynamicPayloadSigningMiddleware struct {\n}\n\n// ID returns the resolver identifier\nfunc (m *dynamicPayloadSigningMiddleware) ID() string {\n\treturn computePayloadHashMiddlewareID\n}\n\n// HandleFinalize delegates SHA256 computation according to whether the request\n// is TLS-enabled.\nfunc (m *dynamicPayloadSigningMiddleware) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif req.IsHTTPS() {\n\t\treturn (&UnsignedPayload{}).HandleFinalize(ctx, in, next)\n\t}\n\treturn (&ComputePayloadSHA256{}).HandleFinalize(ctx, in, next)\n}\n\n// UnsignedPayload sets the SigV4 request payload hash to unsigned.\n//\n// Will not set the Unsigned Payload magic SHA value, if a SHA has already been\n// stored in the context. (e.g. application pre-computed SHA256 before making\n// API call).\n//\n// This middleware does not check the X-Amz-Content-Sha256 header, if that\n// header is serialized a middleware must translate it into the context.\ntype UnsignedPayload struct{}\n\n// AddUnsignedPayloadMiddleware adds unsignedPayload to the operation\n// middleware stack\nfunc AddUnsignedPayloadMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&UnsignedPayload{}, \"ResolveEndpointV2\", middleware.After)\n}\n\n// ID returns the unsignedPayload identifier\nfunc (m *UnsignedPayload) ID() string {\n\treturn computePayloadHashMiddlewareID\n}\n\n// HandleFinalize sets the payload hash magic value to the unsigned sentinel.\nfunc (m *UnsignedPayload) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif GetPayloadHash(ctx) == \"\" {\n\t\tctx = SetPayloadHash(ctx, v4Internal.UnsignedPayload)\n\t}\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// ComputePayloadSHA256 computes SHA256 payload hash to sign.\n//\n// Will not set the Unsigned Payload magic SHA value, if a SHA has already been\n// stored in the context. (e.g. application pre-computed SHA256 before making\n// API call).\n//\n// This middleware does not check the X-Amz-Content-Sha256 header, if that\n// header is serialized a middleware must translate it into the context.\ntype ComputePayloadSHA256 struct{}\n\n// AddComputePayloadSHA256Middleware adds computePayloadSHA256 to the\n// operation middleware stack\nfunc AddComputePayloadSHA256Middleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&ComputePayloadSHA256{}, \"ResolveEndpointV2\", middleware.After)\n}\n\n// RemoveComputePayloadSHA256Middleware removes computePayloadSHA256 from the\n// operation middleware stack\nfunc RemoveComputePayloadSHA256Middleware(stack *middleware.Stack) error {\n\t_, err := stack.Finalize.Remove(computePayloadHashMiddlewareID)\n\treturn err\n}\n\n// ID is the middleware name\nfunc (m *ComputePayloadSHA256) ID() string {\n\treturn computePayloadHashMiddlewareID\n}\n\n// HandleFinalize computes the payload hash for the request, storing it to the\n// context. This is a no-op if a caller has previously set that value.\nfunc (m *ComputePayloadSHA256) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif GetPayloadHash(ctx) != \"\" {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &HashComputationError{\n\t\t\tErr: fmt.Errorf(\"unexpected request middleware type %T\", in.Request),\n\t\t}\n\t}\n\n\thash := sha256.New()\n\tif stream := req.GetStream(); stream != nil {\n\t\t_, err = io.Copy(hash, stream)\n\t\tif err != nil {\n\t\t\treturn out, metadata, &HashComputationError{\n\t\t\t\tErr: fmt.Errorf(\"failed to compute payload hash, %w\", err),\n\t\t\t}\n\t\t}\n\n\t\tif err := req.RewindStream(); err != nil {\n\t\t\treturn out, metadata, &HashComputationError{\n\t\t\t\tErr: fmt.Errorf(\"failed to seek body to start, %w\", err),\n\t\t\t}\n\t\t}\n\t}\n\n\tctx = SetPayloadHash(ctx, hex.EncodeToString(hash.Sum(nil)))\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// SwapComputePayloadSHA256ForUnsignedPayloadMiddleware replaces the\n// ComputePayloadSHA256 middleware with the UnsignedPayload middleware.\n//\n// Use this to disable computing the Payload SHA256 checksum and instead use\n// UNSIGNED-PAYLOAD for the SHA256 value.\nfunc SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &UnsignedPayload{})\n\treturn err\n}\n\n// ContentSHA256Header sets the X-Amz-Content-Sha256 header value to\n// the Payload hash stored in the context.\ntype ContentSHA256Header struct{}\n\n// AddContentSHA256HeaderMiddleware adds ContentSHA256Header to the\n// operation middleware stack\nfunc AddContentSHA256HeaderMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&ContentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After)\n}\n\n// RemoveContentSHA256HeaderMiddleware removes contentSHA256Header middleware\n// from the operation middleware stack\nfunc RemoveContentSHA256HeaderMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Finalize.Remove((*ContentSHA256Header)(nil).ID())\n\treturn err\n}\n\n// ID returns the ContentSHA256HeaderMiddleware identifier\nfunc (m *ContentSHA256Header) ID() string {\n\treturn \"SigV4ContentSHA256Header\"\n}\n\n// HandleFinalize sets the X-Amz-Content-Sha256 header value to the Payload hash\n// stored in the context.\nfunc (m *ContentSHA256Header) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &HashComputationError{Err: fmt.Errorf(\"unexpected request middleware type %T\", in.Request)}\n\t}\n\n\treq.Header.Set(v4Internal.ContentSHAKey, GetPayloadHash(ctx))\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// SignHTTPRequestMiddlewareOptions is the configuration options for\n// [SignHTTPRequestMiddleware].\n//\n// Deprecated: [SignHTTPRequestMiddleware] is deprecated.\ntype SignHTTPRequestMiddlewareOptions struct {\n\tCredentialsProvider aws.CredentialsProvider\n\tSigner              HTTPSigner\n\tLogSigning          bool\n}\n\n// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4\n// HTTP Signing.\n//\n// Deprecated: AWS service clients no longer use this middleware. Signing as an\n// SDK operation is now performed through an internal per-service middleware\n// which opaquely selects and uses the signer from the resolved auth scheme.\ntype SignHTTPRequestMiddleware struct {\n\tcredentialsProvider aws.CredentialsProvider\n\tsigner              HTTPSigner\n\tlogSigning          bool\n}\n\n// NewSignHTTPRequestMiddleware constructs a [SignHTTPRequestMiddleware] using\n// the given [Signer] for signing requests.\n//\n// Deprecated: SignHTTPRequestMiddleware is deprecated.\nfunc NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *SignHTTPRequestMiddleware {\n\treturn &SignHTTPRequestMiddleware{\n\t\tcredentialsProvider: options.CredentialsProvider,\n\t\tsigner:              options.Signer,\n\t\tlogSigning:          options.LogSigning,\n\t}\n}\n\n// ID is the SignHTTPRequestMiddleware identifier.\n//\n// Deprecated: SignHTTPRequestMiddleware is deprecated.\nfunc (s *SignHTTPRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\n// HandleFinalize will take the provided input and sign the request using the\n// SigV4 authentication scheme.\n//\n// Deprecated: SignHTTPRequestMiddleware is deprecated.\nfunc (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif !haveCredentialProvider(s.credentialsProvider) {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &SigningError{Err: fmt.Errorf(\"unexpected request middleware type %T\", in.Request)}\n\t}\n\n\tsigningName, signingRegion := awsmiddleware.GetSigningName(ctx), awsmiddleware.GetSigningRegion(ctx)\n\tpayloadHash := GetPayloadHash(ctx)\n\tif len(payloadHash) == 0 {\n\t\treturn out, metadata, &SigningError{Err: fmt.Errorf(\"computed payload hash missing from context\")}\n\t}\n\n\tcredentials, err := s.credentialsProvider.Retrieve(ctx)\n\tif err != nil {\n\t\treturn out, metadata, &SigningError{Err: fmt.Errorf(\"failed to retrieve credentials: %w\", err)}\n\t}\n\n\tsignerOptions := []func(o *SignerOptions){\n\t\tfunc(o *SignerOptions) {\n\t\t\to.Logger = middleware.GetLogger(ctx)\n\t\t\to.LogSigning = s.logSigning\n\t\t},\n\t}\n\n\t// existing DisableURIPathEscaping is equivalent in purpose\n\t// to authentication scheme property DisableDoubleEncoding\n\tdisableDoubleEncoding, overridden := internalauth.GetDisableDoubleEncoding(ctx)\n\tif overridden {\n\t\tsignerOptions = append(signerOptions, func(o *SignerOptions) {\n\t\t\to.DisableURIPathEscaping = disableDoubleEncoding\n\t\t})\n\t}\n\n\terr = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), signerOptions...)\n\tif err != nil {\n\t\treturn out, metadata, &SigningError{Err: fmt.Errorf(\"failed to sign http request, %w\", err)}\n\t}\n\n\tctx = awsmiddleware.SetSigningCredentials(ctx, credentials)\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// StreamingEventsPayload signs input event stream messages.\ntype StreamingEventsPayload struct{}\n\n// AddStreamingEventsPayload adds the streamingEventsPayload middleware to the stack.\nfunc AddStreamingEventsPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Add(&StreamingEventsPayload{}, middleware.Before)\n}\n\n// ID identifies the middleware.\nfunc (s *StreamingEventsPayload) ID() string {\n\treturn computePayloadHashMiddlewareID\n}\n\n// HandleFinalize marks the input stream to be signed with SigV4.\nfunc (s *StreamingEventsPayload) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tcontentSHA := GetPayloadHash(ctx)\n\tif len(contentSHA) == 0 {\n\t\tcontentSHA = v4Internal.StreamingEventsPayload\n\t}\n\n\tctx = SetPayloadHash(ctx, contentSHA)\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// GetSignedRequestSignature attempts to extract the signature of the request.\n// Returning an error if the request is unsigned, or unable to extract the\n// signature.\nfunc GetSignedRequestSignature(r *http.Request) ([]byte, error) {\n\tconst authHeaderSignatureElem = \"Signature=\"\n\n\tif auth := r.Header.Get(authorizationHeader); len(auth) != 0 {\n\t\tps := strings.Split(auth, \", \")\n\t\tfor _, p := range ps {\n\t\t\tif idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 {\n\t\t\t\tsig := p[len(authHeaderSignatureElem):]\n\t\t\t\tif len(sig) == 0 {\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid request signature authorization header\")\n\t\t\t\t}\n\t\t\t\treturn hex.DecodeString(sig)\n\t\t\t}\n\t\t}\n\t}\n\n\tif sig := r.URL.Query().Get(\"X-Amz-Signature\"); len(sig) != 0 {\n\t\treturn hex.DecodeString(sig)\n\t}\n\n\treturn nil, fmt.Errorf(\"request not signed\")\n}\n\nfunc haveCredentialProvider(p aws.CredentialsProvider) bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\n\treturn !aws.IsCredentialsProvider(p, (*aws.AnonymousCredentials)(nil))\n}\n\ntype payloadHashKey struct{}\n\n// GetPayloadHash retrieves the payload hash to use for signing\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetPayloadHash(ctx context.Context) (v string) {\n\tv, _ = middleware.GetStackValue(ctx, payloadHashKey{}).(string)\n\treturn v\n}\n\n// SetPayloadHash sets the payload hash to be used for signing the request\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc SetPayloadHash(ctx context.Context, hash string) context.Context {\n\treturn middleware.WithStackValue(ctx, payloadHashKey{}, hash)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.go",
    "content": "package v4\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyHTTP \"github.com/aws/smithy-go/transport/http\"\n)\n\n// HTTPPresigner is an interface to a SigV4 signer that can sign create a\n// presigned URL for a HTTP requests.\ntype HTTPPresigner interface {\n\tPresignHTTP(\n\t\tctx context.Context, credentials aws.Credentials, r *http.Request,\n\t\tpayloadHash string, service string, region string, signingTime time.Time,\n\t\toptFns ...func(*SignerOptions),\n\t) (url string, signedHeader http.Header, err error)\n}\n\n// PresignedHTTPRequest provides the URL and signed headers that are included\n// in the presigned URL.\ntype PresignedHTTPRequest struct {\n\tURL          string\n\tMethod       string\n\tSignedHeader http.Header\n}\n\n// PresignHTTPRequestMiddlewareOptions is the options for the PresignHTTPRequestMiddleware middleware.\ntype PresignHTTPRequestMiddlewareOptions struct {\n\tCredentialsProvider aws.CredentialsProvider\n\tPresigner           HTTPPresigner\n\tLogSigning          bool\n}\n\n// PresignHTTPRequestMiddleware provides the Finalize middleware for creating a\n// presigned URL for an HTTP request.\n//\n// Will short circuit the middleware stack and not forward onto the next\n// Finalize handler.\ntype PresignHTTPRequestMiddleware struct {\n\tcredentialsProvider aws.CredentialsProvider\n\tpresigner           HTTPPresigner\n\tlogSigning          bool\n}\n\n// NewPresignHTTPRequestMiddleware returns a new PresignHTTPRequestMiddleware\n// initialized with the presigner.\nfunc NewPresignHTTPRequestMiddleware(options PresignHTTPRequestMiddlewareOptions) *PresignHTTPRequestMiddleware {\n\treturn &PresignHTTPRequestMiddleware{\n\t\tcredentialsProvider: options.CredentialsProvider,\n\t\tpresigner:           options.Presigner,\n\t\tlogSigning:          options.LogSigning,\n\t}\n}\n\n// ID provides the middleware ID.\nfunc (*PresignHTTPRequestMiddleware) ID() string { return \"PresignHTTPRequest\" }\n\n// HandleFinalize will take the provided input and create a presigned url for\n// the http request using the SigV4 presign authentication scheme.\n//\n// Since the signed request is not a valid HTTP request\nfunc (s *PresignHTTPRequestMiddleware) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyHTTP.Request)\n\tif !ok {\n\t\treturn out, metadata, &SigningError{\n\t\t\tErr: fmt.Errorf(\"unexpected request middleware type %T\", in.Request),\n\t\t}\n\t}\n\n\thttpReq := req.Build(ctx)\n\tif !haveCredentialProvider(s.credentialsProvider) {\n\t\tout.Result = &PresignedHTTPRequest{\n\t\t\tURL:          httpReq.URL.String(),\n\t\t\tMethod:       httpReq.Method,\n\t\t\tSignedHeader: http.Header{},\n\t\t}\n\n\t\treturn out, metadata, nil\n\t}\n\n\tsigningName := awsmiddleware.GetSigningName(ctx)\n\tsigningRegion := awsmiddleware.GetSigningRegion(ctx)\n\tpayloadHash := GetPayloadHash(ctx)\n\tif len(payloadHash) == 0 {\n\t\treturn out, metadata, &SigningError{\n\t\t\tErr: fmt.Errorf(\"computed payload hash missing from context\"),\n\t\t}\n\t}\n\n\tcredentials, err := s.credentialsProvider.Retrieve(ctx)\n\tif err != nil {\n\t\treturn out, metadata, &SigningError{\n\t\t\tErr: fmt.Errorf(\"failed to retrieve credentials: %w\", err),\n\t\t}\n\t}\n\n\tu, h, err := s.presigner.PresignHTTP(ctx, credentials,\n\t\thttpReq, payloadHash, signingName, signingRegion, sdk.NowTime(),\n\t\tfunc(o *SignerOptions) {\n\t\t\to.Logger = middleware.GetLogger(ctx)\n\t\t\to.LogSigning = s.logSigning\n\t\t})\n\tif err != nil {\n\t\treturn out, metadata, &SigningError{\n\t\t\tErr: fmt.Errorf(\"failed to sign http request, %w\", err),\n\t\t}\n\t}\n\n\tout.Result = &PresignedHTTPRequest{\n\t\tURL:          u,\n\t\tMethod:       httpReq.Method,\n\t\tSignedHeader: h,\n\t}\n\n\treturn out, metadata, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go",
    "content": "package v4\n\nimport (\n\t\"context\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tv4Internal \"github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4\"\n\t\"strings\"\n\t\"time\"\n)\n\n// EventStreamSigner is an AWS EventStream protocol signer.\ntype EventStreamSigner interface {\n\tGetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error)\n}\n\n// StreamSignerOptions is the configuration options for StreamSigner.\ntype StreamSignerOptions struct{}\n\n// StreamSigner implements Signature Version 4 (SigV4) signing of event stream encoded payloads.\ntype StreamSigner struct {\n\toptions StreamSignerOptions\n\n\tcredentials aws.Credentials\n\tservice     string\n\tregion      string\n\n\tprevSignature []byte\n\n\tsigningKeyDeriver *v4Internal.SigningKeyDeriver\n}\n\n// NewStreamSigner returns a new AWS EventStream protocol signer.\nfunc NewStreamSigner(credentials aws.Credentials, service, region string, seedSignature []byte, optFns ...func(*StreamSignerOptions)) *StreamSigner {\n\to := StreamSignerOptions{}\n\n\tfor _, fn := range optFns {\n\t\tfn(&o)\n\t}\n\n\treturn &StreamSigner{\n\t\toptions:           o,\n\t\tcredentials:       credentials,\n\t\tservice:           service,\n\t\tregion:            region,\n\t\tsigningKeyDeriver: v4Internal.NewSigningKeyDeriver(),\n\t\tprevSignature:     seedSignature,\n\t}\n}\n\n// GetSignature signs the provided header and payload bytes.\nfunc (s *StreamSigner) GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error) {\n\toptions := s.options\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tprevSignature := s.prevSignature\n\n\tst := v4Internal.NewSigningTime(signingTime)\n\n\tsigKey := s.signingKeyDeriver.DeriveKey(s.credentials, s.service, s.region, st)\n\n\tscope := v4Internal.BuildCredentialScope(st, s.region, s.service)\n\n\tstringToSign := s.buildEventStreamStringToSign(headers, payload, prevSignature, scope, &st)\n\n\tsignature := v4Internal.HMACSHA256(sigKey, []byte(stringToSign))\n\ts.prevSignature = signature\n\n\treturn signature, nil\n}\n\nfunc (s *StreamSigner) buildEventStreamStringToSign(headers, payload, previousSignature []byte, credentialScope string, signingTime *v4Internal.SigningTime) string {\n\thash := sha256.New()\n\treturn strings.Join([]string{\n\t\t\"AWS4-HMAC-SHA256-PAYLOAD\",\n\t\tsigningTime.TimeFormat(),\n\t\tcredentialScope,\n\t\thex.EncodeToString(previousSignature),\n\t\thex.EncodeToString(makeHash(hash, headers)),\n\t\thex.EncodeToString(makeHash(hash, payload)),\n\t}, \"\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go",
    "content": "// Package v4 implements the AWS signature version 4 algorithm (commonly known\n// as SigV4).\n//\n// For more information about SigV4, see [Signing AWS API requests] in the IAM\n// user guide.\n//\n// While this implementation CAN work in an external context, it is developed\n// primarily for SDK use and you may encounter fringe behaviors around header\n// canonicalization.\n//\n// # Pre-escaping a request URI\n//\n// AWS v4 signature validation requires that the canonical string's URI path\n// component must be the escaped form of the HTTP request's path.\n//\n// The Go HTTP client will perform escaping automatically on the HTTP request.\n// This may cause signature validation errors because the request differs from\n// the URI path or query from which the signature was generated.\n//\n// Because of this, we recommend that you explicitly escape the request when\n// using this signer outside of the SDK to prevent possible signature mismatch.\n// This can be done by setting URL.Opaque on the request. The signer will\n// prefer that value, falling back to the return of URL.EscapedPath if unset.\n//\n// When setting URL.Opaque you must do so in the form of:\n//\n//\t\"//<hostname>/<path>\"\n//\n//\t// e.g.\n//\t\"//example.com/some/path\"\n//\n// The leading \"//\" and hostname are required or the escaping will not work\n// correctly.\n//\n// The TestStandaloneSign unit test provides a complete example of using the\n// signer outside of the SDK and pre-escaping the URI path.\n//\n// [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html\npackage v4\n\nimport (\n\t\"context\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"hash\"\n\t\"net/http\"\n\t\"net/textproto\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tv4Internal \"github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\t\"github.com/aws/smithy-go/logging\"\n)\n\nconst (\n\tsigningAlgorithm    = \"AWS4-HMAC-SHA256\"\n\tauthorizationHeader = \"Authorization\"\n\n\t// Version of signing v4\n\tVersion = \"SigV4\"\n)\n\n// HTTPSigner is an interface to a SigV4 signer that can sign HTTP requests\ntype HTTPSigner interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*SignerOptions)) error\n}\n\ntype keyDerivator interface {\n\tDeriveKey(credential aws.Credentials, service, region string, signingTime v4Internal.SigningTime) []byte\n}\n\n// SignerOptions is the SigV4 Signer options.\ntype SignerOptions struct {\n\t// Disables the Signer's moving HTTP header key/value pairs from the HTTP\n\t// request header to the request's query string. This is most commonly used\n\t// with pre-signed requests preventing headers from being added to the\n\t// request's query string.\n\tDisableHeaderHoisting bool\n\n\t// Disables the automatic escaping of the URI path of the request for the\n\t// siganture's canonical string's path. For services that do not need additional\n\t// escaping then use this to disable the signer escaping the path.\n\t//\n\t// S3 is an example of a service that does not need additional escaping.\n\t//\n\t// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n\tDisableURIPathEscaping bool\n\n\t// The logger to send log messages to.\n\tLogger logging.Logger\n\n\t// Enable logging of signed requests.\n\t// This will enable logging of the canonical request, the string to sign, and for presigning the subsequent\n\t// presigned URL.\n\tLogSigning bool\n\n\t// Disables setting the session token on the request as part of signing\n\t// through X-Amz-Security-Token. This is needed for variations of v4 that\n\t// present the token elsewhere.\n\tDisableSessionToken bool\n}\n\n// Signer applies AWS v4 signing to given request. Use this to sign requests\n// that need to be signed with AWS V4 Signatures.\ntype Signer struct {\n\toptions      SignerOptions\n\tkeyDerivator keyDerivator\n}\n\n// NewSigner returns a new SigV4 Signer\nfunc NewSigner(optFns ...func(signer *SignerOptions)) *Signer {\n\toptions := SignerOptions{}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &Signer{options: options, keyDerivator: v4Internal.NewSigningKeyDeriver()}\n}\n\ntype httpSigner struct {\n\tRequest      *http.Request\n\tServiceName  string\n\tRegion       string\n\tTime         v4Internal.SigningTime\n\tCredentials  aws.Credentials\n\tKeyDerivator keyDerivator\n\tIsPreSign    bool\n\n\tPayloadHash string\n\n\tDisableHeaderHoisting  bool\n\tDisableURIPathEscaping bool\n\tDisableSessionToken    bool\n}\n\nfunc (s *httpSigner) Build() (signedRequest, error) {\n\treq := s.Request\n\n\tquery := req.URL.Query()\n\theaders := req.Header\n\n\ts.setRequiredSigningFields(headers, query)\n\n\t// Sort Each Query Key's Values\n\tfor key := range query {\n\t\tsort.Strings(query[key])\n\t}\n\n\tv4Internal.SanitizeHostForHeader(req)\n\n\tcredentialScope := s.buildCredentialScope()\n\tcredentialStr := s.Credentials.AccessKeyID + \"/\" + credentialScope\n\tif s.IsPreSign {\n\t\tquery.Set(v4Internal.AmzCredentialKey, credentialStr)\n\t}\n\n\tunsignedHeaders := headers\n\tif s.IsPreSign && !s.DisableHeaderHoisting {\n\t\tvar urlValues url.Values\n\t\turlValues, unsignedHeaders = buildQuery(v4Internal.AllowedQueryHoisting, headers)\n\t\tfor k := range urlValues {\n\t\t\tquery[k] = urlValues[k]\n\t\t}\n\t}\n\n\thost := req.URL.Host\n\tif len(req.Host) > 0 {\n\t\thost = req.Host\n\t}\n\n\tsignedHeaders, signedHeadersStr, canonicalHeaderStr := s.buildCanonicalHeaders(host, v4Internal.IgnoredHeaders, unsignedHeaders, s.Request.ContentLength)\n\n\tif s.IsPreSign {\n\t\tquery.Set(v4Internal.AmzSignedHeadersKey, signedHeadersStr)\n\t}\n\n\tvar rawQuery strings.Builder\n\trawQuery.WriteString(strings.Replace(query.Encode(), \"+\", \"%20\", -1))\n\n\tcanonicalURI := v4Internal.GetURIPath(req.URL)\n\tif !s.DisableURIPathEscaping {\n\t\tcanonicalURI = httpbinding.EscapePath(canonicalURI, false)\n\t}\n\n\tcanonicalString := s.buildCanonicalString(\n\t\treq.Method,\n\t\tcanonicalURI,\n\t\trawQuery.String(),\n\t\tsignedHeadersStr,\n\t\tcanonicalHeaderStr,\n\t)\n\n\tstrToSign := s.buildStringToSign(credentialScope, canonicalString)\n\tsigningSignature, err := s.buildSignature(strToSign)\n\tif err != nil {\n\t\treturn signedRequest{}, err\n\t}\n\n\tif s.IsPreSign {\n\t\trawQuery.WriteString(\"&X-Amz-Signature=\")\n\t\trawQuery.WriteString(signingSignature)\n\t} else {\n\t\theaders[authorizationHeader] = append(headers[authorizationHeader][:0], buildAuthorizationHeader(credentialStr, signedHeadersStr, signingSignature))\n\t}\n\n\treq.URL.RawQuery = rawQuery.String()\n\n\treturn signedRequest{\n\t\tRequest:         req,\n\t\tSignedHeaders:   signedHeaders,\n\t\tCanonicalString: canonicalString,\n\t\tStringToSign:    strToSign,\n\t\tPreSigned:       s.IsPreSign,\n\t}, nil\n}\n\nfunc buildAuthorizationHeader(credentialStr, signedHeadersStr, signingSignature string) string {\n\tconst credential = \"Credential=\"\n\tconst signedHeaders = \"SignedHeaders=\"\n\tconst signature = \"Signature=\"\n\tconst commaSpace = \", \"\n\n\tvar parts strings.Builder\n\tparts.Grow(len(signingAlgorithm) + 1 +\n\t\tlen(credential) + len(credentialStr) + 2 +\n\t\tlen(signedHeaders) + len(signedHeadersStr) + 2 +\n\t\tlen(signature) + len(signingSignature),\n\t)\n\tparts.WriteString(signingAlgorithm)\n\tparts.WriteRune(' ')\n\tparts.WriteString(credential)\n\tparts.WriteString(credentialStr)\n\tparts.WriteString(commaSpace)\n\tparts.WriteString(signedHeaders)\n\tparts.WriteString(signedHeadersStr)\n\tparts.WriteString(commaSpace)\n\tparts.WriteString(signature)\n\tparts.WriteString(signingSignature)\n\treturn parts.String()\n}\n\n// SignHTTP signs AWS v4 requests with the provided payload hash, service name, region the\n// request is made to, and time the request is signed at. The signTime allows\n// you to specify that a request is signed for the future, and cannot be\n// used until then.\n//\n// The payloadHash is the hex encoded SHA-256 hash of the request payload, and\n// must be provided. Even if the request has no payload (aka body). If the\n// request has no payload you should use the hex encoded SHA-256 of an empty\n// string as the payloadHash value.\n//\n//\t\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n//\n// Some services such as Amazon S3 accept alternative values for the payload\n// hash, such as \"UNSIGNED-PAYLOAD\" for requests where the body will not be\n// included in the request signature.\n//\n// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html\n//\n// Sign differs from Presign in that it will sign the request using HTTP\n// header values. This type of signing is intended for http.Request values that\n// will not be shared, or are shared in a way the header values on the request\n// will not be lost.\n//\n// The passed in request will be modified in place.\nfunc (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(options *SignerOptions)) error {\n\toptions := s.options\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tsigner := &httpSigner{\n\t\tRequest:                r,\n\t\tPayloadHash:            payloadHash,\n\t\tServiceName:            service,\n\t\tRegion:                 region,\n\t\tCredentials:            credentials,\n\t\tTime:                   v4Internal.NewSigningTime(signingTime.UTC()),\n\t\tDisableHeaderHoisting:  options.DisableHeaderHoisting,\n\t\tDisableURIPathEscaping: options.DisableURIPathEscaping,\n\t\tDisableSessionToken:    options.DisableSessionToken,\n\t\tKeyDerivator:           s.keyDerivator,\n\t}\n\n\tsignedRequest, err := signer.Build()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogSigningInfo(ctx, options, &signedRequest, false)\n\n\treturn nil\n}\n\n// PresignHTTP signs AWS v4 requests with the payload hash, service name, region\n// the request is made to, and time the request is signed at. The signTime\n// allows you to specify that a request is signed for the future, and cannot\n// be used until then.\n//\n// Returns the signed URL and the map of HTTP headers that were included in the\n// signature or an error if signing the request failed. For presigned requests\n// these headers and their values must be included on the HTTP request when it\n// is made. This is helpful to know what header values need to be shared with\n// the party the presigned request will be distributed to.\n//\n// The payloadHash is the hex encoded SHA-256 hash of the request payload, and\n// must be provided. Even if the request has no payload (aka body). If the\n// request has no payload you should use the hex encoded SHA-256 of an empty\n// string as the payloadHash value.\n//\n//\t\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n//\n// Some services such as Amazon S3 accept alternative values for the payload\n// hash, such as \"UNSIGNED-PAYLOAD\" for requests where the body will not be\n// included in the request signature.\n//\n// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html\n//\n// PresignHTTP differs from SignHTTP in that it will sign the request using\n// query string instead of header values. This allows you to share the\n// Presigned Request's URL with third parties, or distribute it throughout your\n// system with minimal dependencies.\n//\n// PresignHTTP will not set the expires time of the presigned request\n// automatically. To specify the expire duration for a request add the\n// \"X-Amz-Expires\" query parameter on the request with the value as the\n// duration in seconds the presigned URL should be considered valid for. This\n// parameter is not used by all AWS services, and is most notable used by\n// Amazon S3 APIs.\n//\n//\texpires := 20 * time.Minute\n//\tquery := req.URL.Query()\n//\tquery.Set(\"X-Amz-Expires\", strconv.FormatInt(int64(expires/time.Second), 10))\n//\treq.URL.RawQuery = query.Encode()\n//\n// This method does not modify the provided request.\nfunc (s *Signer) PresignHTTP(\n\tctx context.Context, credentials aws.Credentials, r *http.Request,\n\tpayloadHash string, service string, region string, signingTime time.Time,\n\toptFns ...func(*SignerOptions),\n) (signedURI string, signedHeaders http.Header, err error) {\n\toptions := s.options\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tsigner := &httpSigner{\n\t\tRequest:                r.Clone(r.Context()),\n\t\tPayloadHash:            payloadHash,\n\t\tServiceName:            service,\n\t\tRegion:                 region,\n\t\tCredentials:            credentials,\n\t\tTime:                   v4Internal.NewSigningTime(signingTime.UTC()),\n\t\tIsPreSign:              true,\n\t\tDisableHeaderHoisting:  options.DisableHeaderHoisting,\n\t\tDisableURIPathEscaping: options.DisableURIPathEscaping,\n\t\tDisableSessionToken:    options.DisableSessionToken,\n\t\tKeyDerivator:           s.keyDerivator,\n\t}\n\n\tsignedRequest, err := signer.Build()\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tlogSigningInfo(ctx, options, &signedRequest, true)\n\n\tsignedHeaders = make(http.Header)\n\n\t// For the signed headers we canonicalize the header keys in the returned map.\n\t// This avoids situations where can standard library double headers like host header. For example the standard\n\t// library will set the Host header, even if it is present in lower-case form.\n\tfor k, v := range signedRequest.SignedHeaders {\n\t\tkey := textproto.CanonicalMIMEHeaderKey(k)\n\t\tsignedHeaders[key] = append(signedHeaders[key], v...)\n\t}\n\n\treturn signedRequest.Request.URL.String(), signedHeaders, nil\n}\n\nfunc (s *httpSigner) buildCredentialScope() string {\n\treturn v4Internal.BuildCredentialScope(s.Time, s.Region, s.ServiceName)\n}\n\nfunc buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header) {\n\tquery := url.Values{}\n\tunsignedHeaders := http.Header{}\n\tfor k, h := range header {\n\t\t// literally just this header has this constraint for some stupid reason,\n\t\t// see #2508\n\t\tif k == \"X-Amz-Expected-Bucket-Owner\" {\n\t\t\tk = \"x-amz-expected-bucket-owner\"\n\t\t}\n\n\t\tif r.IsValid(k) {\n\t\t\tquery[k] = h\n\t\t} else {\n\t\t\tunsignedHeaders[k] = h\n\t\t}\n\t}\n\n\treturn query, unsignedHeaders\n}\n\nfunc (s *httpSigner) buildCanonicalHeaders(host string, rule v4Internal.Rule, header http.Header, length int64) (signed http.Header, signedHeaders, canonicalHeadersStr string) {\n\tsigned = make(http.Header)\n\n\tvar headers []string\n\tconst hostHeader = \"host\"\n\theaders = append(headers, hostHeader)\n\tsigned[hostHeader] = append(signed[hostHeader], host)\n\n\tconst contentLengthHeader = \"content-length\"\n\tif length > 0 {\n\t\theaders = append(headers, contentLengthHeader)\n\t\tsigned[contentLengthHeader] = append(signed[contentLengthHeader], strconv.FormatInt(length, 10))\n\t}\n\n\tfor k, v := range header {\n\t\tif !rule.IsValid(k) {\n\t\t\tcontinue // ignored header\n\t\t}\n\t\tif strings.EqualFold(k, contentLengthHeader) {\n\t\t\t// prevent signing already handled content-length header.\n\t\t\tcontinue\n\t\t}\n\n\t\tlowerCaseKey := strings.ToLower(k)\n\t\tif _, ok := signed[lowerCaseKey]; ok {\n\t\t\t// include additional values\n\t\t\tsigned[lowerCaseKey] = append(signed[lowerCaseKey], v...)\n\t\t\tcontinue\n\t\t}\n\n\t\theaders = append(headers, lowerCaseKey)\n\t\tsigned[lowerCaseKey] = v\n\t}\n\tsort.Strings(headers)\n\n\tsignedHeaders = strings.Join(headers, \";\")\n\n\tvar canonicalHeaders strings.Builder\n\tn := len(headers)\n\tconst colon = ':'\n\tfor i := 0; i < n; i++ {\n\t\tif headers[i] == hostHeader {\n\t\t\tcanonicalHeaders.WriteString(hostHeader)\n\t\t\tcanonicalHeaders.WriteRune(colon)\n\t\t\tcanonicalHeaders.WriteString(v4Internal.StripExcessSpaces(host))\n\t\t} else {\n\t\t\tcanonicalHeaders.WriteString(headers[i])\n\t\t\tcanonicalHeaders.WriteRune(colon)\n\t\t\t// Trim out leading, trailing, and dedup inner spaces from signed header values.\n\t\t\tvalues := signed[headers[i]]\n\t\t\tfor j, v := range values {\n\t\t\t\tcleanedValue := strings.TrimSpace(v4Internal.StripExcessSpaces(v))\n\t\t\t\tcanonicalHeaders.WriteString(cleanedValue)\n\t\t\t\tif j < len(values)-1 {\n\t\t\t\t\tcanonicalHeaders.WriteRune(',')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcanonicalHeaders.WriteRune('\\n')\n\t}\n\tcanonicalHeadersStr = canonicalHeaders.String()\n\n\treturn signed, signedHeaders, canonicalHeadersStr\n}\n\nfunc (s *httpSigner) buildCanonicalString(method, uri, query, signedHeaders, canonicalHeaders string) string {\n\treturn strings.Join([]string{\n\t\tmethod,\n\t\turi,\n\t\tquery,\n\t\tcanonicalHeaders,\n\t\tsignedHeaders,\n\t\ts.PayloadHash,\n\t}, \"\\n\")\n}\n\nfunc (s *httpSigner) buildStringToSign(credentialScope, canonicalRequestString string) string {\n\treturn strings.Join([]string{\n\t\tsigningAlgorithm,\n\t\ts.Time.TimeFormat(),\n\t\tcredentialScope,\n\t\thex.EncodeToString(makeHash(sha256.New(), []byte(canonicalRequestString))),\n\t}, \"\\n\")\n}\n\nfunc makeHash(hash hash.Hash, b []byte) []byte {\n\thash.Reset()\n\thash.Write(b)\n\treturn hash.Sum(nil)\n}\n\nfunc (s *httpSigner) buildSignature(strToSign string) (string, error) {\n\tkey := s.KeyDerivator.DeriveKey(s.Credentials, s.ServiceName, s.Region, s.Time)\n\treturn hex.EncodeToString(v4Internal.HMACSHA256(key, []byte(strToSign))), nil\n}\n\nfunc (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Values) {\n\tamzDate := s.Time.TimeFormat()\n\n\tif s.IsPreSign {\n\t\tquery.Set(v4Internal.AmzAlgorithmKey, signingAlgorithm)\n\t\tsessionToken := s.Credentials.SessionToken\n\t\tif !s.DisableSessionToken && len(sessionToken) > 0 {\n\t\t\tquery.Set(\"X-Amz-Security-Token\", sessionToken)\n\t\t}\n\n\t\tquery.Set(v4Internal.AmzDateKey, amzDate)\n\t\treturn\n\t}\n\n\theaders[v4Internal.AmzDateKey] = append(headers[v4Internal.AmzDateKey][:0], amzDate)\n\n\tif !s.DisableSessionToken && len(s.Credentials.SessionToken) > 0 {\n\t\theaders[v4Internal.AmzSecurityTokenKey] = append(headers[v4Internal.AmzSecurityTokenKey][:0], s.Credentials.SessionToken)\n\t}\n}\n\nfunc logSigningInfo(ctx context.Context, options SignerOptions, request *signedRequest, isPresign bool) {\n\tif !options.LogSigning {\n\t\treturn\n\t}\n\tsignedURLMsg := \"\"\n\tif isPresign {\n\t\tsignedURLMsg = fmt.Sprintf(logSignedURLMsg, request.Request.URL.String())\n\t}\n\tlogger := logging.WithContext(ctx, options.Logger)\n\tlogger.Logf(logging.Debug, logSignInfoMsg, request.CanonicalString, request.StringToSign, signedURLMsg)\n}\n\ntype signedRequest struct {\n\tRequest         *http.Request\n\tSignedHeaders   http.Header\n\tCanonicalString string\n\tStringToSign    string\n\tPreSigned       bool\n}\n\nconst logSignInfoMsg = `Request Signature:\n---[ CANONICAL STRING  ]-----------------------------\n%s\n---[ STRING TO SIGN ]--------------------------------\n%s%s\n-----------------------------------------------------`\nconst logSignedURLMsg = `\n---[ SIGNED URL ]------------------------------------\n%s`\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go",
    "content": "// Code generated by aws/generate.go DO NOT EDIT.\n\npackage aws\n\nimport (\n\t\"github.com/aws/smithy-go/ptr\"\n\t\"time\"\n)\n\n// Bool returns a pointer value for the bool value passed in.\nfunc Bool(v bool) *bool {\n\treturn ptr.Bool(v)\n}\n\n// BoolSlice returns a slice of bool pointers from the values\n// passed in.\nfunc BoolSlice(vs []bool) []*bool {\n\treturn ptr.BoolSlice(vs)\n}\n\n// BoolMap returns a map of bool pointers from the values\n// passed in.\nfunc BoolMap(vs map[string]bool) map[string]*bool {\n\treturn ptr.BoolMap(vs)\n}\n\n// Byte returns a pointer value for the byte value passed in.\nfunc Byte(v byte) *byte {\n\treturn ptr.Byte(v)\n}\n\n// ByteSlice returns a slice of byte pointers from the values\n// passed in.\nfunc ByteSlice(vs []byte) []*byte {\n\treturn ptr.ByteSlice(vs)\n}\n\n// ByteMap returns a map of byte pointers from the values\n// passed in.\nfunc ByteMap(vs map[string]byte) map[string]*byte {\n\treturn ptr.ByteMap(vs)\n}\n\n// String returns a pointer value for the string value passed in.\nfunc String(v string) *string {\n\treturn ptr.String(v)\n}\n\n// StringSlice returns a slice of string pointers from the values\n// passed in.\nfunc StringSlice(vs []string) []*string {\n\treturn ptr.StringSlice(vs)\n}\n\n// StringMap returns a map of string pointers from the values\n// passed in.\nfunc StringMap(vs map[string]string) map[string]*string {\n\treturn ptr.StringMap(vs)\n}\n\n// Int returns a pointer value for the int value passed in.\nfunc Int(v int) *int {\n\treturn ptr.Int(v)\n}\n\n// IntSlice returns a slice of int pointers from the values\n// passed in.\nfunc IntSlice(vs []int) []*int {\n\treturn ptr.IntSlice(vs)\n}\n\n// IntMap returns a map of int pointers from the values\n// passed in.\nfunc IntMap(vs map[string]int) map[string]*int {\n\treturn ptr.IntMap(vs)\n}\n\n// Int8 returns a pointer value for the int8 value passed in.\nfunc Int8(v int8) *int8 {\n\treturn ptr.Int8(v)\n}\n\n// Int8Slice returns a slice of int8 pointers from the values\n// passed in.\nfunc Int8Slice(vs []int8) []*int8 {\n\treturn ptr.Int8Slice(vs)\n}\n\n// Int8Map returns a map of int8 pointers from the values\n// passed in.\nfunc Int8Map(vs map[string]int8) map[string]*int8 {\n\treturn ptr.Int8Map(vs)\n}\n\n// Int16 returns a pointer value for the int16 value passed in.\nfunc Int16(v int16) *int16 {\n\treturn ptr.Int16(v)\n}\n\n// Int16Slice returns a slice of int16 pointers from the values\n// passed in.\nfunc Int16Slice(vs []int16) []*int16 {\n\treturn ptr.Int16Slice(vs)\n}\n\n// Int16Map returns a map of int16 pointers from the values\n// passed in.\nfunc Int16Map(vs map[string]int16) map[string]*int16 {\n\treturn ptr.Int16Map(vs)\n}\n\n// Int32 returns a pointer value for the int32 value passed in.\nfunc Int32(v int32) *int32 {\n\treturn ptr.Int32(v)\n}\n\n// Int32Slice returns a slice of int32 pointers from the values\n// passed in.\nfunc Int32Slice(vs []int32) []*int32 {\n\treturn ptr.Int32Slice(vs)\n}\n\n// Int32Map returns a map of int32 pointers from the values\n// passed in.\nfunc Int32Map(vs map[string]int32) map[string]*int32 {\n\treturn ptr.Int32Map(vs)\n}\n\n// Int64 returns a pointer value for the int64 value passed in.\nfunc Int64(v int64) *int64 {\n\treturn ptr.Int64(v)\n}\n\n// Int64Slice returns a slice of int64 pointers from the values\n// passed in.\nfunc Int64Slice(vs []int64) []*int64 {\n\treturn ptr.Int64Slice(vs)\n}\n\n// Int64Map returns a map of int64 pointers from the values\n// passed in.\nfunc Int64Map(vs map[string]int64) map[string]*int64 {\n\treturn ptr.Int64Map(vs)\n}\n\n// Uint returns a pointer value for the uint value passed in.\nfunc Uint(v uint) *uint {\n\treturn ptr.Uint(v)\n}\n\n// UintSlice returns a slice of uint pointers from the values\n// passed in.\nfunc UintSlice(vs []uint) []*uint {\n\treturn ptr.UintSlice(vs)\n}\n\n// UintMap returns a map of uint pointers from the values\n// passed in.\nfunc UintMap(vs map[string]uint) map[string]*uint {\n\treturn ptr.UintMap(vs)\n}\n\n// Uint8 returns a pointer value for the uint8 value passed in.\nfunc Uint8(v uint8) *uint8 {\n\treturn ptr.Uint8(v)\n}\n\n// Uint8Slice returns a slice of uint8 pointers from the values\n// passed in.\nfunc Uint8Slice(vs []uint8) []*uint8 {\n\treturn ptr.Uint8Slice(vs)\n}\n\n// Uint8Map returns a map of uint8 pointers from the values\n// passed in.\nfunc Uint8Map(vs map[string]uint8) map[string]*uint8 {\n\treturn ptr.Uint8Map(vs)\n}\n\n// Uint16 returns a pointer value for the uint16 value passed in.\nfunc Uint16(v uint16) *uint16 {\n\treturn ptr.Uint16(v)\n}\n\n// Uint16Slice returns a slice of uint16 pointers from the values\n// passed in.\nfunc Uint16Slice(vs []uint16) []*uint16 {\n\treturn ptr.Uint16Slice(vs)\n}\n\n// Uint16Map returns a map of uint16 pointers from the values\n// passed in.\nfunc Uint16Map(vs map[string]uint16) map[string]*uint16 {\n\treturn ptr.Uint16Map(vs)\n}\n\n// Uint32 returns a pointer value for the uint32 value passed in.\nfunc Uint32(v uint32) *uint32 {\n\treturn ptr.Uint32(v)\n}\n\n// Uint32Slice returns a slice of uint32 pointers from the values\n// passed in.\nfunc Uint32Slice(vs []uint32) []*uint32 {\n\treturn ptr.Uint32Slice(vs)\n}\n\n// Uint32Map returns a map of uint32 pointers from the values\n// passed in.\nfunc Uint32Map(vs map[string]uint32) map[string]*uint32 {\n\treturn ptr.Uint32Map(vs)\n}\n\n// Uint64 returns a pointer value for the uint64 value passed in.\nfunc Uint64(v uint64) *uint64 {\n\treturn ptr.Uint64(v)\n}\n\n// Uint64Slice returns a slice of uint64 pointers from the values\n// passed in.\nfunc Uint64Slice(vs []uint64) []*uint64 {\n\treturn ptr.Uint64Slice(vs)\n}\n\n// Uint64Map returns a map of uint64 pointers from the values\n// passed in.\nfunc Uint64Map(vs map[string]uint64) map[string]*uint64 {\n\treturn ptr.Uint64Map(vs)\n}\n\n// Float32 returns a pointer value for the float32 value passed in.\nfunc Float32(v float32) *float32 {\n\treturn ptr.Float32(v)\n}\n\n// Float32Slice returns a slice of float32 pointers from the values\n// passed in.\nfunc Float32Slice(vs []float32) []*float32 {\n\treturn ptr.Float32Slice(vs)\n}\n\n// Float32Map returns a map of float32 pointers from the values\n// passed in.\nfunc Float32Map(vs map[string]float32) map[string]*float32 {\n\treturn ptr.Float32Map(vs)\n}\n\n// Float64 returns a pointer value for the float64 value passed in.\nfunc Float64(v float64) *float64 {\n\treturn ptr.Float64(v)\n}\n\n// Float64Slice returns a slice of float64 pointers from the values\n// passed in.\nfunc Float64Slice(vs []float64) []*float64 {\n\treturn ptr.Float64Slice(vs)\n}\n\n// Float64Map returns a map of float64 pointers from the values\n// passed in.\nfunc Float64Map(vs map[string]float64) map[string]*float64 {\n\treturn ptr.Float64Map(vs)\n}\n\n// Time returns a pointer value for the time.Time value passed in.\nfunc Time(v time.Time) *time.Time {\n\treturn ptr.Time(v)\n}\n\n// TimeSlice returns a slice of time.Time pointers from the values\n// passed in.\nfunc TimeSlice(vs []time.Time) []*time.Time {\n\treturn ptr.TimeSlice(vs)\n}\n\n// TimeMap returns a map of time.Time pointers from the values\n// passed in.\nfunc TimeMap(vs map[string]time.Time) map[string]*time.Time {\n\treturn ptr.TimeMap(vs)\n}\n\n// Duration returns a pointer value for the time.Duration value passed in.\nfunc Duration(v time.Duration) *time.Duration {\n\treturn ptr.Duration(v)\n}\n\n// DurationSlice returns a slice of time.Duration pointers from the values\n// passed in.\nfunc DurationSlice(vs []time.Duration) []*time.Duration {\n\treturn ptr.DurationSlice(vs)\n}\n\n// DurationMap returns a map of time.Duration pointers from the values\n// passed in.\nfunc DurationMap(vs map[string]time.Duration) map[string]*time.Duration {\n\treturn ptr.DurationMap(vs)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go",
    "content": "package http\n\nimport (\n\t\"crypto/tls\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"net\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Defaults for the HTTPTransportBuilder.\nvar (\n\t// Default connection pool options\n\tDefaultHTTPTransportMaxIdleConns        = 100\n\tDefaultHTTPTransportMaxIdleConnsPerHost = 10\n\n\t// Default connection timeouts\n\tDefaultHTTPTransportIdleConnTimeout       = 90 * time.Second\n\tDefaultHTTPTransportTLSHandleshakeTimeout = 10 * time.Second\n\tDefaultHTTPTransportExpectContinueTimeout = 1 * time.Second\n\n\t// Default to TLS 1.2 for all HTTPS requests.\n\tDefaultHTTPTransportTLSMinVersion uint16 = tls.VersionTLS12\n)\n\n// Timeouts for net.Dialer's network connection.\nvar (\n\tDefaultDialConnectTimeout   = 30 * time.Second\n\tDefaultDialKeepAliveTimeout = 30 * time.Second\n)\n\n// BuildableClient provides a HTTPClient implementation with options to\n// create copies of the HTTPClient when additional configuration is provided.\n//\n// The client's methods will not share the http.Transport value between copies\n// of the BuildableClient. Only exported member values of the Transport and\n// optional Dialer will be copied between copies of BuildableClient.\ntype BuildableClient struct {\n\ttransport *http.Transport\n\tdialer    *net.Dialer\n\n\tinitOnce sync.Once\n\n\tclientTimeout time.Duration\n\tclient        *http.Client\n}\n\n// NewBuildableClient returns an initialized client for invoking HTTP\n// requests.\nfunc NewBuildableClient() *BuildableClient {\n\treturn &BuildableClient{}\n}\n\n// Do implements the HTTPClient interface's Do method to invoke a HTTP request,\n// and receive the response. Uses the BuildableClient's current\n// configuration to invoke the http.Request.\n//\n// If connection pooling is enabled (aka HTTP KeepAlive) the client will only\n// share pooled connections with its own instance. Copies of the\n// BuildableClient will have their own connection pools.\n//\n// Redirect (3xx) responses will not be followed, the HTTP response received\n// will returned instead.\nfunc (b *BuildableClient) Do(req *http.Request) (*http.Response, error) {\n\tb.initOnce.Do(b.build)\n\n\treturn b.client.Do(req)\n}\n\n// Freeze returns a frozen aws.HTTPClient implementation that is no longer a BuildableClient.\n// Use this to prevent the SDK from applying DefaultMode configuration values to a buildable client.\nfunc (b *BuildableClient) Freeze() aws.HTTPClient {\n\tcpy := b.clone()\n\tcpy.build()\n\treturn cpy.client\n}\n\nfunc (b *BuildableClient) build() {\n\tb.client = wrapWithLimitedRedirect(&http.Client{\n\t\tTimeout:   b.clientTimeout,\n\t\tTransport: b.GetTransport(),\n\t})\n}\n\nfunc (b *BuildableClient) clone() *BuildableClient {\n\tcpy := NewBuildableClient()\n\tcpy.transport = b.GetTransport()\n\tcpy.dialer = b.GetDialer()\n\tcpy.clientTimeout = b.clientTimeout\n\n\treturn cpy\n}\n\n// WithTransportOptions copies the BuildableClient and returns it with the\n// http.Transport options applied.\n//\n// If a non (*http.Transport) was set as the round tripper, the round tripper\n// will be replaced with a default Transport value before invoking the option\n// functions.\nfunc (b *BuildableClient) WithTransportOptions(opts ...func(*http.Transport)) *BuildableClient {\n\tcpy := b.clone()\n\n\ttr := cpy.GetTransport()\n\tfor _, opt := range opts {\n\t\topt(tr)\n\t}\n\tcpy.transport = tr\n\n\treturn cpy\n}\n\n// WithDialerOptions copies the BuildableClient and returns it with the\n// net.Dialer options applied. Will set the client's http.Transport DialContext\n// member.\nfunc (b *BuildableClient) WithDialerOptions(opts ...func(*net.Dialer)) *BuildableClient {\n\tcpy := b.clone()\n\n\tdialer := cpy.GetDialer()\n\tfor _, opt := range opts {\n\t\topt(dialer)\n\t}\n\tcpy.dialer = dialer\n\n\ttr := cpy.GetTransport()\n\ttr.DialContext = cpy.dialer.DialContext\n\tcpy.transport = tr\n\n\treturn cpy\n}\n\n// WithTimeout Sets the timeout used by the client for all requests.\nfunc (b *BuildableClient) WithTimeout(timeout time.Duration) *BuildableClient {\n\tcpy := b.clone()\n\tcpy.clientTimeout = timeout\n\treturn cpy\n}\n\n// GetTransport returns a copy of the client's HTTP Transport.\nfunc (b *BuildableClient) GetTransport() *http.Transport {\n\tvar tr *http.Transport\n\tif b.transport != nil {\n\t\ttr = b.transport.Clone()\n\t} else {\n\t\ttr = defaultHTTPTransport()\n\t}\n\n\treturn tr\n}\n\n// GetDialer returns a copy of the client's network dialer.\nfunc (b *BuildableClient) GetDialer() *net.Dialer {\n\tvar dialer *net.Dialer\n\tif b.dialer != nil {\n\t\tdialer = shallowCopyStruct(b.dialer).(*net.Dialer)\n\t} else {\n\t\tdialer = defaultDialer()\n\t}\n\n\treturn dialer\n}\n\n// GetTimeout returns a copy of the client's timeout to cancel requests with.\nfunc (b *BuildableClient) GetTimeout() time.Duration {\n\treturn b.clientTimeout\n}\n\nfunc defaultDialer() *net.Dialer {\n\treturn &net.Dialer{\n\t\tTimeout:   DefaultDialConnectTimeout,\n\t\tKeepAlive: DefaultDialKeepAliveTimeout,\n\t\tDualStack: true,\n\t}\n}\n\nfunc defaultHTTPTransport() *http.Transport {\n\tdialer := defaultDialer()\n\n\ttr := &http.Transport{\n\t\tProxy:                 http.ProxyFromEnvironment,\n\t\tDialContext:           dialer.DialContext,\n\t\tTLSHandshakeTimeout:   DefaultHTTPTransportTLSHandleshakeTimeout,\n\t\tMaxIdleConns:          DefaultHTTPTransportMaxIdleConns,\n\t\tMaxIdleConnsPerHost:   DefaultHTTPTransportMaxIdleConnsPerHost,\n\t\tIdleConnTimeout:       DefaultHTTPTransportIdleConnTimeout,\n\t\tExpectContinueTimeout: DefaultHTTPTransportExpectContinueTimeout,\n\t\tForceAttemptHTTP2:     true,\n\t\tTLSClientConfig: &tls.Config{\n\t\t\tMinVersion: DefaultHTTPTransportTLSMinVersion,\n\t\t},\n\t}\n\n\treturn tr\n}\n\n// shallowCopyStruct creates a shallow copy of the passed in source struct, and\n// returns that copy of the same struct type.\nfunc shallowCopyStruct(src interface{}) interface{} {\n\tsrcVal := reflect.ValueOf(src)\n\tsrcValType := srcVal.Type()\n\n\tvar returnAsPtr bool\n\tif srcValType.Kind() == reflect.Ptr {\n\t\tsrcVal = srcVal.Elem()\n\t\tsrcValType = srcValType.Elem()\n\t\treturnAsPtr = true\n\t}\n\tdstVal := reflect.New(srcValType).Elem()\n\n\tfor i := 0; i < srcValType.NumField(); i++ {\n\t\tft := srcValType.Field(i)\n\t\tif len(ft.PkgPath) != 0 {\n\t\t\t// unexported fields have a PkgPath\n\t\t\tcontinue\n\t\t}\n\n\t\tdstVal.Field(i).Set(srcVal.Field(i))\n\t}\n\n\tif returnAsPtr {\n\t\tdstVal = dstVal.Addr()\n\t}\n\n\treturn dstVal.Interface()\n}\n\n// wrapWithLimitedRedirect updates the Client's Transport and CheckRedirect to\n// not follow any redirect other than 307 and 308. No other redirect will be\n// followed.\n//\n// If the client does not have a Transport defined will use a new SDK default\n// http.Transport configuration.\nfunc wrapWithLimitedRedirect(c *http.Client) *http.Client {\n\ttr := c.Transport\n\tif tr == nil {\n\t\ttr = defaultHTTPTransport()\n\t}\n\n\tcc := *c\n\tcc.CheckRedirect = limitedRedirect\n\tcc.Transport = suppressBadHTTPRedirectTransport{\n\t\ttr: tr,\n\t}\n\n\treturn &cc\n}\n\n// limitedRedirect is a CheckRedirect that prevents the client from following\n// any non 307/308 HTTP status code redirects.\n//\n// The 307 and 308 redirects are allowed because the client must use the\n// original HTTP method for the redirected to location. Whereas 301 and 302\n// allow the client to switch to GET for the redirect.\n//\n// Suppresses all redirect requests with a URL of badHTTPRedirectLocation.\nfunc limitedRedirect(r *http.Request, via []*http.Request) error {\n\t// Request.Response, in CheckRedirect is the response that is triggering\n\t// the redirect.\n\tresp := r.Response\n\tif r.URL.String() == badHTTPRedirectLocation {\n\t\tresp.Header.Del(badHTTPRedirectLocation)\n\t\treturn http.ErrUseLastResponse\n\t}\n\n\tswitch resp.StatusCode {\n\tcase 307, 308:\n\t\t// Only allow 307 and 308 redirects as they preserve the method.\n\t\treturn nil\n\t}\n\n\treturn http.ErrUseLastResponse\n}\n\n// suppressBadHTTPRedirectTransport provides an http.RoundTripper\n// implementation that wraps another http.RoundTripper to prevent HTTP client\n// receiving 301 and 302 HTTP responses redirects without the required location\n// header.\n//\n// Clients using this utility must have a CheckRedirect, e.g. limitedRedirect,\n// that check for responses with having a URL of baseHTTPRedirectLocation, and\n// suppress the redirect.\ntype suppressBadHTTPRedirectTransport struct {\n\ttr http.RoundTripper\n}\n\nconst badHTTPRedirectLocation = `https://amazonaws.com/badhttpredirectlocation`\n\n// RoundTrip backfills a stub location when a 301/302 response is received\n// without a location. This stub location is used by limitedRedirect to prevent\n// the HTTP client from failing attempting to use follow a redirect without a\n// location value.\nfunc (t suppressBadHTTPRedirectTransport) RoundTrip(r *http.Request) (*http.Response, error) {\n\tresp, err := t.tr.RoundTrip(r)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\t// S3 is the only known service to return 301 without location header.\n\t// The Go standard library HTTP client will return an opaque error if it\n\t// tries to follow a 301/302 response missing the location header.\n\tswitch resp.StatusCode {\n\tcase 301, 302:\n\t\tif v := resp.Header.Get(\"Location\"); len(v) == 0 {\n\t\t\tresp.Header.Set(\"Location\", badHTTPRedirectLocation)\n\t\t}\n\t}\n\n\treturn resp, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// removeContentTypeHeader is a build middleware that removes\n// content type header if content-length header is unset or\n// is set to zero,\ntype removeContentTypeHeader struct {\n}\n\n// ID the name of the middleware.\nfunc (m *removeContentTypeHeader) ID() string {\n\treturn \"RemoveContentTypeHeader\"\n}\n\n// HandleBuild adds or appends the constructed user agent to the request.\nfunc (m *removeContentTypeHeader) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in)\n\t}\n\n\t// remove contentTypeHeader when content-length is zero\n\tif req.ContentLength == 0 {\n\t\treq.Header.Del(\"content-type\")\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n\n// RemoveContentTypeHeader removes content-type header if\n// content length is unset or equal to zero.\nfunc RemoveContentTypeHeader(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&removeContentTypeHeader{}, middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.go",
    "content": "package http\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ResponseError provides the HTTP centric error type wrapping the underlying error\n// with the HTTP response value and the deserialized RequestID.\ntype ResponseError struct {\n\t*smithyhttp.ResponseError\n\n\t// RequestID associated with response error\n\tRequestID string\n}\n\n// ServiceRequestID returns the request id associated with Response Error\nfunc (e *ResponseError) ServiceRequestID() string { return e.RequestID }\n\n// Error returns the formatted error\nfunc (e *ResponseError) Error() string {\n\treturn fmt.Sprintf(\n\t\t\"https response error StatusCode: %d, RequestID: %s, %v\",\n\t\te.Response.StatusCode, e.RequestID, e.Err)\n}\n\n// As populates target and returns true if the type of target is a error type that\n// the ResponseError embeds, (e.g.AWS HTTP ResponseError)\nfunc (e *ResponseError) As(target interface{}) bool {\n\treturn errors.As(e.ResponseError, target)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// AddResponseErrorMiddleware adds response error wrapper middleware\nfunc AddResponseErrorMiddleware(stack *middleware.Stack) error {\n\t// add error wrapper middleware before request id retriever middleware so that it can wrap the error response\n\t// returned by operation deserializers\n\treturn stack.Deserialize.Insert(&ResponseErrorWrapper{}, \"RequestIDRetriever\", middleware.Before)\n}\n\n// ResponseErrorWrapper wraps operation errors with ResponseError.\ntype ResponseErrorWrapper struct {\n}\n\n// ID returns the middleware identifier\nfunc (m *ResponseErrorWrapper) ID() string {\n\treturn \"ResponseErrorWrapper\"\n}\n\n// HandleDeserialize wraps the stack error with smithyhttp.ResponseError.\nfunc (m *ResponseErrorWrapper) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err == nil {\n\t\t// Nothing to do when there is no error.\n\t\treturn out, metadata, err\n\t}\n\n\tresp, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\t// No raw response to wrap with.\n\t\treturn out, metadata, err\n\t}\n\n\t// look for request id in metadata\n\treqID, _ := awsmiddleware.GetRequestIDMetadata(metadata)\n\n\t// Wrap the returned smithy error with the request id retrieved from the metadata\n\terr = &ResponseError{\n\t\tResponseError: &smithyhttp.ResponseError{\n\t\t\tResponse: resp,\n\t\t\tErr:      err,\n\t\t},\n\t\tRequestID: reqID,\n\t}\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\ntype readResult struct {\n\tn   int\n\terr error\n}\n\n// ResponseTimeoutError is an error when the reads from the response are\n// delayed longer than the timeout the read was configured for.\ntype ResponseTimeoutError struct {\n\tTimeoutDur time.Duration\n}\n\n// Timeout returns that the error is was caused by a timeout, and can be\n// retried.\nfunc (*ResponseTimeoutError) Timeout() bool { return true }\n\nfunc (e *ResponseTimeoutError) Error() string {\n\treturn fmt.Sprintf(\"read on body reach timeout limit, %v\", e.TimeoutDur)\n}\n\n// timeoutReadCloser will handle body reads that take too long.\n// We will return a ErrReadTimeout error if a timeout occurs.\ntype timeoutReadCloser struct {\n\treader   io.ReadCloser\n\tduration time.Duration\n}\n\n// Read will spin off a goroutine to call the reader's Read method. We will\n// select on the timer's channel or the read's channel. Whoever completes first\n// will be returned.\nfunc (r *timeoutReadCloser) Read(b []byte) (int, error) {\n\ttimer := time.NewTimer(r.duration)\n\tc := make(chan readResult, 1)\n\n\tgo func() {\n\t\tn, err := r.reader.Read(b)\n\t\ttimer.Stop()\n\t\tc <- readResult{n: n, err: err}\n\t}()\n\n\tselect {\n\tcase data := <-c:\n\t\treturn data.n, data.err\n\tcase <-timer.C:\n\t\treturn 0, &ResponseTimeoutError{TimeoutDur: r.duration}\n\t}\n}\n\nfunc (r *timeoutReadCloser) Close() error {\n\treturn r.reader.Close()\n}\n\n// AddResponseReadTimeoutMiddleware adds a middleware to the stack that wraps the\n// response body so that a read that takes too long will return an error.\nfunc AddResponseReadTimeoutMiddleware(stack *middleware.Stack, duration time.Duration) error {\n\treturn stack.Deserialize.Add(&readTimeout{duration: duration}, middleware.After)\n}\n\n// readTimeout wraps the response body with a timeoutReadCloser\ntype readTimeout struct {\n\tduration time.Duration\n}\n\n// ID returns the id of the middleware\nfunc (*readTimeout) ID() string {\n\treturn \"ReadResponseTimeout\"\n}\n\n// HandleDeserialize implements the DeserializeMiddleware interface\nfunc (m *readTimeout) HandleDeserialize(\n\tctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tresponse.Body = &timeoutReadCloser{\n\t\treader:   response.Body,\n\t\tduration: m.duration,\n\t}\n\tout.RawResponse = response\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/types.go",
    "content": "package aws\n\nimport (\n\t\"fmt\"\n)\n\n// Ternary is an enum allowing an unknown or none state in addition to a bool's\n// true and false.\ntype Ternary int\n\nfunc (t Ternary) String() string {\n\tswitch t {\n\tcase UnknownTernary:\n\t\treturn \"unknown\"\n\tcase FalseTernary:\n\t\treturn \"false\"\n\tcase TrueTernary:\n\t\treturn \"true\"\n\tdefault:\n\t\treturn fmt.Sprintf(\"unknown value, %d\", int(t))\n\t}\n}\n\n// Bool returns true if the value is TrueTernary, false otherwise.\nfunc (t Ternary) Bool() bool {\n\treturn t == TrueTernary\n}\n\n// Enumerations for the values of the Ternary type.\nconst (\n\tUnknownTernary Ternary = iota\n\tFalseTernary\n\tTrueTernary\n)\n\n// BoolTernary returns a true or false Ternary value for the bool provided.\nfunc BoolTernary(v bool) Ternary {\n\tif v {\n\t\treturn TrueTernary\n\t}\n\treturn FalseTernary\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/aws/version.go",
    "content": "// Package aws provides core functionality for making requests to AWS services.\npackage aws\n\n// SDKName is the name of this AWS SDK\nconst SDKName = \"aws-sdk-go-v2\"\n\n// SDKVersion is the version of this SDK\nconst SDKVersion = goModuleVersion\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md",
    "content": "# v1.27.27 (2024-07-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.26 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.25 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.24 (2024-07-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.23 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.22 (2024-06-26)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.21 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.20 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.19 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.18 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.17 (2024-06-03)\n\n* **Documentation**: Add deprecation docs to global endpoint resolution interfaces. These APIs were previously deprecated with the introduction of service-specific endpoint resolution (EndpointResolverV2 and BaseEndpoint on service client options).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.16 (2024-05-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.15 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.14 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.13 (2024-05-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.12 (2024-05-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.11 (2024-04-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.10 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.9 (2024-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.8 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.7 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.6 (2024-03-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.5 (2024-03-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.4 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.3 (2024-02-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.2 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.1 (2024-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.6 (2024-01-22)\n\n* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.5 (2024-01-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.4 (2024-01-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.3 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.2 (2023-12-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.1 (2023-12-08)\n\n* **Bug Fix**: Correct loading of [services *] sections into shared config.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.0 (2023-12-07)\n\n* **Feature**: Support modeled request compression. The only algorithm supported at this time is `gzip`.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.12 (2023-12-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.11 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.10 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.9 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.8 (2023-11-28.3)\n\n* **Bug Fix**: Correct resolution of S3Express auth disable toggle.\n\n# v1.25.7 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.6 (2023-11-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.5 (2023-11-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.4 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.3 (2023-11-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.2 (2023-11-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.1 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.0 (2023-11-14)\n\n* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.0 (2023-11-13)\n\n* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.0 (2023-11-09.2)\n\n* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.3 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.2 (2023-11-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.1 (2023-11-06)\n\n* No change notes available for this release.\n\n# v1.22.0 (2023-11-02)\n\n* **Feature**: Add env and shared config settings for disabling IMDSv1 fallback.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.1 (2023-10-24)\n\n* No change notes available for this release.\n\n# v1.19.0 (2023-10-16)\n\n* **Feature**: Modify logic of retrieving user agent appID from env config\n\n# v1.18.45 (2023-10-12)\n\n* **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.44 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.43 (2023-10-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.42 (2023-09-22)\n\n* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0.\n* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.41 (2023-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.40 (2023-09-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.39 (2023-09-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.38 (2023-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.37 (2023-08-23)\n\n* No change notes available for this release.\n\n# v1.18.36 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.35 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.34 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.33 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.32 (2023-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.31 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.30 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.29 (2023-07-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.28 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.27 (2023-06-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.26 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.25 (2023-05-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.24 (2023-05-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.23 (2023-05-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.22 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.21 (2023-04-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.20 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.19 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.18 (2023-03-16)\n\n* **Bug Fix**: Allow RoleARN to be set as functional option on STS WebIdentityRoleOptions. Fixes aws/aws-sdk-go-v2#2015.\n\n# v1.18.17 (2023-03-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.16 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.15 (2023-02-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.14 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.13 (2023-02-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.12 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.11 (2023-02-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.10 (2023-01-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.9 (2023-01-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.8 (2023-01-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.7 (2022-12-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.6 (2022-12-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.5 (2022-12-15)\n\n* **Bug Fix**: Unify logic between shared config and in finding home directory\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.4 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.3 (2022-11-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.2 (2022-11-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.1 (2022-11-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.0 (2022-11-11)\n\n* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846\n* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.11 (2022-11-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.10 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.9 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.8 (2022-09-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.7 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.6 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.5 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.4 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.3 (2022-08-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.2 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.1 (2022-08-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2022-08-14)\n\n* **Feature**: Add alternative mechanism for determning the users `$HOME` or `%USERPROFILE%` location when the environment variables are not present.\n\n# v1.16.1 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2022-08-10)\n\n* **Feature**: Adds support for the following settings in the `~/.aws/credentials` file: `sso_account_id`, `sso_region`, `sso_role_name`, `sso_start_url`, and `ca_bundle`.\n\n# v1.15.17 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.16 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.15 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.14 (2022-07-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.13 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.12 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.11 (2022-06-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.10 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.9 (2022-05-26)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.8 (2022-05-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.7 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.6 (2022-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.5 (2022-05-09)\n\n* **Bug Fix**: Fixes a bug in LoadDefaultConfig to correctly assign ConfigSources so all config resolvers have access to the config sources. This fixes the feature/ec2/imds client not having configuration applied via config.LoadOptions such as EC2IMDSClientEnableState. PR [#1682](https://github.com/aws/aws-sdk-go-v2/pull/1682)\n\n# v1.15.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2022-02-24)\n\n* **Feature**: Adds support for loading RetryMaxAttempts and RetryMod from the environment and shared configuration files. These parameters drive how the SDK's API client will initialize its default retryer, if custome retryer has not been specified. See [config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config) module and [aws.Config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config) for more information about and how to use these new options.\n* **Feature**: Adds support for the `ca_bundle` parameter in shared config and credentials files. The usage of the file is the same as environment variable, `AWS_CA_BUNDLE`, but sourced from shared config. Fixes [#1589](https://github.com/aws/aws-sdk-go-v2/issues/1589)\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2022-01-28)\n\n* **Bug Fix**: Fixes LoadDefaultConfig handling of errors returned by passed in functional options. Previously errors returned from the LoadOptions passed into LoadDefaultConfig were incorrectly ignored. [#1562](https://github.com/aws/aws-sdk-go-v2/pull/1562). Thanks to [Pinglei Guo](https://github.com/pingleig) for submitting this PR.\n* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug.\n* **Bug Fix**: Updates `config` module to use os.UserHomeDir instead of hard coded environment variable for OS. [#1563](https://github.com/aws/aws-sdk-go-v2/pull/1563)\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2022-01-07)\n\n* **Feature**: Add load option for CredentialCache. Adds a new member to the LoadOptions struct, CredentialsCacheOptions. This member allows specifying a function that will be used to configure the CredentialsCache. The CredentialsCacheOptions will only be used if the configuration loader will wrap the underlying credential provider in the CredentialsCache.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.1 (2021-12-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2021-12-02)\n\n* **Feature**: Add support for specifying `EndpointResolverWithOptions` on `LoadOptions`, and associated `WithEndpointResolverWithOptions`.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.3 (2021-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.2 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.1 (2021-11-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.3 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.2 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.1 (2021-09-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-09-02)\n\n* **Feature**: Add support for S3 Multi-Region Access Point ARNs.\n\n# v1.7.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.1 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-08-04)\n\n* **Feature**: adds error handling for defered close calls\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-07-15)\n\n* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints.\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-07-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-06-25)\n\n* **Feature**: Adds configuration setting for enabling endpoint discovery.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-05-20)\n\n* **Feature**: SSO credentials can now be defined alongside other credential providers within the same configuration profile.\n* **Bug Fix**: Profile names were incorrectly normalized to lower-case, which could result in unexpected profile configurations.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/config.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// defaultAWSConfigResolvers are a slice of functions that will resolve external\n// configuration values into AWS configuration values.\n//\n// This will setup the AWS configuration's Region,\nvar defaultAWSConfigResolvers = []awsConfigResolver{\n\t// Resolves the default configuration the SDK's aws.Config will be\n\t// initialized with.\n\tresolveDefaultAWSConfig,\n\n\t// Sets the logger to be used. Could be user provided logger, and client\n\t// logging mode.\n\tresolveLogger,\n\tresolveClientLogMode,\n\n\t// Sets the HTTP client and configuration to use for making requests using\n\t// the HTTP transport.\n\tresolveHTTPClient,\n\tresolveCustomCABundle,\n\n\t// Sets the endpoint resolving behavior the API Clients will use for making\n\t// requests to. Clients default to their own clients this allows overrides\n\t// to be specified. The resolveEndpointResolver option is deprecated, but\n\t// we still need to set it for backwards compatibility on config\n\t// construction.\n\tresolveEndpointResolver,\n\tresolveEndpointResolverWithOptions,\n\n\t// Sets the retry behavior API clients will use within their retry attempt\n\t// middleware. Defaults to unset, allowing API clients to define their own\n\t// retry behavior.\n\tresolveRetryer,\n\n\t// Sets the region the API Clients should use for making requests to.\n\tresolveRegion,\n\tresolveEC2IMDSRegion,\n\tresolveDefaultRegion,\n\n\t// Sets the additional set of middleware stack mutators that will custom\n\t// API client request pipeline middleware.\n\tresolveAPIOptions,\n\n\t// Resolves the DefaultsMode that should be used by SDK clients. If this\n\t// mode is set to DefaultsModeAuto.\n\t//\n\t// Comes after HTTPClient and CustomCABundle to ensure the HTTP client is\n\t// configured if provided before invoking IMDS if mode is auto. Comes\n\t// before resolving credentials so that those subsequent clients use the\n\t// configured auto mode.\n\tresolveDefaultsModeOptions,\n\n\t// Sets the resolved credentials the API clients will use for\n\t// authentication. Provides the SDK's default credential chain.\n\t//\n\t// Should probably be the last step in the resolve chain to ensure that all\n\t// other configurations are resolved first in case downstream credentials\n\t// implementations depend on or can be configured with earlier resolved\n\t// configuration options.\n\tresolveCredentials,\n\n\t// Sets the resolved bearer authentication token API clients will use for\n\t// httpBearerAuth authentication scheme.\n\tresolveBearerAuthToken,\n\n\t// Sets the sdk app ID if present in env var or shared config profile\n\tresolveAppID,\n\n\tresolveBaseEndpoint,\n\n\t// Sets the DisableRequestCompression if present in env var or shared config profile\n\tresolveDisableRequestCompression,\n\n\t// Sets the RequestMinCompressSizeBytes if present in env var or shared config profile\n\tresolveRequestMinCompressSizeBytes,\n\n\t// Sets the AccountIDEndpointMode if present in env var or shared config profile\n\tresolveAccountIDEndpointMode,\n}\n\n// A Config represents a generic configuration value or set of values. This type\n// will be used by the AWSConfigResolvers to extract\n//\n// General the Config type will use type assertion against the Provider interfaces\n// to extract specific data from the Config.\ntype Config interface{}\n\n// A loader is used to load external configuration data and returns it as\n// a generic Config type.\n//\n// The loader should return an error if it fails to load the external configuration\n// or the configuration data is malformed, or required components missing.\ntype loader func(context.Context, configs) (Config, error)\n\n// An awsConfigResolver will extract configuration data from the configs slice\n// using the provider interfaces to extract specific functionality. The extracted\n// configuration values will be written to the AWS Config value.\n//\n// The resolver should return an error if it it fails to extract the data, the\n// data is malformed, or incomplete.\ntype awsConfigResolver func(ctx context.Context, cfg *aws.Config, configs configs) error\n\n// configs is a slice of Config values. These values will be used by the\n// AWSConfigResolvers to extract external configuration values to populate the\n// AWS Config type.\n//\n// Use AppendFromLoaders to add additional external Config values that are\n// loaded from external sources.\n//\n// Use ResolveAWSConfig after external Config values have been added or loaded\n// to extract the loaded configuration values into the AWS Config.\ntype configs []Config\n\n// AppendFromLoaders iterates over the slice of loaders passed in calling each\n// loader function in order. The external config value returned by the loader\n// will be added to the returned configs slice.\n//\n// If a loader returns an error this method will stop iterating and return\n// that error.\nfunc (cs configs) AppendFromLoaders(ctx context.Context, loaders []loader) (configs, error) {\n\tfor _, fn := range loaders {\n\t\tcfg, err := fn(ctx, cs)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcs = append(cs, cfg)\n\t}\n\n\treturn cs, nil\n}\n\n// ResolveAWSConfig returns a AWS configuration populated with values by calling\n// the resolvers slice passed in. Each resolver is called in order. Any resolver\n// may overwrite the AWS Configuration value of a previous resolver.\n//\n// If an resolver returns an error this method will return that error, and stop\n// iterating over the resolvers.\nfunc (cs configs) ResolveAWSConfig(ctx context.Context, resolvers []awsConfigResolver) (aws.Config, error) {\n\tvar cfg aws.Config\n\n\tfor _, fn := range resolvers {\n\t\tif err := fn(ctx, &cfg, cs); err != nil {\n\t\t\treturn aws.Config{}, err\n\t\t}\n\t}\n\n\treturn cfg, nil\n}\n\n// ResolveConfig calls the provide function passing slice of configuration sources.\n// This implements the aws.ConfigResolver interface.\nfunc (cs configs) ResolveConfig(f func(configs []interface{}) error) error {\n\tvar cfgs []interface{}\n\tfor i := range cs {\n\t\tcfgs = append(cfgs, cs[i])\n\t}\n\treturn f(cfgs)\n}\n\n// LoadDefaultConfig reads the SDK's default external configurations, and\n// populates an AWS Config with the values from the external configurations.\n//\n// An optional variadic set of additional Config values can be provided as input\n// that will be prepended to the configs slice. Use this to add custom configuration.\n// The custom configurations must satisfy the respective providers for their data\n// or the custom data will be ignored by the resolvers and config loaders.\n//\n//\tcfg, err := config.LoadDefaultConfig( context.TODO(),\n//\t   config.WithSharedConfigProfile(\"test-profile\"),\n//\t)\n//\tif err != nil {\n//\t   panic(fmt.Sprintf(\"failed loading config, %v\", err))\n//\t}\n//\n// The default configuration sources are:\n// * Environment Variables\n// * Shared Configuration and Shared Credentials files.\nfunc LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) {\n\tvar options LoadOptions\n\tfor _, optFn := range optFns {\n\t\tif err := optFn(&options); err != nil {\n\t\t\treturn aws.Config{}, err\n\t\t}\n\t}\n\n\t// assign Load Options to configs\n\tvar cfgCpy = configs{options}\n\n\tcfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options))\n\tif err != nil {\n\t\treturn aws.Config{}, err\n\t}\n\n\tcfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers)\n\tif err != nil {\n\t\treturn aws.Config{}, err\n\t}\n\n\treturn cfg, nil\n}\n\nfunc resolveConfigLoaders(options *LoadOptions) []loader {\n\tloaders := make([]loader, 2)\n\tloaders[0] = loadEnvConfig\n\n\t// specification of a profile should cause a load failure if it doesn't exist\n\tif os.Getenv(awsProfileEnvVar) != \"\" || options.SharedConfigProfile != \"\" {\n\t\tloaders[1] = loadSharedConfig\n\t} else {\n\t\tloaders[1] = loadSharedConfigIgnoreNotExist\n\t}\n\n\treturn loaders\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n)\n\nconst execEnvVar = \"AWS_EXECUTION_ENV\"\n\n// DefaultsModeOptions is the set of options that are used to configure\ntype DefaultsModeOptions struct {\n\t// The SDK configuration defaults mode. Defaults to legacy if not specified.\n\t//\n\t// Supported modes are: auto, cross-region, in-region, legacy, mobile, standard\n\tMode aws.DefaultsMode\n\n\t// The EC2 Instance Metadata Client that should be used when performing environment\n\t// discovery when aws.DefaultsModeAuto is set.\n\t//\n\t// If not specified the SDK will construct a client if the instance metadata service has not been disabled by\n\t// the AWS_EC2_METADATA_DISABLED environment variable.\n\tIMDSClient *imds.Client\n}\n\nfunc resolveDefaultsModeRuntimeEnvironment(ctx context.Context, envConfig *EnvConfig, client *imds.Client) (aws.RuntimeEnvironment, error) {\n\tgetRegionOutput, err := client.GetRegion(ctx, &imds.GetRegionInput{})\n\t// honor context timeouts, but if we couldn't talk to IMDS don't fail runtime environment introspection.\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn aws.RuntimeEnvironment{}, err\n\tdefault:\n\t}\n\n\tvar imdsRegion string\n\tif err == nil {\n\t\timdsRegion = getRegionOutput.Region\n\t}\n\n\treturn aws.RuntimeEnvironment{\n\t\tEnvironmentIdentifier:     aws.ExecutionEnvironmentID(os.Getenv(execEnvVar)),\n\t\tRegion:                    envConfig.Region,\n\t\tEC2InstanceMetadataRegion: imdsRegion,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/doc.go",
    "content": "// Package config provides utilities for loading configuration from multiple\n// sources that can be used to configure the SDK's API clients, and utilities.\n//\n// The config package will load configuration from environment variables, AWS\n// shared configuration file (~/.aws/config), and AWS shared credentials file\n// (~/.aws/credentials).\n//\n// Use the LoadDefaultConfig to load configuration from all the SDK's supported\n// sources, and resolve credentials using the SDK's default credential chain.\n//\n// LoadDefaultConfig allows for a variadic list of additional Config sources that can\n// provide one or more configuration values which can be used to programmatically control the resolution\n// of a specific value, or allow for broader range of additional configuration sources not supported by the SDK.\n// A Config source implements one or more provider interfaces defined in this package. Config sources passed in will\n// take precedence over the default environment and shared config sources used by the SDK. If one or more Config sources\n// implement the same provider interface, priority will be handled by the order in which the sources were passed in.\n//\n// A number of helpers (prefixed by “With“)  are provided in this package that implement their respective provider\n// interface. These helpers should be used for overriding configuration programmatically at runtime.\npackage config\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go",
    "content": "package config\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\tsmithyrequestcompression \"github.com/aws/smithy-go/private/requestcompression\"\n)\n\n// CredentialsSourceName provides a name of the provider when config is\n// loaded from environment.\nconst CredentialsSourceName = \"EnvConfigCredentials\"\n\n// Environment variables that will be read for configuration values.\nconst (\n\tawsAccessKeyIDEnvVar = \"AWS_ACCESS_KEY_ID\"\n\tawsAccessKeyEnvVar   = \"AWS_ACCESS_KEY\"\n\n\tawsSecretAccessKeyEnvVar = \"AWS_SECRET_ACCESS_KEY\"\n\tawsSecretKeyEnvVar       = \"AWS_SECRET_KEY\"\n\n\tawsSessionTokenEnvVar = \"AWS_SESSION_TOKEN\"\n\n\tawsContainerCredentialsEndpointEnvVar     = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\"\n\tawsContainerCredentialsRelativePathEnvVar = \"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\"\n\tawsContainerPProviderAuthorizationEnvVar  = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\"\n\n\tawsRegionEnvVar        = \"AWS_REGION\"\n\tawsDefaultRegionEnvVar = \"AWS_DEFAULT_REGION\"\n\n\tawsProfileEnvVar        = \"AWS_PROFILE\"\n\tawsDefaultProfileEnvVar = \"AWS_DEFAULT_PROFILE\"\n\n\tawsSharedCredentialsFileEnvVar = \"AWS_SHARED_CREDENTIALS_FILE\"\n\n\tawsConfigFileEnvVar = \"AWS_CONFIG_FILE\"\n\n\tawsCustomCABundleEnvVar = \"AWS_CA_BUNDLE\"\n\n\tawsWebIdentityTokenFilePathEnvVar = \"AWS_WEB_IDENTITY_TOKEN_FILE\"\n\n\tawsRoleARNEnvVar         = \"AWS_ROLE_ARN\"\n\tawsRoleSessionNameEnvVar = \"AWS_ROLE_SESSION_NAME\"\n\n\tawsEnableEndpointDiscoveryEnvVar = \"AWS_ENABLE_ENDPOINT_DISCOVERY\"\n\n\tawsS3UseARNRegionEnvVar = \"AWS_S3_USE_ARN_REGION\"\n\n\tawsEc2MetadataServiceEndpointModeEnvVar = \"AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE\"\n\n\tawsEc2MetadataServiceEndpointEnvVar = \"AWS_EC2_METADATA_SERVICE_ENDPOINT\"\n\n\tawsEc2MetadataDisabled         = \"AWS_EC2_METADATA_DISABLED\"\n\tawsEc2MetadataV1DisabledEnvVar = \"AWS_EC2_METADATA_V1_DISABLED\"\n\n\tawsS3DisableMultiRegionAccessPointEnvVar = \"AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS\"\n\n\tawsUseDualStackEndpoint = \"AWS_USE_DUALSTACK_ENDPOINT\"\n\n\tawsUseFIPSEndpoint = \"AWS_USE_FIPS_ENDPOINT\"\n\n\tawsDefaultMode = \"AWS_DEFAULTS_MODE\"\n\n\tawsRetryMaxAttempts = \"AWS_MAX_ATTEMPTS\"\n\tawsRetryMode        = \"AWS_RETRY_MODE\"\n\tawsSdkAppID         = \"AWS_SDK_UA_APP_ID\"\n\n\tawsIgnoreConfiguredEndpoints = \"AWS_IGNORE_CONFIGURED_ENDPOINT_URLS\"\n\tawsEndpointURL               = \"AWS_ENDPOINT_URL\"\n\n\tawsDisableRequestCompression      = \"AWS_DISABLE_REQUEST_COMPRESSION\"\n\tawsRequestMinCompressionSizeBytes = \"AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES\"\n\n\tawsS3DisableExpressSessionAuthEnv = \"AWS_S3_DISABLE_EXPRESS_SESSION_AUTH\"\n\n\tawsAccountIDEnv             = \"AWS_ACCOUNT_ID\"\n\tawsAccountIDEndpointModeEnv = \"AWS_ACCOUNT_ID_ENDPOINT_MODE\"\n)\n\nvar (\n\tcredAccessEnvKeys = []string{\n\t\tawsAccessKeyIDEnvVar,\n\t\tawsAccessKeyEnvVar,\n\t}\n\tcredSecretEnvKeys = []string{\n\t\tawsSecretAccessKeyEnvVar,\n\t\tawsSecretKeyEnvVar,\n\t}\n\tregionEnvKeys = []string{\n\t\tawsRegionEnvVar,\n\t\tawsDefaultRegionEnvVar,\n\t}\n\tprofileEnvKeys = []string{\n\t\tawsProfileEnvVar,\n\t\tawsDefaultProfileEnvVar,\n\t}\n)\n\n// EnvConfig is a collection of environment values the SDK will read\n// setup config from. All environment values are optional. But some values\n// such as credentials require multiple values to be complete or the values\n// will be ignored.\ntype EnvConfig struct {\n\t// Environment configuration values. If set both Access Key ID and Secret Access\n\t// Key must be provided. Session Token and optionally also be provided, but is\n\t// not required.\n\t//\n\t//\t# Access Key ID\n\t//\tAWS_ACCESS_KEY_ID=AKID\n\t//\tAWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set.\n\t//\n\t//\t# Secret Access Key\n\t//\tAWS_SECRET_ACCESS_KEY=SECRET\n\t//\tAWS_SECRET_KEY=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set.\n\t//\n\t//\t# Session Token\n\t//\tAWS_SESSION_TOKEN=TOKEN\n\tCredentials aws.Credentials\n\n\t// ContainerCredentialsEndpoint value is the HTTP enabled endpoint to retrieve credentials\n\t// using the endpointcreds.Provider\n\tContainerCredentialsEndpoint string\n\n\t// ContainerCredentialsRelativePath is the relative URI path that will be used when attempting to retrieve\n\t// credentials from the container endpoint.\n\tContainerCredentialsRelativePath string\n\n\t// ContainerAuthorizationToken is the authorization token that will be included in the HTTP Authorization\n\t// header when attempting to retrieve credentials from the container credentials endpoint.\n\tContainerAuthorizationToken string\n\n\t// Region value will instruct the SDK where to make service API requests to. If is\n\t// not provided in the environment the region must be provided before a service\n\t// client request is made.\n\t//\n\t//\tAWS_REGION=us-west-2\n\t//\tAWS_DEFAULT_REGION=us-west-2\n\tRegion string\n\n\t// Profile name the SDK should load use when loading shared configuration from the\n\t// shared configuration files. If not provided \"default\" will be used as the\n\t// profile name.\n\t//\n\t//\tAWS_PROFILE=my_profile\n\t//\tAWS_DEFAULT_PROFILE=my_profile\n\tSharedConfigProfile string\n\n\t// Shared credentials file path can be set to instruct the SDK to use an alternate\n\t// file for the shared credentials. If not set the file will be loaded from\n\t// $HOME/.aws/credentials on Linux/Unix based systems, and\n\t// %USERPROFILE%\\.aws\\credentials on Windows.\n\t//\n\t//\tAWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials\n\tSharedCredentialsFile string\n\n\t// Shared config file path can be set to instruct the SDK to use an alternate\n\t// file for the shared config. If not set the file will be loaded from\n\t// $HOME/.aws/config on Linux/Unix based systems, and\n\t// %USERPROFILE%\\.aws\\config on Windows.\n\t//\n\t//\tAWS_CONFIG_FILE=$HOME/my_shared_config\n\tSharedConfigFile string\n\n\t// Sets the path to a custom Credentials Authority (CA) Bundle PEM file\n\t// that the SDK will use instead of the system's root CA bundle.\n\t// Only use this if you want to configure the SDK to use a custom set\n\t// of CAs.\n\t//\n\t// Enabling this option will attempt to merge the Transport\n\t// into the SDK's HTTP client. If the client's Transport is\n\t// not a http.Transport an error will be returned. If the\n\t// Transport's TLS config is set this option will cause the\n\t// SDK to overwrite the Transport's TLS config's  RootCAs value.\n\t//\n\t// Setting a custom HTTPClient in the aws.Config options will override this setting.\n\t// To use this option and custom HTTP client, the HTTP client needs to be provided\n\t// when creating the config. Not the service client.\n\t//\n\t//  AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle\n\tCustomCABundle string\n\n\t// Enables endpoint discovery via environment variables.\n\t//\n\t//\tAWS_ENABLE_ENDPOINT_DISCOVERY=true\n\tEnableEndpointDiscovery aws.EndpointDiscoveryEnableState\n\n\t// Specifies the WebIdentity token the SDK should use to assume a role\n\t// with.\n\t//\n\t//  AWS_WEB_IDENTITY_TOKEN_FILE=file_path\n\tWebIdentityTokenFilePath string\n\n\t// Specifies the IAM role arn to use when assuming an role.\n\t//\n\t//  AWS_ROLE_ARN=role_arn\n\tRoleARN string\n\n\t// Specifies the IAM role session name to use when assuming a role.\n\t//\n\t//  AWS_ROLE_SESSION_NAME=session_name\n\tRoleSessionName string\n\n\t// Specifies if the S3 service should allow ARNs to direct the region\n\t// the client's requests are sent to.\n\t//\n\t// AWS_S3_USE_ARN_REGION=true\n\tS3UseARNRegion *bool\n\n\t// Specifies if the EC2 IMDS service client is enabled.\n\t//\n\t// AWS_EC2_METADATA_DISABLED=true\n\tEC2IMDSClientEnableState imds.ClientEnableState\n\n\t// Specifies if EC2 IMDSv1 fallback is disabled.\n\t//\n\t// AWS_EC2_METADATA_V1_DISABLED=true\n\tEC2IMDSv1Disabled *bool\n\n\t// Specifies the EC2 Instance Metadata Service default endpoint selection mode (IPv4 or IPv6)\n\t//\n\t// AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE=IPv6\n\tEC2IMDSEndpointMode imds.EndpointModeState\n\n\t// Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EC2IMDSEndpointMode.\n\t//\n\t// AWS_EC2_METADATA_SERVICE_ENDPOINT=http://fd00:ec2::254\n\tEC2IMDSEndpoint string\n\n\t// Specifies if the S3 service should disable multi-region access points\n\t// support.\n\t//\n\t// AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS=true\n\tS3DisableMultiRegionAccessPoints *bool\n\n\t// Specifies that SDK clients must resolve a dual-stack endpoint for\n\t// services.\n\t//\n\t// AWS_USE_DUALSTACK_ENDPOINT=true\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// Specifies that SDK clients must resolve a FIPS endpoint for\n\t// services.\n\t//\n\t// AWS_USE_FIPS_ENDPOINT=true\n\tUseFIPSEndpoint aws.FIPSEndpointState\n\n\t// Specifies the SDK Defaults Mode used by services.\n\t//\n\t// AWS_DEFAULTS_MODE=standard\n\tDefaultsMode aws.DefaultsMode\n\n\t// Specifies the maximum number attempts an API client will call an\n\t// operation that fails with a retryable error.\n\t//\n\t// AWS_MAX_ATTEMPTS=3\n\tRetryMaxAttempts int\n\n\t// Specifies the retry model the API client will be created with.\n\t//\n\t// aws_retry_mode=standard\n\tRetryMode aws.RetryMode\n\n\t// aws sdk app ID that can be added to user agent header string\n\tAppID string\n\n\t// Flag used to disable configured endpoints.\n\tIgnoreConfiguredEndpoints *bool\n\n\t// Value to contain configured endpoints to be propagated to\n\t// corresponding endpoint resolution field.\n\tBaseEndpoint string\n\n\t// determine if request compression is allowed, default to false\n\t// retrieved from env var AWS_DISABLE_REQUEST_COMPRESSION\n\tDisableRequestCompression *bool\n\n\t// inclusive threshold request body size to trigger compression,\n\t// default to 10240 and must be within 0 and 10485760 bytes inclusive\n\t// retrieved from env var AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES\n\tRequestMinCompressSizeBytes *int64\n\n\t// Whether S3Express auth is disabled.\n\t//\n\t// This will NOT prevent requests from being made to S3Express buckets, it\n\t// will only bypass the modified endpoint routing and signing behaviors\n\t// associated with the feature.\n\tS3DisableExpressAuth *bool\n\n\t// Indicates whether account ID will be required/ignored in endpoint2.0 routing\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n}\n\n// loadEnvConfig reads configuration values from the OS's environment variables.\n// Returning the a Config typed EnvConfig to satisfy the ConfigLoader func type.\nfunc loadEnvConfig(ctx context.Context, cfgs configs) (Config, error) {\n\treturn NewEnvConfig()\n}\n\n// NewEnvConfig retrieves the SDK's environment configuration.\n// See `EnvConfig` for the values that will be retrieved.\nfunc NewEnvConfig() (EnvConfig, error) {\n\tvar cfg EnvConfig\n\n\tcreds := aws.Credentials{\n\t\tSource: CredentialsSourceName,\n\t}\n\tsetStringFromEnvVal(&creds.AccessKeyID, credAccessEnvKeys)\n\tsetStringFromEnvVal(&creds.SecretAccessKey, credSecretEnvKeys)\n\tif creds.HasKeys() {\n\t\tcreds.AccountID = os.Getenv(awsAccountIDEnv)\n\t\tcreds.SessionToken = os.Getenv(awsSessionTokenEnvVar)\n\t\tcfg.Credentials = creds\n\t}\n\n\tcfg.ContainerCredentialsEndpoint = os.Getenv(awsContainerCredentialsEndpointEnvVar)\n\tcfg.ContainerCredentialsRelativePath = os.Getenv(awsContainerCredentialsRelativePathEnvVar)\n\tcfg.ContainerAuthorizationToken = os.Getenv(awsContainerPProviderAuthorizationEnvVar)\n\n\tsetStringFromEnvVal(&cfg.Region, regionEnvKeys)\n\tsetStringFromEnvVal(&cfg.SharedConfigProfile, profileEnvKeys)\n\n\tcfg.SharedCredentialsFile = os.Getenv(awsSharedCredentialsFileEnvVar)\n\tcfg.SharedConfigFile = os.Getenv(awsConfigFileEnvVar)\n\n\tcfg.CustomCABundle = os.Getenv(awsCustomCABundleEnvVar)\n\n\tcfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFilePathEnvVar)\n\n\tcfg.RoleARN = os.Getenv(awsRoleARNEnvVar)\n\tcfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvVar)\n\n\tcfg.AppID = os.Getenv(awsSdkAppID)\n\n\tif err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompression}); err != nil {\n\t\treturn cfg, err\n\t}\n\tif err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytes}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setBoolPtrFromEnvVal(&cfg.S3UseARNRegion, []string{awsS3UseARNRegionEnvVar}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tsetEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabled})\n\tif err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnvVar}); err != nil {\n\t\treturn cfg, err\n\t}\n\tcfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnvVar)\n\tif err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnvVar}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointEnvVar}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpoint}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpoint}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultMode}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsRetryMaxAttempts}); err != nil {\n\t\treturn cfg, err\n\t}\n\tif err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryMode}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tsetStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL})\n\n\tif err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setBoolPtrFromEnvVal(&cfg.S3DisableExpressAuth, []string{awsS3DisableExpressSessionAuthEnv}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err := setAIDEndPointModeFromEnvVal(&cfg.AccountIDEndpointMode, []string{awsAccountIDEndpointModeEnv}); err != nil {\n\t\treturn cfg, err\n\t}\n\n\treturn cfg, nil\n}\n\nfunc (c EnvConfig) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) {\n\tif len(c.DefaultsMode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn c.DefaultsMode, true, nil\n}\n\nfunc (c EnvConfig) getAppID(context.Context) (string, bool, error) {\n\treturn c.AppID, len(c.AppID) > 0, nil\n}\n\nfunc (c EnvConfig) getDisableRequestCompression(context.Context) (bool, bool, error) {\n\tif c.DisableRequestCompression == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *c.DisableRequestCompression, true, nil\n}\n\nfunc (c EnvConfig) getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) {\n\tif c.RequestMinCompressSizeBytes == nil {\n\t\treturn 0, false, nil\n\t}\n\treturn *c.RequestMinCompressSizeBytes, true, nil\n}\n\nfunc (c EnvConfig) getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error) {\n\treturn c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil\n}\n\n// GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified,\n// and not 0.\nfunc (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) {\n\tif c.RetryMaxAttempts == 0 {\n\t\treturn 0, false, nil\n\t}\n\treturn c.RetryMaxAttempts, true, nil\n}\n\n// GetRetryMode returns the RetryMode of AWS_RETRY_MODE if was specified, and a\n// valid value.\nfunc (c EnvConfig) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) {\n\tif len(c.RetryMode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn c.RetryMode, true, nil\n}\n\nfunc setEC2IMDSClientEnableState(state *imds.ClientEnableState, keys []string) {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tswitch {\n\t\tcase strings.EqualFold(value, \"true\"):\n\t\t\t*state = imds.ClientDisabled\n\t\tcase strings.EqualFold(value, \"false\"):\n\t\t\t*state = imds.ClientEnabled\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n}\n\nfunc setDefaultsModeFromEnvVal(mode *aws.DefaultsMode, keys []string) error {\n\tfor _, k := range keys {\n\t\tif value := os.Getenv(k); len(value) > 0 {\n\t\t\tif ok := mode.SetFromString(value); !ok {\n\t\t\t\treturn fmt.Errorf(\"invalid %s value: %s\", k, value)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setRetryModeFromEnvVal(mode *aws.RetryMode, keys []string) (err error) {\n\tfor _, k := range keys {\n\t\tif value := os.Getenv(k); len(value) > 0 {\n\t\t\t*mode, err = aws.ParseRetryMode(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid %s value, %w\", k, err)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setEC2IMDSEndpointMode(mode *imds.EndpointModeState, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif err := mode.SetFromString(value); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid value for environment variable, %s=%s, %v\", k, value, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setAIDEndPointModeFromEnvVal(m *aws.AccountIDEndpointMode, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch value {\n\t\tcase \"preferred\":\n\t\t\t*m = aws.AccountIDEndpointModePreferred\n\t\tcase \"required\":\n\t\t\t*m = aws.AccountIDEndpointModeRequired\n\t\tcase \"disabled\":\n\t\t\t*m = aws.AccountIDEndpointModeDisabled\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid value for environment variable, %s=%s, must be preferred/required/disabled\", k, value)\n\t\t}\n\t\tbreak\n\t}\n\treturn nil\n}\n\n// GetRegion returns the AWS Region if set in the environment. Returns an empty\n// string if not set.\nfunc (c EnvConfig) getRegion(ctx context.Context) (string, bool, error) {\n\tif len(c.Region) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn c.Region, true, nil\n}\n\n// GetSharedConfigProfile returns the shared config profile if set in the\n// environment. Returns an empty string if not set.\nfunc (c EnvConfig) getSharedConfigProfile(ctx context.Context) (string, bool, error) {\n\tif len(c.SharedConfigProfile) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn c.SharedConfigProfile, true, nil\n}\n\n// getSharedConfigFiles returns a slice of filenames set in the environment.\n//\n// Will return the filenames in the order of:\n// * Shared Config\nfunc (c EnvConfig) getSharedConfigFiles(context.Context) ([]string, bool, error) {\n\tvar files []string\n\tif v := c.SharedConfigFile; len(v) > 0 {\n\t\tfiles = append(files, v)\n\t}\n\n\tif len(files) == 0 {\n\t\treturn nil, false, nil\n\t}\n\treturn files, true, nil\n}\n\n// getSharedCredentialsFiles returns a slice of filenames set in the environment.\n//\n// Will return the filenames in the order of:\n// * Shared Credentials\nfunc (c EnvConfig) getSharedCredentialsFiles(context.Context) ([]string, bool, error) {\n\tvar files []string\n\tif v := c.SharedCredentialsFile; len(v) > 0 {\n\t\tfiles = append(files, v)\n\t}\n\tif len(files) == 0 {\n\t\treturn nil, false, nil\n\t}\n\treturn files, true, nil\n}\n\n// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was\nfunc (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) {\n\tif len(c.CustomCABundle) == 0 {\n\t\treturn nil, false, nil\n\t}\n\n\tb, err := ioutil.ReadFile(c.CustomCABundle)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\treturn bytes.NewReader(b), true, nil\n}\n\n// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured\n// endpoints feature.\nfunc (c EnvConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) {\n\tif c.IgnoreConfiguredEndpoints == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.IgnoreConfiguredEndpoints, true, nil\n}\n\nfunc (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) {\n\treturn c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil\n}\n\n// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use\n// with configured endpoints.\nfunc (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) {\n\tif endpt := os.Getenv(fmt.Sprintf(\"%s_%s\", awsEndpointURL, normalizeEnv(sdkID))); endpt != \"\" {\n\t\treturn endpt, true, nil\n\t}\n\treturn \"\", false, nil\n}\n\nfunc normalizeEnv(sdkID string) string {\n\tupper := strings.ToUpper(sdkID)\n\treturn strings.ReplaceAll(upper, \" \", \"_\")\n}\n\n// GetS3UseARNRegion returns whether to allow ARNs to direct the region\n// the S3 client's requests are sent to.\nfunc (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) {\n\tif c.S3UseARNRegion == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.S3UseARNRegion, true, nil\n}\n\n// GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point\n// support for the S3 client.\nfunc (c EnvConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) {\n\tif c.S3DisableMultiRegionAccessPoints == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.S3DisableMultiRegionAccessPoints, true, nil\n}\n\n// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be\n// used for requests.\nfunc (c EnvConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) {\n\tif c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset {\n\t\treturn aws.DualStackEndpointStateUnset, false, nil\n\t}\n\n\treturn c.UseDualStackEndpoint, true, nil\n}\n\n// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be\n// used for requests.\nfunc (c EnvConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) {\n\tif c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset {\n\t\treturn aws.FIPSEndpointStateUnset, false, nil\n\t}\n\n\treturn c.UseFIPSEndpoint, true, nil\n}\n\nfunc setStringFromEnvVal(dst *string, keys []string) {\n\tfor _, k := range keys {\n\t\tif v := os.Getenv(k); len(v) > 0 {\n\t\t\t*dst = v\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc setIntFromEnvVal(dst *int, keys []string) error {\n\tfor _, k := range keys {\n\t\tif v := os.Getenv(k); len(v) > 0 {\n\t\t\ti, err := strconv.ParseInt(v, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value %s=%s, %w\", k, v, err)\n\t\t\t}\n\t\t\t*dst = int(i)\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc setBoolPtrFromEnvVal(dst **bool, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif *dst == nil {\n\t\t\t*dst = new(bool)\n\t\t}\n\n\t\tswitch {\n\t\tcase strings.EqualFold(value, \"false\"):\n\t\t\t**dst = false\n\t\tcase strings.EqualFold(value, \"true\"):\n\t\t\t**dst = true\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"invalid value for environment variable, %s=%s, need true or false\",\n\t\t\t\tk, value)\n\t\t}\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\nfunc setInt64PtrFromEnvVal(dst **int64, keys []string, max int64) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tv, err := strconv.ParseInt(value, 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid value for env var, %s=%s, need int64\", k, value)\n\t\t} else if v < 0 || v > max {\n\t\t\treturn fmt.Errorf(\"invalid range for env var min request compression size bytes %q, must be within 0 and 10485760 inclusively\", v)\n\t\t}\n\t\tif *dst == nil {\n\t\t\t*dst = new(int64)\n\t\t}\n\n\t\t**dst = v\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\nfunc setEndpointDiscoveryTypeFromEnvVal(dst *aws.EndpointDiscoveryEnableState, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue // skip if empty\n\t\t}\n\n\t\tswitch {\n\t\tcase strings.EqualFold(value, endpointDiscoveryDisabled):\n\t\t\t*dst = aws.EndpointDiscoveryDisabled\n\t\tcase strings.EqualFold(value, endpointDiscoveryEnabled):\n\t\t\t*dst = aws.EndpointDiscoveryEnabled\n\t\tcase strings.EqualFold(value, endpointDiscoveryAuto):\n\t\t\t*dst = aws.EndpointDiscoveryAuto\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"invalid value for environment variable, %s=%s, need true, false or auto\",\n\t\t\t\tk, value)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setUseDualStackEndpointFromEnvVal(dst *aws.DualStackEndpointState, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue // skip if empty\n\t\t}\n\n\t\tswitch {\n\t\tcase strings.EqualFold(value, \"true\"):\n\t\t\t*dst = aws.DualStackEndpointStateEnabled\n\t\tcase strings.EqualFold(value, \"false\"):\n\t\t\t*dst = aws.DualStackEndpointStateDisabled\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"invalid value for environment variable, %s=%s, need true, false\",\n\t\t\t\tk, value)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setUseFIPSEndpointFromEnvVal(dst *aws.FIPSEndpointState, keys []string) error {\n\tfor _, k := range keys {\n\t\tvalue := os.Getenv(k)\n\t\tif len(value) == 0 {\n\t\t\tcontinue // skip if empty\n\t\t}\n\n\t\tswitch {\n\t\tcase strings.EqualFold(value, \"true\"):\n\t\t\t*dst = aws.FIPSEndpointStateEnabled\n\t\tcase strings.EqualFold(value, \"false\"):\n\t\t\t*dst = aws.FIPSEndpointStateDisabled\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"invalid value for environment variable, %s=%s, need true, false\",\n\t\t\t\tk, value)\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetEnableEndpointDiscovery returns resolved value for EnableEndpointDiscovery env variable setting.\nfunc (c EnvConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) {\n\tif c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset {\n\t\treturn aws.EndpointDiscoveryUnset, false, nil\n\t}\n\n\treturn c.EnableEndpointDiscovery, true, nil\n}\n\n// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface.\nfunc (c EnvConfig) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) {\n\tif c.EC2IMDSClientEnableState == imds.ClientDefaultEnableState {\n\t\treturn imds.ClientDefaultEnableState, false, nil\n\t}\n\n\treturn c.EC2IMDSClientEnableState, true, nil\n}\n\n// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.\nfunc (c EnvConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) {\n\tif c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset {\n\t\treturn imds.EndpointModeStateUnset, false, nil\n\t}\n\n\treturn c.EC2IMDSEndpointMode, true, nil\n}\n\n// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.\nfunc (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) {\n\tif len(c.EC2IMDSEndpoint) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn c.EC2IMDSEndpoint, true, nil\n}\n\n// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option\n// resolver interface.\nfunc (c EnvConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) {\n\tif c.EC2IMDSv1Disabled == nil {\n\t\treturn false, false\n\t}\n\n\treturn *c.EC2IMDSv1Disabled, true\n}\n\n// GetS3DisableExpressAuth returns the configured value for\n// [EnvConfig.S3DisableExpressAuth].\nfunc (c EnvConfig) GetS3DisableExpressAuth() (value, ok bool) {\n\tif c.S3DisableExpressAuth == nil {\n\t\treturn false, false\n\t}\n\n\treturn *c.S3DisableExpressAuth, true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/generate.go",
    "content": "package config\n\n//go:generate go run -tags codegen ./codegen -output=provider_assert_test.go\n//go:generate gofmt -s -w ./\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage config\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.27.27\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/endpointcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/processcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ssocreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\tsmithybearer \"github.com/aws/smithy-go/auth/bearer\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// LoadOptionsFunc is a type alias for LoadOptions functional option\ntype LoadOptionsFunc func(*LoadOptions) error\n\n// LoadOptions are discrete set of options that are valid for loading the\n// configuration\ntype LoadOptions struct {\n\n\t// Region is the region to send requests to.\n\tRegion string\n\n\t// Credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// Token provider for authentication operations with bearer authentication.\n\tBearerAuthTokenProvider smithybearer.TokenProvider\n\n\t// HTTPClient the SDK's API clients will use to invoke HTTP requests.\n\tHTTPClient HTTPClient\n\n\t// EndpointResolver that can be used to provide or override an endpoint for\n\t// the given service and region.\n\t//\n\t// See the `aws.EndpointResolver` documentation on usage.\n\t//\n\t// Deprecated: See EndpointResolverWithOptions\n\tEndpointResolver aws.EndpointResolver\n\n\t// EndpointResolverWithOptions that can be used to provide or override an\n\t// endpoint for the given service and region.\n\t//\n\t// See the `aws.EndpointResolverWithOptions` documentation on usage.\n\tEndpointResolverWithOptions aws.EndpointResolverWithOptions\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client\n\t// will call an operation that fails with a retryable error.\n\t//\n\t// This value will only be used if Retryer option is nil.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry model the API client will be created with.\n\t//\n\t// This value will only be used if Retryer option is nil.\n\tRetryMode aws.RetryMode\n\n\t// Retryer is a function that provides a Retryer implementation. A Retryer\n\t// guides how HTTP requests should be retried in case of recoverable\n\t// failures.\n\t//\n\t// If not nil, RetryMaxAttempts, and RetryMode will be ignored.\n\tRetryer func() aws.Retryer\n\n\t// APIOptions provides the set of middleware mutations modify how the API\n\t// client requests will be handled. This is useful for adding additional\n\t// tracing data to a request, or changing behavior of the SDK's client.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// ClientLogMode is used to configure the events that will be sent to the\n\t// configured logger. This can be used to configure the logging of signing,\n\t// retries, request, and responses of the SDK clients.\n\t//\n\t// See the ClientLogMode type documentation for the complete set of logging\n\t// modes and available configuration.\n\tClientLogMode *aws.ClientLogMode\n\n\t// SharedConfigProfile is the profile to be used when loading the SharedConfig\n\tSharedConfigProfile string\n\n\t// SharedConfigFiles is the slice of custom shared config files to use when\n\t// loading the SharedConfig. A non-default profile used within config file\n\t// must have name defined with prefix 'profile '. eg [profile xyz]\n\t// indicates a profile with name 'xyz'. To read more on the format of the\n\t// config file, please refer the documentation at\n\t// https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-config\n\t//\n\t// If duplicate profiles are provided within the same, or across multiple\n\t// shared config files, the next parsed profile will override only the\n\t// properties that conflict with the previously defined profile. Note that\n\t// if duplicate profiles are provided within the SharedCredentialsFiles and\n\t// SharedConfigFiles, the properties defined in shared credentials file\n\t// take precedence.\n\tSharedConfigFiles []string\n\n\t// SharedCredentialsFile is the slice of custom shared credentials files to\n\t// use when loading the SharedConfig. The profile name used within\n\t// credentials file must not prefix 'profile '. eg [xyz] indicates a\n\t// profile with name 'xyz'. Profile declared as [profile xyz] will be\n\t// ignored. To read more on the format of the credentials file, please\n\t// refer the documentation at\n\t// https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-creds\n\t//\n\t// If duplicate profiles are provided with a same, or across multiple\n\t// shared credentials files, the next parsed profile will override only\n\t// properties that conflict with the previously defined profile. Note that\n\t// if duplicate profiles are provided within the SharedCredentialsFiles and\n\t// SharedConfigFiles, the properties defined in shared credentials file\n\t// take precedence.\n\tSharedCredentialsFiles []string\n\n\t// CustomCABundle is CA bundle PEM bytes reader\n\tCustomCABundle io.Reader\n\n\t// DefaultRegion is the fall back region, used if a region was not resolved\n\t// from other sources\n\tDefaultRegion string\n\n\t// UseEC2IMDSRegion indicates if SDK should retrieve the region\n\t// from the EC2 Metadata service\n\tUseEC2IMDSRegion *UseEC2IMDSRegion\n\n\t// CredentialsCacheOptions is a function for setting the\n\t// aws.CredentialsCacheOptions\n\tCredentialsCacheOptions func(*aws.CredentialsCacheOptions)\n\n\t// BearerAuthTokenCacheOptions is a function for setting the smithy-go\n\t// auth/bearer#TokenCacheOptions\n\tBearerAuthTokenCacheOptions func(*smithybearer.TokenCacheOptions)\n\n\t// SSOTokenProviderOptions is a function for setting the\n\t// credentials/ssocreds.SSOTokenProviderOptions\n\tSSOTokenProviderOptions func(*ssocreds.SSOTokenProviderOptions)\n\n\t// ProcessCredentialOptions is a function for setting\n\t// the processcreds.Options\n\tProcessCredentialOptions func(*processcreds.Options)\n\n\t// EC2RoleCredentialOptions is a function for setting\n\t// the ec2rolecreds.Options\n\tEC2RoleCredentialOptions func(*ec2rolecreds.Options)\n\n\t// EndpointCredentialOptions is a function for setting\n\t// the endpointcreds.Options\n\tEndpointCredentialOptions func(*endpointcreds.Options)\n\n\t// WebIdentityRoleCredentialOptions is a function for setting\n\t// the stscreds.WebIdentityRoleOptions\n\tWebIdentityRoleCredentialOptions func(*stscreds.WebIdentityRoleOptions)\n\n\t// AssumeRoleCredentialOptions is a function for setting the\n\t// stscreds.AssumeRoleOptions\n\tAssumeRoleCredentialOptions func(*stscreds.AssumeRoleOptions)\n\n\t// SSOProviderOptions is a function for setting\n\t// the ssocreds.Options\n\tSSOProviderOptions func(options *ssocreds.Options)\n\n\t// LogConfigurationWarnings when set to true, enables logging\n\t// configuration warnings\n\tLogConfigurationWarnings *bool\n\n\t// S3UseARNRegion specifies if the S3 service should allow ARNs to direct\n\t// the region, the client's requests are sent to.\n\tS3UseARNRegion *bool\n\n\t// S3DisableMultiRegionAccessPoints specifies if the S3 service should disable\n\t// the S3 Multi-Region access points feature.\n\tS3DisableMultiRegionAccessPoints *bool\n\n\t// EnableEndpointDiscovery specifies if endpoint discovery is enable for\n\t// the client.\n\tEnableEndpointDiscovery aws.EndpointDiscoveryEnableState\n\n\t// Specifies if the EC2 IMDS service client is enabled.\n\t//\n\t// AWS_EC2_METADATA_DISABLED=true\n\tEC2IMDSClientEnableState imds.ClientEnableState\n\n\t// Specifies the EC2 Instance Metadata Service default endpoint selection\n\t// mode (IPv4 or IPv6)\n\tEC2IMDSEndpointMode imds.EndpointModeState\n\n\t// Specifies the EC2 Instance Metadata Service endpoint to use. If\n\t// specified it overrides EC2IMDSEndpointMode.\n\tEC2IMDSEndpoint string\n\n\t// Specifies that SDK clients must resolve a dual-stack endpoint for\n\t// services.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// Specifies that SDK clients must resolve a FIPS endpoint for\n\t// services.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n\n\t// Specifies the SDK configuration mode for defaults.\n\tDefaultsModeOptions DefaultsModeOptions\n\n\t// The sdk app ID retrieved from env var or shared config to be added to request user agent header\n\tAppID string\n\n\t// Specifies whether an operation request could be compressed\n\tDisableRequestCompression *bool\n\n\t// The inclusive min bytes of a request body that could be compressed\n\tRequestMinCompressSizeBytes *int64\n\n\t// Whether S3 Express auth is disabled.\n\tS3DisableExpressAuth *bool\n\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n}\n\nfunc (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) {\n\tif len(o.DefaultsModeOptions.Mode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn o.DefaultsModeOptions.Mode, true, nil\n}\n\n// GetRetryMaxAttempts returns the RetryMaxAttempts if specified in the\n// LoadOptions and not 0.\nfunc (o LoadOptions) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn 0, false, nil\n\t}\n\treturn o.RetryMaxAttempts, true, nil\n}\n\n// GetRetryMode returns the RetryMode specified in the LoadOptions.\nfunc (o LoadOptions) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) {\n\tif len(o.RetryMode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn o.RetryMode, true, nil\n}\n\nfunc (o LoadOptions) getDefaultsModeIMDSClient(ctx context.Context) (*imds.Client, bool, error) {\n\tif o.DefaultsModeOptions.IMDSClient == nil {\n\t\treturn nil, false, nil\n\t}\n\treturn o.DefaultsModeOptions.IMDSClient, true, nil\n}\n\n// getRegion returns Region from config's LoadOptions\nfunc (o LoadOptions) getRegion(ctx context.Context) (string, bool, error) {\n\tif len(o.Region) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.Region, true, nil\n}\n\n// getAppID returns AppID from config's LoadOptions\nfunc (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) {\n\treturn o.AppID, len(o.AppID) > 0, nil\n}\n\n// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions\nfunc (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) {\n\tif o.DisableRequestCompression == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *o.DisableRequestCompression, true, nil\n}\n\n// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions\nfunc (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) {\n\tif o.RequestMinCompressSizeBytes == nil {\n\t\treturn 0, false, nil\n\t}\n\treturn *o.RequestMinCompressSizeBytes, true, nil\n}\n\nfunc (o LoadOptions) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) {\n\treturn o.AccountIDEndpointMode, len(o.AccountIDEndpointMode) > 0, nil\n}\n\n// WithRegion is a helper function to construct functional options\n// that sets Region on config's LoadOptions. Setting the region to\n// an empty string, will result in the region value being ignored.\n// If multiple WithRegion calls are made, the last call overrides\n// the previous call values.\nfunc WithRegion(v string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.Region = v\n\t\treturn nil\n\t}\n}\n\n// WithAppID is a helper function to construct functional options\n// that sets AppID on config's LoadOptions.\nfunc WithAppID(ID string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.AppID = ID\n\t\treturn nil\n\t}\n}\n\n// WithDisableRequestCompression is a helper function to construct functional options\n// that sets DisableRequestCompression on config's LoadOptions.\nfunc WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\tif DisableRequestCompression == nil {\n\t\t\treturn nil\n\t\t}\n\t\to.DisableRequestCompression = DisableRequestCompression\n\t\treturn nil\n\t}\n}\n\n// WithRequestMinCompressSizeBytes is a helper function to construct functional options\n// that sets RequestMinCompressSizeBytes on config's LoadOptions.\nfunc WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\tif RequestMinCompressSizeBytes == nil {\n\t\t\treturn nil\n\t\t}\n\t\to.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes\n\t\treturn nil\n\t}\n}\n\n// WithAccountIDEndpointMode is a helper function to construct functional options\n// that sets AccountIDEndpointMode on config's LoadOptions\nfunc WithAccountIDEndpointMode(m aws.AccountIDEndpointMode) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\tif m != \"\" {\n\t\t\to.AccountIDEndpointMode = m\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// getDefaultRegion returns DefaultRegion from config's LoadOptions\nfunc (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) {\n\tif len(o.DefaultRegion) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.DefaultRegion, true, nil\n}\n\n// WithDefaultRegion is a helper function to construct functional options\n// that sets a DefaultRegion on config's LoadOptions. Setting the default\n// region to an empty string, will result in the default region value\n// being ignored. If multiple WithDefaultRegion calls are made, the last\n// call overrides the previous call values. Note that both WithRegion and\n// WithEC2IMDSRegion call takes precedence over WithDefaultRegion call\n// when resolving region.\nfunc WithDefaultRegion(v string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.DefaultRegion = v\n\t\treturn nil\n\t}\n}\n\n// getSharedConfigProfile returns SharedConfigProfile from config's LoadOptions\nfunc (o LoadOptions) getSharedConfigProfile(ctx context.Context) (string, bool, error) {\n\tif len(o.SharedConfigProfile) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.SharedConfigProfile, true, nil\n}\n\n// WithSharedConfigProfile is a helper function to construct functional options\n// that sets SharedConfigProfile on config's LoadOptions. Setting the shared\n// config profile to an empty string, will result in the shared config profile\n// value being ignored.\n// If multiple WithSharedConfigProfile calls are made, the last call overrides\n// the previous call values.\nfunc WithSharedConfigProfile(v string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.SharedConfigProfile = v\n\t\treturn nil\n\t}\n}\n\n// getSharedConfigFiles returns SharedConfigFiles set on config's LoadOptions\nfunc (o LoadOptions) getSharedConfigFiles(ctx context.Context) ([]string, bool, error) {\n\tif o.SharedConfigFiles == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.SharedConfigFiles, true, nil\n}\n\n// WithSharedConfigFiles is a helper function to construct functional options\n// that sets slice of SharedConfigFiles on config's LoadOptions.\n// Setting the shared config files to an nil string slice, will result in the\n// shared config files value being ignored.\n// If multiple WithSharedConfigFiles calls are made, the last call overrides\n// the previous call values.\nfunc WithSharedConfigFiles(v []string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.SharedConfigFiles = v\n\t\treturn nil\n\t}\n}\n\n// getSharedCredentialsFiles returns SharedCredentialsFiles set on config's LoadOptions\nfunc (o LoadOptions) getSharedCredentialsFiles(ctx context.Context) ([]string, bool, error) {\n\tif o.SharedCredentialsFiles == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.SharedCredentialsFiles, true, nil\n}\n\n// WithSharedCredentialsFiles is a helper function to construct functional options\n// that sets slice of SharedCredentialsFiles on config's LoadOptions.\n// Setting the shared credentials files to an nil string slice, will result in the\n// shared credentials files value being ignored.\n// If multiple WithSharedCredentialsFiles calls are made, the last call overrides\n// the previous call values.\nfunc WithSharedCredentialsFiles(v []string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.SharedCredentialsFiles = v\n\t\treturn nil\n\t}\n}\n\n// getCustomCABundle returns CustomCABundle from LoadOptions\nfunc (o LoadOptions) getCustomCABundle(ctx context.Context) (io.Reader, bool, error) {\n\tif o.CustomCABundle == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.CustomCABundle, true, nil\n}\n\n// WithCustomCABundle is a helper function to construct functional options\n// that sets CustomCABundle on config's LoadOptions. Setting the custom CA Bundle\n// to nil will result in custom CA Bundle value being ignored.\n// If multiple WithCustomCABundle calls are made, the last call overrides the\n// previous call values.\nfunc WithCustomCABundle(v io.Reader) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.CustomCABundle = v\n\t\treturn nil\n\t}\n}\n\n// UseEC2IMDSRegion provides a regionProvider that retrieves the region\n// from the EC2 Metadata service.\ntype UseEC2IMDSRegion struct {\n\t// If unset will default to generic EC2 IMDS client.\n\tClient *imds.Client\n}\n\n// getRegion attempts to retrieve the region from EC2 Metadata service.\nfunc (p *UseEC2IMDSRegion) getRegion(ctx context.Context) (string, bool, error) {\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\n\tclient := p.Client\n\tif client == nil {\n\t\tclient = imds.New(imds.Options{})\n\t}\n\n\tresult, err := client.GetRegion(ctx, nil)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tif len(result.Region) != 0 {\n\t\treturn result.Region, true, nil\n\t}\n\treturn \"\", false, nil\n}\n\n// getEC2IMDSRegion returns the value of EC2 IMDS region.\nfunc (o LoadOptions) getEC2IMDSRegion(ctx context.Context) (string, bool, error) {\n\tif o.UseEC2IMDSRegion == nil {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.UseEC2IMDSRegion.getRegion(ctx)\n}\n\n// WithEC2IMDSRegion is a helper function to construct functional options\n// that enables resolving EC2IMDS region. The function takes\n// in a UseEC2IMDSRegion functional option, and can be used to set the\n// EC2IMDS client which will be used to resolve EC2IMDSRegion.\n// If no functional option is provided, an EC2IMDS client is built and used\n// by the resolver. If multiple WithEC2IMDSRegion calls are made, the last\n// call overrides the previous call values. Note that the WithRegion calls takes\n// precedence over WithEC2IMDSRegion when resolving region.\nfunc WithEC2IMDSRegion(fnOpts ...func(o *UseEC2IMDSRegion)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.UseEC2IMDSRegion = &UseEC2IMDSRegion{}\n\n\t\tfor _, fn := range fnOpts {\n\t\t\tfn(o.UseEC2IMDSRegion)\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// getCredentialsProvider returns the credentials value\nfunc (o LoadOptions) getCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error) {\n\tif o.Credentials == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.Credentials, true, nil\n}\n\n// WithCredentialsProvider is a helper function to construct functional options\n// that sets Credential provider value on config's LoadOptions. If credentials\n// provider is set to nil, the credentials provider value will be ignored.\n// If multiple WithCredentialsProvider calls are made, the last call overrides\n// the previous call values.\nfunc WithCredentialsProvider(v aws.CredentialsProvider) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.Credentials = v\n\t\treturn nil\n\t}\n}\n\n// getCredentialsCacheOptionsProvider returns the wrapped function to set aws.CredentialsCacheOptions\nfunc (o LoadOptions) getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) {\n\tif o.CredentialsCacheOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.CredentialsCacheOptions, true, nil\n}\n\n// WithCredentialsCacheOptions is a helper function to construct functional\n// options that sets a function to modify the aws.CredentialsCacheOptions the\n// aws.CredentialsCache will be configured with, if the CredentialsCache is used\n// by the configuration loader.\n//\n// If multiple WithCredentialsCacheOptions calls are made, the last call\n// overrides the previous call values.\nfunc WithCredentialsCacheOptions(v func(*aws.CredentialsCacheOptions)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.CredentialsCacheOptions = v\n\t\treturn nil\n\t}\n}\n\n// getBearerAuthTokenProvider returns the credentials value\nfunc (o LoadOptions) getBearerAuthTokenProvider(ctx context.Context) (smithybearer.TokenProvider, bool, error) {\n\tif o.BearerAuthTokenProvider == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.BearerAuthTokenProvider, true, nil\n}\n\n// WithBearerAuthTokenProvider is a helper function to construct functional options\n// that sets Credential provider value on config's LoadOptions. If credentials\n// provider is set to nil, the credentials provider value will be ignored.\n// If multiple WithBearerAuthTokenProvider calls are made, the last call overrides\n// the previous call values.\nfunc WithBearerAuthTokenProvider(v smithybearer.TokenProvider) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.BearerAuthTokenProvider = v\n\t\treturn nil\n\t}\n}\n\n// getBearerAuthTokenCacheOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions\nfunc (o LoadOptions) getBearerAuthTokenCacheOptions(ctx context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) {\n\tif o.BearerAuthTokenCacheOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.BearerAuthTokenCacheOptions, true, nil\n}\n\n// WithBearerAuthTokenCacheOptions is a helper function to construct functional options\n// that sets a function to modify the TokenCacheOptions the smithy-go\n// auth/bearer#TokenCache will be configured with, if the TokenCache is used by\n// the configuration loader.\n//\n// If multiple WithBearerAuthTokenCacheOptions calls are made, the last call overrides\n// the previous call values.\nfunc WithBearerAuthTokenCacheOptions(v func(*smithybearer.TokenCacheOptions)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.BearerAuthTokenCacheOptions = v\n\t\treturn nil\n\t}\n}\n\n// getSSOTokenProviderOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions\nfunc (o LoadOptions) getSSOTokenProviderOptions(ctx context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) {\n\tif o.SSOTokenProviderOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.SSOTokenProviderOptions, true, nil\n}\n\n// WithSSOTokenProviderOptions is a helper function to construct functional\n// options that sets a function to modify the SSOtokenProviderOptions the SDK's\n// credentials/ssocreds#SSOProvider will be configured with, if the\n// SSOTokenProvider is used by the configuration loader.\n//\n// If multiple WithSSOTokenProviderOptions calls are made, the last call overrides\n// the previous call values.\nfunc WithSSOTokenProviderOptions(v func(*ssocreds.SSOTokenProviderOptions)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.SSOTokenProviderOptions = v\n\t\treturn nil\n\t}\n}\n\n// getProcessCredentialOptions returns the wrapped function to set processcreds.Options\nfunc (o LoadOptions) getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) {\n\tif o.ProcessCredentialOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.ProcessCredentialOptions, true, nil\n}\n\n// WithProcessCredentialOptions is a helper function to construct functional options\n// that sets a function to use processcreds.Options on config's LoadOptions.\n// If process credential options is set to nil, the process credential value will\n// be ignored. If multiple WithProcessCredentialOptions calls are made, the last call\n// overrides the previous call values.\nfunc WithProcessCredentialOptions(v func(*processcreds.Options)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.ProcessCredentialOptions = v\n\t\treturn nil\n\t}\n}\n\n// getEC2RoleCredentialOptions returns the wrapped function to set the ec2rolecreds.Options\nfunc (o LoadOptions) getEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error) {\n\tif o.EC2RoleCredentialOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.EC2RoleCredentialOptions, true, nil\n}\n\n// WithEC2RoleCredentialOptions is a helper function to construct functional options\n// that sets a function to use ec2rolecreds.Options on config's LoadOptions. If\n// EC2 role credential options is set to nil, the EC2 role credential options value\n// will be ignored. If multiple WithEC2RoleCredentialOptions calls are made,\n// the last call overrides the previous call values.\nfunc WithEC2RoleCredentialOptions(v func(*ec2rolecreds.Options)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EC2RoleCredentialOptions = v\n\t\treturn nil\n\t}\n}\n\n// getEndpointCredentialOptions returns the wrapped function to set endpointcreds.Options\nfunc (o LoadOptions) getEndpointCredentialOptions(context.Context) (func(*endpointcreds.Options), bool, error) {\n\tif o.EndpointCredentialOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.EndpointCredentialOptions, true, nil\n}\n\n// WithEndpointCredentialOptions is a helper function to construct functional options\n// that sets a function to use endpointcreds.Options on config's LoadOptions. If\n// endpoint credential options is set to nil, the endpoint credential options\n// value will be ignored. If multiple WithEndpointCredentialOptions calls are made,\n// the last call overrides the previous call values.\nfunc WithEndpointCredentialOptions(v func(*endpointcreds.Options)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EndpointCredentialOptions = v\n\t\treturn nil\n\t}\n}\n\n// getWebIdentityRoleCredentialOptions returns the wrapped function\nfunc (o LoadOptions) getWebIdentityRoleCredentialOptions(context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error) {\n\tif o.WebIdentityRoleCredentialOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.WebIdentityRoleCredentialOptions, true, nil\n}\n\n// WithWebIdentityRoleCredentialOptions is a helper function to construct\n// functional options that sets a function to use stscreds.WebIdentityRoleOptions\n// on config's LoadOptions. If web identity role credentials options is set to nil,\n// the web identity role credentials value will be ignored. If multiple\n// WithWebIdentityRoleCredentialOptions calls are made, the last call\n// overrides the previous call values.\nfunc WithWebIdentityRoleCredentialOptions(v func(*stscreds.WebIdentityRoleOptions)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.WebIdentityRoleCredentialOptions = v\n\t\treturn nil\n\t}\n}\n\n// getAssumeRoleCredentialOptions returns AssumeRoleCredentialOptions from LoadOptions\nfunc (o LoadOptions) getAssumeRoleCredentialOptions(context.Context) (func(options *stscreds.AssumeRoleOptions), bool, error) {\n\tif o.AssumeRoleCredentialOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.AssumeRoleCredentialOptions, true, nil\n}\n\n// WithAssumeRoleCredentialOptions  is a helper function to construct\n// functional options that sets a function to use stscreds.AssumeRoleOptions\n// on config's LoadOptions. If assume role credentials options is set to nil,\n// the assume role credentials value will be ignored. If multiple\n// WithAssumeRoleCredentialOptions calls are made, the last call overrides\n// the previous call values.\nfunc WithAssumeRoleCredentialOptions(v func(*stscreds.AssumeRoleOptions)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.AssumeRoleCredentialOptions = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getHTTPClient(ctx context.Context) (HTTPClient, bool, error) {\n\tif o.HTTPClient == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.HTTPClient, true, nil\n}\n\n// WithHTTPClient is a helper function to construct functional options\n// that sets HTTPClient on LoadOptions. If HTTPClient is set to nil,\n// the HTTPClient value will be ignored.\n// If multiple WithHTTPClient calls are made, the last call overrides\n// the previous call values.\nfunc WithHTTPClient(v HTTPClient) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.HTTPClient = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error) {\n\tif o.APIOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.APIOptions, true, nil\n}\n\n// WithAPIOptions is a helper function to construct functional options\n// that sets APIOptions on LoadOptions. If APIOptions is set to nil, the\n// APIOptions value is ignored. If multiple WithAPIOptions calls are\n// made, the last call overrides the previous call values.\nfunc WithAPIOptions(v []func(*middleware.Stack) error) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\to.APIOptions = append(o.APIOptions, v...)\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getRetryMaxAttempts(ctx context.Context) (int, bool, error) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn 0, false, nil\n\t}\n\n\treturn o.RetryMaxAttempts, true, nil\n}\n\n// WithRetryMaxAttempts is a helper function to construct functional options that sets\n// RetryMaxAttempts on LoadOptions. If RetryMaxAttempts is unset, the RetryMaxAttempts value is\n// ignored. If multiple WithRetryMaxAttempts calls are made, the last call overrides\n// the previous call values.\n//\n// Will be ignored of LoadOptions.Retryer or WithRetryer are used.\nfunc WithRetryMaxAttempts(v int) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.RetryMaxAttempts = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getRetryMode(ctx context.Context) (aws.RetryMode, bool, error) {\n\tif o.RetryMode == \"\" {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.RetryMode, true, nil\n}\n\n// WithRetryMode is a helper function to construct functional options that sets\n// RetryMode on LoadOptions. If RetryMode is unset, the RetryMode value is\n// ignored. If multiple WithRetryMode calls are made, the last call overrides\n// the previous call values.\n//\n// Will be ignored of LoadOptions.Retryer or WithRetryer are used.\nfunc WithRetryMode(v aws.RetryMode) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.RetryMode = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) {\n\tif o.Retryer == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.Retryer, true, nil\n}\n\n// WithRetryer is a helper function to construct functional options\n// that sets Retryer on LoadOptions. If Retryer is set to nil, the\n// Retryer value is ignored. If multiple WithRetryer calls are\n// made, the last call overrides the previous call values.\nfunc WithRetryer(v func() aws.Retryer) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.Retryer = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error) {\n\tif o.EndpointResolver == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.EndpointResolver, true, nil\n}\n\n// WithEndpointResolver is a helper function to construct functional options\n// that sets the EndpointResolver on LoadOptions. If the EndpointResolver is set to nil,\n// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls\n// are made, the last call overrides the previous call values.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. The API\n// for endpoint resolution is now unique to each service and is set via the\n// EndpointResolverV2 field on service client options. Use of\n// WithEndpointResolver or WithEndpointResolverWithOptions will prevent you\n// from using any endpoint-related service features released after the\n// introduction of EndpointResolverV2. You may also encounter broken or\n// unexpected behavior when using the old global interface with services that\n// use many endpoint-related customizations such as S3.\nfunc WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EndpointResolver = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) {\n\tif o.EndpointResolverWithOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.EndpointResolverWithOptions, true, nil\n}\n\n// WithEndpointResolverWithOptions is a helper function to construct functional options\n// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil,\n// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls\n// are made, the last call overrides the previous call values.\n//\n// Deprecated: The global endpoint resolution interface is deprecated. See\n// deprecation docs on [WithEndpointResolver].\nfunc WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EndpointResolverWithOptions = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getLogger(ctx context.Context) (logging.Logger, bool, error) {\n\tif o.Logger == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.Logger, true, nil\n}\n\n// WithLogger is a helper function to construct functional options\n// that sets Logger on LoadOptions. If Logger is set to nil, the\n// Logger value will be ignored. If multiple WithLogger calls are made,\n// the last call overrides the previous call values.\nfunc WithLogger(v logging.Logger) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.Logger = v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error) {\n\tif o.ClientLogMode == nil {\n\t\treturn 0, false, nil\n\t}\n\n\treturn *o.ClientLogMode, true, nil\n}\n\n// WithClientLogMode is a helper function to construct functional options\n// that sets client log mode on LoadOptions. If client log mode is set to nil,\n// the client log mode value will be ignored. If multiple WithClientLogMode calls are made,\n// the last call overrides the previous call values.\nfunc WithClientLogMode(v aws.ClientLogMode) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.ClientLogMode = &v\n\t\treturn nil\n\t}\n}\n\nfunc (o LoadOptions) getLogConfigurationWarnings(ctx context.Context) (v bool, found bool, err error) {\n\tif o.LogConfigurationWarnings == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *o.LogConfigurationWarnings, true, nil\n}\n\n// WithLogConfigurationWarnings is a helper function to construct\n// functional options that can be used to set LogConfigurationWarnings\n// on LoadOptions.\n//\n// If multiple WithLogConfigurationWarnings calls are made, the last call\n// overrides the previous call values.\nfunc WithLogConfigurationWarnings(v bool) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.LogConfigurationWarnings = &v\n\t\treturn nil\n\t}\n}\n\n// GetS3UseARNRegion returns whether to allow ARNs to direct the region\n// the S3 client's requests are sent to.\nfunc (o LoadOptions) GetS3UseARNRegion(ctx context.Context) (v bool, found bool, err error) {\n\tif o.S3UseARNRegion == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *o.S3UseARNRegion, true, nil\n}\n\n// WithS3UseARNRegion is a helper function to construct functional options\n// that can be used to set S3UseARNRegion on LoadOptions.\n// If multiple WithS3UseARNRegion calls are made, the last call overrides\n// the previous call values.\nfunc WithS3UseARNRegion(v bool) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.S3UseARNRegion = &v\n\t\treturn nil\n\t}\n}\n\n// GetS3DisableMultiRegionAccessPoints returns whether to disable\n// the S3 multi-region access points feature.\nfunc (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) {\n\tif o.S3DisableMultiRegionAccessPoints == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *o.S3DisableMultiRegionAccessPoints, true, nil\n}\n\n// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options\n// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions.\n// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides\n// the previous call values.\nfunc WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.S3DisableMultiRegionAccessPoints = &v\n\t\treturn nil\n\t}\n}\n\n// GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set.\nfunc (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) {\n\tif o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset {\n\t\treturn aws.EndpointDiscoveryUnset, false, nil\n\t}\n\treturn o.EnableEndpointDiscovery, true, nil\n}\n\n// WithEndpointDiscovery is a helper function to construct functional options\n// that can be used to enable endpoint discovery on LoadOptions for supported clients.\n// If multiple WithEndpointDiscovery calls are made, the last call overrides\n// the previous call values.\nfunc WithEndpointDiscovery(v aws.EndpointDiscoveryEnableState) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EnableEndpointDiscovery = v\n\t\treturn nil\n\t}\n}\n\n// getSSOProviderOptions returns AssumeRoleCredentialOptions from LoadOptions\nfunc (o LoadOptions) getSSOProviderOptions(context.Context) (func(options *ssocreds.Options), bool, error) {\n\tif o.SSOProviderOptions == nil {\n\t\treturn nil, false, nil\n\t}\n\n\treturn o.SSOProviderOptions, true, nil\n}\n\n// WithSSOProviderOptions is a helper function to construct\n// functional options that sets a function to use ssocreds.Options\n// on config's LoadOptions. If the SSO credential provider options is set to nil,\n// the sso provider options value will be ignored. If multiple\n// WithSSOProviderOptions calls are made, the last call overrides\n// the previous call values.\nfunc WithSSOProviderOptions(v func(*ssocreds.Options)) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.SSOProviderOptions = v\n\t\treturn nil\n\t}\n}\n\n// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface.\nfunc (o LoadOptions) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) {\n\tif o.EC2IMDSClientEnableState == imds.ClientDefaultEnableState {\n\t\treturn imds.ClientDefaultEnableState, false, nil\n\t}\n\n\treturn o.EC2IMDSClientEnableState, true, nil\n}\n\n// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.\nfunc (o LoadOptions) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) {\n\tif o.EC2IMDSEndpointMode == imds.EndpointModeStateUnset {\n\t\treturn imds.EndpointModeStateUnset, false, nil\n\t}\n\n\treturn o.EC2IMDSEndpointMode, true, nil\n}\n\n// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.\nfunc (o LoadOptions) GetEC2IMDSEndpoint() (string, bool, error) {\n\tif len(o.EC2IMDSEndpoint) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn o.EC2IMDSEndpoint, true, nil\n}\n\n// WithEC2IMDSClientEnableState is a helper function to construct functional options that sets the EC2IMDSClientEnableState.\nfunc WithEC2IMDSClientEnableState(v imds.ClientEnableState) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EC2IMDSClientEnableState = v\n\t\treturn nil\n\t}\n}\n\n// WithEC2IMDSEndpointMode is a helper function to construct functional options that sets the EC2IMDSEndpointMode.\nfunc WithEC2IMDSEndpointMode(v imds.EndpointModeState) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EC2IMDSEndpointMode = v\n\t\treturn nil\n\t}\n}\n\n// WithEC2IMDSEndpoint is a helper function to construct functional options that sets the EC2IMDSEndpoint.\nfunc WithEC2IMDSEndpoint(v string) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.EC2IMDSEndpoint = v\n\t\treturn nil\n\t}\n}\n\n// WithUseDualStackEndpoint is a helper function to construct\n// functional options that can be used to set UseDualStackEndpoint on LoadOptions.\nfunc WithUseDualStackEndpoint(v aws.DualStackEndpointState) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.UseDualStackEndpoint = v\n\t\treturn nil\n\t}\n}\n\n// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be\n// used for requests.\nfunc (o LoadOptions) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) {\n\tif o.UseDualStackEndpoint == aws.DualStackEndpointStateUnset {\n\t\treturn aws.DualStackEndpointStateUnset, false, nil\n\t}\n\treturn o.UseDualStackEndpoint, true, nil\n}\n\n// WithUseFIPSEndpoint is a helper function to construct\n// functional options that can be used to set UseFIPSEndpoint on LoadOptions.\nfunc WithUseFIPSEndpoint(v aws.FIPSEndpointState) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.UseFIPSEndpoint = v\n\t\treturn nil\n\t}\n}\n\n// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be\n// used for requests.\nfunc (o LoadOptions) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) {\n\tif o.UseFIPSEndpoint == aws.FIPSEndpointStateUnset {\n\t\treturn aws.FIPSEndpointStateUnset, false, nil\n\t}\n\treturn o.UseFIPSEndpoint, true, nil\n}\n\n// WithDefaultsMode sets the SDK defaults configuration mode to the value provided.\n//\n// Zero or more functional options can be provided to provide configuration options for performing\n// environment discovery when using aws.DefaultsModeAuto.\nfunc WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsModeOptions)) LoadOptionsFunc {\n\tdo := DefaultsModeOptions{\n\t\tMode: mode,\n\t}\n\tfor _, fn := range optFns {\n\t\tfn(&do)\n\t}\n\treturn func(options *LoadOptions) error {\n\t\toptions.DefaultsModeOptions = do\n\t\treturn nil\n\t}\n}\n\n// GetS3DisableExpressAuth returns the configured value for\n// [EnvConfig.S3DisableExpressAuth].\nfunc (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) {\n\tif o.S3DisableExpressAuth == nil {\n\t\treturn false, false\n\t}\n\n\treturn *o.S3DisableExpressAuth, true\n}\n\n// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth]\n// to the value provided.\nfunc WithS3DisableExpressAuth(v bool) LoadOptionsFunc {\n\treturn func(o *LoadOptions) error {\n\t\to.S3DisableExpressAuth = &v\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/local.go",
    "content": "package config\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n)\n\nvar lookupHostFn = net.LookupHost\n\nfunc isLoopbackHost(host string) (bool, error) {\n\tip := net.ParseIP(host)\n\tif ip != nil {\n\t\treturn ip.IsLoopback(), nil\n\t}\n\n\t// Host is not an ip, perform lookup\n\taddrs, err := lookupHostFn(host)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif len(addrs) == 0 {\n\t\treturn false, fmt.Errorf(\"no addrs found for host, %s\", host)\n\t}\n\n\tfor _, addr := range addrs {\n\t\tif !net.ParseIP(addr).IsLoopback() {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc validateLocalURL(v string) error {\n\tu, err := url.Parse(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\thost := u.Hostname()\n\tif len(host) == 0 {\n\t\treturn fmt.Errorf(\"unable to parse host from local HTTP cred provider URL\")\n\t} else if isLoopback, err := isLoopbackHost(host); err != nil {\n\t\treturn fmt.Errorf(\"failed to resolve host %q, %v\", host, err)\n\t} else if !isLoopback {\n\t\treturn fmt.Errorf(\"invalid endpoint host, %q, only host resolving to loopback addresses are allowed\", host)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/provider.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/endpointcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/processcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ssocreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\tsmithybearer \"github.com/aws/smithy-go/auth/bearer\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// sharedConfigProfileProvider provides access to the shared config profile\n// name external configuration value.\ntype sharedConfigProfileProvider interface {\n\tgetSharedConfigProfile(ctx context.Context) (string, bool, error)\n}\n\n// getSharedConfigProfile searches the configs for a sharedConfigProfileProvider\n// and returns the value if found. Returns an error if a provider fails before a\n// value is found.\nfunc getSharedConfigProfile(ctx context.Context, configs configs) (value string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(sharedConfigProfileProvider); ok {\n\t\t\tvalue, found, err = p.getSharedConfigProfile(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// sharedConfigFilesProvider provides access to the shared config filesnames\n// external configuration value.\ntype sharedConfigFilesProvider interface {\n\tgetSharedConfigFiles(ctx context.Context) ([]string, bool, error)\n}\n\n// getSharedConfigFiles searches the configs for a sharedConfigFilesProvider\n// and returns the value if found. Returns an error if a provider fails before a\n// value is found.\nfunc getSharedConfigFiles(ctx context.Context, configs configs) (value []string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(sharedConfigFilesProvider); ok {\n\t\t\tvalue, found, err = p.getSharedConfigFiles(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\n// sharedCredentialsFilesProvider provides access to the shared credentials filesnames\n// external configuration value.\ntype sharedCredentialsFilesProvider interface {\n\tgetSharedCredentialsFiles(ctx context.Context) ([]string, bool, error)\n}\n\n// getSharedCredentialsFiles searches the configs for a sharedCredentialsFilesProvider\n// and returns the value if found. Returns an error if a provider fails before a\n// value is found.\nfunc getSharedCredentialsFiles(ctx context.Context, configs configs) (value []string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(sharedCredentialsFilesProvider); ok {\n\t\t\tvalue, found, err = p.getSharedCredentialsFiles(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\n// customCABundleProvider provides access to the custom CA bundle PEM bytes.\ntype customCABundleProvider interface {\n\tgetCustomCABundle(ctx context.Context) (io.Reader, bool, error)\n}\n\n// getCustomCABundle searches the configs for a customCABundleProvider\n// and returns the value if found. Returns an error if a provider fails before a\n// value is found.\nfunc getCustomCABundle(ctx context.Context, configs configs) (value io.Reader, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(customCABundleProvider); ok {\n\t\t\tvalue, found, err = p.getCustomCABundle(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\n// regionProvider provides access to the region external configuration value.\ntype regionProvider interface {\n\tgetRegion(ctx context.Context) (string, bool, error)\n}\n\n// getRegion searches the configs for a regionProvider and returns the value\n// if found. Returns an error if a provider fails before a value is found.\nfunc getRegion(ctx context.Context, configs configs) (value string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(regionProvider); ok {\n\t\t\tvalue, found, err = p.getRegion(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// IgnoreConfiguredEndpointsProvider is needed to search for all providers\n// that provide a flag to disable configured endpoints.\ntype IgnoreConfiguredEndpointsProvider interface {\n\tGetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error)\n}\n\n// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured\n// endpoints feature.\nfunc GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok {\n\t\t\tvalue, found, err = p.GetIgnoreConfiguredEndpoints(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\ntype baseEndpointProvider interface {\n\tgetBaseEndpoint(ctx context.Context) (string, bool, error)\n}\n\nfunc getBaseEndpoint(ctx context.Context, configs configs) (value string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(baseEndpointProvider); ok {\n\t\t\tvalue, found, err = p.getBaseEndpoint(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\ntype servicesObjectProvider interface {\n\tgetServicesObject(ctx context.Context) (map[string]map[string]string, bool, error)\n}\n\nfunc getServicesObject(ctx context.Context, configs configs) (value map[string]map[string]string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(servicesObjectProvider); ok {\n\t\t\tvalue, found, err = p.getServicesObject(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// appIDProvider provides access to the sdk app ID value\ntype appIDProvider interface {\n\tgetAppID(ctx context.Context) (string, bool, error)\n}\n\nfunc getAppID(ctx context.Context, configs configs) (value string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(appIDProvider); ok {\n\t\t\tvalue, found, err = p.getAppID(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// disableRequestCompressionProvider provides access to the DisableRequestCompression\ntype disableRequestCompressionProvider interface {\n\tgetDisableRequestCompression(context.Context) (bool, bool, error)\n}\n\nfunc getDisableRequestCompression(ctx context.Context, configs configs) (value bool, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(disableRequestCompressionProvider); ok {\n\t\t\tvalue, found, err = p.getDisableRequestCompression(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// requestMinCompressSizeBytesProvider provides access to the MinCompressSizeBytes\ntype requestMinCompressSizeBytesProvider interface {\n\tgetRequestMinCompressSizeBytes(context.Context) (int64, bool, error)\n}\n\nfunc getRequestMinCompressSizeBytes(ctx context.Context, configs configs) (value int64, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(requestMinCompressSizeBytesProvider); ok {\n\t\t\tvalue, found, err = p.getRequestMinCompressSizeBytes(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// accountIDEndpointModeProvider provides access to the AccountIDEndpointMode\ntype accountIDEndpointModeProvider interface {\n\tgetAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error)\n}\n\nfunc getAccountIDEndpointMode(ctx context.Context, configs configs) (value aws.AccountIDEndpointMode, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(accountIDEndpointModeProvider); ok {\n\t\t\tvalue, found, err = p.getAccountIDEndpointMode(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ec2IMDSRegionProvider provides access to the ec2 imds region\n// configuration value\ntype ec2IMDSRegionProvider interface {\n\tgetEC2IMDSRegion(ctx context.Context) (string, bool, error)\n}\n\n// getEC2IMDSRegion searches the configs for a ec2IMDSRegionProvider and\n// returns the value if found. Returns an error if a provider fails before\n// a value is found.\nfunc getEC2IMDSRegion(ctx context.Context, configs configs) (region string, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif provider, ok := cfg.(ec2IMDSRegionProvider); ok {\n\t\t\tregion, found, err = provider.getEC2IMDSRegion(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// credentialsProviderProvider provides access to the credentials external\n// configuration value.\ntype credentialsProviderProvider interface {\n\tgetCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error)\n}\n\n// getCredentialsProvider searches the configs for a credentialsProviderProvider\n// and returns the value if found. Returns an error if a provider fails before a\n// value is found.\nfunc getCredentialsProvider(ctx context.Context, configs configs) (p aws.CredentialsProvider, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif provider, ok := cfg.(credentialsProviderProvider); ok {\n\t\t\tp, found, err = provider.getCredentialsProvider(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// credentialsCacheOptionsProvider is an interface for retrieving a function for setting\n// the aws.CredentialsCacheOptions.\ntype credentialsCacheOptionsProvider interface {\n\tgetCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error)\n}\n\n// getCredentialsCacheOptionsProvider is an interface for retrieving a function for setting\n// the aws.CredentialsCacheOptions.\nfunc getCredentialsCacheOptionsProvider(ctx context.Context, configs configs) (\n\tf func(*aws.CredentialsCacheOptions), found bool, err error,\n) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(credentialsCacheOptionsProvider); ok {\n\t\t\tf, found, err = p.getCredentialsCacheOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// bearerAuthTokenProviderProvider provides access to the bearer authentication\n// token external configuration value.\ntype bearerAuthTokenProviderProvider interface {\n\tgetBearerAuthTokenProvider(context.Context) (smithybearer.TokenProvider, bool, error)\n}\n\n// getBearerAuthTokenProvider searches the config sources for a\n// bearerAuthTokenProviderProvider and returns the value if found. Returns an\n// error if a provider fails before a value is found.\nfunc getBearerAuthTokenProvider(ctx context.Context, configs configs) (p smithybearer.TokenProvider, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif provider, ok := cfg.(bearerAuthTokenProviderProvider); ok {\n\t\t\tp, found, err = provider.getBearerAuthTokenProvider(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// bearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for\n// setting the smithy-go auth/bearer#TokenCacheOptions.\ntype bearerAuthTokenCacheOptionsProvider interface {\n\tgetBearerAuthTokenCacheOptions(context.Context) (func(*smithybearer.TokenCacheOptions), bool, error)\n}\n\n// getBearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for\n// setting the smithy-go auth/bearer#TokenCacheOptions.\nfunc getBearerAuthTokenCacheOptions(ctx context.Context, configs configs) (\n\tf func(*smithybearer.TokenCacheOptions), found bool, err error,\n) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(bearerAuthTokenCacheOptionsProvider); ok {\n\t\t\tf, found, err = p.getBearerAuthTokenCacheOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ssoTokenProviderOptionsProvider is an interface for retrieving a function for\n// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions.\ntype ssoTokenProviderOptionsProvider interface {\n\tgetSSOTokenProviderOptions(context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error)\n}\n\n// getSSOTokenProviderOptions is an interface for retrieving a function for\n// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions.\nfunc getSSOTokenProviderOptions(ctx context.Context, configs configs) (\n\tf func(*ssocreds.SSOTokenProviderOptions), found bool, err error,\n) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(ssoTokenProviderOptionsProvider); ok {\n\t\t\tf, found, err = p.getSSOTokenProviderOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ssoTokenProviderOptionsProvider\n\n// processCredentialOptions is an interface for retrieving a function for setting\n// the processcreds.Options.\ntype processCredentialOptions interface {\n\tgetProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error)\n}\n\n// getProcessCredentialOptions searches the slice of configs and returns the first function found\nfunc getProcessCredentialOptions(ctx context.Context, configs configs) (f func(*processcreds.Options), found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(processCredentialOptions); ok {\n\t\t\tf, found, err = p.getProcessCredentialOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ec2RoleCredentialOptionsProvider is an interface for retrieving a function\n// for setting the ec2rolecreds.Provider options.\ntype ec2RoleCredentialOptionsProvider interface {\n\tgetEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error)\n}\n\n// getEC2RoleCredentialProviderOptions searches the slice of configs and returns the first function found\nfunc getEC2RoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*ec2rolecreds.Options), found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(ec2RoleCredentialOptionsProvider); ok {\n\t\t\tf, found, err = p.getEC2RoleCredentialOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// defaultRegionProvider is an interface for retrieving a default region if a region was not resolved from other sources\ntype defaultRegionProvider interface {\n\tgetDefaultRegion(ctx context.Context) (string, bool, error)\n}\n\n// getDefaultRegion searches the slice of configs and returns the first fallback region found\nfunc getDefaultRegion(ctx context.Context, configs configs) (value string, found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(defaultRegionProvider); ok {\n\t\t\tvalue, found, err = p.getDefaultRegion(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// endpointCredentialOptionsProvider is an interface for retrieving a function for setting\n// the endpointcreds.ProviderOptions.\ntype endpointCredentialOptionsProvider interface {\n\tgetEndpointCredentialOptions(ctx context.Context) (func(*endpointcreds.Options), bool, error)\n}\n\n// getEndpointCredentialProviderOptions searches the slice of configs and returns the first function found\nfunc getEndpointCredentialProviderOptions(ctx context.Context, configs configs) (f func(*endpointcreds.Options), found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(endpointCredentialOptionsProvider); ok {\n\t\t\tf, found, err = p.getEndpointCredentialOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// webIdentityRoleCredentialOptionsProvider is an interface for retrieving a function for setting\n// the stscreds.WebIdentityRoleProvider.\ntype webIdentityRoleCredentialOptionsProvider interface {\n\tgetWebIdentityRoleCredentialOptions(ctx context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error)\n}\n\n// getWebIdentityCredentialProviderOptions searches the slice of configs and returns the first function found\nfunc getWebIdentityCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.WebIdentityRoleOptions), found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(webIdentityRoleCredentialOptionsProvider); ok {\n\t\t\tf, found, err = p.getWebIdentityRoleCredentialOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// assumeRoleCredentialOptionsProvider is an interface for retrieving a function for setting\n// the stscreds.AssumeRoleOptions.\ntype assumeRoleCredentialOptionsProvider interface {\n\tgetAssumeRoleCredentialOptions(ctx context.Context) (func(*stscreds.AssumeRoleOptions), bool, error)\n}\n\n// getAssumeRoleCredentialProviderOptions searches the slice of configs and returns the first function found\nfunc getAssumeRoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.AssumeRoleOptions), found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(assumeRoleCredentialOptionsProvider); ok {\n\t\t\tf, found, err = p.getAssumeRoleCredentialOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// HTTPClient is an HTTP client implementation\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// httpClientProvider is an interface for retrieving HTTPClient\ntype httpClientProvider interface {\n\tgetHTTPClient(ctx context.Context) (HTTPClient, bool, error)\n}\n\n// getHTTPClient searches the slice of configs and returns the HTTPClient set on configs\nfunc getHTTPClient(ctx context.Context, configs configs) (client HTTPClient, found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(httpClientProvider); ok {\n\t\t\tclient, found, err = p.getHTTPClient(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// apiOptionsProvider is an interface for retrieving APIOptions\ntype apiOptionsProvider interface {\n\tgetAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error)\n}\n\n// getAPIOptions searches the slice of configs and returns the APIOptions set on configs\nfunc getAPIOptions(ctx context.Context, configs configs) (apiOptions []func(*middleware.Stack) error, found bool, err error) {\n\tfor _, config := range configs {\n\t\tif p, ok := config.(apiOptionsProvider); ok {\n\t\t\t// retrieve APIOptions from configs and set it on cfg\n\t\t\tapiOptions, found, err = p.getAPIOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// endpointResolverProvider is an interface for retrieving an aws.EndpointResolver from a configuration source\ntype endpointResolverProvider interface {\n\tgetEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error)\n}\n\n// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used\n// to configure the aws.Config.EndpointResolver value.\nfunc getEndpointResolver(ctx context.Context, configs configs) (f aws.EndpointResolver, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(endpointResolverProvider); ok {\n\t\t\tf, found, err = p.getEndpointResolver(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// endpointResolverWithOptionsProvider is an interface for retrieving an aws.EndpointResolverWithOptions from a configuration source\ntype endpointResolverWithOptionsProvider interface {\n\tgetEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error)\n}\n\n// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used\n// to configure the aws.Config.EndpointResolver value.\nfunc getEndpointResolverWithOptions(ctx context.Context, configs configs) (f aws.EndpointResolverWithOptions, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(endpointResolverWithOptionsProvider); ok {\n\t\t\tf, found, err = p.getEndpointResolverWithOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// loggerProvider is an interface for retrieving a logging.Logger from a configuration source.\ntype loggerProvider interface {\n\tgetLogger(ctx context.Context) (logging.Logger, bool, error)\n}\n\n// getLogger searches the provided config sources for a logging.Logger that can be used\n// to configure the aws.Config.Logger value.\nfunc getLogger(ctx context.Context, configs configs) (l logging.Logger, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(loggerProvider); ok {\n\t\t\tl, found, err = p.getLogger(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// clientLogModeProvider is an interface for retrieving the aws.ClientLogMode from a configuration source.\ntype clientLogModeProvider interface {\n\tgetClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error)\n}\n\nfunc getClientLogMode(ctx context.Context, configs configs) (m aws.ClientLogMode, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(clientLogModeProvider); ok {\n\t\t\tm, found, err = p.getClientLogMode(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// retryProvider is an configuration provider for custom Retryer.\ntype retryProvider interface {\n\tgetRetryer(ctx context.Context) (func() aws.Retryer, bool, error)\n}\n\nfunc getRetryer(ctx context.Context, configs configs) (v func() aws.Retryer, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(retryProvider); ok {\n\t\t\tv, found, err = p.getRetryer(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// logConfigurationWarningsProvider is an configuration provider for\n// retrieving a boolean indicating whether configuration issues should\n// be logged when loading from config sources\ntype logConfigurationWarningsProvider interface {\n\tgetLogConfigurationWarnings(ctx context.Context) (bool, bool, error)\n}\n\nfunc getLogConfigurationWarnings(ctx context.Context, configs configs) (v bool, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(logConfigurationWarningsProvider); ok {\n\t\t\tv, found, err = p.getLogConfigurationWarnings(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ssoCredentialOptionsProvider is an interface for retrieving a function for setting\n// the ssocreds.Options.\ntype ssoCredentialOptionsProvider interface {\n\tgetSSOProviderOptions(context.Context) (func(*ssocreds.Options), bool, error)\n}\n\nfunc getSSOProviderOptions(ctx context.Context, configs configs) (v func(options *ssocreds.Options), found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(ssoCredentialOptionsProvider); ok {\n\t\t\tv, found, err = p.getSSOProviderOptions(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn v, found, err\n}\n\ntype defaultsModeIMDSClientProvider interface {\n\tgetDefaultsModeIMDSClient(context.Context) (*imds.Client, bool, error)\n}\n\nfunc getDefaultsModeIMDSClient(ctx context.Context, configs configs) (v *imds.Client, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(defaultsModeIMDSClientProvider); ok {\n\t\t\tv, found, err = p.getDefaultsModeIMDSClient(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn v, found, err\n}\n\ntype defaultsModeProvider interface {\n\tgetDefaultsMode(context.Context) (aws.DefaultsMode, bool, error)\n}\n\nfunc getDefaultsMode(ctx context.Context, configs configs) (v aws.DefaultsMode, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(defaultsModeProvider); ok {\n\t\t\tv, found, err = p.getDefaultsMode(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn v, found, err\n}\n\ntype retryMaxAttemptsProvider interface {\n\tGetRetryMaxAttempts(context.Context) (int, bool, error)\n}\n\nfunc getRetryMaxAttempts(ctx context.Context, configs configs) (v int, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(retryMaxAttemptsProvider); ok {\n\t\t\tv, found, err = p.GetRetryMaxAttempts(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn v, found, err\n}\n\ntype retryModeProvider interface {\n\tGetRetryMode(context.Context) (aws.RetryMode, bool, error)\n}\n\nfunc getRetryMode(ctx context.Context, configs configs) (v aws.RetryMode, found bool, err error) {\n\tfor _, c := range configs {\n\t\tif p, ok := c.(retryModeProvider); ok {\n\t\t\tv, found, err = p.GetRetryMode(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn v, found, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\t\"github.com/aws/smithy-go/logging\"\n)\n\n// resolveDefaultAWSConfig will write default configuration values into the cfg\n// value. It will write the default values, overwriting any previous value.\n//\n// This should be used as the first resolver in the slice of resolvers when\n// resolving external configuration.\nfunc resolveDefaultAWSConfig(ctx context.Context, cfg *aws.Config, cfgs configs) error {\n\tvar sources []interface{}\n\tfor _, s := range cfgs {\n\t\tsources = append(sources, s)\n\t}\n\n\t*cfg = aws.Config{\n\t\tLogger:        logging.NewStandardLogger(os.Stderr),\n\t\tConfigSources: sources,\n\t}\n\treturn nil\n}\n\n// resolveCustomCABundle extracts the first instance of a custom CA bundle filename\n// from the external configurations. It will update the HTTP Client's builder\n// to be configured with the custom CA bundle.\n//\n// Config provider used:\n// * customCABundleProvider\nfunc resolveCustomCABundle(ctx context.Context, cfg *aws.Config, cfgs configs) error {\n\tpemCerts, found, err := getCustomCABundle(ctx, cfgs)\n\tif err != nil {\n\t\t// TODO error handling, What is the best way to handle this?\n\t\t// capture previous errors continue. error out if all errors\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tif cfg.HTTPClient == nil {\n\t\tcfg.HTTPClient = awshttp.NewBuildableClient()\n\t}\n\n\ttrOpts, ok := cfg.HTTPClient.(*awshttp.BuildableClient)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unable to add custom RootCAs HTTPClient, \"+\n\t\t\t\"has no WithTransportOptions, %T\", cfg.HTTPClient)\n\t}\n\n\tvar appendErr error\n\tclient := trOpts.WithTransportOptions(func(tr *http.Transport) {\n\t\tif tr.TLSClientConfig == nil {\n\t\t\ttr.TLSClientConfig = &tls.Config{}\n\t\t}\n\t\tif tr.TLSClientConfig.RootCAs == nil {\n\t\t\ttr.TLSClientConfig.RootCAs = x509.NewCertPool()\n\t\t}\n\n\t\tb, err := ioutil.ReadAll(pemCerts)\n\t\tif err != nil {\n\t\t\tappendErr = fmt.Errorf(\"failed to read custom CA bundle PEM file\")\n\t\t}\n\n\t\tif !tr.TLSClientConfig.RootCAs.AppendCertsFromPEM(b) {\n\t\t\tappendErr = fmt.Errorf(\"failed to load custom CA bundle PEM file\")\n\t\t}\n\t})\n\tif appendErr != nil {\n\t\treturn appendErr\n\t}\n\n\tcfg.HTTPClient = client\n\treturn err\n}\n\n// resolveRegion extracts the first instance of a Region from the configs slice.\n//\n// Config providers used:\n// * regionProvider\nfunc resolveRegion(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tv, found, err := getRegion(ctx, configs)\n\tif err != nil {\n\t\t// TODO error handling, What is the best way to handle this?\n\t\t// capture previous errors continue. error out if all errors\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.Region = v\n\treturn nil\n}\n\nfunc resolveBaseEndpoint(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tvar downcastCfgSources []interface{}\n\tfor _, cs := range configs {\n\t\tdowncastCfgSources = append(downcastCfgSources, interface{}(cs))\n\t}\n\n\tif val, found, err := GetIgnoreConfiguredEndpoints(ctx, downcastCfgSources); found && val && err == nil {\n\t\tcfg.BaseEndpoint = nil\n\t\treturn nil\n\t}\n\n\tv, found, err := getBaseEndpoint(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !found {\n\t\treturn nil\n\t}\n\tcfg.BaseEndpoint = aws.String(v)\n\treturn nil\n}\n\n// resolveAppID extracts the sdk app ID from the configs slice's SharedConfig or env var\nfunc resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tID, _, err := getAppID(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcfg.AppID = ID\n\treturn nil\n}\n\n// resolveDisableRequestCompression extracts the DisableRequestCompression from the configs slice's\n// SharedConfig or EnvConfig\nfunc resolveDisableRequestCompression(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tdisable, _, err := getDisableRequestCompression(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcfg.DisableRequestCompression = disable\n\treturn nil\n}\n\n// resolveRequestMinCompressSizeBytes extracts the RequestMinCompressSizeBytes from the configs slice's\n// SharedConfig or EnvConfig\nfunc resolveRequestMinCompressSizeBytes(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tminBytes, found, err := getRequestMinCompressSizeBytes(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// must set a default min size 10240 if not configured\n\tif !found {\n\t\tminBytes = 10240\n\t}\n\tcfg.RequestMinCompressSizeBytes = minBytes\n\treturn nil\n}\n\n// resolveAccountIDEndpointMode extracts the AccountIDEndpointMode from the configs slice's\n// SharedConfig or EnvConfig\nfunc resolveAccountIDEndpointMode(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tm, found, err := getAccountIDEndpointMode(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !found {\n\t\tm = aws.AccountIDEndpointModePreferred\n\t}\n\n\tcfg.AccountIDEndpointMode = m\n\treturn nil\n}\n\n// resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default\n// region if region had not been resolved from other sources.\nfunc resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tif len(cfg.Region) > 0 {\n\t\treturn nil\n\t}\n\n\tv, found, err := getDefaultRegion(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.Region = v\n\n\treturn nil\n}\n\n// resolveHTTPClient extracts the first instance of a HTTPClient and sets `aws.Config.HTTPClient` to the HTTPClient instance\n// if one has not been resolved from other sources.\nfunc resolveHTTPClient(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tc, found, err := getHTTPClient(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.HTTPClient = c\n\treturn nil\n}\n\n// resolveAPIOptions extracts the first instance of APIOptions and sets `aws.Config.APIOptions` to the resolved API options\n// if one has not been resolved from other sources.\nfunc resolveAPIOptions(ctx context.Context, cfg *aws.Config, configs configs) error {\n\to, found, err := getAPIOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.APIOptions = o\n\n\treturn nil\n}\n\n// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice\n// and sets the functions result on the aws.Config.EndpointResolver\nfunc resolveEndpointResolver(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tendpointResolver, found, err := getEndpointResolver(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.EndpointResolver = endpointResolver\n\n\treturn nil\n}\n\n// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice\n// and sets the functions result on the aws.Config.EndpointResolver\nfunc resolveEndpointResolverWithOptions(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tendpointResolver, found, err := getEndpointResolverWithOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.EndpointResolverWithOptions = endpointResolver\n\n\treturn nil\n}\n\nfunc resolveLogger(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tlogger, found, err := getLogger(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.Logger = logger\n\n\treturn nil\n}\n\nfunc resolveClientLogMode(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tmode, found, err := getClientLogMode(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.ClientLogMode = mode\n\n\treturn nil\n}\n\nfunc resolveRetryer(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tretryer, found, err := getRetryer(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif found {\n\t\tcfg.Retryer = retryer\n\t\treturn nil\n\t}\n\n\t// Only load the retry options if a custom retryer has not be specified.\n\tif err = resolveRetryMaxAttempts(ctx, cfg, configs); err != nil {\n\t\treturn err\n\t}\n\treturn resolveRetryMode(ctx, cfg, configs)\n}\n\nfunc resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tif len(cfg.Region) > 0 {\n\t\treturn nil\n\t}\n\n\tregion, found, err := getEC2IMDSRegion(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\treturn nil\n\t}\n\n\tcfg.Region = region\n\n\treturn nil\n}\n\nfunc resolveDefaultsModeOptions(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tdefaultsMode, found, err := getDefaultsMode(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\tdefaultsMode = aws.DefaultsModeLegacy\n\t}\n\n\tvar environment aws.RuntimeEnvironment\n\tif defaultsMode == aws.DefaultsModeAuto {\n\t\tenvConfig, _, _ := getAWSConfigSources(configs)\n\n\t\tclient, found, err := getDefaultsModeIMDSClient(ctx, configs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !found {\n\t\t\tclient = imds.NewFromConfig(*cfg)\n\t\t}\n\n\t\tenvironment, err = resolveDefaultsModeRuntimeEnvironment(ctx, envConfig, client)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcfg.DefaultsMode = defaultsMode\n\tcfg.RuntimeEnvironment = environment\n\n\treturn nil\n}\n\nfunc resolveRetryMaxAttempts(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tmaxAttempts, found, err := getRetryMaxAttempts(ctx, configs)\n\tif err != nil || !found {\n\t\treturn err\n\t}\n\tcfg.RetryMaxAttempts = maxAttempts\n\n\treturn nil\n}\n\nfunc resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tretryMode, found, err := getRetryMode(ctx, configs)\n\tif err != nil || !found {\n\t\treturn err\n\t}\n\tcfg.RetryMode = retryMode\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ssocreds\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssooidc\"\n\tsmithybearer \"github.com/aws/smithy-go/auth/bearer\"\n)\n\n// resolveBearerAuthToken extracts a token provider from the config sources.\n//\n// If an explicit bearer authentication token provider is not found the\n// resolver will fallback to resolving token provider via other config sources\n// such as SharedConfig.\nfunc resolveBearerAuthToken(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tfound, err := resolveBearerAuthTokenProvider(ctx, cfg, configs)\n\tif found || err != nil {\n\t\treturn err\n\t}\n\n\treturn resolveBearerAuthTokenProviderChain(ctx, cfg, configs)\n}\n\n// resolveBearerAuthTokenProvider extracts the first instance of\n// BearerAuthTokenProvider from the config sources.\n//\n// The resolved BearerAuthTokenProvider will be wrapped in a cache to ensure\n// the Token is only refreshed when needed. This also protects the\n// TokenProvider so it can be used concurrently.\n//\n// Config providers used:\n// * bearerAuthTokenProviderProvider\nfunc resolveBearerAuthTokenProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) {\n\ttokenProvider, found, err := getBearerAuthTokenProvider(ctx, configs)\n\tif !found || err != nil {\n\t\treturn false, err\n\t}\n\n\tcfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache(\n\t\tctx, configs, tokenProvider)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}\n\nfunc resolveBearerAuthTokenProviderChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) {\n\t_, sharedConfig, _ := getAWSConfigSources(configs)\n\n\tvar provider smithybearer.TokenProvider\n\n\tif sharedConfig.SSOSession != nil {\n\t\tprovider, err = resolveBearerAuthSSOTokenProvider(\n\t\t\tctx, cfg, sharedConfig.SSOSession, configs)\n\t}\n\n\tif err == nil && provider != nil {\n\t\tcfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache(\n\t\t\tctx, configs, provider)\n\t}\n\n\treturn err\n}\n\nfunc resolveBearerAuthSSOTokenProvider(ctx context.Context, cfg *aws.Config, session *SSOSession, configs configs) (*ssocreds.SSOTokenProvider, error) {\n\tssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get SSOTokenProviderOptions from config sources, %w\", err)\n\t}\n\n\tvar optFns []func(*ssocreds.SSOTokenProviderOptions)\n\tif found {\n\t\toptFns = append(optFns, ssoTokenProviderOptionsFn)\n\t}\n\n\tcachePath, err := ssocreds.StandardCachedTokenFilepath(session.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get SSOTokenProvider's cache path, %w\", err)\n\t}\n\n\tclient := ssooidc.NewFromConfig(*cfg)\n\tprovider := ssocreds.NewSSOTokenProvider(client, cachePath, optFns...)\n\n\treturn provider, nil\n}\n\n// wrapWithBearerAuthTokenCache will wrap provider with an smithy-go\n// bearer/auth#TokenCache with the provided options if the provider is not\n// already a TokenCache.\nfunc wrapWithBearerAuthTokenCache(\n\tctx context.Context,\n\tcfgs configs,\n\tprovider smithybearer.TokenProvider,\n\toptFns ...func(*smithybearer.TokenCacheOptions),\n) (smithybearer.TokenProvider, error) {\n\t_, ok := provider.(*smithybearer.TokenCache)\n\tif ok {\n\t\treturn provider, nil\n\t}\n\n\ttokenCacheConfigOptions, optionsFound, err := getBearerAuthTokenCacheOptions(ctx, cfgs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts := make([]func(*smithybearer.TokenCacheOptions), 0, 2+len(optFns))\n\topts = append(opts, func(o *smithybearer.TokenCacheOptions) {\n\t\to.RefreshBeforeExpires = 5 * time.Minute\n\t\to.RetrieveBearerTokenTimeout = 30 * time.Second\n\t})\n\topts = append(opts, optFns...)\n\tif optionsFound {\n\t\topts = append(opts, tokenCacheConfigOptions)\n\t}\n\n\treturn smithybearer.NewTokenCache(provider, opts...), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go",
    "content": "package config\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/url\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/endpointcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/processcreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/ssocreds\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssooidc\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts\"\n)\n\nconst (\n\t// valid credential source values\n\tcredSourceEc2Metadata      = \"Ec2InstanceMetadata\"\n\tcredSourceEnvironment      = \"Environment\"\n\tcredSourceECSContainer     = \"EcsContainer\"\n\thttpProviderAuthFileEnvVar = \"AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE\"\n)\n\n// direct representation of the IPv4 address for the ECS container\n// \"169.254.170.2\"\nvar ecsContainerIPv4 net.IP = []byte{\n\t169, 254, 170, 2,\n}\n\n// direct representation of the IPv4 address for the EKS container\n// \"169.254.170.23\"\nvar eksContainerIPv4 net.IP = []byte{\n\t169, 254, 170, 23,\n}\n\n// direct representation of the IPv6 address for the EKS container\n// \"fd00:ec2::23\"\nvar eksContainerIPv6 net.IP = []byte{\n\t0xFD, 0, 0xE, 0xC2,\n\t0, 0, 0, 0,\n\t0, 0, 0, 0,\n\t0, 0, 0, 0x23,\n}\n\nvar (\n\tecsContainerEndpoint = \"http://169.254.170.2\" // not constant to allow for swapping during unit-testing\n)\n\n// resolveCredentials extracts a credential provider from slice of config\n// sources.\n//\n// If an explicit credential provider is not found the resolver will fallback\n// to resolving credentials by extracting a credential provider from EnvConfig\n// and SharedConfig.\nfunc resolveCredentials(ctx context.Context, cfg *aws.Config, configs configs) error {\n\tfound, err := resolveCredentialProvider(ctx, cfg, configs)\n\tif found || err != nil {\n\t\treturn err\n\t}\n\n\treturn resolveCredentialChain(ctx, cfg, configs)\n}\n\n// resolveCredentialProvider extracts the first instance of Credentials from the\n// config slices.\n//\n// The resolved CredentialProvider will be wrapped in a cache to ensure the\n// credentials are only refreshed when needed. This also protects the\n// credential provider to be used concurrently.\n//\n// Config providers used:\n// * credentialsProviderProvider\nfunc resolveCredentialProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) {\n\tcredProvider, found, err := getCredentialsProvider(ctx, configs)\n\tif !found || err != nil {\n\t\treturn false, err\n\t}\n\n\tcfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, credProvider)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}\n\n// resolveCredentialChain resolves a credential provider chain using EnvConfig\n// and SharedConfig if present in the slice of provided configs.\n//\n// The resolved CredentialProvider will be wrapped in a cache to ensure the\n// credentials are only refreshed when needed. This also protects the\n// credential provider to be used concurrently.\nfunc resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) {\n\tenvConfig, sharedConfig, other := getAWSConfigSources(configs)\n\n\t// When checking if a profile was specified programmatically we should only consider the \"other\"\n\t// configuration sources that have been provided. This ensures we correctly honor the expected credential\n\t// hierarchy.\n\t_, sharedProfileSet, err := getSharedConfigProfile(ctx, other)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch {\n\tcase sharedProfileSet:\n\t\terr = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)\n\tcase envConfig.Credentials.HasKeys():\n\t\tcfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials}\n\tcase len(envConfig.WebIdentityTokenFilePath) > 0:\n\t\terr = assumeWebIdentity(ctx, cfg, envConfig.WebIdentityTokenFilePath, envConfig.RoleARN, envConfig.RoleSessionName, configs)\n\tdefault:\n\t\terr = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Wrap the resolved provider in a cache so the SDK will cache credentials.\n\tcfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, cfg.Credentials)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedConfig *SharedConfig, configs configs) (err error) {\n\n\tswitch {\n\tcase sharedConfig.Source != nil:\n\t\t// Assume IAM role with credentials source from a different profile.\n\t\terr = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig.Source, configs)\n\n\tcase sharedConfig.Credentials.HasKeys():\n\t\t// Static Credentials from Shared Config/Credentials file.\n\t\tcfg.Credentials = credentials.StaticCredentialsProvider{\n\t\t\tValue: sharedConfig.Credentials,\n\t\t}\n\n\tcase len(sharedConfig.CredentialSource) != 0:\n\t\terr = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs)\n\n\tcase len(sharedConfig.WebIdentityTokenFile) != 0:\n\t\t// Credentials from Assume Web Identity token require an IAM Role, and\n\t\t// that roll will be assumed. May be wrapped with another assume role\n\t\t// via SourceProfile.\n\t\treturn assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs)\n\n\tcase sharedConfig.hasSSOConfiguration():\n\t\terr = resolveSSOCredentials(ctx, cfg, sharedConfig, configs)\n\n\tcase len(sharedConfig.CredentialProcess) != 0:\n\t\t// Get credentials from CredentialProcess\n\t\terr = processCredentials(ctx, cfg, sharedConfig, configs)\n\n\tcase len(envConfig.ContainerCredentialsEndpoint) != 0:\n\t\terr = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs)\n\n\tcase len(envConfig.ContainerCredentialsRelativePath) != 0:\n\t\terr = resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs)\n\n\tdefault:\n\t\terr = resolveEC2RoleCredentials(ctx, cfg, configs)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(sharedConfig.RoleARN) > 0 {\n\t\treturn credsFromAssumeRole(ctx, cfg, sharedConfig, configs)\n\t}\n\n\treturn nil\n}\n\nfunc resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error {\n\tif err := sharedConfig.validateSSOConfiguration(); err != nil {\n\t\treturn err\n\t}\n\n\tvar options []func(*ssocreds.Options)\n\tv, found, err := getSSOProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\toptions = append(options, v)\n\t}\n\n\tcfgCopy := cfg.Copy()\n\n\tif sharedConfig.SSOSession != nil {\n\t\tssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get SSOTokenProviderOptions from config sources, %w\", err)\n\t\t}\n\t\tvar optFns []func(*ssocreds.SSOTokenProviderOptions)\n\t\tif found {\n\t\t\toptFns = append(optFns, ssoTokenProviderOptionsFn)\n\t\t}\n\t\tcfgCopy.Region = sharedConfig.SSOSession.SSORegion\n\t\tcachedPath, err := ssocreds.StandardCachedTokenFilepath(sharedConfig.SSOSession.Name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\toidcClient := ssooidc.NewFromConfig(cfgCopy)\n\t\ttokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath, optFns...)\n\t\toptions = append(options, func(o *ssocreds.Options) {\n\t\t\to.SSOTokenProvider = tokenProvider\n\t\t\to.CachedTokenFilepath = cachedPath\n\t\t})\n\t} else {\n\t\tcfgCopy.Region = sharedConfig.SSORegion\n\t}\n\n\tcfg.Credentials = ssocreds.New(sso.NewFromConfig(cfgCopy), sharedConfig.SSOAccountID, sharedConfig.SSORoleName, sharedConfig.SSOStartURL, options...)\n\n\treturn nil\n}\n\nfunc ecsContainerURI(path string) string {\n\treturn fmt.Sprintf(\"%s%s\", ecsContainerEndpoint, path)\n}\n\nfunc processCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error {\n\tvar opts []func(*processcreds.Options)\n\n\toptions, found, err := getProcessCredentialOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\topts = append(opts, options)\n\t}\n\n\tcfg.Credentials = processcreds.NewProvider(sharedConfig.CredentialProcess, opts...)\n\n\treturn nil\n}\n\n// isAllowedHost allows host to be loopback or known ECS/EKS container IPs\n//\n// host can either be an IP address OR an unresolved hostname - resolution will\n// be automatically performed in the latter case\nfunc isAllowedHost(host string) (bool, error) {\n\tif ip := net.ParseIP(host); ip != nil {\n\t\treturn isIPAllowed(ip), nil\n\t}\n\n\taddrs, err := lookupHostFn(host)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor _, addr := range addrs {\n\t\tif ip := net.ParseIP(addr); ip == nil || !isIPAllowed(ip) {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc isIPAllowed(ip net.IP) bool {\n\treturn ip.IsLoopback() ||\n\t\tip.Equal(ecsContainerIPv4) ||\n\t\tip.Equal(eksContainerIPv4) ||\n\t\tip.Equal(eksContainerIPv6)\n}\n\nfunc resolveLocalHTTPCredProvider(ctx context.Context, cfg *aws.Config, endpointURL, authToken string, configs configs) error {\n\tvar resolveErr error\n\n\tparsed, err := url.Parse(endpointURL)\n\tif err != nil {\n\t\tresolveErr = fmt.Errorf(\"invalid URL, %w\", err)\n\t} else {\n\t\thost := parsed.Hostname()\n\t\tif len(host) == 0 {\n\t\t\tresolveErr = fmt.Errorf(\"unable to parse host from local HTTP cred provider URL\")\n\t\t} else if parsed.Scheme == \"http\" {\n\t\t\tif isAllowedHost, allowHostErr := isAllowedHost(host); allowHostErr != nil {\n\t\t\t\tresolveErr = fmt.Errorf(\"failed to resolve host %q, %v\", host, allowHostErr)\n\t\t\t} else if !isAllowedHost {\n\t\t\t\tresolveErr = fmt.Errorf(\"invalid endpoint host, %q, only loopback/ecs/eks hosts are allowed\", host)\n\t\t\t}\n\t\t}\n\t}\n\n\tif resolveErr != nil {\n\t\treturn resolveErr\n\t}\n\n\treturn resolveHTTPCredProvider(ctx, cfg, endpointURL, authToken, configs)\n}\n\nfunc resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToken string, configs configs) error {\n\toptFns := []func(*endpointcreds.Options){\n\t\tfunc(options *endpointcreds.Options) {\n\t\t\tif len(authToken) != 0 {\n\t\t\t\toptions.AuthorizationToken = authToken\n\t\t\t}\n\t\t\tif authFilePath := os.Getenv(httpProviderAuthFileEnvVar); authFilePath != \"\" {\n\t\t\t\toptions.AuthorizationTokenProvider = endpointcreds.TokenProviderFunc(func() (string, error) {\n\t\t\t\t\tvar contents []byte\n\t\t\t\t\tvar err error\n\t\t\t\t\tif contents, err = ioutil.ReadFile(authFilePath); err != nil {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to read authorization token from %v: %v\", authFilePath, err)\n\t\t\t\t\t}\n\t\t\t\t\treturn string(contents), nil\n\t\t\t\t})\n\t\t\t}\n\t\t\toptions.APIOptions = cfg.APIOptions\n\t\t\tif cfg.Retryer != nil {\n\t\t\t\toptions.Retryer = cfg.Retryer()\n\t\t\t}\n\t\t},\n\t}\n\n\toptFn, found, err := getEndpointCredentialProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\toptFns = append(optFns, optFn)\n\t}\n\n\tprovider := endpointcreds.New(url, optFns...)\n\n\tcfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider, func(options *aws.CredentialsCacheOptions) {\n\t\toptions.ExpiryWindow = 5 * time.Minute\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedCfg *SharedConfig, configs configs) (err error) {\n\tswitch sharedCfg.CredentialSource {\n\tcase credSourceEc2Metadata:\n\t\treturn resolveEC2RoleCredentials(ctx, cfg, configs)\n\n\tcase credSourceEnvironment:\n\t\tcfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials}\n\n\tcase credSourceECSContainer:\n\t\tif len(envConfig.ContainerCredentialsRelativePath) == 0 {\n\t\t\treturn fmt.Errorf(\"EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set\")\n\t\t}\n\t\treturn resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment\")\n\t}\n\n\treturn nil\n}\n\nfunc resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs configs) error {\n\toptFns := make([]func(*ec2rolecreds.Options), 0, 2)\n\n\toptFn, found, err := getEC2RoleCredentialProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\toptFns = append(optFns, optFn)\n\t}\n\n\toptFns = append(optFns, func(o *ec2rolecreds.Options) {\n\t\t// Only define a client from config if not already defined.\n\t\tif o.Client == nil {\n\t\t\to.Client = imds.NewFromConfig(*cfg)\n\t\t}\n\t})\n\n\tprovider := ec2rolecreds.New(optFns...)\n\n\tcfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc getAWSConfigSources(cfgs configs) (*EnvConfig, *SharedConfig, configs) {\n\tvar (\n\t\tenvConfig    *EnvConfig\n\t\tsharedConfig *SharedConfig\n\t\tother        configs\n\t)\n\n\tfor i := range cfgs {\n\t\tswitch c := cfgs[i].(type) {\n\t\tcase EnvConfig:\n\t\t\tif envConfig == nil {\n\t\t\t\tenvConfig = &c\n\t\t\t}\n\t\tcase *EnvConfig:\n\t\t\tif envConfig == nil {\n\t\t\t\tenvConfig = c\n\t\t\t}\n\t\tcase SharedConfig:\n\t\t\tif sharedConfig == nil {\n\t\t\t\tsharedConfig = &c\n\t\t\t}\n\t\tcase *SharedConfig:\n\t\t\tif envConfig == nil {\n\t\t\t\tsharedConfig = c\n\t\t\t}\n\t\tdefault:\n\t\t\tother = append(other, c)\n\t\t}\n\t}\n\n\tif envConfig == nil {\n\t\tenvConfig = &EnvConfig{}\n\t}\n\n\tif sharedConfig == nil {\n\t\tsharedConfig = &SharedConfig{}\n\t}\n\n\treturn envConfig, sharedConfig, other\n}\n\n// AssumeRoleTokenProviderNotSetError is an error returned when creating a\n// session when the MFAToken option is not set when shared config is configured\n// load assume a role with an MFA token.\ntype AssumeRoleTokenProviderNotSetError struct{}\n\n// Error is the error message\nfunc (e AssumeRoleTokenProviderNotSetError) Error() string {\n\treturn fmt.Sprintf(\"assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.\")\n}\n\nfunc assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, roleARN, sessionName string, configs configs) error {\n\tif len(filepath) == 0 {\n\t\treturn fmt.Errorf(\"token file path is not set\")\n\t}\n\n\toptFns := []func(*stscreds.WebIdentityRoleOptions){\n\t\tfunc(options *stscreds.WebIdentityRoleOptions) {\n\t\t\toptions.RoleSessionName = sessionName\n\t\t},\n\t}\n\n\toptFn, found, err := getWebIdentityCredentialProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif found {\n\t\toptFns = append(optFns, optFn)\n\t}\n\n\topts := stscreds.WebIdentityRoleOptions{\n\t\tRoleARN: roleARN,\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&opts)\n\t}\n\n\tif len(opts.RoleARN) == 0 {\n\t\treturn fmt.Errorf(\"role ARN is not set\")\n\t}\n\n\tclient := opts.Client\n\tif client == nil {\n\t\tclient = sts.NewFromConfig(*cfg)\n\t}\n\n\tprovider := stscreds.NewWebIdentityRoleProvider(client, roleARN, stscreds.IdentityTokenFile(filepath), optFns...)\n\n\tcfg.Credentials = provider\n\n\treturn nil\n}\n\nfunc credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *SharedConfig, configs configs) (err error) {\n\toptFns := []func(*stscreds.AssumeRoleOptions){\n\t\tfunc(options *stscreds.AssumeRoleOptions) {\n\t\t\toptions.RoleSessionName = sharedCfg.RoleSessionName\n\t\t\tif sharedCfg.RoleDurationSeconds != nil {\n\t\t\t\tif *sharedCfg.RoleDurationSeconds/time.Minute > 15 {\n\t\t\t\t\toptions.Duration = *sharedCfg.RoleDurationSeconds\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Assume role with external ID\n\t\t\tif len(sharedCfg.ExternalID) > 0 {\n\t\t\t\toptions.ExternalID = aws.String(sharedCfg.ExternalID)\n\t\t\t}\n\n\t\t\t// Assume role with MFA\n\t\t\tif len(sharedCfg.MFASerial) != 0 {\n\t\t\t\toptions.SerialNumber = aws.String(sharedCfg.MFASerial)\n\t\t\t}\n\t\t},\n\t}\n\n\toptFn, found, err := getAssumeRoleCredentialProviderOptions(ctx, configs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\toptFns = append(optFns, optFn)\n\t}\n\n\t{\n\t\t// Synthesize options early to validate configuration errors sooner to ensure a token provider\n\t\t// is present if the SerialNumber was set.\n\t\tvar o stscreds.AssumeRoleOptions\n\t\tfor _, fn := range optFns {\n\t\t\tfn(&o)\n\t\t}\n\t\tif o.TokenProvider == nil && o.SerialNumber != nil {\n\t\t\treturn AssumeRoleTokenProviderNotSetError{}\n\t\t}\n\t}\n\n\tcfg.Credentials = stscreds.NewAssumeRoleProvider(sts.NewFromConfig(*cfg), sharedCfg.RoleARN, optFns...)\n\n\treturn nil\n}\n\n// wrapWithCredentialsCache will wrap provider with an aws.CredentialsCache\n// with the provided options if the provider is not already a\n// aws.CredentialsCache.\nfunc wrapWithCredentialsCache(\n\tctx context.Context,\n\tcfgs configs,\n\tprovider aws.CredentialsProvider,\n\toptFns ...func(options *aws.CredentialsCacheOptions),\n) (aws.CredentialsProvider, error) {\n\t_, ok := provider.(*aws.CredentialsCache)\n\tif ok {\n\t\treturn provider, nil\n\t}\n\n\tcredCacheOptions, optionsFound, err := getCredentialsCacheOptionsProvider(ctx, cfgs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// force allocation of a new slice if the additional options are\n\t// needed, to prevent overwriting the passed in slice of options.\n\toptFns = optFns[:len(optFns):len(optFns)]\n\tif optionsFound {\n\t\toptFns = append(optFns, credCacheOptions)\n\t}\n\n\treturn aws.NewCredentialsCache(provider, optFns...), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go",
    "content": "package config\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/ini\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/shareddefaults\"\n\t\"github.com/aws/smithy-go/logging\"\n\tsmithyrequestcompression \"github.com/aws/smithy-go/private/requestcompression\"\n)\n\nconst (\n\t// Prefix to use for filtering profiles. The profile prefix should only\n\t// exist in the shared config file, not the credentials file.\n\tprofilePrefix = `profile `\n\n\t// Prefix to be used for SSO sections. These are supposed to only exist in\n\t// the shared config file, not the credentials file.\n\tssoSectionPrefix = `sso-session `\n\n\t// Prefix for services section. It is referenced in profile via the services\n\t// parameter to configure clients for service-specific parameters.\n\tservicesPrefix = `services `\n\n\t// string equivalent for boolean\n\tendpointDiscoveryDisabled = `false`\n\tendpointDiscoveryEnabled  = `true`\n\tendpointDiscoveryAuto     = `auto`\n\n\t// Static Credentials group\n\taccessKeyIDKey  = `aws_access_key_id`     // group required\n\tsecretAccessKey = `aws_secret_access_key` // group required\n\tsessionTokenKey = `aws_session_token`     // optional\n\n\t// Assume Role Credentials group\n\troleArnKey             = `role_arn`          // group required\n\tsourceProfileKey       = `source_profile`    // group required\n\tcredentialSourceKey    = `credential_source` // group required (or source_profile)\n\texternalIDKey          = `external_id`       // optional\n\tmfaSerialKey           = `mfa_serial`        // optional\n\troleSessionNameKey     = `role_session_name` // optional\n\troleDurationSecondsKey = \"duration_seconds\"  // optional\n\n\t// AWS Single Sign-On (AWS SSO) group\n\tssoSessionNameKey = \"sso_session\"\n\n\tssoRegionKey   = \"sso_region\"\n\tssoStartURLKey = \"sso_start_url\"\n\n\tssoAccountIDKey = \"sso_account_id\"\n\tssoRoleNameKey  = \"sso_role_name\"\n\n\t// Additional Config fields\n\tregionKey = `region`\n\n\t// endpoint discovery group\n\tenableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional\n\n\t// External Credential process\n\tcredentialProcessKey = `credential_process` // optional\n\n\t// Web Identity Token File\n\twebIdentityTokenFileKey = `web_identity_token_file` // optional\n\n\t// S3 ARN Region Usage\n\ts3UseARNRegionKey = \"s3_use_arn_region\"\n\n\tec2MetadataServiceEndpointModeKey = \"ec2_metadata_service_endpoint_mode\"\n\n\tec2MetadataServiceEndpointKey = \"ec2_metadata_service_endpoint\"\n\n\tec2MetadataV1DisabledKey = \"ec2_metadata_v1_disabled\"\n\n\t// Use DualStack Endpoint Resolution\n\tuseDualStackEndpoint = \"use_dualstack_endpoint\"\n\n\t// DefaultSharedConfigProfile is the default profile to be used when\n\t// loading configuration from the config files if another profile name\n\t// is not provided.\n\tDefaultSharedConfigProfile = `default`\n\n\t// S3 Disable Multi-Region AccessPoints\n\ts3DisableMultiRegionAccessPointsKey = `s3_disable_multiregion_access_points`\n\n\tuseFIPSEndpointKey = \"use_fips_endpoint\"\n\n\tdefaultsModeKey = \"defaults_mode\"\n\n\t// Retry options\n\tretryMaxAttemptsKey = \"max_attempts\"\n\tretryModeKey        = \"retry_mode\"\n\n\tcaBundleKey = \"ca_bundle\"\n\n\tsdkAppID = \"sdk_ua_app_id\"\n\n\tignoreConfiguredEndpoints = \"ignore_configured_endpoint_urls\"\n\n\tendpointURL = \"endpoint_url\"\n\n\tservicesSectionKey = \"services\"\n\n\tdisableRequestCompression      = \"disable_request_compression\"\n\trequestMinCompressionSizeBytes = \"request_min_compression_size_bytes\"\n\n\ts3DisableExpressSessionAuthKey = \"s3_disable_express_session_auth\"\n\n\taccountIDKey          = \"aws_account_id\"\n\taccountIDEndpointMode = \"account_id_endpoint_mode\"\n)\n\n// defaultSharedConfigProfile allows for swapping the default profile for testing\nvar defaultSharedConfigProfile = DefaultSharedConfigProfile\n\n// DefaultSharedCredentialsFilename returns the SDK's default file path\n// for the shared credentials file.\n//\n// Builds the shared config file path based on the OS's platform.\n//\n//   - Linux/Unix: $HOME/.aws/credentials\n//   - Windows: %USERPROFILE%\\.aws\\credentials\nfunc DefaultSharedCredentialsFilename() string {\n\treturn filepath.Join(shareddefaults.UserHomeDir(), \".aws\", \"credentials\")\n}\n\n// DefaultSharedConfigFilename returns the SDK's default file path for\n// the shared config file.\n//\n// Builds the shared config file path based on the OS's platform.\n//\n//   - Linux/Unix: $HOME/.aws/config\n//   - Windows: %USERPROFILE%\\.aws\\config\nfunc DefaultSharedConfigFilename() string {\n\treturn filepath.Join(shareddefaults.UserHomeDir(), \".aws\", \"config\")\n}\n\n// DefaultSharedConfigFiles is a slice of the default shared config files that\n// the will be used in order to load the SharedConfig.\nvar DefaultSharedConfigFiles = []string{\n\tDefaultSharedConfigFilename(),\n}\n\n// DefaultSharedCredentialsFiles is a slice of the default shared credentials\n// files that the will be used in order to load the SharedConfig.\nvar DefaultSharedCredentialsFiles = []string{\n\tDefaultSharedCredentialsFilename(),\n}\n\n// SSOSession provides the shared configuration parameters of the sso-session\n// section.\ntype SSOSession struct {\n\tName        string\n\tSSORegion   string\n\tSSOStartURL string\n}\n\nfunc (s *SSOSession) setFromIniSection(section ini.Section) {\n\tupdateString(&s.Name, section, ssoSessionNameKey)\n\tupdateString(&s.SSORegion, section, ssoRegionKey)\n\tupdateString(&s.SSOStartURL, section, ssoStartURLKey)\n}\n\n// Services contains values configured in the services section\n// of the AWS configuration file.\ntype Services struct {\n\t// Services section values\n\t// {\"serviceId\": {\"key\": \"value\"}}\n\t// e.g. {\"s3\": {\"endpoint_url\": \"example.com\"}}\n\tServiceValues map[string]map[string]string\n}\n\nfunc (s *Services) setFromIniSection(section ini.Section) {\n\tif s.ServiceValues == nil {\n\t\ts.ServiceValues = make(map[string]map[string]string)\n\t}\n\tfor _, service := range section.List() {\n\t\ts.ServiceValues[service] = section.Map(service)\n\t}\n}\n\n// SharedConfig represents the configuration fields of the SDK config files.\ntype SharedConfig struct {\n\tProfile string\n\n\t// Credentials values from the config file. Both aws_access_key_id\n\t// and aws_secret_access_key must be provided together in the same file\n\t// to be considered valid. The values will be ignored if not a complete group.\n\t// aws_session_token is an optional field that can be provided if both of the\n\t// other two fields are also provided.\n\t//\n\t//\taws_access_key_id\n\t//\taws_secret_access_key\n\t//\taws_session_token\n\tCredentials aws.Credentials\n\n\tCredentialSource     string\n\tCredentialProcess    string\n\tWebIdentityTokenFile string\n\n\t// SSO session options\n\tSSOSessionName string\n\tSSOSession     *SSOSession\n\n\t// Legacy SSO session options\n\tSSORegion   string\n\tSSOStartURL string\n\n\t// SSO fields not used\n\tSSOAccountID string\n\tSSORoleName  string\n\n\tRoleARN             string\n\tExternalID          string\n\tMFASerial           string\n\tRoleSessionName     string\n\tRoleDurationSeconds *time.Duration\n\n\tSourceProfileName string\n\tSource            *SharedConfig\n\n\t// Region is the region the SDK should use for looking up AWS service endpoints\n\t// and signing requests.\n\t//\n\t//\tregion = us-west-2\n\tRegion string\n\n\t// EnableEndpointDiscovery can be enabled or disabled in the shared config\n\t// by setting endpoint_discovery_enabled to true, or false respectively.\n\t//\n\t//\tendpoint_discovery_enabled = true\n\tEnableEndpointDiscovery aws.EndpointDiscoveryEnableState\n\n\t// Specifies if the S3 service should allow ARNs to direct the region\n\t// the client's requests are sent to.\n\t//\n\t// s3_use_arn_region=true\n\tS3UseARNRegion *bool\n\n\t// Specifies the EC2 Instance Metadata Service default endpoint selection\n\t// mode (IPv4 or IPv6)\n\t//\n\t// ec2_metadata_service_endpoint_mode=IPv6\n\tEC2IMDSEndpointMode imds.EndpointModeState\n\n\t// Specifies the EC2 Instance Metadata Service endpoint to use. If\n\t// specified it overrides EC2IMDSEndpointMode.\n\t//\n\t// ec2_metadata_service_endpoint=http://fd00:ec2::254\n\tEC2IMDSEndpoint string\n\n\t// Specifies that IMDS clients should not fallback to IMDSv1 if token\n\t// requests fail.\n\t//\n\t// ec2_metadata_v1_disabled=true\n\tEC2IMDSv1Disabled *bool\n\n\t// Specifies if the S3 service should disable support for Multi-Region\n\t// access-points\n\t//\n\t// s3_disable_multiregion_access_points=true\n\tS3DisableMultiRegionAccessPoints *bool\n\n\t// Specifies that SDK clients must resolve a dual-stack endpoint for\n\t// services.\n\t//\n\t// use_dualstack_endpoint=true\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// Specifies that SDK clients must resolve a FIPS endpoint for\n\t// services.\n\t//\n\t// use_fips_endpoint=true\n\tUseFIPSEndpoint aws.FIPSEndpointState\n\n\t// Specifies which defaults mode should be used by services.\n\t//\n\t// defaults_mode=standard\n\tDefaultsMode aws.DefaultsMode\n\n\t// Specifies the maximum number attempts an API client will call an\n\t// operation that fails with a retryable error.\n\t//\n\t// max_attempts=3\n\tRetryMaxAttempts int\n\n\t// Specifies the retry model the API client will be created with.\n\t//\n\t// retry_mode=standard\n\tRetryMode aws.RetryMode\n\n\t// Sets the path to a custom Credentials Authority (CA) Bundle PEM file\n\t// that the SDK will use instead of the system's root CA bundle. Only use\n\t// this if you want to configure the SDK to use a custom set of CAs.\n\t//\n\t// Enabling this option will attempt to merge the Transport into the SDK's\n\t// HTTP client. If the client's Transport is not a http.Transport an error\n\t// will be returned. If the Transport's TLS config is set this option will\n\t// cause the SDK to overwrite the Transport's TLS config's  RootCAs value.\n\t//\n\t// Setting a custom HTTPClient in the aws.Config options will override this\n\t// setting. To use this option and custom HTTP client, the HTTP client\n\t// needs to be provided when creating the config. Not the service client.\n\t//\n\t//  ca_bundle=$HOME/my_custom_ca_bundle\n\tCustomCABundle string\n\n\t// aws sdk app ID that can be added to user agent header string\n\tAppID string\n\n\t// Flag used to disable configured endpoints.\n\tIgnoreConfiguredEndpoints *bool\n\n\t// Value to contain configured endpoints to be propagated to\n\t// corresponding endpoint resolution field.\n\tBaseEndpoint string\n\n\t// Services section config.\n\tServicesSectionName string\n\tServices            Services\n\n\t// determine if request compression is allowed, default to false\n\t// retrieved from config file's profile field disable_request_compression\n\tDisableRequestCompression *bool\n\n\t// inclusive threshold request body size to trigger compression,\n\t// default to 10240 and must be within 0 and 10485760 bytes inclusive\n\t// retrieved from config file's profile field request_min_compression_size_bytes\n\tRequestMinCompressSizeBytes *int64\n\n\t// Whether S3Express auth is disabled.\n\t//\n\t// This will NOT prevent requests from being made to S3Express buckets, it\n\t// will only bypass the modified endpoint routing and signing behaviors\n\t// associated with the feature.\n\tS3DisableExpressAuth *bool\n\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n}\n\nfunc (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) {\n\tif len(c.DefaultsMode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn c.DefaultsMode, true, nil\n}\n\n// GetRetryMaxAttempts returns the maximum number of attempts an API client\n// created Retryer should attempt an operation call before failing.\nfunc (c SharedConfig) GetRetryMaxAttempts(ctx context.Context) (value int, ok bool, err error) {\n\tif c.RetryMaxAttempts == 0 {\n\t\treturn 0, false, nil\n\t}\n\n\treturn c.RetryMaxAttempts, true, nil\n}\n\n// GetRetryMode returns the model the API client should create its Retryer in.\nfunc (c SharedConfig) GetRetryMode(ctx context.Context) (value aws.RetryMode, ok bool, err error) {\n\tif len(c.RetryMode) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn c.RetryMode, true, nil\n}\n\n// GetS3UseARNRegion returns if the S3 service should allow ARNs to direct the region\n// the client's requests are sent to.\nfunc (c SharedConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) {\n\tif c.S3UseARNRegion == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.S3UseARNRegion, true, nil\n}\n\n// GetEnableEndpointDiscovery returns if the enable_endpoint_discovery is set.\nfunc (c SharedConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) {\n\tif c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset {\n\t\treturn aws.EndpointDiscoveryUnset, false, nil\n\t}\n\n\treturn c.EnableEndpointDiscovery, true, nil\n}\n\n// GetS3DisableMultiRegionAccessPoints returns if the S3 service should disable support for Multi-Region\n// access-points.\nfunc (c SharedConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) {\n\tif c.S3DisableMultiRegionAccessPoints == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.S3DisableMultiRegionAccessPoints, true, nil\n}\n\n// GetRegion returns the region for the profile if a region is set.\nfunc (c SharedConfig) getRegion(ctx context.Context) (string, bool, error) {\n\tif len(c.Region) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\treturn c.Region, true, nil\n}\n\n// GetCredentialsProvider returns the credentials for a profile if they were set.\nfunc (c SharedConfig) getCredentialsProvider() (aws.Credentials, bool, error) {\n\treturn c.Credentials, true, nil\n}\n\n// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.\nfunc (c SharedConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) {\n\tif c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset {\n\t\treturn imds.EndpointModeStateUnset, false, nil\n\t}\n\n\treturn c.EC2IMDSEndpointMode, true, nil\n}\n\n// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.\nfunc (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) {\n\tif len(c.EC2IMDSEndpoint) == 0 {\n\t\treturn \"\", false, nil\n\t}\n\n\treturn c.EC2IMDSEndpoint, true, nil\n}\n\n// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option\n// resolver interface.\nfunc (c SharedConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) {\n\tif c.EC2IMDSv1Disabled == nil {\n\t\treturn false, false\n\t}\n\n\treturn *c.EC2IMDSv1Disabled, true\n}\n\n// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be\n// used for requests.\nfunc (c SharedConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) {\n\tif c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset {\n\t\treturn aws.DualStackEndpointStateUnset, false, nil\n\t}\n\n\treturn c.UseDualStackEndpoint, true, nil\n}\n\n// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be\n// used for requests.\nfunc (c SharedConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) {\n\tif c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset {\n\t\treturn aws.FIPSEndpointStateUnset, false, nil\n\t}\n\n\treturn c.UseFIPSEndpoint, true, nil\n}\n\n// GetS3DisableExpressAuth returns the configured value for\n// [SharedConfig.S3DisableExpressAuth].\nfunc (c SharedConfig) GetS3DisableExpressAuth() (value, ok bool) {\n\tif c.S3DisableExpressAuth == nil {\n\t\treturn false, false\n\t}\n\n\treturn *c.S3DisableExpressAuth, true\n}\n\n// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was\nfunc (c SharedConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) {\n\tif len(c.CustomCABundle) == 0 {\n\t\treturn nil, false, nil\n\t}\n\n\tb, err := ioutil.ReadFile(c.CustomCABundle)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\treturn bytes.NewReader(b), true, nil\n}\n\n// getAppID returns the sdk app ID if set in shared config profile\nfunc (c SharedConfig) getAppID(context.Context) (string, bool, error) {\n\treturn c.AppID, len(c.AppID) > 0, nil\n}\n\n// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured\n// endpoints feature.\nfunc (c SharedConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) {\n\tif c.IgnoreConfiguredEndpoints == nil {\n\t\treturn false, false, nil\n\t}\n\n\treturn *c.IgnoreConfiguredEndpoints, true, nil\n}\n\nfunc (c SharedConfig) getBaseEndpoint(context.Context) (string, bool, error) {\n\treturn c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil\n}\n\n// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use\n// with configured endpoints.\nfunc (c SharedConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) {\n\tif service, ok := c.Services.ServiceValues[normalizeShared(sdkID)]; ok {\n\t\tif endpt, ok := service[endpointURL]; ok {\n\t\t\treturn endpt, true, nil\n\t\t}\n\t}\n\treturn \"\", false, nil\n}\n\nfunc normalizeShared(sdkID string) string {\n\tlower := strings.ToLower(sdkID)\n\treturn strings.ReplaceAll(lower, \" \", \"_\")\n}\n\nfunc (c SharedConfig) getServicesObject(context.Context) (map[string]map[string]string, bool, error) {\n\treturn c.Services.ServiceValues, c.Services.ServiceValues != nil, nil\n}\n\n// loadSharedConfigIgnoreNotExist is an alias for loadSharedConfig with the\n// addition of ignoring when none of the files exist or when the profile\n// is not found in any of the files.\nfunc loadSharedConfigIgnoreNotExist(ctx context.Context, configs configs) (Config, error) {\n\tcfg, err := loadSharedConfig(ctx, configs)\n\tif err != nil {\n\t\tif _, ok := err.(SharedConfigProfileNotExistError); ok {\n\t\t\treturn SharedConfig{}, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn cfg, nil\n}\n\n// loadSharedConfig uses the configs passed in to load the SharedConfig from file\n// The file names and profile name are sourced from the configs.\n//\n// If profile name is not provided DefaultSharedConfigProfile (default) will\n// be used.\n//\n// If shared config filenames are not provided DefaultSharedConfigFiles will\n// be used.\n//\n// Config providers used:\n// * sharedConfigProfileProvider\n// * sharedConfigFilesProvider\nfunc loadSharedConfig(ctx context.Context, configs configs) (Config, error) {\n\tvar profile string\n\tvar configFiles []string\n\tvar credentialsFiles []string\n\tvar ok bool\n\tvar err error\n\n\tprofile, ok, err = getSharedConfigProfile(ctx, configs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\tprofile = defaultSharedConfigProfile\n\t}\n\n\tconfigFiles, ok, err = getSharedConfigFiles(ctx, configs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcredentialsFiles, ok, err = getSharedCredentialsFiles(ctx, configs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// setup logger if log configuration warning is seti\n\tvar logger logging.Logger\n\tlogWarnings, found, err := getLogConfigurationWarnings(ctx, configs)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\tif found && logWarnings {\n\t\tlogger, found, err = getLogger(ctx, configs)\n\t\tif err != nil {\n\t\t\treturn SharedConfig{}, err\n\t\t}\n\t\tif !found {\n\t\t\tlogger = logging.NewStandardLogger(os.Stderr)\n\t\t}\n\t}\n\n\treturn LoadSharedConfigProfile(ctx, profile,\n\t\tfunc(o *LoadSharedConfigOptions) {\n\t\t\to.Logger = logger\n\t\t\to.ConfigFiles = configFiles\n\t\t\to.CredentialsFiles = credentialsFiles\n\t\t},\n\t)\n}\n\n// LoadSharedConfigOptions struct contains optional values that can be used to load the config.\ntype LoadSharedConfigOptions struct {\n\n\t// CredentialsFiles are the shared credentials files\n\tCredentialsFiles []string\n\n\t// ConfigFiles are the shared config files\n\tConfigFiles []string\n\n\t// Logger is the logger used to log shared config behavior\n\tLogger logging.Logger\n}\n\n// LoadSharedConfigProfile retrieves the configuration from the list of files\n// using the profile provided. The order the files are listed will determine\n// precedence. Values in subsequent files will overwrite values defined in\n// earlier files.\n//\n// For example, given two files A and B. Both define credentials. If the order\n// of the files are A then B, B's credential values will be used instead of A's.\n//\n// If config files are not set, SDK will default to using a file at location `.aws/config` if present.\n// If credentials files are not set, SDK will default to using a file at location `.aws/credentials` if present.\n// No default files are set, if files set to an empty slice.\n//\n// You can read more about shared config and credentials file location at\n// https://docs.aws.amazon.com/credref/latest/refdocs/file-location.html#file-location\nfunc LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func(*LoadSharedConfigOptions)) (SharedConfig, error) {\n\tvar option LoadSharedConfigOptions\n\tfor _, fn := range optFns {\n\t\tfn(&option)\n\t}\n\n\tif option.ConfigFiles == nil {\n\t\toption.ConfigFiles = DefaultSharedConfigFiles\n\t}\n\n\tif option.CredentialsFiles == nil {\n\t\toption.CredentialsFiles = DefaultSharedCredentialsFiles\n\t}\n\n\t// load shared configuration sections from shared configuration INI options\n\tconfigSections, err := loadIniFiles(option.ConfigFiles)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\t// check for profile prefix and drop duplicates or invalid profiles\n\terr = processConfigSections(ctx, &configSections, option.Logger)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\t// load shared credentials sections from shared credentials INI options\n\tcredentialsSections, err := loadIniFiles(option.CredentialsFiles)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\t// check for profile prefix and drop duplicates or invalid profiles\n\terr = processCredentialsSections(ctx, &credentialsSections, option.Logger)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\terr = mergeSections(&configSections, credentialsSections)\n\tif err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\tcfg := SharedConfig{}\n\tprofiles := map[string]struct{}{}\n\n\tif err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil {\n\t\treturn SharedConfig{}, err\n\t}\n\n\treturn cfg, nil\n}\n\nfunc processConfigSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error {\n\tskipSections := map[string]struct{}{}\n\n\tfor _, section := range sections.List() {\n\t\tif _, ok := skipSections[section]; ok {\n\t\t\tcontinue\n\t\t}\n\n\t\t// drop sections from config file that do not have expected prefixes.\n\t\tswitch {\n\t\tcase strings.HasPrefix(section, profilePrefix):\n\t\t\t// Rename sections to remove \"profile \" prefixing to match with\n\t\t\t// credentials file. If default is already present, it will be\n\t\t\t// dropped.\n\t\t\tnewName, err := renameProfileSection(section, sections, logger)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to rename profile section, %w\", err)\n\t\t\t}\n\t\t\tskipSections[newName] = struct{}{}\n\n\t\tcase strings.HasPrefix(section, ssoSectionPrefix):\n\t\tcase strings.HasPrefix(section, servicesPrefix):\n\t\tcase strings.EqualFold(section, \"default\"):\n\t\tdefault:\n\t\t\t// drop this section, as invalid profile name\n\t\t\tsections.DeleteSection(section)\n\n\t\t\tif logger != nil {\n\t\t\t\tlogger.Logf(logging.Debug, \"A profile defined with name `%v` is ignored. \"+\n\t\t\t\t\t\"For use within a shared configuration file, \"+\n\t\t\t\t\t\"a non-default profile must have `profile ` \"+\n\t\t\t\t\t\"prefixed to the profile name.\",\n\t\t\t\t\tsection,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc renameProfileSection(section string, sections *ini.Sections, logger logging.Logger) (string, error) {\n\tv, ok := sections.GetSection(section)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"error processing profiles within the shared configuration files\")\n\t}\n\n\t// delete section with profile as prefix\n\tsections.DeleteSection(section)\n\n\t// set the value to non-prefixed name in sections.\n\tsection = strings.TrimPrefix(section, profilePrefix)\n\tif sections.HasSection(section) {\n\t\toldSection, _ := sections.GetSection(section)\n\t\tv.Logs = append(v.Logs,\n\t\t\tfmt.Sprintf(\"A non-default profile not prefixed with `profile ` found in %s, \"+\n\t\t\t\t\"overriding non-default profile from %s\",\n\t\t\t\tv.SourceFile, oldSection.SourceFile))\n\t\tsections.DeleteSection(section)\n\t}\n\n\t// assign non-prefixed name to section\n\tv.Name = section\n\tsections.SetSection(section, v)\n\n\treturn section, nil\n}\n\nfunc processCredentialsSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error {\n\tfor _, section := range sections.List() {\n\t\t// drop profiles with prefix for credential files\n\t\tif strings.HasPrefix(section, profilePrefix) {\n\t\t\t// drop this section, as invalid profile name\n\t\t\tsections.DeleteSection(section)\n\n\t\t\tif logger != nil {\n\t\t\t\tlogger.Logf(logging.Debug,\n\t\t\t\t\t\"The profile defined with name `%v` is ignored. A profile with the `profile ` prefix is invalid \"+\n\t\t\t\t\t\t\"for the shared credentials file.\\n\",\n\t\t\t\t\tsection,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc loadIniFiles(filenames []string) (ini.Sections, error) {\n\tmergedSections := ini.NewSections()\n\n\tfor _, filename := range filenames {\n\t\tsections, err := ini.OpenFile(filename)\n\t\tvar v *ini.UnableToReadFile\n\t\tif ok := errors.As(err, &v); ok {\n\t\t\t// Skip files which can't be opened and read for whatever reason.\n\t\t\t// We treat such files as empty, and do not fall back to other locations.\n\t\t\tcontinue\n\t\t} else if err != nil {\n\t\t\treturn ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err}\n\t\t}\n\n\t\t// mergeSections into mergedSections\n\t\terr = mergeSections(&mergedSections, sections)\n\t\tif err != nil {\n\t\t\treturn ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err}\n\t\t}\n\t}\n\n\treturn mergedSections, nil\n}\n\n// mergeSections merges source section properties into destination section properties\nfunc mergeSections(dst *ini.Sections, src ini.Sections) error {\n\tfor _, sectionName := range src.List() {\n\t\tsrcSection, _ := src.GetSection(sectionName)\n\n\t\tif (!srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey)) ||\n\t\t\t(srcSection.Has(accessKeyIDKey) && !srcSection.Has(secretAccessKey)) {\n\t\t\tsrcSection.Errors = append(srcSection.Errors,\n\t\t\t\tfmt.Errorf(\"partial credentials found for profile %v\", sectionName))\n\t\t}\n\n\t\tif !dst.HasSection(sectionName) {\n\t\t\tdst.SetSection(sectionName, srcSection)\n\t\t\tcontinue\n\t\t}\n\n\t\t// merge with destination srcSection\n\t\tdstSection, _ := dst.GetSection(sectionName)\n\n\t\t// errors should be overriden if any\n\t\tdstSection.Errors = srcSection.Errors\n\n\t\t// Access key id update\n\t\tif srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey) {\n\t\t\taccessKey := srcSection.String(accessKeyIDKey)\n\t\t\tsecretKey := srcSection.String(secretAccessKey)\n\n\t\t\tif dstSection.Has(accessKeyIDKey) {\n\t\t\t\tdstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, accessKeyIDKey,\n\t\t\t\t\tdstSection.SourceFile[accessKeyIDKey], srcSection.SourceFile[accessKeyIDKey]))\n\t\t\t}\n\n\t\t\t// update access key\n\t\t\tv, err := ini.NewStringValue(accessKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error merging access key, %w\", err)\n\t\t\t}\n\t\t\tdstSection.UpdateValue(accessKeyIDKey, v)\n\n\t\t\t// update secret key\n\t\t\tv, err = ini.NewStringValue(secretKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error merging secret key, %w\", err)\n\t\t\t}\n\t\t\tdstSection.UpdateValue(secretAccessKey, v)\n\n\t\t\t// update session token\n\t\t\tif err = mergeStringKey(&srcSection, &dstSection, sectionName, sessionTokenKey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// update source file to reflect where the static creds came from\n\t\t\tdstSection.UpdateSourceFile(accessKeyIDKey, srcSection.SourceFile[accessKeyIDKey])\n\t\t\tdstSection.UpdateSourceFile(secretAccessKey, srcSection.SourceFile[secretAccessKey])\n\t\t}\n\n\t\tstringKeys := []string{\n\t\t\troleArnKey,\n\t\t\tsourceProfileKey,\n\t\t\tcredentialSourceKey,\n\t\t\texternalIDKey,\n\t\t\tmfaSerialKey,\n\t\t\troleSessionNameKey,\n\t\t\tregionKey,\n\t\t\tenableEndpointDiscoveryKey,\n\t\t\tcredentialProcessKey,\n\t\t\twebIdentityTokenFileKey,\n\t\t\ts3UseARNRegionKey,\n\t\t\ts3DisableMultiRegionAccessPointsKey,\n\t\t\tec2MetadataServiceEndpointModeKey,\n\t\t\tec2MetadataServiceEndpointKey,\n\t\t\tec2MetadataV1DisabledKey,\n\t\t\tuseDualStackEndpoint,\n\t\t\tuseFIPSEndpointKey,\n\t\t\tdefaultsModeKey,\n\t\t\tretryModeKey,\n\t\t\tcaBundleKey,\n\t\t\troleDurationSecondsKey,\n\t\t\tretryMaxAttemptsKey,\n\n\t\t\tssoSessionNameKey,\n\t\t\tssoAccountIDKey,\n\t\t\tssoRegionKey,\n\t\t\tssoRoleNameKey,\n\t\t\tssoStartURLKey,\n\t\t}\n\t\tfor i := range stringKeys {\n\t\t\tif err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t// set srcSection on dst srcSection\n\t\t*dst = dst.SetSection(sectionName, dstSection)\n\t}\n\n\treturn nil\n}\n\nfunc mergeStringKey(srcSection *ini.Section, dstSection *ini.Section, sectionName, key string) error {\n\tif srcSection.Has(key) {\n\t\tsrcValue := srcSection.String(key)\n\t\tval, err := ini.NewStringValue(srcValue)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error merging %s, %w\", key, err)\n\t\t}\n\n\t\tif dstSection.Has(key) {\n\t\t\tdstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, key,\n\t\t\t\tdstSection.SourceFile[key], srcSection.SourceFile[key]))\n\t\t}\n\n\t\tdstSection.UpdateValue(key, val)\n\t\tdstSection.UpdateSourceFile(key, srcSection.SourceFile[key])\n\t}\n\treturn nil\n}\n\nfunc newMergeKeyLogMessage(sectionName, key, dstSourceFile, srcSourceFile string) string {\n\treturn fmt.Sprintf(\"For profile: %v, overriding %v value, defined in %v \"+\n\t\t\"with a %v value found in a duplicate profile defined at file %v. \\n\",\n\t\tsectionName, key, dstSourceFile, key, srcSourceFile)\n}\n\n// Returns an error if all of the files fail to load. If at least one file is\n// successfully loaded and contains the profile, no error will be returned.\nfunc (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile string,\n\tsections ini.Sections, logger logging.Logger) error {\n\tc.Profile = profile\n\n\tsection, ok := sections.GetSection(profile)\n\tif !ok {\n\t\treturn SharedConfigProfileNotExistError{\n\t\t\tProfile: profile,\n\t\t}\n\t}\n\n\t// if logs are appended to the section, log them\n\tif section.Logs != nil && logger != nil {\n\t\tfor _, log := range section.Logs {\n\t\t\tlogger.Logf(logging.Debug, log)\n\t\t}\n\t}\n\n\t// set config from the provided INI section\n\terr := c.setFromIniSection(profile, section)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error fetching config from profile, %v, %w\", profile, err)\n\t}\n\n\tif _, ok := profiles[profile]; ok {\n\t\t// if this is the second instance of the profile the Assume Role\n\t\t// options must be cleared because they are only valid for the\n\t\t// first reference of a profile. The self linked instance of the\n\t\t// profile only have credential provider options.\n\t\tc.clearAssumeRoleOptions()\n\t} else {\n\t\t// First time a profile has been seen. Assert if the credential type\n\t\t// requires a role ARN, the ARN is also set\n\t\tif err := c.validateCredentialsConfig(profile); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// if not top level profile and has credentials, return with credentials.\n\tif len(profiles) != 0 && c.Credentials.HasKeys() {\n\t\treturn nil\n\t}\n\n\tprofiles[profile] = struct{}{}\n\n\t// validate no colliding credentials type are present\n\tif err := c.validateCredentialType(); err != nil {\n\t\treturn err\n\t}\n\n\t// Link source profiles for assume roles\n\tif len(c.SourceProfileName) != 0 {\n\t\t// Linked profile via source_profile ignore credential provider\n\t\t// options, the source profile must provide the credentials.\n\t\tc.clearCredentialOptions()\n\n\t\tsrcCfg := &SharedConfig{}\n\t\terr := srcCfg.setFromIniSections(profiles, c.SourceProfileName, sections, logger)\n\t\tif err != nil {\n\t\t\t// SourceProfileName that doesn't exist is an error in configuration.\n\t\t\tif _, ok := err.(SharedConfigProfileNotExistError); ok {\n\t\t\t\terr = SharedConfigAssumeRoleError{\n\t\t\t\t\tRoleARN: c.RoleARN,\n\t\t\t\t\tProfile: c.SourceProfileName,\n\t\t\t\t\tErr:     err,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tif !srcCfg.hasCredentials() {\n\t\t\treturn SharedConfigAssumeRoleError{\n\t\t\t\tRoleARN: c.RoleARN,\n\t\t\t\tProfile: c.SourceProfileName,\n\t\t\t}\n\t\t}\n\n\t\tc.Source = srcCfg\n\t}\n\n\t// If the profile contains an SSO session parameter, the session MUST exist\n\t// as a section in the config file. Load the SSO session using the name\n\t// provided. If the session section is not found or incomplete an error\n\t// will be returned.\n\tif c.hasSSOTokenProviderConfiguration() {\n\t\tsection, ok := sections.GetSection(ssoSectionPrefix + strings.TrimSpace(c.SSOSessionName))\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"failed to find SSO session section, %v\", c.SSOSessionName)\n\t\t}\n\t\tvar ssoSession SSOSession\n\t\tssoSession.setFromIniSection(section)\n\t\tssoSession.Name = c.SSOSessionName\n\t\tc.SSOSession = &ssoSession\n\t}\n\n\tif len(c.ServicesSectionName) > 0 {\n\t\tif section, ok := sections.GetSection(servicesPrefix + c.ServicesSectionName); ok {\n\t\t\tvar svcs Services\n\t\t\tsvcs.setFromIniSection(section)\n\t\t\tc.Services = svcs\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// setFromIniSection loads the configuration from the profile section defined in\n// the provided INI file. A SharedConfig pointer type value is used so that\n// multiple config file loadings can be chained.\n//\n// Only loads complete logically grouped values, and will not set fields in cfg\n// for incomplete grouped values in the config. Such as credentials. For example\n// if a config file only includes aws_access_key_id but no aws_secret_access_key\n// the aws_access_key_id will be ignored.\nfunc (c *SharedConfig) setFromIniSection(profile string, section ini.Section) error {\n\tif len(section.Name) == 0 {\n\t\tsources := make([]string, 0)\n\t\tfor _, v := range section.SourceFile {\n\t\t\tsources = append(sources, v)\n\t\t}\n\n\t\treturn fmt.Errorf(\"parsing error : could not find profile section name after processing files: %v\", sources)\n\t}\n\n\tif len(section.Errors) != 0 {\n\t\tvar errStatement string\n\t\tfor i, e := range section.Errors {\n\t\t\terrStatement = fmt.Sprintf(\"%d, %v\\n\", i+1, e.Error())\n\t\t}\n\t\treturn fmt.Errorf(\"Error using profile: \\n %v\", errStatement)\n\t}\n\n\t// Assume Role\n\tupdateString(&c.RoleARN, section, roleArnKey)\n\tupdateString(&c.ExternalID, section, externalIDKey)\n\tupdateString(&c.MFASerial, section, mfaSerialKey)\n\tupdateString(&c.RoleSessionName, section, roleSessionNameKey)\n\tupdateString(&c.SourceProfileName, section, sourceProfileKey)\n\tupdateString(&c.CredentialSource, section, credentialSourceKey)\n\tupdateString(&c.Region, section, regionKey)\n\n\t// AWS Single Sign-On (AWS SSO)\n\t// SSO session options\n\tupdateString(&c.SSOSessionName, section, ssoSessionNameKey)\n\n\t// Legacy SSO session options\n\tupdateString(&c.SSORegion, section, ssoRegionKey)\n\tupdateString(&c.SSOStartURL, section, ssoStartURLKey)\n\n\t// SSO fields not used\n\tupdateString(&c.SSOAccountID, section, ssoAccountIDKey)\n\tupdateString(&c.SSORoleName, section, ssoRoleNameKey)\n\n\t// we're retaining a behavioral quirk with this field that existed before\n\t// the removal of literal parsing for #2276:\n\t//   - if the key is missing, the config field will not be set\n\t//   - if the key is set to a non-numeric, the config field will be set to 0\n\tif section.Has(roleDurationSecondsKey) {\n\t\tif v, ok := section.Int(roleDurationSecondsKey); ok {\n\t\t\tc.RoleDurationSeconds = aws.Duration(time.Duration(v) * time.Second)\n\t\t} else {\n\t\t\tc.RoleDurationSeconds = aws.Duration(time.Duration(0))\n\t\t}\n\t}\n\n\tupdateString(&c.CredentialProcess, section, credentialProcessKey)\n\tupdateString(&c.WebIdentityTokenFile, section, webIdentityTokenFileKey)\n\n\tupdateEndpointDiscoveryType(&c.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey)\n\tupdateBoolPtr(&c.S3UseARNRegion, section, s3UseARNRegionKey)\n\tupdateBoolPtr(&c.S3DisableMultiRegionAccessPoints, section, s3DisableMultiRegionAccessPointsKey)\n\tupdateBoolPtr(&c.S3DisableExpressAuth, section, s3DisableExpressSessionAuthKey)\n\n\tif err := updateEC2MetadataServiceEndpointMode(&c.EC2IMDSEndpointMode, section, ec2MetadataServiceEndpointModeKey); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %v\", ec2MetadataServiceEndpointModeKey, err)\n\t}\n\tupdateString(&c.EC2IMDSEndpoint, section, ec2MetadataServiceEndpointKey)\n\tupdateBoolPtr(&c.EC2IMDSv1Disabled, section, ec2MetadataV1DisabledKey)\n\n\tupdateUseDualStackEndpoint(&c.UseDualStackEndpoint, section, useDualStackEndpoint)\n\tupdateUseFIPSEndpoint(&c.UseFIPSEndpoint, section, useFIPSEndpointKey)\n\n\tif err := updateDefaultsMode(&c.DefaultsMode, section, defaultsModeKey); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", defaultsModeKey, err)\n\t}\n\n\tif err := updateInt(&c.RetryMaxAttempts, section, retryMaxAttemptsKey); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", retryMaxAttemptsKey, err)\n\t}\n\tif err := updateRetryMode(&c.RetryMode, section, retryModeKey); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", retryModeKey, err)\n\t}\n\n\tupdateString(&c.CustomCABundle, section, caBundleKey)\n\n\t// user agent app ID added to request User-Agent header\n\tupdateString(&c.AppID, section, sdkAppID)\n\n\tupdateBoolPtr(&c.IgnoreConfiguredEndpoints, section, ignoreConfiguredEndpoints)\n\n\tupdateString(&c.BaseEndpoint, section, endpointURL)\n\n\tif err := updateDisableRequestCompression(&c.DisableRequestCompression, section, disableRequestCompression); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", disableRequestCompression, err)\n\t}\n\tif err := updateRequestMinCompressSizeBytes(&c.RequestMinCompressSizeBytes, section, requestMinCompressionSizeBytes); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", requestMinCompressionSizeBytes, err)\n\t}\n\n\tif err := updateAIDEndpointMode(&c.AccountIDEndpointMode, section, accountIDEndpointMode); err != nil {\n\t\treturn fmt.Errorf(\"failed to load %s from shared config, %w\", accountIDEndpointMode, err)\n\t}\n\n\t// Shared Credentials\n\tcreds := aws.Credentials{\n\t\tAccessKeyID:     section.String(accessKeyIDKey),\n\t\tSecretAccessKey: section.String(secretAccessKey),\n\t\tSessionToken:    section.String(sessionTokenKey),\n\t\tSource:          fmt.Sprintf(\"SharedConfigCredentials: %s\", section.SourceFile[accessKeyIDKey]),\n\t\tAccountID:       section.String(accountIDKey),\n\t}\n\n\tif creds.HasKeys() {\n\t\tc.Credentials = creds\n\t}\n\n\tupdateString(&c.ServicesSectionName, section, servicesSectionKey)\n\n\treturn nil\n}\n\nfunc updateRequestMinCompressSizeBytes(bytes **int64, sec ini.Section, key string) error {\n\tif !sec.Has(key) {\n\t\treturn nil\n\t}\n\n\tv, ok := sec.Int(key)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid value for min request compression size bytes %s, need int64\", sec.String(key))\n\t}\n\tif v < 0 || v > smithyrequestcompression.MaxRequestMinCompressSizeBytes {\n\t\treturn fmt.Errorf(\"invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively\", v)\n\t}\n\t*bytes = new(int64)\n\t**bytes = v\n\treturn nil\n}\n\nfunc updateDisableRequestCompression(disable **bool, sec ini.Section, key string) error {\n\tif !sec.Has(key) {\n\t\treturn nil\n\t}\n\n\tv := sec.String(key)\n\tswitch {\n\tcase v == \"true\":\n\t\t*disable = new(bool)\n\t\t**disable = true\n\tcase v == \"false\":\n\t\t*disable = new(bool)\n\t\t**disable = false\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid value for shared config profile field, %s=%s, need true or false\", key, v)\n\t}\n\treturn nil\n}\n\nfunc updateAIDEndpointMode(m *aws.AccountIDEndpointMode, sec ini.Section, key string) error {\n\tif !sec.Has(key) {\n\t\treturn nil\n\t}\n\n\tv := sec.String(key)\n\tswitch v {\n\tcase \"preferred\":\n\t\t*m = aws.AccountIDEndpointModePreferred\n\tcase \"required\":\n\t\t*m = aws.AccountIDEndpointModeRequired\n\tcase \"disabled\":\n\t\t*m = aws.AccountIDEndpointModeDisabled\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid value for shared config profile field, %s=%s, must be preferred/required/disabled\", key, v)\n\t}\n\n\treturn nil\n}\n\nfunc (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) {\n\tif c.RequestMinCompressSizeBytes == nil {\n\t\treturn 0, false, nil\n\t}\n\treturn *c.RequestMinCompressSizeBytes, true, nil\n}\n\nfunc (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, bool, error) {\n\tif c.DisableRequestCompression == nil {\n\t\treturn false, false, nil\n\t}\n\treturn *c.DisableRequestCompression, true, nil\n}\n\nfunc (c SharedConfig) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) {\n\treturn c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil\n}\n\nfunc updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error {\n\tif !section.Has(key) {\n\t\treturn nil\n\t}\n\tvalue := section.String(key)\n\tif ok := mode.SetFromString(value); !ok {\n\t\treturn fmt.Errorf(\"invalid value: %s\", value)\n\t}\n\treturn nil\n}\n\nfunc updateRetryMode(mode *aws.RetryMode, section ini.Section, key string) (err error) {\n\tif !section.Has(key) {\n\t\treturn nil\n\t}\n\tvalue := section.String(key)\n\tif *mode, err = aws.ParseRetryMode(value); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc updateEC2MetadataServiceEndpointMode(endpointMode *imds.EndpointModeState, section ini.Section, key string) error {\n\tif !section.Has(key) {\n\t\treturn nil\n\t}\n\tvalue := section.String(key)\n\treturn endpointMode.SetFromString(value)\n}\n\nfunc (c *SharedConfig) validateCredentialsConfig(profile string) error {\n\tif err := c.validateCredentialsRequireARN(profile); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (c *SharedConfig) validateCredentialsRequireARN(profile string) error {\n\tvar credSource string\n\n\tswitch {\n\tcase len(c.SourceProfileName) != 0:\n\t\tcredSource = sourceProfileKey\n\tcase len(c.CredentialSource) != 0:\n\t\tcredSource = credentialSourceKey\n\tcase len(c.WebIdentityTokenFile) != 0:\n\t\tcredSource = webIdentityTokenFileKey\n\t}\n\n\tif len(credSource) != 0 && len(c.RoleARN) == 0 {\n\t\treturn CredentialRequiresARNError{\n\t\t\tType:    credSource,\n\t\t\tProfile: profile,\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *SharedConfig) validateCredentialType() error {\n\t// Only one or no credential type can be defined.\n\tif !oneOrNone(\n\t\tlen(c.SourceProfileName) != 0,\n\t\tlen(c.CredentialSource) != 0,\n\t\tlen(c.CredentialProcess) != 0,\n\t\tlen(c.WebIdentityTokenFile) != 0,\n\t) {\n\t\treturn fmt.Errorf(\"only one credential type may be specified per profile: source profile, credential source, credential process, web identity token\")\n\t}\n\n\treturn nil\n}\n\nfunc (c *SharedConfig) validateSSOConfiguration() error {\n\tif c.hasSSOTokenProviderConfiguration() {\n\t\terr := c.validateSSOTokenProviderConfiguration()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\tif c.hasLegacySSOConfiguration() {\n\t\terr := c.validateLegacySSOConfiguration()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *SharedConfig) validateSSOTokenProviderConfiguration() error {\n\tvar missing []string\n\n\tif len(c.SSOSessionName) == 0 {\n\t\tmissing = append(missing, ssoSessionNameKey)\n\t}\n\n\tif c.SSOSession == nil {\n\t\tmissing = append(missing, ssoSectionPrefix)\n\t} else {\n\t\tif len(c.SSOSession.SSORegion) == 0 {\n\t\t\tmissing = append(missing, ssoRegionKey)\n\t\t}\n\n\t\tif len(c.SSOSession.SSOStartURL) == 0 {\n\t\t\tmissing = append(missing, ssoStartURLKey)\n\t\t}\n\t}\n\n\tif len(missing) > 0 {\n\t\treturn fmt.Errorf(\"profile %q is configured to use SSO but is missing required configuration: %s\",\n\t\t\tc.Profile, strings.Join(missing, \", \"))\n\t}\n\n\tif len(c.SSORegion) > 0 && c.SSORegion != c.SSOSession.SSORegion {\n\t\treturn fmt.Errorf(\"%s in profile %q must match %s in %s\", ssoRegionKey, c.Profile, ssoRegionKey, ssoSectionPrefix)\n\t}\n\n\tif len(c.SSOStartURL) > 0 && c.SSOStartURL != c.SSOSession.SSOStartURL {\n\t\treturn fmt.Errorf(\"%s in profile %q must match %s in %s\", ssoStartURLKey, c.Profile, ssoStartURLKey, ssoSectionPrefix)\n\t}\n\n\treturn nil\n}\n\nfunc (c *SharedConfig) validateLegacySSOConfiguration() error {\n\tvar missing []string\n\n\tif len(c.SSORegion) == 0 {\n\t\tmissing = append(missing, ssoRegionKey)\n\t}\n\n\tif len(c.SSOStartURL) == 0 {\n\t\tmissing = append(missing, ssoStartURLKey)\n\t}\n\n\tif len(c.SSOAccountID) == 0 {\n\t\tmissing = append(missing, ssoAccountIDKey)\n\t}\n\n\tif len(c.SSORoleName) == 0 {\n\t\tmissing = append(missing, ssoRoleNameKey)\n\t}\n\n\tif len(missing) > 0 {\n\t\treturn fmt.Errorf(\"profile %q is configured to use SSO but is missing required configuration: %s\",\n\t\t\tc.Profile, strings.Join(missing, \", \"))\n\t}\n\treturn nil\n}\n\nfunc (c *SharedConfig) hasCredentials() bool {\n\tswitch {\n\tcase len(c.SourceProfileName) != 0:\n\tcase len(c.CredentialSource) != 0:\n\tcase len(c.CredentialProcess) != 0:\n\tcase len(c.WebIdentityTokenFile) != 0:\n\tcase c.hasSSOConfiguration():\n\tcase c.Credentials.HasKeys():\n\tdefault:\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (c *SharedConfig) hasSSOConfiguration() bool {\n\treturn c.hasSSOTokenProviderConfiguration() || c.hasLegacySSOConfiguration()\n}\n\nfunc (c *SharedConfig) hasSSOTokenProviderConfiguration() bool {\n\treturn len(c.SSOSessionName) > 0\n}\n\nfunc (c *SharedConfig) hasLegacySSOConfiguration() bool {\n\treturn len(c.SSORegion) > 0 || len(c.SSOAccountID) > 0 || len(c.SSOStartURL) > 0 || len(c.SSORoleName) > 0\n}\n\nfunc (c *SharedConfig) clearAssumeRoleOptions() {\n\tc.RoleARN = \"\"\n\tc.ExternalID = \"\"\n\tc.MFASerial = \"\"\n\tc.RoleSessionName = \"\"\n\tc.SourceProfileName = \"\"\n}\n\nfunc (c *SharedConfig) clearCredentialOptions() {\n\tc.CredentialSource = \"\"\n\tc.CredentialProcess = \"\"\n\tc.WebIdentityTokenFile = \"\"\n\tc.Credentials = aws.Credentials{}\n\tc.SSOAccountID = \"\"\n\tc.SSORegion = \"\"\n\tc.SSORoleName = \"\"\n\tc.SSOStartURL = \"\"\n}\n\n// SharedConfigLoadError is an error for the shared config file failed to load.\ntype SharedConfigLoadError struct {\n\tFilename string\n\tErr      error\n}\n\n// Unwrap returns the underlying error that caused the failure.\nfunc (e SharedConfigLoadError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e SharedConfigLoadError) Error() string {\n\treturn fmt.Sprintf(\"failed to load shared config file, %s, %v\", e.Filename, e.Err)\n}\n\n// SharedConfigProfileNotExistError is an error for the shared config when\n// the profile was not find in the config file.\ntype SharedConfigProfileNotExistError struct {\n\tFilename []string\n\tProfile  string\n\tErr      error\n}\n\n// Unwrap returns the underlying error that caused the failure.\nfunc (e SharedConfigProfileNotExistError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e SharedConfigProfileNotExistError) Error() string {\n\treturn fmt.Sprintf(\"failed to get shared config profile, %s\", e.Profile)\n}\n\n// SharedConfigAssumeRoleError is an error for the shared config when the\n// profile contains assume role information, but that information is invalid\n// or not complete.\ntype SharedConfigAssumeRoleError struct {\n\tProfile string\n\tRoleARN string\n\tErr     error\n}\n\n// Unwrap returns the underlying error that caused the failure.\nfunc (e SharedConfigAssumeRoleError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e SharedConfigAssumeRoleError) Error() string {\n\treturn fmt.Sprintf(\"failed to load assume role %s, of profile %s, %v\",\n\t\te.RoleARN, e.Profile, e.Err)\n}\n\n// CredentialRequiresARNError provides the error for shared config credentials\n// that are incorrectly configured in the shared config or credentials file.\ntype CredentialRequiresARNError struct {\n\t// type of credentials that were configured.\n\tType string\n\n\t// Profile name the credentials were in.\n\tProfile string\n}\n\n// Error satisfies the error interface.\nfunc (e CredentialRequiresARNError) Error() string {\n\treturn fmt.Sprintf(\n\t\t\"credential type %s requires role_arn, profile %s\",\n\t\te.Type, e.Profile,\n\t)\n}\n\nfunc oneOrNone(bs ...bool) bool {\n\tvar count int\n\n\tfor _, b := range bs {\n\t\tif b {\n\t\t\tcount++\n\t\t\tif count > 1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\n// updateString will only update the dst with the value in the section key, key\n// is present in the section.\nfunc updateString(dst *string, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\t*dst = section.String(key)\n}\n\n// updateInt will only update the dst with the value in the section key, key\n// is present in the section.\n//\n// Down casts the INI integer value from a int64 to an int, which could be\n// different bit size depending on platform.\nfunc updateInt(dst *int, section ini.Section, key string) error {\n\tif !section.Has(key) {\n\t\treturn nil\n\t}\n\n\tv, ok := section.Int(key)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid value %s=%s, expect integer\", key, section.String(key))\n\t}\n\n\t*dst = int(v)\n\treturn nil\n}\n\n// updateBool will only update the dst with the value in the section key, key\n// is present in the section.\nfunc updateBool(dst *bool, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\n\t// retains pre-#2276 behavior where non-bool value would resolve to false\n\tv, _ := section.Bool(key)\n\t*dst = v\n}\n\n// updateBoolPtr will only update the dst with the value in the section key,\n// key is present in the section.\nfunc updateBoolPtr(dst **bool, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\n\t// retains pre-#2276 behavior where non-bool value would resolve to false\n\tv, _ := section.Bool(key)\n\t*dst = new(bool)\n\t**dst = v\n}\n\n// updateEndpointDiscoveryType will only update the dst with the value in the section, if\n// a valid key and corresponding EndpointDiscoveryType is found.\nfunc updateEndpointDiscoveryType(dst *aws.EndpointDiscoveryEnableState, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\n\tvalue := section.String(key)\n\tif len(value) == 0 {\n\t\treturn\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(value, endpointDiscoveryDisabled):\n\t\t*dst = aws.EndpointDiscoveryDisabled\n\tcase strings.EqualFold(value, endpointDiscoveryEnabled):\n\t\t*dst = aws.EndpointDiscoveryEnabled\n\tcase strings.EqualFold(value, endpointDiscoveryAuto):\n\t\t*dst = aws.EndpointDiscoveryAuto\n\t}\n}\n\n// updateEndpointDiscoveryType will only update the dst with the value in the section, if\n// a valid key and corresponding EndpointDiscoveryType is found.\nfunc updateUseDualStackEndpoint(dst *aws.DualStackEndpointState, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\n\t// retains pre-#2276 behavior where non-bool value would resolve to false\n\tif v, _ := section.Bool(key); v {\n\t\t*dst = aws.DualStackEndpointStateEnabled\n\t} else {\n\t\t*dst = aws.DualStackEndpointStateDisabled\n\t}\n\n\treturn\n}\n\n// updateEndpointDiscoveryType will only update the dst with the value in the section, if\n// a valid key and corresponding EndpointDiscoveryType is found.\nfunc updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key string) {\n\tif !section.Has(key) {\n\t\treturn\n\t}\n\n\t// retains pre-#2276 behavior where non-bool value would resolve to false\n\tif v, _ := section.Bool(key); v {\n\t\t*dst = aws.FIPSEndpointStateEnabled\n\t} else {\n\t\t*dst = aws.FIPSEndpointStateDisabled\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md",
    "content": "# v1.17.27 (2024-07-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.26 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.25 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.24 (2024-07-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.23 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.22 (2024-06-26)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.21 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.20 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.19 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.18 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.17 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.16 (2024-05-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.15 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.14 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.13 (2024-05-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.12 (2024-05-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.11 (2024-04-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.10 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.9 (2024-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.8 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.7 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.6 (2024-03-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.5 (2024-03-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.4 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.3 (2024-02-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.2 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.1 (2024-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.16 (2024-01-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.15 (2024-01-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.14 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.13 (2023-12-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.12 (2023-12-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.11 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.10 (2023-12-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.9 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.8 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.7 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.6 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.5 (2023-11-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.4 (2023-11-21)\n\n* **Bug Fix**: Don't expect error responses to have a JSON payload in the endpointcreds provider.\n\n# v1.16.3 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.2 (2023-11-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.1 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2023-11-14)\n\n* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider.\n\n# v1.15.2 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.1 (2023-11-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.43 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.42 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.41 (2023-10-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.40 (2023-09-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.39 (2023-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.38 (2023-09-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.37 (2023-09-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.36 (2023-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.35 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.34 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.33 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.32 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.31 (2023-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.30 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.29 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.28 (2023-07-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.27 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.26 (2023-06-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.25 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.24 (2023-05-09)\n\n* No change notes available for this release.\n\n# v1.13.23 (2023-05-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.22 (2023-05-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.21 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.20 (2023-04-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.19 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.18 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.17 (2023-03-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.16 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.15 (2023-02-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.14 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.13 (2023-02-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.12 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.11 (2023-02-01)\n\n* No change notes available for this release.\n\n# v1.13.10 (2023-01-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.9 (2023-01-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.8 (2023-01-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.7 (2022-12-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.6 (2022-12-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.5 (2022-12-15)\n\n* **Bug Fix**: Unify logic between shared config and in finding home directory\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.4 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.3 (2022-11-22)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.2 (2022-11-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2022-11-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-11-11)\n\n* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846\n* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider\n\n# v1.12.24 (2022-11-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.23 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.22 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.21 (2022-09-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.20 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.19 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.18 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.17 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.16 (2022-08-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.15 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.14 (2022-08-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.13 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.12 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.11 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.10 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.9 (2022-07-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.6 (2022-06-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.5 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.4 (2022-05-26)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.3 (2022-05-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.2 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.1 (2022-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2022-04-25)\n\n* **Feature**: Adds Duration and Policy options that can be used when creating stscreds.WebIdentityRoleProvider credentials provider.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.2 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.1 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2022-03-23)\n\n* **Feature**: Update `ec2rolecreds` package's `Provider` to implememnt support for CredentialsCache new optional caching strategy interfaces, HandleFailRefreshCredentialsCacheStrategy and AdjustExpiresByCredentialsCacheStrategy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2022-02-24)\n\n* **Feature**: Adds support for `SourceIdentity` to `stscreds.AssumeRoleProvider` [#1588](https://github.com/aws/aws-sdk-go-v2/pull/1588). Fixes [#1575](https://github.com/aws/aws-sdk-go-v2/issues/1575)\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.5 (2021-12-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.4 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.3 (2021-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.2 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.1 (2021-11-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.3 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.2 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-09-10)\n\n* **Documentation**: Fixes the AssumeRoleProvider's documentation for using custom TokenProviders.\n\n# v1.4.0 (2021-08-27)\n\n* **Feature**: Adds support for Tags and TransitiveTagKeys to stscreds.AssumeRoleProvider. Closes https://github.com/aws/aws-sdk-go-v2/issues/723\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Bug Fix**: Fixed example usages of aws.CredentialsCache ([#1275](https://github.com/aws/aws-sdk-go-v2/pull/1275))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.go",
    "content": "/*\nPackage credentials provides types for retrieving credentials from credentials sources.\n*/\npackage credentials\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go",
    "content": "// Package ec2rolecreds provides the credentials provider implementation for\n// retrieving AWS credentials from Amazon EC2 Instance Roles via Amazon EC2 IMDS.\n//\n// # Concurrency and caching\n//\n// The Provider is not safe to be used concurrently, and does not provide any\n// caching of credentials retrieved. You should wrap the Provider with a\n// `aws.CredentialsCache` to provide concurrency safety, and caching of\n// credentials.\n//\n// # Loading credentials with the SDK's AWS Config\n//\n// The EC2 Instance role credentials provider will automatically be the resolved\n// credential provider in the credential chain if no other credential provider is\n// resolved first.\n//\n// To explicitly instruct the SDK's credentials resolving to use the EC2 Instance\n// role for credentials, you specify a `credentials_source` property in the config\n// profile the SDK will load.\n//\n//\t[default]\n//\tcredential_source = Ec2InstanceMetadata\n//\n// # Loading credentials with the Provider directly\n//\n// Another way to use the EC2 Instance role credentials provider is to create it\n// directly and assign it as the credentials provider for an API client.\n//\n// The following example creates a credentials provider for a command, and wraps\n// it with the CredentialsCache before assigning the provider to the Amazon S3 API\n// client's Credentials option.\n//\n//\tprovider := imds.New(imds.Options{})\n//\n//\t// Create the service client value configured for credentials.\n//\tsvc := s3.New(s3.Options{\n//\t  Credentials: aws.NewCredentialsCache(provider),\n//\t})\n//\n// If you need more control, you can set the configuration options on the\n// credentials provider using the imds.Options type to configure the EC2 IMDS\n// API Client and ExpiryWindow of the retrieved credentials.\n//\n//\tprovider := imds.New(imds.Options{\n//\t\t// See imds.Options type's documentation for more options available.\n//\t\tClient: imds.New(Options{\n//\t\t\tHTTPClient: customHTTPClient,\n//\t\t}),\n//\n//\t\t// Modify how soon credentials expire prior to their original expiry time.\n//\t\tExpiryWindow: 5 * time.Minute,\n//\t})\n//\n// # EC2 IMDS API Client\n//\n// See the github.com/aws/aws-sdk-go-v2/feature/ec2/imds module for more details on\n// configuring the client, and options available.\npackage ec2rolecreds\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go",
    "content": "package ec2rolecreds\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"path\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/feature/ec2/imds\"\n\tsdkrand \"github.com/aws/aws-sdk-go-v2/internal/rand\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// ProviderName provides a name of EC2Role provider\nconst ProviderName = \"EC2RoleProvider\"\n\n// GetMetadataAPIClient provides the interface for an EC2 IMDS API client for the\n// GetMetadata operation.\ntype GetMetadataAPIClient interface {\n\tGetMetadata(context.Context, *imds.GetMetadataInput, ...func(*imds.Options)) (*imds.GetMetadataOutput, error)\n}\n\n// A Provider retrieves credentials from the EC2 service, and keeps track if\n// those credentials are expired.\n//\n// The New function must be used to create the with a custom EC2 IMDS client.\n//\n//\tp := &ec2rolecreds.New(func(o *ec2rolecreds.Options{\n//\t     o.Client = imds.New(imds.Options{/* custom options */})\n//\t})\ntype Provider struct {\n\toptions Options\n}\n\n// Options is a list of user settable options for setting the behavior of the Provider.\ntype Options struct {\n\t// The API client that will be used by the provider to make GetMetadata API\n\t// calls to EC2 IMDS.\n\t//\n\t// If nil, the provider will default to the EC2 IMDS client.\n\tClient GetMetadataAPIClient\n}\n\n// New returns an initialized Provider value configured to retrieve\n// credentials from EC2 Instance Metadata service.\nfunc New(optFns ...func(*Options)) *Provider {\n\toptions := Options{}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.Client == nil {\n\t\toptions.Client = imds.New(imds.Options{})\n\t}\n\n\treturn &Provider{\n\t\toptions: options,\n\t}\n}\n\n// Retrieve retrieves credentials from the EC2 service. Error will be returned\n// if the request fails, or unable to extract the desired credentials.\nfunc (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\tcredsList, err := requestCredList(ctx, p.options.Client)\n\tif err != nil {\n\t\treturn aws.Credentials{Source: ProviderName}, err\n\t}\n\n\tif len(credsList) == 0 {\n\t\treturn aws.Credentials{Source: ProviderName},\n\t\t\tfmt.Errorf(\"unexpected empty EC2 IMDS role list\")\n\t}\n\tcredsName := credsList[0]\n\n\troleCreds, err := requestCred(ctx, p.options.Client, credsName)\n\tif err != nil {\n\t\treturn aws.Credentials{Source: ProviderName}, err\n\t}\n\n\tcreds := aws.Credentials{\n\t\tAccessKeyID:     roleCreds.AccessKeyID,\n\t\tSecretAccessKey: roleCreds.SecretAccessKey,\n\t\tSessionToken:    roleCreds.Token,\n\t\tSource:          ProviderName,\n\n\t\tCanExpire: true,\n\t\tExpires:   roleCreds.Expiration,\n\t}\n\n\t// Cap role credentials Expires to 1 hour so they can be refreshed more\n\t// often. Jitter will be applied credentials cache if being used.\n\tif anHour := sdk.NowTime().Add(1 * time.Hour); creds.Expires.After(anHour) {\n\t\tcreds.Expires = anHour\n\t}\n\n\treturn creds, nil\n}\n\n// HandleFailToRefresh will extend the credentials Expires time if it it is\n// expired. If the credentials will not expire within the minimum time, they\n// will be returned.\n//\n// If the credentials cannot expire, the original error will be returned.\nfunc (p *Provider) HandleFailToRefresh(ctx context.Context, prevCreds aws.Credentials, err error) (\n\taws.Credentials, error,\n) {\n\tif !prevCreds.CanExpire {\n\t\treturn aws.Credentials{}, err\n\t}\n\n\tif prevCreds.Expires.After(sdk.NowTime().Add(5 * time.Minute)) {\n\t\treturn prevCreds, nil\n\t}\n\n\tnewCreds := prevCreds\n\trandFloat64, err := sdkrand.CryptoRandFloat64()\n\tif err != nil {\n\t\treturn aws.Credentials{}, fmt.Errorf(\"failed to get random float, %w\", err)\n\t}\n\n\t// Random distribution of [5,15) minutes.\n\texpireOffset := time.Duration(randFloat64*float64(10*time.Minute)) + 5*time.Minute\n\tnewCreds.Expires = sdk.NowTime().Add(expireOffset)\n\n\tlogger := middleware.GetLogger(ctx)\n\tlogger.Logf(logging.Warn, \"Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again in %v minutes.\", math.Floor(expireOffset.Minutes()))\n\n\treturn newCreds, nil\n}\n\n// AdjustExpiresBy will adds the passed in duration to the passed in\n// credential's Expires time, unless the time until Expires is less than 15\n// minutes. Returns the credentials, even if not updated.\nfunc (p *Provider) AdjustExpiresBy(creds aws.Credentials, dur time.Duration) (\n\taws.Credentials, error,\n) {\n\tif !creds.CanExpire {\n\t\treturn creds, nil\n\t}\n\tif creds.Expires.Before(sdk.NowTime().Add(15 * time.Minute)) {\n\t\treturn creds, nil\n\t}\n\n\tcreds.Expires = creds.Expires.Add(dur)\n\treturn creds, nil\n}\n\n// ec2RoleCredRespBody provides the shape for unmarshaling credential\n// request responses.\ntype ec2RoleCredRespBody struct {\n\t// Success State\n\tExpiration      time.Time\n\tAccessKeyID     string\n\tSecretAccessKey string\n\tToken           string\n\n\t// Error state\n\tCode    string\n\tMessage string\n}\n\nconst iamSecurityCredsPath = \"/iam/security-credentials/\"\n\n// requestCredList requests a list of credentials from the EC2 service. If\n// there are no credentials, or there is an error making or receiving the\n// request\nfunc requestCredList(ctx context.Context, client GetMetadataAPIClient) ([]string, error) {\n\tresp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{\n\t\tPath: iamSecurityCredsPath,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"no EC2 IMDS role found, %w\", err)\n\t}\n\tdefer resp.Content.Close()\n\n\tcredsList := []string{}\n\ts := bufio.NewScanner(resp.Content)\n\tfor s.Scan() {\n\t\tcredsList = append(credsList, s.Text())\n\t}\n\n\tif err := s.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read EC2 IMDS role, %w\", err)\n\t}\n\n\treturn credsList, nil\n}\n\n// requestCred requests the credentials for a specific credentials from the EC2 service.\n//\n// If the credentials cannot be found, or there is an error reading the response\n// and error will be returned.\nfunc requestCred(ctx context.Context, client GetMetadataAPIClient, credsName string) (ec2RoleCredRespBody, error) {\n\tresp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{\n\t\tPath: path.Join(iamSecurityCredsPath, credsName),\n\t})\n\tif err != nil {\n\t\treturn ec2RoleCredRespBody{},\n\t\t\tfmt.Errorf(\"failed to get %s EC2 IMDS role credentials, %w\",\n\t\t\t\tcredsName, err)\n\t}\n\tdefer resp.Content.Close()\n\n\tvar respCreds ec2RoleCredRespBody\n\tif err := json.NewDecoder(resp.Content).Decode(&respCreds); err != nil {\n\t\treturn ec2RoleCredRespBody{},\n\t\t\tfmt.Errorf(\"failed to decode %s EC2 IMDS role credentials, %w\",\n\t\t\t\tcredsName, err)\n\t}\n\n\tif !strings.EqualFold(respCreds.Code, \"Success\") {\n\t\t// If an error code was returned something failed requesting the role.\n\t\treturn ec2RoleCredRespBody{},\n\t\t\tfmt.Errorf(\"failed to get %s EC2 IMDS role credentials, %w\",\n\t\t\t\tcredsName,\n\t\t\t\t&smithy.GenericAPIError{Code: respCreds.Code, Message: respCreds.Message})\n\t}\n\n\treturn respCreds, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\t\"github.com/aws/smithy-go\"\n\tsmithymiddleware \"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ServiceID is the client identifer\nconst ServiceID = \"endpoint-credentials\"\n\n// HTTPClient is a client for sending HTTP requests\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// Options is the endpoint client configurable options\ntype Options struct {\n\t// The endpoint to retrieve credentials from\n\tEndpoint string\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer.\n\tRetryer aws.Retryer\n\n\t// Set of options to modify how the credentials operation is invoked.\n\tAPIOptions []func(*smithymiddleware.Stack) error\n}\n\n// Copy creates a copy of the API options.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*smithymiddleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\treturn to\n}\n\n// Client is an client for retrieving AWS credentials from an endpoint\ntype Client struct {\n\toptions Options\n}\n\n// New constructs a new Client from the given options\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tif options.HTTPClient == nil {\n\t\toptions.HTTPClient = awshttp.NewBuildableClient()\n\t}\n\n\tif options.Retryer == nil {\n\t\t// Amazon-owned implementations of this endpoint are known to sometimes\n\t\t// return plaintext responses (i.e. no Code) like normal, add a few\n\t\t// additional status codes\n\t\toptions.Retryer = retry.NewStandard(func(o *retry.StandardOptions) {\n\t\t\to.Retryables = append(o.Retryables, retry.RetryableHTTPStatusCode{\n\t\t\t\tCodes: map[int]struct{}{\n\t\t\t\t\thttp.StatusTooManyRequests: {},\n\t\t\t\t},\n\t\t\t})\n\t\t})\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\treturn client\n}\n\n// GetCredentialsInput is the input to send with the endpoint service to receive credentials.\ntype GetCredentialsInput struct {\n\tAuthorizationToken string\n}\n\n// GetCredentials retrieves credentials from credential endpoint\nfunc (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput, optFns ...func(*Options)) (*GetCredentialsOutput, error) {\n\tstack := smithymiddleware.NewStack(\"GetCredentials\", smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tstack.Serialize.Add(&serializeOpGetCredential{}, smithymiddleware.After)\n\tstack.Build.Add(&buildEndpoint{Endpoint: options.Endpoint}, smithymiddleware.After)\n\tstack.Deserialize.Add(&deserializeOpGetCredential{}, smithymiddleware.After)\n\taddProtocolFinalizerMiddlewares(stack, options, \"GetCredentials\")\n\tretry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer})\n\tmiddleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID)\n\tsmithyhttp.AddErrorCloseResponseBodyMiddleware(stack)\n\tsmithyhttp.AddCloseResponseBodyMiddleware(stack)\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\thandler := smithymiddleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, _, err := handler.Handle(ctx, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result.(*GetCredentialsOutput), err\n}\n\n// GetCredentialsOutput is the response from the credential endpoint\ntype GetCredentialsOutput struct {\n\tExpiration      *time.Time\n\tAccessKeyID     string\n\tSecretAccessKey string\n\tToken           string\n\tAccountID       string\n}\n\n// EndpointError is an error returned from the endpoint service\ntype EndpointError struct {\n\tCode       string            `json:\"code\"`\n\tMessage    string            `json:\"message\"`\n\tFault      smithy.ErrorFault `json:\"-\"`\n\tstatusCode int               `json:\"-\"`\n}\n\n// Error is the error mesage string\nfunc (e *EndpointError) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.Code, e.Message)\n}\n\n// ErrorCode is the error code returned by the endpoint\nfunc (e *EndpointError) ErrorCode() string {\n\treturn e.Code\n}\n\n// ErrorMessage is the error message returned by the endpoint\nfunc (e *EndpointError) ErrorMessage() string {\n\treturn e.Message\n}\n\n// ErrorFault indicates error fault classification\nfunc (e *EndpointError) ErrorFault() smithy.ErrorFault {\n\treturn e.Fault\n}\n\n// HTTPStatusCode implements retry.HTTPStatusCode.\nfunc (e *EndpointError) HTTPStatusCode() int {\n\treturn e.statusCode\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go",
    "content": "package client\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\n\t\"github.com/aws/smithy-go\"\n\tsmithymiddleware \"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\ntype buildEndpoint struct {\n\tEndpoint string\n}\n\nfunc (b *buildEndpoint) ID() string {\n\treturn \"BuildEndpoint\"\n}\n\nfunc (b *buildEndpoint) HandleBuild(ctx context.Context, in smithymiddleware.BuildInput, next smithymiddleware.BuildHandler) (\n\tout smithymiddleware.BuildOutput, metadata smithymiddleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport, %T\", in.Request)\n\t}\n\n\tif len(b.Endpoint) == 0 {\n\t\treturn out, metadata, fmt.Errorf(\"endpoint not provided\")\n\t}\n\n\tparsed, err := url.Parse(b.Endpoint)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint, %w\", err)\n\t}\n\n\trequest.URL = parsed\n\n\treturn next.HandleBuild(ctx, in)\n}\n\ntype serializeOpGetCredential struct{}\n\nfunc (s *serializeOpGetCredential) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (s *serializeOpGetCredential) HandleSerialize(ctx context.Context, in smithymiddleware.SerializeInput, next smithymiddleware.SerializeHandler) (\n\tout smithymiddleware.SerializeOutput, metadata smithymiddleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type, %T\", in.Request)\n\t}\n\n\tparams, ok := in.Parameters.(*GetCredentialsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters, %T\", in.Parameters)\n\t}\n\n\tconst acceptHeader = \"Accept\"\n\trequest.Header[acceptHeader] = append(request.Header[acceptHeader][:0], \"application/json\")\n\n\tif len(params.AuthorizationToken) > 0 {\n\t\tconst authHeader = \"Authorization\"\n\t\trequest.Header[authHeader] = append(request.Header[authHeader][:0], params.AuthorizationToken)\n\t}\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype deserializeOpGetCredential struct{}\n\nfunc (d *deserializeOpGetCredential) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (d *deserializeOpGetCredential) HandleDeserialize(ctx context.Context, in smithymiddleware.DeserializeInput, next smithymiddleware.DeserializeHandler) (\n\tout smithymiddleware.DeserializeOutput, metadata smithymiddleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, deserializeError(response)\n\t}\n\n\tvar shape *GetCredentialsOutput\n\tif err = json.NewDecoder(response.Body).Decode(&shape); err != nil {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"failed to deserialize json response, %w\", err)}\n\t}\n\n\tout.Result = shape\n\treturn out, metadata, err\n}\n\nfunc deserializeError(response *smithyhttp.Response) error {\n\t// we could be talking to anything, json isn't guaranteed\n\t// see https://github.com/aws/aws-sdk-go-v2/issues/2316\n\tif response.Header.Get(\"Content-Type\") == \"application/json\" {\n\t\treturn deserializeJSONError(response)\n\t}\n\n\tmsg, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr: fmt.Errorf(\"read response, %w\", err),\n\t\t}\n\t}\n\n\treturn &EndpointError{\n\t\t// no sensible value for Code\n\t\tMessage:    string(msg),\n\t\tFault:      stof(response.StatusCode),\n\t\tstatusCode: response.StatusCode,\n\t}\n}\n\nfunc deserializeJSONError(response *smithyhttp.Response) error {\n\tvar errShape *EndpointError\n\tif err := json.NewDecoder(response.Body).Decode(&errShape); err != nil {\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr: fmt.Errorf(\"failed to decode error message, %w\", err),\n\t\t}\n\t}\n\n\terrShape.Fault = stof(response.StatusCode)\n\terrShape.statusCode = response.StatusCode\n\treturn errShape\n}\n\n// maps HTTP status code to smithy ErrorFault\nfunc stof(code int) smithy.ErrorFault {\n\tif code >= 500 {\n\t\treturn smithy.FaultServer\n\t}\n\treturn smithy.FaultClient\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *smithymiddleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, smithymiddleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", smithymiddleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", smithymiddleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", smithymiddleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go",
    "content": "// Package endpointcreds provides support for retrieving credentials from an\n// arbitrary HTTP endpoint.\n//\n// The credentials endpoint Provider can receive both static and refreshable\n// credentials that will expire. Credentials are static when an \"Expiration\"\n// value is not provided in the endpoint's response.\n//\n// Static credentials will never expire once they have been retrieved. The format\n// of the static credentials response:\n//\n//\t{\n//\t    \"AccessKeyId\" : \"MUA...\",\n//\t    \"SecretAccessKey\" : \"/7PC5om....\",\n//\t}\n//\n// Refreshable credentials will expire within the \"ExpiryWindow\" of the Expiration\n// value in the response. The format of the refreshable credentials response:\n//\n//\t{\n//\t    \"AccessKeyId\" : \"MUA...\",\n//\t    \"SecretAccessKey\" : \"/7PC5om....\",\n//\t    \"Token\" : \"AQoDY....=\",\n//\t    \"Expiration\" : \"2016-02-25T06:03:31Z\"\n//\t}\n//\n// Errors should be returned in the following format and only returned with 400\n// or 500 HTTP status codes.\n//\n//\t{\n//\t    \"code\": \"ErrorCode\",\n//\t    \"message\": \"Helpful error message.\"\n//\t}\npackage endpointcreds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// ProviderName is the name of the credentials provider.\nconst ProviderName = `CredentialsEndpointProvider`\n\ntype getCredentialsAPIClient interface {\n\tGetCredentials(context.Context, *client.GetCredentialsInput, ...func(*client.Options)) (*client.GetCredentialsOutput, error)\n}\n\n// Provider satisfies the aws.CredentialsProvider interface, and is a client to\n// retrieve credentials from an arbitrary endpoint.\ntype Provider struct {\n\t// The AWS Client to make HTTP requests to the endpoint with. The endpoint\n\t// the request will be made to is provided by the aws.Config's\n\t// EndpointResolver.\n\tclient getCredentialsAPIClient\n\n\toptions Options\n}\n\n// HTTPClient is a client for sending HTTP requests\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// Options is structure of configurable options for Provider\ntype Options struct {\n\t// Endpoint to retrieve credentials from. Required\n\tEndpoint string\n\n\t// HTTPClient to handle sending HTTP requests to the target endpoint.\n\tHTTPClient HTTPClient\n\n\t// Set of options to modify how the credentials operation is invoked.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// The Retryer to be used for determining whether a failed requested should be retried\n\tRetryer aws.Retryer\n\n\t// Optional authorization token value if set will be used as the value of\n\t// the Authorization header of the endpoint credential request.\n\t//\n\t// When constructed from environment, the provider will use the value of\n\t// AWS_CONTAINER_AUTHORIZATION_TOKEN environment variable as the token\n\t//\n\t// Will be overridden if AuthorizationTokenProvider is configured\n\tAuthorizationToken string\n\n\t// Optional auth provider func to dynamically load the auth token from a file\n\t// everytime a credential is retrieved\n\t//\n\t// When constructed from environment, the provider will read and use the content\n\t// of the file pointed to by AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE environment variable\n\t// as the auth token everytime credentials are retrieved\n\t//\n\t// Will override AuthorizationToken if configured\n\tAuthorizationTokenProvider AuthTokenProvider\n}\n\n// AuthTokenProvider defines an interface to dynamically load a value to be passed\n// for the Authorization header of a credentials request.\ntype AuthTokenProvider interface {\n\tGetToken() (string, error)\n}\n\n// TokenProviderFunc is a func type implementing AuthTokenProvider interface\n// and enables customizing token provider behavior\ntype TokenProviderFunc func() (string, error)\n\n// GetToken func retrieves auth token according to TokenProviderFunc implementation\nfunc (p TokenProviderFunc) GetToken() (string, error) {\n\treturn p()\n}\n\n// New returns a credentials Provider for retrieving AWS credentials\n// from arbitrary endpoint.\nfunc New(endpoint string, optFns ...func(*Options)) *Provider {\n\to := Options{\n\t\tEndpoint: endpoint,\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&o)\n\t}\n\n\tp := &Provider{\n\t\tclient: client.New(client.Options{\n\t\t\tHTTPClient: o.HTTPClient,\n\t\t\tEndpoint:   o.Endpoint,\n\t\t\tAPIOptions: o.APIOptions,\n\t\t\tRetryer:    o.Retryer,\n\t\t}),\n\t\toptions: o,\n\t}\n\n\treturn p\n}\n\n// Retrieve will attempt to request the credentials from the endpoint the Provider\n// was configured for. And error will be returned if the retrieval fails.\nfunc (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\tresp, err := p.getCredentials(ctx)\n\tif err != nil {\n\t\treturn aws.Credentials{}, fmt.Errorf(\"failed to load credentials, %w\", err)\n\t}\n\n\tcreds := aws.Credentials{\n\t\tAccessKeyID:     resp.AccessKeyID,\n\t\tSecretAccessKey: resp.SecretAccessKey,\n\t\tSessionToken:    resp.Token,\n\t\tSource:          ProviderName,\n\t\tAccountID:       resp.AccountID,\n\t}\n\n\tif resp.Expiration != nil {\n\t\tcreds.CanExpire = true\n\t\tcreds.Expires = *resp.Expiration\n\t}\n\n\treturn creds, nil\n}\n\nfunc (p *Provider) getCredentials(ctx context.Context) (*client.GetCredentialsOutput, error) {\n\tauthToken, err := p.resolveAuthToken()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"resolve auth token: %v\", err)\n\t}\n\n\treturn p.client.GetCredentials(ctx, &client.GetCredentialsInput{\n\t\tAuthorizationToken: authToken,\n\t})\n}\n\nfunc (p *Provider) resolveAuthToken() (string, error) {\n\tauthToken := p.options.AuthorizationToken\n\n\tvar err error\n\tif p.options.AuthorizationTokenProvider != nil {\n\t\tauthToken, err = p.options.AuthorizationTokenProvider.GetToken()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\tif strings.ContainsAny(authToken, \"\\r\\n\") {\n\t\treturn \"\", fmt.Errorf(\"authorization token contains invalid newline sequence\")\n\t}\n\n\treturn authToken, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage credentials\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.17.27\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go",
    "content": "// Package processcreds is a credentials provider to retrieve credentials from a\n// external CLI invoked process.\n//\n// WARNING: The following describes a method of sourcing credentials from an external\n// process. This can potentially be dangerous, so proceed with caution. Other\n// credential providers should be preferred if at all possible. If using this\n// option, you should make sure that the config file is as locked down as possible\n// using security best practices for your operating system.\n//\n// # Concurrency and caching\n//\n// The Provider is not safe to be used concurrently, and does not provide any\n// caching of credentials retrieved. You should wrap the Provider with a\n// `aws.CredentialsCache` to provide concurrency safety, and caching of\n// credentials.\n//\n// # Loading credentials with the SDKs AWS Config\n//\n// You can use credentials from a AWS shared config `credential_process` in a\n// variety of ways.\n//\n// One way is to setup your shared config file, located in the default\n// location, with the `credential_process` key and the command you want to be\n// called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable\n// (e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file.\n//\n//\t[default]\n//\tcredential_process = /command/to/call\n//\n// Loading configuration using external will use the credential process to\n// retrieve credentials. NOTE: If there are credentials in the profile you are\n// using, the credential process will not be used.\n//\n//\t// Initialize a session to load credentials.\n//\tcfg, _ := config.LoadDefaultConfig(context.TODO())\n//\n//\t// Create S3 service client to use the credentials.\n//\tsvc := s3.NewFromConfig(cfg)\n//\n// # Loading credentials with the Provider directly\n//\n// Another way to use the credentials process provider is by using the\n// `NewProvider` constructor to create the provider and providing a it with a\n// command to be executed to retrieve credentials.\n//\n// The following example creates a credentials provider for a command, and wraps\n// it with the CredentialsCache before assigning the provider to the Amazon S3 API\n// client's Credentials option.\n//\n//\t // Create credentials using the Provider.\n//\t\tprovider := processcreds.NewProvider(\"/path/to/command\")\n//\n//\t // Create the service client value configured for credentials.\n//\t svc := s3.New(s3.Options{\n//\t   Credentials: aws.NewCredentialsCache(provider),\n//\t })\n//\n// If you need more control, you can set any configurable options in the\n// credentials using one or more option functions.\n//\n//\tprovider := processcreds.NewProvider(\"/path/to/command\",\n//\t    func(o *processcreds.Options) {\n//\t      // Override the provider's default timeout\n//\t      o.Timeout = 2 * time.Minute\n//\t    })\n//\n// You can also use your own `exec.Cmd` value by satisfying a value that satisfies\n// the `NewCommandBuilder` interface and use the `NewProviderCommand` constructor.\n//\n//\t// Create an exec.Cmd\n//\tcmdBuilder := processcreds.NewCommandBuilderFunc(\n//\t\tfunc(ctx context.Context) (*exec.Cmd, error) {\n//\t\t\tcmd := exec.CommandContext(ctx,\n//\t\t\t\t\"customCLICommand\",\n//\t\t\t\t\"-a\", \"argument\",\n//\t\t\t)\n//\t\t\tcmd.Env = []string{\n//\t\t\t\t\"ENV_VAR_FOO=value\",\n//\t\t\t\t\"ENV_VAR_BAR=other_value\",\n//\t\t\t}\n//\n//\t\t\treturn cmd, nil\n//\t\t},\n//\t)\n//\n//\t// Create credentials using your exec.Cmd and custom timeout\n//\tprovider := processcreds.NewProviderCommand(cmdBuilder,\n//\t\tfunc(opt *processcreds.Provider) {\n//\t\t\t// optionally override the provider's default timeout\n//\t\t\topt.Timeout = 1 * time.Second\n//\t\t})\npackage processcreds\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go",
    "content": "package processcreds\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdkio\"\n)\n\nconst (\n\t// ProviderName is the name this credentials provider will label any\n\t// returned credentials Value with.\n\tProviderName = `ProcessProvider`\n\n\t// DefaultTimeout default limit on time a process can run.\n\tDefaultTimeout = time.Duration(1) * time.Minute\n)\n\n// ProviderError is an error indicating failure initializing or executing the\n// process credentials provider\ntype ProviderError struct {\n\tErr error\n}\n\n// Error returns the error message.\nfunc (e *ProviderError) Error() string {\n\treturn fmt.Sprintf(\"process provider error: %v\", e.Err)\n}\n\n// Unwrap returns the underlying error the provider error wraps.\nfunc (e *ProviderError) Unwrap() error {\n\treturn e.Err\n}\n\n// Provider satisfies the credentials.Provider interface, and is a\n// client to retrieve credentials from a process.\ntype Provider struct {\n\t// Provides a constructor for exec.Cmd that are invoked by the provider for\n\t// retrieving credentials. Use this to provide custom creation of exec.Cmd\n\t// with things like environment variables, or other configuration.\n\t//\n\t// The provider defaults to the DefaultNewCommand function.\n\tcommandBuilder NewCommandBuilder\n\n\toptions Options\n}\n\n// Options is the configuration options for configuring the Provider.\ntype Options struct {\n\t// Timeout limits the time a process can run.\n\tTimeout time.Duration\n}\n\n// NewCommandBuilder provides the interface for specifying how command will be\n// created that the Provider will use to retrieve credentials with.\ntype NewCommandBuilder interface {\n\tNewCommand(context.Context) (*exec.Cmd, error)\n}\n\n// NewCommandBuilderFunc provides a wrapper type around a function pointer to\n// satisfy the NewCommandBuilder interface.\ntype NewCommandBuilderFunc func(context.Context) (*exec.Cmd, error)\n\n// NewCommand calls the underlying function pointer the builder was initialized with.\nfunc (fn NewCommandBuilderFunc) NewCommand(ctx context.Context) (*exec.Cmd, error) {\n\treturn fn(ctx)\n}\n\n// DefaultNewCommandBuilder provides the default NewCommandBuilder\n// implementation used by the provider. It takes a command and arguments to\n// invoke. The command will also be initialized with the current process\n// environment variables, stderr, and stdin pipes.\ntype DefaultNewCommandBuilder struct {\n\tArgs []string\n}\n\n// NewCommand returns an initialized exec.Cmd with the builder's initialized\n// Args. The command is also initialized current process environment variables,\n// stderr, and stdin pipes.\nfunc (b DefaultNewCommandBuilder) NewCommand(ctx context.Context) (*exec.Cmd, error) {\n\tvar cmdArgs []string\n\tif runtime.GOOS == \"windows\" {\n\t\tcmdArgs = []string{\"cmd.exe\", \"/C\"}\n\t} else {\n\t\tcmdArgs = []string{\"sh\", \"-c\"}\n\t}\n\n\tif len(b.Args) == 0 {\n\t\treturn nil, &ProviderError{\n\t\t\tErr: fmt.Errorf(\"failed to prepare command: command must not be empty\"),\n\t\t}\n\t}\n\n\tcmdArgs = append(cmdArgs, b.Args...)\n\tcmd := exec.CommandContext(ctx, cmdArgs[0], cmdArgs[1:]...)\n\tcmd.Env = os.Environ()\n\n\tcmd.Stderr = os.Stderr // display stderr on console for MFA\n\tcmd.Stdin = os.Stdin   // enable stdin for MFA\n\n\treturn cmd, nil\n}\n\n// NewProvider returns a pointer to a new Credentials object wrapping the\n// Provider.\n//\n// The provider defaults to the DefaultNewCommandBuilder for creating command\n// the Provider will use to retrieve credentials with.\nfunc NewProvider(command string, options ...func(*Options)) *Provider {\n\tvar args []string\n\n\t// Ensure that the command arguments are not set if the provided command is\n\t// empty. This will error out when the command is executed since no\n\t// arguments are specified.\n\tif len(command) > 0 {\n\t\targs = []string{command}\n\t}\n\n\tcommanBuilder := DefaultNewCommandBuilder{\n\t\tArgs: args,\n\t}\n\treturn NewProviderCommand(commanBuilder, options...)\n}\n\n// NewProviderCommand returns a pointer to a new Credentials object with the\n// specified command, and default timeout duration. Use this to provide custom\n// creation of exec.Cmd for options like environment variables, or other\n// configuration.\nfunc NewProviderCommand(builder NewCommandBuilder, options ...func(*Options)) *Provider {\n\tp := &Provider{\n\t\tcommandBuilder: builder,\n\t\toptions: Options{\n\t\t\tTimeout: DefaultTimeout,\n\t\t},\n\t}\n\n\tfor _, option := range options {\n\t\toption(&p.options)\n\t}\n\n\treturn p\n}\n\n// A CredentialProcessResponse is the AWS credentials format that must be\n// returned when executing an external credential_process.\ntype CredentialProcessResponse struct {\n\t// As of this writing, the Version key must be set to 1. This might\n\t// increment over time as the structure evolves.\n\tVersion int\n\n\t// The access key ID that identifies the temporary security credentials.\n\tAccessKeyID string `json:\"AccessKeyId\"`\n\n\t// The secret access key that can be used to sign requests.\n\tSecretAccessKey string\n\n\t// The token that users must pass to the service API to use the temporary credentials.\n\tSessionToken string\n\n\t// The date on which the current credentials expire.\n\tExpiration *time.Time\n\n\t// The ID of the account for credentials\n\tAccountID string `json:\"AccountId\"`\n}\n\n// Retrieve executes the credential process command and returns the\n// credentials, or error if the command fails.\nfunc (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\tout, err := p.executeCredentialProcess(ctx)\n\tif err != nil {\n\t\treturn aws.Credentials{Source: ProviderName}, err\n\t}\n\n\t// Serialize and validate response\n\tresp := &CredentialProcessResponse{}\n\tif err = json.Unmarshal(out, resp); err != nil {\n\t\treturn aws.Credentials{Source: ProviderName}, &ProviderError{\n\t\t\tErr: fmt.Errorf(\"parse failed of process output: %s, error: %w\", out, err),\n\t\t}\n\t}\n\n\tif resp.Version != 1 {\n\t\treturn aws.Credentials{Source: ProviderName}, &ProviderError{\n\t\t\tErr: fmt.Errorf(\"wrong version in process output (not 1)\"),\n\t\t}\n\t}\n\n\tif len(resp.AccessKeyID) == 0 {\n\t\treturn aws.Credentials{Source: ProviderName}, &ProviderError{\n\t\t\tErr: fmt.Errorf(\"missing AccessKeyId in process output\"),\n\t\t}\n\t}\n\n\tif len(resp.SecretAccessKey) == 0 {\n\t\treturn aws.Credentials{Source: ProviderName}, &ProviderError{\n\t\t\tErr: fmt.Errorf(\"missing SecretAccessKey in process output\"),\n\t\t}\n\t}\n\n\tcreds := aws.Credentials{\n\t\tSource:          ProviderName,\n\t\tAccessKeyID:     resp.AccessKeyID,\n\t\tSecretAccessKey: resp.SecretAccessKey,\n\t\tSessionToken:    resp.SessionToken,\n\t\tAccountID:       resp.AccountID,\n\t}\n\n\t// Handle expiration\n\tif resp.Expiration != nil {\n\t\tcreds.CanExpire = true\n\t\tcreds.Expires = *resp.Expiration\n\t}\n\n\treturn creds, nil\n}\n\n// executeCredentialProcess starts the credential process on the OS and\n// returns the results or an error.\nfunc (p *Provider) executeCredentialProcess(ctx context.Context) ([]byte, error) {\n\tif p.options.Timeout >= 0 {\n\t\tvar cancelFunc func()\n\t\tctx, cancelFunc = context.WithTimeout(ctx, p.options.Timeout)\n\t\tdefer cancelFunc()\n\t}\n\n\tcmd, err := p.commandBuilder.NewCommand(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// get creds json on process's stdout\n\toutput := bytes.NewBuffer(make([]byte, 0, int(8*sdkio.KibiByte)))\n\tif cmd.Stdout != nil {\n\t\tcmd.Stdout = io.MultiWriter(cmd.Stdout, output)\n\t} else {\n\t\tcmd.Stdout = output\n\t}\n\n\texecCh := make(chan error, 1)\n\tgo executeCommand(cmd, execCh)\n\n\tselect {\n\tcase execError := <-execCh:\n\t\tif execError == nil {\n\t\t\tbreak\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn output.Bytes(), &ProviderError{\n\t\t\t\tErr: fmt.Errorf(\"credential process timed out: %w\", execError),\n\t\t\t}\n\t\tdefault:\n\t\t\treturn output.Bytes(), &ProviderError{\n\t\t\t\tErr: fmt.Errorf(\"error in credential_process: %w\", execError),\n\t\t\t}\n\t\t}\n\t}\n\n\tout := output.Bytes()\n\tif runtime.GOOS == \"windows\" {\n\t\t// windows adds slashes to quotes\n\t\tout = bytes.ReplaceAll(out, []byte(`\\\"`), []byte(`\"`))\n\t}\n\n\treturn out, nil\n}\n\nfunc executeCommand(cmd *exec.Cmd, exec chan error) {\n\t// Start the command\n\terr := cmd.Start()\n\tif err == nil {\n\t\terr = cmd.Wait()\n\t}\n\n\texec <- err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go",
    "content": "// Package ssocreds provides a credential provider for retrieving temporary AWS\n// credentials using an SSO access token.\n//\n// IMPORTANT: The provider in this package does not initiate or perform the AWS\n// SSO login flow. The SDK provider expects that you have already performed the\n// SSO login flow using AWS CLI using the \"aws sso login\" command, or by some\n// other mechanism. The provider must find a valid non-expired access token for\n// the AWS SSO user portal URL in ~/.aws/sso/cache. If a cached token is not\n// found, it is expired, or the file is malformed an error will be returned.\n//\n// # Loading AWS SSO credentials with the AWS shared configuration file\n//\n// You can use configure AWS SSO credentials from the AWS shared configuration file by\n// specifying the required keys in the profile and referencing an sso-session:\n//\n//\tsso_session\n//\tsso_account_id\n//\tsso_role_name\n//\n// For example, the following defines a profile \"devsso\" and specifies the AWS\n// SSO parameters that defines the target account, role, sign-on portal, and\n// the region where the user portal is located. Note: all SSO arguments must be\n// provided, or an error will be returned.\n//\n//\t[profile devsso]\n//\tsso_session = dev-session\n//\tsso_role_name = SSOReadOnlyRole\n//\tsso_account_id = 123456789012\n//\n//\t[sso-session dev-session]\n//\tsso_start_url = https://my-sso-portal.awsapps.com/start\n//\tsso_region = us-east-1\n//\tsso_registration_scopes = sso:account:access\n//\n// Using the config module, you can load the AWS SDK shared configuration, and\n// specify that this profile be used to retrieve credentials. For example:\n//\n//\tconfig, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile(\"devsso\"))\n//\tif err != nil {\n//\t    return err\n//\t}\n//\n// # Programmatically loading AWS SSO credentials directly\n//\n// You can programmatically construct the AWS SSO Provider in your application,\n// and provide the necessary information to load and retrieve temporary\n// credentials using an access token from ~/.aws/sso/cache.\n//\n//\tssoClient := sso.NewFromConfig(cfg)\n//\tssoOidcClient := ssooidc.NewFromConfig(cfg)\n//\ttokenPath, err := ssocreds.StandardCachedTokenFilepath(\"dev-session\")\n//\tif err != nil {\n//\t    return err\n//\t}\n//\n//\tvar provider aws.CredentialsProvider\n//\tprovider = ssocreds.New(ssoClient, \"123456789012\", \"SSOReadOnlyRole\", \"https://my-sso-portal.awsapps.com/start\", func(options *ssocreds.Options) {\n//\t  options.SSOTokenProvider = ssocreds.NewSSOTokenProvider(ssoOidcClient, tokenPath)\n//\t})\n//\n//\t// Wrap the provider with aws.CredentialsCache to cache the credentials until their expire time\n//\tprovider = aws.NewCredentialsCache(provider)\n//\n//\tcredentials, err := provider.Retrieve(context.TODO())\n//\tif err != nil {\n//\t    return err\n//\t}\n//\n// It is important that you wrap the Provider with aws.CredentialsCache if you\n// are programmatically constructing the provider directly. This prevents your\n// application from accessing the cached access token and requesting new\n// credentials each time the credentials are used.\n//\n// # Additional Resources\n//\n// Configuring the AWS CLI to use AWS Single Sign-On:\n// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html\n//\n// AWS Single Sign-On User Guide:\n// https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html\npackage ssocreds\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go",
    "content": "package ssocreds\n\nimport (\n\t\"crypto/sha1\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/shareddefaults\"\n)\n\nvar osUserHomeDur = shareddefaults.UserHomeDir\n\n// StandardCachedTokenFilepath returns the filepath for the cached SSO token file, or\n// error if unable get derive the path. Key that will be used to compute a SHA1\n// value that is hex encoded.\n//\n// Derives the filepath using the Key as:\n//\n//\t~/.aws/sso/cache/<sha1-hex-encoded-key>.json\nfunc StandardCachedTokenFilepath(key string) (string, error) {\n\thomeDir := osUserHomeDur()\n\tif len(homeDir) == 0 {\n\t\treturn \"\", fmt.Errorf(\"unable to get USER's home directory for cached token\")\n\t}\n\thash := sha1.New()\n\tif _, err := hash.Write([]byte(key)); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to compute cached token filepath key SHA1 hash, %w\", err)\n\t}\n\n\tcacheFilename := strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + \".json\"\n\n\treturn filepath.Join(homeDir, \".aws\", \"sso\", \"cache\", cacheFilename), nil\n}\n\ntype tokenKnownFields struct {\n\tAccessToken string   `json:\"accessToken,omitempty\"`\n\tExpiresAt   *rfc3339 `json:\"expiresAt,omitempty\"`\n\n\tRefreshToken string `json:\"refreshToken,omitempty\"`\n\tClientID     string `json:\"clientId,omitempty\"`\n\tClientSecret string `json:\"clientSecret,omitempty\"`\n}\n\ntype token struct {\n\ttokenKnownFields\n\tUnknownFields map[string]interface{} `json:\"-\"`\n}\n\nfunc (t token) MarshalJSON() ([]byte, error) {\n\tfields := map[string]interface{}{}\n\n\tsetTokenFieldString(fields, \"accessToken\", t.AccessToken)\n\tsetTokenFieldRFC3339(fields, \"expiresAt\", t.ExpiresAt)\n\n\tsetTokenFieldString(fields, \"refreshToken\", t.RefreshToken)\n\tsetTokenFieldString(fields, \"clientId\", t.ClientID)\n\tsetTokenFieldString(fields, \"clientSecret\", t.ClientSecret)\n\n\tfor k, v := range t.UnknownFields {\n\t\tif _, ok := fields[k]; ok {\n\t\t\treturn nil, fmt.Errorf(\"unknown token field %v, duplicates known field\", k)\n\t\t}\n\t\tfields[k] = v\n\t}\n\n\treturn json.Marshal(fields)\n}\n\nfunc setTokenFieldString(fields map[string]interface{}, key, value string) {\n\tif value == \"\" {\n\t\treturn\n\t}\n\tfields[key] = value\n}\nfunc setTokenFieldRFC3339(fields map[string]interface{}, key string, value *rfc3339) {\n\tif value == nil {\n\t\treturn\n\t}\n\tfields[key] = value\n}\n\nfunc (t *token) UnmarshalJSON(b []byte) error {\n\tvar fields map[string]interface{}\n\tif err := json.Unmarshal(b, &fields); err != nil {\n\t\treturn nil\n\t}\n\n\tt.UnknownFields = map[string]interface{}{}\n\n\tfor k, v := range fields {\n\t\tvar err error\n\t\tswitch k {\n\t\tcase \"accessToken\":\n\t\t\terr = getTokenFieldString(v, &t.AccessToken)\n\t\tcase \"expiresAt\":\n\t\t\terr = getTokenFieldRFC3339(v, &t.ExpiresAt)\n\t\tcase \"refreshToken\":\n\t\t\terr = getTokenFieldString(v, &t.RefreshToken)\n\t\tcase \"clientId\":\n\t\t\terr = getTokenFieldString(v, &t.ClientID)\n\t\tcase \"clientSecret\":\n\t\t\terr = getTokenFieldString(v, &t.ClientSecret)\n\t\tdefault:\n\t\t\tt.UnknownFields[k] = v\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"field %q, %w\", k, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getTokenFieldString(v interface{}, value *string) error {\n\tvar ok bool\n\t*value, ok = v.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expect value to be string, got %T\", v)\n\t}\n\treturn nil\n}\n\nfunc getTokenFieldRFC3339(v interface{}, value **rfc3339) error {\n\tvar stringValue string\n\tif err := getTokenFieldString(v, &stringValue); err != nil {\n\t\treturn err\n\t}\n\n\ttimeValue, err := parseRFC3339(stringValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*value = &timeValue\n\treturn nil\n}\n\nfunc loadCachedToken(filename string) (token, error) {\n\tfileBytes, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn token{}, fmt.Errorf(\"failed to read cached SSO token file, %w\", err)\n\t}\n\n\tvar t token\n\tif err := json.Unmarshal(fileBytes, &t); err != nil {\n\t\treturn token{}, fmt.Errorf(\"failed to parse cached SSO token file, %w\", err)\n\t}\n\n\tif len(t.AccessToken) == 0 || t.ExpiresAt == nil || time.Time(*t.ExpiresAt).IsZero() {\n\t\treturn token{}, fmt.Errorf(\n\t\t\t\"cached SSO token must contain accessToken and expiresAt fields\")\n\t}\n\n\treturn t, nil\n}\n\nfunc storeCachedToken(filename string, t token, fileMode os.FileMode) (err error) {\n\ttmpFilename := filename + \".tmp-\" + strconv.FormatInt(sdk.NowTime().UnixNano(), 10)\n\tif err := writeCacheFile(tmpFilename, fileMode, t); err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.Rename(tmpFilename, filename); err != nil {\n\t\treturn fmt.Errorf(\"failed to replace old cached SSO token file, %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc writeCacheFile(filename string, fileMode os.FileMode, t token) (err error) {\n\tvar f *os.File\n\tf, err = os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_RDWR, fileMode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create cached SSO token file %w\", err)\n\t}\n\n\tdefer func() {\n\t\tcloseErr := f.Close()\n\t\tif err == nil && closeErr != nil {\n\t\t\terr = fmt.Errorf(\"failed to close cached SSO token file, %w\", closeErr)\n\t\t}\n\t}()\n\n\tencoder := json.NewEncoder(f)\n\n\tif err = encoder.Encode(t); err != nil {\n\t\treturn fmt.Errorf(\"failed to serialize cached SSO token, %w\", err)\n\t}\n\n\treturn nil\n}\n\ntype rfc3339 time.Time\n\nfunc parseRFC3339(v string) (rfc3339, error) {\n\tparsed, err := time.Parse(time.RFC3339, v)\n\tif err != nil {\n\t\treturn rfc3339{}, fmt.Errorf(\"expected RFC3339 timestamp: %w\", err)\n\t}\n\n\treturn rfc3339(parsed), nil\n}\n\nfunc (r *rfc3339) UnmarshalJSON(bytes []byte) (err error) {\n\tvar value string\n\n\t// Use JSON unmarshal to unescape the quoted value making use of JSON's\n\t// unquoting rules.\n\tif err = json.Unmarshal(bytes, &value); err != nil {\n\t\treturn err\n\t}\n\n\t*r, err = parseRFC3339(value)\n\n\treturn nil\n}\n\nfunc (r *rfc3339) MarshalJSON() ([]byte, error) {\n\tvalue := time.Time(*r).Format(time.RFC3339)\n\n\t// Use JSON unmarshal to unescape the quoted value making use of JSON's\n\t// quoting rules.\n\treturn json.Marshal(value)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go",
    "content": "package ssocreds\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso\"\n)\n\n// ProviderName is the name of the provider used to specify the source of\n// credentials.\nconst ProviderName = \"SSOProvider\"\n\n// GetRoleCredentialsAPIClient is a API client that implements the\n// GetRoleCredentials operation.\ntype GetRoleCredentialsAPIClient interface {\n\tGetRoleCredentials(context.Context, *sso.GetRoleCredentialsInput, ...func(*sso.Options)) (\n\t\t*sso.GetRoleCredentialsOutput, error,\n\t)\n}\n\n// Options is the Provider options structure.\ntype Options struct {\n\t// The Client which is configured for the AWS Region where the AWS SSO user\n\t// portal is located.\n\tClient GetRoleCredentialsAPIClient\n\n\t// The AWS account that is assigned to the user.\n\tAccountID string\n\n\t// The role name that is assigned to the user.\n\tRoleName string\n\n\t// The URL that points to the organization's AWS Single Sign-On (AWS SSO)\n\t// user portal.\n\tStartURL string\n\n\t// The filepath the cached token will be retrieved from. If unset Provider will\n\t// use the startURL to determine the filepath at.\n\t//\n\t//    ~/.aws/sso/cache/<sha1-hex-encoded-startURL>.json\n\t//\n\t// If custom cached token filepath is used, the Provider's startUrl\n\t// parameter will be ignored.\n\tCachedTokenFilepath string\n\n\t// Used by the SSOCredentialProvider if a token configuration\n\t// profile is used in the shared config\n\tSSOTokenProvider *SSOTokenProvider\n}\n\n// Provider is an AWS credential provider that retrieves temporary AWS\n// credentials by exchanging an SSO login token.\ntype Provider struct {\n\toptions Options\n\n\tcachedTokenFilepath string\n}\n\n// New returns a new AWS Single Sign-On (AWS SSO) credential provider. The\n// provided client is expected to be configured for the AWS Region where the\n// AWS SSO user portal is located.\nfunc New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL string, optFns ...func(options *Options)) *Provider {\n\toptions := Options{\n\t\tClient:    client,\n\t\tAccountID: accountID,\n\t\tRoleName:  roleName,\n\t\tStartURL:  startURL,\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &Provider{\n\t\toptions:             options,\n\t\tcachedTokenFilepath: options.CachedTokenFilepath,\n\t}\n}\n\n// Retrieve retrieves temporary AWS credentials from the configured Amazon\n// Single Sign-On (AWS SSO) user portal by exchanging the accessToken present\n// in ~/.aws/sso/cache. However, if a token provider configuration exists\n// in the shared config, then we ought to use the token provider rather then\n// direct access on the cached token.\nfunc (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\tvar accessToken *string\n\tif p.options.SSOTokenProvider != nil {\n\t\ttoken, err := p.options.SSOTokenProvider.RetrieveBearerToken(ctx)\n\t\tif err != nil {\n\t\t\treturn aws.Credentials{}, err\n\t\t}\n\t\taccessToken = &token.Value\n\t} else {\n\t\tif p.cachedTokenFilepath == \"\" {\n\t\t\tcachedTokenFilepath, err := StandardCachedTokenFilepath(p.options.StartURL)\n\t\t\tif err != nil {\n\t\t\t\treturn aws.Credentials{}, &InvalidTokenError{Err: err}\n\t\t\t}\n\t\t\tp.cachedTokenFilepath = cachedTokenFilepath\n\t\t}\n\n\t\ttokenFile, err := loadCachedToken(p.cachedTokenFilepath)\n\t\tif err != nil {\n\t\t\treturn aws.Credentials{}, &InvalidTokenError{Err: err}\n\t\t}\n\n\t\tif tokenFile.ExpiresAt == nil || sdk.NowTime().After(time.Time(*tokenFile.ExpiresAt)) {\n\t\t\treturn aws.Credentials{}, &InvalidTokenError{}\n\t\t}\n\t\taccessToken = &tokenFile.AccessToken\n\t}\n\n\toutput, err := p.options.Client.GetRoleCredentials(ctx, &sso.GetRoleCredentialsInput{\n\t\tAccessToken: accessToken,\n\t\tAccountId:   &p.options.AccountID,\n\t\tRoleName:    &p.options.RoleName,\n\t})\n\tif err != nil {\n\t\treturn aws.Credentials{}, err\n\t}\n\n\treturn aws.Credentials{\n\t\tAccessKeyID:     aws.ToString(output.RoleCredentials.AccessKeyId),\n\t\tSecretAccessKey: aws.ToString(output.RoleCredentials.SecretAccessKey),\n\t\tSessionToken:    aws.ToString(output.RoleCredentials.SessionToken),\n\t\tCanExpire:       true,\n\t\tExpires:         time.Unix(0, output.RoleCredentials.Expiration*int64(time.Millisecond)).UTC(),\n\t\tSource:          ProviderName,\n\t\tAccountID:       p.options.AccountID,\n\t}, nil\n}\n\n// InvalidTokenError is the error type that is returned if loaded token has\n// expired or is otherwise invalid. To refresh the SSO session run AWS SSO\n// login with the corresponding profile.\ntype InvalidTokenError struct {\n\tErr error\n}\n\nfunc (i *InvalidTokenError) Unwrap() error {\n\treturn i.Err\n}\n\nfunc (i *InvalidTokenError) Error() string {\n\tconst msg = \"the SSO session has expired or is invalid\"\n\tif i.Err == nil {\n\t\treturn msg\n\t}\n\treturn msg + \": \" + i.Err.Error()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go",
    "content": "package ssocreds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssooidc\"\n\t\"github.com/aws/smithy-go/auth/bearer\"\n)\n\n// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API\n// client for calling CreateToken operation to refresh the SSO token.\ntype CreateTokenAPIClient interface {\n\tCreateToken(context.Context, *ssooidc.CreateTokenInput, ...func(*ssooidc.Options)) (\n\t\t*ssooidc.CreateTokenOutput, error,\n\t)\n}\n\n// SSOTokenProviderOptions provides the options for configuring the\n// SSOTokenProvider.\ntype SSOTokenProviderOptions struct {\n\t// Client that can be overridden\n\tClient CreateTokenAPIClient\n\n\t// The set of API Client options to be applied when invoking the\n\t// CreateToken operation.\n\tClientOptions []func(*ssooidc.Options)\n\n\t// The path the file containing the cached SSO token will be read from.\n\t// Initialized the NewSSOTokenProvider's cachedTokenFilepath parameter.\n\tCachedTokenFilepath string\n}\n\n// SSOTokenProvider provides an utility for refreshing SSO AccessTokens for\n// Bearer Authentication. The SSOTokenProvider can only be used to refresh\n// already cached SSO Tokens. This utility cannot perform the initial SSO\n// create token.\n//\n// The SSOTokenProvider is not safe to use concurrently. It must be wrapped in\n// a utility such as smithy-go's auth/bearer#TokenCache. The SDK's\n// config.LoadDefaultConfig will automatically wrap the SSOTokenProvider with\n// the smithy-go TokenCache, if the external configuration loaded configured\n// for an SSO session.\n//\n// The initial SSO create token should be preformed with the AWS CLI before the\n// Go application using the SSOTokenProvider will need to retrieve the SSO\n// token. If the AWS CLI has not created the token cache file, this provider\n// will return an error when attempting to retrieve the cached token.\n//\n// This provider will attempt to refresh the cached SSO token periodically if\n// needed when RetrieveBearerToken is called.\n//\n// A utility such as the AWS CLI must be used to initially create the SSO\n// session and cached token file.\n// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html\ntype SSOTokenProvider struct {\n\toptions SSOTokenProviderOptions\n}\n\nvar _ bearer.TokenProvider = (*SSOTokenProvider)(nil)\n\n// NewSSOTokenProvider returns an initialized SSOTokenProvider that will\n// periodically refresh the SSO token cached stored in the cachedTokenFilepath.\n// The cachedTokenFilepath file's content will be rewritten by the token\n// provider when the token is refreshed.\n//\n// The client must be configured for the AWS region the SSO token was created for.\nfunc NewSSOTokenProvider(client CreateTokenAPIClient, cachedTokenFilepath string, optFns ...func(o *SSOTokenProviderOptions)) *SSOTokenProvider {\n\toptions := SSOTokenProviderOptions{\n\t\tClient:              client,\n\t\tCachedTokenFilepath: cachedTokenFilepath,\n\t}\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tprovider := &SSOTokenProvider{\n\t\toptions: options,\n\t}\n\n\treturn provider\n}\n\n// RetrieveBearerToken returns the SSO token stored in the cachedTokenFilepath\n// the SSOTokenProvider was created with. If the token has expired\n// RetrieveBearerToken will attempt to refresh it. If the token cannot be\n// refreshed or is not present an error will be returned.\n//\n// A utility such as the AWS CLI must be used to initially create the SSO\n// session and cached token file. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html\nfunc (p SSOTokenProvider) RetrieveBearerToken(ctx context.Context) (bearer.Token, error) {\n\tcachedToken, err := loadCachedToken(p.options.CachedTokenFilepath)\n\tif err != nil {\n\t\treturn bearer.Token{}, err\n\t}\n\n\tif cachedToken.ExpiresAt != nil && sdk.NowTime().After(time.Time(*cachedToken.ExpiresAt)) {\n\t\tcachedToken, err = p.refreshToken(ctx, cachedToken)\n\t\tif err != nil {\n\t\t\treturn bearer.Token{}, fmt.Errorf(\"refresh cached SSO token failed, %w\", err)\n\t\t}\n\t}\n\n\texpiresAt := aws.ToTime((*time.Time)(cachedToken.ExpiresAt))\n\treturn bearer.Token{\n\t\tValue:     cachedToken.AccessToken,\n\t\tCanExpire: !expiresAt.IsZero(),\n\t\tExpires:   expiresAt,\n\t}, nil\n}\n\nfunc (p SSOTokenProvider) refreshToken(ctx context.Context, cachedToken token) (token, error) {\n\tif cachedToken.ClientSecret == \"\" || cachedToken.ClientID == \"\" || cachedToken.RefreshToken == \"\" {\n\t\treturn token{}, fmt.Errorf(\"cached SSO token is expired, or not present, and cannot be refreshed\")\n\t}\n\n\tcreateResult, err := p.options.Client.CreateToken(ctx, &ssooidc.CreateTokenInput{\n\t\tClientId:     &cachedToken.ClientID,\n\t\tClientSecret: &cachedToken.ClientSecret,\n\t\tRefreshToken: &cachedToken.RefreshToken,\n\t\tGrantType:    aws.String(\"refresh_token\"),\n\t}, p.options.ClientOptions...)\n\tif err != nil {\n\t\treturn token{}, fmt.Errorf(\"unable to refresh SSO token, %w\", err)\n\t}\n\n\texpiresAt := sdk.NowTime().Add(time.Duration(createResult.ExpiresIn) * time.Second)\n\n\tcachedToken.AccessToken = aws.ToString(createResult.AccessToken)\n\tcachedToken.ExpiresAt = (*rfc3339)(&expiresAt)\n\tcachedToken.RefreshToken = aws.ToString(createResult.RefreshToken)\n\n\tfileInfo, err := os.Stat(p.options.CachedTokenFilepath)\n\tif err != nil {\n\t\treturn token{}, fmt.Errorf(\"failed to stat cached SSO token file %w\", err)\n\t}\n\n\tif err = storeCachedToken(p.options.CachedTokenFilepath, cachedToken, fileInfo.Mode()); err != nil {\n\t\treturn token{}, fmt.Errorf(\"unable to cache refreshed SSO token, %w\", err)\n\t}\n\n\treturn cachedToken, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.go",
    "content": "package credentials\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\nconst (\n\t// StaticCredentialsName provides a name of Static provider\n\tStaticCredentialsName = \"StaticCredentials\"\n)\n\n// StaticCredentialsEmptyError is emitted when static credentials are empty.\ntype StaticCredentialsEmptyError struct{}\n\nfunc (*StaticCredentialsEmptyError) Error() string {\n\treturn \"static credentials are empty\"\n}\n\n// A StaticCredentialsProvider is a set of credentials which are set, and will\n// never expire.\ntype StaticCredentialsProvider struct {\n\tValue aws.Credentials\n}\n\n// NewStaticCredentialsProvider return a StaticCredentialsProvider initialized with the AWS\n// credentials passed in.\nfunc NewStaticCredentialsProvider(key, secret, session string) StaticCredentialsProvider {\n\treturn StaticCredentialsProvider{\n\t\tValue: aws.Credentials{\n\t\t\tAccessKeyID:     key,\n\t\t\tSecretAccessKey: secret,\n\t\t\tSessionToken:    session,\n\t\t},\n\t}\n}\n\n// Retrieve returns the credentials or error if the credentials are invalid.\nfunc (s StaticCredentialsProvider) Retrieve(_ context.Context) (aws.Credentials, error) {\n\tv := s.Value\n\tif v.AccessKeyID == \"\" || v.SecretAccessKey == \"\" {\n\t\treturn aws.Credentials{\n\t\t\tSource: StaticCredentialsName,\n\t\t}, &StaticCredentialsEmptyError{}\n\t}\n\n\tif len(v.Source) == 0 {\n\t\tv.Source = StaticCredentialsName\n\t}\n\n\treturn v, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go",
    "content": "// Package stscreds are credential Providers to retrieve STS AWS credentials.\n//\n// STS provides multiple ways to retrieve credentials which can be used when making\n// future AWS service API operation calls.\n//\n// The SDK will ensure that per instance of credentials.Credentials all requests\n// to refresh the credentials will be synchronized. But, the SDK is unable to\n// ensure synchronous usage of the AssumeRoleProvider if the value is shared\n// between multiple Credentials or service clients.\n//\n// # Assume Role\n//\n// To assume an IAM role using STS with the SDK you can create a new Credentials\n// with the SDKs's stscreds package.\n//\n//\t// Initial credentials loaded from SDK's default credential chain. Such as\n//\t// the environment, shared credentials (~/.aws/credentials), or EC2 Instance\n//\t// Role. These credentials will be used to to make the STS Assume Role API.\n//\tcfg, err := config.LoadDefaultConfig(context.TODO())\n//\tif err != nil {\n//\t\tpanic(err)\n//\t}\n//\n//\t// Create the credentials from AssumeRoleProvider to assume the role\n//\t// referenced by the \"myRoleARN\" ARN.\n//\tstsSvc := sts.NewFromConfig(cfg)\n//\tcreds := stscreds.NewAssumeRoleProvider(stsSvc, \"myRoleArn\")\n//\n//\tcfg.Credentials = aws.NewCredentialsCache(creds)\n//\n//\t// Create service client value configured for credentials\n//\t// from assumed role.\n//\tsvc := s3.NewFromConfig(cfg)\n//\n// # Assume Role with custom MFA Token provider\n//\n// To assume an IAM role with a MFA token you can either specify a custom MFA\n// token provider or use the SDK's built in StdinTokenProvider that will prompt\n// the user for a token code each time the credentials need to to be refreshed.\n// Specifying a custom token provider allows you to control where the token\n// code is retrieved from, and how it is refreshed.\n//\n// With a custom token provider, the provider is responsible for refreshing the\n// token code when called.\n//\n//\t\tcfg, err := config.LoadDefaultConfig(context.TODO())\n//\t\tif err != nil {\n//\t\t\tpanic(err)\n//\t\t}\n//\n//\t staticTokenProvider := func() (string, error) {\n//\t     return someTokenCode, nil\n//\t }\n//\n//\t\t// Create the credentials from AssumeRoleProvider to assume the role\n//\t\t// referenced by the \"myRoleARN\" ARN using the MFA token code provided.\n//\t\tcreds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), \"myRoleArn\", func(o *stscreds.AssumeRoleOptions) {\n//\t\t\to.SerialNumber = aws.String(\"myTokenSerialNumber\")\n//\t\t\to.TokenProvider = staticTokenProvider\n//\t\t})\n//\n//\t\tcfg.Credentials = aws.NewCredentialsCache(creds)\n//\n//\t\t// Create service client value configured for credentials\n//\t\t// from assumed role.\n//\t\tsvc := s3.NewFromConfig(cfg)\n//\n// # Assume Role with MFA Token Provider\n//\n// To assume an IAM role with MFA for longer running tasks where the credentials\n// may need to be refreshed setting the TokenProvider field of AssumeRoleProvider\n// will allow the credential provider to prompt for new MFA token code when the\n// role's credentials need to be refreshed.\n//\n// The StdinTokenProvider function is available to prompt on stdin to retrieve\n// the MFA token code from the user. You can also implement custom prompts by\n// satisfying the TokenProvider function signature.\n//\n// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will\n// have undesirable results as the StdinTokenProvider will not be synchronized. A\n// single Credentials with an AssumeRoleProvider can be shared safely.\n//\n//\tcfg, err := config.LoadDefaultConfig(context.TODO())\n//\tif err != nil {\n//\t\tpanic(err)\n//\t}\n//\n//\t// Create the credentials from AssumeRoleProvider to assume the role\n//\t// referenced by the \"myRoleARN\" ARN using the MFA token code provided.\n//\tcreds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), \"myRoleArn\", func(o *stscreds.AssumeRoleOptions) {\n//\t\to.SerialNumber = aws.String(\"myTokenSerialNumber\")\n//\t\to.TokenProvider = stscreds.StdinTokenProvider\n//\t})\n//\n//\tcfg.Credentials = aws.NewCredentialsCache(creds)\n//\n//\t// Create service client value configured for credentials\n//\t// from assumed role.\n//\tsvc := s3.NewFromConfig(cfg)\npackage stscreds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n)\n\n// StdinTokenProvider will prompt on stdout and read from stdin for a string value.\n// An error is returned if reading from stdin fails.\n//\n// Use this function go read MFA tokens from stdin. The function makes no attempt\n// to make atomic prompts from stdin across multiple gorouties.\n//\n// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will\n// have undesirable results as the StdinTokenProvider will not be synchronized. A\n// single Credentials with an AssumeRoleProvider can be shared safely\n//\n// Will wait forever until something is provided on the stdin.\nfunc StdinTokenProvider() (string, error) {\n\tvar v string\n\tfmt.Printf(\"Assume Role MFA token code: \")\n\t_, err := fmt.Scanln(&v)\n\n\treturn v, err\n}\n\n// ProviderName provides a name of AssumeRole provider\nconst ProviderName = \"AssumeRoleProvider\"\n\n// AssumeRoleAPIClient is a client capable of the STS AssumeRole operation.\ntype AssumeRoleAPIClient interface {\n\tAssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)\n}\n\n// DefaultDuration is the default amount of time in minutes that the\n// credentials will be valid for. This value is only used by AssumeRoleProvider\n// for specifying the default expiry duration of an assume role.\n//\n// Other providers such as WebIdentityRoleProvider do not use this value, and\n// instead rely on STS API's default parameter handing to assign a default\n// value.\nvar DefaultDuration = time.Duration(15) * time.Minute\n\n// AssumeRoleProvider retrieves temporary credentials from the STS service, and\n// keeps track of their expiration time.\n//\n// This credential provider will be used by the SDKs default credential change\n// when shared configuration is enabled, and the shared config or shared credentials\n// file configure assume role. See Session docs for how to do this.\n//\n// AssumeRoleProvider does not provide any synchronization and it is not safe\n// to share this value across multiple Credentials, Sessions, or service clients\n// without also sharing the same Credentials instance.\ntype AssumeRoleProvider struct {\n\toptions AssumeRoleOptions\n}\n\n// AssumeRoleOptions is the configurable options for AssumeRoleProvider\ntype AssumeRoleOptions struct {\n\t// Client implementation of the AssumeRole operation. Required\n\tClient AssumeRoleAPIClient\n\n\t// IAM Role ARN to be assumed. Required\n\tRoleARN string\n\n\t// Session name, if you wish to uniquely identify this session.\n\tRoleSessionName string\n\n\t// Expiry duration of the STS credentials. Defaults to 15 minutes if not set.\n\tDuration time.Duration\n\n\t// Optional ExternalID to pass along, defaults to nil if not set.\n\tExternalID *string\n\n\t// The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\tPolicy *string\n\n\t// The ARNs of IAM managed policies you want to use as managed session policies.\n\t// The policies must exist in the same account as the role.\n\t//\n\t// This parameter is optional. You can provide up to 10 managed policy ARNs.\n\t// However, the plain text that you use for both inline and managed session\n\t// policies can't exceed 2,048 characters.\n\t//\n\t// An AWS conversion compresses the passed session policies and session tags\n\t// into a packed binary format that has a separate limit. Your request can fail\n\t// for this limit even if your plain text meets the other requirements. The\n\t// PackedPolicySize response element indicates by percentage how close the policies\n\t// and tags for your request are to the upper size limit.\n\t//\n\t// Passing policies to this operation returns new temporary credentials. The\n\t// resulting session's permissions are the intersection of the role's identity-based\n\t// policy and the session policies. You can use the role's temporary credentials\n\t// in subsequent AWS API calls to access resources in the account that owns\n\t// the role. You cannot use session policies to grant more permissions than\n\t// those allowed by the identity-based policy of the role that is being assumed.\n\t// For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)\n\t// in the IAM User Guide.\n\tPolicyARNs []types.PolicyDescriptorType\n\n\t// The identification number of the MFA device that is associated with the user\n\t// who is making the AssumeRole call. Specify this value if the trust policy\n\t// of the role being assumed includes a condition that requires MFA authentication.\n\t// The value is either the serial number for a hardware device (such as GAHT12345678)\n\t// or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).\n\tSerialNumber *string\n\n\t// The source identity specified by the principal that is calling the AssumeRole\n\t// operation. You can require users to specify a source identity when they assume a\n\t// role. You do this by using the sts:SourceIdentity condition key in a role trust\n\t// policy. You can use source identity information in CloudTrail logs to determine\n\t// who took actions with a role. You can use the aws:SourceIdentity condition key\n\t// to further control access to Amazon Web Services resources based on the value of\n\t// source identity. For more information about using source identity, see Monitor\n\t// and control actions taken with assumed roles\n\t// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)\n\t// in the IAM User Guide.\n\tSourceIdentity *string\n\n\t// Async method of providing MFA token code for assuming an IAM role with MFA.\n\t// The value returned by the function will be used as the TokenCode in the Retrieve\n\t// call. See StdinTokenProvider for a provider that prompts and reads from stdin.\n\t//\n\t// This token provider will be called when ever the assumed role's\n\t// credentials need to be refreshed when SerialNumber is set.\n\tTokenProvider func() (string, error)\n\n\t// A list of session tags that you want to pass. Each session tag consists of a key\n\t// name and an associated value. For more information about session tags, see\n\t// Tagging STS Sessions\n\t// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the\n\t// IAM User Guide. This parameter is optional. You can pass up to 50 session tags.\n\tTags []types.Tag\n\n\t// A list of keys for session tags that you want to set as transitive. If you set a\n\t// tag key as transitive, the corresponding key and value passes to subsequent\n\t// sessions in a role chain. For more information, see Chaining Roles with Session\n\t// Tags\n\t// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)\n\t// in the IAM User Guide. This parameter is optional.\n\tTransitiveTagKeys []string\n}\n\n// NewAssumeRoleProvider constructs and returns a credentials provider that\n// will retrieve credentials by assuming a IAM role using STS.\nfunc NewAssumeRoleProvider(client AssumeRoleAPIClient, roleARN string, optFns ...func(*AssumeRoleOptions)) *AssumeRoleProvider {\n\to := AssumeRoleOptions{\n\t\tClient:  client,\n\t\tRoleARN: roleARN,\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&o)\n\t}\n\n\treturn &AssumeRoleProvider{\n\t\toptions: o,\n\t}\n}\n\n// Retrieve generates a new set of temporary credentials using STS.\nfunc (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\t// Apply defaults where parameters are not set.\n\tif len(p.options.RoleSessionName) == 0 {\n\t\t// Try to work out a role name that will hopefully end up unique.\n\t\tp.options.RoleSessionName = fmt.Sprintf(\"aws-go-sdk-%d\", time.Now().UTC().UnixNano())\n\t}\n\tif p.options.Duration == 0 {\n\t\t// Expire as often as AWS permits.\n\t\tp.options.Duration = DefaultDuration\n\t}\n\tinput := &sts.AssumeRoleInput{\n\t\tDurationSeconds:   aws.Int32(int32(p.options.Duration / time.Second)),\n\t\tPolicyArns:        p.options.PolicyARNs,\n\t\tRoleArn:           aws.String(p.options.RoleARN),\n\t\tRoleSessionName:   aws.String(p.options.RoleSessionName),\n\t\tExternalId:        p.options.ExternalID,\n\t\tSourceIdentity:    p.options.SourceIdentity,\n\t\tTags:              p.options.Tags,\n\t\tTransitiveTagKeys: p.options.TransitiveTagKeys,\n\t}\n\tif p.options.Policy != nil {\n\t\tinput.Policy = p.options.Policy\n\t}\n\tif p.options.SerialNumber != nil {\n\t\tif p.options.TokenProvider != nil {\n\t\t\tinput.SerialNumber = p.options.SerialNumber\n\t\t\tcode, err := p.options.TokenProvider()\n\t\t\tif err != nil {\n\t\t\t\treturn aws.Credentials{}, err\n\t\t\t}\n\t\t\tinput.TokenCode = aws.String(code)\n\t\t} else {\n\t\t\treturn aws.Credentials{}, fmt.Errorf(\"assume role with MFA enabled, but TokenProvider is not set\")\n\t\t}\n\t}\n\n\tresp, err := p.options.Client.AssumeRole(ctx, input)\n\tif err != nil {\n\t\treturn aws.Credentials{Source: ProviderName}, err\n\t}\n\n\tvar accountID string\n\tif resp.AssumedRoleUser != nil {\n\t\taccountID = getAccountID(resp.AssumedRoleUser)\n\t}\n\n\treturn aws.Credentials{\n\t\tAccessKeyID:     *resp.Credentials.AccessKeyId,\n\t\tSecretAccessKey: *resp.Credentials.SecretAccessKey,\n\t\tSessionToken:    *resp.Credentials.SessionToken,\n\t\tSource:          ProviderName,\n\n\t\tCanExpire: true,\n\t\tExpires:   *resp.Credentials.Expiration,\n\t\tAccountID: accountID,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go",
    "content": "package stscreds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n)\n\nvar invalidIdentityTokenExceptionCode = (&types.InvalidIdentityTokenException{}).ErrorCode()\n\nconst (\n\t// WebIdentityProviderName is the web identity provider name\n\tWebIdentityProviderName = \"WebIdentityCredentials\"\n)\n\n// AssumeRoleWithWebIdentityAPIClient is a client capable of the STS AssumeRoleWithWebIdentity operation.\ntype AssumeRoleWithWebIdentityAPIClient interface {\n\tAssumeRoleWithWebIdentity(ctx context.Context, params *sts.AssumeRoleWithWebIdentityInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleWithWebIdentityOutput, error)\n}\n\n// WebIdentityRoleProvider is used to retrieve credentials using\n// an OIDC token.\ntype WebIdentityRoleProvider struct {\n\toptions WebIdentityRoleOptions\n}\n\n// WebIdentityRoleOptions is a structure of configurable options for WebIdentityRoleProvider\ntype WebIdentityRoleOptions struct {\n\t// Client implementation of the AssumeRoleWithWebIdentity operation. Required\n\tClient AssumeRoleWithWebIdentityAPIClient\n\n\t// JWT Token Provider. Required\n\tTokenRetriever IdentityTokenRetriever\n\n\t// IAM Role ARN to assume. Required\n\tRoleARN string\n\n\t// Session name, if you wish to uniquely identify this session.\n\tRoleSessionName string\n\n\t// Expiry duration of the STS credentials. STS will assign a default expiry\n\t// duration if this value is unset. This is different from the Duration\n\t// option of AssumeRoleProvider, which automatically assigns 15 minutes if\n\t// Duration is unset.\n\t//\n\t// See the STS AssumeRoleWithWebIdentity API reference guide for more\n\t// information on defaults.\n\t// https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html\n\tDuration time.Duration\n\n\t// An IAM policy in JSON format that you want to use as an inline session policy.\n\tPolicy *string\n\n\t// The Amazon Resource Names (ARNs) of the IAM managed policies that you\n\t// want to use as managed session policies.  The policies must exist in the\n\t// same account as the role.\n\tPolicyARNs []types.PolicyDescriptorType\n}\n\n// IdentityTokenRetriever is an interface for retrieving a JWT\ntype IdentityTokenRetriever interface {\n\tGetIdentityToken() ([]byte, error)\n}\n\n// IdentityTokenFile is for retrieving an identity token from the given file name\ntype IdentityTokenFile string\n\n// GetIdentityToken retrieves the JWT token from the file and returns the contents as a []byte\nfunc (j IdentityTokenFile) GetIdentityToken() ([]byte, error) {\n\tb, err := ioutil.ReadFile(string(j))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to read file at %s: %v\", string(j), err)\n\t}\n\n\treturn b, nil\n}\n\n// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the\n// provided stsiface.ClientAPI\nfunc NewWebIdentityRoleProvider(client AssumeRoleWithWebIdentityAPIClient, roleARN string, tokenRetriever IdentityTokenRetriever, optFns ...func(*WebIdentityRoleOptions)) *WebIdentityRoleProvider {\n\to := WebIdentityRoleOptions{\n\t\tClient:         client,\n\t\tRoleARN:        roleARN,\n\t\tTokenRetriever: tokenRetriever,\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&o)\n\t}\n\n\treturn &WebIdentityRoleProvider{options: o}\n}\n\n// Retrieve will attempt to assume a role from a token which is located at\n// 'WebIdentityTokenFilePath' specified destination and if that is empty an\n// error will be returned.\nfunc (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) {\n\tb, err := p.options.TokenRetriever.GetIdentityToken()\n\tif err != nil {\n\t\treturn aws.Credentials{}, fmt.Errorf(\"failed to retrieve jwt from provide source, %w\", err)\n\t}\n\n\tsessionName := p.options.RoleSessionName\n\tif len(sessionName) == 0 {\n\t\t// session name is used to uniquely identify a session. This simply\n\t\t// uses unix time in nanoseconds to uniquely identify sessions.\n\t\tsessionName = strconv.FormatInt(sdk.NowTime().UnixNano(), 10)\n\t}\n\tinput := &sts.AssumeRoleWithWebIdentityInput{\n\t\tPolicyArns:       p.options.PolicyARNs,\n\t\tRoleArn:          &p.options.RoleARN,\n\t\tRoleSessionName:  &sessionName,\n\t\tWebIdentityToken: aws.String(string(b)),\n\t}\n\tif p.options.Duration != 0 {\n\t\t// If set use the value, otherwise STS will assign a default expiration duration.\n\t\tinput.DurationSeconds = aws.Int32(int32(p.options.Duration / time.Second))\n\t}\n\tif p.options.Policy != nil {\n\t\tinput.Policy = p.options.Policy\n\t}\n\n\tresp, err := p.options.Client.AssumeRoleWithWebIdentity(ctx, input, func(options *sts.Options) {\n\t\toptions.Retryer = retry.AddWithErrorCodes(options.Retryer, invalidIdentityTokenExceptionCode)\n\t})\n\tif err != nil {\n\t\treturn aws.Credentials{}, fmt.Errorf(\"failed to retrieve credentials, %w\", err)\n\t}\n\n\tvar accountID string\n\tif resp.AssumedRoleUser != nil {\n\t\taccountID = getAccountID(resp.AssumedRoleUser)\n\t}\n\n\t// InvalidIdentityToken error is a temporary error that can occur\n\t// when assuming an Role with a JWT web identity token.\n\n\tvalue := aws.Credentials{\n\t\tAccessKeyID:     aws.ToString(resp.Credentials.AccessKeyId),\n\t\tSecretAccessKey: aws.ToString(resp.Credentials.SecretAccessKey),\n\t\tSessionToken:    aws.ToString(resp.Credentials.SessionToken),\n\t\tSource:          WebIdentityProviderName,\n\t\tCanExpire:       true,\n\t\tExpires:         *resp.Credentials.Expiration,\n\t\tAccountID:       accountID,\n\t}\n\treturn value, nil\n}\n\n// extract accountID from arn with format \"arn:partition:service:region:account-id:[resource-section]\"\nfunc getAccountID(u *types.AssumedRoleUser) string {\n\tif u.Arn == nil {\n\t\treturn \"\"\n\t}\n\tparts := strings.Split(*u.Arn, \":\")\n\tif len(parts) < 5 {\n\t\treturn \"\"\n\t}\n\treturn parts[4]\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md",
    "content": "# v1.16.11 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.10 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.9 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.8 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.7 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.6 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.5 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.4 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.3 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.2 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.1 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2024-03-21)\n\n* **Feature**: Add config switch `DisableDefaultTimeout` that allows you to disable the default operation timeout (5 seconds) for IMDS calls.\n\n# v1.15.4 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.3 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.2 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.1 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.11 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.10 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.9 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.8 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.7 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.6 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.5 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.4 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.3 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.2 (2023-11-02)\n\n* No change notes available for this release.\n\n# v1.14.1 (2023-11-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.13 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.12 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.11 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.10 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.9 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.8 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.7 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.6 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.5 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.4 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.3 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.2 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2023-03-14)\n\n* **Feature**: Add flag to disable IMDSv1 fallback\n\n# v1.12.24 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.23 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.22 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.21 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.20 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.19 (2022-10-24)\n\n* **Bug Fix**: Fixes an issue that prevented logging of the API request or responses when the respective log modes were enabled.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.18 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.17 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.16 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.15 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.14 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.13 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.12 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.11 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.10 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.9 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.6 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2022-02-24)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.2 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-11-06)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-10-11)\n\n* **Feature**: Respect passed in Context Deadline/Timeout. Updates the IMDS Client operations to not override the passed in Context's Deadline or Timeout options. If an Client operation is called with a Context with a Deadline or Timeout, the client will no longer override it with the client's default timeout.\n* **Bug Fix**: Fix IMDS client's response handling and operation timeout race. Fixes #1253\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-08-04)\n\n* **Feature**: adds error handling for defered close calls\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-07-15)\n\n* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints.\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalconfig \"github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config\"\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ServiceID provides the unique name of this API client\nconst ServiceID = \"ec2imds\"\n\n// Client provides the API client for interacting with the Amazon EC2 Instance\n// Metadata Service API.\ntype Client struct {\n\toptions Options\n}\n\n// ClientEnableState provides an enumeration if the client is enabled,\n// disabled, or default behavior.\ntype ClientEnableState = internalconfig.ClientEnableState\n\n// Enumeration values for ClientEnableState\nconst (\n\tClientDefaultEnableState ClientEnableState = internalconfig.ClientDefaultEnableState // default behavior\n\tClientDisabled           ClientEnableState = internalconfig.ClientDisabled           // client disabled\n\tClientEnabled            ClientEnableState = internalconfig.ClientEnabled            // client enabled\n)\n\n// EndpointModeState is an enum configuration variable describing the client endpoint mode.\n// Not configurable directly, but used when using the NewFromConfig.\ntype EndpointModeState = internalconfig.EndpointModeState\n\n// Enumeration values for EndpointModeState\nconst (\n\tEndpointModeStateUnset EndpointModeState = internalconfig.EndpointModeStateUnset\n\tEndpointModeStateIPv4  EndpointModeState = internalconfig.EndpointModeStateIPv4\n\tEndpointModeStateIPv6  EndpointModeState = internalconfig.EndpointModeStateIPv6\n)\n\nconst (\n\tdisableClientEnvVar = \"AWS_EC2_METADATA_DISABLED\"\n\n\t// Client endpoint options\n\tendpointEnvVar = \"AWS_EC2_METADATA_SERVICE_ENDPOINT\"\n\n\tdefaultIPv4Endpoint = \"http://169.254.169.254\"\n\tdefaultIPv6Endpoint = \"http://[fd00:ec2::254]\"\n)\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\toptions.HTTPClient = resolveHTTPClient(options.HTTPClient)\n\n\tif options.Retryer == nil {\n\t\toptions.Retryer = retry.NewStandard()\n\t}\n\toptions.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second)\n\n\tif options.ClientEnableState == ClientDefaultEnableState {\n\t\tif v := os.Getenv(disableClientEnvVar); strings.EqualFold(v, \"true\") {\n\t\t\toptions.ClientEnableState = ClientDisabled\n\t\t}\n\t}\n\n\tif len(options.Endpoint) == 0 {\n\t\tif v := os.Getenv(endpointEnvVar); len(v) != 0 {\n\t\t\toptions.Endpoint = v\n\t\t}\n\t}\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\tif client.options.tokenProvider == nil && !client.options.disableAPIToken {\n\t\tclient.options.tokenProvider = newTokenProvider(client, defaultTokenTTL)\n\t}\n\n\treturn client\n}\n\n// NewFromConfig returns an initialized Client based the AWS SDK config, and\n// functional options. Provide additional functional options to further\n// configure the behavior of the client, such as changing the client's endpoint\n// or adding custom middleware behavior.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tAPIOptions:    append([]func(*middleware.Stack) error{}, cfg.APIOptions...),\n\t\tHTTPClient:    cfg.HTTPClient,\n\t\tClientLogMode: cfg.ClientLogMode,\n\t\tLogger:        cfg.Logger,\n\t}\n\n\tif cfg.Retryer != nil {\n\t\topts.Retryer = cfg.Retryer()\n\t}\n\n\tresolveClientEnableState(cfg, &opts)\n\tresolveEndpointConfig(cfg, &opts)\n\tresolveEndpointModeConfig(cfg, &opts)\n\tresolveEnableFallback(cfg, &opts)\n\n\treturn New(opts, optFns...)\n}\n\n// Options provides the fields for configuring the API client's behavior.\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation\n\t// call to modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// The endpoint the client will use to retrieve EC2 instance metadata.\n\t//\n\t// Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EndpointMode.\n\t//\n\t// If unset, and the environment variable AWS_EC2_METADATA_SERVICE_ENDPOINT\n\t// has a value the client will use the value of the environment variable as\n\t// the endpoint for operation calls.\n\t//\n\t//    AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1]\n\tEndpoint string\n\n\t// The endpoint selection mode the client will use if no explicit endpoint is provided using the Endpoint field.\n\t//\n\t// Setting EndpointMode to EndpointModeStateIPv4 will configure the client to use the default EC2 IPv4 endpoint.\n\t// Setting EndpointMode to EndpointModeStateIPv6 will configure the client to use the default EC2 IPv6 endpoint.\n\t//\n\t// By default if EndpointMode is not set (EndpointModeStateUnset) than the default endpoint selection mode EndpointModeStateIPv4.\n\tEndpointMode EndpointModeState\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default\n\t// HTTP implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer.\n\tRetryer aws.Retryer\n\n\t// Changes if the EC2 Instance Metadata client is enabled or not. Client\n\t// will default to enabled if not set to ClientDisabled. When the client is\n\t// disabled it will return an error for all operation calls.\n\t//\n\t// If ClientEnableState value is ClientDefaultEnableState (default value),\n\t// and the environment variable \"AWS_EC2_METADATA_DISABLED\" is set to\n\t// \"true\", the client will be disabled.\n\t//\n\t//    AWS_EC2_METADATA_DISABLED=true\n\tClientEnableState ClientEnableState\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// Configure IMDSv1 fallback behavior. By default, the client will attempt\n\t// to fall back to IMDSv1 as needed for backwards compatibility. When set to [aws.FalseTernary]\n\t// the client will return any errors encountered from attempting to fetch a token\n\t// instead of silently using the insecure data flow of IMDSv1.\n\t//\n\t// See [configuring IMDS] for more information.\n\t//\n\t// [configuring IMDS]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html\n\tEnableFallback aws.Ternary\n\n\t// By default, all IMDS client operations enforce a 5-second timeout. You\n\t// can disable that behavior with this setting.\n\tDisableDefaultTimeout bool\n\n\t// provides the caching of API tokens used for operation calls. If unset,\n\t// the API token will not be retrieved for the operation.\n\ttokenProvider *tokenProvider\n\n\t// option to disable the API token provider for testing.\n\tdisableAPIToken bool\n}\n\n// HTTPClient provides the interface for a client making HTTP requests with the\n// API.\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// Copy creates a copy of the API options.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = append([]func(*middleware.Stack) error{}, o.APIOptions...)\n\treturn to\n}\n\n// WithAPIOptions wraps the API middleware functions, as a functional option\n// for the API Client Options. Use this helper to add additional functional\n// options to the API client, or operation calls.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\nfunc (c *Client) invokeOperation(\n\tctx context.Context, opID string, params interface{}, optFns []func(*Options),\n\tstackFns ...func(*middleware.Stack, Options) error,\n) (\n\tresult interface{}, metadata middleware.Metadata, err error,\n) {\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.ClientEnableState == ClientDisabled {\n\t\treturn nil, metadata, &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr: fmt.Errorf(\n\t\t\t\t\"access disabled to EC2 IMDS via client option, or %q environment variable\",\n\t\t\t\tdisableClientEnvVar),\n\t\t}\n\t}\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\treturn nil, metadata, &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\n\treturn result, metadata, err\n}\n\nconst (\n\t// HTTP client constants\n\tdefaultDialerTimeout         = 250 * time.Millisecond\n\tdefaultResponseHeaderTimeout = 500 * time.Millisecond\n)\n\nfunc resolveHTTPClient(client HTTPClient) HTTPClient {\n\tif client == nil {\n\t\tclient = awshttp.NewBuildableClient()\n\t}\n\n\tif c, ok := client.(*awshttp.BuildableClient); ok {\n\t\tclient = c.\n\t\t\tWithDialerOptions(func(d *net.Dialer) {\n\t\t\t\t// Use a custom Dial timeout for the EC2 Metadata service to account\n\t\t\t\t// for the possibility the application might not be running in an\n\t\t\t\t// environment with the service present. The client should fail fast in\n\t\t\t\t// this case.\n\t\t\t\td.Timeout = defaultDialerTimeout\n\t\t\t}).\n\t\t\tWithTransportOptions(func(tr *http.Transport) {\n\t\t\t\t// Use a custom Transport timeout for the EC2 Metadata service to\n\t\t\t\t// account for the possibility that the application might be running in\n\t\t\t\t// a container, and EC2Metadata service drops the connection after a\n\t\t\t\t// single IP Hop. The client should fail fast in this case.\n\t\t\t\ttr.ResponseHeaderTimeout = defaultResponseHeaderTimeout\n\t\t\t})\n\t}\n\n\treturn client\n}\n\nfunc resolveClientEnableState(cfg aws.Config, options *Options) error {\n\tif options.ClientEnableState != ClientDefaultEnableState {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalconfig.ResolveClientEnableState(cfg.ConfigSources)\n\tif err != nil || !found {\n\t\treturn err\n\t}\n\toptions.ClientEnableState = value\n\treturn nil\n}\n\nfunc resolveEndpointModeConfig(cfg aws.Config, options *Options) error {\n\tif options.EndpointMode != EndpointModeStateUnset {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalconfig.ResolveEndpointModeConfig(cfg.ConfigSources)\n\tif err != nil || !found {\n\t\treturn err\n\t}\n\toptions.EndpointMode = value\n\treturn nil\n}\n\nfunc resolveEndpointConfig(cfg aws.Config, options *Options) error {\n\tif len(options.Endpoint) != 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalconfig.ResolveEndpointConfig(cfg.ConfigSources)\n\tif err != nil || !found {\n\t\treturn err\n\t}\n\toptions.Endpoint = value\n\treturn nil\n}\n\nfunc resolveEnableFallback(cfg aws.Config, options *Options) {\n\tif options.EnableFallback != aws.UnknownTernary {\n\t\treturn\n\t}\n\n\tdisabled, ok := internalconfig.ResolveV1FallbackDisabled(cfg.ConfigSources)\n\tif !ok {\n\t\treturn\n\t}\n\n\tif disabled {\n\t\toptions.EnableFallback = aws.FalseTernary\n\t} else {\n\t\toptions.EnableFallback = aws.TrueTernary\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getDynamicDataPath = \"/latest/dynamic\"\n\n// GetDynamicData uses the path provided to request information from the EC2\n// instance metadata service for dynamic data. The content will be returned\n// as a string, or error if the request failed.\nfunc (c *Client) GetDynamicData(ctx context.Context, params *GetDynamicDataInput, optFns ...func(*Options)) (*GetDynamicDataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDynamicDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDynamicData\", params, optFns,\n\t\taddGetDynamicDataMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDynamicDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetDynamicDataInput provides the input parameters for the GetDynamicData\n// operation.\ntype GetDynamicDataInput struct {\n\t// The relative dynamic data path to retrieve. Can be empty string to\n\t// retrieve a response containing a new line separated list of dynamic data\n\t// resources available.\n\t//\n\t// Must not include the dynamic data base path.\n\t//\n\t// May include leading slash. If Path includes trailing slash the trailing\n\t// slash will be included in the request for the resource.\n\tPath string\n}\n\n// GetDynamicDataOutput provides the output parameters for the GetDynamicData\n// operation.\ntype GetDynamicDataOutput struct {\n\tContent io.ReadCloser\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetDynamicDataMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetDynamicData\",\n\t\tbuildGetDynamicDataPath,\n\t\tbuildGetDynamicDataOutput)\n}\n\nfunc buildGetDynamicDataPath(params interface{}) (string, error) {\n\tp, ok := params.(*GetDynamicDataInput)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unknown parameter type %T\", params)\n\t}\n\n\treturn appendURIPath(getDynamicDataPath, p.Path), nil\n}\n\nfunc buildGetDynamicDataOutput(resp *smithyhttp.Response) (interface{}, error) {\n\treturn &GetDynamicDataOutput{\n\t\tContent: resp.Body,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getIAMInfoPath = getMetadataPath + \"/iam/info\"\n\n// GetIAMInfo retrieves an identity document describing an\n// instance. Error is returned if the request fails or is unable to parse\n// the response.\nfunc (c *Client) GetIAMInfo(\n\tctx context.Context, params *GetIAMInfoInput, optFns ...func(*Options),\n) (\n\t*GetIAMInfoOutput, error,\n) {\n\tif params == nil {\n\t\tparams = &GetIAMInfoInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetIAMInfo\", params, optFns,\n\t\taddGetIAMInfoMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetIAMInfoOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetIAMInfoInput provides the input parameters for GetIAMInfo operation.\ntype GetIAMInfoInput struct{}\n\n// GetIAMInfoOutput provides the output parameters for GetIAMInfo operation.\ntype GetIAMInfoOutput struct {\n\tIAMInfo\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetIAMInfoMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetIAMInfo\",\n\t\tbuildGetIAMInfoPath,\n\t\tbuildGetIAMInfoOutput,\n\t)\n}\n\nfunc buildGetIAMInfoPath(params interface{}) (string, error) {\n\treturn getIAMInfoPath, nil\n}\n\nfunc buildGetIAMInfoOutput(resp *smithyhttp.Response) (v interface{}, err error) {\n\tdefer func() {\n\t\tcloseErr := resp.Body.Close()\n\t\tif err == nil {\n\t\t\terr = closeErr\n\t\t} else if closeErr != nil {\n\t\t\terr = fmt.Errorf(\"response body close error: %v, original error: %w\", closeErr, err)\n\t\t}\n\t}()\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(resp.Body, ringBuffer)\n\n\timdsResult := &GetIAMInfoOutput{}\n\tif err = json.NewDecoder(body).Decode(&imdsResult.IAMInfo); err != nil {\n\t\treturn nil, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode instance identity document, %w\", err),\n\t\t\tSnapshot: ringBuffer.Bytes(),\n\t\t}\n\t}\n\t// Any code other success is an error\n\tif !strings.EqualFold(imdsResult.Code, \"success\") {\n\t\treturn nil, fmt.Errorf(\"failed to get EC2 IMDS IAM info, %s\",\n\t\t\timdsResult.Code)\n\t}\n\n\treturn imdsResult, nil\n}\n\n// IAMInfo provides the shape for unmarshaling an IAM info from the metadata\n// API.\ntype IAMInfo struct {\n\tCode               string\n\tLastUpdated        time.Time\n\tInstanceProfileArn string\n\tInstanceProfileID  string\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getInstanceIdentityDocumentPath = getDynamicDataPath + \"/instance-identity/document\"\n\n// GetInstanceIdentityDocument retrieves an identity document describing an\n// instance. Error is returned if the request fails or is unable to parse\n// the response.\nfunc (c *Client) GetInstanceIdentityDocument(\n\tctx context.Context, params *GetInstanceIdentityDocumentInput, optFns ...func(*Options),\n) (\n\t*GetInstanceIdentityDocumentOutput, error,\n) {\n\tif params == nil {\n\t\tparams = &GetInstanceIdentityDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetInstanceIdentityDocument\", params, optFns,\n\t\taddGetInstanceIdentityDocumentMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetInstanceIdentityDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetInstanceIdentityDocumentInput provides the input parameters for\n// GetInstanceIdentityDocument operation.\ntype GetInstanceIdentityDocumentInput struct{}\n\n// GetInstanceIdentityDocumentOutput provides the output parameters for\n// GetInstanceIdentityDocument operation.\ntype GetInstanceIdentityDocumentOutput struct {\n\tInstanceIdentityDocument\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetInstanceIdentityDocumentMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetInstanceIdentityDocument\",\n\t\tbuildGetInstanceIdentityDocumentPath,\n\t\tbuildGetInstanceIdentityDocumentOutput,\n\t)\n}\n\nfunc buildGetInstanceIdentityDocumentPath(params interface{}) (string, error) {\n\treturn getInstanceIdentityDocumentPath, nil\n}\n\nfunc buildGetInstanceIdentityDocumentOutput(resp *smithyhttp.Response) (v interface{}, err error) {\n\tdefer func() {\n\t\tcloseErr := resp.Body.Close()\n\t\tif err == nil {\n\t\t\terr = closeErr\n\t\t} else if closeErr != nil {\n\t\t\terr = fmt.Errorf(\"response body close error: %v, original error: %w\", closeErr, err)\n\t\t}\n\t}()\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(resp.Body, ringBuffer)\n\n\toutput := &GetInstanceIdentityDocumentOutput{}\n\tif err = json.NewDecoder(body).Decode(&output.InstanceIdentityDocument); err != nil {\n\t\treturn nil, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode instance identity document, %w\", err),\n\t\t\tSnapshot: ringBuffer.Bytes(),\n\t\t}\n\t}\n\n\treturn output, nil\n}\n\n// InstanceIdentityDocument provides the shape for unmarshaling\n// an instance identity document\ntype InstanceIdentityDocument struct {\n\tDevpayProductCodes      []string  `json:\"devpayProductCodes\"`\n\tMarketplaceProductCodes []string  `json:\"marketplaceProductCodes\"`\n\tAvailabilityZone        string    `json:\"availabilityZone\"`\n\tPrivateIP               string    `json:\"privateIp\"`\n\tVersion                 string    `json:\"version\"`\n\tRegion                  string    `json:\"region\"`\n\tInstanceID              string    `json:\"instanceId\"`\n\tBillingProducts         []string  `json:\"billingProducts\"`\n\tInstanceType            string    `json:\"instanceType\"`\n\tAccountID               string    `json:\"accountId\"`\n\tPendingTime             time.Time `json:\"pendingTime\"`\n\tImageID                 string    `json:\"imageId\"`\n\tKernelID                string    `json:\"kernelId\"`\n\tRamdiskID               string    `json:\"ramdiskId\"`\n\tArchitecture            string    `json:\"architecture\"`\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getMetadataPath = \"/latest/meta-data\"\n\n// GetMetadata uses the path provided to request information from the Amazon\n// EC2 Instance Metadata Service. The content will be returned as a string, or\n// error if the request failed.\nfunc (c *Client) GetMetadata(ctx context.Context, params *GetMetadataInput, optFns ...func(*Options)) (*GetMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMetadata\", params, optFns,\n\t\taddGetMetadataMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetMetadataInput provides the input parameters for the GetMetadata\n// operation.\ntype GetMetadataInput struct {\n\t// The relative metadata path to retrieve. Can be empty string to retrieve\n\t// a response containing a new line separated list of metadata resources\n\t// available.\n\t//\n\t// Must not include the metadata base path.\n\t//\n\t// May include leading slash. If Path includes trailing slash the trailing slash\n\t// will be included in the request for the resource.\n\tPath string\n}\n\n// GetMetadataOutput provides the output parameters for the GetMetadata\n// operation.\ntype GetMetadataOutput struct {\n\tContent io.ReadCloser\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetMetadataMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetMetadata\",\n\t\tbuildGetMetadataPath,\n\t\tbuildGetMetadataOutput)\n}\n\nfunc buildGetMetadataPath(params interface{}) (string, error) {\n\tp, ok := params.(*GetMetadataInput)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unknown parameter type %T\", params)\n\t}\n\n\treturn appendURIPath(getMetadataPath, p.Path), nil\n}\n\nfunc buildGetMetadataOutput(resp *smithyhttp.Response) (interface{}, error) {\n\treturn &GetMetadataOutput{\n\t\tContent: resp.Body,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// GetRegion retrieves an identity document describing an\n// instance. Error is returned if the request fails or is unable to parse\n// the response.\nfunc (c *Client) GetRegion(\n\tctx context.Context, params *GetRegionInput, optFns ...func(*Options),\n) (\n\t*GetRegionOutput, error,\n) {\n\tif params == nil {\n\t\tparams = &GetRegionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRegion\", params, optFns,\n\t\taddGetRegionMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRegionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetRegionInput provides the input parameters for GetRegion operation.\ntype GetRegionInput struct{}\n\n// GetRegionOutput provides the output parameters for GetRegion operation.\ntype GetRegionOutput struct {\n\tRegion string\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetRegionMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetRegion\",\n\t\tbuildGetInstanceIdentityDocumentPath,\n\t\tbuildGetRegionOutput,\n\t)\n}\n\nfunc buildGetRegionOutput(resp *smithyhttp.Response) (interface{}, error) {\n\tout, err := buildGetInstanceIdentityDocumentOutput(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult, ok := out.(*GetInstanceIdentityDocumentOutput)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unexpected instance identity document type, %T\", out)\n\t}\n\n\tregion := result.Region\n\tif len(region) == 0 {\n\t\treturn \"\", fmt.Errorf(\"instance metadata did not return a region value\")\n\t}\n\n\treturn &GetRegionOutput{\n\t\tRegion: region,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getTokenPath = \"/latest/api/token\"\nconst tokenTTLHeader = \"X-Aws-Ec2-Metadata-Token-Ttl-Seconds\"\n\n// getToken uses the duration to return a token for EC2 IMDS, or an error if\n// the request failed.\nfunc (c *Client) getToken(ctx context.Context, params *getTokenInput, optFns ...func(*Options)) (*getTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &getTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"getToken\", params, optFns,\n\t\taddGetTokenMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*getTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype getTokenInput struct {\n\tTokenTTL time.Duration\n}\n\ntype getTokenOutput struct {\n\tToken    string\n\tTokenTTL time.Duration\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetTokenMiddleware(stack *middleware.Stack, options Options) error {\n\terr := addRequestMiddleware(stack,\n\t\toptions,\n\t\t\"PUT\",\n\t\t\"GetToken\",\n\t\tbuildGetTokenPath,\n\t\tbuildGetTokenOutput)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = stack.Serialize.Add(&tokenTTLRequestHeader{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc buildGetTokenPath(interface{}) (string, error) {\n\treturn getTokenPath, nil\n}\n\nfunc buildGetTokenOutput(resp *smithyhttp.Response) (v interface{}, err error) {\n\tdefer func() {\n\t\tcloseErr := resp.Body.Close()\n\t\tif err == nil {\n\t\t\terr = closeErr\n\t\t} else if closeErr != nil {\n\t\t\terr = fmt.Errorf(\"response body close error: %v, original error: %w\", closeErr, err)\n\t\t}\n\t}()\n\n\tttlHeader := resp.Header.Get(tokenTTLHeader)\n\ttokenTTL, err := strconv.ParseInt(ttlHeader, 10, 64)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse API token, %w\", err)\n\t}\n\n\tvar token strings.Builder\n\tif _, err = io.Copy(&token, resp.Body); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to read API token, %w\", err)\n\t}\n\n\treturn &getTokenOutput{\n\t\tToken:    token.String(),\n\t\tTokenTTL: time.Duration(tokenTTL) * time.Second,\n\t}, nil\n}\n\ntype tokenTTLRequestHeader struct{}\n\nfunc (*tokenTTLRequestHeader) ID() string { return \"tokenTTLRequestHeader\" }\nfunc (*tokenTTLRequestHeader) HandleSerialize(\n\tctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expect HTTP transport, got %T\", in.Request)\n\t}\n\n\tinput, ok := in.Parameters.(*getTokenInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expect getTokenInput, got %T\", in.Parameters)\n\t}\n\n\treq.Header.Set(tokenTTLHeader, strconv.Itoa(int(input.TokenTTL/time.Second)))\n\n\treturn next.HandleSerialize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst getUserDataPath = \"/latest/user-data\"\n\n// GetUserData uses the path provided to request information from the EC2\n// instance metadata service for dynamic data. The content will be returned\n// as a string, or error if the request failed.\nfunc (c *Client) GetUserData(ctx context.Context, params *GetUserDataInput, optFns ...func(*Options)) (*GetUserDataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetUserDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetUserData\", params, optFns,\n\t\taddGetUserDataMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetUserDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// GetUserDataInput provides the input parameters for the GetUserData\n// operation.\ntype GetUserDataInput struct{}\n\n// GetUserDataOutput provides the output parameters for the GetUserData\n// operation.\ntype GetUserDataOutput struct {\n\tContent io.ReadCloser\n\n\tResultMetadata middleware.Metadata\n}\n\nfunc addGetUserDataMiddleware(stack *middleware.Stack, options Options) error {\n\treturn addAPIRequestMiddleware(stack,\n\t\toptions,\n\t\t\"GetUserData\",\n\t\tbuildGetUserDataPath,\n\t\tbuildGetUserDataOutput)\n}\n\nfunc buildGetUserDataPath(params interface{}) (string, error) {\n\treturn getUserDataPath, nil\n}\n\nfunc buildGetUserDataOutput(resp *smithyhttp.Response) (interface{}, error) {\n\treturn &GetUserDataOutput{\n\t\tContent: resp.Body,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go",
    "content": "// Package imds provides the API client for interacting with the Amazon EC2\n// Instance Metadata Service.\n//\n// All Client operation calls have a default timeout. If the operation is not\n// completed before this timeout expires, the operation will be canceled. This\n// timeout can be overridden through the following:\n//   - Set the options flag DisableDefaultTimeout\n//   - Provide a Context with a timeout or deadline with calling the client's operations.\n//\n// See the EC2 IMDS user guide for more information on using the API.\n// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html\npackage imds\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage imds\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.16.11\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go",
    "content": "package config\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// ClientEnableState provides an enumeration if the client is enabled,\n// disabled, or default behavior.\ntype ClientEnableState uint\n\n// Enumeration values for ClientEnableState\nconst (\n\tClientDefaultEnableState ClientEnableState = iota\n\tClientDisabled\n\tClientEnabled\n)\n\n// EndpointModeState is the EC2 IMDS Endpoint Configuration Mode\ntype EndpointModeState uint\n\n// Enumeration values for ClientEnableState\nconst (\n\tEndpointModeStateUnset EndpointModeState = iota\n\tEndpointModeStateIPv4\n\tEndpointModeStateIPv6\n)\n\n// SetFromString sets the EndpointModeState based on the provided string value. Unknown values will default to EndpointModeStateUnset\nfunc (e *EndpointModeState) SetFromString(v string) error {\n\tv = strings.TrimSpace(v)\n\n\tswitch {\n\tcase len(v) == 0:\n\t\t*e = EndpointModeStateUnset\n\tcase strings.EqualFold(v, \"IPv6\"):\n\t\t*e = EndpointModeStateIPv6\n\tcase strings.EqualFold(v, \"IPv4\"):\n\t\t*e = EndpointModeStateIPv4\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown EC2 IMDS endpoint mode, must be either IPv6 or IPv4\")\n\t}\n\treturn nil\n}\n\n// ClientEnableStateResolver is a config resolver interface for retrieving whether the IMDS client is disabled.\ntype ClientEnableStateResolver interface {\n\tGetEC2IMDSClientEnableState() (ClientEnableState, bool, error)\n}\n\n// EndpointModeResolver is a config resolver interface for retrieving the EndpointModeState configuration.\ntype EndpointModeResolver interface {\n\tGetEC2IMDSEndpointMode() (EndpointModeState, bool, error)\n}\n\n// EndpointResolver is a config resolver interface for retrieving the endpoint.\ntype EndpointResolver interface {\n\tGetEC2IMDSEndpoint() (string, bool, error)\n}\n\ntype v1FallbackDisabledResolver interface {\n\tGetEC2IMDSV1FallbackDisabled() (bool, bool)\n}\n\n// ResolveClientEnableState resolves the ClientEnableState from a list of configuration sources.\nfunc ResolveClientEnableState(sources []interface{}) (value ClientEnableState, found bool, err error) {\n\tfor _, source := range sources {\n\t\tif resolver, ok := source.(ClientEnableStateResolver); ok {\n\t\t\tvalue, found, err = resolver.GetEC2IMDSClientEnableState()\n\t\t\tif err != nil || found {\n\t\t\t\treturn value, found, err\n\t\t\t}\n\t\t}\n\t}\n\treturn value, found, err\n}\n\n// ResolveEndpointModeConfig resolves the EndpointModeState from a list of configuration sources.\nfunc ResolveEndpointModeConfig(sources []interface{}) (value EndpointModeState, found bool, err error) {\n\tfor _, source := range sources {\n\t\tif resolver, ok := source.(EndpointModeResolver); ok {\n\t\t\tvalue, found, err = resolver.GetEC2IMDSEndpointMode()\n\t\t\tif err != nil || found {\n\t\t\t\treturn value, found, err\n\t\t\t}\n\t\t}\n\t}\n\treturn value, found, err\n}\n\n// ResolveEndpointConfig resolves the endpoint from a list of configuration sources.\nfunc ResolveEndpointConfig(sources []interface{}) (value string, found bool, err error) {\n\tfor _, source := range sources {\n\t\tif resolver, ok := source.(EndpointResolver); ok {\n\t\t\tvalue, found, err = resolver.GetEC2IMDSEndpoint()\n\t\t\tif err != nil || found {\n\t\t\t\treturn value, found, err\n\t\t\t}\n\t\t}\n\t}\n\treturn value, found, err\n}\n\n// ResolveV1FallbackDisabled ...\nfunc ResolveV1FallbackDisabled(sources []interface{}) (bool, bool) {\n\tfor _, source := range sources {\n\t\tif resolver, ok := source.(v1FallbackDisabledResolver); ok {\n\t\t\tif v, found := resolver.GetEC2IMDSV1FallbackDisabled(); found {\n\t\t\t\treturn v, true\n\t\t\t}\n\t\t}\n\t}\n\treturn false, false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go",
    "content": "package imds\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/url\"\n\t\"path\"\n\t\"time\"\n\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nfunc addAPIRequestMiddleware(stack *middleware.Stack,\n\toptions Options,\n\toperation string,\n\tgetPath func(interface{}) (string, error),\n\tgetOutput func(*smithyhttp.Response) (interface{}, error),\n) (err error) {\n\terr = addRequestMiddleware(stack, options, \"GET\", operation, getPath, getOutput)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Token Serializer build and state management.\n\tif !options.disableAPIToken {\n\t\terr = stack.Finalize.Insert(options.tokenProvider, (*retry.Attempt)(nil).ID(), middleware.After)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = stack.Deserialize.Insert(options.tokenProvider, \"OperationDeserializer\", middleware.Before)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc addRequestMiddleware(stack *middleware.Stack,\n\toptions Options,\n\tmethod string,\n\toperation string,\n\tgetPath func(interface{}) (string, error),\n\tgetOutput func(*smithyhttp.Response) (interface{}, error),\n) (err error) {\n\terr = awsmiddleware.AddSDKAgentKey(awsmiddleware.FeatureMetadata, \"ec2-imds\")(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Operation timeout\n\terr = stack.Initialize.Add(&operationTimeout{\n\t\tDisabled:       options.DisableDefaultTimeout,\n\t\tDefaultTimeout: defaultOperationTimeout,\n\t}, middleware.Before)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Operation Serializer\n\terr = stack.Serialize.Add(&serializeRequest{\n\t\tGetPath: getPath,\n\t\tMethod:  method,\n\t}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Operation endpoint resolver\n\terr = stack.Serialize.Insert(&resolveEndpoint{\n\t\tEndpoint:     options.Endpoint,\n\t\tEndpointMode: options.EndpointMode,\n\t}, \"OperationSerializer\", middleware.Before)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Operation Deserializer\n\terr = stack.Deserialize.Add(&deserializeResponse{\n\t\tGetOutput: getOutput,\n\t}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          options.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  options.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         options.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: options.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = addSetLoggerMiddleware(stack, options)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %w\", err)\n\t}\n\n\t// Retry support\n\treturn retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{\n\t\tRetryer:          options.Retryer,\n\t\tLogRetryAttempts: options.ClientLogMode.IsRetries(),\n\t})\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\ntype serializeRequest struct {\n\tGetPath func(interface{}) (string, error)\n\tMethod  string\n}\n\nfunc (*serializeRequest) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *serializeRequest) HandleSerialize(\n\tctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\treqPath, err := m.GetPath(in.Parameters)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"unable to get request URL path, %w\", err)\n\t}\n\n\trequest.Request.URL.Path = reqPath\n\trequest.Request.Method = m.Method\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype deserializeResponse struct {\n\tGetOutput func(*smithyhttp.Response) (interface{}, error)\n}\n\nfunc (*deserializeResponse) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *deserializeResponse) HandleDeserialize(\n\tctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresp, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\"unexpected transport response type, %T, want %T\", out.RawResponse, resp)\n\t}\n\tdefer resp.Body.Close()\n\n\t// read the full body so that any operation timeouts cleanup will not race\n\t// the body being read.\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"read response body failed, %w\", err)\n\t}\n\tresp.Body = ioutil.NopCloser(bytes.NewReader(body))\n\n\t// Anything that's not 200 |< 300 is error\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\treturn out, metadata, &smithyhttp.ResponseError{\n\t\t\tResponse: resp,\n\t\t\tErr:      fmt.Errorf(\"request to EC2 IMDS failed\"),\n\t\t}\n\t}\n\n\tresult, err := m.GetOutput(resp)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\"unable to get deserialized result for response, %w\", err,\n\t\t)\n\t}\n\tout.Result = result\n\n\treturn out, metadata, err\n}\n\ntype resolveEndpoint struct {\n\tEndpoint     string\n\tEndpointMode EndpointModeState\n}\n\nfunc (*resolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *resolveEndpoint) HandleSerialize(\n\tctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tvar endpoint string\n\tif len(m.Endpoint) > 0 {\n\t\tendpoint = m.Endpoint\n\t} else {\n\t\tswitch m.EndpointMode {\n\t\tcase EndpointModeStateIPv6:\n\t\t\tendpoint = defaultIPv6Endpoint\n\t\tcase EndpointModeStateIPv4:\n\t\t\tfallthrough\n\t\tcase EndpointModeStateUnset:\n\t\t\tendpoint = defaultIPv4Endpoint\n\t\tdefault:\n\t\t\treturn out, metadata, fmt.Errorf(\"unsupported IMDS endpoint mode\")\n\t\t}\n\t}\n\n\treq.URL, err = url.Parse(endpoint)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\nconst (\n\tdefaultOperationTimeout = 5 * time.Second\n)\n\n// operationTimeout adds a timeout on the middleware stack if the Context the\n// stack was called with does not have a deadline. The next middleware must\n// complete before the timeout, or the context will be canceled.\n//\n// If DefaultTimeout is zero, no default timeout will be used if the Context\n// does not have a timeout.\n//\n// The next middleware must also ensure that any resources that are also\n// canceled by the stack's context are completely consumed before returning.\n// Otherwise the timeout cleanup will race the resource being consumed\n// upstream.\ntype operationTimeout struct {\n\tDisabled       bool\n\tDefaultTimeout time.Duration\n}\n\nfunc (*operationTimeout) ID() string { return \"OperationTimeout\" }\n\nfunc (m *operationTimeout) HandleInitialize(\n\tctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler,\n) (\n\toutput middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.Disabled {\n\t\treturn next.HandleInitialize(ctx, input)\n\t}\n\n\tif _, ok := ctx.Deadline(); !ok && m.DefaultTimeout != 0 {\n\t\tvar cancelFn func()\n\t\tctx, cancelFn = context.WithTimeout(ctx, m.DefaultTimeout)\n\t\tdefer cancelFn()\n\t}\n\n\treturn next.HandleInitialize(ctx, input)\n}\n\n// appendURIPath joins a URI path component to the existing path with `/`\n// separators between the path components. If the path being added ends with a\n// trailing `/` that slash will be maintained.\nfunc appendURIPath(base, add string) string {\n\treqPath := path.Join(base, add)\n\tif len(add) != 0 && add[len(add)-1] == '/' {\n\t\treqPath += \"/\"\n\t}\n\treturn reqPath\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go",
    "content": "package imds\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"net/http\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst (\n\t// Headers for Token and TTL\n\ttokenHeader     = \"x-aws-ec2-metadata-token\"\n\tdefaultTokenTTL = 5 * time.Minute\n)\n\ntype tokenProvider struct {\n\tclient   *Client\n\ttokenTTL time.Duration\n\n\ttoken    *apiToken\n\ttokenMux sync.RWMutex\n\n\tdisabled uint32 // Atomic updated\n}\n\nfunc newTokenProvider(client *Client, ttl time.Duration) *tokenProvider {\n\treturn &tokenProvider{\n\t\tclient:   client,\n\t\ttokenTTL: ttl,\n\t}\n}\n\n// apiToken provides the API token used by all operation calls for th EC2\n// Instance metadata service.\ntype apiToken struct {\n\ttoken   string\n\texpires time.Time\n}\n\nvar timeNow = time.Now\n\n// Expired returns if the token is expired.\nfunc (t *apiToken) Expired() bool {\n\t// Calling Round(0) on the current time will truncate the monotonic reading only. Ensures credential expiry\n\t// time is always based on reported wall-clock time.\n\treturn timeNow().Round(0).After(t.expires)\n}\n\nfunc (t *tokenProvider) ID() string { return \"APITokenProvider\" }\n\n// HandleFinalize is the finalize stack middleware, that if the token provider is\n// enabled, will attempt to add the cached API token to the request. If the API\n// token is not cached, it will be retrieved in a separate API call, getToken.\n//\n// For retry attempts, handler must be added after attempt retryer.\n//\n// If request for getToken fails the token provider may be disabled from future\n// requests, depending on the response status code.\nfunc (t *tokenProvider) HandleFinalize(\n\tctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif t.fallbackEnabled() && !t.enabled() {\n\t\t// short-circuits to insecure data flow if token provider is disabled.\n\t\treturn next.HandleFinalize(ctx, input)\n\t}\n\n\treq, ok := input.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unexpected transport request type %T\", input.Request)\n\t}\n\n\ttok, err := t.getToken(ctx)\n\tif err != nil {\n\t\t// If the error allows the token to downgrade to insecure flow allow that.\n\t\tvar bypassErr *bypassTokenRetrievalError\n\t\tif errors.As(err, &bypassErr) {\n\t\t\treturn next.HandleFinalize(ctx, input)\n\t\t}\n\n\t\treturn out, metadata, fmt.Errorf(\"failed to get API token, %w\", err)\n\t}\n\n\treq.Header.Set(tokenHeader, tok.token)\n\n\treturn next.HandleFinalize(ctx, input)\n}\n\n// HandleDeserialize is the deserialize stack middleware for determining if the\n// operation the token provider is decorating failed because of a 401\n// unauthorized status code. If the operation failed for that reason the token\n// provider needs to be re-enabled so that it can start adding the API token to\n// operation calls.\nfunc (t *tokenProvider) HandleDeserialize(\n\tctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, input)\n\tif err == nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresp, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expect HTTP transport, got %T\", out.RawResponse)\n\t}\n\n\tif resp.StatusCode == http.StatusUnauthorized { // unauthorized\n\t\tt.enable()\n\t\terr = &retryableError{Err: err, isRetryable: true}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc (t *tokenProvider) getToken(ctx context.Context) (tok *apiToken, err error) {\n\tif t.fallbackEnabled() && !t.enabled() {\n\t\treturn nil, &bypassTokenRetrievalError{\n\t\t\tErr: fmt.Errorf(\"cannot get API token, provider disabled\"),\n\t\t}\n\t}\n\n\tt.tokenMux.RLock()\n\ttok = t.token\n\tt.tokenMux.RUnlock()\n\n\tif tok != nil && !tok.Expired() {\n\t\treturn tok, nil\n\t}\n\n\ttok, err = t.updateToken(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn tok, nil\n}\n\nfunc (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) {\n\tt.tokenMux.Lock()\n\tdefer t.tokenMux.Unlock()\n\n\t// Prevent multiple requests to update retrieving the token.\n\tif t.token != nil && !t.token.Expired() {\n\t\ttok := t.token\n\t\treturn tok, nil\n\t}\n\n\tresult, err := t.client.getToken(ctx, &getTokenInput{\n\t\tTokenTTL: t.tokenTTL,\n\t})\n\tif err != nil {\n\t\tvar statusErr interface{ HTTPStatusCode() int }\n\t\tif errors.As(err, &statusErr) {\n\t\t\tswitch statusErr.HTTPStatusCode() {\n\t\t\t// Disable future get token if failed because of 403, 404, or 405\n\t\t\tcase http.StatusForbidden,\n\t\t\t\thttp.StatusNotFound,\n\t\t\t\thttp.StatusMethodNotAllowed:\n\n\t\t\t\tif t.fallbackEnabled() {\n\t\t\t\t\tlogger := middleware.GetLogger(ctx)\n\t\t\t\t\tlogger.Logf(logging.Warn, \"falling back to IMDSv1: %v\", err)\n\t\t\t\t\tt.disable()\n\t\t\t\t}\n\n\t\t\t// 400 errors are terminal, and need to be upstreamed\n\t\t\tcase http.StatusBadRequest:\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\t// Disable if request send failed or timed out getting response\n\t\tvar re *smithyhttp.RequestSendError\n\t\tvar ce *smithy.CanceledError\n\t\tif errors.As(err, &re) || errors.As(err, &ce) {\n\t\t\tatomic.StoreUint32(&t.disabled, 1)\n\t\t}\n\n\t\tif !t.fallbackEnabled() {\n\t\t\t// NOTE: getToken() is an implementation detail of some outer operation\n\t\t\t// (e.g. GetMetadata). It has its own retries that have already been exhausted.\n\t\t\t// Mark the underlying error as a terminal error.\n\t\t\terr = &retryableError{Err: err, isRetryable: false}\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Token couldn't be retrieved, fallback to IMDSv1 insecure flow for this request\n\t\t// and allow the request to proceed. Future requests _may_ re-attempt fetching a\n\t\t// token if not disabled.\n\t\treturn nil, &bypassTokenRetrievalError{Err: err}\n\t}\n\n\ttok := &apiToken{\n\t\ttoken:   result.Token,\n\t\texpires: timeNow().Add(result.TokenTTL),\n\t}\n\tt.token = tok\n\n\treturn tok, nil\n}\n\n// enabled returns if the token provider is current enabled or not.\nfunc (t *tokenProvider) enabled() bool {\n\treturn atomic.LoadUint32(&t.disabled) == 0\n}\n\n// fallbackEnabled returns false if EnableFallback is [aws.FalseTernary], true otherwise\nfunc (t *tokenProvider) fallbackEnabled() bool {\n\tswitch t.client.options.EnableFallback {\n\tcase aws.FalseTernary:\n\t\treturn false\n\tdefault:\n\t\treturn true\n\t}\n}\n\n// disable disables the token provider and it will no longer attempt to inject\n// the token, nor request updates.\nfunc (t *tokenProvider) disable() {\n\tatomic.StoreUint32(&t.disabled, 1)\n}\n\n// enable enables the token provide to start refreshing tokens, and adding them\n// to the pending request.\nfunc (t *tokenProvider) enable() {\n\tt.tokenMux.Lock()\n\tt.token = nil\n\tt.tokenMux.Unlock()\n\tatomic.StoreUint32(&t.disabled, 0)\n}\n\ntype bypassTokenRetrievalError struct {\n\tErr error\n}\n\nfunc (e *bypassTokenRetrievalError) Error() string {\n\treturn fmt.Sprintf(\"bypass token retrieval, %v\", e.Err)\n}\n\nfunc (e *bypassTokenRetrievalError) Unwrap() error { return e.Err }\n\ntype retryableError struct {\n\tErr         error\n\tisRetryable bool\n}\n\nfunc (e *retryableError) RetryableError() bool { return e.isRetryable }\n\nfunc (e *retryableError) Error() string { return e.Err.Error() }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go",
    "content": "package auth\n\nimport (\n\t\"github.com/aws/smithy-go/auth\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// HTTPAuthScheme is the SDK's internal implementation of smithyhttp.AuthScheme\n// for pre-existing implementations where the signer was added to client\n// config. SDK clients will key off of this type and ensure per-operation\n// updates to those signers persist on the scheme itself.\ntype HTTPAuthScheme struct {\n\tschemeID string\n\tsigner   smithyhttp.Signer\n}\n\nvar _ smithyhttp.AuthScheme = (*HTTPAuthScheme)(nil)\n\n// NewHTTPAuthScheme returns an auth scheme instance with the given config.\nfunc NewHTTPAuthScheme(schemeID string, signer smithyhttp.Signer) *HTTPAuthScheme {\n\treturn &HTTPAuthScheme{\n\t\tschemeID: schemeID,\n\t\tsigner:   signer,\n\t}\n}\n\n// SchemeID identifies the auth scheme.\nfunc (s *HTTPAuthScheme) SchemeID() string {\n\treturn s.schemeID\n}\n\n// IdentityResolver gets the identity resolver for the auth scheme.\nfunc (s *HTTPAuthScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver {\n\treturn o.GetIdentityResolver(s.schemeID)\n}\n\n// Signer gets the signer for the auth scheme.\nfunc (s *HTTPAuthScheme) Signer() smithyhttp.Signer {\n\treturn s.signer\n}\n\n// WithSigner returns a new instance of the auth scheme with the updated signer.\nfunc (s *HTTPAuthScheme) WithSigner(signer smithyhttp.Signer) *HTTPAuthScheme {\n\treturn NewHTTPAuthScheme(s.schemeID, signer)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go",
    "content": "package auth\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// SigV4 is a constant representing\n// Authentication Scheme Signature Version 4\nconst SigV4 = \"sigv4\"\n\n// SigV4A is a constant representing\n// Authentication Scheme Signature Version 4A\nconst SigV4A = \"sigv4a\"\n\n// SigV4S3Express identifies the S3 S3Express auth scheme.\nconst SigV4S3Express = \"sigv4-s3express\"\n\n// None is a constant representing the\n// None Authentication Scheme\nconst None = \"none\"\n\n// SupportedSchemes is a data structure\n// that indicates the list of supported AWS\n// authentication schemes\nvar SupportedSchemes = map[string]bool{\n\tSigV4:          true,\n\tSigV4A:         true,\n\tSigV4S3Express: true,\n\tNone:           true,\n}\n\n// AuthenticationScheme is a representation of\n// AWS authentication schemes\ntype AuthenticationScheme interface {\n\tisAuthenticationScheme()\n}\n\n// AuthenticationSchemeV4 is a AWS SigV4 representation\ntype AuthenticationSchemeV4 struct {\n\tName                  string\n\tSigningName           *string\n\tSigningRegion         *string\n\tDisableDoubleEncoding *bool\n}\n\nfunc (a *AuthenticationSchemeV4) isAuthenticationScheme() {}\n\n// AuthenticationSchemeV4A is a AWS SigV4A representation\ntype AuthenticationSchemeV4A struct {\n\tName                  string\n\tSigningName           *string\n\tSigningRegionSet      []string\n\tDisableDoubleEncoding *bool\n}\n\nfunc (a *AuthenticationSchemeV4A) isAuthenticationScheme() {}\n\n// AuthenticationSchemeNone is a representation for the none auth scheme\ntype AuthenticationSchemeNone struct{}\n\nfunc (a *AuthenticationSchemeNone) isAuthenticationScheme() {}\n\n// NoAuthenticationSchemesFoundError is used in signaling\n// that no authentication schemes have been specified.\ntype NoAuthenticationSchemesFoundError struct{}\n\nfunc (e *NoAuthenticationSchemesFoundError) Error() string {\n\treturn fmt.Sprint(\"No authentication schemes specified.\")\n}\n\n// UnSupportedAuthenticationSchemeSpecifiedError is used in\n// signaling that only unsupported authentication schemes\n// were specified.\ntype UnSupportedAuthenticationSchemeSpecifiedError struct {\n\tUnsupportedSchemes []string\n}\n\nfunc (e *UnSupportedAuthenticationSchemeSpecifiedError) Error() string {\n\treturn fmt.Sprint(\"Unsupported authentication scheme specified.\")\n}\n\n// GetAuthenticationSchemes extracts the relevant authentication scheme data\n// into a custom strongly typed Go data structure.\nfunc GetAuthenticationSchemes(p *smithy.Properties) ([]AuthenticationScheme, error) {\n\tvar result []AuthenticationScheme\n\tif !p.Has(\"authSchemes\") {\n\t\treturn nil, &NoAuthenticationSchemesFoundError{}\n\t}\n\n\tauthSchemes, _ := p.Get(\"authSchemes\").([]interface{})\n\n\tvar unsupportedSchemes []string\n\tfor _, scheme := range authSchemes {\n\t\tauthScheme, _ := scheme.(map[string]interface{})\n\n\t\tversion := authScheme[\"name\"].(string)\n\t\tswitch version {\n\t\tcase SigV4, SigV4S3Express:\n\t\t\tv4Scheme := AuthenticationSchemeV4{\n\t\t\t\tName:                  version,\n\t\t\t\tSigningName:           getSigningName(authScheme),\n\t\t\t\tSigningRegion:         getSigningRegion(authScheme),\n\t\t\t\tDisableDoubleEncoding: getDisableDoubleEncoding(authScheme),\n\t\t\t}\n\t\t\tresult = append(result, AuthenticationScheme(&v4Scheme))\n\t\tcase SigV4A:\n\t\t\tv4aScheme := AuthenticationSchemeV4A{\n\t\t\t\tName:                  SigV4A,\n\t\t\t\tSigningName:           getSigningName(authScheme),\n\t\t\t\tSigningRegionSet:      getSigningRegionSet(authScheme),\n\t\t\t\tDisableDoubleEncoding: getDisableDoubleEncoding(authScheme),\n\t\t\t}\n\t\t\tresult = append(result, AuthenticationScheme(&v4aScheme))\n\t\tcase None:\n\t\t\tnoneScheme := AuthenticationSchemeNone{}\n\t\t\tresult = append(result, AuthenticationScheme(&noneScheme))\n\t\tdefault:\n\t\t\tunsupportedSchemes = append(unsupportedSchemes, authScheme[\"name\"].(string))\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tif len(result) == 0 {\n\t\treturn nil, &UnSupportedAuthenticationSchemeSpecifiedError{\n\t\t\tUnsupportedSchemes: unsupportedSchemes,\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\ntype disableDoubleEncoding struct{}\n\n// SetDisableDoubleEncoding sets or modifies the disable double encoding option\n// on the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc SetDisableDoubleEncoding(ctx context.Context, value bool) context.Context {\n\treturn middleware.WithStackValue(ctx, disableDoubleEncoding{}, value)\n}\n\n// GetDisableDoubleEncoding retrieves the disable double encoding option\n// from the context.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetDisableDoubleEncoding(ctx context.Context) (value bool, ok bool) {\n\tvalue, ok = middleware.GetStackValue(ctx, disableDoubleEncoding{}).(bool)\n\treturn value, ok\n}\n\nfunc getSigningName(authScheme map[string]interface{}) *string {\n\tsigningName, ok := authScheme[\"signingName\"].(string)\n\tif !ok || signingName == \"\" {\n\t\treturn nil\n\t}\n\treturn &signingName\n}\n\nfunc getSigningRegionSet(authScheme map[string]interface{}) []string {\n\tuntypedSigningRegionSet, ok := authScheme[\"signingRegionSet\"].([]interface{})\n\tif !ok {\n\t\treturn nil\n\t}\n\tsigningRegionSet := []string{}\n\tfor _, item := range untypedSigningRegionSet {\n\t\tsigningRegionSet = append(signingRegionSet, item.(string))\n\t}\n\treturn signingRegionSet\n}\n\nfunc getSigningRegion(authScheme map[string]interface{}) *string {\n\tsigningRegion, ok := authScheme[\"signingRegion\"].(string)\n\tif !ok || signingRegion == \"\" {\n\t\treturn nil\n\t}\n\treturn &signingRegion\n}\n\nfunc getDisableDoubleEncoding(authScheme map[string]interface{}) *bool {\n\tdisableDoubleEncoding, ok := authScheme[\"disableDoubleEncoding\"].(bool)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn &disableDoubleEncoding\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go",
    "content": "package smithy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/auth/bearer\"\n)\n\n// BearerTokenAdapter adapts smithy bearer.Token to smithy auth.Identity.\ntype BearerTokenAdapter struct {\n\tToken bearer.Token\n}\n\nvar _ auth.Identity = (*BearerTokenAdapter)(nil)\n\n// Expiration returns the time of expiration for the token.\nfunc (v *BearerTokenAdapter) Expiration() time.Time {\n\treturn v.Token.Expires\n}\n\n// BearerTokenProviderAdapter adapts smithy bearer.TokenProvider to smithy\n// auth.IdentityResolver.\ntype BearerTokenProviderAdapter struct {\n\tProvider bearer.TokenProvider\n}\n\nvar _ (auth.IdentityResolver) = (*BearerTokenProviderAdapter)(nil)\n\n// GetIdentity retrieves a bearer token using the underlying provider.\nfunc (v *BearerTokenProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) (\n\tauth.Identity, error,\n) {\n\ttoken, err := v.Provider.RetrieveBearerToken(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get token: %w\", err)\n\t}\n\n\treturn &BearerTokenAdapter{Token: token}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go",
    "content": "package smithy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/auth/bearer\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// BearerTokenSignerAdapter adapts smithy bearer.Signer to smithy http\n// auth.Signer.\ntype BearerTokenSignerAdapter struct {\n\tSigner bearer.Signer\n}\n\nvar _ (smithyhttp.Signer) = (*BearerTokenSignerAdapter)(nil)\n\n// SignRequest signs the request with the provided bearer token.\nfunc (v *BearerTokenSignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, _ smithy.Properties) error {\n\tca, ok := identity.(*BearerTokenAdapter)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected identity type: %T\", identity)\n\t}\n\n\tsigned, err := v.Signer.SignWithBearerToken(ctx, ca.Token, r)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sign request: %w\", err)\n\t}\n\n\t*r = *signed.(*smithyhttp.Request)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go",
    "content": "package smithy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n)\n\n// CredentialsAdapter adapts aws.Credentials to auth.Identity.\ntype CredentialsAdapter struct {\n\tCredentials aws.Credentials\n}\n\nvar _ auth.Identity = (*CredentialsAdapter)(nil)\n\n// Expiration returns the time of expiration for the credentials.\nfunc (v *CredentialsAdapter) Expiration() time.Time {\n\treturn v.Credentials.Expires\n}\n\n// CredentialsProviderAdapter adapts aws.CredentialsProvider to auth.IdentityResolver.\ntype CredentialsProviderAdapter struct {\n\tProvider aws.CredentialsProvider\n}\n\nvar _ (auth.IdentityResolver) = (*CredentialsProviderAdapter)(nil)\n\n// GetIdentity retrieves AWS credentials using the underlying provider.\nfunc (v *CredentialsProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) (\n\tauth.Identity, error,\n) {\n\tif v.Provider == nil {\n\t\treturn &CredentialsAdapter{Credentials: aws.Credentials{}}, nil\n\t}\n\n\tcreds, err := v.Provider.Retrieve(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get credentials: %w\", err)\n\t}\n\n\treturn &CredentialsAdapter{Credentials: creds}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go",
    "content": "// Package smithy adapts concrete AWS auth and signing types to the generic smithy versions.\npackage smithy\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go",
    "content": "package smithy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tv4 \"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tinternalcontext \"github.com/aws/aws-sdk-go-v2/internal/context\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/sdk\"\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/logging\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// V4SignerAdapter adapts v4.HTTPSigner to smithy http.Signer.\ntype V4SignerAdapter struct {\n\tSigner     v4.HTTPSigner\n\tLogger     logging.Logger\n\tLogSigning bool\n}\n\nvar _ (smithyhttp.Signer) = (*V4SignerAdapter)(nil)\n\n// SignRequest signs the request with the provided identity.\nfunc (v *V4SignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error {\n\tca, ok := identity.(*CredentialsAdapter)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected identity type: %T\", identity)\n\t}\n\n\tname, ok := smithyhttp.GetSigV4SigningName(&props)\n\tif !ok {\n\t\treturn fmt.Errorf(\"sigv4 signing name is required\")\n\t}\n\n\tregion, ok := smithyhttp.GetSigV4SigningRegion(&props)\n\tif !ok {\n\t\treturn fmt.Errorf(\"sigv4 signing region is required\")\n\t}\n\n\thash := v4.GetPayloadHash(ctx)\n\tsigningTime := sdk.NowTime()\n\tskew := internalcontext.GetAttemptSkewContext(ctx)\n\tsigningTime = signingTime.Add(skew)\n\terr := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, signingTime, func(o *v4.SignerOptions) {\n\t\to.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props)\n\n\t\to.Logger = v.Logger\n\t\to.LogSigning = v.LogSigning\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sign http: %w\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md",
    "content": "# v1.3.15 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.14 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.13 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.12 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.11 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.10 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.9 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.8 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.7 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.6 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.5 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.4 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.3 (2024-03-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.10 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.9 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.8 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.7 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.6 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.5 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.4 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.3 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.2 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2023-11-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.43 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.42 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.41 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.40 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.39 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.38 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.37 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.36 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.35 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.34 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.33 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.32 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.31 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.30 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.29 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.28 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.27 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.26 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.25 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.24 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.23 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.22 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.21 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.20 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.19 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.18 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.17 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.16 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.15 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.14 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.13 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.12 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.11 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.10 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.9 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.8 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.7 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.6 (2022-03-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.5 (2022-02-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.4 (2022-01-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.3 (2022-01-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.2 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.7 (2021-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.6 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.5 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.4 (2021-08-27)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.2 (2021-08-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.1 (2021-07-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.0 (2021-06-25)\n\n* **Release**: Release new modules\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go",
    "content": "package configsources\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// EnableEndpointDiscoveryProvider is an interface for retrieving external configuration value\n// for Enable Endpoint Discovery\ntype EnableEndpointDiscoveryProvider interface {\n\tGetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error)\n}\n\n// ResolveEnableEndpointDiscovery extracts the first instance of a EnableEndpointDiscoveryProvider from the config slice.\n// Additionally returns a aws.EndpointDiscoveryEnableState to indicate if the value was found in provided configs,\n// and error if one is encountered.\nfunc ResolveEnableEndpointDiscovery(ctx context.Context, configs []interface{}) (value aws.EndpointDiscoveryEnableState, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(EnableEndpointDiscoveryProvider); ok {\n\t\t\tvalue, found, err = p.GetEnableEndpointDiscovery(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// UseDualStackEndpointProvider is an interface for retrieving external configuration values for UseDualStackEndpoint\ntype UseDualStackEndpointProvider interface {\n\tGetUseDualStackEndpoint(context.Context) (value aws.DualStackEndpointState, found bool, err error)\n}\n\n// ResolveUseDualStackEndpoint extracts the first instance of a UseDualStackEndpoint from the config slice.\n// Additionally returns a boolean to indicate if the value was found in provided configs, and error if one is encountered.\nfunc ResolveUseDualStackEndpoint(ctx context.Context, configs []interface{}) (value aws.DualStackEndpointState, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(UseDualStackEndpointProvider); ok {\n\t\t\tvalue, found, err = p.GetUseDualStackEndpoint(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// UseFIPSEndpointProvider is an interface for retrieving external configuration values for UseFIPSEndpoint\ntype UseFIPSEndpointProvider interface {\n\tGetUseFIPSEndpoint(context.Context) (value aws.FIPSEndpointState, found bool, err error)\n}\n\n// ResolveUseFIPSEndpoint extracts the first instance of a UseFIPSEndpointProvider from the config slice.\n// Additionally, returns a boolean to indicate if the value was found in provided configs, and error if one is encountered.\nfunc ResolveUseFIPSEndpoint(ctx context.Context, configs []interface{}) (value aws.FIPSEndpointState, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(UseFIPSEndpointProvider); ok {\n\t\t\tvalue, found, err = p.GetUseFIPSEndpoint(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go",
    "content": "package configsources\n\nimport (\n\t\"context\"\n)\n\n// ServiceBaseEndpointProvider is needed to search for all providers\n// that provide a configured service endpoint\ntype ServiceBaseEndpointProvider interface {\n\tGetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error)\n}\n\n// IgnoreConfiguredEndpointsProvider is needed to search for all providers\n// that provide a flag to disable configured endpoints.\n//\n// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because\n// service packages cannot import github.com/aws/aws-sdk-go-v2/config\n// due to result import cycle error.\ntype IgnoreConfiguredEndpointsProvider interface {\n\tGetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error)\n}\n\n// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured\n// endpoints feature.\n//\n// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because\n// service packages cannot import github.com/aws/aws-sdk-go-v2/config\n// due to result import cycle error.\nfunc GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) {\n\tfor _, cfg := range configs {\n\t\tif p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok {\n\t\t\tvalue, found, err = p.GetIgnoreConfiguredEndpoints(ctx)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ResolveServiceBaseEndpoint is used to retrieve service endpoints from configured sources\n// while allowing for configured endpoints to be disabled\nfunc ResolveServiceBaseEndpoint(ctx context.Context, sdkID string, configs []interface{}) (value string, found bool, err error) {\n\tif val, found, _ := GetIgnoreConfiguredEndpoints(ctx, configs); found && val {\n\t\treturn \"\", false, nil\n\t}\n\n\tfor _, cs := range configs {\n\t\tif p, ok := cs.(ServiceBaseEndpointProvider); ok {\n\t\t\tvalue, found, err = p.GetServiceBaseEndpoint(context.Background(), sdkID)\n\t\t\tif err != nil || found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage configsources\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.3.15\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go",
    "content": "package context\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype s3BackendKey struct{}\ntype checksumInputAlgorithmKey struct{}\ntype clockSkew struct{}\n\nconst (\n\t// S3BackendS3Express identifies the S3Express backend\n\tS3BackendS3Express = \"S3Express\"\n)\n\n// SetS3Backend stores the resolved endpoint backend within the request\n// context, which is required for a variety of custom S3 behaviors.\nfunc SetS3Backend(ctx context.Context, typ string) context.Context {\n\treturn middleware.WithStackValue(ctx, s3BackendKey{}, typ)\n}\n\n// GetS3Backend retrieves the stored endpoint backend within the context.\nfunc GetS3Backend(ctx context.Context) string {\n\tv, _ := middleware.GetStackValue(ctx, s3BackendKey{}).(string)\n\treturn v\n}\n\n// SetChecksumInputAlgorithm sets the request checksum algorithm on the\n// context.\nfunc SetChecksumInputAlgorithm(ctx context.Context, value string) context.Context {\n\treturn middleware.WithStackValue(ctx, checksumInputAlgorithmKey{}, value)\n}\n\n// GetChecksumInputAlgorithm returns the checksum algorithm from the context.\nfunc GetChecksumInputAlgorithm(ctx context.Context) string {\n\tv, _ := middleware.GetStackValue(ctx, checksumInputAlgorithmKey{}).(string)\n\treturn v\n}\n\n// SetAttemptSkewContext sets the clock skew value on the context\nfunc SetAttemptSkewContext(ctx context.Context, v time.Duration) context.Context {\n\treturn middleware.WithStackValue(ctx, clockSkew{}, v)\n}\n\n// GetAttemptSkewContext gets the clock skew value from the context\nfunc GetAttemptSkewContext(ctx context.Context) time.Duration {\n\tx, _ := middleware.GetStackValue(ctx, clockSkew{}).(time.Duration)\n\treturn x\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go",
    "content": "package awsrulesfn\n\nimport (\n\t\"strings\"\n)\n\n// ARN provides AWS ARN components broken out into a data structure.\ntype ARN struct {\n\tPartition  string\n\tService    string\n\tRegion     string\n\tAccountId  string\n\tResourceId OptionalStringSlice\n}\n\nconst (\n\tarnDelimiters      = \":\"\n\tresourceDelimiters = \"/:\"\n\tarnSections        = 6\n\tarnPrefix          = \"arn:\"\n\n\t// zero-indexed\n\tsectionPartition = 1\n\tsectionService   = 2\n\tsectionRegion    = 3\n\tsectionAccountID = 4\n\tsectionResource  = 5\n)\n\n// ParseARN returns an [ARN] value parsed from the input string provided. If\n// the ARN cannot be parsed nil will be returned, and error added to\n// [ErrorCollector].\nfunc ParseARN(input string) *ARN {\n\tif !strings.HasPrefix(input, arnPrefix) {\n\t\treturn nil\n\t}\n\n\tsections := strings.SplitN(input, arnDelimiters, arnSections)\n\tif numSections := len(sections); numSections != arnSections {\n\t\treturn nil\n\t}\n\n\tif sections[sectionPartition] == \"\" {\n\t\treturn nil\n\t}\n\tif sections[sectionService] == \"\" {\n\t\treturn nil\n\t}\n\tif sections[sectionResource] == \"\" {\n\t\treturn nil\n\t}\n\n\treturn &ARN{\n\t\tPartition:  sections[sectionPartition],\n\t\tService:    sections[sectionService],\n\t\tRegion:     sections[sectionRegion],\n\t\tAccountId:  sections[sectionAccountID],\n\t\tResourceId: splitResource(sections[sectionResource]),\n\t}\n}\n\n// splitResource splits the resource components by the ARN resource delimiters.\nfunc splitResource(v string) []string {\n\tvar parts []string\n\tvar offset int\n\n\tfor offset <= len(v) {\n\t\tidx := strings.IndexAny(v[offset:], \"/:\")\n\t\tif idx < 0 {\n\t\t\tparts = append(parts, v[offset:])\n\t\t\tbreak\n\t\t}\n\t\tparts = append(parts, v[offset:idx+offset])\n\t\toffset += idx + 1\n\t}\n\n\treturn parts\n}\n\n// OptionalStringSlice provides a helper to safely get the index of a string\n// slice that may be out of bounds. Returns pointer to string if index is\n// valid. Otherwise returns nil.\ntype OptionalStringSlice []string\n\n// Get returns a string pointer of the string at index i if the index is valid.\n// Otherwise returns nil.\nfunc (s OptionalStringSlice) Get(i int) *string {\n\tif i < 0 || i >= len(s) {\n\t\treturn nil\n\t}\n\n\tv := s[i]\n\treturn &v\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go",
    "content": "// Package awsrulesfn provides AWS focused endpoint rule functions for\n// evaluating endpoint resolution rules.\npackage awsrulesfn\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go",
    "content": "//go:build codegen\n// +build codegen\n\npackage awsrulesfn\n\n//go:generate go run -tags codegen ./internal/partition/codegen.go -model partitions.json -output partitions.go\n//go:generate gofmt -w -s .\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go",
    "content": "package awsrulesfn\n\nimport (\n\t\"net\"\n\t\"strings\"\n\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// IsVirtualHostableS3Bucket returns if the input is a DNS compatible bucket\n// name and can be used with Amazon S3 virtual hosted style addressing. Similar\n// to [rulesfn.IsValidHostLabel] with the added restriction that the length of label\n// must be [3:63] characters long, all lowercase, and not formatted as an IP\n// address.\nfunc IsVirtualHostableS3Bucket(input string, allowSubDomains bool) bool {\n\t// input should not be formatted as an IP address\n\t// NOTE: this will technically trip up on IPv6 hosts with zone IDs, but\n\t// validation further down will catch that anyway (it's guaranteed to have\n\t// unfriendly characters % and : if that's the case)\n\tif net.ParseIP(input) != nil {\n\t\treturn false\n\t}\n\n\tvar labels []string\n\tif allowSubDomains {\n\t\tlabels = strings.Split(input, \".\")\n\t} else {\n\t\tlabels = []string{input}\n\t}\n\n\tfor _, label := range labels {\n\t\t// validate special length constraints\n\t\tif l := len(label); l < 3 || l > 63 {\n\t\t\treturn false\n\t\t}\n\n\t\t// Validate no capital letters\n\t\tfor _, r := range label {\n\t\t\tif r >= 'A' && r <= 'Z' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Validate valid host label\n\t\tif !smithyhttp.ValidHostLabel(label) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go",
    "content": "package awsrulesfn\n\nimport \"regexp\"\n\n// Partition provides the metadata describing an AWS partition.\ntype Partition struct {\n\tID            string                     `json:\"id\"`\n\tRegions       map[string]RegionOverrides `json:\"regions\"`\n\tRegionRegex   string                     `json:\"regionRegex\"`\n\tDefaultConfig PartitionConfig            `json:\"outputs\"`\n}\n\n// PartitionConfig provides the endpoint metadata for an AWS region or partition.\ntype PartitionConfig struct {\n\tName                 string `json:\"name\"`\n\tDnsSuffix            string `json:\"dnsSuffix\"`\n\tDualStackDnsSuffix   string `json:\"dualStackDnsSuffix\"`\n\tSupportsFIPS         bool   `json:\"supportsFIPS\"`\n\tSupportsDualStack    bool   `json:\"supportsDualStack\"`\n\tImplicitGlobalRegion string `json:\"implicitGlobalRegion\"`\n}\n\ntype RegionOverrides struct {\n\tName               *string `json:\"name\"`\n\tDnsSuffix          *string `json:\"dnsSuffix\"`\n\tDualStackDnsSuffix *string `json:\"dualStackDnsSuffix\"`\n\tSupportsFIPS       *bool   `json:\"supportsFIPS\"`\n\tSupportsDualStack  *bool   `json:\"supportsDualStack\"`\n}\n\nconst defaultPartition = \"aws\"\n\nfunc getPartition(partitions []Partition, region string) *PartitionConfig {\n\tfor _, partition := range partitions {\n\t\tif v, ok := partition.Regions[region]; ok {\n\t\t\tp := mergeOverrides(partition.DefaultConfig, v)\n\t\t\treturn &p\n\t\t}\n\t}\n\n\tfor _, partition := range partitions {\n\t\tregionRegex := regexp.MustCompile(partition.RegionRegex)\n\t\tif regionRegex.MatchString(region) {\n\t\t\tv := partition.DefaultConfig\n\t\t\treturn &v\n\t\t}\n\t}\n\n\tfor _, partition := range partitions {\n\t\tif partition.ID == defaultPartition {\n\t\t\tv := partition.DefaultConfig\n\t\t\treturn &v\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc mergeOverrides(into PartitionConfig, from RegionOverrides) PartitionConfig {\n\tif from.Name != nil {\n\t\tinto.Name = *from.Name\n\t}\n\tif from.DnsSuffix != nil {\n\t\tinto.DnsSuffix = *from.DnsSuffix\n\t}\n\tif from.DualStackDnsSuffix != nil {\n\t\tinto.DualStackDnsSuffix = *from.DualStackDnsSuffix\n\t}\n\tif from.SupportsFIPS != nil {\n\t\tinto.SupportsFIPS = *from.SupportsFIPS\n\t}\n\tif from.SupportsDualStack != nil {\n\t\tinto.SupportsDualStack = *from.SupportsDualStack\n\t}\n\treturn into\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go",
    "content": "// Code generated by endpoint/awsrulesfn/internal/partition. DO NOT EDIT.\n\npackage awsrulesfn\n\n// GetPartition returns an AWS [Partition] for the region provided. If the\n// partition cannot be determined nil will be returned.\nfunc GetPartition(region string) *PartitionConfig {\n\treturn getPartition(partitions, region)\n}\n\nvar partitions = []Partition{\n\t{\n\t\tID:          \"aws\",\n\t\tRegionRegex: \"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws\",\n\t\t\tDnsSuffix:            \"amazonaws.com\",\n\t\t\tDualStackDnsSuffix:   \"api.aws\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    true,\n\t\t\tImplicitGlobalRegion: \"us-east-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"af-south-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-northeast-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-northeast-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-northeast-3\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-south-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-south-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-southeast-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-southeast-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-southeast-3\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ap-southeast-4\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"aws-global\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ca-central-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"ca-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-central-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-central-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-north-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-south-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-south-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-west-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"eu-west-3\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"il-central-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"me-central-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"me-south-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"sa-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-east-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-west-2\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-cn\",\n\t\tRegionRegex: \"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-cn\",\n\t\t\tDnsSuffix:            \"amazonaws.com.cn\",\n\t\t\tDualStackDnsSuffix:   \"api.amazonwebservices.com.cn\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    true,\n\t\t\tImplicitGlobalRegion: \"cn-northwest-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"aws-cn-global\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"cn-north-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"cn-northwest-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-us-gov\",\n\t\tRegionRegex: \"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-us-gov\",\n\t\t\tDnsSuffix:            \"amazonaws.com\",\n\t\t\tDualStackDnsSuffix:   \"api.aws\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    true,\n\t\t\tImplicitGlobalRegion: \"us-gov-west-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"aws-us-gov-global\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-gov-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-gov-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-iso\",\n\t\tRegionRegex: \"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-iso\",\n\t\t\tDnsSuffix:            \"c2s.ic.gov\",\n\t\t\tDualStackDnsSuffix:   \"c2s.ic.gov\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    false,\n\t\t\tImplicitGlobalRegion: \"us-iso-east-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"aws-iso-global\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-iso-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-iso-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-iso-b\",\n\t\tRegionRegex: \"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-iso-b\",\n\t\t\tDnsSuffix:            \"sc2s.sgov.gov\",\n\t\t\tDualStackDnsSuffix:   \"sc2s.sgov.gov\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    false,\n\t\t\tImplicitGlobalRegion: \"us-isob-east-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"aws-iso-b-global\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t\t\"us-isob-east-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-iso-e\",\n\t\tRegionRegex: \"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-iso-e\",\n\t\t\tDnsSuffix:            \"cloud.adc-e.uk\",\n\t\t\tDualStackDnsSuffix:   \"cloud.adc-e.uk\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    false,\n\t\t\tImplicitGlobalRegion: \"eu-isoe-west-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{\n\t\t\t\"eu-isoe-west-1\": {\n\t\t\t\tName:               nil,\n\t\t\t\tDnsSuffix:          nil,\n\t\t\t\tDualStackDnsSuffix: nil,\n\t\t\t\tSupportsFIPS:       nil,\n\t\t\t\tSupportsDualStack:  nil,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID:          \"aws-iso-f\",\n\t\tRegionRegex: \"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tDefaultConfig: PartitionConfig{\n\t\t\tName:                 \"aws-iso-f\",\n\t\t\tDnsSuffix:            \"csp.hci.ic.gov\",\n\t\t\tDualStackDnsSuffix:   \"csp.hci.ic.gov\",\n\t\t\tSupportsFIPS:         true,\n\t\t\tSupportsDualStack:    false,\n\t\t\tImplicitGlobalRegion: \"us-isof-south-1\",\n\t\t},\n\t\tRegions: map[string]RegionOverrides{},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json",
    "content": "{\n  \"partitions\" : [ {\n    \"id\" : \"aws\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"amazonaws.com\",\n      \"dualStackDnsSuffix\" : \"api.aws\",\n      \"implicitGlobalRegion\" : \"us-east-1\",\n      \"name\" : \"aws\",\n      \"supportsDualStack\" : true,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"af-south-1\" : {\n        \"description\" : \"Africa (Cape Town)\"\n      },\n      \"ap-east-1\" : {\n        \"description\" : \"Asia Pacific (Hong Kong)\"\n      },\n      \"ap-northeast-1\" : {\n        \"description\" : \"Asia Pacific (Tokyo)\"\n      },\n      \"ap-northeast-2\" : {\n        \"description\" : \"Asia Pacific (Seoul)\"\n      },\n      \"ap-northeast-3\" : {\n        \"description\" : \"Asia Pacific (Osaka)\"\n      },\n      \"ap-south-1\" : {\n        \"description\" : \"Asia Pacific (Mumbai)\"\n      },\n      \"ap-south-2\" : {\n        \"description\" : \"Asia Pacific (Hyderabad)\"\n      },\n      \"ap-southeast-1\" : {\n        \"description\" : \"Asia Pacific (Singapore)\"\n      },\n      \"ap-southeast-2\" : {\n        \"description\" : \"Asia Pacific (Sydney)\"\n      },\n      \"ap-southeast-3\" : {\n        \"description\" : \"Asia Pacific (Jakarta)\"\n      },\n      \"ap-southeast-4\" : {\n        \"description\" : \"Asia Pacific (Melbourne)\"\n      },\n      \"aws-global\" : {\n        \"description\" : \"AWS Standard global region\"\n      },\n      \"ca-central-1\" : {\n        \"description\" : \"Canada (Central)\"\n      },\n      \"ca-west-1\" : {\n        \"description\" : \"Canada West (Calgary)\"\n      },\n      \"eu-central-1\" : {\n        \"description\" : \"Europe (Frankfurt)\"\n      },\n      \"eu-central-2\" : {\n        \"description\" : \"Europe (Zurich)\"\n      },\n      \"eu-north-1\" : {\n        \"description\" : \"Europe (Stockholm)\"\n      },\n      \"eu-south-1\" : {\n        \"description\" : \"Europe (Milan)\"\n      },\n      \"eu-south-2\" : {\n        \"description\" : \"Europe (Spain)\"\n      },\n      \"eu-west-1\" : {\n        \"description\" : \"Europe (Ireland)\"\n      },\n      \"eu-west-2\" : {\n        \"description\" : \"Europe (London)\"\n      },\n      \"eu-west-3\" : {\n        \"description\" : \"Europe (Paris)\"\n      },\n      \"il-central-1\" : {\n        \"description\" : \"Israel (Tel Aviv)\"\n      },\n      \"me-central-1\" : {\n        \"description\" : \"Middle East (UAE)\"\n      },\n      \"me-south-1\" : {\n        \"description\" : \"Middle East (Bahrain)\"\n      },\n      \"sa-east-1\" : {\n        \"description\" : \"South America (Sao Paulo)\"\n      },\n      \"us-east-1\" : {\n        \"description\" : \"US East (N. Virginia)\"\n      },\n      \"us-east-2\" : {\n        \"description\" : \"US East (Ohio)\"\n      },\n      \"us-west-1\" : {\n        \"description\" : \"US West (N. California)\"\n      },\n      \"us-west-2\" : {\n        \"description\" : \"US West (Oregon)\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-cn\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"amazonaws.com.cn\",\n      \"dualStackDnsSuffix\" : \"api.amazonwebservices.com.cn\",\n      \"implicitGlobalRegion\" : \"cn-northwest-1\",\n      \"name\" : \"aws-cn\",\n      \"supportsDualStack\" : true,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"aws-cn-global\" : {\n        \"description\" : \"AWS China global region\"\n      },\n      \"cn-north-1\" : {\n        \"description\" : \"China (Beijing)\"\n      },\n      \"cn-northwest-1\" : {\n        \"description\" : \"China (Ningxia)\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-us-gov\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"amazonaws.com\",\n      \"dualStackDnsSuffix\" : \"api.aws\",\n      \"implicitGlobalRegion\" : \"us-gov-west-1\",\n      \"name\" : \"aws-us-gov\",\n      \"supportsDualStack\" : true,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"aws-us-gov-global\" : {\n        \"description\" : \"AWS GovCloud (US) global region\"\n      },\n      \"us-gov-east-1\" : {\n        \"description\" : \"AWS GovCloud (US-East)\"\n      },\n      \"us-gov-west-1\" : {\n        \"description\" : \"AWS GovCloud (US-West)\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-iso\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"c2s.ic.gov\",\n      \"dualStackDnsSuffix\" : \"c2s.ic.gov\",\n      \"implicitGlobalRegion\" : \"us-iso-east-1\",\n      \"name\" : \"aws-iso\",\n      \"supportsDualStack\" : false,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"aws-iso-global\" : {\n        \"description\" : \"AWS ISO (US) global region\"\n      },\n      \"us-iso-east-1\" : {\n        \"description\" : \"US ISO East\"\n      },\n      \"us-iso-west-1\" : {\n        \"description\" : \"US ISO WEST\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-iso-b\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"sc2s.sgov.gov\",\n      \"dualStackDnsSuffix\" : \"sc2s.sgov.gov\",\n      \"implicitGlobalRegion\" : \"us-isob-east-1\",\n      \"name\" : \"aws-iso-b\",\n      \"supportsDualStack\" : false,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"aws-iso-b-global\" : {\n        \"description\" : \"AWS ISOB (US) global region\"\n      },\n      \"us-isob-east-1\" : {\n        \"description\" : \"US ISOB East (Ohio)\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-iso-e\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"cloud.adc-e.uk\",\n      \"dualStackDnsSuffix\" : \"cloud.adc-e.uk\",\n      \"implicitGlobalRegion\" : \"eu-isoe-west-1\",\n      \"name\" : \"aws-iso-e\",\n      \"supportsDualStack\" : false,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : {\n      \"eu-isoe-west-1\" : {\n        \"description\" : \"EU ISOE West\"\n      }\n    }\n  }, {\n    \"id\" : \"aws-iso-f\",\n    \"outputs\" : {\n      \"dnsSuffix\" : \"csp.hci.ic.gov\",\n      \"dualStackDnsSuffix\" : \"csp.hci.ic.gov\",\n      \"implicitGlobalRegion\" : \"us-isof-south-1\",\n      \"name\" : \"aws-iso-f\",\n      \"supportsDualStack\" : false,\n      \"supportsFIPS\" : true\n    },\n    \"regionRegex\" : \"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\",\n    \"regions\" : { }\n  } ],\n  \"version\" : \"1.1\"\n}"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go",
    "content": "package endpoints\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\nconst (\n\tdefaultProtocol = \"https\"\n\tdefaultSigner   = \"v4\"\n)\n\nvar (\n\tprotocolPriority = []string{\"https\", \"http\"}\n\tsignerPriority   = []string{\"v4\"}\n)\n\n// Options provide configuration needed to direct how endpoints are resolved.\ntype Options struct {\n\t// Disable usage of HTTPS (TLS / SSL)\n\tDisableHTTPS bool\n}\n\n// Partitions is a slice of partition\ntype Partitions []Partition\n\n// ResolveEndpoint resolves a service endpoint for the given region and options.\nfunc (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) {\n\tif len(ps) == 0 {\n\t\treturn aws.Endpoint{}, fmt.Errorf(\"no partitions found\")\n\t}\n\n\tfor i := 0; i < len(ps); i++ {\n\t\tif !ps[i].canResolveEndpoint(region) {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn ps[i].ResolveEndpoint(region, opts)\n\t}\n\n\t// fallback to first partition format to use when resolving the endpoint.\n\treturn ps[0].ResolveEndpoint(region, opts)\n}\n\n// Partition is an AWS partition description for a service and its' region endpoints.\ntype Partition struct {\n\tID                string\n\tRegionRegex       *regexp.Regexp\n\tPartitionEndpoint string\n\tIsRegionalized    bool\n\tDefaults          Endpoint\n\tEndpoints         Endpoints\n}\n\nfunc (p Partition) canResolveEndpoint(region string) bool {\n\t_, ok := p.Endpoints[region]\n\treturn ok || p.RegionRegex.MatchString(region)\n}\n\n// ResolveEndpoint resolves and service endpoint for the given region and options.\nfunc (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) {\n\tif len(region) == 0 && len(p.PartitionEndpoint) != 0 {\n\t\tregion = p.PartitionEndpoint\n\t}\n\n\te, _ := p.endpointForRegion(region)\n\n\treturn e.resolve(p.ID, region, p.Defaults, options), nil\n}\n\nfunc (p Partition) endpointForRegion(region string) (Endpoint, bool) {\n\tif e, ok := p.Endpoints[region]; ok {\n\t\treturn e, true\n\t}\n\n\tif !p.IsRegionalized {\n\t\treturn p.Endpoints[p.PartitionEndpoint], region == p.PartitionEndpoint\n\t}\n\n\t// Unable to find any matching endpoint, return\n\t// blank that will be used for generic endpoint creation.\n\treturn Endpoint{}, false\n}\n\n// Endpoints is a map of service config regions to endpoints\ntype Endpoints map[string]Endpoint\n\n// CredentialScope is the credential scope of a region and service\ntype CredentialScope struct {\n\tRegion  string\n\tService string\n}\n\n// Endpoint is a service endpoint description\ntype Endpoint struct {\n\t// True if the endpoint cannot be resolved for this partition/region/service\n\tUnresolveable aws.Ternary\n\n\tHostname  string\n\tProtocols []string\n\n\tCredentialScope CredentialScope\n\n\tSignatureVersions []string `json:\"signatureVersions\"`\n}\n\nfunc (e Endpoint) resolve(partition, region string, def Endpoint, options Options) aws.Endpoint {\n\tvar merged Endpoint\n\tmerged.mergeIn(def)\n\tmerged.mergeIn(e)\n\te = merged\n\n\tvar u string\n\tif e.Unresolveable != aws.TrueTernary {\n\t\t// Only attempt to resolve the endpoint if it can be resolved.\n\t\thostname := strings.Replace(e.Hostname, \"{region}\", region, 1)\n\n\t\tscheme := getEndpointScheme(e.Protocols, options.DisableHTTPS)\n\t\tu = scheme + \"://\" + hostname\n\t}\n\n\tsigningRegion := e.CredentialScope.Region\n\tif len(signingRegion) == 0 {\n\t\tsigningRegion = region\n\t}\n\tsigningName := e.CredentialScope.Service\n\n\treturn aws.Endpoint{\n\t\tURL:           u,\n\t\tPartitionID:   partition,\n\t\tSigningRegion: signingRegion,\n\t\tSigningName:   signingName,\n\t\tSigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),\n\t}\n}\n\nfunc (e *Endpoint) mergeIn(other Endpoint) {\n\tif other.Unresolveable != aws.UnknownTernary {\n\t\te.Unresolveable = other.Unresolveable\n\t}\n\tif len(other.Hostname) > 0 {\n\t\te.Hostname = other.Hostname\n\t}\n\tif len(other.Protocols) > 0 {\n\t\te.Protocols = other.Protocols\n\t}\n\tif len(other.CredentialScope.Region) > 0 {\n\t\te.CredentialScope.Region = other.CredentialScope.Region\n\t}\n\tif len(other.CredentialScope.Service) > 0 {\n\t\te.CredentialScope.Service = other.CredentialScope.Service\n\t}\n\tif len(other.SignatureVersions) > 0 {\n\t\te.SignatureVersions = other.SignatureVersions\n\t}\n}\n\nfunc getEndpointScheme(protocols []string, disableHTTPS bool) string {\n\tif disableHTTPS {\n\t\treturn \"http\"\n\t}\n\n\treturn getByPriority(protocols, protocolPriority, defaultProtocol)\n}\n\nfunc getByPriority(s []string, p []string, def string) string {\n\tif len(s) == 0 {\n\t\treturn def\n\t}\n\n\tfor i := 0; i < len(p); i++ {\n\t\tfor j := 0; j < len(s); j++ {\n\t\t\tif s[j] == p[i] {\n\t\t\t\treturn s[j]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s[0]\n}\n\n// MapFIPSRegion extracts the intrinsic AWS region from one that may have an\n// embedded FIPS microformat.\nfunc MapFIPSRegion(region string) string {\n\tconst fipsInfix = \"-fips-\"\n\tconst fipsPrefix = \"fips-\"\n\tconst fipsSuffix = \"-fips\"\n\n\tif strings.Contains(region, fipsInfix) ||\n\t\tstrings.Contains(region, fipsPrefix) ||\n\t\tstrings.Contains(region, fipsSuffix) {\n\t\tregion = strings.ReplaceAll(region, fipsInfix, \"-\")\n\t\tregion = strings.ReplaceAll(region, fipsPrefix, \"\")\n\t\tregion = strings.ReplaceAll(region, fipsSuffix, \"\")\n\t}\n\n\treturn region\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md",
    "content": "# v2.6.15 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.14 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.13 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.12 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.11 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.10 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.9 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.8 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.7 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.6 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.5 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.4 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.3 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.2 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.1 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.6.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.10 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.9 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.8 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.7 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.6 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.5 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.4 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.3 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.2 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.1 (2023-11-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.5.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.37 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.36 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.35 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.34 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.33 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.32 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.31 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.30 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.29 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.28 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.27 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.26 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.25 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.24 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.23 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.22 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.21 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.20 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.19 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.18 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.17 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.16 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.15 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.14 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.13 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.12 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.11 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.10 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.9 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.6 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.4.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.3.0 (2022-02-24)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.2.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.1.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.0.2 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.0.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v2.0.0 (2021-11-06)\n\n* **Release**: Endpoint Variant Model Support\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go",
    "content": "package endpoints\n\nimport (\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n)\n\n// DefaultKey is a compound map key of a variant and other values.\ntype DefaultKey struct {\n\tVariant        EndpointVariant\n\tServiceVariant ServiceVariant\n}\n\n// EndpointKey is a compound map key of a region and associated variant value.\ntype EndpointKey struct {\n\tRegion         string\n\tVariant        EndpointVariant\n\tServiceVariant ServiceVariant\n}\n\n// EndpointVariant is a bit field to describe the endpoints attributes.\ntype EndpointVariant uint64\n\nconst (\n\t// FIPSVariant indicates that the endpoint is FIPS capable.\n\tFIPSVariant EndpointVariant = 1 << (64 - 1 - iota)\n\n\t// DualStackVariant indicates that the endpoint is DualStack capable.\n\tDualStackVariant\n)\n\n// ServiceVariant is a bit field to describe the service endpoint attributes.\ntype ServiceVariant uint64\n\nconst (\n\tdefaultProtocol = \"https\"\n\tdefaultSigner   = \"v4\"\n)\n\nvar (\n\tprotocolPriority = []string{\"https\", \"http\"}\n\tsignerPriority   = []string{\"v4\", \"s3v4\"}\n)\n\n// Options provide configuration needed to direct how endpoints are resolved.\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is the resolved region string. If provided (non-zero length) it takes priority\n\t// over the region name passed to the ResolveEndpoint call.\n\tResolvedRegion string\n\n\t// Disable usage of HTTPS (TLS / SSL)\n\tDisableHTTPS bool\n\n\t// Instruct the resolver to use a service endpoint that supports dual-stack.\n\t// If a service does not have a dual-stack endpoint an error will be returned by the resolver.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// Instruct the resolver to use a service endpoint that supports FIPS.\n\t// If a service does not have a FIPS endpoint an error will be returned by the resolver.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n\n\t// ServiceVariant is a bitfield of service specified endpoint variant data.\n\tServiceVariant ServiceVariant\n}\n\n// GetEndpointVariant returns the EndpointVariant for the variant associated options.\nfunc (o Options) GetEndpointVariant() (v EndpointVariant) {\n\tif o.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {\n\t\tv |= DualStackVariant\n\t}\n\tif o.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled {\n\t\tv |= FIPSVariant\n\t}\n\treturn v\n}\n\n// Partitions is a slice of partition\ntype Partitions []Partition\n\n// ResolveEndpoint resolves a service endpoint for the given region and options.\nfunc (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) {\n\tif len(ps) == 0 {\n\t\treturn aws.Endpoint{}, fmt.Errorf(\"no partitions found\")\n\t}\n\n\tif opts.Logger == nil {\n\t\topts.Logger = logging.Nop{}\n\t}\n\n\tif len(opts.ResolvedRegion) > 0 {\n\t\tregion = opts.ResolvedRegion\n\t}\n\n\tfor i := 0; i < len(ps); i++ {\n\t\tif !ps[i].canResolveEndpoint(region, opts) {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn ps[i].ResolveEndpoint(region, opts)\n\t}\n\n\t// fallback to first partition format to use when resolving the endpoint.\n\treturn ps[0].ResolveEndpoint(region, opts)\n}\n\n// Partition is an AWS partition description for a service and its' region endpoints.\ntype Partition struct {\n\tID                string\n\tRegionRegex       *regexp.Regexp\n\tPartitionEndpoint string\n\tIsRegionalized    bool\n\tDefaults          map[DefaultKey]Endpoint\n\tEndpoints         Endpoints\n}\n\nfunc (p Partition) canResolveEndpoint(region string, opts Options) bool {\n\t_, ok := p.Endpoints[EndpointKey{\n\t\tRegion:  region,\n\t\tVariant: opts.GetEndpointVariant(),\n\t}]\n\treturn ok || p.RegionRegex.MatchString(region)\n}\n\n// ResolveEndpoint resolves and service endpoint for the given region and options.\nfunc (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) {\n\tif len(region) == 0 && len(p.PartitionEndpoint) != 0 {\n\t\tregion = p.PartitionEndpoint\n\t}\n\n\tendpoints := p.Endpoints\n\n\tvariant := options.GetEndpointVariant()\n\tserviceVariant := options.ServiceVariant\n\n\tdefaults := p.Defaults[DefaultKey{\n\t\tVariant:        variant,\n\t\tServiceVariant: serviceVariant,\n\t}]\n\n\treturn p.endpointForRegion(region, variant, serviceVariant, endpoints).resolve(p.ID, region, defaults, options)\n}\n\nfunc (p Partition) endpointForRegion(region string, variant EndpointVariant, serviceVariant ServiceVariant, endpoints Endpoints) Endpoint {\n\tkey := EndpointKey{\n\t\tRegion:  region,\n\t\tVariant: variant,\n\t}\n\n\tif e, ok := endpoints[key]; ok {\n\t\treturn e\n\t}\n\n\tif !p.IsRegionalized {\n\t\treturn endpoints[EndpointKey{\n\t\t\tRegion:         p.PartitionEndpoint,\n\t\t\tVariant:        variant,\n\t\t\tServiceVariant: serviceVariant,\n\t\t}]\n\t}\n\n\t// Unable to find any matching endpoint, return\n\t// blank that will be used for generic endpoint creation.\n\treturn Endpoint{}\n}\n\n// Endpoints is a map of service config regions to endpoints\ntype Endpoints map[EndpointKey]Endpoint\n\n// CredentialScope is the credential scope of a region and service\ntype CredentialScope struct {\n\tRegion  string\n\tService string\n}\n\n// Endpoint is a service endpoint description\ntype Endpoint struct {\n\t// True if the endpoint cannot be resolved for this partition/region/service\n\tUnresolveable aws.Ternary\n\n\tHostname  string\n\tProtocols []string\n\n\tCredentialScope CredentialScope\n\n\tSignatureVersions []string\n\n\t// Indicates that this endpoint is deprecated.\n\tDeprecated aws.Ternary\n}\n\n// IsZero returns whether the endpoint structure is an empty (zero) value.\nfunc (e Endpoint) IsZero() bool {\n\tswitch {\n\tcase e.Unresolveable != aws.UnknownTernary:\n\t\treturn false\n\tcase len(e.Hostname) != 0:\n\t\treturn false\n\tcase len(e.Protocols) != 0:\n\t\treturn false\n\tcase e.CredentialScope != (CredentialScope{}):\n\t\treturn false\n\tcase len(e.SignatureVersions) != 0:\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (e Endpoint) resolve(partition, region string, def Endpoint, options Options) (aws.Endpoint, error) {\n\tvar merged Endpoint\n\tmerged.mergeIn(def)\n\tmerged.mergeIn(e)\n\te = merged\n\n\tif e.IsZero() {\n\t\treturn aws.Endpoint{}, fmt.Errorf(\"unable to resolve endpoint for region: %v\", region)\n\t}\n\n\tvar u string\n\tif e.Unresolveable != aws.TrueTernary {\n\t\t// Only attempt to resolve the endpoint if it can be resolved.\n\t\thostname := strings.Replace(e.Hostname, \"{region}\", region, 1)\n\n\t\tscheme := getEndpointScheme(e.Protocols, options.DisableHTTPS)\n\t\tu = scheme + \"://\" + hostname\n\t}\n\n\tsigningRegion := e.CredentialScope.Region\n\tif len(signingRegion) == 0 {\n\t\tsigningRegion = region\n\t}\n\tsigningName := e.CredentialScope.Service\n\n\tif e.Deprecated == aws.TrueTernary && options.LogDeprecated {\n\t\toptions.Logger.Logf(logging.Warn, \"endpoint identifier %q, url %q marked as deprecated\", region, u)\n\t}\n\n\treturn aws.Endpoint{\n\t\tURL:           u,\n\t\tPartitionID:   partition,\n\t\tSigningRegion: signingRegion,\n\t\tSigningName:   signingName,\n\t\tSigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),\n\t}, nil\n}\n\nfunc (e *Endpoint) mergeIn(other Endpoint) {\n\tif other.Unresolveable != aws.UnknownTernary {\n\t\te.Unresolveable = other.Unresolveable\n\t}\n\tif len(other.Hostname) > 0 {\n\t\te.Hostname = other.Hostname\n\t}\n\tif len(other.Protocols) > 0 {\n\t\te.Protocols = other.Protocols\n\t}\n\tif len(other.CredentialScope.Region) > 0 {\n\t\te.CredentialScope.Region = other.CredentialScope.Region\n\t}\n\tif len(other.CredentialScope.Service) > 0 {\n\t\te.CredentialScope.Service = other.CredentialScope.Service\n\t}\n\tif len(other.SignatureVersions) > 0 {\n\t\te.SignatureVersions = other.SignatureVersions\n\t}\n\tif other.Deprecated != aws.UnknownTernary {\n\t\te.Deprecated = other.Deprecated\n\t}\n}\n\nfunc getEndpointScheme(protocols []string, disableHTTPS bool) string {\n\tif disableHTTPS {\n\t\treturn \"http\"\n\t}\n\n\treturn getByPriority(protocols, protocolPriority, defaultProtocol)\n}\n\nfunc getByPriority(s []string, p []string, def string) string {\n\tif len(s) == 0 {\n\t\treturn def\n\t}\n\n\tfor i := 0; i < len(p); i++ {\n\t\tfor j := 0; j < len(s); j++ {\n\t\t\tif s[j] == p[i] {\n\t\t\t\treturn s[j]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s[0]\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage endpoints\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"2.6.15\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md",
    "content": "# v1.8.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n\n# v1.7.3 (2024-01-22)\n\n* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons.\n\n# v1.7.2 (2023-12-08)\n\n* **Bug Fix**: Correct loading of [services *] sections into shared config.\n\n# v1.7.1 (2023-11-16)\n\n* **Bug Fix**: Fix recognition of trailing comments in shared config properties. # or ; separators that aren't preceded by whitespace at the end of a property value should be considered part of it.\n\n# v1.7.0 (2023-11-13)\n\n* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section.\n\n# v1.6.0 (2023-11-09.2)\n\n* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored\n\n# v1.5.2 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.1 (2023-11-07)\n\n* **Bug Fix**: Fix subproperty performance regression\n\n# v1.5.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.45 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.44 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.43 (2023-09-22)\n\n* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0.\n* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats.\n\n# v1.3.42 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.41 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.40 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.39 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.38 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.37 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.36 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.35 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.34 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.33 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.32 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.31 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.30 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.29 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.28 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.27 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.26 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.25 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.24 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.23 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.22 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.21 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.20 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.19 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.18 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.17 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.16 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.15 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.14 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.13 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.12 (2022-05-17)\n\n* **Bug Fix**: Removes the fuzz testing files from the module, as they are invalid and not used.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.11 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.10 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.9 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.8 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.7 (2022-03-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.6 (2022-02-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.5 (2022-01-28)\n\n* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug.\n\n# v1.3.4 (2022-01-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.3 (2022-01-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.5 (2021-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.4 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.3 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.2 (2021-08-27)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-08-04)\n\n* **Feature**: adds error handling for defered close calls\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.1 (2021-07-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.0 (2021-07-01)\n\n* **Feature**: Support for `:`, `=`, `[`, `]` being present in expression values.\n\n# v1.0.1 (2021-06-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.0.0 (2021-05-20)\n\n* **Release**: The `github.com/aws/aws-sdk-go-v2/internal/ini` package is now a Go Module.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go",
    "content": "package ini\n\nimport \"fmt\"\n\n// UnableToReadFile is an error indicating that a ini file could not be read\ntype UnableToReadFile struct {\n\tErr error\n}\n\n// Error returns an error message and the underlying error message if present\nfunc (e *UnableToReadFile) Error() string {\n\tbase := \"unable to read file\"\n\tif e.Err == nil {\n\t\treturn base\n\t}\n\treturn fmt.Sprintf(\"%s: %v\", base, e.Err)\n}\n\n// Unwrap returns the underlying error\nfunc (e *UnableToReadFile) Unwrap() error {\n\treturn e.Err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage ini\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.8.0\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go",
    "content": "// Package ini implements parsing of the AWS shared config file.\n//\n//\tExample:\n//\tsections, err := ini.OpenFile(\"/path/to/file\")\n//\tif err != nil {\n//\t\tpanic(err)\n//\t}\n//\n//\tprofile := \"foo\"\n//\tsection, ok := sections.GetSection(profile)\n//\tif !ok {\n//\t\tfmt.Printf(\"section %q could not be found\", profile)\n//\t}\npackage ini\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// OpenFile parses shared config from the given file path.\nfunc OpenFile(path string) (sections Sections, err error) {\n\tf, oerr := os.Open(path)\n\tif oerr != nil {\n\t\treturn Sections{}, &UnableToReadFile{Err: oerr}\n\t}\n\n\tdefer func() {\n\t\tcloseErr := f.Close()\n\t\tif err == nil {\n\t\t\terr = closeErr\n\t\t} else if closeErr != nil {\n\t\t\terr = fmt.Errorf(\"close error: %v, original error: %w\", closeErr, err)\n\t\t}\n\t}()\n\n\treturn Parse(f, path)\n}\n\n// Parse parses shared config from the given reader.\nfunc Parse(r io.Reader, path string) (Sections, error) {\n\tcontents, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn Sections{}, fmt.Errorf(\"read all: %v\", err)\n\t}\n\n\tlines := strings.Split(string(contents), \"\\n\")\n\ttokens, err := tokenize(lines)\n\tif err != nil {\n\t\treturn Sections{}, fmt.Errorf(\"tokenize: %v\", err)\n\t}\n\n\treturn parse(tokens, path), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go",
    "content": "package ini\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc parse(tokens []lineToken, path string) Sections {\n\tparser := &parser{\n\t\tpath:     path,\n\t\tsections: NewSections(),\n\t}\n\tparser.parse(tokens)\n\treturn parser.sections\n}\n\ntype parser struct {\n\tcsection, ckey string   // current state\n\tpath           string   // source file path\n\tsections       Sections // parse result\n}\n\nfunc (p *parser) parse(tokens []lineToken) {\n\tfor _, otok := range tokens {\n\t\tswitch tok := otok.(type) {\n\t\tcase *lineTokenProfile:\n\t\t\tp.handleProfile(tok)\n\t\tcase *lineTokenProperty:\n\t\t\tp.handleProperty(tok)\n\t\tcase *lineTokenSubProperty:\n\t\t\tp.handleSubProperty(tok)\n\t\tcase *lineTokenContinuation:\n\t\t\tp.handleContinuation(tok)\n\t\t}\n\t}\n}\n\nfunc (p *parser) handleProfile(tok *lineTokenProfile) {\n\tname := tok.Name\n\tif tok.Type != \"\" {\n\t\tname = fmt.Sprintf(\"%s %s\", tok.Type, tok.Name)\n\t}\n\tp.ckey = \"\"\n\tp.csection = name\n\tif _, ok := p.sections.container[name]; !ok {\n\t\tp.sections.container[name] = NewSection(name)\n\t}\n}\n\nfunc (p *parser) handleProperty(tok *lineTokenProperty) {\n\tif p.csection == \"\" {\n\t\treturn // LEGACY: don't error on \"global\" properties\n\t}\n\n\tp.ckey = tok.Key\n\tif _, ok := p.sections.container[p.csection].values[tok.Key]; ok {\n\t\tsection := p.sections.container[p.csection]\n\t\tsection.Logs = append(p.sections.container[p.csection].Logs,\n\t\t\tfmt.Sprintf(\n\t\t\t\t\"For profile: %v, overriding %v value, with a %v value found in a duplicate profile defined later in the same file %v. \\n\",\n\t\t\t\tp.csection, tok.Key, tok.Key, p.path,\n\t\t\t),\n\t\t)\n\t\tp.sections.container[p.csection] = section\n\t}\n\n\tp.sections.container[p.csection].values[tok.Key] = Value{\n\t\tstr: tok.Value,\n\t}\n\tp.sections.container[p.csection].SourceFile[tok.Key] = p.path\n}\n\nfunc (p *parser) handleSubProperty(tok *lineTokenSubProperty) {\n\tif p.csection == \"\" {\n\t\treturn // LEGACY: don't error on \"global\" properties\n\t}\n\n\tif p.ckey == \"\" || p.sections.container[p.csection].values[p.ckey].str != \"\" {\n\t\t// This is an \"orphaned\" subproperty, either because it's at\n\t\t// the beginning of a section or because the last property's\n\t\t// value isn't empty. Either way we're lenient here and\n\t\t// \"promote\" this to a normal property.\n\t\tp.handleProperty(&lineTokenProperty{\n\t\t\tKey:   tok.Key,\n\t\t\tValue: strings.TrimSpace(trimPropertyComment(tok.Value)),\n\t\t})\n\t\treturn\n\t}\n\n\tif p.sections.container[p.csection].values[p.ckey].mp == nil {\n\t\tp.sections.container[p.csection].values[p.ckey] = Value{\n\t\t\tmp: map[string]string{},\n\t\t}\n\t}\n\tp.sections.container[p.csection].values[p.ckey].mp[tok.Key] = tok.Value\n}\n\nfunc (p *parser) handleContinuation(tok *lineTokenContinuation) {\n\tif p.ckey == \"\" {\n\t\treturn\n\t}\n\n\tvalue, _ := p.sections.container[p.csection].values[p.ckey]\n\tif value.str != \"\" && value.mp == nil {\n\t\tvalue.str = fmt.Sprintf(\"%s\\n%s\", value.str, tok.Value)\n\t}\n\n\tp.sections.container[p.csection].values[p.ckey] = value\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go",
    "content": "package ini\n\nimport (\n\t\"sort\"\n)\n\n// Sections is a map of Section structures that represent\n// a configuration.\ntype Sections struct {\n\tcontainer map[string]Section\n}\n\n// NewSections returns empty ini Sections\nfunc NewSections() Sections {\n\treturn Sections{\n\t\tcontainer: make(map[string]Section, 0),\n\t}\n}\n\n// GetSection will return section p. If section p does not exist,\n// false will be returned in the second parameter.\nfunc (t Sections) GetSection(p string) (Section, bool) {\n\tv, ok := t.container[p]\n\treturn v, ok\n}\n\n// HasSection denotes if Sections consist of a section with\n// provided name.\nfunc (t Sections) HasSection(p string) bool {\n\t_, ok := t.container[p]\n\treturn ok\n}\n\n// SetSection sets a section value for provided section name.\nfunc (t Sections) SetSection(p string, v Section) Sections {\n\tt.container[p] = v\n\treturn t\n}\n\n// DeleteSection deletes a section entry/value for provided section name./\nfunc (t Sections) DeleteSection(p string) {\n\tdelete(t.container, p)\n}\n\n// values represents a map of union values.\ntype values map[string]Value\n\n// List will return a list of all sections that were successfully\n// parsed.\nfunc (t Sections) List() []string {\n\tkeys := make([]string, len(t.container))\n\ti := 0\n\tfor k := range t.container {\n\t\tkeys[i] = k\n\t\ti++\n\t}\n\n\tsort.Strings(keys)\n\treturn keys\n}\n\n// Section contains a name and values. This represent\n// a sectioned entry in a configuration file.\ntype Section struct {\n\t// Name is the Section profile name\n\tName string\n\n\t// values are the values within parsed profile\n\tvalues values\n\n\t// Errors is the list of errors\n\tErrors []error\n\n\t// Logs is the list of logs\n\tLogs []string\n\n\t// SourceFile is the INI Source file from where this section\n\t// was retrieved. They key is the property, value is the\n\t// source file the property was retrieved from.\n\tSourceFile map[string]string\n}\n\n// NewSection returns an initialize section for the name\nfunc NewSection(name string) Section {\n\treturn Section{\n\t\tName:       name,\n\t\tvalues:     values{},\n\t\tSourceFile: map[string]string{},\n\t}\n}\n\n// List will return a list of all\n// services in values\nfunc (t Section) List() []string {\n\tkeys := make([]string, len(t.values))\n\ti := 0\n\tfor k := range t.values {\n\t\tkeys[i] = k\n\t\ti++\n\t}\n\n\tsort.Strings(keys)\n\treturn keys\n}\n\n// UpdateSourceFile updates source file for a property to provided filepath.\nfunc (t Section) UpdateSourceFile(property string, filepath string) {\n\tt.SourceFile[property] = filepath\n}\n\n// UpdateValue updates value for a provided key with provided value\nfunc (t Section) UpdateValue(k string, v Value) error {\n\tt.values[k] = v\n\treturn nil\n}\n\n// Has will return whether or not an entry exists in a given section\nfunc (t Section) Has(k string) bool {\n\t_, ok := t.values[k]\n\treturn ok\n}\n\n// ValueType will returned what type the union is set to. If\n// k was not found, the NoneType will be returned.\nfunc (t Section) ValueType(k string) (ValueType, bool) {\n\tv, ok := t.values[k]\n\treturn v.Type, ok\n}\n\n// Bool returns a bool value at k\nfunc (t Section) Bool(k string) (bool, bool) {\n\treturn t.values[k].BoolValue()\n}\n\n// Int returns an integer value at k\nfunc (t Section) Int(k string) (int64, bool) {\n\treturn t.values[k].IntValue()\n}\n\n// Map returns a map value at k\nfunc (t Section) Map(k string) map[string]string {\n\treturn t.values[k].MapValue()\n}\n\n// Float64 returns a float value at k\nfunc (t Section) Float64(k string) (float64, bool) {\n\treturn t.values[k].FloatValue()\n}\n\n// String returns the string value at k\nfunc (t Section) String(k string) string {\n\t_, ok := t.values[k]\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn t.values[k].StringValue()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go",
    "content": "package ini\n\nimport (\n\t\"strings\"\n)\n\nfunc trimProfileComment(s string) string {\n\tr, _, _ := strings.Cut(s, \"#\")\n\tr, _, _ = strings.Cut(r, \";\")\n\treturn r\n}\n\nfunc trimPropertyComment(s string) string {\n\tr, _, _ := strings.Cut(s, \" #\")\n\tr, _, _ = strings.Cut(r, \" ;\")\n\tr, _, _ = strings.Cut(r, \"\\t#\")\n\tr, _, _ = strings.Cut(r, \"\\t;\")\n\treturn r\n}\n\n// assumes no surrounding comment\nfunc splitProperty(s string) (string, string, bool) {\n\tequalsi := strings.Index(s, \"=\")\n\tcoloni := strings.Index(s, \":\") // LEGACY: also supported for property assignment\n\tsep := \"=\"\n\tif equalsi == -1 || coloni != -1 && coloni < equalsi {\n\t\tsep = \":\"\n\t}\n\n\tk, v, ok := strings.Cut(s, sep)\n\tif !ok {\n\t\treturn \"\", \"\", false\n\t}\n\treturn strings.TrimSpace(k), strings.TrimSpace(v), true\n}\n\n// assumes no surrounding comment, whitespace, or profile brackets\nfunc splitProfile(s string) (string, string) {\n\tvar first int\n\tfor i, r := range s {\n\t\tif isLineSpace(r) {\n\t\t\tif first == 0 {\n\t\t\t\tfirst = i\n\t\t\t}\n\t\t} else {\n\t\t\tif first != 0 {\n\t\t\t\treturn s[:first], s[i:]\n\t\t\t}\n\t\t}\n\t}\n\tif first == 0 {\n\t\treturn \"\", s // type component is effectively blank\n\t}\n\treturn \"\", \"\"\n}\n\nfunc isLineSpace(r rune) bool {\n\treturn r == ' ' || r == '\\t'\n}\n\nfunc unquote(s string) string {\n\tif isSingleQuoted(s) || isDoubleQuoted(s) {\n\t\treturn s[1 : len(s)-1]\n\t}\n\treturn s\n}\n\n// applies various legacy conversions to property values:\n//   - remote wrapping single/doublequotes\nfunc legacyStrconv(s string) string {\n\ts = unquote(s)\n\treturn s\n}\n\nfunc isSingleQuoted(s string) bool {\n\treturn hasAffixes(s, \"'\", \"'\")\n}\n\nfunc isDoubleQuoted(s string) bool {\n\treturn hasAffixes(s, `\"`, `\"`)\n}\n\nfunc isBracketed(s string) bool {\n\treturn hasAffixes(s, \"[\", \"]\")\n}\n\nfunc hasAffixes(s, left, right string) bool {\n\treturn strings.HasPrefix(s, left) && strings.HasSuffix(s, right)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go",
    "content": "package ini\n\ntype lineToken interface {\n\tisLineToken()\n}\n\ntype lineTokenProfile struct {\n\tType string\n\tName string\n}\n\nfunc (*lineTokenProfile) isLineToken() {}\n\ntype lineTokenProperty struct {\n\tKey   string\n\tValue string\n}\n\nfunc (*lineTokenProperty) isLineToken() {}\n\ntype lineTokenContinuation struct {\n\tValue string\n}\n\nfunc (*lineTokenContinuation) isLineToken() {}\n\ntype lineTokenSubProperty struct {\n\tKey   string\n\tValue string\n}\n\nfunc (*lineTokenSubProperty) isLineToken() {}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go",
    "content": "package ini\n\nimport (\n\t\"strings\"\n)\n\nfunc tokenize(lines []string) ([]lineToken, error) {\n\ttokens := make([]lineToken, 0, len(lines))\n\tfor _, line := range lines {\n\t\tif len(strings.TrimSpace(line)) == 0 || isLineComment(line) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif tok := asProfile(line); tok != nil {\n\t\t\ttokens = append(tokens, tok)\n\t\t} else if tok := asProperty(line); tok != nil {\n\t\t\ttokens = append(tokens, tok)\n\t\t} else if tok := asSubProperty(line); tok != nil {\n\t\t\ttokens = append(tokens, tok)\n\t\t} else if tok := asContinuation(line); tok != nil {\n\t\t\ttokens = append(tokens, tok)\n\t\t} // unrecognized tokens are effectively ignored\n\t}\n\treturn tokens, nil\n}\n\nfunc isLineComment(line string) bool {\n\ttrimmed := strings.TrimLeft(line, \" \\t\")\n\treturn strings.HasPrefix(trimmed, \"#\") || strings.HasPrefix(trimmed, \";\")\n}\n\nfunc asProfile(line string) *lineTokenProfile { // \" [ type name ] ; comment\"\n\ttrimmed := strings.TrimSpace(trimProfileComment(line)) // \"[ type name ]\"\n\tif !isBracketed(trimmed) {\n\t\treturn nil\n\t}\n\ttrimmed = trimmed[1 : len(trimmed)-1] // \" type name \" (or just \" name \")\n\ttrimmed = strings.TrimSpace(trimmed)  // \"type name\" / \"name\"\n\ttyp, name := splitProfile(trimmed)\n\treturn &lineTokenProfile{\n\t\tType: typ,\n\t\tName: name,\n\t}\n}\n\nfunc asProperty(line string) *lineTokenProperty {\n\tif isLineSpace(rune(line[0])) {\n\t\treturn nil\n\t}\n\n\ttrimmed := trimPropertyComment(line)\n\ttrimmed = strings.TrimRight(trimmed, \" \\t\")\n\tk, v, ok := splitProperty(trimmed)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn &lineTokenProperty{\n\t\tKey:   strings.ToLower(k), // LEGACY: normalize key case\n\t\tValue: legacyStrconv(v),   // LEGACY: see func docs\n\t}\n}\n\nfunc asSubProperty(line string) *lineTokenSubProperty {\n\tif !isLineSpace(rune(line[0])) {\n\t\treturn nil\n\t}\n\n\t// comments on sub-properties are included in the value\n\ttrimmed := strings.TrimLeft(line, \" \\t\")\n\tk, v, ok := splitProperty(trimmed)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn &lineTokenSubProperty{ // same LEGACY constraints as in normal property\n\t\tKey:   strings.ToLower(k),\n\t\tValue: legacyStrconv(v),\n\t}\n}\n\nfunc asContinuation(line string) *lineTokenContinuation {\n\tif !isLineSpace(rune(line[0])) {\n\t\treturn nil\n\t}\n\n\t// includes comments like sub-properties\n\ttrimmed := strings.TrimLeft(line, \" \\t\")\n\treturn &lineTokenContinuation{\n\t\tValue: trimmed,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go",
    "content": "package ini\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// ValueType is an enum that will signify what type\n// the Value is\ntype ValueType int\n\nfunc (v ValueType) String() string {\n\tswitch v {\n\tcase NoneType:\n\t\treturn \"NONE\"\n\tcase StringType:\n\t\treturn \"STRING\"\n\t}\n\n\treturn \"\"\n}\n\n// ValueType enums\nconst (\n\tNoneType = ValueType(iota)\n\tStringType\n\tQuotedStringType\n)\n\n// Value is a union container\ntype Value struct {\n\tType ValueType\n\n\tstr string\n\tmp  map[string]string\n}\n\n// NewStringValue returns a Value type generated using a string input.\nfunc NewStringValue(str string) (Value, error) {\n\treturn Value{str: str}, nil\n}\n\nfunc (v Value) String() string {\n\tswitch v.Type {\n\tcase StringType:\n\t\treturn fmt.Sprintf(\"string: %s\", string(v.str))\n\tcase QuotedStringType:\n\t\treturn fmt.Sprintf(\"quoted string: %s\", string(v.str))\n\tdefault:\n\t\treturn \"union not set\"\n\t}\n}\n\n// MapValue returns a map value for sub properties\nfunc (v Value) MapValue() map[string]string {\n\treturn v.mp\n}\n\n// IntValue returns an integer value\nfunc (v Value) IntValue() (int64, bool) {\n\ti, err := strconv.ParseInt(string(v.str), 0, 64)\n\tif err != nil {\n\t\treturn 0, false\n\t}\n\treturn i, true\n}\n\n// FloatValue returns a float value\nfunc (v Value) FloatValue() (float64, bool) {\n\tf, err := strconv.ParseFloat(string(v.str), 64)\n\tif err != nil {\n\t\treturn 0, false\n\t}\n\treturn f, true\n}\n\n// BoolValue returns a bool value\nfunc (v Value) BoolValue() (bool, bool) {\n\t// we don't use ParseBool as it recognizes more than what we've\n\t// historically supported\n\tif strings.EqualFold(v.str, \"true\") {\n\t\treturn true, true\n\t} else if strings.EqualFold(v.str, \"false\") {\n\t\treturn false, true\n\t}\n\treturn false, false\n}\n\n// StringValue returns the string value\nfunc (v Value) StringValue() string {\n\treturn v.str\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\tinternalcontext \"github.com/aws/aws-sdk-go-v2/internal/context\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// AddTimeOffsetMiddleware sets a value representing clock skew on the request context.\n// This can be read by other operations (such as signing) to correct the date value they send\n// on the request\ntype AddTimeOffsetMiddleware struct {\n\tOffset *atomic.Int64\n}\n\n// ID the identifier for AddTimeOffsetMiddleware\nfunc (m *AddTimeOffsetMiddleware) ID() string { return \"AddTimeOffsetMiddleware\" }\n\n// HandleBuild sets a value for attemptSkew on the request context if one is set on the client.\nfunc (m AddTimeOffsetMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.Offset != nil {\n\t\toffset := time.Duration(m.Offset.Load())\n\t\tctx = internalcontext.SetAttemptSkewContext(ctx, offset)\n\t}\n\treturn next.HandleBuild(ctx, in)\n}\n\n// HandleDeserialize gets the clock skew context from the context, and if set, sets it on the pointer\n// held by AddTimeOffsetMiddleware\nfunc (m *AddTimeOffsetMiddleware) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif v := internalcontext.GetAttemptSkewContext(ctx); v != 0 {\n\t\tm.Offset.Store(v.Nanoseconds())\n\t}\n\treturn next.HandleDeserialize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go",
    "content": "package rand\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n)\n\nfunc init() {\n\tReader = rand.Reader\n}\n\n// Reader provides a random reader that can reset during testing.\nvar Reader io.Reader\n\nvar floatMaxBigInt = big.NewInt(1 << 53)\n\n// Float64 returns a float64 read from an io.Reader source. The returned float will be between [0.0, 1.0).\nfunc Float64(reader io.Reader) (float64, error) {\n\tbi, err := rand.Int(reader, floatMaxBigInt)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to read random value, %v\", err)\n\t}\n\n\treturn float64(bi.Int64()) / (1 << 53), nil\n}\n\n// CryptoRandFloat64 returns a random float64 obtained from the crypto rand\n// source.\nfunc CryptoRandFloat64() (float64, error) {\n\treturn Float64(Reader)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.go",
    "content": "package sdk\n\n// Invalidator provides access to a type's invalidate method to make it\n// invalidate it cache.\n//\n// e.g aws.SafeCredentialsProvider's Invalidate method.\ntype Invalidator interface {\n\tInvalidate()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.go",
    "content": "package sdk\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\nfunc init() {\n\tNowTime = time.Now\n\tSleep = time.Sleep\n\tSleepWithContext = sleepWithContext\n}\n\n// NowTime is a value for getting the current time. This value can be overridden\n// for testing mocking out current time.\nvar NowTime func() time.Time\n\n// Sleep is a value for sleeping for a duration. This value can be overridden\n// for testing and mocking out sleep duration.\nvar Sleep func(time.Duration)\n\n// SleepWithContext will wait for the timer duration to expire, or the context\n// is canceled. Which ever happens first. If the context is canceled the Context's\n// error will be returned.\n//\n// This value can be overridden for testing and mocking out sleep duration.\nvar SleepWithContext func(context.Context, time.Duration) error\n\n// sleepWithContext will wait for the timer duration to expire, or the context\n// is canceled. Which ever happens first. If the context is canceled the\n// Context's error will be returned.\nfunc sleepWithContext(ctx context.Context, dur time.Duration) error {\n\tt := time.NewTimer(dur)\n\tdefer t.Stop()\n\n\tselect {\n\tcase <-t.C:\n\t\tbreak\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n\n\treturn nil\n}\n\n// noOpSleepWithContext does nothing, returns immediately.\nfunc noOpSleepWithContext(context.Context, time.Duration) error {\n\treturn nil\n}\n\nfunc noOpSleep(time.Duration) {}\n\n// TestingUseNopSleep is a utility for disabling sleep across the SDK for\n// testing.\nfunc TestingUseNopSleep() func() {\n\tSleepWithContext = noOpSleepWithContext\n\tSleep = noOpSleep\n\n\treturn func() {\n\t\tSleepWithContext = sleepWithContext\n\t\tSleep = time.Sleep\n\t}\n}\n\n// TestingUseReferenceTime is a utility for swapping the time function across the SDK to return a specific reference time\n// for testing purposes.\nfunc TestingUseReferenceTime(referenceTime time.Time) func() {\n\tNowTime = func() time.Time {\n\t\treturn referenceTime\n\t}\n\treturn func() {\n\t\tNowTime = time.Now\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.go",
    "content": "package sdkio\n\nconst (\n\t// Byte is 8 bits\n\tByte int64 = 1\n\t// KibiByte (KiB) is 1024 Bytes\n\tKibiByte = Byte * 1024\n\t// MebiByte (MiB) is 1024 KiB\n\tMebiByte = KibiByte * 1024\n\t// GibiByte (GiB) is 1024 MiB\n\tGibiByte = MebiByte * 1024\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go",
    "content": "package shareddefaults\n\nimport (\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n)\n\n// SharedCredentialsFilename returns the SDK's default file path\n// for the shared credentials file.\n//\n// Builds the shared config file path based on the OS's platform.\n//\n//   - Linux/Unix: $HOME/.aws/credentials\n//   - Windows: %USERPROFILE%\\.aws\\credentials\nfunc SharedCredentialsFilename() string {\n\treturn filepath.Join(UserHomeDir(), \".aws\", \"credentials\")\n}\n\n// SharedConfigFilename returns the SDK's default file path for\n// the shared config file.\n//\n// Builds the shared config file path based on the OS's platform.\n//\n//   - Linux/Unix: $HOME/.aws/config\n//   - Windows: %USERPROFILE%\\.aws\\config\nfunc SharedConfigFilename() string {\n\treturn filepath.Join(UserHomeDir(), \".aws\", \"config\")\n}\n\n// UserHomeDir returns the home directory for the user the process is\n// running under.\nfunc UserHomeDir() string {\n\t// Ignore errors since we only care about Windows and *nix.\n\thome, _ := os.UserHomeDir()\n\n\tif len(home) > 0 {\n\t\treturn home\n\t}\n\n\tcurrUser, _ := user.Current()\n\tif currUser != nil {\n\t\thome = currUser.HomeDir\n\t}\n\n\treturn home\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.go",
    "content": "package strings\n\nimport (\n\t\"strings\"\n)\n\n// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings,\n// under Unicode case-folding.\nfunc HasPrefixFold(s, prefix string) bool {\n\treturn len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go",
    "content": "// Package singleflight provides a duplicate function call suppression\n// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight\n// package. The package is forked, because the package a part of the unstable\n// and unversioned golang.org/x/sync module.\n//\n// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight\npackage singleflight\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage singleflight\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"sync\"\n)\n\n// errGoexit indicates the runtime.Goexit was called in\n// the user given function.\nvar errGoexit = errors.New(\"runtime.Goexit was called\")\n\n// A panicError is an arbitrary value recovered from a panic\n// with the stack trace during the execution of given function.\ntype panicError struct {\n\tvalue interface{}\n\tstack []byte\n}\n\n// Error implements error interface.\nfunc (p *panicError) Error() string {\n\treturn fmt.Sprintf(\"%v\\n\\n%s\", p.value, p.stack)\n}\n\nfunc newPanicError(v interface{}) error {\n\tstack := debug.Stack()\n\n\t// The first line of the stack trace is of the form \"goroutine N [status]:\"\n\t// but by the time the panic reaches Do the goroutine may no longer exist\n\t// and its status will have changed. Trim out the misleading line.\n\tif line := bytes.IndexByte(stack[:], '\\n'); line >= 0 {\n\t\tstack = stack[line+1:]\n\t}\n\treturn &panicError{value: v, stack: stack}\n}\n\n// call is an in-flight or completed singleflight.Do call\ntype call struct {\n\twg sync.WaitGroup\n\n\t// These fields are written once before the WaitGroup is done\n\t// and are only read after the WaitGroup is done.\n\tval interface{}\n\terr error\n\n\t// forgotten indicates whether Forget was called with this call's key\n\t// while the call was still in flight.\n\tforgotten bool\n\n\t// These fields are read and written with the singleflight\n\t// mutex held before the WaitGroup is done, and are read but\n\t// not written after the WaitGroup is done.\n\tdups  int\n\tchans []chan<- Result\n}\n\n// Group represents a class of work and forms a namespace in\n// which units of work can be executed with duplicate suppression.\ntype Group struct {\n\tmu sync.Mutex       // protects m\n\tm  map[string]*call // lazily initialized\n}\n\n// Result holds the results of Do, so they can be passed\n// on a channel.\ntype Result struct {\n\tVal    interface{}\n\tErr    error\n\tShared bool\n}\n\n// Do executes and returns the results of the given function, making\n// sure that only one execution is in-flight for a given key at a\n// time. If a duplicate comes in, the duplicate caller waits for the\n// original to complete and receives the same results.\n// The return value shared indicates whether v was given to multiple callers.\nfunc (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) {\n\tg.mu.Lock()\n\tif g.m == nil {\n\t\tg.m = make(map[string]*call)\n\t}\n\tif c, ok := g.m[key]; ok {\n\t\tc.dups++\n\t\tg.mu.Unlock()\n\t\tc.wg.Wait()\n\n\t\tif e, ok := c.err.(*panicError); ok {\n\t\t\tpanic(e)\n\t\t} else if c.err == errGoexit {\n\t\t\truntime.Goexit()\n\t\t}\n\t\treturn c.val, c.err, true\n\t}\n\tc := new(call)\n\tc.wg.Add(1)\n\tg.m[key] = c\n\tg.mu.Unlock()\n\n\tg.doCall(c, key, fn)\n\treturn c.val, c.err, c.dups > 0\n}\n\n// DoChan is like Do but returns a channel that will receive the\n// results when they are ready.\n//\n// The returned channel will not be closed.\nfunc (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result {\n\tch := make(chan Result, 1)\n\tg.mu.Lock()\n\tif g.m == nil {\n\t\tg.m = make(map[string]*call)\n\t}\n\tif c, ok := g.m[key]; ok {\n\t\tc.dups++\n\t\tc.chans = append(c.chans, ch)\n\t\tg.mu.Unlock()\n\t\treturn ch\n\t}\n\tc := &call{chans: []chan<- Result{ch}}\n\tc.wg.Add(1)\n\tg.m[key] = c\n\tg.mu.Unlock()\n\n\tgo g.doCall(c, key, fn)\n\n\treturn ch\n}\n\n// doCall handles the single call for a key.\nfunc (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) {\n\tnormalReturn := false\n\trecovered := false\n\n\t// use double-defer to distinguish panic from runtime.Goexit,\n\t// more details see https://golang.org/cl/134395\n\tdefer func() {\n\t\t// the given function invoked runtime.Goexit\n\t\tif !normalReturn && !recovered {\n\t\t\tc.err = errGoexit\n\t\t}\n\n\t\tc.wg.Done()\n\t\tg.mu.Lock()\n\t\tdefer g.mu.Unlock()\n\t\tif !c.forgotten {\n\t\t\tdelete(g.m, key)\n\t\t}\n\n\t\tif e, ok := c.err.(*panicError); ok {\n\t\t\t// In order to prevent the waiting channels from being blocked forever,\n\t\t\t// needs to ensure that this panic cannot be recovered.\n\t\t\tif len(c.chans) > 0 {\n\t\t\t\tgo panic(e)\n\t\t\t\tselect {} // Keep this goroutine around so that it will appear in the crash dump.\n\t\t\t} else {\n\t\t\t\tpanic(e)\n\t\t\t}\n\t\t} else if c.err == errGoexit {\n\t\t\t// Already in the process of goexit, no need to call again\n\t\t} else {\n\t\t\t// Normal return\n\t\t\tfor _, ch := range c.chans {\n\t\t\t\tch <- Result{c.val, c.err, c.dups > 0}\n\t\t\t}\n\t\t}\n\t}()\n\n\tfunc() {\n\t\tdefer func() {\n\t\t\tif !normalReturn {\n\t\t\t\t// Ideally, we would wait to take a stack trace until we've determined\n\t\t\t\t// whether this is a panic or a runtime.Goexit.\n\t\t\t\t//\n\t\t\t\t// Unfortunately, the only way we can distinguish the two is to see\n\t\t\t\t// whether the recover stopped the goroutine from terminating, and by\n\t\t\t\t// the time we know that, the part of the stack trace relevant to the\n\t\t\t\t// panic has been discarded.\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\tc.err = newPanicError(r)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\tc.val, c.err = fn()\n\t\tnormalReturn = true\n\t}()\n\n\tif !normalReturn {\n\t\trecovered = true\n\t}\n}\n\n// Forget tells the singleflight to forget about a key.  Future calls\n// to Do for this key will call the function rather than waiting for\n// an earlier call to complete.\nfunc (g *Group) Forget(key string) {\n\tg.mu.Lock()\n\tif c, ok := g.m[key]; ok {\n\t\tc.forgotten = true\n\t}\n\tdelete(g.m, key)\n\tg.mu.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.go",
    "content": "package timeconv\n\nimport \"time\"\n\n// FloatSecondsDur converts a fractional seconds to duration.\nfunc FloatSecondsDur(v float64) time.Duration {\n\treturn time.Duration(v * float64(time.Second))\n}\n\n// DurSecondsFloat converts a duration into fractional seconds.\nfunc DurSecondsFloat(d time.Duration) float64 {\n\treturn float64(d) / float64(time.Second)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/CHANGELOG.md",
    "content": "# v1.18.11 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.18.10 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.9 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.18.8 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.7 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.6 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.5 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n\n# v1.18.4 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.3 (2023-02-15)\n\n* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.\n* **Bug Fix**: Correct error type parsing for restJson services.\n\n# v1.18.2 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.1 (2023-01-23)\n\n* No change notes available for this release.\n\n# v1.18.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.17.25 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.24 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.23 (2022-11-22)\n\n* No change notes available for this release.\n\n# v1.17.22 (2022-11-16)\n\n* No change notes available for this release.\n\n# v1.17.21 (2022-11-10)\n\n* No change notes available for this release.\n\n# v1.17.20 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.19 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.18 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.17 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.16 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.15 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.14 (2022-08-30)\n\n* No change notes available for this release.\n\n# v1.17.13 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.12 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.11 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.10 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.9 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.6 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2022-03-21)\n\n* **Feature**: This release includes a fix in the DescribeImageScanFindings paginated output.\n\n# v1.16.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Feature**: Updated service client model to latest release.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2021-12-21)\n\n* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens.\n* **Feature**: Updated to latest service endpoints\n\n# v1.11.1 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2021-11-30)\n\n* **Feature**: API client updated\n\n# v1.10.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2021-11-12)\n\n* **Feature**: Service clients now support custom endpoints that have an initial URI path defined.\n* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature.\n\n# v1.9.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Feature**: Updated service to latest API model.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-10-21)\n\n* **Feature**: API client updated\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.1 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-09-24)\n\n* **Feature**: API client updated\n\n# v1.6.0 (2021-09-17)\n\n* **Feature**: Updated API client and endpoints to latest revision.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nconst ServiceID = \"ECR\"\nconst ServiceAPIVersion = \"2015-09-21\"\n\n// Client provides the API client to make operations call for Amazon EC2 Container\n// Registry.\ntype Client struct {\n\toptions Options\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveDefaultEndpointConfiguration(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\treturn client\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\tEndpointResolver EndpointResolver\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts. When creating a new API Clients this\n\t// member will only be used if the Retryer Options member is nil. This value will\n\t// be ignored if Retryer is not nil. If specified in an operation call's functional\n\t// options with a value that is different than the constructed client's Options,\n\t// the Client's Retryer will be wrapped to use the operation's specific\n\t// RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified. When creating a new API Clients this\n\t// member will only be used if the Retryer Options member is nil. This value will\n\t// be ignored if Retryer is not nil. Currently does not support per operation call\n\t// overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time. Currently does not support per operation call\n\t// overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// WithEndpointResolver returns a functional option for setting the Client's\n// EndpointResolver option.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttemptOptions(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:             cfg.Region,\n\t\tDefaultsMode:       cfg.DefaultsMode,\n\t\tRuntimeEnvironment: cfg.RuntimeEnvironment,\n\t\tHTTPClient:         cfg.HTTPClient,\n\t\tCredentials:        cfg.Credentials,\n\t\tAPIOptions:         cfg.APIOptions,\n\t\tLogger:             cfg.Logger,\n\t\tClientLogMode:      cfg.ClientLogMode,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttemptOptions(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())\n}\n\nfunc addClientUserAgent(stack *middleware.Stack) error {\n\treturn awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"ecr\", goModuleVersion)(stack)\n}\n\nfunc addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {\n\tmw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{\n\t\tCredentialsProvider: o.Credentials,\n\t\tSigner:              o.HTTPSignerV4,\n\t\tLogSigning:          o.ClientLogMode.IsSigning(),\n\t})\n\treturn stack.Finalize.Add(mw, middleware.After)\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc addRetryMiddlewares(stack *middleware.Stack, o Options) error {\n\tmo := retry.AddRetryMiddlewaresOptions{\n\t\tRetryer:          o.Retryer,\n\t\tLogRetryAttempts: o.ClientLogMode.IsRetries(),\n\t}\n\treturn retry.AddRetryMiddlewares(stack, mo)\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn awsmiddleware.AddRequestIDRetrieverMiddleware(stack)\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn awshttp.AddResponseErrorMiddleware(stack)\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchCheckLayerAvailability.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Checks the availability of one or more image layers in a repository. When an\n// image is pushed to a repository, each image layer is checked to verify if it has\n// been uploaded before. If it has been uploaded, then the image layer is skipped.\n// This operation is used by the Amazon ECR proxy and is not generally used by\n// customers for pulling and pushing images. In most cases, you should use the\n// docker CLI to pull, tag, and push images.\nfunc (c *Client) BatchCheckLayerAvailability(ctx context.Context, params *BatchCheckLayerAvailabilityInput, optFns ...func(*Options)) (*BatchCheckLayerAvailabilityOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchCheckLayerAvailabilityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchCheckLayerAvailability\", params, optFns, c.addOperationBatchCheckLayerAvailabilityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchCheckLayerAvailabilityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype BatchCheckLayerAvailabilityInput struct {\n\n\t// The digests of the image layers to check.\n\t//\n\t// This member is required.\n\tLayerDigests []string\n\n\t// The name of the repository that is associated with the image layers to check.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the image layers to check. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchCheckLayerAvailabilityOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.LayerFailure\n\n\t// A list of image layer objects corresponding to the image layer references in\n\t// the request.\n\tLayers []types.Layer\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchCheckLayerAvailability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchCheckLayerAvailability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchCheckLayerAvailabilityValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCheckLayerAvailability(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchCheckLayerAvailability(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"BatchCheckLayerAvailability\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchDeleteImage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a list of specified images within a repository. Images are specified\n// with either an imageTag or imageDigest . You can remove a tag from an image by\n// specifying the image's tag in your request. When you remove the last tag from an\n// image, the image is deleted from your repository. You can completely delete an\n// image (and all of its tags) by specifying the image's digest in your request.\nfunc (c *Client) BatchDeleteImage(ctx context.Context, params *BatchDeleteImageInput, optFns ...func(*Options)) (*BatchDeleteImageOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchDeleteImageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchDeleteImage\", params, optFns, c.addOperationBatchDeleteImageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchDeleteImageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// Deletes specified images within a specified repository. Images are specified\n// with either the imageTag or imageDigest .\ntype BatchDeleteImageInput struct {\n\n\t// A list of image ID references that correspond to images to delete. The format\n\t// of the imageIds reference is imageTag=tag or imageDigest=digest .\n\t//\n\t// This member is required.\n\tImageIds []types.ImageIdentifier\n\n\t// The repository that contains the image to delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the image to delete. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchDeleteImageOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.ImageFailure\n\n\t// The image IDs of the deleted images.\n\tImageIds []types.ImageIdentifier\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchDeleteImageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteImage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchDeleteImage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"BatchDeleteImage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetImage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Gets detailed information for an image. Images are specified with either an\n// imageTag or imageDigest . When an image is pulled, the BatchGetImage API is\n// called once to retrieve the image manifest.\nfunc (c *Client) BatchGetImage(ctx context.Context, params *BatchGetImageInput, optFns ...func(*Options)) (*BatchGetImageOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchGetImageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchGetImage\", params, optFns, c.addOperationBatchGetImageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchGetImageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype BatchGetImageInput struct {\n\n\t// A list of image ID references that correspond to images to describe. The format\n\t// of the imageIds reference is imageTag=tag or imageDigest=digest .\n\t//\n\t// This member is required.\n\tImageIds []types.ImageIdentifier\n\n\t// The repository that contains the images to describe.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The accepted media types for the request. Valid values:\n\t// application/vnd.docker.distribution.manifest.v1+json |\n\t// application/vnd.docker.distribution.manifest.v2+json |\n\t// application/vnd.oci.image.manifest.v1+json\n\tAcceptedMediaTypes []string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the images to describe. If you do not specify a registry, the default registry\n\t// is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchGetImageOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.ImageFailure\n\n\t// A list of image objects corresponding to the image references in the request.\n\tImages []types.Image\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchGetImageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchGetImageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetImage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchGetImage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"BatchGetImage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetRepositoryScanningConfiguration.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Gets the scanning configuration for one or more repositories.\nfunc (c *Client) BatchGetRepositoryScanningConfiguration(ctx context.Context, params *BatchGetRepositoryScanningConfigurationInput, optFns ...func(*Options)) (*BatchGetRepositoryScanningConfigurationOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchGetRepositoryScanningConfigurationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchGetRepositoryScanningConfiguration\", params, optFns, c.addOperationBatchGetRepositoryScanningConfigurationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchGetRepositoryScanningConfigurationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype BatchGetRepositoryScanningConfigurationInput struct {\n\n\t// One or more repository names to get the scanning configuration for.\n\t//\n\t// This member is required.\n\tRepositoryNames []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchGetRepositoryScanningConfigurationOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.RepositoryScanningConfigurationFailure\n\n\t// The scanning configuration for the requested repositories.\n\tScanningConfigurations []types.RepositoryScanningConfiguration\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchGetRepositoryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetRepositoryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchGetRepositoryScanningConfigurationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetRepositoryScanningConfiguration(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchGetRepositoryScanningConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"BatchGetRepositoryScanningConfiguration\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CompleteLayerUpload.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Informs Amazon ECR that the image layer upload has completed for a specified\n// registry, repository name, and upload ID. You can optionally provide a sha256\n// digest of the image layer for data validation purposes. When an image is pushed,\n// the CompleteLayerUpload API is called once per each new image layer to verify\n// that the upload has completed. This operation is used by the Amazon ECR proxy\n// and is not generally used by customers for pulling and pushing images. In most\n// cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) CompleteLayerUpload(ctx context.Context, params *CompleteLayerUploadInput, optFns ...func(*Options)) (*CompleteLayerUploadOutput, error) {\n\tif params == nil {\n\t\tparams = &CompleteLayerUploadInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CompleteLayerUpload\", params, optFns, c.addOperationCompleteLayerUploadMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CompleteLayerUploadOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CompleteLayerUploadInput struct {\n\n\t// The sha256 digest of the image layer.\n\t//\n\t// This member is required.\n\tLayerDigests []string\n\n\t// The name of the repository to associate with the image layer.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The upload ID from a previous InitiateLayerUpload operation to associate with\n\t// the image layer.\n\t//\n\t// This member is required.\n\tUploadId *string\n\n\t// The Amazon Web Services account ID associated with the registry to which to\n\t// upload layers. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CompleteLayerUploadOutput struct {\n\n\t// The sha256 digest of the image layer.\n\tLayerDigest *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// The upload ID associated with the layer.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCompleteLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCompleteLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCompleteLayerUploadValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCompleteLayerUpload(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCompleteLayerUpload(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"CompleteLayerUpload\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreatePullThroughCacheRule.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Creates a pull through cache rule. A pull through cache rule provides a way to\n// cache images from an external public registry in your Amazon ECR private\n// registry.\nfunc (c *Client) CreatePullThroughCacheRule(ctx context.Context, params *CreatePullThroughCacheRuleInput, optFns ...func(*Options)) (*CreatePullThroughCacheRuleOutput, error) {\n\tif params == nil {\n\t\tparams = &CreatePullThroughCacheRuleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreatePullThroughCacheRule\", params, optFns, c.addOperationCreatePullThroughCacheRuleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreatePullThroughCacheRuleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreatePullThroughCacheRuleInput struct {\n\n\t// The repository name prefix to use when caching images from the source registry.\n\t//\n\t// This member is required.\n\tEcrRepositoryPrefix *string\n\n\t// The registry URL of the upstream public registry to use as the source for the\n\t// pull through cache rule.\n\t//\n\t// This member is required.\n\tUpstreamRegistryUrl *string\n\n\t// The Amazon Web Services account ID associated with the registry to create the\n\t// pull through cache rule for. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreatePullThroughCacheRuleOutput struct {\n\n\t// The date and time, in JavaScript date format, when the pull through cache rule\n\t// was created.\n\tCreatedAt *time.Time\n\n\t// The Amazon ECR repository prefix associated with the pull through cache rule.\n\tEcrRepositoryPrefix *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The upstream registry URL associated with the pull through cache rule.\n\tUpstreamRegistryUrl *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePullThroughCacheRule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePullThroughCacheRule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreatePullThroughCacheRuleValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePullThroughCacheRule(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreatePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"CreatePullThroughCacheRule\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreateRepository.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates a repository. For more information, see Amazon ECR repositories (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) CreateRepository(ctx context.Context, params *CreateRepositoryInput, optFns ...func(*Options)) (*CreateRepositoryOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateRepositoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateRepository\", params, optFns, c.addOperationCreateRepositoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateRepositoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateRepositoryInput struct {\n\n\t// The name to use for the repository. The repository name may be specified on its\n\t// own (such as nginx-web-app ) or it can be prepended with a namespace to group\n\t// the repository into a category (such as project-a/nginx-web-app ).\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The encryption configuration for the repository. This determines how the\n\t// contents of your repository are encrypted at rest.\n\tEncryptionConfiguration *types.EncryptionConfiguration\n\n\t// The image scanning configuration for the repository. This determines whether\n\t// images are scanned for known vulnerabilities after being pushed to the\n\t// repository.\n\tImageScanningConfiguration *types.ImageScanningConfiguration\n\n\t// The tag mutability setting for the repository. If this parameter is omitted,\n\t// the default setting of MUTABLE will be used which will allow image tags to be\n\t// overwritten. If IMMUTABLE is specified, all image tags within the repository\n\t// will be immutable which will prevent them from being overwritten.\n\tImageTagMutability types.ImageTagMutability\n\n\t// The Amazon Web Services account ID associated with the registry to create the\n\t// repository. If you do not specify a registry, the default registry is assumed.\n\tRegistryId *string\n\n\t// The metadata that you apply to the repository to help you categorize and\n\t// organize them. Each tag consists of a key and an optional value, both of which\n\t// you define. Tag keys can have a maximum character length of 128 characters, and\n\t// tag values can have a maximum length of 256 characters.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateRepositoryOutput struct {\n\n\t// The repository that was created.\n\tRepository *types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateRepositoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepository(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateRepository(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"CreateRepository\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteLifecyclePolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Deletes the lifecycle policy associated with the specified repository.\nfunc (c *Client) DeleteLifecyclePolicy(ctx context.Context, params *DeleteLifecyclePolicyInput, optFns ...func(*Options)) (*DeleteLifecyclePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteLifecyclePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteLifecyclePolicy\", params, optFns, c.addOperationDeleteLifecyclePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteLifecyclePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteLifecyclePolicyInput struct {\n\n\t// The name of the repository.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteLifecyclePolicyOutput struct {\n\n\t// The time stamp of the last time that the lifecycle policy was run.\n\tLastEvaluatedAt *time.Time\n\n\t// The JSON lifecycle policy text.\n\tLifecyclePolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteLifecyclePolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLifecyclePolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DeleteLifecyclePolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeletePullThroughCacheRule.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Deletes a pull through cache rule.\nfunc (c *Client) DeletePullThroughCacheRule(ctx context.Context, params *DeletePullThroughCacheRuleInput, optFns ...func(*Options)) (*DeletePullThroughCacheRuleOutput, error) {\n\tif params == nil {\n\t\tparams = &DeletePullThroughCacheRuleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeletePullThroughCacheRule\", params, optFns, c.addOperationDeletePullThroughCacheRuleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeletePullThroughCacheRuleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeletePullThroughCacheRuleInput struct {\n\n\t// The Amazon ECR repository prefix associated with the pull through cache rule to\n\t// delete.\n\t//\n\t// This member is required.\n\tEcrRepositoryPrefix *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the pull through cache rule. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeletePullThroughCacheRuleOutput struct {\n\n\t// The timestamp associated with the pull through cache rule.\n\tCreatedAt *time.Time\n\n\t// The Amazon ECR repository prefix associated with the request.\n\tEcrRepositoryPrefix *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The upstream registry URL associated with the pull through cache rule.\n\tUpstreamRegistryUrl *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeletePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePullThroughCacheRule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePullThroughCacheRule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeletePullThroughCacheRuleValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePullThroughCacheRule(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeletePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DeletePullThroughCacheRule\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRegistryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes the registry permissions policy.\nfunc (c *Client) DeleteRegistryPolicy(ctx context.Context, params *DeleteRegistryPolicyInput, optFns ...func(*Options)) (*DeleteRegistryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteRegistryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteRegistryPolicy\", params, optFns, c.addOperationDeleteRegistryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteRegistryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteRegistryPolicyInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteRegistryPolicyOutput struct {\n\n\t// The contents of the registry permissions policy that was deleted.\n\tPolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRegistryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteRegistryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DeleteRegistryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepository.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a repository. If the repository contains images, you must either delete\n// all images in the repository or use the force option to delete the repository.\nfunc (c *Client) DeleteRepository(ctx context.Context, params *DeleteRepositoryInput, optFns ...func(*Options)) (*DeleteRepositoryOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteRepositoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteRepository\", params, optFns, c.addOperationDeleteRepositoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteRepositoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteRepositoryInput struct {\n\n\t// The name of the repository to delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// If a repository contains images, forces the deletion.\n\tForce bool\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository to delete. If you do not specify a registry, the default registry\n\t// is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteRepositoryOutput struct {\n\n\t// The repository that was deleted.\n\tRepository *types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteRepositoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepository(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteRepository(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DeleteRepository\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes the repository policy associated with the specified repository.\nfunc (c *Client) DeleteRepositoryPolicy(ctx context.Context, params *DeleteRepositoryPolicyInput, optFns ...func(*Options)) (*DeleteRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteRepositoryPolicy\", params, optFns, c.addOperationDeleteRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteRepositoryPolicyInput struct {\n\n\t// The name of the repository that is associated with the repository policy to\n\t// delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository policy to delete. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteRepositoryPolicyOutput struct {\n\n\t// The JSON repository policy that was deleted from the repository.\n\tPolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DeleteRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageReplicationStatus.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns the replication status for a specified image.\nfunc (c *Client) DescribeImageReplicationStatus(ctx context.Context, params *DescribeImageReplicationStatusInput, optFns ...func(*Options)) (*DescribeImageReplicationStatusOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeImageReplicationStatusInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeImageReplicationStatus\", params, optFns, c.addOperationDescribeImageReplicationStatusMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeImageReplicationStatusOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeImageReplicationStatusInput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tImageId *types.ImageIdentifier\n\n\t// The name of the repository that the image is in.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry. If you do not\n\t// specify a registry, the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeImageReplicationStatusOutput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\tImageId *types.ImageIdentifier\n\n\t// The replication status details for the images in the specified repository.\n\tReplicationStatuses []types.ImageReplicationStatus\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeImageReplicationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageReplicationStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeImageReplicationStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeImageReplicationStatusValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageReplicationStatus(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeImageReplicationStatus(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribeImageReplicationStatus\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageScanFindings.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\tsmithywaiter \"github.com/aws/smithy-go/waiter\"\n\t\"github.com/jmespath/go-jmespath\"\n\t\"time\"\n)\n\n// Returns the scan findings for the specified image.\nfunc (c *Client) DescribeImageScanFindings(ctx context.Context, params *DescribeImageScanFindingsInput, optFns ...func(*Options)) (*DescribeImageScanFindingsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeImageScanFindingsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeImageScanFindings\", params, optFns, c.addOperationDescribeImageScanFindingsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeImageScanFindingsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeImageScanFindingsInput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tImageId *types.ImageIdentifier\n\n\t// The repository for the image for which to describe the scan findings.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The maximum number of image scan results returned by DescribeImageScanFindings\n\t// in paginated output. When this parameter is used, DescribeImageScanFindings\n\t// only returns maxResults results in a single page along with a nextToken\n\t// response element. The remaining results of the initial request can be seen by\n\t// sending another DescribeImageScanFindings request with the returned nextToken\n\t// value. This value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribeImageScanFindings returns up to 100 results and a nextToken value, if\n\t// applicable.\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated DescribeImageScanFindings\n\t// request where maxResults was used and the results exceeded the value of that\n\t// parameter. Pagination continues from the end of the previous results that\n\t// returned the nextToken value. This value is null when there are no more results\n\t// to return.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to describe the image scan findings for. If you do not\n\t// specify a registry, the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeImageScanFindingsOutput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\tImageId *types.ImageIdentifier\n\n\t// The information contained in the image scan findings.\n\tImageScanFindings *types.ImageScanFindings\n\n\t// The current state of the scan.\n\tImageScanStatus *types.ImageScanStatus\n\n\t// The nextToken value to include in a future DescribeImageScanFindings request.\n\t// When the results of a DescribeImageScanFindings request exceed maxResults , this\n\t// value can be used to retrieve the next page of results. This value is null when\n\t// there are no more results to return.\n\tNextToken *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeImageScanFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageScanFindings{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeImageScanFindings{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeImageScanFindingsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageScanFindings(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeImageScanFindingsAPIClient is a client that implements the\n// DescribeImageScanFindings operation.\ntype DescribeImageScanFindingsAPIClient interface {\n\tDescribeImageScanFindings(context.Context, *DescribeImageScanFindingsInput, ...func(*Options)) (*DescribeImageScanFindingsOutput, error)\n}\n\nvar _ DescribeImageScanFindingsAPIClient = (*Client)(nil)\n\n// DescribeImageScanFindingsPaginatorOptions is the paginator options for\n// DescribeImageScanFindings\ntype DescribeImageScanFindingsPaginatorOptions struct {\n\t// The maximum number of image scan results returned by DescribeImageScanFindings\n\t// in paginated output. When this parameter is used, DescribeImageScanFindings\n\t// only returns maxResults results in a single page along with a nextToken\n\t// response element. The remaining results of the initial request can be seen by\n\t// sending another DescribeImageScanFindings request with the returned nextToken\n\t// value. This value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribeImageScanFindings returns up to 100 results and a nextToken value, if\n\t// applicable.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeImageScanFindingsPaginator is a paginator for DescribeImageScanFindings\ntype DescribeImageScanFindingsPaginator struct {\n\toptions   DescribeImageScanFindingsPaginatorOptions\n\tclient    DescribeImageScanFindingsAPIClient\n\tparams    *DescribeImageScanFindingsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeImageScanFindingsPaginator returns a new\n// DescribeImageScanFindingsPaginator\nfunc NewDescribeImageScanFindingsPaginator(client DescribeImageScanFindingsAPIClient, params *DescribeImageScanFindingsInput, optFns ...func(*DescribeImageScanFindingsPaginatorOptions)) *DescribeImageScanFindingsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeImageScanFindingsInput{}\n\t}\n\n\toptions := DescribeImageScanFindingsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeImageScanFindingsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeImageScanFindingsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeImageScanFindings page.\nfunc (p *DescribeImageScanFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImageScanFindingsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeImageScanFindings(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\n// ImageScanCompleteWaiterOptions are waiter options for ImageScanCompleteWaiter\ntype ImageScanCompleteWaiterOptions struct {\n\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// MinDelay is the minimum amount of time to delay between retries. If unset,\n\t// ImageScanCompleteWaiter will use default minimum delay of 5 seconds. Note that\n\t// MinDelay must resolve to a value lesser than or equal to the MaxDelay.\n\tMinDelay time.Duration\n\n\t// MaxDelay is the maximum amount of time to delay between retries. If unset or\n\t// set to zero, ImageScanCompleteWaiter will use default max delay of 120 seconds.\n\t// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.\n\tMaxDelay time.Duration\n\n\t// LogWaitAttempts is used to enable logging for waiter retry attempts\n\tLogWaitAttempts bool\n\n\t// Retryable is function that can be used to override the service defined\n\t// waiter-behavior based on operation output, or returned error. This function is\n\t// used by the waiter to decide if a state is retryable or a terminal state. By\n\t// default service-modeled logic will populate this option. This option can thus be\n\t// used to define a custom waiter state with fall-back to service-modeled waiter\n\t// state mutators.The function returns an error in case of a failure state. In case\n\t// of retry state, this function returns a bool value of true and nil error, while\n\t// in case of success it returns a bool value of false and nil error.\n\tRetryable func(context.Context, *DescribeImageScanFindingsInput, *DescribeImageScanFindingsOutput, error) (bool, error)\n}\n\n// ImageScanCompleteWaiter defines the waiters for ImageScanComplete\ntype ImageScanCompleteWaiter struct {\n\tclient DescribeImageScanFindingsAPIClient\n\n\toptions ImageScanCompleteWaiterOptions\n}\n\n// NewImageScanCompleteWaiter constructs a ImageScanCompleteWaiter.\nfunc NewImageScanCompleteWaiter(client DescribeImageScanFindingsAPIClient, optFns ...func(*ImageScanCompleteWaiterOptions)) *ImageScanCompleteWaiter {\n\toptions := ImageScanCompleteWaiterOptions{}\n\toptions.MinDelay = 5 * time.Second\n\toptions.MaxDelay = 120 * time.Second\n\toptions.Retryable = imageScanCompleteStateRetryable\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\treturn &ImageScanCompleteWaiter{\n\t\tclient:  client,\n\t\toptions: options,\n\t}\n}\n\n// Wait calls the waiter function for ImageScanComplete waiter. The maxWaitDur is\n// the maximum wait duration the waiter will wait. The maxWaitDur is required and\n// must be greater than zero.\nfunc (w *ImageScanCompleteWaiter) Wait(ctx context.Context, params *DescribeImageScanFindingsInput, maxWaitDur time.Duration, optFns ...func(*ImageScanCompleteWaiterOptions)) error {\n\t_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)\n\treturn err\n}\n\n// WaitForOutput calls the waiter function for ImageScanComplete waiter and\n// returns the output of the successful operation. The maxWaitDur is the maximum\n// wait duration the waiter will wait. The maxWaitDur is required and must be\n// greater than zero.\nfunc (w *ImageScanCompleteWaiter) WaitForOutput(ctx context.Context, params *DescribeImageScanFindingsInput, maxWaitDur time.Duration, optFns ...func(*ImageScanCompleteWaiterOptions)) (*DescribeImageScanFindingsOutput, error) {\n\tif maxWaitDur <= 0 {\n\t\treturn nil, fmt.Errorf(\"maximum wait time for waiter must be greater than zero\")\n\t}\n\n\toptions := w.options\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.MaxDelay <= 0 {\n\t\toptions.MaxDelay = 120 * time.Second\n\t}\n\n\tif options.MinDelay > options.MaxDelay {\n\t\treturn nil, fmt.Errorf(\"minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.\", options.MinDelay, options.MaxDelay)\n\t}\n\n\tctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)\n\tdefer cancelFn()\n\n\tlogger := smithywaiter.Logger{}\n\tremainingTime := maxWaitDur\n\n\tvar attempt int64\n\tfor {\n\n\t\tattempt++\n\t\tapiOptions := options.APIOptions\n\t\tstart := time.Now()\n\n\t\tif options.LogWaitAttempts {\n\t\t\tlogger.Attempt = attempt\n\t\t\tapiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)\n\t\t\tapiOptions = append(apiOptions, logger.AddLogger)\n\t\t}\n\n\t\tout, err := w.client.DescribeImageScanFindings(ctx, params, func(o *Options) {\n\t\t\to.APIOptions = append(o.APIOptions, apiOptions...)\n\t\t})\n\n\t\tretryable, err := options.Retryable(ctx, params, out, err)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !retryable {\n\t\t\treturn out, nil\n\t\t}\n\n\t\tremainingTime -= time.Since(start)\n\t\tif remainingTime < options.MinDelay || remainingTime <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// compute exponential backoff between waiter retries\n\t\tdelay, err := smithywaiter.ComputeDelay(\n\t\t\tattempt, options.MinDelay, options.MaxDelay, remainingTime,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error computing waiter delay, %w\", err)\n\t\t}\n\n\t\tremainingTime -= delay\n\t\t// sleep for the delay amount before invoking a request\n\t\tif err := smithytime.SleepWithContext(ctx, delay); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"request cancelled while waiting, %w\", err)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"exceeded max wait time for ImageScanComplete waiter\")\n}\n\nfunc imageScanCompleteStateRetryable(ctx context.Context, input *DescribeImageScanFindingsInput, output *DescribeImageScanFindingsOutput, err error) (bool, error) {\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"imageScanStatus.status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"COMPLETE\"\n\t\tvalue, ok := pathValue.(types.ScanStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.ScanStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"imageScanStatus.status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"FAILED\"\n\t\tvalue, ok := pathValue.(types.ScanStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.ScanStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeImageScanFindings(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribeImageScanFindings\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImages.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns metadata about the images in a repository. Beginning with Docker\n// version 1.9, the Docker client compresses image layers before pushing them to a\n// V2 Docker registry. The output of the docker images command shows the\n// uncompressed image size, so it may return a larger image size than the image\n// sizes returned by DescribeImages .\nfunc (c *Client) DescribeImages(ctx context.Context, params *DescribeImagesInput, optFns ...func(*Options)) (*DescribeImagesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeImagesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeImages\", params, optFns, c.addOperationDescribeImagesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeImagesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeImagesInput struct {\n\n\t// The repository that contains the images to describe.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The filter key and value with which to filter your DescribeImages results.\n\tFilter *types.DescribeImagesFilter\n\n\t// The list of image IDs for the requested repository.\n\tImageIds []types.ImageIdentifier\n\n\t// The maximum number of repository results returned by DescribeImages in\n\t// paginated output. When this parameter is used, DescribeImages only returns\n\t// maxResults results in a single page along with a nextToken response element.\n\t// The remaining results of the initial request can be seen by sending another\n\t// DescribeImages request with the returned nextToken value. This value can be\n\t// between 1 and 1000. If this parameter is not used, then DescribeImages returns\n\t// up to 100 results and a nextToken value, if applicable. This option cannot be\n\t// used when you specify images with imageIds .\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated DescribeImages request\n\t// where maxResults was used and the results exceeded the value of that parameter.\n\t// Pagination continues from the end of the previous results that returned the\n\t// nextToken value. This value is null when there are no more results to return.\n\t// This option cannot be used when you specify images with imageIds .\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to describe images. If you do not specify a registry,\n\t// the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeImagesOutput struct {\n\n\t// A list of ImageDetail objects that contain data about the image.\n\tImageDetails []types.ImageDetail\n\n\t// The nextToken value to include in a future DescribeImages request. When the\n\t// results of a DescribeImages request exceed maxResults , this value can be used\n\t// to retrieve the next page of results. This value is null when there are no more\n\t// results to return.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeImagesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImages(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeImagesAPIClient is a client that implements the DescribeImages\n// operation.\ntype DescribeImagesAPIClient interface {\n\tDescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error)\n}\n\nvar _ DescribeImagesAPIClient = (*Client)(nil)\n\n// DescribeImagesPaginatorOptions is the paginator options for DescribeImages\ntype DescribeImagesPaginatorOptions struct {\n\t// The maximum number of repository results returned by DescribeImages in\n\t// paginated output. When this parameter is used, DescribeImages only returns\n\t// maxResults results in a single page along with a nextToken response element.\n\t// The remaining results of the initial request can be seen by sending another\n\t// DescribeImages request with the returned nextToken value. This value can be\n\t// between 1 and 1000. If this parameter is not used, then DescribeImages returns\n\t// up to 100 results and a nextToken value, if applicable. This option cannot be\n\t// used when you specify images with imageIds .\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeImagesPaginator is a paginator for DescribeImages\ntype DescribeImagesPaginator struct {\n\toptions   DescribeImagesPaginatorOptions\n\tclient    DescribeImagesAPIClient\n\tparams    *DescribeImagesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeImagesPaginator returns a new DescribeImagesPaginator\nfunc NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeImagesInput{}\n\t}\n\n\toptions := DescribeImagesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeImagesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeImagesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeImages page.\nfunc (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeImages(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribeImages\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribePullThroughCacheRules.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns the pull through cache rules for a registry.\nfunc (c *Client) DescribePullThroughCacheRules(ctx context.Context, params *DescribePullThroughCacheRulesInput, optFns ...func(*Options)) (*DescribePullThroughCacheRulesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribePullThroughCacheRulesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribePullThroughCacheRules\", params, optFns, c.addOperationDescribePullThroughCacheRulesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribePullThroughCacheRulesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribePullThroughCacheRulesInput struct {\n\n\t// The Amazon ECR repository prefixes associated with the pull through cache rules\n\t// to return. If no repository prefix value is specified, all pull through cache\n\t// rules are returned.\n\tEcrRepositoryPrefixes []string\n\n\t// The maximum number of pull through cache rules returned by\n\t// DescribePullThroughCacheRulesRequest in paginated output. When this parameter is\n\t// used, DescribePullThroughCacheRulesRequest only returns maxResults results in a\n\t// single page along with a nextToken response element. The remaining results of\n\t// the initial request can be seen by sending another\n\t// DescribePullThroughCacheRulesRequest request with the returned nextToken value.\n\t// This value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribePullThroughCacheRulesRequest returns up to 100 results and a nextToken\n\t// value, if applicable.\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated\n\t// DescribePullThroughCacheRulesRequest request where maxResults was used and the\n\t// results exceeded the value of that parameter. Pagination continues from the end\n\t// of the previous results that returned the nextToken value. This value is null\n\t// when there are no more results to return.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry to return the\n\t// pull through cache rules for. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribePullThroughCacheRulesOutput struct {\n\n\t// The nextToken value to include in a future DescribePullThroughCacheRulesRequest\n\t// request. When the results of a DescribePullThroughCacheRulesRequest request\n\t// exceed maxResults , this value can be used to retrieve the next page of results.\n\t// This value is null when there are no more results to return.\n\tNextToken *string\n\n\t// The details of the pull through cache rules.\n\tPullThroughCacheRules []types.PullThroughCacheRule\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribePullThroughCacheRulesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePullThroughCacheRules{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePullThroughCacheRules{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePullThroughCacheRules(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribePullThroughCacheRulesAPIClient is a client that implements the\n// DescribePullThroughCacheRules operation.\ntype DescribePullThroughCacheRulesAPIClient interface {\n\tDescribePullThroughCacheRules(context.Context, *DescribePullThroughCacheRulesInput, ...func(*Options)) (*DescribePullThroughCacheRulesOutput, error)\n}\n\nvar _ DescribePullThroughCacheRulesAPIClient = (*Client)(nil)\n\n// DescribePullThroughCacheRulesPaginatorOptions is the paginator options for\n// DescribePullThroughCacheRules\ntype DescribePullThroughCacheRulesPaginatorOptions struct {\n\t// The maximum number of pull through cache rules returned by\n\t// DescribePullThroughCacheRulesRequest in paginated output. When this parameter is\n\t// used, DescribePullThroughCacheRulesRequest only returns maxResults results in a\n\t// single page along with a nextToken response element. The remaining results of\n\t// the initial request can be seen by sending another\n\t// DescribePullThroughCacheRulesRequest request with the returned nextToken value.\n\t// This value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribePullThroughCacheRulesRequest returns up to 100 results and a nextToken\n\t// value, if applicable.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribePullThroughCacheRulesPaginator is a paginator for\n// DescribePullThroughCacheRules\ntype DescribePullThroughCacheRulesPaginator struct {\n\toptions   DescribePullThroughCacheRulesPaginatorOptions\n\tclient    DescribePullThroughCacheRulesAPIClient\n\tparams    *DescribePullThroughCacheRulesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribePullThroughCacheRulesPaginator returns a new\n// DescribePullThroughCacheRulesPaginator\nfunc NewDescribePullThroughCacheRulesPaginator(client DescribePullThroughCacheRulesAPIClient, params *DescribePullThroughCacheRulesInput, optFns ...func(*DescribePullThroughCacheRulesPaginatorOptions)) *DescribePullThroughCacheRulesPaginator {\n\tif params == nil {\n\t\tparams = &DescribePullThroughCacheRulesInput{}\n\t}\n\n\toptions := DescribePullThroughCacheRulesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribePullThroughCacheRulesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribePullThroughCacheRulesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribePullThroughCacheRules page.\nfunc (p *DescribePullThroughCacheRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePullThroughCacheRulesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribePullThroughCacheRules(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribePullThroughCacheRules(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribePullThroughCacheRules\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRegistry.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes the settings for a registry. The replication configuration for a\n// repository can be created or updated with the PutReplicationConfiguration API\n// action.\nfunc (c *Client) DescribeRegistry(ctx context.Context, params *DescribeRegistryInput, optFns ...func(*Options)) (*DescribeRegistryOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeRegistryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeRegistry\", params, optFns, c.addOperationDescribeRegistryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeRegistryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeRegistryInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeRegistryOutput struct {\n\n\t// The ID of the registry.\n\tRegistryId *string\n\n\t// The replication configuration for the registry.\n\tReplicationConfiguration *types.ReplicationConfiguration\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeRegistryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRegistry{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRegistry{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRegistry(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeRegistry(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribeRegistry\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRepositories.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes image repositories in a registry.\nfunc (c *Client) DescribeRepositories(ctx context.Context, params *DescribeRepositoriesInput, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeRepositoriesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeRepositories\", params, optFns, c.addOperationDescribeRepositoriesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeRepositoriesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeRepositoriesInput struct {\n\n\t// The maximum number of repository results returned by DescribeRepositories in\n\t// paginated output. When this parameter is used, DescribeRepositories only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. The remaining results of the initial request can be seen by sending\n\t// another DescribeRepositories request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribeRepositories returns up to 100 results and a nextToken value, if\n\t// applicable. This option cannot be used when you specify repositories with\n\t// repositoryNames .\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated DescribeRepositories\n\t// request where maxResults was used and the results exceeded the value of that\n\t// parameter. Pagination continues from the end of the previous results that\n\t// returned the nextToken value. This value is null when there are no more results\n\t// to return. This option cannot be used when you specify repositories with\n\t// repositoryNames . This token should be treated as an opaque identifier that is\n\t// only used to retrieve the next items in a list and not for other programmatic\n\t// purposes.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repositories to be described. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\t// A list of repositories to describe. If this parameter is omitted, then all\n\t// repositories in a registry are described.\n\tRepositoryNames []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeRepositoriesOutput struct {\n\n\t// The nextToken value to include in a future DescribeRepositories request. When\n\t// the results of a DescribeRepositories request exceed maxResults , this value can\n\t// be used to retrieve the next page of results. This value is null when there are\n\t// no more results to return.\n\tNextToken *string\n\n\t// A list of repository objects corresponding to valid repositories.\n\tRepositories []types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRepositories{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRepositories{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRepositories(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeRepositoriesAPIClient is a client that implements the\n// DescribeRepositories operation.\ntype DescribeRepositoriesAPIClient interface {\n\tDescribeRepositories(context.Context, *DescribeRepositoriesInput, ...func(*Options)) (*DescribeRepositoriesOutput, error)\n}\n\nvar _ DescribeRepositoriesAPIClient = (*Client)(nil)\n\n// DescribeRepositoriesPaginatorOptions is the paginator options for\n// DescribeRepositories\ntype DescribeRepositoriesPaginatorOptions struct {\n\t// The maximum number of repository results returned by DescribeRepositories in\n\t// paginated output. When this parameter is used, DescribeRepositories only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. The remaining results of the initial request can be seen by sending\n\t// another DescribeRepositories request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter is not used, then\n\t// DescribeRepositories returns up to 100 results and a nextToken value, if\n\t// applicable. This option cannot be used when you specify repositories with\n\t// repositoryNames .\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeRepositoriesPaginator is a paginator for DescribeRepositories\ntype DescribeRepositoriesPaginator struct {\n\toptions   DescribeRepositoriesPaginatorOptions\n\tclient    DescribeRepositoriesAPIClient\n\tparams    *DescribeRepositoriesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeRepositoriesPaginator returns a new DescribeRepositoriesPaginator\nfunc NewDescribeRepositoriesPaginator(client DescribeRepositoriesAPIClient, params *DescribeRepositoriesInput, optFns ...func(*DescribeRepositoriesPaginatorOptions)) *DescribeRepositoriesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeRepositoriesInput{}\n\t}\n\n\toptions := DescribeRepositoriesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeRepositoriesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeRepositoriesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeRepositories page.\nfunc (p *DescribeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeRepositories(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"DescribeRepositories\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetAuthorizationToken.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves an authorization token. An authorization token represents your IAM\n// authentication credentials and can be used to access any Amazon ECR registry\n// that your IAM principal has access to. The authorization token is valid for 12\n// hours. The authorizationToken returned is a base64 encoded string that can be\n// decoded and used in a docker login command to authenticate to a registry. The\n// CLI offers an get-login-password command that simplifies the login process. For\n// more information, see Registry authentication (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) GetAuthorizationToken(ctx context.Context, params *GetAuthorizationTokenInput, optFns ...func(*Options)) (*GetAuthorizationTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &GetAuthorizationTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetAuthorizationToken\", params, optFns, c.addOperationGetAuthorizationTokenMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetAuthorizationTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetAuthorizationTokenInput struct {\n\n\t// A list of Amazon Web Services account IDs that are associated with the\n\t// registries for which to get AuthorizationData objects. If you do not specify a\n\t// registry, the default registry is assumed.\n\t//\n\t// Deprecated: This field is deprecated. The returned authorization token can be\n\t// used to access any Amazon ECR registry that the IAM principal has access to,\n\t// specifying a registry ID doesn't change the permissions scope of the\n\t// authorization token.\n\tRegistryIds []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetAuthorizationTokenOutput struct {\n\n\t// A list of authorization token data objects that correspond to the registryIds\n\t// values in the request.\n\tAuthorizationData []types.AuthorizationData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAuthorizationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAuthorizationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAuthorizationToken(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetAuthorizationToken(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetAuthorizationToken\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetDownloadUrlForLayer.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the pre-signed Amazon S3 download URL corresponding to an image\n// layer. You can only get URLs for image layers that are referenced in an image.\n// When an image is pulled, the GetDownloadUrlForLayer API is called once per image\n// layer that is not already cached. This operation is used by the Amazon ECR proxy\n// and is not generally used by customers for pulling and pushing images. In most\n// cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) GetDownloadUrlForLayer(ctx context.Context, params *GetDownloadUrlForLayerInput, optFns ...func(*Options)) (*GetDownloadUrlForLayerOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDownloadUrlForLayerInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDownloadUrlForLayer\", params, optFns, c.addOperationGetDownloadUrlForLayerMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDownloadUrlForLayerOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetDownloadUrlForLayerInput struct {\n\n\t// The digest of the image layer to download.\n\t//\n\t// This member is required.\n\tLayerDigest *string\n\n\t// The name of the repository that is associated with the image layer to download.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the image layer to download. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetDownloadUrlForLayerOutput struct {\n\n\t// The pre-signed Amazon S3 download URL for the requested layer.\n\tDownloadUrl *string\n\n\t// The digest of the image layer to download.\n\tLayerDigest *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetDownloadUrlForLayerMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDownloadUrlForLayer{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDownloadUrlForLayer{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetDownloadUrlForLayerValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDownloadUrlForLayer(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetDownloadUrlForLayer(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetDownloadUrlForLayer\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves the lifecycle policy for the specified repository.\nfunc (c *Client) GetLifecyclePolicy(ctx context.Context, params *GetLifecyclePolicyInput, optFns ...func(*Options)) (*GetLifecyclePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &GetLifecyclePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetLifecyclePolicy\", params, optFns, c.addOperationGetLifecyclePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetLifecyclePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetLifecyclePolicyInput struct {\n\n\t// The name of the repository.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetLifecyclePolicyOutput struct {\n\n\t// The time stamp of the last time that the lifecycle policy was run.\n\tLastEvaluatedAt *time.Time\n\n\t// The JSON lifecycle policy text.\n\tLifecyclePolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetLifecyclePolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLifecyclePolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetLifecyclePolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicyPreview.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\tsmithywaiter \"github.com/aws/smithy-go/waiter\"\n\t\"github.com/jmespath/go-jmespath\"\n\t\"time\"\n)\n\n// Retrieves the results of the lifecycle policy preview request for the specified\n// repository.\nfunc (c *Client) GetLifecyclePolicyPreview(ctx context.Context, params *GetLifecyclePolicyPreviewInput, optFns ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) {\n\tif params == nil {\n\t\tparams = &GetLifecyclePolicyPreviewInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetLifecyclePolicyPreview\", params, optFns, c.addOperationGetLifecyclePolicyPreviewMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetLifecyclePolicyPreviewOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetLifecyclePolicyPreviewInput struct {\n\n\t// The name of the repository.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// An optional parameter that filters results based on image tag status and all\n\t// tags, if tagged.\n\tFilter *types.LifecyclePolicyPreviewFilter\n\n\t// The list of imageIDs to be included.\n\tImageIds []types.ImageIdentifier\n\n\t// The maximum number of repository results returned by\n\t// GetLifecyclePolicyPreviewRequest in  paginated output. When this parameter is\n\t// used, GetLifecyclePolicyPreviewRequest only returns  maxResults results in a\n\t// single page along with a nextToken   response element. The remaining results of\n\t// the initial request can be seen by sending  another\n\t// GetLifecyclePolicyPreviewRequest request with the returned nextToken   value.\n\t// This value can be between 1 and 1000. If this  parameter is not used, then\n\t// GetLifecyclePolicyPreviewRequest returns up to  100 results and a nextToken\n\t// value, if  applicable. This option cannot be used when you specify images with\n\t// imageIds .\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated\n\t// GetLifecyclePolicyPreviewRequest request where maxResults was used and the\n\t// results exceeded the value of that parameter. Pagination continues from the end\n\t// of the  previous results that returned the nextToken value. This value is  null\n\t// when there are no more results to return. This option cannot be used when you\n\t// specify images with imageIds .\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetLifecyclePolicyPreviewOutput struct {\n\n\t// The JSON lifecycle policy text.\n\tLifecyclePolicyText *string\n\n\t// The nextToken value to include in a future GetLifecyclePolicyPreview request.\n\t// When the results of a GetLifecyclePolicyPreview request exceed maxResults , this\n\t// value can be used to retrieve the next page of results. This value is null when\n\t// there are no more results to return.\n\tNextToken *string\n\n\t// The results of the lifecycle policy preview request.\n\tPreviewResults []types.LifecyclePolicyPreviewResult\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// The status of the lifecycle policy preview request.\n\tStatus types.LifecyclePolicyPreviewStatus\n\n\t// The list of images that is returned as a result of the action.\n\tSummary *types.LifecyclePolicyPreviewSummary\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLifecyclePolicyPreview{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLifecyclePolicyPreview{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetLifecyclePolicyPreviewValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetLifecyclePolicyPreviewAPIClient is a client that implements the\n// GetLifecyclePolicyPreview operation.\ntype GetLifecyclePolicyPreviewAPIClient interface {\n\tGetLifecyclePolicyPreview(context.Context, *GetLifecyclePolicyPreviewInput, ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error)\n}\n\nvar _ GetLifecyclePolicyPreviewAPIClient = (*Client)(nil)\n\n// GetLifecyclePolicyPreviewPaginatorOptions is the paginator options for\n// GetLifecyclePolicyPreview\ntype GetLifecyclePolicyPreviewPaginatorOptions struct {\n\t// The maximum number of repository results returned by\n\t// GetLifecyclePolicyPreviewRequest in  paginated output. When this parameter is\n\t// used, GetLifecyclePolicyPreviewRequest only returns  maxResults results in a\n\t// single page along with a nextToken   response element. The remaining results of\n\t// the initial request can be seen by sending  another\n\t// GetLifecyclePolicyPreviewRequest request with the returned nextToken   value.\n\t// This value can be between 1 and 1000. If this  parameter is not used, then\n\t// GetLifecyclePolicyPreviewRequest returns up to  100 results and a nextToken\n\t// value, if  applicable. This option cannot be used when you specify images with\n\t// imageIds .\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetLifecyclePolicyPreviewPaginator is a paginator for GetLifecyclePolicyPreview\ntype GetLifecyclePolicyPreviewPaginator struct {\n\toptions   GetLifecyclePolicyPreviewPaginatorOptions\n\tclient    GetLifecyclePolicyPreviewAPIClient\n\tparams    *GetLifecyclePolicyPreviewInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetLifecyclePolicyPreviewPaginator returns a new\n// GetLifecyclePolicyPreviewPaginator\nfunc NewGetLifecyclePolicyPreviewPaginator(client GetLifecyclePolicyPreviewAPIClient, params *GetLifecyclePolicyPreviewInput, optFns ...func(*GetLifecyclePolicyPreviewPaginatorOptions)) *GetLifecyclePolicyPreviewPaginator {\n\tif params == nil {\n\t\tparams = &GetLifecyclePolicyPreviewInput{}\n\t}\n\n\toptions := GetLifecyclePolicyPreviewPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetLifecyclePolicyPreviewPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetLifecyclePolicyPreviewPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetLifecyclePolicyPreview page.\nfunc (p *GetLifecyclePolicyPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetLifecyclePolicyPreview(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\n// LifecyclePolicyPreviewCompleteWaiterOptions are waiter options for\n// LifecyclePolicyPreviewCompleteWaiter\ntype LifecyclePolicyPreviewCompleteWaiterOptions struct {\n\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// MinDelay is the minimum amount of time to delay between retries. If unset,\n\t// LifecyclePolicyPreviewCompleteWaiter will use default minimum delay of 5\n\t// seconds. Note that MinDelay must resolve to a value lesser than or equal to the\n\t// MaxDelay.\n\tMinDelay time.Duration\n\n\t// MaxDelay is the maximum amount of time to delay between retries. If unset or\n\t// set to zero, LifecyclePolicyPreviewCompleteWaiter will use default max delay of\n\t// 120 seconds. Note that MaxDelay must resolve to value greater than or equal to\n\t// the MinDelay.\n\tMaxDelay time.Duration\n\n\t// LogWaitAttempts is used to enable logging for waiter retry attempts\n\tLogWaitAttempts bool\n\n\t// Retryable is function that can be used to override the service defined\n\t// waiter-behavior based on operation output, or returned error. This function is\n\t// used by the waiter to decide if a state is retryable or a terminal state. By\n\t// default service-modeled logic will populate this option. This option can thus be\n\t// used to define a custom waiter state with fall-back to service-modeled waiter\n\t// state mutators.The function returns an error in case of a failure state. In case\n\t// of retry state, this function returns a bool value of true and nil error, while\n\t// in case of success it returns a bool value of false and nil error.\n\tRetryable func(context.Context, *GetLifecyclePolicyPreviewInput, *GetLifecyclePolicyPreviewOutput, error) (bool, error)\n}\n\n// LifecyclePolicyPreviewCompleteWaiter defines the waiters for\n// LifecyclePolicyPreviewComplete\ntype LifecyclePolicyPreviewCompleteWaiter struct {\n\tclient GetLifecyclePolicyPreviewAPIClient\n\n\toptions LifecyclePolicyPreviewCompleteWaiterOptions\n}\n\n// NewLifecyclePolicyPreviewCompleteWaiter constructs a\n// LifecyclePolicyPreviewCompleteWaiter.\nfunc NewLifecyclePolicyPreviewCompleteWaiter(client GetLifecyclePolicyPreviewAPIClient, optFns ...func(*LifecyclePolicyPreviewCompleteWaiterOptions)) *LifecyclePolicyPreviewCompleteWaiter {\n\toptions := LifecyclePolicyPreviewCompleteWaiterOptions{}\n\toptions.MinDelay = 5 * time.Second\n\toptions.MaxDelay = 120 * time.Second\n\toptions.Retryable = lifecyclePolicyPreviewCompleteStateRetryable\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\treturn &LifecyclePolicyPreviewCompleteWaiter{\n\t\tclient:  client,\n\t\toptions: options,\n\t}\n}\n\n// Wait calls the waiter function for LifecyclePolicyPreviewComplete waiter. The\n// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is\n// required and must be greater than zero.\nfunc (w *LifecyclePolicyPreviewCompleteWaiter) Wait(ctx context.Context, params *GetLifecyclePolicyPreviewInput, maxWaitDur time.Duration, optFns ...func(*LifecyclePolicyPreviewCompleteWaiterOptions)) error {\n\t_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)\n\treturn err\n}\n\n// WaitForOutput calls the waiter function for LifecyclePolicyPreviewComplete\n// waiter and returns the output of the successful operation. The maxWaitDur is the\n// maximum wait duration the waiter will wait. The maxWaitDur is required and must\n// be greater than zero.\nfunc (w *LifecyclePolicyPreviewCompleteWaiter) WaitForOutput(ctx context.Context, params *GetLifecyclePolicyPreviewInput, maxWaitDur time.Duration, optFns ...func(*LifecyclePolicyPreviewCompleteWaiterOptions)) (*GetLifecyclePolicyPreviewOutput, error) {\n\tif maxWaitDur <= 0 {\n\t\treturn nil, fmt.Errorf(\"maximum wait time for waiter must be greater than zero\")\n\t}\n\n\toptions := w.options\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.MaxDelay <= 0 {\n\t\toptions.MaxDelay = 120 * time.Second\n\t}\n\n\tif options.MinDelay > options.MaxDelay {\n\t\treturn nil, fmt.Errorf(\"minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.\", options.MinDelay, options.MaxDelay)\n\t}\n\n\tctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)\n\tdefer cancelFn()\n\n\tlogger := smithywaiter.Logger{}\n\tremainingTime := maxWaitDur\n\n\tvar attempt int64\n\tfor {\n\n\t\tattempt++\n\t\tapiOptions := options.APIOptions\n\t\tstart := time.Now()\n\n\t\tif options.LogWaitAttempts {\n\t\t\tlogger.Attempt = attempt\n\t\t\tapiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)\n\t\t\tapiOptions = append(apiOptions, logger.AddLogger)\n\t\t}\n\n\t\tout, err := w.client.GetLifecyclePolicyPreview(ctx, params, func(o *Options) {\n\t\t\to.APIOptions = append(o.APIOptions, apiOptions...)\n\t\t})\n\n\t\tretryable, err := options.Retryable(ctx, params, out, err)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !retryable {\n\t\t\treturn out, nil\n\t\t}\n\n\t\tremainingTime -= time.Since(start)\n\t\tif remainingTime < options.MinDelay || remainingTime <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// compute exponential backoff between waiter retries\n\t\tdelay, err := smithywaiter.ComputeDelay(\n\t\t\tattempt, options.MinDelay, options.MaxDelay, remainingTime,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error computing waiter delay, %w\", err)\n\t\t}\n\n\t\tremainingTime -= delay\n\t\t// sleep for the delay amount before invoking a request\n\t\tif err := smithytime.SleepWithContext(ctx, delay); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"request cancelled while waiting, %w\", err)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"exceeded max wait time for LifecyclePolicyPreviewComplete waiter\")\n}\n\nfunc lifecyclePolicyPreviewCompleteStateRetryable(ctx context.Context, input *GetLifecyclePolicyPreviewInput, output *GetLifecyclePolicyPreviewOutput, err error) (bool, error) {\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"COMPLETE\"\n\t\tvalue, ok := pathValue.(types.LifecyclePolicyPreviewStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.LifecyclePolicyPreviewStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"FAILED\"\n\t\tvalue, ok := pathValue.(types.LifecyclePolicyPreviewStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.LifecyclePolicyPreviewStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetLifecyclePolicyPreview\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the permissions policy for a registry.\nfunc (c *Client) GetRegistryPolicy(ctx context.Context, params *GetRegistryPolicyInput, optFns ...func(*Options)) (*GetRegistryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRegistryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRegistryPolicy\", params, optFns, c.addOperationGetRegistryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRegistryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRegistryPolicyInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype GetRegistryPolicyOutput struct {\n\n\t// The JSON text of the permissions policy for a registry.\n\tPolicyText *string\n\n\t// The ID of the registry.\n\tRegistryId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRegistryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetRegistryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryScanningConfiguration.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the scanning configuration for a registry.\nfunc (c *Client) GetRegistryScanningConfiguration(ctx context.Context, params *GetRegistryScanningConfigurationInput, optFns ...func(*Options)) (*GetRegistryScanningConfigurationOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRegistryScanningConfigurationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRegistryScanningConfiguration\", params, optFns, c.addOperationGetRegistryScanningConfigurationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRegistryScanningConfigurationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRegistryScanningConfigurationInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype GetRegistryScanningConfigurationOutput struct {\n\n\t// The ID of the registry.\n\tRegistryId *string\n\n\t// The scanning configuration for the registry.\n\tScanningConfiguration *types.RegistryScanningConfiguration\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRegistryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRegistryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryScanningConfiguration(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRegistryScanningConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetRegistryScanningConfiguration\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the repository policy for the specified repository.\nfunc (c *Client) GetRepositoryPolicy(ctx context.Context, params *GetRepositoryPolicyInput, optFns ...func(*Options)) (*GetRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRepositoryPolicy\", params, optFns, c.addOperationGetRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRepositoryPolicyInput struct {\n\n\t// The name of the repository with the policy to retrieve.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetRepositoryPolicyOutput struct {\n\n\t// The JSON repository policy text associated with the repository.\n\tPolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"GetRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_InitiateLayerUpload.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Notifies Amazon ECR that you intend to upload an image layer. When an image is\n// pushed, the InitiateLayerUpload API is called once per image layer that has not\n// already been uploaded. Whether or not an image layer has been uploaded is\n// determined by the BatchCheckLayerAvailability API action. This operation is used\n// by the Amazon ECR proxy and is not generally used by customers for pulling and\n// pushing images. In most cases, you should use the docker CLI to pull, tag, and\n// push images.\nfunc (c *Client) InitiateLayerUpload(ctx context.Context, params *InitiateLayerUploadInput, optFns ...func(*Options)) (*InitiateLayerUploadOutput, error) {\n\tif params == nil {\n\t\tparams = &InitiateLayerUploadInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"InitiateLayerUpload\", params, optFns, c.addOperationInitiateLayerUploadMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*InitiateLayerUploadOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype InitiateLayerUploadInput struct {\n\n\t// The name of the repository to which you intend to upload layers.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry to which you\n\t// intend to upload layers. If you do not specify a registry, the default registry\n\t// is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype InitiateLayerUploadOutput struct {\n\n\t// The size, in bytes, that Amazon ECR expects future layer part uploads to be.\n\tPartSize *int64\n\n\t// The upload ID for the layer upload. This parameter is passed to further\n\t// UploadLayerPart and CompleteLayerUpload operations.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpInitiateLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpInitiateLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpInitiateLayerUploadValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitiateLayerUpload(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opInitiateLayerUpload(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"InitiateLayerUpload\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListImages.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all the image IDs for the specified repository. You can filter images\n// based on whether or not they are tagged by using the tagStatus filter and\n// specifying either TAGGED , UNTAGGED or ANY . For example, you can filter your\n// results to return only UNTAGGED images and then pipe that result to a\n// BatchDeleteImage operation to delete them. Or, you can filter your results to\n// return only TAGGED images to list all of the tags in your repository.\nfunc (c *Client) ListImages(ctx context.Context, params *ListImagesInput, optFns ...func(*Options)) (*ListImagesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListImagesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListImages\", params, optFns, c.addOperationListImagesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListImagesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListImagesInput struct {\n\n\t// The repository with image IDs to be listed.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The filter key and value with which to filter your ListImages results.\n\tFilter *types.ListImagesFilter\n\n\t// The maximum number of image results returned by ListImages in paginated output.\n\t// When this parameter is used, ListImages only returns maxResults results in a\n\t// single page along with a nextToken response element. The remaining results of\n\t// the initial request can be seen by sending another ListImages request with the\n\t// returned nextToken value. This value can be between 1 and 1000. If this\n\t// parameter is not used, then ListImages returns up to 100 results and a nextToken\n\t// value, if applicable.\n\tMaxResults *int32\n\n\t// The nextToken value returned from a previous paginated ListImages request where\n\t// maxResults was used and the results exceeded the value of that parameter.\n\t// Pagination continues from the end of the previous results that returned the\n\t// nextToken value. This value is null when there are no more results to return.\n\t// This token should be treated as an opaque identifier that is only used to\n\t// retrieve the next items in a list and not for other programmatic purposes.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to list images. If you do not specify a registry, the\n\t// default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListImagesOutput struct {\n\n\t// The list of image IDs for the requested repository.\n\tImageIds []types.ImageIdentifier\n\n\t// The nextToken value to include in a future ListImages request. When the results\n\t// of a ListImages request exceed maxResults , this value can be used to retrieve\n\t// the next page of results. This value is null when there are no more results to\n\t// return.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListImagesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImages(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListImagesAPIClient is a client that implements the ListImages operation.\ntype ListImagesAPIClient interface {\n\tListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error)\n}\n\nvar _ ListImagesAPIClient = (*Client)(nil)\n\n// ListImagesPaginatorOptions is the paginator options for ListImages\ntype ListImagesPaginatorOptions struct {\n\t// The maximum number of image results returned by ListImages in paginated output.\n\t// When this parameter is used, ListImages only returns maxResults results in a\n\t// single page along with a nextToken response element. The remaining results of\n\t// the initial request can be seen by sending another ListImages request with the\n\t// returned nextToken value. This value can be between 1 and 1000. If this\n\t// parameter is not used, then ListImages returns up to 100 results and a nextToken\n\t// value, if applicable.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListImagesPaginator is a paginator for ListImages\ntype ListImagesPaginator struct {\n\toptions   ListImagesPaginatorOptions\n\tclient    ListImagesAPIClient\n\tparams    *ListImagesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListImagesPaginator returns a new ListImagesPaginator\nfunc NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator {\n\tif params == nil {\n\t\tparams = &ListImagesInput{}\n\t}\n\n\toptions := ListImagesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListImagesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListImagesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListImages page.\nfunc (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListImages(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"ListImages\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListTagsForResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// List the tags for an Amazon ECR resource.\nfunc (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &ListTagsForResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListTagsForResource\", params, optFns, c.addOperationListTagsForResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListTagsForResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListTagsForResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) that identifies the resource for which to list\n\t// the tags. Currently, the only supported resource is an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListTagsForResourceOutput struct {\n\n\t// The tags for the resource.\n\tTags []types.Tag\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"ListTagsForResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the image manifest and tags associated with an image. When\n// an image is pushed and all new image layers have been uploaded, the PutImage API\n// is called once to create or update the image manifest and the tags associated\n// with the image. This operation is used by the Amazon ECR proxy and is not\n// generally used by customers for pulling and pushing images. In most cases, you\n// should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) PutImage(ctx context.Context, params *PutImageInput, optFns ...func(*Options)) (*PutImageOutput, error) {\n\tif params == nil {\n\t\tparams = &PutImageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutImage\", params, optFns, c.addOperationPutImageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutImageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutImageInput struct {\n\n\t// The image manifest corresponding to the image to be uploaded.\n\t//\n\t// This member is required.\n\tImageManifest *string\n\n\t// The name of the repository in which to put the image.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The image digest of the image manifest corresponding to the image.\n\tImageDigest *string\n\n\t// The media type of the image manifest. If you push an image manifest that does\n\t// not contain the mediaType field, you must specify the imageManifestMediaType in\n\t// the request.\n\tImageManifestMediaType *string\n\n\t// The tag to associate with the image. This parameter is required for images that\n\t// use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI)\n\t// formats.\n\tImageTag *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to put the image. If you do not specify a registry, the\n\t// default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutImageOutput struct {\n\n\t// Details of the image uploaded.\n\tImage *types.Image\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutImageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutImage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutImage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageScanningConfiguration.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// The PutImageScanningConfiguration API is being deprecated, in favor of\n// specifying the image scanning configuration at the registry level. For more\n// information, see PutRegistryScanningConfiguration . Updates the image scanning\n// configuration for the specified repository.\nfunc (c *Client) PutImageScanningConfiguration(ctx context.Context, params *PutImageScanningConfigurationInput, optFns ...func(*Options)) (*PutImageScanningConfigurationOutput, error) {\n\tif params == nil {\n\t\tparams = &PutImageScanningConfigurationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutImageScanningConfiguration\", params, optFns, c.addOperationPutImageScanningConfigurationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutImageScanningConfigurationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutImageScanningConfigurationInput struct {\n\n\t// The image scanning configuration for the repository. This setting determines\n\t// whether images are scanned for known vulnerabilities after being pushed to the\n\t// repository.\n\t//\n\t// This member is required.\n\tImageScanningConfiguration *types.ImageScanningConfiguration\n\n\t// The name of the repository in which to update the image scanning configuration\n\t// setting.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to update the image scanning configuration setting. If\n\t// you do not specify a registry, the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutImageScanningConfigurationOutput struct {\n\n\t// The image scanning configuration setting for the repository.\n\tImageScanningConfiguration *types.ImageScanningConfiguration\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutImageScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImageScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutImageScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutImageScanningConfigurationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImageScanningConfiguration(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutImageScanningConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutImageScanningConfiguration\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageTagMutability.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates the image tag mutability settings for the specified repository. For\n// more information, see Image tag mutability (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) PutImageTagMutability(ctx context.Context, params *PutImageTagMutabilityInput, optFns ...func(*Options)) (*PutImageTagMutabilityOutput, error) {\n\tif params == nil {\n\t\tparams = &PutImageTagMutabilityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutImageTagMutability\", params, optFns, c.addOperationPutImageTagMutabilityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutImageTagMutabilityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutImageTagMutabilityInput struct {\n\n\t// The tag mutability setting for the repository. If MUTABLE is specified, image\n\t// tags can be overwritten. If IMMUTABLE is specified, all image tags within the\n\t// repository will be immutable which will prevent them from being overwritten.\n\t//\n\t// This member is required.\n\tImageTagMutability types.ImageTagMutability\n\n\t// The name of the repository in which to update the image tag mutability settings.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to update the image tag mutability settings. If you do\n\t// not specify a registry, the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutImageTagMutabilityOutput struct {\n\n\t// The image tag mutability setting for the repository.\n\tImageTagMutability types.ImageTagMutability\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutImageTagMutabilityMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImageTagMutability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutImageTagMutability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutImageTagMutabilityValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImageTagMutability(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutImageTagMutability(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutImageTagMutability\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutLifecyclePolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the lifecycle policy for the specified repository. For more\n// information, see Lifecycle policy template (https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html)\n// .\nfunc (c *Client) PutLifecyclePolicy(ctx context.Context, params *PutLifecyclePolicyInput, optFns ...func(*Options)) (*PutLifecyclePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutLifecyclePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutLifecyclePolicy\", params, optFns, c.addOperationPutLifecyclePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutLifecyclePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutLifecyclePolicyInput struct {\n\n\t// The JSON repository policy text to apply to the repository.\n\t//\n\t// This member is required.\n\tLifecyclePolicyText *string\n\n\t// The name of the repository to receive the policy.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do  not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutLifecyclePolicyOutput struct {\n\n\t// The JSON repository policy text.\n\tLifecyclePolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutLifecyclePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutLifecyclePolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutLifecyclePolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutLifecyclePolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the permissions policy for your registry. A registry policy\n// is used to specify permissions for another Amazon Web Services account and is\n// used when configuring cross-account replication. For more information, see\n// Registry permissions (https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) PutRegistryPolicy(ctx context.Context, params *PutRegistryPolicyInput, optFns ...func(*Options)) (*PutRegistryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutRegistryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutRegistryPolicy\", params, optFns, c.addOperationPutRegistryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutRegistryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutRegistryPolicyInput struct {\n\n\t// The JSON policy text to apply to your registry. The policy text follows the\n\t// same format as IAM policy text. For more information, see Registry permissions (https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html)\n\t// in the Amazon Elastic Container Registry User Guide.\n\t//\n\t// This member is required.\n\tPolicyText *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutRegistryPolicyOutput struct {\n\n\t// The JSON policy text for your registry.\n\tPolicyText *string\n\n\t// The registry ID.\n\tRegistryId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRegistryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutRegistryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutRegistryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutRegistryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryScanningConfiguration.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the scanning configuration for your private registry.\nfunc (c *Client) PutRegistryScanningConfiguration(ctx context.Context, params *PutRegistryScanningConfigurationInput, optFns ...func(*Options)) (*PutRegistryScanningConfigurationOutput, error) {\n\tif params == nil {\n\t\tparams = &PutRegistryScanningConfigurationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutRegistryScanningConfiguration\", params, optFns, c.addOperationPutRegistryScanningConfigurationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutRegistryScanningConfigurationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutRegistryScanningConfigurationInput struct {\n\n\t// The scanning rules to use for the registry. A scanning rule is used to\n\t// determine which repository filters are used and at what frequency scanning will\n\t// occur.\n\tRules []types.RegistryScanningRule\n\n\t// The scanning type to set for the registry. When a registry scanning\n\t// configuration is not defined, by default the BASIC scan type is used. When\n\t// basic scanning is used, you may specify filters to determine which individual\n\t// repositories, or all repositories, are scanned when new images are pushed to\n\t// those repositories. Alternatively, you can do manual scans of images with basic\n\t// scanning. When the ENHANCED scan type is set, Amazon Inspector provides\n\t// automated vulnerability scanning. You may choose between continuous scanning or\n\t// scan on push and you may specify filters to determine which individual\n\t// repositories, or all repositories, are scanned.\n\tScanType types.ScanType\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutRegistryScanningConfigurationOutput struct {\n\n\t// The scanning configuration for your registry.\n\tRegistryScanningConfiguration *types.RegistryScanningConfiguration\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutRegistryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRegistryScanningConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutRegistryScanningConfigurationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryScanningConfiguration(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutRegistryScanningConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutRegistryScanningConfiguration\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutReplicationConfiguration.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the replication configuration for a registry. The existing\n// replication configuration for a repository can be retrieved with the\n// DescribeRegistry API action. The first time the PutReplicationConfiguration API\n// is called, a service-linked IAM role is created in your account for the\n// replication process. For more information, see Using service-linked roles for\n// Amazon ECR (https://docs.aws.amazon.com/AmazonECR/latest/userguide/using-service-linked-roles.html)\n// in the Amazon Elastic Container Registry User Guide. When configuring\n// cross-account replication, the destination account must grant the source account\n// permission to replicate. This permission is controlled using a registry\n// permissions policy. For more information, see PutRegistryPolicy .\nfunc (c *Client) PutReplicationConfiguration(ctx context.Context, params *PutReplicationConfigurationInput, optFns ...func(*Options)) (*PutReplicationConfigurationOutput, error) {\n\tif params == nil {\n\t\tparams = &PutReplicationConfigurationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutReplicationConfiguration\", params, optFns, c.addOperationPutReplicationConfigurationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutReplicationConfigurationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutReplicationConfigurationInput struct {\n\n\t// An object representing the replication configuration for a registry.\n\t//\n\t// This member is required.\n\tReplicationConfiguration *types.ReplicationConfiguration\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutReplicationConfigurationOutput struct {\n\n\t// The contents of the replication configuration for the registry.\n\tReplicationConfiguration *types.ReplicationConfiguration\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutReplicationConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutReplicationConfiguration{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutReplicationConfigurationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutReplicationConfiguration(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutReplicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"PutReplicationConfiguration\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_SetRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Applies a repository policy to the specified repository to control access\n// permissions. For more information, see Amazon ECR Repository policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) SetRepositoryPolicy(ctx context.Context, params *SetRepositoryPolicyInput, optFns ...func(*Options)) (*SetRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &SetRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"SetRepositoryPolicy\", params, optFns, c.addOperationSetRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*SetRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype SetRepositoryPolicyInput struct {\n\n\t// The JSON repository policy text to apply to the repository. For more\n\t// information, see Amazon ECR repository policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html)\n\t// in the Amazon Elastic Container Registry User Guide.\n\t//\n\t// This member is required.\n\tPolicyText *string\n\n\t// The name of the repository to receive the policy.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// If the policy you are attempting to set on a repository policy would prevent\n\t// you from setting another policy in the future, you must force the\n\t// SetRepositoryPolicy operation. This is intended to prevent accidental repository\n\t// lock outs.\n\tForce bool\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype SetRepositoryPolicyOutput struct {\n\n\t// The JSON repository policy text applied to the repository.\n\tPolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpSetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpSetRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opSetRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"SetRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartImageScan.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Starts an image vulnerability scan. An image scan can only be started once per\n// 24 hours on an individual image. This limit includes if an image was scanned on\n// initial push. For more information, see Image scanning (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) StartImageScan(ctx context.Context, params *StartImageScanInput, optFns ...func(*Options)) (*StartImageScanOutput, error) {\n\tif params == nil {\n\t\tparams = &StartImageScanInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartImageScan\", params, optFns, c.addOperationStartImageScanMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartImageScanOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartImageScanInput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tImageId *types.ImageIdentifier\n\n\t// The name of the repository that contains the images to scan.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository in which to start an image scan request. If you do not specify a\n\t// registry, the default registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartImageScanOutput struct {\n\n\t// An object with identifying information for an image in an Amazon ECR repository.\n\tImageId *types.ImageIdentifier\n\n\t// The current state of the scan.\n\tImageScanStatus *types.ImageScanStatus\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartImageScanMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartImageScan{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartImageScan{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartImageScanValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImageScan(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartImageScan(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"StartImageScan\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartLifecyclePolicyPreview.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Starts a preview of a lifecycle policy for the specified repository. This\n// allows you to see the results before associating the lifecycle policy with the\n// repository.\nfunc (c *Client) StartLifecyclePolicyPreview(ctx context.Context, params *StartLifecyclePolicyPreviewInput, optFns ...func(*Options)) (*StartLifecyclePolicyPreviewOutput, error) {\n\tif params == nil {\n\t\tparams = &StartLifecyclePolicyPreviewInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartLifecyclePolicyPreview\", params, optFns, c.addOperationStartLifecyclePolicyPreviewMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartLifecyclePolicyPreviewOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartLifecyclePolicyPreviewInput struct {\n\n\t// The name of the repository to be evaluated.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The policy to be evaluated against. If you do not specify a policy, the current\n\t// policy for the repository is used.\n\tLifecyclePolicyText *string\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository. If you do not specify a registry, the default registry is\n\t// assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartLifecyclePolicyPreviewOutput struct {\n\n\t// The JSON repository policy text.\n\tLifecyclePolicyText *string\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// The status of the lifecycle policy preview request.\n\tStatus types.LifecyclePolicyPreviewStatus\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartLifecyclePolicyPreview{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartLifecyclePolicyPreview{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartLifecyclePolicyPreviewValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartLifecyclePolicyPreview(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartLifecyclePolicyPreview(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"StartLifecyclePolicyPreview\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_TagResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Adds specified tags to a resource with the specified ARN. Existing tags on a\n// resource are not changed if they are not specified in the request parameters.\nfunc (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &TagResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"TagResource\", params, optFns, c.addOperationTagResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*TagResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype TagResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) of the the resource to which to add tags.\n\t// Currently, the only supported resource is an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// The tags to add to the resource. A tag is an array of key-value pairs. Tag keys\n\t// can have a maximum character length of 128 characters, and tag values can have a\n\t// maximum length of 256 characters.\n\t//\n\t// This member is required.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype TagResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpTagResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"TagResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UntagResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes specified tags from a resource.\nfunc (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &UntagResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UntagResource\", params, optFns, c.addOperationUntagResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UntagResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UntagResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) of the resource from which to remove tags.\n\t// Currently, the only supported resource is an Amazon ECR repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// The keys of the tags to be removed.\n\t//\n\t// This member is required.\n\tTagKeys []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UntagResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUntagResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"UntagResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UploadLayerPart.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Uploads an image layer part to Amazon ECR. When an image is pushed, each new\n// image layer is uploaded in parts. The maximum size of each image layer part can\n// be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per\n// each new image layer part. This operation is used by the Amazon ECR proxy and is\n// not generally used by customers for pulling and pushing images. In most cases,\n// you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) UploadLayerPart(ctx context.Context, params *UploadLayerPartInput, optFns ...func(*Options)) (*UploadLayerPartOutput, error) {\n\tif params == nil {\n\t\tparams = &UploadLayerPartInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UploadLayerPart\", params, optFns, c.addOperationUploadLayerPartMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UploadLayerPartOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UploadLayerPartInput struct {\n\n\t// The base64-encoded layer part payload.\n\t//\n\t// This member is required.\n\tLayerPartBlob []byte\n\n\t// The position of the first byte of the layer part witin the overall image layer.\n\t//\n\t// This member is required.\n\tPartFirstByte *int64\n\n\t// The position of the last byte of the layer part within the overall image layer.\n\t//\n\t// This member is required.\n\tPartLastByte *int64\n\n\t// The name of the repository to which you are uploading layer parts.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The upload ID from a previous InitiateLayerUpload operation to associate with\n\t// the layer part upload.\n\t//\n\t// This member is required.\n\tUploadId *string\n\n\t// The Amazon Web Services account ID associated with the registry to which you\n\t// are uploading layer parts. If you do not specify a registry, the default\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UploadLayerPartOutput struct {\n\n\t// The integer value of the last byte received in the request.\n\tLastByteReceived *int64\n\n\t// The registry ID associated with the request.\n\tRegistryId *string\n\n\t// The repository name associated with the request.\n\tRepositoryName *string\n\n\t// The upload ID associated with the request.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUploadLayerPart{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUploadLayerPart{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUploadLayerPartValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUploadLayerPart(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUploadLayerPart(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr\",\n\t\tOperationName: \"UploadLayerPart\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"math\"\n\t\"strings\"\n)\n\ntype awsAwsjson11_deserializeOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchCheckLayerAvailability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response, &metadata)\n\t}\n\toutput := &BatchCheckLayerAvailabilityOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpBatchDeleteImage struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchDeleteImage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchDeleteImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchDeleteImage(response, &metadata)\n\t}\n\toutput := &BatchDeleteImageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpBatchGetImage struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchGetImage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchGetImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchGetImage(response, &metadata)\n\t}\n\toutput := &BatchGetImageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchGetImageOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(response, &metadata)\n\t}\n\toutput := &BatchGetRepositoryScanningConfigurationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchGetRepositoryScanningConfigurationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCompleteLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCompleteLayerUpload) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCompleteLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response, &metadata)\n\t}\n\toutput := &CompleteLayerUploadOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"EmptyUploadException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorEmptyUploadException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidLayerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidLayerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayerAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayerPartTooSmallException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayerPartTooSmallException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UploadNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreatePullThroughCacheRule struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreatePullThroughCacheRule) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response, &metadata)\n\t}\n\toutput := &CreatePullThroughCacheRuleOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"PullThroughCacheRuleAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedUpstreamRegistryException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateRepository struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateRepository) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateRepository(response, &metadata)\n\t}\n\toutput := &CreateRepositoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteLifecyclePolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response, &metadata)\n\t}\n\toutput := &DeleteLifecyclePolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteLifecyclePolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LifecyclePolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeletePullThroughCacheRule struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeletePullThroughCacheRule) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeletePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response, &metadata)\n\t}\n\toutput := &DeletePullThroughCacheRuleOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"PullThroughCacheRuleNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteRegistryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response, &metadata)\n\t}\n\toutput := &DeleteRegistryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteRegistryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteRepository struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteRepository) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepository(response, &metadata)\n\t}\n\toutput := &DeleteRepositoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotEmptyException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &DeleteRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeImageReplicationStatus struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeImageReplicationStatus) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeImageReplicationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response, &metadata)\n\t}\n\toutput := &DescribeImageReplicationStatusOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeImageReplicationStatusOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeImages struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeImages) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeImages(response, &metadata)\n\t}\n\toutput := &DescribeImagesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeImageScanFindings struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeImageScanFindings) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeImageScanFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response, &metadata)\n\t}\n\toutput := &DescribeImageScanFindingsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeImageScanFindingsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ScanNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorScanNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribePullThroughCacheRules struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribePullThroughCacheRules) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribePullThroughCacheRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response, &metadata)\n\t}\n\toutput := &DescribePullThroughCacheRulesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribePullThroughCacheRulesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"PullThroughCacheRuleNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeRegistry struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeRegistry) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeRegistry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeRegistry(response, &metadata)\n\t}\n\toutput := &DescribeRegistryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeRegistryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeRegistry(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeRepositories struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeRepositories) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeRepositories) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeRepositories(response, &metadata)\n\t}\n\toutput := &DescribeRepositoriesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetAuthorizationToken struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetAuthorizationToken) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetAuthorizationToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response, &metadata)\n\t}\n\toutput := &GetAuthorizationTokenOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetDownloadUrlForLayer struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetDownloadUrlForLayer) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetDownloadUrlForLayer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response, &metadata)\n\t}\n\toutput := &GetDownloadUrlForLayerOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetDownloadUrlForLayerOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayerInaccessibleException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayerInaccessibleException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayersNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayersNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetLifecyclePolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response, &metadata)\n\t}\n\toutput := &GetLifecyclePolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LifecyclePolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetLifecyclePolicyPreview struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetLifecyclePolicyPreview) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetLifecyclePolicyPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response, &metadata)\n\t}\n\toutput := &GetLifecyclePolicyPreviewOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyPreviewOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LifecyclePolicyPreviewNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLifecyclePolicyPreviewNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRegistryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response, &metadata)\n\t}\n\toutput := &GetRegistryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRegistryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRegistryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRegistryScanningConfiguration) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRegistryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response, &metadata)\n\t}\n\toutput := &GetRegistryScanningConfigurationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRegistryScanningConfigurationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &GetRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpInitiateLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpInitiateLayerUpload) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpInitiateLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response, &metadata)\n\t}\n\toutput := &InitiateLayerUploadOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListImages struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListImages) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListImages(response, &metadata)\n\t}\n\toutput := &ListImagesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListImagesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)\n\t}\n\toutput := &ListTagsForResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutImage struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutImage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutImage(response, &metadata)\n\t}\n\toutput := &PutImageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutImageOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ImageDigestDoesNotMatchException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response, errorBody)\n\n\tcase strings.EqualFold(\"ImageTagAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayersNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayersNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"ReferencedImagesNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutImageScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutImageScanningConfiguration) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutImageScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response, &metadata)\n\t}\n\toutput := &PutImageScanningConfigurationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutImageScanningConfigurationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutImageTagMutability struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutImageTagMutability) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutImageTagMutability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutImageTagMutability(response, &metadata)\n\t}\n\toutput := &PutImageTagMutabilityOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutImageTagMutabilityOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutImageTagMutability(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutLifecyclePolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response, &metadata)\n\t}\n\toutput := &PutLifecyclePolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutLifecyclePolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutRegistryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response, &metadata)\n\t}\n\toutput := &PutRegistryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutRegistryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutRegistryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutRegistryScanningConfiguration) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutRegistryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response, &metadata)\n\t}\n\toutput := &PutRegistryScanningConfigurationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutRegistryScanningConfigurationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutReplicationConfiguration struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutReplicationConfiguration) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response, &metadata)\n\t}\n\toutput := &PutReplicationConfigurationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutReplicationConfigurationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpSetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpSetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &SetRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartImageScan struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartImageScan) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartImageScan) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartImageScan(response, &metadata)\n\t}\n\toutput := &StartImageScanOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartImageScanOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartImageScan(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedImageTypeException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response, errorBody)\n\n\tcase strings.EqualFold(\"ValidationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorValidationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartLifecyclePolicyPreview struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartLifecyclePolicyPreview) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartLifecyclePolicyPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response, &metadata)\n\t}\n\toutput := &StartLifecyclePolicyPreviewOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartLifecyclePolicyPreviewOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LifecyclePolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"LifecyclePolicyPreviewInProgressException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLifecyclePolicyPreviewInProgressException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpTagResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpTagResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)\n\t}\n\toutput := &TagResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUntagResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUntagResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)\n\t}\n\toutput := &UntagResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUploadLayerPart struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUploadLayerPart) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUploadLayerPart(response, &metadata)\n\t}\n\toutput := &UploadLayerPartOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidLayerPartException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"KmsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorKmsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UploadNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.EmptyUploadException{}\n\terr := awsAwsjson11_deserializeDocumentEmptyUploadException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentImageAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageDigestDoesNotMatchException{}\n\terr := awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentImageNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageTagAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidLayerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidLayerException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidLayerException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidLayerPartException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidLayerPartException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidLayerPartException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidParameterException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTagParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTagParameterException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTagParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorKmsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.KmsException{}\n\terr := awsAwsjson11_deserializeDocumentKmsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayerAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayerInaccessibleException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayerInaccessibleException{}\n\terr := awsAwsjson11_deserializeDocumentLayerInaccessibleException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayerPartTooSmallException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayerPartTooSmallException{}\n\terr := awsAwsjson11_deserializeDocumentLayerPartTooSmallException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayersNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayersNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentLayersNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LifecyclePolicyNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentLifecyclePolicyNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLifecyclePolicyPreviewInProgressException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LifecyclePolicyPreviewInProgressException{}\n\terr := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewInProgressException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLifecyclePolicyPreviewNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LifecyclePolicyPreviewNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.PullThroughCacheRuleAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentPullThroughCacheRuleAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.PullThroughCacheRuleNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentPullThroughCacheRuleNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ReferencedImagesNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RegistryPolicyNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryNotEmptyException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryPolicyNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ScanNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ServerException{}\n\terr := awsAwsjson11_deserializeDocumentServerException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TooManyTagsException{}\n\terr := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedImageTypeException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedUpstreamRegistryException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUploadNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UploadNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentUploadNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ValidationException{}\n\terr := awsAwsjson11_deserializeDocumentValidationException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeDocumentAttribute(v **types.Attribute, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Attribute\n\tif *v == nil {\n\t\tsv = &types.Attribute{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttributeKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttributeValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAttributeList(v *[]types.Attribute, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Attribute\n\tif *v == nil {\n\t\tcv = []types.Attribute{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Attribute\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAttribute(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAuthorizationData(v **types.AuthorizationData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AuthorizationData\n\tif *v == nil {\n\t\tsv = &types.AuthorizationData{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"authorizationToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Base64 to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AuthorizationToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiresAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"proxyEndpoint\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ProxyEndpoint to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ProxyEndpoint = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAuthorizationDataList(v *[]types.AuthorizationData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AuthorizationData\n\tif *v == nil {\n\t\tcv = []types.AuthorizationData{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AuthorizationData\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAuthorizationData(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEcrContainerImageDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AwsEcrContainerImageDetails\n\tif *v == nil {\n\t\tsv = &types.AwsEcrContainerImageDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"architecture\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arch to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Architecture = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"author\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Author to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Author = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageTags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageTagsList(&sv.ImageTags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"platform\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Platform to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Platform = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"pushedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.PushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"registry\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Registry = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCvssScore(v **types.CvssScore, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CvssScore\n\tif *v == nil {\n\t\tsv = &types.CvssScore{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"baseScore\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.BaseScore = f64\n\n\t\t\t\tcase string:\n\t\t\t\t\tvar f64 float64\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase strings.EqualFold(jtv, \"NaN\"):\n\t\t\t\t\t\tf64 = math.NaN()\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(1)\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"-Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(-1)\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn fmt.Errorf(\"unknown JSON number value: %s\", jtv)\n\n\t\t\t\t\t}\n\t\t\t\t\tsv.BaseScore = f64\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected BaseScore to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"scoringVector\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScoringVector to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScoringVector = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"source\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Source to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Source = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Version to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCvssScoreAdjustment(v **types.CvssScoreAdjustment, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CvssScoreAdjustment\n\tif *v == nil {\n\t\tsv = &types.CvssScoreAdjustment{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"metric\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Metric to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Metric = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"reason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Reason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Reason = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCvssScoreAdjustmentList(v *[]types.CvssScoreAdjustment, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.CvssScoreAdjustment\n\tif *v == nil {\n\t\tcv = []types.CvssScoreAdjustment{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.CvssScoreAdjustment\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCvssScoreDetails(v **types.CvssScoreDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CvssScoreDetails\n\tif *v == nil {\n\t\tsv = &types.CvssScoreDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"adjustments\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"score\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.Score = f64\n\n\t\t\t\tcase string:\n\t\t\t\t\tvar f64 float64\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase strings.EqualFold(jtv, \"NaN\"):\n\t\t\t\t\t\tf64 = math.NaN()\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(1)\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"-Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(-1)\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn fmt.Errorf(\"unknown JSON number value: %s\", jtv)\n\n\t\t\t\t\t}\n\t\t\t\t\tsv.Score = f64\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Score to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"scoreSource\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Source to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScoreSource = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"scoringVector\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScoringVector to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScoringVector = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Version to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCvssScoreList(v *[]types.CvssScore, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.CvssScore\n\tif *v == nil {\n\t\tcv = []types.CvssScore{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.CvssScore\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentCvssScore(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEmptyUploadException(v **types.EmptyUploadException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.EmptyUploadException\n\tif *v == nil {\n\t\tsv = &types.EmptyUploadException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.EncryptionConfiguration\n\tif *v == nil {\n\t\tsv = &types.EncryptionConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"encryptionType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected EncryptionType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EncryptionType = types.EncryptionType(jtv)\n\t\t\t}\n\n\t\tcase \"kmsKey\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected KmsKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KmsKey = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEnhancedImageScanFinding(v **types.EnhancedImageScanFinding, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.EnhancedImageScanFinding\n\tif *v == nil {\n\t\tsv = &types.EnhancedImageScanFinding{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"awsAccountId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AwsAccountId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FindingDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"findingArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FindingArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FindingArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"firstObservedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.FirstObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"lastObservedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"packageVulnerabilityDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"remediation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRemediation(&sv.Remediation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"resources\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceList(&sv.Resources, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"score\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.Score = f64\n\n\t\t\t\tcase string:\n\t\t\t\t\tvar f64 float64\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase strings.EqualFold(jtv, \"NaN\"):\n\t\t\t\t\t\tf64 = math.NaN()\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(1)\n\n\t\t\t\t\tcase strings.EqualFold(jtv, \"-Infinity\"):\n\t\t\t\t\t\tf64 = math.Inf(-1)\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn fmt.Errorf(\"unknown JSON number value: %s\", jtv)\n\n\t\t\t\t\t}\n\t\t\t\t\tsv.Score = f64\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Score to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"scoreDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentScoreDetails(&sv.ScoreDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Severity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Status to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Title to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Type to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"updatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEnhancedImageScanFindingList(v *[]types.EnhancedImageScanFinding, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.EnhancedImageScanFinding\n\tif *v == nil {\n\t\tcv = []types.EnhancedImageScanFinding{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.EnhancedImageScanFinding\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentEnhancedImageScanFinding(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentFindingSeverityCounts(v *map[string]int32, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]int32\n\tif *v == nil {\n\t\tmv = map[string]int32{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal int32\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(json.Number)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected SeverityCount to be json.Number, got %T instead\", value)\n\t\t\t}\n\t\t\ti64, err := jtv.Int64()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparsedVal = int32(i64)\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImage(v **types.Image, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Image\n\tif *v == nil {\n\t\tsv = &types.Image{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageManifest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageManifest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageManifestMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifestMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageAlreadyExistsException(v **types.ImageAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.ImageAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDetail(v **types.ImageDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageDetail\n\tif *v == nil {\n\t\tsv = &types.ImageDetail{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"artifactMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ArtifactMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageManifestMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifestMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imagePushedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected PushTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"imageScanFindingsSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanFindingsSummary(&sv.ImageScanFindingsSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanStatus\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageSizeInBytes\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageSizeInBytes to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ImageSizeInBytes = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"imageTags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"lastRecordedPullTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastRecordedPullTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected RecordedPullTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDetailList(v *[]types.ImageDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageDetail\n\tif *v == nil {\n\t\tcv = []types.ImageDetail{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageDetail\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageDetail(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(v **types.ImageDigestDoesNotMatchException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageDigestDoesNotMatchException\n\tif *v == nil {\n\t\tsv = &types.ImageDigestDoesNotMatchException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageFailure(v **types.ImageFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageFailure\n\tif *v == nil {\n\t\tsv = &types.ImageFailure{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageFailureCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = types.ImageFailureCode(jtv)\n\t\t\t}\n\n\t\tcase \"failureReason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageFailureReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureReason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageFailureList(v *[]types.ImageFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageFailure\n\tif *v == nil {\n\t\tcv = []types.ImageFailure{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageFailure\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageFailure(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageIdentifier(v **types.ImageIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageIdentifier\n\tif *v == nil {\n\t\tsv = &types.ImageIdentifier{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageTag\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageTag = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageIdentifierList(v *[]types.ImageIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageIdentifier\n\tif *v == nil {\n\t\tcv = []types.ImageIdentifier{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageIdentifier\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageList(v *[]types.Image, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Image\n\tif *v == nil {\n\t\tcv = []types.Image{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Image\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImage(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageNotFoundException(v **types.ImageNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ImageNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageReplicationStatus(v **types.ImageReplicationStatus, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageReplicationStatus\n\tif *v == nil {\n\t\tsv = &types.ImageReplicationStatus{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReplicationError to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReplicationStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ReplicationStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageReplicationStatusList(v *[]types.ImageReplicationStatus, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageReplicationStatus\n\tif *v == nil {\n\t\tcv = []types.ImageReplicationStatus{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageReplicationStatus\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageReplicationStatus(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanFinding(v **types.ImageScanFinding, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageScanFinding\n\tif *v == nil {\n\t\tsv = &types.ImageScanFinding{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"attributes\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAttributeList(&sv.Attributes, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FindingDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FindingName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FindingSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = types.FindingSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"uri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Uri = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanFindingList(v *[]types.ImageScanFinding, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageScanFinding\n\tif *v == nil {\n\t\tcv = []types.ImageScanFinding{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageScanFinding\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageScanFinding(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanFindings(v **types.ImageScanFindings, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageScanFindings\n\tif *v == nil {\n\t\tsv = &types.ImageScanFindings{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"enhancedFindings\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentEnhancedImageScanFindingList(&sv.EnhancedFindings, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"findings\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanFindingList(&sv.Findings, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"findingSeverityCounts\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentFindingSeverityCounts(&sv.FindingSeverityCounts, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanCompletedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImageScanCompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"vulnerabilitySourceUpdatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.VulnerabilitySourceUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected VulnerabilitySourceUpdateTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanFindingsSummary(v **types.ImageScanFindingsSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageScanFindingsSummary\n\tif *v == nil {\n\t\tsv = &types.ImageScanFindingsSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"findingSeverityCounts\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentFindingSeverityCounts(&sv.FindingSeverityCounts, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanCompletedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImageScanCompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"vulnerabilitySourceUpdatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.VulnerabilitySourceUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected VulnerabilitySourceUpdateTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanningConfiguration(v **types.ImageScanningConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageScanningConfiguration\n\tif *v == nil {\n\t\tsv = &types.ImageScanningConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"scanOnPush\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanOnPushFlag to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScanOnPush = jtv\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageScanStatus(v **types.ImageScanStatus, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageScanStatus\n\tif *v == nil {\n\t\tsv = &types.ImageScanStatus{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanStatusDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ScanStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(v **types.ImageTagAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageTagAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.ImageTagAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagsList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidLayerException(v **types.InvalidLayerException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidLayerException\n\tif *v == nil {\n\t\tsv = &types.InvalidLayerException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidLayerPartException(v **types.InvalidLayerPartException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidLayerPartException\n\tif *v == nil {\n\t\tsv = &types.InvalidLayerPartException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastValidByteReceived\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LastValidByteReceived = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidParameterException\n\tif *v == nil {\n\t\tsv = &types.InvalidParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTagParameterException(v **types.InvalidTagParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTagParameterException\n\tif *v == nil {\n\t\tsv = &types.InvalidTagParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentKmsException(v **types.KmsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.KmsException\n\tif *v == nil {\n\t\tsv = &types.KmsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"kmsError\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected KmsError to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KmsError = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayer(v **types.Layer, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Layer\n\tif *v == nil {\n\t\tsv = &types.Layer{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"layerAvailability\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerAvailability to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerAvailability = types.LayerAvailability(jtv)\n\t\t\t}\n\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"layerSize\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerSizeInBytes to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LayerSize = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"mediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(v **types.LayerAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.LayerAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerFailure(v **types.LayerFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerFailure\n\tif *v == nil {\n\t\tsv = &types.LayerFailure{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerFailureCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = types.LayerFailureCode(jtv)\n\t\t\t}\n\n\t\tcase \"failureReason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerFailureReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureReason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BatchedOperationLayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerFailureList(v *[]types.LayerFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.LayerFailure\n\tif *v == nil {\n\t\tcv = []types.LayerFailure{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.LayerFailure\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentLayerFailure(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerInaccessibleException(v **types.LayerInaccessibleException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerInaccessibleException\n\tif *v == nil {\n\t\tsv = &types.LayerInaccessibleException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerList(v *[]types.Layer, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Layer\n\tif *v == nil {\n\t\tcv = []types.Layer{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Layer\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentLayer(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerPartTooSmallException(v **types.LayerPartTooSmallException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerPartTooSmallException\n\tif *v == nil {\n\t\tsv = &types.LayerPartTooSmallException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayersNotFoundException(v **types.LayersNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayersNotFoundException\n\tif *v == nil {\n\t\tsv = &types.LayersNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyNotFoundException(v **types.LifecyclePolicyNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyNotFoundException\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewInProgressException(v **types.LifecyclePolicyPreviewInProgressException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyPreviewInProgressException\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyPreviewInProgressException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewNotFoundException(v **types.LifecyclePolicyPreviewNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyPreviewNotFoundException\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyPreviewNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResult(v **types.LifecyclePolicyPreviewResult, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyPreviewResult\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyPreviewResult{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"action\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLifecyclePolicyRuleAction(&sv.Action, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"appliedRulePriority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyRulePriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.AppliedRulePriority = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imagePushedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected PushTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"imageTags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResultList(v *[]types.LifecyclePolicyPreviewResult, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.LifecyclePolicyPreviewResult\n\tif *v == nil {\n\t\tcv = []types.LifecyclePolicyPreviewResult{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.LifecyclePolicyPreviewResult\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResult(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewSummary(v **types.LifecyclePolicyPreviewSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyPreviewSummary\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyPreviewSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"expiringImageTotalCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ExpiringImageTotalCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLifecyclePolicyRuleAction(v **types.LifecyclePolicyRuleAction, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LifecyclePolicyRuleAction\n\tif *v == nil {\n\t\tsv = &types.LifecyclePolicyRuleAction{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageActionType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.ImageActionType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LimitExceededException\n\tif *v == nil {\n\t\tsv = &types.LimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPackageVulnerabilityDetails(v **types.PackageVulnerabilityDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PackageVulnerabilityDetails\n\tif *v == nil {\n\t\tsv = &types.PackageVulnerabilityDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"cvss\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"referenceUrls\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReferenceUrlsList(&sv.ReferenceUrls, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"relatedVulnerabilities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRelatedVulnerabilitiesList(&sv.RelatedVulnerabilities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"source\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Source to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Source = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"sourceUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"vendorCreatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"vendorSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Severity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VendorSeverity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"vendorUpdatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected Date to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"vulnerabilityId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected VulnerabilityId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VulnerabilityId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"vulnerablePackages\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentVulnerablePackagesList(&sv.VulnerablePackages, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughCacheRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PullThroughCacheRule\n\tif *v == nil {\n\t\tsv = &types.PullThroughCacheRule{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ecrRepositoryPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EcrRepositoryPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"upstreamRegistryUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UpstreamRegistryUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPullThroughCacheRuleAlreadyExistsException(v **types.PullThroughCacheRuleAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PullThroughCacheRuleAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.PullThroughCacheRuleAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPullThroughCacheRuleList(v *[]types.PullThroughCacheRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PullThroughCacheRule\n\tif *v == nil {\n\t\tcv = []types.PullThroughCacheRule{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PullThroughCacheRule\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPullThroughCacheRule(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPullThroughCacheRuleNotFoundException(v **types.PullThroughCacheRuleNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PullThroughCacheRuleNotFoundException\n\tif *v == nil {\n\t\tsv = &types.PullThroughCacheRuleNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Recommendation\n\tif *v == nil {\n\t\tsv = &types.Recommendation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"text\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RecommendationText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Text = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"url\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Url = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(v **types.ReferencedImagesNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReferencedImagesNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ReferencedImagesNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReferenceUrlsList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(v **types.RegistryPolicyNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryPolicyNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RegistryPolicyNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(v **types.RegistryScanningConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryScanningConfiguration\n\tif *v == nil {\n\t\tsv = &types.RegistryScanningConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"rules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryScanningRuleList(&sv.Rules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"scanType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScanType = types.ScanType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryScanningRule(v **types.RegistryScanningRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryScanningRule\n\tif *v == nil {\n\t\tsv = &types.RegistryScanningRule{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"repositoryFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(&sv.RepositoryFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"scanFrequency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanFrequency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScanFrequency = types.ScanFrequency(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryScanningRuleList(v *[]types.RegistryScanningRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RegistryScanningRule\n\tif *v == nil {\n\t\tcv = []types.RegistryScanningRule{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RegistryScanningRule\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRegistryScanningRule(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRelatedVulnerabilitiesList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected RelatedVulnerability to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Remediation\n\tif *v == nil {\n\t\tsv = &types.Remediation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"recommendation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReplicationConfiguration(v **types.ReplicationConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReplicationConfiguration\n\tif *v == nil {\n\t\tsv = &types.ReplicationConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"rules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReplicationRuleList(&sv.Rules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReplicationDestination(v **types.ReplicationDestination, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReplicationDestination\n\tif *v == nil {\n\t\tsv = &types.ReplicationDestination{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReplicationDestinationList(v *[]types.ReplicationDestination, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ReplicationDestination\n\tif *v == nil {\n\t\tcv = []types.ReplicationDestination{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ReplicationDestination\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentReplicationDestination(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReplicationRule(v **types.ReplicationRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReplicationRule\n\tif *v == nil {\n\t\tsv = &types.ReplicationRule{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"destinations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReplicationDestinationList(&sv.Destinations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"repositoryFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryFilterList(&sv.RepositoryFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReplicationRuleList(v *[]types.ReplicationRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ReplicationRule\n\tif *v == nil {\n\t\tcv = []types.ReplicationRule{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ReplicationRule\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentReplicationRule(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepository(v **types.Repository, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Repository\n\tif *v == nil {\n\t\tsv = &types.Repository{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"encryptionConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanningConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageTagMutability\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageTagMutability to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageTagMutability = types.ImageTagMutability(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(v **types.RepositoryAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.RepositoryAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryFilter(v **types.RepositoryFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryFilter\n\tif *v == nil {\n\t\tsv = &types.RepositoryFilter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"filter\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryFilterValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Filter = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"filterType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryFilterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FilterType = types.RepositoryFilterType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryFilterList(v *[]types.RepositoryFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RepositoryFilter\n\tif *v == nil {\n\t\tcv = []types.RepositoryFilter{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RepositoryFilter\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRepositoryFilter(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryList(v *[]types.Repository, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Repository\n\tif *v == nil {\n\t\tcv = []types.Repository{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Repository\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRepository(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(v **types.RepositoryNotEmptyException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryNotEmptyException\n\tif *v == nil {\n\t\tsv = &types.RepositoryNotEmptyException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryNotFoundException(v **types.RepositoryNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RepositoryNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(v **types.RepositoryPolicyNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryPolicyNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RepositoryPolicyNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryScanningConfiguration(v **types.RepositoryScanningConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryScanningConfiguration\n\tif *v == nil {\n\t\tsv = &types.RepositoryScanningConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"appliedScanFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(&sv.AppliedScanFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"repositoryArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"scanFrequency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanFrequency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScanFrequency = types.ScanFrequency(jtv)\n\t\t\t}\n\n\t\tcase \"scanOnPush\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanOnPushFlag to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScanOnPush = jtv\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailure(v **types.RepositoryScanningConfigurationFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryScanningConfigurationFailure\n\tif *v == nil {\n\t\tsv = &types.RepositoryScanningConfigurationFailure{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanningConfigurationFailureCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = types.ScanningConfigurationFailureCode(jtv)\n\t\t\t}\n\n\t\tcase \"failureReason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanningConfigurationFailureReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureReason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailureList(v *[]types.RepositoryScanningConfigurationFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RepositoryScanningConfigurationFailure\n\tif *v == nil {\n\t\tcv = []types.RepositoryScanningConfigurationFailure{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RepositoryScanningConfigurationFailure\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailure(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationList(v *[]types.RepositoryScanningConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RepositoryScanningConfiguration\n\tif *v == nil {\n\t\tcv = []types.RepositoryScanningConfiguration{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RepositoryScanningConfiguration\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRepositoryScanningConfiguration(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Resource\n\tif *v == nil {\n\t\tsv = &types.Resource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"details\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDetails(&sv.Details, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"id\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Id = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Type to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDetails(v **types.ResourceDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDetails\n\tif *v == nil {\n\t\tsv = &types.ResourceDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"awsEcrContainerImage\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAwsEcrContainerImageDetails(&sv.AwsEcrContainerImage, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceList(v *[]types.Resource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Resource\n\tif *v == nil {\n\t\tcv = []types.Resource{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Resource\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScanningRepositoryFilter(v **types.ScanningRepositoryFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ScanningRepositoryFilter\n\tif *v == nil {\n\t\tsv = &types.ScanningRepositoryFilter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"filter\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanningRepositoryFilterValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Filter = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"filterType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScanningRepositoryFilterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FilterType = types.ScanningRepositoryFilterType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(v *[]types.ScanningRepositoryFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ScanningRepositoryFilter\n\tif *v == nil {\n\t\tcv = []types.ScanningRepositoryFilter{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ScanningRepositoryFilter\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentScanningRepositoryFilter(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScanNotFoundException(v **types.ScanNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ScanNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ScanNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScoreDetails(v **types.ScoreDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ScoreDetails\n\tif *v == nil {\n\t\tsv = &types.ScoreDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"cvss\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCvssScoreDetails(&sv.Cvss, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ServerException\n\tif *v == nil {\n\t\tsv = &types.ServerException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Tag\n\tif *v == nil {\n\t\tsv = &types.Tag{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Tag\n\tif *v == nil {\n\t\tcv = []types.Tag{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Tag\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected TagValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TooManyTagsException\n\tif *v == nil {\n\t\tsv = &types.TooManyTagsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.UnsupportedImageTypeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedImageTypeException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedImageTypeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **types.UnsupportedUpstreamRegistryException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedUpstreamRegistryException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedUpstreamRegistryException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UploadNotFoundException\n\tif *v == nil {\n\t\tsv = &types.UploadNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ValidationException\n\tif *v == nil {\n\t\tsv = &types.ValidationException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.VulnerablePackage\n\tif *v == nil {\n\t\tsv = &types.VulnerablePackage{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"arch\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arch to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Arch = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"epoch\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Epoch to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Epoch = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"filePath\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected FilePath to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FilePath = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected VulnerablePackageName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"packageManager\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PackageManager to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PackageManager = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"release\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Release to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Release = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"sourceLayerHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SourceLayerHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceLayerHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Version to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentVulnerablePackagesList(v *[]types.VulnerablePackage, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.VulnerablePackage\n\tif *v == nil {\n\t\tcv = []types.VulnerablePackage{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.VulnerablePackage\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(v **BatchCheckLayerAvailabilityOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchCheckLayerAvailabilityOutput\n\tif *v == nil {\n\t\tsv = &BatchCheckLayerAvailabilityOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLayerFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"layers\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLayerList(&sv.Layers, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(v **BatchDeleteImageOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchDeleteImageOutput\n\tif *v == nil {\n\t\tsv = &BatchDeleteImageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifierList(&sv.ImageIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchGetImageOutput(v **BatchGetImageOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchGetImageOutput\n\tif *v == nil {\n\t\tsv = &BatchGetImageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"images\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageList(&sv.Images, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchGetRepositoryScanningConfigurationOutput(v **BatchGetRepositoryScanningConfigurationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchGetRepositoryScanningConfigurationOutput\n\tif *v == nil {\n\t\tsv = &BatchGetRepositoryScanningConfigurationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"scanningConfigurations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationList(&sv.ScanningConfigurations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(v **CompleteLayerUploadOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CompleteLayerUploadOutput\n\tif *v == nil {\n\t\tsv = &CompleteLayerUploadOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **CreatePullThroughCacheRuleOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreatePullThroughCacheRuleOutput\n\tif *v == nil {\n\t\tsv = &CreatePullThroughCacheRuleOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ecrRepositoryPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EcrRepositoryPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"upstreamRegistryUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UpstreamRegistryUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(v **CreateRepositoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateRepositoryOutput\n\tif *v == nil {\n\t\tsv = &CreateRepositoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"repository\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteLifecyclePolicyOutput(v **DeleteLifecyclePolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteLifecyclePolicyOutput\n\tif *v == nil {\n\t\tsv = &DeleteLifecyclePolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastEvaluatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastEvaluatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected EvaluationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"lifecyclePolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LifecyclePolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(v **DeletePullThroughCacheRuleOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeletePullThroughCacheRuleOutput\n\tif *v == nil {\n\t\tsv = &DeletePullThroughCacheRuleOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ecrRepositoryPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EcrRepositoryPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"upstreamRegistryUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UpstreamRegistryUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteRegistryPolicyOutput(v **DeleteRegistryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteRegistryPolicyOutput\n\tif *v == nil {\n\t\tsv = &DeleteRegistryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(v **DeleteRepositoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteRepositoryOutput\n\tif *v == nil {\n\t\tsv = &DeleteRepositoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"repository\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(v **DeleteRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &DeleteRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeImageReplicationStatusOutput(v **DescribeImageReplicationStatusOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeImageReplicationStatusOutput\n\tif *v == nil {\n\t\tsv = &DescribeImageReplicationStatusOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"replicationStatuses\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageReplicationStatusList(&sv.ReplicationStatuses, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeImageScanFindingsOutput(v **DescribeImageScanFindingsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeImageScanFindingsOutput\n\tif *v == nil {\n\t\tsv = &DescribeImageScanFindingsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanFindings\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanFindings(&sv.ImageScanFindings, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanStatus\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(v **DescribeImagesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeImagesOutput\n\tif *v == nil {\n\t\tsv = &DescribeImagesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageDetailList(&sv.ImageDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribePullThroughCacheRulesOutput(v **DescribePullThroughCacheRulesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribePullThroughCacheRulesOutput\n\tif *v == nil {\n\t\tsv = &DescribePullThroughCacheRulesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"pullThroughCacheRules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPullThroughCacheRuleList(&sv.PullThroughCacheRules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeRegistryOutput(v **DescribeRegistryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeRegistryOutput\n\tif *v == nil {\n\t\tsv = &DescribeRegistryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"replicationConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(v **DescribeRepositoriesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeRepositoriesOutput\n\tif *v == nil {\n\t\tsv = &DescribeRepositoriesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositories\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryList(&sv.Repositories, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(v **GetAuthorizationTokenOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetAuthorizationTokenOutput\n\tif *v == nil {\n\t\tsv = &GetAuthorizationTokenOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"authorizationData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAuthorizationDataList(&sv.AuthorizationData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetDownloadUrlForLayerOutput(v **GetDownloadUrlForLayerOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetDownloadUrlForLayerOutput\n\tif *v == nil {\n\t\tsv = &GetDownloadUrlForLayerOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"downloadUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DownloadUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyOutput(v **GetLifecyclePolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetLifecyclePolicyOutput\n\tif *v == nil {\n\t\tsv = &GetLifecyclePolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastEvaluatedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastEvaluatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected EvaluationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"lifecyclePolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LifecyclePolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyPreviewOutput(v **GetLifecyclePolicyPreviewOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetLifecyclePolicyPreviewOutput\n\tif *v == nil {\n\t\tsv = &GetLifecyclePolicyPreviewOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lifecyclePolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LifecyclePolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"previewResults\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResultList(&sv.PreviewResults, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyPreviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.LifecyclePolicyPreviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"summary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewSummary(&sv.Summary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRegistryPolicyOutput(v **GetRegistryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRegistryPolicyOutput\n\tif *v == nil {\n\t\tsv = &GetRegistryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRegistryScanningConfigurationOutput(v **GetRegistryScanningConfigurationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRegistryScanningConfigurationOutput\n\tif *v == nil {\n\t\tsv = &GetRegistryScanningConfigurationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"scanningConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(&sv.ScanningConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(v **GetRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &GetRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(v **InitiateLayerUploadOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *InitiateLayerUploadOutput\n\tif *v == nil {\n\t\tsv = &InitiateLayerUploadOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"partSize\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PartSize = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListImagesOutput\n\tif *v == nil {\n\t\tsv = &ListImagesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifierList(&sv.ImageIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListTagsForResourceOutput\n\tif *v == nil {\n\t\tsv = &ListTagsForResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutImageOutput(v **PutImageOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutImageOutput\n\tif *v == nil {\n\t\tsv = &PutImageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"image\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImage(&sv.Image, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutImageScanningConfigurationOutput(v **PutImageScanningConfigurationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutImageScanningConfigurationOutput\n\tif *v == nil {\n\t\tsv = &PutImageScanningConfigurationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageScanningConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutImageTagMutabilityOutput(v **PutImageTagMutabilityOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutImageTagMutabilityOutput\n\tif *v == nil {\n\t\tsv = &PutImageTagMutabilityOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageTagMutability\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageTagMutability to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageTagMutability = types.ImageTagMutability(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutLifecyclePolicyOutput(v **PutLifecyclePolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutLifecyclePolicyOutput\n\tif *v == nil {\n\t\tsv = &PutLifecyclePolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lifecyclePolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LifecyclePolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutRegistryPolicyOutput(v **PutRegistryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutRegistryPolicyOutput\n\tif *v == nil {\n\t\tsv = &PutRegistryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutRegistryScanningConfigurationOutput(v **PutRegistryScanningConfigurationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutRegistryScanningConfigurationOutput\n\tif *v == nil {\n\t\tsv = &PutRegistryScanningConfigurationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"registryScanningConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(&sv.RegistryScanningConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutReplicationConfigurationOutput(v **PutReplicationConfigurationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutReplicationConfigurationOutput\n\tif *v == nil {\n\t\tsv = &PutReplicationConfigurationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"replicationConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(v **SetRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *SetRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &SetRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartImageScanOutput(v **StartImageScanOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartImageScanOutput\n\tif *v == nil {\n\t\tsv = &StartImageScanOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageScanStatus\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartLifecyclePolicyPreviewOutput(v **StartLifecyclePolicyPreviewOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartLifecyclePolicyPreviewOutput\n\tif *v == nil {\n\t\tsv = &StartLifecyclePolicyPreviewOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lifecyclePolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LifecyclePolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LifecyclePolicyPreviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.LifecyclePolicyPreviewStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *TagResourceOutput\n\tif *v == nil {\n\t\tsv = &TagResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UntagResourceOutput\n\tif *v == nil {\n\t\tsv = &UntagResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UploadLayerPartOutput\n\tif *v == nil {\n\t\tsv = &UploadLayerPartOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastByteReceived\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LastByteReceived = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package ecr provides the API client, operations, and parameter types for Amazon\n// EC2 Container Registry.\n//\n// Amazon Elastic Container Registry Amazon Elastic Container Registry (Amazon\n// ECR) is a managed container image registry service. Customers can use the\n// familiar Docker CLI, or their preferred client, to push, pull, and manage\n// images. Amazon ECR provides a secure, scalable, and reliable registry for your\n// Docker or Open Container Initiative (OCI) images. Amazon ECR supports private\n// repositories with resource-based permissions using IAM so that specific users or\n// Amazon EC2 instances can access repositories and images. Amazon ECR has service\n// endpoints in each supported Region. For more information, see Amazon ECR\n// endpoints (https://docs.aws.amazon.com/general/latest/gr/ecr.html) in the Amazon\n// Web Services General Reference.\npackage ecr\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\nfunc resolveDefaultEndpointConfiguration(o *Options) {\n\tif o.EndpointResolver != nil {\n\t\treturn\n\t}\n\to.EndpointResolver = NewDefaultEndpointResolver()\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"ecr\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n\tresolver    EndpointResolver\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\tif w.awsResolver == nil {\n\t\tgoto fallback\n\t}\n\tendpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n\tif err == nil {\n\t\treturn endpoint, nil\n\t}\n\n\tif nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {\n\t\treturn endpoint, err\n\t}\n\nfallback:\n\tif w.resolver == nil {\n\t\treturn endpoint, fmt.Errorf(\"default endpoint resolver provided was nil\")\n\t}\n\treturn w.resolver.ResolveEndpoint(region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided\n// fallbackResolver for resolution.\n//\n// fallbackResolver must not be nil\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t\tresolver:    fallbackResolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\",\n        \"github.com/jmespath/go-jmespath\": \"v0.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_BatchCheckLayerAvailability.go\",\n        \"api_op_BatchDeleteImage.go\",\n        \"api_op_BatchGetImage.go\",\n        \"api_op_BatchGetRepositoryScanningConfiguration.go\",\n        \"api_op_CompleteLayerUpload.go\",\n        \"api_op_CreatePullThroughCacheRule.go\",\n        \"api_op_CreateRepository.go\",\n        \"api_op_DeleteLifecyclePolicy.go\",\n        \"api_op_DeletePullThroughCacheRule.go\",\n        \"api_op_DeleteRegistryPolicy.go\",\n        \"api_op_DeleteRepository.go\",\n        \"api_op_DeleteRepositoryPolicy.go\",\n        \"api_op_DescribeImageReplicationStatus.go\",\n        \"api_op_DescribeImageScanFindings.go\",\n        \"api_op_DescribeImages.go\",\n        \"api_op_DescribePullThroughCacheRules.go\",\n        \"api_op_DescribeRegistry.go\",\n        \"api_op_DescribeRepositories.go\",\n        \"api_op_GetAuthorizationToken.go\",\n        \"api_op_GetDownloadUrlForLayer.go\",\n        \"api_op_GetLifecyclePolicy.go\",\n        \"api_op_GetLifecyclePolicyPreview.go\",\n        \"api_op_GetRegistryPolicy.go\",\n        \"api_op_GetRegistryScanningConfiguration.go\",\n        \"api_op_GetRepositoryPolicy.go\",\n        \"api_op_InitiateLayerUpload.go\",\n        \"api_op_ListImages.go\",\n        \"api_op_ListTagsForResource.go\",\n        \"api_op_PutImage.go\",\n        \"api_op_PutImageScanningConfiguration.go\",\n        \"api_op_PutImageTagMutability.go\",\n        \"api_op_PutLifecyclePolicy.go\",\n        \"api_op_PutRegistryPolicy.go\",\n        \"api_op_PutRegistryScanningConfiguration.go\",\n        \"api_op_PutReplicationConfiguration.go\",\n        \"api_op_SetRepositoryPolicy.go\",\n        \"api_op_StartImageScan.go\",\n        \"api_op_StartLifecyclePolicyPreview.go\",\n        \"api_op_TagResource.go\",\n        \"api_op_UntagResource.go\",\n        \"api_op_UploadLayerPart.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"types/enums.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/ecr\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage ecr\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.18.11\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver ECR endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ecr-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"af-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.af-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"af-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-northeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-northeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-northeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-southeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-southeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-southeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ap-southeast-4.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.ca-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-east-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-west-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-central-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-north-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.eu-west-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.me-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.me-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.sa-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.cn-north-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.cn-northwest-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-iso-east-1.c2s.ic.gov\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-iso-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-iso-west-1.c2s.ic.gov\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-iso-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-isob-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-isob-east-1.sc2s.sgov.gov\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-isob-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ecr-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-gov-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"dkr-us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"dkr-us-gov-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-dkr-us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ecr-fips.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ecr-fips.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\tsmithyjson \"github.com/aws/smithy-go/encoding/json\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"path\"\n)\n\ntype awsAwsjson11_serializeOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchCheckLayerAvailability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchCheckLayerAvailabilityInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchCheckLayerAvailabilityInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpBatchDeleteImage struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchDeleteImage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchDeleteImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchDeleteImageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchDeleteImageInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpBatchGetImage struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchGetImage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchGetImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchGetImageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.BatchGetImage\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchGetImageInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpBatchGetRepositoryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchGetRepositoryScanningConfiguration) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchGetRepositoryScanningConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchGetRepositoryScanningConfigurationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.BatchGetRepositoryScanningConfiguration\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchGetRepositoryScanningConfigurationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCompleteLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCompleteLayerUpload) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCompleteLayerUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CompleteLayerUploadInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCompleteLayerUploadInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreatePullThroughCacheRule struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreatePullThroughCacheRule) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreatePullThroughCacheRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreatePullThroughCacheRuleInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateRepository struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateRepository) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateRepository) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateRepositoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.CreateRepository\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateRepositoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteLifecyclePolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteLifecyclePolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteLifecyclePolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeletePullThroughCacheRule struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeletePullThroughCacheRule) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeletePullThroughCacheRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeletePullThroughCacheRuleInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DeletePullThroughCacheRule\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeletePullThroughCacheRuleInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteRegistryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteRegistryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteRegistryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DeleteRegistryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteRegistryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteRepository struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteRepository) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteRepository) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteRepositoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DeleteRepository\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteRepositoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeImageReplicationStatus struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeImageReplicationStatus) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeImageReplicationStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeImageReplicationStatusInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribeImageReplicationStatus\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeImageReplicationStatusInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeImages struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeImages) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeImages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeImagesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribeImages\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeImagesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeImageScanFindings struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeImageScanFindings) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeImageScanFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeImageScanFindingsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeImageScanFindingsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribePullThroughCacheRules struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribePullThroughCacheRules) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribePullThroughCacheRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribePullThroughCacheRulesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribePullThroughCacheRules\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribePullThroughCacheRulesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeRegistry struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeRegistry) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeRegistry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeRegistryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribeRegistry\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeRegistryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeRepositories struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeRepositories) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeRepositories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeRepositoriesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.DescribeRepositories\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeRepositoriesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetAuthorizationToken struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetAuthorizationToken) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetAuthorizationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetAuthorizationTokenInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetAuthorizationTokenInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetDownloadUrlForLayer struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetDownloadUrlForLayer) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetDownloadUrlForLayer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetDownloadUrlForLayerInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetDownloadUrlForLayerInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetLifecyclePolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetLifecyclePolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetLifecyclePolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetLifecyclePolicyPreview struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetLifecyclePolicyPreview) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetLifecyclePolicyPreview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetLifecyclePolicyPreviewInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetLifecyclePolicyPreviewInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRegistryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRegistryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRegistryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetRegistryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRegistryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRegistryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRegistryScanningConfiguration) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRegistryScanningConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRegistryScanningConfigurationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetRegistryScanningConfiguration\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRegistryScanningConfigurationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpInitiateLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_serializeOpInitiateLayerUpload) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpInitiateLayerUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*InitiateLayerUploadInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentInitiateLayerUploadInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListImages struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListImages) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListImages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListImagesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.ListImages\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListImagesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListTagsForResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.ListTagsForResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutImage struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutImage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutImageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutImage\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutImageInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutImageScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutImageScanningConfiguration) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutImageScanningConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutImageScanningConfigurationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutImageScanningConfiguration\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutImageScanningConfigurationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutImageTagMutability struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutImageTagMutability) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutImageTagMutability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutImageTagMutabilityInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutImageTagMutabilityInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutLifecyclePolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutLifecyclePolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutLifecyclePolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutLifecyclePolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutRegistryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutRegistryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutRegistryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutRegistryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutRegistryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutRegistryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutRegistryScanningConfiguration struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutRegistryScanningConfiguration) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutRegistryScanningConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutRegistryScanningConfigurationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutRegistryScanningConfiguration\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutRegistryScanningConfigurationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutReplicationConfiguration struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutReplicationConfiguration) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutReplicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutReplicationConfigurationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.PutReplicationConfiguration\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutReplicationConfigurationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpSetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpSetRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*SetRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentSetRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartImageScan struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartImageScan) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartImageScan) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartImageScanInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.StartImageScan\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartImageScanInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartLifecyclePolicyPreview struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartLifecyclePolicyPreview) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartLifecyclePolicyPreview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartLifecyclePolicyPreviewInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartLifecyclePolicyPreviewInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpTagResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpTagResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*TagResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.TagResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUntagResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUntagResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UntagResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.UntagResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUploadLayerPart struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUploadLayerPart) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUploadLayerPart) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UploadLayerPartInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonEC2ContainerRegistry_V20150921.UploadLayerPart\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUploadLayerPartInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDescribeImagesFilter(v *types.DescribeImagesFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.TagStatus) > 0 {\n\t\tok := object.Key(\"tagStatus\")\n\t\tok.String(string(v.TagStatus))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.EncryptionType) > 0 {\n\t\tok := object.Key(\"encryptionType\")\n\t\tok.String(string(v.EncryptionType))\n\t}\n\n\tif v.KmsKey != nil {\n\t\tok := object.Key(\"kmsKey\")\n\t\tok.String(*v.KmsKey)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentGetAuthorizationTokenRegistryIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentImageIdentifier(v *types.ImageIdentifier, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageDigest != nil {\n\t\tok := object.Key(\"imageDigest\")\n\t\tok.String(*v.ImageDigest)\n\t}\n\n\tif v.ImageTag != nil {\n\t\tok := object.Key(\"imageTag\")\n\t\tok.String(*v.ImageTag)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentImageIdentifierList(v []types.ImageIdentifier, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifier(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentImageScanningConfiguration(v *types.ImageScanningConfiguration, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ScanOnPush {\n\t\tok := object.Key(\"scanOnPush\")\n\t\tok.Boolean(v.ScanOnPush)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentLayerDigestList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentLifecyclePolicyPreviewFilter(v *types.LifecyclePolicyPreviewFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.TagStatus) > 0 {\n\t\tok := object.Key(\"tagStatus\")\n\t\tok.String(string(v.TagStatus))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentListImagesFilter(v *types.ListImagesFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.TagStatus) > 0 {\n\t\tok := object.Key(\"tagStatus\")\n\t\tok.String(string(v.TagStatus))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMediaTypeList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPullThroughCacheRuleRepositoryPrefixList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRegistryScanningRule(v *types.RegistryScanningRule, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RepositoryFilters != nil {\n\t\tok := object.Key(\"repositoryFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentScanningRepositoryFilterList(v.RepositoryFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ScanFrequency) > 0 {\n\t\tok := object.Key(\"scanFrequency\")\n\t\tok.String(string(v.ScanFrequency))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRegistryScanningRuleList(v []types.RegistryScanningRule, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentRegistryScanningRule(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentReplicationConfiguration(v *types.ReplicationConfiguration, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Rules != nil {\n\t\tok := object.Key(\"rules\")\n\t\tif err := awsAwsjson11_serializeDocumentReplicationRuleList(v.Rules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentReplicationDestination(v *types.ReplicationDestination, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Region != nil {\n\t\tok := object.Key(\"region\")\n\t\tok.String(*v.Region)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentReplicationDestinationList(v []types.ReplicationDestination, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentReplicationDestination(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentReplicationRule(v *types.ReplicationRule, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Destinations != nil {\n\t\tok := object.Key(\"destinations\")\n\t\tif err := awsAwsjson11_serializeDocumentReplicationDestinationList(v.Destinations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RepositoryFilters != nil {\n\t\tok := object.Key(\"repositoryFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryFilterList(v.RepositoryFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentReplicationRuleList(v []types.ReplicationRule, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentReplicationRule(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRepositoryFilter(v *types.RepositoryFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filter != nil {\n\t\tok := object.Key(\"filter\")\n\t\tok.String(*v.Filter)\n\t}\n\n\tif len(v.FilterType) > 0 {\n\t\tok := object.Key(\"filterType\")\n\t\tok.String(string(v.FilterType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRepositoryFilterList(v []types.RepositoryFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRepositoryNameList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentScanningConfigurationRepositoryNameList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentScanningRepositoryFilter(v *types.ScanningRepositoryFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filter != nil {\n\t\tok := object.Key(\"filter\")\n\t\tok.String(*v.Filter)\n\t}\n\n\tif len(v.FilterType) > 0 {\n\t\tok := object.Key(\"filterType\")\n\t\tok.String(string(v.FilterType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentScanningRepositoryFilterList(v []types.ScanningRepositoryFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentScanningRepositoryFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerDigests != nil {\n\t\tok := object.Key(\"layerDigests\")\n\t\tif err := awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v.LayerDigests, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchDeleteImageInput(v *BatchDeleteImageInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchGetImageInput(v *BatchGetImageInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AcceptedMediaTypes != nil {\n\t\tok := object.Key(\"acceptedMediaTypes\")\n\t\tif err := awsAwsjson11_serializeDocumentMediaTypeList(v.AcceptedMediaTypes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchGetRepositoryScanningConfigurationInput(v *BatchGetRepositoryScanningConfigurationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RepositoryNames != nil {\n\t\tok := object.Key(\"repositoryNames\")\n\t\tif err := awsAwsjson11_serializeDocumentScanningConfigurationRepositoryNameList(v.RepositoryNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCompleteLayerUploadInput(v *CompleteLayerUploadInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerDigests != nil {\n\t\tok := object.Key(\"layerDigests\")\n\t\tif err := awsAwsjson11_serializeDocumentLayerDigestList(v.LayerDigests, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.UploadId != nil {\n\t\tok := object.Key(\"uploadId\")\n\t\tok.String(*v.UploadId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePullThroughCacheRuleInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.EcrRepositoryPrefix != nil {\n\t\tok := object.Key(\"ecrRepositoryPrefix\")\n\t\tok.String(*v.EcrRepositoryPrefix)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.UpstreamRegistryUrl != nil {\n\t\tok := object.Key(\"upstreamRegistryUrl\")\n\t\tok.String(*v.UpstreamRegistryUrl)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateRepositoryInput(v *CreateRepositoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.EncryptionConfiguration != nil {\n\t\tok := object.Key(\"encryptionConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ImageScanningConfiguration != nil {\n\t\tok := object.Key(\"imageScanningConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ImageTagMutability) > 0 {\n\t\tok := object.Key(\"imageTagMutability\")\n\t\tok.String(string(v.ImageTagMutability))\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteLifecyclePolicyInput(v *DeleteLifecyclePolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeletePullThroughCacheRuleInput(v *DeletePullThroughCacheRuleInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.EcrRepositoryPrefix != nil {\n\t\tok := object.Key(\"ecrRepositoryPrefix\")\n\t\tok.String(*v.EcrRepositoryPrefix)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteRegistryPolicyInput(v *DeleteRegistryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteRepositoryInput(v *DeleteRepositoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Force {\n\t\tok := object.Key(\"force\")\n\t\tok.Boolean(v.Force)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteRepositoryPolicyInput(v *DeleteRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeImageReplicationStatusInput(v *DescribeImageReplicationStatusInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageId != nil {\n\t\tok := object.Key(\"imageId\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifier(v.ImageId, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeImageScanFindingsInput(v *DescribeImageScanFindingsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageId != nil {\n\t\tok := object.Key(\"imageId\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifier(v.ImageId, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeImagesInput(v *DescribeImagesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filter != nil {\n\t\tok := object.Key(\"filter\")\n\t\tif err := awsAwsjson11_serializeDocumentDescribeImagesFilter(v.Filter, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribePullThroughCacheRulesInput(v *DescribePullThroughCacheRulesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.EcrRepositoryPrefixes != nil {\n\t\tok := object.Key(\"ecrRepositoryPrefixes\")\n\t\tif err := awsAwsjson11_serializeDocumentPullThroughCacheRuleRepositoryPrefixList(v.EcrRepositoryPrefixes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeRegistryInput(v *DescribeRegistryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeRepositoriesInput(v *DescribeRepositoriesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryNames != nil {\n\t\tok := object.Key(\"repositoryNames\")\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryNameList(v.RepositoryNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetAuthorizationTokenInput(v *GetAuthorizationTokenInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryIds != nil {\n\t\tok := object.Key(\"registryIds\")\n\t\tif err := awsAwsjson11_serializeDocumentGetAuthorizationTokenRegistryIdList(v.RegistryIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetDownloadUrlForLayerInput(v *GetDownloadUrlForLayerInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerDigest != nil {\n\t\tok := object.Key(\"layerDigest\")\n\t\tok.String(*v.LayerDigest)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetLifecyclePolicyInput(v *GetLifecyclePolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetLifecyclePolicyPreviewInput(v *GetLifecyclePolicyPreviewInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filter != nil {\n\t\tok := object.Key(\"filter\")\n\t\tif err := awsAwsjson11_serializeDocumentLifecyclePolicyPreviewFilter(v.Filter, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRegistryPolicyInput(v *GetRegistryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRegistryScanningConfigurationInput(v *GetRegistryScanningConfigurationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRepositoryPolicyInput(v *GetRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentInitiateLayerUploadInput(v *InitiateLayerUploadInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListImagesInput(v *ListImagesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filter != nil {\n\t\tok := object.Key(\"filter\")\n\t\tif err := awsAwsjson11_serializeDocumentListImagesFilter(v.Filter, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutImageInput(v *PutImageInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageDigest != nil {\n\t\tok := object.Key(\"imageDigest\")\n\t\tok.String(*v.ImageDigest)\n\t}\n\n\tif v.ImageManifest != nil {\n\t\tok := object.Key(\"imageManifest\")\n\t\tok.String(*v.ImageManifest)\n\t}\n\n\tif v.ImageManifestMediaType != nil {\n\t\tok := object.Key(\"imageManifestMediaType\")\n\t\tok.String(*v.ImageManifestMediaType)\n\t}\n\n\tif v.ImageTag != nil {\n\t\tok := object.Key(\"imageTag\")\n\t\tok.String(*v.ImageTag)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutImageScanningConfigurationInput(v *PutImageScanningConfigurationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageScanningConfiguration != nil {\n\t\tok := object.Key(\"imageScanningConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutImageTagMutabilityInput(v *PutImageTagMutabilityInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.ImageTagMutability) > 0 {\n\t\tok := object.Key(\"imageTagMutability\")\n\t\tok.String(string(v.ImageTagMutability))\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutLifecyclePolicyInput(v *PutLifecyclePolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LifecyclePolicyText != nil {\n\t\tok := object.Key(\"lifecyclePolicyText\")\n\t\tok.String(*v.LifecyclePolicyText)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutRegistryPolicyInput(v *PutRegistryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.PolicyText != nil {\n\t\tok := object.Key(\"policyText\")\n\t\tok.String(*v.PolicyText)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutRegistryScanningConfigurationInput(v *PutRegistryScanningConfigurationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Rules != nil {\n\t\tok := object.Key(\"rules\")\n\t\tif err := awsAwsjson11_serializeDocumentRegistryScanningRuleList(v.Rules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ScanType) > 0 {\n\t\tok := object.Key(\"scanType\")\n\t\tok.String(string(v.ScanType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutReplicationConfigurationInput(v *PutReplicationConfigurationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ReplicationConfiguration != nil {\n\t\tok := object.Key(\"replicationConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentReplicationConfiguration(v.ReplicationConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentSetRepositoryPolicyInput(v *SetRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Force {\n\t\tok := object.Key(\"force\")\n\t\tok.Boolean(v.Force)\n\t}\n\n\tif v.PolicyText != nil {\n\t\tok := object.Key(\"policyText\")\n\t\tok.String(*v.PolicyText)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartImageScanInput(v *StartImageScanInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageId != nil {\n\t\tok := object.Key(\"imageId\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifier(v.ImageId, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartLifecyclePolicyPreviewInput(v *StartLifecyclePolicyPreviewInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LifecyclePolicyText != nil {\n\t\tok := object.Key(\"lifecyclePolicyText\")\n\t\tok.String(*v.LifecyclePolicyText)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\tif v.TagKeys != nil {\n\t\tok := object.Key(\"tagKeys\")\n\t\tif err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerPartBlob != nil {\n\t\tok := object.Key(\"layerPartBlob\")\n\t\tok.Base64EncodeBytes(v.LayerPartBlob)\n\t}\n\n\tif v.PartFirstByte != nil {\n\t\tok := object.Key(\"partFirstByte\")\n\t\tok.Long(*v.PartFirstByte)\n\t}\n\n\tif v.PartLastByte != nil {\n\t\tok := object.Key(\"partLastByte\")\n\t\tok.Long(*v.PartLastByte)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.UploadId != nil {\n\t\tok := object.Key(\"uploadId\")\n\t\tok.String(*v.UploadId)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/enums.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\ntype EncryptionType string\n\n// Enum values for EncryptionType\nconst (\n\tEncryptionTypeAes256 EncryptionType = \"AES256\"\n\tEncryptionTypeKms    EncryptionType = \"KMS\"\n)\n\n// Values returns all known values for EncryptionType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (EncryptionType) Values() []EncryptionType {\n\treturn []EncryptionType{\n\t\t\"AES256\",\n\t\t\"KMS\",\n\t}\n}\n\ntype FindingSeverity string\n\n// Enum values for FindingSeverity\nconst (\n\tFindingSeverityInformational FindingSeverity = \"INFORMATIONAL\"\n\tFindingSeverityLow           FindingSeverity = \"LOW\"\n\tFindingSeverityMedium        FindingSeverity = \"MEDIUM\"\n\tFindingSeverityHigh          FindingSeverity = \"HIGH\"\n\tFindingSeverityCritical      FindingSeverity = \"CRITICAL\"\n\tFindingSeverityUndefined     FindingSeverity = \"UNDEFINED\"\n)\n\n// Values returns all known values for FindingSeverity. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (FindingSeverity) Values() []FindingSeverity {\n\treturn []FindingSeverity{\n\t\t\"INFORMATIONAL\",\n\t\t\"LOW\",\n\t\t\"MEDIUM\",\n\t\t\"HIGH\",\n\t\t\"CRITICAL\",\n\t\t\"UNDEFINED\",\n\t}\n}\n\ntype ImageActionType string\n\n// Enum values for ImageActionType\nconst (\n\tImageActionTypeExpire ImageActionType = \"EXPIRE\"\n)\n\n// Values returns all known values for ImageActionType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ImageActionType) Values() []ImageActionType {\n\treturn []ImageActionType{\n\t\t\"EXPIRE\",\n\t}\n}\n\ntype ImageFailureCode string\n\n// Enum values for ImageFailureCode\nconst (\n\tImageFailureCodeInvalidImageDigest            ImageFailureCode = \"InvalidImageDigest\"\n\tImageFailureCodeInvalidImageTag               ImageFailureCode = \"InvalidImageTag\"\n\tImageFailureCodeImageTagDoesNotMatchDigest    ImageFailureCode = \"ImageTagDoesNotMatchDigest\"\n\tImageFailureCodeImageNotFound                 ImageFailureCode = \"ImageNotFound\"\n\tImageFailureCodeMissingDigestAndTag           ImageFailureCode = \"MissingDigestAndTag\"\n\tImageFailureCodeImageReferencedByManifestList ImageFailureCode = \"ImageReferencedByManifestList\"\n\tImageFailureCodeKmsError                      ImageFailureCode = \"KmsError\"\n)\n\n// Values returns all known values for ImageFailureCode. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ImageFailureCode) Values() []ImageFailureCode {\n\treturn []ImageFailureCode{\n\t\t\"InvalidImageDigest\",\n\t\t\"InvalidImageTag\",\n\t\t\"ImageTagDoesNotMatchDigest\",\n\t\t\"ImageNotFound\",\n\t\t\"MissingDigestAndTag\",\n\t\t\"ImageReferencedByManifestList\",\n\t\t\"KmsError\",\n\t}\n}\n\ntype ImageTagMutability string\n\n// Enum values for ImageTagMutability\nconst (\n\tImageTagMutabilityMutable   ImageTagMutability = \"MUTABLE\"\n\tImageTagMutabilityImmutable ImageTagMutability = \"IMMUTABLE\"\n)\n\n// Values returns all known values for ImageTagMutability. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ImageTagMutability) Values() []ImageTagMutability {\n\treturn []ImageTagMutability{\n\t\t\"MUTABLE\",\n\t\t\"IMMUTABLE\",\n\t}\n}\n\ntype LayerAvailability string\n\n// Enum values for LayerAvailability\nconst (\n\tLayerAvailabilityAvailable   LayerAvailability = \"AVAILABLE\"\n\tLayerAvailabilityUnavailable LayerAvailability = \"UNAVAILABLE\"\n)\n\n// Values returns all known values for LayerAvailability. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (LayerAvailability) Values() []LayerAvailability {\n\treturn []LayerAvailability{\n\t\t\"AVAILABLE\",\n\t\t\"UNAVAILABLE\",\n\t}\n}\n\ntype LayerFailureCode string\n\n// Enum values for LayerFailureCode\nconst (\n\tLayerFailureCodeInvalidLayerDigest LayerFailureCode = \"InvalidLayerDigest\"\n\tLayerFailureCodeMissingLayerDigest LayerFailureCode = \"MissingLayerDigest\"\n)\n\n// Values returns all known values for LayerFailureCode. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (LayerFailureCode) Values() []LayerFailureCode {\n\treturn []LayerFailureCode{\n\t\t\"InvalidLayerDigest\",\n\t\t\"MissingLayerDigest\",\n\t}\n}\n\ntype LifecyclePolicyPreviewStatus string\n\n// Enum values for LifecyclePolicyPreviewStatus\nconst (\n\tLifecyclePolicyPreviewStatusInProgress LifecyclePolicyPreviewStatus = \"IN_PROGRESS\"\n\tLifecyclePolicyPreviewStatusComplete   LifecyclePolicyPreviewStatus = \"COMPLETE\"\n\tLifecyclePolicyPreviewStatusExpired    LifecyclePolicyPreviewStatus = \"EXPIRED\"\n\tLifecyclePolicyPreviewStatusFailed     LifecyclePolicyPreviewStatus = \"FAILED\"\n)\n\n// Values returns all known values for LifecyclePolicyPreviewStatus. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (LifecyclePolicyPreviewStatus) Values() []LifecyclePolicyPreviewStatus {\n\treturn []LifecyclePolicyPreviewStatus{\n\t\t\"IN_PROGRESS\",\n\t\t\"COMPLETE\",\n\t\t\"EXPIRED\",\n\t\t\"FAILED\",\n\t}\n}\n\ntype ReplicationStatus string\n\n// Enum values for ReplicationStatus\nconst (\n\tReplicationStatusInProgress ReplicationStatus = \"IN_PROGRESS\"\n\tReplicationStatusComplete   ReplicationStatus = \"COMPLETE\"\n\tReplicationStatusFailed     ReplicationStatus = \"FAILED\"\n)\n\n// Values returns all known values for ReplicationStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ReplicationStatus) Values() []ReplicationStatus {\n\treturn []ReplicationStatus{\n\t\t\"IN_PROGRESS\",\n\t\t\"COMPLETE\",\n\t\t\"FAILED\",\n\t}\n}\n\ntype RepositoryFilterType string\n\n// Enum values for RepositoryFilterType\nconst (\n\tRepositoryFilterTypePrefixMatch RepositoryFilterType = \"PREFIX_MATCH\"\n)\n\n// Values returns all known values for RepositoryFilterType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (RepositoryFilterType) Values() []RepositoryFilterType {\n\treturn []RepositoryFilterType{\n\t\t\"PREFIX_MATCH\",\n\t}\n}\n\ntype ScanFrequency string\n\n// Enum values for ScanFrequency\nconst (\n\tScanFrequencyScanOnPush     ScanFrequency = \"SCAN_ON_PUSH\"\n\tScanFrequencyContinuousScan ScanFrequency = \"CONTINUOUS_SCAN\"\n\tScanFrequencyManual         ScanFrequency = \"MANUAL\"\n)\n\n// Values returns all known values for ScanFrequency. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ScanFrequency) Values() []ScanFrequency {\n\treturn []ScanFrequency{\n\t\t\"SCAN_ON_PUSH\",\n\t\t\"CONTINUOUS_SCAN\",\n\t\t\"MANUAL\",\n\t}\n}\n\ntype ScanningConfigurationFailureCode string\n\n// Enum values for ScanningConfigurationFailureCode\nconst (\n\tScanningConfigurationFailureCodeRepositoryNotFound ScanningConfigurationFailureCode = \"REPOSITORY_NOT_FOUND\"\n)\n\n// Values returns all known values for ScanningConfigurationFailureCode. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (ScanningConfigurationFailureCode) Values() []ScanningConfigurationFailureCode {\n\treturn []ScanningConfigurationFailureCode{\n\t\t\"REPOSITORY_NOT_FOUND\",\n\t}\n}\n\ntype ScanningRepositoryFilterType string\n\n// Enum values for ScanningRepositoryFilterType\nconst (\n\tScanningRepositoryFilterTypeWildcard ScanningRepositoryFilterType = \"WILDCARD\"\n)\n\n// Values returns all known values for ScanningRepositoryFilterType. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (ScanningRepositoryFilterType) Values() []ScanningRepositoryFilterType {\n\treturn []ScanningRepositoryFilterType{\n\t\t\"WILDCARD\",\n\t}\n}\n\ntype ScanStatus string\n\n// Enum values for ScanStatus\nconst (\n\tScanStatusInProgress             ScanStatus = \"IN_PROGRESS\"\n\tScanStatusComplete               ScanStatus = \"COMPLETE\"\n\tScanStatusFailed                 ScanStatus = \"FAILED\"\n\tScanStatusUnsupportedImage       ScanStatus = \"UNSUPPORTED_IMAGE\"\n\tScanStatusActive                 ScanStatus = \"ACTIVE\"\n\tScanStatusPending                ScanStatus = \"PENDING\"\n\tScanStatusScanEligibilityExpired ScanStatus = \"SCAN_ELIGIBILITY_EXPIRED\"\n\tScanStatusFindingsUnavailable    ScanStatus = \"FINDINGS_UNAVAILABLE\"\n)\n\n// Values returns all known values for ScanStatus. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (ScanStatus) Values() []ScanStatus {\n\treturn []ScanStatus{\n\t\t\"IN_PROGRESS\",\n\t\t\"COMPLETE\",\n\t\t\"FAILED\",\n\t\t\"UNSUPPORTED_IMAGE\",\n\t\t\"ACTIVE\",\n\t\t\"PENDING\",\n\t\t\"SCAN_ELIGIBILITY_EXPIRED\",\n\t\t\"FINDINGS_UNAVAILABLE\",\n\t}\n}\n\ntype ScanType string\n\n// Enum values for ScanType\nconst (\n\tScanTypeBasic    ScanType = \"BASIC\"\n\tScanTypeEnhanced ScanType = \"ENHANCED\"\n)\n\n// Values returns all known values for ScanType. Note that this can be expanded in\n// the future, and so it is only as up to date as the client. The ordering of this\n// slice is not guaranteed to be stable across updates.\nfunc (ScanType) Values() []ScanType {\n\treturn []ScanType{\n\t\t\"BASIC\",\n\t\t\"ENHANCED\",\n\t}\n}\n\ntype TagStatus string\n\n// Enum values for TagStatus\nconst (\n\tTagStatusTagged   TagStatus = \"TAGGED\"\n\tTagStatusUntagged TagStatus = \"UNTAGGED\"\n\tTagStatusAny      TagStatus = \"ANY\"\n)\n\n// Values returns all known values for TagStatus. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (TagStatus) Values() []TagStatus {\n\treturn []TagStatus{\n\t\t\"TAGGED\",\n\t\t\"UNTAGGED\",\n\t\t\"ANY\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// The specified layer upload does not contain any layer parts.\ntype EmptyUploadException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *EmptyUploadException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *EmptyUploadException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *EmptyUploadException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"EmptyUploadException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *EmptyUploadException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image has already been pushed, and there were no changes to the\n// manifest or image tag after the last push.\ntype ImageAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image digest does not match the digest that Amazon ECR calculated\n// for the image.\ntype ImageDigestDoesNotMatchException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageDigestDoesNotMatchException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageDigestDoesNotMatchException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The image requested does not exist in the specified repository.\ntype ImageNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image is tagged with a tag that already exists. The repository is\n// configured for tag immutability.\ntype ImageTagAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageTagAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageTagAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The layer digest calculation performed by Amazon ECR upon receipt of the image\n// layer does not match the digest specified.\ntype InvalidLayerException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidLayerException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidLayerException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidLayerException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidLayerException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidLayerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The layer part size is not valid, or the first byte specified is not\n// consecutive to the last byte of a previous layer part upload.\ntype InvalidLayerPartException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tRegistryId            *string\n\tRepositoryName        *string\n\tUploadId              *string\n\tLastValidByteReceived *int64\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidLayerPartException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidLayerPartException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidLayerPartException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidLayerPartException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidLayerPartException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified parameter is invalid. Review the available parameters for the API\n// request.\ntype InvalidParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// An invalid parameter has been specified. Tag keys can have a maximum character\n// length of 128 characters, and tag values can have a maximum length of 256\n// characters.\ntype InvalidTagParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTagParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTagParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTagParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTagParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTagParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The operation failed due to a KMS exception.\ntype KmsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tKmsError *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *KmsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *KmsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *KmsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"KmsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *KmsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The image layer already exists in the associated repository.\ntype LayerAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayerAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayerAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayerAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayerAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayerAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified layer is not available because it is not associated with an\n// image. Unassociated image layers may be cleaned up at any time.\ntype LayerInaccessibleException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayerInaccessibleException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayerInaccessibleException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayerInaccessibleException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayerInaccessibleException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayerInaccessibleException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Layer parts must be at least 5 MiB in size.\ntype LayerPartTooSmallException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayerPartTooSmallException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayerPartTooSmallException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayerPartTooSmallException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayerPartTooSmallException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayerPartTooSmallException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified layers could not be found, or the specified layer is not valid\n// for this repository.\ntype LayersNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayersNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayersNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayersNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayersNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayersNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The lifecycle policy could not be found, and no policy is set to the repository.\ntype LifecyclePolicyNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LifecyclePolicyNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LifecyclePolicyNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LifecyclePolicyNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LifecyclePolicyNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LifecyclePolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The previous lifecycle policy preview request has not completed. Wait and try\n// again.\ntype LifecyclePolicyPreviewInProgressException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LifecyclePolicyPreviewInProgressException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LifecyclePolicyPreviewInProgressException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LifecyclePolicyPreviewInProgressException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LifecyclePolicyPreviewInProgressException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LifecyclePolicyPreviewInProgressException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// There is no dry run for this repository.\ntype LifecyclePolicyPreviewNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LifecyclePolicyPreviewNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LifecyclePolicyPreviewNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LifecyclePolicyPreviewNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LifecyclePolicyPreviewNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LifecyclePolicyPreviewNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The operation did not succeed because it would have exceeded a service limit\n// for your account. For more information, see Amazon ECR service quotas (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\n// in the Amazon Elastic Container Registry User Guide.\ntype LimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A pull through cache rule with these settings already exists for the private\n// registry.\ntype PullThroughCacheRuleAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *PullThroughCacheRuleAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *PullThroughCacheRuleAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *PullThroughCacheRuleAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"PullThroughCacheRuleAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *PullThroughCacheRuleAlreadyExistsException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The pull through cache rule was not found. Specify a valid pull through cache\n// rule and try again.\ntype PullThroughCacheRuleNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *PullThroughCacheRuleNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *PullThroughCacheRuleNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *PullThroughCacheRuleNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"PullThroughCacheRuleNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *PullThroughCacheRuleNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The manifest list is referencing an image that does not exist.\ntype ReferencedImagesNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ReferencedImagesNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ReferencedImagesNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The registry doesn't have an associated registry policy.\ntype RegistryPolicyNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RegistryPolicyNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RegistryPolicyNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RegistryPolicyNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RegistryPolicyNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RegistryPolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository already exists in the specified registry.\ntype RepositoryAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository contains images. To delete a repository that contains\n// images, you must force the deletion with the force parameter.\ntype RepositoryNotEmptyException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryNotEmptyException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryNotEmptyException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryNotEmptyException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryNotEmptyException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryNotEmptyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository could not be found. Check the spelling of the\n// specified repository and ensure that you are performing operations on the\n// correct registry.\ntype RepositoryNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository and registry combination does not have an associated\n// repository policy.\ntype RepositoryPolicyNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryPolicyNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryPolicyNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image scan could not be found. Ensure that image scanning is\n// enabled on the repository and try again.\ntype ScanNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ScanNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ScanNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ScanNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ScanNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ScanNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// These errors are usually caused by a server-side issue.\ntype ServerException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ServerException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ServerException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ServerException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ServerException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }\n\n// The list of tags on the repository is over the limit. The maximum number of\n// tags that can be applied to a repository is 50.\ntype TooManyTagsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TooManyTagsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TooManyTagsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TooManyTagsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TooManyTagsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The image is of a type that cannot be scanned.\ntype UnsupportedImageTypeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedImageTypeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedImageTypeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedImageTypeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedImageTypeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedImageTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified upstream registry isn't supported.\ntype UnsupportedUpstreamRegistryException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedUpstreamRegistryException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedUpstreamRegistryException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedUpstreamRegistryException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedUpstreamRegistryException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedUpstreamRegistryException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The upload could not be found, or the specified upload ID is not valid for this\n// repository.\ntype UploadNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UploadNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UploadNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UploadNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UploadNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UploadNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// There was an exception validating this request.\ntype ValidationException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ValidationException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ValidationException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ValidationException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ValidationException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"time\"\n)\n\n// This data type is used in the ImageScanFinding data type.\ntype Attribute struct {\n\n\t// The attribute key.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The value assigned to the attribute key.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing authorization data for an Amazon ECR registry.\ntype AuthorizationData struct {\n\n\t// A base64-encoded string that contains authorization data for the specified\n\t// Amazon ECR registry. When the string is decoded, it is presented in the format\n\t// user:password for private registry authentication using docker login .\n\tAuthorizationToken *string\n\n\t// The Unix time in seconds and milliseconds when the authorization token expires.\n\t// Authorization tokens are valid for 12 hours.\n\tExpiresAt *time.Time\n\n\t// The registry URL to use for this authorization token in a docker login command.\n\t// The Amazon ECR registry URL format is\n\t// https://aws_account_id.dkr.ecr.region.amazonaws.com . For example,\n\t// https://012345678910.dkr.ecr.us-east-1.amazonaws.com ..\n\tProxyEndpoint *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The image details of the Amazon ECR container image.\ntype AwsEcrContainerImageDetails struct {\n\n\t// The architecture of the Amazon ECR container image.\n\tArchitecture *string\n\n\t// The image author of the Amazon ECR container image.\n\tAuthor *string\n\n\t// The image hash of the Amazon ECR container image.\n\tImageHash *string\n\n\t// The image tags attached to the Amazon ECR container image.\n\tImageTags []string\n\n\t// The platform of the Amazon ECR container image.\n\tPlatform *string\n\n\t// The date and time the Amazon ECR container image was pushed.\n\tPushedAt *time.Time\n\n\t// The registry the Amazon ECR container image belongs to.\n\tRegistry *string\n\n\t// The name of the repository the Amazon ECR container image resides in.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The CVSS score for a finding.\ntype CvssScore struct {\n\n\t// The base CVSS score used for the finding.\n\tBaseScore float64\n\n\t// The vector string of the CVSS score.\n\tScoringVector *string\n\n\t// The source of the CVSS score.\n\tSource *string\n\n\t// The version of CVSS used for the score.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Details on adjustments Amazon Inspector made to the CVSS score for a finding.\ntype CvssScoreAdjustment struct {\n\n\t// The metric used to adjust the CVSS score.\n\tMetric *string\n\n\t// The reason the CVSS score has been adjustment.\n\tReason *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the CVSS score.\ntype CvssScoreDetails struct {\n\n\t// An object that contains details about adjustment Amazon Inspector made to the\n\t// CVSS score.\n\tAdjustments []CvssScoreAdjustment\n\n\t// The CVSS score.\n\tScore float64\n\n\t// The source for the CVSS score.\n\tScoreSource *string\n\n\t// The vector for the CVSS score.\n\tScoringVector *string\n\n\t// The CVSS version used in scoring.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing a filter on a DescribeImages operation.\ntype DescribeImagesFilter struct {\n\n\t// The tag status with which to filter your DescribeImages results. You can filter\n\t// results based on whether they are TAGGED or UNTAGGED .\n\tTagStatus TagStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// The encryption configuration for the repository. This determines how the\n// contents of your repository are encrypted at rest. By default, when no\n// encryption configuration is set or the AES256 encryption type is used, Amazon\n// ECR uses server-side encryption with Amazon S3-managed encryption keys which\n// encrypts your data at rest using an AES-256 encryption algorithm. This does not\n// require any action on your part. For more control over the encryption of the\n// contents of your repository, you can use server-side encryption with Key\n// Management Service key stored in Key Management Service (KMS) to encrypt your\n// images. For more information, see Amazon ECR encryption at rest (https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html)\n// in the Amazon Elastic Container Registry User Guide.\ntype EncryptionConfiguration struct {\n\n\t// The encryption type to use. If you use the KMS encryption type, the contents of\n\t// the repository will be encrypted using server-side encryption with Key\n\t// Management Service key stored in KMS. When you use KMS to encrypt your data, you\n\t// can either use the default Amazon Web Services managed KMS key for Amazon ECR,\n\t// or specify your own KMS key, which you already created. For more information,\n\t// see Protecting data using server-side encryption with an KMS key stored in Key\n\t// Management Service (SSE-KMS) (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html)\n\t// in the Amazon Simple Storage Service Console Developer Guide. If you use the\n\t// AES256 encryption type, Amazon ECR uses server-side encryption with Amazon\n\t// S3-managed encryption keys which encrypts the images in the repository using an\n\t// AES-256 encryption algorithm. For more information, see Protecting data using\n\t// server-side encryption with Amazon S3-managed encryption keys (SSE-S3) (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html)\n\t// in the Amazon Simple Storage Service Console Developer Guide.\n\t//\n\t// This member is required.\n\tEncryptionType EncryptionType\n\n\t// If you use the KMS encryption type, specify the KMS key to use for encryption.\n\t// The alias, key ID, or full ARN of the KMS key can be specified. The key must\n\t// exist in the same Region as the repository. If no key is specified, the default\n\t// Amazon Web Services managed KMS key for Amazon ECR will be used.\n\tKmsKey *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of an enhanced image scan. This is returned when enhanced scanning\n// is enabled for your private registry.\ntype EnhancedImageScanFinding struct {\n\n\t// The Amazon Web Services account ID associated with the image.\n\tAwsAccountId *string\n\n\t// The description of the finding.\n\tDescription *string\n\n\t// The Amazon Resource Number (ARN) of the finding.\n\tFindingArn *string\n\n\t// The date and time that the finding was first observed.\n\tFirstObservedAt *time.Time\n\n\t// The date and time that the finding was last observed.\n\tLastObservedAt *time.Time\n\n\t// An object that contains the details of a package vulnerability finding.\n\tPackageVulnerabilityDetails *PackageVulnerabilityDetails\n\n\t// An object that contains the details about how to remediate a finding.\n\tRemediation *Remediation\n\n\t// Contains information on the resources involved in a finding.\n\tResources []Resource\n\n\t// The Amazon Inspector score given to the finding.\n\tScore float64\n\n\t// An object that contains details of the Amazon Inspector score.\n\tScoreDetails *ScoreDetails\n\n\t// The severity of the finding.\n\tSeverity *string\n\n\t// The status of the finding.\n\tStatus *string\n\n\t// The title of the finding.\n\tTitle *string\n\n\t// The type of the finding.\n\tType *string\n\n\t// The date and time the finding was last updated at.\n\tUpdatedAt *time.Time\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing an Amazon ECR image.\ntype Image struct {\n\n\t// An object containing the image tag and image digest associated with an image.\n\tImageId *ImageIdentifier\n\n\t// The image manifest associated with the image.\n\tImageManifest *string\n\n\t// The manifest media type of the image.\n\tImageManifestMediaType *string\n\n\t// The Amazon Web Services account ID associated with the registry containing the\n\t// image.\n\tRegistryId *string\n\n\t// The name of the repository associated with the image.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that describes an image returned by a DescribeImages operation.\ntype ImageDetail struct {\n\n\t// The artifact media type of the image.\n\tArtifactMediaType *string\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The media type of the image manifest.\n\tImageManifestMediaType *string\n\n\t// The date and time, expressed in standard JavaScript date format, at which the\n\t// current image was pushed to the repository.\n\tImagePushedAt *time.Time\n\n\t// A summary of the last completed image scan.\n\tImageScanFindingsSummary *ImageScanFindingsSummary\n\n\t// The current state of the scan.\n\tImageScanStatus *ImageScanStatus\n\n\t// The size, in bytes, of the image in the repository. If the image is a manifest\n\t// list, this will be the max size of all manifests in the list. Beginning with\n\t// Docker version 1.9, the Docker client compresses image layers before pushing\n\t// them to a V2 Docker registry. The output of the docker images command shows the\n\t// uncompressed image size, so it may return a larger image size than the image\n\t// sizes returned by DescribeImages .\n\tImageSizeInBytes *int64\n\n\t// The list of tags associated with this image.\n\tImageTags []string\n\n\t// The date and time, expressed in standard JavaScript date format, when Amazon\n\t// ECR recorded the last image pull. Amazon ECR refreshes the last image pull\n\t// timestamp at least once every 24 hours. For example, if you pull an image once a\n\t// day then the lastRecordedPullTime timestamp will indicate the exact time that\n\t// the image was last pulled. However, if you pull an image once an hour, because\n\t// Amazon ECR refreshes the lastRecordedPullTime timestamp at least once every 24\n\t// hours, the result may not be the exact time that the image was last pulled.\n\tLastRecordedPullTime *time.Time\n\n\t// The Amazon Web Services account ID associated with the registry to which this\n\t// image belongs.\n\tRegistryId *string\n\n\t// The name of the repository to which this image belongs.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing an Amazon ECR image failure.\ntype ImageFailure struct {\n\n\t// The code associated with the failure.\n\tFailureCode ImageFailureCode\n\n\t// The reason for the failure.\n\tFailureReason *string\n\n\t// The image ID associated with the failure.\n\tImageId *ImageIdentifier\n\n\tnoSmithyDocumentSerde\n}\n\n// An object with identifying information for an image in an Amazon ECR repository.\ntype ImageIdentifier struct {\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The tag used for the image.\n\tImageTag *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The status of the replication process for an image.\ntype ImageReplicationStatus struct {\n\n\t// The failure code for a replication that has failed.\n\tFailureCode *string\n\n\t// The destination Region for the image replication.\n\tRegion *string\n\n\t// The Amazon Web Services account ID associated with the registry to which the\n\t// image belongs.\n\tRegistryId *string\n\n\t// The image replication status.\n\tStatus ReplicationStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains information about an image scan finding.\ntype ImageScanFinding struct {\n\n\t// A collection of attributes of the host from which the finding is generated.\n\tAttributes []Attribute\n\n\t// The description of the finding.\n\tDescription *string\n\n\t// The name associated with the finding, usually a CVE number.\n\tName *string\n\n\t// The finding severity.\n\tSeverity FindingSeverity\n\n\t// A link containing additional details about the security vulnerability.\n\tUri *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of an image scan.\ntype ImageScanFindings struct {\n\n\t// Details about the enhanced scan findings from Amazon Inspector.\n\tEnhancedFindings []EnhancedImageScanFinding\n\n\t// The image vulnerability counts, sorted by severity.\n\tFindingSeverityCounts map[string]int32\n\n\t// The findings from the image scan.\n\tFindings []ImageScanFinding\n\n\t// The time of the last completed image scan.\n\tImageScanCompletedAt *time.Time\n\n\t// The time when the vulnerability data was last scanned.\n\tVulnerabilitySourceUpdatedAt *time.Time\n\n\tnoSmithyDocumentSerde\n}\n\n// A summary of the last completed image scan.\ntype ImageScanFindingsSummary struct {\n\n\t// The image vulnerability counts, sorted by severity.\n\tFindingSeverityCounts map[string]int32\n\n\t// The time of the last completed image scan.\n\tImageScanCompletedAt *time.Time\n\n\t// The time when the vulnerability data was last scanned.\n\tVulnerabilitySourceUpdatedAt *time.Time\n\n\tnoSmithyDocumentSerde\n}\n\n// The image scanning configuration for a repository.\ntype ImageScanningConfiguration struct {\n\n\t// The setting that determines whether images are scanned after being pushed to a\n\t// repository. If set to true , images will be scanned after being pushed. If this\n\t// parameter is not specified, it will default to false and images will not be\n\t// scanned unless a scan is manually started with the API_StartImageScan (https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_StartImageScan.html)\n\t// API.\n\tScanOnPush bool\n\n\tnoSmithyDocumentSerde\n}\n\n// The current status of an image scan.\ntype ImageScanStatus struct {\n\n\t// The description of the image scan status.\n\tDescription *string\n\n\t// The current state of an image scan.\n\tStatus ScanStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing an Amazon ECR image layer.\ntype Layer struct {\n\n\t// The availability status of the image layer.\n\tLayerAvailability LayerAvailability\n\n\t// The sha256 digest of the image layer.\n\tLayerDigest *string\n\n\t// The size, in bytes, of the image layer.\n\tLayerSize *int64\n\n\t// The media type of the layer, such as\n\t// application/vnd.docker.image.rootfs.diff.tar.gzip or\n\t// application/vnd.oci.image.layer.v1.tar+gzip .\n\tMediaType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing an Amazon ECR image layer failure.\ntype LayerFailure struct {\n\n\t// The failure code associated with the failure.\n\tFailureCode LayerFailureCode\n\n\t// The reason for the failure.\n\tFailureReason *string\n\n\t// The layer digest associated with the failure.\n\tLayerDigest *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The filter for the lifecycle policy preview.\ntype LifecyclePolicyPreviewFilter struct {\n\n\t// The tag status of the image.\n\tTagStatus TagStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// The result of the lifecycle policy preview.\ntype LifecyclePolicyPreviewResult struct {\n\n\t// The type of action to be taken.\n\tAction *LifecyclePolicyRuleAction\n\n\t// The priority of the applied rule.\n\tAppliedRulePriority *int32\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The date and time, expressed in standard JavaScript date format, at which the\n\t// current image was pushed to the repository.\n\tImagePushedAt *time.Time\n\n\t// The list of tags associated with this image.\n\tImageTags []string\n\n\tnoSmithyDocumentSerde\n}\n\n// The summary of the lifecycle policy preview request.\ntype LifecyclePolicyPreviewSummary struct {\n\n\t// The number of expiring images.\n\tExpiringImageTotalCount *int32\n\n\tnoSmithyDocumentSerde\n}\n\n// The type of action to be taken.\ntype LifecyclePolicyRuleAction struct {\n\n\t// The type of action to be taken.\n\tType ImageActionType\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing a filter on a ListImages operation.\ntype ListImagesFilter struct {\n\n\t// The tag status with which to filter your ListImages results. You can filter\n\t// results based on whether they are TAGGED or UNTAGGED .\n\tTagStatus TagStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a package vulnerability finding.\ntype PackageVulnerabilityDetails struct {\n\n\t// An object that contains details about the CVSS score of a finding.\n\tCvss []CvssScore\n\n\t// One or more URLs that contain details about this vulnerability type.\n\tReferenceUrls []string\n\n\t// One or more vulnerabilities related to the one identified in this finding.\n\tRelatedVulnerabilities []string\n\n\t// The source of the vulnerability information.\n\tSource *string\n\n\t// A URL to the source of the vulnerability information.\n\tSourceUrl *string\n\n\t// The date and time that this vulnerability was first added to the vendor's\n\t// database.\n\tVendorCreatedAt *time.Time\n\n\t// The severity the vendor has given to this vulnerability type.\n\tVendorSeverity *string\n\n\t// The date and time the vendor last updated this vulnerability in their database.\n\tVendorUpdatedAt *time.Time\n\n\t// The ID given to this vulnerability.\n\tVulnerabilityId *string\n\n\t// The packages impacted by this vulnerability.\n\tVulnerablePackages []VulnerablePackage\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of a pull through cache rule.\ntype PullThroughCacheRule struct {\n\n\t// The date and time the pull through cache was created.\n\tCreatedAt *time.Time\n\n\t// The Amazon ECR repository prefix associated with the pull through cache rule.\n\tEcrRepositoryPrefix *string\n\n\t// The Amazon Web Services account ID associated with the registry the pull\n\t// through cache rule is associated with.\n\tRegistryId *string\n\n\t// The upstream registry URL associated with the pull through cache rule.\n\tUpstreamRegistryUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Details about the recommended course of action to remediate the finding.\ntype Recommendation struct {\n\n\t// The recommended course of action to remediate the finding.\n\tText *string\n\n\t// The URL address to the CVE remediation recommendations.\n\tUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The scanning configuration for a private registry.\ntype RegistryScanningConfiguration struct {\n\n\t// The scanning rules associated with the registry.\n\tRules []RegistryScanningRule\n\n\t// The type of scanning configured for the registry.\n\tScanType ScanType\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of a scanning rule for a private registry.\ntype RegistryScanningRule struct {\n\n\t// The repository filters associated with the scanning configuration for a private\n\t// registry.\n\t//\n\t// This member is required.\n\tRepositoryFilters []ScanningRepositoryFilter\n\n\t// The frequency that scans are performed at for a private registry. When the\n\t// ENHANCED scan type is specified, the supported scan frequencies are\n\t// CONTINUOUS_SCAN and SCAN_ON_PUSH . When the BASIC scan type is specified, the\n\t// SCAN_ON_PUSH and MANUAL scan frequencies are supported.\n\t//\n\t// This member is required.\n\tScanFrequency ScanFrequency\n\n\tnoSmithyDocumentSerde\n}\n\n// Information on how to remediate a finding.\ntype Remediation struct {\n\n\t// An object that contains information about the recommended course of action to\n\t// remediate the finding.\n\tRecommendation *Recommendation\n\n\tnoSmithyDocumentSerde\n}\n\n// The replication configuration for a registry.\ntype ReplicationConfiguration struct {\n\n\t// An array of objects representing the replication destinations and repository\n\t// filters for a replication configuration.\n\t//\n\t// This member is required.\n\tRules []ReplicationRule\n\n\tnoSmithyDocumentSerde\n}\n\n// An array of objects representing the destination for a replication rule.\ntype ReplicationDestination struct {\n\n\t// The Region to replicate to.\n\t//\n\t// This member is required.\n\tRegion *string\n\n\t// The Amazon Web Services account ID of the Amazon ECR private registry to\n\t// replicate to. When configuring cross-Region replication within your own\n\t// registry, specify your own account ID.\n\t//\n\t// This member is required.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An array of objects representing the replication destinations and repository\n// filters for a replication configuration.\ntype ReplicationRule struct {\n\n\t// An array of objects representing the destination for a replication rule.\n\t//\n\t// This member is required.\n\tDestinations []ReplicationDestination\n\n\t// An array of objects representing the filters for a replication rule. Specifying\n\t// a repository filter for a replication rule provides a method for controlling\n\t// which repositories in a private registry are replicated.\n\tRepositoryFilters []RepositoryFilter\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing a repository.\ntype Repository struct {\n\n\t// The date and time, in JavaScript date format, when the repository was created.\n\tCreatedAt *time.Time\n\n\t// The encryption configuration for the repository. This determines how the\n\t// contents of your repository are encrypted at rest.\n\tEncryptionConfiguration *EncryptionConfiguration\n\n\t// The image scanning configuration for a repository.\n\tImageScanningConfiguration *ImageScanningConfiguration\n\n\t// The tag mutability setting for the repository.\n\tImageTagMutability ImageTagMutability\n\n\t// The Amazon Web Services account ID associated with the registry that contains\n\t// the repository.\n\tRegistryId *string\n\n\t// The Amazon Resource Name (ARN) that identifies the repository. The ARN contains\n\t// the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web\n\t// Services account ID of the repository owner, repository namespace, and\n\t// repository name. For example, arn:aws:ecr:region:012345678910:repository/test .\n\tRepositoryArn *string\n\n\t// The name of the repository.\n\tRepositoryName *string\n\n\t// The URI for the repository. You can use this URI for container image push and\n\t// pull operations.\n\tRepositoryUri *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The filter settings used with image replication. Specifying a repository filter\n// to a replication rule provides a method for controlling which repositories in a\n// private registry are replicated. If no repository filter is specified, all\n// images in the repository are replicated.\ntype RepositoryFilter struct {\n\n\t// The repository filter details. When the PREFIX_MATCH filter type is specified,\n\t// this value is required and should be the repository name prefix to configure\n\t// replication for.\n\t//\n\t// This member is required.\n\tFilter *string\n\n\t// The repository filter type. The only supported value is PREFIX_MATCH , which is\n\t// a repository name prefix specified with the filter parameter.\n\t//\n\t// This member is required.\n\tFilterType RepositoryFilterType\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of the scanning configuration for a repository.\ntype RepositoryScanningConfiguration struct {\n\n\t// The scan filters applied to the repository.\n\tAppliedScanFilters []ScanningRepositoryFilter\n\n\t// The ARN of the repository.\n\tRepositoryArn *string\n\n\t// The name of the repository.\n\tRepositoryName *string\n\n\t// The scan frequency for the repository.\n\tScanFrequency ScanFrequency\n\n\t// Whether or not scan on push is configured for the repository.\n\tScanOnPush bool\n\n\tnoSmithyDocumentSerde\n}\n\n// The details about any failures associated with the scanning configuration of a\n// repository.\ntype RepositoryScanningConfigurationFailure struct {\n\n\t// The failure code.\n\tFailureCode ScanningConfigurationFailureCode\n\n\t// The reason for the failure.\n\tFailureReason *string\n\n\t// The name of the repository.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Details about the resource involved in a finding.\ntype Resource struct {\n\n\t// An object that contains details about the resource involved in a finding.\n\tDetails *ResourceDetails\n\n\t// The ID of the resource.\n\tId *string\n\n\t// The tags attached to the resource.\n\tTags map[string]string\n\n\t// The type of resource.\n\tType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains details about the resource involved in the finding.\ntype ResourceDetails struct {\n\n\t// An object that contains details about the Amazon ECR container image involved\n\t// in the finding.\n\tAwsEcrContainerImage *AwsEcrContainerImageDetails\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of a scanning repository filter. For more information on how to use\n// filters, see Using filters (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html#image-scanning-filters)\n// in the Amazon Elastic Container Registry User Guide.\ntype ScanningRepositoryFilter struct {\n\n\t// The filter to use when scanning.\n\t//\n\t// This member is required.\n\tFilter *string\n\n\t// The type associated with the filter.\n\t//\n\t// This member is required.\n\tFilterType ScanningRepositoryFilterType\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the Amazon Inspector score given to a finding.\ntype ScoreDetails struct {\n\n\t// An object that contains details about the CVSS score given to a finding.\n\tCvss *CvssScoreDetails\n\n\tnoSmithyDocumentSerde\n}\n\n// The metadata to apply to a resource to help you categorize and organize them.\n// Each tag consists of a key and a value, both of which you define. Tag keys can\n// have a maximum character length of 128 characters, and tag values can have a\n// maximum length of 256 characters.\ntype Tag struct {\n\n\t// One part of a key-value pair that make up a tag. A key is a general label that\n\t// acts like a category for more specific tag values.\n\tKey *string\n\n\t// A value acts as a descriptor within a tag category (key).\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information on the vulnerable package identified by a finding.\ntype VulnerablePackage struct {\n\n\t// The architecture of the vulnerable package.\n\tArch *string\n\n\t// The epoch of the vulnerable package.\n\tEpoch *int32\n\n\t// The file path of the vulnerable package.\n\tFilePath *string\n\n\t// The name of the vulnerable package.\n\tName *string\n\n\t// The package manager of the vulnerable package.\n\tPackageManager *string\n\n\t// The release of the vulnerable package.\n\tRelease *string\n\n\t// The source layer hash of the vulnerable package.\n\tSourceLayerHash *string\n\n\t// The version of the vulnerable package.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecr/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecr\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*validateOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchCheckLayerAvailability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchCheckLayerAvailabilityInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchCheckLayerAvailabilityInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpBatchDeleteImage struct {\n}\n\nfunc (*validateOpBatchDeleteImage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchDeleteImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchDeleteImageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchDeleteImageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpBatchGetImage struct {\n}\n\nfunc (*validateOpBatchGetImage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchGetImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchGetImageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchGetImageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpBatchGetRepositoryScanningConfiguration struct {\n}\n\nfunc (*validateOpBatchGetRepositoryScanningConfiguration) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchGetRepositoryScanningConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchGetRepositoryScanningConfigurationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchGetRepositoryScanningConfigurationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCompleteLayerUpload struct {\n}\n\nfunc (*validateOpCompleteLayerUpload) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCompleteLayerUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CompleteLayerUploadInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCompleteLayerUploadInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreatePullThroughCacheRule struct {\n}\n\nfunc (*validateOpCreatePullThroughCacheRule) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreatePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreatePullThroughCacheRuleInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreatePullThroughCacheRuleInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateRepository struct {\n}\n\nfunc (*validateOpCreateRepository) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateRepository) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateRepositoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateRepositoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteLifecyclePolicy struct {\n}\n\nfunc (*validateOpDeleteLifecyclePolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteLifecyclePolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteLifecyclePolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeletePullThroughCacheRule struct {\n}\n\nfunc (*validateOpDeletePullThroughCacheRule) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeletePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeletePullThroughCacheRuleInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeletePullThroughCacheRuleInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteRepository struct {\n}\n\nfunc (*validateOpDeleteRepository) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteRepository) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteRepositoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteRepositoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*validateOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeImageReplicationStatus struct {\n}\n\nfunc (*validateOpDescribeImageReplicationStatus) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeImageReplicationStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeImageReplicationStatusInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeImageReplicationStatusInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeImageScanFindings struct {\n}\n\nfunc (*validateOpDescribeImageScanFindings) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeImageScanFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeImageScanFindingsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeImageScanFindingsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeImages struct {\n}\n\nfunc (*validateOpDescribeImages) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeImages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeImagesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeImagesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetDownloadUrlForLayer struct {\n}\n\nfunc (*validateOpGetDownloadUrlForLayer) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetDownloadUrlForLayer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetDownloadUrlForLayerInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetDownloadUrlForLayerInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetLifecyclePolicy struct {\n}\n\nfunc (*validateOpGetLifecyclePolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetLifecyclePolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetLifecyclePolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetLifecyclePolicyPreview struct {\n}\n\nfunc (*validateOpGetLifecyclePolicyPreview) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetLifecyclePolicyPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetLifecyclePolicyPreviewInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetLifecyclePolicyPreviewInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetRepositoryPolicy struct {\n}\n\nfunc (*validateOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpInitiateLayerUpload struct {\n}\n\nfunc (*validateOpInitiateLayerUpload) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpInitiateLayerUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*InitiateLayerUploadInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpInitiateLayerUploadInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListImages struct {\n}\n\nfunc (*validateOpListImages) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListImages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListImagesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListImagesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListTagsForResource struct {\n}\n\nfunc (*validateOpListTagsForResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListTagsForResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutImage struct {\n}\n\nfunc (*validateOpPutImage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutImageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutImageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutImageScanningConfiguration struct {\n}\n\nfunc (*validateOpPutImageScanningConfiguration) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutImageScanningConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutImageScanningConfigurationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutImageScanningConfigurationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutImageTagMutability struct {\n}\n\nfunc (*validateOpPutImageTagMutability) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutImageTagMutability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutImageTagMutabilityInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutImageTagMutabilityInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutLifecyclePolicy struct {\n}\n\nfunc (*validateOpPutLifecyclePolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutLifecyclePolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutLifecyclePolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutRegistryPolicy struct {\n}\n\nfunc (*validateOpPutRegistryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutRegistryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutRegistryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutRegistryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutRegistryScanningConfiguration struct {\n}\n\nfunc (*validateOpPutRegistryScanningConfiguration) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutRegistryScanningConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutRegistryScanningConfigurationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutRegistryScanningConfigurationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutReplicationConfiguration struct {\n}\n\nfunc (*validateOpPutReplicationConfiguration) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutReplicationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutReplicationConfigurationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutReplicationConfigurationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpSetRepositoryPolicy struct {\n}\n\nfunc (*validateOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpSetRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*SetRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpSetRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartImageScan struct {\n}\n\nfunc (*validateOpStartImageScan) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartImageScan) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartImageScanInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartImageScanInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartLifecyclePolicyPreview struct {\n}\n\nfunc (*validateOpStartLifecyclePolicyPreview) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartLifecyclePolicyPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartLifecyclePolicyPreviewInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartLifecyclePolicyPreviewInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpTagResource struct {\n}\n\nfunc (*validateOpTagResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*TagResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpTagResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUntagResource struct {\n}\n\nfunc (*validateOpUntagResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UntagResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUntagResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUploadLayerPart struct {\n}\n\nfunc (*validateOpUploadLayerPart) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUploadLayerPart) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UploadLayerPartInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUploadLayerPartInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpBatchCheckLayerAvailabilityValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchCheckLayerAvailability{}, middleware.After)\n}\n\nfunc addOpBatchDeleteImageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchDeleteImage{}, middleware.After)\n}\n\nfunc addOpBatchGetImageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchGetImage{}, middleware.After)\n}\n\nfunc addOpBatchGetRepositoryScanningConfigurationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchGetRepositoryScanningConfiguration{}, middleware.After)\n}\n\nfunc addOpCompleteLayerUploadValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCompleteLayerUpload{}, middleware.After)\n}\n\nfunc addOpCreatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreatePullThroughCacheRule{}, middleware.After)\n}\n\nfunc addOpCreateRepositoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateRepository{}, middleware.After)\n}\n\nfunc addOpDeleteLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteLifecyclePolicy{}, middleware.After)\n}\n\nfunc addOpDeletePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeletePullThroughCacheRule{}, middleware.After)\n}\n\nfunc addOpDeleteRepositoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteRepository{}, middleware.After)\n}\n\nfunc addOpDeleteRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpDescribeImageReplicationStatusValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeImageReplicationStatus{}, middleware.After)\n}\n\nfunc addOpDescribeImageScanFindingsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeImageScanFindings{}, middleware.After)\n}\n\nfunc addOpDescribeImagesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeImages{}, middleware.After)\n}\n\nfunc addOpGetDownloadUrlForLayerValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetDownloadUrlForLayer{}, middleware.After)\n}\n\nfunc addOpGetLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetLifecyclePolicy{}, middleware.After)\n}\n\nfunc addOpGetLifecyclePolicyPreviewValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetLifecyclePolicyPreview{}, middleware.After)\n}\n\nfunc addOpGetRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpInitiateLayerUploadValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpInitiateLayerUpload{}, middleware.After)\n}\n\nfunc addOpListImagesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListImages{}, middleware.After)\n}\n\nfunc addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)\n}\n\nfunc addOpPutImageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutImage{}, middleware.After)\n}\n\nfunc addOpPutImageScanningConfigurationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutImageScanningConfiguration{}, middleware.After)\n}\n\nfunc addOpPutImageTagMutabilityValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutImageTagMutability{}, middleware.After)\n}\n\nfunc addOpPutLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutLifecyclePolicy{}, middleware.After)\n}\n\nfunc addOpPutRegistryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutRegistryPolicy{}, middleware.After)\n}\n\nfunc addOpPutRegistryScanningConfigurationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutRegistryScanningConfiguration{}, middleware.After)\n}\n\nfunc addOpPutReplicationConfigurationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutReplicationConfiguration{}, middleware.After)\n}\n\nfunc addOpSetRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpSetRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpStartImageScanValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartImageScan{}, middleware.After)\n}\n\nfunc addOpStartLifecyclePolicyPreviewValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartLifecyclePolicyPreview{}, middleware.After)\n}\n\nfunc addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpTagResource{}, middleware.After)\n}\n\nfunc addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)\n}\n\nfunc addOpUploadLayerPartValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUploadLayerPart{}, middleware.After)\n}\n\nfunc validateEncryptionConfiguration(v *types.EncryptionConfiguration) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"EncryptionConfiguration\"}\n\tif len(v.EncryptionType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"EncryptionType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRegistryScanningRule(v *types.RegistryScanningRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegistryScanningRule\"}\n\tif len(v.ScanFrequency) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ScanFrequency\"))\n\t}\n\tif v.RepositoryFilters == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryFilters\"))\n\t} else if v.RepositoryFilters != nil {\n\t\tif err := validateScanningRepositoryFilterList(v.RepositoryFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"RepositoryFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRegistryScanningRuleList(v []types.RegistryScanningRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegistryScanningRuleList\"}\n\tfor i := range v {\n\t\tif err := validateRegistryScanningRule(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateReplicationConfiguration(v *types.ReplicationConfiguration) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ReplicationConfiguration\"}\n\tif v.Rules == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Rules\"))\n\t} else if v.Rules != nil {\n\t\tif err := validateReplicationRuleList(v.Rules); err != nil {\n\t\t\tinvalidParams.AddNested(\"Rules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateReplicationDestination(v *types.ReplicationDestination) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ReplicationDestination\"}\n\tif v.Region == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Region\"))\n\t}\n\tif v.RegistryId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RegistryId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateReplicationDestinationList(v []types.ReplicationDestination) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ReplicationDestinationList\"}\n\tfor i := range v {\n\t\tif err := validateReplicationDestination(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateReplicationRule(v *types.ReplicationRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ReplicationRule\"}\n\tif v.Destinations == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Destinations\"))\n\t} else if v.Destinations != nil {\n\t\tif err := validateReplicationDestinationList(v.Destinations); err != nil {\n\t\t\tinvalidParams.AddNested(\"Destinations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.RepositoryFilters != nil {\n\t\tif err := validateRepositoryFilterList(v.RepositoryFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"RepositoryFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateReplicationRuleList(v []types.ReplicationRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ReplicationRuleList\"}\n\tfor i := range v {\n\t\tif err := validateReplicationRule(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRepositoryFilter(v *types.RepositoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RepositoryFilter\"}\n\tif v.Filter == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Filter\"))\n\t}\n\tif len(v.FilterType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"FilterType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRepositoryFilterList(v []types.RepositoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RepositoryFilterList\"}\n\tfor i := range v {\n\t\tif err := validateRepositoryFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateScanningRepositoryFilter(v *types.ScanningRepositoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ScanningRepositoryFilter\"}\n\tif v.Filter == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Filter\"))\n\t}\n\tif len(v.FilterType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"FilterType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateScanningRepositoryFilterList(v []types.ScanningRepositoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ScanningRepositoryFilterList\"}\n\tfor i := range v {\n\t\tif err := validateScanningRepositoryFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchCheckLayerAvailabilityInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.LayerDigests == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerDigests\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpBatchDeleteImageInput(v *BatchDeleteImageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchDeleteImageInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageIds == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageIds\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpBatchGetImageInput(v *BatchGetImageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchGetImageInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageIds == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageIds\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpBatchGetRepositoryScanningConfigurationInput(v *BatchGetRepositoryScanningConfigurationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchGetRepositoryScanningConfigurationInput\"}\n\tif v.RepositoryNames == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryNames\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCompleteLayerUploadInput(v *CompleteLayerUploadInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CompleteLayerUploadInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.UploadId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"UploadId\"))\n\t}\n\tif v.LayerDigests == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerDigests\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreatePullThroughCacheRuleInput(v *CreatePullThroughCacheRuleInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreatePullThroughCacheRuleInput\"}\n\tif v.EcrRepositoryPrefix == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"EcrRepositoryPrefix\"))\n\t}\n\tif v.UpstreamRegistryUrl == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"UpstreamRegistryUrl\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateRepositoryInput(v *CreateRepositoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateRepositoryInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.EncryptionConfiguration != nil {\n\t\tif err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"EncryptionConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteLifecyclePolicyInput(v *DeleteLifecyclePolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteLifecyclePolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeletePullThroughCacheRuleInput(v *DeletePullThroughCacheRuleInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeletePullThroughCacheRuleInput\"}\n\tif v.EcrRepositoryPrefix == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"EcrRepositoryPrefix\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteRepositoryInput(v *DeleteRepositoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteRepositoryInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteRepositoryPolicyInput(v *DeleteRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeImageReplicationStatusInput(v *DescribeImageReplicationStatusInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeImageReplicationStatusInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeImageScanFindingsInput(v *DescribeImageScanFindingsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeImageScanFindingsInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeImagesInput(v *DescribeImagesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeImagesInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetDownloadUrlForLayerInput(v *GetDownloadUrlForLayerInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetDownloadUrlForLayerInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.LayerDigest == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerDigest\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetLifecyclePolicyInput(v *GetLifecyclePolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetLifecyclePolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetLifecyclePolicyPreviewInput(v *GetLifecyclePolicyPreviewInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetLifecyclePolicyPreviewInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetRepositoryPolicyInput(v *GetRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpInitiateLayerUploadInput(v *InitiateLayerUploadInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InitiateLayerUploadInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListImagesInput(v *ListImagesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListImagesInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListTagsForResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutImageInput(v *PutImageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutImageInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageManifest == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageManifest\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutImageScanningConfigurationInput(v *PutImageScanningConfigurationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutImageScanningConfigurationInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageScanningConfiguration == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageScanningConfiguration\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutImageTagMutabilityInput(v *PutImageTagMutabilityInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutImageTagMutabilityInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif len(v.ImageTagMutability) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageTagMutability\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutLifecyclePolicyInput(v *PutLifecyclePolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutLifecyclePolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.LifecyclePolicyText == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LifecyclePolicyText\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutRegistryPolicyInput(v *PutRegistryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutRegistryPolicyInput\"}\n\tif v.PolicyText == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PolicyText\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutRegistryScanningConfigurationInput(v *PutRegistryScanningConfigurationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutRegistryScanningConfigurationInput\"}\n\tif v.Rules != nil {\n\t\tif err := validateRegistryScanningRuleList(v.Rules); err != nil {\n\t\t\tinvalidParams.AddNested(\"Rules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutReplicationConfigurationInput(v *PutReplicationConfigurationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutReplicationConfigurationInput\"}\n\tif v.ReplicationConfiguration == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ReplicationConfiguration\"))\n\t} else if v.ReplicationConfiguration != nil {\n\t\tif err := validateReplicationConfiguration(v.ReplicationConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"ReplicationConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpSetRepositoryPolicyInput(v *SetRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SetRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.PolicyText == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PolicyText\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartImageScanInput(v *StartImageScanInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartImageScanInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartLifecyclePolicyPreviewInput(v *StartLifecyclePolicyPreviewInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartLifecyclePolicyPreviewInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpTagResourceInput(v *TagResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TagResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.Tags == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Tags\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUntagResourceInput(v *UntagResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UntagResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.TagKeys == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TagKeys\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUploadLayerPartInput(v *UploadLayerPartInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UploadLayerPartInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.UploadId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"UploadId\"))\n\t}\n\tif v.PartFirstByte == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PartFirstByte\"))\n\t}\n\tif v.PartLastByte == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PartLastByte\"))\n\t}\n\tif v.LayerPartBlob == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerPartBlob\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/CHANGELOG.md",
    "content": "# v1.16.2 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.16.1 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2023-04-11)\n\n* **Feature**: This release will allow using registry alias as registryId in BatchDeleteImage request.\n\n# v1.15.8 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.15.7 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.6 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.5 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.4 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n\n# v1.15.3 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.2 (2023-02-15)\n\n* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.\n* **Bug Fix**: Correct error type parsing for restJson services.\n\n# v1.15.1 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2023-01-09)\n\n* **Feature**: This release for Amazon ECR Public makes several change to bring the SDK into sync with the API.\n\n# v1.14.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.13.22 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.21 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.20 (2022-11-30)\n\n* No change notes available for this release.\n\n# v1.13.19 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.18 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.17 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.16 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.15 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.14 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.13 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.12 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.11 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.10 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.9 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.6 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2021-12-21)\n\n* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens.\n\n# v1.8.2 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-11-12)\n\n* **Feature**: Service clients now support custom endpoints that have an initial URI path defined.\n\n# v1.7.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.2 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-08-27)\n\n* **Feature**: Updated API model to latest revision.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nconst ServiceID = \"ECR PUBLIC\"\nconst ServiceAPIVersion = \"2020-10-30\"\n\n// Client provides the API client to make operations call for Amazon Elastic\n// Container Registry Public.\ntype Client struct {\n\toptions Options\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveDefaultEndpointConfiguration(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\treturn client\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\tEndpointResolver EndpointResolver\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts. When creating a new API Clients this\n\t// member will only be used if the Retryer Options member is nil. This value will\n\t// be ignored if Retryer is not nil. If specified in an operation call's functional\n\t// options with a value that is different than the constructed client's Options,\n\t// the Client's Retryer will be wrapped to use the operation's specific\n\t// RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified. When creating a new API Clients this\n\t// member will only be used if the Retryer Options member is nil. This value will\n\t// be ignored if Retryer is not nil. Currently does not support per operation call\n\t// overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time. Currently does not support per operation call\n\t// overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// WithEndpointResolver returns a functional option for setting the Client's\n// EndpointResolver option.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttemptOptions(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:             cfg.Region,\n\t\tDefaultsMode:       cfg.DefaultsMode,\n\t\tRuntimeEnvironment: cfg.RuntimeEnvironment,\n\t\tHTTPClient:         cfg.HTTPClient,\n\t\tCredentials:        cfg.Credentials,\n\t\tAPIOptions:         cfg.APIOptions,\n\t\tLogger:             cfg.Logger,\n\t\tClientLogMode:      cfg.ClientLogMode,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttemptOptions(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())\n}\n\nfunc addClientUserAgent(stack *middleware.Stack) error {\n\treturn awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"ecrpublic\", goModuleVersion)(stack)\n}\n\nfunc addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {\n\tmw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{\n\t\tCredentialsProvider: o.Credentials,\n\t\tSigner:              o.HTTPSignerV4,\n\t\tLogSigning:          o.ClientLogMode.IsSigning(),\n\t})\n\treturn stack.Finalize.Add(mw, middleware.After)\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc addRetryMiddlewares(stack *middleware.Stack, o Options) error {\n\tmo := retry.AddRetryMiddlewaresOptions{\n\t\tRetryer:          o.Retryer,\n\t\tLogRetryAttempts: o.ClientLogMode.IsRetries(),\n\t}\n\treturn retry.AddRetryMiddlewares(stack, mo)\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn awsmiddleware.AddRequestIDRetrieverMiddleware(stack)\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn awshttp.AddResponseErrorMiddleware(stack)\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchCheckLayerAvailability.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Checks the availability of one or more image layers that are within a\n// repository in a public registry. When an image is pushed to a repository, each\n// image layer is checked to verify if it has been uploaded before. If it has been\n// uploaded, then the image layer is skipped. This operation is used by the Amazon\n// ECR proxy and is not generally used by customers for pulling and pushing images.\n// In most cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) BatchCheckLayerAvailability(ctx context.Context, params *BatchCheckLayerAvailabilityInput, optFns ...func(*Options)) (*BatchCheckLayerAvailabilityOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchCheckLayerAvailabilityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchCheckLayerAvailability\", params, optFns, c.addOperationBatchCheckLayerAvailabilityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchCheckLayerAvailabilityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype BatchCheckLayerAvailabilityInput struct {\n\n\t// The digests of the image layers to check.\n\t//\n\t// This member is required.\n\tLayerDigests []string\n\n\t// The name of the repository that's associated with the image layers to check.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID, or registry alias, associated with the\n\t// public registry that contains the image layers to check. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchCheckLayerAvailabilityOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.LayerFailure\n\n\t// A list of image layer objects that correspond to the image layer references in\n\t// the request.\n\tLayers []types.Layer\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchCheckLayerAvailability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchCheckLayerAvailability{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchCheckLayerAvailabilityValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCheckLayerAvailability(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchCheckLayerAvailability(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"BatchCheckLayerAvailability\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchDeleteImage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a list of specified images that are within a repository in a public\n// registry. Images are specified with either an imageTag or imageDigest . You can\n// remove a tag from an image by specifying the image's tag in your request. When\n// you remove the last tag from an image, the image is deleted from your\n// repository. You can completely delete an image (and all of its tags) by\n// specifying the digest of the image in your request.\nfunc (c *Client) BatchDeleteImage(ctx context.Context, params *BatchDeleteImageInput, optFns ...func(*Options)) (*BatchDeleteImageOutput, error) {\n\tif params == nil {\n\t\tparams = &BatchDeleteImageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"BatchDeleteImage\", params, optFns, c.addOperationBatchDeleteImageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*BatchDeleteImageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype BatchDeleteImageInput struct {\n\n\t// A list of image ID references that correspond to images to delete. The format\n\t// of the imageIds reference is imageTag=tag or imageDigest=digest .\n\t//\n\t// This member is required.\n\tImageIds []types.ImageIdentifier\n\n\t// The repository in a public registry that contains the image to delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID, or registry alias, that's associated with\n\t// the registry that contains the image to delete. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype BatchDeleteImageOutput struct {\n\n\t// Any failures associated with the call.\n\tFailures []types.ImageFailure\n\n\t// The image IDs of the deleted images.\n\tImageIds []types.ImageIdentifier\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpBatchDeleteImageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteImage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opBatchDeleteImage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"BatchDeleteImage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CompleteLayerUpload.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Informs Amazon ECR that the image layer upload is complete for a specified\n// public registry, repository name, and upload ID. You can optionally provide a\n// sha256 digest of the image layer for data validation purposes. When an image is\n// pushed, the CompleteLayerUpload API is called once for each new image layer to\n// verify that the upload is complete. This operation is used by the Amazon ECR\n// proxy and is not generally used by customers for pulling and pushing images. In\n// most cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) CompleteLayerUpload(ctx context.Context, params *CompleteLayerUploadInput, optFns ...func(*Options)) (*CompleteLayerUploadOutput, error) {\n\tif params == nil {\n\t\tparams = &CompleteLayerUploadInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CompleteLayerUpload\", params, optFns, c.addOperationCompleteLayerUploadMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CompleteLayerUploadOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CompleteLayerUploadInput struct {\n\n\t// The sha256 digest of the image layer.\n\t//\n\t// This member is required.\n\tLayerDigests []string\n\n\t// The name of the repository in a public registry to associate with the image\n\t// layer.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The upload ID from a previous InitiateLayerUpload operation to associate with\n\t// the image layer.\n\t//\n\t// This member is required.\n\tUploadId *string\n\n\t// The Amazon Web Services account ID, or registry alias, associated with the\n\t// registry where layers are uploaded. If you do not specify a registry, the\n\t// default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CompleteLayerUploadOutput struct {\n\n\t// The sha256 digest of the image layer.\n\tLayerDigest *string\n\n\t// The public registry ID that's associated with the request.\n\tRegistryId *string\n\n\t// The repository name that's associated with the request.\n\tRepositoryName *string\n\n\t// The upload ID that's associated with the layer.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCompleteLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCompleteLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCompleteLayerUploadValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCompleteLayerUpload(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCompleteLayerUpload(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"CompleteLayerUpload\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CreateRepository.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates a repository in a public registry. For more information, see Amazon ECR\n// repositories (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) CreateRepository(ctx context.Context, params *CreateRepositoryInput, optFns ...func(*Options)) (*CreateRepositoryOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateRepositoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateRepository\", params, optFns, c.addOperationCreateRepositoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateRepositoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateRepositoryInput struct {\n\n\t// The name to use for the repository. This appears publicly in the Amazon ECR\n\t// Public Gallery. The repository name can be specified on its own (for example\n\t// nginx-web-app ) or prepended with a namespace to group the repository into a\n\t// category (for example project-a/nginx-web-app ).\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The details about the repository that are publicly visible in the Amazon ECR\n\t// Public Gallery.\n\tCatalogData *types.RepositoryCatalogDataInput\n\n\t// The metadata that you apply to each repository to help categorize and organize\n\t// your repositories. Each tag consists of a key and an optional value. You define\n\t// both of them. Tag keys can have a maximum character length of 128 characters,\n\t// and tag values can have a maximum length of 256 characters.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateRepositoryOutput struct {\n\n\t// The catalog data for a repository. This data is publicly visible in the Amazon\n\t// ECR Public Gallery.\n\tCatalogData *types.RepositoryCatalogData\n\n\t// The repository that was created.\n\tRepository *types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateRepositoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepository(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateRepository(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"CreateRepository\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepository.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a repository in a public registry. If the repository contains images,\n// you must either manually delete all images in the repository or use the force\n// option. This option deletes all images on your behalf before deleting the\n// repository.\nfunc (c *Client) DeleteRepository(ctx context.Context, params *DeleteRepositoryInput, optFns ...func(*Options)) (*DeleteRepositoryOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteRepositoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteRepository\", params, optFns, c.addOperationDeleteRepositoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteRepositoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteRepositoryInput struct {\n\n\t// The name of the repository to delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The force option can be used to delete a repository that contains images. If\n\t// the force option is not used, the repository must be empty prior to deletion.\n\tForce bool\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository to delete. If you do not specify a registry, the\n\t// default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteRepositoryOutput struct {\n\n\t// The repository that was deleted.\n\tRepository *types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRepository{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteRepositoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepository(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteRepository(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DeleteRepository\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes the repository policy that's associated with the specified repository.\nfunc (c *Client) DeleteRepositoryPolicy(ctx context.Context, params *DeleteRepositoryPolicyInput, optFns ...func(*Options)) (*DeleteRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteRepositoryPolicy\", params, optFns, c.addOperationDeleteRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteRepositoryPolicyInput struct {\n\n\t// The name of the repository that's associated with the repository policy to\n\t// delete.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository policy to delete. If you do not specify a registry,\n\t// the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteRepositoryPolicyOutput struct {\n\n\t// The JSON repository policy that was deleted from the repository.\n\tPolicyText *string\n\n\t// The registry ID that's associated with the request.\n\tRegistryId *string\n\n\t// The repository name that's associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DeleteRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImageTags.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns the image tag details for a repository in a public registry.\nfunc (c *Client) DescribeImageTags(ctx context.Context, params *DescribeImageTagsInput, optFns ...func(*Options)) (*DescribeImageTagsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeImageTagsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeImageTags\", params, optFns, c.addOperationDescribeImageTagsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeImageTagsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeImageTagsInput struct {\n\n\t// The name of the repository that contains the image tag details to describe.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The maximum number of repository results that's returned by DescribeImageTags\n\t// in paginated output. When this parameter is used, DescribeImageTags only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. You can see the remaining results of the initial request by sending\n\t// another DescribeImageTags request with the returned nextToken value. This value\n\t// can be between 1 and 1000. If this parameter isn't used, then DescribeImageTags\n\t// returns up to 100 results and a nextToken value, if applicable. If you specify\n\t// images with imageIds , you can't use this option.\n\tMaxResults *int32\n\n\t// The nextToken value that's returned from a previous paginated DescribeImageTags\n\t// request where maxResults was used and the results exceeded the value of that\n\t// parameter. Pagination continues from the end of the previous results that\n\t// returned the nextToken value. If there are no more results to return, this\n\t// value is null . If you specify images with imageIds , you can't use this option.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository where images are described. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeImageTagsOutput struct {\n\n\t// The image tag details for the images in the requested repository.\n\tImageTagDetails []types.ImageTagDetail\n\n\t// The nextToken value to include in a future DescribeImageTags request. When the\n\t// results of a DescribeImageTags request exceed maxResults , you can use this\n\t// value to retrieve the next page of results. If there are no more results to\n\t// return, this value is null .\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeImageTagsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageTags{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeImageTags{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeImageTagsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageTags(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeImageTagsAPIClient is a client that implements the DescribeImageTags\n// operation.\ntype DescribeImageTagsAPIClient interface {\n\tDescribeImageTags(context.Context, *DescribeImageTagsInput, ...func(*Options)) (*DescribeImageTagsOutput, error)\n}\n\nvar _ DescribeImageTagsAPIClient = (*Client)(nil)\n\n// DescribeImageTagsPaginatorOptions is the paginator options for DescribeImageTags\ntype DescribeImageTagsPaginatorOptions struct {\n\t// The maximum number of repository results that's returned by DescribeImageTags\n\t// in paginated output. When this parameter is used, DescribeImageTags only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. You can see the remaining results of the initial request by sending\n\t// another DescribeImageTags request with the returned nextToken value. This value\n\t// can be between 1 and 1000. If this parameter isn't used, then DescribeImageTags\n\t// returns up to 100 results and a nextToken value, if applicable. If you specify\n\t// images with imageIds , you can't use this option.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeImageTagsPaginator is a paginator for DescribeImageTags\ntype DescribeImageTagsPaginator struct {\n\toptions   DescribeImageTagsPaginatorOptions\n\tclient    DescribeImageTagsAPIClient\n\tparams    *DescribeImageTagsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeImageTagsPaginator returns a new DescribeImageTagsPaginator\nfunc NewDescribeImageTagsPaginator(client DescribeImageTagsAPIClient, params *DescribeImageTagsInput, optFns ...func(*DescribeImageTagsPaginatorOptions)) *DescribeImageTagsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeImageTagsInput{}\n\t}\n\n\toptions := DescribeImageTagsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeImageTagsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeImageTagsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeImageTags page.\nfunc (p *DescribeImageTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImageTagsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeImageTags(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeImageTags(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DescribeImageTags\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImages.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns metadata that's related to the images in a repository in a public\n// registry. Beginning with Docker version 1.9, the Docker client compresses image\n// layers before pushing them to a V2 Docker registry. The output of the docker\n// images command shows the uncompressed image size. Therefore, it might return a\n// larger image size than the image sizes that are returned by DescribeImages .\nfunc (c *Client) DescribeImages(ctx context.Context, params *DescribeImagesInput, optFns ...func(*Options)) (*DescribeImagesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeImagesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeImages\", params, optFns, c.addOperationDescribeImagesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeImagesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeImagesInput struct {\n\n\t// The repository that contains the images to describe.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The list of image IDs for the requested repository.\n\tImageIds []types.ImageIdentifier\n\n\t// The maximum number of repository results that's returned by DescribeImages in\n\t// paginated output. When this parameter is used, DescribeImages only returns\n\t// maxResults results in a single page along with a nextToken response element.\n\t// You can see the remaining results of the initial request by sending another\n\t// DescribeImages request with the returned nextToken value. This value can be\n\t// between 1 and 1000. If this parameter isn't used, then DescribeImages returns\n\t// up to 100 results and a nextToken value, if applicable. If you specify images\n\t// with imageIds , you can't use this option.\n\tMaxResults *int32\n\n\t// The nextToken value that's returned from a previous paginated DescribeImages\n\t// request where maxResults was used and the results exceeded the value of that\n\t// parameter. Pagination continues from the end of the previous results that\n\t// returned the nextToken value. If there are no more results to return, this\n\t// value is null . If you specify images with imageIds , you can't use this option.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository where images are described. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeImagesOutput struct {\n\n\t// A list of ImageDetail objects that contain data about the image.\n\tImageDetails []types.ImageDetail\n\n\t// The nextToken value to include in a future DescribeImages request. When the\n\t// results of a DescribeImages request exceed maxResults , you can use this value\n\t// to retrieve the next page of results. If there are no more results to return,\n\t// this value is null .\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeImages{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeImagesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImages(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeImagesAPIClient is a client that implements the DescribeImages\n// operation.\ntype DescribeImagesAPIClient interface {\n\tDescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error)\n}\n\nvar _ DescribeImagesAPIClient = (*Client)(nil)\n\n// DescribeImagesPaginatorOptions is the paginator options for DescribeImages\ntype DescribeImagesPaginatorOptions struct {\n\t// The maximum number of repository results that's returned by DescribeImages in\n\t// paginated output. When this parameter is used, DescribeImages only returns\n\t// maxResults results in a single page along with a nextToken response element.\n\t// You can see the remaining results of the initial request by sending another\n\t// DescribeImages request with the returned nextToken value. This value can be\n\t// between 1 and 1000. If this parameter isn't used, then DescribeImages returns\n\t// up to 100 results and a nextToken value, if applicable. If you specify images\n\t// with imageIds , you can't use this option.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeImagesPaginator is a paginator for DescribeImages\ntype DescribeImagesPaginator struct {\n\toptions   DescribeImagesPaginatorOptions\n\tclient    DescribeImagesAPIClient\n\tparams    *DescribeImagesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeImagesPaginator returns a new DescribeImagesPaginator\nfunc NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeImagesInput{}\n\t}\n\n\toptions := DescribeImagesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeImagesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeImagesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeImages page.\nfunc (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeImages(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DescribeImages\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRegistries.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns details for a public registry.\nfunc (c *Client) DescribeRegistries(ctx context.Context, params *DescribeRegistriesInput, optFns ...func(*Options)) (*DescribeRegistriesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeRegistriesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeRegistries\", params, optFns, c.addOperationDescribeRegistriesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeRegistriesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeRegistriesInput struct {\n\n\t// The maximum number of repository results that's returned by DescribeRegistries\n\t// in paginated output. When this parameter is used, DescribeRegistries only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. The remaining results of the initial request can be seen by sending\n\t// another DescribeRegistries request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter isn't used, then\n\t// DescribeRegistries returns up to 100 results and a nextToken value, if\n\t// applicable.\n\tMaxResults *int32\n\n\t// The nextToken value that's returned from a previous paginated DescribeRegistries\n\t// request where maxResults was used and the results exceeded the value of that\n\t// parameter. Pagination continues from the end of the previous results that\n\t// returned the nextToken value. If there are no more results to return, this\n\t// value is null . This token should be treated as an opaque identifier that is\n\t// only used to retrieve the next items in a list and not for other programmatic\n\t// purposes.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeRegistriesOutput struct {\n\n\t// An object that contains the details for a public registry.\n\t//\n\t// This member is required.\n\tRegistries []types.Registry\n\n\t// The nextToken value to include in a future DescribeRepositories request. If the\n\t// results of a DescribeRepositories request exceed maxResults , you can use this\n\t// value to retrieve the next page of results. If there are no more results, this\n\t// value is null .\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeRegistriesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRegistries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRegistries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRegistries(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeRegistriesAPIClient is a client that implements the DescribeRegistries\n// operation.\ntype DescribeRegistriesAPIClient interface {\n\tDescribeRegistries(context.Context, *DescribeRegistriesInput, ...func(*Options)) (*DescribeRegistriesOutput, error)\n}\n\nvar _ DescribeRegistriesAPIClient = (*Client)(nil)\n\n// DescribeRegistriesPaginatorOptions is the paginator options for\n// DescribeRegistries\ntype DescribeRegistriesPaginatorOptions struct {\n\t// The maximum number of repository results that's returned by DescribeRegistries\n\t// in paginated output. When this parameter is used, DescribeRegistries only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. The remaining results of the initial request can be seen by sending\n\t// another DescribeRegistries request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter isn't used, then\n\t// DescribeRegistries returns up to 100 results and a nextToken value, if\n\t// applicable.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeRegistriesPaginator is a paginator for DescribeRegistries\ntype DescribeRegistriesPaginator struct {\n\toptions   DescribeRegistriesPaginatorOptions\n\tclient    DescribeRegistriesAPIClient\n\tparams    *DescribeRegistriesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeRegistriesPaginator returns a new DescribeRegistriesPaginator\nfunc NewDescribeRegistriesPaginator(client DescribeRegistriesAPIClient, params *DescribeRegistriesInput, optFns ...func(*DescribeRegistriesPaginatorOptions)) *DescribeRegistriesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeRegistriesInput{}\n\t}\n\n\toptions := DescribeRegistriesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeRegistriesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeRegistriesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeRegistries page.\nfunc (p *DescribeRegistriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRegistriesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeRegistries(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeRegistries(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DescribeRegistries\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRepositories.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes repositories that are in a public registry.\nfunc (c *Client) DescribeRepositories(ctx context.Context, params *DescribeRepositoriesInput, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeRepositoriesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeRepositories\", params, optFns, c.addOperationDescribeRepositoriesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeRepositoriesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeRepositoriesInput struct {\n\n\t// The maximum number of repository results that's returned by DescribeRepositories\n\t// in paginated output. When this parameter is used, DescribeRepositories only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. You can see the remaining results of the initial request by sending\n\t// another DescribeRepositories request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter isn't used, then\n\t// DescribeRepositories returns up to 100 results and a nextToken value, if\n\t// applicable. If you specify repositories with repositoryNames , you can't use\n\t// this option.\n\tMaxResults *int32\n\n\t// The nextToken value that's returned from a previous paginated\n\t// DescribeRepositories request where maxResults was used and the results exceeded\n\t// the value of that parameter. Pagination continues from the end of the previous\n\t// results that returned the nextToken value. If there are no more results to\n\t// return, this value is null . If you specify repositories with repositoryNames ,\n\t// you can't use this option. This token should be treated as an opaque identifier\n\t// that is only used to retrieve the next items in a list and not for other\n\t// programmatic purposes.\n\tNextToken *string\n\n\t// The Amazon Web Services account ID that's associated with the registry that\n\t// contains the repositories to be described. If you do not specify a registry, the\n\t// default public registry is assumed.\n\tRegistryId *string\n\n\t// A list of repositories to describe. If this parameter is omitted, then all\n\t// repositories in a registry are described.\n\tRepositoryNames []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeRepositoriesOutput struct {\n\n\t// The nextToken value to include in a future DescribeRepositories request. When\n\t// the results of a DescribeRepositories request exceed maxResults , this value can\n\t// be used to retrieve the next page of results. If there are no more results to\n\t// return, this value is null .\n\tNextToken *string\n\n\t// A list of repository objects corresponding to valid repositories.\n\tRepositories []types.Repository\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRepositories{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRepositories{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRepositories(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeRepositoriesAPIClient is a client that implements the\n// DescribeRepositories operation.\ntype DescribeRepositoriesAPIClient interface {\n\tDescribeRepositories(context.Context, *DescribeRepositoriesInput, ...func(*Options)) (*DescribeRepositoriesOutput, error)\n}\n\nvar _ DescribeRepositoriesAPIClient = (*Client)(nil)\n\n// DescribeRepositoriesPaginatorOptions is the paginator options for\n// DescribeRepositories\ntype DescribeRepositoriesPaginatorOptions struct {\n\t// The maximum number of repository results that's returned by DescribeRepositories\n\t// in paginated output. When this parameter is used, DescribeRepositories only\n\t// returns maxResults results in a single page along with a nextToken response\n\t// element. You can see the remaining results of the initial request by sending\n\t// another DescribeRepositories request with the returned nextToken value. This\n\t// value can be between 1 and 1000. If this parameter isn't used, then\n\t// DescribeRepositories returns up to 100 results and a nextToken value, if\n\t// applicable. If you specify repositories with repositoryNames , you can't use\n\t// this option.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeRepositoriesPaginator is a paginator for DescribeRepositories\ntype DescribeRepositoriesPaginator struct {\n\toptions   DescribeRepositoriesPaginatorOptions\n\tclient    DescribeRepositoriesAPIClient\n\tparams    *DescribeRepositoriesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeRepositoriesPaginator returns a new DescribeRepositoriesPaginator\nfunc NewDescribeRepositoriesPaginator(client DescribeRepositoriesAPIClient, params *DescribeRepositoriesInput, optFns ...func(*DescribeRepositoriesPaginatorOptions)) *DescribeRepositoriesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeRepositoriesInput{}\n\t}\n\n\toptions := DescribeRepositoriesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeRepositoriesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeRepositoriesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeRepositories page.\nfunc (p *DescribeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeRepositories(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"DescribeRepositories\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetAuthorizationToken.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves an authorization token. An authorization token represents your IAM\n// authentication credentials. You can use it to access any Amazon ECR registry\n// that your IAM principal has access to. The authorization token is valid for 12\n// hours. This API requires the ecr-public:GetAuthorizationToken and\n// sts:GetServiceBearerToken permissions.\nfunc (c *Client) GetAuthorizationToken(ctx context.Context, params *GetAuthorizationTokenInput, optFns ...func(*Options)) (*GetAuthorizationTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &GetAuthorizationTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetAuthorizationToken\", params, optFns, c.addOperationGetAuthorizationTokenMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetAuthorizationTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetAuthorizationTokenInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype GetAuthorizationTokenOutput struct {\n\n\t// An authorization token data object that corresponds to a public registry.\n\tAuthorizationData *types.AuthorizationData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAuthorizationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAuthorizationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAuthorizationToken(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetAuthorizationToken(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"GetAuthorizationToken\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRegistryCatalogData.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves catalog metadata for a public registry.\nfunc (c *Client) GetRegistryCatalogData(ctx context.Context, params *GetRegistryCatalogDataInput, optFns ...func(*Options)) (*GetRegistryCatalogDataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRegistryCatalogDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRegistryCatalogData\", params, optFns, c.addOperationGetRegistryCatalogDataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRegistryCatalogDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRegistryCatalogDataInput struct {\n\tnoSmithyDocumentSerde\n}\n\ntype GetRegistryCatalogDataOutput struct {\n\n\t// The catalog metadata for the public registry.\n\t//\n\t// This member is required.\n\tRegistryCatalogData *types.RegistryCatalogData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRegistryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRegistryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryCatalogData(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRegistryCatalogData(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"GetRegistryCatalogData\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryCatalogData.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieve catalog metadata for a repository in a public registry. This metadata\n// is displayed publicly in the Amazon ECR Public Gallery.\nfunc (c *Client) GetRepositoryCatalogData(ctx context.Context, params *GetRepositoryCatalogDataInput, optFns ...func(*Options)) (*GetRepositoryCatalogDataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRepositoryCatalogDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRepositoryCatalogData\", params, optFns, c.addOperationGetRepositoryCatalogDataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRepositoryCatalogDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRepositoryCatalogDataInput struct {\n\n\t// The name of the repository to retrieve the catalog metadata for.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID that's associated with the registry that\n\t// contains the repositories to be described. If you do not specify a registry, the\n\t// default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetRepositoryCatalogDataOutput struct {\n\n\t// The catalog metadata for the repository.\n\tCatalogData *types.RepositoryCatalogData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRepositoryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRepositoryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetRepositoryCatalogDataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryCatalogData(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRepositoryCatalogData(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"GetRepositoryCatalogData\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the repository policy for the specified repository.\nfunc (c *Client) GetRepositoryPolicy(ctx context.Context, params *GetRepositoryPolicyInput, optFns ...func(*Options)) (*GetRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRepositoryPolicy\", params, optFns, c.addOperationGetRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRepositoryPolicyInput struct {\n\n\t// The name of the repository with the policy to retrieve.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository. If you do not specify a registry, the default\n\t// public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetRepositoryPolicyOutput struct {\n\n\t// The repository policy text that's associated with the repository. The policy\n\t// text will be in JSON format.\n\tPolicyText *string\n\n\t// The registry ID that's associated with the request.\n\tRegistryId *string\n\n\t// The repository name that's associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"GetRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_InitiateLayerUpload.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Notifies Amazon ECR that you intend to upload an image layer. When an image is\n// pushed, the InitiateLayerUpload API is called once for each image layer that\n// hasn't already been uploaded. Whether an image layer uploads is determined by\n// the BatchCheckLayerAvailability API action. This operation is used by the Amazon\n// ECR proxy and is not generally used by customers for pulling and pushing images.\n// In most cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) InitiateLayerUpload(ctx context.Context, params *InitiateLayerUploadInput, optFns ...func(*Options)) (*InitiateLayerUploadOutput, error) {\n\tif params == nil {\n\t\tparams = &InitiateLayerUploadInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"InitiateLayerUpload\", params, optFns, c.addOperationInitiateLayerUploadMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*InitiateLayerUploadOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype InitiateLayerUploadInput struct {\n\n\t// The name of the repository that you want to upload layers to.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID, or registry alias, that's associated with\n\t// the registry to which you intend to upload layers. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype InitiateLayerUploadOutput struct {\n\n\t// The size, in bytes, that Amazon ECR expects future layer part uploads to be.\n\tPartSize *int64\n\n\t// The upload ID for the layer upload. This parameter is passed to further\n\t// UploadLayerPart and CompleteLayerUpload operations.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpInitiateLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpInitiateLayerUpload{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpInitiateLayerUploadValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitiateLayerUpload(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opInitiateLayerUpload(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"InitiateLayerUpload\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_ListTagsForResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// List the tags for an Amazon ECR Public resource.\nfunc (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &ListTagsForResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListTagsForResource\", params, optFns, c.addOperationListTagsForResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListTagsForResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListTagsForResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) that identifies the resource to list the tags\n\t// for. Currently, the supported resource is an Amazon ECR Public repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListTagsForResourceOutput struct {\n\n\t// The tags for the resource.\n\tTags []types.Tag\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"ListTagsForResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutImage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the image manifest and tags that are associated with an\n// image. When an image is pushed and all new image layers have been uploaded, the\n// PutImage API is called once to create or update the image manifest and the tags\n// that are associated with the image. This operation is used by the Amazon ECR\n// proxy and is not generally used by customers for pulling and pushing images. In\n// most cases, you should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) PutImage(ctx context.Context, params *PutImageInput, optFns ...func(*Options)) (*PutImageOutput, error) {\n\tif params == nil {\n\t\tparams = &PutImageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutImage\", params, optFns, c.addOperationPutImageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutImageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutImageInput struct {\n\n\t// The image manifest that corresponds to the image to be uploaded.\n\t//\n\t// This member is required.\n\tImageManifest *string\n\n\t// The name of the repository where the image is put.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The image digest of the image manifest that corresponds to the image.\n\tImageDigest *string\n\n\t// The media type of the image manifest. If you push an image manifest that\n\t// doesn't contain the mediaType field, you must specify the imageManifestMediaType\n\t// in the request.\n\tImageManifestMediaType *string\n\n\t// The tag to associate with the image. This parameter is required for images that\n\t// use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI)\n\t// formats.\n\tImageTag *string\n\n\t// The Amazon Web Services account ID, or registry alias, that's associated with\n\t// the public registry that contains the repository where the image is put. If you\n\t// do not specify a registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutImageOutput struct {\n\n\t// Details of the image uploaded.\n\tImage *types.Image\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutImage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutImageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutImage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"PutImage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRegistryCatalogData.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Create or update the catalog data for a public registry.\nfunc (c *Client) PutRegistryCatalogData(ctx context.Context, params *PutRegistryCatalogDataInput, optFns ...func(*Options)) (*PutRegistryCatalogDataOutput, error) {\n\tif params == nil {\n\t\tparams = &PutRegistryCatalogDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutRegistryCatalogData\", params, optFns, c.addOperationPutRegistryCatalogDataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutRegistryCatalogDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutRegistryCatalogDataInput struct {\n\n\t// The display name for a public registry. The display name is shown as the\n\t// repository author in the Amazon ECR Public Gallery. The registry display name is\n\t// only publicly visible in the Amazon ECR Public Gallery for verified accounts.\n\tDisplayName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutRegistryCatalogDataOutput struct {\n\n\t// The catalog data for the public registry.\n\t//\n\t// This member is required.\n\tRegistryCatalogData *types.RegistryCatalogData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutRegistryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRegistryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryCatalogData(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutRegistryCatalogData(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"PutRegistryCatalogData\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRepositoryCatalogData.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates the catalog data for a repository in a public registry.\nfunc (c *Client) PutRepositoryCatalogData(ctx context.Context, params *PutRepositoryCatalogDataInput, optFns ...func(*Options)) (*PutRepositoryCatalogDataOutput, error) {\n\tif params == nil {\n\t\tparams = &PutRepositoryCatalogDataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutRepositoryCatalogData\", params, optFns, c.addOperationPutRepositoryCatalogDataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutRepositoryCatalogDataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutRepositoryCatalogDataInput struct {\n\n\t// An object containing the catalog data for a repository. This data is publicly\n\t// visible in the Amazon ECR Public Gallery.\n\t//\n\t// This member is required.\n\tCatalogData *types.RepositoryCatalogDataInput\n\n\t// The name of the repository to create or update the catalog data for.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// the repository is in. If you do not specify a registry, the default public\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutRepositoryCatalogDataOutput struct {\n\n\t// The catalog data for the repository.\n\tCatalogData *types.RepositoryCatalogData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutRepositoryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRepositoryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRepositoryCatalogData{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutRepositoryCatalogDataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRepositoryCatalogData(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutRepositoryCatalogData(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"PutRepositoryCatalogData\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_SetRepositoryPolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Applies a repository policy to the specified public repository to control\n// access permissions. For more information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html)\n// in the Amazon Elastic Container Registry User Guide.\nfunc (c *Client) SetRepositoryPolicy(ctx context.Context, params *SetRepositoryPolicyInput, optFns ...func(*Options)) (*SetRepositoryPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &SetRepositoryPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"SetRepositoryPolicy\", params, optFns, c.addOperationSetRepositoryPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*SetRepositoryPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype SetRepositoryPolicyInput struct {\n\n\t// The JSON repository policy text to apply to the repository. For more\n\t// information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html)\n\t// in the Amazon Elastic Container Registry User Guide.\n\t//\n\t// This member is required.\n\tPolicyText *string\n\n\t// The name of the repository to receive the policy.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// If the policy that you want to set on a repository policy would prevent you\n\t// from setting another policy in the future, you must force the\n\t// SetRepositoryPolicy operation. This prevents accidental repository lockouts.\n\tForce bool\n\n\t// The Amazon Web Services account ID that's associated with the registry that\n\t// contains the repository. If you do not specify a registry, the default public\n\t// registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype SetRepositoryPolicyOutput struct {\n\n\t// The JSON repository policy text that's applied to the repository.\n\tPolicyText *string\n\n\t// The registry ID that's associated with the request.\n\tRegistryId *string\n\n\t// The repository name that's associated with the request.\n\tRepositoryName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpSetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetRepositoryPolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpSetRepositoryPolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetRepositoryPolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opSetRepositoryPolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"SetRepositoryPolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_TagResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Associates the specified tags to a resource with the specified resourceArn . If\n// existing tags on a resource aren't specified in the request parameters, they\n// aren't changed. When a resource is deleted, the tags associated with that\n// resource are also deleted.\nfunc (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &TagResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"TagResource\", params, optFns, c.addOperationTagResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*TagResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype TagResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) of the resource to add tags to. Currently, the\n\t// supported resource is an Amazon ECR Public repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// The tags to add to the resource. A tag is an array of key-value pairs. Tag keys\n\t// can have a maximum character length of 128 characters, and tag values can have a\n\t// maximum length of 256 characters.\n\t//\n\t// This member is required.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype TagResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpTagResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"TagResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UntagResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes specified tags from a resource.\nfunc (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &UntagResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UntagResource\", params, optFns, c.addOperationUntagResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UntagResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UntagResourceInput struct {\n\n\t// The Amazon Resource Name (ARN) of the resource to delete tags from. Currently,\n\t// the supported resource is an Amazon ECR Public repository.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// The keys of the tags to be removed.\n\t//\n\t// This member is required.\n\tTagKeys []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UntagResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUntagResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"UntagResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UploadLayerPart.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Uploads an image layer part to Amazon ECR. When an image is pushed, each new\n// image layer is uploaded in parts. The maximum size of each image layer part can\n// be 20971520 bytes (about 20MB). The UploadLayerPart API is called once for each\n// new image layer part. This operation is used by the Amazon ECR proxy and is not\n// generally used by customers for pulling and pushing images. In most cases, you\n// should use the docker CLI to pull, tag, and push images.\nfunc (c *Client) UploadLayerPart(ctx context.Context, params *UploadLayerPartInput, optFns ...func(*Options)) (*UploadLayerPartOutput, error) {\n\tif params == nil {\n\t\tparams = &UploadLayerPartInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UploadLayerPart\", params, optFns, c.addOperationUploadLayerPartMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UploadLayerPartOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UploadLayerPartInput struct {\n\n\t// The base64-encoded layer part payload.\n\t//\n\t// This member is required.\n\tLayerPartBlob []byte\n\n\t// The position of the first byte of the layer part witin the overall image layer.\n\t//\n\t// This member is required.\n\tPartFirstByte *int64\n\n\t// The position of the last byte of the layer part within the overall image layer.\n\t//\n\t// This member is required.\n\tPartLastByte *int64\n\n\t// The name of the repository that you're uploading layer parts to.\n\t//\n\t// This member is required.\n\tRepositoryName *string\n\n\t// The upload ID from a previous InitiateLayerUpload operation to associate with\n\t// the layer part upload.\n\t//\n\t// This member is required.\n\tUploadId *string\n\n\t// The Amazon Web Services account ID, or registry alias, that's associated with\n\t// the registry that you're uploading layer parts to. If you do not specify a\n\t// registry, the default public registry is assumed.\n\tRegistryId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UploadLayerPartOutput struct {\n\n\t// The integer value of the last byte that's received in the request.\n\tLastByteReceived *int64\n\n\t// The registry ID that's associated with the request.\n\tRegistryId *string\n\n\t// The repository name that's associated with the request.\n\tRepositoryName *string\n\n\t// The upload ID that's associated with the request.\n\tUploadId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUploadLayerPart{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUploadLayerPart{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addHTTPSignerV4Middleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUploadLayerPartValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUploadLayerPart(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUploadLayerPart(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tSigningName:   \"ecr-public\",\n\t\tOperationName: \"UploadLayerPart\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype awsAwsjson11_deserializeOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchCheckLayerAvailability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response, &metadata)\n\t}\n\toutput := &BatchCheckLayerAvailabilityOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpBatchDeleteImage struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpBatchDeleteImage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpBatchDeleteImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorBatchDeleteImage(response, &metadata)\n\t}\n\toutput := &BatchDeleteImageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCompleteLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCompleteLayerUpload) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCompleteLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response, &metadata)\n\t}\n\toutput := &CompleteLayerUploadOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"EmptyUploadException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorEmptyUploadException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidLayerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidLayerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayerAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayerPartTooSmallException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayerPartTooSmallException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tcase strings.EqualFold(\"UploadNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateRepository struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateRepository) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateRepository(response, &metadata)\n\t}\n\toutput := &CreateRepositoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteRepository struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteRepository) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepository(response, &metadata)\n\t}\n\toutput := &DeleteRepositoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotEmptyException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &DeleteRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeImages struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeImages) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeImages(response, &metadata)\n\t}\n\toutput := &DescribeImagesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeImageTags struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeImageTags) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeImageTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeImageTags(response, &metadata)\n\t}\n\toutput := &DescribeImageTagsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeImageTagsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeImageTags(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeRegistries struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeRegistries) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeRegistries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeRegistries(response, &metadata)\n\t}\n\toutput := &DescribeRegistriesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeRegistriesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeRegistries(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeRepositories struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeRepositories) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeRepositories) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeRepositories(response, &metadata)\n\t}\n\toutput := &DescribeRepositoriesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetAuthorizationToken struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetAuthorizationToken) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetAuthorizationToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response, &metadata)\n\t}\n\toutput := &GetAuthorizationTokenOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRegistryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRegistryCatalogData) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRegistryCatalogData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRegistryCatalogData(response, &metadata)\n\t}\n\toutput := &GetRegistryCatalogDataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRegistryCatalogDataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRegistryCatalogData(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRepositoryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRepositoryCatalogData) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRepositoryCatalogData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRepositoryCatalogData(response, &metadata)\n\t}\n\toutput := &GetRepositoryCatalogDataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRepositoryCatalogDataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRepositoryCatalogData(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryCatalogDataNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryCatalogDataNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &GetRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryPolicyNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpInitiateLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpInitiateLayerUpload) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpInitiateLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response, &metadata)\n\t}\n\toutput := &InitiateLayerUploadOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)\n\t}\n\toutput := &ListTagsForResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutImage struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutImage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutImage(response, &metadata)\n\t}\n\toutput := &PutImageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutImageOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ImageAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ImageDigestDoesNotMatchException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response, errorBody)\n\n\tcase strings.EqualFold(\"ImageTagAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LayersNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLayersNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"ReferencedImagesNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutRegistryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutRegistryCatalogData) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutRegistryCatalogData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutRegistryCatalogData(response, &metadata)\n\t}\n\toutput := &PutRegistryCatalogDataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutRegistryCatalogDataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutRegistryCatalogData(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutRepositoryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutRepositoryCatalogData) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutRepositoryCatalogData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutRepositoryCatalogData(response, &metadata)\n\t}\n\toutput := &PutRepositoryCatalogDataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutRepositoryCatalogDataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutRepositoryCatalogData(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpSetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpSetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response, &metadata)\n\t}\n\toutput := &SetRepositoryPolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpTagResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpTagResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)\n\t}\n\toutput := &TagResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUntagResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUntagResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)\n\t}\n\toutput := &UntagResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTagParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUploadLayerPart struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUploadLayerPart) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUploadLayerPart(response, &metadata)\n\t}\n\toutput := &UploadLayerPartOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidLayerPartException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"LimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegistryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRegistryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"RepositoryNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"ServerException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCommandException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCommandException(response, errorBody)\n\n\tcase strings.EqualFold(\"UploadNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.EmptyUploadException{}\n\terr := awsAwsjson11_deserializeDocumentEmptyUploadException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentImageAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageDigestDoesNotMatchException{}\n\terr := awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentImageNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ImageTagAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidLayerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidLayerException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidLayerException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidLayerPartException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidLayerPartException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidLayerPartException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidParameterException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTagParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTagParameterException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTagParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayerAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayerPartTooSmallException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayerPartTooSmallException{}\n\terr := awsAwsjson11_deserializeDocumentLayerPartTooSmallException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLayersNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LayersNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentLayersNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.LimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ReferencedImagesNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRegistryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RegistryNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRegistryNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryCatalogDataNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryCatalogDataNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryCatalogDataNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryNotEmptyException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.RepositoryPolicyNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ServerException{}\n\terr := awsAwsjson11_deserializeDocumentServerException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TooManyTagsException{}\n\terr := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedCommandException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedCommandException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedCommandException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUploadNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UploadNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentUploadNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeDocumentArchitectureList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Architecture to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAuthorizationData(v **types.AuthorizationData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AuthorizationData\n\tif *v == nil {\n\t\tsv = &types.AuthorizationData{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"authorizationToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Base64 to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AuthorizationToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiresAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEmptyUploadException(v **types.EmptyUploadException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.EmptyUploadException\n\tif *v == nil {\n\t\tsv = &types.EmptyUploadException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImage(v **types.Image, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Image\n\tif *v == nil {\n\t\tsv = &types.Image{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageManifest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageManifest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageManifestMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifestMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryIdOrAlias to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageAlreadyExistsException(v **types.ImageAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.ImageAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDetail(v **types.ImageDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageDetail\n\tif *v == nil {\n\t\tsv = &types.ImageDetail{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"artifactMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ArtifactMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageManifestMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifestMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imagePushedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected PushTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"imageSizeInBytes\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageSizeInBytes to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ImageSizeInBytes = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"imageTags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDetailList(v *[]types.ImageDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageDetail\n\tif *v == nil {\n\t\tcv = []types.ImageDetail{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageDetail\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageDetail(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(v **types.ImageDigestDoesNotMatchException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageDigestDoesNotMatchException\n\tif *v == nil {\n\t\tsv = &types.ImageDigestDoesNotMatchException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageFailure(v **types.ImageFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageFailure\n\tif *v == nil {\n\t\tsv = &types.ImageFailure{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageFailureCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = types.ImageFailureCode(jtv)\n\t\t\t}\n\n\t\tcase \"failureReason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageFailureReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureReason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageId\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageFailureList(v *[]types.ImageFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageFailure\n\tif *v == nil {\n\t\tcv = []types.ImageFailure{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageFailure\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageFailure(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageIdentifier(v **types.ImageIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageIdentifier\n\tif *v == nil {\n\t\tsv = &types.ImageIdentifier{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageTag\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageTag = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageIdentifierList(v *[]types.ImageIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageIdentifier\n\tif *v == nil {\n\t\tcv = []types.ImageIdentifier{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageIdentifier\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifier(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageNotFoundException(v **types.ImageNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ImageNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(v **types.ImageTagAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageTagAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.ImageTagAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagDetail(v **types.ImageTagDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ImageTagDetail\n\tif *v == nil {\n\t\tsv = &types.ImageTagDetail{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"imageDetail\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReferencedImageDetail(&sv.ImageDetail, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageTag\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageTag = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagDetailList(v *[]types.ImageTagDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ImageTagDetail\n\tif *v == nil {\n\t\tcv = []types.ImageTagDetail{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ImageTagDetail\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentImageTagDetail(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentImageTagList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ImageTag to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidLayerException(v **types.InvalidLayerException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidLayerException\n\tif *v == nil {\n\t\tsv = &types.InvalidLayerException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidLayerPartException(v **types.InvalidLayerPartException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidLayerPartException\n\tif *v == nil {\n\t\tsv = &types.InvalidLayerPartException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastValidByteReceived\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LastValidByteReceived = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidParameterException\n\tif *v == nil {\n\t\tsv = &types.InvalidParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTagParameterException(v **types.InvalidTagParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTagParameterException\n\tif *v == nil {\n\t\tsv = &types.InvalidTagParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayer(v **types.Layer, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Layer\n\tif *v == nil {\n\t\tsv = &types.Layer{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"layerAvailability\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerAvailability to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerAvailability = types.LayerAvailability(jtv)\n\t\t\t}\n\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"layerSize\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerSizeInBytes to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LayerSize = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"mediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(v **types.LayerAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.LayerAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerFailure(v **types.LayerFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerFailure\n\tif *v == nil {\n\t\tsv = &types.LayerFailure{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failureCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerFailureCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureCode = types.LayerFailureCode(jtv)\n\t\t\t}\n\n\t\tcase \"failureReason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerFailureReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureReason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BatchedOperationLayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerFailureList(v *[]types.LayerFailure, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.LayerFailure\n\tif *v == nil {\n\t\tcv = []types.LayerFailure{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.LayerFailure\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentLayerFailure(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerList(v *[]types.Layer, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Layer\n\tif *v == nil {\n\t\tcv = []types.Layer{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Layer\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentLayer(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayerPartTooSmallException(v **types.LayerPartTooSmallException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayerPartTooSmallException\n\tif *v == nil {\n\t\tsv = &types.LayerPartTooSmallException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLayersNotFoundException(v **types.LayersNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LayersNotFoundException\n\tif *v == nil {\n\t\tsv = &types.LayersNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LimitExceededException\n\tif *v == nil {\n\t\tsv = &types.LimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOperatingSystemList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReferencedImageDetail(v **types.ReferencedImageDetail, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReferencedImageDetail\n\tif *v == nil {\n\t\tsv = &types.ReferencedImageDetail{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"artifactMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ArtifactMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imageManifestMediaType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MediaType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ImageManifestMediaType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"imagePushedAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected PushTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"imageSizeInBytes\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ImageSizeInBytes to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ImageSizeInBytes = ptr.Int64(i64)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(v **types.ReferencedImagesNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReferencedImagesNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ReferencedImagesNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistry(v **types.Registry, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Registry\n\tif *v == nil {\n\t\tsv = &types.Registry{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"aliases\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryAliasList(&sv.Aliases, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"registryArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"verified\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryVerified to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Verified = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryAlias(v **types.RegistryAlias, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryAlias\n\tif *v == nil {\n\t\tsv = &types.RegistryAlias{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"defaultRegistryAlias\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DefaultRegistryAliasFlag to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultRegistryAlias = jtv\n\t\t\t}\n\n\t\tcase \"name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryAliasName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"primaryRegistryAlias\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PrimaryRegistryAliasFlag to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PrimaryRegistryAlias = jtv\n\t\t\t}\n\n\t\tcase \"status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryAliasStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.RegistryAliasStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryAliasList(v *[]types.RegistryAlias, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RegistryAlias\n\tif *v == nil {\n\t\tcv = []types.RegistryAlias{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RegistryAlias\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRegistryAlias(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryCatalogData(v **types.RegistryCatalogData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryCatalogData\n\tif *v == nil {\n\t\tsv = &types.RegistryCatalogData{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"displayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryList(v *[]types.Registry, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Registry\n\tif *v == nil {\n\t\tcv = []types.Registry{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Registry\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRegistry(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegistryNotFoundException(v **types.RegistryNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RegistryNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RegistryNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepository(v **types.Repository, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Repository\n\tif *v == nil {\n\t\tsv = &types.Repository{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreationTimestamp to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Arn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(v **types.RepositoryAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.RepositoryAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryCatalogData(v **types.RepositoryCatalogData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryCatalogData\n\tif *v == nil {\n\t\tsv = &types.RepositoryCatalogData{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"aboutText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AboutText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AboutText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"architectures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentArchitectureList(&sv.Architectures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"logoUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LogoUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"marketplaceCertified\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MarketplaceCertified to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MarketplaceCertified = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"operatingSystems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOperatingSystemList(&sv.OperatingSystems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"usageText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UsageText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UsageText = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryCatalogDataNotFoundException(v **types.RepositoryCatalogDataNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryCatalogDataNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RepositoryCatalogDataNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryList(v *[]types.Repository, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Repository\n\tif *v == nil {\n\t\tcv = []types.Repository{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Repository\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRepository(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(v **types.RepositoryNotEmptyException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryNotEmptyException\n\tif *v == nil {\n\t\tsv = &types.RepositoryNotEmptyException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryNotFoundException(v **types.RepositoryNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RepositoryNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(v **types.RepositoryPolicyNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RepositoryPolicyNotFoundException\n\tif *v == nil {\n\t\tsv = &types.RepositoryPolicyNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ServerException\n\tif *v == nil {\n\t\tsv = &types.ServerException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Tag\n\tif *v == nil {\n\t\tsv = &types.Tag{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Tag\n\tif *v == nil {\n\t\tcv = []types.Tag{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Tag\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TooManyTagsException\n\tif *v == nil {\n\t\tsv = &types.TooManyTagsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedCommandException(v **types.UnsupportedCommandException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedCommandException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedCommandException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UploadNotFoundException\n\tif *v == nil {\n\t\tsv = &types.UploadNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExceptionMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(v **BatchCheckLayerAvailabilityOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchCheckLayerAvailabilityOutput\n\tif *v == nil {\n\t\tsv = &BatchCheckLayerAvailabilityOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLayerFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"layers\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLayerList(&sv.Layers, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(v **BatchDeleteImageOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *BatchDeleteImageOutput\n\tif *v == nil {\n\t\tsv = &BatchDeleteImageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"failures\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageFailureList(&sv.Failures, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"imageIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageIdentifierList(&sv.ImageIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(v **CompleteLayerUploadOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CompleteLayerUploadOutput\n\tif *v == nil {\n\t\tsv = &CompleteLayerUploadOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"layerDigest\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LayerDigest to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LayerDigest = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(v **CreateRepositoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateRepositoryOutput\n\tif *v == nil {\n\t\tsv = &CreateRepositoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"catalogData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryCatalogData(&sv.CatalogData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"repository\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(v **DeleteRepositoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteRepositoryOutput\n\tif *v == nil {\n\t\tsv = &DeleteRepositoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"repository\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(v **DeleteRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &DeleteRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(v **DescribeImagesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeImagesOutput\n\tif *v == nil {\n\t\tsv = &DescribeImagesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageDetailList(&sv.ImageDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeImageTagsOutput(v **DescribeImageTagsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeImageTagsOutput\n\tif *v == nil {\n\t\tsv = &DescribeImageTagsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"imageTagDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImageTagDetailList(&sv.ImageTagDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeRegistriesOutput(v **DescribeRegistriesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeRegistriesOutput\n\tif *v == nil {\n\t\tsv = &DescribeRegistriesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registries\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryList(&sv.Registries, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(v **DescribeRepositoriesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeRepositoriesOutput\n\tif *v == nil {\n\t\tsv = &DescribeRepositoriesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositories\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryList(&sv.Repositories, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(v **GetAuthorizationTokenOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetAuthorizationTokenOutput\n\tif *v == nil {\n\t\tsv = &GetAuthorizationTokenOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"authorizationData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAuthorizationData(&sv.AuthorizationData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRegistryCatalogDataOutput(v **GetRegistryCatalogDataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRegistryCatalogDataOutput\n\tif *v == nil {\n\t\tsv = &GetRegistryCatalogDataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"registryCatalogData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryCatalogData(&sv.RegistryCatalogData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRepositoryCatalogDataOutput(v **GetRepositoryCatalogDataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRepositoryCatalogDataOutput\n\tif *v == nil {\n\t\tsv = &GetRepositoryCatalogDataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"catalogData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryCatalogData(&sv.CatalogData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(v **GetRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &GetRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(v **InitiateLayerUploadOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *InitiateLayerUploadOutput\n\tif *v == nil {\n\t\tsv = &InitiateLayerUploadOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"partSize\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PartSize = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListTagsForResourceOutput\n\tif *v == nil {\n\t\tsv = &ListTagsForResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutImageOutput(v **PutImageOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutImageOutput\n\tif *v == nil {\n\t\tsv = &PutImageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"image\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentImage(&sv.Image, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutRegistryCatalogDataOutput(v **PutRegistryCatalogDataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutRegistryCatalogDataOutput\n\tif *v == nil {\n\t\tsv = &PutRegistryCatalogDataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"registryCatalogData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegistryCatalogData(&sv.RegistryCatalogData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutRepositoryCatalogDataOutput(v **PutRepositoryCatalogDataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutRepositoryCatalogDataOutput\n\tif *v == nil {\n\t\tsv = &PutRepositoryCatalogDataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"catalogData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRepositoryCatalogData(&sv.CatalogData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(v **SetRepositoryPolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *SetRepositoryPolicyOutput\n\tif *v == nil {\n\t\tsv = &SetRepositoryPolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"policyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryPolicyText to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *TagResourceOutput\n\tif *v == nil {\n\t\tsv = &TagResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UntagResourceOutput\n\tif *v == nil {\n\t\tsv = &UntagResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UploadLayerPartOutput\n\tif *v == nil {\n\t\tsv = &UploadLayerPartOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"lastByteReceived\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PartSize to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LastByteReceived = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"registryId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistryId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RegistryId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"repositoryName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RepositoryName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RepositoryName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"uploadId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UploadId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UploadId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package ecrpublic provides the API client, operations, and parameter types for\n// Amazon Elastic Container Registry Public.\n//\n// Amazon Elastic Container Registry Public Amazon Elastic Container Registry\n// Public (Amazon ECR Public) is a managed container image registry service. Amazon\n// ECR provides both public and private registries to host your container images.\n// You can use the Docker CLI or your preferred client to push, pull, and manage\n// images. Amazon ECR provides a secure, scalable, and reliable registry for your\n// Docker or Open Container Initiative (OCI) images. Amazon ECR supports public\n// repositories with this API. For information about the Amazon ECR API for private\n// repositories, see Amazon Elastic Container Registry API Reference (https://docs.aws.amazon.com/AmazonECR/latest/APIReference/Welcome.html)\n// .\npackage ecrpublic\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\nfunc resolveDefaultEndpointConfiguration(o *Options) {\n\tif o.EndpointResolver != nil {\n\t\treturn\n\t}\n\to.EndpointResolver = NewDefaultEndpointResolver()\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"ecr-public\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n\tresolver    EndpointResolver\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\tif w.awsResolver == nil {\n\t\tgoto fallback\n\t}\n\tendpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n\tif err == nil {\n\t\treturn endpoint, nil\n\t}\n\n\tif nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {\n\t\treturn endpoint, err\n\t}\n\nfallback:\n\tif w.resolver == nil {\n\t\treturn endpoint, fmt.Errorf(\"default endpoint resolver provided was nil\")\n\t}\n\treturn w.resolver.ResolveEndpoint(region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided\n// fallbackResolver for resolution.\n//\n// fallbackResolver must not be nil\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t\tresolver:    fallbackResolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_BatchCheckLayerAvailability.go\",\n        \"api_op_BatchDeleteImage.go\",\n        \"api_op_CompleteLayerUpload.go\",\n        \"api_op_CreateRepository.go\",\n        \"api_op_DeleteRepository.go\",\n        \"api_op_DeleteRepositoryPolicy.go\",\n        \"api_op_DescribeImageTags.go\",\n        \"api_op_DescribeImages.go\",\n        \"api_op_DescribeRegistries.go\",\n        \"api_op_DescribeRepositories.go\",\n        \"api_op_GetAuthorizationToken.go\",\n        \"api_op_GetRegistryCatalogData.go\",\n        \"api_op_GetRepositoryCatalogData.go\",\n        \"api_op_GetRepositoryPolicy.go\",\n        \"api_op_InitiateLayerUpload.go\",\n        \"api_op_ListTagsForResource.go\",\n        \"api_op_PutImage.go\",\n        \"api_op_PutRegistryCatalogData.go\",\n        \"api_op_PutRepositoryCatalogData.go\",\n        \"api_op_SetRepositoryPolicy.go\",\n        \"api_op_TagResource.go\",\n        \"api_op_UntagResource.go\",\n        \"api_op_UploadLayerPart.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"types/enums.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/ecrpublic\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage ecrpublic\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.16.2\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver ECR PUBLIC endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr-public.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"api.ecr-public.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"api.ecr-public.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\tsmithyjson \"github.com/aws/smithy-go/encoding/json\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"path\"\n)\n\ntype awsAwsjson11_serializeOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchCheckLayerAvailability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchCheckLayerAvailabilityInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.BatchCheckLayerAvailability\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchCheckLayerAvailabilityInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpBatchDeleteImage struct {\n}\n\nfunc (*awsAwsjson11_serializeOpBatchDeleteImage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpBatchDeleteImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*BatchDeleteImageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.BatchDeleteImage\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentBatchDeleteImageInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCompleteLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCompleteLayerUpload) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCompleteLayerUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CompleteLayerUploadInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.CompleteLayerUpload\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCompleteLayerUploadInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateRepository struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateRepository) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateRepository) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateRepositoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.CreateRepository\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateRepositoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteRepository struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteRepository) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteRepository) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteRepositoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DeleteRepository\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteRepositoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DeleteRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeImages struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeImages) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeImages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeImagesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DescribeImages\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeImagesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeImageTags struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeImageTags) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeImageTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeImageTagsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DescribeImageTags\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeImageTagsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeRegistries struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeRegistries) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeRegistries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeRegistriesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DescribeRegistries\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeRegistriesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeRepositories struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeRepositories) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeRepositories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeRepositoriesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.DescribeRepositories\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeRepositoriesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetAuthorizationToken struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetAuthorizationToken) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetAuthorizationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetAuthorizationTokenInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.GetAuthorizationToken\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetAuthorizationTokenInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRegistryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRegistryCatalogData) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRegistryCatalogData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRegistryCatalogDataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.GetRegistryCatalogData\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRegistryCatalogDataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRepositoryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRepositoryCatalogData) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRepositoryCatalogData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRepositoryCatalogDataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.GetRepositoryCatalogData\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRepositoryCatalogDataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.GetRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpInitiateLayerUpload struct {\n}\n\nfunc (*awsAwsjson11_serializeOpInitiateLayerUpload) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpInitiateLayerUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*InitiateLayerUploadInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.InitiateLayerUpload\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentInitiateLayerUploadInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListTagsForResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.ListTagsForResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutImage struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutImage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutImageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.PutImage\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutImageInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutRegistryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutRegistryCatalogData) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutRegistryCatalogData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutRegistryCatalogDataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.PutRegistryCatalogData\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutRegistryCatalogDataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutRepositoryCatalogData struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutRepositoryCatalogData) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutRepositoryCatalogData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutRepositoryCatalogDataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.PutRepositoryCatalogData\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutRepositoryCatalogDataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpSetRepositoryPolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpSetRepositoryPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*SetRepositoryPolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.SetRepositoryPolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentSetRepositoryPolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpTagResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpTagResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*TagResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.TagResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUntagResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUntagResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UntagResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.UntagResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUploadLayerPart struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUploadLayerPart) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUploadLayerPart) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UploadLayerPartInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"SpencerFrontendService.UploadLayerPart\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUploadLayerPartInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsAwsjson11_serializeDocumentArchitectureList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentImageIdentifier(v *types.ImageIdentifier, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageDigest != nil {\n\t\tok := object.Key(\"imageDigest\")\n\t\tok.String(*v.ImageDigest)\n\t}\n\n\tif v.ImageTag != nil {\n\t\tok := object.Key(\"imageTag\")\n\t\tok.String(*v.ImageTag)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentImageIdentifierList(v []types.ImageIdentifier, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifier(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentLayerDigestList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOperatingSystemList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRepositoryCatalogDataInput(v *types.RepositoryCatalogDataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AboutText != nil {\n\t\tok := object.Key(\"aboutText\")\n\t\tok.String(*v.AboutText)\n\t}\n\n\tif v.Architectures != nil {\n\t\tok := object.Key(\"architectures\")\n\t\tif err := awsAwsjson11_serializeDocumentArchitectureList(v.Architectures, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.LogoImageBlob != nil {\n\t\tok := object.Key(\"logoImageBlob\")\n\t\tok.Base64EncodeBytes(v.LogoImageBlob)\n\t}\n\n\tif v.OperatingSystems != nil {\n\t\tok := object.Key(\"operatingSystems\")\n\t\tif err := awsAwsjson11_serializeDocumentOperatingSystemList(v.OperatingSystems, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.UsageText != nil {\n\t\tok := object.Key(\"usageText\")\n\t\tok.String(*v.UsageText)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRepositoryNameList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerDigests != nil {\n\t\tok := object.Key(\"layerDigests\")\n\t\tif err := awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v.LayerDigests, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentBatchDeleteImageInput(v *BatchDeleteImageInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCompleteLayerUploadInput(v *CompleteLayerUploadInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerDigests != nil {\n\t\tok := object.Key(\"layerDigests\")\n\t\tif err := awsAwsjson11_serializeDocumentLayerDigestList(v.LayerDigests, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.UploadId != nil {\n\t\tok := object.Key(\"uploadId\")\n\t\tok.String(*v.UploadId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateRepositoryInput(v *CreateRepositoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CatalogData != nil {\n\t\tok := object.Key(\"catalogData\")\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryCatalogDataInput(v.CatalogData, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteRepositoryInput(v *DeleteRepositoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Force {\n\t\tok := object.Key(\"force\")\n\t\tok.Boolean(v.Force)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteRepositoryPolicyInput(v *DeleteRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeImagesInput(v *DescribeImagesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageIds != nil {\n\t\tok := object.Key(\"imageIds\")\n\t\tif err := awsAwsjson11_serializeDocumentImageIdentifierList(v.ImageIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeImageTagsInput(v *DescribeImageTagsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeRegistriesInput(v *DescribeRegistriesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeRepositoriesInput(v *DescribeRepositoriesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"maxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"nextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryNames != nil {\n\t\tok := object.Key(\"repositoryNames\")\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryNameList(v.RepositoryNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetAuthorizationTokenInput(v *GetAuthorizationTokenInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRegistryCatalogDataInput(v *GetRegistryCatalogDataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRepositoryCatalogDataInput(v *GetRepositoryCatalogDataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetRepositoryPolicyInput(v *GetRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentInitiateLayerUploadInput(v *InitiateLayerUploadInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutImageInput(v *PutImageInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ImageDigest != nil {\n\t\tok := object.Key(\"imageDigest\")\n\t\tok.String(*v.ImageDigest)\n\t}\n\n\tif v.ImageManifest != nil {\n\t\tok := object.Key(\"imageManifest\")\n\t\tok.String(*v.ImageManifest)\n\t}\n\n\tif v.ImageManifestMediaType != nil {\n\t\tok := object.Key(\"imageManifestMediaType\")\n\t\tok.String(*v.ImageManifestMediaType)\n\t}\n\n\tif v.ImageTag != nil {\n\t\tok := object.Key(\"imageTag\")\n\t\tok.String(*v.ImageTag)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutRegistryCatalogDataInput(v *PutRegistryCatalogDataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DisplayName != nil {\n\t\tok := object.Key(\"displayName\")\n\t\tok.String(*v.DisplayName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutRepositoryCatalogDataInput(v *PutRepositoryCatalogDataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CatalogData != nil {\n\t\tok := object.Key(\"catalogData\")\n\t\tif err := awsAwsjson11_serializeDocumentRepositoryCatalogDataInput(v.CatalogData, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentSetRepositoryPolicyInput(v *SetRepositoryPolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Force {\n\t\tok := object.Key(\"force\")\n\t\tok.Boolean(v.Force)\n\t}\n\n\tif v.PolicyText != nil {\n\t\tok := object.Key(\"policyText\")\n\t\tok.String(*v.PolicyText)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"resourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\tif v.TagKeys != nil {\n\t\tok := object.Key(\"tagKeys\")\n\t\tif err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.LayerPartBlob != nil {\n\t\tok := object.Key(\"layerPartBlob\")\n\t\tok.Base64EncodeBytes(v.LayerPartBlob)\n\t}\n\n\tif v.PartFirstByte != nil {\n\t\tok := object.Key(\"partFirstByte\")\n\t\tok.Long(*v.PartFirstByte)\n\t}\n\n\tif v.PartLastByte != nil {\n\t\tok := object.Key(\"partLastByte\")\n\t\tok.Long(*v.PartLastByte)\n\t}\n\n\tif v.RegistryId != nil {\n\t\tok := object.Key(\"registryId\")\n\t\tok.String(*v.RegistryId)\n\t}\n\n\tif v.RepositoryName != nil {\n\t\tok := object.Key(\"repositoryName\")\n\t\tok.String(*v.RepositoryName)\n\t}\n\n\tif v.UploadId != nil {\n\t\tok := object.Key(\"uploadId\")\n\t\tok.String(*v.UploadId)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/types/enums.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\ntype ImageFailureCode string\n\n// Enum values for ImageFailureCode\nconst (\n\tImageFailureCodeInvalidImageDigest            ImageFailureCode = \"InvalidImageDigest\"\n\tImageFailureCodeInvalidImageTag               ImageFailureCode = \"InvalidImageTag\"\n\tImageFailureCodeImageTagDoesNotMatchDigest    ImageFailureCode = \"ImageTagDoesNotMatchDigest\"\n\tImageFailureCodeImageNotFound                 ImageFailureCode = \"ImageNotFound\"\n\tImageFailureCodeMissingDigestAndTag           ImageFailureCode = \"MissingDigestAndTag\"\n\tImageFailureCodeImageReferencedByManifestList ImageFailureCode = \"ImageReferencedByManifestList\"\n\tImageFailureCodeKmsError                      ImageFailureCode = \"KmsError\"\n)\n\n// Values returns all known values for ImageFailureCode. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ImageFailureCode) Values() []ImageFailureCode {\n\treturn []ImageFailureCode{\n\t\t\"InvalidImageDigest\",\n\t\t\"InvalidImageTag\",\n\t\t\"ImageTagDoesNotMatchDigest\",\n\t\t\"ImageNotFound\",\n\t\t\"MissingDigestAndTag\",\n\t\t\"ImageReferencedByManifestList\",\n\t\t\"KmsError\",\n\t}\n}\n\ntype LayerAvailability string\n\n// Enum values for LayerAvailability\nconst (\n\tLayerAvailabilityAvailable   LayerAvailability = \"AVAILABLE\"\n\tLayerAvailabilityUnavailable LayerAvailability = \"UNAVAILABLE\"\n)\n\n// Values returns all known values for LayerAvailability. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (LayerAvailability) Values() []LayerAvailability {\n\treturn []LayerAvailability{\n\t\t\"AVAILABLE\",\n\t\t\"UNAVAILABLE\",\n\t}\n}\n\ntype LayerFailureCode string\n\n// Enum values for LayerFailureCode\nconst (\n\tLayerFailureCodeInvalidLayerDigest LayerFailureCode = \"InvalidLayerDigest\"\n\tLayerFailureCodeMissingLayerDigest LayerFailureCode = \"MissingLayerDigest\"\n)\n\n// Values returns all known values for LayerFailureCode. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (LayerFailureCode) Values() []LayerFailureCode {\n\treturn []LayerFailureCode{\n\t\t\"InvalidLayerDigest\",\n\t\t\"MissingLayerDigest\",\n\t}\n}\n\ntype RegistryAliasStatus string\n\n// Enum values for RegistryAliasStatus\nconst (\n\tRegistryAliasStatusActive   RegistryAliasStatus = \"ACTIVE\"\n\tRegistryAliasStatusPending  RegistryAliasStatus = \"PENDING\"\n\tRegistryAliasStatusRejected RegistryAliasStatus = \"REJECTED\"\n)\n\n// Values returns all known values for RegistryAliasStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (RegistryAliasStatus) Values() []RegistryAliasStatus {\n\treturn []RegistryAliasStatus{\n\t\t\"ACTIVE\",\n\t\t\"PENDING\",\n\t\t\"REJECTED\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// The specified layer upload doesn't contain any layer parts.\ntype EmptyUploadException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *EmptyUploadException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *EmptyUploadException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *EmptyUploadException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"EmptyUploadException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *EmptyUploadException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image has already been pushed, and there were no changes to the\n// manifest or image tag after the last push.\ntype ImageAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image digest doesn't match the digest that Amazon ECR calculated\n// for the image.\ntype ImageDigestDoesNotMatchException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageDigestDoesNotMatchException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageDigestDoesNotMatchException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageDigestDoesNotMatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The image requested doesn't exist in the specified repository.\ntype ImageNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified image is tagged with a tag that already exists. The repository is\n// configured for tag immutability.\ntype ImageTagAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ImageTagAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ImageTagAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ImageTagAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The layer digest calculation performed by Amazon ECR when the image layer\n// doesn't match the digest specified.\ntype InvalidLayerException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidLayerException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidLayerException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidLayerException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidLayerException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidLayerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The layer part size isn't valid, or the first byte specified isn't consecutive\n// to the last byte of a previous layer part upload.\ntype InvalidLayerPartException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tRegistryId            *string\n\tRepositoryName        *string\n\tUploadId              *string\n\tLastValidByteReceived *int64\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidLayerPartException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidLayerPartException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidLayerPartException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidLayerPartException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidLayerPartException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified parameter is invalid. Review the available parameters for the API\n// request.\ntype InvalidParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// An invalid parameter has been specified. Tag keys can have a maximum character\n// length of 128 characters, and tag values can have a maximum length of 256\n// characters.\ntype InvalidTagParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTagParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTagParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTagParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTagParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTagParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The image layer already exists in the associated repository.\ntype LayerAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayerAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayerAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayerAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayerAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayerAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Layer parts must be at least 5 MiB in size.\ntype LayerPartTooSmallException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayerPartTooSmallException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayerPartTooSmallException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayerPartTooSmallException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayerPartTooSmallException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayerPartTooSmallException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified layers can't be found, or the specified layer isn't valid for\n// this repository.\ntype LayersNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LayersNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LayersNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LayersNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LayersNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LayersNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The operation didn't succeed because it would have exceeded a service limit for\n// your account. For more information, see Amazon ECR Service Quotas (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\n// in the Amazon Elastic Container Registry User Guide.\ntype LimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *LimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *LimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *LimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"LimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The manifest list is referencing an image that doesn't exist.\ntype ReferencedImagesNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ReferencedImagesNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ReferencedImagesNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ReferencedImagesNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The registry doesn't exist.\ntype RegistryNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RegistryNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RegistryNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RegistryNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RegistryNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RegistryNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository already exists in the specified registry.\ntype RepositoryAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The repository catalog data doesn't exist.\ntype RepositoryCatalogDataNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryCatalogDataNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryCatalogDataNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryCatalogDataNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryCatalogDataNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryCatalogDataNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified repository contains images. To delete a repository that contains\n// images, you must force the deletion with the force parameter.\ntype RepositoryNotEmptyException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryNotEmptyException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryNotEmptyException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryNotEmptyException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryNotEmptyException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryNotEmptyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository can't be found. Check the spelling of the specified\n// repository and ensure that you're performing operations on the correct registry.\ntype RepositoryNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified repository and registry combination doesn't have an associated\n// repository policy.\ntype RepositoryPolicyNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RepositoryPolicyNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RepositoryPolicyNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RepositoryPolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// These errors are usually caused by a server-side issue.\ntype ServerException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ServerException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ServerException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ServerException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ServerException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }\n\n// The list of tags on the repository is over the limit. The maximum number of\n// tags that can be applied to a repository is 50.\ntype TooManyTagsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TooManyTagsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TooManyTagsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TooManyTagsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TooManyTagsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The action isn't supported in this Region.\ntype UnsupportedCommandException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedCommandException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedCommandException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedCommandException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedCommandException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedCommandException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The upload can't be found, or the specified upload ID isn't valid for this\n// repository.\ntype UploadNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UploadNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UploadNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UploadNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UploadNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UploadNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"time\"\n)\n\n// An authorization token data object that corresponds to a public registry.\ntype AuthorizationData struct {\n\n\t// A base64-encoded string that contains authorization data for a public Amazon\n\t// ECR registry. When the string is decoded, it's presented in the format\n\t// user:password for public registry authentication using docker login .\n\tAuthorizationToken *string\n\n\t// The Unix time in seconds and milliseconds when the authorization token expires.\n\t// Authorization tokens are valid for 12 hours.\n\tExpiresAt *time.Time\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that represents an Amazon ECR image.\ntype Image struct {\n\n\t// An object that contains the image tag and image digest associated with an image.\n\tImageId *ImageIdentifier\n\n\t// The image manifest that's associated with the image.\n\tImageManifest *string\n\n\t// The manifest media type of the image.\n\tImageManifestMediaType *string\n\n\t// The Amazon Web Services account ID that's associated with the registry\n\t// containing the image.\n\tRegistryId *string\n\n\t// The name of the repository that's associated with the image.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that describes an image that's returned by a DescribeImages operation.\ntype ImageDetail struct {\n\n\t// The artifact media type of the image.\n\tArtifactMediaType *string\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The media type of the image manifest.\n\tImageManifestMediaType *string\n\n\t// The date and time, expressed in standard JavaScript date format, that the\n\t// current image was pushed to the repository at.\n\tImagePushedAt *time.Time\n\n\t// The size, in bytes, of the image in the repository. If the image is a manifest\n\t// list, this is the max size of all manifests in the list. Beginning with Docker\n\t// version 1.9, the Docker client compresses image layers before pushing them to a\n\t// V2 Docker registry. The output of the docker images command shows the\n\t// uncompressed image size, so it might return a larger image size than the image\n\t// sizes that are returned by DescribeImages .\n\tImageSizeInBytes *int64\n\n\t// The list of tags that's associated with this image.\n\tImageTags []string\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// where this image belongs.\n\tRegistryId *string\n\n\t// The name of the repository where this image belongs.\n\tRepositoryName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that represents an Amazon ECR image failure.\ntype ImageFailure struct {\n\n\t// The code that's associated with the failure.\n\tFailureCode ImageFailureCode\n\n\t// The reason for the failure.\n\tFailureReason *string\n\n\t// The image ID that's associated with the failure.\n\tImageId *ImageIdentifier\n\n\tnoSmithyDocumentSerde\n}\n\n// An object with identifying information for an Amazon ECR image.\ntype ImageIdentifier struct {\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The tag that's used for the image.\n\tImageTag *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that represents the image tag details for an image.\ntype ImageTagDetail struct {\n\n\t// The time stamp that indicates when the image tag was created.\n\tCreatedAt *time.Time\n\n\t// An object that describes the details of an image.\n\tImageDetail *ReferencedImageDetail\n\n\t// The tag that's associated with the image.\n\tImageTag *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that represents an Amazon ECR image layer.\ntype Layer struct {\n\n\t// The availability status of the image layer.\n\tLayerAvailability LayerAvailability\n\n\t// The sha256 digest of the image layer.\n\tLayerDigest *string\n\n\t// The size, in bytes, of the image layer.\n\tLayerSize *int64\n\n\t// The media type of the layer, such as\n\t// application/vnd.docker.image.rootfs.diff.tar.gzip or\n\t// application/vnd.oci.image.layer.v1.tar+gzip .\n\tMediaType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that represents an Amazon ECR image layer failure.\ntype LayerFailure struct {\n\n\t// The failure code that's associated with the failure.\n\tFailureCode LayerFailureCode\n\n\t// The reason for the failure.\n\tFailureReason *string\n\n\t// The layer digest that's associated with the failure.\n\tLayerDigest *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that describes the image tag details that are returned by a\n// DescribeImageTags action.\ntype ReferencedImageDetail struct {\n\n\t// The artifact media type of the image.\n\tArtifactMediaType *string\n\n\t// The sha256 digest of the image manifest.\n\tImageDigest *string\n\n\t// The media type of the image manifest.\n\tImageManifestMediaType *string\n\n\t// The date and time, expressed in standard JavaScript date format, which the\n\t// current image tag was pushed to the repository at.\n\tImagePushedAt *time.Time\n\n\t// The size, in bytes, of the image in the repository. If the image is a manifest\n\t// list, this is the max size of all manifests in the list. Beginning with Docker\n\t// version 1.9, the Docker client compresses image layers before pushing them to a\n\t// V2 Docker registry. The output of the docker images command shows the\n\t// uncompressed image size, so it might return a larger image size than the image\n\t// sizes that are returned by DescribeImages .\n\tImageSizeInBytes *int64\n\n\tnoSmithyDocumentSerde\n}\n\n// The details of a public registry.\ntype Registry struct {\n\n\t// An array of objects that represents the aliases for a public registry.\n\t//\n\t// This member is required.\n\tAliases []RegistryAlias\n\n\t// The Amazon Resource Name (ARN) of the public registry.\n\t//\n\t// This member is required.\n\tRegistryArn *string\n\n\t// The Amazon Web Services account ID that's associated with the registry. If you\n\t// do not specify a registry, the default public registry is assumed.\n\t//\n\t// This member is required.\n\tRegistryId *string\n\n\t// The URI of a public registry. The URI contains a universal prefix and the\n\t// registry alias.\n\t//\n\t// This member is required.\n\tRegistryUri *string\n\n\t// Indicates whether the account is a verified Amazon Web Services Marketplace\n\t// vendor. If an account is verified, each public repository receives a verified\n\t// account badge on the Amazon ECR Public Gallery.\n\t//\n\t// This member is required.\n\tVerified *bool\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing the aliases for a public registry. A public registry is\n// given an alias when it's created. However, a custom alias can be set using the\n// Amazon ECR console. For more information, see Registries (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html)\n// in the Amazon Elastic Container Registry User Guide.\ntype RegistryAlias struct {\n\n\t// Indicates whether the registry alias is the default alias for the registry.\n\t// When the first public repository is created, your public registry is assigned a\n\t// default registry alias.\n\t//\n\t// This member is required.\n\tDefaultRegistryAlias bool\n\n\t// The name of the registry alias.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// Indicates whether the registry alias is the primary alias for the registry. If\n\t// true, the alias is the primary registry alias and is displayed in both the\n\t// repository URL and the image URI used in the docker pull commands on the Amazon\n\t// ECR Public Gallery. A registry alias that isn't the primary registry alias can\n\t// be used in the repository URI in a docker pull command.\n\t//\n\t// This member is required.\n\tPrimaryRegistryAlias bool\n\n\t// The status of the registry alias.\n\t//\n\t// This member is required.\n\tStatus RegistryAliasStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// The metadata for a public registry.\ntype RegistryCatalogData struct {\n\n\t// The display name for a public registry. This appears on the Amazon ECR Public\n\t// Gallery. Only accounts that have the verified account badge can have a registry\n\t// display name.\n\tDisplayName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object representing a repository.\ntype Repository struct {\n\n\t// The date and time, in JavaScript date format, when the repository was created.\n\tCreatedAt *time.Time\n\n\t// The Amazon Web Services account ID that's associated with the public registry\n\t// that contains the repository.\n\tRegistryId *string\n\n\t// The Amazon Resource Name (ARN) that identifies the repository. The ARN contains\n\t// the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web\n\t// Services account ID of the repository owner, repository namespace, and\n\t// repository name. For example, arn:aws:ecr:region:012345678910:repository/test .\n\tRepositoryArn *string\n\n\t// The name of the repository.\n\tRepositoryName *string\n\n\t// The URI for the repository. You can use this URI for container image push and\n\t// pull operations.\n\tRepositoryUri *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The catalog data for a repository. This data is publicly visible in the Amazon\n// ECR Public Gallery.\ntype RepositoryCatalogData struct {\n\n\t// The longform description of the contents of the repository. This text appears\n\t// in the repository details on the Amazon ECR Public Gallery.\n\tAboutText *string\n\n\t// The architecture tags that are associated with the repository. Only supported\n\t// operating system tags appear publicly in the Amazon ECR Public Gallery. For more\n\t// information, see RepositoryCatalogDataInput .\n\tArchitectures []string\n\n\t// The short description of the repository.\n\tDescription *string\n\n\t// The URL that contains the logo that's associated with the repository.\n\tLogoUrl *string\n\n\t// Indicates whether the repository is certified by Amazon Web Services\n\t// Marketplace.\n\tMarketplaceCertified *bool\n\n\t// The operating system tags that are associated with the repository. Only\n\t// supported operating system tags appear publicly in the Amazon ECR Public\n\t// Gallery. For more information, see RepositoryCatalogDataInput .\n\tOperatingSystems []string\n\n\t// The longform usage details of the contents of the repository. The usage text\n\t// provides context for users of the repository.\n\tUsageText *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that contains the catalog data for a repository. This data is\n// publicly visible in the Amazon ECR Public Gallery.\ntype RepositoryCatalogDataInput struct {\n\n\t// A detailed description of the contents of the repository. It's publicly visible\n\t// in the Amazon ECR Public Gallery. The text must be in markdown format.\n\tAboutText *string\n\n\t// The system architecture that the images in the repository are compatible with.\n\t// On the Amazon ECR Public Gallery, the following supported architectures appear\n\t// as badges on the repository and are used as search filters. If an unsupported\n\t// tag is added to your repository catalog data, it's associated with the\n\t// repository and can be retrieved using the API but isn't discoverable in the\n\t// Amazon ECR Public Gallery.\n\t//   - ARM\n\t//   - ARM 64\n\t//   - x86\n\t//   - x86-64\n\tArchitectures []string\n\n\t// A short description of the contents of the repository. This text appears in\n\t// both the image details and also when searching for repositories on the Amazon\n\t// ECR Public Gallery.\n\tDescription *string\n\n\t// The base64-encoded repository logo payload. The repository logo is only\n\t// publicly visible in the Amazon ECR Public Gallery for verified accounts.\n\tLogoImageBlob []byte\n\n\t// The operating systems that the images in the repository are compatible with. On\n\t// the Amazon ECR Public Gallery, the following supported operating systems appear\n\t// as badges on the repository and are used as search filters. If an unsupported\n\t// tag is added to your repository catalog data, it's associated with the\n\t// repository and can be retrieved using the API but isn't discoverable in the\n\t// Amazon ECR Public Gallery.\n\t//   - Linux\n\t//   - Windows\n\tOperatingSystems []string\n\n\t// Detailed information about how to use the contents of the repository. It's\n\t// publicly visible in the Amazon ECR Public Gallery. The usage text provides\n\t// context, support information, and additional usage details for users of the\n\t// repository. The text must be in markdown format.\n\tUsageText *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The metadata that you apply to a resource to help you categorize and organize\n// them. Each tag consists of a key and an optional value. You define both. Tag\n// keys can have a maximum character length of 128 characters, and tag values can\n// have a maximum length of 256 characters.\ntype Tag struct {\n\n\t// One part of a key-value pair that make up a tag. A key is a general label that\n\t// acts like a category for more specific tag values.\n\tKey *string\n\n\t// The optional part of a key-value pair that make up a tag. A value acts as a\n\t// descriptor within a tag category (key).\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ecrpublic\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpBatchCheckLayerAvailability struct {\n}\n\nfunc (*validateOpBatchCheckLayerAvailability) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchCheckLayerAvailability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchCheckLayerAvailabilityInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchCheckLayerAvailabilityInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpBatchDeleteImage struct {\n}\n\nfunc (*validateOpBatchDeleteImage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpBatchDeleteImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*BatchDeleteImageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpBatchDeleteImageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCompleteLayerUpload struct {\n}\n\nfunc (*validateOpCompleteLayerUpload) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCompleteLayerUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CompleteLayerUploadInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCompleteLayerUploadInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateRepository struct {\n}\n\nfunc (*validateOpCreateRepository) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateRepository) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateRepositoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateRepositoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteRepository struct {\n}\n\nfunc (*validateOpDeleteRepository) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteRepository) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteRepositoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteRepositoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteRepositoryPolicy struct {\n}\n\nfunc (*validateOpDeleteRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeImages struct {\n}\n\nfunc (*validateOpDescribeImages) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeImages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeImagesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeImagesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeImageTags struct {\n}\n\nfunc (*validateOpDescribeImageTags) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeImageTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeImageTagsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeImageTagsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetRepositoryCatalogData struct {\n}\n\nfunc (*validateOpGetRepositoryCatalogData) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetRepositoryCatalogData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetRepositoryCatalogDataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetRepositoryCatalogDataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetRepositoryPolicy struct {\n}\n\nfunc (*validateOpGetRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpInitiateLayerUpload struct {\n}\n\nfunc (*validateOpInitiateLayerUpload) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpInitiateLayerUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*InitiateLayerUploadInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpInitiateLayerUploadInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListTagsForResource struct {\n}\n\nfunc (*validateOpListTagsForResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListTagsForResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutImage struct {\n}\n\nfunc (*validateOpPutImage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutImageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutImageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutRepositoryCatalogData struct {\n}\n\nfunc (*validateOpPutRepositoryCatalogData) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutRepositoryCatalogData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutRepositoryCatalogDataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutRepositoryCatalogDataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpSetRepositoryPolicy struct {\n}\n\nfunc (*validateOpSetRepositoryPolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpSetRepositoryPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*SetRepositoryPolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpSetRepositoryPolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpTagResource struct {\n}\n\nfunc (*validateOpTagResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*TagResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpTagResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUntagResource struct {\n}\n\nfunc (*validateOpUntagResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UntagResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUntagResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUploadLayerPart struct {\n}\n\nfunc (*validateOpUploadLayerPart) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUploadLayerPart) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UploadLayerPartInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUploadLayerPartInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpBatchCheckLayerAvailabilityValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchCheckLayerAvailability{}, middleware.After)\n}\n\nfunc addOpBatchDeleteImageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpBatchDeleteImage{}, middleware.After)\n}\n\nfunc addOpCompleteLayerUploadValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCompleteLayerUpload{}, middleware.After)\n}\n\nfunc addOpCreateRepositoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateRepository{}, middleware.After)\n}\n\nfunc addOpDeleteRepositoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteRepository{}, middleware.After)\n}\n\nfunc addOpDeleteRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpDescribeImagesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeImages{}, middleware.After)\n}\n\nfunc addOpDescribeImageTagsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeImageTags{}, middleware.After)\n}\n\nfunc addOpGetRepositoryCatalogDataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetRepositoryCatalogData{}, middleware.After)\n}\n\nfunc addOpGetRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpInitiateLayerUploadValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpInitiateLayerUpload{}, middleware.After)\n}\n\nfunc addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)\n}\n\nfunc addOpPutImageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutImage{}, middleware.After)\n}\n\nfunc addOpPutRepositoryCatalogDataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutRepositoryCatalogData{}, middleware.After)\n}\n\nfunc addOpSetRepositoryPolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpSetRepositoryPolicy{}, middleware.After)\n}\n\nfunc addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpTagResource{}, middleware.After)\n}\n\nfunc addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)\n}\n\nfunc addOpUploadLayerPartValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUploadLayerPart{}, middleware.After)\n}\n\nfunc validateOpBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchCheckLayerAvailabilityInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.LayerDigests == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerDigests\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpBatchDeleteImageInput(v *BatchDeleteImageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BatchDeleteImageInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageIds == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageIds\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCompleteLayerUploadInput(v *CompleteLayerUploadInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CompleteLayerUploadInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.UploadId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"UploadId\"))\n\t}\n\tif v.LayerDigests == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerDigests\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateRepositoryInput(v *CreateRepositoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateRepositoryInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteRepositoryInput(v *DeleteRepositoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteRepositoryInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteRepositoryPolicyInput(v *DeleteRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeImagesInput(v *DescribeImagesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeImagesInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeImageTagsInput(v *DescribeImageTagsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeImageTagsInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetRepositoryCatalogDataInput(v *GetRepositoryCatalogDataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetRepositoryCatalogDataInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetRepositoryPolicyInput(v *GetRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpInitiateLayerUploadInput(v *InitiateLayerUploadInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InitiateLayerUploadInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListTagsForResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutImageInput(v *PutImageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutImageInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.ImageManifest == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ImageManifest\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutRepositoryCatalogDataInput(v *PutRepositoryCatalogDataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutRepositoryCatalogDataInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.CatalogData == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"CatalogData\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpSetRepositoryPolicyInput(v *SetRepositoryPolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SetRepositoryPolicyInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.PolicyText == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PolicyText\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpTagResourceInput(v *TagResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TagResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.Tags == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Tags\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUntagResourceInput(v *UntagResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UntagResourceInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.TagKeys == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TagKeys\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUploadLayerPartInput(v *UploadLayerPartInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UploadLayerPartInput\"}\n\tif v.RepositoryName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RepositoryName\"))\n\t}\n\tif v.UploadId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"UploadId\"))\n\t}\n\tif v.PartFirstByte == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PartFirstByte\"))\n\t}\n\tif v.PartLastByte == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PartLastByte\"))\n\t}\n\tif v.LayerPartBlob == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"LayerPartBlob\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md",
    "content": "# v1.11.3 (2024-06-28)\n\n* No change notes available for this release.\n\n# v1.11.2 (2024-03-29)\n\n* No change notes available for this release.\n\n# v1.11.1 (2024-02-21)\n\n* No change notes available for this release.\n\n# v1.11.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n\n# v1.10.4 (2023-12-07)\n\n* No change notes available for this release.\n\n# v1.10.3 (2023-11-30)\n\n* No change notes available for this release.\n\n# v1.10.2 (2023-11-29)\n\n* No change notes available for this release.\n\n# v1.10.1 (2023-11-15)\n\n* No change notes available for this release.\n\n# v1.10.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n\n# v1.9.15 (2023-10-06)\n\n* No change notes available for this release.\n\n# v1.9.14 (2023-08-18)\n\n* No change notes available for this release.\n\n# v1.9.13 (2023-08-07)\n\n* No change notes available for this release.\n\n# v1.9.12 (2023-07-31)\n\n* No change notes available for this release.\n\n# v1.9.11 (2022-12-02)\n\n* No change notes available for this release.\n\n# v1.9.10 (2022-10-24)\n\n* No change notes available for this release.\n\n# v1.9.9 (2022-09-14)\n\n* No change notes available for this release.\n\n# v1.9.8 (2022-09-02)\n\n* No change notes available for this release.\n\n# v1.9.7 (2022-08-31)\n\n* No change notes available for this release.\n\n# v1.9.6 (2022-08-29)\n\n* No change notes available for this release.\n\n# v1.9.5 (2022-08-11)\n\n* No change notes available for this release.\n\n# v1.9.4 (2022-08-09)\n\n* No change notes available for this release.\n\n# v1.9.3 (2022-06-29)\n\n* No change notes available for this release.\n\n# v1.9.2 (2022-06-07)\n\n* No change notes available for this release.\n\n# v1.9.1 (2022-03-24)\n\n* No change notes available for this release.\n\n# v1.9.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.8.0 (2022-02-24)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.7.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.6.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.5.0 (2021-11-06)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.4.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n\n# v1.3.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.2.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n\n# v1.2.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.2.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n\n# v1.1.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go",
    "content": "package acceptencoding\n\nimport (\n\t\"compress/gzip\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nconst acceptEncodingHeaderKey = \"Accept-Encoding\"\nconst contentEncodingHeaderKey = \"Content-Encoding\"\n\n// AddAcceptEncodingGzipOptions provides the options for the\n// AddAcceptEncodingGzip middleware setup.\ntype AddAcceptEncodingGzipOptions struct {\n\tEnable bool\n}\n\n// AddAcceptEncodingGzip explicitly adds handling for accept-encoding GZIP\n// middleware to the operation stack. This allows checksums to be correctly\n// computed without disabling GZIP support.\nfunc AddAcceptEncodingGzip(stack *middleware.Stack, options AddAcceptEncodingGzipOptions) error {\n\tif options.Enable {\n\t\tif err := stack.Finalize.Add(&EnableGzip{}, middleware.Before); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := stack.Deserialize.Insert(&DecompressGzip{}, \"OperationDeserializer\", middleware.After); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn stack.Finalize.Add(&DisableGzip{}, middleware.Before)\n}\n\n// DisableGzip provides the middleware that will\n// disable the underlying http client automatically enabling for gzip\n// decompress content-encoding support.\ntype DisableGzip struct{}\n\n// ID returns the id for the middleware.\nfunc (*DisableGzip) ID() string {\n\treturn \"DisableAcceptEncodingGzip\"\n}\n\n// HandleFinalize implements the FinalizeMiddleware interface.\nfunc (*DisableGzip) HandleFinalize(\n\tctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\toutput middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := input.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn output, metadata, &smithy.SerializationError{\n\t\t\tErr: fmt.Errorf(\"unknown request type %T\", input.Request),\n\t\t}\n\t}\n\n\t// Explicitly enable gzip support, this will prevent the http client from\n\t// auto extracting the zipped content.\n\treq.Header.Set(acceptEncodingHeaderKey, \"identity\")\n\n\treturn next.HandleFinalize(ctx, input)\n}\n\n// EnableGzip provides a middleware to enable support for\n// gzip responses, with manual decompression. This prevents the underlying HTTP\n// client from performing the gzip decompression automatically.\ntype EnableGzip struct{}\n\n// ID returns the id for the middleware.\nfunc (*EnableGzip) ID() string {\n\treturn \"AcceptEncodingGzip\"\n}\n\n// HandleFinalize implements the FinalizeMiddleware interface.\nfunc (*EnableGzip) HandleFinalize(\n\tctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\toutput middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := input.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn output, metadata, &smithy.SerializationError{\n\t\t\tErr: fmt.Errorf(\"unknown request type %T\", input.Request),\n\t\t}\n\t}\n\n\t// Explicitly enable gzip support, this will prevent the http client from\n\t// auto extracting the zipped content.\n\treq.Header.Set(acceptEncodingHeaderKey, \"gzip\")\n\n\treturn next.HandleFinalize(ctx, input)\n}\n\n// DecompressGzip provides the middleware for decompressing a gzip\n// response from the service.\ntype DecompressGzip struct{}\n\n// ID returns the id for the middleware.\nfunc (*DecompressGzip) ID() string {\n\treturn \"DecompressGzip\"\n}\n\n// HandleDeserialize implements the DeserializeMiddlware interface.\nfunc (*DecompressGzip) HandleDeserialize(\n\tctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\toutput middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\toutput, metadata, err = next.HandleDeserialize(ctx, input)\n\tif err != nil {\n\t\treturn output, metadata, err\n\t}\n\n\tresp, ok := output.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn output, metadata, &smithy.DeserializationError{\n\t\t\tErr: fmt.Errorf(\"unknown response type %T\", output.RawResponse),\n\t\t}\n\t}\n\tif v := resp.Header.Get(contentEncodingHeaderKey); v != \"gzip\" {\n\t\treturn output, metadata, err\n\t}\n\n\t// Clear content length since it will no longer be valid once the response\n\t// body is decompressed.\n\tresp.Header.Del(\"Content-Length\")\n\tresp.ContentLength = -1\n\n\tresp.Body = wrapGzipReader(resp.Body)\n\n\treturn output, metadata, err\n}\n\ntype gzipReader struct {\n\treader io.ReadCloser\n\tgzip   *gzip.Reader\n}\n\nfunc wrapGzipReader(reader io.ReadCloser) *gzipReader {\n\treturn &gzipReader{\n\t\treader: reader,\n\t}\n}\n\n// Read wraps the gzip reader around the underlying io.Reader to extract the\n// response bytes on the fly.\nfunc (g *gzipReader) Read(b []byte) (n int, err error) {\n\tif g.gzip == nil {\n\t\tg.gzip, err = gzip.NewReader(g.reader)\n\t\tif err != nil {\n\t\t\tg.gzip = nil // ensure uninitialized gzip value isn't used in close.\n\t\t\treturn 0, fmt.Errorf(\"failed to decompress gzip response, %w\", err)\n\t\t}\n\t}\n\n\treturn g.gzip.Read(b)\n}\n\nfunc (g *gzipReader) Close() error {\n\tif g.gzip == nil {\n\t\treturn nil\n\t}\n\n\tif err := g.gzip.Close(); err != nil {\n\t\tg.reader.Close()\n\t\treturn fmt.Errorf(\"failed to decompress gzip response, %w\", err)\n\t}\n\n\treturn g.reader.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go",
    "content": "/*\nPackage acceptencoding provides customizations associated with Accept Encoding Header.\n\n# Accept encoding gzip\n\nThe Go HTTP client automatically supports accept-encoding and content-encoding\ngzip by default. This default behavior is not desired by the SDK, and prevents\nvalidating the response body's checksum. To prevent this the SDK must manually\ncontrol usage of content-encoding gzip.\n\nTo control content-encoding, the SDK must always set the `Accept-Encoding`\nheader to a value. This prevents the HTTP client from using gzip automatically.\nWhen gzip is enabled on the API client, the SDK's customization will control\ndecompressing the gzip data in order to not break the checksum validation. When\ngzip is disabled, the API client will disable gzip, preventing the HTTP\nclient's default behavior.\n\nAn `EnableAcceptEncodingGzip` option may or may not be present depending on the client using\nthe below middleware. The option if present can be used to enable auto decompressing\ngzip by the SDK.\n*/\npackage acceptencoding\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage acceptencoding\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.11.3\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md",
    "content": "# v1.11.17 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.16 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.15 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.14 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.13 (2024-06-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.12 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.11 (2024-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.10 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.9 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.8 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.7 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.6 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.5 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.4 (2024-03-05)\n\n* **Bug Fix**: Restore typo'd API `AddAsIsInternalPresigingMiddleware` as an alias for backwards compatibility.\n\n# v1.11.3 (2024-03-04)\n\n* **Bug Fix**: Correct a typo in internal AddAsIsPresigningMiddleware API.\n\n# v1.11.2 (2024-02-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.1 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.10 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.9 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.8 (2023-12-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.7 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.6 (2023-11-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.5 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.4 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.3 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.2 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.1 (2023-11-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.37 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.36 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.35 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.34 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.33 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.32 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.31 (2023-07-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.30 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.29 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.28 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.27 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.26 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.25 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.24 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.23 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.22 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.21 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.20 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.19 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.18 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.17 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.16 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.15 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.14 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.13 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.12 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.11 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.10 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.9 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.8 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.7 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.6 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2022-02-24)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.2 (2021-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-11-06)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.1.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go",
    "content": "package presignedurl\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// WithIsPresigning adds the isPresigning sentinel value to a context to signal\n// that the middleware stack is using the presign flow.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc WithIsPresigning(ctx context.Context) context.Context {\n\treturn middleware.WithStackValue(ctx, isPresigningKey{}, true)\n}\n\n// GetIsPresigning returns if the context contains the isPresigning sentinel\n// value for presigning flows.\n//\n// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues\n// to clear all stack values.\nfunc GetIsPresigning(ctx context.Context) bool {\n\tv, _ := middleware.GetStackValue(ctx, isPresigningKey{}).(bool)\n\treturn v\n}\n\ntype isPresigningKey struct{}\n\n// AddAsIsPresigningMiddleware adds a middleware to the head of the stack that\n// will update the stack's context to be flagged as being invoked for the\n// purpose of presigning.\nfunc AddAsIsPresigningMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(asIsPresigningMiddleware{}, middleware.Before)\n}\n\n// AddAsIsPresigingMiddleware is an alias for backwards compatibility.\n//\n// Deprecated: This API was released with a typo. Use\n// [AddAsIsPresigningMiddleware] instead.\nfunc AddAsIsPresigingMiddleware(stack *middleware.Stack) error {\n\treturn AddAsIsPresigningMiddleware(stack)\n}\n\ntype asIsPresigningMiddleware struct{}\n\nfunc (asIsPresigningMiddleware) ID() string { return \"AsIsPresigningMiddleware\" }\n\nfunc (asIsPresigningMiddleware) HandleInitialize(\n\tctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,\n) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tctx = WithIsPresigning(ctx)\n\treturn next.HandleInitialize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.go",
    "content": "// Package presignedurl provides the customizations for API clients to fill in\n// presigned URLs into input parameters.\npackage presignedurl\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage presignedurl\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.11.17\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.go",
    "content": "package presignedurl\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tv4 \"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// URLPresigner provides the interface to presign the input parameters in to a\n// presigned URL.\ntype URLPresigner interface {\n\t// PresignURL presigns a URL.\n\tPresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error)\n}\n\n// ParameterAccessor provides an collection of accessor to for retrieving and\n// setting the values needed to PresignedURL generation\ntype ParameterAccessor struct {\n\t// GetPresignedURL accessor points to a function that retrieves a presigned url if present\n\tGetPresignedURL func(interface{}) (string, bool, error)\n\n\t// GetSourceRegion accessor points to a function that retrieves source region for presigned url\n\tGetSourceRegion func(interface{}) (string, bool, error)\n\n\t// CopyInput accessor points to a function that takes in an input, and returns a copy.\n\tCopyInput func(interface{}) (interface{}, error)\n\n\t// SetDestinationRegion accessor points to a function that sets destination region on api input struct\n\tSetDestinationRegion func(interface{}, string) error\n\n\t// SetPresignedURL accessor points to a function that sets presigned url on api input struct\n\tSetPresignedURL func(interface{}, string) error\n}\n\n// Options provides the set of options needed by the presigned URL middleware.\ntype Options struct {\n\t// Accessor are the parameter accessors used by this middleware\n\tAccessor ParameterAccessor\n\n\t// Presigner is the URLPresigner used by the middleware\n\tPresigner URLPresigner\n}\n\n// AddMiddleware adds the Presign URL middleware to the middleware stack.\nfunc AddMiddleware(stack *middleware.Stack, opts Options) error {\n\treturn stack.Initialize.Add(&presign{options: opts}, middleware.Before)\n}\n\n// RemoveMiddleware removes the Presign URL middleware from the stack.\nfunc RemoveMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Initialize.Remove((*presign)(nil).ID())\n\treturn err\n}\n\ntype presign struct {\n\toptions Options\n}\n\nfunc (m *presign) ID() string { return \"Presign\" }\n\nfunc (m *presign) HandleInitialize(\n\tctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler,\n) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\t// If PresignedURL is already set ignore middleware.\n\tif _, ok, err := m.options.Accessor.GetPresignedURL(input.Parameters); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"presign middleware failed, %w\", err)\n\t} else if ok {\n\t\treturn next.HandleInitialize(ctx, input)\n\t}\n\n\t// If have source region is not set ignore middleware.\n\tsrcRegion, ok, err := m.options.Accessor.GetSourceRegion(input.Parameters)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"presign middleware failed, %w\", err)\n\t} else if !ok || len(srcRegion) == 0 {\n\t\treturn next.HandleInitialize(ctx, input)\n\t}\n\n\t// Create a copy of the original input so the destination region value can\n\t// be added. This ensures that value does not leak into the original\n\t// request parameters.\n\tparamCpy, err := m.options.Accessor.CopyInput(input.Parameters)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"unable to create presigned URL, %w\", err)\n\t}\n\n\t// Destination region is the API client's configured region.\n\tdstRegion := awsmiddleware.GetRegion(ctx)\n\tif err = m.options.Accessor.SetDestinationRegion(paramCpy, dstRegion); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"presign middleware failed, %w\", err)\n\t}\n\n\tpresignedReq, err := m.options.Presigner.PresignURL(ctx, srcRegion, paramCpy)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"unable to create presigned URL, %w\", err)\n\t}\n\n\t// Update the original input with the presigned URL value.\n\tif err = m.options.Accessor.SetPresignedURL(input.Parameters, presignedReq.URL); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"presign middleware failed, %w\", err)\n\t}\n\n\treturn next.HandleInitialize(ctx, input)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/CHANGELOG.md",
    "content": "# v1.44.7 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.44.6 (2023-12-20)\n\n* No change notes available for this release.\n\n# v1.44.5 (2023-12-08)\n\n* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.\n\n# v1.44.4 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.44.3 (2023-12-06)\n\n* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.\n\n# v1.44.2 (2023-12-01)\n\n* **Bug Fix**: Correct wrapping of errors in authentication workflow.\n* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.44.1 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.44.0 (2023-11-29)\n\n* **Feature**: Expose Options() accessor on service clients.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.43.3 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.43.2 (2023-11-28)\n\n* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.\n\n# v1.43.1 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.43.0 (2023-11-16)\n\n* **Feature**: This release introduces the ability to filter automation execution steps which have parent steps. In addition, runbook variable information is returned by GetAutomationExecution and parent step information is returned by the DescribeAutomationStepExecutions API.\n\n# v1.42.2 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.42.1 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.42.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.41.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.40.0 (2023-10-24)\n\n* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162).\n\n# v1.39.0 (2023-10-20)\n\n* **Feature**: This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem.\n\n# v1.38.2 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.38.1 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.38.0 (2023-09-25)\n\n* **Feature**: This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output.\n\n# v1.37.5 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.37.4 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.37.3 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.37.2 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.37.1 (2023-08-01)\n\n* No change notes available for this release.\n\n# v1.37.0 (2023-07-31)\n\n* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.9 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.8 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.7 (2023-06-27)\n\n* **Documentation**: Systems Manager doc-only update for June 2023.\n\n# v1.36.6 (2023-06-15)\n\n* No change notes available for this release.\n\n# v1.36.5 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.4 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.36.3 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.2 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.36.1 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.36.0 (2023-03-22)\n\n* **Feature**: This Patch Manager release supports creating, updating, and deleting Patch Baselines for AmazonLinux2023, AlmaLinux.\n\n# v1.35.7 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.35.6 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.35.5 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n* **Documentation**: Document only update for Feb 2023\n\n# v1.35.4 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.35.3 (2023-02-15)\n\n* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.\n* **Bug Fix**: Correct error type parsing for restJson services.\n\n# v1.35.2 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.35.1 (2023-01-23)\n\n* No change notes available for this release.\n\n# v1.35.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.34.0 (2023-01-04)\n\n* **Feature**: Adding support for QuickSetup Document Type in Systems Manager\n\n# v1.33.4 (2022-12-21)\n\n* **Documentation**: Doc-only updates for December 2022.\n\n# v1.33.3 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.33.2 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.33.1 (2022-11-22)\n\n* No change notes available for this release.\n\n# v1.33.0 (2022-11-16)\n\n* **Feature**: This release adds support for cross account access in CreateOpsItem, UpdateOpsItem and GetOpsItem. It introduces new APIs to setup resource policies for SSM resources: PutResourcePolicy, GetResourcePolicies and DeleteResourcePolicy.\n\n# v1.32.1 (2022-11-10)\n\n* No change notes available for this release.\n\n# v1.32.0 (2022-11-07)\n\n* **Feature**: This release includes support for applying a CloudWatch alarm to multi account multi region Systems Manager Automation\n\n# v1.31.3 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.31.2 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.31.1 (2022-10-20)\n\n* No change notes available for this release.\n\n# v1.31.0 (2022-10-13)\n\n* **Feature**: Support of AmazonLinux2022 by Patch Manager\n\n# v1.30.0 (2022-09-26)\n\n* **Feature**: This release includes support for applying a CloudWatch alarm to Systems Manager capabilities like Automation, Run Command, State Manager, and Maintenance Windows.\n\n# v1.29.0 (2022-09-23)\n\n* **Feature**: This release adds new SSM document types ConformancePackTemplate and CloudFormation\n\n# v1.28.1 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.0 (2022-09-14)\n\n* **Feature**: Fixed a bug in the API client generation which caused some operation parameters to be incorrectly generated as value types instead of pointer types. The service API always required these affected parameters to be nilable. This fixes the SDK client to match the expectations of the the service API.\n* **Feature**: This release adds support for Systems Manager State Manager Association tagging.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.13 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.12 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.11 (2022-08-30)\n\n* No change notes available for this release.\n\n# v1.27.10 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.9 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.8 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.7 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.6 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.5 (2022-07-27)\n\n* **Documentation**: Adding doc updates for OpsCenter support in Service Setting actions.\n\n# v1.27.4 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.3 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.2 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.1 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.0 (2022-05-04)\n\n* **Feature**: This release adds the TargetMaps parameter in SSM State Manager API.\n\n# v1.26.0 (2022-04-29)\n\n* **Feature**: Update the StartChangeRequestExecution, adding TargetMaps to the Runbook parameter\n\n# v1.25.1 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.0 (2022-04-19)\n\n* **Feature**: Added offset support for specifying the number of days to wait after the date and time specified by a CRON expression when creating SSM association.\n\n# v1.24.1 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.0 (2022-03-25)\n\n* **Feature**: This Patch Manager release supports creating, updating, and deleting Patch Baselines for Rocky Linux OS.\n\n# v1.23.1 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.0 (2022-03-23)\n\n* **Feature**: Update AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource APIs to reflect the support for tagging Automation resources. Includes other minor documentation updates.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.0 (2022-01-14)\n\n* **Feature**: Updated API models\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.0 (2021-12-21)\n\n* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens.\n* **Feature**: Updated to latest service endpoints\n\n# v1.17.1 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2021-11-30)\n\n* **Feature**: API client updated\n\n# v1.16.0 (2021-11-19)\n\n* **Feature**: API client updated\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2021-11-12)\n\n* **Feature**: Service clients now support custom endpoints that have an initial URI path defined.\n* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature.\n\n# v1.14.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2021-10-11)\n\n* **Feature**: API client updated\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2021-09-24)\n\n* **Feature**: API client updated\n\n# v1.10.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.1 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2021-08-12)\n\n* **Feature**: API client updated\n\n# v1.8.1 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-07-15)\n\n* **Feature**: Updated service model to latest version.\n* **Documentation**: Updated service model to latest revision.\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.2 (2021-06-04)\n\n* **Documentation**: Updated service client to latest API model.\n\n# v1.6.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Feature**: Updated to latest service API model.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\tcryptorand \"crypto/rand\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalauth \"github.com/aws/aws-sdk-go-v2/internal/auth\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyrand \"github.com/aws/smithy-go/rand\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nconst ServiceID = \"SSM\"\nconst ServiceAPIVersion = \"2014-11-06\"\n\n// Client provides the API client to make operations call for Amazon Simple\n// Systems Manager (SSM).\ntype Client struct {\n\toptions Options\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveIdempotencyTokenProvider(&options)\n\n\tresolveEndpointResolverV2(&options)\n\n\tresolveAuthSchemeResolver(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttempts(&options)\n\n\tignoreAnonymousAuth(&options)\n\n\twrapWithAnonymousAuth(&options)\n\n\tresolveAuthSchemes(&options)\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\treturn client\n}\n\n// Options returns a copy of the client configuration.\n//\n// Callers SHOULD NOT perform mutations on any inner structures within client\n// config. Config overrides should instead be made on a per-operation basis through\n// functional options.\nfunc (c *Client) Options() Options {\n\treturn c.options.Copy()\n}\n\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeOperationRetryMaxAttempts(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype operationInputKey struct{}\n\nfunc setOperationInput(ctx context.Context, input interface{}) context.Context {\n\treturn middleware.WithStackValue(ctx, operationInputKey{}, input)\n}\n\nfunc getOperationInput(ctx context.Context) interface{} {\n\treturn middleware.GetStackValue(ctx, operationInputKey{})\n}\n\ntype setOperationInputMiddleware struct {\n}\n\nfunc (*setOperationInputMiddleware) ID() string {\n\treturn \"setOperationInput\"\n}\n\nfunc (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tctx = setOperationInput(ctx, in.Parameters)\n\treturn next.HandleSerialize(ctx, in)\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\nfunc resolveAuthSchemeResolver(options *Options) {\n\tif options.AuthSchemeResolver == nil {\n\t\toptions.AuthSchemeResolver = &defaultAuthSchemeResolver{}\n\t}\n}\n\nfunc resolveAuthSchemes(options *Options) {\n\tif options.AuthSchemes == nil {\n\t\toptions.AuthSchemes = []smithyhttp.AuthScheme{\n\t\t\tinternalauth.NewHTTPAuthScheme(\"aws.auth#sigv4\", &internalauthsmithy.V4SignerAdapter{\n\t\t\t\tSigner:     options.HTTPSignerV4,\n\t\t\t\tLogger:     options.Logger,\n\t\t\t\tLogSigning: options.ClientLogMode.IsSigning(),\n\t\t\t}),\n\t\t}\n\t}\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\ntype legacyEndpointContextSetter struct {\n\tLegacyResolver EndpointResolver\n}\n\nfunc (*legacyEndpointContextSetter) ID() string {\n\treturn \"legacyEndpointContextSetter\"\n}\n\nfunc (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.LegacyResolver != nil {\n\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)\n\t}\n\n\treturn next.HandleInitialize(ctx, in)\n\n}\nfunc addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {\n\treturn stack.Initialize.Add(&legacyEndpointContextSetter{\n\t\tLegacyResolver: o.EndpointResolver,\n\t}, middleware.Before)\n}\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:             cfg.Region,\n\t\tDefaultsMode:       cfg.DefaultsMode,\n\t\tRuntimeEnvironment: cfg.RuntimeEnvironment,\n\t\tHTTPClient:         cfg.HTTPClient,\n\t\tCredentials:        cfg.Credentials,\n\t\tAPIOptions:         cfg.APIOptions,\n\t\tLogger:             cfg.Logger,\n\t\tClientLogMode:      cfg.ClientLogMode,\n\t\tAppID:              cfg.AppID,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\tresolveBaseEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttempts(o *Options) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc finalizeOperationRetryMaxAttempts(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)\n}\n\nfunc addClientUserAgent(stack *middleware.Stack, options Options) error {\n\tif err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"ssm\", goModuleVersion)(stack); err != nil {\n\t\treturn err\n\t}\n\n\tif len(options.AppID) > 0 {\n\t\treturn awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)\n\t}\n\n\treturn nil\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc resolveIdempotencyTokenProvider(o *Options) {\n\tif o.IdempotencyTokenProvider != nil {\n\t\treturn\n\t}\n\to.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)\n}\n\nfunc addRetryMiddlewares(stack *middleware.Stack, o Options) error {\n\tmo := retry.AddRetryMiddlewaresOptions{\n\t\tRetryer:          o.Retryer,\n\t\tLogRetryAttempts: o.ClientLogMode.IsRetries(),\n\t}\n\treturn retry.AddRetryMiddlewares(stack, mo)\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\n// IdempotencyTokenProvider interface for providing idempotency token\ntype IdempotencyTokenProvider interface {\n\tGetIdempotencyToken() (string, error)\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn awsmiddleware.AddRequestIDRetrieverMiddleware(stack)\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn awshttp.AddResponseErrorMiddleware(stack)\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n\ntype disableHTTPSMiddleware struct {\n\tDisableHTTPS bool\n}\n\nfunc (*disableHTTPSMiddleware) ID() string {\n\treturn \"disableHTTPS\"\n}\n\nfunc (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {\n\t\treq.URL.Scheme = \"http\"\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Finalize.Insert(&disableHTTPSMiddleware{\n\t\tDisableHTTPS: o.EndpointOptions.DisableHTTPS,\n\t}, \"ResolveEndpointV2\", middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AddTagsToResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Adds or overwrites one or more tags for the specified resource. Tags are\n// metadata that you can assign to your automations, documents, managed nodes,\n// maintenance windows, Parameter Store parameters, and patch baselines. Tags\n// enable you to categorize your resources in different ways, for example, by\n// purpose, owner, or environment. Each tag consists of a key and an optional\n// value, both of which you define. For example, you could define a set of tags for\n// your account's managed nodes that helps you track each node's owner and stack\n// level. For example:\n//   - Key=Owner,Value=DbAdmin\n//   - Key=Owner,Value=SysAdmin\n//   - Key=Owner,Value=Dev\n//   - Key=Stack,Value=Production\n//   - Key=Stack,Value=Pre-Production\n//   - Key=Stack,Value=Test\n//\n// Most resources can have a maximum of 50 tags. Automations can have a maximum of\n// 5 tags. We recommend that you devise a set of tag keys that meets your needs for\n// each resource type. Using a consistent set of tag keys makes it easier for you\n// to manage your resources. You can search and filter the resources based on the\n// tags you add. Tags don't have any semantic meaning to and are interpreted\n// strictly as a string of characters. For more information about using tags with\n// Amazon Elastic Compute Cloud (Amazon EC2) instances, see Tagging your Amazon\n// EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)\n// in the Amazon EC2 User Guide.\nfunc (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &AddTagsToResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AddTagsToResource\", params, optFns, c.addOperationAddTagsToResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*AddTagsToResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype AddTagsToResourceInput struct {\n\n\t// The resource ID you want to tag. Use the ID of the resource. Here are some\n\t// examples: MaintenanceWindow : mw-012345abcde PatchBaseline : pb-012345abcde\n\t// Automation : example-c160-4567-8519-012345abcde OpsMetadata object: ResourceID\n\t// for tagging is created from the Amazon Resource Name (ARN) for the object.\n\t// Specifically, ResourceID is created from the strings that come after the word\n\t// opsmetadata in the ARN. For example, an OpsMetadata object with an ARN of\n\t// arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager has a\n\t// ResourceID of either aws/ssm/MyGroup/appmanager or /aws/ssm/MyGroup/appmanager .\n\t// For the Document and Parameter values, use the name of the resource. If you're\n\t// tagging a shared document, you must use the full ARN of the document.\n\t// ManagedInstance : mi-012345abcde The ManagedInstance type for this API\n\t// operation is only for on-premises managed nodes. You must specify the name of\n\t// the managed node in the following format: mi-ID_number . For example,\n\t// mi-1a2b3c4d5e6f .\n\t//\n\t// This member is required.\n\tResourceId *string\n\n\t// Specifies the type of resource you are tagging. The ManagedInstance type for\n\t// this API operation is for on-premises managed nodes. You must specify the name\n\t// of the managed node in the following format: mi-ID_number . For example,\n\t// mi-1a2b3c4d5e6f .\n\t//\n\t// This member is required.\n\tResourceType types.ResourceTypeForTagging\n\n\t// One or more tags. The value parameter is required. Don't enter personally\n\t// identifiable information in this field.\n\t//\n\t// This member is required.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype AddTagsToResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTagsToResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTagsToResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"AddTagsToResource\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpAddTagsToResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opAddTagsToResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"AddTagsToResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AssociateOpsItemRelatedItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Associates a related item to a Systems Manager OpsCenter OpsItem. For example,\n// you can associate an Incident Manager incident or analysis with an OpsItem.\n// Incident Manager and OpsCenter are capabilities of Amazon Web Services Systems\n// Manager.\nfunc (c *Client) AssociateOpsItemRelatedItem(ctx context.Context, params *AssociateOpsItemRelatedItemInput, optFns ...func(*Options)) (*AssociateOpsItemRelatedItemOutput, error) {\n\tif params == nil {\n\t\tparams = &AssociateOpsItemRelatedItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AssociateOpsItemRelatedItem\", params, optFns, c.addOperationAssociateOpsItemRelatedItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*AssociateOpsItemRelatedItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype AssociateOpsItemRelatedItemInput struct {\n\n\t// The type of association that you want to create between an OpsItem and a\n\t// resource. OpsCenter supports IsParentOf and RelatesTo association types.\n\t//\n\t// This member is required.\n\tAssociationType *string\n\n\t// The ID of the OpsItem to which you want to associate a resource as a related\n\t// item.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\t// The type of resource that you want to associate with an OpsItem. OpsCenter\n\t// supports the following types: AWS::SSMIncidents::IncidentRecord : an Incident\n\t// Manager incident. AWS::SSM::Document : a Systems Manager (SSM) document.\n\t//\n\t// This member is required.\n\tResourceType *string\n\n\t// The Amazon Resource Name (ARN) of the Amazon Web Services resource that you\n\t// want to associate with the OpsItem.\n\t//\n\t// This member is required.\n\tResourceUri *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype AssociateOpsItemRelatedItemOutput struct {\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationAssociateOpsItemRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateOpsItemRelatedItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"AssociateOpsItemRelatedItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpAssociateOpsItemRelatedItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateOpsItemRelatedItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opAssociateOpsItemRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"AssociateOpsItemRelatedItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelCommand.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Attempts to cancel the command specified by the Command ID. There is no\n// guarantee that the command will be terminated and the underlying process\n// stopped.\nfunc (c *Client) CancelCommand(ctx context.Context, params *CancelCommandInput, optFns ...func(*Options)) (*CancelCommandOutput, error) {\n\tif params == nil {\n\t\tparams = &CancelCommandInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CancelCommand\", params, optFns, c.addOperationCancelCommandMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CancelCommandOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CancelCommandInput struct {\n\n\t// The ID of the command you want to cancel.\n\t//\n\t// This member is required.\n\tCommandId *string\n\n\t// (Optional) A list of managed node IDs on which you want to cancel the command.\n\t// If not provided, the command is canceled on every node on which it was\n\t// requested.\n\tInstanceIds []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Whether or not the command was successfully canceled. There is no guarantee\n// that a request can be canceled.\ntype CancelCommandOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelCommand{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelCommand{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CancelCommand\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCancelCommandValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCommand(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCancelCommand(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CancelCommand\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelMaintenanceWindowExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Stops a maintenance window execution that is already in progress and cancels\n// any tasks in the window that haven't already starting running. Tasks already in\n// progress will continue to completion.\nfunc (c *Client) CancelMaintenanceWindowExecution(ctx context.Context, params *CancelMaintenanceWindowExecutionInput, optFns ...func(*Options)) (*CancelMaintenanceWindowExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &CancelMaintenanceWindowExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CancelMaintenanceWindowExecution\", params, optFns, c.addOperationCancelMaintenanceWindowExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CancelMaintenanceWindowExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CancelMaintenanceWindowExecutionInput struct {\n\n\t// The ID of the maintenance window execution to stop.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CancelMaintenanceWindowExecutionOutput struct {\n\n\t// The ID of the maintenance window execution that has been stopped.\n\tWindowExecutionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelMaintenanceWindowExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelMaintenanceWindowExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CancelMaintenanceWindowExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCancelMaintenanceWindowExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMaintenanceWindowExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCancelMaintenanceWindowExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CancelMaintenanceWindowExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateActivation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Generates an activation code and activation ID you can use to register your\n// on-premises servers, edge devices, or virtual machine (VM) with Amazon Web\n// Services Systems Manager. Registering these machines with Systems Manager makes\n// it possible to manage them using Systems Manager capabilities. You use the\n// activation code and ID when installing SSM Agent on machines in your hybrid\n// environment. For more information about requirements for managing on-premises\n// machines using Systems Manager, see Setting up Amazon Web Services Systems\n// Manager for hybrid environments (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html)\n// in the Amazon Web Services Systems Manager User Guide. Amazon Elastic Compute\n// Cloud (Amazon EC2) instances, edge devices, and on-premises servers and VMs that\n// are configured for Systems Manager are all called managed nodes.\nfunc (c *Client) CreateActivation(ctx context.Context, params *CreateActivationInput, optFns ...func(*Options)) (*CreateActivationOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateActivationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateActivation\", params, optFns, c.addOperationCreateActivationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateActivationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateActivationInput struct {\n\n\t// The name of the Identity and Access Management (IAM) role that you want to\n\t// assign to the managed node. This IAM role must provide AssumeRole permissions\n\t// for the Amazon Web Services Systems Manager service principal ssm.amazonaws.com\n\t// . For more information, see Create an IAM service role for a hybrid environment (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html)\n\t// in the Amazon Web Services Systems Manager User Guide. You can't specify an IAM\n\t// service-linked role for this parameter. You must create a unique role.\n\t//\n\t// This member is required.\n\tIamRole *string\n\n\t// The name of the registered, managed node as it will appear in the Amazon Web\n\t// Services Systems Manager console or when you use the Amazon Web Services command\n\t// line tools to list Systems Manager resources. Don't enter personally\n\t// identifiable information in this field.\n\tDefaultInstanceName *string\n\n\t// A user-defined description of the resource that you want to register with\n\t// Systems Manager. Don't enter personally identifiable information in this field.\n\tDescription *string\n\n\t// The date by which this activation request should expire, in timestamp format,\n\t// such as \"2021-07-07T00:00:00\". You can specify a date up to 30 days in advance.\n\t// If you don't provide an expiration date, the activation code expires in 24\n\t// hours.\n\tExpirationDate *time.Time\n\n\t// Specify the maximum number of managed nodes you want to register. The default\n\t// value is 1 .\n\tRegistrationLimit *int32\n\n\t// Reserved for internal use.\n\tRegistrationMetadata []types.RegistrationMetadataItem\n\n\t// Optional metadata that you assign to a resource. Tags enable you to categorize\n\t// a resource in different ways, such as by purpose, owner, or environment. For\n\t// example, you might want to tag an activation to identify which servers or\n\t// virtual machines (VMs) in your on-premises environment you intend to activate.\n\t// In this case, you could specify the following key-value pairs:\n\t//   - Key=OS,Value=Windows\n\t//   - Key=Environment,Value=Production\n\t// When you install SSM Agent on your on-premises servers and VMs, you specify an\n\t// activation ID and code. When you specify the activation ID and code, tags\n\t// assigned to the activation are automatically applied to the on-premises servers\n\t// or VMs. You can't add tags to or delete tags from an existing activation. You\n\t// can tag your on-premises servers, edge devices, and VMs after they connect to\n\t// Systems Manager for the first time and are assigned a managed node ID. This\n\t// means they are listed in the Amazon Web Services Systems Manager console with an\n\t// ID that is prefixed with \"mi-\". For information about how to add tags to your\n\t// managed nodes, see AddTagsToResource . For information about how to remove tags\n\t// from your managed nodes, see RemoveTagsFromResource .\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateActivationOutput struct {\n\n\t// The code the system generates when it processes the activation. The activation\n\t// code functions like a password to validate the activation ID.\n\tActivationCode *string\n\n\t// The ID number generated by the system when it processed the activation. The\n\t// activation ID functions like a user name.\n\tActivationId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateActivation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateActivation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateActivation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateActivationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateActivation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateActivation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateActivation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// A State Manager association defines the state that you want to maintain on your\n// managed nodes. For example, an association can specify that anti-virus software\n// must be installed and running on your managed nodes, or that certain ports must\n// be closed. For static targets, the association specifies a schedule for when the\n// configuration is reapplied. For dynamic targets, such as an Amazon Web Services\n// resource group or an Amazon Web Services autoscaling group, State Manager, a\n// capability of Amazon Web Services Systems Manager applies the configuration when\n// new managed nodes are added to the group. The association also specifies actions\n// to take when applying the configuration. For example, an association for\n// anti-virus software might run once a day. If the software isn't installed, then\n// State Manager installs it. If the software is installed, but the service isn't\n// running, then the association might instruct State Manager to start the service.\nfunc (c *Client) CreateAssociation(ctx context.Context, params *CreateAssociationInput, optFns ...func(*Options)) (*CreateAssociationOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateAssociationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateAssociation\", params, optFns, c.addOperationCreateAssociationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateAssociationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateAssociationInput struct {\n\n\t// The name of the SSM Command document or Automation runbook that contains the\n\t// configuration information for the managed node. You can specify Amazon Web\n\t// Services-predefined documents, documents you created, or a document that is\n\t// shared with you from another Amazon Web Services account. For Systems Manager\n\t// documents (SSM documents) that are shared with you from other Amazon Web\n\t// Services accounts, you must specify the complete SSM document ARN, in the\n\t// following format: arn:partition:ssm:region:account-id:document/document-name\n\t// For example: arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For\n\t// Amazon Web Services-predefined documents and SSM documents you created in your\n\t// account, you only need to specify the document name. For example,\n\t// AWS-ApplyPatchBaseline or My-Document .\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// By default, when you create a new association, the system runs it immediately\n\t// after it is created and then according to the schedule you specified. Specify\n\t// this option if you don't want an association to run immediately after you create\n\t// it. This parameter isn't supported for rate expressions.\n\tApplyOnlyAtCronInterval bool\n\n\t// Specify a descriptive name for the association.\n\tAssociationName *string\n\n\t// Choose the parameter that will define how your automation will branch out. This\n\t// target is required for associations that use an Automation runbook and target\n\t// resources by using rate controls. Automation is a capability of Amazon Web\n\t// Services Systems Manager.\n\tAutomationTargetParameterName *string\n\n\t// The names or Amazon Resource Names (ARNs) of the Change Calendar type documents\n\t// you want to gate your associations under. The associations only run when that\n\t// change calendar is open. For more information, see Amazon Web Services Systems\n\t// Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar)\n\t// .\n\tCalendarNames []string\n\n\t// The severity level to assign to the association.\n\tComplianceSeverity types.AssociationComplianceSeverity\n\n\t// The document version you want to associate with the target(s). Can be a\n\t// specific version or the default version. State Manager doesn't support running\n\t// associations that use a new version of a document if that document is shared\n\t// from another account. State Manager always runs the default version of a\n\t// document if shared from another account, even though the Systems Manager console\n\t// shows that a new version was processed. If you want to run an association using\n\t// a new version of a document shared form another account, you must set the\n\t// document version to default .\n\tDocumentVersion *string\n\n\t// The managed node ID. InstanceId has been deprecated. To specify a managed node\n\t// ID for an association, use the Targets parameter. Requests that include the\n\t// parameter InstanceID with Systems Manager documents (SSM documents) that use\n\t// schema version 2.0 or later will fail. In addition, if you use the parameter\n\t// InstanceId , you can't use the parameters AssociationName , DocumentVersion ,\n\t// MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use\n\t// these parameters, you must use the Targets parameter.\n\tInstanceId *string\n\n\t// The maximum number of targets allowed to run the association at the same time.\n\t// You can specify a number, for example 10, or a percentage of the target set, for\n\t// example 10%. The default value is 100%, which means all targets run the\n\t// association at the same time. If a new managed node starts and attempts to run\n\t// an association while Systems Manager is running MaxConcurrency associations,\n\t// the association is allowed to run. During the next association interval, the new\n\t// managed node will process its association within the limit specified for\n\t// MaxConcurrency .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops sending requests\n\t// to run the association on additional targets. You can specify either an absolute\n\t// number of errors, for example 10, or a percentage of the target set, for example\n\t// 10%. If you specify 3, for example, the system stops sending requests when the\n\t// fourth error is received. If you specify 0, then the system stops sending\n\t// requests after the first error is returned. If you run an association on 50\n\t// managed nodes and set MaxError to 10%, then the system stops sending the\n\t// request when the sixth error is received. Executions that are already running an\n\t// association when MaxErrors is reached are allowed to complete, but some of\n\t// these executions may fail as well. If you need to ensure that there won't be\n\t// more than max-errors failed executions, set MaxConcurrency to 1 so that\n\t// executions proceed one at a time.\n\tMaxErrors *string\n\n\t// An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the\n\t// output details of the request.\n\tOutputLocation *types.InstanceAssociationOutputLocation\n\n\t// The parameters for the runtime configuration of the document.\n\tParameters map[string][]string\n\n\t// A cron expression when the association will be applied to the target(s).\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association. For\n\t// example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could\n\t// specify an offset of 3 to run the association each Sunday after the second\n\t// Thursday of the month. For more information about cron schedules for\n\t// associations, see Reference: Cron and rate expressions for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html)\n\t// in the Amazon Web Services Systems Manager User Guide. To use offsets, you must\n\t// specify the ApplyOnlyAtCronInterval parameter. This option tells the system not\n\t// to run an association immediately after you create it.\n\tScheduleOffset *int32\n\n\t// The mode for generating association compliance. You can specify AUTO or MANUAL .\n\t// In AUTO mode, the system uses the status of the association execution to\n\t// determine the compliance status. If the association execution runs successfully,\n\t// then the association is COMPLIANT . If the association execution doesn't run\n\t// successfully, the association is NON-COMPLIANT . In MANUAL mode, you must\n\t// specify the AssociationId as a parameter for the PutComplianceItems API\n\t// operation. In this case, compliance data isn't managed by State Manager. It is\n\t// managed by your direct call to the PutComplianceItems API operation. By\n\t// default, all associations use AUTO mode.\n\tSyncCompliance types.AssociationSyncCompliance\n\n\t// Adds or overwrites one or more tags for a State Manager association. Tags are\n\t// metadata that you can assign to your Amazon Web Services resources. Tags enable\n\t// you to categorize your resources in different ways, for example, by purpose,\n\t// owner, or environment. Each tag consists of a key and an optional value, both of\n\t// which you define.\n\tTags []types.Tag\n\n\t// A location is a combination of Amazon Web Services Regions and Amazon Web\n\t// Services accounts where you want to run the association. Use this action to\n\t// create an association in multiple Regions and multiple accounts.\n\tTargetLocations []types.TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The targets for the association. You can target managed nodes by using tags,\n\t// Amazon Web Services resource groups, all managed nodes in an Amazon Web Services\n\t// account, or individual managed node IDs. You can target all managed nodes in an\n\t// Amazon Web Services account by specifying the InstanceIds key with a value of *\n\t// . For more information about choosing targets for an association, see Using\n\t// targets and rate controls with State Manager associations (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tTargets []types.Target\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateAssociationOutput struct {\n\n\t// Information about the association.\n\tAssociationDescription *types.AssociationDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateAssociation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateAssociationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateAssociation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateAssociation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociationBatch.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Associates the specified Amazon Web Services Systems Manager document (SSM\n// document) with the specified managed nodes or targets. When you associate a\n// document with one or more managed nodes using IDs or tags, Amazon Web Services\n// Systems Manager Agent (SSM Agent) running on the managed node processes the\n// document and configures the node as specified. If you associate a document with\n// a managed node that already has an associated document, the system returns the\n// AssociationAlreadyExists exception.\nfunc (c *Client) CreateAssociationBatch(ctx context.Context, params *CreateAssociationBatchInput, optFns ...func(*Options)) (*CreateAssociationBatchOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateAssociationBatchInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateAssociationBatch\", params, optFns, c.addOperationCreateAssociationBatchMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateAssociationBatchOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateAssociationBatchInput struct {\n\n\t// One or more associations.\n\t//\n\t// This member is required.\n\tEntries []types.CreateAssociationBatchRequestEntry\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateAssociationBatchOutput struct {\n\n\t// Information about the associations that failed.\n\tFailed []types.FailedCreateAssociation\n\n\t// Information about the associations that succeeded.\n\tSuccessful []types.AssociationDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociationBatch{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssociationBatch{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateAssociationBatch\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateAssociationBatchValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociationBatch(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateAssociationBatch(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateAssociationBatch\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateDocument.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates a Amazon Web Services Systems Manager (SSM document). An SSM document\n// defines the actions that Systems Manager performs on your managed nodes. For\n// more information about SSM documents, including information about supported\n// schemas, features, and syntax, see Amazon Web Services Systems Manager Documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) CreateDocument(ctx context.Context, params *CreateDocumentInput, optFns ...func(*Options)) (*CreateDocumentOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateDocument\", params, optFns, c.addOperationCreateDocumentMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateDocumentInput struct {\n\n\t// The content for the new SSM document in JSON or YAML format. The content of the\n\t// document must not exceed 64KB. This quota also includes the content specified\n\t// for input parameters at runtime. We recommend storing the contents for your new\n\t// document in an external JSON or YAML file and referencing the file in a command.\n\t// For examples, see the following topics in the Amazon Web Services Systems\n\t// Manager User Guide.\n\t//   - Create an SSM document (Amazon Web Services API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html)\n\t//   - Create an SSM document (Amazon Web Services CLI) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-cli.html)\n\t//   - Create an SSM document (API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html)\n\t//\n\t// This member is required.\n\tContent *string\n\n\t// A name for the SSM document. You can't use the following strings as document\n\t// name prefixes. These are reserved by Amazon Web Services for use as document\n\t// name prefixes:\n\t//   - aws\n\t//   - amazon\n\t//   - amzn\n\t//\n\t// This member is required.\n\tName *string\n\n\t// A list of key-value pairs that describe attachments to a version of a document.\n\tAttachments []types.AttachmentsSource\n\n\t// An optional field where you can specify a friendly name for the SSM document.\n\t// This value can differ for each version of the document. You can update this\n\t// value at a later time using the UpdateDocument operation.\n\tDisplayName *string\n\n\t// Specify the document format for the request. The document format can be JSON,\n\t// YAML, or TEXT. JSON is the default format.\n\tDocumentFormat types.DocumentFormat\n\n\t// The type of document to create. The DeploymentStrategy document type is an\n\t// internal-use-only document type reserved for AppConfig.\n\tDocumentType types.DocumentType\n\n\t// A list of SSM documents required by a document. This parameter is used\n\t// exclusively by AppConfig. When a user creates an AppConfig configuration in an\n\t// SSM document, the user must also specify a required document for validation\n\t// purposes. In this case, an ApplicationConfiguration document requires an\n\t// ApplicationConfigurationSchema document for validation purposes. For more\n\t// information, see What is AppConfig? (https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html)\n\t// in the AppConfig User Guide.\n\tRequires []types.DocumentRequires\n\n\t// Optional metadata that you assign to a resource. Tags enable you to categorize\n\t// a resource in different ways, such as by purpose, owner, or environment. For\n\t// example, you might want to tag an SSM document to identify the types of targets\n\t// or the environment where it will run. In this case, you could specify the\n\t// following key-value pairs:\n\t//   - Key=OS,Value=Windows\n\t//   - Key=Environment,Value=Production\n\t// To add tags to an existing SSM document, use the AddTagsToResource operation.\n\tTags []types.Tag\n\n\t// Specify a target type to define the kinds of resources the document can run on.\n\t// For example, to run a document on EC2 instances, specify the following value:\n\t// /AWS::EC2::Instance . If you specify a value of '/' the document can run on all\n\t// types of resources. If you don't specify a value, the document can't run on any\n\t// resources. For a list of valid resource types, see Amazon Web Services resource\n\t// and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)\n\t// in the CloudFormation User Guide.\n\tTargetType *string\n\n\t// An optional field specifying the version of the artifact you are creating with\n\t// the document. For example, Release12.1 . This value is unique across all\n\t// versions of a document, and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateDocumentOutput struct {\n\n\t// Information about the SSM document.\n\tDocumentDescription *types.DocumentDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateDocument\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateDocumentValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDocument(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateDocument(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateDocument\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates a new maintenance window. The value you specify for Duration determines\n// the specific end time for the maintenance window based on the time it begins. No\n// maintenance window tasks are permitted to start after the resulting endtime\n// minus the number of hours you specify for Cutoff . For example, if the\n// maintenance window starts at 3 PM, the duration is three hours, and the value\n// you specify for Cutoff is one hour, no maintenance window tasks can start after\n// 5 PM.\nfunc (c *Client) CreateMaintenanceWindow(ctx context.Context, params *CreateMaintenanceWindowInput, optFns ...func(*Options)) (*CreateMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateMaintenanceWindow\", params, optFns, c.addOperationCreateMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateMaintenanceWindowInput struct {\n\n\t// Enables a maintenance window task to run on managed nodes, even if you haven't\n\t// registered those nodes as targets. If enabled, then you must specify the\n\t// unregistered managed nodes (by node ID) when you register a task with the\n\t// maintenance window. If you don't enable this option, then you must specify\n\t// previously-registered targets when you register a task with the maintenance\n\t// window.\n\t//\n\t// This member is required.\n\tAllowUnassociatedTargets bool\n\n\t// The number of hours before the end of the maintenance window that Amazon Web\n\t// Services Systems Manager stops scheduling new tasks for execution.\n\t//\n\t// This member is required.\n\tCutoff int32\n\n\t// The duration of the maintenance window in hours.\n\t//\n\t// This member is required.\n\tDuration *int32\n\n\t// The name of the maintenance window.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The schedule of the maintenance window in the form of a cron or rate expression.\n\t//\n\t// This member is required.\n\tSchedule *string\n\n\t// User-provided idempotency token.\n\tClientToken *string\n\n\t// An optional description for the maintenance window. We recommend specifying a\n\t// description to help you organize your maintenance windows.\n\tDescription *string\n\n\t// The date and time, in ISO-8601 Extended format, for when you want the\n\t// maintenance window to become inactive. EndDate allows you to set a date and\n\t// time in the future when the maintenance window will no longer run.\n\tEndDate *string\n\n\t// The number of days to wait after the date and time specified by a cron\n\t// expression before running the maintenance window. For example, the following\n\t// cron expression schedules a maintenance window to run on the third Tuesday of\n\t// every month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2 ,\n\t// the maintenance window won't run until two days later.\n\tScheduleOffset *int32\n\n\t// The time zone that the scheduled maintenance window executions are based on, in\n\t// Internet Assigned Numbers Authority (IANA) format. For example:\n\t// \"America/Los_Angeles\", \"UTC\", or \"Asia/Seoul\". For more information, see the\n\t// Time Zone Database (https://www.iana.org/time-zones) on the IANA website.\n\tScheduleTimezone *string\n\n\t// The date and time, in ISO-8601 Extended format, for when you want the\n\t// maintenance window to become active. StartDate allows you to delay activation\n\t// of the maintenance window until the specified future date.\n\tStartDate *string\n\n\t// Optional metadata that you assign to a resource. Tags enable you to categorize\n\t// a resource in different ways, such as by purpose, owner, or environment. For\n\t// example, you might want to tag a maintenance window to identify the type of\n\t// tasks it will run, the types of targets, and the environment it will run in. In\n\t// this case, you could specify the following key-value pairs:\n\t//   - Key=TaskType,Value=AgentUpdate\n\t//   - Key=OS,Value=Windows\n\t//   - Key=Environment,Value=Production\n\t// To add tags to an existing maintenance window, use the AddTagsToResource\n\t// operation.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateMaintenanceWindowOutput struct {\n\n\t// The ID of the created maintenance window.\n\tWindowId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addIdempotencyToken_opCreateMaintenanceWindowMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype idempotencyToken_initializeOpCreateMaintenanceWindow struct {\n\ttokenProvider IdempotencyTokenProvider\n}\n\nfunc (*idempotencyToken_initializeOpCreateMaintenanceWindow) ID() string {\n\treturn \"OperationIdempotencyTokenAutoFill\"\n}\n\nfunc (m *idempotencyToken_initializeOpCreateMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.tokenProvider == nil {\n\t\treturn next.HandleInitialize(ctx, in)\n\t}\n\n\tinput, ok := in.Parameters.(*CreateMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expected middleware input to be of type *CreateMaintenanceWindowInput \")\n\t}\n\n\tif input.ClientToken == nil {\n\t\tt, err := m.tokenProvider.GetIdempotencyToken()\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\t\tinput.ClientToken = &t\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\nfunc addIdempotencyToken_opCreateMaintenanceWindowMiddleware(stack *middleware.Stack, cfg Options) error {\n\treturn stack.Initialize.Add(&idempotencyToken_initializeOpCreateMaintenanceWindow{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)\n}\n\nfunc newServiceMetadataMiddleware_opCreateMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Creates a new OpsItem. You must have permission in Identity and Access\n// Management (IAM) to create a new OpsItem. For more information, see Set up\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html)\n// in the Amazon Web Services Systems Manager User Guide. Operations engineers and\n// IT professionals use Amazon Web Services Systems Manager OpsCenter to view,\n// investigate, and remediate operational issues impacting the performance and\n// health of their Amazon Web Services resources. For more information, see Amazon\n// Web Services Systems Manager OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) CreateOpsItem(ctx context.Context, params *CreateOpsItemInput, optFns ...func(*Options)) (*CreateOpsItemOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateOpsItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateOpsItem\", params, optFns, c.addOperationCreateOpsItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateOpsItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateOpsItemInput struct {\n\n\t// User-defined text that contains information about the OpsItem, in Markdown\n\t// format. Provide enough information so that users viewing this OpsItem for the\n\t// first time understand the issue.\n\t//\n\t// This member is required.\n\tDescription *string\n\n\t// The origin of the OpsItem, such as Amazon EC2 or Systems Manager. The source\n\t// name can't contain the following strings: aws , amazon , and amzn .\n\t//\n\t// This member is required.\n\tSource *string\n\n\t// A short heading that describes the nature of the OpsItem and the impacted\n\t// resource.\n\t//\n\t// This member is required.\n\tTitle *string\n\n\t// The target Amazon Web Services account where you want to create an OpsItem. To\n\t// make this call, your account must be configured to work with OpsItems across\n\t// accounts. For more information, see Set up OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tAccountId *string\n\n\t// The time a runbook workflow ended. Currently reported only for the OpsItem type\n\t// /aws/changerequest .\n\tActualEndTime *time.Time\n\n\t// The time a runbook workflow started. Currently reported only for the OpsItem\n\t// type /aws/changerequest .\n\tActualStartTime *time.Time\n\n\t// Specify a category to assign to an OpsItem.\n\tCategory *string\n\n\t// The Amazon Resource Name (ARN) of an SNS topic where notifications are sent\n\t// when this OpsItem is edited or changed.\n\tNotifications []types.OpsItemNotification\n\n\t// Operational data is custom data that provides useful reference details about\n\t// the OpsItem. For example, you can specify log files, error strings, license\n\t// keys, troubleshooting tips, or other relevant data. You enter operational data\n\t// as key-value pairs. The key has a maximum length of 128 characters. The value\n\t// has a maximum size of 20 KB. Operational data keys can't begin with the\n\t// following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , /ssm . You can\n\t// choose to make the data searchable by other users in the account or you can\n\t// restrict search access. Searchable data means that all users with access to the\n\t// OpsItem Overview page (as provided by the DescribeOpsItems API operation) can\n\t// view and search on the specified data. Operational data that isn't searchable is\n\t// only viewable by users who have access to the OpsItem (as provided by the\n\t// GetOpsItem API operation). Use the /aws/resources key in OperationalData to\n\t// specify a related resource in the request. Use the /aws/automations key in\n\t// OperationalData to associate an Automation runbook with the OpsItem. To view\n\t// Amazon Web Services CLI example commands that use these keys, see Creating\n\t// OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tOperationalData map[string]types.OpsItemDataValue\n\n\t// The type of OpsItem to create. Systems Manager supports the following types of\n\t// OpsItems:\n\t//   - /aws/issue This type of OpsItem is used for default OpsItems created by\n\t//   OpsCenter.\n\t//   - /aws/changerequest This type of OpsItem is used by Change Manager for\n\t//   reviewing and approving or rejecting change requests.\n\t//   - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and\n\t//   reporting on duplicate OpsItems.\n\tOpsItemType *string\n\n\t// The time specified in a change request for a runbook workflow to end. Currently\n\t// supported only for the OpsItem type /aws/changerequest .\n\tPlannedEndTime *time.Time\n\n\t// The time specified in a change request for a runbook workflow to start.\n\t// Currently supported only for the OpsItem type /aws/changerequest .\n\tPlannedStartTime *time.Time\n\n\t// The importance of this OpsItem in relation to other OpsItems in the system.\n\tPriority *int32\n\n\t// One or more OpsItems that share something in common with the current OpsItems.\n\t// For example, related OpsItems can include OpsItems with similar error messages,\n\t// impacted resources, or statuses for the impacted resource.\n\tRelatedOpsItems []types.RelatedOpsItem\n\n\t// Specify a severity to assign to an OpsItem.\n\tSeverity *string\n\n\t// Optional metadata that you assign to a resource. Tags use a key-value pair. For\n\t// example: Key=Department,Value=Finance To add tags to a new OpsItem, a user must\n\t// have IAM permissions for both the ssm:CreateOpsItems operation and the\n\t// ssm:AddTagsToResource operation. To add tags to an existing OpsItem, use the\n\t// AddTagsToResource operation.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateOpsItemOutput struct {\n\n\t// The OpsItem Amazon Resource Name (ARN).\n\tOpsItemArn *string\n\n\t// The ID of the OpsItem.\n\tOpsItemId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateOpsItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateOpsItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateOpsItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateOpsItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// If you create a new application in Application Manager, Amazon Web Services\n// Systems Manager calls this API operation to specify information about the new\n// application, including the application type.\nfunc (c *Client) CreateOpsMetadata(ctx context.Context, params *CreateOpsMetadataInput, optFns ...func(*Options)) (*CreateOpsMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateOpsMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateOpsMetadata\", params, optFns, c.addOperationCreateOpsMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateOpsMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateOpsMetadataInput struct {\n\n\t// A resource ID for a new Application Manager application.\n\t//\n\t// This member is required.\n\tResourceId *string\n\n\t// Metadata for a new Application Manager application.\n\tMetadata map[string]types.MetadataValue\n\n\t// Optional metadata that you assign to a resource. You can specify a maximum of\n\t// five tags for an OpsMetadata object. Tags enable you to categorize a resource in\n\t// different ways, such as by purpose, owner, or environment. For example, you\n\t// might want to tag an OpsMetadata object to identify an environment or target\n\t// Amazon Web Services Region. In this case, you could specify the following\n\t// key-value pairs:\n\t//   - Key=Environment,Value=Production\n\t//   - Key=Region,Value=us-east-2\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateOpsMetadataOutput struct {\n\n\t// The Amazon Resource Name (ARN) of the OpsMetadata Object or blob created by the\n\t// call.\n\tOpsMetadataArn *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateOpsMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateOpsMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateOpsMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreatePatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates a patch baseline. For information about valid key-value pairs in\n// PatchFilters for each supported operating system type, see PatchFilter .\nfunc (c *Client) CreatePatchBaseline(ctx context.Context, params *CreatePatchBaselineInput, optFns ...func(*Options)) (*CreatePatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &CreatePatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreatePatchBaseline\", params, optFns, c.addOperationCreatePatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreatePatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreatePatchBaselineInput struct {\n\n\t// The name of the patch baseline.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// A set of rules used to include patches in the baseline.\n\tApprovalRules *types.PatchRuleGroup\n\n\t// A list of explicitly approved patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tApprovedPatches []string\n\n\t// Defines the compliance level for approved patches. When an approved patch is\n\t// reported as missing, this value describes the severity of the compliance\n\t// violation. The default value is UNSPECIFIED .\n\tApprovedPatchesComplianceLevel types.PatchComplianceLevel\n\n\t// Indicates whether the list of approved patches includes non-security updates\n\t// that should be applied to the managed nodes. The default value is false .\n\t// Applies to Linux managed nodes only.\n\tApprovedPatchesEnableNonSecurity *bool\n\n\t// User-provided idempotency token.\n\tClientToken *string\n\n\t// A description of the patch baseline.\n\tDescription *string\n\n\t// A set of global filters used to include patches in the baseline.\n\tGlobalFilters *types.PatchFilterGroup\n\n\t// Defines the operating system the patch baseline applies to. The default value\n\t// is WINDOWS .\n\tOperatingSystem types.OperatingSystem\n\n\t// A list of explicitly rejected patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tRejectedPatches []string\n\n\t// The action for Patch Manager to take on patches included in the RejectedPackages\n\t// list.\n\t//   - ALLOW_AS_DEPENDENCY : A package in the Rejected patches list is installed\n\t//   only if it is a dependency of another package. It is considered compliant with\n\t//   the patch baseline, and its status is reported as InstalledOther . This is the\n\t//   default action if no option is specified.\n\t//   - BLOCK : Packages in the RejectedPatches list, and packages that include them\n\t//   as dependencies, aren't installed under any circumstances. If a package was\n\t//   installed before it was added to the Rejected patches list, it is considered\n\t//   non-compliant with the patch baseline, and its status is reported as\n\t//   InstalledRejected .\n\tRejectedPatchesAction types.PatchAction\n\n\t// Information about the patches to use to update the managed nodes, including\n\t// target operating systems and source repositories. Applies to Linux managed nodes\n\t// only.\n\tSources []types.PatchSource\n\n\t// Optional metadata that you assign to a resource. Tags enable you to categorize\n\t// a resource in different ways, such as by purpose, owner, or environment. For\n\t// example, you might want to tag a patch baseline to identify the severity level\n\t// of patches it specifies and the operating system family it applies to. In this\n\t// case, you could specify the following key-value pairs:\n\t//   - Key=PatchSeverity,Value=Critical\n\t//   - Key=OS,Value=Windows\n\t// To add tags to an existing patch baseline, use the AddTagsToResource operation.\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreatePatchBaselineOutput struct {\n\n\t// The ID of the created patch baseline.\n\tBaselineId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreatePatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addIdempotencyToken_opCreatePatchBaselineMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreatePatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype idempotencyToken_initializeOpCreatePatchBaseline struct {\n\ttokenProvider IdempotencyTokenProvider\n}\n\nfunc (*idempotencyToken_initializeOpCreatePatchBaseline) ID() string {\n\treturn \"OperationIdempotencyTokenAutoFill\"\n}\n\nfunc (m *idempotencyToken_initializeOpCreatePatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.tokenProvider == nil {\n\t\treturn next.HandleInitialize(ctx, in)\n\t}\n\n\tinput, ok := in.Parameters.(*CreatePatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expected middleware input to be of type *CreatePatchBaselineInput \")\n\t}\n\n\tif input.ClientToken == nil {\n\t\tt, err := m.tokenProvider.GetIdempotencyToken()\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\t\tinput.ClientToken = &t\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\nfunc addIdempotencyToken_opCreatePatchBaselineMiddleware(stack *middleware.Stack, cfg Options) error {\n\treturn stack.Initialize.Add(&idempotencyToken_initializeOpCreatePatchBaseline{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)\n}\n\nfunc newServiceMetadataMiddleware_opCreatePatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreatePatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateResourceDataSync.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// A resource data sync helps you view data from multiple sources in a single\n// location. Amazon Web Services Systems Manager offers two types of resource data\n// sync: SyncToDestination and SyncFromSource . You can configure Systems Manager\n// Inventory to use the SyncToDestination type to synchronize Inventory data from\n// multiple Amazon Web Services Regions to a single Amazon Simple Storage Service\n// (Amazon S3) bucket. For more information, see Configuring resource data sync\n// for Inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html)\n// in the Amazon Web Services Systems Manager User Guide. You can configure Systems\n// Manager Explorer to use the SyncFromSource type to synchronize operational work\n// items (OpsItems) and operational data (OpsData) from multiple Amazon Web\n// Services Regions to a single Amazon S3 bucket. This type can synchronize\n// OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web\n// Services Regions or EntireOrganization by using Organizations. For more\n// information, see Setting up Systems Manager Explorer to display data from\n// multiple accounts and Regions (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html)\n// in the Amazon Web Services Systems Manager User Guide. A resource data sync is\n// an asynchronous operation that returns immediately. After a successful initial\n// sync is completed, the system continuously syncs data. To check the status of a\n// sync, use the ListResourceDataSync . By default, data isn't encrypted in Amazon\n// S3. We strongly recommend that you enable encryption in Amazon S3 to ensure\n// secure data storage. We also recommend that you secure access to the Amazon S3\n// bucket by creating a restrictive bucket policy.\nfunc (c *Client) CreateResourceDataSync(ctx context.Context, params *CreateResourceDataSyncInput, optFns ...func(*Options)) (*CreateResourceDataSyncOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateResourceDataSyncInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateResourceDataSync\", params, optFns, c.addOperationCreateResourceDataSyncMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateResourceDataSyncOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateResourceDataSyncInput struct {\n\n\t// A name for the configuration.\n\t//\n\t// This member is required.\n\tSyncName *string\n\n\t// Amazon S3 configuration details for the sync. This parameter is required if the\n\t// SyncType value is SyncToDestination.\n\tS3Destination *types.ResourceDataSyncS3Destination\n\n\t// Specify information about the data sources to synchronize. This parameter is\n\t// required if the SyncType value is SyncFromSource.\n\tSyncSource *types.ResourceDataSyncSource\n\n\t// Specify SyncToDestination to create a resource data sync that synchronizes data\n\t// to an S3 bucket for Inventory. If you specify SyncToDestination , you must\n\t// provide a value for S3Destination . Specify SyncFromSource to synchronize data\n\t// from a single account and multiple Regions, or multiple Amazon Web Services\n\t// accounts and Amazon Web Services Regions, as listed in Organizations for\n\t// Explorer. If you specify SyncFromSource , you must provide a value for\n\t// SyncSource . The default value is SyncToDestination .\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateResourceDataSyncOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateResourceDataSync\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateResourceDataSyncValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourceDataSync(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateResourceDataSync\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteActivation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes an activation. You aren't required to delete an activation. If you\n// delete an activation, you can no longer use it to register additional managed\n// nodes. Deleting an activation doesn't de-register managed nodes. You must\n// manually de-register managed nodes.\nfunc (c *Client) DeleteActivation(ctx context.Context, params *DeleteActivationInput, optFns ...func(*Options)) (*DeleteActivationOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteActivationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteActivation\", params, optFns, c.addOperationDeleteActivationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteActivationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteActivationInput struct {\n\n\t// The ID of the activation that you want to delete.\n\t//\n\t// This member is required.\n\tActivationId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteActivationOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteActivation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteActivation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteActivation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteActivationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteActivation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteActivation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteActivation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteAssociation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Disassociates the specified Amazon Web Services Systems Manager document (SSM\n// document) from the specified managed node. If you created the association by\n// using the Targets parameter, then you must delete the association by using the\n// association ID. When you disassociate a document from a managed node, it doesn't\n// change the configuration of the node. To change the configuration state of a\n// managed node after you disassociate a document, you must create a new document\n// with the desired configuration and associate it with the node.\nfunc (c *Client) DeleteAssociation(ctx context.Context, params *DeleteAssociationInput, optFns ...func(*Options)) (*DeleteAssociationOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteAssociationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteAssociation\", params, optFns, c.addOperationDeleteAssociationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteAssociationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteAssociationInput struct {\n\n\t// The association ID that you want to delete.\n\tAssociationId *string\n\n\t// The managed node ID. InstanceId has been deprecated. To specify a managed node\n\t// ID for an association, use the Targets parameter. Requests that include the\n\t// parameter InstanceID with Systems Manager documents (SSM documents) that use\n\t// schema version 2.0 or later will fail. In addition, if you use the parameter\n\t// InstanceId , you can't use the parameters AssociationName , DocumentVersion ,\n\t// MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use\n\t// these parameters, you must use the Targets parameter.\n\tInstanceId *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteAssociationOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteAssociation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssociation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteAssociation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteAssociation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteDocument.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes the Amazon Web Services Systems Manager document (SSM document) and all\n// managed node associations to the document. Before you delete the document, we\n// recommend that you use DeleteAssociation to disassociate all managed nodes that\n// are associated with the document.\nfunc (c *Client) DeleteDocument(ctx context.Context, params *DeleteDocumentInput, optFns ...func(*Options)) (*DeleteDocumentOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteDocument\", params, optFns, c.addOperationDeleteDocumentMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteDocumentInput struct {\n\n\t// The name of the document.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The version of the document that you want to delete. If not provided, all\n\t// versions of the document are deleted.\n\tDocumentVersion *string\n\n\t// Some SSM document types require that you specify a Force flag before you can\n\t// delete the document. For example, you must specify a Force flag to delete a\n\t// document of type ApplicationConfigurationSchema . You can restrict access to the\n\t// Force flag in an Identity and Access Management (IAM) policy.\n\tForce bool\n\n\t// The version name of the document that you want to delete. If not provided, all\n\t// versions of the document are deleted.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteDocumentOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteDocument\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteDocumentValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDocument(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteDocument(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteDocument\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteInventory.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Delete a custom inventory type or the data associated with a custom Inventory\n// type. Deleting a custom inventory type is also referred to as deleting a custom\n// inventory schema.\nfunc (c *Client) DeleteInventory(ctx context.Context, params *DeleteInventoryInput, optFns ...func(*Options)) (*DeleteInventoryOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteInventoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteInventory\", params, optFns, c.addOperationDeleteInventoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteInventoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteInventoryInput struct {\n\n\t// The name of the custom inventory type for which you want to delete either all\n\t// previously collected data or the inventory type itself.\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\t// User-provided idempotency token.\n\tClientToken *string\n\n\t// Use this option to view a summary of the deletion request without deleting any\n\t// data or the data type. This option is useful when you only want to understand\n\t// what will be deleted. Once you validate that the data to be deleted is what you\n\t// intend to delete, you can run the same command without specifying the DryRun\n\t// option.\n\tDryRun bool\n\n\t// Use the SchemaDeleteOption to delete a custom inventory type (schema). If you\n\t// don't choose this option, the system only deletes existing inventory data\n\t// associated with the custom inventory type. Choose one of the following options:\n\t// DisableSchema: If you choose this option, the system ignores all inventory data\n\t// for the specified version, and any earlier versions. To enable this schema\n\t// again, you must call the PutInventory operation for a version greater than the\n\t// disabled version. DeleteSchema: This option deletes the specified custom type\n\t// from the Inventory service. You can recreate the schema later, if you want.\n\tSchemaDeleteOption types.InventorySchemaDeleteOption\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteInventoryOutput struct {\n\n\t// Every DeleteInventory operation is assigned a unique ID. This option returns a\n\t// unique ID. You can use this ID to query the status of a delete operation. This\n\t// option is useful for ensuring that a delete operation has completed before you\n\t// begin other operations.\n\tDeletionId *string\n\n\t// A summary of the delete operation. For more information about this summary, see\n\t// Deleting custom inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete-summary)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tDeletionSummary *types.InventoryDeletionSummary\n\n\t// The name of the inventory data type specified in the request.\n\tTypeName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteInventory\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addIdempotencyToken_opDeleteInventoryMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteInventoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInventory(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype idempotencyToken_initializeOpDeleteInventory struct {\n\ttokenProvider IdempotencyTokenProvider\n}\n\nfunc (*idempotencyToken_initializeOpDeleteInventory) ID() string {\n\treturn \"OperationIdempotencyTokenAutoFill\"\n}\n\nfunc (m *idempotencyToken_initializeOpDeleteInventory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.tokenProvider == nil {\n\t\treturn next.HandleInitialize(ctx, in)\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteInventoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expected middleware input to be of type *DeleteInventoryInput \")\n\t}\n\n\tif input.ClientToken == nil {\n\t\tt, err := m.tokenProvider.GetIdempotencyToken()\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\t\tinput.ClientToken = &t\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\nfunc addIdempotencyToken_opDeleteInventoryMiddleware(stack *middleware.Stack, cfg Options) error {\n\treturn stack.Initialize.Add(&idempotencyToken_initializeOpDeleteInventory{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)\n}\n\nfunc newServiceMetadataMiddleware_opDeleteInventory(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteInventory\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a maintenance window.\nfunc (c *Client) DeleteMaintenanceWindow(ctx context.Context, params *DeleteMaintenanceWindowInput, optFns ...func(*Options)) (*DeleteMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteMaintenanceWindow\", params, optFns, c.addOperationDeleteMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteMaintenanceWindowInput struct {\n\n\t// The ID of the maintenance window to delete.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteMaintenanceWindowOutput struct {\n\n\t// The ID of the deleted maintenance window.\n\tWindowId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Delete an OpsItem. You must have permission in Identity and Access Management\n// (IAM) to delete an OpsItem. Note the following important information about this\n// operation.\n//   - Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.\n//   - This operation uses an eventual consistency model, which means the system\n//     can take a few minutes to complete this operation. If you delete an OpsItem and\n//     immediately call, for example, GetOpsItem , the deleted OpsItem might still\n//     appear in the response.\n//   - This operation is idempotent. The system doesn't throw an exception if you\n//     repeatedly call this operation for the same OpsItem. If the first call is\n//     successful, all additional calls return the same successful response as the\n//     first call.\n//   - This operation doesn't support cross-account calls. A delegated\n//     administrator or management account can't delete OpsItems in other accounts,\n//     even if OpsCenter has been set up for cross-account administration. For more\n//     information about cross-account administration, see Setting up OpsCenter to\n//     centrally manage OpsItems across accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html)\n//     in the Systems Manager User Guide.\nfunc (c *Client) DeleteOpsItem(ctx context.Context, params *DeleteOpsItemInput, optFns ...func(*Options)) (*DeleteOpsItemOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteOpsItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteOpsItem\", params, optFns, c.addOperationDeleteOpsItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteOpsItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteOpsItemInput struct {\n\n\t// The ID of the OpsItem that you want to delete.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteOpsItemOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteOpsItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteOpsItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteOpsItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteOpsItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Delete OpsMetadata related to an application.\nfunc (c *Client) DeleteOpsMetadata(ctx context.Context, params *DeleteOpsMetadataInput, optFns ...func(*Options)) (*DeleteOpsMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteOpsMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteOpsMetadata\", params, optFns, c.addOperationDeleteOpsMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteOpsMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteOpsMetadataInput struct {\n\n\t// The Amazon Resource Name (ARN) of an OpsMetadata Object to delete.\n\t//\n\t// This member is required.\n\tOpsMetadataArn *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteOpsMetadataOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteOpsMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteOpsMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteOpsMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameter.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Delete a parameter from the system. After deleting a parameter, wait for at\n// least 30 seconds to create a parameter with the same name.\nfunc (c *Client) DeleteParameter(ctx context.Context, params *DeleteParameterInput, optFns ...func(*Options)) (*DeleteParameterOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteParameterInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteParameter\", params, optFns, c.addOperationDeleteParameterMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteParameterOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteParameterInput struct {\n\n\t// The name of the parameter to delete.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteParameterOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteParameter\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteParameterValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameter(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteParameter(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteParameter\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameters.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Delete a list of parameters. After deleting a parameter, wait for at least 30\n// seconds to create a parameter with the same name.\nfunc (c *Client) DeleteParameters(ctx context.Context, params *DeleteParametersInput, optFns ...func(*Options)) (*DeleteParametersOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteParametersInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteParameters\", params, optFns, c.addOperationDeleteParametersMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteParametersOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteParametersInput struct {\n\n\t// The names of the parameters to delete. After deleting a parameter, wait for at\n\t// least 30 seconds to create a parameter with the same name.\n\t//\n\t// This member is required.\n\tNames []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteParametersOutput struct {\n\n\t// The names of the deleted parameters.\n\tDeletedParameters []string\n\n\t// The names of parameters that weren't deleted because the parameters aren't\n\t// valid.\n\tInvalidParameters []string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteParameters\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteParametersValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameters(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteParameters(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteParameters\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeletePatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a patch baseline.\nfunc (c *Client) DeletePatchBaseline(ctx context.Context, params *DeletePatchBaselineInput, optFns ...func(*Options)) (*DeletePatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &DeletePatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeletePatchBaseline\", params, optFns, c.addOperationDeletePatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeletePatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeletePatchBaselineInput struct {\n\n\t// The ID of the patch baseline to delete.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeletePatchBaselineOutput struct {\n\n\t// The ID of the deleted patch baseline.\n\tBaselineId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeletePatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeletePatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeletePatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeletePatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourceDataSync.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a resource data sync configuration. After the configuration is deleted,\n// changes to data on managed nodes are no longer synced to or from the target.\n// Deleting a sync configuration doesn't delete data.\nfunc (c *Client) DeleteResourceDataSync(ctx context.Context, params *DeleteResourceDataSyncInput, optFns ...func(*Options)) (*DeleteResourceDataSyncOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteResourceDataSyncInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteResourceDataSync\", params, optFns, c.addOperationDeleteResourceDataSyncMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteResourceDataSyncOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteResourceDataSyncInput struct {\n\n\t// The name of the configuration to delete.\n\t//\n\t// This member is required.\n\tSyncName *string\n\n\t// Specify the type of resource data sync to delete.\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteResourceDataSyncOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteResourceDataSync\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteResourceDataSyncValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourceDataSync(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteResourceDataSync\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourcePolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes a Systems Manager resource policy. A resource policy helps you to\n// define the IAM entity (for example, an Amazon Web Services account) that can\n// manage your Systems Manager resources. Currently, OpsItemGroup is the only\n// resource that supports Systems Manager resource policies. The resource policy\n// for OpsItemGroup enables Amazon Web Services accounts to view and interact with\n// OpsCenter operational work items (OpsItems).\nfunc (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &DeleteResourcePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeleteResourcePolicy\", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeleteResourcePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeleteResourcePolicyInput struct {\n\n\t// ID of the current policy version. The hash helps to prevent multiple calls from\n\t// attempting to overwrite a policy.\n\t//\n\t// This member is required.\n\tPolicyHash *string\n\n\t// The policy ID.\n\t//\n\t// This member is required.\n\tPolicyId *string\n\n\t// Amazon Resource Name (ARN) of the resource to which the policies are attached.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeleteResourcePolicyOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeleteResourcePolicy\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeleteResourcePolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterManagedInstance.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes the server or virtual machine from the list of registered servers. You\n// can reregister the node again at any time. If you don't plan to use Run Command\n// on the server, we suggest uninstalling SSM Agent first.\nfunc (c *Client) DeregisterManagedInstance(ctx context.Context, params *DeregisterManagedInstanceInput, optFns ...func(*Options)) (*DeregisterManagedInstanceOutput, error) {\n\tif params == nil {\n\t\tparams = &DeregisterManagedInstanceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeregisterManagedInstance\", params, optFns, c.addOperationDeregisterManagedInstanceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeregisterManagedInstanceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeregisterManagedInstanceInput struct {\n\n\t// The ID assigned to the managed node when you registered it using the activation\n\t// process.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeregisterManagedInstanceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterManagedInstance{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterManagedInstance{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeregisterManagedInstance\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeregisterManagedInstanceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterManagedInstance(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeregisterManagedInstance(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeregisterManagedInstance\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterPatchBaselineForPatchGroup.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes a patch group from a patch baseline.\nfunc (c *Client) DeregisterPatchBaselineForPatchGroup(ctx context.Context, params *DeregisterPatchBaselineForPatchGroupInput, optFns ...func(*Options)) (*DeregisterPatchBaselineForPatchGroupOutput, error) {\n\tif params == nil {\n\t\tparams = &DeregisterPatchBaselineForPatchGroupInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeregisterPatchBaselineForPatchGroup\", params, optFns, c.addOperationDeregisterPatchBaselineForPatchGroupMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeregisterPatchBaselineForPatchGroupOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeregisterPatchBaselineForPatchGroupInput struct {\n\n\t// The ID of the patch baseline to deregister the patch group from.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\t// The name of the patch group that should be deregistered from the patch baseline.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeregisterPatchBaselineForPatchGroupOutput struct {\n\n\t// The ID of the patch baseline the patch group was deregistered from.\n\tBaselineId *string\n\n\t// The name of the patch group deregistered from the patch baseline.\n\tPatchGroup *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeregisterPatchBaselineForPatchGroup\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeregisterPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeregisterPatchBaselineForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeregisterPatchBaselineForPatchGroup\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTargetFromMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes a target from a maintenance window.\nfunc (c *Client) DeregisterTargetFromMaintenanceWindow(ctx context.Context, params *DeregisterTargetFromMaintenanceWindowInput, optFns ...func(*Options)) (*DeregisterTargetFromMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &DeregisterTargetFromMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeregisterTargetFromMaintenanceWindow\", params, optFns, c.addOperationDeregisterTargetFromMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeregisterTargetFromMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeregisterTargetFromMaintenanceWindowInput struct {\n\n\t// The ID of the maintenance window the target should be removed from.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The ID of the target definition to remove.\n\t//\n\t// This member is required.\n\tWindowTargetId *string\n\n\t// The system checks if the target is being referenced by a task. If the target is\n\t// being referenced, the system returns an error and doesn't deregister the target\n\t// from the maintenance window.\n\tSafe *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeregisterTargetFromMaintenanceWindowOutput struct {\n\n\t// The ID of the maintenance window the target was removed from.\n\tWindowId *string\n\n\t// The ID of the removed target definition.\n\tWindowTargetId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeregisterTargetFromMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeregisterTargetFromMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTargetFromMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeregisterTargetFromMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeregisterTargetFromMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTaskFromMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes a task from a maintenance window.\nfunc (c *Client) DeregisterTaskFromMaintenanceWindow(ctx context.Context, params *DeregisterTaskFromMaintenanceWindowInput, optFns ...func(*Options)) (*DeregisterTaskFromMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &DeregisterTaskFromMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DeregisterTaskFromMaintenanceWindow\", params, optFns, c.addOperationDeregisterTaskFromMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DeregisterTaskFromMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DeregisterTaskFromMaintenanceWindowInput struct {\n\n\t// The ID of the maintenance window the task should be removed from.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The ID of the task to remove from the maintenance window.\n\t//\n\t// This member is required.\n\tWindowTaskId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DeregisterTaskFromMaintenanceWindowOutput struct {\n\n\t// The ID of the maintenance window the task was removed from.\n\tWindowId *string\n\n\t// The ID of the task removed from the maintenance window.\n\tWindowTaskId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterTaskFromMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DeregisterTaskFromMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDeregisterTaskFromMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTaskFromMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDeregisterTaskFromMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DeregisterTaskFromMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeActivations.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes details about the activation, such as the date and time the\n// activation was created, its expiration date, the Identity and Access Management\n// (IAM) role assigned to the managed nodes in the activation, and the number of\n// nodes registered by using this activation.\nfunc (c *Client) DescribeActivations(ctx context.Context, params *DescribeActivationsInput, optFns ...func(*Options)) (*DescribeActivationsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeActivationsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeActivations\", params, optFns, c.addOperationDescribeActivationsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeActivationsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeActivationsInput struct {\n\n\t// A filter to view information about your activations.\n\tFilters []types.DescribeActivationsFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeActivationsOutput struct {\n\n\t// A list of activations for your Amazon Web Services account.\n\tActivationList []types.Activation\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeActivations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeActivations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeActivations\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeActivations(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeActivationsAPIClient is a client that implements the\n// DescribeActivations operation.\ntype DescribeActivationsAPIClient interface {\n\tDescribeActivations(context.Context, *DescribeActivationsInput, ...func(*Options)) (*DescribeActivationsOutput, error)\n}\n\nvar _ DescribeActivationsAPIClient = (*Client)(nil)\n\n// DescribeActivationsPaginatorOptions is the paginator options for\n// DescribeActivations\ntype DescribeActivationsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeActivationsPaginator is a paginator for DescribeActivations\ntype DescribeActivationsPaginator struct {\n\toptions   DescribeActivationsPaginatorOptions\n\tclient    DescribeActivationsAPIClient\n\tparams    *DescribeActivationsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator\nfunc NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeActivationsInput{}\n\t}\n\n\toptions := DescribeActivationsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeActivationsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeActivationsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeActivations page.\nfunc (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActivationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeActivations(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeActivations(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeActivations\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes the association for the specified target or managed node. If you\n// created the association by using the Targets parameter, then you must retrieve\n// the association by using the association ID.\nfunc (c *Client) DescribeAssociation(ctx context.Context, params *DescribeAssociationInput, optFns ...func(*Options)) (*DescribeAssociationOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAssociationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAssociation\", params, optFns, c.addOperationDescribeAssociationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAssociationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAssociationInput struct {\n\n\t// The association ID for which you want information.\n\tAssociationId *string\n\n\t// Specify the association version to retrieve. To view the latest version, either\n\t// specify $LATEST for this parameter, or omit this parameter. To view a list of\n\t// all associations for a managed node, use ListAssociations . To get a list of\n\t// versions for a specific association, use ListAssociationVersions .\n\tAssociationVersion *string\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAssociationOutput struct {\n\n\t// Information about the association.\n\tAssociationDescription *types.AssociationDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAssociation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAssociation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAssociation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutionTargets.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Views information about a specific execution of a specific association.\nfunc (c *Client) DescribeAssociationExecutionTargets(ctx context.Context, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAssociationExecutionTargetsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAssociationExecutionTargets\", params, optFns, c.addOperationDescribeAssociationExecutionTargetsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAssociationExecutionTargetsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAssociationExecutionTargetsInput struct {\n\n\t// The association ID that includes the execution for which you want to view\n\t// details.\n\t//\n\t// This member is required.\n\tAssociationId *string\n\n\t// The execution ID for which you want to view details.\n\t//\n\t// This member is required.\n\tExecutionId *string\n\n\t// Filters for the request. You can specify the following filters and values.\n\t// Status (EQUAL) ResourceId (EQUAL) ResourceType (EQUAL)\n\tFilters []types.AssociationExecutionTargetsFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAssociationExecutionTargetsOutput struct {\n\n\t// Information about the execution.\n\tAssociationExecutionTargets []types.AssociationExecutionTarget\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutionTargets{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociationExecutionTargets{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAssociationExecutionTargets\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeAssociationExecutionTargetsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeAssociationExecutionTargetsAPIClient is a client that implements the\n// DescribeAssociationExecutionTargets operation.\ntype DescribeAssociationExecutionTargetsAPIClient interface {\n\tDescribeAssociationExecutionTargets(context.Context, *DescribeAssociationExecutionTargetsInput, ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error)\n}\n\nvar _ DescribeAssociationExecutionTargetsAPIClient = (*Client)(nil)\n\n// DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options\n// for DescribeAssociationExecutionTargets\ntype DescribeAssociationExecutionTargetsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeAssociationExecutionTargetsPaginator is a paginator for\n// DescribeAssociationExecutionTargets\ntype DescribeAssociationExecutionTargetsPaginator struct {\n\toptions   DescribeAssociationExecutionTargetsPaginatorOptions\n\tclient    DescribeAssociationExecutionTargetsAPIClient\n\tparams    *DescribeAssociationExecutionTargetsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeAssociationExecutionTargetsPaginator returns a new\n// DescribeAssociationExecutionTargetsPaginator\nfunc NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeAssociationExecutionTargetsInput{}\n\t}\n\n\toptions := DescribeAssociationExecutionTargetsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeAssociationExecutionTargetsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeAssociationExecutionTargetsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeAssociationExecutionTargets page.\nfunc (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeAssociationExecutionTargets(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAssociationExecutionTargets\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Views all executions for a specific association ID.\nfunc (c *Client) DescribeAssociationExecutions(ctx context.Context, params *DescribeAssociationExecutionsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAssociationExecutionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAssociationExecutions\", params, optFns, c.addOperationDescribeAssociationExecutionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAssociationExecutionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAssociationExecutionsInput struct {\n\n\t// The association ID for which you want to view execution history details.\n\t//\n\t// This member is required.\n\tAssociationId *string\n\n\t// Filters for the request. You can specify the following filters and values.\n\t// ExecutionId (EQUAL) Status (EQUAL) CreatedTime (EQUAL, GREATER_THAN, LESS_THAN)\n\tFilters []types.AssociationExecutionFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAssociationExecutionsOutput struct {\n\n\t// A list of the executions for the specified association ID.\n\tAssociationExecutions []types.AssociationExecution\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociationExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAssociationExecutions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeAssociationExecutionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeAssociationExecutionsAPIClient is a client that implements the\n// DescribeAssociationExecutions operation.\ntype DescribeAssociationExecutionsAPIClient interface {\n\tDescribeAssociationExecutions(context.Context, *DescribeAssociationExecutionsInput, ...func(*Options)) (*DescribeAssociationExecutionsOutput, error)\n}\n\nvar _ DescribeAssociationExecutionsAPIClient = (*Client)(nil)\n\n// DescribeAssociationExecutionsPaginatorOptions is the paginator options for\n// DescribeAssociationExecutions\ntype DescribeAssociationExecutionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeAssociationExecutionsPaginator is a paginator for\n// DescribeAssociationExecutions\ntype DescribeAssociationExecutionsPaginator struct {\n\toptions   DescribeAssociationExecutionsPaginatorOptions\n\tclient    DescribeAssociationExecutionsAPIClient\n\tparams    *DescribeAssociationExecutionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeAssociationExecutionsPaginator returns a new\n// DescribeAssociationExecutionsPaginator\nfunc NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeAssociationExecutionsInput{}\n\t}\n\n\toptions := DescribeAssociationExecutionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeAssociationExecutionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeAssociationExecutionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeAssociationExecutions page.\nfunc (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeAssociationExecutions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAssociationExecutions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAssociationExecutions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationExecutions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Provides details about all active and terminated Automation executions.\nfunc (c *Client) DescribeAutomationExecutions(ctx context.Context, params *DescribeAutomationExecutionsInput, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAutomationExecutionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAutomationExecutions\", params, optFns, c.addOperationDescribeAutomationExecutionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAutomationExecutionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAutomationExecutionsInput struct {\n\n\t// Filters used to limit the scope of executions that are requested.\n\tFilters []types.AutomationExecutionFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAutomationExecutionsOutput struct {\n\n\t// The list of details about each automation execution which has occurred which\n\t// matches the filter specification, if any.\n\tAutomationExecutionMetadataList []types.AutomationExecutionMetadata\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAutomationExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAutomationExecutions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeAutomationExecutionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationExecutions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeAutomationExecutionsAPIClient is a client that implements the\n// DescribeAutomationExecutions operation.\ntype DescribeAutomationExecutionsAPIClient interface {\n\tDescribeAutomationExecutions(context.Context, *DescribeAutomationExecutionsInput, ...func(*Options)) (*DescribeAutomationExecutionsOutput, error)\n}\n\nvar _ DescribeAutomationExecutionsAPIClient = (*Client)(nil)\n\n// DescribeAutomationExecutionsPaginatorOptions is the paginator options for\n// DescribeAutomationExecutions\ntype DescribeAutomationExecutionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeAutomationExecutionsPaginator is a paginator for\n// DescribeAutomationExecutions\ntype DescribeAutomationExecutionsPaginator struct {\n\toptions   DescribeAutomationExecutionsPaginatorOptions\n\tclient    DescribeAutomationExecutionsAPIClient\n\tparams    *DescribeAutomationExecutionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeAutomationExecutionsPaginator returns a new\n// DescribeAutomationExecutionsPaginator\nfunc NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeAutomationExecutionsInput{}\n\t}\n\n\toptions := DescribeAutomationExecutionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeAutomationExecutionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeAutomationExecutionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeAutomationExecutions page.\nfunc (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeAutomationExecutions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAutomationExecutions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAutomationExecutions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationStepExecutions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Information about all active and terminated step executions in an Automation\n// workflow.\nfunc (c *Client) DescribeAutomationStepExecutions(ctx context.Context, params *DescribeAutomationStepExecutionsInput, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAutomationStepExecutionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAutomationStepExecutions\", params, optFns, c.addOperationDescribeAutomationStepExecutionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAutomationStepExecutionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAutomationStepExecutionsInput struct {\n\n\t// The Automation execution ID for which you want step execution descriptions.\n\t//\n\t// This member is required.\n\tAutomationExecutionId *string\n\n\t// One or more filters to limit the number of step executions returned by the\n\t// request.\n\tFilters []types.StepExecutionFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// Indicates whether to list step executions in reverse order by start time. The\n\t// default value is 'false'.\n\tReverseOrder *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAutomationStepExecutionsOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// A list of details about the current state of all steps that make up an\n\t// execution.\n\tStepExecutions []types.StepExecution\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationStepExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAutomationStepExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAutomationStepExecutions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeAutomationStepExecutionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeAutomationStepExecutionsAPIClient is a client that implements the\n// DescribeAutomationStepExecutions operation.\ntype DescribeAutomationStepExecutionsAPIClient interface {\n\tDescribeAutomationStepExecutions(context.Context, *DescribeAutomationStepExecutionsInput, ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error)\n}\n\nvar _ DescribeAutomationStepExecutionsAPIClient = (*Client)(nil)\n\n// DescribeAutomationStepExecutionsPaginatorOptions is the paginator options for\n// DescribeAutomationStepExecutions\ntype DescribeAutomationStepExecutionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeAutomationStepExecutionsPaginator is a paginator for\n// DescribeAutomationStepExecutions\ntype DescribeAutomationStepExecutionsPaginator struct {\n\toptions   DescribeAutomationStepExecutionsPaginatorOptions\n\tclient    DescribeAutomationStepExecutionsAPIClient\n\tparams    *DescribeAutomationStepExecutionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeAutomationStepExecutionsPaginator returns a new\n// DescribeAutomationStepExecutionsPaginator\nfunc NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeAutomationStepExecutionsInput{}\n\t}\n\n\toptions := DescribeAutomationStepExecutionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeAutomationStepExecutionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeAutomationStepExecutionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeAutomationStepExecutions page.\nfunc (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeAutomationStepExecutions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAutomationStepExecutions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAvailablePatches.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all patches eligible to be included in a patch baseline.\nfunc (c *Client) DescribeAvailablePatches(ctx context.Context, params *DescribeAvailablePatchesInput, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeAvailablePatchesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeAvailablePatches\", params, optFns, c.addOperationDescribeAvailablePatchesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeAvailablePatchesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeAvailablePatchesInput struct {\n\n\t// Each element in the array is a structure containing a key-value pair. Windows\n\t// Server Supported keys for Windows Server managed node patches include the\n\t// following:\n\t//   - PATCH_SET Sample values: OS | APPLICATION\n\t//   - PRODUCT Sample values: WindowsServer2012 | Office 2010 |\n\t//   MicrosoftDefenderAntivirus\n\t//   - PRODUCT_FAMILY Sample values: Windows | Office\n\t//   - MSRC_SEVERITY Sample values: ServicePacks | Important | Moderate\n\t//   - CLASSIFICATION Sample values: ServicePacks | SecurityUpdates |\n\t//   DefinitionUpdates\n\t//   - PATCH_ID Sample values: KB123456 | KB4516046\n\t// Linux When specifying filters for Linux patches, you must specify a key-pair\n\t// for PRODUCT . For example, using the Command Line Interface (CLI), the following\n\t// command fails: aws ssm describe-available-patches --filters\n\t// Key=CVE_ID,Values=CVE-2018-3615 However, the following command succeeds: aws\n\t// ssm describe-available-patches --filters Key=PRODUCT,Values=AmazonLinux2018.03\n\t// Key=CVE_ID,Values=CVE-2018-3615 Supported keys for Linux managed node patches\n\t// include the following:\n\t//   - PRODUCT Sample values: AmazonLinux2018.03 | AmazonLinux2.0\n\t//   - NAME Sample values: kernel-headers | samba-python | php\n\t//   - SEVERITY Sample values: Critical | Important | Medium | Low\n\t//   - EPOCH Sample values: 0 | 1\n\t//   - VERSION Sample values: 78.6.1 | 4.10.16\n\t//   - RELEASE Sample values: 9.56.amzn1 | 1.amzn2\n\t//   - ARCH Sample values: i686 | x86_64\n\t//   - REPOSITORY Sample values: Core | Updates\n\t//   - ADVISORY_ID Sample values: ALAS-2018-1058 | ALAS2-2021-1594\n\t//   - CVE_ID Sample values: CVE-2018-3615 | CVE-2020-1472\n\t//   - BUGZILLA_ID Sample values: 1463241\n\tFilters []types.PatchOrchestratorFilter\n\n\t// The maximum number of patches to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeAvailablePatchesOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// An array of patches. Each entry in the array is a patch structure.\n\tPatches []types.Patch\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAvailablePatches{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAvailablePatches{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeAvailablePatches\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAvailablePatches(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeAvailablePatchesAPIClient is a client that implements the\n// DescribeAvailablePatches operation.\ntype DescribeAvailablePatchesAPIClient interface {\n\tDescribeAvailablePatches(context.Context, *DescribeAvailablePatchesInput, ...func(*Options)) (*DescribeAvailablePatchesOutput, error)\n}\n\nvar _ DescribeAvailablePatchesAPIClient = (*Client)(nil)\n\n// DescribeAvailablePatchesPaginatorOptions is the paginator options for\n// DescribeAvailablePatches\ntype DescribeAvailablePatchesPaginatorOptions struct {\n\t// The maximum number of patches to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeAvailablePatchesPaginator is a paginator for DescribeAvailablePatches\ntype DescribeAvailablePatchesPaginator struct {\n\toptions   DescribeAvailablePatchesPaginatorOptions\n\tclient    DescribeAvailablePatchesAPIClient\n\tparams    *DescribeAvailablePatchesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeAvailablePatchesPaginator returns a new\n// DescribeAvailablePatchesPaginator\nfunc NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeAvailablePatchesInput{}\n\t}\n\n\toptions := DescribeAvailablePatchesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeAvailablePatchesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeAvailablePatchesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeAvailablePatches page.\nfunc (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeAvailablePatches(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeAvailablePatches(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeAvailablePatches\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocument.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes the specified Amazon Web Services Systems Manager document (SSM\n// document).\nfunc (c *Client) DescribeDocument(ctx context.Context, params *DescribeDocumentInput, optFns ...func(*Options)) (*DescribeDocumentOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeDocument\", params, optFns, c.addOperationDescribeDocumentMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeDocumentInput struct {\n\n\t// The name of the SSM document.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The document version for which you want information. Can be a specific version\n\t// or the default version.\n\tDocumentVersion *string\n\n\t// An optional field specifying the version of the artifact associated with the\n\t// document. For example, \"Release 12, Update 6\". This value is unique across all\n\t// versions of a document, and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeDocumentOutput struct {\n\n\t// Information about the SSM document.\n\tDocument *types.DocumentDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeDocument\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeDocumentValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocument(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeDocument(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeDocument\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocumentPermission.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes the permissions for a Amazon Web Services Systems Manager document\n// (SSM document). If you created the document, you are the owner. If a document is\n// shared, it can either be shared privately (by specifying a user's Amazon Web\n// Services account ID) or publicly (All).\nfunc (c *Client) DescribeDocumentPermission(ctx context.Context, params *DescribeDocumentPermissionInput, optFns ...func(*Options)) (*DescribeDocumentPermissionOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeDocumentPermissionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeDocumentPermission\", params, optFns, c.addOperationDescribeDocumentPermissionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeDocumentPermissionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeDocumentPermissionInput struct {\n\n\t// The name of the document for which you are the owner.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The permission type for the document. The permission type can be Share.\n\t//\n\t// This member is required.\n\tPermissionType types.DocumentPermissionType\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeDocumentPermissionOutput struct {\n\n\t// The account IDs that have permission to use this document. The ID can be either\n\t// an Amazon Web Services account or All.\n\tAccountIds []string\n\n\t// A list of Amazon Web Services accounts where the current document is shared and\n\t// the version shared with each account.\n\tAccountSharingInfoList []types.AccountSharingInfo\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocumentPermission{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDocumentPermission{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeDocumentPermission\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeDocumentPermissionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocumentPermission(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeDocumentPermission(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeDocumentPermission\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// All associations for the managed node(s).\nfunc (c *Client) DescribeEffectiveInstanceAssociations(ctx context.Context, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeEffectiveInstanceAssociationsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeEffectiveInstanceAssociations\", params, optFns, c.addOperationDescribeEffectiveInstanceAssociationsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeEffectiveInstanceAssociationsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeEffectiveInstanceAssociationsInput struct {\n\n\t// The managed node ID for which you want to view all associations.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeEffectiveInstanceAssociationsOutput struct {\n\n\t// The associations for the requested managed node.\n\tAssociations []types.InstanceAssociation\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectiveInstanceAssociations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeEffectiveInstanceAssociations\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeEffectiveInstanceAssociationsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeEffectiveInstanceAssociationsAPIClient is a client that implements the\n// DescribeEffectiveInstanceAssociations operation.\ntype DescribeEffectiveInstanceAssociationsAPIClient interface {\n\tDescribeEffectiveInstanceAssociations(context.Context, *DescribeEffectiveInstanceAssociationsInput, ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error)\n}\n\nvar _ DescribeEffectiveInstanceAssociationsAPIClient = (*Client)(nil)\n\n// DescribeEffectiveInstanceAssociationsPaginatorOptions is the paginator options\n// for DescribeEffectiveInstanceAssociations\ntype DescribeEffectiveInstanceAssociationsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeEffectiveInstanceAssociationsPaginator is a paginator for\n// DescribeEffectiveInstanceAssociations\ntype DescribeEffectiveInstanceAssociationsPaginator struct {\n\toptions   DescribeEffectiveInstanceAssociationsPaginatorOptions\n\tclient    DescribeEffectiveInstanceAssociationsAPIClient\n\tparams    *DescribeEffectiveInstanceAssociationsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeEffectiveInstanceAssociationsPaginator returns a new\n// DescribeEffectiveInstanceAssociationsPaginator\nfunc NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeEffectiveInstanceAssociationsInput{}\n\t}\n\n\toptions := DescribeEffectiveInstanceAssociationsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeEffectiveInstanceAssociationsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeEffectiveInstanceAssociationsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeEffectiveInstanceAssociations page.\nfunc (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeEffectiveInstanceAssociations(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeEffectiveInstanceAssociations\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the current effective patches (the patch and the approval state) for\n// the specified patch baseline. Applies to patch baselines for Windows only.\nfunc (c *Client) DescribeEffectivePatchesForPatchBaseline(ctx context.Context, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeEffectivePatchesForPatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeEffectivePatchesForPatchBaseline\", params, optFns, c.addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeEffectivePatchesForPatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeEffectivePatchesForPatchBaselineInput struct {\n\n\t// The ID of the patch baseline to retrieve the effective patches for.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\t// The maximum number of patches to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeEffectivePatchesForPatchBaselineOutput struct {\n\n\t// An array of patches and patch status.\n\tEffectivePatches []types.EffectivePatch\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectivePatchesForPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeEffectivePatchesForPatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeEffectivePatchesForPatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeEffectivePatchesForPatchBaselineAPIClient is a client that implements\n// the DescribeEffectivePatchesForPatchBaseline operation.\ntype DescribeEffectivePatchesForPatchBaselineAPIClient interface {\n\tDescribeEffectivePatchesForPatchBaseline(context.Context, *DescribeEffectivePatchesForPatchBaselineInput, ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error)\n}\n\nvar _ DescribeEffectivePatchesForPatchBaselineAPIClient = (*Client)(nil)\n\n// DescribeEffectivePatchesForPatchBaselinePaginatorOptions is the paginator\n// options for DescribeEffectivePatchesForPatchBaseline\ntype DescribeEffectivePatchesForPatchBaselinePaginatorOptions struct {\n\t// The maximum number of patches to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeEffectivePatchesForPatchBaselinePaginator is a paginator for\n// DescribeEffectivePatchesForPatchBaseline\ntype DescribeEffectivePatchesForPatchBaselinePaginator struct {\n\toptions   DescribeEffectivePatchesForPatchBaselinePaginatorOptions\n\tclient    DescribeEffectivePatchesForPatchBaselineAPIClient\n\tparams    *DescribeEffectivePatchesForPatchBaselineInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new\n// DescribeEffectivePatchesForPatchBaselinePaginator\nfunc NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator {\n\tif params == nil {\n\t\tparams = &DescribeEffectivePatchesForPatchBaselineInput{}\n\t}\n\n\toptions := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeEffectivePatchesForPatchBaselinePaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeEffectivePatchesForPatchBaselinePaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeEffectivePatchesForPatchBaseline page.\nfunc (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeEffectivePatchesForPatchBaseline(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeEffectivePatchesForPatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceAssociationsStatus.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// The status of the associations for the managed node(s).\nfunc (c *Client) DescribeInstanceAssociationsStatus(ctx context.Context, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInstanceAssociationsStatusInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInstanceAssociationsStatus\", params, optFns, c.addOperationDescribeInstanceAssociationsStatusMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInstanceAssociationsStatusOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInstanceAssociationsStatusInput struct {\n\n\t// The managed node IDs for which you want association status information.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInstanceAssociationsStatusOutput struct {\n\n\t// Status information about the association.\n\tInstanceAssociationStatusInfos []types.InstanceAssociationStatusInfo\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstanceAssociationsStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInstanceAssociationsStatus\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeInstanceAssociationsStatusValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInstanceAssociationsStatusAPIClient is a client that implements the\n// DescribeInstanceAssociationsStatus operation.\ntype DescribeInstanceAssociationsStatusAPIClient interface {\n\tDescribeInstanceAssociationsStatus(context.Context, *DescribeInstanceAssociationsStatusInput, ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error)\n}\n\nvar _ DescribeInstanceAssociationsStatusAPIClient = (*Client)(nil)\n\n// DescribeInstanceAssociationsStatusPaginatorOptions is the paginator options for\n// DescribeInstanceAssociationsStatus\ntype DescribeInstanceAssociationsStatusPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInstanceAssociationsStatusPaginator is a paginator for\n// DescribeInstanceAssociationsStatus\ntype DescribeInstanceAssociationsStatusPaginator struct {\n\toptions   DescribeInstanceAssociationsStatusPaginatorOptions\n\tclient    DescribeInstanceAssociationsStatusAPIClient\n\tparams    *DescribeInstanceAssociationsStatusInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInstanceAssociationsStatusPaginator returns a new\n// DescribeInstanceAssociationsStatusPaginator\nfunc NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInstanceAssociationsStatusInput{}\n\t}\n\n\toptions := DescribeInstanceAssociationsStatusPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInstanceAssociationsStatusPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInstanceAssociationsStatusPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInstanceAssociationsStatus page.\nfunc (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInstanceAssociationsStatus(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInstanceAssociationsStatus\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceInformation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Provides information about one or more of your managed nodes, including the\n// operating system platform, SSM Agent version, association status, and IP\n// address. This operation does not return information for nodes that are either\n// Stopped or Terminated. If you specify one or more node IDs, the operation\n// returns information for those managed nodes. If you don't specify node IDs, it\n// returns information for all your managed nodes. If you specify a node ID that\n// isn't valid or a node that you don't own, you receive an error. The IamRole\n// field returned for this API operation is the Identity and Access Management\n// (IAM) role assigned to on-premises managed nodes. This operation does not return\n// the IAM role for EC2 instances.\nfunc (c *Client) DescribeInstanceInformation(ctx context.Context, params *DescribeInstanceInformationInput, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInstanceInformationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInstanceInformation\", params, optFns, c.addOperationDescribeInstanceInformationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInstanceInformationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInstanceInformationInput struct {\n\n\t// One or more filters. Use a filter to return a more specific list of managed\n\t// nodes. You can filter based on tags applied to your managed nodes. Tag filters\n\t// can't be combined with other filter types. Use this Filters data type instead\n\t// of InstanceInformationFilterList , which is deprecated.\n\tFilters []types.InstanceInformationStringFilter\n\n\t// This is a legacy method. We recommend that you don't use this method. Instead,\n\t// use the Filters data type. Filters enables you to return node information by\n\t// filtering based on tags applied to managed nodes. Attempting to use\n\t// InstanceInformationFilterList and Filters leads to an exception error.\n\tInstanceInformationFilterList []types.InstanceInformationFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\t// The default value is 10 items.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInstanceInformationOutput struct {\n\n\t// The managed node information list.\n\tInstanceInformationList []types.InstanceInformation\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceInformation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstanceInformation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInstanceInformation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeInstanceInformationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceInformation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInstanceInformationAPIClient is a client that implements the\n// DescribeInstanceInformation operation.\ntype DescribeInstanceInformationAPIClient interface {\n\tDescribeInstanceInformation(context.Context, *DescribeInstanceInformationInput, ...func(*Options)) (*DescribeInstanceInformationOutput, error)\n}\n\nvar _ DescribeInstanceInformationAPIClient = (*Client)(nil)\n\n// DescribeInstanceInformationPaginatorOptions is the paginator options for\n// DescribeInstanceInformation\ntype DescribeInstanceInformationPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\t// The default value is 10 items.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInstanceInformationPaginator is a paginator for\n// DescribeInstanceInformation\ntype DescribeInstanceInformationPaginator struct {\n\toptions   DescribeInstanceInformationPaginatorOptions\n\tclient    DescribeInstanceInformationAPIClient\n\tparams    *DescribeInstanceInformationInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInstanceInformationPaginator returns a new\n// DescribeInstanceInformationPaginator\nfunc NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInstanceInformationInput{}\n\t}\n\n\toptions := DescribeInstanceInformationPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInstanceInformationPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInstanceInformationPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInstanceInformation page.\nfunc (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInstanceInformation(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInstanceInformation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInstanceInformation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStates.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the high-level patch state of one or more managed nodes.\nfunc (c *Client) DescribeInstancePatchStates(ctx context.Context, params *DescribeInstancePatchStatesInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchStatesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInstancePatchStates\", params, optFns, c.addOperationDescribeInstancePatchStatesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInstancePatchStatesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInstancePatchStatesInput struct {\n\n\t// The ID of the managed node for which patch state information should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tInstanceIds []string\n\n\t// The maximum number of managed nodes to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInstancePatchStatesOutput struct {\n\n\t// The high-level patch state for the requested managed nodes.\n\tInstancePatchStates []types.InstancePatchState\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStates{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatchStates{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInstancePatchStates\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeInstancePatchStatesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStates(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInstancePatchStatesAPIClient is a client that implements the\n// DescribeInstancePatchStates operation.\ntype DescribeInstancePatchStatesAPIClient interface {\n\tDescribeInstancePatchStates(context.Context, *DescribeInstancePatchStatesInput, ...func(*Options)) (*DescribeInstancePatchStatesOutput, error)\n}\n\nvar _ DescribeInstancePatchStatesAPIClient = (*Client)(nil)\n\n// DescribeInstancePatchStatesPaginatorOptions is the paginator options for\n// DescribeInstancePatchStates\ntype DescribeInstancePatchStatesPaginatorOptions struct {\n\t// The maximum number of managed nodes to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInstancePatchStatesPaginator is a paginator for\n// DescribeInstancePatchStates\ntype DescribeInstancePatchStatesPaginator struct {\n\toptions   DescribeInstancePatchStatesPaginatorOptions\n\tclient    DescribeInstancePatchStatesAPIClient\n\tparams    *DescribeInstancePatchStatesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInstancePatchStatesPaginator returns a new\n// DescribeInstancePatchStatesPaginator\nfunc NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchStatesInput{}\n\t}\n\n\toptions := DescribeInstancePatchStatesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInstancePatchStatesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInstancePatchStatesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInstancePatchStates page.\nfunc (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInstancePatchStates(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInstancePatchStates(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInstancePatchStates\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the high-level patch state for the managed nodes in the specified\n// patch group.\nfunc (c *Client) DescribeInstancePatchStatesForPatchGroup(ctx context.Context, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchStatesForPatchGroupInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInstancePatchStatesForPatchGroup\", params, optFns, c.addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInstancePatchStatesForPatchGroupOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInstancePatchStatesForPatchGroupInput struct {\n\n\t// The name of the patch group for which the patch state information should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\t// Each entry in the array is a structure containing:\n\t//   - Key (string between 1 and 200 characters)\n\t//   - Values (array containing a single string)\n\t//   - Type (string \"Equal\", \"NotEqual\", \"LessThan\", \"GreaterThan\")\n\tFilters []types.InstancePatchStateFilter\n\n\t// The maximum number of patches to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInstancePatchStatesForPatchGroupOutput struct {\n\n\t// The high-level patch state for the requested managed nodes.\n\tInstancePatchStates []types.InstancePatchState\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatchStatesForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInstancePatchStatesForPatchGroup\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeInstancePatchStatesForPatchGroupValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInstancePatchStatesForPatchGroupAPIClient is a client that implements\n// the DescribeInstancePatchStatesForPatchGroup operation.\ntype DescribeInstancePatchStatesForPatchGroupAPIClient interface {\n\tDescribeInstancePatchStatesForPatchGroup(context.Context, *DescribeInstancePatchStatesForPatchGroupInput, ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error)\n}\n\nvar _ DescribeInstancePatchStatesForPatchGroupAPIClient = (*Client)(nil)\n\n// DescribeInstancePatchStatesForPatchGroupPaginatorOptions is the paginator\n// options for DescribeInstancePatchStatesForPatchGroup\ntype DescribeInstancePatchStatesForPatchGroupPaginatorOptions struct {\n\t// The maximum number of patches to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInstancePatchStatesForPatchGroupPaginator is a paginator for\n// DescribeInstancePatchStatesForPatchGroup\ntype DescribeInstancePatchStatesForPatchGroupPaginator struct {\n\toptions   DescribeInstancePatchStatesForPatchGroupPaginatorOptions\n\tclient    DescribeInstancePatchStatesForPatchGroupAPIClient\n\tparams    *DescribeInstancePatchStatesForPatchGroupInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new\n// DescribeInstancePatchStatesForPatchGroupPaginator\nfunc NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchStatesForPatchGroupInput{}\n\t}\n\n\toptions := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInstancePatchStatesForPatchGroupPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInstancePatchStatesForPatchGroupPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInstancePatchStatesForPatchGroup page.\nfunc (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInstancePatchStatesForPatchGroup(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInstancePatchStatesForPatchGroup\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatches.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves information about the patches on the specified managed node and their\n// state relative to the patch baseline being used for the node.\nfunc (c *Client) DescribeInstancePatches(ctx context.Context, params *DescribeInstancePatchesInput, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInstancePatches\", params, optFns, c.addOperationDescribeInstancePatchesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInstancePatchesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInstancePatchesInput struct {\n\n\t// The ID of the managed node whose patch state information should be retrieved.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// Each element in the array is a structure containing a key-value pair. Supported\n\t// keys for DescribeInstancePatches include the following:\n\t//   - Classification Sample values: Security | SecurityUpdates\n\t//   - KBId Sample values: KB4480056 | java-1.7.0-openjdk.x86_64\n\t//   - Severity Sample values: Important | Medium | Low\n\t//   - State Sample values: Installed | InstalledOther | InstalledPendingReboot For\n\t//   lists of all State values, see Understanding patch compliance state values (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html)\n\t//   in the Amazon Web Services Systems Manager User Guide.\n\tFilters []types.PatchOrchestratorFilter\n\n\t// The maximum number of patches to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInstancePatchesOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Each entry in the array is a structure containing:\n\t//   - Title (string)\n\t//   - KBId (string)\n\t//   - Classification (string)\n\t//   - Severity (string)\n\t//   - State (string, such as \"INSTALLED\" or \"FAILED\")\n\t//   - InstalledTime (DateTime)\n\t//   - InstalledBy (string)\n\tPatches []types.PatchComplianceData\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatches{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatches{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInstancePatches\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeInstancePatchesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatches(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInstancePatchesAPIClient is a client that implements the\n// DescribeInstancePatches operation.\ntype DescribeInstancePatchesAPIClient interface {\n\tDescribeInstancePatches(context.Context, *DescribeInstancePatchesInput, ...func(*Options)) (*DescribeInstancePatchesOutput, error)\n}\n\nvar _ DescribeInstancePatchesAPIClient = (*Client)(nil)\n\n// DescribeInstancePatchesPaginatorOptions is the paginator options for\n// DescribeInstancePatches\ntype DescribeInstancePatchesPaginatorOptions struct {\n\t// The maximum number of patches to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInstancePatchesPaginator is a paginator for DescribeInstancePatches\ntype DescribeInstancePatchesPaginator struct {\n\toptions   DescribeInstancePatchesPaginatorOptions\n\tclient    DescribeInstancePatchesAPIClient\n\tparams    *DescribeInstancePatchesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInstancePatchesPaginator returns a new\n// DescribeInstancePatchesPaginator\nfunc NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInstancePatchesInput{}\n\t}\n\n\toptions := DescribeInstancePatchesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInstancePatchesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInstancePatchesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInstancePatches page.\nfunc (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInstancePatches(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInstancePatches(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInstancePatches\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInventoryDeletions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Describes a specific delete inventory operation.\nfunc (c *Client) DescribeInventoryDeletions(ctx context.Context, params *DescribeInventoryDeletionsInput, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeInventoryDeletionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeInventoryDeletions\", params, optFns, c.addOperationDescribeInventoryDeletionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeInventoryDeletionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeInventoryDeletionsInput struct {\n\n\t// Specify the delete inventory ID for which you want information. This ID was\n\t// returned by the DeleteInventory operation.\n\tDeletionId *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeInventoryDeletionsOutput struct {\n\n\t// A list of status items for deleted inventory.\n\tInventoryDeletions []types.InventoryDeletionStatusItem\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInventoryDeletions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInventoryDeletions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeInventoryDeletions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInventoryDeletions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeInventoryDeletionsAPIClient is a client that implements the\n// DescribeInventoryDeletions operation.\ntype DescribeInventoryDeletionsAPIClient interface {\n\tDescribeInventoryDeletions(context.Context, *DescribeInventoryDeletionsInput, ...func(*Options)) (*DescribeInventoryDeletionsOutput, error)\n}\n\nvar _ DescribeInventoryDeletionsAPIClient = (*Client)(nil)\n\n// DescribeInventoryDeletionsPaginatorOptions is the paginator options for\n// DescribeInventoryDeletions\ntype DescribeInventoryDeletionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeInventoryDeletionsPaginator is a paginator for\n// DescribeInventoryDeletions\ntype DescribeInventoryDeletionsPaginator struct {\n\toptions   DescribeInventoryDeletionsPaginatorOptions\n\tclient    DescribeInventoryDeletionsAPIClient\n\tparams    *DescribeInventoryDeletionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeInventoryDeletionsPaginator returns a new\n// DescribeInventoryDeletionsPaginator\nfunc NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeInventoryDeletionsInput{}\n\t}\n\n\toptions := DescribeInventoryDeletionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeInventoryDeletionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeInventoryDeletionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeInventoryDeletions page.\nfunc (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeInventoryDeletions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeInventoryDeletions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeInventoryDeletions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the individual task executions (one per target) for a particular task\n// run as part of a maintenance window execution.\nfunc (c *Client) DescribeMaintenanceWindowExecutionTaskInvocations(ctx context.Context, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowExecutionTaskInvocations\", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowExecutionTaskInvocationsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowExecutionTaskInvocationsInput struct {\n\n\t// The ID of the specific task in the maintenance window task that should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tTaskId *string\n\n\t// The ID of the maintenance window execution the task is part of.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\t// Optional filters used to scope down the returned task invocations. The\n\t// supported filter key is STATUS with the corresponding values PENDING ,\n\t// IN_PROGRESS , SUCCESS , FAILED , TIMED_OUT , CANCELLING , and CANCELLED .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowExecutionTaskInvocationsOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the task invocation results per invocation.\n\tWindowExecutionTaskInvocationIdentities []types.MaintenanceWindowExecutionTaskInvocationIdentity\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTaskInvocations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowExecutionTaskInvocations\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowExecutionTaskInvocationsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient is a client that\n// implements the DescribeMaintenanceWindowExecutionTaskInvocations operation.\ntype DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient interface {\n\tDescribeMaintenanceWindowExecutionTaskInvocations(context.Context, *DescribeMaintenanceWindowExecutionTaskInvocationsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions is the\n// paginator options for DescribeMaintenanceWindowExecutionTaskInvocations\ntype DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator is a paginator for\n// DescribeMaintenanceWindowExecutionTaskInvocations\ntype DescribeMaintenanceWindowExecutionTaskInvocationsPaginator struct {\n\toptions   DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions\n\tclient    DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient\n\tparams    *DescribeMaintenanceWindowExecutionTaskInvocationsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new\n// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator\nfunc NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowExecutionTaskInvocationsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowExecutionTaskInvocations\n// page.\nfunc (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowExecutionTaskInvocations(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowExecutionTaskInvocations\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// For a given maintenance window execution, lists the tasks that were run.\nfunc (c *Client) DescribeMaintenanceWindowExecutionTasks(ctx context.Context, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionTasksInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowExecutionTasks\", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowExecutionTasksOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowExecutionTasksInput struct {\n\n\t// The ID of the maintenance window execution whose task executions should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\t// Optional filters used to scope down the returned tasks. The supported filter\n\t// key is STATUS with the corresponding values PENDING , IN_PROGRESS , SUCCESS ,\n\t// FAILED , TIMED_OUT , CANCELLING , and CANCELLED .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowExecutionTasksOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the task executions.\n\tWindowExecutionTaskIdentities []types.MaintenanceWindowExecutionTaskIdentity\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTasks{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowExecutionTasks\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowExecutionTasksValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements\n// the DescribeMaintenanceWindowExecutionTasks operation.\ntype DescribeMaintenanceWindowExecutionTasksAPIClient interface {\n\tDescribeMaintenanceWindowExecutionTasks(context.Context, *DescribeMaintenanceWindowExecutionTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowExecutionTasksAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator\n// options for DescribeMaintenanceWindowExecutionTasks\ntype DescribeMaintenanceWindowExecutionTasksPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowExecutionTasksPaginator is a paginator for\n// DescribeMaintenanceWindowExecutionTasks\ntype DescribeMaintenanceWindowExecutionTasksPaginator struct {\n\toptions   DescribeMaintenanceWindowExecutionTasksPaginatorOptions\n\tclient    DescribeMaintenanceWindowExecutionTasksAPIClient\n\tparams    *DescribeMaintenanceWindowExecutionTasksInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new\n// DescribeMaintenanceWindowExecutionTasksPaginator\nfunc NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionTasksInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowExecutionTasksPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowExecutionTasksPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowExecutionTasks page.\nfunc (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowExecutionTasks(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowExecutionTasks\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the executions of a maintenance window. This includes information about\n// when the maintenance window was scheduled to be active, and information about\n// tasks registered and run with the maintenance window.\nfunc (c *Client) DescribeMaintenanceWindowExecutions(ctx context.Context, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowExecutions\", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowExecutionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowExecutionsInput struct {\n\n\t// The ID of the maintenance window whose executions should be retrieved.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// Each entry in the array is a structure containing:\n\t//   - Key. A string between 1 and 128 characters. Supported keys include\n\t//   ExecutedBefore and ExecutedAfter .\n\t//   - Values. An array of strings, each between 1 and 256 characters. Supported\n\t//   values are date/time strings in a valid ISO 8601 date/time format, such as\n\t//   2021-11-04T05:00:00Z .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowExecutionsOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the maintenance window executions.\n\tWindowExecutions []types.MaintenanceWindowExecution\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowExecutions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowExecutionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowExecutionsAPIClient is a client that implements the\n// DescribeMaintenanceWindowExecutions operation.\ntype DescribeMaintenanceWindowExecutionsAPIClient interface {\n\tDescribeMaintenanceWindowExecutions(context.Context, *DescribeMaintenanceWindowExecutionsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowExecutionsAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options\n// for DescribeMaintenanceWindowExecutions\ntype DescribeMaintenanceWindowExecutionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowExecutionsPaginator is a paginator for\n// DescribeMaintenanceWindowExecutions\ntype DescribeMaintenanceWindowExecutionsPaginator struct {\n\toptions   DescribeMaintenanceWindowExecutionsPaginatorOptions\n\tclient    DescribeMaintenanceWindowExecutionsAPIClient\n\tparams    *DescribeMaintenanceWindowExecutionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowExecutionsPaginator returns a new\n// DescribeMaintenanceWindowExecutionsPaginator\nfunc NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowExecutionsInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowExecutionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowExecutionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowExecutionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowExecutions page.\nfunc (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowExecutions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowExecutions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves information about upcoming executions of a maintenance window.\nfunc (c *Client) DescribeMaintenanceWindowSchedule(ctx context.Context, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowScheduleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowSchedule\", params, optFns, c.addOperationDescribeMaintenanceWindowScheduleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowScheduleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowScheduleInput struct {\n\n\t// Filters used to limit the range of results. For example, you can limit\n\t// maintenance window executions to only those scheduled before or after a certain\n\t// date and time.\n\tFilters []types.PatchOrchestratorFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// The type of resource you want to retrieve information about. For example,\n\t// INSTANCE .\n\tResourceType types.MaintenanceWindowResourceType\n\n\t// The managed node ID or key-value pair to retrieve information about.\n\tTargets []types.Target\n\n\t// The ID of the maintenance window to retrieve information about.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowScheduleOutput struct {\n\n\t// The token for the next set of items to return. (You use this token in the next\n\t// call.)\n\tNextToken *string\n\n\t// Information about maintenance window executions scheduled for the specified\n\t// time range.\n\tScheduledWindowExecutions []types.ScheduledWindowExecution\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowSchedule{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowSchedule\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowScheduleAPIClient is a client that implements the\n// DescribeMaintenanceWindowSchedule operation.\ntype DescribeMaintenanceWindowScheduleAPIClient interface {\n\tDescribeMaintenanceWindowSchedule(context.Context, *DescribeMaintenanceWindowScheduleInput, ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowScheduleAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowSchedulePaginatorOptions is the paginator options for\n// DescribeMaintenanceWindowSchedule\ntype DescribeMaintenanceWindowSchedulePaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowSchedulePaginator is a paginator for\n// DescribeMaintenanceWindowSchedule\ntype DescribeMaintenanceWindowSchedulePaginator struct {\n\toptions   DescribeMaintenanceWindowSchedulePaginatorOptions\n\tclient    DescribeMaintenanceWindowScheduleAPIClient\n\tparams    *DescribeMaintenanceWindowScheduleInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowSchedulePaginator returns a new\n// DescribeMaintenanceWindowSchedulePaginator\nfunc NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowScheduleInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowSchedulePaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowSchedulePaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowSchedulePaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowSchedule page.\nfunc (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowSchedule(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowSchedule\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTargets.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the targets registered with the maintenance window.\nfunc (c *Client) DescribeMaintenanceWindowTargets(ctx context.Context, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowTargetsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowTargets\", params, optFns, c.addOperationDescribeMaintenanceWindowTargetsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowTargetsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowTargetsInput struct {\n\n\t// The ID of the maintenance window whose targets should be retrieved.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// Optional filters that can be used to narrow down the scope of the returned\n\t// window targets. The supported filter keys are Type , WindowTargetId , and\n\t// OwnerInformation .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowTargetsOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the targets in the maintenance window.\n\tTargets []types.MaintenanceWindowTarget\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowTargets{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowTargets\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowTargetsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowTargetsAPIClient is a client that implements the\n// DescribeMaintenanceWindowTargets operation.\ntype DescribeMaintenanceWindowTargetsAPIClient interface {\n\tDescribeMaintenanceWindowTargets(context.Context, *DescribeMaintenanceWindowTargetsInput, ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowTargetsAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowTargetsPaginatorOptions is the paginator options for\n// DescribeMaintenanceWindowTargets\ntype DescribeMaintenanceWindowTargetsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowTargetsPaginator is a paginator for\n// DescribeMaintenanceWindowTargets\ntype DescribeMaintenanceWindowTargetsPaginator struct {\n\toptions   DescribeMaintenanceWindowTargetsPaginatorOptions\n\tclient    DescribeMaintenanceWindowTargetsAPIClient\n\tparams    *DescribeMaintenanceWindowTargetsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowTargetsPaginator returns a new\n// DescribeMaintenanceWindowTargetsPaginator\nfunc NewDescribeMaintenanceWindowTargetsPaginator(client DescribeMaintenanceWindowTargetsAPIClient, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*DescribeMaintenanceWindowTargetsPaginatorOptions)) *DescribeMaintenanceWindowTargetsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowTargetsInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowTargetsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowTargetsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowTargetsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowTargets page.\nfunc (p *DescribeMaintenanceWindowTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowTargets(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowTargets\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTasks.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the tasks in a maintenance window. For maintenance window tasks without a\n// specified target, you can't supply values for --max-errors and --max-concurrency\n// . Instead, the system inserts a placeholder value of 1 , which may be reported\n// in the response to this command. These values don't affect the running of your\n// task and can be ignored.\nfunc (c *Client) DescribeMaintenanceWindowTasks(ctx context.Context, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowTasksInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowTasks\", params, optFns, c.addOperationDescribeMaintenanceWindowTasksMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowTasksOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowTasksInput struct {\n\n\t// The ID of the maintenance window whose tasks should be retrieved.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// Optional filters used to narrow down the scope of the returned tasks. The\n\t// supported filter keys are WindowTaskId , TaskArn , Priority , and TaskType .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowTasksOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the tasks in the maintenance window.\n\tTasks []types.MaintenanceWindowTask\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowTasks{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowTasks\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowTasksValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowTasksAPIClient is a client that implements the\n// DescribeMaintenanceWindowTasks operation.\ntype DescribeMaintenanceWindowTasksAPIClient interface {\n\tDescribeMaintenanceWindowTasks(context.Context, *DescribeMaintenanceWindowTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowTasksAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowTasksPaginatorOptions is the paginator options for\n// DescribeMaintenanceWindowTasks\ntype DescribeMaintenanceWindowTasksPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowTasksPaginator is a paginator for\n// DescribeMaintenanceWindowTasks\ntype DescribeMaintenanceWindowTasksPaginator struct {\n\toptions   DescribeMaintenanceWindowTasksPaginatorOptions\n\tclient    DescribeMaintenanceWindowTasksAPIClient\n\tparams    *DescribeMaintenanceWindowTasksInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowTasksPaginator returns a new\n// DescribeMaintenanceWindowTasksPaginator\nfunc NewDescribeMaintenanceWindowTasksPaginator(client DescribeMaintenanceWindowTasksAPIClient, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*DescribeMaintenanceWindowTasksPaginatorOptions)) *DescribeMaintenanceWindowTasksPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowTasksInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowTasksPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowTasksPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowTasksPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowTasks page.\nfunc (p *DescribeMaintenanceWindowTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowTasks(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowTasks\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindows.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the maintenance windows in an Amazon Web Services account.\nfunc (c *Client) DescribeMaintenanceWindows(ctx context.Context, params *DescribeMaintenanceWindowsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindows\", params, optFns, c.addOperationDescribeMaintenanceWindowsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowsInput struct {\n\n\t// Optional filters used to narrow down the scope of the returned maintenance\n\t// windows. Supported filter keys are Name and Enabled . For example,\n\t// Name=MyMaintenanceWindow and Enabled=True .\n\tFilters []types.MaintenanceWindowFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowsOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Information about the maintenance windows.\n\tWindowIdentities []types.MaintenanceWindowIdentity\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindows{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindows{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindows\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindows(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowsAPIClient is a client that implements the\n// DescribeMaintenanceWindows operation.\ntype DescribeMaintenanceWindowsAPIClient interface {\n\tDescribeMaintenanceWindows(context.Context, *DescribeMaintenanceWindowsInput, ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowsAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowsPaginatorOptions is the paginator options for\n// DescribeMaintenanceWindows\ntype DescribeMaintenanceWindowsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowsPaginator is a paginator for\n// DescribeMaintenanceWindows\ntype DescribeMaintenanceWindowsPaginator struct {\n\toptions   DescribeMaintenanceWindowsPaginatorOptions\n\tclient    DescribeMaintenanceWindowsAPIClient\n\tparams    *DescribeMaintenanceWindowsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowsPaginator returns a new\n// DescribeMaintenanceWindowsPaginator\nfunc NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowsInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindows page.\nfunc (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindows(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindows(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindows\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves information about the maintenance window targets or tasks that a\n// managed node is associated with.\nfunc (c *Client) DescribeMaintenanceWindowsForTarget(ctx context.Context, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowsForTargetInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeMaintenanceWindowsForTarget\", params, optFns, c.addOperationDescribeMaintenanceWindowsForTargetMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeMaintenanceWindowsForTargetOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeMaintenanceWindowsForTargetInput struct {\n\n\t// The type of resource you want to retrieve information about. For example,\n\t// INSTANCE .\n\t//\n\t// This member is required.\n\tResourceType types.MaintenanceWindowResourceType\n\n\t// The managed node ID or key-value pair to retrieve information about.\n\t//\n\t// This member is required.\n\tTargets []types.Target\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeMaintenanceWindowsForTargetOutput struct {\n\n\t// The token for the next set of items to return. (You use this token in the next\n\t// call.)\n\tNextToken *string\n\n\t// Information about the maintenance window targets and tasks a managed node is\n\t// associated with.\n\tWindowIdentities []types.MaintenanceWindowIdentityForTarget\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowsForTarget{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeMaintenanceWindowsForTarget\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeMaintenanceWindowsForTargetValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeMaintenanceWindowsForTargetAPIClient is a client that implements the\n// DescribeMaintenanceWindowsForTarget operation.\ntype DescribeMaintenanceWindowsForTargetAPIClient interface {\n\tDescribeMaintenanceWindowsForTarget(context.Context, *DescribeMaintenanceWindowsForTargetInput, ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error)\n}\n\nvar _ DescribeMaintenanceWindowsForTargetAPIClient = (*Client)(nil)\n\n// DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options\n// for DescribeMaintenanceWindowsForTarget\ntype DescribeMaintenanceWindowsForTargetPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeMaintenanceWindowsForTargetPaginator is a paginator for\n// DescribeMaintenanceWindowsForTarget\ntype DescribeMaintenanceWindowsForTargetPaginator struct {\n\toptions   DescribeMaintenanceWindowsForTargetPaginatorOptions\n\tclient    DescribeMaintenanceWindowsForTargetAPIClient\n\tparams    *DescribeMaintenanceWindowsForTargetInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeMaintenanceWindowsForTargetPaginator returns a new\n// DescribeMaintenanceWindowsForTargetPaginator\nfunc NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator {\n\tif params == nil {\n\t\tparams = &DescribeMaintenanceWindowsForTargetInput{}\n\t}\n\n\toptions := DescribeMaintenanceWindowsForTargetPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeMaintenanceWindowsForTargetPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeMaintenanceWindowsForTargetPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeMaintenanceWindowsForTarget page.\nfunc (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeMaintenanceWindowsForTarget(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeMaintenanceWindowsForTarget\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeOpsItems.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Query a set of OpsItems. You must have permission in Identity and Access\n// Management (IAM) to query a list of OpsItems. For more information, see Set up\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html)\n// in the Amazon Web Services Systems Manager User Guide. Operations engineers and\n// IT professionals use Amazon Web Services Systems Manager OpsCenter to view,\n// investigate, and remediate operational issues impacting the performance and\n// health of their Amazon Web Services resources. For more information, see\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) DescribeOpsItems(ctx context.Context, params *DescribeOpsItemsInput, optFns ...func(*Options)) (*DescribeOpsItemsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeOpsItemsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeOpsItems\", params, optFns, c.addOperationDescribeOpsItemsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeOpsItemsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeOpsItemsInput struct {\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\t// One or more filters to limit the response.\n\t//   - Key: CreatedTime Operations: GreaterThan, LessThan\n\t//   - Key: LastModifiedBy Operations: Contains, Equals\n\t//   - Key: LastModifiedTime Operations: GreaterThan, LessThan\n\t//   - Key: Priority Operations: Equals\n\t//   - Key: Source Operations: Contains, Equals\n\t//   - Key: Status Operations: Equals\n\t//   - Key: Title* Operations: Equals,Contains\n\t//   - Key: OperationalData** Operations: Equals\n\t//   - Key: OperationalDataKey Operations: Equals\n\t//   - Key: OperationalDataValue Operations: Equals, Contains\n\t//   - Key: OpsItemId Operations: Equals\n\t//   - Key: ResourceId Operations: Contains\n\t//   - Key: AutomationId Operations: Equals\n\t//   - Key: AccountId Operations: Equals\n\t// *The Equals operator for Title matches the first 100 characters. If you specify\n\t// more than 100 characters, they system returns an error that the filter value\n\t// exceeds the length limit. **If you filter the response by using the\n\t// OperationalData operator, specify a key-value pair by using the following JSON\n\t// format: {\"key\":\"key_name\",\"value\":\"a_value\"}\n\tOpsItemFilters []types.OpsItemFilter\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeOpsItemsOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A list of OpsItems.\n\tOpsItemSummaries []types.OpsItemSummary\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOpsItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOpsItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeOpsItems\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeOpsItemsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOpsItems(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeOpsItemsAPIClient is a client that implements the DescribeOpsItems\n// operation.\ntype DescribeOpsItemsAPIClient interface {\n\tDescribeOpsItems(context.Context, *DescribeOpsItemsInput, ...func(*Options)) (*DescribeOpsItemsOutput, error)\n}\n\nvar _ DescribeOpsItemsAPIClient = (*Client)(nil)\n\n// DescribeOpsItemsPaginatorOptions is the paginator options for DescribeOpsItems\ntype DescribeOpsItemsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeOpsItemsPaginator is a paginator for DescribeOpsItems\ntype DescribeOpsItemsPaginator struct {\n\toptions   DescribeOpsItemsPaginatorOptions\n\tclient    DescribeOpsItemsAPIClient\n\tparams    *DescribeOpsItemsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeOpsItemsPaginator returns a new DescribeOpsItemsPaginator\nfunc NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *DescribeOpsItemsInput, optFns ...func(*DescribeOpsItemsPaginatorOptions)) *DescribeOpsItemsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeOpsItemsInput{}\n\t}\n\n\toptions := DescribeOpsItemsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeOpsItemsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeOpsItemsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeOpsItems page.\nfunc (p *DescribeOpsItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOpsItemsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeOpsItems(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeOpsItems(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeOpsItems\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeParameters.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Get information about a parameter. Request results are returned on a\n// best-effort basis. If you specify MaxResults in the request, the response\n// includes information up to the limit specified. The number of items returned,\n// however, can be between zero and the value of MaxResults . If the service\n// reaches an internal limit while processing the results, it stops the operation\n// and returns the matching values up to that point and a NextToken . You can\n// specify the NextToken in a subsequent call to get the next set of results. If\n// you change the KMS key alias for the KMS key used to encrypt a parameter, then\n// you must also update the key alias the parameter uses to reference KMS.\n// Otherwise, DescribeParameters retrieves whatever the original key alias was\n// referencing.\nfunc (c *Client) DescribeParameters(ctx context.Context, params *DescribeParametersInput, optFns ...func(*Options)) (*DescribeParametersOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeParametersInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeParameters\", params, optFns, c.addOperationDescribeParametersMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeParametersOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeParametersInput struct {\n\n\t// This data type is deprecated. Instead, use ParameterFilters .\n\tFilters []types.ParametersFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// Filters to limit the request results.\n\tParameterFilters []types.ParameterStringFilter\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeParametersOutput struct {\n\n\t// The token to use when requesting the next set of items.\n\tNextToken *string\n\n\t// Parameters returned by the request.\n\tParameters []types.ParameterMetadata\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeParameters\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeParametersValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeParameters(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeParametersAPIClient is a client that implements the DescribeParameters\n// operation.\ntype DescribeParametersAPIClient interface {\n\tDescribeParameters(context.Context, *DescribeParametersInput, ...func(*Options)) (*DescribeParametersOutput, error)\n}\n\nvar _ DescribeParametersAPIClient = (*Client)(nil)\n\n// DescribeParametersPaginatorOptions is the paginator options for\n// DescribeParameters\ntype DescribeParametersPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeParametersPaginator is a paginator for DescribeParameters\ntype DescribeParametersPaginator struct {\n\toptions   DescribeParametersPaginatorOptions\n\tclient    DescribeParametersAPIClient\n\tparams    *DescribeParametersInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeParametersPaginator returns a new DescribeParametersPaginator\nfunc NewDescribeParametersPaginator(client DescribeParametersAPIClient, params *DescribeParametersInput, optFns ...func(*DescribeParametersPaginatorOptions)) *DescribeParametersPaginator {\n\tif params == nil {\n\t\tparams = &DescribeParametersInput{}\n\t}\n\n\toptions := DescribeParametersPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeParametersPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeParametersPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeParameters page.\nfunc (p *DescribeParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeParametersOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeParameters(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeParameters(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeParameters\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchBaselines.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the patch baselines in your Amazon Web Services account.\nfunc (c *Client) DescribePatchBaselines(ctx context.Context, params *DescribePatchBaselinesInput, optFns ...func(*Options)) (*DescribePatchBaselinesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribePatchBaselinesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribePatchBaselines\", params, optFns, c.addOperationDescribePatchBaselinesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribePatchBaselinesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribePatchBaselinesInput struct {\n\n\t// Each element in the array is a structure containing a key-value pair. Supported\n\t// keys for DescribePatchBaselines include the following:\n\t//   - NAME_PREFIX Sample values: AWS- | My-\n\t//   - OWNER Sample values: AWS | Self\n\t//   - OPERATING_SYSTEM Sample values: AMAZON_LINUX | SUSE | WINDOWS\n\tFilters []types.PatchOrchestratorFilter\n\n\t// The maximum number of patch baselines to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribePatchBaselinesOutput struct {\n\n\t// An array of PatchBaselineIdentity elements.\n\tBaselineIdentities []types.PatchBaselineIdentity\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchBaselines{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePatchBaselines{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribePatchBaselines\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchBaselines(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribePatchBaselinesAPIClient is a client that implements the\n// DescribePatchBaselines operation.\ntype DescribePatchBaselinesAPIClient interface {\n\tDescribePatchBaselines(context.Context, *DescribePatchBaselinesInput, ...func(*Options)) (*DescribePatchBaselinesOutput, error)\n}\n\nvar _ DescribePatchBaselinesAPIClient = (*Client)(nil)\n\n// DescribePatchBaselinesPaginatorOptions is the paginator options for\n// DescribePatchBaselines\ntype DescribePatchBaselinesPaginatorOptions struct {\n\t// The maximum number of patch baselines to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribePatchBaselinesPaginator is a paginator for DescribePatchBaselines\ntype DescribePatchBaselinesPaginator struct {\n\toptions   DescribePatchBaselinesPaginatorOptions\n\tclient    DescribePatchBaselinesAPIClient\n\tparams    *DescribePatchBaselinesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribePatchBaselinesPaginator returns a new DescribePatchBaselinesPaginator\nfunc NewDescribePatchBaselinesPaginator(client DescribePatchBaselinesAPIClient, params *DescribePatchBaselinesInput, optFns ...func(*DescribePatchBaselinesPaginatorOptions)) *DescribePatchBaselinesPaginator {\n\tif params == nil {\n\t\tparams = &DescribePatchBaselinesInput{}\n\t}\n\n\toptions := DescribePatchBaselinesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribePatchBaselinesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribePatchBaselinesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribePatchBaselines page.\nfunc (p *DescribePatchBaselinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchBaselinesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribePatchBaselines(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribePatchBaselines(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribePatchBaselines\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroupState.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns high-level aggregated patch compliance state information for a patch\n// group.\nfunc (c *Client) DescribePatchGroupState(ctx context.Context, params *DescribePatchGroupStateInput, optFns ...func(*Options)) (*DescribePatchGroupStateOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribePatchGroupStateInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribePatchGroupState\", params, optFns, c.addOperationDescribePatchGroupStateMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribePatchGroupStateOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribePatchGroupStateInput struct {\n\n\t// The name of the patch group whose patch snapshot should be retrieved.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribePatchGroupStateOutput struct {\n\n\t// The number of managed nodes in the patch group.\n\tInstances int32\n\n\t// The number of managed nodes where patches that are specified as Critical for\n\t// compliance reporting in the patch baseline aren't installed. These patches might\n\t// be missing, have failed installation, were rejected, or were installed but\n\t// awaiting a required managed node reboot. The status of these managed nodes is\n\t// NON_COMPLIANT .\n\tInstancesWithCriticalNonCompliantPatches *int32\n\n\t// The number of managed nodes with patches from the patch baseline that failed to\n\t// install.\n\tInstancesWithFailedPatches int32\n\n\t// The number of managed nodes with patches installed that aren't defined in the\n\t// patch baseline.\n\tInstancesWithInstalledOtherPatches int32\n\n\t// The number of managed nodes with installed patches.\n\tInstancesWithInstalledPatches int32\n\n\t// The number of managed nodes with patches installed by Patch Manager that\n\t// haven't been rebooted after the patch installation. The status of these managed\n\t// nodes is NON_COMPLIANT .\n\tInstancesWithInstalledPendingRebootPatches *int32\n\n\t// The number of managed nodes with patches installed that are specified in a\n\t// RejectedPatches list. Patches with a status of INSTALLED_REJECTED were\n\t// typically installed before they were added to a RejectedPatches list. If\n\t// ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction , the\n\t// value of InstancesWithInstalledRejectedPatches will always be 0 (zero).\n\tInstancesWithInstalledRejectedPatches *int32\n\n\t// The number of managed nodes with missing patches from the patch baseline.\n\tInstancesWithMissingPatches int32\n\n\t// The number of managed nodes with patches that aren't applicable.\n\tInstancesWithNotApplicablePatches int32\n\n\t// The number of managed nodes with patches installed that are specified as other\n\t// than Critical or Security but aren't compliant with the patch baseline. The\n\t// status of these managed nodes is NON_COMPLIANT .\n\tInstancesWithOtherNonCompliantPatches *int32\n\n\t// The number of managed nodes where patches that are specified as Security in a\n\t// patch advisory aren't installed. These patches might be missing, have failed\n\t// installation, were rejected, or were installed but awaiting a required managed\n\t// node reboot. The status of these managed nodes is NON_COMPLIANT .\n\tInstancesWithSecurityNonCompliantPatches *int32\n\n\t// The number of managed nodes with NotApplicable patches beyond the supported\n\t// limit, which aren't reported by name to Inventory. Inventory is a capability of\n\t// Amazon Web Services Systems Manager.\n\tInstancesWithUnreportedNotApplicablePatches *int32\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchGroupState{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePatchGroupState{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribePatchGroupState\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribePatchGroupStateValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchGroupState(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribePatchGroupState(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribePatchGroupState\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroups.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all patch groups that have been registered with patch baselines.\nfunc (c *Client) DescribePatchGroups(ctx context.Context, params *DescribePatchGroupsInput, optFns ...func(*Options)) (*DescribePatchGroupsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribePatchGroupsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribePatchGroups\", params, optFns, c.addOperationDescribePatchGroupsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribePatchGroupsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribePatchGroupsInput struct {\n\n\t// Each element in the array is a structure containing a key-value pair. Supported\n\t// keys for DescribePatchGroups include the following:\n\t//   - NAME_PREFIX Sample values: AWS- | My- .\n\t//   - OPERATING_SYSTEM Sample values: AMAZON_LINUX | SUSE | WINDOWS\n\tFilters []types.PatchOrchestratorFilter\n\n\t// The maximum number of patch groups to return (per page).\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribePatchGroupsOutput struct {\n\n\t// Each entry in the array contains:\n\t//   - PatchGroup : string (between 1 and 256 characters. Regex:\n\t//   ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$)\n\t//   - PatchBaselineIdentity : A PatchBaselineIdentity element.\n\tMappings []types.PatchGroupPatchBaselineMapping\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchGroups{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePatchGroups{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribePatchGroups\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchGroups(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribePatchGroupsAPIClient is a client that implements the\n// DescribePatchGroups operation.\ntype DescribePatchGroupsAPIClient interface {\n\tDescribePatchGroups(context.Context, *DescribePatchGroupsInput, ...func(*Options)) (*DescribePatchGroupsOutput, error)\n}\n\nvar _ DescribePatchGroupsAPIClient = (*Client)(nil)\n\n// DescribePatchGroupsPaginatorOptions is the paginator options for\n// DescribePatchGroups\ntype DescribePatchGroupsPaginatorOptions struct {\n\t// The maximum number of patch groups to return (per page).\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribePatchGroupsPaginator is a paginator for DescribePatchGroups\ntype DescribePatchGroupsPaginator struct {\n\toptions   DescribePatchGroupsPaginatorOptions\n\tclient    DescribePatchGroupsAPIClient\n\tparams    *DescribePatchGroupsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribePatchGroupsPaginator returns a new DescribePatchGroupsPaginator\nfunc NewDescribePatchGroupsPaginator(client DescribePatchGroupsAPIClient, params *DescribePatchGroupsInput, optFns ...func(*DescribePatchGroupsPaginatorOptions)) *DescribePatchGroupsPaginator {\n\tif params == nil {\n\t\tparams = &DescribePatchGroupsInput{}\n\t}\n\n\toptions := DescribePatchGroupsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribePatchGroupsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribePatchGroupsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribePatchGroups page.\nfunc (p *DescribePatchGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchGroupsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribePatchGroups(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribePatchGroups(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribePatchGroups\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchProperties.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the properties of available patches organized by product, product family,\n// classification, severity, and other properties of available patches. You can use\n// the reported properties in the filters you specify in requests for operations\n// such as CreatePatchBaseline , UpdatePatchBaseline , DescribeAvailablePatches ,\n// and DescribePatchBaselines . The following section lists the properties that can\n// be used in filters for each major operating system type: AMAZON_LINUX Valid\n// properties: PRODUCT | CLASSIFICATION | SEVERITY AMAZON_LINUX_2 Valid\n// properties: PRODUCT | CLASSIFICATION | SEVERITY CENTOS Valid properties: PRODUCT\n// | CLASSIFICATION | SEVERITY DEBIAN Valid properties: PRODUCT | PRIORITY MACOS\n// Valid properties: PRODUCT | CLASSIFICATION ORACLE_LINUX Valid properties:\n// PRODUCT | CLASSIFICATION | SEVERITY REDHAT_ENTERPRISE_LINUX Valid properties:\n// PRODUCT | CLASSIFICATION | SEVERITY SUSE Valid properties: PRODUCT |\n// CLASSIFICATION | SEVERITY UBUNTU Valid properties: PRODUCT | PRIORITY WINDOWS\n// Valid properties: PRODUCT | PRODUCT_FAMILY | CLASSIFICATION | MSRC_SEVERITY\nfunc (c *Client) DescribePatchProperties(ctx context.Context, params *DescribePatchPropertiesInput, optFns ...func(*Options)) (*DescribePatchPropertiesOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribePatchPropertiesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribePatchProperties\", params, optFns, c.addOperationDescribePatchPropertiesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribePatchPropertiesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribePatchPropertiesInput struct {\n\n\t// The operating system type for which to list patches.\n\t//\n\t// This member is required.\n\tOperatingSystem types.OperatingSystem\n\n\t// The patch property for which you want to view patch details.\n\t//\n\t// This member is required.\n\tProperty types.PatchProperty\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// Indicates whether to list patches for the Windows operating system or for\n\t// applications released by Microsoft. Not applicable for the Linux or macOS\n\t// operating systems.\n\tPatchSet types.PatchSet\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribePatchPropertiesOutput struct {\n\n\t// The token for the next set of items to return. (You use this token in the next\n\t// call.)\n\tNextToken *string\n\n\t// A list of the properties for patches matching the filter request parameters.\n\tProperties []map[string]string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchProperties{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePatchProperties{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribePatchProperties\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribePatchPropertiesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchProperties(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribePatchPropertiesAPIClient is a client that implements the\n// DescribePatchProperties operation.\ntype DescribePatchPropertiesAPIClient interface {\n\tDescribePatchProperties(context.Context, *DescribePatchPropertiesInput, ...func(*Options)) (*DescribePatchPropertiesOutput, error)\n}\n\nvar _ DescribePatchPropertiesAPIClient = (*Client)(nil)\n\n// DescribePatchPropertiesPaginatorOptions is the paginator options for\n// DescribePatchProperties\ntype DescribePatchPropertiesPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribePatchPropertiesPaginator is a paginator for DescribePatchProperties\ntype DescribePatchPropertiesPaginator struct {\n\toptions   DescribePatchPropertiesPaginatorOptions\n\tclient    DescribePatchPropertiesAPIClient\n\tparams    *DescribePatchPropertiesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribePatchPropertiesPaginator returns a new\n// DescribePatchPropertiesPaginator\nfunc NewDescribePatchPropertiesPaginator(client DescribePatchPropertiesAPIClient, params *DescribePatchPropertiesInput, optFns ...func(*DescribePatchPropertiesPaginatorOptions)) *DescribePatchPropertiesPaginator {\n\tif params == nil {\n\t\tparams = &DescribePatchPropertiesInput{}\n\t}\n\n\toptions := DescribePatchPropertiesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribePatchPropertiesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribePatchPropertiesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribePatchProperties page.\nfunc (p *DescribePatchPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchPropertiesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribePatchProperties(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribePatchProperties(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribePatchProperties\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeSessions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves a list of all active sessions (both connected and disconnected) or\n// terminated sessions from the past 30 days.\nfunc (c *Client) DescribeSessions(ctx context.Context, params *DescribeSessionsInput, optFns ...func(*Options)) (*DescribeSessionsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeSessionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeSessions\", params, optFns, c.addOperationDescribeSessionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeSessionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DescribeSessionsInput struct {\n\n\t// The session status to retrieve a list of sessions for. For example, \"Active\".\n\t//\n\t// This member is required.\n\tState types.SessionState\n\n\t// One or more filters to limit the type of sessions returned by the request.\n\tFilters []types.SessionFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DescribeSessionsOutput struct {\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// A list of sessions meeting the request parameters.\n\tSessions []types.Session\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSessions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSessions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DescribeSessions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDescribeSessionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSessions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// DescribeSessionsAPIClient is a client that implements the DescribeSessions\n// operation.\ntype DescribeSessionsAPIClient interface {\n\tDescribeSessions(context.Context, *DescribeSessionsInput, ...func(*Options)) (*DescribeSessionsOutput, error)\n}\n\nvar _ DescribeSessionsAPIClient = (*Client)(nil)\n\n// DescribeSessionsPaginatorOptions is the paginator options for DescribeSessions\ntype DescribeSessionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// DescribeSessionsPaginator is a paginator for DescribeSessions\ntype DescribeSessionsPaginator struct {\n\toptions   DescribeSessionsPaginatorOptions\n\tclient    DescribeSessionsAPIClient\n\tparams    *DescribeSessionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewDescribeSessionsPaginator returns a new DescribeSessionsPaginator\nfunc NewDescribeSessionsPaginator(client DescribeSessionsAPIClient, params *DescribeSessionsInput, optFns ...func(*DescribeSessionsPaginatorOptions)) *DescribeSessionsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeSessionsInput{}\n\t}\n\n\toptions := DescribeSessionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeSessionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *DescribeSessionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next DescribeSessions page.\nfunc (p *DescribeSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSessionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.DescribeSessions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opDescribeSessions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DescribeSessions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DisassociateOpsItemRelatedItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Deletes the association between an OpsItem and a related item. For example,\n// this API operation can delete an Incident Manager incident from an OpsItem.\n// Incident Manager is a capability of Amazon Web Services Systems Manager.\nfunc (c *Client) DisassociateOpsItemRelatedItem(ctx context.Context, params *DisassociateOpsItemRelatedItemInput, optFns ...func(*Options)) (*DisassociateOpsItemRelatedItemOutput, error) {\n\tif params == nil {\n\t\tparams = &DisassociateOpsItemRelatedItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DisassociateOpsItemRelatedItem\", params, optFns, c.addOperationDisassociateOpsItemRelatedItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DisassociateOpsItemRelatedItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DisassociateOpsItemRelatedItemInput struct {\n\n\t// The ID of the association for which you want to delete an association between\n\t// the OpsItem and a related item.\n\t//\n\t// This member is required.\n\tAssociationId *string\n\n\t// The ID of the OpsItem for which you want to delete an association between the\n\t// OpsItem and a related item.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype DisassociateOpsItemRelatedItemOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDisassociateOpsItemRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DisassociateOpsItemRelatedItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDisassociateOpsItemRelatedItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateOpsItemRelatedItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDisassociateOpsItemRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DisassociateOpsItemRelatedItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetAutomationExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Get detailed information about a particular Automation execution.\nfunc (c *Client) GetAutomationExecution(ctx context.Context, params *GetAutomationExecutionInput, optFns ...func(*Options)) (*GetAutomationExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &GetAutomationExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetAutomationExecution\", params, optFns, c.addOperationGetAutomationExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetAutomationExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetAutomationExecutionInput struct {\n\n\t// The unique identifier for an existing automation execution to examine. The\n\t// execution ID is returned by StartAutomationExecution when the execution of an\n\t// Automation runbook is initiated.\n\t//\n\t// This member is required.\n\tAutomationExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetAutomationExecutionOutput struct {\n\n\t// Detailed information about the current state of an automation execution.\n\tAutomationExecution *types.AutomationExecution\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetAutomationExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetAutomationExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAutomationExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetAutomationExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetAutomationExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCalendarState.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Gets the state of a Amazon Web Services Systems Manager change calendar at the\n// current time or a specified time. If you specify a time, GetCalendarState\n// returns the state of the calendar at that specific time, and returns the next\n// time that the change calendar state will transition. If you don't specify a\n// time, GetCalendarState uses the current time. Change Calendar entries have two\n// possible states: OPEN or CLOSED . If you specify more than one calendar in a\n// request, the command returns the status of OPEN only if all calendars in the\n// request are open. If one or more calendars in the request are closed, the status\n// returned is CLOSED . For more information about Change Calendar, a capability of\n// Amazon Web Services Systems Manager, see Amazon Web Services Systems Manager\n// Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) GetCalendarState(ctx context.Context, params *GetCalendarStateInput, optFns ...func(*Options)) (*GetCalendarStateOutput, error) {\n\tif params == nil {\n\t\tparams = &GetCalendarStateInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetCalendarState\", params, optFns, c.addOperationGetCalendarStateMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetCalendarStateOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetCalendarStateInput struct {\n\n\t// The names or Amazon Resource Names (ARNs) of the Systems Manager documents (SSM\n\t// documents) that represent the calendar entries for which you want to get the\n\t// state.\n\t//\n\t// This member is required.\n\tCalendarNames []string\n\n\t// (Optional) The specific time for which you want to get calendar state\n\t// information, in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format. If\n\t// you don't specify a value or AtTime , the current time is used.\n\tAtTime *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetCalendarStateOutput struct {\n\n\t// The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, that\n\t// you specified in your command. If you don't specify a time, GetCalendarState\n\t// uses the current time.\n\tAtTime *string\n\n\t// The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, that\n\t// the calendar state will change. If the current calendar state is OPEN ,\n\t// NextTransitionTime indicates when the calendar state changes to CLOSED , and\n\t// vice-versa.\n\tNextTransitionTime *string\n\n\t// The state of the calendar. An OPEN calendar indicates that actions are allowed\n\t// to proceed, and a CLOSED calendar indicates that actions aren't allowed to\n\t// proceed.\n\tState types.CalendarState\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCalendarState{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCalendarState{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetCalendarState\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetCalendarStateValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCalendarState(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetCalendarState(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetCalendarState\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCommandInvocation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\tsmithywaiter \"github.com/aws/smithy-go/waiter\"\n\t\"github.com/jmespath/go-jmespath\"\n\t\"time\"\n)\n\n// Returns detailed information about command execution for an invocation or\n// plugin. GetCommandInvocation only gives the execution status of a plugin in a\n// document. To get the command execution status on a specific managed node, use\n// ListCommandInvocations . To get the command execution status across managed\n// nodes, use ListCommands .\nfunc (c *Client) GetCommandInvocation(ctx context.Context, params *GetCommandInvocationInput, optFns ...func(*Options)) (*GetCommandInvocationOutput, error) {\n\tif params == nil {\n\t\tparams = &GetCommandInvocationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetCommandInvocation\", params, optFns, c.addOperationGetCommandInvocationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetCommandInvocationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetCommandInvocationInput struct {\n\n\t// (Required) The parent command ID of the invocation plugin.\n\t//\n\t// This member is required.\n\tCommandId *string\n\n\t// (Required) The ID of the managed node targeted by the command. A managed node\n\t// can be an Amazon Elastic Compute Cloud (Amazon EC2) instance, edge device, and\n\t// on-premises server or VM in your hybrid environment that is configured for\n\t// Amazon Web Services Systems Manager.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The name of the step for which you want detailed results. If the document\n\t// contains only one step, you can omit the name and details for that step. If the\n\t// document contains more than one step, you must specify the name of the step for\n\t// which you want to view details. Be sure to specify the name of the step, not the\n\t// name of a plugin like aws:RunShellScript . To find the PluginName , check the\n\t// document content and find the name of the step you want details for.\n\t// Alternatively, use ListCommandInvocations with the CommandId and Details\n\t// parameters. The PluginName is the Name attribute of the CommandPlugin object in\n\t// the CommandPlugins list.\n\tPluginName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetCommandInvocationOutput struct {\n\n\t// Amazon CloudWatch Logs information where Systems Manager sent the command\n\t// output.\n\tCloudWatchOutputConfig *types.CloudWatchOutputConfig\n\n\t// The parent command ID of the invocation plugin.\n\tCommandId *string\n\n\t// The comment text for the command.\n\tComment *string\n\n\t// The name of the document that was run. For example, AWS-RunShellScript .\n\tDocumentName *string\n\n\t// The Systems Manager document (SSM document) version used in the request.\n\tDocumentVersion *string\n\n\t// Duration since ExecutionStartDateTime .\n\tExecutionElapsedTime *string\n\n\t// The date and time the plugin finished running. Date and time are written in ISO\n\t// 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The\n\t// following sample Amazon Web Services CLI command uses the InvokedAfter filter.\n\t// aws ssm list-commands --filters key=InvokedAfter,value=2017-06-07T00:00:00Z If\n\t// the plugin hasn't started to run, the string is empty.\n\tExecutionEndDateTime *string\n\n\t// The date and time the plugin started running. Date and time are written in ISO\n\t// 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The\n\t// following sample Amazon Web Services CLI command uses the InvokedBefore filter.\n\t// aws ssm list-commands --filters key=InvokedBefore,value=2017-06-07T00:00:00Z If\n\t// the plugin hasn't started to run, the string is empty.\n\tExecutionStartDateTime *string\n\n\t// The ID of the managed node targeted by the command. A managed node can be an\n\t// Amazon Elastic Compute Cloud (Amazon EC2) instance, edge device, or on-premises\n\t// server or VM in your hybrid environment that is configured for Amazon Web\n\t// Services Systems Manager.\n\tInstanceId *string\n\n\t// The name of the plugin, or step name, for which details are reported. For\n\t// example, aws:RunShellScript is a plugin.\n\tPluginName *string\n\n\t// The error level response code for the plugin script. If the response code is -1\n\t// , then the command hasn't started running on the managed node, or it wasn't\n\t// received by the node.\n\tResponseCode int32\n\n\t// The first 8,000 characters written by the plugin to stderr . If the command\n\t// hasn't finished running, then this string is empty.\n\tStandardErrorContent *string\n\n\t// The URL for the complete text written by the plugin to stderr . If the command\n\t// hasn't finished running, then this string is empty.\n\tStandardErrorUrl *string\n\n\t// The first 24,000 characters written by the plugin to stdout . If the command\n\t// hasn't finished running, if ExecutionStatus is neither Succeeded nor Failed,\n\t// then this string is empty.\n\tStandardOutputContent *string\n\n\t// The URL for the complete text written by the plugin to stdout in Amazon Simple\n\t// Storage Service (Amazon S3). If an S3 bucket wasn't specified, then this string\n\t// is empty.\n\tStandardOutputUrl *string\n\n\t// The status of this invocation plugin. This status can be different than\n\t// StatusDetails .\n\tStatus types.CommandInvocationStatus\n\n\t// A detailed status of the command execution for an invocation. StatusDetails\n\t// includes more information than Status because it includes states resulting from\n\t// error and concurrency control parameters. StatusDetails can show different\n\t// results than Status . For more information about these statuses, see\n\t// Understanding command statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html)\n\t// in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one\n\t// of the following values:\n\t//   - Pending: The command hasn't been sent to the managed node.\n\t//   - In Progress: The command has been sent to the managed node but hasn't\n\t//   reached a terminal state.\n\t//   - Delayed: The system attempted to send the command to the target, but the\n\t//   target wasn't available. The managed node might not be available because of\n\t//   network issues, because the node was stopped, or for similar reasons. The system\n\t//   will try to send the command again.\n\t//   - Success: The command or plugin ran successfully. This is a terminal state.\n\t//   - Delivery Timed Out: The command wasn't delivered to the managed node before\n\t//   the delivery timeout expired. Delivery timeouts don't count against the parent\n\t//   command's MaxErrors limit, but they do contribute to whether the parent\n\t//   command status is Success or Incomplete. This is a terminal state.\n\t//   - Execution Timed Out: The command started to run on the managed node, but\n\t//   the execution wasn't complete before the timeout expired. Execution timeouts\n\t//   count against the MaxErrors limit of the parent command. This is a terminal\n\t//   state.\n\t//   - Failed: The command wasn't run successfully on the managed node. For a\n\t//   plugin, this indicates that the result code wasn't zero. For a command\n\t//   invocation, this indicates that the result code for one or more plugins wasn't\n\t//   zero. Invocation failures count against the MaxErrors limit of the parent\n\t//   command. This is a terminal state.\n\t//   - Cancelled: The command was terminated before it was completed. This is a\n\t//   terminal state.\n\t//   - Undeliverable: The command can't be delivered to the managed node. The node\n\t//   might not exist or might not be responding. Undeliverable invocations don't\n\t//   count against the parent command's MaxErrors limit and don't contribute to\n\t//   whether the parent command status is Success or Incomplete. This is a terminal\n\t//   state.\n\t//   - Terminated: The parent command exceeded its MaxErrors limit and subsequent\n\t//   command invocations were canceled by the system. This is a terminal state.\n\tStatusDetails *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCommandInvocation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCommandInvocation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetCommandInvocation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetCommandInvocationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommandInvocation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetCommandInvocationAPIClient is a client that implements the\n// GetCommandInvocation operation.\ntype GetCommandInvocationAPIClient interface {\n\tGetCommandInvocation(context.Context, *GetCommandInvocationInput, ...func(*Options)) (*GetCommandInvocationOutput, error)\n}\n\nvar _ GetCommandInvocationAPIClient = (*Client)(nil)\n\n// CommandExecutedWaiterOptions are waiter options for CommandExecutedWaiter\ntype CommandExecutedWaiterOptions struct {\n\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// MinDelay is the minimum amount of time to delay between retries. If unset,\n\t// CommandExecutedWaiter will use default minimum delay of 5 seconds. Note that\n\t// MinDelay must resolve to a value lesser than or equal to the MaxDelay.\n\tMinDelay time.Duration\n\n\t// MaxDelay is the maximum amount of time to delay between retries. If unset or\n\t// set to zero, CommandExecutedWaiter will use default max delay of 120 seconds.\n\t// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.\n\tMaxDelay time.Duration\n\n\t// LogWaitAttempts is used to enable logging for waiter retry attempts\n\tLogWaitAttempts bool\n\n\t// Retryable is function that can be used to override the service defined\n\t// waiter-behavior based on operation output, or returned error. This function is\n\t// used by the waiter to decide if a state is retryable or a terminal state. By\n\t// default service-modeled logic will populate this option. This option can thus be\n\t// used to define a custom waiter state with fall-back to service-modeled waiter\n\t// state mutators.The function returns an error in case of a failure state. In case\n\t// of retry state, this function returns a bool value of true and nil error, while\n\t// in case of success it returns a bool value of false and nil error.\n\tRetryable func(context.Context, *GetCommandInvocationInput, *GetCommandInvocationOutput, error) (bool, error)\n}\n\n// CommandExecutedWaiter defines the waiters for CommandExecuted\ntype CommandExecutedWaiter struct {\n\tclient GetCommandInvocationAPIClient\n\n\toptions CommandExecutedWaiterOptions\n}\n\n// NewCommandExecutedWaiter constructs a CommandExecutedWaiter.\nfunc NewCommandExecutedWaiter(client GetCommandInvocationAPIClient, optFns ...func(*CommandExecutedWaiterOptions)) *CommandExecutedWaiter {\n\toptions := CommandExecutedWaiterOptions{}\n\toptions.MinDelay = 5 * time.Second\n\toptions.MaxDelay = 120 * time.Second\n\toptions.Retryable = commandExecutedStateRetryable\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\treturn &CommandExecutedWaiter{\n\t\tclient:  client,\n\t\toptions: options,\n\t}\n}\n\n// Wait calls the waiter function for CommandExecuted waiter. The maxWaitDur is\n// the maximum wait duration the waiter will wait. The maxWaitDur is required and\n// must be greater than zero.\nfunc (w *CommandExecutedWaiter) Wait(ctx context.Context, params *GetCommandInvocationInput, maxWaitDur time.Duration, optFns ...func(*CommandExecutedWaiterOptions)) error {\n\t_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)\n\treturn err\n}\n\n// WaitForOutput calls the waiter function for CommandExecuted waiter and returns\n// the output of the successful operation. The maxWaitDur is the maximum wait\n// duration the waiter will wait. The maxWaitDur is required and must be greater\n// than zero.\nfunc (w *CommandExecutedWaiter) WaitForOutput(ctx context.Context, params *GetCommandInvocationInput, maxWaitDur time.Duration, optFns ...func(*CommandExecutedWaiterOptions)) (*GetCommandInvocationOutput, error) {\n\tif maxWaitDur <= 0 {\n\t\treturn nil, fmt.Errorf(\"maximum wait time for waiter must be greater than zero\")\n\t}\n\n\toptions := w.options\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tif options.MaxDelay <= 0 {\n\t\toptions.MaxDelay = 120 * time.Second\n\t}\n\n\tif options.MinDelay > options.MaxDelay {\n\t\treturn nil, fmt.Errorf(\"minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.\", options.MinDelay, options.MaxDelay)\n\t}\n\n\tctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)\n\tdefer cancelFn()\n\n\tlogger := smithywaiter.Logger{}\n\tremainingTime := maxWaitDur\n\n\tvar attempt int64\n\tfor {\n\n\t\tattempt++\n\t\tapiOptions := options.APIOptions\n\t\tstart := time.Now()\n\n\t\tif options.LogWaitAttempts {\n\t\t\tlogger.Attempt = attempt\n\t\t\tapiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)\n\t\t\tapiOptions = append(apiOptions, logger.AddLogger)\n\t\t}\n\n\t\tout, err := w.client.GetCommandInvocation(ctx, params, func(o *Options) {\n\t\t\to.APIOptions = append(o.APIOptions, apiOptions...)\n\t\t})\n\n\t\tretryable, err := options.Retryable(ctx, params, out, err)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !retryable {\n\t\t\treturn out, nil\n\t\t}\n\n\t\tremainingTime -= time.Since(start)\n\t\tif remainingTime < options.MinDelay || remainingTime <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// compute exponential backoff between waiter retries\n\t\tdelay, err := smithywaiter.ComputeDelay(\n\t\t\tattempt, options.MinDelay, options.MaxDelay, remainingTime,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error computing waiter delay, %w\", err)\n\t\t}\n\n\t\tremainingTime -= delay\n\t\t// sleep for the delay amount before invoking a request\n\t\tif err := smithytime.SleepWithContext(ctx, delay); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"request cancelled while waiting, %w\", err)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"exceeded max wait time for CommandExecuted waiter\")\n}\n\nfunc commandExecutedStateRetryable(ctx context.Context, input *GetCommandInvocationInput, output *GetCommandInvocationOutput, err error) (bool, error) {\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Pending\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"InProgress\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Delayed\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Success\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Cancelled\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"TimedOut\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Failed\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tpathValue, err := jmespath.Search(\"Status\", output)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error evaluating waiter state: %w\", err)\n\t\t}\n\n\t\texpectedValue := \"Cancelling\"\n\t\tvalue, ok := pathValue.(types.CommandInvocationStatus)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"waiter comparator expected types.CommandInvocationStatus value, got %T\", pathValue)\n\t\t}\n\n\t\tif string(value) == expectedValue {\n\t\t\treturn false, fmt.Errorf(\"waiter state transitioned to Failure\")\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tvar errorType *types.InvocationDoesNotExist\n\t\tif errors.As(err, &errorType) {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetCommandInvocation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetCommandInvocation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetConnectionStatus.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the Session Manager connection status for a managed node to determine\n// whether it is running and ready to receive Session Manager connections.\nfunc (c *Client) GetConnectionStatus(ctx context.Context, params *GetConnectionStatusInput, optFns ...func(*Options)) (*GetConnectionStatusOutput, error) {\n\tif params == nil {\n\t\tparams = &GetConnectionStatusInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetConnectionStatus\", params, optFns, c.addOperationGetConnectionStatusMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetConnectionStatusOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetConnectionStatusInput struct {\n\n\t// The managed node ID.\n\t//\n\t// This member is required.\n\tTarget *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetConnectionStatusOutput struct {\n\n\t// The status of the connection to the managed node. For example, 'Connected' or\n\t// 'Not Connected'.\n\tStatus types.ConnectionStatus\n\n\t// The ID of the managed node to check connection status.\n\tTarget *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetConnectionStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetConnectionStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetConnectionStatus\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetConnectionStatusValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConnectionStatus(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetConnectionStatus(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetConnectionStatus\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDefaultPatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the default patch baseline. Amazon Web Services Systems Manager\n// supports creating multiple default patch baselines. For example, you can create\n// a default patch baseline for each operating system. If you don't specify an\n// operating system value, the default patch baseline for Windows is returned.\nfunc (c *Client) GetDefaultPatchBaseline(ctx context.Context, params *GetDefaultPatchBaselineInput, optFns ...func(*Options)) (*GetDefaultPatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDefaultPatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDefaultPatchBaseline\", params, optFns, c.addOperationGetDefaultPatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDefaultPatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetDefaultPatchBaselineInput struct {\n\n\t// Returns the default patch baseline for the specified operating system.\n\tOperatingSystem types.OperatingSystem\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetDefaultPatchBaselineOutput struct {\n\n\t// The ID of the default patch baseline.\n\tBaselineId *string\n\n\t// The operating system for the returned patch baseline.\n\tOperatingSystem types.OperatingSystem\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDefaultPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDefaultPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetDefaultPatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDefaultPatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetDefaultPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetDefaultPatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDeployablePatchSnapshotForInstance.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the current snapshot for the patch baseline the managed node uses.\n// This API is primarily used by the AWS-RunPatchBaseline Systems Manager document\n// (SSM document). If you run the command locally, such as with the Command Line\n// Interface (CLI), the system attempts to use your local Amazon Web Services\n// credentials and the operation fails. To avoid this, you can run the command in\n// the Amazon Web Services Systems Manager console. Use Run Command, a capability\n// of Amazon Web Services Systems Manager, with an SSM document that enables you to\n// target a managed node with a script or command. For example, run the command\n// using the AWS-RunShellScript document or the AWS-RunPowerShellScript document.\nfunc (c *Client) GetDeployablePatchSnapshotForInstance(ctx context.Context, params *GetDeployablePatchSnapshotForInstanceInput, optFns ...func(*Options)) (*GetDeployablePatchSnapshotForInstanceOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDeployablePatchSnapshotForInstanceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDeployablePatchSnapshotForInstance\", params, optFns, c.addOperationGetDeployablePatchSnapshotForInstanceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDeployablePatchSnapshotForInstanceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetDeployablePatchSnapshotForInstanceInput struct {\n\n\t// The ID of the managed node for which the appropriate patch snapshot should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The snapshot ID provided by the user when running AWS-RunPatchBaseline .\n\t//\n\t// This member is required.\n\tSnapshotId *string\n\n\t// Defines the basic information about a patch baseline override.\n\tBaselineOverride *types.BaselineOverride\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetDeployablePatchSnapshotForInstanceOutput struct {\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\t// Returns the specific operating system (for example Windows Server 2012 or\n\t// Amazon Linux 2015.09) on the managed node for the specified patch snapshot.\n\tProduct *string\n\n\t// A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be used to\n\t// download the patch snapshot.\n\tSnapshotDownloadUrl *string\n\n\t// The user-defined snapshot ID.\n\tSnapshotId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetDeployablePatchSnapshotForInstance\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetDeployablePatchSnapshotForInstanceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeployablePatchSnapshotForInstance(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetDeployablePatchSnapshotForInstance(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetDeployablePatchSnapshotForInstance\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDocument.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Gets the contents of the specified Amazon Web Services Systems Manager document\n// (SSM document).\nfunc (c *Client) GetDocument(ctx context.Context, params *GetDocumentInput, optFns ...func(*Options)) (*GetDocumentOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDocument\", params, optFns, c.addOperationGetDocumentMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetDocumentInput struct {\n\n\t// The name of the SSM document.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// Returns the document in the specified format. The document format can be either\n\t// JSON or YAML. JSON is the default format.\n\tDocumentFormat types.DocumentFormat\n\n\t// The document version for which you want information.\n\tDocumentVersion *string\n\n\t// An optional field specifying the version of the artifact associated with the\n\t// document. For example, \"Release 12, Update 6\". This value is unique across all\n\t// versions of a document and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetDocumentOutput struct {\n\n\t// A description of the document attachments, including names, locations, sizes,\n\t// and so on.\n\tAttachmentsContent []types.AttachmentContent\n\n\t// The contents of the SSM document.\n\tContent *string\n\n\t// The date the SSM document was created.\n\tCreatedDate *time.Time\n\n\t// The friendly name of the SSM document. This value can differ for each version\n\t// of the document. If you want to update this value, see UpdateDocument .\n\tDisplayName *string\n\n\t// The document format, either JSON or YAML.\n\tDocumentFormat types.DocumentFormat\n\n\t// The document type.\n\tDocumentType types.DocumentType\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\t// A list of SSM documents required by a document. For example, an\n\t// ApplicationConfiguration document requires an ApplicationConfigurationSchema\n\t// document.\n\tRequires []types.DocumentRequires\n\n\t// The current review status of a new custom Systems Manager document (SSM\n\t// document) created by a member of your organization, or of the latest version of\n\t// an existing SSM document. Only one version of an SSM document can be in the\n\t// APPROVED state at a time. When a new version is approved, the status of the\n\t// previous version changes to REJECTED. Only one version of an SSM document can be\n\t// in review, or PENDING, at a time.\n\tReviewStatus types.ReviewStatus\n\n\t// The status of the SSM document, such as Creating , Active , Updating , Failed ,\n\t// and Deleting .\n\tStatus types.DocumentStatus\n\n\t// A message returned by Amazon Web Services Systems Manager that explains the\n\t// Status value. For example, a Failed status might be explained by the\n\t// StatusInformation message, \"The specified S3 bucket doesn't exist. Verify that\n\t// the URL of the S3 bucket is correct.\"\n\tStatusInformation *string\n\n\t// The version of the artifact associated with the document. For example, \"Release\n\t// 12, Update 6\". This value is unique across all versions of a document, and can't\n\t// be changed.\n\tVersionName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetDocument\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetDocumentValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDocument(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetDocument(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetDocument\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventory.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Query inventory information. This includes managed node status, such as Stopped\n// or Terminated .\nfunc (c *Client) GetInventory(ctx context.Context, params *GetInventoryInput, optFns ...func(*Options)) (*GetInventoryOutput, error) {\n\tif params == nil {\n\t\tparams = &GetInventoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetInventory\", params, optFns, c.addOperationGetInventoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetInventoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetInventoryInput struct {\n\n\t// Returns counts of inventory types based on one or more expressions. For\n\t// example, if you aggregate by using an expression that uses the\n\t// AWS:InstanceInformation.PlatformType type, you can see a count of how many\n\t// Windows and Linux managed nodes exist in your inventoried fleet.\n\tAggregators []types.InventoryAggregator\n\n\t// One or more filters. Use a filter to return a more specific list of results.\n\tFilters []types.InventoryFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// The list of inventory item types to return.\n\tResultAttributes []types.ResultAttribute\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetInventoryOutput struct {\n\n\t// Collection of inventory entities such as a collection of managed node inventory.\n\tEntities []types.InventoryResultEntity\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetInventory\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetInventoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInventory(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetInventoryAPIClient is a client that implements the GetInventory operation.\ntype GetInventoryAPIClient interface {\n\tGetInventory(context.Context, *GetInventoryInput, ...func(*Options)) (*GetInventoryOutput, error)\n}\n\nvar _ GetInventoryAPIClient = (*Client)(nil)\n\n// GetInventoryPaginatorOptions is the paginator options for GetInventory\ntype GetInventoryPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetInventoryPaginator is a paginator for GetInventory\ntype GetInventoryPaginator struct {\n\toptions   GetInventoryPaginatorOptions\n\tclient    GetInventoryAPIClient\n\tparams    *GetInventoryInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetInventoryPaginator returns a new GetInventoryPaginator\nfunc NewGetInventoryPaginator(client GetInventoryAPIClient, params *GetInventoryInput, optFns ...func(*GetInventoryPaginatorOptions)) *GetInventoryPaginator {\n\tif params == nil {\n\t\tparams = &GetInventoryInput{}\n\t}\n\n\toptions := GetInventoryPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetInventoryPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetInventoryPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetInventory page.\nfunc (p *GetInventoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventoryOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetInventory(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetInventory(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetInventory\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventorySchema.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Return a list of inventory type names for the account, or return a list of\n// attribute names for a specific Inventory item type.\nfunc (c *Client) GetInventorySchema(ctx context.Context, params *GetInventorySchemaInput, optFns ...func(*Options)) (*GetInventorySchemaOutput, error) {\n\tif params == nil {\n\t\tparams = &GetInventorySchemaInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetInventorySchema\", params, optFns, c.addOperationGetInventorySchemaMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetInventorySchemaOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetInventorySchemaInput struct {\n\n\t// Returns inventory schemas that support aggregation. For example, this call\n\t// returns the AWS:InstanceInformation type, because it supports aggregation based\n\t// on the PlatformName , PlatformType , and PlatformVersion attributes.\n\tAggregator bool\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// Returns the sub-type schema for a specified inventory type.\n\tSubType *bool\n\n\t// The type of inventory item to return.\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetInventorySchemaOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Inventory schemas returned by the request.\n\tSchemas []types.InventoryItemSchema\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetInventorySchema{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetInventorySchema{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetInventorySchema\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInventorySchema(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetInventorySchemaAPIClient is a client that implements the GetInventorySchema\n// operation.\ntype GetInventorySchemaAPIClient interface {\n\tGetInventorySchema(context.Context, *GetInventorySchemaInput, ...func(*Options)) (*GetInventorySchemaOutput, error)\n}\n\nvar _ GetInventorySchemaAPIClient = (*Client)(nil)\n\n// GetInventorySchemaPaginatorOptions is the paginator options for\n// GetInventorySchema\ntype GetInventorySchemaPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetInventorySchemaPaginator is a paginator for GetInventorySchema\ntype GetInventorySchemaPaginator struct {\n\toptions   GetInventorySchemaPaginatorOptions\n\tclient    GetInventorySchemaAPIClient\n\tparams    *GetInventorySchemaInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetInventorySchemaPaginator returns a new GetInventorySchemaPaginator\nfunc NewGetInventorySchemaPaginator(client GetInventorySchemaAPIClient, params *GetInventorySchemaInput, optFns ...func(*GetInventorySchemaPaginatorOptions)) *GetInventorySchemaPaginator {\n\tif params == nil {\n\t\tparams = &GetInventorySchemaInput{}\n\t}\n\n\toptions := GetInventorySchemaPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetInventorySchemaPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetInventorySchemaPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetInventorySchema page.\nfunc (p *GetInventorySchemaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventorySchemaOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetInventorySchema(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetInventorySchema(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetInventorySchema\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves a maintenance window.\nfunc (c *Client) GetMaintenanceWindow(ctx context.Context, params *GetMaintenanceWindowInput, optFns ...func(*Options)) (*GetMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMaintenanceWindow\", params, optFns, c.addOperationGetMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetMaintenanceWindowInput struct {\n\n\t// The ID of the maintenance window for which you want to retrieve information.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetMaintenanceWindowOutput struct {\n\n\t// Whether targets must be registered with the maintenance window before tasks can\n\t// be defined for those targets.\n\tAllowUnassociatedTargets bool\n\n\t// The date the maintenance window was created.\n\tCreatedDate *time.Time\n\n\t// The number of hours before the end of the maintenance window that Amazon Web\n\t// Services Systems Manager stops scheduling new tasks for execution.\n\tCutoff int32\n\n\t// The description of the maintenance window.\n\tDescription *string\n\n\t// The duration of the maintenance window in hours.\n\tDuration *int32\n\n\t// Indicates whether the maintenance window is enabled.\n\tEnabled bool\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become inactive. The maintenance window won't run after this\n\t// specified time.\n\tEndDate *string\n\n\t// The date the maintenance window was last modified.\n\tModifiedDate *time.Time\n\n\t// The name of the maintenance window.\n\tName *string\n\n\t// The next time the maintenance window will actually run, taking into account any\n\t// specified times for the maintenance window to become active or inactive.\n\tNextExecutionTime *string\n\n\t// The schedule of the maintenance window in the form of a cron or rate expression.\n\tSchedule *string\n\n\t// The number of days to wait to run a maintenance window after the scheduled cron\n\t// expression date and time.\n\tScheduleOffset *int32\n\n\t// The time zone that the scheduled maintenance window executions are based on, in\n\t// Internet Assigned Numbers Authority (IANA) format. For example:\n\t// \"America/Los_Angeles\", \"UTC\", or \"Asia/Seoul\". For more information, see the\n\t// Time Zone Database (https://www.iana.org/time-zones) on the IANA website.\n\tScheduleTimezone *string\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become active. The maintenance window won't run before this\n\t// specified time.\n\tStartDate *string\n\n\t// The ID of the created maintenance window.\n\tWindowId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves details about a specific a maintenance window execution.\nfunc (c *Client) GetMaintenanceWindowExecution(ctx context.Context, params *GetMaintenanceWindowExecutionInput, optFns ...func(*Options)) (*GetMaintenanceWindowExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMaintenanceWindowExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMaintenanceWindowExecution\", params, optFns, c.addOperationGetMaintenanceWindowExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMaintenanceWindowExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetMaintenanceWindowExecutionInput struct {\n\n\t// The ID of the maintenance window execution that includes the task.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetMaintenanceWindowExecutionOutput struct {\n\n\t// The time the maintenance window finished running.\n\tEndTime *time.Time\n\n\t// The time the maintenance window started running.\n\tStartTime *time.Time\n\n\t// The status of the maintenance window execution.\n\tStatus types.MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status. Not available for all status values.\n\tStatusDetails *string\n\n\t// The ID of the task executions from the maintenance window execution.\n\tTaskIds []string\n\n\t// The ID of the maintenance window execution.\n\tWindowExecutionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMaintenanceWindowExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetMaintenanceWindowExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetMaintenanceWindowExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetMaintenanceWindowExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetMaintenanceWindowExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTask.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves the details about a specific task run as part of a maintenance window\n// execution.\nfunc (c *Client) GetMaintenanceWindowExecutionTask(ctx context.Context, params *GetMaintenanceWindowExecutionTaskInput, optFns ...func(*Options)) (*GetMaintenanceWindowExecutionTaskOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMaintenanceWindowExecutionTaskInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMaintenanceWindowExecutionTask\", params, optFns, c.addOperationGetMaintenanceWindowExecutionTaskMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMaintenanceWindowExecutionTaskOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetMaintenanceWindowExecutionTaskInput struct {\n\n\t// The ID of the specific task execution in the maintenance window task that\n\t// should be retrieved.\n\t//\n\t// This member is required.\n\tTaskId *string\n\n\t// The ID of the maintenance window execution that includes the task.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetMaintenanceWindowExecutionTaskOutput struct {\n\n\t// The details for the CloudWatch alarm you applied to your maintenance window\n\t// task.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// The time the task execution completed.\n\tEndTime *time.Time\n\n\t// The defined maximum number of task executions that could be run in parallel.\n\tMaxConcurrency *string\n\n\t// The defined maximum number of task execution errors allowed before scheduling\n\t// of the task execution would have been stopped.\n\tMaxErrors *string\n\n\t// The priority of the task.\n\tPriority int32\n\n\t// The role that was assumed when running the task.\n\tServiceRole *string\n\n\t// The time the task execution started.\n\tStartTime *time.Time\n\n\t// The status of the task.\n\tStatus types.MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status. Not available for all status values.\n\tStatusDetails *string\n\n\t// The Amazon Resource Name (ARN) of the task that ran.\n\tTaskArn *string\n\n\t// The ID of the specific task execution in the maintenance window task that was\n\t// retrieved.\n\tTaskExecutionId *string\n\n\t// The parameters passed to the task when it was run. TaskParameters has been\n\t// deprecated. To specify parameters to pass to a task when it runs, instead use\n\t// the Parameters option in the TaskInvocationParameters structure. For\n\t// information about how Systems Manager handles these options for the supported\n\t// maintenance window task types, see MaintenanceWindowTaskInvocationParameters .\n\t// The map has the following format:\n\t//   - Key : string, between 1 and 255 characters\n\t//   - Value : an array of strings, each between 1 and 255 characters\n\tTaskParameters []map[string]types.MaintenanceWindowTaskParameterValueExpression\n\n\t// The CloudWatch alarms that were invoked by the maintenance window task.\n\tTriggeredAlarms []types.AlarmStateInformation\n\n\t// The type of task that was run.\n\tType types.MaintenanceWindowTaskType\n\n\t// The ID of the maintenance window execution that includes the task.\n\tWindowExecutionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetMaintenanceWindowExecutionTask\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetMaintenanceWindowExecutionTaskValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTask(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTask(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetMaintenanceWindowExecutionTask\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTaskInvocation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves information about a specific task running on a specific target.\nfunc (c *Client) GetMaintenanceWindowExecutionTaskInvocation(ctx context.Context, params *GetMaintenanceWindowExecutionTaskInvocationInput, optFns ...func(*Options)) (*GetMaintenanceWindowExecutionTaskInvocationOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMaintenanceWindowExecutionTaskInvocationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMaintenanceWindowExecutionTaskInvocation\", params, optFns, c.addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMaintenanceWindowExecutionTaskInvocationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetMaintenanceWindowExecutionTaskInvocationInput struct {\n\n\t// The invocation ID to retrieve.\n\t//\n\t// This member is required.\n\tInvocationId *string\n\n\t// The ID of the specific task in the maintenance window task that should be\n\t// retrieved.\n\t//\n\t// This member is required.\n\tTaskId *string\n\n\t// The ID of the maintenance window execution for which the task is a part.\n\t//\n\t// This member is required.\n\tWindowExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetMaintenanceWindowExecutionTaskInvocationOutput struct {\n\n\t// The time that the task finished running on the target.\n\tEndTime *time.Time\n\n\t// The execution ID.\n\tExecutionId *string\n\n\t// The invocation ID.\n\tInvocationId *string\n\n\t// User-provided value to be included in any Amazon CloudWatch Events or Amazon\n\t// EventBridge events raised while running tasks for these targets in this\n\t// maintenance window.\n\tOwnerInformation *string\n\n\t// The parameters used at the time that the task ran.\n\tParameters *string\n\n\t// The time that the task started running on the target.\n\tStartTime *time.Time\n\n\t// The task status for an invocation.\n\tStatus types.MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status. Details are only available for certain\n\t// status values.\n\tStatusDetails *string\n\n\t// The task execution ID.\n\tTaskExecutionId *string\n\n\t// Retrieves the task type for a maintenance window.\n\tTaskType types.MaintenanceWindowTaskType\n\n\t// The maintenance window execution ID.\n\tWindowExecutionId *string\n\n\t// The maintenance window target ID.\n\tWindowTargetId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTaskInvocation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetMaintenanceWindowExecutionTaskInvocation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetMaintenanceWindowExecutionTaskInvocationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTaskInvocation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTaskInvocation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetMaintenanceWindowExecutionTaskInvocation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowTask.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the details of a maintenance window task. For maintenance window\n// tasks without a specified target, you can't supply values for --max-errors and\n// --max-concurrency . Instead, the system inserts a placeholder value of 1 , which\n// may be reported in the response to this command. These values don't affect the\n// running of your task and can be ignored. To retrieve a list of tasks in a\n// maintenance window, instead use the DescribeMaintenanceWindowTasks command.\nfunc (c *Client) GetMaintenanceWindowTask(ctx context.Context, params *GetMaintenanceWindowTaskInput, optFns ...func(*Options)) (*GetMaintenanceWindowTaskOutput, error) {\n\tif params == nil {\n\t\tparams = &GetMaintenanceWindowTaskInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetMaintenanceWindowTask\", params, optFns, c.addOperationGetMaintenanceWindowTaskMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetMaintenanceWindowTaskOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetMaintenanceWindowTaskInput struct {\n\n\t// The maintenance window ID that includes the task to retrieve.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The maintenance window task ID to retrieve.\n\t//\n\t// This member is required.\n\tWindowTaskId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetMaintenanceWindowTaskOutput struct {\n\n\t// The details for the CloudWatch alarm you applied to your maintenance window\n\t// task.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// The action to take on tasks when the maintenance window cutoff time is reached.\n\t// CONTINUE_TASK means that tasks continue to run. For Automation, Lambda, Step\n\t// Functions tasks, CANCEL_TASK means that currently running task invocations\n\t// continue, but no new task invocations are started. For Run Command tasks,\n\t// CANCEL_TASK means the system attempts to stop the task by sending a\n\t// CancelCommand operation.\n\tCutoffBehavior types.MaintenanceWindowTaskCutoffBehavior\n\n\t// The retrieved task description.\n\tDescription *string\n\n\t// The location in Amazon Simple Storage Service (Amazon S3) where the task\n\t// results are logged. LoggingInfo has been deprecated. To specify an Amazon\n\t// Simple Storage Service (Amazon S3) bucket to contain logs, instead use the\n\t// OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters\n\t// structure. For information about how Amazon Web Services Systems Manager handles\n\t// these options for the supported maintenance window task types, see\n\t// MaintenanceWindowTaskInvocationParameters .\n\tLoggingInfo *types.LoggingInfo\n\n\t// The maximum number of targets allowed to run this task in parallel. For\n\t// maintenance window tasks without a target specified, you can't supply a value\n\t// for this option. Instead, the system inserts a placeholder value of 1 , which\n\t// may be reported in the response to this command. This value doesn't affect the\n\t// running of your task and can be ignored.\n\tMaxConcurrency *string\n\n\t// The maximum number of errors allowed before the task stops being scheduled. For\n\t// maintenance window tasks without a target specified, you can't supply a value\n\t// for this option. Instead, the system inserts a placeholder value of 1 , which\n\t// may be reported in the response to this command. This value doesn't affect the\n\t// running of your task and can be ignored.\n\tMaxErrors *string\n\n\t// The retrieved task name.\n\tName *string\n\n\t// The priority of the task when it runs. The lower the number, the higher the\n\t// priority. Tasks that have the same priority are scheduled in parallel.\n\tPriority int32\n\n\t// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM)\n\t// service role to use to publish Amazon Simple Notification Service (Amazon SNS)\n\t// notifications for maintenance window Run Command tasks.\n\tServiceRoleArn *string\n\n\t// The targets where the task should run.\n\tTargets []types.Target\n\n\t// The resource that the task used during execution. For RUN_COMMAND and AUTOMATION\n\t// task types, the value of TaskArn is the SSM document name/ARN. For LAMBDA\n\t// tasks, the value is the function name/ARN. For STEP_FUNCTIONS tasks, the value\n\t// is the state machine ARN.\n\tTaskArn *string\n\n\t// The parameters to pass to the task when it runs.\n\tTaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters\n\n\t// The parameters to pass to the task when it runs. TaskParameters has been\n\t// deprecated. To specify parameters to pass to a task when it runs, instead use\n\t// the Parameters option in the TaskInvocationParameters structure. For\n\t// information about how Systems Manager handles these options for the supported\n\t// maintenance window task types, see MaintenanceWindowTaskInvocationParameters .\n\tTaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression\n\n\t// The type of task to run.\n\tTaskType types.MaintenanceWindowTaskType\n\n\t// The retrieved maintenance window ID.\n\tWindowId *string\n\n\t// The retrieved maintenance window task ID.\n\tWindowTaskId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMaintenanceWindowTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetMaintenanceWindowTask\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetMaintenanceWindowTaskValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowTask(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetMaintenanceWindowTask(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetMaintenanceWindowTask\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Get information about an OpsItem by using the ID. You must have permission in\n// Identity and Access Management (IAM) to view information about an OpsItem. For\n// more information, see Set up OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html)\n// in the Amazon Web Services Systems Manager User Guide. Operations engineers and\n// IT professionals use Amazon Web Services Systems Manager OpsCenter to view,\n// investigate, and remediate operational issues impacting the performance and\n// health of their Amazon Web Services resources. For more information, see\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) GetOpsItem(ctx context.Context, params *GetOpsItemInput, optFns ...func(*Options)) (*GetOpsItemOutput, error) {\n\tif params == nil {\n\t\tparams = &GetOpsItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetOpsItem\", params, optFns, c.addOperationGetOpsItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetOpsItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetOpsItemInput struct {\n\n\t// The ID of the OpsItem that you want to get.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\t// The OpsItem Amazon Resource Name (ARN).\n\tOpsItemArn *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetOpsItemOutput struct {\n\n\t// The OpsItem.\n\tOpsItem *types.OpsItem\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetOpsItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetOpsItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetOpsItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetOpsItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// View operational metadata related to an application in Application Manager.\nfunc (c *Client) GetOpsMetadata(ctx context.Context, params *GetOpsMetadataInput, optFns ...func(*Options)) (*GetOpsMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &GetOpsMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetOpsMetadata\", params, optFns, c.addOperationGetOpsMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetOpsMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetOpsMetadataInput struct {\n\n\t// The Amazon Resource Name (ARN) of an OpsMetadata Object to view.\n\t//\n\t// This member is required.\n\tOpsMetadataArn *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetOpsMetadataOutput struct {\n\n\t// OpsMetadata for an Application Manager application.\n\tMetadata map[string]types.MetadataValue\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// The resource ID of the Application Manager application.\n\tResourceId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetOpsMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetOpsMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetOpsMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsSummary.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// View a summary of operations metadata (OpsData) based on specified filters and\n// aggregators. OpsData can include information about Amazon Web Services Systems\n// Manager OpsCenter operational workitems (OpsItems) as well as information about\n// any Amazon Web Services resource or service configured to report OpsData to\n// Amazon Web Services Systems Manager Explorer.\nfunc (c *Client) GetOpsSummary(ctx context.Context, params *GetOpsSummaryInput, optFns ...func(*Options)) (*GetOpsSummaryOutput, error) {\n\tif params == nil {\n\t\tparams = &GetOpsSummaryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetOpsSummary\", params, optFns, c.addOperationGetOpsSummaryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetOpsSummaryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetOpsSummaryInput struct {\n\n\t// Optional aggregators that return counts of OpsData based on one or more\n\t// expressions.\n\tAggregators []types.OpsAggregator\n\n\t// Optional filters used to scope down the returned OpsData.\n\tFilters []types.OpsFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\t// The OpsData data type to return.\n\tResultAttributes []types.OpsResultAttribute\n\n\t// Specify the name of a resource data sync to get.\n\tSyncName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetOpsSummaryOutput struct {\n\n\t// The list of aggregated details and filtered OpsData.\n\tEntities []types.OpsEntity\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsSummary{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetOpsSummary{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetOpsSummary\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetOpsSummaryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsSummary(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetOpsSummaryAPIClient is a client that implements the GetOpsSummary operation.\ntype GetOpsSummaryAPIClient interface {\n\tGetOpsSummary(context.Context, *GetOpsSummaryInput, ...func(*Options)) (*GetOpsSummaryOutput, error)\n}\n\nvar _ GetOpsSummaryAPIClient = (*Client)(nil)\n\n// GetOpsSummaryPaginatorOptions is the paginator options for GetOpsSummary\ntype GetOpsSummaryPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetOpsSummaryPaginator is a paginator for GetOpsSummary\ntype GetOpsSummaryPaginator struct {\n\toptions   GetOpsSummaryPaginatorOptions\n\tclient    GetOpsSummaryAPIClient\n\tparams    *GetOpsSummaryInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetOpsSummaryPaginator returns a new GetOpsSummaryPaginator\nfunc NewGetOpsSummaryPaginator(client GetOpsSummaryAPIClient, params *GetOpsSummaryInput, optFns ...func(*GetOpsSummaryPaginatorOptions)) *GetOpsSummaryPaginator {\n\tif params == nil {\n\t\tparams = &GetOpsSummaryInput{}\n\t}\n\n\toptions := GetOpsSummaryPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetOpsSummaryPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetOpsSummaryPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetOpsSummary page.\nfunc (p *GetOpsSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOpsSummaryOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetOpsSummary(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetOpsSummary(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetOpsSummary\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameter.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Get information about a single parameter by specifying the parameter name. To\n// get information about more than one parameter at a time, use the GetParameters\n// operation.\nfunc (c *Client) GetParameter(ctx context.Context, params *GetParameterInput, optFns ...func(*Options)) (*GetParameterOutput, error) {\n\tif params == nil {\n\t\tparams = &GetParameterInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetParameter\", params, optFns, c.addOperationGetParameterMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetParameterOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetParameterInput struct {\n\n\t// The name of the parameter you want to query. To query by parameter label, use\n\t// \"Name\": \"name:label\" . To query by parameter version, use \"Name\": \"name:version\"\n\t// .\n\t//\n\t// This member is required.\n\tName *string\n\n\t// Return decrypted values for secure string parameters. This flag is ignored for\n\t// String and StringList parameter types.\n\tWithDecryption *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetParameterOutput struct {\n\n\t// Information about a parameter.\n\tParameter *types.Parameter\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetParameterMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetParameter\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetParameterValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameter(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetParameter(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetParameter\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameterHistory.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the history of all changes to a parameter. If you change the KMS key\n// alias for the KMS key used to encrypt a parameter, then you must also update the\n// key alias the parameter uses to reference KMS. Otherwise, GetParameterHistory\n// retrieves whatever the original key alias was referencing.\nfunc (c *Client) GetParameterHistory(ctx context.Context, params *GetParameterHistoryInput, optFns ...func(*Options)) (*GetParameterHistoryOutput, error) {\n\tif params == nil {\n\t\tparams = &GetParameterHistoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetParameterHistory\", params, optFns, c.addOperationGetParameterHistoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetParameterHistoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetParameterHistoryInput struct {\n\n\t// The name of the parameter for which you want to review history.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// Return decrypted values for secure string parameters. This flag is ignored for\n\t// String and StringList parameter types.\n\tWithDecryption *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetParameterHistoryOutput struct {\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// A list of parameters returned by the request.\n\tParameters []types.ParameterHistory\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameterHistory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetParameterHistory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetParameterHistory\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetParameterHistoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameterHistory(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetParameterHistoryAPIClient is a client that implements the\n// GetParameterHistory operation.\ntype GetParameterHistoryAPIClient interface {\n\tGetParameterHistory(context.Context, *GetParameterHistoryInput, ...func(*Options)) (*GetParameterHistoryOutput, error)\n}\n\nvar _ GetParameterHistoryAPIClient = (*Client)(nil)\n\n// GetParameterHistoryPaginatorOptions is the paginator options for\n// GetParameterHistory\ntype GetParameterHistoryPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetParameterHistoryPaginator is a paginator for GetParameterHistory\ntype GetParameterHistoryPaginator struct {\n\toptions   GetParameterHistoryPaginatorOptions\n\tclient    GetParameterHistoryAPIClient\n\tparams    *GetParameterHistoryInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetParameterHistoryPaginator returns a new GetParameterHistoryPaginator\nfunc NewGetParameterHistoryPaginator(client GetParameterHistoryAPIClient, params *GetParameterHistoryInput, optFns ...func(*GetParameterHistoryPaginatorOptions)) *GetParameterHistoryPaginator {\n\tif params == nil {\n\t\tparams = &GetParameterHistoryInput{}\n\t}\n\n\toptions := GetParameterHistoryPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetParameterHistoryPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetParameterHistoryPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetParameterHistory page.\nfunc (p *GetParameterHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParameterHistoryOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetParameterHistory(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetParameterHistory(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetParameterHistory\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameters.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Get information about one or more parameters by specifying multiple parameter\n// names. To get information about a single parameter, you can use the GetParameter\n// operation instead.\nfunc (c *Client) GetParameters(ctx context.Context, params *GetParametersInput, optFns ...func(*Options)) (*GetParametersOutput, error) {\n\tif params == nil {\n\t\tparams = &GetParametersInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetParameters\", params, optFns, c.addOperationGetParametersMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetParametersOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetParametersInput struct {\n\n\t// Names of the parameters for which you want to query information. To query by\n\t// parameter label, use \"Name\": \"name:label\" . To query by parameter version, use\n\t// \"Name\": \"name:version\" .\n\t//\n\t// This member is required.\n\tNames []string\n\n\t// Return decrypted secure string value. Return decrypted values for secure string\n\t// parameters. This flag is ignored for String and StringList parameter types.\n\tWithDecryption *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetParametersOutput struct {\n\n\t// A list of parameters that aren't formatted correctly or don't run during an\n\t// execution.\n\tInvalidParameters []string\n\n\t// A list of details for a parameter.\n\tParameters []types.Parameter\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetParametersMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetParameters{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetParameters\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetParametersValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameters(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetParameters(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetParameters\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParametersByPath.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieve information about one or more parameters in a specific hierarchy.\n// Request results are returned on a best-effort basis. If you specify MaxResults\n// in the request, the response includes information up to the limit specified. The\n// number of items returned, however, can be between zero and the value of\n// MaxResults . If the service reaches an internal limit while processing the\n// results, it stops the operation and returns the matching values up to that point\n// and a NextToken . You can specify the NextToken in a subsequent call to get the\n// next set of results.\nfunc (c *Client) GetParametersByPath(ctx context.Context, params *GetParametersByPathInput, optFns ...func(*Options)) (*GetParametersByPathOutput, error) {\n\tif params == nil {\n\t\tparams = &GetParametersByPathInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetParametersByPath\", params, optFns, c.addOperationGetParametersByPathMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetParametersByPathOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetParametersByPathInput struct {\n\n\t// The hierarchy for the parameter. Hierarchies start with a forward slash (/).\n\t// The hierarchy is the parameter name except the last part of the parameter. For\n\t// the API call to succeed, the last part of the parameter name can't be in the\n\t// path. A parameter name hierarchy can have a maximum of 15 levels. Here is an\n\t// example of a hierarchy: /Finance/Prod/IAD/WinServ2016/license33\n\t//\n\t// This member is required.\n\tPath *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\t// Filters to limit the request results. The following Key values are supported\n\t// for GetParametersByPath : Type , KeyId , and Label . The following Key values\n\t// aren't supported for GetParametersByPath : tag , DataType , Name , Path , and\n\t// Tier .\n\tParameterFilters []types.ParameterStringFilter\n\n\t// Retrieve all parameters within a hierarchy. If a user has access to a path,\n\t// then the user can access all levels of that path. For example, if a user has\n\t// permission to access path /a , then the user can also access /a/b . Even if a\n\t// user has explicitly been denied access in IAM for parameter /a/b , they can\n\t// still call the GetParametersByPath API operation recursively for /a and view\n\t// /a/b .\n\tRecursive *bool\n\n\t// Retrieve all parameters in a hierarchy with their value decrypted.\n\tWithDecryption *bool\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetParametersByPathOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A list of parameters found in the specified hierarchy.\n\tParameters []types.Parameter\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParametersByPath{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetParametersByPath{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetParametersByPath\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetParametersByPathValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParametersByPath(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetParametersByPathAPIClient is a client that implements the\n// GetParametersByPath operation.\ntype GetParametersByPathAPIClient interface {\n\tGetParametersByPath(context.Context, *GetParametersByPathInput, ...func(*Options)) (*GetParametersByPathOutput, error)\n}\n\nvar _ GetParametersByPathAPIClient = (*Client)(nil)\n\n// GetParametersByPathPaginatorOptions is the paginator options for\n// GetParametersByPath\ntype GetParametersByPathPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetParametersByPathPaginator is a paginator for GetParametersByPath\ntype GetParametersByPathPaginator struct {\n\toptions   GetParametersByPathPaginatorOptions\n\tclient    GetParametersByPathAPIClient\n\tparams    *GetParametersByPathInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetParametersByPathPaginator returns a new GetParametersByPathPaginator\nfunc NewGetParametersByPathPaginator(client GetParametersByPathAPIClient, params *GetParametersByPathInput, optFns ...func(*GetParametersByPathPaginatorOptions)) *GetParametersByPathPaginator {\n\tif params == nil {\n\t\tparams = &GetParametersByPathInput{}\n\t}\n\n\toptions := GetParametersByPathPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetParametersByPathPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetParametersByPathPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetParametersByPath page.\nfunc (p *GetParametersByPathPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParametersByPathOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetParametersByPath(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetParametersByPath(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetParametersByPath\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Retrieves information about a patch baseline.\nfunc (c *Client) GetPatchBaseline(ctx context.Context, params *GetPatchBaselineInput, optFns ...func(*Options)) (*GetPatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &GetPatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetPatchBaseline\", params, optFns, c.addOperationGetPatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetPatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetPatchBaselineInput struct {\n\n\t// The ID of the patch baseline to retrieve. To retrieve information about an\n\t// Amazon Web Services managed patch baseline, specify the full Amazon Resource\n\t// Name (ARN) of the baseline. For example, for the baseline\n\t// AWS-AmazonLinuxDefaultPatchBaseline , specify\n\t// arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7 instead of\n\t// pb-0e392de35e7c563b7 .\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetPatchBaselineOutput struct {\n\n\t// A set of rules used to include patches in the baseline.\n\tApprovalRules *types.PatchRuleGroup\n\n\t// A list of explicitly approved patches for the baseline.\n\tApprovedPatches []string\n\n\t// Returns the specified compliance severity level for approved patches in the\n\t// patch baseline.\n\tApprovedPatchesComplianceLevel types.PatchComplianceLevel\n\n\t// Indicates whether the list of approved patches includes non-security updates\n\t// that should be applied to the managed nodes. The default value is false .\n\t// Applies to Linux managed nodes only.\n\tApprovedPatchesEnableNonSecurity *bool\n\n\t// The ID of the retrieved patch baseline.\n\tBaselineId *string\n\n\t// The date the patch baseline was created.\n\tCreatedDate *time.Time\n\n\t// A description of the patch baseline.\n\tDescription *string\n\n\t// A set of global filters used to exclude patches from the baseline.\n\tGlobalFilters *types.PatchFilterGroup\n\n\t// The date the patch baseline was last modified.\n\tModifiedDate *time.Time\n\n\t// The name of the patch baseline.\n\tName *string\n\n\t// Returns the operating system specified for the patch baseline.\n\tOperatingSystem types.OperatingSystem\n\n\t// Patch groups included in the patch baseline.\n\tPatchGroups []string\n\n\t// A list of explicitly rejected patches for the baseline.\n\tRejectedPatches []string\n\n\t// The action specified to take on patches included in the RejectedPatches list. A\n\t// patch can be allowed only if it is a dependency of another package, or blocked\n\t// entirely along with packages that include it as a dependency.\n\tRejectedPatchesAction types.PatchAction\n\n\t// Information about the patches to use to update the managed nodes, including\n\t// target operating systems and source repositories. Applies to Linux managed nodes\n\t// only.\n\tSources []types.PatchSource\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetPatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetPatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetPatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaselineForPatchGroup.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves the patch baseline that should be used for the specified patch group.\nfunc (c *Client) GetPatchBaselineForPatchGroup(ctx context.Context, params *GetPatchBaselineForPatchGroupInput, optFns ...func(*Options)) (*GetPatchBaselineForPatchGroupOutput, error) {\n\tif params == nil {\n\t\tparams = &GetPatchBaselineForPatchGroupInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetPatchBaselineForPatchGroup\", params, optFns, c.addOperationGetPatchBaselineForPatchGroupMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetPatchBaselineForPatchGroupOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetPatchBaselineForPatchGroupInput struct {\n\n\t// The name of the patch group whose patch baseline should be retrieved.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\t// Returns the operating system rule specified for patch groups using the patch\n\t// baseline.\n\tOperatingSystem types.OperatingSystem\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetPatchBaselineForPatchGroupOutput struct {\n\n\t// The ID of the patch baseline that should be used for the patch group.\n\tBaselineId *string\n\n\t// The operating system rule specified for patch groups using the patch baseline.\n\tOperatingSystem types.OperatingSystem\n\n\t// The name of the patch group.\n\tPatchGroup *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetPatchBaselineForPatchGroup\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetPatchBaselineForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetPatchBaselineForPatchGroup\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetResourcePolicies.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns an array of the Policy object.\nfunc (c *Client) GetResourcePolicies(ctx context.Context, params *GetResourcePoliciesInput, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) {\n\tif params == nil {\n\t\tparams = &GetResourcePoliciesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetResourcePolicies\", params, optFns, c.addOperationGetResourcePoliciesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetResourcePoliciesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetResourcePoliciesInput struct {\n\n\t// Amazon Resource Name (ARN) of the resource to which the policies are attached.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetResourcePoliciesOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// An array of the Policy object.\n\tPolicies []types.GetResourcePoliciesResponseEntry\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetResourcePoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourcePolicies{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResourcePolicies{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetResourcePolicies\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetResourcePoliciesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicies(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// GetResourcePoliciesAPIClient is a client that implements the\n// GetResourcePolicies operation.\ntype GetResourcePoliciesAPIClient interface {\n\tGetResourcePolicies(context.Context, *GetResourcePoliciesInput, ...func(*Options)) (*GetResourcePoliciesOutput, error)\n}\n\nvar _ GetResourcePoliciesAPIClient = (*Client)(nil)\n\n// GetResourcePoliciesPaginatorOptions is the paginator options for\n// GetResourcePolicies\ntype GetResourcePoliciesPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// GetResourcePoliciesPaginator is a paginator for GetResourcePolicies\ntype GetResourcePoliciesPaginator struct {\n\toptions   GetResourcePoliciesPaginatorOptions\n\tclient    GetResourcePoliciesAPIClient\n\tparams    *GetResourcePoliciesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewGetResourcePoliciesPaginator returns a new GetResourcePoliciesPaginator\nfunc NewGetResourcePoliciesPaginator(client GetResourcePoliciesAPIClient, params *GetResourcePoliciesInput, optFns ...func(*GetResourcePoliciesPaginatorOptions)) *GetResourcePoliciesPaginator {\n\tif params == nil {\n\t\tparams = &GetResourcePoliciesInput{}\n\t}\n\n\toptions := GetResourcePoliciesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &GetResourcePoliciesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *GetResourcePoliciesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next GetResourcePolicies page.\nfunc (p *GetResourcePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetResourcePolicies(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opGetResourcePolicies(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetResourcePolicies\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetServiceSetting.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ServiceSetting is an account-level setting for an Amazon Web Services service.\n// This setting defines how a user interacts with or uses a service or a feature of\n// a service. For example, if an Amazon Web Services service charges money to the\n// account based on feature or service usage, then the Amazon Web Services service\n// team might create a default setting of false . This means the user can't use\n// this feature unless they change the setting to true and intentionally opt in\n// for a paid feature. Services map a SettingId object to a setting value. Amazon\n// Web Services services teams define the default value for a SettingId . You can't\n// create a new SettingId , but you can overwrite the default value if you have the\n// ssm:UpdateServiceSetting permission for the setting. Use the\n// UpdateServiceSetting API operation to change the default setting. Or use the\n// ResetServiceSetting to change the value back to the original value defined by\n// the Amazon Web Services service team. Query the current service setting for the\n// Amazon Web Services account.\nfunc (c *Client) GetServiceSetting(ctx context.Context, params *GetServiceSettingInput, optFns ...func(*Options)) (*GetServiceSettingOutput, error) {\n\tif params == nil {\n\t\tparams = &GetServiceSettingInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetServiceSetting\", params, optFns, c.addOperationGetServiceSettingMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetServiceSettingOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// The request body of the GetServiceSetting API operation.\ntype GetServiceSettingInput struct {\n\n\t// The ID of the service setting to get. The setting ID can be one of the\n\t// following.\n\t//   - /ssm/managed-instance/default-ec2-instance-management-role\n\t//   - /ssm/automation/customer-script-log-destination\n\t//   - /ssm/automation/customer-script-log-group-name\n\t//   - /ssm/documents/console/public-sharing-permission\n\t//   - /ssm/managed-instance/activation-tier\n\t//   - /ssm/opsinsights/opscenter\n\t//   - /ssm/parameter-store/default-parameter-tier\n\t//   - /ssm/parameter-store/high-throughput-enabled\n\t//\n\t// This member is required.\n\tSettingId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The query result body of the GetServiceSetting API operation.\ntype GetServiceSettingOutput struct {\n\n\t// The query result of the current service setting.\n\tServiceSetting *types.ServiceSetting\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpGetServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetServiceSetting\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetServiceSettingValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceSetting(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetServiceSetting(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetServiceSetting\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_LabelParameterVersion.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// A parameter label is a user-defined alias to help you manage different versions\n// of a parameter. When you modify a parameter, Amazon Web Services Systems Manager\n// automatically saves a new version and increments the version number by one. A\n// label can help you remember the purpose of a parameter when there are multiple\n// versions. Parameter labels have the following requirements and restrictions.\n//   - A version of a parameter can have a maximum of 10 labels.\n//   - You can't attach the same label to different versions of the same\n//     parameter. For example, if version 1 has the label Production, then you can't\n//     attach Production to version 2.\n//   - You can move a label from one version of a parameter to another.\n//   - You can't create a label when you create a new parameter. You must attach a\n//     label to a specific version of a parameter.\n//   - If you no longer want to use a parameter label, then you can either delete\n//     it or move it to a different version of a parameter.\n//   - A label can have a maximum of 100 characters.\n//   - Labels can contain letters (case sensitive), numbers, periods (.), hyphens\n//     (-), or underscores (_).\n//   - Labels can't begin with a number, \" aws \" or \" ssm \" (not case sensitive).\n//     If a label fails to meet these requirements, then the label isn't associated\n//     with a parameter and the system displays it in the list of InvalidLabels.\nfunc (c *Client) LabelParameterVersion(ctx context.Context, params *LabelParameterVersionInput, optFns ...func(*Options)) (*LabelParameterVersionOutput, error) {\n\tif params == nil {\n\t\tparams = &LabelParameterVersionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"LabelParameterVersion\", params, optFns, c.addOperationLabelParameterVersionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*LabelParameterVersionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype LabelParameterVersionInput struct {\n\n\t// One or more labels to attach to the specified parameter version.\n\t//\n\t// This member is required.\n\tLabels []string\n\n\t// The parameter name on which you want to attach one or more labels.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The specific version of the parameter on which you want to attach one or more\n\t// labels. If no version is specified, the system attaches the label to the latest\n\t// version.\n\tParameterVersion *int64\n\n\tnoSmithyDocumentSerde\n}\n\ntype LabelParameterVersionOutput struct {\n\n\t// The label doesn't meet the requirements. For information about parameter label\n\t// requirements, see Labeling parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tInvalidLabels []string\n\n\t// The version of the parameter that has been labeled.\n\tParameterVersion int64\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpLabelParameterVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpLabelParameterVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"LabelParameterVersion\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpLabelParameterVersionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opLabelParameterVersion(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opLabelParameterVersion(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"LabelParameterVersion\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociationVersions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Retrieves all versions of an association for a specific association ID.\nfunc (c *Client) ListAssociationVersions(ctx context.Context, params *ListAssociationVersionsInput, optFns ...func(*Options)) (*ListAssociationVersionsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListAssociationVersionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListAssociationVersions\", params, optFns, c.addOperationListAssociationVersionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListAssociationVersionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListAssociationVersionsInput struct {\n\n\t// The association ID for which you want to view all versions.\n\t//\n\t// This member is required.\n\tAssociationId *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListAssociationVersionsOutput struct {\n\n\t// Information about all versions of the association for the specified association\n\t// ID.\n\tAssociationVersions []types.AssociationVersionInfo\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssociationVersions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssociationVersions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListAssociationVersions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListAssociationVersionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociationVersions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListAssociationVersionsAPIClient is a client that implements the\n// ListAssociationVersions operation.\ntype ListAssociationVersionsAPIClient interface {\n\tListAssociationVersions(context.Context, *ListAssociationVersionsInput, ...func(*Options)) (*ListAssociationVersionsOutput, error)\n}\n\nvar _ ListAssociationVersionsAPIClient = (*Client)(nil)\n\n// ListAssociationVersionsPaginatorOptions is the paginator options for\n// ListAssociationVersions\ntype ListAssociationVersionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListAssociationVersionsPaginator is a paginator for ListAssociationVersions\ntype ListAssociationVersionsPaginator struct {\n\toptions   ListAssociationVersionsPaginatorOptions\n\tclient    ListAssociationVersionsAPIClient\n\tparams    *ListAssociationVersionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListAssociationVersionsPaginator returns a new\n// ListAssociationVersionsPaginator\nfunc NewListAssociationVersionsPaginator(client ListAssociationVersionsAPIClient, params *ListAssociationVersionsInput, optFns ...func(*ListAssociationVersionsPaginatorOptions)) *ListAssociationVersionsPaginator {\n\tif params == nil {\n\t\tparams = &ListAssociationVersionsInput{}\n\t}\n\n\toptions := ListAssociationVersionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListAssociationVersionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListAssociationVersionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListAssociationVersions page.\nfunc (p *ListAssociationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationVersionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListAssociationVersions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListAssociationVersions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListAssociationVersions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociations.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns all State Manager associations in the current Amazon Web Services\n// account and Amazon Web Services Region. You can limit the results to a specific\n// State Manager association document or managed node by specifying a filter. State\n// Manager is a capability of Amazon Web Services Systems Manager.\nfunc (c *Client) ListAssociations(ctx context.Context, params *ListAssociationsInput, optFns ...func(*Options)) (*ListAssociationsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListAssociationsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListAssociations\", params, optFns, c.addOperationListAssociationsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListAssociationsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListAssociationsInput struct {\n\n\t// One or more filters. Use a filter to return a more specific list of results.\n\t// Filtering associations using the InstanceID attribute only returns legacy\n\t// associations created using the InstanceID attribute. Associations targeting the\n\t// managed node that are part of the Target Attributes ResourceGroup or Tags\n\t// aren't returned.\n\tAssociationFilterList []types.AssociationFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListAssociationsOutput struct {\n\n\t// The associations.\n\tAssociations []types.Association\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssociations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssociations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListAssociations\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListAssociationsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociations(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListAssociationsAPIClient is a client that implements the ListAssociations\n// operation.\ntype ListAssociationsAPIClient interface {\n\tListAssociations(context.Context, *ListAssociationsInput, ...func(*Options)) (*ListAssociationsOutput, error)\n}\n\nvar _ ListAssociationsAPIClient = (*Client)(nil)\n\n// ListAssociationsPaginatorOptions is the paginator options for ListAssociations\ntype ListAssociationsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListAssociationsPaginator is a paginator for ListAssociations\ntype ListAssociationsPaginator struct {\n\toptions   ListAssociationsPaginatorOptions\n\tclient    ListAssociationsAPIClient\n\tparams    *ListAssociationsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListAssociationsPaginator returns a new ListAssociationsPaginator\nfunc NewListAssociationsPaginator(client ListAssociationsAPIClient, params *ListAssociationsInput, optFns ...func(*ListAssociationsPaginatorOptions)) *ListAssociationsPaginator {\n\tif params == nil {\n\t\tparams = &ListAssociationsInput{}\n\t}\n\n\toptions := ListAssociationsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListAssociationsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListAssociationsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListAssociations page.\nfunc (p *ListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListAssociations(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListAssociations(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListAssociations\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommandInvocations.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// An invocation is copy of a command sent to a specific managed node. A command\n// can apply to one or more managed nodes. A command invocation applies to one\n// managed node. For example, if a user runs SendCommand against three managed\n// nodes, then a command invocation is created for each requested managed node ID.\n// ListCommandInvocations provide status about command execution.\nfunc (c *Client) ListCommandInvocations(ctx context.Context, params *ListCommandInvocationsInput, optFns ...func(*Options)) (*ListCommandInvocationsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListCommandInvocationsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListCommandInvocations\", params, optFns, c.addOperationListCommandInvocationsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListCommandInvocationsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListCommandInvocationsInput struct {\n\n\t// (Optional) The invocations for a specific command ID.\n\tCommandId *string\n\n\t// (Optional) If set this returns the response of the command executions and any\n\t// command output. The default value is false .\n\tDetails bool\n\n\t// (Optional) One or more filters. Use a filter to return a more specific list of\n\t// results.\n\tFilters []types.CommandFilter\n\n\t// (Optional) The command execution details for a specific managed node ID.\n\tInstanceId *string\n\n\t// (Optional) The maximum number of items to return for this call. The call also\n\t// returns a token that you can specify in a subsequent call to get the next set of\n\t// results.\n\tMaxResults *int32\n\n\t// (Optional) The token for the next set of items to return. (You received this\n\t// token from a previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListCommandInvocationsOutput struct {\n\n\t// (Optional) A list of all invocations.\n\tCommandInvocations []types.CommandInvocation\n\n\t// (Optional) The token for the next set of items to return. (You received this\n\t// token from a previous call.)\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommandInvocations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCommandInvocations{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListCommandInvocations\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListCommandInvocationsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommandInvocations(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListCommandInvocationsAPIClient is a client that implements the\n// ListCommandInvocations operation.\ntype ListCommandInvocationsAPIClient interface {\n\tListCommandInvocations(context.Context, *ListCommandInvocationsInput, ...func(*Options)) (*ListCommandInvocationsOutput, error)\n}\n\nvar _ ListCommandInvocationsAPIClient = (*Client)(nil)\n\n// ListCommandInvocationsPaginatorOptions is the paginator options for\n// ListCommandInvocations\ntype ListCommandInvocationsPaginatorOptions struct {\n\t// (Optional) The maximum number of items to return for this call. The call also\n\t// returns a token that you can specify in a subsequent call to get the next set of\n\t// results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListCommandInvocationsPaginator is a paginator for ListCommandInvocations\ntype ListCommandInvocationsPaginator struct {\n\toptions   ListCommandInvocationsPaginatorOptions\n\tclient    ListCommandInvocationsAPIClient\n\tparams    *ListCommandInvocationsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListCommandInvocationsPaginator returns a new ListCommandInvocationsPaginator\nfunc NewListCommandInvocationsPaginator(client ListCommandInvocationsAPIClient, params *ListCommandInvocationsInput, optFns ...func(*ListCommandInvocationsPaginatorOptions)) *ListCommandInvocationsPaginator {\n\tif params == nil {\n\t\tparams = &ListCommandInvocationsInput{}\n\t}\n\n\toptions := ListCommandInvocationsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListCommandInvocationsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListCommandInvocationsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListCommandInvocations page.\nfunc (p *ListCommandInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandInvocationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListCommandInvocations(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListCommandInvocations(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListCommandInvocations\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommands.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists the commands requested by users of the Amazon Web Services account.\nfunc (c *Client) ListCommands(ctx context.Context, params *ListCommandsInput, optFns ...func(*Options)) (*ListCommandsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListCommandsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListCommands\", params, optFns, c.addOperationListCommandsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListCommandsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListCommandsInput struct {\n\n\t// (Optional) If provided, lists only the specified command.\n\tCommandId *string\n\n\t// (Optional) One or more filters. Use a filter to return a more specific list of\n\t// results.\n\tFilters []types.CommandFilter\n\n\t// (Optional) Lists commands issued against this managed node ID. You can't\n\t// specify a managed node ID in the same command that you specify Status = Pending\n\t// . This is because the command hasn't reached the managed node yet.\n\tInstanceId *string\n\n\t// (Optional) The maximum number of items to return for this call. The call also\n\t// returns a token that you can specify in a subsequent call to get the next set of\n\t// results.\n\tMaxResults *int32\n\n\t// (Optional) The token for the next set of items to return. (You received this\n\t// token from a previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListCommandsOutput struct {\n\n\t// (Optional) The list of commands requested by the user.\n\tCommands []types.Command\n\n\t// (Optional) The token for the next set of items to return. (You received this\n\t// token from a previous call.)\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListCommandsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommands{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCommands{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListCommands\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListCommandsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommands(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListCommandsAPIClient is a client that implements the ListCommands operation.\ntype ListCommandsAPIClient interface {\n\tListCommands(context.Context, *ListCommandsInput, ...func(*Options)) (*ListCommandsOutput, error)\n}\n\nvar _ ListCommandsAPIClient = (*Client)(nil)\n\n// ListCommandsPaginatorOptions is the paginator options for ListCommands\ntype ListCommandsPaginatorOptions struct {\n\t// (Optional) The maximum number of items to return for this call. The call also\n\t// returns a token that you can specify in a subsequent call to get the next set of\n\t// results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListCommandsPaginator is a paginator for ListCommands\ntype ListCommandsPaginator struct {\n\toptions   ListCommandsPaginatorOptions\n\tclient    ListCommandsAPIClient\n\tparams    *ListCommandsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListCommandsPaginator returns a new ListCommandsPaginator\nfunc NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator {\n\tif params == nil {\n\t\tparams = &ListCommandsInput{}\n\t}\n\n\toptions := ListCommandsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListCommandsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListCommandsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListCommands page.\nfunc (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListCommands(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListCommands(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListCommands\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceItems.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// For a specified resource ID, this API operation returns a list of compliance\n// statuses for different resource types. Currently, you can only specify one\n// resource ID per call. List results depend on the criteria specified in the\n// filter.\nfunc (c *Client) ListComplianceItems(ctx context.Context, params *ListComplianceItemsInput, optFns ...func(*Options)) (*ListComplianceItemsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListComplianceItemsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListComplianceItems\", params, optFns, c.addOperationListComplianceItemsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListComplianceItemsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListComplianceItemsInput struct {\n\n\t// One or more compliance filters. Use a filter to return a more specific list of\n\t// results.\n\tFilters []types.ComplianceStringFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\t// The ID for the resources from which to get compliance information. Currently,\n\t// you can only specify one resource ID.\n\tResourceIds []string\n\n\t// The type of resource from which to get compliance information. Currently, the\n\t// only supported resource type is ManagedInstance .\n\tResourceTypes []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListComplianceItemsOutput struct {\n\n\t// A list of compliance information for the specified resource ID.\n\tComplianceItems []types.ComplianceItem\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListComplianceItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListComplianceItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListComplianceItems\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComplianceItems(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListComplianceItemsAPIClient is a client that implements the\n// ListComplianceItems operation.\ntype ListComplianceItemsAPIClient interface {\n\tListComplianceItems(context.Context, *ListComplianceItemsInput, ...func(*Options)) (*ListComplianceItemsOutput, error)\n}\n\nvar _ ListComplianceItemsAPIClient = (*Client)(nil)\n\n// ListComplianceItemsPaginatorOptions is the paginator options for\n// ListComplianceItems\ntype ListComplianceItemsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListComplianceItemsPaginator is a paginator for ListComplianceItems\ntype ListComplianceItemsPaginator struct {\n\toptions   ListComplianceItemsPaginatorOptions\n\tclient    ListComplianceItemsAPIClient\n\tparams    *ListComplianceItemsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListComplianceItemsPaginator returns a new ListComplianceItemsPaginator\nfunc NewListComplianceItemsPaginator(client ListComplianceItemsAPIClient, params *ListComplianceItemsInput, optFns ...func(*ListComplianceItemsPaginatorOptions)) *ListComplianceItemsPaginator {\n\tif params == nil {\n\t\tparams = &ListComplianceItemsInput{}\n\t}\n\n\toptions := ListComplianceItemsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListComplianceItemsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListComplianceItemsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListComplianceItems page.\nfunc (p *ListComplianceItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceItemsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListComplianceItems(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListComplianceItems(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListComplianceItems\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceSummaries.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a summary count of compliant and non-compliant resources for a\n// compliance type. For example, this call can return State Manager associations,\n// patches, or custom compliance types according to the filter criteria that you\n// specify.\nfunc (c *Client) ListComplianceSummaries(ctx context.Context, params *ListComplianceSummariesInput, optFns ...func(*Options)) (*ListComplianceSummariesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListComplianceSummariesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListComplianceSummaries\", params, optFns, c.addOperationListComplianceSummariesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListComplianceSummariesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListComplianceSummariesInput struct {\n\n\t// One or more compliance or inventory filters. Use a filter to return a more\n\t// specific list of results.\n\tFilters []types.ComplianceStringFilter\n\n\t// The maximum number of items to return for this call. Currently, you can specify\n\t// null or 50. The call also returns a token that you can specify in a subsequent\n\t// call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListComplianceSummariesOutput struct {\n\n\t// A list of compliant and non-compliant summary counts based on compliance types.\n\t// For example, this call returns State Manager associations, patches, or custom\n\t// compliance types according to the filter criteria that you specified.\n\tComplianceSummaryItems []types.ComplianceSummaryItem\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListComplianceSummaries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListComplianceSummaries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListComplianceSummaries\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComplianceSummaries(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListComplianceSummariesAPIClient is a client that implements the\n// ListComplianceSummaries operation.\ntype ListComplianceSummariesAPIClient interface {\n\tListComplianceSummaries(context.Context, *ListComplianceSummariesInput, ...func(*Options)) (*ListComplianceSummariesOutput, error)\n}\n\nvar _ ListComplianceSummariesAPIClient = (*Client)(nil)\n\n// ListComplianceSummariesPaginatorOptions is the paginator options for\n// ListComplianceSummaries\ntype ListComplianceSummariesPaginatorOptions struct {\n\t// The maximum number of items to return for this call. Currently, you can specify\n\t// null or 50. The call also returns a token that you can specify in a subsequent\n\t// call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListComplianceSummariesPaginator is a paginator for ListComplianceSummaries\ntype ListComplianceSummariesPaginator struct {\n\toptions   ListComplianceSummariesPaginatorOptions\n\tclient    ListComplianceSummariesAPIClient\n\tparams    *ListComplianceSummariesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListComplianceSummariesPaginator returns a new\n// ListComplianceSummariesPaginator\nfunc NewListComplianceSummariesPaginator(client ListComplianceSummariesAPIClient, params *ListComplianceSummariesInput, optFns ...func(*ListComplianceSummariesPaginatorOptions)) *ListComplianceSummariesPaginator {\n\tif params == nil {\n\t\tparams = &ListComplianceSummariesInput{}\n\t}\n\n\toptions := ListComplianceSummariesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListComplianceSummariesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListComplianceSummariesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListComplianceSummaries page.\nfunc (p *ListComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceSummariesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListComplianceSummaries(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListComplianceSummaries\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentMetadataHistory.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Information about approval reviews for a version of a change template in Change\n// Manager.\nfunc (c *Client) ListDocumentMetadataHistory(ctx context.Context, params *ListDocumentMetadataHistoryInput, optFns ...func(*Options)) (*ListDocumentMetadataHistoryOutput, error) {\n\tif params == nil {\n\t\tparams = &ListDocumentMetadataHistoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListDocumentMetadataHistory\", params, optFns, c.addOperationListDocumentMetadataHistoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListDocumentMetadataHistoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListDocumentMetadataHistoryInput struct {\n\n\t// The type of data for which details are being requested. Currently, the only\n\t// supported value is DocumentReviews .\n\t//\n\t// This member is required.\n\tMetadata types.DocumentMetadataEnum\n\n\t// The name of the change template.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The version of the change template.\n\tDocumentVersion *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListDocumentMetadataHistoryOutput struct {\n\n\t// The user ID of the person in the organization who requested the review of the\n\t// change template.\n\tAuthor *string\n\n\t// The version of the change template.\n\tDocumentVersion *string\n\n\t// Information about the response to the change template approval request.\n\tMetadata *types.DocumentMetadataResponseInfo\n\n\t// The name of the change template.\n\tName *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocumentMetadataHistory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDocumentMetadataHistory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListDocumentMetadataHistory\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListDocumentMetadataHistoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocumentMetadataHistory(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opListDocumentMetadataHistory(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListDocumentMetadataHistory\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentVersions.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// List all versions for a document.\nfunc (c *Client) ListDocumentVersions(ctx context.Context, params *ListDocumentVersionsInput, optFns ...func(*Options)) (*ListDocumentVersionsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListDocumentVersionsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListDocumentVersions\", params, optFns, c.addOperationListDocumentVersionsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListDocumentVersionsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListDocumentVersionsInput struct {\n\n\t// The name of the document. You can specify an Amazon Resource Name (ARN).\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListDocumentVersionsOutput struct {\n\n\t// The document versions.\n\tDocumentVersions []types.DocumentVersionInfo\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocumentVersions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDocumentVersions{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListDocumentVersions\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListDocumentVersionsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocumentVersions(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListDocumentVersionsAPIClient is a client that implements the\n// ListDocumentVersions operation.\ntype ListDocumentVersionsAPIClient interface {\n\tListDocumentVersions(context.Context, *ListDocumentVersionsInput, ...func(*Options)) (*ListDocumentVersionsOutput, error)\n}\n\nvar _ ListDocumentVersionsAPIClient = (*Client)(nil)\n\n// ListDocumentVersionsPaginatorOptions is the paginator options for\n// ListDocumentVersions\ntype ListDocumentVersionsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListDocumentVersionsPaginator is a paginator for ListDocumentVersions\ntype ListDocumentVersionsPaginator struct {\n\toptions   ListDocumentVersionsPaginatorOptions\n\tclient    ListDocumentVersionsAPIClient\n\tparams    *ListDocumentVersionsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListDocumentVersionsPaginator returns a new ListDocumentVersionsPaginator\nfunc NewListDocumentVersionsPaginator(client ListDocumentVersionsAPIClient, params *ListDocumentVersionsInput, optFns ...func(*ListDocumentVersionsPaginatorOptions)) *ListDocumentVersionsPaginator {\n\tif params == nil {\n\t\tparams = &ListDocumentVersionsInput{}\n\t}\n\n\toptions := ListDocumentVersionsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListDocumentVersionsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListDocumentVersionsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListDocumentVersions page.\nfunc (p *ListDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentVersionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListDocumentVersions(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListDocumentVersions(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListDocumentVersions\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocuments.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns all Systems Manager (SSM) documents in the current Amazon Web Services\n// account and Amazon Web Services Region. You can limit the results of this\n// request by using a filter.\nfunc (c *Client) ListDocuments(ctx context.Context, params *ListDocumentsInput, optFns ...func(*Options)) (*ListDocumentsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListDocumentsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListDocuments\", params, optFns, c.addOperationListDocumentsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListDocumentsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListDocumentsInput struct {\n\n\t// This data type is deprecated. Instead, use Filters .\n\tDocumentFilterList []types.DocumentFilter\n\n\t// One or more DocumentKeyValuesFilter objects. Use a filter to return a more\n\t// specific list of results. For keys, you can specify one or more key-value pair\n\t// tags that have been applied to a document. Other valid keys include Owner , Name\n\t// , PlatformTypes , DocumentType , and TargetType . For example, to return\n\t// documents you own use Key=Owner,Values=Self . To specify a custom key-value\n\t// pair, use the format Key=tag:tagName,Values=valueName . This API operation only\n\t// supports filtering documents by using a single tag key and one or more tag\n\t// values. For example: Key=tag:tagName,Values=valueName1,valueName2\n\tFilters []types.DocumentKeyValuesFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListDocumentsOutput struct {\n\n\t// The names of the SSM documents.\n\tDocumentIdentifiers []types.DocumentIdentifier\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocuments{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDocuments{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListDocuments\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListDocumentsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocuments(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListDocumentsAPIClient is a client that implements the ListDocuments operation.\ntype ListDocumentsAPIClient interface {\n\tListDocuments(context.Context, *ListDocumentsInput, ...func(*Options)) (*ListDocumentsOutput, error)\n}\n\nvar _ ListDocumentsAPIClient = (*Client)(nil)\n\n// ListDocumentsPaginatorOptions is the paginator options for ListDocuments\ntype ListDocumentsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListDocumentsPaginator is a paginator for ListDocuments\ntype ListDocumentsPaginator struct {\n\toptions   ListDocumentsPaginatorOptions\n\tclient    ListDocumentsAPIClient\n\tparams    *ListDocumentsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListDocumentsPaginator returns a new ListDocumentsPaginator\nfunc NewListDocumentsPaginator(client ListDocumentsAPIClient, params *ListDocumentsInput, optFns ...func(*ListDocumentsPaginatorOptions)) *ListDocumentsPaginator {\n\tif params == nil {\n\t\tparams = &ListDocumentsInput{}\n\t}\n\n\toptions := ListDocumentsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListDocumentsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListDocumentsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListDocuments page.\nfunc (p *ListDocumentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListDocuments(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListDocuments(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListDocuments\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListInventoryEntries.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// A list of inventory items returned by the request.\nfunc (c *Client) ListInventoryEntries(ctx context.Context, params *ListInventoryEntriesInput, optFns ...func(*Options)) (*ListInventoryEntriesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListInventoryEntriesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListInventoryEntries\", params, optFns, c.addOperationListInventoryEntriesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListInventoryEntriesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListInventoryEntriesInput struct {\n\n\t// The managed node ID for which you want inventory information.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The type of inventory item for which you want information.\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\t// One or more filters. Use a filter to return a more specific list of results.\n\tFilters []types.InventoryFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListInventoryEntriesOutput struct {\n\n\t// The time that inventory information was collected for the managed node(s).\n\tCaptureTime *string\n\n\t// A list of inventory items on the managed node(s).\n\tEntries []map[string]string\n\n\t// The managed node ID targeted by the request to query inventory information.\n\tInstanceId *string\n\n\t// The token to use when requesting the next set of items. If there are no\n\t// additional items to return, the string is empty.\n\tNextToken *string\n\n\t// The inventory schema version used by the managed node(s).\n\tSchemaVersion *string\n\n\t// The type of inventory item returned by the request.\n\tTypeName *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListInventoryEntries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListInventoryEntries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListInventoryEntries\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListInventoryEntriesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInventoryEntries(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opListInventoryEntries(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListInventoryEntries\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemEvents.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a list of all OpsItem events in the current Amazon Web Services Region\n// and Amazon Web Services account. You can limit the results to events associated\n// with specific OpsItems by specifying a filter.\nfunc (c *Client) ListOpsItemEvents(ctx context.Context, params *ListOpsItemEventsInput, optFns ...func(*Options)) (*ListOpsItemEventsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListOpsItemEventsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListOpsItemEvents\", params, optFns, c.addOperationListOpsItemEventsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListOpsItemEventsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListOpsItemEventsInput struct {\n\n\t// One or more OpsItem filters. Use a filter to return a more specific list of\n\t// results.\n\tFilters []types.OpsItemEventFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListOpsItemEventsOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A list of event information for the specified OpsItems.\n\tSummaries []types.OpsItemEventSummary\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsItemEvents{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOpsItemEvents{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListOpsItemEvents\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListOpsItemEventsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsItemEvents(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListOpsItemEventsAPIClient is a client that implements the ListOpsItemEvents\n// operation.\ntype ListOpsItemEventsAPIClient interface {\n\tListOpsItemEvents(context.Context, *ListOpsItemEventsInput, ...func(*Options)) (*ListOpsItemEventsOutput, error)\n}\n\nvar _ ListOpsItemEventsAPIClient = (*Client)(nil)\n\n// ListOpsItemEventsPaginatorOptions is the paginator options for ListOpsItemEvents\ntype ListOpsItemEventsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListOpsItemEventsPaginator is a paginator for ListOpsItemEvents\ntype ListOpsItemEventsPaginator struct {\n\toptions   ListOpsItemEventsPaginatorOptions\n\tclient    ListOpsItemEventsAPIClient\n\tparams    *ListOpsItemEventsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListOpsItemEventsPaginator returns a new ListOpsItemEventsPaginator\nfunc NewListOpsItemEventsPaginator(client ListOpsItemEventsAPIClient, params *ListOpsItemEventsInput, optFns ...func(*ListOpsItemEventsPaginatorOptions)) *ListOpsItemEventsPaginator {\n\tif params == nil {\n\t\tparams = &ListOpsItemEventsInput{}\n\t}\n\n\toptions := ListOpsItemEventsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListOpsItemEventsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListOpsItemEventsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListOpsItemEvents page.\nfunc (p *ListOpsItemEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsItemEventsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListOpsItemEvents(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListOpsItemEvents(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListOpsItemEvents\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemRelatedItems.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all related-item resources associated with a Systems Manager OpsCenter\n// OpsItem. OpsCenter is a capability of Amazon Web Services Systems Manager.\nfunc (c *Client) ListOpsItemRelatedItems(ctx context.Context, params *ListOpsItemRelatedItemsInput, optFns ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListOpsItemRelatedItemsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListOpsItemRelatedItems\", params, optFns, c.addOperationListOpsItemRelatedItemsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListOpsItemRelatedItemsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListOpsItemRelatedItemsInput struct {\n\n\t// One or more OpsItem filters. Use a filter to return a more specific list of\n\t// results.\n\tFilters []types.OpsItemRelatedItemsFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// The token for the next set of items to return. (You received this token from a\n\t// previous call.)\n\tNextToken *string\n\n\t// The ID of the OpsItem for which you want to list all related-item resources.\n\tOpsItemId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListOpsItemRelatedItemsOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A list of related-item resources for the specified OpsItem.\n\tSummaries []types.OpsItemRelatedItemSummary\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListOpsItemRelatedItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsItemRelatedItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOpsItemRelatedItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListOpsItemRelatedItems\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListOpsItemRelatedItemsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsItemRelatedItems(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListOpsItemRelatedItemsAPIClient is a client that implements the\n// ListOpsItemRelatedItems operation.\ntype ListOpsItemRelatedItemsAPIClient interface {\n\tListOpsItemRelatedItems(context.Context, *ListOpsItemRelatedItemsInput, ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error)\n}\n\nvar _ ListOpsItemRelatedItemsAPIClient = (*Client)(nil)\n\n// ListOpsItemRelatedItemsPaginatorOptions is the paginator options for\n// ListOpsItemRelatedItems\ntype ListOpsItemRelatedItemsPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListOpsItemRelatedItemsPaginator is a paginator for ListOpsItemRelatedItems\ntype ListOpsItemRelatedItemsPaginator struct {\n\toptions   ListOpsItemRelatedItemsPaginatorOptions\n\tclient    ListOpsItemRelatedItemsAPIClient\n\tparams    *ListOpsItemRelatedItemsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListOpsItemRelatedItemsPaginator returns a new\n// ListOpsItemRelatedItemsPaginator\nfunc NewListOpsItemRelatedItemsPaginator(client ListOpsItemRelatedItemsAPIClient, params *ListOpsItemRelatedItemsInput, optFns ...func(*ListOpsItemRelatedItemsPaginatorOptions)) *ListOpsItemRelatedItemsPaginator {\n\tif params == nil {\n\t\tparams = &ListOpsItemRelatedItemsInput{}\n\t}\n\n\toptions := ListOpsItemRelatedItemsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListOpsItemRelatedItemsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListOpsItemRelatedItemsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListOpsItemRelatedItems page.\nfunc (p *ListOpsItemRelatedItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListOpsItemRelatedItems(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListOpsItemRelatedItems(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListOpsItemRelatedItems\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Amazon Web Services Systems Manager calls this API operation when displaying\n// all Application Manager OpsMetadata objects or blobs.\nfunc (c *Client) ListOpsMetadata(ctx context.Context, params *ListOpsMetadataInput, optFns ...func(*Options)) (*ListOpsMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &ListOpsMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListOpsMetadata\", params, optFns, c.addOperationListOpsMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListOpsMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListOpsMetadataInput struct {\n\n\t// One or more filters to limit the number of OpsMetadata objects returned by the\n\t// call.\n\tFilters []types.OpsMetadataFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListOpsMetadataOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// Returns a list of OpsMetadata objects.\n\tOpsMetadataList []types.OpsMetadata\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListOpsMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListOpsMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListOpsMetadataAPIClient is a client that implements the ListOpsMetadata\n// operation.\ntype ListOpsMetadataAPIClient interface {\n\tListOpsMetadata(context.Context, *ListOpsMetadataInput, ...func(*Options)) (*ListOpsMetadataOutput, error)\n}\n\nvar _ ListOpsMetadataAPIClient = (*Client)(nil)\n\n// ListOpsMetadataPaginatorOptions is the paginator options for ListOpsMetadata\ntype ListOpsMetadataPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListOpsMetadataPaginator is a paginator for ListOpsMetadata\ntype ListOpsMetadataPaginator struct {\n\toptions   ListOpsMetadataPaginatorOptions\n\tclient    ListOpsMetadataAPIClient\n\tparams    *ListOpsMetadataInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListOpsMetadataPaginator returns a new ListOpsMetadataPaginator\nfunc NewListOpsMetadataPaginator(client ListOpsMetadataAPIClient, params *ListOpsMetadataInput, optFns ...func(*ListOpsMetadataPaginatorOptions)) *ListOpsMetadataPaginator {\n\tif params == nil {\n\t\tparams = &ListOpsMetadataInput{}\n\t}\n\n\toptions := ListOpsMetadataPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListOpsMetadataPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListOpsMetadataPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListOpsMetadata page.\nfunc (p *ListOpsMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsMetadataOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListOpsMetadata(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListOpsMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceComplianceSummaries.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a resource-level summary count. The summary includes information about\n// compliant and non-compliant statuses and detailed compliance-item severity\n// counts, according to the filter criteria you specify.\nfunc (c *Client) ListResourceComplianceSummaries(ctx context.Context, params *ListResourceComplianceSummariesInput, optFns ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListResourceComplianceSummariesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListResourceComplianceSummaries\", params, optFns, c.addOperationListResourceComplianceSummariesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListResourceComplianceSummariesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListResourceComplianceSummariesInput struct {\n\n\t// One or more filters. Use a filter to return a more specific list of results.\n\tFilters []types.ComplianceStringFilter\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListResourceComplianceSummariesOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A summary count for specified or targeted managed nodes. Summary count includes\n\t// information about compliant and non-compliant State Manager associations, patch\n\t// status, or custom items according to the filter criteria that you specify.\n\tResourceComplianceSummaryItems []types.ResourceComplianceSummaryItem\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceComplianceSummaries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourceComplianceSummaries{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListResourceComplianceSummaries\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceComplianceSummaries(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListResourceComplianceSummariesAPIClient is a client that implements the\n// ListResourceComplianceSummaries operation.\ntype ListResourceComplianceSummariesAPIClient interface {\n\tListResourceComplianceSummaries(context.Context, *ListResourceComplianceSummariesInput, ...func(*Options)) (*ListResourceComplianceSummariesOutput, error)\n}\n\nvar _ ListResourceComplianceSummariesAPIClient = (*Client)(nil)\n\n// ListResourceComplianceSummariesPaginatorOptions is the paginator options for\n// ListResourceComplianceSummaries\ntype ListResourceComplianceSummariesPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListResourceComplianceSummariesPaginator is a paginator for\n// ListResourceComplianceSummaries\ntype ListResourceComplianceSummariesPaginator struct {\n\toptions   ListResourceComplianceSummariesPaginatorOptions\n\tclient    ListResourceComplianceSummariesAPIClient\n\tparams    *ListResourceComplianceSummariesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListResourceComplianceSummariesPaginator returns a new\n// ListResourceComplianceSummariesPaginator\nfunc NewListResourceComplianceSummariesPaginator(client ListResourceComplianceSummariesAPIClient, params *ListResourceComplianceSummariesInput, optFns ...func(*ListResourceComplianceSummariesPaginatorOptions)) *ListResourceComplianceSummariesPaginator {\n\tif params == nil {\n\t\tparams = &ListResourceComplianceSummariesInput{}\n\t}\n\n\toptions := ListResourceComplianceSummariesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListResourceComplianceSummariesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListResourceComplianceSummariesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListResourceComplianceSummaries page.\nfunc (p *ListResourceComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListResourceComplianceSummaries(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListResourceComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListResourceComplianceSummaries\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceDataSync.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists your resource data sync configurations. Includes information about the\n// last time a sync attempted to start, the last sync status, and the last time a\n// sync successfully completed. The number of sync configurations might be too\n// large to return using a single call to ListResourceDataSync . You can limit the\n// number of sync configurations returned by using the MaxResults parameter. To\n// determine whether there are more sync configurations to list, check the value of\n// NextToken in the output. If there are more sync configurations to list, you can\n// request them by specifying the NextToken returned in the call to the parameter\n// of a subsequent call.\nfunc (c *Client) ListResourceDataSync(ctx context.Context, params *ListResourceDataSyncInput, optFns ...func(*Options)) (*ListResourceDataSyncOutput, error) {\n\tif params == nil {\n\t\tparams = &ListResourceDataSyncInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListResourceDataSync\", params, optFns, c.addOperationListResourceDataSyncMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListResourceDataSyncOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListResourceDataSyncInput struct {\n\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tMaxResults *int32\n\n\t// A token to start the list. Use this token to get the next set of results.\n\tNextToken *string\n\n\t// View a list of resource data syncs according to the sync type. Specify\n\t// SyncToDestination to view resource data syncs that synchronize data to an Amazon\n\t// S3 bucket. Specify SyncFromSource to view resource data syncs from\n\t// Organizations or from multiple Amazon Web Services Regions.\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListResourceDataSyncOutput struct {\n\n\t// The token for the next set of items to return. Use this token to get the next\n\t// set of results.\n\tNextToken *string\n\n\t// A list of your current resource data sync configurations and their statuses.\n\tResourceDataSyncItems []types.ResourceDataSyncItem\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListResourceDataSync\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceDataSync(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListResourceDataSyncAPIClient is a client that implements the\n// ListResourceDataSync operation.\ntype ListResourceDataSyncAPIClient interface {\n\tListResourceDataSync(context.Context, *ListResourceDataSyncInput, ...func(*Options)) (*ListResourceDataSyncOutput, error)\n}\n\nvar _ ListResourceDataSyncAPIClient = (*Client)(nil)\n\n// ListResourceDataSyncPaginatorOptions is the paginator options for\n// ListResourceDataSync\ntype ListResourceDataSyncPaginatorOptions struct {\n\t// The maximum number of items to return for this call. The call also returns a\n\t// token that you can specify in a subsequent call to get the next set of results.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListResourceDataSyncPaginator is a paginator for ListResourceDataSync\ntype ListResourceDataSyncPaginator struct {\n\toptions   ListResourceDataSyncPaginatorOptions\n\tclient    ListResourceDataSyncAPIClient\n\tparams    *ListResourceDataSyncInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListResourceDataSyncPaginator returns a new ListResourceDataSyncPaginator\nfunc NewListResourceDataSyncPaginator(client ListResourceDataSyncAPIClient, params *ListResourceDataSyncInput, optFns ...func(*ListResourceDataSyncPaginatorOptions)) *ListResourceDataSyncPaginator {\n\tif params == nil {\n\t\tparams = &ListResourceDataSyncInput{}\n\t}\n\n\toptions := ListResourceDataSyncPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListResourceDataSyncPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListResourceDataSyncPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListResourceDataSync page.\nfunc (p *ListResourceDataSyncPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceDataSyncOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListResourceDataSync(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\nfunc newServiceMetadataMiddleware_opListResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListResourceDataSync\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListTagsForResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a list of the tags assigned to the specified resource. For information\n// about the ID format for each supported resource type, see AddTagsToResource .\nfunc (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &ListTagsForResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListTagsForResource\", params, optFns, c.addOperationListTagsForResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListTagsForResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListTagsForResourceInput struct {\n\n\t// The resource ID for which you want to see a list of tags.\n\t//\n\t// This member is required.\n\tResourceId *string\n\n\t// Returns a list of tags for a specific resource type.\n\t//\n\t// This member is required.\n\tResourceType types.ResourceTypeForTagging\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListTagsForResourceOutput struct {\n\n\t// A list of tags.\n\tTagList []types.Tag\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListTagsForResource\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListTagsForResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ModifyDocumentPermission.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Shares a Amazon Web Services Systems Manager document (SSM document)publicly or\n// privately. If you share a document privately, you must specify the Amazon Web\n// Services user IDs for those people who can use the document. If you share a\n// document publicly, you must specify All as the account ID.\nfunc (c *Client) ModifyDocumentPermission(ctx context.Context, params *ModifyDocumentPermissionInput, optFns ...func(*Options)) (*ModifyDocumentPermissionOutput, error) {\n\tif params == nil {\n\t\tparams = &ModifyDocumentPermissionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ModifyDocumentPermission\", params, optFns, c.addOperationModifyDocumentPermissionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ModifyDocumentPermissionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ModifyDocumentPermissionInput struct {\n\n\t// The name of the document that you want to share.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The permission type for the document. The permission type can be Share.\n\t//\n\t// This member is required.\n\tPermissionType types.DocumentPermissionType\n\n\t// The Amazon Web Services users that should have access to the document. The\n\t// account IDs can either be a group of account IDs or All.\n\tAccountIdsToAdd []string\n\n\t// The Amazon Web Services users that should no longer have access to the\n\t// document. The Amazon Web Services user can either be a group of account IDs or\n\t// All. This action has a higher priority than AccountIdsToAdd. If you specify an\n\t// ID to add and the same ID to remove, the system removes access to the document.\n\tAccountIdsToRemove []string\n\n\t// (Optional) The version of the document to share. If it isn't specified, the\n\t// system choose the Default version to share.\n\tSharedDocumentVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ModifyDocumentPermissionOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpModifyDocumentPermission{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpModifyDocumentPermission{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ModifyDocumentPermission\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpModifyDocumentPermissionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDocumentPermission(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opModifyDocumentPermission(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ModifyDocumentPermission\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutComplianceItems.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Registers a compliance type and other compliance details on a designated\n// resource. This operation lets you register custom compliance details with a\n// resource. This call overwrites existing compliance information on the resource,\n// so you must provide a full list of compliance items each time that you send the\n// request. ComplianceType can be one of the following:\n//   - ExecutionId: The execution ID when the patch, association, or custom\n//     compliance item was applied.\n//   - ExecutionType: Specify patch, association, or Custom: string .\n//   - ExecutionTime. The time the patch, association, or custom compliance item\n//     was applied to the managed node.\n//   - Id: The patch, association, or custom compliance ID.\n//   - Title: A title.\n//   - Status: The status of the compliance item. For example, approved for\n//     patches, or Failed for associations.\n//   - Severity: A patch severity. For example, Critical .\n//   - DocumentName: An SSM document name. For example, AWS-RunPatchBaseline .\n//   - DocumentVersion: An SSM document version number. For example, 4.\n//   - Classification: A patch classification. For example, security updates .\n//   - PatchBaselineId: A patch baseline ID.\n//   - PatchSeverity: A patch severity. For example, Critical .\n//   - PatchState: A patch state. For example, InstancesWithFailedPatches .\n//   - PatchGroup: The name of a patch group.\n//   - InstalledTime: The time the association, patch, or custom compliance item\n//     was applied to the resource. Specify the time by using the following format:\n//     yyyy-MM-dd'T'HH:mm:ss'Z'\nfunc (c *Client) PutComplianceItems(ctx context.Context, params *PutComplianceItemsInput, optFns ...func(*Options)) (*PutComplianceItemsOutput, error) {\n\tif params == nil {\n\t\tparams = &PutComplianceItemsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutComplianceItems\", params, optFns, c.addOperationPutComplianceItemsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutComplianceItemsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutComplianceItemsInput struct {\n\n\t// Specify the compliance type. For example, specify Association (for a State\n\t// Manager association), Patch, or Custom: string .\n\t//\n\t// This member is required.\n\tComplianceType *string\n\n\t// A summary of the call execution that includes an execution ID, the type of\n\t// execution (for example, Command ), and the date/time of the execution using a\n\t// datetime object that is saved in the following format: yyyy-MM-dd'T'HH:mm:ss'Z'.\n\t//\n\t// This member is required.\n\tExecutionSummary *types.ComplianceExecutionSummary\n\n\t// Information about the compliance as defined by the resource type. For example,\n\t// for a patch compliance type, Items includes information about the\n\t// PatchSeverity, Classification, and so on.\n\t//\n\t// This member is required.\n\tItems []types.ComplianceItemEntry\n\n\t// Specify an ID for this resource. For a managed node, this is the node ID.\n\t//\n\t// This member is required.\n\tResourceId *string\n\n\t// Specify the type of resource. ManagedInstance is currently the only supported\n\t// resource type.\n\t//\n\t// This member is required.\n\tResourceType *string\n\n\t// MD5 or SHA-256 content hash. The content hash is used to determine if existing\n\t// information should be overwritten or ignored. If the content hashes match, the\n\t// request to put compliance information is ignored.\n\tItemContentHash *string\n\n\t// The mode for uploading compliance items. You can specify COMPLETE or PARTIAL .\n\t// In COMPLETE mode, the system overwrites all existing compliance information for\n\t// the resource. You must provide a full list of compliance items each time you\n\t// send the request. In PARTIAL mode, the system overwrites compliance information\n\t// for a specific association. The association must be configured with\n\t// SyncCompliance set to MANUAL . By default, all requests use COMPLETE mode. This\n\t// attribute is only valid for association compliance.\n\tUploadType types.ComplianceUploadType\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutComplianceItemsOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutComplianceItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutComplianceItems{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"PutComplianceItems\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutComplianceItemsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutComplianceItems(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutComplianceItems(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"PutComplianceItems\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutInventory.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Bulk update custom inventory items on one or more managed nodes. The request\n// adds an inventory item, if it doesn't already exist, or updates an inventory\n// item, if it does exist.\nfunc (c *Client) PutInventory(ctx context.Context, params *PutInventoryInput, optFns ...func(*Options)) (*PutInventoryOutput, error) {\n\tif params == nil {\n\t\tparams = &PutInventoryInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutInventory\", params, optFns, c.addOperationPutInventoryMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutInventoryOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutInventoryInput struct {\n\n\t// An managed node ID where you want to add or update inventory items.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The inventory items that you want to add or update on managed nodes.\n\t//\n\t// This member is required.\n\tItems []types.InventoryItem\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutInventoryOutput struct {\n\n\t// Information about the request.\n\tMessage *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutInventory{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"PutInventory\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutInventoryValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutInventory(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutInventory(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"PutInventory\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutParameter.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Add a parameter to the system.\nfunc (c *Client) PutParameter(ctx context.Context, params *PutParameterInput, optFns ...func(*Options)) (*PutParameterOutput, error) {\n\tif params == nil {\n\t\tparams = &PutParameterInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutParameter\", params, optFns, c.addOperationPutParameterMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutParameterOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutParameterInput struct {\n\n\t// The fully qualified name of the parameter that you want to add to the system.\n\t// The fully qualified name includes the complete hierarchy of the parameter path\n\t// and name. For parameters in a hierarchy, you must include a leading forward\n\t// slash character (/) when you create or reference a parameter. For example:\n\t// /Dev/DBServer/MySQL/db-string13 Naming Constraints:\n\t//   - Parameter names are case sensitive.\n\t//   - A parameter name must be unique within an Amazon Web Services Region\n\t//   - A parameter name can't be prefixed with \" aws \" or \" ssm \"\n\t//   (case-insensitive).\n\t//   - Parameter names can include only the following symbols and letters:\n\t//   a-zA-Z0-9_.- In addition, the slash character ( / ) is used to delineate\n\t//   hierarchies in parameter names. For example:\n\t//   /Dev/Production/East/Project-ABC/MyParameter\n\t//   - A parameter name can't include spaces.\n\t//   - Parameter hierarchies are limited to a maximum depth of fifteen levels.\n\t// For additional information about valid values for parameter names, see Creating\n\t// Systems Manager parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-create.html)\n\t// in the Amazon Web Services Systems Manager User Guide. The maximum length\n\t// constraint of 2048 characters listed below includes 1037 characters reserved for\n\t// internal use by Systems Manager. The maximum length for a parameter name that\n\t// you create is 1011 characters. This includes the characters in the ARN that\n\t// precede the name you specify, such as\n\t// arn:aws:ssm:us-east-2:111122223333:parameter/ .\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The parameter value that you want to add to the system. Standard parameters\n\t// have a value limit of 4 KB. Advanced parameters have a value limit of 8 KB.\n\t// Parameters can't be referenced or nested in the values of other parameters. You\n\t// can't include {{}} or {{ssm:parameter-name}} in a parameter value.\n\t//\n\t// This member is required.\n\tValue *string\n\n\t// A regular expression used to validate the parameter value. For example, for\n\t// String types with values restricted to numbers, you can specify the following:\n\t// AllowedPattern=^\\d+$\n\tAllowedPattern *string\n\n\t// The data type for a String parameter. Supported data types include plain text\n\t// and Amazon Machine Image (AMI) IDs. The following data type values are\n\t// supported.\n\t//   - text\n\t//   - aws:ec2:image\n\t//   - aws:ssm:integration\n\t// When you create a String parameter and specify aws:ec2:image , Amazon Web\n\t// Services Systems Manager validates the parameter value is in the required\n\t// format, such as ami-12345abcdeEXAMPLE , and that the specified AMI is available\n\t// in your Amazon Web Services account. If the action is successful, the service\n\t// sends back an HTTP 200 response which indicates a successful PutParameter call\n\t// for all cases except for data type aws:ec2:image . If you call PutParameter\n\t// with aws:ec2:image data type, a successful HTTP 200 response does not guarantee\n\t// that your parameter was successfully created or updated. The aws:ec2:image\n\t// value is validated asynchronously, and the PutParameter call returns before the\n\t// validation is complete. If you submit an invalid AMI value, the PutParameter\n\t// operation will return success, but the asynchronous validation will fail and the\n\t// parameter will not be created or updated. To monitor whether your aws:ec2:image\n\t// parameters are created successfully, see Setting up notifications or trigger\n\t// actions based on Parameter Store events (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-cwe.html)\n\t// . For more information about AMI format validation , see Native parameter\n\t// support for Amazon Machine Image (AMI) IDs (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-ec2-aliases.html)\n\t// .\n\tDataType *string\n\n\t// Information about the parameter that you want to add to the system. Optional\n\t// but recommended. Don't enter personally identifiable information in this field.\n\tDescription *string\n\n\t// The Key Management Service (KMS) ID that you want to use to encrypt a\n\t// parameter. Use a custom key for better security. Required for parameters that\n\t// use the SecureString data type. If you don't specify a key ID, the system uses\n\t// the default key associated with your Amazon Web Services account which is not as\n\t// secure as using a custom key.\n\t//   - To use a custom KMS key, choose the SecureString data type with the Key ID\n\t//   parameter.\n\tKeyId *string\n\n\t// Overwrite an existing parameter. The default value is false .\n\tOverwrite *bool\n\n\t// One or more policies to apply to a parameter. This operation takes a JSON\n\t// array. Parameter Store, a capability of Amazon Web Services Systems Manager\n\t// supports the following policy types: Expiration: This policy deletes the\n\t// parameter after it expires. When you create the policy, you specify the\n\t// expiration date. You can update the expiration date and time by updating the\n\t// policy. Updating the parameter doesn't affect the expiration date and time. When\n\t// the expiration time is reached, Parameter Store deletes the parameter.\n\t// ExpirationNotification: This policy initiates an event in Amazon CloudWatch\n\t// Events that notifies you about the expiration. By using this policy, you can\n\t// receive notification before or after the expiration time is reached, in units of\n\t// days or hours. NoChangeNotification: This policy initiates a CloudWatch Events\n\t// event if a parameter hasn't been modified for a specified period of time. This\n\t// policy type is useful when, for example, a secret needs to be changed within a\n\t// period of time, but it hasn't been changed. All existing policies are preserved\n\t// until you send new policies or an empty policy. For more information about\n\t// parameter policies, see Assigning parameter policies (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html)\n\t// .\n\tPolicies *string\n\n\t// Optional metadata that you assign to a resource. Tags enable you to categorize\n\t// a resource in different ways, such as by purpose, owner, or environment. For\n\t// example, you might want to tag a Systems Manager parameter to identify the type\n\t// of resource to which it applies, the environment, or the type of configuration\n\t// data referenced by the parameter. In this case, you could specify the following\n\t// key-value pairs:\n\t//   - Key=Resource,Value=S3bucket\n\t//   - Key=OS,Value=Windows\n\t//   - Key=ParameterType,Value=LicenseKey\n\t// To add tags to an existing Systems Manager parameter, use the AddTagsToResource\n\t// operation.\n\tTags []types.Tag\n\n\t// The parameter tier to assign to a parameter. Parameter Store offers a standard\n\t// tier and an advanced tier for parameters. Standard parameters have a content\n\t// size limit of 4 KB and can't be configured to use parameter policies. You can\n\t// create a maximum of 10,000 standard parameters for each Region in an Amazon Web\n\t// Services account. Standard parameters are offered at no additional cost.\n\t// Advanced parameters have a content size limit of 8 KB and can be configured to\n\t// use parameter policies. You can create a maximum of 100,000 advanced parameters\n\t// for each Region in an Amazon Web Services account. Advanced parameters incur a\n\t// charge. For more information, see Standard and advanced parameter tiers (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html)\n\t// in the Amazon Web Services Systems Manager User Guide. You can change a standard\n\t// parameter to an advanced parameter any time. But you can't revert an advanced\n\t// parameter to a standard parameter. Reverting an advanced parameter to a standard\n\t// parameter would result in data loss because the system would truncate the size\n\t// of the parameter from 8 KB to 4 KB. Reverting would also remove any policies\n\t// attached to the parameter. Lastly, advanced parameters use a different form of\n\t// encryption than standard parameters. If you no longer need an advanced\n\t// parameter, or if you no longer want to incur charges for an advanced parameter,\n\t// you must delete it and recreate it as a new standard parameter. Using the\n\t// Default Tier Configuration In PutParameter requests, you can specify the tier\n\t// to create the parameter in. Whenever you specify a tier in the request,\n\t// Parameter Store creates or updates the parameter according to that request.\n\t// However, if you don't specify a tier in a request, Parameter Store assigns the\n\t// tier based on the current Parameter Store default tier configuration. The\n\t// default tier when you begin using Parameter Store is the standard-parameter\n\t// tier. If you use the advanced-parameter tier, you can specify one of the\n\t// following as the default:\n\t//   - Advanced: With this option, Parameter Store evaluates all requests as\n\t//   advanced parameters.\n\t//   - Intelligent-Tiering: With this option, Parameter Store evaluates each\n\t//   request to determine if the parameter is standard or advanced. If the request\n\t//   doesn't include any options that require an advanced parameter, the parameter is\n\t//   created in the standard-parameter tier. If one or more options requiring an\n\t//   advanced parameter are included in the request, Parameter Store create a\n\t//   parameter in the advanced-parameter tier. This approach helps control your\n\t//   parameter-related costs by always creating standard parameters unless an\n\t//   advanced parameter is necessary.\n\t// Options that require an advanced parameter include the following:\n\t//   - The content size of the parameter is more than 4 KB.\n\t//   - The parameter uses a parameter policy.\n\t//   - More than 10,000 parameters already exist in your Amazon Web Services\n\t//   account in the current Amazon Web Services Region.\n\t// For more information about configuring the default tier option, see Specifying\n\t// a default parameter tier (https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-default-tier.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tTier types.ParameterTier\n\n\t// The type of parameter that you want to add to the system. SecureString isn't\n\t// currently supported for CloudFormation templates. Items in a StringList must be\n\t// separated by a comma (,). You can't use other punctuation or special character\n\t// to escape items in the list. If you have a parameter value that requires a\n\t// comma, then use the String data type. Specifying a parameter type isn't\n\t// required when updating a parameter. You must specify a parameter type when\n\t// creating a parameter.\n\tType types.ParameterType\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutParameterOutput struct {\n\n\t// The tier assigned to the parameter.\n\tTier types.ParameterTier\n\n\t// The new version number of a parameter. If you edit a parameter value, Parameter\n\t// Store automatically creates a new version and assigns this new version a unique\n\t// ID. You can reference a parameter version ID in API operations or in Systems\n\t// Manager documents (SSM documents). By default, if you don't specify a specific\n\t// version, the system returns the latest parameter value when a parameter is\n\t// called.\n\tVersion int64\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutParameterMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutParameter{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"PutParameter\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutParameterValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutParameter(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutParameter(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"PutParameter\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutResourcePolicy.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates or updates a Systems Manager resource policy. A resource policy helps\n// you to define the IAM entity (for example, an Amazon Web Services account) that\n// can manage your Systems Manager resources. Currently, OpsItemGroup is the only\n// resource that supports Systems Manager resource policies. The resource policy\n// for OpsItemGroup enables Amazon Web Services accounts to view and interact with\n// OpsCenter operational work items (OpsItems).\nfunc (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutResourcePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutResourcePolicy\", params, optFns, c.addOperationPutResourcePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutResourcePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype PutResourcePolicyInput struct {\n\n\t// A policy you want to associate with a resource.\n\t//\n\t// This member is required.\n\tPolicy *string\n\n\t// Amazon Resource Name (ARN) of the resource to which you want to attach a policy.\n\t//\n\t// This member is required.\n\tResourceArn *string\n\n\t// ID of the current policy version. The hash helps to prevent a situation where\n\t// multiple users attempt to overwrite a policy. You must provide this hash when\n\t// updating or deleting a policy.\n\tPolicyHash *string\n\n\t// The policy ID.\n\tPolicyId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype PutResourcePolicyOutput struct {\n\n\t// ID of the current policy version.\n\tPolicyHash *string\n\n\t// The policy ID. To update a policy, you must specify PolicyId and PolicyHash .\n\tPolicyId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"PutResourcePolicy\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"PutResourcePolicy\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterDefaultPatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Defines the default patch baseline for the relevant operating system. To reset\n// the Amazon Web Services-predefined patch baseline as the default, specify the\n// full patch baseline Amazon Resource Name (ARN) as the baseline ID value. For\n// example, for CentOS, specify\n// arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0574b43a65ea646ed instead of\n// pb-0574b43a65ea646ed .\nfunc (c *Client) RegisterDefaultPatchBaseline(ctx context.Context, params *RegisterDefaultPatchBaselineInput, optFns ...func(*Options)) (*RegisterDefaultPatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &RegisterDefaultPatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RegisterDefaultPatchBaseline\", params, optFns, c.addOperationRegisterDefaultPatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RegisterDefaultPatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RegisterDefaultPatchBaselineInput struct {\n\n\t// The ID of the patch baseline that should be the default patch baseline.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype RegisterDefaultPatchBaselineOutput struct {\n\n\t// The ID of the default patch baseline.\n\tBaselineId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterDefaultPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterDefaultPatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RegisterDefaultPatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRegisterDefaultPatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDefaultPatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opRegisterDefaultPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RegisterDefaultPatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterPatchBaselineForPatchGroup.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Registers a patch baseline for a patch group.\nfunc (c *Client) RegisterPatchBaselineForPatchGroup(ctx context.Context, params *RegisterPatchBaselineForPatchGroupInput, optFns ...func(*Options)) (*RegisterPatchBaselineForPatchGroupOutput, error) {\n\tif params == nil {\n\t\tparams = &RegisterPatchBaselineForPatchGroupInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RegisterPatchBaselineForPatchGroup\", params, optFns, c.addOperationRegisterPatchBaselineForPatchGroupMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RegisterPatchBaselineForPatchGroupOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RegisterPatchBaselineForPatchGroupInput struct {\n\n\t// The ID of the patch baseline to register with the patch group.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\t// The name of the patch group to be registered with the patch baseline.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype RegisterPatchBaselineForPatchGroupOutput struct {\n\n\t// The ID of the patch baseline the patch group was registered with.\n\tBaselineId *string\n\n\t// The name of the patch group registered with the patch baseline.\n\tPatchGroup *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterPatchBaselineForPatchGroup{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RegisterPatchBaselineForPatchGroup\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRegisterPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opRegisterPatchBaselineForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RegisterPatchBaselineForPatchGroup\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTargetWithMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Registers a target with a maintenance window.\nfunc (c *Client) RegisterTargetWithMaintenanceWindow(ctx context.Context, params *RegisterTargetWithMaintenanceWindowInput, optFns ...func(*Options)) (*RegisterTargetWithMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &RegisterTargetWithMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RegisterTargetWithMaintenanceWindow\", params, optFns, c.addOperationRegisterTargetWithMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RegisterTargetWithMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RegisterTargetWithMaintenanceWindowInput struct {\n\n\t// The type of target being registered with the maintenance window.\n\t//\n\t// This member is required.\n\tResourceType types.MaintenanceWindowResourceType\n\n\t// The targets to register with the maintenance window. In other words, the\n\t// managed nodes to run commands on when the maintenance window runs. If a single\n\t// maintenance window task is registered with multiple targets, its task\n\t// invocations occur sequentially and not in parallel. If your task must run on\n\t// multiple targets at the same time, register a task for each target individually\n\t// and assign each task the same priority level. You can specify targets using\n\t// managed node IDs, resource group names, or tags that have been applied to\n\t// managed nodes. Example 1: Specify managed node IDs Key=InstanceIds,Values=,,\n\t// Example 2: Use tag key-pairs applied to managed nodes Key=tag:,Values=, Example\n\t// 3: Use tag-keys applied to managed nodes Key=tag-key,Values=, Example 4: Use\n\t// resource group names Key=resource-groups:Name,Values= Example 5: Use filters\n\t// for resource group types Key=resource-groups:ResourceTypeFilters,Values=, For\n\t// Key=resource-groups:ResourceTypeFilters , specify resource types in the\n\t// following format\n\t// Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC\n\t// For more information about these examples formats, including the best use case\n\t// for each one, see Examples: Register targets with a maintenance window (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\t//\n\t// This member is required.\n\tTargets []types.Target\n\n\t// The ID of the maintenance window the target should be registered with.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// User-provided idempotency token.\n\tClientToken *string\n\n\t// An optional description for the target.\n\tDescription *string\n\n\t// An optional name for the target.\n\tName *string\n\n\t// User-provided value that will be included in any Amazon CloudWatch Events\n\t// events raised while running tasks for these targets in this maintenance window.\n\tOwnerInformation *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype RegisterTargetWithMaintenanceWindowOutput struct {\n\n\t// The ID of the target definition in this maintenance window.\n\tWindowTargetId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterTargetWithMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RegisterTargetWithMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addIdempotencyToken_opRegisterTargetWithMaintenanceWindowMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRegisterTargetWithMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTargetWithMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype idempotencyToken_initializeOpRegisterTargetWithMaintenanceWindow struct {\n\ttokenProvider IdempotencyTokenProvider\n}\n\nfunc (*idempotencyToken_initializeOpRegisterTargetWithMaintenanceWindow) ID() string {\n\treturn \"OperationIdempotencyTokenAutoFill\"\n}\n\nfunc (m *idempotencyToken_initializeOpRegisterTargetWithMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.tokenProvider == nil {\n\t\treturn next.HandleInitialize(ctx, in)\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterTargetWithMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expected middleware input to be of type *RegisterTargetWithMaintenanceWindowInput \")\n\t}\n\n\tif input.ClientToken == nil {\n\t\tt, err := m.tokenProvider.GetIdempotencyToken()\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\t\tinput.ClientToken = &t\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\nfunc addIdempotencyToken_opRegisterTargetWithMaintenanceWindowMiddleware(stack *middleware.Stack, cfg Options) error {\n\treturn stack.Initialize.Add(&idempotencyToken_initializeOpRegisterTargetWithMaintenanceWindow{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)\n}\n\nfunc newServiceMetadataMiddleware_opRegisterTargetWithMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RegisterTargetWithMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Adds a new task to a maintenance window.\nfunc (c *Client) RegisterTaskWithMaintenanceWindow(ctx context.Context, params *RegisterTaskWithMaintenanceWindowInput, optFns ...func(*Options)) (*RegisterTaskWithMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &RegisterTaskWithMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RegisterTaskWithMaintenanceWindow\", params, optFns, c.addOperationRegisterTaskWithMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RegisterTaskWithMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RegisterTaskWithMaintenanceWindowInput struct {\n\n\t// The ARN of the task to run.\n\t//\n\t// This member is required.\n\tTaskArn *string\n\n\t// The type of task being registered.\n\t//\n\t// This member is required.\n\tTaskType types.MaintenanceWindowTaskType\n\n\t// The ID of the maintenance window the task should be added to.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The CloudWatch alarm you want to apply to your maintenance window task.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// User-provided idempotency token.\n\tClientToken *string\n\n\t// Indicates whether tasks should continue to run after the cutoff time specified\n\t// in the maintenance windows is reached.\n\t//   - CONTINUE_TASK : When the cutoff time is reached, any tasks that are running\n\t//   continue. The default value.\n\t//   - CANCEL_TASK :\n\t//   - For Automation, Lambda, Step Functions tasks: When the cutoff time is\n\t//   reached, any task invocations that are already running continue, but no new task\n\t//   invocations are started.\n\t//   - For Run Command tasks: When the cutoff time is reached, the system sends a\n\t//   CancelCommand operation that attempts to cancel the command associated with\n\t//   the task. However, there is no guarantee that the command will be terminated and\n\t//   the underlying process stopped. The status for tasks that are not completed\n\t//   is TIMED_OUT .\n\tCutoffBehavior types.MaintenanceWindowTaskCutoffBehavior\n\n\t// An optional description for the task.\n\tDescription *string\n\n\t// A structure containing information about an Amazon Simple Storage Service\n\t// (Amazon S3) bucket to write managed node-level logs to. LoggingInfo has been\n\t// deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to\n\t// contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options\n\t// in the TaskInvocationParameters structure. For information about how Amazon Web\n\t// Services Systems Manager handles these options for the supported maintenance\n\t// window task types, see MaintenanceWindowTaskInvocationParameters .\n\tLoggingInfo *types.LoggingInfo\n\n\t// The maximum number of targets this task can be run for, in parallel. Although\n\t// this element is listed as \"Required: No\", a value can be omitted only when you\n\t// are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxConcurrency *string\n\n\t// The maximum number of errors allowed before this task stops being scheduled.\n\t// Although this element is listed as \"Required: No\", a value can be omitted only\n\t// when you are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxErrors *string\n\n\t// An optional name for the task.\n\tName *string\n\n\t// The priority of the task in the maintenance window, the lower the number the\n\t// higher the priority. Tasks in a maintenance window are scheduled in priority\n\t// order with tasks that have the same priority scheduled in parallel.\n\tPriority *int32\n\n\t// The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services\n\t// Systems Manager to assume when running a maintenance window task. If you do not\n\t// specify a service role ARN, Systems Manager uses your account's service-linked\n\t// role. If no service-linked role for Systems Manager exists in your account, it\n\t// is created when you run RegisterTaskWithMaintenanceWindow . For more\n\t// information, see the following topics in the in the Amazon Web Services Systems\n\t// Manager User Guide:\n\t//   - Using service-linked roles for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions)\n\t//   - Should I use a service-linked role or a custom service role to run\n\t//   maintenance window tasks?  (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role)\n\tServiceRoleArn *string\n\n\t// The targets (either managed nodes or maintenance window targets). One or more\n\t// targets must be specified for maintenance window Run Command-type tasks.\n\t// Depending on the task, targets are optional for other maintenance window task\n\t// types (Automation, Lambda, and Step Functions). For more information about\n\t// running tasks that don't specify targets, see Registering maintenance window\n\t// tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// in the Amazon Web Services Systems Manager User Guide. Specify managed nodes\n\t// using the following format: Key=InstanceIds,Values=, Specify maintenance window\n\t// targets using the following format: Key=WindowTargetIds,Values=,\n\tTargets []types.Target\n\n\t// The parameters that the task should use during execution. Populate only the\n\t// fields that match the task type. All other fields should be empty.\n\tTaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters\n\n\t// The parameters that should be passed to the task when it is run. TaskParameters\n\t// has been deprecated. To specify parameters to pass to a task when it runs,\n\t// instead use the Parameters option in the TaskInvocationParameters structure.\n\t// For information about how Systems Manager handles these options for the\n\t// supported maintenance window task types, see\n\t// MaintenanceWindowTaskInvocationParameters .\n\tTaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression\n\n\tnoSmithyDocumentSerde\n}\n\ntype RegisterTaskWithMaintenanceWindowOutput struct {\n\n\t// The ID of the task in the maintenance window.\n\tWindowTaskId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterTaskWithMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RegisterTaskWithMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addIdempotencyToken_opRegisterTaskWithMaintenanceWindowMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRegisterTaskWithMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTaskWithMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype idempotencyToken_initializeOpRegisterTaskWithMaintenanceWindow struct {\n\ttokenProvider IdempotencyTokenProvider\n}\n\nfunc (*idempotencyToken_initializeOpRegisterTaskWithMaintenanceWindow) ID() string {\n\treturn \"OperationIdempotencyTokenAutoFill\"\n}\n\nfunc (m *idempotencyToken_initializeOpRegisterTaskWithMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.tokenProvider == nil {\n\t\treturn next.HandleInitialize(ctx, in)\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterTaskWithMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"expected middleware input to be of type *RegisterTaskWithMaintenanceWindowInput \")\n\t}\n\n\tif input.ClientToken == nil {\n\t\tt, err := m.tokenProvider.GetIdempotencyToken()\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\t\tinput.ClientToken = &t\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\nfunc addIdempotencyToken_opRegisterTaskWithMaintenanceWindowMiddleware(stack *middleware.Stack, cfg Options) error {\n\treturn stack.Initialize.Add(&idempotencyToken_initializeOpRegisterTaskWithMaintenanceWindow{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)\n}\n\nfunc newServiceMetadataMiddleware_opRegisterTaskWithMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RegisterTaskWithMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RemoveTagsFromResource.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes tag keys from the specified resource.\nfunc (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsFromResourceInput, optFns ...func(*Options)) (*RemoveTagsFromResourceOutput, error) {\n\tif params == nil {\n\t\tparams = &RemoveTagsFromResourceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RemoveTagsFromResource\", params, optFns, c.addOperationRemoveTagsFromResourceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RemoveTagsFromResourceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RemoveTagsFromResourceInput struct {\n\n\t// The ID of the resource from which you want to remove tags. For example:\n\t// ManagedInstance: mi-012345abcde MaintenanceWindow: mw-012345abcde Automation :\n\t// example-c160-4567-8519-012345abcde PatchBaseline: pb-012345abcde OpsMetadata\n\t// object: ResourceID for tagging is created from the Amazon Resource Name (ARN)\n\t// for the object. Specifically, ResourceID is created from the strings that come\n\t// after the word opsmetadata in the ARN. For example, an OpsMetadata object with\n\t// an ARN of\n\t// arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager has a\n\t// ResourceID of either aws/ssm/MyGroup/appmanager or /aws/ssm/MyGroup/appmanager .\n\t// For the Document and Parameter values, use the name of the resource. The\n\t// ManagedInstance type for this API operation is only for on-premises managed\n\t// nodes. Specify the name of the managed node in the following format:\n\t// mi-ID_number. For example, mi-1a2b3c4d5e6f.\n\t//\n\t// This member is required.\n\tResourceId *string\n\n\t// The type of resource from which you want to remove a tag. The ManagedInstance\n\t// type for this API operation is only for on-premises managed nodes. Specify the\n\t// name of the managed node in the following format: mi-ID_number . For example,\n\t// mi-1a2b3c4d5e6f .\n\t//\n\t// This member is required.\n\tResourceType types.ResourceTypeForTagging\n\n\t// Tag keys that you want to remove from the specified resource.\n\t//\n\t// This member is required.\n\tTagKeys []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype RemoveTagsFromResourceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveTagsFromResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveTagsFromResource{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RemoveTagsFromResource\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRemoveTagsFromResourceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTagsFromResource(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opRemoveTagsFromResource(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RemoveTagsFromResource\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResetServiceSetting.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ServiceSetting is an account-level setting for an Amazon Web Services service.\n// This setting defines how a user interacts with or uses a service or a feature of\n// a service. For example, if an Amazon Web Services service charges money to the\n// account based on feature or service usage, then the Amazon Web Services service\n// team might create a default setting of \"false\". This means the user can't use\n// this feature unless they change the setting to \"true\" and intentionally opt in\n// for a paid feature. Services map a SettingId object to a setting value. Amazon\n// Web Services services teams define the default value for a SettingId . You can't\n// create a new SettingId , but you can overwrite the default value if you have the\n// ssm:UpdateServiceSetting permission for the setting. Use the GetServiceSetting\n// API operation to view the current value. Use the UpdateServiceSetting API\n// operation to change the default setting. Reset the service setting for the\n// account to the default value as provisioned by the Amazon Web Services service\n// team.\nfunc (c *Client) ResetServiceSetting(ctx context.Context, params *ResetServiceSettingInput, optFns ...func(*Options)) (*ResetServiceSettingOutput, error) {\n\tif params == nil {\n\t\tparams = &ResetServiceSettingInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ResetServiceSetting\", params, optFns, c.addOperationResetServiceSettingMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ResetServiceSettingOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// The request body of the ResetServiceSetting API operation.\ntype ResetServiceSettingInput struct {\n\n\t// The Amazon Resource Name (ARN) of the service setting to reset. The setting ID\n\t// can be one of the following.\n\t//   - /ssm/managed-instance/default-ec2-instance-management-role\n\t//   - /ssm/automation/customer-script-log-destination\n\t//   - /ssm/automation/customer-script-log-group-name\n\t//   - /ssm/documents/console/public-sharing-permission\n\t//   - /ssm/managed-instance/activation-tier\n\t//   - /ssm/opsinsights/opscenter\n\t//   - /ssm/parameter-store/default-parameter-tier\n\t//   - /ssm/parameter-store/high-throughput-enabled\n\t//\n\t// This member is required.\n\tSettingId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The result body of the ResetServiceSetting API operation.\ntype ResetServiceSettingOutput struct {\n\n\t// The current, effective service setting after calling the ResetServiceSetting\n\t// API operation.\n\tServiceSetting *types.ServiceSetting\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpResetServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResetServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ResetServiceSetting\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpResetServiceSettingValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetServiceSetting(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opResetServiceSetting(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ResetServiceSetting\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResumeSession.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Reconnects a session to a managed node after it has been disconnected.\n// Connections can be resumed for disconnected sessions, but not terminated\n// sessions. This command is primarily for use by client machines to automatically\n// reconnect during intermittent network issues. It isn't intended for any other\n// use.\nfunc (c *Client) ResumeSession(ctx context.Context, params *ResumeSessionInput, optFns ...func(*Options)) (*ResumeSessionOutput, error) {\n\tif params == nil {\n\t\tparams = &ResumeSessionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ResumeSession\", params, optFns, c.addOperationResumeSessionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ResumeSessionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ResumeSessionInput struct {\n\n\t// The ID of the disconnected session to resume.\n\t//\n\t// This member is required.\n\tSessionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ResumeSessionOutput struct {\n\n\t// The ID of the session.\n\tSessionId *string\n\n\t// A URL back to SSM Agent on the managed node that the Session Manager client\n\t// uses to send commands and receive output from the managed node. Format:\n\t// wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output)\n\t// . region represents the Region identifier for an Amazon Web Services Region\n\t// supported by Amazon Web Services Systems Manager, such as us-east-2 for the US\n\t// East (Ohio) Region. For a list of supported region values, see the Region column\n\t// in Systems Manager service endpoints (https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region)\n\t// in the Amazon Web Services General Reference. session-id represents the ID of a\n\t// Session Manager session, such as 1a2b3c4dEXAMPLE .\n\tStreamUrl *string\n\n\t// An encrypted token value containing session and caller information. Used to\n\t// authenticate the connection to the managed node.\n\tTokenValue *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpResumeSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResumeSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ResumeSession\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpResumeSessionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opResumeSession(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opResumeSession(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ResumeSession\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendAutomationSignal.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Sends a signal to an Automation execution to change the current behavior or\n// status of the execution.\nfunc (c *Client) SendAutomationSignal(ctx context.Context, params *SendAutomationSignalInput, optFns ...func(*Options)) (*SendAutomationSignalOutput, error) {\n\tif params == nil {\n\t\tparams = &SendAutomationSignalInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"SendAutomationSignal\", params, optFns, c.addOperationSendAutomationSignalMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*SendAutomationSignalOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype SendAutomationSignalInput struct {\n\n\t// The unique identifier for an existing Automation execution that you want to\n\t// send the signal to.\n\t//\n\t// This member is required.\n\tAutomationExecutionId *string\n\n\t// The type of signal to send to an Automation execution.\n\t//\n\t// This member is required.\n\tSignalType types.SignalType\n\n\t// The data sent with the signal. The data schema depends on the type of signal\n\t// used in the request. For Approve and Reject signal types, the payload is an\n\t// optional comment that you can send with the signal type. For example:\n\t// Comment=\"Looks good\" For StartStep and Resume signal types, you must send the\n\t// name of the Automation step to start or resume as the payload. For example:\n\t// StepName=\"step1\" For the StopStep signal type, you must send the step execution\n\t// ID as the payload. For example:\n\t// StepExecutionId=\"97fff367-fc5a-4299-aed8-0123456789ab\"\n\tPayload map[string][]string\n\n\tnoSmithyDocumentSerde\n}\n\ntype SendAutomationSignalOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpSendAutomationSignal{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSendAutomationSignal{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"SendAutomationSignal\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpSendAutomationSignalValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendAutomationSignal(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opSendAutomationSignal(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"SendAutomationSignal\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendCommand.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Runs commands on one or more managed nodes.\nfunc (c *Client) SendCommand(ctx context.Context, params *SendCommandInput, optFns ...func(*Options)) (*SendCommandOutput, error) {\n\tif params == nil {\n\t\tparams = &SendCommandInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"SendCommand\", params, optFns, c.addOperationSendCommandMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*SendCommandOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype SendCommandInput struct {\n\n\t// The name of the Amazon Web Services Systems Manager document (SSM document) to\n\t// run. This can be a public document or a custom document. To run a shared\n\t// document belonging to another account, specify the document Amazon Resource Name\n\t// (ARN). For more information about how to use shared documents, see Using shared\n\t// SSM documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html)\n\t// in the Amazon Web Services Systems Manager User Guide. If you specify a document\n\t// name or ARN that hasn't been shared with your account, you receive an\n\t// InvalidDocument error.\n\t//\n\t// This member is required.\n\tDocumentName *string\n\n\t// The CloudWatch alarm you want to apply to your command.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// Enables Amazon Web Services Systems Manager to send Run Command output to\n\t// Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services\n\t// Systems Manager.\n\tCloudWatchOutputConfig *types.CloudWatchOutputConfig\n\n\t// User-specified information about the command, such as a brief description of\n\t// what the command should do.\n\tComment *string\n\n\t// The Sha256 or Sha1 hash created by the system when the document was created.\n\t// Sha1 hashes have been deprecated.\n\tDocumentHash *string\n\n\t// Sha256 or Sha1. Sha1 hashes have been deprecated.\n\tDocumentHashType types.DocumentHashType\n\n\t// The SSM document version to use in the request. You can specify $DEFAULT,\n\t// $LATEST, or a specific version number. If you run commands by using the Command\n\t// Line Interface (Amazon Web Services CLI), then you must escape the first two\n\t// options by using a backslash. If you specify a version number, then you don't\n\t// need to use the backslash. For example: --document-version \"\\$DEFAULT\"\n\t// --document-version \"\\$LATEST\" --document-version \"3\"\n\tDocumentVersion *string\n\n\t// The IDs of the managed nodes where the command should run. Specifying managed\n\t// node IDs is most useful when you are targeting a limited number of managed\n\t// nodes, though you can specify up to 50 IDs. To target a larger number of managed\n\t// nodes, or if you prefer not to list individual node IDs, we recommend using the\n\t// Targets option instead. Using Targets , which accepts tag key-value pairs to\n\t// identify the managed nodes to send commands to, you can a send command to tens,\n\t// hundreds, or thousands of nodes at once. For more information about how to use\n\t// targets, see Using targets and rate controls to send commands to a fleet (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tInstanceIds []string\n\n\t// (Optional) The maximum number of managed nodes that are allowed to run the\n\t// command at the same time. You can specify a number such as 10 or a percentage\n\t// such as 10%. The default value is 50 . For more information about how to use\n\t// MaxConcurrency , see Using concurrency controls (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tMaxConcurrency *string\n\n\t// The maximum number of errors allowed without the command failing. When the\n\t// command fails one more time beyond the value of MaxErrors , the systems stops\n\t// sending the command to additional targets. You can specify a number like 10 or a\n\t// percentage like 10%. The default value is 0 . For more information about how to\n\t// use MaxErrors , see Using error controls (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-maxerrors)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tMaxErrors *string\n\n\t// Configurations for sending notifications.\n\tNotificationConfig *types.NotificationConfig\n\n\t// The name of the S3 bucket where command execution responses should be stored.\n\tOutputS3BucketName *string\n\n\t// The directory structure within the S3 bucket where the responses should be\n\t// stored.\n\tOutputS3KeyPrefix *string\n\n\t// (Deprecated) You can no longer specify this parameter. The system ignores it.\n\t// Instead, Systems Manager automatically determines the Amazon Web Services Region\n\t// of the S3 bucket.\n\tOutputS3Region *string\n\n\t// The required and optional parameters specified in the document being run.\n\tParameters map[string][]string\n\n\t// The ARN of the Identity and Access Management (IAM) service role to use to\n\t// publish Amazon Simple Notification Service (Amazon SNS) notifications for Run\n\t// Command commands. This role must provide the sns:Publish permission for your\n\t// notification topic. For information about creating and using this service role,\n\t// see Monitoring Systems Manager status changes using Amazon SNS notifications (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tServiceRoleArn *string\n\n\t// An array of search criteria that targets managed nodes using a Key,Value\n\t// combination that you specify. Specifying targets is most useful when you want to\n\t// send a command to a large number of managed nodes at once. Using Targets , which\n\t// accepts tag key-value pairs to identify managed nodes, you can send a command to\n\t// tens, hundreds, or thousands of nodes at once. To send a command to a smaller\n\t// number of managed nodes, you can use the InstanceIds option instead. For more\n\t// information about how to use targets, see Sending commands to a fleet (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tTargets []types.Target\n\n\t// If this time is reached and the command hasn't already started running, it\n\t// won't run.\n\tTimeoutSeconds *int32\n\n\tnoSmithyDocumentSerde\n}\n\ntype SendCommandOutput struct {\n\n\t// The request as it was received by Systems Manager. Also provides the command ID\n\t// which can be used future references to this request.\n\tCommand *types.Command\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpSendCommand{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSendCommand{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"SendCommand\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpSendCommandValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCommand(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opSendCommand(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"SendCommand\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAssociationsOnce.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Runs an association immediately and only one time. This operation can be\n// helpful when troubleshooting associations.\nfunc (c *Client) StartAssociationsOnce(ctx context.Context, params *StartAssociationsOnceInput, optFns ...func(*Options)) (*StartAssociationsOnceOutput, error) {\n\tif params == nil {\n\t\tparams = &StartAssociationsOnceInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartAssociationsOnce\", params, optFns, c.addOperationStartAssociationsOnceMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartAssociationsOnceOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartAssociationsOnceInput struct {\n\n\t// The association IDs that you want to run immediately and only one time.\n\t//\n\t// This member is required.\n\tAssociationIds []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartAssociationsOnceOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAssociationsOnce{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAssociationsOnce{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StartAssociationsOnce\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartAssociationsOnceValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAssociationsOnce(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartAssociationsOnce(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StartAssociationsOnce\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAutomationExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Initiates execution of an Automation runbook.\nfunc (c *Client) StartAutomationExecution(ctx context.Context, params *StartAutomationExecutionInput, optFns ...func(*Options)) (*StartAutomationExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &StartAutomationExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartAutomationExecution\", params, optFns, c.addOperationStartAutomationExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartAutomationExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartAutomationExecutionInput struct {\n\n\t// The name of the SSM document to run. This can be a public document or a custom\n\t// document. To run a shared document belonging to another account, specify the\n\t// document ARN. For more information about how to use shared documents, see Using\n\t// shared SSM documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\t//\n\t// This member is required.\n\tDocumentName *string\n\n\t// The CloudWatch alarm you want to apply to your automation.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// User-provided idempotency token. The token must be unique, is case insensitive,\n\t// enforces the UUID format, and can't be reused.\n\tClientToken *string\n\n\t// The version of the Automation runbook to use for this execution.\n\tDocumentVersion *string\n\n\t// The maximum number of targets allowed to run this task in parallel. You can\n\t// specify a number, such as 10, or a percentage, such as 10%. The default value is\n\t// 10 .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops running the\n\t// automation on additional targets. You can specify either an absolute number of\n\t// errors, for example 10, or a percentage of the target set, for example 10%. If\n\t// you specify 3, for example, the system stops running the automation when the\n\t// fourth error is received. If you specify 0, then the system stops running the\n\t// automation on additional targets after the first error result is returned. If\n\t// you run an automation on 50 resources and set max-errors to 10%, then the system\n\t// stops running the automation on additional targets when the sixth error is\n\t// received. Executions that are already running an automation when max-errors is\n\t// reached are allowed to complete, but some of these executions may fail as well.\n\t// If you need to ensure that there won't be more than max-errors failed\n\t// executions, set max-concurrency to 1 so the executions proceed one at a time.\n\tMaxErrors *string\n\n\t// The execution mode of the automation. Valid modes include the following: Auto\n\t// and Interactive. The default mode is Auto.\n\tMode types.ExecutionMode\n\n\t// A key-value map of execution parameters, which match the declared parameters in\n\t// the Automation runbook.\n\tParameters map[string][]string\n\n\t// Optional metadata that you assign to a resource. You can specify a maximum of\n\t// five tags for an automation. Tags enable you to categorize a resource in\n\t// different ways, such as by purpose, owner, or environment. For example, you\n\t// might want to tag an automation to identify an environment or operating system.\n\t// In this case, you could specify the following key-value pairs:\n\t//   - Key=environment,Value=test\n\t//   - Key=OS,Value=Windows\n\t// To add tags to an existing automation, use the AddTagsToResource operation.\n\tTags []types.Tag\n\n\t// A location is a combination of Amazon Web Services Regions and/or Amazon Web\n\t// Services accounts where you want to run the automation. Use this operation to\n\t// start an automation in multiple Amazon Web Services Regions and multiple Amazon\n\t// Web Services accounts. For more information, see Running Automation workflows\n\t// in multiple Amazon Web Services Regions and Amazon Web Services accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tTargetLocations []types.TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The name of the parameter used as the target resource for the rate-controlled\n\t// execution. Required if you specify targets.\n\tTargetParameterName *string\n\n\t// A key-value mapping to target resources. Required if you specify\n\t// TargetParameterName.\n\tTargets []types.Target\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartAutomationExecutionOutput struct {\n\n\t// The unique ID of a newly scheduled automation execution.\n\tAutomationExecutionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StartAutomationExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartAutomationExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAutomationExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartAutomationExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StartAutomationExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartChangeRequestExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Creates a change request for Change Manager. The Automation runbooks specified\n// in the change request run only after all required approvals for the change\n// request have been received.\nfunc (c *Client) StartChangeRequestExecution(ctx context.Context, params *StartChangeRequestExecutionInput, optFns ...func(*Options)) (*StartChangeRequestExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &StartChangeRequestExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartChangeRequestExecution\", params, optFns, c.addOperationStartChangeRequestExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartChangeRequestExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartChangeRequestExecutionInput struct {\n\n\t// The name of the change template document to run during the runbook workflow.\n\t//\n\t// This member is required.\n\tDocumentName *string\n\n\t// Information about the Automation runbooks that are run during the runbook\n\t// workflow. The Automation runbooks specified for the runbook workflow can't run\n\t// until all required approvals for the change request have been received.\n\t//\n\t// This member is required.\n\tRunbooks []types.Runbook\n\n\t// Indicates whether the change request can be approved automatically without the\n\t// need for manual approvals. If AutoApprovable is enabled in a change template,\n\t// then setting AutoApprove to true in StartChangeRequestExecution creates a\n\t// change request that bypasses approver review. Change Calendar restrictions are\n\t// not bypassed in this scenario. If the state of an associated calendar is CLOSED\n\t// , change freeze approvers must still grant permission for this change request to\n\t// run. If they don't, the change won't be processed until the calendar state is\n\t// again OPEN .\n\tAutoApprove bool\n\n\t// User-provided details about the change. If no details are provided, content\n\t// specified in the Template information section of the associated change template\n\t// is added.\n\tChangeDetails *string\n\n\t// The name of the change request associated with the runbook workflow to be run.\n\tChangeRequestName *string\n\n\t// The user-provided idempotency token. The token must be unique, is case\n\t// insensitive, enforces the UUID format, and can't be reused.\n\tClientToken *string\n\n\t// The version of the change template document to run during the runbook workflow.\n\tDocumentVersion *string\n\n\t// A key-value map of parameters that match the declared parameters in the change\n\t// template document.\n\tParameters map[string][]string\n\n\t// The time that the requester expects the runbook workflow related to the change\n\t// request to complete. The time is an estimate only that the requester provides\n\t// for reviewers.\n\tScheduledEndTime *time.Time\n\n\t// The date and time specified in the change request to run the Automation\n\t// runbooks. The Automation runbooks specified for the runbook workflow can't run\n\t// until all required approvals for the change request have been received.\n\tScheduledTime *time.Time\n\n\t// Optional metadata that you assign to a resource. You can specify a maximum of\n\t// five tags for a change request. Tags enable you to categorize a resource in\n\t// different ways, such as by purpose, owner, or environment. For example, you\n\t// might want to tag a change request to identify an environment or target Amazon\n\t// Web Services Region. In this case, you could specify the following key-value\n\t// pairs:\n\t//   - Key=Environment,Value=Production\n\t//   - Key=Region,Value=us-east-2\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartChangeRequestExecutionOutput struct {\n\n\t// The unique ID of a runbook workflow operation. (A runbook workflow is a type of\n\t// Automation operation.)\n\tAutomationExecutionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartChangeRequestExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartChangeRequestExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StartChangeRequestExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartChangeRequestExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartChangeRequestExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartChangeRequestExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StartChangeRequestExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartSession.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Initiates a connection to a target (for example, a managed node) for a Session\n// Manager session. Returns a URL and token that can be used to open a WebSocket\n// connection for sending input and receiving outputs. Amazon Web Services CLI\n// usage: start-session is an interactive command that requires the Session\n// Manager plugin to be installed on the client machine making the call. For\n// information, see Install the Session Manager plugin for the Amazon Web Services\n// CLI (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)\n// in the Amazon Web Services Systems Manager User Guide. Amazon Web Services Tools\n// for PowerShell usage: Start-SSMSession isn't currently supported by Amazon Web\n// Services Tools for PowerShell on Windows local machines.\nfunc (c *Client) StartSession(ctx context.Context, params *StartSessionInput, optFns ...func(*Options)) (*StartSessionOutput, error) {\n\tif params == nil {\n\t\tparams = &StartSessionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartSession\", params, optFns, c.addOperationStartSessionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartSessionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartSessionInput struct {\n\n\t// The managed node to connect to for the session.\n\t//\n\t// This member is required.\n\tTarget *string\n\n\t// The name of the SSM document you want to use to define the type of session,\n\t// input parameters, or preferences for the session. For example,\n\t// SSM-SessionManagerRunShell . You can call the GetDocument API to verify the\n\t// document exists before attempting to start a session. If no document name is\n\t// provided, a shell to the managed node is launched by default. For more\n\t// information, see Start a session (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tDocumentName *string\n\n\t// The values you want to specify for the parameters defined in the Session\n\t// document.\n\tParameters map[string][]string\n\n\t// The reason for connecting to the instance. This value is included in the\n\t// details for the Amazon CloudWatch Events event created when you start the\n\t// session.\n\tReason *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartSessionOutput struct {\n\n\t// The ID of the session.\n\tSessionId *string\n\n\t// A URL back to SSM Agent on the managed node that the Session Manager client\n\t// uses to send commands and receive output from the node. Format:\n\t// wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output)\n\t// region represents the Region identifier for an Amazon Web Services Region\n\t// supported by Amazon Web Services Systems Manager, such as us-east-2 for the US\n\t// East (Ohio) Region. For a list of supported region values, see the Region column\n\t// in Systems Manager service endpoints (https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region)\n\t// in the Amazon Web Services General Reference. session-id represents the ID of a\n\t// Session Manager session, such as 1a2b3c4dEXAMPLE .\n\tStreamUrl *string\n\n\t// An encrypted token value containing session and caller information. This token\n\t// is used to authenticate the connection to the managed node, and is valid only\n\t// long enough to ensure the connection is successful. Never share your session's\n\t// token.\n\tTokenValue *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStartSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StartSession\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartSessionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSession(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartSession(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StartSession\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StopAutomationExecution.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Stop an Automation that is currently running.\nfunc (c *Client) StopAutomationExecution(ctx context.Context, params *StopAutomationExecutionInput, optFns ...func(*Options)) (*StopAutomationExecutionOutput, error) {\n\tif params == nil {\n\t\tparams = &StopAutomationExecutionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StopAutomationExecution\", params, optFns, c.addOperationStopAutomationExecutionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StopAutomationExecutionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StopAutomationExecutionInput struct {\n\n\t// The execution ID of the Automation to stop.\n\t//\n\t// This member is required.\n\tAutomationExecutionId *string\n\n\t// The stop request type. Valid types include the following: Cancel and Complete.\n\t// The default type is Cancel.\n\tType types.StopType\n\n\tnoSmithyDocumentSerde\n}\n\ntype StopAutomationExecutionOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpStopAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopAutomationExecution{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StopAutomationExecution\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStopAutomationExecutionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopAutomationExecution(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStopAutomationExecution(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StopAutomationExecution\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_TerminateSession.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Permanently ends a session and closes the data connection between the Session\n// Manager client and SSM Agent on the managed node. A terminated session can't be\n// resumed.\nfunc (c *Client) TerminateSession(ctx context.Context, params *TerminateSessionInput, optFns ...func(*Options)) (*TerminateSessionOutput, error) {\n\tif params == nil {\n\t\tparams = &TerminateSessionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"TerminateSession\", params, optFns, c.addOperationTerminateSessionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*TerminateSessionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype TerminateSessionInput struct {\n\n\t// The ID of the session to terminate.\n\t//\n\t// This member is required.\n\tSessionId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype TerminateSessionOutput struct {\n\n\t// The ID of the session that has been terminated.\n\tSessionId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpTerminateSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTerminateSession{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"TerminateSession\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpTerminateSessionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateSession(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opTerminateSession(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"TerminateSession\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UnlabelParameterVersion.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Remove a label or labels from a parameter.\nfunc (c *Client) UnlabelParameterVersion(ctx context.Context, params *UnlabelParameterVersionInput, optFns ...func(*Options)) (*UnlabelParameterVersionOutput, error) {\n\tif params == nil {\n\t\tparams = &UnlabelParameterVersionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UnlabelParameterVersion\", params, optFns, c.addOperationUnlabelParameterVersionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UnlabelParameterVersionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UnlabelParameterVersionInput struct {\n\n\t// One or more labels to delete from the specified parameter version.\n\t//\n\t// This member is required.\n\tLabels []string\n\n\t// The name of the parameter from which you want to delete one or more labels.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The specific version of the parameter which you want to delete one or more\n\t// labels from. If it isn't present, the call will fail.\n\t//\n\t// This member is required.\n\tParameterVersion *int64\n\n\tnoSmithyDocumentSerde\n}\n\ntype UnlabelParameterVersionOutput struct {\n\n\t// The labels that aren't attached to the given parameter version.\n\tInvalidLabels []string\n\n\t// A list of all labels deleted from the parameter.\n\tRemovedLabels []string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUnlabelParameterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUnlabelParameterVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUnlabelParameterVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UnlabelParameterVersion\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUnlabelParameterVersionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnlabelParameterVersion(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUnlabelParameterVersion(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UnlabelParameterVersion\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociation.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates an association. You can update the association name and version, the\n// document version, schedule, parameters, and Amazon Simple Storage Service\n// (Amazon S3) output. When you call UpdateAssociation , the system removes all\n// optional parameters from the request and overwrites the association with null\n// values for those parameters. This is by design. You must specify all optional\n// parameters in the call, even if you are not changing the parameters. This\n// includes the Name parameter. Before calling this API action, we recommend that\n// you call the DescribeAssociation API operation and make a note of all optional\n// parameters required for your UpdateAssociation call. In order to call this API\n// operation, a user, group, or role must be granted permission to call the\n// DescribeAssociation API operation. If you don't have permission to call\n// DescribeAssociation , then you receive the following error: An error occurred\n// (AccessDeniedException) when calling the UpdateAssociation operation: User:\n// isn't authorized to perform: ssm:DescribeAssociation on resource: When you\n// update an association, the association immediately runs against the specified\n// targets. You can add the ApplyOnlyAtCronInterval parameter to run the\n// association during the next schedule run.\nfunc (c *Client) UpdateAssociation(ctx context.Context, params *UpdateAssociationInput, optFns ...func(*Options)) (*UpdateAssociationOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateAssociationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateAssociation\", params, optFns, c.addOperationUpdateAssociationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateAssociationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateAssociationInput struct {\n\n\t// The ID of the association you want to update.\n\t//\n\t// This member is required.\n\tAssociationId *string\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// By default, when you update an association, the system runs it immediately\n\t// after it is updated and then according to the schedule you specified. Specify\n\t// this option if you don't want an association to run immediately after you update\n\t// it. This parameter isn't supported for rate expressions. If you chose this\n\t// option when you created an association and later you edit that association or\n\t// you make changes to the SSM document on which that association is based (by\n\t// using the Documents page in the console), State Manager applies the association\n\t// at the next specified cron interval. For example, if you chose the Latest\n\t// version of an SSM document when you created an association and you edit the\n\t// association by choosing a different document version on the Documents page,\n\t// State Manager applies the association at the next specified cron interval if you\n\t// previously selected this option. If this option wasn't selected, State Manager\n\t// immediately runs the association. You can reset this option. To do so, specify\n\t// the no-apply-only-at-cron-interval parameter when you update the association\n\t// from the command line. This parameter forces the association to run immediately\n\t// after updating it and according to the interval specified.\n\tApplyOnlyAtCronInterval bool\n\n\t// The name of the association that you want to update.\n\tAssociationName *string\n\n\t// This parameter is provided for concurrency control purposes. You must specify\n\t// the latest association version in the service. If you want to ensure that this\n\t// request succeeds, either specify $LATEST , or omit this parameter.\n\tAssociationVersion *string\n\n\t// Choose the parameter that will define how your automation will branch out. This\n\t// target is required for associations that use an Automation runbook and target\n\t// resources by using rate controls. Automation is a capability of Amazon Web\n\t// Services Systems Manager.\n\tAutomationTargetParameterName *string\n\n\t// The names or Amazon Resource Names (ARNs) of the Change Calendar type documents\n\t// you want to gate your associations under. The associations only run when that\n\t// change calendar is open. For more information, see Amazon Web Services Systems\n\t// Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar)\n\t// .\n\tCalendarNames []string\n\n\t// The severity level to assign to the association.\n\tComplianceSeverity types.AssociationComplianceSeverity\n\n\t// The document version you want update for the association. State Manager doesn't\n\t// support running associations that use a new version of a document if that\n\t// document is shared from another account. State Manager always runs the default\n\t// version of a document if shared from another account, even though the Systems\n\t// Manager console shows that a new version was processed. If you want to run an\n\t// association using a new version of a document shared form another account, you\n\t// must set the document version to default .\n\tDocumentVersion *string\n\n\t// The maximum number of targets allowed to run the association at the same time.\n\t// You can specify a number, for example 10, or a percentage of the target set, for\n\t// example 10%. The default value is 100%, which means all targets run the\n\t// association at the same time. If a new managed node starts and attempts to run\n\t// an association while Systems Manager is running MaxConcurrency associations,\n\t// the association is allowed to run. During the next association interval, the new\n\t// managed node will process its association within the limit specified for\n\t// MaxConcurrency .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops sending requests\n\t// to run the association on additional targets. You can specify either an absolute\n\t// number of errors, for example 10, or a percentage of the target set, for example\n\t// 10%. If you specify 3, for example, the system stops sending requests when the\n\t// fourth error is received. If you specify 0, then the system stops sending\n\t// requests after the first error is returned. If you run an association on 50\n\t// managed nodes and set MaxError to 10%, then the system stops sending the\n\t// request when the sixth error is received. Executions that are already running an\n\t// association when MaxErrors is reached are allowed to complete, but some of\n\t// these executions may fail as well. If you need to ensure that there won't be\n\t// more than max-errors failed executions, set MaxConcurrency to 1 so that\n\t// executions proceed one at a time.\n\tMaxErrors *string\n\n\t// The name of the SSM Command document or Automation runbook that contains the\n\t// configuration information for the managed node. You can specify Amazon Web\n\t// Services-predefined documents, documents you created, or a document that is\n\t// shared with you from another account. For Systems Manager document (SSM\n\t// document) that are shared with you from other Amazon Web Services accounts, you\n\t// must specify the complete SSM document ARN, in the following format:\n\t// arn:aws:ssm:region:account-id:document/document-name For example:\n\t// arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For Amazon Web\n\t// Services-predefined documents and SSM documents you created in your account, you\n\t// only need to specify the document name. For example, AWS-ApplyPatchBaseline or\n\t// My-Document .\n\tName *string\n\n\t// An S3 bucket where you want to store the results of this request.\n\tOutputLocation *types.InstanceAssociationOutputLocation\n\n\t// The parameters you want to update for the association. If you create a\n\t// parameter using Parameter Store, a capability of Amazon Web Services Systems\n\t// Manager, you can reference the parameter using {{ssm:parameter-name}} .\n\tParameters map[string][]string\n\n\t// The cron expression used to schedule the association that you want to update.\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association. For\n\t// example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could\n\t// specify an offset of 3 to run the association each Sunday after the second\n\t// Thursday of the month. For more information about cron schedules for\n\t// associations, see Reference: Cron and rate expressions for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html)\n\t// in the Amazon Web Services Systems Manager User Guide. To use offsets, you must\n\t// specify the ApplyOnlyAtCronInterval parameter. This option tells the system not\n\t// to run an association immediately after you create it.\n\tScheduleOffset *int32\n\n\t// The mode for generating association compliance. You can specify AUTO or MANUAL .\n\t// In AUTO mode, the system uses the status of the association execution to\n\t// determine the compliance status. If the association execution runs successfully,\n\t// then the association is COMPLIANT . If the association execution doesn't run\n\t// successfully, the association is NON-COMPLIANT . In MANUAL mode, you must\n\t// specify the AssociationId as a parameter for the PutComplianceItems API\n\t// operation. In this case, compliance data isn't managed by State Manager, a\n\t// capability of Amazon Web Services Systems Manager. It is managed by your direct\n\t// call to the PutComplianceItems API operation. By default, all associations use\n\t// AUTO mode.\n\tSyncCompliance types.AssociationSyncCompliance\n\n\t// A location is a combination of Amazon Web Services Regions and Amazon Web\n\t// Services accounts where you want to run the association. Use this action to\n\t// update an association in multiple Regions and multiple accounts.\n\tTargetLocations []types.TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The targets of the association.\n\tTargets []types.Target\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateAssociationOutput struct {\n\n\t// The description of the association that was updated.\n\tAssociationDescription *types.AssociationDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAssociation{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateAssociation\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateAssociationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssociation(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateAssociation(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateAssociation\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociationStatus.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates the status of the Amazon Web Services Systems Manager document (SSM\n// document) associated with the specified managed node. UpdateAssociationStatus\n// is primarily used by the Amazon Web Services Systems Manager Agent (SSM Agent)\n// to report status updates about your associations and is only used for\n// associations created with the InstanceId legacy parameter.\nfunc (c *Client) UpdateAssociationStatus(ctx context.Context, params *UpdateAssociationStatusInput, optFns ...func(*Options)) (*UpdateAssociationStatusOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateAssociationStatusInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateAssociationStatus\", params, optFns, c.addOperationUpdateAssociationStatusMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateAssociationStatusOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateAssociationStatusInput struct {\n\n\t// The association status.\n\t//\n\t// This member is required.\n\tAssociationStatus *types.AssociationStatus\n\n\t// The managed node ID.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The name of the SSM document.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateAssociationStatusOutput struct {\n\n\t// Information about the association.\n\tAssociationDescription *types.AssociationDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAssociationStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAssociationStatus{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateAssociationStatus\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateAssociationStatusValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssociationStatus(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateAssociationStatus(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateAssociationStatus\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocument.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates one or more values for an SSM document.\nfunc (c *Client) UpdateDocument(ctx context.Context, params *UpdateDocumentInput, optFns ...func(*Options)) (*UpdateDocumentOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateDocumentInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateDocument\", params, optFns, c.addOperationUpdateDocumentMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateDocumentOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateDocumentInput struct {\n\n\t// A valid JSON or YAML string.\n\t//\n\t// This member is required.\n\tContent *string\n\n\t// The name of the SSM document that you want to update.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// A list of key-value pairs that describe attachments to a version of a document.\n\tAttachments []types.AttachmentsSource\n\n\t// The friendly name of the SSM document that you want to update. This value can\n\t// differ for each version of the document. If you don't specify a value for this\n\t// parameter in your request, the existing value is applied to the new document\n\t// version.\n\tDisplayName *string\n\n\t// Specify the document format for the new document version. Systems Manager\n\t// supports JSON and YAML documents. JSON is the default format.\n\tDocumentFormat types.DocumentFormat\n\n\t// The version of the document that you want to update. Currently, Systems Manager\n\t// supports updating only the latest version of the document. You can specify the\n\t// version number of the latest version or use the $LATEST variable. If you change\n\t// a document version for a State Manager association, Systems Manager immediately\n\t// runs the association unless you previously specifed the\n\t// apply-only-at-cron-interval parameter.\n\tDocumentVersion *string\n\n\t// Specify a new target type for the document.\n\tTargetType *string\n\n\t// An optional field specifying the version of the artifact you are updating with\n\t// the document. For example, \"Release 12, Update 6\". This value is unique across\n\t// all versions of a document, and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateDocumentOutput struct {\n\n\t// A description of the document that was updated.\n\tDocumentDescription *types.DocumentDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDocument{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateDocument\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateDocumentValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocument(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateDocument(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateDocument\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentDefaultVersion.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Set the default version of a document. If you change a document version for a\n// State Manager association, Systems Manager immediately runs the association\n// unless you previously specifed the apply-only-at-cron-interval parameter.\nfunc (c *Client) UpdateDocumentDefaultVersion(ctx context.Context, params *UpdateDocumentDefaultVersionInput, optFns ...func(*Options)) (*UpdateDocumentDefaultVersionOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateDocumentDefaultVersionInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateDocumentDefaultVersion\", params, optFns, c.addOperationUpdateDocumentDefaultVersionMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateDocumentDefaultVersionOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateDocumentDefaultVersionInput struct {\n\n\t// The version of a custom document that you want to set as the default version.\n\t//\n\t// This member is required.\n\tDocumentVersion *string\n\n\t// The name of a custom document that you want to set as the default version.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateDocumentDefaultVersionOutput struct {\n\n\t// The description of a custom document that you want to set as the default\n\t// version.\n\tDescription *types.DocumentDefaultVersionDescription\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocumentDefaultVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateDocumentDefaultVersion\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateDocumentDefaultVersionValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocumentDefaultVersion(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateDocumentDefaultVersion(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateDocumentDefaultVersion\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates information related to approval reviews for a specific version of a\n// change template in Change Manager.\nfunc (c *Client) UpdateDocumentMetadata(ctx context.Context, params *UpdateDocumentMetadataInput, optFns ...func(*Options)) (*UpdateDocumentMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateDocumentMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateDocumentMetadata\", params, optFns, c.addOperationUpdateDocumentMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateDocumentMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateDocumentMetadataInput struct {\n\n\t// The change template review details to update.\n\t//\n\t// This member is required.\n\tDocumentReviews *types.DocumentReviews\n\n\t// The name of the change template for which a version's metadata is to be updated.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The version of a change template in which to update approval metadata.\n\tDocumentVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateDocumentMetadataOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocumentMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDocumentMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateDocumentMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateDocumentMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocumentMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateDocumentMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateDocumentMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindow.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Updates an existing maintenance window. Only specified parameters are modified.\n// The value you specify for Duration determines the specific end time for the\n// maintenance window based on the time it begins. No maintenance window tasks are\n// permitted to start after the resulting endtime minus the number of hours you\n// specify for Cutoff . For example, if the maintenance window starts at 3 PM, the\n// duration is three hours, and the value you specify for Cutoff is one hour, no\n// maintenance window tasks can start after 5 PM.\nfunc (c *Client) UpdateMaintenanceWindow(ctx context.Context, params *UpdateMaintenanceWindowInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateMaintenanceWindowInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateMaintenanceWindow\", params, optFns, c.addOperationUpdateMaintenanceWindowMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateMaintenanceWindowOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateMaintenanceWindowInput struct {\n\n\t// The ID of the maintenance window to update.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// Whether targets must be registered with the maintenance window before tasks can\n\t// be defined for those targets.\n\tAllowUnassociatedTargets *bool\n\n\t// The number of hours before the end of the maintenance window that Amazon Web\n\t// Services Systems Manager stops scheduling new tasks for execution.\n\tCutoff *int32\n\n\t// An optional description for the update request.\n\tDescription *string\n\n\t// The duration of the maintenance window in hours.\n\tDuration *int32\n\n\t// Whether the maintenance window is enabled.\n\tEnabled *bool\n\n\t// The date and time, in ISO-8601 Extended format, for when you want the\n\t// maintenance window to become inactive. EndDate allows you to set a date and\n\t// time in the future when the maintenance window will no longer run.\n\tEndDate *string\n\n\t// The name of the maintenance window.\n\tName *string\n\n\t// If True , then all fields that are required by the CreateMaintenanceWindow\n\t// operation are also required for this API request. Optional fields that aren't\n\t// specified are set to null.\n\tReplace *bool\n\n\t// The schedule of the maintenance window in the form of a cron or rate expression.\n\tSchedule *string\n\n\t// The number of days to wait after the date and time specified by a cron\n\t// expression before running the maintenance window. For example, the following\n\t// cron expression schedules a maintenance window to run the third Tuesday of every\n\t// month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2 , the\n\t// maintenance window won't run until two days later.\n\tScheduleOffset *int32\n\n\t// The time zone that the scheduled maintenance window executions are based on, in\n\t// Internet Assigned Numbers Authority (IANA) format. For example:\n\t// \"America/Los_Angeles\", \"UTC\", or \"Asia/Seoul\". For more information, see the\n\t// Time Zone Database (https://www.iana.org/time-zones) on the IANA website.\n\tScheduleTimezone *string\n\n\t// The date and time, in ISO-8601 Extended format, for when you want the\n\t// maintenance window to become active. StartDate allows you to delay activation\n\t// of the maintenance window until the specified future date.\n\tStartDate *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateMaintenanceWindowOutput struct {\n\n\t// Whether targets must be registered with the maintenance window before tasks can\n\t// be defined for those targets.\n\tAllowUnassociatedTargets bool\n\n\t// The number of hours before the end of the maintenance window that Amazon Web\n\t// Services Systems Manager stops scheduling new tasks for execution.\n\tCutoff int32\n\n\t// An optional description of the update.\n\tDescription *string\n\n\t// The duration of the maintenance window in hours.\n\tDuration *int32\n\n\t// Whether the maintenance window is enabled.\n\tEnabled bool\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become inactive. The maintenance window won't run after this\n\t// specified time.\n\tEndDate *string\n\n\t// The name of the maintenance window.\n\tName *string\n\n\t// The schedule of the maintenance window in the form of a cron or rate expression.\n\tSchedule *string\n\n\t// The number of days to wait to run a maintenance window after the scheduled cron\n\t// expression date and time.\n\tScheduleOffset *int32\n\n\t// The time zone that the scheduled maintenance window executions are based on, in\n\t// Internet Assigned Numbers Authority (IANA) format. For example:\n\t// \"America/Los_Angeles\", \"UTC\", or \"Asia/Seoul\". For more information, see the\n\t// Time Zone Database (https://www.iana.org/time-zones) on the IANA website.\n\tScheduleTimezone *string\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become active. The maintenance window won't run before this\n\t// specified time.\n\tStartDate *string\n\n\t// The ID of the created maintenance window.\n\tWindowId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMaintenanceWindow{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateMaintenanceWindow\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateMaintenanceWindowValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindow(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateMaintenanceWindow\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTarget.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Modifies the target of an existing maintenance window. You can change the\n// following:\n//   - Name\n//   - Description\n//   - Owner\n//   - IDs for an ID target\n//   - Tags for a Tag target\n//   - From any supported tag type to another. The three supported tag types are\n//     ID target, Tag target, and resource group. For more information, see Target .\n//\n// If a parameter is null, then the corresponding field isn't modified.\nfunc (c *Client) UpdateMaintenanceWindowTarget(ctx context.Context, params *UpdateMaintenanceWindowTargetInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowTargetOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateMaintenanceWindowTargetInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateMaintenanceWindowTarget\", params, optFns, c.addOperationUpdateMaintenanceWindowTargetMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateMaintenanceWindowTargetOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateMaintenanceWindowTargetInput struct {\n\n\t// The maintenance window ID with which to modify the target.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The target ID to modify.\n\t//\n\t// This member is required.\n\tWindowTargetId *string\n\n\t// An optional description for the update.\n\tDescription *string\n\n\t// A name for the update.\n\tName *string\n\n\t// User-provided value that will be included in any Amazon CloudWatch Events\n\t// events raised while running tasks for these targets in this maintenance window.\n\tOwnerInformation *string\n\n\t// If True , then all fields that are required by the\n\t// RegisterTargetWithMaintenanceWindow operation are also required for this API\n\t// request. Optional fields that aren't specified are set to null.\n\tReplace *bool\n\n\t// The targets to add or replace.\n\tTargets []types.Target\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateMaintenanceWindowTargetOutput struct {\n\n\t// The updated description.\n\tDescription *string\n\n\t// The updated name.\n\tName *string\n\n\t// The updated owner.\n\tOwnerInformation *string\n\n\t// The updated targets.\n\tTargets []types.Target\n\n\t// The maintenance window ID specified in the update request.\n\tWindowId *string\n\n\t// The target ID specified in the update request.\n\tWindowTargetId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateMaintenanceWindowTarget\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateMaintenanceWindowTargetValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindowTarget(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateMaintenanceWindowTarget(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateMaintenanceWindowTarget\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTask.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Modifies a task assigned to a maintenance window. You can't change the task\n// type, but you can change the following values:\n//   - TaskARN . For example, you can change a RUN_COMMAND task from\n//     AWS-RunPowerShellScript to AWS-RunShellScript .\n//   - ServiceRoleArn\n//   - TaskInvocationParameters\n//   - Priority\n//   - MaxConcurrency\n//   - MaxErrors\n//\n// One or more targets must be specified for maintenance window Run Command-type\n// tasks. Depending on the task, targets are optional for other maintenance window\n// task types (Automation, Lambda, and Step Functions). For more information about\n// running tasks that don't specify targets, see Registering maintenance window\n// tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n// in the Amazon Web Services Systems Manager User Guide. If the value for a\n// parameter in UpdateMaintenanceWindowTask is null, then the corresponding field\n// isn't modified. If you set Replace to true, then all fields required by the\n// RegisterTaskWithMaintenanceWindow operation are required for this request.\n// Optional fields that aren't specified are set to null. When you update a\n// maintenance window task that has options specified in TaskInvocationParameters ,\n// you must provide again all the TaskInvocationParameters values that you want to\n// retain. The values you don't specify again are removed. For example, suppose\n// that when you registered a Run Command task, you specified\n// TaskInvocationParameters values for Comment , NotificationConfig , and\n// OutputS3BucketName . If you update the maintenance window task and specify only\n// a different OutputS3BucketName value, the values for Comment and\n// NotificationConfig are removed.\nfunc (c *Client) UpdateMaintenanceWindowTask(ctx context.Context, params *UpdateMaintenanceWindowTaskInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowTaskOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateMaintenanceWindowTaskInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateMaintenanceWindowTask\", params, optFns, c.addOperationUpdateMaintenanceWindowTaskMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateMaintenanceWindowTaskOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateMaintenanceWindowTaskInput struct {\n\n\t// The maintenance window ID that contains the task to modify.\n\t//\n\t// This member is required.\n\tWindowId *string\n\n\t// The task ID to modify.\n\t//\n\t// This member is required.\n\tWindowTaskId *string\n\n\t// The CloudWatch alarm you want to apply to your maintenance window task.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// Indicates whether tasks should continue to run after the cutoff time specified\n\t// in the maintenance windows is reached.\n\t//   - CONTINUE_TASK : When the cutoff time is reached, any tasks that are running\n\t//   continue. The default value.\n\t//   - CANCEL_TASK :\n\t//   - For Automation, Lambda, Step Functions tasks: When the cutoff time is\n\t//   reached, any task invocations that are already running continue, but no new task\n\t//   invocations are started.\n\t//   - For Run Command tasks: When the cutoff time is reached, the system sends a\n\t//   CancelCommand operation that attempts to cancel the command associated with\n\t//   the task. However, there is no guarantee that the command will be terminated and\n\t//   the underlying process stopped. The status for tasks that are not completed\n\t//   is TIMED_OUT .\n\tCutoffBehavior types.MaintenanceWindowTaskCutoffBehavior\n\n\t// The new task description to specify.\n\tDescription *string\n\n\t// The new logging location in Amazon S3 to specify. LoggingInfo has been\n\t// deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to\n\t// contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options\n\t// in the TaskInvocationParameters structure. For information about how Amazon Web\n\t// Services Systems Manager handles these options for the supported maintenance\n\t// window task types, see MaintenanceWindowTaskInvocationParameters .\n\tLoggingInfo *types.LoggingInfo\n\n\t// The new MaxConcurrency value you want to specify. MaxConcurrency is the number\n\t// of targets that are allowed to run this task, in parallel. Although this element\n\t// is listed as \"Required: No\", a value can be omitted only when you are\n\t// registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxConcurrency *string\n\n\t// The new MaxErrors value to specify. MaxErrors is the maximum number of errors\n\t// that are allowed before the task stops being scheduled. Although this element is\n\t// listed as \"Required: No\", a value can be omitted only when you are registering\n\t// or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxErrors *string\n\n\t// The new task name to specify.\n\tName *string\n\n\t// The new task priority to specify. The lower the number, the higher the\n\t// priority. Tasks that have the same priority are scheduled in parallel.\n\tPriority *int32\n\n\t// If True, then all fields that are required by the\n\t// RegisterTaskWithMaintenanceWindow operation are also required for this API\n\t// request. Optional fields that aren't specified are set to null.\n\tReplace *bool\n\n\t// The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services\n\t// Systems Manager to assume when running a maintenance window task. If you do not\n\t// specify a service role ARN, Systems Manager uses your account's service-linked\n\t// role. If no service-linked role for Systems Manager exists in your account, it\n\t// is created when you run RegisterTaskWithMaintenanceWindow . For more\n\t// information, see the following topics in the in the Amazon Web Services Systems\n\t// Manager User Guide:\n\t//   - Using service-linked roles for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions)\n\t//   - Should I use a service-linked role or a custom service role to run\n\t//   maintenance window tasks?  (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role)\n\tServiceRoleArn *string\n\n\t// The targets (either managed nodes or tags) to modify. Managed nodes are\n\t// specified using the format Key=instanceids,Values=instanceID_1,instanceID_2 .\n\t// Tags are specified using the format Key=tag_name,Values=tag_value . One or more\n\t// targets must be specified for maintenance window Run Command-type tasks.\n\t// Depending on the task, targets are optional for other maintenance window task\n\t// types (Automation, Lambda, and Step Functions). For more information about\n\t// running tasks that don't specify targets, see Registering maintenance window\n\t// tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tTargets []types.Target\n\n\t// The task ARN to modify.\n\tTaskArn *string\n\n\t// The parameters that the task should use during execution. Populate only the\n\t// fields that match the task type. All other fields should be empty. When you\n\t// update a maintenance window task that has options specified in\n\t// TaskInvocationParameters , you must provide again all the\n\t// TaskInvocationParameters values that you want to retain. The values you don't\n\t// specify again are removed. For example, suppose that when you registered a Run\n\t// Command task, you specified TaskInvocationParameters values for Comment ,\n\t// NotificationConfig , and OutputS3BucketName . If you update the maintenance\n\t// window task and specify only a different OutputS3BucketName value, the values\n\t// for Comment and NotificationConfig are removed.\n\tTaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters\n\n\t// The parameters to modify. TaskParameters has been deprecated. To specify\n\t// parameters to pass to a task when it runs, instead use the Parameters option in\n\t// the TaskInvocationParameters structure. For information about how Systems\n\t// Manager handles these options for the supported maintenance window task types,\n\t// see MaintenanceWindowTaskInvocationParameters . The map has the following\n\t// format: Key: string, between 1 and 255 characters Value: an array of strings,\n\t// each string is between 1 and 255 characters\n\tTaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateMaintenanceWindowTaskOutput struct {\n\n\t// The details for the CloudWatch alarm you applied to your maintenance window\n\t// task.\n\tAlarmConfiguration *types.AlarmConfiguration\n\n\t// The specification for whether tasks should continue to run after the cutoff\n\t// time specified in the maintenance windows is reached.\n\tCutoffBehavior types.MaintenanceWindowTaskCutoffBehavior\n\n\t// The updated task description.\n\tDescription *string\n\n\t// The updated logging information in Amazon S3. LoggingInfo has been deprecated.\n\t// To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs,\n\t// instead use the OutputS3BucketName and OutputS3KeyPrefix options in the\n\t// TaskInvocationParameters structure. For information about how Amazon Web\n\t// Services Systems Manager handles these options for the supported maintenance\n\t// window task types, see MaintenanceWindowTaskInvocationParameters .\n\tLoggingInfo *types.LoggingInfo\n\n\t// The updated MaxConcurrency value.\n\tMaxConcurrency *string\n\n\t// The updated MaxErrors value.\n\tMaxErrors *string\n\n\t// The updated task name.\n\tName *string\n\n\t// The updated priority value.\n\tPriority int32\n\n\t// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM)\n\t// service role to use to publish Amazon Simple Notification Service (Amazon SNS)\n\t// notifications for maintenance window Run Command tasks.\n\tServiceRoleArn *string\n\n\t// The updated target values.\n\tTargets []types.Target\n\n\t// The updated task ARN value.\n\tTaskArn *string\n\n\t// The updated parameter values.\n\tTaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters\n\n\t// The updated parameter values. TaskParameters has been deprecated. To specify\n\t// parameters to pass to a task when it runs, instead use the Parameters option in\n\t// the TaskInvocationParameters structure. For information about how Systems\n\t// Manager handles these options for the supported maintenance window task types,\n\t// see MaintenanceWindowTaskInvocationParameters .\n\tTaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression\n\n\t// The ID of the maintenance window that was updated.\n\tWindowId *string\n\n\t// The task ID of the maintenance window that was updated.\n\tWindowTaskId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindowTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateMaintenanceWindowTask\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateMaintenanceWindowTaskValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindowTask(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateMaintenanceWindowTask(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateMaintenanceWindowTask\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateManagedInstanceRole.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Changes the Identity and Access Management (IAM) role that is assigned to the\n// on-premises server, edge device, or virtual machines (VM). IAM roles are first\n// assigned to these hybrid nodes during the activation process. For more\n// information, see CreateActivation .\nfunc (c *Client) UpdateManagedInstanceRole(ctx context.Context, params *UpdateManagedInstanceRoleInput, optFns ...func(*Options)) (*UpdateManagedInstanceRoleOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateManagedInstanceRoleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateManagedInstanceRole\", params, optFns, c.addOperationUpdateManagedInstanceRoleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateManagedInstanceRoleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateManagedInstanceRoleInput struct {\n\n\t// The name of the Identity and Access Management (IAM) role that you want to\n\t// assign to the managed node. This IAM role must provide AssumeRole permissions\n\t// for the Amazon Web Services Systems Manager service principal ssm.amazonaws.com\n\t// . For more information, see Create an IAM service role for a hybrid environment (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html)\n\t// in the Amazon Web Services Systems Manager User Guide. You can't specify an IAM\n\t// service-linked role for this parameter. You must create a unique role.\n\t//\n\t// This member is required.\n\tIamRole *string\n\n\t// The ID of the managed node where you want to update the role.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateManagedInstanceRoleOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateManagedInstanceRole{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateManagedInstanceRole{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateManagedInstanceRole\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateManagedInstanceRoleValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateManagedInstanceRole(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateManagedInstanceRole(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateManagedInstanceRole\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsItem.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Edit or change an OpsItem. You must have permission in Identity and Access\n// Management (IAM) to update an OpsItem. For more information, see Set up\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html)\n// in the Amazon Web Services Systems Manager User Guide. Operations engineers and\n// IT professionals use Amazon Web Services Systems Manager OpsCenter to view,\n// investigate, and remediate operational issues impacting the performance and\n// health of their Amazon Web Services resources. For more information, see\n// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html)\n// in the Amazon Web Services Systems Manager User Guide.\nfunc (c *Client) UpdateOpsItem(ctx context.Context, params *UpdateOpsItemInput, optFns ...func(*Options)) (*UpdateOpsItemOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateOpsItemInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateOpsItem\", params, optFns, c.addOperationUpdateOpsItemMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateOpsItemOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateOpsItemInput struct {\n\n\t// The ID of the OpsItem.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\t// The time a runbook workflow ended. Currently reported only for the OpsItem type\n\t// /aws/changerequest .\n\tActualEndTime *time.Time\n\n\t// The time a runbook workflow started. Currently reported only for the OpsItem\n\t// type /aws/changerequest .\n\tActualStartTime *time.Time\n\n\t// Specify a new category for an OpsItem.\n\tCategory *string\n\n\t// User-defined text that contains information about the OpsItem, in Markdown\n\t// format.\n\tDescription *string\n\n\t// The Amazon Resource Name (ARN) of an SNS topic where notifications are sent\n\t// when this OpsItem is edited or changed.\n\tNotifications []types.OpsItemNotification\n\n\t// Add new keys or edit existing key-value pairs of the OperationalData map in the\n\t// OpsItem object. Operational data is custom data that provides useful reference\n\t// details about the OpsItem. For example, you can specify log files, error\n\t// strings, license keys, troubleshooting tips, or other relevant data. You enter\n\t// operational data as key-value pairs. The key has a maximum length of 128\n\t// characters. The value has a maximum size of 20 KB. Operational data keys can't\n\t// begin with the following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn ,\n\t// /ssm . You can choose to make the data searchable by other users in the account\n\t// or you can restrict search access. Searchable data means that all users with\n\t// access to the OpsItem Overview page (as provided by the DescribeOpsItems API\n\t// operation) can view and search on the specified data. Operational data that\n\t// isn't searchable is only viewable by users who have access to the OpsItem (as\n\t// provided by the GetOpsItem API operation). Use the /aws/resources key in\n\t// OperationalData to specify a related resource in the request. Use the\n\t// /aws/automations key in OperationalData to associate an Automation runbook with\n\t// the OpsItem. To view Amazon Web Services CLI example commands that use these\n\t// keys, see Creating OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tOperationalData map[string]types.OpsItemDataValue\n\n\t// Keys that you want to remove from the OperationalData map.\n\tOperationalDataToDelete []string\n\n\t// The OpsItem Amazon Resource Name (ARN).\n\tOpsItemArn *string\n\n\t// The time specified in a change request for a runbook workflow to end. Currently\n\t// supported only for the OpsItem type /aws/changerequest .\n\tPlannedEndTime *time.Time\n\n\t// The time specified in a change request for a runbook workflow to start.\n\t// Currently supported only for the OpsItem type /aws/changerequest .\n\tPlannedStartTime *time.Time\n\n\t// The importance of this OpsItem in relation to other OpsItems in the system.\n\tPriority *int32\n\n\t// One or more OpsItems that share something in common with the current OpsItems.\n\t// For example, related OpsItems can include OpsItems with similar error messages,\n\t// impacted resources, or statuses for the impacted resource.\n\tRelatedOpsItems []types.RelatedOpsItem\n\n\t// Specify a new severity for an OpsItem.\n\tSeverity *string\n\n\t// The OpsItem status. Status can be Open , In Progress , or Resolved . For more\n\t// information, see Editing OpsItem details (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tStatus types.OpsItemStatus\n\n\t// A short heading that describes the nature of the OpsItem and the impacted\n\t// resource.\n\tTitle *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateOpsItemOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateOpsItem{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateOpsItem\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateOpsItemValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOpsItem(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateOpsItem(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateOpsItem\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsMetadata.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Amazon Web Services Systems Manager calls this API operation when you edit\n// OpsMetadata in Application Manager.\nfunc (c *Client) UpdateOpsMetadata(ctx context.Context, params *UpdateOpsMetadataInput, optFns ...func(*Options)) (*UpdateOpsMetadataOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateOpsMetadataInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateOpsMetadata\", params, optFns, c.addOperationUpdateOpsMetadataMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateOpsMetadataOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateOpsMetadataInput struct {\n\n\t// The Amazon Resource Name (ARN) of the OpsMetadata Object to update.\n\t//\n\t// This member is required.\n\tOpsMetadataArn *string\n\n\t// The metadata keys to delete from the OpsMetadata object.\n\tKeysToDelete []string\n\n\t// Metadata to add to an OpsMetadata object.\n\tMetadataToUpdate map[string]types.MetadataValue\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateOpsMetadataOutput struct {\n\n\t// The Amazon Resource Name (ARN) of the OpsMetadata Object that was updated.\n\tOpsMetadataArn *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateOpsMetadata{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateOpsMetadata\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateOpsMetadataValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOpsMetadata(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateOpsMetadata\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdatePatchBaseline.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"time\"\n)\n\n// Modifies an existing patch baseline. Fields not specified in the request are\n// left unchanged. For information about valid key-value pairs in PatchFilters for\n// each supported operating system type, see PatchFilter .\nfunc (c *Client) UpdatePatchBaseline(ctx context.Context, params *UpdatePatchBaselineInput, optFns ...func(*Options)) (*UpdatePatchBaselineOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdatePatchBaselineInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdatePatchBaseline\", params, optFns, c.addOperationUpdatePatchBaselineMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdatePatchBaselineOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdatePatchBaselineInput struct {\n\n\t// The ID of the patch baseline to update.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\t// A set of rules used to include patches in the baseline.\n\tApprovalRules *types.PatchRuleGroup\n\n\t// A list of explicitly approved patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tApprovedPatches []string\n\n\t// Assigns a new compliance severity level to an existing patch baseline.\n\tApprovedPatchesComplianceLevel types.PatchComplianceLevel\n\n\t// Indicates whether the list of approved patches includes non-security updates\n\t// that should be applied to the managed nodes. The default value is false .\n\t// Applies to Linux managed nodes only.\n\tApprovedPatchesEnableNonSecurity *bool\n\n\t// A description of the patch baseline.\n\tDescription *string\n\n\t// A set of global filters used to include patches in the baseline.\n\tGlobalFilters *types.PatchFilterGroup\n\n\t// The name of the patch baseline.\n\tName *string\n\n\t// A list of explicitly rejected patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tRejectedPatches []string\n\n\t// The action for Patch Manager to take on patches included in the RejectedPackages\n\t// list.\n\t//   - ALLOW_AS_DEPENDENCY : A package in the Rejected patches list is installed\n\t//   only if it is a dependency of another package. It is considered compliant with\n\t//   the patch baseline, and its status is reported as InstalledOther . This is the\n\t//   default action if no option is specified.\n\t//   - BLOCK : Packages in the RejectedPatches list, and packages that include them\n\t//   as dependencies, aren't installed under any circumstances. If a package was\n\t//   installed before it was added to the Rejected patches list, it is considered\n\t//   non-compliant with the patch baseline, and its status is reported as\n\t//   InstalledRejected .\n\tRejectedPatchesAction types.PatchAction\n\n\t// If True, then all fields that are required by the CreatePatchBaseline operation\n\t// are also required for this API request. Optional fields that aren't specified\n\t// are set to null.\n\tReplace *bool\n\n\t// Information about the patches to use to update the managed nodes, including\n\t// target operating systems and source repositories. Applies to Linux managed nodes\n\t// only.\n\tSources []types.PatchSource\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdatePatchBaselineOutput struct {\n\n\t// A set of rules used to include patches in the baseline.\n\tApprovalRules *types.PatchRuleGroup\n\n\t// A list of explicitly approved patches for the baseline.\n\tApprovedPatches []string\n\n\t// The compliance severity level assigned to the patch baseline after the update\n\t// completed.\n\tApprovedPatchesComplianceLevel types.PatchComplianceLevel\n\n\t// Indicates whether the list of approved patches includes non-security updates\n\t// that should be applied to the managed nodes. The default value is false .\n\t// Applies to Linux managed nodes only.\n\tApprovedPatchesEnableNonSecurity *bool\n\n\t// The ID of the deleted patch baseline.\n\tBaselineId *string\n\n\t// The date when the patch baseline was created.\n\tCreatedDate *time.Time\n\n\t// A description of the patch baseline.\n\tDescription *string\n\n\t// A set of global filters used to exclude patches from the baseline.\n\tGlobalFilters *types.PatchFilterGroup\n\n\t// The date when the patch baseline was last modified.\n\tModifiedDate *time.Time\n\n\t// The name of the patch baseline.\n\tName *string\n\n\t// The operating system rule used by the updated patch baseline.\n\tOperatingSystem types.OperatingSystem\n\n\t// A list of explicitly rejected patches for the baseline.\n\tRejectedPatches []string\n\n\t// The action specified to take on patches included in the RejectedPatches list. A\n\t// patch can be allowed only if it is a dependency of another package, or blocked\n\t// entirely along with packages that include it as a dependency.\n\tRejectedPatchesAction types.PatchAction\n\n\t// Information about the patches to use to update the managed nodes, including\n\t// target operating systems and source repositories. Applies to Linux managed nodes\n\t// only.\n\tSources []types.PatchSource\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePatchBaseline{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdatePatchBaseline\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdatePatchBaselineValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePatchBaseline(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdatePatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdatePatchBaseline\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateResourceDataSync.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Update a resource data sync. After you create a resource data sync for a\n// Region, you can't change the account options for that sync. For example, if you\n// create a sync in the us-east-2 (Ohio) Region and you choose the Include only\n// the current account option, you can't edit that sync later and choose the\n// Include all accounts from my Organizations configuration option. Instead, you\n// must delete the first resource data sync, and create a new one. This API\n// operation only supports a resource data sync that was created with a\n// SyncFromSource SyncType .\nfunc (c *Client) UpdateResourceDataSync(ctx context.Context, params *UpdateResourceDataSyncInput, optFns ...func(*Options)) (*UpdateResourceDataSyncOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateResourceDataSyncInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateResourceDataSync\", params, optFns, c.addOperationUpdateResourceDataSyncMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateResourceDataSyncOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype UpdateResourceDataSyncInput struct {\n\n\t// The name of the resource data sync you want to update.\n\t//\n\t// This member is required.\n\tSyncName *string\n\n\t// Specify information about the data sources to synchronize.\n\t//\n\t// This member is required.\n\tSyncSource *types.ResourceDataSyncSource\n\n\t// The type of resource data sync. The supported SyncType is SyncFromSource.\n\t//\n\t// This member is required.\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype UpdateResourceDataSyncOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateResourceDataSync{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateResourceDataSync\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateResourceDataSyncValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResourceDataSync(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateResourceDataSync\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateServiceSetting.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// ServiceSetting is an account-level setting for an Amazon Web Services service.\n// This setting defines how a user interacts with or uses a service or a feature of\n// a service. For example, if an Amazon Web Services service charges money to the\n// account based on feature or service usage, then the Amazon Web Services service\n// team might create a default setting of \"false\". This means the user can't use\n// this feature unless they change the setting to \"true\" and intentionally opt in\n// for a paid feature. Services map a SettingId object to a setting value. Amazon\n// Web Services services teams define the default value for a SettingId . You can't\n// create a new SettingId , but you can overwrite the default value if you have the\n// ssm:UpdateServiceSetting permission for the setting. Use the GetServiceSetting\n// API operation to view the current value. Or, use the ResetServiceSetting to\n// change the value back to the original value defined by the Amazon Web Services\n// service team. Update the service setting for the account.\nfunc (c *Client) UpdateServiceSetting(ctx context.Context, params *UpdateServiceSettingInput, optFns ...func(*Options)) (*UpdateServiceSettingOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateServiceSettingInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateServiceSetting\", params, optFns, c.addOperationUpdateServiceSettingMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateServiceSettingOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\n// The request body of the UpdateServiceSetting API operation.\ntype UpdateServiceSettingInput struct {\n\n\t// The Amazon Resource Name (ARN) of the service setting to update. For example,\n\t// arn:aws:ssm:us-east-1:111122223333:servicesetting/ssm/parameter-store/high-throughput-enabled\n\t// . The setting ID can be one of the following.\n\t//   - /ssm/managed-instance/default-ec2-instance-management-role\n\t//   - /ssm/automation/customer-script-log-destination\n\t//   - /ssm/automation/customer-script-log-group-name\n\t//   - /ssm/documents/console/public-sharing-permission\n\t//   - /ssm/managed-instance/activation-tier\n\t//   - /ssm/opsinsights/opscenter\n\t//   - /ssm/parameter-store/default-parameter-tier\n\t//   - /ssm/parameter-store/high-throughput-enabled\n\t// Permissions to update the\n\t// /ssm/managed-instance/default-ec2-instance-management-role setting should only\n\t// be provided to administrators. Implement least privilege access when allowing\n\t// individuals to configure or modify the Default Host Management Configuration.\n\t//\n\t// This member is required.\n\tSettingId *string\n\n\t// The new value to specify for the service setting. The following list specifies\n\t// the available values for each setting.\n\t//   - For /ssm/managed-instance/default-ec2-instance-management-role , enter the\n\t//   name of an IAM role.\n\t//   - For /ssm/automation/customer-script-log-destination , enter CloudWatch .\n\t//   - For /ssm/automation/customer-script-log-group-name , enter the name of an\n\t//   Amazon CloudWatch Logs log group.\n\t//   - For /ssm/documents/console/public-sharing-permission , enter Enable or\n\t//   Disable .\n\t//   - For /ssm/managed-instance/activation-tier , enter standard or advanced .\n\t//   - For /ssm/opsinsights/opscenter , enter Enabled or Disabled .\n\t//   - For /ssm/parameter-store/default-parameter-tier , enter Standard , Advanced\n\t//   , or Intelligent-Tiering\n\t//   - For /ssm/parameter-store/high-throughput-enabled , enter true or false .\n\t//\n\t// This member is required.\n\tSettingValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The result body of the UpdateServiceSetting API operation.\ntype UpdateServiceSettingOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateServiceSetting{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"UpdateServiceSetting\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetryMiddlewares(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpUpdateServiceSettingValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceSetting(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = awsmiddleware.AddRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opUpdateServiceSetting(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"UpdateServiceSetting\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/auth.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nfunc bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {\n\tparams.Region = options.Region\n}\n\ntype setLegacyContextSigningOptionsMiddleware struct {\n}\n\nfunc (*setLegacyContextSigningOptionsMiddleware) ID() string {\n\treturn \"setLegacyContextSigningOptions\"\n}\n\nfunc (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tschemeID := rscheme.Scheme.SchemeID()\n\n\tif sn := awsmiddleware.GetSigningName(ctx); sn != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)\n\t\t}\n\t}\n\n\tif sr := awsmiddleware.GetSigningRegion(ctx); sr != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})\n\t\t}\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, \"Signing\", middleware.Before)\n}\n\ntype withAnonymous struct {\n\tresolver AuthSchemeResolver\n}\n\nvar _ AuthSchemeResolver = (*withAnonymous)(nil)\n\nfunc (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\topts, err := v.resolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts = append(opts, &smithyauth.Option{\n\t\tSchemeID: smithyauth.SchemeIDAnonymous,\n\t})\n\treturn opts, nil\n}\n\nfunc wrapWithAnonymousAuth(options *Options) {\n\tif _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {\n\t\treturn\n\t}\n\n\toptions.AuthSchemeResolver = &withAnonymous{\n\t\tresolver: options.AuthSchemeResolver,\n\t}\n}\n\n// AuthResolverParameters contains the set of inputs necessary for auth scheme\n// resolution.\ntype AuthResolverParameters struct {\n\t// The name of the operation being invoked.\n\tOperation string\n\n\t// The region in which the operation is being invoked.\n\tRegion string\n}\n\nfunc bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {\n\tparams := &AuthResolverParameters{\n\t\tOperation: operation,\n\t}\n\n\tbindAuthParamsRegion(params, input, options)\n\n\treturn params\n}\n\n// AuthSchemeResolver returns a set of possible authentication options for an\n// operation.\ntype AuthSchemeResolver interface {\n\tResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)\n}\n\ntype defaultAuthSchemeResolver struct{}\n\nvar _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)\n\nfunc (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\tif overrides, ok := operationAuthOptions[params.Operation]; ok {\n\t\treturn overrides(params), nil\n\t}\n\treturn serviceAuthOptions(params), nil\n}\n\nvar operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{}\n\nfunc serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {\n\treturn []*smithyauth.Option{\n\t\t{\n\t\t\tSchemeID: smithyauth.SchemeIDSigV4,\n\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\tvar props smithy.Properties\n\t\t\t\tsmithyhttp.SetSigV4SigningName(&props, \"ssm\")\n\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&props, params.Region)\n\t\t\t\treturn props\n\t\t\t}(),\n\t\t},\n\t}\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tparams := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options)\n\toptions, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"resolve auth scheme: %w\", err)\n\t}\n\n\tscheme, ok := m.selectScheme(options)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"could not select an auth scheme\")\n\t}\n\n\tctx = setResolvedAuthScheme(ctx, scheme)\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {\n\tfor _, option := range options {\n\t\tif option.SchemeID == smithyauth.SchemeIDAnonymous {\n\t\t\treturn newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true\n\t\t}\n\n\t\tfor _, scheme := range m.options.AuthSchemes {\n\t\t\tif scheme.SchemeID() != option.SchemeID {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif scheme.IdentityResolver(m.options) != nil {\n\t\t\t\treturn newResolvedAuthScheme(scheme, option), true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, false\n}\n\ntype resolvedAuthSchemeKey struct{}\n\ntype resolvedAuthScheme struct {\n\tScheme             smithyhttp.AuthScheme\n\tIdentityProperties smithy.Properties\n\tSignerProperties   smithy.Properties\n}\n\nfunc newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {\n\treturn &resolvedAuthScheme{\n\t\tScheme:             scheme,\n\t\tIdentityProperties: option.IdentityProperties,\n\t\tSignerProperties:   option.SignerProperties,\n\t}\n}\n\nfunc setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {\n\treturn middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)\n}\n\nfunc getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {\n\tv, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)\n\treturn v\n}\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tresolver := rscheme.Scheme.IdentityResolver(m.options)\n\tif resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity resolver\")\n\t}\n\n\tidentity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"get identity: %w\", err)\n\t}\n\n\tctx = setIdentity(ctx, identity)\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype identityKey struct{}\n\nfunc setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {\n\treturn middleware.WithStackValue(ctx, identityKey{}, identity)\n}\n\nfunc getIdentity(ctx context.Context) smithyauth.Identity {\n\tv, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)\n\treturn v\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unexpected transport type %T\", in.Request)\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tidentity := getIdentity(ctx)\n\tif identity == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity\")\n\t}\n\n\tsigner := rscheme.Scheme.Signer()\n\tif signer == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no signer\")\n\t}\n\n\tif err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"sign request: %w\", err)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype awsAwsjson11_deserializeOpAddTagsToResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpAddTagsToResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpAddTagsToResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorAddTagsToResource(response, &metadata)\n\t}\n\toutput := &AddTagsToResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentAddTagsToResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorAddTagsToResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyTagsError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyTagsError(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorAssociateOpsItemRelatedItem(response, &metadata)\n\t}\n\toutput := &AssociateOpsItemRelatedItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentAssociateOpsItemRelatedItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorAssociateOpsItemRelatedItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemRelatedItemAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemRelatedItemAlreadyExistsException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCancelCommand struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCancelCommand) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCancelCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCancelCommand(response, &metadata)\n\t}\n\toutput := &CancelCommandOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCancelCommandOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCancelCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DuplicateInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDuplicateInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidCommandId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCancelMaintenanceWindowExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCancelMaintenanceWindowExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCancelMaintenanceWindowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCancelMaintenanceWindowExecution(response, &metadata)\n\t}\n\toutput := &CancelMaintenanceWindowExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCancelMaintenanceWindowExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCancelMaintenanceWindowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateActivation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateActivation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateActivation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateActivation(response, &metadata)\n\t}\n\toutput := &CreateActivationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateActivationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateActivation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameters\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateAssociation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateAssociation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateAssociation(response, &metadata)\n\t}\n\toutput := &CreateAssociationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateAssociationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationAlreadyExists\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationAlreadyExists(response, errorBody)\n\n\tcase strings.EqualFold(\"AssociationLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidOutputLocation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidOutputLocation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameters\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidSchedule\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTag\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTag(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTarget\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTargetMaps\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedPlatformType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedPlatformType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateAssociationBatch struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateAssociationBatch) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateAssociationBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response, &metadata)\n\t}\n\toutput := &CreateAssociationBatchOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateAssociationBatchOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"DuplicateInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDuplicateInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidOutputLocation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidOutputLocation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameters\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidSchedule\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTarget\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTargetMaps\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedPlatformType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedPlatformType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateDocument struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateDocument) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateDocument(response, &metadata)\n\t}\n\toutput := &CreateDocumentOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateDocumentOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DocumentAlreadyExists\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDocumentAlreadyExists(response, errorBody)\n\n\tcase strings.EqualFold(\"DocumentLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDocumentLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentContent\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentContent(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentSchemaVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"MaxDocumentSizeExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &CreateMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateOpsItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateOpsItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateOpsItem(response, &metadata)\n\t}\n\toutput := &CreateOpsItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateOpsItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemAccessDeniedException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateOpsMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateOpsMetadata(response, &metadata)\n\t}\n\toutput := &CreateOpsMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateOpsMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataInvalidArgumentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataTooManyUpdatesException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataTooManyUpdatesException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreatePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreatePatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreatePatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreatePatchBaseline(response, &metadata)\n\t}\n\toutput := &CreatePatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreatePatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreatePatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpCreateResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpCreateResourceDataSync) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpCreateResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorCreateResourceDataSync(response, &metadata)\n\t}\n\toutput := &CreateResourceDataSyncOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentCreateResourceDataSyncOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorCreateResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncCountExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncCountExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncInvalidConfigurationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteActivation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteActivation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteActivation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteActivation(response, &metadata)\n\t}\n\toutput := &DeleteActivationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteActivationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteActivation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidActivation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidActivation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidActivationId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidActivationId(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteAssociation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteAssociation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteAssociation(response, &metadata)\n\t}\n\toutput := &DeleteAssociationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteAssociationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteDocument struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteDocument) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteDocument(response, &metadata)\n\t}\n\toutput := &DeleteDocumentOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteDocumentOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociatedInstances\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociatedInstances(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentOperation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteInventory struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteInventory) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteInventory(response, &metadata)\n\t}\n\toutput := &DeleteInventoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteInventoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDeleteInventoryParametersException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDeleteInventoryParametersException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInventoryRequestException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInventoryRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidOptionException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidOptionException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &DeleteMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteOpsItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteOpsItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteOpsItem(response, &metadata)\n\t}\n\toutput := &DeleteOpsItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteOpsItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteOpsMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteOpsMetadata(response, &metadata)\n\t}\n\toutput := &DeleteOpsMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteOpsMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataInvalidArgumentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteParameter struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteParameter) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteParameter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteParameter(response, &metadata)\n\t}\n\toutput := &DeleteParameterOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteParameterOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteParameter(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteParameters struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteParameters) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteParameters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteParameters(response, &metadata)\n\t}\n\toutput := &DeleteParametersOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteParametersOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteParameters(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeletePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeletePatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeletePatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeletePatchBaseline(response, &metadata)\n\t}\n\toutput := &DeletePatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeletePatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeletePatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceInUseException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteResourceDataSync) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response, &metadata)\n\t}\n\toutput := &DeleteResourceDataSyncOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteResourceDataSyncOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncInvalidConfigurationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeleteResourcePolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata)\n\t}\n\toutput := &DeleteResourcePolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeregisterManagedInstance struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeregisterManagedInstance) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response, &metadata)\n\t}\n\toutput := &DeregisterManagedInstanceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeregisterManagedInstanceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response, &metadata)\n\t}\n\toutput := &DeregisterPatchBaselineForPatchGroupOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeregisterPatchBaselineForPatchGroupOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &DeregisterTargetFromMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeregisterTargetFromMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"TargetInUseException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTargetInUseException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDeregisterTaskFromMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDeregisterTaskFromMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDeregisterTaskFromMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDeregisterTaskFromMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &DeregisterTaskFromMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDeregisterTaskFromMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDeregisterTaskFromMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeActivations struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeActivations) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeActivations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeActivations(response, &metadata)\n\t}\n\toutput := &DescribeActivationsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeActivationsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeActivations(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAssociation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAssociation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAssociation(response, &metadata)\n\t}\n\toutput := &DescribeAssociationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAssociationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAssociationVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAssociationVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAssociationExecutions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAssociationExecutions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAssociationExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAssociationExecutions(response, &metadata)\n\t}\n\toutput := &DescribeAssociationExecutionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAssociationExecutionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAssociationExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAssociationExecutionTargets struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAssociationExecutionTargets) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAssociationExecutionTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAssociationExecutionTargets(response, &metadata)\n\t}\n\toutput := &DescribeAssociationExecutionTargetsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAssociationExecutionTargetsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAssociationExecutionTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"AssociationExecutionDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationExecutionDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAutomationExecutions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAutomationExecutions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAutomationExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAutomationExecutions(response, &metadata)\n\t}\n\toutput := &DescribeAutomationExecutionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAutomationExecutionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAutomationExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterValue\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterValue(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAutomationStepExecutions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAutomationStepExecutions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAutomationStepExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAutomationStepExecutions(response, &metadata)\n\t}\n\toutput := &DescribeAutomationStepExecutionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAutomationStepExecutionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAutomationStepExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationExecutionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterValue\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterValue(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeAvailablePatches struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeAvailablePatches) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeAvailablePatches) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeAvailablePatches(response, &metadata)\n\t}\n\toutput := &DescribeAvailablePatchesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeAvailablePatchesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeAvailablePatches(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeDocument struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeDocument) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeDocument(response, &metadata)\n\t}\n\toutput := &DescribeDocumentOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeDocumentOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeDocumentPermission struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeDocumentPermission) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeDocumentPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response, &metadata)\n\t}\n\toutput := &DescribeDocumentPermissionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeDocumentPermissionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentOperation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidPermissionType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidPermissionType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeEffectiveInstanceAssociations struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeEffectiveInstanceAssociations) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeEffectiveInstanceAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeEffectiveInstanceAssociations(response, &metadata)\n\t}\n\toutput := &DescribeEffectiveInstanceAssociationsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeEffectiveInstanceAssociationsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeEffectiveInstanceAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeEffectivePatchesForPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeEffectivePatchesForPatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeEffectivePatchesForPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeEffectivePatchesForPatchBaseline(response, &metadata)\n\t}\n\toutput := &DescribeEffectivePatchesForPatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeEffectivePatchesForPatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeEffectivePatchesForPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedOperatingSystem\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInstanceAssociationsStatus struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInstanceAssociationsStatus) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInstanceAssociationsStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInstanceAssociationsStatus(response, &metadata)\n\t}\n\toutput := &DescribeInstanceAssociationsStatusOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInstanceAssociationsStatusOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInstanceAssociationsStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInstanceInformation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInstanceInformation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInstanceInformation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInstanceInformation(response, &metadata)\n\t}\n\toutput := &DescribeInstanceInformationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInstanceInformationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInstanceInformation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceInformationFilterValue\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceInformationFilterValue(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInstancePatches struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInstancePatches) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInstancePatches) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInstancePatches(response, &metadata)\n\t}\n\toutput := &DescribeInstancePatchesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInstancePatchesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInstancePatches(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInstancePatchStates struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInstancePatchStates) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInstancePatchStates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInstancePatchStates(response, &metadata)\n\t}\n\toutput := &DescribeInstancePatchStatesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInstancePatchStatesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInstancePatchStates(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInstancePatchStatesForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInstancePatchStatesForPatchGroup) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInstancePatchStatesForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInstancePatchStatesForPatchGroup(response, &metadata)\n\t}\n\toutput := &DescribeInstancePatchStatesForPatchGroupOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInstancePatchStatesForPatchGroupOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInstancePatchStatesForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeInventoryDeletions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeInventoryDeletions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeInventoryDeletions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeInventoryDeletions(response, &metadata)\n\t}\n\toutput := &DescribeInventoryDeletionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeInventoryDeletionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeInventoryDeletions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDeletionIdException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDeletionIdException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutions(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowExecutionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTaskInvocations struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTaskInvocations) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTaskInvocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTaskInvocations(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowExecutionTaskInvocationsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionTaskInvocationsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTaskInvocations(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTasks struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTasks) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTasks(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowExecutionTasksOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionTasksOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindows struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindows) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindows) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindows(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindows(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowSchedule struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowSchedule) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowSchedule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowSchedule(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowScheduleOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowScheduleOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowsForTarget struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowsForTarget) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowsForTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowsForTarget(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowsForTargetOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowsForTargetOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowsForTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowTargets struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowTargets) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTargets(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowTargetsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowTargetsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeMaintenanceWindowTasks struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeMaintenanceWindowTasks) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeMaintenanceWindowTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTasks(response, &metadata)\n\t}\n\toutput := &DescribeMaintenanceWindowTasksOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowTasksOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeOpsItems struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeOpsItems) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeOpsItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeOpsItems(response, &metadata)\n\t}\n\toutput := &DescribeOpsItemsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeOpsItemsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeOpsItems(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeParameters struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeParameters) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeParameters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeParameters(response, &metadata)\n\t}\n\toutput := &DescribeParametersOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeParametersOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeParameters(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterOption\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterOption(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterValue\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterValue(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribePatchBaselines struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribePatchBaselines) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribePatchBaselines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribePatchBaselines(response, &metadata)\n\t}\n\toutput := &DescribePatchBaselinesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribePatchBaselinesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribePatchBaselines(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribePatchGroups struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribePatchGroups) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribePatchGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribePatchGroups(response, &metadata)\n\t}\n\toutput := &DescribePatchGroupsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribePatchGroupsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribePatchGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribePatchGroupState struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribePatchGroupState) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribePatchGroupState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribePatchGroupState(response, &metadata)\n\t}\n\toutput := &DescribePatchGroupStateOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribePatchGroupState(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribePatchProperties struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribePatchProperties) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribePatchProperties) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribePatchProperties(response, &metadata)\n\t}\n\toutput := &DescribePatchPropertiesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribePatchPropertiesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribePatchProperties(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDescribeSessions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDescribeSessions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDescribeSessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDescribeSessions(response, &metadata)\n\t}\n\toutput := &DescribeSessionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDescribeSessionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDescribeSessions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorDisassociateOpsItemRelatedItem(response, &metadata)\n\t}\n\toutput := &DisassociateOpsItemRelatedItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentDisassociateOpsItemRelatedItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorDisassociateOpsItemRelatedItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemRelatedItemAssociationNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemRelatedItemAssociationNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetAutomationExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetAutomationExecution(response, &metadata)\n\t}\n\toutput := &GetAutomationExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetAutomationExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationExecutionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetCalendarState struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetCalendarState) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetCalendarState(response, &metadata)\n\t}\n\toutput := &GetCalendarStateOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetCalendarStateOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentType(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedCalendarException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedCalendarException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetCommandInvocation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetCommandInvocation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetCommandInvocation(response, &metadata)\n\t}\n\toutput := &GetCommandInvocationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetCommandInvocationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidCommandId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidPluginName\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidPluginName(response, errorBody)\n\n\tcase strings.EqualFold(\"InvocationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvocationDoesNotExist(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetConnectionStatus struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetConnectionStatus) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetConnectionStatus(response, &metadata)\n\t}\n\toutput := &GetConnectionStatusOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetConnectionStatusOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetDefaultPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetDefaultPatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response, &metadata)\n\t}\n\toutput := &GetDefaultPatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetDefaultPatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response, &metadata)\n\t}\n\toutput := &GetDeployablePatchSnapshotForInstanceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetDeployablePatchSnapshotForInstanceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedFeatureRequiredException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedFeatureRequiredException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedOperatingSystem\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetDocument struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetDocument) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetDocument(response, &metadata)\n\t}\n\toutput := &GetDocumentOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetDocumentOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetInventory struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetInventory) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetInventory(response, &metadata)\n\t}\n\toutput := &GetInventoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetInventoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAggregatorException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAggregatorException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInventoryGroupException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInventoryGroupException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResultAttributeException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResultAttributeException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetInventorySchema struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetInventorySchema) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetInventorySchema) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetInventorySchema(response, &metadata)\n\t}\n\toutput := &GetInventorySchemaOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetInventorySchemaOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetInventorySchema(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &GetMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetMaintenanceWindowExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetMaintenanceWindowExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetMaintenanceWindowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecution(response, &metadata)\n\t}\n\toutput := &GetMaintenanceWindowExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTask struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTask) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTask(response, &metadata)\n\t}\n\toutput := &GetMaintenanceWindowExecutionTaskOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTaskInvocation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTaskInvocation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetMaintenanceWindowExecutionTaskInvocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTaskInvocation(response, &metadata)\n\t}\n\toutput := &GetMaintenanceWindowExecutionTaskInvocationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskInvocationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTaskInvocation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetMaintenanceWindowTask struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetMaintenanceWindowTask) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetMaintenanceWindowTask(response, &metadata)\n\t}\n\toutput := &GetMaintenanceWindowTaskOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowTaskOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetOpsItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetOpsItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetOpsItem(response, &metadata)\n\t}\n\toutput := &GetOpsItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetOpsItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemAccessDeniedException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetOpsMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetOpsMetadata(response, &metadata)\n\t}\n\toutput := &GetOpsMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetOpsMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataInvalidArgumentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetOpsSummary struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetOpsSummary) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetOpsSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetOpsSummary(response, &metadata)\n\t}\n\toutput := &GetOpsSummaryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetOpsSummaryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetOpsSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAggregatorException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAggregatorException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetParameter struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetParameter) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetParameter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetParameter(response, &metadata)\n\t}\n\toutput := &GetParameterOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetParameterOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetParameter(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidKeyId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidKeyId(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterVersionNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterVersionNotFound(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetParameterHistory struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetParameterHistory) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetParameterHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetParameterHistory(response, &metadata)\n\t}\n\toutput := &GetParameterHistoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetParameterHistoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetParameterHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidKeyId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidKeyId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetParameters struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetParameters) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetParameters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetParameters(response, &metadata)\n\t}\n\toutput := &GetParametersOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetParametersOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetParameters(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidKeyId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidKeyId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetParametersByPath struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetParametersByPath) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetParametersByPath) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetParametersByPath(response, &metadata)\n\t}\n\toutput := &GetParametersByPathOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetParametersByPathOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetParametersByPath(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterOption\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterOption(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterValue\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterValue(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidKeyId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidKeyId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetPatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetPatchBaseline(response, &metadata)\n\t}\n\toutput := &GetPatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetPatchBaselineForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response, &metadata)\n\t}\n\toutput := &GetPatchBaselineForPatchGroupOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetPatchBaselineForPatchGroupOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetResourcePolicies struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetResourcePolicies) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetResourcePolicies(response, &metadata)\n\t}\n\toutput := &GetResourcePoliciesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetResourcePoliciesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpGetServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpGetServiceSetting) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpGetServiceSetting) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorGetServiceSetting(response, &metadata)\n\t}\n\toutput := &GetServiceSettingOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentGetServiceSettingOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorGetServiceSetting(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ServiceSettingNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServiceSettingNotFound(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpLabelParameterVersion struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpLabelParameterVersion) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpLabelParameterVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorLabelParameterVersion(response, &metadata)\n\t}\n\toutput := &LabelParameterVersionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentLabelParameterVersionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorLabelParameterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterVersionLabelLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterVersionLabelLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterVersionNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterVersionNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListAssociations struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListAssociations) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListAssociations(response, &metadata)\n\t}\n\toutput := &ListAssociationsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListAssociationsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListAssociationVersions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListAssociationVersions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListAssociationVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListAssociationVersions(response, &metadata)\n\t}\n\toutput := &ListAssociationVersionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListAssociationVersionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListAssociationVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListCommandInvocations struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListCommandInvocations) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListCommandInvocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListCommandInvocations(response, &metadata)\n\t}\n\toutput := &ListCommandInvocationsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListCommandInvocationsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListCommandInvocations(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidCommandId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListCommands struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListCommands) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListCommands) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListCommands(response, &metadata)\n\t}\n\toutput := &ListCommandsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListCommandsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListCommands(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidCommandId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListComplianceItems struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListComplianceItems) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListComplianceItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListComplianceItems(response, &metadata)\n\t}\n\toutput := &ListComplianceItemsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListComplianceItems(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListComplianceSummaries struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListComplianceSummaries) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListComplianceSummaries(response, &metadata)\n\t}\n\toutput := &ListComplianceSummariesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListDocumentMetadataHistory struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListDocumentMetadataHistory) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListDocumentMetadataHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response, &metadata)\n\t}\n\toutput := &ListDocumentMetadataHistoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListDocuments struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListDocuments) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListDocuments(response, &metadata)\n\t}\n\toutput := &ListDocumentsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListDocumentsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilterKey\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListDocumentVersions struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListDocumentVersions) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListDocumentVersions(response, &metadata)\n\t}\n\toutput := &ListDocumentVersionsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListInventoryEntries struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListInventoryEntries) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListInventoryEntries(response, &metadata)\n\t}\n\toutput := &ListInventoryEntriesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListOpsItemEvents struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListOpsItemEvents) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemEvents(response, &metadata)\n\t}\n\toutput := &ListOpsItemEventsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListOpsItemRelatedItems struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListOpsItemRelatedItems) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response, &metadata)\n\t}\n\toutput := &ListOpsItemRelatedItemsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListOpsMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListOpsMetadata(response, &metadata)\n\t}\n\toutput := &ListOpsMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataInvalidArgumentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListResourceComplianceSummaries struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListResourceComplianceSummaries) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response, &metadata)\n\t}\n\toutput := &ListResourceComplianceSummariesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidFilter\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListResourceDataSync) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListResourceDataSync(response, &metadata)\n\t}\n\toutput := &ListResourceDataSyncOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNextToken\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncInvalidConfigurationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)\n\t}\n\toutput := &ListTagsForResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpModifyDocumentPermission struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpModifyDocumentPermission) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response, &metadata)\n\t}\n\toutput := &ModifyDocumentPermissionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentModifyDocumentPermissionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DocumentLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDocumentLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"DocumentPermissionLimit\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDocumentPermissionLimit(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidPermissionType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidPermissionType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutComplianceItems struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutComplianceItems) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutComplianceItems(response, &metadata)\n\t}\n\toutput := &PutComplianceItemsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutComplianceItemsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"ComplianceTypeCountLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorComplianceTypeCountLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidItemContentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody)\n\n\tcase strings.EqualFold(\"ItemSizeLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"TotalSizeLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutInventory struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutInventory) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutInventory(response, &metadata)\n\t}\n\toutput := &PutInventoryOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutInventoryOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"CustomSchemaCountLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorCustomSchemaCountLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInventoryItemContextException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInventoryItemContextException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidItemContentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTypeNameException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody)\n\n\tcase strings.EqualFold(\"ItemContentMismatchException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorItemContentMismatchException(response, errorBody)\n\n\tcase strings.EqualFold(\"ItemSizeLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"SubTypeCountLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorSubTypeCountLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"TotalSizeLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedInventoryItemContextException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedInventoryItemContextException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedInventorySchemaVersionException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedInventorySchemaVersionException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutParameter struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutParameter) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutParameter(response, &metadata)\n\t}\n\toutput := &PutParameterOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutParameterOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"HierarchyLevelLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorHierarchyLevelLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"HierarchyTypeMismatchException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorHierarchyTypeMismatchException(response, errorBody)\n\n\tcase strings.EqualFold(\"IncompatiblePolicyException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIncompatiblePolicyException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAllowedPatternException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAllowedPatternException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidKeyId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidKeyId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidPolicyAttributeException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidPolicyAttributeException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidPolicyTypeException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidPolicyTypeException(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterAlreadyExists\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterAlreadyExists(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterMaxVersionLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterMaxVersionLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterPatternMismatchException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterPatternMismatchException(response, errorBody)\n\n\tcase strings.EqualFold(\"PoliciesLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorPoliciesLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedParameterType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedParameterType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpPutResourcePolicy struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata)\n\t}\n\toutput := &PutResourcePolicyOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourcePolicyLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourcePolicyLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpRegisterDefaultPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpRegisterDefaultPatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpRegisterDefaultPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorRegisterDefaultPatchBaseline(response, &metadata)\n\t}\n\toutput := &RegisterDefaultPatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentRegisterDefaultPatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorRegisterDefaultPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpRegisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpRegisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpRegisterPatchBaselineForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorRegisterPatchBaselineForPatchGroup(response, &metadata)\n\t}\n\toutput := &RegisterPatchBaselineForPatchGroupOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentRegisterPatchBaselineForPatchGroupOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorRegisterPatchBaselineForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpRegisterTargetWithMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpRegisterTargetWithMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpRegisterTargetWithMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorRegisterTargetWithMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &RegisterTargetWithMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentRegisterTargetWithMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorRegisterTargetWithMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpRegisterTaskWithMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpRegisterTaskWithMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpRegisterTaskWithMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorRegisterTaskWithMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &RegisterTaskWithMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentRegisterTaskWithMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorRegisterTaskWithMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"FeatureNotAvailableException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorFeatureNotAvailableException(response, errorBody)\n\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpRemoveTagsFromResource struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpRemoveTagsFromResource) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpRemoveTagsFromResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorRemoveTagsFromResource(response, &metadata)\n\t}\n\toutput := &RemoveTagsFromResourceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentRemoveTagsFromResourceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorRemoveTagsFromResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidResourceType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpResetServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpResetServiceSetting) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpResetServiceSetting) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorResetServiceSetting(response, &metadata)\n\t}\n\toutput := &ResetServiceSettingOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentResetServiceSettingOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorResetServiceSetting(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ServiceSettingNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServiceSettingNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpResumeSession struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpResumeSession) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpResumeSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorResumeSession(response, &metadata)\n\t}\n\toutput := &ResumeSessionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentResumeSessionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorResumeSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpSendAutomationSignal struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpSendAutomationSignal) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpSendAutomationSignal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorSendAutomationSignal(response, &metadata)\n\t}\n\toutput := &SendAutomationSignalOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentSendAutomationSignalOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorSendAutomationSignal(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationExecutionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationStepNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationStepNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAutomationSignalException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAutomationSignalException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpSendCommand struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpSendCommand) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpSendCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorSendCommand(response, &metadata)\n\t}\n\toutput := &SendCommandOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentSendCommandOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorSendCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DuplicateInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDuplicateInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidNotificationConfig\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidNotificationConfig(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidOutputFolder\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidOutputFolder(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameters\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRole\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidRole(response, errorBody)\n\n\tcase strings.EqualFold(\"MaxDocumentSizeExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedPlatformType\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorUnsupportedPlatformType(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartAssociationsOnce struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartAssociationsOnce) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartAssociationsOnce) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartAssociationsOnce(response, &metadata)\n\t}\n\toutput := &StartAssociationsOnceOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartAssociationsOnceOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartAssociationsOnce(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAssociation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAssociation(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartAutomationExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartAutomationExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartAutomationExecution(response, &metadata)\n\t}\n\toutput := &StartAutomationExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartAutomationExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartAutomationExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationDefinitionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationDefinitionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationDefinitionVersionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationDefinitionVersionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationExecutionLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAutomationExecutionParametersException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAutomationExecutionParametersException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTarget\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartChangeRequestExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartChangeRequestExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartChangeRequestExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response, &metadata)\n\t}\n\toutput := &StartChangeRequestExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartChangeRequestExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationDefinitionNotApprovedException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationDefinitionNotApprovedException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationDefinitionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationDefinitionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationDefinitionVersionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationDefinitionVersionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"AutomationExecutionLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"IdempotentParameterMismatch\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAutomationExecutionParametersException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAutomationExecutionParametersException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStartSession struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStartSession) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStartSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStartSession(response, &metadata)\n\t}\n\toutput := &StartSessionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStartSessionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStartSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"TargetNotConnected\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTargetNotConnected(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpStopAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpStopAutomationExecution) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpStopAutomationExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorStopAutomationExecution(response, &metadata)\n\t}\n\toutput := &StopAutomationExecutionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentStopAutomationExecutionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorStopAutomationExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AutomationExecutionNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAutomationStatusUpdateException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAutomationStatusUpdateException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpTerminateSession struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpTerminateSession) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpTerminateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorTerminateSession(response, &metadata)\n\t}\n\toutput := &TerminateSessionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentTerminateSessionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorTerminateSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUnlabelParameterVersion struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUnlabelParameterVersion) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUnlabelParameterVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUnlabelParameterVersion(response, &metadata)\n\t}\n\toutput := &UnlabelParameterVersionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUnlabelParameterVersionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUnlabelParameterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"ParameterVersionNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorParameterVersionNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateAssociation struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateAssociation) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociation(response, &metadata)\n\t}\n\toutput := &UpdateAssociationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateAssociationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"AssociationVersionLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationVersionLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidAssociationVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidAssociationVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidOutputLocation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidOutputLocation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidParameters\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidSchedule\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTarget\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidTargetMaps\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidUpdate\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidUpdate(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateAssociationStatus struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateAssociationStatus) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response, &metadata)\n\t}\n\toutput := &UpdateAssociationStatusOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateAssociationStatusOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AssociationDoesNotExist\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tcase strings.EqualFold(\"StatusUnchanged\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorStatusUnchanged(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateDocument struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateDocument) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocument(response, &metadata)\n\t}\n\toutput := &UpdateDocumentOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateDocumentOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DocumentVersionLimitExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDocumentVersionLimitExceeded(response, errorBody)\n\n\tcase strings.EqualFold(\"DuplicateDocumentContent\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDuplicateDocumentContent(response, errorBody)\n\n\tcase strings.EqualFold(\"DuplicateDocumentVersionName\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDuplicateDocumentVersionName(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentContent\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentContent(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentOperation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentSchemaVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"MaxDocumentSizeExceeded\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response, &metadata)\n\t}\n\toutput := &UpdateDocumentDefaultVersionOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateDocumentDefaultVersionOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentSchemaVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateDocumentMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateDocumentMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response, &metadata)\n\t}\n\toutput := &UpdateDocumentMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocument\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentOperation\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidDocumentVersion\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateMaintenanceWindow) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response, &metadata)\n\t}\n\toutput := &UpdateMaintenanceWindowOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response, &metadata)\n\t}\n\toutput := &UpdateMaintenanceWindowTargetOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response, &metadata)\n\t}\n\toutput := &UpdateMaintenanceWindowTaskOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateManagedInstanceRole struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateManagedInstanceRole) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response, &metadata)\n\t}\n\toutput := &UpdateManagedInstanceRoleOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateManagedInstanceRoleOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidInstanceId\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateOpsItem struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateOpsItem) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsItem(response, &metadata)\n\t}\n\toutput := &UpdateOpsItemOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateOpsItemOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemAccessDeniedException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemAlreadyExistsException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemInvalidParameterException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsItemNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateOpsMetadata) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response, &metadata)\n\t}\n\toutput := &UpdateOpsMetadataOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateOpsMetadataOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataInvalidArgumentException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataKeyLimitExceededException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataKeyLimitExceededException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"OpsMetadataTooManyUpdatesException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorOpsMetadataTooManyUpdatesException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdatePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdatePatchBaseline) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response, &metadata)\n\t}\n\toutput := &UpdatePatchBaselineOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"DoesNotExistException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateResourceDataSync) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateResourceDataSync(response, &metadata)\n\t}\n\toutput := &UpdateResourceDataSyncOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateResourceDataSyncOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncConflictException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncConflictException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncInvalidConfigurationException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceDataSyncNotFoundException\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsjson11_deserializeOpUpdateServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_deserializeOpUpdateServiceSetting) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsjson11_deserializeOpUpdateServiceSetting) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsjson11_deserializeOpErrorUpdateServiceSetting(response, &metadata)\n\t}\n\toutput := &UpdateServiceSettingOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsAwsjson11_deserializeOpDocumentUpdateServiceSettingOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsjson11_deserializeOpErrorUpdateServiceSetting(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerError\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)\n\n\tcase strings.EqualFold(\"ServiceSettingNotFound\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorServiceSettingNotFound(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyUpdates\", errorCode):\n\t\treturn awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsAwsjson11_deserializeErrorAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociatedInstances(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociatedInstances{}\n\terr := awsAwsjson11_deserializeDocumentAssociatedInstances(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociationAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociationAlreadyExists{}\n\terr := awsAwsjson11_deserializeDocumentAssociationAlreadyExists(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociationDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociationDoesNotExist{}\n\terr := awsAwsjson11_deserializeDocumentAssociationDoesNotExist(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociationExecutionDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociationExecutionDoesNotExist{}\n\terr := awsAwsjson11_deserializeDocumentAssociationExecutionDoesNotExist(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociationLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociationLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentAssociationLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAssociationVersionLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AssociationVersionLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentAssociationVersionLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationDefinitionNotApprovedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationDefinitionNotApprovedException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationDefinitionNotApprovedException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationDefinitionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationDefinitionNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationDefinitionNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationDefinitionVersionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationDefinitionVersionNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationDefinitionVersionNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationExecutionLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationExecutionLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationExecutionLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationExecutionNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationExecutionNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorAutomationStepNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.AutomationStepNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentAutomationStepNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorComplianceTypeCountLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ComplianceTypeCountLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentComplianceTypeCountLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorCustomSchemaCountLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.CustomSchemaCountLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentCustomSchemaCountLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDocumentAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DocumentAlreadyExists{}\n\terr := awsAwsjson11_deserializeDocumentDocumentAlreadyExists(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDocumentLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DocumentLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentDocumentLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDocumentPermissionLimit(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DocumentPermissionLimit{}\n\terr := awsAwsjson11_deserializeDocumentDocumentPermissionLimit(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDocumentVersionLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DocumentVersionLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentDocumentVersionLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DoesNotExistException{}\n\terr := awsAwsjson11_deserializeDocumentDoesNotExistException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDuplicateDocumentContent(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DuplicateDocumentContent{}\n\terr := awsAwsjson11_deserializeDocumentDuplicateDocumentContent(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDuplicateDocumentVersionName(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DuplicateDocumentVersionName{}\n\terr := awsAwsjson11_deserializeDocumentDuplicateDocumentVersionName(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorDuplicateInstanceId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.DuplicateInstanceId{}\n\terr := awsAwsjson11_deserializeDocumentDuplicateInstanceId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorFeatureNotAvailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.FeatureNotAvailableException{}\n\terr := awsAwsjson11_deserializeDocumentFeatureNotAvailableException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorHierarchyLevelLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.HierarchyLevelLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentHierarchyLevelLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorHierarchyTypeMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.HierarchyTypeMismatchException{}\n\terr := awsAwsjson11_deserializeDocumentHierarchyTypeMismatchException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.IdempotentParameterMismatch{}\n\terr := awsAwsjson11_deserializeDocumentIdempotentParameterMismatch(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorIncompatiblePolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.IncompatiblePolicyException{}\n\terr := awsAwsjson11_deserializeDocumentIncompatiblePolicyException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InternalServerError{}\n\terr := awsAwsjson11_deserializeDocumentInternalServerError(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidActivation(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidActivation{}\n\terr := awsAwsjson11_deserializeDocumentInvalidActivation(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidActivationId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidActivationId{}\n\terr := awsAwsjson11_deserializeDocumentInvalidActivationId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAggregatorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAggregatorException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAggregatorException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAllowedPatternException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAllowedPatternException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAllowedPatternException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAssociation(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAssociation{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAssociation(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAssociationVersion(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAssociationVersion{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAssociationVersion(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAutomationExecutionParametersException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAutomationExecutionParametersException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAutomationExecutionParametersException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAutomationSignalException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAutomationSignalException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAutomationSignalException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidAutomationStatusUpdateException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidAutomationStatusUpdateException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidAutomationStatusUpdateException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidCommandId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidCommandId{}\n\terr := awsAwsjson11_deserializeDocumentInvalidCommandId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDeleteInventoryParametersException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDeleteInventoryParametersException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDeleteInventoryParametersException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDeletionIdException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDeletionIdException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDeletionIdException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocument(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocument{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocument(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocumentContent(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocumentContent{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocumentContent(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocumentOperation(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocumentOperation{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocumentOperation(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocumentSchemaVersion{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocumentSchemaVersion(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocumentType(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocumentType{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocumentType(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidDocumentVersion(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidDocumentVersion{}\n\terr := awsAwsjson11_deserializeDocumentInvalidDocumentVersion(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidFilter(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidFilter{}\n\terr := awsAwsjson11_deserializeDocumentInvalidFilter(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidFilterKey(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidFilterKey{}\n\terr := awsAwsjson11_deserializeDocumentInvalidFilterKey(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidFilterOption(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidFilterOption{}\n\terr := awsAwsjson11_deserializeDocumentInvalidFilterOption(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidFilterValue(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidFilterValue{}\n\terr := awsAwsjson11_deserializeDocumentInvalidFilterValue(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidInstanceId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidInstanceId{}\n\terr := awsAwsjson11_deserializeDocumentInvalidInstanceId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidInstanceInformationFilterValue(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidInstanceInformationFilterValue{}\n\terr := awsAwsjson11_deserializeDocumentInvalidInstanceInformationFilterValue(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidInventoryGroupException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidInventoryGroupException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidInventoryGroupException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidInventoryItemContextException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidInventoryItemContextException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidInventoryItemContextException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidInventoryRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidInventoryRequestException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidInventoryRequestException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidItemContentException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidItemContentException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidItemContentException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidKeyId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidKeyId{}\n\terr := awsAwsjson11_deserializeDocumentInvalidKeyId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidNextToken(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidNextToken{}\n\terr := awsAwsjson11_deserializeDocumentInvalidNextToken(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidNotificationConfig(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidNotificationConfig{}\n\terr := awsAwsjson11_deserializeDocumentInvalidNotificationConfig(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidOptionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidOptionException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidOptionException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidOutputFolder(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidOutputFolder{}\n\terr := awsAwsjson11_deserializeDocumentInvalidOutputFolder(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidOutputLocation(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidOutputLocation{}\n\terr := awsAwsjson11_deserializeDocumentInvalidOutputLocation(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidParameters(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidParameters{}\n\terr := awsAwsjson11_deserializeDocumentInvalidParameters(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidPermissionType(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidPermissionType{}\n\terr := awsAwsjson11_deserializeDocumentInvalidPermissionType(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidPluginName(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidPluginName{}\n\terr := awsAwsjson11_deserializeDocumentInvalidPluginName(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidPolicyAttributeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidPolicyAttributeException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidPolicyAttributeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidPolicyTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidPolicyTypeException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidPolicyTypeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidResourceId(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidResourceId{}\n\terr := awsAwsjson11_deserializeDocumentInvalidResourceId(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidResourceType(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidResourceType{}\n\terr := awsAwsjson11_deserializeDocumentInvalidResourceType(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidResultAttributeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidResultAttributeException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidResultAttributeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidRole(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidRole{}\n\terr := awsAwsjson11_deserializeDocumentInvalidRole(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidSchedule(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidSchedule{}\n\terr := awsAwsjson11_deserializeDocumentInvalidSchedule(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTag(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTag{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTag(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTarget(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTarget{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTarget(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTargetMaps(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTargetMaps{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTargetMaps(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidTypeNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidTypeNameException{}\n\terr := awsAwsjson11_deserializeDocumentInvalidTypeNameException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvalidUpdate(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvalidUpdate{}\n\terr := awsAwsjson11_deserializeDocumentInvalidUpdate(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorInvocationDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.InvocationDoesNotExist{}\n\terr := awsAwsjson11_deserializeDocumentInvocationDoesNotExist(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorItemContentMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ItemContentMismatchException{}\n\terr := awsAwsjson11_deserializeDocumentItemContentMismatchException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ItemSizeLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentItemSizeLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.MaxDocumentSizeExceeded{}\n\terr := awsAwsjson11_deserializeDocumentMaxDocumentSizeExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemAccessDeniedException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemAccessDeniedException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemConflictException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemConflictException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemInvalidParameterException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemInvalidParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemRelatedItemAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemRelatedItemAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemRelatedItemAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsItemRelatedItemAssociationNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsItemRelatedItemAssociationNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentOpsItemRelatedItemAssociationNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataInvalidArgumentException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataInvalidArgumentException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataKeyLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataKeyLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataKeyLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorOpsMetadataTooManyUpdatesException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.OpsMetadataTooManyUpdatesException{}\n\terr := awsAwsjson11_deserializeDocumentOpsMetadataTooManyUpdatesException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterAlreadyExists{}\n\terr := awsAwsjson11_deserializeDocumentParameterAlreadyExists(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentParameterLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterMaxVersionLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterMaxVersionLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentParameterMaxVersionLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterNotFound{}\n\terr := awsAwsjson11_deserializeDocumentParameterNotFound(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterPatternMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterPatternMismatchException{}\n\terr := awsAwsjson11_deserializeDocumentParameterPatternMismatchException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterVersionLabelLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterVersionLabelLimitExceeded{}\n\terr := awsAwsjson11_deserializeDocumentParameterVersionLabelLimitExceeded(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorParameterVersionNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ParameterVersionNotFound{}\n\terr := awsAwsjson11_deserializeDocumentParameterVersionNotFound(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorPoliciesLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.PoliciesLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentPoliciesLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceDataSyncAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceDataSyncAlreadyExistsException{}\n\terr := awsAwsjson11_deserializeDocumentResourceDataSyncAlreadyExistsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceDataSyncConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceDataSyncConflictException{}\n\terr := awsAwsjson11_deserializeDocumentResourceDataSyncConflictException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceDataSyncCountExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceDataSyncCountExceededException{}\n\terr := awsAwsjson11_deserializeDocumentResourceDataSyncCountExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceDataSyncInvalidConfigurationException{}\n\terr := awsAwsjson11_deserializeDocumentResourceDataSyncInvalidConfigurationException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceDataSyncNotFoundException{}\n\terr := awsAwsjson11_deserializeDocumentResourceDataSyncNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceInUseException{}\n\terr := awsAwsjson11_deserializeDocumentResourceInUseException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourceLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentResourceLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourcePolicyConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourcePolicyConflictException{}\n\terr := awsAwsjson11_deserializeDocumentResourcePolicyConflictException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourcePolicyInvalidParameterException{}\n\terr := awsAwsjson11_deserializeDocumentResourcePolicyInvalidParameterException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorResourcePolicyLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ResourcePolicyLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentResourcePolicyLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorServiceSettingNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.ServiceSettingNotFound{}\n\terr := awsAwsjson11_deserializeDocumentServiceSettingNotFound(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorStatusUnchanged(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.StatusUnchanged{}\n\terr := awsAwsjson11_deserializeDocumentStatusUnchanged(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorSubTypeCountLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.SubTypeCountLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentSubTypeCountLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTargetInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TargetInUseException{}\n\terr := awsAwsjson11_deserializeDocumentTargetInUseException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTargetNotConnected(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TargetNotConnected{}\n\terr := awsAwsjson11_deserializeDocumentTargetNotConnected(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTooManyTagsError(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TooManyTagsError{}\n\terr := awsAwsjson11_deserializeDocumentTooManyTagsError(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTooManyUpdates(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TooManyUpdates{}\n\terr := awsAwsjson11_deserializeDocumentTooManyUpdates(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.TotalSizeLimitExceededException{}\n\terr := awsAwsjson11_deserializeDocumentTotalSizeLimitExceededException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedCalendarException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedCalendarException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedCalendarException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedFeatureRequiredException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedFeatureRequiredException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedFeatureRequiredException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedInventoryItemContextException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedInventoryItemContextException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedInventoryItemContextException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedInventorySchemaVersionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedInventorySchemaVersionException{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedInventorySchemaVersionException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedOperatingSystem{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedParameterType(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedParameterType{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedParameterType(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeErrorUnsupportedPlatformType(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\toutput := &types.UnsupportedPlatformType{}\n\terr := awsAwsjson11_deserializeDocumentUnsupportedPlatformType(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\treturn output\n}\n\nfunc awsAwsjson11_deserializeDocumentAccountIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AccountId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAccounts(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Account to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAccountSharingInfo(v **types.AccountSharingInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AccountSharingInfo\n\tif *v == nil {\n\t\tsv = &types.AccountSharingInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AccountId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccountId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccountId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SharedDocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SharedDocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SharedDocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAccountSharingInfoList(v *[]types.AccountSharingInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AccountSharingInfo\n\tif *v == nil {\n\t\tcv = []types.AccountSharingInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AccountSharingInfo\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAccountSharingInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentActivation(v **types.Activation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Activation\n\tif *v == nil {\n\t\tsv = &types.Activation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActivationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ActivationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ActivationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected CreatedDate to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DefaultInstanceName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DefaultInstanceName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultInstanceName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ActivationDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExpirationDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationDate to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Expired\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Expired = jtv\n\t\t\t}\n\n\t\tcase \"IamRole\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IamRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IamRole = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"RegistrationLimit\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistrationLimit to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.RegistrationLimit = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"RegistrationsCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RegistrationsCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.RegistrationsCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentActivationList(v *[]types.Activation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Activation\n\tif *v == nil {\n\t\tcv = []types.Activation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Activation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentActivation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlarm(v **types.Alarm, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Alarm\n\tif *v == nil {\n\t\tsv = &types.Alarm{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AlarmName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlarmConfiguration(v **types.AlarmConfiguration, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AlarmConfiguration\n\tif *v == nil {\n\t\tsv = &types.AlarmConfiguration{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Alarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmList(&sv.Alarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"IgnorePollAlarmFailure\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IgnorePollAlarmFailure = jtv\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlarmList(v *[]types.Alarm, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Alarm\n\tif *v == nil {\n\t\tcv = []types.Alarm{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Alarm\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAlarm(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlarmStateInformation(v **types.AlarmStateInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AlarmStateInformation\n\tif *v == nil {\n\t\tsv = &types.AlarmStateInformation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AlarmName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"State\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExternalAlarmState to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.State = types.ExternalAlarmState(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlarmStateInformationList(v *[]types.AlarmStateInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AlarmStateInformation\n\tif *v == nil {\n\t\tcv = []types.AlarmStateInformation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AlarmStateInformation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.AlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociatedInstances(v **types.AssociatedInstances, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociatedInstances\n\tif *v == nil {\n\t\tsv = &types.AssociatedInstances{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociation(v **types.Association, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Association\n\tif *v == nil {\n\t\tsv = &types.Association{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Overview\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationOverview(&sv.Overview, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduleExpression\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleExpression to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleExpression = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationAlreadyExists(v **types.AssociationAlreadyExists, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationAlreadyExists\n\tif *v == nil {\n\t\tsv = &types.AssociationAlreadyExists{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationDescription(v **types.AssociationDescription, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationDescription\n\tif *v == nil {\n\t\tsv = &types.AssociationDescription{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApplyOnlyAtCronInterval\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ApplyOnlyAtCronInterval to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApplyOnlyAtCronInterval = jtv\n\t\t\t}\n\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationTargetParameterName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationTargetParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationTargetParameterName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CalendarNames\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ComplianceSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationComplianceSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceSeverity = types.AssociationComplianceSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"Date\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastSuccessfulExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastSuccessfulExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastUpdateAssociationDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastUpdateAssociationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputLocation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationOutputLocation(&sv.OutputLocation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Overview\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationOverview(&sv.Overview, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameters(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduleExpression\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleExpression to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleExpression = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationStatus(&sv.Status, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"SyncCompliance\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationSyncCompliance to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncCompliance = types.AssociationSyncCompliance(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationDescriptionList(v *[]types.AssociationDescription, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AssociationDescription\n\tif *v == nil {\n\t\tcv = []types.AssociationDescription{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AssociationDescription\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescription(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationDoesNotExist(v **types.AssociationDoesNotExist, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationDoesNotExist\n\tif *v == nil {\n\t\tsv = &types.AssociationDoesNotExist{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationExecution(v **types.AssociationExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationExecution\n\tif *v == nil {\n\t\tsv = &types.AssociationExecution{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DetailedStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailedStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ResourceCountByStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceCountByStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceCountByStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationExecutionDoesNotExist(v **types.AssociationExecutionDoesNotExist, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationExecutionDoesNotExist\n\tif *v == nil {\n\t\tsv = &types.AssociationExecutionDoesNotExist{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationExecutionsList(v *[]types.AssociationExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AssociationExecution\n\tif *v == nil {\n\t\tcv = []types.AssociationExecution{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AssociationExecution\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAssociationExecution(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationExecutionTarget(v **types.AssociationExecutionTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationExecutionTarget\n\tif *v == nil {\n\t\tsv = &types.AssociationExecutionTarget{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DetailedStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailedStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"OutputSource\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOutputSource(&sv.OutputSource, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ResourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationExecutionTargetsList(v *[]types.AssociationExecutionTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AssociationExecutionTarget\n\tif *v == nil {\n\t\tcv = []types.AssociationExecutionTarget{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AssociationExecutionTarget\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAssociationExecutionTarget(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationLimitExceeded(v **types.AssociationLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.AssociationLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationList(v *[]types.Association, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Association\n\tif *v == nil {\n\t\tcv = []types.Association{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Association\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAssociation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationOverview(v **types.AssociationOverview, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationOverview\n\tif *v == nil {\n\t\tsv = &types.AssociationOverview{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationStatusAggregatedCount\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationStatusAggregatedCount(&sv.AssociationStatusAggregatedCount, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"DetailedStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailedStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationStatus(v **types.AssociationStatus, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationStatus\n\tif *v == nil {\n\t\tsv = &types.AssociationStatus{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AdditionalInfo\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusAdditionalInfo to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AdditionalInfo = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Date\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationStatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = types.AssociationStatusName(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationStatusAggregatedCount(v *map[string]int32, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]int32\n\tif *v == nil {\n\t\tmv = map[string]int32{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal int32\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(json.Number)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected InstanceCount to be json.Number, got %T instead\", value)\n\t\t\t}\n\t\t\ti64, err := jtv.Int64()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparsedVal = int32(i64)\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.AssociationVersionInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationVersionInfo\n\tif *v == nil {\n\t\tsv = &types.AssociationVersionInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApplyOnlyAtCronInterval\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ApplyOnlyAtCronInterval to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApplyOnlyAtCronInterval = jtv\n\t\t\t}\n\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CalendarNames\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ComplianceSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationComplianceSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceSeverity = types.AssociationComplianceSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputLocation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationOutputLocation(&sv.OutputLocation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameters(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduleExpression\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleExpression to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleExpression = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"SyncCompliance\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationSyncCompliance to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncCompliance = types.AssociationSyncCompliance(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationVersionLimitExceeded(v **types.AssociationVersionLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AssociationVersionLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.AssociationVersionLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAssociationVersionList(v *[]types.AssociationVersionInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AssociationVersionInfo\n\tif *v == nil {\n\t\tcv = []types.AssociationVersionInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AssociationVersionInfo\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAssociationVersionInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAttachmentContent(v **types.AttachmentContent, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AttachmentContent\n\tif *v == nil {\n\t\tsv = &types.AttachmentContent{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Hash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttachmentHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Hash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"HashType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttachmentHashType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.HashType = types.AttachmentHashType(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttachmentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Size\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ContentLength to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Size = i64\n\t\t\t}\n\n\t\tcase \"Url\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttachmentUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Url = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAttachmentContentList(v *[]types.AttachmentContent, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AttachmentContent\n\tif *v == nil {\n\t\tcv = []types.AttachmentContent{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AttachmentContent\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAttachmentContent(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAttachmentInformation(v **types.AttachmentInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AttachmentInformation\n\tif *v == nil {\n\t\tsv = &types.AttachmentInformation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AttachmentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAttachmentInformationList(v *[]types.AttachmentInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AttachmentInformation\n\tif *v == nil {\n\t\tcv = []types.AttachmentInformation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AttachmentInformation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAttachmentInformation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationDefinitionNotApprovedException(v **types.AutomationDefinitionNotApprovedException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationDefinitionNotApprovedException\n\tif *v == nil {\n\t\tsv = &types.AutomationDefinitionNotApprovedException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationDefinitionNotFoundException(v **types.AutomationDefinitionNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationDefinitionNotFoundException\n\tif *v == nil {\n\t\tsv = &types.AutomationDefinitionNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationDefinitionVersionNotFoundException(v **types.AutomationDefinitionVersionNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationDefinitionVersionNotFoundException\n\tif *v == nil {\n\t\tsv = &types.AutomationDefinitionVersionNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationExecution\n\tif *v == nil {\n\t\tsv = &types.AutomationExecution{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationExecutionStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionStatus = types.AutomationExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationSubtype\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationSubtype to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationSubtype = types.AutomationSubtype(jtv)\n\t\t\t}\n\n\t\tcase \"ChangeRequestName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ChangeRequestName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ChangeRequestName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CurrentAction\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CurrentAction = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CurrentStepName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CurrentStepName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"FailureMessage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureMessage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Mode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExecutionMode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Mode = types.ExecutionMode(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Outputs\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Outputs, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ParentAutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ParentAutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ProgressCounters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentProgressCounters(&sv.ProgressCounters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ResolvedTargets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResolvedTargets(&sv.ResolvedTargets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Runbooks\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRunbooks(&sv.Runbooks, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduledTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"StepExecutions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentStepExecutionList(&sv.StepExecutions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"StepExecutionsTruncated\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepExecutionsTruncated = jtv\n\t\t\t}\n\n\t\tcase \"Target\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Target = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetParameterName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationParameterKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetParameterName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Variables\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Variables, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationExecutionLimitExceededException(v **types.AutomationExecutionLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationExecutionLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.AutomationExecutionLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.AutomationExecutionMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationExecutionMetadata\n\tif *v == nil {\n\t\tsv = &types.AutomationExecutionMetadata{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationExecutionStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionStatus = types.AutomationExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationSubtype\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationSubtype to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationSubtype = types.AutomationSubtype(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationType = types.AutomationType(jtv)\n\t\t\t}\n\n\t\tcase \"ChangeRequestName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ChangeRequestName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ChangeRequestName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CurrentAction\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CurrentAction = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CurrentStepName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CurrentStepName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"FailureMessage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureMessage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LogFile\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LogFile = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Mode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExecutionMode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Mode = types.ExecutionMode(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Outputs\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Outputs, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ParentAutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ParentAutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResolvedTargets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResolvedTargets(&sv.ResolvedTargets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Runbooks\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRunbooks(&sv.Runbooks, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduledTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Target\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Target = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetParameterName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationParameterKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetParameterName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationExecutionMetadataList(v *[]types.AutomationExecutionMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AutomationExecutionMetadata\n\tif *v == nil {\n\t\tcv = []types.AutomationExecutionMetadata{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AutomationExecutionMetadata\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationExecutionNotFoundException(v **types.AutomationExecutionNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationExecutionNotFoundException\n\tif *v == nil {\n\t\tsv = &types.AutomationExecutionNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationParameterMap(v *map[string][]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string][]string\n\tif *v == nil {\n\t\tmv = map[string][]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal []string\n\t\tmapVar := parsedVal\n\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterValueList(&mapVar, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = mapVar\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationParameterValueList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AutomationParameterValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentAutomationStepNotFoundException(v **types.AutomationStepNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AutomationStepNotFoundException\n\tif *v == nil {\n\t\tsv = &types.AutomationStepNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCalendarNameOrARNList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected CalendarNameOrARN to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCategoryEnumList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Category to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCategoryList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Category to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(v **types.CloudWatchOutputConfig, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CloudWatchOutputConfig\n\tif *v == nil {\n\t\tsv = &types.CloudWatchOutputConfig{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CloudWatchLogGroupName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CloudWatchLogGroupName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CloudWatchLogGroupName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CloudWatchOutputEnabled\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CloudWatchOutputEnabled to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CloudWatchOutputEnabled = jtv\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Command\n\tif *v == nil {\n\t\tsv = &types.Command{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CloudWatchOutputConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(&sv.CloudWatchOutputConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CommandId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CommandId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Comment\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Comment to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Comment = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CompletedCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CompletedCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.CompletedCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"DeliveryTimedOutCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DeliveryTimedOutCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.DeliveryTimedOutCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ErrorCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ErrorCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"ExpiresAfter\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExpiresAfter = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"InstanceIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceIdList(&sv.InstanceIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NotificationConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNotificationConfig(&sv.NotificationConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OutputS3BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3KeyPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3KeyPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3KeyPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3Region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameters(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RequestedDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ServiceRole\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRole = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.CommandStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TargetCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TargetCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TargetCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TimeoutSeconds\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TimeoutSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TimeoutSeconds = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommandInvocation(v **types.CommandInvocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CommandInvocation\n\tif *v == nil {\n\t\tsv = &types.CommandInvocation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CloudWatchOutputConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(&sv.CloudWatchOutputConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CommandId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CommandId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CommandPlugins\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCommandPluginList(&sv.CommandPlugins, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Comment\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Comment to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Comment = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceTagName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NotificationConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNotificationConfig(&sv.NotificationConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RequestedDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ServiceRole\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRole = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardErrorUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardErrorUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardOutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardOutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandInvocationStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.CommandInvocationStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TraceOutput\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InvocationTraceOutput to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TraceOutput = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommandInvocationList(v *[]types.CommandInvocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.CommandInvocation\n\tif *v == nil {\n\t\tcv = []types.CommandInvocation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.CommandInvocation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentCommandInvocation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommandList(v *[]types.Command, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Command\n\tif *v == nil {\n\t\tcv = []types.Command{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Command\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentCommand(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommandPlugin(v **types.CommandPlugin, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CommandPlugin\n\tif *v == nil {\n\t\tsv = &types.CommandPlugin{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandPluginName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Output\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandPluginOutput to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Output = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3KeyPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3KeyPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3KeyPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3Region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResponseCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResponseCode to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ResponseCode = int32(i64)\n\t\t\t}\n\n\t\tcase \"ResponseFinishDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ResponseFinishDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ResponseStartDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ResponseStartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"StandardErrorUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardErrorUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardOutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardOutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandPluginStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.CommandPluginStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCommandPluginList(v *[]types.CommandPlugin, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.CommandPlugin\n\tif *v == nil {\n\t\tcv = []types.CommandPlugin{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.CommandPlugin\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentCommandPlugin(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceExecutionSummary(v **types.ComplianceExecutionSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ComplianceExecutionSummary\n\tif *v == nil {\n\t\tsv = &types.ComplianceExecutionSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceExecutionType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceItem(v **types.ComplianceItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ComplianceItem\n\tif *v == nil {\n\t\tsv = &types.ComplianceItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ComplianceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Details\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentComplianceItemDetails(&sv.Details, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ExecutionSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentComplianceExecutionSummary(&sv.ExecutionSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Id\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceItemId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Id = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = types.ComplianceSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ComplianceStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceItemTitle to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceItemDetails(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AttributeValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceItemList(v *[]types.ComplianceItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ComplianceItem\n\tif *v == nil {\n\t\tcv = []types.ComplianceItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ComplianceItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentComplianceItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceSummaryItem(v **types.ComplianceSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ComplianceSummaryItem\n\tif *v == nil {\n\t\tsv = &types.ComplianceSummaryItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ComplianceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CompliantSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCompliantSummary(&sv.CompliantSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NonCompliantSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNonCompliantSummary(&sv.NonCompliantSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceSummaryItemList(v *[]types.ComplianceSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ComplianceSummaryItem\n\tif *v == nil {\n\t\tcv = []types.ComplianceSummaryItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ComplianceSummaryItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentComplianceSummaryItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentComplianceTypeCountLimitExceededException(v **types.ComplianceTypeCountLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ComplianceTypeCountLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.ComplianceTypeCountLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCompliantSummary(v **types.CompliantSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CompliantSummary\n\tif *v == nil {\n\t\tsv = &types.CompliantSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CompliantCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.CompliantCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"SeveritySummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentSeveritySummary(&sv.SeveritySummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **types.CreateAssociationBatchRequestEntry, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CreateAssociationBatchRequestEntry\n\tif *v == nil {\n\t\tsv = &types.CreateAssociationBatchRequestEntry{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApplyOnlyAtCronInterval\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ApplyOnlyAtCronInterval to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApplyOnlyAtCronInterval = jtv\n\t\t\t}\n\n\t\tcase \"AssociationName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AutomationTargetParameterName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationTargetParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationTargetParameterName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CalendarNames\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ComplianceSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationComplianceSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceSeverity = types.AssociationComplianceSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputLocation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationOutputLocation(&sv.OutputLocation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameters(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ScheduleExpression\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleExpression to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleExpression = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ScheduleOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"SyncCompliance\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationSyncCompliance to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncCompliance = types.AssociationSyncCompliance(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentCustomSchemaCountLimitExceededException(v **types.CustomSchemaCountLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.CustomSchemaCountLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.CustomSchemaCountLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentAlreadyExists(v **types.DocumentAlreadyExists, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentAlreadyExists\n\tif *v == nil {\n\t\tsv = &types.DocumentAlreadyExists{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentDefaultVersionDescription(v **types.DocumentDefaultVersionDescription, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentDefaultVersionDescription\n\tif *v == nil {\n\t\tsv = &types.DocumentDefaultVersionDescription{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DefaultVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DefaultVersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultVersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescription, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentDescription\n\tif *v == nil {\n\t\tsv = &types.DocumentDescription{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApprovedVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApprovedVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AttachmentsInformation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAttachmentInformationList(&sv.AttachmentsInformation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Author\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentAuthor to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Author = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Category\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCategoryList(&sv.Category, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CategoryEnum\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCategoryEnumList(&sv.CategoryEnum, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DefaultVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DescriptionInDocument to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DisplayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentFormat\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentFormat to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentFormat = types.DocumentFormat(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentType = types.DocumentType(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Hash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Hash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"HashType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentHashType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.HashType = types.DocumentHashType(jtv)\n\t\t\t}\n\n\t\tcase \"LatestVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LatestVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Owner\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentOwner to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Owner = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentParameterList(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"PendingReviewVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PendingReviewVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PlatformTypes\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPlatformTypeList(&sv.PlatformTypes, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Requires\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentRequiresList(&sv.Requires, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ReviewInformation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentReviewInformationList(&sv.ReviewInformation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ReviewStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ReviewStatus = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"SchemaVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SchemaVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Sha1\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentSha1 to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Sha1 = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.DocumentStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatusInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TargetType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"VersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentIdentifier(v **types.DocumentIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentIdentifier\n\tif *v == nil {\n\t\tsv = &types.DocumentIdentifier{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Author\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentAuthor to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Author = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DisplayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentFormat\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentFormat to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentFormat = types.DocumentFormat(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentType = types.DocumentType(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Owner\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentOwner to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Owner = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PlatformTypes\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPlatformTypeList(&sv.PlatformTypes, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Requires\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentRequiresList(&sv.Requires, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ReviewStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ReviewStatus = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"SchemaVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SchemaVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Tags\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TargetType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"VersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentIdentifierList(v *[]types.DocumentIdentifier, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentIdentifier\n\tif *v == nil {\n\t\tcv = []types.DocumentIdentifier{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentIdentifier\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentIdentifier(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentLimitExceeded(v **types.DocumentLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.DocumentLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(v **types.DocumentMetadataResponseInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentMetadataResponseInfo\n\tif *v == nil {\n\t\tsv = &types.DocumentMetadataResponseInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ReviewerResponse\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentReviewerResponseList(&sv.ReviewerResponse, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentParameter(v **types.DocumentParameter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentParameter\n\tif *v == nil {\n\t\tsv = &types.DocumentParameter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DefaultValue\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentParameterDefaultValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultValue = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentParameterDescrption to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentParameterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.DocumentParameterType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentParameterList(v *[]types.DocumentParameter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentParameter\n\tif *v == nil {\n\t\tcv = []types.DocumentParameter{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentParameter\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentParameter(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentPermissionLimit(v **types.DocumentPermissionLimit, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentPermissionLimit\n\tif *v == nil {\n\t\tsv = &types.DocumentPermissionLimit{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentRequires(v **types.DocumentRequires, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentRequires\n\tif *v == nil {\n\t\tsv = &types.DocumentRequires{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"RequireType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RequireType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RequireType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"VersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentRequiresList(v *[]types.DocumentRequires, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentRequires\n\tif *v == nil {\n\t\tcv = []types.DocumentRequires{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentRequires\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentRequires(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentReviewCommentList(v *[]types.DocumentReviewCommentSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentReviewCommentSource\n\tif *v == nil {\n\t\tcv = []types.DocumentReviewCommentSource{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentReviewCommentSource\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentReviewCommentSource(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentReviewCommentSource(v **types.DocumentReviewCommentSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentReviewCommentSource\n\tif *v == nil {\n\t\tsv = &types.DocumentReviewCommentSource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Content\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentReviewComment to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Content = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentReviewCommentType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.DocumentReviewCommentType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentReviewerResponseList(v *[]types.DocumentReviewerResponseSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentReviewerResponseSource\n\tif *v == nil {\n\t\tcv = []types.DocumentReviewerResponseSource{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentReviewerResponseSource\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(v **types.DocumentReviewerResponseSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentReviewerResponseSource\n\tif *v == nil {\n\t\tsv = &types.DocumentReviewerResponseSource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Comment\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentReviewCommentList(&sv.Comment, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CreateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Reviewer\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Reviewer to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Reviewer = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ReviewStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ReviewStatus = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"UpdatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.UpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentVersionInfo(v **types.DocumentVersionInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentVersionInfo\n\tif *v == nil {\n\t\tsv = &types.DocumentVersionInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DisplayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentFormat\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentFormat to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentFormat = types.DocumentFormat(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"IsDefaultVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IsDefaultVersion = jtv\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ReviewStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ReviewStatus = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.DocumentStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatusInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"VersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentVersionLimitExceeded(v **types.DocumentVersionLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DocumentVersionLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.DocumentVersionLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDocumentVersionList(v *[]types.DocumentVersionInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.DocumentVersionInfo\n\tif *v == nil {\n\t\tcv = []types.DocumentVersionInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.DocumentVersionInfo\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentDocumentVersionInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDoesNotExistException(v **types.DoesNotExistException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DoesNotExistException\n\tif *v == nil {\n\t\tsv = &types.DoesNotExistException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDuplicateDocumentContent(v **types.DuplicateDocumentContent, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DuplicateDocumentContent\n\tif *v == nil {\n\t\tsv = &types.DuplicateDocumentContent{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDuplicateDocumentVersionName(v **types.DuplicateDocumentVersionName, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DuplicateDocumentVersionName\n\tif *v == nil {\n\t\tsv = &types.DuplicateDocumentVersionName{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentDuplicateInstanceId(v **types.DuplicateInstanceId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.DuplicateInstanceId\n\tif *v == nil {\n\t\tsv = &types.DuplicateInstanceId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEffectivePatch(v **types.EffectivePatch, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.EffectivePatch\n\tif *v == nil {\n\t\tsv = &types.EffectivePatch{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Patch\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatch(&sv.Patch, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"PatchStatus\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchStatus(&sv.PatchStatus, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentEffectivePatchList(v *[]types.EffectivePatch, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.EffectivePatch\n\tif *v == nil {\n\t\tcv = []types.EffectivePatch{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.EffectivePatch\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentEffectivePatch(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentFailedCreateAssociation(v **types.FailedCreateAssociation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.FailedCreateAssociation\n\tif *v == nil {\n\t\tsv = &types.FailedCreateAssociation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Entry\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(&sv.Entry, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Fault\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Fault to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Fault = types.Fault(jtv)\n\t\t\t}\n\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BatchErrorMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentFailedCreateAssociationList(v *[]types.FailedCreateAssociation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.FailedCreateAssociation\n\tif *v == nil {\n\t\tcv = []types.FailedCreateAssociation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.FailedCreateAssociation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentFailedCreateAssociation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentFailureDetails(v **types.FailureDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.FailureDetails\n\tif *v == nil {\n\t\tsv = &types.FailureDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Details\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Details, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"FailureStage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureStage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"FailureType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentFeatureNotAvailableException(v **types.FeatureNotAvailableException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.FeatureNotAvailableException\n\tif *v == nil {\n\t\tsv = &types.FeatureNotAvailableException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntries(v *[]types.GetResourcePoliciesResponseEntry, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.GetResourcePoliciesResponseEntry\n\tif *v == nil {\n\t\tcv = []types.GetResourcePoliciesResponseEntry{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.GetResourcePoliciesResponseEntry\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntry(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntry(v **types.GetResourcePoliciesResponseEntry, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.GetResourcePoliciesResponseEntry\n\tif *v == nil {\n\t\tsv = &types.GetResourcePoliciesResponseEntry{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Policy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Policy to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Policy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PolicyHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PolicyHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PolicyId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PolicyId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentHierarchyLevelLimitExceededException(v **types.HierarchyLevelLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.HierarchyLevelLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.HierarchyLevelLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentHierarchyTypeMismatchException(v **types.HierarchyTypeMismatchException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.HierarchyTypeMismatchException\n\tif *v == nil {\n\t\tsv = &types.HierarchyTypeMismatchException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentIdempotentParameterMismatch(v **types.IdempotentParameterMismatch, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.IdempotentParameterMismatch\n\tif *v == nil {\n\t\tsv = &types.IdempotentParameterMismatch{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentIncompatiblePolicyException(v **types.IncompatiblePolicyException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.IncompatiblePolicyException\n\tif *v == nil {\n\t\tsv = &types.IncompatiblePolicyException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAggregatedAssociationOverview(v **types.InstanceAggregatedAssociationOverview, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceAggregatedAssociationOverview\n\tif *v == nil {\n\t\tsv = &types.InstanceAggregatedAssociationOverview{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DetailedStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailedStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceAssociationStatusAggregatedCount\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationStatusAggregatedCount(&sv.InstanceAssociationStatusAggregatedCount, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociation(v **types.InstanceAssociation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceAssociation\n\tif *v == nil {\n\t\tsv = &types.InstanceAssociation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Content\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentContent to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Content = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationList(v *[]types.InstanceAssociation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InstanceAssociation\n\tif *v == nil {\n\t\tcv = []types.InstanceAssociation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InstanceAssociation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationOutputLocation(v **types.InstanceAssociationOutputLocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceAssociationOutputLocation\n\tif *v == nil {\n\t\tsv = &types.InstanceAssociationOutputLocation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"S3Location\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentS3OutputLocation(&sv.S3Location, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationOutputUrl(v **types.InstanceAssociationOutputUrl, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceAssociationOutputUrl\n\tif *v == nil {\n\t\tsv = &types.InstanceAssociationOutputUrl{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"S3OutputUrl\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentS3OutputUrl(&sv.S3OutputUrl, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationStatusAggregatedCount(v *map[string]int32, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]int32\n\tif *v == nil {\n\t\tmv = map[string]int32{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal int32\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(json.Number)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected InstanceCount to be json.Number, got %T instead\", value)\n\t\t\t}\n\t\t\ti64, err := jtv.Int64()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparsedVal = int32(i64)\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationStatusInfo(v **types.InstanceAssociationStatusInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceAssociationStatusInfo\n\tif *v == nil {\n\t\tsv = &types.InstanceAssociationStatusInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AssociationVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DetailedStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailedStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ErrorCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AgentErrorCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ErrorCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionSummary\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceAssociationExecutionSummary to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionSummary = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputUrl\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationOutputUrl(&sv.OutputUrl, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceAssociationStatusInfos(v *[]types.InstanceAssociationStatusInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InstanceAssociationStatusInfo\n\tif *v == nil {\n\t\tcv = []types.InstanceAssociationStatusInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InstanceAssociationStatusInfo\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationStatusInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceInformation(v **types.InstanceInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstanceInformation\n\tif *v == nil {\n\t\tsv = &types.InstanceInformation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActivationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ActivationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ActivationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AgentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Version to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AgentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationOverview\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAggregatedAssociationOverview(&sv.AssociationOverview, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"AssociationStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ComputerName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComputerName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComputerName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"IamRole\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IamRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IamRole = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"IPAddress\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IPAddress to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IPAddress = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"IsLatestVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IsLatestVersion = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"LastAssociationExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastPingDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastPingDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastSuccessfulAssociationExecutionDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastSuccessfulAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PingStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PingStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PingStatus = types.PingStatus(jtv)\n\t\t\t}\n\n\t\tcase \"PlatformName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PlatformName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PlatformType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PlatformType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PlatformType = types.PlatformType(jtv)\n\t\t\t}\n\n\t\tcase \"PlatformVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PlatformVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"RegistrationDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.RegistrationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = types.ResourceType(jtv)\n\t\t\t}\n\n\t\tcase \"SourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceType = types.SourceType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstanceInformationList(v *[]types.InstanceInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InstanceInformation\n\tif *v == nil {\n\t\tcv = []types.InstanceInformation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InstanceInformation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInstanceInformation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchState, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InstancePatchState\n\tif *v == nil {\n\t\tsv = &types.InstancePatchState{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CriticalNonCompliantCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchCriticalNonCompliantCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.CriticalNonCompliantCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"FailedCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchFailedCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.FailedCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstalledCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchInstalledCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstalledCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstalledOtherCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchInstalledOtherCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstalledOtherCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstalledPendingRebootCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchInstalledPendingRebootCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstalledPendingRebootCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstalledRejectedCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchInstalledRejectedCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstalledRejectedCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstallOverrideList\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstallOverrideList to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstallOverrideList = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastNoRebootInstallOperationTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastNoRebootInstallOperationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"MissingCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchMissingCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.MissingCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"NotApplicableCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchNotApplicableCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.NotApplicableCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"Operation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchOperationType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Operation = types.PatchOperationType(jtv)\n\t\t\t}\n\n\t\tcase \"OperationEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.OperationEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"OperationStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.OperationStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"OtherNonCompliantCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchOtherNonCompliantCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.OtherNonCompliantCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"OwnerInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OwnerInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OwnerInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PatchGroup\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PatchGroup = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"RebootOption\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RebootOption to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RebootOption = types.RebootOption(jtv)\n\t\t\t}\n\n\t\tcase \"SecurityNonCompliantCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchSecurityNonCompliantCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.SecurityNonCompliantCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"SnapshotId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SnapshotId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SnapshotId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"UnreportedNotApplicableCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchUnreportedNotApplicableCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.UnreportedNotApplicableCount = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstancePatchStateList(v *[]types.InstancePatchState, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InstancePatchState\n\tif *v == nil {\n\t\tcv = []types.InstancePatchState{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InstancePatchState\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInstancePatchState(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInstancePatchStatesList(v *[]types.InstancePatchState, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InstancePatchState\n\tif *v == nil {\n\t\tcv = []types.InstancePatchState{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InstancePatchState\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInstancePatchState(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InternalServerError\n\tif *v == nil {\n\t\tsv = &types.InternalServerError{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidActivation(v **types.InvalidActivation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidActivation\n\tif *v == nil {\n\t\tsv = &types.InvalidActivation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidActivationId(v **types.InvalidActivationId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidActivationId\n\tif *v == nil {\n\t\tsv = &types.InvalidActivationId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAggregatorException(v **types.InvalidAggregatorException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAggregatorException\n\tif *v == nil {\n\t\tsv = &types.InvalidAggregatorException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAllowedPatternException(v **types.InvalidAllowedPatternException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAllowedPatternException\n\tif *v == nil {\n\t\tsv = &types.InvalidAllowedPatternException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAssociation(v **types.InvalidAssociation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAssociation\n\tif *v == nil {\n\t\tsv = &types.InvalidAssociation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAssociationVersion(v **types.InvalidAssociationVersion, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAssociationVersion\n\tif *v == nil {\n\t\tsv = &types.InvalidAssociationVersion{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAutomationExecutionParametersException(v **types.InvalidAutomationExecutionParametersException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAutomationExecutionParametersException\n\tif *v == nil {\n\t\tsv = &types.InvalidAutomationExecutionParametersException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAutomationSignalException(v **types.InvalidAutomationSignalException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAutomationSignalException\n\tif *v == nil {\n\t\tsv = &types.InvalidAutomationSignalException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidAutomationStatusUpdateException(v **types.InvalidAutomationStatusUpdateException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidAutomationStatusUpdateException\n\tif *v == nil {\n\t\tsv = &types.InvalidAutomationStatusUpdateException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidCommandId(v **types.InvalidCommandId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidCommandId\n\tif *v == nil {\n\t\tsv = &types.InvalidCommandId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDeleteInventoryParametersException(v **types.InvalidDeleteInventoryParametersException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDeleteInventoryParametersException\n\tif *v == nil {\n\t\tsv = &types.InvalidDeleteInventoryParametersException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDeletionIdException(v **types.InvalidDeletionIdException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDeletionIdException\n\tif *v == nil {\n\t\tsv = &types.InvalidDeletionIdException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocument(v **types.InvalidDocument, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocument\n\tif *v == nil {\n\t\tsv = &types.InvalidDocument{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocumentContent(v **types.InvalidDocumentContent, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocumentContent\n\tif *v == nil {\n\t\tsv = &types.InvalidDocumentContent{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocumentOperation(v **types.InvalidDocumentOperation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocumentOperation\n\tif *v == nil {\n\t\tsv = &types.InvalidDocumentOperation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocumentSchemaVersion(v **types.InvalidDocumentSchemaVersion, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocumentSchemaVersion\n\tif *v == nil {\n\t\tsv = &types.InvalidDocumentSchemaVersion{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocumentType(v **types.InvalidDocumentType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocumentType\n\tif *v == nil {\n\t\tsv = &types.InvalidDocumentType{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidDocumentVersion(v **types.InvalidDocumentVersion, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidDocumentVersion\n\tif *v == nil {\n\t\tsv = &types.InvalidDocumentVersion{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidFilter(v **types.InvalidFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidFilter\n\tif *v == nil {\n\t\tsv = &types.InvalidFilter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidFilterKey(v **types.InvalidFilterKey, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidFilterKey\n\tif *v == nil {\n\t\tsv = &types.InvalidFilterKey{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidFilterOption(v **types.InvalidFilterOption, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidFilterOption\n\tif *v == nil {\n\t\tsv = &types.InvalidFilterOption{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidFilterValue(v **types.InvalidFilterValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidFilterValue\n\tif *v == nil {\n\t\tsv = &types.InvalidFilterValue{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidInstanceId(v **types.InvalidInstanceId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidInstanceId\n\tif *v == nil {\n\t\tsv = &types.InvalidInstanceId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidInstanceInformationFilterValue(v **types.InvalidInstanceInformationFilterValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidInstanceInformationFilterValue\n\tif *v == nil {\n\t\tsv = &types.InvalidInstanceInformationFilterValue{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidInventoryGroupException(v **types.InvalidInventoryGroupException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidInventoryGroupException\n\tif *v == nil {\n\t\tsv = &types.InvalidInventoryGroupException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidInventoryItemContextException(v **types.InvalidInventoryItemContextException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidInventoryItemContextException\n\tif *v == nil {\n\t\tsv = &types.InvalidInventoryItemContextException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidInventoryRequestException(v **types.InvalidInventoryRequestException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidInventoryRequestException\n\tif *v == nil {\n\t\tsv = &types.InvalidInventoryRequestException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidItemContentException(v **types.InvalidItemContentException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidItemContentException\n\tif *v == nil {\n\t\tsv = &types.InvalidItemContentException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidKeyId(v **types.InvalidKeyId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidKeyId\n\tif *v == nil {\n\t\tsv = &types.InvalidKeyId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidNextToken(v **types.InvalidNextToken, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidNextToken\n\tif *v == nil {\n\t\tsv = &types.InvalidNextToken{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidNotificationConfig(v **types.InvalidNotificationConfig, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidNotificationConfig\n\tif *v == nil {\n\t\tsv = &types.InvalidNotificationConfig{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidOptionException(v **types.InvalidOptionException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidOptionException\n\tif *v == nil {\n\t\tsv = &types.InvalidOptionException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidOutputFolder(v **types.InvalidOutputFolder, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidOutputFolder\n\tif *v == nil {\n\t\tsv = &types.InvalidOutputFolder{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidOutputLocation(v **types.InvalidOutputLocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidOutputLocation\n\tif *v == nil {\n\t\tsv = &types.InvalidOutputLocation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidParameters(v **types.InvalidParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidParameters\n\tif *v == nil {\n\t\tsv = &types.InvalidParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidPermissionType(v **types.InvalidPermissionType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidPermissionType\n\tif *v == nil {\n\t\tsv = &types.InvalidPermissionType{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidPluginName(v **types.InvalidPluginName, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidPluginName\n\tif *v == nil {\n\t\tsv = &types.InvalidPluginName{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidPolicyAttributeException(v **types.InvalidPolicyAttributeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidPolicyAttributeException\n\tif *v == nil {\n\t\tsv = &types.InvalidPolicyAttributeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidPolicyTypeException(v **types.InvalidPolicyTypeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidPolicyTypeException\n\tif *v == nil {\n\t\tsv = &types.InvalidPolicyTypeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidResourceId(v **types.InvalidResourceId, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidResourceId\n\tif *v == nil {\n\t\tsv = &types.InvalidResourceId{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidResourceType(v **types.InvalidResourceType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidResourceType\n\tif *v == nil {\n\t\tsv = &types.InvalidResourceType{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidResultAttributeException(v **types.InvalidResultAttributeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidResultAttributeException\n\tif *v == nil {\n\t\tsv = &types.InvalidResultAttributeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidRole(v **types.InvalidRole, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidRole\n\tif *v == nil {\n\t\tsv = &types.InvalidRole{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidSchedule(v **types.InvalidSchedule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidSchedule\n\tif *v == nil {\n\t\tsv = &types.InvalidSchedule{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTag(v **types.InvalidTag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTag\n\tif *v == nil {\n\t\tsv = &types.InvalidTag{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTarget(v **types.InvalidTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTarget\n\tif *v == nil {\n\t\tsv = &types.InvalidTarget{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTargetMaps(v **types.InvalidTargetMaps, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTargetMaps\n\tif *v == nil {\n\t\tsv = &types.InvalidTargetMaps{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidTypeNameException(v **types.InvalidTypeNameException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidTypeNameException\n\tif *v == nil {\n\t\tsv = &types.InvalidTypeNameException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvalidUpdate(v **types.InvalidUpdate, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidUpdate\n\tif *v == nil {\n\t\tsv = &types.InvalidUpdate{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryDeletionsList(v *[]types.InventoryDeletionStatusItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InventoryDeletionStatusItem\n\tif *v == nil {\n\t\tcv = []types.InventoryDeletionStatusItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InventoryDeletionStatusItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionStatusItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryDeletionStatusItem(v **types.InventoryDeletionStatusItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryDeletionStatusItem\n\tif *v == nil {\n\t\tsv = &types.InventoryDeletionStatusItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DeletionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UUID to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DeletionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DeletionStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.DeletionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryDeletionStartTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DeletionSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionSummary(&sv.DeletionSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"LastStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryDeletionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastStatus = types.InventoryDeletionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"LastStatusMessage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryDeletionLastStatusMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastStatusMessage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastStatusUpdateTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastStatusUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryDeletionLastStatusUpdateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryDeletionSummary(v **types.InventoryDeletionSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryDeletionSummary\n\tif *v == nil {\n\t\tsv = &types.InventoryDeletionSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"RemainingCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RemainingCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.RemainingCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"SummaryItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionSummaryItems(&sv.SummaryItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TotalCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TotalCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TotalCount = int32(i64)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryDeletionSummaryItem(v **types.InventoryDeletionSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryDeletionSummaryItem\n\tif *v == nil {\n\t\tsv = &types.InventoryDeletionSummaryItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Count\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Count = int32(i64)\n\t\t\t}\n\n\t\tcase \"RemainingCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RemainingCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.RemainingCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryDeletionSummaryItems(v *[]types.InventoryDeletionSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InventoryDeletionSummaryItem\n\tif *v == nil {\n\t\tcv = []types.InventoryDeletionSummaryItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InventoryDeletionSummaryItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionSummaryItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemAttribute(v **types.InventoryItemAttribute, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryItemAttribute\n\tif *v == nil {\n\t\tsv = &types.InventoryItemAttribute{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DataType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryAttributeDataType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DataType = types.InventoryAttributeDataType(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemAttributeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemAttributeList(v *[]types.InventoryItemAttribute, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InventoryItemAttribute\n\tif *v == nil {\n\t\tcv = []types.InventoryItemAttribute{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InventoryItemAttribute\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemAttribute(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemEntry(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AttributeValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemEntryList(v *[]map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []map[string]string\n\tif *v == nil {\n\t\tcv = []map[string]string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col map[string]string\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemEntry(&col, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemSchema(v **types.InventoryItemSchema, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryItemSchema\n\tif *v == nil {\n\t\tsv = &types.InventoryItemSchema{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Attributes\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemAttributeList(&sv.Attributes, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"DisplayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryTypeDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryItemSchemaResultList(v *[]types.InventoryItemSchema, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InventoryItemSchema\n\tif *v == nil {\n\t\tcv = []types.InventoryItemSchema{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InventoryItemSchema\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemSchema(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryResultEntity(v **types.InventoryResultEntity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryResultEntity\n\tif *v == nil {\n\t\tsv = &types.InventoryResultEntity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Data\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryResultItemMap(&sv.Data, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Id\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryResultEntityId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Id = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryResultEntityList(v *[]types.InventoryResultEntity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.InventoryResultEntity\n\tif *v == nil {\n\t\tcv = []types.InventoryResultEntity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.InventoryResultEntity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryResultEntity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryResultItem(v **types.InventoryResultItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InventoryResultItem\n\tif *v == nil {\n\t\tsv = &types.InventoryResultItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CaptureTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemCaptureTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CaptureTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Content\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Content, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ContentHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemContentHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ContentHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SchemaVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SchemaVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInventoryResultItemMap(v *map[string]types.InventoryResultItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]types.InventoryResultItem\n\tif *v == nil {\n\t\tmv = map[string]types.InventoryResultItem{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal types.InventoryResultItem\n\t\tmapVar := parsedVal\n\t\tdestAddr := &mapVar\n\t\tif err := awsAwsjson11_deserializeDocumentInventoryResultItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = *destAddr\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentInvocationDoesNotExist(v **types.InvocationDoesNotExist, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvocationDoesNotExist\n\tif *v == nil {\n\t\tsv = &types.InvocationDoesNotExist{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentItemContentMismatchException(v **types.ItemContentMismatchException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ItemContentMismatchException\n\tif *v == nil {\n\t\tsv = &types.ItemContentMismatchException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentItemSizeLimitExceededException(v **types.ItemSizeLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ItemSizeLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.ItemSizeLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentLoggingInfo(v **types.LoggingInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.LoggingInfo\n\tif *v == nil {\n\t\tsv = &types.LoggingInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"S3BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.S3BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"S3KeyPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3KeyPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.S3KeyPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"S3Region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.S3Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowAutomationParameters(v **types.MaintenanceWindowAutomationParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowAutomationParameters\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowAutomationParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecution(v **types.MaintenanceWindowExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowExecution\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowExecution{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionList(v *[]types.MaintenanceWindowExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowExecution\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowExecution{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowExecution\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecution(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentity(v **types.MaintenanceWindowExecutionTaskIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowExecutionTaskIdentity\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowExecutionTaskIdentity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskType = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentityList(v *[]types.MaintenanceWindowExecutionTaskIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowExecutionTaskIdentity\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowExecutionTaskIdentity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowExecutionTaskIdentity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIdentity(v **types.MaintenanceWindowExecutionTaskInvocationIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowExecutionTaskInvocationIdentity\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowExecutionTaskInvocationIdentity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InvocationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskInvocationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InvocationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OwnerInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OwnerInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OwnerInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskInvocationParameters to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Parameters = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskType = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIdentityList(v *[]types.MaintenanceWindowExecutionTaskInvocationIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowExecutionTaskInvocationIdentity\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowExecutionTaskInvocationIdentity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowExecutionTaskInvocationIdentity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIdentity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowIdentity(v **types.MaintenanceWindowIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowIdentity\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowIdentity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Cutoff\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowCutoff to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Cutoff = int32(i64)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Duration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDurationHours to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Duration = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Enabled\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowEnabled to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Enabled = jtv\n\t\t\t}\n\n\t\tcase \"EndDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EndDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NextExecutionTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextExecutionTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Schedule\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowSchedule to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Schedule = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"ScheduleTimezone\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTimezone to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleTimezone = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StartDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowIdentityForTarget(v **types.MaintenanceWindowIdentityForTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowIdentityForTarget\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowIdentityForTarget{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowIdentityList(v *[]types.MaintenanceWindowIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowIdentity\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowIdentity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowIdentity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowIdentity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowLambdaParameters(v **types.MaintenanceWindowLambdaParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowLambdaParameters\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowLambdaParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ClientContext\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowLambdaClientContext to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ClientContext = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Payload\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowLambdaPayload to be []byte, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tdv, err := base64.StdEncoding.DecodeString(jtv)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to base64 decode MaintenanceWindowLambdaPayload, %w\", err)\n\t\t\t\t}\n\t\t\t\tsv.Payload = dv\n\t\t\t}\n\n\t\tcase \"Qualifier\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowLambdaQualifier to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Qualifier = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowRunCommandParameters(v **types.MaintenanceWindowRunCommandParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowRunCommandParameters\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowRunCommandParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CloudWatchOutputConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(&sv.CloudWatchOutputConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Comment\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Comment to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Comment = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentHashType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentHashType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentHashType = types.DocumentHashType(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NotificationConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNotificationConfig(&sv.NotificationConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OutputS3BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3KeyPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3KeyPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3KeyPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameters(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ServiceRoleArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRoleArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TimeoutSeconds\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TimeoutSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TimeoutSeconds = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowsForTargetList(v *[]types.MaintenanceWindowIdentityForTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowIdentityForTarget\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowIdentityForTarget{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowIdentityForTarget\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowIdentityForTarget(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowStepFunctionsParameters(v **types.MaintenanceWindowStepFunctionsParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowStepFunctionsParameters\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowStepFunctionsParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Input\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStepFunctionsInput to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Input = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStepFunctionsName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTarget(v **types.MaintenanceWindowTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowTarget\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowTarget{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OwnerInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OwnerInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OwnerInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = types.MaintenanceWindowResourceType(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTargetList(v *[]types.MaintenanceWindowTarget, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowTarget\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowTarget{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowTarget\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTarget(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTask(v **types.MaintenanceWindowTask, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowTask\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowTask{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CutoffBehavior\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LoggingInfo\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = int32(i64)\n\t\t\t}\n\n\t\tcase \"ServiceRoleArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRoleArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameters(&sv.TaskParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTaskId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTaskId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskInvocationParameters(v **types.MaintenanceWindowTaskInvocationParameters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowTaskInvocationParameters\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowTaskInvocationParameters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Automation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowAutomationParameters(&sv.Automation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Lambda\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowLambdaParameters(&sv.Lambda, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RunCommand\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowRunCommandParameters(&sv.RunCommand, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"StepFunctions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowStepFunctionsParameters(&sv.StepFunctions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskList(v *[]types.MaintenanceWindowTask, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.MaintenanceWindowTask\n\tif *v == nil {\n\t\tcv = []types.MaintenanceWindowTask{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.MaintenanceWindowTask\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTask(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameters(v *map[string]types.MaintenanceWindowTaskParameterValueExpression, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]types.MaintenanceWindowTaskParameterValueExpression\n\tif *v == nil {\n\t\tmv = map[string]types.MaintenanceWindowTaskParameterValueExpression{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal types.MaintenanceWindowTaskParameterValueExpression\n\t\tmapVar := parsedVal\n\t\tdestAddr := &mapVar\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameterValueExpression(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = *destAddr\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParametersList(v *[]map[string]types.MaintenanceWindowTaskParameterValueExpression, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []map[string]types.MaintenanceWindowTaskParameterValueExpression\n\tif *v == nil {\n\t\tcv = []map[string]types.MaintenanceWindowTaskParameterValueExpression{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col map[string]types.MaintenanceWindowTaskParameterValueExpression\n\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameters(&col, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameterValueExpression(v **types.MaintenanceWindowTaskParameterValueExpression, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaintenanceWindowTaskParameterValueExpression\n\tif *v == nil {\n\t\tsv = &types.MaintenanceWindowTaskParameterValueExpression{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Values\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameterValueList(&sv.Values, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameterValueList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskParameterValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMaxDocumentSizeExceeded(v **types.MaxDocumentSizeExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MaxDocumentSizeExceeded\n\tif *v == nil {\n\t\tsv = &types.MaxDocumentSizeExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMetadataMap(v *map[string]types.MetadataValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]types.MetadataValue\n\tif *v == nil {\n\t\tmv = map[string]types.MetadataValue{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal types.MetadataValue\n\t\tmapVar := parsedVal\n\t\tdestAddr := &mapVar\n\t\tif err := awsAwsjson11_deserializeDocumentMetadataValue(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = *destAddr\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentMetadataValue(v **types.MetadataValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.MetadataValue\n\tif *v == nil {\n\t\tsv = &types.MetadataValue{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MetadataValueString to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentNonCompliantSummary(v **types.NonCompliantSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.NonCompliantSummary\n\tif *v == nil {\n\t\tsv = &types.NonCompliantSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NonCompliantCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.NonCompliantCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"SeveritySummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentSeveritySummary(&sv.SeveritySummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentNormalStringMap(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentNotificationConfig(v **types.NotificationConfig, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.NotificationConfig\n\tif *v == nil {\n\t\tsv = &types.NotificationConfig{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NotificationArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NotificationArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NotificationArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NotificationEvents\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNotificationEventList(&sv.NotificationEvents, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NotificationType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NotificationType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NotificationType = types.NotificationType(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentNotificationEventList(v *[]types.NotificationEvent, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.NotificationEvent\n\tif *v == nil {\n\t\tcv = []types.NotificationEvent{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.NotificationEvent\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected NotificationEvent to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = types.NotificationEvent(jtv)\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntity(v **types.OpsEntity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsEntity\n\tif *v == nil {\n\t\tsv = &types.OpsEntity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Data\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsEntityItemMap(&sv.Data, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Id\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsEntityId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Id = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntityItem(v **types.OpsEntityItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsEntityItem\n\tif *v == nil {\n\t\tsv = &types.OpsEntityItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CaptureTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsEntityItemCaptureTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CaptureTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Content\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsEntityItemEntryList(&sv.Content, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntityItemEntry(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AttributeValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntityItemEntryList(v *[]map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []map[string]string\n\tif *v == nil {\n\t\tcv = []map[string]string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col map[string]string\n\t\tif err := awsAwsjson11_deserializeDocumentOpsEntityItemEntry(&col, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntityItemMap(v *map[string]types.OpsEntityItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]types.OpsEntityItem\n\tif *v == nil {\n\t\tmv = map[string]types.OpsEntityItem{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal types.OpsEntityItem\n\t\tmapVar := parsedVal\n\t\tdestAddr := &mapVar\n\t\tif err := awsAwsjson11_deserializeDocumentOpsEntityItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = *destAddr\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsEntityList(v *[]types.OpsEntity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsEntity\n\tif *v == nil {\n\t\tcv = []types.OpsEntity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsEntity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsEntity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItem\n\tif *v == nil {\n\t\tsv = &types.OpsItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActualEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ActualStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Category\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemCategory to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Category = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CreatedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Notifications\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemNotifications(&sv.Notifications, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OperationalData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemOperationalData(&sv.OperationalData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OpsItemArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PlannedEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"PlannedStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"RelatedOpsItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRelatedOpsItems(&sv.RelatedOpsItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Source\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemSource to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Source = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.OpsItemStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemTitle to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemAccessDeniedException(v **types.OpsItemAccessDeniedException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemAccessDeniedException\n\tif *v == nil {\n\t\tsv = &types.OpsItemAccessDeniedException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemAlreadyExistsException(v **types.OpsItemAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.OpsItemAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemConflictException(v **types.OpsItemConflictException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemConflictException\n\tif *v == nil {\n\t\tsv = &types.OpsItemConflictException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemDataValue(v **types.OpsItemDataValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemDataValue\n\tif *v == nil {\n\t\tsv = &types.OpsItemDataValue{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemDataType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.OpsItemDataType(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemDataValueString to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemEventSummaries(v *[]types.OpsItemEventSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsItemEventSummary\n\tif *v == nil {\n\t\tcv = []types.OpsItemEventSummary{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsItemEventSummary\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsItemEventSummary(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemEventSummary(v **types.OpsItemEventSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemEventSummary\n\tif *v == nil {\n\t\tsv = &types.OpsItemEventSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CreatedBy\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.CreatedBy, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Detail\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Detail = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DetailType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DetailType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"EventId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EventId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Source\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Source = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemIdentity(v **types.OpsItemIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemIdentity\n\tif *v == nil {\n\t\tsv = &types.OpsItemIdentity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Arn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Arn = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemInvalidParameterException(v **types.OpsItemInvalidParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemInvalidParameterException\n\tif *v == nil {\n\t\tsv = &types.OpsItemInvalidParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ParameterNames\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemParameterNamesList(&sv.ParameterNames, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemLimitExceededException(v **types.OpsItemLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.OpsItemLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Limit\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Limit = int32(i64)\n\t\t\t}\n\n\t\tcase \"LimitType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LimitType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceTypes\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemParameterNamesList(&sv.ResourceTypes, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemNotFoundException(v **types.OpsItemNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemNotFoundException\n\tif *v == nil {\n\t\tsv = &types.OpsItemNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemNotification(v **types.OpsItemNotification, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemNotification\n\tif *v == nil {\n\t\tsv = &types.OpsItemNotification{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Arn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Arn = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemNotifications(v *[]types.OpsItemNotification, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsItemNotification\n\tif *v == nil {\n\t\tcv = []types.OpsItemNotification{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsItemNotification\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsItemNotification(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemOperationalData(v *map[string]types.OpsItemDataValue, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]types.OpsItemDataValue\n\tif *v == nil {\n\t\tmv = map[string]types.OpsItemDataValue{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal types.OpsItemDataValue\n\t\tmapVar := parsedVal\n\t\tdestAddr := &mapVar\n\t\tif err := awsAwsjson11_deserializeDocumentOpsItemDataValue(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = *destAddr\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemParameterNamesList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemRelatedItemAlreadyExistsException(v **types.OpsItemRelatedItemAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemRelatedItemAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.OpsItemRelatedItemAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationResourceUri to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemRelatedItemAssociationNotFoundException(v **types.OpsItemRelatedItemAssociationNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemRelatedItemAssociationNotFoundException\n\tif *v == nil {\n\t\tsv = &types.OpsItemRelatedItemAssociationNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummaries(v *[]types.OpsItemRelatedItemSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsItemRelatedItemSummary\n\tif *v == nil {\n\t\tcv = []types.OpsItemRelatedItemSummary{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsItemRelatedItemSummary\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummary(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummary(v **types.OpsItemRelatedItemSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemRelatedItemSummary\n\tif *v == nil {\n\t\tsv = &types.OpsItemRelatedItemSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"AssociationType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedBy\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.CreatedBy, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedBy\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.LastModifiedBy, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"LastModifiedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationResourceUri to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemSummaries(v *[]types.OpsItemSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsItemSummary\n\tif *v == nil {\n\t\tcv = []types.OpsItemSummary{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsItemSummary\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsItemSummary(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsItemSummary\n\tif *v == nil {\n\t\tsv = &types.OpsItemSummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActualEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ActualStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Category\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemCategory to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Category = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CreatedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedBy\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedBy = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"OperationalData\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemOperationalData(&sv.OperationalData, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PlannedEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"PlannedStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Source\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemSource to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Source = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.OpsItemStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemTitle to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadata(v **types.OpsMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadata\n\tif *v == nil {\n\t\tsv = &types.OpsMetadata{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CreationDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedUser\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedUser = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsMetadataArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsMetadataArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsMetadataArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsMetadataResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataAlreadyExistsException(v **types.OpsMetadataAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataInvalidArgumentException(v **types.OpsMetadataInvalidArgumentException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataInvalidArgumentException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataInvalidArgumentException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataKeyLimitExceededException(v **types.OpsMetadataKeyLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataKeyLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataKeyLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataLimitExceededException(v **types.OpsMetadataLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataList(v *[]types.OpsMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.OpsMetadata\n\tif *v == nil {\n\t\tcv = []types.OpsMetadata{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.OpsMetadata\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentOpsMetadata(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataNotFoundException(v **types.OpsMetadataNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataNotFoundException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOpsMetadataTooManyUpdatesException(v **types.OpsMetadataTooManyUpdatesException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OpsMetadataTooManyUpdatesException\n\tif *v == nil {\n\t\tsv = &types.OpsMetadataTooManyUpdatesException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentOutputSource(v **types.OutputSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.OutputSource\n\tif *v == nil {\n\t\tsv = &types.OutputSource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OutputSourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OutputSourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputSourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputSourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OutputSourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputSourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameter(v **types.Parameter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Parameter\n\tif *v == nil {\n\t\tsv = &types.Parameter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ARN\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ARN = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DataType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterDataType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DataType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Selector\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterSelector to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Selector = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SourceResult\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceResult = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.ParameterType(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterVersion to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Version = i64\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterAlreadyExists(v **types.ParameterAlreadyExists, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterAlreadyExists\n\tif *v == nil {\n\t\tsv = &types.ParameterAlreadyExists{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterHistory(v **types.ParameterHistory, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterHistory\n\tif *v == nil {\n\t\tsv = &types.ParameterHistory{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AllowedPattern\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AllowedPattern to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AllowedPattern = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DataType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterDataType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DataType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"KeyId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterKeyId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KeyId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Labels\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.Labels, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"LastModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedUser\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedUser = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Policies\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterPolicyList(&sv.Policies, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Tier\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterTier to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Tier = types.ParameterTier(jtv)\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.ParameterType(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterVersion to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Version = i64\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterHistoryList(v *[]types.ParameterHistory, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ParameterHistory\n\tif *v == nil {\n\t\tcv = []types.ParameterHistory{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ParameterHistory\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentParameterHistory(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterInlinePolicy(v **types.ParameterInlinePolicy, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterInlinePolicy\n\tif *v == nil {\n\t\tsv = &types.ParameterInlinePolicy{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"PolicyStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyStatus = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PolicyText\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyText = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PolicyType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterLabelList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ParameterLabel to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterLimitExceeded(v **types.ParameterLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.ParameterLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterList(v *[]types.Parameter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Parameter\n\tif *v == nil {\n\t\tcv = []types.Parameter{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Parameter\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentParameter(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterMaxVersionLimitExceeded(v **types.ParameterMaxVersionLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterMaxVersionLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.ParameterMaxVersionLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterMetadata(v **types.ParameterMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterMetadata\n\tif *v == nil {\n\t\tsv = &types.ParameterMetadata{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AllowedPattern\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AllowedPattern to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AllowedPattern = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DataType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterDataType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DataType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"KeyId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterKeyId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KeyId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedUser\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedUser = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Policies\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterPolicyList(&sv.Policies, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Tier\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterTier to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Tier = types.ParameterTier(jtv)\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.ParameterType(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterVersion to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Version = i64\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterMetadataList(v *[]types.ParameterMetadata, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ParameterMetadata\n\tif *v == nil {\n\t\tcv = []types.ParameterMetadata{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ParameterMetadata\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentParameterMetadata(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterNameList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PSParameterName to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterNotFound(v **types.ParameterNotFound, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterNotFound\n\tif *v == nil {\n\t\tsv = &types.ParameterNotFound{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterPatternMismatchException(v **types.ParameterPatternMismatchException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterPatternMismatchException\n\tif *v == nil {\n\t\tsv = &types.ParameterPatternMismatchException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterPolicyList(v *[]types.ParameterInlinePolicy, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ParameterInlinePolicy\n\tif *v == nil {\n\t\tcv = []types.ParameterInlinePolicy{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ParameterInlinePolicy\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentParameterInlinePolicy(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameters(v *map[string][]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string][]string\n\tif *v == nil {\n\t\tmv = map[string][]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal []string\n\t\tmapVar := parsedVal\n\t\tif err := awsAwsjson11_deserializeDocumentParameterValueList(&mapVar, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = mapVar\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterValueList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ParameterValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterVersionLabelLimitExceeded(v **types.ParameterVersionLabelLimitExceeded, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterVersionLabelLimitExceeded\n\tif *v == nil {\n\t\tsv = &types.ParameterVersionLabelLimitExceeded{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParameterVersionNotFound(v **types.ParameterVersionNotFound, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParameterVersionNotFound\n\tif *v == nil {\n\t\tsv = &types.ParameterVersionNotFound{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentParentStepDetails(v **types.ParentStepDetails, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ParentStepDetails\n\tif *v == nil {\n\t\tsv = &types.ParentStepDetails{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Action\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationActionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Action = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Iteration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Iteration = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"IteratorValue\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IteratorValue = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatch(v **types.Patch, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Patch\n\tif *v == nil {\n\t\tsv = &types.Patch{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AdvisoryIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchAdvisoryIdList(&sv.AdvisoryIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Arch\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchArch to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Arch = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"BugzillaIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchBugzillaIdList(&sv.BugzillaIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Classification\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchClassification to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Classification = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ContentUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchContentUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ContentUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CVEIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchCVEIdList(&sv.CVEIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Epoch\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchEpoch to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Epoch = int32(i64)\n\t\t\t}\n\n\t\tcase \"Id\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Id = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"KbNumber\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchKbNumber to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KbNumber = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Language\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchLanguage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Language = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MsrcNumber\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchMsrcNumber to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MsrcNumber = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MsrcSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchMsrcSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MsrcSeverity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Product\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchProduct to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Product = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ProductFamily\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchProductFamily to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ProductFamily = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Release\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchRelease to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Release = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ReleaseDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ReleaseDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Repository\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchRepository to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Repository = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchTitle to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Vendor\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchVendor to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Vendor = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Version = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchAdvisoryIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchAdvisoryId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchBaselineIdentity(v **types.PatchBaselineIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchBaselineIdentity\n\tif *v == nil {\n\t\tsv = &types.PatchBaselineIdentity{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineDescription\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineDescription = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"BaselineName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DefaultBaseline\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DefaultBaseline to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DefaultBaseline = jtv\n\t\t\t}\n\n\t\tcase \"OperatingSystem\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OperatingSystem = types.OperatingSystem(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchBaselineIdentityList(v *[]types.PatchBaselineIdentity, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchBaselineIdentity\n\tif *v == nil {\n\t\tcv = []types.PatchBaselineIdentity{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchBaselineIdentity\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchBaselineIdentity(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchBugzillaIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchBugzillaId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchComplianceData(v **types.PatchComplianceData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchComplianceData\n\tif *v == nil {\n\t\tsv = &types.PatchComplianceData{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Classification\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchClassification to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Classification = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CVEIds\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchCVEIds to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CVEIds = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstalledTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.InstalledTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"KBId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchKbNumber to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.KBId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Severity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Severity = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"State\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchComplianceDataState to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.State = types.PatchComplianceDataState(jtv)\n\t\t\t}\n\n\t\tcase \"Title\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchTitle to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Title = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchComplianceDataList(v *[]types.PatchComplianceData, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchComplianceData\n\tif *v == nil {\n\t\tcv = []types.PatchComplianceData{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchComplianceData\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchComplianceData(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchCVEIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchCVEId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchFilter(v **types.PatchFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchFilter\n\tif *v == nil {\n\t\tsv = &types.PatchFilter{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchFilterKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = types.PatchFilterKey(jtv)\n\t\t\t}\n\n\t\tcase \"Values\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchFilterValueList(&sv.Values, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchFilterGroup(v **types.PatchFilterGroup, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchFilterGroup\n\tif *v == nil {\n\t\tsv = &types.PatchFilterGroup{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"PatchFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchFilterList(&sv.PatchFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchFilterList(v *[]types.PatchFilter, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchFilter\n\tif *v == nil {\n\t\tcv = []types.PatchFilter{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchFilter\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchFilter(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchFilterValueList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchFilterValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchGroupList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchGroupPatchBaselineMapping(v **types.PatchGroupPatchBaselineMapping, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchGroupPatchBaselineMapping\n\tif *v == nil {\n\t\tsv = &types.PatchGroupPatchBaselineMapping{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineIdentity\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchBaselineIdentity(&sv.BaselineIdentity, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"PatchGroup\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PatchGroup = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchGroupPatchBaselineMappingList(v *[]types.PatchGroupPatchBaselineMapping, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchGroupPatchBaselineMapping\n\tif *v == nil {\n\t\tcv = []types.PatchGroupPatchBaselineMapping{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchGroupPatchBaselineMapping\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchGroupPatchBaselineMapping(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchIdList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchId to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchList(v *[]types.Patch, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Patch\n\tif *v == nil {\n\t\tcv = []types.Patch{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Patch\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatch(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchPropertiesList(v *[]map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []map[string]string\n\tif *v == nil {\n\t\tcv = []map[string]string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col map[string]string\n\t\tif err := awsAwsjson11_deserializeDocumentPatchPropertyEntry(&col, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchPropertyEntry(v *map[string]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string]string\n\tif *v == nil {\n\t\tmv = map[string]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected AttributeValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tparsedVal = jtv\n\t\t}\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchRule(v **types.PatchRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchRule\n\tif *v == nil {\n\t\tsv = &types.PatchRule{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApproveAfterDays\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ApproveAfterDays to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ApproveAfterDays = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"ApproveUntilDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApproveUntilDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ComplianceLevel\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchComplianceLevel to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceLevel = types.PatchComplianceLevel(jtv)\n\t\t\t}\n\n\t\tcase \"EnableNonSecurity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EnableNonSecurity = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"PatchFilterGroup\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchFilterGroup(&sv.PatchFilterGroup, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchRuleGroup(v **types.PatchRuleGroup, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchRuleGroup\n\tif *v == nil {\n\t\tsv = &types.PatchRuleGroup{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"PatchRules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchRuleList(&sv.PatchRules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchRuleList(v *[]types.PatchRule, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchRule\n\tif *v == nil {\n\t\tcv = []types.PatchRule{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchRule\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchRule(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchSource(v **types.PatchSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchSource\n\tif *v == nil {\n\t\tsv = &types.PatchSource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Configuration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchSourceConfiguration to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Configuration = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchSourceName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Products\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchSourceProductList(&sv.Products, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchSourceList(v *[]types.PatchSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PatchSource\n\tif *v == nil {\n\t\tcv = []types.PatchSource{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PatchSource\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentPatchSource(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchSourceProductList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PatchSourceProduct to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPatchStatus(v **types.PatchStatus, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PatchStatus\n\tif *v == nil {\n\t\tsv = &types.PatchStatus{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApprovalDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ApprovalDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ComplianceLevel\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchComplianceLevel to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceLevel = types.PatchComplianceLevel(jtv)\n\t\t\t}\n\n\t\tcase \"DeploymentStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchDeploymentStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DeploymentStatus = types.PatchDeploymentStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPlatformTypeList(v *[]types.PlatformType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.PlatformType\n\tif *v == nil {\n\t\tcv = []types.PlatformType{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.PlatformType\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected PlatformType to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = types.PlatformType(jtv)\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentPoliciesLimitExceededException(v **types.PoliciesLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.PoliciesLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.PoliciesLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentProgressCounters(v **types.ProgressCounters, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ProgressCounters\n\tif *v == nil {\n\t\tsv = &types.ProgressCounters{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CancelledSteps\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.CancelledSteps = int32(i64)\n\t\t\t}\n\n\t\tcase \"FailedSteps\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.FailedSteps = int32(i64)\n\t\t\t}\n\n\t\tcase \"SuccessSteps\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.SuccessSteps = int32(i64)\n\t\t\t}\n\n\t\tcase \"TimedOutSteps\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TimedOutSteps = int32(i64)\n\t\t\t}\n\n\t\tcase \"TotalSteps\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TotalSteps = int32(i64)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRegions(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Region to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRelatedOpsItem(v **types.RelatedOpsItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RelatedOpsItem\n\tif *v == nil {\n\t\tsv = &types.RelatedOpsItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRelatedOpsItems(v *[]types.RelatedOpsItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RelatedOpsItem\n\tif *v == nil {\n\t\tcv = []types.RelatedOpsItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RelatedOpsItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRelatedOpsItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResolvedTargets(v **types.ResolvedTargets, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResolvedTargets\n\tif *v == nil {\n\t\tsv = &types.ResolvedTargets{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ParameterValues\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetParameterList(&sv.ParameterValues, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Truncated\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Truncated = jtv\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceComplianceSummaryItem(v **types.ResourceComplianceSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceComplianceSummaryItem\n\tif *v == nil {\n\t\tsv = &types.ResourceComplianceSummaryItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ComplianceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ComplianceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CompliantSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCompliantSummary(&sv.CompliantSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ExecutionSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentComplianceExecutionSummary(&sv.ExecutionSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NonCompliantSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNonCompliantSummary(&sv.NonCompliantSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OverallSeverity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSeverity to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OverallSeverity = types.ComplianceSeverity(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceResourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ComplianceStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceComplianceSummaryItemList(v *[]types.ResourceComplianceSummaryItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ResourceComplianceSummaryItem\n\tif *v == nil {\n\t\tcv = []types.ResourceComplianceSummaryItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ResourceComplianceSummaryItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentResourceComplianceSummaryItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncAlreadyExistsException(v **types.ResourceDataSyncAlreadyExistsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncAlreadyExistsException\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncAlreadyExistsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"SyncName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncAwsOrganizationsSource(v **types.ResourceDataSyncAwsOrganizationsSource, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncAwsOrganizationsSource\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncAwsOrganizationsSource{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OrganizationalUnits\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncOrganizationalUnitList(&sv.OrganizationalUnits, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OrganizationSourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncOrganizationSourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OrganizationSourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncConflictException(v **types.ResourceDataSyncConflictException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncConflictException\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncConflictException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncCountExceededException(v **types.ResourceDataSyncCountExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncCountExceededException\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncCountExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncDestinationDataSharing(v **types.ResourceDataSyncDestinationDataSharing, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncDestinationDataSharing\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncDestinationDataSharing{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DestinationDataSharingType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncDestinationDataSharingType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DestinationDataSharingType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncInvalidConfigurationException(v **types.ResourceDataSyncInvalidConfigurationException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncInvalidConfigurationException\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncInvalidConfigurationException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncItem(v **types.ResourceDataSyncItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncItem\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncItem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"LastStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LastResourceDataSyncStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastStatus = types.LastResourceDataSyncStatus(jtv)\n\t\t\t}\n\n\t\tcase \"LastSuccessfulSyncTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastSuccessfulSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected LastSuccessfulResourceDataSyncTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastSyncStatusMessage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LastResourceDataSyncMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastSyncStatusMessage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastSyncTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected LastResourceDataSyncTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"S3Destination\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncS3Destination(&sv.S3Destination, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"SyncCreatedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.SyncCreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncCreatedTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"SyncLastModifiedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.SyncLastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncLastModifiedTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"SyncName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SyncSource\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncSourceWithState(&sv.SyncSource, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"SyncType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncItemList(v *[]types.ResourceDataSyncItem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ResourceDataSyncItem\n\tif *v == nil {\n\t\tcv = []types.ResourceDataSyncItem{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ResourceDataSyncItem\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncItem(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncNotFoundException(v **types.ResourceDataSyncNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SyncName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SyncType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncOrganizationalUnit(v **types.ResourceDataSyncOrganizationalUnit, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncOrganizationalUnit\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncOrganizationalUnit{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OrganizationalUnitId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncOrganizationalUnitId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OrganizationalUnitId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncOrganizationalUnitList(v *[]types.ResourceDataSyncOrganizationalUnit, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ResourceDataSyncOrganizationalUnit\n\tif *v == nil {\n\t\tcv = []types.ResourceDataSyncOrganizationalUnit{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ResourceDataSyncOrganizationalUnit\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncOrganizationalUnit(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncS3Destination(v **types.ResourceDataSyncS3Destination, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncS3Destination\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncS3Destination{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AWSKMSKeyARN\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncAWSKMSKeyARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AWSKMSKeyARN = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncS3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DestinationDataSharing\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncDestinationDataSharing(&sv.DestinationDataSharing, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Prefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncS3Prefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Prefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncS3Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SyncFormat\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncS3Format to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SyncFormat = types.ResourceDataSyncS3Format(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncSourceRegionList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncSourceRegion to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceDataSyncSourceWithState(v **types.ResourceDataSyncSourceWithState, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceDataSyncSourceWithState\n\tif *v == nil {\n\t\tsv = &types.ResourceDataSyncSourceWithState{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AwsOrganizationsSource\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncAwsOrganizationsSource(&sv.AwsOrganizationsSource, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"EnableAllOpsDataSources\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncEnableAllOpsDataSources to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EnableAllOpsDataSources = jtv\n\t\t\t}\n\n\t\tcase \"IncludeFutureRegions\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncIncludeFutureRegions to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IncludeFutureRegions = jtv\n\t\t\t}\n\n\t\tcase \"SourceRegions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncSourceRegionList(&sv.SourceRegions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"SourceType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncSourceType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SourceType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"State\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResourceDataSyncState to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.State = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceInUseException\n\tif *v == nil {\n\t\tsv = &types.ResourceInUseException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.ResourceLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourcePolicyConflictException(v **types.ResourcePolicyConflictException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourcePolicyConflictException\n\tif *v == nil {\n\t\tsv = &types.ResourcePolicyConflictException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourcePolicyInvalidParameterException(v **types.ResourcePolicyInvalidParameterException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourcePolicyInvalidParameterException\n\tif *v == nil {\n\t\tsv = &types.ResourcePolicyInvalidParameterException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ParameterNames\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourcePolicyParameterNamesList(&sv.ParameterNames, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourcePolicyLimitExceededException(v **types.ResourcePolicyLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourcePolicyLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.ResourcePolicyLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Limit\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Limit = int32(i64)\n\t\t\t}\n\n\t\tcase \"LimitType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LimitType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentResourcePolicyParameterNamesList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReviewInformation(v **types.ReviewInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ReviewInformation\n\tif *v == nil {\n\t\tsv = &types.ReviewInformation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ReviewedTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ReviewedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Reviewer\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Reviewer to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Reviewer = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentReviewInformationList(v *[]types.ReviewInformation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ReviewInformation\n\tif *v == nil {\n\t\tcv = []types.ReviewInformation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ReviewInformation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentReviewInformation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRunbook(v **types.Runbook, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Runbook\n\tif *v == nil {\n\t\tsv = &types.Runbook{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetLocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetMaps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetParameterName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationParameterKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetParameterName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentRunbooks(v *[]types.Runbook, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Runbook\n\tif *v == nil {\n\t\tcv = []types.Runbook{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Runbook\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentRunbook(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentS3OutputLocation(v **types.S3OutputLocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.S3OutputLocation\n\tif *v == nil {\n\t\tsv = &types.S3OutputLocation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OutputS3BucketName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3BucketName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3BucketName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3KeyPrefix\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3KeyPrefix to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3KeyPrefix = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputS3Region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected S3Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputS3Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentS3OutputUrl(v **types.S3OutputUrl, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.S3OutputUrl\n\tif *v == nil {\n\t\tsv = &types.S3OutputUrl{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScheduledWindowExecution(v **types.ScheduledWindowExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ScheduledWindowExecution\n\tif *v == nil {\n\t\tsv = &types.ScheduledWindowExecution{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ExecutionTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentScheduledWindowExecutionList(v *[]types.ScheduledWindowExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.ScheduledWindowExecution\n\tif *v == nil {\n\t\tcv = []types.ScheduledWindowExecution{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.ScheduledWindowExecution\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentScheduledWindowExecution(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentServiceSetting(v **types.ServiceSetting, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ServiceSetting\n\tif *v == nil {\n\t\tsv = &types.ServiceSetting{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ARN\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ARN = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LastModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"LastModifiedUser\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.LastModifiedUser = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SettingId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceSettingId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SettingId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SettingValue\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceSettingValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SettingValue = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentServiceSettingNotFound(v **types.ServiceSettingNotFound, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ServiceSettingNotFound\n\tif *v == nil {\n\t\tsv = &types.ServiceSettingNotFound{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentSession(v **types.Session, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Session\n\tif *v == nil {\n\t\tsv = &types.Session{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Details\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Details = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"EndDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"MaxSessionDuration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxSessionDuration to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxSessionDuration = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OutputUrl\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentSessionManagerOutputUrl(&sv.OutputUrl, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Owner\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionOwner to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Owner = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Reason\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionReason to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Reason = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SessionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SessionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.SessionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Target\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionTarget to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Target = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentSessionList(v *[]types.Session, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Session\n\tif *v == nil {\n\t\tcv = []types.Session{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Session\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentSession(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentSessionManagerOutputUrl(v **types.SessionManagerOutputUrl, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.SessionManagerOutputUrl\n\tif *v == nil {\n\t\tsv = &types.SessionManagerOutputUrl{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CloudWatchOutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionManagerCloudWatchOutputUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CloudWatchOutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"S3OutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionManagerS3OutputUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.S3OutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentSeveritySummary(v **types.SeveritySummary, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.SeveritySummary\n\tif *v == nil {\n\t\tsv = &types.SeveritySummary{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CriticalCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.CriticalCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"HighCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.HighCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"InformationalCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InformationalCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"LowCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.LowCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"MediumCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.MediumCount = int32(i64)\n\t\t\t}\n\n\t\tcase \"UnspecifiedCount\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ComplianceSummaryCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.UnspecifiedCount = int32(i64)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentStatusUnchanged(v **types.StatusUnchanged, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.StatusUnchanged\n\tif *v == nil {\n\t\tsv = &types.StatusUnchanged{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.StepExecution\n\tif *v == nil {\n\t\tsv = &types.StepExecution{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Action\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationActionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Action = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionEndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionStartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"FailureDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"FailureMessage\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.FailureMessage = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Inputs\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentNormalStringMap(&sv.Inputs, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"IsCritical\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IsCritical = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"IsEnd\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IsEnd = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"MaxAttempts\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.MaxAttempts = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"NextStep\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextStep = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OnFailure\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OnFailure = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Outputs\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Outputs, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"OverriddenParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.OverriddenParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ParentStepDetails\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParentStepDetails(&sv.ParentStepDetails, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Response\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Response = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResponseCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResponseCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StepStatus = types.AutomationExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocation\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetLocation(&sv.TargetLocation, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TimeoutSeconds\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Long to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.TimeoutSeconds = ptr.Int64(i64)\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ValidNextSteps\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentValidNextStepList(&sv.ValidNextSteps, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentStepExecutionList(v *[]types.StepExecution, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.StepExecution\n\tif *v == nil {\n\t\tcv = []types.StepExecution{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.StepExecution\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentStepExecution(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentSubTypeCountLimitExceededException(v **types.SubTypeCountLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.SubTypeCountLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.SubTypeCountLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Tag\n\tif *v == nil {\n\t\tsv = &types.Tag{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Value\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TagValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Value = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Tag\n\tif *v == nil {\n\t\tcv = []types.Tag{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Tag\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTarget(v **types.Target, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.Target\n\tif *v == nil {\n\t\tsv = &types.Target{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Key\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TargetKey to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Key = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Values\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargetValues(&sv.Values, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetInUseException(v **types.TargetInUseException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TargetInUseException\n\tif *v == nil {\n\t\tsv = &types.TargetInUseException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetLocation(v **types.TargetLocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TargetLocation\n\tif *v == nil {\n\t\tsv = &types.TargetLocation{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Accounts\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ExecutionRoleName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExecutionRoleName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionRoleName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Regions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentRegions(&sv.Regions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetLocationAlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.TargetLocationAlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TargetLocationMaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetLocationMaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TargetLocationMaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TargetLocationMaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetLocations(v *[]types.TargetLocation, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.TargetLocation\n\tif *v == nil {\n\t\tcv = []types.TargetLocation{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.TargetLocation\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentTargetLocation(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetMap(v *map[string][]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar mv map[string][]string\n\tif *v == nil {\n\t\tmv = map[string][]string{}\n\t} else {\n\t\tmv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tvar parsedVal []string\n\t\tmapVar := parsedVal\n\t\tif err := awsAwsjson11_deserializeDocumentTargetMapValueList(&mapVar, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparsedVal = mapVar\n\t\tmv[key] = parsedVal\n\n\t}\n\t*v = mv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetMaps(v *[]map[string][]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []map[string][]string\n\tif *v == nil {\n\t\tcv = []map[string][]string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col map[string][]string\n\t\tif err := awsAwsjson11_deserializeDocumentTargetMap(&col, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetMapValueList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected TargetMapValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetNotConnected(v **types.TargetNotConnected, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TargetNotConnected\n\tif *v == nil {\n\t\tsv = &types.TargetNotConnected{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetParameterList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ParameterValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargets(v *[]types.Target, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.Target\n\tif *v == nil {\n\t\tcv = []types.Target{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.Target\n\t\tdestAddr := &col\n\t\tif err := awsAwsjson11_deserializeDocumentTarget(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTargetValues(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected TargetValue to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTooManyTagsError(v **types.TooManyTagsError, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TooManyTagsError\n\tif *v == nil {\n\t\tsv = &types.TooManyTagsError{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTooManyUpdates(v **types.TooManyUpdates, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TooManyUpdates\n\tif *v == nil {\n\t\tsv = &types.TooManyUpdates{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentTotalSizeLimitExceededException(v **types.TotalSizeLimitExceededException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TotalSizeLimitExceededException\n\tif *v == nil {\n\t\tsv = &types.TotalSizeLimitExceededException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedCalendarException(v **types.UnsupportedCalendarException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedCalendarException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedCalendarException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedFeatureRequiredException(v **types.UnsupportedFeatureRequiredException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedFeatureRequiredException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedFeatureRequiredException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedInventoryItemContextException(v **types.UnsupportedInventoryItemContextException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedInventoryItemContextException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedInventoryItemContextException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedInventorySchemaVersionException(v **types.UnsupportedInventorySchemaVersionException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedInventorySchemaVersionException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedInventorySchemaVersionException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(v **types.UnsupportedOperatingSystem, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedOperatingSystem\n\tif *v == nil {\n\t\tsv = &types.UnsupportedOperatingSystem{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.UnsupportedParameterType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedParameterType\n\tif *v == nil {\n\t\tsv = &types.UnsupportedParameterType{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentUnsupportedPlatformType(v **types.UnsupportedPlatformType, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedPlatformType\n\tif *v == nil {\n\t\tsv = &types.UnsupportedPlatformType{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeDocumentValidNextStepList(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected ValidNextStep to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentAddTagsToResourceOutput(v **AddTagsToResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *AddTagsToResourceOutput\n\tif *v == nil {\n\t\tsv = &AddTagsToResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentAssociateOpsItemRelatedItemOutput(v **AssociateOpsItemRelatedItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *AssociateOpsItemRelatedItemOutput\n\tif *v == nil {\n\t\tsv = &AssociateOpsItemRelatedItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemRelatedItemAssociationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AssociationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCancelCommandOutput(v **CancelCommandOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CancelCommandOutput\n\tif *v == nil {\n\t\tsv = &CancelCommandOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCancelMaintenanceWindowExecutionOutput(v **CancelMaintenanceWindowExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CancelMaintenanceWindowExecutionOutput\n\tif *v == nil {\n\t\tsv = &CancelMaintenanceWindowExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateActivationOutput(v **CreateActivationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateActivationOutput\n\tif *v == nil {\n\t\tsv = &CreateActivationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActivationCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ActivationCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ActivationCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ActivationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ActivationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ActivationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateAssociationBatchOutput(v **CreateAssociationBatchOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateAssociationBatchOutput\n\tif *v == nil {\n\t\tsv = &CreateAssociationBatchOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Failed\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentFailedCreateAssociationList(&sv.Failed, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Successful\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescriptionList(&sv.Successful, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateAssociationOutput(v **CreateAssociationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateAssociationOutput\n\tif *v == nil {\n\t\tsv = &CreateAssociationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescription(&sv.AssociationDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateDocumentOutput(v **CreateDocumentOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateDocumentOutput\n\tif *v == nil {\n\t\tsv = &CreateDocumentOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentDescription(&sv.DocumentDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateMaintenanceWindowOutput(v **CreateMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &CreateMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateOpsItemOutput(v **CreateOpsItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateOpsItemOutput\n\tif *v == nil {\n\t\tsv = &CreateOpsItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OpsItemArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsItemArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsItemId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateOpsMetadataOutput(v **CreateOpsMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateOpsMetadataOutput\n\tif *v == nil {\n\t\tsv = &CreateOpsMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OpsMetadataArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsMetadataArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsMetadataArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreatePatchBaselineOutput(v **CreatePatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreatePatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &CreatePatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentCreateResourceDataSyncOutput(v **CreateResourceDataSyncOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateResourceDataSyncOutput\n\tif *v == nil {\n\t\tsv = &CreateResourceDataSyncOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteActivationOutput(v **DeleteActivationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteActivationOutput\n\tif *v == nil {\n\t\tsv = &DeleteActivationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteAssociationOutput(v **DeleteAssociationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteAssociationOutput\n\tif *v == nil {\n\t\tsv = &DeleteAssociationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteDocumentOutput(v **DeleteDocumentOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteDocumentOutput\n\tif *v == nil {\n\t\tsv = &DeleteDocumentOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteInventoryOutput(v **DeleteInventoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteInventoryOutput\n\tif *v == nil {\n\t\tsv = &DeleteInventoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DeletionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UUID to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DeletionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DeletionSummary\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionSummary(&sv.DeletionSummary, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteMaintenanceWindowOutput(v **DeleteMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &DeleteMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteOpsItemOutput(v **DeleteOpsItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteOpsItemOutput\n\tif *v == nil {\n\t\tsv = &DeleteOpsItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteOpsMetadataOutput(v **DeleteOpsMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteOpsMetadataOutput\n\tif *v == nil {\n\t\tsv = &DeleteOpsMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteParameterOutput(v **DeleteParameterOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteParameterOutput\n\tif *v == nil {\n\t\tsv = &DeleteParameterOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteParametersOutput(v **DeleteParametersOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteParametersOutput\n\tif *v == nil {\n\t\tsv = &DeleteParametersOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DeletedParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterNameList(&sv.DeletedParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"InvalidParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterNameList(&sv.InvalidParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeletePatchBaselineOutput(v **DeletePatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeletePatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &DeletePatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteResourceDataSyncOutput(v **DeleteResourceDataSyncOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteResourceDataSyncOutput\n\tif *v == nil {\n\t\tsv = &DeleteResourceDataSyncOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeleteResourcePolicyOutput\n\tif *v == nil {\n\t\tsv = &DeleteResourcePolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeregisterManagedInstanceOutput(v **DeregisterManagedInstanceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeregisterManagedInstanceOutput\n\tif *v == nil {\n\t\tsv = &DeregisterManagedInstanceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeregisterPatchBaselineForPatchGroupOutput(v **DeregisterPatchBaselineForPatchGroupOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeregisterPatchBaselineForPatchGroupOutput\n\tif *v == nil {\n\t\tsv = &DeregisterPatchBaselineForPatchGroupOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PatchGroup\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PatchGroup = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeregisterTargetFromMaintenanceWindowOutput(v **DeregisterTargetFromMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeregisterTargetFromMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &DeregisterTargetFromMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDeregisterTaskFromMaintenanceWindowOutput(v **DeregisterTaskFromMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DeregisterTaskFromMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &DeregisterTaskFromMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTaskId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTaskId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeActivationsOutput(v **DescribeActivationsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeActivationsOutput\n\tif *v == nil {\n\t\tsv = &DescribeActivationsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ActivationList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentActivationList(&sv.ActivationList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAssociationExecutionsOutput(v **DescribeAssociationExecutionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAssociationExecutionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeAssociationExecutionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationExecutions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationExecutionsList(&sv.AssociationExecutions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAssociationExecutionTargetsOutput(v **DescribeAssociationExecutionTargetsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAssociationExecutionTargetsOutput\n\tif *v == nil {\n\t\tsv = &DescribeAssociationExecutionTargetsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationExecutionTargets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationExecutionTargetsList(&sv.AssociationExecutionTargets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAssociationOutput(v **DescribeAssociationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAssociationOutput\n\tif *v == nil {\n\t\tsv = &DescribeAssociationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescription(&sv.AssociationDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAutomationExecutionsOutput(v **DescribeAutomationExecutionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAutomationExecutionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeAutomationExecutionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AutomationExecutionMetadataList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationExecutionMetadataList(&sv.AutomationExecutionMetadataList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAutomationStepExecutionsOutput(v **DescribeAutomationStepExecutionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAutomationStepExecutionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeAutomationStepExecutionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StepExecutions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentStepExecutionList(&sv.StepExecutions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeAvailablePatchesOutput(v **DescribeAvailablePatchesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeAvailablePatchesOutput\n\tif *v == nil {\n\t\tsv = &DescribeAvailablePatchesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Patches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchList(&sv.Patches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeDocumentOutput(v **DescribeDocumentOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeDocumentOutput\n\tif *v == nil {\n\t\tsv = &DescribeDocumentOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Document\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentDescription(&sv.Document, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeDocumentPermissionOutput(v **DescribeDocumentPermissionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeDocumentPermissionOutput\n\tif *v == nil {\n\t\tsv = &DescribeDocumentPermissionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AccountIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAccountIdList(&sv.AccountIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"AccountSharingInfoList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAccountSharingInfoList(&sv.AccountSharingInfoList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeEffectiveInstanceAssociationsOutput(v **DescribeEffectiveInstanceAssociationsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeEffectiveInstanceAssociationsOutput\n\tif *v == nil {\n\t\tsv = &DescribeEffectiveInstanceAssociationsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Associations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationList(&sv.Associations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeEffectivePatchesForPatchBaselineOutput(v **DescribeEffectivePatchesForPatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeEffectivePatchesForPatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &DescribeEffectivePatchesForPatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"EffectivePatches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentEffectivePatchList(&sv.EffectivePatches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInstanceAssociationsStatusOutput(v **DescribeInstanceAssociationsStatusOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInstanceAssociationsStatusOutput\n\tif *v == nil {\n\t\tsv = &DescribeInstanceAssociationsStatusOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InstanceAssociationStatusInfos\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceAssociationStatusInfos(&sv.InstanceAssociationStatusInfos, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInstanceInformationOutput(v **DescribeInstanceInformationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInstanceInformationOutput\n\tif *v == nil {\n\t\tsv = &DescribeInstanceInformationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InstanceInformationList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstanceInformationList(&sv.InstanceInformationList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInstancePatchesOutput(v **DescribeInstancePatchesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInstancePatchesOutput\n\tif *v == nil {\n\t\tsv = &DescribeInstancePatchesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Patches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchComplianceDataList(&sv.Patches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInstancePatchStatesForPatchGroupOutput(v **DescribeInstancePatchStatesForPatchGroupOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInstancePatchStatesForPatchGroupOutput\n\tif *v == nil {\n\t\tsv = &DescribeInstancePatchStatesForPatchGroupOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InstancePatchStates\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstancePatchStatesList(&sv.InstancePatchStates, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInstancePatchStatesOutput(v **DescribeInstancePatchStatesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInstancePatchStatesOutput\n\tif *v == nil {\n\t\tsv = &DescribeInstancePatchStatesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InstancePatchStates\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInstancePatchStateList(&sv.InstancePatchStates, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeInventoryDeletionsOutput(v **DescribeInventoryDeletionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeInventoryDeletionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeInventoryDeletionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InventoryDeletions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryDeletionsList(&sv.InventoryDeletions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionsOutput(v **DescribeMaintenanceWindowExecutionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowExecutionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowExecutionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionList(&sv.WindowExecutions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionTaskInvocationsOutput(v **DescribeMaintenanceWindowExecutionTaskInvocationsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowExecutionTaskInvocationsOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowExecutionTaskInvocationsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionTaskInvocationIdentities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIdentityList(&sv.WindowExecutionTaskInvocationIdentities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowExecutionTasksOutput(v **DescribeMaintenanceWindowExecutionTasksOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowExecutionTasksOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowExecutionTasksOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionTaskIdentities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentityList(&sv.WindowExecutionTaskIdentities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowScheduleOutput(v **DescribeMaintenanceWindowScheduleOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowScheduleOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowScheduleOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduledWindowExecutions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentScheduledWindowExecutionList(&sv.ScheduledWindowExecutions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowsForTargetOutput(v **DescribeMaintenanceWindowsForTargetOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowsForTargetOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowsForTargetOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowIdentities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowsForTargetList(&sv.WindowIdentities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowsOutput(v **DescribeMaintenanceWindowsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowsOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowIdentities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowIdentityList(&sv.WindowIdentities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowTargetsOutput(v **DescribeMaintenanceWindowTargetsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowTargetsOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowTargetsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTargetList(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeMaintenanceWindowTasksOutput(v **DescribeMaintenanceWindowTasksOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeMaintenanceWindowTasksOutput\n\tif *v == nil {\n\t\tsv = &DescribeMaintenanceWindowTasksOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Tasks\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskList(&sv.Tasks, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeOpsItemsOutput(v **DescribeOpsItemsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeOpsItemsOutput\n\tif *v == nil {\n\t\tsv = &DescribeOpsItemsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsItemSummaries\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemSummaries(&sv.OpsItemSummaries, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeParametersOutput(v **DescribeParametersOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeParametersOutput\n\tif *v == nil {\n\t\tsv = &DescribeParametersOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterMetadataList(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribePatchBaselinesOutput(v **DescribePatchBaselinesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribePatchBaselinesOutput\n\tif *v == nil {\n\t\tsv = &DescribePatchBaselinesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineIdentities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchBaselineIdentityList(&sv.BaselineIdentities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribePatchGroupsOutput(v **DescribePatchGroupsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribePatchGroupsOutput\n\tif *v == nil {\n\t\tsv = &DescribePatchGroupsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Mappings\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchGroupPatchBaselineMappingList(&sv.Mappings, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **DescribePatchGroupStateOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribePatchGroupStateOutput\n\tif *v == nil {\n\t\tsv = &DescribePatchGroupStateOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Instances\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Instances = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithCriticalNonCompliantPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstancesCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithCriticalNonCompliantPatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstancesWithFailedPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithFailedPatches = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithInstalledOtherPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithInstalledOtherPatches = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithInstalledPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithInstalledPatches = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithInstalledPendingRebootPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstancesCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithInstalledPendingRebootPatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstancesWithInstalledRejectedPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstancesCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithInstalledRejectedPatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstancesWithMissingPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithMissingPatches = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithNotApplicablePatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithNotApplicablePatches = int32(i64)\n\t\t\t}\n\n\t\tcase \"InstancesWithOtherNonCompliantPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstancesCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithOtherNonCompliantPatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstancesWithSecurityNonCompliantPatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstancesCount to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithSecurityNonCompliantPatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"InstancesWithUnreportedNotApplicablePatches\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Integer to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.InstancesWithUnreportedNotApplicablePatches = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribePatchPropertiesOutput(v **DescribePatchPropertiesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribePatchPropertiesOutput\n\tif *v == nil {\n\t\tsv = &DescribePatchPropertiesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Properties\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchPropertiesList(&sv.Properties, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDescribeSessionsOutput(v **DescribeSessionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DescribeSessionsOutput\n\tif *v == nil {\n\t\tsv = &DescribeSessionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Sessions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentSessionList(&sv.Sessions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentDisassociateOpsItemRelatedItemOutput(v **DisassociateOpsItemRelatedItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *DisassociateOpsItemRelatedItemOutput\n\tif *v == nil {\n\t\tsv = &DisassociateOpsItemRelatedItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetAutomationExecutionOutput(v **GetAutomationExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetAutomationExecutionOutput\n\tif *v == nil {\n\t\tsv = &GetAutomationExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AutomationExecution\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAutomationExecution(&sv.AutomationExecution, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetCalendarStateOutput(v **GetCalendarStateOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetCalendarStateOutput\n\tif *v == nil {\n\t\tsv = &GetCalendarStateOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AtTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ISO8601String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AtTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NextTransitionTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ISO8601String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextTransitionTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"State\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CalendarState to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.State = types.CalendarState(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetCommandInvocationOutput(v **GetCommandInvocationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetCommandInvocationOutput\n\tif *v == nil {\n\t\tsv = &GetCommandInvocationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CloudWatchOutputConfig\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(&sv.CloudWatchOutputConfig, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CommandId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CommandId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Comment\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Comment to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Comment = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionElapsedTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionElapsedTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionEndDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionEndDateTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ExecutionStartDateTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionStartDateTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PluginName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandPluginName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PluginName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResponseCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ResponseCode to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ResponseCode = int32(i64)\n\t\t\t}\n\n\t\tcase \"StandardErrorContent\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StandardErrorContent to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardErrorContent = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardErrorUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardErrorUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardOutputContent\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StandardOutputContent to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardOutputContent = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StandardOutputUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Url to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StandardOutputUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected CommandInvocationStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.CommandInvocationStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetConnectionStatusOutput(v **GetConnectionStatusOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetConnectionStatusOutput\n\tif *v == nil {\n\t\tsv = &GetConnectionStatusOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ConnectionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.ConnectionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Target\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionTarget to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Target = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetDefaultPatchBaselineOutput(v **GetDefaultPatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetDefaultPatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &GetDefaultPatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OperatingSystem\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OperatingSystem = types.OperatingSystem(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetDeployablePatchSnapshotForInstanceOutput(v **GetDeployablePatchSnapshotForInstanceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetDeployablePatchSnapshotForInstanceOutput\n\tif *v == nil {\n\t\tsv = &GetDeployablePatchSnapshotForInstanceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Product\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Product to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Product = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SnapshotDownloadUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SnapshotDownloadUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SnapshotDownloadUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SnapshotId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SnapshotId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SnapshotId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetDocumentOutput(v **GetDocumentOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetDocumentOutput\n\tif *v == nil {\n\t\tsv = &GetDocumentOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AttachmentsContent\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAttachmentContentList(&sv.AttachmentsContent, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Content\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentContent to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Content = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"DisplayName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentDisplayName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DisplayName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentFormat\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentFormat to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentFormat = types.DocumentFormat(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentType = types.DocumentType(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentARN to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Requires\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentRequiresList(&sv.Requires, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ReviewStatus\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ReviewStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ReviewStatus = types.ReviewStatus(jtv)\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.DocumentStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentStatusInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"VersionName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersionName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VersionName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetInventoryOutput(v **GetInventoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetInventoryOutput\n\tif *v == nil {\n\t\tsv = &GetInventoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Entities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryResultEntityList(&sv.Entities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetInventorySchemaOutput(v **GetInventorySchemaOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetInventorySchemaOutput\n\tif *v == nil {\n\t\tsv = &GetInventorySchemaOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Schemas\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemSchemaResultList(&sv.Schemas, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionOutput(v **GetMaintenanceWindowExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetMaintenanceWindowExecutionOutput\n\tif *v == nil {\n\t\tsv = &GetMaintenanceWindowExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskIds\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdList(&sv.TaskIds, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskInvocationOutput(v **GetMaintenanceWindowExecutionTaskInvocationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetMaintenanceWindowExecutionTaskInvocationOutput\n\tif *v == nil {\n\t\tsv = &GetMaintenanceWindowExecutionTaskInvocationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"ExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"InvocationId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskInvocationId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InvocationId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OwnerInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OwnerInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OwnerInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskInvocationParameters to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Parameters = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskType = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskOutput(v **GetMaintenanceWindowExecutionTaskOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetMaintenanceWindowExecutionTaskOutput\n\tif *v == nil {\n\t\tsv = &GetMaintenanceWindowExecutionTaskOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"EndTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = int32(i64)\n\t\t\t}\n\n\t\tcase \"ServiceRole\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRole = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartTime\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Status\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatus to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Status = types.MaintenanceWindowExecutionStatus(jtv)\n\t\t\t}\n\n\t\tcase \"StatusDetails\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionStatusDetails to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StatusDetails = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParametersList(&sv.TaskParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TriggeredAlarms\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Type\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Type = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"WindowExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(v **GetMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &GetMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AllowUnassociatedTargets\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowAllowUnassociatedTargets to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AllowUnassociatedTargets = jtv\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Cutoff\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowCutoff to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Cutoff = int32(i64)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Duration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDurationHours to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Duration = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Enabled\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowEnabled to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Enabled = jtv\n\t\t\t}\n\n\t\tcase \"EndDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EndDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NextExecutionTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextExecutionTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Schedule\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowSchedule to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Schedule = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"ScheduleTimezone\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTimezone to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleTimezone = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StartDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowTaskOutput(v **GetMaintenanceWindowTaskOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetMaintenanceWindowTaskOutput\n\tif *v == nil {\n\t\tsv = &GetMaintenanceWindowTaskOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CutoffBehavior\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LoggingInfo\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = int32(i64)\n\t\t\t}\n\n\t\tcase \"ServiceRoleArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRoleArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskInvocationParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskInvocationParameters(&sv.TaskInvocationParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameters(&sv.TaskParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskType = types.MaintenanceWindowTaskType(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTaskId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTaskId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetOpsItemOutput(v **GetOpsItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetOpsItemOutput\n\tif *v == nil {\n\t\tsv = &GetOpsItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OpsItem\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItem(&sv.OpsItem, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetOpsMetadataOutput(v **GetOpsMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetOpsMetadataOutput\n\tif *v == nil {\n\t\tsv = &GetOpsMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Metadata\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMetadataMap(&sv.Metadata, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsMetadataResourceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ResourceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetOpsSummaryOutput(v **GetOpsSummaryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetOpsSummaryOutput\n\tif *v == nil {\n\t\tsv = &GetOpsSummaryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Entities\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsEntityList(&sv.Entities, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetParameterHistoryOutput(v **GetParameterHistoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetParameterHistoryOutput\n\tif *v == nil {\n\t\tsv = &GetParameterHistoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterHistoryList(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetParameterOutput(v **GetParameterOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetParameterOutput\n\tif *v == nil {\n\t\tsv = &GetParameterOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Parameter\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameter(&sv.Parameter, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetParametersByPathOutput(v **GetParametersByPathOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetParametersByPathOutput\n\tif *v == nil {\n\t\tsv = &GetParametersByPathOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterList(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetParametersOutput(v **GetParametersOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetParametersOutput\n\tif *v == nil {\n\t\tsv = &GetParametersOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InvalidParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterNameList(&sv.InvalidParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Parameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterList(&sv.Parameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetPatchBaselineForPatchGroupOutput(v **GetPatchBaselineForPatchGroupOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetPatchBaselineForPatchGroupOutput\n\tif *v == nil {\n\t\tsv = &GetPatchBaselineForPatchGroupOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OperatingSystem\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OperatingSystem = types.OperatingSystem(jtv)\n\t\t\t}\n\n\t\tcase \"PatchGroup\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PatchGroup = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(v **GetPatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetPatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &GetPatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApprovalRules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchRuleGroup(&sv.ApprovalRules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApprovedPatches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchIdList(&sv.ApprovedPatches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApprovedPatchesComplianceLevel\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchComplianceLevel to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApprovedPatchesComplianceLevel = types.PatchComplianceLevel(jtv)\n\t\t\t}\n\n\t\tcase \"ApprovedPatchesEnableNonSecurity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApprovedPatchesEnableNonSecurity = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"GlobalFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchFilterGroup(&sv.GlobalFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OperatingSystem\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OperatingSystem = types.OperatingSystem(jtv)\n\t\t\t}\n\n\t\tcase \"PatchGroups\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchGroupList(&sv.PatchGroups, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RejectedPatches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchIdList(&sv.RejectedPatches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RejectedPatchesAction\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchAction to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RejectedPatchesAction = types.PatchAction(jtv)\n\t\t\t}\n\n\t\tcase \"Sources\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchSourceList(&sv.Sources, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetResourcePoliciesOutput(v **GetResourcePoliciesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetResourcePoliciesOutput\n\tif *v == nil {\n\t\tsv = &GetResourcePoliciesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Policies\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntries(&sv.Policies, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentGetServiceSettingOutput(v **GetServiceSettingOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetServiceSettingOutput\n\tif *v == nil {\n\t\tsv = &GetServiceSettingOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ServiceSetting\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentServiceSetting(&sv.ServiceSetting, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentLabelParameterVersionOutput(v **LabelParameterVersionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *LabelParameterVersionOutput\n\tif *v == nil {\n\t\tsv = &LabelParameterVersionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InvalidLabels\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.InvalidLabels, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ParameterVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterVersion to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ParameterVersion = i64\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListAssociationsOutput(v **ListAssociationsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListAssociationsOutput\n\tif *v == nil {\n\t\tsv = &ListAssociationsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Associations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationList(&sv.Associations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListAssociationVersionsOutput(v **ListAssociationVersionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListAssociationVersionsOutput\n\tif *v == nil {\n\t\tsv = &ListAssociationVersionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationVersions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationVersionList(&sv.AssociationVersions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListCommandInvocationsOutput(v **ListCommandInvocationsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListCommandInvocationsOutput\n\tif *v == nil {\n\t\tsv = &ListCommandInvocationsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CommandInvocations\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCommandInvocationList(&sv.CommandInvocations, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListCommandsOutput\n\tif *v == nil {\n\t\tsv = &ListCommandsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Commands\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCommandList(&sv.Commands, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplianceItemsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListComplianceItemsOutput\n\tif *v == nil {\n\t\tsv = &ListComplianceItemsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ComplianceItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentComplianceItemList(&sv.ComplianceItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(v **ListComplianceSummariesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListComplianceSummariesOutput\n\tif *v == nil {\n\t\tsv = &ListComplianceSummariesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ComplianceSummaryItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentComplianceSummaryItemList(&sv.ComplianceSummaryItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(v **ListDocumentMetadataHistoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListDocumentMetadataHistoryOutput\n\tif *v == nil {\n\t\tsv = &ListDocumentMetadataHistoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Author\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentAuthor to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Author = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"DocumentVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DocumentVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Metadata\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(&sv.Metadata, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DocumentName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListDocumentsOutput\n\tif *v == nil {\n\t\tsv = &ListDocumentsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentIdentifiers\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentIdentifierList(&sv.DocumentIdentifiers, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocumentVersionsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListDocumentVersionsOutput\n\tif *v == nil {\n\t\tsv = &ListDocumentVersionsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentVersions\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentVersionList(&sv.DocumentVersions, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInventoryEntriesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListInventoryEntriesOutput\n\tif *v == nil {\n\t\tsv = &ListInventoryEntriesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"CaptureTime\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemCaptureTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CaptureTime = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Entries\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Entries, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"InstanceId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InstanceId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.InstanceId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"SchemaVersion\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemSchemaVersion to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SchemaVersion = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TypeName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected InventoryItemTypeName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TypeName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(v **ListOpsItemEventsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListOpsItemEventsOutput\n\tif *v == nil {\n\t\tsv = &ListOpsItemEventsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Summaries\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemEventSummaries(&sv.Summaries, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(v **ListOpsItemRelatedItemsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListOpsItemRelatedItemsOutput\n\tif *v == nil {\n\t\tsv = &ListOpsItemRelatedItemsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected String to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Summaries\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummaries(&sv.Summaries, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(v **ListOpsMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListOpsMetadataOutput\n\tif *v == nil {\n\t\tsv = &ListOpsMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OpsMetadataList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentOpsMetadataList(&sv.OpsMetadataList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(v **ListResourceComplianceSummariesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListResourceComplianceSummariesOutput\n\tif *v == nil {\n\t\tsv = &ListResourceComplianceSummariesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceComplianceSummaryItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceComplianceSummaryItemList(&sv.ResourceComplianceSummaryItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(v **ListResourceDataSyncOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListResourceDataSyncOutput\n\tif *v == nil {\n\t\tsv = &ListResourceDataSyncOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"NextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ResourceDataSyncItems\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentResourceDataSyncItemList(&sv.ResourceDataSyncItems, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListTagsForResourceOutput\n\tif *v == nil {\n\t\tsv = &ListTagsForResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"TagList\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTagList(&sv.TagList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentModifyDocumentPermissionOutput(v **ModifyDocumentPermissionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ModifyDocumentPermissionOutput\n\tif *v == nil {\n\t\tsv = &ModifyDocumentPermissionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutComplianceItemsOutput(v **PutComplianceItemsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutComplianceItemsOutput\n\tif *v == nil {\n\t\tsv = &PutComplianceItemsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutInventoryOutput(v **PutInventoryOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutInventoryOutput\n\tif *v == nil {\n\t\tsv = &PutInventoryOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PutInventoryMessage to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutParameterOutput(v **PutParameterOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutParameterOutput\n\tif *v == nil {\n\t\tsv = &PutParameterOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Tier\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ParameterTier to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Tier = types.ParameterTier(jtv)\n\t\t\t}\n\n\t\tcase \"Version\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PSParameterVersion to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Version = i64\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *PutResourcePolicyOutput\n\tif *v == nil {\n\t\tsv = &PutResourcePolicyOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"PolicyHash\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PolicyHash to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyHash = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PolicyId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PolicyId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PolicyId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentRegisterDefaultPatchBaselineOutput(v **RegisterDefaultPatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RegisterDefaultPatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &RegisterDefaultPatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentRegisterPatchBaselineForPatchGroupOutput(v **RegisterPatchBaselineForPatchGroupOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RegisterPatchBaselineForPatchGroupOutput\n\tif *v == nil {\n\t\tsv = &RegisterPatchBaselineForPatchGroupOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"PatchGroup\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchGroup to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.PatchGroup = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentRegisterTargetWithMaintenanceWindowOutput(v **RegisterTargetWithMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RegisterTargetWithMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &RegisterTargetWithMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentRegisterTaskWithMaintenanceWindowOutput(v **RegisterTaskWithMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RegisterTaskWithMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &RegisterTaskWithMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"WindowTaskId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTaskId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentRemoveTagsFromResourceOutput(v **RemoveTagsFromResourceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RemoveTagsFromResourceOutput\n\tif *v == nil {\n\t\tsv = &RemoveTagsFromResourceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentResetServiceSettingOutput(v **ResetServiceSettingOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ResetServiceSettingOutput\n\tif *v == nil {\n\t\tsv = &ResetServiceSettingOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ServiceSetting\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentServiceSetting(&sv.ServiceSetting, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentResumeSessionOutput(v **ResumeSessionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ResumeSessionOutput\n\tif *v == nil {\n\t\tsv = &ResumeSessionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"SessionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SessionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StreamUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StreamUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StreamUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TokenValue\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TokenValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TokenValue = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentSendAutomationSignalOutput(v **SendAutomationSignalOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *SendAutomationSignalOutput\n\tif *v == nil {\n\t\tsv = &SendAutomationSignalOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentSendCommandOutput(v **SendCommandOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *SendCommandOutput\n\tif *v == nil {\n\t\tsv = &SendCommandOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Command\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentCommand(&sv.Command, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartAssociationsOnceOutput(v **StartAssociationsOnceOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartAssociationsOnceOutput\n\tif *v == nil {\n\t\tsv = &StartAssociationsOnceOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartAutomationExecutionOutput(v **StartAutomationExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartAutomationExecutionOutput\n\tif *v == nil {\n\t\tsv = &StartAutomationExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartChangeRequestExecutionOutput(v **StartChangeRequestExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartChangeRequestExecutionOutput\n\tif *v == nil {\n\t\tsv = &StartChangeRequestExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AutomationExecutionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AutomationExecutionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AutomationExecutionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStartSessionOutput(v **StartSessionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartSessionOutput\n\tif *v == nil {\n\t\tsv = &StartSessionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"SessionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SessionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StreamUrl\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected StreamUrl to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StreamUrl = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TokenValue\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TokenValue to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TokenValue = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentStopAutomationExecutionOutput(v **StopAutomationExecutionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StopAutomationExecutionOutput\n\tif *v == nil {\n\t\tsv = &StopAutomationExecutionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentTerminateSessionOutput(v **TerminateSessionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *TerminateSessionOutput\n\tif *v == nil {\n\t\tsv = &TerminateSessionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"SessionId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SessionId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUnlabelParameterVersionOutput(v **UnlabelParameterVersionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UnlabelParameterVersionOutput\n\tif *v == nil {\n\t\tsv = &UnlabelParameterVersionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"InvalidLabels\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.InvalidLabels, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RemovedLabels\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.RemovedLabels, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateAssociationOutput(v **UpdateAssociationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateAssociationOutput\n\tif *v == nil {\n\t\tsv = &UpdateAssociationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescription(&sv.AssociationDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateAssociationStatusOutput(v **UpdateAssociationStatusOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateAssociationStatusOutput\n\tif *v == nil {\n\t\tsv = &UpdateAssociationStatusOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AssociationDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAssociationDescription(&sv.AssociationDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateDocumentDefaultVersionOutput(v **UpdateDocumentDefaultVersionOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateDocumentDefaultVersionOutput\n\tif *v == nil {\n\t\tsv = &UpdateDocumentDefaultVersionOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Description\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentDefaultVersionDescription(&sv.Description, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(v **UpdateDocumentMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateDocumentMetadataOutput\n\tif *v == nil {\n\t\tsv = &UpdateDocumentMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateDocumentOutput(v **UpdateDocumentOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateDocumentOutput\n\tif *v == nil {\n\t\tsv = &UpdateDocumentOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"DocumentDescription\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentDocumentDescription(&sv.DocumentDescription, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(v **UpdateMaintenanceWindowOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateMaintenanceWindowOutput\n\tif *v == nil {\n\t\tsv = &UpdateMaintenanceWindowOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AllowUnassociatedTargets\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowAllowUnassociatedTargets to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AllowUnassociatedTargets = jtv\n\t\t\t}\n\n\t\tcase \"Cutoff\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowCutoff to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Cutoff = int32(i64)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Duration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDurationHours to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Duration = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"Enabled\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowEnabled to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Enabled = jtv\n\t\t\t}\n\n\t\tcase \"EndDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EndDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Schedule\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowSchedule to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Schedule = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"ScheduleOffset\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowOffset to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ScheduleOffset = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase \"ScheduleTimezone\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTimezone to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ScheduleTimezone = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"StartDate\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowStringDateTime to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.StartDate = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(v **UpdateMaintenanceWindowTargetOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateMaintenanceWindowTargetOutput\n\tif *v == nil {\n\t\tsv = &UpdateMaintenanceWindowTargetOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OwnerInformation\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OwnerInformation to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OwnerInformation = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTargetId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTargetId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTargetId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(v **UpdateMaintenanceWindowTaskOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateMaintenanceWindowTaskOutput\n\tif *v == nil {\n\t\tsv = &UpdateMaintenanceWindowTaskOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"AlarmConfiguration\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"CutoffBehavior\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv)\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"LoggingInfo\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"MaxConcurrency\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxConcurrency to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxConcurrency = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"MaxErrors\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaxErrors to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.MaxErrors = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Priority\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskPriority to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Priority = int32(i64)\n\t\t\t}\n\n\t\tcase \"ServiceRoleArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ServiceRole to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ServiceRoleArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"Targets\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TaskArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"TaskInvocationParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskInvocationParameters(&sv.TaskInvocationParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"TaskParameters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentMaintenanceWindowTaskParameters(&sv.TaskParameters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"WindowId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"WindowTaskId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected MaintenanceWindowTaskId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.WindowTaskId = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateManagedInstanceRoleOutput(v **UpdateManagedInstanceRoleOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateManagedInstanceRoleOutput\n\tif *v == nil {\n\t\tsv = &UpdateManagedInstanceRoleOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateOpsItemOutput(v **UpdateOpsItemOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateOpsItemOutput\n\tif *v == nil {\n\t\tsv = &UpdateOpsItemOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateOpsMetadataOutput(v **UpdateOpsMetadataOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateOpsMetadataOutput\n\tif *v == nil {\n\t\tsv = &UpdateOpsMetadataOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"OpsMetadataArn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OpsMetadataArn to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OpsMetadataArn = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(v **UpdatePatchBaselineOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdatePatchBaselineOutput\n\tif *v == nil {\n\t\tsv = &UpdatePatchBaselineOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"ApprovalRules\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchRuleGroup(&sv.ApprovalRules, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApprovedPatches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchIdList(&sv.ApprovedPatches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ApprovedPatchesComplianceLevel\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchComplianceLevel to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApprovedPatchesComplianceLevel = types.PatchComplianceLevel(jtv)\n\t\t\t}\n\n\t\tcase \"ApprovedPatchesEnableNonSecurity\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Boolean to be of type *bool, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ApprovedPatchesEnableNonSecurity = ptr.Bool(jtv)\n\t\t\t}\n\n\t\tcase \"BaselineId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.BaselineId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"CreatedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"GlobalFilters\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchFilterGroup(&sv.GlobalFilters, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"ModifiedDate\":\n\t\t\tif value != nil {\n\t\t\t\tswitch jtv := value.(type) {\n\t\t\t\tcase json.Number:\n\t\t\t\t\tf64, err := jtv.Float64()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tsv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"expected DateTime to be a JSON Number, got %T instead\", value)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"Name\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected BaselineName to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Name = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"OperatingSystem\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected OperatingSystem to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.OperatingSystem = types.OperatingSystem(jtv)\n\t\t\t}\n\n\t\tcase \"RejectedPatches\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchIdList(&sv.RejectedPatches, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"RejectedPatchesAction\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected PatchAction to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RejectedPatchesAction = types.PatchAction(jtv)\n\t\t\t}\n\n\t\tcase \"Sources\":\n\t\t\tif err := awsAwsjson11_deserializeDocumentPatchSourceList(&sv.Sources, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateResourceDataSyncOutput(v **UpdateResourceDataSyncOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateResourceDataSyncOutput\n\tif *v == nil {\n\t\tsv = &UpdateResourceDataSyncOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsjson11_deserializeOpDocumentUpdateServiceSettingOutput(v **UpdateServiceSettingOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *UpdateServiceSettingOutput\n\tif *v == nil {\n\t\tsv = &UpdateServiceSettingOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package ssm provides the API client, operations, and parameter types for Amazon\n// Simple Systems Manager (SSM).\n//\n// Amazon Web Services Systems Manager is the operations hub for your Amazon Web\n// Services applications and resources and a secure end-to-end management solution\n// for hybrid cloud environments that enables safe and secure operations at scale.\n// This reference is intended to be used with the Amazon Web Services Systems\n// Manager User Guide (https://docs.aws.amazon.com/systems-manager/latest/userguide/)\n// . To get started, see Setting up Amazon Web Services Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html)\n// . Related resources\n//   - For information about each of the capabilities that comprise Systems\n//     Manager, see Systems Manager capabilities (https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities)\n//     in the Amazon Web Services Systems Manager User Guide.\n//   - For details about predefined runbooks for Automation, a capability of\n//     Amazon Web Services Systems Manager, see the Systems Manager Automation\n//     runbook reference (https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-runbook-reference.html)\n//     .\n//   - For information about AppConfig, a capability of Systems Manager, see the\n//     AppConfig User Guide (https://docs.aws.amazon.com/appconfig/latest/userguide/)\n//     and the AppConfig API Reference (https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/)\n//     .\n//   - For information about Incident Manager, a capability of Systems Manager,\n//     see the Systems Manager Incident Manager User Guide (https://docs.aws.amazon.com/incident-manager/latest/userguide/)\n//     and the Systems Manager Incident Manager API Reference (https://docs.aws.amazon.com/incident-manager/latest/APIReference/)\n//     .\npackage ssm\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithyendpoints \"github.com/aws/smithy-go/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleSerialize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\tnf := (&aws.EndpointNotFoundError{})\n\t\tif errors.As(err, &nf) {\n\t\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)\n\t\t\treturn next.HandleSerialize(ctx, in)\n\t\t}\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"ssm\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,\n// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked\n// via its middleware.\n//\n// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n\nfunc resolveEndpointResolverV2(options *Options) {\n\tif options.EndpointResolverV2 == nil {\n\t\toptions.EndpointResolverV2 = NewDefaultEndpointResolverV2()\n\t}\n}\n\nfunc resolveBaseEndpoint(cfg aws.Config, o *Options) {\n\tif cfg.BaseEndpoint != nil {\n\t\to.BaseEndpoint = cfg.BaseEndpoint\n\t}\n\n\t_, g := os.LookupEnv(\"AWS_ENDPOINT_URL\")\n\t_, s := os.LookupEnv(\"AWS_ENDPOINT_URL_SSM\")\n\n\tif g && !s {\n\t\treturn\n\t}\n\n\tvalue, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), \"SSM\", cfg.ConfigSources)\n\tif found && err == nil {\n\t\to.BaseEndpoint = &value\n\t}\n}\n\n// EndpointParameters provides the parameters that influence how endpoints are\n// resolved.\ntype EndpointParameters struct {\n\t// The AWS region used to dispatch the request.\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// AWS::Region\n\tRegion *string\n\n\t// When true, use the dual-stack endpoint. If the configured endpoint does not\n\t// support dual-stack, dispatching the request MAY return an error.\n\t//\n\t// Defaults to\n\t// false if no value is provided.\n\t//\n\t// AWS::UseDualStack\n\tUseDualStack *bool\n\n\t// When true, send this request to the FIPS-compliant regional endpoint. If the\n\t// configured endpoint does not have a FIPS compliant endpoint, dispatching the\n\t// request will return an error.\n\t//\n\t// Defaults to false if no value is\n\t// provided.\n\t//\n\t// AWS::UseFIPS\n\tUseFIPS *bool\n\n\t// Override the endpoint used to send this request\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// SDK::Endpoint\n\tEndpoint *string\n}\n\n// ValidateRequired validates required parameters are set.\nfunc (p EndpointParameters) ValidateRequired() error {\n\tif p.UseDualStack == nil {\n\t\treturn fmt.Errorf(\"parameter UseDualStack is required\")\n\t}\n\n\tif p.UseFIPS == nil {\n\t\treturn fmt.Errorf(\"parameter UseFIPS is required\")\n\t}\n\n\treturn nil\n}\n\n// WithDefaults returns a shallow copy of EndpointParameterswith default values\n// applied to members where applicable.\nfunc (p EndpointParameters) WithDefaults() EndpointParameters {\n\tif p.UseDualStack == nil {\n\t\tp.UseDualStack = ptr.Bool(false)\n\t}\n\n\tif p.UseFIPS == nil {\n\t\tp.UseFIPS = ptr.Bool(false)\n\t}\n\treturn p\n}\n\n// EndpointResolverV2 provides the interface for resolving service endpoints.\ntype EndpointResolverV2 interface {\n\t// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n\t// returning the endpoint if found. Otherwise an error is returned.\n\tResolveEndpoint(ctx context.Context, params EndpointParameters) (\n\t\tsmithyendpoints.Endpoint, error,\n\t)\n}\n\n// resolver provides the implementation for resolving endpoints.\ntype resolver struct{}\n\nfunc NewDefaultEndpointResolverV2() EndpointResolverV2 {\n\treturn &resolver{}\n}\n\n// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n// returning the endpoint if found. Otherwise an error is returned.\nfunc (r *resolver) ResolveEndpoint(\n\tctx context.Context, params EndpointParameters,\n) (\n\tendpoint smithyendpoints.Endpoint, err error,\n) {\n\tparams = params.WithDefaults()\n\tif err = params.ValidateRequired(); err != nil {\n\t\treturn endpoint, fmt.Errorf(\"endpoint parameters are not valid, %w\", err)\n\t}\n\t_UseDualStack := *params.UseDualStack\n\t_UseFIPS := *params.UseFIPS\n\n\tif exprVal := params.Endpoint; exprVal != nil {\n\t\t_Endpoint := *exprVal\n\t\t_ = _Endpoint\n\t\tif _UseFIPS == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: FIPS and custom endpoint are not supported\")\n\t\t}\n\t\tif _UseDualStack == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Dualstack and custom endpoint are not supported\")\n\t\t}\n\t\turiString := _Endpoint\n\n\t\turi, err := url.Parse(uriString)\n\t\tif err != nil {\n\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t}\n\n\t\treturn smithyendpoints.Endpoint{\n\t\t\tURI:     *uri,\n\t\t\tHeaders: http.Header{},\n\t\t}, nil\n\t}\n\tif exprVal := params.Region; exprVal != nil {\n\t\t_Region := *exprVal\n\t\t_ = _Region\n\t\tif exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {\n\t\t\t_PartitionResult := *exprVal\n\t\t\t_ = _PartitionResult\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _UseDualStack == true {\n\t\t\t\t\tif true == _PartitionResult.SupportsFIPS {\n\t\t\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\t\tout.WriteString(\"https://ssm-fips.\")\n\t\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t\t}()\n\n\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS and DualStack are enabled, but this partition does not support one or both\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _PartitionResult.SupportsFIPS == true {\n\t\t\t\t\tif _PartitionResult.Name == \"aws-us-gov\" {\n\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\tout.WriteString(\"https://ssm.\")\n\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\tout.WriteString(\".amazonaws.com\")\n\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://ssm-fips.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS is enabled but this partition does not support FIPS\")\n\t\t\t}\n\t\t\tif _UseDualStack == true {\n\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://ssm.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"DualStack is enabled but this partition does not support DualStack\")\n\t\t\t}\n\t\t\turiString := func() string {\n\t\t\t\tvar out strings.Builder\n\t\t\t\tout.WriteString(\"https://ssm.\")\n\t\t\t\tout.WriteString(_Region)\n\t\t\t\tout.WriteString(\".\")\n\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\treturn out.String()\n\t\t\t}()\n\n\t\t\turi, err := url.Parse(uriString)\n\t\t\tif err != nil {\n\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t}\n\n\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\tURI:     *uri,\n\t\t\t\tHeaders: http.Header{},\n\t\t\t}, nil\n\t\t}\n\t\treturn endpoint, fmt.Errorf(\"Endpoint resolution failed. Invalid operation or environment input.\")\n\t}\n\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Missing Region\")\n}\n\ntype endpointParamsBinder interface {\n\tbindEndpointParams(*EndpointParameters)\n}\n\nfunc bindEndpointParams(input interface{}, options Options) *EndpointParameters {\n\tparams := &EndpointParameters{}\n\n\tparams.Region = aws.String(endpoints.MapFIPSRegion(options.Region))\n\tparams.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)\n\tparams.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)\n\tparams.Endpoint = options.BaseEndpoint\n\n\tif b, ok := input.(endpointParamsBinder); ok {\n\t\tb.bindEndpointParams(params)\n\t}\n\n\treturn params\n}\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.options.EndpointResolverV2 == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\tparams := bindEndpointParams(getOperationInput(ctx), m.options)\n\tendpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\tif endpt.URI.RawPath == \"\" && req.URL.RawPath != \"\" {\n\t\tendpt.URI.RawPath = endpt.URI.Path\n\t}\n\treq.URL.Scheme = endpt.URI.Scheme\n\treq.URL.Host = endpt.URI.Host\n\treq.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)\n\treq.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)\n\tfor k := range endpt.Headers {\n\t\treq.Header.Set(k, endpt.Headers.Get(k))\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\topts, _ := smithyauth.GetAuthOptions(&endpt.Properties)\n\tfor _, o := range opts {\n\t\trscheme.SignerProperties.SetAll(&o.SignerProperties)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\",\n        \"github.com/google/go-cmp\": \"v0.5.4\",\n        \"github.com/jmespath/go-jmespath\": \"v0.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_AddTagsToResource.go\",\n        \"api_op_AssociateOpsItemRelatedItem.go\",\n        \"api_op_CancelCommand.go\",\n        \"api_op_CancelMaintenanceWindowExecution.go\",\n        \"api_op_CreateActivation.go\",\n        \"api_op_CreateAssociation.go\",\n        \"api_op_CreateAssociationBatch.go\",\n        \"api_op_CreateDocument.go\",\n        \"api_op_CreateMaintenanceWindow.go\",\n        \"api_op_CreateOpsItem.go\",\n        \"api_op_CreateOpsMetadata.go\",\n        \"api_op_CreatePatchBaseline.go\",\n        \"api_op_CreateResourceDataSync.go\",\n        \"api_op_DeleteActivation.go\",\n        \"api_op_DeleteAssociation.go\",\n        \"api_op_DeleteDocument.go\",\n        \"api_op_DeleteInventory.go\",\n        \"api_op_DeleteMaintenanceWindow.go\",\n        \"api_op_DeleteOpsItem.go\",\n        \"api_op_DeleteOpsMetadata.go\",\n        \"api_op_DeleteParameter.go\",\n        \"api_op_DeleteParameters.go\",\n        \"api_op_DeletePatchBaseline.go\",\n        \"api_op_DeleteResourceDataSync.go\",\n        \"api_op_DeleteResourcePolicy.go\",\n        \"api_op_DeregisterManagedInstance.go\",\n        \"api_op_DeregisterPatchBaselineForPatchGroup.go\",\n        \"api_op_DeregisterTargetFromMaintenanceWindow.go\",\n        \"api_op_DeregisterTaskFromMaintenanceWindow.go\",\n        \"api_op_DescribeActivations.go\",\n        \"api_op_DescribeAssociation.go\",\n        \"api_op_DescribeAssociationExecutionTargets.go\",\n        \"api_op_DescribeAssociationExecutions.go\",\n        \"api_op_DescribeAutomationExecutions.go\",\n        \"api_op_DescribeAutomationStepExecutions.go\",\n        \"api_op_DescribeAvailablePatches.go\",\n        \"api_op_DescribeDocument.go\",\n        \"api_op_DescribeDocumentPermission.go\",\n        \"api_op_DescribeEffectiveInstanceAssociations.go\",\n        \"api_op_DescribeEffectivePatchesForPatchBaseline.go\",\n        \"api_op_DescribeInstanceAssociationsStatus.go\",\n        \"api_op_DescribeInstanceInformation.go\",\n        \"api_op_DescribeInstancePatchStates.go\",\n        \"api_op_DescribeInstancePatchStatesForPatchGroup.go\",\n        \"api_op_DescribeInstancePatches.go\",\n        \"api_op_DescribeInventoryDeletions.go\",\n        \"api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go\",\n        \"api_op_DescribeMaintenanceWindowExecutionTasks.go\",\n        \"api_op_DescribeMaintenanceWindowExecutions.go\",\n        \"api_op_DescribeMaintenanceWindowSchedule.go\",\n        \"api_op_DescribeMaintenanceWindowTargets.go\",\n        \"api_op_DescribeMaintenanceWindowTasks.go\",\n        \"api_op_DescribeMaintenanceWindows.go\",\n        \"api_op_DescribeMaintenanceWindowsForTarget.go\",\n        \"api_op_DescribeOpsItems.go\",\n        \"api_op_DescribeParameters.go\",\n        \"api_op_DescribePatchBaselines.go\",\n        \"api_op_DescribePatchGroupState.go\",\n        \"api_op_DescribePatchGroups.go\",\n        \"api_op_DescribePatchProperties.go\",\n        \"api_op_DescribeSessions.go\",\n        \"api_op_DisassociateOpsItemRelatedItem.go\",\n        \"api_op_GetAutomationExecution.go\",\n        \"api_op_GetCalendarState.go\",\n        \"api_op_GetCommandInvocation.go\",\n        \"api_op_GetConnectionStatus.go\",\n        \"api_op_GetDefaultPatchBaseline.go\",\n        \"api_op_GetDeployablePatchSnapshotForInstance.go\",\n        \"api_op_GetDocument.go\",\n        \"api_op_GetInventory.go\",\n        \"api_op_GetInventorySchema.go\",\n        \"api_op_GetMaintenanceWindow.go\",\n        \"api_op_GetMaintenanceWindowExecution.go\",\n        \"api_op_GetMaintenanceWindowExecutionTask.go\",\n        \"api_op_GetMaintenanceWindowExecutionTaskInvocation.go\",\n        \"api_op_GetMaintenanceWindowTask.go\",\n        \"api_op_GetOpsItem.go\",\n        \"api_op_GetOpsMetadata.go\",\n        \"api_op_GetOpsSummary.go\",\n        \"api_op_GetParameter.go\",\n        \"api_op_GetParameterHistory.go\",\n        \"api_op_GetParameters.go\",\n        \"api_op_GetParametersByPath.go\",\n        \"api_op_GetPatchBaseline.go\",\n        \"api_op_GetPatchBaselineForPatchGroup.go\",\n        \"api_op_GetResourcePolicies.go\",\n        \"api_op_GetServiceSetting.go\",\n        \"api_op_LabelParameterVersion.go\",\n        \"api_op_ListAssociationVersions.go\",\n        \"api_op_ListAssociations.go\",\n        \"api_op_ListCommandInvocations.go\",\n        \"api_op_ListCommands.go\",\n        \"api_op_ListComplianceItems.go\",\n        \"api_op_ListComplianceSummaries.go\",\n        \"api_op_ListDocumentMetadataHistory.go\",\n        \"api_op_ListDocumentVersions.go\",\n        \"api_op_ListDocuments.go\",\n        \"api_op_ListInventoryEntries.go\",\n        \"api_op_ListOpsItemEvents.go\",\n        \"api_op_ListOpsItemRelatedItems.go\",\n        \"api_op_ListOpsMetadata.go\",\n        \"api_op_ListResourceComplianceSummaries.go\",\n        \"api_op_ListResourceDataSync.go\",\n        \"api_op_ListTagsForResource.go\",\n        \"api_op_ModifyDocumentPermission.go\",\n        \"api_op_PutComplianceItems.go\",\n        \"api_op_PutInventory.go\",\n        \"api_op_PutParameter.go\",\n        \"api_op_PutResourcePolicy.go\",\n        \"api_op_RegisterDefaultPatchBaseline.go\",\n        \"api_op_RegisterPatchBaselineForPatchGroup.go\",\n        \"api_op_RegisterTargetWithMaintenanceWindow.go\",\n        \"api_op_RegisterTaskWithMaintenanceWindow.go\",\n        \"api_op_RemoveTagsFromResource.go\",\n        \"api_op_ResetServiceSetting.go\",\n        \"api_op_ResumeSession.go\",\n        \"api_op_SendAutomationSignal.go\",\n        \"api_op_SendCommand.go\",\n        \"api_op_StartAssociationsOnce.go\",\n        \"api_op_StartAutomationExecution.go\",\n        \"api_op_StartChangeRequestExecution.go\",\n        \"api_op_StartSession.go\",\n        \"api_op_StopAutomationExecution.go\",\n        \"api_op_TerminateSession.go\",\n        \"api_op_UnlabelParameterVersion.go\",\n        \"api_op_UpdateAssociation.go\",\n        \"api_op_UpdateAssociationStatus.go\",\n        \"api_op_UpdateDocument.go\",\n        \"api_op_UpdateDocumentDefaultVersion.go\",\n        \"api_op_UpdateDocumentMetadata.go\",\n        \"api_op_UpdateMaintenanceWindow.go\",\n        \"api_op_UpdateMaintenanceWindowTarget.go\",\n        \"api_op_UpdateMaintenanceWindowTask.go\",\n        \"api_op_UpdateManagedInstanceRole.go\",\n        \"api_op_UpdateOpsItem.go\",\n        \"api_op_UpdateOpsMetadata.go\",\n        \"api_op_UpdatePatchBaseline.go\",\n        \"api_op_UpdateResourceDataSync.go\",\n        \"api_op_UpdateServiceSetting.go\",\n        \"auth.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"endpoints_config_test.go\",\n        \"endpoints_test.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"options.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"types/enums.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/ssm\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage ssm\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.44.7\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver SSM endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsIsoF  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoF:  regexp.MustCompile(\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"af-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"ca-central-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.ca-central-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"ca-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.ca-west-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-ca-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.ca-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-ca-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.ca-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"il-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.us-east-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.us-east-2.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.us-west-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm-fips.us-west-2.amazonaws.com\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-isob-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-f\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoF,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"ssm.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"fips-us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"ssm.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm.us-gov-east-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"ssm.us-gov-west-1.amazonaws.com\",\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/options.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n)\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// The optional application specific identifier appended to the User-Agent header.\n\tAppID string\n\n\t// This endpoint will be given as input to an EndpointResolverV2. It is used for\n\t// providing a custom base endpoint that is subject to modifications by the\n\t// processing EndpointResolverV2.\n\tBaseEndpoint *string\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\t//\n\t// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a\n\t// value for this field will likely prevent you from using any endpoint-related\n\t// service features released after the introduction of EndpointResolverV2 and\n\t// BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom\n\t// endpoint, set the client option BaseEndpoint instead.\n\tEndpointResolver EndpointResolver\n\n\t// Resolves the endpoint used for a particular service operation. This should be\n\t// used over the deprecated EndpointResolver.\n\tEndpointResolverV2 EndpointResolverV2\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// Provides idempotency tokens values that will be automatically populated into\n\t// idempotent API operations.\n\tIdempotencyTokenProvider IdempotencyTokenProvider\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts. If specified in an operation call's\n\t// functional options with a value that is different than the constructed client's\n\t// Options, the Client's Retryer will be wrapped to use the operation's specific\n\t// RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified. When creating a new API Clients this\n\t// member will only be used if the Retryer Options member is nil. This value will\n\t// be ignored if Retryer is not nil. Currently does not support per operation call\n\t// overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time. Currently does not support per operation call\n\t// overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// The auth scheme resolver which determines how to authenticate for each\n\t// operation.\n\tAuthSchemeResolver AuthSchemeResolver\n\n\t// The list of auth schemes supported by the client.\n\tAuthSchemes []smithyhttp.AuthScheme\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\n\nfunc (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {\n\tif schemeID == \"aws.auth#sigv4\" {\n\t\treturn getSigV4IdentityResolver(o)\n\t}\n\tif schemeID == \"smithy.api#noAuth\" {\n\t\treturn &smithyauth.AnonymousIdentityResolver{}\n\t}\n\treturn nil\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for\n// this field will likely prevent you from using any endpoint-related service\n// features released after the introduction of EndpointResolverV2 and BaseEndpoint.\n// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n// the client option BaseEndpoint instead.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\n// WithEndpointResolverV2 returns a functional option for setting the Client's\n// EndpointResolverV2 option.\nfunc WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolverV2 = v\n\t}\n}\n\nfunc getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {\n\tif o.Credentials != nil {\n\t\treturn &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}\n\t}\n\treturn nil\n}\n\n// WithSigV4SigningName applies an override to the authentication workflow to\n// use the given signing name for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing name from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningName(name string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningName\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\n// WithSigV4SigningRegion applies an override to the authentication workflow to\n// use the given signing region for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing region from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningRegion(region string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningRegion\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\nfunc ignoreAnonymousAuth(options *Options) {\n\tif aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {\n\t\toptions.Credentials = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\tsmithyjson \"github.com/aws/smithy-go/encoding/json\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"path\"\n)\n\ntype awsAwsjson11_serializeOpAddTagsToResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpAddTagsToResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpAddTagsToResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*AddTagsToResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.AddTagsToResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentAddTagsToResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpAssociateOpsItemRelatedItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpAssociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpAssociateOpsItemRelatedItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*AssociateOpsItemRelatedItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.AssociateOpsItemRelatedItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentAssociateOpsItemRelatedItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCancelCommand struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCancelCommand) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCancelCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CancelCommandInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CancelCommand\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCancelCommandInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCancelMaintenanceWindowExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCancelMaintenanceWindowExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCancelMaintenanceWindowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CancelMaintenanceWindowExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CancelMaintenanceWindowExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCancelMaintenanceWindowExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateActivation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateActivation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateActivation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateActivationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateActivation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateActivationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateAssociation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateAssociation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateAssociationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateAssociation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateAssociationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateAssociationBatch struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateAssociationBatch) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateAssociationBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateAssociationBatchInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateAssociationBatch\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateAssociationBatchInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateDocument struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateDocument) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateDocumentInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateDocument\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateDocumentInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateOpsItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateOpsItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateOpsItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateOpsItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateOpsItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateOpsItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateOpsMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateOpsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateOpsMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateOpsMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateOpsMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreatePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreatePatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreatePatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreatePatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreatePatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreatePatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpCreateResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_serializeOpCreateResourceDataSync) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpCreateResourceDataSync) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateResourceDataSyncInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.CreateResourceDataSync\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentCreateResourceDataSyncInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteActivation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteActivation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteActivation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteActivationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteActivation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteActivationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteAssociation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteAssociation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteAssociationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteAssociation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteAssociationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteDocument struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteDocument) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteDocumentInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteDocument\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteDocumentInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteInventory struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteInventory) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteInventory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteInventoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteInventory\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteInventoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteOpsItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteOpsItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteOpsItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteOpsItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteOpsItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteOpsMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteOpsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteOpsMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteOpsMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteOpsMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteParameter struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteParameter) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteParameter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteParameterInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteParameter\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteParameterInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteParameters struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteParameters) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteParametersInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteParameters\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteParametersInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeletePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeletePatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeletePatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeletePatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeletePatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeletePatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteResourceDataSync) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteResourceDataSync) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteResourceDataSyncInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteResourceDataSync\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteResourceDataSyncInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeleteResourcePolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeleteResourcePolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeleteResourcePolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeregisterManagedInstance struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeregisterManagedInstance) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeregisterManagedInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeregisterManagedInstanceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeregisterManagedInstance\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeregisterManagedInstanceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeregisterPatchBaselineForPatchGroupInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeregisterPatchBaselineForPatchGroup\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeregisterPatchBaselineForPatchGroupInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeregisterTargetFromMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeregisterTargetFromMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeregisterTargetFromMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DeregisterTaskFromMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DeregisterTaskFromMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDeregisterTaskFromMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeActivations struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeActivations) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeActivations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeActivationsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeActivations\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeActivationsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAssociation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAssociation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAssociationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAssociation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAssociationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAssociationExecutions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAssociationExecutions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAssociationExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAssociationExecutionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAssociationExecutions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAssociationExecutionTargets struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAssociationExecutionTargets) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAssociationExecutionTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAssociationExecutionTargetsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAssociationExecutionTargets\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionTargetsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAutomationExecutions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAutomationExecutions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAutomationExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAutomationExecutionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAutomationExecutions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAutomationExecutionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAutomationStepExecutions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAutomationStepExecutions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAutomationStepExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAutomationStepExecutionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAutomationStepExecutions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAutomationStepExecutionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeAvailablePatches struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeAvailablePatches) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeAvailablePatches) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeAvailablePatchesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeAvailablePatches\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeAvailablePatchesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeDocument struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeDocument) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeDocumentInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeDocument\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeDocumentInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeDocumentPermission struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeDocumentPermission) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeDocumentPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeDocumentPermissionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeDocumentPermission\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeDocumentPermissionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeEffectiveInstanceAssociationsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeEffectiveInstanceAssociations\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeEffectiveInstanceAssociationsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeEffectivePatchesForPatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeEffectivePatchesForPatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeEffectivePatchesForPatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInstanceAssociationsStatusInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInstanceAssociationsStatus\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInstanceAssociationsStatusInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInstanceInformation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInstanceInformation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInstanceInformation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInstanceInformationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInstanceInformation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInstanceInformationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInstancePatches struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInstancePatches) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInstancePatches) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInstancePatchesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInstancePatches\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInstancePatchesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInstancePatchStates struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInstancePatchStates) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInstancePatchStates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInstancePatchStatesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInstancePatchStates\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInstancePatchStatesForPatchGroupInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInstancePatchStatesForPatchGroup\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesForPatchGroupInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeInventoryDeletions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeInventoryDeletions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeInventoryDeletions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeInventoryDeletionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeInventoryDeletions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeInventoryDeletionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowExecutions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionTaskInvocationsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTaskInvocationsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionTasksInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowExecutionTasks\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTasksInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindows struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindows) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindows) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindows\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowScheduleInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowSchedule\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowScheduleInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowsForTargetInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowsForTarget\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsForTargetInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowTargetsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowTargets\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTargetsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowTasksInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeMaintenanceWindowTasks\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTasksInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeOpsItems struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeOpsItems) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeOpsItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeOpsItemsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeOpsItems\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeOpsItemsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeParameters struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeParameters) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeParametersInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeParameters\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeParametersInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribePatchBaselines struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribePatchBaselines) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribePatchBaselines) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribePatchBaselinesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribePatchBaselines\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribePatchBaselinesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribePatchGroups struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribePatchGroups) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribePatchGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribePatchGroupsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribePatchGroups\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribePatchGroupsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribePatchGroupState struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribePatchGroupState) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribePatchGroupState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribePatchGroupStateInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribePatchGroupState\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribePatchGroupStateInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribePatchProperties struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribePatchProperties) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribePatchProperties) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribePatchPropertiesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribePatchProperties\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribePatchPropertiesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDescribeSessions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDescribeSessions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDescribeSessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DescribeSessionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DescribeSessions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDescribeSessionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DisassociateOpsItemRelatedItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.DisassociateOpsItemRelatedItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentDisassociateOpsItemRelatedItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetAutomationExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetAutomationExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetAutomationExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetAutomationExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetAutomationExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetCalendarState struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetCalendarState) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetCalendarState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetCalendarStateInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetCalendarState\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetCalendarStateInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetCommandInvocation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetCommandInvocation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetCommandInvocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetCommandInvocationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetCommandInvocation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetCommandInvocationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetConnectionStatus struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetConnectionStatus) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetConnectionStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetConnectionStatusInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetConnectionStatus\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetConnectionStatusInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetDefaultPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetDefaultPatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetDefaultPatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetDefaultPatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetDefaultPatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetDefaultPatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetDeployablePatchSnapshotForInstanceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetDeployablePatchSnapshotForInstance\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetDeployablePatchSnapshotForInstanceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetDocument struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetDocument) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetDocumentInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetDocument\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetDocumentInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetInventory struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetInventory) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetInventory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetInventoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetInventory\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetInventoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetInventorySchema struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetInventorySchema) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetInventorySchema) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetInventorySchemaInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetInventorySchema\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetInventorySchemaInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetMaintenanceWindowExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetMaintenanceWindowExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetMaintenanceWindowExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionTaskInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetMaintenanceWindowExecutionTask\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionTaskInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionTaskInvocationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionTaskInvocationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetMaintenanceWindowTask struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetMaintenanceWindowTask) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetMaintenanceWindowTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowTaskInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetMaintenanceWindowTask\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetMaintenanceWindowTaskInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetOpsItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetOpsItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetOpsItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetOpsItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetOpsItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetOpsItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetOpsMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetOpsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetOpsMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetOpsMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetOpsMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetOpsSummary struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetOpsSummary) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetOpsSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetOpsSummaryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetOpsSummary\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetOpsSummaryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetParameter struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetParameter) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetParameter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetParameterInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetParameter\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetParameterInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetParameterHistory struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetParameterHistory) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetParameterHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetParameterHistoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetParameterHistory\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetParameterHistoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetParameters struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetParameters) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetParametersInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetParameters\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetParametersInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetParametersByPath struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetParametersByPath) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetParametersByPath) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetParametersByPathInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetParametersByPath\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetParametersByPathInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetPatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetPatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetPatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetPatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetPatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetPatchBaselineForPatchGroupInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetPatchBaselineForPatchGroup\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetPatchBaselineForPatchGroupInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetResourcePolicies struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetResourcePolicies) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetResourcePoliciesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetResourcePolicies\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetResourcePoliciesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpGetServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_serializeOpGetServiceSetting) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpGetServiceSetting) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetServiceSettingInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.GetServiceSetting\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentGetServiceSettingInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpLabelParameterVersion struct {\n}\n\nfunc (*awsAwsjson11_serializeOpLabelParameterVersion) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpLabelParameterVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*LabelParameterVersionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.LabelParameterVersion\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentLabelParameterVersionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListAssociations struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListAssociations) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListAssociationsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListAssociations\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListAssociationsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListAssociationVersions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListAssociationVersions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListAssociationVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListAssociationVersionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListAssociationVersions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListAssociationVersionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListCommandInvocations struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListCommandInvocations) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListCommandInvocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListCommandInvocationsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListCommandInvocations\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListCommandInvocationsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListCommands struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListCommands) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListCommands) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListCommandsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListCommands\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListCommandsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListComplianceItems struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListComplianceItems) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListComplianceItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListComplianceItemsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListComplianceItems\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListComplianceItemsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListComplianceSummaries struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListComplianceSummaries) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListComplianceSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListComplianceSummariesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListComplianceSummaries\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListComplianceSummariesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListDocumentMetadataHistory struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListDocumentMetadataHistory) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListDocumentMetadataHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListDocumentMetadataHistoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListDocumentMetadataHistory\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListDocumentMetadataHistoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListDocuments struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListDocuments) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListDocuments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListDocumentsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListDocuments\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListDocumentsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListDocumentVersions struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListDocumentVersions) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListDocumentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListDocumentVersionsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListDocumentVersions\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListDocumentVersionsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListInventoryEntries struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListInventoryEntries) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListInventoryEntries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListInventoryEntriesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListInventoryEntries\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListInventoryEntriesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListOpsItemEvents struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListOpsItemEvents) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListOpsItemEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListOpsItemEventsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListOpsItemEvents\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListOpsItemRelatedItems struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListOpsItemRelatedItems) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListOpsItemRelatedItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListOpsItemRelatedItemsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListOpsItemRelatedItems\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListOpsItemRelatedItemsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListOpsMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListOpsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListOpsMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListOpsMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListOpsMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListResourceComplianceSummaries struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListResourceComplianceSummaries) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListResourceComplianceSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListResourceComplianceSummariesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListResourceComplianceSummaries\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListResourceComplianceSummariesInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListResourceDataSync) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListResourceDataSync) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListResourceDataSyncInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListResourceDataSync\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListResourceDataSyncInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpListTagsForResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpListTagsForResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ListTagsForResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpModifyDocumentPermission struct {\n}\n\nfunc (*awsAwsjson11_serializeOpModifyDocumentPermission) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpModifyDocumentPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ModifyDocumentPermissionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ModifyDocumentPermission\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentModifyDocumentPermissionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutComplianceItems struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutComplianceItems) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutComplianceItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutComplianceItemsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.PutComplianceItems\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutComplianceItemsInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutInventory struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutInventory) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutInventory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutInventoryInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.PutInventory\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutInventoryInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutParameter struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutParameter) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutParameter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutParameterInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.PutParameter\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutParameterInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpPutResourcePolicy struct {\n}\n\nfunc (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*PutResourcePolicyInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.PutResourcePolicy\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpRegisterDefaultPatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpRegisterDefaultPatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpRegisterDefaultPatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterDefaultPatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.RegisterDefaultPatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentRegisterDefaultPatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterPatchBaselineForPatchGroupInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.RegisterPatchBaselineForPatchGroup\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentRegisterPatchBaselineForPatchGroupInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterTargetWithMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.RegisterTargetWithMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentRegisterTargetWithMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterTaskWithMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.RegisterTaskWithMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentRegisterTaskWithMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpRemoveTagsFromResource struct {\n}\n\nfunc (*awsAwsjson11_serializeOpRemoveTagsFromResource) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpRemoveTagsFromResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RemoveTagsFromResourceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.RemoveTagsFromResource\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentRemoveTagsFromResourceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpResetServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_serializeOpResetServiceSetting) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpResetServiceSetting) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ResetServiceSettingInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ResetServiceSetting\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentResetServiceSettingInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpResumeSession struct {\n}\n\nfunc (*awsAwsjson11_serializeOpResumeSession) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpResumeSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ResumeSessionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.ResumeSession\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentResumeSessionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpSendAutomationSignal struct {\n}\n\nfunc (*awsAwsjson11_serializeOpSendAutomationSignal) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpSendAutomationSignal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*SendAutomationSignalInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.SendAutomationSignal\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentSendAutomationSignalInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpSendCommand struct {\n}\n\nfunc (*awsAwsjson11_serializeOpSendCommand) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpSendCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*SendCommandInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.SendCommand\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentSendCommandInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartAssociationsOnce struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartAssociationsOnce) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartAssociationsOnce) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartAssociationsOnceInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.StartAssociationsOnce\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartAssociationsOnceInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartAutomationExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartAutomationExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartAutomationExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.StartAutomationExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartAutomationExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartChangeRequestExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartChangeRequestExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartChangeRequestExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartChangeRequestExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.StartChangeRequestExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStartSession struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStartSession) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStartSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartSessionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.StartSession\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStartSessionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpStopAutomationExecution struct {\n}\n\nfunc (*awsAwsjson11_serializeOpStopAutomationExecution) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpStopAutomationExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StopAutomationExecutionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.StopAutomationExecution\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentStopAutomationExecutionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpTerminateSession struct {\n}\n\nfunc (*awsAwsjson11_serializeOpTerminateSession) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpTerminateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*TerminateSessionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.TerminateSession\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentTerminateSessionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUnlabelParameterVersion struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUnlabelParameterVersion) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUnlabelParameterVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UnlabelParameterVersionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UnlabelParameterVersion\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUnlabelParameterVersionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateAssociation struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateAssociation) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateAssociationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateAssociation\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateAssociationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateAssociationStatus struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateAssociationStatus) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateAssociationStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateAssociationStatusInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateAssociationStatus\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateAssociationStatusInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateDocument struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateDocument) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateDocumentInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateDocument\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateDocumentInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateDocumentDefaultVersion struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateDocumentDefaultVersion) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateDocumentDefaultVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateDocumentDefaultVersionInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateDocumentDefaultVersion\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateDocumentDefaultVersionInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateDocumentMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateDocumentMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateDocumentMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateDocumentMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateDocumentMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateDocumentMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateMaintenanceWindow struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateMaintenanceWindow) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateMaintenanceWindow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateMaintenanceWindow\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowTargetInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateMaintenanceWindowTarget\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTargetInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateMaintenanceWindowTask struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateMaintenanceWindowTask) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateMaintenanceWindowTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowTaskInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateMaintenanceWindowTask\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTaskInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateManagedInstanceRole struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateManagedInstanceRole) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateManagedInstanceRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateManagedInstanceRoleInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateManagedInstanceRole\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateManagedInstanceRoleInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateOpsItem struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateOpsItem) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateOpsItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateOpsItemInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateOpsItem\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateOpsItemInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateOpsMetadata struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateOpsMetadata) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateOpsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateOpsMetadataInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateOpsMetadata\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateOpsMetadataInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdatePatchBaseline struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdatePatchBaseline) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdatePatchBaseline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdatePatchBaselineInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdatePatchBaseline\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdatePatchBaselineInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateResourceDataSync struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateResourceDataSync) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateResourceDataSync) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateResourceDataSyncInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateResourceDataSync\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateResourceDataSyncInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsjson11_serializeOpUpdateServiceSetting struct {\n}\n\nfunc (*awsAwsjson11_serializeOpUpdateServiceSetting) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsjson11_serializeOpUpdateServiceSetting) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*UpdateServiceSettingInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-amz-json-1.1\")\n\thttpBindingEncoder.SetHeader(\"X-Amz-Target\").String(\"AmazonSSM.UpdateServiceSetting\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsAwsjson11_serializeOpDocumentUpdateServiceSettingInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsAwsjson11_serializeDocumentAccountIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAccounts(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAlarm(v *types.Alarm, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAlarmConfiguration(v *types.AlarmConfiguration, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Alarms != nil {\n\t\tok := object.Key(\"Alarms\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmList(v.Alarms, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.IgnorePollAlarmFailure {\n\t\tok := object.Key(\"IgnorePollAlarmFailure\")\n\t\tok.Boolean(v.IgnorePollAlarmFailure)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAlarmList(v []types.Alarm, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAlarm(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationExecutionFilter(v *types.AssociationExecutionFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationExecutionFilterList(v []types.AssociationExecutionFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAssociationExecutionFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationExecutionTargetsFilter(v *types.AssociationExecutionTargetsFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationExecutionTargetsFilterList(v []types.AssociationExecutionTargetsFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAssociationExecutionTargetsFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationFilter(v *types.AssociationFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationFilterList(v []types.AssociationFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAssociationFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAssociationStatus(v *types.AssociationStatus, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AdditionalInfo != nil {\n\t\tok := object.Key(\"AdditionalInfo\")\n\t\tok.String(*v.AdditionalInfo)\n\t}\n\n\tif v.Date != nil {\n\t\tok := object.Key(\"Date\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.Date))\n\t}\n\n\tif v.Message != nil {\n\t\tok := object.Key(\"Message\")\n\t\tok.String(*v.Message)\n\t}\n\n\tif len(v.Name) > 0 {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(string(v.Name))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAttachmentsSource(v *types.AttachmentsSource, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentAttachmentsSourceValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAttachmentsSourceList(v []types.AttachmentsSource, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAttachmentsSource(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAttachmentsSourceValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAutomationExecutionFilter(v *types.AutomationExecutionFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationExecutionFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAutomationExecutionFilterList(v []types.AutomationExecutionFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentAutomationExecutionFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAutomationExecutionFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAutomationParameterMap(v map[string][]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tif vv := v[key]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterValueList(v[key], om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentAutomationParameterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentBaselineOverride(v *types.BaselineOverride, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ApprovalRules != nil {\n\t\tok := object.Key(\"ApprovalRules\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchRuleGroup(v.ApprovalRules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApprovedPatches != nil {\n\t\tok := object.Key(\"ApprovedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.ApprovedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ApprovedPatchesComplianceLevel) > 0 {\n\t\tok := object.Key(\"ApprovedPatchesComplianceLevel\")\n\t\tok.String(string(v.ApprovedPatchesComplianceLevel))\n\t}\n\n\tif v.ApprovedPatchesEnableNonSecurity {\n\t\tok := object.Key(\"ApprovedPatchesEnableNonSecurity\")\n\t\tok.Boolean(v.ApprovedPatchesEnableNonSecurity)\n\t}\n\n\tif v.GlobalFilters != nil {\n\t\tok := object.Key(\"GlobalFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterGroup(v.GlobalFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.OperatingSystem) > 0 {\n\t\tok := object.Key(\"OperatingSystem\")\n\t\tok.String(string(v.OperatingSystem))\n\t}\n\n\tif v.RejectedPatches != nil {\n\t\tok := object.Key(\"RejectedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.RejectedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.RejectedPatchesAction) > 0 {\n\t\tok := object.Key(\"RejectedPatchesAction\")\n\t\tok.String(string(v.RejectedPatchesAction))\n\t}\n\n\tif v.Sources != nil {\n\t\tok := object.Key(\"Sources\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchSourceList(v.Sources, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCalendarNameOrARNList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCloudWatchOutputConfig(v *types.CloudWatchOutputConfig, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CloudWatchLogGroupName != nil {\n\t\tok := object.Key(\"CloudWatchLogGroupName\")\n\t\tok.String(*v.CloudWatchLogGroupName)\n\t}\n\n\tif v.CloudWatchOutputEnabled {\n\t\tok := object.Key(\"CloudWatchOutputEnabled\")\n\t\tok.Boolean(v.CloudWatchOutputEnabled)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCommandFilter(v *types.CommandFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCommandFilterList(v []types.CommandFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentCommandFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceExecutionSummary(v *types.ComplianceExecutionSummary, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ExecutionId != nil {\n\t\tok := object.Key(\"ExecutionId\")\n\t\tok.String(*v.ExecutionId)\n\t}\n\n\tif v.ExecutionTime != nil {\n\t\tok := object.Key(\"ExecutionTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ExecutionTime))\n\t}\n\n\tif v.ExecutionType != nil {\n\t\tok := object.Key(\"ExecutionType\")\n\t\tok.String(*v.ExecutionType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceItemDetails(v map[string]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tom.String(v[key])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceItemEntry(v *types.ComplianceItemEntry, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Details != nil {\n\t\tok := object.Key(\"Details\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceItemDetails(v.Details, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Id != nil {\n\t\tok := object.Key(\"Id\")\n\t\tok.String(*v.Id)\n\t}\n\n\tif len(v.Severity) > 0 {\n\t\tok := object.Key(\"Severity\")\n\t\tok.String(string(v.Severity))\n\t}\n\n\tif len(v.Status) > 0 {\n\t\tok := object.Key(\"Status\")\n\t\tok.String(string(v.Status))\n\t}\n\n\tif v.Title != nil {\n\t\tok := object.Key(\"Title\")\n\t\tok.String(*v.Title)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceItemEntryList(v []types.ComplianceItemEntry, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentComplianceItemEntry(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceResourceIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceResourceTypeList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceStringFilter(v *types.ComplianceStringFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceStringFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceStringFilterList(v []types.ComplianceStringFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentComplianceStringFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentComplianceStringFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntries(v []types.CreateAssociationBatchRequestEntry, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.CreateAssociationBatchRequestEntry, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApplyOnlyAtCronInterval {\n\t\tok := object.Key(\"ApplyOnlyAtCronInterval\")\n\t\tok.Boolean(v.ApplyOnlyAtCronInterval)\n\t}\n\n\tif v.AssociationName != nil {\n\t\tok := object.Key(\"AssociationName\")\n\t\tok.String(*v.AssociationName)\n\t}\n\n\tif v.AutomationTargetParameterName != nil {\n\t\tok := object.Key(\"AutomationTargetParameterName\")\n\t\tok.String(*v.AutomationTargetParameterName)\n\t}\n\n\tif v.CalendarNames != nil {\n\t\tok := object.Key(\"CalendarNames\")\n\t\tif err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ComplianceSeverity) > 0 {\n\t\tok := object.Key(\"ComplianceSeverity\")\n\t\tok.String(string(v.ComplianceSeverity))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.OutputLocation != nil {\n\t\tok := object.Key(\"OutputLocation\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v.OutputLocation, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ScheduleExpression != nil {\n\t\tok := object.Key(\"ScheduleExpression\")\n\t\tok.String(*v.ScheduleExpression)\n\t}\n\n\tif v.ScheduleOffset != nil {\n\t\tok := object.Key(\"ScheduleOffset\")\n\t\tok.Integer(*v.ScheduleOffset)\n\t}\n\n\tif len(v.SyncCompliance) > 0 {\n\t\tok := object.Key(\"SyncCompliance\")\n\t\tok.String(string(v.SyncCompliance))\n\t}\n\n\tif v.TargetLocations != nil {\n\t\tok := object.Key(\"TargetLocations\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetMaps != nil {\n\t\tok := object.Key(\"TargetMaps\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDescribeActivationsFilter(v *types.DescribeActivationsFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.FilterKey) > 0 {\n\t\tok := object.Key(\"FilterKey\")\n\t\tok.String(string(v.FilterKey))\n\t}\n\n\tif v.FilterValues != nil {\n\t\tok := object.Key(\"FilterValues\")\n\t\tif err := awsAwsjson11_serializeDocumentStringList(v.FilterValues, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDescribeActivationsFilterList(v []types.DescribeActivationsFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentDescribeActivationsFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentFilter(v *types.DocumentFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentFilterList(v []types.DocumentFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentDocumentFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentKeyValuesFilter(v *types.DocumentKeyValuesFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentKeyValuesFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentKeyValuesFilterList(v []types.DocumentKeyValuesFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentDocumentKeyValuesFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentKeyValuesFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentRequires(v *types.DocumentRequires, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.RequireType != nil {\n\t\tok := object.Key(\"RequireType\")\n\t\tok.String(*v.RequireType)\n\t}\n\n\tif v.Version != nil {\n\t\tok := object.Key(\"Version\")\n\t\tok.String(*v.Version)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentRequiresList(v []types.DocumentRequires, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentDocumentRequires(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentReviewCommentList(v []types.DocumentReviewCommentSource, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentDocumentReviewCommentSource(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentReviewCommentSource(v *types.DocumentReviewCommentSource, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Content != nil {\n\t\tok := object.Key(\"Content\")\n\t\tok.String(*v.Content)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentDocumentReviews(v *types.DocumentReviews, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Action) > 0 {\n\t\tok := object.Key(\"Action\")\n\t\tok.String(string(v.Action))\n\t}\n\n\tif v.Comment != nil {\n\t\tok := object.Key(\"Comment\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentReviewCommentList(v.Comment, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v *types.InstanceAssociationOutputLocation, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.S3Location != nil {\n\t\tok := object.Key(\"S3Location\")\n\t\tif err := awsAwsjson11_serializeDocumentS3OutputLocation(v.S3Location, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceInformationFilter(v *types.InstanceInformationFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.ValueSet != nil {\n\t\tok := object.Key(\"valueSet\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationFilterValueSet(v.ValueSet, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceInformationFilterList(v []types.InstanceInformationFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceInformationFilterValueSet(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceInformationStringFilter(v *types.InstanceInformationStringFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationFilterValueSet(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstanceInformationStringFilterList(v []types.InstanceInformationStringFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationStringFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstancePatchStateFilter(v *types.InstancePatchStateFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentInstancePatchStateFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstancePatchStateFilterList(v []types.InstancePatchStateFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInstancePatchStateFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInstancePatchStateFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryAggregator(v *types.InventoryAggregator, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Aggregators != nil {\n\t\tok := object.Key(\"Aggregators\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryAggregatorList(v.Aggregators, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Expression != nil {\n\t\tok := object.Key(\"Expression\")\n\t\tok.String(*v.Expression)\n\t}\n\n\tif v.Groups != nil {\n\t\tok := object.Key(\"Groups\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryGroupList(v.Groups, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryAggregatorList(v []types.InventoryAggregator, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInventoryAggregator(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryFilter(v *types.InventoryFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryFilterList(v []types.InventoryFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInventoryFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryGroup(v *types.InventoryGroup, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryGroupList(v []types.InventoryGroup, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInventoryGroup(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryItem(v *types.InventoryItem, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CaptureTime != nil {\n\t\tok := object.Key(\"CaptureTime\")\n\t\tok.String(*v.CaptureTime)\n\t}\n\n\tif v.Content != nil {\n\t\tok := object.Key(\"Content\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryItemEntryList(v.Content, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ContentHash != nil {\n\t\tok := object.Key(\"ContentHash\")\n\t\tok.String(*v.ContentHash)\n\t}\n\n\tif v.Context != nil {\n\t\tok := object.Key(\"Context\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryItemContentContext(v.Context, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SchemaVersion != nil {\n\t\tok := object.Key(\"SchemaVersion\")\n\t\tok.String(*v.SchemaVersion)\n\t}\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryItemContentContext(v map[string]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tom.String(v[key])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryItemEntry(v map[string]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tom.String(v[key])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryItemEntryList(v []map[string]string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif vv := v[i]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentInventoryItemEntry(v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentInventoryItemList(v []types.InventoryItem, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentInventoryItem(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentKeyList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentLoggingInfo(v *types.LoggingInfo, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.S3BucketName != nil {\n\t\tok := object.Key(\"S3BucketName\")\n\t\tok.String(*v.S3BucketName)\n\t}\n\n\tif v.S3KeyPrefix != nil {\n\t\tok := object.Key(\"S3KeyPrefix\")\n\t\tok.String(*v.S3KeyPrefix)\n\t}\n\n\tif v.S3Region != nil {\n\t\tok := object.Key(\"S3Region\")\n\t\tok.String(*v.S3Region)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowAutomationParameters(v *types.MaintenanceWindowAutomationParameters, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowFilter(v *types.MaintenanceWindowFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v []types.MaintenanceWindowFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowLambdaParameters(v *types.MaintenanceWindowLambdaParameters, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientContext != nil {\n\t\tok := object.Key(\"ClientContext\")\n\t\tok.String(*v.ClientContext)\n\t}\n\n\tif v.Payload != nil {\n\t\tok := object.Key(\"Payload\")\n\t\tok.Base64EncodeBytes(v.Payload)\n\t}\n\n\tif v.Qualifier != nil {\n\t\tok := object.Key(\"Qualifier\")\n\t\tok.String(*v.Qualifier)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowRunCommandParameters(v *types.MaintenanceWindowRunCommandParameters, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CloudWatchOutputConfig != nil {\n\t\tok := object.Key(\"CloudWatchOutputConfig\")\n\t\tif err := awsAwsjson11_serializeDocumentCloudWatchOutputConfig(v.CloudWatchOutputConfig, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Comment != nil {\n\t\tok := object.Key(\"Comment\")\n\t\tok.String(*v.Comment)\n\t}\n\n\tif v.DocumentHash != nil {\n\t\tok := object.Key(\"DocumentHash\")\n\t\tok.String(*v.DocumentHash)\n\t}\n\n\tif len(v.DocumentHashType) > 0 {\n\t\tok := object.Key(\"DocumentHashType\")\n\t\tok.String(string(v.DocumentHashType))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.NotificationConfig != nil {\n\t\tok := object.Key(\"NotificationConfig\")\n\t\tif err := awsAwsjson11_serializeDocumentNotificationConfig(v.NotificationConfig, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OutputS3BucketName != nil {\n\t\tok := object.Key(\"OutputS3BucketName\")\n\t\tok.String(*v.OutputS3BucketName)\n\t}\n\n\tif v.OutputS3KeyPrefix != nil {\n\t\tok := object.Key(\"OutputS3KeyPrefix\")\n\t\tok.String(*v.OutputS3KeyPrefix)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ServiceRoleArn != nil {\n\t\tok := object.Key(\"ServiceRoleArn\")\n\t\tok.String(*v.ServiceRoleArn)\n\t}\n\n\tif v.TimeoutSeconds != nil {\n\t\tok := object.Key(\"TimeoutSeconds\")\n\t\tok.Integer(*v.TimeoutSeconds)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowStepFunctionsParameters(v *types.MaintenanceWindowStepFunctionsParameters, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Input != nil {\n\t\tok := object.Key(\"Input\")\n\t\tok.String(*v.Input)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowTaskInvocationParameters(v *types.MaintenanceWindowTaskInvocationParameters, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Automation != nil {\n\t\tok := object.Key(\"Automation\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowAutomationParameters(v.Automation, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Lambda != nil {\n\t\tok := object.Key(\"Lambda\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowLambdaParameters(v.Lambda, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RunCommand != nil {\n\t\tok := object.Key(\"RunCommand\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowRunCommandParameters(v.RunCommand, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.StepFunctions != nil {\n\t\tok := object.Key(\"StepFunctions\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowStepFunctionsParameters(v.StepFunctions, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameters(v map[string]types.MaintenanceWindowTaskParameterValueExpression, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tmapVar := v[key]\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameterValueExpression(&mapVar, om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameterValueExpression(v *types.MaintenanceWindowTaskParameterValueExpression, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMetadataKeysToDeleteList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMetadataMap(v map[string]types.MetadataValue, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tmapVar := v[key]\n\t\tif err := awsAwsjson11_serializeDocumentMetadataValue(&mapVar, om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentMetadataValue(v *types.MetadataValue, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentNotificationConfig(v *types.NotificationConfig, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.NotificationArn != nil {\n\t\tok := object.Key(\"NotificationArn\")\n\t\tok.String(*v.NotificationArn)\n\t}\n\n\tif v.NotificationEvents != nil {\n\t\tok := object.Key(\"NotificationEvents\")\n\t\tif err := awsAwsjson11_serializeDocumentNotificationEventList(v.NotificationEvents, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.NotificationType) > 0 {\n\t\tok := object.Key(\"NotificationType\")\n\t\tok.String(string(v.NotificationType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentNotificationEventList(v []types.NotificationEvent, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(string(v[i]))\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsAggregator(v *types.OpsAggregator, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Aggregators != nil {\n\t\tok := object.Key(\"Aggregators\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsAggregatorList(v.Aggregators, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.AggregatorType != nil {\n\t\tok := object.Key(\"AggregatorType\")\n\t\tok.String(*v.AggregatorType)\n\t}\n\n\tif v.AttributeName != nil {\n\t\tok := object.Key(\"AttributeName\")\n\t\tok.String(*v.AttributeName)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsAggregatorValueMap(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsAggregatorList(v []types.OpsAggregator, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsAggregator(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsAggregatorValueMap(v map[string]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tom.String(v[key])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsFilter(v *types.OpsFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsFilterList(v []types.OpsFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemDataValue(v *types.OpsItemDataValue, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemEventFilter(v *types.OpsItemEventFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif len(v.Operator) > 0 {\n\t\tok := object.Key(\"Operator\")\n\t\tok.String(string(v.Operator))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemEventFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemEventFilters(v []types.OpsItemEventFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemEventFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemEventFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemFilter(v *types.OpsItemFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif len(v.Operator) > 0 {\n\t\tok := object.Key(\"Operator\")\n\t\tok.String(string(v.Operator))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemFilters(v []types.OpsItemFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemNotification(v *types.OpsItemNotification, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Arn != nil {\n\t\tok := object.Key(\"Arn\")\n\t\tok.String(*v.Arn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemNotifications(v []types.OpsItemNotification, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemNotification(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemOperationalData(v map[string]types.OpsItemDataValue, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tmapVar := v[key]\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemDataValue(&mapVar, om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemOpsDataKeysList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilter(v *types.OpsItemRelatedItemsFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif len(v.Operator) > 0 {\n\t\tok := object.Key(\"Operator\")\n\t\tok.String(string(v.Operator))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilters(v []types.OpsItemRelatedItemsFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsMetadataFilter(v *types.OpsMetadataFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsMetadataFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsMetadataFilterList(v []types.OpsMetadataFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsMetadataFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsMetadataFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsResultAttribute(v *types.OpsResultAttribute, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentOpsResultAttributeList(v []types.OpsResultAttribute, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentOpsResultAttribute(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterLabelList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterNameList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameters(v map[string][]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tif vv := v[key]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentParameterValueList(v[key], om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParametersFilter(v *types.ParametersFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentParametersFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParametersFilterList(v []types.ParametersFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentParametersFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParametersFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterStringFilter(v *types.ParameterStringFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Option != nil {\n\t\tok := object.Key(\"Option\")\n\t\tok.String(*v.Option)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterStringFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterStringFilterList(v []types.ParameterStringFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentParameterStringFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterStringFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentParameterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchFilter(v *types.PatchFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchFilterGroup(v *types.PatchFilterGroup, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.PatchFilters != nil {\n\t\tok := object.Key(\"PatchFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterList(v.PatchFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchFilterList(v []types.PatchFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchIdList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchOrchestratorFilter(v *types.PatchOrchestratorFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v []types.PatchOrchestratorFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchOrchestratorFilterValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchRule(v *types.PatchRule, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ApproveAfterDays != nil {\n\t\tok := object.Key(\"ApproveAfterDays\")\n\t\tok.Integer(*v.ApproveAfterDays)\n\t}\n\n\tif v.ApproveUntilDate != nil {\n\t\tok := object.Key(\"ApproveUntilDate\")\n\t\tok.String(*v.ApproveUntilDate)\n\t}\n\n\tif len(v.ComplianceLevel) > 0 {\n\t\tok := object.Key(\"ComplianceLevel\")\n\t\tok.String(string(v.ComplianceLevel))\n\t}\n\n\tif v.EnableNonSecurity != nil {\n\t\tok := object.Key(\"EnableNonSecurity\")\n\t\tok.Boolean(*v.EnableNonSecurity)\n\t}\n\n\tif v.PatchFilterGroup != nil {\n\t\tok := object.Key(\"PatchFilterGroup\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterGroup(v.PatchFilterGroup, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchRuleGroup(v *types.PatchRuleGroup, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.PatchRules != nil {\n\t\tok := object.Key(\"PatchRules\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchRuleList(v.PatchRules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchRuleList(v []types.PatchRule, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentPatchRule(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchSource(v *types.PatchSource, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Configuration != nil {\n\t\tok := object.Key(\"Configuration\")\n\t\tok.String(*v.Configuration)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Products != nil {\n\t\tok := object.Key(\"Products\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchSourceProductList(v.Products, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchSourceList(v []types.PatchSource, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentPatchSource(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentPatchSourceProductList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRegions(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRegistrationMetadataItem(v *types.RegistrationMetadataItem, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRegistrationMetadataList(v []types.RegistrationMetadataItem, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentRegistrationMetadataItem(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRelatedOpsItem(v *types.RelatedOpsItem, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRelatedOpsItems(v []types.RelatedOpsItem, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentRelatedOpsItem(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncAwsOrganizationsSource(v *types.ResourceDataSyncAwsOrganizationsSource, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OrganizationalUnits != nil {\n\t\tok := object.Key(\"OrganizationalUnits\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncOrganizationalUnitList(v.OrganizationalUnits, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OrganizationSourceType != nil {\n\t\tok := object.Key(\"OrganizationSourceType\")\n\t\tok.String(*v.OrganizationSourceType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncDestinationDataSharing(v *types.ResourceDataSyncDestinationDataSharing, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DestinationDataSharingType != nil {\n\t\tok := object.Key(\"DestinationDataSharingType\")\n\t\tok.String(*v.DestinationDataSharingType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncOrganizationalUnit(v *types.ResourceDataSyncOrganizationalUnit, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OrganizationalUnitId != nil {\n\t\tok := object.Key(\"OrganizationalUnitId\")\n\t\tok.String(*v.OrganizationalUnitId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncOrganizationalUnitList(v []types.ResourceDataSyncOrganizationalUnit, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncOrganizationalUnit(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncS3Destination(v *types.ResourceDataSyncS3Destination, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AWSKMSKeyARN != nil {\n\t\tok := object.Key(\"AWSKMSKeyARN\")\n\t\tok.String(*v.AWSKMSKeyARN)\n\t}\n\n\tif v.BucketName != nil {\n\t\tok := object.Key(\"BucketName\")\n\t\tok.String(*v.BucketName)\n\t}\n\n\tif v.DestinationDataSharing != nil {\n\t\tok := object.Key(\"DestinationDataSharing\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncDestinationDataSharing(v.DestinationDataSharing, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Prefix != nil {\n\t\tok := object.Key(\"Prefix\")\n\t\tok.String(*v.Prefix)\n\t}\n\n\tif v.Region != nil {\n\t\tok := object.Key(\"Region\")\n\t\tok.String(*v.Region)\n\t}\n\n\tif len(v.SyncFormat) > 0 {\n\t\tok := object.Key(\"SyncFormat\")\n\t\tok.String(string(v.SyncFormat))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncSource(v *types.ResourceDataSyncSource, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AwsOrganizationsSource != nil {\n\t\tok := object.Key(\"AwsOrganizationsSource\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncAwsOrganizationsSource(v.AwsOrganizationsSource, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.EnableAllOpsDataSources {\n\t\tok := object.Key(\"EnableAllOpsDataSources\")\n\t\tok.Boolean(v.EnableAllOpsDataSources)\n\t}\n\n\tif v.IncludeFutureRegions {\n\t\tok := object.Key(\"IncludeFutureRegions\")\n\t\tok.Boolean(v.IncludeFutureRegions)\n\t}\n\n\tif v.SourceRegions != nil {\n\t\tok := object.Key(\"SourceRegions\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncSourceRegionList(v.SourceRegions, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SourceType != nil {\n\t\tok := object.Key(\"SourceType\")\n\t\tok.String(*v.SourceType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResourceDataSyncSourceRegionList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResultAttribute(v *types.ResultAttribute, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentResultAttributeList(v []types.ResultAttribute, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentResultAttribute(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRunbook(v *types.Runbook, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentName != nil {\n\t\tok := object.Key(\"DocumentName\")\n\t\tok.String(*v.DocumentName)\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetLocations != nil {\n\t\tok := object.Key(\"TargetLocations\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetMaps != nil {\n\t\tok := object.Key(\"TargetMaps\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetParameterName != nil {\n\t\tok := object.Key(\"TargetParameterName\")\n\t\tok.String(*v.TargetParameterName)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentRunbooks(v []types.Runbook, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentRunbook(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentS3OutputLocation(v *types.S3OutputLocation, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OutputS3BucketName != nil {\n\t\tok := object.Key(\"OutputS3BucketName\")\n\t\tok.String(*v.OutputS3BucketName)\n\t}\n\n\tif v.OutputS3KeyPrefix != nil {\n\t\tok := object.Key(\"OutputS3KeyPrefix\")\n\t\tok.String(*v.OutputS3KeyPrefix)\n\t}\n\n\tif v.OutputS3Region != nil {\n\t\tok := object.Key(\"OutputS3Region\")\n\t\tok.String(*v.OutputS3Region)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentSessionFilter(v *types.SessionFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentSessionFilterList(v []types.SessionFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentSessionFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentSessionManagerParameters(v map[string][]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tif vv := v[key]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentSessionManagerParameterValueList(v[key], om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentSessionManagerParameterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentStepExecutionFilter(v *types.StepExecutionFilter, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.Key) > 0 {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(string(v.Key))\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentStepExecutionFilterValueList(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentStepExecutionFilterList(v []types.StepExecutionFilter, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentStepExecutionFilter(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentStepExecutionFilterValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentStringList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTarget(v *types.Target, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Key != nil {\n\t\tok := object.Key(\"Key\")\n\t\tok.String(*v.Key)\n\t}\n\n\tif v.Values != nil {\n\t\tok := object.Key(\"Values\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetValues(v.Values, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetLocation(v *types.TargetLocation, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Accounts != nil {\n\t\tok := object.Key(\"Accounts\")\n\t\tif err := awsAwsjson11_serializeDocumentAccounts(v.Accounts, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ExecutionRoleName != nil {\n\t\tok := object.Key(\"ExecutionRoleName\")\n\t\tok.String(*v.ExecutionRoleName)\n\t}\n\n\tif v.Regions != nil {\n\t\tok := object.Key(\"Regions\")\n\t\tif err := awsAwsjson11_serializeDocumentRegions(v.Regions, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetLocationAlarmConfiguration != nil {\n\t\tok := object.Key(\"TargetLocationAlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.TargetLocationAlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetLocationMaxConcurrency != nil {\n\t\tok := object.Key(\"TargetLocationMaxConcurrency\")\n\t\tok.String(*v.TargetLocationMaxConcurrency)\n\t}\n\n\tif v.TargetLocationMaxErrors != nil {\n\t\tok := object.Key(\"TargetLocationMaxErrors\")\n\t\tok.String(*v.TargetLocationMaxErrors)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetLocations(v []types.TargetLocation, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocation(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetMap(v map[string][]string, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tfor key := range v {\n\t\tom := object.Key(key)\n\t\tif vv := v[key]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentTargetMapValueList(v[key], om); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetMaps(v []map[string][]string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif vv := v[i]; vv == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := awsAwsjson11_serializeDocumentTargetMap(v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetMapValueList(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargets(v []types.Target, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsjson11_serializeDocumentTarget(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeDocumentTargetValues(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentAddTagsToResourceInput(v *AddTagsToResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceId != nil {\n\t\tok := object.Key(\"ResourceId\")\n\t\tok.String(*v.ResourceId)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentAssociateOpsItemRelatedItemInput(v *AssociateOpsItemRelatedItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationType != nil {\n\t\tok := object.Key(\"AssociationType\")\n\t\tok.String(*v.AssociationType)\n\t}\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\tif v.ResourceType != nil {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(*v.ResourceType)\n\t}\n\n\tif v.ResourceUri != nil {\n\t\tok := object.Key(\"ResourceUri\")\n\t\tok.String(*v.ResourceUri)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCancelCommandInput(v *CancelCommandInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CommandId != nil {\n\t\tok := object.Key(\"CommandId\")\n\t\tok.String(*v.CommandId)\n\t}\n\n\tif v.InstanceIds != nil {\n\t\tok := object.Key(\"InstanceIds\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceIdList(v.InstanceIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCancelMaintenanceWindowExecutionInput(v *CancelMaintenanceWindowExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateActivationInput(v *CreateActivationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DefaultInstanceName != nil {\n\t\tok := object.Key(\"DefaultInstanceName\")\n\t\tok.String(*v.DefaultInstanceName)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.ExpirationDate != nil {\n\t\tok := object.Key(\"ExpirationDate\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ExpirationDate))\n\t}\n\n\tif v.IamRole != nil {\n\t\tok := object.Key(\"IamRole\")\n\t\tok.String(*v.IamRole)\n\t}\n\n\tif v.RegistrationLimit != nil {\n\t\tok := object.Key(\"RegistrationLimit\")\n\t\tok.Integer(*v.RegistrationLimit)\n\t}\n\n\tif v.RegistrationMetadata != nil {\n\t\tok := object.Key(\"RegistrationMetadata\")\n\t\tif err := awsAwsjson11_serializeDocumentRegistrationMetadataList(v.RegistrationMetadata, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateAssociationBatchInput(v *CreateAssociationBatchInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Entries != nil {\n\t\tok := object.Key(\"Entries\")\n\t\tif err := awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntries(v.Entries, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApplyOnlyAtCronInterval {\n\t\tok := object.Key(\"ApplyOnlyAtCronInterval\")\n\t\tok.Boolean(v.ApplyOnlyAtCronInterval)\n\t}\n\n\tif v.AssociationName != nil {\n\t\tok := object.Key(\"AssociationName\")\n\t\tok.String(*v.AssociationName)\n\t}\n\n\tif v.AutomationTargetParameterName != nil {\n\t\tok := object.Key(\"AutomationTargetParameterName\")\n\t\tok.String(*v.AutomationTargetParameterName)\n\t}\n\n\tif v.CalendarNames != nil {\n\t\tok := object.Key(\"CalendarNames\")\n\t\tif err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ComplianceSeverity) > 0 {\n\t\tok := object.Key(\"ComplianceSeverity\")\n\t\tok.String(string(v.ComplianceSeverity))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.OutputLocation != nil {\n\t\tok := object.Key(\"OutputLocation\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v.OutputLocation, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ScheduleExpression != nil {\n\t\tok := object.Key(\"ScheduleExpression\")\n\t\tok.String(*v.ScheduleExpression)\n\t}\n\n\tif v.ScheduleOffset != nil {\n\t\tok := object.Key(\"ScheduleOffset\")\n\t\tok.Integer(*v.ScheduleOffset)\n\t}\n\n\tif len(v.SyncCompliance) > 0 {\n\t\tok := object.Key(\"SyncCompliance\")\n\t\tok.String(string(v.SyncCompliance))\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetLocations != nil {\n\t\tok := object.Key(\"TargetLocations\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetMaps != nil {\n\t\tok := object.Key(\"TargetMaps\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateDocumentInput(v *CreateDocumentInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Attachments != nil {\n\t\tok := object.Key(\"Attachments\")\n\t\tif err := awsAwsjson11_serializeDocumentAttachmentsSourceList(v.Attachments, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Content != nil {\n\t\tok := object.Key(\"Content\")\n\t\tok.String(*v.Content)\n\t}\n\n\tif v.DisplayName != nil {\n\t\tok := object.Key(\"DisplayName\")\n\t\tok.String(*v.DisplayName)\n\t}\n\n\tif len(v.DocumentFormat) > 0 {\n\t\tok := object.Key(\"DocumentFormat\")\n\t\tok.String(string(v.DocumentFormat))\n\t}\n\n\tif len(v.DocumentType) > 0 {\n\t\tok := object.Key(\"DocumentType\")\n\t\tok.String(string(v.DocumentType))\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Requires != nil {\n\t\tok := object.Key(\"Requires\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentRequiresList(v.Requires, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetType != nil {\n\t\tok := object.Key(\"TargetType\")\n\t\tok.String(*v.TargetType)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(v *CreateMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\t{\n\t\tok := object.Key(\"AllowUnassociatedTargets\")\n\t\tok.Boolean(v.AllowUnassociatedTargets)\n\t}\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\t{\n\t\tok := object.Key(\"Cutoff\")\n\t\tok.Integer(v.Cutoff)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Duration != nil {\n\t\tok := object.Key(\"Duration\")\n\t\tok.Integer(*v.Duration)\n\t}\n\n\tif v.EndDate != nil {\n\t\tok := object.Key(\"EndDate\")\n\t\tok.String(*v.EndDate)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Schedule != nil {\n\t\tok := object.Key(\"Schedule\")\n\t\tok.String(*v.Schedule)\n\t}\n\n\tif v.ScheduleOffset != nil {\n\t\tok := object.Key(\"ScheduleOffset\")\n\t\tok.Integer(*v.ScheduleOffset)\n\t}\n\n\tif v.ScheduleTimezone != nil {\n\t\tok := object.Key(\"ScheduleTimezone\")\n\t\tok.String(*v.ScheduleTimezone)\n\t}\n\n\tif v.StartDate != nil {\n\t\tok := object.Key(\"StartDate\")\n\t\tok.String(*v.StartDate)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateOpsItemInput(v *CreateOpsItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AccountId != nil {\n\t\tok := object.Key(\"AccountId\")\n\t\tok.String(*v.AccountId)\n\t}\n\n\tif v.ActualEndTime != nil {\n\t\tok := object.Key(\"ActualEndTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ActualEndTime))\n\t}\n\n\tif v.ActualStartTime != nil {\n\t\tok := object.Key(\"ActualStartTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ActualStartTime))\n\t}\n\n\tif v.Category != nil {\n\t\tok := object.Key(\"Category\")\n\t\tok.String(*v.Category)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Notifications != nil {\n\t\tok := object.Key(\"Notifications\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemNotifications(v.Notifications, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OperationalData != nil {\n\t\tok := object.Key(\"OperationalData\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemOperationalData(v.OperationalData, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OpsItemType != nil {\n\t\tok := object.Key(\"OpsItemType\")\n\t\tok.String(*v.OpsItemType)\n\t}\n\n\tif v.PlannedEndTime != nil {\n\t\tok := object.Key(\"PlannedEndTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.PlannedEndTime))\n\t}\n\n\tif v.PlannedStartTime != nil {\n\t\tok := object.Key(\"PlannedStartTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.PlannedStartTime))\n\t}\n\n\tif v.Priority != nil {\n\t\tok := object.Key(\"Priority\")\n\t\tok.Integer(*v.Priority)\n\t}\n\n\tif v.RelatedOpsItems != nil {\n\t\tok := object.Key(\"RelatedOpsItems\")\n\t\tif err := awsAwsjson11_serializeDocumentRelatedOpsItems(v.RelatedOpsItems, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Severity != nil {\n\t\tok := object.Key(\"Severity\")\n\t\tok.String(*v.Severity)\n\t}\n\n\tif v.Source != nil {\n\t\tok := object.Key(\"Source\")\n\t\tok.String(*v.Source)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Title != nil {\n\t\tok := object.Key(\"Title\")\n\t\tok.String(*v.Title)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateOpsMetadataInput(v *CreateOpsMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Metadata != nil {\n\t\tok := object.Key(\"Metadata\")\n\t\tif err := awsAwsjson11_serializeDocumentMetadataMap(v.Metadata, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ResourceId != nil {\n\t\tok := object.Key(\"ResourceId\")\n\t\tok.String(*v.ResourceId)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreatePatchBaselineInput(v *CreatePatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ApprovalRules != nil {\n\t\tok := object.Key(\"ApprovalRules\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchRuleGroup(v.ApprovalRules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApprovedPatches != nil {\n\t\tok := object.Key(\"ApprovedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.ApprovedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ApprovedPatchesComplianceLevel) > 0 {\n\t\tok := object.Key(\"ApprovedPatchesComplianceLevel\")\n\t\tok.String(string(v.ApprovedPatchesComplianceLevel))\n\t}\n\n\tif v.ApprovedPatchesEnableNonSecurity != nil {\n\t\tok := object.Key(\"ApprovedPatchesEnableNonSecurity\")\n\t\tok.Boolean(*v.ApprovedPatchesEnableNonSecurity)\n\t}\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.GlobalFilters != nil {\n\t\tok := object.Key(\"GlobalFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterGroup(v.GlobalFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif len(v.OperatingSystem) > 0 {\n\t\tok := object.Key(\"OperatingSystem\")\n\t\tok.String(string(v.OperatingSystem))\n\t}\n\n\tif v.RejectedPatches != nil {\n\t\tok := object.Key(\"RejectedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.RejectedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.RejectedPatchesAction) > 0 {\n\t\tok := object.Key(\"RejectedPatchesAction\")\n\t\tok.String(string(v.RejectedPatchesAction))\n\t}\n\n\tif v.Sources != nil {\n\t\tok := object.Key(\"Sources\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchSourceList(v.Sources, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentCreateResourceDataSyncInput(v *CreateResourceDataSyncInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.S3Destination != nil {\n\t\tok := object.Key(\"S3Destination\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncS3Destination(v.S3Destination, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SyncName != nil {\n\t\tok := object.Key(\"SyncName\")\n\t\tok.String(*v.SyncName)\n\t}\n\n\tif v.SyncSource != nil {\n\t\tok := object.Key(\"SyncSource\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncSource(v.SyncSource, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SyncType != nil {\n\t\tok := object.Key(\"SyncType\")\n\t\tok.String(*v.SyncType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteActivationInput(v *DeleteActivationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ActivationId != nil {\n\t\tok := object.Key(\"ActivationId\")\n\t\tok.String(*v.ActivationId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteAssociationInput(v *DeleteAssociationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteDocumentInput(v *DeleteDocumentInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Force {\n\t\tok := object.Key(\"Force\")\n\t\tok.Boolean(v.Force)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteInventoryInput(v *DeleteInventoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif v.DryRun {\n\t\tok := object.Key(\"DryRun\")\n\t\tok.Boolean(v.DryRun)\n\t}\n\n\tif len(v.SchemaDeleteOption) > 0 {\n\t\tok := object.Key(\"SchemaDeleteOption\")\n\t\tok.String(string(v.SchemaDeleteOption))\n\t}\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteMaintenanceWindowInput(v *DeleteMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(v *DeleteOpsItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteOpsMetadataInput(v *DeleteOpsMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OpsMetadataArn != nil {\n\t\tok := object.Key(\"OpsMetadataArn\")\n\t\tok.String(*v.OpsMetadataArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteParameterInput(v *DeleteParameterInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteParametersInput(v *DeleteParametersInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Names != nil {\n\t\tok := object.Key(\"Names\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterNameList(v.Names, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeletePatchBaselineInput(v *DeletePatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteResourceDataSyncInput(v *DeleteResourceDataSyncInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SyncName != nil {\n\t\tok := object.Key(\"SyncName\")\n\t\tok.String(*v.SyncName)\n\t}\n\n\tif v.SyncType != nil {\n\t\tok := object.Key(\"SyncType\")\n\t\tok.String(*v.SyncType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.PolicyHash != nil {\n\t\tok := object.Key(\"PolicyHash\")\n\t\tok.String(*v.PolicyHash)\n\t}\n\n\tif v.PolicyId != nil {\n\t\tok := object.Key(\"PolicyId\")\n\t\tok.String(*v.PolicyId)\n\t}\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"ResourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeregisterManagedInstanceInput(v *DeregisterManagedInstanceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeregisterPatchBaselineForPatchGroupInput(v *DeregisterPatchBaselineForPatchGroupInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\tif v.PatchGroup != nil {\n\t\tok := object.Key(\"PatchGroup\")\n\t\tok.String(*v.PatchGroup)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeregisterTargetFromMaintenanceWindowInput(v *DeregisterTargetFromMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Safe != nil {\n\t\tok := object.Key(\"Safe\")\n\t\tok.Boolean(*v.Safe)\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\tif v.WindowTargetId != nil {\n\t\tok := object.Key(\"WindowTargetId\")\n\t\tok.String(*v.WindowTargetId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDeregisterTaskFromMaintenanceWindowInput(v *DeregisterTaskFromMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\tif v.WindowTaskId != nil {\n\t\tok := object.Key(\"WindowTaskId\")\n\t\tok.String(*v.WindowTaskId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeActivationsInput(v *DescribeActivationsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentDescribeActivationsFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionsInput(v *DescribeAssociationExecutionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentAssociationExecutionFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionTargetsInput(v *DescribeAssociationExecutionTargetsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.ExecutionId != nil {\n\t\tok := object.Key(\"ExecutionId\")\n\t\tok.String(*v.ExecutionId)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentAssociationExecutionTargetsFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAssociationInput(v *DescribeAssociationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.AssociationVersion != nil {\n\t\tok := object.Key(\"AssociationVersion\")\n\t\tok.String(*v.AssociationVersion)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAutomationExecutionsInput(v *DescribeAutomationExecutionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationExecutionFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAutomationStepExecutionsInput(v *DescribeAutomationStepExecutionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AutomationExecutionId != nil {\n\t\tok := object.Key(\"AutomationExecutionId\")\n\t\tok.String(*v.AutomationExecutionId)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentStepExecutionFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ReverseOrder != nil {\n\t\tok := object.Key(\"ReverseOrder\")\n\t\tok.Boolean(*v.ReverseOrder)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeAvailablePatchesInput(v *DescribeAvailablePatchesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeDocumentInput(v *DescribeDocumentInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeDocumentPermissionInput(v *DescribeDocumentPermissionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif len(v.PermissionType) > 0 {\n\t\tok := object.Key(\"PermissionType\")\n\t\tok.String(string(v.PermissionType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeEffectiveInstanceAssociationsInput(v *DescribeEffectiveInstanceAssociationsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeEffectivePatchesForPatchBaselineInput(v *DescribeEffectivePatchesForPatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInstanceAssociationsStatusInput(v *DescribeInstanceAssociationsStatusInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInstanceInformationInput(v *DescribeInstanceInformationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationStringFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceInformationFilterList != nil {\n\t\tok := object.Key(\"InstanceInformationFilterList\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceInformationFilterList(v.InstanceInformationFilterList, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInstancePatchesInput(v *DescribeInstancePatchesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesForPatchGroupInput(v *DescribeInstancePatchStatesForPatchGroupInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentInstancePatchStateFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.PatchGroup != nil {\n\t\tok := object.Key(\"PatchGroup\")\n\t\tok.String(*v.PatchGroup)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesInput(v *DescribeInstancePatchStatesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InstanceIds != nil {\n\t\tok := object.Key(\"InstanceIds\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceIdList(v.InstanceIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeInventoryDeletionsInput(v *DescribeInventoryDeletionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DeletionId != nil {\n\t\tok := object.Key(\"DeletionId\")\n\t\tok.String(*v.DeletionId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionsInput(v *DescribeMaintenanceWindowExecutionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTaskInvocationsInput(v *DescribeMaintenanceWindowExecutionTaskInvocationsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.TaskId != nil {\n\t\tok := object.Key(\"TaskId\")\n\t\tok.String(*v.TaskId)\n\t}\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTasksInput(v *DescribeMaintenanceWindowExecutionTasksInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowScheduleInput(v *DescribeMaintenanceWindowScheduleInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsForTargetInput(v *DescribeMaintenanceWindowsForTargetInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsInput(v *DescribeMaintenanceWindowsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTargetsInput(v *DescribeMaintenanceWindowTargetsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTasksInput(v *DescribeMaintenanceWindowTasksInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeOpsItemsInput(v *DescribeOpsItemsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.OpsItemFilters != nil {\n\t\tok := object.Key(\"OpsItemFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemFilters(v.OpsItemFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeParametersInput(v *DescribeParametersInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentParametersFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ParameterFilters != nil {\n\t\tok := object.Key(\"ParameterFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterStringFilterList(v.ParameterFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribePatchBaselinesInput(v *DescribePatchBaselinesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribePatchGroupsInput(v *DescribePatchGroupsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchOrchestratorFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribePatchGroupStateInput(v *DescribePatchGroupStateInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.PatchGroup != nil {\n\t\tok := object.Key(\"PatchGroup\")\n\t\tok.String(*v.PatchGroup)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribePatchPropertiesInput(v *DescribePatchPropertiesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif len(v.OperatingSystem) > 0 {\n\t\tok := object.Key(\"OperatingSystem\")\n\t\tok.String(string(v.OperatingSystem))\n\t}\n\n\tif len(v.PatchSet) > 0 {\n\t\tok := object.Key(\"PatchSet\")\n\t\tok.String(string(v.PatchSet))\n\t}\n\n\tif len(v.Property) > 0 {\n\t\tok := object.Key(\"Property\")\n\t\tok.String(string(v.Property))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDescribeSessionsInput(v *DescribeSessionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentSessionFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif len(v.State) > 0 {\n\t\tok := object.Key(\"State\")\n\t\tok.String(string(v.State))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentDisassociateOpsItemRelatedItemInput(v *DisassociateOpsItemRelatedItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetAutomationExecutionInput(v *GetAutomationExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AutomationExecutionId != nil {\n\t\tok := object.Key(\"AutomationExecutionId\")\n\t\tok.String(*v.AutomationExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetCalendarStateInput(v *GetCalendarStateInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AtTime != nil {\n\t\tok := object.Key(\"AtTime\")\n\t\tok.String(*v.AtTime)\n\t}\n\n\tif v.CalendarNames != nil {\n\t\tok := object.Key(\"CalendarNames\")\n\t\tif err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetCommandInvocationInput(v *GetCommandInvocationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CommandId != nil {\n\t\tok := object.Key(\"CommandId\")\n\t\tok.String(*v.CommandId)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.PluginName != nil {\n\t\tok := object.Key(\"PluginName\")\n\t\tok.String(*v.PluginName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetConnectionStatusInput(v *GetConnectionStatusInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Target != nil {\n\t\tok := object.Key(\"Target\")\n\t\tok.String(*v.Target)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetDefaultPatchBaselineInput(v *GetDefaultPatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.OperatingSystem) > 0 {\n\t\tok := object.Key(\"OperatingSystem\")\n\t\tok.String(string(v.OperatingSystem))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetDeployablePatchSnapshotForInstanceInput(v *GetDeployablePatchSnapshotForInstanceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineOverride != nil {\n\t\tok := object.Key(\"BaselineOverride\")\n\t\tif err := awsAwsjson11_serializeDocumentBaselineOverride(v.BaselineOverride, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.SnapshotId != nil {\n\t\tok := object.Key(\"SnapshotId\")\n\t\tok.String(*v.SnapshotId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetDocumentInput(v *GetDocumentInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.DocumentFormat) > 0 {\n\t\tok := object.Key(\"DocumentFormat\")\n\t\tok.String(string(v.DocumentFormat))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetInventoryInput(v *GetInventoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Aggregators != nil {\n\t\tok := object.Key(\"Aggregators\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryAggregatorList(v.Aggregators, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ResultAttributes != nil {\n\t\tok := object.Key(\"ResultAttributes\")\n\t\tif err := awsAwsjson11_serializeDocumentResultAttributeList(v.ResultAttributes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetInventorySchemaInput(v *GetInventorySchemaInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Aggregator {\n\t\tok := object.Key(\"Aggregator\")\n\t\tok.Boolean(v.Aggregator)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.SubType != nil {\n\t\tok := object.Key(\"SubType\")\n\t\tok.Boolean(*v.SubType)\n\t}\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionInput(v *GetMaintenanceWindowExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionTaskInput(v *GetMaintenanceWindowExecutionTaskInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.TaskId != nil {\n\t\tok := object.Key(\"TaskId\")\n\t\tok.String(*v.TaskId)\n\t}\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetMaintenanceWindowExecutionTaskInvocationInput(v *GetMaintenanceWindowExecutionTaskInvocationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InvocationId != nil {\n\t\tok := object.Key(\"InvocationId\")\n\t\tok.String(*v.InvocationId)\n\t}\n\n\tif v.TaskId != nil {\n\t\tok := object.Key(\"TaskId\")\n\t\tok.String(*v.TaskId)\n\t}\n\n\tif v.WindowExecutionId != nil {\n\t\tok := object.Key(\"WindowExecutionId\")\n\t\tok.String(*v.WindowExecutionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetMaintenanceWindowInput(v *GetMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetMaintenanceWindowTaskInput(v *GetMaintenanceWindowTaskInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\tif v.WindowTaskId != nil {\n\t\tok := object.Key(\"WindowTaskId\")\n\t\tok.String(*v.WindowTaskId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetOpsItemInput(v *GetOpsItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.OpsItemArn != nil {\n\t\tok := object.Key(\"OpsItemArn\")\n\t\tok.String(*v.OpsItemArn)\n\t}\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetOpsMetadataInput(v *GetOpsMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.OpsMetadataArn != nil {\n\t\tok := object.Key(\"OpsMetadataArn\")\n\t\tok.String(*v.OpsMetadataArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetOpsSummaryInput(v *GetOpsSummaryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Aggregators != nil {\n\t\tok := object.Key(\"Aggregators\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsAggregatorList(v.Aggregators, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ResultAttributes != nil {\n\t\tok := object.Key(\"ResultAttributes\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsResultAttributeList(v.ResultAttributes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SyncName != nil {\n\t\tok := object.Key(\"SyncName\")\n\t\tok.String(*v.SyncName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetParameterHistoryInput(v *GetParameterHistoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.WithDecryption != nil {\n\t\tok := object.Key(\"WithDecryption\")\n\t\tok.Boolean(*v.WithDecryption)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetParameterInput(v *GetParameterInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.WithDecryption != nil {\n\t\tok := object.Key(\"WithDecryption\")\n\t\tok.Boolean(*v.WithDecryption)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetParametersByPathInput(v *GetParametersByPathInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ParameterFilters != nil {\n\t\tok := object.Key(\"ParameterFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterStringFilterList(v.ParameterFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Path != nil {\n\t\tok := object.Key(\"Path\")\n\t\tok.String(*v.Path)\n\t}\n\n\tif v.Recursive != nil {\n\t\tok := object.Key(\"Recursive\")\n\t\tok.Boolean(*v.Recursive)\n\t}\n\n\tif v.WithDecryption != nil {\n\t\tok := object.Key(\"WithDecryption\")\n\t\tok.Boolean(*v.WithDecryption)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetParametersInput(v *GetParametersInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Names != nil {\n\t\tok := object.Key(\"Names\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterNameList(v.Names, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.WithDecryption != nil {\n\t\tok := object.Key(\"WithDecryption\")\n\t\tok.Boolean(*v.WithDecryption)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetPatchBaselineForPatchGroupInput(v *GetPatchBaselineForPatchGroupInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif len(v.OperatingSystem) > 0 {\n\t\tok := object.Key(\"OperatingSystem\")\n\t\tok.String(string(v.OperatingSystem))\n\t}\n\n\tif v.PatchGroup != nil {\n\t\tok := object.Key(\"PatchGroup\")\n\t\tok.String(*v.PatchGroup)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetPatchBaselineInput(v *GetPatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetResourcePoliciesInput(v *GetResourcePoliciesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"ResourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentGetServiceSettingInput(v *GetServiceSettingInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SettingId != nil {\n\t\tok := object.Key(\"SettingId\")\n\t\tok.String(*v.SettingId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentLabelParameterVersionInput(v *LabelParameterVersionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Labels != nil {\n\t\tok := object.Key(\"Labels\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterLabelList(v.Labels, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.ParameterVersion != nil {\n\t\tok := object.Key(\"ParameterVersion\")\n\t\tok.Long(*v.ParameterVersion)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListAssociationsInput(v *ListAssociationsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationFilterList != nil {\n\t\tok := object.Key(\"AssociationFilterList\")\n\t\tif err := awsAwsjson11_serializeDocumentAssociationFilterList(v.AssociationFilterList, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListAssociationVersionsInput(v *ListAssociationVersionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListCommandInvocationsInput(v *ListCommandInvocationsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CommandId != nil {\n\t\tok := object.Key(\"CommandId\")\n\t\tok.String(*v.CommandId)\n\t}\n\n\tif v.Details {\n\t\tok := object.Key(\"Details\")\n\t\tok.Boolean(v.Details)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentCommandFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListCommandsInput(v *ListCommandsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.CommandId != nil {\n\t\tok := object.Key(\"CommandId\")\n\t\tok.String(*v.CommandId)\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentCommandFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListComplianceItemsInput(v *ListComplianceItemsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceStringFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.ResourceIds != nil {\n\t\tok := object.Key(\"ResourceIds\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceResourceIdList(v.ResourceIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ResourceTypes != nil {\n\t\tok := object.Key(\"ResourceTypes\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceResourceTypeList(v.ResourceTypes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListComplianceSummariesInput(v *ListComplianceSummariesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceStringFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListDocumentMetadataHistoryInput(v *ListDocumentMetadataHistoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif len(v.Metadata) > 0 {\n\t\tok := object.Key(\"Metadata\")\n\t\tok.String(string(v.Metadata))\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListDocumentsInput(v *ListDocumentsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentFilterList != nil {\n\t\tok := object.Key(\"DocumentFilterList\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentFilterList(v.DocumentFilterList, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentKeyValuesFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListDocumentVersionsInput(v *ListDocumentVersionsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListInventoryEntriesInput(v *ListInventoryEntriesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.TypeName != nil {\n\t\tok := object.Key(\"TypeName\")\n\t\tok.String(*v.TypeName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(v *ListOpsItemEventsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemEventFilters(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListOpsItemRelatedItemsInput(v *ListOpsItemRelatedItemsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilters(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListOpsMetadataInput(v *ListOpsMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsMetadataFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListResourceComplianceSummariesInput(v *ListResourceComplianceSummariesInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Filters != nil {\n\t\tok := object.Key(\"Filters\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceStringFilterList(v.Filters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListResourceDataSyncInput(v *ListResourceDataSyncInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.MaxResults != nil {\n\t\tok := object.Key(\"MaxResults\")\n\t\tok.Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tok := object.Key(\"NextToken\")\n\t\tok.String(*v.NextToken)\n\t}\n\n\tif v.SyncType != nil {\n\t\tok := object.Key(\"SyncType\")\n\t\tok.String(*v.SyncType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceId != nil {\n\t\tok := object.Key(\"ResourceId\")\n\t\tok.String(*v.ResourceId)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentModifyDocumentPermissionInput(v *ModifyDocumentPermissionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AccountIdsToAdd != nil {\n\t\tok := object.Key(\"AccountIdsToAdd\")\n\t\tif err := awsAwsjson11_serializeDocumentAccountIdList(v.AccountIdsToAdd, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.AccountIdsToRemove != nil {\n\t\tok := object.Key(\"AccountIdsToRemove\")\n\t\tif err := awsAwsjson11_serializeDocumentAccountIdList(v.AccountIdsToRemove, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif len(v.PermissionType) > 0 {\n\t\tok := object.Key(\"PermissionType\")\n\t\tok.String(string(v.PermissionType))\n\t}\n\n\tif v.SharedDocumentVersion != nil {\n\t\tok := object.Key(\"SharedDocumentVersion\")\n\t\tok.String(*v.SharedDocumentVersion)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutComplianceItemsInput(v *PutComplianceItemsInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ComplianceType != nil {\n\t\tok := object.Key(\"ComplianceType\")\n\t\tok.String(*v.ComplianceType)\n\t}\n\n\tif v.ExecutionSummary != nil {\n\t\tok := object.Key(\"ExecutionSummary\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceExecutionSummary(v.ExecutionSummary, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ItemContentHash != nil {\n\t\tok := object.Key(\"ItemContentHash\")\n\t\tok.String(*v.ItemContentHash)\n\t}\n\n\tif v.Items != nil {\n\t\tok := object.Key(\"Items\")\n\t\tif err := awsAwsjson11_serializeDocumentComplianceItemEntryList(v.Items, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ResourceId != nil {\n\t\tok := object.Key(\"ResourceId\")\n\t\tok.String(*v.ResourceId)\n\t}\n\n\tif v.ResourceType != nil {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(*v.ResourceType)\n\t}\n\n\tif len(v.UploadType) > 0 {\n\t\tok := object.Key(\"UploadType\")\n\t\tok.String(string(v.UploadType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutInventoryInput(v *PutInventoryInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.Items != nil {\n\t\tok := object.Key(\"Items\")\n\t\tif err := awsAwsjson11_serializeDocumentInventoryItemList(v.Items, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutParameterInput(v *PutParameterInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AllowedPattern != nil {\n\t\tok := object.Key(\"AllowedPattern\")\n\t\tok.String(*v.AllowedPattern)\n\t}\n\n\tif v.DataType != nil {\n\t\tok := object.Key(\"DataType\")\n\t\tok.String(*v.DataType)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.KeyId != nil {\n\t\tok := object.Key(\"KeyId\")\n\t\tok.String(*v.KeyId)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Overwrite != nil {\n\t\tok := object.Key(\"Overwrite\")\n\t\tok.Boolean(*v.Overwrite)\n\t}\n\n\tif v.Policies != nil {\n\t\tok := object.Key(\"Policies\")\n\t\tok.String(*v.Policies)\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.Tier) > 0 {\n\t\tok := object.Key(\"Tier\")\n\t\tok.String(string(v.Tier))\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\tif v.Value != nil {\n\t\tok := object.Key(\"Value\")\n\t\tok.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Policy != nil {\n\t\tok := object.Key(\"Policy\")\n\t\tok.String(*v.Policy)\n\t}\n\n\tif v.PolicyHash != nil {\n\t\tok := object.Key(\"PolicyHash\")\n\t\tok.String(*v.PolicyHash)\n\t}\n\n\tif v.PolicyId != nil {\n\t\tok := object.Key(\"PolicyId\")\n\t\tok.String(*v.PolicyId)\n\t}\n\n\tif v.ResourceArn != nil {\n\t\tok := object.Key(\"ResourceArn\")\n\t\tok.String(*v.ResourceArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentRegisterDefaultPatchBaselineInput(v *RegisterDefaultPatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentRegisterPatchBaselineForPatchGroupInput(v *RegisterPatchBaselineForPatchGroupInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\tif v.PatchGroup != nil {\n\t\tok := object.Key(\"PatchGroup\")\n\t\tok.String(*v.PatchGroup)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentRegisterTargetWithMaintenanceWindowInput(v *RegisterTargetWithMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.OwnerInformation != nil {\n\t\tok := object.Key(\"OwnerInformation\")\n\t\tok.String(*v.OwnerInformation)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentRegisterTaskWithMaintenanceWindowInput(v *RegisterTaskWithMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif len(v.CutoffBehavior) > 0 {\n\t\tok := object.Key(\"CutoffBehavior\")\n\t\tok.String(string(v.CutoffBehavior))\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.LoggingInfo != nil {\n\t\tok := object.Key(\"LoggingInfo\")\n\t\tif err := awsAwsjson11_serializeDocumentLoggingInfo(v.LoggingInfo, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Priority != nil {\n\t\tok := object.Key(\"Priority\")\n\t\tok.Integer(*v.Priority)\n\t}\n\n\tif v.ServiceRoleArn != nil {\n\t\tok := object.Key(\"ServiceRoleArn\")\n\t\tok.String(*v.ServiceRoleArn)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TaskArn != nil {\n\t\tok := object.Key(\"TaskArn\")\n\t\tok.String(*v.TaskArn)\n\t}\n\n\tif v.TaskInvocationParameters != nil {\n\t\tok := object.Key(\"TaskInvocationParameters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskInvocationParameters(v.TaskInvocationParameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TaskParameters != nil {\n\t\tok := object.Key(\"TaskParameters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameters(v.TaskParameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.TaskType) > 0 {\n\t\tok := object.Key(\"TaskType\")\n\t\tok.String(string(v.TaskType))\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ResourceId != nil {\n\t\tok := object.Key(\"ResourceId\")\n\t\tok.String(*v.ResourceId)\n\t}\n\n\tif len(v.ResourceType) > 0 {\n\t\tok := object.Key(\"ResourceType\")\n\t\tok.String(string(v.ResourceType))\n\t}\n\n\tif v.TagKeys != nil {\n\t\tok := object.Key(\"TagKeys\")\n\t\tif err := awsAwsjson11_serializeDocumentKeyList(v.TagKeys, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentResetServiceSettingInput(v *ResetServiceSettingInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SettingId != nil {\n\t\tok := object.Key(\"SettingId\")\n\t\tok.String(*v.SettingId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentResumeSessionInput(v *ResumeSessionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SessionId != nil {\n\t\tok := object.Key(\"SessionId\")\n\t\tok.String(*v.SessionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentSendAutomationSignalInput(v *SendAutomationSignalInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AutomationExecutionId != nil {\n\t\tok := object.Key(\"AutomationExecutionId\")\n\t\tok.String(*v.AutomationExecutionId)\n\t}\n\n\tif v.Payload != nil {\n\t\tok := object.Key(\"Payload\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Payload, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.SignalType) > 0 {\n\t\tok := object.Key(\"SignalType\")\n\t\tok.String(string(v.SignalType))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentSendCommandInput(v *SendCommandInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.CloudWatchOutputConfig != nil {\n\t\tok := object.Key(\"CloudWatchOutputConfig\")\n\t\tif err := awsAwsjson11_serializeDocumentCloudWatchOutputConfig(v.CloudWatchOutputConfig, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Comment != nil {\n\t\tok := object.Key(\"Comment\")\n\t\tok.String(*v.Comment)\n\t}\n\n\tif v.DocumentHash != nil {\n\t\tok := object.Key(\"DocumentHash\")\n\t\tok.String(*v.DocumentHash)\n\t}\n\n\tif len(v.DocumentHashType) > 0 {\n\t\tok := object.Key(\"DocumentHashType\")\n\t\tok.String(string(v.DocumentHashType))\n\t}\n\n\tif v.DocumentName != nil {\n\t\tok := object.Key(\"DocumentName\")\n\t\tok.String(*v.DocumentName)\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.InstanceIds != nil {\n\t\tok := object.Key(\"InstanceIds\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceIdList(v.InstanceIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.NotificationConfig != nil {\n\t\tok := object.Key(\"NotificationConfig\")\n\t\tif err := awsAwsjson11_serializeDocumentNotificationConfig(v.NotificationConfig, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OutputS3BucketName != nil {\n\t\tok := object.Key(\"OutputS3BucketName\")\n\t\tok.String(*v.OutputS3BucketName)\n\t}\n\n\tif v.OutputS3KeyPrefix != nil {\n\t\tok := object.Key(\"OutputS3KeyPrefix\")\n\t\tok.String(*v.OutputS3KeyPrefix)\n\t}\n\n\tif v.OutputS3Region != nil {\n\t\tok := object.Key(\"OutputS3Region\")\n\t\tok.String(*v.OutputS3Region)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ServiceRoleArn != nil {\n\t\tok := object.Key(\"ServiceRoleArn\")\n\t\tok.String(*v.ServiceRoleArn)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TimeoutSeconds != nil {\n\t\tok := object.Key(\"TimeoutSeconds\")\n\t\tok.Integer(*v.TimeoutSeconds)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartAssociationsOnceInput(v *StartAssociationsOnceInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationIds != nil {\n\t\tok := object.Key(\"AssociationIds\")\n\t\tif err := awsAwsjson11_serializeDocumentAssociationIdList(v.AssociationIds, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartAutomationExecutionInput(v *StartAutomationExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif v.DocumentName != nil {\n\t\tok := object.Key(\"DocumentName\")\n\t\tok.String(*v.DocumentName)\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif len(v.Mode) > 0 {\n\t\tok := object.Key(\"Mode\")\n\t\tok.String(string(v.Mode))\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetLocations != nil {\n\t\tok := object.Key(\"TargetLocations\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetMaps != nil {\n\t\tok := object.Key(\"TargetMaps\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetParameterName != nil {\n\t\tok := object.Key(\"TargetParameterName\")\n\t\tok.String(*v.TargetParameterName)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(v *StartChangeRequestExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AutoApprove {\n\t\tok := object.Key(\"AutoApprove\")\n\t\tok.Boolean(v.AutoApprove)\n\t}\n\n\tif v.ChangeDetails != nil {\n\t\tok := object.Key(\"ChangeDetails\")\n\t\tok.String(*v.ChangeDetails)\n\t}\n\n\tif v.ChangeRequestName != nil {\n\t\tok := object.Key(\"ChangeRequestName\")\n\t\tok.String(*v.ChangeRequestName)\n\t}\n\n\tif v.ClientToken != nil {\n\t\tok := object.Key(\"ClientToken\")\n\t\tok.String(*v.ClientToken)\n\t}\n\n\tif v.DocumentName != nil {\n\t\tok := object.Key(\"DocumentName\")\n\t\tok.String(*v.DocumentName)\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Runbooks != nil {\n\t\tok := object.Key(\"Runbooks\")\n\t\tif err := awsAwsjson11_serializeDocumentRunbooks(v.Runbooks, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ScheduledEndTime != nil {\n\t\tok := object.Key(\"ScheduledEndTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ScheduledEndTime))\n\t}\n\n\tif v.ScheduledTime != nil {\n\t\tok := object.Key(\"ScheduledTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ScheduledTime))\n\t}\n\n\tif v.Tags != nil {\n\t\tok := object.Key(\"Tags\")\n\t\tif err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStartSessionInput(v *StartSessionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentName != nil {\n\t\tok := object.Key(\"DocumentName\")\n\t\tok.String(*v.DocumentName)\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentSessionManagerParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Reason != nil {\n\t\tok := object.Key(\"Reason\")\n\t\tok.String(*v.Reason)\n\t}\n\n\tif v.Target != nil {\n\t\tok := object.Key(\"Target\")\n\t\tok.String(*v.Target)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentStopAutomationExecutionInput(v *StopAutomationExecutionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AutomationExecutionId != nil {\n\t\tok := object.Key(\"AutomationExecutionId\")\n\t\tok.String(*v.AutomationExecutionId)\n\t}\n\n\tif len(v.Type) > 0 {\n\t\tok := object.Key(\"Type\")\n\t\tok.String(string(v.Type))\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentTerminateSessionInput(v *TerminateSessionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SessionId != nil {\n\t\tok := object.Key(\"SessionId\")\n\t\tok.String(*v.SessionId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUnlabelParameterVersionInput(v *UnlabelParameterVersionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Labels != nil {\n\t\tok := object.Key(\"Labels\")\n\t\tif err := awsAwsjson11_serializeDocumentParameterLabelList(v.Labels, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.ParameterVersion != nil {\n\t\tok := object.Key(\"ParameterVersion\")\n\t\tok.Long(*v.ParameterVersion)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApplyOnlyAtCronInterval {\n\t\tok := object.Key(\"ApplyOnlyAtCronInterval\")\n\t\tok.Boolean(v.ApplyOnlyAtCronInterval)\n\t}\n\n\tif v.AssociationId != nil {\n\t\tok := object.Key(\"AssociationId\")\n\t\tok.String(*v.AssociationId)\n\t}\n\n\tif v.AssociationName != nil {\n\t\tok := object.Key(\"AssociationName\")\n\t\tok.String(*v.AssociationName)\n\t}\n\n\tif v.AssociationVersion != nil {\n\t\tok := object.Key(\"AssociationVersion\")\n\t\tok.String(*v.AssociationVersion)\n\t}\n\n\tif v.AutomationTargetParameterName != nil {\n\t\tok := object.Key(\"AutomationTargetParameterName\")\n\t\tok.String(*v.AutomationTargetParameterName)\n\t}\n\n\tif v.CalendarNames != nil {\n\t\tok := object.Key(\"CalendarNames\")\n\t\tif err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ComplianceSeverity) > 0 {\n\t\tok := object.Key(\"ComplianceSeverity\")\n\t\tok.String(string(v.ComplianceSeverity))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.OutputLocation != nil {\n\t\tok := object.Key(\"OutputLocation\")\n\t\tif err := awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v.OutputLocation, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Parameters != nil {\n\t\tok := object.Key(\"Parameters\")\n\t\tif err := awsAwsjson11_serializeDocumentParameters(v.Parameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ScheduleExpression != nil {\n\t\tok := object.Key(\"ScheduleExpression\")\n\t\tok.String(*v.ScheduleExpression)\n\t}\n\n\tif v.ScheduleOffset != nil {\n\t\tok := object.Key(\"ScheduleOffset\")\n\t\tok.Integer(*v.ScheduleOffset)\n\t}\n\n\tif len(v.SyncCompliance) > 0 {\n\t\tok := object.Key(\"SyncCompliance\")\n\t\tok.String(string(v.SyncCompliance))\n\t}\n\n\tif v.TargetLocations != nil {\n\t\tok := object.Key(\"TargetLocations\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TargetMaps != nil {\n\t\tok := object.Key(\"TargetMaps\")\n\t\tif err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateAssociationStatusInput(v *UpdateAssociationStatusInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AssociationStatus != nil {\n\t\tok := object.Key(\"AssociationStatus\")\n\t\tif err := awsAwsjson11_serializeDocumentAssociationStatus(v.AssociationStatus, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateDocumentDefaultVersionInput(v *UpdateDocumentDefaultVersionInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateDocumentInput(v *UpdateDocumentInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Attachments != nil {\n\t\tok := object.Key(\"Attachments\")\n\t\tif err := awsAwsjson11_serializeDocumentAttachmentsSourceList(v.Attachments, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Content != nil {\n\t\tok := object.Key(\"Content\")\n\t\tok.String(*v.Content)\n\t}\n\n\tif v.DisplayName != nil {\n\t\tok := object.Key(\"DisplayName\")\n\t\tok.String(*v.DisplayName)\n\t}\n\n\tif len(v.DocumentFormat) > 0 {\n\t\tok := object.Key(\"DocumentFormat\")\n\t\tok.String(string(v.DocumentFormat))\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.TargetType != nil {\n\t\tok := object.Key(\"TargetType\")\n\t\tok.String(*v.TargetType)\n\t}\n\n\tif v.VersionName != nil {\n\t\tok := object.Key(\"VersionName\")\n\t\tok.String(*v.VersionName)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateDocumentMetadataInput(v *UpdateDocumentMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.DocumentReviews != nil {\n\t\tok := object.Key(\"DocumentReviews\")\n\t\tif err := awsAwsjson11_serializeDocumentDocumentReviews(v.DocumentReviews, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.DocumentVersion != nil {\n\t\tok := object.Key(\"DocumentVersion\")\n\t\tok.String(*v.DocumentVersion)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaintenanceWindowInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AllowUnassociatedTargets != nil {\n\t\tok := object.Key(\"AllowUnassociatedTargets\")\n\t\tok.Boolean(*v.AllowUnassociatedTargets)\n\t}\n\n\tif v.Cutoff != nil {\n\t\tok := object.Key(\"Cutoff\")\n\t\tok.Integer(*v.Cutoff)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Duration != nil {\n\t\tok := object.Key(\"Duration\")\n\t\tok.Integer(*v.Duration)\n\t}\n\n\tif v.Enabled != nil {\n\t\tok := object.Key(\"Enabled\")\n\t\tok.Boolean(*v.Enabled)\n\t}\n\n\tif v.EndDate != nil {\n\t\tok := object.Key(\"EndDate\")\n\t\tok.String(*v.EndDate)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Replace != nil {\n\t\tok := object.Key(\"Replace\")\n\t\tok.Boolean(*v.Replace)\n\t}\n\n\tif v.Schedule != nil {\n\t\tok := object.Key(\"Schedule\")\n\t\tok.String(*v.Schedule)\n\t}\n\n\tif v.ScheduleOffset != nil {\n\t\tok := object.Key(\"ScheduleOffset\")\n\t\tok.Integer(*v.ScheduleOffset)\n\t}\n\n\tif v.ScheduleTimezone != nil {\n\t\tok := object.Key(\"ScheduleTimezone\")\n\t\tok.String(*v.ScheduleTimezone)\n\t}\n\n\tif v.StartDate != nil {\n\t\tok := object.Key(\"StartDate\")\n\t\tok.String(*v.StartDate)\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTargetInput(v *UpdateMaintenanceWindowTargetInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.OwnerInformation != nil {\n\t\tok := object.Key(\"OwnerInformation\")\n\t\tok.String(*v.OwnerInformation)\n\t}\n\n\tif v.Replace != nil {\n\t\tok := object.Key(\"Replace\")\n\t\tok.Boolean(*v.Replace)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\tif v.WindowTargetId != nil {\n\t\tok := object.Key(\"WindowTargetId\")\n\t\tok.String(*v.WindowTargetId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTaskInput(v *UpdateMaintenanceWindowTaskInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.AlarmConfiguration != nil {\n\t\tok := object.Key(\"AlarmConfiguration\")\n\t\tif err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.CutoffBehavior) > 0 {\n\t\tok := object.Key(\"CutoffBehavior\")\n\t\tok.String(string(v.CutoffBehavior))\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.LoggingInfo != nil {\n\t\tok := object.Key(\"LoggingInfo\")\n\t\tif err := awsAwsjson11_serializeDocumentLoggingInfo(v.LoggingInfo, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MaxConcurrency != nil {\n\t\tok := object.Key(\"MaxConcurrency\")\n\t\tok.String(*v.MaxConcurrency)\n\t}\n\n\tif v.MaxErrors != nil {\n\t\tok := object.Key(\"MaxErrors\")\n\t\tok.String(*v.MaxErrors)\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.Priority != nil {\n\t\tok := object.Key(\"Priority\")\n\t\tok.Integer(*v.Priority)\n\t}\n\n\tif v.Replace != nil {\n\t\tok := object.Key(\"Replace\")\n\t\tok.Boolean(*v.Replace)\n\t}\n\n\tif v.ServiceRoleArn != nil {\n\t\tok := object.Key(\"ServiceRoleArn\")\n\t\tok.String(*v.ServiceRoleArn)\n\t}\n\n\tif v.Targets != nil {\n\t\tok := object.Key(\"Targets\")\n\t\tif err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TaskArn != nil {\n\t\tok := object.Key(\"TaskArn\")\n\t\tok.String(*v.TaskArn)\n\t}\n\n\tif v.TaskInvocationParameters != nil {\n\t\tok := object.Key(\"TaskInvocationParameters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskInvocationParameters(v.TaskInvocationParameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TaskParameters != nil {\n\t\tok := object.Key(\"TaskParameters\")\n\t\tif err := awsAwsjson11_serializeDocumentMaintenanceWindowTaskParameters(v.TaskParameters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.WindowId != nil {\n\t\tok := object.Key(\"WindowId\")\n\t\tok.String(*v.WindowId)\n\t}\n\n\tif v.WindowTaskId != nil {\n\t\tok := object.Key(\"WindowTaskId\")\n\t\tok.String(*v.WindowTaskId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateManagedInstanceRoleInput(v *UpdateManagedInstanceRoleInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.IamRole != nil {\n\t\tok := object.Key(\"IamRole\")\n\t\tok.String(*v.IamRole)\n\t}\n\n\tif v.InstanceId != nil {\n\t\tok := object.Key(\"InstanceId\")\n\t\tok.String(*v.InstanceId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateOpsItemInput(v *UpdateOpsItemInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ActualEndTime != nil {\n\t\tok := object.Key(\"ActualEndTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ActualEndTime))\n\t}\n\n\tif v.ActualStartTime != nil {\n\t\tok := object.Key(\"ActualStartTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.ActualStartTime))\n\t}\n\n\tif v.Category != nil {\n\t\tok := object.Key(\"Category\")\n\t\tok.String(*v.Category)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.Notifications != nil {\n\t\tok := object.Key(\"Notifications\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemNotifications(v.Notifications, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OperationalData != nil {\n\t\tok := object.Key(\"OperationalData\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemOperationalData(v.OperationalData, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OperationalDataToDelete != nil {\n\t\tok := object.Key(\"OperationalDataToDelete\")\n\t\tif err := awsAwsjson11_serializeDocumentOpsItemOpsDataKeysList(v.OperationalDataToDelete, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OpsItemArn != nil {\n\t\tok := object.Key(\"OpsItemArn\")\n\t\tok.String(*v.OpsItemArn)\n\t}\n\n\tif v.OpsItemId != nil {\n\t\tok := object.Key(\"OpsItemId\")\n\t\tok.String(*v.OpsItemId)\n\t}\n\n\tif v.PlannedEndTime != nil {\n\t\tok := object.Key(\"PlannedEndTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.PlannedEndTime))\n\t}\n\n\tif v.PlannedStartTime != nil {\n\t\tok := object.Key(\"PlannedStartTime\")\n\t\tok.Double(smithytime.FormatEpochSeconds(*v.PlannedStartTime))\n\t}\n\n\tif v.Priority != nil {\n\t\tok := object.Key(\"Priority\")\n\t\tok.Integer(*v.Priority)\n\t}\n\n\tif v.RelatedOpsItems != nil {\n\t\tok := object.Key(\"RelatedOpsItems\")\n\t\tif err := awsAwsjson11_serializeDocumentRelatedOpsItems(v.RelatedOpsItems, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Severity != nil {\n\t\tok := object.Key(\"Severity\")\n\t\tok.String(*v.Severity)\n\t}\n\n\tif len(v.Status) > 0 {\n\t\tok := object.Key(\"Status\")\n\t\tok.String(string(v.Status))\n\t}\n\n\tif v.Title != nil {\n\t\tok := object.Key(\"Title\")\n\t\tok.String(*v.Title)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateOpsMetadataInput(v *UpdateOpsMetadataInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.KeysToDelete != nil {\n\t\tok := object.Key(\"KeysToDelete\")\n\t\tif err := awsAwsjson11_serializeDocumentMetadataKeysToDeleteList(v.KeysToDelete, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.MetadataToUpdate != nil {\n\t\tok := object.Key(\"MetadataToUpdate\")\n\t\tif err := awsAwsjson11_serializeDocumentMetadataMap(v.MetadataToUpdate, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.OpsMetadataArn != nil {\n\t\tok := object.Key(\"OpsMetadataArn\")\n\t\tok.String(*v.OpsMetadataArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdatePatchBaselineInput(v *UpdatePatchBaselineInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ApprovalRules != nil {\n\t\tok := object.Key(\"ApprovalRules\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchRuleGroup(v.ApprovalRules, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ApprovedPatches != nil {\n\t\tok := object.Key(\"ApprovedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.ApprovedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.ApprovedPatchesComplianceLevel) > 0 {\n\t\tok := object.Key(\"ApprovedPatchesComplianceLevel\")\n\t\tok.String(string(v.ApprovedPatchesComplianceLevel))\n\t}\n\n\tif v.ApprovedPatchesEnableNonSecurity != nil {\n\t\tok := object.Key(\"ApprovedPatchesEnableNonSecurity\")\n\t\tok.Boolean(*v.ApprovedPatchesEnableNonSecurity)\n\t}\n\n\tif v.BaselineId != nil {\n\t\tok := object.Key(\"BaselineId\")\n\t\tok.String(*v.BaselineId)\n\t}\n\n\tif v.Description != nil {\n\t\tok := object.Key(\"Description\")\n\t\tok.String(*v.Description)\n\t}\n\n\tif v.GlobalFilters != nil {\n\t\tok := object.Key(\"GlobalFilters\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchFilterGroup(v.GlobalFilters, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Name != nil {\n\t\tok := object.Key(\"Name\")\n\t\tok.String(*v.Name)\n\t}\n\n\tif v.RejectedPatches != nil {\n\t\tok := object.Key(\"RejectedPatches\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchIdList(v.RejectedPatches, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(v.RejectedPatchesAction) > 0 {\n\t\tok := object.Key(\"RejectedPatchesAction\")\n\t\tok.String(string(v.RejectedPatchesAction))\n\t}\n\n\tif v.Replace != nil {\n\t\tok := object.Key(\"Replace\")\n\t\tok.Boolean(*v.Replace)\n\t}\n\n\tif v.Sources != nil {\n\t\tok := object.Key(\"Sources\")\n\t\tif err := awsAwsjson11_serializeDocumentPatchSourceList(v.Sources, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateResourceDataSyncInput(v *UpdateResourceDataSyncInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SyncName != nil {\n\t\tok := object.Key(\"SyncName\")\n\t\tok.String(*v.SyncName)\n\t}\n\n\tif v.SyncSource != nil {\n\t\tok := object.Key(\"SyncSource\")\n\t\tif err := awsAwsjson11_serializeDocumentResourceDataSyncSource(v.SyncSource, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SyncType != nil {\n\t\tok := object.Key(\"SyncType\")\n\t\tok.String(*v.SyncType)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsjson11_serializeOpDocumentUpdateServiceSettingInput(v *UpdateServiceSettingInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.SettingId != nil {\n\t\tok := object.Key(\"SettingId\")\n\t\tok.String(*v.SettingId)\n\t}\n\n\tif v.SettingValue != nil {\n\t\tok := object.Key(\"SettingValue\")\n\t\tok.String(*v.SettingValue)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/enums.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\ntype AssociationComplianceSeverity string\n\n// Enum values for AssociationComplianceSeverity\nconst (\n\tAssociationComplianceSeverityCritical    AssociationComplianceSeverity = \"CRITICAL\"\n\tAssociationComplianceSeverityHigh        AssociationComplianceSeverity = \"HIGH\"\n\tAssociationComplianceSeverityMedium      AssociationComplianceSeverity = \"MEDIUM\"\n\tAssociationComplianceSeverityLow         AssociationComplianceSeverity = \"LOW\"\n\tAssociationComplianceSeverityUnspecified AssociationComplianceSeverity = \"UNSPECIFIED\"\n)\n\n// Values returns all known values for AssociationComplianceSeverity. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (AssociationComplianceSeverity) Values() []AssociationComplianceSeverity {\n\treturn []AssociationComplianceSeverity{\n\t\t\"CRITICAL\",\n\t\t\"HIGH\",\n\t\t\"MEDIUM\",\n\t\t\"LOW\",\n\t\t\"UNSPECIFIED\",\n\t}\n}\n\ntype AssociationExecutionFilterKey string\n\n// Enum values for AssociationExecutionFilterKey\nconst (\n\tAssociationExecutionFilterKeyExecutionId AssociationExecutionFilterKey = \"ExecutionId\"\n\tAssociationExecutionFilterKeyStatus      AssociationExecutionFilterKey = \"Status\"\n\tAssociationExecutionFilterKeyCreatedTime AssociationExecutionFilterKey = \"CreatedTime\"\n)\n\n// Values returns all known values for AssociationExecutionFilterKey. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (AssociationExecutionFilterKey) Values() []AssociationExecutionFilterKey {\n\treturn []AssociationExecutionFilterKey{\n\t\t\"ExecutionId\",\n\t\t\"Status\",\n\t\t\"CreatedTime\",\n\t}\n}\n\ntype AssociationExecutionTargetsFilterKey string\n\n// Enum values for AssociationExecutionTargetsFilterKey\nconst (\n\tAssociationExecutionTargetsFilterKeyStatus       AssociationExecutionTargetsFilterKey = \"Status\"\n\tAssociationExecutionTargetsFilterKeyResourceId   AssociationExecutionTargetsFilterKey = \"ResourceId\"\n\tAssociationExecutionTargetsFilterKeyResourceType AssociationExecutionTargetsFilterKey = \"ResourceType\"\n)\n\n// Values returns all known values for AssociationExecutionTargetsFilterKey. Note\n// that this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (AssociationExecutionTargetsFilterKey) Values() []AssociationExecutionTargetsFilterKey {\n\treturn []AssociationExecutionTargetsFilterKey{\n\t\t\"Status\",\n\t\t\"ResourceId\",\n\t\t\"ResourceType\",\n\t}\n}\n\ntype AssociationFilterKey string\n\n// Enum values for AssociationFilterKey\nconst (\n\tAssociationFilterKeyInstanceId         AssociationFilterKey = \"InstanceId\"\n\tAssociationFilterKeyName               AssociationFilterKey = \"Name\"\n\tAssociationFilterKeyAssociationId      AssociationFilterKey = \"AssociationId\"\n\tAssociationFilterKeyStatus             AssociationFilterKey = \"AssociationStatusName\"\n\tAssociationFilterKeyLastExecutedBefore AssociationFilterKey = \"LastExecutedBefore\"\n\tAssociationFilterKeyLastExecutedAfter  AssociationFilterKey = \"LastExecutedAfter\"\n\tAssociationFilterKeyAssociationName    AssociationFilterKey = \"AssociationName\"\n\tAssociationFilterKeyResourceGroupName  AssociationFilterKey = \"ResourceGroupName\"\n)\n\n// Values returns all known values for AssociationFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AssociationFilterKey) Values() []AssociationFilterKey {\n\treturn []AssociationFilterKey{\n\t\t\"InstanceId\",\n\t\t\"Name\",\n\t\t\"AssociationId\",\n\t\t\"AssociationStatusName\",\n\t\t\"LastExecutedBefore\",\n\t\t\"LastExecutedAfter\",\n\t\t\"AssociationName\",\n\t\t\"ResourceGroupName\",\n\t}\n}\n\ntype AssociationFilterOperatorType string\n\n// Enum values for AssociationFilterOperatorType\nconst (\n\tAssociationFilterOperatorTypeEqual       AssociationFilterOperatorType = \"EQUAL\"\n\tAssociationFilterOperatorTypeLessThan    AssociationFilterOperatorType = \"LESS_THAN\"\n\tAssociationFilterOperatorTypeGreaterThan AssociationFilterOperatorType = \"GREATER_THAN\"\n)\n\n// Values returns all known values for AssociationFilterOperatorType. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (AssociationFilterOperatorType) Values() []AssociationFilterOperatorType {\n\treturn []AssociationFilterOperatorType{\n\t\t\"EQUAL\",\n\t\t\"LESS_THAN\",\n\t\t\"GREATER_THAN\",\n\t}\n}\n\ntype AssociationStatusName string\n\n// Enum values for AssociationStatusName\nconst (\n\tAssociationStatusNamePending AssociationStatusName = \"Pending\"\n\tAssociationStatusNameSuccess AssociationStatusName = \"Success\"\n\tAssociationStatusNameFailed  AssociationStatusName = \"Failed\"\n)\n\n// Values returns all known values for AssociationStatusName. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AssociationStatusName) Values() []AssociationStatusName {\n\treturn []AssociationStatusName{\n\t\t\"Pending\",\n\t\t\"Success\",\n\t\t\"Failed\",\n\t}\n}\n\ntype AssociationSyncCompliance string\n\n// Enum values for AssociationSyncCompliance\nconst (\n\tAssociationSyncComplianceAuto   AssociationSyncCompliance = \"AUTO\"\n\tAssociationSyncComplianceManual AssociationSyncCompliance = \"MANUAL\"\n)\n\n// Values returns all known values for AssociationSyncCompliance. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (AssociationSyncCompliance) Values() []AssociationSyncCompliance {\n\treturn []AssociationSyncCompliance{\n\t\t\"AUTO\",\n\t\t\"MANUAL\",\n\t}\n}\n\ntype AttachmentHashType string\n\n// Enum values for AttachmentHashType\nconst (\n\tAttachmentHashTypeSha256 AttachmentHashType = \"Sha256\"\n)\n\n// Values returns all known values for AttachmentHashType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AttachmentHashType) Values() []AttachmentHashType {\n\treturn []AttachmentHashType{\n\t\t\"Sha256\",\n\t}\n}\n\ntype AttachmentsSourceKey string\n\n// Enum values for AttachmentsSourceKey\nconst (\n\tAttachmentsSourceKeySourceUrl           AttachmentsSourceKey = \"SourceUrl\"\n\tAttachmentsSourceKeyS3FileUrl           AttachmentsSourceKey = \"S3FileUrl\"\n\tAttachmentsSourceKeyAttachmentReference AttachmentsSourceKey = \"AttachmentReference\"\n)\n\n// Values returns all known values for AttachmentsSourceKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AttachmentsSourceKey) Values() []AttachmentsSourceKey {\n\treturn []AttachmentsSourceKey{\n\t\t\"SourceUrl\",\n\t\t\"S3FileUrl\",\n\t\t\"AttachmentReference\",\n\t}\n}\n\ntype AutomationExecutionFilterKey string\n\n// Enum values for AutomationExecutionFilterKey\nconst (\n\tAutomationExecutionFilterKeyDocumentNamePrefix  AutomationExecutionFilterKey = \"DocumentNamePrefix\"\n\tAutomationExecutionFilterKeyExecutionStatus     AutomationExecutionFilterKey = \"ExecutionStatus\"\n\tAutomationExecutionFilterKeyExecutionId         AutomationExecutionFilterKey = \"ExecutionId\"\n\tAutomationExecutionFilterKeyParentExecutionId   AutomationExecutionFilterKey = \"ParentExecutionId\"\n\tAutomationExecutionFilterKeyCurrentAction       AutomationExecutionFilterKey = \"CurrentAction\"\n\tAutomationExecutionFilterKeyStartTimeBefore     AutomationExecutionFilterKey = \"StartTimeBefore\"\n\tAutomationExecutionFilterKeyStartTimeAfter      AutomationExecutionFilterKey = \"StartTimeAfter\"\n\tAutomationExecutionFilterKeyAutomationType      AutomationExecutionFilterKey = \"AutomationType\"\n\tAutomationExecutionFilterKeyTagKey              AutomationExecutionFilterKey = \"TagKey\"\n\tAutomationExecutionFilterKeyTargetResourceGroup AutomationExecutionFilterKey = \"TargetResourceGroup\"\n\tAutomationExecutionFilterKeyAutomationSubtype   AutomationExecutionFilterKey = \"AutomationSubtype\"\n\tAutomationExecutionFilterKeyOpsItemId           AutomationExecutionFilterKey = \"OpsItemId\"\n)\n\n// Values returns all known values for AutomationExecutionFilterKey. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (AutomationExecutionFilterKey) Values() []AutomationExecutionFilterKey {\n\treturn []AutomationExecutionFilterKey{\n\t\t\"DocumentNamePrefix\",\n\t\t\"ExecutionStatus\",\n\t\t\"ExecutionId\",\n\t\t\"ParentExecutionId\",\n\t\t\"CurrentAction\",\n\t\t\"StartTimeBefore\",\n\t\t\"StartTimeAfter\",\n\t\t\"AutomationType\",\n\t\t\"TagKey\",\n\t\t\"TargetResourceGroup\",\n\t\t\"AutomationSubtype\",\n\t\t\"OpsItemId\",\n\t}\n}\n\ntype AutomationExecutionStatus string\n\n// Enum values for AutomationExecutionStatus\nconst (\n\tAutomationExecutionStatusPending                        AutomationExecutionStatus = \"Pending\"\n\tAutomationExecutionStatusInprogress                     AutomationExecutionStatus = \"InProgress\"\n\tAutomationExecutionStatusWaiting                        AutomationExecutionStatus = \"Waiting\"\n\tAutomationExecutionStatusSuccess                        AutomationExecutionStatus = \"Success\"\n\tAutomationExecutionStatusTimedout                       AutomationExecutionStatus = \"TimedOut\"\n\tAutomationExecutionStatusCancelling                     AutomationExecutionStatus = \"Cancelling\"\n\tAutomationExecutionStatusCancelled                      AutomationExecutionStatus = \"Cancelled\"\n\tAutomationExecutionStatusFailed                         AutomationExecutionStatus = \"Failed\"\n\tAutomationExecutionStatusPendingApproval                AutomationExecutionStatus = \"PendingApproval\"\n\tAutomationExecutionStatusApproved                       AutomationExecutionStatus = \"Approved\"\n\tAutomationExecutionStatusRejected                       AutomationExecutionStatus = \"Rejected\"\n\tAutomationExecutionStatusScheduled                      AutomationExecutionStatus = \"Scheduled\"\n\tAutomationExecutionStatusRunbookInprogress              AutomationExecutionStatus = \"RunbookInProgress\"\n\tAutomationExecutionStatusPendingChangeCalendarOverride  AutomationExecutionStatus = \"PendingChangeCalendarOverride\"\n\tAutomationExecutionStatusChangeCalendarOverrideApproved AutomationExecutionStatus = \"ChangeCalendarOverrideApproved\"\n\tAutomationExecutionStatusChangeCalendarOverrideRejected AutomationExecutionStatus = \"ChangeCalendarOverrideRejected\"\n\tAutomationExecutionStatusCompletedWithSuccess           AutomationExecutionStatus = \"CompletedWithSuccess\"\n\tAutomationExecutionStatusCompletedWithFailure           AutomationExecutionStatus = \"CompletedWithFailure\"\n\tAutomationExecutionStatusExited                         AutomationExecutionStatus = \"Exited\"\n)\n\n// Values returns all known values for AutomationExecutionStatus. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (AutomationExecutionStatus) Values() []AutomationExecutionStatus {\n\treturn []AutomationExecutionStatus{\n\t\t\"Pending\",\n\t\t\"InProgress\",\n\t\t\"Waiting\",\n\t\t\"Success\",\n\t\t\"TimedOut\",\n\t\t\"Cancelling\",\n\t\t\"Cancelled\",\n\t\t\"Failed\",\n\t\t\"PendingApproval\",\n\t\t\"Approved\",\n\t\t\"Rejected\",\n\t\t\"Scheduled\",\n\t\t\"RunbookInProgress\",\n\t\t\"PendingChangeCalendarOverride\",\n\t\t\"ChangeCalendarOverrideApproved\",\n\t\t\"ChangeCalendarOverrideRejected\",\n\t\t\"CompletedWithSuccess\",\n\t\t\"CompletedWithFailure\",\n\t\t\"Exited\",\n\t}\n}\n\ntype AutomationSubtype string\n\n// Enum values for AutomationSubtype\nconst (\n\tAutomationSubtypeChangeRequest AutomationSubtype = \"ChangeRequest\"\n)\n\n// Values returns all known values for AutomationSubtype. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AutomationSubtype) Values() []AutomationSubtype {\n\treturn []AutomationSubtype{\n\t\t\"ChangeRequest\",\n\t}\n}\n\ntype AutomationType string\n\n// Enum values for AutomationType\nconst (\n\tAutomationTypeCrossAccount AutomationType = \"CrossAccount\"\n\tAutomationTypeLocal        AutomationType = \"Local\"\n)\n\n// Values returns all known values for AutomationType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (AutomationType) Values() []AutomationType {\n\treturn []AutomationType{\n\t\t\"CrossAccount\",\n\t\t\"Local\",\n\t}\n}\n\ntype CalendarState string\n\n// Enum values for CalendarState\nconst (\n\tCalendarStateOpen   CalendarState = \"OPEN\"\n\tCalendarStateClosed CalendarState = \"CLOSED\"\n)\n\n// Values returns all known values for CalendarState. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (CalendarState) Values() []CalendarState {\n\treturn []CalendarState{\n\t\t\"OPEN\",\n\t\t\"CLOSED\",\n\t}\n}\n\ntype CommandFilterKey string\n\n// Enum values for CommandFilterKey\nconst (\n\tCommandFilterKeyInvokedAfter   CommandFilterKey = \"InvokedAfter\"\n\tCommandFilterKeyInvokedBefore  CommandFilterKey = \"InvokedBefore\"\n\tCommandFilterKeyStatus         CommandFilterKey = \"Status\"\n\tCommandFilterKeyExecutionStage CommandFilterKey = \"ExecutionStage\"\n\tCommandFilterKeyDocumentName   CommandFilterKey = \"DocumentName\"\n)\n\n// Values returns all known values for CommandFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (CommandFilterKey) Values() []CommandFilterKey {\n\treturn []CommandFilterKey{\n\t\t\"InvokedAfter\",\n\t\t\"InvokedBefore\",\n\t\t\"Status\",\n\t\t\"ExecutionStage\",\n\t\t\"DocumentName\",\n\t}\n}\n\ntype CommandInvocationStatus string\n\n// Enum values for CommandInvocationStatus\nconst (\n\tCommandInvocationStatusPending    CommandInvocationStatus = \"Pending\"\n\tCommandInvocationStatusInProgress CommandInvocationStatus = \"InProgress\"\n\tCommandInvocationStatusDelayed    CommandInvocationStatus = \"Delayed\"\n\tCommandInvocationStatusSuccess    CommandInvocationStatus = \"Success\"\n\tCommandInvocationStatusCancelled  CommandInvocationStatus = \"Cancelled\"\n\tCommandInvocationStatusTimedOut   CommandInvocationStatus = \"TimedOut\"\n\tCommandInvocationStatusFailed     CommandInvocationStatus = \"Failed\"\n\tCommandInvocationStatusCancelling CommandInvocationStatus = \"Cancelling\"\n)\n\n// Values returns all known values for CommandInvocationStatus. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (CommandInvocationStatus) Values() []CommandInvocationStatus {\n\treturn []CommandInvocationStatus{\n\t\t\"Pending\",\n\t\t\"InProgress\",\n\t\t\"Delayed\",\n\t\t\"Success\",\n\t\t\"Cancelled\",\n\t\t\"TimedOut\",\n\t\t\"Failed\",\n\t\t\"Cancelling\",\n\t}\n}\n\ntype CommandPluginStatus string\n\n// Enum values for CommandPluginStatus\nconst (\n\tCommandPluginStatusPending    CommandPluginStatus = \"Pending\"\n\tCommandPluginStatusInProgress CommandPluginStatus = \"InProgress\"\n\tCommandPluginStatusSuccess    CommandPluginStatus = \"Success\"\n\tCommandPluginStatusTimedOut   CommandPluginStatus = \"TimedOut\"\n\tCommandPluginStatusCancelled  CommandPluginStatus = \"Cancelled\"\n\tCommandPluginStatusFailed     CommandPluginStatus = \"Failed\"\n)\n\n// Values returns all known values for CommandPluginStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (CommandPluginStatus) Values() []CommandPluginStatus {\n\treturn []CommandPluginStatus{\n\t\t\"Pending\",\n\t\t\"InProgress\",\n\t\t\"Success\",\n\t\t\"TimedOut\",\n\t\t\"Cancelled\",\n\t\t\"Failed\",\n\t}\n}\n\ntype CommandStatus string\n\n// Enum values for CommandStatus\nconst (\n\tCommandStatusPending    CommandStatus = \"Pending\"\n\tCommandStatusInProgress CommandStatus = \"InProgress\"\n\tCommandStatusSuccess    CommandStatus = \"Success\"\n\tCommandStatusCancelled  CommandStatus = \"Cancelled\"\n\tCommandStatusFailed     CommandStatus = \"Failed\"\n\tCommandStatusTimedOut   CommandStatus = \"TimedOut\"\n\tCommandStatusCancelling CommandStatus = \"Cancelling\"\n)\n\n// Values returns all known values for CommandStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (CommandStatus) Values() []CommandStatus {\n\treturn []CommandStatus{\n\t\t\"Pending\",\n\t\t\"InProgress\",\n\t\t\"Success\",\n\t\t\"Cancelled\",\n\t\t\"Failed\",\n\t\t\"TimedOut\",\n\t\t\"Cancelling\",\n\t}\n}\n\ntype ComplianceQueryOperatorType string\n\n// Enum values for ComplianceQueryOperatorType\nconst (\n\tComplianceQueryOperatorTypeEqual       ComplianceQueryOperatorType = \"EQUAL\"\n\tComplianceQueryOperatorTypeNotEqual    ComplianceQueryOperatorType = \"NOT_EQUAL\"\n\tComplianceQueryOperatorTypeBeginWith   ComplianceQueryOperatorType = \"BEGIN_WITH\"\n\tComplianceQueryOperatorTypeLessThan    ComplianceQueryOperatorType = \"LESS_THAN\"\n\tComplianceQueryOperatorTypeGreaterThan ComplianceQueryOperatorType = \"GREATER_THAN\"\n)\n\n// Values returns all known values for ComplianceQueryOperatorType. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (ComplianceQueryOperatorType) Values() []ComplianceQueryOperatorType {\n\treturn []ComplianceQueryOperatorType{\n\t\t\"EQUAL\",\n\t\t\"NOT_EQUAL\",\n\t\t\"BEGIN_WITH\",\n\t\t\"LESS_THAN\",\n\t\t\"GREATER_THAN\",\n\t}\n}\n\ntype ComplianceSeverity string\n\n// Enum values for ComplianceSeverity\nconst (\n\tComplianceSeverityCritical      ComplianceSeverity = \"CRITICAL\"\n\tComplianceSeverityHigh          ComplianceSeverity = \"HIGH\"\n\tComplianceSeverityMedium        ComplianceSeverity = \"MEDIUM\"\n\tComplianceSeverityLow           ComplianceSeverity = \"LOW\"\n\tComplianceSeverityInformational ComplianceSeverity = \"INFORMATIONAL\"\n\tComplianceSeverityUnspecified   ComplianceSeverity = \"UNSPECIFIED\"\n)\n\n// Values returns all known values for ComplianceSeverity. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ComplianceSeverity) Values() []ComplianceSeverity {\n\treturn []ComplianceSeverity{\n\t\t\"CRITICAL\",\n\t\t\"HIGH\",\n\t\t\"MEDIUM\",\n\t\t\"LOW\",\n\t\t\"INFORMATIONAL\",\n\t\t\"UNSPECIFIED\",\n\t}\n}\n\ntype ComplianceStatus string\n\n// Enum values for ComplianceStatus\nconst (\n\tComplianceStatusCompliant    ComplianceStatus = \"COMPLIANT\"\n\tComplianceStatusNonCompliant ComplianceStatus = \"NON_COMPLIANT\"\n)\n\n// Values returns all known values for ComplianceStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ComplianceStatus) Values() []ComplianceStatus {\n\treturn []ComplianceStatus{\n\t\t\"COMPLIANT\",\n\t\t\"NON_COMPLIANT\",\n\t}\n}\n\ntype ComplianceUploadType string\n\n// Enum values for ComplianceUploadType\nconst (\n\tComplianceUploadTypeComplete ComplianceUploadType = \"COMPLETE\"\n\tComplianceUploadTypePartial  ComplianceUploadType = \"PARTIAL\"\n)\n\n// Values returns all known values for ComplianceUploadType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ComplianceUploadType) Values() []ComplianceUploadType {\n\treturn []ComplianceUploadType{\n\t\t\"COMPLETE\",\n\t\t\"PARTIAL\",\n\t}\n}\n\ntype ConnectionStatus string\n\n// Enum values for ConnectionStatus\nconst (\n\tConnectionStatusConnected    ConnectionStatus = \"connected\"\n\tConnectionStatusNotConnected ConnectionStatus = \"notconnected\"\n)\n\n// Values returns all known values for ConnectionStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ConnectionStatus) Values() []ConnectionStatus {\n\treturn []ConnectionStatus{\n\t\t\"connected\",\n\t\t\"notconnected\",\n\t}\n}\n\ntype DescribeActivationsFilterKeys string\n\n// Enum values for DescribeActivationsFilterKeys\nconst (\n\tDescribeActivationsFilterKeysActivationIds       DescribeActivationsFilterKeys = \"ActivationIds\"\n\tDescribeActivationsFilterKeysDefaultInstanceName DescribeActivationsFilterKeys = \"DefaultInstanceName\"\n\tDescribeActivationsFilterKeysIamRole             DescribeActivationsFilterKeys = \"IamRole\"\n)\n\n// Values returns all known values for DescribeActivationsFilterKeys. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (DescribeActivationsFilterKeys) Values() []DescribeActivationsFilterKeys {\n\treturn []DescribeActivationsFilterKeys{\n\t\t\"ActivationIds\",\n\t\t\"DefaultInstanceName\",\n\t\t\"IamRole\",\n\t}\n}\n\ntype DocumentFilterKey string\n\n// Enum values for DocumentFilterKey\nconst (\n\tDocumentFilterKeyName          DocumentFilterKey = \"Name\"\n\tDocumentFilterKeyOwner         DocumentFilterKey = \"Owner\"\n\tDocumentFilterKeyPlatformTypes DocumentFilterKey = \"PlatformTypes\"\n\tDocumentFilterKeyDocumentType  DocumentFilterKey = \"DocumentType\"\n)\n\n// Values returns all known values for DocumentFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentFilterKey) Values() []DocumentFilterKey {\n\treturn []DocumentFilterKey{\n\t\t\"Name\",\n\t\t\"Owner\",\n\t\t\"PlatformTypes\",\n\t\t\"DocumentType\",\n\t}\n}\n\ntype DocumentFormat string\n\n// Enum values for DocumentFormat\nconst (\n\tDocumentFormatYaml DocumentFormat = \"YAML\"\n\tDocumentFormatJson DocumentFormat = \"JSON\"\n\tDocumentFormatText DocumentFormat = \"TEXT\"\n)\n\n// Values returns all known values for DocumentFormat. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentFormat) Values() []DocumentFormat {\n\treturn []DocumentFormat{\n\t\t\"YAML\",\n\t\t\"JSON\",\n\t\t\"TEXT\",\n\t}\n}\n\ntype DocumentHashType string\n\n// Enum values for DocumentHashType\nconst (\n\tDocumentHashTypeSha256 DocumentHashType = \"Sha256\"\n\tDocumentHashTypeSha1   DocumentHashType = \"Sha1\"\n)\n\n// Values returns all known values for DocumentHashType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentHashType) Values() []DocumentHashType {\n\treturn []DocumentHashType{\n\t\t\"Sha256\",\n\t\t\"Sha1\",\n\t}\n}\n\ntype DocumentMetadataEnum string\n\n// Enum values for DocumentMetadataEnum\nconst (\n\tDocumentMetadataEnumDocumentReviews DocumentMetadataEnum = \"DocumentReviews\"\n)\n\n// Values returns all known values for DocumentMetadataEnum. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentMetadataEnum) Values() []DocumentMetadataEnum {\n\treturn []DocumentMetadataEnum{\n\t\t\"DocumentReviews\",\n\t}\n}\n\ntype DocumentParameterType string\n\n// Enum values for DocumentParameterType\nconst (\n\tDocumentParameterTypeString     DocumentParameterType = \"String\"\n\tDocumentParameterTypeStringList DocumentParameterType = \"StringList\"\n)\n\n// Values returns all known values for DocumentParameterType. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentParameterType) Values() []DocumentParameterType {\n\treturn []DocumentParameterType{\n\t\t\"String\",\n\t\t\"StringList\",\n\t}\n}\n\ntype DocumentPermissionType string\n\n// Enum values for DocumentPermissionType\nconst (\n\tDocumentPermissionTypeShare DocumentPermissionType = \"Share\"\n)\n\n// Values returns all known values for DocumentPermissionType. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentPermissionType) Values() []DocumentPermissionType {\n\treturn []DocumentPermissionType{\n\t\t\"Share\",\n\t}\n}\n\ntype DocumentReviewAction string\n\n// Enum values for DocumentReviewAction\nconst (\n\tDocumentReviewActionSendForReview DocumentReviewAction = \"SendForReview\"\n\tDocumentReviewActionUpdateReview  DocumentReviewAction = \"UpdateReview\"\n\tDocumentReviewActionApprove       DocumentReviewAction = \"Approve\"\n\tDocumentReviewActionReject        DocumentReviewAction = \"Reject\"\n)\n\n// Values returns all known values for DocumentReviewAction. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentReviewAction) Values() []DocumentReviewAction {\n\treturn []DocumentReviewAction{\n\t\t\"SendForReview\",\n\t\t\"UpdateReview\",\n\t\t\"Approve\",\n\t\t\"Reject\",\n\t}\n}\n\ntype DocumentReviewCommentType string\n\n// Enum values for DocumentReviewCommentType\nconst (\n\tDocumentReviewCommentTypeComment DocumentReviewCommentType = \"Comment\"\n)\n\n// Values returns all known values for DocumentReviewCommentType. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentReviewCommentType) Values() []DocumentReviewCommentType {\n\treturn []DocumentReviewCommentType{\n\t\t\"Comment\",\n\t}\n}\n\ntype DocumentStatus string\n\n// Enum values for DocumentStatus\nconst (\n\tDocumentStatusCreating DocumentStatus = \"Creating\"\n\tDocumentStatusActive   DocumentStatus = \"Active\"\n\tDocumentStatusUpdating DocumentStatus = \"Updating\"\n\tDocumentStatusDeleting DocumentStatus = \"Deleting\"\n\tDocumentStatusFailed   DocumentStatus = \"Failed\"\n)\n\n// Values returns all known values for DocumentStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentStatus) Values() []DocumentStatus {\n\treturn []DocumentStatus{\n\t\t\"Creating\",\n\t\t\"Active\",\n\t\t\"Updating\",\n\t\t\"Deleting\",\n\t\t\"Failed\",\n\t}\n}\n\ntype DocumentType string\n\n// Enum values for DocumentType\nconst (\n\tDocumentTypeCommand                        DocumentType = \"Command\"\n\tDocumentTypePolicy                         DocumentType = \"Policy\"\n\tDocumentTypeAutomation                     DocumentType = \"Automation\"\n\tDocumentTypeSession                        DocumentType = \"Session\"\n\tDocumentTypePackage                        DocumentType = \"Package\"\n\tDocumentTypeApplicationConfiguration       DocumentType = \"ApplicationConfiguration\"\n\tDocumentTypeApplicationConfigurationSchema DocumentType = \"ApplicationConfigurationSchema\"\n\tDocumentTypeDeploymentStrategy             DocumentType = \"DeploymentStrategy\"\n\tDocumentTypeChangeCalendar                 DocumentType = \"ChangeCalendar\"\n\tDocumentTypeChangeTemplate                 DocumentType = \"Automation.ChangeTemplate\"\n\tDocumentTypeProblemAnalysis                DocumentType = \"ProblemAnalysis\"\n\tDocumentTypeProblemAnalysisTemplate        DocumentType = \"ProblemAnalysisTemplate\"\n\tDocumentTypeCloudFormation                 DocumentType = \"CloudFormation\"\n\tDocumentTypeConformancePackTemplate        DocumentType = \"ConformancePackTemplate\"\n\tDocumentTypeQuickSetup                     DocumentType = \"QuickSetup\"\n)\n\n// Values returns all known values for DocumentType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (DocumentType) Values() []DocumentType {\n\treturn []DocumentType{\n\t\t\"Command\",\n\t\t\"Policy\",\n\t\t\"Automation\",\n\t\t\"Session\",\n\t\t\"Package\",\n\t\t\"ApplicationConfiguration\",\n\t\t\"ApplicationConfigurationSchema\",\n\t\t\"DeploymentStrategy\",\n\t\t\"ChangeCalendar\",\n\t\t\"Automation.ChangeTemplate\",\n\t\t\"ProblemAnalysis\",\n\t\t\"ProblemAnalysisTemplate\",\n\t\t\"CloudFormation\",\n\t\t\"ConformancePackTemplate\",\n\t\t\"QuickSetup\",\n\t}\n}\n\ntype ExecutionMode string\n\n// Enum values for ExecutionMode\nconst (\n\tExecutionModeAuto        ExecutionMode = \"Auto\"\n\tExecutionModeInteractive ExecutionMode = \"Interactive\"\n)\n\n// Values returns all known values for ExecutionMode. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ExecutionMode) Values() []ExecutionMode {\n\treturn []ExecutionMode{\n\t\t\"Auto\",\n\t\t\"Interactive\",\n\t}\n}\n\ntype ExternalAlarmState string\n\n// Enum values for ExternalAlarmState\nconst (\n\tExternalAlarmStateUnknown ExternalAlarmState = \"UNKNOWN\"\n\tExternalAlarmStateAlarm   ExternalAlarmState = \"ALARM\"\n)\n\n// Values returns all known values for ExternalAlarmState. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ExternalAlarmState) Values() []ExternalAlarmState {\n\treturn []ExternalAlarmState{\n\t\t\"UNKNOWN\",\n\t\t\"ALARM\",\n\t}\n}\n\ntype Fault string\n\n// Enum values for Fault\nconst (\n\tFaultClient  Fault = \"Client\"\n\tFaultServer  Fault = \"Server\"\n\tFaultUnknown Fault = \"Unknown\"\n)\n\n// Values returns all known values for Fault. Note that this can be expanded in\n// the future, and so it is only as up to date as the client. The ordering of this\n// slice is not guaranteed to be stable across updates.\nfunc (Fault) Values() []Fault {\n\treturn []Fault{\n\t\t\"Client\",\n\t\t\"Server\",\n\t\t\"Unknown\",\n\t}\n}\n\ntype InstanceInformationFilterKey string\n\n// Enum values for InstanceInformationFilterKey\nconst (\n\tInstanceInformationFilterKeyInstanceIds       InstanceInformationFilterKey = \"InstanceIds\"\n\tInstanceInformationFilterKeyAgentVersion      InstanceInformationFilterKey = \"AgentVersion\"\n\tInstanceInformationFilterKeyPingStatus        InstanceInformationFilterKey = \"PingStatus\"\n\tInstanceInformationFilterKeyPlatformTypes     InstanceInformationFilterKey = \"PlatformTypes\"\n\tInstanceInformationFilterKeyActivationIds     InstanceInformationFilterKey = \"ActivationIds\"\n\tInstanceInformationFilterKeyIamRole           InstanceInformationFilterKey = \"IamRole\"\n\tInstanceInformationFilterKeyResourceType      InstanceInformationFilterKey = \"ResourceType\"\n\tInstanceInformationFilterKeyAssociationStatus InstanceInformationFilterKey = \"AssociationStatus\"\n)\n\n// Values returns all known values for InstanceInformationFilterKey. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (InstanceInformationFilterKey) Values() []InstanceInformationFilterKey {\n\treturn []InstanceInformationFilterKey{\n\t\t\"InstanceIds\",\n\t\t\"AgentVersion\",\n\t\t\"PingStatus\",\n\t\t\"PlatformTypes\",\n\t\t\"ActivationIds\",\n\t\t\"IamRole\",\n\t\t\"ResourceType\",\n\t\t\"AssociationStatus\",\n\t}\n}\n\ntype InstancePatchStateOperatorType string\n\n// Enum values for InstancePatchStateOperatorType\nconst (\n\tInstancePatchStateOperatorTypeEqual       InstancePatchStateOperatorType = \"Equal\"\n\tInstancePatchStateOperatorTypeNotEqual    InstancePatchStateOperatorType = \"NotEqual\"\n\tInstancePatchStateOperatorTypeLessThan    InstancePatchStateOperatorType = \"LessThan\"\n\tInstancePatchStateOperatorTypeGreaterThan InstancePatchStateOperatorType = \"GreaterThan\"\n)\n\n// Values returns all known values for InstancePatchStateOperatorType. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (InstancePatchStateOperatorType) Values() []InstancePatchStateOperatorType {\n\treturn []InstancePatchStateOperatorType{\n\t\t\"Equal\",\n\t\t\"NotEqual\",\n\t\t\"LessThan\",\n\t\t\"GreaterThan\",\n\t}\n}\n\ntype InventoryAttributeDataType string\n\n// Enum values for InventoryAttributeDataType\nconst (\n\tInventoryAttributeDataTypeString InventoryAttributeDataType = \"string\"\n\tInventoryAttributeDataTypeNumber InventoryAttributeDataType = \"number\"\n)\n\n// Values returns all known values for InventoryAttributeDataType. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (InventoryAttributeDataType) Values() []InventoryAttributeDataType {\n\treturn []InventoryAttributeDataType{\n\t\t\"string\",\n\t\t\"number\",\n\t}\n}\n\ntype InventoryDeletionStatus string\n\n// Enum values for InventoryDeletionStatus\nconst (\n\tInventoryDeletionStatusInProgress InventoryDeletionStatus = \"InProgress\"\n\tInventoryDeletionStatusComplete   InventoryDeletionStatus = \"Complete\"\n)\n\n// Values returns all known values for InventoryDeletionStatus. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (InventoryDeletionStatus) Values() []InventoryDeletionStatus {\n\treturn []InventoryDeletionStatus{\n\t\t\"InProgress\",\n\t\t\"Complete\",\n\t}\n}\n\ntype InventoryQueryOperatorType string\n\n// Enum values for InventoryQueryOperatorType\nconst (\n\tInventoryQueryOperatorTypeEqual       InventoryQueryOperatorType = \"Equal\"\n\tInventoryQueryOperatorTypeNotEqual    InventoryQueryOperatorType = \"NotEqual\"\n\tInventoryQueryOperatorTypeBeginWith   InventoryQueryOperatorType = \"BeginWith\"\n\tInventoryQueryOperatorTypeLessThan    InventoryQueryOperatorType = \"LessThan\"\n\tInventoryQueryOperatorTypeGreaterThan InventoryQueryOperatorType = \"GreaterThan\"\n\tInventoryQueryOperatorTypeExists      InventoryQueryOperatorType = \"Exists\"\n)\n\n// Values returns all known values for InventoryQueryOperatorType. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (InventoryQueryOperatorType) Values() []InventoryQueryOperatorType {\n\treturn []InventoryQueryOperatorType{\n\t\t\"Equal\",\n\t\t\"NotEqual\",\n\t\t\"BeginWith\",\n\t\t\"LessThan\",\n\t\t\"GreaterThan\",\n\t\t\"Exists\",\n\t}\n}\n\ntype InventorySchemaDeleteOption string\n\n// Enum values for InventorySchemaDeleteOption\nconst (\n\tInventorySchemaDeleteOptionDisableSchema InventorySchemaDeleteOption = \"DisableSchema\"\n\tInventorySchemaDeleteOptionDeleteSchema  InventorySchemaDeleteOption = \"DeleteSchema\"\n)\n\n// Values returns all known values for InventorySchemaDeleteOption. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (InventorySchemaDeleteOption) Values() []InventorySchemaDeleteOption {\n\treturn []InventorySchemaDeleteOption{\n\t\t\"DisableSchema\",\n\t\t\"DeleteSchema\",\n\t}\n}\n\ntype LastResourceDataSyncStatus string\n\n// Enum values for LastResourceDataSyncStatus\nconst (\n\tLastResourceDataSyncStatusSuccessful LastResourceDataSyncStatus = \"Successful\"\n\tLastResourceDataSyncStatusFailed     LastResourceDataSyncStatus = \"Failed\"\n\tLastResourceDataSyncStatusInprogress LastResourceDataSyncStatus = \"InProgress\"\n)\n\n// Values returns all known values for LastResourceDataSyncStatus. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (LastResourceDataSyncStatus) Values() []LastResourceDataSyncStatus {\n\treturn []LastResourceDataSyncStatus{\n\t\t\"Successful\",\n\t\t\"Failed\",\n\t\t\"InProgress\",\n\t}\n}\n\ntype MaintenanceWindowExecutionStatus string\n\n// Enum values for MaintenanceWindowExecutionStatus\nconst (\n\tMaintenanceWindowExecutionStatusPending            MaintenanceWindowExecutionStatus = \"PENDING\"\n\tMaintenanceWindowExecutionStatusInProgress         MaintenanceWindowExecutionStatus = \"IN_PROGRESS\"\n\tMaintenanceWindowExecutionStatusSuccess            MaintenanceWindowExecutionStatus = \"SUCCESS\"\n\tMaintenanceWindowExecutionStatusFailed             MaintenanceWindowExecutionStatus = \"FAILED\"\n\tMaintenanceWindowExecutionStatusTimedOut           MaintenanceWindowExecutionStatus = \"TIMED_OUT\"\n\tMaintenanceWindowExecutionStatusCancelling         MaintenanceWindowExecutionStatus = \"CANCELLING\"\n\tMaintenanceWindowExecutionStatusCancelled          MaintenanceWindowExecutionStatus = \"CANCELLED\"\n\tMaintenanceWindowExecutionStatusSkippedOverlapping MaintenanceWindowExecutionStatus = \"SKIPPED_OVERLAPPING\"\n)\n\n// Values returns all known values for MaintenanceWindowExecutionStatus. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (MaintenanceWindowExecutionStatus) Values() []MaintenanceWindowExecutionStatus {\n\treturn []MaintenanceWindowExecutionStatus{\n\t\t\"PENDING\",\n\t\t\"IN_PROGRESS\",\n\t\t\"SUCCESS\",\n\t\t\"FAILED\",\n\t\t\"TIMED_OUT\",\n\t\t\"CANCELLING\",\n\t\t\"CANCELLED\",\n\t\t\"SKIPPED_OVERLAPPING\",\n\t}\n}\n\ntype MaintenanceWindowResourceType string\n\n// Enum values for MaintenanceWindowResourceType\nconst (\n\tMaintenanceWindowResourceTypeInstance      MaintenanceWindowResourceType = \"INSTANCE\"\n\tMaintenanceWindowResourceTypeResourceGroup MaintenanceWindowResourceType = \"RESOURCE_GROUP\"\n)\n\n// Values returns all known values for MaintenanceWindowResourceType. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (MaintenanceWindowResourceType) Values() []MaintenanceWindowResourceType {\n\treturn []MaintenanceWindowResourceType{\n\t\t\"INSTANCE\",\n\t\t\"RESOURCE_GROUP\",\n\t}\n}\n\ntype MaintenanceWindowTaskCutoffBehavior string\n\n// Enum values for MaintenanceWindowTaskCutoffBehavior\nconst (\n\tMaintenanceWindowTaskCutoffBehaviorContinueTask MaintenanceWindowTaskCutoffBehavior = \"CONTINUE_TASK\"\n\tMaintenanceWindowTaskCutoffBehaviorCancelTask   MaintenanceWindowTaskCutoffBehavior = \"CANCEL_TASK\"\n)\n\n// Values returns all known values for MaintenanceWindowTaskCutoffBehavior. Note\n// that this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (MaintenanceWindowTaskCutoffBehavior) Values() []MaintenanceWindowTaskCutoffBehavior {\n\treturn []MaintenanceWindowTaskCutoffBehavior{\n\t\t\"CONTINUE_TASK\",\n\t\t\"CANCEL_TASK\",\n\t}\n}\n\ntype MaintenanceWindowTaskType string\n\n// Enum values for MaintenanceWindowTaskType\nconst (\n\tMaintenanceWindowTaskTypeRunCommand    MaintenanceWindowTaskType = \"RUN_COMMAND\"\n\tMaintenanceWindowTaskTypeAutomation    MaintenanceWindowTaskType = \"AUTOMATION\"\n\tMaintenanceWindowTaskTypeStepFunctions MaintenanceWindowTaskType = \"STEP_FUNCTIONS\"\n\tMaintenanceWindowTaskTypeLambda        MaintenanceWindowTaskType = \"LAMBDA\"\n)\n\n// Values returns all known values for MaintenanceWindowTaskType. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (MaintenanceWindowTaskType) Values() []MaintenanceWindowTaskType {\n\treturn []MaintenanceWindowTaskType{\n\t\t\"RUN_COMMAND\",\n\t\t\"AUTOMATION\",\n\t\t\"STEP_FUNCTIONS\",\n\t\t\"LAMBDA\",\n\t}\n}\n\ntype NotificationEvent string\n\n// Enum values for NotificationEvent\nconst (\n\tNotificationEventAll        NotificationEvent = \"All\"\n\tNotificationEventInProgress NotificationEvent = \"InProgress\"\n\tNotificationEventSuccess    NotificationEvent = \"Success\"\n\tNotificationEventTimedOut   NotificationEvent = \"TimedOut\"\n\tNotificationEventCancelled  NotificationEvent = \"Cancelled\"\n\tNotificationEventFailed     NotificationEvent = \"Failed\"\n)\n\n// Values returns all known values for NotificationEvent. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (NotificationEvent) Values() []NotificationEvent {\n\treturn []NotificationEvent{\n\t\t\"All\",\n\t\t\"InProgress\",\n\t\t\"Success\",\n\t\t\"TimedOut\",\n\t\t\"Cancelled\",\n\t\t\"Failed\",\n\t}\n}\n\ntype NotificationType string\n\n// Enum values for NotificationType\nconst (\n\tNotificationTypeCommand    NotificationType = \"Command\"\n\tNotificationTypeInvocation NotificationType = \"Invocation\"\n)\n\n// Values returns all known values for NotificationType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (NotificationType) Values() []NotificationType {\n\treturn []NotificationType{\n\t\t\"Command\",\n\t\t\"Invocation\",\n\t}\n}\n\ntype OperatingSystem string\n\n// Enum values for OperatingSystem\nconst (\n\tOperatingSystemWindows               OperatingSystem = \"WINDOWS\"\n\tOperatingSystemAmazonLinux           OperatingSystem = \"AMAZON_LINUX\"\n\tOperatingSystemAmazonLinux2          OperatingSystem = \"AMAZON_LINUX_2\"\n\tOperatingSystemAmazonLinux2022       OperatingSystem = \"AMAZON_LINUX_2022\"\n\tOperatingSystemUbuntu                OperatingSystem = \"UBUNTU\"\n\tOperatingSystemRedhatEnterpriseLinux OperatingSystem = \"REDHAT_ENTERPRISE_LINUX\"\n\tOperatingSystemSuse                  OperatingSystem = \"SUSE\"\n\tOperatingSystemCentOS                OperatingSystem = \"CENTOS\"\n\tOperatingSystemOracleLinux           OperatingSystem = \"ORACLE_LINUX\"\n\tOperatingSystemDebian                OperatingSystem = \"DEBIAN\"\n\tOperatingSystemMacOS                 OperatingSystem = \"MACOS\"\n\tOperatingSystemRaspbian              OperatingSystem = \"RASPBIAN\"\n\tOperatingSystemRockyLinux            OperatingSystem = \"ROCKY_LINUX\"\n\tOperatingSystemAlmaLinux             OperatingSystem = \"ALMA_LINUX\"\n\tOperatingSystemAmazonLinux2023       OperatingSystem = \"AMAZON_LINUX_2023\"\n)\n\n// Values returns all known values for OperatingSystem. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OperatingSystem) Values() []OperatingSystem {\n\treturn []OperatingSystem{\n\t\t\"WINDOWS\",\n\t\t\"AMAZON_LINUX\",\n\t\t\"AMAZON_LINUX_2\",\n\t\t\"AMAZON_LINUX_2022\",\n\t\t\"UBUNTU\",\n\t\t\"REDHAT_ENTERPRISE_LINUX\",\n\t\t\"SUSE\",\n\t\t\"CENTOS\",\n\t\t\"ORACLE_LINUX\",\n\t\t\"DEBIAN\",\n\t\t\"MACOS\",\n\t\t\"RASPBIAN\",\n\t\t\"ROCKY_LINUX\",\n\t\t\"ALMA_LINUX\",\n\t\t\"AMAZON_LINUX_2023\",\n\t}\n}\n\ntype OpsFilterOperatorType string\n\n// Enum values for OpsFilterOperatorType\nconst (\n\tOpsFilterOperatorTypeEqual       OpsFilterOperatorType = \"Equal\"\n\tOpsFilterOperatorTypeNotEqual    OpsFilterOperatorType = \"NotEqual\"\n\tOpsFilterOperatorTypeBeginWith   OpsFilterOperatorType = \"BeginWith\"\n\tOpsFilterOperatorTypeLessThan    OpsFilterOperatorType = \"LessThan\"\n\tOpsFilterOperatorTypeGreaterThan OpsFilterOperatorType = \"GreaterThan\"\n\tOpsFilterOperatorTypeExists      OpsFilterOperatorType = \"Exists\"\n)\n\n// Values returns all known values for OpsFilterOperatorType. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsFilterOperatorType) Values() []OpsFilterOperatorType {\n\treturn []OpsFilterOperatorType{\n\t\t\"Equal\",\n\t\t\"NotEqual\",\n\t\t\"BeginWith\",\n\t\t\"LessThan\",\n\t\t\"GreaterThan\",\n\t\t\"Exists\",\n\t}\n}\n\ntype OpsItemDataType string\n\n// Enum values for OpsItemDataType\nconst (\n\tOpsItemDataTypeSearchableString OpsItemDataType = \"SearchableString\"\n\tOpsItemDataTypeString           OpsItemDataType = \"String\"\n)\n\n// Values returns all known values for OpsItemDataType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemDataType) Values() []OpsItemDataType {\n\treturn []OpsItemDataType{\n\t\t\"SearchableString\",\n\t\t\"String\",\n\t}\n}\n\ntype OpsItemEventFilterKey string\n\n// Enum values for OpsItemEventFilterKey\nconst (\n\tOpsItemEventFilterKeyOpsitemId OpsItemEventFilterKey = \"OpsItemId\"\n)\n\n// Values returns all known values for OpsItemEventFilterKey. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemEventFilterKey) Values() []OpsItemEventFilterKey {\n\treturn []OpsItemEventFilterKey{\n\t\t\"OpsItemId\",\n\t}\n}\n\ntype OpsItemEventFilterOperator string\n\n// Enum values for OpsItemEventFilterOperator\nconst (\n\tOpsItemEventFilterOperatorEqual OpsItemEventFilterOperator = \"Equal\"\n)\n\n// Values returns all known values for OpsItemEventFilterOperator. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemEventFilterOperator) Values() []OpsItemEventFilterOperator {\n\treturn []OpsItemEventFilterOperator{\n\t\t\"Equal\",\n\t}\n}\n\ntype OpsItemFilterKey string\n\n// Enum values for OpsItemFilterKey\nconst (\n\tOpsItemFilterKeyStatus                            OpsItemFilterKey = \"Status\"\n\tOpsItemFilterKeyCreatedBy                         OpsItemFilterKey = \"CreatedBy\"\n\tOpsItemFilterKeySource                            OpsItemFilterKey = \"Source\"\n\tOpsItemFilterKeyPriority                          OpsItemFilterKey = \"Priority\"\n\tOpsItemFilterKeyTitle                             OpsItemFilterKey = \"Title\"\n\tOpsItemFilterKeyOpsitemId                         OpsItemFilterKey = \"OpsItemId\"\n\tOpsItemFilterKeyCreatedTime                       OpsItemFilterKey = \"CreatedTime\"\n\tOpsItemFilterKeyLastModifiedTime                  OpsItemFilterKey = \"LastModifiedTime\"\n\tOpsItemFilterKeyActualStartTime                   OpsItemFilterKey = \"ActualStartTime\"\n\tOpsItemFilterKeyActualEndTime                     OpsItemFilterKey = \"ActualEndTime\"\n\tOpsItemFilterKeyPlannedStartTime                  OpsItemFilterKey = \"PlannedStartTime\"\n\tOpsItemFilterKeyPlannedEndTime                    OpsItemFilterKey = \"PlannedEndTime\"\n\tOpsItemFilterKeyOperationalData                   OpsItemFilterKey = \"OperationalData\"\n\tOpsItemFilterKeyOperationalDataKey                OpsItemFilterKey = \"OperationalDataKey\"\n\tOpsItemFilterKeyOperationalDataValue              OpsItemFilterKey = \"OperationalDataValue\"\n\tOpsItemFilterKeyResourceId                        OpsItemFilterKey = \"ResourceId\"\n\tOpsItemFilterKeyAutomationId                      OpsItemFilterKey = \"AutomationId\"\n\tOpsItemFilterKeyCategory                          OpsItemFilterKey = \"Category\"\n\tOpsItemFilterKeySeverity                          OpsItemFilterKey = \"Severity\"\n\tOpsItemFilterKeyOpsitemType                       OpsItemFilterKey = \"OpsItemType\"\n\tOpsItemFilterKeyChangeRequestRequesterArn         OpsItemFilterKey = \"ChangeRequestByRequesterArn\"\n\tOpsItemFilterKeyChangeRequestRequesterName        OpsItemFilterKey = \"ChangeRequestByRequesterName\"\n\tOpsItemFilterKeyChangeRequestApproverArn          OpsItemFilterKey = \"ChangeRequestByApproverArn\"\n\tOpsItemFilterKeyChangeRequestApproverName         OpsItemFilterKey = \"ChangeRequestByApproverName\"\n\tOpsItemFilterKeyChangeRequestTemplate             OpsItemFilterKey = \"ChangeRequestByTemplate\"\n\tOpsItemFilterKeyChangeRequestTargetsResourceGroup OpsItemFilterKey = \"ChangeRequestByTargetsResourceGroup\"\n\tOpsItemFilterKeyInsightType                       OpsItemFilterKey = \"InsightByType\"\n\tOpsItemFilterKeyAccountId                         OpsItemFilterKey = \"AccountId\"\n)\n\n// Values returns all known values for OpsItemFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemFilterKey) Values() []OpsItemFilterKey {\n\treturn []OpsItemFilterKey{\n\t\t\"Status\",\n\t\t\"CreatedBy\",\n\t\t\"Source\",\n\t\t\"Priority\",\n\t\t\"Title\",\n\t\t\"OpsItemId\",\n\t\t\"CreatedTime\",\n\t\t\"LastModifiedTime\",\n\t\t\"ActualStartTime\",\n\t\t\"ActualEndTime\",\n\t\t\"PlannedStartTime\",\n\t\t\"PlannedEndTime\",\n\t\t\"OperationalData\",\n\t\t\"OperationalDataKey\",\n\t\t\"OperationalDataValue\",\n\t\t\"ResourceId\",\n\t\t\"AutomationId\",\n\t\t\"Category\",\n\t\t\"Severity\",\n\t\t\"OpsItemType\",\n\t\t\"ChangeRequestByRequesterArn\",\n\t\t\"ChangeRequestByRequesterName\",\n\t\t\"ChangeRequestByApproverArn\",\n\t\t\"ChangeRequestByApproverName\",\n\t\t\"ChangeRequestByTemplate\",\n\t\t\"ChangeRequestByTargetsResourceGroup\",\n\t\t\"InsightByType\",\n\t\t\"AccountId\",\n\t}\n}\n\ntype OpsItemFilterOperator string\n\n// Enum values for OpsItemFilterOperator\nconst (\n\tOpsItemFilterOperatorEqual       OpsItemFilterOperator = \"Equal\"\n\tOpsItemFilterOperatorContains    OpsItemFilterOperator = \"Contains\"\n\tOpsItemFilterOperatorGreaterThan OpsItemFilterOperator = \"GreaterThan\"\n\tOpsItemFilterOperatorLessThan    OpsItemFilterOperator = \"LessThan\"\n)\n\n// Values returns all known values for OpsItemFilterOperator. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemFilterOperator) Values() []OpsItemFilterOperator {\n\treturn []OpsItemFilterOperator{\n\t\t\"Equal\",\n\t\t\"Contains\",\n\t\t\"GreaterThan\",\n\t\t\"LessThan\",\n\t}\n}\n\ntype OpsItemRelatedItemsFilterKey string\n\n// Enum values for OpsItemRelatedItemsFilterKey\nconst (\n\tOpsItemRelatedItemsFilterKeyResourceType  OpsItemRelatedItemsFilterKey = \"ResourceType\"\n\tOpsItemRelatedItemsFilterKeyAssociationId OpsItemRelatedItemsFilterKey = \"AssociationId\"\n\tOpsItemRelatedItemsFilterKeyResourceUri   OpsItemRelatedItemsFilterKey = \"ResourceUri\"\n)\n\n// Values returns all known values for OpsItemRelatedItemsFilterKey. Note that\n// this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (OpsItemRelatedItemsFilterKey) Values() []OpsItemRelatedItemsFilterKey {\n\treturn []OpsItemRelatedItemsFilterKey{\n\t\t\"ResourceType\",\n\t\t\"AssociationId\",\n\t\t\"ResourceUri\",\n\t}\n}\n\ntype OpsItemRelatedItemsFilterOperator string\n\n// Enum values for OpsItemRelatedItemsFilterOperator\nconst (\n\tOpsItemRelatedItemsFilterOperatorEqual OpsItemRelatedItemsFilterOperator = \"Equal\"\n)\n\n// Values returns all known values for OpsItemRelatedItemsFilterOperator. Note\n// that this can be expanded in the future, and so it is only as up to date as the\n// client. The ordering of this slice is not guaranteed to be stable across\n// updates.\nfunc (OpsItemRelatedItemsFilterOperator) Values() []OpsItemRelatedItemsFilterOperator {\n\treturn []OpsItemRelatedItemsFilterOperator{\n\t\t\"Equal\",\n\t}\n}\n\ntype OpsItemStatus string\n\n// Enum values for OpsItemStatus\nconst (\n\tOpsItemStatusOpen                           OpsItemStatus = \"Open\"\n\tOpsItemStatusInProgress                     OpsItemStatus = \"InProgress\"\n\tOpsItemStatusResolved                       OpsItemStatus = \"Resolved\"\n\tOpsItemStatusPending                        OpsItemStatus = \"Pending\"\n\tOpsItemStatusTimedOut                       OpsItemStatus = \"TimedOut\"\n\tOpsItemStatusCancelling                     OpsItemStatus = \"Cancelling\"\n\tOpsItemStatusCancelled                      OpsItemStatus = \"Cancelled\"\n\tOpsItemStatusFailed                         OpsItemStatus = \"Failed\"\n\tOpsItemStatusCompletedWithSuccess           OpsItemStatus = \"CompletedWithSuccess\"\n\tOpsItemStatusCompletedWithFailure           OpsItemStatus = \"CompletedWithFailure\"\n\tOpsItemStatusScheduled                      OpsItemStatus = \"Scheduled\"\n\tOpsItemStatusRunbookInProgress              OpsItemStatus = \"RunbookInProgress\"\n\tOpsItemStatusPendingChangeCalendarOverride  OpsItemStatus = \"PendingChangeCalendarOverride\"\n\tOpsItemStatusChangeCalendarOverrideApproved OpsItemStatus = \"ChangeCalendarOverrideApproved\"\n\tOpsItemStatusChangeCalendarOverrideRejected OpsItemStatus = \"ChangeCalendarOverrideRejected\"\n\tOpsItemStatusPendingApproval                OpsItemStatus = \"PendingApproval\"\n\tOpsItemStatusApproved                       OpsItemStatus = \"Approved\"\n\tOpsItemStatusRejected                       OpsItemStatus = \"Rejected\"\n\tOpsItemStatusClosed                         OpsItemStatus = \"Closed\"\n)\n\n// Values returns all known values for OpsItemStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (OpsItemStatus) Values() []OpsItemStatus {\n\treturn []OpsItemStatus{\n\t\t\"Open\",\n\t\t\"InProgress\",\n\t\t\"Resolved\",\n\t\t\"Pending\",\n\t\t\"TimedOut\",\n\t\t\"Cancelling\",\n\t\t\"Cancelled\",\n\t\t\"Failed\",\n\t\t\"CompletedWithSuccess\",\n\t\t\"CompletedWithFailure\",\n\t\t\"Scheduled\",\n\t\t\"RunbookInProgress\",\n\t\t\"PendingChangeCalendarOverride\",\n\t\t\"ChangeCalendarOverrideApproved\",\n\t\t\"ChangeCalendarOverrideRejected\",\n\t\t\"PendingApproval\",\n\t\t\"Approved\",\n\t\t\"Rejected\",\n\t\t\"Closed\",\n\t}\n}\n\ntype ParametersFilterKey string\n\n// Enum values for ParametersFilterKey\nconst (\n\tParametersFilterKeyName  ParametersFilterKey = \"Name\"\n\tParametersFilterKeyType  ParametersFilterKey = \"Type\"\n\tParametersFilterKeyKeyId ParametersFilterKey = \"KeyId\"\n)\n\n// Values returns all known values for ParametersFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ParametersFilterKey) Values() []ParametersFilterKey {\n\treturn []ParametersFilterKey{\n\t\t\"Name\",\n\t\t\"Type\",\n\t\t\"KeyId\",\n\t}\n}\n\ntype ParameterTier string\n\n// Enum values for ParameterTier\nconst (\n\tParameterTierStandard           ParameterTier = \"Standard\"\n\tParameterTierAdvanced           ParameterTier = \"Advanced\"\n\tParameterTierIntelligentTiering ParameterTier = \"Intelligent-Tiering\"\n)\n\n// Values returns all known values for ParameterTier. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ParameterTier) Values() []ParameterTier {\n\treturn []ParameterTier{\n\t\t\"Standard\",\n\t\t\"Advanced\",\n\t\t\"Intelligent-Tiering\",\n\t}\n}\n\ntype ParameterType string\n\n// Enum values for ParameterType\nconst (\n\tParameterTypeString       ParameterType = \"String\"\n\tParameterTypeStringList   ParameterType = \"StringList\"\n\tParameterTypeSecureString ParameterType = \"SecureString\"\n)\n\n// Values returns all known values for ParameterType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ParameterType) Values() []ParameterType {\n\treturn []ParameterType{\n\t\t\"String\",\n\t\t\"StringList\",\n\t\t\"SecureString\",\n\t}\n}\n\ntype PatchAction string\n\n// Enum values for PatchAction\nconst (\n\tPatchActionAllowAsDependency PatchAction = \"ALLOW_AS_DEPENDENCY\"\n\tPatchActionBlock             PatchAction = \"BLOCK\"\n)\n\n// Values returns all known values for PatchAction. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (PatchAction) Values() []PatchAction {\n\treturn []PatchAction{\n\t\t\"ALLOW_AS_DEPENDENCY\",\n\t\t\"BLOCK\",\n\t}\n}\n\ntype PatchComplianceDataState string\n\n// Enum values for PatchComplianceDataState\nconst (\n\tPatchComplianceDataStateInstalled              PatchComplianceDataState = \"INSTALLED\"\n\tPatchComplianceDataStateInstalledOther         PatchComplianceDataState = \"INSTALLED_OTHER\"\n\tPatchComplianceDataStateInstalledPendingReboot PatchComplianceDataState = \"INSTALLED_PENDING_REBOOT\"\n\tPatchComplianceDataStateInstalledRejected      PatchComplianceDataState = \"INSTALLED_REJECTED\"\n\tPatchComplianceDataStateMissing                PatchComplianceDataState = \"MISSING\"\n\tPatchComplianceDataStateNotApplicable          PatchComplianceDataState = \"NOT_APPLICABLE\"\n\tPatchComplianceDataStateFailed                 PatchComplianceDataState = \"FAILED\"\n)\n\n// Values returns all known values for PatchComplianceDataState. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchComplianceDataState) Values() []PatchComplianceDataState {\n\treturn []PatchComplianceDataState{\n\t\t\"INSTALLED\",\n\t\t\"INSTALLED_OTHER\",\n\t\t\"INSTALLED_PENDING_REBOOT\",\n\t\t\"INSTALLED_REJECTED\",\n\t\t\"MISSING\",\n\t\t\"NOT_APPLICABLE\",\n\t\t\"FAILED\",\n\t}\n}\n\ntype PatchComplianceLevel string\n\n// Enum values for PatchComplianceLevel\nconst (\n\tPatchComplianceLevelCritical      PatchComplianceLevel = \"CRITICAL\"\n\tPatchComplianceLevelHigh          PatchComplianceLevel = \"HIGH\"\n\tPatchComplianceLevelMedium        PatchComplianceLevel = \"MEDIUM\"\n\tPatchComplianceLevelLow           PatchComplianceLevel = \"LOW\"\n\tPatchComplianceLevelInformational PatchComplianceLevel = \"INFORMATIONAL\"\n\tPatchComplianceLevelUnspecified   PatchComplianceLevel = \"UNSPECIFIED\"\n)\n\n// Values returns all known values for PatchComplianceLevel. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchComplianceLevel) Values() []PatchComplianceLevel {\n\treturn []PatchComplianceLevel{\n\t\t\"CRITICAL\",\n\t\t\"HIGH\",\n\t\t\"MEDIUM\",\n\t\t\"LOW\",\n\t\t\"INFORMATIONAL\",\n\t\t\"UNSPECIFIED\",\n\t}\n}\n\ntype PatchDeploymentStatus string\n\n// Enum values for PatchDeploymentStatus\nconst (\n\tPatchDeploymentStatusApproved         PatchDeploymentStatus = \"APPROVED\"\n\tPatchDeploymentStatusPendingApproval  PatchDeploymentStatus = \"PENDING_APPROVAL\"\n\tPatchDeploymentStatusExplicitApproved PatchDeploymentStatus = \"EXPLICIT_APPROVED\"\n\tPatchDeploymentStatusExplicitRejected PatchDeploymentStatus = \"EXPLICIT_REJECTED\"\n)\n\n// Values returns all known values for PatchDeploymentStatus. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchDeploymentStatus) Values() []PatchDeploymentStatus {\n\treturn []PatchDeploymentStatus{\n\t\t\"APPROVED\",\n\t\t\"PENDING_APPROVAL\",\n\t\t\"EXPLICIT_APPROVED\",\n\t\t\"EXPLICIT_REJECTED\",\n\t}\n}\n\ntype PatchFilterKey string\n\n// Enum values for PatchFilterKey\nconst (\n\tPatchFilterKeyArch           PatchFilterKey = \"ARCH\"\n\tPatchFilterKeyAdvisoryId     PatchFilterKey = \"ADVISORY_ID\"\n\tPatchFilterKeyBugzillaId     PatchFilterKey = \"BUGZILLA_ID\"\n\tPatchFilterKeyPatchSet       PatchFilterKey = \"PATCH_SET\"\n\tPatchFilterKeyProduct        PatchFilterKey = \"PRODUCT\"\n\tPatchFilterKeyProductFamily  PatchFilterKey = \"PRODUCT_FAMILY\"\n\tPatchFilterKeyClassification PatchFilterKey = \"CLASSIFICATION\"\n\tPatchFilterKeyCVEId          PatchFilterKey = \"CVE_ID\"\n\tPatchFilterKeyEpoch          PatchFilterKey = \"EPOCH\"\n\tPatchFilterKeyMsrcSeverity   PatchFilterKey = \"MSRC_SEVERITY\"\n\tPatchFilterKeyName           PatchFilterKey = \"NAME\"\n\tPatchFilterKeyPatchId        PatchFilterKey = \"PATCH_ID\"\n\tPatchFilterKeySection        PatchFilterKey = \"SECTION\"\n\tPatchFilterKeyPriority       PatchFilterKey = \"PRIORITY\"\n\tPatchFilterKeyRepository     PatchFilterKey = \"REPOSITORY\"\n\tPatchFilterKeyRelease        PatchFilterKey = \"RELEASE\"\n\tPatchFilterKeySeverity       PatchFilterKey = \"SEVERITY\"\n\tPatchFilterKeySecurity       PatchFilterKey = \"SECURITY\"\n\tPatchFilterKeyVersion        PatchFilterKey = \"VERSION\"\n)\n\n// Values returns all known values for PatchFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchFilterKey) Values() []PatchFilterKey {\n\treturn []PatchFilterKey{\n\t\t\"ARCH\",\n\t\t\"ADVISORY_ID\",\n\t\t\"BUGZILLA_ID\",\n\t\t\"PATCH_SET\",\n\t\t\"PRODUCT\",\n\t\t\"PRODUCT_FAMILY\",\n\t\t\"CLASSIFICATION\",\n\t\t\"CVE_ID\",\n\t\t\"EPOCH\",\n\t\t\"MSRC_SEVERITY\",\n\t\t\"NAME\",\n\t\t\"PATCH_ID\",\n\t\t\"SECTION\",\n\t\t\"PRIORITY\",\n\t\t\"REPOSITORY\",\n\t\t\"RELEASE\",\n\t\t\"SEVERITY\",\n\t\t\"SECURITY\",\n\t\t\"VERSION\",\n\t}\n}\n\ntype PatchOperationType string\n\n// Enum values for PatchOperationType\nconst (\n\tPatchOperationTypeScan    PatchOperationType = \"Scan\"\n\tPatchOperationTypeInstall PatchOperationType = \"Install\"\n)\n\n// Values returns all known values for PatchOperationType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchOperationType) Values() []PatchOperationType {\n\treturn []PatchOperationType{\n\t\t\"Scan\",\n\t\t\"Install\",\n\t}\n}\n\ntype PatchProperty string\n\n// Enum values for PatchProperty\nconst (\n\tPatchPropertyProduct             PatchProperty = \"PRODUCT\"\n\tPatchPropertyPatchProductFamily  PatchProperty = \"PRODUCT_FAMILY\"\n\tPatchPropertyPatchClassification PatchProperty = \"CLASSIFICATION\"\n\tPatchPropertyPatchMsrcSeverity   PatchProperty = \"MSRC_SEVERITY\"\n\tPatchPropertyPatchPriority       PatchProperty = \"PRIORITY\"\n\tPatchPropertyPatchSeverity       PatchProperty = \"SEVERITY\"\n)\n\n// Values returns all known values for PatchProperty. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PatchProperty) Values() []PatchProperty {\n\treturn []PatchProperty{\n\t\t\"PRODUCT\",\n\t\t\"PRODUCT_FAMILY\",\n\t\t\"CLASSIFICATION\",\n\t\t\"MSRC_SEVERITY\",\n\t\t\"PRIORITY\",\n\t\t\"SEVERITY\",\n\t}\n}\n\ntype PatchSet string\n\n// Enum values for PatchSet\nconst (\n\tPatchSetOs          PatchSet = \"OS\"\n\tPatchSetApplication PatchSet = \"APPLICATION\"\n)\n\n// Values returns all known values for PatchSet. Note that this can be expanded in\n// the future, and so it is only as up to date as the client. The ordering of this\n// slice is not guaranteed to be stable across updates.\nfunc (PatchSet) Values() []PatchSet {\n\treturn []PatchSet{\n\t\t\"OS\",\n\t\t\"APPLICATION\",\n\t}\n}\n\ntype PingStatus string\n\n// Enum values for PingStatus\nconst (\n\tPingStatusOnline         PingStatus = \"Online\"\n\tPingStatusConnectionLost PingStatus = \"ConnectionLost\"\n\tPingStatusInactive       PingStatus = \"Inactive\"\n)\n\n// Values returns all known values for PingStatus. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (PingStatus) Values() []PingStatus {\n\treturn []PingStatus{\n\t\t\"Online\",\n\t\t\"ConnectionLost\",\n\t\t\"Inactive\",\n\t}\n}\n\ntype PlatformType string\n\n// Enum values for PlatformType\nconst (\n\tPlatformTypeWindows PlatformType = \"Windows\"\n\tPlatformTypeLinux   PlatformType = \"Linux\"\n\tPlatformTypeMacos   PlatformType = \"MacOS\"\n)\n\n// Values returns all known values for PlatformType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (PlatformType) Values() []PlatformType {\n\treturn []PlatformType{\n\t\t\"Windows\",\n\t\t\"Linux\",\n\t\t\"MacOS\",\n\t}\n}\n\ntype RebootOption string\n\n// Enum values for RebootOption\nconst (\n\tRebootOptionRebootIfNeeded RebootOption = \"RebootIfNeeded\"\n\tRebootOptionNoReboot       RebootOption = \"NoReboot\"\n)\n\n// Values returns all known values for RebootOption. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (RebootOption) Values() []RebootOption {\n\treturn []RebootOption{\n\t\t\"RebootIfNeeded\",\n\t\t\"NoReboot\",\n\t}\n}\n\ntype ResourceDataSyncS3Format string\n\n// Enum values for ResourceDataSyncS3Format\nconst (\n\tResourceDataSyncS3FormatJsonSerde ResourceDataSyncS3Format = \"JsonSerDe\"\n)\n\n// Values returns all known values for ResourceDataSyncS3Format. Note that this\n// can be expanded in the future, and so it is only as up to date as the client.\n// The ordering of this slice is not guaranteed to be stable across updates.\nfunc (ResourceDataSyncS3Format) Values() []ResourceDataSyncS3Format {\n\treturn []ResourceDataSyncS3Format{\n\t\t\"JsonSerDe\",\n\t}\n}\n\ntype ResourceType string\n\n// Enum values for ResourceType\nconst (\n\tResourceTypeManagedInstance ResourceType = \"ManagedInstance\"\n\tResourceTypeEc2Instance     ResourceType = \"EC2Instance\"\n)\n\n// Values returns all known values for ResourceType. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ResourceType) Values() []ResourceType {\n\treturn []ResourceType{\n\t\t\"ManagedInstance\",\n\t\t\"EC2Instance\",\n\t}\n}\n\ntype ResourceTypeForTagging string\n\n// Enum values for ResourceTypeForTagging\nconst (\n\tResourceTypeForTaggingDocument          ResourceTypeForTagging = \"Document\"\n\tResourceTypeForTaggingManagedInstance   ResourceTypeForTagging = \"ManagedInstance\"\n\tResourceTypeForTaggingMaintenanceWindow ResourceTypeForTagging = \"MaintenanceWindow\"\n\tResourceTypeForTaggingParameter         ResourceTypeForTagging = \"Parameter\"\n\tResourceTypeForTaggingPatchBaseline     ResourceTypeForTagging = \"PatchBaseline\"\n\tResourceTypeForTaggingOpsItem           ResourceTypeForTagging = \"OpsItem\"\n\tResourceTypeForTaggingOpsmetadata       ResourceTypeForTagging = \"OpsMetadata\"\n\tResourceTypeForTaggingAutomation        ResourceTypeForTagging = \"Automation\"\n\tResourceTypeForTaggingAssociation       ResourceTypeForTagging = \"Association\"\n)\n\n// Values returns all known values for ResourceTypeForTagging. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ResourceTypeForTagging) Values() []ResourceTypeForTagging {\n\treturn []ResourceTypeForTagging{\n\t\t\"Document\",\n\t\t\"ManagedInstance\",\n\t\t\"MaintenanceWindow\",\n\t\t\"Parameter\",\n\t\t\"PatchBaseline\",\n\t\t\"OpsItem\",\n\t\t\"OpsMetadata\",\n\t\t\"Automation\",\n\t\t\"Association\",\n\t}\n}\n\ntype ReviewStatus string\n\n// Enum values for ReviewStatus\nconst (\n\tReviewStatusApproved    ReviewStatus = \"APPROVED\"\n\tReviewStatusNotReviewed ReviewStatus = \"NOT_REVIEWED\"\n\tReviewStatusPending     ReviewStatus = \"PENDING\"\n\tReviewStatusRejected    ReviewStatus = \"REJECTED\"\n)\n\n// Values returns all known values for ReviewStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (ReviewStatus) Values() []ReviewStatus {\n\treturn []ReviewStatus{\n\t\t\"APPROVED\",\n\t\t\"NOT_REVIEWED\",\n\t\t\"PENDING\",\n\t\t\"REJECTED\",\n\t}\n}\n\ntype SessionFilterKey string\n\n// Enum values for SessionFilterKey\nconst (\n\tSessionFilterKeyInvokedAfter  SessionFilterKey = \"InvokedAfter\"\n\tSessionFilterKeyInvokedBefore SessionFilterKey = \"InvokedBefore\"\n\tSessionFilterKeyTargetId      SessionFilterKey = \"Target\"\n\tSessionFilterKeyOwner         SessionFilterKey = \"Owner\"\n\tSessionFilterKeyStatus        SessionFilterKey = \"Status\"\n\tSessionFilterKeySessionId     SessionFilterKey = \"SessionId\"\n)\n\n// Values returns all known values for SessionFilterKey. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (SessionFilterKey) Values() []SessionFilterKey {\n\treturn []SessionFilterKey{\n\t\t\"InvokedAfter\",\n\t\t\"InvokedBefore\",\n\t\t\"Target\",\n\t\t\"Owner\",\n\t\t\"Status\",\n\t\t\"SessionId\",\n\t}\n}\n\ntype SessionState string\n\n// Enum values for SessionState\nconst (\n\tSessionStateActive  SessionState = \"Active\"\n\tSessionStateHistory SessionState = \"History\"\n)\n\n// Values returns all known values for SessionState. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (SessionState) Values() []SessionState {\n\treturn []SessionState{\n\t\t\"Active\",\n\t\t\"History\",\n\t}\n}\n\ntype SessionStatus string\n\n// Enum values for SessionStatus\nconst (\n\tSessionStatusConnected    SessionStatus = \"Connected\"\n\tSessionStatusConnecting   SessionStatus = \"Connecting\"\n\tSessionStatusDisconnected SessionStatus = \"Disconnected\"\n\tSessionStatusTerminated   SessionStatus = \"Terminated\"\n\tSessionStatusTerminating  SessionStatus = \"Terminating\"\n\tSessionStatusFailed       SessionStatus = \"Failed\"\n)\n\n// Values returns all known values for SessionStatus. Note that this can be\n// expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (SessionStatus) Values() []SessionStatus {\n\treturn []SessionStatus{\n\t\t\"Connected\",\n\t\t\"Connecting\",\n\t\t\"Disconnected\",\n\t\t\"Terminated\",\n\t\t\"Terminating\",\n\t\t\"Failed\",\n\t}\n}\n\ntype SignalType string\n\n// Enum values for SignalType\nconst (\n\tSignalTypeApprove   SignalType = \"Approve\"\n\tSignalTypeReject    SignalType = \"Reject\"\n\tSignalTypeStartStep SignalType = \"StartStep\"\n\tSignalTypeStopStep  SignalType = \"StopStep\"\n\tSignalTypeResume    SignalType = \"Resume\"\n)\n\n// Values returns all known values for SignalType. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (SignalType) Values() []SignalType {\n\treturn []SignalType{\n\t\t\"Approve\",\n\t\t\"Reject\",\n\t\t\"StartStep\",\n\t\t\"StopStep\",\n\t\t\"Resume\",\n\t}\n}\n\ntype SourceType string\n\n// Enum values for SourceType\nconst (\n\tSourceTypeAwsEc2Instance        SourceType = \"AWS::EC2::Instance\"\n\tSourceTypeAwsIotThing           SourceType = \"AWS::IoT::Thing\"\n\tSourceTypeAwsSsmManagedinstance SourceType = \"AWS::SSM::ManagedInstance\"\n)\n\n// Values returns all known values for SourceType. Note that this can be expanded\n// in the future, and so it is only as up to date as the client. The ordering of\n// this slice is not guaranteed to be stable across updates.\nfunc (SourceType) Values() []SourceType {\n\treturn []SourceType{\n\t\t\"AWS::EC2::Instance\",\n\t\t\"AWS::IoT::Thing\",\n\t\t\"AWS::SSM::ManagedInstance\",\n\t}\n}\n\ntype StepExecutionFilterKey string\n\n// Enum values for StepExecutionFilterKey\nconst (\n\tStepExecutionFilterKeyStartTimeBefore         StepExecutionFilterKey = \"StartTimeBefore\"\n\tStepExecutionFilterKeyStartTimeAfter          StepExecutionFilterKey = \"StartTimeAfter\"\n\tStepExecutionFilterKeyStepExecutionStatus     StepExecutionFilterKey = \"StepExecutionStatus\"\n\tStepExecutionFilterKeyStepExecutionId         StepExecutionFilterKey = \"StepExecutionId\"\n\tStepExecutionFilterKeyStepName                StepExecutionFilterKey = \"StepName\"\n\tStepExecutionFilterKeyAction                  StepExecutionFilterKey = \"Action\"\n\tStepExecutionFilterKeyParentStepExecutionId   StepExecutionFilterKey = \"ParentStepExecutionId\"\n\tStepExecutionFilterKeyParentStepIteration     StepExecutionFilterKey = \"ParentStepIteration\"\n\tStepExecutionFilterKeyParentStepIteratorValue StepExecutionFilterKey = \"ParentStepIteratorValue\"\n)\n\n// Values returns all known values for StepExecutionFilterKey. Note that this can\n// be expanded in the future, and so it is only as up to date as the client. The\n// ordering of this slice is not guaranteed to be stable across updates.\nfunc (StepExecutionFilterKey) Values() []StepExecutionFilterKey {\n\treturn []StepExecutionFilterKey{\n\t\t\"StartTimeBefore\",\n\t\t\"StartTimeAfter\",\n\t\t\"StepExecutionStatus\",\n\t\t\"StepExecutionId\",\n\t\t\"StepName\",\n\t\t\"Action\",\n\t\t\"ParentStepExecutionId\",\n\t\t\"ParentStepIteration\",\n\t\t\"ParentStepIteratorValue\",\n\t}\n}\n\ntype StopType string\n\n// Enum values for StopType\nconst (\n\tStopTypeComplete StopType = \"Complete\"\n\tStopTypeCancel   StopType = \"Cancel\"\n)\n\n// Values returns all known values for StopType. Note that this can be expanded in\n// the future, and so it is only as up to date as the client. The ordering of this\n// slice is not guaranteed to be stable across updates.\nfunc (StopType) Values() []StopType {\n\treturn []StopType{\n\t\t\"Complete\",\n\t\t\"Cancel\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// Error returned if an attempt is made to register a patch group with a patch\n// baseline that is already registered with a different patch baseline.\ntype AlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You must disassociate a document from all managed nodes before you can delete\n// it.\ntype AssociatedInstances struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociatedInstances) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociatedInstances) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociatedInstances) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociatedInstances\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociatedInstances) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified association already exists.\ntype AssociationAlreadyExists struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociationAlreadyExists) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociationAlreadyExists) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociationAlreadyExists) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociationAlreadyExists\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociationAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified association doesn't exist.\ntype AssociationDoesNotExist struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociationDoesNotExist) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociationDoesNotExist) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociationDoesNotExist) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociationDoesNotExist\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociationDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified execution ID doesn't exist. Verify the ID number and try again.\ntype AssociationExecutionDoesNotExist struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociationExecutionDoesNotExist) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociationExecutionDoesNotExist) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociationExecutionDoesNotExist) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociationExecutionDoesNotExist\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociationExecutionDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You can have at most 2,000 active associations.\ntype AssociationLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociationLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociationLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociationLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociationLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociationLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You have reached the maximum number versions allowed for an association. Each\n// association has a limit of 1,000 versions.\ntype AssociationVersionLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AssociationVersionLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AssociationVersionLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AssociationVersionLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AssociationVersionLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AssociationVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the Change Manager change template used in the change request\n// was rejected or is still in a pending state.\ntype AutomationDefinitionNotApprovedException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationDefinitionNotApprovedException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationDefinitionNotApprovedException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationDefinitionNotApprovedException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationDefinitionNotApprovedException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationDefinitionNotApprovedException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// An Automation runbook with the specified name couldn't be found.\ntype AutomationDefinitionNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationDefinitionNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationDefinitionNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationDefinitionNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationDefinitionNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationDefinitionNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// An Automation runbook with the specified name and version couldn't be found.\ntype AutomationDefinitionVersionNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationDefinitionVersionNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationDefinitionVersionNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationDefinitionVersionNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationDefinitionVersionNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationDefinitionVersionNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The number of simultaneously running Automation executions exceeded the\n// allowable limit.\ntype AutomationExecutionLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationExecutionLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationExecutionLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationExecutionLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationExecutionLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationExecutionLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// There is no automation execution information for the requested automation\n// execution ID.\ntype AutomationExecutionNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationExecutionNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationExecutionNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationExecutionNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationExecutionNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationExecutionNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified step name and execution ID don't exist. Verify the information\n// and try again.\ntype AutomationStepNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AutomationStepNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AutomationStepNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AutomationStepNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AutomationStepNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AutomationStepNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You specified too many custom compliance types. You can specify a maximum of 10\n// different types.\ntype ComplianceTypeCountLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ComplianceTypeCountLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ComplianceTypeCountLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ComplianceTypeCountLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ComplianceTypeCountLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ComplianceTypeCountLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// You have exceeded the limit for custom schemas. Delete one or more custom\n// schemas and try again.\ntype CustomSchemaCountLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *CustomSchemaCountLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *CustomSchemaCountLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *CustomSchemaCountLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"CustomSchemaCountLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *CustomSchemaCountLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified document already exists.\ntype DocumentAlreadyExists struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DocumentAlreadyExists) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DocumentAlreadyExists) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DocumentAlreadyExists) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DocumentAlreadyExists\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DocumentAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You can have at most 500 active SSM documents.\ntype DocumentLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DocumentLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DocumentLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DocumentLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DocumentLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DocumentLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The document can't be shared with more Amazon Web Services accounts. You can\n// specify a maximum of 20 accounts per API operation to share a private document.\n// By default, you can share a private document with a maximum of 1,000 accounts\n// and publicly share up to five documents. If you need to increase the quota for\n// privately or publicly shared Systems Manager documents, contact Amazon Web\n// Services Support.\ntype DocumentPermissionLimit struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DocumentPermissionLimit) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DocumentPermissionLimit) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DocumentPermissionLimit) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DocumentPermissionLimit\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DocumentPermissionLimit) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The document has too many versions. Delete one or more document versions and\n// try again.\ntype DocumentVersionLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DocumentVersionLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DocumentVersionLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DocumentVersionLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DocumentVersionLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DocumentVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Error returned when the ID specified for a resource, such as a maintenance\n// window or patch baseline, doesn't exist. For information about resource quotas\n// in Amazon Web Services Systems Manager, see Systems Manager service quotas (https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm)\n// in the Amazon Web Services General Reference.\ntype DoesNotExistException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DoesNotExistException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DoesNotExistException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DoesNotExistException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DoesNotExistException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The content of the association document matches another document. Change the\n// content of the document and try again.\ntype DuplicateDocumentContent struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DuplicateDocumentContent) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DuplicateDocumentContent) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DuplicateDocumentContent) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DuplicateDocumentContent\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DuplicateDocumentContent) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The version name has already been used in this document. Specify a different\n// version name, and then try again.\ntype DuplicateDocumentVersionName struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DuplicateDocumentVersionName) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DuplicateDocumentVersionName) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DuplicateDocumentVersionName) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DuplicateDocumentVersionName\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DuplicateDocumentVersionName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You can't specify a managed node ID in more than one association.\ntype DuplicateInstanceId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *DuplicateInstanceId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *DuplicateInstanceId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *DuplicateInstanceId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"DuplicateInstanceId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *DuplicateInstanceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You attempted to register a LAMBDA or STEP_FUNCTIONS task in a region where the\n// corresponding service isn't available.\ntype FeatureNotAvailableException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *FeatureNotAvailableException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *FeatureNotAvailableException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *FeatureNotAvailableException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"FeatureNotAvailableException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *FeatureNotAvailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A hierarchy can have a maximum of 15 levels. For more information, see\n// Requirements and constraints for parameter names (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html)\n// in the Amazon Web Services Systems Manager User Guide.\ntype HierarchyLevelLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *HierarchyLevelLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *HierarchyLevelLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *HierarchyLevelLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"HierarchyLevelLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *HierarchyLevelLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// Parameter Store doesn't support changing a parameter type in a hierarchy. For\n// example, you can't change a parameter from a String type to a SecureString\n// type. You must create a new, unique parameter.\ntype HierarchyTypeMismatchException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *HierarchyTypeMismatchException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *HierarchyTypeMismatchException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *HierarchyTypeMismatchException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"HierarchyTypeMismatchException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *HierarchyTypeMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Error returned when an idempotent operation is retried and the parameters don't\n// match the original call to the API with the same idempotency token.\ntype IdempotentParameterMismatch struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *IdempotentParameterMismatch) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *IdempotentParameterMismatch) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *IdempotentParameterMismatch) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"IdempotentParameterMismatch\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *IdempotentParameterMismatch) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// There is a conflict in the policies specified for this parameter. You can't,\n// for example, specify two Expiration policies for a parameter. Review your\n// policies, and try again.\ntype IncompatiblePolicyException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *IncompatiblePolicyException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *IncompatiblePolicyException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *IncompatiblePolicyException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"IncompatiblePolicyException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *IncompatiblePolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// An error occurred on the server side.\ntype InternalServerError struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InternalServerError) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InternalServerError) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InternalServerError) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InternalServerError\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }\n\n// The activation isn't valid. The activation might have been deleted, or the\n// ActivationId and the ActivationCode don't match.\ntype InvalidActivation struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidActivation) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidActivation) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidActivation) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidActivation\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidActivation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The activation ID isn't valid. Verify the you entered the correct ActivationId\n// or ActivationCode and try again.\ntype InvalidActivationId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidActivationId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidActivationId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidActivationId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidActivationId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidActivationId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified aggregator isn't valid for inventory groups. Verify that the\n// aggregator uses a valid inventory type such as AWS:Application or\n// AWS:InstanceInformation .\ntype InvalidAggregatorException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAggregatorException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAggregatorException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAggregatorException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAggregatorException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAggregatorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The request doesn't meet the regular expression requirement.\ntype InvalidAllowedPatternException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAllowedPatternException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAllowedPatternException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAllowedPatternException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAllowedPatternException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAllowedPatternException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The association isn't valid or doesn't exist.\ntype InvalidAssociation struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAssociation) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAssociation) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAssociation) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAssociation\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAssociation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The version you specified isn't valid. Use ListAssociationVersions to view all\n// versions of an association according to the association ID. Or, use the $LATEST\n// parameter to view the latest version of the association.\ntype InvalidAssociationVersion struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAssociationVersion) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAssociationVersion) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAssociationVersion) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAssociationVersion\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAssociationVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The supplied parameters for invoking the specified Automation runbook are\n// incorrect. For example, they may not match the set of parameters permitted for\n// the specified Automation document.\ntype InvalidAutomationExecutionParametersException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAutomationExecutionParametersException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAutomationExecutionParametersException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAutomationExecutionParametersException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAutomationExecutionParametersException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAutomationExecutionParametersException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The signal isn't valid for the current Automation execution.\ntype InvalidAutomationSignalException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAutomationSignalException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAutomationSignalException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAutomationSignalException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAutomationSignalException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAutomationSignalException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified update status operation isn't valid.\ntype InvalidAutomationStatusUpdateException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAutomationStatusUpdateException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAutomationStatusUpdateException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAutomationStatusUpdateException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAutomationStatusUpdateException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAutomationStatusUpdateException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified command ID isn't valid. Verify the ID and try again.\ntype InvalidCommandId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidCommandId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidCommandId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidCommandId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidCommandId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidCommandId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// One or more of the parameters specified for the delete operation isn't valid.\n// Verify all parameters and try again.\ntype InvalidDeleteInventoryParametersException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDeleteInventoryParametersException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDeleteInventoryParametersException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDeleteInventoryParametersException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDeleteInventoryParametersException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDeleteInventoryParametersException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The ID specified for the delete operation doesn't exist or isn't valid. Verify\n// the ID and try again.\ntype InvalidDeletionIdException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDeletionIdException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDeletionIdException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDeletionIdException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDeletionIdException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDeletionIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified SSM document doesn't exist.\ntype InvalidDocument struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocument) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocument) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocument) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocument\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocument) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The content for the document isn't valid.\ntype InvalidDocumentContent struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocumentContent) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocumentContent) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocumentContent) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocumentContent\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocumentContent) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You attempted to delete a document while it is still shared. You must stop\n// sharing the document before you can delete it.\ntype InvalidDocumentOperation struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocumentOperation) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocumentOperation) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocumentOperation) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocumentOperation\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocumentOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The version of the document schema isn't supported.\ntype InvalidDocumentSchemaVersion struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocumentSchemaVersion) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocumentSchemaVersion) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocumentSchemaVersion) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocumentSchemaVersion\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocumentSchemaVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The SSM document type isn't valid. Valid document types are described in the\n// DocumentType property.\ntype InvalidDocumentType struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocumentType) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocumentType) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocumentType) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocumentType\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocumentType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The document version isn't valid or doesn't exist.\ntype InvalidDocumentVersion struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidDocumentVersion) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidDocumentVersion) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidDocumentVersion) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidDocumentVersion\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidDocumentVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The filter name isn't valid. Verify the you entered the correct name and try\n// again.\ntype InvalidFilter struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidFilter) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidFilter) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidFilter) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidFilter\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidFilter) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified key isn't valid.\ntype InvalidFilterKey struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidFilterKey) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidFilterKey) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidFilterKey) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidFilterKey\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidFilterKey) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified filter option isn't valid. Valid options are Equals and\n// BeginsWith. For Path filter, valid options are Recursive and OneLevel.\ntype InvalidFilterOption struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidFilterOption) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidFilterOption) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidFilterOption) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidFilterOption\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidFilterOption) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The filter value isn't valid. Verify the value and try again.\ntype InvalidFilterValue struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidFilterValue) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidFilterValue) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidFilterValue) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidFilterValue\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidFilterValue) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The following problems can cause this exception:\n//   - You don't have permission to access the managed node.\n//   - Amazon Web Services Systems Manager Agent(SSM Agent) isn't running. Verify\n//     that SSM Agent is running.\n//   - SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM\n//     Agent.\n//   - The managed node isn't in valid state. Valid states are: Running , Pending ,\n//     Stopped , and Stopping . Invalid states are: Shutting-down and Terminated .\ntype InvalidInstanceId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidInstanceId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidInstanceId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidInstanceId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidInstanceId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidInstanceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified filter value isn't valid.\ntype InvalidInstanceInformationFilterValue struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidInstanceInformationFilterValue) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidInstanceInformationFilterValue) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidInstanceInformationFilterValue) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidInstanceInformationFilterValue\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidInstanceInformationFilterValue) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified inventory group isn't valid.\ntype InvalidInventoryGroupException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidInventoryGroupException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidInventoryGroupException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidInventoryGroupException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidInventoryGroupException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidInventoryGroupException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You specified invalid keys or values in the Context attribute for InventoryItem\n// . Verify the keys and values, and try again.\ntype InvalidInventoryItemContextException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidInventoryItemContextException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidInventoryItemContextException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidInventoryItemContextException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidInventoryItemContextException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidInventoryItemContextException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The request isn't valid.\ntype InvalidInventoryRequestException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidInventoryRequestException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidInventoryRequestException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidInventoryRequestException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidInventoryRequestException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidInventoryRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// One or more content items isn't valid.\ntype InvalidItemContentException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidItemContentException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidItemContentException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidItemContentException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidItemContentException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidItemContentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The query key ID isn't valid.\ntype InvalidKeyId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidKeyId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidKeyId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidKeyId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidKeyId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidKeyId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified token isn't valid.\ntype InvalidNextToken struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidNextToken) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidNextToken) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidNextToken) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidNextToken\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidNextToken) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// One or more configuration items isn't valid. Verify that a valid Amazon\n// Resource Name (ARN) was provided for an Amazon Simple Notification Service\n// topic.\ntype InvalidNotificationConfig struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidNotificationConfig) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidNotificationConfig) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidNotificationConfig) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidNotificationConfig\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidNotificationConfig) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The delete inventory option specified isn't valid. Verify the option and try\n// again.\ntype InvalidOptionException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidOptionException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidOptionException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidOptionException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidOptionException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidOptionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The S3 bucket doesn't exist.\ntype InvalidOutputFolder struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidOutputFolder) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidOutputFolder) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidOutputFolder) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidOutputFolder\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidOutputFolder) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The output location isn't valid or doesn't exist.\ntype InvalidOutputLocation struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidOutputLocation) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidOutputLocation) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidOutputLocation) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidOutputLocation\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidOutputLocation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You must specify values for all required parameters in the Amazon Web Services\n// Systems Manager document (SSM document). You can only supply values to\n// parameters defined in the SSM document.\ntype InvalidParameters struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidParameters) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidParameters) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidParameters) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidParameters\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidParameters) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The permission type isn't supported. Share is the only supported permission\n// type.\ntype InvalidPermissionType struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidPermissionType) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidPermissionType) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidPermissionType) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidPermissionType\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidPermissionType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The plugin name isn't valid.\ntype InvalidPluginName struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidPluginName) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidPluginName) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidPluginName) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidPluginName\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidPluginName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A policy attribute or its value is invalid.\ntype InvalidPolicyAttributeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidPolicyAttributeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidPolicyAttributeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidPolicyAttributeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidPolicyAttributeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidPolicyAttributeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The policy type isn't supported. Parameter Store supports the following policy\n// types: Expiration, ExpirationNotification, and NoChangeNotification.\ntype InvalidPolicyTypeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidPolicyTypeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidPolicyTypeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidPolicyTypeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidPolicyTypeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidPolicyTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The resource ID isn't valid. Verify that you entered the correct ID and try\n// again.\ntype InvalidResourceId struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidResourceId) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidResourceId) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidResourceId) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidResourceId\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidResourceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The resource type isn't valid. For example, if you are attempting to tag an EC2\n// instance, the instance must be a registered managed node.\ntype InvalidResourceType struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidResourceType) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidResourceType) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidResourceType) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidResourceType\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidResourceType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified inventory item result attribute isn't valid.\ntype InvalidResultAttributeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidResultAttributeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidResultAttributeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidResultAttributeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidResultAttributeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidResultAttributeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The role name can't contain invalid characters. Also verify that you specified\n// an IAM role for notifications that includes the required trust policy. For\n// information about configuring the IAM role for Run Command notifications, see\n// Configuring Amazon SNS Notifications for Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html)\n// in the Amazon Web Services Systems Manager User Guide.\ntype InvalidRole struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidRole) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidRole) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidRole) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidRole\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidRole) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The schedule is invalid. Verify your cron or rate expression and try again.\ntype InvalidSchedule struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidSchedule) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidSchedule) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidSchedule) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidSchedule\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidSchedule) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified tag key or value isn't valid.\ntype InvalidTag struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTag) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTag) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTag) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTag\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTag) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The target isn't valid or doesn't exist. It might not be configured for Systems\n// Manager or you might not have permission to perform the operation.\ntype InvalidTarget struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTarget) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTarget) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTarget) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTarget\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTarget) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// TargetMap parameter isn't valid.\ntype InvalidTargetMaps struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTargetMaps) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTargetMaps) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTargetMaps) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTargetMaps\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTargetMaps) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The parameter type name isn't valid.\ntype InvalidTypeNameException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidTypeNameException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidTypeNameException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidTypeNameException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidTypeNameException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidTypeNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The update isn't valid.\ntype InvalidUpdate struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidUpdate) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidUpdate) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidUpdate) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidUpdate\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidUpdate) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The command ID and managed node ID you specified didn't match any invocations.\n// Verify the command ID and the managed node ID and try again.\ntype InvocationDoesNotExist struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvocationDoesNotExist) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvocationDoesNotExist) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvocationDoesNotExist) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvocationDoesNotExist\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvocationDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The inventory item has invalid content.\ntype ItemContentMismatchException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ItemContentMismatchException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ItemContentMismatchException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ItemContentMismatchException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ItemContentMismatchException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ItemContentMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The inventory item size has exceeded the size limit.\ntype ItemSizeLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ItemSizeLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ItemSizeLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ItemSizeLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ItemSizeLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ItemSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The size limit of a document is 64 KB.\ntype MaxDocumentSizeExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *MaxDocumentSizeExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *MaxDocumentSizeExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *MaxDocumentSizeExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"MaxDocumentSizeExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *MaxDocumentSizeExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You don't have permission to view OpsItems in the specified account. Verify\n// that your account is configured either as a Systems Manager delegated\n// administrator or that you are logged into the Organizations management account.\ntype OpsItemAccessDeniedException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemAccessDeniedException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemAccessDeniedException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemAccessDeniedException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemAccessDeniedException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The OpsItem already exists.\ntype OpsItemAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tOpsItemId *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified OpsItem is in the process of being deleted.\ntype OpsItemConflictException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemConflictException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemConflictException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemConflictException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemConflictException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A specified parameter argument isn't valid. Verify the available arguments and\n// try again.\ntype OpsItemInvalidParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tParameterNames []string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemInvalidParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemInvalidParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemInvalidParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemInvalidParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemInvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The request caused OpsItems to exceed one or more quotas.\ntype OpsItemLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tResourceTypes []string\n\tLimit         int32\n\tLimitType     *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified OpsItem ID doesn't exist. Verify the ID and try again.\ntype OpsItemNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The Amazon Resource Name (ARN) is already associated with the OpsItem.\ntype OpsItemRelatedItemAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tResourceUri *string\n\tOpsItemId   *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemRelatedItemAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemRelatedItemAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemRelatedItemAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemRelatedItemAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemRelatedItemAlreadyExistsException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The association wasn't found using the parameters you specified in the call.\n// Verify the information and try again.\ntype OpsItemRelatedItemAssociationNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsItemRelatedItemAssociationNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsItemRelatedItemAssociationNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsItemRelatedItemAssociationNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsItemRelatedItemAssociationNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsItemRelatedItemAssociationNotFoundException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// An OpsMetadata object already exists for the selected resource.\ntype OpsMetadataAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// One of the arguments passed is invalid.\ntype OpsMetadataInvalidArgumentException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataInvalidArgumentException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataInvalidArgumentException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataInvalidArgumentException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataInvalidArgumentException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataInvalidArgumentException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The OpsMetadata object exceeds the maximum number of OpsMetadata keys that you\n// can assign to an application in Application Manager.\ntype OpsMetadataKeyLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataKeyLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataKeyLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataKeyLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataKeyLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataKeyLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// Your account reached the maximum number of OpsMetadata objects allowed by\n// Application Manager. The maximum is 200 OpsMetadata objects. Delete one or more\n// OpsMetadata object and try again.\ntype OpsMetadataLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The OpsMetadata object doesn't exist.\ntype OpsMetadataNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The system is processing too many concurrent updates. Wait a few moments and\n// try again.\ntype OpsMetadataTooManyUpdatesException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *OpsMetadataTooManyUpdatesException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *OpsMetadataTooManyUpdatesException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *OpsMetadataTooManyUpdatesException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"OpsMetadataTooManyUpdatesException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *OpsMetadataTooManyUpdatesException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The parameter already exists. You can't create duplicate parameters.\ntype ParameterAlreadyExists struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterAlreadyExists) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterAlreadyExists) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterAlreadyExists) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterAlreadyExists\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You have exceeded the number of parameters for this Amazon Web Services\n// account. Delete one or more parameters and try again.\ntype ParameterLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Parameter Store retains the 100 most recently created versions of a parameter.\n// After this number of versions has been created, Parameter Store deletes the\n// oldest version when a new one is created. However, if the oldest version has a\n// label attached to it, Parameter Store won't delete the version and instead\n// presents this error message: An error occurred\n// (ParameterMaxVersionLimitExceeded) when calling the PutParameter operation: You\n// attempted to create a new version of parameter-name by calling the PutParameter\n// API with the overwrite flag. Version version-number, the oldest version, can't\n// be deleted because it has a label associated with it. Move the label to another\n// version of the parameter, and try again. This safeguard is to prevent parameter\n// versions with mission critical labels assigned to them from being deleted. To\n// continue creating new parameters, first move the label from the oldest version\n// of the parameter to a newer one for use in your operations. For information\n// about moving parameter labels, see Move a parameter label (console) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-console-move)\n// or Move a parameter label (CLI) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-cli-move)\n// in the Amazon Web Services Systems Manager User Guide.\ntype ParameterMaxVersionLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterMaxVersionLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterMaxVersionLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterMaxVersionLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterMaxVersionLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterMaxVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The parameter couldn't be found. Verify the name and try again.\ntype ParameterNotFound struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterNotFound) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterNotFound) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterNotFound) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterNotFound\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The parameter name isn't valid.\ntype ParameterPatternMismatchException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterPatternMismatchException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterPatternMismatchException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterPatternMismatchException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterPatternMismatchException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterPatternMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A parameter version can have a maximum of ten labels.\ntype ParameterVersionLabelLimitExceeded struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterVersionLabelLimitExceeded) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterVersionLabelLimitExceeded) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterVersionLabelLimitExceeded) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterVersionLabelLimitExceeded\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterVersionLabelLimitExceeded) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified parameter version wasn't found. Verify the parameter name and\n// version, and try again.\ntype ParameterVersionNotFound struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ParameterVersionNotFound) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ParameterVersionNotFound) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ParameterVersionNotFound) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ParameterVersionNotFound\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ParameterVersionNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You specified more than the maximum number of allowed policies for the\n// parameter. The maximum is 10.\ntype PoliciesLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *PoliciesLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *PoliciesLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *PoliciesLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"PoliciesLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *PoliciesLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// A sync configuration with the same name already exists.\ntype ResourceDataSyncAlreadyExistsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tSyncName *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceDataSyncAlreadyExistsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceDataSyncAlreadyExistsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceDataSyncAlreadyExistsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceDataSyncAlreadyExistsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceDataSyncAlreadyExistsException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// Another UpdateResourceDataSync request is being processed. Wait a few minutes\n// and try again.\ntype ResourceDataSyncConflictException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceDataSyncConflictException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceDataSyncConflictException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceDataSyncConflictException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceDataSyncConflictException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceDataSyncConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// You have exceeded the allowed maximum sync configurations.\ntype ResourceDataSyncCountExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceDataSyncCountExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceDataSyncCountExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceDataSyncCountExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceDataSyncCountExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceDataSyncCountExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified sync configuration is invalid.\ntype ResourceDataSyncInvalidConfigurationException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceDataSyncInvalidConfigurationException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceDataSyncInvalidConfigurationException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceDataSyncInvalidConfigurationException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceDataSyncInvalidConfigurationException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceDataSyncInvalidConfigurationException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified sync name wasn't found.\ntype ResourceDataSyncNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tSyncName *string\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceDataSyncNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceDataSyncNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceDataSyncNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceDataSyncNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceDataSyncNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Error returned if an attempt is made to delete a patch baseline that is\n// registered for a patch group.\ntype ResourceInUseException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceInUseException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceInUseException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceInUseException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceInUseException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Error returned when the caller has exceeded the default resource quotas. For\n// example, too many maintenance windows or patch baselines have been created. For\n// information about resource quotas in Systems Manager, see Systems Manager\n// service quotas (https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm)\n// in the Amazon Web Services General Reference.\ntype ResourceLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The hash provided in the call doesn't match the stored hash. This exception is\n// thrown when trying to update an obsolete policy version or when multiple\n// requests to update a policy are sent.\ntype ResourcePolicyConflictException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourcePolicyConflictException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourcePolicyConflictException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourcePolicyConflictException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourcePolicyConflictException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourcePolicyConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// One or more parameters specified for the call aren't valid. Verify the\n// parameters and their values and try again.\ntype ResourcePolicyInvalidParameterException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tParameterNames []string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourcePolicyInvalidParameterException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourcePolicyInvalidParameterException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourcePolicyInvalidParameterException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourcePolicyInvalidParameterException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourcePolicyInvalidParameterException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The PutResourcePolicy API action enforces two limits. A policy can't be greater\n// than 1024 bytes in size. And only one policy can be attached to OpsItemGroup .\n// Verify these limits and try again.\ntype ResourcePolicyLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tLimit     int32\n\tLimitType *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourcePolicyLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourcePolicyLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourcePolicyLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourcePolicyLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourcePolicyLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The specified service setting wasn't found. Either the service name or the\n// setting hasn't been provisioned by the Amazon Web Services service team.\ntype ServiceSettingNotFound struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ServiceSettingNotFound) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ServiceSettingNotFound) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ServiceSettingNotFound) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ServiceSettingNotFound\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ServiceSettingNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The updated status is the same as the current status.\ntype StatusUnchanged struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *StatusUnchanged) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *StatusUnchanged) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *StatusUnchanged) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"StatusUnchanged\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *StatusUnchanged) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The sub-type count exceeded the limit for the inventory type.\ntype SubTypeCountLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *SubTypeCountLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *SubTypeCountLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *SubTypeCountLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"SubTypeCountLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *SubTypeCountLimitExceededException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// You specified the Safe option for the DeregisterTargetFromMaintenanceWindow\n// operation, but the target is still referenced in a task.\ntype TargetInUseException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TargetInUseException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TargetInUseException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TargetInUseException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TargetInUseException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TargetInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified target managed node for the session isn't fully configured for\n// use with Session Manager. For more information, see Getting started with\n// Session Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html)\n// in the Amazon Web Services Systems Manager User Guide. This error is also\n// returned if you attempt to start a session on a managed node that is located in\n// a different account or Region\ntype TargetNotConnected struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TargetNotConnected) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TargetNotConnected) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TargetNotConnected) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TargetNotConnected\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TargetNotConnected) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The Targets parameter includes too many tags. Remove one or more tags and try\n// the command again.\ntype TooManyTagsError struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TooManyTagsError) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TooManyTagsError) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TooManyTagsError) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TooManyTagsError\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TooManyTagsError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// There are concurrent updates for a resource that supports one update at a time.\ntype TooManyUpdates struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TooManyUpdates) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TooManyUpdates) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TooManyUpdates) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TooManyUpdates\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TooManyUpdates) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The size of inventory data has exceeded the total size limit for the resource.\ntype TotalSizeLimitExceededException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TotalSizeLimitExceededException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TotalSizeLimitExceededException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TotalSizeLimitExceededException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TotalSizeLimitExceededException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TotalSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The calendar entry contained in the specified SSM document isn't supported.\ntype UnsupportedCalendarException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedCalendarException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedCalendarException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedCalendarException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedCalendarException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedCalendarException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Patching for applications released by Microsoft is only available on EC2\n// instances and advanced instances. To patch applications released by Microsoft on\n// on-premises servers and VMs, you must enable advanced instances. For more\n// information, see Enabling the advanced-instances tier (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances-advanced.html)\n// in the Amazon Web Services Systems Manager User Guide.\ntype UnsupportedFeatureRequiredException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedFeatureRequiredException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedFeatureRequiredException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedFeatureRequiredException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedFeatureRequiredException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedFeatureRequiredException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The Context attribute that you specified for the InventoryItem isn't allowed\n// for this inventory type. You can only use the Context attribute with inventory\n// types like AWS:ComplianceItem .\ntype UnsupportedInventoryItemContextException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedInventoryItemContextException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedInventoryItemContextException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedInventoryItemContextException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedInventoryItemContextException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedInventoryItemContextException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// Inventory item type schema version has to match supported versions in the\n// service. Check output of GetInventorySchema to see the available schema version\n// for each type.\ntype UnsupportedInventorySchemaVersionException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedInventorySchemaVersionException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedInventorySchemaVersionException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedInventorySchemaVersionException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedInventorySchemaVersionException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedInventorySchemaVersionException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The operating systems you specified isn't supported, or the operation isn't\n// supported for the operating system.\ntype UnsupportedOperatingSystem struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedOperatingSystem) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedOperatingSystem) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedOperatingSystem) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedOperatingSystem\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedOperatingSystem) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The parameter type isn't supported.\ntype UnsupportedParameterType struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedParameterType) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedParameterType) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedParameterType) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedParameterType\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedParameterType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The document doesn't support the platform type of the given managed node ID(s).\n// For example, you sent an document for a Windows managed node to a Linux node.\ntype UnsupportedPlatformType struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedPlatformType) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedPlatformType) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedPlatformType) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedPlatformType\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedPlatformType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"time\"\n)\n\n// Information includes the Amazon Web Services account ID where the current\n// document is shared and the version shared with that account.\ntype AccountSharingInfo struct {\n\n\t// The Amazon Web Services account ID where the current document is shared.\n\tAccountId *string\n\n\t// The version of the current document shared with the account.\n\tSharedDocumentVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An activation registers one or more on-premises servers or virtual machines\n// (VMs) with Amazon Web Services so that you can configure those servers or VMs\n// using Run Command. A server or VM that has been registered with Amazon Web\n// Services Systems Manager is called a managed node.\ntype Activation struct {\n\n\t// The ID created by Systems Manager when you submitted the activation.\n\tActivationId *string\n\n\t// The date the activation was created.\n\tCreatedDate *time.Time\n\n\t// A name for the managed node when it is created.\n\tDefaultInstanceName *string\n\n\t// A user defined description of the activation.\n\tDescription *string\n\n\t// The date when this activation can no longer be used to register managed nodes.\n\tExpirationDate *time.Time\n\n\t// Whether or not the activation is expired.\n\tExpired bool\n\n\t// The Identity and Access Management (IAM) role to assign to the managed node.\n\tIamRole *string\n\n\t// The maximum number of managed nodes that can be registered using this\n\t// activation.\n\tRegistrationLimit *int32\n\n\t// The number of managed nodes already registered with this activation.\n\tRegistrationsCount *int32\n\n\t// Tags assigned to the activation.\n\tTags []Tag\n\n\tnoSmithyDocumentSerde\n}\n\n// A CloudWatch alarm you apply to an automation or command.\ntype Alarm struct {\n\n\t// The name of your CloudWatch alarm.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The details for the CloudWatch alarm you want to apply to an automation or\n// command.\ntype AlarmConfiguration struct {\n\n\t// The name of the CloudWatch alarm specified in the configuration.\n\t//\n\t// This member is required.\n\tAlarms []Alarm\n\n\t// When this value is true, your automation or command continues to run in cases\n\t// where we can’t retrieve alarm status information from CloudWatch. In cases where\n\t// we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the\n\t// automation or command continues to run, regardless of this value. Default is\n\t// false.\n\tIgnorePollAlarmFailure bool\n\n\tnoSmithyDocumentSerde\n}\n\n// The details about the state of your CloudWatch alarm.\ntype AlarmStateInformation struct {\n\n\t// The name of your CloudWatch alarm.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The state of your CloudWatch alarm.\n\t//\n\t// This member is required.\n\tState ExternalAlarmState\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes an association of a Amazon Web Services Systems Manager document (SSM\n// document) and a managed node.\ntype Association struct {\n\n\t// The ID created by the system when you create an association. An association is\n\t// a binding between a document and a set of targets with a schedule.\n\tAssociationId *string\n\n\t// The association name.\n\tAssociationName *string\n\n\t// The association version.\n\tAssociationVersion *string\n\n\t// The version of the document used in the association. If you change a document\n\t// version for a State Manager association, Systems Manager immediately runs the\n\t// association unless you previously specifed the apply-only-at-cron-interval\n\t// parameter. State Manager doesn't support running associations that use a new\n\t// version of a document if that document is shared from another account. State\n\t// Manager always runs the default version of a document if shared from another\n\t// account, even though the Systems Manager console shows that a new version was\n\t// processed. If you want to run an association using a new version of a document\n\t// shared form another account, you must set the document version to default .\n\tDocumentVersion *string\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\t// The date on which the association was last run.\n\tLastExecutionDate *time.Time\n\n\t// The name of the SSM document.\n\tName *string\n\n\t// Information about the association.\n\tOverview *AssociationOverview\n\n\t// A cron expression that specifies a schedule when the association runs. The\n\t// schedule runs in Coordinated Universal Time (UTC).\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association.\n\tScheduleOffset *int32\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The managed nodes targeted by the request to create an association. You can\n\t// target all managed nodes in an Amazon Web Services account by specifying the\n\t// InstanceIds key with a value of * .\n\tTargets []Target\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes the parameters for a document.\ntype AssociationDescription struct {\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// By default, when you create a new associations, the system runs it immediately\n\t// after it is created and then according to the schedule you specified. Specify\n\t// this option if you don't want an association to run immediately after you create\n\t// it. This parameter isn't supported for rate expressions.\n\tApplyOnlyAtCronInterval bool\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// The association name.\n\tAssociationName *string\n\n\t// The association version.\n\tAssociationVersion *string\n\n\t// Choose the parameter that will define how your automation will branch out. This\n\t// target is required for associations that use an Automation runbook and target\n\t// resources by using rate controls. Automation is a capability of Amazon Web\n\t// Services Systems Manager.\n\tAutomationTargetParameterName *string\n\n\t// The names or Amazon Resource Names (ARNs) of the Change Calendar type documents\n\t// your associations are gated under. The associations only run when that change\n\t// calendar is open. For more information, see Amazon Web Services Systems Manager\n\t// Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar)\n\t// .\n\tCalendarNames []string\n\n\t// The severity level that is assigned to the association.\n\tComplianceSeverity AssociationComplianceSeverity\n\n\t// The date when the association was made.\n\tDate *time.Time\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\t// The date on which the association was last run.\n\tLastExecutionDate *time.Time\n\n\t// The last date on which the association was successfully run.\n\tLastSuccessfulExecutionDate *time.Time\n\n\t// The date when the association was last updated.\n\tLastUpdateAssociationDate *time.Time\n\n\t// The maximum number of targets allowed to run the association at the same time.\n\t// You can specify a number, for example 10, or a percentage of the target set, for\n\t// example 10%. The default value is 100%, which means all targets run the\n\t// association at the same time. If a new managed node starts and attempts to run\n\t// an association while Systems Manager is running MaxConcurrency associations,\n\t// the association is allowed to run. During the next association interval, the new\n\t// managed node will process its association within the limit specified for\n\t// MaxConcurrency .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops sending requests\n\t// to run the association on additional targets. You can specify either an absolute\n\t// number of errors, for example 10, or a percentage of the target set, for example\n\t// 10%. If you specify 3, for example, the system stops sending requests when the\n\t// fourth error is received. If you specify 0, then the system stops sending\n\t// requests after the first error is returned. If you run an association on 50\n\t// managed nodes and set MaxError to 10%, then the system stops sending the\n\t// request when the sixth error is received. Executions that are already running an\n\t// association when MaxErrors is reached are allowed to complete, but some of\n\t// these executions may fail as well. If you need to ensure that there won't be\n\t// more than max-errors failed executions, set MaxConcurrency to 1 so that\n\t// executions proceed one at a time.\n\tMaxErrors *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\t// An S3 bucket where you want to store the output details of the request.\n\tOutputLocation *InstanceAssociationOutputLocation\n\n\t// Information about the association.\n\tOverview *AssociationOverview\n\n\t// A description of the parameters for a document.\n\tParameters map[string][]string\n\n\t// A cron expression that specifies a schedule when the association runs.\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association.\n\tScheduleOffset *int32\n\n\t// The association status.\n\tStatus *AssociationStatus\n\n\t// The mode for generating association compliance. You can specify AUTO or MANUAL .\n\t// In AUTO mode, the system uses the status of the association execution to\n\t// determine the compliance status. If the association execution runs successfully,\n\t// then the association is COMPLIANT . If the association execution doesn't run\n\t// successfully, the association is NON-COMPLIANT . In MANUAL mode, you must\n\t// specify the AssociationId as a parameter for the PutComplianceItems API\n\t// operation. In this case, compliance data isn't managed by State Manager, a\n\t// capability of Amazon Web Services Systems Manager. It is managed by your direct\n\t// call to the PutComplianceItems API operation. By default, all associations use\n\t// AUTO mode.\n\tSyncCompliance AssociationSyncCompliance\n\n\t// The combination of Amazon Web Services Regions and Amazon Web Services accounts\n\t// where you want to run the association.\n\tTargetLocations []TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The managed nodes targeted by the request.\n\tTargets []Target\n\n\t// The CloudWatch alarm that was invoked during the association.\n\tTriggeredAlarms []AlarmStateInformation\n\n\tnoSmithyDocumentSerde\n}\n\n// Includes information about the specified association.\ntype AssociationExecution struct {\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// The association version.\n\tAssociationVersion *string\n\n\t// The time the execution started.\n\tCreatedTime *time.Time\n\n\t// Detailed status information about the execution.\n\tDetailedStatus *string\n\n\t// The execution ID for the association.\n\tExecutionId *string\n\n\t// The date of the last execution.\n\tLastExecutionDate *time.Time\n\n\t// An aggregate status of the resources in the execution based on the status type.\n\tResourceCountByStatus *string\n\n\t// The status of the association execution.\n\tStatus *string\n\n\t// The CloudWatch alarms that were invoked by the association.\n\tTriggeredAlarms []AlarmStateInformation\n\n\tnoSmithyDocumentSerde\n}\n\n// Filters used in the request.\ntype AssociationExecutionFilter struct {\n\n\t// The key value used in the request.\n\t//\n\t// This member is required.\n\tKey AssociationExecutionFilterKey\n\n\t// The filter type specified in the request.\n\t//\n\t// This member is required.\n\tType AssociationFilterOperatorType\n\n\t// The value specified for the key.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Includes information about the specified association execution.\ntype AssociationExecutionTarget struct {\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// The association version.\n\tAssociationVersion *string\n\n\t// Detailed information about the execution status.\n\tDetailedStatus *string\n\n\t// The execution ID.\n\tExecutionId *string\n\n\t// The date of the last execution.\n\tLastExecutionDate *time.Time\n\n\t// The location where the association details are saved.\n\tOutputSource *OutputSource\n\n\t// The resource ID, for example, the managed node ID where the association ran.\n\tResourceId *string\n\n\t// The resource type, for example, EC2.\n\tResourceType *string\n\n\t// The association execution status.\n\tStatus *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Filters for the association execution.\ntype AssociationExecutionTargetsFilter struct {\n\n\t// The key value used in the request.\n\t//\n\t// This member is required.\n\tKey AssociationExecutionTargetsFilterKey\n\n\t// The value specified for the key.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter.\ntype AssociationFilter struct {\n\n\t// The name of the filter. InstanceId has been deprecated.\n\t//\n\t// This member is required.\n\tKey AssociationFilterKey\n\n\t// The filter value.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the association.\ntype AssociationOverview struct {\n\n\t// Returns the number of targets for the association status. For example, if you\n\t// created an association with two managed nodes, and one of them was successful,\n\t// this would return the count of managed nodes by status.\n\tAssociationStatusAggregatedCount map[string]int32\n\n\t// A detailed status of the association.\n\tDetailedStatus *string\n\n\t// The status of the association. Status can be: Pending, Success, or Failed.\n\tStatus *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes an association status.\ntype AssociationStatus struct {\n\n\t// The date when the status changed.\n\t//\n\t// This member is required.\n\tDate *time.Time\n\n\t// The reason for the status.\n\t//\n\t// This member is required.\n\tMessage *string\n\n\t// The status.\n\t//\n\t// This member is required.\n\tName AssociationStatusName\n\n\t// A user-defined string.\n\tAdditionalInfo *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the association version.\ntype AssociationVersionInfo struct {\n\n\t// By default, when you create a new associations, the system runs it immediately\n\t// after it is created and then according to the schedule you specified. Specify\n\t// this option if you don't want an association to run immediately after you create\n\t// it. This parameter isn't supported for rate expressions.\n\tApplyOnlyAtCronInterval bool\n\n\t// The ID created by the system when the association was created.\n\tAssociationId *string\n\n\t// The name specified for the association version when the association version was\n\t// created.\n\tAssociationName *string\n\n\t// The association version.\n\tAssociationVersion *string\n\n\t// The names or Amazon Resource Names (ARNs) of the Change Calendar type documents\n\t// your associations are gated under. The associations for this version only run\n\t// when that Change Calendar is open. For more information, see Amazon Web\n\t// Services Systems Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar)\n\t// .\n\tCalendarNames []string\n\n\t// The severity level that is assigned to the association.\n\tComplianceSeverity AssociationComplianceSeverity\n\n\t// The date the association version was created.\n\tCreatedDate *time.Time\n\n\t// The version of an Amazon Web Services Systems Manager document (SSM document)\n\t// used when the association version was created.\n\tDocumentVersion *string\n\n\t// The maximum number of targets allowed to run the association at the same time.\n\t// You can specify a number, for example 10, or a percentage of the target set, for\n\t// example 10%. The default value is 100%, which means all targets run the\n\t// association at the same time. If a new managed node starts and attempts to run\n\t// an association while Systems Manager is running MaxConcurrency associations,\n\t// the association is allowed to run. During the next association interval, the new\n\t// managed node will process its association within the limit specified for\n\t// MaxConcurrency .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops sending requests\n\t// to run the association on additional targets. You can specify either an absolute\n\t// number of errors, for example 10, or a percentage of the target set, for example\n\t// 10%. If you specify 3, for example, the system stops sending requests when the\n\t// fourth error is received. If you specify 0, then the system stops sending\n\t// requests after the first error is returned. If you run an association on 50\n\t// managed nodes and set MaxError to 10%, then the system stops sending the\n\t// request when the sixth error is received. Executions that are already running an\n\t// association when MaxErrors is reached are allowed to complete, but some of\n\t// these executions may fail as well. If you need to ensure that there won't be\n\t// more than max-errors failed executions, set MaxConcurrency to 1 so that\n\t// executions proceed one at a time.\n\tMaxErrors *string\n\n\t// The name specified when the association was created.\n\tName *string\n\n\t// The location in Amazon S3 specified for the association when the association\n\t// version was created.\n\tOutputLocation *InstanceAssociationOutputLocation\n\n\t// Parameters specified when the association version was created.\n\tParameters map[string][]string\n\n\t// The cron or rate schedule specified for the association when the association\n\t// version was created.\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association.\n\tScheduleOffset *int32\n\n\t// The mode for generating association compliance. You can specify AUTO or MANUAL .\n\t// In AUTO mode, the system uses the status of the association execution to\n\t// determine the compliance status. If the association execution runs successfully,\n\t// then the association is COMPLIANT . If the association execution doesn't run\n\t// successfully, the association is NON-COMPLIANT . In MANUAL mode, you must\n\t// specify the AssociationId as a parameter for the PutComplianceItems API\n\t// operation. In this case, compliance data isn't managed by State Manager, a\n\t// capability of Amazon Web Services Systems Manager. It is managed by your direct\n\t// call to the PutComplianceItems API operation. By default, all associations use\n\t// AUTO mode.\n\tSyncCompliance AssociationSyncCompliance\n\n\t// The combination of Amazon Web Services Regions and Amazon Web Services accounts\n\t// where you wanted to run the association when this association version was\n\t// created.\n\tTargetLocations []TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The targets specified for the association when the association version was\n\t// created.\n\tTargets []Target\n\n\tnoSmithyDocumentSerde\n}\n\n// A structure that includes attributes that describe a document attachment.\ntype AttachmentContent struct {\n\n\t// The cryptographic hash value of the document content.\n\tHash *string\n\n\t// The hash algorithm used to calculate the hash value.\n\tHashType AttachmentHashType\n\n\t// The name of an attachment.\n\tName *string\n\n\t// The size of an attachment in bytes.\n\tSize int64\n\n\t// The URL location of the attachment content.\n\tUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An attribute of an attachment, such as the attachment name.\ntype AttachmentInformation struct {\n\n\t// The name of the attachment.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Identifying information about a document attachment, including the file name\n// and a key-value pair that identifies the location of an attachment to a\n// document.\ntype AttachmentsSource struct {\n\n\t// The key of a key-value pair that identifies the location of an attachment to a\n\t// document.\n\tKey AttachmentsSourceKey\n\n\t// The name of the document attachment file.\n\tName *string\n\n\t// The value of a key-value pair that identifies the location of an attachment to\n\t// a document. The format for Value depends on the type of key you specify.\n\t//   - For the key SourceUrl, the value is an S3 bucket location. For example:\n\t//   \"Values\": [ \"s3://doc-example-bucket/my-folder\" ]\n\t//   - For the key S3FileUrl, the value is a file in an S3 bucket. For example:\n\t//   \"Values\": [ \"s3://doc-example-bucket/my-folder/my-file.py\" ]\n\t//   - For the key AttachmentReference, the value is constructed from the name of\n\t//   another SSM document in your account, a version number of that document, and a\n\t//   file attached to that document version that you want to reuse. For example:\n\t//   \"Values\": [ \"MyOtherDocument/3/my-other-file.py\" ] However, if the SSM\n\t//   document is shared with you from another account, the full SSM document ARN must\n\t//   be specified instead of the document name only. For example: \"Values\": [\n\t//   \"arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py\"\n\t//   ]\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Detailed information about the current state of an individual Automation\n// execution.\ntype AutomationExecution struct {\n\n\t// The details for the CloudWatch alarm applied to your automation.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// The ID of a State Manager association used in the Automation operation.\n\tAssociationId *string\n\n\t// The execution ID.\n\tAutomationExecutionId *string\n\n\t// The execution status of the Automation.\n\tAutomationExecutionStatus AutomationExecutionStatus\n\n\t// The subtype of the Automation operation. Currently, the only supported value is\n\t// ChangeRequest .\n\tAutomationSubtype AutomationSubtype\n\n\t// The name of the Change Manager change request.\n\tChangeRequestName *string\n\n\t// The action of the step that is currently running.\n\tCurrentAction *string\n\n\t// The name of the step that is currently running.\n\tCurrentStepName *string\n\n\t// The name of the Automation runbook used during the execution.\n\tDocumentName *string\n\n\t// The version of the document to use during execution.\n\tDocumentVersion *string\n\n\t// The Amazon Resource Name (ARN) of the user who ran the automation.\n\tExecutedBy *string\n\n\t// The time the execution finished.\n\tExecutionEndTime *time.Time\n\n\t// The time the execution started.\n\tExecutionStartTime *time.Time\n\n\t// A message describing why an execution has failed, if the status is set to\n\t// Failed.\n\tFailureMessage *string\n\n\t// The MaxConcurrency value specified by the user when the execution started.\n\tMaxConcurrency *string\n\n\t// The MaxErrors value specified by the user when the execution started.\n\tMaxErrors *string\n\n\t// The automation execution mode.\n\tMode ExecutionMode\n\n\t// The ID of an OpsItem that is created to represent a Change Manager change\n\t// request.\n\tOpsItemId *string\n\n\t// The list of execution outputs as defined in the Automation runbook.\n\tOutputs map[string][]string\n\n\t// The key-value map of execution parameters, which were supplied when calling\n\t// StartAutomationExecution .\n\tParameters map[string][]string\n\n\t// The AutomationExecutionId of the parent automation.\n\tParentAutomationExecutionId *string\n\n\t// An aggregate of step execution statuses displayed in the Amazon Web Services\n\t// Systems Manager console for a multi-Region and multi-account Automation\n\t// execution.\n\tProgressCounters *ProgressCounters\n\n\t// A list of resolved targets in the rate control execution.\n\tResolvedTargets *ResolvedTargets\n\n\t// Information about the Automation runbooks that are run as part of a runbook\n\t// workflow. The Automation runbooks specified for the runbook workflow can't run\n\t// until all required approvals for the change request have been received.\n\tRunbooks []Runbook\n\n\t// The date and time the Automation operation is scheduled to start.\n\tScheduledTime *time.Time\n\n\t// A list of details about the current state of all steps that comprise an\n\t// execution. An Automation runbook contains a list of steps that are run in order.\n\tStepExecutions []StepExecution\n\n\t// A boolean value that indicates if the response contains the full list of the\n\t// Automation step executions. If true, use the DescribeAutomationStepExecutions\n\t// API operation to get the full list of step executions.\n\tStepExecutionsTruncated bool\n\n\t// The target of the execution.\n\tTarget *string\n\n\t// The combination of Amazon Web Services Regions and/or Amazon Web Services\n\t// accounts where you want to run the Automation.\n\tTargetLocations []TargetLocation\n\n\t// The specified key-value mapping of document parameters to target resources.\n\tTargetMaps []map[string][]string\n\n\t// The parameter name.\n\tTargetParameterName *string\n\n\t// The specified targets.\n\tTargets []Target\n\n\t// The CloudWatch alarm that was invoked by the automation.\n\tTriggeredAlarms []AlarmStateInformation\n\n\t// Variables defined for the automation.\n\tVariables map[string][]string\n\n\tnoSmithyDocumentSerde\n}\n\n// A filter used to match specific automation executions. This is used to limit\n// the scope of Automation execution information returned.\ntype AutomationExecutionFilter struct {\n\n\t// One or more keys to limit the results.\n\t//\n\t// This member is required.\n\tKey AutomationExecutionFilterKey\n\n\t// The values used to limit the execution information associated with the filter's\n\t// key.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Details about a specific Automation execution.\ntype AutomationExecutionMetadata struct {\n\n\t// The details for the CloudWatch alarm applied to your automation.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// The ID of a State Manager association used in the Automation operation.\n\tAssociationId *string\n\n\t// The execution ID.\n\tAutomationExecutionId *string\n\n\t// The status of the execution.\n\tAutomationExecutionStatus AutomationExecutionStatus\n\n\t// The subtype of the Automation operation. Currently, the only supported value is\n\t// ChangeRequest .\n\tAutomationSubtype AutomationSubtype\n\n\t// Use this filter with DescribeAutomationExecutions . Specify either Local or\n\t// CrossAccount. CrossAccount is an Automation that runs in multiple Amazon Web\n\t// Services Regions and Amazon Web Services accounts. For more information, see\n\t// Running Automation workflows in multiple Amazon Web Services Regions and\n\t// accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tAutomationType AutomationType\n\n\t// The name of the Change Manager change request.\n\tChangeRequestName *string\n\n\t// The action of the step that is currently running.\n\tCurrentAction *string\n\n\t// The name of the step that is currently running.\n\tCurrentStepName *string\n\n\t// The name of the Automation runbook used during execution.\n\tDocumentName *string\n\n\t// The document version used during the execution.\n\tDocumentVersion *string\n\n\t// The IAM role ARN of the user who ran the automation.\n\tExecutedBy *string\n\n\t// The time the execution finished. This isn't populated if the execution is still\n\t// in progress.\n\tExecutionEndTime *time.Time\n\n\t// The time the execution started.\n\tExecutionStartTime *time.Time\n\n\t// The list of execution outputs as defined in the Automation runbook.\n\tFailureMessage *string\n\n\t// An S3 bucket where execution information is stored.\n\tLogFile *string\n\n\t// The MaxConcurrency value specified by the user when starting the automation.\n\tMaxConcurrency *string\n\n\t// The MaxErrors value specified by the user when starting the automation.\n\tMaxErrors *string\n\n\t// The Automation execution mode.\n\tMode ExecutionMode\n\n\t// The ID of an OpsItem that is created to represent a Change Manager change\n\t// request.\n\tOpsItemId *string\n\n\t// The list of execution outputs as defined in the Automation runbook.\n\tOutputs map[string][]string\n\n\t// The execution ID of the parent automation.\n\tParentAutomationExecutionId *string\n\n\t// A list of targets that resolved during the execution.\n\tResolvedTargets *ResolvedTargets\n\n\t// Information about the Automation runbooks that are run during a runbook\n\t// workflow in Change Manager. The Automation runbooks specified for the runbook\n\t// workflow can't run until all required approvals for the change request have been\n\t// received.\n\tRunbooks []Runbook\n\n\t// The date and time the Automation operation is scheduled to start.\n\tScheduledTime *time.Time\n\n\t// The list of execution outputs as defined in the Automation runbook.\n\tTarget *string\n\n\t// The specified key-value mapping of document parameters to target resources.\n\tTargetMaps []map[string][]string\n\n\t// The list of execution outputs as defined in the Automation runbook.\n\tTargetParameterName *string\n\n\t// The targets defined by the user when starting the automation.\n\tTargets []Target\n\n\t// The CloudWatch alarm that was invoked by the automation.\n\tTriggeredAlarms []AlarmStateInformation\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines the basic information about a patch baseline override.\ntype BaselineOverride struct {\n\n\t// A set of rules defining the approval rules for a patch baseline.\n\tApprovalRules *PatchRuleGroup\n\n\t// A list of explicitly approved patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tApprovedPatches []string\n\n\t// Defines the compliance level for approved patches. When an approved patch is\n\t// reported as missing, this value describes the severity of the compliance\n\t// violation.\n\tApprovedPatchesComplianceLevel PatchComplianceLevel\n\n\t// Indicates whether the list of approved patches includes non-security updates\n\t// that should be applied to the managed nodes. The default value is false .\n\t// Applies to Linux managed nodes only.\n\tApprovedPatchesEnableNonSecurity bool\n\n\t// A set of patch filters, typically used for approval rules.\n\tGlobalFilters *PatchFilterGroup\n\n\t// The operating system rule used by the patch baseline override.\n\tOperatingSystem OperatingSystem\n\n\t// A list of explicitly rejected patches for the baseline. For information about\n\t// accepted formats for lists of approved patches and rejected patches, see About\n\t// package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tRejectedPatches []string\n\n\t// The action for Patch Manager to take on patches included in the RejectedPackages\n\t// list. A patch can be allowed only if it is a dependency of another package, or\n\t// blocked entirely along with packages that include it as a dependency.\n\tRejectedPatchesAction PatchAction\n\n\t// Information about the patches to use to update the managed nodes, including\n\t// target operating systems and source repositories. Applies to Linux managed nodes\n\t// only.\n\tSources []PatchSource\n\n\tnoSmithyDocumentSerde\n}\n\n// Configuration options for sending command output to Amazon CloudWatch Logs.\ntype CloudWatchOutputConfig struct {\n\n\t// The name of the CloudWatch Logs log group where you want to send command\n\t// output. If you don't specify a group name, Amazon Web Services Systems Manager\n\t// automatically creates a log group for you. The log group uses the following\n\t// naming format: aws/ssm/SystemsManagerDocumentName\n\tCloudWatchLogGroupName *string\n\n\t// Enables Systems Manager to send command output to CloudWatch Logs.\n\tCloudWatchOutputEnabled bool\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a command request.\ntype Command struct {\n\n\t// The details for the CloudWatch alarm applied to your command.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// Amazon CloudWatch Logs information where you want Amazon Web Services Systems\n\t// Manager to send the command output.\n\tCloudWatchOutputConfig *CloudWatchOutputConfig\n\n\t// A unique identifier for this command.\n\tCommandId *string\n\n\t// User-specified information about the command, such as a brief description of\n\t// what the command should do.\n\tComment *string\n\n\t// The number of targets for which the command invocation reached a terminal\n\t// state. Terminal states include the following: Success, Failed, Execution Timed\n\t// Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable.\n\tCompletedCount int32\n\n\t// The number of targets for which the status is Delivery Timed Out.\n\tDeliveryTimedOutCount int32\n\n\t// The name of the document requested for execution.\n\tDocumentName *string\n\n\t// The Systems Manager document (SSM document) version.\n\tDocumentVersion *string\n\n\t// The number of targets for which the status is Failed or Execution Timed Out.\n\tErrorCount int32\n\n\t// If a command expires, it changes status to DeliveryTimedOut for all invocations\n\t// that have the status InProgress , Pending , or Delayed . ExpiresAfter is\n\t// calculated based on the total timeout for the overall command. For more\n\t// information, see Understanding command timeout values (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tExpiresAfter *time.Time\n\n\t// The managed node IDs against which this command was requested.\n\tInstanceIds []string\n\n\t// The maximum number of managed nodes that are allowed to run the command at the\n\t// same time. You can specify a number of managed nodes, such as 10, or a\n\t// percentage of nodes, such as 10%. The default value is 50. For more information\n\t// about how to use MaxConcurrency , see Running commands using Systems Manager\n\t// Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tMaxConcurrency *string\n\n\t// The maximum number of errors allowed before the system stops sending the\n\t// command to additional targets. You can specify a number of errors, such as 10,\n\t// or a percentage or errors, such as 10%. The default value is 0 . For more\n\t// information about how to use MaxErrors , see Running commands using Systems\n\t// Manager Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tMaxErrors *string\n\n\t// Configurations for sending notifications about command status changes.\n\tNotificationConfig *NotificationConfig\n\n\t// The S3 bucket where the responses to the command executions should be stored.\n\t// This was requested when issuing the command.\n\tOutputS3BucketName *string\n\n\t// The S3 directory path inside the bucket where the responses to the command\n\t// executions should be stored. This was requested when issuing the command.\n\tOutputS3KeyPrefix *string\n\n\t// (Deprecated) You can no longer specify this parameter. The system ignores it.\n\t// Instead, Systems Manager automatically determines the Amazon Web Services Region\n\t// of the S3 bucket.\n\tOutputS3Region *string\n\n\t// The parameter values to be inserted in the document when running the command.\n\tParameters map[string][]string\n\n\t// The date and time the command was requested.\n\tRequestedDateTime *time.Time\n\n\t// The Identity and Access Management (IAM) service role that Run Command, a\n\t// capability of Amazon Web Services Systems Manager, uses to act on your behalf\n\t// when sending notifications about command status changes.\n\tServiceRole *string\n\n\t// The status of the command.\n\tStatus CommandStatus\n\n\t// A detailed status of the command execution. StatusDetails includes more\n\t// information than Status because it includes states resulting from error and\n\t// concurrency control parameters. StatusDetails can show different results than\n\t// Status. For more information about these statuses, see Understanding command\n\t// statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html)\n\t// in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one\n\t// of the following values:\n\t//   - Pending: The command hasn't been sent to any managed nodes.\n\t//   - In Progress: The command has been sent to at least one managed node but\n\t//   hasn't reached a final state on all managed nodes.\n\t//   - Success: The command successfully ran on all invocations. This is a\n\t//   terminal state.\n\t//   - Delivery Timed Out: The value of MaxErrors or more command invocations\n\t//   shows a status of Delivery Timed Out. This is a terminal state.\n\t//   - Execution Timed Out: The value of MaxErrors or more command invocations\n\t//   shows a status of Execution Timed Out. This is a terminal state.\n\t//   - Failed: The value of MaxErrors or more command invocations shows a status\n\t//   of Failed. This is a terminal state.\n\t//   - Incomplete: The command was attempted on all managed nodes and one or more\n\t//   invocations doesn't have a value of Success but not enough invocations failed\n\t//   for the status to be Failed. This is a terminal state.\n\t//   - Cancelled: The command was terminated before it was completed. This is a\n\t//   terminal state.\n\t//   - Rate Exceeded: The number of managed nodes targeted by the command exceeded\n\t//   the account limit for pending invocations. The system has canceled the command\n\t//   before running it on any managed node. This is a terminal state.\n\t//   - Delayed: The system attempted to send the command to the managed node but\n\t//   wasn't successful. The system retries again.\n\tStatusDetails *string\n\n\t// The number of targets for the command.\n\tTargetCount int32\n\n\t// An array of search criteria that targets managed nodes using a Key,Value\n\t// combination that you specify. Targets is required if you don't provide one or\n\t// more managed node IDs in the call.\n\tTargets []Target\n\n\t// The TimeoutSeconds value specified for a command.\n\tTimeoutSeconds *int32\n\n\t// The CloudWatch alarm that was invoked by the command.\n\tTriggeredAlarms []AlarmStateInformation\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a command filter. A managed node ID can't be specified when a command\n// status is Pending because the command hasn't run on the node yet.\ntype CommandFilter struct {\n\n\t// The name of the filter. The ExecutionStage filter can't be used with the\n\t// ListCommandInvocations operation, only with ListCommands .\n\t//\n\t// This member is required.\n\tKey CommandFilterKey\n\n\t// The filter value. Valid values for each filter key are as follows:\n\t//   - InvokedAfter: Specify a timestamp to limit your results. For example,\n\t//   specify 2021-07-07T00:00:00Z to see a list of command executions occurring\n\t//   July 7, 2021, and later.\n\t//   - InvokedBefore: Specify a timestamp to limit your results. For example,\n\t//   specify 2021-07-07T00:00:00Z to see a list of command executions from before\n\t//   July 7, 2021.\n\t//   - Status: Specify a valid command status to see a list of all command\n\t//   executions with that status. The status choices depend on the API you call. The\n\t//   status values you can specify for ListCommands are:\n\t//   - Pending\n\t//   - InProgress\n\t//   - Success\n\t//   - Cancelled\n\t//   - Failed\n\t//   - TimedOut (this includes both Delivery and Execution time outs)\n\t//   - AccessDenied\n\t//   - DeliveryTimedOut\n\t//   - ExecutionTimedOut\n\t//   - Incomplete\n\t//   - NoInstancesInTag\n\t//   - LimitExceeded The status values you can specify for ListCommandInvocations\n\t//   are:\n\t//   - Pending\n\t//   - InProgress\n\t//   - Delayed\n\t//   - Success\n\t//   - Cancelled\n\t//   - Failed\n\t//   - TimedOut (this includes both Delivery and Execution time outs)\n\t//   - AccessDenied\n\t//   - DeliveryTimedOut\n\t//   - ExecutionTimedOut\n\t//   - Undeliverable\n\t//   - InvalidPlatform\n\t//   - Terminated\n\t//   - DocumentName: Specify name of the Amazon Web Services Systems Manager\n\t//   document (SSM document) for which you want to see command execution results. For\n\t//   example, specify AWS-RunPatchBaseline to see command executions that used this\n\t//   SSM document to perform security patching operations on managed nodes.\n\t//   - ExecutionStage: Specify one of the following values ( ListCommands\n\t//   operations only):\n\t//   - Executing : Returns a list of command executions that are currently still\n\t//   running.\n\t//   - Complete : Returns a list of command executions that have already completed.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An invocation is a copy of a command sent to a specific managed node. A command\n// can apply to one or more managed nodes. A command invocation applies to one\n// managed node. For example, if a user runs SendCommand against three managed\n// nodes, then a command invocation is created for each requested managed node ID.\n// A command invocation returns status and detail information about a command you\n// ran.\ntype CommandInvocation struct {\n\n\t// Amazon CloudWatch Logs information where you want Amazon Web Services Systems\n\t// Manager to send the command output.\n\tCloudWatchOutputConfig *CloudWatchOutputConfig\n\n\t// The command against which this invocation was requested.\n\tCommandId *string\n\n\t// Plugins processed by the command.\n\tCommandPlugins []CommandPlugin\n\n\t// User-specified information about the command, such as a brief description of\n\t// what the command should do.\n\tComment *string\n\n\t// The document name that was requested for execution.\n\tDocumentName *string\n\n\t// The Systems Manager document (SSM document) version.\n\tDocumentVersion *string\n\n\t// The managed node ID in which this invocation was requested.\n\tInstanceId *string\n\n\t// The fully qualified host name of the managed node.\n\tInstanceName *string\n\n\t// Configurations for sending notifications about command status changes on a per\n\t// managed node basis.\n\tNotificationConfig *NotificationConfig\n\n\t// The time and date the request was sent to this managed node.\n\tRequestedDateTime *time.Time\n\n\t// The Identity and Access Management (IAM) service role that Run Command, a\n\t// capability of Amazon Web Services Systems Manager, uses to act on your behalf\n\t// when sending notifications about command status changes on a per managed node\n\t// basis.\n\tServiceRole *string\n\n\t// The URL to the plugin's StdErr file in Amazon Simple Storage Service (Amazon\n\t// S3), if the S3 bucket was defined for the parent command. For an invocation,\n\t// StandardErrorUrl is populated if there is just one plugin defined for the\n\t// command, and the S3 bucket was defined for the command.\n\tStandardErrorUrl *string\n\n\t// The URL to the plugin's StdOut file in Amazon Simple Storage Service (Amazon\n\t// S3), if the S3 bucket was defined for the parent command. For an invocation,\n\t// StandardOutputUrl is populated if there is just one plugin defined for the\n\t// command, and the S3 bucket was defined for the command.\n\tStandardOutputUrl *string\n\n\t// Whether or not the invocation succeeded, failed, or is pending.\n\tStatus CommandInvocationStatus\n\n\t// A detailed status of the command execution for each invocation (each managed\n\t// node targeted by the command). StatusDetails includes more information than\n\t// Status because it includes states resulting from error and concurrency control\n\t// parameters. StatusDetails can show different results than Status. For more\n\t// information about these statuses, see Understanding command statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html)\n\t// in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one\n\t// of the following values:\n\t//   - Pending: The command hasn't been sent to the managed node.\n\t//   - In Progress: The command has been sent to the managed node but hasn't\n\t//   reached a terminal state.\n\t//   - Success: The execution of the command or plugin was successfully completed.\n\t//   This is a terminal state.\n\t//   - Delivery Timed Out: The command wasn't delivered to the managed node before\n\t//   the delivery timeout expired. Delivery timeouts don't count against the parent\n\t//   command's MaxErrors limit, but they do contribute to whether the parent\n\t//   command status is Success or Incomplete. This is a terminal state.\n\t//   - Execution Timed Out: Command execution started on the managed node, but the\n\t//   execution wasn't complete before the execution timeout expired. Execution\n\t//   timeouts count against the MaxErrors limit of the parent command. This is a\n\t//   terminal state.\n\t//   - Failed: The command wasn't successful on the managed node. For a plugin,\n\t//   this indicates that the result code wasn't zero. For a command invocation, this\n\t//   indicates that the result code for one or more plugins wasn't zero. Invocation\n\t//   failures count against the MaxErrors limit of the parent command. This is a\n\t//   terminal state.\n\t//   - Cancelled: The command was terminated before it was completed. This is a\n\t//   terminal state.\n\t//   - Undeliverable: The command can't be delivered to the managed node. The\n\t//   managed node might not exist or might not be responding. Undeliverable\n\t//   invocations don't count against the parent command's MaxErrors limit and don't\n\t//   contribute to whether the parent command status is Success or Incomplete. This\n\t//   is a terminal state.\n\t//   - Terminated: The parent command exceeded its MaxErrors limit and subsequent\n\t//   command invocations were canceled by the system. This is a terminal state.\n\t//   - Delayed: The system attempted to send the command to the managed node but\n\t//   wasn't successful. The system retries again.\n\tStatusDetails *string\n\n\t// Gets the trace output sent by the agent.\n\tTraceOutput *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes plugin details.\ntype CommandPlugin struct {\n\n\t// The name of the plugin. Must be one of the following: aws:updateAgent ,\n\t// aws:domainjoin , aws:applications , aws:runPowerShellScript , aws:psmodule ,\n\t// aws:cloudWatch , aws:runShellScript , or aws:updateSSMAgent .\n\tName *string\n\n\t// Output of the plugin execution.\n\tOutput *string\n\n\t// The S3 bucket where the responses to the command executions should be stored.\n\t// This was requested when issuing the command. For example, in the following\n\t// response:\n\t// doc-example-bucket/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-02573cafcfEXAMPLE/awsrunShellScript\n\t// doc-example-bucket is the name of the S3 bucket;\n\t// ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix;\n\t// i-02573cafcfEXAMPLE is the managed node ID; awsrunShellScript is the name of\n\t// the plugin.\n\tOutputS3BucketName *string\n\n\t// The S3 directory path inside the bucket where the responses to the command\n\t// executions should be stored. This was requested when issuing the command. For\n\t// example, in the following response:\n\t// doc-example-bucket/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-02573cafcfEXAMPLE/awsrunShellScript\n\t// doc-example-bucket is the name of the S3 bucket;\n\t// ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix;\n\t// i-02573cafcfEXAMPLE is the managed node ID; awsrunShellScript is the name of\n\t// the plugin.\n\tOutputS3KeyPrefix *string\n\n\t// (Deprecated) You can no longer specify this parameter. The system ignores it.\n\t// Instead, Amazon Web Services Systems Manager automatically determines the S3\n\t// bucket region.\n\tOutputS3Region *string\n\n\t// A numeric response code generated after running the plugin.\n\tResponseCode int32\n\n\t// The time the plugin stopped running. Could stop prematurely if, for example, a\n\t// cancel command was sent.\n\tResponseFinishDateTime *time.Time\n\n\t// The time the plugin started running.\n\tResponseStartDateTime *time.Time\n\n\t// The URL for the complete text written by the plugin to stderr. If execution\n\t// isn't yet complete, then this string is empty.\n\tStandardErrorUrl *string\n\n\t// The URL for the complete text written by the plugin to stdout in Amazon S3. If\n\t// the S3 bucket for the command wasn't specified, then this string is empty.\n\tStandardOutputUrl *string\n\n\t// The status of this plugin. You can run a document with multiple plugins.\n\tStatus CommandPluginStatus\n\n\t// A detailed status of the plugin execution. StatusDetails includes more\n\t// information than Status because it includes states resulting from error and\n\t// concurrency control parameters. StatusDetails can show different results than\n\t// Status. For more information about these statuses, see Understanding command\n\t// statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html)\n\t// in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one\n\t// of the following values:\n\t//   - Pending: The command hasn't been sent to the managed node.\n\t//   - In Progress: The command has been sent to the managed node but hasn't\n\t//   reached a terminal state.\n\t//   - Success: The execution of the command or plugin was successfully completed.\n\t//   This is a terminal state.\n\t//   - Delivery Timed Out: The command wasn't delivered to the managed node before\n\t//   the delivery timeout expired. Delivery timeouts don't count against the parent\n\t//   command's MaxErrors limit, but they do contribute to whether the parent\n\t//   command status is Success or Incomplete. This is a terminal state.\n\t//   - Execution Timed Out: Command execution started on the managed node, but the\n\t//   execution wasn't complete before the execution timeout expired. Execution\n\t//   timeouts count against the MaxErrors limit of the parent command. This is a\n\t//   terminal state.\n\t//   - Failed: The command wasn't successful on the managed node. For a plugin,\n\t//   this indicates that the result code wasn't zero. For a command invocation, this\n\t//   indicates that the result code for one or more plugins wasn't zero. Invocation\n\t//   failures count against the MaxErrors limit of the parent command. This is a\n\t//   terminal state.\n\t//   - Cancelled: The command was terminated before it was completed. This is a\n\t//   terminal state.\n\t//   - Undeliverable: The command can't be delivered to the managed node. The\n\t//   managed node might not exist, or it might not be responding. Undeliverable\n\t//   invocations don't count against the parent command's MaxErrors limit, and they\n\t//   don't contribute to whether the parent command status is Success or Incomplete.\n\t//   This is a terminal state.\n\t//   - Terminated: The parent command exceeded its MaxErrors limit and subsequent\n\t//   command invocations were canceled by the system. This is a terminal state.\n\tStatusDetails *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A summary of the call execution that includes an execution ID, the type of\n// execution (for example, Command ), and the date/time of the execution using a\n// datetime object that is saved in the following format: yyyy-MM-dd'T'HH:mm:ss'Z'.\ntype ComplianceExecutionSummary struct {\n\n\t// The time the execution ran as a datetime object that is saved in the following\n\t// format: yyyy-MM-dd'T'HH:mm:ss'Z'.\n\t//\n\t// This member is required.\n\tExecutionTime *time.Time\n\n\t// An ID created by the system when PutComplianceItems was called. For example,\n\t// CommandID is a valid execution ID. You can use this ID in subsequent calls.\n\tExecutionId *string\n\n\t// The type of execution. For example, Command is a valid execution type.\n\tExecutionType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the compliance as defined by the resource type. For example,\n// for a patch resource type, Items includes information about the PatchSeverity,\n// Classification, and so on.\ntype ComplianceItem struct {\n\n\t// The compliance type. For example, Association (for a State Manager\n\t// association), Patch, or Custom: string are all valid compliance types.\n\tComplianceType *string\n\n\t// A \"Key\": \"Value\" tag combination for the compliance item.\n\tDetails map[string]string\n\n\t// A summary for the compliance item. The summary includes an execution ID, the\n\t// execution type (for example, command), and the execution time.\n\tExecutionSummary *ComplianceExecutionSummary\n\n\t// An ID for the compliance item. For example, if the compliance item is a Windows\n\t// patch, the ID could be the number of the KB article; for example: KB4010320.\n\tId *string\n\n\t// An ID for the resource. For a managed node, this is the node ID.\n\tResourceId *string\n\n\t// The type of resource. ManagedInstance is currently the only supported resource\n\t// type.\n\tResourceType *string\n\n\t// The severity of the compliance status. Severity can be one of the following:\n\t// Critical, High, Medium, Low, Informational, Unspecified.\n\tSeverity ComplianceSeverity\n\n\t// The status of the compliance item. An item is either COMPLIANT, NON_COMPLIANT,\n\t// or an empty string (for Windows patches that aren't applicable).\n\tStatus ComplianceStatus\n\n\t// A title for the compliance item. For example, if the compliance item is a\n\t// Windows patch, the title could be the title of the KB article for the patch; for\n\t// example: Security Update for Active Directory Federation Services.\n\tTitle *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a compliance item.\ntype ComplianceItemEntry struct {\n\n\t// The severity of the compliance status. Severity can be one of the following:\n\t// Critical, High, Medium, Low, Informational, Unspecified.\n\t//\n\t// This member is required.\n\tSeverity ComplianceSeverity\n\n\t// The status of the compliance item. An item is either COMPLIANT or NON_COMPLIANT.\n\t//\n\t// This member is required.\n\tStatus ComplianceStatus\n\n\t// A \"Key\": \"Value\" tag combination for the compliance item.\n\tDetails map[string]string\n\n\t// The compliance item ID. For example, if the compliance item is a Windows patch,\n\t// the ID could be the number of the KB article.\n\tId *string\n\n\t// The title of the compliance item. For example, if the compliance item is a\n\t// Windows patch, the title could be the title of the KB article for the patch; for\n\t// example: Security Update for Active Directory Federation Services.\n\tTitle *string\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more filters. Use a filter to return a more specific list of results.\ntype ComplianceStringFilter struct {\n\n\t// The name of the filter.\n\tKey *string\n\n\t// The type of comparison that should be performed for the value: Equal, NotEqual,\n\t// BeginWith, LessThan, or GreaterThan.\n\tType ComplianceQueryOperatorType\n\n\t// The value for which to search.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// A summary of compliance information by compliance type.\ntype ComplianceSummaryItem struct {\n\n\t// The type of compliance item. For example, the compliance type can be\n\t// Association, Patch, or Custom:string.\n\tComplianceType *string\n\n\t// A list of COMPLIANT items for the specified compliance type.\n\tCompliantSummary *CompliantSummary\n\n\t// A list of NON_COMPLIANT items for the specified compliance type.\n\tNonCompliantSummary *NonCompliantSummary\n\n\tnoSmithyDocumentSerde\n}\n\n// A summary of resources that are compliant. The summary is organized according\n// to the resource count for each compliance type.\ntype CompliantSummary struct {\n\n\t// The total number of resources that are compliant.\n\tCompliantCount int32\n\n\t// A summary of the compliance severity by compliance type.\n\tSeveritySummary *SeveritySummary\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes the association of a Amazon Web Services Systems Manager document\n// (SSM document) and a managed node.\ntype CreateAssociationBatchRequestEntry struct {\n\n\t// The name of the SSM document that contains the configuration information for\n\t// the managed node. You can specify Command or Automation runbooks. You can\n\t// specify Amazon Web Services-predefined documents, documents you created, or a\n\t// document that is shared with you from another account. For SSM documents that\n\t// are shared with you from other Amazon Web Services accounts, you must specify\n\t// the complete SSM document ARN, in the following format:\n\t// arn:aws:ssm:region:account-id:document/document-name For example:\n\t// arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For Amazon Web\n\t// Services-predefined documents and SSM documents you created in your account, you\n\t// only need to specify the document name. For example, AWS-ApplyPatchBaseline or\n\t// My-Document .\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// By default, when you create a new associations, the system runs it immediately\n\t// after it is created and then according to the schedule you specified. Specify\n\t// this option if you don't want an association to run immediately after you create\n\t// it. This parameter isn't supported for rate expressions.\n\tApplyOnlyAtCronInterval bool\n\n\t// Specify a descriptive name for the association.\n\tAssociationName *string\n\n\t// Specify the target for the association. This target is required for\n\t// associations that use an Automation runbook and target resources by using rate\n\t// controls. Automation is a capability of Amazon Web Services Systems Manager.\n\tAutomationTargetParameterName *string\n\n\t// The names or Amazon Resource Names (ARNs) of the Change Calendar type documents\n\t// your associations are gated under. The associations only run when that Change\n\t// Calendar is open. For more information, see Amazon Web Services Systems Manager\n\t// Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar)\n\t// .\n\tCalendarNames []string\n\n\t// The severity level to assign to the association.\n\tComplianceSeverity AssociationComplianceSeverity\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// The managed node ID. InstanceId has been deprecated. To specify a managed node\n\t// ID for an association, use the Targets parameter. Requests that include the\n\t// parameter InstanceID with Systems Manager documents (SSM documents) that use\n\t// schema version 2.0 or later will fail. In addition, if you use the parameter\n\t// InstanceId , you can't use the parameters AssociationName , DocumentVersion ,\n\t// MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use\n\t// these parameters, you must use the Targets parameter.\n\tInstanceId *string\n\n\t// The maximum number of targets allowed to run the association at the same time.\n\t// You can specify a number, for example 10, or a percentage of the target set, for\n\t// example 10%. The default value is 100%, which means all targets run the\n\t// association at the same time. If a new managed node starts and attempts to run\n\t// an association while Systems Manager is running MaxConcurrency associations,\n\t// the association is allowed to run. During the next association interval, the new\n\t// managed node will process its association within the limit specified for\n\t// MaxConcurrency .\n\tMaxConcurrency *string\n\n\t// The number of errors that are allowed before the system stops sending requests\n\t// to run the association on additional targets. You can specify either an absolute\n\t// number of errors, for example 10, or a percentage of the target set, for example\n\t// 10%. If you specify 3, for example, the system stops sending requests when the\n\t// fourth error is received. If you specify 0, then the system stops sending\n\t// requests after the first error is returned. If you run an association on 50\n\t// managed nodes and set MaxError to 10%, then the system stops sending the\n\t// request when the sixth error is received. Executions that are already running an\n\t// association when MaxErrors is reached are allowed to complete, but some of\n\t// these executions may fail as well. If you need to ensure that there won't be\n\t// more than max-errors failed executions, set MaxConcurrency to 1 so that\n\t// executions proceed one at a time.\n\tMaxErrors *string\n\n\t// An S3 bucket where you want to store the results of this request.\n\tOutputLocation *InstanceAssociationOutputLocation\n\n\t// A description of the parameters for a document.\n\tParameters map[string][]string\n\n\t// A cron expression that specifies a schedule when the association runs.\n\tScheduleExpression *string\n\n\t// Number of days to wait after the scheduled day to run an association.\n\tScheduleOffset *int32\n\n\t// The mode for generating association compliance. You can specify AUTO or MANUAL .\n\t// In AUTO mode, the system uses the status of the association execution to\n\t// determine the compliance status. If the association execution runs successfully,\n\t// then the association is COMPLIANT . If the association execution doesn't run\n\t// successfully, the association is NON-COMPLIANT . In MANUAL mode, you must\n\t// specify the AssociationId as a parameter for the PutComplianceItems API\n\t// operation. In this case, compliance data isn't managed by State Manager, a\n\t// capability of Amazon Web Services Systems Manager. It is managed by your direct\n\t// call to the PutComplianceItems API operation. By default, all associations use\n\t// AUTO mode.\n\tSyncCompliance AssociationSyncCompliance\n\n\t// Use this action to create an association in multiple Regions and multiple\n\t// accounts.\n\tTargetLocations []TargetLocation\n\n\t// A key-value mapping of document parameters to target resources. Both Targets\n\t// and TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The managed nodes targeted by the request.\n\tTargets []Target\n\n\tnoSmithyDocumentSerde\n}\n\n// Filter for the DescribeActivation API.\ntype DescribeActivationsFilter struct {\n\n\t// The name of the filter.\n\tFilterKey DescribeActivationsFilterKeys\n\n\t// The filter values.\n\tFilterValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// A default version of a document.\ntype DocumentDefaultVersionDescription struct {\n\n\t// The default version of the document.\n\tDefaultVersion *string\n\n\t// The default version of the artifact associated with the document.\n\tDefaultVersionName *string\n\n\t// The name of the document.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes an Amazon Web Services Systems Manager document (SSM document).\ntype DocumentDescription struct {\n\n\t// The version of the document currently approved for use in the organization.\n\tApprovedVersion *string\n\n\t// Details about the document attachments, including names, locations, sizes, and\n\t// so on.\n\tAttachmentsInformation []AttachmentInformation\n\n\t// The user in your organization who created the document.\n\tAuthor *string\n\n\t// The classification of a document to help you identify and categorize its use.\n\tCategory []string\n\n\t// The value that identifies a document's category.\n\tCategoryEnum []string\n\n\t// The date when the document was created.\n\tCreatedDate *time.Time\n\n\t// The default version.\n\tDefaultVersion *string\n\n\t// A description of the document.\n\tDescription *string\n\n\t// The friendly name of the SSM document. This value can differ for each version\n\t// of the document. If you want to update this value, see UpdateDocument .\n\tDisplayName *string\n\n\t// The document format, either JSON or YAML.\n\tDocumentFormat DocumentFormat\n\n\t// The type of document.\n\tDocumentType DocumentType\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// The Sha256 or Sha1 hash created by the system when the document was created.\n\t// Sha1 hashes have been deprecated.\n\tHash *string\n\n\t// The hash type of the document. Valid values include Sha256 or Sha1 . Sha1 hashes\n\t// have been deprecated.\n\tHashType DocumentHashType\n\n\t// The latest version of the document.\n\tLatestVersion *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\t// The Amazon Web Services user that created the document.\n\tOwner *string\n\n\t// A description of the parameters for a document.\n\tParameters []DocumentParameter\n\n\t// The version of the document that is currently under review.\n\tPendingReviewVersion *string\n\n\t// The list of operating system (OS) platforms compatible with this SSM document.\n\tPlatformTypes []PlatformType\n\n\t// A list of SSM documents required by a document. For example, an\n\t// ApplicationConfiguration document requires an ApplicationConfigurationSchema\n\t// document.\n\tRequires []DocumentRequires\n\n\t// Details about the review of a document.\n\tReviewInformation []ReviewInformation\n\n\t// The current status of the review.\n\tReviewStatus ReviewStatus\n\n\t// The schema version.\n\tSchemaVersion *string\n\n\t// The SHA1 hash of the document, which you can use for verification.\n\tSha1 *string\n\n\t// The status of the SSM document.\n\tStatus DocumentStatus\n\n\t// A message returned by Amazon Web Services Systems Manager that explains the\n\t// Status value. For example, a Failed status might be explained by the\n\t// StatusInformation message, \"The specified S3 bucket doesn't exist. Verify that\n\t// the URL of the S3 bucket is correct.\"\n\tStatusInformation *string\n\n\t// The tags, or metadata, that have been applied to the document.\n\tTags []Tag\n\n\t// The target type which defines the kinds of resources the document can run on.\n\t// For example, /AWS::EC2::Instance . For a list of valid resource types, see\n\t// Amazon Web Services resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)\n\t// in the CloudFormation User Guide.\n\tTargetType *string\n\n\t// The version of the artifact associated with the document.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// This data type is deprecated. Instead, use DocumentKeyValuesFilter .\ntype DocumentFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey DocumentFilterKey\n\n\t// The value of the filter.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes the name of a SSM document.\ntype DocumentIdentifier struct {\n\n\t// The user in your organization who created the document.\n\tAuthor *string\n\n\t// The date the SSM document was created.\n\tCreatedDate *time.Time\n\n\t// An optional field where you can specify a friendly name for the SSM document.\n\t// This value can differ for each version of the document. If you want to update\n\t// this value, see UpdateDocument .\n\tDisplayName *string\n\n\t// The document format, either JSON or YAML.\n\tDocumentFormat DocumentFormat\n\n\t// The document type.\n\tDocumentType DocumentType\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// The name of the SSM document.\n\tName *string\n\n\t// The Amazon Web Services user that created the document.\n\tOwner *string\n\n\t// The operating system platform.\n\tPlatformTypes []PlatformType\n\n\t// A list of SSM documents required by a document. For example, an\n\t// ApplicationConfiguration document requires an ApplicationConfigurationSchema\n\t// document.\n\tRequires []DocumentRequires\n\n\t// The current status of a document review.\n\tReviewStatus ReviewStatus\n\n\t// The schema version.\n\tSchemaVersion *string\n\n\t// The tags, or metadata, that have been applied to the document.\n\tTags []Tag\n\n\t// The target type which defines the kinds of resources the document can run on.\n\t// For example, /AWS::EC2::Instance . For a list of valid resource types, see\n\t// Amazon Web Services resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)\n\t// in the CloudFormation User Guide.\n\tTargetType *string\n\n\t// An optional field specifying the version of the artifact associated with the\n\t// document. For example, \"Release 12, Update 6\". This value is unique across all\n\t// versions of a document, and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more filters. Use a filter to return a more specific list of documents.\n// For keys, you can specify one or more tags that have been applied to a document.\n// You can also use Amazon Web Services-provided keys, some of which have specific\n// allowed values. These keys and their associated values are as follows:\n// DocumentType\n//   - ApplicationConfiguration\n//   - ApplicationConfigurationSchema\n//   - Automation\n//   - ChangeCalendar\n//   - Command\n//   - Package\n//   - Policy\n//   - Session\n//\n// Owner Note that only one Owner can be specified in a request. For example:\n// Key=Owner,Values=Self .\n//   - Amazon\n//   - Private\n//   - Public\n//   - Self\n//   - ThirdParty\n//\n// PlatformTypes\n//   - Linux\n//   - Windows\n//\n// Name is another Amazon Web Services-provided key. If you use Name as a key, you\n// can use a name prefix to return a list of documents. For example, in the Amazon\n// Web Services CLI, to return a list of all documents that begin with Te , run the\n// following command: aws ssm list-documents --filters Key=Name,Values=Te You can\n// also use the TargetType Amazon Web Services-provided key. For a list of valid\n// resource type values that can be used with this key, see Amazon Web Services\n// resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)\n// in the CloudFormation User Guide. If you specify more than two keys, only\n// documents that are identified by all the tags are returned in the results. If\n// you specify more than two values for a key, documents that are identified by any\n// of the values are returned in the results. To specify a custom key-value pair,\n// use the format Key=tag:tagName,Values=valueName . For example, if you created a\n// key called region and are using the Amazon Web Services CLI to call the\n// list-documents command: aws ssm list-documents --filters\n// Key=tag:region,Values=east,west Key=Owner,Values=Self\ntype DocumentKeyValuesFilter struct {\n\n\t// The name of the filter key.\n\tKey *string\n\n\t// The value for the filter key.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Details about the response to a document review request.\ntype DocumentMetadataResponseInfo struct {\n\n\t// Details about a reviewer's response to a document review request.\n\tReviewerResponse []DocumentReviewerResponseSource\n\n\tnoSmithyDocumentSerde\n}\n\n// Parameters specified in a Systems Manager document that run on the server when\n// the command is run.\ntype DocumentParameter struct {\n\n\t// If specified, the default values for the parameters. Parameters without a\n\t// default value are required. Parameters with a default value are optional.\n\tDefaultValue *string\n\n\t// A description of what the parameter does, how to use it, the default value, and\n\t// whether or not the parameter is optional.\n\tDescription *string\n\n\t// The name of the parameter.\n\tName *string\n\n\t// The type of parameter. The type can be either String or StringList.\n\tType DocumentParameterType\n\n\tnoSmithyDocumentSerde\n}\n\n// An SSM document required by the current document.\ntype DocumentRequires struct {\n\n\t// The name of the required SSM document. The name can be an Amazon Resource Name\n\t// (ARN).\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The document type of the required SSM document.\n\tRequireType *string\n\n\t// The document version required by the current document.\n\tVersion *string\n\n\t// An optional field specifying the version of the artifact associated with the\n\t// document. For example, \"Release 12, Update 6\". This value is unique across all\n\t// versions of a document, and can't be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about comments added to a document review request.\ntype DocumentReviewCommentSource struct {\n\n\t// The content of a comment entered by a user who requests a review of a new\n\t// document version, or who reviews the new version.\n\tContent *string\n\n\t// The type of information added to a review request. Currently, only the value\n\t// Comment is supported.\n\tType DocumentReviewCommentType\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a reviewer's response to a document review request.\ntype DocumentReviewerResponseSource struct {\n\n\t// The comment entered by a reviewer as part of their document review response.\n\tComment []DocumentReviewCommentSource\n\n\t// The date and time that a reviewer entered a response to a document review\n\t// request.\n\tCreateTime *time.Time\n\n\t// The current review status of a new custom SSM document created by a member of\n\t// your organization, or of the latest version of an existing SSM document. Only\n\t// one version of a document can be in the APPROVED state at a time. When a new\n\t// version is approved, the status of the previous version changes to REJECTED.\n\t// Only one version of a document can be in review, or PENDING, at a time.\n\tReviewStatus ReviewStatus\n\n\t// The user in your organization assigned to review a document request.\n\tReviewer *string\n\n\t// The date and time that a reviewer last updated a response to a document review\n\t// request.\n\tUpdatedTime *time.Time\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a document approval review.\ntype DocumentReviews struct {\n\n\t// The action to take on a document approval review request.\n\t//\n\t// This member is required.\n\tAction DocumentReviewAction\n\n\t// A comment entered by a user in your organization about the document review\n\t// request.\n\tComment []DocumentReviewCommentSource\n\n\tnoSmithyDocumentSerde\n}\n\n// Version information about the document.\ntype DocumentVersionInfo struct {\n\n\t// The date the document was created.\n\tCreatedDate *time.Time\n\n\t// The friendly name of the SSM document. This value can differ for each version\n\t// of the document. If you want to update this value, see UpdateDocument .\n\tDisplayName *string\n\n\t// The document format, either JSON or YAML.\n\tDocumentFormat DocumentFormat\n\n\t// The document version.\n\tDocumentVersion *string\n\n\t// An identifier for the default version of the document.\n\tIsDefaultVersion bool\n\n\t// The document name.\n\tName *string\n\n\t// The current status of the approval review for the latest version of the\n\t// document.\n\tReviewStatus ReviewStatus\n\n\t// The status of the SSM document, such as Creating , Active , Failed , and\n\t// Deleting .\n\tStatus DocumentStatus\n\n\t// A message returned by Amazon Web Services Systems Manager that explains the\n\t// Status value. For example, a Failed status might be explained by the\n\t// StatusInformation message, \"The specified S3 bucket doesn't exist. Verify that\n\t// the URL of the S3 bucket is correct.\"\n\tStatusInformation *string\n\n\t// The version of the artifact associated with the document. For example, \"Release\n\t// 12, Update 6\". This value is unique across all versions of a document, and can't\n\t// be changed.\n\tVersionName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The EffectivePatch structure defines metadata about a patch along with the\n// approval state of the patch in a particular patch baseline. The approval state\n// includes information about whether the patch is currently approved, due to be\n// approved by a rule, explicitly approved, or explicitly rejected and the date the\n// patch was or will be approved.\ntype EffectivePatch struct {\n\n\t// Provides metadata for a patch, including information such as the KB ID,\n\t// severity, classification and a URL for where more information can be obtained\n\t// about the patch.\n\tPatch *Patch\n\n\t// The status of the patch in a patch baseline. This includes information about\n\t// whether the patch is currently approved, due to be approved by a rule,\n\t// explicitly approved, or explicitly rejected and the date the patch was or will\n\t// be approved.\n\tPatchStatus *PatchStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a failed association.\ntype FailedCreateAssociation struct {\n\n\t// The association.\n\tEntry *CreateAssociationBatchRequestEntry\n\n\t// The source of the failure.\n\tFault Fault\n\n\t// A description of the failure.\n\tMessage *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about an Automation failure.\ntype FailureDetails struct {\n\n\t// Detailed information about the Automation step failure.\n\tDetails map[string][]string\n\n\t// The stage of the Automation execution when the failure occurred. The stages\n\t// include the following: InputValidation, PreVerification, Invocation,\n\t// PostVerification.\n\tFailureStage *string\n\n\t// The type of Automation failure. Failure types include the following: Action,\n\t// Permission, Throttling, Verification, Internal.\n\tFailureType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A resource policy helps you to define the IAM entity (for example, an Amazon\n// Web Services account) that can manage your Systems Manager resources. Currently,\n// OpsItemGroup is the only resource that supports Systems Manager resource\n// policies. The resource policy for OpsItemGroup enables Amazon Web Services\n// accounts to view and interact with OpsCenter operational work items (OpsItems).\ntype GetResourcePoliciesResponseEntry struct {\n\n\t// A resource policy helps you to define the IAM entity (for example, an Amazon\n\t// Web Services account) that can manage your Systems Manager resources. Currently,\n\t// OpsItemGroup is the only resource that supports Systems Manager resource\n\t// policies. The resource policy for OpsItemGroup enables Amazon Web Services\n\t// accounts to view and interact with OpsCenter operational work items (OpsItems).\n\tPolicy *string\n\n\t// ID of the current policy version. The hash helps to prevent a situation where\n\t// multiple users attempt to overwrite a policy. You must provide this hash when\n\t// updating or deleting a policy.\n\tPolicyHash *string\n\n\t// A policy ID.\n\tPolicyId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Status information about the aggregated associations.\ntype InstanceAggregatedAssociationOverview struct {\n\n\t// Detailed status information about the aggregated associations.\n\tDetailedStatus *string\n\n\t// The number of associations for the managed node(s).\n\tInstanceAssociationStatusAggregatedCount map[string]int32\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more association documents on the managed node.\ntype InstanceAssociation struct {\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// Version information for the association on the managed node.\n\tAssociationVersion *string\n\n\t// The content of the association document for the managed node(s).\n\tContent *string\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An S3 bucket where you want to store the results of this request. For the\n// minimal permissions required to enable Amazon S3 output for an association, see\n// Creating associations (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc.html)\n// in the Systems Manager User Guide.\ntype InstanceAssociationOutputLocation struct {\n\n\t// An S3 bucket where you want to store the results of this request.\n\tS3Location *S3OutputLocation\n\n\tnoSmithyDocumentSerde\n}\n\n// The URL of S3 bucket where you want to store the results of this request.\ntype InstanceAssociationOutputUrl struct {\n\n\t// The URL of S3 bucket where you want to store the results of this request.\n\tS3OutputUrl *S3OutputUrl\n\n\tnoSmithyDocumentSerde\n}\n\n// Status information about the association.\ntype InstanceAssociationStatusInfo struct {\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// The name of the association applied to the managed node.\n\tAssociationName *string\n\n\t// The version of the association applied to the managed node.\n\tAssociationVersion *string\n\n\t// Detailed status information about the association.\n\tDetailedStatus *string\n\n\t// The association document versions.\n\tDocumentVersion *string\n\n\t// An error code returned by the request to create the association.\n\tErrorCode *string\n\n\t// The date the association ran.\n\tExecutionDate *time.Time\n\n\t// Summary information about association execution.\n\tExecutionSummary *string\n\n\t// The managed node ID where the association was created.\n\tInstanceId *string\n\n\t// The name of the association.\n\tName *string\n\n\t// A URL for an S3 bucket where you want to store the results of this request.\n\tOutputUrl *InstanceAssociationOutputUrl\n\n\t// Status information about the association.\n\tStatus *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter for a specific list of managed nodes.\ntype InstanceInformation struct {\n\n\t// The activation ID created by Amazon Web Services Systems Manager when the\n\t// server or virtual machine (VM) was registered.\n\tActivationId *string\n\n\t// The version of SSM Agent running on your Linux managed node.\n\tAgentVersion *string\n\n\t// Information about the association.\n\tAssociationOverview *InstanceAggregatedAssociationOverview\n\n\t// The status of the association.\n\tAssociationStatus *string\n\n\t// The fully qualified host name of the managed node.\n\tComputerName *string\n\n\t// The IP address of the managed node.\n\tIPAddress *string\n\n\t// The Identity and Access Management (IAM) role assigned to the on-premises\n\t// Systems Manager managed node. This call doesn't return the IAM role for Amazon\n\t// Elastic Compute Cloud (Amazon EC2) instances. To retrieve the IAM role for an\n\t// EC2 instance, use the Amazon EC2 DescribeInstances operation. For information,\n\t// see DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html)\n\t// in the Amazon EC2 API Reference or describe-instances (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html)\n\t// in the Amazon Web Services CLI Command Reference.\n\tIamRole *string\n\n\t// The managed node ID.\n\tInstanceId *string\n\n\t// Indicates whether the latest version of SSM Agent is running on your Linux\n\t// managed node. This field doesn't indicate whether or not the latest version is\n\t// installed on Windows managed nodes, because some older versions of Windows\n\t// Server use the EC2Config service to process Systems Manager requests.\n\tIsLatestVersion *bool\n\n\t// The date the association was last run.\n\tLastAssociationExecutionDate *time.Time\n\n\t// The date and time when the agent last pinged the Systems Manager service.\n\tLastPingDateTime *time.Time\n\n\t// The last date the association was successfully run.\n\tLastSuccessfulAssociationExecutionDate *time.Time\n\n\t// The name assigned to an on-premises server, edge device, or virtual machine\n\t// (VM) when it is activated as a Systems Manager managed node. The name is\n\t// specified as the DefaultInstanceName property using the CreateActivation\n\t// command. It is applied to the managed node by specifying the Activation Code and\n\t// Activation ID when you install SSM Agent on the node, as explained in Install\n\t// SSM Agent for a hybrid environment (Linux) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html)\n\t// and Install SSM Agent for a hybrid environment (Windows) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html)\n\t// . To retrieve the Name tag of an EC2 instance, use the Amazon EC2\n\t// DescribeInstances operation. For information, see DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html)\n\t// in the Amazon EC2 API Reference or describe-instances (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html)\n\t// in the Amazon Web Services CLI Command Reference.\n\tName *string\n\n\t// Connection status of SSM Agent. The status Inactive has been deprecated and is\n\t// no longer in use.\n\tPingStatus PingStatus\n\n\t// The name of the operating system platform running on your managed node.\n\tPlatformName *string\n\n\t// The operating system platform type.\n\tPlatformType PlatformType\n\n\t// The version of the OS platform running on your managed node.\n\tPlatformVersion *string\n\n\t// The date the server or VM was registered with Amazon Web Services as a managed\n\t// node.\n\tRegistrationDate *time.Time\n\n\t// The type of instance. Instances are either EC2 instances or managed instances.\n\tResourceType ResourceType\n\n\t// The ID of the source resource. For IoT Greengrass devices, SourceId is the\n\t// Thing name.\n\tSourceId *string\n\n\t// The type of the source resource. For IoT Greengrass devices, SourceType is\n\t// AWS::IoT::Thing .\n\tSourceType SourceType\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter for a specific list of managed nodes. You can filter node\n// information by using tags. You specify tags by using a key-value mapping. Use\n// this operation instead of the\n// DescribeInstanceInformationRequest$InstanceInformationFilterList method. The\n// InstanceInformationFilterList method is a legacy method and doesn't support tags.\ntype InstanceInformationFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey InstanceInformationFilterKey\n\n\t// The filter values.\n\t//\n\t// This member is required.\n\tValueSet []string\n\n\tnoSmithyDocumentSerde\n}\n\n// The filters to describe or get information about your managed nodes.\ntype InstanceInformationStringFilter struct {\n\n\t// The filter key name to describe your managed nodes. Valid filter key values:\n\t// ActivationIds | AgentVersion | AssociationStatus | IamRole | InstanceIds |\n\t// PingStatus | PlatformTypes | ResourceType | SourceIds | SourceTypes | \"tag-key\"\n\t// | \"tag: {keyname}\n\t//   - Valid values for the AssociationStatus filter key: Success | Pending |\n\t//   Failed\n\t//   - Valid values for the PingStatus filter key: Online | ConnectionLost |\n\t//   Inactive (deprecated)\n\t//   - Valid values for the PlatformType filter key: Windows | Linux | MacOS\n\t//   - Valid values for the ResourceType filter key: EC2Instance | ManagedInstance\n\t//   - Valid values for the SourceType filter key: AWS::EC2::Instance |\n\t//   AWS::SSM::ManagedInstance | AWS::IoT::Thing\n\t//   - Valid tag examples: Key=tag-key,Values=Purpose | Key=tag:Purpose,Values=Test\n\t//   .\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The filter values.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines the high-level patch compliance state for a managed node, providing\n// information about the number of installed, missing, not applicable, and failed\n// patches along with metadata about the operation when this information was\n// gathered for the managed node.\ntype InstancePatchState struct {\n\n\t// The ID of the patch baseline used to patch the managed node.\n\t//\n\t// This member is required.\n\tBaselineId *string\n\n\t// The ID of the managed node the high-level patch compliance information was\n\t// collected for.\n\t//\n\t// This member is required.\n\tInstanceId *string\n\n\t// The type of patching operation that was performed: or\n\t//   - SCAN assesses the patch compliance state.\n\t//   - INSTALL installs missing patches.\n\t//\n\t// This member is required.\n\tOperation PatchOperationType\n\n\t// The time the most recent patching operation completed on the managed node.\n\t//\n\t// This member is required.\n\tOperationEndTime *time.Time\n\n\t// The time the most recent patching operation was started on the managed node.\n\t//\n\t// This member is required.\n\tOperationStartTime *time.Time\n\n\t// The name of the patch group the managed node belongs to.\n\t//\n\t// This member is required.\n\tPatchGroup *string\n\n\t// The number of patches per node that are specified as Critical for compliance\n\t// reporting in the patch baseline aren't installed. These patches might be\n\t// missing, have failed installation, were rejected, or were installed but awaiting\n\t// a required managed node reboot. The status of these managed nodes is\n\t// NON_COMPLIANT .\n\tCriticalNonCompliantCount *int32\n\n\t// The number of patches from the patch baseline that were attempted to be\n\t// installed during the last patching operation, but failed to install.\n\tFailedCount int32\n\n\t// An https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL to\n\t// a list of patches to be installed. This patch installation list, which you\n\t// maintain in an S3 bucket in YAML format and specify in the SSM document\n\t// AWS-RunPatchBaseline , overrides the patches specified by the default patch\n\t// baseline. For more information about the InstallOverrideList parameter, see\n\t// About the AWS-RunPatchBaseline (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-about-aws-runpatchbaseline.html)\n\t// SSM document in the Amazon Web Services Systems Manager User Guide.\n\tInstallOverrideList *string\n\n\t// The number of patches from the patch baseline that are installed on the managed\n\t// node.\n\tInstalledCount int32\n\n\t// The number of patches not specified in the patch baseline that are installed on\n\t// the managed node.\n\tInstalledOtherCount int32\n\n\t// The number of patches installed by Patch Manager since the last time the\n\t// managed node was rebooted.\n\tInstalledPendingRebootCount *int32\n\n\t// The number of patches installed on a managed node that are specified in a\n\t// RejectedPatches list. Patches with a status of InstalledRejected were typically\n\t// installed before they were added to a RejectedPatches list. If\n\t// ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction , the\n\t// value of InstalledRejectedCount will always be 0 (zero).\n\tInstalledRejectedCount *int32\n\n\t// The time of the last attempt to patch the managed node with NoReboot specified\n\t// as the reboot option.\n\tLastNoRebootInstallOperationTime *time.Time\n\n\t// The number of patches from the patch baseline that are applicable for the\n\t// managed node but aren't currently installed.\n\tMissingCount int32\n\n\t// The number of patches from the patch baseline that aren't applicable for the\n\t// managed node and therefore aren't installed on the node. This number may be\n\t// truncated if the list of patch names is very large. The number of patches beyond\n\t// this limit are reported in UnreportedNotApplicableCount .\n\tNotApplicableCount int32\n\n\t// The number of patches per node that are specified as other than Critical or\n\t// Security but aren't compliant with the patch baseline. The status of these\n\t// managed nodes is NON_COMPLIANT .\n\tOtherNonCompliantCount *int32\n\n\t// Placeholder information. This field will always be empty in the current release\n\t// of the service.\n\tOwnerInformation *string\n\n\t// Indicates the reboot option specified in the patch baseline. Reboot options\n\t// apply to Install operations only. Reboots aren't attempted for Patch Manager\n\t// Scan operations.\n\t//   - RebootIfNeeded : Patch Manager tries to reboot the managed node if it\n\t//   installed any patches, or if any patches are detected with a status of\n\t//   InstalledPendingReboot .\n\t//   - NoReboot : Patch Manager attempts to install missing packages without trying\n\t//   to reboot the system. Patches installed with this option are assigned a status\n\t//   of InstalledPendingReboot . These patches might not be in effect until a\n\t//   reboot is performed.\n\tRebootOption RebootOption\n\n\t// The number of patches per node that are specified as Security in a patch\n\t// advisory aren't installed. These patches might be missing, have failed\n\t// installation, were rejected, or were installed but awaiting a required managed\n\t// node reboot. The status of these managed nodes is NON_COMPLIANT .\n\tSecurityNonCompliantCount *int32\n\n\t// The ID of the patch baseline snapshot used during the patching operation when\n\t// this compliance data was collected.\n\tSnapshotId *string\n\n\t// The number of patches beyond the supported limit of NotApplicableCount that\n\t// aren't reported by name to Inventory. Inventory is a capability of Amazon Web\n\t// Services Systems Manager.\n\tUnreportedNotApplicableCount *int32\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines a filter used in DescribeInstancePatchStatesForPatchGroup to scope down\n// the information returned by the API. Example: To filter for all managed nodes in\n// a patch group having more than three patches with a FailedCount status, use the\n// following for the filter:\n//   - Value for Key : FailedCount\n//   - Value for Type : GreaterThan\n//   - Value for Values : 3\ntype InstancePatchStateFilter struct {\n\n\t// The key for the filter. Supported values include the following:\n\t//   - InstalledCount\n\t//   - InstalledOtherCount\n\t//   - InstalledPendingRebootCount\n\t//   - InstalledRejectedCount\n\t//   - MissingCount\n\t//   - FailedCount\n\t//   - UnreportedNotApplicableCount\n\t//   - NotApplicableCount\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The type of comparison that should be performed for the value.\n\t//\n\t// This member is required.\n\tType InstancePatchStateOperatorType\n\n\t// The value for the filter. Must be an integer greater than or equal to 0.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Specifies the inventory type and attribute for the aggregation execution.\ntype InventoryAggregator struct {\n\n\t// Nested aggregators to further refine aggregation for an inventory type.\n\tAggregators []InventoryAggregator\n\n\t// The inventory type and attribute name for aggregation.\n\tExpression *string\n\n\t// A user-defined set of one or more filters on which to aggregate inventory data.\n\t// Groups return a count of resources that match and don't match the specified\n\t// criteria.\n\tGroups []InventoryGroup\n\n\tnoSmithyDocumentSerde\n}\n\n// Status information returned by the DeleteInventory operation.\ntype InventoryDeletionStatusItem struct {\n\n\t// The deletion ID returned by the DeleteInventory operation.\n\tDeletionId *string\n\n\t// The UTC timestamp when the delete operation started.\n\tDeletionStartTime *time.Time\n\n\t// Information about the delete operation. For more information about this\n\t// summary, see Understanding the delete inventory summary (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tDeletionSummary *InventoryDeletionSummary\n\n\t// The status of the operation. Possible values are InProgress and Complete.\n\tLastStatus InventoryDeletionStatus\n\n\t// Information about the status.\n\tLastStatusMessage *string\n\n\t// The UTC timestamp of when the last status report.\n\tLastStatusUpdateTime *time.Time\n\n\t// The name of the inventory data type.\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the delete operation.\ntype InventoryDeletionSummary struct {\n\n\t// Remaining number of items to delete.\n\tRemainingCount int32\n\n\t// A list of counts and versions for deleted items.\n\tSummaryItems []InventoryDeletionSummaryItem\n\n\t// The total number of items to delete. This count doesn't change during the\n\t// delete operation.\n\tTotalCount int32\n\n\tnoSmithyDocumentSerde\n}\n\n// Either a count, remaining count, or a version number in a delete inventory\n// summary.\ntype InventoryDeletionSummaryItem struct {\n\n\t// A count of the number of deleted items.\n\tCount int32\n\n\t// The remaining number of items to delete.\n\tRemainingCount int32\n\n\t// The inventory type version.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more filters. Use a filter to return a more specific list of results.\ntype InventoryFilter struct {\n\n\t// The name of the filter key.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// Inventory filter values. Example: inventory filter where managed node IDs are\n\t// specified as values Key=AWS:InstanceInformation.InstanceId,Values=\n\t// i-a12b3c4d5e6g, i-1a2b3c4d5e6,Type=Equal .\n\t//\n\t// This member is required.\n\tValues []string\n\n\t// The type of filter. The Exists filter must be used with aggregators. For more\n\t// information, see Aggregating inventory data (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-aggregate.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tType InventoryQueryOperatorType\n\n\tnoSmithyDocumentSerde\n}\n\n// A user-defined set of one or more filters on which to aggregate inventory data.\n// Groups return a count of resources that match and don't match the specified\n// criteria.\ntype InventoryGroup struct {\n\n\t// Filters define the criteria for the group. The matchingCount field displays the\n\t// number of resources that match the criteria. The notMatchingCount field\n\t// displays the number of resources that don't match the criteria.\n\t//\n\t// This member is required.\n\tFilters []InventoryFilter\n\n\t// The name of the group.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information collected from managed nodes based on your inventory policy document\ntype InventoryItem struct {\n\n\t// The time the inventory information was collected.\n\t//\n\t// This member is required.\n\tCaptureTime *string\n\n\t// The schema version for the inventory item.\n\t//\n\t// This member is required.\n\tSchemaVersion *string\n\n\t// The name of the inventory type. Default inventory item type names start with AWS\n\t// . Custom inventory type names will start with Custom. Default inventory item\n\t// types include the following: AWS:AWSComponent , AWS:Application ,\n\t// AWS:InstanceInformation , AWS:Network , and AWS:WindowsUpdate .\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\t// The inventory data of the inventory type.\n\tContent []map[string]string\n\n\t// MD5 hash of the inventory item type contents. The content hash is used to\n\t// determine whether to update inventory information. The PutInventory API doesn't\n\t// update the inventory item type contents if the MD5 hash hasn't changed since\n\t// last update.\n\tContentHash *string\n\n\t// A map of associated properties for a specified inventory type. For example,\n\t// with this attribute, you can specify the ExecutionId , ExecutionType ,\n\t// ComplianceType properties of the AWS:ComplianceItem type.\n\tContext map[string]string\n\n\tnoSmithyDocumentSerde\n}\n\n// Attributes are the entries within the inventory item content. It contains name\n// and value.\ntype InventoryItemAttribute struct {\n\n\t// The data type of the inventory item attribute.\n\t//\n\t// This member is required.\n\tDataType InventoryAttributeDataType\n\n\t// Name of the inventory item attribute.\n\t//\n\t// This member is required.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The inventory item schema definition. Users can use this to compose inventory\n// query filters.\ntype InventoryItemSchema struct {\n\n\t// The schema attributes for inventory. This contains data type and attribute name.\n\t//\n\t// This member is required.\n\tAttributes []InventoryItemAttribute\n\n\t// The name of the inventory type. Default inventory item type names start with\n\t// Amazon Web Services. Custom inventory type names will start with Custom. Default\n\t// inventory item types include the following: AWS:AWSComponent , AWS:Application ,\n\t// AWS:InstanceInformation , AWS:Network , and AWS:WindowsUpdate .\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\t// The alias name of the inventory type. The alias name is used for display\n\t// purposes.\n\tDisplayName *string\n\n\t// The schema version for the inventory item.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Inventory query results.\ntype InventoryResultEntity struct {\n\n\t// The data section in the inventory result entity JSON.\n\tData map[string]InventoryResultItem\n\n\t// ID of the inventory result entity. For example, for managed node inventory the\n\t// result will be the managed node ID. For EC2 instance inventory, the result will\n\t// be the instance ID.\n\tId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The inventory result item.\ntype InventoryResultItem struct {\n\n\t// Contains all the inventory data of the item type. Results include attribute\n\t// names and values.\n\t//\n\t// This member is required.\n\tContent []map[string]string\n\n\t// The schema version for the inventory result item/\n\t//\n\t// This member is required.\n\tSchemaVersion *string\n\n\t// The name of the inventory result item type.\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\t// The time inventory item data was captured.\n\tCaptureTime *string\n\n\t// MD5 hash of the inventory item type contents. The content hash is used to\n\t// determine whether to update inventory information. The PutInventory API doesn't\n\t// update the inventory item type contents if the MD5 hash hasn't changed since\n\t// last update.\n\tContentHash *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about an Amazon Simple Storage Service (Amazon S3) bucket to write\n// managed node-level logs to. LoggingInfo has been deprecated. To specify an\n// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use\n// the OutputS3BucketName and OutputS3KeyPrefix options in the\n// TaskInvocationParameters structure. For information about how Amazon Web\n// Services Systems Manager handles these options for the supported maintenance\n// window task types, see MaintenanceWindowTaskInvocationParameters .\ntype LoggingInfo struct {\n\n\t// The name of an S3 bucket where execution logs are stored.\n\t//\n\t// This member is required.\n\tS3BucketName *string\n\n\t// The Amazon Web Services Region where the S3 bucket is located.\n\t//\n\t// This member is required.\n\tS3Region *string\n\n\t// (Optional) The S3 bucket subfolder.\n\tS3KeyPrefix *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The parameters for an AUTOMATION task type.\ntype MaintenanceWindowAutomationParameters struct {\n\n\t// The version of an Automation runbook to use during task execution.\n\tDocumentVersion *string\n\n\t// The parameters for the AUTOMATION task. For information about specifying and\n\t// updating task parameters, see RegisterTaskWithMaintenanceWindow and\n\t// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an\n\t// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use\n\t// the OutputS3BucketName and OutputS3KeyPrefix options in the\n\t// TaskInvocationParameters structure. For information about how Amazon Web\n\t// Services Systems Manager handles these options for the supported maintenance\n\t// window task types, see MaintenanceWindowTaskInvocationParameters .\n\t// TaskParameters has been deprecated. To specify parameters to pass to a task when\n\t// it runs, instead use the Parameters option in the TaskInvocationParameters\n\t// structure. For information about how Systems Manager handles these options for\n\t// the supported maintenance window task types, see\n\t// MaintenanceWindowTaskInvocationParameters . For AUTOMATION task types, Amazon\n\t// Web Services Systems Manager ignores any values specified for these parameters.\n\tParameters map[string][]string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes the information about an execution of a maintenance window.\ntype MaintenanceWindowExecution struct {\n\n\t// The time the execution finished.\n\tEndTime *time.Time\n\n\t// The time the execution started.\n\tStartTime *time.Time\n\n\t// The status of the execution.\n\tStatus MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status. Not available for all status values.\n\tStatusDetails *string\n\n\t// The ID of the maintenance window execution.\n\tWindowExecutionId *string\n\n\t// The ID of the maintenance window.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a task execution performed as part of a maintenance window\n// execution.\ntype MaintenanceWindowExecutionTaskIdentity struct {\n\n\t// The details for the CloudWatch alarm applied to your maintenance window task.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// The time the task execution finished.\n\tEndTime *time.Time\n\n\t// The time the task execution started.\n\tStartTime *time.Time\n\n\t// The status of the task execution.\n\tStatus MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status of the task execution. Not available for all\n\t// status values.\n\tStatusDetails *string\n\n\t// The Amazon Resource Name (ARN) of the task that ran.\n\tTaskArn *string\n\n\t// The ID of the specific task execution in the maintenance window execution.\n\tTaskExecutionId *string\n\n\t// The type of task that ran.\n\tTaskType MaintenanceWindowTaskType\n\n\t// The CloudWatch alarm that was invoked by the maintenance window task.\n\tTriggeredAlarms []AlarmStateInformation\n\n\t// The ID of the maintenance window execution that ran the task.\n\tWindowExecutionId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes the information about a task invocation for a particular target as\n// part of a task execution performed as part of a maintenance window execution.\ntype MaintenanceWindowExecutionTaskInvocationIdentity struct {\n\n\t// The time the invocation finished.\n\tEndTime *time.Time\n\n\t// The ID of the action performed in the service that actually handled the task\n\t// invocation. If the task type is RUN_COMMAND , this value is the command ID.\n\tExecutionId *string\n\n\t// The ID of the task invocation.\n\tInvocationId *string\n\n\t// User-provided value that was specified when the target was registered with the\n\t// maintenance window. This was also included in any Amazon CloudWatch Events\n\t// events raised during the task invocation.\n\tOwnerInformation *string\n\n\t// The parameters that were provided for the invocation when it was run.\n\tParameters *string\n\n\t// The time the invocation started.\n\tStartTime *time.Time\n\n\t// The status of the task invocation.\n\tStatus MaintenanceWindowExecutionStatus\n\n\t// The details explaining the status of the task invocation. Not available for all\n\t// status values.\n\tStatusDetails *string\n\n\t// The ID of the specific task execution in the maintenance window execution.\n\tTaskExecutionId *string\n\n\t// The task type.\n\tTaskType MaintenanceWindowTaskType\n\n\t// The ID of the maintenance window execution that ran the task.\n\tWindowExecutionId *string\n\n\t// The ID of the target definition in this maintenance window the invocation was\n\t// performed for.\n\tWindowTargetId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Filter used in the request. Supported filter keys depend on the API operation\n// that includes the filter. API operations that use MaintenanceWindowFilter>\n// include the following:\n//   - DescribeMaintenanceWindowExecutions\n//   - DescribeMaintenanceWindowExecutionTaskInvocations\n//   - DescribeMaintenanceWindowExecutionTasks\n//   - DescribeMaintenanceWindows\n//   - DescribeMaintenanceWindowTargets\n//   - DescribeMaintenanceWindowTasks\ntype MaintenanceWindowFilter struct {\n\n\t// The name of the filter.\n\tKey *string\n\n\t// The filter values.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the maintenance window.\ntype MaintenanceWindowIdentity struct {\n\n\t// The number of hours before the end of the maintenance window that Amazon Web\n\t// Services Systems Manager stops scheduling new tasks for execution.\n\tCutoff int32\n\n\t// A description of the maintenance window.\n\tDescription *string\n\n\t// The duration of the maintenance window in hours.\n\tDuration *int32\n\n\t// Indicates whether the maintenance window is enabled.\n\tEnabled bool\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become inactive.\n\tEndDate *string\n\n\t// The name of the maintenance window.\n\tName *string\n\n\t// The next time the maintenance window will actually run, taking into account any\n\t// specified times for the maintenance window to become active or inactive.\n\tNextExecutionTime *string\n\n\t// The schedule of the maintenance window in the form of a cron or rate expression.\n\tSchedule *string\n\n\t// The number of days to wait to run a maintenance window after the scheduled cron\n\t// expression date and time.\n\tScheduleOffset *int32\n\n\t// The time zone that the scheduled maintenance window executions are based on, in\n\t// Internet Assigned Numbers Authority (IANA) format.\n\tScheduleTimezone *string\n\n\t// The date and time, in ISO-8601 Extended format, for when the maintenance window\n\t// is scheduled to become active.\n\tStartDate *string\n\n\t// The ID of the maintenance window.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The maintenance window to which the specified target belongs.\ntype MaintenanceWindowIdentityForTarget struct {\n\n\t// The name of the maintenance window.\n\tName *string\n\n\t// The ID of the maintenance window.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The parameters for a LAMBDA task type. For information about specifying and\n// updating task parameters, see RegisterTaskWithMaintenanceWindow and\n// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an\n// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use\n// the OutputS3BucketName and OutputS3KeyPrefix options in the\n// TaskInvocationParameters structure. For information about how Amazon Web\n// Services Systems Manager handles these options for the supported maintenance\n// window task types, see MaintenanceWindowTaskInvocationParameters .\n// TaskParameters has been deprecated. To specify parameters to pass to a task when\n// it runs, instead use the Parameters option in the TaskInvocationParameters\n// structure. For information about how Systems Manager handles these options for\n// the supported maintenance window task types, see\n// MaintenanceWindowTaskInvocationParameters . For Lambda tasks, Systems Manager\n// ignores any values specified for TaskParameters and LoggingInfo.\ntype MaintenanceWindowLambdaParameters struct {\n\n\t// Pass client-specific information to the Lambda function that you are invoking.\n\t// You can then process the client information in your Lambda function as you\n\t// choose through the context variable.\n\tClientContext *string\n\n\t// JSON to provide to your Lambda function as input.\n\tPayload []byte\n\n\t// (Optional) Specify an Lambda function version or alias name. If you specify a\n\t// function version, the operation uses the qualified function Amazon Resource Name\n\t// (ARN) to invoke a specific Lambda function. If you specify an alias name, the\n\t// operation uses the alias ARN to invoke the Lambda function version to which the\n\t// alias points.\n\tQualifier *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The parameters for a RUN_COMMAND task type. For information about specifying\n// and updating task parameters, see RegisterTaskWithMaintenanceWindow and\n// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an\n// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use\n// the OutputS3BucketName and OutputS3KeyPrefix options in the\n// TaskInvocationParameters structure. For information about how Amazon Web\n// Services Systems Manager handles these options for the supported maintenance\n// window task types, see MaintenanceWindowTaskInvocationParameters .\n// TaskParameters has been deprecated. To specify parameters to pass to a task when\n// it runs, instead use the Parameters option in the TaskInvocationParameters\n// structure. For information about how Systems Manager handles these options for\n// the supported maintenance window task types, see\n// MaintenanceWindowTaskInvocationParameters . For RUN_COMMAND tasks, Systems\n// Manager uses specified values for TaskParameters and LoggingInfo only if no\n// values are specified for TaskInvocationParameters .\ntype MaintenanceWindowRunCommandParameters struct {\n\n\t// Configuration options for sending command output to Amazon CloudWatch Logs.\n\tCloudWatchOutputConfig *CloudWatchOutputConfig\n\n\t// Information about the commands to run.\n\tComment *string\n\n\t// The SHA-256 or SHA-1 hash created by the system when the document was created.\n\t// SHA-1 hashes have been deprecated.\n\tDocumentHash *string\n\n\t// SHA-256 or SHA-1. SHA-1 hashes have been deprecated.\n\tDocumentHashType DocumentHashType\n\n\t// The Amazon Web Services Systems Manager document (SSM document) version to use\n\t// in the request. You can specify $DEFAULT , $LATEST , or a specific version\n\t// number. If you run commands by using the Amazon Web Services CLI, then you must\n\t// escape the first two options by using a backslash. If you specify a version\n\t// number, then you don't need to use the backslash. For example:\n\t// --document-version \"\\$DEFAULT\"\n\t//     --document-version \"\\$LATEST\"\n\t//\n\t//     --document-version \"3\"\n\tDocumentVersion *string\n\n\t// Configurations for sending notifications about command status changes on a\n\t// per-managed node basis.\n\tNotificationConfig *NotificationConfig\n\n\t// The name of the Amazon Simple Storage Service (Amazon S3) bucket.\n\tOutputS3BucketName *string\n\n\t// The S3 bucket subfolder.\n\tOutputS3KeyPrefix *string\n\n\t// The parameters for the RUN_COMMAND task execution.\n\tParameters map[string][]string\n\n\t// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM)\n\t// service role to use to publish Amazon Simple Notification Service (Amazon SNS)\n\t// notifications for maintenance window Run Command tasks.\n\tServiceRoleArn *string\n\n\t// If this time is reached and the command hasn't already started running, it\n\t// doesn't run.\n\tTimeoutSeconds *int32\n\n\tnoSmithyDocumentSerde\n}\n\n// The parameters for a STEP_FUNCTIONS task. For information about specifying and\n// updating task parameters, see RegisterTaskWithMaintenanceWindow and\n// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an\n// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use\n// the OutputS3BucketName and OutputS3KeyPrefix options in the\n// TaskInvocationParameters structure. For information about how Amazon Web\n// Services Systems Manager handles these options for the supported maintenance\n// window task types, see MaintenanceWindowTaskInvocationParameters .\n// TaskParameters has been deprecated. To specify parameters to pass to a task when\n// it runs, instead use the Parameters option in the TaskInvocationParameters\n// structure. For information about how Systems Manager handles these options for\n// the supported maintenance window task types, see\n// MaintenanceWindowTaskInvocationParameters . For Step Functions tasks, Systems\n// Manager ignores any values specified for TaskParameters and LoggingInfo .\ntype MaintenanceWindowStepFunctionsParameters struct {\n\n\t// The inputs for the STEP_FUNCTIONS task.\n\tInput *string\n\n\t// The name of the STEP_FUNCTIONS task.\n\tName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The target registered with the maintenance window.\ntype MaintenanceWindowTarget struct {\n\n\t// A description for the target.\n\tDescription *string\n\n\t// The name for the maintenance window target.\n\tName *string\n\n\t// A user-provided value that will be included in any Amazon CloudWatch Events\n\t// events that are raised while running tasks for these targets in this maintenance\n\t// window.\n\tOwnerInformation *string\n\n\t// The type of target that is being registered with the maintenance window.\n\tResourceType MaintenanceWindowResourceType\n\n\t// The targets, either managed nodes or tags. Specify managed nodes using the\n\t// following format: Key=instanceids,Values=, Tags are specified using the\n\t// following format: Key=,Values= .\n\tTargets []Target\n\n\t// The ID of the maintenance window to register the target with.\n\tWindowId *string\n\n\t// The ID of the target.\n\tWindowTargetId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a task defined for a maintenance window.\ntype MaintenanceWindowTask struct {\n\n\t// The details for the CloudWatch alarm applied to your maintenance window task.\n\tAlarmConfiguration *AlarmConfiguration\n\n\t// The specification for whether tasks should continue to run after the cutoff\n\t// time specified in the maintenance windows is reached.\n\tCutoffBehavior MaintenanceWindowTaskCutoffBehavior\n\n\t// A description of the task.\n\tDescription *string\n\n\t// Information about an S3 bucket to write task-level logs to. LoggingInfo has\n\t// been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket\n\t// to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix\n\t// options in the TaskInvocationParameters structure. For information about how\n\t// Amazon Web Services Systems Manager handles these options for the supported\n\t// maintenance window task types, see MaintenanceWindowTaskInvocationParameters .\n\tLoggingInfo *LoggingInfo\n\n\t// The maximum number of targets this task can be run for, in parallel. Although\n\t// this element is listed as \"Required: No\", a value can be omitted only when you\n\t// are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxConcurrency *string\n\n\t// The maximum number of errors allowed before this task stops being scheduled.\n\t// Although this element is listed as \"Required: No\", a value can be omitted only\n\t// when you are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n\t// You must provide a value in all other cases. For maintenance window tasks\n\t// without a target specified, you can't supply a value for this option. Instead,\n\t// the system inserts a placeholder value of 1 . This value doesn't affect the\n\t// running of your task.\n\tMaxErrors *string\n\n\t// The task name.\n\tName *string\n\n\t// The priority of the task in the maintenance window. The lower the number, the\n\t// higher the priority. Tasks that have the same priority are scheduled in\n\t// parallel.\n\tPriority int32\n\n\t// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM)\n\t// service role to use to publish Amazon Simple Notification Service (Amazon SNS)\n\t// notifications for maintenance window Run Command tasks.\n\tServiceRoleArn *string\n\n\t// The targets (either managed nodes or tags). Managed nodes are specified using\n\t// Key=instanceids,Values=, . Tags are specified using Key=,Values= .\n\tTargets []Target\n\n\t// The resource that the task uses during execution. For RUN_COMMAND and AUTOMATION\n\t// task types, TaskArn is the Amazon Web Services Systems Manager (SSM document)\n\t// name or ARN. For LAMBDA tasks, it's the function name or ARN. For STEP_FUNCTIONS\n\t// tasks, it's the state machine ARN.\n\tTaskArn *string\n\n\t// The parameters that should be passed to the task when it is run. TaskParameters\n\t// has been deprecated. To specify parameters to pass to a task when it runs,\n\t// instead use the Parameters option in the TaskInvocationParameters structure.\n\t// For information about how Systems Manager handles these options for the\n\t// supported maintenance window task types, see\n\t// MaintenanceWindowTaskInvocationParameters .\n\tTaskParameters map[string]MaintenanceWindowTaskParameterValueExpression\n\n\t// The type of task.\n\tType MaintenanceWindowTaskType\n\n\t// The ID of the maintenance window where the task is registered.\n\tWindowId *string\n\n\t// The task ID.\n\tWindowTaskId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The parameters for task execution.\ntype MaintenanceWindowTaskInvocationParameters struct {\n\n\t// The parameters for an AUTOMATION task type.\n\tAutomation *MaintenanceWindowAutomationParameters\n\n\t// The parameters for a LAMBDA task type.\n\tLambda *MaintenanceWindowLambdaParameters\n\n\t// The parameters for a RUN_COMMAND task type.\n\tRunCommand *MaintenanceWindowRunCommandParameters\n\n\t// The parameters for a STEP_FUNCTIONS task type.\n\tStepFunctions *MaintenanceWindowStepFunctionsParameters\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines the values for a task parameter.\ntype MaintenanceWindowTaskParameterValueExpression struct {\n\n\t// This field contains an array of 0 or more strings, each 1 to 255 characters in\n\t// length.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Metadata to assign to an Application Manager application.\ntype MetadataValue struct {\n\n\t// Metadata value to assign to an Application Manager application.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A summary of resources that aren't compliant. The summary is organized\n// according to resource type.\ntype NonCompliantSummary struct {\n\n\t// The total number of compliance items that aren't compliant.\n\tNonCompliantCount int32\n\n\t// A summary of the non-compliance severity by compliance type\n\tSeveritySummary *SeveritySummary\n\n\tnoSmithyDocumentSerde\n}\n\n// Configurations for sending notifications.\ntype NotificationConfig struct {\n\n\t// An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon\n\t// SNS) topic. Run Command pushes notifications about command status changes to\n\t// this topic.\n\tNotificationArn *string\n\n\t// The different events for which you can receive notifications. To learn more\n\t// about these events, see Monitoring Systems Manager status changes using Amazon\n\t// SNS notifications (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tNotificationEvents []NotificationEvent\n\n\t// The type of notification.\n\t//   - Command : Receive notification when the status of a command changes.\n\t//   - Invocation : For commands sent to multiple managed nodes, receive\n\t//   notification on a per-node basis when the status of a command changes.\n\tNotificationType NotificationType\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more aggregators for viewing counts of OpsData using different\n// dimensions such as Source , CreatedTime , or Source and CreatedTime , to name a\n// few.\ntype OpsAggregator struct {\n\n\t// Either a Range or Count aggregator for limiting an OpsData summary.\n\tAggregatorType *string\n\n\t// A nested aggregator for viewing counts of OpsData.\n\tAggregators []OpsAggregator\n\n\t// The name of an OpsData attribute on which to limit the count of OpsData.\n\tAttributeName *string\n\n\t// The aggregator filters.\n\tFilters []OpsFilter\n\n\t// The data type name to use for viewing counts of OpsData.\n\tTypeName *string\n\n\t// The aggregator value.\n\tValues map[string]string\n\n\tnoSmithyDocumentSerde\n}\n\n// The result of the query.\ntype OpsEntity struct {\n\n\t// The data returned by the query.\n\tData map[string]OpsEntityItem\n\n\t// The query ID.\n\tId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The OpsData summary.\ntype OpsEntityItem struct {\n\n\t// The time the OpsData was captured.\n\tCaptureTime *string\n\n\t// The details of an OpsData summary.\n\tContent []map[string]string\n\n\tnoSmithyDocumentSerde\n}\n\n// A filter for viewing OpsData summaries.\ntype OpsFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The filter value.\n\t//\n\t// This member is required.\n\tValues []string\n\n\t// The type of filter.\n\tType OpsFilterOperatorType\n\n\tnoSmithyDocumentSerde\n}\n\n// Operations engineers and IT professionals use Amazon Web Services Systems\n// Manager OpsCenter to view, investigate, and remediate operational work items\n// (OpsItems) impacting the performance and health of their Amazon Web Services\n// resources. OpsCenter is integrated with Amazon EventBridge and Amazon\n// CloudWatch. This means you can configure these services to automatically create\n// an OpsItem in OpsCenter when a CloudWatch alarm enters the ALARM state or when\n// EventBridge processes an event from any Amazon Web Services service that\n// publishes events. Configuring Amazon CloudWatch alarms and EventBridge events to\n// automatically create OpsItems allows you to quickly diagnose and remediate\n// issues with Amazon Web Services resources from a single console. To help you\n// diagnose issues, each OpsItem includes contextually relevant information such as\n// the name and ID of the Amazon Web Services resource that generated the OpsItem,\n// alarm or event details, alarm history, and an alarm timeline graph. For the\n// Amazon Web Services resource, OpsCenter aggregates information from Config,\n// CloudTrail logs, and EventBridge, so you don't have to navigate across multiple\n// console pages during your investigation. For more information, see OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html)\n// in the Amazon Web Services Systems Manager User Guide.\ntype OpsItem struct {\n\n\t// The time a runbook workflow ended. Currently reported only for the OpsItem type\n\t// /aws/changerequest .\n\tActualEndTime *time.Time\n\n\t// The time a runbook workflow started. Currently reported only for the OpsItem\n\t// type /aws/changerequest .\n\tActualStartTime *time.Time\n\n\t// An OpsItem category. Category options include: Availability, Cost, Performance,\n\t// Recovery, Security.\n\tCategory *string\n\n\t// The ARN of the Amazon Web Services account that created the OpsItem.\n\tCreatedBy *string\n\n\t// The date and time the OpsItem was created.\n\tCreatedTime *time.Time\n\n\t// The OpsItem description.\n\tDescription *string\n\n\t// The ARN of the Amazon Web Services account that last updated the OpsItem.\n\tLastModifiedBy *string\n\n\t// The date and time the OpsItem was last updated.\n\tLastModifiedTime *time.Time\n\n\t// The Amazon Resource Name (ARN) of an Amazon Simple Notification Service (Amazon\n\t// SNS) topic where notifications are sent when this OpsItem is edited or changed.\n\tNotifications []OpsItemNotification\n\n\t// Operational data is custom data that provides useful reference details about\n\t// the OpsItem. For example, you can specify log files, error strings, license\n\t// keys, troubleshooting tips, or other relevant data. You enter operational data\n\t// as key-value pairs. The key has a maximum length of 128 characters. The value\n\t// has a maximum size of 20 KB. Operational data keys can't begin with the\n\t// following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , /ssm . You can\n\t// choose to make the data searchable by other users in the account or you can\n\t// restrict search access. Searchable data means that all users with access to the\n\t// OpsItem Overview page (as provided by the DescribeOpsItems API operation) can\n\t// view and search on the specified data. Operational data that isn't searchable is\n\t// only viewable by users who have access to the OpsItem (as provided by the\n\t// GetOpsItem API operation). Use the /aws/resources key in OperationalData to\n\t// specify a related resource in the request. Use the /aws/automations key in\n\t// OperationalData to associate an Automation runbook with the OpsItem. To view\n\t// Amazon Web Services CLI example commands that use these keys, see Creating\n\t// OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tOperationalData map[string]OpsItemDataValue\n\n\t// The OpsItem Amazon Resource Name (ARN).\n\tOpsItemArn *string\n\n\t// The ID of the OpsItem.\n\tOpsItemId *string\n\n\t// The type of OpsItem. Systems Manager supports the following types of OpsItems:\n\t//   - /aws/issue This type of OpsItem is used for default OpsItems created by\n\t//   OpsCenter.\n\t//   - /aws/changerequest This type of OpsItem is used by Change Manager for\n\t//   reviewing and approving or rejecting change requests.\n\t//   - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and\n\t//   reporting on duplicate OpsItems.\n\tOpsItemType *string\n\n\t// The time specified in a change request for a runbook workflow to end. Currently\n\t// supported only for the OpsItem type /aws/changerequest .\n\tPlannedEndTime *time.Time\n\n\t// The time specified in a change request for a runbook workflow to start.\n\t// Currently supported only for the OpsItem type /aws/changerequest .\n\tPlannedStartTime *time.Time\n\n\t// The importance of this OpsItem in relation to other OpsItems in the system.\n\tPriority *int32\n\n\t// One or more OpsItems that share something in common with the current OpsItem.\n\t// For example, related OpsItems can include OpsItems with similar error messages,\n\t// impacted resources, or statuses for the impacted resource.\n\tRelatedOpsItems []RelatedOpsItem\n\n\t// The severity of the OpsItem. Severity options range from 1 to 4.\n\tSeverity *string\n\n\t// The origin of the OpsItem, such as Amazon EC2 or Systems Manager. The impacted\n\t// resource is a subset of source.\n\tSource *string\n\n\t// The OpsItem status. Status can be Open , In Progress , or Resolved . For more\n\t// information, see Editing OpsItem details (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tStatus OpsItemStatus\n\n\t// A short heading that describes the nature of the OpsItem and the impacted\n\t// resource.\n\tTitle *string\n\n\t// The version of this OpsItem. Each time the OpsItem is edited the version number\n\t// increments by one.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An object that defines the value of the key and its type in the OperationalData\n// map.\ntype OpsItemDataValue struct {\n\n\t// The type of key-value pair. Valid types include SearchableString and String .\n\tType OpsItemDataType\n\n\t// The value of the OperationalData key.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter for a specific list of OpsItem events. You can filter event\n// information by using tags. You specify tags by using a key-value pair mapping.\ntype OpsItemEventFilter struct {\n\n\t// The name of the filter key. Currently, the only supported value is OpsItemId .\n\t//\n\t// This member is required.\n\tKey OpsItemEventFilterKey\n\n\t// The operator used by the filter call. Currently, the only supported value is\n\t// Equal .\n\t//\n\t// This member is required.\n\tOperator OpsItemEventFilterOperator\n\n\t// The values for the filter, consisting of one or more OpsItem IDs.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Summary information about an OpsItem event or that associated an OpsItem with a\n// related item.\ntype OpsItemEventSummary struct {\n\n\t// Information about the user or resource that created the OpsItem event.\n\tCreatedBy *OpsItemIdentity\n\n\t// The date and time the OpsItem event was created.\n\tCreatedTime *time.Time\n\n\t// Specific information about the OpsItem event.\n\tDetail *string\n\n\t// The type of information provided as a detail.\n\tDetailType *string\n\n\t// The ID of the OpsItem event.\n\tEventId *string\n\n\t// The ID of the OpsItem.\n\tOpsItemId *string\n\n\t// The source of the OpsItem event.\n\tSource *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes an OpsItem filter.\ntype OpsItemFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey OpsItemFilterKey\n\n\t// The operator used by the filter call.\n\t//\n\t// This member is required.\n\tOperator OpsItemFilterOperator\n\n\t// The filter value.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the user or resource that created an OpsItem event.\ntype OpsItemIdentity struct {\n\n\t// The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem event.\n\tArn *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A notification about the OpsItem.\ntype OpsItemNotification struct {\n\n\t// The Amazon Resource Name (ARN) of an Amazon Simple Notification Service (Amazon\n\t// SNS) topic where notifications are sent when this OpsItem is edited or changed.\n\tArn *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter for a specific list of related-item resources.\ntype OpsItemRelatedItemsFilter struct {\n\n\t// The name of the filter key. Supported values include ResourceUri , ResourceType\n\t// , or AssociationId .\n\t//\n\t// This member is required.\n\tKey OpsItemRelatedItemsFilterKey\n\n\t// The operator used by the filter call. The only supported operator is EQUAL .\n\t//\n\t// This member is required.\n\tOperator OpsItemRelatedItemsFilterOperator\n\n\t// The values for the filter.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Summary information about related-item resources for an OpsItem.\ntype OpsItemRelatedItemSummary struct {\n\n\t// The association ID.\n\tAssociationId *string\n\n\t// The association type.\n\tAssociationType *string\n\n\t// Information about the user or resource that created an OpsItem event.\n\tCreatedBy *OpsItemIdentity\n\n\t// The time the related-item association was created.\n\tCreatedTime *time.Time\n\n\t// Information about the user or resource that created an OpsItem event.\n\tLastModifiedBy *OpsItemIdentity\n\n\t// The time the related-item association was last updated.\n\tLastModifiedTime *time.Time\n\n\t// The OpsItem ID.\n\tOpsItemId *string\n\n\t// The resource type.\n\tResourceType *string\n\n\t// The Amazon Resource Name (ARN) of the related-item resource.\n\tResourceUri *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A count of OpsItems.\ntype OpsItemSummary struct {\n\n\t// The time a runbook workflow ended. Currently reported only for the OpsItem type\n\t// /aws/changerequest .\n\tActualEndTime *time.Time\n\n\t// The time a runbook workflow started. Currently reported only for the OpsItem\n\t// type /aws/changerequest .\n\tActualStartTime *time.Time\n\n\t// A list of OpsItems by category.\n\tCategory *string\n\n\t// The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.\n\tCreatedBy *string\n\n\t// The date and time the OpsItem was created.\n\tCreatedTime *time.Time\n\n\t// The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.\n\tLastModifiedBy *string\n\n\t// The date and time the OpsItem was last updated.\n\tLastModifiedTime *time.Time\n\n\t// Operational data is custom data that provides useful reference details about\n\t// the OpsItem.\n\tOperationalData map[string]OpsItemDataValue\n\n\t// The ID of the OpsItem.\n\tOpsItemId *string\n\n\t// The type of OpsItem. Systems Manager supports the following types of OpsItems:\n\t//   - /aws/issue This type of OpsItem is used for default OpsItems created by\n\t//   OpsCenter.\n\t//   - /aws/changerequest This type of OpsItem is used by Change Manager for\n\t//   reviewing and approving or rejecting change requests.\n\t//   - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and\n\t//   reporting on duplicate OpsItems.\n\tOpsItemType *string\n\n\t// The time specified in a change request for a runbook workflow to end. Currently\n\t// supported only for the OpsItem type /aws/changerequest .\n\tPlannedEndTime *time.Time\n\n\t// The time specified in a change request for a runbook workflow to start.\n\t// Currently supported only for the OpsItem type /aws/changerequest .\n\tPlannedStartTime *time.Time\n\n\t// The importance of this OpsItem in relation to other OpsItems in the system.\n\tPriority *int32\n\n\t// A list of OpsItems by severity.\n\tSeverity *string\n\n\t// The impacted Amazon Web Services resource.\n\tSource *string\n\n\t// The OpsItem status. Status can be Open , In Progress , or Resolved .\n\tStatus OpsItemStatus\n\n\t// A short heading that describes the nature of the OpsItem and the impacted\n\t// resource.\n\tTitle *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Operational metadata for an application in Application Manager.\ntype OpsMetadata struct {\n\n\t// The date the OpsMetadata objects was created.\n\tCreationDate *time.Time\n\n\t// The date the OpsMetadata object was last updated.\n\tLastModifiedDate *time.Time\n\n\t// The user name who last updated the OpsMetadata object.\n\tLastModifiedUser *string\n\n\t// The Amazon Resource Name (ARN) of the OpsMetadata Object or blob.\n\tOpsMetadataArn *string\n\n\t// The ID of the Application Manager application.\n\tResourceId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A filter to limit the number of OpsMetadata objects displayed.\ntype OpsMetadataFilter struct {\n\n\t// A filter key.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// A filter value.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// The OpsItem data type to return.\ntype OpsResultAttribute struct {\n\n\t// Name of the data type. Valid value: AWS:OpsItem , AWS:EC2InstanceInformation ,\n\t// AWS:OpsItemTrendline , or AWS:ComplianceSummary .\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the source where the association execution details are stored.\ntype OutputSource struct {\n\n\t// The ID of the output source, for example the URL of an S3 bucket.\n\tOutputSourceId *string\n\n\t// The type of source where the association execution details are stored, for\n\t// example, Amazon S3.\n\tOutputSourceType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An Amazon Web Services Systems Manager parameter in Parameter Store.\ntype Parameter struct {\n\n\t// The Amazon Resource Name (ARN) of the parameter.\n\tARN *string\n\n\t// The data type of the parameter, such as text or aws:ec2:image . The default is\n\t// text .\n\tDataType *string\n\n\t// Date the parameter was last changed or updated and the parameter version was\n\t// created.\n\tLastModifiedDate *time.Time\n\n\t// The name of the parameter.\n\tName *string\n\n\t// Either the version number or the label used to retrieve the parameter value.\n\t// Specify selectors by using one of the following formats: parameter_name:version\n\t// parameter_name:label\n\tSelector *string\n\n\t// Applies to parameters that reference information in other Amazon Web Services\n\t// services. SourceResult is the raw result or response from the source.\n\tSourceResult *string\n\n\t// The type of parameter. Valid values include the following: String , StringList ,\n\t// and SecureString . If type is StringList , the system returns a comma-separated\n\t// string with no spaces between commas in the Value field.\n\tType ParameterType\n\n\t// The parameter value. If type is StringList , the system returns a\n\t// comma-separated string with no spaces between commas in the Value field.\n\tValue *string\n\n\t// The parameter version.\n\tVersion int64\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about parameter usage.\ntype ParameterHistory struct {\n\n\t// Parameter names can include the following letters and symbols. a-zA-Z0-9_.-\n\tAllowedPattern *string\n\n\t// The data type of the parameter, such as text or aws:ec2:image . The default is\n\t// text .\n\tDataType *string\n\n\t// Information about the parameter.\n\tDescription *string\n\n\t// The ID of the query key used for this parameter.\n\tKeyId *string\n\n\t// Labels assigned to the parameter version.\n\tLabels []string\n\n\t// Date the parameter was last changed or updated.\n\tLastModifiedDate *time.Time\n\n\t// Amazon Resource Name (ARN) of the Amazon Web Services user who last changed the\n\t// parameter.\n\tLastModifiedUser *string\n\n\t// The name of the parameter.\n\tName *string\n\n\t// Information about the policies assigned to a parameter. Assigning parameter\n\t// policies (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tPolicies []ParameterInlinePolicy\n\n\t// The parameter tier.\n\tTier ParameterTier\n\n\t// The type of parameter used.\n\tType ParameterType\n\n\t// The parameter value.\n\tValue *string\n\n\t// The parameter version.\n\tVersion int64\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more policies assigned to a parameter.\ntype ParameterInlinePolicy struct {\n\n\t// The status of the policy. Policies report the following statuses: Pending (the\n\t// policy hasn't been enforced or applied yet), Finished (the policy was applied),\n\t// Failed (the policy wasn't applied), or InProgress (the policy is being applied\n\t// now).\n\tPolicyStatus *string\n\n\t// The JSON text of the policy.\n\tPolicyText *string\n\n\t// The type of policy. Parameter Store, a capability of Amazon Web Services\n\t// Systems Manager, supports the following policy types: Expiration,\n\t// ExpirationNotification, and NoChangeNotification.\n\tPolicyType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Metadata includes information like the ARN of the last user and the date/time\n// the parameter was last used.\ntype ParameterMetadata struct {\n\n\t// A parameter name can include only the following letters and symbols.\n\t// a-zA-Z0-9_.-\n\tAllowedPattern *string\n\n\t// The data type of the parameter, such as text or aws:ec2:image . The default is\n\t// text .\n\tDataType *string\n\n\t// Description of the parameter actions.\n\tDescription *string\n\n\t// The ID of the query key used for this parameter.\n\tKeyId *string\n\n\t// Date the parameter was last changed or updated.\n\tLastModifiedDate *time.Time\n\n\t// Amazon Resource Name (ARN) of the Amazon Web Services user who last changed the\n\t// parameter.\n\tLastModifiedUser *string\n\n\t// The parameter name.\n\tName *string\n\n\t// A list of policies associated with a parameter.\n\tPolicies []ParameterInlinePolicy\n\n\t// The parameter tier.\n\tTier ParameterTier\n\n\t// The type of parameter. Valid parameter types include the following: String ,\n\t// StringList , and SecureString .\n\tType ParameterType\n\n\t// The parameter version.\n\tVersion int64\n\n\tnoSmithyDocumentSerde\n}\n\n// This data type is deprecated. Instead, use ParameterStringFilter .\ntype ParametersFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey ParametersFilterKey\n\n\t// The filter values.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// One or more filters. Use a filter to return a more specific list of results.\ntype ParameterStringFilter struct {\n\n\t// The name of the filter. The ParameterStringFilter object is used by the\n\t// DescribeParameters and GetParametersByPath API operations. However, not all of\n\t// the pattern values listed for Key can be used with both operations. For\n\t// DescribeParameters , all of the listed patterns are valid except Label . For\n\t// GetParametersByPath , the following patterns listed for Key aren't valid: tag ,\n\t// DataType , Name , Path , and Tier . For examples of Amazon Web Services CLI\n\t// commands demonstrating valid parameter filter constructions, see Searching for\n\t// Systems Manager parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// For all filters used with DescribeParameters , valid options include Equals and\n\t// BeginsWith . The Name filter additionally supports the Contains option.\n\t// (Exception: For filters using the key Path , valid options include Recursive\n\t// and OneLevel .) For filters used with GetParametersByPath , valid options\n\t// include Equals and BeginsWith . (Exception: For filters using Label as the Key\n\t// name, the only valid option is Equals .)\n\tOption *string\n\n\t// The value you want to search for.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// A detailed status of the parent step.\ntype ParentStepDetails struct {\n\n\t// The name of the automation action.\n\tAction *string\n\n\t// The current repetition of the loop represented by an integer.\n\tIteration *int32\n\n\t// The current value of the specified iterator in the loop.\n\tIteratorValue *string\n\n\t// The unique ID of a step execution.\n\tStepExecutionId *string\n\n\t// The name of the step.\n\tStepName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Represents metadata about a patch.\ntype Patch struct {\n\n\t// The Advisory ID of the patch. For example, RHSA-2020:3779 . Applies to\n\t// Linux-based managed nodes only.\n\tAdvisoryIds []string\n\n\t// The architecture of the patch. For example, in\n\t// example-pkg-0.710.10-2.7.abcd.x86_64 , the architecture is indicated by x86_64 .\n\t// Applies to Linux-based managed nodes only.\n\tArch *string\n\n\t// The Bugzilla ID of the patch. For example, 1600646 . Applies to Linux-based\n\t// managed nodes only.\n\tBugzillaIds []string\n\n\t// The Common Vulnerabilities and Exposures (CVE) ID of the patch. For example,\n\t// CVE-2011-3192 . Applies to Linux-based managed nodes only.\n\tCVEIds []string\n\n\t// The classification of the patch. For example, SecurityUpdates , Updates , or\n\t// CriticalUpdates .\n\tClassification *string\n\n\t// The URL where more information can be obtained about the patch.\n\tContentUrl *string\n\n\t// The description of the patch.\n\tDescription *string\n\n\t// The epoch of the patch. For example in pkg-example-EE-20180914-2.2.amzn1.noarch\n\t// , the epoch value is 20180914-2 . Applies to Linux-based managed nodes only.\n\tEpoch int32\n\n\t// The ID of the patch. Applies to Windows patches only. This ID isn't the same as\n\t// the Microsoft Knowledge Base ID.\n\tId *string\n\n\t// The Microsoft Knowledge Base ID of the patch. Applies to Windows patches only.\n\tKbNumber *string\n\n\t// The language of the patch if it's language-specific.\n\tLanguage *string\n\n\t// The ID of the Microsoft Security Response Center (MSRC) bulletin the patch is\n\t// related to. For example, MS14-045 . Applies to Windows patches only.\n\tMsrcNumber *string\n\n\t// The severity of the patch, such as Critical , Important , or Moderate . Applies\n\t// to Windows patches only.\n\tMsrcSeverity *string\n\n\t// The name of the patch. Applies to Linux-based managed nodes only.\n\tName *string\n\n\t// The specific product the patch is applicable for. For example, WindowsServer2016\n\t// or AmazonLinux2018.03 .\n\tProduct *string\n\n\t// The product family the patch is applicable for. For example, Windows or Amazon\n\t// Linux 2 .\n\tProductFamily *string\n\n\t// The particular release of a patch. For example, in\n\t// pkg-example-EE-20180914-2.2.amzn1.noarch , the release is 2.amaz1 . Applies to\n\t// Linux-based managed nodes only.\n\tRelease *string\n\n\t// The date the patch was released.\n\tReleaseDate *time.Time\n\n\t// The source patch repository for the operating system and version, such as\n\t// trusty-security for Ubuntu Server 14.04 LTE and focal-security for Ubuntu\n\t// Server 20.04 LTE. Applies to Linux-based managed nodes only.\n\tRepository *string\n\n\t// The severity level of the patch. For example, CRITICAL or MODERATE .\n\tSeverity *string\n\n\t// The title of the patch.\n\tTitle *string\n\n\t// The name of the vendor providing the patch.\n\tVendor *string\n\n\t// The version number of the patch. For example, in\n\t// example-pkg-1.710.10-2.7.abcd.x86_64 , the version number is indicated by -1 .\n\t// Applies to Linux-based managed nodes only.\n\tVersion *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines the basic information about a patch baseline.\ntype PatchBaselineIdentity struct {\n\n\t// The description of the patch baseline.\n\tBaselineDescription *string\n\n\t// The ID of the patch baseline.\n\tBaselineId *string\n\n\t// The name of the patch baseline.\n\tBaselineName *string\n\n\t// Whether this is the default baseline. Amazon Web Services Systems Manager\n\t// supports creating multiple default patch baselines. For example, you can create\n\t// a default patch baseline for each operating system.\n\tDefaultBaseline bool\n\n\t// Defines the operating system the patch baseline applies to. The default value\n\t// is WINDOWS .\n\tOperatingSystem OperatingSystem\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the state of a patch on a particular managed node as it\n// relates to the patch baseline used to patch the node.\ntype PatchComplianceData struct {\n\n\t// The classification of the patch, such as SecurityUpdates , Updates , and\n\t// CriticalUpdates .\n\t//\n\t// This member is required.\n\tClassification *string\n\n\t// The date/time the patch was installed on the managed node. Not all operating\n\t// systems provide this level of information.\n\t//\n\t// This member is required.\n\tInstalledTime *time.Time\n\n\t// The operating system-specific ID of the patch.\n\t//\n\t// This member is required.\n\tKBId *string\n\n\t// The severity of the patch such as Critical , Important , and Moderate .\n\t//\n\t// This member is required.\n\tSeverity *string\n\n\t// The state of the patch on the managed node, such as INSTALLED or FAILED. For\n\t// descriptions of each patch state, see About patch compliance (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-compliance-about.html#sysman-compliance-monitor-patch)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\t//\n\t// This member is required.\n\tState PatchComplianceDataState\n\n\t// The title of the patch.\n\t//\n\t// This member is required.\n\tTitle *string\n\n\t// The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that\n\t// are resolved by the patch.\n\tCVEIds *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines which patches should be included in a patch baseline. A patch filter\n// consists of a key and a set of values. The filter key is a patch property. For\n// example, the available filter keys for WINDOWS are PATCH_SET , PRODUCT ,\n// PRODUCT_FAMILY , CLASSIFICATION , and MSRC_SEVERITY . The filter values define a\n// matching criterion for the patch property indicated by the key. For example, if\n// the filter key is PRODUCT and the filter values are [\"Office 2013\", \"Office\n// 2016\"] , then the filter accepts all patches where product name is either\n// \"Office 2013\" or \"Office 2016\". The filter values can be exact values for the\n// patch property given as a key, or a wildcard (*), which matches all values. You\n// can view lists of valid values for the patch properties by running the\n// DescribePatchProperties command. For information about which patch properties\n// can be used with each major operating system, see DescribePatchProperties .\ntype PatchFilter struct {\n\n\t// The key for the filter. Run the DescribePatchProperties command to view lists\n\t// of valid keys for each operating system type.\n\t//\n\t// This member is required.\n\tKey PatchFilterKey\n\n\t// The value for the filter key. Run the DescribePatchProperties command to view\n\t// lists of valid values for each key based on operating system type.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// A set of patch filters, typically used for approval rules.\ntype PatchFilterGroup struct {\n\n\t// The set of patch filters that make up the group.\n\t//\n\t// This member is required.\n\tPatchFilters []PatchFilter\n\n\tnoSmithyDocumentSerde\n}\n\n// The mapping between a patch group and the patch baseline the patch group is\n// registered with.\ntype PatchGroupPatchBaselineMapping struct {\n\n\t// The patch baseline the patch group is registered with.\n\tBaselineIdentity *PatchBaselineIdentity\n\n\t// The name of the patch group registered with the patch baseline.\n\tPatchGroup *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines a filter used in Patch Manager APIs. Supported filter keys depend on\n// the API operation that includes the filter. Patch Manager API operations that\n// use PatchOrchestratorFilter include the following:\n//   - DescribeAvailablePatches\n//   - DescribeInstancePatches\n//   - DescribePatchBaselines\n//   - DescribePatchGroups\ntype PatchOrchestratorFilter struct {\n\n\t// The key for the filter.\n\tKey *string\n\n\t// The value for the filter.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Defines an approval rule for a patch baseline.\ntype PatchRule struct {\n\n\t// The patch filter group that defines the criteria for the rule.\n\t//\n\t// This member is required.\n\tPatchFilterGroup *PatchFilterGroup\n\n\t// The number of days after the release date of each patch matched by the rule\n\t// that the patch is marked as approved in the patch baseline. For example, a value\n\t// of 7 means that patches are approved seven days after they are released. Not\n\t// supported on Debian Server or Ubuntu Server.\n\tApproveAfterDays *int32\n\n\t// The cutoff date for auto approval of released patches. Any patches released on\n\t// or before this date are installed automatically. Not supported on Debian Server\n\t// or Ubuntu Server. Enter dates in the format YYYY-MM-DD . For example, 2021-12-31\n\t// .\n\tApproveUntilDate *string\n\n\t// A compliance severity level for all approved patches in a patch baseline.\n\tComplianceLevel PatchComplianceLevel\n\n\t// For managed nodes identified by the approval rule filters, enables a patch\n\t// baseline to apply non-security updates available in the specified repository.\n\t// The default value is false . Applies to Linux managed nodes only.\n\tEnableNonSecurity *bool\n\n\tnoSmithyDocumentSerde\n}\n\n// A set of rules defining the approval rules for a patch baseline.\ntype PatchRuleGroup struct {\n\n\t// The rules that make up the rule group.\n\t//\n\t// This member is required.\n\tPatchRules []PatchRule\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the patches to use to update the managed nodes, including\n// target operating systems and source repository. Applies to Linux managed nodes\n// only.\ntype PatchSource struct {\n\n\t// The value of the yum repo configuration. For example: [main]\n\t//     name=MyCustomRepository\n\t//\n\t//     baseurl=https://my-custom-repository\n\t// enabled=1 For information about other options available for your yum repository\n\t// configuration, see dnf.conf(5) (https://man7.org/linux/man-pages/man5/dnf.conf.5.html)\n\t// .\n\t//\n\t// This member is required.\n\tConfiguration *string\n\n\t// The name specified to identify the patch source.\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The specific operating system versions a patch repository applies to, such as\n\t// \"Ubuntu16.04\", \"AmazonLinux2016.09\", \"RedhatEnterpriseLinux7.2\" or \"Suse12.7\".\n\t// For lists of supported product values, see PatchFilter .\n\t//\n\t// This member is required.\n\tProducts []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the approval status of a patch.\ntype PatchStatus struct {\n\n\t// The date the patch was approved (or will be approved if the status is\n\t// PENDING_APPROVAL ).\n\tApprovalDate *time.Time\n\n\t// The compliance severity level for a patch.\n\tComplianceLevel PatchComplianceLevel\n\n\t// The approval status of a patch.\n\tDeploymentStatus PatchDeploymentStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// An aggregate of step execution statuses displayed in the Amazon Web Services\n// Systems Manager console for a multi-Region and multi-account Automation\n// execution.\ntype ProgressCounters struct {\n\n\t// The total number of steps that the system cancelled in all specified Amazon Web\n\t// Services Regions and Amazon Web Services accounts for the current Automation\n\t// execution.\n\tCancelledSteps int32\n\n\t// The total number of steps that failed to run in all specified Amazon Web\n\t// Services Regions and Amazon Web Services accounts for the current Automation\n\t// execution.\n\tFailedSteps int32\n\n\t// The total number of steps that successfully completed in all specified Amazon\n\t// Web Services Regions and Amazon Web Services accounts for the current Automation\n\t// execution.\n\tSuccessSteps int32\n\n\t// The total number of steps that timed out in all specified Amazon Web Services\n\t// Regions and Amazon Web Services accounts for the current Automation execution.\n\tTimedOutSteps int32\n\n\t// The total number of steps run in all specified Amazon Web Services Regions and\n\t// Amazon Web Services accounts for the current Automation execution.\n\tTotalSteps int32\n\n\tnoSmithyDocumentSerde\n}\n\n// Reserved for internal use.\ntype RegistrationMetadataItem struct {\n\n\t// Reserved for internal use.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// Reserved for internal use.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An OpsItems that shares something in common with the current OpsItem. For\n// example, related OpsItems can include OpsItems with similar error messages,\n// impacted resources, or statuses for the impacted resource.\ntype RelatedOpsItem struct {\n\n\t// The ID of an OpsItem related to the current OpsItem.\n\t//\n\t// This member is required.\n\tOpsItemId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about targets that resolved during the Automation execution.\ntype ResolvedTargets struct {\n\n\t// A list of parameter values sent to targets that resolved during the Automation\n\t// execution.\n\tParameterValues []string\n\n\t// A boolean value indicating whether the resolved target list is truncated.\n\tTruncated bool\n\n\tnoSmithyDocumentSerde\n}\n\n// Compliance summary information for a specific resource.\ntype ResourceComplianceSummaryItem struct {\n\n\t// The compliance type.\n\tComplianceType *string\n\n\t// A list of items that are compliant for the resource.\n\tCompliantSummary *CompliantSummary\n\n\t// Information about the execution.\n\tExecutionSummary *ComplianceExecutionSummary\n\n\t// A list of items that aren't compliant for the resource.\n\tNonCompliantSummary *NonCompliantSummary\n\n\t// The highest severity item found for the resource. The resource is compliant for\n\t// this item.\n\tOverallSeverity ComplianceSeverity\n\n\t// The resource ID.\n\tResourceId *string\n\n\t// The resource type.\n\tResourceType *string\n\n\t// The compliance status for the resource.\n\tStatus ComplianceStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the AwsOrganizationsSource resource data sync source. A sync\n// source of this type can synchronize data from Organizations or, if an Amazon Web\n// Services organization isn't present, from multiple Amazon Web Services Regions.\ntype ResourceDataSyncAwsOrganizationsSource struct {\n\n\t// If an Amazon Web Services organization is present, this is either\n\t// OrganizationalUnits or EntireOrganization . For OrganizationalUnits , the data\n\t// is aggregated from a set of organization units. For EntireOrganization , the\n\t// data is aggregated from the entire Amazon Web Services organization.\n\t//\n\t// This member is required.\n\tOrganizationSourceType *string\n\n\t// The Organizations organization units included in the sync.\n\tOrganizationalUnits []ResourceDataSyncOrganizationalUnit\n\n\tnoSmithyDocumentSerde\n}\n\n// Synchronize Amazon Web Services Systems Manager Inventory data from multiple\n// Amazon Web Services accounts defined in Organizations to a centralized Amazon S3\n// bucket. Data is synchronized to individual key prefixes in the central bucket.\n// Each key prefix represents a different Amazon Web Services account ID.\ntype ResourceDataSyncDestinationDataSharing struct {\n\n\t// The sharing data type. Only Organization is supported.\n\tDestinationDataSharingType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a resource data sync configuration, including its current\n// status and last successful sync.\ntype ResourceDataSyncItem struct {\n\n\t// The status reported by the last sync.\n\tLastStatus LastResourceDataSyncStatus\n\n\t// The last time the sync operations returned a status of SUCCESSFUL (UTC).\n\tLastSuccessfulSyncTime *time.Time\n\n\t// The status message details reported by the last sync.\n\tLastSyncStatusMessage *string\n\n\t// The last time the configuration attempted to sync (UTC).\n\tLastSyncTime *time.Time\n\n\t// Configuration information for the target S3 bucket.\n\tS3Destination *ResourceDataSyncS3Destination\n\n\t// The date and time the configuration was created (UTC).\n\tSyncCreatedTime *time.Time\n\n\t// The date and time the resource data sync was changed.\n\tSyncLastModifiedTime *time.Time\n\n\t// The name of the resource data sync.\n\tSyncName *string\n\n\t// Information about the source where the data was synchronized.\n\tSyncSource *ResourceDataSyncSourceWithState\n\n\t// The type of resource data sync. If SyncType is SyncToDestination , then the\n\t// resource data sync synchronizes data to an S3 bucket. If the SyncType is\n\t// SyncFromSource then the resource data sync synchronizes data from Organizations\n\t// or from multiple Amazon Web Services Regions.\n\tSyncType *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The Organizations organizational unit data source for the sync.\ntype ResourceDataSyncOrganizationalUnit struct {\n\n\t// The Organizations unit ID data source for the sync.\n\tOrganizationalUnitId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the target S3 bucket for the resource data sync.\ntype ResourceDataSyncS3Destination struct {\n\n\t// The name of the S3 bucket where the aggregated data is stored.\n\t//\n\t// This member is required.\n\tBucketName *string\n\n\t// The Amazon Web Services Region with the S3 bucket targeted by the resource data\n\t// sync.\n\t//\n\t// This member is required.\n\tRegion *string\n\n\t// A supported sync format. The following format is currently supported: JsonSerDe\n\t//\n\t// This member is required.\n\tSyncFormat ResourceDataSyncS3Format\n\n\t// The ARN of an encryption key for a destination in Amazon S3. Must belong to the\n\t// same Region as the destination S3 bucket.\n\tAWSKMSKeyARN *string\n\n\t// Enables destination data sharing. By default, this field is null .\n\tDestinationDataSharing *ResourceDataSyncDestinationDataSharing\n\n\t// An Amazon S3 prefix for the bucket.\n\tPrefix *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the source of the data included in the resource data sync.\ntype ResourceDataSyncSource struct {\n\n\t// The SyncSource Amazon Web Services Regions included in the resource data sync.\n\t//\n\t// This member is required.\n\tSourceRegions []string\n\n\t// The type of data source for the resource data sync. SourceType is either\n\t// AwsOrganizations (if an organization is present in Organizations) or\n\t// SingleAccountMultiRegions .\n\t//\n\t// This member is required.\n\tSourceType *string\n\n\t// Information about the AwsOrganizationsSource resource data sync source. A sync\n\t// source of this type can synchronize data from Organizations.\n\tAwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource\n\n\t// When you create a resource data sync, if you choose one of the Organizations\n\t// options, then Systems Manager automatically enables all OpsData sources in the\n\t// selected Amazon Web Services Regions for all Amazon Web Services accounts in\n\t// your organization (or in the selected organization units). For more information,\n\t// see About multiple account and Region resource data syncs (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tEnableAllOpsDataSources bool\n\n\t// Whether to automatically synchronize and aggregate data from new Amazon Web\n\t// Services Regions when those Regions come online.\n\tIncludeFutureRegions bool\n\n\tnoSmithyDocumentSerde\n}\n\n// The data type name for including resource data sync state. There are four sync\n// states: OrganizationNotExists (Your organization doesn't exist) NoPermissions\n// (The system can't locate the service-linked role. This role is automatically\n// created when a user creates a resource data sync in Amazon Web Services Systems\n// Manager Explorer.) InvalidOrganizationalUnit (You specified or selected an\n// invalid unit in the resource data sync configuration.) TrustedAccessDisabled\n// (You disabled Systems Manager access in the organization in Organizations.)\ntype ResourceDataSyncSourceWithState struct {\n\n\t// The field name in SyncSource for the ResourceDataSyncAwsOrganizationsSource\n\t// type.\n\tAwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource\n\n\t// When you create a resource data sync, if you choose one of the Organizations\n\t// options, then Systems Manager automatically enables all OpsData sources in the\n\t// selected Amazon Web Services Regions for all Amazon Web Services accounts in\n\t// your organization (or in the selected organization units). For more information,\n\t// see About multiple account and Region resource data syncs (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html)\n\t// in the Amazon Web Services Systems Manager User Guide.\n\tEnableAllOpsDataSources bool\n\n\t// Whether to automatically synchronize and aggregate data from new Amazon Web\n\t// Services Regions when those Regions come online.\n\tIncludeFutureRegions bool\n\n\t// The SyncSource Amazon Web Services Regions included in the resource data sync.\n\tSourceRegions []string\n\n\t// The type of data source for the resource data sync. SourceType is either\n\t// AwsOrganizations (if an organization is present in Organizations) or\n\t// singleAccountMultiRegions .\n\tSourceType *string\n\n\t// The data type name for including resource data sync state. There are four sync\n\t// states: OrganizationNotExists : Your organization doesn't exist. NoPermissions :\n\t// The system can't locate the service-linked role. This role is automatically\n\t// created when a user creates a resource data sync in Explorer.\n\t// InvalidOrganizationalUnit : You specified or selected an invalid unit in the\n\t// resource data sync configuration. TrustedAccessDisabled : You disabled Systems\n\t// Manager access in the organization in Organizations.\n\tState *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The inventory item result attribute.\ntype ResultAttribute struct {\n\n\t// Name of the inventory item type. Valid value: AWS:InstanceInformation . Default\n\t// Value: AWS:InstanceInformation .\n\t//\n\t// This member is required.\n\tTypeName *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about the result of a document review request.\ntype ReviewInformation struct {\n\n\t// The time that the reviewer took action on the document review request.\n\tReviewedTime *time.Time\n\n\t// The reviewer assigned to take action on the document review request.\n\tReviewer *string\n\n\t// The current status of the document review request.\n\tStatus ReviewStatus\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about an Automation runbook used in a runbook workflow in Change\n// Manager. The Automation runbooks specified for the runbook workflow can't run\n// until all required approvals for the change request have been received.\ntype Runbook struct {\n\n\t// The name of the Automation runbook used in a runbook workflow.\n\t//\n\t// This member is required.\n\tDocumentName *string\n\n\t// The version of the Automation runbook used in a runbook workflow.\n\tDocumentVersion *string\n\n\t// The MaxConcurrency value specified by the user when the operation started,\n\t// indicating the maximum number of resources that the runbook operation can run on\n\t// at the same time.\n\tMaxConcurrency *string\n\n\t// The MaxErrors value specified by the user when the execution started,\n\t// indicating the maximum number of errors that can occur during the operation\n\t// before the updates are stopped or rolled back.\n\tMaxErrors *string\n\n\t// The key-value map of execution parameters, which were supplied when calling\n\t// StartChangeRequestExecution .\n\tParameters map[string][]string\n\n\t// Information about the Amazon Web Services Regions and Amazon Web Services\n\t// accounts targeted by the current Runbook operation.\n\tTargetLocations []TargetLocation\n\n\t// A key-value mapping of runbook parameters to target resources. Both Targets and\n\t// TargetMaps can't be specified together.\n\tTargetMaps []map[string][]string\n\n\t// The name of the parameter used as the target resource for the rate-controlled\n\t// runbook workflow. Required if you specify Targets .\n\tTargetParameterName *string\n\n\t// A key-value mapping to target resources that the runbook operation performs\n\t// tasks on. Required if you specify TargetParameterName .\n\tTargets []Target\n\n\tnoSmithyDocumentSerde\n}\n\n// An S3 bucket where you want to store the results of this request.\ntype S3OutputLocation struct {\n\n\t// The name of the S3 bucket.\n\tOutputS3BucketName *string\n\n\t// The S3 bucket subfolder.\n\tOutputS3KeyPrefix *string\n\n\t// The Amazon Web Services Region of the S3 bucket.\n\tOutputS3Region *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A URL for the Amazon Web Services Systems Manager (Systems Manager) bucket\n// where you want to store the results of this request.\ntype S3OutputUrl struct {\n\n\t// A URL for an S3 bucket where you want to store the results of this request.\n\tOutputUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a scheduled execution for a maintenance window.\ntype ScheduledWindowExecution struct {\n\n\t// The time, in ISO-8601 Extended format, that the maintenance window is scheduled\n\t// to be run.\n\tExecutionTime *string\n\n\t// The name of the maintenance window to be run.\n\tName *string\n\n\t// The ID of the maintenance window to be run.\n\tWindowId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The service setting data structure. ServiceSetting is an account-level setting\n// for an Amazon Web Services service. This setting defines how a user interacts\n// with or uses a service or a feature of a service. For example, if an Amazon Web\n// Services service charges money to the account based on feature or service usage,\n// then the Amazon Web Services service team might create a default setting of\n// \"false\". This means the user can't use this feature unless they change the\n// setting to \"true\" and intentionally opt in for a paid feature. Services map a\n// SettingId object to a setting value. Amazon Web Services services teams define\n// the default value for a SettingId . You can't create a new SettingId , but you\n// can overwrite the default value if you have the ssm:UpdateServiceSetting\n// permission for the setting. Use the UpdateServiceSetting API operation to\n// change the default setting. Or, use the ResetServiceSetting to change the value\n// back to the original value defined by the Amazon Web Services service team.\ntype ServiceSetting struct {\n\n\t// The ARN of the service setting.\n\tARN *string\n\n\t// The last time the service setting was modified.\n\tLastModifiedDate *time.Time\n\n\t// The ARN of the last modified user. This field is populated only if the setting\n\t// value was overwritten.\n\tLastModifiedUser *string\n\n\t// The ID of the service setting.\n\tSettingId *string\n\n\t// The value of the service setting.\n\tSettingValue *string\n\n\t// The status of the service setting. The value can be Default, Customized or\n\t// PendingUpdate.\n\t//   - Default: The current setting uses a default value provisioned by the Amazon\n\t//   Web Services service team.\n\t//   - Customized: The current setting use a custom value specified by the\n\t//   customer.\n\t//   - PendingUpdate: The current setting uses a default or custom value, but a\n\t//   setting change request is pending approval.\n\tStatus *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Information about a Session Manager connection to a managed node.\ntype Session struct {\n\n\t// Reserved for future use.\n\tDetails *string\n\n\t// The name of the Session Manager SSM document used to define the parameters and\n\t// plugin settings for the session. For example, SSM-SessionManagerRunShell .\n\tDocumentName *string\n\n\t// The date and time, in ISO-8601 Extended format, when the session was terminated.\n\tEndDate *time.Time\n\n\t// The maximum duration of a session before it terminates.\n\tMaxSessionDuration *string\n\n\t// Reserved for future use.\n\tOutputUrl *SessionManagerOutputUrl\n\n\t// The ID of the Amazon Web Services user that started the session.\n\tOwner *string\n\n\t// The reason for connecting to the instance.\n\tReason *string\n\n\t// The ID of the session.\n\tSessionId *string\n\n\t// The date and time, in ISO-8601 Extended format, when the session began.\n\tStartDate *time.Time\n\n\t// The status of the session. For example, \"Connected\" or \"Terminated\".\n\tStatus SessionStatus\n\n\t// The managed node that the Session Manager session connected to.\n\tTarget *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Describes a filter for Session Manager information.\ntype SessionFilter struct {\n\n\t// The name of the filter.\n\t//\n\t// This member is required.\n\tKey SessionFilterKey\n\n\t// The filter value. Valid values for each filter key are as follows:\n\t//   - InvokedAfter: Specify a timestamp to limit your results. For example,\n\t//   specify 2018-08-29T00:00:00Z to see sessions that started August 29, 2018, and\n\t//   later.\n\t//   - InvokedBefore: Specify a timestamp to limit your results. For example,\n\t//   specify 2018-08-29T00:00:00Z to see sessions that started before August 29,\n\t//   2018.\n\t//   - Target: Specify a managed node to which session connections have been made.\n\t//   - Owner: Specify an Amazon Web Services user to see a list of sessions\n\t//   started by that user.\n\t//   - Status: Specify a valid session status to see a list of all sessions with\n\t//   that status. Status values you can specify include:\n\t//   - Connected\n\t//   - Connecting\n\t//   - Disconnected\n\t//   - Terminated\n\t//   - Terminating\n\t//   - Failed\n\t//   - SessionId: Specify a session ID to return details about the session.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Reserved for future use.\ntype SessionManagerOutputUrl struct {\n\n\t// Reserved for future use.\n\tCloudWatchOutputUrl *string\n\n\t// Reserved for future use.\n\tS3OutputUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\n// The number of managed nodes found for each patch severity level defined in the\n// request filter.\ntype SeveritySummary struct {\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// Critical . Critical severity is determined by the organization that published\n\t// the compliance items.\n\tCriticalCount int32\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// high. High severity is determined by the organization that published the\n\t// compliance items.\n\tHighCount int32\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// informational. Informational severity is determined by the organization that\n\t// published the compliance items.\n\tInformationalCount int32\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// low. Low severity is determined by the organization that published the\n\t// compliance items.\n\tLowCount int32\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// medium. Medium severity is determined by the organization that published the\n\t// compliance items.\n\tMediumCount int32\n\n\t// The total number of resources or compliance items that have a severity level of\n\t// unspecified. Unspecified severity is determined by the organization that\n\t// published the compliance items.\n\tUnspecifiedCount int32\n\n\tnoSmithyDocumentSerde\n}\n\n// Detailed information about an the execution state of an Automation step.\ntype StepExecution struct {\n\n\t// The action this step performs. The action determines the behavior of the step.\n\tAction *string\n\n\t// If a step has finished execution, this contains the time the execution ended.\n\t// If the step hasn't yet concluded, this field isn't populated.\n\tExecutionEndTime *time.Time\n\n\t// If a step has begun execution, this contains the time the step started. If the\n\t// step is in Pending status, this field isn't populated.\n\tExecutionStartTime *time.Time\n\n\t// Information about the Automation failure.\n\tFailureDetails *FailureDetails\n\n\t// If a step failed, this message explains why the execution failed.\n\tFailureMessage *string\n\n\t// Fully-resolved values passed into the step before execution.\n\tInputs map[string]string\n\n\t// The flag which can be used to help decide whether the failure of current step\n\t// leads to the Automation failure.\n\tIsCritical *bool\n\n\t// The flag which can be used to end automation no matter whether the step\n\t// succeeds or fails.\n\tIsEnd *bool\n\n\t// The maximum number of tries to run the action of the step. The default value is\n\t// 1 .\n\tMaxAttempts *int32\n\n\t// The next step after the step succeeds.\n\tNextStep *string\n\n\t// The action to take if the step fails. The default value is Abort .\n\tOnFailure *string\n\n\t// Returned values from the execution of the step.\n\tOutputs map[string][]string\n\n\t// A user-specified list of parameters to override when running a step.\n\tOverriddenParameters map[string][]string\n\n\t// Information about the parent step.\n\tParentStepDetails *ParentStepDetails\n\n\t// A message associated with the response code for an execution.\n\tResponse *string\n\n\t// The response code returned by the execution of the step.\n\tResponseCode *string\n\n\t// The unique ID of a step execution.\n\tStepExecutionId *string\n\n\t// The name of this execution step.\n\tStepName *string\n\n\t// The execution status for this step.\n\tStepStatus AutomationExecutionStatus\n\n\t// The combination of Amazon Web Services Regions and Amazon Web Services accounts\n\t// targeted by the current Automation execution.\n\tTargetLocation *TargetLocation\n\n\t// The targets for the step execution.\n\tTargets []Target\n\n\t// The timeout seconds of the step.\n\tTimeoutSeconds *int64\n\n\t// The CloudWatch alarms that were invoked by the automation.\n\tTriggeredAlarms []AlarmStateInformation\n\n\t// Strategies used when step fails, we support Continue and Abort. Abort will fail\n\t// the automation when the step fails. Continue will ignore the failure of current\n\t// step and allow automation to run the next step. With conditional branching, we\n\t// add step:stepName to support the automation to go to another specific step.\n\tValidNextSteps []string\n\n\tnoSmithyDocumentSerde\n}\n\n// A filter to limit the amount of step execution information returned by the call.\ntype StepExecutionFilter struct {\n\n\t// One or more keys to limit the results.\n\t//\n\t// This member is required.\n\tKey StepExecutionFilterKey\n\n\t// The values of the filter key.\n\t//\n\t// This member is required.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Metadata that you assign to your Amazon Web Services resources. Tags enable you\n// to categorize your resources in different ways, for example, by purpose, owner,\n// or environment. In Amazon Web Services Systems Manager, you can apply tags to\n// Systems Manager documents (SSM documents), managed nodes, maintenance windows,\n// parameters, patch baselines, OpsItems, and OpsMetadata.\ntype Tag struct {\n\n\t// The name of the tag.\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The value of the tag.\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\n// An array of search criteria that targets managed nodes using a key-value pair\n// that you specify. One or more targets must be specified for maintenance window\n// Run Command-type tasks. Depending on the task, targets are optional for other\n// maintenance window task types (Automation, Lambda, and Step Functions). For more\n// information about running tasks that don't specify targets, see Registering\n// maintenance window tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html)\n// in the Amazon Web Services Systems Manager User Guide. Supported formats include\n// the following.\n//   - Key=InstanceIds,Values=,,\n//   - Key=tag:,Values=,\n//   - Key=tag-key,Values=,\n//   - Run Command and Maintenance window targets only:\n//     Key=resource-groups:Name,Values=\n//   - Maintenance window targets only:\n//     Key=resource-groups:ResourceTypeFilters,Values=,\n//   - Automation targets only: Key=ResourceGroup;Values=\n//\n// For example:\n//\n//\t-\n//\tKey=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE\n//\t- Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3\n//\t- Key=tag-key,Values=Name,Instance-Type,CostCenter\n//\t- Run Command and Maintenance window targets only:\n//\tKey=resource-groups:Name,Values=ProductionResourceGroup This example\n//\tdemonstrates how to target all resources in the resource group\n//\tProductionResourceGroup in your maintenance window.\n//\t- Maintenance window targets only:\n//\tKey=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC\n//\tThis example demonstrates how to target only Amazon Elastic Compute Cloud\n//\t(Amazon EC2) instances and VPCs in your maintenance window.\n//\t- Automation targets only: Key=ResourceGroup,Values=MyResourceGroup\n//\t- State Manager association targets only: Key=InstanceIds,Values=* This\n//\texample demonstrates how to target all managed instances in the Amazon Web\n//\tServices Region where the association was created.\n//\n// For more information about how to send commands that target managed nodes using\n// Key,Value parameters, see Targeting multiple instances (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-targeting)\n// in the Amazon Web Services Systems Manager User Guide.\ntype Target struct {\n\n\t// User-defined criteria for sending commands that target managed nodes that meet\n\t// the criteria.\n\tKey *string\n\n\t// User-defined criteria that maps to Key . For example, if you specified\n\t// tag:ServerRole , you could specify value:WebServer to run a command on\n\t// instances that include EC2 tags of ServerRole,WebServer . Depending on the type\n\t// of target, the maximum number of values for a key might be lower than the global\n\t// maximum of 50.\n\tValues []string\n\n\tnoSmithyDocumentSerde\n}\n\n// The combination of Amazon Web Services Regions and Amazon Web Services accounts\n// targeted by the current Automation execution.\ntype TargetLocation struct {\n\n\t// The Amazon Web Services accounts targeted by the current Automation execution.\n\tAccounts []string\n\n\t// The Automation execution role used by the currently running Automation. If not\n\t// specified, the default value is AWS-SystemsManager-AutomationExecutionRole .\n\tExecutionRoleName *string\n\n\t// The Amazon Web Services Regions targeted by the current Automation execution.\n\tRegions []string\n\n\t// The details for the CloudWatch alarm you want to apply to an automation or\n\t// command.\n\tTargetLocationAlarmConfiguration *AlarmConfiguration\n\n\t// The maximum number of Amazon Web Services Regions and Amazon Web Services\n\t// accounts allowed to run the Automation concurrently.\n\tTargetLocationMaxConcurrency *string\n\n\t// The maximum number of errors allowed before the system stops queueing\n\t// additional Automation executions for the currently running Automation.\n\tTargetLocationMaxErrors *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssm/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssm/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpAddTagsToResource struct {\n}\n\nfunc (*validateOpAddTagsToResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpAddTagsToResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*AddTagsToResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpAddTagsToResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpAssociateOpsItemRelatedItem struct {\n}\n\nfunc (*validateOpAssociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpAssociateOpsItemRelatedItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*AssociateOpsItemRelatedItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpAssociateOpsItemRelatedItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCancelCommand struct {\n}\n\nfunc (*validateOpCancelCommand) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCancelCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CancelCommandInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCancelCommandInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCancelMaintenanceWindowExecution struct {\n}\n\nfunc (*validateOpCancelMaintenanceWindowExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCancelMaintenanceWindowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CancelMaintenanceWindowExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCancelMaintenanceWindowExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateActivation struct {\n}\n\nfunc (*validateOpCreateActivation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateActivation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateActivationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateActivationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateAssociationBatch struct {\n}\n\nfunc (*validateOpCreateAssociationBatch) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateAssociationBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateAssociationBatchInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateAssociationBatchInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateAssociation struct {\n}\n\nfunc (*validateOpCreateAssociation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateAssociationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateAssociationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateDocument struct {\n}\n\nfunc (*validateOpCreateDocument) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateDocumentInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateDocumentInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateMaintenanceWindow struct {\n}\n\nfunc (*validateOpCreateMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateOpsItem struct {\n}\n\nfunc (*validateOpCreateOpsItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateOpsItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateOpsItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateOpsMetadata struct {\n}\n\nfunc (*validateOpCreateOpsMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateOpsMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateOpsMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateOpsMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreatePatchBaseline struct {\n}\n\nfunc (*validateOpCreatePatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreatePatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreatePatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreatePatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateResourceDataSync struct {\n}\n\nfunc (*validateOpCreateResourceDataSync) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateResourceDataSync) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateResourceDataSyncInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateResourceDataSyncInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteActivation struct {\n}\n\nfunc (*validateOpDeleteActivation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteActivation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteActivationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteActivationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteDocument struct {\n}\n\nfunc (*validateOpDeleteDocument) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteDocumentInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteDocumentInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteInventory struct {\n}\n\nfunc (*validateOpDeleteInventory) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteInventory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteInventoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteInventoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteMaintenanceWindow struct {\n}\n\nfunc (*validateOpDeleteMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteOpsItem struct {\n}\n\nfunc (*validateOpDeleteOpsItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteOpsItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteOpsItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteOpsMetadata struct {\n}\n\nfunc (*validateOpDeleteOpsMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteOpsMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteOpsMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteOpsMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteParameter struct {\n}\n\nfunc (*validateOpDeleteParameter) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteParameter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteParameterInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteParameterInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteParameters struct {\n}\n\nfunc (*validateOpDeleteParameters) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteParametersInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteParametersInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeletePatchBaseline struct {\n}\n\nfunc (*validateOpDeletePatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeletePatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeletePatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeletePatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteResourceDataSync struct {\n}\n\nfunc (*validateOpDeleteResourceDataSync) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteResourceDataSync) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteResourceDataSyncInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteResourceDataSyncInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeleteResourcePolicy struct {\n}\n\nfunc (*validateOpDeleteResourcePolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeleteResourcePolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeleteResourcePolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeregisterManagedInstance struct {\n}\n\nfunc (*validateOpDeregisterManagedInstance) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeregisterManagedInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeregisterManagedInstanceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeregisterManagedInstanceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeregisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*validateOpDeregisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeregisterPatchBaselineForPatchGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeregisterPatchBaselineForPatchGroupInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeregisterPatchBaselineForPatchGroupInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeregisterTargetFromMaintenanceWindow struct {\n}\n\nfunc (*validateOpDeregisterTargetFromMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeregisterTargetFromMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeregisterTargetFromMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeregisterTargetFromMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDeregisterTaskFromMaintenanceWindow struct {\n}\n\nfunc (*validateOpDeregisterTaskFromMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDeregisterTaskFromMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DeregisterTaskFromMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDeregisterTaskFromMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeAssociationExecutions struct {\n}\n\nfunc (*validateOpDescribeAssociationExecutions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeAssociationExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeAssociationExecutionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeAssociationExecutionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeAssociationExecutionTargets struct {\n}\n\nfunc (*validateOpDescribeAssociationExecutionTargets) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeAssociationExecutionTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeAssociationExecutionTargetsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeAssociationExecutionTargetsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeAutomationExecutions struct {\n}\n\nfunc (*validateOpDescribeAutomationExecutions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeAutomationExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeAutomationExecutionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeAutomationExecutionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeAutomationStepExecutions struct {\n}\n\nfunc (*validateOpDescribeAutomationStepExecutions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeAutomationStepExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeAutomationStepExecutionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeAutomationStepExecutionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeDocument struct {\n}\n\nfunc (*validateOpDescribeDocument) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeDocumentInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeDocumentInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeDocumentPermission struct {\n}\n\nfunc (*validateOpDescribeDocumentPermission) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeDocumentPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeDocumentPermissionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeDocumentPermissionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeEffectiveInstanceAssociations struct {\n}\n\nfunc (*validateOpDescribeEffectiveInstanceAssociations) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeEffectiveInstanceAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeEffectiveInstanceAssociationsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeEffectiveInstanceAssociationsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeEffectivePatchesForPatchBaseline struct {\n}\n\nfunc (*validateOpDescribeEffectivePatchesForPatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeEffectivePatchesForPatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeEffectivePatchesForPatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeEffectivePatchesForPatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeInstanceAssociationsStatus struct {\n}\n\nfunc (*validateOpDescribeInstanceAssociationsStatus) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeInstanceAssociationsStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeInstanceAssociationsStatusInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeInstanceAssociationsStatusInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeInstanceInformation struct {\n}\n\nfunc (*validateOpDescribeInstanceInformation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeInstanceInformation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeInstanceInformationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeInstanceInformationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeInstancePatches struct {\n}\n\nfunc (*validateOpDescribeInstancePatches) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeInstancePatches) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeInstancePatchesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeInstancePatchesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeInstancePatchStatesForPatchGroup struct {\n}\n\nfunc (*validateOpDescribeInstancePatchStatesForPatchGroup) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeInstancePatchStatesForPatchGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeInstancePatchStatesForPatchGroupInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeInstancePatchStatesForPatchGroupInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeInstancePatchStates struct {\n}\n\nfunc (*validateOpDescribeInstancePatchStates) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeInstancePatchStates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeInstancePatchStatesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeInstancePatchStatesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowExecutions struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowExecutions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowExecutionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowExecutionTaskInvocations struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowExecutionTaskInvocations) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowExecutionTaskInvocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionTaskInvocationsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowExecutionTaskInvocationsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowExecutionTasks struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowExecutionTasks) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowExecutionTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowExecutionTasksInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowExecutionTasksInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowsForTarget struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowsForTarget) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowsForTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowsForTargetInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowsForTargetInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowTargets struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowTargets) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowTargetsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowTargetsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeMaintenanceWindowTasks struct {\n}\n\nfunc (*validateOpDescribeMaintenanceWindowTasks) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeMaintenanceWindowTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeMaintenanceWindowTasksInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeMaintenanceWindowTasksInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeOpsItems struct {\n}\n\nfunc (*validateOpDescribeOpsItems) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeOpsItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeOpsItemsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeOpsItemsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeParameters struct {\n}\n\nfunc (*validateOpDescribeParameters) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeParametersInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeParametersInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribePatchGroupState struct {\n}\n\nfunc (*validateOpDescribePatchGroupState) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribePatchGroupState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribePatchGroupStateInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribePatchGroupStateInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribePatchProperties struct {\n}\n\nfunc (*validateOpDescribePatchProperties) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribePatchProperties) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribePatchPropertiesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribePatchPropertiesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDescribeSessions struct {\n}\n\nfunc (*validateOpDescribeSessions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDescribeSessions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DescribeSessionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDescribeSessionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDisassociateOpsItemRelatedItem struct {\n}\n\nfunc (*validateOpDisassociateOpsItemRelatedItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDisassociateOpsItemRelatedItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DisassociateOpsItemRelatedItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDisassociateOpsItemRelatedItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetAutomationExecution struct {\n}\n\nfunc (*validateOpGetAutomationExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetAutomationExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetAutomationExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetAutomationExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetCalendarState struct {\n}\n\nfunc (*validateOpGetCalendarState) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetCalendarState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetCalendarStateInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetCalendarStateInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetCommandInvocation struct {\n}\n\nfunc (*validateOpGetCommandInvocation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetCommandInvocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetCommandInvocationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetCommandInvocationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetConnectionStatus struct {\n}\n\nfunc (*validateOpGetConnectionStatus) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetConnectionStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetConnectionStatusInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetConnectionStatusInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetDeployablePatchSnapshotForInstance struct {\n}\n\nfunc (*validateOpGetDeployablePatchSnapshotForInstance) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetDeployablePatchSnapshotForInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetDeployablePatchSnapshotForInstanceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetDeployablePatchSnapshotForInstanceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetDocument struct {\n}\n\nfunc (*validateOpGetDocument) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetDocumentInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetDocumentInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetInventory struct {\n}\n\nfunc (*validateOpGetInventory) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetInventory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetInventoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetInventoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetMaintenanceWindowExecution struct {\n}\n\nfunc (*validateOpGetMaintenanceWindowExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetMaintenanceWindowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetMaintenanceWindowExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetMaintenanceWindowExecutionTask struct {\n}\n\nfunc (*validateOpGetMaintenanceWindowExecutionTask) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetMaintenanceWindowExecutionTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionTaskInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetMaintenanceWindowExecutionTaskInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetMaintenanceWindowExecutionTaskInvocation struct {\n}\n\nfunc (*validateOpGetMaintenanceWindowExecutionTaskInvocation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetMaintenanceWindowExecutionTaskInvocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowExecutionTaskInvocationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetMaintenanceWindowExecutionTaskInvocationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetMaintenanceWindow struct {\n}\n\nfunc (*validateOpGetMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetMaintenanceWindowTask struct {\n}\n\nfunc (*validateOpGetMaintenanceWindowTask) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetMaintenanceWindowTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetMaintenanceWindowTaskInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetMaintenanceWindowTaskInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetOpsItem struct {\n}\n\nfunc (*validateOpGetOpsItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetOpsItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetOpsItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetOpsMetadata struct {\n}\n\nfunc (*validateOpGetOpsMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetOpsMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetOpsMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetOpsMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetOpsSummary struct {\n}\n\nfunc (*validateOpGetOpsSummary) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetOpsSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetOpsSummaryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetOpsSummaryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetParameterHistory struct {\n}\n\nfunc (*validateOpGetParameterHistory) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetParameterHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetParameterHistoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetParameterHistoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetParameter struct {\n}\n\nfunc (*validateOpGetParameter) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetParameter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetParameterInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetParameterInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetParametersByPath struct {\n}\n\nfunc (*validateOpGetParametersByPath) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetParametersByPath) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetParametersByPathInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetParametersByPathInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetParameters struct {\n}\n\nfunc (*validateOpGetParameters) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetParametersInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetParametersInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetPatchBaselineForPatchGroup struct {\n}\n\nfunc (*validateOpGetPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetPatchBaselineForPatchGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetPatchBaselineForPatchGroupInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetPatchBaselineForPatchGroupInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetPatchBaseline struct {\n}\n\nfunc (*validateOpGetPatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetPatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetPatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetPatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetResourcePolicies struct {\n}\n\nfunc (*validateOpGetResourcePolicies) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetResourcePolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetResourcePoliciesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetResourcePoliciesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetServiceSetting struct {\n}\n\nfunc (*validateOpGetServiceSetting) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetServiceSetting) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetServiceSettingInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetServiceSettingInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpLabelParameterVersion struct {\n}\n\nfunc (*validateOpLabelParameterVersion) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpLabelParameterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*LabelParameterVersionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpLabelParameterVersionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListAssociations struct {\n}\n\nfunc (*validateOpListAssociations) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListAssociationsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListAssociationsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListAssociationVersions struct {\n}\n\nfunc (*validateOpListAssociationVersions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListAssociationVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListAssociationVersionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListAssociationVersionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListCommandInvocations struct {\n}\n\nfunc (*validateOpListCommandInvocations) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListCommandInvocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListCommandInvocationsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListCommandInvocationsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListCommands struct {\n}\n\nfunc (*validateOpListCommands) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListCommands) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListCommandsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListCommandsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListDocumentMetadataHistory struct {\n}\n\nfunc (*validateOpListDocumentMetadataHistory) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListDocumentMetadataHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListDocumentMetadataHistoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListDocumentMetadataHistoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListDocuments struct {\n}\n\nfunc (*validateOpListDocuments) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListDocuments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListDocumentsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListDocumentsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListDocumentVersions struct {\n}\n\nfunc (*validateOpListDocumentVersions) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListDocumentVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListDocumentVersionsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListDocumentVersionsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListInventoryEntries struct {\n}\n\nfunc (*validateOpListInventoryEntries) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListInventoryEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListInventoryEntriesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListInventoryEntriesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListOpsItemEvents struct {\n}\n\nfunc (*validateOpListOpsItemEvents) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListOpsItemEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListOpsItemEventsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListOpsItemEventsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListOpsItemRelatedItems struct {\n}\n\nfunc (*validateOpListOpsItemRelatedItems) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListOpsItemRelatedItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListOpsItemRelatedItemsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListOpsItemRelatedItemsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListOpsMetadata struct {\n}\n\nfunc (*validateOpListOpsMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListOpsMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListOpsMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListOpsMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListTagsForResource struct {\n}\n\nfunc (*validateOpListTagsForResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListTagsForResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListTagsForResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpModifyDocumentPermission struct {\n}\n\nfunc (*validateOpModifyDocumentPermission) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpModifyDocumentPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ModifyDocumentPermissionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpModifyDocumentPermissionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutComplianceItems struct {\n}\n\nfunc (*validateOpPutComplianceItems) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutComplianceItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutComplianceItemsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutComplianceItemsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutInventory struct {\n}\n\nfunc (*validateOpPutInventory) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutInventory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutInventoryInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutInventoryInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutParameter struct {\n}\n\nfunc (*validateOpPutParameter) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutParameter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutParameterInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutParameterInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpPutResourcePolicy struct {\n}\n\nfunc (*validateOpPutResourcePolicy) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*PutResourcePolicyInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpPutResourcePolicyInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRegisterDefaultPatchBaseline struct {\n}\n\nfunc (*validateOpRegisterDefaultPatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRegisterDefaultPatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RegisterDefaultPatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRegisterDefaultPatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRegisterPatchBaselineForPatchGroup struct {\n}\n\nfunc (*validateOpRegisterPatchBaselineForPatchGroup) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRegisterPatchBaselineForPatchGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RegisterPatchBaselineForPatchGroupInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRegisterPatchBaselineForPatchGroupInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRegisterTargetWithMaintenanceWindow struct {\n}\n\nfunc (*validateOpRegisterTargetWithMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRegisterTargetWithMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RegisterTargetWithMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRegisterTargetWithMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRegisterTaskWithMaintenanceWindow struct {\n}\n\nfunc (*validateOpRegisterTaskWithMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRegisterTaskWithMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RegisterTaskWithMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRegisterTaskWithMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRemoveTagsFromResource struct {\n}\n\nfunc (*validateOpRemoveTagsFromResource) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRemoveTagsFromResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RemoveTagsFromResourceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRemoveTagsFromResourceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpResetServiceSetting struct {\n}\n\nfunc (*validateOpResetServiceSetting) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpResetServiceSetting) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ResetServiceSettingInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpResetServiceSettingInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpResumeSession struct {\n}\n\nfunc (*validateOpResumeSession) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpResumeSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ResumeSessionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpResumeSessionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpSendAutomationSignal struct {\n}\n\nfunc (*validateOpSendAutomationSignal) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpSendAutomationSignal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*SendAutomationSignalInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpSendAutomationSignalInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpSendCommand struct {\n}\n\nfunc (*validateOpSendCommand) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpSendCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*SendCommandInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpSendCommandInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartAssociationsOnce struct {\n}\n\nfunc (*validateOpStartAssociationsOnce) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartAssociationsOnce) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartAssociationsOnceInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartAssociationsOnceInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartAutomationExecution struct {\n}\n\nfunc (*validateOpStartAutomationExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartAutomationExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartAutomationExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartAutomationExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartChangeRequestExecution struct {\n}\n\nfunc (*validateOpStartChangeRequestExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartChangeRequestExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartChangeRequestExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartChangeRequestExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartSession struct {\n}\n\nfunc (*validateOpStartSession) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartSessionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartSessionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStopAutomationExecution struct {\n}\n\nfunc (*validateOpStopAutomationExecution) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStopAutomationExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StopAutomationExecutionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStopAutomationExecutionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpTerminateSession struct {\n}\n\nfunc (*validateOpTerminateSession) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpTerminateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*TerminateSessionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpTerminateSessionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUnlabelParameterVersion struct {\n}\n\nfunc (*validateOpUnlabelParameterVersion) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUnlabelParameterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UnlabelParameterVersionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUnlabelParameterVersionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateAssociation struct {\n}\n\nfunc (*validateOpUpdateAssociation) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateAssociationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateAssociationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateAssociationStatus struct {\n}\n\nfunc (*validateOpUpdateAssociationStatus) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateAssociationStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateAssociationStatusInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateAssociationStatusInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateDocumentDefaultVersion struct {\n}\n\nfunc (*validateOpUpdateDocumentDefaultVersion) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateDocumentDefaultVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateDocumentDefaultVersionInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateDocumentDefaultVersionInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateDocument struct {\n}\n\nfunc (*validateOpUpdateDocument) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateDocumentInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateDocumentInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateDocumentMetadata struct {\n}\n\nfunc (*validateOpUpdateDocumentMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateDocumentMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateDocumentMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateDocumentMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateMaintenanceWindow struct {\n}\n\nfunc (*validateOpUpdateMaintenanceWindow) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateMaintenanceWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateMaintenanceWindowInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateMaintenanceWindowTarget struct {\n}\n\nfunc (*validateOpUpdateMaintenanceWindowTarget) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateMaintenanceWindowTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowTargetInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateMaintenanceWindowTargetInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateMaintenanceWindowTask struct {\n}\n\nfunc (*validateOpUpdateMaintenanceWindowTask) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateMaintenanceWindowTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateMaintenanceWindowTaskInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateMaintenanceWindowTaskInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateManagedInstanceRole struct {\n}\n\nfunc (*validateOpUpdateManagedInstanceRole) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateManagedInstanceRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateManagedInstanceRoleInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateManagedInstanceRoleInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateOpsItem struct {\n}\n\nfunc (*validateOpUpdateOpsItem) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateOpsItemInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateOpsItemInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateOpsMetadata struct {\n}\n\nfunc (*validateOpUpdateOpsMetadata) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateOpsMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateOpsMetadataInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateOpsMetadataInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdatePatchBaseline struct {\n}\n\nfunc (*validateOpUpdatePatchBaseline) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdatePatchBaseline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdatePatchBaselineInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdatePatchBaselineInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateResourceDataSync struct {\n}\n\nfunc (*validateOpUpdateResourceDataSync) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateResourceDataSync) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateResourceDataSyncInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateResourceDataSyncInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpUpdateServiceSetting struct {\n}\n\nfunc (*validateOpUpdateServiceSetting) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpUpdateServiceSetting) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*UpdateServiceSettingInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpUpdateServiceSettingInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpAddTagsToResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpAddTagsToResource{}, middleware.After)\n}\n\nfunc addOpAssociateOpsItemRelatedItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpAssociateOpsItemRelatedItem{}, middleware.After)\n}\n\nfunc addOpCancelCommandValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCancelCommand{}, middleware.After)\n}\n\nfunc addOpCancelMaintenanceWindowExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCancelMaintenanceWindowExecution{}, middleware.After)\n}\n\nfunc addOpCreateActivationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateActivation{}, middleware.After)\n}\n\nfunc addOpCreateAssociationBatchValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateAssociationBatch{}, middleware.After)\n}\n\nfunc addOpCreateAssociationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateAssociation{}, middleware.After)\n}\n\nfunc addOpCreateDocumentValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateDocument{}, middleware.After)\n}\n\nfunc addOpCreateMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpCreateOpsItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateOpsItem{}, middleware.After)\n}\n\nfunc addOpCreateOpsMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateOpsMetadata{}, middleware.After)\n}\n\nfunc addOpCreatePatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreatePatchBaseline{}, middleware.After)\n}\n\nfunc addOpCreateResourceDataSyncValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateResourceDataSync{}, middleware.After)\n}\n\nfunc addOpDeleteActivationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteActivation{}, middleware.After)\n}\n\nfunc addOpDeleteDocumentValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteDocument{}, middleware.After)\n}\n\nfunc addOpDeleteInventoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteInventory{}, middleware.After)\n}\n\nfunc addOpDeleteMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpDeleteOpsItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteOpsItem{}, middleware.After)\n}\n\nfunc addOpDeleteOpsMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteOpsMetadata{}, middleware.After)\n}\n\nfunc addOpDeleteParameterValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteParameter{}, middleware.After)\n}\n\nfunc addOpDeleteParametersValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteParameters{}, middleware.After)\n}\n\nfunc addOpDeletePatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeletePatchBaseline{}, middleware.After)\n}\n\nfunc addOpDeleteResourceDataSyncValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteResourceDataSync{}, middleware.After)\n}\n\nfunc addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After)\n}\n\nfunc addOpDeregisterManagedInstanceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeregisterManagedInstance{}, middleware.After)\n}\n\nfunc addOpDeregisterPatchBaselineForPatchGroupValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeregisterPatchBaselineForPatchGroup{}, middleware.After)\n}\n\nfunc addOpDeregisterTargetFromMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeregisterTargetFromMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpDeregisterTaskFromMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDeregisterTaskFromMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpDescribeAssociationExecutionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeAssociationExecutions{}, middleware.After)\n}\n\nfunc addOpDescribeAssociationExecutionTargetsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeAssociationExecutionTargets{}, middleware.After)\n}\n\nfunc addOpDescribeAutomationExecutionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeAutomationExecutions{}, middleware.After)\n}\n\nfunc addOpDescribeAutomationStepExecutionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeAutomationStepExecutions{}, middleware.After)\n}\n\nfunc addOpDescribeDocumentValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeDocument{}, middleware.After)\n}\n\nfunc addOpDescribeDocumentPermissionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeDocumentPermission{}, middleware.After)\n}\n\nfunc addOpDescribeEffectiveInstanceAssociationsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeEffectiveInstanceAssociations{}, middleware.After)\n}\n\nfunc addOpDescribeEffectivePatchesForPatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeEffectivePatchesForPatchBaseline{}, middleware.After)\n}\n\nfunc addOpDescribeInstanceAssociationsStatusValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeInstanceAssociationsStatus{}, middleware.After)\n}\n\nfunc addOpDescribeInstanceInformationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeInstanceInformation{}, middleware.After)\n}\n\nfunc addOpDescribeInstancePatchesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeInstancePatches{}, middleware.After)\n}\n\nfunc addOpDescribeInstancePatchStatesForPatchGroupValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeInstancePatchStatesForPatchGroup{}, middleware.After)\n}\n\nfunc addOpDescribeInstancePatchStatesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeInstancePatchStates{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowExecutionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowExecutions{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowExecutionTaskInvocationsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowExecutionTaskInvocations{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowExecutionTasksValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowExecutionTasks{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowsForTargetValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowsForTarget{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowTargetsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowTargets{}, middleware.After)\n}\n\nfunc addOpDescribeMaintenanceWindowTasksValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeMaintenanceWindowTasks{}, middleware.After)\n}\n\nfunc addOpDescribeOpsItemsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeOpsItems{}, middleware.After)\n}\n\nfunc addOpDescribeParametersValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeParameters{}, middleware.After)\n}\n\nfunc addOpDescribePatchGroupStateValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribePatchGroupState{}, middleware.After)\n}\n\nfunc addOpDescribePatchPropertiesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribePatchProperties{}, middleware.After)\n}\n\nfunc addOpDescribeSessionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDescribeSessions{}, middleware.After)\n}\n\nfunc addOpDisassociateOpsItemRelatedItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDisassociateOpsItemRelatedItem{}, middleware.After)\n}\n\nfunc addOpGetAutomationExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetAutomationExecution{}, middleware.After)\n}\n\nfunc addOpGetCalendarStateValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetCalendarState{}, middleware.After)\n}\n\nfunc addOpGetCommandInvocationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetCommandInvocation{}, middleware.After)\n}\n\nfunc addOpGetConnectionStatusValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetConnectionStatus{}, middleware.After)\n}\n\nfunc addOpGetDeployablePatchSnapshotForInstanceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetDeployablePatchSnapshotForInstance{}, middleware.After)\n}\n\nfunc addOpGetDocumentValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetDocument{}, middleware.After)\n}\n\nfunc addOpGetInventoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetInventory{}, middleware.After)\n}\n\nfunc addOpGetMaintenanceWindowExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetMaintenanceWindowExecution{}, middleware.After)\n}\n\nfunc addOpGetMaintenanceWindowExecutionTaskValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetMaintenanceWindowExecutionTask{}, middleware.After)\n}\n\nfunc addOpGetMaintenanceWindowExecutionTaskInvocationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetMaintenanceWindowExecutionTaskInvocation{}, middleware.After)\n}\n\nfunc addOpGetMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpGetMaintenanceWindowTaskValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetMaintenanceWindowTask{}, middleware.After)\n}\n\nfunc addOpGetOpsItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetOpsItem{}, middleware.After)\n}\n\nfunc addOpGetOpsMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetOpsMetadata{}, middleware.After)\n}\n\nfunc addOpGetOpsSummaryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetOpsSummary{}, middleware.After)\n}\n\nfunc addOpGetParameterHistoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetParameterHistory{}, middleware.After)\n}\n\nfunc addOpGetParameterValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetParameter{}, middleware.After)\n}\n\nfunc addOpGetParametersByPathValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetParametersByPath{}, middleware.After)\n}\n\nfunc addOpGetParametersValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetParameters{}, middleware.After)\n}\n\nfunc addOpGetPatchBaselineForPatchGroupValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetPatchBaselineForPatchGroup{}, middleware.After)\n}\n\nfunc addOpGetPatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetPatchBaseline{}, middleware.After)\n}\n\nfunc addOpGetResourcePoliciesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetResourcePolicies{}, middleware.After)\n}\n\nfunc addOpGetServiceSettingValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetServiceSetting{}, middleware.After)\n}\n\nfunc addOpLabelParameterVersionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpLabelParameterVersion{}, middleware.After)\n}\n\nfunc addOpListAssociationsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListAssociations{}, middleware.After)\n}\n\nfunc addOpListAssociationVersionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListAssociationVersions{}, middleware.After)\n}\n\nfunc addOpListCommandInvocationsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListCommandInvocations{}, middleware.After)\n}\n\nfunc addOpListCommandsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListCommands{}, middleware.After)\n}\n\nfunc addOpListDocumentMetadataHistoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListDocumentMetadataHistory{}, middleware.After)\n}\n\nfunc addOpListDocumentsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListDocuments{}, middleware.After)\n}\n\nfunc addOpListDocumentVersionsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListDocumentVersions{}, middleware.After)\n}\n\nfunc addOpListInventoryEntriesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListInventoryEntries{}, middleware.After)\n}\n\nfunc addOpListOpsItemEventsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListOpsItemEvents{}, middleware.After)\n}\n\nfunc addOpListOpsItemRelatedItemsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListOpsItemRelatedItems{}, middleware.After)\n}\n\nfunc addOpListOpsMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListOpsMetadata{}, middleware.After)\n}\n\nfunc addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)\n}\n\nfunc addOpModifyDocumentPermissionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpModifyDocumentPermission{}, middleware.After)\n}\n\nfunc addOpPutComplianceItemsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutComplianceItems{}, middleware.After)\n}\n\nfunc addOpPutInventoryValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutInventory{}, middleware.After)\n}\n\nfunc addOpPutParameterValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutParameter{}, middleware.After)\n}\n\nfunc addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After)\n}\n\nfunc addOpRegisterDefaultPatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRegisterDefaultPatchBaseline{}, middleware.After)\n}\n\nfunc addOpRegisterPatchBaselineForPatchGroupValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRegisterPatchBaselineForPatchGroup{}, middleware.After)\n}\n\nfunc addOpRegisterTargetWithMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRegisterTargetWithMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpRegisterTaskWithMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRegisterTaskWithMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpRemoveTagsFromResourceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRemoveTagsFromResource{}, middleware.After)\n}\n\nfunc addOpResetServiceSettingValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpResetServiceSetting{}, middleware.After)\n}\n\nfunc addOpResumeSessionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpResumeSession{}, middleware.After)\n}\n\nfunc addOpSendAutomationSignalValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpSendAutomationSignal{}, middleware.After)\n}\n\nfunc addOpSendCommandValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpSendCommand{}, middleware.After)\n}\n\nfunc addOpStartAssociationsOnceValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartAssociationsOnce{}, middleware.After)\n}\n\nfunc addOpStartAutomationExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartAutomationExecution{}, middleware.After)\n}\n\nfunc addOpStartChangeRequestExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartChangeRequestExecution{}, middleware.After)\n}\n\nfunc addOpStartSessionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartSession{}, middleware.After)\n}\n\nfunc addOpStopAutomationExecutionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStopAutomationExecution{}, middleware.After)\n}\n\nfunc addOpTerminateSessionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpTerminateSession{}, middleware.After)\n}\n\nfunc addOpUnlabelParameterVersionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUnlabelParameterVersion{}, middleware.After)\n}\n\nfunc addOpUpdateAssociationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateAssociation{}, middleware.After)\n}\n\nfunc addOpUpdateAssociationStatusValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateAssociationStatus{}, middleware.After)\n}\n\nfunc addOpUpdateDocumentDefaultVersionValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateDocumentDefaultVersion{}, middleware.After)\n}\n\nfunc addOpUpdateDocumentValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateDocument{}, middleware.After)\n}\n\nfunc addOpUpdateDocumentMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateDocumentMetadata{}, middleware.After)\n}\n\nfunc addOpUpdateMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateMaintenanceWindow{}, middleware.After)\n}\n\nfunc addOpUpdateMaintenanceWindowTargetValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateMaintenanceWindowTarget{}, middleware.After)\n}\n\nfunc addOpUpdateMaintenanceWindowTaskValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateMaintenanceWindowTask{}, middleware.After)\n}\n\nfunc addOpUpdateManagedInstanceRoleValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateManagedInstanceRole{}, middleware.After)\n}\n\nfunc addOpUpdateOpsItemValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateOpsItem{}, middleware.After)\n}\n\nfunc addOpUpdateOpsMetadataValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateOpsMetadata{}, middleware.After)\n}\n\nfunc addOpUpdatePatchBaselineValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdatePatchBaseline{}, middleware.After)\n}\n\nfunc addOpUpdateResourceDataSyncValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateResourceDataSync{}, middleware.After)\n}\n\nfunc addOpUpdateServiceSettingValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpUpdateServiceSetting{}, middleware.After)\n}\n\nfunc validateAlarm(v *types.Alarm) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"Alarm\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAlarmConfiguration(v *types.AlarmConfiguration) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AlarmConfiguration\"}\n\tif v.Alarms == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Alarms\"))\n\t} else if v.Alarms != nil {\n\t\tif err := validateAlarmList(v.Alarms); err != nil {\n\t\t\tinvalidParams.AddNested(\"Alarms\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAlarmList(v []types.Alarm) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AlarmList\"}\n\tfor i := range v {\n\t\tif err := validateAlarm(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationExecutionFilter(v *types.AssociationExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationExecutionFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif len(v.Type) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Type\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationExecutionFilterList(v []types.AssociationExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationExecutionFilterList\"}\n\tfor i := range v {\n\t\tif err := validateAssociationExecutionFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationExecutionTargetsFilter(v *types.AssociationExecutionTargetsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationExecutionTargetsFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationExecutionTargetsFilterList(v []types.AssociationExecutionTargetsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationExecutionTargetsFilterList\"}\n\tfor i := range v {\n\t\tif err := validateAssociationExecutionTargetsFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationFilter(v *types.AssociationFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationFilterList(v []types.AssociationFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationFilterList\"}\n\tfor i := range v {\n\t\tif err := validateAssociationFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAssociationStatus(v *types.AssociationStatus) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociationStatus\"}\n\tif v.Date == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Date\"))\n\t}\n\tif len(v.Name) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Message == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Message\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAutomationExecutionFilter(v *types.AutomationExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AutomationExecutionFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateAutomationExecutionFilterList(v []types.AutomationExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AutomationExecutionFilterList\"}\n\tfor i := range v {\n\t\tif err := validateAutomationExecutionFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateBaselineOverride(v *types.BaselineOverride) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"BaselineOverride\"}\n\tif v.GlobalFilters != nil {\n\t\tif err := validatePatchFilterGroup(v.GlobalFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"GlobalFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ApprovalRules != nil {\n\t\tif err := validatePatchRuleGroup(v.ApprovalRules); err != nil {\n\t\t\tinvalidParams.AddNested(\"ApprovalRules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Sources != nil {\n\t\tif err := validatePatchSourceList(v.Sources); err != nil {\n\t\t\tinvalidParams.AddNested(\"Sources\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateCommandFilter(v *types.CommandFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CommandFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateCommandFilterList(v []types.CommandFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CommandFilterList\"}\n\tfor i := range v {\n\t\tif err := validateCommandFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateComplianceExecutionSummary(v *types.ComplianceExecutionSummary) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ComplianceExecutionSummary\"}\n\tif v.ExecutionTime == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ExecutionTime\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateComplianceItemEntry(v *types.ComplianceItemEntry) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ComplianceItemEntry\"}\n\tif len(v.Severity) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Severity\"))\n\t}\n\tif len(v.Status) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Status\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateComplianceItemEntryList(v []types.ComplianceItemEntry) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ComplianceItemEntryList\"}\n\tfor i := range v {\n\t\tif err := validateComplianceItemEntry(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateCreateAssociationBatchRequestEntries(v []types.CreateAssociationBatchRequestEntry) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateAssociationBatchRequestEntries\"}\n\tfor i := range v {\n\t\tif err := validateCreateAssociationBatchRequestEntry(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateCreateAssociationBatchRequestEntry(v *types.CreateAssociationBatchRequestEntry) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateAssociationBatchRequestEntry\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.TargetLocations != nil {\n\t\tif err := validateTargetLocations(v.TargetLocations); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateDocumentFilter(v *types.DocumentFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DocumentFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateDocumentFilterList(v []types.DocumentFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DocumentFilterList\"}\n\tfor i := range v {\n\t\tif err := validateDocumentFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateDocumentRequires(v *types.DocumentRequires) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DocumentRequires\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateDocumentRequiresList(v []types.DocumentRequires) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DocumentRequiresList\"}\n\tfor i := range v {\n\t\tif err := validateDocumentRequires(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateDocumentReviews(v *types.DocumentReviews) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DocumentReviews\"}\n\tif len(v.Action) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Action\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstanceInformationFilter(v *types.InstanceInformationFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstanceInformationFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.ValueSet == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ValueSet\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstanceInformationFilterList(v []types.InstanceInformationFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstanceInformationFilterList\"}\n\tfor i := range v {\n\t\tif err := validateInstanceInformationFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstanceInformationStringFilter(v *types.InstanceInformationStringFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstanceInformationStringFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstanceInformationStringFilterList(v []types.InstanceInformationStringFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstanceInformationStringFilterList\"}\n\tfor i := range v {\n\t\tif err := validateInstanceInformationStringFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstancePatchStateFilter(v *types.InstancePatchStateFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstancePatchStateFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif len(v.Type) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Type\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInstancePatchStateFilterList(v []types.InstancePatchStateFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InstancePatchStateFilterList\"}\n\tfor i := range v {\n\t\tif err := validateInstancePatchStateFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryAggregator(v *types.InventoryAggregator) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryAggregator\"}\n\tif v.Aggregators != nil {\n\t\tif err := validateInventoryAggregatorList(v.Aggregators); err != nil {\n\t\t\tinvalidParams.AddNested(\"Aggregators\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Groups != nil {\n\t\tif err := validateInventoryGroupList(v.Groups); err != nil {\n\t\t\tinvalidParams.AddNested(\"Groups\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryAggregatorList(v []types.InventoryAggregator) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryAggregatorList\"}\n\tfor i := range v {\n\t\tif err := validateInventoryAggregator(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryFilter(v *types.InventoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryFilterList(v []types.InventoryFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryFilterList\"}\n\tfor i := range v {\n\t\tif err := validateInventoryFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryGroup(v *types.InventoryGroup) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryGroup\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Filters == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Filters\"))\n\t} else if v.Filters != nil {\n\t\tif err := validateInventoryFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryGroupList(v []types.InventoryGroup) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryGroupList\"}\n\tfor i := range v {\n\t\tif err := validateInventoryGroup(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryItem(v *types.InventoryItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryItem\"}\n\tif v.TypeName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif v.SchemaVersion == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SchemaVersion\"))\n\t}\n\tif v.CaptureTime == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"CaptureTime\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateInventoryItemList(v []types.InventoryItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"InventoryItemList\"}\n\tfor i := range v {\n\t\tif err := validateInventoryItem(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateLoggingInfo(v *types.LoggingInfo) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"LoggingInfo\"}\n\tif v.S3BucketName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"S3BucketName\"))\n\t}\n\tif v.S3Region == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"S3Region\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsAggregator(v *types.OpsAggregator) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsAggregator\"}\n\tif v.Filters != nil {\n\t\tif err := validateOpsFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Aggregators != nil {\n\t\tif err := validateOpsAggregatorList(v.Aggregators); err != nil {\n\t\t\tinvalidParams.AddNested(\"Aggregators\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsAggregatorList(v []types.OpsAggregator) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsAggregatorList\"}\n\tfor i := range v {\n\t\tif err := validateOpsAggregator(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsFilter(v *types.OpsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsFilterList(v []types.OpsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsFilterList\"}\n\tfor i := range v {\n\t\tif err := validateOpsFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemEventFilter(v *types.OpsItemEventFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemEventFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif len(v.Operator) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Operator\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemEventFilters(v []types.OpsItemEventFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemEventFilters\"}\n\tfor i := range v {\n\t\tif err := validateOpsItemEventFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemFilter(v *types.OpsItemFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif len(v.Operator) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Operator\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemFilters(v []types.OpsItemFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemFilters\"}\n\tfor i := range v {\n\t\tif err := validateOpsItemFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemRelatedItemsFilter(v *types.OpsItemRelatedItemsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemRelatedItemsFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif len(v.Operator) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Operator\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsItemRelatedItemsFilters(v []types.OpsItemRelatedItemsFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsItemRelatedItemsFilters\"}\n\tfor i := range v {\n\t\tif err := validateOpsItemRelatedItemsFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsMetadataFilter(v *types.OpsMetadataFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsMetadataFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsMetadataFilterList(v []types.OpsMetadataFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsMetadataFilterList\"}\n\tfor i := range v {\n\t\tif err := validateOpsMetadataFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsResultAttribute(v *types.OpsResultAttribute) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsResultAttribute\"}\n\tif v.TypeName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpsResultAttributeList(v []types.OpsResultAttribute) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"OpsResultAttributeList\"}\n\tfor i := range v {\n\t\tif err := validateOpsResultAttribute(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateParametersFilter(v *types.ParametersFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ParametersFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateParametersFilterList(v []types.ParametersFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ParametersFilterList\"}\n\tfor i := range v {\n\t\tif err := validateParametersFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateParameterStringFilter(v *types.ParameterStringFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ParameterStringFilter\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateParameterStringFilterList(v []types.ParameterStringFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ParameterStringFilterList\"}\n\tfor i := range v {\n\t\tif err := validateParameterStringFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchFilter(v *types.PatchFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchFilterGroup(v *types.PatchFilterGroup) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchFilterGroup\"}\n\tif v.PatchFilters == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchFilters\"))\n\t} else if v.PatchFilters != nil {\n\t\tif err := validatePatchFilterList(v.PatchFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"PatchFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchFilterList(v []types.PatchFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchFilterList\"}\n\tfor i := range v {\n\t\tif err := validatePatchFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchRule(v *types.PatchRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchRule\"}\n\tif v.PatchFilterGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchFilterGroup\"))\n\t} else if v.PatchFilterGroup != nil {\n\t\tif err := validatePatchFilterGroup(v.PatchFilterGroup); err != nil {\n\t\t\tinvalidParams.AddNested(\"PatchFilterGroup\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchRuleGroup(v *types.PatchRuleGroup) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchRuleGroup\"}\n\tif v.PatchRules == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchRules\"))\n\t} else if v.PatchRules != nil {\n\t\tif err := validatePatchRuleList(v.PatchRules); err != nil {\n\t\t\tinvalidParams.AddNested(\"PatchRules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchRuleList(v []types.PatchRule) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchRuleList\"}\n\tfor i := range v {\n\t\tif err := validatePatchRule(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchSource(v *types.PatchSource) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchSource\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Products == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Products\"))\n\t}\n\tif v.Configuration == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Configuration\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validatePatchSourceList(v []types.PatchSource) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PatchSourceList\"}\n\tfor i := range v {\n\t\tif err := validatePatchSource(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRegistrationMetadataItem(v *types.RegistrationMetadataItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegistrationMetadataItem\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRegistrationMetadataList(v []types.RegistrationMetadataItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegistrationMetadataList\"}\n\tfor i := range v {\n\t\tif err := validateRegistrationMetadataItem(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRelatedOpsItem(v *types.RelatedOpsItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RelatedOpsItem\"}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRelatedOpsItems(v []types.RelatedOpsItem) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RelatedOpsItems\"}\n\tfor i := range v {\n\t\tif err := validateRelatedOpsItem(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateResourceDataSyncAwsOrganizationsSource(v *types.ResourceDataSyncAwsOrganizationsSource) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResourceDataSyncAwsOrganizationsSource\"}\n\tif v.OrganizationSourceType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OrganizationSourceType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateResourceDataSyncS3Destination(v *types.ResourceDataSyncS3Destination) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResourceDataSyncS3Destination\"}\n\tif v.BucketName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BucketName\"))\n\t}\n\tif len(v.SyncFormat) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncFormat\"))\n\t}\n\tif v.Region == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Region\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateResourceDataSyncSource(v *types.ResourceDataSyncSource) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResourceDataSyncSource\"}\n\tif v.SourceType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SourceType\"))\n\t}\n\tif v.AwsOrganizationsSource != nil {\n\t\tif err := validateResourceDataSyncAwsOrganizationsSource(v.AwsOrganizationsSource); err != nil {\n\t\t\tinvalidParams.AddNested(\"AwsOrganizationsSource\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.SourceRegions == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SourceRegions\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateResultAttribute(v *types.ResultAttribute) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResultAttribute\"}\n\tif v.TypeName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateResultAttributeList(v []types.ResultAttribute) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResultAttributeList\"}\n\tfor i := range v {\n\t\tif err := validateResultAttribute(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRunbook(v *types.Runbook) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"Runbook\"}\n\tif v.DocumentName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentName\"))\n\t}\n\tif v.TargetLocations != nil {\n\t\tif err := validateTargetLocations(v.TargetLocations); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateRunbooks(v []types.Runbook) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"Runbooks\"}\n\tfor i := range v {\n\t\tif err := validateRunbook(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateSessionFilter(v *types.SessionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SessionFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateSessionFilterList(v []types.SessionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SessionFilterList\"}\n\tfor i := range v {\n\t\tif err := validateSessionFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateStepExecutionFilter(v *types.StepExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StepExecutionFilter\"}\n\tif len(v.Key) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Values == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Values\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateStepExecutionFilterList(v []types.StepExecutionFilter) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StepExecutionFilterList\"}\n\tfor i := range v {\n\t\tif err := validateStepExecutionFilter(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateTag(v *types.Tag) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"Tag\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateTagList(v []types.Tag) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TagList\"}\n\tfor i := range v {\n\t\tif err := validateTag(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateTargetLocation(v *types.TargetLocation) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TargetLocation\"}\n\tif v.TargetLocationAlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.TargetLocationAlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocationAlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateTargetLocations(v []types.TargetLocation) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TargetLocations\"}\n\tfor i := range v {\n\t\tif err := validateTargetLocation(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpAddTagsToResourceInput(v *AddTagsToResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AddTagsToResourceInput\"}\n\tif len(v.ResourceType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.ResourceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceId\"))\n\t}\n\tif v.Tags == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Tags\"))\n\t} else if v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpAssociateOpsItemRelatedItemInput(v *AssociateOpsItemRelatedItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssociateOpsItemRelatedItemInput\"}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif v.AssociationType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationType\"))\n\t}\n\tif v.ResourceType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.ResourceUri == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceUri\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCancelCommandInput(v *CancelCommandInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CancelCommandInput\"}\n\tif v.CommandId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"CommandId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCancelMaintenanceWindowExecutionInput(v *CancelMaintenanceWindowExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CancelMaintenanceWindowExecutionInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateActivationInput(v *CreateActivationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateActivationInput\"}\n\tif v.IamRole == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"IamRole\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.RegistrationMetadata != nil {\n\t\tif err := validateRegistrationMetadataList(v.RegistrationMetadata); err != nil {\n\t\t\tinvalidParams.AddNested(\"RegistrationMetadata\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateAssociationBatchInput(v *CreateAssociationBatchInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateAssociationBatchInput\"}\n\tif v.Entries == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Entries\"))\n\t} else if v.Entries != nil {\n\t\tif err := validateCreateAssociationBatchRequestEntries(v.Entries); err != nil {\n\t\t\tinvalidParams.AddNested(\"Entries\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateAssociationInput(v *CreateAssociationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateAssociationInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.TargetLocations != nil {\n\t\tif err := validateTargetLocations(v.TargetLocations); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateDocumentInput(v *CreateDocumentInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateDocumentInput\"}\n\tif v.Content == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Content\"))\n\t}\n\tif v.Requires != nil {\n\t\tif err := validateDocumentRequiresList(v.Requires); err != nil {\n\t\t\tinvalidParams.AddNested(\"Requires\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateMaintenanceWindowInput(v *CreateMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateMaintenanceWindowInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Schedule == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Schedule\"))\n\t}\n\tif v.Duration == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Duration\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateOpsItemInput(v *CreateOpsItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateOpsItemInput\"}\n\tif v.Description == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Description\"))\n\t}\n\tif v.RelatedOpsItems != nil {\n\t\tif err := validateRelatedOpsItems(v.RelatedOpsItems); err != nil {\n\t\t\tinvalidParams.AddNested(\"RelatedOpsItems\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Source == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Source\"))\n\t}\n\tif v.Title == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Title\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateOpsMetadataInput(v *CreateOpsMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateOpsMetadataInput\"}\n\tif v.ResourceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceId\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreatePatchBaselineInput(v *CreatePatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreatePatchBaselineInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.GlobalFilters != nil {\n\t\tif err := validatePatchFilterGroup(v.GlobalFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"GlobalFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ApprovalRules != nil {\n\t\tif err := validatePatchRuleGroup(v.ApprovalRules); err != nil {\n\t\t\tinvalidParams.AddNested(\"ApprovalRules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Sources != nil {\n\t\tif err := validatePatchSourceList(v.Sources); err != nil {\n\t\t\tinvalidParams.AddNested(\"Sources\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateResourceDataSyncInput(v *CreateResourceDataSyncInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateResourceDataSyncInput\"}\n\tif v.SyncName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncName\"))\n\t}\n\tif v.S3Destination != nil {\n\t\tif err := validateResourceDataSyncS3Destination(v.S3Destination); err != nil {\n\t\t\tinvalidParams.AddNested(\"S3Destination\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.SyncSource != nil {\n\t\tif err := validateResourceDataSyncSource(v.SyncSource); err != nil {\n\t\t\tinvalidParams.AddNested(\"SyncSource\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteActivationInput(v *DeleteActivationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteActivationInput\"}\n\tif v.ActivationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ActivationId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteDocumentInput(v *DeleteDocumentInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteDocumentInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteInventoryInput(v *DeleteInventoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteInventoryInput\"}\n\tif v.TypeName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteMaintenanceWindowInput(v *DeleteMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteOpsItemInput(v *DeleteOpsItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteOpsItemInput\"}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteOpsMetadataInput(v *DeleteOpsMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteOpsMetadataInput\"}\n\tif v.OpsMetadataArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsMetadataArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteParameterInput(v *DeleteParameterInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteParameterInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteParametersInput(v *DeleteParametersInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteParametersInput\"}\n\tif v.Names == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Names\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeletePatchBaselineInput(v *DeletePatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeletePatchBaselineInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteResourceDataSyncInput(v *DeleteResourceDataSyncInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteResourceDataSyncInput\"}\n\tif v.SyncName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncName\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeleteResourcePolicyInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.PolicyId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PolicyId\"))\n\t}\n\tif v.PolicyHash == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PolicyHash\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeregisterManagedInstanceInput(v *DeregisterManagedInstanceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeregisterManagedInstanceInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeregisterPatchBaselineForPatchGroupInput(v *DeregisterPatchBaselineForPatchGroupInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeregisterPatchBaselineForPatchGroupInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif v.PatchGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchGroup\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeregisterTargetFromMaintenanceWindowInput(v *DeregisterTargetFromMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeregisterTargetFromMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.WindowTargetId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowTargetId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDeregisterTaskFromMaintenanceWindowInput(v *DeregisterTaskFromMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DeregisterTaskFromMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.WindowTaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowTaskId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeAssociationExecutionsInput(v *DescribeAssociationExecutionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeAssociationExecutionsInput\"}\n\tif v.AssociationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationId\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateAssociationExecutionFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeAssociationExecutionTargetsInput(v *DescribeAssociationExecutionTargetsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeAssociationExecutionTargetsInput\"}\n\tif v.AssociationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationId\"))\n\t}\n\tif v.ExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ExecutionId\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateAssociationExecutionTargetsFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeAutomationExecutionsInput(v *DescribeAutomationExecutionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeAutomationExecutionsInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateAutomationExecutionFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeAutomationStepExecutionsInput(v *DescribeAutomationStepExecutionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeAutomationStepExecutionsInput\"}\n\tif v.AutomationExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AutomationExecutionId\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateStepExecutionFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeDocumentInput(v *DescribeDocumentInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeDocumentInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeDocumentPermissionInput(v *DescribeDocumentPermissionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeDocumentPermissionInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif len(v.PermissionType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PermissionType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeEffectiveInstanceAssociationsInput(v *DescribeEffectiveInstanceAssociationsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeEffectiveInstanceAssociationsInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeEffectivePatchesForPatchBaselineInput(v *DescribeEffectivePatchesForPatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeEffectivePatchesForPatchBaselineInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeInstanceAssociationsStatusInput(v *DescribeInstanceAssociationsStatusInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeInstanceAssociationsStatusInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeInstanceInformationInput(v *DescribeInstanceInformationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeInstanceInformationInput\"}\n\tif v.InstanceInformationFilterList != nil {\n\t\tif err := validateInstanceInformationFilterList(v.InstanceInformationFilterList); err != nil {\n\t\t\tinvalidParams.AddNested(\"InstanceInformationFilterList\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateInstanceInformationStringFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeInstancePatchesInput(v *DescribeInstancePatchesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeInstancePatchesInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeInstancePatchStatesForPatchGroupInput(v *DescribeInstancePatchStatesForPatchGroupInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeInstancePatchStatesForPatchGroupInput\"}\n\tif v.PatchGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchGroup\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateInstancePatchStateFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeInstancePatchStatesInput(v *DescribeInstancePatchStatesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeInstancePatchStatesInput\"}\n\tif v.InstanceIds == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceIds\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowExecutionsInput(v *DescribeMaintenanceWindowExecutionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowExecutionsInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowExecutionTaskInvocationsInput(v *DescribeMaintenanceWindowExecutionTaskInvocationsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowExecutionTaskInvocationsInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif v.TaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TaskId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowExecutionTasksInput(v *DescribeMaintenanceWindowExecutionTasksInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowExecutionTasksInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowsForTargetInput(v *DescribeMaintenanceWindowsForTargetInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowsForTargetInput\"}\n\tif v.Targets == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Targets\"))\n\t}\n\tif len(v.ResourceType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowTargetsInput(v *DescribeMaintenanceWindowTargetsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowTargetsInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeMaintenanceWindowTasksInput(v *DescribeMaintenanceWindowTasksInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeMaintenanceWindowTasksInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeOpsItemsInput(v *DescribeOpsItemsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeOpsItemsInput\"}\n\tif v.OpsItemFilters != nil {\n\t\tif err := validateOpsItemFilters(v.OpsItemFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"OpsItemFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeParametersInput(v *DescribeParametersInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeParametersInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateParametersFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ParameterFilters != nil {\n\t\tif err := validateParameterStringFilterList(v.ParameterFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"ParameterFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribePatchGroupStateInput(v *DescribePatchGroupStateInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribePatchGroupStateInput\"}\n\tif v.PatchGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchGroup\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribePatchPropertiesInput(v *DescribePatchPropertiesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribePatchPropertiesInput\"}\n\tif len(v.OperatingSystem) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OperatingSystem\"))\n\t}\n\tif len(v.Property) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Property\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDescribeSessionsInput(v *DescribeSessionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DescribeSessionsInput\"}\n\tif len(v.State) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"State\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateSessionFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDisassociateOpsItemRelatedItemInput(v *DisassociateOpsItemRelatedItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DisassociateOpsItemRelatedItemInput\"}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif v.AssociationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetAutomationExecutionInput(v *GetAutomationExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetAutomationExecutionInput\"}\n\tif v.AutomationExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AutomationExecutionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetCalendarStateInput(v *GetCalendarStateInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetCalendarStateInput\"}\n\tif v.CalendarNames == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"CalendarNames\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetCommandInvocationInput(v *GetCommandInvocationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetCommandInvocationInput\"}\n\tif v.CommandId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"CommandId\"))\n\t}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetConnectionStatusInput(v *GetConnectionStatusInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetConnectionStatusInput\"}\n\tif v.Target == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Target\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetDeployablePatchSnapshotForInstanceInput(v *GetDeployablePatchSnapshotForInstanceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetDeployablePatchSnapshotForInstanceInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif v.SnapshotId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SnapshotId\"))\n\t}\n\tif v.BaselineOverride != nil {\n\t\tif err := validateBaselineOverride(v.BaselineOverride); err != nil {\n\t\t\tinvalidParams.AddNested(\"BaselineOverride\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetDocumentInput(v *GetDocumentInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetDocumentInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetInventoryInput(v *GetInventoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetInventoryInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateInventoryFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Aggregators != nil {\n\t\tif err := validateInventoryAggregatorList(v.Aggregators); err != nil {\n\t\t\tinvalidParams.AddNested(\"Aggregators\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ResultAttributes != nil {\n\t\tif err := validateResultAttributeList(v.ResultAttributes); err != nil {\n\t\t\tinvalidParams.AddNested(\"ResultAttributes\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetMaintenanceWindowExecutionInput(v *GetMaintenanceWindowExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetMaintenanceWindowExecutionInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetMaintenanceWindowExecutionTaskInput(v *GetMaintenanceWindowExecutionTaskInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetMaintenanceWindowExecutionTaskInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif v.TaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TaskId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetMaintenanceWindowExecutionTaskInvocationInput(v *GetMaintenanceWindowExecutionTaskInvocationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetMaintenanceWindowExecutionTaskInvocationInput\"}\n\tif v.WindowExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowExecutionId\"))\n\t}\n\tif v.TaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TaskId\"))\n\t}\n\tif v.InvocationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InvocationId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetMaintenanceWindowInput(v *GetMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetMaintenanceWindowTaskInput(v *GetMaintenanceWindowTaskInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetMaintenanceWindowTaskInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.WindowTaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowTaskId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetOpsItemInput(v *GetOpsItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetOpsItemInput\"}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetOpsMetadataInput(v *GetOpsMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetOpsMetadataInput\"}\n\tif v.OpsMetadataArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsMetadataArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetOpsSummaryInput(v *GetOpsSummaryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetOpsSummaryInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateOpsFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Aggregators != nil {\n\t\tif err := validateOpsAggregatorList(v.Aggregators); err != nil {\n\t\t\tinvalidParams.AddNested(\"Aggregators\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ResultAttributes != nil {\n\t\tif err := validateOpsResultAttributeList(v.ResultAttributes); err != nil {\n\t\t\tinvalidParams.AddNested(\"ResultAttributes\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetParameterHistoryInput(v *GetParameterHistoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetParameterHistoryInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetParameterInput(v *GetParameterInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetParameterInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetParametersByPathInput(v *GetParametersByPathInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetParametersByPathInput\"}\n\tif v.Path == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Path\"))\n\t}\n\tif v.ParameterFilters != nil {\n\t\tif err := validateParameterStringFilterList(v.ParameterFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"ParameterFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetParametersInput(v *GetParametersInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetParametersInput\"}\n\tif v.Names == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Names\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetPatchBaselineForPatchGroupInput(v *GetPatchBaselineForPatchGroupInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetPatchBaselineForPatchGroupInput\"}\n\tif v.PatchGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchGroup\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetPatchBaselineInput(v *GetPatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetPatchBaselineInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetResourcePoliciesInput(v *GetResourcePoliciesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetResourcePoliciesInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetServiceSettingInput(v *GetServiceSettingInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetServiceSettingInput\"}\n\tif v.SettingId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SettingId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpLabelParameterVersionInput(v *LabelParameterVersionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"LabelParameterVersionInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Labels == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Labels\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListAssociationsInput(v *ListAssociationsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListAssociationsInput\"}\n\tif v.AssociationFilterList != nil {\n\t\tif err := validateAssociationFilterList(v.AssociationFilterList); err != nil {\n\t\t\tinvalidParams.AddNested(\"AssociationFilterList\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListAssociationVersionsInput(v *ListAssociationVersionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListAssociationVersionsInput\"}\n\tif v.AssociationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListCommandInvocationsInput(v *ListCommandInvocationsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListCommandInvocationsInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateCommandFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListCommandsInput(v *ListCommandsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListCommandsInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateCommandFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListDocumentMetadataHistoryInput(v *ListDocumentMetadataHistoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListDocumentMetadataHistoryInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif len(v.Metadata) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Metadata\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListDocumentsInput(v *ListDocumentsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListDocumentsInput\"}\n\tif v.DocumentFilterList != nil {\n\t\tif err := validateDocumentFilterList(v.DocumentFilterList); err != nil {\n\t\t\tinvalidParams.AddNested(\"DocumentFilterList\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListDocumentVersionsInput(v *ListDocumentVersionsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListDocumentVersionsInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListInventoryEntriesInput(v *ListInventoryEntriesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListInventoryEntriesInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif v.TypeName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif v.Filters != nil {\n\t\tif err := validateInventoryFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListOpsItemEventsInput(v *ListOpsItemEventsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListOpsItemEventsInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateOpsItemEventFilters(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListOpsItemRelatedItemsInput(v *ListOpsItemRelatedItemsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListOpsItemRelatedItemsInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateOpsItemRelatedItemsFilters(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListOpsMetadataInput(v *ListOpsMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListOpsMetadataInput\"}\n\tif v.Filters != nil {\n\t\tif err := validateOpsMetadataFilterList(v.Filters); err != nil {\n\t\t\tinvalidParams.AddNested(\"Filters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListTagsForResourceInput\"}\n\tif len(v.ResourceType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.ResourceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpModifyDocumentPermissionInput(v *ModifyDocumentPermissionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ModifyDocumentPermissionInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif len(v.PermissionType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PermissionType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutComplianceItemsInput(v *PutComplianceItemsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutComplianceItemsInput\"}\n\tif v.ResourceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceId\"))\n\t}\n\tif v.ResourceType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.ComplianceType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ComplianceType\"))\n\t}\n\tif v.ExecutionSummary == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ExecutionSummary\"))\n\t} else if v.ExecutionSummary != nil {\n\t\tif err := validateComplianceExecutionSummary(v.ExecutionSummary); err != nil {\n\t\t\tinvalidParams.AddNested(\"ExecutionSummary\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Items == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Items\"))\n\t} else if v.Items != nil {\n\t\tif err := validateComplianceItemEntryList(v.Items); err != nil {\n\t\t\tinvalidParams.AddNested(\"Items\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutInventoryInput(v *PutInventoryInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutInventoryInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif v.Items == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Items\"))\n\t} else if v.Items != nil {\n\t\tif err := validateInventoryItemList(v.Items); err != nil {\n\t\t\tinvalidParams.AddNested(\"Items\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutParameterInput(v *PutParameterInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutParameterInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"PutResourcePolicyInput\"}\n\tif v.ResourceArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceArn\"))\n\t}\n\tif v.Policy == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Policy\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRegisterDefaultPatchBaselineInput(v *RegisterDefaultPatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegisterDefaultPatchBaselineInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRegisterPatchBaselineForPatchGroupInput(v *RegisterPatchBaselineForPatchGroupInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegisterPatchBaselineForPatchGroupInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif v.PatchGroup == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PatchGroup\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRegisterTargetWithMaintenanceWindowInput(v *RegisterTargetWithMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegisterTargetWithMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif len(v.ResourceType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.Targets == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Targets\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRegisterTaskWithMaintenanceWindowInput(v *RegisterTaskWithMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegisterTaskWithMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.TaskArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TaskArn\"))\n\t}\n\tif len(v.TaskType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TaskType\"))\n\t}\n\tif v.LoggingInfo != nil {\n\t\tif err := validateLoggingInfo(v.LoggingInfo); err != nil {\n\t\t\tinvalidParams.AddNested(\"LoggingInfo\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RemoveTagsFromResourceInput\"}\n\tif len(v.ResourceType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceType\"))\n\t}\n\tif v.ResourceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ResourceId\"))\n\t}\n\tif v.TagKeys == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"TagKeys\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpResetServiceSettingInput(v *ResetServiceSettingInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResetServiceSettingInput\"}\n\tif v.SettingId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SettingId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpResumeSessionInput(v *ResumeSessionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ResumeSessionInput\"}\n\tif v.SessionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SessionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpSendAutomationSignalInput(v *SendAutomationSignalInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SendAutomationSignalInput\"}\n\tif v.AutomationExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AutomationExecutionId\"))\n\t}\n\tif len(v.SignalType) == 0 {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SignalType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpSendCommandInput(v *SendCommandInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"SendCommandInput\"}\n\tif v.DocumentName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentName\"))\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartAssociationsOnceInput(v *StartAssociationsOnceInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartAssociationsOnceInput\"}\n\tif v.AssociationIds == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationIds\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartAutomationExecutionInput(v *StartAutomationExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartAutomationExecutionInput\"}\n\tif v.DocumentName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentName\"))\n\t}\n\tif v.TargetLocations != nil {\n\t\tif err := validateTargetLocations(v.TargetLocations); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartChangeRequestExecutionInput(v *StartChangeRequestExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartChangeRequestExecutionInput\"}\n\tif v.DocumentName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentName\"))\n\t}\n\tif v.Runbooks == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Runbooks\"))\n\t} else if v.Runbooks != nil {\n\t\tif err := validateRunbooks(v.Runbooks); err != nil {\n\t\t\tinvalidParams.AddNested(\"Runbooks\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagList(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartSessionInput(v *StartSessionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartSessionInput\"}\n\tif v.Target == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Target\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStopAutomationExecutionInput(v *StopAutomationExecutionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StopAutomationExecutionInput\"}\n\tif v.AutomationExecutionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AutomationExecutionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpTerminateSessionInput(v *TerminateSessionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TerminateSessionInput\"}\n\tif v.SessionId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SessionId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUnlabelParameterVersionInput(v *UnlabelParameterVersionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UnlabelParameterVersionInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.ParameterVersion == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ParameterVersion\"))\n\t}\n\tif v.Labels == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Labels\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateAssociationInput(v *UpdateAssociationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateAssociationInput\"}\n\tif v.AssociationId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationId\"))\n\t}\n\tif v.TargetLocations != nil {\n\t\tif err := validateTargetLocations(v.TargetLocations); err != nil {\n\t\t\tinvalidParams.AddNested(\"TargetLocations\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateAssociationStatusInput(v *UpdateAssociationStatusInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateAssociationStatusInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif v.AssociationStatus == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AssociationStatus\"))\n\t} else if v.AssociationStatus != nil {\n\t\tif err := validateAssociationStatus(v.AssociationStatus); err != nil {\n\t\t\tinvalidParams.AddNested(\"AssociationStatus\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateDocumentDefaultVersionInput(v *UpdateDocumentDefaultVersionInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateDocumentDefaultVersionInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.DocumentVersion == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentVersion\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateDocumentInput(v *UpdateDocumentInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateDocumentInput\"}\n\tif v.Content == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Content\"))\n\t}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateDocumentMetadataInput(v *UpdateDocumentMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateDocumentMetadataInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.DocumentReviews == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"DocumentReviews\"))\n\t} else if v.DocumentReviews != nil {\n\t\tif err := validateDocumentReviews(v.DocumentReviews); err != nil {\n\t\t\tinvalidParams.AddNested(\"DocumentReviews\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateMaintenanceWindowInput(v *UpdateMaintenanceWindowInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateMaintenanceWindowInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateMaintenanceWindowTargetInput(v *UpdateMaintenanceWindowTargetInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateMaintenanceWindowTargetInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.WindowTargetId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowTargetId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateMaintenanceWindowTaskInput(v *UpdateMaintenanceWindowTaskInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateMaintenanceWindowTaskInput\"}\n\tif v.WindowId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowId\"))\n\t}\n\tif v.WindowTaskId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WindowTaskId\"))\n\t}\n\tif v.LoggingInfo != nil {\n\t\tif err := validateLoggingInfo(v.LoggingInfo); err != nil {\n\t\t\tinvalidParams.AddNested(\"LoggingInfo\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.AlarmConfiguration != nil {\n\t\tif err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil {\n\t\t\tinvalidParams.AddNested(\"AlarmConfiguration\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateManagedInstanceRoleInput(v *UpdateManagedInstanceRoleInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateManagedInstanceRoleInput\"}\n\tif v.InstanceId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"InstanceId\"))\n\t}\n\tif v.IamRole == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"IamRole\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateOpsItemInput(v *UpdateOpsItemInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateOpsItemInput\"}\n\tif v.RelatedOpsItems != nil {\n\t\tif err := validateRelatedOpsItems(v.RelatedOpsItems); err != nil {\n\t\t\tinvalidParams.AddNested(\"RelatedOpsItems\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.OpsItemId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsItemId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateOpsMetadataInput(v *UpdateOpsMetadataInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateOpsMetadataInput\"}\n\tif v.OpsMetadataArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"OpsMetadataArn\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdatePatchBaselineInput(v *UpdatePatchBaselineInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdatePatchBaselineInput\"}\n\tif v.BaselineId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"BaselineId\"))\n\t}\n\tif v.GlobalFilters != nil {\n\t\tif err := validatePatchFilterGroup(v.GlobalFilters); err != nil {\n\t\t\tinvalidParams.AddNested(\"GlobalFilters\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.ApprovalRules != nil {\n\t\tif err := validatePatchRuleGroup(v.ApprovalRules); err != nil {\n\t\t\tinvalidParams.AddNested(\"ApprovalRules\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif v.Sources != nil {\n\t\tif err := validatePatchSourceList(v.Sources); err != nil {\n\t\t\tinvalidParams.AddNested(\"Sources\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateResourceDataSyncInput(v *UpdateResourceDataSyncInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateResourceDataSyncInput\"}\n\tif v.SyncName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncName\"))\n\t}\n\tif v.SyncType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncType\"))\n\t}\n\tif v.SyncSource == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SyncSource\"))\n\t} else if v.SyncSource != nil {\n\t\tif err := validateResourceDataSyncSource(v.SyncSource); err != nil {\n\t\t\tinvalidParams.AddNested(\"SyncSource\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpUpdateServiceSettingInput(v *UpdateServiceSettingInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"UpdateServiceSettingInput\"}\n\tif v.SettingId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SettingId\"))\n\t}\n\tif v.SettingValue == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SettingValue\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md",
    "content": "# v1.22.4 (2024-07-18)\n\n* No change notes available for this release.\n\n# v1.22.3 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.2 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.1 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.0 (2024-06-26)\n\n* **Feature**: Support list-of-string endpoint parameter.\n\n# v1.21.1 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.0 (2024-06-18)\n\n* **Feature**: Track usage of various AWS SDK features in user-agent string.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.12 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.11 (2024-06-07)\n\n* **Bug Fix**: Add clock skew correction on all service clients\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.10 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.9 (2024-05-23)\n\n* No change notes available for this release.\n\n# v1.20.8 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.7 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.6 (2024-05-08)\n\n* **Bug Fix**: GoDoc improvement\n\n# v1.20.5 (2024-04-05)\n\n* No change notes available for this release.\n\n# v1.20.4 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.3 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.2 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.1 (2024-02-23)\n\n* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.0 (2024-02-22)\n\n* **Feature**: Add middleware stack snapshot tests.\n\n# v1.19.2 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.1 (2024-02-20)\n\n* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == \"\"`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `\"\"`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure.\n\n# v1.19.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.7 (2024-01-18)\n\n* No change notes available for this release.\n\n# v1.18.6 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.5 (2023-12-08)\n\n* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.\n\n# v1.18.4 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.3 (2023-12-06)\n\n* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.\n\n# v1.18.2 (2023-12-01)\n\n* **Bug Fix**: Correct wrapping of errors in authentication workflow.\n* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.1 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.0 (2023-11-29)\n\n* **Feature**: Expose Options() accessor on service clients.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.5 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.4 (2023-11-28)\n\n* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.\n\n# v1.17.3 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.2 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.1 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.2 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.1 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2023-10-02)\n\n* **Feature**: Fix FIPS Endpoints in aws-us-gov.\n\n# v1.14.1 (2023-09-22)\n\n* No change notes available for this release.\n\n# v1.14.0 (2023-09-18)\n\n* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.\n* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.\n\n# v1.13.6 (2023-08-31)\n\n* No change notes available for this release.\n\n# v1.13.5 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.4 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.3 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.2 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2023-08-01)\n\n* No change notes available for this release.\n\n# v1.13.0 (2023-07-31)\n\n* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.14 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.13 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.12 (2023-06-15)\n\n* No change notes available for this release.\n\n# v1.12.11 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.10 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.12.9 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.8 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.12.7 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.6 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.5 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.4 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n\n# v1.12.3 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.2 (2023-02-15)\n\n* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.\n* **Bug Fix**: Correct error type parsing for restJson services.\n\n# v1.12.1 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.11.28 (2022-12-20)\n\n* No change notes available for this release.\n\n# v1.11.27 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.26 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.25 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.24 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.23 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.22 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.21 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.20 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.19 (2022-08-30)\n\n* **Documentation**: Documentation updates for the AWS IAM Identity Center Portal CLI Reference.\n\n# v1.11.18 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.17 (2022-08-15)\n\n* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)\n\n# v1.11.16 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.15 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.14 (2022-08-08)\n\n* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.13 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.12 (2022-07-11)\n\n* No change notes available for this release.\n\n# v1.11.11 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.10 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.9 (2022-06-16)\n\n* No change notes available for this release.\n\n# v1.11.8 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.7 (2022-05-26)\n\n* No change notes available for this release.\n\n# v1.11.6 (2022-05-25)\n\n* No change notes available for this release.\n\n# v1.11.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Documentation**: Updated API models\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-12-21)\n\n* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens.\n\n# v1.6.2 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Feature**: Updated service to latest API model.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.2 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalauth \"github.com/aws/aws-sdk-go-v2/internal/auth\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tinternalmiddleware \"github.com/aws/aws-sdk-go-v2/internal/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\nconst ServiceID = \"SSO\"\nconst ServiceAPIVersion = \"2019-06-10\"\n\n// Client provides the API client to make operations call for AWS Single Sign-On.\ntype Client struct {\n\toptions Options\n\n\t// Difference between the time reported by the server and the client\n\ttimeOffset *atomic.Int64\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveEndpointResolverV2(&options)\n\n\tresolveAuthSchemeResolver(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttempts(&options)\n\n\tignoreAnonymousAuth(&options)\n\n\twrapWithAnonymousAuth(&options)\n\n\tresolveAuthSchemes(&options)\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\tinitializeTimeOffsetResolver(client)\n\n\treturn client\n}\n\n// Options returns a copy of the client configuration.\n//\n// Callers SHOULD NOT perform mutations on any inner structures within client\n// config. Config overrides should instead be made on a per-operation basis through\n// functional options.\nfunc (c *Client) Options() Options {\n\treturn c.options.Copy()\n}\n\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeOperationRetryMaxAttempts(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype operationInputKey struct{}\n\nfunc setOperationInput(ctx context.Context, input interface{}) context.Context {\n\treturn middleware.WithStackValue(ctx, operationInputKey{}, input)\n}\n\nfunc getOperationInput(ctx context.Context) interface{} {\n\treturn middleware.GetStackValue(ctx, operationInputKey{})\n}\n\ntype setOperationInputMiddleware struct {\n}\n\nfunc (*setOperationInputMiddleware) ID() string {\n\treturn \"setOperationInput\"\n}\n\nfunc (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tctx = setOperationInput(ctx, in.Parameters)\n\treturn next.HandleSerialize(ctx, in)\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\nfunc resolveAuthSchemeResolver(options *Options) {\n\tif options.AuthSchemeResolver == nil {\n\t\toptions.AuthSchemeResolver = &defaultAuthSchemeResolver{}\n\t}\n}\n\nfunc resolveAuthSchemes(options *Options) {\n\tif options.AuthSchemes == nil {\n\t\toptions.AuthSchemes = []smithyhttp.AuthScheme{\n\t\t\tinternalauth.NewHTTPAuthScheme(\"aws.auth#sigv4\", &internalauthsmithy.V4SignerAdapter{\n\t\t\t\tSigner:     options.HTTPSignerV4,\n\t\t\t\tLogger:     options.Logger,\n\t\t\t\tLogSigning: options.ClientLogMode.IsSigning(),\n\t\t\t}),\n\t\t}\n\t}\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\ntype legacyEndpointContextSetter struct {\n\tLegacyResolver EndpointResolver\n}\n\nfunc (*legacyEndpointContextSetter) ID() string {\n\treturn \"legacyEndpointContextSetter\"\n}\n\nfunc (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.LegacyResolver != nil {\n\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)\n\t}\n\n\treturn next.HandleInitialize(ctx, in)\n\n}\nfunc addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {\n\treturn stack.Initialize.Add(&legacyEndpointContextSetter{\n\t\tLegacyResolver: o.EndpointResolver,\n\t}, middleware.Before)\n}\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:                cfg.Region,\n\t\tDefaultsMode:          cfg.DefaultsMode,\n\t\tRuntimeEnvironment:    cfg.RuntimeEnvironment,\n\t\tHTTPClient:            cfg.HTTPClient,\n\t\tCredentials:           cfg.Credentials,\n\t\tAPIOptions:            cfg.APIOptions,\n\t\tLogger:                cfg.Logger,\n\t\tClientLogMode:         cfg.ClientLogMode,\n\t\tAppID:                 cfg.AppID,\n\t\tAccountIDEndpointMode: cfg.AccountIDEndpointMode,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\tresolveBaseEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttempts(o *Options) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc finalizeOperationRetryMaxAttempts(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)\n}\n\nfunc addClientUserAgent(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"sso\", goModuleVersion)\n\tif len(options.AppID) > 0 {\n\t\tua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)\n\t}\n\n\treturn nil\n}\n\nfunc getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) {\n\tid := (*awsmiddleware.RequestUserAgent)(nil).ID()\n\tmw, ok := stack.Build.Get(id)\n\tif !ok {\n\t\tmw = awsmiddleware.NewRequestUserAgent()\n\t\tif err := stack.Build.Add(mw, middleware.After); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tua, ok := mw.(*awsmiddleware.RequestUserAgent)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%T for %s middleware did not match expected type\", mw, id)\n\t}\n\n\treturn ua, nil\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc addClientRequestID(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)\n}\n\nfunc addComputeContentLength(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After)\n}\n\nfunc addRawResponseToMetadata(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)\n}\n\nfunc addRecordResponseTiming(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)\n}\nfunc addStreamingEventsPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before)\n}\n\nfunc addUnsignedPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.UnsignedPayload{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addComputePayloadSHA256(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addContentSHA256Header(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After)\n}\n\nfunc addIsWaiterUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter)\n\t\treturn nil\n\t})\n}\n\nfunc addIsPaginatorUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator)\n\t\treturn nil\n\t})\n}\n\nfunc addRetry(stack *middleware.Stack, o Options) error {\n\tattempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) {\n\t\tm.LogAttempts = o.ClientLogMode.IsRetries()\n\t})\n\tif err := stack.Finalize.Insert(attempt, \"Signing\", middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\nfunc resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string {\n\tif mode == aws.AccountIDEndpointModeDisabled {\n\t\treturn nil\n\t}\n\n\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != \"\" {\n\t\treturn aws.String(ca.Credentials.AccountID)\n\t}\n\n\treturn nil\n}\n\nfunc addTimeOffsetBuild(stack *middleware.Stack, c *Client) error {\n\tmw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset}\n\tif err := stack.Build.Add(&mw, middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn stack.Deserialize.Insert(&mw, \"RecordResponseTiming\", middleware.Before)\n}\nfunc initializeTimeOffsetResolver(c *Client) {\n\tc.timeOffset = new(atomic.Int64)\n}\n\nfunc checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error {\n\tswitch mode {\n\tcase aws.AccountIDEndpointModeUnset:\n\tcase aws.AccountIDEndpointModePreferred:\n\tcase aws.AccountIDEndpointModeDisabled:\n\tcase aws.AccountIDEndpointModeRequired:\n\t\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t} else if ca.Credentials.AccountID == \"\" {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t}\n\t// default check in case invalid mode is configured through request config\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid accountID endpoint mode %s, must be preferred/required/disabled\", mode)\n\t}\n\n\treturn nil\n}\n\nfunc addUserAgentRetryMode(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch options.Retryer.(type) {\n\tcase *retry.Standard:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard)\n\tcase *retry.AdaptiveMode:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive)\n\t}\n\treturn nil\n}\n\nfunc addRecursionDetection(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After)\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, \"OperationDeserializer\", middleware.Before)\n\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, \"RequestIDRetriever\", middleware.Before)\n\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n\ntype disableHTTPSMiddleware struct {\n\tDisableHTTPS bool\n}\n\nfunc (*disableHTTPSMiddleware) ID() string {\n\treturn \"disableHTTPS\"\n}\n\nfunc (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {\n\t\treq.URL.Scheme = \"http\"\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Finalize.Insert(&disableHTTPSMiddleware{\n\t\tDisableHTTPS: o.EndpointOptions.DisableHTTPS,\n\t}, \"ResolveEndpointV2\", middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns the STS short-term credentials for a given role name that is assigned\n// to the user.\nfunc (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredentialsInput, optFns ...func(*Options)) (*GetRoleCredentialsOutput, error) {\n\tif params == nil {\n\t\tparams = &GetRoleCredentialsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetRoleCredentials\", params, optFns, c.addOperationGetRoleCredentialsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetRoleCredentialsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetRoleCredentialsInput struct {\n\n\t// The token issued by the CreateToken API call. For more information, see [CreateToken] in the\n\t// IAM Identity Center OIDC API Reference Guide.\n\t//\n\t// [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html\n\t//\n\t// This member is required.\n\tAccessToken *string\n\n\t// The identifier for the AWS account that is assigned to the user.\n\t//\n\t// This member is required.\n\tAccountId *string\n\n\t// The friendly name of the role that is assigned to the user.\n\t//\n\t// This member is required.\n\tRoleName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetRoleCredentialsOutput struct {\n\n\t// The credentials for the role that is assigned to the user.\n\tRoleCredentials *types.RoleCredentials\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRoleCredentials{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetRoleCredentials\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoleCredentials(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetRoleCredentials(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetRoleCredentials\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all roles that are assigned to the user for a given AWS account.\nfunc (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesInput, optFns ...func(*Options)) (*ListAccountRolesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListAccountRolesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListAccountRoles\", params, optFns, c.addOperationListAccountRolesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListAccountRolesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListAccountRolesInput struct {\n\n\t// The token issued by the CreateToken API call. For more information, see [CreateToken] in the\n\t// IAM Identity Center OIDC API Reference Guide.\n\t//\n\t// [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html\n\t//\n\t// This member is required.\n\tAccessToken *string\n\n\t// The identifier for the AWS account that is assigned to the user.\n\t//\n\t// This member is required.\n\tAccountId *string\n\n\t// The number of items that clients can request per page.\n\tMaxResults *int32\n\n\t// The page token from the previous response output when you request subsequent\n\t// pages.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListAccountRolesOutput struct {\n\n\t// The page token client that is used to retrieve the list of accounts.\n\tNextToken *string\n\n\t// A paginated response with the list of roles and the next token if more results\n\t// are available.\n\tRoleList []types.RoleInfo\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccountRoles{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListAccountRoles\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListAccountRolesValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountRoles(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListAccountRolesPaginatorOptions is the paginator options for ListAccountRoles\ntype ListAccountRolesPaginatorOptions struct {\n\t// The number of items that clients can request per page.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListAccountRolesPaginator is a paginator for ListAccountRoles\ntype ListAccountRolesPaginator struct {\n\toptions   ListAccountRolesPaginatorOptions\n\tclient    ListAccountRolesAPIClient\n\tparams    *ListAccountRolesInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator\nfunc NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator {\n\tif params == nil {\n\t\tparams = &ListAccountRolesInput{}\n\t}\n\n\toptions := ListAccountRolesPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListAccountRolesPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListAccountRolesPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListAccountRoles page.\nfunc (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountRolesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\toptFns = append([]func(*Options){\n\t\taddIsPaginatorUserAgent,\n\t}, optFns...)\n\tresult, err := p.client.ListAccountRoles(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\n// ListAccountRolesAPIClient is a client that implements the ListAccountRoles\n// operation.\ntype ListAccountRolesAPIClient interface {\n\tListAccountRoles(context.Context, *ListAccountRolesInput, ...func(*Options)) (*ListAccountRolesOutput, error)\n}\n\nvar _ ListAccountRolesAPIClient = (*Client)(nil)\n\nfunc newServiceMetadataMiddleware_opListAccountRoles(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListAccountRoles\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Lists all AWS accounts assigned to the user. These AWS accounts are assigned by\n// the administrator of the account. For more information, see [Assign User Access]in the IAM Identity\n// Center User Guide. This operation returns a paginated response.\n//\n// [Assign User Access]: https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers\nfunc (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListAccountsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListAccounts\", params, optFns, c.addOperationListAccountsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListAccountsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListAccountsInput struct {\n\n\t// The token issued by the CreateToken API call. For more information, see [CreateToken] in the\n\t// IAM Identity Center OIDC API Reference Guide.\n\t//\n\t// [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html\n\t//\n\t// This member is required.\n\tAccessToken *string\n\n\t// This is the number of items clients can request per page.\n\tMaxResults *int32\n\n\t// (Optional) When requesting subsequent pages, this is the page token from the\n\t// previous response output.\n\tNextToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype ListAccountsOutput struct {\n\n\t// A paginated response with the list of account information and the next token if\n\t// more results are available.\n\tAccountList []types.AccountInfo\n\n\t// The page token client that is used to retrieve the list of accounts.\n\tNextToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccounts{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"ListAccounts\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpListAccountsValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ListAccountsPaginatorOptions is the paginator options for ListAccounts\ntype ListAccountsPaginatorOptions struct {\n\t// This is the number of items clients can request per page.\n\tLimit int32\n\n\t// Set to true if pagination should stop if the service returns a pagination token\n\t// that matches the most recent token provided to the service.\n\tStopOnDuplicateToken bool\n}\n\n// ListAccountsPaginator is a paginator for ListAccounts\ntype ListAccountsPaginator struct {\n\toptions   ListAccountsPaginatorOptions\n\tclient    ListAccountsAPIClient\n\tparams    *ListAccountsInput\n\tnextToken *string\n\tfirstPage bool\n}\n\n// NewListAccountsPaginator returns a new ListAccountsPaginator\nfunc NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator {\n\tif params == nil {\n\t\tparams = &ListAccountsInput{}\n\t}\n\n\toptions := ListAccountsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListAccountsPaginator{\n\t\toptions:   options,\n\t\tclient:    client,\n\t\tparams:    params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}\n\n// HasMorePages returns a boolean indicating whether more pages are available\nfunc (p *ListAccountsPaginator) HasMorePages() bool {\n\treturn p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)\n}\n\n// NextPage retrieves the next ListAccounts page.\nfunc (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\toptFns = append([]func(*Options){\n\t\taddIsPaginatorUserAgent,\n\t}, optFns...)\n\tresult, err := p.client.ListAccounts(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}\n\n// ListAccountsAPIClient is a client that implements the ListAccounts operation.\ntype ListAccountsAPIClient interface {\n\tListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error)\n}\n\nvar _ ListAccountsAPIClient = (*Client)(nil)\n\nfunc newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"ListAccounts\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Removes the locally stored SSO tokens from the client-side cache and sends an\n// API call to the IAM Identity Center service to invalidate the corresponding\n// server-side IAM Identity Center sign in session.\n//\n// If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM\n// Identity Center sign in session is used to obtain an IAM session, as specified\n// in the corresponding IAM Identity Center permission set. More specifically, IAM\n// Identity Center assumes an IAM role in the target account on behalf of the user,\n// and the corresponding temporary AWS credentials are returned to the client.\n//\n// After user logout, any existing IAM role sessions that were created by using\n// IAM Identity Center permission sets continue based on the duration configured in\n// the permission set. For more information, see [User authentications]in the IAM Identity Center User\n// Guide.\n//\n// [User authentications]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html\nfunc (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) {\n\tif params == nil {\n\t\tparams = &LogoutInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"Logout\", params, optFns, c.addOperationLogoutMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*LogoutOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype LogoutInput struct {\n\n\t// The token issued by the CreateToken API call. For more information, see [CreateToken] in the\n\t// IAM Identity Center OIDC API Reference Guide.\n\t//\n\t// [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html\n\t//\n\t// This member is required.\n\tAccessToken *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype LogoutOutput struct {\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpLogout{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"Logout\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpLogoutValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opLogout(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opLogout(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"Logout\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nfunc bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) {\n\tparams.Region = options.Region\n}\n\ntype setLegacyContextSigningOptionsMiddleware struct {\n}\n\nfunc (*setLegacyContextSigningOptionsMiddleware) ID() string {\n\treturn \"setLegacyContextSigningOptions\"\n}\n\nfunc (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tschemeID := rscheme.Scheme.SchemeID()\n\n\tif sn := awsmiddleware.GetSigningName(ctx); sn != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)\n\t\t}\n\t}\n\n\tif sr := awsmiddleware.GetSigningRegion(ctx); sr != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})\n\t\t}\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, \"Signing\", middleware.Before)\n}\n\ntype withAnonymous struct {\n\tresolver AuthSchemeResolver\n}\n\nvar _ AuthSchemeResolver = (*withAnonymous)(nil)\n\nfunc (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\topts, err := v.resolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts = append(opts, &smithyauth.Option{\n\t\tSchemeID: smithyauth.SchemeIDAnonymous,\n\t})\n\treturn opts, nil\n}\n\nfunc wrapWithAnonymousAuth(options *Options) {\n\tif _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {\n\t\treturn\n\t}\n\n\toptions.AuthSchemeResolver = &withAnonymous{\n\t\tresolver: options.AuthSchemeResolver,\n\t}\n}\n\n// AuthResolverParameters contains the set of inputs necessary for auth scheme\n// resolution.\ntype AuthResolverParameters struct {\n\t// The name of the operation being invoked.\n\tOperation string\n\n\t// The region in which the operation is being invoked.\n\tRegion string\n}\n\nfunc bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters {\n\tparams := &AuthResolverParameters{\n\t\tOperation: operation,\n\t}\n\n\tbindAuthParamsRegion(ctx, params, input, options)\n\n\treturn params\n}\n\n// AuthSchemeResolver returns a set of possible authentication options for an\n// operation.\ntype AuthSchemeResolver interface {\n\tResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)\n}\n\ntype defaultAuthSchemeResolver struct{}\n\nvar _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)\n\nfunc (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\tif overrides, ok := operationAuthOptions[params.Operation]; ok {\n\t\treturn overrides(params), nil\n\t}\n\treturn serviceAuthOptions(params), nil\n}\n\nvar operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{\n\t\"GetRoleCredentials\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"ListAccountRoles\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"ListAccounts\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"Logout\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n}\n\nfunc serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {\n\treturn []*smithyauth.Option{\n\t\t{\n\t\t\tSchemeID: smithyauth.SchemeIDSigV4,\n\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\tvar props smithy.Properties\n\t\t\t\tsmithyhttp.SetSigV4SigningName(&props, \"awsssoportal\")\n\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&props, params.Region)\n\t\t\t\treturn props\n\t\t\t}(),\n\t\t},\n\t}\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tparams := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options)\n\toptions, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"resolve auth scheme: %w\", err)\n\t}\n\n\tscheme, ok := m.selectScheme(options)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"could not select an auth scheme\")\n\t}\n\n\tctx = setResolvedAuthScheme(ctx, scheme)\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {\n\tfor _, option := range options {\n\t\tif option.SchemeID == smithyauth.SchemeIDAnonymous {\n\t\t\treturn newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true\n\t\t}\n\n\t\tfor _, scheme := range m.options.AuthSchemes {\n\t\t\tif scheme.SchemeID() != option.SchemeID {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif scheme.IdentityResolver(m.options) != nil {\n\t\t\t\treturn newResolvedAuthScheme(scheme, option), true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, false\n}\n\ntype resolvedAuthSchemeKey struct{}\n\ntype resolvedAuthScheme struct {\n\tScheme             smithyhttp.AuthScheme\n\tIdentityProperties smithy.Properties\n\tSignerProperties   smithy.Properties\n}\n\nfunc newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {\n\treturn &resolvedAuthScheme{\n\t\tScheme:             scheme,\n\t\tIdentityProperties: option.IdentityProperties,\n\t\tSignerProperties:   option.SignerProperties,\n\t}\n}\n\nfunc setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {\n\treturn middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)\n}\n\nfunc getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {\n\tv, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)\n\treturn v\n}\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tresolver := rscheme.Scheme.IdentityResolver(m.options)\n\tif resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity resolver\")\n\t}\n\n\tidentity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"get identity: %w\", err)\n\t}\n\n\tctx = setIdentity(ctx, identity)\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype identityKey struct{}\n\nfunc setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {\n\treturn middleware.WithStackValue(ctx, identityKey{}, identity)\n}\n\nfunc getIdentity(ctx context.Context) smithyauth.Identity {\n\tv, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)\n\treturn v\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unexpected transport type %T\", in.Request)\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tidentity := getIdentity(ctx)\n\tif identity == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity\")\n\t}\n\n\tsigner := rscheme.Scheme.Signer()\n\tif signer == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no signer\")\n\t}\n\n\tif err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"sign request: %w\", err)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sso/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc deserializeS3Expires(v string) (*time.Time, error) {\n\tt, err := smithytime.ParseHTTPDate(v)\n\tif err != nil {\n\t\treturn nil, nil\n\t}\n\treturn &t, nil\n}\n\ntype awsRestjson1_deserializeOpGetRoleCredentials struct {\n}\n\nfunc (*awsRestjson1_deserializeOpGetRoleCredentials) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpGetRoleCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorGetRoleCredentials(response, &metadata)\n\t}\n\toutput := &GetRoleCredentialsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentGetRoleCredentialsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorGetRoleCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceNotFoundException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyRequestsException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentGetRoleCredentialsOutput(v **GetRoleCredentialsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *GetRoleCredentialsOutput\n\tif *v == nil {\n\t\tsv = &GetRoleCredentialsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"roleCredentials\":\n\t\t\tif err := awsRestjson1_deserializeDocumentRoleCredentials(&sv.RoleCredentials, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpListAccountRoles struct {\n}\n\nfunc (*awsRestjson1_deserializeOpListAccountRoles) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpListAccountRoles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorListAccountRoles(response, &metadata)\n\t}\n\toutput := &ListAccountRolesOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentListAccountRolesOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorListAccountRoles(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceNotFoundException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyRequestsException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentListAccountRolesOutput(v **ListAccountRolesOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListAccountRolesOutput\n\tif *v == nil {\n\t\tsv = &ListAccountRolesOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextTokenType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"roleList\":\n\t\t\tif err := awsRestjson1_deserializeDocumentRoleListType(&sv.RoleList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpListAccounts struct {\n}\n\nfunc (*awsRestjson1_deserializeOpListAccounts) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpListAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorListAccounts(response, &metadata)\n\t}\n\toutput := &ListAccountsOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentListAccountsOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorListAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"ResourceNotFoundException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyRequestsException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentListAccountsOutput(v **ListAccountsOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *ListAccountsOutput\n\tif *v == nil {\n\t\tsv = &ListAccountsOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accountList\":\n\t\t\tif err := awsRestjson1_deserializeDocumentAccountListType(&sv.AccountList, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"nextToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected NextTokenType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.NextToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpLogout struct {\n}\n\nfunc (*awsRestjson1_deserializeOpLogout) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpLogout) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorLogout(response, &metadata)\n\t}\n\toutput := &LogoutOutput{}\n\tout.Result = output\n\n\tif _, err = io.Copy(ioutil.Discard, response.Body); err != nil {\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr: fmt.Errorf(\"failed to discard response body, %w\", err),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorLogout(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"TooManyRequestsException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidRequestException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.ResourceNotFoundException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.TooManyRequestsException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.UnauthorizedException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeDocumentAccountInfo(v **types.AccountInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AccountInfo\n\tif *v == nil {\n\t\tsv = &types.AccountInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accountId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccountIdType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccountId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"accountName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccountNameType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccountName = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"emailAddress\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected EmailAddressType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.EmailAddress = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentAccountListType(v *[]types.AccountInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.AccountInfo\n\tif *v == nil {\n\t\tcv = []types.AccountInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.AccountInfo\n\t\tdestAddr := &col\n\t\tif err := awsRestjson1_deserializeDocumentAccountInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidRequestException\n\tif *v == nil {\n\t\tsv = &types.InvalidRequestException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ResourceNotFoundException\n\tif *v == nil {\n\t\tsv = &types.ResourceNotFoundException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentRoleCredentials(v **types.RoleCredentials, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RoleCredentials\n\tif *v == nil {\n\t\tsv = &types.RoleCredentials{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accessKeyId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccessKeyType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccessKeyId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiration\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationTimestampType to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Expiration = i64\n\t\t\t}\n\n\t\tcase \"secretAccessKey\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SecretAccessKeyType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SecretAccessKey = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"sessionToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected SessionTokenType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.SessionToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentRoleInfo(v **types.RoleInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.RoleInfo\n\tif *v == nil {\n\t\tsv = &types.RoleInfo{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accountId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccountIdType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccountId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"roleName\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RoleNameType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RoleName = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentRoleListType(v *[]types.RoleInfo, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []types.RoleInfo\n\tif *v == nil {\n\t\tcv = []types.RoleInfo{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col types.RoleInfo\n\t\tdestAddr := &col\n\t\tif err := awsRestjson1_deserializeDocumentRoleInfo(&destAddr, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcol = *destAddr\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.TooManyRequestsException\n\tif *v == nil {\n\t\tsv = &types.TooManyRequestsException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnauthorizedException\n\tif *v == nil {\n\t\tsv = &types.UnauthorizedException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"message\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Message = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package sso provides the API client, operations, and parameter types for AWS\n// Single Sign-On.\n//\n// AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web\n// service that makes it easy for you to assign user access to IAM Identity Center\n// resources such as the AWS access portal. Users can get AWS account applications\n// and roles assigned to them and get federated into the application.\n//\n// Although AWS Single Sign-On was renamed, the sso and identitystore API\n// namespaces will continue to retain their original name for backward\n// compatibility purposes. For more information, see [IAM Identity Center rename].\n//\n// This reference guide describes the IAM Identity Center Portal operations that\n// you can call programatically and includes detailed information on data types and\n// errors.\n//\n// AWS provides SDKs that consist of libraries and sample code for various\n// programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android.\n// The SDKs provide a convenient way to create programmatic access to IAM Identity\n// Center and other AWS services. For more information about the AWS SDKs,\n// including how to download and install them, see [Tools for Amazon Web Services].\n//\n// [Tools for Amazon Web Services]: http://aws.amazon.com/tools/\n// [IAM Identity Center rename]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed\npackage sso\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithyendpoints \"github.com/aws/smithy-go/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleSerialize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\tnf := (&aws.EndpointNotFoundError{})\n\t\tif errors.As(err, &nf) {\n\t\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)\n\t\t\treturn next.HandleSerialize(ctx, in)\n\t\t}\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"awsssoportal\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,\n// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked\n// via its middleware.\n//\n// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n\nfunc resolveEndpointResolverV2(options *Options) {\n\tif options.EndpointResolverV2 == nil {\n\t\toptions.EndpointResolverV2 = NewDefaultEndpointResolverV2()\n\t}\n}\n\nfunc resolveBaseEndpoint(cfg aws.Config, o *Options) {\n\tif cfg.BaseEndpoint != nil {\n\t\to.BaseEndpoint = cfg.BaseEndpoint\n\t}\n\n\t_, g := os.LookupEnv(\"AWS_ENDPOINT_URL\")\n\t_, s := os.LookupEnv(\"AWS_ENDPOINT_URL_SSO\")\n\n\tif g && !s {\n\t\treturn\n\t}\n\n\tvalue, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), \"SSO\", cfg.ConfigSources)\n\tif found && err == nil {\n\t\to.BaseEndpoint = &value\n\t}\n}\n\nfunc bindRegion(region string) *string {\n\tif region == \"\" {\n\t\treturn nil\n\t}\n\treturn aws.String(endpoints.MapFIPSRegion(region))\n}\n\n// EndpointParameters provides the parameters that influence how endpoints are\n// resolved.\ntype EndpointParameters struct {\n\t// The AWS region used to dispatch the request.\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// AWS::Region\n\tRegion *string\n\n\t// When true, use the dual-stack endpoint. If the configured endpoint does not\n\t// support dual-stack, dispatching the request MAY return an error.\n\t//\n\t// Defaults to\n\t// false if no value is provided.\n\t//\n\t// AWS::UseDualStack\n\tUseDualStack *bool\n\n\t// When true, send this request to the FIPS-compliant regional endpoint. If the\n\t// configured endpoint does not have a FIPS compliant endpoint, dispatching the\n\t// request will return an error.\n\t//\n\t// Defaults to false if no value is\n\t// provided.\n\t//\n\t// AWS::UseFIPS\n\tUseFIPS *bool\n\n\t// Override the endpoint used to send this request\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// SDK::Endpoint\n\tEndpoint *string\n}\n\n// ValidateRequired validates required parameters are set.\nfunc (p EndpointParameters) ValidateRequired() error {\n\tif p.UseDualStack == nil {\n\t\treturn fmt.Errorf(\"parameter UseDualStack is required\")\n\t}\n\n\tif p.UseFIPS == nil {\n\t\treturn fmt.Errorf(\"parameter UseFIPS is required\")\n\t}\n\n\treturn nil\n}\n\n// WithDefaults returns a shallow copy of EndpointParameterswith default values\n// applied to members where applicable.\nfunc (p EndpointParameters) WithDefaults() EndpointParameters {\n\tif p.UseDualStack == nil {\n\t\tp.UseDualStack = ptr.Bool(false)\n\t}\n\n\tif p.UseFIPS == nil {\n\t\tp.UseFIPS = ptr.Bool(false)\n\t}\n\treturn p\n}\n\ntype stringSlice []string\n\nfunc (s stringSlice) Get(i int) *string {\n\tif i < 0 || i >= len(s) {\n\t\treturn nil\n\t}\n\n\tv := s[i]\n\treturn &v\n}\n\n// EndpointResolverV2 provides the interface for resolving service endpoints.\ntype EndpointResolverV2 interface {\n\t// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n\t// returning the endpoint if found. Otherwise an error is returned.\n\tResolveEndpoint(ctx context.Context, params EndpointParameters) (\n\t\tsmithyendpoints.Endpoint, error,\n\t)\n}\n\n// resolver provides the implementation for resolving endpoints.\ntype resolver struct{}\n\nfunc NewDefaultEndpointResolverV2() EndpointResolverV2 {\n\treturn &resolver{}\n}\n\n// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n// returning the endpoint if found. Otherwise an error is returned.\nfunc (r *resolver) ResolveEndpoint(\n\tctx context.Context, params EndpointParameters,\n) (\n\tendpoint smithyendpoints.Endpoint, err error,\n) {\n\tparams = params.WithDefaults()\n\tif err = params.ValidateRequired(); err != nil {\n\t\treturn endpoint, fmt.Errorf(\"endpoint parameters are not valid, %w\", err)\n\t}\n\t_UseDualStack := *params.UseDualStack\n\t_UseFIPS := *params.UseFIPS\n\n\tif exprVal := params.Endpoint; exprVal != nil {\n\t\t_Endpoint := *exprVal\n\t\t_ = _Endpoint\n\t\tif _UseFIPS == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: FIPS and custom endpoint are not supported\")\n\t\t}\n\t\tif _UseDualStack == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Dualstack and custom endpoint are not supported\")\n\t\t}\n\t\turiString := _Endpoint\n\n\t\turi, err := url.Parse(uriString)\n\t\tif err != nil {\n\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t}\n\n\t\treturn smithyendpoints.Endpoint{\n\t\t\tURI:     *uri,\n\t\t\tHeaders: http.Header{},\n\t\t}, nil\n\t}\n\tif exprVal := params.Region; exprVal != nil {\n\t\t_Region := *exprVal\n\t\t_ = _Region\n\t\tif exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {\n\t\t\t_PartitionResult := *exprVal\n\t\t\t_ = _PartitionResult\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _UseDualStack == true {\n\t\t\t\t\tif true == _PartitionResult.SupportsFIPS {\n\t\t\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\t\tout.WriteString(\"https://portal.sso-fips.\")\n\t\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t\t}()\n\n\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS and DualStack are enabled, but this partition does not support one or both\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif true == _PartitionResult.SupportsFIPS {\n\t\t\t\t\tif \"aws-us-gov\" == _PartitionResult.Name {\n\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\tout.WriteString(\"https://portal.sso.\")\n\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\tout.WriteString(\".amazonaws.com\")\n\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://portal.sso-fips.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS is enabled but this partition does not support FIPS\")\n\t\t\t}\n\t\t\tif _UseDualStack == true {\n\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://portal.sso.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"DualStack is enabled but this partition does not support DualStack\")\n\t\t\t}\n\t\t\turiString := func() string {\n\t\t\t\tvar out strings.Builder\n\t\t\t\tout.WriteString(\"https://portal.sso.\")\n\t\t\t\tout.WriteString(_Region)\n\t\t\t\tout.WriteString(\".\")\n\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\treturn out.String()\n\t\t\t}()\n\n\t\t\turi, err := url.Parse(uriString)\n\t\t\tif err != nil {\n\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t}\n\n\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\tURI:     *uri,\n\t\t\t\tHeaders: http.Header{},\n\t\t\t}, nil\n\t\t}\n\t\treturn endpoint, fmt.Errorf(\"Endpoint resolution failed. Invalid operation or environment input.\")\n\t}\n\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Missing Region\")\n}\n\ntype endpointParamsBinder interface {\n\tbindEndpointParams(*EndpointParameters)\n}\n\nfunc bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters {\n\tparams := &EndpointParameters{}\n\n\tparams.Region = bindRegion(options.Region)\n\tparams.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)\n\tparams.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)\n\tparams.Endpoint = options.BaseEndpoint\n\n\tif b, ok := input.(endpointParamsBinder); ok {\n\t\tb.bindEndpointParams(params)\n\t}\n\n\treturn params\n}\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\tif err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"invalid accountID set: %w\", err)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.options.EndpointResolverV2 == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\tparams := bindEndpointParams(ctx, getOperationInput(ctx), m.options)\n\tendpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\tif endpt.URI.RawPath == \"\" && req.URL.RawPath != \"\" {\n\t\tendpt.URI.RawPath = endpt.URI.Path\n\t}\n\treq.URL.Scheme = endpt.URI.Scheme\n\treq.URL.Host = endpt.URI.Host\n\treq.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)\n\treq.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)\n\tfor k := range endpt.Headers {\n\t\treq.Header.Set(k, endpt.Headers.Get(k))\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\topts, _ := smithyauth.GetAuthOptions(&endpt.Properties)\n\tfor _, o := range opts {\n\t\trscheme.SignerProperties.SetAll(&o.SignerProperties)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_GetRoleCredentials.go\",\n        \"api_op_ListAccountRoles.go\",\n        \"api_op_ListAccounts.go\",\n        \"api_op_Logout.go\",\n        \"auth.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"endpoints_config_test.go\",\n        \"endpoints_test.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"options.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"snapshot_test.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/sso\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage sso\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.22.4\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver SSO endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsIsoF  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoF:  regexp.MustCompile(\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"af-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.af-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"af-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-northeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-northeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-northeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-southeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-southeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-southeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ap-southeast-4.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ca-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.ca-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-central-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-north-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.eu-west-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"il-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.il-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"il-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.me-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.me-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.sa-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.cn-north-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.cn-northwest-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-f\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoF,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"portal.sso.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"portal.sso.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n)\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Indicates how aws account ID is applied in endpoint2.0 routing\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n\n\t// The optional application specific identifier appended to the User-Agent header.\n\tAppID string\n\n\t// This endpoint will be given as input to an EndpointResolverV2. It is used for\n\t// providing a custom base endpoint that is subject to modifications by the\n\t// processing EndpointResolverV2.\n\tBaseEndpoint *string\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\t//\n\t// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a\n\t// value for this field will likely prevent you from using any endpoint-related\n\t// service features released after the introduction of EndpointResolverV2 and\n\t// BaseEndpoint.\n\t//\n\t// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n\t// the client option BaseEndpoint instead.\n\tEndpointResolver EndpointResolver\n\n\t// Resolves the endpoint used for a particular service operation. This should be\n\t// used over the deprecated EndpointResolver.\n\tEndpointResolverV2 EndpointResolverV2\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts.\n\t//\n\t// If specified in an operation call's functional options with a value that is\n\t// different than the constructed client's Options, the Client's Retryer will be\n\t// wrapped to use the operation's specific RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified.\n\t//\n\t// When creating a new API Clients this member will only be used if the Retryer\n\t// Options member is nil. This value will be ignored if Retryer is not nil.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// The auth scheme resolver which determines how to authenticate for each\n\t// operation.\n\tAuthSchemeResolver AuthSchemeResolver\n\n\t// The list of auth schemes supported by the client.\n\tAuthSchemes []smithyhttp.AuthScheme\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\n\nfunc (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {\n\tif schemeID == \"aws.auth#sigv4\" {\n\t\treturn getSigV4IdentityResolver(o)\n\t}\n\tif schemeID == \"smithy.api#noAuth\" {\n\t\treturn &smithyauth.AnonymousIdentityResolver{}\n\t}\n\treturn nil\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for\n// this field will likely prevent you from using any endpoint-related service\n// features released after the introduction of EndpointResolverV2 and BaseEndpoint.\n//\n// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n// the client option BaseEndpoint instead.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\n// WithEndpointResolverV2 returns a functional option for setting the Client's\n// EndpointResolverV2 option.\nfunc WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolverV2 = v\n\t}\n}\n\nfunc getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {\n\tif o.Credentials != nil {\n\t\treturn &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}\n\t}\n\treturn nil\n}\n\n// WithSigV4SigningName applies an override to the authentication workflow to\n// use the given signing name for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing name from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningName(name string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningName\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\n// WithSigV4SigningRegion applies an override to the authentication workflow to\n// use the given signing region for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing region from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningRegion(region string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningRegion\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\nfunc ignoreAnonymousAuth(options *Options) {\n\tif aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {\n\t\toptions.Credentials = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\ntype awsRestjson1_serializeOpGetRoleCredentials struct {\n}\n\nfunc (*awsRestjson1_serializeOpGetRoleCredentials) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetRoleCredentialsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/federation/credentials\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"GET\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif err := awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(input, restEncoder); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(v *GetRoleCredentialsInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\tif v.AccessToken != nil && len(*v.AccessToken) > 0 {\n\t\tlocationName := \"X-Amz-Sso_bearer_token\"\n\t\tencoder.SetHeader(locationName).String(*v.AccessToken)\n\t}\n\n\tif v.AccountId != nil {\n\t\tencoder.SetQuery(\"account_id\").String(*v.AccountId)\n\t}\n\n\tif v.RoleName != nil {\n\t\tencoder.SetQuery(\"role_name\").String(*v.RoleName)\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpListAccountRoles struct {\n}\n\nfunc (*awsRestjson1_serializeOpListAccountRoles) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListAccountRolesInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/assignment/roles\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"GET\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif err := awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(input, restEncoder); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(v *ListAccountRolesInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\tif v.AccessToken != nil && len(*v.AccessToken) > 0 {\n\t\tlocationName := \"X-Amz-Sso_bearer_token\"\n\t\tencoder.SetHeader(locationName).String(*v.AccessToken)\n\t}\n\n\tif v.AccountId != nil {\n\t\tencoder.SetQuery(\"account_id\").String(*v.AccountId)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tencoder.SetQuery(\"max_result\").Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tencoder.SetQuery(\"next_token\").String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpListAccounts struct {\n}\n\nfunc (*awsRestjson1_serializeOpListAccounts) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*ListAccountsInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/assignment/accounts\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"GET\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif err := awsRestjson1_serializeOpHttpBindingsListAccountsInput(input, restEncoder); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsListAccountsInput(v *ListAccountsInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\tif v.AccessToken != nil && len(*v.AccessToken) > 0 {\n\t\tlocationName := \"X-Amz-Sso_bearer_token\"\n\t\tencoder.SetHeader(locationName).String(*v.AccessToken)\n\t}\n\n\tif v.MaxResults != nil {\n\t\tencoder.SetQuery(\"max_result\").Integer(*v.MaxResults)\n\t}\n\n\tif v.NextToken != nil {\n\t\tencoder.SetQuery(\"next_token\").String(*v.NextToken)\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpLogout struct {\n}\n\nfunc (*awsRestjson1_serializeOpLogout) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*LogoutInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/logout\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"POST\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif err := awsRestjson1_serializeOpHttpBindingsLogoutInput(input, restEncoder); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsLogoutInput(v *LogoutInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\tif v.AccessToken != nil && len(*v.AccessToken) > 0 {\n\t\tlocationName := \"X-Amz-Sso_bearer_token\"\n\t\tencoder.SetHeader(locationName).String(*v.AccessToken)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// Indicates that a problem occurred with the input to the request. For example, a\n// required parameter might be missing or out of range.\ntype InvalidRequestException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidRequestException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidRequestException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidRequestException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidRequestException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The specified resource doesn't exist.\ntype ResourceNotFoundException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ResourceNotFoundException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ResourceNotFoundException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ResourceNotFoundException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ResourceNotFoundException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the request is being made too frequently and is more than what\n// the server can handle.\ntype TooManyRequestsException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *TooManyRequestsException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *TooManyRequestsException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *TooManyRequestsException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"TooManyRequestsException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the request is not authorized. This can happen due to an invalid\n// access token in the request.\ntype UnauthorizedException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnauthorizedException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnauthorizedException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnauthorizedException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnauthorizedException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n)\n\n// Provides information about your AWS account.\ntype AccountInfo struct {\n\n\t// The identifier of the AWS account that is assigned to the user.\n\tAccountId *string\n\n\t// The display name of the AWS account that is assigned to the user.\n\tAccountName *string\n\n\t// The email address of the AWS account that is assigned to the user.\n\tEmailAddress *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Provides information about the role credentials that are assigned to the user.\ntype RoleCredentials struct {\n\n\t// The identifier used for the temporary security credentials. For more\n\t// information, see [Using Temporary Security Credentials to Request Access to AWS Resources]in the AWS IAM User Guide.\n\t//\n\t// [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html\n\tAccessKeyId *string\n\n\t// The date on which temporary security credentials expire.\n\tExpiration int64\n\n\t// The key that is used to sign the request. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS\n\t// IAM User Guide.\n\t//\n\t// [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html\n\tSecretAccessKey *string\n\n\t// The token used for temporary credentials. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS\n\t// IAM User Guide.\n\t//\n\t// [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html\n\tSessionToken *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Provides information about the role that is assigned to the user.\ntype RoleInfo struct {\n\n\t// The identifier of the AWS account assigned to the user.\n\tAccountId *string\n\n\t// The friendly name of the role that is assigned to the user.\n\tRoleName *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sso\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpGetRoleCredentials struct {\n}\n\nfunc (*validateOpGetRoleCredentials) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetRoleCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetRoleCredentialsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetRoleCredentialsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListAccountRoles struct {\n}\n\nfunc (*validateOpListAccountRoles) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListAccountRoles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListAccountRolesInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListAccountRolesInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpListAccounts struct {\n}\n\nfunc (*validateOpListAccounts) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpListAccounts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*ListAccountsInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpListAccountsInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpLogout struct {\n}\n\nfunc (*validateOpLogout) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpLogout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*LogoutInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpLogoutInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpGetRoleCredentialsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetRoleCredentials{}, middleware.After)\n}\n\nfunc addOpListAccountRolesValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListAccountRoles{}, middleware.After)\n}\n\nfunc addOpListAccountsValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpListAccounts{}, middleware.After)\n}\n\nfunc addOpLogoutValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpLogout{}, middleware.After)\n}\n\nfunc validateOpGetRoleCredentialsInput(v *GetRoleCredentialsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetRoleCredentialsInput\"}\n\tif v.RoleName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleName\"))\n\t}\n\tif v.AccountId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccountId\"))\n\t}\n\tif v.AccessToken == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccessToken\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListAccountRolesInput(v *ListAccountRolesInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListAccountRolesInput\"}\n\tif v.AccessToken == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccessToken\"))\n\t}\n\tif v.AccountId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccountId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpListAccountsInput(v *ListAccountsInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"ListAccountsInput\"}\n\tif v.AccessToken == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccessToken\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpLogoutInput(v *LogoutInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"LogoutInput\"}\n\tif v.AccessToken == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccessToken\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md",
    "content": "# v1.26.4 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.3 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.2 (2024-07-03)\n\n* No change notes available for this release.\n\n# v1.26.1 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.0 (2024-06-26)\n\n* **Feature**: Support list-of-string endpoint parameter.\n\n# v1.25.1 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.0 (2024-06-18)\n\n* **Feature**: Track usage of various AWS SDK features in user-agent string.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.6 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.5 (2024-06-07)\n\n* **Bug Fix**: Add clock skew correction on all service clients\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.4 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.3 (2024-05-23)\n\n* No change notes available for this release.\n\n# v1.24.2 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.1 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.0 (2024-05-10)\n\n* **Feature**: Updated request parameters for PKCE support.\n\n# v1.23.5 (2024-05-08)\n\n* **Bug Fix**: GoDoc improvement\n\n# v1.23.4 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.3 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.2 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.1 (2024-02-23)\n\n* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.0 (2024-02-22)\n\n* **Feature**: Add middleware stack snapshot tests.\n\n# v1.22.2 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.22.1 (2024-02-20)\n\n* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == \"\"`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `\"\"`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure.\n\n# v1.22.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.7 (2024-01-16)\n\n* No change notes available for this release.\n\n# v1.21.6 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.5 (2023-12-08)\n\n* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.\n\n# v1.21.4 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.3 (2023-12-06)\n\n* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.\n\n# v1.21.2 (2023-12-01)\n\n* **Bug Fix**: Correct wrapping of errors in authentication workflow.\n* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.1 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.0 (2023-11-29)\n\n* **Feature**: Expose Options() accessor on service clients.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.3 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.2 (2023-11-28)\n\n* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.\n\n# v1.20.1 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.0 (2023-11-17)\n\n* **Feature**: Adding support for `sso-oauth:CreateTokenWithIAM`.\n\n# v1.19.2 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.1 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.3 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.2 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.1 (2023-09-22)\n\n* No change notes available for this release.\n\n# v1.17.0 (2023-09-20)\n\n* **Feature**: Update FIPS endpoints in aws-us-gov.\n\n# v1.16.0 (2023-09-18)\n\n* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.\n* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.\n\n# v1.15.6 (2023-09-05)\n\n* No change notes available for this release.\n\n# v1.15.5 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.4 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.3 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.2 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.1 (2023-08-01)\n\n* No change notes available for this release.\n\n# v1.15.0 (2023-07-31)\n\n* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.14 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.13 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.12 (2023-06-15)\n\n* No change notes available for this release.\n\n# v1.14.11 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.10 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.14.9 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.8 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.14.7 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.6 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.5 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.4 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n\n# v1.14.3 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.2 (2023-02-15)\n\n* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.\n* **Bug Fix**: Correct error type parsing for restJson services.\n\n# v1.14.1 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.13.11 (2022-12-19)\n\n* No change notes available for this release.\n\n# v1.13.10 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.9 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.8 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.7 (2022-10-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.6 (2022-09-30)\n\n* **Documentation**: Documentation updates for the IAM Identity Center OIDC CLI Reference.\n\n# v1.13.5 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.4 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.3 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.2 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.1 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-08-25)\n\n* **Feature**: Updated required request parameters on IAM Identity Center's OIDC CreateToken action.\n\n# v1.12.14 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.13 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.12 (2022-08-08)\n\n* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.11 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.10 (2022-07-11)\n\n* No change notes available for this release.\n\n# v1.12.9 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.8 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.7 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.6 (2022-05-27)\n\n* No change notes available for this release.\n\n# v1.12.5 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.9.0 (2022-01-07)\n\n* **Feature**: API client updated\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.2 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-10-21)\n\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-10-11)\n\n* **Feature**: API client updated\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-09-17)\n\n* **Feature**: Updated API client and endpoints to latest revision.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-08-27)\n\n* **Feature**: Updated API model to latest revision.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.3 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.2 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.1 (2021-07-15)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.3.0 (2021-06-25)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.2.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalauth \"github.com/aws/aws-sdk-go-v2/internal/auth\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tinternalmiddleware \"github.com/aws/aws-sdk-go-v2/internal/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\nconst ServiceID = \"SSO OIDC\"\nconst ServiceAPIVersion = \"2019-06-10\"\n\n// Client provides the API client to make operations call for AWS SSO OIDC.\ntype Client struct {\n\toptions Options\n\n\t// Difference between the time reported by the server and the client\n\ttimeOffset *atomic.Int64\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveEndpointResolverV2(&options)\n\n\tresolveAuthSchemeResolver(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttempts(&options)\n\n\tignoreAnonymousAuth(&options)\n\n\twrapWithAnonymousAuth(&options)\n\n\tresolveAuthSchemes(&options)\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\tinitializeTimeOffsetResolver(client)\n\n\treturn client\n}\n\n// Options returns a copy of the client configuration.\n//\n// Callers SHOULD NOT perform mutations on any inner structures within client\n// config. Config overrides should instead be made on a per-operation basis through\n// functional options.\nfunc (c *Client) Options() Options {\n\treturn c.options.Copy()\n}\n\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeOperationRetryMaxAttempts(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype operationInputKey struct{}\n\nfunc setOperationInput(ctx context.Context, input interface{}) context.Context {\n\treturn middleware.WithStackValue(ctx, operationInputKey{}, input)\n}\n\nfunc getOperationInput(ctx context.Context) interface{} {\n\treturn middleware.GetStackValue(ctx, operationInputKey{})\n}\n\ntype setOperationInputMiddleware struct {\n}\n\nfunc (*setOperationInputMiddleware) ID() string {\n\treturn \"setOperationInput\"\n}\n\nfunc (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tctx = setOperationInput(ctx, in.Parameters)\n\treturn next.HandleSerialize(ctx, in)\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\nfunc resolveAuthSchemeResolver(options *Options) {\n\tif options.AuthSchemeResolver == nil {\n\t\toptions.AuthSchemeResolver = &defaultAuthSchemeResolver{}\n\t}\n}\n\nfunc resolveAuthSchemes(options *Options) {\n\tif options.AuthSchemes == nil {\n\t\toptions.AuthSchemes = []smithyhttp.AuthScheme{\n\t\t\tinternalauth.NewHTTPAuthScheme(\"aws.auth#sigv4\", &internalauthsmithy.V4SignerAdapter{\n\t\t\t\tSigner:     options.HTTPSignerV4,\n\t\t\t\tLogger:     options.Logger,\n\t\t\t\tLogSigning: options.ClientLogMode.IsSigning(),\n\t\t\t}),\n\t\t}\n\t}\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\ntype legacyEndpointContextSetter struct {\n\tLegacyResolver EndpointResolver\n}\n\nfunc (*legacyEndpointContextSetter) ID() string {\n\treturn \"legacyEndpointContextSetter\"\n}\n\nfunc (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.LegacyResolver != nil {\n\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)\n\t}\n\n\treturn next.HandleInitialize(ctx, in)\n\n}\nfunc addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {\n\treturn stack.Initialize.Add(&legacyEndpointContextSetter{\n\t\tLegacyResolver: o.EndpointResolver,\n\t}, middleware.Before)\n}\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:                cfg.Region,\n\t\tDefaultsMode:          cfg.DefaultsMode,\n\t\tRuntimeEnvironment:    cfg.RuntimeEnvironment,\n\t\tHTTPClient:            cfg.HTTPClient,\n\t\tCredentials:           cfg.Credentials,\n\t\tAPIOptions:            cfg.APIOptions,\n\t\tLogger:                cfg.Logger,\n\t\tClientLogMode:         cfg.ClientLogMode,\n\t\tAppID:                 cfg.AppID,\n\t\tAccountIDEndpointMode: cfg.AccountIDEndpointMode,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\tresolveBaseEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttempts(o *Options) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc finalizeOperationRetryMaxAttempts(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)\n}\n\nfunc addClientUserAgent(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"ssooidc\", goModuleVersion)\n\tif len(options.AppID) > 0 {\n\t\tua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)\n\t}\n\n\treturn nil\n}\n\nfunc getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) {\n\tid := (*awsmiddleware.RequestUserAgent)(nil).ID()\n\tmw, ok := stack.Build.Get(id)\n\tif !ok {\n\t\tmw = awsmiddleware.NewRequestUserAgent()\n\t\tif err := stack.Build.Add(mw, middleware.After); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tua, ok := mw.(*awsmiddleware.RequestUserAgent)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%T for %s middleware did not match expected type\", mw, id)\n\t}\n\n\treturn ua, nil\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc addClientRequestID(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)\n}\n\nfunc addComputeContentLength(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After)\n}\n\nfunc addRawResponseToMetadata(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)\n}\n\nfunc addRecordResponseTiming(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)\n}\nfunc addStreamingEventsPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before)\n}\n\nfunc addUnsignedPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.UnsignedPayload{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addComputePayloadSHA256(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addContentSHA256Header(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After)\n}\n\nfunc addIsWaiterUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter)\n\t\treturn nil\n\t})\n}\n\nfunc addIsPaginatorUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator)\n\t\treturn nil\n\t})\n}\n\nfunc addRetry(stack *middleware.Stack, o Options) error {\n\tattempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) {\n\t\tm.LogAttempts = o.ClientLogMode.IsRetries()\n\t})\n\tif err := stack.Finalize.Insert(attempt, \"Signing\", middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\nfunc resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string {\n\tif mode == aws.AccountIDEndpointModeDisabled {\n\t\treturn nil\n\t}\n\n\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != \"\" {\n\t\treturn aws.String(ca.Credentials.AccountID)\n\t}\n\n\treturn nil\n}\n\nfunc addTimeOffsetBuild(stack *middleware.Stack, c *Client) error {\n\tmw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset}\n\tif err := stack.Build.Add(&mw, middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn stack.Deserialize.Insert(&mw, \"RecordResponseTiming\", middleware.Before)\n}\nfunc initializeTimeOffsetResolver(c *Client) {\n\tc.timeOffset = new(atomic.Int64)\n}\n\nfunc checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error {\n\tswitch mode {\n\tcase aws.AccountIDEndpointModeUnset:\n\tcase aws.AccountIDEndpointModePreferred:\n\tcase aws.AccountIDEndpointModeDisabled:\n\tcase aws.AccountIDEndpointModeRequired:\n\t\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t} else if ca.Credentials.AccountID == \"\" {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t}\n\t// default check in case invalid mode is configured through request config\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid accountID endpoint mode %s, must be preferred/required/disabled\", mode)\n\t}\n\n\treturn nil\n}\n\nfunc addUserAgentRetryMode(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch options.Retryer.(type) {\n\tcase *retry.Standard:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard)\n\tcase *retry.AdaptiveMode:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive)\n\t}\n\treturn nil\n}\n\nfunc addRecursionDetection(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After)\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, \"OperationDeserializer\", middleware.Before)\n\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, \"RequestIDRetriever\", middleware.Before)\n\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n\ntype disableHTTPSMiddleware struct {\n\tDisableHTTPS bool\n}\n\nfunc (*disableHTTPSMiddleware) ID() string {\n\treturn \"disableHTTPS\"\n}\n\nfunc (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {\n\t\treq.URL.Scheme = \"http\"\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Finalize.Insert(&disableHTTPSMiddleware{\n\t\tDisableHTTPS: o.EndpointOptions.DisableHTTPS,\n\t}, \"ResolveEndpointV2\", middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates and returns access and refresh tokens for clients that are\n// authenticated using client secrets. The access token can be used to fetch\n// short-term credentials for the assigned AWS accounts or to access application\n// APIs using bearer authentication.\nfunc (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateToken\", params, optFns, c.addOperationCreateTokenMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateTokenInput struct {\n\n\t// The unique identifier string for the client or application. This value comes\n\t// from the result of the RegisterClientAPI.\n\t//\n\t// This member is required.\n\tClientId *string\n\n\t// A secret string generated for the client. This value should come from the\n\t// persisted result of the RegisterClientAPI.\n\t//\n\t// This member is required.\n\tClientSecret *string\n\n\t// Supports the following OAuth grant types: Device Code and Refresh Token.\n\t// Specify either of the following values, depending on the grant type that you\n\t// want:\n\t//\n\t// * Device Code - urn:ietf:params:oauth:grant-type:device_code\n\t//\n\t// * Refresh Token - refresh_token\n\t//\n\t// For information about how to obtain the device code, see the StartDeviceAuthorization topic.\n\t//\n\t// This member is required.\n\tGrantType *string\n\n\t// Used only when calling this API for the Authorization Code grant type. The\n\t// short-term code is used to identify this authorization request. This grant type\n\t// is currently unsupported for the CreateTokenAPI.\n\tCode *string\n\n\t// Used only when calling this API for the Authorization Code grant type. This\n\t// value is generated by the client and presented to validate the original code\n\t// challenge value the client passed at authorization time.\n\tCodeVerifier *string\n\n\t// Used only when calling this API for the Device Code grant type. This short-term\n\t// code is used to identify this authorization request. This comes from the result\n\t// of the StartDeviceAuthorizationAPI.\n\tDeviceCode *string\n\n\t// Used only when calling this API for the Authorization Code grant type. This\n\t// value specifies the location of the client or application that has registered to\n\t// receive the authorization code.\n\tRedirectUri *string\n\n\t// Used only when calling this API for the Refresh Token grant type. This token is\n\t// used to refresh short-term tokens, such as the access token, that might expire.\n\t//\n\t// For more information about the features and limitations of the current IAM\n\t// Identity Center OIDC implementation, see Considerations for Using this Guide in\n\t// the [IAM Identity Center OIDC API Reference].\n\t//\n\t// [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html\n\tRefreshToken *string\n\n\t// The list of scopes for which authorization is requested. The access token that\n\t// is issued is limited to the scopes that are granted. If this value is not\n\t// specified, IAM Identity Center authorizes all scopes that are configured for the\n\t// client during the call to RegisterClient.\n\tScope []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateTokenOutput struct {\n\n\t// A bearer token to access Amazon Web Services accounts and applications assigned\n\t// to a user.\n\tAccessToken *string\n\n\t// Indicates the time in seconds when an access token will expire.\n\tExpiresIn int32\n\n\t// The idToken is not implemented or supported. For more information about the\n\t// features and limitations of the current IAM Identity Center OIDC implementation,\n\t// see Considerations for Using this Guide in the [IAM Identity Center OIDC API Reference].\n\t//\n\t// A JSON Web Token (JWT) that identifies who is associated with the issued access\n\t// token.\n\t//\n\t// [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html\n\tIdToken *string\n\n\t// A token that, if present, can be used to refresh a previously issued access\n\t// token that might have expired.\n\t//\n\t// For more information about the features and limitations of the current IAM\n\t// Identity Center OIDC implementation, see Considerations for Using this Guide in\n\t// the [IAM Identity Center OIDC API Reference].\n\t//\n\t// [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html\n\tRefreshToken *string\n\n\t// Used to notify the client that the returned token is an access token. The\n\t// supported token type is Bearer .\n\tTokenType *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateToken\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateTokenValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateToken\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Creates and returns access and refresh tokens for clients and applications that\n// are authenticated using IAM entities. The access token can be used to fetch\n// short-term credentials for the assigned Amazon Web Services accounts or to\n// access application APIs using bearer authentication.\nfunc (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateTokenWithIAMInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateTokenWithIAM\", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateTokenWithIAMOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype CreateTokenWithIAMInput struct {\n\n\t// The unique identifier string for the client or application. This value is an\n\t// application ARN that has OAuth grants configured.\n\t//\n\t// This member is required.\n\tClientId *string\n\n\t// Supports the following OAuth grant types: Authorization Code, Refresh Token,\n\t// JWT Bearer, and Token Exchange. Specify one of the following values, depending\n\t// on the grant type that you want:\n\t//\n\t// * Authorization Code - authorization_code\n\t//\n\t// * Refresh Token - refresh_token\n\t//\n\t// * JWT Bearer - urn:ietf:params:oauth:grant-type:jwt-bearer\n\t//\n\t// * Token Exchange - urn:ietf:params:oauth:grant-type:token-exchange\n\t//\n\t// This member is required.\n\tGrantType *string\n\n\t// Used only when calling this API for the JWT Bearer grant type. This value\n\t// specifies the JSON Web Token (JWT) issued by a trusted token issuer. To\n\t// authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the\n\t// application.\n\tAssertion *string\n\n\t// Used only when calling this API for the Authorization Code grant type. This\n\t// short-term code is used to identify this authorization request. The code is\n\t// obtained through a redirect from IAM Identity Center to a redirect URI persisted\n\t// in the Authorization Code GrantOptions for the application.\n\tCode *string\n\n\t// Used only when calling this API for the Authorization Code grant type. This\n\t// value is generated by the client and presented to validate the original code\n\t// challenge value the client passed at authorization time.\n\tCodeVerifier *string\n\n\t// Used only when calling this API for the Authorization Code grant type. This\n\t// value specifies the location of the client or application that has registered to\n\t// receive the authorization code.\n\tRedirectUri *string\n\n\t// Used only when calling this API for the Refresh Token grant type. This token is\n\t// used to refresh short-term tokens, such as the access token, that might expire.\n\t//\n\t// For more information about the features and limitations of the current IAM\n\t// Identity Center OIDC implementation, see Considerations for Using this Guide in\n\t// the [IAM Identity Center OIDC API Reference].\n\t//\n\t// [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html\n\tRefreshToken *string\n\n\t// Used only when calling this API for the Token Exchange grant type. This value\n\t// specifies the type of token that the requester can receive. The following values\n\t// are supported:\n\t//\n\t// * Access Token - urn:ietf:params:oauth:token-type:access_token\n\t//\n\t// * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token\n\tRequestedTokenType *string\n\n\t// The list of scopes for which authorization is requested. The access token that\n\t// is issued is limited to the scopes that are granted. If the value is not\n\t// specified, IAM Identity Center authorizes all scopes configured for the\n\t// application, including the following default scopes: openid , aws ,\n\t// sts:identity_context .\n\tScope []string\n\n\t// Used only when calling this API for the Token Exchange grant type. This value\n\t// specifies the subject of the exchange. The value of the subject token must be an\n\t// access token issued by IAM Identity Center to a different client or application.\n\t// The access token must have authorized scopes that indicate the requested\n\t// application as a target audience.\n\tSubjectToken *string\n\n\t// Used only when calling this API for the Token Exchange grant type. This value\n\t// specifies the type of token that is passed as the subject of the exchange. The\n\t// following value is supported:\n\t//\n\t// * Access Token - urn:ietf:params:oauth:token-type:access_token\n\tSubjectTokenType *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype CreateTokenWithIAMOutput struct {\n\n\t// A bearer token to access Amazon Web Services accounts and applications assigned\n\t// to a user.\n\tAccessToken *string\n\n\t// Indicates the time in seconds when an access token will expire.\n\tExpiresIn int32\n\n\t// A JSON Web Token (JWT) that identifies the user associated with the issued\n\t// access token.\n\tIdToken *string\n\n\t// Indicates the type of tokens that are issued by IAM Identity Center. The\n\t// following values are supported:\n\t//\n\t// * Access Token - urn:ietf:params:oauth:token-type:access_token\n\t//\n\t// * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token\n\tIssuedTokenType *string\n\n\t// A token that, if present, can be used to refresh a previously issued access\n\t// token that might have expired.\n\t//\n\t// For more information about the features and limitations of the current IAM\n\t// Identity Center OIDC implementation, see Considerations for Using this Guide in\n\t// the [IAM Identity Center OIDC API Reference].\n\t//\n\t// [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html\n\tRefreshToken *string\n\n\t// The list of scopes for which authorization is granted. The access token that is\n\t// issued is limited to the scopes that are granted.\n\tScope []string\n\n\t// Used to notify the requester that the returned token is an access token. The\n\t// supported token type is Bearer .\n\tTokenType *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"CreateTokenWithIAM\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"CreateTokenWithIAM\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Registers a client with IAM Identity Center. This allows clients to initiate\n// device authorization. The output should be persisted for reuse through many\n// authentication requests.\nfunc (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) {\n\tif params == nil {\n\t\tparams = &RegisterClientInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"RegisterClient\", params, optFns, c.addOperationRegisterClientMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*RegisterClientOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype RegisterClientInput struct {\n\n\t// The friendly name of the client.\n\t//\n\t// This member is required.\n\tClientName *string\n\n\t// The type of client. The service supports only public as a client type. Anything\n\t// other than public will be rejected by the service.\n\t//\n\t// This member is required.\n\tClientType *string\n\n\t// This IAM Identity Center application ARN is used to define\n\t// administrator-managed configuration for public client access to resources. At\n\t// authorization, the scopes, grants, and redirect URI available to this client\n\t// will be restricted by this application resource.\n\tEntitledApplicationArn *string\n\n\t// The list of OAuth 2.0 grant types that are defined by the client. This list is\n\t// used to restrict the token granting flows available to the client.\n\tGrantTypes []string\n\n\t// The IAM Identity Center Issuer URL associated with an instance of IAM Identity\n\t// Center. This value is needed for user access to resources through the client.\n\tIssuerUrl *string\n\n\t// The list of redirect URI that are defined by the client. At completion of\n\t// authorization, this list is used to restrict what locations the user agent can\n\t// be redirected back to.\n\tRedirectUris []string\n\n\t// The list of scopes that are defined by the client. Upon authorization, this\n\t// list is used to restrict permissions when granting an access token.\n\tScopes []string\n\n\tnoSmithyDocumentSerde\n}\n\ntype RegisterClientOutput struct {\n\n\t// An endpoint that the client can use to request authorization.\n\tAuthorizationEndpoint *string\n\n\t// The unique identifier string for each client. This client uses this identifier\n\t// to get authenticated by the service in subsequent calls.\n\tClientId *string\n\n\t// Indicates the time at which the clientId and clientSecret were issued.\n\tClientIdIssuedAt int64\n\n\t// A secret string generated for the client. The client will use this string to\n\t// get authenticated by the service in subsequent calls.\n\tClientSecret *string\n\n\t// Indicates the time at which the clientId and clientSecret will become invalid.\n\tClientSecretExpiresAt int64\n\n\t// An endpoint that the client can use to create tokens.\n\tTokenEndpoint *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"RegisterClient\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpRegisterClientValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"RegisterClient\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Initiates device authorization by requesting a pair of verification codes from\n// the authorization service.\nfunc (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDeviceAuthorizationInput, optFns ...func(*Options)) (*StartDeviceAuthorizationOutput, error) {\n\tif params == nil {\n\t\tparams = &StartDeviceAuthorizationInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartDeviceAuthorization\", params, optFns, c.addOperationStartDeviceAuthorizationMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartDeviceAuthorizationOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype StartDeviceAuthorizationInput struct {\n\n\t// The unique identifier string for the client that is registered with IAM\n\t// Identity Center. This value should come from the persisted result of the RegisterClientAPI\n\t// operation.\n\t//\n\t// This member is required.\n\tClientId *string\n\n\t// A secret string that is generated for the client. This value should come from\n\t// the persisted result of the RegisterClientAPI operation.\n\t//\n\t// This member is required.\n\tClientSecret *string\n\n\t// The URL for the Amazon Web Services access portal. For more information, see [Using the Amazon Web Services access portal]\n\t// in the IAM Identity Center User Guide.\n\t//\n\t// [Using the Amazon Web Services access portal]: https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html\n\t//\n\t// This member is required.\n\tStartUrl *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype StartDeviceAuthorizationOutput struct {\n\n\t// The short-lived code that is used by the device when polling for a session\n\t// token.\n\tDeviceCode *string\n\n\t// Indicates the number of seconds in which the verification code will become\n\t// invalid.\n\tExpiresIn int32\n\n\t// Indicates the number of seconds the client must wait between attempts when\n\t// polling for a session.\n\tInterval int32\n\n\t// A one-time user verification code. This is needed to authorize an in-use device.\n\tUserCode *string\n\n\t// The URI of the verification page that takes the userCode to authorize the\n\t// device.\n\tVerificationUri *string\n\n\t// An alternate URL that the client can use to automatically launch a browser.\n\t// This process skips the manual step in which the user visits the verification\n\t// page and enters their code.\n\tVerificationUriComplete *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"StartDeviceAuthorization\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeviceAuthorization(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opStartDeviceAuthorization(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"StartDeviceAuthorization\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nfunc bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) {\n\tparams.Region = options.Region\n}\n\ntype setLegacyContextSigningOptionsMiddleware struct {\n}\n\nfunc (*setLegacyContextSigningOptionsMiddleware) ID() string {\n\treturn \"setLegacyContextSigningOptions\"\n}\n\nfunc (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tschemeID := rscheme.Scheme.SchemeID()\n\n\tif sn := awsmiddleware.GetSigningName(ctx); sn != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)\n\t\t}\n\t}\n\n\tif sr := awsmiddleware.GetSigningRegion(ctx); sr != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})\n\t\t}\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, \"Signing\", middleware.Before)\n}\n\ntype withAnonymous struct {\n\tresolver AuthSchemeResolver\n}\n\nvar _ AuthSchemeResolver = (*withAnonymous)(nil)\n\nfunc (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\topts, err := v.resolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts = append(opts, &smithyauth.Option{\n\t\tSchemeID: smithyauth.SchemeIDAnonymous,\n\t})\n\treturn opts, nil\n}\n\nfunc wrapWithAnonymousAuth(options *Options) {\n\tif _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {\n\t\treturn\n\t}\n\n\toptions.AuthSchemeResolver = &withAnonymous{\n\t\tresolver: options.AuthSchemeResolver,\n\t}\n}\n\n// AuthResolverParameters contains the set of inputs necessary for auth scheme\n// resolution.\ntype AuthResolverParameters struct {\n\t// The name of the operation being invoked.\n\tOperation string\n\n\t// The region in which the operation is being invoked.\n\tRegion string\n}\n\nfunc bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters {\n\tparams := &AuthResolverParameters{\n\t\tOperation: operation,\n\t}\n\n\tbindAuthParamsRegion(ctx, params, input, options)\n\n\treturn params\n}\n\n// AuthSchemeResolver returns a set of possible authentication options for an\n// operation.\ntype AuthSchemeResolver interface {\n\tResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)\n}\n\ntype defaultAuthSchemeResolver struct{}\n\nvar _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)\n\nfunc (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\tif overrides, ok := operationAuthOptions[params.Operation]; ok {\n\t\treturn overrides(params), nil\n\t}\n\treturn serviceAuthOptions(params), nil\n}\n\nvar operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{\n\t\"CreateToken\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"RegisterClient\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"StartDeviceAuthorization\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n}\n\nfunc serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {\n\treturn []*smithyauth.Option{\n\t\t{\n\t\t\tSchemeID: smithyauth.SchemeIDSigV4,\n\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\tvar props smithy.Properties\n\t\t\t\tsmithyhttp.SetSigV4SigningName(&props, \"sso-oauth\")\n\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&props, params.Region)\n\t\t\t\treturn props\n\t\t\t}(),\n\t\t},\n\t}\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tparams := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options)\n\toptions, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"resolve auth scheme: %w\", err)\n\t}\n\n\tscheme, ok := m.selectScheme(options)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"could not select an auth scheme\")\n\t}\n\n\tctx = setResolvedAuthScheme(ctx, scheme)\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {\n\tfor _, option := range options {\n\t\tif option.SchemeID == smithyauth.SchemeIDAnonymous {\n\t\t\treturn newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true\n\t\t}\n\n\t\tfor _, scheme := range m.options.AuthSchemes {\n\t\t\tif scheme.SchemeID() != option.SchemeID {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif scheme.IdentityResolver(m.options) != nil {\n\t\t\t\treturn newResolvedAuthScheme(scheme, option), true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, false\n}\n\ntype resolvedAuthSchemeKey struct{}\n\ntype resolvedAuthScheme struct {\n\tScheme             smithyhttp.AuthScheme\n\tIdentityProperties smithy.Properties\n\tSignerProperties   smithy.Properties\n}\n\nfunc newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {\n\treturn &resolvedAuthScheme{\n\t\tScheme:             scheme,\n\t\tIdentityProperties: option.IdentityProperties,\n\t\tSignerProperties:   option.SignerProperties,\n\t}\n}\n\nfunc setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {\n\treturn middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)\n}\n\nfunc getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {\n\tv, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)\n\treturn v\n}\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tresolver := rscheme.Scheme.IdentityResolver(m.options)\n\tif resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity resolver\")\n\t}\n\n\tidentity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"get identity: %w\", err)\n\t}\n\n\tctx = setIdentity(ctx, identity)\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype identityKey struct{}\n\nfunc setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {\n\treturn middleware.WithStackValue(ctx, identityKey{}, identity)\n}\n\nfunc getIdentity(ctx context.Context) smithyauth.Identity {\n\tv, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)\n\treturn v\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unexpected transport type %T\", in.Request)\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tidentity := getIdentity(ctx)\n\tif identity == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity\")\n\t}\n\n\tsigner := rscheme.Scheme.Signer()\n\tif signer == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no signer\")\n\t}\n\n\tif err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"sign request: %w\", err)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ssooidc/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc deserializeS3Expires(v string) (*time.Time, error) {\n\tt, err := smithytime.ParseHTTPDate(v)\n\tif err != nil {\n\t\treturn nil, nil\n\t}\n\treturn &t, nil\n}\n\ntype awsRestjson1_deserializeOpCreateToken struct {\n}\n\nfunc (*awsRestjson1_deserializeOpCreateToken) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpCreateToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorCreateToken(response, &metadata)\n\t}\n\toutput := &CreateTokenOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentCreateTokenOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorCreateToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AccessDeniedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)\n\n\tcase strings.EqualFold(\"AuthorizationPendingException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody)\n\n\tcase strings.EqualFold(\"ExpiredTokenException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInternalServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidClientException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidGrantException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidScopeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody)\n\n\tcase strings.EqualFold(\"SlowDownException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorSlowDownException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedGrantTypeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateTokenOutput\n\tif *v == nil {\n\t\tsv = &CreateTokenOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accessToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccessToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccessToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiresIn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationInSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ExpiresIn = int32(i64)\n\t\t\t}\n\n\t\tcase \"idToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IdToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IdToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"refreshToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RefreshToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RefreshToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"tokenType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TokenType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TokenType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpCreateTokenWithIAM struct {\n}\n\nfunc (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response, &metadata)\n\t}\n\toutput := &CreateTokenWithIAMOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"AccessDeniedException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)\n\n\tcase strings.EqualFold(\"AuthorizationPendingException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody)\n\n\tcase strings.EqualFold(\"ExpiredTokenException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"InternalServerException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInternalServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidClientException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidGrantException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRequestRegionException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidScopeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody)\n\n\tcase strings.EqualFold(\"SlowDownException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorSlowDownException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedGrantTypeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *CreateTokenWithIAMOutput\n\tif *v == nil {\n\t\tsv = &CreateTokenWithIAMOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"accessToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected AccessToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AccessToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiresIn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationInSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ExpiresIn = int32(i64)\n\t\t\t}\n\n\t\tcase \"idToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IdToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IdToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"issuedTokenType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TokenTypeURI to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.IssuedTokenType = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"refreshToken\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected RefreshToken to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.RefreshToken = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"scope\":\n\t\t\tif err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase \"tokenType\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected TokenType to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TokenType = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpRegisterClient struct {\n}\n\nfunc (*awsRestjson1_deserializeOpRegisterClient) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpRegisterClient) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorRegisterClient(response, &metadata)\n\t}\n\toutput := &RegisterClientOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentRegisterClientOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorRegisterClient(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInternalServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidClientMetadataException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidClientMetadataException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRedirectUriException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRedirectUriException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidScopeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnsupportedGrantTypeException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentRegisterClientOutput(v **RegisterClientOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *RegisterClientOutput\n\tif *v == nil {\n\t\tsv = &RegisterClientOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"authorizationEndpoint\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected URI to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.AuthorizationEndpoint = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"clientId\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ClientId to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ClientId = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"clientIdIssuedAt\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LongTimeStampType to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ClientIdIssuedAt = i64\n\t\t\t}\n\n\t\tcase \"clientSecret\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ClientSecret to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.ClientSecret = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"clientSecretExpiresAt\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected LongTimeStampType to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ClientSecretExpiresAt = i64\n\t\t\t}\n\n\t\tcase \"tokenEndpoint\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected URI to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.TokenEndpoint = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\ntype awsRestjson1_deserializeOpStartDeviceAuthorization struct {\n}\n\nfunc (*awsRestjson1_deserializeOpStartDeviceAuthorization) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsRestjson1_deserializeOpStartDeviceAuthorization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response, &metadata)\n\t}\n\toutput := &StartDeviceAuthorizationOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\terr = awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(&output, shape)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body with invalid JSON, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\theaderCode := response.Header.Get(\"X-Amzn-ErrorType\")\n\tif len(headerCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(headerCode)\n\t}\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tjsonCode, message, err := restjson.GetErrorInfo(decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\tif len(headerCode) == 0 && len(jsonCode) != 0 {\n\t\terrorCode = restjson.SanitizeErrorCode(jsonCode)\n\t}\n\tif len(message) != 0 {\n\t\terrorMessage = message\n\t}\n\n\tswitch {\n\tcase strings.EqualFold(\"InternalServerException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInternalServerException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidClientException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidRequestException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)\n\n\tcase strings.EqualFold(\"SlowDownException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorSlowDownException(response, errorBody)\n\n\tcase strings.EqualFold(\"UnauthorizedClientException\", errorCode):\n\t\treturn awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(v **StartDeviceAuthorizationOutput, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *StartDeviceAuthorizationOutput\n\tif *v == nil {\n\t\tsv = &StartDeviceAuthorizationOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"deviceCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected DeviceCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.DeviceCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"expiresIn\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ExpirationInSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.ExpiresIn = int32(i64)\n\t\t\t}\n\n\t\tcase \"interval\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(json.Number)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected IntervalInSeconds to be json.Number, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\ti64, err := jtv.Int64()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Interval = int32(i64)\n\t\t\t}\n\n\t\tcase \"userCode\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected UserCode to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.UserCode = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"verificationUri\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected URI to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VerificationUri = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"verificationUriComplete\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected URI to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.VerificationUriComplete = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.AccessDeniedException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorAuthorizationPendingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.AuthorizationPendingException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentAuthorizationPendingException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.ExpiredTokenException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentExpiredTokenException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InternalServerException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidClientException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidClientException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidClientMetadataException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidClientMetadataException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidClientMetadataException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidGrantException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidGrantException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidGrantException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidRedirectUriException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidRedirectUriException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidRedirectUriException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidRequestException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidRequestRegionException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidRequestRegionException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidScopeException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentInvalidScopeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorSlowDownException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.SlowDownException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentSlowDownException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.UnauthorizedClientException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentUnauthorizedClientException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.UnsupportedGrantTypeException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\tdecoder := json.NewDecoder(body)\n\tdecoder.UseNumber()\n\tvar shape interface{}\n\tif err := decoder.Decode(&shape); err != nil && err != io.EOF {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terr := awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(&output, shape)\n\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn err\n\t}\n\n\terrorBody.Seek(0, io.SeekStart)\n\n\treturn output\n}\n\nfunc awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AccessDeniedException\n\tif *v == nil {\n\t\tsv = &types.AccessDeniedException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentAuthorizationPendingException(v **types.AuthorizationPendingException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.AuthorizationPendingException\n\tif *v == nil {\n\t\tsv = &types.AuthorizationPendingException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.ExpiredTokenException\n\tif *v == nil {\n\t\tsv = &types.ExpiredTokenException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InternalServerException\n\tif *v == nil {\n\t\tsv = &types.InternalServerException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidClientException(v **types.InvalidClientException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidClientException\n\tif *v == nil {\n\t\tsv = &types.InvalidClientException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidClientMetadataException(v **types.InvalidClientMetadataException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidClientMetadataException\n\tif *v == nil {\n\t\tsv = &types.InvalidClientMetadataException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidGrantException(v **types.InvalidGrantException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidGrantException\n\tif *v == nil {\n\t\tsv = &types.InvalidGrantException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidRedirectUriException(v **types.InvalidRedirectUriException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidRedirectUriException\n\tif *v == nil {\n\t\tsv = &types.InvalidRedirectUriException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidRequestException\n\tif *v == nil {\n\t\tsv = &types.InvalidRequestException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidRequestRegionException\n\tif *v == nil {\n\t\tsv = &types.InvalidRequestRegionException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"endpoint\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Location to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Endpoint = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"region\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Region to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Region = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.InvalidScopeException\n\tif *v == nil {\n\t\tsv = &types.InvalidScopeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentScopes(v *[]string, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar cv []string\n\tif *v == nil {\n\t\tcv = []string{}\n\t} else {\n\t\tcv = *v\n\t}\n\n\tfor _, value := range shape {\n\t\tvar col string\n\t\tif value != nil {\n\t\t\tjtv, ok := value.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected Scope to be of type string, got %T instead\", value)\n\t\t\t}\n\t\t\tcol = jtv\n\t\t}\n\t\tcv = append(cv, col)\n\n\t}\n\t*v = cv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.SlowDownException\n\tif *v == nil {\n\t\tsv = &types.SlowDownException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnauthorizedClientException\n\tif *v == nil {\n\t\tsv = &types.UnauthorizedClientException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(v **types.UnsupportedGrantTypeException, value interface{}) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tif value == nil {\n\t\treturn nil\n\t}\n\n\tshape, ok := value.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected JSON type %v\", value)\n\t}\n\n\tvar sv *types.UnsupportedGrantTypeException\n\tif *v == nil {\n\t\tsv = &types.UnsupportedGrantTypeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor key, value := range shape {\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected Error to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_ = ptr.String(jtv)\n\t\t\t}\n\n\t\tcase \"error_description\":\n\t\t\tif value != nil {\n\t\t\t\tjtv, ok := value.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected ErrorDescription to be of type string, got %T instead\", value)\n\t\t\t\t}\n\t\t\t\tsv.Error_description = ptr.String(jtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t_, _ = key, value\n\n\t\t}\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package ssooidc provides the API client, operations, and parameter types for\n// AWS SSO OIDC.\n//\n// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a\n// client (such as CLI or a native application) to register with IAM Identity\n// Center. The service also enables the client to fetch the user’s access token\n// upon successful authentication and authorization with IAM Identity Center.\n//\n// IAM Identity Center uses the sso and identitystore API namespaces.\n//\n// # Considerations for Using This Guide\n//\n// Before you begin using this guide, we recommend that you first review the\n// following important information about how the IAM Identity Center OIDC service\n// works.\n//\n//   - The IAM Identity Center OIDC service currently implements only the portions\n//     of the OAuth 2.0 Device Authorization Grant standard ([https://tools.ietf.org/html/rfc8628] ) that are necessary to\n//     enable single sign-on authentication with the CLI.\n//\n//   - With older versions of the CLI, the service only emits OIDC access tokens,\n//     so to obtain a new token, users must explicitly re-authenticate. To access the\n//     OIDC flow that supports token refresh and doesn’t require re-authentication,\n//     update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with\n//     support for OIDC token refresh and configurable IAM Identity Center session\n//     durations. For more information, see [Configure Amazon Web Services access portal session duration].\n//\n//   - The access tokens provided by this service grant access to all Amazon Web\n//     Services account entitlements assigned to an IAM Identity Center user, not just\n//     a particular application.\n//\n//   - The documentation in this guide does not describe the mechanism to convert\n//     the access token into Amazon Web Services Auth (“sigv4”) credentials for use\n//     with IAM-protected Amazon Web Services service endpoints. For more information,\n//     see [GetRoleCredentials]in the IAM Identity Center Portal API Reference Guide.\n//\n// For general information about IAM Identity Center, see [What is IAM Identity Center?] in the IAM Identity\n// Center User Guide.\n//\n// [Configure Amazon Web Services access portal session duration]: https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html\n// [GetRoleCredentials]: https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html\n// [https://tools.ietf.org/html/rfc8628]: https://tools.ietf.org/html/rfc8628\n// [What is IAM Identity Center?]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html\npackage ssooidc\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithyendpoints \"github.com/aws/smithy-go/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleSerialize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\tnf := (&aws.EndpointNotFoundError{})\n\t\tif errors.As(err, &nf) {\n\t\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)\n\t\t\treturn next.HandleSerialize(ctx, in)\n\t\t}\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"sso-oauth\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,\n// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked\n// via its middleware.\n//\n// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n\nfunc resolveEndpointResolverV2(options *Options) {\n\tif options.EndpointResolverV2 == nil {\n\t\toptions.EndpointResolverV2 = NewDefaultEndpointResolverV2()\n\t}\n}\n\nfunc resolveBaseEndpoint(cfg aws.Config, o *Options) {\n\tif cfg.BaseEndpoint != nil {\n\t\to.BaseEndpoint = cfg.BaseEndpoint\n\t}\n\n\t_, g := os.LookupEnv(\"AWS_ENDPOINT_URL\")\n\t_, s := os.LookupEnv(\"AWS_ENDPOINT_URL_SSO_OIDC\")\n\n\tif g && !s {\n\t\treturn\n\t}\n\n\tvalue, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), \"SSO OIDC\", cfg.ConfigSources)\n\tif found && err == nil {\n\t\to.BaseEndpoint = &value\n\t}\n}\n\nfunc bindRegion(region string) *string {\n\tif region == \"\" {\n\t\treturn nil\n\t}\n\treturn aws.String(endpoints.MapFIPSRegion(region))\n}\n\n// EndpointParameters provides the parameters that influence how endpoints are\n// resolved.\ntype EndpointParameters struct {\n\t// The AWS region used to dispatch the request.\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// AWS::Region\n\tRegion *string\n\n\t// When true, use the dual-stack endpoint. If the configured endpoint does not\n\t// support dual-stack, dispatching the request MAY return an error.\n\t//\n\t// Defaults to\n\t// false if no value is provided.\n\t//\n\t// AWS::UseDualStack\n\tUseDualStack *bool\n\n\t// When true, send this request to the FIPS-compliant regional endpoint. If the\n\t// configured endpoint does not have a FIPS compliant endpoint, dispatching the\n\t// request will return an error.\n\t//\n\t// Defaults to false if no value is\n\t// provided.\n\t//\n\t// AWS::UseFIPS\n\tUseFIPS *bool\n\n\t// Override the endpoint used to send this request\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// SDK::Endpoint\n\tEndpoint *string\n}\n\n// ValidateRequired validates required parameters are set.\nfunc (p EndpointParameters) ValidateRequired() error {\n\tif p.UseDualStack == nil {\n\t\treturn fmt.Errorf(\"parameter UseDualStack is required\")\n\t}\n\n\tif p.UseFIPS == nil {\n\t\treturn fmt.Errorf(\"parameter UseFIPS is required\")\n\t}\n\n\treturn nil\n}\n\n// WithDefaults returns a shallow copy of EndpointParameterswith default values\n// applied to members where applicable.\nfunc (p EndpointParameters) WithDefaults() EndpointParameters {\n\tif p.UseDualStack == nil {\n\t\tp.UseDualStack = ptr.Bool(false)\n\t}\n\n\tif p.UseFIPS == nil {\n\t\tp.UseFIPS = ptr.Bool(false)\n\t}\n\treturn p\n}\n\ntype stringSlice []string\n\nfunc (s stringSlice) Get(i int) *string {\n\tif i < 0 || i >= len(s) {\n\t\treturn nil\n\t}\n\n\tv := s[i]\n\treturn &v\n}\n\n// EndpointResolverV2 provides the interface for resolving service endpoints.\ntype EndpointResolverV2 interface {\n\t// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n\t// returning the endpoint if found. Otherwise an error is returned.\n\tResolveEndpoint(ctx context.Context, params EndpointParameters) (\n\t\tsmithyendpoints.Endpoint, error,\n\t)\n}\n\n// resolver provides the implementation for resolving endpoints.\ntype resolver struct{}\n\nfunc NewDefaultEndpointResolverV2() EndpointResolverV2 {\n\treturn &resolver{}\n}\n\n// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n// returning the endpoint if found. Otherwise an error is returned.\nfunc (r *resolver) ResolveEndpoint(\n\tctx context.Context, params EndpointParameters,\n) (\n\tendpoint smithyendpoints.Endpoint, err error,\n) {\n\tparams = params.WithDefaults()\n\tif err = params.ValidateRequired(); err != nil {\n\t\treturn endpoint, fmt.Errorf(\"endpoint parameters are not valid, %w\", err)\n\t}\n\t_UseDualStack := *params.UseDualStack\n\t_UseFIPS := *params.UseFIPS\n\n\tif exprVal := params.Endpoint; exprVal != nil {\n\t\t_Endpoint := *exprVal\n\t\t_ = _Endpoint\n\t\tif _UseFIPS == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: FIPS and custom endpoint are not supported\")\n\t\t}\n\t\tif _UseDualStack == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Dualstack and custom endpoint are not supported\")\n\t\t}\n\t\turiString := _Endpoint\n\n\t\turi, err := url.Parse(uriString)\n\t\tif err != nil {\n\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t}\n\n\t\treturn smithyendpoints.Endpoint{\n\t\t\tURI:     *uri,\n\t\t\tHeaders: http.Header{},\n\t\t}, nil\n\t}\n\tif exprVal := params.Region; exprVal != nil {\n\t\t_Region := *exprVal\n\t\t_ = _Region\n\t\tif exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {\n\t\t\t_PartitionResult := *exprVal\n\t\t\t_ = _PartitionResult\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _UseDualStack == true {\n\t\t\t\t\tif true == _PartitionResult.SupportsFIPS {\n\t\t\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\t\tout.WriteString(\"https://oidc-fips.\")\n\t\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t\t}()\n\n\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS and DualStack are enabled, but this partition does not support one or both\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _PartitionResult.SupportsFIPS == true {\n\t\t\t\t\tif _PartitionResult.Name == \"aws-us-gov\" {\n\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\tout.WriteString(\"https://oidc.\")\n\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\tout.WriteString(\".amazonaws.com\")\n\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://oidc-fips.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS is enabled but this partition does not support FIPS\")\n\t\t\t}\n\t\t\tif _UseDualStack == true {\n\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://oidc.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"DualStack is enabled but this partition does not support DualStack\")\n\t\t\t}\n\t\t\turiString := func() string {\n\t\t\t\tvar out strings.Builder\n\t\t\t\tout.WriteString(\"https://oidc.\")\n\t\t\t\tout.WriteString(_Region)\n\t\t\t\tout.WriteString(\".\")\n\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\treturn out.String()\n\t\t\t}()\n\n\t\t\turi, err := url.Parse(uriString)\n\t\t\tif err != nil {\n\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t}\n\n\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\tURI:     *uri,\n\t\t\t\tHeaders: http.Header{},\n\t\t\t}, nil\n\t\t}\n\t\treturn endpoint, fmt.Errorf(\"Endpoint resolution failed. Invalid operation or environment input.\")\n\t}\n\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Missing Region\")\n}\n\ntype endpointParamsBinder interface {\n\tbindEndpointParams(*EndpointParameters)\n}\n\nfunc bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters {\n\tparams := &EndpointParameters{}\n\n\tparams.Region = bindRegion(options.Region)\n\tparams.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)\n\tparams.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)\n\tparams.Endpoint = options.BaseEndpoint\n\n\tif b, ok := input.(endpointParamsBinder); ok {\n\t\tb.bindEndpointParams(params)\n\t}\n\n\treturn params\n}\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\tif err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"invalid accountID set: %w\", err)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.options.EndpointResolverV2 == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\tparams := bindEndpointParams(ctx, getOperationInput(ctx), m.options)\n\tendpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\tif endpt.URI.RawPath == \"\" && req.URL.RawPath != \"\" {\n\t\tendpt.URI.RawPath = endpt.URI.Path\n\t}\n\treq.URL.Scheme = endpt.URI.Scheme\n\treq.URL.Host = endpt.URI.Host\n\treq.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)\n\treq.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)\n\tfor k := range endpt.Headers {\n\t\treq.Header.Set(k, endpt.Headers.Get(k))\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\topts, _ := smithyauth.GetAuthOptions(&endpt.Properties)\n\tfor _, o := range opts {\n\t\trscheme.SignerProperties.SetAll(&o.SignerProperties)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_CreateToken.go\",\n        \"api_op_CreateTokenWithIAM.go\",\n        \"api_op_RegisterClient.go\",\n        \"api_op_StartDeviceAuthorization.go\",\n        \"auth.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"endpoints_config_test.go\",\n        \"endpoints_test.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"options.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"snapshot_test.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/ssooidc\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage ssooidc\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.26.4\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver SSO OIDC endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsIsoF  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoF:  regexp.MustCompile(\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"af-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.af-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"af-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-northeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-northeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-northeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-southeast-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-southeast-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-southeast-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ap-southeast-4.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ca-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.ca-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-central-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-north-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-south-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.eu-west-3.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"il-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.il-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"il-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-central-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.me-central-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-central-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-south-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.me-south-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"me-south-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.sa-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.cn-north-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.cn-northwest-1.amazonaws.com.cn\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-f\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoF,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"oidc.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"oidc.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n)\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Indicates how aws account ID is applied in endpoint2.0 routing\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n\n\t// The optional application specific identifier appended to the User-Agent header.\n\tAppID string\n\n\t// This endpoint will be given as input to an EndpointResolverV2. It is used for\n\t// providing a custom base endpoint that is subject to modifications by the\n\t// processing EndpointResolverV2.\n\tBaseEndpoint *string\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\t//\n\t// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a\n\t// value for this field will likely prevent you from using any endpoint-related\n\t// service features released after the introduction of EndpointResolverV2 and\n\t// BaseEndpoint.\n\t//\n\t// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n\t// the client option BaseEndpoint instead.\n\tEndpointResolver EndpointResolver\n\n\t// Resolves the endpoint used for a particular service operation. This should be\n\t// used over the deprecated EndpointResolver.\n\tEndpointResolverV2 EndpointResolverV2\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts.\n\t//\n\t// If specified in an operation call's functional options with a value that is\n\t// different than the constructed client's Options, the Client's Retryer will be\n\t// wrapped to use the operation's specific RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified.\n\t//\n\t// When creating a new API Clients this member will only be used if the Retryer\n\t// Options member is nil. This value will be ignored if Retryer is not nil.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// The auth scheme resolver which determines how to authenticate for each\n\t// operation.\n\tAuthSchemeResolver AuthSchemeResolver\n\n\t// The list of auth schemes supported by the client.\n\tAuthSchemes []smithyhttp.AuthScheme\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\n\nfunc (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {\n\tif schemeID == \"aws.auth#sigv4\" {\n\t\treturn getSigV4IdentityResolver(o)\n\t}\n\tif schemeID == \"smithy.api#noAuth\" {\n\t\treturn &smithyauth.AnonymousIdentityResolver{}\n\t}\n\treturn nil\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for\n// this field will likely prevent you from using any endpoint-related service\n// features released after the introduction of EndpointResolverV2 and BaseEndpoint.\n//\n// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n// the client option BaseEndpoint instead.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\n// WithEndpointResolverV2 returns a functional option for setting the Client's\n// EndpointResolverV2 option.\nfunc WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolverV2 = v\n\t}\n}\n\nfunc getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {\n\tif o.Credentials != nil {\n\t\treturn &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}\n\t}\n\treturn nil\n}\n\n// WithSigV4SigningName applies an override to the authentication workflow to\n// use the given signing name for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing name from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningName(name string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningName\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\n// WithSigV4SigningRegion applies an override to the authentication workflow to\n// use the given signing region for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing region from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningRegion(region string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningRegion\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\nfunc ignoreAnonymousAuth(options *Options) {\n\tif aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {\n\t\toptions.Credentials = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\tsmithyjson \"github.com/aws/smithy-go/encoding/json\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\ntype awsRestjson1_serializeOpCreateToken struct {\n}\n\nfunc (*awsRestjson1_serializeOpCreateToken) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateTokenInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/token\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"POST\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\trestEncoder.SetHeader(\"Content-Type\").String(\"application/json\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsRestjson1_serializeOpDocumentCreateTokenInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\treturn nil\n}\n\nfunc awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientId != nil {\n\t\tok := object.Key(\"clientId\")\n\t\tok.String(*v.ClientId)\n\t}\n\n\tif v.ClientSecret != nil {\n\t\tok := object.Key(\"clientSecret\")\n\t\tok.String(*v.ClientSecret)\n\t}\n\n\tif v.Code != nil {\n\t\tok := object.Key(\"code\")\n\t\tok.String(*v.Code)\n\t}\n\n\tif v.CodeVerifier != nil {\n\t\tok := object.Key(\"codeVerifier\")\n\t\tok.String(*v.CodeVerifier)\n\t}\n\n\tif v.DeviceCode != nil {\n\t\tok := object.Key(\"deviceCode\")\n\t\tok.String(*v.DeviceCode)\n\t}\n\n\tif v.GrantType != nil {\n\t\tok := object.Key(\"grantType\")\n\t\tok.String(*v.GrantType)\n\t}\n\n\tif v.RedirectUri != nil {\n\t\tok := object.Key(\"redirectUri\")\n\t\tok.String(*v.RedirectUri)\n\t}\n\n\tif v.RefreshToken != nil {\n\t\tok := object.Key(\"refreshToken\")\n\t\tok.String(*v.RefreshToken)\n\t}\n\n\tif v.Scope != nil {\n\t\tok := object.Key(\"scope\")\n\t\tif err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpCreateTokenWithIAM struct {\n}\n\nfunc (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpCreateTokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*CreateTokenWithIAMInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/token?aws_iam=t\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"POST\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\trestEncoder.SetHeader(\"Content-Type\").String(\"application/json\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\treturn nil\n}\n\nfunc awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.Assertion != nil {\n\t\tok := object.Key(\"assertion\")\n\t\tok.String(*v.Assertion)\n\t}\n\n\tif v.ClientId != nil {\n\t\tok := object.Key(\"clientId\")\n\t\tok.String(*v.ClientId)\n\t}\n\n\tif v.Code != nil {\n\t\tok := object.Key(\"code\")\n\t\tok.String(*v.Code)\n\t}\n\n\tif v.CodeVerifier != nil {\n\t\tok := object.Key(\"codeVerifier\")\n\t\tok.String(*v.CodeVerifier)\n\t}\n\n\tif v.GrantType != nil {\n\t\tok := object.Key(\"grantType\")\n\t\tok.String(*v.GrantType)\n\t}\n\n\tif v.RedirectUri != nil {\n\t\tok := object.Key(\"redirectUri\")\n\t\tok.String(*v.RedirectUri)\n\t}\n\n\tif v.RefreshToken != nil {\n\t\tok := object.Key(\"refreshToken\")\n\t\tok.String(*v.RefreshToken)\n\t}\n\n\tif v.RequestedTokenType != nil {\n\t\tok := object.Key(\"requestedTokenType\")\n\t\tok.String(*v.RequestedTokenType)\n\t}\n\n\tif v.Scope != nil {\n\t\tok := object.Key(\"scope\")\n\t\tif err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.SubjectToken != nil {\n\t\tok := object.Key(\"subjectToken\")\n\t\tok.String(*v.SubjectToken)\n\t}\n\n\tif v.SubjectTokenType != nil {\n\t\tok := object.Key(\"subjectTokenType\")\n\t\tok.String(*v.SubjectTokenType)\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpRegisterClient struct {\n}\n\nfunc (*awsRestjson1_serializeOpRegisterClient) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*RegisterClientInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/client/register\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"POST\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\trestEncoder.SetHeader(\"Content-Type\").String(\"application/json\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsRestjson1_serializeOpDocumentRegisterClientInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\treturn nil\n}\n\nfunc awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientName != nil {\n\t\tok := object.Key(\"clientName\")\n\t\tok.String(*v.ClientName)\n\t}\n\n\tif v.ClientType != nil {\n\t\tok := object.Key(\"clientType\")\n\t\tok.String(*v.ClientType)\n\t}\n\n\tif v.EntitledApplicationArn != nil {\n\t\tok := object.Key(\"entitledApplicationArn\")\n\t\tok.String(*v.EntitledApplicationArn)\n\t}\n\n\tif v.GrantTypes != nil {\n\t\tok := object.Key(\"grantTypes\")\n\t\tif err := awsRestjson1_serializeDocumentGrantTypes(v.GrantTypes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.IssuerUrl != nil {\n\t\tok := object.Key(\"issuerUrl\")\n\t\tok.String(*v.IssuerUrl)\n\t}\n\n\tif v.RedirectUris != nil {\n\t\tok := object.Key(\"redirectUris\")\n\t\tif err := awsRestjson1_serializeDocumentRedirectUris(v.RedirectUris, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Scopes != nil {\n\t\tok := object.Key(\"scopes\")\n\t\tif err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype awsRestjson1_serializeOpStartDeviceAuthorization struct {\n}\n\nfunc (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*StartDeviceAuthorizationInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\topPath, opQuery := httpbinding.SplitURI(\"/device_authorization\")\n\trequest.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)\n\trequest.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)\n\trequest.Method = \"POST\"\n\tvar restEncoder *httpbinding.Encoder\n\tif request.URL.RawPath == \"\" {\n\t\trestEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\t} else {\n\t\trequest.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)\n\t\trestEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)\n\t}\n\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\trestEncoder.SetHeader(\"Content-Type\").String(\"application/json\")\n\n\tjsonEncoder := smithyjson.NewEncoder()\n\tif err := awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(input, jsonEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = restEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsRestjson1_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unsupported serialization of nil %T\", v)\n\t}\n\n\treturn nil\n}\n\nfunc awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error {\n\tobject := value.Object()\n\tdefer object.Close()\n\n\tif v.ClientId != nil {\n\t\tok := object.Key(\"clientId\")\n\t\tok.String(*v.ClientId)\n\t}\n\n\tif v.ClientSecret != nil {\n\t\tok := object.Key(\"clientSecret\")\n\t\tok.String(*v.ClientSecret)\n\t}\n\n\tif v.StartUrl != nil {\n\t\tok := object.Key(\"startUrl\")\n\t\tok.String(*v.StartUrl)\n\t}\n\n\treturn nil\n}\n\nfunc awsRestjson1_serializeDocumentGrantTypes(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsRestjson1_serializeDocumentRedirectUris(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error {\n\tarray := value.Array()\n\tdefer array.Close()\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// You do not have sufficient access to perform this action.\ntype AccessDeniedException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AccessDeniedException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AccessDeniedException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AccessDeniedException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AccessDeniedException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that a request to authorize a client with an access user session\n// token is pending.\ntype AuthorizationPendingException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *AuthorizationPendingException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *AuthorizationPendingException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *AuthorizationPendingException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"AuthorizationPendingException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the token issued by the service is expired and is no longer\n// valid.\ntype ExpiredTokenException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ExpiredTokenException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ExpiredTokenException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ExpiredTokenException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ExpiredTokenException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that an error from the service occurred while trying to process a\n// request.\ntype InternalServerException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InternalServerException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InternalServerException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InternalServerException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InternalServerException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }\n\n// Indicates that the clientId or clientSecret in the request is invalid. For\n// example, this can occur when a client sends an incorrect clientId or an expired\n// clientSecret .\ntype InvalidClientException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidClientException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidClientException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidClientException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidClientException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the client information sent in the request during registration\n// is invalid.\ntype InvalidClientMetadataException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidClientMetadataException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidClientMetadataException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidClientMetadataException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidClientMetadataException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that a request contains an invalid grant. This can occur if a client\n// makes a CreateTokenrequest with an invalid grant type.\ntype InvalidGrantException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidGrantException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidGrantException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidGrantException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidGrantException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that one or more redirect URI in the request is not supported for\n// this operation.\ntype InvalidRedirectUriException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidRedirectUriException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidRedirectUriException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidRedirectUriException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidRedirectUriException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidRedirectUriException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that something is wrong with the input to the request. For example, a\n// required parameter might be missing or out of range.\ntype InvalidRequestException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidRequestException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidRequestException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidRequestException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidRequestException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that a token provided as input to the request was issued by and is\n// only usable by calling IAM Identity Center endpoints in another region.\ntype InvalidRequestRegionException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\tEndpoint          *string\n\tRegion            *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidRequestRegionException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidRequestRegionException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidRequestRegionException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidRequestRegionException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the scope provided in the request is invalid.\ntype InvalidScopeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidScopeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidScopeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidScopeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidScopeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the client is making the request too frequently and is more than\n// the service can handle.\ntype SlowDownException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *SlowDownException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *SlowDownException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *SlowDownException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"SlowDownException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the client is not currently authorized to make the request. This\n// can happen when a clientId is not issued for a public client.\ntype UnauthorizedClientException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnauthorizedClientException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnauthorizedClientException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnauthorizedClientException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnauthorizedClientException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// Indicates that the grant type in the request is not supported by the service.\ntype UnsupportedGrantTypeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tError_            *string\n\tError_description *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *UnsupportedGrantTypeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *UnsupportedGrantTypeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *UnsupportedGrantTypeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"UnsupportedGrantTypeException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n)\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage ssooidc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpCreateToken struct {\n}\n\nfunc (*validateOpCreateToken) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateTokenInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateTokenInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpCreateTokenWithIAM struct {\n}\n\nfunc (*validateOpCreateTokenWithIAM) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*CreateTokenWithIAMInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpCreateTokenWithIAMInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpRegisterClient struct {\n}\n\nfunc (*validateOpRegisterClient) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*RegisterClientInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpRegisterClientInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpStartDeviceAuthorization struct {\n}\n\nfunc (*validateOpStartDeviceAuthorization) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*StartDeviceAuthorizationInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpStartDeviceAuthorizationInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateToken{}, middleware.After)\n}\n\nfunc addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After)\n}\n\nfunc addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After)\n}\n\nfunc addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After)\n}\n\nfunc validateOpCreateTokenInput(v *CreateTokenInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateTokenInput\"}\n\tif v.ClientId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientId\"))\n\t}\n\tif v.ClientSecret == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientSecret\"))\n\t}\n\tif v.GrantType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"GrantType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"CreateTokenWithIAMInput\"}\n\tif v.ClientId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientId\"))\n\t}\n\tif v.GrantType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"GrantType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpRegisterClientInput(v *RegisterClientInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"RegisterClientInput\"}\n\tif v.ClientName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientName\"))\n\t}\n\tif v.ClientType == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientType\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"StartDeviceAuthorizationInput\"}\n\tif v.ClientId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientId\"))\n\t}\n\tif v.ClientSecret == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"ClientSecret\"))\n\t}\n\tif v.StartUrl == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"StartUrl\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md",
    "content": "# v1.30.3 (2024-07-10.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.30.2 (2024-07-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.30.1 (2024-06-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.30.0 (2024-06-26)\n\n* **Feature**: Support list-of-string endpoint parameter.\n\n# v1.29.1 (2024-06-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.29.0 (2024-06-18)\n\n* **Feature**: Track usage of various AWS SDK features in user-agent string.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.13 (2024-06-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.12 (2024-06-07)\n\n* **Bug Fix**: Add clock skew correction on all service clients\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.11 (2024-06-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.10 (2024-05-23)\n\n* No change notes available for this release.\n\n# v1.28.9 (2024-05-16)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.8 (2024-05-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.7 (2024-05-08)\n\n* **Bug Fix**: GoDoc improvement\n\n# v1.28.6 (2024-03-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.5 (2024-03-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.4 (2024-03-07)\n\n* **Bug Fix**: Remove dependency on go-cmp.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.3 (2024-03-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.2 (2024-03-04)\n\n* **Bug Fix**: Update internal/presigned-url dependency for corrected API name.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.1 (2024-02-23)\n\n* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.28.0 (2024-02-22)\n\n* **Feature**: Add middleware stack snapshot tests.\n\n# v1.27.2 (2024-02-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.27.1 (2024-02-20)\n\n* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == \"\"`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `\"\"`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure.\n\n# v1.27.0 (2024-02-13)\n\n* **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.7 (2024-01-04)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.6 (2023-12-20)\n\n* No change notes available for this release.\n\n# v1.26.5 (2023-12-08)\n\n* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.\n\n# v1.26.4 (2023-12-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.3 (2023-12-06)\n\n* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.\n* **Bug Fix**: STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication.\n\n# v1.26.2 (2023-12-01)\n\n* **Bug Fix**: Correct wrapping of errors in authentication workflow.\n* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.1 (2023-11-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.26.0 (2023-11-29)\n\n* **Feature**: Expose Options() accessor on service clients.\n* **Documentation**: Documentation updates for AWS Security Token Service.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.6 (2023-11-28.2)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.5 (2023-11-28)\n\n* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.\n\n# v1.25.4 (2023-11-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.3 (2023-11-17)\n\n* **Documentation**: API updates for the AWS Security Token Service\n\n# v1.25.2 (2023-11-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.1 (2023-11-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.25.0 (2023-11-01)\n\n* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.24.0 (2023-10-31)\n\n* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.2 (2023-10-12)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.1 (2023-10-06)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.23.0 (2023-10-02)\n\n* **Feature**: STS API updates for assumeRole\n\n# v1.22.0 (2023-09-18)\n\n* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.\n* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.\n\n# v1.21.5 (2023-08-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.4 (2023-08-18)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.3 (2023-08-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.2 (2023-08-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.21.1 (2023-08-01)\n\n* No change notes available for this release.\n\n# v1.21.0 (2023-07-31)\n\n* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.1 (2023-07-28)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.20.0 (2023-07-25)\n\n* **Feature**: API updates for the AWS Security Token Service\n\n# v1.19.3 (2023-07-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.2 (2023-06-15)\n\n* No change notes available for this release.\n\n# v1.19.1 (2023-06-13)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.19.0 (2023-05-08)\n\n* **Feature**: Documentation updates for AWS Security Token Service.\n\n# v1.18.11 (2023-05-04)\n\n* No change notes available for this release.\n\n# v1.18.10 (2023-04-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.9 (2023-04-10)\n\n* No change notes available for this release.\n\n# v1.18.8 (2023-04-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.7 (2023-03-21)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.6 (2023-03-10)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.5 (2023-02-22)\n\n* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.\n\n# v1.18.4 (2023-02-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.18.3 (2023-02-03)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization.\n\n# v1.18.2 (2023-01-25)\n\n* **Documentation**: Doc only change to update wording in a key topic\n\n# v1.18.1 (2023-01-23)\n\n* No change notes available for this release.\n\n# v1.18.0 (2023-01-05)\n\n* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).\n\n# v1.17.7 (2022-12-15)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.6 (2022-12-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.5 (2022-11-22)\n\n* No change notes available for this release.\n\n# v1.17.4 (2022-11-17)\n\n* **Documentation**: Documentation updates for AWS Security Token Service.\n\n# v1.17.3 (2022-11-16)\n\n* No change notes available for this release.\n\n# v1.17.2 (2022-11-10)\n\n* No change notes available for this release.\n\n# v1.17.1 (2022-10-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.17.0 (2022-10-21)\n\n* **Feature**: Add presign functionality for sts:AssumeRole operation\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.19 (2022-09-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.18 (2022-09-14)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.17 (2022-09-02)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.16 (2022-08-31)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.15 (2022-08-30)\n\n* No change notes available for this release.\n\n# v1.16.14 (2022-08-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.13 (2022-08-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.12 (2022-08-09)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.11 (2022-08-08)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.10 (2022-08-01)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.9 (2022-07-05)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.8 (2022-06-29)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.7 (2022-06-07)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.6 (2022-05-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.5 (2022-05-16)\n\n* **Documentation**: Documentation updates for AWS Security Token Service.\n\n# v1.16.4 (2022-04-25)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.3 (2022-03-30)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.2 (2022-03-24)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.1 (2022-03-23)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.16.0 (2022-03-08)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Documentation**: Updated service client model to latest release.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.15.0 (2022-02-24)\n\n* **Feature**: API client updated\n* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.14.0 (2022-01-14)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.13.0 (2022-01-07)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.12.0 (2021-12-21)\n\n* **Feature**: Updated to latest service endpoints\n\n# v1.11.1 (2021-12-02)\n\n* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.11.0 (2021-11-30)\n\n* **Feature**: API client updated\n\n# v1.10.1 (2021-11-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.10.0 (2021-11-12)\n\n* **Feature**: Service clients now support custom endpoints that have an initial URI path defined.\n\n# v1.9.0 (2021-11-06)\n\n* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.8.0 (2021-10-21)\n\n* **Feature**: API client updated\n* **Feature**: Updated  to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.2 (2021-10-11)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.1 (2021-09-17)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.7.0 (2021-08-27)\n\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.2 (2021-08-19)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.1 (2021-08-04)\n\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.6.0 (2021-07-15)\n\n* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model.\n* **Documentation**: Updated service model to latest revision.\n* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.5.0 (2021-06-25)\n\n* **Feature**: API client updated\n* **Feature**: Updated `github.com/aws/smithy-go` to latest version\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.1 (2021-05-20)\n\n* **Dependency Update**: Updated to the latest SDK module versions\n\n# v1.4.0 (2021-05-14)\n\n* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.\n* **Dependency Update**: Updated to the latest SDK module versions\n\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/defaults\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/query\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\tawshttp \"github.com/aws/aws-sdk-go-v2/aws/transport/http\"\n\tinternalauth \"github.com/aws/aws-sdk-go-v2/internal/auth\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\tinternalmiddleware \"github.com/aws/aws-sdk-go-v2/internal/middleware\"\n\tacceptencodingcust \"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding\"\n\tpresignedurlcust \"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\nconst ServiceID = \"STS\"\nconst ServiceAPIVersion = \"2011-06-15\"\n\n// Client provides the API client to make operations call for AWS Security Token\n// Service.\ntype Client struct {\n\toptions Options\n\n\t// Difference between the time reported by the server and the client\n\ttimeOffset *atomic.Int64\n}\n\n// New returns an initialized Client based on the functional options. Provide\n// additional functional options to further configure the behavior of the client,\n// such as changing the client's endpoint or adding custom middleware behavior.\nfunc New(options Options, optFns ...func(*Options)) *Client {\n\toptions = options.Copy()\n\n\tresolveDefaultLogger(&options)\n\n\tsetResolvedDefaultsMode(&options)\n\n\tresolveRetryer(&options)\n\n\tresolveHTTPClient(&options)\n\n\tresolveHTTPSignerV4(&options)\n\n\tresolveEndpointResolverV2(&options)\n\n\tresolveAuthSchemeResolver(&options)\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeRetryMaxAttempts(&options)\n\n\tignoreAnonymousAuth(&options)\n\n\twrapWithAnonymousAuth(&options)\n\n\tresolveAuthSchemes(&options)\n\n\tclient := &Client{\n\t\toptions: options,\n\t}\n\n\tinitializeTimeOffsetResolver(client)\n\n\treturn client\n}\n\n// Options returns a copy of the client configuration.\n//\n// Callers SHOULD NOT perform mutations on any inner structures within client\n// config. Config overrides should instead be made on a per-operation basis through\n// functional options.\nfunc (c *Client) Options() Options {\n\treturn c.options.Copy()\n}\n\nfunc (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {\n\tctx = middleware.ClearStackValues(ctx)\n\tstack := middleware.NewStack(opID, smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\tfinalizeOperationRetryMaxAttempts(&options, *c)\n\n\tfinalizeClientEndpointResolverOptions(&options)\n\n\tfor _, fn := range stackFns {\n\t\tif err := fn(stack, options); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, metadata, err\n\t\t}\n\t}\n\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err = handler.Handle(ctx, params)\n\tif err != nil {\n\t\terr = &smithy.OperationError{\n\t\t\tServiceID:     ServiceID,\n\t\t\tOperationName: opID,\n\t\t\tErr:           err,\n\t\t}\n\t}\n\treturn result, metadata, err\n}\n\ntype operationInputKey struct{}\n\nfunc setOperationInput(ctx context.Context, input interface{}) context.Context {\n\treturn middleware.WithStackValue(ctx, operationInputKey{}, input)\n}\n\nfunc getOperationInput(ctx context.Context) interface{} {\n\treturn middleware.GetStackValue(ctx, operationInputKey{})\n}\n\ntype setOperationInputMiddleware struct {\n}\n\nfunc (*setOperationInputMiddleware) ID() string {\n\treturn \"setOperationInput\"\n}\n\nfunc (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tctx = setOperationInput(ctx, in.Parameters)\n\treturn next.HandleSerialize(ctx, in)\n}\n\nfunc addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {\n\tif err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveAuthScheme: %w\", err)\n\t}\n\tif err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, \"ResolveAuthScheme\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add GetIdentity: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, \"GetIdentity\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add ResolveEndpointV2: %v\", err)\n\t}\n\tif err := stack.Finalize.Insert(&signRequestMiddleware{}, \"ResolveEndpointV2\", middleware.After); err != nil {\n\t\treturn fmt.Errorf(\"add Signing: %w\", err)\n\t}\n\treturn nil\n}\nfunc resolveAuthSchemeResolver(options *Options) {\n\tif options.AuthSchemeResolver == nil {\n\t\toptions.AuthSchemeResolver = &defaultAuthSchemeResolver{}\n\t}\n}\n\nfunc resolveAuthSchemes(options *Options) {\n\tif options.AuthSchemes == nil {\n\t\toptions.AuthSchemes = []smithyhttp.AuthScheme{\n\t\t\tinternalauth.NewHTTPAuthScheme(\"aws.auth#sigv4\", &internalauthsmithy.V4SignerAdapter{\n\t\t\t\tSigner:     options.HTTPSignerV4,\n\t\t\t\tLogger:     options.Logger,\n\t\t\t\tLogSigning: options.ClientLogMode.IsSigning(),\n\t\t\t}),\n\t\t}\n\t}\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n\ntype legacyEndpointContextSetter struct {\n\tLegacyResolver EndpointResolver\n}\n\nfunc (*legacyEndpointContextSetter) ID() string {\n\treturn \"legacyEndpointContextSetter\"\n}\n\nfunc (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.LegacyResolver != nil {\n\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)\n\t}\n\n\treturn next.HandleInitialize(ctx, in)\n\n}\nfunc addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {\n\treturn stack.Initialize.Add(&legacyEndpointContextSetter{\n\t\tLegacyResolver: o.EndpointResolver,\n\t}, middleware.Before)\n}\n\nfunc resolveDefaultLogger(o *Options) {\n\tif o.Logger != nil {\n\t\treturn\n\t}\n\to.Logger = logging.Nop{}\n}\n\nfunc addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {\n\treturn middleware.AddSetLoggerMiddleware(stack, o.Logger)\n}\n\nfunc setResolvedDefaultsMode(o *Options) {\n\tif len(o.resolvedDefaultsMode) > 0 {\n\t\treturn\n\t}\n\n\tvar mode aws.DefaultsMode\n\tmode.SetFromString(string(o.DefaultsMode))\n\n\tif mode == aws.DefaultsModeAuto {\n\t\tmode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)\n\t}\n\n\to.resolvedDefaultsMode = mode\n}\n\n// NewFromConfig returns a new client from the provided config.\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {\n\topts := Options{\n\t\tRegion:                cfg.Region,\n\t\tDefaultsMode:          cfg.DefaultsMode,\n\t\tRuntimeEnvironment:    cfg.RuntimeEnvironment,\n\t\tHTTPClient:            cfg.HTTPClient,\n\t\tCredentials:           cfg.Credentials,\n\t\tAPIOptions:            cfg.APIOptions,\n\t\tLogger:                cfg.Logger,\n\t\tClientLogMode:         cfg.ClientLogMode,\n\t\tAppID:                 cfg.AppID,\n\t\tAccountIDEndpointMode: cfg.AccountIDEndpointMode,\n\t}\n\tresolveAWSRetryerProvider(cfg, &opts)\n\tresolveAWSRetryMaxAttempts(cfg, &opts)\n\tresolveAWSRetryMode(cfg, &opts)\n\tresolveAWSEndpointResolver(cfg, &opts)\n\tresolveUseDualStackEndpoint(cfg, &opts)\n\tresolveUseFIPSEndpoint(cfg, &opts)\n\tresolveBaseEndpoint(cfg, &opts)\n\treturn New(opts, optFns...)\n}\n\nfunc resolveHTTPClient(o *Options) {\n\tvar buildable *awshttp.BuildableClient\n\n\tif o.HTTPClient != nil {\n\t\tvar ok bool\n\t\tbuildable, ok = o.HTTPClient.(*awshttp.BuildableClient)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuildable = awshttp.NewBuildableClient()\n\t}\n\n\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\tif err == nil {\n\t\tbuildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {\n\t\t\tif dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {\n\t\t\t\tdialer.Timeout = dialerTimeout\n\t\t\t}\n\t\t})\n\n\t\tbuildable = buildable.WithTransportOptions(func(transport *http.Transport) {\n\t\t\tif tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {\n\t\t\t\ttransport.TLSHandshakeTimeout = tlsHandshakeTimeout\n\t\t\t}\n\t\t})\n\t}\n\n\to.HTTPClient = buildable\n}\n\nfunc resolveRetryer(o *Options) {\n\tif o.Retryer != nil {\n\t\treturn\n\t}\n\n\tif len(o.RetryMode) == 0 {\n\t\tmodeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)\n\t\tif err == nil {\n\t\t\to.RetryMode = modeConfig.RetryMode\n\t\t}\n\t}\n\tif len(o.RetryMode) == 0 {\n\t\to.RetryMode = aws.RetryModeStandard\n\t}\n\n\tvar standardOptions []func(*retry.StandardOptions)\n\tif v := o.RetryMaxAttempts; v != 0 {\n\t\tstandardOptions = append(standardOptions, func(so *retry.StandardOptions) {\n\t\t\tso.MaxAttempts = v\n\t\t})\n\t}\n\n\tswitch o.RetryMode {\n\tcase aws.RetryModeAdaptive:\n\t\tvar adaptiveOptions []func(*retry.AdaptiveModeOptions)\n\t\tif len(standardOptions) != 0 {\n\t\t\tadaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {\n\t\t\t\tao.StandardOptions = append(ao.StandardOptions, standardOptions...)\n\t\t\t})\n\t\t}\n\t\to.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)\n\n\tdefault:\n\t\to.Retryer = retry.NewStandard(standardOptions...)\n\t}\n}\n\nfunc resolveAWSRetryerProvider(cfg aws.Config, o *Options) {\n\tif cfg.Retryer == nil {\n\t\treturn\n\t}\n\to.Retryer = cfg.Retryer()\n}\n\nfunc resolveAWSRetryMode(cfg aws.Config, o *Options) {\n\tif len(cfg.RetryMode) == 0 {\n\t\treturn\n\t}\n\to.RetryMode = cfg.RetryMode\n}\nfunc resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {\n\tif cfg.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\to.RetryMaxAttempts = cfg.RetryMaxAttempts\n}\n\nfunc finalizeRetryMaxAttempts(o *Options) {\n\tif o.RetryMaxAttempts == 0 {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc finalizeOperationRetryMaxAttempts(o *Options, client Client) {\n\tif v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {\n\t\treturn\n\t}\n\n\to.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)\n}\n\nfunc resolveAWSEndpointResolver(cfg aws.Config, o *Options) {\n\tif cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {\n\t\treturn\n\t}\n\to.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)\n}\n\nfunc addClientUserAgent(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, \"sts\", goModuleVersion)\n\tif len(options.AppID) > 0 {\n\t\tua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)\n\t}\n\n\treturn nil\n}\n\nfunc getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) {\n\tid := (*awsmiddleware.RequestUserAgent)(nil).ID()\n\tmw, ok := stack.Build.Get(id)\n\tif !ok {\n\t\tmw = awsmiddleware.NewRequestUserAgent()\n\t\tif err := stack.Build.Add(mw, middleware.After); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tua, ok := mw.(*awsmiddleware.RequestUserAgent)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%T for %s middleware did not match expected type\", mw, id)\n\t}\n\n\treturn ua, nil\n}\n\ntype HTTPSignerV4 interface {\n\tSignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error\n}\n\nfunc resolveHTTPSignerV4(o *Options) {\n\tif o.HTTPSignerV4 != nil {\n\t\treturn\n\t}\n\to.HTTPSignerV4 = newDefaultV4Signer(*o)\n}\n\nfunc newDefaultV4Signer(o Options) *v4.Signer {\n\treturn v4.NewSigner(func(so *v4.SignerOptions) {\n\t\tso.Logger = o.Logger\n\t\tso.LogSigning = o.ClientLogMode.IsSigning()\n\t})\n}\n\nfunc addClientRequestID(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)\n}\n\nfunc addComputeContentLength(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After)\n}\n\nfunc addRawResponseToMetadata(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)\n}\n\nfunc addRecordResponseTiming(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)\n}\nfunc addStreamingEventsPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before)\n}\n\nfunc addUnsignedPayload(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.UnsignedPayload{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addComputePayloadSHA256(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, \"ResolveEndpointV2\", middleware.After)\n}\n\nfunc addContentSHA256Header(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After)\n}\n\nfunc addIsWaiterUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter)\n\t\treturn nil\n\t})\n}\n\nfunc addIsPaginatorUserAgent(o *Options) {\n\to.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {\n\t\tua, err := getOrAddRequestUserAgent(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator)\n\t\treturn nil\n\t})\n}\n\nfunc addRetry(stack *middleware.Stack, o Options) error {\n\tattempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) {\n\t\tm.LogAttempts = o.ClientLogMode.IsRetries()\n\t})\n\tif err := stack.Finalize.Insert(attempt, \"Signing\", middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// resolves dual-stack endpoint configuration\nfunc resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseDualStackEndpoint = value\n\t}\n\treturn nil\n}\n\n// resolves FIPS endpoint configuration\nfunc resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {\n\tif len(cfg.ConfigSources) == 0 {\n\t\treturn nil\n\t}\n\tvalue, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\to.EndpointOptions.UseFIPSEndpoint = value\n\t}\n\treturn nil\n}\n\nfunc resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string {\n\tif mode == aws.AccountIDEndpointModeDisabled {\n\t\treturn nil\n\t}\n\n\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != \"\" {\n\t\treturn aws.String(ca.Credentials.AccountID)\n\t}\n\n\treturn nil\n}\n\nfunc addTimeOffsetBuild(stack *middleware.Stack, c *Client) error {\n\tmw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset}\n\tif err := stack.Build.Add(&mw, middleware.After); err != nil {\n\t\treturn err\n\t}\n\treturn stack.Deserialize.Insert(&mw, \"RecordResponseTiming\", middleware.Before)\n}\nfunc initializeTimeOffsetResolver(c *Client) {\n\tc.timeOffset = new(atomic.Int64)\n}\n\nfunc checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error {\n\tswitch mode {\n\tcase aws.AccountIDEndpointModeUnset:\n\tcase aws.AccountIDEndpointModePreferred:\n\tcase aws.AccountIDEndpointModeDisabled:\n\tcase aws.AccountIDEndpointModeRequired:\n\t\tif ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t} else if ca.Credentials.AccountID == \"\" {\n\t\t\treturn fmt.Errorf(\"accountID is required but not set\")\n\t\t}\n\t// default check in case invalid mode is configured through request config\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid accountID endpoint mode %s, must be preferred/required/disabled\", mode)\n\t}\n\n\treturn nil\n}\n\nfunc addUserAgentRetryMode(stack *middleware.Stack, options Options) error {\n\tua, err := getOrAddRequestUserAgent(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch options.Retryer.(type) {\n\tcase *retry.Standard:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard)\n\tcase *retry.AdaptiveMode:\n\t\tua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive)\n\t}\n\treturn nil\n}\n\nfunc addRecursionDetection(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After)\n}\n\nfunc addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, \"OperationDeserializer\", middleware.Before)\n\n}\n\nfunc addResponseErrorMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, \"RequestIDRetriever\", middleware.Before)\n\n}\n\n// HTTPPresignerV4 represents presigner interface used by presign url client\ntype HTTPPresignerV4 interface {\n\tPresignHTTP(\n\t\tctx context.Context, credentials aws.Credentials, r *http.Request,\n\t\tpayloadHash string, service string, region string, signingTime time.Time,\n\t\toptFns ...func(*v4.SignerOptions),\n\t) (url string, signedHeader http.Header, err error)\n}\n\n// PresignOptions represents the presign client options\ntype PresignOptions struct {\n\n\t// ClientOptions are list of functional options to mutate client options used by\n\t// the presign client.\n\tClientOptions []func(*Options)\n\n\t// Presigner is the presigner used by the presign url client\n\tPresigner HTTPPresignerV4\n}\n\nfunc (o PresignOptions) copy() PresignOptions {\n\tclientOptions := make([]func(*Options), len(o.ClientOptions))\n\tcopy(clientOptions, o.ClientOptions)\n\to.ClientOptions = clientOptions\n\treturn o\n}\n\n// WithPresignClientFromClientOptions is a helper utility to retrieve a function\n// that takes PresignOption as input\nfunc WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) {\n\treturn withPresignClientFromClientOptions(optFns).options\n}\n\ntype withPresignClientFromClientOptions []func(*Options)\n\nfunc (w withPresignClientFromClientOptions) options(o *PresignOptions) {\n\to.ClientOptions = append(o.ClientOptions, w...)\n}\n\n// PresignClient represents the presign url client\ntype PresignClient struct {\n\tclient  *Client\n\toptions PresignOptions\n}\n\n// NewPresignClient generates a presign client using provided API Client and\n// presign options\nfunc NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient {\n\tvar options PresignOptions\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\tif len(options.ClientOptions) != 0 {\n\t\tc = New(c.options, options.ClientOptions...)\n\t}\n\n\tif options.Presigner == nil {\n\t\toptions.Presigner = newDefaultV4Signer(c.options)\n\t}\n\n\treturn &PresignClient{\n\t\tclient:  c,\n\t\toptions: options,\n\t}\n}\n\nfunc withNopHTTPClientAPIOption(o *Options) {\n\to.HTTPClient = smithyhttp.NopClient{}\n}\n\ntype presignContextPolyfillMiddleware struct {\n}\n\nfunc (*presignContextPolyfillMiddleware) ID() string {\n\treturn \"presignContextPolyfill\"\n}\n\nfunc (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tschemeID := rscheme.Scheme.SchemeID()\n\n\tif schemeID == \"aws.auth#sigv4\" || schemeID == \"com.amazonaws.s3#sigv4express\" {\n\t\tif sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok {\n\t\t\tctx = awsmiddleware.SetSigningName(ctx, sn)\n\t\t}\n\t\tif sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok {\n\t\t\tctx = awsmiddleware.SetSigningRegion(ctx, sr)\n\t\t}\n\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\tif sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok {\n\t\t\tctx = awsmiddleware.SetSigningName(ctx, sn)\n\t\t}\n\t\tif sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok {\n\t\t\tctx = awsmiddleware.SetSigningRegion(ctx, sr[0])\n\t\t}\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype presignConverter PresignOptions\n\nfunc (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) {\n\tif _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok {\n\t\tstack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID())\n\t}\n\tif _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok {\n\t\tstack.Finalize.Remove((*retry.Attempt)(nil).ID())\n\t}\n\tif _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok {\n\t\tstack.Finalize.Remove((*retry.MetricsHeader)(nil).ID())\n\t}\n\tstack.Deserialize.Clear()\n\tstack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID())\n\tstack.Build.Remove(\"UserAgent\")\n\tif err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, \"Signing\", middleware.Before); err != nil {\n\t\treturn err\n\t}\n\n\tpmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{\n\t\tCredentialsProvider: options.Credentials,\n\t\tPresigner:           c.Presigner,\n\t\tLogSigning:          options.ClientLogMode.IsSigning(),\n\t})\n\tif _, err := stack.Finalize.Swap(\"Signing\", pmw); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil {\n\t\treturn err\n\t}\n\t// convert request to a GET request\n\terr = query.AddAsGetRequestMiddleware(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = presignedurlcust.AddAsIsPresigningMiddleware(stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc addRequestResponseLogging(stack *middleware.Stack, o Options) error {\n\treturn stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{\n\t\tLogRequest:          o.ClientLogMode.IsRequest(),\n\t\tLogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),\n\t\tLogResponse:         o.ClientLogMode.IsResponse(),\n\t\tLogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),\n\t}, middleware.After)\n}\n\ntype disableHTTPSMiddleware struct {\n\tDisableHTTPS bool\n}\n\nfunc (*disableHTTPSMiddleware) ID() string {\n\treturn \"disableHTTPS\"\n}\n\nfunc (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {\n\t\treq.URL.Scheme = \"http\"\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Finalize.Insert(&disableHTTPSMiddleware{\n\t\tDisableHTTPS: o.EndpointOptions.DisableHTTPS,\n\t}, \"ResolveEndpointV2\", middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a set of temporary security credentials that you can use to access\n// Amazon Web Services resources. These temporary credentials consist of an access\n// key ID, a secret access key, and a security token. Typically, you use AssumeRole\n// within your account or for cross-account access. For a comparison of AssumeRole\n// with other API operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the\n// IAM User Guide.\n//\n// # Permissions\n//\n// The temporary security credentials created by AssumeRole can be used to make\n// API calls to any Amazon Web Services service with the following exception: You\n// cannot call the Amazon Web Services STS GetFederationToken or GetSessionToken\n// API operations.\n//\n// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a\n// single JSON policy document to use as an inline session policy. You can also\n// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed\n// session policies. The plaintext that you use for both inline and managed session\n// policies can't exceed 2,048 characters. Passing policies to this operation\n// returns new temporary credentials. The resulting session's permissions are the\n// intersection of the role's identity-based policy and the session policies. You\n// can use the role's temporary credentials in subsequent Amazon Web Services API\n// calls to access resources in the account that owns the role. You cannot use\n// session policies to grant more permissions than those allowed by the\n// identity-based policy of the role that is being assumed. For more information,\n// see [Session Policies]in the IAM User Guide.\n//\n// When you create a role, you create two policies: a role trust policy that\n// specifies who can assume the role, and a permissions policy that specifies what\n// can be done with the role. You specify the trusted principal that is allowed to\n// assume the role in the role trust policy.\n//\n// To assume a role from a different account, your Amazon Web Services account\n// must be trusted by the role. The trust relationship is defined in the role's\n// trust policy when the role is created. That trust policy states which accounts\n// are allowed to delegate that access to users in the account.\n//\n// A user who wants to access a role in a different account must also have\n// permissions that are delegated from the account administrator. The administrator\n// must attach a policy that allows the user to call AssumeRole for the ARN of the\n// role in the other account.\n//\n// To allow a user to assume a role in the same account, you can do either of the\n// following:\n//\n//   - Attach a policy to the user that allows the user to call AssumeRole (as long\n//     as the role's trust policy trusts the account).\n//\n//   - Add the user as a principal directly in the role's trust policy.\n//\n// You can do either because the role’s trust policy acts as an IAM resource-based\n// policy. When a resource-based policy grants access to a principal in the same\n// account, no additional identity-based policy is required. For more information\n// about trust policies and resource-based policies, see [IAM Policies]in the IAM User Guide.\n//\n// # Tags\n//\n// (Optional) You can pass tag key-value pairs to your session. These tags are\n// called session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM\n// User Guide.\n//\n// An administrator must grant you the permissions necessary to pass session tags.\n// The administrator can also create granular permissions to allow you to pass only\n// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.\n//\n// You can set the session tags as transitive. Transitive tags persist during role\n// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.\n//\n// # Using MFA with AssumeRole\n//\n// (Optional) You can include multi-factor authentication (MFA) information when\n// you call AssumeRole . This is useful for cross-account scenarios to ensure that\n// the user that assumes the role has been authenticated with an Amazon Web\n// Services MFA device. In that scenario, the trust policy of the role being\n// assumed includes a condition that tests for MFA authentication. If the caller\n// does not include valid MFA information, the request to assume the role is\n// denied. The condition in a trust policy that tests for MFA authentication might\n// look like the following example.\n//\n//\t\"Condition\": {\"Bool\": {\"aws:MultiFactorAuthPresent\": true}}\n//\n// For more information, see [Configuring MFA-Protected API Access] in the IAM User Guide guide.\n//\n// To use MFA with AssumeRole , you pass values for the SerialNumber and TokenCode\n// parameters. The SerialNumber value identifies the user's hardware or virtual\n// MFA device. The TokenCode is the time-based one-time password (TOTP) that the\n// MFA device produces.\n//\n// [Configuring MFA-Protected API Access]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html\n// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining\n// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\n// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [IAM Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html\n// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\n// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html\nfunc (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) {\n\tif params == nil {\n\t\tparams = &AssumeRoleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AssumeRole\", params, optFns, c.addOperationAssumeRoleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*AssumeRoleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype AssumeRoleInput struct {\n\n\t// The Amazon Resource Name (ARN) of the role to assume.\n\t//\n\t// This member is required.\n\tRoleArn *string\n\n\t// An identifier for the assumed role session.\n\t//\n\t// Use the role session name to uniquely identify a session when the same role is\n\t// assumed by different principals or for different reasons. In cross-account\n\t// scenarios, the role session name is visible to, and can be logged by the account\n\t// that owns the role. The role session name is also used in the ARN of the assumed\n\t// role principal. This means that subsequent cross-account API requests that use\n\t// the temporary security credentials will expose the role session name to the\n\t// external account in their CloudTrail logs.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// This member is required.\n\tRoleSessionName *string\n\n\t// The duration, in seconds, of the role session. The value specified can range\n\t// from 900 seconds (15 minutes) up to the maximum session duration set for the\n\t// role. The maximum session duration setting can have a value from 1 hour to 12\n\t// hours. If you specify a value higher than this setting or the administrator\n\t// setting (whichever is lower), the operation fails. For example, if you specify a\n\t// session duration of 12 hours, but your administrator set the maximum session\n\t// duration to 6 hours, your operation fails.\n\t//\n\t// Role chaining limits your Amazon Web Services CLI or Amazon Web Services API\n\t// role session to a maximum of one hour. When you use the AssumeRole API\n\t// operation to assume a role, you can specify the duration of your role session\n\t// with the DurationSeconds parameter. You can specify a parameter value of up to\n\t// 43200 seconds (12 hours), depending on the maximum session duration setting for\n\t// your role. However, if you assume a role using role chaining and provide a\n\t// DurationSeconds parameter value greater than one hour, the operation fails. To\n\t// learn how to view the maximum value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.\n\t//\n\t// By default, the value is set to 3600 seconds.\n\t//\n\t// The DurationSeconds parameter is separate from the duration of a console\n\t// session that you might request using the returned credentials. The request to\n\t// the federation endpoint for a console sign-in token takes a SessionDuration\n\t// parameter that specifies the maximum length of the console session. For more\n\t// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.\n\t//\n\t// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session\n\t// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\n\tDurationSeconds *int32\n\n\t// A unique identifier that might be required when you assume a role in another\n\t// account. If the administrator of the account to which the role belongs provided\n\t// you with an external ID, then provide that value in the ExternalId parameter.\n\t// This value can be any string, such as a passphrase or account number. A\n\t// cross-account role is usually set up to trust everyone in an account. Therefore,\n\t// the administrator of the trusting account might send an external ID to the\n\t// administrator of the trusted account. That way, only someone with the ID can\n\t// assume the role, rather than everyone in the account. For more information about\n\t// the external ID, see [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]in the IAM User Guide.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@:/-\n\t//\n\t// [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html\n\tExternalId *string\n\n\t// An IAM policy in JSON format that you want to use as an inline session policy.\n\t//\n\t// This parameter is optional. Passing policies to this operation returns new\n\t// temporary credentials. The resulting session's permissions are the intersection\n\t// of the role's identity-based policy and the session policies. You can use the\n\t// role's temporary credentials in subsequent Amazon Web Services API calls to\n\t// access resources in the account that owns the role. You cannot use session\n\t// policies to grant more permissions than those allowed by the identity-based\n\t// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM\n\t// User Guide.\n\t//\n\t// The plaintext that you use for both inline and managed session policies can't\n\t// exceed 2,048 characters. The JSON policy characters can be any ASCII character\n\t// from the space character to the end of the valid character list (\\u0020 through\n\t// \\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A), and carriage\n\t// return (\\u000D) characters.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\tPolicy *string\n\n\t// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to\n\t// use as managed session policies. The policies must exist in the same account as\n\t// the role.\n\t//\n\t// This parameter is optional. You can provide up to 10 managed policy ARNs.\n\t// However, the plaintext that you use for both inline and managed session policies\n\t// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the\n\t// Amazon Web Services General Reference.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// Passing policies to this operation returns new temporary credentials. The\n\t// resulting session's permissions are the intersection of the role's\n\t// identity-based policy and the session policies. You can use the role's temporary\n\t// credentials in subsequent Amazon Web Services API calls to access resources in\n\t// the account that owns the role. You cannot use session policies to grant more\n\t// permissions than those allowed by the identity-based policy of the role that is\n\t// being assumed. For more information, see [Session Policies]in the IAM User Guide.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\n\tPolicyArns []types.PolicyDescriptorType\n\n\t// A list of previously acquired trusted context assertions in the format of a\n\t// JSON array. The trusted context assertion is signed and encrypted by Amazon Web\n\t// Services STS.\n\t//\n\t// The following is an example of a ProvidedContext value that includes a single\n\t// trusted context assertion and the ARN of the context provider from which the\n\t// trusted context assertion was generated.\n\t//\n\t//     [{\"ProviderArn\":\"arn:aws:iam::aws:contextProvider/IdentityCenter\",\"ContextAssertion\":\"trusted-context-assertion\"}]\n\tProvidedContexts []types.ProvidedContext\n\n\t// The identification number of the MFA device that is associated with the user\n\t// who is making the AssumeRole call. Specify this value if the trust policy of\n\t// the role being assumed includes a condition that requires MFA authentication.\n\t// The value is either the serial number for a hardware device (such as\n\t// GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as\n\t// arn:aws:iam::123456789012:mfa/user ).\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\tSerialNumber *string\n\n\t// The source identity specified by the principal that is calling the AssumeRole\n\t// operation.\n\t//\n\t// You can require users to specify a source identity when they assume a role. You\n\t// do this by using the sts:SourceIdentity condition key in a role trust policy.\n\t// You can use source identity information in CloudTrail logs to determine who took\n\t// actions with a role. You can use the aws:SourceIdentity condition key to\n\t// further control access to Amazon Web Services resources based on the value of\n\t// source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the\n\t// IAM User Guide.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-. You cannot use a\n\t// value that begins with the text aws: . This prefix is reserved for Amazon Web\n\t// Services internal use.\n\t//\n\t// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html\n\tSourceIdentity *string\n\n\t// A list of session tags that you want to pass. Each session tag consists of a\n\t// key name and an associated value. For more information about session tags, see [Tagging Amazon Web Services STS Sessions]\n\t// in the IAM User Guide.\n\t//\n\t// This parameter is optional. You can pass up to 50 session tags. The plaintext\n\t// session tag keys can’t exceed 128 characters, and the values can’t exceed 256\n\t// characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// You can pass a session tag with the same key as a tag that is already attached\n\t// to the role. When you do, session tags override a role tag with the same key.\n\t//\n\t// Tag key–value pairs are not case sensitive, but case is preserved. This means\n\t// that you cannot have separate Department and department tag keys. Assume that\n\t// the role has the Department = Marketing tag and you pass the department =\n\t// engineering session tag. Department and department are not saved as separate\n\t// tags, and the session tag passed in the request takes precedence over the role\n\t// tag.\n\t//\n\t// Additionally, if you used temporary credentials to perform this operation, the\n\t// new session inherits any transitive session tags from the calling session. If\n\t// you pass a session tag with the same key as an inherited tag, the operation\n\t// fails. To view the inherited tags for a session, see the CloudTrail logs. For\n\t// more information, see [Viewing Session Tags in CloudTrail]in the IAM User Guide.\n\t//\n\t// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n\t// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n\t// [Viewing Session Tags in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs\n\tTags []types.Tag\n\n\t// The value provided by the MFA device, if the trust policy of the role being\n\t// assumed requires MFA. (In other words, if the policy includes a condition that\n\t// tests for MFA). If the role being assumed requires MFA and if the TokenCode\n\t// value is missing or expired, the AssumeRole call returns an \"access denied\"\n\t// error.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a sequence\n\t// of six numeric digits.\n\tTokenCode *string\n\n\t// A list of keys for session tags that you want to set as transitive. If you set\n\t// a tag key as transitive, the corresponding key and value passes to subsequent\n\t// sessions in a role chain. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.\n\t//\n\t// This parameter is optional. When you set session tags as transitive, the\n\t// session policy and session tags packed binary limit is not affected.\n\t//\n\t// If you choose not to specify a transitive tag key, then no tags are passed from\n\t// this session to any subsequent sessions.\n\t//\n\t// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining\n\tTransitiveTagKeys []string\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful AssumeRole request, including temporary Amazon Web\n// Services credentials that can be used to make Amazon Web Services requests.\ntype AssumeRoleOutput struct {\n\n\t// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers\n\t// that you can use to refer to the resulting temporary security credentials. For\n\t// example, you can reference these credentials as a principal in a resource-based\n\t// policy by using the ARN or assumed role ID. The ARN and ID include the\n\t// RoleSessionName that you specified when you called AssumeRole .\n\tAssumedRoleUser *types.AssumedRoleUser\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t// The size of the security token that STS API operations return is not fixed. We\n\t// strongly recommend that you make no assumptions about the maximum size.\n\tCredentials *types.Credentials\n\n\t// A percentage value that indicates the packed size of the session policies and\n\t// session tags combined passed in the request. The request fails if the packed\n\t// size is greater than 100 percent, which means the policies and tags exceeded the\n\t// allowed space.\n\tPackedPolicySize *int32\n\n\t// The source identity specified by the principal that is calling the AssumeRole\n\t// operation.\n\t//\n\t// You can require users to specify a source identity when they assume a role. You\n\t// do this by using the sts:SourceIdentity condition key in a role trust policy.\n\t// You can use source identity information in CloudTrail logs to determine who took\n\t// actions with a role. You can use the aws:SourceIdentity condition key to\n\t// further control access to Amazon Web Services resources based on the value of\n\t// source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the\n\t// IAM User Guide.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html\n\tSourceIdentity *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRole{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"AssumeRole\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpAssumeRoleValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"AssumeRole\",\n\t}\n}\n\n// PresignAssumeRole is used to generate a presigned HTTP Request which contains\n// presigned URL, signed headers and HTTP method used.\nfunc (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) {\n\tif params == nil {\n\t\tparams = &AssumeRoleInput{}\n\t}\n\toptions := c.options.copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\tclientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption)\n\n\tresult, _, err := c.client.invokeOperation(ctx, \"AssumeRole\", params, clientOptFns,\n\t\tc.client.addOperationAssumeRoleMiddlewares,\n\t\tpresignConverter(options).convertToPresignMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*v4.PresignedHTTPRequest)\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a set of temporary security credentials for users who have been\n// authenticated via a SAML authentication response. This operation provides a\n// mechanism for tying an enterprise identity store or directory to role-based\n// Amazon Web Services access without user-specific credentials or configuration.\n// For a comparison of AssumeRoleWithSAML with the other API operations that\n// produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide.\n//\n// The temporary security credentials returned by this operation consist of an\n// access key ID, a secret access key, and a security token. Applications can use\n// these temporary security credentials to sign calls to Amazon Web Services\n// services.\n//\n// # Session Duration\n//\n// By default, the temporary security credentials created by AssumeRoleWithSAML\n// last for one hour. However, you can use the optional DurationSeconds parameter\n// to specify the duration of your session. Your role session lasts for the\n// duration that you specify, or until the time specified in the SAML\n// authentication response's SessionNotOnOrAfter value, whichever is shorter. You\n// can provide a DurationSeconds value from 900 seconds (15 minutes) up to the\n// maximum session duration setting for the role. This setting can have a value\n// from 1 hour to 12 hours. To learn how to view the maximum value for your role,\n// see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. The maximum session duration limit applies when you\n// use the AssumeRole* API operations or the assume-role* CLI commands. However\n// the limit does not apply when you use those operations to create a console URL.\n// For more information, see [Using IAM Roles]in the IAM User Guide.\n//\n// [Role chaining]limits your CLI or Amazon Web Services API role session to a maximum of one\n// hour. When you use the AssumeRole API operation to assume a role, you can\n// specify the duration of your role session with the DurationSeconds parameter.\n// You can specify a parameter value of up to 43200 seconds (12 hours), depending\n// on the maximum session duration setting for your role. However, if you assume a\n// role using role chaining and provide a DurationSeconds parameter value greater\n// than one hour, the operation fails.\n//\n// # Permissions\n//\n// The temporary security credentials created by AssumeRoleWithSAML can be used to\n// make API calls to any Amazon Web Services service with the following exception:\n// you cannot call the STS GetFederationToken or GetSessionToken API operations.\n//\n// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a\n// single JSON policy document to use as an inline session policy. You can also\n// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed\n// session policies. The plaintext that you use for both inline and managed session\n// policies can't exceed 2,048 characters. Passing policies to this operation\n// returns new temporary credentials. The resulting session's permissions are the\n// intersection of the role's identity-based policy and the session policies. You\n// can use the role's temporary credentials in subsequent Amazon Web Services API\n// calls to access resources in the account that owns the role. You cannot use\n// session policies to grant more permissions than those allowed by the\n// identity-based policy of the role that is being assumed. For more information,\n// see [Session Policies]in the IAM User Guide.\n//\n// Calling AssumeRoleWithSAML does not require the use of Amazon Web Services\n// security credentials. The identity of the caller is validated by using keys in\n// the metadata document that is uploaded for the SAML provider entity for your\n// identity provider.\n//\n// Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. The\n// entry includes the value in the NameID element of the SAML assertion. We\n// recommend that you use a NameIDType that is not associated with any personally\n// identifiable information (PII). For example, you could instead use the\n// persistent identifier ( urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ).\n//\n// # Tags\n//\n// (Optional) You can configure your IdP to pass attributes into your SAML\n// assertion as session tags. Each session tag consists of a key name and an\n// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User\n// Guide.\n//\n// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed\n// 128 characters and the values can’t exceed 256 characters. For these and\n// additional limits, see [IAM and STS Character Limits]in the IAM User Guide.\n//\n// An Amazon Web Services conversion compresses the passed inline session policy,\n// managed policy ARNs, and session tags into a packed binary format that has a\n// separate limit. Your request can fail for this limit even if your plaintext\n// meets the other requirements. The PackedPolicySize response element indicates\n// by percentage how close the policies and tags for your request are to the upper\n// size limit.\n//\n// You can pass a session tag with the same key as a tag that is attached to the\n// role. When you do, session tags override the role's tags with the same key.\n//\n// An administrator must grant you the permissions necessary to pass session tags.\n// The administrator can also create granular permissions to allow you to pass only\n// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.\n//\n// You can set the session tags as transitive. Transitive tags persist during role\n// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.\n//\n// # SAML Configuration\n//\n// Before your application can call AssumeRoleWithSAML , you must configure your\n// SAML identity provider (IdP) to issue the claims required by Amazon Web\n// Services. Additionally, you must use Identity and Access Management (IAM) to\n// create a SAML provider entity in your Amazon Web Services account that\n// represents your identity provider. You must also create an IAM role that\n// specifies this SAML provider in its trust policy.\n//\n// For more information, see the following resources:\n//\n// [About SAML 2.0-based Federation]\n//   - in the IAM User Guide.\n//\n// [Creating SAML Identity Providers]\n//   - in the IAM User Guide.\n//\n// [Configuring a Relying Party and Claims]\n//   - in the IAM User Guide.\n//\n// [Creating a Role for SAML 2.0 Federation]\n//   - in the IAM User Guide.\n//\n// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session\n// [Creating a Role for SAML 2.0 Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html\n// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\n// [Creating SAML Identity Providers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html\n// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\n// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html\n// [Configuring a Relying Party and Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html\n// [Role chaining]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining\n// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html\n// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n// [About SAML 2.0-based Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html\n// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining\nfunc (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) {\n\tif params == nil {\n\t\tparams = &AssumeRoleWithSAMLInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AssumeRoleWithSAML\", params, optFns, c.addOperationAssumeRoleWithSAMLMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*AssumeRoleWithSAMLOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype AssumeRoleWithSAMLInput struct {\n\n\t// The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the\n\t// IdP.\n\t//\n\t// This member is required.\n\tPrincipalArn *string\n\n\t// The Amazon Resource Name (ARN) of the role that the caller is assuming.\n\t//\n\t// This member is required.\n\tRoleArn *string\n\n\t// The base64 encoded SAML authentication response provided by the IdP.\n\t//\n\t// For more information, see [Configuring a Relying Party and Adding Claims] in the IAM User Guide.\n\t//\n\t// [Configuring a Relying Party and Adding Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html\n\t//\n\t// This member is required.\n\tSAMLAssertion *string\n\n\t// The duration, in seconds, of the role session. Your role session lasts for the\n\t// duration that you specify for the DurationSeconds parameter, or until the time\n\t// specified in the SAML authentication response's SessionNotOnOrAfter value,\n\t// whichever is shorter. You can provide a DurationSeconds value from 900 seconds\n\t// (15 minutes) up to the maximum session duration setting for the role. This\n\t// setting can have a value from 1 hour to 12 hours. If you specify a value higher\n\t// than this setting, the operation fails. For example, if you specify a session\n\t// duration of 12 hours, but your administrator set the maximum session duration to\n\t// 6 hours, your operation fails. To learn how to view the maximum value for your\n\t// role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.\n\t//\n\t// By default, the value is set to 3600 seconds.\n\t//\n\t// The DurationSeconds parameter is separate from the duration of a console\n\t// session that you might request using the returned credentials. The request to\n\t// the federation endpoint for a console sign-in token takes a SessionDuration\n\t// parameter that specifies the maximum length of the console session. For more\n\t// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.\n\t//\n\t// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session\n\t// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\n\tDurationSeconds *int32\n\n\t// An IAM policy in JSON format that you want to use as an inline session policy.\n\t//\n\t// This parameter is optional. Passing policies to this operation returns new\n\t// temporary credentials. The resulting session's permissions are the intersection\n\t// of the role's identity-based policy and the session policies. You can use the\n\t// role's temporary credentials in subsequent Amazon Web Services API calls to\n\t// access resources in the account that owns the role. You cannot use session\n\t// policies to grant more permissions than those allowed by the identity-based\n\t// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM\n\t// User Guide.\n\t//\n\t// The plaintext that you use for both inline and managed session policies can't\n\t// exceed 2,048 characters. The JSON policy characters can be any ASCII character\n\t// from the space character to the end of the valid character list (\\u0020 through\n\t// \\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A), and carriage\n\t// return (\\u000D) characters.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\tPolicy *string\n\n\t// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to\n\t// use as managed session policies. The policies must exist in the same account as\n\t// the role.\n\t//\n\t// This parameter is optional. You can provide up to 10 managed policy ARNs.\n\t// However, the plaintext that you use for both inline and managed session policies\n\t// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the\n\t// Amazon Web Services General Reference.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// Passing policies to this operation returns new temporary credentials. The\n\t// resulting session's permissions are the intersection of the role's\n\t// identity-based policy and the session policies. You can use the role's temporary\n\t// credentials in subsequent Amazon Web Services API calls to access resources in\n\t// the account that owns the role. You cannot use session policies to grant more\n\t// permissions than those allowed by the identity-based policy of the role that is\n\t// being assumed. For more information, see [Session Policies]in the IAM User Guide.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\n\tPolicyArns []types.PolicyDescriptorType\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web\n// Services credentials that can be used to make Amazon Web Services requests.\ntype AssumeRoleWithSAMLOutput struct {\n\n\t// The identifiers for the temporary security credentials that the operation\n\t// returns.\n\tAssumedRoleUser *types.AssumedRoleUser\n\n\t//  The value of the Recipient attribute of the SubjectConfirmationData element of\n\t// the SAML assertion.\n\tAudience *string\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t// The size of the security token that STS API operations return is not fixed. We\n\t// strongly recommend that you make no assumptions about the maximum size.\n\tCredentials *types.Credentials\n\n\t// The value of the Issuer element of the SAML assertion.\n\tIssuer *string\n\n\t// A hash value based on the concatenation of the following:\n\t//\n\t//   - The Issuer response value.\n\t//\n\t//   - The Amazon Web Services account ID.\n\t//\n\t//   - The friendly name (the last part of the ARN) of the SAML provider in IAM.\n\t//\n\t// The combination of NameQualifier and Subject can be used to uniquely identify a\n\t// user.\n\t//\n\t// The following pseudocode shows how the hash value is calculated:\n\t//\n\t//     BASE64 ( SHA1 ( \"https://example.com/saml\" + \"123456789012\" + \"/MySAMLIdP\" ) )\n\tNameQualifier *string\n\n\t// A percentage value that indicates the packed size of the session policies and\n\t// session tags combined passed in the request. The request fails if the packed\n\t// size is greater than 100 percent, which means the policies and tags exceeded the\n\t// allowed space.\n\tPackedPolicySize *int32\n\n\t// The value in the SourceIdentity attribute in the SAML assertion.\n\t//\n\t// You can require users to set a source identity value when they assume a role.\n\t// You do this by using the sts:SourceIdentity condition key in a role trust\n\t// policy. That way, actions that are taken with the role are associated with that\n\t// user. After the source identity is set, the value cannot be changed. It is\n\t// present in the request for all actions that are taken by the role and persists\n\t// across [chained role]sessions. You can configure your SAML identity provider to use an\n\t// attribute associated with your users, like user name or email, as the source\n\t// identity when calling AssumeRoleWithSAML . You do this by adding an attribute to\n\t// the SAML assertion. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in\n\t// the IAM User Guide.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining\n\t// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html\n\tSourceIdentity *string\n\n\t// The value of the NameID element in the Subject element of the SAML assertion.\n\tSubject *string\n\n\t//  The format of the name ID, as defined by the Format attribute in the NameID\n\t// element of the SAML assertion. Typical examples of the format are transient or\n\t// persistent .\n\t//\n\t// If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format ,\n\t// that prefix is removed. For example,\n\t// urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient .\n\t// If the format includes any other prefix, the format is returned with no\n\t// modifications.\n\tSubjectType *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithSAML{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"AssumeRoleWithSAML\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"AssumeRoleWithSAML\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a set of temporary security credentials for users who have been\n// authenticated in a mobile or web application with a web identity provider.\n// Example providers include the OAuth 2.0 providers Login with Amazon and\n// Facebook, or any OpenID Connect-compatible identity provider such as Google or [Amazon Cognito federated identities].\n//\n// For mobile applications, we recommend that you use Amazon Cognito. You can use\n// Amazon Cognito with the [Amazon Web Services SDK for iOS Developer Guide]and the [Amazon Web Services SDK for Android Developer Guide] to uniquely identify a user. You can also\n// supply the user with a consistent identity throughout the lifetime of an\n// application.\n//\n// To learn more about Amazon Cognito, see [Amazon Cognito identity pools] in Amazon Cognito Developer Guide.\n//\n// Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web\n// Services security credentials. Therefore, you can distribute an application (for\n// example, on mobile devices) that requests temporary security credentials without\n// including long-term Amazon Web Services credentials in the application. You also\n// don't need to deploy server-based proxy services that use long-term Amazon Web\n// Services credentials. Instead, the identity of the caller is validated by using\n// a token from the web identity provider. For a comparison of\n// AssumeRoleWithWebIdentity with the other API operations that produce temporary\n// credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide.\n//\n// The temporary security credentials returned by this API consist of an access\n// key ID, a secret access key, and a security token. Applications can use these\n// temporary security credentials to sign calls to Amazon Web Services service API\n// operations.\n//\n// # Session Duration\n//\n// By default, the temporary security credentials created by\n// AssumeRoleWithWebIdentity last for one hour. However, you can use the optional\n// DurationSeconds parameter to specify the duration of your session. You can\n// provide a value from 900 seconds (15 minutes) up to the maximum session duration\n// setting for the role. This setting can have a value from 1 hour to 12 hours. To\n// learn how to view the maximum value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.\n// The maximum session duration limit applies when you use the AssumeRole* API\n// operations or the assume-role* CLI commands. However the limit does not apply\n// when you use those operations to create a console URL. For more information, see\n// [Using IAM Roles]in the IAM User Guide.\n//\n// # Permissions\n//\n// The temporary security credentials created by AssumeRoleWithWebIdentity can be\n// used to make API calls to any Amazon Web Services service with the following\n// exception: you cannot call the STS GetFederationToken or GetSessionToken API\n// operations.\n//\n// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a\n// single JSON policy document to use as an inline session policy. You can also\n// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed\n// session policies. The plaintext that you use for both inline and managed session\n// policies can't exceed 2,048 characters. Passing policies to this operation\n// returns new temporary credentials. The resulting session's permissions are the\n// intersection of the role's identity-based policy and the session policies. You\n// can use the role's temporary credentials in subsequent Amazon Web Services API\n// calls to access resources in the account that owns the role. You cannot use\n// session policies to grant more permissions than those allowed by the\n// identity-based policy of the role that is being assumed. For more information,\n// see [Session Policies]in the IAM User Guide.\n//\n// # Tags\n//\n// (Optional) You can configure your IdP to pass attributes into your web identity\n// token as session tags. Each session tag consists of a key name and an associated\n// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide.\n//\n// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed\n// 128 characters and the values can’t exceed 256 characters. For these and\n// additional limits, see [IAM and STS Character Limits]in the IAM User Guide.\n//\n// An Amazon Web Services conversion compresses the passed inline session policy,\n// managed policy ARNs, and session tags into a packed binary format that has a\n// separate limit. Your request can fail for this limit even if your plaintext\n// meets the other requirements. The PackedPolicySize response element indicates\n// by percentage how close the policies and tags for your request are to the upper\n// size limit.\n//\n// You can pass a session tag with the same key as a tag that is attached to the\n// role. When you do, the session tag overrides the role tag with the same key.\n//\n// An administrator must grant you the permissions necessary to pass session tags.\n// The administrator can also create granular permissions to allow you to pass only\n// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.\n//\n// You can set the session tags as transitive. Transitive tags persist during role\n// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.\n//\n// # Identities\n//\n// Before your application can call AssumeRoleWithWebIdentity , you must have an\n// identity token from a supported identity provider and create a role that the\n// application can assume. The role that your application assumes must trust the\n// identity provider that is associated with the identity token. In other words,\n// the identity provider must be specified in the role's trust policy.\n//\n// Calling AssumeRoleWithWebIdentity can result in an entry in your CloudTrail\n// logs. The entry includes the [Subject]of the provided web identity token. We recommend\n// that you avoid using any personally identifiable information (PII) in this\n// field. For example, you could instead use a GUID or a pairwise identifier, as [suggested in the OIDC specification].\n//\n// For more information about how to use web identity federation and the\n// AssumeRoleWithWebIdentity API, see the following resources:\n//\n// [Using Web Identity Federation API Operations for Mobile Apps]\n//   - and [Federation Through a Web-based Identity Provider].\n//\n// [Web Identity Federation Playground]\n//   - . Walk through the process of authenticating through Login with Amazon,\n//     Facebook, or Google, getting temporary security credentials, and then using\n//     those credentials to make a request to Amazon Web Services.\n//\n// [Amazon Web Services SDK for iOS Developer Guide]\n//   - and [Amazon Web Services SDK for Android Developer Guide]. These toolkits contain sample apps that show how to invoke the\n//     identity providers. The toolkits then show how to use the information from these\n//     providers to get and use temporary security credentials.\n//\n// [Web Identity Federation with Mobile Applications]\n//   - . This article discusses web identity federation and shows an example of\n//     how to use web identity federation to get access to content in Amazon S3.\n//\n// [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/\n// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session\n// [Web Identity Federation Playground]: https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/\n// [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/\n// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\n// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\n// [Subject]: http://openid.net/specs/openid-connect-core-1_0.html#Claims\n// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html\n// [Amazon Cognito identity pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html\n// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity\n// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html\n// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html\n// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining\n// [Web Identity Federation with Mobile Applications]: http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications\n// [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html\n// [suggested in the OIDC specification]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes\nfunc (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) {\n\tif params == nil {\n\t\tparams = &AssumeRoleWithWebIdentityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AssumeRoleWithWebIdentity\", params, optFns, c.addOperationAssumeRoleWithWebIdentityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*AssumeRoleWithWebIdentityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype AssumeRoleWithWebIdentityInput struct {\n\n\t// The Amazon Resource Name (ARN) of the role that the caller is assuming.\n\t//\n\t// This member is required.\n\tRoleArn *string\n\n\t// An identifier for the assumed role session. Typically, you pass the name or\n\t// identifier that is associated with the user who is using your application. That\n\t// way, the temporary security credentials that your application will use are\n\t// associated with that user. This session name is included as part of the ARN and\n\t// assumed role ID in the AssumedRoleUser response element.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// This member is required.\n\tRoleSessionName *string\n\n\t// The OAuth 2.0 access token or OpenID Connect ID token that is provided by the\n\t// identity provider. Your application must get this token by authenticating the\n\t// user who is using your application with a web identity provider before the\n\t// application makes an AssumeRoleWithWebIdentity call. Only tokens with RSA\n\t// algorithms (RS256) are supported.\n\t//\n\t// This member is required.\n\tWebIdentityToken *string\n\n\t// The duration, in seconds, of the role session. The value can range from 900\n\t// seconds (15 minutes) up to the maximum session duration setting for the role.\n\t// This setting can have a value from 1 hour to 12 hours. If you specify a value\n\t// higher than this setting, the operation fails. For example, if you specify a\n\t// session duration of 12 hours, but your administrator set the maximum session\n\t// duration to 6 hours, your operation fails. To learn how to view the maximum\n\t// value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.\n\t//\n\t// By default, the value is set to 3600 seconds.\n\t//\n\t// The DurationSeconds parameter is separate from the duration of a console\n\t// session that you might request using the returned credentials. The request to\n\t// the federation endpoint for a console sign-in token takes a SessionDuration\n\t// parameter that specifies the maximum length of the console session. For more\n\t// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.\n\t//\n\t// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session\n\t// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\n\tDurationSeconds *int32\n\n\t// An IAM policy in JSON format that you want to use as an inline session policy.\n\t//\n\t// This parameter is optional. Passing policies to this operation returns new\n\t// temporary credentials. The resulting session's permissions are the intersection\n\t// of the role's identity-based policy and the session policies. You can use the\n\t// role's temporary credentials in subsequent Amazon Web Services API calls to\n\t// access resources in the account that owns the role. You cannot use session\n\t// policies to grant more permissions than those allowed by the identity-based\n\t// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM\n\t// User Guide.\n\t//\n\t// The plaintext that you use for both inline and managed session policies can't\n\t// exceed 2,048 characters. The JSON policy characters can be any ASCII character\n\t// from the space character to the end of the valid character list (\\u0020 through\n\t// \\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A), and carriage\n\t// return (\\u000D) characters.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\tPolicy *string\n\n\t// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to\n\t// use as managed session policies. The policies must exist in the same account as\n\t// the role.\n\t//\n\t// This parameter is optional. You can provide up to 10 managed policy ARNs.\n\t// However, the plaintext that you use for both inline and managed session policies\n\t// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the\n\t// Amazon Web Services General Reference.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// Passing policies to this operation returns new temporary credentials. The\n\t// resulting session's permissions are the intersection of the role's\n\t// identity-based policy and the session policies. You can use the role's temporary\n\t// credentials in subsequent Amazon Web Services API calls to access resources in\n\t// the account that owns the role. You cannot use session policies to grant more\n\t// permissions than those allowed by the identity-based policy of the role that is\n\t// being assumed. For more information, see [Session Policies]in the IAM User Guide.\n\t//\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\n\tPolicyArns []types.PolicyDescriptorType\n\n\t// The fully qualified host component of the domain name of the OAuth 2.0 identity\n\t// provider. Do not specify this value for an OpenID Connect identity provider.\n\t//\n\t// Currently www.amazon.com and graph.facebook.com are the only supported identity\n\t// providers for OAuth 2.0 access tokens. Do not include URL schemes and port\n\t// numbers.\n\t//\n\t// Do not specify this value for OpenID Connect ID tokens.\n\tProviderId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web\n// Services credentials that can be used to make Amazon Web Services requests.\ntype AssumeRoleWithWebIdentityOutput struct {\n\n\t// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers\n\t// that you can use to refer to the resulting temporary security credentials. For\n\t// example, you can reference these credentials as a principal in a resource-based\n\t// policy by using the ARN or assumed role ID. The ARN and ID include the\n\t// RoleSessionName that you specified when you called AssumeRole .\n\tAssumedRoleUser *types.AssumedRoleUser\n\n\t// The intended audience (also known as client ID) of the web identity token. This\n\t// is traditionally the client identifier issued to the application that requested\n\t// the web identity token.\n\tAudience *string\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security token.\n\t//\n\t// The size of the security token that STS API operations return is not fixed. We\n\t// strongly recommend that you make no assumptions about the maximum size.\n\tCredentials *types.Credentials\n\n\t// A percentage value that indicates the packed size of the session policies and\n\t// session tags combined passed in the request. The request fails if the packed\n\t// size is greater than 100 percent, which means the policies and tags exceeded the\n\t// allowed space.\n\tPackedPolicySize *int32\n\n\t//  The issuing authority of the web identity token presented. For OpenID Connect\n\t// ID tokens, this contains the value of the iss field. For OAuth 2.0 access\n\t// tokens, this contains the value of the ProviderId parameter that was passed in\n\t// the AssumeRoleWithWebIdentity request.\n\tProvider *string\n\n\t// The value of the source identity that is returned in the JSON web token (JWT)\n\t// from the identity provider.\n\t//\n\t// You can require users to set a source identity value when they assume a role.\n\t// You do this by using the sts:SourceIdentity condition key in a role trust\n\t// policy. That way, actions that are taken with the role are associated with that\n\t// user. After the source identity is set, the value cannot be changed. It is\n\t// present in the request for all actions that are taken by the role and persists\n\t// across [chained role]sessions. You can configure your identity provider to use an attribute\n\t// associated with your users, like user name or email, as the source identity when\n\t// calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON\n\t// web token. To learn more about OIDC tokens and claims, see [Using Tokens with User Pools]in the Amazon\n\t// Cognito Developer Guide. For more information about using source identity, see [Monitor and control actions taken with assumed roles]\n\t// in the IAM User Guide.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining\n\t// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html\n\t// [Using Tokens with User Pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html\n\tSourceIdentity *string\n\n\t// The unique user identifier that is returned by the identity provider. This\n\t// identifier is associated with the WebIdentityToken that was submitted with the\n\t// AssumeRoleWithWebIdentity call. The identifier is typically unique to the user\n\t// and the application that acquired the WebIdentityToken (pairwise identifier).\n\t// For OpenID Connect ID tokens, this field contains the value returned by the\n\t// identity provider as the token's sub (Subject) claim.\n\tSubjectFromWebIdentityToken *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithWebIdentity{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"AssumeRoleWithWebIdentity\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"AssumeRoleWithWebIdentity\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Decodes additional information about the authorization status of a request from\n// an encoded message returned in response to an Amazon Web Services request.\n//\n// For example, if a user is not authorized to perform an operation that he or she\n// has requested, the request returns a Client.UnauthorizedOperation response (an\n// HTTP 403 response). Some Amazon Web Services operations additionally return an\n// encoded message that can provide details about this authorization failure.\n//\n// Only certain Amazon Web Services operations return an encoded authorization\n// message. The documentation for an individual operation indicates whether that\n// operation returns an encoded message in addition to returning an HTTP code.\n//\n// The message is encoded because the details of the authorization status can\n// contain privileged information that the user who requested the operation should\n// not see. To decode an authorization status message, a user must be granted\n// permissions through an IAM [policy]to request the DecodeAuthorizationMessage (\n// sts:DecodeAuthorizationMessage ) action.\n//\n// The decoded message includes the following type of information:\n//\n//   - Whether the request was denied due to an explicit deny or due to the\n//     absence of an explicit allow. For more information, see [Determining Whether a Request is Allowed or Denied]in the IAM User\n//     Guide.\n//\n//   - The principal who made the request.\n//\n//   - The requested action.\n//\n//   - The requested resource.\n//\n//   - The values of condition keys in the context of the user's request.\n//\n// [Determining Whether a Request is Allowed or Denied]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow\n// [policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html\nfunc (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) {\n\tif params == nil {\n\t\tparams = &DecodeAuthorizationMessageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DecodeAuthorizationMessage\", params, optFns, c.addOperationDecodeAuthorizationMessageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DecodeAuthorizationMessageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype DecodeAuthorizationMessageInput struct {\n\n\t// The encoded message that was returned with the response.\n\t//\n\t// This member is required.\n\tEncodedMessage *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A document that contains additional information about the authorization status\n// of a request from an encoded message that is returned in response to an Amazon\n// Web Services request.\ntype DecodeAuthorizationMessageOutput struct {\n\n\t// The API returns a response with the decoded message.\n\tDecodedMessage *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpDecodeAuthorizationMessage{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"DecodeAuthorizationMessage\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"DecodeAuthorizationMessage\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns the account identifier for the specified access key ID.\n//\n// Access keys consist of two parts: an access key ID (for example,\n// AKIAIOSFODNN7EXAMPLE ) and a secret access key (for example,\n// wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). For more information about access\n// keys, see [Managing Access Keys for IAM Users]in the IAM User Guide.\n//\n// When you pass an access key ID to this operation, it returns the ID of the\n// Amazon Web Services account to which the keys belong. Access key IDs beginning\n// with AKIA are long-term credentials for an IAM user or the Amazon Web Services\n// account root user. Access key IDs beginning with ASIA are temporary credentials\n// that are created using STS operations. If the account in the response belongs to\n// you, you can sign in as the root user and review your root user access keys.\n// Then, you can pull a [credentials report]to learn which IAM user owns the keys. To learn who\n// requested the temporary credentials for an ASIA access key, view the STS events\n// in your [CloudTrail logs]in the IAM User Guide.\n//\n// This operation does not indicate the state of the access key. The key might be\n// active, inactive, or deleted. Active keys might not have permissions to perform\n// an operation. Providing a deleted access key might return an error that the key\n// doesn't exist.\n//\n// [credentials report]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html\n// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html\n// [Managing Access Keys for IAM Users]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html\nfunc (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) {\n\tif params == nil {\n\t\tparams = &GetAccessKeyInfoInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetAccessKeyInfo\", params, optFns, c.addOperationGetAccessKeyInfoMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetAccessKeyInfoOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetAccessKeyInfoInput struct {\n\n\t// The identifier of an access key.\n\t//\n\t// This parameter allows (through its regex pattern) a string of characters that\n\t// can consist of any upper- or lowercase letter or digit.\n\t//\n\t// This member is required.\n\tAccessKeyId *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype GetAccessKeyInfoOutput struct {\n\n\t// The number used to identify the Amazon Web Services account.\n\tAccount *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetAccessKeyInfo{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetAccessKeyInfo\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetAccessKeyInfo\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns details about the IAM user or role whose credentials are used to call\n// the operation.\n//\n// No permissions are required to perform this operation. If an administrator\n// attaches a policy to your identity that explicitly denies access to the\n// sts:GetCallerIdentity action, you can still perform this operation. Permissions\n// are not required because the same information is returned when access is denied.\n// To view an example response, see [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]in the IAM User Guide.\n//\n// [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa\nfunc (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) {\n\tif params == nil {\n\t\tparams = &GetCallerIdentityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetCallerIdentity\", params, optFns, c.addOperationGetCallerIdentityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetCallerIdentityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetCallerIdentityInput struct {\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful GetCallerIdentity request, including information about the\n// entity making the request.\ntype GetCallerIdentityOutput struct {\n\n\t// The Amazon Web Services account ID number of the account that owns or contains\n\t// the calling entity.\n\tAccount *string\n\n\t// The Amazon Web Services ARN associated with the calling entity.\n\tArn *string\n\n\t// The unique identifier of the calling entity. The exact value depends on the\n\t// type of entity that is making the call. The values returned are those listed in\n\t// the aws:userid column in the [Principal table]found on the Policy Variables reference page in\n\t// the IAM User Guide.\n\t//\n\t// [Principal table]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable\n\tUserId *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetCallerIdentity{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetCallerIdentity\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetCallerIdentity\",\n\t}\n}\n\n// PresignGetCallerIdentity is used to generate a presigned HTTP Request which\n// contains presigned URL, signed headers and HTTP method used.\nfunc (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) {\n\tif params == nil {\n\t\tparams = &GetCallerIdentityInput{}\n\t}\n\toptions := c.options.copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\tclientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption)\n\n\tresult, _, err := c.client.invokeOperation(ctx, \"GetCallerIdentity\", params, clientOptFns,\n\t\tc.client.addOperationGetCallerIdentityMiddlewares,\n\t\tpresignConverter(options).convertToPresignMiddleware,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*v4.PresignedHTTPRequest)\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a set of temporary security credentials (consisting of an access key\n// ID, a secret access key, and a security token) for a user. A typical use is in a\n// proxy application that gets temporary security credentials on behalf of\n// distributed applications inside a corporate network.\n//\n// You must call the GetFederationToken operation using the long-term security\n// credentials of an IAM user. As a result, this call is appropriate in contexts\n// where those credentials can be safeguarded, usually in a server-based\n// application. For a comparison of GetFederationToken with the other API\n// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide.\n//\n// Although it is possible to call GetFederationToken using the security\n// credentials of an Amazon Web Services account root user rather than an IAM user\n// that you create for the purpose of a proxy application, we do not recommend it.\n// For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in the IAM User Guide.\n//\n// You can create a mobile-based or browser-based app that can authenticate users\n// using a web identity provider like Login with Amazon, Facebook, Google, or an\n// OpenID Connect-compatible identity provider. In this case, we recommend that you\n// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User\n// Guide.\n//\n// # Session duration\n//\n// The temporary credentials are valid for the specified duration, from 900\n// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default\n// session duration is 43,200 seconds (12 hours). Temporary credentials obtained by\n// using the root user credentials have a maximum duration of 3,600 seconds (1\n// hour).\n//\n// # Permissions\n//\n// You can use the temporary credentials created by GetFederationToken in any\n// Amazon Web Services service with the following exceptions:\n//\n//   - You cannot call any IAM operations using the CLI or the Amazon Web Services\n//     API. This limitation does not apply to console sessions.\n//\n//   - You cannot call any STS operations except GetCallerIdentity .\n//\n// You can use temporary credentials for single sign-on (SSO) to the console.\n//\n// You must pass an inline or managed [session policy] to this operation. You can pass a single\n// JSON policy document to use as an inline session policy. You can also specify up\n// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session\n// policies. The plaintext that you use for both inline and managed session\n// policies can't exceed 2,048 characters.\n//\n// Though the session policy parameters are optional, if you do not pass a policy,\n// then the resulting federated user session has no permissions. When you pass\n// session policies, the session permissions are the intersection of the IAM user\n// policies and the session policies that you pass. This gives you a way to further\n// restrict the permissions for a federated user. You cannot use session policies\n// to grant more permissions than those that are defined in the permissions policy\n// of the IAM user. For more information, see [Session Policies]in the IAM User Guide. For\n// information about using GetFederationToken to create temporary security\n// credentials, see [GetFederationToken—Federation Through a Custom Identity Broker].\n//\n// You can use the credentials to access a resource that has a resource-based\n// policy. If that policy specifically references the federated user session in the\n// Principal element of the policy, the session has the permissions allowed by the\n// policy. These permissions are granted in addition to the permissions granted by\n// the session policies.\n//\n// # Tags\n//\n// (Optional) You can pass tag key-value pairs to your session. These are called\n// session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM User\n// Guide.\n//\n// You can create a mobile-based or browser-based app that can authenticate users\n// using a web identity provider like Login with Amazon, Facebook, Google, or an\n// OpenID Connect-compatible identity provider. In this case, we recommend that you\n// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User\n// Guide.\n//\n// An administrator must grant you the permissions necessary to pass session tags.\n// The administrator can also create granular permissions to allow you to pass only\n// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.\n//\n// Tag key–value pairs are not case sensitive, but case is preserved. This means\n// that you cannot have separate Department and department tag keys. Assume that\n// the user that you are federating has the Department = Marketing tag and you\n// pass the department = engineering session tag. Department and department are\n// not saved as separate tags, and the session tag passed in the request takes\n// precedence over the user tag.\n//\n// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity\n// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Amazon Cognito]: http://aws.amazon.com/cognito/\n// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n// [GetFederationToken—Federation Through a Custom Identity Broker]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken\n// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\n// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials\n// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\n// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html\nfunc (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &GetFederationTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetFederationToken\", params, optFns, c.addOperationGetFederationTokenMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetFederationTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetFederationTokenInput struct {\n\n\t// The name of the federated user. The name is used as an identifier for the\n\t// temporary security credentials (such as Bob ). For example, you can reference\n\t// the federated user name in a resource-based policy, such as in an Amazon S3\n\t// bucket policy.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@-\n\t//\n\t// This member is required.\n\tName *string\n\n\t// The duration, in seconds, that the session should last. Acceptable durations\n\t// for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds\n\t// (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained\n\t// using root user credentials are restricted to a maximum of 3,600 seconds (one\n\t// hour). If the specified duration is longer than one hour, the session obtained\n\t// by using root user credentials defaults to one hour.\n\tDurationSeconds *int32\n\n\t// An IAM policy in JSON format that you want to use as an inline session policy.\n\t//\n\t// You must pass an inline or managed [session policy] to this operation. You can pass a single\n\t// JSON policy document to use as an inline session policy. You can also specify up\n\t// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session\n\t// policies.\n\t//\n\t// This parameter is optional. However, if you do not pass any session policies,\n\t// then the resulting federated user session has no permissions.\n\t//\n\t// When you pass session policies, the session permissions are the intersection of\n\t// the IAM user policies and the session policies that you pass. This gives you a\n\t// way to further restrict the permissions for a federated user. You cannot use\n\t// session policies to grant more permissions than those that are defined in the\n\t// permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User\n\t// Guide.\n\t//\n\t// The resulting credentials can be used to access a resource that has a\n\t// resource-based policy. If that policy specifically references the federated user\n\t// session in the Principal element of the policy, the session has the permissions\n\t// allowed by the policy. These permissions are granted in addition to the\n\t// permissions that are granted by the session policies.\n\t//\n\t// The plaintext that you use for both inline and managed session policies can't\n\t// exceed 2,048 characters. The JSON policy characters can be any ASCII character\n\t// from the space character to the end of the valid character list (\\u0020 through\n\t// \\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A), and carriage\n\t// return (\\u000D) characters.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\tPolicy *string\n\n\t// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to\n\t// use as a managed session policy. The policies must exist in the same account as\n\t// the IAM user that is requesting federated access.\n\t//\n\t// You must pass an inline or managed [session policy] to this operation. You can pass a single\n\t// JSON policy document to use as an inline session policy. You can also specify up\n\t// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session\n\t// policies. The plaintext that you use for both inline and managed session\n\t// policies can't exceed 2,048 characters. You can provide up to 10 managed policy\n\t// ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General\n\t// Reference.\n\t//\n\t// This parameter is optional. However, if you do not pass any session policies,\n\t// then the resulting federated user session has no permissions.\n\t//\n\t// When you pass session policies, the session permissions are the intersection of\n\t// the IAM user policies and the session policies that you pass. This gives you a\n\t// way to further restrict the permissions for a federated user. You cannot use\n\t// session policies to grant more permissions than those that are defined in the\n\t// permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User\n\t// Guide.\n\t//\n\t// The resulting credentials can be used to access a resource that has a\n\t// resource-based policy. If that policy specifically references the federated user\n\t// session in the Principal element of the policy, the session has the permissions\n\t// allowed by the policy. These permissions are granted in addition to the\n\t// permissions that are granted by the session policies.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session\n\t// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\n\tPolicyArns []types.PolicyDescriptorType\n\n\t// A list of session tags. Each session tag consists of a key name and an\n\t// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User\n\t// Guide.\n\t//\n\t// This parameter is optional. You can pass up to 50 session tags. The plaintext\n\t// session tag keys can’t exceed 128 characters and the values can’t exceed 256\n\t// characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide.\n\t//\n\t// An Amazon Web Services conversion compresses the passed inline session policy,\n\t// managed policy ARNs, and session tags into a packed binary format that has a\n\t// separate limit. Your request can fail for this limit even if your plaintext\n\t// meets the other requirements. The PackedPolicySize response element indicates\n\t// by percentage how close the policies and tags for your request are to the upper\n\t// size limit.\n\t//\n\t// You can pass a session tag with the same key as a tag that is already attached\n\t// to the user you are federating. When you do, session tags override a user tag\n\t// with the same key.\n\t//\n\t// Tag key–value pairs are not case sensitive, but case is preserved. This means\n\t// that you cannot have separate Department and department tag keys. Assume that\n\t// the role has the Department = Marketing tag and you pass the department =\n\t// engineering session tag. Department and department are not saved as separate\n\t// tags, and the session tag passed in the request takes precedence over the role\n\t// tag.\n\t//\n\t// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n\t// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n\tTags []types.Tag\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful GetFederationToken request, including temporary Amazon Web\n// Services credentials that can be used to make Amazon Web Services requests.\ntype GetFederationTokenOutput struct {\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t// The size of the security token that STS API operations return is not fixed. We\n\t// strongly recommend that you make no assumptions about the maximum size.\n\tCredentials *types.Credentials\n\n\t// Identifiers for the federated user associated with the credentials (such as\n\t// arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use\n\t// the federated user's ARN in your resource-based policies, such as an Amazon S3\n\t// bucket policy.\n\tFederatedUser *types.FederatedUser\n\n\t// A percentage value that indicates the packed size of the session policies and\n\t// session tags combined passed in the request. The request fails if the packed\n\t// size is greater than 100 percent, which means the policies and tags exceeded the\n\t// allowed space.\n\tPackedPolicySize *int32\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetFederationToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetFederationToken\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addOpGetFederationTokenValidationMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetFederationToken\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Returns a set of temporary credentials for an Amazon Web Services account or\n// IAM user. The credentials consist of an access key ID, a secret access key, and\n// a security token. Typically, you use GetSessionToken if you want to use MFA to\n// protect programmatic calls to specific Amazon Web Services API operations like\n// Amazon EC2 StopInstances .\n//\n// MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is\n// associated with their MFA device. Using the temporary security credentials that\n// the call returns, IAM users can then make programmatic calls to API operations\n// that require MFA authentication. An incorrect MFA code causes the API to return\n// an access denied error. For a comparison of GetSessionToken with the other API\n// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide.\n//\n// No permissions are required for users to perform this operation. The purpose of\n// the sts:GetSessionToken operation is to authenticate the user using MFA. You\n// cannot use policies to control authentication operations. For more information,\n// see [Permissions for GetSessionToken]in the IAM User Guide.\n//\n// # Session Duration\n//\n// The GetSessionToken operation must be called by using the long-term Amazon Web\n// Services security credentials of an IAM user. Credentials that are created by\n// IAM users are valid for the duration that you specify. This duration can range\n// from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours),\n// with a default of 43,200 seconds (12 hours). Credentials based on account\n// credentials can range from 900 seconds (15 minutes) up to 3,600 seconds (1\n// hour), with a default of 1 hour.\n//\n// # Permissions\n//\n// The temporary security credentials created by GetSessionToken can be used to\n// make API calls to any Amazon Web Services service with the following exceptions:\n//\n//   - You cannot call any IAM API operations unless MFA authentication\n//     information is included in the request.\n//\n//   - You cannot call any STS API except AssumeRole or GetCallerIdentity .\n//\n// The credentials that GetSessionToken returns are based on permissions\n// associated with the IAM user whose credentials were used to call the operation.\n// The temporary credentials have the same permissions as the IAM user.\n//\n// Although it is possible to call GetSessionToken using the security credentials\n// of an Amazon Web Services account root user rather than an IAM user, we do not\n// recommend it. If GetSessionToken is called using root user credentials, the\n// temporary credentials have root user permissions. For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in\n// the IAM User Guide\n//\n// For more information about using GetSessionToken to create temporary\n// credentials, see [Temporary Credentials for Users in Untrusted Environments]in the IAM User Guide.\n//\n// [Permissions for GetSessionToken]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html\n// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\n// [Temporary Credentials for Users in Untrusted Environments]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken\n// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials\n// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\nfunc (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) {\n\tif params == nil {\n\t\tparams = &GetSessionTokenInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetSessionToken\", params, optFns, c.addOperationGetSessionTokenMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetSessionTokenOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype GetSessionTokenInput struct {\n\n\t// The duration, in seconds, that the credentials should remain valid. Acceptable\n\t// durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600\n\t// seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions for\n\t// Amazon Web Services account owners are restricted to a maximum of 3,600 seconds\n\t// (one hour). If the duration is longer than one hour, the session for Amazon Web\n\t// Services account owners defaults to one hour.\n\tDurationSeconds *int32\n\n\t// The identification number of the MFA device that is associated with the IAM\n\t// user who is making the GetSessionToken call. Specify this value if the IAM user\n\t// has a policy that requires MFA authentication. The value is either the serial\n\t// number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name\n\t// (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You\n\t// can find the device for an IAM user by going to the Amazon Web Services\n\t// Management Console and viewing the user's security credentials.\n\t//\n\t// The regex used to validate this parameter is a string of characters consisting\n\t// of upper- and lower-case alphanumeric characters with no spaces. You can also\n\t// include underscores or any of the following characters: =,.@:/-\n\tSerialNumber *string\n\n\t// The value provided by the MFA device, if MFA is required. If any policy\n\t// requires the IAM user to submit an MFA code, specify this value. If MFA\n\t// authentication is required, the user must provide a code when requesting a set\n\t// of temporary security credentials. A user who fails to provide the code receives\n\t// an \"access denied\" response when requesting resources that require MFA\n\t// authentication.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a sequence\n\t// of six numeric digits.\n\tTokenCode *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains the response to a successful GetSessionToken request, including temporary Amazon Web\n// Services credentials that can be used to make Amazon Web Services requests.\ntype GetSessionTokenOutput struct {\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t// The size of the security token that STS API operations return is not fixed. We\n\t// strongly recommend that you make no assumptions about the maximum size.\n\tCredentials *types.Credentials\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {\n\tif err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {\n\t\treturn err\n\t}\n\terr = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSessionToken{}, middleware.After)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := addProtocolFinalizerMiddlewares(stack, options, \"GetSessionToken\"); err != nil {\n\t\treturn fmt.Errorf(\"add protocol finalizers: %v\", err)\n\t}\n\n\tif err = addlegacyEndpointContextSetter(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLoggerMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientRequestID(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputeContentLength(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResolveEndpointMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addComputePayloadSHA256(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRetry(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addRawResponseToMetadata(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecordResponseTiming(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addClientUserAgent(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addTimeOffsetBuild(stack, c); err != nil {\n\t\treturn err\n\t}\n\tif err = addUserAgentRetryMode(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil {\n\t\treturn err\n\t}\n\tif err = addRecursionDetection(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestIDRetrieverMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addResponseErrorMiddleware(stack); err != nil {\n\t\treturn err\n\t}\n\tif err = addRequestResponseLogging(stack, options); err != nil {\n\t\treturn err\n\t}\n\tif err = addDisableHTTPSMiddleware(stack, options); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddleware.RegisterServiceMetadata {\n\treturn &awsmiddleware.RegisterServiceMetadata{\n\t\tRegion:        region,\n\t\tServiceID:     ServiceID,\n\t\tOperationName: \"GetSessionToken\",\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\nfunc bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) {\n\tparams.Region = options.Region\n}\n\ntype setLegacyContextSigningOptionsMiddleware struct {\n}\n\nfunc (*setLegacyContextSigningOptionsMiddleware) ID() string {\n\treturn \"setLegacyContextSigningOptions\"\n}\n\nfunc (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tschemeID := rscheme.Scheme.SchemeID()\n\n\tif sn := awsmiddleware.GetSigningName(ctx); sn != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)\n\t\t}\n\t}\n\n\tif sr := awsmiddleware.GetSigningRegion(ctx); sr != \"\" {\n\t\tif schemeID == \"aws.auth#sigv4\" {\n\t\t\tsmithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)\n\t\t} else if schemeID == \"aws.auth#sigv4a\" {\n\t\t\tsmithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})\n\t\t}\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {\n\treturn stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, \"Signing\", middleware.Before)\n}\n\ntype withAnonymous struct {\n\tresolver AuthSchemeResolver\n}\n\nvar _ AuthSchemeResolver = (*withAnonymous)(nil)\n\nfunc (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\topts, err := v.resolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts = append(opts, &smithyauth.Option{\n\t\tSchemeID: smithyauth.SchemeIDAnonymous,\n\t})\n\treturn opts, nil\n}\n\nfunc wrapWithAnonymousAuth(options *Options) {\n\tif _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {\n\t\treturn\n\t}\n\n\toptions.AuthSchemeResolver = &withAnonymous{\n\t\tresolver: options.AuthSchemeResolver,\n\t}\n}\n\n// AuthResolverParameters contains the set of inputs necessary for auth scheme\n// resolution.\ntype AuthResolverParameters struct {\n\t// The name of the operation being invoked.\n\tOperation string\n\n\t// The region in which the operation is being invoked.\n\tRegion string\n}\n\nfunc bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters {\n\tparams := &AuthResolverParameters{\n\t\tOperation: operation,\n\t}\n\n\tbindAuthParamsRegion(ctx, params, input, options)\n\n\treturn params\n}\n\n// AuthSchemeResolver returns a set of possible authentication options for an\n// operation.\ntype AuthSchemeResolver interface {\n\tResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)\n}\n\ntype defaultAuthSchemeResolver struct{}\n\nvar _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)\n\nfunc (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {\n\tif overrides, ok := operationAuthOptions[params.Operation]; ok {\n\t\treturn overrides(params), nil\n\t}\n\treturn serviceAuthOptions(params), nil\n}\n\nvar operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{\n\t\"AssumeRoleWithSAML\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n\n\t\"AssumeRoleWithWebIdentity\": func(params *AuthResolverParameters) []*smithyauth.Option {\n\t\treturn []*smithyauth.Option{\n\t\t\t{SchemeID: smithyauth.SchemeIDAnonymous},\n\t\t}\n\t},\n}\n\nfunc serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {\n\treturn []*smithyauth.Option{\n\t\t{\n\t\t\tSchemeID: smithyauth.SchemeIDSigV4,\n\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\tvar props smithy.Properties\n\t\t\t\tsmithyhttp.SetSigV4SigningName(&props, \"sts\")\n\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&props, params.Region)\n\t\t\t\treturn props\n\t\t\t}(),\n\t\t},\n\t}\n}\n\ntype resolveAuthSchemeMiddleware struct {\n\toperation string\n\toptions   Options\n}\n\nfunc (*resolveAuthSchemeMiddleware) ID() string {\n\treturn \"ResolveAuthScheme\"\n}\n\nfunc (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tparams := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options)\n\toptions, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"resolve auth scheme: %w\", err)\n\t}\n\n\tscheme, ok := m.selectScheme(options)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"could not select an auth scheme\")\n\t}\n\n\tctx = setResolvedAuthScheme(ctx, scheme)\n\treturn next.HandleFinalize(ctx, in)\n}\n\nfunc (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {\n\tfor _, option := range options {\n\t\tif option.SchemeID == smithyauth.SchemeIDAnonymous {\n\t\t\treturn newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true\n\t\t}\n\n\t\tfor _, scheme := range m.options.AuthSchemes {\n\t\t\tif scheme.SchemeID() != option.SchemeID {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif scheme.IdentityResolver(m.options) != nil {\n\t\t\t\treturn newResolvedAuthScheme(scheme, option), true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, false\n}\n\ntype resolvedAuthSchemeKey struct{}\n\ntype resolvedAuthScheme struct {\n\tScheme             smithyhttp.AuthScheme\n\tIdentityProperties smithy.Properties\n\tSignerProperties   smithy.Properties\n}\n\nfunc newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {\n\treturn &resolvedAuthScheme{\n\t\tScheme:             scheme,\n\t\tIdentityProperties: option.IdentityProperties,\n\t\tSignerProperties:   option.SignerProperties,\n\t}\n}\n\nfunc setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {\n\treturn middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)\n}\n\nfunc getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {\n\tv, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)\n\treturn v\n}\n\ntype getIdentityMiddleware struct {\n\toptions Options\n}\n\nfunc (*getIdentityMiddleware) ID() string {\n\treturn \"GetIdentity\"\n}\n\nfunc (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tresolver := rscheme.Scheme.IdentityResolver(m.options)\n\tif resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity resolver\")\n\t}\n\n\tidentity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"get identity: %w\", err)\n\t}\n\n\tctx = setIdentity(ctx, identity)\n\treturn next.HandleFinalize(ctx, in)\n}\n\ntype identityKey struct{}\n\nfunc setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {\n\treturn middleware.WithStackValue(ctx, identityKey{}, identity)\n}\n\nfunc getIdentity(ctx context.Context) smithyauth.Identity {\n\tv, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)\n\treturn v\n}\n\ntype signRequestMiddleware struct {\n}\n\nfunc (*signRequestMiddleware) ID() string {\n\treturn \"Signing\"\n}\n\nfunc (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unexpected transport type %T\", in.Request)\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\tidentity := getIdentity(ctx)\n\tif identity == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no identity\")\n\t}\n\n\tsigner := rscheme.Scheme.Signer()\n\tif signer == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no signer\")\n\t}\n\n\tif err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"sign request: %w\", err)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tawsxml \"github.com/aws/aws-sdk-go-v2/aws/protocol/xml\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyxml \"github.com/aws/smithy-go/encoding/xml\"\n\tsmithyio \"github.com/aws/smithy-go/io\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithytime \"github.com/aws/smithy-go/time\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc deserializeS3Expires(v string) (*time.Time, error) {\n\tt, err := smithytime.ParseHTTPDate(v)\n\tif err != nil {\n\t\treturn nil, nil\n\t}\n\treturn &t, nil\n}\n\ntype awsAwsquery_deserializeOpAssumeRole struct {\n}\n\nfunc (*awsAwsquery_deserializeOpAssumeRole) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorAssumeRole(response, &metadata)\n\t}\n\toutput := &AssumeRoleOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"AssumeRoleResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentAssumeRoleOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorAssumeRole(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"ExpiredTokenException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"MalformedPolicyDocument\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"PackedPolicyTooLarge\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegionDisabledException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpAssumeRoleWithSAML struct {\n}\n\nfunc (*awsAwsquery_deserializeOpAssumeRoleWithSAML) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response, &metadata)\n\t}\n\toutput := &AssumeRoleWithSAMLOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"AssumeRoleWithSAMLResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"ExpiredTokenException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"IDPRejectedClaim\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidIdentityToken\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"MalformedPolicyDocument\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"PackedPolicyTooLarge\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegionDisabledException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpAssumeRoleWithWebIdentity struct {\n}\n\nfunc (*awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response, &metadata)\n\t}\n\toutput := &AssumeRoleWithWebIdentityOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"AssumeRoleWithWebIdentityResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"ExpiredTokenException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"IDPCommunicationError\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorIDPCommunicationErrorException(response, errorBody)\n\n\tcase strings.EqualFold(\"IDPRejectedClaim\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody)\n\n\tcase strings.EqualFold(\"InvalidIdentityToken\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody)\n\n\tcase strings.EqualFold(\"MalformedPolicyDocument\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"PackedPolicyTooLarge\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegionDisabledException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpDecodeAuthorizationMessage struct {\n}\n\nfunc (*awsAwsquery_deserializeOpDecodeAuthorizationMessage) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response, &metadata)\n\t}\n\toutput := &DecodeAuthorizationMessageOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"DecodeAuthorizationMessageResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"InvalidAuthorizationMessageException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpGetAccessKeyInfo struct {\n}\n\nfunc (*awsAwsquery_deserializeOpGetAccessKeyInfo) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response, &metadata)\n\t}\n\toutput := &GetAccessKeyInfoOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"GetAccessKeyInfoResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpGetCallerIdentity struct {\n}\n\nfunc (*awsAwsquery_deserializeOpGetCallerIdentity) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorGetCallerIdentity(response, &metadata)\n\t}\n\toutput := &GetCallerIdentityOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"GetCallerIdentityResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorGetCallerIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpGetFederationToken struct {\n}\n\nfunc (*awsAwsquery_deserializeOpGetFederationToken) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorGetFederationToken(response, &metadata)\n\t}\n\toutput := &GetFederationTokenOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"GetFederationTokenResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorGetFederationToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"MalformedPolicyDocument\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)\n\n\tcase strings.EqualFold(\"PackedPolicyTooLarge\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)\n\n\tcase strings.EqualFold(\"RegionDisabledException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\ntype awsAwsquery_deserializeOpGetSessionToken struct {\n}\n\nfunc (*awsAwsquery_deserializeOpGetSessionToken) ID() string {\n\treturn \"OperationDeserializer\"\n}\n\nfunc (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*smithyhttp.Response)\n\tif !ok {\n\t\treturn out, metadata, &smithy.DeserializationError{Err: fmt.Errorf(\"unknown transport type %T\", out.RawResponse)}\n\t}\n\n\tif response.StatusCode < 200 || response.StatusCode >= 300 {\n\t\treturn out, metadata, awsAwsquery_deserializeOpErrorGetSessionToken(response, &metadata)\n\t}\n\toutput := &GetSessionTokenOutput{}\n\tout.Result = output\n\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(response.Body, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn out, metadata, nil\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn out, metadata, &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"GetSessionTokenResult\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\terr = &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t\treturn out, metadata, err\n\t}\n\n\treturn out, metadata, err\n}\n\nfunc awsAwsquery_deserializeOpErrorGetSessionToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {\n\tvar errorBuffer bytes.Buffer\n\tif _, err := io.Copy(&errorBuffer, response.Body); err != nil {\n\t\treturn &smithy.DeserializationError{Err: fmt.Errorf(\"failed to copy error response body, %w\", err)}\n\t}\n\terrorBody := bytes.NewReader(errorBuffer.Bytes())\n\n\terrorCode := \"UnknownError\"\n\terrorMessage := errorCode\n\n\terrorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif reqID := errorComponents.RequestID; len(reqID) != 0 {\n\t\tawsmiddleware.SetRequestIDMetadata(metadata, reqID)\n\t}\n\tif len(errorComponents.Code) != 0 {\n\t\terrorCode = errorComponents.Code\n\t}\n\tif len(errorComponents.Message) != 0 {\n\t\terrorMessage = errorComponents.Message\n\t}\n\terrorBody.Seek(0, io.SeekStart)\n\tswitch {\n\tcase strings.EqualFold(\"RegionDisabledException\", errorCode):\n\t\treturn awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)\n\n\tdefault:\n\t\tgenericError := &smithy.GenericAPIError{\n\t\t\tCode:    errorCode,\n\t\t\tMessage: errorMessage,\n\t\t}\n\t\treturn genericError\n\n\t}\n}\n\nfunc awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.ExpiredTokenException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentExpiredTokenException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.IDPCommunicationErrorException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.IDPRejectedClaimException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidAuthorizationMessageException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.InvalidIdentityTokenException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.MalformedPolicyDocumentException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.PackedPolicyTooLargeException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error {\n\toutput := &types.RegionDisabledException{}\n\tvar buff [1024]byte\n\tringBuffer := smithyio.NewRingBuffer(buff[:])\n\tbody := io.TeeReader(errorBody, ringBuffer)\n\trootDecoder := xml.NewDecoder(body)\n\tt, err := smithyxml.FetchRootElement(rootDecoder)\n\tif err == io.EOF {\n\t\treturn output\n\t}\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder := smithyxml.WrapNodeDecoder(rootDecoder, t)\n\tt, err = decoder.GetElement(\"Error\")\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\tdecoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\terr = awsAwsquery_deserializeDocumentRegionDisabledException(&output, decoder)\n\tif err != nil {\n\t\tvar snapshot bytes.Buffer\n\t\tio.Copy(&snapshot, ringBuffer)\n\t\treturn &smithy.DeserializationError{\n\t\t\tErr:      fmt.Errorf(\"failed to decode response body, %w\", err),\n\t\t\tSnapshot: snapshot.Bytes(),\n\t\t}\n\t}\n\n\treturn output\n}\n\nfunc awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.AssumedRoleUser\n\tif *v == nil {\n\t\tsv = &types.AssumedRoleUser{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Arn\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Arn = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"AssumedRoleId\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.AssumedRoleId = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.Credentials\n\tif *v == nil {\n\t\tsv = &types.Credentials{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"AccessKeyId\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.AccessKeyId = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Expiration\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tt, err := smithytime.ParseDateTime(xtv)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.Expiration = ptr.Time(t)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SecretAccessKey\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SecretAccessKey = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SessionToken\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SessionToken = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.ExpiredTokenException\n\tif *v == nil {\n\t\tsv = &types.ExpiredTokenException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.FederatedUser\n\tif *v == nil {\n\t\tsv = &types.FederatedUser{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Arn\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Arn = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"FederatedUserId\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.FederatedUserId = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.IDPCommunicationErrorException\n\tif *v == nil {\n\t\tsv = &types.IDPCommunicationErrorException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.IDPRejectedClaimException\n\tif *v == nil {\n\t\tsv = &types.IDPRejectedClaimException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.InvalidAuthorizationMessageException\n\tif *v == nil {\n\t\tsv = &types.InvalidAuthorizationMessageException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.InvalidIdentityTokenException\n\tif *v == nil {\n\t\tsv = &types.InvalidIdentityTokenException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.MalformedPolicyDocumentException\n\tif *v == nil {\n\t\tsv = &types.MalformedPolicyDocumentException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.PackedPolicyTooLargeException\n\tif *v == nil {\n\t\tsv = &types.PackedPolicyTooLargeException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *types.RegionDisabledException\n\tif *v == nil {\n\t\tsv = &types.RegionDisabledException{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"message\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Message = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *AssumeRoleOutput\n\tif *v == nil {\n\t\tsv = &AssumeRoleOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"AssumedRoleUser\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Credentials\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"PackedPolicySize\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\ti64, err := strconv.ParseInt(xtv, 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PackedPolicySize = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SourceIdentity\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SourceIdentity = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWithSAMLOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *AssumeRoleWithSAMLOutput\n\tif *v == nil {\n\t\tsv = &AssumeRoleWithSAMLOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"AssumedRoleUser\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Audience\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Audience = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Credentials\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Issuer\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Issuer = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"NameQualifier\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.NameQualifier = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"PackedPolicySize\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\ti64, err := strconv.ParseInt(xtv, 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PackedPolicySize = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SourceIdentity\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SourceIdentity = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Subject\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Subject = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SubjectType\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SubjectType = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **AssumeRoleWithWebIdentityOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *AssumeRoleWithWebIdentityOutput\n\tif *v == nil {\n\t\tsv = &AssumeRoleWithWebIdentityOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"AssumedRoleUser\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Audience\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Audience = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Credentials\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"PackedPolicySize\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\ti64, err := strconv.ParseInt(xtv, 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PackedPolicySize = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Provider\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Provider = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SourceIdentity\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SourceIdentity = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"SubjectFromWebIdentityToken\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.SubjectFromWebIdentityToken = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(v **DecodeAuthorizationMessageOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *DecodeAuthorizationMessageOutput\n\tif *v == nil {\n\t\tsv = &DecodeAuthorizationMessageOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"DecodedMessage\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.DecodedMessage = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(v **GetAccessKeyInfoOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *GetAccessKeyInfoOutput\n\tif *v == nil {\n\t\tsv = &GetAccessKeyInfoOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Account\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Account = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(v **GetCallerIdentityOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *GetCallerIdentityOutput\n\tif *v == nil {\n\t\tsv = &GetCallerIdentityOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Account\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Account = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"Arn\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.Arn = ptr.String(xtv)\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"UserId\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\tsv.UserId = ptr.String(xtv)\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederationTokenOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *GetFederationTokenOutput\n\tif *v == nil {\n\t\tsv = &GetFederationTokenOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Credentials\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"FederatedUser\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentFederatedUser(&sv.FederatedUser, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase strings.EqualFold(\"PackedPolicySize\", t.Name.Local):\n\t\t\tval, err := decoder.Value()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif val == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{\n\t\t\t\txtv := string(val)\n\t\t\t\ti64, err := strconv.ParseInt(xtv, 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsv.PackedPolicySize = ptr.Int32(int32(i64))\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n\nfunc awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenOutput, decoder smithyxml.NodeDecoder) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"unexpected nil of type %T\", v)\n\t}\n\tvar sv *GetSessionTokenOutput\n\tif *v == nil {\n\t\tsv = &GetSessionTokenOutput{}\n\t} else {\n\t\tsv = *v\n\t}\n\n\tfor {\n\t\tt, done, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\toriginalDecoder := decoder\n\t\tdecoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)\n\t\tswitch {\n\t\tcase strings.EqualFold(\"Credentials\", t.Name.Local):\n\t\t\tnodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)\n\t\t\tif err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// Do nothing and ignore the unexpected tag element\n\t\t\terr = decoder.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\tdecoder = originalDecoder\n\t}\n\t*v = sv\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\n// Package sts provides the API client, operations, and parameter types for AWS\n// Security Token Service.\n//\n// # Security Token Service\n//\n// Security Token Service (STS) enables you to request temporary,\n// limited-privilege credentials for users. This guide provides descriptions of the\n// STS API. For more information about using this service, see [Temporary Security Credentials].\n//\n// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html\npackage sts\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalConfig \"github.com/aws/aws-sdk-go-v2/internal/configsources\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints\"\n\t\"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn\"\n\tinternalendpoints \"github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints\"\n\tsmithy \"github.com/aws/smithy-go\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\tsmithyendpoints \"github.com/aws/smithy-go/endpoints\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/ptr\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n)\n\n// EndpointResolverOptions is the service endpoint resolver options\ntype EndpointResolverOptions = internalendpoints.Options\n\n// EndpointResolver interface for resolving service endpoints.\ntype EndpointResolver interface {\n\tResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n}\n\nvar _ EndpointResolver = &internalendpoints.Resolver{}\n\n// NewDefaultEndpointResolver constructs a new service endpoint resolver\nfunc NewDefaultEndpointResolver() *internalendpoints.Resolver {\n\treturn internalendpoints.New()\n}\n\n// EndpointResolverFunc is a helper utility that wraps a function so it satisfies\n// the EndpointResolver interface. This is useful when you want to add additional\n// endpoint resolving logic, or stub out specific endpoints with custom values.\ntype EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)\n\nfunc (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn fn(region, options)\n}\n\n// EndpointResolverFromURL returns an EndpointResolver configured using the\n// provided endpoint url. By default, the resolved endpoint resolver uses the\n// client region as signing region, and the endpoint source is set to\n// EndpointSourceCustom.You can provide functional options to configure endpoint\n// values for the resolved endpoint.\nfunc EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {\n\te := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}\n\tfor _, fn := range optFns {\n\t\tfn(&e)\n\t}\n\n\treturn EndpointResolverFunc(\n\t\tfunc(region string, options EndpointResolverOptions) (aws.Endpoint, error) {\n\t\t\tif len(e.SigningRegion) == 0 {\n\t\t\t\te.SigningRegion = region\n\t\t\t}\n\t\t\treturn e, nil\n\t\t},\n\t)\n}\n\ntype ResolveEndpoint struct {\n\tResolver EndpointResolver\n\tOptions  EndpointResolverOptions\n}\n\nfunc (*ResolveEndpoint) ID() string {\n\treturn \"ResolveEndpoint\"\n}\n\nfunc (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleSerialize(ctx, in)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.Resolver == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\teo := m.Options\n\teo.Logger = middleware.GetLogger(ctx)\n\n\tvar endpoint aws.Endpoint\n\tendpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)\n\tif err != nil {\n\t\tnf := (&aws.EndpointNotFoundError{})\n\t\tif errors.As(err, &nf) {\n\t\t\tctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)\n\t\t\treturn next.HandleSerialize(ctx, in)\n\t\t}\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\treq.URL, err = url.Parse(endpoint.URL)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to parse endpoint URL: %w\", err)\n\t}\n\n\tif len(awsmiddleware.GetSigningName(ctx)) == 0 {\n\t\tsigningName := endpoint.SigningName\n\t\tif len(signingName) == 0 {\n\t\t\tsigningName = \"sts\"\n\t\t}\n\t\tctx = awsmiddleware.SetSigningName(ctx, signingName)\n\t}\n\tctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)\n\tctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)\n\tctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)\n\tctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {\n\treturn stack.Serialize.Insert(&ResolveEndpoint{\n\t\tResolver: o.EndpointResolver,\n\t\tOptions:  o.EndpointOptions,\n\t}, \"OperationSerializer\", middleware.Before)\n}\n\nfunc removeResolveEndpointMiddleware(stack *middleware.Stack) error {\n\t_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())\n\treturn err\n}\n\ntype wrappedEndpointResolver struct {\n\tawsResolver aws.EndpointResolverWithOptions\n}\n\nfunc (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {\n\treturn w.awsResolver.ResolveEndpoint(ServiceID, region, options)\n}\n\ntype awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)\n\nfunc (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\treturn a(service, region)\n}\n\nvar _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)\n\n// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.\n// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,\n// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked\n// via its middleware.\n//\n// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.\nfunc withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {\n\tvar resolver aws.EndpointResolverWithOptions\n\n\tif awsResolverWithOptions != nil {\n\t\tresolver = awsResolverWithOptions\n\t} else if awsResolver != nil {\n\t\tresolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)\n\t}\n\n\treturn &wrappedEndpointResolver{\n\t\tawsResolver: resolver,\n\t}\n}\n\nfunc finalizeClientEndpointResolverOptions(options *Options) {\n\toptions.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()\n\n\tif len(options.EndpointOptions.ResolvedRegion) == 0 {\n\t\tconst fipsInfix = \"-fips-\"\n\t\tconst fipsPrefix = \"fips-\"\n\t\tconst fipsSuffix = \"-fips\"\n\n\t\tif strings.Contains(options.Region, fipsInfix) ||\n\t\t\tstrings.Contains(options.Region, fipsPrefix) ||\n\t\t\tstrings.Contains(options.Region, fipsSuffix) {\n\t\t\toptions.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(\n\t\t\t\toptions.Region, fipsInfix, \"-\"), fipsPrefix, \"\"), fipsSuffix, \"\")\n\t\t\toptions.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled\n\t\t}\n\t}\n\n}\n\nfunc resolveEndpointResolverV2(options *Options) {\n\tif options.EndpointResolverV2 == nil {\n\t\toptions.EndpointResolverV2 = NewDefaultEndpointResolverV2()\n\t}\n}\n\nfunc resolveBaseEndpoint(cfg aws.Config, o *Options) {\n\tif cfg.BaseEndpoint != nil {\n\t\to.BaseEndpoint = cfg.BaseEndpoint\n\t}\n\n\t_, g := os.LookupEnv(\"AWS_ENDPOINT_URL\")\n\t_, s := os.LookupEnv(\"AWS_ENDPOINT_URL_STS\")\n\n\tif g && !s {\n\t\treturn\n\t}\n\n\tvalue, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), \"STS\", cfg.ConfigSources)\n\tif found && err == nil {\n\t\to.BaseEndpoint = &value\n\t}\n}\n\nfunc bindRegion(region string) *string {\n\tif region == \"\" {\n\t\treturn nil\n\t}\n\treturn aws.String(endpoints.MapFIPSRegion(region))\n}\n\n// EndpointParameters provides the parameters that influence how endpoints are\n// resolved.\ntype EndpointParameters struct {\n\t// The AWS region used to dispatch the request.\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// AWS::Region\n\tRegion *string\n\n\t// When true, use the dual-stack endpoint. If the configured endpoint does not\n\t// support dual-stack, dispatching the request MAY return an error.\n\t//\n\t// Defaults to\n\t// false if no value is provided.\n\t//\n\t// AWS::UseDualStack\n\tUseDualStack *bool\n\n\t// When true, send this request to the FIPS-compliant regional endpoint. If the\n\t// configured endpoint does not have a FIPS compliant endpoint, dispatching the\n\t// request will return an error.\n\t//\n\t// Defaults to false if no value is\n\t// provided.\n\t//\n\t// AWS::UseFIPS\n\tUseFIPS *bool\n\n\t// Override the endpoint used to send this request\n\t//\n\t// Parameter is\n\t// required.\n\t//\n\t// SDK::Endpoint\n\tEndpoint *string\n\n\t// Whether the global endpoint should be used, rather then the regional endpoint\n\t// for us-east-1.\n\t//\n\t// Defaults to false if no value is\n\t// provided.\n\t//\n\t// AWS::STS::UseGlobalEndpoint\n\tUseGlobalEndpoint *bool\n}\n\n// ValidateRequired validates required parameters are set.\nfunc (p EndpointParameters) ValidateRequired() error {\n\tif p.UseDualStack == nil {\n\t\treturn fmt.Errorf(\"parameter UseDualStack is required\")\n\t}\n\n\tif p.UseFIPS == nil {\n\t\treturn fmt.Errorf(\"parameter UseFIPS is required\")\n\t}\n\n\tif p.UseGlobalEndpoint == nil {\n\t\treturn fmt.Errorf(\"parameter UseGlobalEndpoint is required\")\n\t}\n\n\treturn nil\n}\n\n// WithDefaults returns a shallow copy of EndpointParameterswith default values\n// applied to members where applicable.\nfunc (p EndpointParameters) WithDefaults() EndpointParameters {\n\tif p.UseDualStack == nil {\n\t\tp.UseDualStack = ptr.Bool(false)\n\t}\n\n\tif p.UseFIPS == nil {\n\t\tp.UseFIPS = ptr.Bool(false)\n\t}\n\n\tif p.UseGlobalEndpoint == nil {\n\t\tp.UseGlobalEndpoint = ptr.Bool(false)\n\t}\n\treturn p\n}\n\ntype stringSlice []string\n\nfunc (s stringSlice) Get(i int) *string {\n\tif i < 0 || i >= len(s) {\n\t\treturn nil\n\t}\n\n\tv := s[i]\n\treturn &v\n}\n\n// EndpointResolverV2 provides the interface for resolving service endpoints.\ntype EndpointResolverV2 interface {\n\t// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n\t// returning the endpoint if found. Otherwise an error is returned.\n\tResolveEndpoint(ctx context.Context, params EndpointParameters) (\n\t\tsmithyendpoints.Endpoint, error,\n\t)\n}\n\n// resolver provides the implementation for resolving endpoints.\ntype resolver struct{}\n\nfunc NewDefaultEndpointResolverV2() EndpointResolverV2 {\n\treturn &resolver{}\n}\n\n// ResolveEndpoint attempts to resolve the endpoint with the provided options,\n// returning the endpoint if found. Otherwise an error is returned.\nfunc (r *resolver) ResolveEndpoint(\n\tctx context.Context, params EndpointParameters,\n) (\n\tendpoint smithyendpoints.Endpoint, err error,\n) {\n\tparams = params.WithDefaults()\n\tif err = params.ValidateRequired(); err != nil {\n\t\treturn endpoint, fmt.Errorf(\"endpoint parameters are not valid, %w\", err)\n\t}\n\t_UseDualStack := *params.UseDualStack\n\t_UseFIPS := *params.UseFIPS\n\t_UseGlobalEndpoint := *params.UseGlobalEndpoint\n\n\tif _UseGlobalEndpoint == true {\n\t\tif !(params.Endpoint != nil) {\n\t\t\tif exprVal := params.Region; exprVal != nil {\n\t\t\t\t_Region := *exprVal\n\t\t\t\t_ = _Region\n\t\t\t\tif exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {\n\t\t\t\t\t_PartitionResult := *exprVal\n\t\t\t\t\t_ = _PartitionResult\n\t\t\t\t\tif _UseFIPS == false {\n\t\t\t\t\t\tif _UseDualStack == false {\n\t\t\t\t\t\t\tif _Region == \"ap-northeast-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"ap-south-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"ap-southeast-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"ap-southeast-2\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"aws-global\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"ca-central-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"eu-central-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"eu-north-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"eu-west-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"eu-west-2\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"eu-west-3\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"sa-east-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"us-east-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"us-east-2\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"us-west-1\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _Region == \"us-west-2\" {\n\t\t\t\t\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\t\tout.WriteString(\"https://sts.\")\n\t\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t\t}()\n\n\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, _Region)\n\t\t\t\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif exprVal := params.Endpoint; exprVal != nil {\n\t\t_Endpoint := *exprVal\n\t\t_ = _Endpoint\n\t\tif _UseFIPS == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: FIPS and custom endpoint are not supported\")\n\t\t}\n\t\tif _UseDualStack == true {\n\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Dualstack and custom endpoint are not supported\")\n\t\t}\n\t\turiString := _Endpoint\n\n\t\turi, err := url.Parse(uriString)\n\t\tif err != nil {\n\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t}\n\n\t\treturn smithyendpoints.Endpoint{\n\t\t\tURI:     *uri,\n\t\t\tHeaders: http.Header{},\n\t\t}, nil\n\t}\n\tif exprVal := params.Region; exprVal != nil {\n\t\t_Region := *exprVal\n\t\t_ = _Region\n\t\tif exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {\n\t\t\t_PartitionResult := *exprVal\n\t\t\t_ = _PartitionResult\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _UseDualStack == true {\n\t\t\t\t\tif true == _PartitionResult.SupportsFIPS {\n\t\t\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\t\tout.WriteString(\"https://sts-fips.\")\n\t\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t\t}()\n\n\t\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS and DualStack are enabled, but this partition does not support one or both\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _UseFIPS == true {\n\t\t\t\tif _PartitionResult.SupportsFIPS == true {\n\t\t\t\t\tif _PartitionResult.Name == \"aws-us-gov\" {\n\t\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\t\tout.WriteString(\"https://sts.\")\n\t\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\t\tout.WriteString(\".amazonaws.com\")\n\t\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://sts-fips.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"FIPS is enabled but this partition does not support FIPS\")\n\t\t\t}\n\t\t\tif _UseDualStack == true {\n\t\t\t\tif true == _PartitionResult.SupportsDualStack {\n\t\t\t\t\turiString := func() string {\n\t\t\t\t\t\tvar out strings.Builder\n\t\t\t\t\t\tout.WriteString(\"https://sts.\")\n\t\t\t\t\t\tout.WriteString(_Region)\n\t\t\t\t\t\tout.WriteString(\".\")\n\t\t\t\t\t\tout.WriteString(_PartitionResult.DualStackDnsSuffix)\n\t\t\t\t\t\treturn out.String()\n\t\t\t\t\t}()\n\n\t\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\t\tURI:     *uri,\n\t\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"DualStack is enabled but this partition does not support DualStack\")\n\t\t\t}\n\t\t\tif _Region == \"aws-global\" {\n\t\t\t\turiString := \"https://sts.amazonaws.com\"\n\n\t\t\t\turi, err := url.Parse(uriString)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t\t}\n\n\t\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\t\tURI:     *uri,\n\t\t\t\t\tHeaders: http.Header{},\n\t\t\t\t\tProperties: func() smithy.Properties {\n\t\t\t\t\t\tvar out smithy.Properties\n\t\t\t\t\t\tsmithyauth.SetAuthOptions(&out, []*smithyauth.Option{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSchemeID: \"aws.auth#sigv4\",\n\t\t\t\t\t\t\t\tSignerProperties: func() smithy.Properties {\n\t\t\t\t\t\t\t\t\tvar sp smithy.Properties\n\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningName(&sp, \"sts\")\n\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4ASigningName(&sp, \"sts\")\n\n\t\t\t\t\t\t\t\t\tsmithyhttp.SetSigV4SigningRegion(&sp, \"us-east-1\")\n\t\t\t\t\t\t\t\t\treturn sp\n\t\t\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn out\n\t\t\t\t\t}(),\n\t\t\t\t}, nil\n\t\t\t}\n\t\t\turiString := func() string {\n\t\t\t\tvar out strings.Builder\n\t\t\t\tout.WriteString(\"https://sts.\")\n\t\t\t\tout.WriteString(_Region)\n\t\t\t\tout.WriteString(\".\")\n\t\t\t\tout.WriteString(_PartitionResult.DnsSuffix)\n\t\t\t\treturn out.String()\n\t\t\t}()\n\n\t\t\turi, err := url.Parse(uriString)\n\t\t\tif err != nil {\n\t\t\t\treturn endpoint, fmt.Errorf(\"Failed to parse uri: %s\", uriString)\n\t\t\t}\n\n\t\t\treturn smithyendpoints.Endpoint{\n\t\t\t\tURI:     *uri,\n\t\t\t\tHeaders: http.Header{},\n\t\t\t}, nil\n\t\t}\n\t\treturn endpoint, fmt.Errorf(\"Endpoint resolution failed. Invalid operation or environment input.\")\n\t}\n\treturn endpoint, fmt.Errorf(\"endpoint rule error, %s\", \"Invalid Configuration: Missing Region\")\n}\n\ntype endpointParamsBinder interface {\n\tbindEndpointParams(*EndpointParameters)\n}\n\nfunc bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters {\n\tparams := &EndpointParameters{}\n\n\tparams.Region = bindRegion(options.Region)\n\tparams.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)\n\tparams.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)\n\tparams.Endpoint = options.BaseEndpoint\n\n\tif b, ok := input.(endpointParamsBinder); ok {\n\t\tb.bindEndpointParams(params)\n\t}\n\n\treturn params\n}\n\ntype resolveEndpointV2Middleware struct {\n\toptions Options\n}\n\nfunc (*resolveEndpointV2Middleware) ID() string {\n\treturn \"ResolveEndpointV2\"\n}\n\nfunc (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\tif awsmiddleware.GetRequiresLegacyEndpoints(ctx) {\n\t\treturn next.HandleFinalize(ctx, in)\n\t}\n\n\tif err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"invalid accountID set: %w\", err)\n\t}\n\n\treq, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tif m.options.EndpointResolverV2 == nil {\n\t\treturn out, metadata, fmt.Errorf(\"expected endpoint resolver to not be nil\")\n\t}\n\n\tparams := bindEndpointParams(ctx, getOperationInput(ctx), m.options)\n\tendpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed to resolve service endpoint, %w\", err)\n\t}\n\n\tif endpt.URI.RawPath == \"\" && req.URL.RawPath != \"\" {\n\t\tendpt.URI.RawPath = endpt.URI.Path\n\t}\n\treq.URL.Scheme = endpt.URI.Scheme\n\treq.URL.Host = endpt.URI.Host\n\treq.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)\n\treq.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)\n\tfor k := range endpt.Headers {\n\t\treq.Header.Set(k, endpt.Headers.Get(k))\n\t}\n\n\trscheme := getResolvedAuthScheme(ctx)\n\tif rscheme == nil {\n\t\treturn out, metadata, fmt.Errorf(\"no resolved auth scheme\")\n\t}\n\n\topts, _ := smithyauth.GetAuthOptions(&endpt.Properties)\n\tfor _, o := range opts {\n\t\trscheme.SignerProperties.SetAll(&o.SignerProperties)\n\t}\n\n\treturn next.HandleFinalize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json",
    "content": "{\n    \"dependencies\": {\n        \"github.com/aws/aws-sdk-go-v2\": \"v1.4.0\",\n        \"github.com/aws/aws-sdk-go-v2/internal/configsources\": \"v0.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\": \"v2.0.0-00010101000000-000000000000\",\n        \"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding\": \"v1.0.5\",\n        \"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url\": \"v1.0.7\",\n        \"github.com/aws/smithy-go\": \"v1.4.0\"\n    },\n    \"files\": [\n        \"api_client.go\",\n        \"api_client_test.go\",\n        \"api_op_AssumeRole.go\",\n        \"api_op_AssumeRoleWithSAML.go\",\n        \"api_op_AssumeRoleWithWebIdentity.go\",\n        \"api_op_DecodeAuthorizationMessage.go\",\n        \"api_op_GetAccessKeyInfo.go\",\n        \"api_op_GetCallerIdentity.go\",\n        \"api_op_GetFederationToken.go\",\n        \"api_op_GetSessionToken.go\",\n        \"auth.go\",\n        \"deserializers.go\",\n        \"doc.go\",\n        \"endpoints.go\",\n        \"endpoints_config_test.go\",\n        \"endpoints_test.go\",\n        \"generated.json\",\n        \"internal/endpoints/endpoints.go\",\n        \"internal/endpoints/endpoints_test.go\",\n        \"options.go\",\n        \"protocol_test.go\",\n        \"serializers.go\",\n        \"snapshot_test.go\",\n        \"types/errors.go\",\n        \"types/types.go\",\n        \"validators.go\"\n    ],\n    \"go\": \"1.15\",\n    \"module\": \"github.com/aws/aws-sdk-go-v2/service/sts\",\n    \"unstable\": false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage sts\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.30.3\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage endpoints\n\nimport (\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tendpoints \"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"regexp\"\n)\n\n// Options is the endpoint resolver configuration options\ntype Options struct {\n\t// Logger is a logging implementation that log events should be sent to.\n\tLogger logging.Logger\n\n\t// LogDeprecated indicates that deprecated endpoints should be logged to the\n\t// provided logger.\n\tLogDeprecated bool\n\n\t// ResolvedRegion is used to override the region to be resolved, rather then the\n\t// using the value passed to the ResolveEndpoint method. This value is used by the\n\t// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative\n\t// name. You must not set this value directly in your application.\n\tResolvedRegion string\n\n\t// DisableHTTPS informs the resolver to return an endpoint that does not use the\n\t// HTTPS scheme.\n\tDisableHTTPS bool\n\n\t// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.\n\tUseDualStackEndpoint aws.DualStackEndpointState\n\n\t// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.\n\tUseFIPSEndpoint aws.FIPSEndpointState\n}\n\nfunc (o Options) GetResolvedRegion() string {\n\treturn o.ResolvedRegion\n}\n\nfunc (o Options) GetDisableHTTPS() bool {\n\treturn o.DisableHTTPS\n}\n\nfunc (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {\n\treturn o.UseDualStackEndpoint\n}\n\nfunc (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {\n\treturn o.UseFIPSEndpoint\n}\n\nfunc transformToSharedOptions(options Options) endpoints.Options {\n\treturn endpoints.Options{\n\t\tLogger:               options.Logger,\n\t\tLogDeprecated:        options.LogDeprecated,\n\t\tResolvedRegion:       options.ResolvedRegion,\n\t\tDisableHTTPS:         options.DisableHTTPS,\n\t\tUseDualStackEndpoint: options.UseDualStackEndpoint,\n\t\tUseFIPSEndpoint:      options.UseFIPSEndpoint,\n\t}\n}\n\n// Resolver STS endpoint resolver\ntype Resolver struct {\n\tpartitions endpoints.Partitions\n}\n\n// ResolveEndpoint resolves the service endpoint for the given region and options\nfunc (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {\n\tif len(region) == 0 {\n\t\treturn endpoint, &aws.MissingRegionError{}\n\t}\n\n\topt := transformToSharedOptions(options)\n\treturn r.partitions.ResolveEndpoint(region, opt)\n}\n\n// New returns a new Resolver\nfunc New() *Resolver {\n\treturn &Resolver{\n\t\tpartitions: defaultPartitions,\n\t}\n}\n\nvar partitionRegexp = struct {\n\tAws      *regexp.Regexp\n\tAwsCn    *regexp.Regexp\n\tAwsIso   *regexp.Regexp\n\tAwsIsoB  *regexp.Regexp\n\tAwsIsoE  *regexp.Regexp\n\tAwsIsoF  *regexp.Regexp\n\tAwsUsGov *regexp.Regexp\n}{\n\n\tAws:      regexp.MustCompile(\"^(us|eu|ap|sa|ca|me|af|il)\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsCn:    regexp.MustCompile(\"^cn\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIso:   regexp.MustCompile(\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoB:  regexp.MustCompile(\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoE:  regexp.MustCompile(\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsIsoF:  regexp.MustCompile(\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\"),\n\tAwsUsGov: regexp.MustCompile(\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\"),\n}\n\nvar defaultPartitions = endpoints.Partitions{\n\t{\n\t\tID: \"aws\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.Aws,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"af-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-northeast-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-south-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ap-southeast-4\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"aws-global\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"ca-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-central-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-north-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-south-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"eu-west-3\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"il-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-central-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"me-south-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"sa-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts-fips.us-east-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-1-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts-fips.us-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-east-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts-fips.us-east-2.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-east-2-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts-fips.us-east-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-east-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts-fips.us-west-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-1-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts-fips.us-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-west-2\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts-fips.us-west-2.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-west-2-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts-fips.us-west-2.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-west-2\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-cn\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.api.amazonwebservices.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.amazonaws.com.cn\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsCn,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-north-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"cn-northwest-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.c2s.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIso,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-iso-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-b\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.sc2s.sgov.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoB,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-isob-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t},\n\t},\n\t{\n\t\tID: \"aws-iso-e\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.cloud.adc-e.uk\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoE,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-iso-f\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.csp.hci.ic.gov\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsIsoF,\n\t\tIsRegionalized: true,\n\t},\n\t{\n\t\tID: \"aws-us-gov\",\n\t\tDefaults: map[endpoints.DefaultKey]endpoints.Endpoint{\n\t\t\t{\n\t\t\t\tVariant: endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: endpoints.FIPSVariant | endpoints.DualStackVariant,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts-fips.{region}.api.aws\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVariant: 0,\n\t\t\t}: {\n\t\t\t\tHostname:          \"sts.{region}.amazonaws.com\",\n\t\t\t\tProtocols:         []string{\"https\"},\n\t\t\t\tSignatureVersions: []string{\"v4\"},\n\t\t\t},\n\t\t},\n\t\tRegionRegex:    partitionRegexp.AwsUsGov,\n\t\tIsRegionalized: true,\n\t\tEndpoints: endpoints.Endpoints{\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-east-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts.us-gov-east-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-east-1-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts.us-gov-east-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-east-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t}: endpoints.Endpoint{},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion:  \"us-gov-west-1\",\n\t\t\t\tVariant: endpoints.FIPSVariant,\n\t\t\t}: {\n\t\t\t\tHostname: \"sts.us-gov-west-1.amazonaws.com\",\n\t\t\t},\n\t\t\tendpoints.EndpointKey{\n\t\t\t\tRegion: \"us-gov-west-1-fips\",\n\t\t\t}: endpoints.Endpoint{\n\t\t\t\tHostname: \"sts.us-gov-west-1.amazonaws.com\",\n\t\t\t\tCredentialScope: endpoints.CredentialScope{\n\t\t\t\t\tRegion: \"us-gov-west-1\",\n\t\t\t\t},\n\t\t\t\tDeprecated: aws.TrueTernary,\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\tinternalauthsmithy \"github.com/aws/aws-sdk-go-v2/internal/auth/smithy\"\n\tsmithyauth \"github.com/aws/smithy-go/auth\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"net/http\"\n)\n\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\ntype Options struct {\n\t// Set of options to modify how an operation is invoked. These apply to all\n\t// operations invoked for this client. Use functional options on operation call to\n\t// modify this list for per operation behavior.\n\tAPIOptions []func(*middleware.Stack) error\n\n\t// Indicates how aws account ID is applied in endpoint2.0 routing\n\tAccountIDEndpointMode aws.AccountIDEndpointMode\n\n\t// The optional application specific identifier appended to the User-Agent header.\n\tAppID string\n\n\t// This endpoint will be given as input to an EndpointResolverV2. It is used for\n\t// providing a custom base endpoint that is subject to modifications by the\n\t// processing EndpointResolverV2.\n\tBaseEndpoint *string\n\n\t// Configures the events that will be sent to the configured logger.\n\tClientLogMode aws.ClientLogMode\n\n\t// The credentials object to use when signing requests.\n\tCredentials aws.CredentialsProvider\n\n\t// The configuration DefaultsMode that the SDK should use when constructing the\n\t// clients initial default settings.\n\tDefaultsMode aws.DefaultsMode\n\n\t// The endpoint options to be used when attempting to resolve an endpoint.\n\tEndpointOptions EndpointResolverOptions\n\n\t// The service endpoint resolver.\n\t//\n\t// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a\n\t// value for this field will likely prevent you from using any endpoint-related\n\t// service features released after the introduction of EndpointResolverV2 and\n\t// BaseEndpoint.\n\t//\n\t// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n\t// the client option BaseEndpoint instead.\n\tEndpointResolver EndpointResolver\n\n\t// Resolves the endpoint used for a particular service operation. This should be\n\t// used over the deprecated EndpointResolver.\n\tEndpointResolverV2 EndpointResolverV2\n\n\t// Signature Version 4 (SigV4) Signer\n\tHTTPSignerV4 HTTPSignerV4\n\n\t// The logger writer interface to write logging messages to.\n\tLogger logging.Logger\n\n\t// The region to send requests to. (Required)\n\tRegion string\n\n\t// RetryMaxAttempts specifies the maximum number attempts an API client will call\n\t// an operation that fails with a retryable error. A value of 0 is ignored, and\n\t// will not be used to configure the API client created default retryer, or modify\n\t// per operation call's retry max attempts.\n\t//\n\t// If specified in an operation call's functional options with a value that is\n\t// different than the constructed client's Options, the Client's Retryer will be\n\t// wrapped to use the operation's specific RetryMaxAttempts value.\n\tRetryMaxAttempts int\n\n\t// RetryMode specifies the retry mode the API client will be created with, if\n\t// Retryer option is not also specified.\n\t//\n\t// When creating a new API Clients this member will only be used if the Retryer\n\t// Options member is nil. This value will be ignored if Retryer is not nil.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tRetryMode aws.RetryMode\n\n\t// Retryer guides how HTTP requests should be retried in case of recoverable\n\t// failures. When nil the API client will use a default retryer. The kind of\n\t// default retry created by the API client can be changed with the RetryMode\n\t// option.\n\tRetryer aws.Retryer\n\n\t// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set\n\t// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You\n\t// should not populate this structure programmatically, or rely on the values here\n\t// within your applications.\n\tRuntimeEnvironment aws.RuntimeEnvironment\n\n\t// The initial DefaultsMode used when the client options were constructed. If the\n\t// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved\n\t// value was at that point in time.\n\t//\n\t// Currently does not support per operation call overrides, may in the future.\n\tresolvedDefaultsMode aws.DefaultsMode\n\n\t// The HTTP client to invoke API calls with. Defaults to client's default HTTP\n\t// implementation if nil.\n\tHTTPClient HTTPClient\n\n\t// The auth scheme resolver which determines how to authenticate for each\n\t// operation.\n\tAuthSchemeResolver AuthSchemeResolver\n\n\t// The list of auth schemes supported by the client.\n\tAuthSchemes []smithyhttp.AuthScheme\n}\n\n// Copy creates a clone where the APIOptions list is deep copied.\nfunc (o Options) Copy() Options {\n\tto := o\n\tto.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))\n\tcopy(to.APIOptions, o.APIOptions)\n\n\treturn to\n}\n\nfunc (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {\n\tif schemeID == \"aws.auth#sigv4\" {\n\t\treturn getSigV4IdentityResolver(o)\n\t}\n\tif schemeID == \"smithy.api#noAuth\" {\n\t\treturn &smithyauth.AnonymousIdentityResolver{}\n\t}\n\treturn nil\n}\n\n// WithAPIOptions returns a functional option for setting the Client's APIOptions\n// option.\nfunc WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, optFns...)\n\t}\n}\n\n// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for\n// this field will likely prevent you from using any endpoint-related service\n// features released after the introduction of EndpointResolverV2 and BaseEndpoint.\n//\n// To migrate an EndpointResolver implementation that uses a custom endpoint, set\n// the client option BaseEndpoint instead.\nfunc WithEndpointResolver(v EndpointResolver) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolver = v\n\t}\n}\n\n// WithEndpointResolverV2 returns a functional option for setting the Client's\n// EndpointResolverV2 option.\nfunc WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {\n\treturn func(o *Options) {\n\t\to.EndpointResolverV2 = v\n\t}\n}\n\nfunc getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {\n\tif o.Credentials != nil {\n\t\treturn &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}\n\t}\n\treturn nil\n}\n\n// WithSigV4SigningName applies an override to the authentication workflow to\n// use the given signing name for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing name from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningName(name string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningName\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\n// WithSigV4SigningRegion applies an override to the authentication workflow to\n// use the given signing region for SigV4-authenticated operations.\n//\n// This is an advanced setting. The value here is FINAL, taking precedence over\n// the resolved signing region from both auth scheme resolution and endpoint\n// resolution.\nfunc WithSigV4SigningRegion(region string) func(*Options) {\n\tfn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\t\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n\t) {\n\t\treturn next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)\n\t}\n\treturn func(o *Options) {\n\t\to.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {\n\t\t\treturn s.Initialize.Add(\n\t\t\t\tmiddleware.InitializeMiddlewareFunc(\"withSigV4SigningRegion\", fn),\n\t\t\t\tmiddleware.Before,\n\t\t\t)\n\t\t})\n\t}\n}\n\nfunc ignoreAnonymousAuth(options *Options) {\n\tif aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {\n\t\toptions.Credentials = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/protocol/query\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/encoding/httpbinding\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"path\"\n)\n\ntype awsAwsquery_serializeOpAssumeRole struct {\n}\n\nfunc (*awsAwsquery_serializeOpAssumeRole) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*AssumeRoleInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"AssumeRole\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentAssumeRoleInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpAssumeRoleWithSAML struct {\n}\n\nfunc (*awsAwsquery_serializeOpAssumeRoleWithSAML) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*AssumeRoleWithSAMLInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"AssumeRoleWithSAML\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpAssumeRoleWithWebIdentity struct {\n}\n\nfunc (*awsAwsquery_serializeOpAssumeRoleWithWebIdentity) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"AssumeRoleWithWebIdentity\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpDecodeAuthorizationMessage struct {\n}\n\nfunc (*awsAwsquery_serializeOpDecodeAuthorizationMessage) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*DecodeAuthorizationMessageInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"DecodeAuthorizationMessage\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpGetAccessKeyInfo struct {\n}\n\nfunc (*awsAwsquery_serializeOpGetAccessKeyInfo) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetAccessKeyInfoInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"GetAccessKeyInfo\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpGetCallerIdentity struct {\n}\n\nfunc (*awsAwsquery_serializeOpGetCallerIdentity) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetCallerIdentityInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"GetCallerIdentity\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpGetFederationToken struct {\n}\n\nfunc (*awsAwsquery_serializeOpGetFederationToken) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetFederationTokenInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"GetFederationToken\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentGetFederationTokenInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\n\ntype awsAwsquery_serializeOpGetSessionToken struct {\n}\n\nfunc (*awsAwsquery_serializeOpGetSessionToken) ID() string {\n\treturn \"OperationSerializer\"\n}\n\nfunc (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := in.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown transport type %T\", in.Request)}\n\t}\n\n\tinput, ok := in.Parameters.(*GetSessionTokenInput)\n\t_ = input\n\tif !ok {\n\t\treturn out, metadata, &smithy.SerializationError{Err: fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)}\n\t}\n\n\toperationPath := \"/\"\n\tif len(request.Request.URL.Path) == 0 {\n\t\trequest.Request.URL.Path = operationPath\n\t} else {\n\t\trequest.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)\n\t\tif request.Request.URL.Path != \"/\" && operationPath[len(operationPath)-1] == '/' {\n\t\t\trequest.Request.URL.Path += \"/\"\n\t\t}\n\t}\n\trequest.Request.Method = \"POST\"\n\thttpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\thttpBindingEncoder.SetHeader(\"Content-Type\").String(\"application/x-www-form-urlencoded\")\n\n\tbodyWriter := bytes.NewBuffer(nil)\n\tbodyEncoder := query.NewEncoder(bodyWriter)\n\tbody := bodyEncoder.Object()\n\tbody.Key(\"Action\").String(\"GetSessionToken\")\n\tbody.Key(\"Version\").String(\"2011-06-15\")\n\n\tif err := awsAwsquery_serializeOpDocumentGetSessionTokenInput(input, bodyEncoder.Value); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\terr = bodyEncoder.Encode()\n\tif err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\n\tif request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {\n\t\treturn out, metadata, &smithy.SerializationError{Err: err}\n\t}\n\tin.Request = request\n\n\treturn next.HandleSerialize(ctx, in)\n}\nfunc awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error {\n\tarray := value.Array(\"member\")\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsquery_serializeDocumentPolicyDescriptorType(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptorType, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.Arn != nil {\n\t\tobjectKey := object.Key(\"arn\")\n\t\tobjectKey.String(*v.Arn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentProvidedContext(v *types.ProvidedContext, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.ContextAssertion != nil {\n\t\tobjectKey := object.Key(\"ContextAssertion\")\n\t\tobjectKey.String(*v.ContextAssertion)\n\t}\n\n\tif v.ProviderArn != nil {\n\t\tobjectKey := object.Key(\"ProviderArn\")\n\t\tobjectKey.String(*v.ProviderArn)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentProvidedContextsListType(v []types.ProvidedContext, value query.Value) error {\n\tarray := value.Array(\"member\")\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsquery_serializeDocumentProvidedContext(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.Key != nil {\n\t\tobjectKey := object.Key(\"Key\")\n\t\tobjectKey.String(*v.Key)\n\t}\n\n\tif v.Value != nil {\n\t\tobjectKey := object.Key(\"Value\")\n\t\tobjectKey.String(*v.Value)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) error {\n\tarray := value.Array(\"member\")\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tav.String(v[i])\n\t}\n\treturn nil\n}\n\nfunc awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) error {\n\tarray := value.Array(\"member\")\n\n\tfor i := range v {\n\t\tav := array.Value()\n\t\tif err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.DurationSeconds != nil {\n\t\tobjectKey := object.Key(\"DurationSeconds\")\n\t\tobjectKey.Integer(*v.DurationSeconds)\n\t}\n\n\tif v.ExternalId != nil {\n\t\tobjectKey := object.Key(\"ExternalId\")\n\t\tobjectKey.String(*v.ExternalId)\n\t}\n\n\tif v.Policy != nil {\n\t\tobjectKey := object.Key(\"Policy\")\n\t\tobjectKey.String(*v.Policy)\n\t}\n\n\tif v.PolicyArns != nil {\n\t\tobjectKey := object.Key(\"PolicyArns\")\n\t\tif err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ProvidedContexts != nil {\n\t\tobjectKey := object.Key(\"ProvidedContexts\")\n\t\tif err := awsAwsquery_serializeDocumentProvidedContextsListType(v.ProvidedContexts, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.RoleArn != nil {\n\t\tobjectKey := object.Key(\"RoleArn\")\n\t\tobjectKey.String(*v.RoleArn)\n\t}\n\n\tif v.RoleSessionName != nil {\n\t\tobjectKey := object.Key(\"RoleSessionName\")\n\t\tobjectKey.String(*v.RoleSessionName)\n\t}\n\n\tif v.SerialNumber != nil {\n\t\tobjectKey := object.Key(\"SerialNumber\")\n\t\tobjectKey.String(*v.SerialNumber)\n\t}\n\n\tif v.SourceIdentity != nil {\n\t\tobjectKey := object.Key(\"SourceIdentity\")\n\t\tobjectKey.String(*v.SourceIdentity)\n\t}\n\n\tif v.Tags != nil {\n\t\tobjectKey := object.Key(\"Tags\")\n\t\tif err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.TokenCode != nil {\n\t\tobjectKey := object.Key(\"TokenCode\")\n\t\tobjectKey.String(*v.TokenCode)\n\t}\n\n\tif v.TransitiveTagKeys != nil {\n\t\tobjectKey := object.Key(\"TransitiveTagKeys\")\n\t\tif err := awsAwsquery_serializeDocumentTagKeyListType(v.TransitiveTagKeys, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.DurationSeconds != nil {\n\t\tobjectKey := object.Key(\"DurationSeconds\")\n\t\tobjectKey.Integer(*v.DurationSeconds)\n\t}\n\n\tif v.Policy != nil {\n\t\tobjectKey := object.Key(\"Policy\")\n\t\tobjectKey.String(*v.Policy)\n\t}\n\n\tif v.PolicyArns != nil {\n\t\tobjectKey := object.Key(\"PolicyArns\")\n\t\tif err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.PrincipalArn != nil {\n\t\tobjectKey := object.Key(\"PrincipalArn\")\n\t\tobjectKey.String(*v.PrincipalArn)\n\t}\n\n\tif v.RoleArn != nil {\n\t\tobjectKey := object.Key(\"RoleArn\")\n\t\tobjectKey.String(*v.RoleArn)\n\t}\n\n\tif v.SAMLAssertion != nil {\n\t\tobjectKey := object.Key(\"SAMLAssertion\")\n\t\tobjectKey.String(*v.SAMLAssertion)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.DurationSeconds != nil {\n\t\tobjectKey := object.Key(\"DurationSeconds\")\n\t\tobjectKey.Integer(*v.DurationSeconds)\n\t}\n\n\tif v.Policy != nil {\n\t\tobjectKey := object.Key(\"Policy\")\n\t\tobjectKey.String(*v.Policy)\n\t}\n\n\tif v.PolicyArns != nil {\n\t\tobjectKey := object.Key(\"PolicyArns\")\n\t\tif err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.ProviderId != nil {\n\t\tobjectKey := object.Key(\"ProviderId\")\n\t\tobjectKey.String(*v.ProviderId)\n\t}\n\n\tif v.RoleArn != nil {\n\t\tobjectKey := object.Key(\"RoleArn\")\n\t\tobjectKey.String(*v.RoleArn)\n\t}\n\n\tif v.RoleSessionName != nil {\n\t\tobjectKey := object.Key(\"RoleSessionName\")\n\t\tobjectKey.String(*v.RoleSessionName)\n\t}\n\n\tif v.WebIdentityToken != nil {\n\t\tobjectKey := object.Key(\"WebIdentityToken\")\n\t\tobjectKey.String(*v.WebIdentityToken)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.EncodedMessage != nil {\n\t\tobjectKey := object.Key(\"EncodedMessage\")\n\t\tobjectKey.String(*v.EncodedMessage)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(v *GetAccessKeyInfoInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.AccessKeyId != nil {\n\t\tobjectKey := object.Key(\"AccessKeyId\")\n\t\tobjectKey.String(*v.AccessKeyId)\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentGetCallerIdentityInput(v *GetCallerIdentityInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationTokenInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.DurationSeconds != nil {\n\t\tobjectKey := object.Key(\"DurationSeconds\")\n\t\tobjectKey.Integer(*v.DurationSeconds)\n\t}\n\n\tif v.Name != nil {\n\t\tobjectKey := object.Key(\"Name\")\n\t\tobjectKey.String(*v.Name)\n\t}\n\n\tif v.Policy != nil {\n\t\tobjectKey := object.Key(\"Policy\")\n\t\tobjectKey.String(*v.Policy)\n\t}\n\n\tif v.PolicyArns != nil {\n\t\tobjectKey := object.Key(\"PolicyArns\")\n\t\tif err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif v.Tags != nil {\n\t\tobjectKey := object.Key(\"Tags\")\n\t\tif err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput, value query.Value) error {\n\tobject := value.Object()\n\t_ = object\n\n\tif v.DurationSeconds != nil {\n\t\tobjectKey := object.Key(\"DurationSeconds\")\n\t\tobjectKey.Integer(*v.DurationSeconds)\n\t}\n\n\tif v.SerialNumber != nil {\n\t\tobjectKey := object.Key(\"SerialNumber\")\n\t\tobjectKey.String(*v.SerialNumber)\n\t}\n\n\tif v.TokenCode != nil {\n\t\tobjectKey := object.Key(\"TokenCode\")\n\t\tobjectKey.String(*v.TokenCode)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\t\"fmt\"\n\tsmithy \"github.com/aws/smithy-go\"\n)\n\n// The web identity token that was passed is expired or is not valid. Get a new\n// identity token from the identity provider and then retry the request.\ntype ExpiredTokenException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *ExpiredTokenException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *ExpiredTokenException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *ExpiredTokenException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"ExpiredTokenException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The request could not be fulfilled because the identity provider (IDP) that was\n// asked to verify the incoming identity token could not be reached. This is often\n// a transient error caused by network conditions. Retry the request a limited\n// number of times so that you don't exceed the request rate. If the error\n// persists, the identity provider might be down or not responding.\ntype IDPCommunicationErrorException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *IDPCommunicationErrorException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *IDPCommunicationErrorException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *IDPCommunicationErrorException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"IDPCommunicationError\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The identity provider (IdP) reported that authentication failed. This might be\n// because the claim is invalid.\n//\n// If this error is returned for the AssumeRoleWithWebIdentity operation, it can\n// also mean that the claim has expired or has been explicitly revoked.\ntype IDPRejectedClaimException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *IDPRejectedClaimException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *IDPRejectedClaimException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *IDPRejectedClaimException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"IDPRejectedClaim\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The error returned if the message passed to DecodeAuthorizationMessage was\n// invalid. This can happen if the token contains invalid characters, such as\n// linebreaks.\ntype InvalidAuthorizationMessageException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidAuthorizationMessageException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidAuthorizationMessageException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidAuthorizationMessageException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidAuthorizationMessageException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault {\n\treturn smithy.FaultClient\n}\n\n// The web identity token that was passed could not be validated by Amazon Web\n// Services. Get a new identity token from the identity provider and then retry the\n// request.\ntype InvalidIdentityTokenException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *InvalidIdentityTokenException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *InvalidIdentityTokenException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *InvalidIdentityTokenException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"InvalidIdentityToken\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The request was rejected because the policy document was malformed. The error\n// message describes the specific error.\ntype MalformedPolicyDocumentException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *MalformedPolicyDocumentException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *MalformedPolicyDocumentException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *MalformedPolicyDocumentException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"MalformedPolicyDocument\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// The request was rejected because the total packed size of the session policies\n// and session tags combined was too large. An Amazon Web Services conversion\n// compresses the session policy document, session policy ARNs, and session tags\n// into a packed binary format that has a separate limit. The error message\n// indicates by percentage how close the policies and tags are to the upper size\n// limit. For more information, see [Passing Session Tags in STS]in the IAM User Guide.\n//\n// You could receive this error even though you meet other defined session policy\n// and session tag limits. For more information, see [IAM and STS Entity Character Limits]in the IAM User Guide.\n//\n// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\n// [IAM and STS Entity Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length\ntype PackedPolicyTooLargeException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *PackedPolicyTooLargeException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *PackedPolicyTooLargeException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *PackedPolicyTooLargeException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"PackedPolicyTooLarge\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n\n// STS is not activated in the requested region for the account that is being\n// asked to generate credentials. The account administrator must use the IAM\n// console to activate STS in that region. For more information, see [Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region]in the IAM\n// User Guide.\n//\n// [Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html\ntype RegionDisabledException struct {\n\tMessage *string\n\n\tErrorCodeOverride *string\n\n\tnoSmithyDocumentSerde\n}\n\nfunc (e *RegionDisabledException) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.ErrorCode(), e.ErrorMessage())\n}\nfunc (e *RegionDisabledException) ErrorMessage() string {\n\tif e.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Message\n}\nfunc (e *RegionDisabledException) ErrorCode() string {\n\tif e == nil || e.ErrorCodeOverride == nil {\n\t\treturn \"RegionDisabledException\"\n\t}\n\treturn *e.ErrorCodeOverride\n}\nfunc (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage types\n\nimport (\n\tsmithydocument \"github.com/aws/smithy-go/document\"\n\t\"time\"\n)\n\n// The identifiers for the temporary security credentials that the operation\n// returns.\ntype AssumedRoleUser struct {\n\n\t// The ARN of the temporary security credentials that are returned from the AssumeRole\n\t// action. For more information about ARNs and how to use them in policies, see [IAM Identifiers]in\n\t// the IAM User Guide.\n\t//\n\t// [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html\n\t//\n\t// This member is required.\n\tArn *string\n\n\t// A unique identifier that contains the role ID and the role session name of the\n\t// role that is being assumed. The role ID is generated by Amazon Web Services when\n\t// the role is created.\n\t//\n\t// This member is required.\n\tAssumedRoleId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Amazon Web Services credentials for API authentication.\ntype Credentials struct {\n\n\t// The access key ID that identifies the temporary security credentials.\n\t//\n\t// This member is required.\n\tAccessKeyId *string\n\n\t// The date on which the current credentials expire.\n\t//\n\t// This member is required.\n\tExpiration *time.Time\n\n\t// The secret access key that can be used to sign requests.\n\t//\n\t// This member is required.\n\tSecretAccessKey *string\n\n\t// The token that users must pass to the service API to use the temporary\n\t// credentials.\n\t//\n\t// This member is required.\n\tSessionToken *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Identifiers for the federated user that is associated with the credentials.\ntype FederatedUser struct {\n\n\t// The ARN that specifies the federated user that is associated with the\n\t// credentials. For more information about ARNs and how to use them in policies,\n\t// see [IAM Identifiers]in the IAM User Guide.\n\t//\n\t// [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html\n\t//\n\t// This member is required.\n\tArn *string\n\n\t// The string that identifies the federated user associated with the credentials,\n\t// similar to the unique ID of an IAM user.\n\t//\n\t// This member is required.\n\tFederatedUserId *string\n\n\tnoSmithyDocumentSerde\n}\n\n// A reference to the IAM managed policy that is passed as a session policy for a\n// role session or a federated user session.\ntype PolicyDescriptorType struct {\n\n\t// The Amazon Resource Name (ARN) of the IAM managed policy to use as a session\n\t// policy for the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web\n\t// Services General Reference.\n\t//\n\t// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\n\tArn *string\n\n\tnoSmithyDocumentSerde\n}\n\n// Contains information about the provided context. This includes the signed and\n// encrypted trusted context assertion and the context provider ARN from which the\n// trusted context assertion was generated.\ntype ProvidedContext struct {\n\n\t// The signed and encrypted trusted context assertion generated by the context\n\t// provider. The trusted context assertion is signed and encrypted by Amazon Web\n\t// Services STS.\n\tContextAssertion *string\n\n\t// The context provider ARN from which the trusted context assertion was generated.\n\tProviderArn *string\n\n\tnoSmithyDocumentSerde\n}\n\n// You can pass custom key-value pair attributes when you assume a role or\n// federate a user. These are called session tags. You can then use the session\n// tags to control access to resources. For more information, see [Tagging Amazon Web Services STS Sessions]in the IAM User\n// Guide.\n//\n// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html\ntype Tag struct {\n\n\t// The key for a session tag.\n\t//\n\t// You can pass up to 50 session tags. The plain text session tag keys can’t\n\t// exceed 128 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User\n\t// Guide.\n\t//\n\t// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n\t//\n\t// This member is required.\n\tKey *string\n\n\t// The value for a session tag.\n\t//\n\t// You can pass up to 50 session tags. The plain text session tag values can’t\n\t// exceed 256 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User\n\t// Guide.\n\t//\n\t// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length\n\t//\n\t// This member is required.\n\tValue *string\n\n\tnoSmithyDocumentSerde\n}\n\ntype noSmithyDocumentSerde = smithydocument.NoSerde\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go",
    "content": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/service/sts/types\"\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype validateOpAssumeRole struct {\n}\n\nfunc (*validateOpAssumeRole) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpAssumeRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*AssumeRoleInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpAssumeRoleInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpAssumeRoleWithSAML struct {\n}\n\nfunc (*validateOpAssumeRoleWithSAML) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpAssumeRoleWithSAML) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*AssumeRoleWithSAMLInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpAssumeRoleWithSAMLInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpAssumeRoleWithWebIdentity struct {\n}\n\nfunc (*validateOpAssumeRoleWithWebIdentity) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpAssumeRoleWithWebIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpAssumeRoleWithWebIdentityInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpDecodeAuthorizationMessage struct {\n}\n\nfunc (*validateOpDecodeAuthorizationMessage) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpDecodeAuthorizationMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*DecodeAuthorizationMessageInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpDecodeAuthorizationMessageInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetAccessKeyInfo struct {\n}\n\nfunc (*validateOpGetAccessKeyInfo) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetAccessKeyInfo) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetAccessKeyInfoInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetAccessKeyInfoInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\ntype validateOpGetFederationToken struct {\n}\n\nfunc (*validateOpGetFederationToken) ID() string {\n\treturn \"OperationInputValidation\"\n}\n\nfunc (m *validateOpGetFederationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tinput, ok := in.Parameters.(*GetFederationTokenInput)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown input parameters type %T\", in.Parameters)\n\t}\n\tif err := validateOpGetFederationTokenInput(input); err != nil {\n\t\treturn out, metadata, err\n\t}\n\treturn next.HandleInitialize(ctx, in)\n}\n\nfunc addOpAssumeRoleValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpAssumeRole{}, middleware.After)\n}\n\nfunc addOpAssumeRoleWithSAMLValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpAssumeRoleWithSAML{}, middleware.After)\n}\n\nfunc addOpAssumeRoleWithWebIdentityValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpAssumeRoleWithWebIdentity{}, middleware.After)\n}\n\nfunc addOpDecodeAuthorizationMessageValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpDecodeAuthorizationMessage{}, middleware.After)\n}\n\nfunc addOpGetAccessKeyInfoValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetAccessKeyInfo{}, middleware.After)\n}\n\nfunc addOpGetFederationTokenValidationMiddleware(stack *middleware.Stack) error {\n\treturn stack.Initialize.Add(&validateOpGetFederationToken{}, middleware.After)\n}\n\nfunc validateTag(v *types.Tag) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"Tag\"}\n\tif v.Key == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Key\"))\n\t}\n\tif v.Value == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Value\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateTagListType(v []types.Tag) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"TagListType\"}\n\tfor i := range v {\n\t\tif err := validateTag(&v[i]); err != nil {\n\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"[%d]\", i), err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpAssumeRoleInput(v *AssumeRoleInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssumeRoleInput\"}\n\tif v.RoleArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif v.RoleSessionName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleSessionName\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagListType(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssumeRoleWithSAMLInput\"}\n\tif v.RoleArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif v.PrincipalArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"PrincipalArn\"))\n\t}\n\tif v.SAMLAssertion == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"SAMLAssertion\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"AssumeRoleWithWebIdentityInput\"}\n\tif v.RoleArn == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif v.RoleSessionName == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"RoleSessionName\"))\n\t}\n\tif v.WebIdentityToken == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"WebIdentityToken\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"DecodeAuthorizationMessageInput\"}\n\tif v.EncodedMessage == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"EncodedMessage\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetAccessKeyInfoInput(v *GetAccessKeyInfoInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetAccessKeyInfoInput\"}\n\tif v.AccessKeyId == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"AccessKeyId\"))\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc validateOpGetFederationTokenInput(v *GetFederationTokenInput) error {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tinvalidParams := smithy.InvalidParamsError{Context: \"GetFederationTokenInput\"}\n\tif v.Name == nil {\n\t\tinvalidParams.Add(smithy.NewErrParamRequired(\"Name\"))\n\t}\n\tif v.Tags != nil {\n\t\tif err := validateTagListType(v.Tags); err != nil {\n\t\t\tinvalidParams.AddNested(\"Tags\", err.(smithy.InvalidParamsError))\n\t\t}\n\t}\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t} else {\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/.gitignore",
    "content": "# Eclipse\n.classpath\n.project\n.settings/\n\n# Intellij\n.idea/\n*.iml\n*.iws\n\n# Mac\n.DS_Store\n\n# Maven\ntarget/\n**/dependency-reduced-pom.xml\n\n# Gradle\n/.gradle\nbuild/\n*/out/\n*/*/out/\n\n# VS Code\nbin/\n.vscode/\n\n# make\nc.out\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/.travis.yml",
    "content": "language: go\nsudo: true\ndist: bionic\n\nbranches:\n  only:\n    - main\n\nos:\n  - linux\n  - osx\n  # Travis doesn't work with windows and Go tip\n  #- windows\n\ngo:\n  - tip\n\nmatrix:\n  allow_failures:\n    - go: tip\n\nbefore_install:\n  - if [ \"$TRAVIS_OS_NAME\" = \"windows\" ]; then choco install make; fi\n  - (cd /tmp/; go get golang.org/x/lint/golint)\n\nscript:\n  - make go test -v ./...;\n\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/CHANGELOG.md",
    "content": "# Release (2024-06-27)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.20.3\n  * **Bug Fix**: Fix encoding/cbor test overflow on x86.\n\n# Release (2024-03-29)\n\n* No change notes available for this release.\n\n# Release (2024-02-21)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.20.1\n  * **Bug Fix**: Remove runtime dependency on go-cmp.\n\n# Release (2024-02-13)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.20.0\n  * **Feature**: Add codegen definition for sigv4a trait.\n  * **Feature**: Bump minimum Go version to 1.20 per our language support policy.\n\n# Release (2023-12-07)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.19.0\n  * **Feature**: Support modeled request compression.\n\n# Release (2023-11-30)\n\n* No change notes available for this release.\n\n# Release (2023-11-29)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.18.0\n  * **Feature**: Expose Options() method on generated service clients.\n\n# Release (2023-11-15)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.17.0\n  * **Feature**: Support identity/auth components of client reference architecture.\n\n# Release (2023-10-31)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.16.0\n  * **Feature**: **LANG**: Bump minimum go version to 1.19.\n\n# Release (2023-10-06)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.15.0\n  * **Feature**: Add `http.WithHeaderComment` middleware.\n\n# Release (2023-08-18)\n\n* No change notes available for this release.\n\n# Release (2023-08-07)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.14.1\n  * **Bug Fix**: Prevent duplicated error returns in EndpointResolverV2 default implementation.\n\n# Release (2023-07-31)\n\n## General Highlights\n* **Feature**: Adds support for smithy-modeled endpoint resolution.\n\n# Release (2022-12-02)\n\n* No change notes available for this release.\n\n# Release (2022-10-24)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.13.4\n  * **Bug Fix**: fixed document type checking for encoding nested types\n\n# Release (2022-09-14)\n\n* No change notes available for this release.\n\n# Release (v1.13.2)\n\n* No change notes available for this release.\n\n# Release (v1.13.1)\n\n* No change notes available for this release.\n\n# Release (v1.13.0)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.13.0\n  * **Feature**: Adds support for the Smithy httpBearerAuth authentication trait to smithy-go. This allows the SDK to support the bearer authentication flow for API operations decorated with httpBearerAuth. An API client will need to be provided with its own bearer.TokenProvider implementation or use the bearer.StaticTokenProvider implementation.\n\n# Release (v1.12.1)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.12.1\n  * **Bug Fix**: Fixes a bug where JSON object keys were not escaped.\n\n# Release (v1.12.0)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.12.0\n  * **Feature**: `transport/http`: Add utility for setting context metadata when operation serializer automatically assigns content-type default value.\n\n# Release (v1.11.3)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.11.3\n  * **Dependency Update**: Updates smithy-go unit test dependency go-cmp to 0.5.8.\n\n# Release (v1.11.2)\n\n* No change notes available for this release.\n\n# Release (v1.11.1)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.11.1\n  * **Bug Fix**: Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. Related to [aws/aws-sdk-go-v2#1583](https://github.com/aws/aws-sdk-go-v2/issues/1583)\n\n# Release (v1.11.0)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.11.0\n  * **Feature**: Updates deserialization of header list to supported quoted strings\n\n# Release (v1.10.0)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.10.0\n  * **Feature**: Add `ptr.Duration`, `ptr.ToDuration`, `ptr.DurationSlice`, `ptr.ToDurationSlice`, `ptr.DurationMap`, and `ptr.ToDurationMap` functions for the `time.Duration` type.\n\n# Release (v1.9.1)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.9.1\n  * **Documentation**: Fixes various typos in Go package documentation.\n\n# Release (v1.9.0)\n\n## Module Highlights\n* `github.com/aws/smithy-go`: v1.9.0\n  * **Feature**: sync: OnceErr, can be used to concurrently record a signal when an error has occurred.\n  * **Bug Fix**: `transport/http`: CloseResponseBody and ErrorCloseResponseBody middleware have been updated to ensure that the body is fully drained before closing.\n\n# Release v1.8.1\n\n### Smithy Go Module\n* **Bug Fix**: Fixed an issue that would cause the HTTP Content-Length to be set to 0 if the stream body was not set.\n  * Fixes [aws/aws-sdk-go-v2#1418](https://github.com/aws/aws-sdk-go-v2/issues/1418)\n\n# Release v1.8.0\n\n### Smithy Go Module\n\n* `time`: Add support for parsing additional DateTime timestamp format ([#324](https://github.com/aws/smithy-go/pull/324))\n  * Adds support for parsing DateTime timestamp formatted time similar to RFC 3339, but without the `Z` character, nor UTC offset.\n  * Fixes [#1387](https://github.com/aws/aws-sdk-go-v2/issues/1387)\n\n# Release v1.7.0\n\n### Smithy Go Module\n* `ptr`:  Handle error for deferred file close call ([#314](https://github.com/aws/smithy-go/pull/314))\n  * Handle error for defer close call\n* `middleware`: Add Clone to Metadata ([#318](https://github.com/aws/smithy-go/pull/318))\n  * Adds a new Clone method to the middleware Metadata type. This provides a shallow clone of the entries in the Metadata.\n* `document`: Add new package for document shape serialization support ([#310](https://github.com/aws/smithy-go/pull/310))\n\n### Codegen\n* Add Smithy Document Shape Support ([#310](https://github.com/aws/smithy-go/pull/310))\n  * Adds support for Smithy Document shapes and supporting types for protocols to implement support\n\n# Release v1.6.0 (2021-07-15)\n\n### Smithy Go Module\n* `encoding/httpbinding`: Support has been added for encoding `float32` and `float64` values that are `NaN`, `Infinity`, or `-Infinity`. ([#316](https://github.com/aws/smithy-go/pull/316))\n\n### Codegen\n* Adds support for handling `float32` and `float64` `NaN` values in HTTP Protocol Unit Tests. ([#316](https://github.com/aws/smithy-go/pull/316))\n* Adds support protocol generator implementations to override the error code string returned by `ErrorCode` methods on generated error types. ([#315](https://github.com/aws/smithy-go/pull/315))\n\n# Release v1.5.0 (2021-06-25)\n\n### Smithy Go module\n* `time`: Update time parsing to not be as strict for HTTPDate and DateTime ([#307](https://github.com/aws/smithy-go/pull/307))\n  * Fixes [#302](https://github.com/aws/smithy-go/issues/302) by changing time to UTC before formatting so no local offset time is lost.\n\n### Codegen\n* Adds support for integrating client members via plugins ([#301](https://github.com/aws/smithy-go/pull/301))\n* Fix serialization of enum types marked with payload trait ([#296](https://github.com/aws/smithy-go/pull/296))\n* Update generation of API client modules to include a manifest of files generated ([#283](https://github.com/aws/smithy-go/pull/283))\n* Update Group Java group ID for smithy-go generator ([#298](https://github.com/aws/smithy-go/pull/298))\n* Support the delegation of determining the errors that can occur for an operation ([#304](https://github.com/aws/smithy-go/pull/304))\n* Support for marking and documenting deprecated client config fields. ([#303](https://github.com/aws/smithy-go/pull/303))\n\n# Release v1.4.0 (2021-05-06)\n\n### Smithy Go module\n* `encoding/xml`: Fix escaping of Next Line and Line Start in XML Encoder ([#267](https://github.com/aws/smithy-go/pull/267))\n\n### Codegen\n* Add support for Smithy 1.7 ([#289](https://github.com/aws/smithy-go/pull/289))\n* Add support for httpQueryParams location\n* Add support for model renaming conflict resolution with service closure\n\n# Release v1.3.1 (2021-04-08)\n\n### Smithy Go module\n* `transport/http`: Loosen endpoint hostname validation to allow specifying port numbers. ([#279](https://github.com/aws/smithy-go/pull/279))\n* `io`: Fix RingBuffer panics due to out of bounds index. ([#282](https://github.com/aws/smithy-go/pull/282))\n\n# Release v1.3.0 (2021-04-01)\n\n### Smithy Go module\n* `transport/http`: Add utility to safely join string to url path, and url raw query.\n\n### Codegen\n* Update HttpBindingProtocolGenerator to use http/transport JoinPath and JoinQuery utility.\n\n# Release v1.2.0 (2021-03-12)\n\n### Smithy Go module\n* Fix support for parsing shortened year format in HTTP Date header.\n* Fix GitHub APIDiff action workflow to get gorelease tool correctly.\n* Fix codegen artifact unit test for Go 1.16\n\n### Codegen\n* Fix generating paginator nil parameter handling before usage.\n* Fix Serialize unboxed members decorated as required.\n* Add ability to define resolvers at both client construction and operation invocation.\n* Support for extending paginators with custom runtime trait\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.md",
    "content": "## Code of Conduct\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).\nFor more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact\nopensource-codeofconduct@amazon.com with any additional questions or comments.\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/CONTRIBUTING.md",
    "content": "# Contributing Guidelines\n\nThank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional\ndocumentation, we greatly value feedback and contributions from our community.\n\nPlease read through this document before submitting any issues or pull requests to ensure we have all the necessary\ninformation to effectively respond to your bug report or contribution.\n\n\n## Reporting Bugs/Feature Requests\n\nWe welcome you to use the GitHub issue tracker to report bugs or suggest features.\n\nWhen filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already\nreported the issue. Please try to include as much information as you can. Details like these are incredibly useful:\n\n* A reproducible test case or series of steps\n* The version of our code being used\n* Any modifications you've made relevant to the bug\n* Anything unusual about your environment or deployment\n\n\n## Contributing via Pull Requests\nContributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:\n\n1. You are working against the latest source on the *main* branch.\n2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.\n3. You open an issue to discuss any significant work - we would hate for your time to be wasted.\n\nTo send us a pull request, please:\n\n1. Fork the repository.\n2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.\n3. Ensure local tests pass.\n4. Commit to your fork using clear commit messages.\n5. Send us a pull request, answering any default questions in the pull request interface.\n6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.\n\nGitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and\n[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).\n\n\n## Finding contributions to work on\nLooking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.\n\n\n## Code of Conduct\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).\nFor more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact\nopensource-codeofconduct@amazon.com with any additional questions or comments.\n\n\n## Security issue notifications\nIf you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.\n\n\n## Licensing\n\nSee the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/Makefile",
    "content": "PRE_RELEASE_VERSION ?=\n\nRELEASE_MANIFEST_FILE ?=\nRELEASE_CHGLOG_DESC_FILE ?=\n\nREPOTOOLS_VERSION ?= latest\nREPOTOOLS_MODULE = github.com/awslabs/aws-go-multi-module-repository-tools\nREPOTOOLS_CMD_CALCULATE_RELEASE = ${REPOTOOLS_MODULE}/cmd/calculaterelease@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS ?=\nREPOTOOLS_CMD_UPDATE_REQUIRES = ${REPOTOOLS_MODULE}/cmd/updaterequires@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_UPDATE_MODULE_METADATA = ${REPOTOOLS_MODULE}/cmd/updatemodulemeta@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION}\nREPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION}\n\nUNIT_TEST_TAGS=\nBUILD_TAGS=\n\nifneq ($(PRE_RELEASE_VERSION),)\n\tREPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION}\nendif\n\nsmithy-publish-local:\n\tcd codegen && ./gradlew publishToMavenLocal\n\nsmithy-build:\n\tcd codegen && ./gradlew build\n\nsmithy-clean:\n\tcd codegen && ./gradlew clean\n\n##################\n# Linting/Verify #\n##################\n.PHONY: verify vet cover\n\nverify: vet\n\nvet:\n\tgo vet ${BUILD_TAGS} --all ./...\n\ncover:\n\tgo test ${BUILD_TAGS} -coverprofile c.out ./...\n\t@cover=`go tool cover -func c.out | grep '^total:' | awk '{ print $$3+0 }'`; \\\n\t\techo \"total (statements): $$cover%\";\n\n################\n# Unit Testing #\n################\n.PHONY: unit unit-race unit-test unit-race-test\n\nunit: verify\n\tgo vet ${BUILD_TAGS} --all ./... && \\\n\tgo test ${BUILD_TAGS} ${RUN_NONE} ./... && \\\n\tgo test -timeout=1m ${UNIT_TEST_TAGS} ./...\n\nunit-race: verify\n\tgo vet ${BUILD_TAGS} --all ./... && \\\n\tgo test ${BUILD_TAGS} ${RUN_NONE} ./... && \\\n\tgo test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./...\n\nunit-test: verify\n\tgo test -timeout=1m ${UNIT_TEST_TAGS} ./...\n\nunit-race-test: verify\n\tgo test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./...\n\n#####################\n#  Release Process  #\n#####################\n.PHONY: preview-release pre-release-validation release\n\npreview-release:\n\tgo run ${REPOTOOLS_CMD_CALCULATE_RELEASE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS}\n\npre-release-validation:\n\t@if [[ -z \"${RELEASE_MANIFEST_FILE}\" ]]; then \\\n\t\techo \"RELEASE_MANIFEST_FILE is required to specify the file to write the release manifest\" && false; \\\n\tfi\n\t@if [[ -z \"${RELEASE_CHGLOG_DESC_FILE}\" ]]; then \\\n\t\techo \"RELEASE_CHGLOG_DESC_FILE is required to specify the file to write the release notes\" && false; \\\n\tfi\n\nrelease: pre-release-validation\n\tgo run ${REPOTOOLS_CMD_CALCULATE_RELEASE} -o ${RELEASE_MANIFEST_FILE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS}\n\tgo run ${REPOTOOLS_CMD_UPDATE_REQUIRES} -release ${RELEASE_MANIFEST_FILE}\n\tgo run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} -release ${RELEASE_MANIFEST_FILE}\n\tgo run ${REPOTOOLS_CMD_GENERATE_CHANGELOG} -release ${RELEASE_MANIFEST_FILE} -o ${RELEASE_CHGLOG_DESC_FILE}\n\tgo run ${REPOTOOLS_CMD_CHANGELOG} rm -all\n\tgo run ${REPOTOOLS_CMD_TAG_RELEASE} -release ${RELEASE_MANIFEST_FILE}\n\nmodule-version:\n\t@go run ${REPOTOOLS_CMD_MODULE_VERSION} .\n\n##############\n# Repo Tools #\n##############\n.PHONY: install-changelog\n\ninstall-changelog:\n\tgo install ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/NOTICE",
    "content": "Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/README.md",
    "content": "## Smithy Go\n\n[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml)\n\n[Smithy](https://smithy.io/) code generators for Go.\n\n**WARNING: All interfaces are subject to change.**\n\n## Can I use this?\n\nIn order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java),\nsuch as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html),\nin order to generate transport mechanisms and serialization/deserialization\ncode (\"serde\") accordingly.\n\nThe code generator does not currently support any protocols out of the box,\ntherefore the useability of this project on its own is currently limited.\nSupport for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html)\nexists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are\ntracking the movement of those out of the SDK into smithy-go in\n[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no\ntimeline for doing so.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/auth.go",
    "content": "// Package auth defines protocol-agnostic authentication types for smithy\n// clients.\npackage auth\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/bearer/docs.go",
    "content": "// Package bearer provides middleware and utilities for authenticating API\n// operation calls with a Bearer Token.\npackage bearer\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/bearer/middleware.go",
    "content": "package bearer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n)\n\n// Message is the middleware stack's request transport message value.\ntype Message interface{}\n\n// Signer provides an interface for implementations to decorate a request\n// message with a bearer token. The signer is responsible for validating the\n// message type is compatible with the signer.\ntype Signer interface {\n\tSignWithBearerToken(context.Context, Token, Message) (Message, error)\n}\n\n// AuthenticationMiddleware provides the Finalize middleware step for signing\n// an request message with a bearer token.\ntype AuthenticationMiddleware struct {\n\tsigner        Signer\n\ttokenProvider TokenProvider\n}\n\n// AddAuthenticationMiddleware helper adds the AuthenticationMiddleware to the\n// middleware Stack in the Finalize step with the options provided.\nfunc AddAuthenticationMiddleware(s *middleware.Stack, signer Signer, tokenProvider TokenProvider) error {\n\treturn s.Finalize.Add(\n\t\tNewAuthenticationMiddleware(signer, tokenProvider),\n\t\tmiddleware.After,\n\t)\n}\n\n// NewAuthenticationMiddleware returns an initialized AuthenticationMiddleware.\nfunc NewAuthenticationMiddleware(signer Signer, tokenProvider TokenProvider) *AuthenticationMiddleware {\n\treturn &AuthenticationMiddleware{\n\t\tsigner:        signer,\n\t\ttokenProvider: tokenProvider,\n\t}\n}\n\nconst authenticationMiddlewareID = \"BearerTokenAuthentication\"\n\n// ID returns the resolver identifier\nfunc (m *AuthenticationMiddleware) ID() string {\n\treturn authenticationMiddlewareID\n}\n\n// HandleFinalize implements the FinalizeMiddleware interface in order to\n// update the request with bearer token authentication.\nfunc (m *AuthenticationMiddleware) HandleFinalize(\n\tctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,\n) (\n\tout middleware.FinalizeOutput, metadata middleware.Metadata, err error,\n) {\n\ttoken, err := m.tokenProvider.RetrieveBearerToken(ctx)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed AuthenticationMiddleware wrap message, %w\", err)\n\t}\n\n\tsignedMessage, err := m.signer.SignWithBearerToken(ctx, token, in.Request)\n\tif err != nil {\n\t\treturn out, metadata, fmt.Errorf(\"failed AuthenticationMiddleware sign message, %w\", err)\n\t}\n\n\tin.Request = signedMessage\n\treturn next.HandleFinalize(ctx, in)\n}\n\n// SignHTTPSMessage provides a bearer token authentication implementation that\n// will sign the message with the provided bearer token.\n//\n// Will fail if the message is not a smithy-go HTTP request or the request is\n// not HTTPS.\ntype SignHTTPSMessage struct{}\n\n// NewSignHTTPSMessage returns an initialized signer for HTTP messages.\nfunc NewSignHTTPSMessage() *SignHTTPSMessage {\n\treturn &SignHTTPSMessage{}\n}\n\n// SignWithBearerToken returns a copy of the HTTP request with the bearer token\n// added via the \"Authorization\" header, per RFC 6750, https://datatracker.ietf.org/doc/html/rfc6750.\n//\n// Returns an error if the request's URL scheme is not HTTPS, or the request\n// message is not an smithy-go HTTP Request pointer type.\nfunc (SignHTTPSMessage) SignWithBearerToken(ctx context.Context, token Token, message Message) (Message, error) {\n\treq, ok := message.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expect smithy-go HTTP Request, got %T\", message)\n\t}\n\n\tif !req.IsHTTPS() {\n\t\treturn nil, fmt.Errorf(\"bearer token with HTTP request requires HTTPS\")\n\t}\n\n\treqClone := req.Clone()\n\treqClone.Header.Set(\"Authorization\", \"Bearer \"+token.Value)\n\n\treturn reqClone, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/bearer/token.go",
    "content": "package bearer\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\n// Token provides a type wrapping a bearer token and expiration metadata.\ntype Token struct {\n\tValue string\n\n\tCanExpire bool\n\tExpires   time.Time\n}\n\n// Expired returns if the token's Expires time is before or equal to the time\n// provided. If CanExpires is false, Expired will always return false.\nfunc (t Token) Expired(now time.Time) bool {\n\tif !t.CanExpire {\n\t\treturn false\n\t}\n\tnow = now.Round(0)\n\treturn now.Equal(t.Expires) || now.After(t.Expires)\n}\n\n// TokenProvider provides interface for retrieving bearer tokens.\ntype TokenProvider interface {\n\tRetrieveBearerToken(context.Context) (Token, error)\n}\n\n// TokenProviderFunc provides a helper utility to wrap a function as a type\n// that implements the TokenProvider interface.\ntype TokenProviderFunc func(context.Context) (Token, error)\n\n// RetrieveBearerToken calls the wrapped function, returning the Token or\n// error.\nfunc (fn TokenProviderFunc) RetrieveBearerToken(ctx context.Context) (Token, error) {\n\treturn fn(ctx)\n}\n\n// StaticTokenProvider provides a utility for wrapping a static bearer token\n// value within an implementation of a token provider.\ntype StaticTokenProvider struct {\n\tToken Token\n}\n\n// RetrieveBearerToken returns the static token specified.\nfunc (s StaticTokenProvider) RetrieveBearerToken(context.Context) (Token, error) {\n\treturn s.Token, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go",
    "content": "package bearer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\tsmithycontext \"github.com/aws/smithy-go/context\"\n\t\"github.com/aws/smithy-go/internal/sync/singleflight\"\n)\n\n// package variable that can be override in unit tests.\nvar timeNow = time.Now\n\n// TokenCacheOptions provides a set of optional configuration options for the\n// TokenCache TokenProvider.\ntype TokenCacheOptions struct {\n\t// The duration before the token will expire when the credentials will be\n\t// refreshed. If DisableAsyncRefresh is true, the RetrieveBearerToken calls\n\t// will be blocking.\n\t//\n\t// Asynchronous refreshes are deduplicated, and only one will be in-flight\n\t// at a time. If the token expires while an asynchronous refresh is in\n\t// flight, the next call to RetrieveBearerToken will block on that refresh\n\t// to return.\n\tRefreshBeforeExpires time.Duration\n\n\t// The timeout the underlying TokenProvider's RetrieveBearerToken call must\n\t// return within, or will be canceled. Defaults to 0, no timeout.\n\t//\n\t// If 0 timeout, its possible for the underlying tokenProvider's\n\t// RetrieveBearerToken call to block forever. Preventing subsequent\n\t// TokenCache attempts to refresh the token.\n\t//\n\t// If this timeout is reached all pending deduplicated calls to\n\t// TokenCache RetrieveBearerToken will fail with an error.\n\tRetrieveBearerTokenTimeout time.Duration\n\n\t// The minimum duration between asynchronous refresh attempts. If the next\n\t// asynchronous recent refresh attempt was within the minimum delay\n\t// duration, the call to retrieve will return the current cached token, if\n\t// not expired.\n\t//\n\t// The asynchronous retrieve is deduplicated across multiple calls when\n\t// RetrieveBearerToken is called. The asynchronous retrieve is not a\n\t// periodic task. It is only performed when the token has not yet expired,\n\t// and the current item is within the RefreshBeforeExpires window, and the\n\t// TokenCache's RetrieveBearerToken method is called.\n\t//\n\t// If 0, (default) there will be no minimum delay between asynchronous\n\t// refresh attempts.\n\t//\n\t// If DisableAsyncRefresh is true, this option is ignored.\n\tAsyncRefreshMinimumDelay time.Duration\n\n\t// Sets if the TokenCache will attempt to refresh the token in the\n\t// background asynchronously instead of blocking for credentials to be\n\t// refreshed. If disabled token refresh will be blocking.\n\t//\n\t// The first call to RetrieveBearerToken will always be blocking, because\n\t// there is no cached token.\n\tDisableAsyncRefresh bool\n}\n\n// TokenCache provides an utility to cache Bearer Authentication tokens from a\n// wrapped TokenProvider. The TokenCache can be has options to configure the\n// cache's early and asynchronous refresh of the token.\ntype TokenCache struct {\n\toptions  TokenCacheOptions\n\tprovider TokenProvider\n\n\tcachedToken            atomic.Value\n\tlastRefreshAttemptTime atomic.Value\n\tsfGroup                singleflight.Group\n}\n\n// NewTokenCache returns a initialized TokenCache that implements the\n// TokenProvider interface. Wrapping the provider passed in. Also taking a set\n// of optional functional option parameters to configure the token cache.\nfunc NewTokenCache(provider TokenProvider, optFns ...func(*TokenCacheOptions)) *TokenCache {\n\tvar options TokenCacheOptions\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &TokenCache{\n\t\toptions:  options,\n\t\tprovider: provider,\n\t}\n}\n\n// RetrieveBearerToken returns the token if it could be obtained, or error if a\n// valid token could not be retrieved.\n//\n// The passed in Context's cancel/deadline/timeout will impacting only this\n// individual retrieve call and not any other already queued up calls. This\n// means underlying provider's RetrieveBearerToken calls could block for ever,\n// and not be canceled with the Context. Set RetrieveBearerTokenTimeout to\n// provide a timeout, preventing the underlying TokenProvider blocking forever.\n//\n// By default, if the passed in Context is canceled, all of its values will be\n// considered expired. The wrapped TokenProvider will not be able to lookup the\n// values from the Context once it is expired. This is done to protect against\n// expired values no longer being valid. To disable this behavior, use\n// smithy-go's context.WithPreserveExpiredValues to add a value to the Context\n// before calling RetrieveBearerToken to enable support for expired values.\n//\n// Without RetrieveBearerTokenTimeout there is the potential for a underlying\n// Provider's RetrieveBearerToken call to sit forever. Blocking in subsequent\n// attempts at refreshing the token.\nfunc (p *TokenCache) RetrieveBearerToken(ctx context.Context) (Token, error) {\n\tcachedToken, ok := p.getCachedToken()\n\tif !ok || cachedToken.Expired(timeNow()) {\n\t\treturn p.refreshBearerToken(ctx)\n\t}\n\n\t// Check if the token should be refreshed before it expires.\n\trefreshToken := cachedToken.Expired(timeNow().Add(p.options.RefreshBeforeExpires))\n\tif !refreshToken {\n\t\treturn cachedToken, nil\n\t}\n\n\tif p.options.DisableAsyncRefresh {\n\t\treturn p.refreshBearerToken(ctx)\n\t}\n\n\tp.tryAsyncRefresh(ctx)\n\n\treturn cachedToken, nil\n}\n\n// tryAsyncRefresh attempts to asynchronously refresh the token returning the\n// already cached token. If it AsyncRefreshMinimumDelay option is not zero, and\n// the duration since the last refresh is less than that value, nothing will be\n// done.\nfunc (p *TokenCache) tryAsyncRefresh(ctx context.Context) {\n\tif p.options.AsyncRefreshMinimumDelay != 0 {\n\t\tvar lastRefreshAttempt time.Time\n\t\tif v := p.lastRefreshAttemptTime.Load(); v != nil {\n\t\t\tlastRefreshAttempt = v.(time.Time)\n\t\t}\n\n\t\tif timeNow().Before(lastRefreshAttempt.Add(p.options.AsyncRefreshMinimumDelay)) {\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Ignore the returned channel so this won't be blocking, and limit the\n\t// number of additional goroutines created.\n\tp.sfGroup.DoChan(\"async-refresh\", func() (interface{}, error) {\n\t\tres, err := p.refreshBearerToken(ctx)\n\t\tif p.options.AsyncRefreshMinimumDelay != 0 {\n\t\t\tvar refreshAttempt time.Time\n\t\t\tif err != nil {\n\t\t\t\trefreshAttempt = timeNow()\n\t\t\t}\n\t\t\tp.lastRefreshAttemptTime.Store(refreshAttempt)\n\t\t}\n\n\t\treturn res, err\n\t})\n}\n\nfunc (p *TokenCache) refreshBearerToken(ctx context.Context) (Token, error) {\n\tresCh := p.sfGroup.DoChan(\"refresh-token\", func() (interface{}, error) {\n\t\tctx := smithycontext.WithSuppressCancel(ctx)\n\t\tif v := p.options.RetrieveBearerTokenTimeout; v != 0 {\n\t\t\tvar cancel func()\n\t\t\tctx, cancel = context.WithTimeout(ctx, v)\n\t\t\tdefer cancel()\n\t\t}\n\t\treturn p.singleRetrieve(ctx)\n\t})\n\n\tselect {\n\tcase res := <-resCh:\n\t\treturn res.Val.(Token), res.Err\n\tcase <-ctx.Done():\n\t\treturn Token{}, fmt.Errorf(\"retrieve bearer token canceled, %w\", ctx.Err())\n\t}\n}\n\nfunc (p *TokenCache) singleRetrieve(ctx context.Context) (interface{}, error) {\n\ttoken, err := p.provider.RetrieveBearerToken(ctx)\n\tif err != nil {\n\t\treturn Token{}, fmt.Errorf(\"failed to retrieve bearer token, %w\", err)\n\t}\n\n\tp.cachedToken.Store(&token)\n\treturn token, nil\n}\n\n// getCachedToken returns the currently cached token and true if found. Returns\n// false if no token is cached.\nfunc (p *TokenCache) getCachedToken() (Token, bool) {\n\tv := p.cachedToken.Load()\n\tif v == nil {\n\t\treturn Token{}, false\n\t}\n\n\tt := v.(*Token)\n\tif t == nil || t.Value == \"\" {\n\t\treturn Token{}, false\n\t}\n\n\treturn *t, true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/identity.go",
    "content": "package auth\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go\"\n)\n\n// Identity contains information that identifies who the user making the\n// request is.\ntype Identity interface {\n\tExpiration() time.Time\n}\n\n// IdentityResolver defines the interface through which an Identity is\n// retrieved.\ntype IdentityResolver interface {\n\tGetIdentity(context.Context, smithy.Properties) (Identity, error)\n}\n\n// IdentityResolverOptions defines the interface through which an entity can be\n// queried to retrieve an IdentityResolver for a given auth scheme.\ntype IdentityResolverOptions interface {\n\tGetIdentityResolver(schemeID string) IdentityResolver\n}\n\n// AnonymousIdentity is a sentinel to indicate no identity.\ntype AnonymousIdentity struct{}\n\nvar _ Identity = (*AnonymousIdentity)(nil)\n\n// Expiration returns the zero value for time, as anonymous identity never\n// expires.\nfunc (*AnonymousIdentity) Expiration() time.Time {\n\treturn time.Time{}\n}\n\n// AnonymousIdentityResolver returns AnonymousIdentity.\ntype AnonymousIdentityResolver struct{}\n\nvar _ IdentityResolver = (*AnonymousIdentityResolver)(nil)\n\n// GetIdentity returns AnonymousIdentity.\nfunc (*AnonymousIdentityResolver) GetIdentity(_ context.Context, _ smithy.Properties) (Identity, error) {\n\treturn &AnonymousIdentity{}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/option.go",
    "content": "package auth\n\nimport \"github.com/aws/smithy-go\"\n\ntype (\n\tauthOptionsKey struct{}\n)\n\n// Option represents a possible authentication method for an operation.\ntype Option struct {\n\tSchemeID           string\n\tIdentityProperties smithy.Properties\n\tSignerProperties   smithy.Properties\n}\n\n// GetAuthOptions gets auth Options from Properties.\nfunc GetAuthOptions(p *smithy.Properties) ([]*Option, bool) {\n\tv, ok := p.Get(authOptionsKey{}).([]*Option)\n\treturn v, ok\n}\n\n// SetAuthOptions sets auth Options on Properties.\nfunc SetAuthOptions(p *smithy.Properties, options []*Option) {\n\tp.Set(authOptionsKey{}, options)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/auth/scheme_id.go",
    "content": "package auth\n\n// Anonymous\nconst (\n\tSchemeIDAnonymous = \"smithy.api#noAuth\"\n)\n\n// HTTP auth schemes\nconst (\n\tSchemeIDHTTPBasic  = \"smithy.api#httpBasicAuth\"\n\tSchemeIDHTTPDigest = \"smithy.api#httpDigestAuth\"\n\tSchemeIDHTTPBearer = \"smithy.api#httpBearerAuth\"\n\tSchemeIDHTTPAPIKey = \"smithy.api#httpApiKeyAuth\"\n)\n\n// AWS auth schemes\nconst (\n\tSchemeIDSigV4  = \"aws.auth#sigv4\"\n\tSchemeIDSigV4A = \"aws.auth#sigv4a\"\n)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/context/suppress_expired.go",
    "content": "package context\n\nimport \"context\"\n\n// valueOnlyContext provides a utility to preserve only the values of a\n// Context. Suppressing any cancellation or deadline on that context being\n// propagated downstream of this value.\n//\n// If preserveExpiredValues is false (default), and the valueCtx is canceled,\n// calls to lookup values with the Values method, will always return nil. Setting\n// preserveExpiredValues to true, will allow the valueOnlyContext to lookup\n// values in valueCtx even if valueCtx is canceled.\n//\n// Based on the Go standard libraries net/lookup.go onlyValuesCtx utility.\n// https://github.com/golang/go/blob/da2773fe3e2f6106634673a38dc3a6eb875fe7d8/src/net/lookup.go\ntype valueOnlyContext struct {\n\tcontext.Context\n\n\tpreserveExpiredValues bool\n\tvaluesCtx             context.Context\n}\n\nvar _ context.Context = (*valueOnlyContext)(nil)\n\n// Value looks up the key, returning its value. If configured to not preserve\n// values of expired context, and the wrapping context is canceled, nil will be\n// returned.\nfunc (v *valueOnlyContext) Value(key interface{}) interface{} {\n\tif !v.preserveExpiredValues {\n\t\tselect {\n\t\tcase <-v.valuesCtx.Done():\n\t\t\treturn nil\n\t\tdefault:\n\t\t}\n\t}\n\n\treturn v.valuesCtx.Value(key)\n}\n\n// WithSuppressCancel wraps the Context value, suppressing its deadline and\n// cancellation events being propagated downstream to consumer of the returned\n// context.\n//\n// By default the wrapped Context's Values are available downstream until the\n// wrapped Context is canceled. Once the wrapped Context is canceled, Values\n// method called on the context return will no longer lookup any key. As they\n// are now considered expired.\n//\n// To override this behavior, use WithPreserveExpiredValues on the Context\n// before it is wrapped by WithSuppressCancel. This will make the Context\n// returned by WithSuppressCancel allow lookup of expired values.\nfunc WithSuppressCancel(ctx context.Context) context.Context {\n\treturn &valueOnlyContext{\n\t\tContext:   context.Background(),\n\t\tvaluesCtx: ctx,\n\n\t\tpreserveExpiredValues: GetPreserveExpiredValues(ctx),\n\t}\n}\n\ntype preserveExpiredValuesKey struct{}\n\n// WithPreserveExpiredValues adds a Value to the Context if expired values\n// should be preserved, and looked up by a Context wrapped by\n// WithSuppressCancel.\n//\n// WithPreserveExpiredValues must be added as a value to a Context, before that\n// Context is wrapped by WithSuppressCancel\nfunc WithPreserveExpiredValues(ctx context.Context, enable bool) context.Context {\n\treturn context.WithValue(ctx, preserveExpiredValuesKey{}, enable)\n}\n\n// GetPreserveExpiredValues looks up, and returns the PreserveExpressValues\n// value in the context. Returning true if enabled, false otherwise.\nfunc GetPreserveExpiredValues(ctx context.Context) bool {\n\tv := ctx.Value(preserveExpiredValuesKey{})\n\tif v != nil {\n\t\treturn v.(bool)\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/doc.go",
    "content": "// Package smithy provides the core components for a Smithy SDK.\npackage smithy\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/document/doc.go",
    "content": "// Package document provides interface definitions and error types for document types.\n//\n// A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send\n// UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8\n// strings to these values.\n//\n// API Clients expose document constructors in their respective client document packages which must be used to\n// Marshal and Unmarshal Go types to and from their respective protocol representations.\n//\n// See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from\n// document types.\npackage document\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/document/document.go",
    "content": "package document\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\n// Marshaler is an interface for a type that marshals a document to its protocol-specific byte representation and\n// returns the resulting bytes. A non-nil error will be returned if an error is encountered during marshaling.\n//\n// Marshal supports basic scalars (int,uint,float,bool,string), big.Int, and big.Float, maps, slices, and structs.\n// Anonymous nested types are flattened based on Go anonymous type visibility.\n//\n// When defining struct types. the `document` struct tag can be used to control how the value will be\n// marshaled into the resulting protocol document.\n//\n//\t\t// Field is ignored\n//\t\tField int `document:\"-\"`\n//\n//\t\t// Field object of key \"myName\"\n//\t\tField int `document:\"myName\"`\n//\n//\t\t// Field object key of key \"myName\", and\n//\t\t// Field is omitted if the field is a zero value for the type.\n//\t\tField int `document:\"myName,omitempty\"`\n//\n//\t\t// Field object key of \"Field\", and\n//\t\t// Field is omitted if the field is a zero value for the type.\n//\t\tField int `document:\",omitempty\"`\n//\n// All struct fields, including anonymous fields, are marshaled unless the\n// any of the following conditions are meet.\n//\n//\t\t- the field is not exported\n//\t\t- document field tag is \"-\"\n//\t\t- document field tag specifies \"omitempty\", and is a zero value.\n//\n// Pointer and interface values are encoded as the value pointed to or\n// contained in the interface. A nil value encodes as a null\n// value unless `omitempty` struct tag is provided.\n//\n// Channel, complex, and function values are not encoded and will be skipped\n// when walking the value to be marshaled.\n//\n// time.Time is not supported and will cause the Marshaler to return an error. These values should be represented\n// by your application as a string or numerical representation.\n//\n// Errors that occur when marshaling will stop the marshaler, and return the error.\n//\n// Marshal cannot represent cyclic data structures and will not handle them.\n// Passing cyclic structures to Marshal will result in an infinite recursion.\ntype Marshaler interface {\n\tMarshalSmithyDocument() ([]byte, error)\n}\n\n// Unmarshaler is an interface for a type that unmarshals a document from its protocol-specific representation, and\n// stores the result into the value pointed by v. If v is nil or not a pointer then InvalidUnmarshalError will be\n// returned.\n//\n// Unmarshaler supports the same encodings produced by a document Marshaler. This includes support for the `document`\n// struct field tag for controlling how struct fields are unmarshaled.\n//\n// Both generic interface{} and concrete types are valid unmarshal destination types. When unmarshaling a document\n// into an empty interface the Unmarshaler will store one of these values:\n//   bool,                   for boolean values\n//   document.Number,        for arbitrary-precision numbers (int64, float64, big.Int, big.Float)\n//   string,                 for string values\n//   []interface{},          for array values\n//   map[string]interface{}, for objects\n//   nil,                    for null values\n//\n// When unmarshaling, any error that occurs will halt the unmarshal and return the error.\ntype Unmarshaler interface {\n\tUnmarshalSmithyDocument(v interface{}) error\n}\n\ntype noSerde interface {\n\tnoSmithyDocumentSerde()\n}\n\n// NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled\n// into a protocol document.\ntype NoSerde struct{}\n\nfunc (n NoSerde) noSmithyDocumentSerde() {}\n\nvar _ noSerde = (*NoSerde)(nil)\n\n// IsNoSerde returns whether the given type implements the no smithy document serde interface.\nfunc IsNoSerde(x interface{}) bool {\n\t_, ok := x.(noSerde)\n\treturn ok\n}\n\n// Number is an arbitrary precision numerical value\ntype Number string\n\n// Int64 returns the number as a string.\nfunc (n Number) String() string {\n\treturn string(n)\n}\n\n// Int64 returns the number as an int64.\nfunc (n Number) Int64() (int64, error) {\n\treturn n.intOfBitSize(64)\n}\n\nfunc (n Number) intOfBitSize(bitSize int) (int64, error) {\n\treturn strconv.ParseInt(string(n), 10, bitSize)\n}\n\n// Uint64 returns the number as a uint64.\nfunc (n Number) Uint64() (uint64, error) {\n\treturn n.uintOfBitSize(64)\n}\n\nfunc (n Number) uintOfBitSize(bitSize int) (uint64, error) {\n\treturn strconv.ParseUint(string(n), 10, bitSize)\n}\n\n// Float32 returns the number parsed as a 32-bit float, returns a float64.\nfunc (n Number) Float32() (float64, error) {\n\treturn n.floatOfBitSize(32)\n}\n\n// Float64 returns the number as a float64.\nfunc (n Number) Float64() (float64, error) {\n\treturn n.floatOfBitSize(64)\n}\n\n// Float64 returns the number as a float64.\nfunc (n Number) floatOfBitSize(bitSize int) (float64, error) {\n\treturn strconv.ParseFloat(string(n), bitSize)\n}\n\n// BigFloat attempts to convert the number to a big.Float, returns an error if the operation fails.\nfunc (n Number) BigFloat() (*big.Float, error) {\n\tf, ok := (&big.Float{}).SetString(string(n))\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"failed to convert to big.Float\")\n\t}\n\treturn f, nil\n}\n\n// BigInt attempts to convert the number to a big.Int, returns an error if the operation fails.\nfunc (n Number) BigInt() (*big.Int, error) {\n\tf, ok := (&big.Int{}).SetString(string(n), 10)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"failed to convert to big.Float\")\n\t}\n\treturn f, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/document/errors.go",
    "content": "package document\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\n// UnmarshalTypeError is an error type representing an error\n// unmarshaling a Smithy document to a Go value type. This is different\n// from UnmarshalError in that it does not wrap an underlying error type.\ntype UnmarshalTypeError struct {\n\tValue string\n\tType  reflect.Type\n}\n\n// Error returns the string representation of the error.\n// Satisfying the error interface.\nfunc (e *UnmarshalTypeError) Error() string {\n\treturn fmt.Sprintf(\"unmarshal failed, cannot unmarshal %s into Go value type %s\",\n\t\te.Value, e.Type.String())\n}\n\n// An InvalidUnmarshalError is an error type representing an invalid type\n// encountered while unmarshaling a Smithy document to a Go value type.\ntype InvalidUnmarshalError struct {\n\tType reflect.Type\n}\n\n// Error returns the string representation of the error.\n// Satisfying the error interface.\nfunc (e *InvalidUnmarshalError) Error() string {\n\tvar msg string\n\tif e.Type == nil {\n\t\tmsg = \"cannot unmarshal to nil value\"\n\t} else if e.Type.Kind() != reflect.Ptr {\n\t\tmsg = fmt.Sprintf(\"cannot unmarshal to non-pointer value, got %s\", e.Type.String())\n\t} else {\n\t\tmsg = fmt.Sprintf(\"cannot unmarshal to nil value, %s\", e.Type.String())\n\t}\n\n\treturn fmt.Sprintf(\"unmarshal failed, %s\", msg)\n}\n\n// An UnmarshalError wraps an error that occurred while unmarshaling a\n// Smithy document into a Go type. This is different from\n// UnmarshalTypeError in that it wraps the underlying error that occurred.\ntype UnmarshalError struct {\n\tErr   error\n\tValue string\n\tType  reflect.Type\n}\n\n// Unwrap returns the underlying unmarshaling error\nfunc (e *UnmarshalError) Unwrap() error {\n\treturn e.Err\n}\n\n// Error returns the string representation of the error.\n// Satisfying the error interface.\nfunc (e *UnmarshalError) Error() string {\n\treturn fmt.Sprintf(\"unmarshal failed, cannot unmarshal %q into %s, %v\",\n\t\te.Value, e.Type.String(), e.Err)\n}\n\n// An InvalidMarshalError is an error type representing an error\n// occurring when marshaling a Go value type.\ntype InvalidMarshalError struct {\n\tMessage string\n}\n\n// Error returns the string representation of the error.\n// Satisfying the error interface.\nfunc (e *InvalidMarshalError) Error() string {\n\treturn fmt.Sprintf(\"marshal failed, %s\", e.Message)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/document.go",
    "content": "package smithy\n\n// Document provides access to loosely structured data in a document-like\n// format.\n//\n// Deprecated: See the github.com/aws/smithy-go/document package.\ntype Document interface {\n\tUnmarshalDocument(interface{}) error\n\tGetValue() (interface{}, error)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/doc.go",
    "content": "// Package encoding provides utilities for encoding values for specific\n// document encodings.\n\npackage encoding\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/encoding.go",
    "content": "package encoding\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\n// EncodeFloat encodes a float value as per the stdlib encoder for json and xml protocol\n// This encodes a float value into dst while attempting to conform to ES6 ToString for Numbers\n//\n// Based on encoding/json floatEncoder from the Go Standard Library\n// https://golang.org/src/encoding/json/encode.go\nfunc EncodeFloat(dst []byte, v float64, bits int) []byte {\n\tif math.IsInf(v, 0) || math.IsNaN(v) {\n\t\tpanic(fmt.Sprintf(\"invalid float value: %s\", strconv.FormatFloat(v, 'g', -1, bits)))\n\t}\n\n\tabs := math.Abs(v)\n\tfmt := byte('f')\n\n\tif abs != 0 {\n\t\tif bits == 64 && (abs < 1e-6 || abs >= 1e21) || bits == 32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) {\n\t\t\tfmt = 'e'\n\t\t}\n\t}\n\n\tdst = strconv.AppendFloat(dst, v, fmt, -1, bits)\n\n\tif fmt == 'e' {\n\t\t// clean up e-09 to e-9\n\t\tn := len(dst)\n\t\tif n >= 4 && dst[n-4] == 'e' && dst[n-3] == '-' && dst[n-2] == '0' {\n\t\t\tdst[n-2] = dst[n-1]\n\t\t\tdst = dst[:n-1]\n\t\t}\n\t}\n\n\treturn dst\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go",
    "content": "package httpbinding\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tcontentLengthHeader = \"Content-Length\"\n\tfloatNaN            = \"NaN\"\n\tfloatInfinity       = \"Infinity\"\n\tfloatNegInfinity    = \"-Infinity\"\n)\n\n// An Encoder provides encoding of REST URI path, query, and header components\n// of an HTTP request. Can also encode a stream as the payload.\n//\n// Does not support SetFields.\ntype Encoder struct {\n\tpath, rawPath, pathBuffer []byte\n\n\tquery  url.Values\n\theader http.Header\n}\n\n// NewEncoder creates a new encoder from the passed in request. It assumes that\n// raw path contains no valuable information at this point, so it passes in path\n// as path and raw path for subsequent trans\nfunc NewEncoder(path, query string, headers http.Header) (*Encoder, error) {\n\treturn NewEncoderWithRawPath(path, path, query, headers)\n}\n\n// NewHTTPBindingEncoder creates a new encoder from the passed in request. All query and\n// header values will be added on top of the request's existing values. Overwriting\n// duplicate values.\nfunc NewEncoderWithRawPath(path, rawPath, query string, headers http.Header) (*Encoder, error) {\n\tparseQuery, err := url.ParseQuery(query)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse query string: %w\", err)\n\t}\n\n\te := &Encoder{\n\t\tpath:    []byte(path),\n\t\trawPath: []byte(rawPath),\n\t\tquery:   parseQuery,\n\t\theader:  headers.Clone(),\n\t}\n\n\treturn e, nil\n}\n\n// Encode returns a REST protocol encoder for encoding HTTP bindings.\n//\n// Due net/http requiring `Content-Length` to be specified on the http.Request#ContentLength directly. Encode\n// will look for whether the header is present, and if so will remove it and set the respective value on http.Request.\n//\n// Returns any error occurring during encoding.\nfunc (e *Encoder) Encode(req *http.Request) (*http.Request, error) {\n\treq.URL.Path, req.URL.RawPath = string(e.path), string(e.rawPath)\n\treq.URL.RawQuery = e.query.Encode()\n\n\t// net/http ignores Content-Length header and requires it to be set on http.Request\n\tif v := e.header.Get(contentLengthHeader); len(v) > 0 {\n\t\tiv, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treq.ContentLength = iv\n\t\te.header.Del(contentLengthHeader)\n\t}\n\n\treq.Header = e.header\n\n\treturn req, nil\n}\n\n// AddHeader returns a HeaderValue for appending to the given header name\nfunc (e *Encoder) AddHeader(key string) HeaderValue {\n\treturn newHeaderValue(e.header, key, true)\n}\n\n// SetHeader returns a HeaderValue for setting the given header name\nfunc (e *Encoder) SetHeader(key string) HeaderValue {\n\treturn newHeaderValue(e.header, key, false)\n}\n\n// Headers returns a Header used for encoding headers with the given prefix\nfunc (e *Encoder) Headers(prefix string) Headers {\n\treturn Headers{\n\t\theader: e.header,\n\t\tprefix: strings.TrimSpace(prefix),\n\t}\n}\n\n// HasHeader returns if a header with the key specified exists with one or\n// more value.\nfunc (e Encoder) HasHeader(key string) bool {\n\treturn len(e.header[key]) != 0\n}\n\n// SetURI returns a URIValue used for setting the given path key\nfunc (e *Encoder) SetURI(key string) URIValue {\n\treturn newURIValue(&e.path, &e.rawPath, &e.pathBuffer, key)\n}\n\n// SetQuery returns a QueryValue used for setting the given query key\nfunc (e *Encoder) SetQuery(key string) QueryValue {\n\treturn NewQueryValue(e.query, key, false)\n}\n\n// AddQuery returns a QueryValue used for appending the given query key\nfunc (e *Encoder) AddQuery(key string) QueryValue {\n\treturn NewQueryValue(e.query, key, true)\n}\n\n// HasQuery returns if a query with the key specified exists with one or\n// more values.\nfunc (e *Encoder) HasQuery(key string) bool {\n\treturn len(e.query.Get(key)) != 0\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go",
    "content": "package httpbinding\n\nimport (\n\t\"encoding/base64\"\n\t\"math\"\n\t\"math/big\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Headers is used to encode header keys using a provided prefix\ntype Headers struct {\n\theader http.Header\n\tprefix string\n}\n\n// AddHeader returns a HeaderValue used to append values to prefix+key\nfunc (h Headers) AddHeader(key string) HeaderValue {\n\treturn h.newHeaderValue(key, true)\n}\n\n// SetHeader returns a HeaderValue used to set the value of prefix+key\nfunc (h Headers) SetHeader(key string) HeaderValue {\n\treturn h.newHeaderValue(key, false)\n}\n\nfunc (h Headers) newHeaderValue(key string, append bool) HeaderValue {\n\treturn newHeaderValue(h.header, h.prefix+strings.TrimSpace(key), append)\n}\n\n// HeaderValue is used to encode values to an HTTP header\ntype HeaderValue struct {\n\theader http.Header\n\tkey    string\n\tappend bool\n}\n\nfunc newHeaderValue(header http.Header, key string, append bool) HeaderValue {\n\treturn HeaderValue{header: header, key: strings.TrimSpace(key), append: append}\n}\n\nfunc (h HeaderValue) modifyHeader(value string) {\n\tif h.append {\n\t\th.header[h.key] = append(h.header[h.key], value)\n\t} else {\n\t\th.header[h.key] = append(h.header[h.key][:0], value)\n\t}\n}\n\n// String encodes the value v as the header string value\nfunc (h HeaderValue) String(v string) {\n\th.modifyHeader(v)\n}\n\n// Byte encodes the value v as a query string value\nfunc (h HeaderValue) Byte(v int8) {\n\th.Long(int64(v))\n}\n\n// Short encodes the value v as a query string value\nfunc (h HeaderValue) Short(v int16) {\n\th.Long(int64(v))\n}\n\n// Integer encodes the value v as the header string value\nfunc (h HeaderValue) Integer(v int32) {\n\th.Long(int64(v))\n}\n\n// Long encodes the value v as the header string value\nfunc (h HeaderValue) Long(v int64) {\n\th.modifyHeader(strconv.FormatInt(v, 10))\n}\n\n// Boolean encodes the value v as a query string value\nfunc (h HeaderValue) Boolean(v bool) {\n\th.modifyHeader(strconv.FormatBool(v))\n}\n\n// Float encodes the value v as a query string value\nfunc (h HeaderValue) Float(v float32) {\n\th.float(float64(v), 32)\n}\n\n// Double encodes the value v as a query string value\nfunc (h HeaderValue) Double(v float64) {\n\th.float(v, 64)\n}\n\nfunc (h HeaderValue) float(v float64, bitSize int) {\n\tswitch {\n\tcase math.IsNaN(v):\n\t\th.String(floatNaN)\n\tcase math.IsInf(v, 1):\n\t\th.String(floatInfinity)\n\tcase math.IsInf(v, -1):\n\t\th.String(floatNegInfinity)\n\tdefault:\n\t\th.modifyHeader(strconv.FormatFloat(v, 'f', -1, bitSize))\n\t}\n}\n\n// BigInteger encodes the value v as a query string value\nfunc (h HeaderValue) BigInteger(v *big.Int) {\n\th.modifyHeader(v.String())\n}\n\n// BigDecimal encodes the value v as a query string value\nfunc (h HeaderValue) BigDecimal(v *big.Float) {\n\tif i, accuracy := v.Int64(); accuracy == big.Exact {\n\t\th.Long(i)\n\t\treturn\n\t}\n\th.modifyHeader(v.Text('e', -1))\n}\n\n// Blob encodes the value v as a base64 header string value\nfunc (h HeaderValue) Blob(v []byte) {\n\tencodeToString := base64.StdEncoding.EncodeToString(v)\n\th.modifyHeader(encodeToString)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go",
    "content": "package httpbinding\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\nconst (\n\turiTokenStart = '{'\n\turiTokenStop  = '}'\n\turiTokenSkip  = '+'\n)\n\nfunc bufCap(b []byte, n int) []byte {\n\tif cap(b) < n {\n\t\treturn make([]byte, 0, n)\n\t}\n\n\treturn b[0:0]\n}\n\n// replacePathElement replaces a single element in the path []byte.\n// Escape is used to control whether the value will be escaped using Amazon path escape style.\nfunc replacePathElement(path, fieldBuf []byte, key, val string, escape bool) ([]byte, []byte, error) {\n\tfieldBuf = bufCap(fieldBuf, len(key)+3) // { <key> [+] }\n\tfieldBuf = append(fieldBuf, uriTokenStart)\n\tfieldBuf = append(fieldBuf, key...)\n\n\tstart := bytes.Index(path, fieldBuf)\n\tend := start + len(fieldBuf)\n\tif start < 0 || len(path[end:]) == 0 {\n\t\t// TODO what to do about error?\n\t\treturn path, fieldBuf, fmt.Errorf(\"invalid path index, start=%d,end=%d. %s\", start, end, path)\n\t}\n\n\tencodeSep := true\n\tif path[end] == uriTokenSkip {\n\t\t// '+' token means do not escape slashes\n\t\tencodeSep = false\n\t\tend++\n\t}\n\n\tif escape {\n\t\tval = EscapePath(val, encodeSep)\n\t}\n\n\tif path[end] != uriTokenStop {\n\t\treturn path, fieldBuf, fmt.Errorf(\"invalid path element, does not contain token stop, %s\", path)\n\t}\n\tend++\n\n\tfieldBuf = bufCap(fieldBuf, len(val))\n\tfieldBuf = append(fieldBuf, val...)\n\n\tkeyLen := end - start\n\tvalLen := len(fieldBuf)\n\n\tif keyLen == valLen {\n\t\tcopy(path[start:], fieldBuf)\n\t\treturn path, fieldBuf, nil\n\t}\n\n\tnewLen := len(path) + (valLen - keyLen)\n\tif len(path) < newLen {\n\t\tpath = path[:cap(path)]\n\t}\n\tif cap(path) < newLen {\n\t\tnewURI := make([]byte, newLen)\n\t\tcopy(newURI, path)\n\t\tpath = newURI\n\t}\n\n\t// shift\n\tcopy(path[start+valLen:], path[end:])\n\tpath = path[:newLen]\n\tcopy(path[start:], fieldBuf)\n\n\treturn path, fieldBuf, nil\n}\n\n// EscapePath escapes part of a URL path in Amazon style.\nfunc EscapePath(path string, encodeSep bool) string {\n\tvar buf bytes.Buffer\n\tfor i := 0; i < len(path); i++ {\n\t\tc := path[i]\n\t\tif noEscape[c] || (c == '/' && !encodeSep) {\n\t\t\tbuf.WriteByte(c)\n\t\t} else {\n\t\t\tfmt.Fprintf(&buf, \"%%%02X\", c)\n\t\t}\n\t}\n\treturn buf.String()\n}\n\nvar noEscape [256]bool\n\nfunc init() {\n\tfor i := 0; i < len(noEscape); i++ {\n\t\t// AWS expects every character except these to be escaped\n\t\tnoEscape[i] = (i >= 'A' && i <= 'Z') ||\n\t\t\t(i >= 'a' && i <= 'z') ||\n\t\t\t(i >= '0' && i <= '9') ||\n\t\t\ti == '-' ||\n\t\t\ti == '.' ||\n\t\t\ti == '_' ||\n\t\t\ti == '~'\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go",
    "content": "package httpbinding\n\nimport (\n\t\"encoding/base64\"\n\t\"math\"\n\t\"math/big\"\n\t\"net/url\"\n\t\"strconv\"\n)\n\n// QueryValue is used to encode query key values\ntype QueryValue struct {\n\tquery  url.Values\n\tkey    string\n\tappend bool\n}\n\n// NewQueryValue creates a new QueryValue which enables encoding\n// a query value into the given url.Values.\nfunc NewQueryValue(query url.Values, key string, append bool) QueryValue {\n\treturn QueryValue{\n\t\tquery:  query,\n\t\tkey:    key,\n\t\tappend: append,\n\t}\n}\n\nfunc (qv QueryValue) updateKey(value string) {\n\tif qv.append {\n\t\tqv.query.Add(qv.key, value)\n\t} else {\n\t\tqv.query.Set(qv.key, value)\n\t}\n}\n\n// Blob encodes v as a base64 query string value\nfunc (qv QueryValue) Blob(v []byte) {\n\tencodeToString := base64.StdEncoding.EncodeToString(v)\n\tqv.updateKey(encodeToString)\n}\n\n// Boolean encodes v as a query string value\nfunc (qv QueryValue) Boolean(v bool) {\n\tqv.updateKey(strconv.FormatBool(v))\n}\n\n// String encodes v as a query string value\nfunc (qv QueryValue) String(v string) {\n\tqv.updateKey(v)\n}\n\n// Byte encodes v as a query string value\nfunc (qv QueryValue) Byte(v int8) {\n\tqv.Long(int64(v))\n}\n\n// Short encodes v as a query string value\nfunc (qv QueryValue) Short(v int16) {\n\tqv.Long(int64(v))\n}\n\n// Integer encodes v as a query string value\nfunc (qv QueryValue) Integer(v int32) {\n\tqv.Long(int64(v))\n}\n\n// Long encodes v as a query string value\nfunc (qv QueryValue) Long(v int64) {\n\tqv.updateKey(strconv.FormatInt(v, 10))\n}\n\n// Float encodes v as a query string value\nfunc (qv QueryValue) Float(v float32) {\n\tqv.float(float64(v), 32)\n}\n\n// Double encodes v as a query string value\nfunc (qv QueryValue) Double(v float64) {\n\tqv.float(v, 64)\n}\n\nfunc (qv QueryValue) float(v float64, bitSize int) {\n\tswitch {\n\tcase math.IsNaN(v):\n\t\tqv.String(floatNaN)\n\tcase math.IsInf(v, 1):\n\t\tqv.String(floatInfinity)\n\tcase math.IsInf(v, -1):\n\t\tqv.String(floatNegInfinity)\n\tdefault:\n\t\tqv.updateKey(strconv.FormatFloat(v, 'f', -1, bitSize))\n\t}\n}\n\n// BigInteger encodes v as a query string value\nfunc (qv QueryValue) BigInteger(v *big.Int) {\n\tqv.updateKey(v.String())\n}\n\n// BigDecimal encodes v as a query string value\nfunc (qv QueryValue) BigDecimal(v *big.Float) {\n\tif i, accuracy := v.Int64(); accuracy == big.Exact {\n\t\tqv.Long(i)\n\t\treturn\n\t}\n\tqv.updateKey(v.Text('e', -1))\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go",
    "content": "package httpbinding\n\nimport (\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// URIValue is used to encode named URI parameters\ntype URIValue struct {\n\tpath, rawPath, buffer *[]byte\n\n\tkey string\n}\n\nfunc newURIValue(path *[]byte, rawPath *[]byte, buffer *[]byte, key string) URIValue {\n\treturn URIValue{path: path, rawPath: rawPath, buffer: buffer, key: key}\n}\n\nfunc (u URIValue) modifyURI(value string) (err error) {\n\t*u.path, *u.buffer, err = replacePathElement(*u.path, *u.buffer, u.key, value, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*u.rawPath, *u.buffer, err = replacePathElement(*u.rawPath, *u.buffer, u.key, value, true)\n\treturn err\n}\n\n// Boolean encodes v as a URI string value\nfunc (u URIValue) Boolean(v bool) error {\n\treturn u.modifyURI(strconv.FormatBool(v))\n}\n\n// String encodes v as a URI string value\nfunc (u URIValue) String(v string) error {\n\treturn u.modifyURI(v)\n}\n\n// Byte encodes v as a URI string value\nfunc (u URIValue) Byte(v int8) error {\n\treturn u.Long(int64(v))\n}\n\n// Short encodes v as a URI string value\nfunc (u URIValue) Short(v int16) error {\n\treturn u.Long(int64(v))\n}\n\n// Integer encodes v as a URI string value\nfunc (u URIValue) Integer(v int32) error {\n\treturn u.Long(int64(v))\n}\n\n// Long encodes v as a URI string value\nfunc (u URIValue) Long(v int64) error {\n\treturn u.modifyURI(strconv.FormatInt(v, 10))\n}\n\n// Float encodes v as a query string value\nfunc (u URIValue) Float(v float32) error {\n\treturn u.float(float64(v), 32)\n}\n\n// Double encodes v as a query string value\nfunc (u URIValue) Double(v float64) error {\n\treturn u.float(v, 64)\n}\n\nfunc (u URIValue) float(v float64, bitSize int) error {\n\tswitch {\n\tcase math.IsNaN(v):\n\t\treturn u.String(floatNaN)\n\tcase math.IsInf(v, 1):\n\t\treturn u.String(floatInfinity)\n\tcase math.IsInf(v, -1):\n\t\treturn u.String(floatNegInfinity)\n\tdefault:\n\t\treturn u.modifyURI(strconv.FormatFloat(v, 'f', -1, bitSize))\n\t}\n}\n\n// BigInteger encodes v as a query string value\nfunc (u URIValue) BigInteger(v *big.Int) error {\n\treturn u.modifyURI(v.String())\n}\n\n// BigDecimal encodes v as a query string value\nfunc (u URIValue) BigDecimal(v *big.Float) error {\n\tif i, accuracy := v.Int64(); accuracy == big.Exact {\n\t\treturn u.Long(i)\n\t}\n\treturn u.modifyURI(v.Text('e', -1))\n}\n\n// SplitURI parses a Smithy HTTP binding trait URI\nfunc SplitURI(uri string) (path, query string) {\n\tqueryStart := strings.IndexRune(uri, '?')\n\tif queryStart == -1 {\n\t\tpath = uri\n\t\treturn path, query\n\t}\n\n\tpath = uri[:queryStart]\n\tif queryStart+1 >= len(uri) {\n\t\treturn path, query\n\t}\n\tquery = uri[queryStart+1:]\n\n\treturn path, query\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/array.go",
    "content": "package json\n\nimport (\n\t\"bytes\"\n)\n\n// Array represents the encoding of a JSON Array\ntype Array struct {\n\tw          *bytes.Buffer\n\twriteComma bool\n\tscratch    *[]byte\n}\n\nfunc newArray(w *bytes.Buffer, scratch *[]byte) *Array {\n\tw.WriteRune(leftBracket)\n\treturn &Array{w: w, scratch: scratch}\n}\n\n// Value adds a new element to the JSON Array.\n// Returns a Value type that is used to encode\n// the array element.\nfunc (a *Array) Value() Value {\n\tif a.writeComma {\n\t\ta.w.WriteRune(comma)\n\t} else {\n\t\ta.writeComma = true\n\t}\n\n\treturn newValue(a.w, a.scratch)\n}\n\n// Close encodes the end of the JSON Array\nfunc (a *Array) Close() {\n\ta.w.WriteRune(rightBracket)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/constants.go",
    "content": "package json\n\nconst (\n\tleftBrace  = '{'\n\trightBrace = '}'\n\n\tleftBracket  = '['\n\trightBracket = ']'\n\n\tcomma = ','\n\tquote = '\"'\n\tcolon = ':'\n\n\tnull = \"null\"\n)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go",
    "content": "package json\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// DiscardUnknownField discards unknown fields from a decoder body.\n// This function is useful while deserializing a JSON body with additional\n// unknown information that should be discarded.\nfunc DiscardUnknownField(decoder *json.Decoder) error {\n\t// This deliberately does not share logic with CollectUnknownField, even\n\t// though it could, because if we were to delegate to that then we'd incur\n\t// extra allocations and general memory usage.\n\tv, err := decoder.Token()\n\tif err == io.EOF {\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, ok := v.(json.Delim); ok {\n\t\tfor decoder.More() {\n\t\t\terr = DiscardUnknownField(decoder)\n\t\t}\n\t\tendToken, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, ok := endToken.(json.Delim); !ok {\n\t\t\treturn fmt.Errorf(\"invalid JSON : expected json delimiter, found %T %v\",\n\t\t\t\tendToken, endToken)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// CollectUnknownField grabs the contents of unknown fields from the decoder body\n// and returns them as a byte slice. This is useful for skipping unknown fields without\n// completely discarding them.\nfunc CollectUnknownField(decoder *json.Decoder) ([]byte, error) {\n\tresult, err := collectUnknownField(decoder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuff := bytes.NewBuffer(nil)\n\tencoder := json.NewEncoder(buff)\n\n\tif err := encoder.Encode(result); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn buff.Bytes(), nil\n}\n\nfunc collectUnknownField(decoder *json.Decoder) (interface{}, error) {\n\t// Grab the initial value. This could either be a concrete value like a string or a a\n\t// delimiter.\n\ttoken, err := decoder.Token()\n\tif err == io.EOF {\n\t\treturn nil, nil\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If it's an array or object, we'll need to recurse.\n\tdelim, ok := token.(json.Delim)\n\tif ok {\n\t\tvar result interface{}\n\t\tif delim == '{' {\n\t\t\tresult, err = collectUnknownObject(decoder)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tresult, err = collectUnknownArray(decoder)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\t// Discard the closing token. decoder.Token handles checking for matching delimiters\n\t\tif _, err := decoder.Token(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\t}\n\n\treturn token, nil\n}\n\nfunc collectUnknownArray(decoder *json.Decoder) ([]interface{}, error) {\n\t// We need to create an empty array here instead of a nil array, since by getting\n\t// into this function at all we necessarily have seen a non-nil list.\n\tarray := []interface{}{}\n\n\tfor decoder.More() {\n\t\tvalue, err := collectUnknownField(decoder)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tarray = append(array, value)\n\t}\n\n\treturn array, nil\n}\n\nfunc collectUnknownObject(decoder *json.Decoder) (map[string]interface{}, error) {\n\tobject := make(map[string]interface{})\n\n\tfor decoder.More() {\n\t\tkey, err := collectUnknownField(decoder)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Keys have to be strings, which is particularly important as the encoder\n\t\t// won't except a map with interface{} keys\n\t\tstringKey, ok := key.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"expected string key, found %T\", key)\n\t\t}\n\n\t\tvalue, err := collectUnknownField(decoder)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tobject[stringKey] = value\n\t}\n\n\treturn object, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/encoder.go",
    "content": "package json\n\nimport (\n\t\"bytes\"\n)\n\n// Encoder is JSON encoder that supports construction of JSON values\n// using methods.\ntype Encoder struct {\n\tw *bytes.Buffer\n\tValue\n}\n\n// NewEncoder returns a new JSON encoder\nfunc NewEncoder() *Encoder {\n\twriter := bytes.NewBuffer(nil)\n\tscratch := make([]byte, 64)\n\n\treturn &Encoder{w: writer, Value: newValue(writer, &scratch)}\n}\n\n// String returns the String output of the JSON encoder\nfunc (e Encoder) String() string {\n\treturn e.w.String()\n}\n\n// Bytes returns the []byte slice of the JSON encoder\nfunc (e Encoder) Bytes() []byte {\n\treturn e.w.Bytes()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/escape.go",
    "content": "// Copyright 2016 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Copied and modified from Go 1.8 stdlib's encoding/json/#safeSet\n\npackage json\n\nimport (\n\t\"bytes\"\n\t\"unicode/utf8\"\n)\n\n// safeSet holds the value true if the ASCII character with the given array\n// position can be represented inside a JSON string without any further\n// escaping.\n//\n// All values are true except for the ASCII control characters (0-31), the\n// double quote (\"), and the backslash character (\"\\\").\nvar safeSet = [utf8.RuneSelf]bool{\n\t' ':      true,\n\t'!':      true,\n\t'\"':      false,\n\t'#':      true,\n\t'$':      true,\n\t'%':      true,\n\t'&':      true,\n\t'\\'':     true,\n\t'(':      true,\n\t')':      true,\n\t'*':      true,\n\t'+':      true,\n\t',':      true,\n\t'-':      true,\n\t'.':      true,\n\t'/':      true,\n\t'0':      true,\n\t'1':      true,\n\t'2':      true,\n\t'3':      true,\n\t'4':      true,\n\t'5':      true,\n\t'6':      true,\n\t'7':      true,\n\t'8':      true,\n\t'9':      true,\n\t':':      true,\n\t';':      true,\n\t'<':      true,\n\t'=':      true,\n\t'>':      true,\n\t'?':      true,\n\t'@':      true,\n\t'A':      true,\n\t'B':      true,\n\t'C':      true,\n\t'D':      true,\n\t'E':      true,\n\t'F':      true,\n\t'G':      true,\n\t'H':      true,\n\t'I':      true,\n\t'J':      true,\n\t'K':      true,\n\t'L':      true,\n\t'M':      true,\n\t'N':      true,\n\t'O':      true,\n\t'P':      true,\n\t'Q':      true,\n\t'R':      true,\n\t'S':      true,\n\t'T':      true,\n\t'U':      true,\n\t'V':      true,\n\t'W':      true,\n\t'X':      true,\n\t'Y':      true,\n\t'Z':      true,\n\t'[':      true,\n\t'\\\\':     false,\n\t']':      true,\n\t'^':      true,\n\t'_':      true,\n\t'`':      true,\n\t'a':      true,\n\t'b':      true,\n\t'c':      true,\n\t'd':      true,\n\t'e':      true,\n\t'f':      true,\n\t'g':      true,\n\t'h':      true,\n\t'i':      true,\n\t'j':      true,\n\t'k':      true,\n\t'l':      true,\n\t'm':      true,\n\t'n':      true,\n\t'o':      true,\n\t'p':      true,\n\t'q':      true,\n\t'r':      true,\n\t's':      true,\n\t't':      true,\n\t'u':      true,\n\t'v':      true,\n\t'w':      true,\n\t'x':      true,\n\t'y':      true,\n\t'z':      true,\n\t'{':      true,\n\t'|':      true,\n\t'}':      true,\n\t'~':      true,\n\t'\\u007f': true,\n}\n\n// copied from Go 1.8 stdlib's encoding/json/#hex\nvar hex = \"0123456789abcdef\"\n\n// escapeStringBytes escapes and writes the passed in string bytes to the dst\n// buffer\n//\n// Copied and modifed from Go 1.8 stdlib's encodeing/json/#encodeState.stringBytes\nfunc escapeStringBytes(e *bytes.Buffer, s []byte) {\n\te.WriteByte('\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\tif safeSet[b] {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif start < i {\n\t\t\t\te.Write(s[start:i])\n\t\t\t}\n\t\t\tswitch b {\n\t\t\tcase '\\\\', '\"':\n\t\t\t\te.WriteByte('\\\\')\n\t\t\t\te.WriteByte(b)\n\t\t\tcase '\\n':\n\t\t\t\te.WriteByte('\\\\')\n\t\t\t\te.WriteByte('n')\n\t\t\tcase '\\r':\n\t\t\t\te.WriteByte('\\\\')\n\t\t\t\te.WriteByte('r')\n\t\t\tcase '\\t':\n\t\t\t\te.WriteByte('\\\\')\n\t\t\t\te.WriteByte('t')\n\t\t\tdefault:\n\t\t\t\t// This encodes bytes < 0x20 except for \\t, \\n and \\r.\n\t\t\t\t// If escapeHTML is set, it also escapes <, >, and &\n\t\t\t\t// because they can lead to security holes when\n\t\t\t\t// user-controlled strings are rendered into JSON\n\t\t\t\t// and served to some browsers.\n\t\t\t\te.WriteString(`\\u00`)\n\t\t\t\te.WriteByte(hex[b>>4])\n\t\t\t\te.WriteByte(hex[b&0xF])\n\t\t\t}\n\t\t\ti++\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\tc, size := utf8.DecodeRune(s[i:])\n\t\tif c == utf8.RuneError && size == 1 {\n\t\t\tif start < i {\n\t\t\t\te.Write(s[start:i])\n\t\t\t}\n\t\t\te.WriteString(`\\ufffd`)\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\t// U+2028 is LINE SEPARATOR.\n\t\t// U+2029 is PARAGRAPH SEPARATOR.\n\t\t// They are both technically valid characters in JSON strings,\n\t\t// but don't work in JSONP, which has to be evaluated as JavaScript,\n\t\t// and can lead to security holes there. It is valid JSON to\n\t\t// escape them, so we do so unconditionally.\n\t\t// See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion.\n\t\tif c == '\\u2028' || c == '\\u2029' {\n\t\t\tif start < i {\n\t\t\t\te.Write(s[start:i])\n\t\t\t}\n\t\t\te.WriteString(`\\u202`)\n\t\t\te.WriteByte(hex[c&0xF])\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\ti += size\n\t}\n\tif start < len(s) {\n\t\te.Write(s[start:])\n\t}\n\te.WriteByte('\"')\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/object.go",
    "content": "package json\n\nimport (\n\t\"bytes\"\n)\n\n// Object represents the encoding of a JSON Object type\ntype Object struct {\n\tw          *bytes.Buffer\n\twriteComma bool\n\tscratch    *[]byte\n}\n\nfunc newObject(w *bytes.Buffer, scratch *[]byte) *Object {\n\tw.WriteRune(leftBrace)\n\treturn &Object{w: w, scratch: scratch}\n}\n\nfunc (o *Object) writeKey(key string) {\n\tescapeStringBytes(o.w, []byte(key))\n\to.w.WriteRune(colon)\n}\n\n// Key adds the given named key to the JSON object.\n// Returns a Value encoder that should be used to encode\n// a JSON value type.\nfunc (o *Object) Key(name string) Value {\n\tif o.writeComma {\n\t\to.w.WriteRune(comma)\n\t} else {\n\t\to.writeComma = true\n\t}\n\to.writeKey(name)\n\treturn newValue(o.w, o.scratch)\n}\n\n// Close encodes the end of the JSON Object\nfunc (o *Object) Close() {\n\to.w.WriteRune(rightBrace)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/json/value.go",
    "content": "package json\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"math/big\"\n\t\"strconv\"\n\n\t\"github.com/aws/smithy-go/encoding\"\n)\n\n// Value represents a JSON Value type\n// JSON Value types: Object, Array, String, Number, Boolean, and Null\ntype Value struct {\n\tw       *bytes.Buffer\n\tscratch *[]byte\n}\n\n// newValue returns a new Value encoder\nfunc newValue(w *bytes.Buffer, scratch *[]byte) Value {\n\treturn Value{w: w, scratch: scratch}\n}\n\n// String encodes v as a JSON string\nfunc (jv Value) String(v string) {\n\tescapeStringBytes(jv.w, []byte(v))\n}\n\n// Byte encodes v as a JSON number\nfunc (jv Value) Byte(v int8) {\n\tjv.Long(int64(v))\n}\n\n// Short encodes v as a JSON number\nfunc (jv Value) Short(v int16) {\n\tjv.Long(int64(v))\n}\n\n// Integer encodes v as a JSON number\nfunc (jv Value) Integer(v int32) {\n\tjv.Long(int64(v))\n}\n\n// Long encodes v as a JSON number\nfunc (jv Value) Long(v int64) {\n\t*jv.scratch = strconv.AppendInt((*jv.scratch)[:0], v, 10)\n\tjv.w.Write(*jv.scratch)\n}\n\n// ULong encodes v as a JSON number\nfunc (jv Value) ULong(v uint64) {\n\t*jv.scratch = strconv.AppendUint((*jv.scratch)[:0], v, 10)\n\tjv.w.Write(*jv.scratch)\n}\n\n// Float encodes v as a JSON number\nfunc (jv Value) Float(v float32) {\n\tjv.float(float64(v), 32)\n}\n\n// Double encodes v as a JSON number\nfunc (jv Value) Double(v float64) {\n\tjv.float(v, 64)\n}\n\nfunc (jv Value) float(v float64, bits int) {\n\t*jv.scratch = encoding.EncodeFloat((*jv.scratch)[:0], v, bits)\n\tjv.w.Write(*jv.scratch)\n}\n\n// Boolean encodes v as a JSON boolean\nfunc (jv Value) Boolean(v bool) {\n\t*jv.scratch = strconv.AppendBool((*jv.scratch)[:0], v)\n\tjv.w.Write(*jv.scratch)\n}\n\n// Base64EncodeBytes writes v as a base64 value in JSON string\nfunc (jv Value) Base64EncodeBytes(v []byte) {\n\tencodeByteSlice(jv.w, (*jv.scratch)[:0], v)\n}\n\n// Write writes v directly to the JSON document\nfunc (jv Value) Write(v []byte) {\n\tjv.w.Write(v)\n}\n\n// Array returns a new Array encoder\nfunc (jv Value) Array() *Array {\n\treturn newArray(jv.w, jv.scratch)\n}\n\n// Object returns a new Object encoder\nfunc (jv Value) Object() *Object {\n\treturn newObject(jv.w, jv.scratch)\n}\n\n// Null encodes a null JSON value\nfunc (jv Value) Null() {\n\tjv.w.WriteString(null)\n}\n\n// BigInteger encodes v as JSON value\nfunc (jv Value) BigInteger(v *big.Int) {\n\tjv.w.Write([]byte(v.Text(10)))\n}\n\n// BigDecimal encodes v as JSON value\nfunc (jv Value) BigDecimal(v *big.Float) {\n\tif i, accuracy := v.Int64(); accuracy == big.Exact {\n\t\tjv.Long(i)\n\t\treturn\n\t}\n\t// TODO: Should this try to match ES6 ToString similar to stdlib JSON?\n\tjv.w.Write([]byte(v.Text('e', -1)))\n}\n\n// Based on encoding/json encodeByteSlice from the Go Standard Library\n// https://golang.org/src/encoding/json/encode.go\nfunc encodeByteSlice(w *bytes.Buffer, scratch []byte, v []byte) {\n\tif v == nil {\n\t\tw.WriteString(null)\n\t\treturn\n\t}\n\n\tw.WriteRune(quote)\n\n\tencodedLen := base64.StdEncoding.EncodedLen(len(v))\n\tif encodedLen <= len(scratch) {\n\t\t// If the encoded bytes fit in e.scratch, avoid an extra\n\t\t// allocation and use the cheaper Encoding.Encode.\n\t\tdst := scratch[:encodedLen]\n\t\tbase64.StdEncoding.Encode(dst, v)\n\t\tw.Write(dst)\n\t} else if encodedLen <= 1024 {\n\t\t// The encoded bytes are short enough to allocate for, and\n\t\t// Encoding.Encode is still cheaper.\n\t\tdst := make([]byte, encodedLen)\n\t\tbase64.StdEncoding.Encode(dst, v)\n\t\tw.Write(dst)\n\t} else {\n\t\t// The encoded bytes are too long to cheaply allocate, and\n\t\t// Encoding.Encode is no longer noticeably cheaper.\n\t\tenc := base64.NewEncoder(base64.StdEncoding, w)\n\t\tenc.Write(v)\n\t\tenc.Close()\n\t}\n\n\tw.WriteRune(quote)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/array.go",
    "content": "package xml\n\n// arrayMemberWrapper is the default member wrapper tag name for XML Array type\nvar arrayMemberWrapper = StartElement{\n\tName: Name{Local: \"member\"},\n}\n\n// Array represents the encoding of a XML array type\ntype Array struct {\n\tw       writer\n\tscratch *[]byte\n\n\t// member start element is the array member wrapper start element\n\tmemberStartElement StartElement\n\n\t// isFlattened indicates if the array is a flattened array.\n\tisFlattened bool\n}\n\n// newArray returns an array encoder.\n// It also takes in the  member start element, array start element.\n// It takes in a isFlattened bool, indicating that an array is flattened array.\n//\n// A wrapped array [\"value1\", \"value2\"] is represented as\n// `<List><member>value1</member><member>value2</member></List>`.\n\n// A flattened array `someList: [\"value1\", \"value2\"]` is represented as\n// `<someList>value1</someList><someList>value2</someList>`.\nfunc newArray(w writer, scratch *[]byte, memberStartElement StartElement, arrayStartElement StartElement, isFlattened bool) *Array {\n\tvar memberWrapper = memberStartElement\n\tif isFlattened {\n\t\tmemberWrapper = arrayStartElement\n\t}\n\n\treturn &Array{\n\t\tw:                  w,\n\t\tscratch:            scratch,\n\t\tmemberStartElement: memberWrapper,\n\t\tisFlattened:        isFlattened,\n\t}\n}\n\n// Member adds a new member to the XML array.\n// It returns a Value encoder.\nfunc (a *Array) Member() Value {\n\tv := newValue(a.w, a.scratch, a.memberStartElement)\n\tv.isFlattened = a.isFlattened\n\treturn v\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/constants.go",
    "content": "package xml\n\nconst (\n\tleftAngleBracket  = '<'\n\trightAngleBracket = '>'\n\tforwardSlash      = '/'\n\tcolon             = ':'\n\tequals            = '='\n\tquote             = '\"'\n)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/doc.go",
    "content": "/*\nPackage xml holds the XMl encoder utility. This utility is written in accordance to our design to delegate to\nshape serializer function in which a xml.Value will be passed around.\n\nResources followed: https://smithy.io/2.0/spec/protocol-traits.html#xml-bindings\n\nMember Element\n\nMember element should be used to encode xml shapes into xml elements except for flattened xml shapes. Member element\nwrite their own element start tag. These elements should always be closed.\n\nFlattened Element\n\nFlattened element should be used to encode shapes marked with flattened trait into xml elements. Flattened element\ndo not write a start tag, and thus should not be closed.\n\nSimple types encoding\n\nAll simple type methods on value such as String(), Long() etc; auto close the associated member element.\n\nArray\n\nArray returns the collection encoder. It has two modes, wrapped and flattened encoding.\n\nWrapped arrays have two methods Array() and ArrayWithCustomName() which facilitate array member wrapping.\nBy default, a wrapped array members are wrapped with `member` named start element.\n\n\t<wrappedArray><member>apple</member><member>tree</member></wrappedArray>\n\nFlattened arrays rely on Value being marked as flattened.\nIf a shape is marked as flattened, Array() will use the shape element name as wrapper for array elements.\n\n\t<flattenedAarray>apple</flattenedArray><flattenedArray>tree</flattenedArray>\n\nMap\n\nMap is the map encoder. It has two modes, wrapped and flattened encoding.\n\nWrapped map has Array() method, which facilitate map member wrapping.\nBy default, a wrapped map members are wrapped with `entry` named start element.\n\n\t<wrappedMap><entry><Key>apple</Key><Value>tree</Value></entry><entry><Key>snow</Key><Value>ice</Value></entry></wrappedMap>\n\nFlattened map rely on Value being marked as flattened.\nIf a shape is marked as flattened, Map() will use the shape element name as wrapper for map entry elements.\n\n\t<flattenedMap><Key>apple</Key><Value>tree</Value></flattenedMap><flattenedMap><Key>snow</Key><Value>ice</Value></flattenedMap>\n*/\npackage xml\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/element.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Copied and modified from Go 1.14 stdlib's encoding/xml\n\npackage xml\n\n// A Name represents an XML name (Local) annotated\n// with a name space identifier (Space).\n// In tokens returned by Decoder.Token, the Space identifier\n// is given as a canonical URL, not the short prefix used\n// in the document being parsed.\ntype Name struct {\n\tSpace, Local string\n}\n\n// An Attr represents an attribute in an XML element (Name=Value).\ntype Attr struct {\n\tName  Name\n\tValue string\n}\n\n/*\nNewAttribute returns a pointer to an attribute.\nIt takes in a local name aka attribute name, and value\nrepresenting the attribute value.\n*/\nfunc NewAttribute(local, value string) Attr {\n\treturn Attr{\n\t\tName: Name{\n\t\t\tLocal: local,\n\t\t},\n\t\tValue: value,\n\t}\n}\n\n/*\nNewNamespaceAttribute returns a pointer to an attribute.\nIt takes in a local name aka attribute name, and value\nrepresenting the attribute value.\n\nNewNamespaceAttribute appends `xmlns:` in front of namespace\nprefix.\n\nFor creating a name space attribute representing\n`xmlns:prefix=\"http://example.com`, the breakdown would be:\nlocal = \"prefix\"\nvalue = \"http://example.com\"\n*/\nfunc NewNamespaceAttribute(local, value string) Attr {\n\tattr := NewAttribute(local, value)\n\n\t// default name space identifier\n\tattr.Name.Space = \"xmlns\"\n\treturn attr\n}\n\n// A StartElement represents an XML start element.\ntype StartElement struct {\n\tName Name\n\tAttr []Attr\n}\n\n// Copy creates a new copy of StartElement.\nfunc (e StartElement) Copy() StartElement {\n\tattrs := make([]Attr, len(e.Attr))\n\tcopy(attrs, e.Attr)\n\te.Attr = attrs\n\treturn e\n}\n\n// End returns the corresponding XML end element.\nfunc (e StartElement) End() EndElement {\n\treturn EndElement{e.Name}\n}\n\n// returns true if start element local name is empty\nfunc (e StartElement) isZero() bool {\n\treturn len(e.Name.Local) == 0\n}\n\n// An EndElement represents an XML end element.\ntype EndElement struct {\n\tName Name\n}\n\n// returns true if end element local name is empty\nfunc (e EndElement) isZero() bool {\n\treturn len(e.Name.Local) == 0\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/encoder.go",
    "content": "package xml\n\n// writer interface used by the xml encoder to write an encoded xml\n// document in a writer.\ntype writer interface {\n\n\t// Write takes in a byte slice and returns number of bytes written and error\n\tWrite(p []byte) (n int, err error)\n\n\t// WriteRune takes in a rune and returns number of bytes written and error\n\tWriteRune(r rune) (n int, err error)\n\n\t// WriteString takes in a string and returns number of bytes written and error\n\tWriteString(s string) (n int, err error)\n\n\t// String method returns a string\n\tString() string\n\n\t// Bytes return a byte slice.\n\tBytes() []byte\n}\n\n// Encoder is an XML encoder that supports construction of XML values\n// using methods. The encoder takes in a writer and maintains a scratch buffer.\ntype Encoder struct {\n\tw       writer\n\tscratch *[]byte\n}\n\n// NewEncoder returns an XML encoder\nfunc NewEncoder(w writer) *Encoder {\n\tscratch := make([]byte, 64)\n\n\treturn &Encoder{w: w, scratch: &scratch}\n}\n\n// String returns the string output of the XML encoder\nfunc (e Encoder) String() string {\n\treturn e.w.String()\n}\n\n// Bytes returns the []byte slice of the XML encoder\nfunc (e Encoder) Bytes() []byte {\n\treturn e.w.Bytes()\n}\n\n// RootElement builds a root element encoding\n// It writes it's start element tag. The value should be closed.\nfunc (e Encoder) RootElement(element StartElement) Value {\n\treturn newValue(e.w, e.scratch, element)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/error_utils.go",
    "content": "package xml\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// ErrorComponents represents the error response fields\n// that will be deserialized from an xml error response body\ntype ErrorComponents struct {\n\tCode    string\n\tMessage string\n}\n\n// GetErrorResponseComponents returns the error fields from an xml error response body\nfunc GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error) {\n\tif noErrorWrapping {\n\t\tvar errResponse noWrappedErrorResponse\n\t\tif err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF {\n\t\t\treturn ErrorComponents{}, fmt.Errorf(\"error while deserializing xml error response: %w\", err)\n\t\t}\n\t\treturn ErrorComponents{\n\t\t\tCode:    errResponse.Code,\n\t\t\tMessage: errResponse.Message,\n\t\t}, nil\n\t}\n\n\tvar errResponse wrappedErrorResponse\n\tif err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF {\n\t\treturn ErrorComponents{}, fmt.Errorf(\"error while deserializing xml error response: %w\", err)\n\t}\n\treturn ErrorComponents{\n\t\tCode:    errResponse.Code,\n\t\tMessage: errResponse.Message,\n\t}, nil\n}\n\n// noWrappedErrorResponse represents the error response body with\n// no internal <Error></Error wrapping\ntype noWrappedErrorResponse struct {\n\tCode    string `xml:\"Code\"`\n\tMessage string `xml:\"Message\"`\n}\n\n// wrappedErrorResponse represents the error response body\n// wrapped within <Error>...</Error>\ntype wrappedErrorResponse struct {\n\tCode    string `xml:\"Error>Code\"`\n\tMessage string `xml:\"Error>Message\"`\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/escape.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Copied and modified from Go 1.14 stdlib's encoding/xml\n\npackage xml\n\nimport (\n\t\"unicode/utf8\"\n)\n\n// Copied from Go 1.14 stdlib's encoding/xml\nvar (\n\tescQuot = []byte(\"&#34;\") // shorter than \"&quot;\"\n\tescApos = []byte(\"&#39;\") // shorter than \"&apos;\"\n\tescAmp  = []byte(\"&amp;\")\n\tescLT   = []byte(\"&lt;\")\n\tescGT   = []byte(\"&gt;\")\n\tescTab  = []byte(\"&#x9;\")\n\tescNL   = []byte(\"&#xA;\")\n\tescCR   = []byte(\"&#xD;\")\n\tescFFFD = []byte(\"\\uFFFD\") // Unicode replacement character\n\n\t// Additional Escapes\n\tescNextLine = []byte(\"&#x85;\")\n\tescLS       = []byte(\"&#x2028;\")\n)\n\n// Decide whether the given rune is in the XML Character Range, per\n// the Char production of https://www.xml.com/axml/testaxml.htm,\n// Section 2.2 Characters.\nfunc isInCharacterRange(r rune) (inrange bool) {\n\treturn r == 0x09 ||\n\t\tr == 0x0A ||\n\t\tr == 0x0D ||\n\t\tr >= 0x20 && r <= 0xD7FF ||\n\t\tr >= 0xE000 && r <= 0xFFFD ||\n\t\tr >= 0x10000 && r <= 0x10FFFF\n}\n\n// TODO: When do we need to escape the string?\n// Based on encoding/xml escapeString from the Go Standard Library.\n// https://golang.org/src/encoding/xml/xml.go\nfunc escapeString(e writer, s string) {\n\tvar esc []byte\n\tlast := 0\n\tfor i := 0; i < len(s); {\n\t\tr, width := utf8.DecodeRuneInString(s[i:])\n\t\ti += width\n\t\tswitch r {\n\t\tcase '\"':\n\t\t\tesc = escQuot\n\t\tcase '\\'':\n\t\t\tesc = escApos\n\t\tcase '&':\n\t\t\tesc = escAmp\n\t\tcase '<':\n\t\t\tesc = escLT\n\t\tcase '>':\n\t\t\tesc = escGT\n\t\tcase '\\t':\n\t\t\tesc = escTab\n\t\tcase '\\n':\n\t\t\tesc = escNL\n\t\tcase '\\r':\n\t\t\tesc = escCR\n\t\tcase '\\u0085':\n\t\t\t// Not escaped by stdlib\n\t\t\tesc = escNextLine\n\t\tcase '\\u2028':\n\t\t\t// Not escaped by stdlib\n\t\t\tesc = escLS\n\t\tdefault:\n\t\t\tif !isInCharacterRange(r) || (r == 0xFFFD && width == 1) {\n\t\t\t\tesc = escFFFD\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\te.WriteString(s[last : i-width])\n\t\te.Write(esc)\n\t\tlast = i\n\t}\n\te.WriteString(s[last:])\n}\n\n// escapeText writes to w the properly escaped XML equivalent\n// of the plain text data s. If escapeNewline is true, newline\n// characters will be escaped.\n//\n// Based on encoding/xml escapeText from the Go Standard Library.\n// https://golang.org/src/encoding/xml/xml.go\nfunc escapeText(e writer, s []byte) {\n\tvar esc []byte\n\tlast := 0\n\tfor i := 0; i < len(s); {\n\t\tr, width := utf8.DecodeRune(s[i:])\n\t\ti += width\n\t\tswitch r {\n\t\tcase '\"':\n\t\t\tesc = escQuot\n\t\tcase '\\'':\n\t\t\tesc = escApos\n\t\tcase '&':\n\t\t\tesc = escAmp\n\t\tcase '<':\n\t\t\tesc = escLT\n\t\tcase '>':\n\t\t\tesc = escGT\n\t\tcase '\\t':\n\t\t\tesc = escTab\n\t\tcase '\\n':\n\t\t\t// This always escapes newline, which is different than stdlib's optional\n\t\t\t// escape of new line.\n\t\t\tesc = escNL\n\t\tcase '\\r':\n\t\t\tesc = escCR\n\t\tcase '\\u0085':\n\t\t\t// Not escaped by stdlib\n\t\t\tesc = escNextLine\n\t\tcase '\\u2028':\n\t\t\t// Not escaped by stdlib\n\t\t\tesc = escLS\n\t\tdefault:\n\t\t\tif !isInCharacterRange(r) || (r == 0xFFFD && width == 1) {\n\t\t\t\tesc = escFFFD\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\te.Write(s[last : i-width])\n\t\te.Write(esc)\n\t\tlast = i\n\t}\n\te.Write(s[last:])\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/map.go",
    "content": "package xml\n\n// mapEntryWrapper is the default member wrapper start element for XML Map entry\nvar mapEntryWrapper = StartElement{\n\tName: Name{Local: \"entry\"},\n}\n\n// Map represents the encoding of a XML map type\ntype Map struct {\n\tw       writer\n\tscratch *[]byte\n\n\t// member start element is the map entry wrapper start element\n\tmemberStartElement StartElement\n\n\t// isFlattened returns true if the map is a flattened map\n\tisFlattened bool\n}\n\n// newMap returns a map encoder which sets the default map\n// entry wrapper to `entry`.\n//\n// A map `someMap : {{key:\"abc\", value:\"123\"}}` is represented as\n// `<someMap><entry><key>abc<key><value>123</value></entry></someMap>`.\nfunc newMap(w writer, scratch *[]byte) *Map {\n\treturn &Map{\n\t\tw:                  w,\n\t\tscratch:            scratch,\n\t\tmemberStartElement: mapEntryWrapper,\n\t}\n}\n\n// newFlattenedMap returns a map encoder which sets the map\n// entry wrapper to the passed in memberWrapper`.\n//\n// A flattened map `someMap : {{key:\"abc\", value:\"123\"}}` is represented as\n// `<someMap><key>abc<key><value>123</value></someMap>`.\nfunc newFlattenedMap(w writer, scratch *[]byte, memberWrapper StartElement) *Map {\n\treturn &Map{\n\t\tw:                  w,\n\t\tscratch:            scratch,\n\t\tmemberStartElement: memberWrapper,\n\t\tisFlattened:        true,\n\t}\n}\n\n// Entry returns a Value encoder with map's element.\n// It writes the member wrapper start tag for each entry.\nfunc (m *Map) Entry() Value {\n\tv := newValue(m.w, m.scratch, m.memberStartElement)\n\tv.isFlattened = m.isFlattened\n\treturn v\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/value.go",
    "content": "package xml\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"strconv\"\n\n\t\"github.com/aws/smithy-go/encoding\"\n)\n\n// Value represents an XML Value type\n// XML Value types: Object, Array, Map, String, Number, Boolean.\ntype Value struct {\n\tw       writer\n\tscratch *[]byte\n\n\t// xml start element is the associated start element for the Value\n\tstartElement StartElement\n\n\t// indicates if the Value represents a flattened shape\n\tisFlattened bool\n}\n\n// newFlattenedValue returns a Value encoder. newFlattenedValue does NOT write the start element tag\nfunc newFlattenedValue(w writer, scratch *[]byte, startElement StartElement) Value {\n\treturn Value{\n\t\tw:            w,\n\t\tscratch:      scratch,\n\t\tstartElement: startElement,\n\t}\n}\n\n// newValue writes the start element xml tag and returns a Value\nfunc newValue(w writer, scratch *[]byte, startElement StartElement) Value {\n\twriteStartElement(w, startElement)\n\treturn Value{w: w, scratch: scratch, startElement: startElement}\n}\n\n// writeStartElement takes in a start element and writes it.\n// It handles namespace, attributes in start element.\nfunc writeStartElement(w writer, el StartElement) error {\n\tif el.isZero() {\n\t\treturn fmt.Errorf(\"xml start element cannot be nil\")\n\t}\n\n\tw.WriteRune(leftAngleBracket)\n\n\tif len(el.Name.Space) != 0 {\n\t\tescapeString(w, el.Name.Space)\n\t\tw.WriteRune(colon)\n\t}\n\tescapeString(w, el.Name.Local)\n\tfor _, attr := range el.Attr {\n\t\tw.WriteRune(' ')\n\t\twriteAttribute(w, &attr)\n\t}\n\n\tw.WriteRune(rightAngleBracket)\n\treturn nil\n}\n\n// writeAttribute writes an attribute from a provided Attribute\n// For a namespace attribute, the attr.Name.Space must be defined as \"xmlns\".\n// https://www.w3.org/TR/REC-xml-names/#NT-DefaultAttName\nfunc writeAttribute(w writer, attr *Attr) {\n\t// if local, space both are not empty\n\tif len(attr.Name.Space) != 0 && len(attr.Name.Local) != 0 {\n\t\tescapeString(w, attr.Name.Space)\n\t\tw.WriteRune(colon)\n\t}\n\n\t// if prefix is empty, the default `xmlns` space should be used as prefix.\n\tif len(attr.Name.Local) == 0 {\n\t\tattr.Name.Local = attr.Name.Space\n\t}\n\n\tescapeString(w, attr.Name.Local)\n\tw.WriteRune(equals)\n\tw.WriteRune(quote)\n\tescapeString(w, attr.Value)\n\tw.WriteRune(quote)\n}\n\n// writeEndElement takes in a end element and writes it.\nfunc writeEndElement(w writer, el EndElement) error {\n\tif el.isZero() {\n\t\treturn fmt.Errorf(\"xml end element cannot be nil\")\n\t}\n\n\tw.WriteRune(leftAngleBracket)\n\tw.WriteRune(forwardSlash)\n\n\tif len(el.Name.Space) != 0 {\n\t\tescapeString(w, el.Name.Space)\n\t\tw.WriteRune(colon)\n\t}\n\tescapeString(w, el.Name.Local)\n\tw.WriteRune(rightAngleBracket)\n\n\treturn nil\n}\n\n// String encodes v as a XML string.\n// It will auto close the parent xml element tag.\nfunc (xv Value) String(v string) {\n\tescapeString(xv.w, v)\n\txv.Close()\n}\n\n// Byte encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Byte(v int8) {\n\txv.Long(int64(v))\n}\n\n// Short encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Short(v int16) {\n\txv.Long(int64(v))\n}\n\n// Integer encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Integer(v int32) {\n\txv.Long(int64(v))\n}\n\n// Long encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Long(v int64) {\n\t*xv.scratch = strconv.AppendInt((*xv.scratch)[:0], v, 10)\n\txv.w.Write(*xv.scratch)\n\n\txv.Close()\n}\n\n// Float encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Float(v float32) {\n\txv.float(float64(v), 32)\n\txv.Close()\n}\n\n// Double encodes v as a XML number.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Double(v float64) {\n\txv.float(v, 64)\n\txv.Close()\n}\n\nfunc (xv Value) float(v float64, bits int) {\n\t*xv.scratch = encoding.EncodeFloat((*xv.scratch)[:0], v, bits)\n\txv.w.Write(*xv.scratch)\n}\n\n// Boolean encodes v as a XML boolean.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Boolean(v bool) {\n\t*xv.scratch = strconv.AppendBool((*xv.scratch)[:0], v)\n\txv.w.Write(*xv.scratch)\n\n\txv.Close()\n}\n\n// Base64EncodeBytes writes v as a base64 value in XML string.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Base64EncodeBytes(v []byte) {\n\tencodeByteSlice(xv.w, (*xv.scratch)[:0], v)\n\txv.Close()\n}\n\n// BigInteger encodes v big.Int as XML value.\n// It will auto close the parent xml element tag.\nfunc (xv Value) BigInteger(v *big.Int) {\n\txv.w.Write([]byte(v.Text(10)))\n\txv.Close()\n}\n\n// BigDecimal encodes v big.Float as XML value.\n// It will auto close the parent xml element tag.\nfunc (xv Value) BigDecimal(v *big.Float) {\n\tif i, accuracy := v.Int64(); accuracy == big.Exact {\n\t\txv.Long(i)\n\t\treturn\n\t}\n\n\txv.w.Write([]byte(v.Text('e', -1)))\n\txv.Close()\n}\n\n// Write writes v directly to the xml document\n// if escapeXMLText is set to true, write will escape text.\n// It will auto close the parent xml element tag.\nfunc (xv Value) Write(v []byte, escapeXMLText bool) {\n\t// escape and write xml text\n\tif escapeXMLText {\n\t\tescapeText(xv.w, v)\n\t} else {\n\t\t// write xml directly\n\t\txv.w.Write(v)\n\t}\n\n\txv.Close()\n}\n\n// MemberElement does member element encoding. It returns a Value.\n// Member Element method should be used for all shapes except flattened shapes.\n//\n// A call to MemberElement will write nested element tags directly using the\n// provided start element. The value returned by MemberElement should be closed.\nfunc (xv Value) MemberElement(element StartElement) Value {\n\treturn newValue(xv.w, xv.scratch, element)\n}\n\n// FlattenedElement returns flattened element encoding. It returns a Value.\n// This method should be used for flattened shapes.\n//\n// Unlike MemberElement, flattened element will NOT write element tags\n// directly for the associated start element.\n//\n// The value returned by the FlattenedElement does not need to be closed.\nfunc (xv Value) FlattenedElement(element StartElement) Value {\n\tv := newFlattenedValue(xv.w, xv.scratch, element)\n\tv.isFlattened = true\n\treturn v\n}\n\n// Array returns an array encoder. By default, the members of array are\n// wrapped with `<member>` element tag.\n// If value is marked as flattened, the start element is used to wrap the members instead of\n// the `<member>` element.\nfunc (xv Value) Array() *Array {\n\treturn newArray(xv.w, xv.scratch, arrayMemberWrapper, xv.startElement, xv.isFlattened)\n}\n\n/*\nArrayWithCustomName returns an array encoder.\n\nIt takes named start element as an argument, the named start element will used to wrap xml array entries.\nfor eg, `<someList><customName>entry1</customName></someList>`\nHere `customName` named start element will be wrapped on each array member.\n*/\nfunc (xv Value) ArrayWithCustomName(element StartElement) *Array {\n\treturn newArray(xv.w, xv.scratch, element, xv.startElement, xv.isFlattened)\n}\n\n/*\nMap returns a map encoder. By default, the map entries are\nwrapped with `<entry>` element tag.\n\nIf value is marked as flattened, the start element is used to wrap the entry instead of\nthe `<member>` element.\n*/\nfunc (xv Value) Map() *Map {\n\t// flattened map\n\tif xv.isFlattened {\n\t\treturn newFlattenedMap(xv.w, xv.scratch, xv.startElement)\n\t}\n\n\t// un-flattened map\n\treturn newMap(xv.w, xv.scratch)\n}\n\n// encodeByteSlice is modified copy of json encoder's encodeByteSlice.\n// It is used to base64 encode a byte slice.\nfunc encodeByteSlice(w writer, scratch []byte, v []byte) {\n\tif v == nil {\n\t\treturn\n\t}\n\n\tencodedLen := base64.StdEncoding.EncodedLen(len(v))\n\tif encodedLen <= len(scratch) {\n\t\t// If the encoded bytes fit in e.scratch, avoid an extra\n\t\t// allocation and use the cheaper Encoding.Encode.\n\t\tdst := scratch[:encodedLen]\n\t\tbase64.StdEncoding.Encode(dst, v)\n\t\tw.Write(dst)\n\t} else if encodedLen <= 1024 {\n\t\t// The encoded bytes are short enough to allocate for, and\n\t\t// Encoding.Encode is still cheaper.\n\t\tdst := make([]byte, encodedLen)\n\t\tbase64.StdEncoding.Encode(dst, v)\n\t\tw.Write(dst)\n\t} else {\n\t\t// The encoded bytes are too long to cheaply allocate, and\n\t\t// Encoding.Encode is no longer noticeably cheaper.\n\t\tenc := base64.NewEncoder(base64.StdEncoding, w)\n\t\tenc.Write(v)\n\t\tenc.Close()\n\t}\n}\n\n// IsFlattened returns true if value is for flattened shape.\nfunc (xv Value) IsFlattened() bool {\n\treturn xv.isFlattened\n}\n\n// Close closes the value.\nfunc (xv Value) Close() {\n\twriteEndElement(xv.w, xv.startElement.End())\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.go",
    "content": "package xml\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// NodeDecoder is a XML decoder wrapper that is responsible to decoding\n// a single XML Node element and it's nested member elements. This wrapper decoder\n// takes in the start element of the top level node being decoded.\ntype NodeDecoder struct {\n\tDecoder *xml.Decoder\n\tStartEl xml.StartElement\n}\n\n// WrapNodeDecoder returns an initialized XMLNodeDecoder\nfunc WrapNodeDecoder(decoder *xml.Decoder, startEl xml.StartElement) NodeDecoder {\n\treturn NodeDecoder{\n\t\tDecoder: decoder,\n\t\tStartEl: startEl,\n\t}\n}\n\n// Token on a Node Decoder returns a xml StartElement. It returns a boolean that indicates the\n// a token is the node decoder's end node token; and an error which indicates any error\n// that occurred while retrieving the start element\nfunc (d NodeDecoder) Token() (t xml.StartElement, done bool, err error) {\n\tfor {\n\t\ttoken, e := d.Decoder.Token()\n\t\tif e != nil {\n\t\t\treturn t, done, e\n\t\t}\n\n\t\t// check if we reach end of the node being decoded\n\t\tif el, ok := token.(xml.EndElement); ok {\n\t\t\treturn t, el == d.StartEl.End(), err\n\t\t}\n\n\t\tif t, ok := token.(xml.StartElement); ok {\n\t\t\treturn restoreAttrNamespaces(t), false, err\n\t\t}\n\n\t\t// skip token if it is a comment or preamble or empty space value due to indentation\n\t\t// or if it's a value and is not expected\n\t}\n}\n\n// restoreAttrNamespaces update XML attributes to restore the short namespaces found within\n// the raw XML document.\nfunc restoreAttrNamespaces(node xml.StartElement) xml.StartElement {\n\tif len(node.Attr) == 0 {\n\t\treturn node\n\t}\n\n\t// Generate a mapping of XML namespace values to their short names.\n\tns := map[string]string{}\n\tfor _, a := range node.Attr {\n\t\tif a.Name.Space == \"xmlns\" {\n\t\t\tns[a.Value] = a.Name.Local\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i, a := range node.Attr {\n\t\tif a.Name.Space == \"xmlns\" {\n\t\t\tcontinue\n\t\t}\n\t\t// By default, xml.Decoder will fully resolve these namespaces. So if you had <foo xmlns:bar=baz bar:bin=hi/>\n\t\t// then by default the second attribute would have the `Name.Space` resolved to `baz`. But we need it to\n\t\t// continue to resolve as `bar` so we can easily identify it later on.\n\t\tif v, ok := ns[node.Attr[i].Name.Space]; ok {\n\t\t\tnode.Attr[i].Name.Space = v\n\t\t}\n\t}\n\treturn node\n}\n\n// GetElement looks for the given tag name at the current level, and returns the element if found, and\n// skipping over non-matching elements. Returns an error if the node is not found, or if an error occurs while walking\n// the document.\nfunc (d NodeDecoder) GetElement(name string) (t xml.StartElement, err error) {\n\tfor {\n\t\ttoken, done, err := d.Token()\n\t\tif err != nil {\n\t\t\treturn t, err\n\t\t}\n\t\tif done {\n\t\t\treturn t, fmt.Errorf(\"%s node not found\", name)\n\t\t}\n\t\tswitch {\n\t\tcase strings.EqualFold(name, token.Name.Local):\n\t\t\treturn token, nil\n\t\tdefault:\n\t\t\terr = d.Decoder.Skip()\n\t\t\tif err != nil {\n\t\t\t\treturn t, err\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Value provides an abstraction to retrieve char data value within an xml element.\n// The method will return an error if it encounters a nested xml element instead of char data.\n// This method should only be used to retrieve simple type or blob shape values as []byte.\nfunc (d NodeDecoder) Value() (c []byte, err error) {\n\tt, e := d.Decoder.Token()\n\tif e != nil {\n\t\treturn c, e\n\t}\n\n\tendElement := d.StartEl.End()\n\n\tswitch ev := t.(type) {\n\tcase xml.CharData:\n\t\tc = ev.Copy()\n\tcase xml.EndElement: // end tag or self-closing\n\t\tif ev == endElement {\n\t\t\treturn []byte{}, err\n\t\t}\n\t\treturn c, fmt.Errorf(\"expected value for %v element, got %T type %v instead\", d.StartEl.Name.Local, t, t)\n\tdefault:\n\t\treturn c, fmt.Errorf(\"expected value for %v element, got %T type %v instead\", d.StartEl.Name.Local, t, t)\n\t}\n\n\tt, e = d.Decoder.Token()\n\tif e != nil {\n\t\treturn c, e\n\t}\n\n\tif ev, ok := t.(xml.EndElement); ok {\n\t\tif ev == endElement {\n\t\t\treturn c, err\n\t\t}\n\t}\n\n\treturn c, fmt.Errorf(\"expected end element %v, got %T type %v instead\", endElement, t, t)\n}\n\n// FetchRootElement takes in a decoder and returns the first start element within the xml body.\n// This function is useful in fetching the start element of an XML response and ignore the\n// comments and preamble\nfunc FetchRootElement(decoder *xml.Decoder) (startElement xml.StartElement, err error) {\n\tfor {\n\t\tt, e := decoder.Token()\n\t\tif e != nil {\n\t\t\treturn startElement, e\n\t\t}\n\n\t\tif startElement, ok := t.(xml.StartElement); ok {\n\t\t\treturn startElement, err\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/endpoints/endpoint.go",
    "content": "package transport\n\nimport (\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/aws/smithy-go\"\n)\n\n// Endpoint is the endpoint object returned by Endpoint resolution V2\ntype Endpoint struct {\n\t// The complete URL minimally specfiying the scheme and host.\n\t// May optionally specify the port and base path component.\n\tURI url.URL\n\n\t// An optional set of headers to be sent using transport layer headers.\n\tHeaders http.Header\n\n\t// A grab-bag property map of endpoint attributes. The\n\t// values present here are subject to change, or being add/removed at any\n\t// time.\n\tProperties smithy.Properties\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/errors.go",
    "content": "package smithy\n\nimport \"fmt\"\n\n// APIError provides the generic API and protocol agnostic error type all SDK\n// generated exception types will implement.\ntype APIError interface {\n\terror\n\n\t// ErrorCode returns the error code for the API exception.\n\tErrorCode() string\n\t// ErrorMessage returns the error message for the API exception.\n\tErrorMessage() string\n\t// ErrorFault returns the fault for the API exception.\n\tErrorFault() ErrorFault\n}\n\n// GenericAPIError provides a generic concrete API error type that SDKs can use\n// to deserialize error responses into. Should be used for unmodeled or untyped\n// errors.\ntype GenericAPIError struct {\n\tCode    string\n\tMessage string\n\tFault   ErrorFault\n}\n\n// ErrorCode returns the error code for the API exception.\nfunc (e *GenericAPIError) ErrorCode() string { return e.Code }\n\n// ErrorMessage returns the error message for the API exception.\nfunc (e *GenericAPIError) ErrorMessage() string { return e.Message }\n\n// ErrorFault returns the fault for the API exception.\nfunc (e *GenericAPIError) ErrorFault() ErrorFault { return e.Fault }\n\nfunc (e *GenericAPIError) Error() string {\n\treturn fmt.Sprintf(\"api error %s: %s\", e.Code, e.Message)\n}\n\nvar _ APIError = (*GenericAPIError)(nil)\n\n// OperationError decorates an underlying error which occurred while invoking\n// an operation with names of the operation and API.\ntype OperationError struct {\n\tServiceID     string\n\tOperationName string\n\tErr           error\n}\n\n// Service returns the name of the API service the error occurred with.\nfunc (e *OperationError) Service() string { return e.ServiceID }\n\n// Operation returns the name of the API operation the error occurred with.\nfunc (e *OperationError) Operation() string { return e.OperationName }\n\n// Unwrap returns the nested error if any, or nil.\nfunc (e *OperationError) Unwrap() error { return e.Err }\n\nfunc (e *OperationError) Error() string {\n\treturn fmt.Sprintf(\"operation error %s: %s, %v\", e.ServiceID, e.OperationName, e.Err)\n}\n\n// DeserializationError provides a wrapper for an error that occurs during\n// deserialization.\ntype DeserializationError struct {\n\tErr      error //  original error\n\tSnapshot []byte\n}\n\n// Error returns a formatted error for DeserializationError\nfunc (e *DeserializationError) Error() string {\n\tconst msg = \"deserialization failed\"\n\tif e.Err == nil {\n\t\treturn msg\n\t}\n\treturn fmt.Sprintf(\"%s, %v\", msg, e.Err)\n}\n\n// Unwrap returns the underlying Error in DeserializationError\nfunc (e *DeserializationError) Unwrap() error { return e.Err }\n\n// ErrorFault provides the type for a Smithy API error fault.\ntype ErrorFault int\n\n// ErrorFault enumeration values\nconst (\n\tFaultUnknown ErrorFault = iota\n\tFaultServer\n\tFaultClient\n)\n\nfunc (f ErrorFault) String() string {\n\tswitch f {\n\tcase FaultServer:\n\t\treturn \"server\"\n\tcase FaultClient:\n\t\treturn \"client\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\n// SerializationError represents an error that occurred while attempting to serialize a request\ntype SerializationError struct {\n\tErr error // original error\n}\n\n// Error returns a formatted error for SerializationError\nfunc (e *SerializationError) Error() string {\n\tconst msg = \"serialization failed\"\n\tif e.Err == nil {\n\t\treturn msg\n\t}\n\treturn fmt.Sprintf(\"%s: %v\", msg, e.Err)\n}\n\n// Unwrap returns the underlying Error in SerializationError\nfunc (e *SerializationError) Unwrap() error { return e.Err }\n\n// CanceledError is the error that will be returned by an API request that was\n// canceled. API operations given a Context may return this error when\n// canceled.\ntype CanceledError struct {\n\tErr error\n}\n\n// CanceledError returns true to satisfy interfaces checking for canceled errors.\nfunc (*CanceledError) CanceledError() bool { return true }\n\n// Unwrap returns the underlying error, if there was one.\nfunc (e *CanceledError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e *CanceledError) Error() string {\n\treturn fmt.Sprintf(\"canceled, %v\", e.Err)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/go_module_metadata.go",
    "content": "// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.\n\npackage smithy\n\n// goModuleVersion is the tagged release for this module\nconst goModuleVersion = \"1.20.3\"\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go",
    "content": "// Package singleflight provides a duplicate function call suppression\n// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight\n// package. The package is forked, because the package a part of the unstable\n// and unversioned golang.org/x/sync module.\n//\n// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight\n\npackage singleflight\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage singleflight\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"sync\"\n)\n\n// errGoexit indicates the runtime.Goexit was called in\n// the user given function.\nvar errGoexit = errors.New(\"runtime.Goexit was called\")\n\n// A panicError is an arbitrary value recovered from a panic\n// with the stack trace during the execution of given function.\ntype panicError struct {\n\tvalue interface{}\n\tstack []byte\n}\n\n// Error implements error interface.\nfunc (p *panicError) Error() string {\n\treturn fmt.Sprintf(\"%v\\n\\n%s\", p.value, p.stack)\n}\n\nfunc newPanicError(v interface{}) error {\n\tstack := debug.Stack()\n\n\t// The first line of the stack trace is of the form \"goroutine N [status]:\"\n\t// but by the time the panic reaches Do the goroutine may no longer exist\n\t// and its status will have changed. Trim out the misleading line.\n\tif line := bytes.IndexByte(stack[:], '\\n'); line >= 0 {\n\t\tstack = stack[line+1:]\n\t}\n\treturn &panicError{value: v, stack: stack}\n}\n\n// call is an in-flight or completed singleflight.Do call\ntype call struct {\n\twg sync.WaitGroup\n\n\t// These fields are written once before the WaitGroup is done\n\t// and are only read after the WaitGroup is done.\n\tval interface{}\n\terr error\n\n\t// forgotten indicates whether Forget was called with this call's key\n\t// while the call was still in flight.\n\tforgotten bool\n\n\t// These fields are read and written with the singleflight\n\t// mutex held before the WaitGroup is done, and are read but\n\t// not written after the WaitGroup is done.\n\tdups  int\n\tchans []chan<- Result\n}\n\n// Group represents a class of work and forms a namespace in\n// which units of work can be executed with duplicate suppression.\ntype Group struct {\n\tmu sync.Mutex       // protects m\n\tm  map[string]*call // lazily initialized\n}\n\n// Result holds the results of Do, so they can be passed\n// on a channel.\ntype Result struct {\n\tVal    interface{}\n\tErr    error\n\tShared bool\n}\n\n// Do executes and returns the results of the given function, making\n// sure that only one execution is in-flight for a given key at a\n// time. If a duplicate comes in, the duplicate caller waits for the\n// original to complete and receives the same results.\n// The return value shared indicates whether v was given to multiple callers.\nfunc (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) {\n\tg.mu.Lock()\n\tif g.m == nil {\n\t\tg.m = make(map[string]*call)\n\t}\n\tif c, ok := g.m[key]; ok {\n\t\tc.dups++\n\t\tg.mu.Unlock()\n\t\tc.wg.Wait()\n\n\t\tif e, ok := c.err.(*panicError); ok {\n\t\t\tpanic(e)\n\t\t} else if c.err == errGoexit {\n\t\t\truntime.Goexit()\n\t\t}\n\t\treturn c.val, c.err, true\n\t}\n\tc := new(call)\n\tc.wg.Add(1)\n\tg.m[key] = c\n\tg.mu.Unlock()\n\n\tg.doCall(c, key, fn)\n\treturn c.val, c.err, c.dups > 0\n}\n\n// DoChan is like Do but returns a channel that will receive the\n// results when they are ready.\n//\n// The returned channel will not be closed.\nfunc (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result {\n\tch := make(chan Result, 1)\n\tg.mu.Lock()\n\tif g.m == nil {\n\t\tg.m = make(map[string]*call)\n\t}\n\tif c, ok := g.m[key]; ok {\n\t\tc.dups++\n\t\tc.chans = append(c.chans, ch)\n\t\tg.mu.Unlock()\n\t\treturn ch\n\t}\n\tc := &call{chans: []chan<- Result{ch}}\n\tc.wg.Add(1)\n\tg.m[key] = c\n\tg.mu.Unlock()\n\n\tgo g.doCall(c, key, fn)\n\n\treturn ch\n}\n\n// doCall handles the single call for a key.\nfunc (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) {\n\tnormalReturn := false\n\trecovered := false\n\n\t// use double-defer to distinguish panic from runtime.Goexit,\n\t// more details see https://golang.org/cl/134395\n\tdefer func() {\n\t\t// the given function invoked runtime.Goexit\n\t\tif !normalReturn && !recovered {\n\t\t\tc.err = errGoexit\n\t\t}\n\n\t\tc.wg.Done()\n\t\tg.mu.Lock()\n\t\tdefer g.mu.Unlock()\n\t\tif !c.forgotten {\n\t\t\tdelete(g.m, key)\n\t\t}\n\n\t\tif e, ok := c.err.(*panicError); ok {\n\t\t\t// In order to prevent the waiting channels from being blocked forever,\n\t\t\t// needs to ensure that this panic cannot be recovered.\n\t\t\tif len(c.chans) > 0 {\n\t\t\t\tgo panic(e)\n\t\t\t\tselect {} // Keep this goroutine around so that it will appear in the crash dump.\n\t\t\t} else {\n\t\t\t\tpanic(e)\n\t\t\t}\n\t\t} else if c.err == errGoexit {\n\t\t\t// Already in the process of goexit, no need to call again\n\t\t} else {\n\t\t\t// Normal return\n\t\t\tfor _, ch := range c.chans {\n\t\t\t\tch <- Result{c.val, c.err, c.dups > 0}\n\t\t\t}\n\t\t}\n\t}()\n\n\tfunc() {\n\t\tdefer func() {\n\t\t\tif !normalReturn {\n\t\t\t\t// Ideally, we would wait to take a stack trace until we've determined\n\t\t\t\t// whether this is a panic or a runtime.Goexit.\n\t\t\t\t//\n\t\t\t\t// Unfortunately, the only way we can distinguish the two is to see\n\t\t\t\t// whether the recover stopped the goroutine from terminating, and by\n\t\t\t\t// the time we know that, the part of the stack trace relevant to the\n\t\t\t\t// panic has been discarded.\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\tc.err = newPanicError(r)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\tc.val, c.err = fn()\n\t\tnormalReturn = true\n\t}()\n\n\tif !normalReturn {\n\t\trecovered = true\n\t}\n}\n\n// Forget tells the singleflight to forget about a key.  Future calls\n// to Do for this key will call the function rather than waiting for\n// an earlier call to complete.\nfunc (g *Group) Forget(key string) {\n\tg.mu.Lock()\n\tif c, ok := g.m[key]; ok {\n\t\tc.forgotten = true\n\t}\n\tdelete(g.m, key)\n\tg.mu.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/io/byte.go",
    "content": "package io\n\nconst (\n\t// Byte is 8 bits\n\tByte int64 = 1\n\t// KibiByte (KiB) is 1024 Bytes\n\tKibiByte = Byte * 1024\n\t// MebiByte (MiB) is 1024 KiB\n\tMebiByte = KibiByte * 1024\n\t// GibiByte (GiB) is 1024 MiB\n\tGibiByte = MebiByte * 1024\n)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/io/doc.go",
    "content": "// Package io provides utilities for Smithy generated API clients.\npackage io\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/io/reader.go",
    "content": "package io\n\nimport (\n\t\"io\"\n)\n\n// ReadSeekNopCloser wraps an io.ReadSeeker with an additional Close method\n// that does nothing.\ntype ReadSeekNopCloser struct {\n\tio.ReadSeeker\n}\n\n// Close does nothing.\nfunc (ReadSeekNopCloser) Close() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/io/ringbuffer.go",
    "content": "package io\n\nimport (\n\t\"bytes\"\n\t\"io\"\n)\n\n// RingBuffer struct satisfies io.ReadWrite interface.\n//\n// ReadBuffer is a revolving buffer data structure, which can be used to store snapshots of data in a\n// revolving window.\ntype RingBuffer struct {\n\tslice []byte\n\tstart int\n\tend   int\n\tsize  int\n}\n\n// NewRingBuffer method takes in a byte slice as an input and returns a RingBuffer.\nfunc NewRingBuffer(slice []byte) *RingBuffer {\n\tringBuf := RingBuffer{\n\t\tslice: slice,\n\t}\n\treturn &ringBuf\n}\n\n// Write method inserts the elements in a byte slice, and returns the number of bytes written along with any error.\nfunc (r *RingBuffer) Write(p []byte) (int, error) {\n\tfor _, b := range p {\n\t\t// check if end points to invalid index, we need to circle back\n\t\tif r.end == len(r.slice) {\n\t\t\tr.end = 0\n\t\t}\n\t\t// check if start points to invalid index, we need to circle back\n\t\tif r.start == len(r.slice) {\n\t\t\tr.start = 0\n\t\t}\n\t\t// if ring buffer is filled, increment the start index\n\t\tif r.size == len(r.slice) {\n\t\t\tr.size--\n\t\t\tr.start++\n\t\t}\n\n\t\tr.slice[r.end] = b\n\t\tr.end++\n\t\tr.size++\n\t}\n\treturn len(p), nil\n}\n\n// Read copies the data on the ring buffer into the byte slice provided to the method.\n// Returns the read count along with any error encountered while reading.\nfunc (r *RingBuffer) Read(p []byte) (int, error) {\n\t// readCount keeps track of the number of bytes read\n\tvar readCount int\n\tfor j := 0; j < len(p); j++ {\n\t\t// if ring buffer is empty or completely read\n\t\t// return EOF error.\n\t\tif r.size == 0 {\n\t\t\treturn readCount, io.EOF\n\t\t}\n\n\t\tif r.start == len(r.slice) {\n\t\t\tr.start = 0\n\t\t}\n\n\t\tp[j] = r.slice[r.start]\n\t\treadCount++\n\t\t// increment the start pointer for ring buffer\n\t\tr.start++\n\t\t// decrement the size of ring buffer\n\t\tr.size--\n\t}\n\treturn readCount, nil\n}\n\n// Len returns the number of unread bytes in the buffer.\nfunc (r *RingBuffer) Len() int {\n\treturn r.size\n}\n\n// Bytes returns a copy of the RingBuffer's bytes.\nfunc (r RingBuffer) Bytes() []byte {\n\tvar b bytes.Buffer\n\tio.Copy(&b, &r)\n\treturn b.Bytes()\n}\n\n// Reset resets the ring buffer.\nfunc (r *RingBuffer) Reset() {\n\t*r = RingBuffer{\n\t\tslice: r.slice,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/local-mod-replace.sh",
    "content": "#1/usr/bin/env bash\n\nPROJECT_DIR=\"\"\nSMITHY_SOURCE_DIR=$(cd `dirname $0` && pwd)\n\nusage() {\n  echo \"Usage: $0 [-s SMITHY_SOURCE_DIR] [-d PROJECT_DIR]\" 1>&2\n  exit 1\n}\n\nwhile getopts \"hs:d:\" options; do\n  case \"${options}\" in\n  s)\n    SMITHY_SOURCE_DIR=${OPTARG}\n    if [ \"$SMITHY_SOURCE_DIR\" == \"\" ]; then\n      echo \"path to smithy-go source directory is required\" || exit\n      usage\n    fi\n    ;;\n  d)\n    PROJECT_DIR=${OPTARG}\n    ;;\n  h)\n    usage\n    ;;\n  *)\n    usage\n    ;;\n  esac\ndone\n\nif [ \"$PROJECT_DIR\" != \"\" ]; then\n  cd $PROJECT_DIR || exit\nfi\n\ngo mod graph | awk '{print $1}' | cut -d '@' -f 1 | sort | uniq | grep \"github.com/aws/smithy-go\" | while read x; do\n  repPath=${x/github.com\\/aws\\/smithy-go/${SMITHY_SOURCE_DIR}}\n  echo -replace $x=$repPath\ndone | xargs go mod edit\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/logging/logger.go",
    "content": "package logging\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log\"\n)\n\n// Classification is the type of the log entry's classification name.\ntype Classification string\n\n// Set of standard classifications that can be used by clients and middleware\nconst (\n\tWarn  Classification = \"WARN\"\n\tDebug Classification = \"DEBUG\"\n)\n\n// Logger is an interface for logging entries at certain classifications.\ntype Logger interface {\n\t// Logf is expected to support the standard fmt package \"verbs\".\n\tLogf(classification Classification, format string, v ...interface{})\n}\n\n// LoggerFunc is a wrapper around a function to satisfy the Logger interface.\ntype LoggerFunc func(classification Classification, format string, v ...interface{})\n\n// Logf delegates the logging request to the wrapped function.\nfunc (f LoggerFunc) Logf(classification Classification, format string, v ...interface{}) {\n\tf(classification, format, v...)\n}\n\n// ContextLogger is an optional interface a Logger implementation may expose that provides\n// the ability to create context aware log entries.\ntype ContextLogger interface {\n\tWithContext(context.Context) Logger\n}\n\n// WithContext will pass the provided context to logger if it implements the ContextLogger interface and return the resulting\n// logger. Otherwise the logger will be returned as is. As a special case if a nil logger is provided, a Nop logger will\n// be returned to the caller.\nfunc WithContext(ctx context.Context, logger Logger) Logger {\n\tif logger == nil {\n\t\treturn Nop{}\n\t}\n\n\tcl, ok := logger.(ContextLogger)\n\tif !ok {\n\t\treturn logger\n\t}\n\n\treturn cl.WithContext(ctx)\n}\n\n// Nop is a Logger implementation that simply does not perform any logging.\ntype Nop struct{}\n\n// Logf simply returns without performing any action\nfunc (n Nop) Logf(Classification, string, ...interface{}) {\n\treturn\n}\n\n// StandardLogger is a Logger implementation that wraps the standard library logger, and delegates logging to it's\n// Printf method.\ntype StandardLogger struct {\n\tLogger *log.Logger\n}\n\n// Logf logs the given classification and message to the underlying logger.\nfunc (s StandardLogger) Logf(classification Classification, format string, v ...interface{}) {\n\tif len(classification) != 0 {\n\t\tformat = string(classification) + \" \" + format\n\t}\n\n\ts.Logger.Printf(format, v...)\n}\n\n// NewStandardLogger returns a new StandardLogger\nfunc NewStandardLogger(writer io.Writer) *StandardLogger {\n\treturn &StandardLogger{\n\t\tLogger: log.New(writer, \"SDK \", log.LstdFlags),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/doc.go",
    "content": "// Package middleware provides transport agnostic middleware for decorating SDK\n// handlers.\n//\n// The Smithy middleware stack provides ordered behavior to be invoked on an\n// underlying handler. The stack is separated into steps that are invoked in a\n// static order. A step is a collection of middleware that are injected into a\n// ordered list defined by the user. The user may add, insert, swap, and remove a\n// step's middleware. When the stack is invoked the step middleware become static,\n// and their order cannot be modified.\n//\n// A stack and its step middleware are **not** safe to modify concurrently.\n//\n// A stack will use the ordered list of middleware to decorate a underlying\n// handler. A handler could be something like an HTTP Client that round trips an\n// API operation over HTTP.\n//\n// Smithy Middleware Stack\n//\n// A Stack is a collection of middleware that wrap a handler. The stack can be\n// broken down into discreet steps. Each step may contain zero or more middleware\n// specific to that stack's step.\n//\n// A Stack Step is a predefined set of middleware that are invoked in a static\n// order by the Stack. These steps represent fixed points in the middleware stack\n// for organizing specific behavior, such as serialize and build. A Stack Step is\n// composed of zero or more middleware that are specific to that step. A step may\n// define its own set of input/output parameters the generic input/output\n// parameters are cast from. A step calls its middleware recursively, before\n// calling the next step in the stack returning the result or error of the step\n// middleware decorating the underlying handler.\n//\n// * Initialize: Prepares the input, and sets any default parameters as needed,\n// (e.g. idempotency token, and presigned URLs).\n//\n// * Serialize: Serializes the prepared input into a data structure that can be\n// consumed by the target transport's message, (e.g. REST-JSON serialization).\n//\n// * Build: Adds additional metadata to the serialized transport message, (e.g.\n// HTTP's Content-Length header, or body checksum). Decorations and\n// modifications to the message should be copied to all message attempts.\n//\n// * Finalize: Performs final preparations needed before sending the message. The\n// message should already be complete by this stage, and is only alternated to\n// meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request\n// signing).\n//\n// * Deserialize: Reacts to the handler's response returned by the recipient of\n// the request message. Deserializes the response into a structured type or\n// error above stacks can react to.\n//\n// Adding Middleware to a Stack Step\n//\n// Middleware can be added to a step front or back, or relative, by name, to an\n// existing middleware in that stack. If a middleware does not have a name, a\n// unique name will be generated at the middleware and be added to the step.\n//\n//     // Create middleware stack\n//     stack := middleware.NewStack()\n//\n//     // Add middleware to stack steps\n//     stack.Initialize.Add(paramValidationMiddleware, middleware.After)\n//     stack.Serialize.Add(marshalOperationFoo, middleware.After)\n//     stack.Deserialize.Add(unmarshalOperationFoo, middleware.After)\n//\n//     // Invoke middleware on handler.\n//     resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler)\npackage middleware\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/logging.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/smithy-go/logging\"\n)\n\n// loggerKey is the context value key for which the logger is associated with.\ntype loggerKey struct{}\n\n// GetLogger takes a context to retrieve a Logger from. If no logger is present on the context a logging.Nop logger\n// is returned. If the logger retrieved from context supports the ContextLogger interface, the context will be passed\n// to the WithContext method and the resulting logger will be returned. Otherwise the stored logger is returned as is.\nfunc GetLogger(ctx context.Context) logging.Logger {\n\tlogger, ok := ctx.Value(loggerKey{}).(logging.Logger)\n\tif !ok || logger == nil {\n\t\treturn logging.Nop{}\n\t}\n\n\treturn logging.WithContext(ctx, logger)\n}\n\n// SetLogger sets the provided logger value on the provided ctx.\nfunc SetLogger(ctx context.Context, logger logging.Logger) context.Context {\n\treturn context.WithValue(ctx, loggerKey{}, logger)\n}\n\ntype setLogger struct {\n\tLogger logging.Logger\n}\n\n// AddSetLoggerMiddleware adds a middleware that will add the provided logger to the middleware context.\nfunc AddSetLoggerMiddleware(stack *Stack, logger logging.Logger) error {\n\treturn stack.Initialize.Add(&setLogger{Logger: logger}, After)\n}\n\nfunc (a *setLogger) ID() string {\n\treturn \"SetLogger\"\n}\n\nfunc (a *setLogger) HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) (\n\tout InitializeOutput, metadata Metadata, err error,\n) {\n\treturn next.HandleInitialize(SetLogger(ctx, a.Logger), in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/metadata.go",
    "content": "package middleware\n\n// MetadataReader provides an interface for reading metadata from the\n// underlying metadata container.\ntype MetadataReader interface {\n\tGet(key interface{}) interface{}\n}\n\n// Metadata provides storing and reading metadata values. Keys may be any\n// comparable value type. Get and set will panic if key is not a comparable\n// value type.\n//\n// Metadata uses lazy initialization, and Set method must be called as an\n// addressable value, or pointer. Not doing so may cause key/value pair to not\n// be set.\ntype Metadata struct {\n\tvalues map[interface{}]interface{}\n}\n\n// Get attempts to retrieve the value the key points to. Returns nil if the\n// key was not found.\n//\n// Panics if key type is not comparable.\nfunc (m Metadata) Get(key interface{}) interface{} {\n\treturn m.values[key]\n}\n\n// Clone creates a shallow copy of Metadata entries, returning a new Metadata\n// value with the original entries copied into it.\nfunc (m Metadata) Clone() Metadata {\n\tvs := make(map[interface{}]interface{}, len(m.values))\n\tfor k, v := range m.values {\n\t\tvs[k] = v\n\t}\n\n\treturn Metadata{\n\t\tvalues: vs,\n\t}\n}\n\n// Set stores the value pointed to by the key. If a value already exists at\n// that key it will be replaced with the new value.\n//\n// Set method must be called as an addressable value, or pointer. If Set is not\n// called as an addressable value or pointer, the key value pair being set may\n// be lost.\n//\n// Panics if the key type is not comparable.\nfunc (m *Metadata) Set(key, value interface{}) {\n\tif m.values == nil {\n\t\tm.values = map[interface{}]interface{}{}\n\t}\n\tm.values[key] = value\n}\n\n// Has returns whether the key exists in the metadata.\n//\n// Panics if the key type is not comparable.\nfunc (m Metadata) Has(key interface{}) bool {\n\tif m.values == nil {\n\t\treturn false\n\t}\n\t_, ok := m.values[key]\n\treturn ok\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/middleware.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n)\n\n// Handler provides the interface for performing the logic to obtain an output,\n// or error for the given input.\ntype Handler interface {\n\t// Handle performs logic to obtain an output for the given input. Handler\n\t// should be decorated with middleware to perform input specific behavior.\n\tHandle(ctx context.Context, input interface{}) (\n\t\toutput interface{}, metadata Metadata, err error,\n\t)\n}\n\n// HandlerFunc provides a wrapper around a function pointer to be used as a\n// middleware handler.\ntype HandlerFunc func(ctx context.Context, input interface{}) (\n\toutput interface{}, metadata Metadata, err error,\n)\n\n// Handle invokes the underlying function, returning the result.\nfunc (fn HandlerFunc) Handle(ctx context.Context, input interface{}) (\n\toutput interface{}, metadata Metadata, err error,\n) {\n\treturn fn(ctx, input)\n}\n\n// Middleware provides the interface to call handlers in a chain.\ntype Middleware interface {\n\t// ID provides a unique identifier for the middleware.\n\tID() string\n\n\t// Performs the middleware's handling of the input, returning the output,\n\t// or error. The middleware can invoke the next Handler if handling should\n\t// continue.\n\tHandleMiddleware(ctx context.Context, input interface{}, next Handler) (\n\t\toutput interface{}, metadata Metadata, err error,\n\t)\n}\n\n// decoratedHandler wraps a middleware in order to to call the next handler in\n// the chain.\ntype decoratedHandler struct {\n\t// The next handler to be called.\n\tNext Handler\n\n\t// The current middleware decorating the handler.\n\tWith Middleware\n}\n\n// Handle implements the Handler interface to handle a operation invocation.\nfunc (m decoratedHandler) Handle(ctx context.Context, input interface{}) (\n\toutput interface{}, metadata Metadata, err error,\n) {\n\treturn m.With.HandleMiddleware(ctx, input, m.Next)\n}\n\n// DecorateHandler decorates a handler with a middleware. Wrapping the handler\n// with the middleware.\nfunc DecorateHandler(h Handler, with ...Middleware) Handler {\n\tfor i := len(with) - 1; i >= 0; i-- {\n\t\th = decoratedHandler{\n\t\t\tNext: h,\n\t\t\tWith: with[i],\n\t\t}\n\t}\n\n\treturn h\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/ordered_group.go",
    "content": "package middleware\n\nimport \"fmt\"\n\n// RelativePosition provides specifying the relative position of a middleware\n// in an ordered group.\ntype RelativePosition int\n\n// Relative position for middleware in steps.\nconst (\n\tAfter RelativePosition = iota\n\tBefore\n)\n\ntype ider interface {\n\tID() string\n}\n\n// orderedIDs provides an ordered collection of items with relative ordering\n// by name.\ntype orderedIDs struct {\n\torder *relativeOrder\n\titems map[string]ider\n}\n\nconst baseOrderedItems = 5\n\nfunc newOrderedIDs() *orderedIDs {\n\treturn &orderedIDs{\n\t\torder: newRelativeOrder(),\n\t\titems: make(map[string]ider, baseOrderedItems),\n\t}\n}\n\n// Add injects the item to the relative position of the item group. Returns an\n// error if the item already exists.\nfunc (g *orderedIDs) Add(m ider, pos RelativePosition) error {\n\tid := m.ID()\n\tif len(id) == 0 {\n\t\treturn fmt.Errorf(\"empty ID, ID must not be empty\")\n\t}\n\n\tif err := g.order.Add(pos, id); err != nil {\n\t\treturn err\n\t}\n\n\tg.items[id] = m\n\treturn nil\n}\n\n// Insert injects the item relative to an existing item id. Returns an error if\n// the original item does not exist, or the item being added already exists.\nfunc (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) error {\n\tif len(m.ID()) == 0 {\n\t\treturn fmt.Errorf(\"insert ID must not be empty\")\n\t}\n\tif len(relativeTo) == 0 {\n\t\treturn fmt.Errorf(\"relative to ID must not be empty\")\n\t}\n\n\tif err := g.order.Insert(relativeTo, pos, m.ID()); err != nil {\n\t\treturn err\n\t}\n\n\tg.items[m.ID()] = m\n\treturn nil\n}\n\n// Get returns the ider identified by id. If ider is not present, returns false.\nfunc (g *orderedIDs) Get(id string) (ider, bool) {\n\tv, ok := g.items[id]\n\treturn v, ok\n}\n\n// Swap removes the item by id, replacing it with the new item. Returns an error\n// if the original item doesn't exist.\nfunc (g *orderedIDs) Swap(id string, m ider) (ider, error) {\n\tif len(id) == 0 {\n\t\treturn nil, fmt.Errorf(\"swap from ID must not be empty\")\n\t}\n\n\tiderID := m.ID()\n\tif len(iderID) == 0 {\n\t\treturn nil, fmt.Errorf(\"swap to ID must not be empty\")\n\t}\n\n\tif err := g.order.Swap(id, iderID); err != nil {\n\t\treturn nil, err\n\t}\n\n\tremoved := g.items[id]\n\n\tdelete(g.items, id)\n\tg.items[iderID] = m\n\n\treturn removed, nil\n}\n\n// Remove removes the item by id. Returns an error if the item\n// doesn't exist.\nfunc (g *orderedIDs) Remove(id string) (ider, error) {\n\tif len(id) == 0 {\n\t\treturn nil, fmt.Errorf(\"remove ID must not be empty\")\n\t}\n\n\tif err := g.order.Remove(id); err != nil {\n\t\treturn nil, err\n\t}\n\n\tremoved := g.items[id]\n\tdelete(g.items, id)\n\treturn removed, nil\n}\n\nfunc (g *orderedIDs) List() []string {\n\titems := g.order.List()\n\torder := make([]string, len(items))\n\tcopy(order, items)\n\treturn order\n}\n\n// Clear removes all entries and slots.\nfunc (g *orderedIDs) Clear() {\n\tg.order.Clear()\n\tg.items = map[string]ider{}\n}\n\n// GetOrder returns the item in the order it should be invoked in.\nfunc (g *orderedIDs) GetOrder() []interface{} {\n\torder := g.order.List()\n\tordered := make([]interface{}, len(order))\n\tfor i := 0; i < len(order); i++ {\n\t\tordered[i] = g.items[order[i]]\n\t}\n\n\treturn ordered\n}\n\n// relativeOrder provides ordering of item\ntype relativeOrder struct {\n\torder []string\n}\n\nfunc newRelativeOrder() *relativeOrder {\n\treturn &relativeOrder{\n\t\torder: make([]string, 0, baseOrderedItems),\n\t}\n}\n\n// Add inserts an item into the order relative to the position provided.\nfunc (s *relativeOrder) Add(pos RelativePosition, ids ...string) error {\n\tif len(ids) == 0 {\n\t\treturn nil\n\t}\n\n\tfor _, id := range ids {\n\t\tif _, ok := s.has(id); ok {\n\t\t\treturn fmt.Errorf(\"already exists, %v\", id)\n\t\t}\n\t}\n\n\tswitch pos {\n\tcase Before:\n\t\treturn s.insert(0, Before, ids...)\n\n\tcase After:\n\t\ts.order = append(s.order, ids...)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid position, %v\", int(pos))\n\t}\n\n\treturn nil\n}\n\n// Insert injects an item before or after the relative item. Returns\n// an error if the relative item does not exist.\nfunc (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...string) error {\n\tif len(ids) == 0 {\n\t\treturn nil\n\t}\n\n\tfor _, id := range ids {\n\t\tif _, ok := s.has(id); ok {\n\t\t\treturn fmt.Errorf(\"already exists, %v\", id)\n\t\t}\n\t}\n\n\ti, ok := s.has(relativeTo)\n\tif !ok {\n\t\treturn fmt.Errorf(\"not found, %v\", relativeTo)\n\t}\n\n\treturn s.insert(i, pos, ids...)\n}\n\n// Swap will replace the item id with the to item. Returns an\n// error if the original item id does not exist. Allows swapping out an\n// item for another item with the same id.\nfunc (s *relativeOrder) Swap(id, to string) error {\n\ti, ok := s.has(id)\n\tif !ok {\n\t\treturn fmt.Errorf(\"not found, %v\", id)\n\t}\n\n\tif _, ok = s.has(to); ok && id != to {\n\t\treturn fmt.Errorf(\"already exists, %v\", to)\n\t}\n\n\ts.order[i] = to\n\treturn nil\n}\n\nfunc (s *relativeOrder) Remove(id string) error {\n\ti, ok := s.has(id)\n\tif !ok {\n\t\treturn fmt.Errorf(\"not found, %v\", id)\n\t}\n\n\ts.order = append(s.order[:i], s.order[i+1:]...)\n\treturn nil\n}\n\nfunc (s *relativeOrder) List() []string {\n\treturn s.order\n}\n\nfunc (s *relativeOrder) Clear() {\n\ts.order = s.order[0:0]\n}\n\nfunc (s *relativeOrder) insert(i int, pos RelativePosition, ids ...string) error {\n\tswitch pos {\n\tcase Before:\n\t\tn := len(ids)\n\t\tvar src []string\n\t\tif n <= cap(s.order)-len(s.order) {\n\t\t\ts.order = s.order[:len(s.order)+n]\n\t\t\tsrc = s.order\n\t\t} else {\n\t\t\tsrc = s.order\n\t\t\ts.order = make([]string, len(s.order)+n)\n\t\t\tcopy(s.order[:i], src[:i]) // only when allocating a new slice do we need to copy the front half\n\t\t}\n\t\tcopy(s.order[i+n:], src[i:])\n\t\tcopy(s.order[i:], ids)\n\tcase After:\n\t\tif i == len(s.order)-1 || len(s.order) == 0 {\n\t\t\ts.order = append(s.order, ids...)\n\t\t} else {\n\t\t\ts.order = append(s.order[:i+1], append(ids, s.order[i+1:]...)...)\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid position, %v\", int(pos))\n\t}\n\n\treturn nil\n}\n\nfunc (s *relativeOrder) has(id string) (i int, found bool) {\n\tfor i := 0; i < len(s.order); i++ {\n\t\tif s.order[i] == id {\n\t\t\treturn i, true\n\t\t}\n\t}\n\treturn 0, false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/stack.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"strings\"\n)\n\n// Stack provides protocol and transport agnostic set of middleware split into\n// distinct steps. Steps have specific transitions between them, that are\n// managed by the individual step.\n//\n// Steps are composed as middleware around the underlying handler in the\n// following order:\n//\n//   Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler\n//\n// Any middleware within the chain may choose to stop and return an error or\n// response. Since the middleware decorate the handler like a call stack, each\n// middleware will receive the result of the next middleware in the chain.\n// Middleware that does not need to react to an input, or result must forward\n// along the input down the chain, or return the result back up the chain.\n//\n//   Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler\ntype Stack struct {\n\t// Initialize prepares the input, and sets any default parameters as\n\t// needed, (e.g. idempotency token, and presigned URLs).\n\t//\n\t// Takes Input Parameters, and returns result or error.\n\t//\n\t// Receives result or error from Serialize step.\n\tInitialize *InitializeStep\n\n\t// Serialize serializes the prepared input into a data structure that can be consumed\n\t// by the target transport's message, (e.g. REST-JSON serialization)\n\t//\n\t// Converts Input Parameters into a Request, and returns the result or error.\n\t//\n\t// Receives result or error from Build step.\n\tSerialize *SerializeStep\n\n\t// Build adds additional metadata to the serialized transport message\n\t// (e.g. HTTP's Content-Length header, or body checksum). Decorations and\n\t// modifications to the message should be copied to all message attempts.\n\t//\n\t// Takes Request, and returns result or error.\n\t//\n\t// Receives result or error from Finalize step.\n\tBuild *BuildStep\n\n\t// Finalize performs final preparations needed before sending the message. The\n\t// message should already be complete by this stage, and is only alternated\n\t// to meet the expectations of the recipient (e.g. Retry and AWS SigV4\n\t// request signing)\n\t//\n\t// Takes Request, and returns result or error.\n\t//\n\t// Receives result or error from Deserialize step.\n\tFinalize *FinalizeStep\n\n\t// Deserialize reacts to the handler's response returned by the recipient of the request\n\t// message. Deserializes the response into a structured type or error above\n\t// stacks can react to.\n\t//\n\t// Should only forward Request to underlying handler.\n\t//\n\t// Takes Request, and returns result or error.\n\t//\n\t// Receives raw response, or error from underlying handler.\n\tDeserialize *DeserializeStep\n\n\tid string\n}\n\n// NewStack returns an initialize empty stack.\nfunc NewStack(id string, newRequestFn func() interface{}) *Stack {\n\treturn &Stack{\n\t\tid:          id,\n\t\tInitialize:  NewInitializeStep(),\n\t\tSerialize:   NewSerializeStep(newRequestFn),\n\t\tBuild:       NewBuildStep(),\n\t\tFinalize:    NewFinalizeStep(),\n\t\tDeserialize: NewDeserializeStep(),\n\t}\n}\n\n// ID returns the unique ID for the stack as a middleware.\nfunc (s *Stack) ID() string { return s.id }\n\n// HandleMiddleware invokes the middleware stack decorating the next handler.\n// Each step of stack will be invoked in order before calling the next step.\n// With the next handler call last.\n//\n// The input value must be the input parameters of the operation being\n// performed.\n//\n// Will return the result of the operation, or error.\nfunc (s *Stack) HandleMiddleware(ctx context.Context, input interface{}, next Handler) (\n\toutput interface{}, metadata Metadata, err error,\n) {\n\th := DecorateHandler(next,\n\t\ts.Initialize,\n\t\ts.Serialize,\n\t\ts.Build,\n\t\ts.Finalize,\n\t\ts.Deserialize,\n\t)\n\n\treturn h.Handle(ctx, input)\n}\n\n// List returns a list of all middleware in the stack by step.\nfunc (s *Stack) List() []string {\n\tvar l []string\n\tl = append(l, s.id)\n\n\tl = append(l, s.Initialize.ID())\n\tl = append(l, s.Initialize.List()...)\n\n\tl = append(l, s.Serialize.ID())\n\tl = append(l, s.Serialize.List()...)\n\n\tl = append(l, s.Build.ID())\n\tl = append(l, s.Build.List()...)\n\n\tl = append(l, s.Finalize.ID())\n\tl = append(l, s.Finalize.List()...)\n\n\tl = append(l, s.Deserialize.ID())\n\tl = append(l, s.Deserialize.List()...)\n\n\treturn l\n}\n\nfunc (s *Stack) String() string {\n\tvar b strings.Builder\n\n\tw := &indentWriter{w: &b}\n\n\tw.WriteLine(s.id)\n\tw.Push()\n\n\twriteStepItems(w, s.Initialize)\n\twriteStepItems(w, s.Serialize)\n\twriteStepItems(w, s.Build)\n\twriteStepItems(w, s.Finalize)\n\twriteStepItems(w, s.Deserialize)\n\n\treturn b.String()\n}\n\ntype stackStepper interface {\n\tID() string\n\tList() []string\n}\n\nfunc writeStepItems(w *indentWriter, s stackStepper) {\n\ttype lister interface {\n\t\tList() []string\n\t}\n\n\tw.WriteLine(s.ID())\n\tw.Push()\n\n\tdefer w.Pop()\n\n\t// ignore stack to prevent circular iterations\n\tif _, ok := s.(*Stack); ok {\n\t\treturn\n\t}\n\n\tfor _, id := range s.List() {\n\t\tw.WriteLine(id)\n\t}\n}\n\ntype stringWriter interface {\n\tio.Writer\n\tWriteString(string) (int, error)\n\tWriteRune(rune) (int, error)\n}\n\ntype indentWriter struct {\n\tw     stringWriter\n\tdepth int\n}\n\nconst indentDepth = \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\"\n\nfunc (w *indentWriter) Push() {\n\tw.depth++\n}\n\nfunc (w *indentWriter) Pop() {\n\tw.depth--\n\tif w.depth < 0 {\n\t\tw.depth = 0\n\t}\n}\n\nfunc (w *indentWriter) WriteLine(v string) {\n\tw.w.WriteString(indentDepth[:w.depth])\n\n\tv = strings.ReplaceAll(v, \"\\n\", \"\\\\n\")\n\tv = strings.ReplaceAll(v, \"\\r\", \"\\\\r\")\n\n\tw.w.WriteString(v)\n\tw.w.WriteRune('\\n')\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/stack_values.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n// WithStackValue adds a key value pair to the context that is intended to be\n// scoped to a stack. Use ClearStackValues to get a new context with all stack\n// values cleared.\nfunc WithStackValue(ctx context.Context, key, value interface{}) context.Context {\n\tmd, _ := ctx.Value(stackValuesKey{}).(*stackValues)\n\n\tmd = withStackValue(md, key, value)\n\treturn context.WithValue(ctx, stackValuesKey{}, md)\n}\n\n// ClearStackValues returns a context without any stack values.\nfunc ClearStackValues(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, stackValuesKey{}, nil)\n}\n\n// GetStackValues returns the value pointed to by the key within the stack\n// values, if it is present.\nfunc GetStackValue(ctx context.Context, key interface{}) interface{} {\n\tmd, _ := ctx.Value(stackValuesKey{}).(*stackValues)\n\tif md == nil {\n\t\treturn nil\n\t}\n\n\treturn md.Value(key)\n}\n\ntype stackValuesKey struct{}\n\ntype stackValues struct {\n\tkey    interface{}\n\tvalue  interface{}\n\tparent *stackValues\n}\n\nfunc withStackValue(parent *stackValues, key, value interface{}) *stackValues {\n\tif key == nil {\n\t\tpanic(\"nil key\")\n\t}\n\tif !reflect.TypeOf(key).Comparable() {\n\t\tpanic(\"key is not comparable\")\n\t}\n\treturn &stackValues{key: key, value: value, parent: parent}\n}\n\nfunc (m *stackValues) Value(key interface{}) interface{} {\n\tif key == m.key {\n\t\treturn m.value\n\t}\n\n\tif m.parent == nil {\n\t\treturn nil\n\t}\n\n\treturn m.parent.Value(key)\n}\n\nfunc (c *stackValues) String() string {\n\tvar str strings.Builder\n\n\tcc := c\n\tfor cc == nil {\n\t\tstr.WriteString(\"(\" +\n\t\t\treflect.TypeOf(c.key).String() +\n\t\t\t\": \" +\n\t\t\tstringify(cc.value) +\n\t\t\t\")\")\n\t\tif cc.parent != nil {\n\t\t\tstr.WriteString(\" -> \")\n\t\t}\n\t\tcc = cc.parent\n\t}\n\tstr.WriteRune('}')\n\n\treturn str.String()\n}\n\ntype stringer interface {\n\tString() string\n}\n\n// stringify tries a bit to stringify v, without using fmt, since we don't\n// want context depending on the unicode tables. This is only used by\n// *valueCtx.String().\nfunc stringify(v interface{}) string {\n\tswitch s := v.(type) {\n\tcase stringer:\n\t\treturn s.String()\n\tcase string:\n\t\treturn s\n\t}\n\treturn \"<not Stringer>\"\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/step_build.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n)\n\n// BuildInput provides the input parameters for the BuildMiddleware to consume.\n// BuildMiddleware may modify the Request value before forwarding the input\n// along to the next BuildHandler.\ntype BuildInput struct {\n\tRequest interface{}\n}\n\n// BuildOutput provides the result returned by the next BuildHandler.\ntype BuildOutput struct {\n\tResult interface{}\n}\n\n// BuildHandler provides the interface for the next handler the\n// BuildMiddleware will call in the middleware chain.\ntype BuildHandler interface {\n\tHandleBuild(ctx context.Context, in BuildInput) (\n\t\tout BuildOutput, metadata Metadata, err error,\n\t)\n}\n\n// BuildMiddleware provides the interface for middleware specific to the\n// serialize step. Delegates to the next BuildHandler for further\n// processing.\ntype BuildMiddleware interface {\n\t// Unique ID for the middleware in theBuildStep. The step does not allow\n\t// duplicate IDs.\n\tID() string\n\n\t// Invokes the middleware behavior which must delegate to the next handler\n\t// for the middleware chain to continue. The method must return a result or\n\t// error to its caller.\n\tHandleBuild(ctx context.Context, in BuildInput, next BuildHandler) (\n\t\tout BuildOutput, metadata Metadata, err error,\n\t)\n}\n\n// BuildMiddlewareFunc returns a BuildMiddleware with the unique ID provided,\n// and the func to be invoked.\nfunc BuildMiddlewareFunc(id string, fn func(context.Context, BuildInput, BuildHandler) (BuildOutput, Metadata, error)) BuildMiddleware {\n\treturn buildMiddlewareFunc{\n\t\tid: id,\n\t\tfn: fn,\n\t}\n}\n\ntype buildMiddlewareFunc struct {\n\t// Unique ID for the middleware.\n\tid string\n\n\t// Middleware function to be called.\n\tfn func(context.Context, BuildInput, BuildHandler) (BuildOutput, Metadata, error)\n}\n\n// ID returns the unique ID for the middleware.\nfunc (s buildMiddlewareFunc) ID() string { return s.id }\n\n// HandleBuild invokes the middleware Fn.\nfunc (s buildMiddlewareFunc) HandleBuild(ctx context.Context, in BuildInput, next BuildHandler) (\n\tout BuildOutput, metadata Metadata, err error,\n) {\n\treturn s.fn(ctx, in, next)\n}\n\nvar _ BuildMiddleware = (buildMiddlewareFunc{})\n\n// BuildStep provides the ordered grouping of BuildMiddleware to be invoked on\n// a handler.\ntype BuildStep struct {\n\tids *orderedIDs\n}\n\n// NewBuildStep returns a BuildStep ready to have middleware for\n// initialization added to it.\nfunc NewBuildStep() *BuildStep {\n\treturn &BuildStep{\n\t\tids: newOrderedIDs(),\n\t}\n}\n\nvar _ Middleware = (*BuildStep)(nil)\n\n// ID returns the unique name of the step as a middleware.\nfunc (s *BuildStep) ID() string {\n\treturn \"Build stack step\"\n}\n\n// HandleMiddleware invokes the middleware by decorating the next handler\n// provided. Returns the result of the middleware and handler being invoked.\n//\n// Implements Middleware interface.\nfunc (s *BuildStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) (\n\tout interface{}, metadata Metadata, err error,\n) {\n\torder := s.ids.GetOrder()\n\n\tvar h BuildHandler = buildWrapHandler{Next: next}\n\tfor i := len(order) - 1; i >= 0; i-- {\n\t\th = decoratedBuildHandler{\n\t\t\tNext: h,\n\t\t\tWith: order[i].(BuildMiddleware),\n\t\t}\n\t}\n\n\tsIn := BuildInput{\n\t\tRequest: in,\n\t}\n\n\tres, metadata, err := h.HandleBuild(ctx, sIn)\n\treturn res.Result, metadata, err\n}\n\n// Get retrieves the middleware identified by id. If the middleware is not present, returns false.\nfunc (s *BuildStep) Get(id string) (BuildMiddleware, bool) {\n\tget, ok := s.ids.Get(id)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn get.(BuildMiddleware), ok\n}\n\n// Add injects the middleware to the relative position of the middleware group.\n// Returns an error if the middleware already exists.\nfunc (s *BuildStep) Add(m BuildMiddleware, pos RelativePosition) error {\n\treturn s.ids.Add(m, pos)\n}\n\n// Insert injects the middleware relative to an existing middleware id.\n// Returns an error if the original middleware does not exist, or the middleware\n// being added already exists.\nfunc (s *BuildStep) Insert(m BuildMiddleware, relativeTo string, pos RelativePosition) error {\n\treturn s.ids.Insert(m, relativeTo, pos)\n}\n\n// Swap removes the middleware by id, replacing it with the new middleware.\n// Returns the middleware removed, or an error if the middleware to be removed\n// doesn't exist.\nfunc (s *BuildStep) Swap(id string, m BuildMiddleware) (BuildMiddleware, error) {\n\tremoved, err := s.ids.Swap(id, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(BuildMiddleware), nil\n}\n\n// Remove removes the middleware by id. Returns error if the middleware\n// doesn't exist.\nfunc (s *BuildStep) Remove(id string) (BuildMiddleware, error) {\n\tremoved, err := s.ids.Remove(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(BuildMiddleware), nil\n}\n\n// List returns a list of the middleware in the step.\nfunc (s *BuildStep) List() []string {\n\treturn s.ids.List()\n}\n\n// Clear removes all middleware in the step.\nfunc (s *BuildStep) Clear() {\n\ts.ids.Clear()\n}\n\ntype buildWrapHandler struct {\n\tNext Handler\n}\n\nvar _ BuildHandler = (*buildWrapHandler)(nil)\n\n// Implements BuildHandler, converts types and delegates to underlying\n// generic handler.\nfunc (w buildWrapHandler) HandleBuild(ctx context.Context, in BuildInput) (\n\tout BuildOutput, metadata Metadata, err error,\n) {\n\tres, metadata, err := w.Next.Handle(ctx, in.Request)\n\treturn BuildOutput{\n\t\tResult: res,\n\t}, metadata, err\n}\n\ntype decoratedBuildHandler struct {\n\tNext BuildHandler\n\tWith BuildMiddleware\n}\n\nvar _ BuildHandler = (*decoratedBuildHandler)(nil)\n\nfunc (h decoratedBuildHandler) HandleBuild(ctx context.Context, in BuildInput) (\n\tout BuildOutput, metadata Metadata, err error,\n) {\n\treturn h.With.HandleBuild(ctx, in, h.Next)\n}\n\n// BuildHandlerFunc provides a wrapper around a function to be used as a build middleware handler.\ntype BuildHandlerFunc func(context.Context, BuildInput) (BuildOutput, Metadata, error)\n\n// HandleBuild invokes the wrapped function with the provided arguments.\nfunc (b BuildHandlerFunc) HandleBuild(ctx context.Context, in BuildInput) (BuildOutput, Metadata, error) {\n\treturn b(ctx, in)\n}\n\nvar _ BuildHandler = BuildHandlerFunc(nil)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/step_deserialize.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n)\n\n// DeserializeInput provides the input parameters for the DeserializeInput to\n// consume. DeserializeMiddleware should not modify the Request, and instead\n// forward it along to the next DeserializeHandler.\ntype DeserializeInput struct {\n\tRequest interface{}\n}\n\n// DeserializeOutput provides the result returned by the next\n// DeserializeHandler. The DeserializeMiddleware should deserialize the\n// RawResponse into a Result that can be consumed by middleware higher up in\n// the stack.\ntype DeserializeOutput struct {\n\tRawResponse interface{}\n\tResult      interface{}\n}\n\n// DeserializeHandler provides the interface for the next handler the\n// DeserializeMiddleware will call in the middleware chain.\ntype DeserializeHandler interface {\n\tHandleDeserialize(ctx context.Context, in DeserializeInput) (\n\t\tout DeserializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// DeserializeMiddleware provides the interface for middleware specific to the\n// serialize step. Delegates to the next DeserializeHandler for further\n// processing.\ntype DeserializeMiddleware interface {\n\t// ID returns a unique ID for the middleware in the DeserializeStep. The step does not\n\t// allow duplicate IDs.\n\tID() string\n\n\t// HandleDeserialize invokes the middleware behavior which must delegate to the next handler\n\t// for the middleware chain to continue. The method must return a result or\n\t// error to its caller.\n\tHandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) (\n\t\tout DeserializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// DeserializeMiddlewareFunc returns a DeserializeMiddleware with the unique ID\n// provided, and the func to be invoked.\nfunc DeserializeMiddlewareFunc(id string, fn func(context.Context, DeserializeInput, DeserializeHandler) (DeserializeOutput, Metadata, error)) DeserializeMiddleware {\n\treturn deserializeMiddlewareFunc{\n\t\tid: id,\n\t\tfn: fn,\n\t}\n}\n\ntype deserializeMiddlewareFunc struct {\n\t// Unique ID for the middleware.\n\tid string\n\n\t// Middleware function to be called.\n\tfn func(context.Context, DeserializeInput, DeserializeHandler) (\n\t\tDeserializeOutput, Metadata, error,\n\t)\n}\n\n// ID returns the unique ID for the middleware.\nfunc (s deserializeMiddlewareFunc) ID() string { return s.id }\n\n// HandleDeserialize invokes the middleware Fn.\nfunc (s deserializeMiddlewareFunc) HandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) (\n\tout DeserializeOutput, metadata Metadata, err error,\n) {\n\treturn s.fn(ctx, in, next)\n}\n\nvar _ DeserializeMiddleware = (deserializeMiddlewareFunc{})\n\n// DeserializeStep provides the ordered grouping of DeserializeMiddleware to be\n// invoked on a handler.\ntype DeserializeStep struct {\n\tids *orderedIDs\n}\n\n// NewDeserializeStep returns a DeserializeStep ready to have middleware for\n// initialization added to it.\nfunc NewDeserializeStep() *DeserializeStep {\n\treturn &DeserializeStep{\n\t\tids: newOrderedIDs(),\n\t}\n}\n\nvar _ Middleware = (*DeserializeStep)(nil)\n\n// ID returns the unique ID of the step as a middleware.\nfunc (s *DeserializeStep) ID() string {\n\treturn \"Deserialize stack step\"\n}\n\n// HandleMiddleware invokes the middleware by decorating the next handler\n// provided. Returns the result of the middleware and handler being invoked.\n//\n// Implements Middleware interface.\nfunc (s *DeserializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) (\n\tout interface{}, metadata Metadata, err error,\n) {\n\torder := s.ids.GetOrder()\n\n\tvar h DeserializeHandler = deserializeWrapHandler{Next: next}\n\tfor i := len(order) - 1; i >= 0; i-- {\n\t\th = decoratedDeserializeHandler{\n\t\t\tNext: h,\n\t\t\tWith: order[i].(DeserializeMiddleware),\n\t\t}\n\t}\n\n\tsIn := DeserializeInput{\n\t\tRequest: in,\n\t}\n\n\tres, metadata, err := h.HandleDeserialize(ctx, sIn)\n\treturn res.Result, metadata, err\n}\n\n// Get retrieves the middleware identified by id. If the middleware is not present, returns false.\nfunc (s *DeserializeStep) Get(id string) (DeserializeMiddleware, bool) {\n\tget, ok := s.ids.Get(id)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn get.(DeserializeMiddleware), ok\n}\n\n// Add injects the middleware to the relative position of the middleware group.\n// Returns an error if the middleware already exists.\nfunc (s *DeserializeStep) Add(m DeserializeMiddleware, pos RelativePosition) error {\n\treturn s.ids.Add(m, pos)\n}\n\n// Insert injects the middleware relative to an existing middleware ID.\n// Returns error if the original middleware does not exist, or the middleware\n// being added already exists.\nfunc (s *DeserializeStep) Insert(m DeserializeMiddleware, relativeTo string, pos RelativePosition) error {\n\treturn s.ids.Insert(m, relativeTo, pos)\n}\n\n// Swap removes the middleware by id, replacing it with the new middleware.\n// Returns the middleware removed, or error if the middleware to be removed\n// doesn't exist.\nfunc (s *DeserializeStep) Swap(id string, m DeserializeMiddleware) (DeserializeMiddleware, error) {\n\tremoved, err := s.ids.Swap(id, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(DeserializeMiddleware), nil\n}\n\n// Remove removes the middleware by id. Returns error if the middleware\n// doesn't exist.\nfunc (s *DeserializeStep) Remove(id string) (DeserializeMiddleware, error) {\n\tremoved, err := s.ids.Remove(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(DeserializeMiddleware), nil\n}\n\n// List returns a list of the middleware in the step.\nfunc (s *DeserializeStep) List() []string {\n\treturn s.ids.List()\n}\n\n// Clear removes all middleware in the step.\nfunc (s *DeserializeStep) Clear() {\n\ts.ids.Clear()\n}\n\ntype deserializeWrapHandler struct {\n\tNext Handler\n}\n\nvar _ DeserializeHandler = (*deserializeWrapHandler)(nil)\n\n// HandleDeserialize implements DeserializeHandler, converts types and delegates to underlying\n// generic handler.\nfunc (w deserializeWrapHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) (\n\tout DeserializeOutput, metadata Metadata, err error,\n) {\n\tresp, metadata, err := w.Next.Handle(ctx, in.Request)\n\treturn DeserializeOutput{\n\t\tRawResponse: resp,\n\t}, metadata, err\n}\n\ntype decoratedDeserializeHandler struct {\n\tNext DeserializeHandler\n\tWith DeserializeMiddleware\n}\n\nvar _ DeserializeHandler = (*decoratedDeserializeHandler)(nil)\n\nfunc (h decoratedDeserializeHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) (\n\tout DeserializeOutput, metadata Metadata, err error,\n) {\n\treturn h.With.HandleDeserialize(ctx, in, h.Next)\n}\n\n// DeserializeHandlerFunc provides a wrapper around a function to be used as a deserialize middleware handler.\ntype DeserializeHandlerFunc func(context.Context, DeserializeInput) (DeserializeOutput, Metadata, error)\n\n// HandleDeserialize invokes the wrapped function with the given arguments.\nfunc (d DeserializeHandlerFunc) HandleDeserialize(ctx context.Context, in DeserializeInput) (DeserializeOutput, Metadata, error) {\n\treturn d(ctx, in)\n}\n\nvar _ DeserializeHandler = DeserializeHandlerFunc(nil)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/step_finalize.go",
    "content": "package middleware\n\nimport \"context\"\n\n// FinalizeInput provides the input parameters for the FinalizeMiddleware to\n// consume. FinalizeMiddleware may modify the Request value before forwarding\n// the FinalizeInput along to the next next FinalizeHandler.\ntype FinalizeInput struct {\n\tRequest interface{}\n}\n\n// FinalizeOutput provides the result returned by the next FinalizeHandler.\ntype FinalizeOutput struct {\n\tResult interface{}\n}\n\n// FinalizeHandler provides the interface for the next handler the\n// FinalizeMiddleware will call in the middleware chain.\ntype FinalizeHandler interface {\n\tHandleFinalize(ctx context.Context, in FinalizeInput) (\n\t\tout FinalizeOutput, metadata Metadata, err error,\n\t)\n}\n\n// FinalizeMiddleware provides the interface for middleware specific to the\n// serialize step. Delegates to the next FinalizeHandler for further\n// processing.\ntype FinalizeMiddleware interface {\n\t// ID returns a unique ID for the middleware in the FinalizeStep. The step does not\n\t// allow duplicate IDs.\n\tID() string\n\n\t// HandleFinalize invokes the middleware behavior which must delegate to the next handler\n\t// for the middleware chain to continue. The method must return a result or\n\t// error to its caller.\n\tHandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) (\n\t\tout FinalizeOutput, metadata Metadata, err error,\n\t)\n}\n\n// FinalizeMiddlewareFunc returns a FinalizeMiddleware with the unique ID\n// provided, and the func to be invoked.\nfunc FinalizeMiddlewareFunc(id string, fn func(context.Context, FinalizeInput, FinalizeHandler) (FinalizeOutput, Metadata, error)) FinalizeMiddleware {\n\treturn finalizeMiddlewareFunc{\n\t\tid: id,\n\t\tfn: fn,\n\t}\n}\n\ntype finalizeMiddlewareFunc struct {\n\t// Unique ID for the middleware.\n\tid string\n\n\t// Middleware function to be called.\n\tfn func(context.Context, FinalizeInput, FinalizeHandler) (\n\t\tFinalizeOutput, Metadata, error,\n\t)\n}\n\n// ID returns the unique ID for the middleware.\nfunc (s finalizeMiddlewareFunc) ID() string { return s.id }\n\n// HandleFinalize invokes the middleware Fn.\nfunc (s finalizeMiddlewareFunc) HandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) (\n\tout FinalizeOutput, metadata Metadata, err error,\n) {\n\treturn s.fn(ctx, in, next)\n}\n\nvar _ FinalizeMiddleware = (finalizeMiddlewareFunc{})\n\n// FinalizeStep provides the ordered grouping of FinalizeMiddleware to be\n// invoked on a handler.\ntype FinalizeStep struct {\n\tids *orderedIDs\n}\n\n// NewFinalizeStep returns a FinalizeStep ready to have middleware for\n// initialization added to it.\nfunc NewFinalizeStep() *FinalizeStep {\n\treturn &FinalizeStep{\n\t\tids: newOrderedIDs(),\n\t}\n}\n\nvar _ Middleware = (*FinalizeStep)(nil)\n\n// ID returns the unique id of the step as a middleware.\nfunc (s *FinalizeStep) ID() string {\n\treturn \"Finalize stack step\"\n}\n\n// HandleMiddleware invokes the middleware by decorating the next handler\n// provided. Returns the result of the middleware and handler being invoked.\n//\n// Implements Middleware interface.\nfunc (s *FinalizeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) (\n\tout interface{}, metadata Metadata, err error,\n) {\n\torder := s.ids.GetOrder()\n\n\tvar h FinalizeHandler = finalizeWrapHandler{Next: next}\n\tfor i := len(order) - 1; i >= 0; i-- {\n\t\th = decoratedFinalizeHandler{\n\t\t\tNext: h,\n\t\t\tWith: order[i].(FinalizeMiddleware),\n\t\t}\n\t}\n\n\tsIn := FinalizeInput{\n\t\tRequest: in,\n\t}\n\n\tres, metadata, err := h.HandleFinalize(ctx, sIn)\n\treturn res.Result, metadata, err\n}\n\n// Get retrieves the middleware identified by id. If the middleware is not present, returns false.\nfunc (s *FinalizeStep) Get(id string) (FinalizeMiddleware, bool) {\n\tget, ok := s.ids.Get(id)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn get.(FinalizeMiddleware), ok\n}\n\n// Add injects the middleware to the relative position of the middleware group.\n// Returns an error if the middleware already exists.\nfunc (s *FinalizeStep) Add(m FinalizeMiddleware, pos RelativePosition) error {\n\treturn s.ids.Add(m, pos)\n}\n\n// Insert injects the middleware relative to an existing middleware ID.\n// Returns error if the original middleware does not exist, or the middleware\n// being added already exists.\nfunc (s *FinalizeStep) Insert(m FinalizeMiddleware, relativeTo string, pos RelativePosition) error {\n\treturn s.ids.Insert(m, relativeTo, pos)\n}\n\n// Swap removes the middleware by id, replacing it with the new middleware.\n// Returns the middleware removed, or error if the middleware to be removed\n// doesn't exist.\nfunc (s *FinalizeStep) Swap(id string, m FinalizeMiddleware) (FinalizeMiddleware, error) {\n\tremoved, err := s.ids.Swap(id, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(FinalizeMiddleware), nil\n}\n\n// Remove removes the middleware by id. Returns error if the middleware\n// doesn't exist.\nfunc (s *FinalizeStep) Remove(id string) (FinalizeMiddleware, error) {\n\tremoved, err := s.ids.Remove(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(FinalizeMiddleware), nil\n}\n\n// List returns a list of the middleware in the step.\nfunc (s *FinalizeStep) List() []string {\n\treturn s.ids.List()\n}\n\n// Clear removes all middleware in the step.\nfunc (s *FinalizeStep) Clear() {\n\ts.ids.Clear()\n}\n\ntype finalizeWrapHandler struct {\n\tNext Handler\n}\n\nvar _ FinalizeHandler = (*finalizeWrapHandler)(nil)\n\n// HandleFinalize implements FinalizeHandler, converts types and delegates to underlying\n// generic handler.\nfunc (w finalizeWrapHandler) HandleFinalize(ctx context.Context, in FinalizeInput) (\n\tout FinalizeOutput, metadata Metadata, err error,\n) {\n\tres, metadata, err := w.Next.Handle(ctx, in.Request)\n\treturn FinalizeOutput{\n\t\tResult: res,\n\t}, metadata, err\n}\n\ntype decoratedFinalizeHandler struct {\n\tNext FinalizeHandler\n\tWith FinalizeMiddleware\n}\n\nvar _ FinalizeHandler = (*decoratedFinalizeHandler)(nil)\n\nfunc (h decoratedFinalizeHandler) HandleFinalize(ctx context.Context, in FinalizeInput) (\n\tout FinalizeOutput, metadata Metadata, err error,\n) {\n\treturn h.With.HandleFinalize(ctx, in, h.Next)\n}\n\n// FinalizeHandlerFunc provides a wrapper around a function to be used as a finalize middleware handler.\ntype FinalizeHandlerFunc func(context.Context, FinalizeInput) (FinalizeOutput, Metadata, error)\n\n// HandleFinalize invokes the wrapped function with the given arguments.\nfunc (f FinalizeHandlerFunc) HandleFinalize(ctx context.Context, in FinalizeInput) (FinalizeOutput, Metadata, error) {\n\treturn f(ctx, in)\n}\n\nvar _ FinalizeHandler = FinalizeHandlerFunc(nil)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/step_initialize.go",
    "content": "package middleware\n\nimport \"context\"\n\n// InitializeInput wraps the input parameters for the InitializeMiddlewares to\n// consume. InitializeMiddleware may modify the parameter value before\n// forwarding it along to the next InitializeHandler.\ntype InitializeInput struct {\n\tParameters interface{}\n}\n\n// InitializeOutput provides the result returned by the next InitializeHandler.\ntype InitializeOutput struct {\n\tResult interface{}\n}\n\n// InitializeHandler provides the interface for the next handler the\n// InitializeMiddleware will call in the middleware chain.\ntype InitializeHandler interface {\n\tHandleInitialize(ctx context.Context, in InitializeInput) (\n\t\tout InitializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// InitializeMiddleware provides the interface for middleware specific to the\n// initialize step. Delegates to the next InitializeHandler for further\n// processing.\ntype InitializeMiddleware interface {\n\t// ID returns a unique ID for the middleware in the InitializeStep. The step does not\n\t// allow duplicate IDs.\n\tID() string\n\n\t// HandleInitialize invokes the middleware behavior which must delegate to the next handler\n\t// for the middleware chain to continue. The method must return a result or\n\t// error to its caller.\n\tHandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) (\n\t\tout InitializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// InitializeMiddlewareFunc returns a InitializeMiddleware with the unique ID provided,\n// and the func to be invoked.\nfunc InitializeMiddlewareFunc(id string, fn func(context.Context, InitializeInput, InitializeHandler) (InitializeOutput, Metadata, error)) InitializeMiddleware {\n\treturn initializeMiddlewareFunc{\n\t\tid: id,\n\t\tfn: fn,\n\t}\n}\n\ntype initializeMiddlewareFunc struct {\n\t// Unique ID for the middleware.\n\tid string\n\n\t// Middleware function to be called.\n\tfn func(context.Context, InitializeInput, InitializeHandler) (\n\t\tInitializeOutput, Metadata, error,\n\t)\n}\n\n// ID returns the unique ID for the middleware.\nfunc (s initializeMiddlewareFunc) ID() string { return s.id }\n\n// HandleInitialize invokes the middleware Fn.\nfunc (s initializeMiddlewareFunc) HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) (\n\tout InitializeOutput, metadata Metadata, err error,\n) {\n\treturn s.fn(ctx, in, next)\n}\n\nvar _ InitializeMiddleware = (initializeMiddlewareFunc{})\n\n// InitializeStep provides the ordered grouping of InitializeMiddleware to be\n// invoked on a handler.\ntype InitializeStep struct {\n\tids *orderedIDs\n}\n\n// NewInitializeStep returns an InitializeStep ready to have middleware for\n// initialization added to it.\nfunc NewInitializeStep() *InitializeStep {\n\treturn &InitializeStep{\n\t\tids: newOrderedIDs(),\n\t}\n}\n\nvar _ Middleware = (*InitializeStep)(nil)\n\n// ID returns the unique ID of the step as a middleware.\nfunc (s *InitializeStep) ID() string {\n\treturn \"Initialize stack step\"\n}\n\n// HandleMiddleware invokes the middleware by decorating the next handler\n// provided. Returns the result of the middleware and handler being invoked.\n//\n// Implements Middleware interface.\nfunc (s *InitializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) (\n\tout interface{}, metadata Metadata, err error,\n) {\n\torder := s.ids.GetOrder()\n\n\tvar h InitializeHandler = initializeWrapHandler{Next: next}\n\tfor i := len(order) - 1; i >= 0; i-- {\n\t\th = decoratedInitializeHandler{\n\t\t\tNext: h,\n\t\t\tWith: order[i].(InitializeMiddleware),\n\t\t}\n\t}\n\n\tsIn := InitializeInput{\n\t\tParameters: in,\n\t}\n\n\tres, metadata, err := h.HandleInitialize(ctx, sIn)\n\treturn res.Result, metadata, err\n}\n\n// Get retrieves the middleware identified by id. If the middleware is not present, returns false.\nfunc (s *InitializeStep) Get(id string) (InitializeMiddleware, bool) {\n\tget, ok := s.ids.Get(id)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn get.(InitializeMiddleware), ok\n}\n\n// Add injects the middleware to the relative position of the middleware group.\n// Returns an error if the middleware already exists.\nfunc (s *InitializeStep) Add(m InitializeMiddleware, pos RelativePosition) error {\n\treturn s.ids.Add(m, pos)\n}\n\n// Insert injects the middleware relative to an existing middleware ID.\n// Returns error if the original middleware does not exist, or the middleware\n// being added already exists.\nfunc (s *InitializeStep) Insert(m InitializeMiddleware, relativeTo string, pos RelativePosition) error {\n\treturn s.ids.Insert(m, relativeTo, pos)\n}\n\n// Swap removes the middleware by id, replacing it with the new middleware.\n// Returns the middleware removed, or error if the middleware to be removed\n// doesn't exist.\nfunc (s *InitializeStep) Swap(id string, m InitializeMiddleware) (InitializeMiddleware, error) {\n\tremoved, err := s.ids.Swap(id, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(InitializeMiddleware), nil\n}\n\n// Remove removes the middleware by id. Returns error if the middleware\n// doesn't exist.\nfunc (s *InitializeStep) Remove(id string) (InitializeMiddleware, error) {\n\tremoved, err := s.ids.Remove(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(InitializeMiddleware), nil\n}\n\n// List returns a list of the middleware in the step.\nfunc (s *InitializeStep) List() []string {\n\treturn s.ids.List()\n}\n\n// Clear removes all middleware in the step.\nfunc (s *InitializeStep) Clear() {\n\ts.ids.Clear()\n}\n\ntype initializeWrapHandler struct {\n\tNext Handler\n}\n\nvar _ InitializeHandler = (*initializeWrapHandler)(nil)\n\n// HandleInitialize implements InitializeHandler, converts types and delegates to underlying\n// generic handler.\nfunc (w initializeWrapHandler) HandleInitialize(ctx context.Context, in InitializeInput) (\n\tout InitializeOutput, metadata Metadata, err error,\n) {\n\tres, metadata, err := w.Next.Handle(ctx, in.Parameters)\n\treturn InitializeOutput{\n\t\tResult: res,\n\t}, metadata, err\n}\n\ntype decoratedInitializeHandler struct {\n\tNext InitializeHandler\n\tWith InitializeMiddleware\n}\n\nvar _ InitializeHandler = (*decoratedInitializeHandler)(nil)\n\nfunc (h decoratedInitializeHandler) HandleInitialize(ctx context.Context, in InitializeInput) (\n\tout InitializeOutput, metadata Metadata, err error,\n) {\n\treturn h.With.HandleInitialize(ctx, in, h.Next)\n}\n\n// InitializeHandlerFunc provides a wrapper around a function to be used as an initialize middleware handler.\ntype InitializeHandlerFunc func(context.Context, InitializeInput) (InitializeOutput, Metadata, error)\n\n// HandleInitialize calls the wrapped function with the provided arguments.\nfunc (i InitializeHandlerFunc) HandleInitialize(ctx context.Context, in InitializeInput) (InitializeOutput, Metadata, error) {\n\treturn i(ctx, in)\n}\n\nvar _ InitializeHandler = InitializeHandlerFunc(nil)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/middleware/step_serialize.go",
    "content": "package middleware\n\nimport \"context\"\n\n// SerializeInput provides the input parameters for the SerializeMiddleware to\n// consume. SerializeMiddleware may modify the Request value before forwarding\n// SerializeInput along to the next SerializeHandler. The Parameters member\n// should not be modified by SerializeMiddleware, InitializeMiddleware should\n// be responsible for modifying the provided Parameter value.\ntype SerializeInput struct {\n\tParameters interface{}\n\tRequest    interface{}\n}\n\n// SerializeOutput provides the result returned by the next SerializeHandler.\ntype SerializeOutput struct {\n\tResult interface{}\n}\n\n// SerializeHandler provides the interface for the next handler the\n// SerializeMiddleware will call in the middleware chain.\ntype SerializeHandler interface {\n\tHandleSerialize(ctx context.Context, in SerializeInput) (\n\t\tout SerializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// SerializeMiddleware provides the interface for middleware specific to the\n// serialize step. Delegates to the next SerializeHandler for further\n// processing.\ntype SerializeMiddleware interface {\n\t// ID returns a unique ID for the middleware in the SerializeStep. The step does not\n\t// allow duplicate IDs.\n\tID() string\n\n\t// HandleSerialize invokes the middleware behavior which must delegate to the next handler\n\t// for the middleware chain to continue. The method must return a result or\n\t// error to its caller.\n\tHandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) (\n\t\tout SerializeOutput, metadata Metadata, err error,\n\t)\n}\n\n// SerializeMiddlewareFunc returns a SerializeMiddleware with the unique ID\n// provided, and the func to be invoked.\nfunc SerializeMiddlewareFunc(id string, fn func(context.Context, SerializeInput, SerializeHandler) (SerializeOutput, Metadata, error)) SerializeMiddleware {\n\treturn serializeMiddlewareFunc{\n\t\tid: id,\n\t\tfn: fn,\n\t}\n}\n\ntype serializeMiddlewareFunc struct {\n\t// Unique ID for the middleware.\n\tid string\n\n\t// Middleware function to be called.\n\tfn func(context.Context, SerializeInput, SerializeHandler) (\n\t\tSerializeOutput, Metadata, error,\n\t)\n}\n\n// ID returns the unique ID for the middleware.\nfunc (s serializeMiddlewareFunc) ID() string { return s.id }\n\n// HandleSerialize invokes the middleware Fn.\nfunc (s serializeMiddlewareFunc) HandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) (\n\tout SerializeOutput, metadata Metadata, err error,\n) {\n\treturn s.fn(ctx, in, next)\n}\n\nvar _ SerializeMiddleware = (serializeMiddlewareFunc{})\n\n// SerializeStep provides the ordered grouping of SerializeMiddleware to be\n// invoked on a handler.\ntype SerializeStep struct {\n\tnewRequest func() interface{}\n\tids        *orderedIDs\n}\n\n// NewSerializeStep returns a SerializeStep ready to have middleware for\n// initialization added to it. The newRequest func parameter is used to\n// initialize the transport specific request for the stack SerializeStep to\n// serialize the input parameters into.\nfunc NewSerializeStep(newRequest func() interface{}) *SerializeStep {\n\treturn &SerializeStep{\n\t\tids:        newOrderedIDs(),\n\t\tnewRequest: newRequest,\n\t}\n}\n\nvar _ Middleware = (*SerializeStep)(nil)\n\n// ID returns the unique ID of the step as a middleware.\nfunc (s *SerializeStep) ID() string {\n\treturn \"Serialize stack step\"\n}\n\n// HandleMiddleware invokes the middleware by decorating the next handler\n// provided. Returns the result of the middleware and handler being invoked.\n//\n// Implements Middleware interface.\nfunc (s *SerializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) (\n\tout interface{}, metadata Metadata, err error,\n) {\n\torder := s.ids.GetOrder()\n\n\tvar h SerializeHandler = serializeWrapHandler{Next: next}\n\tfor i := len(order) - 1; i >= 0; i-- {\n\t\th = decoratedSerializeHandler{\n\t\t\tNext: h,\n\t\t\tWith: order[i].(SerializeMiddleware),\n\t\t}\n\t}\n\n\tsIn := SerializeInput{\n\t\tParameters: in,\n\t\tRequest:    s.newRequest(),\n\t}\n\n\tres, metadata, err := h.HandleSerialize(ctx, sIn)\n\treturn res.Result, metadata, err\n}\n\n// Get retrieves the middleware identified by id. If the middleware is not present, returns false.\nfunc (s *SerializeStep) Get(id string) (SerializeMiddleware, bool) {\n\tget, ok := s.ids.Get(id)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn get.(SerializeMiddleware), ok\n}\n\n// Add injects the middleware to the relative position of the middleware group.\n// Returns an error if the middleware already exists.\nfunc (s *SerializeStep) Add(m SerializeMiddleware, pos RelativePosition) error {\n\treturn s.ids.Add(m, pos)\n}\n\n// Insert injects the middleware relative to an existing middleware ID.\n// Returns error if the original middleware does not exist, or the middleware\n// being added already exists.\nfunc (s *SerializeStep) Insert(m SerializeMiddleware, relativeTo string, pos RelativePosition) error {\n\treturn s.ids.Insert(m, relativeTo, pos)\n}\n\n// Swap removes the middleware by id, replacing it with the new middleware.\n// Returns the middleware removed, or error if the middleware to be removed\n// doesn't exist.\nfunc (s *SerializeStep) Swap(id string, m SerializeMiddleware) (SerializeMiddleware, error) {\n\tremoved, err := s.ids.Swap(id, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(SerializeMiddleware), nil\n}\n\n// Remove removes the middleware by id. Returns error if the middleware\n// doesn't exist.\nfunc (s *SerializeStep) Remove(id string) (SerializeMiddleware, error) {\n\tremoved, err := s.ids.Remove(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn removed.(SerializeMiddleware), nil\n}\n\n// List returns a list of the middleware in the step.\nfunc (s *SerializeStep) List() []string {\n\treturn s.ids.List()\n}\n\n// Clear removes all middleware in the step.\nfunc (s *SerializeStep) Clear() {\n\ts.ids.Clear()\n}\n\ntype serializeWrapHandler struct {\n\tNext Handler\n}\n\nvar _ SerializeHandler = (*serializeWrapHandler)(nil)\n\n// Implements SerializeHandler, converts types and delegates to underlying\n// generic handler.\nfunc (w serializeWrapHandler) HandleSerialize(ctx context.Context, in SerializeInput) (\n\tout SerializeOutput, metadata Metadata, err error,\n) {\n\tres, metadata, err := w.Next.Handle(ctx, in.Request)\n\treturn SerializeOutput{\n\t\tResult: res,\n\t}, metadata, err\n}\n\ntype decoratedSerializeHandler struct {\n\tNext SerializeHandler\n\tWith SerializeMiddleware\n}\n\nvar _ SerializeHandler = (*decoratedSerializeHandler)(nil)\n\nfunc (h decoratedSerializeHandler) HandleSerialize(ctx context.Context, in SerializeInput) (\n\tout SerializeOutput, metadata Metadata, err error,\n) {\n\treturn h.With.HandleSerialize(ctx, in, h.Next)\n}\n\n// SerializeHandlerFunc provides a wrapper around a function to be used as a serialize middleware handler.\ntype SerializeHandlerFunc func(context.Context, SerializeInput) (SerializeOutput, Metadata, error)\n\n// HandleSerialize calls the wrapped function with the provided arguments.\nfunc (s SerializeHandlerFunc) HandleSerialize(ctx context.Context, in SerializeInput) (SerializeOutput, Metadata, error) {\n\treturn s(ctx, in)\n}\n\nvar _ SerializeHandler = SerializeHandlerFunc(nil)\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/modman.toml",
    "content": "[dependencies]\n  \"github.com/jmespath/go-jmespath\" = \"v0.4.0\"\n\n[modules]\n\n  [modules.codegen]\n    no_tag = true\n\n  [modules.\"codegen/smithy-go-codegen/build/test-generated/go/internal/testmodule\"]\n    no_tag = true\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go",
    "content": "package requestcompression\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"fmt\"\n\t\"io\"\n)\n\nfunc gzipCompress(input io.Reader) ([]byte, error) {\n\tvar b bytes.Buffer\n\tw, err := gzip.NewWriterLevel(&b, gzip.DefaultCompression)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create gzip writer, %v\", err)\n\t}\n\n\tinBytes, err := io.ReadAll(input)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed read payload to compress, %v\", err)\n\t}\n\n\tif _, err = w.Write(inBytes); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to write payload to be compressed, %v\", err)\n\t}\n\tif err = w.Close(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to flush payload being compressed, %v\", err)\n\t}\n\n\treturn b.Bytes(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go",
    "content": "package requestcompression\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/middleware\"\n\tsmithyhttp \"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n\t\"net/http\"\n)\n\nconst captureUncompressedRequestID = \"CaptureUncompressedRequest\"\n\n// AddCaptureUncompressedRequestMiddleware captures http request before compress encoding for check\nfunc AddCaptureUncompressedRequestMiddleware(stack *middleware.Stack, buf *bytes.Buffer) error {\n\treturn stack.Serialize.Insert(&captureUncompressedRequestMiddleware{\n\t\tbuf: buf,\n\t}, \"RequestCompression\", middleware.Before)\n}\n\ntype captureUncompressedRequestMiddleware struct {\n\treq   *http.Request\n\tbuf   *bytes.Buffer\n\tbytes []byte\n}\n\n// ID returns id of the captureUncompressedRequestMiddleware\nfunc (*captureUncompressedRequestMiddleware) ID() string {\n\treturn captureUncompressedRequestID\n}\n\n// HandleSerialize captures request payload before it is compressed by request compression middleware\nfunc (m *captureUncompressedRequestMiddleware) HandleSerialize(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\toutput middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\trequest, ok := input.Request.(*smithyhttp.Request)\n\tif !ok {\n\t\treturn output, metadata, fmt.Errorf(\"error when retrieving http request\")\n\t}\n\n\t_, err = io.Copy(m.buf, request.GetStream())\n\tif err != nil {\n\t\treturn output, metadata, fmt.Errorf(\"error when copying http request stream: %q\", err)\n\t}\n\tif err = request.RewindStream(); err != nil {\n\t\treturn output, metadata, fmt.Errorf(\"error when rewinding request stream: %q\", err)\n\t}\n\n\treturn next.HandleSerialize(ctx, input)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go",
    "content": "// Package requestcompression implements runtime support for smithy-modeled\n// request compression.\n//\n// This package is designated as private and is intended for use only by the\n// smithy client runtime. The exported API therein is not considered stable and\n// is subject to breaking changes without notice.\npackage requestcompression\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/transport/http\"\n\t\"io\"\n)\n\nconst MaxRequestMinCompressSizeBytes = 10485760\n\n// Enumeration values for supported compress Algorithms.\nconst (\n\tGZIP = \"gzip\"\n)\n\ntype compressFunc func(io.Reader) ([]byte, error)\n\nvar allowedAlgorithms = map[string]compressFunc{\n\tGZIP: gzipCompress,\n}\n\n// AddRequestCompression add requestCompression middleware to op stack\nfunc AddRequestCompression(stack *middleware.Stack, disabled bool, minBytes int64, algorithms []string) error {\n\treturn stack.Serialize.Add(&requestCompression{\n\t\tdisableRequestCompression:   disabled,\n\t\trequestMinCompressSizeBytes: minBytes,\n\t\tcompressAlgorithms:          algorithms,\n\t}, middleware.After)\n}\n\ntype requestCompression struct {\n\tdisableRequestCompression   bool\n\trequestMinCompressSizeBytes int64\n\tcompressAlgorithms          []string\n}\n\n// ID returns the ID of the middleware\nfunc (m requestCompression) ID() string {\n\treturn \"RequestCompression\"\n}\n\n// HandleSerialize gzip compress the request's stream/body if enabled by config fields\nfunc (m requestCompression) HandleSerialize(\n\tctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, metadata middleware.Metadata, err error,\n) {\n\tif m.disableRequestCompression {\n\t\treturn next.HandleSerialize(ctx, in)\n\t}\n\t// still need to check requestMinCompressSizeBytes in case it is out of range after service client config\n\tif m.requestMinCompressSizeBytes < 0 || m.requestMinCompressSizeBytes > MaxRequestMinCompressSizeBytes {\n\t\treturn out, metadata, fmt.Errorf(\"invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively\", m.requestMinCompressSizeBytes)\n\t}\n\n\treq, ok := in.Request.(*http.Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown request type %T\", req)\n\t}\n\n\tfor _, algorithm := range m.compressAlgorithms {\n\t\tcompressFunc := allowedAlgorithms[algorithm]\n\t\tif compressFunc != nil {\n\t\t\tif stream := req.GetStream(); stream != nil {\n\t\t\t\tsize, found, err := req.StreamLength()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn out, metadata, fmt.Errorf(\"error while finding request stream length, %v\", err)\n\t\t\t\t} else if !found || size < m.requestMinCompressSizeBytes {\n\t\t\t\t\treturn next.HandleSerialize(ctx, in)\n\t\t\t\t}\n\n\t\t\t\tcompressedBytes, err := compressFunc(stream)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn out, metadata, fmt.Errorf(\"failed to compress request stream, %v\", err)\n\t\t\t\t}\n\n\t\t\t\tvar newReq *http.Request\n\t\t\t\tif newReq, err = req.SetStream(bytes.NewReader(compressedBytes)); err != nil {\n\t\t\t\t\treturn out, metadata, fmt.Errorf(\"failed to set request stream, %v\", err)\n\t\t\t\t}\n\t\t\t\t*req = *newReq\n\n\t\t\t\tif val := req.Header.Get(\"Content-Encoding\"); val != \"\" {\n\t\t\t\t\treq.Header.Set(\"Content-Encoding\", fmt.Sprintf(\"%s, %s\", val, algorithm))\n\t\t\t\t} else {\n\t\t\t\t\treq.Header.Set(\"Content-Encoding\", algorithm)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn next.HandleSerialize(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/properties.go",
    "content": "package smithy\n\n// PropertiesReader provides an interface for reading metadata from the\n// underlying metadata container.\ntype PropertiesReader interface {\n\tGet(key interface{}) interface{}\n}\n\n// Properties provides storing and reading metadata values. Keys may be any\n// comparable value type. Get and Set will panic if a key is not comparable.\n//\n// The zero value for a Properties instance is ready for reads/writes without\n// any additional initialization.\ntype Properties struct {\n\tvalues map[interface{}]interface{}\n}\n\n// Get attempts to retrieve the value the key points to. Returns nil if the\n// key was not found.\n//\n// Panics if key type is not comparable.\nfunc (m *Properties) Get(key interface{}) interface{} {\n\tm.lazyInit()\n\treturn m.values[key]\n}\n\n// Set stores the value pointed to by the key. If a value already exists at\n// that key it will be replaced with the new value.\n//\n// Panics if the key type is not comparable.\nfunc (m *Properties) Set(key, value interface{}) {\n\tm.lazyInit()\n\tm.values[key] = value\n}\n\n// Has returns whether the key exists in the metadata.\n//\n// Panics if the key type is not comparable.\nfunc (m *Properties) Has(key interface{}) bool {\n\tm.lazyInit()\n\t_, ok := m.values[key]\n\treturn ok\n}\n\n// SetAll accepts all of the given Properties into the receiver, overwriting\n// any existing keys in the case of conflicts.\nfunc (m *Properties) SetAll(other *Properties) {\n\tif other.values == nil {\n\t\treturn\n\t}\n\n\tm.lazyInit()\n\tfor k, v := range other.values {\n\t\tm.values[k] = v\n\t}\n}\n\nfunc (m *Properties) lazyInit() {\n\tif m.values == nil {\n\t\tm.values = map[interface{}]interface{}{}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/ptr/doc.go",
    "content": "// Package ptr provides utilities for converting scalar literal type values to and from pointers inline.\npackage ptr\n\n//go:generate go run -tags codegen generate.go\n//go:generate gofmt -w -s .\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/ptr/from_ptr.go",
    "content": "// Code generated by smithy-go/ptr/generate.go DO NOT EDIT.\npackage ptr\n\nimport (\n\t\"time\"\n)\n\n// ToBool returns bool value dereferenced if the passed\n// in pointer was not nil. Returns a bool zero value if the\n// pointer was nil.\nfunc ToBool(p *bool) (v bool) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToBoolSlice returns a slice of bool values, that are\n// dereferenced if the passed in pointer was not nil. Returns a bool\n// zero value if the pointer was nil.\nfunc ToBoolSlice(vs []*bool) []bool {\n\tps := make([]bool, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToBool(v)\n\t}\n\n\treturn ps\n}\n\n// ToBoolMap returns a map of bool values, that are\n// dereferenced if the passed in pointer was not nil. The bool\n// zero value is used if the pointer was nil.\nfunc ToBoolMap(vs map[string]*bool) map[string]bool {\n\tps := make(map[string]bool, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToBool(v)\n\t}\n\n\treturn ps\n}\n\n// ToByte returns byte value dereferenced if the passed\n// in pointer was not nil. Returns a byte zero value if the\n// pointer was nil.\nfunc ToByte(p *byte) (v byte) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToByteSlice returns a slice of byte values, that are\n// dereferenced if the passed in pointer was not nil. Returns a byte\n// zero value if the pointer was nil.\nfunc ToByteSlice(vs []*byte) []byte {\n\tps := make([]byte, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToByte(v)\n\t}\n\n\treturn ps\n}\n\n// ToByteMap returns a map of byte values, that are\n// dereferenced if the passed in pointer was not nil. The byte\n// zero value is used if the pointer was nil.\nfunc ToByteMap(vs map[string]*byte) map[string]byte {\n\tps := make(map[string]byte, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToByte(v)\n\t}\n\n\treturn ps\n}\n\n// ToString returns string value dereferenced if the passed\n// in pointer was not nil. Returns a string zero value if the\n// pointer was nil.\nfunc ToString(p *string) (v string) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToStringSlice returns a slice of string values, that are\n// dereferenced if the passed in pointer was not nil. Returns a string\n// zero value if the pointer was nil.\nfunc ToStringSlice(vs []*string) []string {\n\tps := make([]string, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToString(v)\n\t}\n\n\treturn ps\n}\n\n// ToStringMap returns a map of string values, that are\n// dereferenced if the passed in pointer was not nil. The string\n// zero value is used if the pointer was nil.\nfunc ToStringMap(vs map[string]*string) map[string]string {\n\tps := make(map[string]string, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToString(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt returns int value dereferenced if the passed\n// in pointer was not nil. Returns a int zero value if the\n// pointer was nil.\nfunc ToInt(p *int) (v int) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToIntSlice returns a slice of int values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int\n// zero value if the pointer was nil.\nfunc ToIntSlice(vs []*int) []int {\n\tps := make([]int, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToInt(v)\n\t}\n\n\treturn ps\n}\n\n// ToIntMap returns a map of int values, that are\n// dereferenced if the passed in pointer was not nil. The int\n// zero value is used if the pointer was nil.\nfunc ToIntMap(vs map[string]*int) map[string]int {\n\tps := make(map[string]int, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToInt(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt8 returns int8 value dereferenced if the passed\n// in pointer was not nil. Returns a int8 zero value if the\n// pointer was nil.\nfunc ToInt8(p *int8) (v int8) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToInt8Slice returns a slice of int8 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int8\n// zero value if the pointer was nil.\nfunc ToInt8Slice(vs []*int8) []int8 {\n\tps := make([]int8, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToInt8(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt8Map returns a map of int8 values, that are\n// dereferenced if the passed in pointer was not nil. The int8\n// zero value is used if the pointer was nil.\nfunc ToInt8Map(vs map[string]*int8) map[string]int8 {\n\tps := make(map[string]int8, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToInt8(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt16 returns int16 value dereferenced if the passed\n// in pointer was not nil. Returns a int16 zero value if the\n// pointer was nil.\nfunc ToInt16(p *int16) (v int16) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToInt16Slice returns a slice of int16 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int16\n// zero value if the pointer was nil.\nfunc ToInt16Slice(vs []*int16) []int16 {\n\tps := make([]int16, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToInt16(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt16Map returns a map of int16 values, that are\n// dereferenced if the passed in pointer was not nil. The int16\n// zero value is used if the pointer was nil.\nfunc ToInt16Map(vs map[string]*int16) map[string]int16 {\n\tps := make(map[string]int16, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToInt16(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt32 returns int32 value dereferenced if the passed\n// in pointer was not nil. Returns a int32 zero value if the\n// pointer was nil.\nfunc ToInt32(p *int32) (v int32) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToInt32Slice returns a slice of int32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int32\n// zero value if the pointer was nil.\nfunc ToInt32Slice(vs []*int32) []int32 {\n\tps := make([]int32, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToInt32(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt32Map returns a map of int32 values, that are\n// dereferenced if the passed in pointer was not nil. The int32\n// zero value is used if the pointer was nil.\nfunc ToInt32Map(vs map[string]*int32) map[string]int32 {\n\tps := make(map[string]int32, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToInt32(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt64 returns int64 value dereferenced if the passed\n// in pointer was not nil. Returns a int64 zero value if the\n// pointer was nil.\nfunc ToInt64(p *int64) (v int64) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToInt64Slice returns a slice of int64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a int64\n// zero value if the pointer was nil.\nfunc ToInt64Slice(vs []*int64) []int64 {\n\tps := make([]int64, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToInt64(v)\n\t}\n\n\treturn ps\n}\n\n// ToInt64Map returns a map of int64 values, that are\n// dereferenced if the passed in pointer was not nil. The int64\n// zero value is used if the pointer was nil.\nfunc ToInt64Map(vs map[string]*int64) map[string]int64 {\n\tps := make(map[string]int64, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToInt64(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint returns uint value dereferenced if the passed\n// in pointer was not nil. Returns a uint zero value if the\n// pointer was nil.\nfunc ToUint(p *uint) (v uint) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToUintSlice returns a slice of uint values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint\n// zero value if the pointer was nil.\nfunc ToUintSlice(vs []*uint) []uint {\n\tps := make([]uint, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToUint(v)\n\t}\n\n\treturn ps\n}\n\n// ToUintMap returns a map of uint values, that are\n// dereferenced if the passed in pointer was not nil. The uint\n// zero value is used if the pointer was nil.\nfunc ToUintMap(vs map[string]*uint) map[string]uint {\n\tps := make(map[string]uint, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToUint(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint8 returns uint8 value dereferenced if the passed\n// in pointer was not nil. Returns a uint8 zero value if the\n// pointer was nil.\nfunc ToUint8(p *uint8) (v uint8) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToUint8Slice returns a slice of uint8 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint8\n// zero value if the pointer was nil.\nfunc ToUint8Slice(vs []*uint8) []uint8 {\n\tps := make([]uint8, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToUint8(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint8Map returns a map of uint8 values, that are\n// dereferenced if the passed in pointer was not nil. The uint8\n// zero value is used if the pointer was nil.\nfunc ToUint8Map(vs map[string]*uint8) map[string]uint8 {\n\tps := make(map[string]uint8, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToUint8(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint16 returns uint16 value dereferenced if the passed\n// in pointer was not nil. Returns a uint16 zero value if the\n// pointer was nil.\nfunc ToUint16(p *uint16) (v uint16) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToUint16Slice returns a slice of uint16 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint16\n// zero value if the pointer was nil.\nfunc ToUint16Slice(vs []*uint16) []uint16 {\n\tps := make([]uint16, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToUint16(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint16Map returns a map of uint16 values, that are\n// dereferenced if the passed in pointer was not nil. The uint16\n// zero value is used if the pointer was nil.\nfunc ToUint16Map(vs map[string]*uint16) map[string]uint16 {\n\tps := make(map[string]uint16, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToUint16(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint32 returns uint32 value dereferenced if the passed\n// in pointer was not nil. Returns a uint32 zero value if the\n// pointer was nil.\nfunc ToUint32(p *uint32) (v uint32) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToUint32Slice returns a slice of uint32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint32\n// zero value if the pointer was nil.\nfunc ToUint32Slice(vs []*uint32) []uint32 {\n\tps := make([]uint32, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToUint32(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint32Map returns a map of uint32 values, that are\n// dereferenced if the passed in pointer was not nil. The uint32\n// zero value is used if the pointer was nil.\nfunc ToUint32Map(vs map[string]*uint32) map[string]uint32 {\n\tps := make(map[string]uint32, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToUint32(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint64 returns uint64 value dereferenced if the passed\n// in pointer was not nil. Returns a uint64 zero value if the\n// pointer was nil.\nfunc ToUint64(p *uint64) (v uint64) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToUint64Slice returns a slice of uint64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a uint64\n// zero value if the pointer was nil.\nfunc ToUint64Slice(vs []*uint64) []uint64 {\n\tps := make([]uint64, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToUint64(v)\n\t}\n\n\treturn ps\n}\n\n// ToUint64Map returns a map of uint64 values, that are\n// dereferenced if the passed in pointer was not nil. The uint64\n// zero value is used if the pointer was nil.\nfunc ToUint64Map(vs map[string]*uint64) map[string]uint64 {\n\tps := make(map[string]uint64, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToUint64(v)\n\t}\n\n\treturn ps\n}\n\n// ToFloat32 returns float32 value dereferenced if the passed\n// in pointer was not nil. Returns a float32 zero value if the\n// pointer was nil.\nfunc ToFloat32(p *float32) (v float32) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToFloat32Slice returns a slice of float32 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a float32\n// zero value if the pointer was nil.\nfunc ToFloat32Slice(vs []*float32) []float32 {\n\tps := make([]float32, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToFloat32(v)\n\t}\n\n\treturn ps\n}\n\n// ToFloat32Map returns a map of float32 values, that are\n// dereferenced if the passed in pointer was not nil. The float32\n// zero value is used if the pointer was nil.\nfunc ToFloat32Map(vs map[string]*float32) map[string]float32 {\n\tps := make(map[string]float32, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToFloat32(v)\n\t}\n\n\treturn ps\n}\n\n// ToFloat64 returns float64 value dereferenced if the passed\n// in pointer was not nil. Returns a float64 zero value if the\n// pointer was nil.\nfunc ToFloat64(p *float64) (v float64) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToFloat64Slice returns a slice of float64 values, that are\n// dereferenced if the passed in pointer was not nil. Returns a float64\n// zero value if the pointer was nil.\nfunc ToFloat64Slice(vs []*float64) []float64 {\n\tps := make([]float64, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToFloat64(v)\n\t}\n\n\treturn ps\n}\n\n// ToFloat64Map returns a map of float64 values, that are\n// dereferenced if the passed in pointer was not nil. The float64\n// zero value is used if the pointer was nil.\nfunc ToFloat64Map(vs map[string]*float64) map[string]float64 {\n\tps := make(map[string]float64, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToFloat64(v)\n\t}\n\n\treturn ps\n}\n\n// ToTime returns time.Time value dereferenced if the passed\n// in pointer was not nil. Returns a time.Time zero value if the\n// pointer was nil.\nfunc ToTime(p *time.Time) (v time.Time) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToTimeSlice returns a slice of time.Time values, that are\n// dereferenced if the passed in pointer was not nil. Returns a time.Time\n// zero value if the pointer was nil.\nfunc ToTimeSlice(vs []*time.Time) []time.Time {\n\tps := make([]time.Time, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToTime(v)\n\t}\n\n\treturn ps\n}\n\n// ToTimeMap returns a map of time.Time values, that are\n// dereferenced if the passed in pointer was not nil. The time.Time\n// zero value is used if the pointer was nil.\nfunc ToTimeMap(vs map[string]*time.Time) map[string]time.Time {\n\tps := make(map[string]time.Time, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToTime(v)\n\t}\n\n\treturn ps\n}\n\n// ToDuration returns time.Duration value dereferenced if the passed\n// in pointer was not nil. Returns a time.Duration zero value if the\n// pointer was nil.\nfunc ToDuration(p *time.Duration) (v time.Duration) {\n\tif p == nil {\n\t\treturn v\n\t}\n\n\treturn *p\n}\n\n// ToDurationSlice returns a slice of time.Duration values, that are\n// dereferenced if the passed in pointer was not nil. Returns a time.Duration\n// zero value if the pointer was nil.\nfunc ToDurationSlice(vs []*time.Duration) []time.Duration {\n\tps := make([]time.Duration, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToDuration(v)\n\t}\n\n\treturn ps\n}\n\n// ToDurationMap returns a map of time.Duration values, that are\n// dereferenced if the passed in pointer was not nil. The time.Duration\n// zero value is used if the pointer was nil.\nfunc ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration {\n\tps := make(map[string]time.Duration, len(vs))\n\tfor k, v := range vs {\n\t\tps[k] = ToDuration(v)\n\t}\n\n\treturn ps\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/ptr/gen_scalars.go",
    "content": "//go:build codegen\n// +build codegen\n\npackage ptr\n\nimport \"strings\"\n\nfunc GetScalars() Scalars {\n\treturn Scalars{\n\t\t{Type: \"bool\"},\n\t\t{Type: \"byte\"},\n\t\t{Type: \"string\"},\n\t\t{Type: \"int\"},\n\t\t{Type: \"int8\"},\n\t\t{Type: \"int16\"},\n\t\t{Type: \"int32\"},\n\t\t{Type: \"int64\"},\n\t\t{Type: \"uint\"},\n\t\t{Type: \"uint8\"},\n\t\t{Type: \"uint16\"},\n\t\t{Type: \"uint32\"},\n\t\t{Type: \"uint64\"},\n\t\t{Type: \"float32\"},\n\t\t{Type: \"float64\"},\n\t\t{Type: \"Time\", Import: &Import{Path: \"time\"}},\n\t\t{Type: \"Duration\", Import: &Import{Path: \"time\"}},\n\t}\n}\n\n// Import provides the import path and optional alias\ntype Import struct {\n\tPath  string\n\tAlias string\n}\n\n// Package returns the Go package name for the import. Returns alias if set.\nfunc (i Import) Package() string {\n\tif v := i.Alias; len(v) != 0 {\n\t\treturn v\n\t}\n\n\tif v := i.Path; len(v) != 0 {\n\t\tparts := strings.Split(v, \"/\")\n\t\tpkg := parts[len(parts)-1]\n\t\treturn pkg\n\t}\n\n\treturn \"\"\n}\n\n// Scalar provides the definition of a type to generate pointer utilities for.\ntype Scalar struct {\n\tType   string\n\tImport *Import\n}\n\n// Name returns the exported function name for the type.\nfunc (t Scalar) Name() string {\n\treturn strings.Title(t.Type)\n}\n\n// Symbol returns the scalar's Go symbol with path if needed.\nfunc (t Scalar) Symbol() string {\n\tif t.Import != nil {\n\t\treturn t.Import.Package() + \".\" + t.Type\n\t}\n\treturn t.Type\n}\n\n// Scalars is a list of scalars.\ntype Scalars []Scalar\n\n// Imports returns all imports for the scalars.\nfunc (ts Scalars) Imports() []*Import {\n\timports := []*Import{}\n\tfor _, t := range ts {\n\t\tif v := t.Import; v != nil {\n\t\t\timports = append(imports, v)\n\t\t}\n\t}\n\n\treturn imports\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/ptr/to_ptr.go",
    "content": "// Code generated by smithy-go/ptr/generate.go DO NOT EDIT.\npackage ptr\n\nimport (\n\t\"time\"\n)\n\n// Bool returns a pointer value for the bool value passed in.\nfunc Bool(v bool) *bool {\n\treturn &v\n}\n\n// BoolSlice returns a slice of bool pointers from the values\n// passed in.\nfunc BoolSlice(vs []bool) []*bool {\n\tps := make([]*bool, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// BoolMap returns a map of bool pointers from the values\n// passed in.\nfunc BoolMap(vs map[string]bool) map[string]*bool {\n\tps := make(map[string]*bool, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Byte returns a pointer value for the byte value passed in.\nfunc Byte(v byte) *byte {\n\treturn &v\n}\n\n// ByteSlice returns a slice of byte pointers from the values\n// passed in.\nfunc ByteSlice(vs []byte) []*byte {\n\tps := make([]*byte, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// ByteMap returns a map of byte pointers from the values\n// passed in.\nfunc ByteMap(vs map[string]byte) map[string]*byte {\n\tps := make(map[string]*byte, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// String returns a pointer value for the string value passed in.\nfunc String(v string) *string {\n\treturn &v\n}\n\n// StringSlice returns a slice of string pointers from the values\n// passed in.\nfunc StringSlice(vs []string) []*string {\n\tps := make([]*string, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// StringMap returns a map of string pointers from the values\n// passed in.\nfunc StringMap(vs map[string]string) map[string]*string {\n\tps := make(map[string]*string, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int returns a pointer value for the int value passed in.\nfunc Int(v int) *int {\n\treturn &v\n}\n\n// IntSlice returns a slice of int pointers from the values\n// passed in.\nfunc IntSlice(vs []int) []*int {\n\tps := make([]*int, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// IntMap returns a map of int pointers from the values\n// passed in.\nfunc IntMap(vs map[string]int) map[string]*int {\n\tps := make(map[string]*int, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int8 returns a pointer value for the int8 value passed in.\nfunc Int8(v int8) *int8 {\n\treturn &v\n}\n\n// Int8Slice returns a slice of int8 pointers from the values\n// passed in.\nfunc Int8Slice(vs []int8) []*int8 {\n\tps := make([]*int8, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int8Map returns a map of int8 pointers from the values\n// passed in.\nfunc Int8Map(vs map[string]int8) map[string]*int8 {\n\tps := make(map[string]*int8, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int16 returns a pointer value for the int16 value passed in.\nfunc Int16(v int16) *int16 {\n\treturn &v\n}\n\n// Int16Slice returns a slice of int16 pointers from the values\n// passed in.\nfunc Int16Slice(vs []int16) []*int16 {\n\tps := make([]*int16, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int16Map returns a map of int16 pointers from the values\n// passed in.\nfunc Int16Map(vs map[string]int16) map[string]*int16 {\n\tps := make(map[string]*int16, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int32 returns a pointer value for the int32 value passed in.\nfunc Int32(v int32) *int32 {\n\treturn &v\n}\n\n// Int32Slice returns a slice of int32 pointers from the values\n// passed in.\nfunc Int32Slice(vs []int32) []*int32 {\n\tps := make([]*int32, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int32Map returns a map of int32 pointers from the values\n// passed in.\nfunc Int32Map(vs map[string]int32) map[string]*int32 {\n\tps := make(map[string]*int32, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int64 returns a pointer value for the int64 value passed in.\nfunc Int64(v int64) *int64 {\n\treturn &v\n}\n\n// Int64Slice returns a slice of int64 pointers from the values\n// passed in.\nfunc Int64Slice(vs []int64) []*int64 {\n\tps := make([]*int64, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Int64Map returns a map of int64 pointers from the values\n// passed in.\nfunc Int64Map(vs map[string]int64) map[string]*int64 {\n\tps := make(map[string]*int64, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint returns a pointer value for the uint value passed in.\nfunc Uint(v uint) *uint {\n\treturn &v\n}\n\n// UintSlice returns a slice of uint pointers from the values\n// passed in.\nfunc UintSlice(vs []uint) []*uint {\n\tps := make([]*uint, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// UintMap returns a map of uint pointers from the values\n// passed in.\nfunc UintMap(vs map[string]uint) map[string]*uint {\n\tps := make(map[string]*uint, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint8 returns a pointer value for the uint8 value passed in.\nfunc Uint8(v uint8) *uint8 {\n\treturn &v\n}\n\n// Uint8Slice returns a slice of uint8 pointers from the values\n// passed in.\nfunc Uint8Slice(vs []uint8) []*uint8 {\n\tps := make([]*uint8, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint8Map returns a map of uint8 pointers from the values\n// passed in.\nfunc Uint8Map(vs map[string]uint8) map[string]*uint8 {\n\tps := make(map[string]*uint8, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint16 returns a pointer value for the uint16 value passed in.\nfunc Uint16(v uint16) *uint16 {\n\treturn &v\n}\n\n// Uint16Slice returns a slice of uint16 pointers from the values\n// passed in.\nfunc Uint16Slice(vs []uint16) []*uint16 {\n\tps := make([]*uint16, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint16Map returns a map of uint16 pointers from the values\n// passed in.\nfunc Uint16Map(vs map[string]uint16) map[string]*uint16 {\n\tps := make(map[string]*uint16, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint32 returns a pointer value for the uint32 value passed in.\nfunc Uint32(v uint32) *uint32 {\n\treturn &v\n}\n\n// Uint32Slice returns a slice of uint32 pointers from the values\n// passed in.\nfunc Uint32Slice(vs []uint32) []*uint32 {\n\tps := make([]*uint32, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint32Map returns a map of uint32 pointers from the values\n// passed in.\nfunc Uint32Map(vs map[string]uint32) map[string]*uint32 {\n\tps := make(map[string]*uint32, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint64 returns a pointer value for the uint64 value passed in.\nfunc Uint64(v uint64) *uint64 {\n\treturn &v\n}\n\n// Uint64Slice returns a slice of uint64 pointers from the values\n// passed in.\nfunc Uint64Slice(vs []uint64) []*uint64 {\n\tps := make([]*uint64, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Uint64Map returns a map of uint64 pointers from the values\n// passed in.\nfunc Uint64Map(vs map[string]uint64) map[string]*uint64 {\n\tps := make(map[string]*uint64, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Float32 returns a pointer value for the float32 value passed in.\nfunc Float32(v float32) *float32 {\n\treturn &v\n}\n\n// Float32Slice returns a slice of float32 pointers from the values\n// passed in.\nfunc Float32Slice(vs []float32) []*float32 {\n\tps := make([]*float32, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Float32Map returns a map of float32 pointers from the values\n// passed in.\nfunc Float32Map(vs map[string]float32) map[string]*float32 {\n\tps := make(map[string]*float32, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Float64 returns a pointer value for the float64 value passed in.\nfunc Float64(v float64) *float64 {\n\treturn &v\n}\n\n// Float64Slice returns a slice of float64 pointers from the values\n// passed in.\nfunc Float64Slice(vs []float64) []*float64 {\n\tps := make([]*float64, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// Float64Map returns a map of float64 pointers from the values\n// passed in.\nfunc Float64Map(vs map[string]float64) map[string]*float64 {\n\tps := make(map[string]*float64, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Time returns a pointer value for the time.Time value passed in.\nfunc Time(v time.Time) *time.Time {\n\treturn &v\n}\n\n// TimeSlice returns a slice of time.Time pointers from the values\n// passed in.\nfunc TimeSlice(vs []time.Time) []*time.Time {\n\tps := make([]*time.Time, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// TimeMap returns a map of time.Time pointers from the values\n// passed in.\nfunc TimeMap(vs map[string]time.Time) map[string]*time.Time {\n\tps := make(map[string]*time.Time, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n\n// Duration returns a pointer value for the time.Duration value passed in.\nfunc Duration(v time.Duration) *time.Duration {\n\treturn &v\n}\n\n// DurationSlice returns a slice of time.Duration pointers from the values\n// passed in.\nfunc DurationSlice(vs []time.Duration) []*time.Duration {\n\tps := make([]*time.Duration, len(vs))\n\tfor i, v := range vs {\n\t\tvv := v\n\t\tps[i] = &vv\n\t}\n\n\treturn ps\n}\n\n// DurationMap returns a map of time.Duration pointers from the values\n// passed in.\nfunc DurationMap(vs map[string]time.Duration) map[string]*time.Duration {\n\tps := make(map[string]*time.Duration, len(vs))\n\tfor k, v := range vs {\n\t\tvv := v\n\t\tps[k] = &vv\n\t}\n\n\treturn ps\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/rand/doc.go",
    "content": "// Package rand provides utilities for creating and working with random value\n// generators.\npackage rand\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/rand/rand.go",
    "content": "package rand\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n)\n\nfunc init() {\n\tReader = rand.Reader\n}\n\n// Reader provides a random reader that can reset during testing.\nvar Reader io.Reader\n\n// Int63n returns a int64 between zero and value of max, read from an io.Reader source.\nfunc Int63n(reader io.Reader, max int64) (int64, error) {\n\tbi, err := rand.Int(reader, big.NewInt(max))\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to read random value, %w\", err)\n\t}\n\n\treturn bi.Int64(), nil\n}\n\n// CryptoRandInt63n returns a random int64 between zero and value of max\n// obtained from the crypto rand source.\nfunc CryptoRandInt63n(max int64) (int64, error) {\n\treturn Int63n(Reader, max)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/rand/uuid.go",
    "content": "package rand\n\nimport (\n\t\"encoding/hex\"\n\t\"io\"\n)\n\nconst dash byte = '-'\n\n// UUIDIdempotencyToken provides a utility to get idempotency tokens in the\n// UUID format.\ntype UUIDIdempotencyToken struct {\n\tuuid *UUID\n}\n\n// NewUUIDIdempotencyToken returns a idempotency token provider returning\n// tokens in the UUID random format using the reader provided.\nfunc NewUUIDIdempotencyToken(r io.Reader) *UUIDIdempotencyToken {\n\treturn &UUIDIdempotencyToken{uuid: NewUUID(r)}\n}\n\n// GetIdempotencyToken returns a random UUID value for Idempotency token.\nfunc (u UUIDIdempotencyToken) GetIdempotencyToken() (string, error) {\n\treturn u.uuid.GetUUID()\n}\n\n// UUID provides computing random UUID version 4 values from a random source\n// reader.\ntype UUID struct {\n\trandSrc io.Reader\n}\n\n// NewUUID returns an initialized UUID value that can be used to retrieve\n// random UUID version 4 values.\nfunc NewUUID(r io.Reader) *UUID {\n\treturn &UUID{randSrc: r}\n}\n\n// GetUUID returns a random UUID version 4 string representation sourced from the random reader the\n// UUID was created with. Returns an error if unable to compute the UUID.\nfunc (r *UUID) GetUUID() (string, error) {\n\tvar b [16]byte\n\tif _, err := io.ReadFull(r.randSrc, b[:]); err != nil {\n\t\treturn \"\", err\n\t}\n\tr.makeUUIDv4(b[:])\n\treturn format(b), nil\n}\n\n// GetBytes returns a byte slice containing a random UUID version 4 sourced from the random reader the\n// UUID was created with. Returns an error if unable to compute the UUID.\nfunc (r *UUID) GetBytes() (u []byte, err error) {\n\tu = make([]byte, 16)\n\tif _, err = io.ReadFull(r.randSrc, u); err != nil {\n\t\treturn u, err\n\t}\n\tr.makeUUIDv4(u)\n\treturn u, nil\n}\n\nfunc (r *UUID) makeUUIDv4(u []byte) {\n\t// 13th character is \"4\"\n\tu[6] = (u[6] & 0x0f) | 0x40 // Version 4\n\t// 17th character is \"8\", \"9\", \"a\", or \"b\"\n\tu[8] = (u[8] & 0x3f) | 0x80 // Variant most significant bits are 10x where x can be either 1 or 0\n}\n\n// Format returns the canonical text representation of a UUID.\n// This implementation is optimized to not use fmt.\n// Example: 82e42f16-b6cc-4d5b-95f5-d403c4befd3d\nfunc format(u [16]byte) string {\n\t// https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29\n\n\tvar scratch [36]byte\n\n\thex.Encode(scratch[:8], u[0:4])\n\tscratch[8] = dash\n\thex.Encode(scratch[9:13], u[4:6])\n\tscratch[13] = dash\n\thex.Encode(scratch[14:18], u[6:8])\n\tscratch[18] = dash\n\thex.Encode(scratch[19:23], u[8:10])\n\tscratch[23] = dash\n\thex.Encode(scratch[24:], u[10:])\n\n\treturn string(scratch[:])\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/time/time.go",
    "content": "package time\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\t// dateTimeFormat is a IMF-fixdate formatted RFC3339 section 5.6\n\tdateTimeFormatInput    = \"2006-01-02T15:04:05.999999999Z\"\n\tdateTimeFormatInputNoZ = \"2006-01-02T15:04:05.999999999\"\n\tdateTimeFormatOutput   = \"2006-01-02T15:04:05.999Z\"\n\n\t// httpDateFormat is a date time defined by RFC 7231#section-7.1.1.1\n\t// IMF-fixdate with no UTC offset.\n\thttpDateFormat = \"Mon, 02 Jan 2006 15:04:05 GMT\"\n\t// Additional formats needed for compatibility.\n\thttpDateFormatSingleDigitDay             = \"Mon, _2 Jan 2006 15:04:05 GMT\"\n\thttpDateFormatSingleDigitDayTwoDigitYear = \"Mon, _2 Jan 06 15:04:05 GMT\"\n)\n\nvar millisecondFloat = big.NewFloat(1e3)\n\n// FormatDateTime formats value as a date-time, (RFC3339 section 5.6)\n//\n// Example: 1985-04-12T23:20:50.52Z\nfunc FormatDateTime(value time.Time) string {\n\treturn value.UTC().Format(dateTimeFormatOutput)\n}\n\n// ParseDateTime parses a string as a date-time, (RFC3339 section 5.6)\n//\n// Example: 1985-04-12T23:20:50.52Z\nfunc ParseDateTime(value string) (time.Time, error) {\n\treturn tryParse(value,\n\t\tdateTimeFormatInput,\n\t\tdateTimeFormatInputNoZ,\n\t\ttime.RFC3339Nano,\n\t\ttime.RFC3339,\n\t)\n}\n\n// FormatHTTPDate formats value as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate)\n//\n// Example: Tue, 29 Apr 2014 18:30:38 GMT\nfunc FormatHTTPDate(value time.Time) string {\n\treturn value.UTC().Format(httpDateFormat)\n}\n\n// ParseHTTPDate parses a string as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate)\n//\n// Example: Tue, 29 Apr 2014 18:30:38 GMT\nfunc ParseHTTPDate(value string) (time.Time, error) {\n\treturn tryParse(value,\n\t\thttpDateFormat,\n\t\thttpDateFormatSingleDigitDay,\n\t\thttpDateFormatSingleDigitDayTwoDigitYear,\n\t\ttime.RFC850,\n\t\ttime.ANSIC,\n\t)\n}\n\n// FormatEpochSeconds returns value as a Unix time in seconds with with decimal precision\n//\n// Example: 1515531081.123\nfunc FormatEpochSeconds(value time.Time) float64 {\n\tms := value.UnixNano() / int64(time.Millisecond)\n\treturn float64(ms) / 1e3\n}\n\n// ParseEpochSeconds returns value as a Unix time in seconds with with decimal precision\n//\n// Example: 1515531081.123\nfunc ParseEpochSeconds(value float64) time.Time {\n\tf := big.NewFloat(value)\n\tf = f.Mul(f, millisecondFloat)\n\ti, _ := f.Int64()\n\t// Offset to `UTC` because time.Unix returns the time value based on system\n\t// local setting.\n\treturn time.Unix(0, i*1e6).UTC()\n}\n\nfunc tryParse(v string, formats ...string) (time.Time, error) {\n\tvar errs parseErrors\n\tfor _, f := range formats {\n\t\tt, err := time.Parse(f, v)\n\t\tif err != nil {\n\t\t\terrs = append(errs, parseError{\n\t\t\t\tFormat: f,\n\t\t\t\tErr:    err,\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\t\treturn t, nil\n\t}\n\n\treturn time.Time{}, fmt.Errorf(\"unable to parse time string, %w\", errs)\n}\n\ntype parseErrors []parseError\n\nfunc (es parseErrors) Error() string {\n\tvar s strings.Builder\n\tfor _, e := range es {\n\t\tfmt.Fprintf(&s, \"\\n * %q: %v\", e.Format, e.Err)\n\t}\n\n\treturn \"parse errors:\" + s.String()\n}\n\ntype parseError struct {\n\tFormat string\n\tErr    error\n}\n\n// SleepWithContext will wait for the timer duration to expire, or until the context\n// is canceled. Whichever happens first. If the context is canceled the\n// Context's error will be returned.\nfunc SleepWithContext(ctx context.Context, dur time.Duration) error {\n\tt := time.NewTimer(dur)\n\tdefer t.Stop()\n\n\tselect {\n\tcase <-t.C:\n\t\tbreak\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/auth.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n)\n\n// AuthScheme defines an HTTP authentication scheme.\ntype AuthScheme interface {\n\tSchemeID() string\n\tIdentityResolver(auth.IdentityResolverOptions) auth.IdentityResolver\n\tSigner() Signer\n}\n\n// Signer defines the interface through which HTTP requests are supplemented\n// with an Identity.\ntype Signer interface {\n\tSignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/auth\"\n)\n\n// NewAnonymousScheme returns the anonymous HTTP auth scheme.\nfunc NewAnonymousScheme() AuthScheme {\n\treturn &authScheme{\n\t\tschemeID: auth.SchemeIDAnonymous,\n\t\tsigner:   &nopSigner{},\n\t}\n}\n\n// authScheme is parameterized to generically implement the exported AuthScheme\n// interface\ntype authScheme struct {\n\tschemeID string\n\tsigner   Signer\n}\n\nvar _ AuthScheme = (*authScheme)(nil)\n\nfunc (s *authScheme) SchemeID() string {\n\treturn s.schemeID\n}\n\nfunc (s *authScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver {\n\treturn o.GetIdentityResolver(s.schemeID)\n}\n\nfunc (s *authScheme) Signer() Signer {\n\treturn s.signer\n}\n\ntype nopSigner struct{}\n\nvar _ Signer = (*nopSigner)(nil)\n\nfunc (*nopSigner) SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\nconst contentMD5Header = \"Content-Md5\"\n\n// contentMD5Checksum provides a middleware to compute and set\n// content-md5 checksum for a http request\ntype contentMD5Checksum struct {\n}\n\n// AddContentChecksumMiddleware adds checksum middleware to middleware's\n// build step.\nfunc AddContentChecksumMiddleware(stack *middleware.Stack) error {\n\t// This middleware must be executed before request body is set.\n\treturn stack.Build.Add(&contentMD5Checksum{}, middleware.Before)\n}\n\n// ID returns the identifier for the checksum middleware\nfunc (m *contentMD5Checksum) ID() string { return \"ContentChecksum\" }\n\n// HandleBuild adds behavior to compute md5 checksum and add content-md5 header\n// on http request\nfunc (m *contentMD5Checksum) HandleBuild(\n\tctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,\n) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown request type %T\", req)\n\t}\n\n\t// if Content-MD5 header is already present, return\n\tif v := req.Header.Get(contentMD5Header); len(v) != 0 {\n\t\treturn next.HandleBuild(ctx, in)\n\t}\n\n\t// fetch the request stream.\n\tstream := req.GetStream()\n\t// compute checksum if payload is explicit\n\tif stream != nil {\n\t\tif !req.IsStreamSeekable() {\n\t\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\t\"unseekable stream is not supported for computing md5 checksum\")\n\t\t}\n\n\t\tv, err := computeMD5Checksum(stream)\n\t\tif err != nil {\n\t\t\treturn out, metadata, fmt.Errorf(\"error computing md5 checksum, %w\", err)\n\t\t}\n\n\t\t// reset the request stream\n\t\tif err := req.RewindStream(); err != nil {\n\t\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\t\"error rewinding request stream after computing md5 checksum, %w\", err)\n\t\t}\n\n\t\t// set the 'Content-MD5' header\n\t\treq.Header.Set(contentMD5Header, string(v))\n\t}\n\n\t// set md5 header value\n\treturn next.HandleBuild(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/client.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\n\tsmithy \"github.com/aws/smithy-go\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// ClientDo provides the interface for custom HTTP client implementations.\ntype ClientDo interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n\n// ClientDoFunc provides a helper to wrap a function as an HTTP client for\n// round tripping requests.\ntype ClientDoFunc func(*http.Request) (*http.Response, error)\n\n// Do will invoke the underlying func, returning the result.\nfunc (fn ClientDoFunc) Do(r *http.Request) (*http.Response, error) {\n\treturn fn(r)\n}\n\n// ClientHandler wraps a client that implements the HTTP Do method. Standard\n// implementation is http.Client.\ntype ClientHandler struct {\n\tclient ClientDo\n}\n\n// NewClientHandler returns an initialized middleware handler for the client.\nfunc NewClientHandler(client ClientDo) ClientHandler {\n\treturn ClientHandler{\n\t\tclient: client,\n\t}\n}\n\n// Handle implements the middleware Handler interface, that will invoke the\n// underlying HTTP client. Requires the input to be a Smithy *Request. Returns\n// a smithy *Response, or error if the request failed.\nfunc (c ClientHandler) Handle(ctx context.Context, input interface{}) (\n\tout interface{}, metadata middleware.Metadata, err error,\n) {\n\treq, ok := input.(*Request)\n\tif !ok {\n\t\treturn nil, metadata, fmt.Errorf(\"expect Smithy http.Request value as input, got unsupported type %T\", input)\n\t}\n\n\tbuiltRequest := req.Build(ctx)\n\tif err := ValidateEndpointHost(builtRequest.Host); err != nil {\n\t\treturn nil, metadata, err\n\t}\n\n\tresp, err := c.client.Do(builtRequest)\n\tif resp == nil {\n\t\t// Ensure a http response value is always present to prevent unexpected\n\t\t// panics.\n\t\tresp = &http.Response{\n\t\t\tHeader: http.Header{},\n\t\t\tBody:   http.NoBody,\n\t\t}\n\t}\n\tif err != nil {\n\t\terr = &RequestSendError{Err: err}\n\n\t\t// Override the error with a context canceled error, if that was canceled.\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\terr = &smithy.CanceledError{Err: ctx.Err()}\n\t\tdefault:\n\t\t}\n\t}\n\n\t// HTTP RoundTripper *should* close the request body. But this may not happen in a timely manner.\n\t// So instead Smithy *Request Build wraps the body to be sent in a safe closer that will clear the\n\t// stream reference so that it can be safely reused.\n\tif builtRequest.Body != nil {\n\t\t_ = builtRequest.Body.Close()\n\t}\n\n\treturn &Response{Response: resp}, metadata, err\n}\n\n// RequestSendError provides a generic request transport error. This error\n// should wrap errors making HTTP client requests.\n//\n// The ClientHandler will wrap the HTTP client's error if the client request\n// fails, and did not fail because of context canceled.\ntype RequestSendError struct {\n\tErr error\n}\n\n// ConnectionError returns that the error is related to not being able to send\n// the request, or receive a response from the service.\nfunc (e *RequestSendError) ConnectionError() bool {\n\treturn true\n}\n\n// Unwrap returns the underlying error, if there was one.\nfunc (e *RequestSendError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e *RequestSendError) Error() string {\n\treturn fmt.Sprintf(\"request send failed, %v\", e.Err)\n}\n\n// NopClient provides a client that ignores the request, and returns an empty\n// successful HTTP response value.\ntype NopClient struct{}\n\n// Do ignores the request and returns a 200 status empty response.\nfunc (NopClient) Do(r *http.Request) (*http.Response, error) {\n\treturn &http.Response{\n\t\tStatusCode: 200,\n\t\tHeader:     http.Header{},\n\t\tBody:       http.NoBody,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/doc.go",
    "content": "/*\nPackage http provides the HTTP transport client and request/response types\nneeded to round trip API operation calls with an service.\n*/\npackage http\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/headerlist.go",
    "content": "package http\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc splitHeaderListValues(vs []string, splitFn func(string) ([]string, error)) ([]string, error) {\n\tvalues := make([]string, 0, len(vs))\n\n\tfor i := 0; i < len(vs); i++ {\n\t\tparts, err := splitFn(vs[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvalues = append(values, parts...)\n\t}\n\n\treturn values, nil\n}\n\n// SplitHeaderListValues attempts to split the elements of the slice by commas,\n// and return a list of all values separated. Returns error if unable to\n// separate the values.\nfunc SplitHeaderListValues(vs []string) ([]string, error) {\n\treturn splitHeaderListValues(vs, quotedCommaSplit)\n}\n\nfunc quotedCommaSplit(v string) (parts []string, err error) {\n\tv = strings.TrimSpace(v)\n\n\texpectMore := true\n\tfor i := 0; i < len(v); i++ {\n\t\tif unicode.IsSpace(rune(v[i])) {\n\t\t\tcontinue\n\t\t}\n\t\texpectMore = false\n\n\t\t// leading  space in part is ignored.\n\t\t// Start of value must be non-space, or quote.\n\t\t//\n\t\t// - If quote, enter quoted mode, find next non-escaped quote to\n\t\t//   terminate the value.\n\t\t// - Otherwise, find next comma to terminate value.\n\n\t\tremaining := v[i:]\n\n\t\tvar value string\n\t\tvar valueLen int\n\t\tif remaining[0] == '\"' {\n\t\t\t//------------------------------\n\t\t\t// Quoted value\n\t\t\t//------------------------------\n\t\t\tvar j int\n\t\t\tvar skipQuote bool\n\t\t\tfor j += 1; j < len(remaining); j++ {\n\t\t\t\tif remaining[j] == '\\\\' || (remaining[j] != '\\\\' && skipQuote) {\n\t\t\t\t\tskipQuote = !skipQuote\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif remaining[j] == '\"' {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif j == len(remaining) || j == 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"value %v missing closing double quote\",\n\t\t\t\t\tremaining)\n\t\t\t}\n\t\t\tvalueLen = j + 1\n\n\t\t\ttail := remaining[valueLen:]\n\t\t\tvar k int\n\t\t\tfor ; k < len(tail); k++ {\n\t\t\t\tif !unicode.IsSpace(rune(tail[k])) && tail[k] != ',' {\n\t\t\t\t\treturn nil, fmt.Errorf(\"value %v has non-space trailing characters\",\n\t\t\t\t\t\tremaining)\n\t\t\t\t}\n\t\t\t\tif tail[k] == ',' {\n\t\t\t\t\texpectMore = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = remaining[:valueLen]\n\t\t\tvalue, err = strconv.Unquote(value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to unquote value %v, %w\", value, err)\n\t\t\t}\n\n\t\t\t// Pad valueLen to include trailing space(s) so `i` is updated correctly.\n\t\t\tvalueLen += k\n\n\t\t} else {\n\t\t\t//------------------------------\n\t\t\t// Unquoted value\n\t\t\t//------------------------------\n\n\t\t\t// Index of the next comma is the length of the value, or end of string.\n\t\t\tvalueLen = strings.Index(remaining, \",\")\n\t\t\tif valueLen != -1 {\n\t\t\t\texpectMore = true\n\t\t\t} else {\n\t\t\t\tvalueLen = len(remaining)\n\t\t\t}\n\t\t\tvalue = strings.TrimSpace(remaining[:valueLen])\n\t\t}\n\n\t\ti += valueLen\n\t\tparts = append(parts, value)\n\n\t}\n\n\tif expectMore {\n\t\tparts = append(parts, \"\")\n\t}\n\n\treturn parts, nil\n}\n\n// SplitHTTPDateTimestampHeaderListValues attempts to split the HTTP-Date\n// timestamp values in the slice by commas, and return a list of all values\n// separated. The split is aware of the HTTP-Date timestamp format, and will skip\n// comma within the timestamp value. Returns an error if unable to split the\n// timestamp values.\nfunc SplitHTTPDateTimestampHeaderListValues(vs []string) ([]string, error) {\n\treturn splitHeaderListValues(vs, splitHTTPDateHeaderValue)\n}\n\nfunc splitHTTPDateHeaderValue(v string) ([]string, error) {\n\tif n := strings.Count(v, \",\"); n <= 1 {\n\t\t// Nothing to do if only contains a no, or single HTTPDate value\n\t\treturn []string{v}, nil\n\t} else if n%2 == 0 {\n\t\treturn nil, fmt.Errorf(\"invalid timestamp HTTPDate header comma separations, %q\", v)\n\t}\n\n\tvar parts []string\n\tvar i, j int\n\n\tvar doSplit bool\n\tfor ; i < len(v); i++ {\n\t\tif v[i] == ',' {\n\t\t\tif doSplit {\n\t\t\t\tdoSplit = false\n\t\t\t\tparts = append(parts, strings.TrimSpace(v[j:i]))\n\t\t\t\tj = i + 1\n\t\t\t} else {\n\t\t\t\t// Skip the first comma in the timestamp value since that\n\t\t\t\t// separates the day from the rest of the timestamp.\n\t\t\t\t//\n\t\t\t\t// Tue, 17 Dec 2019 23:48:18 GMT\n\t\t\t\tdoSplit = true\n\t\t\t}\n\t\t}\n\t}\n\t// Add final part\n\tif j < len(v) {\n\t\tparts = append(parts, strings.TrimSpace(v[j:]))\n\t}\n\n\treturn parts, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/host.go",
    "content": "package http\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// ValidateEndpointHost validates that the host string passed in is a valid RFC\n// 3986 host. Returns error if the host is not valid.\nfunc ValidateEndpointHost(host string) error {\n\tvar errors strings.Builder\n\tvar hostname string\n\tvar port string\n\tvar err error\n\n\tif strings.Contains(host, \":\") {\n\t\thostname, port, err = net.SplitHostPort(host)\n\t\tif err != nil {\n\t\t\terrors.WriteString(fmt.Sprintf(\"\\n endpoint %v, failed to parse, got \", host))\n\t\t\terrors.WriteString(err.Error())\n\t\t}\n\n\t\tif !ValidPortNumber(port) {\n\t\t\terrors.WriteString(fmt.Sprintf(\"port number should be in range [0-65535], got %v\", port))\n\t\t}\n\t} else {\n\t\thostname = host\n\t}\n\n\tlabels := strings.Split(hostname, \".\")\n\tfor i, label := range labels {\n\t\tif i == len(labels)-1 && len(label) == 0 {\n\t\t\t// Allow trailing dot for FQDN hosts.\n\t\t\tcontinue\n\t\t}\n\n\t\tif !ValidHostLabel(label) {\n\t\t\terrors.WriteString(\"\\nendpoint host domain labels must match \\\"[a-zA-Z0-9-]{1,63}\\\", but found: \")\n\t\t\terrors.WriteString(label)\n\t\t}\n\t}\n\n\tif len(hostname) == 0 && len(port) != 0 {\n\t\terrors.WriteString(\"\\nendpoint host with port must not be empty\")\n\t}\n\n\tif len(hostname) > 255 {\n\t\terrors.WriteString(fmt.Sprintf(\"\\nendpoint host must be less than 255 characters, but was %d\", len(hostname)))\n\t}\n\n\tif len(errors.String()) > 0 {\n\t\treturn fmt.Errorf(\"invalid endpoint host%s\", errors.String())\n\t}\n\treturn nil\n}\n\n// ValidPortNumber returns whether the port is valid RFC 3986 port.\nfunc ValidPortNumber(port string) bool {\n\ti, err := strconv.Atoi(port)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tif i < 0 || i > 65535 {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// ValidHostLabel returns whether the label is a valid RFC 3986 host abel.\nfunc ValidHostLabel(label string) bool {\n\tif l := len(label); l == 0 || l > 63 {\n\t\treturn false\n\t}\n\tfor _, r := range label {\n\t\tswitch {\n\t\tcase r >= '0' && r <= '9':\n\t\tcase r >= 'A' && r <= 'Z':\n\t\tcase r >= 'a' && r <= 'z':\n\t\tcase r == '-':\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go",
    "content": "package io\n\nimport (\n\t\"io\"\n\t\"sync\"\n)\n\n// NewSafeReadCloser returns a new safeReadCloser that wraps readCloser.\nfunc NewSafeReadCloser(readCloser io.ReadCloser) io.ReadCloser {\n\tsr := &safeReadCloser{\n\t\treadCloser: readCloser,\n\t}\n\n\tif _, ok := readCloser.(io.WriterTo); ok {\n\t\treturn &safeWriteToReadCloser{safeReadCloser: sr}\n\t}\n\n\treturn sr\n}\n\n// safeWriteToReadCloser wraps a safeReadCloser but exposes a WriteTo interface implementation. This will panic\n// if the underlying io.ReadClose does not support WriteTo. Use NewSafeReadCloser to ensure the proper handling of this\n// type.\ntype safeWriteToReadCloser struct {\n\t*safeReadCloser\n}\n\n// WriteTo implements the io.WriteTo interface.\nfunc (r *safeWriteToReadCloser) WriteTo(w io.Writer) (int64, error) {\n\tr.safeReadCloser.mtx.Lock()\n\tdefer r.safeReadCloser.mtx.Unlock()\n\n\tif r.safeReadCloser.closed {\n\t\treturn 0, io.EOF\n\t}\n\n\treturn r.safeReadCloser.readCloser.(io.WriterTo).WriteTo(w)\n}\n\n// safeReadCloser wraps a io.ReadCloser and presents an io.ReadCloser interface. When Close is called on safeReadCloser\n// the underlying Close method will be executed, and then the reference to the reader will be dropped. This type\n// is meant to be used with the net/http library which will retain a reference to the request body for the lifetime\n// of a goroutine connection. Wrapping in this manner will ensure that no data race conditions are falsely reported.\n// This type is thread-safe.\ntype safeReadCloser struct {\n\treadCloser io.ReadCloser\n\tclosed     bool\n\tmtx        sync.Mutex\n}\n\n// Read reads up to len(p) bytes into p from the underlying read. If the reader is closed io.EOF will be returned.\nfunc (r *safeReadCloser) Read(p []byte) (n int, err error) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\tif r.closed {\n\t\treturn 0, io.EOF\n\t}\n\n\treturn r.readCloser.Read(p)\n}\n\n// Close calls the underlying io.ReadCloser's Close method, removes the reference to the reader, and returns any error\n// reported from Close. Subsequent calls to Close will always return a nil error.\nfunc (r *safeReadCloser) Close() error {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\tif r.closed {\n\t\treturn nil\n\t}\n\n\tr.closed = true\n\trc := r.readCloser\n\tr.readCloser = nil\n\treturn rc.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go",
    "content": "package http\n\nimport (\n\t\"crypto/md5\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// computeMD5Checksum computes base64 md5 checksum of an io.Reader's contents.\n// Returns the byte slice of md5 checksum and an error.\nfunc computeMD5Checksum(r io.Reader) ([]byte, error) {\n\th := md5.New()\n\t// copy errors may be assumed to be from the body.\n\t_, err := io.Copy(h, r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read body: %w\", err)\n\t}\n\n\t// encode the md5 checksum in base64.\n\tsum := h.Sum(nil)\n\tsum64 := make([]byte, base64.StdEncoding.EncodedLen(len(sum)))\n\tbase64.StdEncoding.Encode(sum64, sum)\n\treturn sum64, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"io\"\n\t\"io/ioutil\"\n)\n\n// AddErrorCloseResponseBodyMiddleware adds the middleware to automatically\n// close the response body of an operation request if the request response\n// failed.\nfunc AddErrorCloseResponseBodyMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&errorCloseResponseBodyMiddleware{}, \"OperationDeserializer\", middleware.Before)\n}\n\ntype errorCloseResponseBodyMiddleware struct{}\n\nfunc (*errorCloseResponseBodyMiddleware) ID() string {\n\treturn \"ErrorCloseResponseBody\"\n}\n\nfunc (m *errorCloseResponseBodyMiddleware) HandleDeserialize(\n\tctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\toutput middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err := next.HandleDeserialize(ctx, input)\n\tif err != nil {\n\t\tif resp, ok := out.RawResponse.(*Response); ok && resp != nil && resp.Body != nil {\n\t\t\t// Consume the full body to prevent TCP connection resets on some platforms\n\t\t\t_, _ = io.Copy(ioutil.Discard, resp.Body)\n\t\t\t// Do not validate that the response closes successfully.\n\t\t\tresp.Body.Close()\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n\n// AddCloseResponseBodyMiddleware adds the middleware to automatically close\n// the response body of an operation request, after the response had been\n// deserialized.\nfunc AddCloseResponseBodyMiddleware(stack *middleware.Stack) error {\n\treturn stack.Deserialize.Insert(&closeResponseBody{}, \"OperationDeserializer\", middleware.Before)\n}\n\ntype closeResponseBody struct{}\n\nfunc (*closeResponseBody) ID() string {\n\treturn \"CloseResponseBody\"\n}\n\nfunc (m *closeResponseBody) HandleDeserialize(\n\tctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\toutput middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err := next.HandleDeserialize(ctx, input)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tif resp, ok := out.RawResponse.(*Response); ok {\n\t\t// Consume the full body to prevent TCP connection resets on some platforms\n\t\t_, copyErr := io.Copy(ioutil.Discard, resp.Body)\n\t\tif copyErr != nil {\n\t\t\tmiddleware.GetLogger(ctx).Logf(logging.Warn, \"failed to discard remaining HTTP response body, this may affect connection reuse\")\n\t\t}\n\n\t\tcloseErr := resp.Body.Close()\n\t\tif closeErr != nil {\n\t\t\tmiddleware.GetLogger(ctx).Logf(logging.Warn, \"failed to close HTTP response body, this may affect connection reuse\")\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// ComputeContentLength provides a middleware to set the content-length\n// header for the length of a serialize request body.\ntype ComputeContentLength struct {\n}\n\n// AddComputeContentLengthMiddleware adds ComputeContentLength to the middleware\n// stack's Build step.\nfunc AddComputeContentLengthMiddleware(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&ComputeContentLength{}, middleware.After)\n}\n\n// ID returns the identifier for the ComputeContentLength.\nfunc (m *ComputeContentLength) ID() string { return \"ComputeContentLength\" }\n\n// HandleBuild adds the length of the serialized request to the HTTP header\n// if the length can be determined.\nfunc (m *ComputeContentLength) HandleBuild(\n\tctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,\n) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown request type %T\", req)\n\t}\n\n\t// do nothing if request content-length was set to 0 or above.\n\tif req.ContentLength >= 0 {\n\t\treturn next.HandleBuild(ctx, in)\n\t}\n\n\t// attempt to compute stream length\n\tif n, ok, err := req.StreamLength(); err != nil {\n\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\"failed getting length of request stream, %w\", err)\n\t} else if ok {\n\t\treq.ContentLength = n\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n\n// validateContentLength provides a middleware to validate the content-length\n// is valid (greater than zero), for the serialized request payload.\ntype validateContentLength struct{}\n\n// ValidateContentLengthHeader adds middleware that validates request content-length\n// is set to value greater than zero.\nfunc ValidateContentLengthHeader(stack *middleware.Stack) error {\n\treturn stack.Build.Add(&validateContentLength{}, middleware.After)\n}\n\n// ID returns the identifier for the ComputeContentLength.\nfunc (m *validateContentLength) ID() string { return \"ValidateContentLength\" }\n\n// HandleBuild adds the length of the serialized request to the HTTP header\n// if the length can be determined.\nfunc (m *validateContentLength) HandleBuild(\n\tctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,\n) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\treq, ok := in.Request.(*Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown request type %T\", req)\n\t}\n\n\t// if request content-length was set to less than 0, return an error\n\tif req.ContentLength < 0 {\n\t\treturn out, metadata, fmt.Errorf(\n\t\t\t\"content length for payload is required and must be at least 0\")\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// WithHeaderComment instruments a middleware stack to append an HTTP field\n// comment to the given header as specified in RFC 9110\n// (https://www.rfc-editor.org/rfc/rfc9110#name-comments).\n//\n// The header is case-insensitive. If the provided header exists when the\n// middleware runs, the content will be inserted as-is enclosed in parentheses.\n//\n// Note that per the HTTP specification, comments are only allowed in fields\n// containing \"comment\" as part of their field value definition, but this API\n// will NOT verify whether the provided header is one of them.\n//\n// WithHeaderComment MAY be applied more than once to a middleware stack and/or\n// more than once per header.\nfunc WithHeaderComment(header, content string) func(*middleware.Stack) error {\n\treturn func(s *middleware.Stack) error {\n\t\tm, err := getOrAddHeaderComment(s)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"get or add header comment: %v\", err)\n\t\t}\n\n\t\tm.values.Add(header, content)\n\t\treturn nil\n\t}\n}\n\ntype headerCommentMiddleware struct {\n\tvalues http.Header // hijack case-insensitive access APIs\n}\n\nfunc (*headerCommentMiddleware) ID() string {\n\treturn \"headerComment\"\n}\n\nfunc (m *headerCommentMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (\n\tout middleware.BuildOutput, metadata middleware.Metadata, err error,\n) {\n\tr, ok := in.Request.(*Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tfor h, contents := range m.values {\n\t\tfor _, c := range contents {\n\t\t\tif existing := r.Header.Get(h); existing != \"\" {\n\t\t\t\tr.Header.Set(h, fmt.Sprintf(\"%s (%s)\", existing, c))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n\nfunc getOrAddHeaderComment(s *middleware.Stack) (*headerCommentMiddleware, error) {\n\tid := (*headerCommentMiddleware)(nil).ID()\n\tm, ok := s.Build.Get(id)\n\tif !ok {\n\t\tm := &headerCommentMiddleware{values: http.Header{}}\n\t\tif err := s.Build.Add(m, middleware.After); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"add build: %v\", err)\n\t\t}\n\n\t\treturn m, nil\n\t}\n\n\thc, ok := m.(*headerCommentMiddleware)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"existing middleware w/ id %s is not *headerCommentMiddleware\", id)\n\t}\n\n\treturn hc, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype isContentTypeAutoSet struct{}\n\n// SetIsContentTypeDefaultValue returns a Context specifying if the request's\n// content-type header was set to a default value.\nfunc SetIsContentTypeDefaultValue(ctx context.Context, isDefault bool) context.Context {\n\treturn context.WithValue(ctx, isContentTypeAutoSet{}, isDefault)\n}\n\n// GetIsContentTypeDefaultValue returns if the content-type HTTP header on the\n// request is a default value that was auto assigned by an operation\n// serializer. Allows middleware post serialization to know if the content-type\n// was auto set to a default value or not.\n//\n// Also returns false if the Context value was never updated to include if\n// content-type was set to a default value.\nfunc GetIsContentTypeDefaultValue(ctx context.Context) bool {\n\tv, _ := ctx.Value(isContentTypeAutoSet{}).(bool)\n\treturn v\n}\n\n// AddNoPayloadDefaultContentTypeRemover Adds the DefaultContentTypeRemover\n// middleware to the stack after the operation serializer. This middleware will\n// remove the content-type header from the request if it was set as a default\n// value, and no request payload is present.\n//\n// Returns error if unable to add the middleware.\nfunc AddNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) {\n\terr = stack.Serialize.Insert(removeDefaultContentType{},\n\t\t\"OperationSerializer\", middleware.After)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to add %s serialize middleware, %w\",\n\t\t\tremoveDefaultContentType{}.ID(), err)\n\t}\n\n\treturn nil\n}\n\n// RemoveNoPayloadDefaultContentTypeRemover removes the\n// DefaultContentTypeRemover middleware from the stack. Returns an error if\n// unable to remove the middleware.\nfunc RemoveNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) {\n\t_, err = stack.Serialize.Remove(removeDefaultContentType{}.ID())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to remove %s serialize middleware, %w\",\n\t\t\tremoveDefaultContentType{}.ID(), err)\n\n\t}\n\treturn nil\n}\n\n// removeDefaultContentType provides after serialization middleware that will\n// remove the content-type header from an HTTP request if the header was set as\n// a default value by the operation serializer, and there is no request payload.\ntype removeDefaultContentType struct{}\n\n// ID returns the middleware ID\nfunc (removeDefaultContentType) ID() string { return \"RemoveDefaultContentType\" }\n\n// HandleSerialize implements the serialization middleware.\nfunc (removeDefaultContentType) HandleSerialize(\n\tctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler,\n) (\n\tout middleware.SerializeOutput, meta middleware.Metadata, err error,\n) {\n\treq, ok := input.Request.(*Request)\n\tif !ok {\n\t\treturn out, meta, fmt.Errorf(\n\t\t\t\"unexpected request type %T for removeDefaultContentType middleware\",\n\t\t\tinput.Request)\n\t}\n\n\tif GetIsContentTypeDefaultValue(ctx) && req.GetStream() == nil {\n\t\treq.Header.Del(\"Content-Type\")\n\t\tinput.Request = req\n\t}\n\n\treturn next.HandleSerialize(ctx, input)\n}\n\ntype headerValue struct {\n\theader string\n\tvalue  string\n\tappend bool\n}\n\ntype headerValueHelper struct {\n\theaderValues []headerValue\n}\n\nfunc (h *headerValueHelper) addHeaderValue(value headerValue) {\n\th.headerValues = append(h.headerValues, value)\n}\n\nfunc (h *headerValueHelper) ID() string {\n\treturn \"HTTPHeaderHelper\"\n}\n\nfunc (h *headerValueHelper) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (out middleware.BuildOutput, metadata middleware.Metadata, err error) {\n\treq, ok := in.Request.(*Request)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in.Request)\n\t}\n\n\tfor _, value := range h.headerValues {\n\t\tif value.append {\n\t\t\treq.Header.Add(value.header, value.value)\n\t\t} else {\n\t\t\treq.Header.Set(value.header, value.value)\n\t\t}\n\t}\n\n\treturn next.HandleBuild(ctx, in)\n}\n\nfunc getOrAddHeaderValueHelper(stack *middleware.Stack) (*headerValueHelper, error) {\n\tid := (*headerValueHelper)(nil).ID()\n\tm, ok := stack.Build.Get(id)\n\tif !ok {\n\t\tm = &headerValueHelper{}\n\t\terr := stack.Build.Add(m, middleware.After)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trequestUserAgent, ok := m.(*headerValueHelper)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%T for %s middleware did not match expected type\", m, id)\n\t}\n\n\treturn requestUserAgent, nil\n}\n\n// AddHeaderValue returns a stack mutator that adds the header value pair to header.\n// Appends to any existing values if present.\nfunc AddHeaderValue(header string, value string) func(stack *middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\thelper, err := getOrAddHeaderValueHelper(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thelper.addHeaderValue(headerValue{header: header, value: value, append: true})\n\t\treturn nil\n\t}\n}\n\n// SetHeaderValue returns a stack mutator that adds the header value pair to header.\n// Replaces any existing values if present.\nfunc SetHeaderValue(header string, value string) func(stack *middleware.Stack) error {\n\treturn func(stack *middleware.Stack) error {\n\t\thelper, err := getOrAddHeaderValueHelper(stack)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thelper.addHeaderValue(headerValue{header: header, value: value, append: false})\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http/httputil\"\n\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// RequestResponseLogger is a deserialize middleware that will log the request and response HTTP messages and optionally\n// their respective bodies. Will not perform any logging if none of the options are set.\ntype RequestResponseLogger struct {\n\tLogRequest         bool\n\tLogRequestWithBody bool\n\n\tLogResponse         bool\n\tLogResponseWithBody bool\n}\n\n// ID is the middleware identifier.\nfunc (r *RequestResponseLogger) ID() string {\n\treturn \"RequestResponseLogger\"\n}\n\n// HandleDeserialize will log the request and response HTTP messages if configured accordingly.\nfunc (r *RequestResponseLogger) HandleDeserialize(\n\tctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tlogger := middleware.GetLogger(ctx)\n\n\tif r.LogRequest || r.LogRequestWithBody {\n\t\tsmithyRequest, ok := in.Request.(*Request)\n\t\tif !ok {\n\t\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", in)\n\t\t}\n\n\t\trc := smithyRequest.Build(ctx)\n\t\treqBytes, err := httputil.DumpRequestOut(rc, r.LogRequestWithBody)\n\t\tif err != nil {\n\t\t\treturn out, metadata, err\n\t\t}\n\n\t\tlogger.Logf(logging.Debug, \"Request\\n%v\", string(reqBytes))\n\n\t\tif r.LogRequestWithBody {\n\t\t\tsmithyRequest, err = smithyRequest.SetStream(rc.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn out, metadata, err\n\t\t\t}\n\t\t\tin.Request = smithyRequest\n\t\t}\n\t}\n\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\n\tif (err == nil) && (r.LogResponse || r.LogResponseWithBody) {\n\t\tsmithyResponse, ok := out.RawResponse.(*Response)\n\t\tif !ok {\n\t\t\treturn out, metadata, fmt.Errorf(\"unknown transport type %T\", out.RawResponse)\n\t\t}\n\n\t\trespBytes, err := httputil.DumpResponse(smithyResponse.Response, r.LogResponseWithBody)\n\t\tif err != nil {\n\t\t\treturn out, metadata, fmt.Errorf(\"failed to dump response %w\", err)\n\t\t}\n\n\t\tlogger.Logf(logging.Debug, \"Response\\n%v\", string(respBytes))\n\t}\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\ntype (\n\thostnameImmutableKey struct{}\n\thostPrefixDisableKey struct{}\n)\n\n// GetHostnameImmutable retrieves whether the endpoint hostname should be considered\n// immutable or not.\n//\n// Scoped to stack values. Use middleware#ClearStackValues to clear all stack\n// values.\nfunc GetHostnameImmutable(ctx context.Context) (v bool) {\n\tv, _ = middleware.GetStackValue(ctx, hostnameImmutableKey{}).(bool)\n\treturn v\n}\n\n// SetHostnameImmutable sets or modifies whether the request's endpoint hostname\n// should be considered immutable or not.\n//\n// Scoped to stack values. Use middleware#ClearStackValues to clear all stack\n// values.\nfunc SetHostnameImmutable(ctx context.Context, value bool) context.Context {\n\treturn middleware.WithStackValue(ctx, hostnameImmutableKey{}, value)\n}\n\n// IsEndpointHostPrefixDisabled retrieves whether the hostname prefixing is\n// disabled.\n//\n// Scoped to stack values. Use middleware#ClearStackValues to clear all stack\n// values.\nfunc IsEndpointHostPrefixDisabled(ctx context.Context) (v bool) {\n\tv, _ = middleware.GetStackValue(ctx, hostPrefixDisableKey{}).(bool)\n\treturn v\n}\n\n// DisableEndpointHostPrefix sets or modifies whether the request's endpoint host\n// prefixing should be disabled. If value is true, endpoint host prefixing\n// will be disabled.\n//\n// Scoped to stack values. Use middleware#ClearStackValues to clear all stack\n// values.\nfunc DisableEndpointHostPrefix(ctx context.Context, value bool) context.Context {\n\treturn middleware.WithStackValue(ctx, hostPrefixDisableKey{}, value)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"strings\"\n)\n\n// MinimumProtocolError is an error type indicating that the established connection did not meet the expected minimum\n// HTTP protocol version.\ntype MinimumProtocolError struct {\n\tproto              string\n\texpectedProtoMajor int\n\texpectedProtoMinor int\n}\n\n// Error returns the error message.\nfunc (m *MinimumProtocolError) Error() string {\n\treturn fmt.Sprintf(\"operation requires minimum HTTP protocol of HTTP/%d.%d, but was %s\",\n\t\tm.expectedProtoMajor, m.expectedProtoMinor, m.proto)\n}\n\n// RequireMinimumProtocol is a deserialization middleware that asserts that the established HTTP connection\n// meets the minimum major ad minor version.\ntype RequireMinimumProtocol struct {\n\tProtoMajor int\n\tProtoMinor int\n}\n\n// AddRequireMinimumProtocol adds the RequireMinimumProtocol middleware to the stack using the provided minimum\n// protocol major and minor version.\nfunc AddRequireMinimumProtocol(stack *middleware.Stack, major, minor int) error {\n\treturn stack.Deserialize.Insert(&RequireMinimumProtocol{\n\t\tProtoMajor: major,\n\t\tProtoMinor: minor,\n\t}, \"OperationDeserializer\", middleware.Before)\n}\n\n// ID returns the middleware identifier string.\nfunc (r *RequireMinimumProtocol) ID() string {\n\treturn \"RequireMinimumProtocol\"\n}\n\n// HandleDeserialize asserts that the established connection is a HTTP connection with the minimum major and minor\n// protocol version.\nfunc (r *RequireMinimumProtocol) HandleDeserialize(\n\tctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler,\n) (\n\tout middleware.DeserializeOutput, metadata middleware.Metadata, err error,\n) {\n\tout, metadata, err = next.HandleDeserialize(ctx, in)\n\tif err != nil {\n\t\treturn out, metadata, err\n\t}\n\n\tresponse, ok := out.RawResponse.(*Response)\n\tif !ok {\n\t\treturn out, metadata, fmt.Errorf(\"unknown transport type: %T\", out.RawResponse)\n\t}\n\n\tif !strings.HasPrefix(response.Proto, \"HTTP\") {\n\t\treturn out, metadata, &MinimumProtocolError{\n\t\t\tproto:              response.Proto,\n\t\t\texpectedProtoMajor: r.ProtoMajor,\n\t\t\texpectedProtoMinor: r.ProtoMinor,\n\t\t}\n\t}\n\n\tif response.ProtoMajor < r.ProtoMajor || response.ProtoMinor < r.ProtoMinor {\n\t\treturn out, metadata, &MinimumProtocolError{\n\t\t\tproto:              response.Proto,\n\t\t\texpectedProtoMajor: r.ProtoMajor,\n\t\t\texpectedProtoMinor: r.ProtoMinor,\n\t\t}\n\t}\n\n\treturn out, metadata, err\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/properties.go",
    "content": "package http\n\nimport smithy \"github.com/aws/smithy-go\"\n\ntype (\n\tsigV4SigningNameKey   struct{}\n\tsigV4SigningRegionKey struct{}\n\n\tsigV4ASigningNameKey    struct{}\n\tsigV4ASigningRegionsKey struct{}\n\n\tisUnsignedPayloadKey     struct{}\n\tdisableDoubleEncodingKey struct{}\n)\n\n// GetSigV4SigningName gets the signing name from Properties.\nfunc GetSigV4SigningName(p *smithy.Properties) (string, bool) {\n\tv, ok := p.Get(sigV4SigningNameKey{}).(string)\n\treturn v, ok\n}\n\n// SetSigV4SigningName sets the signing name on Properties.\nfunc SetSigV4SigningName(p *smithy.Properties, name string) {\n\tp.Set(sigV4SigningNameKey{}, name)\n}\n\n// GetSigV4SigningRegion gets the signing region from Properties.\nfunc GetSigV4SigningRegion(p *smithy.Properties) (string, bool) {\n\tv, ok := p.Get(sigV4SigningRegionKey{}).(string)\n\treturn v, ok\n}\n\n// SetSigV4SigningRegion sets the signing region on Properties.\nfunc SetSigV4SigningRegion(p *smithy.Properties, region string) {\n\tp.Set(sigV4SigningRegionKey{}, region)\n}\n\n// GetSigV4ASigningName gets the v4a signing name from Properties.\nfunc GetSigV4ASigningName(p *smithy.Properties) (string, bool) {\n\tv, ok := p.Get(sigV4ASigningNameKey{}).(string)\n\treturn v, ok\n}\n\n// SetSigV4ASigningName sets the signing name on Properties.\nfunc SetSigV4ASigningName(p *smithy.Properties, name string) {\n\tp.Set(sigV4ASigningNameKey{}, name)\n}\n\n// GetSigV4ASigningRegion gets the v4a signing region set from Properties.\nfunc GetSigV4ASigningRegions(p *smithy.Properties) ([]string, bool) {\n\tv, ok := p.Get(sigV4ASigningRegionsKey{}).([]string)\n\treturn v, ok\n}\n\n// SetSigV4ASigningRegions sets the v4a signing region set on Properties.\nfunc SetSigV4ASigningRegions(p *smithy.Properties, regions []string) {\n\tp.Set(sigV4ASigningRegionsKey{}, regions)\n}\n\n// GetIsUnsignedPayload gets whether the payload is unsigned from Properties.\nfunc GetIsUnsignedPayload(p *smithy.Properties) (bool, bool) {\n\tv, ok := p.Get(isUnsignedPayloadKey{}).(bool)\n\treturn v, ok\n}\n\n// SetIsUnsignedPayload sets whether the payload is unsigned on Properties.\nfunc SetIsUnsignedPayload(p *smithy.Properties, isUnsignedPayload bool) {\n\tp.Set(isUnsignedPayloadKey{}, isUnsignedPayload)\n}\n\n// GetDisableDoubleEncoding gets whether the payload is unsigned from Properties.\nfunc GetDisableDoubleEncoding(p *smithy.Properties) (bool, bool) {\n\tv, ok := p.Get(disableDoubleEncodingKey{}).(bool)\n\treturn v, ok\n}\n\n// SetDisableDoubleEncoding sets whether the payload is unsigned on Properties.\nfunc SetDisableDoubleEncoding(p *smithy.Properties, disableDoubleEncoding bool) {\n\tp.Set(disableDoubleEncodingKey{}, disableDoubleEncoding)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/request.go",
    "content": "package http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\tiointernal \"github.com/aws/smithy-go/transport/http/internal/io\"\n)\n\n// Request provides the HTTP specific request structure for HTTP specific\n// middleware steps to use to serialize input, and send an operation's request.\ntype Request struct {\n\t*http.Request\n\tstream           io.Reader\n\tisStreamSeekable bool\n\tstreamStartPos   int64\n}\n\n// NewStackRequest returns an initialized request ready to be populated with the\n// HTTP request details. Returns empty interface so the function can be used as\n// a parameter to the Smithy middleware Stack constructor.\nfunc NewStackRequest() interface{} {\n\treturn &Request{\n\t\tRequest: &http.Request{\n\t\t\tURL:           &url.URL{},\n\t\t\tHeader:        http.Header{},\n\t\t\tContentLength: -1, // default to unknown length\n\t\t},\n\t}\n}\n\n// IsHTTPS returns if the request is HTTPS. Returns false if no endpoint URL is set.\nfunc (r *Request) IsHTTPS() bool {\n\tif r.URL == nil {\n\t\treturn false\n\t}\n\treturn strings.EqualFold(r.URL.Scheme, \"https\")\n}\n\n// Clone returns a deep copy of the Request for the new context. A reference to\n// the Stream is copied, but the underlying stream is not copied.\nfunc (r *Request) Clone() *Request {\n\trc := *r\n\trc.Request = rc.Request.Clone(context.TODO())\n\treturn &rc\n}\n\n// StreamLength returns the number of bytes of the serialized stream attached\n// to the request and ok set. If the length cannot be determined, an error will\n// be returned.\nfunc (r *Request) StreamLength() (size int64, ok bool, err error) {\n\treturn streamLength(r.stream, r.isStreamSeekable, r.streamStartPos)\n}\n\nfunc streamLength(stream io.Reader, seekable bool, startPos int64) (size int64, ok bool, err error) {\n\tif stream == nil {\n\t\treturn 0, true, nil\n\t}\n\n\tif l, ok := stream.(interface{ Len() int }); ok {\n\t\treturn int64(l.Len()), true, nil\n\t}\n\n\tif !seekable {\n\t\treturn 0, false, nil\n\t}\n\n\ts := stream.(io.Seeker)\n\tendOffset, err := s.Seek(0, io.SeekEnd)\n\tif err != nil {\n\t\treturn 0, false, err\n\t}\n\n\t// The reason to seek to streamStartPos instead of 0 is to ensure that the\n\t// SDK only sends the stream from the starting position the user's\n\t// application provided it to the SDK at. For example application opens a\n\t// file, and wants to skip the first N bytes uploading the rest. The\n\t// application would move the file's offset N bytes, then hand it off to\n\t// the SDK to send the remaining. The SDK should respect that initial offset.\n\t_, err = s.Seek(startPos, io.SeekStart)\n\tif err != nil {\n\t\treturn 0, false, err\n\t}\n\n\treturn endOffset - startPos, true, nil\n}\n\n// RewindStream will rewind the io.Reader to the relative start position if it\n// is an io.Seeker.\nfunc (r *Request) RewindStream() error {\n\t// If there is no stream there is nothing to rewind.\n\tif r.stream == nil {\n\t\treturn nil\n\t}\n\n\tif !r.isStreamSeekable {\n\t\treturn fmt.Errorf(\"request stream is not seekable\")\n\t}\n\t_, err := r.stream.(io.Seeker).Seek(r.streamStartPos, io.SeekStart)\n\treturn err\n}\n\n// GetStream returns the request stream io.Reader if a stream is set. If no\n// stream is present nil will be returned.\nfunc (r *Request) GetStream() io.Reader {\n\treturn r.stream\n}\n\n// IsStreamSeekable returns whether the stream is seekable.\nfunc (r *Request) IsStreamSeekable() bool {\n\treturn r.isStreamSeekable\n}\n\n// SetStream returns a clone of the request with the stream set to the provided\n// reader. May return an error if the provided reader is seekable but returns\n// an error.\nfunc (r *Request) SetStream(reader io.Reader) (rc *Request, err error) {\n\trc = r.Clone()\n\n\tif reader == http.NoBody {\n\t\treader = nil\n\t}\n\n\tvar isStreamSeekable bool\n\tvar streamStartPos int64\n\tswitch v := reader.(type) {\n\tcase io.Seeker:\n\t\tn, err := v.Seek(0, io.SeekCurrent)\n\t\tif err != nil {\n\t\t\treturn r, err\n\t\t}\n\t\tisStreamSeekable = true\n\t\tstreamStartPos = n\n\tdefault:\n\t\t// If the stream length can be determined, and is determined to be empty,\n\t\t// use a nil stream to prevent confusion between empty vs not-empty\n\t\t// streams.\n\t\tlength, ok, err := streamLength(reader, false, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t} else if ok && length == 0 {\n\t\t\treader = nil\n\t\t}\n\t}\n\n\trc.stream = reader\n\trc.isStreamSeekable = isStreamSeekable\n\trc.streamStartPos = streamStartPos\n\n\treturn rc, err\n}\n\n// Build returns a build standard HTTP request value from the Smithy request.\n// The request's stream is wrapped in a safe container that allows it to be\n// reused for subsequent attempts.\nfunc (r *Request) Build(ctx context.Context) *http.Request {\n\treq := r.Request.Clone(ctx)\n\n\tif r.stream == nil && req.ContentLength == -1 {\n\t\treq.ContentLength = 0\n\t}\n\n\tswitch stream := r.stream.(type) {\n\tcase *io.PipeReader:\n\t\treq.Body = ioutil.NopCloser(stream)\n\t\treq.ContentLength = -1\n\tdefault:\n\t\t// HTTP Client Request must only have a non-nil body if the\n\t\t// ContentLength is explicitly unknown (-1) or non-zero. The HTTP\n\t\t// Client will interpret a non-nil body and ContentLength 0 as\n\t\t// \"unknown\". This is unwanted behavior.\n\t\tif req.ContentLength != 0 && r.stream != nil {\n\t\t\treq.Body = iointernal.NewSafeReadCloser(ioutil.NopCloser(stream))\n\t\t}\n\t}\n\n\treturn req\n}\n\n// RequestCloner is a function that can take an input request type and clone the request\n// for use in a subsequent retry attempt.\nfunc RequestCloner(v interface{}) interface{} {\n\treturn v.(*Request).Clone()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/response.go",
    "content": "package http\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// Response provides the HTTP specific response structure for HTTP specific\n// middleware steps to use to deserialize the response from an operation call.\ntype Response struct {\n\t*http.Response\n}\n\n// ResponseError provides the HTTP centric error type wrapping the underlying\n// error with the HTTP response value.\ntype ResponseError struct {\n\tResponse *Response\n\tErr      error\n}\n\n// HTTPStatusCode returns the HTTP response status code received from the service.\nfunc (e *ResponseError) HTTPStatusCode() int { return e.Response.StatusCode }\n\n// HTTPResponse returns the HTTP response received from the service.\nfunc (e *ResponseError) HTTPResponse() *Response { return e.Response }\n\n// Unwrap returns the nested error if any, or nil.\nfunc (e *ResponseError) Unwrap() error { return e.Err }\n\nfunc (e *ResponseError) Error() string {\n\treturn fmt.Sprintf(\n\t\t\"http response error StatusCode: %d, %v\",\n\t\te.Response.StatusCode, e.Err)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/time.go",
    "content": "package http\n\nimport (\n\t\"time\"\n\n\tsmithytime \"github.com/aws/smithy-go/time\"\n)\n\n// ParseTime parses a time string like the HTTP Date header. This uses a more\n// relaxed rule set for date parsing compared to the standard library.\nfunc ParseTime(text string) (t time.Time, err error) {\n\treturn smithytime.ParseHTTPDate(text)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/url.go",
    "content": "package http\n\nimport \"strings\"\n\n// JoinPath returns an absolute URL path composed of the two paths provided.\n// Enforces that the returned path begins with '/'. If added path is empty the\n// returned path suffix will match the first parameter suffix.\nfunc JoinPath(a, b string) string {\n\tif len(a) == 0 {\n\t\ta = \"/\"\n\t} else if a[0] != '/' {\n\t\ta = \"/\" + a\n\t}\n\n\tif len(b) != 0 && b[0] == '/' {\n\t\tb = b[1:]\n\t}\n\n\tif len(b) != 0 && len(a) > 1 && a[len(a)-1] != '/' {\n\t\ta = a + \"/\"\n\t}\n\n\treturn a + b\n}\n\n// JoinRawQuery returns an absolute raw query expression. Any duplicate '&'\n// will be collapsed to single separator between values.\nfunc JoinRawQuery(a, b string) string {\n\ta = strings.TrimFunc(a, isAmpersand)\n\tb = strings.TrimFunc(b, isAmpersand)\n\n\tif len(a) == 0 {\n\t\treturn b\n\t}\n\tif len(b) == 0 {\n\t\treturn a\n\t}\n\n\treturn a + \"&\" + b\n}\n\nfunc isAmpersand(v rune) bool {\n\treturn v == '&'\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/transport/http/user_agent.go",
    "content": "package http\n\nimport (\n\t\"strings\"\n)\n\n// UserAgentBuilder is a builder for a HTTP User-Agent string.\ntype UserAgentBuilder struct {\n\tsb strings.Builder\n}\n\n// NewUserAgentBuilder returns a new UserAgentBuilder.\nfunc NewUserAgentBuilder() *UserAgentBuilder {\n\treturn &UserAgentBuilder{sb: strings.Builder{}}\n}\n\n// AddKey adds the named component/product to the agent string\nfunc (u *UserAgentBuilder) AddKey(key string) {\n\tu.appendTo(key)\n}\n\n// AddKeyValue adds the named key to the agent string with the given value.\nfunc (u *UserAgentBuilder) AddKeyValue(key, value string) {\n\tu.appendTo(key + \"/\" + value)\n}\n\n// Build returns the constructed User-Agent string. May be called multiple times.\nfunc (u *UserAgentBuilder) Build() string {\n\treturn u.sb.String()\n}\n\nfunc (u *UserAgentBuilder) appendTo(value string) {\n\tif u.sb.Len() > 0 {\n\t\tu.sb.WriteRune(' ')\n\t}\n\tu.sb.WriteString(value)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/validation.go",
    "content": "package smithy\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// An InvalidParamsError provides wrapping of invalid parameter errors found when\n// validating API operation input parameters.\ntype InvalidParamsError struct {\n\t// Context is the base context of the invalid parameter group.\n\tContext string\n\terrs    []InvalidParamError\n}\n\n// Add adds a new invalid parameter error to the collection of invalid\n// parameters. The context of the invalid parameter will be updated to reflect\n// this collection.\nfunc (e *InvalidParamsError) Add(err InvalidParamError) {\n\terr.SetContext(e.Context)\n\te.errs = append(e.errs, err)\n}\n\n// AddNested adds the invalid parameter errors from another InvalidParamsError\n// value into this collection. The nested errors will have their nested context\n// updated and base context to reflect the merging.\n//\n// Use for nested validations errors.\nfunc (e *InvalidParamsError) AddNested(nestedCtx string, nested InvalidParamsError) {\n\tfor _, err := range nested.errs {\n\t\terr.SetContext(e.Context)\n\t\terr.AddNestedContext(nestedCtx)\n\t\te.errs = append(e.errs, err)\n\t}\n}\n\n// Len returns the number of invalid parameter errors\nfunc (e *InvalidParamsError) Len() int {\n\treturn len(e.errs)\n}\n\n// Error returns the string formatted form of the invalid parameters.\nfunc (e InvalidParamsError) Error() string {\n\tw := &bytes.Buffer{}\n\tfmt.Fprintf(w, \"%d validation error(s) found.\\n\", len(e.errs))\n\n\tfor _, err := range e.errs {\n\t\tfmt.Fprintf(w, \"- %s\\n\", err.Error())\n\t}\n\n\treturn w.String()\n}\n\n// Errs returns a slice of the invalid parameters\nfunc (e InvalidParamsError) Errs() []error {\n\terrs := make([]error, len(e.errs))\n\tfor i := 0; i < len(errs); i++ {\n\t\terrs[i] = e.errs[i]\n\t}\n\n\treturn errs\n}\n\n// An InvalidParamError represents an invalid parameter error type.\ntype InvalidParamError interface {\n\terror\n\n\t// Field name the error occurred on.\n\tField() string\n\n\t// SetContext updates the context of the error.\n\tSetContext(string)\n\n\t// AddNestedContext updates the error's context to include a nested level.\n\tAddNestedContext(string)\n}\n\ntype invalidParamError struct {\n\tcontext       string\n\tnestedContext string\n\tfield         string\n\treason        string\n}\n\n// Error returns the string version of the invalid parameter error.\nfunc (e invalidParamError) Error() string {\n\treturn fmt.Sprintf(\"%s, %s.\", e.reason, e.Field())\n}\n\n// Field Returns the field and context the error occurred.\nfunc (e invalidParamError) Field() string {\n\tsb := &strings.Builder{}\n\tsb.WriteString(e.context)\n\tif sb.Len() > 0 {\n\t\tif len(e.nestedContext) == 0 || (len(e.nestedContext) > 0 && e.nestedContext[:1] != \"[\") {\n\t\t\tsb.WriteRune('.')\n\t\t}\n\t}\n\tif len(e.nestedContext) > 0 {\n\t\tsb.WriteString(e.nestedContext)\n\t\tsb.WriteRune('.')\n\t}\n\tsb.WriteString(e.field)\n\treturn sb.String()\n}\n\n// SetContext updates the base context of the error.\nfunc (e *invalidParamError) SetContext(ctx string) {\n\te.context = ctx\n}\n\n// AddNestedContext prepends a context to the field's path.\nfunc (e *invalidParamError) AddNestedContext(ctx string) {\n\tif len(e.nestedContext) == 0 {\n\t\te.nestedContext = ctx\n\t\treturn\n\t}\n\t// Check if our nested context is an index into a slice or map\n\tif e.nestedContext[:1] != \"[\" {\n\t\te.nestedContext = fmt.Sprintf(\"%s.%s\", ctx, e.nestedContext)\n\t\treturn\n\t}\n\te.nestedContext = ctx + e.nestedContext\n}\n\n// An ParamRequiredError represents an required parameter error.\ntype ParamRequiredError struct {\n\tinvalidParamError\n}\n\n// NewErrParamRequired creates a new required parameter error.\nfunc NewErrParamRequired(field string) *ParamRequiredError {\n\treturn &ParamRequiredError{\n\t\tinvalidParamError{\n\t\t\tfield:  field,\n\t\t\treason: fmt.Sprintf(\"missing required field\"),\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/waiter/logger.go",
    "content": "package waiter\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/aws/smithy-go/logging\"\n\t\"github.com/aws/smithy-go/middleware\"\n)\n\n// Logger is the Logger middleware used by the waiter to log an attempt\ntype Logger struct {\n\t// Attempt is the current attempt to be logged\n\tAttempt int64\n}\n\n// ID representing the Logger middleware\nfunc (*Logger) ID() string {\n\treturn \"WaiterLogger\"\n}\n\n// HandleInitialize performs handling of request in initialize stack step\nfunc (m *Logger) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (\n\tout middleware.InitializeOutput, metadata middleware.Metadata, err error,\n) {\n\tlogger := middleware.GetLogger(ctx)\n\n\tlogger.Logf(logging.Debug, fmt.Sprintf(\"attempting waiter request, attempt count: %d\", m.Attempt))\n\n\treturn next.HandleInitialize(ctx, in)\n}\n\n// AddLogger is a helper util to add waiter logger after `SetLogger` middleware in\nfunc (m Logger) AddLogger(stack *middleware.Stack) error {\n\treturn stack.Initialize.Insert(&m, \"SetLogger\", middleware.After)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/smithy-go/waiter/waiter.go",
    "content": "package waiter\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"time\"\n\n\t\"github.com/aws/smithy-go/rand\"\n)\n\n// ComputeDelay computes delay between waiter attempts. The function takes in a current attempt count,\n// minimum delay, maximum delay, and remaining wait time for waiter as input. The inputs minDelay and maxDelay\n// must always be greater than 0, along with minDelay lesser than or equal to maxDelay.\n//\n// Returns the computed delay and if next attempt count is possible within the given input time constraints.\n// Note that the zeroth attempt results in no delay.\nfunc ComputeDelay(attempt int64, minDelay, maxDelay, remainingTime time.Duration) (delay time.Duration, err error) {\n\t// zeroth attempt, no delay\n\tif attempt <= 0 {\n\t\treturn 0, nil\n\t}\n\n\t// remainingTime is zero or less, no delay\n\tif remainingTime <= 0 {\n\t\treturn 0, nil\n\t}\n\n\t// validate min delay is greater than 0\n\tif minDelay == 0 {\n\t\treturn 0, fmt.Errorf(\"minDelay must be greater than zero when computing Delay\")\n\t}\n\n\t// validate max delay is greater than 0\n\tif maxDelay == 0 {\n\t\treturn 0, fmt.Errorf(\"maxDelay must be greater than zero when computing Delay\")\n\t}\n\n\t// Get attempt ceiling to prevent integer overflow.\n\tattemptCeiling := (math.Log(float64(maxDelay/minDelay)) / math.Log(2)) + 1\n\n\tif attempt > int64(attemptCeiling) {\n\t\tdelay = maxDelay\n\t} else {\n\t\t// Compute exponential delay based on attempt.\n\t\tri := 1 << uint64(attempt-1)\n\t\t// compute delay\n\t\tdelay = minDelay * time.Duration(ri)\n\t}\n\n\tif delay != minDelay {\n\t\t// randomize to get jitter between min delay and delay value\n\t\td, err := rand.CryptoRandInt63n(int64(delay - minDelay))\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"error computing retry jitter, %w\", err)\n\t\t}\n\n\t\tdelay = time.Duration(d) + minDelay\n\t}\n\n\t// check if this is the last attempt possible and compute delay accordingly\n\tif remainingTime-delay <= minDelay {\n\t\tdelay = remainingTime - minDelay\n\t}\n\n\treturn delay, nil\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/LICENSE",
    "content": "Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n1. Definitions.\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n1. You must give any other recipients of the Work or Derivative Works a copy of this License; and\n2. You must cause any modified files to carry prominent notices stating that You changed the files; and\n3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n4. If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. \n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\nEND OF TERMS AND CONDITIONS\nAPPENDIX: How to apply the Apache License to your work\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n***\n\nNote: Other license terms may apply to certain, identified software files contained within or distributed with the accompanying software if such terms are included in the directory containing the accompanying software. Such other license terms will then apply in lieu of the terms of the software license above.\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api/client.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage api\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache\"\n)\n\nconst (\n\tproxyEndpointScheme = \"https://\"\n\tprogramName         = \"docker-credential-ecr-login\"\n\tecrPublicName       = \"public.ecr.aws\"\n\tecrPublicEndpoint   = proxyEndpointScheme + ecrPublicName\n)\n\nvar ecrPattern = regexp.MustCompile(`(^[a-zA-Z0-9][a-zA-Z0-9-_]*)\\.dkr\\.ecr(-fips)?\\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\\.amazonaws\\.com(\\.cn)?$`)\n\ntype Service string\n\nconst (\n\tServiceECR       Service = \"ecr\"\n\tServiceECRPublic Service = \"ecr-public\"\n)\n\n// Registry in ECR\ntype Registry struct {\n\tService Service\n\tID      string\n\tFIPS    bool\n\tRegion  string\n}\n\n// ExtractRegistry returns the ECR registry behind a given service endpoint\nfunc ExtractRegistry(input string) (*Registry, error) {\n\tif strings.HasPrefix(input, proxyEndpointScheme) {\n\t\tinput = strings.TrimPrefix(input, proxyEndpointScheme)\n\t}\n\tserverURL, err := url.Parse(proxyEndpointScheme + input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif serverURL.Hostname() == ecrPublicName {\n\t\treturn &Registry{\n\t\t\tService: ServiceECRPublic,\n\t\t}, nil\n\t}\n\tmatches := ecrPattern.FindStringSubmatch(serverURL.Hostname())\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(programName + \" can only be used with Amazon Elastic Container Registry.\")\n\t} else if len(matches) < 3 {\n\t\treturn nil, fmt.Errorf(\"%q is not a valid repository URI for Amazon Elastic Container Registry.\", input)\n\t}\n\treturn &Registry{\n\t\tService: ServiceECR,\n\t\tID:      matches[1],\n\t\tFIPS:    matches[2] == \"-fips\",\n\t\tRegion:  matches[3],\n\t}, nil\n}\n\n// Client used for calling ECR service\ntype Client interface {\n\tGetCredentials(serverURL string) (*Auth, error)\n\tGetCredentialsByRegistryID(registryID string) (*Auth, error)\n\tListCredentials() ([]*Auth, error)\n}\n\n// Auth credentials returned by ECR service to allow docker login\ntype Auth struct {\n\tProxyEndpoint string\n\tUsername      string\n\tPassword      string\n}\n\ntype defaultClient struct {\n\tecrClient       ECRAPI\n\tecrPublicClient ECRPublicAPI\n\tcredentialCache cache.CredentialsCache\n}\n\ntype ECRAPI interface {\n\tGetAuthorizationToken(context.Context, *ecr.GetAuthorizationTokenInput, ...func(*ecr.Options)) (*ecr.GetAuthorizationTokenOutput, error)\n}\n\ntype ECRPublicAPI interface {\n\tGetAuthorizationToken(context.Context, *ecrpublic.GetAuthorizationTokenInput, ...func(*ecrpublic.Options)) (*ecrpublic.GetAuthorizationTokenOutput, error)\n}\n\n// GetCredentials returns username, password, and proxyEndpoint\nfunc (c *defaultClient) GetCredentials(serverURL string) (*Auth, error) {\n\tregistry, err := ExtractRegistry(serverURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.\n\t\tWithField(\"service\", registry.Service).\n\t\tWithField(\"registry\", registry.ID).\n\t\tWithField(\"region\", registry.Region).\n\t\tWithField(\"serverURL\", serverURL).\n\t\tDebug(\"Retrieving credentials\")\n\tswitch registry.Service {\n\tcase ServiceECR:\n\t\treturn c.GetCredentialsByRegistryID(registry.ID)\n\tcase ServiceECRPublic:\n\t\treturn c.GetPublicCredentials()\n\t}\n\treturn nil, fmt.Errorf(\"unknown service %q\", registry.Service)\n}\n\n// GetCredentialsByRegistryID returns username, password, and proxyEndpoint\nfunc (c *defaultClient) GetCredentialsByRegistryID(registryID string) (*Auth, error) {\n\tcachedEntry := c.credentialCache.Get(registryID)\n\tif cachedEntry != nil {\n\t\tif cachedEntry.IsValid(time.Now()) {\n\t\t\tlogrus.WithField(\"registry\", registryID).Debug(\"Using cached token\")\n\t\t\treturn extractToken(cachedEntry.AuthorizationToken, cachedEntry.ProxyEndpoint)\n\t\t}\n\t\tlogrus.\n\t\t\tWithField(\"requestedAt\", cachedEntry.RequestedAt).\n\t\t\tWithField(\"expiresAt\", cachedEntry.ExpiresAt).\n\t\t\tDebug(\"Cached token is no longer valid\")\n\t}\n\n\tauth, err := c.getAuthorizationToken(registryID)\n\n\t// if we have a cached token, fall back to avoid failing the request. This may result an expired token\n\t// being returned, but if there is a 500 or timeout from the service side, we'd like to attempt to re-use an\n\t// old token. We invalidate tokens prior to their expiration date to help mitigate this scenario.\n\tif err != nil && cachedEntry != nil {\n\t\tlogrus.WithError(err).Info(\"Got error fetching authorization token. Falling back to cached token.\")\n\t\treturn extractToken(cachedEntry.AuthorizationToken, cachedEntry.ProxyEndpoint)\n\t}\n\treturn auth, err\n}\n\nfunc (c *defaultClient) GetPublicCredentials() (*Auth, error) {\n\tcachedEntry := c.credentialCache.GetPublic()\n\tif cachedEntry != nil {\n\t\tif cachedEntry.IsValid(time.Now()) {\n\t\t\tlogrus.WithField(\"registry\", ecrPublicName).Debug(\"Using cached token\")\n\t\t\treturn extractToken(cachedEntry.AuthorizationToken, cachedEntry.ProxyEndpoint)\n\t\t}\n\t\tlogrus.\n\t\t\tWithField(\"requestedAt\", cachedEntry.RequestedAt).\n\t\t\tWithField(\"expiresAt\", cachedEntry.ExpiresAt).\n\t\t\tDebug(\"Cached token is no longer valid\")\n\t}\n\n\tauth, err := c.getPublicAuthorizationToken()\n\t// if we have a cached token, fall back to avoid failing the request. This may result an expired token\n\t// being returned, but if there is a 500 or timeout from the service side, we'd like to attempt to re-use an\n\t// old token. We invalidate tokens prior to their expiration date to help mitigate this scenario.\n\tif err != nil && cachedEntry != nil {\n\t\tlogrus.WithError(err).Info(\"Got error fetching authorization token. Falling back to cached token.\")\n\t\treturn extractToken(cachedEntry.AuthorizationToken, cachedEntry.ProxyEndpoint)\n\t}\n\treturn auth, err\n}\n\nfunc (c *defaultClient) ListCredentials() ([]*Auth, error) {\n\t// prime the cache with default authorization tokens\n\t_, err := c.GetCredentialsByRegistryID(\"\")\n\tif err != nil {\n\t\tlogrus.WithError(err).Debug(\"couldn't get authorization token for default registry\")\n\t}\n\t_, err = c.GetPublicCredentials()\n\tif err != nil {\n\t\tlogrus.WithError(err).Debug(\"couldn't get authorization token for public registry\")\n\t}\n\n\tauths := make([]*Auth, 0)\n\tfor _, authEntry := range c.credentialCache.List() {\n\t\tauth, err := extractToken(authEntry.AuthorizationToken, authEntry.ProxyEndpoint)\n\t\tif err != nil {\n\t\t\tlogrus.WithError(err).Debug(\"Could not extract token\")\n\t\t} else {\n\t\t\tauths = append(auths, auth)\n\t\t}\n\t}\n\n\treturn auths, nil\n}\n\nfunc (c *defaultClient) getAuthorizationToken(registryID string) (*Auth, error) {\n\tvar input *ecr.GetAuthorizationTokenInput\n\tif registryID == \"\" {\n\t\tlogrus.Debug(\"Calling ECR.GetAuthorizationToken for default registry\")\n\t\tinput = &ecr.GetAuthorizationTokenInput{}\n\t} else {\n\t\tlogrus.WithField(\"registry\", registryID).Debug(\"Calling ECR.GetAuthorizationToken\")\n\t\tinput = &ecr.GetAuthorizationTokenInput{\n\t\t\tRegistryIds: []string{registryID},\n\t\t}\n\t}\n\n\toutput, err := c.ecrClient.GetAuthorizationToken(context.TODO(), input)\n\tif err != nil || output == nil {\n\t\tif err == nil {\n\t\t\tif registryID == \"\" {\n\t\t\t\terr = fmt.Errorf(\"missing AuthorizationData in ECR response for default registry\")\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"missing AuthorizationData in ECR response for %s\", registryID)\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"ecr: Failed to get authorization token: %w\", err)\n\t}\n\n\tfor _, authData := range output.AuthorizationData {\n\t\tif authData.ProxyEndpoint != nil && authData.AuthorizationToken != nil {\n\t\t\tauthEntry := cache.AuthEntry{\n\t\t\t\tAuthorizationToken: aws.ToString(authData.AuthorizationToken),\n\t\t\t\tRequestedAt:        time.Now(),\n\t\t\t\tExpiresAt:          aws.ToTime(authData.ExpiresAt),\n\t\t\t\tProxyEndpoint:      aws.ToString(authData.ProxyEndpoint),\n\t\t\t\tService:            cache.ServiceECR,\n\t\t\t}\n\t\t\tregistry, err := ExtractRegistry(authEntry.ProxyEndpoint)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Invalid ProxyEndpoint returned by ECR: %s\", authEntry.ProxyEndpoint)\n\t\t\t}\n\t\t\tauth, err := extractToken(authEntry.AuthorizationToken, authEntry.ProxyEndpoint)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tc.credentialCache.Set(registry.ID, &authEntry)\n\t\t\treturn auth, nil\n\t\t}\n\t}\n\tif registryID == \"\" {\n\t\treturn nil, fmt.Errorf(\"No AuthorizationToken found for default registry\")\n\t}\n\treturn nil, fmt.Errorf(\"No AuthorizationToken found for %s\", registryID)\n}\n\nfunc (c *defaultClient) getPublicAuthorizationToken() (*Auth, error) {\n\tvar input *ecrpublic.GetAuthorizationTokenInput\n\n\toutput, err := c.ecrPublicClient.GetAuthorizationToken(context.TODO(), input)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ecr: failed to get authorization token: %w\", err)\n\t}\n\tif output == nil || output.AuthorizationData == nil {\n\t\treturn nil, fmt.Errorf(\"ecr: missing AuthorizationData in ECR Public response\")\n\t}\n\tauthData := output.AuthorizationData\n\ttoken, err := extractToken(aws.ToString(authData.AuthorizationToken), ecrPublicEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tauthEntry := cache.AuthEntry{\n\t\tAuthorizationToken: aws.ToString(authData.AuthorizationToken),\n\t\tRequestedAt:        time.Now(),\n\t\tExpiresAt:          aws.ToTime(authData.ExpiresAt),\n\t\tProxyEndpoint:      ecrPublicEndpoint,\n\t\tService:            cache.ServiceECRPublic,\n\t}\n\tc.credentialCache.Set(ecrPublicName, &authEntry)\n\treturn token, nil\n}\n\nfunc extractToken(token string, proxyEndpoint string) (*Auth, error) {\n\tdecodedToken, err := base64.StdEncoding.DecodeString(token)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid token: %w\", err)\n\t}\n\n\tparts := strings.SplitN(string(decodedToken), \":\", 2)\n\tif len(parts) < 2 {\n\t\treturn nil, fmt.Errorf(\"invalid token: expected two parts, got %d\", len(parts))\n\t}\n\n\treturn &Auth{\n\t\tUsername:      parts[0],\n\t\tPassword:      parts[1],\n\t\tProxyEndpoint: proxyEndpoint,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api/factory.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage api\n\nimport (\n\t\"context\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/config\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecr\"\n\t\"github.com/aws/aws-sdk-go-v2/service/ecrpublic\"\n\t\"github.com/aws/smithy-go/middleware\"\n\t\"github.com/aws/smithy-go/transport/http\"\n\t\"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache\"\n\t\"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/version\"\n)\n\n// Options makes the constructors more configurable\ntype Options struct {\n\tConfig   aws.Config\n\tCacheDir string\n}\n\n// ClientFactory is a factory for creating clients to interact with ECR\ntype ClientFactory interface {\n\tNewClient(awsConfig aws.Config) Client\n\tNewClientWithOptions(opts Options) Client\n\tNewClientFromRegion(region string) Client\n\tNewClientWithFipsEndpoint(region string) (Client, error)\n\tNewClientWithDefaults() Client\n}\n\n// DefaultClientFactory is a default implementation of the ClientFactory\ntype DefaultClientFactory struct{}\n\nvar userAgentLoadOption = config.WithAPIOptions([]func(*middleware.Stack) error{\n\thttp.AddHeaderValue(\"User-Agent\", \"amazon-ecr-credential-helper/\"+version.Version),\n})\n\n// NewClientWithDefaults creates the client and defaults region\nfunc (defaultClientFactory DefaultClientFactory) NewClientWithDefaults() Client {\n\tawsConfig, err := config.LoadDefaultConfig(context.TODO(), userAgentLoadOption)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn defaultClientFactory.NewClientWithOptions(Options{Config: awsConfig})\n}\n\n// NewClientWithFipsEndpoint overrides the default ECR service endpoint in a given region to use the FIPS endpoint\nfunc (defaultClientFactory DefaultClientFactory) NewClientWithFipsEndpoint(region string) (Client, error) {\n\tawsConfig, err := config.LoadDefaultConfig(\n\t\tcontext.TODO(),\n\t\tuserAgentLoadOption,\n\t\tconfig.WithRegion(region),\n\t\tconfig.WithEndpointDiscovery(aws.EndpointDiscoveryEnabled),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn defaultClientFactory.NewClientWithOptions(Options{Config: awsConfig}), nil\n}\n\n// NewClientFromRegion uses the region to create the client\nfunc (defaultClientFactory DefaultClientFactory) NewClientFromRegion(region string) Client {\n\tawsConfig, err := config.LoadDefaultConfig(\n\t\tcontext.TODO(),\n\t\tuserAgentLoadOption,\n\t\tconfig.WithRegion(region),\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn defaultClientFactory.NewClientWithOptions(Options{\n\t\tConfig: awsConfig,\n\t})\n}\n\n// NewClient Create new client with AWS Config\nfunc (defaultClientFactory DefaultClientFactory) NewClient(awsConfig aws.Config) Client {\n\treturn defaultClientFactory.NewClientWithOptions(Options{Config: awsConfig})\n}\n\n// NewClientWithOptions Create new client with Options\nfunc (defaultClientFactory DefaultClientFactory) NewClientWithOptions(opts Options) Client {\n\t// The ECR Public API is only available in us-east-1 today\n\tpublicConfig := opts.Config.Copy()\n\tpublicConfig.Region = \"us-east-1\"\n\treturn &defaultClient{\n\t\tecrClient:       ecr.NewFromConfig(opts.Config),\n\t\tecrPublicClient: ecrpublic.NewFromConfig(publicConfig),\n\t\tcredentialCache: cache.BuildCredentialsCache(opts.Config, opts.CacheDir),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache/build.go",
    "content": "// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage cache\n\nimport (\n\t\"context\"\n\t\"crypto/md5\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/mitchellh/go-homedir\"\n\t\"github.com/sirupsen/logrus\"\n\n\tecrconfig \"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/config\"\n)\n\nfunc BuildCredentialsCache(config aws.Config, cacheDir string) CredentialsCache {\n\tif os.Getenv(\"AWS_ECR_DISABLE_CACHE\") != \"\" {\n\t\tlogrus.Debug(\"Cache disabled due to AWS_ECR_DISABLE_CACHE\")\n\t\treturn NewNullCredentialsCache()\n\t}\n\n\tif cacheDir == \"\" {\n\t\t//Get cacheDir from env var \"AWS_ECR_CACHE_DIR\" or set to default\n\t\tcacheDir = ecrconfig.GetCacheDir()\n\t}\n\n\tcacheDir, err := homedir.Expand(cacheDir)\n\tif err != nil {\n\t\tlogrus.WithError(err).Debug(\"Could not expand cache path, disabling cache\")\n\t\treturn NewNullCredentialsCache()\n\t}\n\n\tcacheFilename := \"cache.json\"\n\n\tcredentials, err := config.Credentials.Retrieve(context.TODO())\n\tif err != nil {\n\t\tlogrus.WithError(err).Debug(\"Could not fetch credentials for cache prefix, disabling cache\")\n\t\treturn NewNullCredentialsCache()\n\t}\n\n\treturn NewFileCredentialsCache(cacheDir, cacheFilename, credentialsCachePrefix(config.Region, credentials), credentialsPublicCacheKey(credentials))\n}\n\n// Determine a key prefix for a credentials cache. Because auth tokens are scoped to an account and region, rely on provided\n// region, as well as hash of the access key.\nfunc credentialsCachePrefix(region string, credentials aws.Credentials) string {\n\treturn fmt.Sprintf(\"%s-%s-\", region, checksum(credentials.AccessKeyID))\n}\n\nfunc credentialsPublicCacheKey(credentials aws.Credentials) string {\n\treturn fmt.Sprintf(\"%s-%s\", ServiceECRPublic, checksum(credentials.AccessKeyID))\n}\n\n// Base64 encodes an MD5 checksum. Relied on for uniqueness, and not for cryptographic security.\nfunc checksum(text string) string {\n\thasher := md5.New()\n\tdata := hasher.Sum([]byte(text))\n\treturn base64.StdEncoding.EncodeToString(data)\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache/credentials.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage cache\n\nimport (\n\t\"time\"\n)\n\ntype CredentialsCache interface {\n\tGet(registry string) *AuthEntry\n\tGetPublic() *AuthEntry\n\tSet(registry string, entry *AuthEntry)\n\tList() []*AuthEntry\n\tClear()\n}\n\ntype Service string\n\nconst (\n\tServiceECR       Service = \"ecr\"\n\tServiceECRPublic Service = \"ecr-public\"\n)\n\ntype AuthEntry struct {\n\tAuthorizationToken string\n\tRequestedAt        time.Time\n\tExpiresAt          time.Time\n\tProxyEndpoint      string\n\tService            Service\n}\n\n// IsValid checks if AuthEntry is still valid at testTime. AuthEntries expire at 1/2 of their original\n// requested window.\nfunc (authEntry *AuthEntry) IsValid(testTime time.Time) bool {\n\tvalidWindow := authEntry.ExpiresAt.Sub(authEntry.RequestedAt)\n\trefreshTime := authEntry.ExpiresAt.Add(-1 * validWindow / time.Duration(2))\n\treturn testTime.Before(refreshTime)\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache/file.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage cache\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst registryCacheVersion = \"1.0\"\n\ntype RegistryCache struct {\n\tRegistries map[string]*AuthEntry\n\tVersion    string\n}\n\ntype fileCredentialCache struct {\n\tpath           string\n\tfilename       string\n\tcachePrefixKey string\n\tpublicCacheKey string\n}\n\nfunc newRegistryCache() *RegistryCache {\n\treturn &RegistryCache{\n\t\tRegistries: make(map[string]*AuthEntry),\n\t\tVersion:    registryCacheVersion,\n\t}\n}\n\n// NewFileCredentialsCache returns a new file credentials cache.\n//\n// path is used for temporary files during save, and filename should be a relative filename\n// in the same directory where the cache is serialized and deserialized.\n//\n// cachePrefixKey is used for scoping credentials for a given credential cache (i.e. region and\n// accessKey).\nfunc NewFileCredentialsCache(path string, filename string, cachePrefixKey string, publicCacheKey string) CredentialsCache {\n\tif _, err := os.Stat(path); err != nil {\n\t\tos.MkdirAll(path, 0700)\n\t}\n\treturn &fileCredentialCache{\n\t\tpath:           path,\n\t\tfilename:       filename,\n\t\tcachePrefixKey: cachePrefixKey,\n\t\tpublicCacheKey: publicCacheKey,\n\t}\n}\n\nfunc (f *fileCredentialCache) Get(registry string) *AuthEntry {\n\tlogrus.WithField(\"registry\", registry).Debug(\"Checking file cache\")\n\tregistryCache := f.init()\n\treturn registryCache.Registries[f.cachePrefixKey+registry]\n}\n\nfunc (f *fileCredentialCache) GetPublic() *AuthEntry {\n\tlogrus.Debug(\"Checking file cache for ECR Public\")\n\tregistryCache := f.init()\n\treturn registryCache.Registries[f.publicCacheKey]\n}\n\nfunc (f *fileCredentialCache) Set(registry string, entry *AuthEntry) {\n\tlogrus.\n\t\tWithField(\"registry\", registry).\n\t\tWithField(\"service\", entry.Service).\n\t\tDebug(\"Saving credentials to file cache\")\n\tregistryCache := f.init()\n\n\tkey := f.cachePrefixKey + registry\n\tif entry.Service == ServiceECRPublic {\n\t\tkey = f.publicCacheKey\n\t}\n\tregistryCache.Registries[key] = entry\n\n\terr := f.save(registryCache)\n\tif err != nil {\n\t\tlogrus.WithError(err).Info(\"Could not save cache\")\n\t}\n}\n\n// List returns all of the available AuthEntries (regardless of prefix)\nfunc (f *fileCredentialCache) List() []*AuthEntry {\n\tregistryCache := f.init()\n\n\t// optimize allocation for copy\n\tentries := make([]*AuthEntry, 0, len(registryCache.Registries))\n\n\tfor _, entry := range registryCache.Registries {\n\t\tentries = append(entries, entry)\n\t}\n\n\treturn entries\n}\n\nfunc (f *fileCredentialCache) Clear() {\n\terr := os.Remove(f.fullFilePath())\n\tif err != nil {\n\t\tlogrus.WithError(err).Info(\"Could not clear cache\")\n\t}\n}\n\nfunc (f *fileCredentialCache) fullFilePath() string {\n\treturn filepath.Join(f.path, f.filename)\n}\n\n// Saves credential cache to disk. This writes to a temporary file first, then moves the file to the config location.\n// This eliminates from reading partially written credential files, and reduces (but does not eliminate) concurrent\n// file access. There is not guarantee here for handling multiple writes at once since there is no out of process locking.\nfunc (f *fileCredentialCache) save(registryCache *RegistryCache) error {\n\tfile, err := ioutil.TempFile(f.path, \".config.json.tmp\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbuff, err := json.MarshalIndent(registryCache, \"\", \"  \")\n\tif err != nil {\n\t\tfile.Close()\n\t\tos.Remove(file.Name())\n\t\treturn err\n\t}\n\n\t_, err = file.Write(buff)\n\n\tif err != nil {\n\t\tfile.Close()\n\t\tos.Remove(file.Name())\n\t\treturn err\n\t}\n\n\tfile.Close()\n\t// note this is only atomic when relying on linux syscalls\n\tos.Rename(file.Name(), f.fullFilePath())\n\treturn err\n}\n\nfunc (f *fileCredentialCache) init() *RegistryCache {\n\tregistryCache, err := f.load()\n\tif err != nil {\n\t\tlogrus.WithError(err).Info(\"Could not load existing cache\")\n\t\tf.Clear()\n\t\tregistryCache = newRegistryCache()\n\t}\n\treturn registryCache\n}\n\n// Loading a cache from disk will return errors for malformed or incompatible cache files.\nfunc (f *fileCredentialCache) load() (*RegistryCache, error) {\n\tregistryCache := newRegistryCache()\n\n\tfile, err := os.Open(f.fullFilePath())\n\tif os.IsNotExist(err) {\n\t\treturn registryCache, nil\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer file.Close()\n\n\tif err = json.NewDecoder(file).Decode(&registryCache); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif registryCache.Version != registryCacheVersion {\n\t\treturn nil, fmt.Errorf(\"ecr: Registry cache version %#v is not compatible with %#v, ignoring existing cache\",\n\t\t\tregistryCache.Version,\n\t\t\tregistryCacheVersion)\n\t}\n\n\t// migrate entries\n\tfor key := range registryCache.Registries {\n\t\tif registryCache.Registries[key].Service == \"\" {\n\t\t\tregistryCache.Registries[key].Service = ServiceECR\n\t\t}\n\t}\n\n\treturn registryCache, nil\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache/null.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage cache\n\ntype nullCredentialsCache struct{}\n\nfunc NewNullCredentialsCache() CredentialsCache {\n\treturn &nullCredentialsCache{}\n}\n\nfunc (n *nullCredentialsCache) Get(_ string) *AuthEntry {\n\treturn nil\n}\n\nfunc (n *nullCredentialsCache) GetPublic() *AuthEntry {\n\treturn nil\n}\n\nfunc (n *nullCredentialsCache) Set(_ string, _ *AuthEntry) {\n}\n\nfunc (n *nullCredentialsCache) List() []*AuthEntry {\n\treturn []*AuthEntry{}\n}\n\nfunc (n *nullCredentialsCache) Clear() {\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/config/cache_dir.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage config\n\nimport \"os\"\n\nfunc GetCacheDir() string {\n\tif cacheDir := os.Getenv(\"AWS_ECR_CACHE_DIR\"); cacheDir != \"\" {\n\t\treturn cacheDir\n\t}\n\treturn \"~/.ecr\"\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/config/log.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage config\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/mitchellh/go-homedir\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc SetupLogger() {\n\tlogrusConfig()\n}\n\nfunc logrusConfig() {\n\tlogdir, err := homedir.Expand(GetCacheDir() + \"/log\")\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"log: failed to find directory: %v\", err)\n\t\tlogdir = os.TempDir()\n\t}\n\t// Clean the path to replace with OS-specific separators\n\tlogdir = filepath.Clean(logdir)\n\terr = os.MkdirAll(logdir, os.ModeDir|0700)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"log: failed to create directory: %v\", err)\n\t\tlogdir = os.TempDir()\n\t}\n\tfile, err := os.OpenFile(filepath.Join(logdir, \"ecr-login.log\"), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)\n\tif err != nil {\n\t\treturn\n\t}\n\tlogrus.SetLevel(logrus.DebugLevel)\n\tlogrus.SetOutput(file)\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/ecr.go",
    "content": "// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy of the\n// License is located at\n//\n//\thttp://aws.amazon.com/apache2.0/\n//\n// or in the \"license\" file accompanying this file. This file is distributed\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n// express or implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\npackage ecr\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api\"\n\t\"github.com/docker/docker-credential-helpers/credentials\"\n)\n\nvar notImplemented = errors.New(\"not implemented\")\n\ntype ECRHelper struct {\n\tclientFactory api.ClientFactory\n\tlogger        *logrus.Logger\n}\n\ntype Option func(*ECRHelper)\n\n// WithClientFactory sets the ClientFactory used to make API requests.\nfunc WithClientFactory(clientFactory api.ClientFactory) Option {\n\treturn func(e *ECRHelper) {\n\t\te.clientFactory = clientFactory\n\t}\n}\n\n// WithLogger sets a new logger instance that writes to the given writer,\n// instead of the default writer which writes to stderr.\n//\n// This can be useful if callers want to redirect logging emitted by this tool\n// to another location.\nfunc WithLogger(w io.Writer) Option {\n\treturn func(e *ECRHelper) {\n\t\tlogger := logrus.New()\n\t\tlogger.Out = w\n\t\te.logger = logger\n\t}\n}\n\n// NewECRHelper returns a new ECRHelper with the given options to override\n// default behavior.\nfunc NewECRHelper(opts ...Option) *ECRHelper {\n\te := &ECRHelper{\n\t\tclientFactory: api.DefaultClientFactory{},\n\t\tlogger:        logrus.StandardLogger(),\n\t}\n\tfor _, o := range opts {\n\t\to(e)\n\t}\n\n\treturn e\n}\n\n// ensure ECRHelper adheres to the credentials.Helper interface\nvar _ credentials.Helper = (*ECRHelper)(nil)\n\nfunc (ECRHelper) Add(creds *credentials.Credentials) error {\n\t// This does not seem to get called\n\treturn notImplemented\n}\n\nfunc (ECRHelper) Delete(serverURL string) error {\n\t// This does not seem to get called\n\treturn notImplemented\n}\n\nfunc (self ECRHelper) Get(serverURL string) (string, string, error) {\n\tregistry, err := api.ExtractRegistry(serverURL)\n\tif err != nil {\n\t\tself.logger.\n\t\t\tWithError(err).\n\t\t\tWithField(\"serverURL\", serverURL).\n\t\t\tError(\"Error parsing the serverURL\")\n\t\treturn \"\", \"\", credentials.NewErrCredentialsNotFound()\n\t}\n\n\tvar client api.Client\n\tif registry.FIPS {\n\t\tclient, err = self.clientFactory.NewClientWithFipsEndpoint(registry.Region)\n\t\tif err != nil {\n\t\t\tself.logger.WithError(err).Error(\"Error resolving FIPS endpoint\")\n\t\t\treturn \"\", \"\", credentials.NewErrCredentialsNotFound()\n\t\t}\n\t} else {\n\t\tclient = self.clientFactory.NewClientFromRegion(registry.Region)\n\t}\n\n\tauth, err := client.GetCredentials(serverURL)\n\tif err != nil {\n\t\tself.logger.WithError(err).Error(\"Error retrieving credentials\")\n\t\treturn \"\", \"\", credentials.NewErrCredentialsNotFound()\n\t}\n\treturn auth.Username, auth.Password, nil\n}\n\nfunc (self ECRHelper) List() (map[string]string, error) {\n\tself.logger.Debug(\"Listing credentials\")\n\tclient := self.clientFactory.NewClientWithDefaults()\n\n\tauths, err := client.ListCredentials()\n\tif err != nil {\n\t\tself.logger.WithError(err).Error(\"Error listing credentials\")\n\t\treturn nil, fmt.Errorf(\"ecr: could not list credentials: %v\", err)\n\t}\n\n\tresult := map[string]string{}\n\n\tfor _, auth := range auths {\n\t\tserverURL := auth.ProxyEndpoint\n\t\tresult[serverURL] = auth.Username\n\t}\n\treturn result, nil\n}\n"
  },
  {
    "path": "vendor/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/version/version.go",
    "content": "package version\n\n// Version indicates which version of the binary is running.\nvar Version = \"development\"\n\n// GitCommitSHA indicates which git shorthash the binary was built off of\nvar GitCommitSHA string\n"
  },
  {
    "path": "vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022 Ayman Bagabas\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/aymanbagabas/go-osc52/v2/README.md",
    "content": "\n# go-osc52\n\n<p>\n    <a href=\"https://github.com/aymanbagabas/go-osc52/releases\"><img src=\"https://img.shields.io/github/release/aymanbagabas/go-osc52.svg\" alt=\"Latest Release\"></a>\n    <a href=\"https://pkg.go.dev/github.com/aymanbagabas/go-osc52/v2?tab=doc\"><img src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"></a>\n</p>\n\nA Go library to work with the [ANSI OSC52](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands) terminal sequence.\n\n## Usage\n\nYou can use this small library to construct an ANSI OSC52 sequence suitable for\nyour terminal.\n\n\n### Example\n\n```go\nimport (\n  \"os\"\n  \"fmt\"\n\n  \"github.com/aymanbagabas/go-osc52/v2\"\n)\n\nfunc main() {\n  s := \"Hello World!\"\n\n  // Copy `s` to system clipboard\n  osc52.New(s).WriteTo(os.Stderr)\n\n  // Copy `s` to primary clipboard (X11)\n  osc52.New(s).Primary().WriteTo(os.Stderr)\n\n  // Query the clipboard\n  osc52.Query().WriteTo(os.Stderr)\n\n  // Clear system clipboard\n  osc52.Clear().WriteTo(os.Stderr)\n\n  // Use the fmt.Stringer interface to copy `s` to system clipboard\n  fmt.Fprint(os.Stderr, osc52.New(s))\n\n  // Or to primary clipboard\n  fmt.Fprint(os.Stderr, osc52.New(s).Primary())\n}\n```\n\n## SSH Example\n\nYou can use this over SSH using [gliderlabs/ssh](https://github.com/gliderlabs/ssh) for instance:\n\n```go\nvar sshSession ssh.Session\nseq := osc52.New(\"Hello awesome!\")\n// Check if term is screen or tmux\npty, _, _ := s.Pty()\nif pty.Term == \"screen\" {\n  seq = seq.Screen()\n} else if isTmux {\n  seq = seq.Tmux()\n}\nseq.WriteTo(sshSession.Stderr())\n```\n\n## Tmux\n\nMake sure you have `set-clipboard on` in your config, otherwise, tmux won't\nallow your application to access the clipboard [^1].\n\nUsing the tmux option, `osc52.TmuxMode` or `osc52.New(...).Tmux()`, wraps the\nOSC52 sequence in a special tmux DCS sequence and pass it to the outer\nterminal. This requires `allow-passthrough on` in your config.\n`allow-passthrough` is no longer enabled by default\n[since tmux 3.3a](https://github.com/tmux/tmux/issues/3218#issuecomment-1153089282) [^2].\n\n[^1]: See [tmux clipboard](https://github.com/tmux/tmux/wiki/Clipboard)\n[^2]: [What is allow-passthrough](https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it)\n\n## Credits\n\n* [vim-oscyank](https://github.com/ojroques/vim-oscyank) this is heavily inspired by vim-oscyank.\n"
  },
  {
    "path": "vendor/github.com/aymanbagabas/go-osc52/v2/osc52.go",
    "content": "// OSC52 is a terminal escape sequence that allows copying text to the clipboard.\n//\n// The sequence consists of the following:\n//\n//\tOSC 52 ; Pc ; Pd BEL\n//\n// Pc is the clipboard choice:\n//\n//\tc: clipboard\n//\tp: primary\n//\tq: secondary (not supported)\n//\ts: select (not supported)\n//\t0-7: cut-buffers (not supported)\n//\n// Pd is the data to copy to the clipboard. This string should be encoded in\n// base64 (RFC-4648).\n//\n// If Pd is \"?\", the terminal replies to the host with the current contents of\n// the clipboard.\n//\n// If Pd is neither a base64 string nor \"?\", the terminal clears the clipboard.\n//\n// See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\n// where Ps = 52 => Manipulate Selection Data.\n//\n// Examples:\n//\n//\t// copy \"hello world\" to the system clipboard\n//\tfmt.Fprint(os.Stderr, osc52.New(\"hello world\"))\n//\n//\t// copy \"hello world\" to the primary Clipboard\n//\tfmt.Fprint(os.Stderr, osc52.New(\"hello world\").Primary())\n//\n//\t// limit the size of the string to copy 10 bytes\n//\tfmt.Fprint(os.Stderr, osc52.New(\"0123456789\").Limit(10))\n//\n//\t// escape the OSC52 sequence for screen using DCS sequences\n//\tfmt.Fprint(os.Stderr, osc52.New(\"hello world\").Screen())\n//\n//\t// escape the OSC52 sequence for Tmux\n//\tfmt.Fprint(os.Stderr, osc52.New(\"hello world\").Tmux())\n//\n//\t// query the system Clipboard\n//\tfmt.Fprint(os.Stderr, osc52.Query())\n//\n//\t// query the primary clipboard\n//\tfmt.Fprint(os.Stderr, osc52.Query().Primary())\n//\n//\t// clear the system Clipboard\n//\tfmt.Fprint(os.Stderr, osc52.Clear())\n//\n//\t// clear the primary Clipboard\n//\tfmt.Fprint(os.Stderr, osc52.Clear().Primary())\npackage osc52\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\n// Clipboard is the clipboard buffer to use.\ntype Clipboard rune\n\nconst (\n\t// SystemClipboard is the system clipboard buffer.\n\tSystemClipboard Clipboard = 'c'\n\t// PrimaryClipboard is the primary clipboard buffer (X11).\n\tPrimaryClipboard = 'p'\n)\n\n// Mode is the mode to use for the OSC52 sequence.\ntype Mode uint\n\nconst (\n\t// DefaultMode is the default OSC52 sequence mode.\n\tDefaultMode Mode = iota\n\t// ScreenMode escapes the OSC52 sequence for screen using DCS sequences.\n\tScreenMode\n\t// TmuxMode escapes the OSC52 sequence for tmux. Not needed if tmux\n\t// clipboard is set to `set-clipboard on`\n\tTmuxMode\n)\n\n// Operation is the OSC52 operation.\ntype Operation uint\n\nconst (\n\t// SetOperation is the copy operation.\n\tSetOperation Operation = iota\n\t// QueryOperation is the query operation.\n\tQueryOperation\n\t// ClearOperation is the clear operation.\n\tClearOperation\n)\n\n// Sequence is the OSC52 sequence.\ntype Sequence struct {\n\tstr       string\n\tlimit     int\n\top        Operation\n\tmode      Mode\n\tclipboard Clipboard\n}\n\nvar _ fmt.Stringer = Sequence{}\n\nvar _ io.WriterTo = Sequence{}\n\n// String returns the OSC52 sequence.\nfunc (s Sequence) String() string {\n\tvar seq strings.Builder\n\t// mode escape sequences start\n\tseq.WriteString(s.seqStart())\n\t// actual OSC52 sequence start\n\tseq.WriteString(fmt.Sprintf(\"\\x1b]52;%c;\", s.clipboard))\n\tswitch s.op {\n\tcase SetOperation:\n\t\tstr := s.str\n\t\tif s.limit > 0 && len(str) > s.limit {\n\t\t\treturn \"\"\n\t\t}\n\t\tb64 := base64.StdEncoding.EncodeToString([]byte(str))\n\t\tswitch s.mode {\n\t\tcase ScreenMode:\n\t\t\t// Screen doesn't support OSC52 but will pass the contents of a DCS\n\t\t\t// sequence to the outer terminal unchanged.\n\t\t\t//\n\t\t\t// Here, we split the encoded string into 76 bytes chunks and then\n\t\t\t// join the chunks with <end-dsc><start-dsc> sequences. Finally,\n\t\t\t// wrap the whole thing in\n\t\t\t// <start-dsc><start-osc52><joined-chunks><end-osc52><end-dsc>.\n\t\t\t// s := strings.SplitN(b64, \"\", 76)\n\t\t\ts := make([]string, 0, len(b64)/76+1)\n\t\t\tfor i := 0; i < len(b64); i += 76 {\n\t\t\t\tend := i + 76\n\t\t\t\tif end > len(b64) {\n\t\t\t\t\tend = len(b64)\n\t\t\t\t}\n\t\t\t\ts = append(s, b64[i:end])\n\t\t\t}\n\t\t\tseq.WriteString(strings.Join(s, \"\\x1b\\\\\\x1bP\"))\n\t\tdefault:\n\t\t\tseq.WriteString(b64)\n\t\t}\n\tcase QueryOperation:\n\t\t// OSC52 queries the clipboard using \"?\"\n\t\tseq.WriteString(\"?\")\n\tcase ClearOperation:\n\t\t// OSC52 clears the clipboard if the data is neither a base64 string nor \"?\"\n\t\t// we're using \"!\" as a default\n\t\tseq.WriteString(\"!\")\n\t}\n\t// actual OSC52 sequence end\n\tseq.WriteString(\"\\x07\")\n\t// mode escape end\n\tseq.WriteString(s.seqEnd())\n\treturn seq.String()\n}\n\n// WriteTo writes the OSC52 sequence to the writer.\nfunc (s Sequence) WriteTo(out io.Writer) (int64, error) {\n\tn, err := out.Write([]byte(s.String()))\n\treturn int64(n), err\n}\n\n// Mode sets the mode for the OSC52 sequence.\nfunc (s Sequence) Mode(m Mode) Sequence {\n\ts.mode = m\n\treturn s\n}\n\n// Tmux sets the mode to TmuxMode.\n// Used to escape the OSC52 sequence for `tmux`.\n//\n// Note: this is not needed if tmux clipboard is set to `set-clipboard on`. If\n// TmuxMode is used, tmux must have `allow-passthrough on` set.\n//\n// This is a syntactic sugar for s.Mode(TmuxMode).\nfunc (s Sequence) Tmux() Sequence {\n\treturn s.Mode(TmuxMode)\n}\n\n// Screen sets the mode to ScreenMode.\n// Used to escape the OSC52 sequence for `screen`.\n//\n// This is a syntactic sugar for s.Mode(ScreenMode).\nfunc (s Sequence) Screen() Sequence {\n\treturn s.Mode(ScreenMode)\n}\n\n// Clipboard sets the clipboard buffer for the OSC52 sequence.\nfunc (s Sequence) Clipboard(c Clipboard) Sequence {\n\ts.clipboard = c\n\treturn s\n}\n\n// Primary sets the clipboard buffer to PrimaryClipboard.\n// This is the X11 primary clipboard.\n//\n// This is a syntactic sugar for s.Clipboard(PrimaryClipboard).\nfunc (s Sequence) Primary() Sequence {\n\treturn s.Clipboard(PrimaryClipboard)\n}\n\n// Limit sets the limit for the OSC52 sequence.\n// The default limit is 0 (no limit).\n//\n// Strings longer than the limit get ignored. Settting the limit to 0 or a\n// negative value disables the limit. Each terminal defines its own escapse\n// sequence limit.\nfunc (s Sequence) Limit(l int) Sequence {\n\tif l < 0 {\n\t\ts.limit = 0\n\t} else {\n\t\ts.limit = l\n\t}\n\treturn s\n}\n\n// Operation sets the operation for the OSC52 sequence.\n// The default operation is SetOperation.\nfunc (s Sequence) Operation(o Operation) Sequence {\n\ts.op = o\n\treturn s\n}\n\n// Clear sets the operation to ClearOperation.\n// This clears the clipboard.\n//\n// This is a syntactic sugar for s.Operation(ClearOperation).\nfunc (s Sequence) Clear() Sequence {\n\treturn s.Operation(ClearOperation)\n}\n\n// Query sets the operation to QueryOperation.\n// This queries the clipboard contents.\n//\n// This is a syntactic sugar for s.Operation(QueryOperation).\nfunc (s Sequence) Query() Sequence {\n\treturn s.Operation(QueryOperation)\n}\n\n// SetString sets the string for the OSC52 sequence. Strings are joined with a\n// space character.\nfunc (s Sequence) SetString(strs ...string) Sequence {\n\ts.str = strings.Join(strs, \" \")\n\treturn s\n}\n\n// New creates a new OSC52 sequence with the given string(s). Strings are\n// joined with a space character.\nfunc New(strs ...string) Sequence {\n\ts := Sequence{\n\t\tstr:       strings.Join(strs, \" \"),\n\t\tlimit:     0,\n\t\tmode:      DefaultMode,\n\t\tclipboard: SystemClipboard,\n\t\top:        SetOperation,\n\t}\n\treturn s\n}\n\n// Query creates a new OSC52 sequence with the QueryOperation.\n// This returns a new OSC52 sequence to query the clipboard contents.\n//\n// This is a syntactic sugar for New().Query().\nfunc Query() Sequence {\n\treturn New().Query()\n}\n\n// Clear creates a new OSC52 sequence with the ClearOperation.\n// This returns a new OSC52 sequence to clear the clipboard.\n//\n// This is a syntactic sugar for New().Clear().\nfunc Clear() Sequence {\n\treturn New().Clear()\n}\n\nfunc (s Sequence) seqStart() string {\n\tswitch s.mode {\n\tcase TmuxMode:\n\t\t// Write the start of a tmux escape sequence.\n\t\treturn \"\\x1bPtmux;\\x1b\"\n\tcase ScreenMode:\n\t\t// Write the start of a DCS sequence.\n\t\treturn \"\\x1bP\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc (s Sequence) seqEnd() string {\n\tswitch s.mode {\n\tcase TmuxMode:\n\t\t// Terminate the tmux escape sequence.\n\t\treturn \"\\x1b\\\\\"\n\tcase ScreenMode:\n\t\t// Write the end of a DCS sequence.\n\t\treturn \"\\x1b\\x5c\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/LICENSE",
    "content": "Copyright (C) 2013 Blake Mizerany\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/exampledata.txt",
    "content": "8\n5\n26\n12\n5\n235\n13\n6\n28\n30\n3\n3\n3\n3\n5\n2\n33\n7\n2\n4\n7\n12\n14\n5\n8\n3\n10\n4\n5\n3\n6\n6\n209\n20\n3\n10\n14\n3\n4\n6\n8\n5\n11\n7\n3\n2\n3\n3\n212\n5\n222\n4\n10\n10\n5\n6\n3\n8\n3\n10\n254\n220\n2\n3\n5\n24\n5\n4\n222\n7\n3\n3\n223\n8\n15\n12\n14\n14\n3\n2\n2\n3\n13\n3\n11\n4\n4\n6\n5\n7\n13\n5\n3\n5\n2\n5\n3\n5\n2\n7\n15\n17\n14\n3\n6\n6\n3\n17\n5\n4\n7\n6\n4\n4\n8\n6\n8\n3\n9\n3\n6\n3\n4\n5\n3\n3\n660\n4\n6\n10\n3\n6\n3\n2\n5\n13\n2\n4\n4\n10\n4\n8\n4\n3\n7\n9\n9\n3\n10\n37\n3\n13\n4\n12\n3\n6\n10\n8\n5\n21\n2\n3\n8\n3\n2\n3\n3\n4\n12\n2\n4\n8\n8\n4\n3\n2\n20\n1\n6\n32\n2\n11\n6\n18\n3\n8\n11\n3\n212\n3\n4\n2\n6\n7\n12\n11\n3\n2\n16\n10\n6\n4\n6\n3\n2\n7\n3\n2\n2\n2\n2\n5\n6\n4\n3\n10\n3\n4\n6\n5\n3\n4\n4\n5\n6\n4\n3\n4\n4\n5\n7\n5\n5\n3\n2\n7\n2\n4\n12\n4\n5\n6\n2\n4\n4\n8\n4\n15\n13\n7\n16\n5\n3\n23\n5\n5\n7\n3\n2\n9\n8\n7\n5\n8\n11\n4\n10\n76\n4\n47\n4\n3\n2\n7\n4\n2\n3\n37\n10\n4\n2\n20\n5\n4\n4\n10\n10\n4\n3\n7\n23\n240\n7\n13\n5\n5\n3\n3\n2\n5\n4\n2\n8\n7\n19\n2\n23\n8\n7\n2\n5\n3\n8\n3\n8\n13\n5\n5\n5\n2\n3\n23\n4\n9\n8\n4\n3\n3\n5\n220\n2\n3\n4\n6\n14\n3\n53\n6\n2\n5\n18\n6\n3\n219\n6\n5\n2\n5\n3\n6\n5\n15\n4\n3\n17\n3\n2\n4\n7\n2\n3\n3\n4\n4\n3\n2\n664\n6\n3\n23\n5\n5\n16\n5\n8\n2\n4\n2\n24\n12\n3\n2\n3\n5\n8\n3\n5\n4\n3\n14\n3\n5\n8\n2\n3\n7\n9\n4\n2\n3\n6\n8\n4\n3\n4\n6\n5\n3\n3\n6\n3\n19\n4\n4\n6\n3\n6\n3\n5\n22\n5\n4\n4\n3\n8\n11\n4\n9\n7\n6\n13\n4\n4\n4\n6\n17\n9\n3\n3\n3\n4\n3\n221\n5\n11\n3\n4\n2\n12\n6\n3\n5\n7\n5\n7\n4\n9\n7\n14\n37\n19\n217\n16\n3\n5\n2\n2\n7\n19\n7\n6\n7\n4\n24\n5\n11\n4\n7\n7\n9\n13\n3\n4\n3\n6\n28\n4\n4\n5\n5\n2\n5\n6\n4\n4\n6\n10\n5\n4\n3\n2\n3\n3\n6\n5\n5\n4\n3\n2\n3\n7\n4\n6\n18\n16\n8\n16\n4\n5\n8\n6\n9\n13\n1545\n6\n215\n6\n5\n6\n3\n45\n31\n5\n2\n2\n4\n3\n3\n2\n5\n4\n3\n5\n7\n7\n4\n5\n8\n5\n4\n749\n2\n31\n9\n11\n2\n11\n5\n4\n4\n7\n9\n11\n4\n5\n4\n7\n3\n4\n6\n2\n15\n3\n4\n3\n4\n3\n5\n2\n13\n5\n5\n3\n3\n23\n4\n4\n5\n7\n4\n13\n2\n4\n3\n4\n2\n6\n2\n7\n3\n5\n5\n3\n29\n5\n4\n4\n3\n10\n2\n3\n79\n16\n6\n6\n7\n7\n3\n5\n5\n7\n4\n3\n7\n9\n5\n6\n5\n9\n6\n3\n6\n4\n17\n2\n10\n9\n3\n6\n2\n3\n21\n22\n5\n11\n4\n2\n17\n2\n224\n2\n14\n3\n4\n4\n2\n4\n4\n4\n4\n5\n3\n4\n4\n10\n2\n6\n3\n3\n5\n7\n2\n7\n5\n6\n3\n218\n2\n2\n5\n2\n6\n3\n5\n222\n14\n6\n33\n3\n2\n5\n3\n3\n3\n9\n5\n3\n3\n2\n7\n4\n3\n4\n3\n5\n6\n5\n26\n4\n13\n9\n7\n3\n221\n3\n3\n4\n4\n4\n4\n2\n18\n5\n3\n7\n9\n6\n8\n3\n10\n3\n11\n9\n5\n4\n17\n5\n5\n6\n6\n3\n2\n4\n12\n17\n6\n7\n218\n4\n2\n4\n10\n3\n5\n15\n3\n9\n4\n3\n3\n6\n29\n3\n3\n4\n5\n5\n3\n8\n5\n6\n6\n7\n5\n3\n5\n3\n29\n2\n31\n5\n15\n24\n16\n5\n207\n4\n3\n3\n2\n15\n4\n4\n13\n5\n5\n4\n6\n10\n2\n7\n8\n4\n6\n20\n5\n3\n4\n3\n12\n12\n5\n17\n7\n3\n3\n3\n6\n10\n3\n5\n25\n80\n4\n9\n3\n2\n11\n3\n3\n2\n3\n8\n7\n5\n5\n19\n5\n3\n3\n12\n11\n2\n6\n5\n5\n5\n3\n3\n3\n4\n209\n14\n3\n2\n5\n19\n4\n4\n3\n4\n14\n5\n6\n4\n13\n9\n7\n4\n7\n10\n2\n9\n5\n7\n2\n8\n4\n6\n5\n5\n222\n8\n7\n12\n5\n216\n3\n4\n4\n6\n3\n14\n8\n7\n13\n4\n3\n3\n3\n3\n17\n5\n4\n3\n33\n6\n6\n33\n7\n5\n3\n8\n7\n5\n2\n9\n4\n2\n233\n24\n7\n4\n8\n10\n3\n4\n15\n2\n16\n3\n3\n13\n12\n7\n5\n4\n207\n4\n2\n4\n27\n15\n2\n5\n2\n25\n6\n5\n5\n6\n13\n6\n18\n6\n4\n12\n225\n10\n7\n5\n2\n2\n11\n4\n14\n21\n8\n10\n3\n5\n4\n232\n2\n5\n5\n3\n7\n17\n11\n6\n6\n23\n4\n6\n3\n5\n4\n2\n17\n3\n6\n5\n8\n3\n2\n2\n14\n9\n4\n4\n2\n5\n5\n3\n7\n6\n12\n6\n10\n3\n6\n2\n2\n19\n5\n4\n4\n9\n2\n4\n13\n3\n5\n6\n3\n6\n5\n4\n9\n6\n3\n5\n7\n3\n6\n6\n4\n3\n10\n6\n3\n221\n3\n5\n3\n6\n4\n8\n5\n3\n6\n4\n4\n2\n54\n5\n6\n11\n3\n3\n4\n4\n4\n3\n7\n3\n11\n11\n7\n10\n6\n13\n223\n213\n15\n231\n7\n3\n7\n228\n2\n3\n4\n4\n5\n6\n7\n4\n13\n3\n4\n5\n3\n6\n4\n6\n7\n2\n4\n3\n4\n3\n3\n6\n3\n7\n3\n5\n18\n5\n6\n8\n10\n3\n3\n3\n2\n4\n2\n4\n4\n5\n6\n6\n4\n10\n13\n3\n12\n5\n12\n16\n8\n4\n19\n11\n2\n4\n5\n6\n8\n5\n6\n4\n18\n10\n4\n2\n216\n6\n6\n6\n2\n4\n12\n8\n3\n11\n5\n6\n14\n5\n3\n13\n4\n5\n4\n5\n3\n28\n6\n3\n7\n219\n3\n9\n7\n3\n10\n6\n3\n4\n19\n5\n7\n11\n6\n15\n19\n4\n13\n11\n3\n7\n5\n10\n2\n8\n11\n2\n6\n4\n6\n24\n6\n3\n3\n3\n3\n6\n18\n4\n11\n4\n2\n5\n10\n8\n3\n9\n5\n3\n4\n5\n6\n2\n5\n7\n4\n4\n14\n6\n4\n4\n5\n5\n7\n2\n4\n3\n7\n3\n3\n6\n4\n5\n4\n4\n4\n3\n3\n3\n3\n8\n14\n2\n3\n5\n3\n2\n4\n5\n3\n7\n3\n3\n18\n3\n4\n4\n5\n7\n3\n3\n3\n13\n5\n4\n8\n211\n5\n5\n3\n5\n2\n5\n4\n2\n655\n6\n3\n5\n11\n2\n5\n3\n12\n9\n15\n11\n5\n12\n217\n2\n6\n17\n3\n3\n207\n5\n5\n4\n5\n9\n3\n2\n8\n5\n4\n3\n2\n5\n12\n4\n14\n5\n4\n2\n13\n5\n8\n4\n225\n4\n3\n4\n5\n4\n3\n3\n6\n23\n9\n2\n6\n7\n233\n4\n4\n6\n18\n3\n4\n6\n3\n4\n4\n2\n3\n7\n4\n13\n227\n4\n3\n5\n4\n2\n12\n9\n17\n3\n7\n14\n6\n4\n5\n21\n4\n8\n9\n2\n9\n25\n16\n3\n6\n4\n7\n8\n5\n2\n3\n5\n4\n3\n3\n5\n3\n3\n3\n2\n3\n19\n2\n4\n3\n4\n2\n3\n4\n4\n2\n4\n3\n3\n3\n2\n6\n3\n17\n5\n6\n4\n3\n13\n5\n3\n3\n3\n4\n9\n4\n2\n14\n12\n4\n5\n24\n4\n3\n37\n12\n11\n21\n3\n4\n3\n13\n4\n2\n3\n15\n4\n11\n4\n4\n3\n8\n3\n4\n4\n12\n8\n5\n3\n3\n4\n2\n220\n3\n5\n223\n3\n3\n3\n10\n3\n15\n4\n241\n9\n7\n3\n6\n6\n23\n4\n13\n7\n3\n4\n7\n4\n9\n3\n3\n4\n10\n5\n5\n1\n5\n24\n2\n4\n5\n5\n6\n14\n3\n8\n2\n3\n5\n13\n13\n3\n5\n2\n3\n15\n3\n4\n2\n10\n4\n4\n4\n5\n5\n3\n5\n3\n4\n7\n4\n27\n3\n6\n4\n15\n3\n5\n6\n6\n5\n4\n8\n3\n9\n2\n6\n3\n4\n3\n7\n4\n18\n3\n11\n3\n3\n8\n9\n7\n24\n3\n219\n7\n10\n4\n5\n9\n12\n2\n5\n4\n4\n4\n3\n3\n19\n5\n8\n16\n8\n6\n22\n3\n23\n3\n242\n9\n4\n3\n3\n5\n7\n3\n3\n5\n8\n3\n7\n5\n14\n8\n10\n3\n4\n3\n7\n4\n6\n7\n4\n10\n4\n3\n11\n3\n7\n10\n3\n13\n6\n8\n12\n10\n5\n7\n9\n3\n4\n7\n7\n10\n8\n30\n9\n19\n4\n3\n19\n15\n4\n13\n3\n215\n223\n4\n7\n4\n8\n17\n16\n3\n7\n6\n5\n5\n4\n12\n3\n7\n4\n4\n13\n4\n5\n2\n5\n6\n5\n6\n6\n7\n10\n18\n23\n9\n3\n3\n6\n5\n2\n4\n2\n7\n3\n3\n2\n5\n5\n14\n10\n224\n6\n3\n4\n3\n7\n5\n9\n3\n6\n4\n2\n5\n11\n4\n3\n3\n2\n8\n4\n7\n4\n10\n7\n3\n3\n18\n18\n17\n3\n3\n3\n4\n5\n3\n3\n4\n12\n7\n3\n11\n13\n5\n4\n7\n13\n5\n4\n11\n3\n12\n3\n6\n4\n4\n21\n4\n6\n9\n5\n3\n10\n8\n4\n6\n4\n4\n6\n5\n4\n8\n6\n4\n6\n4\n4\n5\n9\n6\n3\n4\n2\n9\n3\n18\n2\n4\n3\n13\n3\n6\n6\n8\n7\n9\n3\n2\n16\n3\n4\n6\n3\n2\n33\n22\n14\n4\n9\n12\n4\n5\n6\n3\n23\n9\n4\n3\n5\n5\n3\n4\n5\n3\n5\n3\n10\n4\n5\n5\n8\n4\n4\n6\n8\n5\n4\n3\n4\n6\n3\n3\n3\n5\n9\n12\n6\n5\n9\n3\n5\n3\n2\n2\n2\n18\n3\n2\n21\n2\n5\n4\n6\n4\n5\n10\n3\n9\n3\n2\n10\n7\n3\n6\n6\n4\n4\n8\n12\n7\n3\n7\n3\n3\n9\n3\n4\n5\n4\n4\n5\n5\n10\n15\n4\n4\n14\n6\n227\n3\n14\n5\n216\n22\n5\n4\n2\n2\n6\n3\n4\n2\n9\n9\n4\n3\n28\n13\n11\n4\n5\n3\n3\n2\n3\n3\n5\n3\n4\n3\n5\n23\n26\n3\n4\n5\n6\n4\n6\n3\n5\n5\n3\n4\n3\n2\n2\n2\n7\n14\n3\n6\n7\n17\n2\n2\n15\n14\n16\n4\n6\n7\n13\n6\n4\n5\n6\n16\n3\n3\n28\n3\n6\n15\n3\n9\n2\n4\n6\n3\n3\n22\n4\n12\n6\n7\n2\n5\n4\n10\n3\n16\n6\n9\n2\n5\n12\n7\n5\n5\n5\n5\n2\n11\n9\n17\n4\n3\n11\n7\n3\n5\n15\n4\n3\n4\n211\n8\n7\n5\n4\n7\n6\n7\n6\n3\n6\n5\n6\n5\n3\n4\n4\n26\n4\n6\n10\n4\n4\n3\n2\n3\n3\n4\n5\n9\n3\n9\n4\n4\n5\n5\n8\n2\n4\n2\n3\n8\n4\n11\n19\n5\n8\n6\n3\n5\n6\n12\n3\n2\n4\n16\n12\n3\n4\n4\n8\n6\n5\n6\n6\n219\n8\n222\n6\n16\n3\n13\n19\n5\n4\n3\n11\n6\n10\n4\n7\n7\n12\n5\n3\n3\n5\n6\n10\n3\n8\n2\n5\n4\n7\n2\n4\n4\n2\n12\n9\n6\n4\n2\n40\n2\n4\n10\n4\n223\n4\n2\n20\n6\n7\n24\n5\n4\n5\n2\n20\n16\n6\n5\n13\n2\n3\n3\n19\n3\n2\n4\n5\n6\n7\n11\n12\n5\n6\n7\n7\n3\n5\n3\n5\n3\n14\n3\n4\n4\n2\n11\n1\n7\n3\n9\n6\n11\n12\n5\n8\n6\n221\n4\n2\n12\n4\n3\n15\n4\n5\n226\n7\n218\n7\n5\n4\n5\n18\n4\n5\n9\n4\n4\n2\n9\n18\n18\n9\n5\n6\n6\n3\n3\n7\n3\n5\n4\n4\n4\n12\n3\n6\n31\n5\n4\n7\n3\n6\n5\n6\n5\n11\n2\n2\n11\n11\n6\n7\n5\n8\n7\n10\n5\n23\n7\n4\n3\n5\n34\n2\n5\n23\n7\n3\n6\n8\n4\n4\n4\n2\n5\n3\n8\n5\n4\n8\n25\n2\n3\n17\n8\n3\n4\n8\n7\n3\n15\n6\n5\n7\n21\n9\n5\n6\n6\n5\n3\n2\n3\n10\n3\n6\n3\n14\n7\n4\n4\n8\n7\n8\n2\n6\n12\n4\n213\n6\n5\n21\n8\n2\n5\n23\n3\n11\n2\n3\n6\n25\n2\n3\n6\n7\n6\n6\n4\n4\n6\n3\n17\n9\n7\n6\n4\n3\n10\n7\n2\n3\n3\n3\n11\n8\n3\n7\n6\n4\n14\n36\n3\n4\n3\n3\n22\n13\n21\n4\n2\n7\n4\n4\n17\n15\n3\n7\n11\n2\n4\n7\n6\n209\n6\n3\n2\n2\n24\n4\n9\n4\n3\n3\n3\n29\n2\n2\n4\n3\n3\n5\n4\n6\n3\n3\n2\n4\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/stream.go",
    "content": "// Package quantile computes approximate quantiles over an unbounded data\n// stream within low memory and CPU bounds.\n//\n// A small amount of accuracy is traded to achieve the above properties.\n//\n// Multiple streams can be merged before calling Query to generate a single set\n// of results. This is meaningful when the streams represent the same type of\n// data. See Merge and Samples.\n//\n// For more detailed information about the algorithm used, see:\n//\n// Effective Computation of Biased Quantiles over Data Streams\n//\n// http://www.cs.rutgers.edu/~muthu/bquant.pdf\npackage quantile\n\nimport (\n\t\"math\"\n\t\"sort\"\n)\n\n// Sample holds an observed value and meta information for compression. JSON\n// tags have been added for convenience.\ntype Sample struct {\n\tValue float64 `json:\",string\"`\n\tWidth float64 `json:\",string\"`\n\tDelta float64 `json:\",string\"`\n}\n\n// Samples represents a slice of samples. It implements sort.Interface.\ntype Samples []Sample\n\nfunc (a Samples) Len() int           { return len(a) }\nfunc (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value }\nfunc (a Samples) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\n\ntype invariant func(s *stream, r float64) float64\n\n// NewLowBiased returns an initialized Stream for low-biased quantiles\n// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but\n// error guarantees can still be given even for the lower ranks of the data\n// distribution.\n//\n// The provided epsilon is a relative error, i.e. the true quantile of a value\n// returned by a query is guaranteed to be within (1±Epsilon)*Quantile.\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error\n// properties.\nfunc NewLowBiased(epsilon float64) *Stream {\n\tƒ := func(s *stream, r float64) float64 {\n\t\treturn 2 * epsilon * r\n\t}\n\treturn newStream(ƒ)\n}\n\n// NewHighBiased returns an initialized Stream for high-biased quantiles\n// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but\n// error guarantees can still be given even for the higher ranks of the data\n// distribution.\n//\n// The provided epsilon is a relative error, i.e. the true quantile of a value\n// returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile).\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error\n// properties.\nfunc NewHighBiased(epsilon float64) *Stream {\n\tƒ := func(s *stream, r float64) float64 {\n\t\treturn 2 * epsilon * (s.n - r)\n\t}\n\treturn newStream(ƒ)\n}\n\n// NewTargeted returns an initialized Stream concerned with a particular set of\n// quantile values that are supplied a priori. Knowing these a priori reduces\n// space and computation time. The targets map maps the desired quantiles to\n// their absolute errors, i.e. the true quantile of a value returned by a query\n// is guaranteed to be within (Quantile±Epsilon).\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.\nfunc NewTargeted(targetMap map[float64]float64) *Stream {\n\t// Convert map to slice to avoid slow iterations on a map.\n\t// ƒ is called on the hot path, so converting the map to a slice\n\t// beforehand results in significant CPU savings.\n\ttargets := targetMapToSlice(targetMap)\n\n\tƒ := func(s *stream, r float64) float64 {\n\t\tvar m = math.MaxFloat64\n\t\tvar f float64\n\t\tfor _, t := range targets {\n\t\t\tif t.quantile*s.n <= r {\n\t\t\t\tf = (2 * t.epsilon * r) / t.quantile\n\t\t\t} else {\n\t\t\t\tf = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile)\n\t\t\t}\n\t\t\tif f < m {\n\t\t\t\tm = f\n\t\t\t}\n\t\t}\n\t\treturn m\n\t}\n\treturn newStream(ƒ)\n}\n\ntype target struct {\n\tquantile float64\n\tepsilon  float64\n}\n\nfunc targetMapToSlice(targetMap map[float64]float64) []target {\n\ttargets := make([]target, 0, len(targetMap))\n\n\tfor quantile, epsilon := range targetMap {\n\t\tt := target{\n\t\t\tquantile: quantile,\n\t\t\tepsilon:  epsilon,\n\t\t}\n\t\ttargets = append(targets, t)\n\t}\n\n\treturn targets\n}\n\n// Stream computes quantiles for a stream of float64s. It is not thread-safe by\n// design. Take care when using across multiple goroutines.\ntype Stream struct {\n\t*stream\n\tb      Samples\n\tsorted bool\n}\n\nfunc newStream(ƒ invariant) *Stream {\n\tx := &stream{ƒ: ƒ}\n\treturn &Stream{x, make(Samples, 0, 500), true}\n}\n\n// Insert inserts v into the stream.\nfunc (s *Stream) Insert(v float64) {\n\ts.insert(Sample{Value: v, Width: 1})\n}\n\nfunc (s *Stream) insert(sample Sample) {\n\ts.b = append(s.b, sample)\n\ts.sorted = false\n\tif len(s.b) == cap(s.b) {\n\t\ts.flush()\n\t}\n}\n\n// Query returns the computed qth percentiles value. If s was created with\n// NewTargeted, and q is not in the set of quantiles provided a priori, Query\n// will return an unspecified result.\nfunc (s *Stream) Query(q float64) float64 {\n\tif !s.flushed() {\n\t\t// Fast path when there hasn't been enough data for a flush;\n\t\t// this also yields better accuracy for small sets of data.\n\t\tl := len(s.b)\n\t\tif l == 0 {\n\t\t\treturn 0\n\t\t}\n\t\ti := int(math.Ceil(float64(l) * q))\n\t\tif i > 0 {\n\t\t\ti -= 1\n\t\t}\n\t\ts.maybeSort()\n\t\treturn s.b[i].Value\n\t}\n\ts.flush()\n\treturn s.stream.query(q)\n}\n\n// Merge merges samples into the underlying streams samples. This is handy when\n// merging multiple streams from separate threads, database shards, etc.\n//\n// ATTENTION: This method is broken and does not yield correct results. The\n// underlying algorithm is not capable of merging streams correctly.\nfunc (s *Stream) Merge(samples Samples) {\n\tsort.Sort(samples)\n\ts.stream.merge(samples)\n}\n\n// Reset reinitializes and clears the list reusing the samples buffer memory.\nfunc (s *Stream) Reset() {\n\ts.stream.reset()\n\ts.b = s.b[:0]\n}\n\n// Samples returns stream samples held by s.\nfunc (s *Stream) Samples() Samples {\n\tif !s.flushed() {\n\t\treturn s.b\n\t}\n\ts.flush()\n\treturn s.stream.samples()\n}\n\n// Count returns the total number of samples observed in the stream\n// since initialization.\nfunc (s *Stream) Count() int {\n\treturn len(s.b) + s.stream.count()\n}\n\nfunc (s *Stream) flush() {\n\ts.maybeSort()\n\ts.stream.merge(s.b)\n\ts.b = s.b[:0]\n}\n\nfunc (s *Stream) maybeSort() {\n\tif !s.sorted {\n\t\ts.sorted = true\n\t\tsort.Sort(s.b)\n\t}\n}\n\nfunc (s *Stream) flushed() bool {\n\treturn len(s.stream.l) > 0\n}\n\ntype stream struct {\n\tn float64\n\tl []Sample\n\tƒ invariant\n}\n\nfunc (s *stream) reset() {\n\ts.l = s.l[:0]\n\ts.n = 0\n}\n\nfunc (s *stream) insert(v float64) {\n\ts.merge(Samples{{v, 1, 0}})\n}\n\nfunc (s *stream) merge(samples Samples) {\n\t// TODO(beorn7): This tries to merge not only individual samples, but\n\t// whole summaries. The paper doesn't mention merging summaries at\n\t// all. Unittests show that the merging is inaccurate. Find out how to\n\t// do merges properly.\n\tvar r float64\n\ti := 0\n\tfor _, sample := range samples {\n\t\tfor ; i < len(s.l); i++ {\n\t\t\tc := s.l[i]\n\t\t\tif c.Value > sample.Value {\n\t\t\t\t// Insert at position i.\n\t\t\t\ts.l = append(s.l, Sample{})\n\t\t\t\tcopy(s.l[i+1:], s.l[i:])\n\t\t\t\ts.l[i] = Sample{\n\t\t\t\t\tsample.Value,\n\t\t\t\t\tsample.Width,\n\t\t\t\t\tmath.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1),\n\t\t\t\t\t// TODO(beorn7): How to calculate delta correctly?\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t\tgoto inserted\n\t\t\t}\n\t\t\tr += c.Width\n\t\t}\n\t\ts.l = append(s.l, Sample{sample.Value, sample.Width, 0})\n\t\ti++\n\tinserted:\n\t\ts.n += sample.Width\n\t\tr += sample.Width\n\t}\n\ts.compress()\n}\n\nfunc (s *stream) count() int {\n\treturn int(s.n)\n}\n\nfunc (s *stream) query(q float64) float64 {\n\tt := math.Ceil(q * s.n)\n\tt += math.Ceil(s.ƒ(s, t) / 2)\n\tp := s.l[0]\n\tvar r float64\n\tfor _, c := range s.l[1:] {\n\t\tr += p.Width\n\t\tif r+c.Width+c.Delta > t {\n\t\t\treturn p.Value\n\t\t}\n\t\tp = c\n\t}\n\treturn p.Value\n}\n\nfunc (s *stream) compress() {\n\tif len(s.l) < 2 {\n\t\treturn\n\t}\n\tx := s.l[len(s.l)-1]\n\txi := len(s.l) - 1\n\tr := s.n - 1 - x.Width\n\n\tfor i := len(s.l) - 2; i >= 0; i-- {\n\t\tc := s.l[i]\n\t\tif c.Width+x.Width+x.Delta <= s.ƒ(s, r) {\n\t\t\tx.Width += c.Width\n\t\t\ts.l[xi] = x\n\t\t\t// Remove element at i.\n\t\t\tcopy(s.l[i:], s.l[i+1:])\n\t\t\ts.l = s.l[:len(s.l)-1]\n\t\t\txi -= 1\n\t\t} else {\n\t\t\tx = c\n\t\t\txi = i\n\t\t}\n\t\tr -= c.Width\n\t}\n}\n\nfunc (s *stream) samples() Samples {\n\tsamples := make(Samples, len(s.l))\n\tcopy(samples, s.l)\n\treturn samples\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n\ntarget\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/.travis.yml",
    "content": "language: go\n\nsudo: false\n\nbranches:\n  except:\n    - release\n\nbranches:\n  only:\n    - master\n    - travis\n\ngo:\n  - \"1.11.x\"\n  - tip\n\nmatrix:\n  allow_failures:\n    - go: tip\n\nbefore_install:\n  - if [ -n \"$GH_USER\" ]; then git config --global github.user ${GH_USER}; fi;\n  - if [ -n \"$GH_TOKEN\" ]; then git config --global github.token ${GH_TOKEN}; fi;\n  - go get github.com/mattn/goveralls\n\nbefore_script:\n  - make deps\n\nscript:\n  - make qa\n\nafter_failure:\n  - cat ./target/test/report.xml\n\nafter_success:\n  - if [ \"$TRAVIS_GO_VERSION\" = \"1.11.1\" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi;\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/LICENSE",
    "content": "Copyright (c) 2014 Will Fitzgerald. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/README.md",
    "content": "# bitset\n\n*Go language library to map between non-negative integers and boolean values*\n\n[![Test](https://github.com/bits-and-blooms/bitset/workflows/Test/badge.svg)](https://github.com/willf/bitset/actions?query=workflow%3ATest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/willf/bitset)](https://goreportcard.com/report/github.com/willf/bitset)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/bits-and-blooms/bitset?tab=doc)](https://pkg.go.dev/github.com/bits-and-blooms/bitset?tab=doc)\n\n\nThis library is part of the [awesome go collection](https://github.com/avelino/awesome-go). It is used in production by several important systems:\n\n* [beego](https://github.com/beego/beego)\n* [CubeFS](https://github.com/cubefs/cubefs)\n* [Amazon EKS Distro](https://github.com/aws/eks-distro)\n* [sourcegraph](https://github.com/sourcegraph/sourcegraph)\n* [torrent](https://github.com/anacrolix/torrent)\n\n\n## Description\n\nPackage bitset implements bitsets, a mapping between non-negative integers and boolean values.\nIt should be more efficient than map[uint] bool.\n\nIt provides methods for setting, clearing, flipping, and testing individual integers.\n\nBut it also provides set intersection, union, difference, complement, and symmetric operations, as well as tests to check whether any, all, or no bits are set, and querying a bitset's current length and number of positive bits.\n\nBitSets are expanded to the size of the largest set bit; the memory allocation is approximately Max bits, where Max is the largest set bit. BitSets are never shrunk. On creation, a hint can be given for the number of bits that will be used.\n\nMany of the methods, including Set, Clear, and Flip, return a BitSet pointer, which allows for chaining.\n\n### Example use:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\n\t\"github.com/bits-and-blooms/bitset\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Hello from BitSet!\\n\")\n\tvar b bitset.BitSet\n\t// play some Go Fish\n\tfor i := 0; i < 100; i++ {\n\t\tcard1 := uint(rand.Intn(52))\n\t\tcard2 := uint(rand.Intn(52))\n\t\tb.Set(card1)\n\t\tif b.Test(card2) {\n\t\t\tfmt.Println(\"Go Fish!\")\n\t\t}\n\t\tb.Clear(card1)\n\t}\n\n\t// Chaining\n\tb.Set(10).Set(11)\n\n\tfor i, e := b.NextSet(0); e; i, e = b.NextSet(i + 1) {\n\t\tfmt.Println(\"The following bit is set:\", i)\n\t}\n\tif b.Intersection(bitset.New(100).Set(10)).Count() == 1 {\n\t\tfmt.Println(\"Intersection works.\")\n\t} else {\n\t\tfmt.Println(\"Intersection doesn't work???\")\n\t}\n}\n```\n\n\nPackage documentation is at: https://pkg.go.dev/github.com/bits-and-blooms/bitset?tab=doc\n\n## Serialization\n\n\nYou may serialize a bitset safely and portably to a stream\nof bytes as follows:\n```Go\n    const length = 9585\n\tconst oneEvery = 97\n\tbs := bitset.New(length)\n\t// Add some bits\n\tfor i := uint(0); i < length; i += oneEvery {\n\t\tbs = bs.Set(i)\n\t}\n\n\tvar buf bytes.Buffer\n\tn, err := bs.WriteTo(&buf)\n\tif err != nil {\n\t\t// failure\n\t}\n\t// Here n == buf.Len()\n```\nYou can later deserialize the result as follows:\n\n```Go\n\t// Read back from buf\n\tbs = bitset.New()\n\tn, err = bs.ReadFrom(&buf)\n\tif err != nil {\n\t\t// error\n\t}\n\t// n is the number of bytes read\n```\n\nThe `ReadFrom` function attempts to read the data into the existing\nBitSet instance, to minimize memory allocations.\n\n\n*Performance tip*: \nWhen reading and writing to a file or a network connection, you may get better performance by \nwrapping your streams with `bufio` instances.\n\nE.g., \n```Go\n\tf, err := os.Create(\"myfile\")\n\tw := bufio.NewWriter(f)\n```\n```Go\n\tf, err := os.Open(\"myfile\")\n\tr := bufio.NewReader(f)\n```\n\n## Memory Usage\n\nThe memory usage of a bitset using `N` bits is at least `N/8` bytes. The number of bits in a bitset is at least as large as one plus the greatest bit index you have accessed. Thus it is possible to run out of memory while using a bitset. If you have lots of bits, you might prefer compressed bitsets, like the [Roaring bitmaps](http://roaringbitmap.org) and its [Go implementation](https://github.com/RoaringBitmap/roaring).\n\nThe `roaring` library allows you to go back and forth between compressed Roaring bitmaps and the conventional bitset instances:\n```Go\n\t\t\tmybitset := roaringbitmap.ToBitSet()\n\t\t\tnewroaringbitmap := roaring.FromBitSet(mybitset)\n```\n\n\n## Implementation Note\n\nGo 1.9 introduced a native `math/bits` library. We provide backward compatibility to Go 1.7, which might be removed.\n\nIt is possible that a later version will match the `math/bits` return signature for counts (which is `int`, rather than our library's `uint64`). If so, the version will be bumped.\n\n## Installation\n\n```bash\ngo get github.com/bits-and-blooms/bitset\n```\n\n## Contributing\n\nIf you wish to contribute to this project, please branch and issue a pull request against master (\"[GitHub Flow](https://guides.github.com/introduction/flow/)\")\n\n## Running all tests\n\nBefore committing the code, please check if it passes tests, has adequate coverage, etc.\n```bash\ngo test\ngo test -cover\n```\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/SECURITY.md",
    "content": "# Security Policy\n\n## Reporting a Vulnerability\n\nYou can report privately a vulnerability by email at daniel@lemire.me (current maintainer).\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/azure-pipelines.yml",
    "content": "# Go\n# Build your Go project.\n# Add steps that test, save build artifacts, deploy, and more:\n# https://docs.microsoft.com/azure/devops/pipelines/languages/go\n\ntrigger:\n- master\n\npool:\n  vmImage: 'Ubuntu-16.04'\n\nvariables:\n  GOBIN:  '$(GOPATH)/bin' # Go binaries path\n  GOROOT: '/usr/local/go1.11' # Go installation path\n  GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path\n  modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code\n\nsteps:\n- script: |\n    mkdir -p '$(GOBIN)'\n    mkdir -p '$(GOPATH)/pkg'\n    mkdir -p '$(modulePath)'\n    shopt -s extglob\n    shopt -s dotglob\n    mv !(gopath) '$(modulePath)'\n    echo '##vso[task.prependpath]$(GOBIN)'\n    echo '##vso[task.prependpath]$(GOROOT)/bin'\n  displayName: 'Set up the Go workspace'\n\n- script: |\n    go version\n    go get -v -t -d ./...\n    if [ -f Gopkg.toml ]; then\n        curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\n        dep ensure\n    fi\n    go build -v .\n  workingDirectory: '$(modulePath)'\n  displayName: 'Get dependencies, then build'\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/bitset.go",
    "content": "/*\nPackage bitset implements bitsets, a mapping\nbetween non-negative integers and boolean values. It should be more\nefficient than map[uint] bool.\n\nIt provides methods for setting, clearing, flipping, and testing\nindividual integers.\n\nBut it also provides set intersection, union, difference,\ncomplement, and symmetric operations, as well as tests to\ncheck whether any, all, or no bits are set, and querying a\nbitset's current length and number of positive bits.\n\nBitSets are expanded to the size of the largest set bit; the\nmemory allocation is approximately Max bits, where Max is\nthe largest set bit. BitSets are never shrunk. On creation,\na hint can be given for the number of bits that will be used.\n\nMany of the methods, including Set,Clear, and Flip, return\na BitSet pointer, which allows for chaining.\n\nExample use:\n\n\timport \"bitset\"\n\tvar b BitSet\n\tb.Set(10).Set(11)\n\tif b.Test(1000) {\n\t\tb.Clear(1000)\n\t}\n\tif B.Intersection(bitset.New(100).Set(10)).Count() > 1 {\n\t\tfmt.Println(\"Intersection works.\")\n\t}\n\nAs an alternative to BitSets, one should check out the 'big' package,\nwhich provides a (less set-theoretical) view of bitsets.\n*/\npackage bitset\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/binary\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n)\n\n// the wordSize of a bit set\nconst wordSize = uint(64)\n\n// the wordSize of a bit set in bytes\nconst wordBytes = wordSize / 8\n\n// log2WordSize is lg(wordSize)\nconst log2WordSize = uint(6)\n\n// allBits has every bit set\nconst allBits uint64 = 0xffffffffffffffff\n\n// default binary BigEndian\nvar binaryOrder binary.ByteOrder = binary.BigEndian\n\n// default json encoding base64.URLEncoding\nvar base64Encoding = base64.URLEncoding\n\n// Base64StdEncoding Marshal/Unmarshal BitSet with base64.StdEncoding(Default: base64.URLEncoding)\nfunc Base64StdEncoding() { base64Encoding = base64.StdEncoding }\n\n// LittleEndian Marshal/Unmarshal Binary as Little Endian(Default: binary.BigEndian)\nfunc LittleEndian() { binaryOrder = binary.LittleEndian }\n\n// A BitSet is a set of bits. The zero value of a BitSet is an empty set of length 0.\ntype BitSet struct {\n\tlength uint\n\tset    []uint64\n}\n\n// Error is used to distinguish errors (panics) generated in this package.\ntype Error string\n\n// safeSet will fixup b.set to be non-nil and return the field value\nfunc (b *BitSet) safeSet() []uint64 {\n\tif b.set == nil {\n\t\tb.set = make([]uint64, wordsNeeded(0))\n\t}\n\treturn b.set\n}\n\n// SetBitsetFrom fills the bitset with an array of integers without creating a new BitSet instance\nfunc (b *BitSet) SetBitsetFrom(buf []uint64) {\n\tb.length = uint(len(buf)) * 64\n\tb.set = buf\n}\n\n// From is a constructor used to create a BitSet from an array of words\nfunc From(buf []uint64) *BitSet {\n\treturn FromWithLength(uint(len(buf))*64, buf)\n}\n\n// FromWithLength constructs from an array of words and length.\nfunc FromWithLength(len uint, set []uint64) *BitSet {\n\treturn &BitSet{len, set}\n}\n\n// Bytes returns the bitset as array of words\nfunc (b *BitSet) Bytes() []uint64 {\n\treturn b.set\n}\n\n// wordsNeeded calculates the number of words needed for i bits\nfunc wordsNeeded(i uint) int {\n\tif i > (Cap() - wordSize + 1) {\n\t\treturn int(Cap() >> log2WordSize)\n\t}\n\treturn int((i + (wordSize - 1)) >> log2WordSize)\n}\n\n// wordsNeededUnbound calculates the number of words needed for i bits, possibly exceeding the capacity.\n// This function is useful if you know that the capacity cannot be exceeded (e.g., you have an existing bitmap).\nfunc wordsNeededUnbound(i uint) int {\n\treturn int((i + (wordSize - 1)) >> log2WordSize)\n}\n\n// wordsIndex calculates the index of words in a `uint64`\nfunc wordsIndex(i uint) uint {\n\treturn i & (wordSize - 1)\n}\n\n// New creates a new BitSet with a hint that length bits will be required\nfunc New(length uint) (bset *BitSet) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tbset = &BitSet{\n\t\t\t\t0,\n\t\t\t\tmake([]uint64, 0),\n\t\t\t}\n\t\t}\n\t}()\n\n\tbset = &BitSet{\n\t\tlength,\n\t\tmake([]uint64, wordsNeeded(length)),\n\t}\n\n\treturn bset\n}\n\n// Cap returns the total possible capacity, or number of bits\nfunc Cap() uint {\n\treturn ^uint(0)\n}\n\n// Len returns the number of bits in the BitSet.\n// Note the difference to method Count, see example.\nfunc (b *BitSet) Len() uint {\n\treturn b.length\n}\n\n// extendSet adds additional words to incorporate new bits if needed\nfunc (b *BitSet) extendSet(i uint) {\n\tif i >= Cap() {\n\t\tpanic(\"You are exceeding the capacity\")\n\t}\n\tnsize := wordsNeeded(i + 1)\n\tif b.set == nil {\n\t\tb.set = make([]uint64, nsize)\n\t} else if cap(b.set) >= nsize {\n\t\tb.set = b.set[:nsize] // fast resize\n\t} else if len(b.set) < nsize {\n\t\tnewset := make([]uint64, nsize, 2*nsize) // increase capacity 2x\n\t\tcopy(newset, b.set)\n\t\tb.set = newset\n\t}\n\tb.length = i + 1\n}\n\n// Test whether bit i is set.\nfunc (b *BitSet) Test(i uint) bool {\n\tif i >= b.length {\n\t\treturn false\n\t}\n\treturn b.set[i>>log2WordSize]&(1<<wordsIndex(i)) != 0\n}\n\n// Set bit i to 1, the capacity of the bitset is automatically\n// increased accordingly.\n// If i>= Cap(), this function will panic.\n// Warning: using a very large value for 'i'\n// may lead to a memory shortage and a panic: the caller is responsible\n// for providing sensible parameters in line with their memory capacity.\nfunc (b *BitSet) Set(i uint) *BitSet {\n\tif i >= b.length { // if we need more bits, make 'em\n\t\tb.extendSet(i)\n\t}\n\tb.set[i>>log2WordSize] |= 1 << wordsIndex(i)\n\treturn b\n}\n\n// Clear bit i to 0\nfunc (b *BitSet) Clear(i uint) *BitSet {\n\tif i >= b.length {\n\t\treturn b\n\t}\n\tb.set[i>>log2WordSize] &^= 1 << wordsIndex(i)\n\treturn b\n}\n\n// SetTo sets bit i to value.\n// If i>= Cap(), this function will panic.\n// Warning: using a very large value for 'i'\n// may lead to a memory shortage and a panic: the caller is responsible\n// for providing sensible parameters in line with their memory capacity.\nfunc (b *BitSet) SetTo(i uint, value bool) *BitSet {\n\tif value {\n\t\treturn b.Set(i)\n\t}\n\treturn b.Clear(i)\n}\n\n// Flip bit at i.\n// If i>= Cap(), this function will panic.\n// Warning: using a very large value for 'i'\n// may lead to a memory shortage and a panic: the caller is responsible\n// for providing sensible parameters in line with their memory capacity.\nfunc (b *BitSet) Flip(i uint) *BitSet {\n\tif i >= b.length {\n\t\treturn b.Set(i)\n\t}\n\tb.set[i>>log2WordSize] ^= 1 << wordsIndex(i)\n\treturn b\n}\n\n// FlipRange bit in [start, end).\n// If end>= Cap(), this function will panic.\n// Warning: using a very large value for 'end'\n// may lead to a memory shortage and a panic: the caller is responsible\n// for providing sensible parameters in line with their memory capacity.\nfunc (b *BitSet) FlipRange(start, end uint) *BitSet {\n\tif start >= end {\n\t\treturn b\n\t}\n\tif end-1 >= b.length { // if we need more bits, make 'em\n\t\tb.extendSet(end - 1)\n\t}\n\tvar startWord uint = start >> log2WordSize\n\tvar endWord uint = end >> log2WordSize\n\tb.set[startWord] ^= ^(^uint64(0) << wordsIndex(start))\n\tif endWord > 0 {\n\t\t// bounds check elimination\n\t\tdata := b.set\n\t\t_ = data[endWord-1]\n\t\tfor i := startWord; i < endWord; i++ {\n\t\t\tdata[i] = ^data[i]\n\t\t}\n\t}\n\tif end&(wordSize-1) != 0 {\n\t\tb.set[endWord] ^= ^uint64(0) >> wordsIndex(-end)\n\t}\n\treturn b\n}\n\n// Shrink shrinks BitSet so that the provided value is the last possible\n// set value. It clears all bits > the provided index and reduces the size\n// and length of the set.\n//\n// Note that the parameter value is not the new length in bits: it is the\n// maximal value that can be stored in the bitset after the function call.\n// The new length in bits is the parameter value + 1. Thus it is not possible\n// to use this function to set the length to 0, the minimal value of the length\n// after this function call is 1.\n//\n// A new slice is allocated to store the new bits, so you may see an increase in\n// memory usage until the GC runs. Normally this should not be a problem, but if you\n// have an extremely large BitSet its important to understand that the old BitSet will\n// remain in memory until the GC frees it.\nfunc (b *BitSet) Shrink(lastbitindex uint) *BitSet {\n\tlength := lastbitindex + 1\n\tidx := wordsNeeded(length)\n\tif idx > len(b.set) {\n\t\treturn b\n\t}\n\tshrunk := make([]uint64, idx)\n\tcopy(shrunk, b.set[:idx])\n\tb.set = shrunk\n\tb.length = length\n\tlastWordUsedBits := length % 64\n\tif lastWordUsedBits != 0 {\n\t\tb.set[idx-1] &= allBits >> uint64(64-wordsIndex(lastWordUsedBits))\n\t}\n\treturn b\n}\n\n// Compact shrinks BitSet to so that we preserve all set bits, while minimizing\n// memory usage. Compact calls Shrink.\nfunc (b *BitSet) Compact() *BitSet {\n\tidx := len(b.set) - 1\n\tfor ; idx >= 0 && b.set[idx] == 0; idx-- {\n\t}\n\tnewlength := uint((idx + 1) << log2WordSize)\n\tif newlength >= b.length {\n\t\treturn b // nothing to do\n\t}\n\tif newlength > 0 {\n\t\treturn b.Shrink(newlength - 1)\n\t}\n\t// We preserve one word\n\treturn b.Shrink(63)\n}\n\n// InsertAt takes an index which indicates where a bit should be\n// inserted. Then it shifts all the bits in the set to the left by 1, starting\n// from the given index position, and sets the index position to 0.\n//\n// Depending on the size of your BitSet, and where you are inserting the new entry,\n// this method could be extremely slow and in some cases might cause the entire BitSet\n// to be recopied.\nfunc (b *BitSet) InsertAt(idx uint) *BitSet {\n\tinsertAtElement := idx >> log2WordSize\n\n\t// if length of set is a multiple of wordSize we need to allocate more space first\n\tif b.isLenExactMultiple() {\n\t\tb.set = append(b.set, uint64(0))\n\t}\n\n\tvar i uint\n\tfor i = uint(len(b.set) - 1); i > insertAtElement; i-- {\n\t\t// all elements above the position where we want to insert can simply by shifted\n\t\tb.set[i] <<= 1\n\n\t\t// we take the most significant bit of the previous element and set it as\n\t\t// the least significant bit of the current element\n\t\tb.set[i] |= (b.set[i-1] & 0x8000000000000000) >> 63\n\t}\n\n\t// generate a mask to extract the data that we need to shift left\n\t// within the element where we insert a bit\n\tdataMask := uint64(1)<<uint64(wordsIndex(idx)) - 1\n\n\t// extract that data that we'll shift\n\tdata := b.set[i] & (^dataMask)\n\n\t// set the positions of the data mask to 0 in the element where we insert\n\tb.set[i] &= dataMask\n\n\t// shift data mask to the left and insert its data to the slice element\n\tb.set[i] |= data << 1\n\n\t// add 1 to length of BitSet\n\tb.length++\n\n\treturn b\n}\n\n// String creates a string representation of the Bitmap\nfunc (b *BitSet) String() string {\n\t// follows code from https://github.com/RoaringBitmap/roaring\n\tvar buffer bytes.Buffer\n\tstart := []byte(\"{\")\n\tbuffer.Write(start)\n\tcounter := 0\n\ti, e := b.NextSet(0)\n\tfor e {\n\t\tcounter = counter + 1\n\t\t// to avoid exhausting the memory\n\t\tif counter > 0x40000 {\n\t\t\tbuffer.WriteString(\"...\")\n\t\t\tbreak\n\t\t}\n\t\tbuffer.WriteString(strconv.FormatInt(int64(i), 10))\n\t\ti, e = b.NextSet(i + 1)\n\t\tif e {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t}\n\tbuffer.WriteString(\"}\")\n\treturn buffer.String()\n}\n\n// DeleteAt deletes the bit at the given index position from\n// within the bitset\n// All the bits residing on the left of the deleted bit get\n// shifted right by 1\n// The running time of this operation may potentially be\n// relatively slow, O(length)\nfunc (b *BitSet) DeleteAt(i uint) *BitSet {\n\t// the index of the slice element where we'll delete a bit\n\tdeleteAtElement := i >> log2WordSize\n\n\t// generate a mask for the data that needs to be shifted right\n\t// within that slice element that gets modified\n\tdataMask := ^((uint64(1) << wordsIndex(i)) - 1)\n\n\t// extract the data that we'll shift right from the slice element\n\tdata := b.set[deleteAtElement] & dataMask\n\n\t// set the masked area to 0 while leaving the rest as it is\n\tb.set[deleteAtElement] &= ^dataMask\n\n\t// shift the previously extracted data to the right and then\n\t// set it in the previously masked area\n\tb.set[deleteAtElement] |= (data >> 1) & dataMask\n\n\t// loop over all the consecutive slice elements to copy each\n\t// lowest bit into the highest position of the previous element,\n\t// then shift the entire content to the right by 1\n\tfor i := int(deleteAtElement) + 1; i < len(b.set); i++ {\n\t\tb.set[i-1] |= (b.set[i] & 1) << 63\n\t\tb.set[i] >>= 1\n\t}\n\n\tb.length = b.length - 1\n\n\treturn b\n}\n\n// NextSet returns the next bit set from the specified index,\n// including possibly the current index\n// along with an error code (true = valid, false = no set bit found)\n// for i,e := v.NextSet(0); e; i,e = v.NextSet(i + 1) {...}\n//\n// Users concerned with performance may want to use NextSetMany to\n// retrieve several values at once.\nfunc (b *BitSet) NextSet(i uint) (uint, bool) {\n\tx := int(i >> log2WordSize)\n\tif x >= len(b.set) {\n\t\treturn 0, false\n\t}\n\tw := b.set[x]\n\tw = w >> wordsIndex(i)\n\tif w != 0 {\n\t\treturn i + trailingZeroes64(w), true\n\t}\n\tx++\n\t// bounds check elimination in the loop\n\tif x < 0 {\n\t\treturn 0, false\n\t}\n\tfor x < len(b.set) {\n\t\tif b.set[x] != 0 {\n\t\t\treturn uint(x)*wordSize + trailingZeroes64(b.set[x]), true\n\t\t}\n\t\tx++\n\n\t}\n\treturn 0, false\n}\n\n// NextSetMany returns many next bit sets from the specified index,\n// including possibly the current index and up to cap(buffer).\n// If the returned slice has len zero, then no more set bits were found\n//\n//\tbuffer := make([]uint, 256) // this should be reused\n//\tj := uint(0)\n//\tj, buffer = bitmap.NextSetMany(j, buffer)\n//\tfor ; len(buffer) > 0; j, buffer = bitmap.NextSetMany(j,buffer) {\n//\t for k := range buffer {\n//\t  do something with buffer[k]\n//\t }\n//\t j += 1\n//\t}\n//\n// It is possible to retrieve all set bits as follow:\n//\n//\tindices := make([]uint, bitmap.Count())\n//\tbitmap.NextSetMany(0, indices)\n//\n// However if bitmap.Count() is large, it might be preferable to\n// use several calls to NextSetMany, for performance reasons.\nfunc (b *BitSet) NextSetMany(i uint, buffer []uint) (uint, []uint) {\n\tmyanswer := buffer\n\tcapacity := cap(buffer)\n\tx := int(i >> log2WordSize)\n\tif x >= len(b.set) || capacity == 0 {\n\t\treturn 0, myanswer[:0]\n\t}\n\tskip := wordsIndex(i)\n\tword := b.set[x] >> skip\n\tmyanswer = myanswer[:capacity]\n\tsize := int(0)\n\tfor word != 0 {\n\t\tr := trailingZeroes64(word)\n\t\tt := word & ((^word) + 1)\n\t\tmyanswer[size] = r + i\n\t\tsize++\n\t\tif size == capacity {\n\t\t\tgoto End\n\t\t}\n\t\tword = word ^ t\n\t}\n\tx++\n\tfor idx, word := range b.set[x:] {\n\t\tfor word != 0 {\n\t\t\tr := trailingZeroes64(word)\n\t\t\tt := word & ((^word) + 1)\n\t\t\tmyanswer[size] = r + (uint(x+idx) << 6)\n\t\t\tsize++\n\t\t\tif size == capacity {\n\t\t\t\tgoto End\n\t\t\t}\n\t\t\tword = word ^ t\n\t\t}\n\t}\nEnd:\n\tif size > 0 {\n\t\treturn myanswer[size-1], myanswer[:size]\n\t}\n\treturn 0, myanswer[:0]\n}\n\n// NextClear returns the next clear bit from the specified index,\n// including possibly the current index\n// along with an error code (true = valid, false = no bit found i.e. all bits are set)\nfunc (b *BitSet) NextClear(i uint) (uint, bool) {\n\tx := int(i >> log2WordSize)\n\tif x >= len(b.set) {\n\t\treturn 0, false\n\t}\n\tw := b.set[x]\n\tw = w >> wordsIndex(i)\n\twA := allBits >> wordsIndex(i)\n\tindex := i + trailingZeroes64(^w)\n\tif w != wA && index < b.length {\n\t\treturn index, true\n\t}\n\tx++\n\t// bounds check elimination in the loop\n\tif x < 0 {\n\t\treturn 0, false\n\t}\n\tfor x < len(b.set) {\n\t\tif b.set[x] != allBits {\n\t\t\tindex = uint(x)*wordSize + trailingZeroes64(^b.set[x])\n\t\t\tif index < b.length {\n\t\t\t\treturn index, true\n\t\t\t}\n\t\t}\n\t\tx++\n\t}\n\treturn 0, false\n}\n\n// ClearAll clears the entire BitSet\nfunc (b *BitSet) ClearAll() *BitSet {\n\tif b != nil && b.set != nil {\n\t\tfor i := range b.set {\n\t\t\tb.set[i] = 0\n\t\t}\n\t}\n\treturn b\n}\n\n// SetAll sets the entire BitSet\nfunc (b *BitSet) SetAll() *BitSet {\n\tif b != nil && b.set != nil {\n\t\tfor i := range b.set {\n\t\t\tb.set[i] = allBits\n\t\t}\n\n\t\tb.cleanLastWord()\n\t}\n\treturn b\n}\n\n// wordCount returns the number of words used in a bit set\nfunc (b *BitSet) wordCount() int {\n\treturn wordsNeededUnbound(b.length)\n}\n\n// Clone this BitSet\nfunc (b *BitSet) Clone() *BitSet {\n\tc := New(b.length)\n\tif b.set != nil { // Clone should not modify current object\n\t\tcopy(c.set, b.set)\n\t}\n\treturn c\n}\n\n// Copy into a destination BitSet using the Go array copy semantics:\n// the number of bits copied is the minimum of the number of bits in the current\n// BitSet (Len()) and the destination Bitset.\n// We return the number of bits copied in the destination BitSet.\nfunc (b *BitSet) Copy(c *BitSet) (count uint) {\n\tif c == nil {\n\t\treturn\n\t}\n\tif b.set != nil { // Copy should not modify current object\n\t\tcopy(c.set, b.set)\n\t}\n\tcount = c.length\n\tif b.length < c.length {\n\t\tcount = b.length\n\t}\n\t// Cleaning the last word is needed to keep the invariant that other functions, such as Count, require\n\t// that any bits in the last word that would exceed the length of the bitmask are set to 0.\n\tc.cleanLastWord()\n\treturn\n}\n\n// CopyFull copies into a destination BitSet such that the destination is\n// identical to the source after the operation, allocating memory if necessary.\nfunc (b *BitSet) CopyFull(c *BitSet) {\n\tif c == nil {\n\t\treturn\n\t}\n\tc.length = b.length\n\tif len(b.set) == 0 {\n\t\tif c.set != nil {\n\t\t\tc.set = c.set[:0]\n\t\t}\n\t} else {\n\t\tif cap(c.set) < len(b.set) {\n\t\t\tc.set = make([]uint64, len(b.set))\n\t\t} else {\n\t\t\tc.set = c.set[:len(b.set)]\n\t\t}\n\t\tcopy(c.set, b.set)\n\t}\n}\n\n// Count (number of set bits).\n// Also known as \"popcount\" or \"population count\".\nfunc (b *BitSet) Count() uint {\n\tif b != nil && b.set != nil {\n\t\treturn uint(popcntSlice(b.set))\n\t}\n\treturn 0\n}\n\n// Equal tests the equivalence of two BitSets.\n// False if they are of different sizes, otherwise true\n// only if all the same bits are set\nfunc (b *BitSet) Equal(c *BitSet) bool {\n\tif c == nil || b == nil {\n\t\treturn c == b\n\t}\n\tif b.length != c.length {\n\t\treturn false\n\t}\n\tif b.length == 0 { // if they have both length == 0, then could have nil set\n\t\treturn true\n\t}\n\twn := b.wordCount()\n\t// bounds check elimination\n\tif wn <= 0 {\n\t\treturn true\n\t}\n\t_ = b.set[wn-1]\n\t_ = c.set[wn-1]\n\tfor p := 0; p < wn; p++ {\n\t\tif c.set[p] != b.set[p] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc panicIfNull(b *BitSet) {\n\tif b == nil {\n\t\tpanic(Error(\"BitSet must not be null\"))\n\t}\n}\n\n// Difference of base set and other set\n// This is the BitSet equivalent of &^ (and not)\nfunc (b *BitSet) Difference(compare *BitSet) (result *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tresult = b.Clone() // clone b (in case b is bigger than compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tresult.set[i] = b.set[i] &^ compare.set[i]\n\t}\n\treturn\n}\n\n// DifferenceCardinality computes the cardinality of the differnce\nfunc (b *BitSet) DifferenceCardinality(compare *BitSet) uint {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tcnt := uint64(0)\n\tcnt += popcntMaskSlice(b.set[:l], compare.set[:l])\n\tcnt += popcntSlice(b.set[l:])\n\treturn uint(cnt)\n}\n\n// InPlaceDifference computes the difference of base set and other set\n// This is the BitSet equivalent of &^ (and not)\nfunc (b *BitSet) InPlaceDifference(compare *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tif l <= 0 {\n\t\treturn\n\t}\n\t// bounds check elimination\n\tdata, cmpData := b.set, compare.set\n\t_ = data[l-1]\n\t_ = cmpData[l-1]\n\tfor i := 0; i < l; i++ {\n\t\tdata[i] &^= cmpData[i]\n\t}\n}\n\n// Convenience function: return two bitsets ordered by\n// increasing length. Note: neither can be nil\nfunc sortByLength(a *BitSet, b *BitSet) (ap *BitSet, bp *BitSet) {\n\tif a.length <= b.length {\n\t\tap, bp = a, b\n\t} else {\n\t\tap, bp = b, a\n\t}\n\treturn\n}\n\n// Intersection of base set and other set\n// This is the BitSet equivalent of & (and)\nfunc (b *BitSet) Intersection(compare *BitSet) (result *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\tresult = New(b.length)\n\tfor i, word := range b.set {\n\t\tresult.set[i] = word & compare.set[i]\n\t}\n\treturn\n}\n\n// IntersectionCardinality computes the cardinality of the union\nfunc (b *BitSet) IntersectionCardinality(compare *BitSet) uint {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\tcnt := popcntAndSlice(b.set, compare.set)\n\treturn uint(cnt)\n}\n\n// InPlaceIntersection destructively computes the intersection of\n// base set and the compare set.\n// This is the BitSet equivalent of & (and)\nfunc (b *BitSet) InPlaceIntersection(compare *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tif l > 0 {\n\t\t// bounds check elimination\n\t\tdata, cmpData := b.set, compare.set\n\t\t_ = data[l-1]\n\t\t_ = cmpData[l-1]\n\n\t\tfor i := 0; i < l; i++ {\n\t\t\tdata[i] &= cmpData[i]\n\t\t}\n\t}\n\tif l >= 0 {\n\t\tfor i := l; i < len(b.set); i++ {\n\t\t\tb.set[i] = 0\n\t\t}\n\t}\n\tif compare.length > 0 {\n\t\tif compare.length-1 >= b.length {\n\t\t\tb.extendSet(compare.length - 1)\n\t\t}\n\t}\n}\n\n// Union of base set and other set\n// This is the BitSet equivalent of | (or)\nfunc (b *BitSet) Union(compare *BitSet) (result *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\tresult = compare.Clone()\n\tfor i, word := range b.set {\n\t\tresult.set[i] = word | compare.set[i]\n\t}\n\treturn\n}\n\n// UnionCardinality computes the cardinality of the uniton of the base set\n// and the compare set.\nfunc (b *BitSet) UnionCardinality(compare *BitSet) uint {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\tcnt := popcntOrSlice(b.set, compare.set)\n\tif len(compare.set) > len(b.set) {\n\t\tcnt += popcntSlice(compare.set[len(b.set):])\n\t}\n\treturn uint(cnt)\n}\n\n// InPlaceUnion creates the destructive union of base set and compare set.\n// This is the BitSet equivalent of | (or).\nfunc (b *BitSet) InPlaceUnion(compare *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tif compare.length > 0 && compare.length-1 >= b.length {\n\t\tb.extendSet(compare.length - 1)\n\t}\n\tif l > 0 {\n\t\t// bounds check elimination\n\t\tdata, cmpData := b.set, compare.set\n\t\t_ = data[l-1]\n\t\t_ = cmpData[l-1]\n\n\t\tfor i := 0; i < l; i++ {\n\t\t\tdata[i] |= cmpData[i]\n\t\t}\n\t}\n\tif len(compare.set) > l {\n\t\tfor i := l; i < len(compare.set); i++ {\n\t\t\tb.set[i] = compare.set[i]\n\t\t}\n\t}\n}\n\n// SymmetricDifference of base set and other set\n// This is the BitSet equivalent of ^ (xor)\nfunc (b *BitSet) SymmetricDifference(compare *BitSet) (result *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\t// compare is bigger, so clone it\n\tresult = compare.Clone()\n\tfor i, word := range b.set {\n\t\tresult.set[i] = word ^ compare.set[i]\n\t}\n\treturn\n}\n\n// SymmetricDifferenceCardinality computes the cardinality of the symmetric difference\nfunc (b *BitSet) SymmetricDifferenceCardinality(compare *BitSet) uint {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tb, compare = sortByLength(b, compare)\n\tcnt := popcntXorSlice(b.set, compare.set)\n\tif len(compare.set) > len(b.set) {\n\t\tcnt += popcntSlice(compare.set[len(b.set):])\n\t}\n\treturn uint(cnt)\n}\n\n// InPlaceSymmetricDifference creates the destructive SymmetricDifference of base set and other set\n// This is the BitSet equivalent of ^ (xor)\nfunc (b *BitSet) InPlaceSymmetricDifference(compare *BitSet) {\n\tpanicIfNull(b)\n\tpanicIfNull(compare)\n\tl := compare.wordCount()\n\tif l > b.wordCount() {\n\t\tl = b.wordCount()\n\t}\n\tif compare.length > 0 && compare.length-1 >= b.length {\n\t\tb.extendSet(compare.length - 1)\n\t}\n\tif l > 0 {\n\t\t// bounds check elimination\n\t\tdata, cmpData := b.set, compare.set\n\t\t_ = data[l-1]\n\t\t_ = cmpData[l-1]\n\t\tfor i := 0; i < l; i++ {\n\t\t\tdata[i] ^= cmpData[i]\n\t\t}\n\t}\n\tif len(compare.set) > l {\n\t\tfor i := l; i < len(compare.set); i++ {\n\t\t\tb.set[i] = compare.set[i]\n\t\t}\n\t}\n}\n\n// Is the length an exact multiple of word sizes?\nfunc (b *BitSet) isLenExactMultiple() bool {\n\treturn wordsIndex(b.length) == 0\n}\n\n// Clean last word by setting unused bits to 0\nfunc (b *BitSet) cleanLastWord() {\n\tif !b.isLenExactMultiple() {\n\t\tb.set[len(b.set)-1] &= allBits >> (wordSize - wordsIndex(b.length))\n\t}\n}\n\n// Complement computes the (local) complement of a bitset (up to length bits)\nfunc (b *BitSet) Complement() (result *BitSet) {\n\tpanicIfNull(b)\n\tresult = New(b.length)\n\tfor i, word := range b.set {\n\t\tresult.set[i] = ^word\n\t}\n\tresult.cleanLastWord()\n\treturn\n}\n\n// All returns true if all bits are set, false otherwise. Returns true for\n// empty sets.\nfunc (b *BitSet) All() bool {\n\tpanicIfNull(b)\n\treturn b.Count() == b.length\n}\n\n// None returns true if no bit is set, false otherwise. Returns true for\n// empty sets.\nfunc (b *BitSet) None() bool {\n\tpanicIfNull(b)\n\tif b != nil && b.set != nil {\n\t\tfor _, word := range b.set {\n\t\t\tif word > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// Any returns true if any bit is set, false otherwise\nfunc (b *BitSet) Any() bool {\n\tpanicIfNull(b)\n\treturn !b.None()\n}\n\n// IsSuperSet returns true if this is a superset of the other set\nfunc (b *BitSet) IsSuperSet(other *BitSet) bool {\n\tl := other.wordCount()\n\tif b.wordCount() < l {\n\t\tl = b.wordCount()\n\t}\n\tfor i, word := range other.set[:l] {\n\t\tif b.set[i]&word != word {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn popcntSlice(other.set[l:]) == 0\n}\n\n// IsStrictSuperSet returns true if this is a strict superset of the other set\nfunc (b *BitSet) IsStrictSuperSet(other *BitSet) bool {\n\treturn b.Count() > other.Count() && b.IsSuperSet(other)\n}\n\n// DumpAsBits dumps a bit set as a string of bits. Following the usual convention in Go,\n// the least significant bits are printed last (index 0 is at the end of the string).\nfunc (b *BitSet) DumpAsBits() string {\n\tif b.set == nil {\n\t\treturn \".\"\n\t}\n\tbuffer := bytes.NewBufferString(\"\")\n\ti := len(b.set) - 1\n\tfor ; i >= 0; i-- {\n\t\tfmt.Fprintf(buffer, \"%064b.\", b.set[i])\n\t}\n\treturn buffer.String()\n}\n\n// BinaryStorageSize returns the binary storage requirements (see WriteTo) in bytes.\nfunc (b *BitSet) BinaryStorageSize() int {\n\treturn int(wordBytes + wordBytes*uint(b.wordCount()))\n}\n\nfunc readUint64Array(reader io.Reader, data []uint64) error {\n\tlength := len(data)\n\tbufferSize := 128\n\tbuffer := make([]byte, bufferSize*int(wordBytes))\n\tfor i := 0; i < length; i += bufferSize {\n\t\tend := i + bufferSize\n\t\tif end > length {\n\t\t\tend = length\n\t\t\tbuffer = buffer[:wordBytes*uint(end-i)]\n\t\t}\n\t\tchunk := data[i:end]\n\t\tif _, err := io.ReadFull(reader, buffer); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor i := range chunk {\n\t\t\tchunk[i] = uint64(binaryOrder.Uint64(buffer[8*i:]))\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc writeUint64Array(writer io.Writer, data []uint64) error {\n\tbufferSize := 128\n\tbuffer := make([]byte, bufferSize*int(wordBytes))\n\tfor i := 0; i < len(data); i += bufferSize {\n\t\tend := i + bufferSize\n\t\tif end > len(data) {\n\t\t\tend = len(data)\n\t\t\tbuffer = buffer[:wordBytes*uint(end-i)]\n\t\t}\n\t\tchunk := data[i:end]\n\t\tfor i, x := range chunk {\n\t\t\tbinaryOrder.PutUint64(buffer[8*i:], x)\n\t\t}\n\t\t_, err := writer.Write(buffer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// WriteTo writes a BitSet to a stream. The format is:\n// 1. uint64 length\n// 2. []uint64 set\n// Upon success, the number of bytes written is returned.\n//\n// Performance: if this function is used to write to a disk or network\n// connection, it might be beneficial to wrap the stream in a bufio.Writer.\n// E.g.,\n//\n//\t      f, err := os.Create(\"myfile\")\n//\t\t       w := bufio.NewWriter(f)\nfunc (b *BitSet) WriteTo(stream io.Writer) (int64, error) {\n\tlength := uint64(b.length)\n\t// Write length\n\terr := binary.Write(stream, binaryOrder, &length)\n\tif err != nil {\n\t\t// Upon failure, we do not guarantee that we\n\t\t// return the number of bytes written.\n\t\treturn int64(0), err\n\t}\n\terr = writeUint64Array(stream, b.set[:b.wordCount()])\n\tif err != nil {\n\t\t// Upon failure, we do not guarantee that we\n\t\t// return the number of bytes written.\n\t\treturn int64(wordBytes), err\n\t}\n\treturn int64(b.BinaryStorageSize()), nil\n}\n\n// ReadFrom reads a BitSet from a stream written using WriteTo\n// The format is:\n// 1. uint64 length\n// 2. []uint64 set\n// Upon success, the number of bytes read is returned.\n// If the current BitSet is not large enough to hold the data,\n// it is extended. In case of error, the BitSet is either\n// left unchanged or made empty if the error occurs too late\n// to preserve the content.\n//\n// Performance: if this function is used to read from a disk or network\n// connection, it might be beneficial to wrap the stream in a bufio.Reader.\n// E.g.,\n//\n//\tf, err := os.Open(\"myfile\")\n//\tr := bufio.NewReader(f)\nfunc (b *BitSet) ReadFrom(stream io.Reader) (int64, error) {\n\tvar length uint64\n\terr := binary.Read(stream, binaryOrder, &length)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\treturn 0, err\n\t}\n\tnewlength := uint(length)\n\n\tif uint64(newlength) != length {\n\t\treturn 0, errors.New(\"unmarshalling error: type mismatch\")\n\t}\n\tnWords := wordsNeeded(uint(newlength))\n\tif cap(b.set) >= nWords {\n\t\tb.set = b.set[:nWords]\n\t} else {\n\t\tb.set = make([]uint64, nWords)\n\t}\n\n\tb.length = newlength\n\n\terr = readUint64Array(stream, b.set)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\t// We do not want to leave the BitSet partially filled as\n\t\t// it is error prone.\n\t\tb.set = b.set[:0]\n\t\tb.length = 0\n\t\treturn 0, err\n\t}\n\n\treturn int64(b.BinaryStorageSize()), nil\n}\n\n// MarshalBinary encodes a BitSet into a binary form and returns the result.\nfunc (b *BitSet) MarshalBinary() ([]byte, error) {\n\tvar buf bytes.Buffer\n\t_, err := b.WriteTo(&buf)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\treturn buf.Bytes(), err\n}\n\n// UnmarshalBinary decodes the binary form generated by MarshalBinary.\nfunc (b *BitSet) UnmarshalBinary(data []byte) error {\n\tbuf := bytes.NewReader(data)\n\t_, err := b.ReadFrom(buf)\n\treturn err\n}\n\n// MarshalJSON marshals a BitSet as a JSON structure\nfunc (b BitSet) MarshalJSON() ([]byte, error) {\n\tbuffer := bytes.NewBuffer(make([]byte, 0, b.BinaryStorageSize()))\n\t_, err := b.WriteTo(buffer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// URLEncode all bytes\n\treturn json.Marshal(base64Encoding.EncodeToString(buffer.Bytes()))\n}\n\n// UnmarshalJSON unmarshals a BitSet from JSON created using MarshalJSON\nfunc (b *BitSet) UnmarshalJSON(data []byte) error {\n\t// Unmarshal as string\n\tvar s string\n\terr := json.Unmarshal(data, &s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// URLDecode string\n\tbuf, err := base64Encoding.DecodeString(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = b.ReadFrom(bytes.NewReader(buf))\n\treturn err\n}\n\n// Rank returns the nunber of set bits up to and including the index\n// that are set in the bitset.\n// See https://en.wikipedia.org/wiki/Ranking#Ranking_in_statistics\nfunc (b *BitSet) Rank(index uint) uint {\n\tif index >= b.length {\n\t\treturn b.Count()\n\t}\n\tleftover := (index + 1) & 63\n\tanswer := uint(popcntSlice(b.set[:(index+1)>>6]))\n\tif leftover != 0 {\n\t\tanswer += uint(popcount(b.set[(index+1)>>6] << (64 - leftover)))\n\t}\n\treturn answer\n}\n\n// Select returns the index of the jth set bit, where j is the argument.\n// The caller is responsible to ensure that 0 <= j < Count(): when j is\n// out of range, the function returns the length of the bitset (b.length).\n//\n// Note that this function differs in convention from the Rank function which\n// returns 1 when ranking the smallest value. We follow the conventional\n// textbook definition of Select and Rank.\nfunc (b *BitSet) Select(index uint) uint {\n\tleftover := index\n\tfor idx, word := range b.set {\n\t\tw := uint(popcount(word))\n\t\tif w > leftover {\n\t\t\treturn uint(idx)*64 + select64(word, leftover)\n\t\t}\n\t\tleftover -= w\n\t}\n\treturn b.length\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/popcnt.go",
    "content": "package bitset\n\n// bit population count, take from\n// https://code.google.com/p/go/issues/detail?id=4988#c11\n// credit: https://code.google.com/u/arnehormann/\nfunc popcount(x uint64) (n uint64) {\n\tx -= (x >> 1) & 0x5555555555555555\n\tx = (x>>2)&0x3333333333333333 + x&0x3333333333333333\n\tx += x >> 4\n\tx &= 0x0f0f0f0f0f0f0f0f\n\tx *= 0x0101010101010101\n\treturn x >> 56\n}\n\nfunc popcntSliceGo(s []uint64) uint64 {\n\tcnt := uint64(0)\n\tfor _, x := range s {\n\t\tcnt += popcount(x)\n\t}\n\treturn cnt\n}\n\nfunc popcntMaskSliceGo(s, m []uint64) uint64 {\n\tcnt := uint64(0)\n\tfor i := range s {\n\t\tcnt += popcount(s[i] &^ m[i])\n\t}\n\treturn cnt\n}\n\nfunc popcntAndSliceGo(s, m []uint64) uint64 {\n\tcnt := uint64(0)\n\tfor i := range s {\n\t\tcnt += popcount(s[i] & m[i])\n\t}\n\treturn cnt\n}\n\nfunc popcntOrSliceGo(s, m []uint64) uint64 {\n\tcnt := uint64(0)\n\tfor i := range s {\n\t\tcnt += popcount(s[i] | m[i])\n\t}\n\treturn cnt\n}\n\nfunc popcntXorSliceGo(s, m []uint64) uint64 {\n\tcnt := uint64(0)\n\tfor i := range s {\n\t\tcnt += popcount(s[i] ^ m[i])\n\t}\n\treturn cnt\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/popcnt_19.go",
    "content": "//go:build go1.9\n// +build go1.9\n\npackage bitset\n\nimport \"math/bits\"\n\nfunc popcntSlice(s []uint64) uint64 {\n\tvar cnt int\n\tfor _, x := range s {\n\t\tcnt += bits.OnesCount64(x)\n\t}\n\treturn uint64(cnt)\n}\n\nfunc popcntMaskSlice(s, m []uint64) uint64 {\n\tvar cnt int\n\t// this explicit check eliminates a bounds check in the loop\n\tif len(m) < len(s) {\n\t\tpanic(\"mask slice is too short\")\n\t}\n\tfor i := range s {\n\t\tcnt += bits.OnesCount64(s[i] &^ m[i])\n\t}\n\treturn uint64(cnt)\n}\n\nfunc popcntAndSlice(s, m []uint64) uint64 {\n\tvar cnt int\n\t// this explicit check eliminates a bounds check in the loop\n\tif len(m) < len(s) {\n\t\tpanic(\"mask slice is too short\")\n\t}\n\tfor i := range s {\n\t\tcnt += bits.OnesCount64(s[i] & m[i])\n\t}\n\treturn uint64(cnt)\n}\n\nfunc popcntOrSlice(s, m []uint64) uint64 {\n\tvar cnt int\n\t// this explicit check eliminates a bounds check in the loop\n\tif len(m) < len(s) {\n\t\tpanic(\"mask slice is too short\")\n\t}\n\tfor i := range s {\n\t\tcnt += bits.OnesCount64(s[i] | m[i])\n\t}\n\treturn uint64(cnt)\n}\n\nfunc popcntXorSlice(s, m []uint64) uint64 {\n\tvar cnt int\n\t// this explicit check eliminates a bounds check in the loop\n\tif len(m) < len(s) {\n\t\tpanic(\"mask slice is too short\")\n\t}\n\tfor i := range s {\n\t\tcnt += bits.OnesCount64(s[i] ^ m[i])\n\t}\n\treturn uint64(cnt)\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.go",
    "content": "//go:build !go1.9 && amd64 && !appengine\n// +build !go1.9,amd64,!appengine\n\npackage bitset\n\n// *** the following functions are defined in popcnt_amd64.s\n\n//go:noescape\n\nfunc hasAsm() bool\n\n// useAsm is a flag used to select the GO or ASM implementation of the popcnt function\nvar useAsm = hasAsm()\n\n//go:noescape\n\nfunc popcntSliceAsm(s []uint64) uint64\n\n//go:noescape\n\nfunc popcntMaskSliceAsm(s, m []uint64) uint64\n\n//go:noescape\n\nfunc popcntAndSliceAsm(s, m []uint64) uint64\n\n//go:noescape\n\nfunc popcntOrSliceAsm(s, m []uint64) uint64\n\n//go:noescape\n\nfunc popcntXorSliceAsm(s, m []uint64) uint64\n\nfunc popcntSlice(s []uint64) uint64 {\n\tif useAsm {\n\t\treturn popcntSliceAsm(s)\n\t}\n\treturn popcntSliceGo(s)\n}\n\nfunc popcntMaskSlice(s, m []uint64) uint64 {\n\tif useAsm {\n\t\treturn popcntMaskSliceAsm(s, m)\n\t}\n\treturn popcntMaskSliceGo(s, m)\n}\n\nfunc popcntAndSlice(s, m []uint64) uint64 {\n\tif useAsm {\n\t\treturn popcntAndSliceAsm(s, m)\n\t}\n\treturn popcntAndSliceGo(s, m)\n}\n\nfunc popcntOrSlice(s, m []uint64) uint64 {\n\tif useAsm {\n\t\treturn popcntOrSliceAsm(s, m)\n\t}\n\treturn popcntOrSliceGo(s, m)\n}\n\nfunc popcntXorSlice(s, m []uint64) uint64 {\n\tif useAsm {\n\t\treturn popcntXorSliceAsm(s, m)\n\t}\n\treturn popcntXorSliceGo(s, m)\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.s",
    "content": "// +build !go1.9\n// +build amd64,!appengine\n\nTEXT ·hasAsm(SB),4,$0-1\nMOVQ $1, AX\nCPUID\nSHRQ $23, CX\nANDQ $1, CX\nMOVB CX, ret+0(FP)\nRET\n\n#define POPCNTQ_DX_DX BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0xd2\n\nTEXT ·popcntSliceAsm(SB),4,$0-32\nXORQ\tAX, AX\nMOVQ\ts+0(FP), SI\nMOVQ\ts_len+8(FP), CX\nTESTQ\tCX, CX\nJZ\t\tpopcntSliceEnd\npopcntSliceLoop:\nBYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0x16 // POPCNTQ (SI), DX\nADDQ\tDX, AX\nADDQ\t$8, SI\nLOOP\tpopcntSliceLoop\npopcntSliceEnd:\nMOVQ\tAX, ret+24(FP)\nRET\n\nTEXT ·popcntMaskSliceAsm(SB),4,$0-56\nXORQ\tAX, AX\nMOVQ\ts+0(FP), SI\nMOVQ\ts_len+8(FP), CX\nTESTQ\tCX, CX\nJZ\t\tpopcntMaskSliceEnd\nMOVQ\tm+24(FP), DI\npopcntMaskSliceLoop:\nMOVQ\t(DI), DX\nNOTQ\tDX\nANDQ\t(SI), DX\nPOPCNTQ_DX_DX\nADDQ\tDX, AX\nADDQ\t$8, SI\nADDQ\t$8, DI\nLOOP\tpopcntMaskSliceLoop\npopcntMaskSliceEnd:\nMOVQ\tAX, ret+48(FP)\nRET\n\nTEXT ·popcntAndSliceAsm(SB),4,$0-56\nXORQ\tAX, AX\nMOVQ\ts+0(FP), SI\nMOVQ\ts_len+8(FP), CX\nTESTQ\tCX, CX\nJZ\t\tpopcntAndSliceEnd\nMOVQ\tm+24(FP), DI\npopcntAndSliceLoop:\nMOVQ\t(DI), DX\nANDQ\t(SI), DX\nPOPCNTQ_DX_DX\nADDQ\tDX, AX\nADDQ\t$8, SI\nADDQ\t$8, DI\nLOOP\tpopcntAndSliceLoop\npopcntAndSliceEnd:\nMOVQ\tAX, ret+48(FP)\nRET\n\nTEXT ·popcntOrSliceAsm(SB),4,$0-56\nXORQ\tAX, AX\nMOVQ\ts+0(FP), SI\nMOVQ\ts_len+8(FP), CX\nTESTQ\tCX, CX\nJZ\t\tpopcntOrSliceEnd\nMOVQ\tm+24(FP), DI\npopcntOrSliceLoop:\nMOVQ\t(DI), DX\nORQ\t\t(SI), DX\nPOPCNTQ_DX_DX\nADDQ\tDX, AX\nADDQ\t$8, SI\nADDQ\t$8, DI\nLOOP\tpopcntOrSliceLoop\npopcntOrSliceEnd:\nMOVQ\tAX, ret+48(FP)\nRET\n\nTEXT ·popcntXorSliceAsm(SB),4,$0-56\nXORQ\tAX, AX\nMOVQ\ts+0(FP), SI\nMOVQ\ts_len+8(FP), CX\nTESTQ\tCX, CX\nJZ\t\tpopcntXorSliceEnd\nMOVQ\tm+24(FP), DI\npopcntXorSliceLoop:\nMOVQ\t(DI), DX\nXORQ\t(SI), DX\nPOPCNTQ_DX_DX\nADDQ\tDX, AX\nADDQ\t$8, SI\nADDQ\t$8, DI\nLOOP\tpopcntXorSliceLoop\npopcntXorSliceEnd:\nMOVQ\tAX, ret+48(FP)\nRET\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/popcnt_generic.go",
    "content": "//go:build !go1.9 && (!amd64 || appengine)\n// +build !go1.9\n// +build !amd64 appengine\n\npackage bitset\n\nfunc popcntSlice(s []uint64) uint64 {\n\treturn popcntSliceGo(s)\n}\n\nfunc popcntMaskSlice(s, m []uint64) uint64 {\n\treturn popcntMaskSliceGo(s, m)\n}\n\nfunc popcntAndSlice(s, m []uint64) uint64 {\n\treturn popcntAndSliceGo(s, m)\n}\n\nfunc popcntOrSlice(s, m []uint64) uint64 {\n\treturn popcntOrSliceGo(s, m)\n}\n\nfunc popcntXorSlice(s, m []uint64) uint64 {\n\treturn popcntXorSliceGo(s, m)\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/select.go",
    "content": "package bitset\n\nfunc select64(w uint64, j uint) uint {\n\tseen := 0\n\t// Divide 64bit\n\tpart := w & 0xFFFFFFFF\n\tn := uint(popcount(part))\n\tif n <= j {\n\t\tpart = w >> 32\n\t\tseen += 32\n\t\tj -= n\n\t}\n\tww := part\n\n\t// Divide 32bit\n\tpart = ww & 0xFFFF\n\n\tn = uint(popcount(part))\n\tif n <= j {\n\t\tpart = ww >> 16\n\t\tseen += 16\n\t\tj -= n\n\t}\n\tww = part\n\n\t// Divide 16bit\n\tpart = ww & 0xFF\n\tn = uint(popcount(part))\n\tif n <= j {\n\t\tpart = ww >> 8\n\t\tseen += 8\n\t\tj -= n\n\t}\n\tww = part\n\n\t// Lookup in final byte\n\tcounter := 0\n\tfor ; counter < 8; counter++ {\n\t\tj -= uint((ww >> counter) & 1)\n\t\tif j+1 == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn uint(seen + counter)\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/trailing_zeros_18.go",
    "content": "//go:build !go1.9\n// +build !go1.9\n\npackage bitset\n\nvar deBruijn = [...]byte{\n\t0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4,\n\t62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5,\n\t63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11,\n\t54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6,\n}\n\nfunc trailingZeroes64(v uint64) uint {\n\treturn uint(deBruijn[((v&-v)*0x03f79d71b4ca8b09)>>58])\n}\n"
  },
  {
    "path": "vendor/github.com/bits-and-blooms/bitset/trailing_zeros_19.go",
    "content": "//go:build go1.9\n// +build go1.9\n\npackage bitset\n\nimport \"math/bits\"\n\nfunc trailingZeroes64(v uint64) uint {\n\treturn uint(bits.TrailingZeros64(v))\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/.travis.yml",
    "content": "language: go\nmatrix:\n  include:\n  - go: 1.4.3\n  - go: 1.5.4\n  - go: 1.6.3\n  - go: 1.7\n  - go: tip\n  allow_failures:\n  - go: tip\ninstall:\n- go get golang.org/x/tools/cmd/cover\n- go get github.com/mattn/goveralls\nscript:\n- echo \"Test and track coverage\" ; $HOME/gopath/bin/goveralls -package \".\" -service=travis-ci\n  -repotoken $COVERALLS_TOKEN\n- echo \"Build examples\" ; cd examples && go build\n- echo \"Check if gofmt'd\" ; diff -u <(echo -n) <(gofmt -d -s .)\nenv:\n  global:\n    secure: HroGEAUQpVq9zX1b1VIkraLiywhGbzvNnTZq2TMxgK7JHP8xqNplAeF1izrR2i4QLL9nsY+9WtYss4QuPvEtZcVHUobw6XnL6radF7jS1LgfYZ9Y7oF+zogZ2I5QUMRLGA7rcxQ05s7mKq3XZQfeqaNts4bms/eZRefWuaFZbkw=\n"
  },
  {
    "path": "vendor/github.com/blang/semver/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2014 Benedikt Lang <github at benediktlang.de>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "vendor/github.com/blang/semver/README.md",
    "content": "semver for golang [![Build Status](https://travis-ci.org/blang/semver.svg?branch=master)](https://travis-ci.org/blang/semver) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master)\n======\n\nsemver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`.\n\nUsage\n-----\n```bash\n$ go get github.com/blang/semver\n```\nNote: Always vendor your dependencies or fix on a specific version tag.\n\n```go\nimport github.com/blang/semver\nv1, err := semver.Make(\"1.0.0-beta\")\nv2, err := semver.Make(\"2.0.0-beta\")\nv1.Compare(v2)\n```\n\nAlso check the [GoDocs](http://godoc.org/github.com/blang/semver).\n\nWhy should I use this lib?\n-----\n\n- Fully spec compatible\n- No reflection\n- No regex\n- Fully tested (Coverage >99%)\n- Readable parsing/validation errors\n- Fast (See [Benchmarks](#benchmarks))\n- Only Stdlib\n- Uses values instead of pointers\n- Many features, see below\n\n\nFeatures\n-----\n\n- Parsing and validation at all levels\n- Comparator-like comparisons\n- Compare Helper Methods\n- InPlace manipulation\n- Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1`\n- Wildcards `>=1.x`, `<=2.5.x`\n- Sortable (implements sort.Interface)\n- database/sql compatible (sql.Scanner/Valuer)\n- encoding/json compatible (json.Marshaler/Unmarshaler)\n\nRanges\n------\n\nA `Range` is a set of conditions which specify which versions satisfy the range.\n\nA condition is composed of an operator and a version. The supported operators are:\n\n- `<1.0.0` Less than `1.0.0`\n- `<=1.0.0` Less than or equal to `1.0.0`\n- `>1.0.0` Greater than `1.0.0`\n- `>=1.0.0` Greater than or equal to `1.0.0`\n- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0`\n- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`.\n\nNote that spaces between the operator and the version will be gracefully tolerated.\n\nA `Range` can link multiple `Ranges` separated by space:\n\nRanges can be linked by logical AND:\n\n  - `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0`\n  - `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2`\n\nRanges can also be linked by logical OR:\n\n  - `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x`\n\nAND has a higher precedence than OR. It's not possible to use brackets.\n\nRanges can be combined by both AND and OR\n\n  - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`\n\nRange usage:\n\n```\nv, err := semver.Parse(\"1.2.3\")\nrange, err := semver.ParseRange(\">1.0.0 <2.0.0 || >=3.0.0\")\nif range(v) {\n    //valid\n}\n\n```\n\nExample\n-----\n\nHave a look at full examples in [examples/main.go](examples/main.go)\n\n```go\nimport github.com/blang/semver\n\nv, err := semver.Make(\"0.0.1-alpha.preview+123.github\")\nfmt.Printf(\"Major: %d\\n\", v.Major)\nfmt.Printf(\"Minor: %d\\n\", v.Minor)\nfmt.Printf(\"Patch: %d\\n\", v.Patch)\nfmt.Printf(\"Pre: %s\\n\", v.Pre)\nfmt.Printf(\"Build: %s\\n\", v.Build)\n\n// Prerelease versions array\nif len(v.Pre) > 0 {\n    fmt.Println(\"Prerelease versions:\")\n    for i, pre := range v.Pre {\n        fmt.Printf(\"%d: %q\\n\", i, pre)\n    }\n}\n\n// Build meta data array\nif len(v.Build) > 0 {\n    fmt.Println(\"Build meta data:\")\n    for i, build := range v.Build {\n        fmt.Printf(\"%d: %q\\n\", i, build)\n    }\n}\n\nv001, err := semver.Make(\"0.0.1\")\n// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE\nv001.GT(v) == true\nv.LT(v001) == true\nv.GTE(v) == true\nv.LTE(v) == true\n\n// Or use v.Compare(v2) for comparisons (-1, 0, 1):\nv001.Compare(v) == 1\nv.Compare(v001) == -1\nv.Compare(v) == 0\n\n// Manipulate Version in place:\nv.Pre[0], err = semver.NewPRVersion(\"beta\")\nif err != nil {\n    fmt.Printf(\"Error parsing pre release version: %q\", err)\n}\n\nfmt.Println(\"\\nValidate versions:\")\nv.Build[0] = \"?\"\n\nerr = v.Validate()\nif err != nil {\n    fmt.Printf(\"Validation failed: %s\\n\", err)\n}\n```\n\n\nBenchmarks\n-----\n\n    BenchmarkParseSimple-4           5000000    390    ns/op    48 B/op   1 allocs/op\n    BenchmarkParseComplex-4          1000000   1813    ns/op   256 B/op   7 allocs/op\n    BenchmarkParseAverage-4          1000000   1171    ns/op   163 B/op   4 allocs/op\n    BenchmarkStringSimple-4         20000000    119    ns/op    16 B/op   1 allocs/op\n    BenchmarkStringLarger-4         10000000    206    ns/op    32 B/op   2 allocs/op\n    BenchmarkStringComplex-4         5000000    324    ns/op    80 B/op   3 allocs/op\n    BenchmarkStringAverage-4         5000000    273    ns/op    53 B/op   2 allocs/op\n    BenchmarkValidateSimple-4      200000000      9.33 ns/op     0 B/op   0 allocs/op\n    BenchmarkValidateComplex-4       3000000    469    ns/op     0 B/op   0 allocs/op\n    BenchmarkValidateAverage-4       5000000    256    ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareSimple-4       100000000     11.8  ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareComplex-4       50000000     30.8  ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareAverage-4       30000000     41.5  ns/op     0 B/op   0 allocs/op\n    BenchmarkSort-4                  3000000    419    ns/op   256 B/op   2 allocs/op\n    BenchmarkRangeParseSimple-4      2000000    850    ns/op   192 B/op   5 allocs/op\n    BenchmarkRangeParseAverage-4     1000000   1677    ns/op   400 B/op  10 allocs/op\n    BenchmarkRangeParseComplex-4      300000   5214    ns/op  1440 B/op  30 allocs/op\n    BenchmarkRangeMatchSimple-4     50000000     25.6  ns/op     0 B/op   0 allocs/op\n    BenchmarkRangeMatchAverage-4    30000000     56.4  ns/op     0 B/op   0 allocs/op\n    BenchmarkRangeMatchComplex-4    10000000    153    ns/op     0 B/op   0 allocs/op\n\nSee benchmark cases at [semver_test.go](semver_test.go)\n\n\nMotivation\n-----\n\nI simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like.\n\n\nContribution\n-----\n\nFeel free to make a pull request. For bigger changes create a issue first to discuss about it.\n\n\nLicense\n-----\n\nSee [LICENSE](LICENSE) file.\n"
  },
  {
    "path": "vendor/github.com/blang/semver/json.go",
    "content": "package semver\n\nimport (\n\t\"encoding/json\"\n)\n\n// MarshalJSON implements the encoding/json.Marshaler interface.\nfunc (v Version) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(v.String())\n}\n\n// UnmarshalJSON implements the encoding/json.Unmarshaler interface.\nfunc (v *Version) UnmarshalJSON(data []byte) (err error) {\n\tvar versionString string\n\n\tif err = json.Unmarshal(data, &versionString); err != nil {\n\t\treturn\n\t}\n\n\t*v, err = Parse(versionString)\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/package.json",
    "content": "{\n  \"author\": \"blang\",\n  \"bugs\": {\n    \"URL\": \"https://github.com/blang/semver/issues\",\n    \"url\": \"https://github.com/blang/semver/issues\"\n  },\n  \"gx\": {\n    \"dvcsimport\": \"github.com/blang/semver\"\n  },\n  \"gxVersion\": \"0.10.0\",\n  \"language\": \"go\",\n  \"license\": \"MIT\",\n  \"name\": \"semver\",\n  \"releaseCmd\": \"git commit -a -m \\\"gx publish $VERSION\\\"\",\n  \"version\": \"3.5.1\"\n}\n\n"
  },
  {
    "path": "vendor/github.com/blang/semver/range.go",
    "content": "package semver\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\ntype wildcardType int\n\nconst (\n\tnoneWildcard  wildcardType = iota\n\tmajorWildcard wildcardType = 1\n\tminorWildcard wildcardType = 2\n\tpatchWildcard wildcardType = 3\n)\n\nfunc wildcardTypefromInt(i int) wildcardType {\n\tswitch i {\n\tcase 1:\n\t\treturn majorWildcard\n\tcase 2:\n\t\treturn minorWildcard\n\tcase 3:\n\t\treturn patchWildcard\n\tdefault:\n\t\treturn noneWildcard\n\t}\n}\n\ntype comparator func(Version, Version) bool\n\nvar (\n\tcompEQ comparator = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == 0\n\t}\n\tcompNE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) != 0\n\t}\n\tcompGT = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == 1\n\t}\n\tcompGE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) >= 0\n\t}\n\tcompLT = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == -1\n\t}\n\tcompLE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) <= 0\n\t}\n)\n\ntype versionRange struct {\n\tv Version\n\tc comparator\n}\n\n// rangeFunc creates a Range from the given versionRange.\nfunc (vr *versionRange) rangeFunc() Range {\n\treturn Range(func(v Version) bool {\n\t\treturn vr.c(v, vr.v)\n\t})\n}\n\n// Range represents a range of versions.\n// A Range can be used to check if a Version satisfies it:\n//\n//     range, err := semver.ParseRange(\">1.0.0 <2.0.0\")\n//     range(semver.MustParse(\"1.1.1\") // returns true\ntype Range func(Version) bool\n\n// OR combines the existing Range with another Range using logical OR.\nfunc (rf Range) OR(f Range) Range {\n\treturn Range(func(v Version) bool {\n\t\treturn rf(v) || f(v)\n\t})\n}\n\n// AND combines the existing Range with another Range using logical AND.\nfunc (rf Range) AND(f Range) Range {\n\treturn Range(func(v Version) bool {\n\t\treturn rf(v) && f(v)\n\t})\n}\n\n// ParseRange parses a range and returns a Range.\n// If the range could not be parsed an error is returned.\n//\n// Valid ranges are:\n//   - \"<1.0.0\"\n//   - \"<=1.0.0\"\n//   - \">1.0.0\"\n//   - \">=1.0.0\"\n//   - \"1.0.0\", \"=1.0.0\", \"==1.0.0\"\n//   - \"!1.0.0\", \"!=1.0.0\"\n//\n// A Range can consist of multiple ranges separated by space:\n// Ranges can be linked by logical AND:\n//   - \">1.0.0 <2.0.0\" would match between both ranges, so \"1.1.1\" and \"1.8.7\" but not \"1.0.0\" or \"2.0.0\"\n//   - \">1.0.0 <3.0.0 !2.0.3-beta.2\" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2\n//\n// Ranges can also be linked by logical OR:\n//   - \"<2.0.0 || >=3.0.0\" would match \"1.x.x\" and \"3.x.x\" but not \"2.x.x\"\n//\n// AND has a higher precedence than OR. It's not possible to use brackets.\n//\n// Ranges can be combined by both AND and OR\n//\n//  - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`\nfunc ParseRange(s string) (Range, error) {\n\tparts := splitAndTrim(s)\n\torParts, err := splitORParts(parts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texpandedParts, err := expandWildcardVersion(orParts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar orFn Range\n\tfor _, p := range expandedParts {\n\t\tvar andFn Range\n\t\tfor _, ap := range p {\n\t\t\topStr, vStr, err := splitComparatorVersion(ap)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tvr, err := buildVersionRange(opStr, vStr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Could not parse Range %q: %s\", ap, err)\n\t\t\t}\n\t\t\trf := vr.rangeFunc()\n\n\t\t\t// Set function\n\t\t\tif andFn == nil {\n\t\t\t\tandFn = rf\n\t\t\t} else { // Combine with existing function\n\t\t\t\tandFn = andFn.AND(rf)\n\t\t\t}\n\t\t}\n\t\tif orFn == nil {\n\t\t\torFn = andFn\n\t\t} else {\n\t\t\torFn = orFn.OR(andFn)\n\t\t}\n\n\t}\n\treturn orFn, nil\n}\n\n// splitORParts splits the already cleaned parts by '||'.\n// Checks for invalid positions of the operator and returns an\n// error if found.\nfunc splitORParts(parts []string) ([][]string, error) {\n\tvar ORparts [][]string\n\tlast := 0\n\tfor i, p := range parts {\n\t\tif p == \"||\" {\n\t\t\tif i == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"First element in range is '||'\")\n\t\t\t}\n\t\t\tORparts = append(ORparts, parts[last:i])\n\t\t\tlast = i + 1\n\t\t}\n\t}\n\tif last == len(parts) {\n\t\treturn nil, fmt.Errorf(\"Last element in range is '||'\")\n\t}\n\tORparts = append(ORparts, parts[last:])\n\treturn ORparts, nil\n}\n\n// buildVersionRange takes a slice of 2: operator and version\n// and builds a versionRange, otherwise an error.\nfunc buildVersionRange(opStr, vStr string) (*versionRange, error) {\n\tc := parseComparator(opStr)\n\tif c == nil {\n\t\treturn nil, fmt.Errorf(\"Could not parse comparator %q in %q\", opStr, strings.Join([]string{opStr, vStr}, \"\"))\n\t}\n\tv, err := Parse(vStr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not parse version %q in %q: %s\", vStr, strings.Join([]string{opStr, vStr}, \"\"), err)\n\t}\n\n\treturn &versionRange{\n\t\tv: v,\n\t\tc: c,\n\t}, nil\n\n}\n\n// inArray checks if a byte is contained in an array of bytes\nfunc inArray(s byte, list []byte) bool {\n\tfor _, el := range list {\n\t\tif el == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// splitAndTrim splits a range string by spaces and cleans whitespaces\nfunc splitAndTrim(s string) (result []string) {\n\tlast := 0\n\tvar lastChar byte\n\texcludeFromSplit := []byte{'>', '<', '='}\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == ' ' && !inArray(lastChar, excludeFromSplit) {\n\t\t\tif last < i-1 {\n\t\t\t\tresult = append(result, s[last:i])\n\t\t\t}\n\t\t\tlast = i + 1\n\t\t} else if s[i] != ' ' {\n\t\t\tlastChar = s[i]\n\t\t}\n\t}\n\tif last < len(s)-1 {\n\t\tresult = append(result, s[last:])\n\t}\n\n\tfor i, v := range result {\n\t\tresult[i] = strings.Replace(v, \" \", \"\", -1)\n\t}\n\n\t// parts := strings.Split(s, \" \")\n\t// for _, x := range parts {\n\t// \tif s := strings.TrimSpace(x); len(s) != 0 {\n\t// \t\tresult = append(result, s)\n\t// \t}\n\t// }\n\treturn\n}\n\n// splitComparatorVersion splits the comparator from the version.\n// Input must be free of leading or trailing spaces.\nfunc splitComparatorVersion(s string) (string, string, error) {\n\ti := strings.IndexFunc(s, unicode.IsDigit)\n\tif i == -1 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Could not get version from string: %q\", s)\n\t}\n\treturn strings.TrimSpace(s[0:i]), s[i:], nil\n}\n\n// getWildcardType will return the type of wildcard that the\n// passed version contains\nfunc getWildcardType(vStr string) wildcardType {\n\tparts := strings.Split(vStr, \".\")\n\tnparts := len(parts)\n\twildcard := parts[nparts-1]\n\n\tpossibleWildcardType := wildcardTypefromInt(nparts)\n\tif wildcard == \"x\" {\n\t\treturn possibleWildcardType\n\t}\n\n\treturn noneWildcard\n}\n\n// createVersionFromWildcard will convert a wildcard version\n// into a regular version, replacing 'x's with '0's, handling\n// special cases like '1.x.x' and '1.x'\nfunc createVersionFromWildcard(vStr string) string {\n\t// handle 1.x.x\n\tvStr2 := strings.Replace(vStr, \".x.x\", \".x\", 1)\n\tvStr2 = strings.Replace(vStr2, \".x\", \".0\", 1)\n\tparts := strings.Split(vStr2, \".\")\n\n\t// handle 1.x\n\tif len(parts) == 2 {\n\t\treturn vStr2 + \".0\"\n\t}\n\n\treturn vStr2\n}\n\n// incrementMajorVersion will increment the major version\n// of the passed version\nfunc incrementMajorVersion(vStr string) (string, error) {\n\tparts := strings.Split(vStr, \".\")\n\ti, err := strconv.Atoi(parts[0])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparts[0] = strconv.Itoa(i + 1)\n\n\treturn strings.Join(parts, \".\"), nil\n}\n\n// incrementMajorVersion will increment the minor version\n// of the passed version\nfunc incrementMinorVersion(vStr string) (string, error) {\n\tparts := strings.Split(vStr, \".\")\n\ti, err := strconv.Atoi(parts[1])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparts[1] = strconv.Itoa(i + 1)\n\n\treturn strings.Join(parts, \".\"), nil\n}\n\n// expandWildcardVersion will expand wildcards inside versions\n// following these rules:\n//\n// * when dealing with patch wildcards:\n// >= 1.2.x    will become    >= 1.2.0\n// <= 1.2.x    will become    <  1.3.0\n// >  1.2.x    will become    >= 1.3.0\n// <  1.2.x    will become    <  1.2.0\n// != 1.2.x    will become    <  1.2.0 >= 1.3.0\n//\n// * when dealing with minor wildcards:\n// >= 1.x      will become    >= 1.0.0\n// <= 1.x      will become    <  2.0.0\n// >  1.x      will become    >= 2.0.0\n// <  1.0      will become    <  1.0.0\n// != 1.x      will become    <  1.0.0 >= 2.0.0\n//\n// * when dealing with wildcards without\n// version operator:\n// 1.2.x       will become    >= 1.2.0 < 1.3.0\n// 1.x         will become    >= 1.0.0 < 2.0.0\nfunc expandWildcardVersion(parts [][]string) ([][]string, error) {\n\tvar expandedParts [][]string\n\tfor _, p := range parts {\n\t\tvar newParts []string\n\t\tfor _, ap := range p {\n\t\t\tif strings.Index(ap, \"x\") != -1 {\n\t\t\t\topStr, vStr, err := splitComparatorVersion(ap)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tversionWildcardType := getWildcardType(vStr)\n\t\t\t\tflatVersion := createVersionFromWildcard(vStr)\n\n\t\t\t\tvar resultOperator string\n\t\t\t\tvar shouldIncrementVersion bool\n\t\t\t\tswitch opStr {\n\t\t\t\tcase \">\":\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \">=\":\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\tcase \"<\":\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\tcase \"<=\":\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \"\", \"=\", \"==\":\n\t\t\t\t\tnewParts = append(newParts, \">=\"+flatVersion)\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \"!=\", \"!\":\n\t\t\t\t\tnewParts = append(newParts, \"<\"+flatVersion)\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\t}\n\n\t\t\t\tvar resultVersion string\n\t\t\t\tif shouldIncrementVersion {\n\t\t\t\t\tswitch versionWildcardType {\n\t\t\t\t\tcase patchWildcard:\n\t\t\t\t\t\tresultVersion, _ = incrementMinorVersion(flatVersion)\n\t\t\t\t\tcase minorWildcard:\n\t\t\t\t\t\tresultVersion, _ = incrementMajorVersion(flatVersion)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresultVersion = flatVersion\n\t\t\t\t}\n\n\t\t\t\tap = resultOperator + resultVersion\n\t\t\t}\n\t\t\tnewParts = append(newParts, ap)\n\t\t}\n\t\texpandedParts = append(expandedParts, newParts)\n\t}\n\n\treturn expandedParts, nil\n}\n\nfunc parseComparator(s string) comparator {\n\tswitch s {\n\tcase \"==\":\n\t\tfallthrough\n\tcase \"\":\n\t\tfallthrough\n\tcase \"=\":\n\t\treturn compEQ\n\tcase \">\":\n\t\treturn compGT\n\tcase \">=\":\n\t\treturn compGE\n\tcase \"<\":\n\t\treturn compLT\n\tcase \"<=\":\n\t\treturn compLE\n\tcase \"!\":\n\t\tfallthrough\n\tcase \"!=\":\n\t\treturn compNE\n\t}\n\n\treturn nil\n}\n\n// MustParseRange is like ParseRange but panics if the range cannot be parsed.\nfunc MustParseRange(s string) Range {\n\tr, err := ParseRange(s)\n\tif err != nil {\n\t\tpanic(`semver: ParseRange(` + s + `): ` + err.Error())\n\t}\n\treturn r\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/semver.go",
    "content": "package semver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tnumbers  string = \"0123456789\"\n\talphas          = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-\"\n\talphanum        = alphas + numbers\n)\n\n// SpecVersion is the latest fully supported spec version of semver\nvar SpecVersion = Version{\n\tMajor: 2,\n\tMinor: 0,\n\tPatch: 0,\n}\n\n// Version represents a semver compatible version\ntype Version struct {\n\tMajor uint64\n\tMinor uint64\n\tPatch uint64\n\tPre   []PRVersion\n\tBuild []string //No Precendence\n}\n\n// Version to string\nfunc (v Version) String() string {\n\tb := make([]byte, 0, 5)\n\tb = strconv.AppendUint(b, v.Major, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Minor, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Patch, 10)\n\n\tif len(v.Pre) > 0 {\n\t\tb = append(b, '-')\n\t\tb = append(b, v.Pre[0].String()...)\n\n\t\tfor _, pre := range v.Pre[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, pre.String()...)\n\t\t}\n\t}\n\n\tif len(v.Build) > 0 {\n\t\tb = append(b, '+')\n\t\tb = append(b, v.Build[0]...)\n\n\t\tfor _, build := range v.Build[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, build...)\n\t\t}\n\t}\n\n\treturn string(b)\n}\n\n// Equals checks if v is equal to o.\nfunc (v Version) Equals(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// EQ checks if v is equal to o.\nfunc (v Version) EQ(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// NE checks if v is not equal to o.\nfunc (v Version) NE(o Version) bool {\n\treturn (v.Compare(o) != 0)\n}\n\n// GT checks if v is greater than o.\nfunc (v Version) GT(o Version) bool {\n\treturn (v.Compare(o) == 1)\n}\n\n// GTE checks if v is greater than or equal to o.\nfunc (v Version) GTE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// GE checks if v is greater than or equal to o.\nfunc (v Version) GE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// LT checks if v is less than o.\nfunc (v Version) LT(o Version) bool {\n\treturn (v.Compare(o) == -1)\n}\n\n// LTE checks if v is less than or equal to o.\nfunc (v Version) LTE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// LE checks if v is less than or equal to o.\nfunc (v Version) LE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// Compare compares Versions v to o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v Version) Compare(o Version) int {\n\tif v.Major != o.Major {\n\t\tif v.Major > o.Major {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Minor != o.Minor {\n\t\tif v.Minor > o.Minor {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Patch != o.Patch {\n\t\tif v.Patch > o.Patch {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\n\t// Quick comparison if a version has no prerelease versions\n\tif len(v.Pre) == 0 && len(o.Pre) == 0 {\n\t\treturn 0\n\t} else if len(v.Pre) == 0 && len(o.Pre) > 0 {\n\t\treturn 1\n\t} else if len(v.Pre) > 0 && len(o.Pre) == 0 {\n\t\treturn -1\n\t}\n\n\ti := 0\n\tfor ; i < len(v.Pre) && i < len(o.Pre); i++ {\n\t\tif comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {\n\t\t\tcontinue\n\t\t} else if comp == 1 {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\t// If all pr versions are the equal but one has further prversion, this one greater\n\tif i == len(v.Pre) && i == len(o.Pre) {\n\t\treturn 0\n\t} else if i == len(v.Pre) && i < len(o.Pre) {\n\t\treturn -1\n\t} else {\n\t\treturn 1\n\t}\n\n}\n\n// Validate validates v and returns error in case\nfunc (v Version) Validate() error {\n\t// Major, Minor, Patch already validated using uint64\n\n\tfor _, pre := range v.Pre {\n\t\tif !pre.IsNum { //Numeric prerelease versions already uint64\n\t\t\tif len(pre.VersionStr) == 0 {\n\t\t\t\treturn fmt.Errorf(\"Prerelease can not be empty %q\", pre.VersionStr)\n\t\t\t}\n\t\t\tif !containsOnly(pre.VersionStr, alphanum) {\n\t\t\t\treturn fmt.Errorf(\"Invalid character(s) found in prerelease %q\", pre.VersionStr)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, build := range v.Build {\n\t\tif len(build) == 0 {\n\t\t\treturn fmt.Errorf(\"Build meta data can not be empty %q\", build)\n\t\t}\n\t\tif !containsOnly(build, alphanum) {\n\t\t\treturn fmt.Errorf(\"Invalid character(s) found in build meta data %q\", build)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error\nfunc New(s string) (vp *Version, err error) {\n\tv, err := Parse(s)\n\tvp = &v\n\treturn\n}\n\n// Make is an alias for Parse, parses version string and returns a validated Version or error\nfunc Make(s string) (Version, error) {\n\treturn Parse(s)\n}\n\n// ParseTolerant allows for certain version specifications that do not strictly adhere to semver\n// specs to be parsed by this library. It does so by normalizing versions before passing them to\n// Parse(). It currently trims spaces, removes a \"v\" prefix, and adds a 0 patch number to versions\n// with only major and minor components specified\nfunc ParseTolerant(s string) (Version, error) {\n\ts = strings.TrimSpace(s)\n\ts = strings.TrimPrefix(s, \"v\")\n\n\t// Split into major.minor.(patch+pr+meta)\n\tparts := strings.SplitN(s, \".\", 3)\n\tif len(parts) < 3 {\n\t\tif strings.ContainsAny(parts[len(parts)-1], \"+-\") {\n\t\t\treturn Version{}, errors.New(\"Short version cannot contain PreRelease/Build meta data\")\n\t\t}\n\t\tfor len(parts) < 3 {\n\t\t\tparts = append(parts, \"0\")\n\t\t}\n\t\ts = strings.Join(parts, \".\")\n\t}\n\n\treturn Parse(s)\n}\n\n// Parse parses version string and returns a validated Version or error\nfunc Parse(s string) (Version, error) {\n\tif len(s) == 0 {\n\t\treturn Version{}, errors.New(\"Version string empty\")\n\t}\n\n\t// Split into major.minor.(patch+pr+meta)\n\tparts := strings.SplitN(s, \".\", 3)\n\tif len(parts) != 3 {\n\t\treturn Version{}, errors.New(\"No Major.Minor.Patch elements found\")\n\t}\n\n\t// Major\n\tif !containsOnly(parts[0], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in major number %q\", parts[0])\n\t}\n\tif hasLeadingZeroes(parts[0]) {\n\t\treturn Version{}, fmt.Errorf(\"Major number must not contain leading zeroes %q\", parts[0])\n\t}\n\tmajor, err := strconv.ParseUint(parts[0], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\t// Minor\n\tif !containsOnly(parts[1], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in minor number %q\", parts[1])\n\t}\n\tif hasLeadingZeroes(parts[1]) {\n\t\treturn Version{}, fmt.Errorf(\"Minor number must not contain leading zeroes %q\", parts[1])\n\t}\n\tminor, err := strconv.ParseUint(parts[1], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv := Version{}\n\tv.Major = major\n\tv.Minor = minor\n\n\tvar build, prerelease []string\n\tpatchStr := parts[2]\n\n\tif buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {\n\t\tbuild = strings.Split(patchStr[buildIndex+1:], \".\")\n\t\tpatchStr = patchStr[:buildIndex]\n\t}\n\n\tif preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {\n\t\tprerelease = strings.Split(patchStr[preIndex+1:], \".\")\n\t\tpatchStr = patchStr[:preIndex]\n\t}\n\n\tif !containsOnly(patchStr, numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in patch number %q\", patchStr)\n\t}\n\tif hasLeadingZeroes(patchStr) {\n\t\treturn Version{}, fmt.Errorf(\"Patch number must not contain leading zeroes %q\", patchStr)\n\t}\n\tpatch, err := strconv.ParseUint(patchStr, 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv.Patch = patch\n\n\t// Prerelease\n\tfor _, prstr := range prerelease {\n\t\tparsedPR, err := NewPRVersion(prstr)\n\t\tif err != nil {\n\t\t\treturn Version{}, err\n\t\t}\n\t\tv.Pre = append(v.Pre, parsedPR)\n\t}\n\n\t// Build meta data\n\tfor _, str := range build {\n\t\tif len(str) == 0 {\n\t\t\treturn Version{}, errors.New(\"Build meta data is empty\")\n\t\t}\n\t\tif !containsOnly(str, alphanum) {\n\t\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in build meta data %q\", str)\n\t\t}\n\t\tv.Build = append(v.Build, str)\n\t}\n\n\treturn v, nil\n}\n\n// MustParse is like Parse but panics if the version cannot be parsed.\nfunc MustParse(s string) Version {\n\tv, err := Parse(s)\n\tif err != nil {\n\t\tpanic(`semver: Parse(` + s + `): ` + err.Error())\n\t}\n\treturn v\n}\n\n// PRVersion represents a PreRelease Version\ntype PRVersion struct {\n\tVersionStr string\n\tVersionNum uint64\n\tIsNum      bool\n}\n\n// NewPRVersion creates a new valid prerelease version\nfunc NewPRVersion(s string) (PRVersion, error) {\n\tif len(s) == 0 {\n\t\treturn PRVersion{}, errors.New(\"Prerelease is empty\")\n\t}\n\tv := PRVersion{}\n\tif containsOnly(s, numbers) {\n\t\tif hasLeadingZeroes(s) {\n\t\t\treturn PRVersion{}, fmt.Errorf(\"Numeric PreRelease version must not contain leading zeroes %q\", s)\n\t\t}\n\t\tnum, err := strconv.ParseUint(s, 10, 64)\n\n\t\t// Might never be hit, but just in case\n\t\tif err != nil {\n\t\t\treturn PRVersion{}, err\n\t\t}\n\t\tv.VersionNum = num\n\t\tv.IsNum = true\n\t} else if containsOnly(s, alphanum) {\n\t\tv.VersionStr = s\n\t\tv.IsNum = false\n\t} else {\n\t\treturn PRVersion{}, fmt.Errorf(\"Invalid character(s) found in prerelease %q\", s)\n\t}\n\treturn v, nil\n}\n\n// IsNumeric checks if prerelease-version is numeric\nfunc (v PRVersion) IsNumeric() bool {\n\treturn v.IsNum\n}\n\n// Compare compares two PreRelease Versions v and o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v PRVersion) Compare(o PRVersion) int {\n\tif v.IsNum && !o.IsNum {\n\t\treturn -1\n\t} else if !v.IsNum && o.IsNum {\n\t\treturn 1\n\t} else if v.IsNum && o.IsNum {\n\t\tif v.VersionNum == o.VersionNum {\n\t\t\treturn 0\n\t\t} else if v.VersionNum > o.VersionNum {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t} else { // both are Alphas\n\t\tif v.VersionStr == o.VersionStr {\n\t\t\treturn 0\n\t\t} else if v.VersionStr > o.VersionStr {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n}\n\n// PreRelease version to string\nfunc (v PRVersion) String() string {\n\tif v.IsNum {\n\t\treturn strconv.FormatUint(v.VersionNum, 10)\n\t}\n\treturn v.VersionStr\n}\n\nfunc containsOnly(s string, set string) bool {\n\treturn strings.IndexFunc(s, func(r rune) bool {\n\t\treturn !strings.ContainsRune(set, r)\n\t}) == -1\n}\n\nfunc hasLeadingZeroes(s string) bool {\n\treturn len(s) > 1 && s[0] == '0'\n}\n\n// NewBuildVersion creates a new valid build version\nfunc NewBuildVersion(s string) (string, error) {\n\tif len(s) == 0 {\n\t\treturn \"\", errors.New(\"Buildversion is empty\")\n\t}\n\tif !containsOnly(s, alphanum) {\n\t\treturn \"\", fmt.Errorf(\"Invalid character(s) found in build meta data %q\", s)\n\t}\n\treturn s, nil\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sort.go",
    "content": "package semver\n\nimport (\n\t\"sort\"\n)\n\n// Versions represents multiple versions.\ntype Versions []Version\n\n// Len returns length of version collection\nfunc (s Versions) Len() int {\n\treturn len(s)\n}\n\n// Swap swaps two versions inside the collection by its indices\nfunc (s Versions) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\n// Less checks if version at index i is less than version at index j\nfunc (s Versions) Less(i, j int) bool {\n\treturn s[i].LT(s[j])\n}\n\n// Sort sorts a slice of versions\nfunc Sort(versions []Version) {\n\tsort.Sort(Versions(versions))\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sql.go",
    "content": "package semver\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n)\n\n// Scan implements the database/sql.Scanner interface.\nfunc (v *Version) Scan(src interface{}) (err error) {\n\tvar str string\n\tswitch src := src.(type) {\n\tcase string:\n\t\tstr = src\n\tcase []byte:\n\t\tstr = string(src)\n\tdefault:\n\t\treturn fmt.Errorf(\"Version.Scan: cannot convert %T to string.\", src)\n\t}\n\n\tif t, err := Parse(str); err == nil {\n\t\t*v = t\n\t}\n\n\treturn\n}\n\n// Value implements the database/sql/driver.Valuer interface.\nfunc (v Version) Value() (driver.Value, error) {\n\treturn v.String(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2014 Benedikt Lang <github at benediktlang.de>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/json.go",
    "content": "package semver\n\nimport (\n\t\"encoding/json\"\n)\n\n// MarshalJSON implements the encoding/json.Marshaler interface.\nfunc (v Version) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(v.String())\n}\n\n// UnmarshalJSON implements the encoding/json.Unmarshaler interface.\nfunc (v *Version) UnmarshalJSON(data []byte) (err error) {\n\tvar versionString string\n\n\tif err = json.Unmarshal(data, &versionString); err != nil {\n\t\treturn\n\t}\n\n\t*v, err = Parse(versionString)\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/range.go",
    "content": "package semver\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\ntype wildcardType int\n\nconst (\n\tnoneWildcard  wildcardType = iota\n\tmajorWildcard wildcardType = 1\n\tminorWildcard wildcardType = 2\n\tpatchWildcard wildcardType = 3\n)\n\nfunc wildcardTypefromInt(i int) wildcardType {\n\tswitch i {\n\tcase 1:\n\t\treturn majorWildcard\n\tcase 2:\n\t\treturn minorWildcard\n\tcase 3:\n\t\treturn patchWildcard\n\tdefault:\n\t\treturn noneWildcard\n\t}\n}\n\ntype comparator func(Version, Version) bool\n\nvar (\n\tcompEQ comparator = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == 0\n\t}\n\tcompNE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) != 0\n\t}\n\tcompGT = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == 1\n\t}\n\tcompGE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) >= 0\n\t}\n\tcompLT = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) == -1\n\t}\n\tcompLE = func(v1 Version, v2 Version) bool {\n\t\treturn v1.Compare(v2) <= 0\n\t}\n)\n\ntype versionRange struct {\n\tv Version\n\tc comparator\n}\n\n// rangeFunc creates a Range from the given versionRange.\nfunc (vr *versionRange) rangeFunc() Range {\n\treturn Range(func(v Version) bool {\n\t\treturn vr.c(v, vr.v)\n\t})\n}\n\n// Range represents a range of versions.\n// A Range can be used to check if a Version satisfies it:\n//\n//     range, err := semver.ParseRange(\">1.0.0 <2.0.0\")\n//     range(semver.MustParse(\"1.1.1\") // returns true\ntype Range func(Version) bool\n\n// OR combines the existing Range with another Range using logical OR.\nfunc (rf Range) OR(f Range) Range {\n\treturn Range(func(v Version) bool {\n\t\treturn rf(v) || f(v)\n\t})\n}\n\n// AND combines the existing Range with another Range using logical AND.\nfunc (rf Range) AND(f Range) Range {\n\treturn Range(func(v Version) bool {\n\t\treturn rf(v) && f(v)\n\t})\n}\n\n// ParseRange parses a range and returns a Range.\n// If the range could not be parsed an error is returned.\n//\n// Valid ranges are:\n//   - \"<1.0.0\"\n//   - \"<=1.0.0\"\n//   - \">1.0.0\"\n//   - \">=1.0.0\"\n//   - \"1.0.0\", \"=1.0.0\", \"==1.0.0\"\n//   - \"!1.0.0\", \"!=1.0.0\"\n//\n// A Range can consist of multiple ranges separated by space:\n// Ranges can be linked by logical AND:\n//   - \">1.0.0 <2.0.0\" would match between both ranges, so \"1.1.1\" and \"1.8.7\" but not \"1.0.0\" or \"2.0.0\"\n//   - \">1.0.0 <3.0.0 !2.0.3-beta.2\" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2\n//\n// Ranges can also be linked by logical OR:\n//   - \"<2.0.0 || >=3.0.0\" would match \"1.x.x\" and \"3.x.x\" but not \"2.x.x\"\n//\n// AND has a higher precedence than OR. It's not possible to use brackets.\n//\n// Ranges can be combined by both AND and OR\n//\n//  - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`\nfunc ParseRange(s string) (Range, error) {\n\tparts := splitAndTrim(s)\n\torParts, err := splitORParts(parts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texpandedParts, err := expandWildcardVersion(orParts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar orFn Range\n\tfor _, p := range expandedParts {\n\t\tvar andFn Range\n\t\tfor _, ap := range p {\n\t\t\topStr, vStr, err := splitComparatorVersion(ap)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tvr, err := buildVersionRange(opStr, vStr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Could not parse Range %q: %s\", ap, err)\n\t\t\t}\n\t\t\trf := vr.rangeFunc()\n\n\t\t\t// Set function\n\t\t\tif andFn == nil {\n\t\t\t\tandFn = rf\n\t\t\t} else { // Combine with existing function\n\t\t\t\tandFn = andFn.AND(rf)\n\t\t\t}\n\t\t}\n\t\tif orFn == nil {\n\t\t\torFn = andFn\n\t\t} else {\n\t\t\torFn = orFn.OR(andFn)\n\t\t}\n\n\t}\n\treturn orFn, nil\n}\n\n// splitORParts splits the already cleaned parts by '||'.\n// Checks for invalid positions of the operator and returns an\n// error if found.\nfunc splitORParts(parts []string) ([][]string, error) {\n\tvar ORparts [][]string\n\tlast := 0\n\tfor i, p := range parts {\n\t\tif p == \"||\" {\n\t\t\tif i == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"First element in range is '||'\")\n\t\t\t}\n\t\t\tORparts = append(ORparts, parts[last:i])\n\t\t\tlast = i + 1\n\t\t}\n\t}\n\tif last == len(parts) {\n\t\treturn nil, fmt.Errorf(\"Last element in range is '||'\")\n\t}\n\tORparts = append(ORparts, parts[last:])\n\treturn ORparts, nil\n}\n\n// buildVersionRange takes a slice of 2: operator and version\n// and builds a versionRange, otherwise an error.\nfunc buildVersionRange(opStr, vStr string) (*versionRange, error) {\n\tc := parseComparator(opStr)\n\tif c == nil {\n\t\treturn nil, fmt.Errorf(\"Could not parse comparator %q in %q\", opStr, strings.Join([]string{opStr, vStr}, \"\"))\n\t}\n\tv, err := Parse(vStr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not parse version %q in %q: %s\", vStr, strings.Join([]string{opStr, vStr}, \"\"), err)\n\t}\n\n\treturn &versionRange{\n\t\tv: v,\n\t\tc: c,\n\t}, nil\n\n}\n\n// inArray checks if a byte is contained in an array of bytes\nfunc inArray(s byte, list []byte) bool {\n\tfor _, el := range list {\n\t\tif el == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// splitAndTrim splits a range string by spaces and cleans whitespaces\nfunc splitAndTrim(s string) (result []string) {\n\tlast := 0\n\tvar lastChar byte\n\texcludeFromSplit := []byte{'>', '<', '='}\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == ' ' && !inArray(lastChar, excludeFromSplit) {\n\t\t\tif last < i-1 {\n\t\t\t\tresult = append(result, s[last:i])\n\t\t\t}\n\t\t\tlast = i + 1\n\t\t} else if s[i] != ' ' {\n\t\t\tlastChar = s[i]\n\t\t}\n\t}\n\tif last < len(s)-1 {\n\t\tresult = append(result, s[last:])\n\t}\n\n\tfor i, v := range result {\n\t\tresult[i] = strings.Replace(v, \" \", \"\", -1)\n\t}\n\n\t// parts := strings.Split(s, \" \")\n\t// for _, x := range parts {\n\t// \tif s := strings.TrimSpace(x); len(s) != 0 {\n\t// \t\tresult = append(result, s)\n\t// \t}\n\t// }\n\treturn\n}\n\n// splitComparatorVersion splits the comparator from the version.\n// Input must be free of leading or trailing spaces.\nfunc splitComparatorVersion(s string) (string, string, error) {\n\ti := strings.IndexFunc(s, unicode.IsDigit)\n\tif i == -1 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Could not get version from string: %q\", s)\n\t}\n\treturn strings.TrimSpace(s[0:i]), s[i:], nil\n}\n\n// getWildcardType will return the type of wildcard that the\n// passed version contains\nfunc getWildcardType(vStr string) wildcardType {\n\tparts := strings.Split(vStr, \".\")\n\tnparts := len(parts)\n\twildcard := parts[nparts-1]\n\n\tpossibleWildcardType := wildcardTypefromInt(nparts)\n\tif wildcard == \"x\" {\n\t\treturn possibleWildcardType\n\t}\n\n\treturn noneWildcard\n}\n\n// createVersionFromWildcard will convert a wildcard version\n// into a regular version, replacing 'x's with '0's, handling\n// special cases like '1.x.x' and '1.x'\nfunc createVersionFromWildcard(vStr string) string {\n\t// handle 1.x.x\n\tvStr2 := strings.Replace(vStr, \".x.x\", \".x\", 1)\n\tvStr2 = strings.Replace(vStr2, \".x\", \".0\", 1)\n\tparts := strings.Split(vStr2, \".\")\n\n\t// handle 1.x\n\tif len(parts) == 2 {\n\t\treturn vStr2 + \".0\"\n\t}\n\n\treturn vStr2\n}\n\n// incrementMajorVersion will increment the major version\n// of the passed version\nfunc incrementMajorVersion(vStr string) (string, error) {\n\tparts := strings.Split(vStr, \".\")\n\ti, err := strconv.Atoi(parts[0])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparts[0] = strconv.Itoa(i + 1)\n\n\treturn strings.Join(parts, \".\"), nil\n}\n\n// incrementMajorVersion will increment the minor version\n// of the passed version\nfunc incrementMinorVersion(vStr string) (string, error) {\n\tparts := strings.Split(vStr, \".\")\n\ti, err := strconv.Atoi(parts[1])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparts[1] = strconv.Itoa(i + 1)\n\n\treturn strings.Join(parts, \".\"), nil\n}\n\n// expandWildcardVersion will expand wildcards inside versions\n// following these rules:\n//\n// * when dealing with patch wildcards:\n// >= 1.2.x    will become    >= 1.2.0\n// <= 1.2.x    will become    <  1.3.0\n// >  1.2.x    will become    >= 1.3.0\n// <  1.2.x    will become    <  1.2.0\n// != 1.2.x    will become    <  1.2.0 >= 1.3.0\n//\n// * when dealing with minor wildcards:\n// >= 1.x      will become    >= 1.0.0\n// <= 1.x      will become    <  2.0.0\n// >  1.x      will become    >= 2.0.0\n// <  1.0      will become    <  1.0.0\n// != 1.x      will become    <  1.0.0 >= 2.0.0\n//\n// * when dealing with wildcards without\n// version operator:\n// 1.2.x       will become    >= 1.2.0 < 1.3.0\n// 1.x         will become    >= 1.0.0 < 2.0.0\nfunc expandWildcardVersion(parts [][]string) ([][]string, error) {\n\tvar expandedParts [][]string\n\tfor _, p := range parts {\n\t\tvar newParts []string\n\t\tfor _, ap := range p {\n\t\t\tif strings.Contains(ap, \"x\") {\n\t\t\t\topStr, vStr, err := splitComparatorVersion(ap)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tversionWildcardType := getWildcardType(vStr)\n\t\t\t\tflatVersion := createVersionFromWildcard(vStr)\n\n\t\t\t\tvar resultOperator string\n\t\t\t\tvar shouldIncrementVersion bool\n\t\t\t\tswitch opStr {\n\t\t\t\tcase \">\":\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \">=\":\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\tcase \"<\":\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\tcase \"<=\":\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \"\", \"=\", \"==\":\n\t\t\t\t\tnewParts = append(newParts, \">=\"+flatVersion)\n\t\t\t\t\tresultOperator = \"<\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\tcase \"!=\", \"!\":\n\t\t\t\t\tnewParts = append(newParts, \"<\"+flatVersion)\n\t\t\t\t\tresultOperator = \">=\"\n\t\t\t\t\tshouldIncrementVersion = true\n\t\t\t\t}\n\n\t\t\t\tvar resultVersion string\n\t\t\t\tif shouldIncrementVersion {\n\t\t\t\t\tswitch versionWildcardType {\n\t\t\t\t\tcase patchWildcard:\n\t\t\t\t\t\tresultVersion, _ = incrementMinorVersion(flatVersion)\n\t\t\t\t\tcase minorWildcard:\n\t\t\t\t\t\tresultVersion, _ = incrementMajorVersion(flatVersion)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresultVersion = flatVersion\n\t\t\t\t}\n\n\t\t\t\tap = resultOperator + resultVersion\n\t\t\t}\n\t\t\tnewParts = append(newParts, ap)\n\t\t}\n\t\texpandedParts = append(expandedParts, newParts)\n\t}\n\n\treturn expandedParts, nil\n}\n\nfunc parseComparator(s string) comparator {\n\tswitch s {\n\tcase \"==\":\n\t\tfallthrough\n\tcase \"\":\n\t\tfallthrough\n\tcase \"=\":\n\t\treturn compEQ\n\tcase \">\":\n\t\treturn compGT\n\tcase \">=\":\n\t\treturn compGE\n\tcase \"<\":\n\t\treturn compLT\n\tcase \"<=\":\n\t\treturn compLE\n\tcase \"!\":\n\t\tfallthrough\n\tcase \"!=\":\n\t\treturn compNE\n\t}\n\n\treturn nil\n}\n\n// MustParseRange is like ParseRange but panics if the range cannot be parsed.\nfunc MustParseRange(s string) Range {\n\tr, err := ParseRange(s)\n\tif err != nil {\n\t\tpanic(`semver: ParseRange(` + s + `): ` + err.Error())\n\t}\n\treturn r\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/semver.go",
    "content": "package semver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tnumbers  string = \"0123456789\"\n\talphas          = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-\"\n\talphanum        = alphas + numbers\n)\n\n// SpecVersion is the latest fully supported spec version of semver\nvar SpecVersion = Version{\n\tMajor: 2,\n\tMinor: 0,\n\tPatch: 0,\n}\n\n// Version represents a semver compatible version\ntype Version struct {\n\tMajor uint64\n\tMinor uint64\n\tPatch uint64\n\tPre   []PRVersion\n\tBuild []string //No Precedence\n}\n\n// Version to string\nfunc (v Version) String() string {\n\tb := make([]byte, 0, 5)\n\tb = strconv.AppendUint(b, v.Major, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Minor, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Patch, 10)\n\n\tif len(v.Pre) > 0 {\n\t\tb = append(b, '-')\n\t\tb = append(b, v.Pre[0].String()...)\n\n\t\tfor _, pre := range v.Pre[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, pre.String()...)\n\t\t}\n\t}\n\n\tif len(v.Build) > 0 {\n\t\tb = append(b, '+')\n\t\tb = append(b, v.Build[0]...)\n\n\t\tfor _, build := range v.Build[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, build...)\n\t\t}\n\t}\n\n\treturn string(b)\n}\n\n// FinalizeVersion discards prerelease and build number and only returns\n// major, minor and patch number.\nfunc (v Version) FinalizeVersion() string {\n\tb := make([]byte, 0, 5)\n\tb = strconv.AppendUint(b, v.Major, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Minor, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Patch, 10)\n\treturn string(b)\n}\n\n// Equals checks if v is equal to o.\nfunc (v Version) Equals(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// EQ checks if v is equal to o.\nfunc (v Version) EQ(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// NE checks if v is not equal to o.\nfunc (v Version) NE(o Version) bool {\n\treturn (v.Compare(o) != 0)\n}\n\n// GT checks if v is greater than o.\nfunc (v Version) GT(o Version) bool {\n\treturn (v.Compare(o) == 1)\n}\n\n// GTE checks if v is greater than or equal to o.\nfunc (v Version) GTE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// GE checks if v is greater than or equal to o.\nfunc (v Version) GE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// LT checks if v is less than o.\nfunc (v Version) LT(o Version) bool {\n\treturn (v.Compare(o) == -1)\n}\n\n// LTE checks if v is less than or equal to o.\nfunc (v Version) LTE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// LE checks if v is less than or equal to o.\nfunc (v Version) LE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// Compare compares Versions v to o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v Version) Compare(o Version) int {\n\tif v.Major != o.Major {\n\t\tif v.Major > o.Major {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Minor != o.Minor {\n\t\tif v.Minor > o.Minor {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Patch != o.Patch {\n\t\tif v.Patch > o.Patch {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\n\t// Quick comparison if a version has no prerelease versions\n\tif len(v.Pre) == 0 && len(o.Pre) == 0 {\n\t\treturn 0\n\t} else if len(v.Pre) == 0 && len(o.Pre) > 0 {\n\t\treturn 1\n\t} else if len(v.Pre) > 0 && len(o.Pre) == 0 {\n\t\treturn -1\n\t}\n\n\ti := 0\n\tfor ; i < len(v.Pre) && i < len(o.Pre); i++ {\n\t\tif comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {\n\t\t\tcontinue\n\t\t} else if comp == 1 {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\t// If all pr versions are the equal but one has further prversion, this one greater\n\tif i == len(v.Pre) && i == len(o.Pre) {\n\t\treturn 0\n\t} else if i == len(v.Pre) && i < len(o.Pre) {\n\t\treturn -1\n\t} else {\n\t\treturn 1\n\t}\n\n}\n\n// IncrementPatch increments the patch version\nfunc (v *Version) IncrementPatch() error {\n\tv.Patch++\n\treturn nil\n}\n\n// IncrementMinor increments the minor version\nfunc (v *Version) IncrementMinor() error {\n\tv.Minor++\n\tv.Patch = 0\n\treturn nil\n}\n\n// IncrementMajor increments the major version\nfunc (v *Version) IncrementMajor() error {\n\tv.Major++\n\tv.Minor = 0\n\tv.Patch = 0\n\treturn nil\n}\n\n// Validate validates v and returns error in case\nfunc (v Version) Validate() error {\n\t// Major, Minor, Patch already validated using uint64\n\n\tfor _, pre := range v.Pre {\n\t\tif !pre.IsNum { //Numeric prerelease versions already uint64\n\t\t\tif len(pre.VersionStr) == 0 {\n\t\t\t\treturn fmt.Errorf(\"Prerelease can not be empty %q\", pre.VersionStr)\n\t\t\t}\n\t\t\tif !containsOnly(pre.VersionStr, alphanum) {\n\t\t\t\treturn fmt.Errorf(\"Invalid character(s) found in prerelease %q\", pre.VersionStr)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, build := range v.Build {\n\t\tif len(build) == 0 {\n\t\t\treturn fmt.Errorf(\"Build meta data can not be empty %q\", build)\n\t\t}\n\t\tif !containsOnly(build, alphanum) {\n\t\t\treturn fmt.Errorf(\"Invalid character(s) found in build meta data %q\", build)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error\nfunc New(s string) (*Version, error) {\n\tv, err := Parse(s)\n\tvp := &v\n\treturn vp, err\n}\n\n// Make is an alias for Parse, parses version string and returns a validated Version or error\nfunc Make(s string) (Version, error) {\n\treturn Parse(s)\n}\n\n// ParseTolerant allows for certain version specifications that do not strictly adhere to semver\n// specs to be parsed by this library. It does so by normalizing versions before passing them to\n// Parse(). It currently trims spaces, removes a \"v\" prefix, adds a 0 patch number to versions\n// with only major and minor components specified, and removes leading 0s.\nfunc ParseTolerant(s string) (Version, error) {\n\ts = strings.TrimSpace(s)\n\ts = strings.TrimPrefix(s, \"v\")\n\n\t// Split into major.minor.(patch+pr+meta)\n\tparts := strings.SplitN(s, \".\", 3)\n\t// Remove leading zeros.\n\tfor i, p := range parts {\n\t\tif len(p) > 1 {\n\t\t\tp = strings.TrimLeft(p, \"0\")\n\t\t\tif len(p) == 0 || !strings.ContainsAny(p[0:1], \"0123456789\") {\n\t\t\t\tp = \"0\" + p\n\t\t\t}\n\t\t\tparts[i] = p\n\t\t}\n\t}\n\t// Fill up shortened versions.\n\tif len(parts) < 3 {\n\t\tif strings.ContainsAny(parts[len(parts)-1], \"+-\") {\n\t\t\treturn Version{}, errors.New(\"Short version cannot contain PreRelease/Build meta data\")\n\t\t}\n\t\tfor len(parts) < 3 {\n\t\t\tparts = append(parts, \"0\")\n\t\t}\n\t}\n\ts = strings.Join(parts, \".\")\n\n\treturn Parse(s)\n}\n\n// Parse parses version string and returns a validated Version or error\nfunc Parse(s string) (Version, error) {\n\tif len(s) == 0 {\n\t\treturn Version{}, errors.New(\"Version string empty\")\n\t}\n\n\t// Split into major.minor.(patch+pr+meta)\n\tparts := strings.SplitN(s, \".\", 3)\n\tif len(parts) != 3 {\n\t\treturn Version{}, errors.New(\"No Major.Minor.Patch elements found\")\n\t}\n\n\t// Major\n\tif !containsOnly(parts[0], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in major number %q\", parts[0])\n\t}\n\tif hasLeadingZeroes(parts[0]) {\n\t\treturn Version{}, fmt.Errorf(\"Major number must not contain leading zeroes %q\", parts[0])\n\t}\n\tmajor, err := strconv.ParseUint(parts[0], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\t// Minor\n\tif !containsOnly(parts[1], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in minor number %q\", parts[1])\n\t}\n\tif hasLeadingZeroes(parts[1]) {\n\t\treturn Version{}, fmt.Errorf(\"Minor number must not contain leading zeroes %q\", parts[1])\n\t}\n\tminor, err := strconv.ParseUint(parts[1], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv := Version{}\n\tv.Major = major\n\tv.Minor = minor\n\n\tvar build, prerelease []string\n\tpatchStr := parts[2]\n\n\tif buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {\n\t\tbuild = strings.Split(patchStr[buildIndex+1:], \".\")\n\t\tpatchStr = patchStr[:buildIndex]\n\t}\n\n\tif preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {\n\t\tprerelease = strings.Split(patchStr[preIndex+1:], \".\")\n\t\tpatchStr = patchStr[:preIndex]\n\t}\n\n\tif !containsOnly(patchStr, numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in patch number %q\", patchStr)\n\t}\n\tif hasLeadingZeroes(patchStr) {\n\t\treturn Version{}, fmt.Errorf(\"Patch number must not contain leading zeroes %q\", patchStr)\n\t}\n\tpatch, err := strconv.ParseUint(patchStr, 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv.Patch = patch\n\n\t// Prerelease\n\tfor _, prstr := range prerelease {\n\t\tparsedPR, err := NewPRVersion(prstr)\n\t\tif err != nil {\n\t\t\treturn Version{}, err\n\t\t}\n\t\tv.Pre = append(v.Pre, parsedPR)\n\t}\n\n\t// Build meta data\n\tfor _, str := range build {\n\t\tif len(str) == 0 {\n\t\t\treturn Version{}, errors.New(\"Build meta data is empty\")\n\t\t}\n\t\tif !containsOnly(str, alphanum) {\n\t\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in build meta data %q\", str)\n\t\t}\n\t\tv.Build = append(v.Build, str)\n\t}\n\n\treturn v, nil\n}\n\n// MustParse is like Parse but panics if the version cannot be parsed.\nfunc MustParse(s string) Version {\n\tv, err := Parse(s)\n\tif err != nil {\n\t\tpanic(`semver: Parse(` + s + `): ` + err.Error())\n\t}\n\treturn v\n}\n\n// PRVersion represents a PreRelease Version\ntype PRVersion struct {\n\tVersionStr string\n\tVersionNum uint64\n\tIsNum      bool\n}\n\n// NewPRVersion creates a new valid prerelease version\nfunc NewPRVersion(s string) (PRVersion, error) {\n\tif len(s) == 0 {\n\t\treturn PRVersion{}, errors.New(\"Prerelease is empty\")\n\t}\n\tv := PRVersion{}\n\tif containsOnly(s, numbers) {\n\t\tif hasLeadingZeroes(s) {\n\t\t\treturn PRVersion{}, fmt.Errorf(\"Numeric PreRelease version must not contain leading zeroes %q\", s)\n\t\t}\n\t\tnum, err := strconv.ParseUint(s, 10, 64)\n\n\t\t// Might never be hit, but just in case\n\t\tif err != nil {\n\t\t\treturn PRVersion{}, err\n\t\t}\n\t\tv.VersionNum = num\n\t\tv.IsNum = true\n\t} else if containsOnly(s, alphanum) {\n\t\tv.VersionStr = s\n\t\tv.IsNum = false\n\t} else {\n\t\treturn PRVersion{}, fmt.Errorf(\"Invalid character(s) found in prerelease %q\", s)\n\t}\n\treturn v, nil\n}\n\n// IsNumeric checks if prerelease-version is numeric\nfunc (v PRVersion) IsNumeric() bool {\n\treturn v.IsNum\n}\n\n// Compare compares two PreRelease Versions v and o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v PRVersion) Compare(o PRVersion) int {\n\tif v.IsNum && !o.IsNum {\n\t\treturn -1\n\t} else if !v.IsNum && o.IsNum {\n\t\treturn 1\n\t} else if v.IsNum && o.IsNum {\n\t\tif v.VersionNum == o.VersionNum {\n\t\t\treturn 0\n\t\t} else if v.VersionNum > o.VersionNum {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t} else { // both are Alphas\n\t\tif v.VersionStr == o.VersionStr {\n\t\t\treturn 0\n\t\t} else if v.VersionStr > o.VersionStr {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n}\n\n// PreRelease version to string\nfunc (v PRVersion) String() string {\n\tif v.IsNum {\n\t\treturn strconv.FormatUint(v.VersionNum, 10)\n\t}\n\treturn v.VersionStr\n}\n\nfunc containsOnly(s string, set string) bool {\n\treturn strings.IndexFunc(s, func(r rune) bool {\n\t\treturn !strings.ContainsRune(set, r)\n\t}) == -1\n}\n\nfunc hasLeadingZeroes(s string) bool {\n\treturn len(s) > 1 && s[0] == '0'\n}\n\n// NewBuildVersion creates a new valid build version\nfunc NewBuildVersion(s string) (string, error) {\n\tif len(s) == 0 {\n\t\treturn \"\", errors.New(\"Buildversion is empty\")\n\t}\n\tif !containsOnly(s, alphanum) {\n\t\treturn \"\", fmt.Errorf(\"Invalid character(s) found in build meta data %q\", s)\n\t}\n\treturn s, nil\n}\n\n// FinalizeVersion returns the major, minor and patch number only and discards\n// prerelease and build number.\nfunc FinalizeVersion(s string) (string, error) {\n\tv, err := Parse(s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tv.Pre = nil\n\tv.Build = nil\n\n\tfinalVer := v.String()\n\treturn finalVer, nil\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/sort.go",
    "content": "package semver\n\nimport (\n\t\"sort\"\n)\n\n// Versions represents multiple versions.\ntype Versions []Version\n\n// Len returns length of version collection\nfunc (s Versions) Len() int {\n\treturn len(s)\n}\n\n// Swap swaps two versions inside the collection by its indices\nfunc (s Versions) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\n// Less checks if version at index i is less than version at index j\nfunc (s Versions) Less(i, j int) bool {\n\treturn s[i].LT(s[j])\n}\n\n// Sort sorts a slice of versions\nfunc Sort(versions []Version) {\n\tsort.Sort(Versions(versions))\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/v4/sql.go",
    "content": "package semver\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n)\n\n// Scan implements the database/sql.Scanner interface.\nfunc (v *Version) Scan(src interface{}) (err error) {\n\tvar str string\n\tswitch src := src.(type) {\n\tcase string:\n\t\tstr = src\n\tcase []byte:\n\t\tstr = string(src)\n\tdefault:\n\t\treturn fmt.Errorf(\"version.Scan: cannot convert %T to string\", src)\n\t}\n\n\tif t, err := Parse(str); err == nil {\n\t\t*v = t\n\t}\n\n\treturn\n}\n\n// Value implements the database/sql/driver.Valuer interface.\nfunc (v Version) Value() (driver.Value, error) {\n\treturn v.String(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/.codecov.yml",
    "content": "coverage:\n  status:\n    project:\n      default:\n        threshold: 1%\n    patch:\n      default:\n        target: 70%\nignore:\n  - globoptions.go\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/.gitignore",
    "content": "# vi\n*~\n*.swp\n*.swo\n\n# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n\n# test directory\ntest/\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Bob Matcuk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/README.md",
    "content": "# doublestar\n\nPath pattern matching and globbing supporting `doublestar` (`**`) patterns.\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/bmatcuk/doublestar)](https://pkg.go.dev/github.com/bmatcuk/doublestar/v4)\n[![Release](https://img.shields.io/github/release/bmatcuk/doublestar.svg?branch=master)](https://github.com/bmatcuk/doublestar/releases)\n[![Build Status](https://github.com/bmatcuk/doublestar/actions/workflows/test.yml/badge.svg)](https://github.com/bmatcuk/doublestar/actions)\n[![codecov.io](https://img.shields.io/codecov/c/github/bmatcuk/doublestar.svg?branch=master)](https://codecov.io/github/bmatcuk/doublestar?branch=master)\n[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/bmatcuk)\n\n## About\n\n#### [Upgrading?](UPGRADING.md)\n\n**doublestar** is a [golang] implementation of path pattern matching and\nglobbing with support for \"doublestar\" (aka globstar: `**`) patterns.\n\ndoublestar patterns match files and directories recursively. For example, if\nyou had the following directory structure:\n\n```bash\ngrandparent\n`-- parent\n    |-- child1\n    `-- child2\n```\n\nYou could find the children with patterns such as: `**/child*`,\n`grandparent/**/child?`, `**/parent/*`, or even just `**` by itself (which will\nreturn all files and directories recursively).\n\nBash's globstar is doublestar's inspiration and, as such, works similarly.\nNote that the doublestar must appear as a path component by itself. A pattern\nsuch as `/path**` is invalid and will be treated the same as `/path*`, but\n`/path*/**` should achieve the desired result. Additionally, `/path/**` will\nmatch all directories and files under the path directory, but `/path/**/` will\nonly match directories.\n\nv4 is a complete rewrite with a focus on performance. Additionally,\n[doublestar] has been updated to use the new [io/fs] package for filesystem\naccess. As a result, it is only supported by [golang] v1.16+.\n\n## Installation\n\n**doublestar** can be installed via `go get`:\n\n```bash\ngo get github.com/bmatcuk/doublestar/v4\n```\n\nTo use it in your code, you must import it:\n\n```go\nimport \"github.com/bmatcuk/doublestar/v4\"\n```\n\n## Usage\n\n### ErrBadPattern\n\n```go\ndoublestar.ErrBadPattern\n```\n\nReturned by various functions to report that the pattern is malformed. At the\nmoment, this value is equal to `path.ErrBadPattern`, but, for portability, this\nequivalence should probably not be relied upon.\n\n### Match\n\n```go\nfunc Match(pattern, name string) (bool, error)\n```\n\nMatch returns true if `name` matches the file name `pattern` ([see\n\"patterns\"]). `name` and `pattern` are split on forward slash (`/`) characters\nand may be relative or absolute.\n\nMatch requires pattern to match all of name, not just a substring. The only\npossible returned error is `ErrBadPattern`, when pattern is malformed.\n\nNote: this is meant as a drop-in replacement for `path.Match()` which always\nuses `'/'` as the path separator. If you want to support systems which use a\ndifferent path separator (such as Windows), what you want is `PathMatch()`.\nAlternatively, you can run `filepath.ToSlash()` on both pattern and name and\nthen use this function.\n\nNote: users should _not_ count on the returned error,\n`doublestar.ErrBadPattern`, being equal to `path.ErrBadPattern`.\n\n\n### PathMatch\n\n```go\nfunc PathMatch(pattern, name string) (bool, error)\n```\n\nPathMatch returns true if `name` matches the file name `pattern` ([see\n\"patterns\"]). The difference between Match and PathMatch is that PathMatch will\nautomatically use your system's path separator to split `name` and `pattern`.\nOn systems where the path separator is `'\\'`, escaping will be disabled.\n\nNote: this is meant as a drop-in replacement for `filepath.Match()`. It assumes\nthat both `pattern` and `name` are using the system's path separator. If you\ncan't be sure of that, use `filepath.ToSlash()` on both `pattern` and `name`,\nand then use the `Match()` function instead.\n\n### GlobOption\n\nOptions that may be passed to `Glob`, `GlobWalk`, or `FilepathGlob`. Any number\nof options may be passed to these functions, and in any order, as the last\nargument(s).\n\n```go\nWithFailOnIOErrors()\n```\n\nIf passed, doublestar will abort and return IO errors when encountered. Note\nthat if the glob pattern references a path that does not exist (such as\n`nonexistent/path/*`), this is _not_ considered an IO error: it is considered a\npattern with no matches.\n\n```go\nWithFailOnPatternNotExist()\n```\n\nIf passed, doublestar will abort and return `doublestar.ErrPatternNotExist` if\nthe pattern references a path that does not exist before any meta characters\nsuch as `nonexistent/path/*`. Note that alts (ie, `{...}`) are expanded before\nthis check. In other words, a pattern such as `{a,b}/*` may fail if either `a`\nor `b` do not exist but `*/{a,b}` will never fail because the star may match\nnothing.\n\n```go\nWithFilesOnly()\n```\n\nIf passed, doublestar will only return \"files\" from `Glob`, `GlobWalk`, or\n`FilepathGlob`. In this context, \"files\" are anything that is not a directory\nor a symlink to a directory.\n\nNote: if combined with the WithNoFollow option, symlinks to directories _will_\nbe included in the result since no attempt is made to follow the symlink.\n\n```go\nWithNoFollow()\n```\n\nIf passed, doublestar will not follow symlinks while traversing the filesystem.\nHowever, due to io/fs's _very_ poor support for querying the filesystem about\nsymlinks, there's a caveat here: if part of the pattern before any meta\ncharacters contains a reference to a symlink, it will be followed. For example,\na pattern such as `path/to/symlink/*` will be followed assuming it is a valid\nsymlink to a directory. However, from this same example, a pattern such as\n`path/to/**` will not traverse the `symlink`, nor would `path/*/symlink/*`\n\nNote: if combined with the WithFilesOnly option, symlinks to directories _will_\nbe included in the result since no attempt is made to follow the symlink.\n\n### Glob\n\n```go\nfunc Glob(fsys fs.FS, pattern string, opts ...GlobOption) ([]string, error)\n```\n\nGlob returns the names of all files matching pattern or nil if there is no\nmatching file. The syntax of patterns is the same as in `Match()`. The pattern\nmay describe hierarchical names such as `usr/*/bin/ed`.\n\nGlob ignores file system errors such as I/O errors reading directories by\ndefault. The only possible returned error is `ErrBadPattern`, reporting that\nthe pattern is malformed.\n\nTo enable aborting on I/O errors, the `WithFailOnIOErrors` option can be\npassed.\n\nNote: this is meant as a drop-in replacement for `io/fs.Glob()`. Like\n`io/fs.Glob()`, this function assumes that your pattern uses `/` as the path\nseparator even if that's not correct for your OS (like Windows). If you aren't\nsure if that's the case, you can use `filepath.ToSlash()` on your pattern\nbefore calling `Glob()`.\n\nLike `io/fs.Glob()`, patterns containing `/./`, `/../`, or starting with `/`\nwill return no results and no errors. This seems to be a [conscious\ndecision](https://github.com/golang/go/issues/44092#issuecomment-774132549),\neven if counter-intuitive. You can use [SplitPattern] to divide a pattern into\na base path (to initialize an `FS` object) and pattern.\n\nNote: users should _not_ count on the returned error,\n`doublestar.ErrBadPattern`, being equal to `path.ErrBadPattern`.\n\n### GlobWalk\n\n```go\ntype GlobWalkFunc func(path string, d fs.DirEntry) error\n\nfunc GlobWalk(fsys fs.FS, pattern string, fn GlobWalkFunc, opts ...GlobOption) error\n```\n\nGlobWalk calls the callback function `fn` for every file matching pattern.  The\nsyntax of pattern is the same as in Match() and the behavior is the same as\nGlob(), with regard to limitations (such as patterns containing `/./`, `/../`,\nor starting with `/`). The pattern may describe hierarchical names such as\nusr/*/bin/ed.\n\nGlobWalk may have a small performance benefit over Glob if you do not need a\nslice of matches because it can avoid allocating memory for the matches.\nAdditionally, GlobWalk gives you access to the `fs.DirEntry` objects for each\nmatch, and lets you quit early by returning a non-nil error from your callback\nfunction. Like `io/fs.WalkDir`, if your callback returns `SkipDir`, GlobWalk\nwill skip the current directory. This means that if the current path _is_ a\ndirectory, GlobWalk will not recurse into it. If the current path is not a\ndirectory, the rest of the parent directory will be skipped.\n\nGlobWalk ignores file system errors such as I/O errors reading directories by\ndefault. GlobWalk may return `ErrBadPattern`, reporting that the pattern is\nmalformed.\n\nTo enable aborting on I/O errors, the `WithFailOnIOErrors` option can be\npassed.\n\nAdditionally, if the callback function `fn` returns an error, GlobWalk will\nexit immediately and return that error.\n\nLike Glob(), this function assumes that your pattern uses `/` as the path\nseparator even if that's not correct for your OS (like Windows). If you aren't\nsure if that's the case, you can use filepath.ToSlash() on your pattern before\ncalling GlobWalk().\n\nNote: users should _not_ count on the returned error,\n`doublestar.ErrBadPattern`, being equal to `path.ErrBadPattern`.\n\n### FilepathGlob\n\n```go\nfunc FilepathGlob(pattern string, opts ...GlobOption) (matches []string, err error)\n```\n\nFilepathGlob returns the names of all files matching pattern or nil if there is\nno matching file. The syntax of pattern is the same as in Match(). The pattern\nmay describe hierarchical names such as usr/*/bin/ed.\n\nFilepathGlob ignores file system errors such as I/O errors reading directories\nby default. The only possible returned error is `ErrBadPattern`, reporting that\nthe pattern is malformed.\n\nTo enable aborting on I/O errors, the `WithFailOnIOErrors` option can be\npassed.\n\nNote: FilepathGlob is a convenience function that is meant as a drop-in\nreplacement for `path/filepath.Glob()` for users who don't need the\ncomplication of io/fs. Basically, it:\n\n* Runs `filepath.Clean()` and `ToSlash()` on the pattern\n* Runs `SplitPattern()` to get a base path and a pattern to Glob\n* Creates an FS object from the base path and `Glob()s` on the pattern\n* Joins the base path with all of the matches from `Glob()`\n\nReturned paths will use the system's path separator, just like\n`filepath.Glob()`.\n\nNote: the returned error `doublestar.ErrBadPattern` is not equal to\n`filepath.ErrBadPattern`.\n\n### SplitPattern\n\n```go\nfunc SplitPattern(p string) (base, pattern string)\n```\n\nSplitPattern is a utility function. Given a pattern, SplitPattern will return\ntwo strings: the first string is everything up to the last slash (`/`) that\nappears _before_ any unescaped \"meta\" characters (ie, `*?[{`).  The second\nstring is everything after that slash. For example, given the pattern:\n\n```\n../../path/to/meta*/**\n             ^----------- split here\n```\n\nSplitPattern returns \"../../path/to\" and \"meta*/**\". This is useful for\ninitializing os.DirFS() to call Glob() because Glob() will silently fail if\nyour pattern includes `/./` or `/../`. For example:\n\n```go\nbase, pattern := SplitPattern(\"../../path/to/meta*/**\")\nfsys := os.DirFS(base)\nmatches, err := Glob(fsys, pattern)\n```\n\nIf SplitPattern cannot find somewhere to split the pattern (for example,\n`meta*/**`), it will return \".\" and the unaltered pattern (`meta*/**` in this\nexample).\n\nOf course, it is your responsibility to decide if the returned base path is\n\"safe\" in the context of your application. Perhaps you could use Match() to\nvalidate against a list of approved base directories?\n\n### ValidatePattern\n\n```go\nfunc ValidatePattern(s string) bool\n```\n\nValidate a pattern. Patterns are validated while they run in Match(),\nPathMatch(), and Glob(), so, you normally wouldn't need to call this.  However,\nthere are cases where this might be useful: for example, if your program allows\na user to enter a pattern that you'll run at a later time, you might want to\nvalidate it.\n\nValidatePattern assumes your pattern uses '/' as the path separator.\n\n### ValidatePathPattern\n\n```go\nfunc ValidatePathPattern(s string) bool\n```\n\nLike ValidatePattern, only uses your OS path separator. In other words, use\nValidatePattern if you would normally use Match() or Glob(). Use\nValidatePathPattern if you would normally use PathMatch(). Keep in mind, Glob()\nrequires '/' separators, even if your OS uses something else.\n\n### Patterns\n\n**doublestar** supports the following special terms in the patterns:\n\nSpecial Terms | Meaning\n------------- | -------\n`*`           | matches any sequence of non-path-separators\n`/**/`        | matches zero or more directories\n`?`           | matches any single non-path-separator character\n`[class]`     | matches any single non-path-separator character against a class of characters ([see \"character classes\"])\n`{alt1,...}`  | matches a sequence of characters if one of the comma-separated alternatives matches\n\nAny character with a special meaning can be escaped with a backslash (`\\`).\n\nA doublestar (`**`) should appear surrounded by path separators such as `/**/`.\nA mid-pattern doublestar (`**`) behaves like bash's globstar option: a pattern\nsuch as `path/to/**.txt` would return the same results as `path/to/*.txt`. The\npattern you're looking for is `path/to/**/*.txt`.\n\n#### Character Classes\n\nCharacter classes support the following:\n\nClass      | Meaning\n---------- | -------\n`[abc]`    | matches any single character within the set\n`[a-z]`    | matches any single character in the range\n`[^class]` | matches any single character which does *not* match the class\n`[!class]` | same as `^`: negates the class\n\n## Performance\n\n```\ngoos: darwin\ngoarch: amd64\npkg: github.com/bmatcuk/doublestar/v4\ncpu: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz\nBenchmarkMatch-8                  285639              3868 ns/op               0 B/op          0 allocs/op\nBenchmarkGoMatch-8                286945              3726 ns/op               0 B/op          0 allocs/op\nBenchmarkPathMatch-8              320511              3493 ns/op               0 B/op          0 allocs/op\nBenchmarkGoPathMatch-8            304236              3434 ns/op               0 B/op          0 allocs/op\nBenchmarkGlob-8                      466           2501123 ns/op          190225 B/op       2849 allocs/op\nBenchmarkGlobWalk-8                  476           2536293 ns/op          184017 B/op       2750 allocs/op\nBenchmarkGoGlob-8                    463           2574836 ns/op          194249 B/op       2929 allocs/op\n```\n\nThese benchmarks (in `doublestar_test.go`) compare Match() to path.Match(),\nPathMath() to filepath.Match(), and Glob() + GlobWalk() to io/fs.Glob(). They\nonly run patterns that the standard go packages can understand as well (so, no\n`{alts}` or `**`) for a fair comparison. Of course, alts and doublestars will\nbe less performant than the other pattern meta characters.\n\nAlts are essentially like running multiple patterns, the number of which can\nget large if your pattern has alts nested inside alts. This affects both\nmatching (ie, Match()) and globbing (Glob()).\n\n`**` performance in matching is actually pretty similar to a regular `*`, but\ncan cause a large number of reads when globbing as it will need to recursively\ntraverse your filesystem.\n\n## Sponsors\nI started this project in 2014 in my spare time and have been maintaining it\never since. In that time, it has grown into one of the most popular globbing\nlibraries in the Go ecosystem. So, if **doublestar** is a useful library in\nyour project, consider [sponsoring] my work! I'd really appreciate it!\n\n[![reviewpad](../sponsors/reviewpad.png?raw=true)](https://reviewpad.com/)\n\nThanks for sponsoring me!\n\n## License\n\n[MIT License](LICENSE)\n\n[SplitPattern]: #splitpattern\n[doublestar]: https://github.com/bmatcuk/doublestar\n[golang]: http://golang.org/\n[io/fs]: https://pkg.go.dev/io/fs\n[see \"character classes\"]: #character-classes\n[see \"patterns\"]: #patterns\n[sponsoring]: https://github.com/sponsors/bmatcuk\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/UPGRADING.md",
    "content": "# Upgrading from v3 to v4\n\nv4 is a complete rewrite with a focus on performance. Additionally,\n[doublestar] has been updated to use the new [io/fs] package for filesystem\naccess. As a result, it is only supported by [golang] v1.16+.\n\n`Match()` and `PathMatch()` mostly did not change, besides big performance\nimprovements. Their API is the same. However, note the following corner cases:\n\n* In previous versions of [doublestar], `PathMatch()` could accept patterns\n  that used either platform-specific path separators, or `/`. This was\n  undocumented and didn't match `filepath.Match()`. In v4, both `pattern` and\n  `name` must be using appropriate path separators for the platform. You can\n  use `filepath.FromSlash()` to change `/` to platform-specific separators if\n  you aren't sure.\n* In previous versions of [doublestar], a pattern such as `path/to/a/**` would\n  _not_ match `path/to/a`. In v4, this pattern _will_ match because if `a` was\n  a directory, `Glob()` would return it. In other words, the following returns\n  true: `Match(\"path/to/a/**\", \"path/to/a\")`\n\n`Glob()` changed from using a [doublestar]-specific filesystem abstraction (the\n`OS` interface) to the [io/fs] package. As a result, it now takes a `fs.FS` as\nits first argument. This change has a couple ramifications:\n\n* Like `io/fs.Glob`, `pattern` must use a `/` as path separator, even on\n  platforms that use something else. You can use `filepath.ToSlash()` on your\n  patterns if you aren't sure.\n* Patterns that contain `/./` or `/../` are invalid. The [io/fs] package\n  rejects them, returning an IO error. Since `Glob()` ignores IO errors, it'll\n  end up being silently rejected. You can run `path.Clean()` to ensure they are\n  removed from the pattern.\n\nv4 also added a `GlobWalk()` function that is slightly more performant than\n`Glob()` if you just need to iterate over the results and don't need a string\nslice. You also get `fs.DirEntry` objects for each result, and can quit early\nif your callback returns an error.\n\n# Upgrading from v2 to v3\n\nv3 introduced using `!` to negate character classes, in addition to `^`. If any\nof your patterns include a character class that starts with an exclamation mark\n(ie, `[!...]`), you'll need to update the pattern to escape or move the\nexclamation mark. Note that, like the caret (`^`), it only negates the\ncharacter class if it is the first character in the character class.\n\n# Upgrading from v1 to v2\n\nThe change from v1 to v2 was fairly minor: the return type of the `Open` method\non the `OS` interface was changed from `*os.File` to `File`, a new interface\nexported by doublestar. The new `File` interface only defines the functionality\ndoublestar actually needs (`io.Closer` and `Readdir`), making it easier to use\ndoublestar with [go-billy], [afero], or something similar. If you were using\nthis functionality, updating should be as easy as updating `Open's` return\ntype, since `os.File` already implements `doublestar.File`.\n\nIf you weren't using this functionality, updating should be as easy as changing\nyour dependencies to point to v2.\n\n[afero]: https://github.com/spf13/afero\n[doublestar]: https://github.com/bmatcuk/doublestar\n[go-billy]: https://github.com/src-d/go-billy\n[golang]: http://golang.org/\n[io/fs]: https://golang.org/pkg/io/fs/\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/doublestar.go",
    "content": "package doublestar\n\nimport (\n\t\"errors\"\n\t\"path\"\n)\n\n// ErrBadPattern indicates a pattern was malformed.\nvar ErrBadPattern = path.ErrBadPattern\n\n// ErrPatternNotExist indicates that the pattern passed to Glob, GlobWalk, or\n// FilepathGlob references a path that does not exist.\nvar ErrPatternNotExist = errors.New(\"pattern does not exist\")\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/glob.go",
    "content": "package doublestar\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\t\"path\"\n)\n\n// Glob returns the names of all files matching pattern or nil if there is no\n// matching file. The syntax of pattern is the same as in Match(). The pattern\n// may describe hierarchical names such as usr/*/bin/ed.\n//\n// Glob ignores file system errors such as I/O errors reading directories by\n// default. The only possible returned error is ErrBadPattern, reporting that\n// the pattern is malformed.\n//\n// To enable aborting on I/O errors, the WithFailOnIOErrors option can be\n// passed.\n//\n// Note: this is meant as a drop-in replacement for io/fs.Glob(). Like\n// io/fs.Glob(), this function assumes that your pattern uses `/` as the path\n// separator even if that's not correct for your OS (like Windows). If you\n// aren't sure if that's the case, you can use filepath.ToSlash() on your\n// pattern before calling Glob().\n//\n// Like `io/fs.Glob()`, patterns containing `/./`, `/../`, or starting with `/`\n// will return no results and no errors. You can use SplitPattern to divide a\n// pattern into a base path (to initialize an `FS` object) and pattern.\n//\n// Note: users should _not_ count on the returned error,\n// doublestar.ErrBadPattern, being equal to path.ErrBadPattern.\n//\nfunc Glob(fsys fs.FS, pattern string, opts ...GlobOption) ([]string, error) {\n\tif !ValidatePattern(pattern) {\n\t\treturn nil, ErrBadPattern\n\t}\n\n\tg := newGlob(opts...)\n\n\tif hasMidDoubleStar(pattern) {\n\t\t// If the pattern has a `**` anywhere but the very end, GlobWalk is more\n\t\t// performant because it can get away with less allocations. If the pattern\n\t\t// ends in a `**`, both methods are pretty much the same, but Glob has a\n\t\t// _very_ slight advantage because of lower function call overhead.\n\t\tvar matches []string\n\t\terr := g.doGlobWalk(fsys, pattern, true, true, func(p string, d fs.DirEntry) error {\n\t\t\tmatches = append(matches, p)\n\t\t\treturn nil\n\t\t})\n\t\treturn matches, err\n\t}\n\treturn g.doGlob(fsys, pattern, nil, true, true)\n}\n\n// Does the actual globbin'\n//   - firstSegment is true if we're in the first segment of the pattern, ie,\n//     the right-most part where we can match files. If it's false, we're\n//     somewhere in the middle (or at the beginning) and can only match\n//     directories since there are path segments above us.\n//   - beforeMeta is true if we're exploring segments before any meta\n//     characters, ie, in a pattern such as `path/to/file*.txt`, the `path/to/`\n//     bit does not contain any meta characters.\nfunc (g *glob) doGlob(fsys fs.FS, pattern string, m []string, firstSegment, beforeMeta bool) (matches []string, err error) {\n\tmatches = m\n\tpatternStart := indexMeta(pattern)\n\tif patternStart == -1 {\n\t\t// pattern doesn't contain any meta characters - does a file matching the\n\t\t// pattern exist?\n\t\t// The pattern may contain escaped wildcard characters for an exact path match.\n\t\tpath := unescapeMeta(pattern)\n\t\tpathInfo, pathExists, pathErr := g.exists(fsys, path, beforeMeta)\n\t\tif pathErr != nil {\n\t\t\treturn nil, pathErr\n\t\t}\n\n\t\tif pathExists && (!firstSegment || !g.filesOnly || !pathInfo.IsDir()) {\n\t\t\tmatches = append(matches, path)\n\t\t}\n\n\t\treturn\n\t}\n\n\tdir := \".\"\n\tsplitIdx := lastIndexSlashOrAlt(pattern)\n\tif splitIdx != -1 {\n\t\tif pattern[splitIdx] == '}' {\n\t\t\topeningIdx := indexMatchedOpeningAlt(pattern[:splitIdx])\n\t\t\tif openingIdx == -1 {\n\t\t\t\t// if there's no matching opening index, technically Match() will treat\n\t\t\t\t// an unmatched `}` as nothing special, so... we will, too!\n\t\t\t\tsplitIdx = lastIndexSlash(pattern[:splitIdx])\n\t\t\t\tif splitIdx != -1 {\n\t\t\t\t\tdir = pattern[:splitIdx]\n\t\t\t\t\tpattern = pattern[splitIdx+1:]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// otherwise, we have to handle the alts:\n\t\t\t\treturn g.globAlts(fsys, pattern, openingIdx, splitIdx, matches, firstSegment, beforeMeta)\n\t\t\t}\n\t\t} else {\n\t\t\tdir = pattern[:splitIdx]\n\t\t\tpattern = pattern[splitIdx+1:]\n\t\t}\n\t}\n\n\t// if `splitIdx` is less than `patternStart`, we know `dir` has no meta\n\t// characters. They would be equal if they are both -1, which means `dir`\n\t// will be \".\", and we know that doesn't have meta characters either.\n\tif splitIdx <= patternStart {\n\t\treturn g.globDir(fsys, dir, pattern, matches, firstSegment, beforeMeta)\n\t}\n\n\tvar dirs []string\n\tdirs, err = g.doGlob(fsys, dir, matches, false, beforeMeta)\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, d := range dirs {\n\t\tmatches, err = g.globDir(fsys, d, pattern, matches, firstSegment, false)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\n// handle alts in the glob pattern - `openingIdx` and `closingIdx` are the\n// indexes of `{` and `}`, respectively\nfunc (g *glob) globAlts(fsys fs.FS, pattern string, openingIdx, closingIdx int, m []string, firstSegment, beforeMeta bool) (matches []string, err error) {\n\tmatches = m\n\n\tvar dirs []string\n\tstartIdx := 0\n\tafterIdx := closingIdx + 1\n\tsplitIdx := lastIndexSlashOrAlt(pattern[:openingIdx])\n\tif splitIdx == -1 || pattern[splitIdx] == '}' {\n\t\t// no common prefix\n\t\tdirs = []string{\"\"}\n\t} else {\n\t\t// our alts have a common prefix that we can process first\n\t\tdirs, err = g.doGlob(fsys, pattern[:splitIdx], matches, false, beforeMeta)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tstartIdx = splitIdx + 1\n\t}\n\n\tfor _, d := range dirs {\n\t\tpatIdx := openingIdx + 1\n\t\taltResultsStartIdx := len(matches)\n\t\tthisResultStartIdx := altResultsStartIdx\n\t\tfor patIdx < closingIdx {\n\t\t\tnextIdx := indexNextAlt(pattern[patIdx:closingIdx], true)\n\t\t\tif nextIdx == -1 {\n\t\t\t\tnextIdx = closingIdx\n\t\t\t} else {\n\t\t\t\tnextIdx += patIdx\n\t\t\t}\n\n\t\t\talt := buildAlt(d, pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx)\n\t\t\tmatches, err = g.doGlob(fsys, alt, matches, firstSegment, beforeMeta)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmatchesLen := len(matches)\n\t\t\tif altResultsStartIdx != thisResultStartIdx && thisResultStartIdx != matchesLen {\n\t\t\t\t// Alts can result in matches that aren't sorted, or, worse, duplicates\n\t\t\t\t// (consider the trivial pattern `path/to/{a,*}`). Since doGlob returns\n\t\t\t\t// sorted results, we can do a sort of in-place merge and remove\n\t\t\t\t// duplicates. But, we only need to do this if this isn't the first alt\n\t\t\t\t// (ie, `altResultsStartIdx != thisResultsStartIdx`) and if the latest\n\t\t\t\t// alt actually added some matches (`thisResultStartIdx !=\n\t\t\t\t// len(matches)`)\n\t\t\t\tmatches = sortAndRemoveDups(matches, altResultsStartIdx, thisResultStartIdx, matchesLen)\n\n\t\t\t\t// length of matches may have changed\n\t\t\t\tthisResultStartIdx = len(matches)\n\t\t\t} else {\n\t\t\t\tthisResultStartIdx = matchesLen\n\t\t\t}\n\n\t\t\tpatIdx = nextIdx + 1\n\t\t}\n\t}\n\n\treturn\n}\n\n// find files/subdirectories in the given `dir` that match `pattern`\nfunc (g *glob) globDir(fsys fs.FS, dir, pattern string, matches []string, canMatchFiles, beforeMeta bool) (m []string, e error) {\n\tm = matches\n\n\tif pattern == \"\" {\n\t\tif !canMatchFiles || !g.filesOnly {\n\t\t\t// pattern can be an empty string if the original pattern ended in a\n\t\t\t// slash, in which case, we should just return dir, but only if it\n\t\t\t// actually exists and it's a directory (or a symlink to a directory)\n\t\t\t_, isDir, err := g.isPathDir(fsys, dir, beforeMeta)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif isDir {\n\t\t\t\tm = append(m, dir)\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\tif pattern == \"**\" {\n\t\treturn g.globDoubleStar(fsys, dir, m, canMatchFiles, beforeMeta)\n\t}\n\n\tdirs, err := fs.ReadDir(fsys, dir)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\te = g.handlePatternNotExist(beforeMeta)\n\t\t} else {\n\t\t\te = g.forwardErrIfFailOnIOErrors(err)\n\t\t}\n\t\treturn\n\t}\n\n\tvar matched bool\n\tfor _, info := range dirs {\n\t\tname := info.Name()\n\t\tmatched, e = matchWithSeparator(pattern, name, '/', false)\n\t\tif e != nil {\n\t\t\treturn\n\t\t}\n\t\tif matched {\n\t\t\tmatched = canMatchFiles\n\t\t\tif !matched || g.filesOnly {\n\t\t\t\tmatched, e = g.isDir(fsys, dir, name, info)\n\t\t\t\tif e != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif canMatchFiles {\n\t\t\t\t\t// if we're here, it's because g.filesOnly\n\t\t\t\t\t// is set and we don't want directories\n\t\t\t\t\tmatched = !matched\n\t\t\t\t}\n\t\t\t}\n\t\t\tif matched {\n\t\t\t\tm = append(m, path.Join(dir, name))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc (g *glob) globDoubleStar(fsys fs.FS, dir string, matches []string, canMatchFiles, beforeMeta bool) ([]string, error) {\n\tdirs, err := fs.ReadDir(fsys, dir)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn matches, g.handlePatternNotExist(beforeMeta)\n\t\t} else {\n\t\t\treturn matches, g.forwardErrIfFailOnIOErrors(err)\n\t\t}\n\t}\n\n\tif !g.filesOnly {\n\t\t// `**` can match *this* dir, so add it\n\t\tmatches = append(matches, dir)\n\t}\n\n\tfor _, info := range dirs {\n\t\tname := info.Name()\n\t\tisDir, err := g.isDir(fsys, dir, name, info)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isDir {\n\t\t\tmatches, err = g.globDoubleStar(fsys, path.Join(dir, name), matches, canMatchFiles, false)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else if canMatchFiles {\n\t\t\tmatches = append(matches, path.Join(dir, name))\n\t\t}\n\t}\n\n\treturn matches, nil\n}\n\n// Returns true if the pattern has a doublestar in the middle of the pattern.\n// In this case, GlobWalk is faster because it can get away with less\n// allocations. However, Glob has a _very_ slight edge if the pattern ends in\n// `**`.\nfunc hasMidDoubleStar(p string) bool {\n\t// subtract 3: 2 because we want to return false if the pattern ends in `**`\n\t// (Glob is _very_ slightly faster in that case), and the extra 1 because our\n\t// loop checks p[i] and p[i+1].\n\tl := len(p) - 3\n\tfor i := 0; i < l; i++ {\n\t\tif p[i] == '\\\\' {\n\t\t\t// escape next byte\n\t\t\ti++\n\t\t} else if p[i] == '*' && p[i+1] == '*' {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Returns the index of the first unescaped meta character, or negative 1.\nfunc indexMeta(s string) int {\n\tvar c byte\n\tl := len(s)\n\tfor i := 0; i < l; i++ {\n\t\tc = s[i]\n\t\tif c == '*' || c == '?' || c == '[' || c == '{' {\n\t\t\treturn i\n\t\t} else if c == '\\\\' {\n\t\t\t// skip next byte\n\t\t\ti++\n\t\t}\n\t}\n\treturn -1\n}\n\n// Returns the index of the last unescaped slash or closing alt (`}`) in the\n// string, or negative 1.\nfunc lastIndexSlashOrAlt(s string) int {\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tif (s[i] == '/' || s[i] == '}') && (i == 0 || s[i-1] != '\\\\') {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\n// Returns the index of the last unescaped slash in the string, or negative 1.\nfunc lastIndexSlash(s string) int {\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tif s[i] == '/' && (i == 0 || s[i-1] != '\\\\') {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\n// Assuming the byte after the end of `s` is a closing `}`, this function will\n// find the index of the matching `{`. That is, it'll skip over any nested `{}`\n// and account for escaping.\nfunc indexMatchedOpeningAlt(s string) int {\n\talts := 1\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tif s[i] == '}' && (i == 0 || s[i-1] != '\\\\') {\n\t\t\talts++\n\t\t} else if s[i] == '{' && (i == 0 || s[i-1] != '\\\\') {\n\t\t\tif alts--; alts == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}\n\n// Returns true if the path exists\nfunc (g *glob) exists(fsys fs.FS, name string, beforeMeta bool) (fs.FileInfo, bool, error) {\n\t// name might end in a slash, but Stat doesn't like that\n\tnamelen := len(name)\n\tif namelen > 1 && name[namelen-1] == '/' {\n\t\tname = name[:namelen-1]\n\t}\n\n\tinfo, err := fs.Stat(fsys, name)\n\tif errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, false, g.handlePatternNotExist(beforeMeta)\n\t}\n\treturn info, err == nil, g.forwardErrIfFailOnIOErrors(err)\n}\n\n// Returns true if the path exists and is a directory or a symlink to a\n// directory\nfunc (g *glob) isPathDir(fsys fs.FS, name string, beforeMeta bool) (fs.FileInfo, bool, error) {\n\tinfo, err := fs.Stat(fsys, name)\n\tif errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, false, g.handlePatternNotExist(beforeMeta)\n\t}\n\treturn info, err == nil && info.IsDir(), g.forwardErrIfFailOnIOErrors(err)\n}\n\n// Returns whether or not the given DirEntry is a directory. If the DirEntry\n// represents a symbolic link, the link is followed by running fs.Stat() on\n// `path.Join(dir, name)` (if dir is \"\", name will be used without joining)\nfunc (g *glob) isDir(fsys fs.FS, dir, name string, info fs.DirEntry) (bool, error) {\n\tif !g.noFollow && (info.Type()&fs.ModeSymlink) > 0 {\n\t\tp := name\n\t\tif dir != \"\" {\n\t\t\tp = path.Join(dir, name)\n\t\t}\n\t\tfinfo, err := fs.Stat(fsys, p)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t// this function is only ever called while expanding a glob, so it can\n\t\t\t\t// never return ErrPatternNotExist\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn false, g.forwardErrIfFailOnIOErrors(err)\n\t\t}\n\t\treturn finfo.IsDir(), nil\n\t}\n\treturn info.IsDir(), nil\n}\n\n// Builds a string from an alt\nfunc buildAlt(prefix, pattern string, startIdx, openingIdx, currentIdx, nextIdx, afterIdx int) string {\n\t// pattern:\n\t//   ignored/start{alts,go,here}remaining - len = 36\n\t//           |    |     | |     ^--- afterIdx   = 27\n\t//           |    |     | \\--------- nextIdx    = 21\n\t//           |    |     \\----------- currentIdx = 19\n\t//           |    \\----------------- openingIdx = 13\n\t//           \\---------------------- startIdx   = 8\n\t//\n\t// result:\n\t//   prefix/startgoremaining - len = 7 + 5 + 2 + 9 = 23\n\tvar buf []byte\n\tpatLen := len(pattern)\n\tsize := (openingIdx - startIdx) + (nextIdx - currentIdx) + (patLen - afterIdx)\n\tif prefix != \"\" && prefix != \".\" {\n\t\tbuf = make([]byte, 0, size+len(prefix)+1)\n\t\tbuf = append(buf, prefix...)\n\t\tbuf = append(buf, '/')\n\t} else {\n\t\tbuf = make([]byte, 0, size)\n\t}\n\tbuf = append(buf, pattern[startIdx:openingIdx]...)\n\tbuf = append(buf, pattern[currentIdx:nextIdx]...)\n\tif afterIdx < patLen {\n\t\tbuf = append(buf, pattern[afterIdx:]...)\n\t}\n\treturn string(buf)\n}\n\n// Running alts can produce results that are not sorted, and, worse, can cause\n// duplicates (consider the trivial pattern `path/to/{a,*}`). Since we know\n// each run of doGlob is sorted, we can basically do the \"merge\" step of a\n// merge sort in-place.\nfunc sortAndRemoveDups(matches []string, idx1, idx2, l int) []string {\n\tvar tmp string\n\tfor ; idx1 < idx2; idx1++ {\n\t\tif matches[idx1] < matches[idx2] {\n\t\t\t// order is correct\n\t\t\tcontinue\n\t\t} else if matches[idx1] > matches[idx2] {\n\t\t\t// need to swap and then re-sort matches above idx2\n\t\t\ttmp = matches[idx1]\n\t\t\tmatches[idx1] = matches[idx2]\n\n\t\t\tshft := idx2 + 1\n\t\t\tfor ; shft < l && matches[shft] < tmp; shft++ {\n\t\t\t\tmatches[shft-1] = matches[shft]\n\t\t\t}\n\t\t\tmatches[shft-1] = tmp\n\t\t} else {\n\t\t\t// duplicate - shift matches above idx2 down one and decrement l\n\t\t\tfor shft := idx2 + 1; shft < l; shft++ {\n\t\t\t\tmatches[shft-1] = matches[shft]\n\t\t\t}\n\t\t\tif l--; idx2 == l {\n\t\t\t\t// nothing left to do... matches[idx2:] must have been full of dups\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn matches[:l]\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/globoptions.go",
    "content": "package doublestar\n\nimport \"strings\"\n\n// glob is an internal type to store options during globbing.\ntype glob struct {\n\tfailOnIOErrors        bool\n\tfailOnPatternNotExist bool\n\tfilesOnly             bool\n\tnoFollow              bool\n}\n\n// GlobOption represents a setting that can be passed to Glob, GlobWalk, and\n// FilepathGlob.\ntype GlobOption func(*glob)\n\n// Construct a new glob object with the given options\nfunc newGlob(opts ...GlobOption) *glob {\n\tg := &glob{}\n\tfor _, opt := range opts {\n\t\topt(g)\n\t}\n\treturn g\n}\n\n// WithFailOnIOErrors is an option that can be passed to Glob, GlobWalk, or\n// FilepathGlob. If passed, doublestar will abort and return IO errors when\n// encountered. Note that if the glob pattern references a path that does not\n// exist (such as `nonexistent/path/*`), this is _not_ considered an IO error:\n// it is considered a pattern with no matches.\n//\nfunc WithFailOnIOErrors() GlobOption {\n\treturn func(g *glob) {\n\t\tg.failOnIOErrors = true\n\t}\n}\n\n// WithFailOnPatternNotExist is an option that can be passed to Glob, GlobWalk,\n// or FilepathGlob. If passed, doublestar will abort and return\n// ErrPatternNotExist if the pattern references a path that does not exist\n// before any meta charcters such as `nonexistent/path/*`. Note that alts (ie,\n// `{...}`) are expanded before this check. In other words, a pattern such as\n// `{a,b}/*` may fail if either `a` or `b` do not exist but `*/{a,b}` will\n// never fail because the star may match nothing.\n//\nfunc WithFailOnPatternNotExist() GlobOption {\n\treturn func(g *glob) {\n\t\tg.failOnPatternNotExist = true\n\t}\n}\n\n// WithFilesOnly is an option that can be passed to Glob, GlobWalk, or\n// FilepathGlob. If passed, doublestar will only return files that match the\n// pattern, not directories.\n//\n// Note: if combined with the WithNoFollow option, symlinks to directories\n// _will_ be included in the result since no attempt is made to follow the\n// symlink.\n//\nfunc WithFilesOnly() GlobOption {\n\treturn func(g *glob) {\n\t\tg.filesOnly = true\n\t}\n}\n\n// WithNoFollow is an option that can be passed to Glob, GlobWalk, or\n// FilepathGlob. If passed, doublestar will not follow symlinks while\n// traversing the filesystem. However, due to io/fs's _very_ poor support for\n// querying the filesystem about symlinks, there's a caveat here: if part of\n// the pattern before any meta characters contains a reference to a symlink, it\n// will be followed. For example, a pattern such as `path/to/symlink/*` will be\n// followed assuming it is a valid symlink to a directory. However, from this\n// same example, a pattern such as `path/to/**` will not traverse the\n// `symlink`, nor would `path/*/symlink/*`\n//\n// Note: if combined with the WithFilesOnly option, symlinks to directories\n// _will_ be included in the result since no attempt is made to follow the\n// symlink.\n//\nfunc WithNoFollow() GlobOption {\n\treturn func(g *glob) {\n\t\tg.noFollow = true\n\t}\n}\n\n// forwardErrIfFailOnIOErrors is used to wrap the return values of I/O\n// functions. When failOnIOErrors is enabled, it will return err; otherwise, it\n// always returns nil.\n//\nfunc (g *glob) forwardErrIfFailOnIOErrors(err error) error {\n\tif g.failOnIOErrors {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// handleErrNotExist handles fs.ErrNotExist errors. If\n// WithFailOnPatternNotExist has been enabled and canFail is true, this will\n// return ErrPatternNotExist. Otherwise, it will return nil.\n//\nfunc (g *glob) handlePatternNotExist(canFail bool) error {\n\tif canFail && g.failOnPatternNotExist {\n\t\treturn ErrPatternNotExist\n\t}\n\treturn nil\n}\n\n// Format options for debugging/testing purposes\nfunc (g *glob) GoString() string {\n\tvar b strings.Builder\n\tb.WriteString(\"opts: \")\n\n\thasOpts := false\n\tif g.failOnIOErrors {\n\t\tb.WriteString(\"WithFailOnIOErrors\")\n\t\thasOpts = true\n\t}\n\tif g.failOnPatternNotExist {\n\t\tif hasOpts {\n\t\t\tb.WriteString(\", \")\n\t\t}\n\t\tb.WriteString(\"WithFailOnPatternNotExist\")\n\t\thasOpts = true\n\t}\n\tif g.filesOnly {\n\t\tif hasOpts {\n\t\t\tb.WriteString(\", \")\n\t\t}\n\t\tb.WriteString(\"WithFilesOnly\")\n\t\thasOpts = true\n\t}\n\tif g.noFollow {\n\t\tif hasOpts {\n\t\t\tb.WriteString(\", \")\n\t\t}\n\t\tb.WriteString(\"WithNoFollow\")\n\t\thasOpts = true\n\t}\n\n\tif !hasOpts {\n\t\tb.WriteString(\"nil\")\n\t}\n\treturn b.String()\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/globwalk.go",
    "content": "package doublestar\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// If returned from GlobWalkFunc, will cause GlobWalk to skip the current\n// directory. In other words, if the current path is a directory, GlobWalk will\n// not recurse into it. Otherwise, GlobWalk will skip the rest of the current\n// directory.\nvar SkipDir = fs.SkipDir\n\n// Callback function for GlobWalk(). If the function returns an error, GlobWalk\n// will end immediately and return the same error.\ntype GlobWalkFunc func(path string, d fs.DirEntry) error\n\n// GlobWalk calls the callback function `fn` for every file matching pattern.\n// The syntax of pattern is the same as in Match() and the behavior is the same\n// as Glob(), with regard to limitations (such as patterns containing `/./`,\n// `/../`, or starting with `/`). The pattern may describe hierarchical names\n// such as usr/*/bin/ed.\n//\n// GlobWalk may have a small performance benefit over Glob if you do not need a\n// slice of matches because it can avoid allocating memory for the matches.\n// Additionally, GlobWalk gives you access to the `fs.DirEntry` objects for\n// each match, and lets you quit early by returning a non-nil error from your\n// callback function. Like `io/fs.WalkDir`, if your callback returns `SkipDir`,\n// GlobWalk will skip the current directory. This means that if the current\n// path _is_ a directory, GlobWalk will not recurse into it. If the current\n// path is not a directory, the rest of the parent directory will be skipped.\n//\n// GlobWalk ignores file system errors such as I/O errors reading directories\n// by default. GlobWalk may return ErrBadPattern, reporting that the pattern is\n// malformed.\n//\n// To enable aborting on I/O errors, the WithFailOnIOErrors option can be\n// passed.\n//\n// Additionally, if the callback function `fn` returns an error, GlobWalk will\n// exit immediately and return that error.\n//\n// Like Glob(), this function assumes that your pattern uses `/` as the path\n// separator even if that's not correct for your OS (like Windows). If you\n// aren't sure if that's the case, you can use filepath.ToSlash() on your\n// pattern before calling GlobWalk().\n//\n// Note: users should _not_ count on the returned error,\n// doublestar.ErrBadPattern, being equal to path.ErrBadPattern.\n//\nfunc GlobWalk(fsys fs.FS, pattern string, fn GlobWalkFunc, opts ...GlobOption) error {\n\tif !ValidatePattern(pattern) {\n\t\treturn ErrBadPattern\n\t}\n\n\tg := newGlob(opts...)\n\treturn g.doGlobWalk(fsys, pattern, true, true, fn)\n}\n\n// Actually execute GlobWalk\n//   - firstSegment is true if we're in the first segment of the pattern, ie,\n//     the right-most part where we can match files. If it's false, we're\n//     somewhere in the middle (or at the beginning) and can only match\n//     directories since there are path segments above us.\n//   - beforeMeta is true if we're exploring segments before any meta\n//     characters, ie, in a pattern such as `path/to/file*.txt`, the `path/to/`\n//     bit does not contain any meta characters.\nfunc (g *glob) doGlobWalk(fsys fs.FS, pattern string, firstSegment, beforeMeta bool, fn GlobWalkFunc) error {\n\tpatternStart := indexMeta(pattern)\n\tif patternStart == -1 {\n\t\t// pattern doesn't contain any meta characters - does a file matching the\n\t\t// pattern exist?\n\t\t// The pattern may contain escaped wildcard characters for an exact path match.\n\t\tpath := unescapeMeta(pattern)\n\t\tinfo, pathExists, err := g.exists(fsys, path, beforeMeta)\n\t\tif pathExists && (!firstSegment || !g.filesOnly || !info.IsDir()) {\n\t\t\terr = fn(path, dirEntryFromFileInfo(info))\n\t\t\tif err == SkipDir {\n\t\t\t\terr = nil\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\n\tdir := \".\"\n\tsplitIdx := lastIndexSlashOrAlt(pattern)\n\tif splitIdx != -1 {\n\t\tif pattern[splitIdx] == '}' {\n\t\t\topeningIdx := indexMatchedOpeningAlt(pattern[:splitIdx])\n\t\t\tif openingIdx == -1 {\n\t\t\t\t// if there's no matching opening index, technically Match() will treat\n\t\t\t\t// an unmatched `}` as nothing special, so... we will, too!\n\t\t\t\tsplitIdx = lastIndexSlash(pattern[:splitIdx])\n\t\t\t\tif splitIdx != -1 {\n\t\t\t\t\tdir = pattern[:splitIdx]\n\t\t\t\t\tpattern = pattern[splitIdx+1:]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// otherwise, we have to handle the alts:\n\t\t\t\treturn g.globAltsWalk(fsys, pattern, openingIdx, splitIdx, firstSegment, beforeMeta, fn)\n\t\t\t}\n\t\t} else {\n\t\t\tdir = pattern[:splitIdx]\n\t\t\tpattern = pattern[splitIdx+1:]\n\t\t}\n\t}\n\n\t// if `splitIdx` is less than `patternStart`, we know `dir` has no meta\n\t// characters. They would be equal if they are both -1, which means `dir`\n\t// will be \".\", and we know that doesn't have meta characters either.\n\tif splitIdx <= patternStart {\n\t\treturn g.globDirWalk(fsys, dir, pattern, firstSegment, beforeMeta, fn)\n\t}\n\n\treturn g.doGlobWalk(fsys, dir, false, beforeMeta, func(p string, d fs.DirEntry) error {\n\t\tif err := g.globDirWalk(fsys, p, pattern, firstSegment, false, fn); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n\n// handle alts in the glob pattern - `openingIdx` and `closingIdx` are the\n// indexes of `{` and `}`, respectively\nfunc (g *glob) globAltsWalk(fsys fs.FS, pattern string, openingIdx, closingIdx int, firstSegment, beforeMeta bool, fn GlobWalkFunc) (err error) {\n\tvar matches []DirEntryWithFullPath\n\tstartIdx := 0\n\tafterIdx := closingIdx + 1\n\tsplitIdx := lastIndexSlashOrAlt(pattern[:openingIdx])\n\tif splitIdx == -1 || pattern[splitIdx] == '}' {\n\t\t// no common prefix\n\t\tmatches, err = g.doGlobAltsWalk(fsys, \"\", pattern, startIdx, openingIdx, closingIdx, afterIdx, firstSegment, beforeMeta, matches)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\t// our alts have a common prefix that we can process first\n\t\tstartIdx = splitIdx + 1\n\t\tinnerBeforeMeta := beforeMeta && !hasMetaExceptAlts(pattern[:splitIdx])\n\t\terr = g.doGlobWalk(fsys, pattern[:splitIdx], false, beforeMeta, func(p string, d fs.DirEntry) (e error) {\n\t\t\tmatches, e = g.doGlobAltsWalk(fsys, p, pattern, startIdx, openingIdx, closingIdx, afterIdx, firstSegment, innerBeforeMeta, matches)\n\t\t\treturn e\n\t\t})\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tskip := \"\"\n\tfor _, m := range matches {\n\t\tif skip != \"\" {\n\t\t\t// Because matches are sorted, we know that descendants of the skipped\n\t\t\t// item must come immediately after the skipped item. If we find an item\n\t\t\t// that does not have a prefix matching the skipped item, we know we're\n\t\t\t// done skipping. I'm using strings.HasPrefix here because\n\t\t\t// filepath.HasPrefix has been marked deprecated (and just calls\n\t\t\t// strings.HasPrefix anyway). The reason it's deprecated is because it\n\t\t\t// doesn't handle case-insensitive paths, nor does it guarantee that the\n\t\t\t// prefix is actually a parent directory. Neither is an issue here: the\n\t\t\t// paths come from the system so their cases will match, and we guarantee\n\t\t\t// a parent directory by appending a slash to the prefix.\n\t\t\t//\n\t\t\t// NOTE: m.Path will always use slashes as path separators.\n\t\t\tif strings.HasPrefix(m.Path, skip) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tskip = \"\"\n\t\t}\n\t\tif err = fn(m.Path, m.Entry); err != nil {\n\t\t\tif err == SkipDir {\n\t\t\t\tisDir, err := g.isDir(fsys, \"\", m.Path, m.Entry)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif isDir {\n\t\t\t\t\t// append a slash to guarantee `skip` will be treated as a parent dir\n\t\t\t\t\tskip = m.Path + \"/\"\n\t\t\t\t} else {\n\t\t\t\t\t// Dir() calls Clean() which calls FromSlash(), so we need to convert\n\t\t\t\t\t// back to slashes\n\t\t\t\t\tskip = filepath.ToSlash(filepath.Dir(m.Path)) + \"/\"\n\t\t\t\t}\n\t\t\t\terr = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\n// runs actual matching for alts\nfunc (g *glob) doGlobAltsWalk(fsys fs.FS, d, pattern string, startIdx, openingIdx, closingIdx, afterIdx int, firstSegment, beforeMeta bool, m []DirEntryWithFullPath) (matches []DirEntryWithFullPath, err error) {\n\tmatches = m\n\tmatchesLen := len(m)\n\tpatIdx := openingIdx + 1\n\tfor patIdx < closingIdx {\n\t\tnextIdx := indexNextAlt(pattern[patIdx:closingIdx], true)\n\t\tif nextIdx == -1 {\n\t\t\tnextIdx = closingIdx\n\t\t} else {\n\t\t\tnextIdx += patIdx\n\t\t}\n\n\t\talt := buildAlt(d, pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx)\n\t\terr = g.doGlobWalk(fsys, alt, firstSegment, beforeMeta, func(p string, d fs.DirEntry) error {\n\t\t\t// insertion sort, ignoring dups\n\t\t\tinsertIdx := matchesLen\n\t\t\tfor insertIdx > 0 && matches[insertIdx-1].Path > p {\n\t\t\t\tinsertIdx--\n\t\t\t}\n\t\t\tif insertIdx > 0 && matches[insertIdx-1].Path == p {\n\t\t\t\t// dup\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// append to grow the slice, then insert\n\t\t\tentry := DirEntryWithFullPath{d, p}\n\t\t\tmatches = append(matches, entry)\n\t\t\tfor i := matchesLen; i > insertIdx; i-- {\n\t\t\t\tmatches[i] = matches[i-1]\n\t\t\t}\n\t\t\tmatches[insertIdx] = entry\n\t\t\tmatchesLen++\n\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tpatIdx = nextIdx + 1\n\t}\n\n\treturn\n}\n\nfunc (g *glob) globDirWalk(fsys fs.FS, dir, pattern string, canMatchFiles, beforeMeta bool, fn GlobWalkFunc) (e error) {\n\tif pattern == \"\" {\n\t\tif !canMatchFiles || !g.filesOnly {\n\t\t\t// pattern can be an empty string if the original pattern ended in a\n\t\t\t// slash, in which case, we should just return dir, but only if it\n\t\t\t// actually exists and it's a directory (or a symlink to a directory)\n\t\t\tinfo, isDir, err := g.isPathDir(fsys, dir, beforeMeta)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif isDir {\n\t\t\t\te = fn(dir, dirEntryFromFileInfo(info))\n\t\t\t\tif e == SkipDir {\n\t\t\t\t\te = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\tif pattern == \"**\" {\n\t\t// `**` can match *this* dir\n\t\tinfo, dirExists, err := g.exists(fsys, dir, beforeMeta)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !dirExists || !info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif !canMatchFiles || !g.filesOnly {\n\t\t\tif e = fn(dir, dirEntryFromFileInfo(info)); e != nil {\n\t\t\t\tif e == SkipDir {\n\t\t\t\t\te = nil\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\treturn g.globDoubleStarWalk(fsys, dir, canMatchFiles, fn)\n\t}\n\n\tdirs, err := fs.ReadDir(fsys, dir)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn g.handlePatternNotExist(beforeMeta)\n\t\t}\n\t\treturn g.forwardErrIfFailOnIOErrors(err)\n\t}\n\n\tvar matched bool\n\tfor _, info := range dirs {\n\t\tname := info.Name()\n\t\tmatched, e = matchWithSeparator(pattern, name, '/', false)\n\t\tif e != nil {\n\t\t\treturn\n\t\t}\n\t\tif matched {\n\t\t\tmatched = canMatchFiles\n\t\t\tif !matched || g.filesOnly {\n\t\t\t\tmatched, e = g.isDir(fsys, dir, name, info)\n\t\t\t\tif e != nil {\n\t\t\t\t\treturn e\n\t\t\t\t}\n\t\t\t\tif canMatchFiles {\n\t\t\t\t\t// if we're here, it's because g.filesOnly\n\t\t\t\t\t// is set and we don't want directories\n\t\t\t\t\tmatched = !matched\n\t\t\t\t}\n\t\t\t}\n\t\t\tif matched {\n\t\t\t\tif e = fn(path.Join(dir, name), info); e != nil {\n\t\t\t\t\tif e == SkipDir {\n\t\t\t\t\t\te = nil\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\n// recursively walk files/directories in a directory\nfunc (g *glob) globDoubleStarWalk(fsys fs.FS, dir string, canMatchFiles bool, fn GlobWalkFunc) (e error) {\n\tdirs, err := fs.ReadDir(fsys, dir)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t// This function is only ever called after we know the top-most directory\n\t\t\t// exists, so, if we ever get here, we know we'll never return\n\t\t\t// ErrPatternNotExist.\n\t\t\treturn nil\n\t\t}\n\t\treturn g.forwardErrIfFailOnIOErrors(err)\n\t}\n\n\tfor _, info := range dirs {\n\t\tname := info.Name()\n\t\tisDir, err := g.isDir(fsys, dir, name, info)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif isDir {\n\t\t\tp := path.Join(dir, name)\n\t\t\tif !canMatchFiles || !g.filesOnly {\n\t\t\t\t// `**` can match *this* dir, so add it\n\t\t\t\tif e = fn(p, info); e != nil {\n\t\t\t\t\tif e == SkipDir {\n\t\t\t\t\t\te = nil\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tif e = g.globDoubleStarWalk(fsys, p, canMatchFiles, fn); e != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if canMatchFiles {\n\t\t\tif e = fn(path.Join(dir, name), info); e != nil {\n\t\t\t\tif e == SkipDir {\n\t\t\t\t\te = nil\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\ntype DirEntryFromFileInfo struct {\n\tfi fs.FileInfo\n}\n\nfunc (d *DirEntryFromFileInfo) Name() string {\n\treturn d.fi.Name()\n}\n\nfunc (d *DirEntryFromFileInfo) IsDir() bool {\n\treturn d.fi.IsDir()\n}\n\nfunc (d *DirEntryFromFileInfo) Type() fs.FileMode {\n\treturn d.fi.Mode().Type()\n}\n\nfunc (d *DirEntryFromFileInfo) Info() (fs.FileInfo, error) {\n\treturn d.fi, nil\n}\n\nfunc dirEntryFromFileInfo(fi fs.FileInfo) fs.DirEntry {\n\treturn &DirEntryFromFileInfo{fi}\n}\n\ntype DirEntryWithFullPath struct {\n\tEntry fs.DirEntry\n\tPath  string\n}\n\nfunc hasMetaExceptAlts(s string) bool {\n\tvar c byte\n\tl := len(s)\n\tfor i := 0; i < l; i++ {\n\t\tc = s[i]\n\t\tif c == '*' || c == '?' || c == '[' {\n\t\t\treturn true\n\t\t} else if c == '\\\\' {\n\t\t\t// skip next byte\n\t\t\ti++\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/match.go",
    "content": "package doublestar\n\nimport (\n\t\"path/filepath\"\n\t\"unicode/utf8\"\n)\n\n// Match reports whether name matches the shell pattern.\n// The pattern syntax is:\n//\n//  pattern:\n//    { term }\n//  term:\n//    '*'         matches any sequence of non-path-separators\n//    '/**/'      matches zero or more directories\n//    '?'         matches any single non-path-separator character\n//    '[' [ '^' '!' ] { character-range } ']'\n//                character class (must be non-empty)\n//                starting with `^` or `!` negates the class\n//    '{' { term } [ ',' { term } ... ] '}'\n//                alternatives\n//    c           matches character c (c != '*', '?', '\\\\', '[')\n//    '\\\\' c      matches character c\n//\n//  character-range:\n//    c           matches character c (c != '\\\\', '-', ']')\n//    '\\\\' c      matches character c\n//    lo '-' hi   matches character c for lo <= c <= hi\n//\n// Match returns true if `name` matches the file name `pattern`. `name` and\n// `pattern` are split on forward slash (`/`) characters and may be relative or\n// absolute.\n//\n// Match requires pattern to match all of name, not just a substring.\n// The only possible returned error is ErrBadPattern, when pattern\n// is malformed.\n//\n// A doublestar (`**`) should appear surrounded by path separators such as\n// `/**/`.  A mid-pattern doublestar (`**`) behaves like bash's globstar\n// option: a pattern such as `path/to/**.txt` would return the same results as\n// `path/to/*.txt`. The pattern you're looking for is `path/to/**/*.txt`.\n//\n// Note: this is meant as a drop-in replacement for path.Match() which\n// always uses '/' as the path separator. If you want to support systems\n// which use a different path separator (such as Windows), what you want\n// is PathMatch(). Alternatively, you can run filepath.ToSlash() on both\n// pattern and name and then use this function.\n//\n// Note: users should _not_ count on the returned error,\n// doublestar.ErrBadPattern, being equal to path.ErrBadPattern.\n//\nfunc Match(pattern, name string) (bool, error) {\n\treturn matchWithSeparator(pattern, name, '/', true)\n}\n\n// PathMatch returns true if `name` matches the file name `pattern`. The\n// difference between Match and PathMatch is that PathMatch will automatically\n// use your system's path separator to split `name` and `pattern`. On systems\n// where the path separator is `'\\'`, escaping will be disabled.\n//\n// Note: this is meant as a drop-in replacement for filepath.Match(). It\n// assumes that both `pattern` and `name` are using the system's path\n// separator. If you can't be sure of that, use filepath.ToSlash() on both\n// `pattern` and `name`, and then use the Match() function instead.\n//\nfunc PathMatch(pattern, name string) (bool, error) {\n\treturn matchWithSeparator(pattern, name, filepath.Separator, true)\n}\n\nfunc matchWithSeparator(pattern, name string, separator rune, validate bool) (matched bool, err error) {\n\treturn doMatchWithSeparator(pattern, name, separator, validate, -1, -1, -1, -1, 0, 0)\n}\n\nfunc doMatchWithSeparator(pattern, name string, separator rune, validate bool, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, patIdx, nameIdx int) (matched bool, err error) {\n\tpatLen := len(pattern)\n\tnameLen := len(name)\n\tstartOfSegment := true\nMATCH:\n\tfor nameIdx < nameLen {\n\t\tif patIdx < patLen {\n\t\t\tswitch pattern[patIdx] {\n\t\t\tcase '*':\n\t\t\t\tif patIdx++; patIdx < patLen && pattern[patIdx] == '*' {\n\t\t\t\t\t// doublestar - must begin with a path separator, otherwise we'll\n\t\t\t\t\t// treat it like a single star like bash\n\t\t\t\t\tpatIdx++\n\t\t\t\t\tif startOfSegment {\n\t\t\t\t\t\tif patIdx >= patLen {\n\t\t\t\t\t\t\t// pattern ends in `/**`: return true\n\t\t\t\t\t\t\treturn true, nil\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// doublestar must also end with a path separator, otherwise we're\n\t\t\t\t\t\t// just going to treat the doublestar as a single star like bash\n\t\t\t\t\t\tpatRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:])\n\t\t\t\t\t\tif patRune == separator {\n\t\t\t\t\t\t\tpatIdx += patRuneLen\n\n\t\t\t\t\t\t\tdoublestarPatternBacktrack = patIdx\n\t\t\t\t\t\t\tdoublestarNameBacktrack = nameIdx\n\t\t\t\t\t\t\tstarPatternBacktrack = -1\n\t\t\t\t\t\t\tstarNameBacktrack = -1\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstartOfSegment = false\n\n\t\t\t\tstarPatternBacktrack = patIdx\n\t\t\t\tstarNameBacktrack = nameIdx\n\t\t\t\tcontinue\n\n\t\t\tcase '?':\n\t\t\t\tstartOfSegment = false\n\t\t\t\tnameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:])\n\t\t\t\tif nameRune == separator {\n\t\t\t\t\t// `?` cannot match the separator\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tpatIdx++\n\t\t\t\tnameIdx += nameRuneLen\n\t\t\t\tcontinue\n\n\t\t\tcase '[':\n\t\t\t\tstartOfSegment = false\n\t\t\t\tif patIdx++; patIdx >= patLen {\n\t\t\t\t\t// class didn't end\n\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t}\n\t\t\t\tnameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:])\n\n\t\t\t\tmatched := false\n\t\t\t\tnegate := pattern[patIdx] == '!' || pattern[patIdx] == '^'\n\t\t\t\tif negate {\n\t\t\t\t\tpatIdx++\n\t\t\t\t}\n\n\t\t\t\tif patIdx >= patLen || pattern[patIdx] == ']' {\n\t\t\t\t\t// class didn't end or empty character class\n\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t}\n\n\t\t\t\tlast := utf8.MaxRune\n\t\t\t\tfor patIdx < patLen && pattern[patIdx] != ']' {\n\t\t\t\t\tpatRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:])\n\t\t\t\t\tpatIdx += patRuneLen\n\n\t\t\t\t\t// match a range\n\t\t\t\t\tif last < utf8.MaxRune && patRune == '-' && patIdx < patLen && pattern[patIdx] != ']' {\n\t\t\t\t\t\tif pattern[patIdx] == '\\\\' {\n\t\t\t\t\t\t\t// next character is escaped\n\t\t\t\t\t\t\tpatIdx++\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpatRune, patRuneLen = utf8.DecodeRuneInString(pattern[patIdx:])\n\t\t\t\t\t\tpatIdx += patRuneLen\n\n\t\t\t\t\t\tif last <= nameRune && nameRune <= patRune {\n\t\t\t\t\t\t\tmatched = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// didn't match range - reset `last`\n\t\t\t\t\t\tlast = utf8.MaxRune\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// not a range - check if the next rune is escaped\n\t\t\t\t\tif patRune == '\\\\' {\n\t\t\t\t\t\tpatRune, patRuneLen = utf8.DecodeRuneInString(pattern[patIdx:])\n\t\t\t\t\t\tpatIdx += patRuneLen\n\t\t\t\t\t}\n\n\t\t\t\t\t// check if the rune matches\n\t\t\t\t\tif patRune == nameRune {\n\t\t\t\t\t\tmatched = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\t// no matches yet\n\t\t\t\t\tlast = patRune\n\t\t\t\t}\n\n\t\t\t\tif matched == negate {\n\t\t\t\t\t// failed to match - if we reached the end of the pattern, that means\n\t\t\t\t\t// we never found a closing `]`\n\t\t\t\t\tif patIdx >= patLen {\n\t\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tclosingIdx := indexUnescapedByte(pattern[patIdx:], ']', true)\n\t\t\t\tif closingIdx == -1 {\n\t\t\t\t\t// no closing `]`\n\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t}\n\n\t\t\t\tpatIdx += closingIdx + 1\n\t\t\t\tnameIdx += nameRuneLen\n\t\t\t\tcontinue\n\n\t\t\tcase '{':\n\t\t\t\tstartOfSegment = false\n\t\t\t\tbeforeIdx := patIdx\n\t\t\t\tpatIdx++\n\t\t\t\tclosingIdx := indexMatchedClosingAlt(pattern[patIdx:], separator != '\\\\')\n\t\t\t\tif closingIdx == -1 {\n\t\t\t\t\t// no closing `}`\n\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t}\n\t\t\t\tclosingIdx += patIdx\n\n\t\t\t\tfor {\n\t\t\t\t\tcommaIdx := indexNextAlt(pattern[patIdx:closingIdx], separator != '\\\\')\n\t\t\t\t\tif commaIdx == -1 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcommaIdx += patIdx\n\n\t\t\t\t\tresult, err := doMatchWithSeparator(pattern[:beforeIdx]+pattern[patIdx:commaIdx]+pattern[closingIdx+1:], name, separator, validate, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, beforeIdx, nameIdx)\n\t\t\t\t\tif result || err != nil {\n\t\t\t\t\t\treturn result, err\n\t\t\t\t\t}\n\n\t\t\t\t\tpatIdx = commaIdx + 1\n\t\t\t\t}\n\t\t\t\treturn doMatchWithSeparator(pattern[:beforeIdx]+pattern[patIdx:closingIdx]+pattern[closingIdx+1:], name, separator, validate, doublestarPatternBacktrack, doublestarNameBacktrack, starPatternBacktrack, starNameBacktrack, beforeIdx, nameIdx)\n\n\t\t\tcase '\\\\':\n\t\t\t\tif separator != '\\\\' {\n\t\t\t\t\t// next rune is \"escaped\" in the pattern - literal match\n\t\t\t\t\tif patIdx++; patIdx >= patLen {\n\t\t\t\t\t\t// pattern ended\n\t\t\t\t\t\treturn false, ErrBadPattern\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfallthrough\n\n\t\t\tdefault:\n\t\t\t\tpatRune, patRuneLen := utf8.DecodeRuneInString(pattern[patIdx:])\n\t\t\t\tnameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:])\n\t\t\t\tif patRune != nameRune {\n\t\t\t\t\tif separator != '\\\\' && patIdx > 0 && pattern[patIdx-1] == '\\\\' {\n\t\t\t\t\t\t// if this rune was meant to be escaped, we need to move patIdx\n\t\t\t\t\t\t// back to the backslash before backtracking or validating below\n\t\t\t\t\t\tpatIdx--\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tpatIdx += patRuneLen\n\t\t\t\tnameIdx += nameRuneLen\n\t\t\t\tstartOfSegment = patRune == separator\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif starPatternBacktrack >= 0 {\n\t\t\t// `*` backtrack, but only if the `name` rune isn't the separator\n\t\t\tnameRune, nameRuneLen := utf8.DecodeRuneInString(name[starNameBacktrack:])\n\t\t\tif nameRune != separator {\n\t\t\t\tstarNameBacktrack += nameRuneLen\n\t\t\t\tpatIdx = starPatternBacktrack\n\t\t\t\tnameIdx = starNameBacktrack\n\t\t\t\tstartOfSegment = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif doublestarPatternBacktrack >= 0 {\n\t\t\t// `**` backtrack, advance `name` past next separator\n\t\t\tnameIdx = doublestarNameBacktrack\n\t\t\tfor nameIdx < nameLen {\n\t\t\t\tnameRune, nameRuneLen := utf8.DecodeRuneInString(name[nameIdx:])\n\t\t\t\tnameIdx += nameRuneLen\n\t\t\t\tif nameRune == separator {\n\t\t\t\t\tdoublestarNameBacktrack = nameIdx\n\t\t\t\t\tpatIdx = doublestarPatternBacktrack\n\t\t\t\t\tstartOfSegment = true\n\t\t\t\t\tcontinue MATCH\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif validate && patIdx < patLen && !doValidatePattern(pattern[patIdx:], separator) {\n\t\t\treturn false, ErrBadPattern\n\t\t}\n\t\treturn false, nil\n\t}\n\n\tif nameIdx < nameLen {\n\t\t// we reached the end of `pattern` before the end of `name`\n\t\treturn false, nil\n\t}\n\n\t// we've reached the end of `name`; we've successfully matched if we've also\n\t// reached the end of `pattern`, or if the rest of `pattern` can match a\n\t// zero-length string\n\treturn isZeroLengthPattern(pattern[patIdx:], separator)\n}\n\nfunc isZeroLengthPattern(pattern string, separator rune) (ret bool, err error) {\n\t// `/**` is a special case - a pattern such as `path/to/a/**` *should* match\n\t// `path/to/a` because `a` might be a directory\n\tif pattern == \"\" || pattern == \"*\" || pattern == \"**\" || pattern == string(separator)+\"**\" {\n\t\treturn true, nil\n\t}\n\n\tif pattern[0] == '{' {\n\t\tclosingIdx := indexMatchedClosingAlt(pattern[1:], separator != '\\\\')\n\t\tif closingIdx == -1 {\n\t\t\t// no closing '}'\n\t\t\treturn false, ErrBadPattern\n\t\t}\n\t\tclosingIdx += 1\n\n\t\tpatIdx := 1\n\t\tfor {\n\t\t\tcommaIdx := indexNextAlt(pattern[patIdx:closingIdx], separator != '\\\\')\n\t\t\tif commaIdx == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcommaIdx += patIdx\n\n\t\t\tret, err = isZeroLengthPattern(pattern[patIdx:commaIdx]+pattern[closingIdx+1:], separator)\n\t\t\tif ret || err != nil {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tpatIdx = commaIdx + 1\n\t\t}\n\t\treturn isZeroLengthPattern(pattern[patIdx:closingIdx]+pattern[closingIdx+1:], separator)\n\t}\n\n\t// no luck - validate the rest of the pattern\n\tif !doValidatePattern(pattern, separator) {\n\t\treturn false, ErrBadPattern\n\t}\n\treturn false, nil\n}\n\n// Finds the index of the first unescaped byte `c`, or negative 1.\nfunc indexUnescapedByte(s string, c byte, allowEscaping bool) int {\n\tl := len(s)\n\tfor i := 0; i < l; i++ {\n\t\tif allowEscaping && s[i] == '\\\\' {\n\t\t\t// skip next byte\n\t\t\ti++\n\t\t} else if s[i] == c {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\n// Assuming the byte before the beginning of `s` is an opening `{`, this\n// function will find the index of the matching `}`. That is, it'll skip over\n// any nested `{}` and account for escaping\nfunc indexMatchedClosingAlt(s string, allowEscaping bool) int {\n\talts := 1\n\tl := len(s)\n\tfor i := 0; i < l; i++ {\n\t\tif allowEscaping && s[i] == '\\\\' {\n\t\t\t// skip next byte\n\t\t\ti++\n\t\t} else if s[i] == '{' {\n\t\t\talts++\n\t\t} else if s[i] == '}' {\n\t\t\tif alts--; alts == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/utils.go",
    "content": "package doublestar\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// SplitPattern is a utility function. Given a pattern, SplitPattern will\n// return two strings: the first string is everything up to the last slash\n// (`/`) that appears _before_ any unescaped \"meta\" characters (ie, `*?[{`).\n// The second string is everything after that slash. For example, given the\n// pattern:\n//\n//   ../../path/to/meta*/**\n//                ^----------- split here\n//\n// SplitPattern returns \"../../path/to\" and \"meta*/**\". This is useful for\n// initializing os.DirFS() to call Glob() because Glob() will silently fail if\n// your pattern includes `/./` or `/../`. For example:\n//\n//   base, pattern := SplitPattern(\"../../path/to/meta*/**\")\n//   fsys := os.DirFS(base)\n//   matches, err := Glob(fsys, pattern)\n//\n// If SplitPattern cannot find somewhere to split the pattern (for example,\n// `meta*/**`), it will return \".\" and the unaltered pattern (`meta*/**` in\n// this example).\n//\n// Of course, it is your responsibility to decide if the returned base path is\n// \"safe\" in the context of your application. Perhaps you could use Match() to\n// validate against a list of approved base directories?\n//\nfunc SplitPattern(p string) (base, pattern string) {\n\tbase = \".\"\n\tpattern = p\n\n\tsplitIdx := -1\n\tfor i := 0; i < len(p); i++ {\n\t\tc := p[i]\n\t\tif c == '\\\\' {\n\t\t\ti++\n\t\t} else if c == '/' {\n\t\t\tsplitIdx = i\n\t\t} else if c == '*' || c == '?' || c == '[' || c == '{' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif splitIdx == 0 {\n\t\treturn \"/\", p[1:]\n\t} else if splitIdx > 0 {\n\t\treturn p[:splitIdx], p[splitIdx+1:]\n\t}\n\n\treturn\n}\n\n// FilepathGlob returns the names of all files matching pattern or nil if there\n// is no matching file. The syntax of pattern is the same as in Match(). The\n// pattern may describe hierarchical names such as usr/*/bin/ed.\n//\n// FilepathGlob ignores file system errors such as I/O errors reading\n// directories by default. The only possible returned error is ErrBadPattern,\n// reporting that the pattern is malformed.\n//\n// To enable aborting on I/O errors, the WithFailOnIOErrors option can be\n// passed.\n//\n// Note: FilepathGlob is a convenience function that is meant as a drop-in\n// replacement for `path/filepath.Glob()` for users who don't need the\n// complication of io/fs. Basically, it:\n//   - Runs `filepath.Clean()` and `ToSlash()` on the pattern\n//   - Runs `SplitPattern()` to get a base path and a pattern to Glob\n//   - Creates an FS object from the base path and `Glob()s` on the pattern\n//   - Joins the base path with all of the matches from `Glob()`\n//\n// Returned paths will use the system's path separator, just like\n// `filepath.Glob()`.\n//\n// Note: the returned error doublestar.ErrBadPattern is not equal to\n// filepath.ErrBadPattern.\n//\nfunc FilepathGlob(pattern string, opts ...GlobOption) (matches []string, err error) {\n\tpattern = filepath.Clean(pattern)\n\tpattern = filepath.ToSlash(pattern)\n\tbase, f := SplitPattern(pattern)\n\tif f == \"\" || f == \".\" || f == \"..\" {\n\t\t// some special cases to match filepath.Glob behavior\n\t\tif !ValidatePathPattern(pattern) {\n\t\t\treturn nil, ErrBadPattern\n\t\t}\n\n\t\tif filepath.Separator != '\\\\' {\n\t\t\tpattern = unescapeMeta(pattern)\n\t\t}\n\n\t\tif _, err = os.Lstat(pattern); err != nil {\n\t\t\tg := newGlob(opts...)\n\t\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t\treturn nil, g.handlePatternNotExist(true)\n\t\t\t}\n\t\t\treturn nil, g.forwardErrIfFailOnIOErrors(err)\n\t\t}\n\t\treturn []string{filepath.FromSlash(pattern)}, nil\n\t}\n\n\tfs := os.DirFS(base)\n\tif matches, err = Glob(fs, f, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tfor i := range matches {\n\t\t// use path.Join because we used ToSlash above to ensure our paths are made\n\t\t// of forward slashes, no matter what the system uses\n\t\tmatches[i] = filepath.FromSlash(path.Join(base, matches[i]))\n\t}\n\treturn\n}\n\n// Finds the next comma, but ignores any commas that appear inside nested `{}`.\n// Assumes that each opening bracket has a corresponding closing bracket.\nfunc indexNextAlt(s string, allowEscaping bool) int {\n\talts := 1\n\tl := len(s)\n\tfor i := 0; i < l; i++ {\n\t\tif allowEscaping && s[i] == '\\\\' {\n\t\t\t// skip next byte\n\t\t\ti++\n\t\t} else if s[i] == '{' {\n\t\t\talts++\n\t\t} else if s[i] == '}' {\n\t\t\talts--\n\t\t} else if s[i] == ',' && alts == 1 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nvar metaReplacer = strings.NewReplacer(\"\\\\*\", \"*\", \"\\\\?\", \"?\", \"\\\\[\", \"[\", \"\\\\]\", \"]\", \"\\\\{\", \"{\", \"\\\\}\", \"}\")\n\n// Unescapes meta characters (*?[]{})\nfunc unescapeMeta(pattern string) string {\n\treturn metaReplacer.Replace(pattern)\n}\n"
  },
  {
    "path": "vendor/github.com/bmatcuk/doublestar/v4/validate.go",
    "content": "package doublestar\n\nimport \"path/filepath\"\n\n// Validate a pattern. Patterns are validated while they run in Match(),\n// PathMatch(), and Glob(), so, you normally wouldn't need to call this.\n// However, there are cases where this might be useful: for example, if your\n// program allows a user to enter a pattern that you'll run at a later time,\n// you might want to validate it.\n//\n// ValidatePattern assumes your pattern uses '/' as the path separator.\n//\nfunc ValidatePattern(s string) bool {\n\treturn doValidatePattern(s, '/')\n}\n\n// Like ValidatePattern, only uses your OS path separator. In other words, use\n// ValidatePattern if you would normally use Match() or Glob(). Use\n// ValidatePathPattern if you would normally use PathMatch(). Keep in mind,\n// Glob() requires '/' separators, even if your OS uses something else.\n//\nfunc ValidatePathPattern(s string) bool {\n\treturn doValidatePattern(s, filepath.Separator)\n}\n\nfunc doValidatePattern(s string, separator rune) bool {\n\taltDepth := 0\n\tl := len(s)\nVALIDATE:\n\tfor i := 0; i < l; i++ {\n\t\tswitch s[i] {\n\t\tcase '\\\\':\n\t\t\tif separator != '\\\\' {\n\t\t\t\t// skip the next byte - return false if there is no next byte\n\t\t\t\tif i++; i >= l {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\n\t\tcase '[':\n\t\t\tif i++; i >= l {\n\t\t\t\t// class didn't end\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif s[i] == '^' || s[i] == '!' {\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i >= l || s[i] == ']' {\n\t\t\t\t// class didn't end or empty character class\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tfor ; i < l; i++ {\n\t\t\t\tif separator != '\\\\' && s[i] == '\\\\' {\n\t\t\t\t\ti++\n\t\t\t\t} else if s[i] == ']' {\n\t\t\t\t\t// looks good\n\t\t\t\t\tcontinue VALIDATE\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// class didn't end\n\t\t\treturn false\n\n\t\tcase '{':\n\t\t\taltDepth++\n\t\t\tcontinue\n\n\t\tcase '}':\n\t\t\tif altDepth == 0 {\n\t\t\t\t// alt end without a corresponding start\n\t\t\t\treturn false\n\t\t\t}\n\t\t\taltDepth--\n\t\t\tcontinue\n\t\t}\n\t}\n\n\t// valid as long as all alts are closed\n\treturn altDepth == 0\n}\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/.editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent\n# coding styles between different editors and IDEs\n# EditorConfig is awesome: https://EditorConfig.org\n\nroot = true\n\n[*]\ncharset = utf-8\nindent_size = 2\nindent_style = space\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n# go\n[*.go]\nindent_style = tab\nindent_size = 4\n\n# python\n[*.{ini,py,py.tpl,rst}]\nindent_size = 4\n\n# rust\n[*.rs]\nindent_size = 4\n\n# documentation, utils\n[*.{md,mdx,diff}]\ntrim_trailing_whitespace = false\n\n# windows shell scripts\n[*.{cmd,bat,ps1}]\nend_of_line = crlf\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/.gitignore",
    "content": "coverage.txt\n<<<<<<< HEAD\n\ndist/\n=======\n_examples/catppuccin\n_examples/frames/\n>>>>>>> 448501b (feat: documentation, better examples)\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/.goreleaser.yaml",
    "content": "before:\n  hooks:\n    - go mod tidy\nbuilds:\n- skip: true\n\n# modelines, feel free to remove those if you don't want/use them:\n# yaml-language-server: $schema=https://goreleaser.com/static/schema.json\n# vim: set ts=2 sw=2 tw=0 fo=cnqoj\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2021 Catppuccin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/README.md",
    "content": "<h3 align=\"center\">\n\t<img src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/logos/exports/1544x1544_circle.png\" width=\"100\" alt=\"Logo\"/><br/>\n\t<img src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png\" height=\"30\" width=\"0px\"/>\n\tCatppuccin for <a href=\"https://go.dev\">Go</a>\n\t<img src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png\" height=\"30\" width=\"0px\"/>\n</h3>\n\n<p align=\"center\">\n\t<a href=\"https://github.com/caarlos0/catppuccin-go/stargazers\"><img src=\"https://img.shields.io/github/stars/caarlos0/catppuccin-go?colorA=363a4f&colorB=b7bdf8&style=for-the-badge\"></a>\n\t<a href=\"https://github.com/caarlos0/catppuccin-go/issues\"><img src=\"https://img.shields.io/github/issues/caarlos0/catppuccin-go?colorA=363a4f&colorB=f5a97f&style=for-the-badge\"></a>\n\t<a href=\"https://github.com/caarlos0/catppuccin-go/contributors\"><img src=\"https://img.shields.io/github/contributors/caarlos0/catppuccin-go?colorA=363a4f&colorB=a6da95&style=for-the-badge\"></a>\n</p>\n\n![Catppuccin Variants](https://raw.githubusercontent.com/catppuccin/go/main/_examples/catppuccin.gif)\n\n## Usage\n\n1. `go get github.com/catppuccin/go`\n2. Add an`import catppuccin \"github.com/catppuccin/go\"` to your file\n3. Use the flavours as you wish.\n\n## 🙋 FAQ (optional)\n\n-\tQ: **_\"Where can I find the doc?\"_**\\\n\tA: https://pkg.go.dev/github.com/catppuccin/go\n\n## 💝 Thanks to\n\n- [Carlos Becker](https://github.com/caarlos0)\n\n&nbsp;\n\n<p align=\"center\">\n\t<img src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/footers/gray0_ctp_on_line.svg?sanitize=true\" />\n</p>\n\n<p align=\"center\">\n\tCopyright &copy; 2021-present <a href=\"https://github.com/catppuccin\" target=\"_blank\">Catppuccin Org</a>\n</p>\n\n<p align=\"center\">\n\t<a href=\"https://github.com/catppuccin/catppuccin/blob/main/LICENSE\"><img src=\"https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8\"/></a>\n</p>\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/frappe.go",
    "content": "package catppuccingo\n\n// frappe variant.\ntype frappe struct{}\n\n// Frappe flavour variant.\nvar Frappe Flavour = frappe{}\n\nfunc (frappe) Name() string { return \"frappe\" }\n\nfunc (frappe) Rosewater() Color {\n\treturn Color{\n\t\tHex: \"#f2d5cf\",\n\t\tRGB: [3]uint32{242, 213, 207},\n\t\tHSL: [3]float32{10, 0.57, 0.88},\n\t}\n}\n\nfunc (frappe) Flamingo() Color {\n\treturn Color{\n\t\tHex: \"#eebebe\",\n\t\tRGB: [3]uint32{238, 190, 190},\n\t\tHSL: [3]float32{0, 0.59, 0.84},\n\t}\n}\n\nfunc (frappe) Pink() Color {\n\treturn Color{\n\t\tHex: \"#f4b8e4\",\n\t\tRGB: [3]uint32{244, 184, 228},\n\t\tHSL: [3]float32{316, 0.73, 0.84},\n\t}\n}\n\nfunc (frappe) Mauve() Color {\n\treturn Color{\n\t\tHex: \"#ca9ee6\",\n\t\tRGB: [3]uint32{202, 158, 230},\n\t\tHSL: [3]float32{277, 0.59, 0.76},\n\t}\n}\n\nfunc (frappe) Red() Color {\n\treturn Color{\n\t\tHex: \"#e78284\",\n\t\tRGB: [3]uint32{231, 130, 132},\n\t\tHSL: [3]float32{359, 0.68, 0.71},\n\t}\n}\n\nfunc (frappe) Maroon() Color {\n\treturn Color{\n\t\tHex: \"#ea999c\",\n\t\tRGB: [3]uint32{234, 153, 156},\n\t\tHSL: [3]float32{358, 0.66, 0.76},\n\t}\n}\n\nfunc (frappe) Peach() Color {\n\treturn Color{\n\t\tHex: \"#ef9f76\",\n\t\tRGB: [3]uint32{239, 159, 118},\n\t\tHSL: [3]float32{20, 0.79, 0.70},\n\t}\n}\n\nfunc (frappe) Yellow() Color {\n\treturn Color{\n\t\tHex: \"#e5c890\",\n\t\tRGB: [3]uint32{229, 200, 144},\n\t\tHSL: [3]float32{40, 0.62, 0.73},\n\t}\n}\n\nfunc (frappe) Green() Color {\n\treturn Color{\n\t\tHex: \"#a6d189\",\n\t\tRGB: [3]uint32{166, 209, 137},\n\t\tHSL: [3]float32{96, 0.44, 0.68},\n\t}\n}\n\nfunc (frappe) Teal() Color {\n\treturn Color{\n\t\tHex: \"#81c8be\",\n\t\tRGB: [3]uint32{129, 200, 190},\n\t\tHSL: [3]float32{172, 0.39, 0.65},\n\t}\n}\n\nfunc (frappe) Sky() Color {\n\treturn Color{\n\t\tHex: \"#99d1db\",\n\t\tRGB: [3]uint32{153, 209, 219},\n\t\tHSL: [3]float32{189, 0.48, 0.73},\n\t}\n}\n\nfunc (frappe) Sapphire() Color {\n\treturn Color{\n\t\tHex: \"#85c1dc\",\n\t\tRGB: [3]uint32{133, 193, 220},\n\t\tHSL: [3]float32{199, 0.55, 0.69},\n\t}\n}\n\nfunc (frappe) Blue() Color {\n\treturn Color{\n\t\tHex: \"#8caaee\",\n\t\tRGB: [3]uint32{140, 170, 238},\n\t\tHSL: [3]float32{222, 0.74, 0.74},\n\t}\n}\n\nfunc (frappe) Lavender() Color {\n\treturn Color{\n\t\tHex: \"#babbf1\",\n\t\tRGB: [3]uint32{186, 187, 241},\n\t\tHSL: [3]float32{239, 0.66, 0.84},\n\t}\n}\n\nfunc (frappe) Text() Color {\n\treturn Color{\n\t\tHex: \"#c6d0f5\",\n\t\tRGB: [3]uint32{198, 208, 245},\n\t\tHSL: [3]float32{227, 0.70, 0.87},\n\t}\n}\n\nfunc (frappe) Subtext1() Color {\n\treturn Color{\n\t\tHex: \"#b5bfe2\",\n\t\tRGB: [3]uint32{181, 191, 226},\n\t\tHSL: [3]float32{227, 0.44, 0.80},\n\t}\n}\n\nfunc (frappe) Subtext0() Color {\n\treturn Color{\n\t\tHex: \"#a5adce\",\n\t\tRGB: [3]uint32{165, 173, 206},\n\t\tHSL: [3]float32{228, 0.29, 0.73},\n\t}\n}\n\nfunc (frappe) Overlay2() Color {\n\treturn Color{\n\t\tHex: \"#949cbb\",\n\t\tRGB: [3]uint32{148, 156, 187},\n\t\tHSL: [3]float32{228, 0.22, 0.66},\n\t}\n}\n\nfunc (frappe) Overlay1() Color {\n\treturn Color{\n\t\tHex: \"#838ba7\",\n\t\tRGB: [3]uint32{131, 139, 167},\n\t\tHSL: [3]float32{227, 0.17, 0.58},\n\t}\n}\n\nfunc (frappe) Overlay0() Color {\n\treturn Color{\n\t\tHex: \"#737994\",\n\t\tRGB: [3]uint32{115, 121, 148},\n\t\tHSL: [3]float32{229, 0.13, 0.52},\n\t}\n}\n\nfunc (frappe) Surface2() Color {\n\treturn Color{\n\t\tHex: \"#626880\",\n\t\tRGB: [3]uint32{98, 104, 128},\n\t\tHSL: [3]float32{228, 0.13, 0.44},\n\t}\n}\n\nfunc (frappe) Surface1() Color {\n\treturn Color{\n\t\tHex: \"#51576d\",\n\t\tRGB: [3]uint32{81, 87, 109},\n\t\tHSL: [3]float32{227, 0.15, 0.37},\n\t}\n}\n\nfunc (frappe) Surface0() Color {\n\treturn Color{\n\t\tHex: \"#414559\",\n\t\tRGB: [3]uint32{65, 69, 89},\n\t\tHSL: [3]float32{230, 0.16, 0.30},\n\t}\n}\n\nfunc (frappe) Base() Color {\n\treturn Color{\n\t\tHex: \"#303446\",\n\t\tRGB: [3]uint32{48, 52, 70},\n\t\tHSL: [3]float32{229, 0.19, 0.23},\n\t}\n}\n\nfunc (frappe) Mantle() Color {\n\treturn Color{\n\t\tHex: \"#292c3c\",\n\t\tRGB: [3]uint32{41, 44, 60},\n\t\tHSL: [3]float32{231, 0.19, 0.20},\n\t}\n}\n\nfunc (frappe) Crust() Color {\n\treturn Color{\n\t\tHex: \"#232634\",\n\t\tRGB: [3]uint32{35, 38, 52},\n\t\tHSL: [3]float32{229, 0.20, 0.17},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/latte.go",
    "content": "package catppuccingo\n\n// latte variant.\ntype latte struct{}\n\n// Latte flavour variant.\nvar Latte Flavour = latte{}\n\nfunc (latte) Name() string { return \"latte\" }\n\nfunc (latte) Rosewater() Color {\n\treturn Color{\n\t\tHex: \"#dc8a78\",\n\t\tRGB: [3]uint32{220, 138, 120},\n\t\tHSL: [3]float32{11, 0.59, 0.67},\n\t}\n}\n\nfunc (latte) Flamingo() Color {\n\treturn Color{\n\t\tHex: \"#dd7878\",\n\t\tRGB: [3]uint32{221, 120, 120},\n\t\tHSL: [3]float32{0, 0.60, 0.67},\n\t}\n}\n\nfunc (latte) Pink() Color {\n\treturn Color{\n\t\tHex: \"#ea76cb\",\n\t\tRGB: [3]uint32{234, 118, 203},\n\t\tHSL: [3]float32{316, 0.73, 0.69},\n\t}\n}\n\nfunc (latte) Mauve() Color {\n\treturn Color{\n\t\tHex: \"#8839ef\",\n\t\tRGB: [3]uint32{136, 57, 239},\n\t\tHSL: [3]float32{266, 0.85, 0.58},\n\t}\n}\n\nfunc (latte) Red() Color {\n\treturn Color{\n\t\tHex: \"#d20f39\",\n\t\tRGB: [3]uint32{210, 15, 57},\n\t\tHSL: [3]float32{347, 0.87, 0.44},\n\t}\n}\n\nfunc (latte) Maroon() Color {\n\treturn Color{\n\t\tHex: \"#e64553\",\n\t\tRGB: [3]uint32{230, 69, 83},\n\t\tHSL: [3]float32{355, 0.76, 0.59},\n\t}\n}\n\nfunc (latte) Peach() Color {\n\treturn Color{\n\t\tHex: \"#fe640b\",\n\t\tRGB: [3]uint32{254, 100, 11},\n\t\tHSL: [3]float32{22, 0.99, 0.52},\n\t}\n}\n\nfunc (latte) Yellow() Color {\n\treturn Color{\n\t\tHex: \"#df8e1d\",\n\t\tRGB: [3]uint32{223, 142, 29},\n\t\tHSL: [3]float32{35, 0.77, 0.49},\n\t}\n}\n\nfunc (latte) Green() Color {\n\treturn Color{\n\t\tHex: \"#40a02b\",\n\t\tRGB: [3]uint32{64, 160, 43},\n\t\tHSL: [3]float32{109, 0.58, 0.40},\n\t}\n}\n\nfunc (latte) Teal() Color {\n\treturn Color{\n\t\tHex: \"#179299\",\n\t\tRGB: [3]uint32{23, 146, 153},\n\t\tHSL: [3]float32{183, 0.74, 0.35},\n\t}\n}\n\nfunc (latte) Sky() Color {\n\treturn Color{\n\t\tHex: \"#04a5e5\",\n\t\tRGB: [3]uint32{4, 165, 229},\n\t\tHSL: [3]float32{197, 0.97, 0.46},\n\t}\n}\n\nfunc (latte) Sapphire() Color {\n\treturn Color{\n\t\tHex: \"#209fb5\",\n\t\tRGB: [3]uint32{32, 159, 181},\n\t\tHSL: [3]float32{189, 0.70, 0.42},\n\t}\n}\n\nfunc (latte) Blue() Color {\n\treturn Color{\n\t\tHex: \"#1e66f5\",\n\t\tRGB: [3]uint32{30, 102, 245},\n\t\tHSL: [3]float32{220, 0.91, 0.54},\n\t}\n}\n\nfunc (latte) Lavender() Color {\n\treturn Color{\n\t\tHex: \"#7287fd\",\n\t\tRGB: [3]uint32{114, 135, 253},\n\t\tHSL: [3]float32{231, 0.97, 0.72},\n\t}\n}\n\nfunc (latte) Text() Color {\n\treturn Color{\n\t\tHex: \"#4c4f69\",\n\t\tRGB: [3]uint32{76, 79, 105},\n\t\tHSL: [3]float32{234, 0.16, 0.35},\n\t}\n}\n\nfunc (latte) Subtext1() Color {\n\treturn Color{\n\t\tHex: \"#5c5f77\",\n\t\tRGB: [3]uint32{92, 95, 119},\n\t\tHSL: [3]float32{233, 0.13, 0.41},\n\t}\n}\n\nfunc (latte) Subtext0() Color {\n\treturn Color{\n\t\tHex: \"#6c6f85\",\n\t\tRGB: [3]uint32{108, 111, 133},\n\t\tHSL: [3]float32{233, 0.10, 0.47},\n\t}\n}\n\nfunc (latte) Overlay2() Color {\n\treturn Color{\n\t\tHex: \"#7c7f93\",\n\t\tRGB: [3]uint32{124, 127, 147},\n\t\tHSL: [3]float32{232, 0.10, 0.53},\n\t}\n}\n\nfunc (latte) Overlay1() Color {\n\treturn Color{\n\t\tHex: \"#8c8fa1\",\n\t\tRGB: [3]uint32{140, 143, 161},\n\t\tHSL: [3]float32{231, 0.10, 0.59},\n\t}\n}\n\nfunc (latte) Overlay0() Color {\n\treturn Color{\n\t\tHex: \"#9ca0b0\",\n\t\tRGB: [3]uint32{156, 160, 176},\n\t\tHSL: [3]float32{228, 0.11, 0.65},\n\t}\n}\n\nfunc (latte) Surface2() Color {\n\treturn Color{\n\t\tHex: \"#acb0be\",\n\t\tRGB: [3]uint32{172, 176, 190},\n\t\tHSL: [3]float32{227, 0.12, 0.71},\n\t}\n}\n\nfunc (latte) Surface1() Color {\n\treturn Color{\n\t\tHex: \"#bcc0cc\",\n\t\tRGB: [3]uint32{188, 192, 204},\n\t\tHSL: [3]float32{225, 0.14, 0.77},\n\t}\n}\n\nfunc (latte) Surface0() Color {\n\treturn Color{\n\t\tHex: \"#ccd0da\",\n\t\tRGB: [3]uint32{204, 208, 218},\n\t\tHSL: [3]float32{223, 0.16, 0.83},\n\t}\n}\n\nfunc (latte) Crust() Color {\n\treturn Color{\n\t\tHex: \"#dce0e8\",\n\t\tRGB: [3]uint32{220, 224, 232},\n\t\tHSL: [3]float32{220, 0.21, 0.89},\n\t}\n}\n\nfunc (latte) Mantle() Color {\n\treturn Color{\n\t\tHex: \"#e6e9ef\",\n\t\tRGB: [3]uint32{230, 233, 239},\n\t\tHSL: [3]float32{220, 0.22, 0.92},\n\t}\n}\n\nfunc (latte) Base() Color {\n\treturn Color{\n\t\tHex: \"#eff1f5\",\n\t\tRGB: [3]uint32{239, 241, 245},\n\t\tHSL: [3]float32{220, 0.23, 0.95},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/macchiato.go",
    "content": "package catppuccingo\n\n// macchiato variant.\ntype macchiato struct{}\n\n// Macchiato flavour variant.\nvar Macchiato Flavour = macchiato{}\n\nfunc (macchiato) Name() string { return \"macchiato\" }\n\nfunc (macchiato) Rosewater() Color {\n\treturn Color{\n\t\tHex: \"#f4dbd6\",\n\t\tRGB: [3]uint32{244, 219, 214},\n\t\tHSL: [3]float32{10, 0.58, 0.90},\n\t}\n}\n\nfunc (macchiato) Flamingo() Color {\n\treturn Color{\n\t\tHex: \"#f0c6c6\",\n\t\tRGB: [3]uint32{240, 198, 198},\n\t\tHSL: [3]float32{0, 0.58, 0.86},\n\t}\n}\n\nfunc (macchiato) Pink() Color {\n\treturn Color{\n\t\tHex: \"#f5bde6\",\n\t\tRGB: [3]uint32{245, 189, 230},\n\t\tHSL: [3]float32{316, 0.74, 0.85},\n\t}\n}\n\nfunc (macchiato) Mauve() Color {\n\treturn Color{\n\t\tHex: \"#c6a0f6\",\n\t\tRGB: [3]uint32{198, 160, 246},\n\t\tHSL: [3]float32{267, 0.83, 0.80},\n\t}\n}\n\nfunc (macchiato) Red() Color {\n\treturn Color{\n\t\tHex: \"#ed8796\",\n\t\tRGB: [3]uint32{237, 135, 150},\n\t\tHSL: [3]float32{351, 0.74, 0.73},\n\t}\n}\n\nfunc (macchiato) Maroon() Color {\n\treturn Color{\n\t\tHex: \"#ee99a0\",\n\t\tRGB: [3]uint32{238, 153, 160},\n\t\tHSL: [3]float32{355, 0.71, 0.77},\n\t}\n}\n\nfunc (macchiato) Peach() Color {\n\treturn Color{\n\t\tHex: \"#f5a97f\",\n\t\tRGB: [3]uint32{245, 169, 127},\n\t\tHSL: [3]float32{21, 0.86, 0.73},\n\t}\n}\n\nfunc (macchiato) Yellow() Color {\n\treturn Color{\n\t\tHex: \"#eed49f\",\n\t\tRGB: [3]uint32{238, 212, 159},\n\t\tHSL: [3]float32{40, 0.70, 0.78},\n\t}\n}\n\nfunc (macchiato) Green() Color {\n\treturn Color{\n\t\tHex: \"#a6da95\",\n\t\tRGB: [3]uint32{166, 218, 149},\n\t\tHSL: [3]float32{105, 0.48, 0.72},\n\t}\n}\n\nfunc (macchiato) Teal() Color {\n\treturn Color{\n\t\tHex: \"#8bd5ca\",\n\t\tRGB: [3]uint32{139, 213, 202},\n\t\tHSL: [3]float32{171, 0.47, 0.69},\n\t}\n}\n\nfunc (macchiato) Sky() Color {\n\treturn Color{\n\t\tHex: \"#91d7e3\",\n\t\tRGB: [3]uint32{145, 215, 227},\n\t\tHSL: [3]float32{189, 0.59, 0.73},\n\t}\n}\n\nfunc (macchiato) Sapphire() Color {\n\treturn Color{\n\t\tHex: \"#7dc4e4\",\n\t\tRGB: [3]uint32{125, 196, 228},\n\t\tHSL: [3]float32{199, 0.66, 0.69},\n\t}\n}\n\nfunc (macchiato) Blue() Color {\n\treturn Color{\n\t\tHex: \"#8aadf4\",\n\t\tRGB: [3]uint32{138, 173, 244},\n\t\tHSL: [3]float32{220, 0.83, 0.75},\n\t}\n}\n\nfunc (macchiato) Lavender() Color {\n\treturn Color{\n\t\tHex: \"#b7bdf8\",\n\t\tRGB: [3]uint32{183, 189, 248},\n\t\tHSL: [3]float32{234, 0.82, 0.85},\n\t}\n}\n\nfunc (macchiato) Text() Color {\n\treturn Color{\n\t\tHex: \"#cad3f5\",\n\t\tRGB: [3]uint32{202, 211, 245},\n\t\tHSL: [3]float32{227, 0.68, 0.88},\n\t}\n}\n\nfunc (macchiato) Subtext1() Color {\n\treturn Color{\n\t\tHex: \"#b8c0e0\",\n\t\tRGB: [3]uint32{184, 192, 224},\n\t\tHSL: [3]float32{228, 0.39, 0.80},\n\t}\n}\n\nfunc (macchiato) Subtext0() Color {\n\treturn Color{\n\t\tHex: \"#a5adcb\",\n\t\tRGB: [3]uint32{165, 173, 203},\n\t\tHSL: [3]float32{227, 0.27, 0.72},\n\t}\n}\n\nfunc (macchiato) Overlay2() Color {\n\treturn Color{\n\t\tHex: \"#939ab7\",\n\t\tRGB: [3]uint32{147, 154, 183},\n\t\tHSL: [3]float32{228, 0.20, 0.65},\n\t}\n}\n\nfunc (macchiato) Overlay1() Color {\n\treturn Color{\n\t\tHex: \"#8087a2\",\n\t\tRGB: [3]uint32{128, 135, 162},\n\t\tHSL: [3]float32{228, 0.15, 0.57},\n\t}\n}\n\nfunc (macchiato) Overlay0() Color {\n\treturn Color{\n\t\tHex: \"#6e738d\",\n\t\tRGB: [3]uint32{110, 115, 141},\n\t\tHSL: [3]float32{230, 0.12, 0.49},\n\t}\n}\n\nfunc (macchiato) Surface2() Color {\n\treturn Color{\n\t\tHex: \"#5b6078\",\n\t\tRGB: [3]uint32{91, 96, 120},\n\t\tHSL: [3]float32{230, 0.14, 0.41},\n\t}\n}\n\nfunc (macchiato) Surface1() Color {\n\treturn Color{\n\t\tHex: \"#494d64\",\n\t\tRGB: [3]uint32{73, 77, 100},\n\t\tHSL: [3]float32{231, 0.16, 0.34},\n\t}\n}\n\nfunc (macchiato) Surface0() Color {\n\treturn Color{\n\t\tHex: \"#363a4f\",\n\t\tRGB: [3]uint32{54, 58, 79},\n\t\tHSL: [3]float32{230, 0.19, 0.26},\n\t}\n}\n\nfunc (macchiato) Base() Color {\n\treturn Color{\n\t\tHex: \"#24273a\",\n\t\tRGB: [3]uint32{36, 39, 58},\n\t\tHSL: [3]float32{232, 0.23, 0.18},\n\t}\n}\n\nfunc (macchiato) Mantle() Color {\n\treturn Color{\n\t\tHex: \"#1e2030\",\n\t\tRGB: [3]uint32{30, 32, 48},\n\t\tHSL: [3]float32{233, 0.23, 0.15},\n\t}\n}\n\nfunc (macchiato) Crust() Color {\n\treturn Color{\n\t\tHex: \"#181926\",\n\t\tRGB: [3]uint32{24, 25, 38},\n\t\tHSL: [3]float32{236, 0.23, 0.12},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/main.go",
    "content": "package catppuccingo\n\nimport (\n\t\"image/color\"\n\t\"strings\"\n)\n\n// Flavour is an interface implemented by all Catppuccin variations.\ntype Flavour interface {\n\tRosewater() Color\n\tFlamingo() Color\n\tPink() Color\n\tMauve() Color\n\tRed() Color\n\tMaroon() Color\n\tPeach() Color\n\tYellow() Color\n\tGreen() Color\n\tTeal() Color\n\tSky() Color\n\tSapphire() Color\n\tBlue() Color\n\tLavender() Color\n\tText() Color\n\tSubtext1() Color\n\tSubtext0() Color\n\tOverlay2() Color\n\tOverlay1() Color\n\tOverlay0() Color\n\tSurface2() Color\n\tSurface1() Color\n\tSurface0() Color\n\tCrust() Color\n\tMantle() Color\n\tBase() Color\n\tName() string\n}\n\n// Theme is a type alias of Flavour to keep compatibility with previous versions.\ntype Theme = Flavour\n\n// Color is a color in Hex, RGB, and HSL.\ntype Color struct {\n\tHex string\n\tRGB [3]uint32\n\tHSL [3]float32\n}\n\n// RGBA implements color.Color\nfunc (c Color) RGBA() (r uint32, g uint32, b uint32, a uint32) {\n\treturn c.RGB[0], c.RGB[1], c.RGB[2], 1\n}\n\nvar _ color.Color = Color{}\n\n// Variant returns the Theme variant by name.\nfunc Variant(flavour string) Theme {\n\tfor _, t := range []Theme{\n\t\tMocha,\n\t\tFrappe,\n\t\tMacchiato,\n\t\tLatte,\n\t} {\n\t\tif strings.EqualFold(t.Name(), flavour) {\n\t\t\treturn t\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/catppuccin/go/mocha.go",
    "content": "package catppuccingo\n\ntype mocha struct{}\n\n// Mocha flavour variant.\nvar Mocha Flavour = mocha{}\n\nfunc (mocha) Name() string { return \"mocha\" }\n\nfunc (mocha) Rosewater() Color {\n\treturn Color{\n\t\tHex: \"#f5e0dc\",\n\t\tRGB: [3]uint32{245, 224, 220},\n\t\tHSL: [3]float32{10, 0.56, 0.91},\n\t}\n}\n\nfunc (mocha) Flamingo() Color {\n\treturn Color{\n\t\tHex: \"#f2cdcd\",\n\t\tRGB: [3]uint32{242, 205, 205},\n\t\tHSL: [3]float32{0, 0.59, 0.88},\n\t}\n}\n\nfunc (mocha) Pink() Color {\n\treturn Color{\n\t\tHex: \"#f5c2e7\",\n\t\tRGB: [3]uint32{245, 194, 231},\n\t\tHSL: [3]float32{316, 0.72, 0.86},\n\t}\n}\n\nfunc (mocha) Mauve() Color {\n\treturn Color{\n\t\tHex: \"#cba6f7\",\n\t\tRGB: [3]uint32{203, 166, 247},\n\t\tHSL: [3]float32{267, 0.84, 0.81},\n\t}\n}\n\nfunc (mocha) Red() Color {\n\treturn Color{\n\t\tHex: \"#f38ba8\",\n\t\tRGB: [3]uint32{243, 139, 168},\n\t\tHSL: [3]float32{343, 0.81, 0.75},\n\t}\n}\n\nfunc (mocha) Maroon() Color {\n\treturn Color{\n\t\tHex: \"#eba0ac\",\n\t\tRGB: [3]uint32{235, 160, 172},\n\t\tHSL: [3]float32{350, 0.65, 0.77},\n\t}\n}\n\nfunc (mocha) Peach() Color {\n\treturn Color{\n\t\tHex: \"#fab387\",\n\t\tRGB: [3]uint32{250, 179, 135},\n\t\tHSL: [3]float32{23, 0.92, 0.75},\n\t}\n}\n\nfunc (mocha) Yellow() Color {\n\treturn Color{\n\t\tHex: \"#f9e2af\",\n\t\tRGB: [3]uint32{249, 226, 175},\n\t\tHSL: [3]float32{41, 0.86, 0.83},\n\t}\n}\n\nfunc (mocha) Green() Color {\n\treturn Color{\n\t\tHex: \"#a6e3a1\",\n\t\tRGB: [3]uint32{166, 227, 161},\n\t\tHSL: [3]float32{115, 0.54, 0.76},\n\t}\n}\n\nfunc (mocha) Teal() Color {\n\treturn Color{\n\t\tHex: \"#94e2d5\",\n\t\tRGB: [3]uint32{148, 226, 213},\n\t\tHSL: [3]float32{170, 0.57, 0.73},\n\t}\n}\n\nfunc (mocha) Sky() Color {\n\treturn Color{\n\t\tHex: \"#89dceb\",\n\t\tRGB: [3]uint32{137, 220, 235},\n\t\tHSL: [3]float32{189, 0.71, 0.73},\n\t}\n}\n\nfunc (mocha) Sapphire() Color {\n\treturn Color{\n\t\tHex: \"#74c7ec\",\n\t\tRGB: [3]uint32{116, 199, 236},\n\t\tHSL: [3]float32{199, 0.76, 0.69},\n\t}\n}\n\nfunc (mocha) Blue() Color {\n\treturn Color{\n\t\tHex: \"#89b4fa\",\n\t\tRGB: [3]uint32{137, 180, 250},\n\t\tHSL: [3]float32{217, 0.92, 0.76},\n\t}\n}\n\nfunc (mocha) Lavender() Color {\n\treturn Color{\n\t\tHex: \"#b4befe\",\n\t\tRGB: [3]uint32{180, 190, 254},\n\t\tHSL: [3]float32{232, 0.97, 0.85},\n\t}\n}\n\nfunc (mocha) Text() Color {\n\treturn Color{\n\t\tHex: \"#cdd6f4\",\n\t\tRGB: [3]uint32{205, 214, 244},\n\t\tHSL: [3]float32{226, 0.64, 0.88},\n\t}\n}\n\nfunc (mocha) Subtext1() Color {\n\treturn Color{\n\t\tHex: \"#bac2de\",\n\t\tRGB: [3]uint32{186, 194, 222},\n\t\tHSL: [3]float32{227, 0.35, 0.80},\n\t}\n}\n\nfunc (mocha) Subtext0() Color {\n\treturn Color{\n\t\tHex: \"#a6adc8\",\n\t\tRGB: [3]uint32{166, 173, 200},\n\t\tHSL: [3]float32{228, 0.24, 0.72},\n\t}\n}\n\nfunc (mocha) Overlay2() Color {\n\treturn Color{\n\t\tHex: \"#9399b2\",\n\t\tRGB: [3]uint32{147, 153, 178},\n\t\tHSL: [3]float32{228, 0.17, 0.64},\n\t}\n}\n\nfunc (mocha) Overlay1() Color {\n\treturn Color{\n\t\tHex: \"#7f849c\",\n\t\tRGB: [3]uint32{127, 132, 156},\n\t\tHSL: [3]float32{230, 0.13, 0.55},\n\t}\n}\n\nfunc (mocha) Overlay0() Color {\n\treturn Color{\n\t\tHex: \"#6c7086\",\n\t\tRGB: [3]uint32{108, 112, 134},\n\t\tHSL: [3]float32{231, 0.11, 0.47},\n\t}\n}\n\nfunc (mocha) Surface2() Color {\n\treturn Color{\n\t\tHex: \"#585b70\",\n\t\tRGB: [3]uint32{88, 91, 112},\n\t\tHSL: [3]float32{233, 0.12, 0.39},\n\t}\n}\n\nfunc (mocha) Surface1() Color {\n\treturn Color{\n\t\tHex: \"#45475a\",\n\t\tRGB: [3]uint32{69, 71, 90},\n\t\tHSL: [3]float32{234, 0.13, 0.31},\n\t}\n}\n\nfunc (mocha) Surface0() Color {\n\treturn Color{\n\t\tHex: \"#313244\",\n\t\tRGB: [3]uint32{49, 50, 68},\n\t\tHSL: [3]float32{237, 0.16, 0.23},\n\t}\n}\n\nfunc (mocha) Base() Color {\n\treturn Color{\n\t\tHex: \"#1e1e2e\",\n\t\tRGB: [3]uint32{30, 30, 46},\n\t\tHSL: [3]float32{240, 0.21, 0.15},\n\t}\n}\n\nfunc (mocha) Mantle() Color {\n\treturn Color{\n\t\tHex: \"#181825\",\n\t\tRGB: [3]uint32{24, 24, 37},\n\t\tHSL: [3]float32{240, 0.21, 0.12},\n\t}\n}\n\nfunc (mocha) Crust() Color {\n\treturn Color{\n\t\tHex: \"#11111b\",\n\t\tRGB: [3]uint32{17, 17, 27},\n\t\tHSL: [3]float32{240, 0.23, 0.9},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n\n# IDEs\n.idea/\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Cenk Altı\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/README.md",
    "content": "# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Coverage Status][coveralls image]][coveralls]\n\nThis is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].\n\n[Exponential backoff][exponential backoff wiki]\nis an algorithm that uses feedback to multiplicatively decrease the rate of some process,\nin order to gradually find an acceptable rate.\nThe retries exponentially increase and stop increasing when a certain threshold is met.\n\n## Usage\n\nImport path is `github.com/cenkalti/backoff/v4`. Please note the version part at the end.\n\nUse https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation.\n\n## Contributing\n\n* I would like to keep this library as small as possible.\n* Please don't send a PR without opening an issue and discussing it first.\n* If proposed change is not a common use case, I will probably not accept it.\n\n[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4\n[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png\n[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master\n[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master\n\n[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java\n[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff\n\n[advanced example]: https://pkg.go.dev/github.com/cenkalti/backoff/v4?tab=doc#pkg-examples\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/backoff.go",
    "content": "// Package backoff implements backoff algorithms for retrying operations.\n//\n// Use Retry function for retrying operations that may fail.\n// If Retry does not meet your needs,\n// copy/paste the function into your project and modify as you wish.\n//\n// There is also Ticker type similar to time.Ticker.\n// You can use it if you need to work with channels.\n//\n// See Examples section below for usage examples.\npackage backoff\n\nimport \"time\"\n\n// BackOff is a backoff policy for retrying an operation.\ntype BackOff interface {\n\t// NextBackOff returns the duration to wait before retrying the operation,\n\t// or backoff. Stop to indicate that no more retries should be made.\n\t//\n\t// Example usage:\n\t//\n\t// \tduration := backoff.NextBackOff();\n\t// \tif (duration == backoff.Stop) {\n\t// \t\t// Do not retry operation.\n\t// \t} else {\n\t// \t\t// Sleep for duration and retry operation.\n\t// \t}\n\t//\n\tNextBackOff() time.Duration\n\n\t// Reset to initial state.\n\tReset()\n}\n\n// Stop indicates that no more retries should be made for use in NextBackOff().\nconst Stop time.Duration = -1\n\n// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,\n// meaning that the operation is retried immediately without waiting, indefinitely.\ntype ZeroBackOff struct{}\n\nfunc (b *ZeroBackOff) Reset() {}\n\nfunc (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }\n\n// StopBackOff is a fixed backoff policy that always returns backoff.Stop for\n// NextBackOff(), meaning that the operation should never be retried.\ntype StopBackOff struct{}\n\nfunc (b *StopBackOff) Reset() {}\n\nfunc (b *StopBackOff) NextBackOff() time.Duration { return Stop }\n\n// ConstantBackOff is a backoff policy that always returns the same backoff delay.\n// This is in contrast to an exponential backoff policy,\n// which returns a delay that grows longer as you call NextBackOff() over and over again.\ntype ConstantBackOff struct {\n\tInterval time.Duration\n}\n\nfunc (b *ConstantBackOff) Reset()                     {}\nfunc (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }\n\nfunc NewConstantBackOff(d time.Duration) *ConstantBackOff {\n\treturn &ConstantBackOff{Interval: d}\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/context.go",
    "content": "package backoff\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\n// BackOffContext is a backoff policy that stops retrying after the context\n// is canceled.\ntype BackOffContext interface { // nolint: golint\n\tBackOff\n\tContext() context.Context\n}\n\ntype backOffContext struct {\n\tBackOff\n\tctx context.Context\n}\n\n// WithContext returns a BackOffContext with context ctx\n//\n// ctx must not be nil\nfunc WithContext(b BackOff, ctx context.Context) BackOffContext { // nolint: golint\n\tif ctx == nil {\n\t\tpanic(\"nil context\")\n\t}\n\n\tif b, ok := b.(*backOffContext); ok {\n\t\treturn &backOffContext{\n\t\t\tBackOff: b.BackOff,\n\t\t\tctx:     ctx,\n\t\t}\n\t}\n\n\treturn &backOffContext{\n\t\tBackOff: b,\n\t\tctx:     ctx,\n\t}\n}\n\nfunc getContext(b BackOff) context.Context {\n\tif cb, ok := b.(BackOffContext); ok {\n\t\treturn cb.Context()\n\t}\n\tif tb, ok := b.(*backOffTries); ok {\n\t\treturn getContext(tb.delegate)\n\t}\n\treturn context.Background()\n}\n\nfunc (b *backOffContext) Context() context.Context {\n\treturn b.ctx\n}\n\nfunc (b *backOffContext) NextBackOff() time.Duration {\n\tselect {\n\tcase <-b.ctx.Done():\n\t\treturn Stop\n\tdefault:\n\t\treturn b.BackOff.NextBackOff()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/exponential.go",
    "content": "package backoff\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n)\n\n/*\nExponentialBackOff is a backoff implementation that increases the backoff\nperiod for each retry attempt using a randomization function that grows exponentially.\n\nNextBackOff() is calculated using the following formula:\n\n randomized interval =\n     RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])\n\nIn other words NextBackOff() will range between the randomization factor\npercentage below and above the retry interval.\n\nFor example, given the following parameters:\n\n RetryInterval = 2\n RandomizationFactor = 0.5\n Multiplier = 2\n\nthe actual backoff period used in the next retry attempt will range between 1 and 3 seconds,\nmultiplied by the exponential, that is, between 2 and 6 seconds.\n\nNote: MaxInterval caps the RetryInterval and not the randomized interval.\n\nIf the time elapsed since an ExponentialBackOff instance is created goes past the\nMaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.\n\nThe elapsed time can be reset by calling Reset().\n\nExample: Given the following default arguments, for 10 tries the sequence will be,\nand assuming we go over the MaxElapsedTime on the 10th try:\n\n Request #  RetryInterval (seconds)  Randomized Interval (seconds)\n\n  1          0.5                     [0.25,   0.75]\n  2          0.75                    [0.375,  1.125]\n  3          1.125                   [0.562,  1.687]\n  4          1.687                   [0.8435, 2.53]\n  5          2.53                    [1.265,  3.795]\n  6          3.795                   [1.897,  5.692]\n  7          5.692                   [2.846,  8.538]\n  8          8.538                   [4.269, 12.807]\n  9         12.807                   [6.403, 19.210]\n 10         19.210                   backoff.Stop\n\nNote: Implementation is not thread-safe.\n*/\ntype ExponentialBackOff struct {\n\tInitialInterval     time.Duration\n\tRandomizationFactor float64\n\tMultiplier          float64\n\tMaxInterval         time.Duration\n\t// After MaxElapsedTime the ExponentialBackOff returns Stop.\n\t// It never stops if MaxElapsedTime == 0.\n\tMaxElapsedTime time.Duration\n\tStop           time.Duration\n\tClock          Clock\n\n\tcurrentInterval time.Duration\n\tstartTime       time.Time\n}\n\n// Clock is an interface that returns current time for BackOff.\ntype Clock interface {\n\tNow() time.Time\n}\n\n// ExponentialBackOffOpts is a function type used to configure ExponentialBackOff options.\ntype ExponentialBackOffOpts func(*ExponentialBackOff)\n\n// Default values for ExponentialBackOff.\nconst (\n\tDefaultInitialInterval     = 500 * time.Millisecond\n\tDefaultRandomizationFactor = 0.5\n\tDefaultMultiplier          = 1.5\n\tDefaultMaxInterval         = 60 * time.Second\n\tDefaultMaxElapsedTime      = 15 * time.Minute\n)\n\n// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.\nfunc NewExponentialBackOff(opts ...ExponentialBackOffOpts) *ExponentialBackOff {\n\tb := &ExponentialBackOff{\n\t\tInitialInterval:     DefaultInitialInterval,\n\t\tRandomizationFactor: DefaultRandomizationFactor,\n\t\tMultiplier:          DefaultMultiplier,\n\t\tMaxInterval:         DefaultMaxInterval,\n\t\tMaxElapsedTime:      DefaultMaxElapsedTime,\n\t\tStop:                Stop,\n\t\tClock:               SystemClock,\n\t}\n\tfor _, fn := range opts {\n\t\tfn(b)\n\t}\n\tb.Reset()\n\treturn b\n}\n\n// WithInitialInterval sets the initial interval between retries.\nfunc WithInitialInterval(duration time.Duration) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.InitialInterval = duration\n\t}\n}\n\n// WithRandomizationFactor sets the randomization factor to add jitter to intervals.\nfunc WithRandomizationFactor(randomizationFactor float64) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.RandomizationFactor = randomizationFactor\n\t}\n}\n\n// WithMultiplier sets the multiplier for increasing the interval after each retry.\nfunc WithMultiplier(multiplier float64) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.Multiplier = multiplier\n\t}\n}\n\n// WithMaxInterval sets the maximum interval between retries.\nfunc WithMaxInterval(duration time.Duration) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.MaxInterval = duration\n\t}\n}\n\n// WithMaxElapsedTime sets the maximum total time for retries.\nfunc WithMaxElapsedTime(duration time.Duration) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.MaxElapsedTime = duration\n\t}\n}\n\n// WithRetryStopDuration sets the duration after which retries should stop.\nfunc WithRetryStopDuration(duration time.Duration) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.Stop = duration\n\t}\n}\n\n// WithClockProvider sets the clock used to measure time.\nfunc WithClockProvider(clock Clock) ExponentialBackOffOpts {\n\treturn func(ebo *ExponentialBackOff) {\n\t\tebo.Clock = clock\n\t}\n}\n\ntype systemClock struct{}\n\nfunc (t systemClock) Now() time.Time {\n\treturn time.Now()\n}\n\n// SystemClock implements Clock interface that uses time.Now().\nvar SystemClock = systemClock{}\n\n// Reset the interval back to the initial retry interval and restarts the timer.\n// Reset must be called before using b.\nfunc (b *ExponentialBackOff) Reset() {\n\tb.currentInterval = b.InitialInterval\n\tb.startTime = b.Clock.Now()\n}\n\n// NextBackOff calculates the next backoff interval using the formula:\n// \tRandomized interval = RetryInterval * (1 ± RandomizationFactor)\nfunc (b *ExponentialBackOff) NextBackOff() time.Duration {\n\t// Make sure we have not gone over the maximum elapsed time.\n\telapsed := b.GetElapsedTime()\n\tnext := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)\n\tb.incrementCurrentInterval()\n\tif b.MaxElapsedTime != 0 && elapsed+next > b.MaxElapsedTime {\n\t\treturn b.Stop\n\t}\n\treturn next\n}\n\n// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance\n// is created and is reset when Reset() is called.\n//\n// The elapsed time is computed using time.Now().UnixNano(). It is\n// safe to call even while the backoff policy is used by a running\n// ticker.\nfunc (b *ExponentialBackOff) GetElapsedTime() time.Duration {\n\treturn b.Clock.Now().Sub(b.startTime)\n}\n\n// Increments the current interval by multiplying it with the multiplier.\nfunc (b *ExponentialBackOff) incrementCurrentInterval() {\n\t// Check for overflow, if overflow is detected set the current interval to the max interval.\n\tif float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {\n\t\tb.currentInterval = b.MaxInterval\n\t} else {\n\t\tb.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)\n\t}\n}\n\n// Returns a random value from the following interval:\n// \t[currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].\nfunc getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {\n\tif randomizationFactor == 0 {\n\t\treturn currentInterval // make sure no randomness is used when randomizationFactor is 0.\n\t}\n\tvar delta = randomizationFactor * float64(currentInterval)\n\tvar minInterval = float64(currentInterval) - delta\n\tvar maxInterval = float64(currentInterval) + delta\n\n\t// Get a random value from the range [minInterval, maxInterval].\n\t// The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then\n\t// we want a 33% chance for selecting either 1, 2 or 3.\n\treturn time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/retry.go",
    "content": "package backoff\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\n// An OperationWithData is executing by RetryWithData() or RetryNotifyWithData().\n// The operation will be retried using a backoff policy if it returns an error.\ntype OperationWithData[T any] func() (T, error)\n\n// An Operation is executing by Retry() or RetryNotify().\n// The operation will be retried using a backoff policy if it returns an error.\ntype Operation func() error\n\nfunc (o Operation) withEmptyData() OperationWithData[struct{}] {\n\treturn func() (struct{}, error) {\n\t\treturn struct{}{}, o()\n\t}\n}\n\n// Notify is a notify-on-error function. It receives an operation error and\n// backoff delay if the operation failed (with an error).\n//\n// NOTE that if the backoff policy stated to stop retrying,\n// the notify function isn't called.\ntype Notify func(error, time.Duration)\n\n// Retry the operation o until it does not return error or BackOff stops.\n// o is guaranteed to be run at least once.\n//\n// If o returns a *PermanentError, the operation is not retried, and the\n// wrapped error is returned.\n//\n// Retry sleeps the goroutine for the duration returned by BackOff after a\n// failed operation returns.\nfunc Retry(o Operation, b BackOff) error {\n\treturn RetryNotify(o, b, nil)\n}\n\n// RetryWithData is like Retry but returns data in the response too.\nfunc RetryWithData[T any](o OperationWithData[T], b BackOff) (T, error) {\n\treturn RetryNotifyWithData(o, b, nil)\n}\n\n// RetryNotify calls notify function with the error and wait duration\n// for each failed attempt before sleep.\nfunc RetryNotify(operation Operation, b BackOff, notify Notify) error {\n\treturn RetryNotifyWithTimer(operation, b, notify, nil)\n}\n\n// RetryNotifyWithData is like RetryNotify but returns data in the response too.\nfunc RetryNotifyWithData[T any](operation OperationWithData[T], b BackOff, notify Notify) (T, error) {\n\treturn doRetryNotify(operation, b, notify, nil)\n}\n\n// RetryNotifyWithTimer calls notify function with the error and wait duration using the given Timer\n// for each failed attempt before sleep.\n// A default timer that uses system timer is used when nil is passed.\nfunc RetryNotifyWithTimer(operation Operation, b BackOff, notify Notify, t Timer) error {\n\t_, err := doRetryNotify(operation.withEmptyData(), b, notify, t)\n\treturn err\n}\n\n// RetryNotifyWithTimerAndData is like RetryNotifyWithTimer but returns data in the response too.\nfunc RetryNotifyWithTimerAndData[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {\n\treturn doRetryNotify(operation, b, notify, t)\n}\n\nfunc doRetryNotify[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {\n\tvar (\n\t\terr  error\n\t\tnext time.Duration\n\t\tres  T\n\t)\n\tif t == nil {\n\t\tt = &defaultTimer{}\n\t}\n\n\tdefer func() {\n\t\tt.Stop()\n\t}()\n\n\tctx := getContext(b)\n\n\tb.Reset()\n\tfor {\n\t\tres, err = operation()\n\t\tif err == nil {\n\t\t\treturn res, nil\n\t\t}\n\n\t\tvar permanent *PermanentError\n\t\tif errors.As(err, &permanent) {\n\t\t\treturn res, permanent.Err\n\t\t}\n\n\t\tif next = b.NextBackOff(); next == Stop {\n\t\t\tif cerr := ctx.Err(); cerr != nil {\n\t\t\t\treturn res, cerr\n\t\t\t}\n\n\t\t\treturn res, err\n\t\t}\n\n\t\tif notify != nil {\n\t\t\tnotify(err, next)\n\t\t}\n\n\t\tt.Start(next)\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn res, ctx.Err()\n\t\tcase <-t.C():\n\t\t}\n\t}\n}\n\n// PermanentError signals that the operation should not be retried.\ntype PermanentError struct {\n\tErr error\n}\n\nfunc (e *PermanentError) Error() string {\n\treturn e.Err.Error()\n}\n\nfunc (e *PermanentError) Unwrap() error {\n\treturn e.Err\n}\n\nfunc (e *PermanentError) Is(target error) bool {\n\t_, ok := target.(*PermanentError)\n\treturn ok\n}\n\n// Permanent wraps the given err in a *PermanentError.\nfunc Permanent(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\treturn &PermanentError{\n\t\tErr: err,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/ticker.go",
    "content": "package backoff\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.\n//\n// Ticks will continue to arrive when the previous operation is still running,\n// so operations that take a while to fail could run in quick succession.\ntype Ticker struct {\n\tC        <-chan time.Time\n\tc        chan time.Time\n\tb        BackOff\n\tctx      context.Context\n\ttimer    Timer\n\tstop     chan struct{}\n\tstopOnce sync.Once\n}\n\n// NewTicker returns a new Ticker containing a channel that will send\n// the time at times specified by the BackOff argument. Ticker is\n// guaranteed to tick at least once.  The channel is closed when Stop\n// method is called or BackOff stops. It is not safe to manipulate the\n// provided backoff policy (notably calling NextBackOff or Reset)\n// while the ticker is running.\nfunc NewTicker(b BackOff) *Ticker {\n\treturn NewTickerWithTimer(b, &defaultTimer{})\n}\n\n// NewTickerWithTimer returns a new Ticker with a custom timer.\n// A default timer that uses system timer is used when nil is passed.\nfunc NewTickerWithTimer(b BackOff, timer Timer) *Ticker {\n\tif timer == nil {\n\t\ttimer = &defaultTimer{}\n\t}\n\tc := make(chan time.Time)\n\tt := &Ticker{\n\t\tC:     c,\n\t\tc:     c,\n\t\tb:     b,\n\t\tctx:   getContext(b),\n\t\ttimer: timer,\n\t\tstop:  make(chan struct{}),\n\t}\n\tt.b.Reset()\n\tgo t.run()\n\treturn t\n}\n\n// Stop turns off a ticker. After Stop, no more ticks will be sent.\nfunc (t *Ticker) Stop() {\n\tt.stopOnce.Do(func() { close(t.stop) })\n}\n\nfunc (t *Ticker) run() {\n\tc := t.c\n\tdefer close(c)\n\n\t// Ticker is guaranteed to tick at least once.\n\tafterC := t.send(time.Now())\n\n\tfor {\n\t\tif afterC == nil {\n\t\t\treturn\n\t\t}\n\n\t\tselect {\n\t\tcase tick := <-afterC:\n\t\t\tafterC = t.send(tick)\n\t\tcase <-t.stop:\n\t\t\tt.c = nil // Prevent future ticks from being sent to the channel.\n\t\t\treturn\n\t\tcase <-t.ctx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (t *Ticker) send(tick time.Time) <-chan time.Time {\n\tselect {\n\tcase t.c <- tick:\n\tcase <-t.stop:\n\t\treturn nil\n\t}\n\n\tnext := t.b.NextBackOff()\n\tif next == Stop {\n\t\tt.Stop()\n\t\treturn nil\n\t}\n\n\tt.timer.Start(next)\n\treturn t.timer.C()\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/timer.go",
    "content": "package backoff\n\nimport \"time\"\n\ntype Timer interface {\n\tStart(duration time.Duration)\n\tStop()\n\tC() <-chan time.Time\n}\n\n// defaultTimer implements Timer interface using time.Timer\ntype defaultTimer struct {\n\ttimer *time.Timer\n}\n\n// C returns the timers channel which receives the current time when the timer fires.\nfunc (t *defaultTimer) C() <-chan time.Time {\n\treturn t.timer.C\n}\n\n// Start starts the timer to fire after the given duration\nfunc (t *defaultTimer) Start(duration time.Duration) {\n\tif t.timer == nil {\n\t\tt.timer = time.NewTimer(duration)\n\t} else {\n\t\tt.timer.Reset(duration)\n\t}\n}\n\n// Stop is called when the timer is not used anymore and resources may be freed.\nfunc (t *defaultTimer) Stop() {\n\tif t.timer != nil {\n\t\tt.timer.Stop()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cenkalti/backoff/v4/tries.go",
    "content": "package backoff\n\nimport \"time\"\n\n/*\nWithMaxRetries creates a wrapper around another BackOff, which will\nreturn Stop if NextBackOff() has been called too many times since\nthe last time Reset() was called\n\nNote: Implementation is not thread-safe.\n*/\nfunc WithMaxRetries(b BackOff, max uint64) BackOff {\n\treturn &backOffTries{delegate: b, maxTries: max}\n}\n\ntype backOffTries struct {\n\tdelegate BackOff\n\tmaxTries uint64\n\tnumTries uint64\n}\n\nfunc (b *backOffTries) NextBackOff() time.Duration {\n\tif b.maxTries == 0 {\n\t\treturn Stop\n\t}\n\tif b.maxTries > 0 {\n\t\tif b.maxTries <= b.numTries {\n\t\t\treturn Stop\n\t\t}\n\t\tb.numTries++\n\t}\n\treturn b.delegate.NextBackOff()\n}\n\nfunc (b *backOffTries) Reset() {\n\tb.numTries = 0\n\tb.delegate.Reset()\n}\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/LICENSE.txt",
    "content": "Copyright (c) 2016 Caleb Spare\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/README.md",
    "content": "# xxhash\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2)\n[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml)\n\nxxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a\nhigh-quality hashing algorithm that is much faster than anything in the Go\nstandard library.\n\nThis package provides a straightforward API:\n\n```\nfunc Sum64(b []byte) uint64\nfunc Sum64String(s string) uint64\ntype Digest struct{ ... }\n    func New() *Digest\n```\n\nThe `Digest` type implements hash.Hash64. Its key methods are:\n\n```\nfunc (*Digest) Write([]byte) (int, error)\nfunc (*Digest) WriteString(string) (int, error)\nfunc (*Digest) Sum64() uint64\n```\n\nThe package is written with optimized pure Go and also contains even faster\nassembly implementations for amd64 and arm64. If desired, the `purego` build tag\nopts into using the Go code even on those architectures.\n\n[xxHash]: http://cyan4973.github.io/xxHash/\n\n## Compatibility\n\nThis package is in a module and the latest code is in version 2 of the module.\nYou need a version of Go with at least \"minimal module compatibility\" to use\ngithub.com/cespare/xxhash/v2:\n\n* 1.9.7+ for Go 1.9\n* 1.10.3+ for Go 1.10\n* Go 1.11 or later\n\nI recommend using the latest release of Go.\n\n## Benchmarks\n\nHere are some quick benchmarks comparing the pure-Go and assembly\nimplementations of Sum64.\n\n| input size | purego    | asm       |\n| ---------- | --------- | --------- |\n| 4 B        |  1.3 GB/s |  1.2 GB/s |\n| 16 B       |  2.9 GB/s |  3.5 GB/s |\n| 100 B      |  6.9 GB/s |  8.1 GB/s |\n| 4 KB       | 11.7 GB/s | 16.7 GB/s |\n| 10 MB      | 12.0 GB/s | 17.3 GB/s |\n\nThese numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C\nCPU using the following commands under Go 1.19.2:\n\n```\nbenchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$')\nbenchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')\n```\n\n## Projects using this package\n\n- [InfluxDB](https://github.com/influxdata/influxdb)\n- [Prometheus](https://github.com/prometheus/prometheus)\n- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics)\n- [FreeCache](https://github.com/coocood/freecache)\n- [FastCache](https://github.com/VictoriaMetrics/fastcache)\n- [Ristretto](https://github.com/dgraph-io/ristretto)\n- [Badger](https://github.com/dgraph-io/badger)\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/testall.sh",
    "content": "#!/bin/bash\nset -eu -o pipefail\n\n# Small convenience script for running the tests with various combinations of\n# arch/tags. This assumes we're running on amd64 and have qemu available.\n\ngo test ./...\ngo test -tags purego ./...\nGOARCH=arm64 go test\nGOARCH=arm64 go test -tags purego\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash.go",
    "content": "// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described\n// at http://cyan4973.github.io/xxHash/.\npackage xxhash\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"math/bits\"\n)\n\nconst (\n\tprime1 uint64 = 11400714785074694791\n\tprime2 uint64 = 14029467366897019727\n\tprime3 uint64 = 1609587929392839161\n\tprime4 uint64 = 9650029242287828579\n\tprime5 uint64 = 2870177450012600261\n)\n\n// Store the primes in an array as well.\n//\n// The consts are used when possible in Go code to avoid MOVs but we need a\n// contiguous array for the assembly code.\nvar primes = [...]uint64{prime1, prime2, prime3, prime4, prime5}\n\n// Digest implements hash.Hash64.\n//\n// Note that a zero-valued Digest is not ready to receive writes.\n// Call Reset or create a Digest using New before calling other methods.\ntype Digest struct {\n\tv1    uint64\n\tv2    uint64\n\tv3    uint64\n\tv4    uint64\n\ttotal uint64\n\tmem   [32]byte\n\tn     int // how much of mem is used\n}\n\n// New creates a new Digest with a zero seed.\nfunc New() *Digest {\n\treturn NewWithSeed(0)\n}\n\n// NewWithSeed creates a new Digest with the given seed.\nfunc NewWithSeed(seed uint64) *Digest {\n\tvar d Digest\n\td.ResetWithSeed(seed)\n\treturn &d\n}\n\n// Reset clears the Digest's state so that it can be reused.\n// It uses a seed value of zero.\nfunc (d *Digest) Reset() {\n\td.ResetWithSeed(0)\n}\n\n// ResetWithSeed clears the Digest's state so that it can be reused.\n// It uses the given seed to initialize the state.\nfunc (d *Digest) ResetWithSeed(seed uint64) {\n\td.v1 = seed + prime1 + prime2\n\td.v2 = seed + prime2\n\td.v3 = seed\n\td.v4 = seed - prime1\n\td.total = 0\n\td.n = 0\n}\n\n// Size always returns 8 bytes.\nfunc (d *Digest) Size() int { return 8 }\n\n// BlockSize always returns 32 bytes.\nfunc (d *Digest) BlockSize() int { return 32 }\n\n// Write adds more data to d. It always returns len(b), nil.\nfunc (d *Digest) Write(b []byte) (n int, err error) {\n\tn = len(b)\n\td.total += uint64(n)\n\n\tmemleft := d.mem[d.n&(len(d.mem)-1):]\n\n\tif d.n+n < 32 {\n\t\t// This new data doesn't even fill the current block.\n\t\tcopy(memleft, b)\n\t\td.n += n\n\t\treturn\n\t}\n\n\tif d.n > 0 {\n\t\t// Finish off the partial block.\n\t\tc := copy(memleft, b)\n\t\td.v1 = round(d.v1, u64(d.mem[0:8]))\n\t\td.v2 = round(d.v2, u64(d.mem[8:16]))\n\t\td.v3 = round(d.v3, u64(d.mem[16:24]))\n\t\td.v4 = round(d.v4, u64(d.mem[24:32]))\n\t\tb = b[c:]\n\t\td.n = 0\n\t}\n\n\tif len(b) >= 32 {\n\t\t// One or more full blocks left.\n\t\tnw := writeBlocks(d, b)\n\t\tb = b[nw:]\n\t}\n\n\t// Store any remaining partial block.\n\tcopy(d.mem[:], b)\n\td.n = len(b)\n\n\treturn\n}\n\n// Sum appends the current hash to b and returns the resulting slice.\nfunc (d *Digest) Sum(b []byte) []byte {\n\ts := d.Sum64()\n\treturn append(\n\t\tb,\n\t\tbyte(s>>56),\n\t\tbyte(s>>48),\n\t\tbyte(s>>40),\n\t\tbyte(s>>32),\n\t\tbyte(s>>24),\n\t\tbyte(s>>16),\n\t\tbyte(s>>8),\n\t\tbyte(s),\n\t)\n}\n\n// Sum64 returns the current hash.\nfunc (d *Digest) Sum64() uint64 {\n\tvar h uint64\n\n\tif d.total >= 32 {\n\t\tv1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4\n\t\th = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)\n\t\th = mergeRound(h, v1)\n\t\th = mergeRound(h, v2)\n\t\th = mergeRound(h, v3)\n\t\th = mergeRound(h, v4)\n\t} else {\n\t\th = d.v3 + prime5\n\t}\n\n\th += d.total\n\n\tb := d.mem[:d.n&(len(d.mem)-1)]\n\tfor ; len(b) >= 8; b = b[8:] {\n\t\tk1 := round(0, u64(b[:8]))\n\t\th ^= k1\n\t\th = rol27(h)*prime1 + prime4\n\t}\n\tif len(b) >= 4 {\n\t\th ^= uint64(u32(b[:4])) * prime1\n\t\th = rol23(h)*prime2 + prime3\n\t\tb = b[4:]\n\t}\n\tfor ; len(b) > 0; b = b[1:] {\n\t\th ^= uint64(b[0]) * prime5\n\t\th = rol11(h) * prime1\n\t}\n\n\th ^= h >> 33\n\th *= prime2\n\th ^= h >> 29\n\th *= prime3\n\th ^= h >> 32\n\n\treturn h\n}\n\nconst (\n\tmagic         = \"xxh\\x06\"\n\tmarshaledSize = len(magic) + 8*5 + 32\n)\n\n// MarshalBinary implements the encoding.BinaryMarshaler interface.\nfunc (d *Digest) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 0, marshaledSize)\n\tb = append(b, magic...)\n\tb = appendUint64(b, d.v1)\n\tb = appendUint64(b, d.v2)\n\tb = appendUint64(b, d.v3)\n\tb = appendUint64(b, d.v4)\n\tb = appendUint64(b, d.total)\n\tb = append(b, d.mem[:d.n]...)\n\tb = b[:len(b)+len(d.mem)-d.n]\n\treturn b, nil\n}\n\n// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.\nfunc (d *Digest) UnmarshalBinary(b []byte) error {\n\tif len(b) < len(magic) || string(b[:len(magic)]) != magic {\n\t\treturn errors.New(\"xxhash: invalid hash state identifier\")\n\t}\n\tif len(b) != marshaledSize {\n\t\treturn errors.New(\"xxhash: invalid hash state size\")\n\t}\n\tb = b[len(magic):]\n\tb, d.v1 = consumeUint64(b)\n\tb, d.v2 = consumeUint64(b)\n\tb, d.v3 = consumeUint64(b)\n\tb, d.v4 = consumeUint64(b)\n\tb, d.total = consumeUint64(b)\n\tcopy(d.mem[:], b)\n\td.n = int(d.total % uint64(len(d.mem)))\n\treturn nil\n}\n\nfunc appendUint64(b []byte, x uint64) []byte {\n\tvar a [8]byte\n\tbinary.LittleEndian.PutUint64(a[:], x)\n\treturn append(b, a[:]...)\n}\n\nfunc consumeUint64(b []byte) ([]byte, uint64) {\n\tx := u64(b)\n\treturn b[8:], x\n}\n\nfunc u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }\nfunc u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }\n\nfunc round(acc, input uint64) uint64 {\n\tacc += input * prime2\n\tacc = rol31(acc)\n\tacc *= prime1\n\treturn acc\n}\n\nfunc mergeRound(acc, val uint64) uint64 {\n\tval = round(0, val)\n\tacc ^= val\n\tacc = acc*prime1 + prime4\n\treturn acc\n}\n\nfunc rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }\nfunc rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }\nfunc rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }\nfunc rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }\nfunc rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }\nfunc rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }\nfunc rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }\nfunc rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s",
    "content": "//go:build !appengine && gc && !purego\n// +build !appengine\n// +build gc\n// +build !purego\n\n#include \"textflag.h\"\n\n// Registers:\n#define h      AX\n#define d      AX\n#define p      SI // pointer to advance through b\n#define n      DX\n#define end    BX // loop end\n#define v1     R8\n#define v2     R9\n#define v3     R10\n#define v4     R11\n#define x      R12\n#define prime1 R13\n#define prime2 R14\n#define prime4 DI\n\n#define round(acc, x) \\\n\tIMULQ prime2, x   \\\n\tADDQ  x, acc      \\\n\tROLQ  $31, acc    \\\n\tIMULQ prime1, acc\n\n// round0 performs the operation x = round(0, x).\n#define round0(x) \\\n\tIMULQ prime2, x \\\n\tROLQ  $31, x    \\\n\tIMULQ prime1, x\n\n// mergeRound applies a merge round on the two registers acc and x.\n// It assumes that prime1, prime2, and prime4 have been loaded.\n#define mergeRound(acc, x) \\\n\tround0(x)         \\\n\tXORQ  x, acc      \\\n\tIMULQ prime1, acc \\\n\tADDQ  prime4, acc\n\n// blockLoop processes as many 32-byte blocks as possible,\n// updating v1, v2, v3, and v4. It assumes that there is at least one block\n// to process.\n#define blockLoop() \\\nloop:  \\\n\tMOVQ +0(p), x  \\\n\tround(v1, x)   \\\n\tMOVQ +8(p), x  \\\n\tround(v2, x)   \\\n\tMOVQ +16(p), x \\\n\tround(v3, x)   \\\n\tMOVQ +24(p), x \\\n\tround(v4, x)   \\\n\tADDQ $32, p    \\\n\tCMPQ p, end    \\\n\tJLE  loop\n\n// func Sum64(b []byte) uint64\nTEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32\n\t// Load fixed primes.\n\tMOVQ ·primes+0(SB), prime1\n\tMOVQ ·primes+8(SB), prime2\n\tMOVQ ·primes+24(SB), prime4\n\n\t// Load slice.\n\tMOVQ b_base+0(FP), p\n\tMOVQ b_len+8(FP), n\n\tLEAQ (p)(n*1), end\n\n\t// The first loop limit will be len(b)-32.\n\tSUBQ $32, end\n\n\t// Check whether we have at least one block.\n\tCMPQ n, $32\n\tJLT  noBlocks\n\n\t// Set up initial state (v1, v2, v3, v4).\n\tMOVQ prime1, v1\n\tADDQ prime2, v1\n\tMOVQ prime2, v2\n\tXORQ v3, v3\n\tXORQ v4, v4\n\tSUBQ prime1, v4\n\n\tblockLoop()\n\n\tMOVQ v1, h\n\tROLQ $1, h\n\tMOVQ v2, x\n\tROLQ $7, x\n\tADDQ x, h\n\tMOVQ v3, x\n\tROLQ $12, x\n\tADDQ x, h\n\tMOVQ v4, x\n\tROLQ $18, x\n\tADDQ x, h\n\n\tmergeRound(h, v1)\n\tmergeRound(h, v2)\n\tmergeRound(h, v3)\n\tmergeRound(h, v4)\n\n\tJMP afterBlocks\n\nnoBlocks:\n\tMOVQ ·primes+32(SB), h\n\nafterBlocks:\n\tADDQ n, h\n\n\tADDQ $24, end\n\tCMPQ p, end\n\tJG   try4\n\nloop8:\n\tMOVQ  (p), x\n\tADDQ  $8, p\n\tround0(x)\n\tXORQ  x, h\n\tROLQ  $27, h\n\tIMULQ prime1, h\n\tADDQ  prime4, h\n\n\tCMPQ p, end\n\tJLE  loop8\n\ntry4:\n\tADDQ $4, end\n\tCMPQ p, end\n\tJG   try1\n\n\tMOVL  (p), x\n\tADDQ  $4, p\n\tIMULQ prime1, x\n\tXORQ  x, h\n\n\tROLQ  $23, h\n\tIMULQ prime2, h\n\tADDQ  ·primes+16(SB), h\n\ntry1:\n\tADDQ $4, end\n\tCMPQ p, end\n\tJGE  finalize\n\nloop1:\n\tMOVBQZX (p), x\n\tADDQ    $1, p\n\tIMULQ   ·primes+32(SB), x\n\tXORQ    x, h\n\tROLQ    $11, h\n\tIMULQ   prime1, h\n\n\tCMPQ p, end\n\tJL   loop1\n\nfinalize:\n\tMOVQ  h, x\n\tSHRQ  $33, x\n\tXORQ  x, h\n\tIMULQ prime2, h\n\tMOVQ  h, x\n\tSHRQ  $29, x\n\tXORQ  x, h\n\tIMULQ ·primes+16(SB), h\n\tMOVQ  h, x\n\tSHRQ  $32, x\n\tXORQ  x, h\n\n\tMOVQ h, ret+24(FP)\n\tRET\n\n// func writeBlocks(d *Digest, b []byte) int\nTEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40\n\t// Load fixed primes needed for round.\n\tMOVQ ·primes+0(SB), prime1\n\tMOVQ ·primes+8(SB), prime2\n\n\t// Load slice.\n\tMOVQ b_base+8(FP), p\n\tMOVQ b_len+16(FP), n\n\tLEAQ (p)(n*1), end\n\tSUBQ $32, end\n\n\t// Load vN from d.\n\tMOVQ s+0(FP), d\n\tMOVQ 0(d), v1\n\tMOVQ 8(d), v2\n\tMOVQ 16(d), v3\n\tMOVQ 24(d), v4\n\n\t// We don't need to check the loop condition here; this function is\n\t// always called with at least one block of data to process.\n\tblockLoop()\n\n\t// Copy vN back to d.\n\tMOVQ v1, 0(d)\n\tMOVQ v2, 8(d)\n\tMOVQ v3, 16(d)\n\tMOVQ v4, 24(d)\n\n\t// The number of bytes written is p minus the old base pointer.\n\tSUBQ b_base+8(FP), p\n\tMOVQ p, ret+32(FP)\n\n\tRET\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_arm64.s",
    "content": "//go:build !appengine && gc && !purego\n// +build !appengine\n// +build gc\n// +build !purego\n\n#include \"textflag.h\"\n\n// Registers:\n#define digest\tR1\n#define h\tR2 // return value\n#define p\tR3 // input pointer\n#define n\tR4 // input length\n#define nblocks\tR5 // n / 32\n#define prime1\tR7\n#define prime2\tR8\n#define prime3\tR9\n#define prime4\tR10\n#define prime5\tR11\n#define v1\tR12\n#define v2\tR13\n#define v3\tR14\n#define v4\tR15\n#define x1\tR20\n#define x2\tR21\n#define x3\tR22\n#define x4\tR23\n\n#define round(acc, x) \\\n\tMADD prime2, acc, x, acc \\\n\tROR  $64-31, acc         \\\n\tMUL  prime1, acc\n\n// round0 performs the operation x = round(0, x).\n#define round0(x) \\\n\tMUL prime2, x \\\n\tROR $64-31, x \\\n\tMUL prime1, x\n\n#define mergeRound(acc, x) \\\n\tround0(x)                     \\\n\tEOR  x, acc                   \\\n\tMADD acc, prime4, prime1, acc\n\n// blockLoop processes as many 32-byte blocks as possible,\n// updating v1, v2, v3, and v4. It assumes that n >= 32.\n#define blockLoop() \\\n\tLSR     $5, n, nblocks  \\\n\tPCALIGN $16             \\\n\tloop:                   \\\n\tLDP.P   16(p), (x1, x2) \\\n\tLDP.P   16(p), (x3, x4) \\\n\tround(v1, x1)           \\\n\tround(v2, x2)           \\\n\tround(v3, x3)           \\\n\tround(v4, x4)           \\\n\tSUB     $1, nblocks     \\\n\tCBNZ    nblocks, loop\n\n// func Sum64(b []byte) uint64\nTEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32\n\tLDP b_base+0(FP), (p, n)\n\n\tLDP  ·primes+0(SB), (prime1, prime2)\n\tLDP  ·primes+16(SB), (prime3, prime4)\n\tMOVD ·primes+32(SB), prime5\n\n\tCMP  $32, n\n\tCSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 }\n\tBLT  afterLoop\n\n\tADD  prime1, prime2, v1\n\tMOVD prime2, v2\n\tMOVD $0, v3\n\tNEG  prime1, v4\n\n\tblockLoop()\n\n\tROR $64-1, v1, x1\n\tROR $64-7, v2, x2\n\tADD x1, x2\n\tROR $64-12, v3, x3\n\tROR $64-18, v4, x4\n\tADD x3, x4\n\tADD x2, x4, h\n\n\tmergeRound(h, v1)\n\tmergeRound(h, v2)\n\tmergeRound(h, v3)\n\tmergeRound(h, v4)\n\nafterLoop:\n\tADD n, h\n\n\tTBZ   $4, n, try8\n\tLDP.P 16(p), (x1, x2)\n\n\tround0(x1)\n\n\t// NOTE: here and below, sequencing the EOR after the ROR (using a\n\t// rotated register) is worth a small but measurable speedup for small\n\t// inputs.\n\tROR  $64-27, h\n\tEOR  x1 @> 64-27, h, h\n\tMADD h, prime4, prime1, h\n\n\tround0(x2)\n\tROR  $64-27, h\n\tEOR  x2 @> 64-27, h, h\n\tMADD h, prime4, prime1, h\n\ntry8:\n\tTBZ    $3, n, try4\n\tMOVD.P 8(p), x1\n\n\tround0(x1)\n\tROR  $64-27, h\n\tEOR  x1 @> 64-27, h, h\n\tMADD h, prime4, prime1, h\n\ntry4:\n\tTBZ     $2, n, try2\n\tMOVWU.P 4(p), x2\n\n\tMUL  prime1, x2\n\tROR  $64-23, h\n\tEOR  x2 @> 64-23, h, h\n\tMADD h, prime3, prime2, h\n\ntry2:\n\tTBZ     $1, n, try1\n\tMOVHU.P 2(p), x3\n\tAND     $255, x3, x1\n\tLSR     $8, x3, x2\n\n\tMUL prime5, x1\n\tROR $64-11, h\n\tEOR x1 @> 64-11, h, h\n\tMUL prime1, h\n\n\tMUL prime5, x2\n\tROR $64-11, h\n\tEOR x2 @> 64-11, h, h\n\tMUL prime1, h\n\ntry1:\n\tTBZ   $0, n, finalize\n\tMOVBU (p), x4\n\n\tMUL prime5, x4\n\tROR $64-11, h\n\tEOR x4 @> 64-11, h, h\n\tMUL prime1, h\n\nfinalize:\n\tEOR h >> 33, h\n\tMUL prime2, h\n\tEOR h >> 29, h\n\tMUL prime3, h\n\tEOR h >> 32, h\n\n\tMOVD h, ret+24(FP)\n\tRET\n\n// func writeBlocks(d *Digest, b []byte) int\nTEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40\n\tLDP ·primes+0(SB), (prime1, prime2)\n\n\t// Load state. Assume v[1-4] are stored contiguously.\n\tMOVD d+0(FP), digest\n\tLDP  0(digest), (v1, v2)\n\tLDP  16(digest), (v3, v4)\n\n\tLDP b_base+8(FP), (p, n)\n\n\tblockLoop()\n\n\t// Store updated state.\n\tSTP (v1, v2), 0(digest)\n\tSTP (v3, v4), 16(digest)\n\n\tBIC  $31, n\n\tMOVD n, ret+32(FP)\n\tRET\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_asm.go",
    "content": "//go:build (amd64 || arm64) && !appengine && gc && !purego\n// +build amd64 arm64\n// +build !appengine\n// +build gc\n// +build !purego\n\npackage xxhash\n\n// Sum64 computes the 64-bit xxHash digest of b with a zero seed.\n//\n//go:noescape\nfunc Sum64(b []byte) uint64\n\n//go:noescape\nfunc writeBlocks(d *Digest, b []byte) int\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_other.go",
    "content": "//go:build (!amd64 && !arm64) || appengine || !gc || purego\n// +build !amd64,!arm64 appengine !gc purego\n\npackage xxhash\n\n// Sum64 computes the 64-bit xxHash digest of b with a zero seed.\nfunc Sum64(b []byte) uint64 {\n\t// A simpler version would be\n\t//   d := New()\n\t//   d.Write(b)\n\t//   return d.Sum64()\n\t// but this is faster, particularly for small inputs.\n\n\tn := len(b)\n\tvar h uint64\n\n\tif n >= 32 {\n\t\tv1 := primes[0] + prime2\n\t\tv2 := prime2\n\t\tv3 := uint64(0)\n\t\tv4 := -primes[0]\n\t\tfor len(b) >= 32 {\n\t\t\tv1 = round(v1, u64(b[0:8:len(b)]))\n\t\t\tv2 = round(v2, u64(b[8:16:len(b)]))\n\t\t\tv3 = round(v3, u64(b[16:24:len(b)]))\n\t\t\tv4 = round(v4, u64(b[24:32:len(b)]))\n\t\t\tb = b[32:len(b):len(b)]\n\t\t}\n\t\th = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)\n\t\th = mergeRound(h, v1)\n\t\th = mergeRound(h, v2)\n\t\th = mergeRound(h, v3)\n\t\th = mergeRound(h, v4)\n\t} else {\n\t\th = prime5\n\t}\n\n\th += uint64(n)\n\n\tfor ; len(b) >= 8; b = b[8:] {\n\t\tk1 := round(0, u64(b[:8]))\n\t\th ^= k1\n\t\th = rol27(h)*prime1 + prime4\n\t}\n\tif len(b) >= 4 {\n\t\th ^= uint64(u32(b[:4])) * prime1\n\t\th = rol23(h)*prime2 + prime3\n\t\tb = b[4:]\n\t}\n\tfor ; len(b) > 0; b = b[1:] {\n\t\th ^= uint64(b[0]) * prime5\n\t\th = rol11(h) * prime1\n\t}\n\n\th ^= h >> 33\n\th *= prime2\n\th ^= h >> 29\n\th *= prime3\n\th ^= h >> 32\n\n\treturn h\n}\n\nfunc writeBlocks(d *Digest, b []byte) int {\n\tv1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4\n\tn := len(b)\n\tfor len(b) >= 32 {\n\t\tv1 = round(v1, u64(b[0:8:len(b)]))\n\t\tv2 = round(v2, u64(b[8:16:len(b)]))\n\t\tv3 = round(v3, u64(b[16:24:len(b)]))\n\t\tv4 = round(v4, u64(b[24:32:len(b)]))\n\t\tb = b[32:len(b):len(b)]\n\t}\n\td.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4\n\treturn n - len(b)\n}\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_safe.go",
    "content": "//go:build appengine\n// +build appengine\n\n// This file contains the safe implementations of otherwise unsafe-using code.\n\npackage xxhash\n\n// Sum64String computes the 64-bit xxHash digest of s with a zero seed.\nfunc Sum64String(s string) uint64 {\n\treturn Sum64([]byte(s))\n}\n\n// WriteString adds more data to d. It always returns len(s), nil.\nfunc (d *Digest) WriteString(s string) (n int, err error) {\n\treturn d.Write([]byte(s))\n}\n"
  },
  {
    "path": "vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go",
    "content": "//go:build !appengine\n// +build !appengine\n\n// This file encapsulates usage of unsafe.\n// xxhash_safe.go contains the safe implementations.\n\npackage xxhash\n\nimport (\n\t\"unsafe\"\n)\n\n// In the future it's possible that compiler optimizations will make these\n// XxxString functions unnecessary by realizing that calls such as\n// Sum64([]byte(s)) don't need to copy s. See https://go.dev/issue/2205.\n// If that happens, even if we keep these functions they can be replaced with\n// the trivial safe code.\n\n// NOTE: The usual way of doing an unsafe string-to-[]byte conversion is:\n//\n//   var b []byte\n//   bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n//   bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data\n//   bh.Len = len(s)\n//   bh.Cap = len(s)\n//\n// Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough\n// weight to this sequence of expressions that any function that uses it will\n// not be inlined. Instead, the functions below use a different unsafe\n// conversion designed to minimize the inliner weight and allow both to be\n// inlined. There is also a test (TestInlining) which verifies that these are\n// inlined.\n//\n// See https://github.com/golang/go/issues/42739 for discussion.\n\n// Sum64String computes the 64-bit xxHash digest of s with a zero seed.\n// It may be faster than Sum64([]byte(s)) by avoiding a copy.\nfunc Sum64String(s string) uint64 {\n\tb := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))\n\treturn Sum64(b)\n}\n\n// WriteString adds more data to d. It always returns len(s), nil.\n// It may be faster than Write([]byte(s)) by avoiding a copy.\nfunc (d *Digest) WriteString(s string) (n int, err error) {\n\td.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})))\n\t// d.Write always returns len(s), nil.\n\t// Ignoring the return output and returning these fixed values buys a\n\t// savings of 6 in the inliner's cost model.\n\treturn len(s), nil\n}\n\n// sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout\n// of the first two words is the same as the layout of a string.\ntype sliceHeader struct {\n\ts   string\n\tcap int\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020-2023 Charmbracelet, Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/cursor/cursor.go",
    "content": "package cursor\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\nconst defaultBlinkSpeed = time.Millisecond * 530\n\n// initialBlinkMsg initializes cursor blinking.\ntype initialBlinkMsg struct{}\n\n// BlinkMsg signals that the cursor should blink. It contains metadata that\n// allows us to tell if the blink message is the one we're expecting.\ntype BlinkMsg struct {\n\tid  int\n\ttag int\n}\n\n// blinkCanceled is sent when a blink operation is canceled.\ntype blinkCanceled struct{}\n\n// blinkCtx manages cursor blinking.\ntype blinkCtx struct {\n\tctx    context.Context\n\tcancel context.CancelFunc\n}\n\n// Mode describes the behavior of the cursor.\ntype Mode int\n\n// Available cursor modes.\nconst (\n\tCursorBlink Mode = iota\n\tCursorStatic\n\tCursorHide\n)\n\n// String returns the cursor mode in a human-readable format. This method is\n// provisional and for informational purposes only.\nfunc (c Mode) String() string {\n\treturn [...]string{\n\t\t\"blink\",\n\t\t\"static\",\n\t\t\"hidden\",\n\t}[c]\n}\n\n// Model is the Bubble Tea model for this cursor element.\ntype Model struct {\n\tBlinkSpeed time.Duration\n\t// Style for styling the cursor block.\n\tStyle lipgloss.Style\n\t// TextStyle is the style used for the cursor when it is hidden (when blinking).\n\t// I.e. displaying normal text.\n\tTextStyle lipgloss.Style\n\n\t// char is the character under the cursor\n\tchar string\n\t// The ID of this Model as it relates to other cursors\n\tid int\n\t// focus indicates whether the containing input is focused\n\tfocus bool\n\t// Cursor Blink state.\n\tBlink bool\n\t// Used to manage cursor blink\n\tblinkCtx *blinkCtx\n\t// The ID of the blink message we're expecting to receive.\n\tblinkTag int\n\t// mode determines the behavior of the cursor\n\tmode Mode\n}\n\n// New creates a new model with default settings.\nfunc New() Model {\n\treturn Model{\n\t\tBlinkSpeed: defaultBlinkSpeed,\n\n\t\tBlink: true,\n\t\tmode:  CursorBlink,\n\n\t\tblinkCtx: &blinkCtx{\n\t\t\tctx: context.Background(),\n\t\t},\n\t}\n}\n\n// Update updates the cursor.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tswitch msg := msg.(type) {\n\tcase initialBlinkMsg:\n\t\t// We accept all initialBlinkMsgs generated by the Blink command.\n\n\t\tif m.mode != CursorBlink || !m.focus {\n\t\t\treturn m, nil\n\t\t}\n\n\t\tcmd := m.BlinkCmd()\n\t\treturn m, cmd\n\n\tcase tea.FocusMsg:\n\t\treturn m, m.Focus()\n\n\tcase tea.BlurMsg:\n\t\tm.Blur()\n\t\treturn m, nil\n\n\tcase BlinkMsg:\n\t\t// We're choosy about whether to accept blinkMsgs so that our cursor\n\t\t// only exactly when it should.\n\n\t\t// Is this model blink-able?\n\t\tif m.mode != CursorBlink || !m.focus {\n\t\t\treturn m, nil\n\t\t}\n\n\t\t// Were we expecting this blink message?\n\t\tif msg.id != m.id || msg.tag != m.blinkTag {\n\t\t\treturn m, nil\n\t\t}\n\n\t\tvar cmd tea.Cmd\n\t\tif m.mode == CursorBlink {\n\t\t\tm.Blink = !m.Blink\n\t\t\tcmd = m.BlinkCmd()\n\t\t}\n\t\treturn m, cmd\n\n\tcase blinkCanceled: // no-op\n\t\treturn m, nil\n\t}\n\treturn m, nil\n}\n\n// Mode returns the model's cursor mode. For available cursor modes, see\n// type Mode.\nfunc (m Model) Mode() Mode {\n\treturn m.mode\n}\n\n// SetMode sets the model's cursor mode. This method returns a command.\n//\n// For available cursor modes, see type CursorMode.\nfunc (m *Model) SetMode(mode Mode) tea.Cmd {\n\t// Adjust the mode value if it's value is out of range\n\tif mode < CursorBlink || mode > CursorHide {\n\t\treturn nil\n\t}\n\tm.mode = mode\n\tm.Blink = m.mode == CursorHide || !m.focus\n\tif mode == CursorBlink {\n\t\treturn Blink\n\t}\n\treturn nil\n}\n\n// BlinkCmd is a command used to manage cursor blinking.\nfunc (m *Model) BlinkCmd() tea.Cmd {\n\tif m.mode != CursorBlink {\n\t\treturn nil\n\t}\n\n\tif m.blinkCtx != nil && m.blinkCtx.cancel != nil {\n\t\tm.blinkCtx.cancel()\n\t}\n\n\tctx, cancel := context.WithTimeout(m.blinkCtx.ctx, m.BlinkSpeed)\n\tm.blinkCtx.cancel = cancel\n\n\tm.blinkTag++\n\n\treturn func() tea.Msg {\n\t\tdefer cancel()\n\t\t<-ctx.Done()\n\t\tif ctx.Err() == context.DeadlineExceeded {\n\t\t\treturn BlinkMsg{id: m.id, tag: m.blinkTag}\n\t\t}\n\t\treturn blinkCanceled{}\n\t}\n}\n\n// Blink is a command used to initialize cursor blinking.\nfunc Blink() tea.Msg {\n\treturn initialBlinkMsg{}\n}\n\n// Focus focuses the cursor to allow it to blink if desired.\nfunc (m *Model) Focus() tea.Cmd {\n\tm.focus = true\n\tm.Blink = m.mode == CursorHide // show the cursor unless we've explicitly hidden it\n\n\tif m.mode == CursorBlink && m.focus {\n\t\treturn m.BlinkCmd()\n\t}\n\treturn nil\n}\n\n// Blur blurs the cursor.\nfunc (m *Model) Blur() {\n\tm.focus = false\n\tm.Blink = true\n}\n\n// SetChar sets the character under the cursor.\nfunc (m *Model) SetChar(char string) {\n\tm.char = char\n}\n\n// View displays the cursor.\nfunc (m Model) View() string {\n\tif m.Blink {\n\t\treturn m.TextStyle.Inline(true).Render(m.char)\n\t}\n\treturn m.Style.Inline(true).Reverse(true).Render(m.char)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/filepicker/filepicker.go",
    "content": "package filepicker\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n\t\"github.com/dustin/go-humanize\"\n)\n\nvar (\n\tlastID int\n\tidMtx  sync.Mutex\n)\n\n// Return the next ID we should use on the Model.\nfunc nextID() int {\n\tidMtx.Lock()\n\tdefer idMtx.Unlock()\n\tlastID++\n\treturn lastID\n}\n\n// New returns a new filepicker model with default styling and key bindings.\nfunc New() Model {\n\treturn Model{\n\t\tid:               nextID(),\n\t\tCurrentDirectory: \".\",\n\t\tCursor:           \">\",\n\t\tAllowedTypes:     []string{},\n\t\tselected:         0,\n\t\tShowPermissions:  true,\n\t\tShowSize:         true,\n\t\tShowHidden:       false,\n\t\tDirAllowed:       false,\n\t\tFileAllowed:      true,\n\t\tAutoHeight:       true,\n\t\tHeight:           0,\n\t\tmax:              0,\n\t\tmin:              0,\n\t\tselectedStack:    newStack(),\n\t\tminStack:         newStack(),\n\t\tmaxStack:         newStack(),\n\t\tKeyMap:           DefaultKeyMap(),\n\t\tStyles:           DefaultStyles(),\n\t}\n}\n\ntype errorMsg struct {\n\terr error\n}\n\ntype readDirMsg struct {\n\tid      int\n\tentries []os.DirEntry\n}\n\nconst (\n\tmarginBottom  = 5\n\tfileSizeWidth = 7\n\tpaddingLeft   = 2\n)\n\n// KeyMap defines key bindings for each user action.\ntype KeyMap struct {\n\tGoToTop  key.Binding\n\tGoToLast key.Binding\n\tDown     key.Binding\n\tUp       key.Binding\n\tPageUp   key.Binding\n\tPageDown key.Binding\n\tBack     key.Binding\n\tOpen     key.Binding\n\tSelect   key.Binding\n}\n\n// DefaultKeyMap defines the default keybindings.\nfunc DefaultKeyMap() KeyMap {\n\treturn KeyMap{\n\t\tGoToTop:  key.NewBinding(key.WithKeys(\"g\"), key.WithHelp(\"g\", \"first\")),\n\t\tGoToLast: key.NewBinding(key.WithKeys(\"G\"), key.WithHelp(\"G\", \"last\")),\n\t\tDown:     key.NewBinding(key.WithKeys(\"j\", \"down\", \"ctrl+n\"), key.WithHelp(\"j\", \"down\")),\n\t\tUp:       key.NewBinding(key.WithKeys(\"k\", \"up\", \"ctrl+p\"), key.WithHelp(\"k\", \"up\")),\n\t\tPageUp:   key.NewBinding(key.WithKeys(\"K\", \"pgup\"), key.WithHelp(\"pgup\", \"page up\")),\n\t\tPageDown: key.NewBinding(key.WithKeys(\"J\", \"pgdown\"), key.WithHelp(\"pgdown\", \"page down\")),\n\t\tBack:     key.NewBinding(key.WithKeys(\"h\", \"backspace\", \"left\", \"esc\"), key.WithHelp(\"h\", \"back\")),\n\t\tOpen:     key.NewBinding(key.WithKeys(\"l\", \"right\", \"enter\"), key.WithHelp(\"l\", \"open\")),\n\t\tSelect:   key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"select\")),\n\t}\n}\n\n// Styles defines the possible customizations for styles in the file picker.\ntype Styles struct {\n\tDisabledCursor   lipgloss.Style\n\tCursor           lipgloss.Style\n\tSymlink          lipgloss.Style\n\tDirectory        lipgloss.Style\n\tFile             lipgloss.Style\n\tDisabledFile     lipgloss.Style\n\tPermission       lipgloss.Style\n\tSelected         lipgloss.Style\n\tDisabledSelected lipgloss.Style\n\tFileSize         lipgloss.Style\n\tEmptyDirectory   lipgloss.Style\n}\n\n// DefaultStyles defines the default styling for the file picker.\nfunc DefaultStyles() Styles {\n\treturn DefaultStylesWithRenderer(lipgloss.DefaultRenderer())\n}\n\n// DefaultStylesWithRenderer defines the default styling for the file picker,\n// with a given Lip Gloss renderer.\nfunc DefaultStylesWithRenderer(r *lipgloss.Renderer) Styles {\n\treturn Styles{\n\t\tDisabledCursor:   r.NewStyle().Foreground(lipgloss.Color(\"247\")),\n\t\tCursor:           r.NewStyle().Foreground(lipgloss.Color(\"212\")),\n\t\tSymlink:          r.NewStyle().Foreground(lipgloss.Color(\"36\")),\n\t\tDirectory:        r.NewStyle().Foreground(lipgloss.Color(\"99\")),\n\t\tFile:             r.NewStyle(),\n\t\tDisabledFile:     r.NewStyle().Foreground(lipgloss.Color(\"243\")),\n\t\tDisabledSelected: r.NewStyle().Foreground(lipgloss.Color(\"247\")),\n\t\tPermission:       r.NewStyle().Foreground(lipgloss.Color(\"244\")),\n\t\tSelected:         r.NewStyle().Foreground(lipgloss.Color(\"212\")).Bold(true),\n\t\tFileSize:         r.NewStyle().Foreground(lipgloss.Color(\"240\")).Width(fileSizeWidth).Align(lipgloss.Right),\n\t\tEmptyDirectory:   r.NewStyle().Foreground(lipgloss.Color(\"240\")).PaddingLeft(paddingLeft).SetString(\"Bummer. No Files Found.\"),\n\t}\n}\n\n// Model represents a file picker.\ntype Model struct {\n\tid int\n\n\t// Path is the path which the user has selected with the file picker.\n\tPath string\n\n\t// CurrentDirectory is the directory that the user is currently in.\n\tCurrentDirectory string\n\n\t// AllowedTypes specifies which file types the user may select.\n\t// If empty the user may select any file.\n\tAllowedTypes []string\n\n\tKeyMap          KeyMap\n\tfiles           []os.DirEntry\n\tShowPermissions bool\n\tShowSize        bool\n\tShowHidden      bool\n\tDirAllowed      bool\n\tFileAllowed     bool\n\n\tFileSelected  string\n\tselected      int\n\tselectedStack stack\n\n\tmin      int\n\tmax      int\n\tmaxStack stack\n\tminStack stack\n\n\tHeight     int\n\tAutoHeight bool\n\n\tCursor string\n\tStyles Styles\n}\n\ntype stack struct {\n\tPush   func(int)\n\tPop    func() int\n\tLength func() int\n}\n\nfunc newStack() stack {\n\tslice := make([]int, 0)\n\treturn stack{\n\t\tPush: func(i int) {\n\t\t\tslice = append(slice, i)\n\t\t},\n\t\tPop: func() int {\n\t\t\tres := slice[len(slice)-1]\n\t\t\tslice = slice[:len(slice)-1]\n\t\t\treturn res\n\t\t},\n\t\tLength: func() int {\n\t\t\treturn len(slice)\n\t\t},\n\t}\n}\n\nfunc (m *Model) pushView(selected, min, max int) {\n\tm.selectedStack.Push(selected)\n\tm.minStack.Push(min)\n\tm.maxStack.Push(max)\n}\n\nfunc (m *Model) popView() (int, int, int) {\n\treturn m.selectedStack.Pop(), m.minStack.Pop(), m.maxStack.Pop()\n}\n\nfunc (m Model) readDir(path string, showHidden bool) tea.Cmd {\n\treturn func() tea.Msg {\n\t\tdirEntries, err := os.ReadDir(path)\n\t\tif err != nil {\n\t\t\treturn errorMsg{err}\n\t\t}\n\n\t\tsort.Slice(dirEntries, func(i, j int) bool {\n\t\t\tif dirEntries[i].IsDir() == dirEntries[j].IsDir() {\n\t\t\t\treturn dirEntries[i].Name() < dirEntries[j].Name()\n\t\t\t}\n\t\t\treturn dirEntries[i].IsDir()\n\t\t})\n\n\t\tif showHidden {\n\t\t\treturn readDirMsg{id: m.id, entries: dirEntries}\n\t\t}\n\n\t\tvar sanitizedDirEntries []os.DirEntry\n\t\tfor _, dirEntry := range dirEntries {\n\t\t\tisHidden, _ := IsHidden(dirEntry.Name())\n\t\t\tif isHidden {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsanitizedDirEntries = append(sanitizedDirEntries, dirEntry)\n\t\t}\n\t\treturn readDirMsg{id: m.id, entries: sanitizedDirEntries}\n\t}\n}\n\n// Init initializes the file picker model.\nfunc (m Model) Init() tea.Cmd {\n\treturn m.readDir(m.CurrentDirectory, m.ShowHidden)\n}\n\n// Update handles user interactions within the file picker model.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tswitch msg := msg.(type) {\n\tcase readDirMsg:\n\t\tif msg.id != m.id {\n\t\t\tbreak\n\t\t}\n\t\tm.files = msg.entries\n\t\tm.max = max(m.max, m.Height-1)\n\tcase tea.WindowSizeMsg:\n\t\tif m.AutoHeight {\n\t\t\tm.Height = msg.Height - marginBottom\n\t\t}\n\t\tm.max = m.Height - 1\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, m.KeyMap.GoToTop):\n\t\t\tm.selected = 0\n\t\t\tm.min = 0\n\t\t\tm.max = m.Height - 1\n\t\tcase key.Matches(msg, m.KeyMap.GoToLast):\n\t\t\tm.selected = len(m.files) - 1\n\t\t\tm.min = len(m.files) - m.Height\n\t\t\tm.max = len(m.files) - 1\n\t\tcase key.Matches(msg, m.KeyMap.Down):\n\t\t\tm.selected++\n\t\t\tif m.selected >= len(m.files) {\n\t\t\t\tm.selected = len(m.files) - 1\n\t\t\t}\n\t\t\tif m.selected > m.max {\n\t\t\t\tm.min++\n\t\t\t\tm.max++\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.Up):\n\t\t\tm.selected--\n\t\t\tif m.selected < 0 {\n\t\t\t\tm.selected = 0\n\t\t\t}\n\t\t\tif m.selected < m.min {\n\t\t\t\tm.min--\n\t\t\t\tm.max--\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.PageDown):\n\t\t\tm.selected += m.Height\n\t\t\tif m.selected >= len(m.files) {\n\t\t\t\tm.selected = len(m.files) - 1\n\t\t\t}\n\t\t\tm.min += m.Height\n\t\t\tm.max += m.Height\n\n\t\t\tif m.max >= len(m.files) {\n\t\t\t\tm.max = len(m.files) - 1\n\t\t\t\tm.min = m.max - m.Height\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.PageUp):\n\t\t\tm.selected -= m.Height\n\t\t\tif m.selected < 0 {\n\t\t\t\tm.selected = 0\n\t\t\t}\n\t\t\tm.min -= m.Height\n\t\t\tm.max -= m.Height\n\n\t\t\tif m.min < 0 {\n\t\t\t\tm.min = 0\n\t\t\t\tm.max = m.min + m.Height\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.Back):\n\t\t\tm.CurrentDirectory = filepath.Dir(m.CurrentDirectory)\n\t\t\tif m.selectedStack.Length() > 0 {\n\t\t\t\tm.selected, m.min, m.max = m.popView()\n\t\t\t} else {\n\t\t\t\tm.selected = 0\n\t\t\t\tm.min = 0\n\t\t\t\tm.max = m.Height - 1\n\t\t\t}\n\t\t\treturn m, m.readDir(m.CurrentDirectory, m.ShowHidden)\n\t\tcase key.Matches(msg, m.KeyMap.Open):\n\t\t\tif len(m.files) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tf := m.files[m.selected]\n\t\t\tinfo, err := f.Info()\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tisSymlink := info.Mode()&os.ModeSymlink != 0\n\t\t\tisDir := f.IsDir()\n\n\t\t\tif isSymlink {\n\t\t\t\tsymlinkPath, _ := filepath.EvalSymlinks(filepath.Join(m.CurrentDirectory, f.Name()))\n\t\t\t\tinfo, err := os.Stat(symlinkPath)\n\t\t\t\tif err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif info.IsDir() {\n\t\t\t\t\tisDir = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isDir && m.FileAllowed) || (isDir && m.DirAllowed) {\n\t\t\t\tif key.Matches(msg, m.KeyMap.Select) {\n\t\t\t\t\t// Select the current path as the selection\n\t\t\t\t\tm.Path = filepath.Join(m.CurrentDirectory, f.Name())\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !isDir {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tm.CurrentDirectory = filepath.Join(m.CurrentDirectory, f.Name())\n\t\t\tm.pushView(m.selected, m.min, m.max)\n\t\t\tm.selected = 0\n\t\t\tm.min = 0\n\t\t\tm.max = m.Height - 1\n\t\t\treturn m, m.readDir(m.CurrentDirectory, m.ShowHidden)\n\t\t}\n\t}\n\treturn m, nil\n}\n\n// View returns the view of the file picker.\nfunc (m Model) View() string {\n\tif len(m.files) == 0 {\n\t\treturn m.Styles.EmptyDirectory.Height(m.Height).MaxHeight(m.Height).String()\n\t}\n\tvar s strings.Builder\n\n\tfor i, f := range m.files {\n\t\tif i < m.min || i > m.max {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar symlinkPath string\n\t\tinfo, _ := f.Info()\n\t\tisSymlink := info.Mode()&os.ModeSymlink != 0\n\t\tsize := strings.Replace(humanize.Bytes(uint64(info.Size())), \" \", \"\", 1)\n\t\tname := f.Name()\n\n\t\tif isSymlink {\n\t\t\tsymlinkPath, _ = filepath.EvalSymlinks(filepath.Join(m.CurrentDirectory, name))\n\t\t}\n\n\t\tdisabled := !m.canSelect(name) && !f.IsDir()\n\n\t\tif m.selected == i {\n\t\t\tselected := \"\"\n\t\t\tif m.ShowPermissions {\n\t\t\t\tselected += \" \" + info.Mode().String()\n\t\t\t}\n\t\t\tif m.ShowSize {\n\t\t\t\tselected += fmt.Sprintf(\"%\"+strconv.Itoa(m.Styles.FileSize.GetWidth())+\"s\", size)\n\t\t\t}\n\t\t\tselected += \" \" + name\n\t\t\tif isSymlink {\n\t\t\t\tselected += \" → \" + symlinkPath\n\t\t\t}\n\t\t\tif disabled {\n\t\t\t\ts.WriteString(m.Styles.DisabledSelected.Render(m.Cursor) + m.Styles.DisabledSelected.Render(selected))\n\t\t\t} else {\n\t\t\t\ts.WriteString(m.Styles.Cursor.Render(m.Cursor) + m.Styles.Selected.Render(selected))\n\t\t\t}\n\t\t\ts.WriteRune('\\n')\n\t\t\tcontinue\n\t\t}\n\n\t\tstyle := m.Styles.File\n\t\tif f.IsDir() {\n\t\t\tstyle = m.Styles.Directory\n\t\t} else if isSymlink {\n\t\t\tstyle = m.Styles.Symlink\n\t\t} else if disabled {\n\t\t\tstyle = m.Styles.DisabledFile\n\t\t}\n\n\t\tfileName := style.Render(name)\n\t\ts.WriteString(m.Styles.Cursor.Render(\" \"))\n\t\tif isSymlink {\n\t\t\tfileName += \" → \" + symlinkPath\n\t\t}\n\t\tif m.ShowPermissions {\n\t\t\ts.WriteString(\" \" + m.Styles.Permission.Render(info.Mode().String()))\n\t\t}\n\t\tif m.ShowSize {\n\t\t\ts.WriteString(m.Styles.FileSize.Render(size))\n\t\t}\n\t\ts.WriteString(\" \" + fileName)\n\t\ts.WriteRune('\\n')\n\t}\n\n\tfor i := lipgloss.Height(s.String()); i <= m.Height; i++ {\n\t\ts.WriteRune('\\n')\n\t}\n\n\treturn s.String()\n}\n\n// DidSelectFile returns whether a user has selected a file (on this msg).\nfunc (m Model) DidSelectFile(msg tea.Msg) (bool, string) {\n\tdidSelect, path := m.didSelectFile(msg)\n\tif didSelect && m.canSelect(path) {\n\t\treturn true, path\n\t}\n\treturn false, \"\"\n}\n\n// DidSelectDisabledFile returns whether a user tried to select a disabled file\n// (on this msg). This is necessary only if you would like to warn the user that\n// they tried to select a disabled file.\nfunc (m Model) DidSelectDisabledFile(msg tea.Msg) (bool, string) {\n\tdidSelect, path := m.didSelectFile(msg)\n\tif didSelect && !m.canSelect(path) {\n\t\treturn true, path\n\t}\n\treturn false, \"\"\n}\n\nfunc (m Model) didSelectFile(msg tea.Msg) (bool, string) {\n\tif len(m.files) == 0 {\n\t\treturn false, \"\"\n\t}\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\t// If the msg does not match the Select keymap then this could not have been a selection.\n\t\tif !key.Matches(msg, m.KeyMap.Select) {\n\t\t\treturn false, \"\"\n\t\t}\n\n\t\t// The key press was a selection, let's confirm whether the current file could\n\t\t// be selected or used for navigating deeper into the stack.\n\t\tf := m.files[m.selected]\n\t\tinfo, err := f.Info()\n\t\tif err != nil {\n\t\t\treturn false, \"\"\n\t\t}\n\t\tisSymlink := info.Mode()&os.ModeSymlink != 0\n\t\tisDir := f.IsDir()\n\n\t\tif isSymlink {\n\t\t\tsymlinkPath, _ := filepath.EvalSymlinks(filepath.Join(m.CurrentDirectory, f.Name()))\n\t\t\tinfo, err := os.Stat(symlinkPath)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif info.IsDir() {\n\t\t\t\tisDir = true\n\t\t\t}\n\t\t}\n\n\t\tif (!isDir && m.FileAllowed) || (isDir && m.DirAllowed) && m.Path != \"\" {\n\t\t\treturn true, m.Path\n\t\t}\n\n\t\t// If the msg was not a KeyMsg, then the file could not have been selected this iteration.\n\t\t// Only a KeyMsg can select a file.\n\tdefault:\n\t\treturn false, \"\"\n\t}\n\treturn false, \"\"\n}\n\nfunc (m Model) canSelect(file string) bool {\n\tif len(m.AllowedTypes) <= 0 {\n\t\treturn true\n\t}\n\n\tfor _, ext := range m.AllowedTypes {\n\t\tif strings.HasSuffix(file, ext) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/filepicker/hidden_unix.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage filepicker\n\nimport \"strings\"\n\n// IsHidden reports whether a file is hidden or not.\nfunc IsHidden(file string) (bool, error) {\n\treturn strings.HasPrefix(file, \".\"), nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/filepicker/hidden_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage filepicker\n\nimport (\n\t\"syscall\"\n)\n\n// IsHidden reports whether a file is hidden or not.\nfunc IsHidden(file string) (bool, error) {\n\tpointer, err := syscall.UTF16PtrFromString(file)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tattributes, err := syscall.GetFileAttributes(pointer)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn attributes&syscall.FILE_ATTRIBUTE_HIDDEN != 0, nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/help/help.go",
    "content": "package help\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// KeyMap is a map of keybindings used to generate help. Since it's an\n// interface it can be any type, though struct or a map[string][]key.Binding\n// are likely candidates.\n//\n// Note that if a key is disabled (via key.Binding.SetEnabled) it will not be\n// rendered in the help view, so in theory generated help should self-manage.\ntype KeyMap interface {\n\t// ShortHelp returns a slice of bindings to be displayed in the short\n\t// version of the help. The help bubble will render help in the order in\n\t// which the help items are returned here.\n\tShortHelp() []key.Binding\n\n\t// FullHelp returns an extended group of help items, grouped by columns.\n\t// The help bubble will render the help in the order in which the help\n\t// items are returned here.\n\tFullHelp() [][]key.Binding\n}\n\n// Styles is a set of available style definitions for the Help bubble.\ntype Styles struct {\n\tEllipsis lipgloss.Style\n\n\t// Styling for the short help\n\tShortKey       lipgloss.Style\n\tShortDesc      lipgloss.Style\n\tShortSeparator lipgloss.Style\n\n\t// Styling for the full help\n\tFullKey       lipgloss.Style\n\tFullDesc      lipgloss.Style\n\tFullSeparator lipgloss.Style\n}\n\n// Model contains the state of the help view.\ntype Model struct {\n\tWidth   int\n\tShowAll bool // if true, render the \"full\" help menu\n\n\tShortSeparator string\n\tFullSeparator  string\n\n\t// The symbol we use in the short help when help items have been truncated\n\t// due to width. Periods of ellipsis by default.\n\tEllipsis string\n\n\tStyles Styles\n}\n\n// New creates a new help view with some useful defaults.\nfunc New() Model {\n\tkeyStyle := lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{\n\t\tLight: \"#909090\",\n\t\tDark:  \"#626262\",\n\t})\n\n\tdescStyle := lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{\n\t\tLight: \"#B2B2B2\",\n\t\tDark:  \"#4A4A4A\",\n\t})\n\n\tsepStyle := lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{\n\t\tLight: \"#DDDADA\",\n\t\tDark:  \"#3C3C3C\",\n\t})\n\n\treturn Model{\n\t\tShortSeparator: \" • \",\n\t\tFullSeparator:  \"    \",\n\t\tEllipsis:       \"…\",\n\t\tStyles: Styles{\n\t\t\tShortKey:       keyStyle,\n\t\t\tShortDesc:      descStyle,\n\t\t\tShortSeparator: sepStyle,\n\t\t\tEllipsis:       sepStyle,\n\t\t\tFullKey:        keyStyle,\n\t\t\tFullDesc:       descStyle,\n\t\t\tFullSeparator:  sepStyle,\n\t\t},\n\t}\n}\n\n// NewModel creates a new help view with some useful defaults.\n//\n// Deprecated: use [New] instead.\nvar NewModel = New\n\n// Update helps satisfy the Bubble Tea Model interface. It's a no-op.\nfunc (m Model) Update(_ tea.Msg) (Model, tea.Cmd) {\n\treturn m, nil\n}\n\n// View renders the help view's current state.\nfunc (m Model) View(k KeyMap) string {\n\tif m.ShowAll {\n\t\treturn m.FullHelpView(k.FullHelp())\n\t}\n\treturn m.ShortHelpView(k.ShortHelp())\n}\n\n// ShortHelpView renders a single line help view from a slice of keybindings.\n// If the line is longer than the maximum width it will be gracefully\n// truncated, showing only as many help items as possible.\nfunc (m Model) ShortHelpView(bindings []key.Binding) string {\n\tif len(bindings) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar b strings.Builder\n\tvar totalWidth int\n\tseparator := m.Styles.ShortSeparator.Inline(true).Render(m.ShortSeparator)\n\n\tfor i, kb := range bindings {\n\t\tif !kb.Enabled() {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar sep string\n\t\tif totalWidth > 0 && i < len(bindings) {\n\t\t\tsep = separator\n\t\t}\n\n\t\tstr := sep +\n\t\t\tm.Styles.ShortKey.Inline(true).Render(kb.Help().Key) + \" \" +\n\t\t\tm.Styles.ShortDesc.Inline(true).Render(kb.Help().Desc)\n\n\t\tw := lipgloss.Width(str)\n\n\t\t// If adding this help item would go over the available width, stop\n\t\t// drawing.\n\t\tif m.Width > 0 && totalWidth+w > m.Width {\n\t\t\t// Although if there's room for an ellipsis, print that.\n\t\t\ttail := \" \" + m.Styles.Ellipsis.Inline(true).Render(m.Ellipsis)\n\t\t\ttailWidth := lipgloss.Width(tail)\n\n\t\t\tif totalWidth+tailWidth < m.Width {\n\t\t\t\tb.WriteString(tail)\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\ttotalWidth += w\n\t\tb.WriteString(str)\n\t}\n\n\treturn b.String()\n}\n\n// FullHelpView renders help columns from a slice of key binding slices. Each\n// top level slice entry renders into a column.\nfunc (m Model) FullHelpView(groups [][]key.Binding) string {\n\tif len(groups) == 0 {\n\t\treturn \"\"\n\t}\n\n\t// Linter note: at this time we don't think it's worth the additional\n\t// code complexity involved in preallocating this slice.\n\t//nolint:prealloc\n\tvar (\n\t\tout []string\n\n\t\ttotalWidth int\n\t\tsep        = m.Styles.FullSeparator.Render(m.FullSeparator)\n\t\tsepWidth   = lipgloss.Width(sep)\n\t)\n\n\t// Iterate over groups to build columns\n\tfor i, group := range groups {\n\t\tif group == nil || !shouldRenderColumn(group) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar (\n\t\t\tkeys         []string\n\t\t\tdescriptions []string\n\t\t)\n\n\t\t// Separate keys and descriptions into different slices\n\t\tfor _, kb := range group {\n\t\t\tif !kb.Enabled() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkeys = append(keys, kb.Help().Key)\n\t\t\tdescriptions = append(descriptions, kb.Help().Desc)\n\t\t}\n\n\t\tcol := lipgloss.JoinHorizontal(lipgloss.Top,\n\t\t\tm.Styles.FullKey.Render(strings.Join(keys, \"\\n\")),\n\t\t\tm.Styles.FullKey.Render(\" \"),\n\t\t\tm.Styles.FullDesc.Render(strings.Join(descriptions, \"\\n\")),\n\t\t)\n\n\t\t// Column\n\t\ttotalWidth += lipgloss.Width(col)\n\t\tif m.Width > 0 && totalWidth > m.Width {\n\t\t\tbreak\n\t\t}\n\n\t\tout = append(out, col)\n\n\t\t// Separator\n\t\tif i < len(group)-1 {\n\t\t\ttotalWidth += sepWidth\n\t\t\tif m.Width > 0 && totalWidth > m.Width {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tout = append(out, sep)\n\t\t}\n\t}\n\n\treturn lipgloss.JoinHorizontal(lipgloss.Top, out...)\n}\n\nfunc shouldRenderColumn(b []key.Binding) (ok bool) {\n\tfor _, v := range b {\n\t\tif v.Enabled() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/key/key.go",
    "content": "// Package key provides some types and functions for generating user-definable\n// keymappings useful in Bubble Tea components. There are a few different ways\n// you can define a keymapping with this package. Here's one example:\n//\n//\ttype KeyMap struct {\n//\t    Up key.Binding\n//\t    Down key.Binding\n//\t}\n//\n//\tvar DefaultKeyMap = KeyMap{\n//\t    Up: key.NewBinding(\n//\t        key.WithKeys(\"k\", \"up\"),        // actual keybindings\n//\t        key.WithHelp(\"↑/k\", \"move up\"), // corresponding help text\n//\t    ),\n//\t    Down: key.NewBinding(\n//\t        key.WithKeys(\"j\", \"down\"),\n//\t        key.WithHelp(\"↓/j\", \"move down\"),\n//\t    ),\n//\t}\n//\n//\tfunc (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n//\t    switch msg := msg.(type) {\n//\t    case tea.KeyMsg:\n//\t        switch {\n//\t        case key.Matches(msg, DefaultKeyMap.Up):\n//\t            // The user pressed up\n//\t        case key.Matches(msg, DefaultKeyMap.Down):\n//\t            // The user pressed down\n//\t        }\n//\t    }\n//\n//\t    // ...\n//\t}\n//\n// The help information, which is not used in the example above, can be used\n// to render help text for keystrokes in your views.\npackage key\n\nimport \"fmt\"\n\n// Binding describes a set of keybindings and, optionally, their associated\n// help text.\ntype Binding struct {\n\tkeys     []string\n\thelp     Help\n\tdisabled bool\n}\n\n// BindingOpt is an initialization option for a keybinding. It's used as an\n// argument to NewBinding.\ntype BindingOpt func(*Binding)\n\n// NewBinding returns a new keybinding from a set of BindingOpt options.\nfunc NewBinding(opts ...BindingOpt) Binding {\n\tb := &Binding{}\n\tfor _, opt := range opts {\n\t\topt(b)\n\t}\n\treturn *b\n}\n\n// WithKeys initializes a keybinding with the given keystrokes.\nfunc WithKeys(keys ...string) BindingOpt {\n\treturn func(b *Binding) {\n\t\tb.keys = keys\n\t}\n}\n\n// WithHelp initializes a keybinding with the given help text.\nfunc WithHelp(key, desc string) BindingOpt {\n\treturn func(b *Binding) {\n\t\tb.help = Help{Key: key, Desc: desc}\n\t}\n}\n\n// WithDisabled initializes a disabled keybinding.\nfunc WithDisabled() BindingOpt {\n\treturn func(b *Binding) {\n\t\tb.disabled = true\n\t}\n}\n\n// SetKeys sets the keys for the keybinding.\nfunc (b *Binding) SetKeys(keys ...string) {\n\tb.keys = keys\n}\n\n// Keys returns the keys for the keybinding.\nfunc (b Binding) Keys() []string {\n\treturn b.keys\n}\n\n// SetHelp sets the help text for the keybinding.\nfunc (b *Binding) SetHelp(key, desc string) {\n\tb.help = Help{Key: key, Desc: desc}\n}\n\n// Help returns the Help information for the keybinding.\nfunc (b Binding) Help() Help {\n\treturn b.help\n}\n\n// Enabled returns whether or not the keybinding is enabled. Disabled\n// keybindings won't be activated and won't show up in help. Keybindings are\n// enabled by default.\nfunc (b Binding) Enabled() bool {\n\treturn !b.disabled && b.keys != nil\n}\n\n// SetEnabled enables or disables the keybinding.\nfunc (b *Binding) SetEnabled(v bool) {\n\tb.disabled = !v\n}\n\n// Unbind removes the keys and help from this binding, effectively nullifying\n// it. This is a step beyond disabling it, since applications can enable\n// or disable key bindings based on application state.\nfunc (b *Binding) Unbind() {\n\tb.keys = nil\n\tb.help = Help{}\n}\n\n// Help is help information for a given keybinding.\ntype Help struct {\n\tKey  string\n\tDesc string\n}\n\n// Matches checks if the given key matches the given bindings.\nfunc Matches[Key fmt.Stringer](k Key, b ...Binding) bool {\n\tkeys := k.String()\n\tfor _, binding := range b {\n\t\tfor _, v := range binding.keys {\n\t\t\tif keys == v && binding.Enabled() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/runeutil/runeutil.go",
    "content": "// Package runeutil provides a utility function for use in Bubbles\n// that can process Key messages containing runes.\npackage runeutil\n\nimport (\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n// Sanitizer is a helper for bubble widgets that want to process\n// Runes from input key messages.\ntype Sanitizer interface {\n\t// Sanitize removes control characters from runes in a KeyRunes\n\t// message, and optionally replaces newline/carriage return/tabs by a\n\t// specified character.\n\t//\n\t// The rune array is modified in-place if possible. In that case, the\n\t// returned slice is the original slice shortened after the control\n\t// characters have been removed/translated.\n\tSanitize(runes []rune) []rune\n}\n\n// NewSanitizer constructs a rune sanitizer.\nfunc NewSanitizer(opts ...Option) Sanitizer {\n\ts := sanitizer{\n\t\treplaceNewLine: []rune(\"\\n\"),\n\t\treplaceTab:     []rune(\"    \"),\n\t}\n\tfor _, o := range opts {\n\t\ts = o(s)\n\t}\n\treturn &s\n}\n\n// Option is the type of option that can be passed to Sanitize().\ntype Option func(sanitizer) sanitizer\n\n// ReplaceTabs replaces tabs by the specified string.\nfunc ReplaceTabs(tabRepl string) Option {\n\treturn func(s sanitizer) sanitizer {\n\t\ts.replaceTab = []rune(tabRepl)\n\t\treturn s\n\t}\n}\n\n// ReplaceNewlines replaces newline characters by the specified string.\nfunc ReplaceNewlines(nlRepl string) Option {\n\treturn func(s sanitizer) sanitizer {\n\t\ts.replaceNewLine = []rune(nlRepl)\n\t\treturn s\n\t}\n}\n\nfunc (s *sanitizer) Sanitize(runes []rune) []rune {\n\t// dstrunes are where we are storing the result.\n\tdstrunes := runes[:0:len(runes)]\n\t// copied indicates whether dstrunes is an alias of runes\n\t// or a copy. We need a copy when dst moves past src.\n\t// We use this as an optimization to avoid allocating\n\t// a new rune slice in the common case where the output\n\t// is smaller or equal to the input.\n\tcopied := false\n\n\tfor src := 0; src < len(runes); src++ {\n\t\tr := runes[src]\n\t\tswitch {\n\t\tcase r == utf8.RuneError:\n\t\t\t// skip\n\n\t\tcase r == '\\r' || r == '\\n':\n\t\t\tif len(dstrunes)+len(s.replaceNewLine) > src && !copied {\n\t\t\t\tdst := len(dstrunes)\n\t\t\t\tdstrunes = make([]rune, dst, len(runes)+len(s.replaceNewLine))\n\t\t\t\tcopy(dstrunes, runes[:dst])\n\t\t\t\tcopied = true\n\t\t\t}\n\t\t\tdstrunes = append(dstrunes, s.replaceNewLine...)\n\n\t\tcase r == '\\t':\n\t\t\tif len(dstrunes)+len(s.replaceTab) > src && !copied {\n\t\t\t\tdst := len(dstrunes)\n\t\t\t\tdstrunes = make([]rune, dst, len(runes)+len(s.replaceTab))\n\t\t\t\tcopy(dstrunes, runes[:dst])\n\t\t\t\tcopied = true\n\t\t\t}\n\t\t\tdstrunes = append(dstrunes, s.replaceTab...)\n\n\t\tcase unicode.IsControl(r):\n\t\t\t// Other control characters: skip.\n\n\t\tdefault:\n\t\t\t// Keep the character.\n\t\t\tdstrunes = append(dstrunes, runes[src])\n\t\t}\n\t}\n\treturn dstrunes\n}\n\ntype sanitizer struct {\n\treplaceNewLine []rune\n\treplaceTab     []rune\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/spinner/spinner.go",
    "content": "package spinner\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Internal ID management. Used during animating to ensure that frame messages\n// are received only by spinner components that sent them.\nvar (\n\tlastID int\n\tidMtx  sync.Mutex\n)\n\n// Return the next ID we should use on the Model.\nfunc nextID() int {\n\tidMtx.Lock()\n\tdefer idMtx.Unlock()\n\tlastID++\n\treturn lastID\n}\n\n// Spinner is a set of frames used in animating the spinner.\ntype Spinner struct {\n\tFrames []string\n\tFPS    time.Duration\n}\n\n// Some spinners to choose from. You could also make your own.\nvar (\n\tLine = Spinner{\n\t\tFrames: []string{\"|\", \"/\", \"-\", \"\\\\\"},\n\t\tFPS:    time.Second / 10, //nolint:gomnd\n\t}\n\tDot = Spinner{\n\t\tFrames: []string{\"⣾ \", \"⣽ \", \"⣻ \", \"⢿ \", \"⡿ \", \"⣟ \", \"⣯ \", \"⣷ \"},\n\t\tFPS:    time.Second / 10, //nolint:gomnd\n\t}\n\tMiniDot = Spinner{\n\t\tFrames: []string{\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"},\n\t\tFPS:    time.Second / 12, //nolint:gomnd\n\t}\n\tJump = Spinner{\n\t\tFrames: []string{\"⢄\", \"⢂\", \"⢁\", \"⡁\", \"⡈\", \"⡐\", \"⡠\"},\n\t\tFPS:    time.Second / 10, //nolint:gomnd\n\t}\n\tPulse = Spinner{\n\t\tFrames: []string{\"█\", \"▓\", \"▒\", \"░\"},\n\t\tFPS:    time.Second / 8, //nolint:gomnd\n\t}\n\tPoints = Spinner{\n\t\tFrames: []string{\"∙∙∙\", \"●∙∙\", \"∙●∙\", \"∙∙●\"},\n\t\tFPS:    time.Second / 7, //nolint:gomnd\n\t}\n\tGlobe = Spinner{\n\t\tFrames: []string{\"🌍\", \"🌎\", \"🌏\"},\n\t\tFPS:    time.Second / 4, //nolint:gomnd\n\t}\n\tMoon = Spinner{\n\t\tFrames: []string{\"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌕\", \"🌖\", \"🌗\", \"🌘\"},\n\t\tFPS:    time.Second / 8, //nolint:gomnd\n\t}\n\tMonkey = Spinner{\n\t\tFrames: []string{\"🙈\", \"🙉\", \"🙊\"},\n\t\tFPS:    time.Second / 3, //nolint:gomnd\n\t}\n\tMeter = Spinner{\n\t\tFrames: []string{\n\t\t\t\"▱▱▱\",\n\t\t\t\"▰▱▱\",\n\t\t\t\"▰▰▱\",\n\t\t\t\"▰▰▰\",\n\t\t\t\"▰▰▱\",\n\t\t\t\"▰▱▱\",\n\t\t\t\"▱▱▱\",\n\t\t},\n\t\tFPS: time.Second / 7, //nolint:gomnd\n\t}\n\tHamburger = Spinner{\n\t\tFrames: []string{\"☱\", \"☲\", \"☴\", \"☲\"},\n\t\tFPS:    time.Second / 3, //nolint:gomnd\n\t}\n\tEllipsis = Spinner{\n\t\tFrames: []string{\"\", \".\", \"..\", \"...\"},\n\t\tFPS:    time.Second / 3, //nolint:gomnd\n\t}\n)\n\n// Model contains the state for the spinner. Use New to create new models\n// rather than using Model as a struct literal.\ntype Model struct {\n\t// Spinner settings to use. See type Spinner.\n\tSpinner Spinner\n\n\t// Style sets the styling for the spinner. Most of the time you'll just\n\t// want foreground and background coloring, and potentially some padding.\n\t//\n\t// For an introduction to styling with Lip Gloss see:\n\t// https://github.com/charmbracelet/lipgloss\n\tStyle lipgloss.Style\n\n\tframe int\n\tid    int\n\ttag   int\n}\n\n// ID returns the spinner's unique ID.\nfunc (m Model) ID() int {\n\treturn m.id\n}\n\n// New returns a model with default values.\nfunc New(opts ...Option) Model {\n\tm := Model{\n\t\tSpinner: Line,\n\t\tid:      nextID(),\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(&m)\n\t}\n\n\treturn m\n}\n\n// NewModel returns a model with default values.\n//\n// Deprecated: use [New] instead.\nvar NewModel = New\n\n// TickMsg indicates that the timer has ticked and we should render a frame.\ntype TickMsg struct {\n\tTime time.Time\n\ttag  int\n\tID   int\n}\n\n// Update is the Tea update function.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tswitch msg := msg.(type) {\n\tcase TickMsg:\n\t\t// If an ID is set, and the ID doesn't belong to this spinner, reject\n\t\t// the message.\n\t\tif msg.ID > 0 && msg.ID != m.id {\n\t\t\treturn m, nil\n\t\t}\n\n\t\t// If a tag is set, and it's not the one we expect, reject the message.\n\t\t// This prevents the spinner from receiving too many messages and\n\t\t// thus spinning too fast.\n\t\tif msg.tag > 0 && msg.tag != m.tag {\n\t\t\treturn m, nil\n\t\t}\n\n\t\tm.frame++\n\t\tif m.frame >= len(m.Spinner.Frames) {\n\t\t\tm.frame = 0\n\t\t}\n\n\t\tm.tag++\n\t\treturn m, m.tick(m.id, m.tag)\n\tdefault:\n\t\treturn m, nil\n\t}\n}\n\n// View renders the model's view.\nfunc (m Model) View() string {\n\tif m.frame >= len(m.Spinner.Frames) {\n\t\treturn \"(error)\"\n\t}\n\n\treturn m.Style.Render(m.Spinner.Frames[m.frame])\n}\n\n// Tick is the command used to advance the spinner one frame. Use this command\n// to effectively start the spinner.\nfunc (m Model) Tick() tea.Msg {\n\treturn TickMsg{\n\t\t// The time at which the tick occurred.\n\t\tTime: time.Now(),\n\n\t\t// The ID of the spinner that this message belongs to. This can be\n\t\t// helpful when routing messages, however bear in mind that spinners\n\t\t// will ignore messages that don't contain ID by default.\n\t\tID: m.id,\n\n\t\ttag: m.tag,\n\t}\n}\n\nfunc (m Model) tick(id, tag int) tea.Cmd {\n\treturn tea.Tick(m.Spinner.FPS, func(t time.Time) tea.Msg {\n\t\treturn TickMsg{\n\t\t\tTime: t,\n\t\t\tID:   id,\n\t\t\ttag:  tag,\n\t\t}\n\t})\n}\n\n// Tick is the command used to advance the spinner one frame. Use this command\n// to effectively start the spinner.\n//\n// Deprecated: Use [Model.Tick] instead.\nfunc Tick() tea.Msg {\n\treturn TickMsg{Time: time.Now()}\n}\n\n// Option is used to set options in New. For example:\n//\n//\tspinner := New(WithSpinner(Dot))\ntype Option func(*Model)\n\n// WithSpinner is an option to set the spinner.\nfunc WithSpinner(spinner Spinner) Option {\n\treturn func(m *Model) {\n\t\tm.Spinner = spinner\n\t}\n}\n\n// WithStyle is an option to set the spinner style.\nfunc WithStyle(style lipgloss.Style) Option {\n\treturn func(m *Model) {\n\t\tm.Style = style\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/textarea/memoization/memoization.go",
    "content": "package memoization\n\nimport (\n\t\"container/list\"\n\t\"crypto/sha256\"\n\t\"fmt\"\n\t\"sync\"\n)\n\n// Hasher is an interface that requires a Hash method. The Hash method is\n// expected to return a string representation of the hash of the object.\ntype Hasher interface {\n\tHash() string\n}\n\n// entry is a struct that holds a key-value pair. It is used as an element\n// in the evictionList of the MemoCache.\ntype entry[T any] struct {\n\tkey   string\n\tvalue T\n}\n\n// MemoCache is a struct that represents a cache with a set capacity. It\n// uses an LRU (Least Recently Used) eviction policy. It is safe for\n// concurrent use.\ntype MemoCache[H Hasher, T any] struct {\n\tcapacity      int\n\tmutex         sync.Mutex\n\tcache         map[string]*list.Element // The cache holding the results\n\tevictionList  *list.List               // A list to keep track of the order for LRU\n\thashableItems map[string]T             // This map keeps track of the original hashable items (optional)\n}\n\n// NewMemoCache is a function that creates a new MemoCache with a given\n// capacity. It returns a pointer to the created MemoCache.\nfunc NewMemoCache[H Hasher, T any](capacity int) *MemoCache[H, T] {\n\treturn &MemoCache[H, T]{\n\t\tcapacity:      capacity,\n\t\tcache:         make(map[string]*list.Element),\n\t\tevictionList:  list.New(),\n\t\thashableItems: make(map[string]T),\n\t}\n}\n\n// Capacity is a method that returns the capacity of the MemoCache.\nfunc (m *MemoCache[H, T]) Capacity() int {\n\treturn m.capacity\n}\n\n// Size is a method that returns the current size of the MemoCache. It is\n// the number of items currently stored in the cache.\nfunc (m *MemoCache[H, T]) Size() int {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\treturn m.evictionList.Len()\n}\n\n// Get is a method that returns the value associated with the given\n// hashable item in the MemoCache. If there is no corresponding value, the\n// method returns nil.\nfunc (m *MemoCache[H, T]) Get(h H) (T, bool) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\thashedKey := h.Hash()\n\tif element, found := m.cache[hashedKey]; found {\n\t\tm.evictionList.MoveToFront(element)\n\t\treturn element.Value.(*entry[T]).value, true\n\t}\n\tvar result T\n\treturn result, false\n}\n\n// Set is a method that sets the value for the given hashable item in the\n// MemoCache. If the cache is at capacity, it evicts the least recently\n// used item before adding the new item.\nfunc (m *MemoCache[H, T]) Set(h H, value T) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\thashedKey := h.Hash()\n\tif element, found := m.cache[hashedKey]; found {\n\t\tm.evictionList.MoveToFront(element)\n\t\telement.Value.(*entry[T]).value = value\n\t\treturn\n\t}\n\n\t// Check if the cache is at capacity\n\tif m.evictionList.Len() >= m.capacity {\n\t\t// Evict the least recently used item from the cache\n\t\ttoEvict := m.evictionList.Back()\n\t\tif toEvict != nil {\n\t\t\tevictedEntry := m.evictionList.Remove(toEvict).(*entry[T])\n\t\t\tdelete(m.cache, evictedEntry.key)\n\t\t\tdelete(m.hashableItems, evictedEntry.key) // if you're keeping track of original items\n\t\t}\n\t}\n\n\t// Add the value to the cache and the evictionList\n\tnewEntry := &entry[T]{\n\t\tkey:   hashedKey,\n\t\tvalue: value,\n\t}\n\telement := m.evictionList.PushFront(newEntry)\n\tm.cache[hashedKey] = element\n\tm.hashableItems[hashedKey] = value // if you're keeping track of original items\n}\n\n// HString is a type that implements the Hasher interface for strings.\ntype HString string\n\n// Hash is a method that returns the hash of the string.\nfunc (h HString) Hash() string {\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(h)))\n}\n\n// HInt is a type that implements the Hasher interface for integers.\ntype HInt int\n\n// Hash is a method that returns the hash of the integer.\nfunc (h HInt) Hash() string {\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(fmt.Sprintf(\"%d\", h))))\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/textarea/textarea.go",
    "content": "package textarea\n\nimport (\n\t\"crypto/sha256\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/atotto/clipboard\"\n\t\"github.com/charmbracelet/bubbles/cursor\"\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/runeutil\"\n\t\"github.com/charmbracelet/bubbles/textarea/memoization\"\n\t\"github.com/charmbracelet/bubbles/viewport\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n\t\"github.com/charmbracelet/x/ansi\"\n\trw \"github.com/mattn/go-runewidth\"\n\t\"github.com/rivo/uniseg\"\n)\n\nconst (\n\tminHeight        = 1\n\tdefaultHeight    = 6\n\tdefaultWidth     = 40\n\tdefaultCharLimit = 400\n\tdefaultMaxHeight = 99\n\tdefaultMaxWidth  = 500\n)\n\n// Internal messages for clipboard operations.\ntype (\n\tpasteMsg    string\n\tpasteErrMsg struct{ error }\n)\n\n// KeyMap is the key bindings for different actions within the textarea.\ntype KeyMap struct {\n\tCharacterBackward       key.Binding\n\tCharacterForward        key.Binding\n\tDeleteAfterCursor       key.Binding\n\tDeleteBeforeCursor      key.Binding\n\tDeleteCharacterBackward key.Binding\n\tDeleteCharacterForward  key.Binding\n\tDeleteWordBackward      key.Binding\n\tDeleteWordForward       key.Binding\n\tInsertNewline           key.Binding\n\tLineEnd                 key.Binding\n\tLineNext                key.Binding\n\tLinePrevious            key.Binding\n\tLineStart               key.Binding\n\tPaste                   key.Binding\n\tWordBackward            key.Binding\n\tWordForward             key.Binding\n\tInputBegin              key.Binding\n\tInputEnd                key.Binding\n\n\tUppercaseWordForward  key.Binding\n\tLowercaseWordForward  key.Binding\n\tCapitalizeWordForward key.Binding\n\n\tTransposeCharacterBackward key.Binding\n}\n\n// DefaultKeyMap is the default set of key bindings for navigating and acting\n// upon the textarea.\nvar DefaultKeyMap = KeyMap{\n\tCharacterForward:        key.NewBinding(key.WithKeys(\"right\", \"ctrl+f\"), key.WithHelp(\"right\", \"character forward\")),\n\tCharacterBackward:       key.NewBinding(key.WithKeys(\"left\", \"ctrl+b\"), key.WithHelp(\"left\", \"character backward\")),\n\tWordForward:             key.NewBinding(key.WithKeys(\"alt+right\", \"alt+f\"), key.WithHelp(\"alt+right\", \"word forward\")),\n\tWordBackward:            key.NewBinding(key.WithKeys(\"alt+left\", \"alt+b\"), key.WithHelp(\"alt+left\", \"word backward\")),\n\tLineNext:                key.NewBinding(key.WithKeys(\"down\", \"ctrl+n\"), key.WithHelp(\"down\", \"next line\")),\n\tLinePrevious:            key.NewBinding(key.WithKeys(\"up\", \"ctrl+p\"), key.WithHelp(\"up\", \"previous line\")),\n\tDeleteWordBackward:      key.NewBinding(key.WithKeys(\"alt+backspace\", \"ctrl+w\"), key.WithHelp(\"alt+backspace\", \"delete word backward\")),\n\tDeleteWordForward:       key.NewBinding(key.WithKeys(\"alt+delete\", \"alt+d\"), key.WithHelp(\"alt+delete\", \"delete word forward\")),\n\tDeleteAfterCursor:       key.NewBinding(key.WithKeys(\"ctrl+k\"), key.WithHelp(\"ctrl+k\", \"delete after cursor\")),\n\tDeleteBeforeCursor:      key.NewBinding(key.WithKeys(\"ctrl+u\"), key.WithHelp(\"ctrl+u\", \"delete before cursor\")),\n\tInsertNewline:           key.NewBinding(key.WithKeys(\"enter\", \"ctrl+m\"), key.WithHelp(\"enter\", \"insert newline\")),\n\tDeleteCharacterBackward: key.NewBinding(key.WithKeys(\"backspace\", \"ctrl+h\"), key.WithHelp(\"backspace\", \"delete character backward\")),\n\tDeleteCharacterForward:  key.NewBinding(key.WithKeys(\"delete\", \"ctrl+d\"), key.WithHelp(\"delete\", \"delete character forward\")),\n\tLineStart:               key.NewBinding(key.WithKeys(\"home\", \"ctrl+a\"), key.WithHelp(\"home\", \"line start\")),\n\tLineEnd:                 key.NewBinding(key.WithKeys(\"end\", \"ctrl+e\"), key.WithHelp(\"end\", \"line end\")),\n\tPaste:                   key.NewBinding(key.WithKeys(\"ctrl+v\"), key.WithHelp(\"ctrl+v\", \"paste\")),\n\tInputBegin:              key.NewBinding(key.WithKeys(\"alt+<\", \"ctrl+home\"), key.WithHelp(\"alt+<\", \"input begin\")),\n\tInputEnd:                key.NewBinding(key.WithKeys(\"alt+>\", \"ctrl+end\"), key.WithHelp(\"alt+>\", \"input end\")),\n\n\tCapitalizeWordForward: key.NewBinding(key.WithKeys(\"alt+c\"), key.WithHelp(\"alt+c\", \"capitalize word forward\")),\n\tLowercaseWordForward:  key.NewBinding(key.WithKeys(\"alt+l\"), key.WithHelp(\"alt+l\", \"lowercase word forward\")),\n\tUppercaseWordForward:  key.NewBinding(key.WithKeys(\"alt+u\"), key.WithHelp(\"alt+u\", \"uppercase word forward\")),\n\n\tTransposeCharacterBackward: key.NewBinding(key.WithKeys(\"ctrl+t\"), key.WithHelp(\"ctrl+t\", \"transpose character backward\")),\n}\n\n// LineInfo is a helper for keeping track of line information regarding\n// soft-wrapped lines.\ntype LineInfo struct {\n\t// Width is the number of columns in the line.\n\tWidth int\n\t// CharWidth is the number of characters in the line to account for\n\t// double-width runes.\n\tCharWidth int\n\t// Height is the number of rows in the line.\n\tHeight int\n\t// StartColumn is the index of the first column of the line.\n\tStartColumn int\n\t// ColumnOffset is the number of columns that the cursor is offset from the\n\t// start of the line.\n\tColumnOffset int\n\t// RowOffset is the number of rows that the cursor is offset from the start\n\t// of the line.\n\tRowOffset int\n\t// CharOffset is the number of characters that the cursor is offset\n\t// from the start of the line. This will generally be equivalent to\n\t// ColumnOffset, but will be different there are double-width runes before\n\t// the cursor.\n\tCharOffset int\n}\n\n// Style that will be applied to the text area.\n//\n// Style can be applied to focused and unfocused states to change the styles\n// depending on the focus state.\n//\n// For an introduction to styling with Lip Gloss see:\n// https://github.com/charmbracelet/lipgloss\ntype Style struct {\n\tBase             lipgloss.Style\n\tCursorLine       lipgloss.Style\n\tCursorLineNumber lipgloss.Style\n\tEndOfBuffer      lipgloss.Style\n\tLineNumber       lipgloss.Style\n\tPlaceholder      lipgloss.Style\n\tPrompt           lipgloss.Style\n\tText             lipgloss.Style\n}\n\nfunc (s Style) computedCursorLine() lipgloss.Style {\n\treturn s.CursorLine.Inherit(s.Base).Inline(true)\n}\n\nfunc (s Style) computedCursorLineNumber() lipgloss.Style {\n\treturn s.CursorLineNumber.\n\t\tInherit(s.CursorLine).\n\t\tInherit(s.Base).\n\t\tInline(true)\n}\n\nfunc (s Style) computedEndOfBuffer() lipgloss.Style {\n\treturn s.EndOfBuffer.Inherit(s.Base).Inline(true)\n}\n\nfunc (s Style) computedLineNumber() lipgloss.Style {\n\treturn s.LineNumber.Inherit(s.Base).Inline(true)\n}\n\nfunc (s Style) computedPlaceholder() lipgloss.Style {\n\treturn s.Placeholder.Inherit(s.Base).Inline(true)\n}\n\nfunc (s Style) computedPrompt() lipgloss.Style {\n\treturn s.Prompt.Inherit(s.Base).Inline(true)\n}\n\nfunc (s Style) computedText() lipgloss.Style {\n\treturn s.Text.Inherit(s.Base).Inline(true)\n}\n\n// line is the input to the text wrapping function. This is stored in a struct\n// so that it can be hashed and memoized.\ntype line struct {\n\trunes []rune\n\twidth int\n}\n\n// Hash returns a hash of the line.\nfunc (w line) Hash() string {\n\tv := fmt.Sprintf(\"%s:%d\", string(w.runes), w.width)\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(v)))\n}\n\n// Model is the Bubble Tea model for this text area element.\ntype Model struct {\n\tErr error\n\n\t// General settings.\n\tcache *memoization.MemoCache[line, [][]rune]\n\n\t// Prompt is printed at the beginning of each line.\n\t//\n\t// When changing the value of Prompt after the model has been\n\t// initialized, ensure that SetWidth() gets called afterwards.\n\t//\n\t// See also SetPromptFunc().\n\tPrompt string\n\n\t// Placeholder is the text displayed when the user\n\t// hasn't entered anything yet.\n\tPlaceholder string\n\n\t// ShowLineNumbers, if enabled, causes line numbers to be printed\n\t// after the prompt.\n\tShowLineNumbers bool\n\n\t// EndOfBufferCharacter is displayed at the end of the input.\n\tEndOfBufferCharacter rune\n\n\t// KeyMap encodes the keybindings recognized by the widget.\n\tKeyMap KeyMap\n\n\t// Styling. FocusedStyle and BlurredStyle are used to style the textarea in\n\t// focused and blurred states.\n\tFocusedStyle Style\n\tBlurredStyle Style\n\t// style is the current styling to use.\n\t// It is used to abstract the differences in focus state when styling the\n\t// model, since we can simply assign the set of styles to this variable\n\t// when switching focus states.\n\tstyle *Style\n\n\t// Cursor is the text area cursor.\n\tCursor cursor.Model\n\n\t// CharLimit is the maximum number of characters this input element will\n\t// accept. If 0 or less, there's no limit.\n\tCharLimit int\n\n\t// MaxHeight is the maximum height of the text area in rows. If 0 or less,\n\t// there's no limit.\n\tMaxHeight int\n\n\t// MaxWidth is the maximum width of the text area in columns. If 0 or less,\n\t// there's no limit.\n\tMaxWidth int\n\n\t// If promptFunc is set, it replaces Prompt as a generator for\n\t// prompt strings at the beginning of each line.\n\tpromptFunc func(line int) string\n\n\t// promptWidth is the width of the prompt.\n\tpromptWidth int\n\n\t// width is the maximum number of characters that can be displayed at once.\n\t// If 0 or less this setting is ignored.\n\twidth int\n\n\t// height is the maximum number of lines that can be displayed at once. It\n\t// essentially treats the text field like a vertically scrolling viewport\n\t// if there are more lines than the permitted height.\n\theight int\n\n\t// Underlying text value.\n\tvalue [][]rune\n\n\t// focus indicates whether user input focus should be on this input\n\t// component. When false, ignore keyboard input and hide the cursor.\n\tfocus bool\n\n\t// Cursor column.\n\tcol int\n\n\t// Cursor row.\n\trow int\n\n\t// Last character offset, used to maintain state when the cursor is moved\n\t// vertically such that we can maintain the same navigating position.\n\tlastCharOffset int\n\n\t// viewport is the vertically-scrollable viewport of the multi-line text\n\t// input.\n\tviewport *viewport.Model\n\n\t// rune sanitizer for input.\n\trsan runeutil.Sanitizer\n}\n\n// New creates a new model with default settings.\nfunc New() Model {\n\tvp := viewport.New(0, 0)\n\tvp.KeyMap = viewport.KeyMap{}\n\tcur := cursor.New()\n\n\tfocusedStyle, blurredStyle := DefaultStyles()\n\n\tm := Model{\n\t\tCharLimit:            defaultCharLimit,\n\t\tMaxHeight:            defaultMaxHeight,\n\t\tMaxWidth:             defaultMaxWidth,\n\t\tPrompt:               lipgloss.ThickBorder().Left + \" \",\n\t\tstyle:                &blurredStyle,\n\t\tFocusedStyle:         focusedStyle,\n\t\tBlurredStyle:         blurredStyle,\n\t\tcache:                memoization.NewMemoCache[line, [][]rune](defaultMaxHeight),\n\t\tEndOfBufferCharacter: ' ',\n\t\tShowLineNumbers:      true,\n\t\tCursor:               cur,\n\t\tKeyMap:               DefaultKeyMap,\n\n\t\tvalue: make([][]rune, minHeight, defaultMaxHeight),\n\t\tfocus: false,\n\t\tcol:   0,\n\t\trow:   0,\n\n\t\tviewport: &vp,\n\t}\n\n\tm.SetHeight(defaultHeight)\n\tm.SetWidth(defaultWidth)\n\n\treturn m\n}\n\n// DefaultStyles returns the default styles for focused and blurred states for\n// the textarea.\nfunc DefaultStyles() (Style, Style) {\n\tfocused := Style{\n\t\tBase:             lipgloss.NewStyle(),\n\t\tCursorLine:       lipgloss.NewStyle().Background(lipgloss.AdaptiveColor{Light: \"255\", Dark: \"0\"}),\n\t\tCursorLineNumber: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"240\"}),\n\t\tEndOfBuffer:      lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"254\", Dark: \"0\"}),\n\t\tLineNumber:       lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"249\", Dark: \"7\"}),\n\t\tPlaceholder:      lipgloss.NewStyle().Foreground(lipgloss.Color(\"240\")),\n\t\tPrompt:           lipgloss.NewStyle().Foreground(lipgloss.Color(\"7\")),\n\t\tText:             lipgloss.NewStyle(),\n\t}\n\tblurred := Style{\n\t\tBase:             lipgloss.NewStyle(),\n\t\tCursorLine:       lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"245\", Dark: \"7\"}),\n\t\tCursorLineNumber: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"249\", Dark: \"7\"}),\n\t\tEndOfBuffer:      lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"254\", Dark: \"0\"}),\n\t\tLineNumber:       lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"249\", Dark: \"7\"}),\n\t\tPlaceholder:      lipgloss.NewStyle().Foreground(lipgloss.Color(\"240\")),\n\t\tPrompt:           lipgloss.NewStyle().Foreground(lipgloss.Color(\"7\")),\n\t\tText:             lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"245\", Dark: \"7\"}),\n\t}\n\n\treturn focused, blurred\n}\n\n// SetValue sets the value of the text input.\nfunc (m *Model) SetValue(s string) {\n\tm.Reset()\n\tm.InsertString(s)\n}\n\n// InsertString inserts a string at the cursor position.\nfunc (m *Model) InsertString(s string) {\n\tm.insertRunesFromUserInput([]rune(s))\n}\n\n// InsertRune inserts a rune at the cursor position.\nfunc (m *Model) InsertRune(r rune) {\n\tm.insertRunesFromUserInput([]rune{r})\n}\n\n// insertRunesFromUserInput inserts runes at the current cursor position.\nfunc (m *Model) insertRunesFromUserInput(runes []rune) {\n\t// Clean up any special characters in the input provided by the\n\t// clipboard. This avoids bugs due to e.g. tab characters and\n\t// whatnot.\n\trunes = m.san().Sanitize(runes)\n\n\tvar availSpace int\n\tif m.CharLimit > 0 {\n\t\tavailSpace = m.CharLimit - m.Length()\n\t\t// If the char limit's been reached, cancel.\n\t\tif availSpace <= 0 {\n\t\t\treturn\n\t\t}\n\t\t// If there's not enough space to paste the whole thing cut the pasted\n\t\t// runes down so they'll fit.\n\t\tif availSpace < len(runes) {\n\t\t\trunes = runes[:availSpace]\n\t\t}\n\t}\n\n\t// Split the input into lines.\n\tvar lines [][]rune\n\tlstart := 0\n\tfor i := 0; i < len(runes); i++ {\n\t\tif runes[i] == '\\n' {\n\t\t\t// Queue a line to become a new row in the text area below.\n\t\t\t// Beware to clamp the max capacity of the slice, to ensure no\n\t\t\t// data from different rows get overwritten when later edits\n\t\t\t// will modify this line.\n\t\t\tlines = append(lines, runes[lstart:i:i])\n\t\t\tlstart = i + 1\n\t\t}\n\t}\n\tif lstart <= len(runes) {\n\t\t// The last line did not end with a newline character.\n\t\t// Take it now.\n\t\tlines = append(lines, runes[lstart:])\n\t}\n\n\t// Obey the maximum height limit.\n\tif m.MaxHeight > 0 && len(m.value)+len(lines)-1 > m.MaxHeight {\n\t\tallowedHeight := max(0, m.MaxHeight-len(m.value)+1)\n\t\tlines = lines[:allowedHeight]\n\t}\n\n\tif len(lines) == 0 {\n\t\t// Nothing left to insert.\n\t\treturn\n\t}\n\n\t// Save the remainder of the original line at the current\n\t// cursor position.\n\ttail := make([]rune, len(m.value[m.row][m.col:]))\n\tcopy(tail, m.value[m.row][m.col:])\n\n\t// Paste the first line at the current cursor position.\n\tm.value[m.row] = append(m.value[m.row][:m.col], lines[0]...)\n\tm.col += len(lines[0])\n\n\tif numExtraLines := len(lines) - 1; numExtraLines > 0 {\n\t\t// Add the new lines.\n\t\t// We try to reuse the slice if there's already space.\n\t\tvar newGrid [][]rune\n\t\tif cap(m.value) >= len(m.value)+numExtraLines {\n\t\t\t// Can reuse the extra space.\n\t\t\tnewGrid = m.value[:len(m.value)+numExtraLines]\n\t\t} else {\n\t\t\t// No space left; need a new slice.\n\t\t\tnewGrid = make([][]rune, len(m.value)+numExtraLines)\n\t\t\tcopy(newGrid, m.value[:m.row+1])\n\t\t}\n\t\t// Add all the rows that were after the cursor in the original\n\t\t// grid at the end of the new grid.\n\t\tcopy(newGrid[m.row+1+numExtraLines:], m.value[m.row+1:])\n\t\tm.value = newGrid\n\t\t// Insert all the new lines in the middle.\n\t\tfor _, l := range lines[1:] {\n\t\t\tm.row++\n\t\t\tm.value[m.row] = l\n\t\t\tm.col = len(l)\n\t\t}\n\t}\n\n\t// Finally add the tail at the end of the last line inserted.\n\tm.value[m.row] = append(m.value[m.row], tail...)\n\n\tm.SetCursor(m.col)\n}\n\n// Value returns the value of the text input.\nfunc (m Model) Value() string {\n\tif m.value == nil {\n\t\treturn \"\"\n\t}\n\n\tvar v strings.Builder\n\tfor _, l := range m.value {\n\t\tv.WriteString(string(l))\n\t\tv.WriteByte('\\n')\n\t}\n\n\treturn strings.TrimSuffix(v.String(), \"\\n\")\n}\n\n// Length returns the number of characters currently in the text input.\nfunc (m *Model) Length() int {\n\tvar l int\n\tfor _, row := range m.value {\n\t\tl += uniseg.StringWidth(string(row))\n\t}\n\t// We add len(m.value) to include the newline characters.\n\treturn l + len(m.value) - 1\n}\n\n// LineCount returns the number of lines that are currently in the text input.\nfunc (m *Model) LineCount() int {\n\treturn len(m.value)\n}\n\n// Line returns the line position.\nfunc (m Model) Line() int {\n\treturn m.row\n}\n\n// CursorDown moves the cursor down by one line.\n// Returns whether or not the cursor blink should be reset.\nfunc (m *Model) CursorDown() {\n\tli := m.LineInfo()\n\tcharOffset := max(m.lastCharOffset, li.CharOffset)\n\tm.lastCharOffset = charOffset\n\n\tif li.RowOffset+1 >= li.Height && m.row < len(m.value)-1 {\n\t\tm.row++\n\t\tm.col = 0\n\t} else {\n\t\t// Move the cursor to the start of the next line so that we can get\n\t\t// the line information. We need to add 2 columns to account for the\n\t\t// trailing space wrapping.\n\t\tm.col = min(li.StartColumn+li.Width+2, len(m.value[m.row])-1)\n\t}\n\n\tnli := m.LineInfo()\n\tm.col = nli.StartColumn\n\n\tif nli.Width <= 0 {\n\t\treturn\n\t}\n\n\toffset := 0\n\tfor offset < charOffset {\n\t\tif m.row >= len(m.value) || m.col >= len(m.value[m.row]) || offset >= nli.CharWidth-1 {\n\t\t\tbreak\n\t\t}\n\t\toffset += rw.RuneWidth(m.value[m.row][m.col])\n\t\tm.col++\n\t}\n}\n\n// CursorUp moves the cursor up by one line.\nfunc (m *Model) CursorUp() {\n\tli := m.LineInfo()\n\tcharOffset := max(m.lastCharOffset, li.CharOffset)\n\tm.lastCharOffset = charOffset\n\n\tif li.RowOffset <= 0 && m.row > 0 {\n\t\tm.row--\n\t\tm.col = len(m.value[m.row])\n\t} else {\n\t\t// Move the cursor to the end of the previous line.\n\t\t// This can be done by moving the cursor to the start of the line and\n\t\t// then subtracting 2 to account for the trailing space we keep on\n\t\t// soft-wrapped lines.\n\t\tm.col = li.StartColumn - 2\n\t}\n\n\tnli := m.LineInfo()\n\tm.col = nli.StartColumn\n\n\tif nli.Width <= 0 {\n\t\treturn\n\t}\n\n\toffset := 0\n\tfor offset < charOffset {\n\t\tif m.col >= len(m.value[m.row]) || offset >= nli.CharWidth-1 {\n\t\t\tbreak\n\t\t}\n\t\toffset += rw.RuneWidth(m.value[m.row][m.col])\n\t\tm.col++\n\t}\n}\n\n// SetCursor moves the cursor to the given position. If the position is\n// out of bounds the cursor will be moved to the start or end accordingly.\nfunc (m *Model) SetCursor(col int) {\n\tm.col = clamp(col, 0, len(m.value[m.row]))\n\t// Any time that we move the cursor horizontally we need to reset the last\n\t// offset so that the horizontal position when navigating is adjusted.\n\tm.lastCharOffset = 0\n}\n\n// CursorStart moves the cursor to the start of the input field.\nfunc (m *Model) CursorStart() {\n\tm.SetCursor(0)\n}\n\n// CursorEnd moves the cursor to the end of the input field.\nfunc (m *Model) CursorEnd() {\n\tm.SetCursor(len(m.value[m.row]))\n}\n\n// Focused returns the focus state on the model.\nfunc (m Model) Focused() bool {\n\treturn m.focus\n}\n\n// Focus sets the focus state on the model. When the model is in focus it can\n// receive keyboard input and the cursor will be hidden.\nfunc (m *Model) Focus() tea.Cmd {\n\tm.focus = true\n\tm.style = &m.FocusedStyle\n\treturn m.Cursor.Focus()\n}\n\n// Blur removes the focus state on the model. When the model is blurred it can\n// not receive keyboard input and the cursor will be hidden.\nfunc (m *Model) Blur() {\n\tm.focus = false\n\tm.style = &m.BlurredStyle\n\tm.Cursor.Blur()\n}\n\n// Reset sets the input to its default state with no input.\nfunc (m *Model) Reset() {\n\tstartCap := m.MaxHeight\n\tif startCap <= 0 {\n\t\tstartCap = defaultMaxHeight\n\t}\n\tm.value = make([][]rune, minHeight, startCap)\n\tm.col = 0\n\tm.row = 0\n\tm.viewport.GotoTop()\n\tm.SetCursor(0)\n}\n\n// san initializes or retrieves the rune sanitizer.\nfunc (m *Model) san() runeutil.Sanitizer {\n\tif m.rsan == nil {\n\t\t// Textinput has all its input on a single line so collapse\n\t\t// newlines/tabs to single spaces.\n\t\tm.rsan = runeutil.NewSanitizer()\n\t}\n\treturn m.rsan\n}\n\n// deleteBeforeCursor deletes all text before the cursor. Returns whether or\n// not the cursor blink should be reset.\nfunc (m *Model) deleteBeforeCursor() {\n\tm.value[m.row] = m.value[m.row][m.col:]\n\tm.SetCursor(0)\n}\n\n// deleteAfterCursor deletes all text after the cursor. Returns whether or not\n// the cursor blink should be reset. If input is masked delete everything after\n// the cursor so as not to reveal word breaks in the masked input.\nfunc (m *Model) deleteAfterCursor() {\n\tm.value[m.row] = m.value[m.row][:m.col]\n\tm.SetCursor(len(m.value[m.row]))\n}\n\n// transposeLeft exchanges the runes at the cursor and immediately\n// before. No-op if the cursor is at the beginning of the line.  If\n// the cursor is not at the end of the line yet, moves the cursor to\n// the right.\nfunc (m *Model) transposeLeft() {\n\tif m.col == 0 || len(m.value[m.row]) < 2 {\n\t\treturn\n\t}\n\tif m.col >= len(m.value[m.row]) {\n\t\tm.SetCursor(m.col - 1)\n\t}\n\tm.value[m.row][m.col-1], m.value[m.row][m.col] = m.value[m.row][m.col], m.value[m.row][m.col-1]\n\tif m.col < len(m.value[m.row]) {\n\t\tm.SetCursor(m.col + 1)\n\t}\n}\n\n// deleteWordLeft deletes the word left to the cursor. Returns whether or not\n// the cursor blink should be reset.\nfunc (m *Model) deleteWordLeft() {\n\tif m.col == 0 || len(m.value[m.row]) == 0 {\n\t\treturn\n\t}\n\n\t// Linter note: it's critical that we acquire the initial cursor position\n\t// here prior to altering it via SetCursor() below. As such, moving this\n\t// call into the corresponding if clause does not apply here.\n\toldCol := m.col //nolint:ifshort\n\n\tm.SetCursor(m.col - 1)\n\tfor unicode.IsSpace(m.value[m.row][m.col]) {\n\t\tif m.col <= 0 {\n\t\t\tbreak\n\t\t}\n\t\t// ignore series of whitespace before cursor\n\t\tm.SetCursor(m.col - 1)\n\t}\n\n\tfor m.col > 0 {\n\t\tif !unicode.IsSpace(m.value[m.row][m.col]) {\n\t\t\tm.SetCursor(m.col - 1)\n\t\t} else {\n\t\t\tif m.col > 0 {\n\t\t\t\t// keep the previous space\n\t\t\t\tm.SetCursor(m.col + 1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif oldCol > len(m.value[m.row]) {\n\t\tm.value[m.row] = m.value[m.row][:m.col]\n\t} else {\n\t\tm.value[m.row] = append(m.value[m.row][:m.col], m.value[m.row][oldCol:]...)\n\t}\n}\n\n// deleteWordRight deletes the word right to the cursor.\nfunc (m *Model) deleteWordRight() {\n\tif m.col >= len(m.value[m.row]) || len(m.value[m.row]) == 0 {\n\t\treturn\n\t}\n\n\toldCol := m.col\n\n\tfor m.col < len(m.value[m.row]) && unicode.IsSpace(m.value[m.row][m.col]) {\n\t\t// ignore series of whitespace after cursor\n\t\tm.SetCursor(m.col + 1)\n\t}\n\n\tfor m.col < len(m.value[m.row]) {\n\t\tif !unicode.IsSpace(m.value[m.row][m.col]) {\n\t\t\tm.SetCursor(m.col + 1)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif m.col > len(m.value[m.row]) {\n\t\tm.value[m.row] = m.value[m.row][:oldCol]\n\t} else {\n\t\tm.value[m.row] = append(m.value[m.row][:oldCol], m.value[m.row][m.col:]...)\n\t}\n\n\tm.SetCursor(oldCol)\n}\n\n// characterRight moves the cursor one character to the right.\nfunc (m *Model) characterRight() {\n\tif m.col < len(m.value[m.row]) {\n\t\tm.SetCursor(m.col + 1)\n\t} else {\n\t\tif m.row < len(m.value)-1 {\n\t\t\tm.row++\n\t\t\tm.CursorStart()\n\t\t}\n\t}\n}\n\n// characterLeft moves the cursor one character to the left.\n// If insideLine is set, the cursor is moved to the last\n// character in the previous line, instead of one past that.\nfunc (m *Model) characterLeft(insideLine bool) {\n\tif m.col == 0 && m.row != 0 {\n\t\tm.row--\n\t\tm.CursorEnd()\n\t\tif !insideLine {\n\t\t\treturn\n\t\t}\n\t}\n\tif m.col > 0 {\n\t\tm.SetCursor(m.col - 1)\n\t}\n}\n\n// wordLeft moves the cursor one word to the left. Returns whether or not the\n// cursor blink should be reset. If input is masked, move input to the start\n// so as not to reveal word breaks in the masked input.\nfunc (m *Model) wordLeft() {\n\tfor {\n\t\tm.characterLeft(true /* insideLine */)\n\t\tif m.col < len(m.value[m.row]) && !unicode.IsSpace(m.value[m.row][m.col]) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor m.col > 0 {\n\t\tif unicode.IsSpace(m.value[m.row][m.col-1]) {\n\t\t\tbreak\n\t\t}\n\t\tm.SetCursor(m.col - 1)\n\t}\n}\n\n// wordRight moves the cursor one word to the right. Returns whether or not the\n// cursor blink should be reset. If the input is masked, move input to the end\n// so as not to reveal word breaks in the masked input.\nfunc (m *Model) wordRight() {\n\tm.doWordRight(func(int, int) { /* nothing */ })\n}\n\nfunc (m *Model) doWordRight(fn func(charIdx int, pos int)) {\n\t// Skip spaces forward.\n\tfor m.col >= len(m.value[m.row]) || unicode.IsSpace(m.value[m.row][m.col]) {\n\t\tif m.row == len(m.value)-1 && m.col == len(m.value[m.row]) {\n\t\t\t// End of text.\n\t\t\tbreak\n\t\t}\n\t\tm.characterRight()\n\t}\n\n\tcharIdx := 0\n\tfor m.col < len(m.value[m.row]) {\n\t\tif unicode.IsSpace(m.value[m.row][m.col]) {\n\t\t\tbreak\n\t\t}\n\t\tfn(charIdx, m.col)\n\t\tm.SetCursor(m.col + 1)\n\t\tcharIdx++\n\t}\n}\n\n// uppercaseRight changes the word to the right to uppercase.\nfunc (m *Model) uppercaseRight() {\n\tm.doWordRight(func(_ int, i int) {\n\t\tm.value[m.row][i] = unicode.ToUpper(m.value[m.row][i])\n\t})\n}\n\n// lowercaseRight changes the word to the right to lowercase.\nfunc (m *Model) lowercaseRight() {\n\tm.doWordRight(func(_ int, i int) {\n\t\tm.value[m.row][i] = unicode.ToLower(m.value[m.row][i])\n\t})\n}\n\n// capitalizeRight changes the word to the right to title case.\nfunc (m *Model) capitalizeRight() {\n\tm.doWordRight(func(charIdx int, i int) {\n\t\tif charIdx == 0 {\n\t\t\tm.value[m.row][i] = unicode.ToTitle(m.value[m.row][i])\n\t\t}\n\t})\n}\n\n// LineInfo returns the number of characters from the start of the\n// (soft-wrapped) line and the (soft-wrapped) line width.\nfunc (m Model) LineInfo() LineInfo {\n\tgrid := m.memoizedWrap(m.value[m.row], m.width)\n\n\t// Find out which line we are currently on. This can be determined by the\n\t// m.col and counting the number of runes that we need to skip.\n\tvar counter int\n\tfor i, line := range grid {\n\t\t// We've found the line that we are on\n\t\tif counter+len(line) == m.col && i+1 < len(grid) {\n\t\t\t// We wrap around to the next line if we are at the end of the\n\t\t\t// previous line so that we can be at the very beginning of the row\n\t\t\treturn LineInfo{\n\t\t\t\tCharOffset:   0,\n\t\t\t\tColumnOffset: 0,\n\t\t\t\tHeight:       len(grid),\n\t\t\t\tRowOffset:    i + 1,\n\t\t\t\tStartColumn:  m.col,\n\t\t\t\tWidth:        len(grid[i+1]),\n\t\t\t\tCharWidth:    uniseg.StringWidth(string(line)),\n\t\t\t}\n\t\t}\n\n\t\tif counter+len(line) >= m.col {\n\t\t\treturn LineInfo{\n\t\t\t\tCharOffset:   uniseg.StringWidth(string(line[:max(0, m.col-counter)])),\n\t\t\t\tColumnOffset: m.col - counter,\n\t\t\t\tHeight:       len(grid),\n\t\t\t\tRowOffset:    i,\n\t\t\t\tStartColumn:  counter,\n\t\t\t\tWidth:        len(line),\n\t\t\t\tCharWidth:    uniseg.StringWidth(string(line)),\n\t\t\t}\n\t\t}\n\n\t\tcounter += len(line)\n\t}\n\treturn LineInfo{}\n}\n\n// repositionView repositions the view of the viewport based on the defined\n// scrolling behavior.\nfunc (m *Model) repositionView() {\n\tmin := m.viewport.YOffset\n\tmax := min + m.viewport.Height - 1\n\n\tif row := m.cursorLineNumber(); row < min {\n\t\tm.viewport.LineUp(min - row)\n\t} else if row > max {\n\t\tm.viewport.LineDown(row - max)\n\t}\n}\n\n// Width returns the width of the textarea.\nfunc (m Model) Width() int {\n\treturn m.width\n}\n\n// moveToBegin moves the cursor to the beginning of the input.\nfunc (m *Model) moveToBegin() {\n\tm.row = 0\n\tm.SetCursor(0)\n}\n\n// moveToEnd moves the cursor to the end of the input.\nfunc (m *Model) moveToEnd() {\n\tm.row = len(m.value) - 1\n\tm.SetCursor(len(m.value[m.row]))\n}\n\n// SetWidth sets the width of the textarea to fit exactly within the given width.\n// This means that the textarea will account for the width of the prompt and\n// whether or not line numbers are being shown.\n//\n// Ensure that SetWidth is called after setting the Prompt and ShowLineNumbers,\n// It is important that the width of the textarea be exactly the given width\n// and no more.\nfunc (m *Model) SetWidth(w int) {\n\t// Update prompt width only if there is no prompt function as SetPromptFunc\n\t// updates the prompt width when it is called.\n\tif m.promptFunc == nil {\n\t\tm.promptWidth = uniseg.StringWidth(m.Prompt)\n\t}\n\n\t// Add base style borders and padding to reserved outer width.\n\treservedOuter := m.style.Base.GetHorizontalFrameSize()\n\n\t// Add prompt width to reserved inner width.\n\treservedInner := m.promptWidth\n\n\t// Add line number width to reserved inner width.\n\tif m.ShowLineNumbers {\n\t\tconst lnWidth = 4 // Up to 3 digits for line number plus 1 margin.\n\t\treservedInner += lnWidth\n\t}\n\n\t// Input width must be at least one more than the reserved inner and outer\n\t// width. This gives us a minimum input width of 1.\n\tminWidth := reservedInner + reservedOuter + 1\n\tinputWidth := max(w, minWidth)\n\n\t// Input width must be no more than maximum width.\n\tif m.MaxWidth > 0 {\n\t\tinputWidth = min(inputWidth, m.MaxWidth)\n\t}\n\n\t// Since the width of the viewport and input area is dependent on the width of\n\t// borders, prompt and line numbers, we need to calculate it by subtracting\n\t// the reserved width from them.\n\n\tm.viewport.Width = inputWidth - reservedOuter\n\tm.width = inputWidth - reservedOuter - reservedInner\n}\n\n// SetPromptFunc supersedes the Prompt field and sets a dynamic prompt\n// instead.\n// If the function returns a prompt that is shorter than the\n// specified promptWidth, it will be padded to the left.\n// If it returns a prompt that is longer, display artifacts\n// may occur; the caller is responsible for computing an adequate\n// promptWidth.\nfunc (m *Model) SetPromptFunc(promptWidth int, fn func(lineIdx int) string) {\n\tm.promptFunc = fn\n\tm.promptWidth = promptWidth\n}\n\n// Height returns the current height of the textarea.\nfunc (m Model) Height() int {\n\treturn m.height\n}\n\n// SetHeight sets the height of the textarea.\nfunc (m *Model) SetHeight(h int) {\n\tif m.MaxHeight > 0 {\n\t\tm.height = clamp(h, minHeight, m.MaxHeight)\n\t\tm.viewport.Height = clamp(h, minHeight, m.MaxHeight)\n\t} else {\n\t\tm.height = max(h, minHeight)\n\t\tm.viewport.Height = max(h, minHeight)\n\t}\n}\n\n// Update is the Bubble Tea update loop.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tif !m.focus {\n\t\tm.Cursor.Blur()\n\t\treturn m, nil\n\t}\n\n\t// Used to determine if the cursor should blink.\n\toldRow, oldCol := m.cursorLineNumber(), m.col\n\n\tvar cmds []tea.Cmd\n\n\tif m.value[m.row] == nil {\n\t\tm.value[m.row] = make([]rune, 0)\n\t}\n\n\tif m.MaxHeight > 0 && m.MaxHeight != m.cache.Capacity() {\n\t\tm.cache = memoization.NewMemoCache[line, [][]rune](m.MaxHeight)\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, m.KeyMap.DeleteAfterCursor):\n\t\t\tm.col = clamp(m.col, 0, len(m.value[m.row]))\n\t\t\tif m.col >= len(m.value[m.row]) {\n\t\t\t\tm.mergeLineBelow(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.deleteAfterCursor()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteBeforeCursor):\n\t\t\tm.col = clamp(m.col, 0, len(m.value[m.row]))\n\t\t\tif m.col <= 0 {\n\t\t\t\tm.mergeLineAbove(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.deleteBeforeCursor()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteCharacterBackward):\n\t\t\tm.col = clamp(m.col, 0, len(m.value[m.row]))\n\t\t\tif m.col <= 0 {\n\t\t\t\tm.mergeLineAbove(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif len(m.value[m.row]) > 0 {\n\t\t\t\tm.value[m.row] = append(m.value[m.row][:max(0, m.col-1)], m.value[m.row][m.col:]...)\n\t\t\t\tif m.col > 0 {\n\t\t\t\t\tm.SetCursor(m.col - 1)\n\t\t\t\t}\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.DeleteCharacterForward):\n\t\t\tif len(m.value[m.row]) > 0 && m.col < len(m.value[m.row]) {\n\t\t\t\tm.value[m.row] = append(m.value[m.row][:m.col], m.value[m.row][m.col+1:]...)\n\t\t\t}\n\t\t\tif m.col >= len(m.value[m.row]) {\n\t\t\t\tm.mergeLineBelow(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.DeleteWordBackward):\n\t\t\tif m.col <= 0 {\n\t\t\t\tm.mergeLineAbove(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.deleteWordLeft()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteWordForward):\n\t\t\tm.col = clamp(m.col, 0, len(m.value[m.row]))\n\t\t\tif m.col >= len(m.value[m.row]) {\n\t\t\t\tm.mergeLineBelow(m.row)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.deleteWordRight()\n\t\tcase key.Matches(msg, m.KeyMap.InsertNewline):\n\t\t\tif m.MaxHeight > 0 && len(m.value) >= m.MaxHeight {\n\t\t\t\treturn m, nil\n\t\t\t}\n\t\t\tm.col = clamp(m.col, 0, len(m.value[m.row]))\n\t\t\tm.splitLine(m.row, m.col)\n\t\tcase key.Matches(msg, m.KeyMap.LineEnd):\n\t\t\tm.CursorEnd()\n\t\tcase key.Matches(msg, m.KeyMap.LineStart):\n\t\t\tm.CursorStart()\n\t\tcase key.Matches(msg, m.KeyMap.CharacterForward):\n\t\t\tm.characterRight()\n\t\tcase key.Matches(msg, m.KeyMap.LineNext):\n\t\t\tm.CursorDown()\n\t\tcase key.Matches(msg, m.KeyMap.WordForward):\n\t\t\tm.wordRight()\n\t\tcase key.Matches(msg, m.KeyMap.Paste):\n\t\t\treturn m, Paste\n\t\tcase key.Matches(msg, m.KeyMap.CharacterBackward):\n\t\t\tm.characterLeft(false /* insideLine */)\n\t\tcase key.Matches(msg, m.KeyMap.LinePrevious):\n\t\t\tm.CursorUp()\n\t\tcase key.Matches(msg, m.KeyMap.WordBackward):\n\t\t\tm.wordLeft()\n\t\tcase key.Matches(msg, m.KeyMap.InputBegin):\n\t\t\tm.moveToBegin()\n\t\tcase key.Matches(msg, m.KeyMap.InputEnd):\n\t\t\tm.moveToEnd()\n\t\tcase key.Matches(msg, m.KeyMap.LowercaseWordForward):\n\t\t\tm.lowercaseRight()\n\t\tcase key.Matches(msg, m.KeyMap.UppercaseWordForward):\n\t\t\tm.uppercaseRight()\n\t\tcase key.Matches(msg, m.KeyMap.CapitalizeWordForward):\n\t\t\tm.capitalizeRight()\n\t\tcase key.Matches(msg, m.KeyMap.TransposeCharacterBackward):\n\t\t\tm.transposeLeft()\n\n\t\tdefault:\n\t\t\tm.insertRunesFromUserInput(msg.Runes)\n\t\t}\n\n\tcase pasteMsg:\n\t\tm.insertRunesFromUserInput([]rune(msg))\n\n\tcase pasteErrMsg:\n\t\tm.Err = msg\n\t}\n\n\tvp, cmd := m.viewport.Update(msg)\n\tm.viewport = &vp\n\tcmds = append(cmds, cmd)\n\n\tnewRow, newCol := m.cursorLineNumber(), m.col\n\tm.Cursor, cmd = m.Cursor.Update(msg)\n\tif (newRow != oldRow || newCol != oldCol) && m.Cursor.Mode() == cursor.CursorBlink {\n\t\tm.Cursor.Blink = false\n\t\tcmd = m.Cursor.BlinkCmd()\n\t}\n\tcmds = append(cmds, cmd)\n\n\tm.repositionView()\n\n\treturn m, tea.Batch(cmds...)\n}\n\n// View renders the text area in its current state.\nfunc (m Model) View() string {\n\tif m.Value() == \"\" && m.row == 0 && m.col == 0 && m.Placeholder != \"\" {\n\t\treturn m.placeholderView()\n\t}\n\tm.Cursor.TextStyle = m.style.computedCursorLine()\n\n\tvar (\n\t\ts                strings.Builder\n\t\tstyle            lipgloss.Style\n\t\tnewLines         int\n\t\twidestLineNumber int\n\t\tlineInfo         = m.LineInfo()\n\t)\n\n\tdisplayLine := 0\n\tfor l, line := range m.value {\n\t\twrappedLines := m.memoizedWrap(line, m.width)\n\n\t\tif m.row == l {\n\t\t\tstyle = m.style.computedCursorLine()\n\t\t} else {\n\t\t\tstyle = m.style.computedText()\n\t\t}\n\n\t\tfor wl, wrappedLine := range wrappedLines {\n\t\t\tprompt := m.getPromptString(displayLine)\n\t\t\tprompt = m.style.computedPrompt().Render(prompt)\n\t\t\ts.WriteString(style.Render(prompt))\n\t\t\tdisplayLine++\n\n\t\t\tvar ln string\n\t\t\tif m.ShowLineNumbers {\n\t\t\t\tif wl == 0 {\n\t\t\t\t\tif m.row == l {\n\t\t\t\t\t\tln = style.Render(m.style.computedCursorLineNumber().Render(m.formatLineNumber(l + 1)))\n\t\t\t\t\t\ts.WriteString(ln)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tln = style.Render(m.style.computedLineNumber().Render(m.formatLineNumber(l + 1)))\n\t\t\t\t\t\ts.WriteString(ln)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif m.row == l {\n\t\t\t\t\t\tln = style.Render(m.style.computedCursorLineNumber().Render(m.formatLineNumber(\" \")))\n\t\t\t\t\t\ts.WriteString(ln)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tln = style.Render(m.style.computedLineNumber().Render(m.formatLineNumber(\" \")))\n\t\t\t\t\t\ts.WriteString(ln)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Note the widest line number for padding purposes later.\n\t\t\tlnw := lipgloss.Width(ln)\n\t\t\tif lnw > widestLineNumber {\n\t\t\t\twidestLineNumber = lnw\n\t\t\t}\n\n\t\t\tstrwidth := uniseg.StringWidth(string(wrappedLine))\n\t\t\tpadding := m.width - strwidth\n\t\t\t// If the trailing space causes the line to be wider than the\n\t\t\t// width, we should not draw it to the screen since it will result\n\t\t\t// in an extra space at the end of the line which can look off when\n\t\t\t// the cursor line is showing.\n\t\t\tif strwidth > m.width {\n\t\t\t\t// The character causing the line to be wider than the width is\n\t\t\t\t// guaranteed to be a space since any other character would\n\t\t\t\t// have been wrapped.\n\t\t\t\twrappedLine = []rune(strings.TrimSuffix(string(wrappedLine), \" \"))\n\t\t\t\tpadding -= m.width - strwidth\n\t\t\t}\n\t\t\tif m.row == l && lineInfo.RowOffset == wl {\n\t\t\t\ts.WriteString(style.Render(string(wrappedLine[:lineInfo.ColumnOffset])))\n\t\t\t\tif m.col >= len(line) && lineInfo.CharOffset >= m.width {\n\t\t\t\t\tm.Cursor.SetChar(\" \")\n\t\t\t\t\ts.WriteString(m.Cursor.View())\n\t\t\t\t} else {\n\t\t\t\t\tm.Cursor.SetChar(string(wrappedLine[lineInfo.ColumnOffset]))\n\t\t\t\t\ts.WriteString(style.Render(m.Cursor.View()))\n\t\t\t\t\ts.WriteString(style.Render(string(wrappedLine[lineInfo.ColumnOffset+1:])))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ts.WriteString(style.Render(string(wrappedLine)))\n\t\t\t}\n\t\t\ts.WriteString(style.Render(strings.Repeat(\" \", max(0, padding))))\n\t\t\ts.WriteRune('\\n')\n\t\t\tnewLines++\n\t\t}\n\t}\n\n\t// Always show at least `m.Height` lines at all times.\n\t// To do this we can simply pad out a few extra new lines in the view.\n\tfor i := 0; i < m.height; i++ {\n\t\tprompt := m.getPromptString(displayLine)\n\t\tprompt = m.style.computedPrompt().Render(prompt)\n\t\ts.WriteString(prompt)\n\t\tdisplayLine++\n\n\t\t// Write end of buffer content\n\t\tleftGutter := string(m.EndOfBufferCharacter)\n\t\trightGapWidth := m.Width() - lipgloss.Width(leftGutter) + widestLineNumber\n\t\trightGap := strings.Repeat(\" \", max(0, rightGapWidth))\n\t\ts.WriteString(m.style.computedEndOfBuffer().Render(leftGutter + rightGap))\n\t\ts.WriteRune('\\n')\n\t}\n\n\tm.viewport.SetContent(s.String())\n\treturn m.style.Base.Render(m.viewport.View())\n}\n\n// formatLineNumber formats the line number for display dynamically based on\n// the maximum number of lines\nfunc (m Model) formatLineNumber(x any) string {\n\t// XXX: ultimately we should use a max buffer height, which has yet to be\n\t// implemented.\n\tdigits := len(strconv.Itoa(m.MaxHeight))\n\treturn fmt.Sprintf(\" %*v \", digits, x)\n}\n\nfunc (m Model) getPromptString(displayLine int) (prompt string) {\n\tprompt = m.Prompt\n\tif m.promptFunc == nil {\n\t\treturn prompt\n\t}\n\tprompt = m.promptFunc(displayLine)\n\tpl := uniseg.StringWidth(prompt)\n\tif pl < m.promptWidth {\n\t\tprompt = fmt.Sprintf(\"%*s%s\", m.promptWidth-pl, \"\", prompt)\n\t}\n\treturn prompt\n}\n\n// placeholderView returns the prompt and placeholder view, if any.\nfunc (m Model) placeholderView() string {\n\tvar (\n\t\ts     strings.Builder\n\t\tp     = m.Placeholder\n\t\tstyle = m.style.computedPlaceholder()\n\t)\n\n\t// word wrap lines\n\tpwordwrap := ansi.Wordwrap(p, m.width, \"\")\n\t// wrap lines (handles lines that could not be word wrapped)\n\tpwrap := ansi.Hardwrap(pwordwrap, m.width, true)\n\t// split string by new lines\n\tplines := strings.Split(strings.TrimSpace(pwrap), \"\\n\")\n\n\tfor i := 0; i < m.height; i++ {\n\t\tlineStyle := m.style.computedPlaceholder()\n\t\tlineNumberStyle := m.style.computedLineNumber()\n\t\tif len(plines) > i {\n\t\t\tlineStyle = m.style.computedCursorLine()\n\t\t\tlineNumberStyle = m.style.computedCursorLineNumber()\n\t\t}\n\n\t\t// render prompt\n\t\tprompt := m.getPromptString(i)\n\t\tprompt = m.style.computedPrompt().Render(prompt)\n\t\ts.WriteString(lineStyle.Render(prompt))\n\n\t\t// when show line numbers enabled:\n\t\t// - render line number for only the cursor line\n\t\t// - indent other placeholder lines\n\t\t// this is consistent with vim with line numbers enabled\n\t\tif m.ShowLineNumbers {\n\t\t\tvar ln string\n\n\t\t\tswitch {\n\t\t\tcase i == 0:\n\t\t\t\tln = strconv.Itoa(i + 1)\n\t\t\t\tfallthrough\n\t\t\tcase len(plines) > i:\n\t\t\t\ts.WriteString(lineStyle.Render(lineNumberStyle.Render(m.formatLineNumber(ln))))\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\n\t\tswitch {\n\t\t// first line\n\t\tcase i == 0:\n\t\t\t// first character of first line as cursor with character\n\t\t\tm.Cursor.TextStyle = m.style.computedPlaceholder()\n\t\t\tm.Cursor.SetChar(string(plines[0][0]))\n\t\t\ts.WriteString(lineStyle.Render(m.Cursor.View()))\n\n\t\t\t// the rest of the first line\n\t\t\ts.WriteString(lineStyle.Render(style.Render(plines[0][1:] + strings.Repeat(\" \", max(0, m.width-uniseg.StringWidth(plines[0]))))))\n\t\t// remaining lines\n\t\tcase len(plines) > i:\n\t\t\t// current line placeholder text\n\t\t\tif len(plines) > i {\n\t\t\t\ts.WriteString(lineStyle.Render(style.Render(plines[i] + strings.Repeat(\" \", max(0, m.width-uniseg.StringWidth(plines[i]))))))\n\t\t\t}\n\t\tdefault:\n\t\t\t// end of line buffer character\n\t\t\teob := m.style.computedEndOfBuffer().Render(string(m.EndOfBufferCharacter))\n\t\t\ts.WriteString(eob)\n\t\t}\n\n\t\t// terminate with new line\n\t\ts.WriteRune('\\n')\n\t}\n\n\tm.viewport.SetContent(s.String())\n\treturn m.style.Base.Render(m.viewport.View())\n}\n\n// Blink returns the blink command for the cursor.\nfunc Blink() tea.Msg {\n\treturn cursor.Blink()\n}\n\nfunc (m Model) memoizedWrap(runes []rune, width int) [][]rune {\n\tinput := line{runes: runes, width: width}\n\tif v, ok := m.cache.Get(input); ok {\n\t\treturn v\n\t}\n\tv := wrap(runes, width)\n\tm.cache.Set(input, v)\n\treturn v\n}\n\n// cursorLineNumber returns the line number that the cursor is on.\n// This accounts for soft wrapped lines.\nfunc (m Model) cursorLineNumber() int {\n\tline := 0\n\tfor i := 0; i < m.row; i++ {\n\t\t// Calculate the number of lines that the current line will be split\n\t\t// into.\n\t\tline += len(m.memoizedWrap(m.value[i], m.width))\n\t}\n\tline += m.LineInfo().RowOffset\n\treturn line\n}\n\n// mergeLineBelow merges the current line the cursor is on with the line below.\nfunc (m *Model) mergeLineBelow(row int) {\n\tif row >= len(m.value)-1 {\n\t\treturn\n\t}\n\n\t// To perform a merge, we will need to combine the two lines and then\n\tm.value[row] = append(m.value[row], m.value[row+1]...)\n\n\t// Shift all lines up by one\n\tfor i := row + 1; i < len(m.value)-1; i++ {\n\t\tm.value[i] = m.value[i+1]\n\t}\n\n\t// And, remove the last line\n\tif len(m.value) > 0 {\n\t\tm.value = m.value[:len(m.value)-1]\n\t}\n}\n\n// mergeLineAbove merges the current line the cursor is on with the line above.\nfunc (m *Model) mergeLineAbove(row int) {\n\tif row <= 0 {\n\t\treturn\n\t}\n\n\tm.col = len(m.value[row-1])\n\tm.row = m.row - 1\n\n\t// To perform a merge, we will need to combine the two lines and then\n\tm.value[row-1] = append(m.value[row-1], m.value[row]...)\n\n\t// Shift all lines up by one\n\tfor i := row; i < len(m.value)-1; i++ {\n\t\tm.value[i] = m.value[i+1]\n\t}\n\n\t// And, remove the last line\n\tif len(m.value) > 0 {\n\t\tm.value = m.value[:len(m.value)-1]\n\t}\n}\n\nfunc (m *Model) splitLine(row, col int) {\n\t// To perform a split, take the current line and keep the content before\n\t// the cursor, take the content after the cursor and make it the content of\n\t// the line underneath, and shift the remaining lines down by one\n\thead, tailSrc := m.value[row][:col], m.value[row][col:]\n\ttail := make([]rune, len(tailSrc))\n\tcopy(tail, tailSrc)\n\n\tm.value = append(m.value[:row+1], m.value[row:]...)\n\n\tm.value[row] = head\n\tm.value[row+1] = tail\n\n\tm.col = 0\n\tm.row++\n}\n\n// Paste is a command for pasting from the clipboard into the text input.\nfunc Paste() tea.Msg {\n\tstr, err := clipboard.ReadAll()\n\tif err != nil {\n\t\treturn pasteErrMsg{err}\n\t}\n\treturn pasteMsg(str)\n}\n\nfunc wrap(runes []rune, width int) [][]rune {\n\tvar (\n\t\tlines  = [][]rune{{}}\n\t\tword   = []rune{}\n\t\trow    int\n\t\tspaces int\n\t)\n\n\t// Word wrap the runes\n\tfor _, r := range runes {\n\t\tif unicode.IsSpace(r) {\n\t\t\tspaces++\n\t\t} else {\n\t\t\tword = append(word, r)\n\t\t}\n\n\t\tif spaces > 0 {\n\t\t\tif uniseg.StringWidth(string(lines[row]))+uniseg.StringWidth(string(word))+spaces > width {\n\t\t\t\trow++\n\t\t\t\tlines = append(lines, []rune{})\n\t\t\t\tlines[row] = append(lines[row], word...)\n\t\t\t\tlines[row] = append(lines[row], repeatSpaces(spaces)...)\n\t\t\t\tspaces = 0\n\t\t\t\tword = nil\n\t\t\t} else {\n\t\t\t\tlines[row] = append(lines[row], word...)\n\t\t\t\tlines[row] = append(lines[row], repeatSpaces(spaces)...)\n\t\t\t\tspaces = 0\n\t\t\t\tword = nil\n\t\t\t}\n\t\t} else {\n\t\t\t// If the last character is a double-width rune, then we may not be able to add it to this line\n\t\t\t// as it might cause us to go past the width.\n\t\t\tlastCharLen := rw.RuneWidth(word[len(word)-1])\n\t\t\tif uniseg.StringWidth(string(word))+lastCharLen > width {\n\t\t\t\t// If the current line has any content, let's move to the next\n\t\t\t\t// line because the current word fills up the entire line.\n\t\t\t\tif len(lines[row]) > 0 {\n\t\t\t\t\trow++\n\t\t\t\t\tlines = append(lines, []rune{})\n\t\t\t\t}\n\t\t\t\tlines[row] = append(lines[row], word...)\n\t\t\t\tword = nil\n\t\t\t}\n\t\t}\n\t}\n\n\tif uniseg.StringWidth(string(lines[row]))+uniseg.StringWidth(string(word))+spaces >= width {\n\t\tlines = append(lines, []rune{})\n\t\tlines[row+1] = append(lines[row+1], word...)\n\t\t// We add an extra space at the end of the line to account for the\n\t\t// trailing space at the end of the previous soft-wrapped lines so that\n\t\t// behaviour when navigating is consistent and so that we don't need to\n\t\t// continually add edges to handle the last line of the wrapped input.\n\t\tspaces++\n\t\tlines[row+1] = append(lines[row+1], repeatSpaces(spaces)...)\n\t} else {\n\t\tlines[row] = append(lines[row], word...)\n\t\tspaces++\n\t\tlines[row] = append(lines[row], repeatSpaces(spaces)...)\n\t}\n\n\treturn lines\n}\n\nfunc repeatSpaces(n int) []rune {\n\treturn []rune(strings.Repeat(string(' '), n))\n}\n\nfunc clamp(v, low, high int) int {\n\tif high < low {\n\t\tlow, high = high, low\n\t}\n\treturn min(high, max(low, v))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/textinput/textinput.go",
    "content": "package textinput\n\nimport (\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n\t\"unicode\"\n\n\t\"github.com/atotto/clipboard\"\n\t\"github.com/charmbracelet/bubbles/cursor\"\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/runeutil\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n\trw \"github.com/mattn/go-runewidth\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// Internal messages for clipboard operations.\ntype (\n\tpasteMsg    string\n\tpasteErrMsg struct{ error }\n)\n\n// EchoMode sets the input behavior of the text input field.\ntype EchoMode int\n\nconst (\n\t// EchoNormal displays text as is. This is the default behavior.\n\tEchoNormal EchoMode = iota\n\n\t// EchoPassword displays the EchoCharacter mask instead of actual\n\t// characters. This is commonly used for password fields.\n\tEchoPassword\n\n\t// EchoNone displays nothing as characters are entered. This is commonly\n\t// seen for password fields on the command line.\n\tEchoNone\n)\n\n// ValidateFunc is a function that returns an error if the input is invalid.\ntype ValidateFunc func(string) error\n\n// KeyMap is the key bindings for different actions within the textinput.\ntype KeyMap struct {\n\tCharacterForward        key.Binding\n\tCharacterBackward       key.Binding\n\tWordForward             key.Binding\n\tWordBackward            key.Binding\n\tDeleteWordBackward      key.Binding\n\tDeleteWordForward       key.Binding\n\tDeleteAfterCursor       key.Binding\n\tDeleteBeforeCursor      key.Binding\n\tDeleteCharacterBackward key.Binding\n\tDeleteCharacterForward  key.Binding\n\tLineStart               key.Binding\n\tLineEnd                 key.Binding\n\tPaste                   key.Binding\n\tAcceptSuggestion        key.Binding\n\tNextSuggestion          key.Binding\n\tPrevSuggestion          key.Binding\n}\n\n// DefaultKeyMap is the default set of key bindings for navigating and acting\n// upon the textinput.\nvar DefaultKeyMap = KeyMap{\n\tCharacterForward:        key.NewBinding(key.WithKeys(\"right\", \"ctrl+f\")),\n\tCharacterBackward:       key.NewBinding(key.WithKeys(\"left\", \"ctrl+b\")),\n\tWordForward:             key.NewBinding(key.WithKeys(\"alt+right\", \"ctrl+right\", \"alt+f\")),\n\tWordBackward:            key.NewBinding(key.WithKeys(\"alt+left\", \"ctrl+left\", \"alt+b\")),\n\tDeleteWordBackward:      key.NewBinding(key.WithKeys(\"alt+backspace\", \"ctrl+w\")),\n\tDeleteWordForward:       key.NewBinding(key.WithKeys(\"alt+delete\", \"alt+d\")),\n\tDeleteAfterCursor:       key.NewBinding(key.WithKeys(\"ctrl+k\")),\n\tDeleteBeforeCursor:      key.NewBinding(key.WithKeys(\"ctrl+u\")),\n\tDeleteCharacterBackward: key.NewBinding(key.WithKeys(\"backspace\", \"ctrl+h\")),\n\tDeleteCharacterForward:  key.NewBinding(key.WithKeys(\"delete\", \"ctrl+d\")),\n\tLineStart:               key.NewBinding(key.WithKeys(\"home\", \"ctrl+a\")),\n\tLineEnd:                 key.NewBinding(key.WithKeys(\"end\", \"ctrl+e\")),\n\tPaste:                   key.NewBinding(key.WithKeys(\"ctrl+v\")),\n\tAcceptSuggestion:        key.NewBinding(key.WithKeys(\"tab\")),\n\tNextSuggestion:          key.NewBinding(key.WithKeys(\"down\", \"ctrl+n\")),\n\tPrevSuggestion:          key.NewBinding(key.WithKeys(\"up\", \"ctrl+p\")),\n}\n\n// Model is the Bubble Tea model for this text input element.\ntype Model struct {\n\tErr error\n\n\t// General settings.\n\tPrompt        string\n\tPlaceholder   string\n\tEchoMode      EchoMode\n\tEchoCharacter rune\n\tCursor        cursor.Model\n\n\t// Deprecated: use [cursor.BlinkSpeed] instead.\n\tBlinkSpeed time.Duration\n\n\t// Styles. These will be applied as inline styles.\n\t//\n\t// For an introduction to styling with Lip Gloss see:\n\t// https://github.com/charmbracelet/lipgloss\n\tPromptStyle      lipgloss.Style\n\tTextStyle        lipgloss.Style\n\tPlaceholderStyle lipgloss.Style\n\tCompletionStyle  lipgloss.Style\n\n\t// Deprecated: use Cursor.Style instead.\n\tCursorStyle lipgloss.Style\n\n\t// CharLimit is the maximum amount of characters this input element will\n\t// accept. If 0 or less, there's no limit.\n\tCharLimit int\n\n\t// Width is the maximum number of characters that can be displayed at once.\n\t// It essentially treats the text field like a horizontally scrolling\n\t// viewport. If 0 or less this setting is ignored.\n\tWidth int\n\n\t// KeyMap encodes the keybindings recognized by the widget.\n\tKeyMap KeyMap\n\n\t// Underlying text value.\n\tvalue []rune\n\n\t// focus indicates whether user input focus should be on this input\n\t// component. When false, ignore keyboard input and hide the cursor.\n\tfocus bool\n\n\t// Cursor position.\n\tpos int\n\n\t// Used to emulate a viewport when width is set and the content is\n\t// overflowing.\n\toffset      int\n\toffsetRight int\n\n\t// Validate is a function that checks whether or not the text within the\n\t// input is valid. If it is not valid, the `Err` field will be set to the\n\t// error returned by the function. If the function is not defined, all\n\t// input is considered valid.\n\tValidate ValidateFunc\n\n\t// rune sanitizer for input.\n\trsan runeutil.Sanitizer\n\n\t// Should the input suggest to complete\n\tShowSuggestions bool\n\n\t// suggestions is a list of suggestions that may be used to complete the\n\t// input.\n\tsuggestions            [][]rune\n\tmatchedSuggestions     [][]rune\n\tcurrentSuggestionIndex int\n}\n\n// New creates a new model with default settings.\nfunc New() Model {\n\treturn Model{\n\t\tPrompt:           \"> \",\n\t\tEchoCharacter:    '*',\n\t\tCharLimit:        0,\n\t\tPlaceholderStyle: lipgloss.NewStyle().Foreground(lipgloss.Color(\"240\")),\n\t\tShowSuggestions:  false,\n\t\tCompletionStyle:  lipgloss.NewStyle().Foreground(lipgloss.Color(\"240\")),\n\t\tCursor:           cursor.New(),\n\t\tKeyMap:           DefaultKeyMap,\n\n\t\tsuggestions: [][]rune{},\n\t\tvalue:       nil,\n\t\tfocus:       false,\n\t\tpos:         0,\n\t}\n}\n\n// NewModel creates a new model with default settings.\n//\n// Deprecated: Use [New] instead.\nvar NewModel = New\n\n// SetValue sets the value of the text input.\nfunc (m *Model) SetValue(s string) {\n\t// Clean up any special characters in the input provided by the\n\t// caller. This avoids bugs due to e.g. tab characters and whatnot.\n\trunes := m.san().Sanitize([]rune(s))\n\terr := m.validate(runes)\n\tm.setValueInternal(runes, err)\n}\n\nfunc (m *Model) setValueInternal(runes []rune, err error) {\n\tm.Err = err\n\n\tempty := len(m.value) == 0\n\n\tif m.CharLimit > 0 && len(runes) > m.CharLimit {\n\t\tm.value = runes[:m.CharLimit]\n\t} else {\n\t\tm.value = runes\n\t}\n\tif (m.pos == 0 && empty) || m.pos > len(m.value) {\n\t\tm.SetCursor(len(m.value))\n\t}\n\tm.handleOverflow()\n}\n\n// Value returns the value of the text input.\nfunc (m Model) Value() string {\n\treturn string(m.value)\n}\n\n// Position returns the cursor position.\nfunc (m Model) Position() int {\n\treturn m.pos\n}\n\n// SetCursor moves the cursor to the given position. If the position is\n// out of bounds the cursor will be moved to the start or end accordingly.\nfunc (m *Model) SetCursor(pos int) {\n\tm.pos = clamp(pos, 0, len(m.value))\n\tm.handleOverflow()\n}\n\n// CursorStart moves the cursor to the start of the input field.\nfunc (m *Model) CursorStart() {\n\tm.SetCursor(0)\n}\n\n// CursorEnd moves the cursor to the end of the input field.\nfunc (m *Model) CursorEnd() {\n\tm.SetCursor(len(m.value))\n}\n\n// Focused returns the focus state on the model.\nfunc (m Model) Focused() bool {\n\treturn m.focus\n}\n\n// Focus sets the focus state on the model. When the model is in focus it can\n// receive keyboard input and the cursor will be shown.\nfunc (m *Model) Focus() tea.Cmd {\n\tm.focus = true\n\treturn m.Cursor.Focus()\n}\n\n// Blur removes the focus state on the model.  When the model is blurred it can\n// not receive keyboard input and the cursor will be hidden.\nfunc (m *Model) Blur() {\n\tm.focus = false\n\tm.Cursor.Blur()\n}\n\n// Reset sets the input to its default state with no input.\nfunc (m *Model) Reset() {\n\tm.value = nil\n\tm.SetCursor(0)\n}\n\n// SetSuggestions sets the suggestions for the input.\nfunc (m *Model) SetSuggestions(suggestions []string) {\n\tm.suggestions = make([][]rune, len(suggestions))\n\tfor i, s := range suggestions {\n\t\tm.suggestions[i] = []rune(s)\n\t}\n\n\tm.updateSuggestions()\n}\n\n// rsan initializes or retrieves the rune sanitizer.\nfunc (m *Model) san() runeutil.Sanitizer {\n\tif m.rsan == nil {\n\t\t// Textinput has all its input on a single line so collapse\n\t\t// newlines/tabs to single spaces.\n\t\tm.rsan = runeutil.NewSanitizer(\n\t\t\truneutil.ReplaceTabs(\" \"), runeutil.ReplaceNewlines(\" \"))\n\t}\n\treturn m.rsan\n}\n\nfunc (m *Model) insertRunesFromUserInput(v []rune) {\n\t// Clean up any special characters in the input provided by the\n\t// clipboard. This avoids bugs due to e.g. tab characters and\n\t// whatnot.\n\tpaste := m.san().Sanitize(v)\n\n\tvar availSpace int\n\tif m.CharLimit > 0 {\n\t\tavailSpace = m.CharLimit - len(m.value)\n\n\t\t// If the char limit's been reached, cancel.\n\t\tif availSpace <= 0 {\n\t\t\treturn\n\t\t}\n\n\t\t// If there's not enough space to paste the whole thing cut the pasted\n\t\t// runes down so they'll fit.\n\t\tif availSpace < len(paste) {\n\t\t\tpaste = paste[:availSpace]\n\t\t}\n\t}\n\n\t// Stuff before and after the cursor\n\thead := m.value[:m.pos]\n\ttailSrc := m.value[m.pos:]\n\ttail := make([]rune, len(tailSrc))\n\tcopy(tail, tailSrc)\n\n\t// Insert pasted runes\n\tfor _, r := range paste {\n\t\thead = append(head, r)\n\t\tm.pos++\n\t\tif m.CharLimit > 0 {\n\t\t\tavailSpace--\n\t\t\tif availSpace <= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// Put it all back together\n\tvalue := append(head, tail...)\n\tinputErr := m.validate(value)\n\tm.setValueInternal(value, inputErr)\n}\n\n// If a max width is defined, perform some logic to treat the visible area\n// as a horizontally scrolling viewport.\nfunc (m *Model) handleOverflow() {\n\tif m.Width <= 0 || uniseg.StringWidth(string(m.value)) <= m.Width {\n\t\tm.offset = 0\n\t\tm.offsetRight = len(m.value)\n\t\treturn\n\t}\n\n\t// Correct right offset if we've deleted characters\n\tm.offsetRight = min(m.offsetRight, len(m.value))\n\n\tif m.pos < m.offset {\n\t\tm.offset = m.pos\n\n\t\tw := 0\n\t\ti := 0\n\t\trunes := m.value[m.offset:]\n\n\t\tfor i < len(runes) && w <= m.Width {\n\t\t\tw += rw.RuneWidth(runes[i])\n\t\t\tif w <= m.Width+1 {\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\n\t\tm.offsetRight = m.offset + i\n\t} else if m.pos >= m.offsetRight {\n\t\tm.offsetRight = m.pos\n\n\t\tw := 0\n\t\trunes := m.value[:m.offsetRight]\n\t\ti := len(runes) - 1\n\n\t\tfor i > 0 && w < m.Width {\n\t\t\tw += rw.RuneWidth(runes[i])\n\t\t\tif w <= m.Width {\n\t\t\t\ti--\n\t\t\t}\n\t\t}\n\n\t\tm.offset = m.offsetRight - (len(runes) - 1 - i)\n\t}\n}\n\n// deleteBeforeCursor deletes all text before the cursor.\nfunc (m *Model) deleteBeforeCursor() {\n\tm.value = m.value[m.pos:]\n\tm.Err = m.validate(m.value)\n\tm.offset = 0\n\tm.SetCursor(0)\n}\n\n// deleteAfterCursor deletes all text after the cursor. If input is masked\n// delete everything after the cursor so as not to reveal word breaks in the\n// masked input.\nfunc (m *Model) deleteAfterCursor() {\n\tm.value = m.value[:m.pos]\n\tm.Err = m.validate(m.value)\n\tm.SetCursor(len(m.value))\n}\n\n// deleteWordBackward deletes the word left to the cursor.\nfunc (m *Model) deleteWordBackward() {\n\tif m.pos == 0 || len(m.value) == 0 {\n\t\treturn\n\t}\n\n\tif m.EchoMode != EchoNormal {\n\t\tm.deleteBeforeCursor()\n\t\treturn\n\t}\n\n\t// Linter note: it's critical that we acquire the initial cursor position\n\t// here prior to altering it via SetCursor() below. As such, moving this\n\t// call into the corresponding if clause does not apply here.\n\toldPos := m.pos //nolint:ifshort\n\n\tm.SetCursor(m.pos - 1)\n\tfor unicode.IsSpace(m.value[m.pos]) {\n\t\tif m.pos <= 0 {\n\t\t\tbreak\n\t\t}\n\t\t// ignore series of whitespace before cursor\n\t\tm.SetCursor(m.pos - 1)\n\t}\n\n\tfor m.pos > 0 {\n\t\tif !unicode.IsSpace(m.value[m.pos]) {\n\t\t\tm.SetCursor(m.pos - 1)\n\t\t} else {\n\t\t\tif m.pos > 0 {\n\t\t\t\t// keep the previous space\n\t\t\t\tm.SetCursor(m.pos + 1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif oldPos > len(m.value) {\n\t\tm.value = m.value[:m.pos]\n\t} else {\n\t\tm.value = append(m.value[:m.pos], m.value[oldPos:]...)\n\t}\n\tm.Err = m.validate(m.value)\n}\n\n// deleteWordForward deletes the word right to the cursor. If input is masked\n// delete everything after the cursor so as not to reveal word breaks in the\n// masked input.\nfunc (m *Model) deleteWordForward() {\n\tif m.pos >= len(m.value) || len(m.value) == 0 {\n\t\treturn\n\t}\n\n\tif m.EchoMode != EchoNormal {\n\t\tm.deleteAfterCursor()\n\t\treturn\n\t}\n\n\toldPos := m.pos\n\tm.SetCursor(m.pos + 1)\n\tfor unicode.IsSpace(m.value[m.pos]) {\n\t\t// ignore series of whitespace after cursor\n\t\tm.SetCursor(m.pos + 1)\n\n\t\tif m.pos >= len(m.value) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor m.pos < len(m.value) {\n\t\tif !unicode.IsSpace(m.value[m.pos]) {\n\t\t\tm.SetCursor(m.pos + 1)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif m.pos > len(m.value) {\n\t\tm.value = m.value[:oldPos]\n\t} else {\n\t\tm.value = append(m.value[:oldPos], m.value[m.pos:]...)\n\t}\n\tm.Err = m.validate(m.value)\n\n\tm.SetCursor(oldPos)\n}\n\n// wordBackward moves the cursor one word to the left. If input is masked, move\n// input to the start so as not to reveal word breaks in the masked input.\nfunc (m *Model) wordBackward() {\n\tif m.pos == 0 || len(m.value) == 0 {\n\t\treturn\n\t}\n\n\tif m.EchoMode != EchoNormal {\n\t\tm.CursorStart()\n\t\treturn\n\t}\n\n\ti := m.pos - 1\n\tfor i >= 0 {\n\t\tif unicode.IsSpace(m.value[i]) {\n\t\t\tm.SetCursor(m.pos - 1)\n\t\t\ti--\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i >= 0 {\n\t\tif !unicode.IsSpace(m.value[i]) {\n\t\t\tm.SetCursor(m.pos - 1)\n\t\t\ti--\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// wordForward moves the cursor one word to the right. If the input is masked,\n// move input to the end so as not to reveal word breaks in the masked input.\nfunc (m *Model) wordForward() {\n\tif m.pos >= len(m.value) || len(m.value) == 0 {\n\t\treturn\n\t}\n\n\tif m.EchoMode != EchoNormal {\n\t\tm.CursorEnd()\n\t\treturn\n\t}\n\n\ti := m.pos\n\tfor i < len(m.value) {\n\t\tif unicode.IsSpace(m.value[i]) {\n\t\t\tm.SetCursor(m.pos + 1)\n\t\t\ti++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i < len(m.value) {\n\t\tif !unicode.IsSpace(m.value[i]) {\n\t\t\tm.SetCursor(m.pos + 1)\n\t\t\ti++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (m Model) echoTransform(v string) string {\n\tswitch m.EchoMode {\n\tcase EchoPassword:\n\t\treturn strings.Repeat(string(m.EchoCharacter), uniseg.StringWidth(v))\n\tcase EchoNone:\n\t\treturn \"\"\n\tcase EchoNormal:\n\t\treturn v\n\tdefault:\n\t\treturn v\n\t}\n}\n\n// Update is the Bubble Tea update loop.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tif !m.focus {\n\t\treturn m, nil\n\t}\n\n\t// Need to check for completion before, because key is configurable and might be double assigned\n\tkeyMsg, ok := msg.(tea.KeyMsg)\n\tif ok && key.Matches(keyMsg, m.KeyMap.AcceptSuggestion) {\n\t\tif m.canAcceptSuggestion() {\n\t\t\tm.value = append(m.value, m.matchedSuggestions[m.currentSuggestionIndex][len(m.value):]...)\n\t\t\tm.CursorEnd()\n\t\t}\n\t}\n\n\t// Let's remember where the position of the cursor currently is so that if\n\t// the cursor position changes, we can reset the blink.\n\toldPos := m.pos //nolint\n\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, m.KeyMap.DeleteWordBackward):\n\t\t\tm.deleteWordBackward()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteCharacterBackward):\n\t\t\tm.Err = nil\n\t\t\tif len(m.value) > 0 {\n\t\t\t\tm.value = append(m.value[:max(0, m.pos-1)], m.value[m.pos:]...)\n\t\t\t\tm.Err = m.validate(m.value)\n\t\t\t\tif m.pos > 0 {\n\t\t\t\t\tm.SetCursor(m.pos - 1)\n\t\t\t\t}\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.WordBackward):\n\t\t\tm.wordBackward()\n\t\tcase key.Matches(msg, m.KeyMap.CharacterBackward):\n\t\t\tif m.pos > 0 {\n\t\t\t\tm.SetCursor(m.pos - 1)\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.WordForward):\n\t\t\tm.wordForward()\n\t\tcase key.Matches(msg, m.KeyMap.CharacterForward):\n\t\t\tif m.pos < len(m.value) {\n\t\t\t\tm.SetCursor(m.pos + 1)\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.LineStart):\n\t\t\tm.CursorStart()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteCharacterForward):\n\t\t\tif len(m.value) > 0 && m.pos < len(m.value) {\n\t\t\t\tm.value = append(m.value[:m.pos], m.value[m.pos+1:]...)\n\t\t\t\tm.Err = m.validate(m.value)\n\t\t\t}\n\t\tcase key.Matches(msg, m.KeyMap.LineEnd):\n\t\t\tm.CursorEnd()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteAfterCursor):\n\t\t\tm.deleteAfterCursor()\n\t\tcase key.Matches(msg, m.KeyMap.DeleteBeforeCursor):\n\t\t\tm.deleteBeforeCursor()\n\t\tcase key.Matches(msg, m.KeyMap.Paste):\n\t\t\treturn m, Paste\n\t\tcase key.Matches(msg, m.KeyMap.DeleteWordForward):\n\t\t\tm.deleteWordForward()\n\t\tcase key.Matches(msg, m.KeyMap.NextSuggestion):\n\t\t\tm.nextSuggestion()\n\t\tcase key.Matches(msg, m.KeyMap.PrevSuggestion):\n\t\t\tm.previousSuggestion()\n\t\tdefault:\n\t\t\t// Input one or more regular characters.\n\t\t\tm.insertRunesFromUserInput(msg.Runes)\n\t\t}\n\n\t\t// Check again if can be completed\n\t\t// because value might be something that does not match the completion prefix\n\t\tm.updateSuggestions()\n\n\tcase pasteMsg:\n\t\tm.insertRunesFromUserInput([]rune(msg))\n\n\tcase pasteErrMsg:\n\t\tm.Err = msg\n\t}\n\n\tvar cmds []tea.Cmd\n\tvar cmd tea.Cmd\n\n\tm.Cursor, cmd = m.Cursor.Update(msg)\n\tcmds = append(cmds, cmd)\n\n\tif oldPos != m.pos && m.Cursor.Mode() == cursor.CursorBlink {\n\t\tm.Cursor.Blink = false\n\t\tcmds = append(cmds, m.Cursor.BlinkCmd())\n\t}\n\n\tm.handleOverflow()\n\treturn m, tea.Batch(cmds...)\n}\n\n// View renders the textinput in its current state.\nfunc (m Model) View() string {\n\t// Placeholder text\n\tif len(m.value) == 0 && m.Placeholder != \"\" {\n\t\treturn m.placeholderView()\n\t}\n\n\tstyleText := m.TextStyle.Inline(true).Render\n\n\tvalue := m.value[m.offset:m.offsetRight]\n\tpos := max(0, m.pos-m.offset)\n\tv := styleText(m.echoTransform(string(value[:pos])))\n\n\tif pos < len(value) {\n\t\tchar := m.echoTransform(string(value[pos]))\n\t\tm.Cursor.SetChar(char)\n\t\tv += m.Cursor.View()                                   // cursor and text under it\n\t\tv += styleText(m.echoTransform(string(value[pos+1:]))) // text after cursor\n\t\tv += m.completionView(0)                               // suggested completion\n\t} else {\n\t\tif m.canAcceptSuggestion() {\n\t\t\tsuggestion := m.matchedSuggestions[m.currentSuggestionIndex]\n\t\t\tif len(value) < len(suggestion) {\n\t\t\t\tm.Cursor.TextStyle = m.CompletionStyle\n\t\t\t\tm.Cursor.SetChar(m.echoTransform(string(suggestion[pos])))\n\t\t\t\tv += m.Cursor.View()\n\t\t\t\tv += m.completionView(1)\n\t\t\t} else {\n\t\t\t\tm.Cursor.SetChar(\" \")\n\t\t\t\tv += m.Cursor.View()\n\t\t\t}\n\t\t} else {\n\t\t\tm.Cursor.SetChar(\" \")\n\t\t\tv += m.Cursor.View()\n\t\t}\n\t}\n\n\t// If a max width and background color were set fill the empty spaces with\n\t// the background color.\n\tvalWidth := uniseg.StringWidth(string(value))\n\tif m.Width > 0 && valWidth <= m.Width {\n\t\tpadding := max(0, m.Width-valWidth)\n\t\tif valWidth+padding <= m.Width && pos < len(value) {\n\t\t\tpadding++\n\t\t}\n\t\tv += styleText(strings.Repeat(\" \", padding))\n\t}\n\n\treturn m.PromptStyle.Render(m.Prompt) + v\n}\n\n// placeholderView returns the prompt and placeholder view, if any.\nfunc (m Model) placeholderView() string {\n\tvar (\n\t\tv     string\n\t\tp     = []rune(m.Placeholder)\n\t\tstyle = m.PlaceholderStyle.Inline(true).Render\n\t)\n\n\tm.Cursor.TextStyle = m.PlaceholderStyle\n\tm.Cursor.SetChar(string(p[:1]))\n\tv += m.Cursor.View()\n\n\t// If the entire placeholder is already set and no padding is needed, finish\n\tif m.Width < 1 && len(p) <= 1 {\n\t\treturn m.PromptStyle.Render(m.Prompt) + v\n\t}\n\n\t// If Width is set then size placeholder accordingly\n\tif m.Width > 0 {\n\t\t// available width is width - len + cursor offset of 1\n\t\tminWidth := lipgloss.Width(m.Placeholder)\n\t\tavailWidth := m.Width - minWidth + 1\n\n\t\t// if width < len, 'subtract'(add) number to len and dont add padding\n\t\tif availWidth < 0 {\n\t\t\tminWidth += availWidth\n\t\t\tavailWidth = 0\n\t\t}\n\t\t// append placeholder[len] - cursor, append padding\n\t\tv += style(string(p[1:minWidth]))\n\t\tv += style(strings.Repeat(\" \", availWidth))\n\t} else {\n\t\t// if there is no width, the placeholder can be any length\n\t\tv += style(string(p[1:]))\n\t}\n\n\treturn m.PromptStyle.Render(m.Prompt) + v\n}\n\n// Blink is a command used to initialize cursor blinking.\nfunc Blink() tea.Msg {\n\treturn cursor.Blink()\n}\n\n// Paste is a command for pasting from the clipboard into the text input.\nfunc Paste() tea.Msg {\n\tstr, err := clipboard.ReadAll()\n\tif err != nil {\n\t\treturn pasteErrMsg{err}\n\t}\n\treturn pasteMsg(str)\n}\n\nfunc clamp(v, low, high int) int {\n\tif high < low {\n\t\tlow, high = high, low\n\t}\n\treturn min(high, max(low, v))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// Deprecated.\n\n// Deprecated: use cursor.Mode.\ntype CursorMode int\n\nconst (\n\t// Deprecated: use cursor.CursorBlink.\n\tCursorBlink = CursorMode(cursor.CursorBlink)\n\t// Deprecated: use cursor.CursorStatic.\n\tCursorStatic = CursorMode(cursor.CursorStatic)\n\t// Deprecated: use cursor.CursorHide.\n\tCursorHide = CursorMode(cursor.CursorHide)\n)\n\nfunc (c CursorMode) String() string {\n\treturn cursor.Mode(c).String()\n}\n\n// Deprecated: use cursor.Mode().\nfunc (m Model) CursorMode() CursorMode {\n\treturn CursorMode(m.Cursor.Mode())\n}\n\n// Deprecated: use cursor.SetMode().\nfunc (m *Model) SetCursorMode(mode CursorMode) tea.Cmd {\n\treturn m.Cursor.SetMode(cursor.Mode(mode))\n}\n\nfunc (m Model) completionView(offset int) string {\n\tvar (\n\t\tvalue = m.value\n\t\tstyle = m.PlaceholderStyle.Inline(true).Render\n\t)\n\n\tif m.canAcceptSuggestion() {\n\t\tsuggestion := m.matchedSuggestions[m.currentSuggestionIndex]\n\t\tif len(value) < len(suggestion) {\n\t\t\treturn style(string(suggestion[len(value)+offset:]))\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// AvailableSuggestions returns the list of available suggestions.\nfunc (m *Model) AvailableSuggestions() []string {\n\tsuggestions := make([]string, len(m.suggestions))\n\tfor i, s := range m.suggestions {\n\t\tsuggestions[i] = string(s)\n\t}\n\n\treturn suggestions\n}\n\n// CurrentSuggestion returns the currently selected suggestion.\nfunc (m *Model) CurrentSuggestion() string {\n\tif m.currentSuggestionIndex >= len(m.matchedSuggestions) {\n\t\treturn \"\"\n\t}\n\n\treturn string(m.matchedSuggestions[m.currentSuggestionIndex])\n}\n\n// canAcceptSuggestion returns whether there is an acceptable suggestion to\n// autocomplete the current value.\nfunc (m *Model) canAcceptSuggestion() bool {\n\treturn len(m.matchedSuggestions) > 0\n}\n\n// updateSuggestions refreshes the list of matching suggestions.\nfunc (m *Model) updateSuggestions() {\n\tif !m.ShowSuggestions {\n\t\treturn\n\t}\n\n\tif len(m.value) <= 0 || len(m.suggestions) <= 0 {\n\t\tm.matchedSuggestions = [][]rune{}\n\t\treturn\n\t}\n\n\tmatches := [][]rune{}\n\tfor _, s := range m.suggestions {\n\t\tsuggestion := string(s)\n\n\t\tif strings.HasPrefix(strings.ToLower(suggestion), strings.ToLower(string(m.value))) {\n\t\t\tmatches = append(matches, []rune(suggestion))\n\t\t}\n\t}\n\tif !reflect.DeepEqual(matches, m.matchedSuggestions) {\n\t\tm.currentSuggestionIndex = 0\n\t}\n\n\tm.matchedSuggestions = matches\n}\n\n// nextSuggestion selects the next suggestion.\nfunc (m *Model) nextSuggestion() {\n\tm.currentSuggestionIndex = (m.currentSuggestionIndex + 1)\n\tif m.currentSuggestionIndex >= len(m.matchedSuggestions) {\n\t\tm.currentSuggestionIndex = 0\n\t}\n}\n\n// previousSuggestion selects the previous suggestion.\nfunc (m *Model) previousSuggestion() {\n\tm.currentSuggestionIndex = (m.currentSuggestionIndex - 1)\n\tif m.currentSuggestionIndex < 0 {\n\t\tm.currentSuggestionIndex = len(m.matchedSuggestions) - 1\n\t}\n}\n\nfunc (m Model) validate(v []rune) error {\n\tif m.Validate != nil {\n\t\treturn m.Validate(string(v))\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/viewport/keymap.go",
    "content": "package viewport\n\nimport \"github.com/charmbracelet/bubbles/key\"\n\nconst spacebar = \" \"\n\n// KeyMap defines the keybindings for the viewport. Note that you don't\n// necessary need to use keybindings at all; the viewport can be controlled\n// programmatically with methods like Model.LineDown(1). See the GoDocs for\n// details.\ntype KeyMap struct {\n\tPageDown     key.Binding\n\tPageUp       key.Binding\n\tHalfPageUp   key.Binding\n\tHalfPageDown key.Binding\n\tDown         key.Binding\n\tUp           key.Binding\n}\n\n// DefaultKeyMap returns a set of pager-like default keybindings.\nfunc DefaultKeyMap() KeyMap {\n\treturn KeyMap{\n\t\tPageDown: key.NewBinding(\n\t\t\tkey.WithKeys(\"pgdown\", spacebar, \"f\"),\n\t\t\tkey.WithHelp(\"f/pgdn\", \"page down\"),\n\t\t),\n\t\tPageUp: key.NewBinding(\n\t\t\tkey.WithKeys(\"pgup\", \"b\"),\n\t\t\tkey.WithHelp(\"b/pgup\", \"page up\"),\n\t\t),\n\t\tHalfPageUp: key.NewBinding(\n\t\t\tkey.WithKeys(\"u\", \"ctrl+u\"),\n\t\t\tkey.WithHelp(\"u\", \"½ page up\"),\n\t\t),\n\t\tHalfPageDown: key.NewBinding(\n\t\t\tkey.WithKeys(\"d\", \"ctrl+d\"),\n\t\t\tkey.WithHelp(\"d\", \"½ page down\"),\n\t\t),\n\t\tUp: key.NewBinding(\n\t\t\tkey.WithKeys(\"up\", \"k\"),\n\t\t\tkey.WithHelp(\"↑/k\", \"up\"),\n\t\t),\n\t\tDown: key.NewBinding(\n\t\t\tkey.WithKeys(\"down\", \"j\"),\n\t\t\tkey.WithHelp(\"↓/j\", \"down\"),\n\t\t),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbles/viewport/viewport.go",
    "content": "package viewport\n\nimport (\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// New returns a new model with the given width and height as well as default\n// key mappings.\nfunc New(width, height int) (m Model) {\n\tm.Width = width\n\tm.Height = height\n\tm.setInitialValues()\n\treturn m\n}\n\n// Model is the Bubble Tea model for this viewport element.\ntype Model struct {\n\tWidth  int\n\tHeight int\n\tKeyMap KeyMap\n\n\t// Whether or not to respond to the mouse. The mouse must be enabled in\n\t// Bubble Tea for this to work. For details, see the Bubble Tea docs.\n\tMouseWheelEnabled bool\n\n\t// The number of lines the mouse wheel will scroll. By default, this is 3.\n\tMouseWheelDelta int\n\n\t// YOffset is the vertical scroll position.\n\tYOffset int\n\n\t// YPosition is the position of the viewport in relation to the terminal\n\t// window. It's used in high performance rendering only.\n\tYPosition int\n\n\t// Style applies a lipgloss style to the viewport. Realistically, it's most\n\t// useful for setting borders, margins and padding.\n\tStyle lipgloss.Style\n\n\t// HighPerformanceRendering bypasses the normal Bubble Tea renderer to\n\t// provide higher performance rendering. Most of the time the normal Bubble\n\t// Tea rendering methods will suffice, but if you're passing content with\n\t// a lot of ANSI escape codes you may see improved rendering in certain\n\t// terminals with this enabled.\n\t//\n\t// This should only be used in program occupying the entire terminal,\n\t// which is usually via the alternate screen buffer.\n\tHighPerformanceRendering bool\n\n\tinitialized bool\n\tlines       []string\n}\n\nfunc (m *Model) setInitialValues() {\n\tm.KeyMap = DefaultKeyMap()\n\tm.MouseWheelEnabled = true\n\tm.MouseWheelDelta = 3\n\tm.initialized = true\n}\n\n// Init exists to satisfy the tea.Model interface for composability purposes.\nfunc (m Model) Init() tea.Cmd {\n\treturn nil\n}\n\n// AtTop returns whether or not the viewport is at the very top position.\nfunc (m Model) AtTop() bool {\n\treturn m.YOffset <= 0\n}\n\n// AtBottom returns whether or not the viewport is at or past the very bottom\n// position.\nfunc (m Model) AtBottom() bool {\n\treturn m.YOffset >= m.maxYOffset()\n}\n\n// PastBottom returns whether or not the viewport is scrolled beyond the last\n// line. This can happen when adjusting the viewport height.\nfunc (m Model) PastBottom() bool {\n\treturn m.YOffset > m.maxYOffset()\n}\n\n// ScrollPercent returns the amount scrolled as a float between 0 and 1.\nfunc (m Model) ScrollPercent() float64 {\n\tif m.Height >= len(m.lines) {\n\t\treturn 1.0\n\t}\n\ty := float64(m.YOffset)\n\th := float64(m.Height)\n\tt := float64(len(m.lines))\n\tv := y / (t - h)\n\treturn math.Max(0.0, math.Min(1.0, v))\n}\n\n// SetContent set the pager's text content. For high performance rendering the\n// Sync command should also be called.\nfunc (m *Model) SetContent(s string) {\n\ts = strings.ReplaceAll(s, \"\\r\\n\", \"\\n\") // normalize line endings\n\tm.lines = strings.Split(s, \"\\n\")\n\n\tif m.YOffset > len(m.lines)-1 {\n\t\tm.GotoBottom()\n\t}\n}\n\n// maxYOffset returns the maximum possible value of the y-offset based on the\n// viewport's content and set height.\nfunc (m Model) maxYOffset() int {\n\treturn max(0, len(m.lines)-m.Height)\n}\n\n// visibleLines returns the lines that should currently be visible in the\n// viewport.\nfunc (m Model) visibleLines() (lines []string) {\n\tif len(m.lines) > 0 {\n\t\ttop := max(0, m.YOffset)\n\t\tbottom := clamp(m.YOffset+m.Height, top, len(m.lines))\n\t\tlines = m.lines[top:bottom]\n\t}\n\treturn lines\n}\n\n// scrollArea returns the scrollable boundaries for high performance rendering.\nfunc (m Model) scrollArea() (top, bottom int) {\n\ttop = max(0, m.YPosition)\n\tbottom = max(top, top+m.Height)\n\tif top > 0 && bottom > top {\n\t\tbottom--\n\t}\n\treturn top, bottom\n}\n\n// SetYOffset sets the Y offset.\nfunc (m *Model) SetYOffset(n int) {\n\tm.YOffset = clamp(n, 0, m.maxYOffset())\n}\n\n// ViewDown moves the view down by the number of lines in the viewport.\n// Basically, \"page down\".\nfunc (m *Model) ViewDown() []string {\n\tif m.AtBottom() {\n\t\treturn nil\n\t}\n\n\treturn m.LineDown(m.Height)\n}\n\n// ViewUp moves the view up by one height of the viewport. Basically, \"page up\".\nfunc (m *Model) ViewUp() []string {\n\tif m.AtTop() {\n\t\treturn nil\n\t}\n\n\treturn m.LineUp(m.Height)\n}\n\n// HalfViewDown moves the view down by half the height of the viewport.\nfunc (m *Model) HalfViewDown() (lines []string) {\n\tif m.AtBottom() {\n\t\treturn nil\n\t}\n\n\treturn m.LineDown(m.Height / 2)\n}\n\n// HalfViewUp moves the view up by half the height of the viewport.\nfunc (m *Model) HalfViewUp() (lines []string) {\n\tif m.AtTop() {\n\t\treturn nil\n\t}\n\n\treturn m.LineUp(m.Height / 2)\n}\n\n// LineDown moves the view down by the given number of lines.\nfunc (m *Model) LineDown(n int) (lines []string) {\n\tif m.AtBottom() || n == 0 || len(m.lines) == 0 {\n\t\treturn nil\n\t}\n\n\t// Make sure the number of lines by which we're going to scroll isn't\n\t// greater than the number of lines we actually have left before we reach\n\t// the bottom.\n\tm.SetYOffset(m.YOffset + n)\n\n\t// Gather lines to send off for performance scrolling.\n\tbottom := clamp(m.YOffset+m.Height, 0, len(m.lines))\n\ttop := clamp(m.YOffset+m.Height-n, 0, bottom)\n\treturn m.lines[top:bottom]\n}\n\n// LineUp moves the view down by the given number of lines. Returns the new\n// lines to show.\nfunc (m *Model) LineUp(n int) (lines []string) {\n\tif m.AtTop() || n == 0 || len(m.lines) == 0 {\n\t\treturn nil\n\t}\n\n\t// Make sure the number of lines by which we're going to scroll isn't\n\t// greater than the number of lines we are from the top.\n\tm.SetYOffset(m.YOffset - n)\n\n\t// Gather lines to send off for performance scrolling.\n\ttop := max(0, m.YOffset)\n\tbottom := clamp(m.YOffset+n, 0, m.maxYOffset())\n\treturn m.lines[top:bottom]\n}\n\n// TotalLineCount returns the total number of lines (both hidden and visible) within the viewport.\nfunc (m Model) TotalLineCount() int {\n\treturn len(m.lines)\n}\n\n// VisibleLineCount returns the number of the visible lines within the viewport.\nfunc (m Model) VisibleLineCount() int {\n\treturn len(m.visibleLines())\n}\n\n// GotoTop sets the viewport to the top position.\nfunc (m *Model) GotoTop() (lines []string) {\n\tif m.AtTop() {\n\t\treturn nil\n\t}\n\n\tm.SetYOffset(0)\n\treturn m.visibleLines()\n}\n\n// GotoBottom sets the viewport to the bottom position.\nfunc (m *Model) GotoBottom() (lines []string) {\n\tm.SetYOffset(m.maxYOffset())\n\treturn m.visibleLines()\n}\n\n// Sync tells the renderer where the viewport will be located and requests\n// a render of the current state of the viewport. It should be called for the\n// first render and after a window resize.\n//\n// For high performance rendering only.\nfunc Sync(m Model) tea.Cmd {\n\tif len(m.lines) == 0 {\n\t\treturn nil\n\t}\n\ttop, bottom := m.scrollArea()\n\treturn tea.SyncScrollArea(m.visibleLines(), top, bottom)\n}\n\n// ViewDown is a high performance command that moves the viewport up by a given\n// number of lines. Use Model.ViewDown to get the lines that should be rendered.\n// For example:\n//\n//\tlines := model.ViewDown(1)\n//\tcmd := ViewDown(m, lines)\nfunc ViewDown(m Model, lines []string) tea.Cmd {\n\tif len(lines) == 0 {\n\t\treturn nil\n\t}\n\ttop, bottom := m.scrollArea()\n\treturn tea.ScrollDown(lines, top, bottom)\n}\n\n// ViewUp is a high performance command the moves the viewport down by a given\n// number of lines height. Use Model.ViewUp to get the lines that should be\n// rendered.\nfunc ViewUp(m Model, lines []string) tea.Cmd {\n\tif len(lines) == 0 {\n\t\treturn nil\n\t}\n\ttop, bottom := m.scrollArea()\n\treturn tea.ScrollUp(lines, top, bottom)\n}\n\n// Update handles standard message-based viewport updates.\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {\n\tvar cmd tea.Cmd\n\tm, cmd = m.updateAsModel(msg)\n\treturn m, cmd\n}\n\n// Author's note: this method has been broken out to make it easier to\n// potentially transition Update to satisfy tea.Model.\nfunc (m Model) updateAsModel(msg tea.Msg) (Model, tea.Cmd) {\n\tif !m.initialized {\n\t\tm.setInitialValues()\n\t}\n\n\tvar cmd tea.Cmd\n\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, m.KeyMap.PageDown):\n\t\t\tlines := m.ViewDown()\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewDown(m, lines)\n\t\t\t}\n\n\t\tcase key.Matches(msg, m.KeyMap.PageUp):\n\t\t\tlines := m.ViewUp()\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewUp(m, lines)\n\t\t\t}\n\n\t\tcase key.Matches(msg, m.KeyMap.HalfPageDown):\n\t\t\tlines := m.HalfViewDown()\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewDown(m, lines)\n\t\t\t}\n\n\t\tcase key.Matches(msg, m.KeyMap.HalfPageUp):\n\t\t\tlines := m.HalfViewUp()\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewUp(m, lines)\n\t\t\t}\n\n\t\tcase key.Matches(msg, m.KeyMap.Down):\n\t\t\tlines := m.LineDown(1)\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewDown(m, lines)\n\t\t\t}\n\n\t\tcase key.Matches(msg, m.KeyMap.Up):\n\t\t\tlines := m.LineUp(1)\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewUp(m, lines)\n\t\t\t}\n\t\t}\n\n\tcase tea.MouseMsg:\n\t\tif !m.MouseWheelEnabled || msg.Action != tea.MouseActionPress {\n\t\t\tbreak\n\t\t}\n\t\tswitch msg.Button {\n\t\tcase tea.MouseButtonWheelUp:\n\t\t\tlines := m.LineUp(m.MouseWheelDelta)\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewUp(m, lines)\n\t\t\t}\n\n\t\tcase tea.MouseButtonWheelDown:\n\t\t\tlines := m.LineDown(m.MouseWheelDelta)\n\t\t\tif m.HighPerformanceRendering {\n\t\t\t\tcmd = ViewDown(m, lines)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn m, cmd\n}\n\n// View renders the viewport into a string.\nfunc (m Model) View() string {\n\tif m.HighPerformanceRendering {\n\t\t// Just send newlines since we're going to be rendering the actual\n\t\t// content separately. We still need to send something that equals the\n\t\t// height of this view so that the Bubble Tea standard renderer can\n\t\t// position anything below this view properly.\n\t\treturn strings.Repeat(\"\\n\", max(0, m.Height-1))\n\t}\n\n\tw, h := m.Width, m.Height\n\tif sw := m.Style.GetWidth(); sw != 0 {\n\t\tw = min(w, sw)\n\t}\n\tif sh := m.Style.GetHeight(); sh != 0 {\n\t\th = min(h, sh)\n\t}\n\tcontentWidth := w - m.Style.GetHorizontalFrameSize()\n\tcontentHeight := h - m.Style.GetVerticalFrameSize()\n\tcontents := lipgloss.NewStyle().\n\t\tWidth(contentWidth).      // pad to width.\n\t\tHeight(contentHeight).    // pad to height.\n\t\tMaxHeight(contentHeight). // truncate height if taller.\n\t\tMaxWidth(contentWidth).   // truncate width if wider.\n\t\tRender(strings.Join(m.visibleLines(), \"\\n\"))\n\treturn m.Style.\n\t\tUnsetWidth().UnsetHeight(). // Style size already applied in contents.\n\t\tRender(contents)\n}\n\nfunc clamp(v, low, high int) int {\n\tif high < low {\n\t\tlow, high = high, low\n\t}\n\treturn min(high, max(low, v))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/.gitattributes",
    "content": "*.golden -text\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/.gitignore",
    "content": ".DS_Store\n.envrc\n\nexamples/fullscreen/fullscreen\nexamples/help/help\nexamples/http/http\nexamples/list-default/list-default\nexamples/list-fancy/list-fancy\nexamples/list-simple/list-simple\nexamples/mouse/mouse\nexamples/pager/pager\nexamples/progress-download/color_vortex.blend\nexamples/progress-download/progress-download\nexamples/simple/simple\nexamples/spinner/spinner\nexamples/textinput/textinput\nexamples/textinputs/textinputs\nexamples/views/views\ntutorials/basics/basics\ntutorials/commands/commands\n.idea\ncoverage.txt\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/.golangci-soft.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    # - dupl\n    - exhaustive\n    # - exhaustivestruct\n    - goconst\n    - godot\n    - godox\n    - gomnd\n    - gomoddirectives\n    - goprintffuncname\n    # - lll\n    - misspell\n    - nakedret\n    - nestif\n    - noctx\n    - nolintlint\n    - prealloc\n    - wrapcheck\n\n  # disable default linters, they are already enabled in .golangci.yml\n  disable:\n    - deadcode\n    - errcheck\n    - gosimple\n    - govet\n    - ineffassign\n    - staticcheck\n    - structcheck\n    - typecheck\n    - unused\n    - varcheck\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/.golangci.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    - bodyclose\n    - exportloopref\n    - gofumpt\n    - goimports\n    - gosec\n    - nilerr\n    - predeclared\n    - revive\n    - rowserrcheck\n    - sqlclosecheck\n    - tparallel\n    - unconvert\n    - unparam\n    - whitespace\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/.goreleaser.yml",
    "content": "includes:\n  - from_url:\n      url: charmbracelet/meta/main/goreleaser-lib.yaml\n\n# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json\n\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/CONTRIBUTING.md",
    "content": "# Contributing\n\nPull requests are welcome for any changes.\n\nConsider opening an issue for larger changes to get feedback on the idea from the team.\n\nIf your change touches parts of the Bubble Tea renderer or internals, make sure\nthat all the examples in the `examples/` folder continue to run correctly.\n\nFor commit messages, please use conventional commits[^1] to make it easier to\ngenerate release notes.\n\n[^1]: https://www.conventionalcommits.org/en/v1.0.0\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020-2023 Charmbracelet, Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/README.md",
    "content": "# Bubble Tea\n\n<p>\n    <a href=\"https://stuff.charm.sh/bubbletea/bubbletea-4k.png\"><img src=\"https://github.com/charmbracelet/bubbletea/assets/25087/108d4fdb-d554-4910-abed-2a5f5586a60e\" width=\"313\" alt=\"Bubble Tea Title Treatment\"></a><br>\n    <a href=\"https://github.com/charmbracelet/bubbletea/releases\"><img src=\"https://img.shields.io/github/release/charmbracelet/bubbletea.svg\" alt=\"Latest Release\"></a>\n    <a href=\"https://pkg.go.dev/github.com/charmbracelet/bubbletea?tab=doc\"><img src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"></a>\n    <a href=\"https://github.com/charmbracelet/bubbletea/actions\"><img src=\"https://github.com/charmbracelet/bubbletea/workflows/build/badge.svg\" alt=\"Build Status\"></a>\n    <a href=\"https://www.phorm.ai/query?projectId=a0e324b6-b706-4546-b951-6671ea60c13f\"><img src=\"https://stuff.charm.sh/misc/phorm-badge.svg\" alt=\"phorm.ai\"></a>\n</p>\n\nThe fun, functional and stateful way to build terminal apps. A Go framework\nbased on [The Elm Architecture][elm]. Bubble Tea is well-suited for simple and\ncomplex terminal applications, either inline, full-window, or a mix of both.\n\n<p>\n    <img src=\"https://stuff.charm.sh/bubbletea/bubbletea-example.gif\" width=\"100%\" alt=\"Bubble Tea Example\">\n</p>\n\nBubble Tea is in use in production and includes a number of features and\nperformance optimizations we’ve added along the way. Among those is a standard\nframerate-based renderer, a renderer for high-performance scrollable\nregions which works alongside the main renderer, and mouse support.\n\nTo get started, see the tutorial below, the [examples][examples], the\n[docs][docs], the [video tutorials][youtube] and some common [resources](#libraries-we-use-with-bubble-tea).\n\n[youtube]: https://charm.sh/yt\n\n## By the way\n\nBe sure to check out [Bubbles][bubbles], a library of common UI components for Bubble Tea.\n\n<p>\n    <a href=\"https://github.com/charmbracelet/bubbles\"><img src=\"https://stuff.charm.sh/bubbles/bubbles-badge.png\" width=\"174\" alt=\"Bubbles Badge\"></a>&nbsp;&nbsp;\n    <a href=\"https://github.com/charmbracelet/bubbles\"><img src=\"https://stuff.charm.sh/bubbles-examples/textinput.gif\" width=\"400\" alt=\"Text Input Example from Bubbles\"></a>\n</p>\n\n***\n\n## Tutorial\n\nBubble Tea is based on the functional design paradigms of [The Elm\nArchitecture][elm], which happens to work nicely with Go. It's a delightful way\nto build applications.\n\nThis tutorial assumes you have a working knowledge of Go.\n\nBy the way, the non-annotated source code for this program is available\n[on GitHub][tut-source].\n\n[elm]: https://guide.elm-lang.org/architecture/\n[tut-source]:https://github.com/charmbracelet/bubbletea/tree/master/tutorials/basics\n\n### Enough! Let's get to it.\n\nFor this tutorial, we're making a shopping list.\n\nTo start we'll define our package and import some libraries. Our only external\nimport will be the Bubble Tea library, which we'll call `tea` for short.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    tea \"github.com/charmbracelet/bubbletea\"\n)\n```\n\nBubble Tea programs are comprised of a **model** that describes the application\nstate and three simple methods on that model:\n\n* **Init**, a function that returns an initial command for the application to run.\n* **Update**, a function that handles incoming events and updates the model accordingly.\n* **View**, a function that renders the UI based on the data in the model.\n\n### The Model\n\nSo let's start by defining our model which will store our application's state.\nIt can be any type, but a `struct` usually makes the most sense.\n\n```go\ntype model struct {\n    choices  []string           // items on the to-do list\n    cursor   int                // which to-do list item our cursor is pointing at\n    selected map[int]struct{}   // which to-do items are selected\n}\n```\n\n### Initialization\n\nNext, we’ll define our application’s initial state. In this case, we’re defining\na function to return our initial model, however, we could just as easily define\nthe initial model as a variable elsewhere, too.\n\n```go\nfunc initialModel() model {\n\treturn model{\n\t\t// Our to-do list is a grocery list\n\t\tchoices:  []string{\"Buy carrots\", \"Buy celery\", \"Buy kohlrabi\"},\n\n\t\t// A map which indicates which choices are selected. We're using\n\t\t// the  map like a mathematical set. The keys refer to the indexes\n\t\t// of the `choices` slice, above.\n\t\tselected: make(map[int]struct{}),\n\t}\n}\n```\n\nNext, we define the `Init` method. `Init` can return a `Cmd` that could perform\nsome initial I/O. For now, we don't need to do any I/O, so for the command,\nwe'll just return `nil`, which translates to \"no command.\"\n\n```go\nfunc (m model) Init() tea.Cmd {\n    // Just return `nil`, which means \"no I/O right now, please.\"\n    return nil\n}\n```\n\n### The Update Method\n\nNext up is the update method. The update function is called when ”things\nhappen.” Its job is to look at what has happened and return an updated model in\nresponse. It can also return a `Cmd` to make more things happen, but for now\ndon't worry about that part.\n\nIn our case, when a user presses the down arrow, `Update`’s job is to notice\nthat the down arrow was pressed and move the cursor accordingly (or not).\n\nThe “something happened” comes in the form of a `Msg`, which can be any type.\nMessages are the result of some I/O that took place, such as a keypress, timer\ntick, or a response from a server.\n\nWe usually figure out which type of `Msg` we received with a type switch, but\nyou could also use a type assertion.\n\nFor now, we'll just deal with `tea.KeyMsg` messages, which are automatically\nsent to the update function when keys are pressed.\n\n```go\nfunc (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n    switch msg := msg.(type) {\n\n    // Is it a key press?\n    case tea.KeyMsg:\n\n        // Cool, what was the actual key pressed?\n        switch msg.String() {\n\n        // These keys should exit the program.\n        case \"ctrl+c\", \"q\":\n            return m, tea.Quit\n\n        // The \"up\" and \"k\" keys move the cursor up\n        case \"up\", \"k\":\n            if m.cursor > 0 {\n                m.cursor--\n            }\n\n        // The \"down\" and \"j\" keys move the cursor down\n        case \"down\", \"j\":\n            if m.cursor < len(m.choices)-1 {\n                m.cursor++\n            }\n\n        // The \"enter\" key and the spacebar (a literal space) toggle\n        // the selected state for the item that the cursor is pointing at.\n        case \"enter\", \" \":\n            _, ok := m.selected[m.cursor]\n            if ok {\n                delete(m.selected, m.cursor)\n            } else {\n                m.selected[m.cursor] = struct{}{}\n            }\n        }\n    }\n\n    // Return the updated model to the Bubble Tea runtime for processing.\n    // Note that we're not returning a command.\n    return m, nil\n}\n```\n\nYou may have noticed that <kbd>ctrl+c</kbd> and <kbd>q</kbd> above return\na `tea.Quit` command with the model. That’s a special command which instructs\nthe Bubble Tea runtime to quit, exiting the program.\n\n### The View Method\n\nAt last, it’s time to render our UI. Of all the methods, the view is the\nsimplest. We look at the model in its current state and use it to return\na `string`. That string is our UI!\n\nBecause the view describes the entire UI of your application, you don’t have to\nworry about redrawing logic and stuff like that. Bubble Tea takes care of it\nfor you.\n\n```go\nfunc (m model) View() string {\n    // The header\n    s := \"What should we buy at the market?\\n\\n\"\n\n    // Iterate over our choices\n    for i, choice := range m.choices {\n\n        // Is the cursor pointing at this choice?\n        cursor := \" \" // no cursor\n        if m.cursor == i {\n            cursor = \">\" // cursor!\n        }\n\n        // Is this choice selected?\n        checked := \" \" // not selected\n        if _, ok := m.selected[i]; ok {\n            checked = \"x\" // selected!\n        }\n\n        // Render the row\n        s += fmt.Sprintf(\"%s [%s] %s\\n\", cursor, checked, choice)\n    }\n\n    // The footer\n    s += \"\\nPress q to quit.\\n\"\n\n    // Send the UI for rendering\n    return s\n}\n```\n\n### All Together Now\n\nThe last step is to simply run our program. We pass our initial model to\n`tea.NewProgram` and let it rip:\n\n```go\nfunc main() {\n    p := tea.NewProgram(initialModel())\n    if _, err := p.Run(); err != nil {\n        fmt.Printf(\"Alas, there's been an error: %v\", err)\n        os.Exit(1)\n    }\n}\n```\n\n## What’s Next?\n\nThis tutorial covers the basics of building an interactive terminal UI, but\nin the real world you'll also need to perform I/O. To learn about that have a\nlook at the [Command Tutorial][cmd]. It's pretty simple.\n\nThere are also several [Bubble Tea examples][examples] available and, of course,\nthere are [Go Docs][docs].\n\n[cmd]: http://github.com/charmbracelet/bubbletea/tree/master/tutorials/commands/\n[examples]: http://github.com/charmbracelet/bubbletea/tree/master/examples\n[docs]: https://pkg.go.dev/github.com/charmbracelet/bubbletea?tab=doc\n\n## Debugging\n\n### Debugging with Delve\n\nSince Bubble Tea apps assume control of stdin and stdout, you’ll need to run\ndelve in headless mode and then connect to it:\n\n```bash\n# Start the debugger\n$ dlv debug --headless --api-version=2 --listen=127.0.0.1:43000 .\nAPI server listening at: 127.0.0.1:43000\n\n# Connect to it from another terminal\n$ dlv connect 127.0.0.1:43000\n```\n\nIf you do not explicitly supply the `--listen` flag, the port used will vary\nper run, so passing this in makes the debugger easier to use from a script \nor your IDE of choice. \n\nAdditionally, we pass in `--api-version=2` because delve defaults to version 1 \nfor backwards compatibility reasons. However, delve recommends using version 2 \nfor all new development and some clients may no longer work with version 1.\nFor more information, see the [Delve documentation](https://github.com/go-delve/delve/tree/master/Documentation/api).\n\n### Logging Stuff\n\nYou can’t really log to stdout with Bubble Tea because your TUI is busy\noccupying that! You can, however, log to a file by including something like\nthe following prior to starting your Bubble Tea program:\n\n```go\nif len(os.Getenv(\"DEBUG\")) > 0 {\n\tf, err := tea.LogToFile(\"debug.log\", \"debug\")\n\tif err != nil {\n\t\tfmt.Println(\"fatal:\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer f.Close()\n}\n```\n\nTo see what’s being logged in real time, run `tail -f debug.log` while you run\nyour program in another window.\n\n## Libraries we use with Bubble Tea\n\n* [Bubbles][bubbles]: Common Bubble Tea components such as text inputs, viewports, spinners and so on\n* [Lip Gloss][lipgloss]: Style, format and layout tools for terminal applications\n* [Harmonica][harmonica]: A spring animation library for smooth, natural motion\n* [BubbleZone][bubblezone]: Easy mouse event tracking for Bubble Tea components\n* [ntcharts][ntcharts]: A terminal charting library built for Bubble Tea and [Lip Gloss][lipgloss]\n* [Termenv][termenv]: Advanced ANSI styling for terminal applications\n* [Reflow][reflow]: Advanced ANSI-aware methods for working with text\n\n[bubbles]: https://github.com/charmbracelet/bubbles\n[lipgloss]: https://github.com/charmbracelet/lipgloss\n[harmonica]: https://github.com/charmbracelet/harmonica\n[bubblezone]: https://github.com/lrstanley/bubblezone\n[ntcharts]: https://github.com/NimbleMarkets/ntcharts\n[termenv]: https://github.com/muesli/termenv\n[reflow]: https://github.com/muesli/reflow\n\n## Bubble Tea in the Wild\n\nFor some Bubble Tea programs in production, see:\n\n* [ASCII Movie](https://github.com/gabe565/ascii-movie): a Star Wars ASCII art movie player\n* [AT CLI](https://github.com/daskycodes/at_cli): execute AT Commands via serial port connections\n* [Aztify](https://github.com/Azure/aztfy): bring Microsoft Azure resources under Terraform\n* [brows](https://github.com/rubysolo/brows): a GitHub release browser\n* [Canard](https://github.com/mrusme/canard): an RSS client\n* [charm](https://github.com/charmbracelet/charm): the official Charm user account manager\n* [chatgpt-cli](https://github.com/j178/chatgpt): a CLI for ChatGPT\n* [chatgpt-tui](https://github.com/tearingItUp786/chatgpt-tui): a TUI for ChatGPT with SQLite sessions\n* [ChatGPTUI](https://github.com/dwisiswant0/chatgptui): a TUI for ChatGPT\n* [chezmoi](https://github.com/twpayne/chezmoi): securely manage your dotfiles across multiple machines\n* [chip-8](https://github.com/braheezy/chip-8): a CHIP-8 interpreter\n* [chtop](https://github.com/chhetripradeep/chtop): monitor your ClickHouse node without leaving the terminal\n* [circumflex](https://github.com/bensadeh/circumflex): read Hacker News in the terminal\n* [clidle](https://github.com/ajeetdsouza/clidle): a Wordle clone\n* [cLive](https://github.com/koki-develop/clive): automate terminal operations and view them live in a browser\n* [container-canary](https://github.com/NVIDIA/container-canary): a container validator\n* [countdown](https://github.com/aldernero/countdown): a multi-event countdown timer\n* [CRT](https://github.com/BigJk/crt): a simple terminal emulator for running Bubble Tea in a dedicated window, with optional shaders\n* [cueitup](https://github.com/dhth/cueitup): inspect messages in an AWS SQS queue in a simple and deliberate manner\n* [Daytona](https://github.com/daytonaio/daytona): an development environment manager\n* [dns53](https://github.com/purpleclay/dns53): dynamic DNS with Amazon Route53; expose your EC2 quickly, securely and privately\n* [eks-node-viewer](https://github.com/awslabs/eks-node-viewer): a tool for visualizing dynamic node usage within an EKS cluster\n* [End Of Eden](https://github.com/BigJk/end_of_eden): a \"Slay the Spire\"-like, roguelike deck-builder game\n* [enola](https://github.com/sherlock-project/enola): find social media accounts by username across social networks\n* [flapioca](https://github.com/kbrgl/flapioca): Flappy Bird on the CLI!\n* [fm](https://github.com/knipferrc/fm): a terminal-based file manager\n* [fork-cleaner](https://github.com/caarlos0/fork-cleaner): clean up old and inactive forks in your GitHub account\n* [fractals-cli](https://github.com/MicheleFiladelfia/fractals-cli): a multiplatform terminal fractal explorer\n* [fztea](https://github.com/jon4hz/fztea): a Flipper Zero TUI\n* [gama](https://github.com/termkit/gama): manage GitHub Actions from the terminal\n* [gambit](https://github.com/maaslalani/gambit): chess in the terminal\n* [gembro](https://git.sr.ht/~rafael/gembro): a mouse-driven Gemini browser\n* [gh-b](https://github.com/joaom00/gh-b): a GitHub CLI extension for managing branches\n* [gh-dash](https://www.github.com/dlvhdr/gh-dash): a GitHub CLI extension for PRs and issues\n* [gitflow-toolkit](https://github.com/mritd/gitflow-toolkit): a GitFlow submission tool\n* [Glow](https://github.com/charmbracelet/glow): a markdown reader, browser, and online markdown stash\n* [go-sweep](https://github.com/maxpaulus43/go-sweep): Minesweeper in the terminal\n* [gocovsh](https://github.com/orlangure/gocovsh): explore Go coverage reports from the CLI\n* [got](https://github.com/fedeztk/got): a simple translator and text-to-speech app built on simplytranslate's APIs\n* [gum](https://github.com/charmbracelet/gum): interactivity and styling for shells and shell scripts\n* [hiSHtory](https://github.com/ddworken/hishtory): your shell history in context: synced, and queryable\n* [httpit](https://github.com/gonetx/httpit): a rapid http(s) benchmark tool\n* [Huh?](https://github.com/charmbracelet/huh): an interactive prompt and form toolkit\n* [IDNT](https://github.com/r-darwish/idnt): a batch software uninstaller\n* [json-log-viewer](https://github.com/hedhyw/json-log-viewer): an interactive JSON log viewer\n* [kboard](https://github.com/CamiloGarciaLaRotta/kboard): a typing game\n* [kplay](https://github.com/dhth/kplay): inspect messages in a Kafka topic\n* [laboon](https://github.com/arisnacg/laboon): a Docker-desktop-style container manager\n* [mc](https://github.com/minio/mc): the official [MinIO](https://min.io) client\n* [mergestat](https://github.com/mergestat/mergestat): run SQL queries on git repositories\n* [meteor](https://github.com/stefanlogue/meteor): a highly customizable conventional commit message tool\n* [mods](https://github.com/charmbracelet/mods): AI on the CLI, built for pipelines\n* [nachrichten](https://github.com/zMoooooritz/nachrichten): access up-to-date news in German provided by the [Tagesschau](https://www.tagesschau.de/)\n* [Neon Modem Overdrive](https://github.com/mrusme/neonmodem): a BBS-style TUI client for Discourse, Lemmy, Lobste.rs and Hacker News\n* [nom](https://github.com/guyfedwards/nom): an RSS reader and manager\n* [Noted](https://github.com/torbratsberg/noted): a note viewer and manager\n* [outtasync](https://github.com/dhth/outtasync): identify CloudFormation stacks that are out of sync with their template files\n* [pathos](https://github.com/chip/pathos): a PATH environment variable editor\n* [Plandex](https://github.com/plandex-ai/plandex): a terminal-based AI coding engine for complex tasks\n* [portal](https://github.com/ZinoKader/portal): secure transfers between computers\n* [prs](https://github.com/dhth/prs): stay up to date with your PRs\n* [puffin](https://github.com/siddhantac/puffin): a TUI for hledger to manage your finances\n* [pug](https://github.com/leg100/pug): terraform task manager\n* [punchout](https://github.com/dhth/punchout): takes the suck out of logging time on JIRA\n* [redis-viewer](https://github.com/SaltFishPr/redis-viewer): a Redis database browser\n* [redis_tui](https://github.com/mat2cc/redis_tui): a Redis database browser\n* [schemas](https://github.com/dhth/schemas): lets you inspect postgres schemas in the terminal\n* [scrabbler](https://github.com/wI2L/scrabbler): an automatic draw tool for your duplicate Scrabble games\n* [sku](https://github.com/fedeztk/sku): Sudoku on the CLI\n* [Slides](https://github.com/maaslalani/slides): a markdown-based presentation tool\n* [SlurmCommander](https://github.com/CLIP-HPC/SlurmCommander): a Slurm workload manager\n* [Soft Serve](https://github.com/charmbracelet/soft-serve): a command-line-first Git server that runs a TUI over SSH\n* [solitaire-tui](https://github.com/brianstrauch/solitaire-tui): Klondike Solitaire for the terminal\n* [StormForge Optimize Controller](https://github.com/thestormforge/optimize-controller): a tool for experimenting with application configurations in Kubernetes\n* [Storydb](https://github.com/grrlopes/storydb): an improved bash/zsh-style ctrl+r command history finder\n* [STTG](https://github.com/wille1101/sttg): a teletext client for SVT, Sweden’s national public television station\n* [sttr](https://github.com/abhimanyu003/sttr): a general-purpose text transformer\n* [superfile](https://github.com/MHNightCat/superfile)  a fancy, modern terminal-based file manager\n* [tasktimer](https://github.com/caarlos0/tasktimer): a dead-simple task timer\n* [termdbms](https://github.com/mathaou/termdbms): a keyboard and mouse driven database browser\n* [tgpt](https://github.com/aandrew-me/tgpt): conversational AI for the CLI; no API keys necessary\n* [ticker](https://github.com/achannarasappa/ticker): a terminal stock viewer and stock position tracker\n* [trainer](https://github.com/rusinikita/trainer): a Go concurrency coding interview simulator with learning materials \n* [tran](https://github.com/abdfnx/tran): securely transfer stuff between computers (based on [portal](https://github.com/ZinoKader/portal))\n* [Trufflehog](https://github.com/trufflesecurity/trufflehog): find leaked credentials\n* [Typer](https://github.com/maaslalani/typer): a typing test\n* [typioca](https://github.com/bloznelis/typioca): a typing test\n* [tz](https://github.com/oz/tz): a scheduling aid for people in multiple time zones\n* [ugm](https://github.com/ariasmn/ugm): a unix user and group browser\n* [walk](https://github.com/antonmedv/walk): a terminal navigator\n* [wander](https://github.com/robinovitch61/wander): a HashiCorp Nomad terminal client\n* [WG Commander](https://github.com/AndrianBdn/wg-cmd): a TUI for a simple WireGuard VPN setup \n* [wishlist](https://github.com/charmbracelet/wishlist): an SSH directory\n\n## Feedback\n\nWe'd love to hear your thoughts on this project. Feel free to drop us a note!\n\n* [Twitter](https://twitter.com/charmcli)\n* [The Fediverse](https://mastodon.social/@charmcli)\n* [Discord](https://charm.sh/chat)\n\n## Acknowledgments\n\nBubble Tea is based on the paradigms of [The Elm Architecture][elm] by Evan\nCzaplicki et alia and the excellent [go-tea][gotea] by TJ Holowaychuk. It’s\ninspired by the many great [_Zeichenorientierte Benutzerschnittstellen_][zb]\nof days past.\n\n[elm]: https://guide.elm-lang.org/architecture/\n[gotea]: https://github.com/tj/go-tea\n[zb]: https://de.wikipedia.org/wiki/Zeichenorientierte_Benutzerschnittstelle\n\n## License\n\n[MIT](https://github.com/charmbracelet/bubbletea/raw/master/LICENSE)\n\n***\n\nPart of [Charm](https://charm.sh).\n\n<a href=\"https://charm.sh/\"><img alt=\"The Charm logo\" src=\"https://stuff.charm.sh/charm-badge.jpg\" width=\"400\"></a>\n\nCharm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/commands.go",
    "content": "package tea\n\nimport (\n\t\"time\"\n)\n\n// Batch performs a bunch of commands concurrently with no ordering guarantees\n// about the results. Use a Batch to return several commands.\n//\n// Example:\n//\n//\t    func (m model) Init() Cmd {\n//\t\t       return tea.Batch(someCommand, someOtherCommand)\n//\t    }\nfunc Batch(cmds ...Cmd) Cmd {\n\tvar validCmds []Cmd //nolint:prealloc\n\tfor _, c := range cmds {\n\t\tif c == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvalidCmds = append(validCmds, c)\n\t}\n\tswitch len(validCmds) {\n\tcase 0:\n\t\treturn nil\n\tcase 1:\n\t\treturn validCmds[0]\n\tdefault:\n\t\treturn func() Msg {\n\t\t\treturn BatchMsg(validCmds)\n\t\t}\n\t}\n}\n\n// BatchMsg is a message used to perform a bunch of commands concurrently with\n// no ordering guarantees. You can send a BatchMsg with Batch.\ntype BatchMsg []Cmd\n\n// Sequence runs the given commands one at a time, in order. Contrast this with\n// Batch, which runs commands concurrently.\nfunc Sequence(cmds ...Cmd) Cmd {\n\treturn func() Msg {\n\t\treturn sequenceMsg(cmds)\n\t}\n}\n\n// sequenceMsg is used internally to run the given commands in order.\ntype sequenceMsg []Cmd\n\n// Every is a command that ticks in sync with the system clock. So, if you\n// wanted to tick with the system clock every second, minute or hour you\n// could use this. It's also handy for having different things tick in sync.\n//\n// Because we're ticking with the system clock the tick will likely not run for\n// the entire specified duration. For example, if we're ticking for one minute\n// and the clock is at 12:34:20 then the next tick will happen at 12:35:00, 40\n// seconds later.\n//\n// To produce the command, pass a duration and a function which returns\n// a message containing the time at which the tick occurred.\n//\n//\ttype TickMsg time.Time\n//\n//\tcmd := Every(time.Second, func(t time.Time) Msg {\n//\t   return TickMsg(t)\n//\t})\n//\n// Beginners' note: Every sends a single message and won't automatically\n// dispatch messages at an interval. To do that, you'll want to return another\n// Every command after receiving your tick message. For example:\n//\n//\ttype TickMsg time.Time\n//\n//\t// Send a message every second.\n//\tfunc tickEvery() Cmd {\n//\t    return Every(time.Second, func(t time.Time) Msg {\n//\t        return TickMsg(t)\n//\t    })\n//\t}\n//\n//\tfunc (m model) Init() Cmd {\n//\t    // Start ticking.\n//\t    return tickEvery()\n//\t}\n//\n//\tfunc (m model) Update(msg Msg) (Model, Cmd) {\n//\t    switch msg.(type) {\n//\t    case TickMsg:\n//\t        // Return your Every command again to loop.\n//\t        return m, tickEvery()\n//\t    }\n//\t    return m, nil\n//\t}\n//\n// Every is analogous to Tick in the Elm Architecture.\nfunc Every(duration time.Duration, fn func(time.Time) Msg) Cmd {\n\tn := time.Now()\n\td := n.Truncate(duration).Add(duration).Sub(n)\n\tt := time.NewTimer(d)\n\treturn func() Msg {\n\t\tts := <-t.C\n\t\tt.Stop()\n\t\tfor len(t.C) > 0 {\n\t\t\t<-t.C\n\t\t}\n\t\treturn fn(ts)\n\t}\n}\n\n// Tick produces a command at an interval independent of the system clock at\n// the given duration. That is, the timer begins precisely when invoked,\n// and runs for its entire duration.\n//\n// To produce the command, pass a duration and a function which returns\n// a message containing the time at which the tick occurred.\n//\n//\ttype TickMsg time.Time\n//\n//\tcmd := Tick(time.Second, func(t time.Time) Msg {\n//\t   return TickMsg(t)\n//\t})\n//\n// Beginners' note: Tick sends a single message and won't automatically\n// dispatch messages at an interval. To do that, you'll want to return another\n// Tick command after receiving your tick message. For example:\n//\n//\ttype TickMsg time.Time\n//\n//\tfunc doTick() Cmd {\n//\t    return Tick(time.Second, func(t time.Time) Msg {\n//\t        return TickMsg(t)\n//\t    })\n//\t}\n//\n//\tfunc (m model) Init() Cmd {\n//\t    // Start ticking.\n//\t    return doTick()\n//\t}\n//\n//\tfunc (m model) Update(msg Msg) (Model, Cmd) {\n//\t    switch msg.(type) {\n//\t    case TickMsg:\n//\t        // Return your Tick command again to loop.\n//\t        return m, doTick()\n//\t    }\n//\t    return m, nil\n//\t}\nfunc Tick(d time.Duration, fn func(time.Time) Msg) Cmd {\n\tt := time.NewTimer(d)\n\treturn func() Msg {\n\t\tts := <-t.C\n\t\tt.Stop()\n\t\tfor len(t.C) > 0 {\n\t\t\t<-t.C\n\t\t}\n\t\treturn fn(ts)\n\t}\n}\n\n// Sequentially produces a command that sequentially executes the given\n// commands.\n// The Msg returned is the first non-nil message returned by a Cmd.\n//\n//\tfunc saveStateCmd() Msg {\n//\t   if err := save(); err != nil {\n//\t       return errMsg{err}\n//\t   }\n//\t   return nil\n//\t}\n//\n//\tcmd := Sequentially(saveStateCmd, Quit)\n//\n// Deprecated: use Sequence instead.\nfunc Sequentially(cmds ...Cmd) Cmd {\n\treturn func() Msg {\n\t\tfor _, cmd := range cmds {\n\t\t\tif cmd == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif msg := cmd(); msg != nil {\n\t\t\t\treturn msg\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// setWindowTitleMsg is an internal message used to set the window title.\ntype setWindowTitleMsg string\n\n// SetWindowTitle produces a command that sets the terminal title.\n//\n// For example:\n//\n//\tfunc (m model) Init() Cmd {\n//\t    // Set title.\n//\t    return tea.SetWindowTitle(\"My App\")\n//\t}\nfunc SetWindowTitle(title string) Cmd {\n\treturn func() Msg {\n\t\treturn setWindowTitleMsg(title)\n\t}\n}\n\ntype windowSizeMsg struct{}\n\n// WindowSize is a command that queries the terminal for its current size. It\n// delivers the results to Update via a [WindowSizeMsg]. Keep in mind that\n// WindowSizeMsgs will automatically be delivered to Update when the [Program]\n// starts and when the window dimensions change so in many cases you will not\n// need to explicitly invoke this command.\nfunc WindowSize() Cmd {\n\treturn func() Msg {\n\t\treturn windowSizeMsg{}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/exec.go",
    "content": "package tea\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n)\n\n// execMsg is used internally to run an ExecCommand sent with Exec.\ntype execMsg struct {\n\tcmd ExecCommand\n\tfn  ExecCallback\n}\n\n// Exec is used to perform arbitrary I/O in a blocking fashion, effectively\n// pausing the Program while execution is running and resuming it when\n// execution has completed.\n//\n// Most of the time you'll want to use ExecProcess, which runs an exec.Cmd.\n//\n// For non-interactive i/o you should use a Cmd (that is, a tea.Cmd).\nfunc Exec(c ExecCommand, fn ExecCallback) Cmd {\n\treturn func() Msg {\n\t\treturn execMsg{cmd: c, fn: fn}\n\t}\n}\n\n// ExecProcess runs the given *exec.Cmd in a blocking fashion, effectively\n// pausing the Program while the command is running. After the *exec.Cmd exists\n// the Program resumes. It's useful for spawning other interactive applications\n// such as editors and shells from within a Program.\n//\n// To produce the command, pass an *exec.Cmd and a function which returns\n// a message containing the error which may have occurred when running the\n// ExecCommand.\n//\n//\ttype VimFinishedMsg struct { err error }\n//\n//\tc := exec.Command(\"vim\", \"file.txt\")\n//\n//\tcmd := ExecProcess(c, func(err error) Msg {\n//\t    return VimFinishedMsg{err: err}\n//\t})\n//\n// Or, if you don't care about errors, you could simply:\n//\n//\tcmd := ExecProcess(exec.Command(\"vim\", \"file.txt\"), nil)\n//\n// For non-interactive i/o you should use a Cmd (that is, a tea.Cmd).\nfunc ExecProcess(c *exec.Cmd, fn ExecCallback) Cmd {\n\treturn Exec(wrapExecCommand(c), fn)\n}\n\n// ExecCallback is used when executing an *exec.Command to return a message\n// with an error, which may or may not be nil.\ntype ExecCallback func(error) Msg\n\n// ExecCommand can be implemented to execute things in a blocking fashion in\n// the current terminal.\ntype ExecCommand interface {\n\tRun() error\n\tSetStdin(io.Reader)\n\tSetStdout(io.Writer)\n\tSetStderr(io.Writer)\n}\n\n// wrapExecCommand wraps an exec.Cmd so that it satisfies the ExecCommand\n// interface so it can be used with Exec.\nfunc wrapExecCommand(c *exec.Cmd) ExecCommand {\n\treturn &osExecCommand{Cmd: c}\n}\n\n// osExecCommand is a layer over an exec.Cmd that satisfies the ExecCommand\n// interface.\ntype osExecCommand struct{ *exec.Cmd }\n\n// SetStdin sets stdin on underlying exec.Cmd to the given io.Reader.\nfunc (c *osExecCommand) SetStdin(r io.Reader) {\n\t// If unset, have the command use the same input as the terminal.\n\tif c.Stdin == nil {\n\t\tc.Stdin = r\n\t}\n}\n\n// SetStdout sets stdout on underlying exec.Cmd to the given io.Writer.\nfunc (c *osExecCommand) SetStdout(w io.Writer) {\n\t// If unset, have the command use the same output as the terminal.\n\tif c.Stdout == nil {\n\t\tc.Stdout = w\n\t}\n}\n\n// SetStderr sets stderr on the underlying exec.Cmd to the given io.Writer.\nfunc (c *osExecCommand) SetStderr(w io.Writer) {\n\t// If unset, use stderr for the command's stderr\n\tif c.Stderr == nil {\n\t\tc.Stderr = w\n\t}\n}\n\n// exec runs an ExecCommand and delivers the results to the program as a Msg.\nfunc (p *Program) exec(c ExecCommand, fn ExecCallback) {\n\tif err := p.ReleaseTerminal(); err != nil {\n\t\t// If we can't release input, abort.\n\t\tif fn != nil {\n\t\t\tgo p.Send(fn(err))\n\t\t}\n\t\treturn\n\t}\n\n\tc.SetStdin(p.input)\n\tc.SetStdout(p.output)\n\tc.SetStderr(os.Stderr)\n\n\t// Execute system command.\n\tif err := c.Run(); err != nil {\n\t\t_ = p.RestoreTerminal() // also try to restore the terminal.\n\t\tif fn != nil {\n\t\t\tgo p.Send(fn(err))\n\t\t}\n\t\treturn\n\t}\n\n\t// Have the program re-capture input.\n\terr := p.RestoreTerminal()\n\tif fn != nil {\n\t\tgo p.Send(fn(err))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/focus.go",
    "content": "package tea\n\n// FocusMsg represents a terminal focus message.\n// This occurs when the terminal gains focus.\ntype FocusMsg struct{}\n\n// BlurMsg represents a terminal blur message.\n// This occurs when the terminal loses focus.\ntype BlurMsg struct{}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/inputreader_other.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage tea\n\nimport (\n\t\"io\"\n\n\t\"github.com/muesli/cancelreader\"\n)\n\nfunc newInputReader(r io.Reader) (cancelreader.CancelReader, error) {\n\treturn cancelreader.NewReader(r)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/inputreader_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage tea\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/charmbracelet/x/term\"\n\t\"github.com/erikgeiser/coninput\"\n\t\"github.com/muesli/cancelreader\"\n\t\"golang.org/x/sys/windows\"\n)\n\ntype conInputReader struct {\n\tcancelMixin\n\n\tconin windows.Handle\n\n\toriginalMode uint32\n}\n\nvar _ cancelreader.CancelReader = &conInputReader{}\n\nfunc newInputReader(r io.Reader) (cancelreader.CancelReader, error) {\n\tfallback := func(io.Reader) (cancelreader.CancelReader, error) {\n\t\treturn cancelreader.NewReader(r)\n\t}\n\tif f, ok := r.(term.File); !ok || f.Fd() != os.Stdin.Fd() {\n\t\treturn fallback(r)\n\t}\n\n\tconin, err := coninput.NewStdinHandle()\n\tif err != nil {\n\t\treturn fallback(r)\n\t}\n\n\toriginalMode, err := prepareConsole(conin,\n\t\twindows.ENABLE_MOUSE_INPUT,\n\t\twindows.ENABLE_WINDOW_INPUT,\n\t\twindows.ENABLE_EXTENDED_FLAGS,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to prepare console input: %w\", err)\n\t}\n\n\treturn &conInputReader{\n\t\tconin:        conin,\n\t\toriginalMode: originalMode,\n\t}, nil\n}\n\n// Cancel implements cancelreader.CancelReader.\nfunc (r *conInputReader) Cancel() bool {\n\tr.setCanceled()\n\n\treturn windows.CancelIo(r.conin) == nil\n}\n\n// Close implements cancelreader.CancelReader.\nfunc (r *conInputReader) Close() error {\n\tif r.originalMode != 0 {\n\t\terr := windows.SetConsoleMode(r.conin, r.originalMode)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reset console mode: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Read implements cancelreader.CancelReader.\nfunc (*conInputReader) Read(_ []byte) (n int, err error) {\n\treturn 0, nil\n}\n\nfunc prepareConsole(input windows.Handle, modes ...uint32) (originalMode uint32, err error) {\n\terr = windows.GetConsoleMode(input, &originalMode)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"get console mode: %w\", err)\n\t}\n\n\tnewMode := coninput.AddInputModes(0, modes...)\n\n\terr = windows.SetConsoleMode(input, newMode)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"set console mode: %w\", err)\n\t}\n\n\treturn originalMode, nil\n}\n\n// cancelMixin represents a goroutine-safe cancelation status.\ntype cancelMixin struct {\n\tunsafeCanceled bool\n\tlock           sync.Mutex\n}\n\nfunc (c *cancelMixin) setCanceled() {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\tc.unsafeCanceled = true\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/key.go",
    "content": "package tea\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\n// KeyMsg contains information about a keypress. KeyMsgs are always sent to\n// the program's update function. There are a couple general patterns you could\n// use to check for keypresses:\n//\n//\t// Switch on the string representation of the key (shorter)\n//\tswitch msg := msg.(type) {\n//\tcase KeyMsg:\n//\t    switch msg.String() {\n//\t    case \"enter\":\n//\t        fmt.Println(\"you pressed enter!\")\n//\t    case \"a\":\n//\t        fmt.Println(\"you pressed a!\")\n//\t    }\n//\t}\n//\n//\t// Switch on the key type (more foolproof)\n//\tswitch msg := msg.(type) {\n//\tcase KeyMsg:\n//\t    switch msg.Type {\n//\t    case KeyEnter:\n//\t        fmt.Println(\"you pressed enter!\")\n//\t    case KeyRunes:\n//\t        switch string(msg.Runes) {\n//\t        case \"a\":\n//\t            fmt.Println(\"you pressed a!\")\n//\t        }\n//\t    }\n//\t}\n//\n// Note that Key.Runes will always contain at least one character, so you can\n// always safely call Key.Runes[0]. In most cases Key.Runes will only contain\n// one character, though certain input method editors (most notably Chinese\n// IMEs) can input multiple runes at once.\ntype KeyMsg Key\n\n// String returns a string representation for a key message. It's safe (and\n// encouraged) for use in key comparison.\nfunc (k KeyMsg) String() (str string) {\n\treturn Key(k).String()\n}\n\n// Key contains information about a keypress.\ntype Key struct {\n\tType  KeyType\n\tRunes []rune\n\tAlt   bool\n\tPaste bool\n}\n\n// String returns a friendly string representation for a key. It's safe (and\n// encouraged) for use in key comparison.\n//\n//\tk := Key{Type: KeyEnter}\n//\tfmt.Println(k)\n//\t// Output: enter\nfunc (k Key) String() (str string) {\n\tvar buf strings.Builder\n\tif k.Alt {\n\t\tbuf.WriteString(\"alt+\")\n\t}\n\tif k.Type == KeyRunes {\n\t\tif k.Paste {\n\t\t\t// Note: bubbles/keys bindings currently do string compares to\n\t\t\t// recognize shortcuts. Since pasted text should never activate\n\t\t\t// shortcuts, we need to ensure that the binding code doesn't\n\t\t\t// match Key events that result from pastes. We achieve this\n\t\t\t// here by enclosing pastes in '[...]' so that the string\n\t\t\t// comparison in Matches() fails in that case.\n\t\t\tbuf.WriteByte('[')\n\t\t}\n\t\tbuf.WriteString(string(k.Runes))\n\t\tif k.Paste {\n\t\t\tbuf.WriteByte(']')\n\t\t}\n\t\treturn buf.String()\n\t} else if s, ok := keyNames[k.Type]; ok {\n\t\tbuf.WriteString(s)\n\t\treturn buf.String()\n\t}\n\treturn \"\"\n}\n\n// KeyType indicates the key pressed, such as KeyEnter or KeyBreak or KeyCtrlC.\n// All other keys will be type KeyRunes. To get the rune value, check the Rune\n// method on a Key struct, or use the Key.String() method:\n//\n//\tk := Key{Type: KeyRunes, Runes: []rune{'a'}, Alt: true}\n//\tif k.Type == KeyRunes {\n//\n//\t    fmt.Println(k.Runes)\n//\t    // Output: a\n//\n//\t    fmt.Println(k.String())\n//\t    // Output: alt+a\n//\n//\t}\ntype KeyType int\n\nfunc (k KeyType) String() (str string) {\n\tif s, ok := keyNames[k]; ok {\n\t\treturn s\n\t}\n\treturn \"\"\n}\n\n// Control keys. We could do this with an iota, but the values are very\n// specific, so we set the values explicitly to avoid any confusion.\n//\n// See also:\n// https://en.wikipedia.org/wiki/C0_and_C1_control_codes\nconst (\n\tkeyNUL KeyType = 0   // null, \\0\n\tkeySOH KeyType = 1   // start of heading\n\tkeySTX KeyType = 2   // start of text\n\tkeyETX KeyType = 3   // break, ctrl+c\n\tkeyEOT KeyType = 4   // end of transmission\n\tkeyENQ KeyType = 5   // enquiry\n\tkeyACK KeyType = 6   // acknowledge\n\tkeyBEL KeyType = 7   // bell, \\a\n\tkeyBS  KeyType = 8   // backspace\n\tkeyHT  KeyType = 9   // horizontal tabulation, \\t\n\tkeyLF  KeyType = 10  // line feed, \\n\n\tkeyVT  KeyType = 11  // vertical tabulation \\v\n\tkeyFF  KeyType = 12  // form feed \\f\n\tkeyCR  KeyType = 13  // carriage return, \\r\n\tkeySO  KeyType = 14  // shift out\n\tkeySI  KeyType = 15  // shift in\n\tkeyDLE KeyType = 16  // data link escape\n\tkeyDC1 KeyType = 17  // device control one\n\tkeyDC2 KeyType = 18  // device control two\n\tkeyDC3 KeyType = 19  // device control three\n\tkeyDC4 KeyType = 20  // device control four\n\tkeyNAK KeyType = 21  // negative acknowledge\n\tkeySYN KeyType = 22  // synchronous idle\n\tkeyETB KeyType = 23  // end of transmission block\n\tkeyCAN KeyType = 24  // cancel\n\tkeyEM  KeyType = 25  // end of medium\n\tkeySUB KeyType = 26  // substitution\n\tkeyESC KeyType = 27  // escape, \\e\n\tkeyFS  KeyType = 28  // file separator\n\tkeyGS  KeyType = 29  // group separator\n\tkeyRS  KeyType = 30  // record separator\n\tkeyUS  KeyType = 31  // unit separator\n\tkeyDEL KeyType = 127 // delete. on most systems this is mapped to backspace, I hear\n)\n\n// Control key aliases.\nconst (\n\tKeyNull      KeyType = keyNUL\n\tKeyBreak     KeyType = keyETX\n\tKeyEnter     KeyType = keyCR\n\tKeyBackspace KeyType = keyDEL\n\tKeyTab       KeyType = keyHT\n\tKeyEsc       KeyType = keyESC\n\tKeyEscape    KeyType = keyESC\n\n\tKeyCtrlAt           KeyType = keyNUL // ctrl+@\n\tKeyCtrlA            KeyType = keySOH\n\tKeyCtrlB            KeyType = keySTX\n\tKeyCtrlC            KeyType = keyETX\n\tKeyCtrlD            KeyType = keyEOT\n\tKeyCtrlE            KeyType = keyENQ\n\tKeyCtrlF            KeyType = keyACK\n\tKeyCtrlG            KeyType = keyBEL\n\tKeyCtrlH            KeyType = keyBS\n\tKeyCtrlI            KeyType = keyHT\n\tKeyCtrlJ            KeyType = keyLF\n\tKeyCtrlK            KeyType = keyVT\n\tKeyCtrlL            KeyType = keyFF\n\tKeyCtrlM            KeyType = keyCR\n\tKeyCtrlN            KeyType = keySO\n\tKeyCtrlO            KeyType = keySI\n\tKeyCtrlP            KeyType = keyDLE\n\tKeyCtrlQ            KeyType = keyDC1\n\tKeyCtrlR            KeyType = keyDC2\n\tKeyCtrlS            KeyType = keyDC3\n\tKeyCtrlT            KeyType = keyDC4\n\tKeyCtrlU            KeyType = keyNAK\n\tKeyCtrlV            KeyType = keySYN\n\tKeyCtrlW            KeyType = keyETB\n\tKeyCtrlX            KeyType = keyCAN\n\tKeyCtrlY            KeyType = keyEM\n\tKeyCtrlZ            KeyType = keySUB\n\tKeyCtrlOpenBracket  KeyType = keyESC // ctrl+[\n\tKeyCtrlBackslash    KeyType = keyFS  // ctrl+\\\n\tKeyCtrlCloseBracket KeyType = keyGS  // ctrl+]\n\tKeyCtrlCaret        KeyType = keyRS  // ctrl+^\n\tKeyCtrlUnderscore   KeyType = keyUS  // ctrl+_\n\tKeyCtrlQuestionMark KeyType = keyDEL // ctrl+?\n)\n\n// Other keys.\nconst (\n\tKeyRunes KeyType = -(iota + 1)\n\tKeyUp\n\tKeyDown\n\tKeyRight\n\tKeyLeft\n\tKeyShiftTab\n\tKeyHome\n\tKeyEnd\n\tKeyPgUp\n\tKeyPgDown\n\tKeyCtrlPgUp\n\tKeyCtrlPgDown\n\tKeyDelete\n\tKeyInsert\n\tKeySpace\n\tKeyCtrlUp\n\tKeyCtrlDown\n\tKeyCtrlRight\n\tKeyCtrlLeft\n\tKeyCtrlHome\n\tKeyCtrlEnd\n\tKeyShiftUp\n\tKeyShiftDown\n\tKeyShiftRight\n\tKeyShiftLeft\n\tKeyShiftHome\n\tKeyShiftEnd\n\tKeyCtrlShiftUp\n\tKeyCtrlShiftDown\n\tKeyCtrlShiftLeft\n\tKeyCtrlShiftRight\n\tKeyCtrlShiftHome\n\tKeyCtrlShiftEnd\n\tKeyF1\n\tKeyF2\n\tKeyF3\n\tKeyF4\n\tKeyF5\n\tKeyF6\n\tKeyF7\n\tKeyF8\n\tKeyF9\n\tKeyF10\n\tKeyF11\n\tKeyF12\n\tKeyF13\n\tKeyF14\n\tKeyF15\n\tKeyF16\n\tKeyF17\n\tKeyF18\n\tKeyF19\n\tKeyF20\n)\n\n// Mappings for control keys and other special keys to friendly consts.\nvar keyNames = map[KeyType]string{\n\t// Control keys.\n\tkeyNUL: \"ctrl+@\", // also ctrl+` (that's ctrl+backtick)\n\tkeySOH: \"ctrl+a\",\n\tkeySTX: \"ctrl+b\",\n\tkeyETX: \"ctrl+c\",\n\tkeyEOT: \"ctrl+d\",\n\tkeyENQ: \"ctrl+e\",\n\tkeyACK: \"ctrl+f\",\n\tkeyBEL: \"ctrl+g\",\n\tkeyBS:  \"ctrl+h\",\n\tkeyHT:  \"tab\", // also ctrl+i\n\tkeyLF:  \"ctrl+j\",\n\tkeyVT:  \"ctrl+k\",\n\tkeyFF:  \"ctrl+l\",\n\tkeyCR:  \"enter\",\n\tkeySO:  \"ctrl+n\",\n\tkeySI:  \"ctrl+o\",\n\tkeyDLE: \"ctrl+p\",\n\tkeyDC1: \"ctrl+q\",\n\tkeyDC2: \"ctrl+r\",\n\tkeyDC3: \"ctrl+s\",\n\tkeyDC4: \"ctrl+t\",\n\tkeyNAK: \"ctrl+u\",\n\tkeySYN: \"ctrl+v\",\n\tkeyETB: \"ctrl+w\",\n\tkeyCAN: \"ctrl+x\",\n\tkeyEM:  \"ctrl+y\",\n\tkeySUB: \"ctrl+z\",\n\tkeyESC: \"esc\",\n\tkeyFS:  \"ctrl+\\\\\",\n\tkeyGS:  \"ctrl+]\",\n\tkeyRS:  \"ctrl+^\",\n\tkeyUS:  \"ctrl+_\",\n\tkeyDEL: \"backspace\",\n\n\t// Other keys.\n\tKeyRunes:          \"runes\",\n\tKeyUp:             \"up\",\n\tKeyDown:           \"down\",\n\tKeyRight:          \"right\",\n\tKeySpace:          \" \", // for backwards compatibility\n\tKeyLeft:           \"left\",\n\tKeyShiftTab:       \"shift+tab\",\n\tKeyHome:           \"home\",\n\tKeyEnd:            \"end\",\n\tKeyCtrlHome:       \"ctrl+home\",\n\tKeyCtrlEnd:        \"ctrl+end\",\n\tKeyShiftHome:      \"shift+home\",\n\tKeyShiftEnd:       \"shift+end\",\n\tKeyCtrlShiftHome:  \"ctrl+shift+home\",\n\tKeyCtrlShiftEnd:   \"ctrl+shift+end\",\n\tKeyPgUp:           \"pgup\",\n\tKeyPgDown:         \"pgdown\",\n\tKeyCtrlPgUp:       \"ctrl+pgup\",\n\tKeyCtrlPgDown:     \"ctrl+pgdown\",\n\tKeyDelete:         \"delete\",\n\tKeyInsert:         \"insert\",\n\tKeyCtrlUp:         \"ctrl+up\",\n\tKeyCtrlDown:       \"ctrl+down\",\n\tKeyCtrlRight:      \"ctrl+right\",\n\tKeyCtrlLeft:       \"ctrl+left\",\n\tKeyShiftUp:        \"shift+up\",\n\tKeyShiftDown:      \"shift+down\",\n\tKeyShiftRight:     \"shift+right\",\n\tKeyShiftLeft:      \"shift+left\",\n\tKeyCtrlShiftUp:    \"ctrl+shift+up\",\n\tKeyCtrlShiftDown:  \"ctrl+shift+down\",\n\tKeyCtrlShiftLeft:  \"ctrl+shift+left\",\n\tKeyCtrlShiftRight: \"ctrl+shift+right\",\n\tKeyF1:             \"f1\",\n\tKeyF2:             \"f2\",\n\tKeyF3:             \"f3\",\n\tKeyF4:             \"f4\",\n\tKeyF5:             \"f5\",\n\tKeyF6:             \"f6\",\n\tKeyF7:             \"f7\",\n\tKeyF8:             \"f8\",\n\tKeyF9:             \"f9\",\n\tKeyF10:            \"f10\",\n\tKeyF11:            \"f11\",\n\tKeyF12:            \"f12\",\n\tKeyF13:            \"f13\",\n\tKeyF14:            \"f14\",\n\tKeyF15:            \"f15\",\n\tKeyF16:            \"f16\",\n\tKeyF17:            \"f17\",\n\tKeyF18:            \"f18\",\n\tKeyF19:            \"f19\",\n\tKeyF20:            \"f20\",\n}\n\n// Sequence mappings.\nvar sequences = map[string]Key{\n\t// Arrow keys\n\t\"\\x1b[A\":    {Type: KeyUp},\n\t\"\\x1b[B\":    {Type: KeyDown},\n\t\"\\x1b[C\":    {Type: KeyRight},\n\t\"\\x1b[D\":    {Type: KeyLeft},\n\t\"\\x1b[1;2A\": {Type: KeyShiftUp},\n\t\"\\x1b[1;2B\": {Type: KeyShiftDown},\n\t\"\\x1b[1;2C\": {Type: KeyShiftRight},\n\t\"\\x1b[1;2D\": {Type: KeyShiftLeft},\n\t\"\\x1b[OA\":   {Type: KeyShiftUp},    // DECCKM\n\t\"\\x1b[OB\":   {Type: KeyShiftDown},  // DECCKM\n\t\"\\x1b[OC\":   {Type: KeyShiftRight}, // DECCKM\n\t\"\\x1b[OD\":   {Type: KeyShiftLeft},  // DECCKM\n\t\"\\x1b[a\":    {Type: KeyShiftUp},    // urxvt\n\t\"\\x1b[b\":    {Type: KeyShiftDown},  // urxvt\n\t\"\\x1b[c\":    {Type: KeyShiftRight}, // urxvt\n\t\"\\x1b[d\":    {Type: KeyShiftLeft},  // urxvt\n\t\"\\x1b[1;3A\": {Type: KeyUp, Alt: true},\n\t\"\\x1b[1;3B\": {Type: KeyDown, Alt: true},\n\t\"\\x1b[1;3C\": {Type: KeyRight, Alt: true},\n\t\"\\x1b[1;3D\": {Type: KeyLeft, Alt: true},\n\n\t\"\\x1b[1;4A\": {Type: KeyShiftUp, Alt: true},\n\t\"\\x1b[1;4B\": {Type: KeyShiftDown, Alt: true},\n\t\"\\x1b[1;4C\": {Type: KeyShiftRight, Alt: true},\n\t\"\\x1b[1;4D\": {Type: KeyShiftLeft, Alt: true},\n\n\t\"\\x1b[1;5A\": {Type: KeyCtrlUp},\n\t\"\\x1b[1;5B\": {Type: KeyCtrlDown},\n\t\"\\x1b[1;5C\": {Type: KeyCtrlRight},\n\t\"\\x1b[1;5D\": {Type: KeyCtrlLeft},\n\t\"\\x1b[Oa\":   {Type: KeyCtrlUp, Alt: true},    // urxvt\n\t\"\\x1b[Ob\":   {Type: KeyCtrlDown, Alt: true},  // urxvt\n\t\"\\x1b[Oc\":   {Type: KeyCtrlRight, Alt: true}, // urxvt\n\t\"\\x1b[Od\":   {Type: KeyCtrlLeft, Alt: true},  // urxvt\n\t\"\\x1b[1;6A\": {Type: KeyCtrlShiftUp},\n\t\"\\x1b[1;6B\": {Type: KeyCtrlShiftDown},\n\t\"\\x1b[1;6C\": {Type: KeyCtrlShiftRight},\n\t\"\\x1b[1;6D\": {Type: KeyCtrlShiftLeft},\n\t\"\\x1b[1;7A\": {Type: KeyCtrlUp, Alt: true},\n\t\"\\x1b[1;7B\": {Type: KeyCtrlDown, Alt: true},\n\t\"\\x1b[1;7C\": {Type: KeyCtrlRight, Alt: true},\n\t\"\\x1b[1;7D\": {Type: KeyCtrlLeft, Alt: true},\n\t\"\\x1b[1;8A\": {Type: KeyCtrlShiftUp, Alt: true},\n\t\"\\x1b[1;8B\": {Type: KeyCtrlShiftDown, Alt: true},\n\t\"\\x1b[1;8C\": {Type: KeyCtrlShiftRight, Alt: true},\n\t\"\\x1b[1;8D\": {Type: KeyCtrlShiftLeft, Alt: true},\n\n\t// Miscellaneous keys\n\t\"\\x1b[Z\": {Type: KeyShiftTab},\n\n\t\"\\x1b[2~\":   {Type: KeyInsert},\n\t\"\\x1b[3;2~\": {Type: KeyInsert, Alt: true},\n\n\t\"\\x1b[3~\":   {Type: KeyDelete},\n\t\"\\x1b[3;3~\": {Type: KeyDelete, Alt: true},\n\n\t\"\\x1b[5~\":   {Type: KeyPgUp},\n\t\"\\x1b[5;3~\": {Type: KeyPgUp, Alt: true},\n\t\"\\x1b[5;5~\": {Type: KeyCtrlPgUp},\n\t\"\\x1b[5^\":   {Type: KeyCtrlPgUp}, // urxvt\n\t\"\\x1b[5;7~\": {Type: KeyCtrlPgUp, Alt: true},\n\n\t\"\\x1b[6~\":   {Type: KeyPgDown},\n\t\"\\x1b[6;3~\": {Type: KeyPgDown, Alt: true},\n\t\"\\x1b[6;5~\": {Type: KeyCtrlPgDown},\n\t\"\\x1b[6^\":   {Type: KeyCtrlPgDown}, // urxvt\n\t\"\\x1b[6;7~\": {Type: KeyCtrlPgDown, Alt: true},\n\n\t\"\\x1b[1~\":   {Type: KeyHome},\n\t\"\\x1b[H\":    {Type: KeyHome},                     // xterm, lxterm\n\t\"\\x1b[1;3H\": {Type: KeyHome, Alt: true},          // xterm, lxterm\n\t\"\\x1b[1;5H\": {Type: KeyCtrlHome},                 // xterm, lxterm\n\t\"\\x1b[1;7H\": {Type: KeyCtrlHome, Alt: true},      // xterm, lxterm\n\t\"\\x1b[1;2H\": {Type: KeyShiftHome},                // xterm, lxterm\n\t\"\\x1b[1;4H\": {Type: KeyShiftHome, Alt: true},     // xterm, lxterm\n\t\"\\x1b[1;6H\": {Type: KeyCtrlShiftHome},            // xterm, lxterm\n\t\"\\x1b[1;8H\": {Type: KeyCtrlShiftHome, Alt: true}, // xterm, lxterm\n\n\t\"\\x1b[4~\":   {Type: KeyEnd},\n\t\"\\x1b[F\":    {Type: KeyEnd},                     // xterm, lxterm\n\t\"\\x1b[1;3F\": {Type: KeyEnd, Alt: true},          // xterm, lxterm\n\t\"\\x1b[1;5F\": {Type: KeyCtrlEnd},                 // xterm, lxterm\n\t\"\\x1b[1;7F\": {Type: KeyCtrlEnd, Alt: true},      // xterm, lxterm\n\t\"\\x1b[1;2F\": {Type: KeyShiftEnd},                // xterm, lxterm\n\t\"\\x1b[1;4F\": {Type: KeyShiftEnd, Alt: true},     // xterm, lxterm\n\t\"\\x1b[1;6F\": {Type: KeyCtrlShiftEnd},            // xterm, lxterm\n\t\"\\x1b[1;8F\": {Type: KeyCtrlShiftEnd, Alt: true}, // xterm, lxterm\n\n\t\"\\x1b[7~\": {Type: KeyHome},          // urxvt\n\t\"\\x1b[7^\": {Type: KeyCtrlHome},      // urxvt\n\t\"\\x1b[7$\": {Type: KeyShiftHome},     // urxvt\n\t\"\\x1b[7@\": {Type: KeyCtrlShiftHome}, // urxvt\n\n\t\"\\x1b[8~\": {Type: KeyEnd},          // urxvt\n\t\"\\x1b[8^\": {Type: KeyCtrlEnd},      // urxvt\n\t\"\\x1b[8$\": {Type: KeyShiftEnd},     // urxvt\n\t\"\\x1b[8@\": {Type: KeyCtrlShiftEnd}, // urxvt\n\n\t// Function keys, Linux console\n\t\"\\x1b[[A\": {Type: KeyF1}, // linux console\n\t\"\\x1b[[B\": {Type: KeyF2}, // linux console\n\t\"\\x1b[[C\": {Type: KeyF3}, // linux console\n\t\"\\x1b[[D\": {Type: KeyF4}, // linux console\n\t\"\\x1b[[E\": {Type: KeyF5}, // linux console\n\n\t// Function keys, X11\n\t\"\\x1bOP\": {Type: KeyF1}, // vt100, xterm\n\t\"\\x1bOQ\": {Type: KeyF2}, // vt100, xterm\n\t\"\\x1bOR\": {Type: KeyF3}, // vt100, xterm\n\t\"\\x1bOS\": {Type: KeyF4}, // vt100, xterm\n\n\t\"\\x1b[1;3P\": {Type: KeyF1, Alt: true}, // vt100, xterm\n\t\"\\x1b[1;3Q\": {Type: KeyF2, Alt: true}, // vt100, xterm\n\t\"\\x1b[1;3R\": {Type: KeyF3, Alt: true}, // vt100, xterm\n\t\"\\x1b[1;3S\": {Type: KeyF4, Alt: true}, // vt100, xterm\n\n\t\"\\x1b[11~\": {Type: KeyF1}, // urxvt\n\t\"\\x1b[12~\": {Type: KeyF2}, // urxvt\n\t\"\\x1b[13~\": {Type: KeyF3}, // urxvt\n\t\"\\x1b[14~\": {Type: KeyF4}, // urxvt\n\n\t\"\\x1b[15~\": {Type: KeyF5}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[15;3~\": {Type: KeyF5, Alt: true}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[17~\": {Type: KeyF6},  // vt100, xterm, also urxvt\n\t\"\\x1b[18~\": {Type: KeyF7},  // vt100, xterm, also urxvt\n\t\"\\x1b[19~\": {Type: KeyF8},  // vt100, xterm, also urxvt\n\t\"\\x1b[20~\": {Type: KeyF9},  // vt100, xterm, also urxvt\n\t\"\\x1b[21~\": {Type: KeyF10}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[17;3~\": {Type: KeyF6, Alt: true},  // vt100, xterm\n\t\"\\x1b[18;3~\": {Type: KeyF7, Alt: true},  // vt100, xterm\n\t\"\\x1b[19;3~\": {Type: KeyF8, Alt: true},  // vt100, xterm\n\t\"\\x1b[20;3~\": {Type: KeyF9, Alt: true},  // vt100, xterm\n\t\"\\x1b[21;3~\": {Type: KeyF10, Alt: true}, // vt100, xterm\n\n\t\"\\x1b[23~\": {Type: KeyF11}, // vt100, xterm, also urxvt\n\t\"\\x1b[24~\": {Type: KeyF12}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[23;3~\": {Type: KeyF11, Alt: true}, // vt100, xterm\n\t\"\\x1b[24;3~\": {Type: KeyF12, Alt: true}, // vt100, xterm\n\n\t\"\\x1b[1;2P\": {Type: KeyF13},\n\t\"\\x1b[1;2Q\": {Type: KeyF14},\n\n\t\"\\x1b[25~\": {Type: KeyF13}, // vt100, xterm, also urxvt\n\t\"\\x1b[26~\": {Type: KeyF14}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[25;3~\": {Type: KeyF13, Alt: true}, // vt100, xterm\n\t\"\\x1b[26;3~\": {Type: KeyF14, Alt: true}, // vt100, xterm\n\n\t\"\\x1b[1;2R\": {Type: KeyF15},\n\t\"\\x1b[1;2S\": {Type: KeyF16},\n\n\t\"\\x1b[28~\": {Type: KeyF15}, // vt100, xterm, also urxvt\n\t\"\\x1b[29~\": {Type: KeyF16}, // vt100, xterm, also urxvt\n\n\t\"\\x1b[28;3~\": {Type: KeyF15, Alt: true}, // vt100, xterm\n\t\"\\x1b[29;3~\": {Type: KeyF16, Alt: true}, // vt100, xterm\n\n\t\"\\x1b[15;2~\": {Type: KeyF17},\n\t\"\\x1b[17;2~\": {Type: KeyF18},\n\t\"\\x1b[18;2~\": {Type: KeyF19},\n\t\"\\x1b[19;2~\": {Type: KeyF20},\n\n\t\"\\x1b[31~\": {Type: KeyF17},\n\t\"\\x1b[32~\": {Type: KeyF18},\n\t\"\\x1b[33~\": {Type: KeyF19},\n\t\"\\x1b[34~\": {Type: KeyF20},\n\n\t// Powershell sequences.\n\t\"\\x1bOA\": {Type: KeyUp, Alt: false},\n\t\"\\x1bOB\": {Type: KeyDown, Alt: false},\n\t\"\\x1bOC\": {Type: KeyRight, Alt: false},\n\t\"\\x1bOD\": {Type: KeyLeft, Alt: false},\n}\n\n// unknownInputByteMsg is reported by the input reader when an invalid\n// utf-8 byte is detected on the input. Currently, it is not handled\n// further by bubbletea. However, having this event makes it possible\n// to troubleshoot invalid inputs.\ntype unknownInputByteMsg byte\n\nfunc (u unknownInputByteMsg) String() string {\n\treturn fmt.Sprintf(\"?%#02x?\", int(u))\n}\n\n// unknownCSISequenceMsg is reported by the input reader when an\n// unrecognized CSI sequence is detected on the input. Currently, it\n// is not handled further by bubbletea. However, having this event\n// makes it possible to troubleshoot invalid inputs.\ntype unknownCSISequenceMsg []byte\n\nfunc (u unknownCSISequenceMsg) String() string {\n\treturn fmt.Sprintf(\"?CSI%+v?\", []byte(u)[2:])\n}\n\nvar spaceRunes = []rune{' '}\n\n// readAnsiInputs reads keypress and mouse inputs from a TTY and produces messages\n// containing information about the key or mouse events accordingly.\nfunc readAnsiInputs(ctx context.Context, msgs chan<- Msg, input io.Reader) error {\n\tvar buf [256]byte\n\n\tvar leftOverFromPrevIteration []byte\nloop:\n\tfor {\n\t\t// Read and block.\n\t\tnumBytes, err := input.Read(buf[:])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading input: %w\", err)\n\t\t}\n\t\tb := buf[:numBytes]\n\t\tif leftOverFromPrevIteration != nil {\n\t\t\tb = append(leftOverFromPrevIteration, b...)\n\t\t}\n\n\t\t// If we had a short read (numBytes < len(buf)), we're sure that\n\t\t// the end of this read is an event boundary, so there is no doubt\n\t\t// if we are encountering the end of the buffer while parsing a message.\n\t\t// However, if we've succeeded in filling up the buffer, there may\n\t\t// be more data in the OS buffer ready to be read in, to complete\n\t\t// the last message in the input. In that case, we will retry with\n\t\t// the left over data in the next iteration.\n\t\tcanHaveMoreData := numBytes == len(buf)\n\n\t\tvar i, w int\n\t\tfor i, w = 0, 0; i < len(b); i += w {\n\t\t\tvar msg Msg\n\t\t\tw, msg = detectOneMsg(b[i:], canHaveMoreData)\n\t\t\tif w == 0 {\n\t\t\t\t// Expecting more bytes beyond the current buffer. Try waiting\n\t\t\t\t// for more input.\n\t\t\t\tleftOverFromPrevIteration = make([]byte, 0, len(b[i:])+len(buf))\n\t\t\t\tleftOverFromPrevIteration = append(leftOverFromPrevIteration, b[i:]...)\n\t\t\t\tcontinue loop\n\t\t\t}\n\n\t\t\tselect {\n\t\t\tcase msgs <- msg:\n\t\t\tcase <-ctx.Done():\n\t\t\t\terr := ctx.Err()\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = fmt.Errorf(\"found context error while reading input: %w\", err)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tleftOverFromPrevIteration = nil\n\t}\n}\n\nvar (\n\tunknownCSIRe  = regexp.MustCompile(`^\\x1b\\[[\\x30-\\x3f]*[\\x20-\\x2f]*[\\x40-\\x7e]`)\n\tmouseSGRRegex = regexp.MustCompile(`(\\d+);(\\d+);(\\d+)([Mm])`)\n)\n\nfunc detectOneMsg(b []byte, canHaveMoreData bool) (w int, msg Msg) {\n\t// Detect mouse events.\n\t// X10 mouse events have a length of 6 bytes\n\tconst mouseEventX10Len = 6\n\tif len(b) >= mouseEventX10Len && b[0] == '\\x1b' && b[1] == '[' {\n\t\tswitch b[2] {\n\t\tcase 'M':\n\t\t\treturn mouseEventX10Len, MouseMsg(parseX10MouseEvent(b))\n\t\tcase '<':\n\t\t\tif matchIndices := mouseSGRRegex.FindSubmatchIndex(b[3:]); matchIndices != nil {\n\t\t\t\t// SGR mouse events length is the length of the match plus the length of the escape sequence\n\t\t\t\tmouseEventSGRLen := matchIndices[1] + 3 //nolint:gomnd\n\t\t\t\treturn mouseEventSGRLen, MouseMsg(parseSGRMouseEvent(b))\n\t\t\t}\n\t\t}\n\t}\n\n\t// Detect focus events.\n\tvar foundRF bool\n\tfoundRF, w, msg = detectReportFocus(b)\n\tif foundRF {\n\t\treturn w, msg\n\t}\n\n\t// Detect bracketed paste.\n\tvar foundbp bool\n\tfoundbp, w, msg = detectBracketedPaste(b)\n\tif foundbp {\n\t\treturn w, msg\n\t}\n\n\t// Detect escape sequence and control characters other than NUL,\n\t// possibly with an escape character in front to mark the Alt\n\t// modifier.\n\tvar foundSeq bool\n\tfoundSeq, w, msg = detectSequence(b)\n\tif foundSeq {\n\t\treturn w, msg\n\t}\n\n\t// No non-NUL control character or escape sequence.\n\t// If we are seeing at least an escape character, remember it for later below.\n\talt := false\n\ti := 0\n\tif b[0] == '\\x1b' {\n\t\talt = true\n\t\ti++\n\t}\n\n\t// Are we seeing a standalone NUL? This is not handled by detectSequence().\n\tif i < len(b) && b[i] == 0 {\n\t\treturn i + 1, KeyMsg{Type: keyNUL, Alt: alt}\n\t}\n\n\t// Find the longest sequence of runes that are not control\n\t// characters from this point.\n\tvar runes []rune\n\tfor rw := 0; i < len(b); i += rw {\n\t\tvar r rune\n\t\tr, rw = utf8.DecodeRune(b[i:])\n\t\tif r == utf8.RuneError || r <= rune(keyUS) || r == rune(keyDEL) || r == ' ' {\n\t\t\t// Rune errors are handled below; control characters and spaces will\n\t\t\t// be handled by detectSequence in the next call to detectOneMsg.\n\t\t\tbreak\n\t\t}\n\t\trunes = append(runes, r)\n\t\tif alt {\n\t\t\t// We only support a single rune after an escape alt modifier.\n\t\t\ti += rw\n\t\t\tbreak\n\t\t}\n\t}\n\tif i >= len(b) && canHaveMoreData {\n\t\t// We have encountered the end of the input buffer. Alas, we can't\n\t\t// be sure whether the data in the remainder of the buffer is\n\t\t// complete (maybe there was a short read). Instead of sending anything\n\t\t// dumb to the message channel, do a short read. The outer loop will\n\t\t// handle this case by extending the buffer as necessary.\n\t\treturn 0, nil\n\t}\n\n\t// If we found at least one rune, we report the bunch of them as\n\t// a single KeyRunes or KeySpace event.\n\tif len(runes) > 0 {\n\t\tk := Key{Type: KeyRunes, Runes: runes, Alt: alt}\n\t\tif len(runes) == 1 && runes[0] == ' ' {\n\t\t\tk.Type = KeySpace\n\t\t}\n\t\treturn i, KeyMsg(k)\n\t}\n\n\t// We didn't find an escape sequence, nor a valid rune. Was this a\n\t// lone escape character at the end of the input?\n\tif alt && len(b) == 1 {\n\t\treturn 1, KeyMsg(Key{Type: KeyEscape})\n\t}\n\n\t// The character at the current position is neither an escape\n\t// sequence, a valid rune start or a sole escape character. Report\n\t// it as an invalid byte.\n\treturn 1, unknownInputByteMsg(b[0])\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/key_other.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage tea\n\nimport (\n\t\"context\"\n\t\"io\"\n)\n\nfunc readInputs(ctx context.Context, msgs chan<- Msg, input io.Reader) error {\n\treturn readAnsiInputs(ctx, msgs, input)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/key_sequences.go",
    "content": "package tea\n\nimport (\n\t\"bytes\"\n\t\"sort\"\n\t\"unicode/utf8\"\n)\n\n// extSequences is used by the map-based algorithm below. It contains\n// the sequences plus their alternatives with an escape character\n// prefixed, plus the control chars, plus the space.\n// It does not contain the NUL character, which is handled specially\n// by detectOneMsg.\nvar extSequences = func() map[string]Key {\n\ts := map[string]Key{}\n\tfor seq, key := range sequences {\n\t\tkey := key\n\t\ts[seq] = key\n\t\tif !key.Alt {\n\t\t\tkey.Alt = true\n\t\t\ts[\"\\x1b\"+seq] = key\n\t\t}\n\t}\n\tfor i := keyNUL + 1; i <= keyDEL; i++ {\n\t\tif i == keyESC {\n\t\t\tcontinue\n\t\t}\n\t\ts[string([]byte{byte(i)})] = Key{Type: i}\n\t\ts[string([]byte{'\\x1b', byte(i)})] = Key{Type: i, Alt: true}\n\t\tif i == keyUS {\n\t\t\ti = keyDEL - 1\n\t\t}\n\t}\n\ts[\" \"] = Key{Type: KeySpace, Runes: spaceRunes}\n\ts[\"\\x1b \"] = Key{Type: KeySpace, Alt: true, Runes: spaceRunes}\n\ts[\"\\x1b\\x1b\"] = Key{Type: KeyEscape, Alt: true}\n\treturn s\n}()\n\n// seqLengths is the sizes of valid sequences, starting with the\n// largest size.\nvar seqLengths = func() []int {\n\tsizes := map[int]struct{}{}\n\tfor seq := range extSequences {\n\t\tsizes[len(seq)] = struct{}{}\n\t}\n\tlsizes := make([]int, 0, len(sizes))\n\tfor sz := range sizes {\n\t\tlsizes = append(lsizes, sz)\n\t}\n\tsort.Slice(lsizes, func(i, j int) bool { return lsizes[i] > lsizes[j] })\n\treturn lsizes\n}()\n\n// detectSequence uses a longest prefix match over the input\n// sequence and a hash map.\nfunc detectSequence(input []byte) (hasSeq bool, width int, msg Msg) {\n\tseqs := extSequences\n\tfor _, sz := range seqLengths {\n\t\tif sz > len(input) {\n\t\t\tcontinue\n\t\t}\n\t\tprefix := input[:sz]\n\t\tkey, ok := seqs[string(prefix)]\n\t\tif ok {\n\t\t\treturn true, sz, KeyMsg(key)\n\t\t}\n\t}\n\t// Is this an unknown CSI sequence?\n\tif loc := unknownCSIRe.FindIndex(input); loc != nil {\n\t\treturn true, loc[1], unknownCSISequenceMsg(input[:loc[1]])\n\t}\n\n\treturn false, 0, nil\n}\n\n// detectBracketedPaste detects an input pasted while bracketed\n// paste mode was enabled.\n//\n// Note: this function is a no-op if bracketed paste was not enabled\n// on the terminal, since in that case we'd never see this\n// particular escape sequence.\nfunc detectBracketedPaste(input []byte) (hasBp bool, width int, msg Msg) {\n\t// Detect the start sequence.\n\tconst bpStart = \"\\x1b[200~\"\n\tif len(input) < len(bpStart) || string(input[:len(bpStart)]) != bpStart {\n\t\treturn false, 0, nil\n\t}\n\n\t// Skip over the start sequence.\n\tinput = input[len(bpStart):]\n\n\t// If we saw the start sequence, then we must have an end sequence\n\t// as well. Find it.\n\tconst bpEnd = \"\\x1b[201~\"\n\tidx := bytes.Index(input, []byte(bpEnd))\n\tinputLen := len(bpStart) + idx + len(bpEnd)\n\tif idx == -1 {\n\t\t// We have encountered the end of the input buffer without seeing\n\t\t// the marker for the end of the bracketed paste.\n\t\t// Tell the outer loop we have done a short read and we want more.\n\t\treturn true, 0, nil\n\t}\n\n\t// The paste is everything in-between.\n\tpaste := input[:idx]\n\n\t// All there is in-between is runes, not to be interpreted further.\n\tk := Key{Type: KeyRunes, Paste: true}\n\tfor len(paste) > 0 {\n\t\tr, w := utf8.DecodeRune(paste)\n\t\tif r != utf8.RuneError {\n\t\t\tk.Runes = append(k.Runes, r)\n\t\t}\n\t\tpaste = paste[w:]\n\t}\n\n\treturn true, inputLen, KeyMsg(k)\n}\n\n// detectReportFocus detects a focus report sequence.\n// nolint: gomnd\nfunc detectReportFocus(input []byte) (hasRF bool, width int, msg Msg) {\n\tswitch {\n\tcase bytes.Equal(input, []byte(\"\\x1b[I\")):\n\t\treturn true, 3, FocusMsg{}\n\tcase bytes.Equal(input, []byte(\"\\x1b[O\")):\n\t\treturn true, 3, BlurMsg{}\n\t}\n\treturn false, 0, nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/key_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage tea\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/erikgeiser/coninput\"\n\tlocalereader \"github.com/mattn/go-localereader\"\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc readInputs(ctx context.Context, msgs chan<- Msg, input io.Reader) error {\n\tif coninReader, ok := input.(*conInputReader); ok {\n\t\treturn readConInputs(ctx, msgs, coninReader.conin)\n\t}\n\n\treturn readAnsiInputs(ctx, msgs, localereader.NewReader(input))\n}\n\nfunc readConInputs(ctx context.Context, msgsch chan<- Msg, con windows.Handle) error {\n\tvar ps coninput.ButtonState                 // keep track of previous mouse state\n\tvar ws coninput.WindowBufferSizeEventRecord // keep track of the last window size event\n\tfor {\n\t\tevents, err := coninput.ReadNConsoleInputs(con, 16)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"read coninput events: %w\", err)\n\t\t}\n\n\t\tfor _, event := range events {\n\t\t\tvar msgs []Msg\n\t\t\tswitch e := event.Unwrap().(type) {\n\t\t\tcase coninput.KeyEventRecord:\n\t\t\t\tif !e.KeyDown || e.VirtualKeyCode == coninput.VK_SHIFT {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tfor i := 0; i < int(e.RepeatCount); i++ {\n\t\t\t\t\teventKeyType := keyType(e)\n\t\t\t\t\tvar runes []rune\n\n\t\t\t\t\t// Add the character only if the key type is an actual character and not a control sequence.\n\t\t\t\t\t// This mimics the behavior in readAnsiInputs where the character is also removed.\n\t\t\t\t\t// We don't need to handle KeySpace here. See the comment in keyType().\n\t\t\t\t\tif eventKeyType == KeyRunes {\n\t\t\t\t\t\trunes = []rune{e.Char}\n\t\t\t\t\t}\n\n\t\t\t\t\tmsgs = append(msgs, KeyMsg{\n\t\t\t\t\t\tType:  eventKeyType,\n\t\t\t\t\t\tRunes: runes,\n\t\t\t\t\t\tAlt:   e.ControlKeyState.Contains(coninput.LEFT_ALT_PRESSED | coninput.RIGHT_ALT_PRESSED),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\tcase coninput.WindowBufferSizeEventRecord:\n\t\t\t\tif e != ws {\n\t\t\t\t\tws = e\n\t\t\t\t\tmsgs = append(msgs, WindowSizeMsg{\n\t\t\t\t\t\tWidth:  int(e.Size.X),\n\t\t\t\t\t\tHeight: int(e.Size.Y),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\tcase coninput.MouseEventRecord:\n\t\t\t\tevent := mouseEvent(ps, e)\n\t\t\t\tif event.Type != MouseUnknown {\n\t\t\t\t\tmsgs = append(msgs, event)\n\t\t\t\t}\n\t\t\t\tps = e.ButtonState\n\t\t\tcase coninput.FocusEventRecord, coninput.MenuEventRecord:\n\t\t\t\t// ignore\n\t\t\tdefault: // unknown event\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Send all messages to the channel\n\t\t\tfor _, msg := range msgs {\n\t\t\t\tselect {\n\t\t\t\tcase msgsch <- msg:\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\terr := ctx.Err()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"coninput context error: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc mouseEventButton(p, s coninput.ButtonState) (button MouseButton, action MouseAction) {\n\tbtn := p ^ s\n\taction = MouseActionPress\n\tif btn&s == 0 {\n\t\taction = MouseActionRelease\n\t}\n\n\tif btn == 0 {\n\t\tswitch {\n\t\tcase s&coninput.FROM_LEFT_1ST_BUTTON_PRESSED > 0:\n\t\t\tbutton = MouseButtonLeft\n\t\tcase s&coninput.FROM_LEFT_2ND_BUTTON_PRESSED > 0:\n\t\t\tbutton = MouseButtonMiddle\n\t\tcase s&coninput.RIGHTMOST_BUTTON_PRESSED > 0:\n\t\t\tbutton = MouseButtonRight\n\t\tcase s&coninput.FROM_LEFT_3RD_BUTTON_PRESSED > 0:\n\t\t\tbutton = MouseButtonBackward\n\t\tcase s&coninput.FROM_LEFT_4TH_BUTTON_PRESSED > 0:\n\t\t\tbutton = MouseButtonForward\n\t\t}\n\t\treturn\n\t}\n\n\tswitch {\n\tcase btn == coninput.FROM_LEFT_1ST_BUTTON_PRESSED: // left button\n\t\tbutton = MouseButtonLeft\n\tcase btn == coninput.RIGHTMOST_BUTTON_PRESSED: // right button\n\t\tbutton = MouseButtonRight\n\tcase btn == coninput.FROM_LEFT_2ND_BUTTON_PRESSED: // middle button\n\t\tbutton = MouseButtonMiddle\n\tcase btn == coninput.FROM_LEFT_3RD_BUTTON_PRESSED: // unknown (possibly mouse backward)\n\t\tbutton = MouseButtonBackward\n\tcase btn == coninput.FROM_LEFT_4TH_BUTTON_PRESSED: // unknown (possibly mouse forward)\n\t\tbutton = MouseButtonForward\n\t}\n\n\treturn button, action\n}\n\nfunc mouseEvent(p coninput.ButtonState, e coninput.MouseEventRecord) MouseMsg {\n\tev := MouseMsg{\n\t\tX:     int(e.MousePositon.X),\n\t\tY:     int(e.MousePositon.Y),\n\t\tAlt:   e.ControlKeyState.Contains(coninput.LEFT_ALT_PRESSED | coninput.RIGHT_ALT_PRESSED),\n\t\tCtrl:  e.ControlKeyState.Contains(coninput.LEFT_CTRL_PRESSED | coninput.RIGHT_CTRL_PRESSED),\n\t\tShift: e.ControlKeyState.Contains(coninput.SHIFT_PRESSED),\n\t}\n\tswitch e.EventFlags {\n\tcase coninput.CLICK, coninput.DOUBLE_CLICK:\n\t\tev.Button, ev.Action = mouseEventButton(p, e.ButtonState)\n\t\tif ev.Action == MouseActionRelease {\n\t\t\tev.Type = MouseRelease\n\t\t}\n\t\tswitch ev.Button {\n\t\tcase MouseButtonLeft:\n\t\t\tev.Type = MouseLeft\n\t\tcase MouseButtonMiddle:\n\t\t\tev.Type = MouseMiddle\n\t\tcase MouseButtonRight:\n\t\t\tev.Type = MouseRight\n\t\tcase MouseButtonBackward:\n\t\t\tev.Type = MouseBackward\n\t\tcase MouseButtonForward:\n\t\t\tev.Type = MouseForward\n\t\t}\n\tcase coninput.MOUSE_WHEELED:\n\t\tif e.WheelDirection > 0 {\n\t\t\tev.Button = MouseButtonWheelUp\n\t\t\tev.Type = MouseWheelUp\n\t\t} else {\n\t\t\tev.Button = MouseButtonWheelDown\n\t\t\tev.Type = MouseWheelDown\n\t\t}\n\tcase coninput.MOUSE_HWHEELED:\n\t\tif e.WheelDirection > 0 {\n\t\t\tev.Button = MouseButtonWheelRight\n\t\t\tev.Type = MouseWheelRight\n\t\t} else {\n\t\t\tev.Button = MouseButtonWheelLeft\n\t\t\tev.Type = MouseWheelLeft\n\t\t}\n\tcase coninput.MOUSE_MOVED:\n\t\tev.Button, _ = mouseEventButton(p, e.ButtonState)\n\t\tev.Action = MouseActionMotion\n\t\tev.Type = MouseMotion\n\t}\n\n\treturn ev\n}\n\nfunc keyType(e coninput.KeyEventRecord) KeyType {\n\tcode := e.VirtualKeyCode\n\n\tshiftPressed := e.ControlKeyState.Contains(coninput.SHIFT_PRESSED)\n\tctrlPressed := e.ControlKeyState.Contains(coninput.LEFT_CTRL_PRESSED | coninput.RIGHT_CTRL_PRESSED)\n\n\tswitch code {\n\tcase coninput.VK_RETURN:\n\t\treturn KeyEnter\n\tcase coninput.VK_BACK:\n\t\treturn KeyBackspace\n\tcase coninput.VK_TAB:\n\t\tif shiftPressed {\n\t\t\treturn KeyShiftTab\n\t\t}\n\t\treturn KeyTab\n\tcase coninput.VK_SPACE:\n\t\treturn KeyRunes // this could be KeySpace but on unix space also produces KeyRunes\n\tcase coninput.VK_ESCAPE:\n\t\treturn KeyEscape\n\tcase coninput.VK_UP:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftUp\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftUp\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlUp\n\t\tdefault:\n\t\t\treturn KeyUp\n\t\t}\n\tcase coninput.VK_DOWN:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftDown\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftDown\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlDown\n\t\tdefault:\n\t\t\treturn KeyDown\n\t\t}\n\tcase coninput.VK_RIGHT:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftRight\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftRight\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlRight\n\t\tdefault:\n\t\t\treturn KeyRight\n\t\t}\n\tcase coninput.VK_LEFT:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftLeft\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftLeft\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlLeft\n\t\tdefault:\n\t\t\treturn KeyLeft\n\t\t}\n\tcase coninput.VK_HOME:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftHome\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftHome\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlHome\n\t\tdefault:\n\t\t\treturn KeyHome\n\t\t}\n\tcase coninput.VK_END:\n\t\tswitch {\n\t\tcase shiftPressed && ctrlPressed:\n\t\t\treturn KeyCtrlShiftEnd\n\t\tcase shiftPressed:\n\t\t\treturn KeyShiftEnd\n\t\tcase ctrlPressed:\n\t\t\treturn KeyCtrlEnd\n\t\tdefault:\n\t\t\treturn KeyEnd\n\t\t}\n\tcase coninput.VK_PRIOR:\n\t\treturn KeyPgUp\n\tcase coninput.VK_NEXT:\n\t\treturn KeyPgDown\n\tcase coninput.VK_DELETE:\n\t\treturn KeyDelete\n\tdefault:\n\t\tif e.ControlKeyState&(coninput.LEFT_CTRL_PRESSED|coninput.RIGHT_CTRL_PRESSED) == 0 {\n\t\t\treturn KeyRunes\n\t\t}\n\n\t\tswitch e.Char {\n\t\tcase '@':\n\t\t\treturn KeyCtrlAt\n\t\tcase '\\x01':\n\t\t\treturn KeyCtrlA\n\t\tcase '\\x02':\n\t\t\treturn KeyCtrlB\n\t\tcase '\\x03':\n\t\t\treturn KeyCtrlC\n\t\tcase '\\x04':\n\t\t\treturn KeyCtrlD\n\t\tcase '\\x05':\n\t\t\treturn KeyCtrlE\n\t\tcase '\\x06':\n\t\t\treturn KeyCtrlF\n\t\tcase '\\a':\n\t\t\treturn KeyCtrlG\n\t\tcase '\\b':\n\t\t\treturn KeyCtrlH\n\t\tcase '\\t':\n\t\t\treturn KeyCtrlI\n\t\tcase '\\n':\n\t\t\treturn KeyCtrlJ\n\t\tcase '\\v':\n\t\t\treturn KeyCtrlK\n\t\tcase '\\f':\n\t\t\treturn KeyCtrlL\n\t\tcase '\\r':\n\t\t\treturn KeyCtrlM\n\t\tcase '\\x0e':\n\t\t\treturn KeyCtrlN\n\t\tcase '\\x0f':\n\t\t\treturn KeyCtrlO\n\t\tcase '\\x10':\n\t\t\treturn KeyCtrlP\n\t\tcase '\\x11':\n\t\t\treturn KeyCtrlQ\n\t\tcase '\\x12':\n\t\t\treturn KeyCtrlR\n\t\tcase '\\x13':\n\t\t\treturn KeyCtrlS\n\t\tcase '\\x14':\n\t\t\treturn KeyCtrlT\n\t\tcase '\\x15':\n\t\t\treturn KeyCtrlU\n\t\tcase '\\x16':\n\t\t\treturn KeyCtrlV\n\t\tcase '\\x17':\n\t\t\treturn KeyCtrlW\n\t\tcase '\\x18':\n\t\t\treturn KeyCtrlX\n\t\tcase '\\x19':\n\t\t\treturn KeyCtrlY\n\t\tcase '\\x1a':\n\t\t\treturn KeyCtrlZ\n\t\tcase '\\x1b':\n\t\t\treturn KeyCtrlCloseBracket\n\t\tcase '\\x1c':\n\t\t\treturn KeyCtrlBackslash\n\t\tcase '\\x1f':\n\t\t\treturn KeyCtrlUnderscore\n\t\t}\n\n\t\tswitch code {\n\t\tcase coninput.VK_OEM_4:\n\t\t\treturn KeyCtrlOpenBracket\n\t\t}\n\n\t\treturn KeyRunes\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/logging.go",
    "content": "package tea\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"unicode\"\n)\n\n// LogToFile sets up default logging to log to a file. This is helpful as we\n// can't print to the terminal since our TUI is occupying it. If the file\n// doesn't exist it will be created.\n//\n// Don't forget to close the file when you're done with it.\n//\n//\t  f, err := LogToFile(\"debug.log\", \"debug\")\n//\t  if err != nil {\n//\t\t\tfmt.Println(\"fatal:\", err)\n//\t\t\tos.Exit(1)\n//\t  }\n//\t  defer f.Close()\nfunc LogToFile(path string, prefix string) (*os.File, error) {\n\treturn LogToFileWith(path, prefix, log.Default())\n}\n\n// LogOptionsSetter is an interface implemented by stdlib's log and charm's log\n// libraries.\ntype LogOptionsSetter interface {\n\tSetOutput(io.Writer)\n\tSetPrefix(string)\n}\n\n// LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.\nfunc LogToFileWith(path string, prefix string, log LogOptionsSetter) (*os.File, error) {\n\tf, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o600) //nolint:gomnd\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error opening file for logging: %w\", err)\n\t}\n\tlog.SetOutput(f)\n\n\t// Add a space after the prefix if a prefix is being specified and it\n\t// doesn't already have a trailing space.\n\tif len(prefix) > 0 {\n\t\tfinalChar := prefix[len(prefix)-1]\n\t\tif !unicode.IsSpace(rune(finalChar)) {\n\t\t\tprefix += \" \"\n\t\t}\n\t}\n\tlog.SetPrefix(prefix)\n\n\treturn f, nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/mouse.go",
    "content": "package tea\n\nimport \"strconv\"\n\n// MouseMsg contains information about a mouse event and are sent to a programs\n// update function when mouse activity occurs. Note that the mouse must first\n// be enabled in order for the mouse events to be received.\ntype MouseMsg MouseEvent\n\n// String returns a string representation of a mouse event.\nfunc (m MouseMsg) String() string {\n\treturn MouseEvent(m).String()\n}\n\n// MouseEvent represents a mouse event, which could be a click, a scroll wheel\n// movement, a cursor movement, or a combination.\ntype MouseEvent struct {\n\tX      int\n\tY      int\n\tShift  bool\n\tAlt    bool\n\tCtrl   bool\n\tAction MouseAction\n\tButton MouseButton\n\n\t// Deprecated: Use MouseAction & MouseButton instead.\n\tType MouseEventType\n}\n\n// IsWheel returns true if the mouse event is a wheel event.\nfunc (m MouseEvent) IsWheel() bool {\n\treturn m.Button == MouseButtonWheelUp || m.Button == MouseButtonWheelDown ||\n\t\tm.Button == MouseButtonWheelLeft || m.Button == MouseButtonWheelRight\n}\n\n// String returns a string representation of a mouse event.\nfunc (m MouseEvent) String() (s string) {\n\tif m.Ctrl {\n\t\ts += \"ctrl+\"\n\t}\n\tif m.Alt {\n\t\ts += \"alt+\"\n\t}\n\tif m.Shift {\n\t\ts += \"shift+\"\n\t}\n\n\tif m.Button == MouseButtonNone { //nolint:nestif\n\t\tif m.Action == MouseActionMotion || m.Action == MouseActionRelease {\n\t\t\ts += mouseActions[m.Action]\n\t\t} else {\n\t\t\ts += \"unknown\"\n\t\t}\n\t} else if m.IsWheel() {\n\t\ts += mouseButtons[m.Button]\n\t} else {\n\t\tbtn := mouseButtons[m.Button]\n\t\tif btn != \"\" {\n\t\t\ts += btn\n\t\t}\n\t\tact := mouseActions[m.Action]\n\t\tif act != \"\" {\n\t\t\ts += \" \" + act\n\t\t}\n\t}\n\n\treturn s\n}\n\n// MouseAction represents the action that occurred during a mouse event.\ntype MouseAction int\n\n// Mouse event actions.\nconst (\n\tMouseActionPress MouseAction = iota\n\tMouseActionRelease\n\tMouseActionMotion\n)\n\nvar mouseActions = map[MouseAction]string{\n\tMouseActionPress:   \"press\",\n\tMouseActionRelease: \"release\",\n\tMouseActionMotion:  \"motion\",\n}\n\n// MouseButton represents the button that was pressed during a mouse event.\ntype MouseButton int\n\n// Mouse event buttons\n//\n// This is based on X11 mouse button codes.\n//\n//\t1 = left button\n//\t2 = middle button (pressing the scroll wheel)\n//\t3 = right button\n//\t4 = turn scroll wheel up\n//\t5 = turn scroll wheel down\n//\t6 = push scroll wheel left\n//\t7 = push scroll wheel right\n//\t8 = 4th button (aka browser backward button)\n//\t9 = 5th button (aka browser forward button)\n//\t10\n//\t11\n//\n// Other buttons are not supported.\nconst (\n\tMouseButtonNone MouseButton = iota\n\tMouseButtonLeft\n\tMouseButtonMiddle\n\tMouseButtonRight\n\tMouseButtonWheelUp\n\tMouseButtonWheelDown\n\tMouseButtonWheelLeft\n\tMouseButtonWheelRight\n\tMouseButtonBackward\n\tMouseButtonForward\n\tMouseButton10\n\tMouseButton11\n)\n\nvar mouseButtons = map[MouseButton]string{\n\tMouseButtonNone:       \"none\",\n\tMouseButtonLeft:       \"left\",\n\tMouseButtonMiddle:     \"middle\",\n\tMouseButtonRight:      \"right\",\n\tMouseButtonWheelUp:    \"wheel up\",\n\tMouseButtonWheelDown:  \"wheel down\",\n\tMouseButtonWheelLeft:  \"wheel left\",\n\tMouseButtonWheelRight: \"wheel right\",\n\tMouseButtonBackward:   \"backward\",\n\tMouseButtonForward:    \"forward\",\n\tMouseButton10:         \"button 10\",\n\tMouseButton11:         \"button 11\",\n}\n\n// MouseEventType indicates the type of mouse event occurring.\n//\n// Deprecated: Use MouseAction & MouseButton instead.\ntype MouseEventType int\n\n// Mouse event types.\n//\n// Deprecated: Use MouseAction & MouseButton instead.\nconst (\n\tMouseUnknown MouseEventType = iota\n\tMouseLeft\n\tMouseRight\n\tMouseMiddle\n\tMouseRelease // mouse button release (X10 only)\n\tMouseWheelUp\n\tMouseWheelDown\n\tMouseWheelLeft\n\tMouseWheelRight\n\tMouseBackward\n\tMouseForward\n\tMouseMotion\n)\n\n// Parse SGR-encoded mouse events; SGR extended mouse events. SGR mouse events\n// look like:\n//\n//\tESC [ < Cb ; Cx ; Cy (M or m)\n//\n// where:\n//\n//\tCb is the encoded button code\n//\tCx is the x-coordinate of the mouse\n//\tCy is the y-coordinate of the mouse\n//\tM is for button press, m is for button release\n//\n// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Extended-coordinates\nfunc parseSGRMouseEvent(buf []byte) MouseEvent {\n\tstr := string(buf[3:])\n\tmatches := mouseSGRRegex.FindStringSubmatch(str)\n\tif len(matches) != 5 { //nolint:gomnd\n\t\t// Unreachable, we already checked the regex in `detectOneMsg`.\n\t\tpanic(\"invalid mouse event\")\n\t}\n\n\tb, _ := strconv.Atoi(matches[1])\n\tpx := matches[2]\n\tpy := matches[3]\n\trelease := matches[4] == \"m\"\n\tm := parseMouseButton(b, true)\n\n\t// Wheel buttons don't have release events\n\t// Motion can be reported as a release event in some terminals (Windows Terminal)\n\tif m.Action != MouseActionMotion && !m.IsWheel() && release {\n\t\tm.Action = MouseActionRelease\n\t\tm.Type = MouseRelease\n\t}\n\n\tx, _ := strconv.Atoi(px)\n\ty, _ := strconv.Atoi(py)\n\n\t// (1,1) is the upper left. We subtract 1 to normalize it to (0,0).\n\tm.X = x - 1\n\tm.Y = y - 1\n\n\treturn m\n}\n\nconst x10MouseByteOffset = 32\n\n// Parse X10-encoded mouse events; the simplest kind. The last release of X10\n// was December 1986, by the way. The original X10 mouse protocol limits the Cx\n// and Cy coordinates to 223 (=255-032).\n//\n// X10 mouse events look like:\n//\n//\tESC [M Cb Cx Cy\n//\n// See: http://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking\nfunc parseX10MouseEvent(buf []byte) MouseEvent {\n\tv := buf[3:6]\n\tm := parseMouseButton(int(v[0]), false)\n\n\t// (1,1) is the upper left. We subtract 1 to normalize it to (0,0).\n\tm.X = int(v[1]) - x10MouseByteOffset - 1\n\tm.Y = int(v[2]) - x10MouseByteOffset - 1\n\n\treturn m\n}\n\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Extended-coordinates\nfunc parseMouseButton(b int, isSGR bool) MouseEvent {\n\tvar m MouseEvent\n\te := b\n\tif !isSGR {\n\t\te -= x10MouseByteOffset\n\t}\n\n\tconst (\n\t\tbitShift  = 0b0000_0100\n\t\tbitAlt    = 0b0000_1000\n\t\tbitCtrl   = 0b0001_0000\n\t\tbitMotion = 0b0010_0000\n\t\tbitWheel  = 0b0100_0000\n\t\tbitAdd    = 0b1000_0000 // additional buttons 8-11\n\n\t\tbitsMask = 0b0000_0011\n\t)\n\n\tif e&bitAdd != 0 {\n\t\tm.Button = MouseButtonBackward + MouseButton(e&bitsMask)\n\t} else if e&bitWheel != 0 {\n\t\tm.Button = MouseButtonWheelUp + MouseButton(e&bitsMask)\n\t} else {\n\t\tm.Button = MouseButtonLeft + MouseButton(e&bitsMask)\n\t\t// X10 reports a button release as 0b0000_0011 (3)\n\t\tif e&bitsMask == bitsMask {\n\t\t\tm.Action = MouseActionRelease\n\t\t\tm.Button = MouseButtonNone\n\t\t}\n\t}\n\n\t// Motion bit doesn't get reported for wheel events.\n\tif e&bitMotion != 0 && !m.IsWheel() {\n\t\tm.Action = MouseActionMotion\n\t}\n\n\t// Modifiers\n\tm.Alt = e&bitAlt != 0\n\tm.Ctrl = e&bitCtrl != 0\n\tm.Shift = e&bitShift != 0\n\n\t// backward compatibility\n\tswitch {\n\tcase m.Button == MouseButtonLeft && m.Action == MouseActionPress:\n\t\tm.Type = MouseLeft\n\tcase m.Button == MouseButtonMiddle && m.Action == MouseActionPress:\n\t\tm.Type = MouseMiddle\n\tcase m.Button == MouseButtonRight && m.Action == MouseActionPress:\n\t\tm.Type = MouseRight\n\tcase m.Button == MouseButtonNone && m.Action == MouseActionRelease:\n\t\tm.Type = MouseRelease\n\tcase m.Button == MouseButtonWheelUp && m.Action == MouseActionPress:\n\t\tm.Type = MouseWheelUp\n\tcase m.Button == MouseButtonWheelDown && m.Action == MouseActionPress:\n\t\tm.Type = MouseWheelDown\n\tcase m.Button == MouseButtonWheelLeft && m.Action == MouseActionPress:\n\t\tm.Type = MouseWheelLeft\n\tcase m.Button == MouseButtonWheelRight && m.Action == MouseActionPress:\n\t\tm.Type = MouseWheelRight\n\tcase m.Button == MouseButtonBackward && m.Action == MouseActionPress:\n\t\tm.Type = MouseBackward\n\tcase m.Button == MouseButtonForward && m.Action == MouseActionPress:\n\t\tm.Type = MouseForward\n\tcase m.Action == MouseActionMotion:\n\t\tm.Type = MouseMotion\n\t\tswitch m.Button { //nolint:exhaustive\n\t\tcase MouseButtonLeft:\n\t\t\tm.Type = MouseLeft\n\t\tcase MouseButtonMiddle:\n\t\t\tm.Type = MouseMiddle\n\t\tcase MouseButtonRight:\n\t\t\tm.Type = MouseRight\n\t\tcase MouseButtonBackward:\n\t\t\tm.Type = MouseBackward\n\t\tcase MouseButtonForward:\n\t\t\tm.Type = MouseForward\n\t\t}\n\tdefault:\n\t\tm.Type = MouseUnknown\n\t}\n\n\treturn m\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/nil_renderer.go",
    "content": "package tea\n\ntype nilRenderer struct{}\n\nfunc (n nilRenderer) start()                     {}\nfunc (n nilRenderer) stop()                      {}\nfunc (n nilRenderer) kill()                      {}\nfunc (n nilRenderer) write(_ string)             {}\nfunc (n nilRenderer) repaint()                   {}\nfunc (n nilRenderer) clearScreen()               {}\nfunc (n nilRenderer) altScreen() bool            { return false }\nfunc (n nilRenderer) enterAltScreen()            {}\nfunc (n nilRenderer) exitAltScreen()             {}\nfunc (n nilRenderer) showCursor()                {}\nfunc (n nilRenderer) hideCursor()                {}\nfunc (n nilRenderer) enableMouseCellMotion()     {}\nfunc (n nilRenderer) disableMouseCellMotion()    {}\nfunc (n nilRenderer) enableMouseAllMotion()      {}\nfunc (n nilRenderer) disableMouseAllMotion()     {}\nfunc (n nilRenderer) enableBracketedPaste()      {}\nfunc (n nilRenderer) disableBracketedPaste()     {}\nfunc (n nilRenderer) enableMouseSGRMode()        {}\nfunc (n nilRenderer) disableMouseSGRMode()       {}\nfunc (n nilRenderer) bracketedPasteActive() bool { return false }\nfunc (n nilRenderer) setWindowTitle(_ string)    {}\nfunc (n nilRenderer) reportFocus() bool          { return false }\nfunc (n nilRenderer) enableReportFocus()         {}\nfunc (n nilRenderer) disableReportFocus()        {}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/options.go",
    "content": "package tea\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"sync/atomic\"\n)\n\n// ProgramOption is used to set options when initializing a Program. Program can\n// accept a variable number of options.\n//\n// Example usage:\n//\n//\tp := NewProgram(model, WithInput(someInput), WithOutput(someOutput))\ntype ProgramOption func(*Program)\n\n// WithContext lets you specify a context in which to run the Program. This is\n// useful if you want to cancel the execution from outside. When a Program gets\n// cancelled it will exit with an error ErrProgramKilled.\nfunc WithContext(ctx context.Context) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.ctx = ctx\n\t}\n}\n\n// WithOutput sets the output which, by default, is stdout. In most cases you\n// won't need to use this.\nfunc WithOutput(output io.Writer) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.output = output\n\t}\n}\n\n// WithInput sets the input which, by default, is stdin. In most cases you\n// won't need to use this. To disable input entirely pass nil.\n//\n//\tp := NewProgram(model, WithInput(nil))\nfunc WithInput(input io.Reader) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.input = input\n\t\tp.inputType = customInput\n\t}\n}\n\n// WithInputTTY opens a new TTY for input (or console input device on Windows).\nfunc WithInputTTY() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.inputType = ttyInput\n\t}\n}\n\n// WithEnvironment sets the environment variables that the program will use.\n// This useful when the program is running in a remote session (e.g. SSH) and\n// you want to pass the environment variables from the remote session to the\n// program.\n//\n// Example:\n//\n//\tvar sess ssh.Session // ssh.Session is a type from the github.com/charmbracelet/ssh package\n//\tpty, _, _ := sess.Pty()\n//\tenviron := append(sess.Environ(), \"TERM=\"+pty.Term)\n//\tp := tea.NewProgram(model, tea.WithEnvironment(environ)\nfunc WithEnvironment(env []string) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.environ = env\n\t}\n}\n\n// WithoutSignalHandler disables the signal handler that Bubble Tea sets up for\n// Programs. This is useful if you want to handle signals yourself.\nfunc WithoutSignalHandler() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withoutSignalHandler\n\t}\n}\n\n// WithoutCatchPanics disables the panic catching that Bubble Tea does by\n// default. If panic catching is disabled the terminal will be in a fairly\n// unusable state after a panic because Bubble Tea will not perform its usual\n// cleanup on exit.\nfunc WithoutCatchPanics() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withoutCatchPanics\n\t}\n}\n\n// WithoutSignals will ignore OS signals.\n// This is mainly useful for testing.\nfunc WithoutSignals() ProgramOption {\n\treturn func(p *Program) {\n\t\tatomic.StoreUint32(&p.ignoreSignals, 1)\n\t}\n}\n\n// WithAltScreen starts the program with the alternate screen buffer enabled\n// (i.e. the program starts in full window mode). Note that the altscreen will\n// be automatically exited when the program quits.\n//\n// Example:\n//\n//\tp := tea.NewProgram(Model{}, tea.WithAltScreen())\n//\tif _, err := p.Run(); err != nil {\n//\t    fmt.Println(\"Error running program:\", err)\n//\t    os.Exit(1)\n//\t}\n//\n// To enter the altscreen once the program has already started running use the\n// EnterAltScreen command.\nfunc WithAltScreen() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withAltScreen\n\t}\n}\n\n// WithoutBracketedPaste starts the program with bracketed paste disabled.\nfunc WithoutBracketedPaste() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withoutBracketedPaste\n\t}\n}\n\n// WithMouseCellMotion starts the program with the mouse enabled in \"cell\n// motion\" mode.\n//\n// Cell motion mode enables mouse click, release, and wheel events. Mouse\n// movement events are also captured if a mouse button is pressed (i.e., drag\n// events). Cell motion mode is better supported than all motion mode.\n//\n// This will try to enable the mouse in extended mode (SGR), if that is not\n// supported by the terminal it will fall back to normal mode (X10).\n//\n// To enable mouse cell motion once the program has already started running use\n// the EnableMouseCellMotion command. To disable the mouse when the program is\n// running use the DisableMouse command.\n//\n// The mouse will be automatically disabled when the program exits.\nfunc WithMouseCellMotion() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withMouseCellMotion // set\n\t\tp.startupOptions &^= withMouseAllMotion // clear\n\t}\n}\n\n// WithMouseAllMotion starts the program with the mouse enabled in \"all motion\"\n// mode.\n//\n// EnableMouseAllMotion is a special command that enables mouse click, release,\n// wheel, and motion events, which are delivered regardless of whether a mouse\n// button is pressed, effectively enabling support for hover interactions.\n//\n// This will try to enable the mouse in extended mode (SGR), if that is not\n// supported by the terminal it will fall back to normal mode (X10).\n//\n// Many modern terminals support this, but not all. If in doubt, use\n// EnableMouseCellMotion instead.\n//\n// To enable the mouse once the program has already started running use the\n// EnableMouseAllMotion command. To disable the mouse when the program is\n// running use the DisableMouse command.\n//\n// The mouse will be automatically disabled when the program exits.\nfunc WithMouseAllMotion() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withMouseAllMotion   // set\n\t\tp.startupOptions &^= withMouseCellMotion // clear\n\t}\n}\n\n// WithoutRenderer disables the renderer. When this is set output and log\n// statements will be plainly sent to stdout (or another output if one is set)\n// without any rendering and redrawing logic. In other words, printing and\n// logging will behave the same way it would in a non-TUI commandline tool.\n// This can be useful if you want to use the Bubble Tea framework for a non-TUI\n// application, or to provide an additional non-TUI mode to your Bubble Tea\n// programs. For example, your program could behave like a daemon if output is\n// not a TTY.\nfunc WithoutRenderer() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.renderer = &nilRenderer{}\n\t}\n}\n\n// WithANSICompressor removes redundant ANSI sequences to produce potentially\n// smaller output, at the cost of some processing overhead.\n//\n// This feature is provisional, and may be changed or removed in a future version\n// of this package.\nfunc WithANSICompressor() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withANSICompressor\n\t}\n}\n\n// WithFilter supplies an event filter that will be invoked before Bubble Tea\n// processes a tea.Msg. The event filter can return any tea.Msg which will then\n// get handled by Bubble Tea instead of the original event. If the event filter\n// returns nil, the event will be ignored and Bubble Tea will not process it.\n//\n// As an example, this could be used to prevent a program from shutting down if\n// there are unsaved changes.\n//\n// Example:\n//\n//\tfunc filter(m tea.Model, msg tea.Msg) tea.Msg {\n//\t\tif _, ok := msg.(tea.QuitMsg); !ok {\n//\t\t\treturn msg\n//\t\t}\n//\n//\t\tmodel := m.(myModel)\n//\t\tif model.hasChanges {\n//\t\t\treturn nil\n//\t\t}\n//\n//\t\treturn msg\n//\t}\n//\n//\tp := tea.NewProgram(Model{}, tea.WithFilter(filter));\n//\n//\tif _,err := p.Run(); err != nil {\n//\t\tfmt.Println(\"Error running program:\", err)\n//\t\tos.Exit(1)\n//\t}\nfunc WithFilter(filter func(Model, Msg) Msg) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.filter = filter\n\t}\n}\n\n// WithFPS sets a custom maximum FPS at which the renderer should run. If\n// less than 1, the default value of 60 will be used. If over 120, the FPS\n// will be capped at 120.\nfunc WithFPS(fps int) ProgramOption {\n\treturn func(p *Program) {\n\t\tp.fps = fps\n\t}\n}\n\n// WithReportFocus enables reporting when the terminal gains and lost focus.\n//\n// You can then check for FocusMsg and BlurMsg in your model's Update method.\nfunc WithReportFocus() ProgramOption {\n\treturn func(p *Program) {\n\t\tp.startupOptions |= withReportFocus\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/renderer.go",
    "content": "package tea\n\n// renderer is the interface for Bubble Tea renderers.\ntype renderer interface {\n\t// Start the renderer.\n\tstart()\n\n\t// Stop the renderer, but render the final frame in the buffer, if any.\n\tstop()\n\n\t// Stop the renderer without doing any final rendering.\n\tkill()\n\n\t// Write a frame to the renderer. The renderer can write this data to\n\t// output at its discretion.\n\twrite(string)\n\n\t// Request a full re-render. Note that this will not trigger a render\n\t// immediately. Rather, this method causes the next render to be a full\n\t// repaint. Because of this, it's safe to call this method multiple times\n\t// in succession.\n\trepaint()\n\n\t// Clears the terminal.\n\tclearScreen()\n\n\t// Whether or not the alternate screen buffer is enabled.\n\taltScreen() bool\n\t// Enable the alternate screen buffer.\n\tenterAltScreen()\n\t// Disable the alternate screen buffer.\n\texitAltScreen()\n\n\t// Show the cursor.\n\tshowCursor()\n\t// Hide the cursor.\n\thideCursor()\n\n\t// enableMouseCellMotion enables mouse click, release, wheel and motion\n\t// events if a mouse button is pressed (i.e., drag events).\n\tenableMouseCellMotion()\n\n\t// disableMouseCellMotion disables Mouse Cell Motion tracking.\n\tdisableMouseCellMotion()\n\n\t// enableMouseAllMotion enables mouse click, release, wheel and motion\n\t// events, regardless of whether a mouse button is pressed. Many modern\n\t// terminals support this, but not all.\n\tenableMouseAllMotion()\n\n\t// disableMouseAllMotion disables All Motion mouse tracking.\n\tdisableMouseAllMotion()\n\n\t// enableMouseSGRMode enables mouse extended mode (SGR).\n\tenableMouseSGRMode()\n\n\t// disableMouseSGRMode disables mouse extended mode (SGR).\n\tdisableMouseSGRMode()\n\n\t// enableBracketedPaste enables bracketed paste, where characters\n\t// inside the input are not interpreted when pasted as a whole.\n\tenableBracketedPaste()\n\n\t// disableBracketedPaste disables bracketed paste.\n\tdisableBracketedPaste()\n\n\t// bracketedPasteActive reports whether bracketed paste mode is\n\t// currently enabled.\n\tbracketedPasteActive() bool\n\n\t// setWindowTitle sets the terminal window title.\n\tsetWindowTitle(string)\n\n\t// reportFocus returns whether reporting focus events is enabled.\n\treportFocus() bool\n\n\t// enableReportFocus reports focus events to the program.\n\tenableReportFocus()\n\n\t// disableReportFocus stops reporting focus events to the program.\n\tdisableReportFocus()\n}\n\n// repaintMsg forces a full repaint.\ntype repaintMsg struct{}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/screen.go",
    "content": "package tea\n\n// WindowSizeMsg is used to report the terminal size. It's sent to Update once\n// initially and then on every terminal resize. Note that Windows does not\n// have support for reporting when resizes occur as it does not support the\n// SIGWINCH signal.\ntype WindowSizeMsg struct {\n\tWidth  int\n\tHeight int\n}\n\n// ClearScreen is a special command that tells the program to clear the screen\n// before the next update. This can be used to move the cursor to the top left\n// of the screen and clear visual clutter when the alt screen is not in use.\n//\n// Note that it should never be necessary to call ClearScreen() for regular\n// redraws.\nfunc ClearScreen() Msg {\n\treturn clearScreenMsg{}\n}\n\n// clearScreenMsg is an internal message that signals to clear the screen.\n// You can send a clearScreenMsg with ClearScreen.\ntype clearScreenMsg struct{}\n\n// EnterAltScreen is a special command that tells the Bubble Tea program to\n// enter the alternate screen buffer.\n//\n// Because commands run asynchronously, this command should not be used in your\n// model's Init function. To initialize your program with the altscreen enabled\n// use the WithAltScreen ProgramOption instead.\nfunc EnterAltScreen() Msg {\n\treturn enterAltScreenMsg{}\n}\n\n// enterAltScreenMsg in an internal message signals that the program should\n// enter alternate screen buffer. You can send a enterAltScreenMsg with\n// EnterAltScreen.\ntype enterAltScreenMsg struct{}\n\n// ExitAltScreen is a special command that tells the Bubble Tea program to exit\n// the alternate screen buffer. This command should be used to exit the\n// alternate screen buffer while the program is running.\n//\n// Note that the alternate screen buffer will be automatically exited when the\n// program quits.\nfunc ExitAltScreen() Msg {\n\treturn exitAltScreenMsg{}\n}\n\n// exitAltScreenMsg in an internal message signals that the program should exit\n// alternate screen buffer. You can send a exitAltScreenMsg with ExitAltScreen.\ntype exitAltScreenMsg struct{}\n\n// EnableMouseCellMotion is a special command that enables mouse click,\n// release, and wheel events. Mouse movement events are also captured if\n// a mouse button is pressed (i.e., drag events).\n//\n// Because commands run asynchronously, this command should not be used in your\n// model's Init function. Use the WithMouseCellMotion ProgramOption instead.\nfunc EnableMouseCellMotion() Msg {\n\treturn enableMouseCellMotionMsg{}\n}\n\n// enableMouseCellMotionMsg is a special command that signals to start\n// listening for \"cell motion\" type mouse events (ESC[?1002l). To send an\n// enableMouseCellMotionMsg, use the EnableMouseCellMotion command.\ntype enableMouseCellMotionMsg struct{}\n\n// EnableMouseAllMotion is a special command that enables mouse click, release,\n// wheel, and motion events, which are delivered regardless of whether a mouse\n// button is pressed, effectively enabling support for hover interactions.\n//\n// Many modern terminals support this, but not all. If in doubt, use\n// EnableMouseCellMotion instead.\n//\n// Because commands run asynchronously, this command should not be used in your\n// model's Init function. Use the WithMouseAllMotion ProgramOption instead.\nfunc EnableMouseAllMotion() Msg {\n\treturn enableMouseAllMotionMsg{}\n}\n\n// enableMouseAllMotionMsg is a special command that signals to start listening\n// for \"all motion\" type mouse events (ESC[?1003l). To send an\n// enableMouseAllMotionMsg, use the EnableMouseAllMotion command.\ntype enableMouseAllMotionMsg struct{}\n\n// DisableMouse is a special command that stops listening for mouse events.\nfunc DisableMouse() Msg {\n\treturn disableMouseMsg{}\n}\n\n// disableMouseMsg is an internal message that signals to stop listening\n// for mouse events. To send a disableMouseMsg, use the DisableMouse command.\ntype disableMouseMsg struct{}\n\n// HideCursor is a special command for manually instructing Bubble Tea to hide\n// the cursor. In some rare cases, certain operations will cause the terminal\n// to show the cursor, which is normally hidden for the duration of a Bubble\n// Tea program's lifetime. You will most likely not need to use this command.\nfunc HideCursor() Msg {\n\treturn hideCursorMsg{}\n}\n\n// hideCursorMsg is an internal command used to hide the cursor. You can send\n// this message with HideCursor.\ntype hideCursorMsg struct{}\n\n// ShowCursor is a special command for manually instructing Bubble Tea to show\n// the cursor.\nfunc ShowCursor() Msg {\n\treturn showCursorMsg{}\n}\n\n// showCursorMsg is an internal command used to show the cursor. You can send\n// this message with ShowCursor.\ntype showCursorMsg struct{}\n\n// EnableBracketedPaste is a special command that tells the Bubble Tea program\n// to accept bracketed paste input.\n//\n// Note that bracketed paste will be automatically disabled when the\n// program quits.\nfunc EnableBracketedPaste() Msg {\n\treturn enableBracketedPasteMsg{}\n}\n\n// enableBracketedPasteMsg in an internal message signals that\n// bracketed paste should be enabled. You can send an\n// enableBracketedPasteMsg with EnableBracketedPaste.\ntype enableBracketedPasteMsg struct{}\n\n// DisableBracketedPaste is a special command that tells the Bubble Tea program\n// to accept bracketed paste input.\n//\n// Note that bracketed paste will be automatically disabled when the\n// program quits.\nfunc DisableBracketedPaste() Msg {\n\treturn disableBracketedPasteMsg{}\n}\n\n// disableBracketedPasteMsg in an internal message signals that\n// bracketed paste should be disabled. You can send an\n// disableBracketedPasteMsg with DisableBracketedPaste.\ntype disableBracketedPasteMsg struct{}\n\n// enableReportFocusMsg is an internal message that signals to enable focus\n// reporting. You can send an enableReportFocusMsg with EnableReportFocus.\ntype enableReportFocusMsg struct{}\n\n// EnableReportFocus is a special command that tells the Bubble Tea program to\n// report focus events to the program.\nfunc EnableReportFocus() Msg {\n\treturn enableReportFocusMsg{}\n}\n\n// disableReportFocusMsg is an internal message that signals to disable focus\n// reporting. You can send an disableReportFocusMsg with DisableReportFocus.\ntype disableReportFocusMsg struct{}\n\n// DisableReportFocus is a special command that tells the Bubble Tea program to\n// stop reporting focus events to the program.\nfunc DisableReportFocus() Msg {\n\treturn disableReportFocusMsg{}\n}\n\n// EnterAltScreen enters the alternate screen buffer, which consumes the entire\n// terminal window. ExitAltScreen will return the terminal to its former state.\n//\n// Deprecated: Use the WithAltScreen ProgramOption instead.\nfunc (p *Program) EnterAltScreen() {\n\tif p.renderer != nil {\n\t\tp.renderer.enterAltScreen()\n\t} else {\n\t\tp.startupOptions |= withAltScreen\n\t}\n}\n\n// ExitAltScreen exits the alternate screen buffer.\n//\n// Deprecated: The altscreen will exited automatically when the program exits.\nfunc (p *Program) ExitAltScreen() {\n\tif p.renderer != nil {\n\t\tp.renderer.exitAltScreen()\n\t} else {\n\t\tp.startupOptions &^= withAltScreen\n\t}\n}\n\n// EnableMouseCellMotion enables mouse click, release, wheel and motion events\n// if a mouse button is pressed (i.e., drag events).\n//\n// Deprecated: Use the WithMouseCellMotion ProgramOption instead.\nfunc (p *Program) EnableMouseCellMotion() {\n\tif p.renderer != nil {\n\t\tp.renderer.enableMouseCellMotion()\n\t} else {\n\t\tp.startupOptions |= withMouseCellMotion\n\t}\n}\n\n// DisableMouseCellMotion disables Mouse Cell Motion tracking. This will be\n// called automatically when exiting a Bubble Tea program.\n//\n// Deprecated: The mouse will automatically be disabled when the program exits.\nfunc (p *Program) DisableMouseCellMotion() {\n\tif p.renderer != nil {\n\t\tp.renderer.disableMouseCellMotion()\n\t} else {\n\t\tp.startupOptions &^= withMouseCellMotion\n\t}\n}\n\n// EnableMouseAllMotion enables mouse click, release, wheel and motion events,\n// regardless of whether a mouse button is pressed. Many modern terminals\n// support this, but not all.\n//\n// Deprecated: Use the WithMouseAllMotion ProgramOption instead.\nfunc (p *Program) EnableMouseAllMotion() {\n\tif p.renderer != nil {\n\t\tp.renderer.enableMouseAllMotion()\n\t} else {\n\t\tp.startupOptions |= withMouseAllMotion\n\t}\n}\n\n// DisableMouseAllMotion disables All Motion mouse tracking. This will be\n// called automatically when exiting a Bubble Tea program.\n//\n// Deprecated: The mouse will automatically be disabled when the program exits.\nfunc (p *Program) DisableMouseAllMotion() {\n\tif p.renderer != nil {\n\t\tp.renderer.disableMouseAllMotion()\n\t} else {\n\t\tp.startupOptions &^= withMouseAllMotion\n\t}\n}\n\n// SetWindowTitle sets the terminal window title.\n//\n// Deprecated: Use the SetWindowTitle command instead.\nfunc (p *Program) SetWindowTitle(title string) {\n\tif p.renderer != nil {\n\t\tp.renderer.setWindowTitle(title)\n\t} else {\n\t\tp.startupTitle = title\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/signals_unix.go",
    "content": "//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix || zos\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris aix zos\n\npackage tea\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n)\n\n// listenForResize sends messages (or errors) when the terminal resizes.\n// Argument output should be the file descriptor for the terminal; usually\n// os.Stdout.\nfunc (p *Program) listenForResize(done chan struct{}) {\n\tsig := make(chan os.Signal, 1)\n\tsignal.Notify(sig, syscall.SIGWINCH)\n\n\tdefer func() {\n\t\tsignal.Stop(sig)\n\t\tclose(done)\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-p.ctx.Done():\n\t\t\treturn\n\t\tcase <-sig:\n\t\t}\n\n\t\tp.checkResize()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/signals_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage tea\n\n// listenForResize is not available on windows because windows does not\n// implement syscall.SIGWINCH.\nfunc (p *Program) listenForResize(done chan struct{}) {\n\tclose(done)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/standard_renderer.go",
    "content": "package tea\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n\t\"github.com/muesli/ansi/compressor\"\n)\n\nconst (\n\t// defaultFramerate specifies the maximum interval at which we should\n\t// update the view.\n\tdefaultFPS = 60\n\tmaxFPS     = 120\n)\n\n// standardRenderer is a framerate-based terminal renderer, updating the view\n// at a given framerate to avoid overloading the terminal emulator.\n//\n// In cases where very high performance is needed the renderer can be told\n// to exclude ranges of lines, allowing them to be written to directly.\ntype standardRenderer struct {\n\tmtx *sync.Mutex\n\tout io.Writer\n\n\tbuf                bytes.Buffer\n\tqueuedMessageLines []string\n\tframerate          time.Duration\n\tticker             *time.Ticker\n\tdone               chan struct{}\n\tlastRender         string\n\tlinesRendered      int\n\tuseANSICompressor  bool\n\tonce               sync.Once\n\n\t// cursor visibility state\n\tcursorHidden bool\n\n\t// essentially whether or not we're using the full size of the terminal\n\taltScreenActive bool\n\n\t// whether or not we're currently using bracketed paste\n\tbpActive bool\n\n\t// reportingFocus whether reporting focus events is enabled\n\treportingFocus bool\n\n\t// renderer dimensions; usually the size of the window\n\twidth  int\n\theight int\n\n\t// lines explicitly set not to render\n\tignoreLines map[int]struct{}\n}\n\n// newRenderer creates a new renderer. Normally you'll want to initialize it\n// with os.Stdout as the first argument.\nfunc newRenderer(out io.Writer, useANSICompressor bool, fps int) renderer {\n\tif fps < 1 {\n\t\tfps = defaultFPS\n\t} else if fps > maxFPS {\n\t\tfps = maxFPS\n\t}\n\tr := &standardRenderer{\n\t\tout:                out,\n\t\tmtx:                &sync.Mutex{},\n\t\tdone:               make(chan struct{}),\n\t\tframerate:          time.Second / time.Duration(fps),\n\t\tuseANSICompressor:  useANSICompressor,\n\t\tqueuedMessageLines: []string{},\n\t}\n\tif r.useANSICompressor {\n\t\tr.out = &compressor.Writer{Forward: out}\n\t}\n\treturn r\n}\n\n// start starts the renderer.\nfunc (r *standardRenderer) start() {\n\tif r.ticker == nil {\n\t\tr.ticker = time.NewTicker(r.framerate)\n\t} else {\n\t\t// If the ticker already exists, it has been stopped and we need to\n\t\t// reset it.\n\t\tr.ticker.Reset(r.framerate)\n\t}\n\n\t// Since the renderer can be restarted after a stop, we need to reset\n\t// the done channel and its corresponding sync.Once.\n\tr.once = sync.Once{}\n\n\tgo r.listen()\n}\n\n// stop permanently halts the renderer, rendering the final frame.\nfunc (r *standardRenderer) stop() {\n\t// Stop the renderer before acquiring the mutex to avoid a deadlock.\n\tr.once.Do(func() {\n\t\tr.done <- struct{}{}\n\t})\n\n\t// flush locks the mutex\n\tr.flush()\n\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EraseEntireLine)\n\t// Move the cursor back to the beginning of the line\n\tr.execute(\"\\r\")\n\n\tif r.useANSICompressor {\n\t\tif w, ok := r.out.(io.WriteCloser); ok {\n\t\t\t_ = w.Close()\n\t\t}\n\t}\n}\n\n// execute writes a sequence to the terminal.\nfunc (r *standardRenderer) execute(seq string) {\n\t_, _ = io.WriteString(r.out, seq)\n}\n\n// kill halts the renderer. The final frame will not be rendered.\nfunc (r *standardRenderer) kill() {\n\t// Stop the renderer before acquiring the mutex to avoid a deadlock.\n\tr.once.Do(func() {\n\t\tr.done <- struct{}{}\n\t})\n\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EraseEntireLine)\n\t// Move the cursor back to the beginning of the line\n\tr.execute(\"\\r\")\n}\n\n// listen waits for ticks on the ticker, or a signal to stop the renderer.\nfunc (r *standardRenderer) listen() {\n\tfor {\n\t\tselect {\n\t\tcase <-r.done:\n\t\t\tr.ticker.Stop()\n\t\t\treturn\n\n\t\tcase <-r.ticker.C:\n\t\t\tr.flush()\n\t\t}\n\t}\n}\n\n// flush renders the buffer.\nfunc (r *standardRenderer) flush() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tif r.buf.Len() == 0 || r.buf.String() == r.lastRender {\n\t\t// Nothing to do\n\t\treturn\n\t}\n\n\t// Output buffer\n\tbuf := &bytes.Buffer{}\n\n\tnewLines := strings.Split(r.buf.String(), \"\\n\")\n\n\t// If we know the output's height, we can use it to determine how many\n\t// lines we can render. We drop lines from the top of the render buffer if\n\t// necessary, as we can't navigate the cursor into the terminal's scrollback\n\t// buffer.\n\tif r.height > 0 && len(newLines) > r.height {\n\t\tnewLines = newLines[len(newLines)-r.height:]\n\t}\n\n\tnumLinesThisFlush := len(newLines)\n\toldLines := strings.Split(r.lastRender, \"\\n\")\n\tskipLines := make(map[int]struct{})\n\tflushQueuedMessages := len(r.queuedMessageLines) > 0 && !r.altScreenActive\n\n\t// Clear any lines we painted in the last render.\n\tif r.linesRendered > 0 {\n\t\tfor i := r.linesRendered - 1; i > 0; i-- {\n\t\t\t// if we are clearing queued messages, we want to clear all lines, since\n\t\t\t// printing messages allows for native terminal word-wrap, we\n\t\t\t// don't have control over the queued lines\n\t\t\tif flushQueuedMessages {\n\t\t\t\tbuf.WriteString(ansi.EraseEntireLine)\n\t\t\t} else if (len(newLines) <= len(oldLines)) && (len(newLines) > i && len(oldLines) > i) && (newLines[i] == oldLines[i]) {\n\t\t\t\t// If the number of lines we want to render hasn't increased and\n\t\t\t\t// new line is the same as the old line we can skip rendering for\n\t\t\t\t// this line as a performance optimization.\n\t\t\t\tskipLines[i] = struct{}{}\n\t\t\t} else if _, exists := r.ignoreLines[i]; !exists {\n\t\t\t\tbuf.WriteString(ansi.EraseEntireLine)\n\t\t\t}\n\n\t\t\tbuf.WriteString(ansi.CursorUp1)\n\t\t}\n\n\t\tif _, exists := r.ignoreLines[0]; !exists {\n\t\t\t// We need to return to the start of the line here to properly\n\t\t\t// erase it. Going back the entire width of the terminal will\n\t\t\t// usually be farther than we need to go, but terminal emulators\n\t\t\t// will stop the cursor at the start of the line as a rule.\n\t\t\t//\n\t\t\t// We use this sequence in particular because it's part of the ANSI\n\t\t\t// standard (whereas others are proprietary to, say, VT100/VT52).\n\t\t\t// If cursor previous line (ESC[ + <n> + F) were better supported\n\t\t\t// we could use that above to eliminate this step.\n\t\t\tbuf.WriteString(ansi.CursorLeft(r.width))\n\t\t\tbuf.WriteString(ansi.EraseEntireLine)\n\t\t}\n\t}\n\n\t// Merge the set of lines we're skipping as a rendering optimization with\n\t// the set of lines we've explicitly asked the renderer to ignore.\n\tfor k, v := range r.ignoreLines {\n\t\tskipLines[k] = v\n\t}\n\n\tif flushQueuedMessages {\n\t\t// Dump the lines we've queued up for printing\n\t\tfor _, line := range r.queuedMessageLines {\n\t\t\t_, _ = buf.WriteString(line)\n\t\t\t_, _ = buf.WriteString(\"\\r\\n\")\n\t\t}\n\t\t// clear the queued message lines\n\t\tr.queuedMessageLines = []string{}\n\t}\n\n\t// Paint new lines\n\tfor i := 0; i < len(newLines); i++ {\n\t\tif _, skip := skipLines[i]; skip {\n\t\t\t// Unless this is the last line, move the cursor down.\n\t\t\tif i < len(newLines)-1 {\n\t\t\t\tbuf.WriteString(ansi.CursorDown1)\n\t\t\t}\n\t\t} else {\n\t\t\tif i == 0 && r.lastRender == \"\" {\n\t\t\t\t// On first render, reset the cursor to the start of the line\n\t\t\t\t// before writing anything.\n\t\t\t\tbuf.WriteByte('\\r')\n\t\t\t}\n\n\t\t\tline := newLines[i]\n\n\t\t\t// Truncate lines wider than the width of the window to avoid\n\t\t\t// wrapping, which will mess up rendering. If we don't have the\n\t\t\t// width of the window this will be ignored.\n\t\t\t//\n\t\t\t// Note that on Windows we only get the width of the window on\n\t\t\t// program initialization, so after a resize this won't perform\n\t\t\t// correctly (signal SIGWINCH is not supported on Windows).\n\t\t\tif r.width > 0 {\n\t\t\t\tline = ansi.Truncate(line, r.width, \"\")\n\t\t\t}\n\n\t\t\t_, _ = buf.WriteString(line)\n\n\t\t\tif i < len(newLines)-1 {\n\t\t\t\t_, _ = buf.WriteString(\"\\r\\n\")\n\t\t\t}\n\t\t}\n\t}\n\tr.linesRendered = numLinesThisFlush\n\n\t// Make sure the cursor is at the start of the last line to keep rendering\n\t// behavior consistent.\n\tif r.altScreenActive {\n\t\t// This case fixes a bug in macOS terminal. In other terminals the\n\t\t// other case seems to do the job regardless of whether or not we're\n\t\t// using the full terminal window.\n\t\tbuf.WriteString(ansi.MoveCursor(r.linesRendered, 0))\n\t} else {\n\t\tbuf.WriteString(ansi.CursorLeft(r.width))\n\t}\n\n\t_, _ = r.out.Write(buf.Bytes())\n\tr.lastRender = r.buf.String()\n\tr.buf.Reset()\n}\n\n// write writes to the internal buffer. The buffer will be outputted via the\n// ticker which calls flush().\nfunc (r *standardRenderer) write(s string) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\tr.buf.Reset()\n\n\t// If an empty string was passed we should clear existing output and\n\t// rendering nothing. Rather than introduce additional state to manage\n\t// this, we render a single space as a simple (albeit less correct)\n\t// solution.\n\tif s == \"\" {\n\t\ts = \" \"\n\t}\n\n\t_, _ = r.buf.WriteString(s)\n}\n\nfunc (r *standardRenderer) repaint() {\n\tr.lastRender = \"\"\n}\n\nfunc (r *standardRenderer) clearScreen() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EraseEntireDisplay)\n\tr.execute(ansi.MoveCursorOrigin)\n\n\tr.repaint()\n}\n\nfunc (r *standardRenderer) altScreen() bool {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\treturn r.altScreenActive\n}\n\nfunc (r *standardRenderer) enterAltScreen() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tif r.altScreenActive {\n\t\treturn\n\t}\n\n\tr.altScreenActive = true\n\tr.execute(ansi.EnableAltScreenBuffer)\n\n\t// Ensure that the terminal is cleared, even when it doesn't support\n\t// alt screen (or alt screen support is disabled, like GNU screen by\n\t// default).\n\t//\n\t// Note: we can't use r.clearScreen() here because the mutex is already\n\t// locked.\n\tr.execute(ansi.EraseEntireDisplay)\n\tr.execute(ansi.MoveCursorOrigin)\n\n\t// cmd.exe and other terminals keep separate cursor states for the AltScreen\n\t// and the main buffer. We have to explicitly reset the cursor visibility\n\t// whenever we enter AltScreen.\n\tif r.cursorHidden {\n\t\tr.execute(ansi.HideCursor)\n\t} else {\n\t\tr.execute(ansi.ShowCursor)\n\t}\n\n\tr.repaint()\n}\n\nfunc (r *standardRenderer) exitAltScreen() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tif !r.altScreenActive {\n\t\treturn\n\t}\n\n\tr.altScreenActive = false\n\tr.execute(ansi.DisableAltScreenBuffer)\n\n\t// cmd.exe and other terminals keep separate cursor states for the AltScreen\n\t// and the main buffer. We have to explicitly reset the cursor visibility\n\t// whenever we exit AltScreen.\n\tif r.cursorHidden {\n\t\tr.execute(ansi.HideCursor)\n\t} else {\n\t\tr.execute(ansi.ShowCursor)\n\t}\n\n\tr.repaint()\n}\n\nfunc (r *standardRenderer) showCursor() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.cursorHidden = false\n\tr.execute(ansi.ShowCursor)\n}\n\nfunc (r *standardRenderer) hideCursor() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.cursorHidden = true\n\tr.execute(ansi.HideCursor)\n}\n\nfunc (r *standardRenderer) enableMouseCellMotion() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EnableMouseCellMotion)\n}\n\nfunc (r *standardRenderer) disableMouseCellMotion() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.DisableMouseCellMotion)\n}\n\nfunc (r *standardRenderer) enableMouseAllMotion() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EnableMouseAllMotion)\n}\n\nfunc (r *standardRenderer) disableMouseAllMotion() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.DisableMouseAllMotion)\n}\n\nfunc (r *standardRenderer) enableMouseSGRMode() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EnableMouseSgrExt)\n}\n\nfunc (r *standardRenderer) disableMouseSGRMode() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.DisableMouseSgrExt)\n}\n\nfunc (r *standardRenderer) enableBracketedPaste() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EnableBracketedPaste)\n\tr.bpActive = true\n}\n\nfunc (r *standardRenderer) disableBracketedPaste() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.DisableBracketedPaste)\n\tr.bpActive = false\n}\n\nfunc (r *standardRenderer) bracketedPasteActive() bool {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\treturn r.bpActive\n}\n\nfunc (r *standardRenderer) enableReportFocus() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.EnableReportFocus)\n\tr.reportingFocus = true\n}\n\nfunc (r *standardRenderer) disableReportFocus() {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.execute(ansi.DisableReportFocus)\n\tr.reportingFocus = false\n}\n\nfunc (r *standardRenderer) reportFocus() bool {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\treturn r.reportingFocus\n}\n\n// setWindowTitle sets the terminal window title.\nfunc (r *standardRenderer) setWindowTitle(title string) {\n\tr.execute(ansi.SetWindowTitle(title))\n}\n\n// setIgnoredLines specifies lines not to be touched by the standard Bubble Tea\n// renderer.\nfunc (r *standardRenderer) setIgnoredLines(from int, to int) {\n\t// Lock if we're going to be clearing some lines since we don't want\n\t// anything jacking our cursor.\n\tif r.linesRendered > 0 {\n\t\tr.mtx.Lock()\n\t\tdefer r.mtx.Unlock()\n\t}\n\n\tif r.ignoreLines == nil {\n\t\tr.ignoreLines = make(map[int]struct{})\n\t}\n\tfor i := from; i < to; i++ {\n\t\tr.ignoreLines[i] = struct{}{}\n\t}\n\n\t// Erase ignored lines\n\tif r.linesRendered > 0 {\n\t\tbuf := &bytes.Buffer{}\n\n\t\tfor i := r.linesRendered - 1; i >= 0; i-- {\n\t\t\tif _, exists := r.ignoreLines[i]; exists {\n\t\t\t\tbuf.WriteString(ansi.EraseEntireLine)\n\t\t\t}\n\t\t\tbuf.WriteString(ansi.CursorUp1)\n\t\t}\n\t\tbuf.WriteString(ansi.MoveCursor(r.linesRendered, 0)) // put cursor back\n\t\t_, _ = r.out.Write(buf.Bytes())\n\t}\n}\n\n// clearIgnoredLines returns control of any ignored lines to the standard\n// Bubble Tea renderer. That is, any lines previously set to be ignored can be\n// rendered to again.\nfunc (r *standardRenderer) clearIgnoredLines() {\n\tr.ignoreLines = nil\n}\n\n// insertTop effectively scrolls up. It inserts lines at the top of a given\n// area designated to be a scrollable region, pushing everything else down.\n// This is roughly how ncurses does it.\n//\n// To call this function use command ScrollUp().\n//\n// For this to work renderer.ignoreLines must be set to ignore the scrollable\n// region since we are bypassing the normal Bubble Tea renderer here.\n//\n// Because this method relies on the terminal dimensions, it's only valid for\n// full-window applications (generally those that use the alternate screen\n// buffer).\n//\n// This method bypasses the normal rendering buffer and is philosophically\n// different than the normal way we approach rendering in Bubble Tea. It's for\n// use in high-performance rendering, such as a pager that could potentially\n// be rendering very complicated ansi. In cases where the content is simpler\n// standard Bubble Tea rendering should suffice.\nfunc (r *standardRenderer) insertTop(lines []string, topBoundary, bottomBoundary int) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tbuf := &bytes.Buffer{}\n\n\tbuf.WriteString(ansi.SetScrollingRegion(topBoundary, bottomBoundary))\n\tbuf.WriteString(ansi.MoveCursor(topBoundary, 0))\n\tbuf.WriteString(ansi.InsertLine(len(lines)))\n\t_, _ = buf.WriteString(strings.Join(lines, \"\\r\\n\"))\n\tbuf.WriteString(ansi.SetScrollingRegion(0, r.height))\n\n\t// Move cursor back to where the main rendering routine expects it to be\n\tbuf.WriteString(ansi.MoveCursor(r.linesRendered, 0))\n\n\t_, _ = r.out.Write(buf.Bytes())\n}\n\n// insertBottom effectively scrolls down. It inserts lines at the bottom of\n// a given area designated to be a scrollable region, pushing everything else\n// up. This is roughly how ncurses does it.\n//\n// To call this function use the command ScrollDown().\n//\n// See note in insertTop() for caveats, how this function only makes sense for\n// full-window applications, and how it differs from the normal way we do\n// rendering in Bubble Tea.\nfunc (r *standardRenderer) insertBottom(lines []string, topBoundary, bottomBoundary int) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tbuf := &bytes.Buffer{}\n\n\tbuf.WriteString(ansi.SetScrollingRegion(topBoundary, bottomBoundary))\n\tbuf.WriteString(ansi.MoveCursor(bottomBoundary, 0))\n\t_, _ = buf.WriteString(\"\\r\\n\" + strings.Join(lines, \"\\r\\n\"))\n\tbuf.WriteString(ansi.SetScrollingRegion(0, r.height))\n\n\t// Move cursor back to where the main rendering routine expects it to be\n\tbuf.WriteString(ansi.MoveCursor(r.linesRendered, 0))\n\n\t_, _ = r.out.Write(buf.Bytes())\n}\n\n// handleMessages handles internal messages for the renderer.\nfunc (r *standardRenderer) handleMessages(msg Msg) {\n\tswitch msg := msg.(type) {\n\tcase repaintMsg:\n\t\t// Force a repaint by clearing the render cache as we slide into a\n\t\t// render.\n\t\tr.mtx.Lock()\n\t\tr.repaint()\n\t\tr.mtx.Unlock()\n\n\tcase WindowSizeMsg:\n\t\tr.mtx.Lock()\n\t\tr.width = msg.Width\n\t\tr.height = msg.Height\n\t\tr.repaint()\n\t\tr.mtx.Unlock()\n\n\tcase clearScrollAreaMsg:\n\t\tr.clearIgnoredLines()\n\n\t\t// Force a repaint on the area where the scrollable stuff was in this\n\t\t// update cycle\n\t\tr.mtx.Lock()\n\t\tr.repaint()\n\t\tr.mtx.Unlock()\n\n\tcase syncScrollAreaMsg:\n\t\t// Re-render scrolling area\n\t\tr.clearIgnoredLines()\n\t\tr.setIgnoredLines(msg.topBoundary, msg.bottomBoundary)\n\t\tr.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)\n\n\t\t// Force non-scrolling stuff to repaint in this update cycle\n\t\tr.mtx.Lock()\n\t\tr.repaint()\n\t\tr.mtx.Unlock()\n\n\tcase scrollUpMsg:\n\t\tr.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)\n\n\tcase scrollDownMsg:\n\t\tr.insertBottom(msg.lines, msg.topBoundary, msg.bottomBoundary)\n\n\tcase printLineMessage:\n\t\tif !r.altScreenActive {\n\t\t\tlines := strings.Split(msg.messageBody, \"\\n\")\n\t\t\tr.mtx.Lock()\n\t\t\tr.queuedMessageLines = append(r.queuedMessageLines, lines...)\n\t\t\tr.repaint()\n\t\t\tr.mtx.Unlock()\n\t\t}\n\t}\n}\n\n// HIGH-PERFORMANCE RENDERING STUFF\n\ntype syncScrollAreaMsg struct {\n\tlines          []string\n\ttopBoundary    int\n\tbottomBoundary int\n}\n\n// SyncScrollArea performs a paint of the entire region designated to be the\n// scrollable area. This is required to initialize the scrollable region and\n// should also be called on resize (WindowSizeMsg).\n//\n// For high-performance, scroll-based rendering only.\nfunc SyncScrollArea(lines []string, topBoundary int, bottomBoundary int) Cmd {\n\treturn func() Msg {\n\t\treturn syncScrollAreaMsg{\n\t\t\tlines:          lines,\n\t\t\ttopBoundary:    topBoundary,\n\t\t\tbottomBoundary: bottomBoundary,\n\t\t}\n\t}\n}\n\ntype clearScrollAreaMsg struct{}\n\n// ClearScrollArea deallocates the scrollable region and returns the control of\n// those lines to the main rendering routine.\n//\n// For high-performance, scroll-based rendering only.\nfunc ClearScrollArea() Msg {\n\treturn clearScrollAreaMsg{}\n}\n\ntype scrollUpMsg struct {\n\tlines          []string\n\ttopBoundary    int\n\tbottomBoundary int\n}\n\n// ScrollUp adds lines to the top of the scrollable region, pushing existing\n// lines below down. Lines that are pushed out the scrollable region disappear\n// from view.\n//\n// For high-performance, scroll-based rendering only.\nfunc ScrollUp(newLines []string, topBoundary, bottomBoundary int) Cmd {\n\treturn func() Msg {\n\t\treturn scrollUpMsg{\n\t\t\tlines:          newLines,\n\t\t\ttopBoundary:    topBoundary,\n\t\t\tbottomBoundary: bottomBoundary,\n\t\t}\n\t}\n}\n\ntype scrollDownMsg struct {\n\tlines          []string\n\ttopBoundary    int\n\tbottomBoundary int\n}\n\n// ScrollDown adds lines to the bottom of the scrollable region, pushing\n// existing lines above up. Lines that are pushed out of the scrollable region\n// disappear from view.\n//\n// For high-performance, scroll-based rendering only.\nfunc ScrollDown(newLines []string, topBoundary, bottomBoundary int) Cmd {\n\treturn func() Msg {\n\t\treturn scrollDownMsg{\n\t\t\tlines:          newLines,\n\t\t\ttopBoundary:    topBoundary,\n\t\t\tbottomBoundary: bottomBoundary,\n\t\t}\n\t}\n}\n\ntype printLineMessage struct {\n\tmessageBody string\n}\n\n// Println prints above the Program. This output is unmanaged by the program and\n// will persist across renders by the Program.\n//\n// Unlike fmt.Println (but similar to log.Println) the message will be print on\n// its own line.\n//\n// If the altscreen is active no output will be printed.\nfunc Println(args ...interface{}) Cmd {\n\treturn func() Msg {\n\t\treturn printLineMessage{\n\t\t\tmessageBody: fmt.Sprint(args...),\n\t\t}\n\t}\n}\n\n// Printf prints above the Program. It takes a format template followed by\n// values similar to fmt.Printf. This output is unmanaged by the program and\n// will persist across renders by the Program.\n//\n// Unlike fmt.Printf (but similar to log.Printf) the message will be print on\n// its own line.\n//\n// If the altscreen is active no output will be printed.\nfunc Printf(template string, args ...interface{}) Cmd {\n\treturn func() Msg {\n\t\treturn printLineMessage{\n\t\t\tmessageBody: fmt.Sprintf(template, args...),\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/tea.go",
    "content": "// Package tea provides a framework for building rich terminal user interfaces\n// based on the paradigms of The Elm Architecture. It's well-suited for simple\n// and complex terminal applications, either inline, full-window, or a mix of\n// both. It's been battle-tested in several large projects and is\n// production-ready.\n//\n// A tutorial is available at https://github.com/charmbracelet/bubbletea/tree/master/tutorials\n//\n// Example programs can be found at https://github.com/charmbracelet/bubbletea/tree/master/examples\npackage tea\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/signal\"\n\t\"runtime/debug\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\n\t\"github.com/charmbracelet/x/term\"\n\t\"github.com/muesli/cancelreader\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\n// ErrProgramKilled is returned by [Program.Run] when the program got killed.\nvar ErrProgramKilled = errors.New(\"program was killed\")\n\n// Msg contain data from the result of a IO operation. Msgs trigger the update\n// function and, henceforth, the UI.\ntype Msg interface{}\n\n// Model contains the program's state as well as its core functions.\ntype Model interface {\n\t// Init is the first function that will be called. It returns an optional\n\t// initial command. To not perform an initial command return nil.\n\tInit() Cmd\n\n\t// Update is called when a message is received. Use it to inspect messages\n\t// and, in response, update the model and/or send a command.\n\tUpdate(Msg) (Model, Cmd)\n\n\t// View renders the program's UI, which is just a string. The view is\n\t// rendered after every Update.\n\tView() string\n}\n\n// Cmd is an IO operation that returns a message when it's complete. If it's\n// nil it's considered a no-op. Use it for things like HTTP requests, timers,\n// saving and loading from disk, and so on.\n//\n// Note that there's almost never a reason to use a command to send a message\n// to another part of your program. That can almost always be done in the\n// update function.\ntype Cmd func() Msg\n\ntype inputType int\n\nconst (\n\tdefaultInput inputType = iota\n\tttyInput\n\tcustomInput\n)\n\n// String implements the stringer interface for [inputType]. It is inteded to\n// be used in testing.\nfunc (i inputType) String() string {\n\treturn [...]string{\n\t\t\"default input\",\n\t\t\"tty input\",\n\t\t\"custom input\",\n\t}[i]\n}\n\n// Options to customize the program during its initialization. These are\n// generally set with ProgramOptions.\n//\n// The options here are treated as bits.\ntype startupOptions int16\n\nfunc (s startupOptions) has(option startupOptions) bool {\n\treturn s&option != 0\n}\n\nconst (\n\twithAltScreen startupOptions = 1 << iota\n\twithMouseCellMotion\n\twithMouseAllMotion\n\twithANSICompressor\n\twithoutSignalHandler\n\t// Catching panics is incredibly useful for restoring the terminal to a\n\t// usable state after a panic occurs. When this is set, Bubble Tea will\n\t// recover from panics, print the stack trace, and disable raw mode. This\n\t// feature is on by default.\n\twithoutCatchPanics\n\twithoutBracketedPaste\n\twithReportFocus\n)\n\n// channelHandlers manages the series of channels returned by various processes.\n// It allows us to wait for those processes to terminate before exiting the\n// program.\ntype channelHandlers []chan struct{}\n\n// Adds a channel to the list of handlers. We wait for all handlers to terminate\n// gracefully on shutdown.\nfunc (h *channelHandlers) add(ch chan struct{}) {\n\t*h = append(*h, ch)\n}\n\n// shutdown waits for all handlers to terminate.\nfunc (h channelHandlers) shutdown() {\n\tvar wg sync.WaitGroup\n\tfor _, ch := range h {\n\t\twg.Add(1)\n\t\tgo func(ch chan struct{}) {\n\t\t\t<-ch\n\t\t\twg.Done()\n\t\t}(ch)\n\t}\n\twg.Wait()\n}\n\n// Program is a terminal user interface.\ntype Program struct {\n\tinitialModel Model\n\n\t// Configuration options that will set as the program is initializing,\n\t// treated as bits. These options can be set via various ProgramOptions.\n\tstartupOptions startupOptions\n\n\t// startupTitle is the title that will be set on the terminal when the\n\t// program starts.\n\tstartupTitle string\n\n\tinputType inputType\n\n\tctx    context.Context\n\tcancel context.CancelFunc\n\n\tmsgs     chan Msg\n\terrs     chan error\n\tfinished chan struct{}\n\n\t// where to send output, this will usually be os.Stdout.\n\toutput io.Writer\n\t// ttyOutput is null if output is not a TTY.\n\tttyOutput           term.File\n\tpreviousOutputState *term.State\n\trenderer            renderer\n\n\t// the environment variables for the program, defaults to os.Environ().\n\tenviron []string\n\n\t// where to read inputs from, this will usually be os.Stdin.\n\tinput io.Reader\n\t// ttyInput is null if input is not a TTY.\n\tttyInput              term.File\n\tpreviousTtyInputState *term.State\n\tcancelReader          cancelreader.CancelReader\n\treadLoopDone          chan struct{}\n\n\t// was the altscreen active before releasing the terminal?\n\taltScreenWasActive bool\n\tignoreSignals      uint32\n\n\tbpWasActive bool // was the bracketed paste mode active before releasing the terminal?\n\treportFocus bool // was focus reporting active before releasing the terminal?\n\n\tfilter func(Model, Msg) Msg\n\n\t// fps is the frames per second we should set on the renderer, if\n\t// applicable,\n\tfps int\n}\n\n// Quit is a special command that tells the Bubble Tea program to exit.\nfunc Quit() Msg {\n\treturn QuitMsg{}\n}\n\n// QuitMsg signals that the program should quit. You can send a QuitMsg with\n// Quit.\ntype QuitMsg struct{}\n\n// Suspend is a special command that tells the Bubble Tea program to suspend.\nfunc Suspend() Msg {\n\treturn SuspendMsg{}\n}\n\n// SuspendMsg signals the program should suspend.\n// This usually happens when ctrl+z is pressed on common programs, but since\n// bubbletea puts the terminal in raw mode, we need to handle it in a\n// per-program basis.\n// You can send this message with Suspend.\ntype SuspendMsg struct{}\n\n// ResumeMsg can be listen to to do something once a program is resumed back\n// from a suspend state.\ntype ResumeMsg struct{}\n\n// NewProgram creates a new Program.\nfunc NewProgram(model Model, opts ...ProgramOption) *Program {\n\tp := &Program{\n\t\tinitialModel: model,\n\t\tmsgs:         make(chan Msg),\n\t}\n\n\t// Apply all options to the program.\n\tfor _, opt := range opts {\n\t\topt(p)\n\t}\n\n\t// A context can be provided with a ProgramOption, but if none was provided\n\t// we'll use the default background context.\n\tif p.ctx == nil {\n\t\tp.ctx = context.Background()\n\t}\n\t// Initialize context and teardown channel.\n\tp.ctx, p.cancel = context.WithCancel(p.ctx)\n\n\t// if no output was set, set it to stdout\n\tif p.output == nil {\n\t\tp.output = os.Stdout\n\t}\n\n\t// if no environment was set, set it to os.Environ()\n\tif p.environ == nil {\n\t\tp.environ = os.Environ()\n\t}\n\n\treturn p\n}\n\nfunc (p *Program) handleSignals() chan struct{} {\n\tch := make(chan struct{})\n\n\t// Listen for SIGINT and SIGTERM.\n\t//\n\t// In most cases ^C will not send an interrupt because the terminal will be\n\t// in raw mode and ^C will be captured as a keystroke and sent along to\n\t// Program.Update as a KeyMsg. When input is not a TTY, however, ^C will be\n\t// caught here.\n\t//\n\t// SIGTERM is sent by unix utilities (like kill) to terminate a process.\n\tgo func() {\n\t\tsig := make(chan os.Signal, 1)\n\t\tsignal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)\n\t\tdefer func() {\n\t\t\tsignal.Stop(sig)\n\t\t\tclose(ch)\n\t\t}()\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-p.ctx.Done():\n\t\t\t\treturn\n\n\t\t\tcase <-sig:\n\t\t\t\tif atomic.LoadUint32(&p.ignoreSignals) == 0 {\n\t\t\t\t\tp.msgs <- QuitMsg{}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn ch\n}\n\n// handleResize handles terminal resize events.\nfunc (p *Program) handleResize() chan struct{} {\n\tch := make(chan struct{})\n\n\tif p.ttyOutput != nil {\n\t\t// Get the initial terminal size and send it to the program.\n\t\tgo p.checkResize()\n\n\t\t// Listen for window resizes.\n\t\tgo p.listenForResize(ch)\n\t} else {\n\t\tclose(ch)\n\t}\n\n\treturn ch\n}\n\n// handleCommands runs commands in a goroutine and sends the result to the\n// program's message channel.\nfunc (p *Program) handleCommands(cmds chan Cmd) chan struct{} {\n\tch := make(chan struct{})\n\n\tgo func() {\n\t\tdefer close(ch)\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-p.ctx.Done():\n\t\t\t\treturn\n\n\t\t\tcase cmd := <-cmds:\n\t\t\t\tif cmd == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Don't wait on these goroutines, otherwise the shutdown\n\t\t\t\t// latency would get too large as a Cmd can run for some time\n\t\t\t\t// (e.g. tick commands that sleep for half a second). It's not\n\t\t\t\t// possible to cancel them so we'll have to leak the goroutine\n\t\t\t\t// until Cmd returns.\n\t\t\t\tgo func() {\n\t\t\t\t\tmsg := cmd() // this can be long.\n\t\t\t\t\tp.Send(msg)\n\t\t\t\t}()\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn ch\n}\n\nfunc (p *Program) disableMouse() {\n\tp.renderer.disableMouseCellMotion()\n\tp.renderer.disableMouseAllMotion()\n\tp.renderer.disableMouseSGRMode()\n}\n\n// eventLoop is the central message loop. It receives and handles the default\n// Bubble Tea messages, update the model and triggers redraws.\nfunc (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) {\n\tfor {\n\t\tselect {\n\t\tcase <-p.ctx.Done():\n\t\t\treturn model, nil\n\n\t\tcase err := <-p.errs:\n\t\t\treturn model, err\n\n\t\tcase msg := <-p.msgs:\n\t\t\t// Filter messages.\n\t\t\tif p.filter != nil {\n\t\t\t\tmsg = p.filter(model, msg)\n\t\t\t}\n\t\t\tif msg == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Handle special internal messages.\n\t\t\tswitch msg := msg.(type) {\n\t\t\tcase QuitMsg:\n\t\t\t\treturn model, nil\n\n\t\t\tcase SuspendMsg:\n\t\t\t\tif suspendSupported {\n\t\t\t\t\tp.suspend()\n\t\t\t\t}\n\n\t\t\tcase clearScreenMsg:\n\t\t\t\tp.renderer.clearScreen()\n\n\t\t\tcase enterAltScreenMsg:\n\t\t\t\tp.renderer.enterAltScreen()\n\n\t\t\tcase exitAltScreenMsg:\n\t\t\t\tp.renderer.exitAltScreen()\n\n\t\t\tcase enableMouseCellMotionMsg, enableMouseAllMotionMsg:\n\t\t\t\tswitch msg.(type) {\n\t\t\t\tcase enableMouseCellMotionMsg:\n\t\t\t\t\tp.renderer.enableMouseCellMotion()\n\t\t\t\tcase enableMouseAllMotionMsg:\n\t\t\t\t\tp.renderer.enableMouseAllMotion()\n\t\t\t\t}\n\t\t\t\t// mouse mode (1006) is a no-op if the terminal doesn't support it.\n\t\t\t\tp.renderer.enableMouseSGRMode()\n\n\t\t\tcase disableMouseMsg:\n\t\t\t\tp.disableMouse()\n\n\t\t\tcase showCursorMsg:\n\t\t\t\tp.renderer.showCursor()\n\n\t\t\tcase hideCursorMsg:\n\t\t\t\tp.renderer.hideCursor()\n\n\t\t\tcase enableBracketedPasteMsg:\n\t\t\t\tp.renderer.enableBracketedPaste()\n\n\t\t\tcase disableBracketedPasteMsg:\n\t\t\t\tp.renderer.disableBracketedPaste()\n\n\t\t\tcase enableReportFocusMsg:\n\t\t\t\tp.renderer.enableReportFocus()\n\n\t\t\tcase disableReportFocusMsg:\n\t\t\t\tp.renderer.disableReportFocus()\n\n\t\t\tcase execMsg:\n\t\t\t\t// NB: this blocks.\n\t\t\t\tp.exec(msg.cmd, msg.fn)\n\n\t\t\tcase BatchMsg:\n\t\t\t\tfor _, cmd := range msg {\n\t\t\t\t\tcmds <- cmd\n\t\t\t\t}\n\t\t\t\tcontinue\n\n\t\t\tcase sequenceMsg:\n\t\t\t\tgo func() {\n\t\t\t\t\t// Execute commands one at a time, in order.\n\t\t\t\t\tfor _, cmd := range msg {\n\t\t\t\t\t\tif cmd == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmsg := cmd()\n\t\t\t\t\t\tif batchMsg, ok := msg.(BatchMsg); ok {\n\t\t\t\t\t\t\tg, _ := errgroup.WithContext(p.ctx)\n\t\t\t\t\t\t\tfor _, cmd := range batchMsg {\n\t\t\t\t\t\t\t\tcmd := cmd\n\t\t\t\t\t\t\t\tg.Go(func() error {\n\t\t\t\t\t\t\t\t\tp.Send(cmd())\n\t\t\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//nolint:errcheck\n\t\t\t\t\t\t\tg.Wait() // wait for all commands from batch msg to finish\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tp.Send(msg)\n\t\t\t\t\t}\n\t\t\t\t}()\n\n\t\t\tcase setWindowTitleMsg:\n\t\t\t\tp.SetWindowTitle(string(msg))\n\n\t\t\tcase windowSizeMsg:\n\t\t\t\tgo p.checkResize()\n\t\t\t}\n\n\t\t\t// Process internal messages for the renderer.\n\t\t\tif r, ok := p.renderer.(*standardRenderer); ok {\n\t\t\t\tr.handleMessages(msg)\n\t\t\t}\n\n\t\t\tvar cmd Cmd\n\t\t\tmodel, cmd = model.Update(msg) // run update\n\t\t\tcmds <- cmd                    // process command (if any)\n\t\t\tp.renderer.write(model.View()) // send view to renderer\n\t\t}\n\t}\n}\n\n// Run initializes the program and runs its event loops, blocking until it gets\n// terminated by either [Program.Quit], [Program.Kill], or its signal handler.\n// Returns the final model.\nfunc (p *Program) Run() (Model, error) {\n\thandlers := channelHandlers{}\n\tcmds := make(chan Cmd)\n\tp.errs = make(chan error)\n\tp.finished = make(chan struct{}, 1)\n\n\tdefer p.cancel()\n\n\tswitch p.inputType {\n\tcase defaultInput:\n\t\tp.input = os.Stdin\n\n\t\t// The user has not set a custom input, so we need to check whether or\n\t\t// not standard input is a terminal. If it's not, we open a new TTY for\n\t\t// input. This will allow things to \"just work\" in cases where data was\n\t\t// piped in or redirected to the application.\n\t\t//\n\t\t// To disable input entirely pass nil to the [WithInput] program option.\n\t\tf, isFile := p.input.(term.File)\n\t\tif !isFile {\n\t\t\tbreak\n\t\t}\n\t\tif term.IsTerminal(f.Fd()) {\n\t\t\tbreak\n\t\t}\n\n\t\tf, err := openInputTTY()\n\t\tif err != nil {\n\t\t\treturn p.initialModel, err\n\t\t}\n\t\tdefer f.Close() //nolint:errcheck\n\t\tp.input = f\n\n\tcase ttyInput:\n\t\t// Open a new TTY, by request\n\t\tf, err := openInputTTY()\n\t\tif err != nil {\n\t\t\treturn p.initialModel, err\n\t\t}\n\t\tdefer f.Close() //nolint:errcheck\n\t\tp.input = f\n\n\tcase customInput:\n\t\t// (There is nothing extra to do.)\n\t}\n\n\t// Handle signals.\n\tif !p.startupOptions.has(withoutSignalHandler) {\n\t\thandlers.add(p.handleSignals())\n\t}\n\n\t// Recover from panics.\n\tif !p.startupOptions.has(withoutCatchPanics) {\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t\tp.shutdown(true)\n\t\t\t\tfmt.Printf(\"Caught panic:\\n\\n%s\\n\\nRestoring terminal...\\n\\n\", r)\n\t\t\t\tdebug.PrintStack()\n\t\t\t\treturn\n\t\t\t}\n\t\t}()\n\t}\n\n\t// If no renderer is set use the standard one.\n\tif p.renderer == nil {\n\t\tp.renderer = newRenderer(p.output, p.startupOptions.has(withANSICompressor), p.fps)\n\t}\n\n\t// Check if output is a TTY before entering raw mode, hiding the cursor and\n\t// so on.\n\tif err := p.initTerminal(); err != nil {\n\t\treturn p.initialModel, err\n\t}\n\n\t// Honor program startup options.\n\tif p.startupTitle != \"\" {\n\t\tp.renderer.setWindowTitle(p.startupTitle)\n\t}\n\tif p.startupOptions&withAltScreen != 0 {\n\t\tp.renderer.enterAltScreen()\n\t}\n\tif p.startupOptions&withoutBracketedPaste == 0 {\n\t\tp.renderer.enableBracketedPaste()\n\t}\n\tif p.startupOptions&withMouseCellMotion != 0 {\n\t\tp.renderer.enableMouseCellMotion()\n\t\tp.renderer.enableMouseSGRMode()\n\t} else if p.startupOptions&withMouseAllMotion != 0 {\n\t\tp.renderer.enableMouseAllMotion()\n\t\tp.renderer.enableMouseSGRMode()\n\t}\n\tif p.startupOptions&withReportFocus != 0 {\n\t\tp.renderer.enableReportFocus()\n\t}\n\n\t// Start the renderer.\n\tp.renderer.start()\n\n\t// Initialize the program.\n\tmodel := p.initialModel\n\tif initCmd := model.Init(); initCmd != nil {\n\t\tch := make(chan struct{})\n\t\thandlers.add(ch)\n\n\t\tgo func() {\n\t\t\tdefer close(ch)\n\n\t\t\tselect {\n\t\t\tcase cmds <- initCmd:\n\t\t\tcase <-p.ctx.Done():\n\t\t\t}\n\t\t}()\n\t}\n\n\t// Render the initial view.\n\tp.renderer.write(model.View())\n\n\t// Subscribe to user input.\n\tif p.input != nil {\n\t\tif err := p.initCancelReader(); err != nil {\n\t\t\treturn model, err\n\t\t}\n\t}\n\n\t// Handle resize events.\n\thandlers.add(p.handleResize())\n\n\t// Process commands.\n\thandlers.add(p.handleCommands(cmds))\n\n\t// Run event loop, handle updates and draw.\n\tmodel, err := p.eventLoop(model, cmds)\n\tkilled := p.ctx.Err() != nil\n\tif killed {\n\t\terr = fmt.Errorf(\"%w: %s\", ErrProgramKilled, p.ctx.Err())\n\t} else {\n\t\t// Ensure we rendered the final state of the model.\n\t\tp.renderer.write(model.View())\n\t}\n\n\t// Tear down.\n\tp.cancel()\n\n\t// Check if the cancel reader has been setup before waiting and closing.\n\tif p.cancelReader != nil {\n\t\t// Wait for input loop to finish.\n\t\tif p.cancelReader.Cancel() {\n\t\t\tp.waitForReadLoop()\n\t\t}\n\t\t_ = p.cancelReader.Close()\n\t}\n\n\t// Wait for all handlers to finish.\n\thandlers.shutdown()\n\n\t// Restore terminal state.\n\tp.shutdown(killed)\n\n\treturn model, err\n}\n\n// StartReturningModel initializes the program and runs its event loops,\n// blocking until it gets terminated by either [Program.Quit], [Program.Kill],\n// or its signal handler. Returns the final model.\n//\n// Deprecated: please use [Program.Run] instead.\nfunc (p *Program) StartReturningModel() (Model, error) {\n\treturn p.Run()\n}\n\n// Start initializes the program and runs its event loops, blocking until it\n// gets terminated by either [Program.Quit], [Program.Kill], or its signal\n// handler.\n//\n// Deprecated: please use [Program.Run] instead.\nfunc (p *Program) Start() error {\n\t_, err := p.Run()\n\treturn err\n}\n\n// Send sends a message to the main update function, effectively allowing\n// messages to be injected from outside the program for interoperability\n// purposes.\n//\n// If the program hasn't started yet this will be a blocking operation.\n// If the program has already been terminated this will be a no-op, so it's safe\n// to send messages after the program has exited.\nfunc (p *Program) Send(msg Msg) {\n\tselect {\n\tcase <-p.ctx.Done():\n\tcase p.msgs <- msg:\n\t}\n}\n\n// Quit is a convenience function for quitting Bubble Tea programs. Use it\n// when you need to shut down a Bubble Tea program from the outside.\n//\n// If you wish to quit from within a Bubble Tea program use the Quit command.\n//\n// If the program is not running this will be a no-op, so it's safe to call\n// if the program is unstarted or has already exited.\nfunc (p *Program) Quit() {\n\tp.Send(Quit())\n}\n\n// Kill stops the program immediately and restores the former terminal state.\n// The final render that you would normally see when quitting will be skipped.\n// [program.Run] returns a [ErrProgramKilled] error.\nfunc (p *Program) Kill() {\n\tp.cancel()\n}\n\n// Wait waits/blocks until the underlying Program finished shutting down.\nfunc (p *Program) Wait() {\n\t<-p.finished\n}\n\n// shutdown performs operations to free up resources and restore the terminal\n// to its original state.\nfunc (p *Program) shutdown(kill bool) {\n\tif p.renderer != nil {\n\t\tif kill {\n\t\t\tp.renderer.kill()\n\t\t} else {\n\t\t\tp.renderer.stop()\n\t\t}\n\t}\n\n\t_ = p.restoreTerminalState()\n\tp.finished <- struct{}{}\n}\n\n// ReleaseTerminal restores the original terminal state and cancels the input\n// reader. You can return control to the Program with RestoreTerminal.\nfunc (p *Program) ReleaseTerminal() error {\n\tatomic.StoreUint32(&p.ignoreSignals, 1)\n\tif p.cancelReader != nil {\n\t\tp.cancelReader.Cancel()\n\t}\n\n\tp.waitForReadLoop()\n\n\tif p.renderer != nil {\n\t\tp.renderer.stop()\n\t\tp.altScreenWasActive = p.renderer.altScreen()\n\t\tp.bpWasActive = p.renderer.bracketedPasteActive()\n\t\tp.reportFocus = p.renderer.reportFocus()\n\t}\n\n\treturn p.restoreTerminalState()\n}\n\n// RestoreTerminal reinitializes the Program's input reader, restores the\n// terminal to the former state when the program was running, and repaints.\n// Use it to reinitialize a Program after running ReleaseTerminal.\nfunc (p *Program) RestoreTerminal() error {\n\tatomic.StoreUint32(&p.ignoreSignals, 0)\n\n\tif err := p.initTerminal(); err != nil {\n\t\treturn err\n\t}\n\tif err := p.initCancelReader(); err != nil {\n\t\treturn err\n\t}\n\tif p.altScreenWasActive {\n\t\tp.renderer.enterAltScreen()\n\t} else {\n\t\t// entering alt screen already causes a repaint.\n\t\tgo p.Send(repaintMsg{})\n\t}\n\tif p.renderer != nil {\n\t\tp.renderer.start()\n\t}\n\tif p.bpWasActive {\n\t\tp.renderer.enableBracketedPaste()\n\t}\n\tif p.reportFocus {\n\t\tp.renderer.enableReportFocus()\n\t}\n\n\t// If the output is a terminal, it may have been resized while another\n\t// process was at the foreground, in which case we may not have received\n\t// SIGWINCH. Detect any size change now and propagate the new size as\n\t// needed.\n\tgo p.checkResize()\n\n\treturn nil\n}\n\n// Println prints above the Program. This output is unmanaged by the program\n// and will persist across renders by the Program.\n//\n// If the altscreen is active no output will be printed.\nfunc (p *Program) Println(args ...interface{}) {\n\tp.msgs <- printLineMessage{\n\t\tmessageBody: fmt.Sprint(args...),\n\t}\n}\n\n// Printf prints above the Program. It takes a format template followed by\n// values similar to fmt.Printf. This output is unmanaged by the program and\n// will persist across renders by the Program.\n//\n// Unlike fmt.Printf (but similar to log.Printf) the message will be print on\n// its own line.\n//\n// If the altscreen is active no output will be printed.\nfunc (p *Program) Printf(template string, args ...interface{}) {\n\tp.msgs <- printLineMessage{\n\t\tmessageBody: fmt.Sprintf(template, args...),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/tea_init.go",
    "content": "package tea\n\nimport (\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\nfunc init() {\n\t// XXX: This is a workaround to make assure that Lip Gloss and Termenv\n\t// query the terminal before any Bubble Tea Program runs and acquires the\n\t// terminal. Without this, Programs that use Lip Gloss/Termenv might hang\n\t// while waiting for a a [termenv.OSCTimeout] while querying the terminal\n\t// for its background/foreground colors.\n\t//\n\t// This happens because Bubble Tea acquires the terminal before termenv\n\t// reads any responses.\n\t//\n\t// Note that this will only affect programs running on the default IO i.e.\n\t// [os.Stdout] and [os.Stdin].\n\t//\n\t// This workaround will be removed in v2.\n\t_ = lipgloss.HasDarkBackground()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/tty.go",
    "content": "package tea\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/charmbracelet/x/term\"\n\t\"github.com/muesli/cancelreader\"\n)\n\nfunc (p *Program) suspend() {\n\tif err := p.ReleaseTerminal(); err != nil {\n\t\t// If we can't release input, abort.\n\t\treturn\n\t}\n\n\tsuspendProcess()\n\n\t_ = p.RestoreTerminal()\n\tgo p.Send(ResumeMsg{})\n}\n\nfunc (p *Program) initTerminal() error {\n\tif _, ok := p.renderer.(*nilRenderer); ok {\n\t\t// No need to initialize the terminal if we're not rendering\n\t\treturn nil\n\t}\n\n\tif err := p.initInput(); err != nil {\n\t\treturn err\n\t}\n\n\tp.renderer.hideCursor()\n\treturn nil\n}\n\n// restoreTerminalState restores the terminal to the state prior to running the\n// Bubble Tea program.\nfunc (p *Program) restoreTerminalState() error {\n\tif p.renderer != nil {\n\t\tp.renderer.disableBracketedPaste()\n\t\tp.renderer.showCursor()\n\t\tp.disableMouse()\n\n\t\tif p.renderer.reportFocus() {\n\t\t\tp.renderer.disableReportFocus()\n\t\t}\n\n\t\tif p.renderer.altScreen() {\n\t\t\tp.renderer.exitAltScreen()\n\n\t\t\t// give the terminal a moment to catch up\n\t\t\ttime.Sleep(time.Millisecond * 10) //nolint:gomnd\n\t\t}\n\t}\n\n\treturn p.restoreInput()\n}\n\n// restoreInput restores the tty input to its original state.\nfunc (p *Program) restoreInput() error {\n\tif p.ttyInput != nil && p.previousTtyInputState != nil {\n\t\tif err := term.Restore(p.ttyInput.Fd(), p.previousTtyInputState); err != nil {\n\t\t\treturn fmt.Errorf(\"error restoring console: %w\", err)\n\t\t}\n\t}\n\tif p.ttyOutput != nil && p.previousOutputState != nil {\n\t\tif err := term.Restore(p.ttyOutput.Fd(), p.previousOutputState); err != nil {\n\t\t\treturn fmt.Errorf(\"error restoring console: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// initCancelReader (re)commences reading inputs.\nfunc (p *Program) initCancelReader() error {\n\tvar err error\n\tp.cancelReader, err = newInputReader(p.input)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating cancelreader: %w\", err)\n\t}\n\n\tp.readLoopDone = make(chan struct{})\n\tgo p.readLoop()\n\n\treturn nil\n}\n\nfunc (p *Program) readLoop() {\n\tdefer close(p.readLoopDone)\n\n\terr := readInputs(p.ctx, p.msgs, p.cancelReader)\n\tif !errors.Is(err, io.EOF) && !errors.Is(err, cancelreader.ErrCanceled) {\n\t\tselect {\n\t\tcase <-p.ctx.Done():\n\t\tcase p.errs <- err:\n\t\t}\n\t}\n}\n\n// waitForReadLoop waits for the cancelReader to finish its read loop.\nfunc (p *Program) waitForReadLoop() {\n\tselect {\n\tcase <-p.readLoopDone:\n\tcase <-time.After(500 * time.Millisecond): //nolint:gomnd\n\t\t// The read loop hangs, which means the input\n\t\t// cancelReader's cancel function has returned true even\n\t\t// though it was not able to cancel the read.\n\t}\n}\n\n// checkResize detects the current size of the output and informs the program\n// via a WindowSizeMsg.\nfunc (p *Program) checkResize() {\n\tif p.ttyOutput == nil {\n\t\t// can't query window size\n\t\treturn\n\t}\n\n\tw, h, err := term.GetSize(p.ttyOutput.Fd())\n\tif err != nil {\n\t\tselect {\n\t\tcase <-p.ctx.Done():\n\t\tcase p.errs <- err:\n\t\t}\n\n\t\treturn\n\t}\n\n\tp.Send(WindowSizeMsg{\n\t\tWidth:  w,\n\t\tHeight: h,\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/tty_unix.go",
    "content": "//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix || zos\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris aix zos\n\npackage tea\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/charmbracelet/x/term\"\n)\n\nfunc (p *Program) initInput() (err error) {\n\t// Check if input is a terminal\n\tif f, ok := p.input.(term.File); ok && term.IsTerminal(f.Fd()) {\n\t\tp.ttyInput = f\n\t\tp.previousTtyInputState, err = term.MakeRaw(p.ttyInput.Fd())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error entering raw mode: %w\", err)\n\t\t}\n\t}\n\n\tif f, ok := p.output.(term.File); ok && term.IsTerminal(f.Fd()) {\n\t\tp.ttyOutput = f\n\t}\n\n\treturn nil\n}\n\nfunc openInputTTY() (*os.File, error) {\n\tf, err := os.Open(\"/dev/tty\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not open a new TTY: %w\", err)\n\t}\n\treturn f, nil\n}\n\nconst suspendSupported = true\n\n// Send SIGTSTP to the entire process group.\nfunc suspendProcess() {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGCONT)\n\t_ = syscall.Kill(0, syscall.SIGTSTP)\n\t// blocks until a CONT happens...\n\t<-c\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/bubbletea/tty_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage tea\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/charmbracelet/x/term\"\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc (p *Program) initInput() (err error) {\n\t// Save stdin state and enable VT input\n\t// We also need to enable VT\n\t// input here.\n\tif f, ok := p.input.(term.File); ok && term.IsTerminal(f.Fd()) {\n\t\tp.ttyInput = f\n\t\tp.previousTtyInputState, err = term.MakeRaw(p.ttyInput.Fd())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Enable VT input\n\t\tvar mode uint32\n\t\tif err := windows.GetConsoleMode(windows.Handle(p.ttyInput.Fd()), &mode); err != nil {\n\t\t\treturn fmt.Errorf(\"error getting console mode: %w\", err)\n\t\t}\n\n\t\tif err := windows.SetConsoleMode(windows.Handle(p.ttyInput.Fd()), mode|windows.ENABLE_VIRTUAL_TERMINAL_INPUT); err != nil {\n\t\t\treturn fmt.Errorf(\"error setting console mode: %w\", err)\n\t\t}\n\t}\n\n\t// Save output screen buffer state and enable VT processing.\n\tif f, ok := p.output.(term.File); ok && term.IsTerminal(f.Fd()) {\n\t\tp.ttyOutput = f\n\t\tp.previousOutputState, err = term.GetState(f.Fd())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar mode uint32\n\t\tif err := windows.GetConsoleMode(windows.Handle(p.ttyOutput.Fd()), &mode); err != nil {\n\t\t\treturn fmt.Errorf(\"error getting console mode: %w\", err)\n\t\t}\n\n\t\tif err := windows.SetConsoleMode(windows.Handle(p.ttyOutput.Fd()), mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err != nil {\n\t\t\treturn fmt.Errorf(\"error setting console mode: %w\", err)\n\t\t}\n\t}\n\n\treturn\n}\n\n// Open the Windows equivalent of a TTY.\nfunc openInputTTY() (*os.File, error) {\n\tf, err := os.OpenFile(\"CONIN$\", os.O_RDWR, 0o644)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}\n\nconst suspendSupported = false\n\nfunc suspendProcess() {}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/.gitattributes",
    "content": "*.gif filter=lfs diff=lfs merge=lfs -text\n*.png filter=lfs diff=lfs merge=lfs -text\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/.gitignore",
    "content": "# If you prefer the allow list template instead of the deny list, see community template:\n# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore\n#\n# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, built with `go test -c`\n*.test\n\n# Output of the go coverage tool, specifically when used with LiteIDE\n*.out\n\n# Dependency directories (remove the comment below to include it)\n# vendor/\n\n# Go workspace file\ngo.work\n\n# Debugging\ndebug.log\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/.golangci-soft.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    - exhaustive\n    - goconst\n    - godot\n    - mnd\n    - gomoddirectives\n    - goprintffuncname\n    - misspell\n    - nakedret\n    - nestif\n    - noctx\n    - nolintlint\n    - prealloc\n    - wrapcheck\n\n  # disable default linters, they are already enabled in .golangci.yml\n  disable:\n    - errcheck\n    - gosimple\n    - govet\n    - ineffassign\n    - staticcheck\n    - typecheck\n    - unused\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/.golangci.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    - bodyclose\n    - goimports\n    - gosec\n    - nilerr\n    - predeclared\n    - revive\n    - rowserrcheck\n    - sqlclosecheck\n    - tparallel\n    - unconvert\n    - unparam\n    - whitespace\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/CONTRIBUTING.md",
    "content": "Contributions are welcome!\n\nPlease submit a PR or open an issue to discuss features.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2023 Charm\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/Makefile",
    "content": ".PHONY: spinner\n\n$(V).SILENT:\ntest:\n\tgo test ./...\n\nspinner:\n\tcd spinner/examples/loading && go run .\n\nburger:\n\tcd examples/burger && go run .\n\ntheme:\n\tcd examples/theme && go run .\n\ngh:\n\tcd examples/gh && go run .\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/README.md",
    "content": "# Huh?\n\n<p>\n  <img alt=\"Hey there! I’m Glenn!\" title=\"Hey there! I’m Glenn!\" src=\"https://stuff.charm.sh/huh/glenn.png\" width=\"400\" />\n  <br><br>\n  <a href=\"https://github.com/charmbracelet/huh/releases\"><img src=\"https://img.shields.io/github/release/charmbracelet/huh.svg\" alt=\"Latest Release\"></a>\n  <a href=\"https://pkg.go.dev/github.com/charmbracelet/huh?tab=doc\"><img src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"Go Docs\"></a>\n  <a href=\"https://github.com/charmbracelet/huh/actions\"><img src=\"https://github.com/charmbracelet/huh/actions/workflows/build.yml/badge.svg?branch=main\" alt=\"Build Status\"></a>\n</p>\n\nA simple, powerful library for building interactive forms and prompts in the terminal.\n\n<img alt=\"Running a burger form\" width=\"600\" src=\"https://vhs.charm.sh/vhs-3J4i6HE3yBmz6SUO3HqILr.gif\">\n\n`huh?` is easy to use in a standalone fashion, can be\n[integrated into a Bubble Tea application](#what-about-bubble-tea), and contains\na first-class [accessible mode](#accessibility) for screen readers.\n\nThe above example is running from a single Go program ([source](./examples/burger/main.go)).\n\n## Tutorial\n\nLet’s build a form for ordering burgers. To start, we’ll import the library and\ndefine a few variables where’ll we store answers.\n\n```go\npackage main\n\nimport \"github.com/charmbracelet/huh\"\n\nvar (\n    burger       string\n    toppings     []string\n    sauceLevel   int\n    name         string\n    instructions string\n    discount     bool\n)\n```\n\n`huh?` separates forms into groups (you can think of groups as pages). Groups\nare made of fields (e.g. `Select`, `Input`, `Text`). We will set up three\ngroups for the customer to fill out.\n\n```go\nform := huh.NewForm(\n    huh.NewGroup(\n        // Ask the user for a base burger and toppings.\n        huh.NewSelect[string]().\n            Title(\"Choose your burger\").\n            Options(\n                huh.NewOption(\"Charmburger Classic\", \"classic\"),\n                huh.NewOption(\"Chickwich\", \"chickwich\"),\n                huh.NewOption(\"Fishburger\", \"fishburger\"),\n                huh.NewOption(\"Charmpossible™ Burger\", \"charmpossible\"),\n            ).\n            Value(&burger), // store the chosen option in the \"burger\" variable\n\n        // Let the user select multiple toppings.\n        huh.NewMultiSelect[string]().\n            Title(\"Toppings\").\n            Options(\n                huh.NewOption(\"Lettuce\", \"lettuce\").Selected(true),\n                huh.NewOption(\"Tomatoes\", \"tomatoes\").Selected(true),\n                huh.NewOption(\"Jalapeños\", \"jalapeños\"),\n                huh.NewOption(\"Cheese\", \"cheese\"),\n                huh.NewOption(\"Vegan Cheese\", \"vegan cheese\"),\n                huh.NewOption(\"Nutella\", \"nutella\"),\n            ).\n            Limit(4). // there’s a 4 topping limit!\n            Value(&toppings),\n\n        // Option values in selects and multi selects can be any type you\n        // want. We’ve been recording strings above, but here we’ll store\n        // answers as integers. Note the generic \"[int]\" directive below.\n        huh.NewSelect[int]().\n            Title(\"How much Charm Sauce do you want?\").\n            Options(\n                huh.NewOption(\"None\", 0),\n                huh.NewOption(\"A little\", 1),\n                huh.NewOption(\"A lot\", 2),\n            ).\n            Value(&sauceLevel),\n    ),\n\n    // Gather some final details about the order.\n    huh.NewGroup(\n        huh.NewInput().\n            Title(\"What’s your name?\").\n            Value(&name).\n            // Validating fields is easy. The form will mark erroneous fields\n            // and display error messages accordingly.\n            Validate(func(str string) error {\n                if str == \"Frank\" {\n                    return errors.New(\"Sorry, we don’t serve customers named Frank.\")\n                }\n                return nil\n            }),\n\n        huh.NewText().\n            Title(\"Special Instructions\").\n            CharLimit(400).\n            Value(&instructions),\n\n        huh.NewConfirm().\n            Title(\"Would you like 15% off?\").\n            Value(&discount),\n    ),\n)\n```\n\nFinally, run the form:\n\n```go\nerr := form.Run()\nif err != nil {\n    log.Fatal(err)\n}\n\nif !discount {\n    fmt.Println(\"What? You didn’t take the discount?!\")\n}\n```\n\nAnd that’s it! For more info see [the full source][burgersource] for this\nexample as well as [the docs][docs].\n\nIf you need more dynamic forms that change based on input from previous fields,\ncheck out the [dynamic forms](#dynamic-forms) example.\n\n[burgersource]: ./examples/burger/main.go\n[docs]: https://pkg.go.dev/github.com/charmbracelet/huh?tab=doc\n\n## Field Reference\n\n- [`Input`](#input): single line text input\n- [`Text`](#text): multi-line text input\n- [`Select`](#select): select an option from a list\n- [`MultiSelect`](#multiple-select): select multiple options from a list\n- [`Confirm`](#confirm): confirm an action (yes or no)\n\n> [!TIP]\n> Just want to prompt the user with a single field? Each field has a `Run`\n> method that can be used as a shorthand for gathering quick and easy input.\n\n```go\nvar name string\n\nhuh.NewInput().\n    Title(\"What’s your name?\").\n    Value(&name).\n    Run() // this is blocking...\n\nfmt.Printf(\"Hey, %s!\\n\", name)\n```\n\n### Input\n\nPrompt the user for a single line of text.\n\n<img alt=\"Input field\" width=\"600\" src=\"https://vhs.charm.sh/vhs-1ULe9JbTHfwFmm3hweRVtD.gif\">\n\n```go\nhuh.NewInput().\n    Title(\"What’s for lunch?\").\n    Prompt(\"?\").\n    Validate(isFood).\n    Value(&lunch)\n```\n\n### Text\n\nPrompt the user for multiple lines of text.\n\n<img alt=\"Text field\" width=\"600\" src=\"https://vhs.charm.sh/vhs-2rrIuVSEf38bT0cwc8hfEG.gif\">\n\n```go\nhuh.NewText().\n    Title(\"Tell me a story.\").\n    Validate(checkForPlagiarism).\n    Value(&story)\n```\n\n### Select\n\nPrompt the user to select a single option from a list.\n\n<img alt=\"Select field\" width=\"600\" src=\"https://vhs.charm.sh/vhs-7wFqZlxMWgbWmOIpBqXJTi.gif\">\n\n```go\nhuh.NewSelect[string]().\n    Title(\"Pick a country.\").\n    Options(\n        huh.NewOption(\"United States\", \"US\"),\n        huh.NewOption(\"Germany\", \"DE\"),\n        huh.NewOption(\"Brazil\", \"BR\"),\n        huh.NewOption(\"Canada\", \"CA\"),\n    ).\n    Value(&country)\n```\n\n### Multiple Select\n\nPrompt the user to select multiple (zero or more) options from a list.\n\n<img alt=\"Multiselect field\" width=\"600\" src=\"https://vhs.charm.sh/vhs-3TLImcoexOehRNLELysMpK.gif\">\n\n```go\nhuh.NewMultiSelect[string]().\n    Options(\n        huh.NewOption(\"Lettuce\", \"Lettuce\").Selected(true),\n        huh.NewOption(\"Tomatoes\", \"Tomatoes\").Selected(true),\n        huh.NewOption(\"Charm Sauce\", \"Charm Sauce\"),\n        huh.NewOption(\"Jalapeños\", \"Jalapeños\"),\n        huh.NewOption(\"Cheese\", \"Cheese\"),\n        huh.NewOption(\"Vegan Cheese\", \"Vegan Cheese\"),\n        huh.NewOption(\"Nutella\", \"Nutella\"),\n    ).\n    Title(\"Toppings\").\n    Limit(4).\n    Value(&toppings)\n```\n\n### Confirm\n\nPrompt the user to confirm (Yes or No).\n\n<img alt=\"Confirm field\" width=\"600\" src=\"https://vhs.charm.sh/vhs-2HeX5MdOxLsrWwsa0TNMIL.gif\">\n\n```go\nhuh.NewConfirm().\n    Title(\"Are you sure?\").\n    Affirmative(\"Yes!\").\n    Negative(\"No.\").\n    Value(&confirm)\n```\n\n## Accessibility\n\n`huh?` has a special rendering option designed specifically for screen readers.\nYou can enable it with `form.WithAccessible(true)`.\n\n> [!TIP]\n> We recommend setting this through an environment variable or configuration\n> option to allow the user to control accessibility.\n\n```go\naccessibleMode := os.Getenv(\"ACCESSIBLE\") != \"\"\nform.WithAccessible(accessibleMode)\n```\n\nAccessible forms will drop TUIs in favor of standard prompts, providing better\ndictation and feedback of the information on screen for the visually impaired.\n\n<img alt=\"Accessible cuisine form\" width=\"600\" src=\"https://vhs.charm.sh/vhs-19xEBn4LgzPZDtgzXRRJYS.gif\">\n\n## Themes\n\n`huh?` contains a powerful theme abstraction. Supply your own custom theme or\nchoose from one of the five predefined themes:\n\n- `Charm`\n- `Dracula`\n- `Catppuccin`\n- `Base 16`\n- `Default`\n\n<br />\n<p>\n    <img alt=\"Charm-themed form\" width=\"400\" src=\"https://stuff.charm.sh/huh/themes/charm-theme.png\">\n    <img alt=\"Dracula-themed form\" width=\"400\" src=\"https://stuff.charm.sh/huh/themes/dracula-theme.png\">\n    <img alt=\"Catppuccin-themed form\" width=\"400\" src=\"https://stuff.charm.sh/huh/themes/catppuccin-theme.png\">\n    <img alt=\"Base 16-themed form\" width=\"400\" src=\"https://stuff.charm.sh/huh/themes/basesixteen-theme.png\">\n    <img alt=\"Default-themed form\" width=\"400\" src=\"https://stuff.charm.sh/huh/themes/default-theme.png\">\n</p>\n\nThemes can take advantage of the full range of\n[Lip Gloss][lipgloss] style options. For a high level theme reference see\n[the docs](https://pkg.go.dev/github.com/charmbracelet/huh#Theme).\n\n[lipgloss]: https://github.com/charmbracelet/lipgloss\n\n## Dynamic Forms\n\n`huh?` forms can be as dynamic as your heart desires. Simply replace properties\nwith their equivalent `Func` to recompute the properties value every time a\ndifferent part of your form changes.\n\nHere’s how you would build a simple country + state / province picker.\n\nFirst, define some variables that we’ll use to store the user selection.\n\n```go\nvar country string\nvar state string\n```\n\nDefine your country select as you normally would:\n\n```go\nhuh.NewSelect[string]().\n    Options(huh.NewOptions(\"United States\", \"Canada\", \"Mexico\")...).\n    Value(&country).\n    Title(\"Country\").\n```\n\nDefine your state select with `TitleFunc` and `OptionsFunc` instead of `Title`\nand `Options`. This will allow you to change the title and options based on the\nselection of the previous field, i.e. `country`.\n\nTo do this, we provide a `func() string` and a `binding any` to `TitleFunc`. The\nfunction defines what to show for the title and the binding specifies what value\nneeds to change for the function to recompute. So if `country` changes (e.g. the\nuser changes the selection) we will recompute the function.\n\nFor `OptionsFunc`, we provide a `func() []Option[string]` and a `binding any`.\nWe’ll fetch the country’s states, provinces, or territories from an API. `huh`\nwill automatically handle caching for you.\n\n> [!IMPORTANT]\n> We have to pass `&country` as the binding to recompute the function only when\n> `country` changes, otherwise we will hit the API too often.\n\n```go\nhuh.NewSelect[string]().\n    Value(&state).\n    Height(8).\n    TitleFunc(func() string {\n        switch country {\n        case \"United States\":\n            return \"State\"\n        case \"Canada\":\n            return \"Province\"\n        default:\n            return \"Territory\"\n        }\n    }, &country).\n    OptionsFunc(func() []huh.Option[string] {\n        opts := fetchStatesForCountry(country)\n        return huh.NewOptions(opts...)\n    }, &country),\n```\n\nLastly, run the `form` with these inputs.\n\n```go\nerr := form.Run()\nif err != nil {\n    log.Fatal(err)\n}\n```\n\n<img width=\"600\" src=\"https://vhs.charm.sh/vhs-6FRmBjNi2aiRb4INPXwIjo.gif\" alt=\"Country / State form with dynamic inputs running.\">\n\n## Bonus: Spinner\n\n`huh?` ships with a standalone spinner package. It’s useful for indicating\nbackground activity after a form is submitted.\n\n<img alt=\"Spinner while making a burger\" width=\"600\" src=\"https://vhs.charm.sh/vhs-6HvYomAFP6H8mngOYWXvwJ.gif\">\n\nCreate a new spinner, set a title, set the action (or provide a `Context`), and run the spinner:\n\n<table>\n\n<tr>\n<td> <strong>Action Style</strong> </td><td> <strong>Context Style</strong> </td></tr>\n<tr>\n<td>\n\n```go\nerr := spinner.New().\n    Title(\"Making your burger...\").\n    Action(makeBurger).\n    Run()\n\nfmt.Println(\"Order up!\")\n```\n\n</td>\n<td>\n\n```go\ngo makeBurger()\n\nerr := spinner.New().\n    Type(spinner.Line).\n    Title(\"Making your burger...\").\n    Context(ctx).\n    Run()\n\nfmt.Println(\"Order up!\")\n```\n\n</td>\n</tr>\n</table>\n\nFor more on Spinners see the [spinner examples](./spinner/examples) and\n[the spinner docs](https://pkg.go.dev/github.com/charmbracelet/huh/spinner).\n\n## What about Bubble Tea?\n\n<img alt=\"Bubbletea + Huh?\" width=\"174\" src=\"https://stuff.charm.sh/huh/bubbletea-huh.png\">\n\nIn addition to its standalone mode, `huh?` has first-class support for\n[Bubble Tea][tea] and can be easily integrated into Bubble Tea applications.\nIt’s incredibly useful in portions of your Bubble Tea application that need\nform-like input.\n\n<img alt=\"Bubble Tea embedded form example\" width=\"800\" src=\"https://vhs.charm.sh/vhs-3wGaB7EUKWmojeaHpARMUv.gif\">\n\nA `huh.Form` is merely a `tea.Model`, so you can use it just as\nyou would any other [Bubble](https://github.com/charmbracelet/bubbles).\n\n```go\ntype Model struct {\n    form *huh.Form // huh.Form is just a tea.Model\n}\n\nfunc NewModel() Model {\n    return Model{\n        form: huh.NewForm(\n            huh.NewGroup(\n                huh.NewSelect[string]().\n                    Key(\"class\").\n                    Options(huh.NewOptions(\"Warrior\", \"Mage\", \"Rogue\")...).\n                    Title(\"Choose your class\"),\n\n            huh.NewSelect[int]().\n                Key(\"level\").\n                Options(huh.NewOptions(1, 20, 9999)...).\n                Title(\"Choose your level\"),\n            ),\n        )\n    }\n}\n\nfunc (m Model) Init() tea.Cmd {\n    return m.form.Init()\n}\n\nfunc (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n    // ...\n\n    form, cmd := m.form.Update(msg)\n    if f, ok := form.(*huh.Form); ok {\n        m.form = f\n    }\n\n    return m, cmd\n}\n\nfunc (m Model) View() string {\n    if m.form.State == huh.StateCompleted {\n        class := m.form.GetString(\"class\")\n        level := m.form.GetString(\"level\")\n        return fmt.Sprintf(\"You selected: %s, Lvl. %d\", class, level)\n    }\n    return m.form.View()\n}\n\n```\n\nFor more info in using `huh?` in Bubble Tea applications see [the full Bubble\nTea example][example].\n\n[tea]: https://github.com/charmbracelet/bubbletea\n[bubbles]: https://github.com/charmbracelet/bubbles\n[example]: https://github.com/charmbracelet/huh/blob/main/examples/bubbletea/main.go\n\n## `Huh?` in the Wild\nFor some `Huh?` programs in production, see:\n\n* [glyphs](https://github.com/maaslalani/glyphs): a unicode symbol picker\n* [meteor](https://github.com/stefanlogue/meteor): a highly customisable conventional commit message tool\n* [freeze](https://github.com/charmbracelet/freeze): a tool for generating images of code and terminal output\n* [gum](https://github.com/charmbracelet/gum): a tool for glamorous shell scripts\n* [savvy](https://github.com/getsavvyinc/savvy-cli): the easiest way to create, share, and run runbooks in the terminal\n\n\n## Feedback\n\nWe’d love to hear your thoughts on this project. Feel free to drop us a note!\n\n- [Twitter](https://twitter.com/charmcli)\n- [The Fediverse](https://mastodon.social/@charmcli)\n- [Discord](https://charm.sh/chat)\n\n## Acknowledgments\n\n`huh?` is inspired by the wonderful [Survey][survey] library by Alec Aivazis.\n\n[survey]: https://github.com/AlecAivazis/survey\n\n## License\n\n[MIT](https://github.com/charmbracelet/bubbletea/raw/master/LICENSE)\n\n---\n\nPart of [Charm](https://charm.sh).\n\n<a href=\"https://charm.sh/\"><img alt=\"The Charm logo\" src=\"https://stuff.charm.sh/charm-badge.jpg\" width=\"400\"></a>\n\nCharm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/SECURITY.md",
    "content": "# Security Policy\n\n## Reporting a Vulnerability\n\nPlease email [vt100@charm.sh](mailto:vt100@charm.sh) for any possible security vulnerabilities.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/accessibility/accessibility.go",
    "content": "package accessibility\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// PromptInt prompts a user for an integer between a certain range.\n//\n// Given invalid input (non-integers, integers outside of the range), the user\n// will continue to be reprompted until a valid input is given, ensuring that\n// the return value is always valid.\nfunc PromptInt(prompt string, low, high int) int {\n\tvar (\n\t\tinput  string\n\t\tchoice int\n\t)\n\n\tvalidInt := func(s string) error {\n\t\ti, err := strconv.Atoi(s)\n\t\tif err != nil || i < low || i > high {\n\t\t\treturn errors.New(\"invalid input. please try again\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tinput = PromptString(prompt, validInt)\n\tchoice, _ = strconv.Atoi(input)\n\treturn choice\n}\n\nfunc parseBool(s string) (bool, error) {\n\ts = strings.ToLower(s)\n\n\tfor _, y := range []string{\"y\", \"yes\"} {\n\t\tif y == s {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\tfor _, n := range []string{\"n\", \"no\"} {\n\t\tif n == s {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\treturn false, errors.New(\"invalid input. please try again\")\n}\n\n// PromptBool prompts a user for a boolean value.\n//\n// Given invalid input (non-boolean), the user will continue to be reprompted\n// until a valid input is given, ensuring that the return value is always valid.\nfunc PromptBool() bool {\n\tvalidBool := func(s string) error {\n\t\t_, err := parseBool(s)\n\t\treturn err\n\t}\n\n\tinput := PromptString(\"Choose [y/N]: \", validBool)\n\tb, _ := parseBool(input)\n\treturn b\n}\n\n// PromptString prompts a user for a string value and validates it against a\n// validator function. It re-prompts the user until a valid input is given.\nfunc PromptString(prompt string, validator func(input string) error) string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tvar (\n\t\tvalid bool\n\t\tinput string\n\t)\n\n\tfor !valid {\n\t\tfmt.Print(prompt)\n\t\t_ = scanner.Scan()\n\t\tinput = scanner.Text()\n\n\t\terr := validator(input)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn input\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/accessor.go",
    "content": "package huh\n\n// Accessor give read/write access to field values.\ntype Accessor[T any] interface {\n\tGet() T\n\tSet(value T)\n}\n\n// EmbeddedAccessor is a basic accessor, acting as the default one for fields.\ntype EmbeddedAccessor[T any] struct {\n\tvalue T\n}\n\n// Get gets the value.\nfunc (a *EmbeddedAccessor[T]) Get() T {\n\treturn a.value\n}\n\n// Set sets the value.\nfunc (a *EmbeddedAccessor[T]) Set(value T) {\n\ta.value = value\n}\n\n// PointerAccessor allows field value to be exposed as a pointed variable.\ntype PointerAccessor[T any] struct {\n\tvalue *T\n}\n\n// NewPointerAccessor returns a new pointer accessor.\nfunc NewPointerAccessor[T any](value *T) *PointerAccessor[T] {\n\treturn &PointerAccessor[T]{\n\t\tvalue: value,\n\t}\n}\n\n// Get gets the value.\nfunc (a *PointerAccessor[T]) Get() T {\n\treturn *a.value\n}\n\n// Set sets the value.\nfunc (a *PointerAccessor[T]) Set(value T) {\n\t*a.value = value\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/clamp.go",
    "content": "package huh\n\nfunc clamp(n, low, high int) int {\n\tif low > high {\n\t\tlow, high = high, low\n\t}\n\treturn min(high, max(low, n))\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/eval.go",
    "content": "package huh\n\nimport (\n\t\"time\"\n\n\t\"github.com/mitchellh/hashstructure/v2\"\n)\n\n// Eval is an evaluatable value, it stores a cached value and a function to\n// recompute it. It's bindings are what we check to see if we need to recompute\n// the value.\n//\n// By default it is also cached.\ntype Eval[T any] struct {\n\tval T\n\tfn  func() T\n\n\tbindings     any\n\tbindingsHash uint64\n\tcache        map[uint64]T\n\n\tloading      bool\n\tloadingStart time.Time\n}\n\nconst spinnerShowThreshold = 25 * time.Millisecond\n\nfunc hash(val any) uint64 {\n\thash, _ := hashstructure.Hash(val, hashstructure.FormatV2, nil)\n\treturn hash\n}\n\nfunc (e *Eval[T]) shouldUpdate() (bool, uint64) {\n\tif e.fn == nil {\n\t\treturn false, 0\n\t}\n\tnewHash := hash(e.bindings)\n\treturn e.bindingsHash != newHash, newHash\n}\n\nfunc (e *Eval[T]) loadFromCache() bool {\n\tval, ok := e.cache[e.bindingsHash]\n\tif ok {\n\t\te.loading = false\n\t\te.val = val\n\t}\n\treturn ok\n}\n\nfunc (e *Eval[T]) update(val T) {\n\te.val = val\n\te.cache[e.bindingsHash] = val\n\te.loading = false\n}\n\ntype updateTitleMsg struct {\n\tid    int\n\thash  uint64\n\ttitle string\n}\n\ntype updateDescriptionMsg struct {\n\tid          int\n\thash        uint64\n\tdescription string\n}\n\ntype updatePlaceholderMsg struct {\n\tid          int\n\thash        uint64\n\tplaceholder string\n}\n\ntype updateSuggestionsMsg struct {\n\tid          int\n\thash        uint64\n\tsuggestions []string\n}\n\ntype updateOptionsMsg[T comparable] struct {\n\tid      int\n\thash    uint64\n\toptions []Option[T]\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_confirm.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Confirm is a form confirm field.\ntype Confirm struct {\n\taccessor Accessor[bool]\n\tkey      string\n\tid       int\n\n\t// customization\n\ttitle       Eval[string]\n\tdescription Eval[string]\n\taffirmative string\n\tnegative    string\n\n\t// error handling\n\tvalidate func(bool) error\n\terr      error\n\n\t// state\n\tfocused bool\n\n\t// options\n\twidth      int\n\theight     int\n\tinline     bool\n\taccessible bool\n\ttheme      *Theme\n\tkeymap     ConfirmKeyMap\n}\n\n// NewConfirm returns a new confirm field.\nfunc NewConfirm() *Confirm {\n\treturn &Confirm{\n\t\taccessor:    &EmbeddedAccessor[bool]{},\n\t\tid:          nextID(),\n\t\ttitle:       Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription: Eval[string]{cache: make(map[uint64]string)},\n\t\taffirmative: \"Yes\",\n\t\tnegative:    \"No\",\n\t\tvalidate:    func(bool) error { return nil },\n\t}\n}\n\n// Validate sets the validation function of the confirm field.\nfunc (c *Confirm) Validate(validate func(bool) error) *Confirm {\n\tc.validate = validate\n\treturn c\n}\n\n// Error returns the error of the confirm field.\nfunc (c *Confirm) Error() error {\n\treturn c.err\n}\n\n// Skip returns whether the confirm should be skipped or should be blocking.\nfunc (*Confirm) Skip() bool {\n\treturn false\n}\n\n// Zoom returns whether the input should be zoomed.\nfunc (*Confirm) Zoom() bool {\n\treturn false\n}\n\n// Affirmative sets the affirmative value of the confirm field.\nfunc (c *Confirm) Affirmative(affirmative string) *Confirm {\n\tc.affirmative = affirmative\n\treturn c\n}\n\n// Negative sets the negative value of the confirm field.\nfunc (c *Confirm) Negative(negative string) *Confirm {\n\tc.negative = negative\n\treturn c\n}\n\n// Value sets the value of the confirm field.\nfunc (c *Confirm) Value(value *bool) *Confirm {\n\treturn c.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the confirm field.\nfunc (c *Confirm) Accessor(accessor Accessor[bool]) *Confirm {\n\tc.accessor = accessor\n\treturn c\n}\n\n// Key sets the key of the confirm field.\nfunc (c *Confirm) Key(key string) *Confirm {\n\tc.key = key\n\treturn c\n}\n\n// Title sets the title of the confirm field.\nfunc (c *Confirm) Title(title string) *Confirm {\n\tc.title.val = title\n\tc.title.fn = nil\n\treturn c\n}\n\n// TitleFunc sets the title func of the confirm field.\nfunc (c *Confirm) TitleFunc(f func() string, bindings any) *Confirm {\n\tc.title.fn = f\n\tc.title.bindings = bindings\n\treturn c\n}\n\n// Description sets the description of the confirm field.\nfunc (c *Confirm) Description(description string) *Confirm {\n\tc.description.val = description\n\tc.description.fn = nil\n\treturn c\n}\n\n// DescriptionFunc sets the description function of the confirm field.\nfunc (c *Confirm) DescriptionFunc(f func() string, bindings any) *Confirm {\n\tc.description.fn = f\n\tc.description.bindings = bindings\n\treturn c\n}\n\n// Inline sets whether the field should be inline.\nfunc (c *Confirm) Inline(inline bool) *Confirm {\n\tc.inline = inline\n\treturn c\n}\n\n// Focus focuses the confirm field.\nfunc (c *Confirm) Focus() tea.Cmd {\n\tc.focused = true\n\treturn nil\n}\n\n// Blur blurs the confirm field.\nfunc (c *Confirm) Blur() tea.Cmd {\n\tc.focused = false\n\tc.err = c.validate(c.accessor.Get())\n\treturn nil\n}\n\n// KeyBinds returns the help message for the confirm field.\nfunc (c *Confirm) KeyBinds() []key.Binding {\n\treturn []key.Binding{c.keymap.Toggle, c.keymap.Prev, c.keymap.Submit, c.keymap.Next, c.keymap.Accept, c.keymap.Reject}\n}\n\n// Init initializes the confirm field.\nfunc (c *Confirm) Init() tea.Cmd {\n\treturn nil\n}\n\n// Update updates the confirm field.\nfunc (c *Confirm) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tvar cmds []tea.Cmd\n\n\tswitch msg := msg.(type) {\n\tcase updateFieldMsg:\n\t\tif ok, hash := c.title.shouldUpdate(); ok {\n\t\t\tc.title.bindingsHash = hash\n\t\t\tif !c.title.loadFromCache() {\n\t\t\t\tc.title.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: c.id, title: c.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := c.description.shouldUpdate(); ok {\n\t\t\tc.description.bindingsHash = hash\n\t\t\tif !c.description.loadFromCache() {\n\t\t\t\tc.description.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: c.id, description: c.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\tcase updateTitleMsg:\n\t\tif msg.id == c.id && msg.hash == c.title.bindingsHash {\n\t\t\tc.title.val = msg.title\n\t\t\tc.title.loading = false\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif msg.id == c.id && msg.hash == c.description.bindingsHash {\n\t\t\tc.description.val = msg.description\n\t\t\tc.description.loading = false\n\t\t}\n\tcase tea.KeyMsg:\n\t\tc.err = nil\n\t\tswitch {\n\t\tcase key.Matches(msg, c.keymap.Toggle):\n\t\t\tif c.negative == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tc.accessor.Set(!c.accessor.Get())\n\t\tcase key.Matches(msg, c.keymap.Prev):\n\t\t\tcmds = append(cmds, PrevField)\n\t\tcase key.Matches(msg, c.keymap.Next, c.keymap.Submit):\n\t\t\tcmds = append(cmds, NextField)\n\t\tcase key.Matches(msg, c.keymap.Accept):\n\t\t\tc.accessor.Set(true)\n\t\t\tcmds = append(cmds, NextField)\n\t\tcase key.Matches(msg, c.keymap.Reject):\n\t\t\tc.accessor.Set(false)\n\t\t\tcmds = append(cmds, NextField)\n\t\t}\n\t}\n\n\treturn c, tea.Batch(cmds...)\n}\n\nfunc (c *Confirm) activeStyles() *FieldStyles {\n\ttheme := c.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif c.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\n// View renders the confirm field.\nfunc (c *Confirm) View() string {\n\tstyles := c.activeStyles()\n\n\tvar sb strings.Builder\n\tsb.WriteString(styles.Title.Render(c.title.val))\n\tif c.err != nil {\n\t\tsb.WriteString(styles.ErrorIndicator.String())\n\t}\n\n\tdescription := styles.Description.Render(c.description.val)\n\n\tif !c.inline && (c.description.val != \"\" || c.description.fn != nil) {\n\t\tsb.WriteString(\"\\n\")\n\t}\n\tsb.WriteString(description)\n\n\tif !c.inline {\n\t\tsb.WriteString(\"\\n\")\n\t\tsb.WriteString(\"\\n\")\n\t}\n\n\tvar negative string\n\tvar affirmative string\n\tif c.negative != \"\" {\n\t\tif c.accessor.Get() {\n\t\t\taffirmative = styles.FocusedButton.Render(c.affirmative)\n\t\t\tnegative = styles.BlurredButton.Render(c.negative)\n\t\t} else {\n\t\t\taffirmative = styles.BlurredButton.Render(c.affirmative)\n\t\t\tnegative = styles.FocusedButton.Render(c.negative)\n\t\t}\n\t\tc.keymap.Reject.SetHelp(\"n\", c.negative)\n\t} else {\n\t\taffirmative = styles.FocusedButton.Render(c.affirmative)\n\t\tc.keymap.Reject.SetEnabled(false)\n\t}\n\n\tc.keymap.Accept.SetHelp(\"y\", c.affirmative)\n\n\tbuttonsRow := lipgloss.JoinHorizontal(lipgloss.Center, affirmative, negative)\n\n\tpromptWidth := lipgloss.Width(sb.String())\n\tbuttonsWidth := lipgloss.Width(buttonsRow)\n\n\trenderWidth := promptWidth\n\tif buttonsWidth > renderWidth {\n\t\trenderWidth = buttonsWidth\n\t}\n\n\tstyle := lipgloss.NewStyle().Width(renderWidth).Align(lipgloss.Center)\n\n\tsb.WriteString(style.Render(buttonsRow))\n\treturn styles.Base.Render(sb.String())\n}\n\n// Run runs the confirm field in accessible mode.\nfunc (c *Confirm) Run() error {\n\tif c.accessible {\n\t\treturn c.runAccessible()\n\t}\n\treturn Run(c)\n}\n\n// runAccessible runs the confirm field in accessible mode.\nfunc (c *Confirm) runAccessible() error {\n\tstyles := c.activeStyles()\n\tfmt.Println(styles.Title.Render(c.title.val))\n\tfmt.Println()\n\tc.accessor.Set(accessibility.PromptBool())\n\tfmt.Println(styles.SelectedOption.Render(\"Chose: \"+c.String()) + \"\\n\")\n\treturn nil\n}\n\nfunc (c *Confirm) String() string {\n\tif c.accessor.Get() {\n\t\treturn c.affirmative\n\t}\n\treturn c.negative\n}\n\n// WithTheme sets the theme of the confirm field.\nfunc (c *Confirm) WithTheme(theme *Theme) Field {\n\tif c.theme != nil {\n\t\treturn c\n\t}\n\tc.theme = theme\n\treturn c\n}\n\n// WithKeyMap sets the keymap of the confirm field.\nfunc (c *Confirm) WithKeyMap(k *KeyMap) Field {\n\tc.keymap = k.Confirm\n\treturn c\n}\n\n// WithAccessible sets the accessible mode of the confirm field.\nfunc (c *Confirm) WithAccessible(accessible bool) Field {\n\tc.accessible = accessible\n\treturn c\n}\n\n// WithWidth sets the width of the confirm field.\nfunc (c *Confirm) WithWidth(width int) Field {\n\tc.width = width\n\treturn c\n}\n\n// WithHeight sets the height of the confirm field.\nfunc (c *Confirm) WithHeight(height int) Field {\n\tc.height = height\n\treturn c\n}\n\n// WithPosition sets the position of the confirm field.\nfunc (c *Confirm) WithPosition(p FieldPosition) Field {\n\tc.keymap.Prev.SetEnabled(!p.IsFirst())\n\tc.keymap.Next.SetEnabled(!p.IsLast())\n\tc.keymap.Submit.SetEnabled(p.IsLast())\n\treturn c\n}\n\n// GetKey returns the key of the field.\nfunc (c *Confirm) GetKey() string {\n\treturn c.key\n}\n\n// GetValue returns the value of the field.\nfunc (c *Confirm) GetValue() any {\n\treturn c.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_filepicker.go",
    "content": "package huh\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\txstrings \"github.com/charmbracelet/x/exp/strings\"\n\n\t\"github.com/charmbracelet/bubbles/filepicker\"\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// FilePicker is a form file file field.\ntype FilePicker struct {\n\taccessor Accessor[string]\n\tkey      string\n\tpicker   filepicker.Model\n\n\t// state\n\tfocused bool\n\tpicking bool\n\n\t// customization\n\ttitle       string\n\tdescription string\n\n\t// error handling\n\tvalidate func(string) error\n\terr      error\n\n\t// options\n\twidth      int\n\theight     int\n\taccessible bool\n\ttheme      *Theme\n\tkeymap     FilePickerKeyMap\n}\n\n// NewFilePicker returns a new file field.\nfunc NewFilePicker() *FilePicker {\n\tfp := filepicker.New()\n\tfp.ShowSize = false\n\tfp.AutoHeight = false\n\n\tif cmd := fp.Init(); cmd != nil {\n\t\tfp, _ = fp.Update(cmd())\n\t}\n\n\treturn &FilePicker{\n\t\taccessor: &EmbeddedAccessor[string]{},\n\t\tvalidate: func(string) error { return nil },\n\t\tpicker:   fp,\n\t}\n}\n\n// CurrentDirectory sets the directory of the file field.\nfunc (f *FilePicker) CurrentDirectory(directory string) *FilePicker {\n\tf.picker.CurrentDirectory = directory\n\tif cmd := f.picker.Init(); cmd != nil {\n\t\tf.picker, _ = f.picker.Update(cmd())\n\t}\n\treturn f\n}\n\n// Picking sets whether the file picker should be in the picking files state.\nfunc (f *FilePicker) Picking(v bool) *FilePicker {\n\tf.setPicking(v)\n\treturn f\n}\n\n// ShowHidden sets whether to show hidden files.\nfunc (f *FilePicker) ShowHidden(v bool) *FilePicker {\n\tf.picker.ShowHidden = v\n\treturn f\n}\n\n// ShowSize sets whether to show file sizes.\nfunc (f *FilePicker) ShowSize(v bool) *FilePicker {\n\tf.picker.ShowSize = v\n\treturn f\n}\n\n// ShowPermissions sets whether to show file permissions.\nfunc (f *FilePicker) ShowPermissions(v bool) *FilePicker {\n\tf.picker.ShowPermissions = v\n\treturn f\n}\n\n// FileAllowed sets whether to allow files to be selected.\nfunc (f *FilePicker) FileAllowed(v bool) *FilePicker {\n\tf.picker.FileAllowed = v\n\treturn f\n}\n\n// DirAllowed sets whether to allow files to be selected.\nfunc (f *FilePicker) DirAllowed(v bool) *FilePicker {\n\tf.picker.DirAllowed = v\n\treturn f\n}\n\n// Value sets the value of the file field.\nfunc (f *FilePicker) Value(value *string) *FilePicker {\n\treturn f.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the file field.\nfunc (f *FilePicker) Accessor(accessor Accessor[string]) *FilePicker {\n\tf.accessor = accessor\n\treturn f\n}\n\n// Key sets the key of the file field which can be used to retrieve the value\n// after submission.\nfunc (f *FilePicker) Key(key string) *FilePicker {\n\tf.key = key\n\treturn f\n}\n\n// Title sets the title of the file field.\nfunc (f *FilePicker) Title(title string) *FilePicker {\n\tf.title = title\n\treturn f\n}\n\n// Description sets the description of the file field.\nfunc (f *FilePicker) Description(description string) *FilePicker {\n\tf.description = description\n\treturn f\n}\n\n// AllowedTypes sets the allowed types of the file field. These will be the only\n// valid file types accepted, other files will show as disabled.\nfunc (f *FilePicker) AllowedTypes(types []string) *FilePicker {\n\tf.picker.AllowedTypes = types\n\treturn f\n}\n\n// Height sets the height of the file field. If the number of options\n// exceeds the height, the file field will become scrollable.\nfunc (f *FilePicker) Height(height int) *FilePicker {\n\tadjust := 0\n\tif f.title != \"\" {\n\t\tadjust++\n\t}\n\tif f.description != \"\" {\n\t\tadjust++\n\t}\n\tf.picker.Height = height - adjust\n\tf.picker.AutoHeight = false\n\treturn f\n}\n\n// Validate sets the validation function of the file field.\nfunc (f *FilePicker) Validate(validate func(string) error) *FilePicker {\n\tf.validate = validate\n\treturn f\n}\n\n// Error returns the error of the file field.\nfunc (f *FilePicker) Error() error {\n\treturn f.err\n}\n\n// Skip returns whether the file should be skipped or should be blocking.\nfunc (*FilePicker) Skip() bool {\n\treturn false\n}\n\n// Zoom returns whether the input should be zoomed.\nfunc (f *FilePicker) Zoom() bool {\n\treturn f.picking\n}\n\n// Focus focuses the file field.\nfunc (f *FilePicker) Focus() tea.Cmd {\n\tf.focused = true\n\treturn f.picker.Init()\n}\n\n// Blur blurs the file field.\nfunc (f *FilePicker) Blur() tea.Cmd {\n\tf.focused = false\n\tf.setPicking(false)\n\tf.err = f.validate(f.accessor.Get())\n\treturn nil\n}\n\n// KeyBinds returns the help keybindings for the file field.\nfunc (f *FilePicker) KeyBinds() []key.Binding {\n\treturn []key.Binding{f.keymap.Up, f.keymap.Down, f.keymap.Close, f.keymap.Open, f.keymap.Prev, f.keymap.Next, f.keymap.Submit}\n}\n\n// Init initializes the file field.\nfunc (f *FilePicker) Init() tea.Cmd {\n\treturn f.picker.Init()\n}\n\n// Update updates the file field.\nfunc (f *FilePicker) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tf.err = nil\n\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, f.keymap.Open):\n\t\t\tif f.picking {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tf.setPicking(true)\n\t\t\treturn f, f.picker.Init()\n\t\tcase key.Matches(msg, f.keymap.Close):\n\t\t\tf.setPicking(false)\n\t\t\treturn f, NextField\n\t\tcase key.Matches(msg, f.keymap.Next):\n\t\t\tf.setPicking(false)\n\t\t\treturn f, NextField\n\t\tcase key.Matches(msg, f.keymap.Prev):\n\t\t\tf.setPicking(false)\n\t\t\treturn f, PrevField\n\t\t}\n\t}\n\n\tvar cmd tea.Cmd\n\tf.picker, cmd = f.picker.Update(msg)\n\tdidSelect, file := f.picker.DidSelectFile(msg)\n\tif didSelect {\n\t\tf.accessor.Set(file)\n\t\tf.setPicking(false)\n\t\treturn f, NextField\n\t}\n\tdidSelect, _ = f.picker.DidSelectDisabledFile(msg)\n\tif didSelect {\n\t\tf.err = errors.New(xstrings.EnglishJoin(f.picker.AllowedTypes, true) + \" files only\")\n\t\treturn f, nil\n\t}\n\n\treturn f, cmd\n}\n\nfunc (f *FilePicker) activeStyles() *FieldStyles {\n\ttheme := f.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif f.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\n// View renders the file field.\nfunc (f *FilePicker) View() string {\n\tstyles := f.activeStyles()\n\n\tvar sb strings.Builder\n\tif f.title != \"\" {\n\t\tsb.WriteString(styles.Title.Render(f.title) + \"\\n\")\n\t}\n\tif f.description != \"\" {\n\t\tsb.WriteString(styles.Description.Render(f.description) + \"\\n\")\n\t}\n\tif f.picking {\n\t\tsb.WriteString(strings.TrimSuffix(f.picker.View(), \"\\n\"))\n\t} else {\n\t\tif f.accessor.Get() != \"\" {\n\t\t\tsb.WriteString(styles.SelectedOption.Render(f.accessor.Get()))\n\t\t} else {\n\t\t\tsb.WriteString(styles.TextInput.Placeholder.Render(\"No file selected.\"))\n\t\t}\n\t}\n\treturn styles.Base.Render(sb.String())\n}\n\nfunc (f *FilePicker) setPicking(v bool) {\n\tf.picking = v\n\n\tf.keymap.Close.SetEnabled(v)\n\tf.keymap.Up.SetEnabled(v)\n\tf.keymap.Down.SetEnabled(v)\n\tf.keymap.Select.SetEnabled(v)\n\tf.keymap.Back.SetEnabled(v)\n\n\tf.picker.KeyMap.Up.SetEnabled(v)\n\tf.picker.KeyMap.Down.SetEnabled(v)\n\tf.picker.KeyMap.Select.SetEnabled(v)\n\tf.picker.KeyMap.Open.SetEnabled(v)\n\tf.picker.KeyMap.Back.SetEnabled(v)\n}\n\n// Run runs the file field.\nfunc (f *FilePicker) Run() error {\n\tif f.accessible {\n\t\treturn f.runAccessible()\n\t}\n\treturn Run(f)\n}\n\n// runAccessible runs an accessible file field.\nfunc (f *FilePicker) runAccessible() error {\n\tstyles := f.activeStyles()\n\tfmt.Println(styles.Title.Render(f.title))\n\tfmt.Println()\n\n\tvalidateFile := func(s string) error {\n\t\t// is the string a file?\n\t\tif _, err := os.Open(s); err != nil {\n\t\t\treturn errors.New(\"not a file\")\n\t\t}\n\n\t\t// is it one of the allowed types?\n\t\tvalid := false\n\t\tfor _, ext := range f.picker.AllowedTypes {\n\t\t\tif strings.HasSuffix(s, ext) {\n\t\t\t\tvalid = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !valid {\n\t\t\treturn errors.New(\"cannot select: \" + s)\n\t\t}\n\n\t\t// does it pass user validation?\n\t\treturn f.validate(s)\n\t}\n\n\tf.accessor.Set(accessibility.PromptString(\"File: \", validateFile))\n\tfmt.Println(styles.SelectedOption.Render(f.accessor.Get() + \"\\n\"))\n\treturn nil\n}\n\n// WithTheme sets the theme of the file field.\nfunc (f *FilePicker) WithTheme(theme *Theme) Field {\n\tif f.theme != nil || theme == nil {\n\t\treturn f\n\t}\n\tf.theme = theme\n\n\t// XXX: add specific themes\n\tf.picker.Styles = filepicker.Styles{\n\t\tDisabledCursor:   lipgloss.Style{},\n\t\tCursor:           theme.Focused.TextInput.Prompt,\n\t\tSymlink:          lipgloss.NewStyle(),\n\t\tDirectory:        theme.Focused.Directory,\n\t\tFile:             theme.Focused.File,\n\t\tDisabledFile:     theme.Focused.TextInput.Placeholder,\n\t\tPermission:       theme.Focused.TextInput.Placeholder,\n\t\tSelected:         theme.Focused.SelectedOption,\n\t\tDisabledSelected: theme.Focused.TextInput.Placeholder,\n\t\tFileSize:         theme.Focused.TextInput.Placeholder,\n\t\tEmptyDirectory:   theme.Focused.TextInput.Placeholder.SetString(\"No files found.\"),\n\t}\n\n\treturn f\n}\n\n// WithKeyMap sets the keymap on a file field.\nfunc (f *FilePicker) WithKeyMap(k *KeyMap) Field {\n\tf.keymap = k.FilePicker\n\tf.picker.KeyMap = filepicker.KeyMap{\n\t\tGoToTop:  k.FilePicker.GoToTop,\n\t\tGoToLast: k.FilePicker.GoToLast,\n\t\tDown:     k.FilePicker.Down,\n\t\tUp:       k.FilePicker.Up,\n\t\tPageUp:   k.FilePicker.PageUp,\n\t\tPageDown: k.FilePicker.PageDown,\n\t\tBack:     k.FilePicker.Back,\n\t\tOpen:     k.FilePicker.Open,\n\t\tSelect:   k.FilePicker.Select,\n\t}\n\tf.setPicking(f.picking)\n\treturn f\n}\n\n// WithAccessible sets the accessible mode of the file field.\nfunc (f *FilePicker) WithAccessible(accessible bool) Field {\n\tf.accessible = accessible\n\treturn f\n}\n\n// WithWidth sets the width of the file field.\nfunc (f *FilePicker) WithWidth(width int) Field {\n\tf.width = width\n\treturn f\n}\n\n// WithHeight sets the height of the file field.\nfunc (f *FilePicker) WithHeight(height int) Field {\n\tf.height = height\n\tf.Height(height)\n\tf.picker, _ = f.picker.Update(nil)\n\treturn f\n}\n\n// WithPosition sets the position of the file field.\nfunc (f *FilePicker) WithPosition(p FieldPosition) Field {\n\tf.keymap.Prev.SetEnabled(!p.IsFirst())\n\tf.keymap.Next.SetEnabled(!p.IsLast())\n\tf.keymap.Submit.SetEnabled(p.IsLast())\n\treturn f\n}\n\n// GetKey returns the key of the field.\nfunc (f *FilePicker) GetKey() string {\n\treturn f.key\n}\n\n// GetValue returns the value of the field.\nfunc (f *FilePicker) GetValue() any {\n\treturn f.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_input.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/textinput\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Input is a input field.\n//\n// The input field is a field that allows the user to enter text. Use it to user\n// input. It can be used for collecting text, passwords, or other short input.\n//\n// The input field supports Suggestions, Placeholder, and Validation.\ntype Input struct {\n\taccessor Accessor[string]\n\tkey      string\n\tid       int\n\n\ttitle       Eval[string]\n\tdescription Eval[string]\n\tplaceholder Eval[string]\n\tsuggestions Eval[[]string]\n\n\ttextinput textinput.Model\n\n\tinline   bool\n\tvalidate func(string) error\n\terr      error\n\tfocused  bool\n\n\taccessible bool\n\twidth      int\n\theight     int // not really used anywhere\n\n\ttheme  *Theme\n\tkeymap InputKeyMap\n}\n\n// NewInput creates a new input field.\n//\n// The input field is a field that allows the user to enter text. Use it to user\n// input. It can be used for collecting text, passwords, or other short input.\n//\n// The input field supports Suggestions, Placeholder, and Validation.\nfunc NewInput() *Input {\n\tinput := textinput.New()\n\n\ti := &Input{\n\t\taccessor:    &EmbeddedAccessor[string]{},\n\t\ttextinput:   input,\n\t\tvalidate:    func(string) error { return nil },\n\t\tid:          nextID(),\n\t\ttitle:       Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription: Eval[string]{cache: make(map[uint64]string)},\n\t\tplaceholder: Eval[string]{cache: make(map[uint64]string)},\n\t\tsuggestions: Eval[[]string]{cache: make(map[uint64][]string)},\n\t}\n\n\treturn i\n}\n\n// Value sets the value of the input field.\nfunc (i *Input) Value(value *string) *Input {\n\treturn i.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the input field.\nfunc (i *Input) Accessor(accessor Accessor[string]) *Input {\n\ti.accessor = accessor\n\ti.textinput.SetValue(i.accessor.Get())\n\treturn i\n}\n\n// Key sets the key of the input field.\nfunc (i *Input) Key(key string) *Input {\n\ti.key = key\n\treturn i\n}\n\n// Title sets the title of the input field.\n//\n// The Title is static for dynamic Title use `TitleFunc`.\nfunc (i *Input) Title(title string) *Input {\n\ti.title.val = title\n\ti.title.fn = nil\n\treturn i\n}\n\n// Description sets the description of the input field.\n//\n// The Description is static for dynamic Description use `DescriptionFunc`.\nfunc (i *Input) Description(description string) *Input {\n\ti.description.val = description\n\ti.description.fn = nil\n\treturn i\n}\n\n// TitleFunc sets the title func of the input field.\n//\n// The TitleFunc will be re-evaluated when the binding of the TitleFunc changes.\n// This is useful when you want to display dynamic content and update the title\n// when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (i *Input) TitleFunc(f func() string, bindings any) *Input {\n\ti.title.fn = f\n\ti.title.bindings = bindings\n\treturn i\n}\n\n// DescriptionFunc sets the description func of the input field.\n//\n// The DescriptionFunc will be re-evaluated when the binding of the\n// DescriptionFunc changes. This is useful when you want to display dynamic\n// content and update the description when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (i *Input) DescriptionFunc(f func() string, bindings any) *Input {\n\ti.description.fn = f\n\ti.description.bindings = bindings\n\treturn i\n}\n\n// Prompt sets the prompt of the input field.\nfunc (i *Input) Prompt(prompt string) *Input {\n\ti.textinput.Prompt = prompt\n\treturn i\n}\n\n// CharLimit sets the character limit of the input field.\nfunc (i *Input) CharLimit(charlimit int) *Input {\n\ti.textinput.CharLimit = charlimit\n\treturn i\n}\n\n// Suggestions sets the suggestions to display for autocomplete in the input\n// field.\n//\n// The suggestions are static for dynamic suggestions use `SuggestionsFunc`.\nfunc (i *Input) Suggestions(suggestions []string) *Input {\n\ti.suggestions.fn = nil\n\n\ti.textinput.ShowSuggestions = len(suggestions) > 0\n\ti.textinput.KeyMap.AcceptSuggestion.SetEnabled(len(suggestions) > 0)\n\ti.textinput.SetSuggestions(suggestions)\n\treturn i\n}\n\n// SuggestionsFunc sets the suggestions func to display for autocomplete in the\n// input field.\n//\n// The SuggestionsFunc will be re-evaluated when the binding of the\n// SuggestionsFunc changes. This is useful when you want to display dynamic\n// suggestions when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (i *Input) SuggestionsFunc(f func() []string, bindings any) *Input {\n\ti.suggestions.fn = f\n\ti.suggestions.bindings = bindings\n\ti.suggestions.loading = true\n\n\ti.textinput.KeyMap.AcceptSuggestion.SetEnabled(f != nil)\n\ti.textinput.ShowSuggestions = f != nil\n\treturn i\n}\n\n// EchoMode sets the input behavior of the text Input field.\ntype EchoMode textinput.EchoMode\n\nconst (\n\t// EchoNormal displays text as is.\n\t// This is the default behavior.\n\tEchoModeNormal EchoMode = EchoMode(textinput.EchoNormal)\n\n\t// EchoPassword displays the EchoCharacter mask instead of actual characters.\n\t// This is commonly used for password fields.\n\tEchoModePassword EchoMode = EchoMode(textinput.EchoPassword)\n\n\t// EchoNone displays nothing as characters are entered.\n\t// This is commonly seen for password fields on the command line.\n\tEchoModeNone EchoMode = EchoMode(textinput.EchoNone)\n)\n\n// EchoMode sets the echo mode of the input.\nfunc (i *Input) EchoMode(mode EchoMode) *Input {\n\ti.textinput.EchoMode = textinput.EchoMode(mode)\n\treturn i\n}\n\n// Password sets whether or not to hide the input while the user is typing.\n//\n// Deprecated: use EchoMode(EchoPassword) instead.\nfunc (i *Input) Password(password bool) *Input {\n\tif password {\n\t\ti.textinput.EchoMode = textinput.EchoPassword\n\t} else {\n\t\ti.textinput.EchoMode = textinput.EchoNormal\n\t}\n\treturn i\n}\n\n// Placeholder sets the placeholder of the text input.\nfunc (i *Input) Placeholder(str string) *Input {\n\ti.textinput.Placeholder = str\n\treturn i\n}\n\n// PlaceholderFunc sets the placeholder func of the text input.\nfunc (i *Input) PlaceholderFunc(f func() string, bindings any) *Input {\n\ti.placeholder.fn = f\n\ti.placeholder.bindings = bindings\n\treturn i\n}\n\n// Inline sets whether the title and input should be on the same line.\nfunc (i *Input) Inline(inline bool) *Input {\n\ti.inline = inline\n\treturn i\n}\n\n// Validate sets the validation function of the input field.\nfunc (i *Input) Validate(validate func(string) error) *Input {\n\ti.validate = validate\n\treturn i\n}\n\n// Error returns the error of the input field.\nfunc (i *Input) Error() error { return i.err }\n\n// Skip returns whether the input should be skipped or should be blocking.\nfunc (*Input) Skip() bool { return false }\n\n// Zoom returns whether the input should be zoomed.\nfunc (*Input) Zoom() bool { return false }\n\n// Focus focuses the input field.\nfunc (i *Input) Focus() tea.Cmd {\n\ti.focused = true\n\treturn i.textinput.Focus()\n}\n\n// Blur blurs the input field.\nfunc (i *Input) Blur() tea.Cmd {\n\ti.focused = false\n\ti.accessor.Set(i.textinput.Value())\n\ti.textinput.Blur()\n\ti.err = i.validate(i.accessor.Get())\n\treturn nil\n}\n\n// KeyBinds returns the help message for the input field.\nfunc (i *Input) KeyBinds() []key.Binding {\n\tif i.textinput.ShowSuggestions {\n\t\treturn []key.Binding{i.keymap.AcceptSuggestion, i.keymap.Prev, i.keymap.Submit, i.keymap.Next}\n\t}\n\treturn []key.Binding{i.keymap.Prev, i.keymap.Submit, i.keymap.Next}\n}\n\n// Init initializes the input field.\nfunc (i *Input) Init() tea.Cmd {\n\ti.textinput.Blur()\n\treturn nil\n}\n\n// Update updates the input field.\nfunc (i *Input) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tvar cmds []tea.Cmd\n\tvar cmd tea.Cmd\n\n\tswitch msg := msg.(type) {\n\tcase updateFieldMsg:\n\t\tvar cmds []tea.Cmd\n\t\tif ok, hash := i.title.shouldUpdate(); ok {\n\t\t\ti.title.bindingsHash = hash\n\t\t\tif !i.title.loadFromCache() {\n\t\t\t\ti.title.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: i.id, title: i.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := i.description.shouldUpdate(); ok {\n\t\t\ti.description.bindingsHash = hash\n\t\t\tif !i.description.loadFromCache() {\n\t\t\t\ti.description.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: i.id, description: i.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := i.placeholder.shouldUpdate(); ok {\n\t\t\ti.placeholder.bindingsHash = hash\n\t\t\tif i.placeholder.loadFromCache() {\n\t\t\t\ti.textinput.Placeholder = i.placeholder.val\n\t\t\t} else {\n\t\t\t\ti.placeholder.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updatePlaceholderMsg{id: i.id, placeholder: i.placeholder.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := i.suggestions.shouldUpdate(); ok {\n\t\t\ti.suggestions.bindingsHash = hash\n\t\t\tif i.suggestions.loadFromCache() {\n\t\t\t\ti.textinput.ShowSuggestions = len(i.suggestions.val) > 0\n\t\t\t\ti.textinput.SetSuggestions(i.suggestions.val)\n\t\t\t} else {\n\t\t\t\ti.suggestions.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateSuggestionsMsg{id: i.id, suggestions: i.suggestions.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn i, tea.Batch(cmds...)\n\tcase updateTitleMsg:\n\t\tif i.id == msg.id && i.title.bindingsHash == msg.hash {\n\t\t\ti.title.update(msg.title)\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif i.id == msg.id && i.description.bindingsHash == msg.hash {\n\t\t\ti.description.update(msg.description)\n\t\t}\n\tcase updatePlaceholderMsg:\n\t\tif i.id == msg.id && i.placeholder.bindingsHash == msg.hash {\n\t\t\ti.placeholder.update(msg.placeholder)\n\t\t\ti.textinput.Placeholder = msg.placeholder\n\t\t}\n\tcase updateSuggestionsMsg:\n\t\tif i.id == msg.id && i.suggestions.bindingsHash == msg.hash {\n\t\t\ti.suggestions.update(msg.suggestions)\n\t\t\ti.textinput.ShowSuggestions = len(msg.suggestions) > 0\n\t\t\ti.textinput.SetSuggestions(msg.suggestions)\n\t\t}\n\tcase tea.KeyMsg:\n\t\ti.err = nil\n\n\t\tswitch {\n\t\tcase key.Matches(msg, i.keymap.Prev):\n\t\t\tvalue := i.textinput.Value()\n\t\t\ti.err = i.validate(value)\n\t\t\tif i.err != nil {\n\t\t\t\treturn i, nil\n\t\t\t}\n\t\t\tcmds = append(cmds, PrevField)\n\t\tcase key.Matches(msg, i.keymap.Next, i.keymap.Submit):\n\t\t\tvalue := i.textinput.Value()\n\t\t\ti.err = i.validate(value)\n\t\t\tif i.err != nil {\n\t\t\t\treturn i, nil\n\t\t\t}\n\t\t\tcmds = append(cmds, NextField)\n\t\t}\n\t}\n\n\ti.textinput, cmd = i.textinput.Update(msg)\n\tcmds = append(cmds, cmd)\n\ti.accessor.Set(i.textinput.Value())\n\n\treturn i, tea.Batch(cmds...)\n}\n\nfunc (i *Input) activeStyles() *FieldStyles {\n\ttheme := i.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif i.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\n// View renders the input field.\nfunc (i *Input) View() string {\n\tstyles := i.activeStyles()\n\n\t// NB: since the method is on a pointer receiver these are being mutated.\n\t// Because this runs on every render this shouldn't matter in practice,\n\t// however.\n\ti.textinput.PlaceholderStyle = styles.TextInput.Placeholder\n\ti.textinput.PromptStyle = styles.TextInput.Prompt\n\ti.textinput.Cursor.Style = styles.TextInput.Cursor\n\ti.textinput.Cursor.TextStyle = styles.TextInput.CursorText\n\ti.textinput.TextStyle = styles.TextInput.Text\n\n\t// Adjust text input size to its char limit if it fit in its width\n\tif i.textinput.CharLimit > 0 {\n\t\ti.textinput.Width = min(i.textinput.CharLimit, i.textinput.Width)\n\t}\n\n\tvar sb strings.Builder\n\tif i.title.val != \"\" || i.title.fn != nil {\n\t\tsb.WriteString(styles.Title.Render(i.title.val))\n\t\tif !i.inline {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\tif i.description.val != \"\" || i.description.fn != nil {\n\t\tsb.WriteString(styles.Description.Render(i.description.val))\n\t\tif !i.inline {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\tsb.WriteString(i.textinput.View())\n\n\treturn styles.Base.Render(sb.String())\n}\n\n// Run runs the input field in accessible mode.\nfunc (i *Input) Run() error {\n\tif i.accessible {\n\t\treturn i.runAccessible()\n\t}\n\treturn i.run()\n}\n\n// run runs the input field.\nfunc (i *Input) run() error {\n\treturn Run(i)\n}\n\n// runAccessible runs the input field in accessible mode.\nfunc (i *Input) runAccessible() error {\n\tstyles := i.activeStyles()\n\tfmt.Println(styles.Title.Render(i.title.val))\n\tfmt.Println()\n\ti.accessor.Set(accessibility.PromptString(\"Input: \", i.validate))\n\tfmt.Println(styles.SelectedOption.Render(\"Input: \" + i.accessor.Get() + \"\\n\"))\n\treturn nil\n}\n\n// WithKeyMap sets the keymap on an input field.\nfunc (i *Input) WithKeyMap(k *KeyMap) Field {\n\ti.keymap = k.Input\n\ti.textinput.KeyMap.AcceptSuggestion = i.keymap.AcceptSuggestion\n\treturn i\n}\n\n// WithAccessible sets the accessible mode of the input field.\nfunc (i *Input) WithAccessible(accessible bool) Field {\n\ti.accessible = accessible\n\treturn i\n}\n\n// WithTheme sets the theme of the input field.\nfunc (i *Input) WithTheme(theme *Theme) Field {\n\tif i.theme != nil {\n\t\treturn i\n\t}\n\ti.theme = theme\n\treturn i\n}\n\n// WithWidth sets the width of the input field.\nfunc (i *Input) WithWidth(width int) Field {\n\tstyles := i.activeStyles()\n\ti.width = width\n\tframeSize := styles.Base.GetHorizontalFrameSize()\n\tpromptWidth := lipgloss.Width(i.textinput.PromptStyle.Render(i.textinput.Prompt))\n\ttitleWidth := lipgloss.Width(styles.Title.Render(i.title.val))\n\tdescriptionWidth := lipgloss.Width(styles.Description.Render(i.description.val))\n\ti.textinput.Width = width - frameSize - promptWidth - 1\n\tif i.inline {\n\t\ti.textinput.Width -= titleWidth\n\t\ti.textinput.Width -= descriptionWidth\n\t}\n\treturn i\n}\n\n// WithHeight sets the height of the input field.\nfunc (i *Input) WithHeight(height int) Field {\n\ti.height = height\n\treturn i\n}\n\n// WithPosition sets the position of the input field.\nfunc (i *Input) WithPosition(p FieldPosition) Field {\n\ti.keymap.Prev.SetEnabled(!p.IsFirst())\n\ti.keymap.Next.SetEnabled(!p.IsLast())\n\ti.keymap.Submit.SetEnabled(p.IsLast())\n\treturn i\n}\n\n// GetKey returns the key of the field.\nfunc (i *Input) GetKey() string { return i.key }\n\n// GetValue returns the value of the field.\nfunc (i *Input) GetValue() any {\n\treturn i.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_multiselect.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/spinner\"\n\t\"github.com/charmbracelet/bubbles/textinput\"\n\t\"github.com/charmbracelet/bubbles/viewport\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// MultiSelect is a form multi-select field.\ntype MultiSelect[T comparable] struct {\n\taccessor Accessor[[]T]\n\tkey      string\n\tid       int\n\n\t// customization\n\ttitle           Eval[string]\n\tdescription     Eval[string]\n\toptions         Eval[[]Option[T]]\n\tfilterable      bool\n\tfilteredOptions []Option[T]\n\tlimit           int\n\theight          int\n\n\t// error handling\n\tvalidate func([]T) error\n\terr      error\n\n\t// state\n\tcursor    int\n\tfocused   bool\n\tfiltering bool\n\tfilter    textinput.Model\n\tviewport  viewport.Model\n\tspinner   spinner.Model\n\n\t// options\n\twidth      int\n\taccessible bool\n\ttheme      *Theme\n\tkeymap     MultiSelectKeyMap\n}\n\n// NewMultiSelect returns a new multi-select field.\nfunc NewMultiSelect[T comparable]() *MultiSelect[T] {\n\tfilter := textinput.New()\n\tfilter.Prompt = \"/\"\n\n\ts := spinner.New(spinner.WithSpinner(spinner.Line))\n\n\treturn &MultiSelect[T]{\n\t\taccessor:    &EmbeddedAccessor[[]T]{},\n\t\tvalidate:    func([]T) error { return nil },\n\t\tfiltering:   false,\n\t\tfilter:      filter,\n\t\tid:          nextID(),\n\t\toptions:     Eval[[]Option[T]]{cache: make(map[uint64][]Option[T])},\n\t\ttitle:       Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription: Eval[string]{cache: make(map[uint64]string)},\n\t\tspinner:     s,\n\t\tfilterable:  true,\n\t}\n}\n\n// Value sets the value of the multi-select field.\nfunc (m *MultiSelect[T]) Value(value *[]T) *MultiSelect[T] {\n\treturn m.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the input field.\nfunc (m *MultiSelect[T]) Accessor(accessor Accessor[[]T]) *MultiSelect[T] {\n\tm.accessor = accessor\n\tfor i, o := range m.options.val {\n\t\tfor _, v := range m.accessor.Get() {\n\t\t\tif o.Value == v {\n\t\t\t\tm.options.val[i].selected = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn m\n}\n\n// Key sets the key of the select field which can be used to retrieve the value\n// after submission.\nfunc (m *MultiSelect[T]) Key(key string) *MultiSelect[T] {\n\tm.key = key\n\treturn m\n}\n\n// Title sets the title of the multi-select field.\nfunc (m *MultiSelect[T]) Title(title string) *MultiSelect[T] {\n\tm.title.val = title\n\tm.title.fn = nil\n\treturn m\n}\n\n// TitleFunc sets the title func of the multi-select field.\nfunc (m *MultiSelect[T]) TitleFunc(f func() string, bindings any) *MultiSelect[T] {\n\tm.title.fn = f\n\tm.title.bindings = bindings\n\treturn m\n}\n\n// Description sets the description of the multi-select field.\nfunc (m *MultiSelect[T]) Description(description string) *MultiSelect[T] {\n\tm.description.val = description\n\treturn m\n}\n\n// DescriptionFunc sets the description func of the multi-select field.\nfunc (m *MultiSelect[T]) DescriptionFunc(f func() string, bindings any) *MultiSelect[T] {\n\tm.description.fn = f\n\tm.description.bindings = bindings\n\treturn m\n}\n\n// Options sets the options of the multi-select field.\nfunc (m *MultiSelect[T]) Options(options ...Option[T]) *MultiSelect[T] {\n\tif len(options) <= 0 {\n\t\treturn m\n\t}\n\n\tfor i, o := range options {\n\t\tfor _, v := range m.accessor.Get() {\n\t\t\tif o.Value == v {\n\t\t\t\toptions[i].selected = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tm.options.val = options\n\tm.filteredOptions = options\n\tm.updateViewportHeight()\n\treturn m\n}\n\n// OptionsFunc sets the options func of the multi-select field.\nfunc (m *MultiSelect[T]) OptionsFunc(f func() []Option[T], bindings any) *MultiSelect[T] {\n\tm.options.fn = f\n\tm.options.bindings = bindings\n\tm.filteredOptions = make([]Option[T], 0)\n\t// If there is no height set, we should attach a static height since these\n\t// options are possibly dynamic.\n\tif m.height <= 0 {\n\t\tm.height = defaultHeight\n\t\tm.updateViewportHeight()\n\t}\n\treturn m\n}\n\n// Filterable sets the multi-select field as filterable.\nfunc (m *MultiSelect[T]) Filterable(filterable bool) *MultiSelect[T] {\n\tm.filterable = filterable\n\treturn m\n}\n\n// Filtering sets the filtering state of the multi-select field.\nfunc (m *MultiSelect[T]) Filtering(filtering bool) *MultiSelect[T] {\n\tm.filtering = filtering\n\tm.filter.Focus()\n\treturn m\n}\n\n// Limit sets the limit of the multi-select field.\nfunc (m *MultiSelect[T]) Limit(limit int) *MultiSelect[T] {\n\tm.limit = limit\n\tm.setSelectAllHelp()\n\treturn m\n}\n\n// Height sets the height of the multi-select field.\nfunc (m *MultiSelect[T]) Height(height int) *MultiSelect[T] {\n\t// What we really want to do is set the height of the viewport, but we\n\t// need a theme applied before we can calcualate its height.\n\tm.height = height\n\tm.updateViewportHeight()\n\treturn m\n}\n\n// Validate sets the validation function of the multi-select field.\nfunc (m *MultiSelect[T]) Validate(validate func([]T) error) *MultiSelect[T] {\n\tm.validate = validate\n\treturn m\n}\n\n// Error returns the error of the multi-select field.\nfunc (m *MultiSelect[T]) Error() error {\n\treturn m.err\n}\n\n// Skip returns whether the multiselect should be skipped or should be blocking.\nfunc (*MultiSelect[T]) Skip() bool {\n\treturn false\n}\n\n// Zoom returns whether the multiselect should be zoomed.\nfunc (*MultiSelect[T]) Zoom() bool {\n\treturn false\n}\n\n// Focus focuses the multi-select field.\nfunc (m *MultiSelect[T]) Focus() tea.Cmd {\n\tm.updateValue()\n\tm.focused = true\n\treturn nil\n}\n\n// Blur blurs the multi-select field.\nfunc (m *MultiSelect[T]) Blur() tea.Cmd {\n\tm.updateValue()\n\tm.focused = false\n\treturn nil\n}\n\n// KeyBinds returns the help message for the multi-select field.\nfunc (m *MultiSelect[T]) KeyBinds() []key.Binding {\n\tbinds := []key.Binding{\n\t\tm.keymap.Toggle,\n\t\tm.keymap.Up,\n\t\tm.keymap.Down,\n\t}\n\tif m.filterable {\n\t\tbinds = append(\n\t\t\tbinds,\n\t\t\tm.keymap.Filter,\n\t\t\tm.keymap.SetFilter,\n\t\t\tm.keymap.ClearFilter,\n\t\t)\n\t}\n\tbinds = append(\n\t\tbinds,\n\t\tm.keymap.Prev,\n\t\tm.keymap.Submit,\n\t\tm.keymap.Next,\n\t\tm.keymap.SelectAll,\n\t\tm.keymap.SelectNone,\n\t)\n\treturn binds\n}\n\n// Init initializes the multi-select field.\nfunc (m *MultiSelect[T]) Init() tea.Cmd {\n\treturn nil\n}\n\n// Update updates the multi-select field.\nfunc (m *MultiSelect[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tvar cmds []tea.Cmd\n\n\t// Enforce height on the viewport during update as we need themes to\n\t// be applied before we can calculate the height.\n\tm.updateViewportHeight()\n\n\tvar cmd tea.Cmd\n\tif m.filtering {\n\t\tm.filter, cmd = m.filter.Update(msg)\n\t\tm.setSelectAllHelp()\n\t\tcmds = append(cmds, cmd)\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase updateFieldMsg:\n\t\tvar fieldCmds []tea.Cmd\n\t\tif ok, hash := m.title.shouldUpdate(); ok {\n\t\t\tm.title.bindingsHash = hash\n\t\t\tif !m.title.loadFromCache() {\n\t\t\t\tm.title.loading = true\n\t\t\t\tfieldCmds = append(fieldCmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: m.id, title: m.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := m.description.shouldUpdate(); ok {\n\t\t\tm.description.bindingsHash = hash\n\t\t\tif !m.description.loadFromCache() {\n\t\t\t\tm.description.loading = true\n\t\t\t\tfieldCmds = append(fieldCmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: m.id, description: m.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := m.options.shouldUpdate(); ok {\n\t\t\tm.options.bindingsHash = hash\n\t\t\tif m.options.loadFromCache() {\n\t\t\t\tm.filteredOptions = m.options.val\n\t\t\t\tm.updateValue()\n\t\t\t\tm.cursor = clamp(m.cursor, 0, len(m.filteredOptions)-1)\n\t\t\t} else {\n\t\t\t\tm.options.loading = true\n\t\t\t\tm.options.loadingStart = time.Now()\n\t\t\t\tfieldCmds = append(fieldCmds, func() tea.Msg {\n\t\t\t\t\treturn updateOptionsMsg[T]{id: m.id, options: m.options.fn(), hash: hash}\n\t\t\t\t}, m.spinner.Tick)\n\t\t\t}\n\t\t}\n\n\t\treturn m, tea.Batch(fieldCmds...)\n\n\tcase spinner.TickMsg:\n\t\tif !m.options.loading {\n\t\t\tbreak\n\t\t}\n\t\tm.spinner, cmd = m.spinner.Update(msg)\n\t\treturn m, cmd\n\n\tcase updateTitleMsg:\n\t\tif msg.id == m.id && msg.hash == m.title.bindingsHash {\n\t\t\tm.title.update(msg.title)\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif msg.id == m.id && msg.hash == m.description.bindingsHash {\n\t\t\tm.description.update(msg.description)\n\t\t}\n\tcase updateOptionsMsg[T]:\n\t\tif msg.id == m.id && msg.hash == m.options.bindingsHash {\n\t\t\tm.options.update(msg.options)\n\t\t\t// since we're updating the options, we need to reset the cursor.\n\t\t\tm.filteredOptions = m.options.val\n\t\t\tm.updateValue()\n\t\t\tm.cursor = clamp(m.cursor, 0, len(m.filteredOptions)-1)\n\t\t}\n\tcase tea.KeyMsg:\n\t\tm.err = nil\n\t\tswitch {\n\t\tcase key.Matches(msg, m.keymap.Filter):\n\t\t\tm.setFilter(true)\n\t\t\treturn m, m.filter.Focus()\n\t\tcase key.Matches(msg, m.keymap.SetFilter):\n\t\t\tif len(m.filteredOptions) <= 0 {\n\t\t\t\tm.filter.SetValue(\"\")\n\t\t\t\tm.filteredOptions = m.options.val\n\t\t\t}\n\t\t\tm.setFilter(false)\n\t\tcase key.Matches(msg, m.keymap.ClearFilter):\n\t\t\tm.filter.SetValue(\"\")\n\t\t\tm.filteredOptions = m.options.val\n\t\t\tm.setFilter(false)\n\t\tcase key.Matches(msg, m.keymap.Up):\n\t\t\t// FIXME: should use keys in keymap\n\t\t\tif m.filtering && msg.String() == \"k\" {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tm.cursor = max(m.cursor-1, 0)\n\t\t\tif m.cursor < m.viewport.YOffset {\n\t\t\t\tm.viewport.SetYOffset(m.cursor)\n\t\t\t}\n\t\tcase key.Matches(msg, m.keymap.Down):\n\t\t\t// FIXME: should use keys in keymap\n\t\t\tif m.filtering && msg.String() == \"j\" {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tm.cursor = min(m.cursor+1, len(m.filteredOptions)-1)\n\t\t\tif m.cursor >= m.viewport.YOffset+m.viewport.Height {\n\t\t\t\tm.viewport.LineDown(1)\n\t\t\t}\n\t\tcase key.Matches(msg, m.keymap.GotoTop):\n\t\t\tif m.filtering {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.cursor = 0\n\t\t\tm.viewport.GotoTop()\n\t\tcase key.Matches(msg, m.keymap.GotoBottom):\n\t\t\tif m.filtering {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm.cursor = len(m.filteredOptions) - 1\n\t\t\tm.viewport.GotoBottom()\n\t\tcase key.Matches(msg, m.keymap.HalfPageUp):\n\t\t\tm.cursor = max(m.cursor-m.viewport.Height/2, 0)\n\t\t\tm.viewport.HalfViewUp()\n\t\tcase key.Matches(msg, m.keymap.HalfPageDown):\n\t\t\tm.cursor = min(m.cursor+m.viewport.Height/2, len(m.filteredOptions)-1)\n\t\t\tm.viewport.HalfViewDown()\n\t\tcase key.Matches(msg, m.keymap.Toggle) && !m.filtering:\n\t\t\tfor i, option := range m.options.val {\n\t\t\t\tif option.Key == m.filteredOptions[m.cursor].Key {\n\t\t\t\t\tif !m.options.val[m.cursor].selected && m.limit > 0 && m.numSelected() >= m.limit {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tselected := m.options.val[i].selected\n\t\t\t\t\tm.options.val[i].selected = !selected\n\t\t\t\t\tm.filteredOptions[m.cursor].selected = !selected\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.setSelectAllHelp()\n\t\t\tm.updateValue()\n\t\tcase key.Matches(msg, m.keymap.SelectAll, m.keymap.SelectNone) && m.limit <= 0:\n\t\t\tselected := false\n\n\t\t\tfor _, option := range m.filteredOptions {\n\t\t\t\tif !option.selected {\n\t\t\t\t\tselected = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor i, option := range m.options.val {\n\t\t\t\tfor j := range m.filteredOptions {\n\t\t\t\t\tif option.Key == m.filteredOptions[j].Key {\n\t\t\t\t\t\tm.options.val[i].selected = selected\n\t\t\t\t\t\tm.filteredOptions[j].selected = selected\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.setSelectAllHelp()\n\t\t\tm.updateValue()\n\t\tcase key.Matches(msg, m.keymap.Prev):\n\t\t\tm.updateValue()\n\t\t\tm.err = m.validate(m.accessor.Get())\n\t\t\tif m.err != nil {\n\t\t\t\treturn m, nil\n\t\t\t}\n\t\t\treturn m, PrevField\n\t\tcase key.Matches(msg, m.keymap.Next, m.keymap.Submit):\n\t\t\tm.updateValue()\n\t\t\tm.err = m.validate(m.accessor.Get())\n\t\t\tif m.err != nil {\n\t\t\t\treturn m, nil\n\t\t\t}\n\t\t\treturn m, NextField\n\t\t}\n\n\t\tif m.filtering {\n\t\t\tm.filteredOptions = m.options.val\n\t\t\tif m.filter.Value() != \"\" {\n\t\t\t\tm.filteredOptions = nil\n\t\t\t\tfor _, option := range m.options.val {\n\t\t\t\t\tif m.filterFunc(option.Key) {\n\t\t\t\t\t\tm.filteredOptions = append(m.filteredOptions, option)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(m.filteredOptions) > 0 {\n\t\t\t\tm.cursor = min(m.cursor, len(m.filteredOptions)-1)\n\t\t\t\tm.viewport.SetYOffset(clamp(m.cursor, 0, len(m.filteredOptions)-m.viewport.Height))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn m, tea.Batch(cmds...)\n}\n\n// updateViewportHeight updates the viewport size according to the Height setting\n// on this multi-select field.\nfunc (m *MultiSelect[T]) updateViewportHeight() {\n\t// If no height is set size the viewport to the number of options.\n\tif m.height <= 0 {\n\t\tm.viewport.Height = len(m.options.val)\n\t\treturn\n\t}\n\n\tconst minHeight = 1\n\tm.viewport.Height = max(minHeight, m.height-\n\t\tlipgloss.Height(m.titleView())-\n\t\tlipgloss.Height(m.descriptionView()))\n}\n\n// numSelected returns the total number of selected options.\nfunc (m *MultiSelect[T]) numSelected() int {\n\tvar count int\n\tfor _, o := range m.options.val {\n\t\tif o.selected {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\n// numFilteredOptionsSelected returns the number of selected options with the\n// current filter applied.\nfunc (m *MultiSelect[T]) numFilteredSelected() int {\n\tvar count int\n\tfor _, o := range m.filteredOptions {\n\t\tif o.selected {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc (m *MultiSelect[T]) updateValue() {\n\tvalue := make([]T, 0)\n\tfor _, option := range m.options.val {\n\t\tif option.selected {\n\t\t\tvalue = append(value, option.Value)\n\t\t}\n\t}\n\tm.accessor.Set(value)\n\tm.err = m.validate(m.accessor.Get())\n}\n\nfunc (m *MultiSelect[T]) activeStyles() *FieldStyles {\n\ttheme := m.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif m.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\nfunc (m *MultiSelect[T]) titleView() string {\n\tif m.title.val == \"\" {\n\t\treturn \"\"\n\t}\n\tvar (\n\t\tstyles = m.activeStyles()\n\t\tsb     = strings.Builder{}\n\t)\n\tif m.filtering {\n\t\tsb.WriteString(m.filter.View())\n\t} else if m.filter.Value() != \"\" {\n\t\tsb.WriteString(styles.Title.Render(m.title.val) + styles.Description.Render(\"/\"+m.filter.Value()))\n\t} else {\n\t\tsb.WriteString(styles.Title.Render(m.title.val))\n\t}\n\tif m.err != nil {\n\t\tsb.WriteString(styles.ErrorIndicator.String())\n\t}\n\treturn sb.String()\n}\n\nfunc (m *MultiSelect[T]) descriptionView() string {\n\treturn m.activeStyles().Description.Render(m.description.val)\n}\n\nfunc (m *MultiSelect[T]) optionsView() string {\n\tvar (\n\t\tstyles = m.activeStyles()\n\t\tc      = styles.MultiSelectSelector.String()\n\t\tsb     strings.Builder\n\t)\n\n\tif m.options.loading && time.Since(m.options.loadingStart) > spinnerShowThreshold {\n\t\tm.spinner.Style = m.activeStyles().MultiSelectSelector.UnsetString()\n\t\tsb.WriteString(m.spinner.View() + \" Loading...\")\n\t\treturn sb.String()\n\t}\n\n\tfor i, option := range m.filteredOptions {\n\t\tif m.cursor == i {\n\t\t\tsb.WriteString(c)\n\t\t} else {\n\t\t\tsb.WriteString(strings.Repeat(\" \", lipgloss.Width(c)))\n\t\t}\n\n\t\tif m.filteredOptions[i].selected {\n\t\t\tsb.WriteString(styles.SelectedPrefix.String())\n\t\t\tsb.WriteString(styles.SelectedOption.Render(option.Key))\n\t\t} else {\n\t\t\tsb.WriteString(styles.UnselectedPrefix.String())\n\t\t\tsb.WriteString(styles.UnselectedOption.Render(option.Key))\n\t\t}\n\t\tif i < len(m.options.val)-1 {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\n\tfor i := len(m.filteredOptions); i < len(m.options.val)-1; i++ {\n\t\tsb.WriteString(\"\\n\")\n\t}\n\n\treturn sb.String()\n}\n\n// View renders the multi-select field.\nfunc (m *MultiSelect[T]) View() string {\n\tstyles := m.activeStyles()\n\n\tm.viewport.SetContent(m.optionsView())\n\n\tvar sb strings.Builder\n\tif m.title.val != \"\" || m.title.fn != nil {\n\t\tsb.WriteString(m.titleView())\n\t\tsb.WriteString(\"\\n\")\n\t}\n\tif m.description.val != \"\" || m.description.fn != nil {\n\t\tsb.WriteString(m.descriptionView() + \"\\n\")\n\t}\n\tsb.WriteString(m.viewport.View())\n\treturn styles.Base.Render(sb.String())\n}\n\nfunc (m *MultiSelect[T]) printOptions() {\n\tstyles := m.activeStyles()\n\tvar sb strings.Builder\n\tsb.WriteString(styles.Title.Render(m.title.val))\n\tsb.WriteString(\"\\n\")\n\n\tfor i, option := range m.options.val {\n\t\tif option.selected {\n\t\t\tsb.WriteString(styles.SelectedOption.Render(fmt.Sprintf(\"%d. %s %s\", i+1, \"✓\", option.Key)))\n\t\t} else {\n\t\t\tsb.WriteString(fmt.Sprintf(\"%d. %s %s\", i+1, \" \", option.Key))\n\t\t}\n\t\tsb.WriteString(\"\\n\")\n\t}\n\n\tfmt.Println(sb.String())\n}\n\n// setFilter sets the filter of the select field.\nfunc (m *MultiSelect[T]) setFilter(filter bool) {\n\tm.filtering = filter\n\tm.keymap.SetFilter.SetEnabled(filter)\n\tm.keymap.Filter.SetEnabled(!filter)\n\tm.keymap.Next.SetEnabled(!filter)\n\tm.keymap.Submit.SetEnabled(!filter)\n\tm.keymap.Prev.SetEnabled(!filter)\n\tm.keymap.ClearFilter.SetEnabled(!filter && m.filter.Value() != \"\")\n}\n\n// filterFunc returns true if the option matches the filter.\nfunc (m *MultiSelect[T]) filterFunc(option string) bool {\n\t// XXX: remove diacritics or allow customization of filter function.\n\treturn strings.Contains(strings.ToLower(option), strings.ToLower(m.filter.Value()))\n}\n\n// setSelectAllHelp enables the appropriate select all or select none keybinding.\nfunc (m *MultiSelect[T]) setSelectAllHelp() {\n\tif m.limit <= 0 {\n\t\tnoneSelected := m.numFilteredSelected() <= 0\n\t\tallSelected := m.numFilteredSelected() > 0 && m.numFilteredSelected() < len(m.filteredOptions)\n\t\tselectAll := noneSelected || allSelected\n\t\tm.keymap.SelectAll.SetEnabled(selectAll)\n\t\tm.keymap.SelectNone.SetEnabled(!selectAll)\n\t}\n}\n\n// Run runs the multi-select field.\nfunc (m *MultiSelect[T]) Run() error {\n\tif m.accessible {\n\t\treturn m.runAccessible()\n\t}\n\treturn Run(m)\n}\n\n// runAccessible() runs the multi-select field in accessible mode.\nfunc (m *MultiSelect[T]) runAccessible() error {\n\tm.printOptions()\n\tstyles := m.activeStyles()\n\n\tvar choice int\n\tfor {\n\t\tfmt.Printf(\"Select up to %d options. 0 to continue.\\n\", m.limit)\n\n\t\tchoice = accessibility.PromptInt(\"Select: \", 0, len(m.options.val))\n\t\tif choice == 0 {\n\t\t\tm.updateValue()\n\t\t\terr := m.validate(m.accessor.Get())\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif !m.options.val[choice-1].selected && m.limit > 0 && m.numSelected() >= m.limit {\n\t\t\tfmt.Printf(\"You can't select more than %d options.\\n\", m.limit)\n\t\t\tcontinue\n\t\t}\n\t\tm.options.val[choice-1].selected = !m.options.val[choice-1].selected\n\t\tif m.options.val[choice-1].selected {\n\t\t\tfmt.Printf(\"Selected: %s\\n\\n\", m.options.val[choice-1].Key)\n\t\t} else {\n\t\t\tfmt.Printf(\"Deselected: %s\\n\\n\", m.options.val[choice-1].Key)\n\t\t}\n\n\t\tm.printOptions()\n\t}\n\n\tvar values []string\n\n\tvalue := m.accessor.Get()\n\tfor _, option := range m.options.val {\n\t\tif option.selected {\n\t\t\tvalue = append(value, option.Value)\n\t\t\tvalues = append(values, option.Key)\n\t\t}\n\t}\n\tm.accessor.Set(value)\n\n\tfmt.Println(styles.SelectedOption.Render(\"Selected:\", strings.Join(values, \", \")+\"\\n\"))\n\treturn nil\n}\n\n// WithTheme sets the theme of the multi-select field.\nfunc (m *MultiSelect[T]) WithTheme(theme *Theme) Field {\n\tif m.theme != nil {\n\t\treturn m\n\t}\n\tm.theme = theme\n\tm.filter.Cursor.Style = theme.Focused.TextInput.Cursor\n\tm.filter.Cursor.TextStyle = theme.Focused.TextInput.CursorText\n\tm.filter.PromptStyle = theme.Focused.TextInput.Prompt\n\tm.filter.TextStyle = theme.Focused.TextInput.Text\n\tm.filter.PlaceholderStyle = theme.Focused.TextInput.Placeholder\n\tm.updateViewportHeight()\n\treturn m\n}\n\n// WithKeyMap sets the keymap of the multi-select field.\nfunc (m *MultiSelect[T]) WithKeyMap(k *KeyMap) Field {\n\tm.keymap = k.MultiSelect\n\tif !m.filterable {\n\t\tm.keymap.Filter.SetEnabled(false)\n\t\tm.keymap.ClearFilter.SetEnabled(false)\n\t\tm.keymap.SetFilter.SetEnabled(false)\n\t}\n\treturn m\n}\n\n// WithAccessible sets the accessible mode of the multi-select field.\nfunc (m *MultiSelect[T]) WithAccessible(accessible bool) Field {\n\tm.accessible = accessible\n\treturn m\n}\n\n// WithWidth sets the width of the multi-select field.\nfunc (m *MultiSelect[T]) WithWidth(width int) Field {\n\tm.width = width\n\treturn m\n}\n\n// WithHeight sets the total height of the multi-select field. Including padding\n// and help menu heights.\nfunc (m *MultiSelect[T]) WithHeight(height int) Field {\n\tm.Height(height)\n\treturn m\n}\n\n// WithPosition sets the position of the multi-select field.\nfunc (m *MultiSelect[T]) WithPosition(p FieldPosition) Field {\n\tif m.filtering {\n\t\treturn m\n\t}\n\tm.keymap.Prev.SetEnabled(!p.IsFirst())\n\tm.keymap.Next.SetEnabled(!p.IsLast())\n\tm.keymap.Submit.SetEnabled(p.IsLast())\n\treturn m\n}\n\n// GetKey returns the multi-select's key.\nfunc (m *MultiSelect[T]) GetKey() string {\n\treturn m.key\n}\n\n// GetValue returns the multi-select's value.\nfunc (m *MultiSelect[T]) GetValue() any {\n\treturn m.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_note.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n)\n\n// Note is a note field.\n//\n// A note is responsible for displaying information to the user. Use it to\n// provide context around a different field. Generally, the notes are not\n// interacted with unless the note has a next button `Next(true)`.\ntype Note struct {\n\tid int\n\n\ttitle       Eval[string]\n\tdescription Eval[string]\n\tnextLabel   string\n\n\tfocused        bool\n\tshowNextButton bool\n\tskip           bool\n\n\taccessible bool\n\theight     int\n\twidth      int\n\n\ttheme  *Theme\n\tkeymap NoteKeyMap\n}\n\n// NewNote creates a new note field.\n//\n// A note is responsible for displaying information to the user. Use it to\n// provide context around a different field. Generally, the notes are not\n// interacted with unless the note has a next button `Next(true)`.\nfunc NewNote() *Note {\n\treturn &Note{\n\t\tid:             nextID(),\n\t\tshowNextButton: false,\n\t\tskip:           true,\n\t\tnextLabel:      \"Next\",\n\t\ttitle:          Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription:    Eval[string]{cache: make(map[uint64]string)},\n\t}\n}\n\n// Title sets the note field's title.\n//\n// This title will be static, for dynamic titles use `TitleFunc`.\nfunc (n *Note) Title(title string) *Note {\n\tn.title.val = title\n\tn.title.fn = nil\n\treturn n\n}\n\n// TitleFunc sets the title func of the note field.\n//\n// The TitleFunc will be re-evaluated when the binding of the TitleFunc changes.\n// This is useful when you want to display dynamic content and update the title\n// of a note when another part of your form changes.\n//\n// See README.md#Dynamic for more usage information.\nfunc (n *Note) TitleFunc(f func() string, bindings any) *Note {\n\tn.title.fn = f\n\tn.title.bindings = bindings\n\treturn n\n}\n\n// Description sets the note field's description.\n//\n// This description will be static, for dynamic descriptions use `DescriptionFunc`.\nfunc (n *Note) Description(description string) *Note {\n\tn.description.val = description\n\tn.description.fn = nil\n\treturn n\n}\n\n// DescriptionFunc sets the description func of the note field.\n//\n// The DescriptionFunc will be re-evaluated when the binding of the\n// DescriptionFunc changes. This is useful when you want to display dynamic\n// content and update the description of a note when another part of your form\n// changes.\n//\n// For example, you can make a dynamic markdown preview with the following Form & Group.\n//\n//\thuh.NewText().Title(\"Markdown\").Value(&md),\n//\thuh.NewNote().Height(20).Title(\"Preview\").\n//\t  DescriptionFunc(func() string {\n//\t      return md\n//\t  }, &md),\n//\n// Notice the `binding` of the Note is the same as the `Value` of the Text field.\n// This binds the two values together, so that when the `Value` of the Text\n// field changes so does the Note description.\nfunc (n *Note) DescriptionFunc(f func() string, bindings any) *Note {\n\tn.description.fn = f\n\tn.description.bindings = bindings\n\treturn n\n}\n\n// Height sets the note field's height.\nfunc (n *Note) Height(height int) *Note {\n\tn.height = height\n\treturn n\n}\n\n// Next sets whether or not to show the next button.\n//\n//\tTitle\n//\tDescription\n//\n//\t[ Next ]\nfunc (n *Note) Next(show bool) *Note {\n\tn.showNextButton = show\n\treturn n\n}\n\n// NextLabel sets the next button label.\nfunc (n *Note) NextLabel(label string) *Note {\n\tn.nextLabel = label\n\treturn n\n}\n\n// Focus focuses the note field.\nfunc (n *Note) Focus() tea.Cmd {\n\tn.focused = true\n\treturn nil\n}\n\n// Blur blurs the note field.\nfunc (n *Note) Blur() tea.Cmd {\n\tn.focused = false\n\treturn nil\n}\n\n// Error returns the error of the note field.\nfunc (n *Note) Error() error { return nil }\n\n// Skip returns whether the note should be skipped or should be blocking.\nfunc (n *Note) Skip() bool { return n.skip }\n\n// Zoom returns whether the note should be zoomed.\nfunc (n *Note) Zoom() bool { return false }\n\n// KeyBinds returns the help message for the note field.\nfunc (n *Note) KeyBinds() []key.Binding {\n\treturn []key.Binding{\n\t\tn.keymap.Prev,\n\t\tn.keymap.Submit,\n\t\tn.keymap.Next,\n\t}\n}\n\n// Init initializes the note field.\nfunc (n *Note) Init() tea.Cmd { return nil }\n\n// Update updates the note field.\nfunc (n *Note) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tswitch msg := msg.(type) {\n\tcase updateFieldMsg:\n\t\tvar cmds []tea.Cmd\n\t\tif ok, hash := n.title.shouldUpdate(); ok {\n\t\t\tn.title.bindingsHash = hash\n\t\t\tif !n.title.loadFromCache() {\n\t\t\t\tn.title.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: n.id, title: n.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := n.description.shouldUpdate(); ok {\n\t\t\tn.description.bindingsHash = hash\n\t\t\tif !n.description.loadFromCache() {\n\t\t\t\tn.description.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: n.id, description: n.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn n, tea.Batch(cmds...)\n\tcase updateTitleMsg:\n\t\tif msg.id == n.id && msg.hash == n.title.bindingsHash {\n\t\t\tn.title.update(msg.title)\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif msg.id == n.id && msg.hash == n.description.bindingsHash {\n\t\t\tn.description.update(msg.description)\n\t\t}\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, n.keymap.Prev):\n\t\t\treturn n, PrevField\n\t\tcase key.Matches(msg, n.keymap.Next, n.keymap.Submit):\n\t\t\treturn n, NextField\n\t\t}\n\t\treturn n, NextField\n\t}\n\treturn n, nil\n}\n\nfunc (n *Note) activeStyles() *FieldStyles {\n\ttheme := n.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif n.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\n// View renders the note field.\nfunc (n *Note) View() string {\n\tstyles := n.activeStyles()\n\tsb := strings.Builder{}\n\n\tif n.title.val != \"\" || n.title.fn != nil {\n\t\tsb.WriteString(styles.NoteTitle.Render(n.title.val))\n\t}\n\tif n.description.val != \"\" || n.description.fn != nil {\n\t\tsb.WriteString(\"\\n\")\n\t\tsb.WriteString(render(n.description.val))\n\t}\n\tif n.showNextButton {\n\t\tsb.WriteString(styles.Next.Render(n.nextLabel))\n\t}\n\treturn styles.Card.Height(n.height).Render(sb.String())\n}\n\n// Run runs the note field.\nfunc (n *Note) Run() error {\n\tif n.accessible {\n\t\treturn n.runAccessible()\n\t}\n\treturn Run(n)\n}\n\n// runAccessible runs an accessible note field.\nfunc (n *Note) runAccessible() error {\n\tif n.title.val != \"\" {\n\t\tfmt.Println(n.title.val)\n\t\tfmt.Println()\n\t}\n\n\tfmt.Println(n.description.val)\n\tfmt.Println()\n\treturn nil\n}\n\n// WithTheme sets the theme on a note field.\nfunc (n *Note) WithTheme(theme *Theme) Field {\n\tif n.theme != nil {\n\t\treturn n\n\t}\n\tn.theme = theme\n\treturn n\n}\n\n// WithKeyMap sets the keymap on a note field.\nfunc (n *Note) WithKeyMap(k *KeyMap) Field {\n\tn.keymap = k.Note\n\treturn n\n}\n\n// WithAccessible sets the accessible mode of the note field.\nfunc (n *Note) WithAccessible(accessible bool) Field {\n\tn.accessible = accessible\n\treturn n\n}\n\n// WithWidth sets the width of the note field.\nfunc (n *Note) WithWidth(width int) Field {\n\tn.width = width\n\treturn n\n}\n\n// WithHeight sets the height of the note field.\nfunc (n *Note) WithHeight(height int) Field {\n\tn.Height(height)\n\treturn n\n}\n\n// WithPosition sets the position information of the note field.\nfunc (n *Note) WithPosition(p FieldPosition) Field {\n\t// if the note is the only field on the screen,\n\t// we shouldn't skip the entire group.\n\tif p.Field == p.FirstField && p.Field == p.LastField {\n\t\tn.skip = false\n\t}\n\tn.keymap.Prev.SetEnabled(!p.IsFirst())\n\tn.keymap.Next.SetEnabled(!p.IsLast())\n\tn.keymap.Submit.SetEnabled(p.IsLast())\n\treturn n\n}\n\n// GetValue satisfies the Field interface, notes do not have values.\nfunc (n *Note) GetValue() any { return nil }\n\n// GetKey satisfies the Field interface, notes do not have keys.\nfunc (n *Note) GetKey() string { return \"\" }\n\nfunc render(input string) string {\n\tvar result strings.Builder\n\tvar italic, bold, codeblock bool\n\tvar escape bool\n\n\tfor _, char := range input {\n\t\tif escape || codeblock {\n\t\t\tresult.WriteRune(char)\n\t\t\tescape = false\n\t\t\tcontinue\n\t\t}\n\t\tswitch char {\n\t\tcase '\\\\':\n\t\t\tescape = true\n\t\tcase '_':\n\t\t\tif !italic {\n\t\t\t\tresult.WriteString(\"\\033[3m\")\n\t\t\t\titalic = true\n\t\t\t} else {\n\t\t\t\tresult.WriteString(\"\\033[23m\")\n\t\t\t\titalic = false\n\t\t\t}\n\t\tcase '*':\n\t\t\tif !bold {\n\t\t\t\tresult.WriteString(\"\\033[1m\")\n\t\t\t\tbold = true\n\t\t\t} else {\n\t\t\t\tresult.WriteString(\"\\033[22m\")\n\t\t\t\tbold = false\n\t\t\t}\n\t\tcase '`':\n\t\t\tif !codeblock {\n\t\t\t\tresult.WriteString(\"\\033[0;37;40m\")\n\t\t\t\tresult.WriteString(\" \")\n\t\t\t\tcodeblock = true\n\t\t\t} else {\n\t\t\t\tresult.WriteString(\" \")\n\t\t\t\tresult.WriteString(\"\\033[0m\")\n\t\t\t\tcodeblock = false\n\n\t\t\t\tif bold {\n\t\t\t\t\tresult.WriteString(\"\\033[1m\")\n\t\t\t\t}\n\t\t\t\tif italic {\n\t\t\t\t\tresult.WriteString(\"\\033[3m\")\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tresult.WriteRune(char)\n\t\t}\n\t}\n\n\t// Reset any open formatting\n\tresult.WriteString(\"\\033[0m\")\n\n\treturn result.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_select.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/spinner\"\n\t\"github.com/charmbracelet/bubbles/textinput\"\n\t\"github.com/charmbracelet/bubbles/viewport\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\nconst (\n\tminHeight     = 1\n\tdefaultHeight = 10\n)\n\n// Select is a select field.\n//\n// A select field is a field that allows the user to select from a list of\n// options. The options can be provided statically or dynamically using Options\n// or OptionsFunc. The options can be filtered using \"/\" and navigation is done\n// using j/k, up/down, or ctrl+n/ctrl+p keys.\ntype Select[T comparable] struct {\n\tid       int\n\taccessor Accessor[T]\n\tkey      string\n\n\tviewport viewport.Model\n\n\ttitle           Eval[string]\n\tdescription     Eval[string]\n\toptions         Eval[[]Option[T]]\n\tfilteredOptions []Option[T]\n\n\tvalidate func(T) error\n\terr      error\n\n\tselected  int\n\tfocused   bool\n\tfiltering bool\n\tfilter    textinput.Model\n\tspinner   spinner.Model\n\n\tinline     bool\n\twidth      int\n\theight     int\n\taccessible bool\n\ttheme      *Theme\n\tkeymap     SelectKeyMap\n}\n\n// NewSelect creates a new select field.\n//\n// A select field is a field that allows the user to select from a list of\n// options. The options can be provided statically or dynamically using Options\n// or OptionsFunc. The options can be filtered using \"/\" and navigation is done\n// using j/k, up/down, or ctrl+n/ctrl+p keys.\nfunc NewSelect[T comparable]() *Select[T] {\n\tfilter := textinput.New()\n\tfilter.Prompt = \"/\"\n\n\ts := spinner.New(spinner.WithSpinner(spinner.Line))\n\n\treturn &Select[T]{\n\t\taccessor:    &EmbeddedAccessor[T]{},\n\t\tvalidate:    func(T) error { return nil },\n\t\tfiltering:   false,\n\t\tfilter:      filter,\n\t\toptions:     Eval[[]Option[T]]{cache: make(map[uint64][]Option[T])},\n\t\ttitle:       Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription: Eval[string]{cache: make(map[uint64]string)},\n\t\tspinner:     s,\n\t}\n}\n\n// Value sets the value of the select field.\nfunc (s *Select[T]) Value(value *T) *Select[T] {\n\treturn s.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the select field.\nfunc (s *Select[T]) Accessor(accessor Accessor[T]) *Select[T] {\n\ts.accessor = accessor\n\ts.selectValue(s.accessor.Get())\n\ts.updateValue()\n\treturn s\n}\n\nfunc (s *Select[T]) selectValue(value T) {\n\tfor i, o := range s.options.val {\n\t\tif o.Value == value {\n\t\t\ts.selected = i\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Key sets the key of the select field which can be used to retrieve the value\n// after submission.\nfunc (s *Select[T]) Key(key string) *Select[T] {\n\ts.key = key\n\treturn s\n}\n\n// Title sets the title of the select field.\n//\n// This title will be static, for dynamic titles use `TitleFunc`.\nfunc (s *Select[T]) Title(title string) *Select[T] {\n\ts.title.val = title\n\ts.title.fn = nil\n\treturn s\n}\n\n// TitleFunc sets the title func of the select field.\n//\n// This TitleFunc will be re-evaluated when the binding of the TitleFunc\n// changes. This when you want to display dynamic content and update the title\n// when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (s *Select[T]) TitleFunc(f func() string, bindings any) *Select[T] {\n\ts.title.fn = f\n\ts.title.bindings = bindings\n\treturn s\n}\n\n// Filtering sets the filtering state of the select field.\nfunc (s *Select[T]) Filtering(filtering bool) *Select[T] {\n\ts.filtering = filtering\n\ts.filter.Focus()\n\treturn s\n}\n\n// Description sets the description of the select field.\n//\n// This description will be static, for dynamic descriptions use `DescriptionFunc`.\nfunc (s *Select[T]) Description(description string) *Select[T] {\n\ts.description.val = description\n\treturn s\n}\n\n// DescriptionFunc sets the description func of the select field.\n//\n// This DescriptionFunc will be re-evaluated when the binding of the\n// DescriptionFunc changes. This is useful when you want to display dynamic\n// content and update the description when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (s *Select[T]) DescriptionFunc(f func() string, bindings any) *Select[T] {\n\ts.description.fn = f\n\ts.description.bindings = bindings\n\treturn s\n}\n\n// Options sets the options of the select field.\n//\n// This is what your user will select from.\n//\n// Title\n// Description\n//\n//\t-> Option 1\n//\t   Option 2\n//\t   Option 3\n//\n// These options will be static, for dynamic options use `OptionsFunc`.\nfunc (s *Select[T]) Options(options ...Option[T]) *Select[T] {\n\tif len(options) <= 0 {\n\t\treturn s\n\t}\n\ts.options.val = options\n\ts.filteredOptions = options\n\n\t// Set the cursor to the existing value or the last selected option.\n\tfor i, option := range options {\n\t\tif option.Value == s.accessor.Get() {\n\t\t\ts.selected = i\n\t\t\tbreak\n\t\t} else if option.selected {\n\t\t\ts.selected = i\n\t\t}\n\t}\n\n\ts.updateViewportHeight()\n\ts.updateValue()\n\n\treturn s\n}\n\n// OptionsFunc sets the options func of the select field.\n//\n// This OptionsFunc will be re-evaluated when the binding of the OptionsFunc\n// changes. This is useful when you want to display dynamic content and update\n// the options when another part of your form changes.\n//\n// For example, changing the state / provinces, based on the selected country.\n//\n//\t   huh.NewSelect[string]().\n//\t\t    Options(huh.NewOptions(\"United States\", \"Canada\", \"Mexico\")...).\n//\t\t    Value(&country).\n//\t\t    Title(\"Country\").\n//\t\t    Height(5),\n//\n//\t\thuh.NewSelect[string]().\n//\t\t  Title(\"State / Province\"). // This can also be made dynamic with `TitleFunc`.\n//\t\t  OptionsFunc(func() []huh.Option[string] {\n//\t\t    s := states[country]\n//\t\t    time.Sleep(1000 * time.Millisecond)\n//\t\t    return huh.NewOptions(s...)\n//\t\t}, &country),\n//\n// See examples/dynamic/dynamic-country/main.go for the full example.\nfunc (s *Select[T]) OptionsFunc(f func() []Option[T], bindings any) *Select[T] {\n\ts.options.fn = f\n\ts.options.bindings = bindings\n\t// If there is no height set, we should attach a static height since these\n\t// options are possibly dynamic.\n\tif s.height <= 0 {\n\t\ts.height = defaultHeight\n\t\ts.updateViewportHeight()\n\t}\n\treturn s\n}\n\n// Inline sets whether the select input should be inline.\nfunc (s *Select[T]) Inline(v bool) *Select[T] {\n\ts.inline = v\n\tif v {\n\t\ts.Height(1)\n\t}\n\ts.keymap.Left.SetEnabled(v)\n\ts.keymap.Right.SetEnabled(v)\n\ts.keymap.Up.SetEnabled(!v)\n\ts.keymap.Down.SetEnabled(!v)\n\treturn s\n}\n\n// Height sets the height of the select field. If the number of options exceeds\n// the height, the select field will become scrollable.\nfunc (s *Select[T]) Height(height int) *Select[T] {\n\ts.height = height\n\ts.updateViewportHeight()\n\treturn s\n}\n\n// Validate sets the validation function of the select field.\nfunc (s *Select[T]) Validate(validate func(T) error) *Select[T] {\n\ts.validate = validate\n\treturn s\n}\n\n// Error returns the error of the select field.\nfunc (s *Select[T]) Error() error { return s.err }\n\n// Skip returns whether the select should be skipped or should be blocking.\nfunc (*Select[T]) Skip() bool { return false }\n\n// Zoom returns whether the input should be zoomed.\nfunc (*Select[T]) Zoom() bool { return false }\n\n// Focus focuses the select field.\nfunc (s *Select[T]) Focus() tea.Cmd {\n\ts.focused = true\n\treturn nil\n}\n\n// Blur blurs the select field.\nfunc (s *Select[T]) Blur() tea.Cmd {\n\tvalue := s.accessor.Get()\n\tif s.inline {\n\t\ts.clearFilter()\n\t\ts.selectValue(value)\n\t}\n\ts.focused = false\n\ts.err = s.validate(value)\n\treturn nil\n}\n\n// KeyBinds returns the help keybindings for the select field.\nfunc (s *Select[T]) KeyBinds() []key.Binding {\n\treturn []key.Binding{\n\t\ts.keymap.Up,\n\t\ts.keymap.Down,\n\t\ts.keymap.Left,\n\t\ts.keymap.Right,\n\t\ts.keymap.Filter,\n\t\ts.keymap.SetFilter,\n\t\ts.keymap.ClearFilter,\n\t\ts.keymap.Prev,\n\t\ts.keymap.Next,\n\t\ts.keymap.Submit,\n\t}\n}\n\n// Init initializes the select field.\nfunc (s *Select[T]) Init() tea.Cmd {\n\treturn nil\n}\n\n// Update updates the select field.\nfunc (s *Select[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\ts.updateViewportHeight()\n\n\tvar cmd tea.Cmd\n\tif s.filtering {\n\t\ts.filter, cmd = s.filter.Update(msg)\n\n\t\t// Keep the selected item in view.\n\t\tif s.selected < s.viewport.YOffset || s.selected >= s.viewport.YOffset+s.viewport.Height {\n\t\t\ts.viewport.SetYOffset(s.selected)\n\t\t}\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase updateFieldMsg:\n\t\tvar cmds []tea.Cmd\n\t\tif ok, hash := s.title.shouldUpdate(); ok {\n\t\t\ts.title.bindingsHash = hash\n\t\t\tif !s.title.loadFromCache() {\n\t\t\t\ts.title.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: s.id, title: s.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := s.description.shouldUpdate(); ok {\n\t\t\ts.description.bindingsHash = hash\n\t\t\tif !s.description.loadFromCache() {\n\t\t\t\ts.description.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: s.id, description: s.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := s.options.shouldUpdate(); ok {\n\t\t\ts.clearFilter()\n\t\t\ts.options.bindingsHash = hash\n\t\t\tif s.options.loadFromCache() {\n\t\t\t\ts.filteredOptions = s.options.val\n\t\t\t\ts.selected = clamp(s.selected, 0, len(s.options.val)-1)\n\t\t\t} else {\n\t\t\t\ts.options.loading = true\n\t\t\t\ts.options.loadingStart = time.Now()\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateOptionsMsg[T]{id: s.id, hash: hash, options: s.options.fn()}\n\t\t\t\t}, s.spinner.Tick)\n\t\t\t}\n\t\t}\n\t\treturn s, tea.Batch(cmds...)\n\n\tcase spinner.TickMsg:\n\t\tif !s.options.loading {\n\t\t\tbreak\n\t\t}\n\t\ts.spinner, cmd = s.spinner.Update(msg)\n\t\treturn s, cmd\n\n\tcase updateTitleMsg:\n\t\tif msg.id == s.id && msg.hash == s.title.bindingsHash {\n\t\t\ts.title.update(msg.title)\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif msg.id == s.id && msg.hash == s.description.bindingsHash {\n\t\t\ts.description.update(msg.description)\n\t\t}\n\tcase updateOptionsMsg[T]:\n\t\tif msg.id == s.id && msg.hash == s.options.bindingsHash {\n\t\t\ts.options.update(msg.options)\n\n\t\t\t// since we're updating the options, we need to update the selected cursor\n\t\t\t// position and filteredOptions.\n\t\t\ts.selected = clamp(s.selected, 0, len(msg.options)-1)\n\t\t\ts.filteredOptions = msg.options\n\t\t\ts.updateValue()\n\t\t}\n\tcase tea.KeyMsg:\n\t\ts.err = nil\n\t\tswitch {\n\t\tcase key.Matches(msg, s.keymap.Filter):\n\t\t\ts.setFiltering(true)\n\t\t\treturn s, s.filter.Focus()\n\t\tcase key.Matches(msg, s.keymap.SetFilter):\n\t\t\tif len(s.filteredOptions) <= 0 {\n\t\t\t\ts.filter.SetValue(\"\")\n\t\t\t\ts.filteredOptions = s.options.val\n\t\t\t}\n\t\t\ts.setFiltering(false)\n\t\tcase key.Matches(msg, s.keymap.ClearFilter):\n\t\t\ts.clearFilter()\n\t\tcase key.Matches(msg, s.keymap.Up, s.keymap.Left):\n\t\t\t// When filtering we should ignore j/k keybindings\n\t\t\t//\n\t\t\t// XXX: Currently, the below check doesn't account for keymap\n\t\t\t// changes. When making this fix it's worth considering ignoring\n\t\t\t// whether to ignore all up/down keybindings as ignoring a-zA-Z0-9\n\t\t\t// may not be enough when international keyboards are considered.\n\t\t\tif s.filtering && (msg.String() == \"k\" || msg.String() == \"h\") {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.selected = s.selected - 1\n\t\t\tif s.selected < 0 {\n\t\t\t\ts.selected = len(s.filteredOptions) - 1\n\t\t\t\ts.viewport.GotoBottom()\n\t\t\t}\n\t\t\tif s.selected < s.viewport.YOffset {\n\t\t\t\ts.viewport.SetYOffset(s.selected)\n\t\t\t}\n\t\t\ts.updateValue()\n\t\tcase key.Matches(msg, s.keymap.GotoTop):\n\t\t\tif s.filtering {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.selected = 0\n\t\t\ts.viewport.GotoTop()\n\t\t\ts.updateValue()\n\t\tcase key.Matches(msg, s.keymap.GotoBottom):\n\t\t\tif s.filtering {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.selected = len(s.filteredOptions) - 1\n\t\t\ts.viewport.GotoBottom()\n\t\tcase key.Matches(msg, s.keymap.HalfPageUp):\n\t\t\ts.selected = max(s.selected-s.viewport.Height/2, 0)\n\t\t\ts.viewport.HalfViewUp()\n\t\t\ts.updateValue()\n\t\tcase key.Matches(msg, s.keymap.HalfPageDown):\n\t\t\ts.selected = min(s.selected+s.viewport.Height/2, len(s.filteredOptions)-1)\n\t\t\ts.viewport.HalfViewDown()\n\t\t\ts.updateValue()\n\t\tcase key.Matches(msg, s.keymap.Down, s.keymap.Right):\n\t\t\t// When filtering we should ignore j/k keybindings\n\t\t\t//\n\t\t\t// XXX: See note in the previous case match.\n\t\t\tif s.filtering && (msg.String() == \"j\" || msg.String() == \"l\") {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.selected = s.selected + 1\n\t\t\tif s.selected > len(s.filteredOptions)-1 {\n\t\t\t\ts.selected = 0\n\t\t\t\ts.viewport.GotoTop()\n\t\t\t}\n\t\t\tif s.selected >= s.viewport.YOffset+s.viewport.Height {\n\t\t\t\ts.viewport.LineDown(1)\n\t\t\t}\n\t\t\ts.updateValue()\n\t\tcase key.Matches(msg, s.keymap.Prev):\n\t\t\tif s.selected >= len(s.filteredOptions) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.updateValue()\n\t\t\ts.err = s.validate(s.accessor.Get())\n\t\t\tif s.err != nil {\n\t\t\t\treturn s, nil\n\t\t\t}\n\t\t\ts.updateValue()\n\t\t\treturn s, PrevField\n\t\tcase key.Matches(msg, s.keymap.Next, s.keymap.Submit):\n\t\t\tif s.selected >= len(s.filteredOptions) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.setFiltering(false)\n\t\t\ts.updateValue()\n\t\t\ts.err = s.validate(s.accessor.Get())\n\t\t\tif s.err != nil {\n\t\t\t\treturn s, nil\n\t\t\t}\n\t\t\ts.updateValue()\n\t\t\treturn s, NextField\n\t\t}\n\n\t\tif s.filtering {\n\t\t\ts.filteredOptions = s.options.val\n\t\t\tif s.filter.Value() != \"\" {\n\t\t\t\ts.filteredOptions = nil\n\t\t\t\tfor _, option := range s.options.val {\n\t\t\t\t\tif s.filterFunc(option.Key) {\n\t\t\t\t\t\ts.filteredOptions = append(s.filteredOptions, option)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(s.filteredOptions) > 0 {\n\t\t\t\ts.selected = min(s.selected, len(s.filteredOptions)-1)\n\t\t\t\ts.viewport.SetYOffset(clamp(s.selected, 0, len(s.filteredOptions)-s.viewport.Height))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s, cmd\n}\n\nfunc (s *Select[T]) updateValue() {\n\tif s.selected < len(s.filteredOptions) && s.selected >= 0 {\n\t\ts.accessor.Set(s.filteredOptions[s.selected].Value)\n\t}\n}\n\n// updateViewportHeight updates the viewport size according to the Height setting\n// on this select field.\nfunc (s *Select[T]) updateViewportHeight() {\n\t// If no height is set size the viewport to the number of options.\n\tif s.height <= 0 {\n\t\ts.viewport.Height = len(s.options.val)\n\t\treturn\n\t}\n\n\ts.viewport.Height = max(minHeight, s.height-\n\t\tlipgloss.Height(s.titleView())-\n\t\tlipgloss.Height(s.descriptionView()))\n}\n\nfunc (s *Select[T]) activeStyles() *FieldStyles {\n\ttheme := s.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif s.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\nfunc (s *Select[T]) titleView() string {\n\tvar (\n\t\tstyles = s.activeStyles()\n\t\tsb     = strings.Builder{}\n\t)\n\tif s.filtering {\n\t\tsb.WriteString(s.filter.View())\n\t} else if s.filter.Value() != \"\" && !s.inline {\n\t\tsb.WriteString(styles.Title.Render(s.title.val) + styles.Description.Render(\"/\"+s.filter.Value()))\n\t} else {\n\t\tsb.WriteString(styles.Title.Render(s.title.val))\n\t}\n\tif s.err != nil {\n\t\tsb.WriteString(styles.ErrorIndicator.String())\n\t}\n\treturn sb.String()\n}\n\nfunc (s *Select[T]) descriptionView() string {\n\treturn s.activeStyles().Description.Render(s.description.val)\n}\n\nfunc (s *Select[T]) optionsView() string {\n\tvar (\n\t\tstyles = s.activeStyles()\n\t\tc      = styles.SelectSelector.String()\n\t\tsb     strings.Builder\n\t)\n\n\tif s.options.loading && time.Since(s.options.loadingStart) > spinnerShowThreshold {\n\t\ts.spinner.Style = s.activeStyles().MultiSelectSelector.UnsetString()\n\t\tsb.WriteString(s.spinner.View() + \" Loading...\")\n\t\treturn sb.String()\n\t}\n\n\tif s.inline {\n\t\tsb.WriteString(styles.PrevIndicator.Faint(s.selected <= 0).String())\n\t\tif len(s.filteredOptions) > 0 {\n\t\t\tsb.WriteString(styles.SelectedOption.Render(s.filteredOptions[s.selected].Key))\n\t\t} else {\n\t\t\tsb.WriteString(styles.TextInput.Placeholder.Render(\"No matches\"))\n\t\t}\n\t\tsb.WriteString(styles.NextIndicator.Faint(s.selected == len(s.filteredOptions)-1).String())\n\t\treturn sb.String()\n\t}\n\n\tfor i, option := range s.filteredOptions {\n\t\tif s.selected == i {\n\t\t\tsb.WriteString(c + styles.SelectedOption.Render(option.Key))\n\t\t} else {\n\t\t\tsb.WriteString(strings.Repeat(\" \", lipgloss.Width(c)) + styles.UnselectedOption.Render(option.Key))\n\t\t}\n\t\tif i < len(s.options.val)-1 {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\n\tfor i := len(s.filteredOptions); i < len(s.options.val)-1; i++ {\n\t\tsb.WriteString(\"\\n\")\n\t}\n\n\treturn sb.String()\n}\n\n// View renders the select field.\nfunc (s *Select[T]) View() string {\n\tstyles := s.activeStyles()\n\ts.viewport.SetContent(s.optionsView())\n\n\tvar sb strings.Builder\n\tif s.title.val != \"\" || s.title.fn != nil {\n\t\tsb.WriteString(s.titleView())\n\t\tif !s.inline {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\tif s.description.val != \"\" || s.description.fn != nil {\n\t\tsb.WriteString(s.descriptionView())\n\t\tif !s.inline {\n\t\t\tsb.WriteString(\"\\n\")\n\t\t}\n\t}\n\tsb.WriteString(s.viewport.View())\n\treturn styles.Base.Render(sb.String())\n}\n\n// clearFilter clears the value of the filter.\nfunc (s *Select[T]) clearFilter() {\n\ts.filter.SetValue(\"\")\n\ts.filteredOptions = s.options.val\n\ts.setFiltering(false)\n}\n\n// setFiltering sets the filter of the select field.\nfunc (s *Select[T]) setFiltering(filtering bool) {\n\tif s.inline && filtering {\n\t\ts.filter.Width = lipgloss.Width(s.titleView()) - 1 - 1\n\t}\n\ts.filtering = filtering\n\ts.keymap.SetFilter.SetEnabled(filtering)\n\ts.keymap.Filter.SetEnabled(!filtering)\n\ts.keymap.ClearFilter.SetEnabled(!filtering && s.filter.Value() != \"\")\n}\n\n// filterFunc returns true if the option matches the filter.\nfunc (s *Select[T]) filterFunc(option string) bool {\n\t// XXX: remove diacritics or allow customization of filter function.\n\treturn strings.Contains(strings.ToLower(option), strings.ToLower(s.filter.Value()))\n}\n\n// Run runs the select field.\nfunc (s *Select[T]) Run() error {\n\tif s.accessible {\n\t\treturn s.runAccessible()\n\t}\n\treturn Run(s)\n}\n\n// runAccessible runs an accessible select field.\nfunc (s *Select[T]) runAccessible() error {\n\tvar sb strings.Builder\n\tstyles := s.activeStyles()\n\tsb.WriteString(styles.Title.Render(s.title.val) + \"\\n\")\n\n\tfor i, option := range s.options.val {\n\t\tsb.WriteString(fmt.Sprintf(\"%d. %s\", i+1, option.Key))\n\t\tsb.WriteString(\"\\n\")\n\t}\n\n\tfmt.Println(sb.String())\n\n\tfor {\n\t\tchoice := accessibility.PromptInt(\"Choose: \", 1, len(s.options.val))\n\t\toption := s.options.val[choice-1]\n\t\tif err := s.validate(option.Value); err != nil {\n\t\t\tfmt.Println(err.Error())\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Println(styles.SelectedOption.Render(\"Chose: \" + option.Key + \"\\n\"))\n\t\ts.accessor.Set(option.Value)\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\n// WithTheme sets the theme of the select field.\nfunc (s *Select[T]) WithTheme(theme *Theme) Field {\n\tif s.theme != nil {\n\t\treturn s\n\t}\n\ts.theme = theme\n\ts.filter.Cursor.Style = theme.Focused.TextInput.Cursor\n\ts.filter.Cursor.TextStyle = theme.Focused.TextInput.CursorText\n\ts.filter.PromptStyle = theme.Focused.TextInput.Prompt\n\ts.filter.TextStyle = theme.Focused.TextInput.Text\n\ts.filter.PlaceholderStyle = theme.Focused.TextInput.Placeholder\n\ts.updateViewportHeight()\n\treturn s\n}\n\n// WithKeyMap sets the keymap on a select field.\nfunc (s *Select[T]) WithKeyMap(k *KeyMap) Field {\n\ts.keymap = k.Select\n\ts.keymap.Left.SetEnabled(s.inline)\n\ts.keymap.Right.SetEnabled(s.inline)\n\ts.keymap.Up.SetEnabled(!s.inline)\n\ts.keymap.Down.SetEnabled(!s.inline)\n\treturn s\n}\n\n// WithAccessible sets the accessible mode of the select field.\nfunc (s *Select[T]) WithAccessible(accessible bool) Field {\n\ts.accessible = accessible\n\treturn s\n}\n\n// WithWidth sets the width of the select field.\nfunc (s *Select[T]) WithWidth(width int) Field {\n\ts.width = width\n\treturn s\n}\n\n// WithHeight sets the height of the select field.\nfunc (s *Select[T]) WithHeight(height int) Field {\n\treturn s.Height(height)\n}\n\n// WithPosition sets the position of the select field.\nfunc (s *Select[T]) WithPosition(p FieldPosition) Field {\n\tif s.filtering {\n\t\treturn s\n\t}\n\ts.keymap.Prev.SetEnabled(!p.IsFirst())\n\ts.keymap.Next.SetEnabled(!p.IsLast())\n\ts.keymap.Submit.SetEnabled(p.IsLast())\n\treturn s\n}\n\n// GetKey returns the key of the field.\nfunc (s *Select[T]) GetKey() string { return s.key }\n\n// GetValue returns the value of the field.\nfunc (s *Select[T]) GetValue() any {\n\treturn s.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/field_text.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/textarea\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/accessibility\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Text is a text field.\n//\n// A text box is responsible for getting multi-line input from the user. Use\n// it to gather longer-form user input. The Text field can be filled with an\n// EDITOR.\ntype Text struct {\n\taccessor Accessor[string]\n\tkey      string\n\tid       int\n\n\ttitle       Eval[string]\n\tdescription Eval[string]\n\tplaceholder Eval[string]\n\n\teditorCmd       string\n\teditorArgs      []string\n\teditorExtension string\n\n\ttextarea textarea.Model\n\n\tfocused  bool\n\tvalidate func(string) error\n\terr      error\n\n\taccessible bool\n\twidth      int\n\n\ttheme  *Theme\n\tkeymap TextKeyMap\n}\n\n// NewText creates a new text field.\n//\n// A text box is responsible for getting multi-line input from the user. Use\n// it to gather longer-form user input. The Text field can be filled with an\n// EDITOR.\nfunc NewText() *Text {\n\ttext := textarea.New()\n\ttext.ShowLineNumbers = false\n\ttext.Prompt = \"\"\n\ttext.FocusedStyle.CursorLine = lipgloss.NewStyle()\n\n\teditorCmd, editorArgs := getEditor()\n\n\tt := &Text{\n\t\taccessor:        &EmbeddedAccessor[string]{},\n\t\tid:              nextID(),\n\t\ttextarea:        text,\n\t\tvalidate:        func(string) error { return nil },\n\t\teditorCmd:       editorCmd,\n\t\teditorArgs:      editorArgs,\n\t\teditorExtension: \"md\",\n\t\ttitle:           Eval[string]{cache: make(map[uint64]string)},\n\t\tdescription:     Eval[string]{cache: make(map[uint64]string)},\n\t\tplaceholder:     Eval[string]{cache: make(map[uint64]string)},\n\t}\n\n\treturn t\n}\n\n// Value sets the value of the text field.\nfunc (t *Text) Value(value *string) *Text {\n\treturn t.Accessor(NewPointerAccessor(value))\n}\n\n// Accessor sets the accessor of the text field.\nfunc (t *Text) Accessor(accessor Accessor[string]) *Text {\n\tt.accessor = accessor\n\tt.textarea.SetValue(t.accessor.Get())\n\treturn t\n}\n\n// Key sets the key of the text field.\nfunc (t *Text) Key(key string) *Text {\n\tt.key = key\n\treturn t\n}\n\n// Title sets the text field's title.\n//\n// This title will be static, for dynamic titles use `TitleFunc`.\nfunc (t *Text) Title(title string) *Text {\n\tt.title.val = title\n\tt.title.fn = nil\n\treturn t\n}\n\n// TitleFunc sets the text field's title func.\n//\n// The TitleFunc will be re-evaluated when the binding of the TitleFunc changes.\n// This is useful when you want to display dynamic content and update the title\n// when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (t *Text) TitleFunc(f func() string, bindings any) *Text {\n\tt.title.fn = f\n\tt.title.bindings = bindings\n\treturn t\n}\n\n// Description sets the description of the text field.\n//\n// This description will be static, for dynamic description use `DescriptionFunc`.\nfunc (t *Text) Description(description string) *Text {\n\tt.description.val = description\n\tt.description.fn = nil\n\treturn t\n}\n\n// DescriptionFunc sets the description func of the text field.\n//\n// The DescriptionFunc will be re-evaluated when the binding of the\n// DescriptionFunc changes. This is useful when you want to display dynamic\n// content and update the description when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (t *Text) DescriptionFunc(f func() string, bindings any) *Text {\n\tt.description.fn = f\n\tt.description.bindings = bindings\n\treturn t\n}\n\n// Lines sets the number of lines to show of the text field.\nfunc (t *Text) Lines(lines int) *Text {\n\tt.textarea.SetHeight(lines)\n\treturn t\n}\n\n// CharLimit sets the character limit of the text field.\nfunc (t *Text) CharLimit(charlimit int) *Text {\n\tt.textarea.CharLimit = charlimit\n\treturn t\n}\n\n// ShowLineNumbers sets whether or not to show line numbers.\nfunc (t *Text) ShowLineNumbers(show bool) *Text {\n\tt.textarea.ShowLineNumbers = show\n\treturn t\n}\n\n// Placeholder sets the placeholder of the text field.\n//\n// This placeholder will be static, for dynamic placeholders use `PlaceholderFunc`.\nfunc (t *Text) Placeholder(str string) *Text {\n\tt.textarea.Placeholder = str\n\treturn t\n}\n\n// PlaceholderFunc sets the placeholder func of the text field.\n//\n// The PlaceholderFunc will be re-evaluated when the binding of the\n// PlaceholderFunc changes. This is useful when you want to display dynamic\n// content and update the placeholder when another part of your form changes.\n//\n// See README#Dynamic for more usage information.\nfunc (t *Text) PlaceholderFunc(f func() string, bindings any) *Text {\n\tt.placeholder.fn = f\n\tt.placeholder.bindings = bindings\n\treturn t\n}\n\n// Validate sets the validation function of the text field.\nfunc (t *Text) Validate(validate func(string) error) *Text {\n\tt.validate = validate\n\treturn t\n}\n\nconst defaultEditor = \"nano\"\n\n// getEditor returns the editor command and arguments.\nfunc getEditor() (string, []string) {\n\teditor := strings.Fields(os.Getenv(\"EDITOR\"))\n\tif len(editor) > 0 {\n\t\treturn editor[0], editor[1:]\n\t}\n\treturn defaultEditor, nil\n}\n\n// Editor specifies which editor to use.\n//\n// The first argument provided is used as the editor command (vim, nvim, nano, etc...)\n// The following (optional) arguments provided are passed as arguments to the editor command.\nfunc (t *Text) Editor(editor ...string) *Text {\n\tif len(editor) > 0 {\n\t\tt.editorCmd = editor[0]\n\t}\n\tif len(editor) > 1 {\n\t\tt.editorArgs = editor[1:]\n\t}\n\treturn t\n}\n\n// EditorExtension specifies arguments to pass into the editor.\nfunc (t *Text) EditorExtension(extension string) *Text {\n\tt.editorExtension = extension\n\treturn t\n}\n\n// Error returns the error of the text field.\nfunc (t *Text) Error() error { return t.err }\n\n// Skip returns whether the textarea should be skipped or should be blocking.\nfunc (*Text) Skip() bool { return false }\n\n// Zoom returns whether the note should be zoomed.\nfunc (*Text) Zoom() bool { return false }\n\n// Focus focuses the text field.\nfunc (t *Text) Focus() tea.Cmd {\n\tt.focused = true\n\treturn t.textarea.Focus()\n}\n\n// Blur blurs the text field.\nfunc (t *Text) Blur() tea.Cmd {\n\tt.focused = false\n\tt.accessor.Set(t.textarea.Value())\n\tt.textarea.Blur()\n\tt.err = t.validate(t.accessor.Get())\n\treturn nil\n}\n\n// KeyBinds returns the help message for the text field.\nfunc (t *Text) KeyBinds() []key.Binding {\n\treturn []key.Binding{t.keymap.NewLine, t.keymap.Editor, t.keymap.Prev, t.keymap.Submit, t.keymap.Next}\n}\n\ntype updateValueMsg []byte\n\n// Init initializes the text field.\nfunc (t *Text) Init() tea.Cmd {\n\tt.textarea.Blur()\n\treturn nil\n}\n\n// Update updates the text field.\nfunc (t *Text) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tvar cmds []tea.Cmd\n\tvar cmd tea.Cmd\n\n\tswitch msg := msg.(type) {\n\tcase updateValueMsg:\n\t\tt.textarea.SetValue(string(msg))\n\t\tt.textarea, cmd = t.textarea.Update(msg)\n\t\tcmds = append(cmds, cmd)\n\t\tt.accessor.Set(t.textarea.Value())\n\tcase updateFieldMsg:\n\t\tvar cmds []tea.Cmd\n\t\tif ok, hash := t.placeholder.shouldUpdate(); ok {\n\t\t\tt.placeholder.bindingsHash = hash\n\t\t\tif t.placeholder.loadFromCache() {\n\t\t\t\tt.textarea.Placeholder = t.placeholder.val\n\t\t\t} else {\n\t\t\t\tt.placeholder.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updatePlaceholderMsg{id: t.id, placeholder: t.placeholder.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := t.title.shouldUpdate(); ok {\n\t\t\tt.title.bindingsHash = hash\n\t\t\tif !t.title.loadFromCache() {\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateTitleMsg{id: t.id, title: t.title.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif ok, hash := t.description.shouldUpdate(); ok {\n\t\t\tt.description.bindingsHash = hash\n\t\t\tif !t.description.loadFromCache() {\n\t\t\t\tt.description.loading = true\n\t\t\t\tcmds = append(cmds, func() tea.Msg {\n\t\t\t\t\treturn updateDescriptionMsg{id: t.id, description: t.description.fn(), hash: hash}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn t, tea.Batch(cmds...)\n\tcase updatePlaceholderMsg:\n\t\tif t.id == msg.id && t.placeholder.bindingsHash == msg.hash {\n\t\t\tt.placeholder.update(msg.placeholder)\n\t\t\tt.textarea.Placeholder = msg.placeholder\n\t\t}\n\tcase updateTitleMsg:\n\t\tif t.id == msg.id && t.title.bindingsHash == msg.hash {\n\t\t\tt.title.update(msg.title)\n\t\t}\n\tcase updateDescriptionMsg:\n\t\tif t.id == msg.id && t.description.bindingsHash == msg.hash {\n\t\t\tt.description.update(msg.description)\n\t\t}\n\tcase tea.KeyMsg:\n\t\tt.err = nil\n\n\t\tswitch {\n\t\tcase key.Matches(msg, t.keymap.Editor):\n\t\t\text := strings.TrimPrefix(t.editorExtension, \".\")\n\t\t\ttmpFile, _ := os.CreateTemp(os.TempDir(), \"*.\"+ext)\n\t\t\tcmd := exec.Command(t.editorCmd, append(t.editorArgs, tmpFile.Name())...) //nolint:gosec\n\t\t\t_ = os.WriteFile(tmpFile.Name(), []byte(t.textarea.Value()), 0o644)       //nolint:mnd,gosec\n\t\t\tcmds = append(cmds, tea.ExecProcess(cmd, func(error) tea.Msg {\n\t\t\t\tcontent, _ := os.ReadFile(tmpFile.Name())\n\t\t\t\t_ = os.Remove(tmpFile.Name())\n\t\t\t\treturn updateValueMsg(content)\n\t\t\t}))\n\t\tcase key.Matches(msg, t.keymap.Next, t.keymap.Submit):\n\t\t\tvalue := t.textarea.Value()\n\t\t\tt.err = t.validate(value)\n\t\t\tif t.err != nil {\n\t\t\t\treturn t, nil\n\t\t\t}\n\t\t\tcmds = append(cmds, NextField)\n\t\tcase key.Matches(msg, t.keymap.Prev):\n\t\t\tvalue := t.textarea.Value()\n\t\t\tt.err = t.validate(value)\n\t\t\tif t.err != nil {\n\t\t\t\treturn t, nil\n\t\t\t}\n\t\t\tcmds = append(cmds, PrevField)\n\t\t}\n\t}\n\n\tt.textarea, cmd = t.textarea.Update(msg)\n\tcmds = append(cmds, cmd)\n\tt.accessor.Set(t.textarea.Value())\n\n\treturn t, tea.Batch(cmds...)\n}\n\nfunc (t *Text) activeStyles() *FieldStyles {\n\ttheme := t.theme\n\tif theme == nil {\n\t\ttheme = ThemeCharm()\n\t}\n\tif t.focused {\n\t\treturn &theme.Focused\n\t}\n\treturn &theme.Blurred\n}\n\nfunc (t *Text) activeTextAreaStyles() *textarea.Style {\n\tif t.theme == nil {\n\t\treturn &t.textarea.BlurredStyle\n\t}\n\tif t.focused {\n\t\treturn &t.textarea.FocusedStyle\n\t}\n\treturn &t.textarea.BlurredStyle\n}\n\n// View renders the text field.\nfunc (t *Text) View() string {\n\tstyles := t.activeStyles()\n\ttextareaStyles := t.activeTextAreaStyles()\n\n\t// NB: since the method is on a pointer receiver these are being mutated.\n\t// Because this runs on every render this shouldn't matter in practice,\n\t// however.\n\ttextareaStyles.Placeholder = styles.TextInput.Placeholder\n\ttextareaStyles.Text = styles.TextInput.Text\n\ttextareaStyles.Prompt = styles.TextInput.Prompt\n\ttextareaStyles.CursorLine = styles.TextInput.Text\n\tt.textarea.Cursor.Style = styles.TextInput.Cursor\n\tt.textarea.Cursor.TextStyle = styles.TextInput.CursorText\n\n\tvar sb strings.Builder\n\tif t.title.val != \"\" || t.title.fn != nil {\n\t\tsb.WriteString(styles.Title.Render(t.title.val))\n\t\tif t.err != nil {\n\t\t\tsb.WriteString(styles.ErrorIndicator.String())\n\t\t}\n\t\tsb.WriteString(\"\\n\")\n\t}\n\tif t.description.val != \"\" || t.description.fn != nil {\n\t\tsb.WriteString(styles.Description.Render(t.description.val))\n\t\tsb.WriteString(\"\\n\")\n\t}\n\tsb.WriteString(t.textarea.View())\n\n\treturn styles.Base.Render(sb.String())\n}\n\n// Run runs the text field.\nfunc (t *Text) Run() error {\n\tif t.accessible {\n\t\treturn t.runAccessible()\n\t}\n\treturn Run(t)\n}\n\n// runAccessible runs an accessible text field.\nfunc (t *Text) runAccessible() error {\n\tstyles := t.activeStyles()\n\tfmt.Println(styles.Title.Render(t.title.val))\n\tfmt.Println()\n\tt.accessor.Set(accessibility.PromptString(\"Input: \", func(input string) error {\n\t\tif err := t.validate(input); err != nil {\n\t\t\t// Handle the error from t.validate, return it\n\t\t\treturn err\n\t\t}\n\n\t\tif len(input) > t.textarea.CharLimit {\n\t\t\treturn fmt.Errorf(\"Input cannot exceed %d characters\", t.textarea.CharLimit)\n\t\t}\n\t\treturn nil\n\t}))\n\tfmt.Println()\n\treturn nil\n}\n\n// WithTheme sets the theme on a text field.\nfunc (t *Text) WithTheme(theme *Theme) Field {\n\tif t.theme != nil {\n\t\treturn t\n\t}\n\tt.theme = theme\n\treturn t\n}\n\n// WithKeyMap sets the keymap on a text field.\nfunc (t *Text) WithKeyMap(k *KeyMap) Field {\n\tt.keymap = k.Text\n\tt.textarea.KeyMap.InsertNewline.SetKeys(t.keymap.NewLine.Keys()...)\n\treturn t\n}\n\n// WithAccessible sets the accessible mode of the text field.\nfunc (t *Text) WithAccessible(accessible bool) Field {\n\tt.accessible = accessible\n\treturn t\n}\n\n// WithWidth sets the width of the text field.\nfunc (t *Text) WithWidth(width int) Field {\n\tt.width = width\n\tt.textarea.SetWidth(width - t.activeStyles().Base.GetHorizontalFrameSize())\n\treturn t\n}\n\n// WithHeight sets the height of the text field.\nfunc (t *Text) WithHeight(height int) Field {\n\tadjust := 0\n\tif t.title.val != \"\" {\n\t\tadjust++\n\t}\n\tif t.description.val != \"\" {\n\t\tadjust++\n\t}\n\tt.textarea.SetHeight(height - t.activeStyles().Base.GetVerticalFrameSize() - adjust)\n\treturn t\n}\n\n// WithPosition sets the position information of the text field.\nfunc (t *Text) WithPosition(p FieldPosition) Field {\n\tt.keymap.Prev.SetEnabled(!p.IsFirst())\n\tt.keymap.Next.SetEnabled(!p.IsLast())\n\tt.keymap.Submit.SetEnabled(p.IsLast())\n\treturn t\n}\n\n// GetKey returns the key of the field.\nfunc (t *Text) GetKey() string { return t.key }\n\n// GetValue returns the value of the field.\nfunc (t *Text) GetValue() any {\n\treturn t.accessor.Get()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/form.go",
    "content": "package huh\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/charmbracelet/bubbles/help\"\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/internal/selector\"\n)\n\nconst defaultWidth = 80\n\n// Internal ID management. Used during animating to ensure that frame messages\n// are received only by spinner components that sent them.\nvar (\n\tlastID int\n\tidMtx  sync.Mutex\n)\n\n// Return the next ID we should use on the Model.\nfunc nextID() int {\n\tidMtx.Lock()\n\tdefer idMtx.Unlock()\n\tlastID++\n\treturn lastID\n}\n\n// FormState represents the current state of the form.\ntype FormState int\n\nconst (\n\t// StateNormal is when the user is completing the form.\n\tStateNormal FormState = iota\n\n\t// StateCompleted is when the user has completed the form.\n\tStateCompleted\n\n\t// StateAborted is when the user has aborted the form.\n\tStateAborted\n)\n\n// ErrUserAborted is the error returned when a user exits the form before submitting.\nvar ErrUserAborted = errors.New(\"user aborted\")\n\n// ErrTimeout is the error returned when the timeout is reached.\nvar ErrTimeout = errors.New(\"timeout\")\n\n// ErrTimeoutUnsupported is the error returned when timeout is used while in accessible mode.\nvar ErrTimeoutUnsupported = errors.New(\"timeout is not supported in accessible mode\")\n\n// Form is a collection of groups that are displayed one at a time on a \"page\".\n//\n// The form can navigate between groups and is complete once all the groups are\n// complete.\ntype Form struct {\n\t// collection of groups\n\tselector *selector.Selector[*Group]\n\n\tresults map[string]any\n\n\t// callbacks\n\tSubmitCmd tea.Cmd\n\tCancelCmd tea.Cmd\n\n\tState FormState\n\n\t// whether or not to use bubble tea rendering for accessibility\n\t// purposes, if true, the form will render with basic prompting primitives\n\t// to be more accessible to screen readers.\n\taccessible bool\n\n\tquitting bool\n\taborted  bool\n\n\t// options\n\twidth      int\n\theight     int\n\tkeymap     *KeyMap\n\ttimeout    time.Duration\n\tteaOptions []tea.ProgramOption\n\n\tlayout Layout\n}\n\n// NewForm returns a form with the given groups and default themes and\n// keybindings.\n//\n// Use With* methods to customize the form with options, such as setting\n// different themes and keybindings.\nfunc NewForm(groups ...*Group) *Form {\n\tselector := selector.NewSelector(groups)\n\n\tf := &Form{\n\t\tselector: selector,\n\t\tkeymap:   NewDefaultKeyMap(),\n\t\tresults:  make(map[string]any),\n\t\tlayout:   LayoutDefault,\n\t\tteaOptions: []tea.ProgramOption{\n\t\t\ttea.WithOutput(os.Stderr),\n\t\t},\n\t}\n\n\t// NB: If dynamic forms come into play this will need to be applied when\n\t// groups and fields are added.\n\tf.WithKeyMap(f.keymap)\n\tf.WithWidth(f.width)\n\tf.WithHeight(f.height)\n\tf.UpdateFieldPositions()\n\n\tif os.Getenv(\"TERM\") == \"dumb\" {\n\t\tf.WithWidth(defaultWidth)\n\t\tf.WithAccessible(true)\n\t}\n\n\treturn f\n}\n\n// Field is a primitive of a form.\n//\n// A field represents a single input control on a form such as a text input,\n// confirm button, select option, etc...\n//\n// Each field implements the Bubble Tea Model interface.\ntype Field interface {\n\t// Bubble Tea Model\n\tInit() tea.Cmd\n\tUpdate(tea.Msg) (tea.Model, tea.Cmd)\n\tView() string\n\n\t// Bubble Tea Events\n\tBlur() tea.Cmd\n\tFocus() tea.Cmd\n\n\t// Errors and Validation\n\tError() error\n\n\t// Run runs the field individually.\n\tRun() error\n\n\t// Skip returns whether this input should be skipped or not.\n\tSkip() bool\n\n\t// Zoom returns whether this input should be zoomed or not.\n\t// Zoom allows the field to take focus of the group / form height.\n\tZoom() bool\n\n\t// KeyBinds returns help keybindings.\n\tKeyBinds() []key.Binding\n\n\t// WithTheme sets the theme on a field.\n\tWithTheme(*Theme) Field\n\n\t// WithAccessible sets whether the field should run in accessible mode.\n\tWithAccessible(bool) Field\n\n\t// WithKeyMap sets the keymap on a field.\n\tWithKeyMap(*KeyMap) Field\n\n\t// WithWidth sets the width of a field.\n\tWithWidth(int) Field\n\n\t// WithHeight sets the height of a field.\n\tWithHeight(int) Field\n\n\t// WithPosition tells the field the index of the group and position it is in.\n\tWithPosition(FieldPosition) Field\n\n\t// GetKey returns the field's key.\n\tGetKey() string\n\n\t// GetValue returns the field's value.\n\tGetValue() any\n}\n\n// FieldPosition is positional information about the given field and form.\ntype FieldPosition struct {\n\tGroup      int\n\tField      int\n\tFirstField int\n\tLastField  int\n\tGroupCount int\n\tFirstGroup int\n\tLastGroup  int\n}\n\n// IsFirst returns whether a field is the form's first field.\nfunc (p FieldPosition) IsFirst() bool {\n\treturn p.Field == p.FirstField && p.Group == p.FirstGroup\n}\n\n// IsLast returns whether a field is the form's last field.\nfunc (p FieldPosition) IsLast() bool {\n\treturn p.Field == p.LastField && p.Group == p.LastGroup\n}\n\n// nextGroupMsg is a message to move to the next group.\ntype nextGroupMsg struct{}\n\n// prevGroupMsg is a message to move to the previous group.\ntype prevGroupMsg struct{}\n\n// nextGroup is the command to move to the next group.\nfunc nextGroup() tea.Msg {\n\treturn nextGroupMsg{}\n}\n\n// prevGroup is the command to move to the previous group.\nfunc prevGroup() tea.Msg {\n\treturn prevGroupMsg{}\n}\n\n// WithAccessible sets the form to run in accessible mode to avoid redrawing the\n// views which makes it easier for screen readers to read and describe the form.\n//\n// This avoids using the Bubble Tea renderer and instead simply uses basic\n// terminal prompting to gather input which degrades the user experience but\n// provides accessibility.\nfunc (f *Form) WithAccessible(accessible bool) *Form {\n\tf.accessible = accessible\n\treturn f\n}\n\n// WithShowHelp sets whether or not the form should show help.\n//\n// This allows the form groups and field to show what keybindings are available\n// to the user.\nfunc (f *Form) WithShowHelp(v bool) *Form {\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.WithShowHelp(v)\n\t\treturn true\n\t})\n\treturn f\n}\n\n// WithShowErrors sets whether or not the form should show errors.\n//\n// This allows the form groups and fields to show errors when the Validate\n// function returns an error.\nfunc (f *Form) WithShowErrors(v bool) *Form {\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.WithShowErrors(v)\n\t\treturn true\n\t})\n\treturn f\n}\n\n// WithTheme sets the theme on a form.\n//\n// This allows all groups and fields to be themed consistently, however themes\n// can be applied to each group and field individually for more granular\n// control.\nfunc (f *Form) WithTheme(theme *Theme) *Form {\n\tif theme == nil {\n\t\treturn f\n\t}\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.WithTheme(theme)\n\t\treturn true\n\t})\n\treturn f\n}\n\n// WithKeyMap sets the keymap on a form.\n//\n// This allows customization of the form key bindings.\nfunc (f *Form) WithKeyMap(keymap *KeyMap) *Form {\n\tif keymap == nil {\n\t\treturn f\n\t}\n\tf.keymap = keymap\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.WithKeyMap(keymap)\n\t\treturn true\n\t})\n\tf.UpdateFieldPositions()\n\treturn f\n}\n\n// WithWidth sets the width of a form.\n//\n// This allows all groups and fields to be sized consistently, however width\n// can be applied to each group and field individually for more granular\n// control.\nfunc (f *Form) WithWidth(width int) *Form {\n\tif width <= 0 {\n\t\treturn f\n\t}\n\tf.width = width\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\twidth := f.layout.GroupWidth(f, group, width)\n\t\tgroup.WithWidth(width)\n\t\treturn true\n\t})\n\treturn f\n}\n\n// WithHeight sets the height of a form.\nfunc (f *Form) WithHeight(height int) *Form {\n\tif height <= 0 {\n\t\treturn f\n\t}\n\tf.height = height\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.WithHeight(height)\n\t\treturn true\n\t})\n\treturn f\n}\n\n// WithOutput sets the io.Writer to output the form.\nfunc (f *Form) WithOutput(w io.Writer) *Form {\n\tf.teaOptions = append(f.teaOptions, tea.WithOutput(w))\n\treturn f\n}\n\n// WithInput sets the io.Reader to the input form.\nfunc (f *Form) WithInput(r io.Reader) *Form {\n\tf.teaOptions = append(f.teaOptions, tea.WithInput(r))\n\treturn f\n}\n\n// WithTimeout sets the duration for the form to be killed.\nfunc (f *Form) WithTimeout(t time.Duration) *Form {\n\tf.timeout = t\n\treturn f\n}\n\n// WithProgramOptions sets the tea options of the form.\nfunc (f *Form) WithProgramOptions(opts ...tea.ProgramOption) *Form {\n\tf.teaOptions = opts\n\treturn f\n}\n\n// WithLayout sets the layout on a form.\n//\n// This allows customization of the form group layout.\nfunc (f *Form) WithLayout(layout Layout) *Form {\n\tf.layout = layout\n\treturn f\n}\n\n// UpdateFieldPositions sets the position on all the fields.\nfunc (f *Form) UpdateFieldPositions() *Form {\n\tfirstGroup := 0\n\tlastGroup := f.selector.Total() - 1\n\n\t// determine the first non-hidden group.\n\tf.selector.Range(func(_ int, g *Group) bool {\n\t\tif !f.isGroupHidden(g) {\n\t\t\treturn false\n\t\t}\n\t\tfirstGroup++\n\t\treturn true\n\t})\n\n\t// determine the last non-hidden group.\n\tf.selector.ReverseRange(func(_ int, g *Group) bool {\n\t\tif !f.isGroupHidden(g) {\n\t\t\treturn false\n\t\t}\n\t\tlastGroup--\n\t\treturn true\n\t})\n\n\tf.selector.Range(func(g int, group *Group) bool {\n\t\t// determine the first non-skippable field.\n\t\tvar firstField int\n\t\tgroup.selector.Range(func(_ int, field Field) bool {\n\t\t\tif !field.Skip() || group.selector.Total() == 1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tfirstField++\n\t\t\treturn true\n\t\t})\n\n\t\t// determine the last non-skippable field.\n\t\tvar lastField int\n\t\tgroup.selector.ReverseRange(func(i int, field Field) bool {\n\t\t\tlastField = i\n\t\t\tif !field.Skip() || group.selector.Total() == 1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\n\t\tgroup.selector.Range(func(i int, field Field) bool {\n\t\t\tfield.WithPosition(FieldPosition{\n\t\t\t\tGroup:      g,\n\t\t\t\tField:      i,\n\t\t\t\tFirstField: firstField,\n\t\t\t\tLastField:  lastField,\n\t\t\t\tFirstGroup: firstGroup,\n\t\t\t\tLastGroup:  lastGroup,\n\t\t\t})\n\t\t\treturn true\n\t\t})\n\n\t\treturn true\n\t})\n\treturn f\n}\n\n// Errors returns the current groups' errors.\nfunc (f *Form) Errors() []error {\n\treturn f.selector.Selected().Errors()\n}\n\n// Help returns the current groups' help.\nfunc (f *Form) Help() help.Model {\n\treturn f.selector.Selected().help\n}\n\n// KeyBinds returns the current fields' keybinds.\nfunc (f *Form) KeyBinds() []key.Binding {\n\tgroup := f.selector.Selected()\n\treturn group.selector.Selected().KeyBinds()\n}\n\n// Get returns a result from the form.\nfunc (f *Form) Get(key string) any {\n\treturn f.results[key]\n}\n\n// GetString returns a result as a string from the form.\nfunc (f *Form) GetString(key string) string {\n\tv, ok := f.results[key].(string)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn v\n}\n\n// GetInt returns a result as a int from the form.\nfunc (f *Form) GetInt(key string) int {\n\tv, ok := f.results[key].(int)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn v\n}\n\n// GetBool returns a result as a string from the form.\nfunc (f *Form) GetBool(key string) bool {\n\tv, ok := f.results[key].(bool)\n\tif !ok {\n\t\treturn false\n\t}\n\treturn v\n}\n\n// NextGroup moves the form to the next group.\nfunc (f *Form) NextGroup() tea.Cmd {\n\t_, cmd := f.Update(nextGroup())\n\treturn cmd\n}\n\n// PrevGroup moves the form to the next group.\nfunc (f *Form) PrevGroup() tea.Cmd {\n\t_, cmd := f.Update(prevGroup())\n\treturn cmd\n}\n\n// NextField moves the form to the next field.\nfunc (f *Form) NextField() tea.Cmd {\n\t_, cmd := f.Update(NextField())\n\treturn cmd\n}\n\n// NextField moves the form to the next field.\nfunc (f *Form) PrevField() tea.Cmd {\n\t_, cmd := f.Update(PrevField())\n\treturn cmd\n}\n\n// Init initializes the form.\nfunc (f *Form) Init() tea.Cmd {\n\tcmds := make([]tea.Cmd, f.selector.Total())\n\tf.selector.Range(func(i int, group *Group) bool {\n\t\tif i == 0 {\n\t\t\tgroup.active = true\n\t\t}\n\t\tcmds[i] = group.Init()\n\t\treturn true\n\t})\n\n\tif f.isGroupHidden(f.selector.Selected()) {\n\t\tcmds = append(cmds, nextGroup)\n\t}\n\n\treturn tea.Batch(cmds...)\n}\n\n// Update updates the form.\nfunc (f *Form) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\t// If the form is aborted or completed there's no need to update it.\n\tif f.State != StateNormal {\n\t\treturn f, nil\n\t}\n\n\tgroup := f.selector.Selected()\n\n\tswitch msg := msg.(type) {\n\tcase tea.WindowSizeMsg:\n\t\tif f.width > 0 {\n\t\t\tbreak\n\t\t}\n\t\tf.selector.Range(func(_ int, group *Group) bool {\n\t\t\twidth := f.layout.GroupWidth(f, group, msg.Width)\n\t\t\tgroup.WithWidth(width)\n\t\t\treturn true\n\t\t})\n\t\tif f.height > 0 {\n\t\t\tbreak\n\t\t}\n\t\tf.selector.Range(func(_ int, group *Group) bool {\n\t\t\tif group.fullHeight() > msg.Height {\n\t\t\t\tgroup.WithHeight(msg.Height)\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\tcase tea.KeyMsg:\n\t\tswitch {\n\t\tcase key.Matches(msg, f.keymap.Quit):\n\t\t\tf.aborted = true\n\t\t\tf.quitting = true\n\t\t\tf.State = StateAborted\n\t\t\treturn f, f.CancelCmd\n\t\t}\n\n\tcase nextFieldMsg:\n\t\t// Form is progressing to the next field, let's save the value of the current field.\n\t\tfield := group.selector.Selected()\n\t\tf.results[field.GetKey()] = field.GetValue()\n\n\tcase nextGroupMsg:\n\t\tif len(group.Errors()) > 0 {\n\t\t\treturn f, nil\n\t\t}\n\n\t\tsubmit := func() (tea.Model, tea.Cmd) {\n\t\t\tf.quitting = true\n\t\t\tf.State = StateCompleted\n\t\t\treturn f, f.SubmitCmd\n\t\t}\n\n\t\tif f.selector.OnLast() {\n\t\t\treturn submit()\n\t\t}\n\n\t\tfor i := f.selector.Index() + 1; i < f.selector.Total(); i++ {\n\t\t\tif !f.isGroupHidden(f.selector.Get(i)) {\n\t\t\t\tf.selector.SetIndex(i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// all subsequent groups are hidden, so we must act as\n\t\t\t// if we were in the last one.\n\t\t\tif i == f.selector.Total()-1 {\n\t\t\t\treturn submit()\n\t\t\t}\n\t\t}\n\t\tf.selector.Selected().active = true\n\t\treturn f, f.selector.Selected().Init()\n\n\tcase prevGroupMsg:\n\t\tif len(group.Errors()) > 0 {\n\t\t\treturn f, nil\n\t\t}\n\n\t\tfor i := f.selector.Index() - 1; i >= 0; i-- {\n\t\t\tif !f.isGroupHidden(f.selector.Get(i)) {\n\t\t\t\tf.selector.SetIndex(i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tf.selector.Selected().active = true\n\t\treturn f, f.selector.Selected().Init()\n\t}\n\n\tm, cmd := group.Update(msg)\n\tf.selector.Set(f.selector.Index(), m.(*Group))\n\n\t// A user input a key, this could hide or show other groups,\n\t// let's update all of their positions.\n\tswitch msg.(type) {\n\tcase tea.KeyMsg:\n\t\tf.UpdateFieldPositions()\n\t}\n\n\treturn f, cmd\n}\n\nfunc (f *Form) isGroupHidden(group *Group) bool {\n\thide := group.hide\n\tif hide == nil {\n\t\treturn false\n\t}\n\treturn hide()\n}\n\n// View renders the form.\nfunc (f *Form) View() string {\n\tif f.quitting {\n\t\treturn \"\"\n\t}\n\n\treturn f.layout.View(f)\n}\n\n// Run runs the form.\nfunc (f *Form) Run() error {\n\treturn f.RunWithContext(context.Background())\n}\n\n// RunWithContext runs the form with the given context.\nfunc (f *Form) RunWithContext(ctx context.Context) error {\n\tf.SubmitCmd = tea.Quit\n\tf.CancelCmd = tea.Quit\n\n\tif f.selector.Total() == 0 {\n\t\treturn nil\n\t}\n\n\tif f.accessible {\n\t\treturn f.runAccessible()\n\t}\n\n\treturn f.run(ctx)\n}\n\n// run runs the form in normal mode.\nfunc (f *Form) run(ctx context.Context) error {\n\tif f.timeout > 0 {\n\t\tctx, cancel := context.WithTimeout(ctx, f.timeout)\n\t\tdefer cancel()\n\t\tf.teaOptions = append(f.teaOptions, tea.WithContext(ctx), tea.WithReportFocus())\n\t} else {\n\t\tf.teaOptions = append(f.teaOptions, tea.WithContext(ctx), tea.WithReportFocus())\n\t}\n\n\tm, err := tea.NewProgram(f, f.teaOptions...).Run()\n\tif m.(*Form).aborted {\n\t\treturn ErrUserAborted\n\t}\n\tif errors.Is(err, tea.ErrProgramKilled) {\n\t\treturn ErrTimeout\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"huh: %w\", err)\n\t}\n\treturn nil\n}\n\n// runAccessible runs the form in accessible mode.\nfunc (f *Form) runAccessible() error {\n\t// Timeouts are not supported in this mode.\n\tif f.timeout > 0 {\n\t\treturn ErrTimeoutUnsupported\n\t}\n\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tgroup.selector.Range(func(_ int, field Field) bool {\n\t\t\tfield.Init()\n\t\t\tfield.Focus()\n\t\t\t_ = field.WithAccessible(true).Run()\n\t\t\treturn true\n\t\t})\n\t\treturn true\n\t})\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/group.go",
    "content": "package huh\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/bubbles/help\"\n\t\"github.com/charmbracelet/bubbles/viewport\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/huh/internal/selector\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Group is a collection of fields that are displayed together with a page of\n// the form. While a group is displayed the form completer can switch between\n// fields in the group.\n//\n// If any of the fields in a group have errors, the form will not be able to\n// progress to the next group.\ntype Group struct {\n\t// collection of fields\n\tselector *selector.Selector[Field]\n\n\t// information\n\ttitle       string\n\tdescription string\n\n\t// navigation\n\tviewport viewport.Model\n\n\t// help\n\tshowHelp bool\n\thelp     help.Model\n\n\t// errors\n\tshowErrors bool\n\n\t// group options\n\twidth  int\n\theight int\n\tkeymap *KeyMap\n\thide   func() bool\n\tactive bool\n}\n\n// NewGroup returns a new group with the given fields.\nfunc NewGroup(fields ...Field) *Group {\n\tselector := selector.NewSelector(fields)\n\tgroup := &Group{\n\t\tselector:   selector,\n\t\thelp:       help.New(),\n\t\tshowHelp:   true,\n\t\tshowErrors: true,\n\t\tactive:     false,\n\t}\n\n\theight := group.fullHeight()\n\tv := viewport.New(80, height) //nolint:mnd\n\tgroup.viewport = v\n\tgroup.height = height\n\n\treturn group\n}\n\n// Title sets the group's title.\nfunc (g *Group) Title(title string) *Group {\n\tg.title = title\n\treturn g\n}\n\n// Description sets the group's description.\nfunc (g *Group) Description(description string) *Group {\n\tg.description = description\n\treturn g\n}\n\n// WithShowHelp sets whether or not the group's help should be shown.\nfunc (g *Group) WithShowHelp(show bool) *Group {\n\tg.showHelp = show\n\treturn g\n}\n\n// WithShowErrors sets whether or not the group's errors should be shown.\nfunc (g *Group) WithShowErrors(show bool) *Group {\n\tg.showErrors = show\n\treturn g\n}\n\n// WithTheme sets the theme on a group.\nfunc (g *Group) WithTheme(t *Theme) *Group {\n\tg.help.Styles = t.Help\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\tfield.WithTheme(t)\n\t\treturn true\n\t})\n\tif g.height <= 0 {\n\t\tg.WithHeight(g.fullHeight())\n\t}\n\treturn g\n}\n\n// WithKeyMap sets the keymap on a group.\nfunc (g *Group) WithKeyMap(k *KeyMap) *Group {\n\tg.keymap = k\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\tfield.WithKeyMap(k)\n\t\treturn true\n\t})\n\treturn g\n}\n\n// WithWidth sets the width on a group.\nfunc (g *Group) WithWidth(width int) *Group {\n\tg.width = width\n\tg.viewport.Width = width\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\tfield.WithWidth(width)\n\t\treturn true\n\t})\n\treturn g\n}\n\n// WithHeight sets the height on a group.\nfunc (g *Group) WithHeight(height int) *Group {\n\tg.height = height\n\tg.viewport.Height = height\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\t// A field height must not exceed the form height.\n\t\tif height-1 <= lipgloss.Height(field.View()) {\n\t\t\tfield.WithHeight(height)\n\t\t}\n\t\treturn true\n\t})\n\treturn g\n}\n\n// WithHide sets whether this group should be skipped.\nfunc (g *Group) WithHide(hide bool) *Group {\n\tg.WithHideFunc(func() bool { return hide })\n\treturn g\n}\n\n// WithHideFunc sets the function that checks if this group should be skipped.\nfunc (g *Group) WithHideFunc(hideFunc func() bool) *Group {\n\tg.hide = hideFunc\n\treturn g\n}\n\n// Errors returns the groups' fields' errors.\nfunc (g *Group) Errors() []error {\n\tvar errs []error\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\tif err := field.Error(); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t\treturn true\n\t})\n\treturn errs\n}\n\n// updateFieldMsg is a message to update the fields of a group that is currently\n// displayed.\n//\n// This is used to update all TitleFunc, DescriptionFunc, and ...Func update\n// methods to make all fields dynamically update based on user input.\ntype updateFieldMsg struct{}\n\n// nextFieldMsg is a message to move to the next field,\n//\n// each field controls when to send this message such that it is able to use\n// different key bindings or events to trigger group progression.\ntype nextFieldMsg struct{}\n\n// prevFieldMsg is a message to move to the previous field.\n//\n// each field controls when to send this message such that it is able to use\n// different key bindings or events to trigger group progression.\ntype prevFieldMsg struct{}\n\n// NextField is the command to move to the next field.\nfunc NextField() tea.Msg {\n\treturn nextFieldMsg{}\n}\n\n// PrevField is the command to move to the previous field.\nfunc PrevField() tea.Msg {\n\treturn prevFieldMsg{}\n}\n\n// Init initializes the group.\nfunc (g *Group) Init() tea.Cmd {\n\tvar cmds []tea.Cmd\n\n\tif g.selector.Selected().Skip() {\n\t\tif g.selector.OnLast() {\n\t\t\tcmds = append(cmds, g.prevField()...)\n\t\t} else if g.selector.OnFirst() {\n\t\t\tcmds = append(cmds, g.nextField()...)\n\t\t}\n\t\treturn tea.Batch(cmds...)\n\t}\n\n\tif g.active {\n\t\tcmd := g.selector.Selected().Focus()\n\t\tcmds = append(cmds, cmd)\n\t}\n\tg.buildView()\n\treturn tea.Batch(cmds...)\n}\n\n// nextField moves to the next field.\nfunc (g *Group) nextField() []tea.Cmd {\n\tblurCmd := g.selector.Selected().Blur()\n\tif g.selector.OnLast() {\n\t\treturn []tea.Cmd{blurCmd, nextGroup}\n\t}\n\tg.selector.Next()\n\tfor g.selector.Selected().Skip() {\n\t\tif g.selector.OnLast() {\n\t\t\treturn []tea.Cmd{blurCmd, nextGroup}\n\t\t}\n\t\tg.selector.Next()\n\t}\n\tfocusCmd := g.selector.Selected().Focus()\n\treturn []tea.Cmd{blurCmd, focusCmd}\n}\n\n// prevField moves to the previous field.\nfunc (g *Group) prevField() []tea.Cmd {\n\tblurCmd := g.selector.Selected().Blur()\n\tif g.selector.OnFirst() {\n\t\treturn []tea.Cmd{blurCmd, prevGroup}\n\t}\n\tg.selector.Prev()\n\tfor g.selector.Selected().Skip() {\n\t\tif g.selector.OnFirst() {\n\t\t\treturn []tea.Cmd{blurCmd, prevGroup}\n\t\t}\n\t\tg.selector.Prev()\n\t}\n\tfocusCmd := g.selector.Selected().Focus()\n\treturn []tea.Cmd{blurCmd, focusCmd}\n}\n\n// Update updates the group.\nfunc (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tvar cmds []tea.Cmd\n\n\t// Update all the fields in the group.\n\tg.selector.Range(func(i int, field Field) bool {\n\t\tswitch msg := msg.(type) {\n\t\tcase tea.KeyMsg:\n\t\t\tbreak\n\t\tdefault:\n\t\t\tm, cmd := field.Update(msg)\n\t\t\tg.selector.Set(i, m.(Field))\n\t\t\tcmds = append(cmds, cmd)\n\t\t}\n\t\tif g.selector.Index() == i {\n\t\t\tm, cmd := field.Update(msg)\n\t\t\tg.selector.Set(i, m.(Field))\n\t\t\tcmds = append(cmds, cmd)\n\t\t}\n\t\tm, cmd := field.Update(updateFieldMsg{})\n\t\tg.selector.Set(i, m.(Field))\n\t\tcmds = append(cmds, cmd)\n\t\treturn true\n\t})\n\n\tswitch msg := msg.(type) {\n\tcase tea.WindowSizeMsg:\n\t\tg.WithHeight(max(g.height, min(g.fullHeight(), msg.Height-1)))\n\tcase nextFieldMsg:\n\t\tcmds = append(cmds, g.nextField()...)\n\tcase prevFieldMsg:\n\t\tcmds = append(cmds, g.prevField()...)\n\t}\n\n\tg.buildView()\n\n\treturn g, tea.Batch(cmds...)\n}\n\n// height returns the full height of the group.\nfunc (g *Group) fullHeight() int {\n\theight := g.selector.Total()\n\tg.selector.Range(func(_ int, field Field) bool {\n\t\theight += lipgloss.Height(field.View())\n\t\treturn true\n\t})\n\treturn height\n}\n\nfunc (g *Group) getContent() (int, string) {\n\tvar fields strings.Builder\n\toffset := 0\n\tgap := \"\\n\\n\"\n\n\t// if the focused field is requesting it be zoomed, only show that field.\n\tif g.selector.Selected().Zoom() {\n\t\tg.selector.Selected().WithHeight(g.height - 1)\n\t\tfields.WriteString(g.selector.Selected().View())\n\t} else {\n\t\tg.selector.Range(func(i int, field Field) bool {\n\t\t\tfields.WriteString(field.View())\n\t\t\tif i == g.selector.Index() {\n\t\t\t\toffset = lipgloss.Height(fields.String()) - lipgloss.Height(field.View())\n\t\t\t}\n\t\t\tif i < g.selector.Total()-1 {\n\t\t\t\tfields.WriteString(gap)\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t}\n\n\treturn offset, fields.String() + \"\\n\"\n}\n\nfunc (g *Group) buildView() {\n\toffset, content := g.getContent()\n\n\tg.viewport.SetContent(content)\n\tg.viewport.SetYOffset(offset)\n}\n\n// View renders the group.\nfunc (g *Group) View() string {\n\tvar view strings.Builder\n\tview.WriteString(g.viewport.View())\n\tview.WriteString(g.Footer())\n\treturn view.String()\n}\n\n// Content renders the group's content only (no footer).\nfunc (g *Group) Content() string {\n\t_, content := g.getContent()\n\treturn content\n}\n\n// Footer renders the group's footer only (no content).\nfunc (g *Group) Footer() string {\n\tvar view strings.Builder\n\tview.WriteRune('\\n')\n\terrors := g.Errors()\n\tif g.showHelp && len(errors) <= 0 {\n\t\tview.WriteString(g.help.ShortHelpView(g.selector.Selected().KeyBinds()))\n\t}\n\tif g.showErrors {\n\t\tfor _, err := range errors {\n\t\t\tview.WriteString(ThemeCharm().Focused.ErrorMessage.Render(err.Error()))\n\t\t}\n\t}\n\treturn view.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/internal/selector/selector.go",
    "content": "package selector\n\n// Selector is a helper type for selecting items.\ntype Selector[T any] struct {\n\titems []T\n\tindex int\n}\n\n// NewSelector creates a new item selector.\nfunc NewSelector[T any](items []T) *Selector[T] {\n\treturn &Selector[T]{\n\t\titems: items,\n\t}\n}\n\n// Append adds an item to the selector.\nfunc (s *Selector[T]) Append(item T) {\n\ts.items = append(s.items, item)\n}\n\n// Next moves the selector to the next item.\nfunc (s *Selector[T]) Next() {\n\tif s.index < len(s.items)-1 {\n\t\ts.index++\n\t}\n}\n\n// Prev moves the selector to the previous item.\nfunc (s *Selector[T]) Prev() {\n\tif s.index > 0 {\n\t\ts.index--\n\t}\n}\n\n// OnFirst returns true if the selector is on the first item.\nfunc (s *Selector[T]) OnFirst() bool {\n\treturn s.index == 0\n}\n\n// OnLast returns true if the selector is on the last item.\nfunc (s *Selector[T]) OnLast() bool {\n\treturn s.index == len(s.items)-1\n}\n\n// Selected returns the index of the current selected item.\nfunc (s *Selector[T]) Selected() T {\n\treturn s.items[s.index]\n}\n\n// Index returns the index of the current selected item.\nfunc (s *Selector[T]) Index() int {\n\treturn s.index\n}\n\n// Totoal returns the total number of items.\nfunc (s *Selector[T]) Total() int {\n\treturn len(s.items)\n}\n\n// SetIndex sets the selected item.\nfunc (s *Selector[T]) SetIndex(i int) {\n\tif i < 0 || i >= len(s.items) {\n\t\treturn\n\t}\n\ts.index = i\n}\n\n// Get returns the item at the given index.\nfunc (s *Selector[T]) Get(i int) T {\n\treturn s.items[i]\n}\n\n// Set sets the item at the given index.\nfunc (s *Selector[T]) Set(i int, item T) {\n\ts.items[i] = item\n}\n\n// Range iterates over the items.\n// The callback function should return true to continue the iteration.\nfunc (s *Selector[T]) Range(f func(i int, item T) bool) {\n\tfor i, item := range s.items {\n\t\tif !f(i, item) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// ReverseRange iterates over the items in reverse.\n// The callback function should return true to continue the iteration.\nfunc (s *Selector[T]) ReverseRange(f func(i int, item T) bool) {\n\tfor i := len(s.items) - 1; i >= 0; i-- {\n\t\tif !f(i, s.items[i]) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/keymap.go",
    "content": "package huh\n\nimport \"github.com/charmbracelet/bubbles/key\"\n\n// KeyMap is the keybindings to navigate the form.\ntype KeyMap struct {\n\tQuit key.Binding\n\n\tConfirm     ConfirmKeyMap\n\tFilePicker  FilePickerKeyMap\n\tInput       InputKeyMap\n\tMultiSelect MultiSelectKeyMap\n\tNote        NoteKeyMap\n\tSelect      SelectKeyMap\n\tText        TextKeyMap\n}\n\n// InputKeyMap is the keybindings for input fields.\ntype InputKeyMap struct {\n\tAcceptSuggestion key.Binding\n\tNext             key.Binding\n\tPrev             key.Binding\n\tSubmit           key.Binding\n}\n\n// TextKeyMap is the keybindings for text fields.\ntype TextKeyMap struct {\n\tNext    key.Binding\n\tPrev    key.Binding\n\tNewLine key.Binding\n\tEditor  key.Binding\n\tSubmit  key.Binding\n}\n\n// SelectKeyMap is the keybindings for select fields.\ntype SelectKeyMap struct {\n\tNext         key.Binding\n\tPrev         key.Binding\n\tUp           key.Binding\n\tDown         key.Binding\n\tHalfPageUp   key.Binding\n\tHalfPageDown key.Binding\n\tGotoTop      key.Binding\n\tGotoBottom   key.Binding\n\tLeft         key.Binding\n\tRight        key.Binding\n\tFilter       key.Binding\n\tSetFilter    key.Binding\n\tClearFilter  key.Binding\n\tSubmit       key.Binding\n}\n\n// MultiSelectKeyMap is the keybindings for multi-select fields.\ntype MultiSelectKeyMap struct {\n\tNext         key.Binding\n\tPrev         key.Binding\n\tUp           key.Binding\n\tDown         key.Binding\n\tHalfPageUp   key.Binding\n\tHalfPageDown key.Binding\n\tGotoTop      key.Binding\n\tGotoBottom   key.Binding\n\tToggle       key.Binding\n\tFilter       key.Binding\n\tSetFilter    key.Binding\n\tClearFilter  key.Binding\n\tSubmit       key.Binding\n\tSelectAll    key.Binding\n\tSelectNone   key.Binding\n}\n\n// FilePickerKey is the keybindings for filepicker fields.\ntype FilePickerKeyMap struct {\n\tOpen     key.Binding\n\tClose    key.Binding\n\tGoToTop  key.Binding\n\tGoToLast key.Binding\n\tPageUp   key.Binding\n\tPageDown key.Binding\n\tBack     key.Binding\n\tSelect   key.Binding\n\tUp       key.Binding\n\tDown     key.Binding\n\tPrev     key.Binding\n\tNext     key.Binding\n\tSubmit   key.Binding\n}\n\n// NoteKeyMap is the keybindings for note fields.\ntype NoteKeyMap struct {\n\tNext   key.Binding\n\tPrev   key.Binding\n\tSubmit key.Binding\n}\n\n// ConfirmKeyMap is the keybindings for confirm fields.\ntype ConfirmKeyMap struct {\n\tNext   key.Binding\n\tPrev   key.Binding\n\tToggle key.Binding\n\tSubmit key.Binding\n\tAccept key.Binding\n\tReject key.Binding\n}\n\n// NewDefaultKeyMap returns a new default keymap.\nfunc NewDefaultKeyMap() *KeyMap {\n\treturn &KeyMap{\n\t\tQuit: key.NewBinding(key.WithKeys(\"ctrl+c\")),\n\t\tInput: InputKeyMap{\n\t\t\tAcceptSuggestion: key.NewBinding(key.WithKeys(\"ctrl+e\"), key.WithHelp(\"ctrl+e\", \"complete\")),\n\t\t\tPrev:             key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:             key.NewBinding(key.WithKeys(\"enter\", \"tab\"), key.WithHelp(\"enter\", \"next\")),\n\t\t\tSubmit:           key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t},\n\t\tFilePicker: FilePickerKeyMap{\n\t\t\tGoToTop:  key.NewBinding(key.WithKeys(\"g\"), key.WithHelp(\"g\", \"first\"), key.WithDisabled()),\n\t\t\tGoToLast: key.NewBinding(key.WithKeys(\"G\"), key.WithHelp(\"G\", \"last\"), key.WithDisabled()),\n\t\t\tPageUp:   key.NewBinding(key.WithKeys(\"K\", \"pgup\"), key.WithHelp(\"pgup\", \"page up\"), key.WithDisabled()),\n\t\t\tPageDown: key.NewBinding(key.WithKeys(\"J\", \"pgdown\"), key.WithHelp(\"pgdown\", \"page down\"), key.WithDisabled()),\n\t\t\tBack:     key.NewBinding(key.WithKeys(\"h\", \"backspace\", \"left\", \"esc\"), key.WithHelp(\"h\", \"back\"), key.WithDisabled()),\n\t\t\tSelect:   key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"select\"), key.WithDisabled()),\n\t\t\tUp:       key.NewBinding(key.WithKeys(\"up\", \"k\", \"ctrl+k\", \"ctrl+p\"), key.WithHelp(\"↑\", \"up\"), key.WithDisabled()),\n\t\t\tDown:     key.NewBinding(key.WithKeys(\"down\", \"j\", \"ctrl+j\", \"ctrl+n\"), key.WithHelp(\"↓\", \"down\"), key.WithDisabled()),\n\n\t\t\tOpen:   key.NewBinding(key.WithKeys(\"l\", \"right\", \"enter\"), key.WithHelp(\"enter\", \"open\")),\n\t\t\tClose:  key.NewBinding(key.WithKeys(\"esc\"), key.WithHelp(\"esc\", \"close\"), key.WithDisabled()),\n\t\t\tPrev:   key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:   key.NewBinding(key.WithKeys(\"tab\"), key.WithHelp(\"tab\", \"next\")),\n\t\t\tSubmit: key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t},\n\t\tText: TextKeyMap{\n\t\t\tPrev:    key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:    key.NewBinding(key.WithKeys(\"tab\", \"enter\"), key.WithHelp(\"enter\", \"next\")),\n\t\t\tSubmit:  key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t\tNewLine: key.NewBinding(key.WithKeys(\"alt+enter\", \"ctrl+j\"), key.WithHelp(\"alt+enter / ctrl+j\", \"new line\")),\n\t\t\tEditor:  key.NewBinding(key.WithKeys(\"ctrl+e\"), key.WithHelp(\"ctrl+e\", \"open editor\")),\n\t\t},\n\t\tSelect: SelectKeyMap{\n\t\t\tPrev:         key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:         key.NewBinding(key.WithKeys(\"enter\", \"tab\"), key.WithHelp(\"enter\", \"select\")),\n\t\t\tSubmit:       key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t\tUp:           key.NewBinding(key.WithKeys(\"up\", \"k\", \"ctrl+k\", \"ctrl+p\"), key.WithHelp(\"↑\", \"up\")),\n\t\t\tDown:         key.NewBinding(key.WithKeys(\"down\", \"j\", \"ctrl+j\", \"ctrl+n\"), key.WithHelp(\"↓\", \"down\")),\n\t\t\tLeft:         key.NewBinding(key.WithKeys(\"h\", \"left\"), key.WithHelp(\"←\", \"left\"), key.WithDisabled()),\n\t\t\tRight:        key.NewBinding(key.WithKeys(\"l\", \"right\"), key.WithHelp(\"→\", \"right\"), key.WithDisabled()),\n\t\t\tFilter:       key.NewBinding(key.WithKeys(\"/\"), key.WithHelp(\"/\", \"filter\")),\n\t\t\tSetFilter:    key.NewBinding(key.WithKeys(\"esc\"), key.WithHelp(\"esc\", \"set filter\"), key.WithDisabled()),\n\t\t\tClearFilter:  key.NewBinding(key.WithKeys(\"esc\"), key.WithHelp(\"esc\", \"clear filter\"), key.WithDisabled()),\n\t\t\tHalfPageUp:   key.NewBinding(key.WithKeys(\"ctrl+u\"), key.WithHelp(\"ctrl+u\", \"½ page up\")),\n\t\t\tHalfPageDown: key.NewBinding(key.WithKeys(\"ctrl+d\"), key.WithHelp(\"ctrl+d\", \"½ page down\")),\n\t\t\tGotoTop:      key.NewBinding(key.WithKeys(\"home\", \"g\"), key.WithHelp(\"g/home\", \"go to start\")),\n\t\t\tGotoBottom:   key.NewBinding(key.WithKeys(\"end\", \"G\"), key.WithHelp(\"G/end\", \"go to end\")),\n\t\t},\n\t\tMultiSelect: MultiSelectKeyMap{\n\t\t\tPrev:         key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:         key.NewBinding(key.WithKeys(\"enter\", \"tab\"), key.WithHelp(\"enter\", \"confirm\")),\n\t\t\tSubmit:       key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t\tToggle:       key.NewBinding(key.WithKeys(\" \", \"x\"), key.WithHelp(\"x\", \"toggle\")),\n\t\t\tUp:           key.NewBinding(key.WithKeys(\"up\", \"k\", \"ctrl+p\"), key.WithHelp(\"↑\", \"up\")),\n\t\t\tDown:         key.NewBinding(key.WithKeys(\"down\", \"j\", \"ctrl+n\"), key.WithHelp(\"↓\", \"down\")),\n\t\t\tFilter:       key.NewBinding(key.WithKeys(\"/\"), key.WithHelp(\"/\", \"filter\")),\n\t\t\tSetFilter:    key.NewBinding(key.WithKeys(\"enter\", \"esc\"), key.WithHelp(\"esc\", \"set filter\"), key.WithDisabled()),\n\t\t\tClearFilter:  key.NewBinding(key.WithKeys(\"esc\"), key.WithHelp(\"esc\", \"clear filter\"), key.WithDisabled()),\n\t\t\tHalfPageUp:   key.NewBinding(key.WithKeys(\"ctrl+u\"), key.WithHelp(\"ctrl+u\", \"½ page up\")),\n\t\t\tHalfPageDown: key.NewBinding(key.WithKeys(\"ctrl+d\"), key.WithHelp(\"ctrl+d\", \"½ page down\")),\n\t\t\tGotoTop:      key.NewBinding(key.WithKeys(\"home\", \"g\"), key.WithHelp(\"g/home\", \"go to start\")),\n\t\t\tGotoBottom:   key.NewBinding(key.WithKeys(\"end\", \"G\"), key.WithHelp(\"G/end\", \"go to end\")),\n\t\t\tSelectAll:    key.NewBinding(key.WithKeys(\"ctrl+a\"), key.WithHelp(\"ctrl+a\", \"select all\")),\n\t\t\tSelectNone:   key.NewBinding(key.WithKeys(\"ctrl+a\"), key.WithHelp(\"ctrl+a\", \"select none\"), key.WithDisabled()),\n\t\t},\n\t\tNote: NoteKeyMap{\n\t\t\tPrev:   key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:   key.NewBinding(key.WithKeys(\"enter\", \"tab\"), key.WithHelp(\"enter\", \"next\")),\n\t\t\tSubmit: key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t},\n\t\tConfirm: ConfirmKeyMap{\n\t\t\tPrev:   key.NewBinding(key.WithKeys(\"shift+tab\"), key.WithHelp(\"shift+tab\", \"back\")),\n\t\t\tNext:   key.NewBinding(key.WithKeys(\"enter\", \"tab\"), key.WithHelp(\"enter\", \"next\")),\n\t\t\tSubmit: key.NewBinding(key.WithKeys(\"enter\"), key.WithHelp(\"enter\", \"submit\")),\n\t\t\tToggle: key.NewBinding(key.WithKeys(\"h\", \"l\", \"right\", \"left\"), key.WithHelp(\"←/→\", \"toggle\")),\n\t\t\tAccept: key.NewBinding(key.WithKeys(\"y\", \"Y\"), key.WithHelp(\"y\", \"Yes\")),\n\t\t\tReject: key.NewBinding(key.WithKeys(\"n\", \"N\"), key.WithHelp(\"n\", \"No\")),\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/layout.go",
    "content": "package huh\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// A Layout is responsible for laying out groups in a form.\ntype Layout interface {\n\tView(f *Form) string\n\tGroupWidth(f *Form, g *Group, w int) int\n}\n\n// Default layout shows a single group at a time.\nvar LayoutDefault Layout = &layoutDefault{}\n\n// Stack layout stacks all groups on top of each other.\nvar LayoutStack Layout = &layoutStack{}\n\n// Column layout distributes groups in even columns.\nfunc LayoutColumns(columns int) Layout {\n\treturn &layoutColumns{columns: columns}\n}\n\n// Grid layout distributes groups in a grid.\nfunc LayoutGrid(rows int, columns int) Layout {\n\treturn &layoutGrid{rows: rows, columns: columns}\n}\n\ntype layoutDefault struct{}\n\nfunc (l *layoutDefault) View(f *Form) string {\n\treturn f.selector.Selected().View()\n}\n\nfunc (l *layoutDefault) GroupWidth(_ *Form, _ *Group, w int) int {\n\treturn w\n}\n\ntype layoutColumns struct {\n\tcolumns int\n}\n\nfunc (l *layoutColumns) visibleGroups(f *Form) []*Group {\n\tsegmentIndex := f.selector.Index() / l.columns\n\tstart := segmentIndex * l.columns\n\tend := start + l.columns\n\n\ttotal := f.selector.Total()\n\tif end > total {\n\t\tend = total\n\t}\n\n\tvar groups []*Group\n\tf.selector.Range(func(i int, group *Group) bool {\n\t\tif i >= start && i < end {\n\t\t\tgroups = append(groups, group)\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\n\treturn groups\n}\n\nfunc (l *layoutColumns) View(f *Form) string {\n\tgroups := l.visibleGroups(f)\n\tif len(groups) == 0 {\n\t\treturn \"\"\n\t}\n\n\tcolumns := make([]string, 0, len(groups))\n\tfor _, group := range groups {\n\t\tcolumns = append(columns, group.Content())\n\t}\n\tfooter := f.selector.Selected().Footer()\n\n\treturn lipgloss.JoinVertical(lipgloss.Left,\n\t\tlipgloss.JoinHorizontal(lipgloss.Top, columns...),\n\t\tfooter,\n\t)\n}\n\nfunc (l *layoutColumns) GroupWidth(_ *Form, _ *Group, w int) int {\n\treturn w / l.columns\n}\n\ntype layoutStack struct{}\n\nfunc (l *layoutStack) View(f *Form) string {\n\tvar columns []string\n\tf.selector.Range(func(_ int, group *Group) bool {\n\t\tcolumns = append(columns, group.Content())\n\t\treturn true\n\t})\n\tfooter := f.selector.Selected().Footer()\n\n\tvar view strings.Builder\n\tview.WriteString(strings.Join(columns, \"\\n\"))\n\tview.WriteString(footer)\n\treturn view.String()\n}\n\nfunc (l *layoutStack) GroupWidth(_ *Form, _ *Group, w int) int {\n\treturn w\n}\n\ntype layoutGrid struct {\n\trows, columns int\n}\n\nfunc (l *layoutGrid) visibleGroups(f *Form) [][]*Group {\n\ttotal := l.rows * l.columns\n\tsegmentIndex := f.selector.Index() / total\n\tstart := segmentIndex * total\n\tend := start + total\n\n\tif glen := f.selector.Total(); end > glen {\n\t\tend = glen\n\t}\n\n\tvar visible []*Group\n\tf.selector.Range(func(i int, group *Group) bool {\n\t\tif i >= start && i < end {\n\t\t\tvisible = append(visible, group)\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\tgrid := make([][]*Group, l.rows)\n\tfor i := 0; i < l.rows; i++ {\n\t\tstartRow := i * l.columns\n\t\tendRow := startRow + l.columns\n\t\tif startRow >= len(visible) {\n\t\t\tbreak\n\t\t}\n\t\tif endRow > len(visible) {\n\t\t\tendRow = len(visible)\n\t\t}\n\t\tgrid[i] = visible[startRow:endRow]\n\t}\n\treturn grid\n}\n\nfunc (l *layoutGrid) View(f *Form) string {\n\tgrid := l.visibleGroups(f)\n\tif len(grid) == 0 {\n\t\treturn \"\"\n\t}\n\n\trows := make([]string, 0, len(grid))\n\tfor _, row := range grid {\n\t\tvar columns []string\n\t\tfor _, group := range row {\n\t\t\tcolumns = append(columns, group.Content())\n\t\t}\n\t\trows = append(rows, lipgloss.JoinHorizontal(lipgloss.Top, columns...))\n\t}\n\tfooter := f.selector.Selected().Footer()\n\n\treturn lipgloss.JoinVertical(lipgloss.Left, strings.Join(rows, \"\\n\"), footer)\n}\n\nfunc (l *layoutGrid) GroupWidth(_ *Form, _ *Group, w int) int {\n\treturn w / l.columns\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/option.go",
    "content": "package huh\n\nimport \"fmt\"\n\n// Option is an option for select fields.\ntype Option[T comparable] struct {\n\tKey      string\n\tValue    T\n\tselected bool\n}\n\n// NewOptions returns new options from a list of values.\nfunc NewOptions[T comparable](values ...T) []Option[T] {\n\toptions := make([]Option[T], len(values))\n\tfor i, o := range values {\n\t\toptions[i] = Option[T]{\n\t\t\tKey:   fmt.Sprint(o),\n\t\t\tValue: o,\n\t\t}\n\t}\n\treturn options\n}\n\n// NewOption returns a new select option.\nfunc NewOption[T comparable](key string, value T) Option[T] {\n\treturn Option[T]{Key: key, Value: value}\n}\n\n// Selected sets whether the option is currently selected.\nfunc (o Option[T]) Selected(selected bool) Option[T] {\n\to.selected = selected\n\treturn o\n}\n\n// String returns the key of the option.\nfunc (o Option[T]) String() string {\n\treturn o.Key\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/run.go",
    "content": "package huh\n\n// Run runs a single field by wrapping it within a group and a form.\nfunc Run(field Field) error {\n\tgroup := NewGroup(field)\n\tform := NewForm(group).WithShowHelp(false)\n\treturn form.Run()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/theme.go",
    "content": "package huh\n\nimport (\n\tcatppuccin \"github.com/catppuccin/go\"\n\t\"github.com/charmbracelet/bubbles/help\"\n\t\"github.com/charmbracelet/lipgloss\"\n)\n\n// Theme is a collection of styles for components of the form.\n// Themes can be applied to a form using the WithTheme option.\ntype Theme struct {\n\tForm           lipgloss.Style\n\tGroup          lipgloss.Style\n\tFieldSeparator lipgloss.Style\n\tBlurred        FieldStyles\n\tFocused        FieldStyles\n\tHelp           help.Styles\n}\n\n// FieldStyles are the styles for input fields.\ntype FieldStyles struct {\n\tBase           lipgloss.Style\n\tTitle          lipgloss.Style\n\tDescription    lipgloss.Style\n\tErrorIndicator lipgloss.Style\n\tErrorMessage   lipgloss.Style\n\n\t// Select styles.\n\tSelectSelector lipgloss.Style // Selection indicator\n\tOption         lipgloss.Style // Select options\n\tNextIndicator  lipgloss.Style\n\tPrevIndicator  lipgloss.Style\n\n\t// FilePicker styles.\n\tDirectory lipgloss.Style\n\tFile      lipgloss.Style\n\n\t// Multi-select styles.\n\tMultiSelectSelector lipgloss.Style\n\tSelectedOption      lipgloss.Style\n\tSelectedPrefix      lipgloss.Style\n\tUnselectedOption    lipgloss.Style\n\tUnselectedPrefix    lipgloss.Style\n\n\t// Textinput and teatarea styles.\n\tTextInput TextInputStyles\n\n\t// Confirm styles.\n\tFocusedButton lipgloss.Style\n\tBlurredButton lipgloss.Style\n\n\t// Card styles.\n\tCard      lipgloss.Style\n\tNoteTitle lipgloss.Style\n\tNext      lipgloss.Style\n}\n\n// TextInputStyles are the styles for text inputs.\ntype TextInputStyles struct {\n\tCursor      lipgloss.Style\n\tCursorText  lipgloss.Style\n\tPlaceholder lipgloss.Style\n\tPrompt      lipgloss.Style\n\tText        lipgloss.Style\n}\n\nconst (\n\tbuttonPaddingHorizontal = 2\n\tbuttonPaddingVertical   = 0\n)\n\n// ThemeBase returns a new base theme with general styles to be inherited by\n// other themes.\nfunc ThemeBase() *Theme {\n\tvar t Theme\n\n\tt.FieldSeparator = lipgloss.NewStyle().SetString(\"\\n\\n\")\n\n\tbutton := lipgloss.NewStyle().\n\t\tPadding(buttonPaddingVertical, buttonPaddingHorizontal).\n\t\tMarginRight(1)\n\n\t// Focused styles.\n\tt.Focused.Base = lipgloss.NewStyle().PaddingLeft(1).BorderStyle(lipgloss.ThickBorder()).BorderLeft(true)\n\tt.Focused.Card = lipgloss.NewStyle().PaddingLeft(1)\n\tt.Focused.ErrorIndicator = lipgloss.NewStyle().SetString(\" *\")\n\tt.Focused.ErrorMessage = lipgloss.NewStyle().SetString(\" *\")\n\tt.Focused.SelectSelector = lipgloss.NewStyle().SetString(\"> \")\n\tt.Focused.NextIndicator = lipgloss.NewStyle().MarginLeft(1).SetString(\"→\")\n\tt.Focused.PrevIndicator = lipgloss.NewStyle().MarginRight(1).SetString(\"←\")\n\tt.Focused.MultiSelectSelector = lipgloss.NewStyle().SetString(\"> \")\n\tt.Focused.SelectedPrefix = lipgloss.NewStyle().SetString(\"[•] \")\n\tt.Focused.UnselectedPrefix = lipgloss.NewStyle().SetString(\"[ ] \")\n\tt.Focused.FocusedButton = button.Foreground(lipgloss.Color(\"0\")).Background(lipgloss.Color(\"7\"))\n\tt.Focused.BlurredButton = button.Foreground(lipgloss.Color(\"7\")).Background(lipgloss.Color(\"0\"))\n\tt.Focused.TextInput.Placeholder = lipgloss.NewStyle().Foreground(lipgloss.Color(\"8\"))\n\n\tt.Help = help.New().Styles\n\n\t// Blurred styles.\n\tt.Blurred = t.Focused\n\tt.Blurred.Base = t.Blurred.Base.BorderStyle(lipgloss.HiddenBorder())\n\tt.Blurred.MultiSelectSelector = lipgloss.NewStyle().SetString(\"  \")\n\tt.Blurred.NextIndicator = lipgloss.NewStyle()\n\tt.Blurred.PrevIndicator = lipgloss.NewStyle()\n\n\treturn &t\n}\n\n// ThemeCharm returns a new theme based on the Charm color scheme.\nfunc ThemeCharm() *Theme {\n\tt := ThemeBase()\n\n\tvar (\n\t\tnormalFg = lipgloss.AdaptiveColor{Light: \"235\", Dark: \"252\"}\n\t\tindigo   = lipgloss.AdaptiveColor{Light: \"#5A56E0\", Dark: \"#7571F9\"}\n\t\tcream    = lipgloss.AdaptiveColor{Light: \"#FFFDF5\", Dark: \"#FFFDF5\"}\n\t\tfuchsia  = lipgloss.Color(\"#F780E2\")\n\t\tgreen    = lipgloss.AdaptiveColor{Light: \"#02BA84\", Dark: \"#02BF87\"}\n\t\tred      = lipgloss.AdaptiveColor{Light: \"#FF4672\", Dark: \"#ED567A\"}\n\t)\n\n\tt.Focused.Base = t.Focused.Base.BorderForeground(lipgloss.Color(\"238\"))\n\tt.Focused.Title = t.Focused.Title.Foreground(indigo).Bold(true)\n\tt.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(indigo).Bold(true).MarginBottom(1)\n\tt.Focused.Directory = t.Focused.Directory.Foreground(indigo)\n\tt.Focused.Description = t.Focused.Description.Foreground(lipgloss.AdaptiveColor{Light: \"\", Dark: \"243\"})\n\tt.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(red)\n\tt.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(red)\n\tt.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(fuchsia)\n\tt.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(fuchsia)\n\tt.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(fuchsia)\n\tt.Focused.Option = t.Focused.Option.Foreground(normalFg)\n\tt.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(fuchsia)\n\tt.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(green)\n\tt.Focused.SelectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"#02CF92\", Dark: \"#02A877\"}).SetString(\"✓ \")\n\tt.Focused.UnselectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: \"\", Dark: \"243\"}).SetString(\"• \")\n\tt.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(normalFg)\n\tt.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(cream).Background(fuchsia)\n\tt.Focused.Next = t.Focused.FocusedButton\n\tt.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(normalFg).Background(lipgloss.AdaptiveColor{Light: \"252\", Dark: \"237\"})\n\n\tt.Focused.TextInput.Cursor = t.Focused.TextInput.Cursor.Foreground(green)\n\tt.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(lipgloss.AdaptiveColor{Light: \"248\", Dark: \"238\"})\n\tt.Focused.TextInput.Prompt = t.Focused.TextInput.Prompt.Foreground(fuchsia)\n\n\tt.Blurred = t.Focused\n\tt.Blurred.Base = t.Focused.Base.BorderStyle(lipgloss.HiddenBorder())\n\tt.Blurred.NextIndicator = lipgloss.NewStyle()\n\tt.Blurred.PrevIndicator = lipgloss.NewStyle()\n\n\treturn t\n}\n\n// ThemeDracula returns a new theme based on the Dracula color scheme.\nfunc ThemeDracula() *Theme {\n\tt := ThemeBase()\n\n\tvar (\n\t\tbackground = lipgloss.AdaptiveColor{Dark: \"#282a36\"}\n\t\tselection  = lipgloss.AdaptiveColor{Dark: \"#44475a\"}\n\t\tforeground = lipgloss.AdaptiveColor{Dark: \"#f8f8f2\"}\n\t\tcomment    = lipgloss.AdaptiveColor{Dark: \"#6272a4\"}\n\t\tgreen      = lipgloss.AdaptiveColor{Dark: \"#50fa7b\"}\n\t\tpurple     = lipgloss.AdaptiveColor{Dark: \"#bd93f9\"}\n\t\tred        = lipgloss.AdaptiveColor{Dark: \"#ff5555\"}\n\t\tyellow     = lipgloss.AdaptiveColor{Dark: \"#f1fa8c\"}\n\t)\n\n\tt.Focused.Base = t.Focused.Base.BorderForeground(selection)\n\tt.Focused.Title = t.Focused.Title.Foreground(purple)\n\tt.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(purple)\n\tt.Focused.Description = t.Focused.Description.Foreground(comment)\n\tt.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(red)\n\tt.Focused.Directory = t.Focused.Directory.Foreground(purple)\n\tt.Focused.File = t.Focused.File.Foreground(foreground)\n\tt.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(red)\n\tt.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(yellow)\n\tt.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(yellow)\n\tt.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(yellow)\n\tt.Focused.Option = t.Focused.Option.Foreground(foreground)\n\tt.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(yellow)\n\tt.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(green)\n\tt.Focused.SelectedPrefix = t.Focused.SelectedPrefix.Foreground(green)\n\tt.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(foreground)\n\tt.Focused.UnselectedPrefix = t.Focused.UnselectedPrefix.Foreground(comment)\n\tt.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(yellow).Background(purple).Bold(true)\n\tt.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(foreground).Background(background)\n\n\tt.Focused.TextInput.Cursor = t.Focused.TextInput.Cursor.Foreground(yellow)\n\tt.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(comment)\n\tt.Focused.TextInput.Prompt = t.Focused.TextInput.Prompt.Foreground(yellow)\n\n\tt.Blurred = t.Focused\n\tt.Blurred.Base = t.Blurred.Base.BorderStyle(lipgloss.HiddenBorder())\n\tt.Blurred.NextIndicator = lipgloss.NewStyle()\n\tt.Blurred.PrevIndicator = lipgloss.NewStyle()\n\n\treturn t\n}\n\n// ThemeBase16 returns a new theme based on the base16 color scheme.\nfunc ThemeBase16() *Theme {\n\tt := ThemeBase()\n\n\tt.Focused.Base = t.Focused.Base.BorderForeground(lipgloss.Color(\"8\"))\n\tt.Focused.Title = t.Focused.Title.Foreground(lipgloss.Color(\"6\"))\n\tt.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(lipgloss.Color(\"6\"))\n\tt.Focused.Directory = t.Focused.Directory.Foreground(lipgloss.Color(\"6\"))\n\tt.Focused.Description = t.Focused.Description.Foreground(lipgloss.Color(\"8\"))\n\tt.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(lipgloss.Color(\"9\"))\n\tt.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(lipgloss.Color(\"9\"))\n\tt.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(lipgloss.Color(\"3\"))\n\tt.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(lipgloss.Color(\"3\"))\n\tt.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(lipgloss.Color(\"3\"))\n\tt.Focused.Option = t.Focused.Option.Foreground(lipgloss.Color(\"7\"))\n\tt.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(lipgloss.Color(\"3\"))\n\tt.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(lipgloss.Color(\"2\"))\n\tt.Focused.SelectedPrefix = t.Focused.SelectedPrefix.Foreground(lipgloss.Color(\"2\"))\n\tt.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(lipgloss.Color(\"7\"))\n\tt.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(lipgloss.Color(\"7\")).Background(lipgloss.Color(\"5\"))\n\tt.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(lipgloss.Color(\"7\")).Background(lipgloss.Color(\"0\"))\n\n\tt.Focused.TextInput.Cursor.Foreground(lipgloss.Color(\"5\"))\n\tt.Focused.TextInput.Placeholder.Foreground(lipgloss.Color(\"8\"))\n\tt.Focused.TextInput.Prompt.Foreground(lipgloss.Color(\"3\"))\n\n\tt.Blurred = t.Focused\n\tt.Blurred.Base = t.Blurred.Base.BorderStyle(lipgloss.HiddenBorder())\n\tt.Blurred.NoteTitle = t.Blurred.NoteTitle.Foreground(lipgloss.Color(\"8\"))\n\tt.Blurred.Title = t.Blurred.NoteTitle.Foreground(lipgloss.Color(\"8\"))\n\n\tt.Blurred.TextInput.Prompt = t.Blurred.TextInput.Prompt.Foreground(lipgloss.Color(\"8\"))\n\tt.Blurred.TextInput.Text = t.Blurred.TextInput.Text.Foreground(lipgloss.Color(\"7\"))\n\n\tt.Blurred.NextIndicator = lipgloss.NewStyle()\n\tt.Blurred.PrevIndicator = lipgloss.NewStyle()\n\n\treturn t\n}\n\n// ThemeCatppuccin returns a new theme based on the Catppuccin color scheme.\nfunc ThemeCatppuccin() *Theme {\n\tt := ThemeBase()\n\n\tlight := catppuccin.Latte\n\tdark := catppuccin.Mocha\n\tvar (\n\t\tbase     = lipgloss.AdaptiveColor{Light: light.Base().Hex, Dark: dark.Base().Hex}\n\t\ttext     = lipgloss.AdaptiveColor{Light: light.Text().Hex, Dark: dark.Text().Hex}\n\t\tsubtext1 = lipgloss.AdaptiveColor{Light: light.Subtext1().Hex, Dark: dark.Subtext1().Hex}\n\t\tsubtext0 = lipgloss.AdaptiveColor{Light: light.Subtext0().Hex, Dark: dark.Subtext0().Hex}\n\t\toverlay1 = lipgloss.AdaptiveColor{Light: light.Overlay1().Hex, Dark: dark.Overlay1().Hex}\n\t\toverlay0 = lipgloss.AdaptiveColor{Light: light.Overlay0().Hex, Dark: dark.Overlay0().Hex}\n\t\tgreen    = lipgloss.AdaptiveColor{Light: light.Green().Hex, Dark: dark.Green().Hex}\n\t\tred      = lipgloss.AdaptiveColor{Light: light.Red().Hex, Dark: dark.Red().Hex}\n\t\tpink     = lipgloss.AdaptiveColor{Light: light.Pink().Hex, Dark: dark.Pink().Hex}\n\t\tmauve    = lipgloss.AdaptiveColor{Light: light.Mauve().Hex, Dark: dark.Mauve().Hex}\n\t\tcursor   = lipgloss.AdaptiveColor{Light: light.Rosewater().Hex, Dark: dark.Rosewater().Hex}\n\t)\n\n\tt.Focused.Base = t.Focused.Base.BorderForeground(subtext1)\n\tt.Focused.Title = t.Focused.Title.Foreground(mauve)\n\tt.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(mauve)\n\tt.Focused.Directory = t.Focused.Directory.Foreground(mauve)\n\tt.Focused.Description = t.Focused.Description.Foreground(subtext0)\n\tt.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(red)\n\tt.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(red)\n\tt.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(pink)\n\tt.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(pink)\n\tt.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(pink)\n\tt.Focused.Option = t.Focused.Option.Foreground(text)\n\tt.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(pink)\n\tt.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(green)\n\tt.Focused.SelectedPrefix = t.Focused.SelectedPrefix.Foreground(green)\n\tt.Focused.UnselectedPrefix = t.Focused.UnselectedPrefix.Foreground(text)\n\tt.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(text)\n\tt.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(base).Background(pink)\n\tt.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(text).Background(base)\n\n\tt.Focused.TextInput.Cursor = t.Focused.TextInput.Cursor.Foreground(cursor)\n\tt.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(overlay0)\n\tt.Focused.TextInput.Prompt = t.Focused.TextInput.Prompt.Foreground(pink)\n\n\tt.Blurred = t.Focused\n\tt.Blurred.Base = t.Blurred.Base.BorderStyle(lipgloss.HiddenBorder())\n\n\tt.Help.Ellipsis = t.Help.Ellipsis.Foreground(subtext0)\n\tt.Help.ShortKey = t.Help.ShortKey.Foreground(subtext0)\n\tt.Help.ShortDesc = t.Help.ShortDesc.Foreground(overlay1)\n\tt.Help.ShortSeparator = t.Help.ShortSeparator.Foreground(subtext0)\n\tt.Help.FullKey = t.Help.FullKey.Foreground(subtext0)\n\tt.Help.FullDesc = t.Help.FullDesc.Foreground(overlay1)\n\tt.Help.FullSeparator = t.Help.FullSeparator.Foreground(subtext0)\n\n\treturn t\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/huh/validate.go",
    "content": "package huh\n\nimport (\n\t\"fmt\"\n\t\"unicode/utf8\"\n)\n\n// ValidateNotEmpty checks if the input is not empty.\nfunc ValidateNotEmpty() func(s string) error {\n\treturn func(s string) error {\n\t\tif err := ValidateMinLength(1)(s); err != nil {\n\t\t\treturn fmt.Errorf(\"input cannot be empty\")\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// ValidateMinLength checks if the length of the input is at least min.\nfunc ValidateMinLength(v int) func(s string) error {\n\treturn func(s string) error {\n\t\tif utf8.RuneCountInString(s) < v {\n\t\t\treturn fmt.Errorf(\"input must be at least %d characters long\", v)\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// ValidateMaxLength checks if the length of the input is at most max.\nfunc ValidateMaxLength(v int) func(s string) error {\n\treturn func(s string) error {\n\t\tif utf8.RuneCountInString(s) > v {\n\t\t\treturn fmt.Errorf(\"input must be at most %d characters long\", v)\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// ValidateLength checks if the length of the input is within the specified range.\nfunc ValidateLength(minl, maxl int) func(s string) error {\n\treturn func(s string) error {\n\t\tif err := ValidateMinLength(minl)(s); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn ValidateMaxLength(maxl)(s)\n\t}\n}\n\n// ValidateOneOf checks if a string is one of the specified options.\nfunc ValidateOneOf(options ...string) func(string) error {\n\tvalidOptions := make(map[string]struct{})\n\tfor _, option := range options {\n\t\tvalidOptions[option] = struct{}{}\n\t}\n\n\treturn func(value string) error {\n\t\tif _, ok := validOptions[value]; !ok {\n\t\t\treturn fmt.Errorf(\"invalid option: %s\", value)\n\t\t}\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/.gitignore",
    "content": "ssh_example_ed25519*\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    # - dupl\n    - exhaustive\n    # - exhaustivestruct\n    - goconst\n    - godot\n    - godox\n    - gomnd\n    - gomoddirectives\n    - goprintffuncname\n    # - lll\n    - misspell\n    - nakedret\n    - nestif\n    - noctx\n    - nolintlint\n    - prealloc\n    - wrapcheck\n\n  # disable default linters, they are already enabled in .golangci.yml\n  disable:\n    - deadcode\n    - errcheck\n    - gosimple\n    - govet\n    - ineffassign\n    - staticcheck\n    - structcheck\n    - typecheck\n    - unused\n    - varcheck\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/.golangci.yml",
    "content": "run:\n  tests: false\n\nissues:\n  include:\n    - EXC0001\n    - EXC0005\n    - EXC0011\n    - EXC0012\n    - EXC0013\n\n  max-issues-per-linter: 0\n  max-same-issues: 0\n\nlinters:\n  enable:\n    - bodyclose\n    - exportloopref\n    - gofumpt\n    - goimports\n    - gosec\n    - nilerr\n    - predeclared\n    - revive\n    - rowserrcheck\n    - sqlclosecheck\n    - tparallel\n    - unconvert\n    - unparam\n    - whitespace\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/.goreleaser.yml",
    "content": "includes:\n  - from_url:\n      url: charmbracelet/meta/main/goreleaser-lib.yaml\n# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json\n\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2021-2023 Charmbracelet, Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/README.md",
    "content": "# Lip Gloss\n\n<p>\n    <a href=\"https://stuff.charm.sh/lipgloss/lipgloss-mascot-2k.png\"><img width=\"340\" alt=\"Lip Gloss title treatment\" src=\"https://github.com/charmbracelet/lipgloss/assets/25087/147cadb1-4254-43ec-ae6b-8d6ca7b029a1\"></a><br>\n    <a href=\"https://github.com/charmbracelet/lipgloss/releases\"><img src=\"https://img.shields.io/github/release/charmbracelet/lipgloss.svg\" alt=\"Latest Release\"></a>\n    <a href=\"https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc\"><img src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"></a>\n    <a href=\"https://github.com/charmbracelet/lipgloss/actions\"><img src=\"https://github.com/charmbracelet/lipgloss/workflows/build/badge.svg\" alt=\"Build Status\"></a>\n    <a href=\"https://www.phorm.ai/query?projectId=a0e324b6-b706-4546-b951-6671ea60c13f\"><img src=\"https://stuff.charm.sh/misc/phorm-badge.svg\" alt=\"phorm.ai\"></a>\n</p>\n\nStyle definitions for nice terminal layouts. Built with TUIs in mind.\n\n![Lip Gloss example](https://stuff.charm.sh/lipgloss/lipgloss-example.png)\n\nLip Gloss takes an expressive, declarative approach to terminal rendering.\nUsers familiar with CSS will feel at home with Lip Gloss.\n\n```go\n\nimport \"github.com/charmbracelet/lipgloss\"\n\nvar style = lipgloss.NewStyle().\n    Bold(true).\n    Foreground(lipgloss.Color(\"#FAFAFA\")).\n    Background(lipgloss.Color(\"#7D56F4\")).\n    PaddingTop(2).\n    PaddingLeft(4).\n    Width(22)\n\nfmt.Println(style.Render(\"Hello, kitty\"))\n```\n\n## Colors\n\nLip Gloss supports the following color profiles:\n\n### ANSI 16 colors (4-bit)\n\n```go\nlipgloss.Color(\"5\")  // magenta\nlipgloss.Color(\"9\")  // red\nlipgloss.Color(\"12\") // light blue\n```\n\n### ANSI 256 Colors (8-bit)\n\n```go\nlipgloss.Color(\"86\")  // aqua\nlipgloss.Color(\"201\") // hot pink\nlipgloss.Color(\"202\") // orange\n```\n\n### True Color (16,777,216 colors; 24-bit)\n\n```go\nlipgloss.Color(\"#0000FF\") // good ol' 100% blue\nlipgloss.Color(\"#04B575\") // a green\nlipgloss.Color(\"#3C3C3C\") // a dark gray\n```\n\n...as well as a 1-bit ASCII profile, which is black and white only.\n\nThe terminal's color profile will be automatically detected, and colors outside\nthe gamut of the current palette will be automatically coerced to their closest\navailable value.\n\n### Adaptive Colors\n\nYou can also specify color options for light and dark backgrounds:\n\n```go\nlipgloss.AdaptiveColor{Light: \"236\", Dark: \"248\"}\n```\n\nThe terminal's background color will automatically be detected and the\nappropriate color will be chosen at runtime.\n\n### Complete Colors\n\nCompleteColor specifies exact values for True Color, ANSI256, and ANSI color\nprofiles.\n\n```go\nlipgloss.CompleteColor{TrueColor: \"#0000FF\", ANSI256: \"86\", ANSI: \"5\"}\n```\n\nAutomatic color degradation will not be performed in this case and it will be\nbased on the color specified.\n\n### Complete Adaptive Colors\n\nYou can use `CompleteColor` with `AdaptiveColor` to specify the exact values for\nlight and dark backgrounds without automatic color degradation.\n\n```go\nlipgloss.CompleteAdaptiveColor{\n    Light: CompleteColor{TrueColor: \"#d7ffae\", ANSI256: \"193\", ANSI: \"11\"},\n    Dark:  CompleteColor{TrueColor: \"#d75fee\", ANSI256: \"163\", ANSI: \"5\"},\n}\n```\n\n## Inline Formatting\n\nLip Gloss supports the usual ANSI text formatting options:\n\n```go\nvar style = lipgloss.NewStyle().\n    Bold(true).\n    Italic(true).\n    Faint(true).\n    Blink(true).\n    Strikethrough(true).\n    Underline(true).\n    Reverse(true)\n```\n\n## Block-Level Formatting\n\nLip Gloss also supports rules for block-level formatting:\n\n```go\n// Padding\nvar style = lipgloss.NewStyle().\n    PaddingTop(2).\n    PaddingRight(4).\n    PaddingBottom(2).\n    PaddingLeft(4)\n\n// Margins\nvar style = lipgloss.NewStyle().\n    MarginTop(2).\n    MarginRight(4).\n    MarginBottom(2).\n    MarginLeft(4)\n```\n\nThere is also shorthand syntax for margins and padding, which follows the same\nformat as CSS:\n\n```go\n// 2 cells on all sides\nlipgloss.NewStyle().Padding(2)\n\n// 2 cells on the top and bottom, 4 cells on the left and right\nlipgloss.NewStyle().Margin(2, 4)\n\n// 1 cell on the top, 4 cells on the sides, 2 cells on the bottom\nlipgloss.NewStyle().Padding(1, 4, 2)\n\n// Clockwise, starting from the top: 2 cells on the top, 4 on the right, 3 on\n// the bottom, and 1 on the left\nlipgloss.NewStyle().Margin(2, 4, 3, 1)\n```\n\n## Aligning Text\n\nYou can align paragraphs of text to the left, right, or center.\n\n```go\nvar style = lipgloss.NewStyle().\n    Width(24).\n    Align(lipgloss.Left).  // align it left\n    Align(lipgloss.Right). // no wait, align it right\n    Align(lipgloss.Center) // just kidding, align it in the center\n```\n\n## Width and Height\n\nSetting a minimum width and height is simple and straightforward.\n\n```go\nvar style = lipgloss.NewStyle().\n    SetString(\"What’s for lunch?\").\n    Width(24).\n    Height(32).\n    Foreground(lipgloss.Color(\"63\"))\n```\n\n## Borders\n\nAdding borders is easy:\n\n```go\n// Add a purple, rectangular border\nvar style = lipgloss.NewStyle().\n    BorderStyle(lipgloss.NormalBorder()).\n    BorderForeground(lipgloss.Color(\"63\"))\n\n// Set a rounded, yellow-on-purple border to the top and left\nvar anotherStyle = lipgloss.NewStyle().\n    BorderStyle(lipgloss.RoundedBorder()).\n    BorderForeground(lipgloss.Color(\"228\")).\n    BorderBackground(lipgloss.Color(\"63\")).\n    BorderTop(true).\n    BorderLeft(true)\n\n// Make your own border\nvar myCuteBorder = lipgloss.Border{\n    Top:         \"._.:*:\",\n    Bottom:      \"._.:*:\",\n    Left:        \"|*\",\n    Right:       \"|*\",\n    TopLeft:     \"*\",\n    TopRight:    \"*\",\n    BottomLeft:  \"*\",\n    BottomRight: \"*\",\n}\n```\n\nThere are also shorthand functions for defining borders, which follow a similar\npattern to the margin and padding shorthand functions.\n\n```go\n// Add a thick border to the top and bottom\nlipgloss.NewStyle().\n    Border(lipgloss.ThickBorder(), true, false)\n\n// Add a double border to the top and left sides. Rules are set clockwise\n// from top.\nlipgloss.NewStyle().\n    Border(lipgloss.DoubleBorder(), true, false, false, true)\n```\n\nFor more on borders see [the docs][docs].\n\n## Copying Styles\n\nJust use assignment:\n\n```go\nstyle := lipgloss.NewStyle().Foreground(lipgloss.Color(\"219\"))\n\ncopiedStyle := style // this is a true copy\n\nwildStyle := style.Blink(true) // this is also true copy, with blink added\n\n```\n\nSince `Style` data structures contains only primitive types, assigning a style\nto another effectively creates a new copy of the style without mutating the\noriginal.\n\n## Inheritance\n\nStyles can inherit rules from other styles. When inheriting, only unset rules\non the receiver are inherited.\n\n```go\nvar styleA = lipgloss.NewStyle().\n    Foreground(lipgloss.Color(\"229\")).\n    Background(lipgloss.Color(\"63\"))\n\n// Only the background color will be inherited here, because the foreground\n// color will have been already set:\nvar styleB = lipgloss.NewStyle().\n    Foreground(lipgloss.Color(\"201\")).\n    Inherit(styleA)\n```\n\n## Unsetting Rules\n\nAll rules can be unset:\n\n```go\nvar style = lipgloss.NewStyle().\n    Bold(true).                        // make it bold\n    UnsetBold().                       // jk don't make it bold\n    Background(lipgloss.Color(\"227\")). // yellow background\n    UnsetBackground()                  // never mind\n```\n\nWhen a rule is unset, it won't be inherited or copied.\n\n## Enforcing Rules\n\nSometimes, such as when developing a component, you want to make sure style\ndefinitions respect their intended purpose in the UI. This is where `Inline`\nand `MaxWidth`, and `MaxHeight` come in:\n\n```go\n// Force rendering onto a single line, ignoring margins, padding, and borders.\nsomeStyle.Inline(true).Render(\"yadda yadda\")\n\n// Also limit rendering to five cells\nsomeStyle.Inline(true).MaxWidth(5).Render(\"yadda yadda\")\n\n// Limit rendering to a 5x5 cell block\nsomeStyle.MaxWidth(5).MaxHeight(5).Render(\"yadda yadda\")\n```\n\n## Tabs\n\nThe tab character (`\\t`) is rendered differently in different terminals (often\nas 8 spaces, sometimes 4). Because of this inconsistency, Lip Gloss converts\ntabs to 4 spaces at render time. This behavior can be changed on a per-style\nbasis, however:\n\n```go\nstyle := lipgloss.NewStyle() // tabs will render as 4 spaces, the default\nstyle = style.TabWidth(2)    // render tabs as 2 spaces\nstyle = style.TabWidth(0)    // remove tabs entirely\nstyle = style.TabWidth(lipgloss.NoTabConversion) // leave tabs intact\n```\n\n## Rendering\n\nGenerally, you just call the `Render(string...)` method on a `lipgloss.Style`:\n\n```go\nstyle := lipgloss.NewStyle().Bold(true).SetString(\"Hello,\")\nfmt.Println(style.Render(\"kitty.\")) // Hello, kitty.\nfmt.Println(style.Render(\"puppy.\")) // Hello, puppy.\n```\n\nBut you could also use the Stringer interface:\n\n```go\nvar style = lipgloss.NewStyle().SetString(\"你好，猫咪。\").Bold(true)\nfmt.Println(style) // 你好，猫咪。\n```\n\n### Custom Renderers\n\nCustom renderers allow you to render to a specific outputs. This is\nparticularly important when you want to render to different outputs and\ncorrectly detect the color profile and dark background status for each, such as\nin a server-client situation.\n\n```go\nfunc myLittleHandler(sess ssh.Session) {\n    // Create a renderer for the client.\n    renderer := lipgloss.NewRenderer(sess)\n\n    // Create a new style on the renderer.\n    style := renderer.NewStyle().Background(lipgloss.AdaptiveColor{Light: \"63\", Dark: \"228\"})\n\n    // Render. The color profile and dark background state will be correctly detected.\n    io.WriteString(sess, style.Render(\"Heyyyyyyy\"))\n}\n```\n\nFor an example on using a custom renderer over SSH with [Wish][wish] see the\n[SSH example][ssh-example].\n\n## Utilities\n\nIn addition to pure styling, Lip Gloss also ships with some utilities to help\nassemble your layouts.\n\n### Joining Paragraphs\n\nHorizontally and vertically joining paragraphs is a cinch.\n\n```go\n// Horizontally join three paragraphs along their bottom edges\nlipgloss.JoinHorizontal(lipgloss.Bottom, paragraphA, paragraphB, paragraphC)\n\n// Vertically join two paragraphs along their center axes\nlipgloss.JoinVertical(lipgloss.Center, paragraphA, paragraphB)\n\n// Horizontally join three paragraphs, with the shorter ones aligning 20%\n// from the top of the tallest\nlipgloss.JoinHorizontal(0.2, paragraphA, paragraphB, paragraphC)\n```\n\n### Measuring Width and Height\n\nSometimes you’ll want to know the width and height of text blocks when building\nyour layouts.\n\n```go\n// Render a block of text.\nvar style = lipgloss.NewStyle().\n    Width(40).\n    Padding(2)\nvar block string = style.Render(someLongString)\n\n// Get the actual, physical dimensions of the text block.\nwidth := lipgloss.Width(block)\nheight := lipgloss.Height(block)\n\n// Here's a shorthand function.\nw, h := lipgloss.Size(block)\n```\n\n### Placing Text in Whitespace\n\nSometimes you’ll simply want to place a block of text in whitespace.\n\n```go\n// Center a paragraph horizontally in a space 80 cells wide. The height of\n// the block returned will be as tall as the input paragraph.\nblock := lipgloss.PlaceHorizontal(80, lipgloss.Center, fancyStyledParagraph)\n\n// Place a paragraph at the bottom of a space 30 cells tall. The width of\n// the text block returned will be as wide as the input paragraph.\nblock := lipgloss.PlaceVertical(30, lipgloss.Bottom, fancyStyledParagraph)\n\n// Place a paragraph in the bottom right corner of a 30x80 cell space.\nblock := lipgloss.Place(30, 80, lipgloss.Right, lipgloss.Bottom, fancyStyledParagraph)\n```\n\nYou can also style the whitespace. For details, see [the docs][docs].\n\n### Rendering Tables\n\nLip Gloss ships with a table rendering sub-package.\n\n```go\nimport \"github.com/charmbracelet/lipgloss/table\"\n```\n\nDefine some rows of data.\n\n```go\nrows := [][]string{\n    {\"Chinese\", \"您好\", \"你好\"},\n    {\"Japanese\", \"こんにちは\", \"やあ\"},\n    {\"Arabic\", \"أهلين\", \"أهلا\"},\n    {\"Russian\", \"Здравствуйте\", \"Привет\"},\n    {\"Spanish\", \"Hola\", \"¿Qué tal?\"},\n}\n```\n\nUse the table package to style and render the table.\n\n```go\nt := table.New().\n    Border(lipgloss.NormalBorder()).\n    BorderStyle(lipgloss.NewStyle().Foreground(lipgloss.Color(\"99\"))).\n    StyleFunc(func(row, col int) lipgloss.Style {\n        switch {\n        case row == 0:\n            return HeaderStyle\n        case row%2 == 0:\n            return EvenRowStyle\n        default:\n            return OddRowStyle\n        }\n    }).\n    Headers(\"LANGUAGE\", \"FORMAL\", \"INFORMAL\").\n    Rows(rows...)\n\n// You can also add tables row-by-row\nt.Row(\"English\", \"You look absolutely fabulous.\", \"How's it going?\")\n```\n\nPrint the table.\n\n```go\nfmt.Println(t)\n```\n\n![Table Example](https://github.com/charmbracelet/lipgloss/assets/42545625/6e4b70c4-f494-45da-a467-bdd27df30d5d)\n\nFor more on tables see [the docs](https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc) and [examples](https://github.com/charmbracelet/lipgloss/tree/master/examples/table).\n\n## Rendering Lists\n\nLip Gloss ships with a list rendering sub-package.\n\n```go\nimport \"github.com/charmbracelet/lipgloss/list\"\n```\n\nDefine a new list.\n\n```go\nl := list.New(\"A\", \"B\", \"C\")\n```\n\nPrint the list.\n\n```go\nfmt.Println(l)\n\n// • A\n// • B\n// • C\n```\n\nLists have the ability to nest.\n\n```go\nl := list.New(\n  \"A\", list.New(\"Artichoke\"),\n  \"B\", list.New(\"Baking Flour\", \"Bananas\", \"Barley\", \"Bean Sprouts\"),\n  \"C\", list.New(\"Cashew Apple\", \"Cashews\", \"Coconut Milk\", \"Curry Paste\", \"Currywurst\"),\n  \"D\", list.New(\"Dill\", \"Dragonfruit\", \"Dried Shrimp\"),\n  \"E\", list.New(\"Eggs\"),\n  \"F\", list.New(\"Fish Cake\", \"Furikake\"),\n  \"J\", list.New(\"Jicama\"),\n  \"K\", list.New(\"Kohlrabi\"),\n  \"L\", list.New(\"Leeks\", \"Lentils\", \"Licorice Root\"),\n)\n```\n\nPrint the list.\n\n```go\nfmt.Println(l)\n```\n\n<p align=\"center\">\n<img width=\"600\" alt=\"image\" src=\"https://github.com/charmbracelet/lipgloss/assets/42545625/0dc9f440-0748-4151-a3b0-7dcf29dfcdb0\">\n</p>\n\nLists can be customized via their enumeration function as well as using\n`lipgloss.Style`s.\n\n```go\nenumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(\"99\")).MarginRight(1)\nitemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(\"212\")).MarginRight(1)\n\nl := list.New(\n  \"Glossier\",\n  \"Claire’s Boutique\",\n  \"Nyx\",\n  \"Mac\",\n  \"Milk\",\n).\n  Enumerator(list.Roman).\n  EnumeratorStyle(enumeratorStyle).\n  ItemStyle(itemStyle)\n```\n\nPrint the list.\n\n<p align=\"center\">\n<img width=\"600\" alt=\"List example\" src=\"https://github.com/charmbracelet/lipgloss/assets/42545625/360494f1-57fb-4e13-bc19-0006efe01561\">\n</p>\n\nIn addition to the predefined enumerators (`Arabic`, `Alphabet`, `Roman`, `Bullet`, `Tree`),\nyou may also define your own custom enumerator:\n\n```go\nl := list.New(\"Duck\", \"Duck\", \"Duck\", \"Duck\", \"Goose\", \"Duck\", \"Duck\")\n\nfunc DuckDuckGooseEnumerator(l list.Items, i int) string {\n    if l.At(i).Value() == \"Goose\" {\n        return \"Honk →\"\n    }\n    return \"\"\n}\n\nl = l.Enumerator(DuckDuckGooseEnumerator)\n```\n\nPrint the list:\n\n<p align=\"center\">\n<img width=\"600\" alt=\"image\" src=\"https://github.com/charmbracelet/lipgloss/assets/42545625/157aaf30-140d-4948-9bb4-dfba46e5b87e\">\n</p>\n\nIf you need, you can also build lists incrementally:\n\n```go\nl := list.New()\n\nfor i := 0; i < repeat; i++ {\n    l.Item(\"Lip Gloss\")\n}\n```\n\n## Rendering Trees\n\nLip Gloss ships with a tree rendering sub-package.\n\n```go\nimport \"github.com/charmbracelet/lipgloss/tree\"\n```\n\nDefine a new tree.\n\n```go\nt := tree.Root(\".\").\n  Child(\"A\", \"B\", \"C\")\n```\n\nPrint the tree.\n\n```go\nfmt.Println(t)\n\n// .\n// ├── A\n// ├── B\n// └── C\n```\n\nTrees have the ability to nest.\n\n```go\nt := tree.Root(\".\").\n  Child(\"Item 1\").\n  Child(\n    tree.Root(\"Item 2\").\n      Child(\"Item 2.1\").\n      Child(\"Item 2.2\").\n      Child(\"Item 2.3\"),\n  ).\n  Child(\n    tree.Root(\"Item 3\").\n      Child(\"Item 3.1\").\n      Child(\"Item 3.2\"),\n  )\n```\n\nPrint the tree.\n\n```go\nfmt.Println(t)\n```\n\n<p align=\"center\">\n<img width=\"400\" alt=\"Tree Example (simple)\" src=\"https://stuff.charm.sh/lipgloss/tree/simple.png\">\n</p>\n\nTrees can be customized via their enumeration function as well as using\n`lipgloss.Style`s.\n\n```go\nenumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(\"99\")).MarginRight(1)\nitemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(\"212\")).MarginRight(1)\n\nt := tree.Root(\"Makeup\").\n  Child(\n    \"Glossier\",\n    \"Claire’s Boutique\",\n    \"Nyx\",\n    \"Mac\",\n    \"Milk\",\n  ).\n  Enumerator(tree.RoundedEnumerator).\n  EnumeratorStyle(enumeratorStyle).\n  ItemStyle(itemStyle).\n  RootStyle(lipgloss.NewStyle().Foreground(lipgloss.Color(\"#04B575\")))\n```\n\nPrint the tree.\n\n<p align=\"center\">\n<img width=\"600\" alt=\"Tree Example (makeup)\" src=\"https://stuff.charm.sh/lipgloss/tree/makeup.png\">\n</p>\n\nThe predefined enumerators for trees are `DefaultEnumerator` and `RoundedEnumerator`.\n\nIf you need, you can also build trees incrementally:\n\n```go\nt := tree.New()\n\nfor i := 0; i < repeat; i++ {\n    t.Child(\"Lip Gloss\")\n}\n```\n\n---\n\n## FAQ\n\n<details>\n<summary>\nWhy are things misaligning? Why are borders at the wrong widths?\n</summary>\n<p>This is most likely due to your locale and encoding, particularly with\nregard to Chinese, Japanese, and Korean (for example, <code>zh_CN.UTF-8</code>\nor <code>ja_JP.UTF-8</code>). The most direct way to fix this is to set\n<code>RUNEWIDTH_EASTASIAN=0</code> in your environment.</p>\n\n<p>For details see <a href=\"https://github.com/charmbracelet/lipgloss/issues/40\">https://github.com/charmbracelet/lipgloss/issues/40.</a></p>\n</details>\n\n<details>\n<summary>\nWhy isn't Lip Gloss displaying colors?\n</summary>\n<p>Lip Gloss automatically degrades colors to the best available option in the\ngiven terminal, and if output's not a TTY it will remove color output entirely.\nThis is common when running tests, CI, or when piping output elsewhere.</p>\n\n<p>If necessary, you can force a color profile in your tests with\n<a href=\"https://pkg.go.dev/github.com/charmbracelet/lipgloss#SetColorProfile\"><code>SetColorProfile</code></a>.</p>\n\n```go\nimport (\n    \"github.com/charmbracelet/lipgloss\"\n    \"github.com/muesli/termenv\"\n)\n\nlipgloss.SetColorProfile(termenv.TrueColor)\n```\n\n_Note:_ this option limits the flexibility of your application and can cause\nANSI escape codes to be output in cases where that might not be desired. Take\ncareful note of your use case and environment before choosing to force a color\nprofile.\n\n</details>\n\n## What about [Bubble Tea][tea]?\n\nLip Gloss doesn’t replace Bubble Tea. Rather, it is an excellent Bubble Tea\ncompanion. It was designed to make assembling terminal user interface views as\nsimple and fun as possible so that you can focus on building your application\ninstead of concerning yourself with low-level layout details.\n\nIn simple terms, you can use Lip Gloss to help build your Bubble Tea views.\n\n[tea]: https://github.com/charmbracelet/tea\n\n## Under the Hood\n\nLip Gloss is built on the excellent [Termenv][termenv] and [Reflow][reflow]\nlibraries which deal with color and ANSI-aware text operations, respectively.\nFor many use cases Termenv and Reflow will be sufficient for your needs.\n\n[termenv]: https://github.com/muesli/termenv\n[reflow]: https://github.com/muesli/reflow\n\n## Rendering Markdown\n\nFor a more document-centric rendering solution with support for things like\nlists, tables, and syntax-highlighted code have a look at [Glamour][glamour],\nthe stylesheet-based Markdown renderer.\n\n[glamour]: https://github.com/charmbracelet/glamour\n\n## Feedback\n\nWe’d love to hear your thoughts on this project. Feel free to drop us a note!\n\n- [Twitter](https://twitter.com/charmcli)\n- [The Fediverse](https://mastodon.social/@charmcli)\n- [Discord](https://charm.sh/chat)\n\n## License\n\n[MIT](https://github.com/charmbracelet/lipgloss/raw/master/LICENSE)\n\n---\n\nPart of [Charm](https://charm.sh).\n\n<a href=\"https://charm.sh/\"><img alt=\"The Charm logo\" src=\"https://stuff.charm.sh/charm-badge.jpg\" width=\"400\"></a>\n\nCharm热爱开源 • Charm loves open source\n\n[docs]: https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc\n[wish]: https://github.com/charmbracelet/wish\n[ssh-example]: examples/ssh\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/align.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n\t\"github.com/muesli/termenv\"\n)\n\n// Perform text alignment. If the string is multi-lined, we also make all lines\n// the same width by padding them with spaces. If a termenv style is passed,\n// use that to style the spaces added.\nfunc alignTextHorizontal(str string, pos Position, width int, style *termenv.Style) string {\n\tlines, widestLine := getLines(str)\n\tvar b strings.Builder\n\n\tfor i, l := range lines {\n\t\tlineWidth := ansi.StringWidth(l)\n\n\t\tshortAmount := widestLine - lineWidth                // difference from the widest line\n\t\tshortAmount += max(0, width-(shortAmount+lineWidth)) // difference from the total width, if set\n\n\t\tif shortAmount > 0 {\n\t\t\tswitch pos { //nolint:exhaustive\n\t\t\tcase Right:\n\t\t\t\ts := strings.Repeat(\" \", shortAmount)\n\t\t\t\tif style != nil {\n\t\t\t\t\ts = style.Styled(s)\n\t\t\t\t}\n\t\t\t\tl = s + l\n\t\t\tcase Center:\n\t\t\t\t// Note: remainder goes on the right.\n\t\t\t\tleft := shortAmount / 2       //nolint:gomnd\n\t\t\t\tright := left + shortAmount%2 //nolint:gomnd\n\n\t\t\t\tleftSpaces := strings.Repeat(\" \", left)\n\t\t\t\trightSpaces := strings.Repeat(\" \", right)\n\n\t\t\t\tif style != nil {\n\t\t\t\t\tleftSpaces = style.Styled(leftSpaces)\n\t\t\t\t\trightSpaces = style.Styled(rightSpaces)\n\t\t\t\t}\n\t\t\t\tl = leftSpaces + l + rightSpaces\n\t\t\tdefault: // Left\n\t\t\t\ts := strings.Repeat(\" \", shortAmount)\n\t\t\t\tif style != nil {\n\t\t\t\t\ts = style.Styled(s)\n\t\t\t\t}\n\t\t\t\tl += s\n\t\t\t}\n\t\t}\n\n\t\tb.WriteString(l)\n\t\tif i < len(lines)-1 {\n\t\t\tb.WriteRune('\\n')\n\t\t}\n\t}\n\n\treturn b.String()\n}\n\nfunc alignTextVertical(str string, pos Position, height int, _ *termenv.Style) string {\n\tstrHeight := strings.Count(str, \"\\n\") + 1\n\tif height < strHeight {\n\t\treturn str\n\t}\n\n\tswitch pos {\n\tcase Top:\n\t\treturn str + strings.Repeat(\"\\n\", height-strHeight)\n\tcase Center:\n\t\ttopPadding, bottomPadding := (height-strHeight)/2, (height-strHeight)/2 //nolint:gomnd\n\t\tif strHeight+topPadding+bottomPadding > height {\n\t\t\ttopPadding--\n\t\t} else if strHeight+topPadding+bottomPadding < height {\n\t\t\tbottomPadding++\n\t\t}\n\t\treturn strings.Repeat(\"\\n\", topPadding) + str + strings.Repeat(\"\\n\", bottomPadding)\n\tcase Bottom:\n\t\treturn strings.Repeat(\"\\n\", height-strHeight) + str\n\t}\n\treturn str\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/ansi_unix.go",
    "content": "//go:build !windows\n// +build !windows\n\npackage lipgloss\n\n// enableLegacyWindowsANSI is only needed on Windows.\nfunc enableLegacyWindowsANSI() {}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/ansi_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage lipgloss\n\nimport (\n\t\"sync\"\n\n\t\"github.com/muesli/termenv\"\n)\n\nvar enableANSI sync.Once\n\n// enableANSIColors enables support for ANSI color sequences in the Windows\n// default console (cmd.exe and the PowerShell application). Note that this\n// only works with Windows 10. Also note that Windows Terminal supports colors\n// by default.\nfunc enableLegacyWindowsANSI() {\n\tenableANSI.Do(func() {\n\t\t_, _ = termenv.EnableWindowsANSIConsole()\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/borders.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n\t\"github.com/muesli/termenv\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// Border contains a series of values which comprise the various parts of a\n// border.\ntype Border struct {\n\tTop          string\n\tBottom       string\n\tLeft         string\n\tRight        string\n\tTopLeft      string\n\tTopRight     string\n\tBottomLeft   string\n\tBottomRight  string\n\tMiddleLeft   string\n\tMiddleRight  string\n\tMiddle       string\n\tMiddleTop    string\n\tMiddleBottom string\n}\n\n// GetTopSize returns the width of the top border. If borders contain runes of\n// varying widths, the widest rune is returned. If no border exists on the top\n// edge, 0 is returned.\nfunc (b Border) GetTopSize() int {\n\treturn getBorderEdgeWidth(b.TopLeft, b.Top, b.TopRight)\n}\n\n// GetRightSize returns the width of the right border. If borders contain\n// runes of varying widths, the widest rune is returned. If no border exists on\n// the right edge, 0 is returned.\nfunc (b Border) GetRightSize() int {\n\treturn getBorderEdgeWidth(b.TopRight, b.Right, b.BottomRight)\n}\n\n// GetBottomSize returns the width of the bottom border. If borders contain\n// runes of varying widths, the widest rune is returned. If no border exists on\n// the bottom edge, 0 is returned.\nfunc (b Border) GetBottomSize() int {\n\treturn getBorderEdgeWidth(b.BottomLeft, b.Bottom, b.BottomRight)\n}\n\n// GetLeftSize returns the width of the left border. If borders contain runes\n// of varying widths, the widest rune is returned. If no border exists on the\n// left edge, 0 is returned.\nfunc (b Border) GetLeftSize() int {\n\treturn getBorderEdgeWidth(b.TopLeft, b.Left, b.BottomLeft)\n}\n\nfunc getBorderEdgeWidth(borderParts ...string) (maxWidth int) {\n\tfor _, piece := range borderParts {\n\t\tw := maxRuneWidth(piece)\n\t\tif w > maxWidth {\n\t\t\tmaxWidth = w\n\t\t}\n\t}\n\treturn maxWidth\n}\n\nvar (\n\tnoBorder = Border{}\n\n\tnormalBorder = Border{\n\t\tTop:          \"─\",\n\t\tBottom:       \"─\",\n\t\tLeft:         \"│\",\n\t\tRight:        \"│\",\n\t\tTopLeft:      \"┌\",\n\t\tTopRight:     \"┐\",\n\t\tBottomLeft:   \"└\",\n\t\tBottomRight:  \"┘\",\n\t\tMiddleLeft:   \"├\",\n\t\tMiddleRight:  \"┤\",\n\t\tMiddle:       \"┼\",\n\t\tMiddleTop:    \"┬\",\n\t\tMiddleBottom: \"┴\",\n\t}\n\n\troundedBorder = Border{\n\t\tTop:          \"─\",\n\t\tBottom:       \"─\",\n\t\tLeft:         \"│\",\n\t\tRight:        \"│\",\n\t\tTopLeft:      \"╭\",\n\t\tTopRight:     \"╮\",\n\t\tBottomLeft:   \"╰\",\n\t\tBottomRight:  \"╯\",\n\t\tMiddleLeft:   \"├\",\n\t\tMiddleRight:  \"┤\",\n\t\tMiddle:       \"┼\",\n\t\tMiddleTop:    \"┬\",\n\t\tMiddleBottom: \"┴\",\n\t}\n\n\tblockBorder = Border{\n\t\tTop:         \"█\",\n\t\tBottom:      \"█\",\n\t\tLeft:        \"█\",\n\t\tRight:       \"█\",\n\t\tTopLeft:     \"█\",\n\t\tTopRight:    \"█\",\n\t\tBottomLeft:  \"█\",\n\t\tBottomRight: \"█\",\n\t}\n\n\touterHalfBlockBorder = Border{\n\t\tTop:         \"▀\",\n\t\tBottom:      \"▄\",\n\t\tLeft:        \"▌\",\n\t\tRight:       \"▐\",\n\t\tTopLeft:     \"▛\",\n\t\tTopRight:    \"▜\",\n\t\tBottomLeft:  \"▙\",\n\t\tBottomRight: \"▟\",\n\t}\n\n\tinnerHalfBlockBorder = Border{\n\t\tTop:         \"▄\",\n\t\tBottom:      \"▀\",\n\t\tLeft:        \"▐\",\n\t\tRight:       \"▌\",\n\t\tTopLeft:     \"▗\",\n\t\tTopRight:    \"▖\",\n\t\tBottomLeft:  \"▝\",\n\t\tBottomRight: \"▘\",\n\t}\n\n\tthickBorder = Border{\n\t\tTop:          \"━\",\n\t\tBottom:       \"━\",\n\t\tLeft:         \"┃\",\n\t\tRight:        \"┃\",\n\t\tTopLeft:      \"┏\",\n\t\tTopRight:     \"┓\",\n\t\tBottomLeft:   \"┗\",\n\t\tBottomRight:  \"┛\",\n\t\tMiddleLeft:   \"┣\",\n\t\tMiddleRight:  \"┫\",\n\t\tMiddle:       \"╋\",\n\t\tMiddleTop:    \"┳\",\n\t\tMiddleBottom: \"┻\",\n\t}\n\n\tdoubleBorder = Border{\n\t\tTop:          \"═\",\n\t\tBottom:       \"═\",\n\t\tLeft:         \"║\",\n\t\tRight:        \"║\",\n\t\tTopLeft:      \"╔\",\n\t\tTopRight:     \"╗\",\n\t\tBottomLeft:   \"╚\",\n\t\tBottomRight:  \"╝\",\n\t\tMiddleLeft:   \"╠\",\n\t\tMiddleRight:  \"╣\",\n\t\tMiddle:       \"╬\",\n\t\tMiddleTop:    \"╦\",\n\t\tMiddleBottom: \"╩\",\n\t}\n\n\thiddenBorder = Border{\n\t\tTop:          \" \",\n\t\tBottom:       \" \",\n\t\tLeft:         \" \",\n\t\tRight:        \" \",\n\t\tTopLeft:      \" \",\n\t\tTopRight:     \" \",\n\t\tBottomLeft:   \" \",\n\t\tBottomRight:  \" \",\n\t\tMiddleLeft:   \" \",\n\t\tMiddleRight:  \" \",\n\t\tMiddle:       \" \",\n\t\tMiddleTop:    \" \",\n\t\tMiddleBottom: \" \",\n\t}\n)\n\n// NormalBorder returns a standard-type border with a normal weight and 90\n// degree corners.\nfunc NormalBorder() Border {\n\treturn normalBorder\n}\n\n// RoundedBorder returns a border with rounded corners.\nfunc RoundedBorder() Border {\n\treturn roundedBorder\n}\n\n// BlockBorder returns a border that takes the whole block.\nfunc BlockBorder() Border {\n\treturn blockBorder\n}\n\n// OuterHalfBlockBorder returns a half-block border that sits outside the frame.\nfunc OuterHalfBlockBorder() Border {\n\treturn outerHalfBlockBorder\n}\n\n// InnerHalfBlockBorder returns a half-block border that sits inside the frame.\nfunc InnerHalfBlockBorder() Border {\n\treturn innerHalfBlockBorder\n}\n\n// ThickBorder returns a border that's thicker than the one returned by\n// NormalBorder.\nfunc ThickBorder() Border {\n\treturn thickBorder\n}\n\n// DoubleBorder returns a border comprised of two thin strokes.\nfunc DoubleBorder() Border {\n\treturn doubleBorder\n}\n\n// HiddenBorder returns a border that renders as a series of single-cell\n// spaces. It's useful for cases when you want to remove a standard border but\n// maintain layout positioning. This said, you can still apply a background\n// color to a hidden border.\nfunc HiddenBorder() Border {\n\treturn hiddenBorder\n}\n\nfunc (s Style) applyBorder(str string) string {\n\tvar (\n\t\ttopSet    = s.isSet(borderTopKey)\n\t\trightSet  = s.isSet(borderRightKey)\n\t\tbottomSet = s.isSet(borderBottomKey)\n\t\tleftSet   = s.isSet(borderLeftKey)\n\n\t\tborder    = s.getBorderStyle()\n\t\thasTop    = s.getAsBool(borderTopKey, false)\n\t\thasRight  = s.getAsBool(borderRightKey, false)\n\t\thasBottom = s.getAsBool(borderBottomKey, false)\n\t\thasLeft   = s.getAsBool(borderLeftKey, false)\n\n\t\ttopFG    = s.getAsColor(borderTopForegroundKey)\n\t\trightFG  = s.getAsColor(borderRightForegroundKey)\n\t\tbottomFG = s.getAsColor(borderBottomForegroundKey)\n\t\tleftFG   = s.getAsColor(borderLeftForegroundKey)\n\n\t\ttopBG    = s.getAsColor(borderTopBackgroundKey)\n\t\trightBG  = s.getAsColor(borderRightBackgroundKey)\n\t\tbottomBG = s.getAsColor(borderBottomBackgroundKey)\n\t\tleftBG   = s.getAsColor(borderLeftBackgroundKey)\n\t)\n\n\t// If a border is set and no sides have been specifically turned on or off\n\t// render borders on all sides.\n\tif border != noBorder && !(topSet || rightSet || bottomSet || leftSet) {\n\t\thasTop = true\n\t\thasRight = true\n\t\thasBottom = true\n\t\thasLeft = true\n\t}\n\n\t// If no border is set or all borders are been disabled, abort.\n\tif border == noBorder || (!hasTop && !hasRight && !hasBottom && !hasLeft) {\n\t\treturn str\n\t}\n\n\tlines, width := getLines(str)\n\n\tif hasLeft {\n\t\tif border.Left == \"\" {\n\t\t\tborder.Left = \" \"\n\t\t}\n\t\twidth += maxRuneWidth(border.Left)\n\t}\n\n\tif hasRight && border.Right == \"\" {\n\t\tborder.Right = \" \"\n\t}\n\n\t// If corners should be rendered but are set with the empty string, fill them\n\t// with a single space.\n\tif hasTop && hasLeft && border.TopLeft == \"\" {\n\t\tborder.TopLeft = \" \"\n\t}\n\tif hasTop && hasRight && border.TopRight == \"\" {\n\t\tborder.TopRight = \" \"\n\t}\n\tif hasBottom && hasLeft && border.BottomLeft == \"\" {\n\t\tborder.BottomLeft = \" \"\n\t}\n\tif hasBottom && hasRight && border.BottomRight == \"\" {\n\t\tborder.BottomRight = \" \"\n\t}\n\n\t// Figure out which corners we should actually be using based on which\n\t// sides are set to show.\n\tif hasTop {\n\t\tswitch {\n\t\tcase !hasLeft && !hasRight:\n\t\t\tborder.TopLeft = \"\"\n\t\t\tborder.TopRight = \"\"\n\t\tcase !hasLeft:\n\t\t\tborder.TopLeft = \"\"\n\t\tcase !hasRight:\n\t\t\tborder.TopRight = \"\"\n\t\t}\n\t}\n\tif hasBottom {\n\t\tswitch {\n\t\tcase !hasLeft && !hasRight:\n\t\t\tborder.BottomLeft = \"\"\n\t\t\tborder.BottomRight = \"\"\n\t\tcase !hasLeft:\n\t\t\tborder.BottomLeft = \"\"\n\t\tcase !hasRight:\n\t\t\tborder.BottomRight = \"\"\n\t\t}\n\t}\n\n\t// For now, limit corners to one rune.\n\tborder.TopLeft = getFirstRuneAsString(border.TopLeft)\n\tborder.TopRight = getFirstRuneAsString(border.TopRight)\n\tborder.BottomRight = getFirstRuneAsString(border.BottomRight)\n\tborder.BottomLeft = getFirstRuneAsString(border.BottomLeft)\n\n\tvar out strings.Builder\n\n\t// Render top\n\tif hasTop {\n\t\ttop := renderHorizontalEdge(border.TopLeft, border.Top, border.TopRight, width)\n\t\ttop = s.styleBorder(top, topFG, topBG)\n\t\tout.WriteString(top)\n\t\tout.WriteRune('\\n')\n\t}\n\n\tleftRunes := []rune(border.Left)\n\tleftIndex := 0\n\n\trightRunes := []rune(border.Right)\n\trightIndex := 0\n\n\t// Render sides\n\tfor i, l := range lines {\n\t\tif hasLeft {\n\t\t\tr := string(leftRunes[leftIndex])\n\t\t\tleftIndex++\n\t\t\tif leftIndex >= len(leftRunes) {\n\t\t\t\tleftIndex = 0\n\t\t\t}\n\t\t\tout.WriteString(s.styleBorder(r, leftFG, leftBG))\n\t\t}\n\t\tout.WriteString(l)\n\t\tif hasRight {\n\t\t\tr := string(rightRunes[rightIndex])\n\t\t\trightIndex++\n\t\t\tif rightIndex >= len(rightRunes) {\n\t\t\t\trightIndex = 0\n\t\t\t}\n\t\t\tout.WriteString(s.styleBorder(r, rightFG, rightBG))\n\t\t}\n\t\tif i < len(lines)-1 {\n\t\t\tout.WriteRune('\\n')\n\t\t}\n\t}\n\n\t// Render bottom\n\tif hasBottom {\n\t\tbottom := renderHorizontalEdge(border.BottomLeft, border.Bottom, border.BottomRight, width)\n\t\tbottom = s.styleBorder(bottom, bottomFG, bottomBG)\n\t\tout.WriteRune('\\n')\n\t\tout.WriteString(bottom)\n\t}\n\n\treturn out.String()\n}\n\n// Render the horizontal (top or bottom) portion of a border.\nfunc renderHorizontalEdge(left, middle, right string, width int) string {\n\tif middle == \"\" {\n\t\tmiddle = \" \"\n\t}\n\n\tleftWidth := ansi.StringWidth(left)\n\trightWidth := ansi.StringWidth(right)\n\n\trunes := []rune(middle)\n\tj := 0\n\n\tout := strings.Builder{}\n\tout.WriteString(left)\n\tfor i := leftWidth + rightWidth; i < width+rightWidth; {\n\t\tout.WriteRune(runes[j])\n\t\tj++\n\t\tif j >= len(runes) {\n\t\t\tj = 0\n\t\t}\n\t\ti += ansi.StringWidth(string(runes[j]))\n\t}\n\tout.WriteString(right)\n\n\treturn out.String()\n}\n\n// Apply foreground and background styling to a border.\nfunc (s Style) styleBorder(border string, fg, bg TerminalColor) string {\n\tif fg == noColor && bg == noColor {\n\t\treturn border\n\t}\n\n\tstyle := termenv.Style{}\n\n\tif fg != noColor {\n\t\tstyle = style.Foreground(fg.color(s.r))\n\t}\n\tif bg != noColor {\n\t\tstyle = style.Background(bg.color(s.r))\n\t}\n\n\treturn style.Styled(border)\n}\n\nfunc maxRuneWidth(str string) int {\n\tvar width int\n\n\tstate := -1\n\tfor len(str) > 0 {\n\t\tvar w int\n\t\t_, str, w, state = uniseg.FirstGraphemeClusterInString(str, state)\n\t\tif w > width {\n\t\t\twidth = w\n\t\t}\n\t}\n\n\treturn width\n}\n\nfunc getFirstRuneAsString(str string) string {\n\tif str == \"\" {\n\t\treturn str\n\t}\n\tr := []rune(str)\n\treturn string(r[0])\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/color.go",
    "content": "package lipgloss\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/muesli/termenv\"\n)\n\n// TerminalColor is a color intended to be rendered in the terminal.\ntype TerminalColor interface {\n\tcolor(*Renderer) termenv.Color\n\tRGBA() (r, g, b, a uint32)\n}\n\nvar noColor = NoColor{}\n\n// NoColor is used to specify the absence of color styling. When this is active\n// foreground colors will be rendered with the terminal's default text color,\n// and background colors will not be drawn at all.\n//\n// Example usage:\n//\n//\tvar style = someStyle.Background(lipgloss.NoColor{})\ntype NoColor struct{}\n\nfunc (NoColor) color(*Renderer) termenv.Color {\n\treturn termenv.NoColor{}\n}\n\n// RGBA returns the RGBA value of this color. Because we have to return\n// something, despite this color being the absence of color, we're returning\n// black with 100% opacity.\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n//\n// Deprecated.\nfunc (n NoColor) RGBA() (r, g, b, a uint32) {\n\treturn 0x0, 0x0, 0x0, 0xFFFF //nolint:gomnd\n}\n\n// Color specifies a color by hex or ANSI value. For example:\n//\n//\tansiColor := lipgloss.Color(\"21\")\n//\thexColor := lipgloss.Color(\"#0000ff\")\ntype Color string\n\nfunc (c Color) color(r *Renderer) termenv.Color {\n\treturn r.ColorProfile().Color(string(c))\n}\n\n// RGBA returns the RGBA value of this color. This satisfies the Go Color\n// interface. Note that on error we return black with 100% opacity, or:\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n//\n// Deprecated.\nfunc (c Color) RGBA() (r, g, b, a uint32) {\n\treturn termenv.ConvertToRGB(c.color(renderer)).RGBA()\n}\n\n// ANSIColor is a color specified by an ANSI color value. It's merely syntactic\n// sugar for the more general Color function. Invalid colors will render as\n// black.\n//\n// Example usage:\n//\n//\t// These two statements are equivalent.\n//\tcolorA := lipgloss.ANSIColor(21)\n//\tcolorB := lipgloss.Color(\"21\")\ntype ANSIColor uint\n\nfunc (ac ANSIColor) color(r *Renderer) termenv.Color {\n\treturn Color(strconv.FormatUint(uint64(ac), 10)).color(r)\n}\n\n// RGBA returns the RGBA value of this color. This satisfies the Go Color\n// interface. Note that on error we return black with 100% opacity, or:\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n//\n// Deprecated.\nfunc (ac ANSIColor) RGBA() (r, g, b, a uint32) {\n\tcf := Color(strconv.FormatUint(uint64(ac), 10))\n\treturn cf.RGBA()\n}\n\n// AdaptiveColor provides color options for light and dark backgrounds. The\n// appropriate color will be returned at runtime based on the darkness of the\n// terminal background color.\n//\n// Example usage:\n//\n//\tcolor := lipgloss.AdaptiveColor{Light: \"#0000ff\", Dark: \"#000099\"}\ntype AdaptiveColor struct {\n\tLight string\n\tDark  string\n}\n\nfunc (ac AdaptiveColor) color(r *Renderer) termenv.Color {\n\tif r.HasDarkBackground() {\n\t\treturn Color(ac.Dark).color(r)\n\t}\n\treturn Color(ac.Light).color(r)\n}\n\n// RGBA returns the RGBA value of this color. This satisfies the Go Color\n// interface. Note that on error we return black with 100% opacity, or:\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n//\n// Deprecated.\nfunc (ac AdaptiveColor) RGBA() (r, g, b, a uint32) {\n\treturn termenv.ConvertToRGB(ac.color(renderer)).RGBA()\n}\n\n// CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color\n// profiles. Automatic color degradation will not be performed.\ntype CompleteColor struct {\n\tTrueColor string\n\tANSI256   string\n\tANSI      string\n}\n\nfunc (c CompleteColor) color(r *Renderer) termenv.Color {\n\tp := r.ColorProfile()\n\tswitch p { //nolint:exhaustive\n\tcase termenv.TrueColor:\n\t\treturn p.Color(c.TrueColor)\n\tcase termenv.ANSI256:\n\t\treturn p.Color(c.ANSI256)\n\tcase termenv.ANSI:\n\t\treturn p.Color(c.ANSI)\n\tdefault:\n\t\treturn termenv.NoColor{}\n\t}\n}\n\n// RGBA returns the RGBA value of this color. This satisfies the Go Color\n// interface. Note that on error we return black with 100% opacity, or:\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n// CompleteAdaptiveColor specifies exact values for truecolor, ANSI256, and ANSI color\n//\n// Deprecated.\nfunc (c CompleteColor) RGBA() (r, g, b, a uint32) {\n\treturn termenv.ConvertToRGB(c.color(renderer)).RGBA()\n}\n\n// CompleteAdaptiveColor specifies exact values for truecolor, ANSI256, and ANSI color\n// profiles, with separate options for light and dark backgrounds. Automatic\n// color degradation will not be performed.\ntype CompleteAdaptiveColor struct {\n\tLight CompleteColor\n\tDark  CompleteColor\n}\n\nfunc (cac CompleteAdaptiveColor) color(r *Renderer) termenv.Color {\n\tif r.HasDarkBackground() {\n\t\treturn cac.Dark.color(r)\n\t}\n\treturn cac.Light.color(r)\n}\n\n// RGBA returns the RGBA value of this color. This satisfies the Go Color\n// interface. Note that on error we return black with 100% opacity, or:\n//\n// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF.\n//\n// Deprecated.\nfunc (cac CompleteAdaptiveColor) RGBA() (r, g, b, a uint32) {\n\treturn termenv.ConvertToRGB(cac.color(renderer)).RGBA()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/get.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n)\n\n// GetBold returns the style's bold value. If no value is set false is returned.\nfunc (s Style) GetBold() bool {\n\treturn s.getAsBool(boldKey, false)\n}\n\n// GetItalic returns the style's italic value. If no value is set false is\n// returned.\nfunc (s Style) GetItalic() bool {\n\treturn s.getAsBool(italicKey, false)\n}\n\n// GetUnderline returns the style's underline value. If no value is set false is\n// returned.\nfunc (s Style) GetUnderline() bool {\n\treturn s.getAsBool(underlineKey, false)\n}\n\n// GetStrikethrough returns the style's strikethrough value. If no value is set false\n// is returned.\nfunc (s Style) GetStrikethrough() bool {\n\treturn s.getAsBool(strikethroughKey, false)\n}\n\n// GetReverse returns the style's reverse value. If no value is set false is\n// returned.\nfunc (s Style) GetReverse() bool {\n\treturn s.getAsBool(reverseKey, false)\n}\n\n// GetBlink returns the style's blink value. If no value is set false is\n// returned.\nfunc (s Style) GetBlink() bool {\n\treturn s.getAsBool(blinkKey, false)\n}\n\n// GetFaint returns the style's faint value. If no value is set false is\n// returned.\nfunc (s Style) GetFaint() bool {\n\treturn s.getAsBool(faintKey, false)\n}\n\n// GetForeground returns the style's foreground color. If no value is set\n// NoColor{} is returned.\nfunc (s Style) GetForeground() TerminalColor {\n\treturn s.getAsColor(foregroundKey)\n}\n\n// GetBackground returns the style's background color. If no value is set\n// NoColor{} is returned.\nfunc (s Style) GetBackground() TerminalColor {\n\treturn s.getAsColor(backgroundKey)\n}\n\n// GetWidth returns the style's width setting. If no width is set 0 is\n// returned.\nfunc (s Style) GetWidth() int {\n\treturn s.getAsInt(widthKey)\n}\n\n// GetHeight returns the style's height setting. If no height is set 0 is\n// returned.\nfunc (s Style) GetHeight() int {\n\treturn s.getAsInt(heightKey)\n}\n\n// GetAlign returns the style's implicit horizontal alignment setting.\n// If no alignment is set Position.Left is returned.\nfunc (s Style) GetAlign() Position {\n\tv := s.getAsPosition(alignHorizontalKey)\n\tif v == Position(0) {\n\t\treturn Left\n\t}\n\treturn v\n}\n\n// GetAlignHorizontal returns the style's implicit horizontal alignment setting.\n// If no alignment is set Position.Left is returned.\nfunc (s Style) GetAlignHorizontal() Position {\n\tv := s.getAsPosition(alignHorizontalKey)\n\tif v == Position(0) {\n\t\treturn Left\n\t}\n\treturn v\n}\n\n// GetAlignVertical returns the style's implicit vertical alignment setting.\n// If no alignment is set Position.Top is returned.\nfunc (s Style) GetAlignVertical() Position {\n\tv := s.getAsPosition(alignVerticalKey)\n\tif v == Position(0) {\n\t\treturn Top\n\t}\n\treturn v\n}\n\n// GetPadding returns the style's top, right, bottom, and left padding values,\n// in that order. 0 is returned for unset values.\nfunc (s Style) GetPadding() (top, right, bottom, left int) {\n\treturn s.getAsInt(paddingTopKey),\n\t\ts.getAsInt(paddingRightKey),\n\t\ts.getAsInt(paddingBottomKey),\n\t\ts.getAsInt(paddingLeftKey)\n}\n\n// GetPaddingTop returns the style's top padding. If no value is set 0 is\n// returned.\nfunc (s Style) GetPaddingTop() int {\n\treturn s.getAsInt(paddingTopKey)\n}\n\n// GetPaddingRight returns the style's right padding. If no value is set 0 is\n// returned.\nfunc (s Style) GetPaddingRight() int {\n\treturn s.getAsInt(paddingRightKey)\n}\n\n// GetPaddingBottom returns the style's bottom padding. If no value is set 0 is\n// returned.\nfunc (s Style) GetPaddingBottom() int {\n\treturn s.getAsInt(paddingBottomKey)\n}\n\n// GetPaddingLeft returns the style's left padding. If no value is set 0 is\n// returned.\nfunc (s Style) GetPaddingLeft() int {\n\treturn s.getAsInt(paddingLeftKey)\n}\n\n// GetHorizontalPadding returns the style's left and right padding. Unset\n// values are measured as 0.\nfunc (s Style) GetHorizontalPadding() int {\n\treturn s.getAsInt(paddingLeftKey) + s.getAsInt(paddingRightKey)\n}\n\n// GetVerticalPadding returns the style's top and bottom padding. Unset values\n// are measured as 0.\nfunc (s Style) GetVerticalPadding() int {\n\treturn s.getAsInt(paddingTopKey) + s.getAsInt(paddingBottomKey)\n}\n\n// GetColorWhitespace returns the style's whitespace coloring setting. If no\n// value is set false is returned.\nfunc (s Style) GetColorWhitespace() bool {\n\treturn s.getAsBool(colorWhitespaceKey, false)\n}\n\n// GetMargin returns the style's top, right, bottom, and left margins, in that\n// order. 0 is returned for unset values.\nfunc (s Style) GetMargin() (top, right, bottom, left int) {\n\treturn s.getAsInt(marginTopKey),\n\t\ts.getAsInt(marginRightKey),\n\t\ts.getAsInt(marginBottomKey),\n\t\ts.getAsInt(marginLeftKey)\n}\n\n// GetMarginTop returns the style's top margin. If no value is set 0 is\n// returned.\nfunc (s Style) GetMarginTop() int {\n\treturn s.getAsInt(marginTopKey)\n}\n\n// GetMarginRight returns the style's right margin. If no value is set 0 is\n// returned.\nfunc (s Style) GetMarginRight() int {\n\treturn s.getAsInt(marginRightKey)\n}\n\n// GetMarginBottom returns the style's bottom margin. If no value is set 0 is\n// returned.\nfunc (s Style) GetMarginBottom() int {\n\treturn s.getAsInt(marginBottomKey)\n}\n\n// GetMarginLeft returns the style's left margin. If no value is set 0 is\n// returned.\nfunc (s Style) GetMarginLeft() int {\n\treturn s.getAsInt(marginLeftKey)\n}\n\n// GetHorizontalMargins returns the style's left and right margins. Unset\n// values are measured as 0.\nfunc (s Style) GetHorizontalMargins() int {\n\treturn s.getAsInt(marginLeftKey) + s.getAsInt(marginRightKey)\n}\n\n// GetVerticalMargins returns the style's top and bottom margins. Unset values\n// are measured as 0.\nfunc (s Style) GetVerticalMargins() int {\n\treturn s.getAsInt(marginTopKey) + s.getAsInt(marginBottomKey)\n}\n\n// GetBorder returns the style's border style (type Border) and value for the\n// top, right, bottom, and left in that order. If no value is set for the\n// border style, Border{} is returned. For all other unset values false is\n// returned.\nfunc (s Style) GetBorder() (b Border, top, right, bottom, left bool) {\n\treturn s.getBorderStyle(),\n\t\ts.getAsBool(borderTopKey, false),\n\t\ts.getAsBool(borderRightKey, false),\n\t\ts.getAsBool(borderBottomKey, false),\n\t\ts.getAsBool(borderLeftKey, false)\n}\n\n// GetBorderStyle returns the style's border style (type Border). If no value\n// is set Border{} is returned.\nfunc (s Style) GetBorderStyle() Border {\n\treturn s.getBorderStyle()\n}\n\n// GetBorderTop returns the style's top border setting. If no value is set\n// false is returned.\nfunc (s Style) GetBorderTop() bool {\n\treturn s.getAsBool(borderTopKey, false)\n}\n\n// GetBorderRight returns the style's right border setting. If no value is set\n// false is returned.\nfunc (s Style) GetBorderRight() bool {\n\treturn s.getAsBool(borderRightKey, false)\n}\n\n// GetBorderBottom returns the style's bottom border setting. If no value is\n// set false is returned.\nfunc (s Style) GetBorderBottom() bool {\n\treturn s.getAsBool(borderBottomKey, false)\n}\n\n// GetBorderLeft returns the style's left border setting. If no value is\n// set false is returned.\nfunc (s Style) GetBorderLeft() bool {\n\treturn s.getAsBool(borderLeftKey, false)\n}\n\n// GetBorderTopForeground returns the style's border top foreground color. If\n// no value is set NoColor{} is returned.\nfunc (s Style) GetBorderTopForeground() TerminalColor {\n\treturn s.getAsColor(borderTopForegroundKey)\n}\n\n// GetBorderRightForeground returns the style's border right foreground color.\n// If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderRightForeground() TerminalColor {\n\treturn s.getAsColor(borderRightForegroundKey)\n}\n\n// GetBorderBottomForeground returns the style's border bottom foreground\n// color.  If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderBottomForeground() TerminalColor {\n\treturn s.getAsColor(borderBottomForegroundKey)\n}\n\n// GetBorderLeftForeground returns the style's border left foreground\n// color.  If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderLeftForeground() TerminalColor {\n\treturn s.getAsColor(borderLeftForegroundKey)\n}\n\n// GetBorderTopBackground returns the style's border top background color. If\n// no value is set NoColor{} is returned.\nfunc (s Style) GetBorderTopBackground() TerminalColor {\n\treturn s.getAsColor(borderTopBackgroundKey)\n}\n\n// GetBorderRightBackground returns the style's border right background color.\n// If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderRightBackground() TerminalColor {\n\treturn s.getAsColor(borderRightBackgroundKey)\n}\n\n// GetBorderBottomBackground returns the style's border bottom background\n// color.  If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderBottomBackground() TerminalColor {\n\treturn s.getAsColor(borderBottomBackgroundKey)\n}\n\n// GetBorderLeftBackground returns the style's border left background\n// color.  If no value is set NoColor{} is returned.\nfunc (s Style) GetBorderLeftBackground() TerminalColor {\n\treturn s.getAsColor(borderLeftBackgroundKey)\n}\n\n// GetBorderTopWidth returns the width of the top border. If borders contain\n// runes of varying widths, the widest rune is returned. If no border exists on\n// the top edge, 0 is returned.\n//\n// Deprecated: This function simply calls Style.GetBorderTopSize.\nfunc (s Style) GetBorderTopWidth() int {\n\treturn s.GetBorderTopSize()\n}\n\n// GetBorderTopSize returns the width of the top border. If borders contain\n// runes of varying widths, the widest rune is returned. If no border exists on\n// the top edge, 0 is returned.\nfunc (s Style) GetBorderTopSize() int {\n\tif !s.getAsBool(borderTopKey, false) {\n\t\treturn 0\n\t}\n\treturn s.getBorderStyle().GetTopSize()\n}\n\n// GetBorderLeftSize returns the width of the left border. If borders contain\n// runes of varying widths, the widest rune is returned. If no border exists on\n// the left edge, 0 is returned.\nfunc (s Style) GetBorderLeftSize() int {\n\tif !s.getAsBool(borderLeftKey, false) {\n\t\treturn 0\n\t}\n\treturn s.getBorderStyle().GetLeftSize()\n}\n\n// GetBorderBottomSize returns the width of the bottom border. If borders\n// contain runes of varying widths, the widest rune is returned. If no border\n// exists on the left edge, 0 is returned.\nfunc (s Style) GetBorderBottomSize() int {\n\tif !s.getAsBool(borderBottomKey, false) {\n\t\treturn 0\n\t}\n\treturn s.getBorderStyle().GetBottomSize()\n}\n\n// GetBorderRightSize returns the width of the right border. If borders\n// contain runes of varying widths, the widest rune is returned. If no border\n// exists on the right edge, 0 is returned.\nfunc (s Style) GetBorderRightSize() int {\n\tif !s.getAsBool(borderRightKey, false) {\n\t\treturn 0\n\t}\n\treturn s.getBorderStyle().GetRightSize()\n}\n\n// GetHorizontalBorderSize returns the width of the horizontal borders. If\n// borders contain runes of varying widths, the widest rune is returned. If no\n// border exists on the horizontal edges, 0 is returned.\nfunc (s Style) GetHorizontalBorderSize() int {\n\treturn s.GetBorderLeftSize() + s.GetBorderRightSize()\n}\n\n// GetVerticalBorderSize returns the width of the vertical borders. If\n// borders contain runes of varying widths, the widest rune is returned. If no\n// border exists on the vertical edges, 0 is returned.\nfunc (s Style) GetVerticalBorderSize() int {\n\treturn s.GetBorderTopSize() + s.GetBorderBottomSize()\n}\n\n// GetInline returns the style's inline setting. If no value is set false is\n// returned.\nfunc (s Style) GetInline() bool {\n\treturn s.getAsBool(inlineKey, false)\n}\n\n// GetMaxWidth returns the style's max width setting. If no value is set 0 is\n// returned.\nfunc (s Style) GetMaxWidth() int {\n\treturn s.getAsInt(maxWidthKey)\n}\n\n// GetMaxHeight returns the style's max height setting. If no value is set 0 is\n// returned.\nfunc (s Style) GetMaxHeight() int {\n\treturn s.getAsInt(maxHeightKey)\n}\n\n// GetTabWidth returns the style's tab width setting. If no value is set 4 is\n// returned which is the implicit default.\nfunc (s Style) GetTabWidth() int {\n\treturn s.getAsInt(tabWidthKey)\n}\n\n// GetUnderlineSpaces returns whether or not the style is set to underline\n// spaces. If not value is set false is returned.\nfunc (s Style) GetUnderlineSpaces() bool {\n\treturn s.getAsBool(underlineSpacesKey, false)\n}\n\n// GetStrikethroughSpaces returns whether or not the style is set to strikethrough\n// spaces. If not value is set false is returned.\nfunc (s Style) GetStrikethroughSpaces() bool {\n\treturn s.getAsBool(strikethroughSpacesKey, false)\n}\n\n// GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding\n// and border widths.\n//\n// Provisional: this method may be renamed.\nfunc (s Style) GetHorizontalFrameSize() int {\n\treturn s.GetHorizontalMargins() + s.GetHorizontalPadding() + s.GetHorizontalBorderSize()\n}\n\n// GetVerticalFrameSize returns the sum of the style's vertical margins, padding\n// and border widths.\n//\n// Provisional: this method may be renamed.\nfunc (s Style) GetVerticalFrameSize() int {\n\treturn s.GetVerticalMargins() + s.GetVerticalPadding() + s.GetVerticalBorderSize()\n}\n\n// GetFrameSize returns the sum of the margins, padding and border width for\n// both the horizontal and vertical margins.\nfunc (s Style) GetFrameSize() (x, y int) {\n\treturn s.GetHorizontalFrameSize(), s.GetVerticalFrameSize()\n}\n\n// GetTransform returns the transform set on the style. If no transform is set\n// nil is returned.\nfunc (s Style) GetTransform() func(string) string {\n\treturn s.getAsTransform(transformKey)\n}\n\n// Returns whether or not the given property is set.\nfunc (s Style) isSet(k propKey) bool {\n\treturn s.props.has(k)\n}\n\nfunc (s Style) getAsBool(k propKey, defaultVal bool) bool {\n\tif !s.isSet(k) {\n\t\treturn defaultVal\n\t}\n\treturn s.attrs&int(k) != 0\n}\n\nfunc (s Style) getAsColor(k propKey) TerminalColor {\n\tif !s.isSet(k) {\n\t\treturn noColor\n\t}\n\n\tvar c TerminalColor\n\tswitch k { //nolint:exhaustive\n\tcase foregroundKey:\n\t\tc = s.fgColor\n\tcase backgroundKey:\n\t\tc = s.bgColor\n\tcase marginBackgroundKey:\n\t\tc = s.marginBgColor\n\tcase borderTopForegroundKey:\n\t\tc = s.borderTopFgColor\n\tcase borderRightForegroundKey:\n\t\tc = s.borderRightFgColor\n\tcase borderBottomForegroundKey:\n\t\tc = s.borderBottomFgColor\n\tcase borderLeftForegroundKey:\n\t\tc = s.borderLeftFgColor\n\tcase borderTopBackgroundKey:\n\t\tc = s.borderTopBgColor\n\tcase borderRightBackgroundKey:\n\t\tc = s.borderRightBgColor\n\tcase borderBottomBackgroundKey:\n\t\tc = s.borderBottomBgColor\n\tcase borderLeftBackgroundKey:\n\t\tc = s.borderLeftBgColor\n\t}\n\n\tif c != nil {\n\t\treturn c\n\t}\n\n\treturn noColor\n}\n\nfunc (s Style) getAsInt(k propKey) int {\n\tif !s.isSet(k) {\n\t\treturn 0\n\t}\n\tswitch k { //nolint:exhaustive\n\tcase widthKey:\n\t\treturn s.width\n\tcase heightKey:\n\t\treturn s.height\n\tcase paddingTopKey:\n\t\treturn s.paddingTop\n\tcase paddingRightKey:\n\t\treturn s.paddingRight\n\tcase paddingBottomKey:\n\t\treturn s.paddingBottom\n\tcase paddingLeftKey:\n\t\treturn s.paddingLeft\n\tcase marginTopKey:\n\t\treturn s.marginTop\n\tcase marginRightKey:\n\t\treturn s.marginRight\n\tcase marginBottomKey:\n\t\treturn s.marginBottom\n\tcase marginLeftKey:\n\t\treturn s.marginLeft\n\tcase maxWidthKey:\n\t\treturn s.maxWidth\n\tcase maxHeightKey:\n\t\treturn s.maxHeight\n\tcase tabWidthKey:\n\t\treturn s.tabWidth\n\t}\n\treturn 0\n}\n\nfunc (s Style) getAsPosition(k propKey) Position {\n\tif !s.isSet(k) {\n\t\treturn Position(0)\n\t}\n\tswitch k { //nolint:exhaustive\n\tcase alignHorizontalKey:\n\t\treturn s.alignHorizontal\n\tcase alignVerticalKey:\n\t\treturn s.alignVertical\n\t}\n\treturn Position(0)\n}\n\nfunc (s Style) getBorderStyle() Border {\n\tif !s.isSet(borderStyleKey) {\n\t\treturn noBorder\n\t}\n\treturn s.borderStyle\n}\n\nfunc (s Style) getAsTransform(propKey) func(string) string {\n\tif !s.isSet(transformKey) {\n\t\treturn nil\n\t}\n\treturn s.transform\n}\n\n// Split a string into lines, additionally returning the size of the widest\n// line.\nfunc getLines(s string) (lines []string, widest int) {\n\tlines = strings.Split(s, \"\\n\")\n\n\tfor _, l := range lines {\n\t\tw := ansi.StringWidth(l)\n\t\tif widest < w {\n\t\t\twidest = w\n\t\t}\n\t}\n\n\treturn lines, widest\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/join.go",
    "content": "package lipgloss\n\nimport (\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n)\n\n// JoinHorizontal is a utility function for horizontally joining two\n// potentially multi-lined strings along a vertical axis. The first argument is\n// the position, with 0 being all the way at the top and 1 being all the way\n// at the bottom.\n//\n// If you just want to align to the top, center or bottom you may as well just\n// use the helper constants Top, Center, and Bottom.\n//\n// Example:\n//\n//\tblockB := \"...\\n...\\n...\"\n//\tblockA := \"...\\n...\\n...\\n...\\n...\"\n//\n//\t// Join 20% from the top\n//\tstr := lipgloss.JoinHorizontal(0.2, blockA, blockB)\n//\n//\t// Join on the top edge\n//\tstr := lipgloss.JoinHorizontal(lipgloss.Top, blockA, blockB)\nfunc JoinHorizontal(pos Position, strs ...string) string {\n\tif len(strs) == 0 {\n\t\treturn \"\"\n\t}\n\tif len(strs) == 1 {\n\t\treturn strs[0]\n\t}\n\n\tvar (\n\t\t// Groups of strings broken into multiple lines\n\t\tblocks = make([][]string, len(strs))\n\n\t\t// Max line widths for the above text blocks\n\t\tmaxWidths = make([]int, len(strs))\n\n\t\t// Height of the tallest block\n\t\tmaxHeight int\n\t)\n\n\t// Break text blocks into lines and get max widths for each text block\n\tfor i, str := range strs {\n\t\tblocks[i], maxWidths[i] = getLines(str)\n\t\tif len(blocks[i]) > maxHeight {\n\t\t\tmaxHeight = len(blocks[i])\n\t\t}\n\t}\n\n\t// Add extra lines to make each side the same height\n\tfor i := range blocks {\n\t\tif len(blocks[i]) >= maxHeight {\n\t\t\tcontinue\n\t\t}\n\n\t\textraLines := make([]string, maxHeight-len(blocks[i]))\n\n\t\tswitch pos { //nolint:exhaustive\n\t\tcase Top:\n\t\t\tblocks[i] = append(blocks[i], extraLines...)\n\n\t\tcase Bottom:\n\t\t\tblocks[i] = append(extraLines, blocks[i]...)\n\n\t\tdefault: // Somewhere in the middle\n\t\t\tn := len(extraLines)\n\t\t\tsplit := int(math.Round(float64(n) * pos.value()))\n\t\t\ttop := n - split\n\t\t\tbottom := n - top\n\n\t\t\tblocks[i] = append(extraLines[top:], blocks[i]...)\n\t\t\tblocks[i] = append(blocks[i], extraLines[bottom:]...)\n\t\t}\n\t}\n\n\t// Merge lines\n\tvar b strings.Builder\n\tfor i := range blocks[0] { // remember, all blocks have the same number of members now\n\t\tfor j, block := range blocks {\n\t\t\tb.WriteString(block[i])\n\n\t\t\t// Also make lines the same length\n\t\t\tb.WriteString(strings.Repeat(\" \", maxWidths[j]-ansi.StringWidth(block[i])))\n\t\t}\n\t\tif i < len(blocks[0])-1 {\n\t\t\tb.WriteRune('\\n')\n\t\t}\n\t}\n\n\treturn b.String()\n}\n\n// JoinVertical is a utility function for vertically joining two potentially\n// multi-lined strings along a horizontal axis. The first argument is the\n// position, with 0 being all the way to the left and 1 being all the way to\n// the right.\n//\n// If you just want to align to the left, right or center you may as well just\n// use the helper constants Left, Center, and Right.\n//\n// Example:\n//\n//\tblockB := \"...\\n...\\n...\"\n//\tblockA := \"...\\n...\\n...\\n...\\n...\"\n//\n//\t// Join 20% from the top\n//\tstr := lipgloss.JoinVertical(0.2, blockA, blockB)\n//\n//\t// Join on the right edge\n//\tstr := lipgloss.JoinVertical(lipgloss.Right, blockA, blockB)\nfunc JoinVertical(pos Position, strs ...string) string {\n\tif len(strs) == 0 {\n\t\treturn \"\"\n\t}\n\tif len(strs) == 1 {\n\t\treturn strs[0]\n\t}\n\n\tvar (\n\t\tblocks   = make([][]string, len(strs))\n\t\tmaxWidth int\n\t)\n\n\tfor i := range strs {\n\t\tvar w int\n\t\tblocks[i], w = getLines(strs[i])\n\t\tif w > maxWidth {\n\t\t\tmaxWidth = w\n\t\t}\n\t}\n\n\tvar b strings.Builder\n\tfor i, block := range blocks {\n\t\tfor j, line := range block {\n\t\t\tw := maxWidth - ansi.StringWidth(line)\n\n\t\t\tswitch pos { //nolint:exhaustive\n\t\t\tcase Left:\n\t\t\t\tb.WriteString(line)\n\t\t\t\tb.WriteString(strings.Repeat(\" \", w))\n\n\t\t\tcase Right:\n\t\t\t\tb.WriteString(strings.Repeat(\" \", w))\n\t\t\t\tb.WriteString(line)\n\n\t\t\tdefault: // Somewhere in the middle\n\t\t\t\tif w < 1 {\n\t\t\t\t\tb.WriteString(line)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tsplit := int(math.Round(float64(w) * pos.value()))\n\t\t\t\tright := w - split\n\t\t\t\tleft := w - right\n\n\t\t\t\tb.WriteString(strings.Repeat(\" \", left))\n\t\t\t\tb.WriteString(line)\n\t\t\t\tb.WriteString(strings.Repeat(\" \", right))\n\t\t\t}\n\n\t\t\t// Write a newline as long as we're not on the last line of the\n\t\t\t// last block.\n\t\t\tif !(i == len(blocks)-1 && j == len(block)-1) {\n\t\t\t\tb.WriteRune('\\n')\n\t\t\t}\n\t\t}\n\t}\n\n\treturn b.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/position.go",
    "content": "package lipgloss\n\nimport (\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n)\n\n// Position represents a position along a horizontal or vertical axis. It's in\n// situations where an axis is involved, like alignment, joining, placement and\n// so on.\n//\n// A value of 0 represents the start (the left or top) and 1 represents the end\n// (the right or bottom). 0.5 represents the center.\n//\n// There are constants Top, Bottom, Center, Left and Right in this package that\n// can be used to aid readability.\ntype Position float64\n\nfunc (p Position) value() float64 {\n\treturn math.Min(1, math.Max(0, float64(p)))\n}\n\n// Position aliases.\nconst (\n\tTop    Position = 0.0\n\tBottom Position = 1.0\n\tCenter Position = 0.5\n\tLeft   Position = 0.0\n\tRight  Position = 1.0\n)\n\n// Place places a string or text block vertically in an unstyled box of a given\n// width or height.\nfunc Place(width, height int, hPos, vPos Position, str string, opts ...WhitespaceOption) string {\n\treturn renderer.Place(width, height, hPos, vPos, str, opts...)\n}\n\n// Place places a string or text block vertically in an unstyled box of a given\n// width or height.\nfunc (r *Renderer) Place(width, height int, hPos, vPos Position, str string, opts ...WhitespaceOption) string {\n\treturn r.PlaceVertical(height, vPos, r.PlaceHorizontal(width, hPos, str, opts...), opts...)\n}\n\n// PlaceHorizontal places a string or text block horizontally in an unstyled\n// block of a given width. If the given width is shorter than the max width of\n// the string (measured by its longest line) this will be a noop.\nfunc PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOption) string {\n\treturn renderer.PlaceHorizontal(width, pos, str, opts...)\n}\n\n// PlaceHorizontal places a string or text block horizontally in an unstyled\n// block of a given width. If the given width is shorter than the max width of\n// the string (measured by its longest line) this will be a noöp.\nfunc (r *Renderer) PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOption) string {\n\tlines, contentWidth := getLines(str)\n\tgap := width - contentWidth\n\n\tif gap <= 0 {\n\t\treturn str\n\t}\n\n\tws := newWhitespace(r, opts...)\n\n\tvar b strings.Builder\n\tfor i, l := range lines {\n\t\t// Is this line shorter than the longest line?\n\t\tshort := max(0, contentWidth-ansi.StringWidth(l))\n\n\t\tswitch pos { //nolint:exhaustive\n\t\tcase Left:\n\t\t\tb.WriteString(l)\n\t\t\tb.WriteString(ws.render(gap + short))\n\n\t\tcase Right:\n\t\t\tb.WriteString(ws.render(gap + short))\n\t\t\tb.WriteString(l)\n\n\t\tdefault: // somewhere in the middle\n\t\t\ttotalGap := gap + short\n\n\t\t\tsplit := int(math.Round(float64(totalGap) * pos.value()))\n\t\t\tleft := totalGap - split\n\t\t\tright := totalGap - left\n\n\t\t\tb.WriteString(ws.render(left))\n\t\t\tb.WriteString(l)\n\t\t\tb.WriteString(ws.render(right))\n\t\t}\n\n\t\tif i < len(lines)-1 {\n\t\t\tb.WriteRune('\\n')\n\t\t}\n\t}\n\n\treturn b.String()\n}\n\n// PlaceVertical places a string or text block vertically in an unstyled block\n// of a given height. If the given height is shorter than the height of the\n// string (measured by its newlines) then this will be a noop.\nfunc PlaceVertical(height int, pos Position, str string, opts ...WhitespaceOption) string {\n\treturn renderer.PlaceVertical(height, pos, str, opts...)\n}\n\n// PlaceVertical places a string or text block vertically in an unstyled block\n// of a given height. If the given height is shorter than the height of the\n// string (measured by its newlines) then this will be a noöp.\nfunc (r *Renderer) PlaceVertical(height int, pos Position, str string, opts ...WhitespaceOption) string {\n\tcontentHeight := strings.Count(str, \"\\n\") + 1\n\tgap := height - contentHeight\n\n\tif gap <= 0 {\n\t\treturn str\n\t}\n\n\tws := newWhitespace(r, opts...)\n\n\t_, width := getLines(str)\n\temptyLine := ws.render(width)\n\tb := strings.Builder{}\n\n\tswitch pos { //nolint:exhaustive\n\tcase Top:\n\t\tb.WriteString(str)\n\t\tb.WriteRune('\\n')\n\t\tfor i := 0; i < gap; i++ {\n\t\t\tb.WriteString(emptyLine)\n\t\t\tif i < gap-1 {\n\t\t\t\tb.WriteRune('\\n')\n\t\t\t}\n\t\t}\n\n\tcase Bottom:\n\t\tb.WriteString(strings.Repeat(emptyLine+\"\\n\", gap))\n\t\tb.WriteString(str)\n\n\tdefault: // Somewhere in the middle\n\t\tsplit := int(math.Round(float64(gap) * pos.value()))\n\t\ttop := gap - split\n\t\tbottom := gap - top\n\n\t\tb.WriteString(strings.Repeat(emptyLine+\"\\n\", top))\n\t\tb.WriteString(str)\n\n\t\tfor i := 0; i < bottom; i++ {\n\t\t\tb.WriteRune('\\n')\n\t\t\tb.WriteString(emptyLine)\n\t\t}\n\t}\n\n\treturn b.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/renderer.go",
    "content": "package lipgloss\n\nimport (\n\t\"io\"\n\t\"sync\"\n\n\t\"github.com/muesli/termenv\"\n)\n\n// We're manually creating the struct here to avoid initializing the output and\n// query the terminal multiple times.\nvar renderer = &Renderer{\n\toutput: termenv.DefaultOutput(),\n}\n\n// Renderer is a lipgloss terminal renderer.\ntype Renderer struct {\n\toutput            *termenv.Output\n\tcolorProfile      termenv.Profile\n\thasDarkBackground bool\n\n\tgetColorProfile      sync.Once\n\texplicitColorProfile bool\n\n\tgetBackgroundColor      sync.Once\n\texplicitBackgroundColor bool\n\n\tmtx sync.RWMutex\n}\n\n// DefaultRenderer returns the default renderer.\nfunc DefaultRenderer() *Renderer {\n\treturn renderer\n}\n\n// SetDefaultRenderer sets the default global renderer.\nfunc SetDefaultRenderer(r *Renderer) {\n\trenderer = r\n}\n\n// NewRenderer creates a new Renderer.\n//\n// w will be used to determine the terminal's color capabilities.\nfunc NewRenderer(w io.Writer, opts ...termenv.OutputOption) *Renderer {\n\tr := &Renderer{\n\t\toutput: termenv.NewOutput(w, opts...),\n\t}\n\treturn r\n}\n\n// Output returns the termenv output.\nfunc (r *Renderer) Output() *termenv.Output {\n\tr.mtx.RLock()\n\tdefer r.mtx.RUnlock()\n\treturn r.output\n}\n\n// SetOutput sets the termenv output.\nfunc (r *Renderer) SetOutput(o *termenv.Output) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\tr.output = o\n}\n\n// ColorProfile returns the detected termenv color profile.\nfunc (r *Renderer) ColorProfile() termenv.Profile {\n\tr.mtx.RLock()\n\tdefer r.mtx.RUnlock()\n\n\tif !r.explicitColorProfile {\n\t\tr.getColorProfile.Do(func() {\n\t\t\t// NOTE: we don't need to lock here because sync.Once provides its\n\t\t\t// own locking mechanism.\n\t\t\tr.colorProfile = r.output.EnvColorProfile()\n\t\t})\n\t}\n\n\treturn r.colorProfile\n}\n\n// ColorProfile returns the detected termenv color profile.\nfunc ColorProfile() termenv.Profile {\n\treturn renderer.ColorProfile()\n}\n\n// SetColorProfile sets the color profile on the renderer. This function exists\n// mostly for testing purposes so that you can assure you're testing against\n// a specific profile.\n//\n// Outside of testing you likely won't want to use this function as the color\n// profile will detect and cache the terminal's color capabilities and choose\n// the best available profile.\n//\n// Available color profiles are:\n//\n//\ttermenv.Ascii     // no color, 1-bit\n//\ttermenv.ANSI      //16 colors, 4-bit\n//\ttermenv.ANSI256   // 256 colors, 8-bit\n//\ttermenv.TrueColor // 16,777,216 colors, 24-bit\n//\n// This function is thread-safe.\nfunc (r *Renderer) SetColorProfile(p termenv.Profile) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.colorProfile = p\n\tr.explicitColorProfile = true\n}\n\n// SetColorProfile sets the color profile on the default renderer. This\n// function exists mostly for testing purposes so that you can assure you're\n// testing against a specific profile.\n//\n// Outside of testing you likely won't want to use this function as the color\n// profile will detect and cache the terminal's color capabilities and choose\n// the best available profile.\n//\n// Available color profiles are:\n//\n//\ttermenv.Ascii     // no color, 1-bit\n//\ttermenv.ANSI      //16 colors, 4-bit\n//\ttermenv.ANSI256   // 256 colors, 8-bit\n//\ttermenv.TrueColor // 16,777,216 colors, 24-bit\n//\n// This function is thread-safe.\nfunc SetColorProfile(p termenv.Profile) {\n\trenderer.SetColorProfile(p)\n}\n\n// HasDarkBackground returns whether or not the terminal has a dark background.\nfunc HasDarkBackground() bool {\n\treturn renderer.HasDarkBackground()\n}\n\n// HasDarkBackground returns whether or not the renderer will render to a dark\n// background. A dark background can either be auto-detected, or set explicitly\n// on the renderer.\nfunc (r *Renderer) HasDarkBackground() bool {\n\tr.mtx.RLock()\n\tdefer r.mtx.RUnlock()\n\n\tif !r.explicitBackgroundColor {\n\t\tr.getBackgroundColor.Do(func() {\n\t\t\t// NOTE: we don't need to lock here because sync.Once provides its\n\t\t\t// own locking mechanism.\n\t\t\tr.hasDarkBackground = r.output.HasDarkBackground()\n\t\t})\n\t}\n\n\treturn r.hasDarkBackground\n}\n\n// SetHasDarkBackground sets the background color detection value for the\n// default renderer. This function exists mostly for testing purposes so that\n// you can assure you're testing against a specific background color setting.\n//\n// Outside of testing you likely won't want to use this function as the\n// backgrounds value will be automatically detected and cached against the\n// terminal's current background color setting.\n//\n// This function is thread-safe.\nfunc SetHasDarkBackground(b bool) {\n\trenderer.SetHasDarkBackground(b)\n}\n\n// SetHasDarkBackground sets the background color detection value on the\n// renderer. This function exists mostly for testing purposes so that you can\n// assure you're testing against a specific background color setting.\n//\n// Outside of testing you likely won't want to use this function as the\n// backgrounds value will be automatically detected and cached against the\n// terminal's current background color setting.\n//\n// This function is thread-safe.\nfunc (r *Renderer) SetHasDarkBackground(b bool) {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tr.hasDarkBackground = b\n\tr.explicitBackgroundColor = true\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/runes.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n)\n\n// StyleRunes apply a given style to runes at the given indices in the string.\n// Note that you must provide styling options for both matched and unmatched\n// runes. Indices out of bounds will be ignored.\nfunc StyleRunes(str string, indices []int, matched, unmatched Style) string {\n\t// Convert slice of indices to a map for easier lookups\n\tm := make(map[int]struct{})\n\tfor _, i := range indices {\n\t\tm[i] = struct{}{}\n\t}\n\n\tvar (\n\t\tout   strings.Builder\n\t\tgroup strings.Builder\n\t\tstyle Style\n\t\trunes = []rune(str)\n\t)\n\n\tfor i, r := range runes {\n\t\tgroup.WriteRune(r)\n\n\t\t_, matches := m[i]\n\t\t_, nextMatches := m[i+1]\n\n\t\tif matches != nextMatches || i == len(runes)-1 {\n\t\t\t// Flush\n\t\t\tif matches {\n\t\t\t\tstyle = matched\n\t\t\t} else {\n\t\t\t\tstyle = unmatched\n\t\t\t}\n\t\t\tout.WriteString(style.Render(group.String()))\n\t\t\tgroup.Reset()\n\t\t}\n\t}\n\n\treturn out.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/set.go",
    "content": "package lipgloss\n\n// Set a value on the underlying rules map.\nfunc (s *Style) set(key propKey, value interface{}) {\n\t// We don't allow negative integers on any of our other values, so just keep\n\t// them at zero or above. We could use uints instead, but the\n\t// conversions are a little tedious, so we're sticking with ints for\n\t// sake of usability.\n\tswitch key { //nolint:exhaustive\n\tcase foregroundKey:\n\t\ts.fgColor = colorOrNil(value)\n\tcase backgroundKey:\n\t\ts.bgColor = colorOrNil(value)\n\tcase widthKey:\n\t\ts.width = max(0, value.(int))\n\tcase heightKey:\n\t\ts.height = max(0, value.(int))\n\tcase alignHorizontalKey:\n\t\ts.alignHorizontal = value.(Position)\n\tcase alignVerticalKey:\n\t\ts.alignVertical = value.(Position)\n\tcase paddingTopKey:\n\t\ts.paddingTop = max(0, value.(int))\n\tcase paddingRightKey:\n\t\ts.paddingRight = max(0, value.(int))\n\tcase paddingBottomKey:\n\t\ts.paddingBottom = max(0, value.(int))\n\tcase paddingLeftKey:\n\t\ts.paddingLeft = max(0, value.(int))\n\tcase marginTopKey:\n\t\ts.marginTop = max(0, value.(int))\n\tcase marginRightKey:\n\t\ts.marginRight = max(0, value.(int))\n\tcase marginBottomKey:\n\t\ts.marginBottom = max(0, value.(int))\n\tcase marginLeftKey:\n\t\ts.marginLeft = max(0, value.(int))\n\tcase marginBackgroundKey:\n\t\ts.marginBgColor = colorOrNil(value)\n\tcase borderStyleKey:\n\t\ts.borderStyle = value.(Border)\n\tcase borderTopForegroundKey:\n\t\ts.borderTopFgColor = colorOrNil(value)\n\tcase borderRightForegroundKey:\n\t\ts.borderRightFgColor = colorOrNil(value)\n\tcase borderBottomForegroundKey:\n\t\ts.borderBottomFgColor = colorOrNil(value)\n\tcase borderLeftForegroundKey:\n\t\ts.borderLeftFgColor = colorOrNil(value)\n\tcase borderTopBackgroundKey:\n\t\ts.borderTopBgColor = colorOrNil(value)\n\tcase borderRightBackgroundKey:\n\t\ts.borderRightBgColor = colorOrNil(value)\n\tcase borderBottomBackgroundKey:\n\t\ts.borderBottomBgColor = colorOrNil(value)\n\tcase borderLeftBackgroundKey:\n\t\ts.borderLeftBgColor = colorOrNil(value)\n\tcase maxWidthKey:\n\t\ts.maxWidth = max(0, value.(int))\n\tcase maxHeightKey:\n\t\ts.maxHeight = max(0, value.(int))\n\tcase tabWidthKey:\n\t\t// TabWidth is the only property that may have a negative value (and\n\t\t// that negative value can be no less than -1).\n\t\ts.tabWidth = value.(int)\n\tcase transformKey:\n\t\ts.transform = value.(func(string) string)\n\tdefault:\n\t\tif v, ok := value.(bool); ok { //nolint:nestif\n\t\t\tif v {\n\t\t\t\ts.attrs |= int(key)\n\t\t\t} else {\n\t\t\t\ts.attrs &^= int(key)\n\t\t\t}\n\t\t} else if attrs, ok := value.(int); ok {\n\t\t\t// bool attrs\n\t\t\tif attrs&int(key) != 0 {\n\t\t\t\ts.attrs |= int(key)\n\t\t\t} else {\n\t\t\t\ts.attrs &^= int(key)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the prop on\n\ts.props = s.props.set(key)\n}\n\n// setFrom sets the property from another style.\nfunc (s *Style) setFrom(key propKey, i Style) {\n\tswitch key { //nolint:exhaustive\n\tcase foregroundKey:\n\t\ts.set(foregroundKey, i.fgColor)\n\tcase backgroundKey:\n\t\ts.set(backgroundKey, i.bgColor)\n\tcase widthKey:\n\t\ts.set(widthKey, i.width)\n\tcase heightKey:\n\t\ts.set(heightKey, i.height)\n\tcase alignHorizontalKey:\n\t\ts.set(alignHorizontalKey, i.alignHorizontal)\n\tcase alignVerticalKey:\n\t\ts.set(alignVerticalKey, i.alignVertical)\n\tcase paddingTopKey:\n\t\ts.set(paddingTopKey, i.paddingTop)\n\tcase paddingRightKey:\n\t\ts.set(paddingRightKey, i.paddingRight)\n\tcase paddingBottomKey:\n\t\ts.set(paddingBottomKey, i.paddingBottom)\n\tcase paddingLeftKey:\n\t\ts.set(paddingLeftKey, i.paddingLeft)\n\tcase marginTopKey:\n\t\ts.set(marginTopKey, i.marginTop)\n\tcase marginRightKey:\n\t\ts.set(marginRightKey, i.marginRight)\n\tcase marginBottomKey:\n\t\ts.set(marginBottomKey, i.marginBottom)\n\tcase marginLeftKey:\n\t\ts.set(marginLeftKey, i.marginLeft)\n\tcase marginBackgroundKey:\n\t\ts.set(marginBackgroundKey, i.marginBgColor)\n\tcase borderStyleKey:\n\t\ts.set(borderStyleKey, i.borderStyle)\n\tcase borderTopForegroundKey:\n\t\ts.set(borderTopForegroundKey, i.borderTopFgColor)\n\tcase borderRightForegroundKey:\n\t\ts.set(borderRightForegroundKey, i.borderRightFgColor)\n\tcase borderBottomForegroundKey:\n\t\ts.set(borderBottomForegroundKey, i.borderBottomFgColor)\n\tcase borderLeftForegroundKey:\n\t\ts.set(borderLeftForegroundKey, i.borderLeftFgColor)\n\tcase borderTopBackgroundKey:\n\t\ts.set(borderTopBackgroundKey, i.borderTopBgColor)\n\tcase borderRightBackgroundKey:\n\t\ts.set(borderRightBackgroundKey, i.borderRightBgColor)\n\tcase borderBottomBackgroundKey:\n\t\ts.set(borderBottomBackgroundKey, i.borderBottomBgColor)\n\tcase borderLeftBackgroundKey:\n\t\ts.set(borderLeftBackgroundKey, i.borderLeftBgColor)\n\tcase maxWidthKey:\n\t\ts.set(maxWidthKey, i.maxWidth)\n\tcase maxHeightKey:\n\t\ts.set(maxHeightKey, i.maxHeight)\n\tcase tabWidthKey:\n\t\ts.set(tabWidthKey, i.tabWidth)\n\tcase transformKey:\n\t\ts.set(transformKey, i.transform)\n\tdefault:\n\t\t// Set attributes for set bool properties\n\t\ts.set(key, i.attrs)\n\t}\n}\n\nfunc colorOrNil(c interface{}) TerminalColor {\n\tif c, ok := c.(TerminalColor); ok {\n\t\treturn c\n\t}\n\treturn nil\n}\n\n// Bold sets a bold formatting rule.\nfunc (s Style) Bold(v bool) Style {\n\ts.set(boldKey, v)\n\treturn s\n}\n\n// Italic sets an italic formatting rule. In some terminal emulators this will\n// render with \"reverse\" coloring if not italic font variant is available.\nfunc (s Style) Italic(v bool) Style {\n\ts.set(italicKey, v)\n\treturn s\n}\n\n// Underline sets an underline rule. By default, underlines will not be drawn on\n// whitespace like margins and padding. To change this behavior set\n// UnderlineSpaces.\nfunc (s Style) Underline(v bool) Style {\n\ts.set(underlineKey, v)\n\treturn s\n}\n\n// Strikethrough sets a strikethrough rule. By default, strikes will not be\n// drawn on whitespace like margins and padding. To change this behavior set\n// StrikethroughSpaces.\nfunc (s Style) Strikethrough(v bool) Style {\n\ts.set(strikethroughKey, v)\n\treturn s\n}\n\n// Reverse sets a rule for inverting foreground and background colors.\nfunc (s Style) Reverse(v bool) Style {\n\ts.set(reverseKey, v)\n\treturn s\n}\n\n// Blink sets a rule for blinking foreground text.\nfunc (s Style) Blink(v bool) Style {\n\ts.set(blinkKey, v)\n\treturn s\n}\n\n// Faint sets a rule for rendering the foreground color in a dimmer shade.\nfunc (s Style) Faint(v bool) Style {\n\ts.set(faintKey, v)\n\treturn s\n}\n\n// Foreground sets a foreground color.\n//\n//\t// Sets the foreground to blue\n//\ts := lipgloss.NewStyle().Foreground(lipgloss.Color(\"#0000ff\"))\n//\n//\t// Removes the foreground color\n//\ts.Foreground(lipgloss.NoColor)\nfunc (s Style) Foreground(c TerminalColor) Style {\n\ts.set(foregroundKey, c)\n\treturn s\n}\n\n// Background sets a background color.\nfunc (s Style) Background(c TerminalColor) Style {\n\ts.set(backgroundKey, c)\n\treturn s\n}\n\n// Width sets the width of the block before applying margins. The width, if\n// set, also determines where text will wrap.\nfunc (s Style) Width(i int) Style {\n\ts.set(widthKey, i)\n\treturn s\n}\n\n// Height sets the height of the block before applying margins. If the height of\n// the text block is less than this value after applying padding (or not), the\n// block will be set to this height.\nfunc (s Style) Height(i int) Style {\n\ts.set(heightKey, i)\n\treturn s\n}\n\n// Align is a shorthand method for setting horizontal and vertical alignment.\n//\n// With one argument, the position value is applied to the horizontal alignment.\n//\n// With two arguments, the value is applied to the horizontal and vertical\n// alignments, in that order.\nfunc (s Style) Align(p ...Position) Style {\n\tif len(p) > 0 {\n\t\ts.set(alignHorizontalKey, p[0])\n\t}\n\tif len(p) > 1 {\n\t\ts.set(alignVerticalKey, p[1])\n\t}\n\treturn s\n}\n\n// AlignHorizontal sets a horizontal text alignment rule.\nfunc (s Style) AlignHorizontal(p Position) Style {\n\ts.set(alignHorizontalKey, p)\n\treturn s\n}\n\n// AlignVertical sets a vertical text alignment rule.\nfunc (s Style) AlignVertical(p Position) Style {\n\ts.set(alignVerticalKey, p)\n\treturn s\n}\n\n// Padding is a shorthand method for setting padding on all sides at once.\n//\n// With one argument, the value is applied to all sides.\n//\n// With two arguments, the value is applied to the vertical and horizontal\n// sides, in that order.\n//\n// With three arguments, the value is applied to the top side, the horizontal\n// sides, and the bottom side, in that order.\n//\n// With four arguments, the value is applied clockwise starting from the top\n// side, followed by the right side, then the bottom, and finally the left.\n//\n// With more than four arguments no padding will be added.\nfunc (s Style) Padding(i ...int) Style {\n\ttop, right, bottom, left, ok := whichSidesInt(i...)\n\tif !ok {\n\t\treturn s\n\t}\n\n\ts.set(paddingTopKey, top)\n\ts.set(paddingRightKey, right)\n\ts.set(paddingBottomKey, bottom)\n\ts.set(paddingLeftKey, left)\n\treturn s\n}\n\n// PaddingLeft adds padding on the left.\nfunc (s Style) PaddingLeft(i int) Style {\n\ts.set(paddingLeftKey, i)\n\treturn s\n}\n\n// PaddingRight adds padding on the right.\nfunc (s Style) PaddingRight(i int) Style {\n\ts.set(paddingRightKey, i)\n\treturn s\n}\n\n// PaddingTop adds padding to the top of the block.\nfunc (s Style) PaddingTop(i int) Style {\n\ts.set(paddingTopKey, i)\n\treturn s\n}\n\n// PaddingBottom adds padding to the bottom of the block.\nfunc (s Style) PaddingBottom(i int) Style {\n\ts.set(paddingBottomKey, i)\n\treturn s\n}\n\n// ColorWhitespace determines whether or not the background color should be\n// applied to the padding. This is true by default as it's more than likely the\n// desired and expected behavior, but it can be disabled for certain graphic\n// effects.\n//\n// Deprecated: Just use margins and padding.\nfunc (s Style) ColorWhitespace(v bool) Style {\n\ts.set(colorWhitespaceKey, v)\n\treturn s\n}\n\n// Margin is a shorthand method for setting margins on all sides at once.\n//\n// With one argument, the value is applied to all sides.\n//\n// With two arguments, the value is applied to the vertical and horizontal\n// sides, in that order.\n//\n// With three arguments, the value is applied to the top side, the horizontal\n// sides, and the bottom side, in that order.\n//\n// With four arguments, the value is applied clockwise starting from the top\n// side, followed by the right side, then the bottom, and finally the left.\n//\n// With more than four arguments no margin will be added.\nfunc (s Style) Margin(i ...int) Style {\n\ttop, right, bottom, left, ok := whichSidesInt(i...)\n\tif !ok {\n\t\treturn s\n\t}\n\n\ts.set(marginTopKey, top)\n\ts.set(marginRightKey, right)\n\ts.set(marginBottomKey, bottom)\n\ts.set(marginLeftKey, left)\n\treturn s\n}\n\n// MarginLeft sets the value of the left margin.\nfunc (s Style) MarginLeft(i int) Style {\n\ts.set(marginLeftKey, i)\n\treturn s\n}\n\n// MarginRight sets the value of the right margin.\nfunc (s Style) MarginRight(i int) Style {\n\ts.set(marginRightKey, i)\n\treturn s\n}\n\n// MarginTop sets the value of the top margin.\nfunc (s Style) MarginTop(i int) Style {\n\ts.set(marginTopKey, i)\n\treturn s\n}\n\n// MarginBottom sets the value of the bottom margin.\nfunc (s Style) MarginBottom(i int) Style {\n\ts.set(marginBottomKey, i)\n\treturn s\n}\n\n// MarginBackground sets the background color of the margin. Note that this is\n// also set when inheriting from a style with a background color. In that case\n// the background color on that style will set the margin color on this style.\nfunc (s Style) MarginBackground(c TerminalColor) Style {\n\ts.set(marginBackgroundKey, c)\n\treturn s\n}\n\n// Border is shorthand for setting the border style and which sides should\n// have a border at once. The variadic argument sides works as follows:\n//\n// With one value, the value is applied to all sides.\n//\n// With two values, the values are applied to the vertical and horizontal\n// sides, in that order.\n//\n// With three values, the values are applied to the top side, the horizontal\n// sides, and the bottom side, in that order.\n//\n// With four values, the values are applied clockwise starting from the top\n// side, followed by the right side, then the bottom, and finally the left.\n//\n// With more than four arguments the border will be applied to all sides.\n//\n// Examples:\n//\n//\t// Applies borders to the top and bottom only\n//\tlipgloss.NewStyle().Border(lipgloss.NormalBorder(), true, false)\n//\n//\t// Applies rounded borders to the right and bottom only\n//\tlipgloss.NewStyle().Border(lipgloss.RoundedBorder(), false, true, true, false)\nfunc (s Style) Border(b Border, sides ...bool) Style {\n\ts.set(borderStyleKey, b)\n\n\ttop, right, bottom, left, ok := whichSidesBool(sides...)\n\tif !ok {\n\t\ttop = true\n\t\tright = true\n\t\tbottom = true\n\t\tleft = true\n\t}\n\n\ts.set(borderTopKey, top)\n\ts.set(borderRightKey, right)\n\ts.set(borderBottomKey, bottom)\n\ts.set(borderLeftKey, left)\n\n\treturn s\n}\n\n// BorderStyle defines the Border on a style. A Border contains a series of\n// definitions for the sides and corners of a border.\n//\n// Note that if border visibility has not been set for any sides when setting\n// the border style, the border will be enabled for all sides during rendering.\n//\n// You can define border characters as you'd like, though several default\n// styles are included: NormalBorder(), RoundedBorder(), BlockBorder(),\n// OuterHalfBlockBorder(), InnerHalfBlockBorder(), ThickBorder(),\n// and DoubleBorder().\n//\n// Example:\n//\n//\tlipgloss.NewStyle().BorderStyle(lipgloss.ThickBorder())\nfunc (s Style) BorderStyle(b Border) Style {\n\ts.set(borderStyleKey, b)\n\treturn s\n}\n\n// BorderTop determines whether or not to draw a top border.\nfunc (s Style) BorderTop(v bool) Style {\n\ts.set(borderTopKey, v)\n\treturn s\n}\n\n// BorderRight determines whether or not to draw a right border.\nfunc (s Style) BorderRight(v bool) Style {\n\ts.set(borderRightKey, v)\n\treturn s\n}\n\n// BorderBottom determines whether or not to draw a bottom border.\nfunc (s Style) BorderBottom(v bool) Style {\n\ts.set(borderBottomKey, v)\n\treturn s\n}\n\n// BorderLeft determines whether or not to draw a left border.\nfunc (s Style) BorderLeft(v bool) Style {\n\ts.set(borderLeftKey, v)\n\treturn s\n}\n\n// BorderForeground is a shorthand function for setting all of the\n// foreground colors of the borders at once. The arguments work as follows:\n//\n// With one argument, the argument is applied to all sides.\n//\n// With two arguments, the arguments are applied to the vertical and horizontal\n// sides, in that order.\n//\n// With three arguments, the arguments are applied to the top side, the\n// horizontal sides, and the bottom side, in that order.\n//\n// With four arguments, the arguments are applied clockwise starting from the\n// top side, followed by the right side, then the bottom, and finally the left.\n//\n// With more than four arguments nothing will be set.\nfunc (s Style) BorderForeground(c ...TerminalColor) Style {\n\tif len(c) == 0 {\n\t\treturn s\n\t}\n\n\ttop, right, bottom, left, ok := whichSidesColor(c...)\n\tif !ok {\n\t\treturn s\n\t}\n\n\ts.set(borderTopForegroundKey, top)\n\ts.set(borderRightForegroundKey, right)\n\ts.set(borderBottomForegroundKey, bottom)\n\ts.set(borderLeftForegroundKey, left)\n\n\treturn s\n}\n\n// BorderTopForeground set the foreground color for the top of the border.\nfunc (s Style) BorderTopForeground(c TerminalColor) Style {\n\ts.set(borderTopForegroundKey, c)\n\treturn s\n}\n\n// BorderRightForeground sets the foreground color for the right side of the\n// border.\nfunc (s Style) BorderRightForeground(c TerminalColor) Style {\n\ts.set(borderRightForegroundKey, c)\n\treturn s\n}\n\n// BorderBottomForeground sets the foreground color for the bottom of the\n// border.\nfunc (s Style) BorderBottomForeground(c TerminalColor) Style {\n\ts.set(borderBottomForegroundKey, c)\n\treturn s\n}\n\n// BorderLeftForeground sets the foreground color for the left side of the\n// border.\nfunc (s Style) BorderLeftForeground(c TerminalColor) Style {\n\ts.set(borderLeftForegroundKey, c)\n\treturn s\n}\n\n// BorderBackground is a shorthand function for setting all of the\n// background colors of the borders at once. The arguments work as follows:\n//\n// With one argument, the argument is applied to all sides.\n//\n// With two arguments, the arguments are applied to the vertical and horizontal\n// sides, in that order.\n//\n// With three arguments, the arguments are applied to the top side, the\n// horizontal sides, and the bottom side, in that order.\n//\n// With four arguments, the arguments are applied clockwise starting from the\n// top side, followed by the right side, then the bottom, and finally the left.\n//\n// With more than four arguments nothing will be set.\nfunc (s Style) BorderBackground(c ...TerminalColor) Style {\n\tif len(c) == 0 {\n\t\treturn s\n\t}\n\n\ttop, right, bottom, left, ok := whichSidesColor(c...)\n\tif !ok {\n\t\treturn s\n\t}\n\n\ts.set(borderTopBackgroundKey, top)\n\ts.set(borderRightBackgroundKey, right)\n\ts.set(borderBottomBackgroundKey, bottom)\n\ts.set(borderLeftBackgroundKey, left)\n\n\treturn s\n}\n\n// BorderTopBackground sets the background color of the top of the border.\nfunc (s Style) BorderTopBackground(c TerminalColor) Style {\n\ts.set(borderTopBackgroundKey, c)\n\treturn s\n}\n\n// BorderRightBackground sets the background color of right side the border.\nfunc (s Style) BorderRightBackground(c TerminalColor) Style {\n\ts.set(borderRightBackgroundKey, c)\n\treturn s\n}\n\n// BorderBottomBackground sets the background color of the bottom of the\n// border.\nfunc (s Style) BorderBottomBackground(c TerminalColor) Style {\n\ts.set(borderBottomBackgroundKey, c)\n\treturn s\n}\n\n// BorderLeftBackground set the background color of the left side of the\n// border.\nfunc (s Style) BorderLeftBackground(c TerminalColor) Style {\n\ts.set(borderLeftBackgroundKey, c)\n\treturn s\n}\n\n// Inline makes rendering output one line and disables the rendering of\n// margins, padding and borders. This is useful when you need a style to apply\n// only to font rendering and don't want it to change any physical dimensions.\n// It works well with Style.MaxWidth.\n//\n// Because this in intended to be used at the time of render, this method will\n// not mutate the style and instead return a copy.\n//\n// Example:\n//\n//\tvar userInput string = \"...\"\n//\tvar userStyle = text.Style{ /* ... */ }\n//\tfmt.Println(userStyle.Inline(true).Render(userInput))\nfunc (s Style) Inline(v bool) Style {\n\to := s // copy\n\to.set(inlineKey, v)\n\treturn o\n}\n\n// MaxWidth applies a max width to a given style. This is useful in enforcing\n// a certain width at render time, particularly with arbitrary strings and\n// styles.\n//\n// Because this in intended to be used at the time of render, this method will\n// not mutate the style and instead return a copy.\n//\n// Example:\n//\n//\tvar userInput string = \"...\"\n//\tvar userStyle = text.Style{ /* ... */ }\n//\tfmt.Println(userStyle.MaxWidth(16).Render(userInput))\nfunc (s Style) MaxWidth(n int) Style {\n\to := s // copy\n\to.set(maxWidthKey, n)\n\treturn o\n}\n\n// MaxHeight applies a max height to a given style. This is useful in enforcing\n// a certain height at render time, particularly with arbitrary strings and\n// styles.\n//\n// Because this in intended to be used at the time of render, this method will\n// not mutate the style and instead returns a copy.\nfunc (s Style) MaxHeight(n int) Style {\n\to := s // copy\n\to.set(maxHeightKey, n)\n\treturn o\n}\n\n// NoTabConversion can be passed to [Style.TabWidth] to disable the replacement\n// of tabs with spaces at render time.\nconst NoTabConversion = -1\n\n// TabWidth sets the number of spaces that a tab (/t) should be rendered as.\n// When set to 0, tabs will be removed. To disable the replacement of tabs with\n// spaces entirely, set this to [NoTabConversion].\n//\n// By default, tabs will be replaced with 4 spaces.\nfunc (s Style) TabWidth(n int) Style {\n\tif n <= -1 {\n\t\tn = -1\n\t}\n\ts.set(tabWidthKey, n)\n\treturn s\n}\n\n// UnderlineSpaces determines whether to underline spaces between words. By\n// default, this is true. Spaces can also be underlined without underlining the\n// text itself.\nfunc (s Style) UnderlineSpaces(v bool) Style {\n\ts.set(underlineSpacesKey, v)\n\treturn s\n}\n\n// StrikethroughSpaces determines whether to apply strikethroughs to spaces\n// between words. By default, this is true. Spaces can also be struck without\n// underlining the text itself.\nfunc (s Style) StrikethroughSpaces(v bool) Style {\n\ts.set(strikethroughSpacesKey, v)\n\treturn s\n}\n\n// Transform applies a given function to a string at render time, allowing for\n// the string being rendered to be manipuated.\n//\n// Example:\n//\n//\ts := NewStyle().Transform(strings.ToUpper)\n//\tfmt.Println(s.Render(\"raow!\") // \"RAOW!\"\nfunc (s Style) Transform(fn func(string) string) Style {\n\ts.set(transformKey, fn)\n\treturn s\n}\n\n// Renderer sets the renderer for the style. This is useful for changing the\n// renderer for a style that is being used in a different context.\nfunc (s Style) Renderer(r *Renderer) Style {\n\ts.r = r\n\treturn s\n}\n\n// whichSidesInt is a helper method for setting values on sides of a block based\n// on the number of arguments. It follows the CSS shorthand rules for blocks\n// like margin, padding. and borders. Here are how the rules work:\n//\n// 0 args:  do nothing\n// 1 arg:   all sides\n// 2 args:  top -> bottom\n// 3 args:  top -> horizontal -> bottom\n// 4 args:  top -> right -> bottom -> left\n// 5+ args: do nothing.\nfunc whichSidesInt(i ...int) (top, right, bottom, left int, ok bool) {\n\tswitch len(i) {\n\tcase 1:\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[0]\n\t\tright = i[0]\n\t\tok = true\n\tcase 2: //nolint:gomnd\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tok = true\n\tcase 3: //nolint:gomnd\n\t\ttop = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tok = true\n\tcase 4: //nolint:gomnd\n\t\ttop = i[0]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tleft = i[3]\n\t\tok = true\n\t}\n\treturn top, right, bottom, left, ok\n}\n\n// whichSidesBool is like whichSidesInt, except it operates on a series of\n// boolean values. See the comment on whichSidesInt for details on how this\n// works.\nfunc whichSidesBool(i ...bool) (top, right, bottom, left bool, ok bool) {\n\tswitch len(i) {\n\tcase 1:\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[0]\n\t\tright = i[0]\n\t\tok = true\n\tcase 2: //nolint:gomnd\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tok = true\n\tcase 3: //nolint:gomnd\n\t\ttop = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tok = true\n\tcase 4: //nolint:gomnd\n\t\ttop = i[0]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tleft = i[3]\n\t\tok = true\n\t}\n\treturn top, right, bottom, left, ok\n}\n\n// whichSidesColor is like whichSides, except it operates on a series of\n// boolean values. See the comment on whichSidesInt for details on how this\n// works.\nfunc whichSidesColor(i ...TerminalColor) (top, right, bottom, left TerminalColor, ok bool) {\n\tswitch len(i) {\n\tcase 1:\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[0]\n\t\tright = i[0]\n\t\tok = true\n\tcase 2: //nolint:gomnd\n\t\ttop = i[0]\n\t\tbottom = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tok = true\n\tcase 3: //nolint:gomnd\n\t\ttop = i[0]\n\t\tleft = i[1]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tok = true\n\tcase 4: //nolint:gomnd\n\t\ttop = i[0]\n\t\tright = i[1]\n\t\tbottom = i[2]\n\t\tleft = i[3]\n\t\tok = true\n\t}\n\treturn top, right, bottom, left, ok\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/size.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n)\n\n// Width returns the cell width of characters in the string. ANSI sequences are\n// ignored and characters wider than one cell (such as Chinese characters and\n// emojis) are appropriately measured.\n//\n// You should use this instead of len(string) len([]rune(string) as neither\n// will give you accurate results.\nfunc Width(str string) (width int) {\n\tfor _, l := range strings.Split(str, \"\\n\") {\n\t\tw := ansi.StringWidth(l)\n\t\tif w > width {\n\t\t\twidth = w\n\t\t}\n\t}\n\n\treturn width\n}\n\n// Height returns height of a string in cells. This is done simply by\n// counting \\n characters. If your strings use \\r\\n for newlines you should\n// convert them to \\n first, or simply write a separate function for measuring\n// height.\nfunc Height(str string) int {\n\treturn strings.Count(str, \"\\n\") + 1\n}\n\n// Size returns the width and height of the string in cells. ANSI sequences are\n// ignored and characters wider than one cell (such as Chinese characters and\n// emojis) are appropriately measured.\nfunc Size(str string) (width, height int) {\n\twidth = Width(str)\n\theight = Height(str)\n\treturn width, height\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/style.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n\t\"github.com/muesli/termenv\"\n)\n\nconst tabWidthDefault = 4\n\n// Property for a key.\ntype propKey int64\n\n// Available properties.\nconst (\n\t// Boolean props come first.\n\tboldKey propKey = 1 << iota\n\titalicKey\n\tunderlineKey\n\tstrikethroughKey\n\treverseKey\n\tblinkKey\n\tfaintKey\n\tunderlineSpacesKey\n\tstrikethroughSpacesKey\n\tcolorWhitespaceKey\n\n\t// Non-boolean props.\n\tforegroundKey\n\tbackgroundKey\n\twidthKey\n\theightKey\n\talignHorizontalKey\n\talignVerticalKey\n\n\t// Padding.\n\tpaddingTopKey\n\tpaddingRightKey\n\tpaddingBottomKey\n\tpaddingLeftKey\n\n\t// Margins.\n\tmarginTopKey\n\tmarginRightKey\n\tmarginBottomKey\n\tmarginLeftKey\n\tmarginBackgroundKey\n\n\t// Border runes.\n\tborderStyleKey\n\n\t// Border edges.\n\tborderTopKey\n\tborderRightKey\n\tborderBottomKey\n\tborderLeftKey\n\n\t// Border foreground colors.\n\tborderTopForegroundKey\n\tborderRightForegroundKey\n\tborderBottomForegroundKey\n\tborderLeftForegroundKey\n\n\t// Border background colors.\n\tborderTopBackgroundKey\n\tborderRightBackgroundKey\n\tborderBottomBackgroundKey\n\tborderLeftBackgroundKey\n\n\tinlineKey\n\tmaxWidthKey\n\tmaxHeightKey\n\ttabWidthKey\n\n\ttransformKey\n)\n\n// props is a set of properties.\ntype props int64\n\n// set sets a property.\nfunc (p props) set(k propKey) props {\n\treturn p | props(k)\n}\n\n// unset unsets a property.\nfunc (p props) unset(k propKey) props {\n\treturn p &^ props(k)\n}\n\n// has checks if a property is set.\nfunc (p props) has(k propKey) bool {\n\treturn p&props(k) != 0\n}\n\n// NewStyle returns a new, empty Style. While it's syntactic sugar for the\n// Style{} primitive, it's recommended to use this function for creating styles\n// in case the underlying implementation changes. It takes an optional string\n// value to be set as the underlying string value for this style.\nfunc NewStyle() Style {\n\treturn renderer.NewStyle()\n}\n\n// NewStyle returns a new, empty Style. While it's syntactic sugar for the\n// Style{} primitive, it's recommended to use this function for creating styles\n// in case the underlying implementation changes. It takes an optional string\n// value to be set as the underlying string value for this style.\nfunc (r *Renderer) NewStyle() Style {\n\ts := Style{r: r}\n\treturn s\n}\n\n// Style contains a set of rules that comprise a style as a whole.\ntype Style struct {\n\tr     *Renderer\n\tprops props\n\tvalue string\n\n\t// we store bool props values here\n\tattrs int\n\n\t// props that have values\n\tfgColor TerminalColor\n\tbgColor TerminalColor\n\n\twidth  int\n\theight int\n\n\talignHorizontal Position\n\talignVertical   Position\n\n\tpaddingTop    int\n\tpaddingRight  int\n\tpaddingBottom int\n\tpaddingLeft   int\n\n\tmarginTop     int\n\tmarginRight   int\n\tmarginBottom  int\n\tmarginLeft    int\n\tmarginBgColor TerminalColor\n\n\tborderStyle         Border\n\tborderTopFgColor    TerminalColor\n\tborderRightFgColor  TerminalColor\n\tborderBottomFgColor TerminalColor\n\tborderLeftFgColor   TerminalColor\n\tborderTopBgColor    TerminalColor\n\tborderRightBgColor  TerminalColor\n\tborderBottomBgColor TerminalColor\n\tborderLeftBgColor   TerminalColor\n\n\tmaxWidth  int\n\tmaxHeight int\n\ttabWidth  int\n\n\ttransform func(string) string\n}\n\n// joinString joins a list of strings into a single string separated with a\n// space.\nfunc joinString(strs ...string) string {\n\treturn strings.Join(strs, \" \")\n}\n\n// SetString sets the underlying string value for this style. To render once\n// the underlying string is set, use the Style.String. This method is\n// a convenience for cases when having a stringer implementation is handy, such\n// as when using fmt.Sprintf. You can also simply define a style and render out\n// strings directly with Style.Render.\nfunc (s Style) SetString(strs ...string) Style {\n\ts.value = joinString(strs...)\n\treturn s\n}\n\n// Value returns the raw, unformatted, underlying string value for this style.\nfunc (s Style) Value() string {\n\treturn s.value\n}\n\n// String implements stringer for a Style, returning the rendered result based\n// on the rules in this style. An underlying string value must be set with\n// Style.SetString prior to using this method.\nfunc (s Style) String() string {\n\treturn s.Render()\n}\n\n// Copy returns a copy of this style, including any underlying string values.\n//\n// Deprecated: to copy just use assignment (i.e. a := b). All methods also\n// return a new style.\nfunc (s Style) Copy() Style {\n\treturn s\n}\n\n// Inherit overlays the style in the argument onto this style by copying each explicitly\n// set value from the argument style onto this style if it is not already explicitly set.\n// Existing set values are kept intact and not overwritten.\n//\n// Margins, padding, and underlying string values are not inherited.\nfunc (s Style) Inherit(i Style) Style {\n\tfor k := boldKey; k <= transformKey; k <<= 1 {\n\t\tif !i.isSet(k) {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch k { //nolint:exhaustive\n\t\tcase marginTopKey, marginRightKey, marginBottomKey, marginLeftKey:\n\t\t\t// Margins are not inherited\n\t\t\tcontinue\n\t\tcase paddingTopKey, paddingRightKey, paddingBottomKey, paddingLeftKey:\n\t\t\t// Padding is not inherited\n\t\t\tcontinue\n\t\tcase backgroundKey:\n\t\t\t// The margins also inherit the background color\n\t\t\tif !s.isSet(marginBackgroundKey) && !i.isSet(marginBackgroundKey) {\n\t\t\t\ts.set(marginBackgroundKey, i.bgColor)\n\t\t\t}\n\t\t}\n\n\t\tif s.isSet(k) {\n\t\t\tcontinue\n\t\t}\n\n\t\ts.setFrom(k, i)\n\t}\n\treturn s\n}\n\n// Render applies the defined style formatting to a given string.\nfunc (s Style) Render(strs ...string) string {\n\tif s.r == nil {\n\t\ts.r = renderer\n\t}\n\tif s.value != \"\" {\n\t\tstrs = append([]string{s.value}, strs...)\n\t}\n\n\tvar (\n\t\tstr = joinString(strs...)\n\n\t\tp            = s.r.ColorProfile()\n\t\tte           = p.String()\n\t\tteSpace      = p.String()\n\t\tteWhitespace = p.String()\n\n\t\tbold          = s.getAsBool(boldKey, false)\n\t\titalic        = s.getAsBool(italicKey, false)\n\t\tunderline     = s.getAsBool(underlineKey, false)\n\t\tstrikethrough = s.getAsBool(strikethroughKey, false)\n\t\treverse       = s.getAsBool(reverseKey, false)\n\t\tblink         = s.getAsBool(blinkKey, false)\n\t\tfaint         = s.getAsBool(faintKey, false)\n\n\t\tfg = s.getAsColor(foregroundKey)\n\t\tbg = s.getAsColor(backgroundKey)\n\n\t\twidth           = s.getAsInt(widthKey)\n\t\theight          = s.getAsInt(heightKey)\n\t\thorizontalAlign = s.getAsPosition(alignHorizontalKey)\n\t\tverticalAlign   = s.getAsPosition(alignVerticalKey)\n\n\t\ttopPadding    = s.getAsInt(paddingTopKey)\n\t\trightPadding  = s.getAsInt(paddingRightKey)\n\t\tbottomPadding = s.getAsInt(paddingBottomKey)\n\t\tleftPadding   = s.getAsInt(paddingLeftKey)\n\n\t\tcolorWhitespace = s.getAsBool(colorWhitespaceKey, true)\n\t\tinline          = s.getAsBool(inlineKey, false)\n\t\tmaxWidth        = s.getAsInt(maxWidthKey)\n\t\tmaxHeight       = s.getAsInt(maxHeightKey)\n\n\t\tunderlineSpaces     = s.getAsBool(underlineSpacesKey, false) || (underline && s.getAsBool(underlineSpacesKey, true))\n\t\tstrikethroughSpaces = s.getAsBool(strikethroughSpacesKey, false) || (strikethrough && s.getAsBool(strikethroughSpacesKey, true))\n\n\t\t// Do we need to style whitespace (padding and space outside\n\t\t// paragraphs) separately?\n\t\tstyleWhitespace = reverse\n\n\t\t// Do we need to style spaces separately?\n\t\tuseSpaceStyler = (underline && !underlineSpaces) || (strikethrough && !strikethroughSpaces) || underlineSpaces || strikethroughSpaces\n\n\t\ttransform = s.getAsTransform(transformKey)\n\t)\n\n\tif transform != nil {\n\t\tstr = transform(str)\n\t}\n\n\tif s.props == 0 {\n\t\treturn s.maybeConvertTabs(str)\n\t}\n\n\t// Enable support for ANSI on the legacy Windows cmd.exe console. This is a\n\t// no-op on non-Windows systems and on Windows runs only once.\n\tenableLegacyWindowsANSI()\n\n\tif bold {\n\t\tte = te.Bold()\n\t}\n\tif italic {\n\t\tte = te.Italic()\n\t}\n\tif underline {\n\t\tte = te.Underline()\n\t}\n\tif reverse {\n\t\tteWhitespace = teWhitespace.Reverse()\n\t\tte = te.Reverse()\n\t}\n\tif blink {\n\t\tte = te.Blink()\n\t}\n\tif faint {\n\t\tte = te.Faint()\n\t}\n\n\tif fg != noColor {\n\t\tte = te.Foreground(fg.color(s.r))\n\t\tif styleWhitespace {\n\t\t\tteWhitespace = teWhitespace.Foreground(fg.color(s.r))\n\t\t}\n\t\tif useSpaceStyler {\n\t\t\tteSpace = teSpace.Foreground(fg.color(s.r))\n\t\t}\n\t}\n\n\tif bg != noColor {\n\t\tte = te.Background(bg.color(s.r))\n\t\tif colorWhitespace {\n\t\t\tteWhitespace = teWhitespace.Background(bg.color(s.r))\n\t\t}\n\t\tif useSpaceStyler {\n\t\t\tteSpace = teSpace.Background(bg.color(s.r))\n\t\t}\n\t}\n\n\tif underline {\n\t\tte = te.Underline()\n\t}\n\tif strikethrough {\n\t\tte = te.CrossOut()\n\t}\n\n\tif underlineSpaces {\n\t\tteSpace = teSpace.Underline()\n\t}\n\tif strikethroughSpaces {\n\t\tteSpace = teSpace.CrossOut()\n\t}\n\n\t// Potentially convert tabs to spaces\n\tstr = s.maybeConvertTabs(str)\n\n\t// Strip newlines in single line mode\n\tif inline {\n\t\tstr = strings.ReplaceAll(str, \"\\n\", \"\")\n\t}\n\n\t// Word wrap\n\tif !inline && width > 0 {\n\t\twrapAt := width - leftPadding - rightPadding\n\t\tstr = ansi.Wrap(str, wrapAt, \"\")\n\t}\n\n\t// Render core text\n\t{\n\t\tvar b strings.Builder\n\n\t\tl := strings.Split(str, \"\\n\")\n\t\tfor i := range l {\n\t\t\tif useSpaceStyler {\n\t\t\t\t// Look for spaces and apply a different styler\n\t\t\t\tfor _, r := range l[i] {\n\t\t\t\t\tif unicode.IsSpace(r) {\n\t\t\t\t\t\tb.WriteString(teSpace.Styled(string(r)))\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tb.WriteString(te.Styled(string(r)))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tb.WriteString(te.Styled(l[i]))\n\t\t\t}\n\t\t\tif i != len(l)-1 {\n\t\t\t\tb.WriteRune('\\n')\n\t\t\t}\n\t\t}\n\n\t\tstr = b.String()\n\t}\n\n\t// Padding\n\tif !inline { //nolint:nestif\n\t\tif leftPadding > 0 {\n\t\t\tvar st *termenv.Style\n\t\t\tif colorWhitespace || styleWhitespace {\n\t\t\t\tst = &teWhitespace\n\t\t\t}\n\t\t\tstr = padLeft(str, leftPadding, st)\n\t\t}\n\n\t\tif rightPadding > 0 {\n\t\t\tvar st *termenv.Style\n\t\t\tif colorWhitespace || styleWhitespace {\n\t\t\t\tst = &teWhitespace\n\t\t\t}\n\t\t\tstr = padRight(str, rightPadding, st)\n\t\t}\n\n\t\tif topPadding > 0 {\n\t\t\tstr = strings.Repeat(\"\\n\", topPadding) + str\n\t\t}\n\n\t\tif bottomPadding > 0 {\n\t\t\tstr += strings.Repeat(\"\\n\", bottomPadding)\n\t\t}\n\t}\n\n\t// Height\n\tif height > 0 {\n\t\tstr = alignTextVertical(str, verticalAlign, height, nil)\n\t}\n\n\t// Set alignment. This will also pad short lines with spaces so that all\n\t// lines are the same length, so we run it under a few different conditions\n\t// beyond alignment.\n\t{\n\t\tnumLines := strings.Count(str, \"\\n\")\n\n\t\tif !(numLines == 0 && width == 0) {\n\t\t\tvar st *termenv.Style\n\t\t\tif colorWhitespace || styleWhitespace {\n\t\t\t\tst = &teWhitespace\n\t\t\t}\n\t\t\tstr = alignTextHorizontal(str, horizontalAlign, width, st)\n\t\t}\n\t}\n\n\tif !inline {\n\t\tstr = s.applyBorder(str)\n\t\tstr = s.applyMargins(str, inline)\n\t}\n\n\t// Truncate according to MaxWidth\n\tif maxWidth > 0 {\n\t\tlines := strings.Split(str, \"\\n\")\n\n\t\tfor i := range lines {\n\t\t\tlines[i] = ansi.Truncate(lines[i], maxWidth, \"\")\n\t\t}\n\n\t\tstr = strings.Join(lines, \"\\n\")\n\t}\n\n\t// Truncate according to MaxHeight\n\tif maxHeight > 0 {\n\t\tlines := strings.Split(str, \"\\n\")\n\t\theight := min(maxHeight, len(lines))\n\t\tif len(lines) > 0 {\n\t\t\tstr = strings.Join(lines[:height], \"\\n\")\n\t\t}\n\t}\n\n\treturn str\n}\n\nfunc (s Style) maybeConvertTabs(str string) string {\n\ttw := tabWidthDefault\n\tif s.isSet(tabWidthKey) {\n\t\ttw = s.getAsInt(tabWidthKey)\n\t}\n\tswitch tw {\n\tcase -1:\n\t\treturn str\n\tcase 0:\n\t\treturn strings.ReplaceAll(str, \"\\t\", \"\")\n\tdefault:\n\t\treturn strings.ReplaceAll(str, \"\\t\", strings.Repeat(\" \", tw))\n\t}\n}\n\nfunc (s Style) applyMargins(str string, inline bool) string {\n\tvar (\n\t\ttopMargin    = s.getAsInt(marginTopKey)\n\t\trightMargin  = s.getAsInt(marginRightKey)\n\t\tbottomMargin = s.getAsInt(marginBottomKey)\n\t\tleftMargin   = s.getAsInt(marginLeftKey)\n\n\t\tstyler termenv.Style\n\t)\n\n\tbgc := s.getAsColor(marginBackgroundKey)\n\tif bgc != noColor {\n\t\tstyler = styler.Background(bgc.color(s.r))\n\t}\n\n\t// Add left and right margin\n\tstr = padLeft(str, leftMargin, &styler)\n\tstr = padRight(str, rightMargin, &styler)\n\n\t// Top/bottom margin\n\tif !inline {\n\t\t_, width := getLines(str)\n\t\tspaces := strings.Repeat(\" \", width)\n\n\t\tif topMargin > 0 {\n\t\t\tstr = styler.Styled(strings.Repeat(spaces+\"\\n\", topMargin)) + str\n\t\t}\n\t\tif bottomMargin > 0 {\n\t\t\tstr += styler.Styled(strings.Repeat(\"\\n\"+spaces, bottomMargin))\n\t\t}\n\t}\n\n\treturn str\n}\n\n// Apply left padding.\nfunc padLeft(str string, n int, style *termenv.Style) string {\n\treturn pad(str, -n, style)\n}\n\n// Apply right padding.\nfunc padRight(str string, n int, style *termenv.Style) string {\n\treturn pad(str, n, style)\n}\n\n// pad adds padding to either the left or right side of a string.\n// Positive values add to the right side while negative values\n// add to the left side.\nfunc pad(str string, n int, style *termenv.Style) string {\n\tif n == 0 {\n\t\treturn str\n\t}\n\n\tsp := strings.Repeat(\" \", abs(n))\n\tif style != nil {\n\t\tsp = style.Styled(sp)\n\t}\n\n\tb := strings.Builder{}\n\tl := strings.Split(str, \"\\n\")\n\n\tfor i := range l {\n\t\tswitch {\n\t\t// pad right\n\t\tcase n > 0:\n\t\t\tb.WriteString(l[i])\n\t\t\tb.WriteString(sp)\n\t\t// pad left\n\t\tdefault:\n\t\t\tb.WriteString(sp)\n\t\t\tb.WriteString(l[i])\n\t\t}\n\n\t\tif i != len(l)-1 {\n\t\t\tb.WriteRune('\\n')\n\t\t}\n\t}\n\n\treturn b.String()\n}\n\nfunc max(a, b int) int { //nolint:unparam\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/unset.go",
    "content": "package lipgloss\n\n// unset unsets a property from a style.\nfunc (s *Style) unset(key propKey) {\n\ts.props = s.props.unset(key)\n}\n\n// UnsetBold removes the bold style rule, if set.\nfunc (s Style) UnsetBold() Style {\n\ts.unset(boldKey)\n\treturn s\n}\n\n// UnsetItalic removes the italic style rule, if set.\nfunc (s Style) UnsetItalic() Style {\n\ts.unset(italicKey)\n\treturn s\n}\n\n// UnsetUnderline removes the underline style rule, if set.\nfunc (s Style) UnsetUnderline() Style {\n\ts.unset(underlineKey)\n\treturn s\n}\n\n// UnsetStrikethrough removes the strikethrough style rule, if set.\nfunc (s Style) UnsetStrikethrough() Style {\n\ts.unset(strikethroughKey)\n\treturn s\n}\n\n// UnsetReverse removes the reverse style rule, if set.\nfunc (s Style) UnsetReverse() Style {\n\ts.unset(reverseKey)\n\treturn s\n}\n\n// UnsetBlink removes the blink style rule, if set.\nfunc (s Style) UnsetBlink() Style {\n\ts.unset(blinkKey)\n\treturn s\n}\n\n// UnsetFaint removes the faint style rule, if set.\nfunc (s Style) UnsetFaint() Style {\n\ts.unset(faintKey)\n\treturn s\n}\n\n// UnsetForeground removes the foreground style rule, if set.\nfunc (s Style) UnsetForeground() Style {\n\ts.unset(foregroundKey)\n\treturn s\n}\n\n// UnsetBackground removes the background style rule, if set.\nfunc (s Style) UnsetBackground() Style {\n\ts.unset(backgroundKey)\n\treturn s\n}\n\n// UnsetWidth removes the width style rule, if set.\nfunc (s Style) UnsetWidth() Style {\n\ts.unset(widthKey)\n\treturn s\n}\n\n// UnsetHeight removes the height style rule, if set.\nfunc (s Style) UnsetHeight() Style {\n\ts.unset(heightKey)\n\treturn s\n}\n\n// UnsetAlign removes the horizontal and vertical text alignment style rule, if set.\nfunc (s Style) UnsetAlign() Style {\n\ts.unset(alignHorizontalKey)\n\ts.unset(alignVerticalKey)\n\treturn s\n}\n\n// UnsetAlignHorizontal removes the horizontal text alignment style rule, if set.\nfunc (s Style) UnsetAlignHorizontal() Style {\n\ts.unset(alignHorizontalKey)\n\treturn s\n}\n\n// UnsetAlignVertical removes the vertical text alignment style rule, if set.\nfunc (s Style) UnsetAlignVertical() Style {\n\ts.unset(alignVerticalKey)\n\treturn s\n}\n\n// UnsetPadding removes all padding style rules.\nfunc (s Style) UnsetPadding() Style {\n\ts.unset(paddingLeftKey)\n\ts.unset(paddingRightKey)\n\ts.unset(paddingTopKey)\n\ts.unset(paddingBottomKey)\n\treturn s\n}\n\n// UnsetPaddingLeft removes the left padding style rule, if set.\nfunc (s Style) UnsetPaddingLeft() Style {\n\ts.unset(paddingLeftKey)\n\treturn s\n}\n\n// UnsetPaddingRight removes the right padding style rule, if set.\nfunc (s Style) UnsetPaddingRight() Style {\n\ts.unset(paddingRightKey)\n\treturn s\n}\n\n// UnsetPaddingTop removes the top padding style rule, if set.\nfunc (s Style) UnsetPaddingTop() Style {\n\ts.unset(paddingTopKey)\n\treturn s\n}\n\n// UnsetPaddingBottom removes the bottom padding style rule, if set.\nfunc (s Style) UnsetPaddingBottom() Style {\n\ts.unset(paddingBottomKey)\n\treturn s\n}\n\n// UnsetColorWhitespace removes the rule for coloring padding, if set.\nfunc (s Style) UnsetColorWhitespace() Style {\n\ts.unset(colorWhitespaceKey)\n\treturn s\n}\n\n// UnsetMargins removes all margin style rules.\nfunc (s Style) UnsetMargins() Style {\n\ts.unset(marginLeftKey)\n\ts.unset(marginRightKey)\n\ts.unset(marginTopKey)\n\ts.unset(marginBottomKey)\n\treturn s\n}\n\n// UnsetMarginLeft removes the left margin style rule, if set.\nfunc (s Style) UnsetMarginLeft() Style {\n\ts.unset(marginLeftKey)\n\treturn s\n}\n\n// UnsetMarginRight removes the right margin style rule, if set.\nfunc (s Style) UnsetMarginRight() Style {\n\ts.unset(marginRightKey)\n\treturn s\n}\n\n// UnsetMarginTop removes the top margin style rule, if set.\nfunc (s Style) UnsetMarginTop() Style {\n\ts.unset(marginTopKey)\n\treturn s\n}\n\n// UnsetMarginBottom removes the bottom margin style rule, if set.\nfunc (s Style) UnsetMarginBottom() Style {\n\ts.unset(marginBottomKey)\n\treturn s\n}\n\n// UnsetMarginBackground removes the margin's background color. Note that the\n// margin's background color can be set from the background color of another\n// style during inheritance.\nfunc (s Style) UnsetMarginBackground() Style {\n\ts.unset(marginBackgroundKey)\n\treturn s\n}\n\n// UnsetBorderStyle removes the border style rule, if set.\nfunc (s Style) UnsetBorderStyle() Style {\n\ts.unset(borderStyleKey)\n\treturn s\n}\n\n// UnsetBorderTop removes the border top style rule, if set.\nfunc (s Style) UnsetBorderTop() Style {\n\ts.unset(borderTopKey)\n\treturn s\n}\n\n// UnsetBorderRight removes the border right style rule, if set.\nfunc (s Style) UnsetBorderRight() Style {\n\ts.unset(borderRightKey)\n\treturn s\n}\n\n// UnsetBorderBottom removes the border bottom style rule, if set.\nfunc (s Style) UnsetBorderBottom() Style {\n\ts.unset(borderBottomKey)\n\treturn s\n}\n\n// UnsetBorderLeft removes the border left style rule, if set.\nfunc (s Style) UnsetBorderLeft() Style {\n\ts.unset(borderLeftKey)\n\treturn s\n}\n\n// UnsetBorderForeground removes all border foreground color styles, if set.\nfunc (s Style) UnsetBorderForeground() Style {\n\ts.unset(borderTopForegroundKey)\n\ts.unset(borderRightForegroundKey)\n\ts.unset(borderBottomForegroundKey)\n\ts.unset(borderLeftForegroundKey)\n\treturn s\n}\n\n// UnsetBorderTopForeground removes the top border foreground color rule,\n// if set.\nfunc (s Style) UnsetBorderTopForeground() Style {\n\ts.unset(borderTopForegroundKey)\n\treturn s\n}\n\n// UnsetBorderRightForeground removes the right border foreground color rule,\n// if set.\nfunc (s Style) UnsetBorderRightForeground() Style {\n\ts.unset(borderRightForegroundKey)\n\treturn s\n}\n\n// UnsetBorderBottomForeground removes the bottom border foreground color\n// rule, if set.\nfunc (s Style) UnsetBorderBottomForeground() Style {\n\ts.unset(borderBottomForegroundKey)\n\treturn s\n}\n\n// UnsetBorderLeftForeground removes the left border foreground color rule,\n// if set.\nfunc (s Style) UnsetBorderLeftForeground() Style {\n\ts.unset(borderLeftForegroundKey)\n\treturn s\n}\n\n// UnsetBorderBackground removes all border background color styles, if\n// set.\nfunc (s Style) UnsetBorderBackground() Style {\n\ts.unset(borderTopBackgroundKey)\n\ts.unset(borderRightBackgroundKey)\n\ts.unset(borderBottomBackgroundKey)\n\ts.unset(borderLeftBackgroundKey)\n\treturn s\n}\n\n// UnsetBorderTopBackgroundColor removes the top border background color rule,\n// if set.\n//\n// Deprecated: This function simply calls Style.UnsetBorderTopBackground.\nfunc (s Style) UnsetBorderTopBackgroundColor() Style {\n\treturn s.UnsetBorderTopBackground()\n}\n\n// UnsetBorderTopBackground removes the top border background color rule,\n// if set.\nfunc (s Style) UnsetBorderTopBackground() Style {\n\ts.unset(borderTopBackgroundKey)\n\treturn s\n}\n\n// UnsetBorderRightBackground removes the right border background color\n// rule, if set.\nfunc (s Style) UnsetBorderRightBackground() Style {\n\ts.unset(borderRightBackgroundKey)\n\treturn s\n}\n\n// UnsetBorderBottomBackground removes the bottom border background color\n// rule, if set.\nfunc (s Style) UnsetBorderBottomBackground() Style {\n\ts.unset(borderBottomBackgroundKey)\n\treturn s\n}\n\n// UnsetBorderLeftBackground removes the left border color rule, if set.\nfunc (s Style) UnsetBorderLeftBackground() Style {\n\ts.unset(borderLeftBackgroundKey)\n\treturn s\n}\n\n// UnsetInline removes the inline style rule, if set.\nfunc (s Style) UnsetInline() Style {\n\ts.unset(inlineKey)\n\treturn s\n}\n\n// UnsetMaxWidth removes the max width style rule, if set.\nfunc (s Style) UnsetMaxWidth() Style {\n\ts.unset(maxWidthKey)\n\treturn s\n}\n\n// UnsetMaxHeight removes the max height style rule, if set.\nfunc (s Style) UnsetMaxHeight() Style {\n\ts.unset(maxHeightKey)\n\treturn s\n}\n\n// UnsetTabWidth removes the tab width style rule, if set.\nfunc (s Style) UnsetTabWidth() Style {\n\ts.unset(tabWidthKey)\n\treturn s\n}\n\n// UnsetUnderlineSpaces removes the value set by UnderlineSpaces.\nfunc (s Style) UnsetUnderlineSpaces() Style {\n\ts.unset(underlineSpacesKey)\n\treturn s\n}\n\n// UnsetStrikethroughSpaces removes the value set by StrikethroughSpaces.\nfunc (s Style) UnsetStrikethroughSpaces() Style {\n\ts.unset(strikethroughSpacesKey)\n\treturn s\n}\n\n// UnsetTransform removes the value set by Transform.\nfunc (s Style) UnsetTransform() Style {\n\ts.unset(transformKey)\n\treturn s\n}\n\n// UnsetString sets the underlying string value to the empty string.\nfunc (s Style) UnsetString() Style {\n\ts.value = \"\"\n\treturn s\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/lipgloss/whitespace.go",
    "content": "package lipgloss\n\nimport (\n\t\"strings\"\n\n\t\"github.com/charmbracelet/x/ansi\"\n\t\"github.com/muesli/termenv\"\n)\n\n// whitespace is a whitespace renderer.\ntype whitespace struct {\n\tre    *Renderer\n\tstyle termenv.Style\n\tchars string\n}\n\n// newWhitespace creates a new whitespace renderer. The order of the options\n// matters, if you're using WithWhitespaceRenderer, make sure it comes first as\n// other options might depend on it.\nfunc newWhitespace(r *Renderer, opts ...WhitespaceOption) *whitespace {\n\tw := &whitespace{\n\t\tre:    r,\n\t\tstyle: r.ColorProfile().String(),\n\t}\n\tfor _, opt := range opts {\n\t\topt(w)\n\t}\n\treturn w\n}\n\n// Render whitespaces.\nfunc (w whitespace) render(width int) string {\n\tif w.chars == \"\" {\n\t\tw.chars = \" \"\n\t}\n\n\tr := []rune(w.chars)\n\tj := 0\n\tb := strings.Builder{}\n\n\t// Cycle through runes and print them into the whitespace.\n\tfor i := 0; i < width; {\n\t\tb.WriteRune(r[j])\n\t\tj++\n\t\tif j >= len(r) {\n\t\t\tj = 0\n\t\t}\n\t\ti += ansi.StringWidth(string(r[j]))\n\t}\n\n\t// Fill any extra gaps white spaces. This might be necessary if any runes\n\t// are more than one cell wide, which could leave a one-rune gap.\n\tshort := width - ansi.StringWidth(b.String())\n\tif short > 0 {\n\t\tb.WriteString(strings.Repeat(\" \", short))\n\t}\n\n\treturn w.style.Styled(b.String())\n}\n\n// WhitespaceOption sets a styling rule for rendering whitespace.\ntype WhitespaceOption func(*whitespace)\n\n// WithWhitespaceForeground sets the color of the characters in the whitespace.\nfunc WithWhitespaceForeground(c TerminalColor) WhitespaceOption {\n\treturn func(w *whitespace) {\n\t\tw.style = w.style.Foreground(c.color(w.re))\n\t}\n}\n\n// WithWhitespaceBackground sets the background color of the whitespace.\nfunc WithWhitespaceBackground(c TerminalColor) WhitespaceOption {\n\treturn func(w *whitespace) {\n\t\tw.style = w.style.Background(c.color(w.re))\n\t}\n}\n\n// WithWhitespaceChars sets the characters to be rendered in the whitespace.\nfunc WithWhitespaceChars(s string) WhitespaceOption {\n\treturn func(w *whitespace) {\n\t\tw.chars = s\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2023 Charmbracelet, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/ansi.go",
    "content": "package ansi\n\nimport \"io\"\n\n// Execute is a function that \"execute\" the given escape sequence by writing it\n// to the provided output writter.\n//\n// This is a syntactic sugar over [io.WriteString].\nfunc Execute(w io.Writer, s string) (int, error) {\n\treturn io.WriteString(w, s)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/ascii.go",
    "content": "package ansi\n\nconst (\n\t// SP is the space character (Char: \\x20).\n\tSP = 0x20\n\t// DEL is the delete character (Caret: ^?, Char: \\x7f).\n\tDEL = 0x7F\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/background.go",
    "content": "package ansi\n\nimport (\n\t\"image/color\"\n)\n\n// SetForegroundColor returns a sequence that sets the default terminal\n// foreground color.\n//\n//\tOSC 10 ; color ST\n//\tOSC 10 ; color BEL\n//\n// Where color is the encoded color number.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc SetForegroundColor(c color.Color) string {\n\treturn \"\\x1b]10;\" + colorToHexString(c) + \"\\x07\"\n}\n\n// RequestForegroundColor is a sequence that requests the current default\n// terminal foreground color.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nconst RequestForegroundColor = \"\\x1b]10;?\\x07\"\n\n// SetBackgroundColor returns a sequence that sets the default terminal\n// background color.\n//\n//\tOSC 11 ; color ST\n//\tOSC 11 ; color BEL\n//\n// Where color is the encoded color number.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc SetBackgroundColor(c color.Color) string {\n\treturn \"\\x1b]11;\" + colorToHexString(c) + \"\\x07\"\n}\n\n// RequestBackgroundColor is a sequence that requests the current default\n// terminal background color.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nconst RequestBackgroundColor = \"\\x1b]11;?\\x07\"\n\n// SetCursorColor returns a sequence that sets the terminal cursor color.\n//\n//\tOSC 12 ; color ST\n//\tOSC 12 ; color BEL\n//\n// Where color is the encoded color number.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc SetCursorColor(c color.Color) string {\n\treturn \"\\x1b]12;\" + colorToHexString(c) + \"\\x07\"\n}\n\n// RequestCursorColor is a sequence that requests the current terminal cursor\n// color.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nconst RequestCursorColor = \"\\x1b]12;?\\x07\"\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/c0.go",
    "content": "package ansi\n\n// C0 control characters.\n//\n// These range from (0x00-0x1F) as defined in ISO 646 (ASCII).\n// See: https://en.wikipedia.org/wiki/C0_and_C1_control_codes\nconst (\n\t// NUL is the null character (Caret: ^@, Char: \\0).\n\tNUL = 0x00\n\t// SOH is the start of heading character (Caret: ^A).\n\tSOH = 0x01\n\t// STX is the start of text character (Caret: ^B).\n\tSTX = 0x02\n\t// ETX is the end of text character (Caret: ^C).\n\tETX = 0x03\n\t// EOT is the end of transmission character (Caret: ^D).\n\tEOT = 0x04\n\t// ENQ is the enquiry character (Caret: ^E).\n\tENQ = 0x05\n\t// ACK is the acknowledge character (Caret: ^F).\n\tACK = 0x06\n\t// BEL is the bell character (Caret: ^G, Char: \\a).\n\tBEL = 0x07\n\t// BS is the backspace character (Caret: ^H, Char: \\b).\n\tBS = 0x08\n\t// HT is the horizontal tab character (Caret: ^I, Char: \\t).\n\tHT = 0x09\n\t// LF is the line feed character (Caret: ^J, Char: \\n).\n\tLF = 0x0A\n\t// VT is the vertical tab character (Caret: ^K, Char: \\v).\n\tVT = 0x0B\n\t// FF is the form feed character (Caret: ^L, Char: \\f).\n\tFF = 0x0C\n\t// CR is the carriage return character (Caret: ^M, Char: \\r).\n\tCR = 0x0D\n\t// SO is the shift out character (Caret: ^N).\n\tSO = 0x0E\n\t// SI is the shift in character (Caret: ^O).\n\tSI = 0x0F\n\t// DLE is the data link escape character (Caret: ^P).\n\tDLE = 0x10\n\t// DC1 is the device control 1 character (Caret: ^Q).\n\tDC1 = 0x11\n\t// DC2 is the device control 2 character (Caret: ^R).\n\tDC2 = 0x12\n\t// DC3 is the device control 3 character (Caret: ^S).\n\tDC3 = 0x13\n\t// DC4 is the device control 4 character (Caret: ^T).\n\tDC4 = 0x14\n\t// NAK is the negative acknowledge character (Caret: ^U).\n\tNAK = 0x15\n\t// SYN is the synchronous idle character (Caret: ^V).\n\tSYN = 0x16\n\t// ETB is the end of transmission block character (Caret: ^W).\n\tETB = 0x17\n\t// CAN is the cancel character (Caret: ^X).\n\tCAN = 0x18\n\t// EM is the end of medium character (Caret: ^Y).\n\tEM = 0x19\n\t// SUB is the substitute character (Caret: ^Z).\n\tSUB = 0x1A\n\t// ESC is the escape character (Caret: ^[, Char: \\e).\n\tESC = 0x1B\n\t// FS is the file separator character (Caret: ^\\).\n\tFS = 0x1C\n\t// GS is the group separator character (Caret: ^]).\n\tGS = 0x1D\n\t// RS is the record separator character (Caret: ^^).\n\tRS = 0x1E\n\t// US is the unit separator character (Caret: ^_).\n\tUS = 0x1F\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/c1.go",
    "content": "package ansi\n\n// C1 control characters.\n//\n// These range from (0x80-0x9F) as defined in ISO 6429 (ECMA-48).\n// See: https://en.wikipedia.org/wiki/C0_and_C1_control_codes\nconst (\n\t// PAD is the padding character.\n\tPAD = 0x80\n\t// HOP is the high octet preset character.\n\tHOP = 0x81\n\t// BPH is the break permitted here character.\n\tBPH = 0x82\n\t// NBH is the no break here character.\n\tNBH = 0x83\n\t// IND is the index character.\n\tIND = 0x84\n\t// NEL is the next line character.\n\tNEL = 0x85\n\t// SSA is the start of selected area character.\n\tSSA = 0x86\n\t// ESA is the end of selected area character.\n\tESA = 0x87\n\t// HTS is the horizontal tab set character.\n\tHTS = 0x88\n\t// HTJ is the horizontal tab with justification character.\n\tHTJ = 0x89\n\t// VTS is the vertical tab set character.\n\tVTS = 0x8A\n\t// PLD is the partial line forward character.\n\tPLD = 0x8B\n\t// PLU is the partial line backward character.\n\tPLU = 0x8C\n\t// RI is the reverse index character.\n\tRI = 0x8D\n\t// SS2 is the single shift 2 character.\n\tSS2 = 0x8E\n\t// SS3 is the single shift 3 character.\n\tSS3 = 0x8F\n\t// DCS is the device control string character.\n\tDCS = 0x90\n\t// PU1 is the private use 1 character.\n\tPU1 = 0x91\n\t// PU2 is the private use 2 character.\n\tPU2 = 0x92\n\t// STS is the set transmit state character.\n\tSTS = 0x93\n\t// CCH is the cancel character.\n\tCCH = 0x94\n\t// MW is the message waiting character.\n\tMW = 0x95\n\t// SPA is the start of guarded area character.\n\tSPA = 0x96\n\t// EPA is the end of guarded area character.\n\tEPA = 0x97\n\t// SOS is the start of string character.\n\tSOS = 0x98\n\t// SGCI is the single graphic character introducer character.\n\tSGCI = 0x99\n\t// SCI is the single character introducer character.\n\tSCI = 0x9A\n\t// CSI is the control sequence introducer character.\n\tCSI = 0x9B\n\t// ST is the string terminator character.\n\tST = 0x9C\n\t// OSC is the operating system command character.\n\tOSC = 0x9D\n\t// PM is the privacy message character.\n\tPM = 0x9E\n\t// APC is the application program command character.\n\tAPC = 0x9F\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/clipboard.go",
    "content": "package ansi\n\nimport \"encoding/base64\"\n\n// Clipboard names.\nconst (\n\tSystemClipboard  = 'c'\n\tPrimaryClipboard = 'p'\n)\n\n// SetClipboard returns a sequence for manipulating the clipboard.\n//\n//\tOSC 52 ; Pc ; Pd ST\n//\tOSC 52 ; Pc ; Pd BEL\n//\n// Where Pc is the clipboard name and Pd is the base64 encoded data.\n// Empty data or invalid base64 data will reset the clipboard.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc SetClipboard(c byte, d string) string {\n\tif d != \"\" {\n\t\td = base64.StdEncoding.EncodeToString([]byte(d))\n\t}\n\treturn \"\\x1b]52;\" + string(c) + \";\" + d + \"\\x07\"\n}\n\n// SetSystemClipboard returns a sequence for setting the system clipboard.\n//\n// This is equivalent to SetClipboard(SystemClipboard, d).\nfunc SetSystemClipboard(d string) string {\n\treturn SetClipboard(SystemClipboard, d)\n}\n\n// SetPrimaryClipboard returns a sequence for setting the primary clipboard.\n//\n// This is equivalent to SetClipboard(PrimaryClipboard, d).\nfunc SetPrimaryClipboard(d string) string {\n\treturn SetClipboard(PrimaryClipboard, d)\n}\n\n// ResetClipboard returns a sequence for resetting the clipboard.\n//\n// This is equivalent to SetClipboard(c, \"\").\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc ResetClipboard(c byte) string {\n\treturn SetClipboard(c, \"\")\n}\n\n// ResetSystemClipboard is a sequence for resetting the system clipboard.\n//\n// This is equivalent to ResetClipboard(SystemClipboard).\nconst ResetSystemClipboard = \"\\x1b]52;c;\\x07\"\n\n// ResetPrimaryClipboard is a sequence for resetting the primary clipboard.\n//\n// This is equivalent to ResetClipboard(PrimaryClipboard).\nconst ResetPrimaryClipboard = \"\\x1b]52;p;\\x07\"\n\n// RequestClipboard returns a sequence for requesting the clipboard.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc RequestClipboard(c byte) string {\n\treturn \"\\x1b]52;\" + string(c) + \";?\\x07\"\n}\n\n// RequestSystemClipboard is a sequence for requesting the system clipboard.\n//\n// This is equivalent to RequestClipboard(SystemClipboard).\nconst RequestSystemClipboard = \"\\x1b]52;c;?\\x07\"\n\n// RequestPrimaryClipboard is a sequence for requesting the primary clipboard.\n//\n// This is equivalent to RequestClipboard(PrimaryClipboard).\nconst RequestPrimaryClipboard = \"\\x1b]52;p;?\\x07\"\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/color.go",
    "content": "package ansi\n\nimport (\n\t\"image/color\"\n)\n\n// Technically speaking, the 16 basic ANSI colors are arbitrary and can be\n// customized at the terminal level. Given that, we're returning what we feel\n// are good defaults.\n//\n// This could also be a slice, but we use a map to make the mappings very\n// explicit.\n//\n// See: https://www.ditig.com/publications/256-colors-cheat-sheet\nvar lowANSI = map[uint32]uint32{\n\t0:  0x000000, // black\n\t1:  0x800000, // red\n\t2:  0x008000, // green\n\t3:  0x808000, // yellow\n\t4:  0x000080, // blue\n\t5:  0x800080, // magenta\n\t6:  0x008080, // cyan\n\t7:  0xc0c0c0, // white\n\t8:  0x808080, // bright black\n\t9:  0xff0000, // bright red\n\t10: 0x00ff00, // bright green\n\t11: 0xffff00, // bright yellow\n\t12: 0x0000ff, // bright blue\n\t13: 0xff00ff, // bright magenta\n\t14: 0x00ffff, // bright cyan\n\t15: 0xffffff, // bright white\n}\n\n// Color is a color that can be used in a terminal. ANSI (including\n// ANSI256) and 24-bit \"true colors\" fall under this category.\ntype Color interface {\n\tcolor.Color\n}\n\n// BasicColor is an ANSI 3-bit or 4-bit color with a value from 0 to 15.\ntype BasicColor uint8\n\nvar _ Color = BasicColor(0)\n\nconst (\n\t// Black is the ANSI black color.\n\tBlack BasicColor = iota\n\n\t// Red is the ANSI red color.\n\tRed\n\n\t// Green is the ANSI green color.\n\tGreen\n\n\t// Yellow is the ANSI yellow color.\n\tYellow\n\n\t// Blue is the ANSI blue color.\n\tBlue\n\n\t// Magenta is the ANSI magenta color.\n\tMagenta\n\n\t// Cyan is the ANSI cyan color.\n\tCyan\n\n\t// White is the ANSI white color.\n\tWhite\n\n\t// BrightBlack is the ANSI bright black color.\n\tBrightBlack\n\n\t// BrightRed is the ANSI bright red color.\n\tBrightRed\n\n\t// BrightGreen is the ANSI bright green color.\n\tBrightGreen\n\n\t// BrightYellow is the ANSI bright yellow color.\n\tBrightYellow\n\n\t// BrightBlue is the ANSI bright blue color.\n\tBrightBlue\n\n\t// BrightMagenta is the ANSI bright magenta color.\n\tBrightMagenta\n\n\t// BrightCyan is the ANSI bright cyan color.\n\tBrightCyan\n\n\t// BrightWhite is the ANSI bright white color.\n\tBrightWhite\n)\n\n// RGBA returns the red, green, blue and alpha components of the color. It\n// satisfies the color.Color interface.\nfunc (c BasicColor) RGBA() (uint32, uint32, uint32, uint32) {\n\tansi := uint32(c)\n\tif ansi > 15 {\n\t\treturn 0, 0, 0, 0xffff\n\t}\n\n\tr, g, b := ansiToRGB(ansi)\n\treturn toRGBA(r, g, b)\n}\n\n// ExtendedColor is an ANSI 256 (8-bit) color with a value from 0 to 255.\ntype ExtendedColor uint8\n\nvar _ Color = ExtendedColor(0)\n\n// RGBA returns the red, green, blue and alpha components of the color. It\n// satisfies the color.Color interface.\nfunc (c ExtendedColor) RGBA() (uint32, uint32, uint32, uint32) {\n\tr, g, b := ansiToRGB(uint32(c))\n\treturn toRGBA(r, g, b)\n}\n\n// TrueColor is a 24-bit color that can be used in the terminal.\n// This can be used to represent RGB colors.\n//\n// For example, the color red can be represented as:\n//\n//\tTrueColor(0xff0000)\ntype TrueColor uint32\n\nvar _ Color = TrueColor(0)\n\n// RGBA returns the red, green, blue and alpha components of the color. It\n// satisfies the color.Color interface.\nfunc (c TrueColor) RGBA() (uint32, uint32, uint32, uint32) {\n\tr, g, b := hexToRGB(uint32(c))\n\treturn toRGBA(r, g, b)\n}\n\n// ansiToRGB converts an ANSI color to a 24-bit RGB color.\n//\n//\tr, g, b := ansiToRGB(57)\nfunc ansiToRGB(ansi uint32) (uint32, uint32, uint32) {\n\t// For out-of-range values return black.\n\tif ansi > 255 {\n\t\treturn 0, 0, 0\n\t}\n\n\t// Low ANSI.\n\tif ansi < 16 {\n\t\th, ok := lowANSI[ansi]\n\t\tif !ok {\n\t\t\treturn 0, 0, 0\n\t\t}\n\t\tr, g, b := hexToRGB(h)\n\t\treturn r, g, b\n\t}\n\n\t// Grays.\n\tif ansi > 231 {\n\t\ts := (ansi-232)*10 + 8\n\t\treturn s, s, s\n\t}\n\n\t// ANSI256.\n\tn := ansi - 16\n\tb := n % 6\n\tg := (n - b) / 6 % 6\n\tr := (n - b - g*6) / 36 % 6\n\tfor _, v := range []*uint32{&r, &g, &b} {\n\t\tif *v > 0 {\n\t\t\tc := *v*40 + 55\n\t\t\t*v = c\n\t\t}\n\t}\n\n\treturn r, g, b\n}\n\n// hexToRGB converts a number in hexadecimal format to red, green, and blue\n// values.\n//\n//\tr, g, b := hexToRGB(0x0000FF)\nfunc hexToRGB(hex uint32) (uint32, uint32, uint32) {\n\treturn hex >> 16, hex >> 8 & 0xff, hex & 0xff\n}\n\n// toRGBA converts an RGB 8-bit color values to 32-bit color values suitable\n// for color.Color.\n//\n// color.Color requires 16-bit color values, so we duplicate the 8-bit values\n// to fill the 16-bit values.\n//\n// This always returns 0xffff (opaque) for the alpha channel.\nfunc toRGBA(r, g, b uint32) (uint32, uint32, uint32, uint32) {\n\tr |= r << 8\n\tg |= g << 8\n\tb |= b << 8\n\treturn r, g, b, 0xffff\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/csi.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\t\"strconv\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n)\n\n// CsiSequence represents a control sequence introducer (CSI) sequence.\n//\n// The sequence starts with a CSI sequence, CSI (0x9B) in a 8-bit environment\n// or ESC [ (0x1B 0x5B) in a 7-bit environment, followed by any number of\n// parameters in the range of 0x30-0x3F, then by any number of intermediate\n// byte in the range of 0x20-0x2F, then finally with a single final byte in the\n// range of 0x20-0x7E.\n//\n//\tCSI P..P I..I F\n//\n// See ECMA-48 § 5.4.\ntype CsiSequence struct {\n\t// Params contains the raw parameters of the sequence.\n\t// This is a slice of integers, where each integer is a 32-bit integer\n\t// containing the parameter value in the lower 31 bits and a flag in the\n\t// most significant bit indicating whether there are more sub-parameters.\n\tParams []int\n\n\t// Cmd contains the raw command of the sequence.\n\t// The command is a 32-bit integer containing the CSI command byte in the\n\t// lower 8 bits, the private marker in the next 8 bits, and the intermediate\n\t// byte in the next 8 bits.\n\t//\n\t//  CSI ? u\n\t//\n\t// Is represented as:\n\t//\n\t//  'u' | '?' << 8\n\tCmd int\n}\n\nvar _ Sequence = CsiSequence{}\n\n// Marker returns the marker byte of the CSI sequence.\n// This is always gonna be one of the following '<' '=' '>' '?' and in the\n// range of 0x3C-0x3F.\n// Zero is returned if the sequence does not have a marker.\nfunc (s CsiSequence) Marker() int {\n\treturn parser.Marker(s.Cmd)\n}\n\n// Intermediate returns the intermediate byte of the CSI sequence.\n// An intermediate byte is in the range of 0x20-0x2F. This includes these\n// characters from ' ', '!', '\"', '#', '$', '%', '&', ”', '(', ')', '*', '+',\n// ',', '-', '.', '/'.\n// Zero is returned if the sequence does not have an intermediate byte.\nfunc (s CsiSequence) Intermediate() int {\n\treturn parser.Intermediate(s.Cmd)\n}\n\n// Command returns the command byte of the CSI sequence.\nfunc (s CsiSequence) Command() int {\n\treturn parser.Command(s.Cmd)\n}\n\n// Param returns the parameter at the given index.\n// It returns -1 if the parameter does not exist.\nfunc (s CsiSequence) Param(i int) int {\n\treturn parser.Param(s.Params, i)\n}\n\n// HasMore returns true if the parameter has more sub-parameters.\nfunc (s CsiSequence) HasMore(i int) bool {\n\treturn parser.HasMore(s.Params, i)\n}\n\n// Subparams returns the sub-parameters of the given parameter.\n// It returns nil if the parameter does not exist.\nfunc (s CsiSequence) Subparams(i int) []int {\n\treturn parser.Subparams(s.Params, i)\n}\n\n// Len returns the number of parameters in the sequence.\n// This will return the number of parameters in the sequence, excluding any\n// sub-parameters.\nfunc (s CsiSequence) Len() int {\n\treturn parser.Len(s.Params)\n}\n\n// Range iterates over the parameters of the sequence and calls the given\n// function for each parameter.\n// The function should return false to stop the iteration.\nfunc (s CsiSequence) Range(fn func(i int, param int, hasMore bool) bool) {\n\tparser.Range(s.Params, fn)\n}\n\n// Clone returns a copy of the CSI sequence.\nfunc (s CsiSequence) Clone() Sequence {\n\treturn CsiSequence{\n\t\tParams: append([]int(nil), s.Params...),\n\t\tCmd:    s.Cmd,\n\t}\n}\n\n// String returns a string representation of the sequence.\n// The string will always be in the 7-bit format i.e (ESC [ P..P I..I F).\nfunc (s CsiSequence) String() string {\n\treturn s.buffer().String()\n}\n\n// buffer returns a buffer containing the sequence.\nfunc (s CsiSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteString(\"\\x1b[\")\n\tif m := s.Marker(); m != 0 {\n\t\tb.WriteByte(byte(m))\n\t}\n\ts.Range(func(i, param int, hasMore bool) bool {\n\t\tif param >= 0 {\n\t\t\tb.WriteString(strconv.Itoa(param))\n\t\t}\n\t\tif i < len(s.Params)-1 {\n\t\t\tif hasMore {\n\t\t\t\tb.WriteByte(':')\n\t\t\t} else {\n\t\t\t\tb.WriteByte(';')\n\t\t\t}\n\t\t}\n\t\treturn true\n\t})\n\tif i := s.Intermediate(); i != 0 {\n\t\tb.WriteByte(byte(i))\n\t}\n\tb.WriteByte(byte(s.Command()))\n\treturn &b\n}\n\n// Bytes returns the byte representation of the sequence.\n// The bytes will always be in the 7-bit format i.e (ESC [ P..P I..I F).\nfunc (s CsiSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/ctrl.go",
    "content": "package ansi\n\n// RequestXTVersion is a control sequence that requests the terminal's XTVERSION. It responds with a DSR sequence identifying the version.\n//\n//\tCSI > Ps q\n//\tDCS > | text ST\n//\n// See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys\nconst RequestXTVersion = \"\\x1b[>0q\"\n\n// RequestPrimaryDeviceAttributes is a control sequence that requests the\n// terminal's primary device attributes (DA1).\n//\n//\tCSI c\n//\n// See https://vt100.net/docs/vt510-rm/DA1.html\nconst RequestPrimaryDeviceAttributes = \"\\x1b[c\"\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/cursor.go",
    "content": "package ansi\n\nimport \"strconv\"\n\n// SaveCursor (DECSC) is an escape sequence that saves the current cursor\n// position.\n//\n//\tESC 7\n//\n// See: https://vt100.net/docs/vt510-rm/DECSC.html\nconst SaveCursor = \"\\x1b7\"\n\n// RestoreCursor (DECRC) is an escape sequence that restores the cursor\n// position.\n//\n//\tESC 8\n//\n// See: https://vt100.net/docs/vt510-rm/DECRC.html\nconst RestoreCursor = \"\\x1b8\"\n\n// RequestCursorPosition (CPR) is an escape sequence that requests the current\n// cursor position.\n//\n//\tCSI 6 n\n//\n// The terminal will report the cursor position as a CSI sequence in the\n// following format:\n//\n//\tCSI Pl ; Pc R\n//\n// Where Pl is the line number and Pc is the column number.\n// See: https://vt100.net/docs/vt510-rm/CPR.html\nconst RequestCursorPosition = \"\\x1b[6n\"\n\n// RequestExtendedCursorPosition (DECXCPR) is a sequence for requesting the\n// cursor position report including the current page number.\n//\n//\tCSI ? 6 n\n//\n// The terminal will report the cursor position as a CSI sequence in the\n// following format:\n//\n//\tCSI ? Pl ; Pc ; Pp R\n//\n// Where Pl is the line number, Pc is the column number, and Pp is the page\n// number.\n// See: https://vt100.net/docs/vt510-rm/DECXCPR.html\nconst RequestExtendedCursorPosition = \"\\x1b[?6n\"\n\n// CursorUp (CUU) returns a sequence for moving the cursor up n cells.\n//\n//\tCSI n A\n//\n// See: https://vt100.net/docs/vt510-rm/CUU.html\nfunc CursorUp(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"A\"\n}\n\n// CursorUp1 is a sequence for moving the cursor up one cell.\n//\n// This is equivalent to CursorUp(1).\nconst CursorUp1 = \"\\x1b[A\"\n\n// CursorDown (CUD) returns a sequence for moving the cursor down n cells.\n//\n//\tCSI n B\n//\n// See: https://vt100.net/docs/vt510-rm/CUD.html\nfunc CursorDown(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"B\"\n}\n\n// CursorDown1 is a sequence for moving the cursor down one cell.\n//\n// This is equivalent to CursorDown(1).\nconst CursorDown1 = \"\\x1b[B\"\n\n// CursorRight (CUF) returns a sequence for moving the cursor right n cells.\n//\n//\tCSI n C\n//\n// See: https://vt100.net/docs/vt510-rm/CUF.html\nfunc CursorRight(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"C\"\n}\n\n// CursorRight1 is a sequence for moving the cursor right one cell.\n//\n// This is equivalent to CursorRight(1).\nconst CursorRight1 = \"\\x1b[C\"\n\n// CursorLeft (CUB) returns a sequence for moving the cursor left n cells.\n//\n//\tCSI n D\n//\n// See: https://vt100.net/docs/vt510-rm/CUB.html\nfunc CursorLeft(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"D\"\n}\n\n// CursorLeft1 is a sequence for moving the cursor left one cell.\n//\n// This is equivalent to CursorLeft(1).\nconst CursorLeft1 = \"\\x1b[D\"\n\n// CursorNextLine (CNL) returns a sequence for moving the cursor to the\n// beginning of the next line n times.\n//\n//\tCSI n E\n//\n// See: https://vt100.net/docs/vt510-rm/CNL.html\nfunc CursorNextLine(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"E\"\n}\n\n// CursorPreviousLine (CPL) returns a sequence for moving the cursor to the\n// beginning of the previous line n times.\n//\n//\tCSI n F\n//\n// See: https://vt100.net/docs/vt510-rm/CPL.html\nfunc CursorPreviousLine(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"F\"\n}\n\n// MoveCursor (CUP) returns a sequence for moving the cursor to the given row\n// and column.\n//\n//\tCSI n ; m H\n//\n// See: https://vt100.net/docs/vt510-rm/CUP.html\nfunc MoveCursor(row, col int) string {\n\tif row < 0 {\n\t\trow = 0\n\t}\n\tif col < 0 {\n\t\tcol = 0\n\t}\n\treturn \"\\x1b[\" + strconv.Itoa(row) + \";\" + strconv.Itoa(col) + \"H\"\n}\n\n// MoveCursorOrigin is a sequence for moving the cursor to the upper left\n// corner of the screen. This is equivalent to MoveCursor(1, 1).\nconst MoveCursorOrigin = \"\\x1b[1;1H\"\n\n// SaveCursorPosition (SCP or SCOSC) is a sequence for saving the cursor\n// position.\n//\n//\tCSI s\n//\n// This acts like Save, except the page number where the cursor is located is\n// not saved.\n//\n// See: https://vt100.net/docs/vt510-rm/SCOSC.html\nconst SaveCursorPosition = \"\\x1b[s\"\n\n// RestoreCursorPosition (RCP or SCORC) is a sequence for restoring the cursor\n// position.\n//\n//\tCSI u\n//\n// This acts like Restore, except the cursor stays on the same page where the\n// cursor was saved.\n//\n// See: https://vt100.net/docs/vt510-rm/SCORC.html\nconst RestoreCursorPosition = \"\\x1b[u\"\n\n// SetCursorStyle (DECSCUSR) returns a sequence for changing the cursor style.\n//\n//\tCSI Ps SP q\n//\n// Where Ps is the cursor style:\n//\n//\t0: Blinking block\n//\t1: Blinking block (default)\n//\t2: Steady block\n//\t3: Blinking underline\n//\t4: Steady underline\n//\t5: Blinking bar (xterm)\n//\t6: Steady bar (xterm)\n//\n// See: https://vt100.net/docs/vt510-rm/DECSCUSR.html\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81\nfunc SetCursorStyle(style int) string {\n\tif style < 0 {\n\t\tstyle = 0\n\t}\n\treturn \"\\x1b[\" + strconv.Itoa(style) + \" q\"\n}\n\n// SetPointerShape returns a sequence for changing the mouse pointer cursor\n// shape. Use \"default\" for the default pointer shape.\n//\n//\tOSC 22 ; Pt ST\n//\tOSC 22 ; Pt BEL\n//\n// Where Pt is the pointer shape name. The name can be anything that the\n// operating system can understand. Some common names are:\n//\n//   - copy\n//   - crosshair\n//   - default\n//   - ew-resize\n//   - n-resize\n//   - text\n//   - wait\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands\nfunc SetPointerShape(shape string) string {\n\treturn \"\\x1b]22;\" + shape + \"\\x07\"\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/dcs.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\t\"strconv\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n)\n\n// DcsSequence represents a Device Control String (DCS) escape sequence.\n//\n// The DCS sequence is used to send device control strings to the terminal. The\n// sequence starts with the C1 control code character DCS (0x9B) or ESC P in\n// 7-bit environments, followed by parameter bytes, intermediate bytes, a\n// command byte, followed by data bytes, and ends with the C1 control code\n// character ST (0x9C) or ESC \\ in 7-bit environments.\n//\n// This follows the parameter string format.\n// See ECMA-48 § 5.4.1\ntype DcsSequence struct {\n\t// Params contains the raw parameters of the sequence.\n\t// This is a slice of integers, where each integer is a 32-bit integer\n\t// containing the parameter value in the lower 31 bits and a flag in the\n\t// most significant bit indicating whether there are more sub-parameters.\n\tParams []int\n\n\t// Data contains the string raw data of the sequence.\n\t// This is the data between the final byte and the escape sequence terminator.\n\tData []byte\n\n\t// Cmd contains the raw command of the sequence.\n\t// The command is a 32-bit integer containing the DCS command byte in the\n\t// lower 8 bits, the private marker in the next 8 bits, and the intermediate\n\t// byte in the next 8 bits.\n\t//\n\t//  DCS > 0 ; 1 $ r <data> ST\n\t//\n\t// Is represented as:\n\t//\n\t//  'r' | '>' << 8 | '$' << 16\n\tCmd int\n}\n\nvar _ Sequence = DcsSequence{}\n\n// Marker returns the marker byte of the DCS sequence.\n// This is always gonna be one of the following '<' '=' '>' '?' and in the\n// range of 0x3C-0x3F.\n// Zero is returned if the sequence does not have a marker.\nfunc (s DcsSequence) Marker() int {\n\treturn parser.Marker(s.Cmd)\n}\n\n// Intermediate returns the intermediate byte of the DCS sequence.\n// An intermediate byte is in the range of 0x20-0x2F. This includes these\n// characters from ' ', '!', '\"', '#', '$', '%', '&', ”', '(', ')', '*', '+',\n// ',', '-', '.', '/'.\n// Zero is returned if the sequence does not have an intermediate byte.\nfunc (s DcsSequence) Intermediate() int {\n\treturn parser.Intermediate(s.Cmd)\n}\n\n// Command returns the command byte of the CSI sequence.\nfunc (s DcsSequence) Command() int {\n\treturn parser.Command(s.Cmd)\n}\n\n// Param returns the parameter at the given index.\n// It returns -1 if the parameter does not exist.\nfunc (s DcsSequence) Param(i int) int {\n\treturn parser.Param(s.Params, i)\n}\n\n// HasMore returns true if the parameter has more sub-parameters.\nfunc (s DcsSequence) HasMore(i int) bool {\n\treturn parser.HasMore(s.Params, i)\n}\n\n// Subparams returns the sub-parameters of the given parameter.\n// It returns nil if the parameter does not exist.\nfunc (s DcsSequence) Subparams(i int) []int {\n\treturn parser.Subparams(s.Params, i)\n}\n\n// Len returns the number of parameters in the sequence.\n// This will return the number of parameters in the sequence, excluding any\n// sub-parameters.\nfunc (s DcsSequence) Len() int {\n\treturn parser.Len(s.Params)\n}\n\n// Range iterates over the parameters of the sequence and calls the given\n// function for each parameter.\n// The function should return false to stop the iteration.\nfunc (s DcsSequence) Range(fn func(i int, param int, hasMore bool) bool) {\n\tparser.Range(s.Params, fn)\n}\n\n// Clone returns a copy of the DCS sequence.\nfunc (s DcsSequence) Clone() Sequence {\n\treturn DcsSequence{\n\t\tParams: append([]int(nil), s.Params...),\n\t\tData:   append([]byte(nil), s.Data...),\n\t\tCmd:    s.Cmd,\n\t}\n}\n\n// String returns a string representation of the sequence.\n// The string will always be in the 7-bit format i.e (ESC P p..p i..i f <data> ESC \\).\nfunc (s DcsSequence) String() string {\n\treturn s.buffer().String()\n}\n\n// buffer returns a buffer containing the sequence.\nfunc (s DcsSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteString(\"\\x1bP\")\n\tif m := s.Marker(); m != 0 {\n\t\tb.WriteByte(byte(m))\n\t}\n\ts.Range(func(i, param int, hasMore bool) bool {\n\t\tif param >= -1 {\n\t\t\tb.WriteString(strconv.Itoa(param))\n\t\t}\n\t\tif i < len(s.Params)-1 {\n\t\t\tif hasMore {\n\t\t\t\tb.WriteByte(':')\n\t\t\t} else {\n\t\t\t\tb.WriteByte(';')\n\t\t\t}\n\t\t}\n\t\treturn true\n\t})\n\tif i := s.Intermediate(); i != 0 {\n\t\tb.WriteByte(byte(i))\n\t}\n\tb.WriteByte(byte(s.Command()))\n\tb.Write(s.Data)\n\tb.WriteByte(ESC)\n\tb.WriteByte('\\\\')\n\treturn &b\n}\n\n// Bytes returns the byte representation of the sequence.\n// The bytes will always be in the 7-bit format i.e (ESC P p..p i..i F <data> ESC \\).\nfunc (s DcsSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/doc.go",
    "content": "// Package ansi defines common ANSI escape sequences based on the ECMA-48\n// specs.\n//\n// All sequences use 7-bit C1 control codes, which are supported by most\n// terminal emulators. OSC sequences are terminated by a BEL for wider\n// compatibility with terminals.\npackage ansi\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/hyperlink.go",
    "content": "package ansi\n\nimport \"strings\"\n\n// SetHyperlink returns a sequence for starting a hyperlink.\n//\n//\tOSC 8 ; Params ; Uri ST\n//\tOSC 8 ; Params ; Uri BEL\n//\n// To reset the hyperlink, omit the URI.\n//\n// See: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda\nfunc SetHyperlink(uri string, params ...string) string {\n\tvar p string\n\tif len(params) > 0 {\n\t\tp = strings.Join(params, \":\")\n\t}\n\treturn \"\\x1b]8;\" + p + \";\" + uri + \"\\x07\"\n}\n\n// ResetHyperlink returns a sequence for resetting the hyperlink.\n//\n// This is equivalent to SetHyperlink(\"\", params...).\n//\n// See: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda\nfunc ResetHyperlink(params ...string) string {\n\treturn SetHyperlink(\"\", params...)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/kitty.go",
    "content": "package ansi\n\nimport \"strconv\"\n\n// Kitty keyboard protocol progressive enhancement flags.\n// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement\nconst (\n\tKittyDisambiguateEscapeCodes = 1 << iota\n\tKittyReportEventTypes\n\tKittyReportAlternateKeys\n\tKittyReportAllKeysAsEscapeCodes\n\tKittyReportAssociatedKeys\n\n\tKittyAllFlags = KittyDisambiguateEscapeCodes | KittyReportEventTypes |\n\t\tKittyReportAlternateKeys | KittyReportAllKeysAsEscapeCodes | KittyReportAssociatedKeys\n)\n\n// RequestKittyKeyboard is a sequence to request the terminal Kitty keyboard\n// protocol enabled flags.\n//\n// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\nconst RequestKittyKeyboard = \"\\x1b[?u\"\n\n// KittyKeyboard returns a sequence to request keyboard enhancements from the terminal.\n// The flags argument is a bitmask of the Kitty keyboard protocol flags. While\n// mode specifies how the flags should be interpreted.\n//\n// Possible values for flags mask:\n//\n//\t1:  Disambiguate escape codes\n//\t2:  Report event types\n//\t4:  Report alternate keys\n//\t8:  Report all keys as escape codes\n//\t16: Report associated text\n//\n// Possible values for mode:\n//\n//\t1: Set given flags and unset all others\n//\t2: Set given flags and keep existing flags unchanged\n//\t3: Unset given flags and keep existing flags unchanged\n//\n// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement\nfunc KittyKeyboard(flags, mode int) string {\n\treturn \"\\x1b[=\" + strconv.Itoa(flags) + \";\" + strconv.Itoa(mode) + \"u\"\n}\n\n// PushKittyKeyboard returns a sequence to push the given flags to the terminal\n// Kitty Keyboard stack.\n//\n// Possible values for flags mask:\n//\n//\t0:  Disable all features\n//\t1:  Disambiguate escape codes\n//\t2:  Report event types\n//\t4:  Report alternate keys\n//\t8:  Report all keys as escape codes\n//\t16: Report associated text\n//\n//\tCSI > flags u\n//\n// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement\nfunc PushKittyKeyboard(flags int) string {\n\tvar f string\n\tif flags > 0 {\n\t\tf = strconv.Itoa(flags)\n\t}\n\n\treturn \"\\x1b[>\" + f + \"u\"\n}\n\n// DisableKittyKeyboard is a sequence to push zero into the terminal Kitty\n// Keyboard stack to disable the protocol.\n//\n// This is equivalent to PushKittyKeyboard(0).\nconst DisableKittyKeyboard = \"\\x1b[>0u\"\n\n// PopKittyKeyboard returns a sequence to pop n number of flags from the\n// terminal Kitty Keyboard stack.\n//\n//\tCSI < flags u\n//\n// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement\nfunc PopKittyKeyboard(n int) string {\n\tvar num string\n\tif n > 0 {\n\t\tnum = strconv.Itoa(n)\n\t}\n\n\treturn \"\\x1b[<\" + num + \"u\"\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/mode.go",
    "content": "package ansi\n\n// This file define uses multiple sequences to set (SM), reset (RM), and request\n// (DECRQM) different ANSI and DEC modes.\n//\n// See: https://vt100.net/docs/vt510-rm/SM.html\n// See: https://vt100.net/docs/vt510-rm/RM.html\n// See: https://vt100.net/docs/vt510-rm/DECRQM.html\n//\n// The terminal then responds to the request with a Report Mode function\n// (DECRPM) in the format:\n//\n// ANSI format:\n//\n//  CSI Pa ; Ps ; $ y\n//\n// DEC format:\n//\n//  CSI ? Pa ; Ps $ y\n//\n// Where Pa is the mode number, and Ps is the mode value.\n// See: https://vt100.net/docs/vt510-rm/DECRPM.html\n\n// Application Cursor Keys (DECCKM) is a mode that determines whether the\n// cursor keys send ANSI cursor sequences or application sequences.\n//\n// See: https://vt100.net/docs/vt510-rm/DECCKM.html\nconst (\n\tEnableCursorKeys  = \"\\x1b[?1h\"\n\tDisableCursorKeys = \"\\x1b[?1l\"\n\tRequestCursorKeys = \"\\x1b[?1$p\"\n)\n\n// Text Cursor Enable Mode (DECTCEM) is a mode that shows/hides the cursor.\n//\n// See: https://vt100.net/docs/vt510-rm/DECTCEM.html\nconst (\n\tShowCursor              = \"\\x1b[?25h\"\n\tHideCursor              = \"\\x1b[?25l\"\n\tRequestCursorVisibility = \"\\x1b[?25$p\"\n)\n\n// VT Mouse Tracking is a mode that determines whether the mouse reports on\n// button press and release.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking\nconst (\n\tEnableMouse  = \"\\x1b[?1000h\"\n\tDisableMouse = \"\\x1b[?1000l\"\n\tRequestMouse = \"\\x1b[?1000$p\"\n)\n\n// VT Hilite Mouse Tracking is a mode that determines whether the mouse reports on\n// button presses, releases, and highlighted cells.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking\nconst (\n\tEnableMouseHilite  = \"\\x1b[?1001h\"\n\tDisableMouseHilite = \"\\x1b[?1001l\"\n\tRequestMouseHilite = \"\\x1b[?1001$p\"\n)\n\n// Cell Motion Mouse Tracking is a mode that determines whether the mouse\n// reports on button press, release, and motion events.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking\nconst (\n\tEnableMouseCellMotion  = \"\\x1b[?1002h\"\n\tDisableMouseCellMotion = \"\\x1b[?1002l\"\n\tRequestMouseCellMotion = \"\\x1b[?1002$p\"\n)\n\n// All Mouse Tracking is a mode that determines whether the mouse reports on\n// button press, release, motion, and highlight events.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking\nconst (\n\tEnableMouseAllMotion  = \"\\x1b[?1003h\"\n\tDisableMouseAllMotion = \"\\x1b[?1003l\"\n\tRequestMouseAllMotion = \"\\x1b[?1003$p\"\n)\n\n// Report Focus is a mode that makes the terminal report focus-in and focus-out events.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut\nconst (\n\tEnableReportFocus  = \"\\x1b[?1004h\"\n\tDisableReportFocus = \"\\x1b[?1004l\"\n\tRequestReportFocus = \"\\x1b[?1004$p\"\n)\n\n// SGR Mouse Extension is a mode that determines whether the mouse reports events\n// formatted with SGR parameters.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking\nconst (\n\tEnableMouseSgrExt  = \"\\x1b[?1006h\"\n\tDisableMouseSgrExt = \"\\x1b[?1006l\"\n\tRequestMouseSgrExt = \"\\x1b[?1006$p\"\n)\n\n// Alternate Screen Buffer is a mode that determines whether the alternate screen\n// buffer is active.\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer\nconst (\n\tEnableAltScreenBuffer  = \"\\x1b[?1049h\"\n\tDisableAltScreenBuffer = \"\\x1b[?1049l\"\n\tRequestAltScreenBuffer = \"\\x1b[?1049$p\"\n)\n\n// Bracketed Paste Mode is a mode that determines whether pasted text is\n// bracketed with escape sequences.\n//\n// See: https://cirw.in/blog/bracketed-paste\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode\nconst (\n\tEnableBracketedPaste  = \"\\x1b[?2004h\"\n\tDisableBracketedPaste = \"\\x1b[?2004l\"\n\tRequestBracketedPaste = \"\\x1b[?2004$p\"\n)\n\n// Synchronized Output Mode is a mode that determines whether output is\n// synchronized with the terminal.\n//\n// See: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036\nconst (\n\tEnableSyncdOutput  = \"\\x1b[?2026h\"\n\tDisableSyncdOutput = \"\\x1b[?2026l\"\n\tRequestSyncdOutput = \"\\x1b[?2026$p\"\n)\n\n// Grapheme Clustering Mode is a mode that determines whether the terminal\n// should look for grapheme clusters instead of single runes in the rendered\n// text. This makes the terminal properly render combining characters such as\n// emojis.\n//\n// See: https://github.com/contour-terminal/terminal-unicode-core\nconst (\n\tEnableGraphemeClustering  = \"\\x1b[?2027h\"\n\tDisableGraphemeClustering = \"\\x1b[?2027l\"\n\tRequestGraphemeClustering = \"\\x1b[?2027$p\"\n)\n\n// Win32Input is a mode that determines whether input is processed by the\n// Win32 console and Conpty.\n//\n// See: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md\nconst (\n\tEnableWin32Input  = \"\\x1b[?9001h\"\n\tDisableWin32Input = \"\\x1b[?9001l\"\n\tRequestWin32Input = \"\\x1b[?9001$p\"\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/osc.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n)\n\n// OscSequence represents an OSC sequence.\n//\n// The sequence starts with a OSC sequence, OSC (0x9D) in a 8-bit environment\n// or ESC ] (0x1B 0x5D) in a 7-bit environment, followed by positive integer identifier,\n// then by arbitrary data terminated by a ST (0x9C) in a 8-bit environment,\n// ESC \\ (0x1B 0x5C) in a 7-bit environment, or BEL (0x07) for backwards compatibility.\n//\n//\tOSC Ps ; Pt ST\n//\tOSC Ps ; Pt BEL\n//\n// See ECMA-48 § 5.7.\ntype OscSequence struct {\n\t// Data contains the raw data of the sequence including the identifier\n\t// command.\n\tData []byte\n\n\t// Cmd contains the raw command of the sequence.\n\tCmd int\n}\n\nvar _ Sequence = OscSequence{}\n\n// Command returns the command of the OSC sequence.\nfunc (s OscSequence) Command() int {\n\treturn s.Cmd\n}\n\n// Params returns the parameters of the OSC sequence split by ';'.\n// The first element is the identifier command.\nfunc (s OscSequence) Params() []string {\n\treturn strings.Split(string(s.Data), \";\")\n}\n\n// Clone returns a copy of the OSC sequence.\nfunc (s OscSequence) Clone() Sequence {\n\treturn OscSequence{\n\t\tData: append([]byte(nil), s.Data...),\n\t\tCmd:  s.Cmd,\n\t}\n}\n\n// String returns the string representation of the OSC sequence.\n// To be more compatible with different terminal, this will always return a\n// 7-bit formatted sequence, terminated by BEL.\nfunc (s OscSequence) String() string {\n\treturn s.buffer().String()\n}\n\n// Bytes returns the byte representation of the OSC sequence.\n// To be more compatible with different terminal, this will always return a\n// 7-bit formatted sequence, terminated by BEL.\nfunc (s OscSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n\nfunc (s OscSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteString(\"\\x1b]\")\n\tb.Write(s.Data)\n\tb.WriteByte(BEL)\n\treturn &b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/params.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n)\n\n// Params parses and returns a list of control sequence parameters.\n//\n// Parameters are positive integers separated by semicolons. Empty parameters\n// default to zero. Parameters can have sub-parameters separated by colons.\n//\n// Any non-parameter bytes are ignored. This includes bytes that are not in the\n// range of 0x30-0x3B.\n//\n// See ECMA-48 § 5.4.1.\nfunc Params(p []byte) [][]uint {\n\tif len(p) == 0 {\n\t\treturn [][]uint{}\n\t}\n\n\t// Filter out non-parameter bytes i.e. non 0x30-0x3B.\n\tp = bytes.TrimFunc(p, func(r rune) bool {\n\t\treturn r < 0x30 || r > 0x3B\n\t})\n\n\tparts := bytes.Split(p, []byte{';'})\n\tparams := make([][]uint, len(parts))\n\tfor i, part := range parts {\n\t\tsparts := bytes.Split(part, []byte{':'})\n\t\tparams[i] = make([]uint, len(sparts))\n\t\tfor j, spart := range sparts {\n\t\t\tparams[i][j] = bytesToUint16(spart)\n\t\t}\n\t}\n\n\treturn params\n}\n\nfunc bytesToUint16(b []byte) uint {\n\tvar n uint\n\tfor _, c := range b {\n\t\tn = n*10 + uint(c-'0')\n\t}\n\treturn n\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/parser/const.go",
    "content": "package parser\n\n// Action is a DEC ANSI parser action.\ntype Action = byte\n\n// These are the actions that the parser can take.\nconst (\n\tNoneAction Action = iota\n\tClearAction\n\tCollectAction\n\tMarkerAction\n\tDispatchAction\n\tExecuteAction\n\tStartAction // Start of a data string\n\tPutAction   // Put into the data string\n\tParamAction\n\tPrintAction\n\n\tIgnoreAction = NoneAction\n)\n\n// nolint: unused\nvar ActionNames = []string{\n\t\"NoneAction\",\n\t\"ClearAction\",\n\t\"CollectAction\",\n\t\"MarkerAction\",\n\t\"DispatchAction\",\n\t\"ExecuteAction\",\n\t\"StartAction\",\n\t\"PutAction\",\n\t\"ParamAction\",\n\t\"PrintAction\",\n}\n\n// State is a DEC ANSI parser state.\ntype State = byte\n\n// These are the states that the parser can be in.\nconst (\n\tGroundState State = iota\n\tCsiEntryState\n\tCsiIntermediateState\n\tCsiParamState\n\tDcsEntryState\n\tDcsIntermediateState\n\tDcsParamState\n\tDcsStringState\n\tEscapeState\n\tEscapeIntermediateState\n\tOscStringState\n\tSosStringState\n\tPmStringState\n\tApcStringState\n\n\t// Utf8State is not part of the DEC ANSI standard. It is used to handle\n\t// UTF-8 sequences.\n\tUtf8State\n)\n\n// nolint: unused\nvar StateNames = []string{\n\t\"GroundState\",\n\t\"CsiEntryState\",\n\t\"CsiIntermediateState\",\n\t\"CsiParamState\",\n\t\"DcsEntryState\",\n\t\"DcsIntermediateState\",\n\t\"DcsParamState\",\n\t\"DcsStringState\",\n\t\"EscapeState\",\n\t\"EscapeIntermediateState\",\n\t\"OscStringState\",\n\t\"SosStringState\",\n\t\"PmStringState\",\n\t\"ApcStringState\",\n\t\"Utf8State\",\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/parser/seq.go",
    "content": "package parser\n\nimport \"math\"\n\n// Shift and masks for sequence parameters and intermediates.\nconst (\n\tMarkerShift    = 8\n\tIntermedShift  = 16\n\tCommandMask    = 0xff\n\tHasMoreFlag    = math.MinInt32\n\tParamMask      = ^HasMoreFlag\n\tMissingParam   = ParamMask\n\tMissingCommand = MissingParam\n\tMaxParam       = math.MaxUint16 // the maximum value a parameter can have\n)\n\nconst (\n\t// MaxParamsSize is the maximum number of parameters a sequence can have.\n\tMaxParamsSize = 32\n\n\t// DefaultParamValue is the default value used for missing parameters.\n\tDefaultParamValue = 0\n)\n\n// Marker returns the marker byte of the sequence.\n// This is always gonna be one of the following '<' '=' '>' '?' and in the\n// range of 0x3C-0x3F.\n// Zero is returned if the sequence does not have a marker.\nfunc Marker(cmd int) int {\n\treturn (cmd >> MarkerShift) & CommandMask\n}\n\n// Intermediate returns the intermediate byte of the sequence.\n// An intermediate byte is in the range of 0x20-0x2F. This includes these\n// characters from ' ', '!', '\"', '#', '$', '%', '&', ”', '(', ')', '*', '+',\n// ',', '-', '.', '/'.\n// Zero is returned if the sequence does not have an intermediate byte.\nfunc Intermediate(cmd int) int {\n\treturn (cmd >> IntermedShift) & CommandMask\n}\n\n// Command returns the command byte of the CSI sequence.\nfunc Command(cmd int) int {\n\treturn cmd & CommandMask\n}\n\n// Param returns the parameter at the given index.\n// It returns -1 if the parameter does not exist.\nfunc Param(params []int, i int) int {\n\tif len(params) == 0 || i < 0 || i >= len(params) {\n\t\treturn -1\n\t}\n\n\tp := params[i] & ParamMask\n\tif p == MissingParam {\n\t\treturn -1\n\t}\n\n\treturn p\n}\n\n// HasMore returns true if the parameter has more sub-parameters.\nfunc HasMore(params []int, i int) bool {\n\tif len(params) == 0 || i >= len(params) {\n\t\treturn false\n\t}\n\n\treturn params[i]&HasMoreFlag != 0\n}\n\n// Subparams returns the sub-parameters of the given parameter.\n// It returns nil if the parameter does not exist.\nfunc Subparams(params []int, i int) []int {\n\tif len(params) == 0 || i < 0 || i >= len(params) {\n\t\treturn nil\n\t}\n\n\t// Count the number of parameters before the given parameter index.\n\tvar count int\n\tvar j int\n\tfor j = 0; j < len(params); j++ {\n\t\tif count == i {\n\t\t\tbreak\n\t\t}\n\t\tif !HasMore(params, j) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count > i || j >= len(params) {\n\t\treturn nil\n\t}\n\n\tvar subs []int\n\tfor ; j < len(params); j++ {\n\t\tif !HasMore(params, j) {\n\t\t\tbreak\n\t\t}\n\t\tp := Param(params, j)\n\t\tif p == -1 {\n\t\t\tp = DefaultParamValue\n\t\t}\n\t\tsubs = append(subs, p)\n\t}\n\n\tp := Param(params, j)\n\tif p == -1 {\n\t\tp = DefaultParamValue\n\t}\n\n\treturn append(subs, p)\n}\n\n// Len returns the number of parameters in the sequence.\n// This will return the number of parameters in the sequence, excluding any\n// sub-parameters.\nfunc Len(params []int) int {\n\tvar n int\n\tfor i := 0; i < len(params); i++ {\n\t\tif !HasMore(params, i) {\n\t\t\tn++\n\t\t}\n\t}\n\treturn n\n}\n\n// Range iterates over the parameters of the sequence and calls the given\n// function for each parameter.\n// The function should return false to stop the iteration.\nfunc Range(params []int, fn func(i int, param int, hasMore bool) bool) {\n\tfor i := 0; i < len(params); i++ {\n\t\tif !fn(i, Param(params, i), HasMore(params, i)) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go",
    "content": "package parser\n\n// Table values are generated like this:\n//\n//\tindex:  currentState << IndexStateShift | charCode\n//\tvalue:  action << TransitionActionShift | nextState\nconst (\n\tTransitionActionShift = 4\n\tTransitionStateMask   = 15\n\tIndexStateShift       = 8\n\n\t// DefaultTableSize is the default size of the transition table.\n\tDefaultTableSize = 4096\n)\n\n// Table is a DEC ANSI transition table.\nvar Table = GenerateTransitionTable()\n\n// TransitionTable is a DEC ANSI transition table.\n// https://vt100.net/emu/dec_ansi_parser\ntype TransitionTable []byte\n\n// NewTransitionTable returns a new DEC ANSI transition table.\nfunc NewTransitionTable(size int) TransitionTable {\n\tif size <= 0 {\n\t\tsize = DefaultTableSize\n\t}\n\treturn TransitionTable(make([]byte, size))\n}\n\n// SetDefault sets default transition.\nfunc (t TransitionTable) SetDefault(action Action, state State) {\n\tfor i := 0; i < len(t); i++ {\n\t\tt[i] = action<<TransitionActionShift | state\n\t}\n}\n\n// AddOne adds a transition.\nfunc (t TransitionTable) AddOne(code byte, state State, action Action, next State) {\n\tidx := int(state)<<IndexStateShift | int(code)\n\tvalue := action<<TransitionActionShift | next\n\tt[idx] = value\n}\n\n// AddMany adds many transitions.\nfunc (t TransitionTable) AddMany(codes []byte, state State, action Action, next State) {\n\tfor _, code := range codes {\n\t\tt.AddOne(code, state, action, next)\n\t}\n}\n\n// AddRange adds a range of transitions.\nfunc (t TransitionTable) AddRange(start, end byte, state State, action Action, next State) {\n\tfor i := int(start); i <= int(end); i++ {\n\t\tt.AddOne(byte(i), state, action, next)\n\t}\n}\n\n// Transition returns the next state and action for the given state and byte.\nfunc (t TransitionTable) Transition(state State, code byte) (State, Action) {\n\tindex := int(state)<<IndexStateShift | int(code)\n\tvalue := t[index]\n\treturn value & TransitionStateMask, value >> TransitionActionShift\n}\n\n// byte range macro\nfunc r(start, end byte) []byte {\n\tvar a []byte\n\tfor i := int(start); i <= int(end); i++ {\n\t\ta = append(a, byte(i))\n\t}\n\treturn a\n}\n\n// GenerateTransitionTable generates a DEC ANSI transition table compatible\n// with the VT500-series of terminals. This implementation includes a few\n// modifications that include:\n//   - A new Utf8State is introduced to handle UTF8 sequences.\n//   - Osc and Dcs data accept UTF8 sequences by extending the printable range\n//     to 0xFF and 0xFE respectively.\n//   - We don't ignore 0x3A (':') when building Csi and Dcs parameters and\n//     instead use it to denote sub-parameters.\n//   - Support dispatching SosPmApc sequences.\n//   - The DEL (0x7F) character is executed in the Ground state.\n//   - The DEL (0x7F) character is collected in the DcsPassthrough string state.\n//   - The ST C1 control character (0x9C) is executed and not ignored.\nfunc GenerateTransitionTable() TransitionTable {\n\ttable := NewTransitionTable(DefaultTableSize)\n\ttable.SetDefault(NoneAction, GroundState)\n\n\t// Anywhere\n\tfor _, state := range r(GroundState, Utf8State) {\n\t\t// Anywhere -> Ground\n\t\ttable.AddMany([]byte{0x18, 0x1a, 0x99, 0x9a}, state, ExecuteAction, GroundState)\n\t\ttable.AddRange(0x80, 0x8F, state, ExecuteAction, GroundState)\n\t\ttable.AddRange(0x90, 0x97, state, ExecuteAction, GroundState)\n\t\ttable.AddOne(0x9C, state, ExecuteAction, GroundState)\n\t\t// Anywhere -> Escape\n\t\ttable.AddOne(0x1B, state, ClearAction, EscapeState)\n\t\t// Anywhere -> SosStringState\n\t\ttable.AddOne(0x98, state, StartAction, SosStringState)\n\t\t// Anywhere -> PmStringState\n\t\ttable.AddOne(0x9E, state, StartAction, PmStringState)\n\t\t// Anywhere -> ApcStringState\n\t\ttable.AddOne(0x9F, state, StartAction, ApcStringState)\n\t\t// Anywhere -> CsiEntry\n\t\ttable.AddOne(0x9B, state, ClearAction, CsiEntryState)\n\t\t// Anywhere -> DcsEntry\n\t\ttable.AddOne(0x90, state, ClearAction, DcsEntryState)\n\t\t// Anywhere -> OscString\n\t\ttable.AddOne(0x9D, state, StartAction, OscStringState)\n\t\t// Anywhere -> Utf8\n\t\ttable.AddRange(0xC2, 0xDF, state, CollectAction, Utf8State) // UTF8 2 byte sequence\n\t\ttable.AddRange(0xE0, 0xEF, state, CollectAction, Utf8State) // UTF8 3 byte sequence\n\t\ttable.AddRange(0xF0, 0xF4, state, CollectAction, Utf8State) // UTF8 4 byte sequence\n\t}\n\n\t// Ground\n\ttable.AddRange(0x00, 0x17, GroundState, ExecuteAction, GroundState)\n\ttable.AddOne(0x19, GroundState, ExecuteAction, GroundState)\n\ttable.AddRange(0x1C, 0x1F, GroundState, ExecuteAction, GroundState)\n\ttable.AddRange(0x20, 0x7E, GroundState, PrintAction, GroundState)\n\ttable.AddOne(0x7F, GroundState, ExecuteAction, GroundState)\n\n\t// EscapeIntermediate\n\ttable.AddRange(0x00, 0x17, EscapeIntermediateState, ExecuteAction, EscapeIntermediateState)\n\ttable.AddOne(0x19, EscapeIntermediateState, ExecuteAction, EscapeIntermediateState)\n\ttable.AddRange(0x1C, 0x1F, EscapeIntermediateState, ExecuteAction, EscapeIntermediateState)\n\ttable.AddRange(0x20, 0x2F, EscapeIntermediateState, CollectAction, EscapeIntermediateState)\n\ttable.AddOne(0x7F, EscapeIntermediateState, IgnoreAction, EscapeIntermediateState)\n\t// EscapeIntermediate -> Ground\n\ttable.AddRange(0x30, 0x7E, EscapeIntermediateState, DispatchAction, GroundState)\n\n\t// Escape\n\ttable.AddRange(0x00, 0x17, EscapeState, ExecuteAction, EscapeState)\n\ttable.AddOne(0x19, EscapeState, ExecuteAction, EscapeState)\n\ttable.AddRange(0x1C, 0x1F, EscapeState, ExecuteAction, EscapeState)\n\ttable.AddOne(0x7F, EscapeState, IgnoreAction, EscapeState)\n\t// Escape -> Ground\n\ttable.AddRange(0x30, 0x4F, EscapeState, DispatchAction, GroundState)\n\ttable.AddRange(0x51, 0x57, EscapeState, DispatchAction, GroundState)\n\ttable.AddOne(0x59, EscapeState, DispatchAction, GroundState)\n\ttable.AddOne(0x5A, EscapeState, DispatchAction, GroundState)\n\ttable.AddOne(0x5C, EscapeState, DispatchAction, GroundState)\n\ttable.AddRange(0x60, 0x7E, EscapeState, DispatchAction, GroundState)\n\t// Escape -> Escape_intermediate\n\ttable.AddRange(0x20, 0x2F, EscapeState, CollectAction, EscapeIntermediateState)\n\t// Escape -> Sos_pm_apc_string\n\ttable.AddOne('X', EscapeState, StartAction, SosStringState) // SOS\n\ttable.AddOne('^', EscapeState, StartAction, PmStringState)  // PM\n\ttable.AddOne('_', EscapeState, StartAction, ApcStringState) // APC\n\t// Escape -> Dcs_entry\n\ttable.AddOne('P', EscapeState, ClearAction, DcsEntryState)\n\t// Escape -> Csi_entry\n\ttable.AddOne('[', EscapeState, ClearAction, CsiEntryState)\n\t// Escape -> Osc_string\n\ttable.AddOne(']', EscapeState, StartAction, OscStringState)\n\n\t// Sos_pm_apc_string\n\tfor _, state := range r(SosStringState, ApcStringState) {\n\t\ttable.AddRange(0x00, 0x17, state, PutAction, state)\n\t\ttable.AddOne(0x19, state, PutAction, state)\n\t\ttable.AddRange(0x1C, 0x1F, state, PutAction, state)\n\t\ttable.AddRange(0x20, 0x7F, state, PutAction, state)\n\t\t// ESC, ST, CAN, and SUB terminate the sequence\n\t\ttable.AddOne(0x1B, state, DispatchAction, EscapeState)\n\t\ttable.AddOne(0x9C, state, DispatchAction, GroundState)\n\t\ttable.AddMany([]byte{0x18, 0x1A}, state, IgnoreAction, GroundState)\n\t}\n\n\t// Dcs_entry\n\ttable.AddRange(0x00, 0x07, DcsEntryState, IgnoreAction, DcsEntryState)\n\ttable.AddRange(0x0E, 0x17, DcsEntryState, IgnoreAction, DcsEntryState)\n\ttable.AddOne(0x19, DcsEntryState, IgnoreAction, DcsEntryState)\n\ttable.AddRange(0x1C, 0x1F, DcsEntryState, IgnoreAction, DcsEntryState)\n\ttable.AddOne(0x7F, DcsEntryState, IgnoreAction, DcsEntryState)\n\t// Dcs_entry -> Dcs_intermediate\n\ttable.AddRange(0x20, 0x2F, DcsEntryState, CollectAction, DcsIntermediateState)\n\t// Dcs_entry -> Dcs_param\n\ttable.AddRange(0x30, 0x3B, DcsEntryState, ParamAction, DcsParamState)\n\ttable.AddRange(0x3C, 0x3F, DcsEntryState, MarkerAction, DcsParamState)\n\t// Dcs_entry -> Dcs_passthrough\n\ttable.AddRange(0x08, 0x0D, DcsEntryState, PutAction, DcsStringState) // Follows ECMA-48 § 8.3.27\n\t// XXX: allows passing ESC (not a ECMA-48 standard) this to allow for\n\t// passthrough of ANSI sequences like in Screen or Tmux passthrough mode.\n\ttable.AddOne(0x1B, DcsEntryState, PutAction, DcsStringState)\n\ttable.AddRange(0x40, 0x7E, DcsEntryState, StartAction, DcsStringState)\n\n\t// Dcs_intermediate\n\ttable.AddRange(0x00, 0x17, DcsIntermediateState, IgnoreAction, DcsIntermediateState)\n\ttable.AddOne(0x19, DcsIntermediateState, IgnoreAction, DcsIntermediateState)\n\ttable.AddRange(0x1C, 0x1F, DcsIntermediateState, IgnoreAction, DcsIntermediateState)\n\ttable.AddRange(0x20, 0x2F, DcsIntermediateState, CollectAction, DcsIntermediateState)\n\ttable.AddOne(0x7F, DcsIntermediateState, IgnoreAction, DcsIntermediateState)\n\t// Dcs_intermediate -> Dcs_passthrough\n\ttable.AddRange(0x30, 0x3F, DcsIntermediateState, StartAction, DcsStringState)\n\ttable.AddRange(0x40, 0x7E, DcsIntermediateState, StartAction, DcsStringState)\n\n\t// Dcs_param\n\ttable.AddRange(0x00, 0x17, DcsParamState, IgnoreAction, DcsParamState)\n\ttable.AddOne(0x19, DcsParamState, IgnoreAction, DcsParamState)\n\ttable.AddRange(0x1C, 0x1F, DcsParamState, IgnoreAction, DcsParamState)\n\ttable.AddRange(0x30, 0x3B, DcsParamState, ParamAction, DcsParamState)\n\ttable.AddOne(0x7F, DcsParamState, IgnoreAction, DcsParamState)\n\ttable.AddRange(0x3C, 0x3F, DcsParamState, IgnoreAction, DcsParamState)\n\t// Dcs_param -> Dcs_intermediate\n\ttable.AddRange(0x20, 0x2F, DcsParamState, CollectAction, DcsIntermediateState)\n\t// Dcs_param -> Dcs_passthrough\n\ttable.AddRange(0x40, 0x7E, DcsParamState, StartAction, DcsStringState)\n\n\t// Dcs_passthrough\n\ttable.AddRange(0x00, 0x17, DcsStringState, PutAction, DcsStringState)\n\ttable.AddOne(0x19, DcsStringState, PutAction, DcsStringState)\n\ttable.AddRange(0x1C, 0x1F, DcsStringState, PutAction, DcsStringState)\n\ttable.AddRange(0x20, 0x7E, DcsStringState, PutAction, DcsStringState)\n\ttable.AddOne(0x7F, DcsStringState, PutAction, DcsStringState)\n\ttable.AddRange(0x80, 0xFF, DcsStringState, PutAction, DcsStringState) // Allow Utf8 characters by extending the printable range from 0x7F to 0xFF\n\t// ST, CAN, SUB, and ESC terminate the sequence\n\ttable.AddOne(0x1B, DcsStringState, DispatchAction, EscapeState)\n\ttable.AddOne(0x9C, DcsStringState, DispatchAction, GroundState)\n\ttable.AddMany([]byte{0x18, 0x1A}, DcsStringState, IgnoreAction, GroundState)\n\n\t// Csi_param\n\ttable.AddRange(0x00, 0x17, CsiParamState, ExecuteAction, CsiParamState)\n\ttable.AddOne(0x19, CsiParamState, ExecuteAction, CsiParamState)\n\ttable.AddRange(0x1C, 0x1F, CsiParamState, ExecuteAction, CsiParamState)\n\ttable.AddRange(0x30, 0x3B, CsiParamState, ParamAction, CsiParamState)\n\ttable.AddOne(0x7F, CsiParamState, IgnoreAction, CsiParamState)\n\ttable.AddRange(0x3C, 0x3F, CsiParamState, IgnoreAction, CsiParamState)\n\t// Csi_param -> Ground\n\ttable.AddRange(0x40, 0x7E, CsiParamState, DispatchAction, GroundState)\n\t// Csi_param -> Csi_intermediate\n\ttable.AddRange(0x20, 0x2F, CsiParamState, CollectAction, CsiIntermediateState)\n\n\t// Csi_intermediate\n\ttable.AddRange(0x00, 0x17, CsiIntermediateState, ExecuteAction, CsiIntermediateState)\n\ttable.AddOne(0x19, CsiIntermediateState, ExecuteAction, CsiIntermediateState)\n\ttable.AddRange(0x1C, 0x1F, CsiIntermediateState, ExecuteAction, CsiIntermediateState)\n\ttable.AddRange(0x20, 0x2F, CsiIntermediateState, CollectAction, CsiIntermediateState)\n\ttable.AddOne(0x7F, CsiIntermediateState, IgnoreAction, CsiIntermediateState)\n\t// Csi_intermediate -> Ground\n\ttable.AddRange(0x40, 0x7E, CsiIntermediateState, DispatchAction, GroundState)\n\t// Csi_intermediate -> Csi_ignore\n\ttable.AddRange(0x30, 0x3F, CsiIntermediateState, IgnoreAction, GroundState)\n\n\t// Csi_entry\n\ttable.AddRange(0x00, 0x17, CsiEntryState, ExecuteAction, CsiEntryState)\n\ttable.AddOne(0x19, CsiEntryState, ExecuteAction, CsiEntryState)\n\ttable.AddRange(0x1C, 0x1F, CsiEntryState, ExecuteAction, CsiEntryState)\n\ttable.AddOne(0x7F, CsiEntryState, IgnoreAction, CsiEntryState)\n\t// Csi_entry -> Ground\n\ttable.AddRange(0x40, 0x7E, CsiEntryState, DispatchAction, GroundState)\n\t// Csi_entry -> Csi_intermediate\n\ttable.AddRange(0x20, 0x2F, CsiEntryState, CollectAction, CsiIntermediateState)\n\t// Csi_entry -> Csi_param\n\ttable.AddRange(0x30, 0x3B, CsiEntryState, ParamAction, CsiParamState)\n\ttable.AddRange(0x3C, 0x3F, CsiEntryState, MarkerAction, CsiParamState)\n\n\t// Osc_string\n\ttable.AddRange(0x00, 0x06, OscStringState, IgnoreAction, OscStringState)\n\ttable.AddRange(0x08, 0x17, OscStringState, IgnoreAction, OscStringState)\n\ttable.AddOne(0x19, OscStringState, IgnoreAction, OscStringState)\n\ttable.AddRange(0x1C, 0x1F, OscStringState, IgnoreAction, OscStringState)\n\ttable.AddRange(0x20, 0xFF, OscStringState, PutAction, OscStringState) // Allow Utf8 characters by extending the printable range from 0x7F to 0xFF\n\n\t// ST, CAN, SUB, ESC, and BEL terminate the sequence\n\ttable.AddOne(0x1B, OscStringState, DispatchAction, EscapeState)\n\ttable.AddOne(0x07, OscStringState, DispatchAction, GroundState)\n\ttable.AddOne(0x9C, OscStringState, DispatchAction, GroundState)\n\ttable.AddMany([]byte{0x18, 0x1A}, OscStringState, IgnoreAction, GroundState)\n\n\treturn table\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/parser.go",
    "content": "package ansi\n\nimport (\n\t\"unicode/utf8\"\n\t\"unsafe\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n)\n\n// ParserDispatcher is a function that dispatches a sequence.\ntype ParserDispatcher func(Sequence)\n\n// Parser represents a DEC ANSI compatible sequence parser.\n//\n// It uses a state machine to parse ANSI escape sequences and control\n// characters. The parser is designed to be used with a terminal emulator or\n// similar application that needs to parse ANSI escape sequences and control\n// characters.\n// See package [parser] for more information.\n//\n//go:generate go run ./gen.go\ntype Parser struct {\n\t// Params contains the raw parameters of the sequence.\n\t// These parameters used when constructing CSI and DCS sequences.\n\tParams []int\n\n\t// Data contains the raw data of the sequence.\n\t// These data used when constructing OSC, DCS, SOS, PM, and APC sequences.\n\tData []byte\n\n\t// DataLen keeps track of the length of the data buffer.\n\t// If DataLen is -1, the data buffer is unlimited and will grow as needed.\n\t// Otherwise, DataLen is limited by the size of the Data buffer.\n\tDataLen int\n\n\t// ParamsLen keeps track of the number of parameters.\n\t// This is limited by the size of the Params buffer.\n\t//\n\t// This is also used when collecting UTF-8 runes to keep track of the\n\t// number of rune bytes collected.\n\tParamsLen int\n\n\t// Cmd contains the raw command along with the private marker and\n\t// intermediate bytes of the sequence.\n\t// The first lower byte contains the command byte, the next byte contains\n\t// the private marker, and the next byte contains the intermediate byte.\n\t//\n\t// This is also used when collecting UTF-8 runes treating it as a slice of\n\t// 4 bytes.\n\tCmd int\n\n\t// State is the current state of the parser.\n\tState byte\n}\n\n// NewParser returns a new parser with the given sizes allocated.\n// If dataSize is zero, the underlying data buffer will be unlimited and will\n// grow as needed.\nfunc NewParser(paramsSize, dataSize int) *Parser {\n\ts := new(Parser)\n\tif dataSize <= 0 {\n\t\tdataSize = 0\n\t\ts.DataLen = -1\n\t}\n\ts.Params = make([]int, paramsSize)\n\ts.Data = make([]byte, dataSize)\n\treturn s\n}\n\n// Reset resets the parser to its initial state.\nfunc (p *Parser) Reset() {\n\tp.clear()\n\tp.State = parser.GroundState\n}\n\n// clear clears the parser parameters and command.\nfunc (p *Parser) clear() {\n\tif len(p.Params) > 0 {\n\t\tp.Params[0] = parser.MissingParam\n\t}\n\tp.ParamsLen = 0\n\tp.Cmd = 0\n}\n\n// clearCmd clears the parser command, params len and data len.\nfunc (p *Parser) clearCmd() {\n\tp.Cmd = 0\n\tp.ParamsLen = 0\n\tp.DataLen = 0\n}\n\n// StateName returns the name of the current state.\nfunc (p *Parser) StateName() string {\n\treturn parser.StateNames[p.State]\n}\n\n// Parse parses the given dispatcher and byte buffer.\nfunc (p *Parser) Parse(dispatcher ParserDispatcher, b []byte) {\n\tfor i := 0; i < len(b); i++ {\n\t\tp.Advance(dispatcher, b[i], i < len(b)-1)\n\t}\n}\n\n// Advance advances the parser with the given dispatcher and byte.\nfunc (p *Parser) Advance(dispatcher ParserDispatcher, b byte, more bool) parser.Action {\n\tswitch p.State {\n\tcase parser.Utf8State:\n\t\t// We handle UTF-8 here.\n\t\treturn p.advanceUtf8(dispatcher, b)\n\tdefault:\n\t\treturn p.advance(dispatcher, b, more)\n\t}\n}\n\nfunc (p *Parser) collectRune(b byte) {\n\tif p.ParamsLen >= utf8.UTFMax {\n\t\treturn\n\t}\n\n\tshift := p.ParamsLen * 8\n\tp.Cmd &^= 0xff << shift\n\tp.Cmd |= int(b) << shift\n\tp.ParamsLen++\n}\n\nfunc (p *Parser) advanceUtf8(dispatcher ParserDispatcher, b byte) parser.Action {\n\t// Collect UTF-8 rune bytes.\n\tp.collectRune(b)\n\trw := utf8ByteLen(byte(p.Cmd & 0xff))\n\tif rw == -1 {\n\t\t// We panic here because the first byte comes from the state machine,\n\t\t// if this panics, it means there is a bug in the state machine!\n\t\tpanic(\"invalid rune\") // unreachable\n\t}\n\n\tif p.ParamsLen < rw {\n\t\treturn parser.CollectAction\n\t}\n\n\t// We have enough bytes to decode the rune using unsafe\n\tr, _ := utf8.DecodeRune((*[utf8.UTFMax]byte)(unsafe.Pointer(&p.Cmd))[:rw])\n\tif dispatcher != nil {\n\t\tdispatcher(Rune(r))\n\t}\n\n\tp.State = parser.GroundState\n\tp.ParamsLen = 0\n\n\treturn parser.PrintAction\n}\n\nfunc (p *Parser) advance(d ParserDispatcher, b byte, more bool) parser.Action {\n\tstate, action := parser.Table.Transition(p.State, b)\n\n\t// We need to clear the parser state if the state changes from EscapeState.\n\t// This is because when we enter the EscapeState, we don't get a chance to\n\t// clear the parser state. For example, when a sequence terminates with a\n\t// ST (\\x1b\\\\ or \\x9c), we dispatch the current sequence and transition to\n\t// EscapeState. However, the parser state is not cleared in this case and\n\t// we need to clear it here before dispatching the esc sequence.\n\tif p.State != state {\n\t\tif p.State == parser.EscapeState {\n\t\t\tp.performAction(d, parser.ClearAction, state, b)\n\t\t}\n\t\tif action == parser.PutAction &&\n\t\t\tp.State == parser.DcsEntryState && state == parser.DcsStringState {\n\t\t\t// XXX: This is a special case where we need to start collecting\n\t\t\t// non-string parameterized data i.e. doesn't follow the ECMA-48 §\n\t\t\t// 5.4.1 string parameters format.\n\t\t\tp.performAction(d, parser.StartAction, state, 0)\n\t\t}\n\t}\n\n\t// Handle special cases\n\tswitch {\n\tcase b == ESC && p.State == parser.EscapeState:\n\t\t// Two ESCs in a row\n\t\tp.performAction(d, parser.ExecuteAction, state, b)\n\t\tif !more {\n\t\t\t// Two ESCs at the end of the buffer\n\t\t\tp.performAction(d, parser.ExecuteAction, state, b)\n\t\t}\n\tcase b == ESC && !more:\n\t\t// Last byte is an ESC\n\t\tp.performAction(d, parser.ExecuteAction, state, b)\n\tcase p.State == parser.EscapeState && b == 'P' && !more:\n\t\t// ESC P (DCS) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tcase p.State == parser.EscapeState && b == 'X' && !more:\n\t\t// ESC X (SOS) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tcase p.State == parser.EscapeState && b == '[' && !more:\n\t\t// ESC [ (CSI) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tcase p.State == parser.EscapeState && b == ']' && !more:\n\t\t// ESC ] (OSC) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tcase p.State == parser.EscapeState && b == '^' && !more:\n\t\t// ESC ^ (PM) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tcase p.State == parser.EscapeState && b == '_' && !more:\n\t\t// ESC _ (APC) at the end of the buffer\n\t\tp.performAction(d, parser.DispatchAction, state, b)\n\tdefault:\n\t\tp.performAction(d, action, state, b)\n\t}\n\n\tp.State = state\n\n\treturn action\n}\n\nfunc (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action, state parser.State, b byte) {\n\tswitch action {\n\tcase parser.IgnoreAction:\n\t\tbreak\n\n\tcase parser.ClearAction:\n\t\tp.clear()\n\n\tcase parser.PrintAction:\n\t\tif dispatcher != nil {\n\t\t\tdispatcher(Rune(b))\n\t\t}\n\n\tcase parser.ExecuteAction:\n\t\tif dispatcher != nil {\n\t\t\tdispatcher(ControlCode(b))\n\t\t}\n\n\tcase parser.MarkerAction:\n\t\t// Collect private marker\n\t\t// we only store the last marker\n\t\tp.Cmd &^= 0xff << parser.MarkerShift\n\t\tp.Cmd |= int(b) << parser.MarkerShift\n\n\tcase parser.CollectAction:\n\t\tif state == parser.Utf8State {\n\t\t\t// Reset the UTF-8 counter\n\t\t\tp.ParamsLen = 0\n\t\t\tp.collectRune(b)\n\t\t} else {\n\t\t\t// Collect intermediate bytes\n\t\t\t// we only store the last intermediate byte\n\t\t\tp.Cmd &^= 0xff << parser.IntermedShift\n\t\t\tp.Cmd |= int(b) << parser.IntermedShift\n\t\t}\n\n\tcase parser.ParamAction:\n\t\t// Collect parameters\n\t\tif p.ParamsLen >= len(p.Params) {\n\t\t\tbreak\n\t\t}\n\n\t\tif b >= '0' && b <= '9' {\n\t\t\tif p.Params[p.ParamsLen] == parser.MissingParam {\n\t\t\t\tp.Params[p.ParamsLen] = 0\n\t\t\t}\n\n\t\t\tp.Params[p.ParamsLen] *= 10\n\t\t\tp.Params[p.ParamsLen] += int(b - '0')\n\t\t}\n\n\t\tif b == ':' {\n\t\t\tp.Params[p.ParamsLen] |= parser.HasMoreFlag\n\t\t}\n\n\t\tif b == ';' || b == ':' {\n\t\t\tp.ParamsLen++\n\t\t\tif p.ParamsLen < len(p.Params) {\n\t\t\t\tp.Params[p.ParamsLen] = parser.MissingParam\n\t\t\t}\n\t\t}\n\n\tcase parser.StartAction:\n\t\tif p.DataLen < 0 && p.Data != nil {\n\t\t\tp.Data = p.Data[:0]\n\t\t} else {\n\t\t\tp.DataLen = 0\n\t\t}\n\t\tif p.State >= parser.DcsEntryState && p.State <= parser.DcsStringState {\n\t\t\t// Collect the command byte for DCS\n\t\t\tp.Cmd |= int(b)\n\t\t} else {\n\t\t\tp.Cmd = parser.MissingCommand\n\t\t}\n\n\tcase parser.PutAction:\n\t\tswitch p.State {\n\t\tcase parser.OscStringState:\n\t\t\tif b == ';' && p.Cmd == parser.MissingCommand {\n\t\t\t\t// Try to parse the command\n\t\t\t\tdatalen := len(p.Data)\n\t\t\t\tif p.DataLen >= 0 {\n\t\t\t\t\tdatalen = p.DataLen\n\t\t\t\t}\n\t\t\t\tfor i := 0; i < datalen; i++ {\n\t\t\t\t\td := p.Data[i]\n\t\t\t\t\tif d < '0' || d > '9' {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif p.Cmd == parser.MissingCommand {\n\t\t\t\t\t\tp.Cmd = 0\n\t\t\t\t\t}\n\t\t\t\t\tp.Cmd *= 10\n\t\t\t\t\tp.Cmd += int(d - '0')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif p.DataLen < 0 {\n\t\t\tp.Data = append(p.Data, b)\n\t\t} else {\n\t\t\tif p.DataLen < len(p.Data) {\n\t\t\t\tp.Data[p.DataLen] = b\n\t\t\t\tp.DataLen++\n\t\t\t}\n\t\t}\n\n\tcase parser.DispatchAction:\n\t\t// Increment the last parameter\n\t\tif p.ParamsLen > 0 && p.ParamsLen < len(p.Params)-1 ||\n\t\t\tp.ParamsLen == 0 && len(p.Params) > 0 && p.Params[0] != parser.MissingParam {\n\t\t\tp.ParamsLen++\n\t\t}\n\n\t\tif dispatcher == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tvar seq Sequence\n\t\tdata := p.Data\n\t\tif p.DataLen >= 0 {\n\t\t\tdata = data[:p.DataLen]\n\t\t}\n\t\tswitch p.State {\n\t\tcase parser.CsiEntryState, parser.CsiParamState, parser.CsiIntermediateState:\n\t\t\tp.Cmd |= int(b)\n\t\t\tseq = CsiSequence{Cmd: p.Cmd, Params: p.Params[:p.ParamsLen]}\n\t\tcase parser.EscapeState, parser.EscapeIntermediateState:\n\t\t\tp.Cmd |= int(b)\n\t\t\tseq = EscSequence(p.Cmd)\n\t\tcase parser.DcsEntryState, parser.DcsParamState, parser.DcsIntermediateState, parser.DcsStringState:\n\t\t\tseq = DcsSequence{Cmd: p.Cmd, Params: p.Params[:p.ParamsLen], Data: data}\n\t\tcase parser.OscStringState:\n\t\t\tseq = OscSequence{Cmd: p.Cmd, Data: data}\n\t\tcase parser.SosStringState:\n\t\t\tseq = SosSequence{Data: data}\n\t\tcase parser.PmStringState:\n\t\t\tseq = PmSequence{Data: data}\n\t\tcase parser.ApcStringState:\n\t\t\tseq = ApcSequence{Data: data}\n\t\t}\n\n\t\tdispatcher(seq)\n\t}\n}\n\nfunc utf8ByteLen(b byte) int {\n\tif b <= 0b0111_1111 { // 0x00-0x7F\n\t\treturn 1\n\t} else if b >= 0b1100_0000 && b <= 0b1101_1111 { // 0xC0-0xDF\n\t\treturn 2\n\t} else if b >= 0b1110_0000 && b <= 0b1110_1111 { // 0xE0-0xEF\n\t\treturn 3\n\t} else if b >= 0b1111_0000 && b <= 0b1111_0111 { // 0xF0-0xF7\n\t\treturn 4\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/parser_decode.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// State represents the state of the ANSI escape sequence parser used by\n// [DecodeSequence].\ntype State = byte\n\n// ANSI escape sequence states used by [DecodeSequence].\nconst (\n\tNormalState State = iota\n\tMarkerState\n\tParamsState\n\tIntermedState\n\tEscapeState\n\tStringState\n)\n\n// DecodeSequence decodes the first ANSI escape sequence or a printable\n// grapheme from the given data. It returns the sequence slice, the number of\n// bytes read, the cell width for each sequence, and the new state.\n//\n// The cell width will always be 0 for control and escape sequences, 1 for\n// ASCII printable characters, and the number of cells other Unicode characters\n// occupy. It uses the uniseg package to calculate the width of Unicode\n// graphemes and characters. This means it will always do grapheme clustering\n// (mode 2027).\n//\n// Passing a non-nil [*Parser] as the last argument will allow the decoder to\n// collect sequence parameters, data, and commands. The parser cmd will have\n// the packed command value that contains intermediate and marker characters.\n// In the case of a OSC sequence, the cmd will be the OSC command number. Use\n// [Cmd] and [Param] types to unpack command intermediates and markers as well\n// as parameters.\n//\n// Zero [p.Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover, checking the\n// validity of other data sequences, OSC, DCS, etc, will require checking for\n// the returned sequence terminator bytes such as ST (ESC \\\\) and BEL).\n//\n// We store the command byte in [p.Cmd] in the most significant byte, the\n// marker byte in the next byte, and the intermediate byte in the least\n// significant byte. This is done to avoid using a struct to store the command\n// and its intermediates and markers. The command byte is always the least\n// significant byte i.e. [p.Cmd & 0xff]. Use the [Cmd] type to unpack the\n// command, intermediate, and marker bytes. Note that we only collect the last\n// marker character and intermediate byte.\n//\n// The [p.Params] slice will contain the parameters of the sequence. Any\n// sub-parameter will have the [parser.HasMoreFlag] set. Use the [Param] type\n// to unpack the parameters.\n//\n// Example:\n//\n//\tvar state byte // the initial state is always zero [NormalState]\n//\tp := NewParser(32, 1024) // create a new parser with a 32 params buffer and 1024 data buffer (optional)\n//\tinput := []byte(\"\\x1b[31mHello, World!\\x1b[0m\")\n//\tfor len(input) > 0 {\n//\t\tseq, width, n, newState := DecodeSequence(input, state, p)\n//\t\tlog.Printf(\"seq: %q, width: %d\", seq, width)\n//\t\tstate = newState\n//\t\tinput = input[n:]\n//\t}\nfunc DecodeSequence[T string | []byte](b T, state byte, p *Parser) (seq T, width int, n int, newState byte) {\n\tfor i := 0; i < len(b); i++ {\n\t\tc := b[i]\n\n\t\tswitch state {\n\t\tcase NormalState:\n\t\t\tswitch c {\n\t\t\tcase ESC:\n\t\t\t\tif p != nil {\n\t\t\t\t\tif len(p.Params) > 0 {\n\t\t\t\t\t\tp.Params[0] = parser.MissingParam\n\t\t\t\t\t}\n\t\t\t\t\tp.Cmd = 0\n\t\t\t\t\tp.ParamsLen = 0\n\t\t\t\t\tp.DataLen = 0\n\t\t\t\t}\n\t\t\t\tstate = EscapeState\n\t\t\t\tcontinue\n\t\t\tcase CSI, DCS:\n\t\t\t\tif p != nil {\n\t\t\t\t\tif len(p.Params) > 0 {\n\t\t\t\t\t\tp.Params[0] = parser.MissingParam\n\t\t\t\t\t}\n\t\t\t\t\tp.Cmd = 0\n\t\t\t\t\tp.ParamsLen = 0\n\t\t\t\t\tp.DataLen = 0\n\t\t\t\t}\n\t\t\t\tstate = MarkerState\n\t\t\t\tcontinue\n\t\t\tcase OSC, APC, SOS, PM:\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Cmd = parser.MissingCommand\n\t\t\t\t\tp.DataLen = 0\n\t\t\t\t}\n\t\t\t\tstate = StringState\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif p != nil {\n\t\t\t\tp.DataLen = 0\n\t\t\t\tp.ParamsLen = 0\n\t\t\t\tp.Cmd = 0\n\t\t\t}\n\t\t\tif c > US && c < DEL {\n\t\t\t\t// ASCII printable characters\n\t\t\t\treturn b[i : i+1], 1, 1, NormalState\n\t\t\t}\n\n\t\t\tif c <= US || c == DEL || c < 0xC0 {\n\t\t\t\t// C0 & C1 control characters & DEL\n\t\t\t\treturn b[i : i+1], 0, 1, NormalState\n\t\t\t}\n\n\t\t\tif utf8.RuneStart(c) {\n\t\t\t\tseq, _, width, _ = FirstGraphemeCluster(b, -1)\n\t\t\t\ti += len(seq)\n\t\t\t\treturn b[:i], width, i, NormalState\n\t\t\t}\n\n\t\t\t// Invalid UTF-8 sequence\n\t\t\treturn b[:i], 0, i, NormalState\n\t\tcase MarkerState:\n\t\t\tif c >= '<' && c <= '?' {\n\t\t\t\tif p != nil {\n\t\t\t\t\t// We only collect the last marker character.\n\t\t\t\t\tp.Cmd &^= 0xff << parser.MarkerShift\n\t\t\t\t\tp.Cmd |= int(c) << parser.MarkerShift\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tstate = ParamsState\n\t\t\tfallthrough\n\t\tcase ParamsState:\n\t\t\tif c >= '0' && c <= '9' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tif p.Params[p.ParamsLen] == parser.MissingParam {\n\t\t\t\t\t\tp.Params[p.ParamsLen] = 0\n\t\t\t\t\t}\n\n\t\t\t\t\tp.Params[p.ParamsLen] *= 10\n\t\t\t\t\tp.Params[p.ParamsLen] += int(c - '0')\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif c == ':' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Params[p.ParamsLen] |= parser.HasMoreFlag\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif c == ';' || c == ':' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.ParamsLen++\n\t\t\t\t\tif p.ParamsLen < len(p.Params) {\n\t\t\t\t\t\tp.Params[p.ParamsLen] = parser.MissingParam\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tstate = IntermedState\n\t\t\tfallthrough\n\t\tcase IntermedState:\n\t\t\tif c >= ' ' && c <= '/' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Cmd &^= 0xff << parser.IntermedShift\n\t\t\t\t\tp.Cmd |= int(c) << parser.IntermedShift\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tstate = NormalState\n\t\t\tif c >= '@' && c <= '~' {\n\t\t\t\tif p != nil {\n\t\t\t\t\t// Increment the last parameter\n\t\t\t\t\tif p.ParamsLen > 0 && p.ParamsLen < len(p.Params)-1 ||\n\t\t\t\t\t\tp.ParamsLen == 0 && len(p.Params) > 0 && p.Params[0] != parser.MissingParam {\n\t\t\t\t\t\tp.ParamsLen++\n\t\t\t\t\t}\n\n\t\t\t\t\tp.Cmd &^= 0xff\n\t\t\t\t\tp.Cmd |= int(c)\n\t\t\t\t}\n\n\t\t\t\tif HasDcsPrefix(b) {\n\t\t\t\t\t// Continue to collect DCS data\n\t\t\t\t\tif p != nil {\n\t\t\t\t\t\tp.DataLen = 0\n\t\t\t\t\t}\n\t\t\t\t\tstate = StringState\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\treturn b[:i+1], 0, i + 1, state\n\t\t\t}\n\n\t\t\t// Invalid CSI/DCS sequence\n\t\t\treturn b[:i], 0, i, NormalState\n\t\tcase EscapeState:\n\t\t\tswitch c {\n\t\t\tcase '[', 'P':\n\t\t\t\tif p != nil {\n\t\t\t\t\tif len(p.Params) > 0 {\n\t\t\t\t\t\tp.Params[0] = parser.MissingParam\n\t\t\t\t\t}\n\t\t\t\t\tp.ParamsLen = 0\n\t\t\t\t\tp.Cmd = 0\n\t\t\t\t}\n\t\t\t\tstate = MarkerState\n\t\t\t\tcontinue\n\t\t\tcase ']', 'X', '^', '_':\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Cmd = parser.MissingCommand\n\t\t\t\t\tp.DataLen = 0\n\t\t\t\t}\n\t\t\t\tstate = StringState\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif c >= ' ' && c <= '/' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Cmd &^= 0xff << parser.IntermedShift\n\t\t\t\t\tp.Cmd |= int(c) << parser.IntermedShift\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t} else if c >= '0' && c <= '~' {\n\t\t\t\tif p != nil {\n\t\t\t\t\tp.Cmd &^= 0xff\n\t\t\t\t\tp.Cmd |= int(c)\n\t\t\t\t}\n\t\t\t\treturn b[:i+1], 0, i + 1, NormalState\n\t\t\t}\n\n\t\t\t// Invalid escape sequence\n\t\t\treturn b[:i], 0, i, NormalState\n\t\tcase StringState:\n\t\t\tswitch c {\n\t\t\tcase BEL:\n\t\t\t\tif HasOscPrefix(b) {\n\t\t\t\t\treturn b[:i+1], 0, i + 1, NormalState\n\t\t\t\t}\n\t\t\tcase CAN, SUB:\n\t\t\t\t// Cancel the sequence\n\t\t\t\treturn b[:i], 0, i, NormalState\n\t\t\tcase ST:\n\t\t\t\treturn b[:i+1], 0, i + 1, NormalState\n\t\t\tcase ESC:\n\t\t\t\tif HasStPrefix(b[i:]) {\n\t\t\t\t\t// End of string 7-bit (ST)\n\t\t\t\t\treturn b[:i+2], 0, i + 2, NormalState\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, cancel the sequence\n\t\t\t\treturn b[:i], 0, i, NormalState\n\t\t\t}\n\n\t\t\tif p != nil && p.DataLen < len(p.Data) {\n\t\t\t\tp.Data[p.DataLen] = c\n\t\t\t\tp.DataLen++\n\n\t\t\t\t// Parse the OSC command number\n\t\t\t\tif c == ';' && p.Cmd == parser.MissingCommand && HasOscPrefix(b) {\n\t\t\t\t\tfor j := 0; j < p.DataLen; j++ {\n\t\t\t\t\t\td := p.Data[j]\n\t\t\t\t\t\tif d < '0' || d > '9' {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif p.Cmd == parser.MissingCommand {\n\t\t\t\t\t\t\tp.Cmd = 0\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp.Cmd *= 10\n\t\t\t\t\t\tp.Cmd += int(d - '0')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn b, 0, len(b), state\n}\n\n// Index returns the index of the first occurrence of the given byte slice in\n// the data. It returns -1 if the byte slice is not found.\nfunc Index[T string | []byte](data, b T) int {\n\tswitch data := any(data).(type) {\n\tcase string:\n\t\treturn strings.Index(data, string(b))\n\tcase []byte:\n\t\treturn bytes.Index(data, []byte(b))\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Equal returns true if the given byte slices are equal.\nfunc Equal[T string | []byte](a, b T) bool {\n\treturn string(a) == string(b)\n}\n\n// HasPrefix returns true if the given byte slice has prefix.\nfunc HasPrefix[T string | []byte](b, prefix T) bool {\n\treturn len(b) >= len(prefix) && Equal(b[0:len(prefix)], prefix)\n}\n\n// HasSuffix returns true if the given byte slice has suffix.\nfunc HasSuffix[T string | []byte](b, suffix T) bool {\n\treturn len(b) >= len(suffix) && Equal(b[len(b)-len(suffix):], suffix)\n}\n\n// HasCsiPrefix returns true if the given byte slice has a CSI prefix.\nfunc HasCsiPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == CSI) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == '[')\n}\n\n// HasOscPrefix returns true if the given byte slice has an OSC prefix.\nfunc HasOscPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == OSC) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == ']')\n}\n\n// HasApcPrefix returns true if the given byte slice has an APC prefix.\nfunc HasApcPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == APC) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == '_')\n}\n\n// HasDcsPrefix returns true if the given byte slice has a DCS prefix.\nfunc HasDcsPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == DCS) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == 'P')\n}\n\n// HasSosPrefix returns true if the given byte slice has a SOS prefix.\nfunc HasSosPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == SOS) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == 'X')\n}\n\n// HasPmPrefix returns true if the given byte slice has a PM prefix.\nfunc HasPmPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == PM) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == '^')\n}\n\n// HasStPrefix returns true if the given byte slice has a ST prefix.\nfunc HasStPrefix[T string | []byte](b T) bool {\n\treturn (len(b) > 0 && b[0] == ST) ||\n\t\t(len(b) > 1 && b[0] == ESC && b[1] == '\\\\')\n}\n\n// HasEscPrefix returns true if the given byte slice has an ESC prefix.\nfunc HasEscPrefix[T string | []byte](b T) bool {\n\treturn len(b) > 0 && b[0] == ESC\n}\n\n// FirstGraphemeCluster returns the first grapheme cluster in the given string or byte slice.\n// This is a syntactic sugar function that wraps\n// uniseg.FirstGraphemeClusterInString and uniseg.FirstGraphemeCluster.\nfunc FirstGraphemeCluster[T string | []byte](b T, state int) (T, T, int, int) {\n\tswitch b := any(b).(type) {\n\tcase string:\n\t\tcluster, rest, width, newState := uniseg.FirstGraphemeClusterInString(b, state)\n\t\treturn T(cluster), T(rest), width, newState\n\tcase []byte:\n\t\tcluster, rest, width, newState := uniseg.FirstGraphemeCluster(b, state)\n\t\treturn T(cluster), T(rest), width, newState\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Cmd represents a sequence command. This is used to pack/unpack a sequence\n// command with its intermediate and marker characters. Those are commonly\n// found in CSI and DCS sequences.\ntype Cmd int\n\n// Marker returns the marker byte of the CSI sequence.\n// This is always gonna be one of the following '<' '=' '>' '?' and in the\n// range of 0x3C-0x3F.\n// Zero is returned if the sequence does not have a marker.\nfunc (c Cmd) Marker() int {\n\treturn parser.Marker(int(c))\n}\n\n// Intermediate returns the intermediate byte of the CSI sequence.\n// An intermediate byte is in the range of 0x20-0x2F. This includes these\n// characters from ' ', '!', '\"', '#', '$', '%', '&', ”', '(', ')', '*', '+',\n// ',', '-', '.', '/'.\n// Zero is returned if the sequence does not have an intermediate byte.\nfunc (c Cmd) Intermediate() int {\n\treturn parser.Intermediate(int(c))\n}\n\n// Command returns the command byte of the CSI sequence.\nfunc (c Cmd) Command() int {\n\treturn parser.Command(int(c))\n}\n\n// Param represents a sequence parameter. Sequence parameters with\n// sub-parameters are packed with the HasMoreFlag set. This is used to unpack\n// the parameters from a CSI and DCS sequences.\ntype Param int\n\n// Param returns the parameter at the given index.\n// It returns -1 if the parameter does not exist.\nfunc (s Param) Param() int {\n\treturn int(s) & parser.ParamMask\n}\n\n// HasMore returns true if the parameter has more sub-parameters.\nfunc (s Param) HasMore() bool {\n\treturn int(s)&parser.HasMoreFlag != 0\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/passthrough.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n)\n\n// ScreenPassthrough wraps the given ANSI sequence in a DCS passthrough\n// sequence to be sent to the outer terminal. This is used to send raw escape\n// sequences to the outer terminal when running inside GNU Screen.\n//\n//\tDCS <data> ST\n//\n// Note: Screen limits the length of string sequences to 768 bytes (since 2014).\n// Use zero to indicate no limit, otherwise, this will chunk the returned\n// string into limit sized chunks.\n//\n// See: https://www.gnu.org/software/screen/manual/screen.html#String-Escapes\n// See: https://git.savannah.gnu.org/cgit/screen.git/tree/src/screen.h?id=c184c6ec27683ff1a860c45be5cf520d896fd2ef#n44\nfunc ScreenPassthrough(seq string, limit int) string {\n\tvar b bytes.Buffer\n\tb.WriteString(\"\\x1bP\")\n\tif limit > 0 {\n\t\tfor i := 0; i < len(seq); i += limit {\n\t\t\tend := i + limit\n\t\t\tif end > len(seq) {\n\t\t\t\tend = len(seq)\n\t\t\t}\n\t\t\tb.WriteString(seq[i:end])\n\t\t\tif end < len(seq) {\n\t\t\t\tb.WriteString(\"\\x1b\\\\\\x1bP\")\n\t\t\t}\n\t\t}\n\t} else {\n\t\tb.WriteString(seq)\n\t}\n\tb.WriteString(\"\\x1b\\\\\")\n\treturn b.String()\n}\n\n// TmuxPassthrough wraps the given ANSI sequence in a special DCS passthrough\n// sequence to be sent to the outer terminal. This is used to send raw escape\n// sequences to the outer terminal when running inside Tmux.\n//\n//\tDCS tmux ; <escaped-data> ST\n//\n// Where <escaped-data> is the given sequence in which all occurrences of ESC\n// (0x1b) are doubled i.e. replaced with ESC ESC (0x1b 0x1b).\n//\n// Note: this needs the `allow-passthrough` option to be set to `on`.\n//\n// See: https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it\nfunc TmuxPassthrough(seq string) string {\n\tvar b bytes.Buffer\n\tb.WriteString(\"\\x1bPtmux;\")\n\tfor i := 0; i < len(seq); i++ {\n\t\tif seq[i] == ESC {\n\t\t\tb.WriteByte(ESC)\n\t\t}\n\t\tb.WriteByte(seq[i])\n\t}\n\tb.WriteString(\"\\x1b\\\\\")\n\treturn b.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/screen.go",
    "content": "package ansi\n\nimport \"strconv\"\n\n// EraseDisplay (ED) clears the screen or parts of the screen. Possible values:\n//\n//\t 0: Clear from cursor to end of screen.\n//\t 1: Clear from cursor to beginning of the screen.\n//\t 2: Clear entire screen (and moves cursor to upper left on DOS).\n//\t 3: Clear entire screen and delete all lines saved in the scrollback buffer.\n//\n//\tCSI <n> J\n//\n// See: https://vt100.net/docs/vt510-rm/ED.html\nfunc EraseDisplay(n int) string {\n\tif n < 0 {\n\t\tn = 0\n\t}\n\treturn \"\\x1b[\" + strconv.Itoa(n) + \"J\"\n}\n\n// EraseDisplay constants.\n// These are the possible values for the EraseDisplay function.\nconst (\n\tEraseDisplayRight  = \"\\x1b[0J\"\n\tEraseDisplayLeft   = \"\\x1b[1J\"\n\tEraseEntireDisplay = \"\\x1b[2J\"\n)\n\n// EraseLine (EL) clears the current line or parts of the line. Possible values:\n//\n//\t0: Clear from cursor to end of line.\n//\t1: Clear from cursor to beginning of the line.\n//\t2: Clear entire line.\n//\n// The cursor position is not affected.\n//\n//\tCSI <n> K\n//\n// See: https://vt100.net/docs/vt510-rm/EL.html\nfunc EraseLine(n int) string {\n\tif n < 0 {\n\t\tn = 0\n\t}\n\treturn \"\\x1b[\" + strconv.Itoa(n) + \"K\"\n}\n\n// EraseLine constants.\n// These are the possible values for the EraseLine function.\nconst (\n\tEraseLineRight  = \"\\x1b[0K\"\n\tEraseLineLeft   = \"\\x1b[1K\"\n\tEraseEntireLine = \"\\x1b[2K\"\n)\n\n// ScrollUp (SU) scrolls the screen up n lines. New lines are added at the\n// bottom of the screen.\n//\n//\tCSI <n> S\n//\n// See: https://vt100.net/docs/vt510-rm/SU.html\nfunc ScrollUp(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"S\"\n}\n\n// ScrollDown (SD) scrolls the screen down n lines. New lines are added at the\n// top of the screen.\n//\n//\tCSI <n> T\n//\n// See: https://vt100.net/docs/vt510-rm/SD.html\nfunc ScrollDown(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"T\"\n}\n\n// InsertLine (IL) inserts n blank lines at the current cursor position.\n// Existing lines are moved down.\n//\n//\tCSI <n> L\n//\n// See: https://vt100.net/docs/vt510-rm/IL.html\nfunc InsertLine(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"L\"\n}\n\n// DeleteLine (DL) deletes n lines at the current cursor position. Existing\n// lines are moved up.\n//\n//\tCSI <n> M\n//\n// See: https://vt100.net/docs/vt510-rm/DL.html\nfunc DeleteLine(n int) string {\n\tvar s string\n\tif n > 1 {\n\t\ts = strconv.Itoa(n)\n\t}\n\treturn \"\\x1b[\" + s + \"M\"\n}\n\n// SetScrollingRegion (DECSTBM) sets the top and bottom margins for the scrolling\n// region. The default is the entire screen.\n//\n//\tCSI <top> ; <bottom> r\n//\n// See: https://vt100.net/docs/vt510-rm/DECSTBM.html\nfunc SetScrollingRegion(t, b int) string {\n\tif t < 0 {\n\t\tt = 0\n\t}\n\tif b < 0 {\n\t\tb = 0\n\t}\n\treturn \"\\x1b[\" + strconv.Itoa(t) + \";\" + strconv.Itoa(b) + \"r\"\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/sequence.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n)\n\n// Sequence represents an ANSI sequence. This can be a control sequence, escape\n// sequence, a printable character, etc.\ntype Sequence interface {\n\t// String returns the string representation of the sequence.\n\tString() string\n\t// Bytes returns the byte representation of the sequence.\n\tBytes() []byte\n\t// Clone returns a copy of the sequence.\n\tClone() Sequence\n}\n\n// Rune represents a printable character.\ntype Rune rune\n\nvar _ Sequence = Rune(0)\n\n// Bytes implements Sequence.\nfunc (r Rune) Bytes() []byte {\n\treturn []byte(string(r))\n}\n\n// String implements Sequence.\nfunc (r Rune) String() string {\n\treturn string(r)\n}\n\n// Clone implements Sequence.\nfunc (r Rune) Clone() Sequence {\n\treturn r\n}\n\n// ControlCode represents a control code character. This is a character that\n// is not printable and is used to control the terminal. This would be a\n// character in the C0 or C1 set in the range of 0x00-0x1F and 0x80-0x9F.\ntype ControlCode byte\n\nvar _ Sequence = ControlCode(0)\n\n// Bytes implements Sequence.\nfunc (c ControlCode) Bytes() []byte {\n\treturn []byte{byte(c)}\n}\n\n// String implements Sequence.\nfunc (c ControlCode) String() string {\n\treturn string(c)\n}\n\n// Clone implements Sequence.\nfunc (c ControlCode) Clone() Sequence {\n\treturn c\n}\n\n// EscSequence represents an escape sequence.\ntype EscSequence int\n\nvar _ Sequence = EscSequence(0)\n\n// buffer returns the buffer of the escape sequence.\nfunc (e EscSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteByte('\\x1b')\n\tif i := parser.Intermediate(int(e)); i != 0 {\n\t\tb.WriteByte(byte(i))\n\t}\n\tb.WriteByte(byte(e.Command()))\n\treturn &b\n}\n\n// Bytes implements Sequence.\nfunc (e EscSequence) Bytes() []byte {\n\treturn e.buffer().Bytes()\n}\n\n// String implements Sequence.\nfunc (e EscSequence) String() string {\n\treturn e.buffer().String()\n}\n\n// Clone implements Sequence.\nfunc (e EscSequence) Clone() Sequence {\n\treturn e\n}\n\n// Command returns the command byte of the escape sequence.\nfunc (e EscSequence) Command() int {\n\treturn parser.Command(int(e))\n}\n\n// Intermediate returns the intermediate byte of the escape sequence.\nfunc (e EscSequence) Intermediate() int {\n\treturn parser.Intermediate(int(e))\n}\n\n// SosSequence represents a SOS sequence.\ntype SosSequence struct {\n\t// Data contains the raw data of the sequence.\n\tData []byte\n}\n\nvar _ Sequence = &SosSequence{}\n\n// Clone implements Sequence.\nfunc (s SosSequence) Clone() Sequence {\n\treturn SosSequence{Data: append([]byte(nil), s.Data...)}\n}\n\n// Bytes implements Sequence.\nfunc (s SosSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n\n// String implements Sequence.\nfunc (s SosSequence) String() string {\n\treturn s.buffer().String()\n}\n\nfunc (s SosSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteByte('\\x1b')\n\tb.WriteByte('X')\n\tb.Write(s.Data)\n\tb.WriteString(\"\\x1b\\\\\")\n\treturn &b\n}\n\n// PmSequence represents a PM sequence.\ntype PmSequence struct {\n\t// Data contains the raw data of the sequence.\n\tData []byte\n}\n\nvar _ Sequence = &PmSequence{}\n\n// Clone implements Sequence.\nfunc (s PmSequence) Clone() Sequence {\n\treturn PmSequence{Data: append([]byte(nil), s.Data...)}\n}\n\n// Bytes implements Sequence.\nfunc (s PmSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n\n// String implements Sequence.\nfunc (s PmSequence) String() string {\n\treturn s.buffer().String()\n}\n\n// buffer returns the buffer of the PM sequence.\nfunc (s PmSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteByte('\\x1b')\n\tb.WriteByte('^')\n\tb.Write(s.Data)\n\tb.WriteString(\"\\x1b\\\\\")\n\treturn &b\n}\n\n// ApcSequence represents an APC sequence.\ntype ApcSequence struct {\n\t// Data contains the raw data of the sequence.\n\tData []byte\n}\n\nvar _ Sequence = &ApcSequence{}\n\n// Clone implements Sequence.\nfunc (s ApcSequence) Clone() Sequence {\n\treturn ApcSequence{Data: append([]byte(nil), s.Data...)}\n}\n\n// Bytes implements Sequence.\nfunc (s ApcSequence) Bytes() []byte {\n\treturn s.buffer().Bytes()\n}\n\n// String implements Sequence.\nfunc (s ApcSequence) String() string {\n\treturn s.buffer().String()\n}\n\n// buffer returns the buffer of the APC sequence.\nfunc (s ApcSequence) buffer() *bytes.Buffer {\n\tvar b bytes.Buffer\n\tb.WriteByte('\\x1b')\n\tb.WriteByte('_')\n\tb.Write(s.Data)\n\tb.WriteString(\"\\x1b\\\\\")\n\treturn &b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/style.go",
    "content": "package ansi\n\nimport (\n\t\"image/color\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// ResetStyle is a SGR (Select Graphic Rendition) style sequence that resets\n// all attributes.\n// See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\nconst ResetStyle = \"\\x1b[m\"\n\n// Attr is a SGR (Select Graphic Rendition) style attribute.\ntype Attr = string\n\n// Style represents an ANSI SGR (Select Graphic Rendition) style.\ntype Style []Attr\n\n// String returns the ANSI SGR (Select Graphic Rendition) style sequence for\n// the given style.\nfunc (s Style) String() string {\n\tif len(s) == 0 {\n\t\treturn ResetStyle\n\t}\n\treturn \"\\x1b[\" + strings.Join(s, \";\") + \"m\"\n}\n\n// Styled returns a styled string with the given style applied.\nfunc (s Style) Styled(str string) string {\n\tif len(s) == 0 {\n\t\treturn str\n\t}\n\treturn s.String() + str + ResetStyle\n}\n\n// Reset appends the reset style attribute to the style.\nfunc (s Style) Reset() Style {\n\treturn append(s, ResetAttr)\n}\n\n// Bold appends the bold style attribute to the style.\nfunc (s Style) Bold() Style {\n\treturn append(s, BoldAttr)\n}\n\n// Faint appends the faint style attribute to the style.\nfunc (s Style) Faint() Style {\n\treturn append(s, FaintAttr)\n}\n\n// Italic appends the italic style attribute to the style.\nfunc (s Style) Italic() Style {\n\treturn append(s, ItalicAttr)\n}\n\n// Underline appends the underline style attribute to the style.\nfunc (s Style) Underline() Style {\n\treturn append(s, UnderlineAttr)\n}\n\n// DoubleUnderline appends the double underline style attribute to the style.\nfunc (s Style) DoubleUnderline() Style {\n\treturn append(s, DoubleUnderlineAttr)\n}\n\n// CurlyUnderline appends the curly underline style attribute to the style.\nfunc (s Style) CurlyUnderline() Style {\n\treturn append(s, CurlyUnderlineAttr)\n}\n\n// DottedUnderline appends the dotted underline style attribute to the style.\nfunc (s Style) DottedUnderline() Style {\n\treturn append(s, DottedUnderlineAttr)\n}\n\n// DashedUnderline appends the dashed underline style attribute to the style.\nfunc (s Style) DashedUnderline() Style {\n\treturn append(s, DashedUnderlineAttr)\n}\n\n// SlowBlink appends the slow blink style attribute to the style.\nfunc (s Style) SlowBlink() Style {\n\treturn append(s, SlowBlinkAttr)\n}\n\n// RapidBlink appends the rapid blink style attribute to the style.\nfunc (s Style) RapidBlink() Style {\n\treturn append(s, RapidBlinkAttr)\n}\n\n// Reverse appends the reverse style attribute to the style.\nfunc (s Style) Reverse() Style {\n\treturn append(s, ReverseAttr)\n}\n\n// Conceal appends the conceal style attribute to the style.\nfunc (s Style) Conceal() Style {\n\treturn append(s, ConcealAttr)\n}\n\n// Strikethrough appends the strikethrough style attribute to the style.\nfunc (s Style) Strikethrough() Style {\n\treturn append(s, StrikethroughAttr)\n}\n\n// NoBold appends the no bold style attribute to the style.\nfunc (s Style) NoBold() Style {\n\treturn append(s, NoBoldAttr)\n}\n\n// NormalIntensity appends the normal intensity style attribute to the style.\nfunc (s Style) NormalIntensity() Style {\n\treturn append(s, NormalIntensityAttr)\n}\n\n// NoItalic appends the no italic style attribute to the style.\nfunc (s Style) NoItalic() Style {\n\treturn append(s, NoItalicAttr)\n}\n\n// NoUnderline appends the no underline style attribute to the style.\nfunc (s Style) NoUnderline() Style {\n\treturn append(s, NoUnderlineAttr)\n}\n\n// NoBlink appends the no blink style attribute to the style.\nfunc (s Style) NoBlink() Style {\n\treturn append(s, NoBlinkAttr)\n}\n\n// NoReverse appends the no reverse style attribute to the style.\nfunc (s Style) NoReverse() Style {\n\treturn append(s, NoReverseAttr)\n}\n\n// NoConceal appends the no conceal style attribute to the style.\nfunc (s Style) NoConceal() Style {\n\treturn append(s, NoConcealAttr)\n}\n\n// NoStrikethrough appends the no strikethrough style attribute to the style.\nfunc (s Style) NoStrikethrough() Style {\n\treturn append(s, NoStrikethroughAttr)\n}\n\n// DefaultForegroundColor appends the default foreground color style attribute to the style.\nfunc (s Style) DefaultForegroundColor() Style {\n\treturn append(s, DefaultForegroundColorAttr)\n}\n\n// DefaultBackgroundColor appends the default background color style attribute to the style.\nfunc (s Style) DefaultBackgroundColor() Style {\n\treturn append(s, DefaultBackgroundColorAttr)\n}\n\n// DefaultUnderlineColor appends the default underline color style attribute to the style.\nfunc (s Style) DefaultUnderlineColor() Style {\n\treturn append(s, DefaultUnderlineColorAttr)\n}\n\n// ForegroundColor appends the foreground color style attribute to the style.\nfunc (s Style) ForegroundColor(c Color) Style {\n\treturn append(s, ForegroundColorAttr(c))\n}\n\n// BackgroundColor appends the background color style attribute to the style.\nfunc (s Style) BackgroundColor(c Color) Style {\n\treturn append(s, BackgroundColorAttr(c))\n}\n\n// UnderlineColor appends the underline color style attribute to the style.\nfunc (s Style) UnderlineColor(c Color) Style {\n\treturn append(s, UnderlineColorAttr(c))\n}\n\n// SGR (Select Graphic Rendition) style attributes.\n// See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\nconst (\n\tResetAttr                  Attr = \"0\"\n\tBoldAttr                   Attr = \"1\"\n\tFaintAttr                  Attr = \"2\"\n\tItalicAttr                 Attr = \"3\"\n\tUnderlineAttr              Attr = \"4\"\n\tDoubleUnderlineAttr        Attr = \"4:2\"\n\tCurlyUnderlineAttr         Attr = \"4:3\"\n\tDottedUnderlineAttr        Attr = \"4:4\"\n\tDashedUnderlineAttr        Attr = \"4:5\"\n\tSlowBlinkAttr              Attr = \"5\"\n\tRapidBlinkAttr             Attr = \"6\"\n\tReverseAttr                Attr = \"7\"\n\tConcealAttr                Attr = \"8\"\n\tStrikethroughAttr          Attr = \"9\"\n\tNoBoldAttr                 Attr = \"21\" // Some terminals treat this as double underline.\n\tNormalIntensityAttr        Attr = \"22\"\n\tNoItalicAttr               Attr = \"23\"\n\tNoUnderlineAttr            Attr = \"24\"\n\tNoBlinkAttr                Attr = \"25\"\n\tNoReverseAttr              Attr = \"27\"\n\tNoConcealAttr              Attr = \"28\"\n\tNoStrikethroughAttr        Attr = \"29\"\n\tDefaultForegroundColorAttr Attr = \"39\"\n\tDefaultBackgroundColorAttr Attr = \"49\"\n\tDefaultUnderlineColorAttr  Attr = \"59\"\n)\n\n// ForegroundColorAttr returns the style SGR attribute for the given foreground\n// color.\n// See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\nfunc ForegroundColorAttr(c Color) Attr {\n\tswitch c := c.(type) {\n\tcase BasicColor:\n\t\t// 3-bit or 4-bit ANSI foreground\n\t\t// \"3<n>\" or \"9<n>\" where n is the color number from 0 to 7\n\t\tif c < 8 {\n\t\t\treturn \"3\" + string('0'+c)\n\t\t} else if c < 16 {\n\t\t\treturn \"9\" + string('0'+c-8)\n\t\t}\n\tcase ExtendedColor:\n\t\t// 256-color ANSI foreground\n\t\t// \"38;5;<n>\"\n\t\treturn \"38;5;\" + strconv.FormatUint(uint64(c), 10)\n\tcase TrueColor, color.Color:\n\t\t// 24-bit \"true color\" foreground\n\t\t// \"38;2;<r>;<g>;<b>\"\n\t\tr, g, b, _ := c.RGBA()\n\t\treturn \"38;2;\" +\n\t\t\tstrconv.FormatUint(uint64(shift(r)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(g)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(b)), 10)\n\t}\n\treturn DefaultForegroundColorAttr\n}\n\n// BackgroundColorAttr returns the style SGR attribute for the given background\n// color.\n// See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\nfunc BackgroundColorAttr(c Color) Attr {\n\tswitch c := c.(type) {\n\tcase BasicColor:\n\t\t// 3-bit or 4-bit ANSI foreground\n\t\t// \"4<n>\" or \"10<n>\" where n is the color number from 0 to 7\n\t\tif c < 8 {\n\t\t\treturn \"4\" + string('0'+c)\n\t\t} else {\n\t\t\treturn \"10\" + string('0'+c-8)\n\t\t}\n\tcase ExtendedColor:\n\t\t// 256-color ANSI foreground\n\t\t// \"48;5;<n>\"\n\t\treturn \"48;5;\" + strconv.FormatUint(uint64(c), 10)\n\tcase TrueColor, color.Color:\n\t\t// 24-bit \"true color\" foreground\n\t\t// \"38;2;<r>;<g>;<b>\"\n\t\tr, g, b, _ := c.RGBA()\n\t\treturn \"48;2;\" +\n\t\t\tstrconv.FormatUint(uint64(shift(r)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(g)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(b)), 10)\n\t}\n\treturn DefaultBackgroundColorAttr\n}\n\n// UnderlineColorAttr returns the style SGR attribute for the given underline\n// color.\n// See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\nfunc UnderlineColorAttr(c Color) Attr {\n\tswitch c := c.(type) {\n\t// NOTE: we can't use 3-bit and 4-bit ANSI color codes with underline\n\t// color, use 256-color instead.\n\t//\n\t// 256-color ANSI underline color\n\t// \"58;5;<n>\"\n\tcase BasicColor:\n\t\treturn \"58;5;\" + strconv.FormatUint(uint64(c), 10)\n\tcase ExtendedColor:\n\t\treturn \"58;5;\" + strconv.FormatUint(uint64(c), 10)\n\tcase TrueColor, color.Color:\n\t\t// 24-bit \"true color\" foreground\n\t\t// \"38;2;<r>;<g>;<b>\"\n\t\tr, g, b, _ := c.RGBA()\n\t\treturn \"58;2;\" +\n\t\t\tstrconv.FormatUint(uint64(shift(r)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(g)), 10) + \";\" +\n\t\t\tstrconv.FormatUint(uint64(shift(b)), 10)\n\t}\n\treturn DefaultUnderlineColorAttr\n}\n\nfunc shift(v uint32) uint32 {\n\tif v > 0xff {\n\t\treturn v >> 8\n\t}\n\treturn v\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/termcap.go",
    "content": "package ansi\n\nimport (\n\t\"encoding/hex\"\n\t\"strings\"\n)\n\n// RequestTermcap (XTGETTCAP) requests Termcap/Terminfo strings.\n//\n//\tDCS + q <Pt> ST\n//\n// Where <Pt> is a list of Termcap/Terminfo capabilities, encoded in 2-digit\n// hexadecimals, separated by semicolons.\n//\n// See: https://man7.org/linux/man-pages/man5/terminfo.5.html\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands\nfunc RequestTermcap(caps ...string) string {\n\tif len(caps) == 0 {\n\t\treturn \"\"\n\t}\n\n\ts := \"\\x1bP+q\"\n\tfor i, c := range caps {\n\t\tif i > 0 {\n\t\t\ts += \";\"\n\t\t}\n\t\ts += strings.ToUpper(hex.EncodeToString([]byte(c)))\n\t}\n\n\treturn s + \"\\x1b\\\\\"\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/title.go",
    "content": "package ansi\n\n// SetIconNameWindowTitle returns a sequence for setting the icon name and\n// window title.\n//\n//\tOSC 0 ; title ST\n//\tOSC 0 ; title BEL\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands\nfunc SetIconNameWindowTitle(s string) string {\n\treturn \"\\x1b]0;\" + s + \"\\x07\"\n}\n\n// SetIconName returns a sequence for setting the icon name.\n//\n//\tOSC 1 ; title ST\n//\tOSC 1 ; title BEL\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands\nfunc SetIconName(s string) string {\n\treturn \"\\x1b]1;\" + s + \"\\x07\"\n}\n\n// SetWindowTitle returns a sequence for setting the window title.\n//\n//\tOSC 2 ; title ST\n//\tOSC 2 ; title BEL\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands\nfunc SetWindowTitle(s string) string {\n\treturn \"\\x1b]2;\" + s + \"\\x07\"\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/truncate.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// Truncate truncates a string to a given length, adding a tail to the\n// end if the string is longer than the given length.\n// This function is aware of ANSI escape codes and will not break them, and\n// accounts for wide-characters (such as East Asians and emojis).\nfunc Truncate(s string, length int, tail string) string {\n\tif sw := StringWidth(s); sw <= length {\n\t\treturn s\n\t}\n\n\ttw := StringWidth(tail)\n\tlength -= tw\n\tif length < 0 {\n\t\treturn \"\"\n\t}\n\n\tvar cluster []byte\n\tvar buf bytes.Buffer\n\tcurWidth := 0\n\tignoring := false\n\tpstate := parser.GroundState // initial state\n\tb := []byte(s)\n\ti := 0\n\n\t// Here we iterate over the bytes of the string and collect printable\n\t// characters and runes. We also keep track of the width of the string\n\t// in cells.\n\t// Once we reach the given length, we start ignoring characters and only\n\t// collect ANSI escape codes until we reach the end of string.\n\tfor i < len(b) {\n\t\tstate, action := parser.Table.Transition(pstate, b[i])\n\t\tif state == parser.Utf8State {\n\t\t\t// This action happens when we transition to the Utf8State.\n\t\t\tvar width int\n\t\t\tcluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1)\n\n\t\t\t// increment the index by the length of the cluster\n\t\t\ti += len(cluster)\n\n\t\t\t// Are we ignoring? Skip to the next byte\n\t\t\tif ignoring {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Is this gonna be too wide?\n\t\t\t// If so write the tail and stop collecting.\n\t\t\tif curWidth+width > length && !ignoring {\n\t\t\t\tignoring = true\n\t\t\t\tbuf.WriteString(tail)\n\t\t\t}\n\n\t\t\tif curWidth+width > length {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcurWidth += width\n\t\t\tbuf.Write(cluster)\n\n\t\t\t// Done collecting, now we're back in the ground state.\n\t\t\tpstate = parser.GroundState\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch action {\n\t\tcase parser.PrintAction:\n\t\t\t// Is this gonna be too wide?\n\t\t\t// If so write the tail and stop collecting.\n\t\t\tif curWidth >= length && !ignoring {\n\t\t\t\tignoring = true\n\t\t\t\tbuf.WriteString(tail)\n\t\t\t}\n\n\t\t\t// Skip to the next byte if we're ignoring\n\t\t\tif ignoring {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// collects printable ASCII\n\t\t\tcurWidth++\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\tbuf.WriteByte(b[i])\n\t\t\ti++\n\t\t}\n\n\t\t// Transition to the next state.\n\t\tpstate = state\n\n\t\t// Once we reach the given length, we start ignoring runes and write\n\t\t// the tail to the buffer.\n\t\tif curWidth > length && !ignoring {\n\t\t\tignoring = true\n\t\t\tbuf.WriteString(tail)\n\t\t}\n\t}\n\n\treturn buf.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/util.go",
    "content": "package ansi\n\nimport (\n\t\"fmt\"\n\t\"image/color\"\n)\n\n// colorToHexString returns a hex string representation of a color.\nfunc colorToHexString(c color.Color) string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\tshift := func(v uint32) uint32 {\n\t\tif v > 0xff {\n\t\t\treturn v >> 8\n\t\t}\n\t\treturn v\n\t}\n\tr, g, b, _ := c.RGBA()\n\tr, g, b = shift(r), shift(g), shift(b)\n\treturn fmt.Sprintf(\"#%02x%02x%02x\", r, g, b)\n}\n\n// rgbToHex converts red, green, and blue values to a hexadecimal value.\n//\n//\thex := rgbToHex(0, 0, 255) // 0x0000FF\nfunc rgbToHex(r, g, b uint32) uint32 {\n\treturn r<<16 + g<<8 + b\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/width.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// Strip removes ANSI escape codes from a string.\nfunc Strip(s string) string {\n\tvar (\n\t\tbuf    bytes.Buffer         // buffer for collecting printable characters\n\t\tri     int                  // rune index\n\t\trw     int                  // rune width\n\t\tpstate = parser.GroundState // initial state\n\t)\n\n\t// This implements a subset of the Parser to only collect runes and\n\t// printable characters.\n\tfor i := 0; i < len(s); i++ {\n\t\tif pstate == parser.Utf8State {\n\t\t\t// During this state, collect rw bytes to form a valid rune in the\n\t\t\t// buffer. After getting all the rune bytes into the buffer,\n\t\t\t// transition to GroundState and reset the counters.\n\t\t\tbuf.WriteByte(s[i])\n\t\t\tri++\n\t\t\tif ri < rw {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpstate = parser.GroundState\n\t\t\tri = 0\n\t\t\trw = 0\n\t\t\tcontinue\n\t\t}\n\n\t\tstate, action := parser.Table.Transition(pstate, s[i])\n\t\tswitch action {\n\t\tcase parser.CollectAction:\n\t\t\tif state == parser.Utf8State {\n\t\t\t\t// This action happens when we transition to the Utf8State.\n\t\t\t\trw = utf8ByteLen(s[i])\n\t\t\t\tbuf.WriteByte(s[i])\n\t\t\t\tri++\n\t\t\t}\n\t\tcase parser.PrintAction, parser.ExecuteAction:\n\t\t\t// collects printable ASCII and non-printable characters\n\t\t\tbuf.WriteByte(s[i])\n\t\t}\n\n\t\t// Transition to the next state.\n\t\t// The Utf8State is managed separately above.\n\t\tif pstate != parser.Utf8State {\n\t\t\tpstate = state\n\t\t}\n\t}\n\n\treturn buf.String()\n}\n\n// StringWidth returns the width of a string in cells. This is the number of\n// cells that the string will occupy when printed in a terminal. ANSI escape\n// codes are ignored and wide characters (such as East Asians and emojis) are\n// accounted for.\nfunc StringWidth(s string) int {\n\tif s == \"\" {\n\t\treturn 0\n\t}\n\n\tvar (\n\t\tpstate  = parser.GroundState // initial state\n\t\tcluster string\n\t\twidth   int\n\t)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tstate, action := parser.Table.Transition(pstate, s[i])\n\t\tif state == parser.Utf8State {\n\t\t\tvar w int\n\t\t\tcluster, _, w, _ = uniseg.FirstGraphemeClusterInString(s[i:], -1)\n\t\t\twidth += w\n\t\t\ti += len(cluster) - 1\n\t\t\tpstate = parser.GroundState\n\t\t\tcontinue\n\t\t}\n\n\t\tif action == parser.PrintAction {\n\t\t\twidth++\n\t\t}\n\n\t\tpstate = state\n\t}\n\n\treturn width\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/wrap.go",
    "content": "package ansi\n\nimport (\n\t\"bytes\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/charmbracelet/x/ansi/parser\"\n\t\"github.com/rivo/uniseg\"\n)\n\n// nbsp is a non-breaking space\nconst nbsp = 0xA0\n\n// Hardwrap wraps a string or a block of text to a given line length, breaking\n// word boundaries. This will preserve ANSI escape codes and will account for\n// wide-characters in the string.\n// When preserveSpace is true, spaces at the beginning of a line will be\n// preserved.\nfunc Hardwrap(s string, limit int, preserveSpace bool) string {\n\tif limit < 1 {\n\t\treturn s\n\t}\n\n\tvar (\n\t\tcluster      []byte\n\t\tbuf          bytes.Buffer\n\t\tcurWidth     int\n\t\tforceNewline bool\n\t\tpstate       = parser.GroundState // initial state\n\t\tb            = []byte(s)\n\t)\n\n\taddNewline := func() {\n\t\tbuf.WriteByte('\\n')\n\t\tcurWidth = 0\n\t}\n\n\ti := 0\n\tfor i < len(b) {\n\t\tstate, action := parser.Table.Transition(pstate, b[i])\n\t\tif state == parser.Utf8State {\n\t\t\tvar width int\n\t\t\tcluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1)\n\t\t\ti += len(cluster)\n\n\t\t\tif curWidth+width > limit {\n\t\t\t\taddNewline()\n\t\t\t}\n\t\t\tif !preserveSpace && curWidth == 0 && len(cluster) <= 4 {\n\t\t\t\t// Skip spaces at the beginning of a line\n\t\t\t\tif r, _ := utf8.DecodeRune(cluster); r != utf8.RuneError && unicode.IsSpace(r) {\n\t\t\t\t\tpstate = parser.GroundState\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuf.Write(cluster)\n\t\t\tcurWidth += width\n\t\t\tpstate = parser.GroundState\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch action {\n\t\tcase parser.PrintAction, parser.ExecuteAction:\n\t\t\tif b[i] == '\\n' {\n\t\t\t\taddNewline()\n\t\t\t\tforceNewline = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif curWidth+1 > limit {\n\t\t\t\taddNewline()\n\t\t\t\tforceNewline = true\n\t\t\t}\n\n\t\t\t// Skip spaces at the beginning of a line\n\t\t\tif curWidth == 0 {\n\t\t\t\tif !preserveSpace && forceNewline && unicode.IsSpace(rune(b[i])) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tforceNewline = false\n\t\t\t}\n\n\t\t\tbuf.WriteByte(b[i])\n\t\t\tcurWidth++\n\t\tdefault:\n\t\t\tbuf.WriteByte(b[i])\n\t\t}\n\n\t\t// We manage the UTF8 state separately manually above.\n\t\tif pstate != parser.Utf8State {\n\t\t\tpstate = state\n\t\t}\n\t\ti++\n\t}\n\n\treturn buf.String()\n}\n\n// Wordwrap wraps a string or a block of text to a given line length, not\n// breaking word boundaries. This will preserve ANSI escape codes and will\n// account for wide-characters in the string.\n// The breakpoints string is a list of characters that are considered\n// breakpoints for word wrapping. A hyphen (-) is always considered a\n// breakpoint.\n//\n// Note: breakpoints must be a string of 1-cell wide rune characters.\nfunc Wordwrap(s string, limit int, breakpoints string) string {\n\tif limit < 1 {\n\t\treturn s\n\t}\n\n\tvar (\n\t\tcluster  []byte\n\t\tbuf      bytes.Buffer\n\t\tword     bytes.Buffer\n\t\tspace    bytes.Buffer\n\t\tcurWidth int\n\t\twordLen  int\n\t\tpstate   = parser.GroundState // initial state\n\t\tb        = []byte(s)\n\t)\n\n\taddSpace := func() {\n\t\tcurWidth += space.Len()\n\t\tbuf.Write(space.Bytes())\n\t\tspace.Reset()\n\t}\n\n\taddWord := func() {\n\t\tif word.Len() == 0 {\n\t\t\treturn\n\t\t}\n\n\t\taddSpace()\n\t\tcurWidth += wordLen\n\t\tbuf.Write(word.Bytes())\n\t\tword.Reset()\n\t\twordLen = 0\n\t}\n\n\taddNewline := func() {\n\t\tbuf.WriteByte('\\n')\n\t\tcurWidth = 0\n\t\tspace.Reset()\n\t}\n\n\ti := 0\n\tfor i < len(b) {\n\t\tstate, action := parser.Table.Transition(pstate, b[i])\n\t\tif state == parser.Utf8State {\n\t\t\tvar width int\n\t\t\tcluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1)\n\t\t\ti += len(cluster)\n\n\t\t\tr, _ := utf8.DecodeRune(cluster)\n\t\t\tif r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp {\n\t\t\t\taddWord()\n\t\t\t\tspace.WriteRune(r)\n\t\t\t} else if bytes.ContainsAny(cluster, breakpoints) {\n\t\t\t\taddSpace()\n\t\t\t\taddWord()\n\t\t\t\tbuf.Write(cluster)\n\t\t\t\tcurWidth++\n\t\t\t} else {\n\t\t\t\tword.Write(cluster)\n\t\t\t\twordLen += width\n\t\t\t\tif curWidth+space.Len()+wordLen > limit &&\n\t\t\t\t\twordLen < limit {\n\t\t\t\t\taddNewline()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpstate = parser.GroundState\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch action {\n\t\tcase parser.PrintAction, parser.ExecuteAction:\n\t\t\tr := rune(b[i])\n\t\t\tswitch {\n\t\t\tcase r == '\\n':\n\t\t\t\tif wordLen == 0 {\n\t\t\t\t\tif curWidth+space.Len() > limit {\n\t\t\t\t\t\tcurWidth = 0\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuf.Write(space.Bytes())\n\t\t\t\t\t}\n\t\t\t\t\tspace.Reset()\n\t\t\t\t}\n\n\t\t\t\taddWord()\n\t\t\t\taddNewline()\n\t\t\tcase unicode.IsSpace(r):\n\t\t\t\taddWord()\n\t\t\t\tspace.WriteByte(b[i])\n\t\t\tcase r == '-':\n\t\t\t\tfallthrough\n\t\t\tcase runeContainsAny(r, breakpoints):\n\t\t\t\taddSpace()\n\t\t\t\taddWord()\n\t\t\t\tbuf.WriteByte(b[i])\n\t\t\t\tcurWidth++\n\t\t\tdefault:\n\t\t\t\tword.WriteByte(b[i])\n\t\t\t\twordLen++\n\t\t\t\tif curWidth+space.Len()+wordLen > limit &&\n\t\t\t\t\twordLen < limit {\n\t\t\t\t\taddNewline()\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\tword.WriteByte(b[i])\n\t\t}\n\n\t\t// We manage the UTF8 state separately manually above.\n\t\tif pstate != parser.Utf8State {\n\t\t\tpstate = state\n\t\t}\n\t\ti++\n\t}\n\n\taddWord()\n\n\treturn buf.String()\n}\n\n// Wrap wraps a string or a block of text to a given line length, breaking word\n// boundaries if necessary. This will preserve ANSI escape codes and will\n// account for wide-characters in the string. The breakpoints string is a list\n// of characters that are considered breakpoints for word wrapping. A hyphen\n// (-) is always considered a breakpoint.\n//\n// Note: breakpoints must be a string of 1-cell wide rune characters.\nfunc Wrap(s string, limit int, breakpoints string) string {\n\tif limit < 1 {\n\t\treturn s\n\t}\n\n\tvar (\n\t\tcluster  []byte\n\t\tbuf      bytes.Buffer\n\t\tword     bytes.Buffer\n\t\tspace    bytes.Buffer\n\t\tcurWidth int                  // written width of the line\n\t\twordLen  int                  // word buffer len without ANSI escape codes\n\t\tpstate   = parser.GroundState // initial state\n\t\tb        = []byte(s)\n\t)\n\n\taddSpace := func() {\n\t\tcurWidth += space.Len()\n\t\tbuf.Write(space.Bytes())\n\t\tspace.Reset()\n\t}\n\n\taddWord := func() {\n\t\tif word.Len() == 0 {\n\t\t\treturn\n\t\t}\n\n\t\taddSpace()\n\t\tcurWidth += wordLen\n\t\tbuf.Write(word.Bytes())\n\t\tword.Reset()\n\t\twordLen = 0\n\t}\n\n\taddNewline := func() {\n\t\tbuf.WriteByte('\\n')\n\t\tcurWidth = 0\n\t\tspace.Reset()\n\t}\n\n\ti := 0\n\tfor i < len(b) {\n\t\tstate, action := parser.Table.Transition(pstate, b[i])\n\t\tif state == parser.Utf8State {\n\t\t\tvar width int\n\t\t\tcluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1)\n\t\t\ti += len(cluster)\n\n\t\t\tr, _ := utf8.DecodeRune(cluster)\n\t\t\tswitch {\n\t\t\tcase r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp: // nbsp is a non-breaking space\n\t\t\t\taddWord()\n\t\t\t\tspace.WriteRune(r)\n\t\t\tcase bytes.ContainsAny(cluster, breakpoints):\n\t\t\t\taddSpace()\n\t\t\t\tif curWidth+wordLen+width > limit {\n\t\t\t\t\tword.Write(cluster)\n\t\t\t\t\twordLen += width\n\t\t\t\t} else {\n\t\t\t\t\taddWord()\n\t\t\t\t\tbuf.Write(cluster)\n\t\t\t\t\tcurWidth += width\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tif wordLen+width > limit {\n\t\t\t\t\t// Hardwrap the word if it's too long\n\t\t\t\t\taddWord()\n\t\t\t\t}\n\n\t\t\t\tword.Write(cluster)\n\t\t\t\twordLen += width\n\n\t\t\t\tif curWidth+wordLen+space.Len() > limit {\n\t\t\t\t\taddNewline()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpstate = parser.GroundState\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch action {\n\t\tcase parser.PrintAction, parser.ExecuteAction:\n\t\t\tswitch r := rune(b[i]); {\n\t\t\tcase r == '\\n':\n\t\t\t\tif wordLen == 0 {\n\t\t\t\t\tif curWidth+space.Len() > limit {\n\t\t\t\t\t\tcurWidth = 0\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// preserve whitespaces\n\t\t\t\t\t\tbuf.Write(space.Bytes())\n\t\t\t\t\t}\n\t\t\t\t\tspace.Reset()\n\t\t\t\t}\n\n\t\t\t\taddWord()\n\t\t\t\taddNewline()\n\t\t\tcase unicode.IsSpace(r):\n\t\t\t\taddWord()\n\t\t\t\tspace.WriteRune(r)\n\t\t\tcase r == '-':\n\t\t\t\tfallthrough\n\t\t\tcase runeContainsAny(r, breakpoints):\n\t\t\t\taddSpace()\n\t\t\t\tif curWidth+wordLen >= limit {\n\t\t\t\t\t// We can't fit the breakpoint in the current line, treat\n\t\t\t\t\t// it as part of the word.\n\t\t\t\t\tword.WriteRune(r)\n\t\t\t\t\twordLen++\n\t\t\t\t} else {\n\t\t\t\t\taddWord()\n\t\t\t\t\tbuf.WriteRune(r)\n\t\t\t\t\tcurWidth++\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tword.WriteRune(r)\n\t\t\t\twordLen++\n\n\t\t\t\tif wordLen == limit {\n\t\t\t\t\t// Hardwrap the word if it's too long\n\t\t\t\t\taddWord()\n\t\t\t\t}\n\n\t\t\t\tif curWidth+wordLen+space.Len() > limit {\n\t\t\t\t\taddNewline()\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\tword.WriteByte(b[i])\n\t\t}\n\n\t\t// We manage the UTF8 state separately manually above.\n\t\tif pstate != parser.Utf8State {\n\t\t\tpstate = state\n\t\t}\n\t\ti++\n\t}\n\n\tif word.Len() != 0 {\n\t\t// Preserve ANSI wrapped spaces at the end of string\n\t\tif curWidth+space.Len() > limit {\n\t\t\tbuf.WriteByte('\\n')\n\t\t}\n\t\taddSpace()\n\t}\n\tbuf.Write(word.Bytes())\n\n\treturn buf.String()\n}\n\nfunc runeContainsAny(r rune, s string) bool {\n\tfor _, c := range s {\n\t\tif c == r {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/ansi/xterm.go",
    "content": "package ansi\n\nimport \"strconv\"\n\n// ModifyOtherKeys returns a sequence that sets XTerm modifyOtherKeys mode.\n// The mode argument specifies the mode to set.\n//\n//\t0: Disable modifyOtherKeys mode.\n//\t1: Enable modifyOtherKeys mode 1.\n//\t2: Enable modifyOtherKeys mode 2.\n//\n//\tCSI > 4 ; mode m\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_\n// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys\nfunc ModifyOtherKeys(mode int) string {\n\treturn \"\\x1b[>4;\" + strconv.Itoa(mode) + \"m\"\n}\n\n// DisableModifyOtherKeys disables the modifyOtherKeys mode.\n//\n//\tCSI > 4 ; 0 m\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_\n// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys\nconst DisableModifyOtherKeys = \"\\x1b[>4;0m\"\n\n// EnableModifyOtherKeys1 enables the modifyOtherKeys mode 1.\n//\n//\tCSI > 4 ; 1 m\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_\n// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys\nconst EnableModifyOtherKeys1 = \"\\x1b[>4;1m\"\n\n// EnableModifyOtherKeys2 enables the modifyOtherKeys mode 2.\n//\n//\tCSI > 4 ; 2 m\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_\n// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys\nconst EnableModifyOtherKeys2 = \"\\x1b[>4;2m\"\n\n// RequestModifyOtherKeys requests the modifyOtherKeys mode.\n//\n//\tCSI ? 4  m\n//\n// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_\n// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys\nconst RequestModifyOtherKeys = \"\\x1b[?4m\"\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/exp/strings/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2023 Charmbracelet, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/exp/strings/join.go",
    "content": "package strings\n\n// The so-called spoken language join here works well for some Western\n// languages. PRs for other languages are welcome, but do note that\n// implementation for some languages will be less straightforward than the ones\n// in use here.\n\nimport (\n\t\"strings\"\n)\n\n// Language is a spoken Language.\ntype Language int\n\n// Available spoken lanaguges.\nconst (\n\tDE Language = iota\n\tDK\n\tEN\n\tES\n\tFR\n\tIT\n\tNO\n\tPT\n\tSE\n)\n\n// String returns the English name of the [Language] code.\nfunc (l Language) String() string {\n\treturn map[Language]string{\n\t\tDE: \"German\",\n\t\tDK: \"Danish\",\n\t\tEN: \"English\",\n\t\tES: \"Spanish\",\n\t\tFR: \"French\",\n\t\tIT: \"Italian\",\n\t\tNO: \"Norwegian\",\n\t\tPT: \"Portuguese\",\n\t\tSE: \"Swedish\",\n\t}[l]\n}\n\nfunc (l Language) conjuction() string {\n\tswitch l {\n\tcase DE:\n\t\treturn \"und\"\n\tcase DK:\n\t\treturn \"og\"\n\tcase EN:\n\t\treturn \"and\"\n\tcase ES:\n\t\treturn \"y\"\n\tcase FR:\n\t\treturn \"et\"\n\tcase NO:\n\t\treturn \"og\"\n\tcase IT:\n\t\treturn \"e\"\n\tcase PT:\n\t\treturn \"e\"\n\tcase SE:\n\t\treturn \"och\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc (l Language) separator() string {\n\tswitch l {\n\tcase DE, DK, EN, ES, FR, NO, IT, PT, SE:\n\t\treturn \", \"\n\tdefault:\n\t\treturn \" \"\n\t}\n}\n\n// EnglishJoin joins a slice of strings with commas and the \"and\" conjugation\n// before the final item. The Oxford comma can optionally be applied.\n//\n// Example:\n//\n//\tstr := EnglishJoin([]string{\"meow\", \"purr\", \"raow\"}, true)\n//\tfmt.Println(str) // meow, purr, and raow\nfunc EnglishJoin(words []string, oxfordComma bool) string {\n\treturn spokenLangJoin(words, EN, oxfordComma)\n}\n\n// SpokenLangaugeJoin joins a slice of strings with commas and a conjuction\n// before the final item. You may specify the language with [Language].\n//\n// If you are using English and need the Oxford Comma, use [EnglishJoin].\n//\n// Example:\n//\n//\tstr := SpokenLanguageJoin([]string{\"eins\", \"zwei\", \"drei\"}, DE)\n//\tfmt.Println(str) // eins, zwei und drei\nfunc SpokenLanguageJoin(words []string, language Language) string {\n\treturn spokenLangJoin(words, language, false)\n}\n\nfunc spokenLangJoin(words []string, language Language, oxfordComma bool) string {\n\tconjuction := language.conjuction() + \" \"\n\tseparator := language.separator()\n\n\tb := strings.Builder{}\n\tfor i, word := range words {\n\t\tif word == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif i == 0 {\n\t\t\tb.WriteString(word)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Is this the final word?\n\t\tif len(words) > 1 && i == len(words)-1 {\n\t\t\t// Apply the Oxford comma if requested as long as the language is\n\t\t\t// English.\n\t\t\tif language == EN && oxfordComma && i > 1 {\n\t\t\t\tb.WriteString(separator)\n\t\t\t} else {\n\t\t\t\tb.WriteRune(' ')\n\t\t\t}\n\n\t\t\tb.WriteString(conjuction + word)\n\t\t\tcontinue\n\t\t}\n\n\t\tb.WriteString(separator + word)\n\t}\n\treturn b.String()\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2023 Charmbracelet, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term.go",
    "content": "package term\n\n// State contains platform-specific state of a terminal.\ntype State struct {\n\tstate\n}\n\n// IsTerminal returns whether the given file descriptor is a terminal.\nfunc IsTerminal(fd uintptr) bool {\n\treturn isTerminal(fd)\n}\n\n// MakeRaw puts the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\treturn makeRaw(fd)\n}\n\n// GetState returns the current state of a terminal which may be useful to\n// restore the terminal after a signal.\nfunc GetState(fd uintptr) (*State, error) {\n\treturn getState(fd)\n}\n\n// SetState sets the given state of the terminal.\nfunc SetState(fd uintptr, state *State) error {\n\treturn setState(fd, state)\n}\n\n// Restore restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc Restore(fd uintptr, oldState *State) error {\n\treturn restore(fd, oldState)\n}\n\n// GetSize returns the visible dimensions of the given terminal.\n//\n// These dimensions don't include any scrollback buffer height.\nfunc GetSize(fd uintptr) (width, height int, err error) {\n\treturn getSize(fd)\n}\n\n// ReadPassword reads a line of input from a terminal without local echo.  This\n// is commonly used for inputting passwords and other sensitive data. The slice\n// returned does not include the \\n.\nfunc ReadPassword(fd uintptr) ([]byte, error) {\n\treturn readPassword(fd)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term_other.go",
    "content": "//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9\n// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!zos,!windows,!solaris,!plan9\n\npackage term\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\ntype state struct{}\n\nfunc isTerminal(fd uintptr) bool {\n\treturn false\n}\n\nfunc makeRaw(fd uintptr) (*State, error) {\n\treturn nil, fmt.Errorf(\"terminal: MakeRaw not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\nfunc getState(fd uintptr) (*State, error) {\n\treturn nil, fmt.Errorf(\"terminal: GetState not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\nfunc restore(fd uintptr, state *State) error {\n\treturn fmt.Errorf(\"terminal: Restore not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\nfunc getSize(fd uintptr) (width, height int, err error) {\n\treturn 0, 0, fmt.Errorf(\"terminal: GetSize not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\nfunc setState(fd uintptr, state *State) error {\n\treturn fmt.Errorf(\"terminal: SetState not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\nfunc readPassword(fd uintptr) ([]byte, error) {\n\treturn nil, fmt.Errorf(\"terminal: ReadPassword not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term_unix.go",
    "content": "//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos\n// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos\n\npackage term\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\ntype state struct {\n\tunix.Termios\n}\n\nfunc isTerminal(fd uintptr) bool {\n\t_, err := unix.IoctlGetTermios(int(fd), ioctlReadTermios)\n\treturn err == nil\n}\n\nfunc makeRaw(fd uintptr) (*State, error) {\n\ttermios, err := unix.IoctlGetTermios(int(fd), ioctlReadTermios)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toldState := State{state{Termios: *termios}}\n\n\t// This attempts to replicate the behaviour documented for cfmakeraw in\n\t// the termios(3) manpage.\n\ttermios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON\n\ttermios.Oflag &^= unix.OPOST\n\ttermios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN\n\ttermios.Cflag &^= unix.CSIZE | unix.PARENB\n\ttermios.Cflag |= unix.CS8\n\ttermios.Cc[unix.VMIN] = 1\n\ttermios.Cc[unix.VTIME] = 0\n\tif err := unix.IoctlSetTermios(int(fd), ioctlWriteTermios, termios); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n\nfunc setState(fd uintptr, state *State) error {\n\tvar termios *unix.Termios\n\tif state != nil {\n\t\ttermios = &state.Termios\n\t}\n\treturn unix.IoctlSetTermios(int(fd), ioctlWriteTermios, termios)\n}\n\nfunc getState(fd uintptr) (*State, error) {\n\ttermios, err := unix.IoctlGetTermios(int(fd), ioctlReadTermios)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &State{state{Termios: *termios}}, nil\n}\n\nfunc restore(fd uintptr, state *State) error {\n\treturn unix.IoctlSetTermios(int(fd), ioctlWriteTermios, &state.Termios)\n}\n\nfunc getSize(fd uintptr) (width, height int, err error) {\n\tws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\treturn int(ws.Col), int(ws.Row), nil\n}\n\n// passwordReader is an io.Reader that reads from a specific file descriptor.\ntype passwordReader int\n\nfunc (r passwordReader) Read(buf []byte) (int, error) {\n\treturn unix.Read(int(r), buf)\n}\n\nfunc readPassword(fd uintptr) ([]byte, error) {\n\ttermios, err := unix.IoctlGetTermios(int(fd), ioctlReadTermios)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewState := *termios\n\tnewState.Lflag &^= unix.ECHO\n\tnewState.Lflag |= unix.ICANON | unix.ISIG\n\tnewState.Iflag |= unix.ICRNL\n\tif err := unix.IoctlSetTermios(int(fd), ioctlWriteTermios, &newState); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer unix.IoctlSetTermios(int(fd), ioctlWriteTermios, termios)\n\n\treturn readPasswordLine(passwordReader(fd))\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term_unix_bsd.go",
    "content": "//go:build darwin || dragonfly || freebsd || netbsd || openbsd\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage term\n\nimport \"golang.org/x/sys/unix\"\n\nconst (\n\tioctlReadTermios  = unix.TIOCGETA\n\tioctlWriteTermios = unix.TIOCSETA\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term_unix_other.go",
    "content": "//go:build aix || linux || solaris || zos\n// +build aix linux solaris zos\n\npackage term\n\nimport \"golang.org/x/sys/unix\"\n\nconst (\n\tioctlReadTermios  = unix.TCGETS\n\tioctlWriteTermios = unix.TCSETS\n)\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/term_windows.go",
    "content": "//go:build windows\n// +build windows\n\npackage term\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\ntype state struct {\n\tMode uint32\n}\n\nfunc isTerminal(fd uintptr) bool {\n\tvar st uint32\n\terr := windows.GetConsoleMode(windows.Handle(fd), &st)\n\treturn err == nil\n}\n\nfunc makeRaw(fd uintptr) (*State, error) {\n\tvar st uint32\n\tif err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {\n\t\treturn nil, err\n\t}\n\traw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)\n\tif err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &State{state{st}}, nil\n}\n\nfunc setState(fd uintptr, state *State) error {\n\tvar mode uint32\n\tif state != nil {\n\t\tmode = state.Mode\n\t}\n\treturn windows.SetConsoleMode(windows.Handle(fd), mode)\n}\n\nfunc getState(fd uintptr) (*State, error) {\n\tvar st uint32\n\tif err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &State{state{st}}, nil\n}\n\nfunc restore(fd uintptr, state *State) error {\n\treturn windows.SetConsoleMode(windows.Handle(fd), state.Mode)\n}\n\nfunc getSize(fd uintptr) (width, height int, err error) {\n\tvar info windows.ConsoleScreenBufferInfo\n\tif err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil {\n\t\treturn 0, 0, err\n\t}\n\treturn int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil\n}\n\nfunc readPassword(fd uintptr) ([]byte, error) {\n\tvar st uint32\n\tif err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {\n\t\treturn nil, err\n\t}\n\told := st\n\n\tst &^= (windows.ENABLE_ECHO_INPUT | windows.ENABLE_LINE_INPUT)\n\tst |= (windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_PROCESSED_INPUT)\n\tif err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer windows.SetConsoleMode(windows.Handle(fd), old)\n\n\tvar h windows.Handle\n\tp, _ := windows.GetCurrentProcess()\n\tif err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {\n\t\treturn nil, err\n\t}\n\n\tf := os.NewFile(uintptr(h), \"stdin\")\n\tdefer f.Close()\n\treturn readPasswordLine(f)\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/terminal.go",
    "content": "package term\n\nimport (\n\t\"io\"\n)\n\n// File represents a file that has a file descriptor and can be read from,\n// written to, and closed.\ntype File interface {\n\tio.ReadWriteCloser\n\tFd() uintptr\n}\n"
  },
  {
    "path": "vendor/github.com/charmbracelet/x/term/util.go",
    "content": "package term\n\nimport (\n\t\"io\"\n\t\"runtime\"\n)\n\n// readPasswordLine reads from reader until it finds \\n or io.EOF.\n// The slice returned does not include the \\n.\n// readPasswordLine also ignores any \\r it finds.\n// Windows uses \\r as end of line. So, on Windows, readPasswordLine\n// reads until it finds \\r and ignores any \\n it finds during processing.\nfunc readPasswordLine(reader io.Reader) ([]byte, error) {\n\tvar buf [1]byte\n\tvar ret []byte\n\n\tfor {\n\t\tn, err := reader.Read(buf[:])\n\t\tif n > 0 {\n\t\t\tswitch buf[0] {\n\t\t\tcase '\\b':\n\t\t\t\tif len(ret) > 0 {\n\t\t\t\t\tret = ret[:len(ret)-1]\n\t\t\t\t}\n\t\t\tcase '\\n':\n\t\t\t\tif runtime.GOOS != \"windows\" {\n\t\t\t\t\treturn ret, nil\n\t\t\t\t}\n\t\t\t\t// otherwise ignore \\n\n\t\t\tcase '\\r':\n\t\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\t\treturn ret, nil\n\t\t\t\t}\n\t\t\t\t// otherwise ignore \\r\n\t\t\tdefault:\n\t\t\t\tret = append(ret, buf[0])\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tif err == io.EOF && len(ret) > 0 {\n\t\t\t\treturn ret, nil\n\t\t\t}\n\t\t\treturn ret, err\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/chrismellard/docker-credential-acr-env/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/chrismellard/docker-credential-acr-env/pkg/credhelper/helper.go",
    "content": "/*\nCopyright © 2020 Chris Mellard chris.mellard@icloud.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\npackage credhelper\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"regexp\"\n\n\t\"github.com/Azure/go-autorest/autorest/azure/auth\"\n\t\"github.com/chrismellard/docker-credential-acr-env/pkg/registry\"\n\t\"github.com/chrismellard/docker-credential-acr-env/pkg/token\"\n\t\"github.com/docker/docker-credential-helpers/credentials\"\n)\n\nvar acrRE = regexp.MustCompile(`.*\\.azurecr\\.io|.*\\.azurecr\\.cn|.*\\.azurecr\\.de|.*\\.azurecr\\.us`)\n\nconst (\n\tmcrHostname   = \"mcr.microsoft.com\"\n\ttokenUsername = \"<token>\"\n)\n\ntype ACRCredHelper struct {\n}\n\nfunc NewACRCredentialsHelper() credentials.Helper {\n\treturn &ACRCredHelper{}\n}\n\nfunc (a ACRCredHelper) Add(_ *credentials.Credentials) error {\n\treturn errors.New(\"list is unimplemented\")\n}\n\nfunc (a ACRCredHelper) Delete(_ string) error {\n\treturn errors.New(\"list is unimplemented\")\n}\n\nfunc isACRRegistry(input string) bool {\n\tserverURL, err := url.Parse(\"https://\" + input)\n\tif err != nil {\n\t\treturn false\n\t}\n\tif serverURL.Hostname() == mcrHostname {\n\t\treturn true\n\t}\n\tmatches := acrRE.FindStringSubmatch(serverURL.Hostname())\n\tif len(matches) == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (a ACRCredHelper) Get(serverURL string) (string, string, error) {\n\tif !isACRRegistry(serverURL) {\n\t\treturn \"\", \"\", errors.New(\"serverURL does not refer to Azure Container Registry\")\n\t}\n\n\tspToken, settings, err := token.GetServicePrincipalTokenFromEnvironment()\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to acquire sp token %w\", err)\n\t}\n\trefreshToken, err := registry.GetRegistryRefreshTokenFromAADExchange(serverURL, spToken, settings.Values[auth.TenantID])\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to acquire refresh token %w\", err)\n\t}\n\treturn tokenUsername, refreshToken, nil\n}\n\nfunc (a ACRCredHelper) List() (map[string]string, error) {\n\treturn nil, errors.New(\"list is unimplemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/chrismellard/docker-credential-acr-env/pkg/registry/const.go",
    "content": "/*\nCopyright © 2020 Chris Mellard chris.mellard@icloud.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\npackage registry\n\nimport (\n\t\"time\"\n)\n\nconst (\n\tsecureScheme   = \"https://\"\n\tdefaultTimeOut = time.Duration(30) * time.Second\n)\n"
  },
  {
    "path": "vendor/github.com/chrismellard/docker-credential-acr-env/pkg/registry/registry.go",
    "content": "/*\nCopyright © 2020 Chris Mellard chris.mellard@icloud.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\npackage registry\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/adal\"\n)\n\n// GetRegistryRefreshTokenFromAADExchange retrieves an OAuth2 refresh token for the registry specified by serverURL\nfunc GetRegistryRefreshTokenFromAADExchange(serverURL string, principalToken *adal.ServicePrincipalToken, tenantID string) (string, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), defaultTimeOut)\n\tdefer cancel()\n\n\t// If refreshing fails, don't try again, just fail.\n\tprincipalToken.MaxMSIRefreshAttempts = 1\n\n\tif err := principalToken.EnsureFreshWithContext(ctx); err != nil {\n\t\treturn \"\", fmt.Errorf(\"error refreshing sp token - %w\", err)\n\t}\n\n\tregistryName, err := getRegistryURL(serverURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to parse server URL - %w\", err)\n\t}\n\trefreshTokenClient := containerregistry.NewRefreshTokensClient(registryName.String())\n\tauthorizer := autorest.NewBearerAuthorizer(principalToken)\n\trefreshTokenClient.Authorizer = authorizer\n\trt, err := refreshTokenClient.GetFromExchange(ctx, \"access_token\", serverURL, tenantID, \"\", principalToken.Token().AccessToken)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get refresh token for container registry - %w\", err)\n\t}\n\n\treturn *rt.RefreshToken, nil\n}\n\n// parseRegistryName parses a serverURL and returns the registry name (i.e. minus transport scheme)\nfunc getRegistryURL(serverURL string) (*url.URL, error) {\n\tsURL, err := url.Parse(secureScheme + serverURL)\n\tif err != nil {\n\t\treturn &url.URL{}, fmt.Errorf(\"failed to parse server URL - %w\", err)\n\t}\n\n\treturn sURL, nil\n}\n"
  },
  {
    "path": "vendor/github.com/chrismellard/docker-credential-acr-env/pkg/token/token.go",
    "content": "/*\nCopyright © 2020 Chris Mellard chris.mellard@icloud.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\npackage token\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/Azure/go-autorest/autorest/adal\"\n\t\"github.com/Azure/go-autorest/autorest/azure/auth\"\n)\n\nfunc GetServicePrincipalTokenFromEnvironment() (*adal.ServicePrincipalToken, auth.EnvironmentSettings, error) {\n\tsettings, err := auth.GetSettingsFromEnvironment()\n\tif err != nil {\n\t\treturn &adal.ServicePrincipalToken{}, auth.EnvironmentSettings{}, fmt.Errorf(\"failed to get auth settings from environment - %w\", err)\n\t}\n\n\tspToken, err := getServicePrincipalToken(settings, settings.Environment.ResourceManagerEndpoint)\n\tif err != nil {\n\t\treturn &adal.ServicePrincipalToken{}, auth.EnvironmentSettings{}, fmt.Errorf(\"failed to initialise sp token config %w\", err)\n\t}\n\n\treturn spToken, settings, nil\n}\n\n// getServicePrincipalToken retrieves an Azure AD OAuth2 token from the supplied environment settings for the specified resource\nfunc getServicePrincipalToken(settings auth.EnvironmentSettings, resource string) (*adal.ServicePrincipalToken, error) {\n\n\t//1.Client Credentials\n\tif _, e := settings.GetClientCredentials(); e == nil {\n\t\tclientCredentialsConfig, err := settings.GetClientCredentials()\n\t\tif err != nil {\n\t\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"failed to get client credentials settings from environment - %w\", err)\n\t\t}\n\t\toAuthConfig, err := adal.NewOAuthConfig(settings.Environment.ActiveDirectoryEndpoint, clientCredentialsConfig.TenantID)\n\t\tif err != nil {\n\t\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"failed to initialise OAuthConfig - %w\", err)\n\t\t}\n\t\treturn adal.NewServicePrincipalToken(*oAuthConfig, clientCredentialsConfig.ClientID, clientCredentialsConfig.ClientSecret, clientCredentialsConfig.Resource)\n\t}\n\n\t//2. Client Certificate\n\tif _, e := settings.GetClientCertificate(); e == nil {\n\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"authentication method currently unsupported\")\n\t}\n\n\t//3. Username Password\n\tif _, e := settings.GetUsernamePassword(); e == nil {\n\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"authentication method currently unsupported\")\n\t}\n\n\t// federated OIDC JWT assertion\n\tjwt, err := jwtLookup()\n\tif err == nil {\n\t\tclientID, isPresent := os.LookupEnv(\"AZURE_CLIENT_ID\")\n\t\tif !isPresent {\n\t\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"failed to get client id from environment\")\n\t\t}\n\t\ttenantID, isPresent := os.LookupEnv(\"AZURE_TENANT_ID\")\n\t\tif !isPresent {\n\t\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"failed to get client id from environment\")\n\t\t}\n\n\t\toAuthConfig, err := adal.NewOAuthConfig(settings.Environment.ActiveDirectoryEndpoint, tenantID)\n\t\tif err != nil {\n\t\t\treturn &adal.ServicePrincipalToken{}, fmt.Errorf(\"failed to initialise OAuthConfig - %w\", err)\n\t\t}\n\n\t\treturn adal.NewServicePrincipalTokenFromFederatedToken(*oAuthConfig, clientID, *jwt, resource)\n\t}\n\n\t// 4. MSI\n\treturn adal.NewServicePrincipalTokenFromManagedIdentity(resource, &adal.ManagedIdentityOptions{\n\t\tClientID: os.Getenv(\"AZURE_CLIENT_ID\"),\n\t})\n}\n\nfunc jwtLookup() (*string, error) {\n\tjwt, isPresent := os.LookupEnv(\"AZURE_FEDERATED_TOKEN\")\n\tif isPresent {\n\t\treturn &jwt, nil\n\t}\n\n\tif jwtFile, isPresent := os.LookupEnv(\"AZURE_FEDERATED_TOKEN_FILE\"); isPresent {\n\t\tjwtBytes, err := os.ReadFile(jwtFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tjwt = string(jwtBytes)\n\t\treturn &jwt, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"no JWT found\")\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/LICENSE.txt",
    "content": "Copyright (c) 2023 Anmol Sethi <hi@nhooyr.io>\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/README.md",
    "content": "# websocket\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/coder/websocket.svg)](https://pkg.go.dev/github.com/coder/websocket)\n[![Go Coverage](https://img.shields.io/badge/coverage-91%25-success)](https://github.com/coder/websocket/coverage.html)\n\nwebsocket is a minimal and idiomatic WebSocket library for Go.\n\n## Install\n\n```sh\ngo get github.com/coder/websocket\n```\n\n> [!NOTE]\n> Coder now maintains this project as explained in [this blog post](https://coder.com/blog/websocket).\n> We're grateful to [nhooyr](https://github.com/nhooyr) for authoring and maintaining this project from\n> 2019 to 2024.\n\n## Highlights\n\n- Minimal and idiomatic API\n- First class [context.Context](https://blog.golang.org/context) support\n- Fully passes the WebSocket [autobahn-testsuite](https://github.com/crossbario/autobahn-testsuite)\n- [Zero dependencies](https://pkg.go.dev/github.com/coder/websocket?tab=imports)\n- JSON helpers in the [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage\n- Zero alloc reads and writes\n- Concurrent writes\n- [Close handshake](https://pkg.go.dev/github.com/coder/websocket#Conn.Close)\n- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper\n- [Ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API\n- [RFC 7692](https://tools.ietf.org/html/rfc7692) permessage-deflate compression\n- [CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections\n- Compile to [Wasm](https://pkg.go.dev/github.com/coder/websocket#hdr-Wasm)\n\n## Roadmap\n\nSee GitHub issues for minor issues but the major future enhancements are:\n\n- [ ] Perfect examples [#217](https://github.com/nhooyr/websocket/issues/217)\n- [ ] wstest.Pipe for in memory testing [#340](https://github.com/nhooyr/websocket/issues/340)\n- [ ] Ping pong heartbeat helper [#267](https://github.com/nhooyr/websocket/issues/267)\n- [ ] Ping pong instrumentation callbacks [#246](https://github.com/nhooyr/websocket/issues/246)\n- [ ] Graceful shutdown helpers [#209](https://github.com/nhooyr/websocket/issues/209)\n- [ ] Assembly for WebSocket masking [#16](https://github.com/nhooyr/websocket/issues/16)\n  - WIP at [#326](https://github.com/nhooyr/websocket/pull/326), about 3x faster\n- [ ] HTTP/2 [#4](https://github.com/nhooyr/websocket/issues/4)\n- [ ] The holy grail [#402](https://github.com/nhooyr/websocket/issues/402)\n\n## Examples\n\nFor a production quality example that demonstrates the complete API, see the\n[echo example](./internal/examples/echo).\n\nFor a full stack example, see the [chat example](./internal/examples/chat).\n\n### Server\n\n```go\nhttp.HandlerFunc(func (w http.ResponseWriter, r *http.Request) {\n\tc, err := websocket.Accept(w, r, nil)\n\tif err != nil {\n\t\t// ...\n\t}\n\tdefer c.CloseNow()\n\n\tctx, cancel := context.WithTimeout(r.Context(), time.Second*10)\n\tdefer cancel()\n\n\tvar v interface{}\n\terr = wsjson.Read(ctx, c, &v)\n\tif err != nil {\n\t\t// ...\n\t}\n\n\tlog.Printf(\"received: %v\", v)\n\n\tc.Close(websocket.StatusNormalClosure, \"\")\n})\n```\n\n### Client\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), time.Minute)\ndefer cancel()\n\nc, _, err := websocket.Dial(ctx, \"ws://localhost:8080\", nil)\nif err != nil {\n\t// ...\n}\ndefer c.CloseNow()\n\nerr = wsjson.Write(ctx, c, \"hi\")\nif err != nil {\n\t// ...\n}\n\nc.Close(websocket.StatusNormalClosure, \"\")\n```\n\n## Comparison\n\n### gorilla/websocket\n\nAdvantages of [gorilla/websocket](https://github.com/gorilla/websocket):\n\n- Mature and widely used\n- [Prepared writes](https://pkg.go.dev/github.com/gorilla/websocket#PreparedMessage)\n- Configurable [buffer sizes](https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers)\n- No extra goroutine per connection to support cancellation with context.Context. This costs github.com/coder/websocket 2 KB of memory per connection.\n  - Will be removed soon with [context.AfterFunc](https://github.com/golang/go/issues/57928). See [#411](https://github.com/nhooyr/websocket/issues/411)\n\nAdvantages of github.com/coder/websocket:\n\n- Minimal and idiomatic API\n  - Compare godoc of [github.com/coder/websocket](https://pkg.go.dev/github.com/coder/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side.\n- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper\n- Zero alloc reads and writes ([gorilla/websocket#535](https://github.com/gorilla/websocket/issues/535))\n- Full [context.Context](https://blog.golang.org/context) support\n- Dial uses [net/http.Client](https://golang.org/pkg/net/http/#Client)\n  - Will enable easy HTTP/2 support in the future\n  - Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client.\n- Concurrent writes\n- Close handshake ([gorilla/websocket#448](https://github.com/gorilla/websocket/issues/448))\n- Idiomatic [ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API\n  - Gorilla requires registering a pong callback before sending a Ping\n- Can target Wasm ([gorilla/websocket#432](https://github.com/gorilla/websocket/issues/432))\n- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage\n- [1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go\n  - Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/).\n    Soon we'll have assembly and be 3x faster [#326](https://github.com/nhooyr/websocket/pull/326)\n- Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support\n  - Gorilla only supports no context takeover mode\n- [CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492))\n\n#### golang.org/x/net/websocket\n\n[golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated.\nSee [golang/go/issues/18152](https://github.com/golang/go/issues/18152).\n\nThe [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) can help in transitioning\nto github.com/coder/websocket.\n\n#### gobwas/ws\n\n[gobwas/ws](https://github.com/gobwas/ws) has an extremely flexible API that allows it to be used\nin an event driven style for performance. See the author's [blog post](https://medium.freecodecamp.org/million-websockets-and-go-cc58418460bb).\n\nHowever it is quite bloated. See https://pkg.go.dev/github.com/gobwas/ws\n\nWhen writing idiomatic Go, github.com/coder/websocket will be faster and easier to use.\n\n#### lesismal/nbio\n\n[lesismal/nbio](https://github.com/lesismal/nbio) is similar to gobwas/ws in that the API is\nevent driven for performance reasons.\n\nHowever it is quite bloated. See https://pkg.go.dev/github.com/lesismal/nbio\n\nWhen writing idiomatic Go, github.com/coder/websocket will be faster and easier to use.\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/accept.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha1\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/textproto\"\n\t\"net/url\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n)\n\n// AcceptOptions represents Accept's options.\ntype AcceptOptions struct {\n\t// Subprotocols lists the WebSocket subprotocols that Accept will negotiate with the client.\n\t// The empty subprotocol will always be negotiated as per RFC 6455. If you would like to\n\t// reject it, close the connection when c.Subprotocol() == \"\".\n\tSubprotocols []string\n\n\t// InsecureSkipVerify is used to disable Accept's origin verification behaviour.\n\t//\n\t// You probably want to use OriginPatterns instead.\n\tInsecureSkipVerify bool\n\n\t// OriginPatterns lists the host patterns for authorized origins.\n\t// The request host is always authorized.\n\t// Use this to enable cross origin WebSockets.\n\t//\n\t// i.e javascript running on example.com wants to access a WebSocket server at chat.example.com.\n\t// In such a case, example.com is the origin and chat.example.com is the request host.\n\t// One would set this field to []string{\"example.com\"} to authorize example.com to connect.\n\t//\n\t// Each pattern is matched case insensitively against the request origin host\n\t// with filepath.Match.\n\t// See https://golang.org/pkg/path/filepath/#Match\n\t//\n\t// Please ensure you understand the ramifications of enabling this.\n\t// If used incorrectly your WebSocket server will be open to CSRF attacks.\n\t//\n\t// Do not use * as a pattern to allow any origin, prefer to use InsecureSkipVerify instead\n\t// to bring attention to the danger of such a setting.\n\tOriginPatterns []string\n\n\t// CompressionMode controls the compression mode.\n\t// Defaults to CompressionDisabled.\n\t//\n\t// See docs on CompressionMode for details.\n\tCompressionMode CompressionMode\n\n\t// CompressionThreshold controls the minimum size of a message before compression is applied.\n\t//\n\t// Defaults to 512 bytes for CompressionNoContextTakeover and 128 bytes\n\t// for CompressionContextTakeover.\n\tCompressionThreshold int\n}\n\nfunc (opts *AcceptOptions) cloneWithDefaults() *AcceptOptions {\n\tvar o AcceptOptions\n\tif opts != nil {\n\t\to = *opts\n\t}\n\treturn &o\n}\n\n// Accept accepts a WebSocket handshake from a client and upgrades the\n// the connection to a WebSocket.\n//\n// Accept will not allow cross origin requests by default.\n// See the InsecureSkipVerify and OriginPatterns options to allow cross origin requests.\n//\n// Accept will write a response to w on all errors.\nfunc Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) {\n\treturn accept(w, r, opts)\n}\n\nfunc accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Conn, err error) {\n\tdefer errd.Wrap(&err, \"failed to accept WebSocket connection\")\n\n\terrCode, err := verifyClientRequest(w, r)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), errCode)\n\t\treturn nil, err\n\t}\n\n\topts = opts.cloneWithDefaults()\n\tif !opts.InsecureSkipVerify {\n\t\terr = authenticateOrigin(r, opts.OriginPatterns)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, filepath.ErrBadPattern) {\n\t\t\t\tlog.Printf(\"websocket: %v\", err)\n\t\t\t\terr = errors.New(http.StatusText(http.StatusForbidden))\n\t\t\t}\n\t\t\thttp.Error(w, err.Error(), http.StatusForbidden)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\thj, ok := w.(http.Hijacker)\n\tif !ok {\n\t\terr = errors.New(\"http.ResponseWriter does not implement http.Hijacker\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotImplemented), http.StatusNotImplemented)\n\t\treturn nil, err\n\t}\n\n\tw.Header().Set(\"Upgrade\", \"websocket\")\n\tw.Header().Set(\"Connection\", \"Upgrade\")\n\n\tkey := r.Header.Get(\"Sec-WebSocket-Key\")\n\tw.Header().Set(\"Sec-WebSocket-Accept\", secWebSocketAccept(key))\n\n\tsubproto := selectSubprotocol(r, opts.Subprotocols)\n\tif subproto != \"\" {\n\t\tw.Header().Set(\"Sec-WebSocket-Protocol\", subproto)\n\t}\n\n\tcopts, ok := selectDeflate(websocketExtensions(r.Header), opts.CompressionMode)\n\tif ok {\n\t\tw.Header().Set(\"Sec-WebSocket-Extensions\", copts.String())\n\t}\n\n\tw.WriteHeader(http.StatusSwitchingProtocols)\n\t// See https://github.com/nhooyr/websocket/issues/166\n\tif ginWriter, ok := w.(interface {\n\t\tWriteHeaderNow()\n\t}); ok {\n\t\tginWriter.WriteHeaderNow()\n\t}\n\n\tnetConn, brw, err := hj.Hijack()\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed to hijack connection: %w\", err)\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn nil, err\n\t}\n\n\t// https://github.com/golang/go/issues/32314\n\tb, _ := brw.Reader.Peek(brw.Reader.Buffered())\n\tbrw.Reader.Reset(io.MultiReader(bytes.NewReader(b), netConn))\n\n\treturn newConn(connConfig{\n\t\tsubprotocol:    w.Header().Get(\"Sec-WebSocket-Protocol\"),\n\t\trwc:            netConn,\n\t\tclient:         false,\n\t\tcopts:          copts,\n\t\tflateThreshold: opts.CompressionThreshold,\n\n\t\tbr: brw.Reader,\n\t\tbw: brw.Writer,\n\t}), nil\n}\n\nfunc verifyClientRequest(w http.ResponseWriter, r *http.Request) (errCode int, _ error) {\n\tif !r.ProtoAtLeast(1, 1) {\n\t\treturn http.StatusUpgradeRequired, fmt.Errorf(\"WebSocket protocol violation: handshake request must be at least HTTP/1.1: %q\", r.Proto)\n\t}\n\n\tif !headerContainsTokenIgnoreCase(r.Header, \"Connection\", \"Upgrade\") {\n\t\tw.Header().Set(\"Connection\", \"Upgrade\")\n\t\tw.Header().Set(\"Upgrade\", \"websocket\")\n\t\treturn http.StatusUpgradeRequired, fmt.Errorf(\"WebSocket protocol violation: Connection header %q does not contain Upgrade\", r.Header.Get(\"Connection\"))\n\t}\n\n\tif !headerContainsTokenIgnoreCase(r.Header, \"Upgrade\", \"websocket\") {\n\t\tw.Header().Set(\"Connection\", \"Upgrade\")\n\t\tw.Header().Set(\"Upgrade\", \"websocket\")\n\t\treturn http.StatusUpgradeRequired, fmt.Errorf(\"WebSocket protocol violation: Upgrade header %q does not contain websocket\", r.Header.Get(\"Upgrade\"))\n\t}\n\n\tif r.Method != \"GET\" {\n\t\treturn http.StatusMethodNotAllowed, fmt.Errorf(\"WebSocket protocol violation: handshake request method is not GET but %q\", r.Method)\n\t}\n\n\tif r.Header.Get(\"Sec-WebSocket-Version\") != \"13\" {\n\t\tw.Header().Set(\"Sec-WebSocket-Version\", \"13\")\n\t\treturn http.StatusBadRequest, fmt.Errorf(\"unsupported WebSocket protocol version (only 13 is supported): %q\", r.Header.Get(\"Sec-WebSocket-Version\"))\n\t}\n\n\twebsocketSecKeys := r.Header.Values(\"Sec-WebSocket-Key\")\n\tif len(websocketSecKeys) == 0 {\n\t\treturn http.StatusBadRequest, errors.New(\"WebSocket protocol violation: missing Sec-WebSocket-Key\")\n\t}\n\n\tif len(websocketSecKeys) > 1 {\n\t\treturn http.StatusBadRequest, errors.New(\"WebSocket protocol violation: multiple Sec-WebSocket-Key headers\")\n\t}\n\n\t// The RFC states to remove any leading or trailing whitespace.\n\twebsocketSecKey := strings.TrimSpace(websocketSecKeys[0])\n\tif v, err := base64.StdEncoding.DecodeString(websocketSecKey); err != nil || len(v) != 16 {\n\t\treturn http.StatusBadRequest, fmt.Errorf(\"WebSocket protocol violation: invalid Sec-WebSocket-Key %q, must be a 16 byte base64 encoded string\", websocketSecKey)\n\t}\n\n\treturn 0, nil\n}\n\nfunc authenticateOrigin(r *http.Request, originHosts []string) error {\n\torigin := r.Header.Get(\"Origin\")\n\tif origin == \"\" {\n\t\treturn nil\n\t}\n\n\tu, err := url.Parse(origin)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse Origin header %q: %w\", origin, err)\n\t}\n\n\tif strings.EqualFold(r.Host, u.Host) {\n\t\treturn nil\n\t}\n\n\tfor _, hostPattern := range originHosts {\n\t\tmatched, err := match(hostPattern, u.Host)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse filepath pattern %q: %w\", hostPattern, err)\n\t\t}\n\t\tif matched {\n\t\t\treturn nil\n\t\t}\n\t}\n\tif u.Host == \"\" {\n\t\treturn fmt.Errorf(\"request Origin %q is not a valid URL with a host\", origin)\n\t}\n\treturn fmt.Errorf(\"request Origin %q is not authorized for Host %q\", u.Host, r.Host)\n}\n\nfunc match(pattern, s string) (bool, error) {\n\treturn filepath.Match(strings.ToLower(pattern), strings.ToLower(s))\n}\n\nfunc selectSubprotocol(r *http.Request, subprotocols []string) string {\n\tcps := headerTokens(r.Header, \"Sec-WebSocket-Protocol\")\n\tfor _, sp := range subprotocols {\n\t\tfor _, cp := range cps {\n\t\t\tif strings.EqualFold(sp, cp) {\n\t\t\t\treturn cp\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc selectDeflate(extensions []websocketExtension, mode CompressionMode) (*compressionOptions, bool) {\n\tif mode == CompressionDisabled {\n\t\treturn nil, false\n\t}\n\tfor _, ext := range extensions {\n\t\tswitch ext.name {\n\t\t// We used to implement x-webkit-deflate-frame too for Safari but Safari has bugs...\n\t\t// See https://github.com/nhooyr/websocket/issues/218\n\t\tcase \"permessage-deflate\":\n\t\t\tcopts, ok := acceptDeflate(ext, mode)\n\t\t\tif ok {\n\t\t\t\treturn copts, true\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, false\n}\n\nfunc acceptDeflate(ext websocketExtension, mode CompressionMode) (*compressionOptions, bool) {\n\tcopts := mode.opts()\n\tfor _, p := range ext.params {\n\t\tswitch p {\n\t\tcase \"client_no_context_takeover\":\n\t\t\tcopts.clientNoContextTakeover = true\n\t\t\tcontinue\n\t\tcase \"server_no_context_takeover\":\n\t\t\tcopts.serverNoContextTakeover = true\n\t\t\tcontinue\n\t\tcase \"client_max_window_bits\",\n\t\t\t\"server_max_window_bits=15\":\n\t\t\tcontinue\n\t\t}\n\n\t\tif strings.HasPrefix(p, \"client_max_window_bits=\") {\n\t\t\t// We can't adjust the deflate window, but decoding with a larger window is acceptable.\n\t\t\tcontinue\n\t\t}\n\t\treturn nil, false\n\t}\n\treturn copts, true\n}\n\nfunc headerContainsTokenIgnoreCase(h http.Header, key, token string) bool {\n\tfor _, t := range headerTokens(h, key) {\n\t\tif strings.EqualFold(t, token) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype websocketExtension struct {\n\tname   string\n\tparams []string\n}\n\nfunc websocketExtensions(h http.Header) []websocketExtension {\n\tvar exts []websocketExtension\n\textStrs := headerTokens(h, \"Sec-WebSocket-Extensions\")\n\tfor _, extStr := range extStrs {\n\t\tif extStr == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tvals := strings.Split(extStr, \";\")\n\t\tfor i := range vals {\n\t\t\tvals[i] = strings.TrimSpace(vals[i])\n\t\t}\n\n\t\te := websocketExtension{\n\t\t\tname:   vals[0],\n\t\t\tparams: vals[1:],\n\t\t}\n\n\t\texts = append(exts, e)\n\t}\n\treturn exts\n}\n\nfunc headerTokens(h http.Header, key string) []string {\n\tkey = textproto.CanonicalMIMEHeaderKey(key)\n\tvar tokens []string\n\tfor _, v := range h[key] {\n\t\tv = strings.TrimSpace(v)\n\t\tfor _, t := range strings.Split(v, \",\") {\n\t\t\tt = strings.TrimSpace(t)\n\t\t\ttokens = append(tokens, t)\n\t\t}\n\t}\n\treturn tokens\n}\n\nvar keyGUID = []byte(\"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\")\n\nfunc secWebSocketAccept(secWebSocketKey string) string {\n\th := sha1.New()\n\th.Write([]byte(secWebSocketKey))\n\th.Write(keyGUID)\n\n\treturn base64.StdEncoding.EncodeToString(h.Sum(nil))\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/close.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"context\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n)\n\n// StatusCode represents a WebSocket status code.\n// https://tools.ietf.org/html/rfc6455#section-7.4\ntype StatusCode int\n\n// https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number\n//\n// These are only the status codes defined by the protocol.\n//\n// You can define custom codes in the 3000-4999 range.\n// The 3000-3999 range is reserved for use by libraries, frameworks and applications.\n// The 4000-4999 range is reserved for private use.\nconst (\n\tStatusNormalClosure   StatusCode = 1000\n\tStatusGoingAway       StatusCode = 1001\n\tStatusProtocolError   StatusCode = 1002\n\tStatusUnsupportedData StatusCode = 1003\n\n\t// 1004 is reserved and so unexported.\n\tstatusReserved StatusCode = 1004\n\n\t// StatusNoStatusRcvd cannot be sent in a close message.\n\t// It is reserved for when a close message is received without\n\t// a status code.\n\tStatusNoStatusRcvd StatusCode = 1005\n\n\t// StatusAbnormalClosure is exported for use only with Wasm.\n\t// In non Wasm Go, the returned error will indicate whether the\n\t// connection was closed abnormally.\n\tStatusAbnormalClosure StatusCode = 1006\n\n\tStatusInvalidFramePayloadData StatusCode = 1007\n\tStatusPolicyViolation         StatusCode = 1008\n\tStatusMessageTooBig           StatusCode = 1009\n\tStatusMandatoryExtension      StatusCode = 1010\n\tStatusInternalError           StatusCode = 1011\n\tStatusServiceRestart          StatusCode = 1012\n\tStatusTryAgainLater           StatusCode = 1013\n\tStatusBadGateway              StatusCode = 1014\n\n\t// StatusTLSHandshake is only exported for use with Wasm.\n\t// In non Wasm Go, the returned error will indicate whether there was\n\t// a TLS handshake failure.\n\tStatusTLSHandshake StatusCode = 1015\n)\n\n// CloseError is returned when the connection is closed with a status and reason.\n//\n// Use Go 1.13's errors.As to check for this error.\n// Also see the CloseStatus helper.\ntype CloseError struct {\n\tCode   StatusCode\n\tReason string\n}\n\nfunc (ce CloseError) Error() string {\n\treturn fmt.Sprintf(\"status = %v and reason = %q\", ce.Code, ce.Reason)\n}\n\n// CloseStatus is a convenience wrapper around Go 1.13's errors.As to grab\n// the status code from a CloseError.\n//\n// -1 will be returned if the passed error is nil or not a CloseError.\nfunc CloseStatus(err error) StatusCode {\n\tvar ce CloseError\n\tif errors.As(err, &ce) {\n\t\treturn ce.Code\n\t}\n\treturn -1\n}\n\n// Close performs the WebSocket close handshake with the given status code and reason.\n//\n// It will write a WebSocket close frame with a timeout of 5s and then wait 5s for\n// the peer to send a close frame.\n// All data messages received from the peer during the close handshake will be discarded.\n//\n// The connection can only be closed once. Additional calls to Close\n// are no-ops.\n//\n// The maximum length of reason must be 125 bytes. Avoid sending a dynamic reason.\n//\n// Close will unblock all goroutines interacting with the connection once\n// complete.\nfunc (c *Conn) Close(code StatusCode, reason string) (err error) {\n\tdefer errd.Wrap(&err, \"failed to close WebSocket\")\n\n\tif !c.casClosing() {\n\t\terr = c.waitGoroutines()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn net.ErrClosed\n\t}\n\tdefer func() {\n\t\tif errors.Is(err, net.ErrClosed) {\n\t\t\terr = nil\n\t\t}\n\t}()\n\n\terr = c.closeHandshake(code, reason)\n\n\terr2 := c.close()\n\tif err == nil && err2 != nil {\n\t\terr = err2\n\t}\n\n\terr2 = c.waitGoroutines()\n\tif err == nil && err2 != nil {\n\t\terr = err2\n\t}\n\n\treturn err\n}\n\n// CloseNow closes the WebSocket connection without attempting a close handshake.\n// Use when you do not want the overhead of the close handshake.\nfunc (c *Conn) CloseNow() (err error) {\n\tdefer errd.Wrap(&err, \"failed to immediately close WebSocket\")\n\n\tif !c.casClosing() {\n\t\terr = c.waitGoroutines()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn net.ErrClosed\n\t}\n\tdefer func() {\n\t\tif errors.Is(err, net.ErrClosed) {\n\t\t\terr = nil\n\t\t}\n\t}()\n\n\terr = c.close()\n\n\terr2 := c.waitGoroutines()\n\tif err == nil && err2 != nil {\n\t\terr = err2\n\t}\n\treturn err\n}\n\nfunc (c *Conn) closeHandshake(code StatusCode, reason string) error {\n\terr := c.writeClose(code, reason)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = c.waitCloseHandshake()\n\tif CloseStatus(err) != code {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *Conn) writeClose(code StatusCode, reason string) error {\n\tce := CloseError{\n\t\tCode:   code,\n\t\tReason: reason,\n\t}\n\n\tvar p []byte\n\tvar err error\n\tif ce.Code != StatusNoStatusRcvd {\n\t\tp, err = ce.bytes()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*5)\n\tdefer cancel()\n\n\terr = c.writeControl(ctx, opClose, p)\n\t// If the connection closed as we're writing we ignore the error as we might\n\t// have written the close frame, the peer responded and then someone else read it\n\t// and closed the connection.\n\tif err != nil && !errors.Is(err, net.ErrClosed) {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *Conn) waitCloseHandshake() error {\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*5)\n\tdefer cancel()\n\n\terr := c.readMu.lock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer c.readMu.unlock()\n\n\tfor i := int64(0); i < c.msgReader.payloadLength; i++ {\n\t\t_, err := c.br.ReadByte()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfor {\n\t\th, err := c.readLoop(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor i := int64(0); i < h.payloadLength; i++ {\n\t\t\t_, err := c.br.ReadByte()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (c *Conn) waitGoroutines() error {\n\tt := time.NewTimer(time.Second * 15)\n\tdefer t.Stop()\n\n\tselect {\n\tcase <-c.timeoutLoopDone:\n\tcase <-t.C:\n\t\treturn errors.New(\"failed to wait for timeoutLoop goroutine to exit\")\n\t}\n\n\tc.closeReadMu.Lock()\n\tcloseRead := c.closeReadCtx != nil\n\tc.closeReadMu.Unlock()\n\tif closeRead {\n\t\tselect {\n\t\tcase <-c.closeReadDone:\n\t\tcase <-t.C:\n\t\t\treturn errors.New(\"failed to wait for close read goroutine to exit\")\n\t\t}\n\t}\n\n\tselect {\n\tcase <-c.closed:\n\tcase <-t.C:\n\t\treturn errors.New(\"failed to wait for connection to be closed\")\n\t}\n\n\treturn nil\n}\n\nfunc parseClosePayload(p []byte) (CloseError, error) {\n\tif len(p) == 0 {\n\t\treturn CloseError{\n\t\t\tCode: StatusNoStatusRcvd,\n\t\t}, nil\n\t}\n\n\tif len(p) < 2 {\n\t\treturn CloseError{}, fmt.Errorf(\"close payload %q too small, cannot even contain the 2 byte status code\", p)\n\t}\n\n\tce := CloseError{\n\t\tCode:   StatusCode(binary.BigEndian.Uint16(p)),\n\t\tReason: string(p[2:]),\n\t}\n\n\tif !validWireCloseCode(ce.Code) {\n\t\treturn CloseError{}, fmt.Errorf(\"invalid status code %v\", ce.Code)\n\t}\n\n\treturn ce, nil\n}\n\n// See http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number\n// and https://tools.ietf.org/html/rfc6455#section-7.4.1\nfunc validWireCloseCode(code StatusCode) bool {\n\tswitch code {\n\tcase statusReserved, StatusNoStatusRcvd, StatusAbnormalClosure, StatusTLSHandshake:\n\t\treturn false\n\t}\n\n\tif code >= StatusNormalClosure && code <= StatusBadGateway {\n\t\treturn true\n\t}\n\tif code >= 3000 && code <= 4999 {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc (ce CloseError) bytes() ([]byte, error) {\n\tp, err := ce.bytesErr()\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed to marshal close frame: %w\", err)\n\t\tce = CloseError{\n\t\t\tCode: StatusInternalError,\n\t\t}\n\t\tp, _ = ce.bytesErr()\n\t}\n\treturn p, err\n}\n\nconst maxCloseReason = maxControlPayload - 2\n\nfunc (ce CloseError) bytesErr() ([]byte, error) {\n\tif len(ce.Reason) > maxCloseReason {\n\t\treturn nil, fmt.Errorf(\"reason string max is %v but got %q with length %v\", maxCloseReason, ce.Reason, len(ce.Reason))\n\t}\n\n\tif !validWireCloseCode(ce.Code) {\n\t\treturn nil, fmt.Errorf(\"status code %v cannot be set\", ce.Code)\n\t}\n\n\tbuf := make([]byte, 2+len(ce.Reason))\n\tbinary.BigEndian.PutUint16(buf, uint16(ce.Code))\n\tcopy(buf[2:], ce.Reason)\n\treturn buf, nil\n}\n\nfunc (c *Conn) casClosing() bool {\n\tc.closeMu.Lock()\n\tdefer c.closeMu.Unlock()\n\tif !c.closing {\n\t\tc.closing = true\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (c *Conn) isClosed() bool {\n\tselect {\n\tcase <-c.closed:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/compress.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"compress/flate\"\n\t\"io\"\n\t\"sync\"\n)\n\n// CompressionMode represents the modes available to the permessage-deflate extension.\n// See https://tools.ietf.org/html/rfc7692\n//\n// Works in all modern browsers except Safari which does not implement the permessage-deflate extension.\n//\n// Compression is only used if the peer supports the mode selected.\ntype CompressionMode int\n\nconst (\n\t// CompressionDisabled disables the negotiation of the permessage-deflate extension.\n\t//\n\t// This is the default. Do not enable compression without benchmarking for your particular use case first.\n\tCompressionDisabled CompressionMode = iota\n\n\t// CompressionContextTakeover compresses each message greater than 128 bytes reusing the 32 KB sliding window from\n\t// previous messages. i.e compression context across messages is preserved.\n\t//\n\t// As most WebSocket protocols are text based and repetitive, this compression mode can be very efficient.\n\t//\n\t// The memory overhead is a fixed 32 KB sliding window, a fixed 1.2 MB flate.Writer and a sync.Pool of 40 KB flate.Reader's\n\t// that are used when reading and then returned.\n\t//\n\t// Thus, it uses more memory than CompressionNoContextTakeover but compresses more efficiently.\n\t//\n\t// If the peer does not support CompressionContextTakeover then we will fall back to CompressionNoContextTakeover.\n\tCompressionContextTakeover\n\n\t// CompressionNoContextTakeover compresses each message greater than 512 bytes. Each message is compressed with\n\t// a new 1.2 MB flate.Writer pulled from a sync.Pool. Each message is read with a 40 KB flate.Reader pulled from\n\t// a sync.Pool.\n\t//\n\t// This means less efficient compression as the sliding window from previous messages will not be used but the\n\t// memory overhead will be lower as there will be no fixed cost for the flate.Writer nor the 32 KB sliding window.\n\t// Especially if the connections are long lived and seldom written to.\n\t//\n\t// Thus, it uses less memory than CompressionContextTakeover but compresses less efficiently.\n\t//\n\t// If the peer does not support CompressionNoContextTakeover then we will fall back to CompressionDisabled.\n\tCompressionNoContextTakeover\n)\n\nfunc (m CompressionMode) opts() *compressionOptions {\n\treturn &compressionOptions{\n\t\tclientNoContextTakeover: m == CompressionNoContextTakeover,\n\t\tserverNoContextTakeover: m == CompressionNoContextTakeover,\n\t}\n}\n\ntype compressionOptions struct {\n\tclientNoContextTakeover bool\n\tserverNoContextTakeover bool\n}\n\nfunc (copts *compressionOptions) String() string {\n\ts := \"permessage-deflate\"\n\tif copts.clientNoContextTakeover {\n\t\ts += \"; client_no_context_takeover\"\n\t}\n\tif copts.serverNoContextTakeover {\n\t\ts += \"; server_no_context_takeover\"\n\t}\n\treturn s\n}\n\n// These bytes are required to get flate.Reader to return.\n// They are removed when sending to avoid the overhead as\n// WebSocket framing tell's when the message has ended but then\n// we need to add them back otherwise flate.Reader keeps\n// trying to read more bytes.\nconst deflateMessageTail = \"\\x00\\x00\\xff\\xff\"\n\ntype trimLastFourBytesWriter struct {\n\tw    io.Writer\n\ttail []byte\n}\n\nfunc (tw *trimLastFourBytesWriter) reset() {\n\tif tw != nil && tw.tail != nil {\n\t\ttw.tail = tw.tail[:0]\n\t}\n}\n\nfunc (tw *trimLastFourBytesWriter) Write(p []byte) (int, error) {\n\tif tw.tail == nil {\n\t\ttw.tail = make([]byte, 0, 4)\n\t}\n\n\textra := len(tw.tail) + len(p) - 4\n\n\tif extra <= 0 {\n\t\ttw.tail = append(tw.tail, p...)\n\t\treturn len(p), nil\n\t}\n\n\t// Now we need to write as many extra bytes as we can from the previous tail.\n\tif extra > len(tw.tail) {\n\t\textra = len(tw.tail)\n\t}\n\tif extra > 0 {\n\t\t_, err := tw.w.Write(tw.tail[:extra])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// Shift remaining bytes in tail over.\n\t\tn := copy(tw.tail, tw.tail[extra:])\n\t\ttw.tail = tw.tail[:n]\n\t}\n\n\t// If p is less than or equal to 4 bytes,\n\t// all of it is is part of the tail.\n\tif len(p) <= 4 {\n\t\ttw.tail = append(tw.tail, p...)\n\t\treturn len(p), nil\n\t}\n\n\t// Otherwise, only the last 4 bytes are.\n\ttw.tail = append(tw.tail, p[len(p)-4:]...)\n\n\tp = p[:len(p)-4]\n\tn, err := tw.w.Write(p)\n\treturn n + 4, err\n}\n\nvar flateReaderPool sync.Pool\n\nfunc getFlateReader(r io.Reader, dict []byte) io.Reader {\n\tfr, ok := flateReaderPool.Get().(io.Reader)\n\tif !ok {\n\t\treturn flate.NewReaderDict(r, dict)\n\t}\n\tfr.(flate.Resetter).Reset(r, dict)\n\treturn fr\n}\n\nfunc putFlateReader(fr io.Reader) {\n\tflateReaderPool.Put(fr)\n}\n\nvar flateWriterPool sync.Pool\n\nfunc getFlateWriter(w io.Writer) *flate.Writer {\n\tfw, ok := flateWriterPool.Get().(*flate.Writer)\n\tif !ok {\n\t\tfw, _ = flate.NewWriter(w, flate.BestSpeed)\n\t\treturn fw\n\t}\n\tfw.Reset(w)\n\treturn fw\n}\n\nfunc putFlateWriter(w *flate.Writer) {\n\tflateWriterPool.Put(w)\n}\n\ntype slidingWindow struct {\n\tbuf []byte\n}\n\nvar swPoolMu sync.RWMutex\nvar swPool = map[int]*sync.Pool{}\n\nfunc slidingWindowPool(n int) *sync.Pool {\n\tswPoolMu.RLock()\n\tp, ok := swPool[n]\n\tswPoolMu.RUnlock()\n\tif ok {\n\t\treturn p\n\t}\n\n\tp = &sync.Pool{}\n\n\tswPoolMu.Lock()\n\tswPool[n] = p\n\tswPoolMu.Unlock()\n\n\treturn p\n}\n\nfunc (sw *slidingWindow) init(n int) {\n\tif sw.buf != nil {\n\t\treturn\n\t}\n\n\tif n == 0 {\n\t\tn = 32768\n\t}\n\n\tp := slidingWindowPool(n)\n\tsw2, ok := p.Get().(*slidingWindow)\n\tif ok {\n\t\t*sw = *sw2\n\t} else {\n\t\tsw.buf = make([]byte, 0, n)\n\t}\n}\n\nfunc (sw *slidingWindow) close() {\n\tsw.buf = sw.buf[:0]\n\tswPoolMu.Lock()\n\tswPool[cap(sw.buf)].Put(sw)\n\tswPoolMu.Unlock()\n}\n\nfunc (sw *slidingWindow) write(p []byte) {\n\tif len(p) >= cap(sw.buf) {\n\t\tsw.buf = sw.buf[:cap(sw.buf)]\n\t\tp = p[len(p)-cap(sw.buf):]\n\t\tcopy(sw.buf, p)\n\t\treturn\n\t}\n\n\tleft := cap(sw.buf) - len(sw.buf)\n\tif left < len(p) {\n\t\t// We need to shift spaceNeeded bytes from the end to make room for p at the end.\n\t\tspaceNeeded := len(p) - left\n\t\tcopy(sw.buf, sw.buf[spaceNeeded:])\n\t\tsw.buf = sw.buf[:len(sw.buf)-spaceNeeded]\n\t}\n\n\tsw.buf = append(sw.buf, p...)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/conn.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"sync\"\n\t\"sync/atomic\"\n)\n\n// MessageType represents the type of a WebSocket message.\n// See https://tools.ietf.org/html/rfc6455#section-5.6\ntype MessageType int\n\n// MessageType constants.\nconst (\n\t// MessageText is for UTF-8 encoded text messages like JSON.\n\tMessageText MessageType = iota + 1\n\t// MessageBinary is for binary messages like protobufs.\n\tMessageBinary\n)\n\n// Conn represents a WebSocket connection.\n// All methods may be called concurrently except for Reader and Read.\n//\n// You must always read from the connection. Otherwise control\n// frames will not be handled. See Reader and CloseRead.\n//\n// Be sure to call Close on the connection when you\n// are finished with it to release associated resources.\n//\n// On any error from any method, the connection is closed\n// with an appropriate reason.\n//\n// This applies to context expirations as well unfortunately.\n// See https://github.com/nhooyr/websocket/issues/242#issuecomment-633182220\ntype Conn struct {\n\tnoCopy noCopy\n\n\tsubprotocol    string\n\trwc            io.ReadWriteCloser\n\tclient         bool\n\tcopts          *compressionOptions\n\tflateThreshold int\n\tbr             *bufio.Reader\n\tbw             *bufio.Writer\n\n\treadTimeout     chan context.Context\n\twriteTimeout    chan context.Context\n\ttimeoutLoopDone chan struct{}\n\n\t// Read state.\n\treadMu         *mu\n\treadHeaderBuf  [8]byte\n\treadControlBuf [maxControlPayload]byte\n\tmsgReader      *msgReader\n\n\t// Write state.\n\tmsgWriter      *msgWriter\n\twriteFrameMu   *mu\n\twriteBuf       []byte\n\twriteHeaderBuf [8]byte\n\twriteHeader    header\n\n\tcloseReadMu   sync.Mutex\n\tcloseReadCtx  context.Context\n\tcloseReadDone chan struct{}\n\n\tclosed  chan struct{}\n\tcloseMu sync.Mutex\n\tclosing bool\n\n\tpingCounter   int32\n\tactivePingsMu sync.Mutex\n\tactivePings   map[string]chan<- struct{}\n}\n\ntype connConfig struct {\n\tsubprotocol    string\n\trwc            io.ReadWriteCloser\n\tclient         bool\n\tcopts          *compressionOptions\n\tflateThreshold int\n\n\tbr *bufio.Reader\n\tbw *bufio.Writer\n}\n\nfunc newConn(cfg connConfig) *Conn {\n\tc := &Conn{\n\t\tsubprotocol:    cfg.subprotocol,\n\t\trwc:            cfg.rwc,\n\t\tclient:         cfg.client,\n\t\tcopts:          cfg.copts,\n\t\tflateThreshold: cfg.flateThreshold,\n\n\t\tbr: cfg.br,\n\t\tbw: cfg.bw,\n\n\t\treadTimeout:     make(chan context.Context),\n\t\twriteTimeout:    make(chan context.Context),\n\t\ttimeoutLoopDone: make(chan struct{}),\n\n\t\tclosed:      make(chan struct{}),\n\t\tactivePings: make(map[string]chan<- struct{}),\n\t}\n\n\tc.readMu = newMu(c)\n\tc.writeFrameMu = newMu(c)\n\n\tc.msgReader = newMsgReader(c)\n\n\tc.msgWriter = newMsgWriter(c)\n\tif c.client {\n\t\tc.writeBuf = extractBufioWriterBuf(c.bw, c.rwc)\n\t}\n\n\tif c.flate() && c.flateThreshold == 0 {\n\t\tc.flateThreshold = 128\n\t\tif !c.msgWriter.flateContextTakeover() {\n\t\t\tc.flateThreshold = 512\n\t\t}\n\t}\n\n\truntime.SetFinalizer(c, func(c *Conn) {\n\t\tc.close()\n\t})\n\n\tgo c.timeoutLoop()\n\n\treturn c\n}\n\n// Subprotocol returns the negotiated subprotocol.\n// An empty string means the default protocol.\nfunc (c *Conn) Subprotocol() string {\n\treturn c.subprotocol\n}\n\nfunc (c *Conn) close() error {\n\tc.closeMu.Lock()\n\tdefer c.closeMu.Unlock()\n\n\tif c.isClosed() {\n\t\treturn net.ErrClosed\n\t}\n\truntime.SetFinalizer(c, nil)\n\tclose(c.closed)\n\n\t// Have to close after c.closed is closed to ensure any goroutine that wakes up\n\t// from the connection being closed also sees that c.closed is closed and returns\n\t// closeErr.\n\terr := c.rwc.Close()\n\t// With the close of rwc, these become safe to close.\n\tc.msgWriter.close()\n\tc.msgReader.close()\n\treturn err\n}\n\nfunc (c *Conn) timeoutLoop() {\n\tdefer close(c.timeoutLoopDone)\n\n\treadCtx := context.Background()\n\twriteCtx := context.Background()\n\n\tfor {\n\t\tselect {\n\t\tcase <-c.closed:\n\t\t\treturn\n\n\t\tcase writeCtx = <-c.writeTimeout:\n\t\tcase readCtx = <-c.readTimeout:\n\n\t\tcase <-readCtx.Done():\n\t\t\tc.close()\n\t\t\treturn\n\t\tcase <-writeCtx.Done():\n\t\t\tc.close()\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (c *Conn) flate() bool {\n\treturn c.copts != nil\n}\n\n// Ping sends a ping to the peer and waits for a pong.\n// Use this to measure latency or ensure the peer is responsive.\n// Ping must be called concurrently with Reader as it does\n// not read from the connection but instead waits for a Reader call\n// to read the pong.\n//\n// TCP Keepalives should suffice for most use cases.\nfunc (c *Conn) Ping(ctx context.Context) error {\n\tp := atomic.AddInt32(&c.pingCounter, 1)\n\n\terr := c.ping(ctx, strconv.Itoa(int(p)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to ping: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (c *Conn) ping(ctx context.Context, p string) error {\n\tpong := make(chan struct{}, 1)\n\n\tc.activePingsMu.Lock()\n\tc.activePings[p] = pong\n\tc.activePingsMu.Unlock()\n\n\tdefer func() {\n\t\tc.activePingsMu.Lock()\n\t\tdelete(c.activePings, p)\n\t\tc.activePingsMu.Unlock()\n\t}()\n\n\terr := c.writeControl(ctx, opPing, []byte(p))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tselect {\n\tcase <-c.closed:\n\t\treturn net.ErrClosed\n\tcase <-ctx.Done():\n\t\treturn fmt.Errorf(\"failed to wait for pong: %w\", ctx.Err())\n\tcase <-pong:\n\t\treturn nil\n\t}\n}\n\ntype mu struct {\n\tc  *Conn\n\tch chan struct{}\n}\n\nfunc newMu(c *Conn) *mu {\n\treturn &mu{\n\t\tc:  c,\n\t\tch: make(chan struct{}, 1),\n\t}\n}\n\nfunc (m *mu) forceLock() {\n\tm.ch <- struct{}{}\n}\n\nfunc (m *mu) tryLock() bool {\n\tselect {\n\tcase m.ch <- struct{}{}:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (m *mu) lock(ctx context.Context) error {\n\tselect {\n\tcase <-m.c.closed:\n\t\treturn net.ErrClosed\n\tcase <-ctx.Done():\n\t\treturn fmt.Errorf(\"failed to acquire lock: %w\", ctx.Err())\n\tcase m.ch <- struct{}{}:\n\t\t// To make sure the connection is certainly alive.\n\t\t// As it's possible the send on m.ch was selected\n\t\t// over the receive on closed.\n\t\tselect {\n\t\tcase <-m.c.closed:\n\t\t\t// Make sure to release.\n\t\t\tm.unlock()\n\t\t\treturn net.ErrClosed\n\t\tdefault:\n\t\t}\n\t\treturn nil\n\t}\n}\n\nfunc (m *mu) unlock() {\n\tselect {\n\tcase <-m.ch:\n\tdefault:\n\t}\n}\n\ntype noCopy struct{}\n\nfunc (*noCopy) Lock() {}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/dial.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n)\n\n// DialOptions represents Dial's options.\ntype DialOptions struct {\n\t// HTTPClient is used for the connection.\n\t// Its Transport must return writable bodies for WebSocket handshakes.\n\t// http.Transport does beginning with Go 1.12.\n\tHTTPClient *http.Client\n\n\t// HTTPHeader specifies the HTTP headers included in the handshake request.\n\tHTTPHeader http.Header\n\n\t// Host optionally overrides the Host HTTP header to send. If empty, the value\n\t// of URL.Host will be used.\n\tHost string\n\n\t// Subprotocols lists the WebSocket subprotocols to negotiate with the server.\n\tSubprotocols []string\n\n\t// CompressionMode controls the compression mode.\n\t// Defaults to CompressionDisabled.\n\t//\n\t// See docs on CompressionMode for details.\n\tCompressionMode CompressionMode\n\n\t// CompressionThreshold controls the minimum size of a message before compression is applied.\n\t//\n\t// Defaults to 512 bytes for CompressionNoContextTakeover and 128 bytes\n\t// for CompressionContextTakeover.\n\tCompressionThreshold int\n}\n\nfunc (opts *DialOptions) cloneWithDefaults(ctx context.Context) (context.Context, context.CancelFunc, *DialOptions) {\n\tvar cancel context.CancelFunc\n\n\tvar o DialOptions\n\tif opts != nil {\n\t\to = *opts\n\t}\n\tif o.HTTPClient == nil {\n\t\to.HTTPClient = http.DefaultClient\n\t}\n\tif o.HTTPClient.Timeout > 0 {\n\t\tctx, cancel = context.WithTimeout(ctx, o.HTTPClient.Timeout)\n\n\t\tnewClient := *o.HTTPClient\n\t\tnewClient.Timeout = 0\n\t\to.HTTPClient = &newClient\n\t}\n\tif o.HTTPHeader == nil {\n\t\to.HTTPHeader = http.Header{}\n\t}\n\tnewClient := *o.HTTPClient\n\toldCheckRedirect := o.HTTPClient.CheckRedirect\n\tnewClient.CheckRedirect = func(req *http.Request, via []*http.Request) error {\n\t\tswitch req.URL.Scheme {\n\t\tcase \"ws\":\n\t\t\treq.URL.Scheme = \"http\"\n\t\tcase \"wss\":\n\t\t\treq.URL.Scheme = \"https\"\n\t\t}\n\t\tif oldCheckRedirect != nil {\n\t\t\treturn oldCheckRedirect(req, via)\n\t\t}\n\t\treturn nil\n\t}\n\to.HTTPClient = &newClient\n\n\treturn ctx, cancel, &o\n}\n\n// Dial performs a WebSocket handshake on url.\n//\n// The response is the WebSocket handshake response from the server.\n// You never need to close resp.Body yourself.\n//\n// If an error occurs, the returned response may be non nil.\n// However, you can only read the first 1024 bytes of the body.\n//\n// This function requires at least Go 1.12 as it uses a new feature\n// in net/http to perform WebSocket handshakes.\n// See docs on the HTTPClient option and https://github.com/golang/go/issues/26937#issuecomment-415855861\n//\n// URLs with http/https schemes will work and are interpreted as ws/wss.\nfunc Dial(ctx context.Context, u string, opts *DialOptions) (*Conn, *http.Response, error) {\n\treturn dial(ctx, u, opts, nil)\n}\n\nfunc dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) (_ *Conn, _ *http.Response, err error) {\n\tdefer errd.Wrap(&err, \"failed to WebSocket dial\")\n\n\tvar cancel context.CancelFunc\n\tctx, cancel, opts = opts.cloneWithDefaults(ctx)\n\tif cancel != nil {\n\t\tdefer cancel()\n\t}\n\n\tsecWebSocketKey, err := secWebSocketKey(rand)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to generate Sec-WebSocket-Key: %w\", err)\n\t}\n\n\tvar copts *compressionOptions\n\tif opts.CompressionMode != CompressionDisabled {\n\t\tcopts = opts.CompressionMode.opts()\n\t}\n\n\tresp, err := handshakeRequest(ctx, urls, opts, copts, secWebSocketKey)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\trespBody := resp.Body\n\tresp.Body = nil\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// We read a bit of the body for easier debugging.\n\t\t\tr := io.LimitReader(respBody, 1024)\n\n\t\t\ttimer := time.AfterFunc(time.Second*3, func() {\n\t\t\t\trespBody.Close()\n\t\t\t})\n\t\t\tdefer timer.Stop()\n\n\t\t\tb, _ := io.ReadAll(r)\n\t\t\trespBody.Close()\n\t\t\tresp.Body = io.NopCloser(bytes.NewReader(b))\n\t\t}\n\t}()\n\n\tcopts, err = verifyServerResponse(opts, copts, secWebSocketKey, resp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\trwc, ok := respBody.(io.ReadWriteCloser)\n\tif !ok {\n\t\treturn nil, resp, fmt.Errorf(\"response body is not a io.ReadWriteCloser: %T\", respBody)\n\t}\n\n\treturn newConn(connConfig{\n\t\tsubprotocol:    resp.Header.Get(\"Sec-WebSocket-Protocol\"),\n\t\trwc:            rwc,\n\t\tclient:         true,\n\t\tcopts:          copts,\n\t\tflateThreshold: opts.CompressionThreshold,\n\t\tbr:             getBufioReader(rwc),\n\t\tbw:             getBufioWriter(rwc),\n\t}), resp, nil\n}\n\nfunc handshakeRequest(ctx context.Context, urls string, opts *DialOptions, copts *compressionOptions, secWebSocketKey string) (*http.Response, error) {\n\tu, err := url.Parse(urls)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse url: %w\", err)\n\t}\n\n\tswitch u.Scheme {\n\tcase \"ws\":\n\t\tu.Scheme = \"http\"\n\tcase \"wss\":\n\t\tu.Scheme = \"https\"\n\tcase \"http\", \"https\":\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unexpected url scheme: %q\", u.Scheme)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new http request: %w\", err)\n\t}\n\tif len(opts.Host) > 0 {\n\t\treq.Host = opts.Host\n\t}\n\treq.Header = opts.HTTPHeader.Clone()\n\treq.Header.Set(\"Connection\", \"Upgrade\")\n\treq.Header.Set(\"Upgrade\", \"websocket\")\n\treq.Header.Set(\"Sec-WebSocket-Version\", \"13\")\n\treq.Header.Set(\"Sec-WebSocket-Key\", secWebSocketKey)\n\tif len(opts.Subprotocols) > 0 {\n\t\treq.Header.Set(\"Sec-WebSocket-Protocol\", strings.Join(opts.Subprotocols, \",\"))\n\t}\n\tif copts != nil {\n\t\treq.Header.Set(\"Sec-WebSocket-Extensions\", copts.String())\n\t}\n\n\tresp, err := opts.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to send handshake request: %w\", err)\n\t}\n\treturn resp, nil\n}\n\nfunc secWebSocketKey(rr io.Reader) (string, error) {\n\tif rr == nil {\n\t\trr = rand.Reader\n\t}\n\tb := make([]byte, 16)\n\t_, err := io.ReadFull(rr, b)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to read random data from rand.Reader: %w\", err)\n\t}\n\treturn base64.StdEncoding.EncodeToString(b), nil\n}\n\nfunc verifyServerResponse(opts *DialOptions, copts *compressionOptions, secWebSocketKey string, resp *http.Response) (*compressionOptions, error) {\n\tif resp.StatusCode != http.StatusSwitchingProtocols {\n\t\treturn nil, fmt.Errorf(\"expected handshake response status code %v but got %v\", http.StatusSwitchingProtocols, resp.StatusCode)\n\t}\n\n\tif !headerContainsTokenIgnoreCase(resp.Header, \"Connection\", \"Upgrade\") {\n\t\treturn nil, fmt.Errorf(\"WebSocket protocol violation: Connection header %q does not contain Upgrade\", resp.Header.Get(\"Connection\"))\n\t}\n\n\tif !headerContainsTokenIgnoreCase(resp.Header, \"Upgrade\", \"WebSocket\") {\n\t\treturn nil, fmt.Errorf(\"WebSocket protocol violation: Upgrade header %q does not contain websocket\", resp.Header.Get(\"Upgrade\"))\n\t}\n\n\tif resp.Header.Get(\"Sec-WebSocket-Accept\") != secWebSocketAccept(secWebSocketKey) {\n\t\treturn nil, fmt.Errorf(\"WebSocket protocol violation: invalid Sec-WebSocket-Accept %q, key %q\",\n\t\t\tresp.Header.Get(\"Sec-WebSocket-Accept\"),\n\t\t\tsecWebSocketKey,\n\t\t)\n\t}\n\n\terr := verifySubprotocol(opts.Subprotocols, resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn verifyServerExtensions(copts, resp.Header)\n}\n\nfunc verifySubprotocol(subprotos []string, resp *http.Response) error {\n\tproto := resp.Header.Get(\"Sec-WebSocket-Protocol\")\n\tif proto == \"\" {\n\t\treturn nil\n\t}\n\n\tfor _, sp2 := range subprotos {\n\t\tif strings.EqualFold(sp2, proto) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"WebSocket protocol violation: unexpected Sec-WebSocket-Protocol from server: %q\", proto)\n}\n\nfunc verifyServerExtensions(copts *compressionOptions, h http.Header) (*compressionOptions, error) {\n\texts := websocketExtensions(h)\n\tif len(exts) == 0 {\n\t\treturn nil, nil\n\t}\n\n\text := exts[0]\n\tif ext.name != \"permessage-deflate\" || len(exts) > 1 || copts == nil {\n\t\treturn nil, fmt.Errorf(\"WebSocket protcol violation: unsupported extensions from server: %+v\", exts[1:])\n\t}\n\n\t_copts := *copts\n\tcopts = &_copts\n\n\tfor _, p := range ext.params {\n\t\tswitch p {\n\t\tcase \"client_no_context_takeover\":\n\t\t\tcopts.clientNoContextTakeover = true\n\t\t\tcontinue\n\t\tcase \"server_no_context_takeover\":\n\t\t\tcopts.serverNoContextTakeover = true\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(p, \"server_max_window_bits=\") {\n\t\t\t// We can't adjust the deflate window, but decoding with a larger window is acceptable.\n\t\t\tcontinue\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"unsupported permessage-deflate parameter: %q\", p)\n\t}\n\n\treturn copts, nil\n}\n\nvar bufioReaderPool sync.Pool\n\nfunc getBufioReader(r io.Reader) *bufio.Reader {\n\tbr, ok := bufioReaderPool.Get().(*bufio.Reader)\n\tif !ok {\n\t\treturn bufio.NewReader(r)\n\t}\n\tbr.Reset(r)\n\treturn br\n}\n\nfunc putBufioReader(br *bufio.Reader) {\n\tbufioReaderPool.Put(br)\n}\n\nvar bufioWriterPool sync.Pool\n\nfunc getBufioWriter(w io.Writer) *bufio.Writer {\n\tbw, ok := bufioWriterPool.Get().(*bufio.Writer)\n\tif !ok {\n\t\treturn bufio.NewWriter(w)\n\t}\n\tbw.Reset(w)\n\treturn bw\n}\n\nfunc putBufioWriter(bw *bufio.Writer) {\n\tbufioWriterPool.Put(bw)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/doc.go",
    "content": "//go:build !js\n// +build !js\n\n// Package websocket implements the RFC 6455 WebSocket protocol.\n//\n// https://tools.ietf.org/html/rfc6455\n//\n// Use Dial to dial a WebSocket server.\n//\n// Use Accept to accept a WebSocket client.\n//\n// Conn represents the resulting WebSocket connection.\n//\n// The examples are the best way to understand how to correctly use the library.\n//\n// The wsjson subpackage contain helpers for JSON and protobuf messages.\n//\n// More documentation at https://github.com/coder/websocket.\n//\n// # Wasm\n//\n// The client side supports compiling to Wasm.\n// It wraps the WebSocket browser API.\n//\n// See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n//\n// Some important caveats to be aware of:\n//\n//   - Accept always errors out\n//   - Conn.Ping is no-op\n//   - Conn.CloseNow is Close(StatusGoingAway, \"\")\n//   - HTTPClient, HTTPHeader and CompressionMode in DialOptions are no-op\n//   - *http.Response from Dial is &http.Response{} with a 101 status code on success\npackage websocket // import \"github.com/coder/websocket\"\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/frame.go",
    "content": "//go:build !js\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n)\n\n// opcode represents a WebSocket opcode.\ntype opcode int\n\n// https://tools.ietf.org/html/rfc6455#section-11.8.\nconst (\n\topContinuation opcode = iota\n\topText\n\topBinary\n\t// 3 - 7 are reserved for further non-control frames.\n\t_\n\t_\n\t_\n\t_\n\t_\n\topClose\n\topPing\n\topPong\n\t// 11-16 are reserved for further control frames.\n)\n\n// header represents a WebSocket frame header.\n// See https://tools.ietf.org/html/rfc6455#section-5.2.\ntype header struct {\n\tfin    bool\n\trsv1   bool\n\trsv2   bool\n\trsv3   bool\n\topcode opcode\n\n\tpayloadLength int64\n\n\tmasked  bool\n\tmaskKey uint32\n}\n\n// readFrameHeader reads a header from the reader.\n// See https://tools.ietf.org/html/rfc6455#section-5.2.\nfunc readFrameHeader(r *bufio.Reader, readBuf []byte) (h header, err error) {\n\tdefer errd.Wrap(&err, \"failed to read frame header\")\n\n\tb, err := r.ReadByte()\n\tif err != nil {\n\t\treturn header{}, err\n\t}\n\n\th.fin = b&(1<<7) != 0\n\th.rsv1 = b&(1<<6) != 0\n\th.rsv2 = b&(1<<5) != 0\n\th.rsv3 = b&(1<<4) != 0\n\n\th.opcode = opcode(b & 0xf)\n\n\tb, err = r.ReadByte()\n\tif err != nil {\n\t\treturn header{}, err\n\t}\n\n\th.masked = b&(1<<7) != 0\n\n\tpayloadLength := b &^ (1 << 7)\n\tswitch {\n\tcase payloadLength < 126:\n\t\th.payloadLength = int64(payloadLength)\n\tcase payloadLength == 126:\n\t\t_, err = io.ReadFull(r, readBuf[:2])\n\t\th.payloadLength = int64(binary.BigEndian.Uint16(readBuf))\n\tcase payloadLength == 127:\n\t\t_, err = io.ReadFull(r, readBuf)\n\t\th.payloadLength = int64(binary.BigEndian.Uint64(readBuf))\n\t}\n\tif err != nil {\n\t\treturn header{}, err\n\t}\n\n\tif h.payloadLength < 0 {\n\t\treturn header{}, fmt.Errorf(\"received negative payload length: %v\", h.payloadLength)\n\t}\n\n\tif h.masked {\n\t\t_, err = io.ReadFull(r, readBuf[:4])\n\t\tif err != nil {\n\t\t\treturn header{}, err\n\t\t}\n\t\th.maskKey = binary.LittleEndian.Uint32(readBuf)\n\t}\n\n\treturn h, nil\n}\n\n// maxControlPayload is the maximum length of a control frame payload.\n// See https://tools.ietf.org/html/rfc6455#section-5.5.\nconst maxControlPayload = 125\n\n// writeFrameHeader writes the bytes of the header to w.\n// See https://tools.ietf.org/html/rfc6455#section-5.2\nfunc writeFrameHeader(h header, w *bufio.Writer, buf []byte) (err error) {\n\tdefer errd.Wrap(&err, \"failed to write frame header\")\n\n\tvar b byte\n\tif h.fin {\n\t\tb |= 1 << 7\n\t}\n\tif h.rsv1 {\n\t\tb |= 1 << 6\n\t}\n\tif h.rsv2 {\n\t\tb |= 1 << 5\n\t}\n\tif h.rsv3 {\n\t\tb |= 1 << 4\n\t}\n\n\tb |= byte(h.opcode)\n\n\terr = w.WriteByte(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlengthByte := byte(0)\n\tif h.masked {\n\t\tlengthByte |= 1 << 7\n\t}\n\n\tswitch {\n\tcase h.payloadLength > math.MaxUint16:\n\t\tlengthByte |= 127\n\tcase h.payloadLength > 125:\n\t\tlengthByte |= 126\n\tcase h.payloadLength >= 0:\n\t\tlengthByte |= byte(h.payloadLength)\n\t}\n\terr = w.WriteByte(lengthByte)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch {\n\tcase h.payloadLength > math.MaxUint16:\n\t\tbinary.BigEndian.PutUint64(buf, uint64(h.payloadLength))\n\t\t_, err = w.Write(buf)\n\tcase h.payloadLength > 125:\n\t\tbinary.BigEndian.PutUint16(buf, uint16(h.payloadLength))\n\t\t_, err = w.Write(buf[:2])\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif h.masked {\n\t\tbinary.LittleEndian.PutUint32(buf, h.maskKey)\n\t\t_, err = w.Write(buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/bpool/bpool.go",
    "content": "package bpool\n\nimport (\n\t\"bytes\"\n\t\"sync\"\n)\n\nvar bpool sync.Pool\n\n// Get returns a buffer from the pool or creates a new one if\n// the pool is empty.\nfunc Get() *bytes.Buffer {\n\tb := bpool.Get()\n\tif b == nil {\n\t\treturn &bytes.Buffer{}\n\t}\n\treturn b.(*bytes.Buffer)\n}\n\n// Put returns a buffer into the pool.\nfunc Put(b *bytes.Buffer) {\n\tb.Reset()\n\tbpool.Put(b)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/errd/wrap.go",
    "content": "package errd\n\nimport (\n\t\"fmt\"\n)\n\n// Wrap wraps err with fmt.Errorf if err is non nil.\n// Intended for use with defer and a named error return.\n// Inspired by https://github.com/golang/go/issues/32676.\nfunc Wrap(err *error, f string, v ...interface{}) {\n\tif *err != nil {\n\t\t*err = fmt.Errorf(f+\": %w\", append(v, *err)...)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/util/util.go",
    "content": "package util\n\n// WriterFunc is used to implement one off io.Writers.\ntype WriterFunc func(p []byte) (int, error)\n\nfunc (f WriterFunc) Write(p []byte) (int, error) {\n\treturn f(p)\n}\n\n// ReaderFunc is used to implement one off io.Readers.\ntype ReaderFunc func(p []byte) (int, error)\n\nfunc (f ReaderFunc) Read(p []byte) (int, error) {\n\treturn f(p)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/wsjs/wsjs_js.go",
    "content": "//go:build js\n// +build js\n\n// Package wsjs implements typed access to the browser javascript WebSocket API.\n//\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\npackage wsjs\n\nimport (\n\t\"syscall/js\"\n)\n\nfunc handleJSError(err *error, onErr func()) {\n\tr := recover()\n\n\tif jsErr, ok := r.(js.Error); ok {\n\t\t*err = jsErr\n\n\t\tif onErr != nil {\n\t\t\tonErr()\n\t\t}\n\t\treturn\n\t}\n\n\tif r != nil {\n\t\tpanic(r)\n\t}\n}\n\n// New is a wrapper around the javascript WebSocket constructor.\nfunc New(url string, protocols []string) (c WebSocket, err error) {\n\tdefer handleJSError(&err, func() {\n\t\tc = WebSocket{}\n\t})\n\n\tjsProtocols := make([]interface{}, len(protocols))\n\tfor i, p := range protocols {\n\t\tjsProtocols[i] = p\n\t}\n\n\tc = WebSocket{\n\t\tv: js.Global().Get(\"WebSocket\").New(url, jsProtocols),\n\t}\n\n\tc.setBinaryType(\"arraybuffer\")\n\n\treturn c, nil\n}\n\n// WebSocket is a wrapper around a javascript WebSocket object.\ntype WebSocket struct {\n\tv js.Value\n}\n\nfunc (c WebSocket) setBinaryType(typ string) {\n\tc.v.Set(\"binaryType\", string(typ))\n}\n\nfunc (c WebSocket) addEventListener(eventType string, fn func(e js.Value)) func() {\n\tf := js.FuncOf(func(this js.Value, args []js.Value) interface{} {\n\t\tfn(args[0])\n\t\treturn nil\n\t})\n\tc.v.Call(\"addEventListener\", eventType, f)\n\n\treturn func() {\n\t\tc.v.Call(\"removeEventListener\", eventType, f)\n\t\tf.Release()\n\t}\n}\n\n// CloseEvent is the type passed to a WebSocket close handler.\ntype CloseEvent struct {\n\tCode     uint16\n\tReason   string\n\tWasClean bool\n}\n\n// OnClose registers a function to be called when the WebSocket is closed.\nfunc (c WebSocket) OnClose(fn func(CloseEvent)) (remove func()) {\n\treturn c.addEventListener(\"close\", func(e js.Value) {\n\t\tce := CloseEvent{\n\t\t\tCode:     uint16(e.Get(\"code\").Int()),\n\t\t\tReason:   e.Get(\"reason\").String(),\n\t\t\tWasClean: e.Get(\"wasClean\").Bool(),\n\t\t}\n\t\tfn(ce)\n\t})\n}\n\n// OnError registers a function to be called when there is an error\n// with the WebSocket.\nfunc (c WebSocket) OnError(fn func(e js.Value)) (remove func()) {\n\treturn c.addEventListener(\"error\", fn)\n}\n\n// MessageEvent is the type passed to a message handler.\ntype MessageEvent struct {\n\t// string or []byte.\n\tData interface{}\n\n\t// There are more fields to the interface but we don't use them.\n\t// See https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent\n}\n\n// OnMessage registers a function to be called when the WebSocket receives a message.\nfunc (c WebSocket) OnMessage(fn func(m MessageEvent)) (remove func()) {\n\treturn c.addEventListener(\"message\", func(e js.Value) {\n\t\tvar data interface{}\n\n\t\tarrayBuffer := e.Get(\"data\")\n\t\tif arrayBuffer.Type() == js.TypeString {\n\t\t\tdata = arrayBuffer.String()\n\t\t} else {\n\t\t\tdata = extractArrayBuffer(arrayBuffer)\n\t\t}\n\n\t\tme := MessageEvent{\n\t\t\tData: data,\n\t\t}\n\t\tfn(me)\n\t})\n}\n\n// Subprotocol returns the WebSocket subprotocol in use.\nfunc (c WebSocket) Subprotocol() string {\n\treturn c.v.Get(\"protocol\").String()\n}\n\n// OnOpen registers a function to be called when the WebSocket is opened.\nfunc (c WebSocket) OnOpen(fn func(e js.Value)) (remove func()) {\n\treturn c.addEventListener(\"open\", fn)\n}\n\n// Close closes the WebSocket with the given code and reason.\nfunc (c WebSocket) Close(code int, reason string) (err error) {\n\tdefer handleJSError(&err, nil)\n\tc.v.Call(\"close\", code, reason)\n\treturn err\n}\n\n// SendText sends the given string as a text message\n// on the WebSocket.\nfunc (c WebSocket) SendText(v string) (err error) {\n\tdefer handleJSError(&err, nil)\n\tc.v.Call(\"send\", v)\n\treturn err\n}\n\n// SendBytes sends the given message as a binary message\n// on the WebSocket.\nfunc (c WebSocket) SendBytes(v []byte) (err error) {\n\tdefer handleJSError(&err, nil)\n\tc.v.Call(\"send\", uint8Array(v))\n\treturn err\n}\n\nfunc extractArrayBuffer(arrayBuffer js.Value) []byte {\n\tuint8Array := js.Global().Get(\"Uint8Array\").New(arrayBuffer)\n\tdst := make([]byte, uint8Array.Length())\n\tjs.CopyBytesToGo(dst, uint8Array)\n\treturn dst\n}\n\nfunc uint8Array(src []byte) js.Value {\n\tuint8Array := js.Global().Get(\"Uint8Array\").New(len(src))\n\tjs.CopyBytesToJS(uint8Array, src)\n\treturn uint8Array\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/xsync/go.go",
    "content": "package xsync\n\nimport (\n\t\"fmt\"\n\t\"runtime/debug\"\n)\n\n// Go allows running a function in another goroutine\n// and waiting for its error.\nfunc Go(fn func() error) <-chan error {\n\terrs := make(chan error, 1)\n\tgo func() {\n\t\tdefer func() {\n\t\t\tr := recover()\n\t\t\tif r != nil {\n\t\t\t\tselect {\n\t\t\t\tcase errs <- fmt.Errorf(\"panic in go fn: %v, %s\", r, debug.Stack()):\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t\terrs <- fn()\n\t}()\n\n\treturn errs\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/internal/xsync/int64.go",
    "content": "package xsync\n\nimport (\n\t\"sync/atomic\"\n)\n\n// Int64 represents an atomic int64.\ntype Int64 struct {\n\t// We do not use atomic.Load/StoreInt64 since it does not\n\t// work on 32 bit computers but we need 64 bit integers.\n\ti atomic.Value\n}\n\n// Load loads the int64.\nfunc (v *Int64) Load() int64 {\n\ti, _ := v.i.Load().(int64)\n\treturn i\n}\n\n// Store stores the int64.\nfunc (v *Int64) Store(i int64) {\n\tv.i.Store(i)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/make.sh",
    "content": "#!/bin/sh\nset -eu\ncd -- \"$(dirname \"$0\")\"\n\necho \"=== fmt.sh\"\n./ci/fmt.sh\necho \"=== lint.sh\"\n./ci/lint.sh\necho \"=== test.sh\"\n./ci/test.sh \"$@\"\necho \"=== bench.sh\"\n./ci/bench.sh\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/mask.go",
    "content": "package websocket\n\nimport (\n\t\"encoding/binary\"\n\t\"math/bits\"\n)\n\n// maskGo applies the WebSocket masking algorithm to p\n// with the given key.\n// See https://tools.ietf.org/html/rfc6455#section-5.3\n//\n// The returned value is the correctly rotated key to\n// to continue to mask/unmask the message.\n//\n// It is optimized for LittleEndian and expects the key\n// to be in little endian.\n//\n// See https://github.com/golang/go/issues/31586\nfunc maskGo(b []byte, key uint32) uint32 {\n\tif len(b) >= 8 {\n\t\tkey64 := uint64(key)<<32 | uint64(key)\n\n\t\t// At some point in the future we can clean these unrolled loops up.\n\t\t// See https://github.com/golang/go/issues/31586#issuecomment-487436401\n\n\t\t// Then we xor until b is less than 128 bytes.\n\t\tfor len(b) >= 128 {\n\t\t\tv := binary.LittleEndian.Uint64(b)\n\t\t\tbinary.LittleEndian.PutUint64(b, v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[8:16])\n\t\t\tbinary.LittleEndian.PutUint64(b[8:16], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[16:24])\n\t\t\tbinary.LittleEndian.PutUint64(b[16:24], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[24:32])\n\t\t\tbinary.LittleEndian.PutUint64(b[24:32], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[32:40])\n\t\t\tbinary.LittleEndian.PutUint64(b[32:40], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[40:48])\n\t\t\tbinary.LittleEndian.PutUint64(b[40:48], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[48:56])\n\t\t\tbinary.LittleEndian.PutUint64(b[48:56], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[56:64])\n\t\t\tbinary.LittleEndian.PutUint64(b[56:64], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[64:72])\n\t\t\tbinary.LittleEndian.PutUint64(b[64:72], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[72:80])\n\t\t\tbinary.LittleEndian.PutUint64(b[72:80], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[80:88])\n\t\t\tbinary.LittleEndian.PutUint64(b[80:88], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[88:96])\n\t\t\tbinary.LittleEndian.PutUint64(b[88:96], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[96:104])\n\t\t\tbinary.LittleEndian.PutUint64(b[96:104], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[104:112])\n\t\t\tbinary.LittleEndian.PutUint64(b[104:112], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[112:120])\n\t\t\tbinary.LittleEndian.PutUint64(b[112:120], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[120:128])\n\t\t\tbinary.LittleEndian.PutUint64(b[120:128], v^key64)\n\t\t\tb = b[128:]\n\t\t}\n\n\t\t// Then we xor until b is less than 64 bytes.\n\t\tfor len(b) >= 64 {\n\t\t\tv := binary.LittleEndian.Uint64(b)\n\t\t\tbinary.LittleEndian.PutUint64(b, v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[8:16])\n\t\t\tbinary.LittleEndian.PutUint64(b[8:16], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[16:24])\n\t\t\tbinary.LittleEndian.PutUint64(b[16:24], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[24:32])\n\t\t\tbinary.LittleEndian.PutUint64(b[24:32], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[32:40])\n\t\t\tbinary.LittleEndian.PutUint64(b[32:40], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[40:48])\n\t\t\tbinary.LittleEndian.PutUint64(b[40:48], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[48:56])\n\t\t\tbinary.LittleEndian.PutUint64(b[48:56], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[56:64])\n\t\t\tbinary.LittleEndian.PutUint64(b[56:64], v^key64)\n\t\t\tb = b[64:]\n\t\t}\n\n\t\t// Then we xor until b is less than 32 bytes.\n\t\tfor len(b) >= 32 {\n\t\t\tv := binary.LittleEndian.Uint64(b)\n\t\t\tbinary.LittleEndian.PutUint64(b, v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[8:16])\n\t\t\tbinary.LittleEndian.PutUint64(b[8:16], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[16:24])\n\t\t\tbinary.LittleEndian.PutUint64(b[16:24], v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[24:32])\n\t\t\tbinary.LittleEndian.PutUint64(b[24:32], v^key64)\n\t\t\tb = b[32:]\n\t\t}\n\n\t\t// Then we xor until b is less than 16 bytes.\n\t\tfor len(b) >= 16 {\n\t\t\tv := binary.LittleEndian.Uint64(b)\n\t\t\tbinary.LittleEndian.PutUint64(b, v^key64)\n\t\t\tv = binary.LittleEndian.Uint64(b[8:16])\n\t\t\tbinary.LittleEndian.PutUint64(b[8:16], v^key64)\n\t\t\tb = b[16:]\n\t\t}\n\n\t\t// Then we xor until b is less than 8 bytes.\n\t\tfor len(b) >= 8 {\n\t\t\tv := binary.LittleEndian.Uint64(b)\n\t\t\tbinary.LittleEndian.PutUint64(b, v^key64)\n\t\t\tb = b[8:]\n\t\t}\n\t}\n\n\t// Then we xor until b is less than 4 bytes.\n\tfor len(b) >= 4 {\n\t\tv := binary.LittleEndian.Uint32(b)\n\t\tbinary.LittleEndian.PutUint32(b, v^key)\n\t\tb = b[4:]\n\t}\n\n\t// xor remaining bytes.\n\tfor i := range b {\n\t\tb[i] ^= byte(key)\n\t\tkey = bits.RotateLeft32(key, -8)\n\t}\n\n\treturn key\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/mask_amd64.s",
    "content": "#include \"textflag.h\"\n\n// func maskAsm(b *byte, len int, key uint32)\nTEXT ·maskAsm(SB), NOSPLIT, $0-28\n\t// AX = b\n\t// CX = len (left length)\n\t// SI = key (uint32)\n\t// DI = uint64(SI) | uint64(SI)<<32\n\tMOVQ b+0(FP), AX\n\tMOVQ len+8(FP), CX\n\tMOVL key+16(FP), SI\n\n\t// calculate the DI\n\t// DI = SI<<32 | SI\n\tMOVL SI, DI\n\tMOVQ DI, DX\n\tSHLQ $32, DI\n\tORQ  DX, DI\n\n\tCMPQ  CX, $15\n\tJLE   less_than_16\n\tCMPQ  CX, $63\n\tJLE   less_than_64\n\tCMPQ  CX, $128\n\tJLE   sse\n\tTESTQ $31, AX\n\tJNZ   unaligned\n\nunaligned_loop_1byte:\n\tXORB  SI, (AX)\n\tINCQ  AX\n\tDECQ  CX\n\tROLL  $24, SI\n\tTESTQ $7, AX\n\tJNZ   unaligned_loop_1byte\n\n\t// calculate DI again since SI was modified\n\t// DI = SI<<32 | SI\n\tMOVL SI, DI\n\tMOVQ DI, DX\n\tSHLQ $32, DI\n\tORQ  DX, DI\n\n\tTESTQ $31, AX\n\tJZ    sse\n\nunaligned:\n\tTESTQ $7, AX               // AND $7 & len, if not zero jump to loop_1b.\n\tJNZ   unaligned_loop_1byte\n\nunaligned_loop:\n\t// we don't need to check the CX since we know it's above 128\n\tXORQ  DI, (AX)\n\tADDQ  $8, AX\n\tSUBQ  $8, CX\n\tTESTQ $31, AX\n\tJNZ   unaligned_loop\n\tJMP   sse\n\nsse:\n\tCMPQ       CX, $0x40\n\tJL         less_than_64\n\tMOVQ       DI, X0\n\tPUNPCKLQDQ X0, X0\n\nsse_loop:\n\tMOVOU 0*16(AX), X1\n\tMOVOU 1*16(AX), X2\n\tMOVOU 2*16(AX), X3\n\tMOVOU 3*16(AX), X4\n\tPXOR  X0, X1\n\tPXOR  X0, X2\n\tPXOR  X0, X3\n\tPXOR  X0, X4\n\tMOVOU X1, 0*16(AX)\n\tMOVOU X2, 1*16(AX)\n\tMOVOU X3, 2*16(AX)\n\tMOVOU X4, 3*16(AX)\n\tADDQ  $0x40, AX\n\tSUBQ  $0x40, CX\n\tCMPQ  CX, $0x40\n\tJAE   sse_loop\n\nless_than_64:\n\tTESTQ $32, CX\n\tJZ    less_than_32\n\tXORQ  DI, (AX)\n\tXORQ  DI, 8(AX)\n\tXORQ  DI, 16(AX)\n\tXORQ  DI, 24(AX)\n\tADDQ  $32, AX\n\nless_than_32:\n\tTESTQ $16, CX\n\tJZ    less_than_16\n\tXORQ  DI, (AX)\n\tXORQ  DI, 8(AX)\n\tADDQ  $16, AX\n\nless_than_16:\n\tTESTQ $8, CX\n\tJZ    less_than_8\n\tXORQ  DI, (AX)\n\tADDQ  $8, AX\n\nless_than_8:\n\tTESTQ $4, CX\n\tJZ    less_than_4\n\tXORL  SI, (AX)\n\tADDQ  $4, AX\n\nless_than_4:\n\tTESTQ $2, CX\n\tJZ    less_than_2\n\tXORW  SI, (AX)\n\tROLL  $16, SI\n\tADDQ  $2, AX\n\nless_than_2:\n\tTESTQ $1, CX\n\tJZ    done\n\tXORB  SI, (AX)\n\tROLL  $24, SI\n\ndone:\n\tMOVL SI, ret+24(FP)\n\tRET\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/mask_arm64.s",
    "content": "#include \"textflag.h\"\n\n// func maskAsm(b *byte, len int, key uint32)\nTEXT ·maskAsm(SB), NOSPLIT, $0-28\n\t// R0 = b\n\t// R1 = len\n\t// R3 = key (uint32)\n\t// R2 = uint64(key)<<32 | uint64(key)\n\tMOVD  b_ptr+0(FP), R0\n\tMOVD  b_len+8(FP), R1\n\tMOVWU key+16(FP), R3\n\tMOVD  R3, R2\n\tORR   R2<<32, R2, R2\n\tVDUP  R2, V0.D2\n\tCMP   $64, R1\n\tBLT   less_than_64\n\nloop_64:\n\tVLD1   (R0), [V1.B16, V2.B16, V3.B16, V4.B16]\n\tVEOR   V1.B16, V0.B16, V1.B16\n\tVEOR   V2.B16, V0.B16, V2.B16\n\tVEOR   V3.B16, V0.B16, V3.B16\n\tVEOR   V4.B16, V0.B16, V4.B16\n\tVST1.P [V1.B16, V2.B16, V3.B16, V4.B16], 64(R0)\n\tSUBS   $64, R1\n\tCMP    $64, R1\n\tBGE    loop_64\n\nless_than_64:\n\tCBZ    R1, end\n\tTBZ    $5, R1, less_than_32\n\tVLD1   (R0), [V1.B16, V2.B16]\n\tVEOR   V1.B16, V0.B16, V1.B16\n\tVEOR   V2.B16, V0.B16, V2.B16\n\tVST1.P [V1.B16, V2.B16], 32(R0)\n\nless_than_32:\n\tTBZ   $4, R1, less_than_16\n\tLDP   (R0), (R11, R12)\n\tEOR   R11, R2, R11\n\tEOR   R12, R2, R12\n\tSTP.P (R11, R12), 16(R0)\n\nless_than_16:\n\tTBZ    $3, R1, less_than_8\n\tMOVD   (R0), R11\n\tEOR    R2, R11, R11\n\tMOVD.P R11, 8(R0)\n\nless_than_8:\n\tTBZ     $2, R1, less_than_4\n\tMOVWU   (R0), R11\n\tEORW    R2, R11, R11\n\tMOVWU.P R11, 4(R0)\n\nless_than_4:\n\tTBZ     $1, R1, less_than_2\n\tMOVHU   (R0), R11\n\tEORW    R3, R11, R11\n\tMOVHU.P R11, 2(R0)\n\tRORW    $16, R3\n\nless_than_2:\n\tTBZ     $0, R1, end\n\tMOVBU   (R0), R11\n\tEORW    R3, R11, R11\n\tMOVBU.P R11, 1(R0)\n\tRORW    $8, R3\n\nend:\n\tMOVWU R3, ret+24(FP)\n\tRET\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/mask_asm.go",
    "content": "//go:build amd64 || arm64\n\npackage websocket\n\nfunc mask(b []byte, key uint32) uint32 {\n\t// TODO: Will enable in v1.9.0.\n\treturn maskGo(b, key)\n\t/*\n\t\tif len(b) > 0 {\n\t\t\treturn maskAsm(&b[0], len(b), key)\n\t\t}\n\t\treturn key\n\t*/\n}\n\n// @nhooyr: I am not confident that the amd64 or the arm64 implementations of this\n// function are perfect. There are almost certainly missing optimizations or\n// opportunities for simplification. I'm confident there are no bugs though.\n// For example, the arm64 implementation doesn't align memory like the amd64.\n// Or the amd64 implementation could use AVX512 instead of just AVX2.\n// The AVX2 code I had to disable anyway as it wasn't performing as expected.\n// See https://github.com/nhooyr/websocket/pull/326#issuecomment-1771138049\n//\n//go:noescape\n//lint:ignore U1000 disabled till v1.9.0\nfunc maskAsm(b *byte, len int, key uint32) uint32\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/mask_go.go",
    "content": "//go:build !amd64 && !arm64 && !js\n\npackage websocket\n\nfunc mask(b []byte, key uint32) uint32 {\n\treturn maskGo(b, key)\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/netconn.go",
    "content": "package websocket\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"net\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\n// NetConn converts a *websocket.Conn into a net.Conn.\n//\n// It's for tunneling arbitrary protocols over WebSockets.\n// Few users of the library will need this but it's tricky to implement\n// correctly and so provided in the library.\n// See https://github.com/nhooyr/websocket/issues/100.\n//\n// Every Write to the net.Conn will correspond to a message write of\n// the given type on *websocket.Conn.\n//\n// The passed ctx bounds the lifetime of the net.Conn. If cancelled,\n// all reads and writes on the net.Conn will be cancelled.\n//\n// If a message is read that is not of the correct type, the connection\n// will be closed with StatusUnsupportedData and an error will be returned.\n//\n// Close will close the *websocket.Conn with StatusNormalClosure.\n//\n// When a deadline is hit and there is an active read or write goroutine, the\n// connection will be closed. This is different from most net.Conn implementations\n// where only the reading/writing goroutines are interrupted but the connection\n// is kept alive.\n//\n// The Addr methods will return the real addresses for connections obtained\n// from websocket.Accept. But for connections obtained from websocket.Dial, a mock net.Addr\n// will be returned that gives \"websocket\" for Network() and \"websocket/unknown-addr\" for\n// String(). This is because websocket.Dial only exposes a io.ReadWriteCloser instead of the\n// full net.Conn to us.\n//\n// When running as WASM, the Addr methods will always return the mock address described above.\n//\n// A received StatusNormalClosure or StatusGoingAway close frame will be translated to\n// io.EOF when reading.\n//\n// Furthermore, the ReadLimit is set to -1 to disable it.\nfunc NetConn(ctx context.Context, c *Conn, msgType MessageType) net.Conn {\n\tc.SetReadLimit(-1)\n\n\tnc := &netConn{\n\t\tc:       c,\n\t\tmsgType: msgType,\n\t\treadMu:  newMu(c),\n\t\twriteMu: newMu(c),\n\t}\n\n\tnc.writeCtx, nc.writeCancel = context.WithCancel(ctx)\n\tnc.readCtx, nc.readCancel = context.WithCancel(ctx)\n\n\tnc.writeTimer = time.AfterFunc(math.MaxInt64, func() {\n\t\tif !nc.writeMu.tryLock() {\n\t\t\t// If the lock cannot be acquired, then there is an\n\t\t\t// active write goroutine and so we should cancel the context.\n\t\t\tnc.writeCancel()\n\t\t\treturn\n\t\t}\n\t\tdefer nc.writeMu.unlock()\n\n\t\t// Prevents future writes from writing until the deadline is reset.\n\t\tatomic.StoreInt64(&nc.writeExpired, 1)\n\t})\n\tif !nc.writeTimer.Stop() {\n\t\t<-nc.writeTimer.C\n\t}\n\n\tnc.readTimer = time.AfterFunc(math.MaxInt64, func() {\n\t\tif !nc.readMu.tryLock() {\n\t\t\t// If the lock cannot be acquired, then there is an\n\t\t\t// active read goroutine and so we should cancel the context.\n\t\t\tnc.readCancel()\n\t\t\treturn\n\t\t}\n\t\tdefer nc.readMu.unlock()\n\n\t\t// Prevents future reads from reading until the deadline is reset.\n\t\tatomic.StoreInt64(&nc.readExpired, 1)\n\t})\n\tif !nc.readTimer.Stop() {\n\t\t<-nc.readTimer.C\n\t}\n\n\treturn nc\n}\n\ntype netConn struct {\n\t// These must be first to be aligned on 32 bit platforms.\n\t// https://github.com/nhooyr/websocket/pull/438\n\treadExpired  int64\n\twriteExpired int64\n\n\tc       *Conn\n\tmsgType MessageType\n\n\twriteTimer  *time.Timer\n\twriteMu     *mu\n\twriteCtx    context.Context\n\twriteCancel context.CancelFunc\n\n\treadTimer  *time.Timer\n\treadMu     *mu\n\treadCtx    context.Context\n\treadCancel context.CancelFunc\n\treadEOFed  bool\n\treader     io.Reader\n}\n\nvar _ net.Conn = &netConn{}\n\nfunc (nc *netConn) Close() error {\n\tnc.writeTimer.Stop()\n\tnc.writeCancel()\n\tnc.readTimer.Stop()\n\tnc.readCancel()\n\treturn nc.c.Close(StatusNormalClosure, \"\")\n}\n\nfunc (nc *netConn) Write(p []byte) (int, error) {\n\tnc.writeMu.forceLock()\n\tdefer nc.writeMu.unlock()\n\n\tif atomic.LoadInt64(&nc.writeExpired) == 1 {\n\t\treturn 0, fmt.Errorf(\"failed to write: %w\", context.DeadlineExceeded)\n\t}\n\n\terr := nc.c.Write(nc.writeCtx, nc.msgType, p)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn len(p), nil\n}\n\nfunc (nc *netConn) Read(p []byte) (int, error) {\n\tnc.readMu.forceLock()\n\tdefer nc.readMu.unlock()\n\n\tfor {\n\t\tn, err := nc.read(p)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif n == 0 {\n\t\t\tcontinue\n\t\t}\n\t\treturn n, nil\n\t}\n}\n\nfunc (nc *netConn) read(p []byte) (int, error) {\n\tif atomic.LoadInt64(&nc.readExpired) == 1 {\n\t\treturn 0, fmt.Errorf(\"failed to read: %w\", context.DeadlineExceeded)\n\t}\n\n\tif nc.readEOFed {\n\t\treturn 0, io.EOF\n\t}\n\n\tif nc.reader == nil {\n\t\ttyp, r, err := nc.c.Reader(nc.readCtx)\n\t\tif err != nil {\n\t\t\tswitch CloseStatus(err) {\n\t\t\tcase StatusNormalClosure, StatusGoingAway:\n\t\t\t\tnc.readEOFed = true\n\t\t\t\treturn 0, io.EOF\n\t\t\t}\n\t\t\treturn 0, err\n\t\t}\n\t\tif typ != nc.msgType {\n\t\t\terr := fmt.Errorf(\"unexpected frame type read (expected %v): %v\", nc.msgType, typ)\n\t\t\tnc.c.Close(StatusUnsupportedData, err.Error())\n\t\t\treturn 0, err\n\t\t}\n\t\tnc.reader = r\n\t}\n\n\tn, err := nc.reader.Read(p)\n\tif err == io.EOF {\n\t\tnc.reader = nil\n\t\terr = nil\n\t}\n\treturn n, err\n}\n\ntype websocketAddr struct {\n}\n\nfunc (a websocketAddr) Network() string {\n\treturn \"websocket\"\n}\n\nfunc (a websocketAddr) String() string {\n\treturn \"websocket/unknown-addr\"\n}\n\nfunc (nc *netConn) SetDeadline(t time.Time) error {\n\tnc.SetWriteDeadline(t)\n\tnc.SetReadDeadline(t)\n\treturn nil\n}\n\nfunc (nc *netConn) SetWriteDeadline(t time.Time) error {\n\tatomic.StoreInt64(&nc.writeExpired, 0)\n\tif t.IsZero() {\n\t\tnc.writeTimer.Stop()\n\t} else {\n\t\tdur := time.Until(t)\n\t\tif dur <= 0 {\n\t\t\tdur = 1\n\t\t}\n\t\tnc.writeTimer.Reset(dur)\n\t}\n\treturn nil\n}\n\nfunc (nc *netConn) SetReadDeadline(t time.Time) error {\n\tatomic.StoreInt64(&nc.readExpired, 0)\n\tif t.IsZero() {\n\t\tnc.readTimer.Stop()\n\t} else {\n\t\tdur := time.Until(t)\n\t\tif dur <= 0 {\n\t\t\tdur = 1\n\t\t}\n\t\tnc.readTimer.Reset(dur)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/netconn_js.go",
    "content": "package websocket\n\nimport \"net\"\n\nfunc (nc *netConn) RemoteAddr() net.Addr {\n\treturn websocketAddr{}\n}\n\nfunc (nc *netConn) LocalAddr() net.Addr {\n\treturn websocketAddr{}\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/netconn_notjs.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport \"net\"\n\nfunc (nc *netConn) RemoteAddr() net.Addr {\n\tif unc, ok := nc.c.rwc.(net.Conn); ok {\n\t\treturn unc.RemoteAddr()\n\t}\n\treturn websocketAddr{}\n}\n\nfunc (nc *netConn) LocalAddr() net.Addr {\n\tif unc, ok := nc.c.rwc.(net.Conn); ok {\n\t\treturn unc.LocalAddr()\n\t}\n\treturn websocketAddr{}\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/read.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n\t\"github.com/coder/websocket/internal/util\"\n\t\"github.com/coder/websocket/internal/xsync\"\n)\n\n// Reader reads from the connection until there is a WebSocket\n// data message to be read. It will handle ping, pong and close frames as appropriate.\n//\n// It returns the type of the message and an io.Reader to read it.\n// The passed context will also bound the reader.\n// Ensure you read to EOF otherwise the connection will hang.\n//\n// Call CloseRead if you do not expect any data messages from the peer.\n//\n// Only one Reader may be open at a time.\n//\n// If you need a separate timeout on the Reader call and the Read itself,\n// use time.AfterFunc to cancel the context passed in.\n// See https://github.com/nhooyr/websocket/issues/87#issue-451703332\n// Most users should not need this.\nfunc (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {\n\treturn c.reader(ctx)\n}\n\n// Read is a convenience method around Reader to read a single message\n// from the connection.\nfunc (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) {\n\ttyp, r, err := c.Reader(ctx)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\tb, err := io.ReadAll(r)\n\treturn typ, b, err\n}\n\n// CloseRead starts a goroutine to read from the connection until it is closed\n// or a data message is received.\n//\n// Once CloseRead is called you cannot read any messages from the connection.\n// The returned context will be cancelled when the connection is closed.\n//\n// If a data message is received, the connection will be closed with StatusPolicyViolation.\n//\n// Call CloseRead when you do not expect to read any more messages.\n// Since it actively reads from the connection, it will ensure that ping, pong and close\n// frames are responded to. This means c.Ping and c.Close will still work as expected.\n//\n// This function is idempotent.\nfunc (c *Conn) CloseRead(ctx context.Context) context.Context {\n\tc.closeReadMu.Lock()\n\tctx2 := c.closeReadCtx\n\tif ctx2 != nil {\n\t\tc.closeReadMu.Unlock()\n\t\treturn ctx2\n\t}\n\tctx, cancel := context.WithCancel(ctx)\n\tc.closeReadCtx = ctx\n\tc.closeReadDone = make(chan struct{})\n\tc.closeReadMu.Unlock()\n\n\tgo func() {\n\t\tdefer close(c.closeReadDone)\n\t\tdefer cancel()\n\t\tdefer c.close()\n\t\t_, _, err := c.Reader(ctx)\n\t\tif err == nil {\n\t\t\tc.Close(StatusPolicyViolation, \"unexpected data message\")\n\t\t}\n\t}()\n\treturn ctx\n}\n\n// SetReadLimit sets the max number of bytes to read for a single message.\n// It applies to the Reader and Read methods.\n//\n// By default, the connection has a message read limit of 32768 bytes.\n//\n// When the limit is hit, the connection will be closed with StatusMessageTooBig.\n//\n// Set to -1 to disable.\nfunc (c *Conn) SetReadLimit(n int64) {\n\tif n >= 0 {\n\t\t// We read one more byte than the limit in case\n\t\t// there is a fin frame that needs to be read.\n\t\tn++\n\t}\n\n\tc.msgReader.limitReader.limit.Store(n)\n}\n\nconst defaultReadLimit = 32768\n\nfunc newMsgReader(c *Conn) *msgReader {\n\tmr := &msgReader{\n\t\tc:   c,\n\t\tfin: true,\n\t}\n\tmr.readFunc = mr.read\n\n\tmr.limitReader = newLimitReader(c, mr.readFunc, defaultReadLimit+1)\n\treturn mr\n}\n\nfunc (mr *msgReader) resetFlate() {\n\tif mr.flateContextTakeover() {\n\t\tif mr.dict == nil {\n\t\t\tmr.dict = &slidingWindow{}\n\t\t}\n\t\tmr.dict.init(32768)\n\t}\n\tif mr.flateBufio == nil {\n\t\tmr.flateBufio = getBufioReader(mr.readFunc)\n\t}\n\n\tif mr.flateContextTakeover() {\n\t\tmr.flateReader = getFlateReader(mr.flateBufio, mr.dict.buf)\n\t} else {\n\t\tmr.flateReader = getFlateReader(mr.flateBufio, nil)\n\t}\n\tmr.limitReader.r = mr.flateReader\n\tmr.flateTail.Reset(deflateMessageTail)\n}\n\nfunc (mr *msgReader) putFlateReader() {\n\tif mr.flateReader != nil {\n\t\tputFlateReader(mr.flateReader)\n\t\tmr.flateReader = nil\n\t}\n}\n\nfunc (mr *msgReader) close() {\n\tmr.c.readMu.forceLock()\n\tmr.putFlateReader()\n\tif mr.dict != nil {\n\t\tmr.dict.close()\n\t\tmr.dict = nil\n\t}\n\tif mr.flateBufio != nil {\n\t\tputBufioReader(mr.flateBufio)\n\t}\n\n\tif mr.c.client {\n\t\tputBufioReader(mr.c.br)\n\t\tmr.c.br = nil\n\t}\n}\n\nfunc (mr *msgReader) flateContextTakeover() bool {\n\tif mr.c.client {\n\t\treturn !mr.c.copts.serverNoContextTakeover\n\t}\n\treturn !mr.c.copts.clientNoContextTakeover\n}\n\nfunc (c *Conn) readRSV1Illegal(h header) bool {\n\t// If compression is disabled, rsv1 is illegal.\n\tif !c.flate() {\n\t\treturn true\n\t}\n\t// rsv1 is only allowed on data frames beginning messages.\n\tif h.opcode != opText && h.opcode != opBinary {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (c *Conn) readLoop(ctx context.Context) (header, error) {\n\tfor {\n\t\th, err := c.readFrameHeader(ctx)\n\t\tif err != nil {\n\t\t\treturn header{}, err\n\t\t}\n\n\t\tif h.rsv1 && c.readRSV1Illegal(h) || h.rsv2 || h.rsv3 {\n\t\t\terr := fmt.Errorf(\"received header with unexpected rsv bits set: %v:%v:%v\", h.rsv1, h.rsv2, h.rsv3)\n\t\t\tc.writeError(StatusProtocolError, err)\n\t\t\treturn header{}, err\n\t\t}\n\n\t\tif !c.client && !h.masked {\n\t\t\treturn header{}, errors.New(\"received unmasked frame from client\")\n\t\t}\n\n\t\tswitch h.opcode {\n\t\tcase opClose, opPing, opPong:\n\t\t\terr = c.handleControl(ctx, h)\n\t\t\tif err != nil {\n\t\t\t\t// Pass through CloseErrors when receiving a close frame.\n\t\t\t\tif h.opcode == opClose && CloseStatus(err) != -1 {\n\t\t\t\t\treturn header{}, err\n\t\t\t\t}\n\t\t\t\treturn header{}, fmt.Errorf(\"failed to handle control frame %v: %w\", h.opcode, err)\n\t\t\t}\n\t\tcase opContinuation, opText, opBinary:\n\t\t\treturn h, nil\n\t\tdefault:\n\t\t\terr := fmt.Errorf(\"received unknown opcode %v\", h.opcode)\n\t\t\tc.writeError(StatusProtocolError, err)\n\t\t\treturn header{}, err\n\t\t}\n\t}\n}\n\nfunc (c *Conn) readFrameHeader(ctx context.Context) (header, error) {\n\tselect {\n\tcase <-c.closed:\n\t\treturn header{}, net.ErrClosed\n\tcase c.readTimeout <- ctx:\n\t}\n\n\th, err := readFrameHeader(c.br, c.readHeaderBuf[:])\n\tif err != nil {\n\t\tselect {\n\t\tcase <-c.closed:\n\t\t\treturn header{}, net.ErrClosed\n\t\tcase <-ctx.Done():\n\t\t\treturn header{}, ctx.Err()\n\t\tdefault:\n\t\t\treturn header{}, err\n\t\t}\n\t}\n\n\tselect {\n\tcase <-c.closed:\n\t\treturn header{}, net.ErrClosed\n\tcase c.readTimeout <- context.Background():\n\t}\n\n\treturn h, nil\n}\n\nfunc (c *Conn) readFramePayload(ctx context.Context, p []byte) (int, error) {\n\tselect {\n\tcase <-c.closed:\n\t\treturn 0, net.ErrClosed\n\tcase c.readTimeout <- ctx:\n\t}\n\n\tn, err := io.ReadFull(c.br, p)\n\tif err != nil {\n\t\tselect {\n\t\tcase <-c.closed:\n\t\t\treturn n, net.ErrClosed\n\t\tcase <-ctx.Done():\n\t\t\treturn n, ctx.Err()\n\t\tdefault:\n\t\t\treturn n, fmt.Errorf(\"failed to read frame payload: %w\", err)\n\t\t}\n\t}\n\n\tselect {\n\tcase <-c.closed:\n\t\treturn n, net.ErrClosed\n\tcase c.readTimeout <- context.Background():\n\t}\n\n\treturn n, err\n}\n\nfunc (c *Conn) handleControl(ctx context.Context, h header) (err error) {\n\tif h.payloadLength < 0 || h.payloadLength > maxControlPayload {\n\t\terr := fmt.Errorf(\"received control frame payload with invalid length: %d\", h.payloadLength)\n\t\tc.writeError(StatusProtocolError, err)\n\t\treturn err\n\t}\n\n\tif !h.fin {\n\t\terr := errors.New(\"received fragmented control frame\")\n\t\tc.writeError(StatusProtocolError, err)\n\t\treturn err\n\t}\n\n\tctx, cancel := context.WithTimeout(ctx, time.Second*5)\n\tdefer cancel()\n\n\tb := c.readControlBuf[:h.payloadLength]\n\t_, err = c.readFramePayload(ctx, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif h.masked {\n\t\tmask(b, h.maskKey)\n\t}\n\n\tswitch h.opcode {\n\tcase opPing:\n\t\treturn c.writeControl(ctx, opPong, b)\n\tcase opPong:\n\t\tc.activePingsMu.Lock()\n\t\tpong, ok := c.activePings[string(b)]\n\t\tc.activePingsMu.Unlock()\n\t\tif ok {\n\t\t\tselect {\n\t\t\tcase pong <- struct{}{}:\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\t// opClose\n\n\tce, err := parseClosePayload(b)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"received invalid close payload: %w\", err)\n\t\tc.writeError(StatusProtocolError, err)\n\t\treturn err\n\t}\n\n\terr = fmt.Errorf(\"received close frame: %w\", ce)\n\tc.writeClose(ce.Code, ce.Reason)\n\tc.readMu.unlock()\n\tc.close()\n\treturn err\n}\n\nfunc (c *Conn) reader(ctx context.Context) (_ MessageType, _ io.Reader, err error) {\n\tdefer errd.Wrap(&err, \"failed to get reader\")\n\n\terr = c.readMu.lock(ctx)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\tdefer c.readMu.unlock()\n\n\tif !c.msgReader.fin {\n\t\treturn 0, nil, errors.New(\"previous message not read to completion\")\n\t}\n\n\th, err := c.readLoop(ctx)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\tif h.opcode == opContinuation {\n\t\terr := errors.New(\"received continuation frame without text or binary frame\")\n\t\tc.writeError(StatusProtocolError, err)\n\t\treturn 0, nil, err\n\t}\n\n\tc.msgReader.reset(ctx, h)\n\n\treturn MessageType(h.opcode), c.msgReader, nil\n}\n\ntype msgReader struct {\n\tc *Conn\n\n\tctx         context.Context\n\tflate       bool\n\tflateReader io.Reader\n\tflateBufio  *bufio.Reader\n\tflateTail   strings.Reader\n\tlimitReader *limitReader\n\tdict        *slidingWindow\n\n\tfin           bool\n\tpayloadLength int64\n\tmaskKey       uint32\n\n\t// util.ReaderFunc(mr.Read) to avoid continuous allocations.\n\treadFunc util.ReaderFunc\n}\n\nfunc (mr *msgReader) reset(ctx context.Context, h header) {\n\tmr.ctx = ctx\n\tmr.flate = h.rsv1\n\tmr.limitReader.reset(mr.readFunc)\n\n\tif mr.flate {\n\t\tmr.resetFlate()\n\t}\n\n\tmr.setFrame(h)\n}\n\nfunc (mr *msgReader) setFrame(h header) {\n\tmr.fin = h.fin\n\tmr.payloadLength = h.payloadLength\n\tmr.maskKey = h.maskKey\n}\n\nfunc (mr *msgReader) Read(p []byte) (n int, err error) {\n\terr = mr.c.readMu.lock(mr.ctx)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to read: %w\", err)\n\t}\n\tdefer mr.c.readMu.unlock()\n\n\tn, err = mr.limitReader.Read(p)\n\tif mr.flate && mr.flateContextTakeover() {\n\t\tp = p[:n]\n\t\tmr.dict.write(p)\n\t}\n\tif errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) && mr.fin && mr.flate {\n\t\tmr.putFlateReader()\n\t\treturn n, io.EOF\n\t}\n\tif err != nil {\n\t\treturn n, fmt.Errorf(\"failed to read: %w\", err)\n\t}\n\treturn n, nil\n}\n\nfunc (mr *msgReader) read(p []byte) (int, error) {\n\tfor {\n\t\tif mr.payloadLength == 0 {\n\t\t\tif mr.fin {\n\t\t\t\tif mr.flate {\n\t\t\t\t\treturn mr.flateTail.Read(p)\n\t\t\t\t}\n\t\t\t\treturn 0, io.EOF\n\t\t\t}\n\n\t\t\th, err := mr.c.readLoop(mr.ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tif h.opcode != opContinuation {\n\t\t\t\terr := errors.New(\"received new data message without finishing the previous message\")\n\t\t\t\tmr.c.writeError(StatusProtocolError, err)\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tmr.setFrame(h)\n\n\t\t\tcontinue\n\t\t}\n\n\t\tif int64(len(p)) > mr.payloadLength {\n\t\t\tp = p[:mr.payloadLength]\n\t\t}\n\n\t\tn, err := mr.c.readFramePayload(mr.ctx, p)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\t\tmr.payloadLength -= int64(n)\n\n\t\tif !mr.c.client {\n\t\t\tmr.maskKey = mask(p, mr.maskKey)\n\t\t}\n\n\t\treturn n, nil\n\t}\n}\n\ntype limitReader struct {\n\tc     *Conn\n\tr     io.Reader\n\tlimit xsync.Int64\n\tn     int64\n}\n\nfunc newLimitReader(c *Conn, r io.Reader, limit int64) *limitReader {\n\tlr := &limitReader{\n\t\tc: c,\n\t}\n\tlr.limit.Store(limit)\n\tlr.reset(r)\n\treturn lr\n}\n\nfunc (lr *limitReader) reset(r io.Reader) {\n\tlr.n = lr.limit.Load()\n\tlr.r = r\n}\n\nfunc (lr *limitReader) Read(p []byte) (int, error) {\n\tif lr.n < 0 {\n\t\treturn lr.r.Read(p)\n\t}\n\n\tif lr.n == 0 {\n\t\terr := fmt.Errorf(\"read limited at %v bytes\", lr.limit.Load())\n\t\tlr.c.writeError(StatusMessageTooBig, err)\n\t\treturn 0, err\n\t}\n\n\tif int64(len(p)) > lr.n {\n\t\tp = p[:lr.n]\n\t}\n\tn, err := lr.r.Read(p)\n\tlr.n -= int64(n)\n\tif lr.n < 0 {\n\t\tlr.n = 0\n\t}\n\treturn n, err\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/stringer.go",
    "content": "// Code generated by \"stringer -type=opcode,MessageType,StatusCode -output=stringer.go\"; DO NOT EDIT.\n\npackage websocket\n\nimport \"strconv\"\n\nfunc _() {\n\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n\t// Re-run the stringer command to generate them again.\n\tvar x [1]struct{}\n\t_ = x[opContinuation-0]\n\t_ = x[opText-1]\n\t_ = x[opBinary-2]\n\t_ = x[opClose-8]\n\t_ = x[opPing-9]\n\t_ = x[opPong-10]\n}\n\nconst (\n\t_opcode_name_0 = \"opContinuationopTextopBinary\"\n\t_opcode_name_1 = \"opCloseopPingopPong\"\n)\n\nvar (\n\t_opcode_index_0 = [...]uint8{0, 14, 20, 28}\n\t_opcode_index_1 = [...]uint8{0, 7, 13, 19}\n)\n\nfunc (i opcode) String() string {\n\tswitch {\n\tcase 0 <= i && i <= 2:\n\t\treturn _opcode_name_0[_opcode_index_0[i]:_opcode_index_0[i+1]]\n\tcase 8 <= i && i <= 10:\n\t\ti -= 8\n\t\treturn _opcode_name_1[_opcode_index_1[i]:_opcode_index_1[i+1]]\n\tdefault:\n\t\treturn \"opcode(\" + strconv.FormatInt(int64(i), 10) + \")\"\n\t}\n}\nfunc _() {\n\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n\t// Re-run the stringer command to generate them again.\n\tvar x [1]struct{}\n\t_ = x[MessageText-1]\n\t_ = x[MessageBinary-2]\n}\n\nconst _MessageType_name = \"MessageTextMessageBinary\"\n\nvar _MessageType_index = [...]uint8{0, 11, 24}\n\nfunc (i MessageType) String() string {\n\ti -= 1\n\tif i < 0 || i >= MessageType(len(_MessageType_index)-1) {\n\t\treturn \"MessageType(\" + strconv.FormatInt(int64(i+1), 10) + \")\"\n\t}\n\treturn _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]]\n}\nfunc _() {\n\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n\t// Re-run the stringer command to generate them again.\n\tvar x [1]struct{}\n\t_ = x[StatusNormalClosure-1000]\n\t_ = x[StatusGoingAway-1001]\n\t_ = x[StatusProtocolError-1002]\n\t_ = x[StatusUnsupportedData-1003]\n\t_ = x[statusReserved-1004]\n\t_ = x[StatusNoStatusRcvd-1005]\n\t_ = x[StatusAbnormalClosure-1006]\n\t_ = x[StatusInvalidFramePayloadData-1007]\n\t_ = x[StatusPolicyViolation-1008]\n\t_ = x[StatusMessageTooBig-1009]\n\t_ = x[StatusMandatoryExtension-1010]\n\t_ = x[StatusInternalError-1011]\n\t_ = x[StatusServiceRestart-1012]\n\t_ = x[StatusTryAgainLater-1013]\n\t_ = x[StatusBadGateway-1014]\n\t_ = x[StatusTLSHandshake-1015]\n}\n\nconst _StatusCode_name = \"StatusNormalClosureStatusGoingAwayStatusProtocolErrorStatusUnsupportedDatastatusReservedStatusNoStatusRcvdStatusAbnormalClosureStatusInvalidFramePayloadDataStatusPolicyViolationStatusMessageTooBigStatusMandatoryExtensionStatusInternalErrorStatusServiceRestartStatusTryAgainLaterStatusBadGatewayStatusTLSHandshake\"\n\nvar _StatusCode_index = [...]uint16{0, 19, 34, 53, 74, 88, 106, 127, 156, 177, 196, 220, 239, 259, 278, 294, 312}\n\nfunc (i StatusCode) String() string {\n\ti -= 1000\n\tif i < 0 || i >= StatusCode(len(_StatusCode_index)-1) {\n\t\treturn \"StatusCode(\" + strconv.FormatInt(int64(i+1000), 10) + \")\"\n\t}\n\treturn _StatusCode_name[_StatusCode_index[i]:_StatusCode_index[i+1]]\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/write.go",
    "content": "//go:build !js\n// +build !js\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"crypto/rand\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"time\"\n\n\t\"compress/flate\"\n\n\t\"github.com/coder/websocket/internal/errd\"\n\t\"github.com/coder/websocket/internal/util\"\n)\n\n// Writer returns a writer bounded by the context that will write\n// a WebSocket message of type dataType to the connection.\n//\n// You must close the writer once you have written the entire message.\n//\n// Only one writer can be open at a time, multiple calls will block until the previous writer\n// is closed.\nfunc (c *Conn) Writer(ctx context.Context, typ MessageType) (io.WriteCloser, error) {\n\tw, err := c.writer(ctx, typ)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get writer: %w\", err)\n\t}\n\treturn w, nil\n}\n\n// Write writes a message to the connection.\n//\n// See the Writer method if you want to stream a message.\n//\n// If compression is disabled or the compression threshold is not met, then it\n// will write the message in a single frame.\nfunc (c *Conn) Write(ctx context.Context, typ MessageType, p []byte) error {\n\t_, err := c.write(ctx, typ, p)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write msg: %w\", err)\n\t}\n\treturn nil\n}\n\ntype msgWriter struct {\n\tc *Conn\n\n\tmu      *mu\n\twriteMu *mu\n\tclosed  bool\n\n\tctx    context.Context\n\topcode opcode\n\tflate  bool\n\n\ttrimWriter  *trimLastFourBytesWriter\n\tflateWriter *flate.Writer\n}\n\nfunc newMsgWriter(c *Conn) *msgWriter {\n\tmw := &msgWriter{\n\t\tc:       c,\n\t\tmu:      newMu(c),\n\t\twriteMu: newMu(c),\n\t}\n\treturn mw\n}\n\nfunc (mw *msgWriter) ensureFlate() {\n\tif mw.trimWriter == nil {\n\t\tmw.trimWriter = &trimLastFourBytesWriter{\n\t\t\tw: util.WriterFunc(mw.write),\n\t\t}\n\t}\n\n\tif mw.flateWriter == nil {\n\t\tmw.flateWriter = getFlateWriter(mw.trimWriter)\n\t}\n\tmw.flate = true\n}\n\nfunc (mw *msgWriter) flateContextTakeover() bool {\n\tif mw.c.client {\n\t\treturn !mw.c.copts.clientNoContextTakeover\n\t}\n\treturn !mw.c.copts.serverNoContextTakeover\n}\n\nfunc (c *Conn) writer(ctx context.Context, typ MessageType) (io.WriteCloser, error) {\n\terr := c.msgWriter.reset(ctx, typ)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.msgWriter, nil\n}\n\nfunc (c *Conn) write(ctx context.Context, typ MessageType, p []byte) (int, error) {\n\tmw, err := c.writer(ctx, typ)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tif !c.flate() {\n\t\tdefer c.msgWriter.mu.unlock()\n\t\treturn c.writeFrame(ctx, true, false, c.msgWriter.opcode, p)\n\t}\n\n\tn, err := mw.Write(p)\n\tif err != nil {\n\t\treturn n, err\n\t}\n\n\terr = mw.Close()\n\treturn n, err\n}\n\nfunc (mw *msgWriter) reset(ctx context.Context, typ MessageType) error {\n\terr := mw.mu.lock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmw.ctx = ctx\n\tmw.opcode = opcode(typ)\n\tmw.flate = false\n\tmw.closed = false\n\n\tmw.trimWriter.reset()\n\n\treturn nil\n}\n\nfunc (mw *msgWriter) putFlateWriter() {\n\tif mw.flateWriter != nil {\n\t\tputFlateWriter(mw.flateWriter)\n\t\tmw.flateWriter = nil\n\t}\n}\n\n// Write writes the given bytes to the WebSocket connection.\nfunc (mw *msgWriter) Write(p []byte) (_ int, err error) {\n\terr = mw.writeMu.lock(mw.ctx)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to write: %w\", err)\n\t}\n\tdefer mw.writeMu.unlock()\n\n\tif mw.closed {\n\t\treturn 0, errors.New(\"cannot use closed writer\")\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"failed to write: %w\", err)\n\t\t}\n\t}()\n\n\tif mw.c.flate() {\n\t\t// Only enables flate if the length crosses the\n\t\t// threshold on the first frame\n\t\tif mw.opcode != opContinuation && len(p) >= mw.c.flateThreshold {\n\t\t\tmw.ensureFlate()\n\t\t}\n\t}\n\n\tif mw.flate {\n\t\treturn mw.flateWriter.Write(p)\n\t}\n\n\treturn mw.write(p)\n}\n\nfunc (mw *msgWriter) write(p []byte) (int, error) {\n\tn, err := mw.c.writeFrame(mw.ctx, false, mw.flate, mw.opcode, p)\n\tif err != nil {\n\t\treturn n, fmt.Errorf(\"failed to write data frame: %w\", err)\n\t}\n\tmw.opcode = opContinuation\n\treturn n, nil\n}\n\n// Close flushes the frame to the connection.\nfunc (mw *msgWriter) Close() (err error) {\n\tdefer errd.Wrap(&err, \"failed to close writer\")\n\n\terr = mw.writeMu.lock(mw.ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer mw.writeMu.unlock()\n\n\tif mw.closed {\n\t\treturn errors.New(\"writer already closed\")\n\t}\n\tmw.closed = true\n\n\tif mw.flate {\n\t\terr = mw.flateWriter.Flush()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to flush flate: %w\", err)\n\t\t}\n\t}\n\n\t_, err = mw.c.writeFrame(mw.ctx, true, mw.flate, mw.opcode, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write fin frame: %w\", err)\n\t}\n\n\tif mw.flate && !mw.flateContextTakeover() {\n\t\tmw.putFlateWriter()\n\t}\n\tmw.mu.unlock()\n\treturn nil\n}\n\nfunc (mw *msgWriter) close() {\n\tif mw.c.client {\n\t\tmw.c.writeFrameMu.forceLock()\n\t\tputBufioWriter(mw.c.bw)\n\t}\n\n\tmw.writeMu.forceLock()\n\tmw.putFlateWriter()\n}\n\nfunc (c *Conn) writeControl(ctx context.Context, opcode opcode, p []byte) error {\n\tctx, cancel := context.WithTimeout(ctx, time.Second*5)\n\tdefer cancel()\n\n\t_, err := c.writeFrame(ctx, true, false, opcode, p)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write control frame %v: %w\", opcode, err)\n\t}\n\treturn nil\n}\n\n// writeFrame handles all writes to the connection.\nfunc (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opcode, p []byte) (_ int, err error) {\n\terr = c.writeFrameMu.lock(ctx)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer c.writeFrameMu.unlock()\n\n\tselect {\n\tcase <-c.closed:\n\t\treturn 0, net.ErrClosed\n\tcase c.writeTimeout <- ctx:\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-c.closed:\n\t\t\t\terr = net.ErrClosed\n\t\t\tcase <-ctx.Done():\n\t\t\t\terr = ctx.Err()\n\t\t\tdefault:\n\t\t\t}\n\t\t\terr = fmt.Errorf(\"failed to write frame: %w\", err)\n\t\t}\n\t}()\n\n\tc.writeHeader.fin = fin\n\tc.writeHeader.opcode = opcode\n\tc.writeHeader.payloadLength = int64(len(p))\n\n\tif c.client {\n\t\tc.writeHeader.masked = true\n\t\t_, err = io.ReadFull(rand.Reader, c.writeHeaderBuf[:4])\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"failed to generate masking key: %w\", err)\n\t\t}\n\t\tc.writeHeader.maskKey = binary.LittleEndian.Uint32(c.writeHeaderBuf[:])\n\t}\n\n\tc.writeHeader.rsv1 = false\n\tif flate && (opcode == opText || opcode == opBinary) {\n\t\tc.writeHeader.rsv1 = true\n\t}\n\n\terr = writeFrameHeader(c.writeHeader, c.bw, c.writeHeaderBuf[:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn, err := c.writeFramePayload(p)\n\tif err != nil {\n\t\treturn n, err\n\t}\n\n\tif c.writeHeader.fin {\n\t\terr = c.bw.Flush()\n\t\tif err != nil {\n\t\t\treturn n, fmt.Errorf(\"failed to flush: %w\", err)\n\t\t}\n\t}\n\n\tselect {\n\tcase <-c.closed:\n\t\tif opcode == opClose {\n\t\t\treturn n, nil\n\t\t}\n\t\treturn n, net.ErrClosed\n\tcase c.writeTimeout <- context.Background():\n\t}\n\n\treturn n, nil\n}\n\nfunc (c *Conn) writeFramePayload(p []byte) (n int, err error) {\n\tdefer errd.Wrap(&err, \"failed to write frame payload\")\n\n\tif !c.writeHeader.masked {\n\t\treturn c.bw.Write(p)\n\t}\n\n\tmaskKey := c.writeHeader.maskKey\n\tfor len(p) > 0 {\n\t\t// If the buffer is full, we need to flush.\n\t\tif c.bw.Available() == 0 {\n\t\t\terr = c.bw.Flush()\n\t\t\tif err != nil {\n\t\t\t\treturn n, err\n\t\t\t}\n\t\t}\n\n\t\t// Start of next write in the buffer.\n\t\ti := c.bw.Buffered()\n\n\t\tj := len(p)\n\t\tif j > c.bw.Available() {\n\t\t\tj = c.bw.Available()\n\t\t}\n\n\t\t_, err := c.bw.Write(p[:j])\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\t\tmaskKey = mask(c.writeBuf[i:c.bw.Buffered()], maskKey)\n\n\t\tp = p[j:]\n\t\tn += j\n\t}\n\n\treturn n, nil\n}\n\n// extractBufioWriterBuf grabs the []byte backing a *bufio.Writer\n// and returns it.\nfunc extractBufioWriterBuf(bw *bufio.Writer, w io.Writer) []byte {\n\tvar writeBuf []byte\n\tbw.Reset(util.WriterFunc(func(p2 []byte) (int, error) {\n\t\twriteBuf = p2[:cap(p2)]\n\t\treturn len(p2), nil\n\t}))\n\n\tbw.WriteByte(0)\n\tbw.Flush()\n\n\tbw.Reset(w)\n\n\treturn writeBuf\n}\n\nfunc (c *Conn) writeError(code StatusCode, err error) {\n\tc.writeClose(code, err.Error())\n}\n"
  },
  {
    "path": "vendor/github.com/coder/websocket/ws_js.go",
    "content": "package websocket // import \"github.com/coder/websocket\"\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall/js\"\n\n\t\"github.com/coder/websocket/internal/bpool\"\n\t\"github.com/coder/websocket/internal/wsjs\"\n\t\"github.com/coder/websocket/internal/xsync\"\n)\n\n// opcode represents a WebSocket opcode.\ntype opcode int\n\n// https://tools.ietf.org/html/rfc6455#section-11.8.\nconst (\n\topContinuation opcode = iota\n\topText\n\topBinary\n\t// 3 - 7 are reserved for further non-control frames.\n\t_\n\t_\n\t_\n\t_\n\t_\n\topClose\n\topPing\n\topPong\n\t// 11-16 are reserved for further control frames.\n)\n\n// Conn provides a wrapper around the browser WebSocket API.\ntype Conn struct {\n\tnoCopy noCopy\n\tws     wsjs.WebSocket\n\n\t// read limit for a message in bytes.\n\tmsgReadLimit xsync.Int64\n\n\tcloseReadMu  sync.Mutex\n\tcloseReadCtx context.Context\n\n\tclosingMu     sync.Mutex\n\tcloseOnce     sync.Once\n\tclosed        chan struct{}\n\tcloseErrOnce  sync.Once\n\tcloseErr      error\n\tcloseWasClean bool\n\n\treleaseOnClose   func()\n\treleaseOnError   func()\n\treleaseOnMessage func()\n\n\treadSignal chan struct{}\n\treadBufMu  sync.Mutex\n\treadBuf    []wsjs.MessageEvent\n}\n\nfunc (c *Conn) close(err error, wasClean bool) {\n\tc.closeOnce.Do(func() {\n\t\truntime.SetFinalizer(c, nil)\n\n\t\tif !wasClean {\n\t\t\terr = fmt.Errorf(\"unclean connection close: %w\", err)\n\t\t}\n\t\tc.setCloseErr(err)\n\t\tc.closeWasClean = wasClean\n\t\tclose(c.closed)\n\t})\n}\n\nfunc (c *Conn) init() {\n\tc.closed = make(chan struct{})\n\tc.readSignal = make(chan struct{}, 1)\n\n\tc.msgReadLimit.Store(32768)\n\n\tc.releaseOnClose = c.ws.OnClose(func(e wsjs.CloseEvent) {\n\t\terr := CloseError{\n\t\t\tCode:   StatusCode(e.Code),\n\t\t\tReason: e.Reason,\n\t\t}\n\t\t// We do not know if we sent or received this close as\n\t\t// its possible the browser triggered it without us\n\t\t// explicitly sending it.\n\t\tc.close(err, e.WasClean)\n\n\t\tc.releaseOnClose()\n\t\tc.releaseOnError()\n\t\tc.releaseOnMessage()\n\t})\n\n\tc.releaseOnError = c.ws.OnError(func(v js.Value) {\n\t\tc.setCloseErr(errors.New(v.Get(\"message\").String()))\n\t\tc.closeWithInternal()\n\t})\n\n\tc.releaseOnMessage = c.ws.OnMessage(func(e wsjs.MessageEvent) {\n\t\tc.readBufMu.Lock()\n\t\tdefer c.readBufMu.Unlock()\n\n\t\tc.readBuf = append(c.readBuf, e)\n\n\t\t// Lets the read goroutine know there is definitely something in readBuf.\n\t\tselect {\n\t\tcase c.readSignal <- struct{}{}:\n\t\tdefault:\n\t\t}\n\t})\n\n\truntime.SetFinalizer(c, func(c *Conn) {\n\t\tc.setCloseErr(errors.New(\"connection garbage collected\"))\n\t\tc.closeWithInternal()\n\t})\n}\n\nfunc (c *Conn) closeWithInternal() {\n\tc.Close(StatusInternalError, \"something went wrong\")\n}\n\n// Read attempts to read a message from the connection.\n// The maximum time spent waiting is bounded by the context.\nfunc (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) {\n\tc.closeReadMu.Lock()\n\tclosedRead := c.closeReadCtx != nil\n\tc.closeReadMu.Unlock()\n\tif closedRead {\n\t\treturn 0, nil, errors.New(\"WebSocket connection read closed\")\n\t}\n\n\ttyp, p, err := c.read(ctx)\n\tif err != nil {\n\t\treturn 0, nil, fmt.Errorf(\"failed to read: %w\", err)\n\t}\n\treadLimit := c.msgReadLimit.Load()\n\tif readLimit >= 0 && int64(len(p)) > readLimit {\n\t\terr := fmt.Errorf(\"read limited at %v bytes\", c.msgReadLimit.Load())\n\t\tc.Close(StatusMessageTooBig, err.Error())\n\t\treturn 0, nil, err\n\t}\n\treturn typ, p, nil\n}\n\nfunc (c *Conn) read(ctx context.Context) (MessageType, []byte, error) {\n\tselect {\n\tcase <-ctx.Done():\n\t\tc.Close(StatusPolicyViolation, \"read timed out\")\n\t\treturn 0, nil, ctx.Err()\n\tcase <-c.readSignal:\n\tcase <-c.closed:\n\t\treturn 0, nil, net.ErrClosed\n\t}\n\n\tc.readBufMu.Lock()\n\tdefer c.readBufMu.Unlock()\n\n\tme := c.readBuf[0]\n\t// We copy the messages forward and decrease the size\n\t// of the slice to avoid reallocating.\n\tcopy(c.readBuf, c.readBuf[1:])\n\tc.readBuf = c.readBuf[:len(c.readBuf)-1]\n\n\tif len(c.readBuf) > 0 {\n\t\t// Next time we read, we'll grab the message.\n\t\tselect {\n\t\tcase c.readSignal <- struct{}{}:\n\t\tdefault:\n\t\t}\n\t}\n\n\tswitch p := me.Data.(type) {\n\tcase string:\n\t\treturn MessageText, []byte(p), nil\n\tcase []byte:\n\t\treturn MessageBinary, p, nil\n\tdefault:\n\t\tpanic(\"websocket: unexpected data type from wsjs OnMessage: \" + reflect.TypeOf(me.Data).String())\n\t}\n}\n\n// Ping is mocked out for Wasm.\nfunc (c *Conn) Ping(ctx context.Context) error {\n\treturn nil\n}\n\n// Write writes a message of the given type to the connection.\n// Always non blocking.\nfunc (c *Conn) Write(ctx context.Context, typ MessageType, p []byte) error {\n\terr := c.write(ctx, typ, p)\n\tif err != nil {\n\t\t// Have to ensure the WebSocket is closed after a write error\n\t\t// to match the Go API. It can only error if the message type\n\t\t// is unexpected or the passed bytes contain invalid UTF-8 for\n\t\t// MessageText.\n\t\terr := fmt.Errorf(\"failed to write: %w\", err)\n\t\tc.setCloseErr(err)\n\t\tc.closeWithInternal()\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *Conn) write(ctx context.Context, typ MessageType, p []byte) error {\n\tif c.isClosed() {\n\t\treturn net.ErrClosed\n\t}\n\tswitch typ {\n\tcase MessageBinary:\n\t\treturn c.ws.SendBytes(p)\n\tcase MessageText:\n\t\treturn c.ws.SendText(string(p))\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected message type: %v\", typ)\n\t}\n}\n\n// Close closes the WebSocket with the given code and reason.\n// It will wait until the peer responds with a close frame\n// or the connection is closed.\n// It thus performs the full WebSocket close handshake.\nfunc (c *Conn) Close(code StatusCode, reason string) error {\n\terr := c.exportedClose(code, reason)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to close WebSocket: %w\", err)\n\t}\n\treturn nil\n}\n\n// CloseNow closes the WebSocket connection without attempting a close handshake.\n// Use when you do not want the overhead of the close handshake.\n//\n// note: No different from Close(StatusGoingAway, \"\") in WASM as there is no way to close\n// a WebSocket without the close handshake.\nfunc (c *Conn) CloseNow() error {\n\treturn c.Close(StatusGoingAway, \"\")\n}\n\nfunc (c *Conn) exportedClose(code StatusCode, reason string) error {\n\tc.closingMu.Lock()\n\tdefer c.closingMu.Unlock()\n\n\tif c.isClosed() {\n\t\treturn net.ErrClosed\n\t}\n\n\tce := fmt.Errorf(\"sent close: %w\", CloseError{\n\t\tCode:   code,\n\t\tReason: reason,\n\t})\n\n\tc.setCloseErr(ce)\n\terr := c.ws.Close(int(code), reason)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t<-c.closed\n\tif !c.closeWasClean {\n\t\treturn c.closeErr\n\t}\n\treturn nil\n}\n\n// Subprotocol returns the negotiated subprotocol.\n// An empty string means the default protocol.\nfunc (c *Conn) Subprotocol() string {\n\treturn c.ws.Subprotocol()\n}\n\n// DialOptions represents the options available to pass to Dial.\ntype DialOptions struct {\n\t// Subprotocols lists the subprotocols to negotiate with the server.\n\tSubprotocols []string\n}\n\n// Dial creates a new WebSocket connection to the given url with the given options.\n// The passed context bounds the maximum time spent waiting for the connection to open.\n// The returned *http.Response is always nil or a mock. It's only in the signature\n// to match the core API.\nfunc Dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Response, error) {\n\tc, resp, err := dial(ctx, url, opts)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to WebSocket dial %q: %w\", url, err)\n\t}\n\treturn c, resp, nil\n}\n\nfunc dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Response, error) {\n\tif opts == nil {\n\t\topts = &DialOptions{}\n\t}\n\n\turl = strings.Replace(url, \"http://\", \"ws://\", 1)\n\turl = strings.Replace(url, \"https://\", \"wss://\", 1)\n\n\tws, err := wsjs.New(url, opts.Subprotocols)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tc := &Conn{\n\t\tws: ws,\n\t}\n\tc.init()\n\n\topench := make(chan struct{})\n\treleaseOpen := ws.OnOpen(func(e js.Value) {\n\t\tclose(opench)\n\t})\n\tdefer releaseOpen()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\tc.Close(StatusPolicyViolation, \"dial timed out\")\n\t\treturn nil, nil, ctx.Err()\n\tcase <-opench:\n\t\treturn c, &http.Response{\n\t\t\tStatusCode: http.StatusSwitchingProtocols,\n\t\t}, nil\n\tcase <-c.closed:\n\t\treturn nil, nil, net.ErrClosed\n\t}\n}\n\n// Reader attempts to read a message from the connection.\n// The maximum time spent waiting is bounded by the context.\nfunc (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {\n\ttyp, p, err := c.Read(ctx)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\treturn typ, bytes.NewReader(p), nil\n}\n\n// Writer returns a writer to write a WebSocket data message to the connection.\n// It buffers the entire message in memory and then sends it when the writer\n// is closed.\nfunc (c *Conn) Writer(ctx context.Context, typ MessageType) (io.WriteCloser, error) {\n\treturn &writer{\n\t\tc:   c,\n\t\tctx: ctx,\n\t\ttyp: typ,\n\t\tb:   bpool.Get(),\n\t}, nil\n}\n\ntype writer struct {\n\tclosed bool\n\n\tc   *Conn\n\tctx context.Context\n\ttyp MessageType\n\n\tb *bytes.Buffer\n}\n\nfunc (w *writer) Write(p []byte) (int, error) {\n\tif w.closed {\n\t\treturn 0, errors.New(\"cannot write to closed writer\")\n\t}\n\tn, err := w.b.Write(p)\n\tif err != nil {\n\t\treturn n, fmt.Errorf(\"failed to write message: %w\", err)\n\t}\n\treturn n, nil\n}\n\nfunc (w *writer) Close() error {\n\tif w.closed {\n\t\treturn errors.New(\"cannot close closed writer\")\n\t}\n\tw.closed = true\n\tdefer bpool.Put(w.b)\n\n\terr := w.c.Write(w.ctx, w.typ, w.b.Bytes())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to close writer: %w\", err)\n\t}\n\treturn nil\n}\n\n// CloseRead implements *Conn.CloseRead for wasm.\nfunc (c *Conn) CloseRead(ctx context.Context) context.Context {\n\tc.closeReadMu.Lock()\n\tctx2 := c.closeReadCtx\n\tif ctx2 != nil {\n\t\tc.closeReadMu.Unlock()\n\t\treturn ctx2\n\t}\n\tctx, cancel := context.WithCancel(ctx)\n\tc.closeReadCtx = ctx\n\tc.closeReadMu.Unlock()\n\n\tgo func() {\n\t\tdefer cancel()\n\t\tdefer c.CloseNow()\n\t\t_, _, err := c.read(ctx)\n\t\tif err != nil {\n\t\t\tc.Close(StatusPolicyViolation, \"unexpected data message\")\n\t\t}\n\t}()\n\treturn ctx\n}\n\n// SetReadLimit implements *Conn.SetReadLimit for wasm.\nfunc (c *Conn) SetReadLimit(n int64) {\n\tc.msgReadLimit.Store(n)\n}\n\nfunc (c *Conn) setCloseErr(err error) {\n\tc.closeErrOnce.Do(func() {\n\t\tc.closeErr = fmt.Errorf(\"WebSocket closed: %w\", err)\n\t})\n}\n\nfunc (c *Conn) isClosed() bool {\n\tselect {\n\tcase <-c.closed:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// AcceptOptions represents Accept's options.\ntype AcceptOptions struct {\n\tSubprotocols         []string\n\tInsecureSkipVerify   bool\n\tOriginPatterns       []string\n\tCompressionMode      CompressionMode\n\tCompressionThreshold int\n}\n\n// Accept is stubbed out for Wasm.\nfunc Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) {\n\treturn nil, errors.New(\"unimplemented\")\n}\n\n// StatusCode represents a WebSocket status code.\n// https://tools.ietf.org/html/rfc6455#section-7.4\ntype StatusCode int\n\n// https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number\n//\n// These are only the status codes defined by the protocol.\n//\n// You can define custom codes in the 3000-4999 range.\n// The 3000-3999 range is reserved for use by libraries, frameworks and applications.\n// The 4000-4999 range is reserved for private use.\nconst (\n\tStatusNormalClosure   StatusCode = 1000\n\tStatusGoingAway       StatusCode = 1001\n\tStatusProtocolError   StatusCode = 1002\n\tStatusUnsupportedData StatusCode = 1003\n\n\t// 1004 is reserved and so unexported.\n\tstatusReserved StatusCode = 1004\n\n\t// StatusNoStatusRcvd cannot be sent in a close message.\n\t// It is reserved for when a close message is received without\n\t// a status code.\n\tStatusNoStatusRcvd StatusCode = 1005\n\n\t// StatusAbnormalClosure is exported for use only with Wasm.\n\t// In non Wasm Go, the returned error will indicate whether the\n\t// connection was closed abnormally.\n\tStatusAbnormalClosure StatusCode = 1006\n\n\tStatusInvalidFramePayloadData StatusCode = 1007\n\tStatusPolicyViolation         StatusCode = 1008\n\tStatusMessageTooBig           StatusCode = 1009\n\tStatusMandatoryExtension      StatusCode = 1010\n\tStatusInternalError           StatusCode = 1011\n\tStatusServiceRestart          StatusCode = 1012\n\tStatusTryAgainLater           StatusCode = 1013\n\tStatusBadGateway              StatusCode = 1014\n\n\t// StatusTLSHandshake is only exported for use with Wasm.\n\t// In non Wasm Go, the returned error will indicate whether there was\n\t// a TLS handshake failure.\n\tStatusTLSHandshake StatusCode = 1015\n)\n\n// CloseError is returned when the connection is closed with a status and reason.\n//\n// Use Go 1.13's errors.As to check for this error.\n// Also see the CloseStatus helper.\ntype CloseError struct {\n\tCode   StatusCode\n\tReason string\n}\n\nfunc (ce CloseError) Error() string {\n\treturn fmt.Sprintf(\"status = %v and reason = %q\", ce.Code, ce.Reason)\n}\n\n// CloseStatus is a convenience wrapper around Go 1.13's errors.As to grab\n// the status code from a CloseError.\n//\n// -1 will be returned if the passed error is nil or not a CloseError.\nfunc CloseStatus(err error) StatusCode {\n\tvar ce CloseError\n\tif errors.As(err, &ce) {\n\t\treturn ce.Code\n\t}\n\treturn -1\n}\n\n// CompressionMode represents the modes available to the deflate extension.\n// See https://tools.ietf.org/html/rfc7692\n// Works in all browsers except Safari which does not implement the deflate extension.\ntype CompressionMode int\n\nconst (\n\t// CompressionNoContextTakeover grabs a new flate.Reader and flate.Writer as needed\n\t// for every message. This applies to both server and client side.\n\t//\n\t// This means less efficient compression as the sliding window from previous messages\n\t// will not be used but the memory overhead will be lower if the connections\n\t// are long lived and seldom used.\n\t//\n\t// The message will only be compressed if greater than 512 bytes.\n\tCompressionNoContextTakeover CompressionMode = iota\n\n\t// CompressionContextTakeover uses a flate.Reader and flate.Writer per connection.\n\t// This enables reusing the sliding window from previous messages.\n\t// As most WebSocket protocols are repetitive, this can be very efficient.\n\t// It carries an overhead of 8 kB for every connection compared to CompressionNoContextTakeover.\n\t//\n\t// If the peer negotiates NoContextTakeover on the client or server side, it will be\n\t// used instead as this is required by the RFC.\n\tCompressionContextTakeover\n\n\t// CompressionDisabled disables the deflate extension.\n\t//\n\t// Use this if you are using a predominantly binary protocol with very\n\t// little duplication in between messages or CPU and memory are more\n\t// important than bandwidth.\n\tCompressionDisabled\n)\n\n// MessageType represents the type of a WebSocket message.\n// See https://tools.ietf.org/html/rfc6455#section-5.6\ntype MessageType int\n\n// MessageType constants.\nconst (\n\t// MessageText is for UTF-8 encoded text messages like JSON.\n\tMessageText MessageType = iota + 1\n\t// MessageBinary is for binary messages like protobufs.\n\tMessageBinary\n)\n\ntype mu struct {\n\tc  *Conn\n\tch chan struct{}\n}\n\nfunc newMu(c *Conn) *mu {\n\treturn &mu{\n\t\tc:  c,\n\t\tch: make(chan struct{}, 1),\n\t}\n}\n\nfunc (m *mu) forceLock() {\n\tm.ch <- struct{}{}\n}\n\nfunc (m *mu) tryLock() bool {\n\tselect {\n\tcase m.ch <- struct{}{}:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (m *mu) unlock() {\n\tselect {\n\tcase <-m.ch:\n\tdefault:\n\t}\n}\n\ntype noCopy struct{}\n\nfunc (*noCopy) Lock() {}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2013-2017 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/NOTICE",
    "content": "The Compose Specification\nCopyright 2020 The Compose Specification Authors\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/cli/options.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage cli\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/compose-spec/compose-go/v2/consts\"\n\t\"github.com/compose-spec/compose-go/v2/dotenv\"\n\t\"github.com/compose-spec/compose-go/v2/errdefs\"\n\t\"github.com/compose-spec/compose-go/v2/loader\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/compose-spec/compose-go/v2/utils\"\n)\n\n// ProjectOptions provides common configuration for loading a project.\ntype ProjectOptions struct {\n\t// Name is a valid Compose project name to be used or empty.\n\t//\n\t// If empty, the project loader will automatically infer a reasonable\n\t// project name if possible.\n\tName string\n\n\t// WorkingDir is a file path to use as the project directory or empty.\n\t//\n\t// If empty, the project loader will automatically infer a reasonable\n\t// working directory if possible.\n\tWorkingDir string\n\n\t// ConfigPaths are file paths to one or more Compose files.\n\t//\n\t// These are applied in order by the loader following the override logic\n\t// as described in the spec.\n\t//\n\t// The first entry is required and is the primary Compose file.\n\t// For convenience, WithConfigFileEnv and WithDefaultConfigPath\n\t// are provided to populate this in a predictable manner.\n\tConfigPaths []string\n\n\t// Environment are additional environment variables to make available\n\t// for interpolation.\n\t//\n\t// NOTE: For security, the loader does not automatically expose any\n\t// process environment variables. For convenience, WithOsEnv can be\n\t// used if appropriate.\n\tEnvironment types.Mapping\n\n\t// EnvFiles are file paths to \".env\" files with additional environment\n\t// variable data.\n\t//\n\t// These are loaded in-order, so it is possible to override variables or\n\t// in subsequent files.\n\t//\n\t// This field is optional, but any file paths that are included here must\n\t// exist or an error will be returned during load.\n\tEnvFiles []string\n\n\tloadOptions []func(*loader.Options)\n\n\t// Callbacks to retrieve metadata information during parse defined before\n\t// creating the project\n\tListeners []loader.Listener\n}\n\ntype ProjectOptionsFn func(*ProjectOptions) error\n\n// NewProjectOptions creates ProjectOptions\nfunc NewProjectOptions(configs []string, opts ...ProjectOptionsFn) (*ProjectOptions, error) {\n\toptions := &ProjectOptions{\n\t\tConfigPaths: configs,\n\t\tEnvironment: map[string]string{},\n\t\tListeners:   []loader.Listener{},\n\t}\n\tfor _, o := range opts {\n\t\terr := o(options)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn options, nil\n}\n\n// WithName defines ProjectOptions' name\nfunc WithName(name string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\t// a project (once loaded) cannot have an empty name\n\t\t// however, on the options object, the name is optional: if unset,\n\t\t// a name will be inferred by the loader, so it's legal to set the\n\t\t// name to an empty string here\n\t\tif name != loader.NormalizeProjectName(name) {\n\t\t\treturn loader.InvalidProjectNameErr(name)\n\t\t}\n\t\to.Name = name\n\t\treturn nil\n\t}\n}\n\n// WithWorkingDirectory defines ProjectOptions' working directory\nfunc WithWorkingDirectory(wd string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\tif wd == \"\" {\n\t\t\treturn nil\n\t\t}\n\t\tabs, err := filepath.Abs(wd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\to.WorkingDir = abs\n\t\treturn nil\n\t}\n}\n\n// WithConfigFileEnv allow to set compose config file paths by COMPOSE_FILE environment variable\nfunc WithConfigFileEnv(o *ProjectOptions) error {\n\tif len(o.ConfigPaths) > 0 {\n\t\treturn nil\n\t}\n\tsep := o.Environment[consts.ComposePathSeparator]\n\tif sep == \"\" {\n\t\tsep = string(os.PathListSeparator)\n\t}\n\tf, ok := o.Environment[consts.ComposeFilePath]\n\tif ok {\n\t\tpaths, err := absolutePaths(strings.Split(f, sep))\n\t\to.ConfigPaths = paths\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// WithDefaultConfigPath searches for default config files from working directory\nfunc WithDefaultConfigPath(o *ProjectOptions) error {\n\tif len(o.ConfigPaths) > 0 {\n\t\treturn nil\n\t}\n\tpwd, err := o.GetWorkingDir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor {\n\t\tcandidates := findFiles(DefaultFileNames, pwd)\n\t\tif len(candidates) > 0 {\n\t\t\twinner := candidates[0]\n\t\t\tif len(candidates) > 1 {\n\t\t\t\tlogrus.Warnf(\"Found multiple config files with supported names: %s\", strings.Join(candidates, \", \"))\n\t\t\t\tlogrus.Warnf(\"Using %s\", winner)\n\t\t\t}\n\t\t\to.ConfigPaths = append(o.ConfigPaths, winner)\n\n\t\t\toverrides := findFiles(DefaultOverrideFileNames, pwd)\n\t\t\tif len(overrides) > 0 {\n\t\t\t\tif len(overrides) > 1 {\n\t\t\t\t\tlogrus.Warnf(\"Found multiple override files with supported names: %s\", strings.Join(overrides, \", \"))\n\t\t\t\t\tlogrus.Warnf(\"Using %s\", overrides[0])\n\t\t\t\t}\n\t\t\t\to.ConfigPaths = append(o.ConfigPaths, overrides[0])\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tparent := filepath.Dir(pwd)\n\t\tif parent == pwd {\n\t\t\t// no config file found, but that's not a blocker if caller only needs project name\n\t\t\treturn nil\n\t\t}\n\t\tpwd = parent\n\t}\n}\n\n// WithEnv defines a key=value set of variables used for compose file interpolation\nfunc WithEnv(env []string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\tfor k, v := range utils.GetAsEqualsMap(env) {\n\t\t\to.Environment[k] = v\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// WithDiscardEnvFile sets discards the `env_file` section after resolving to\n// the `environment` section\nfunc WithDiscardEnvFile(o *ProjectOptions) error {\n\to.loadOptions = append(o.loadOptions, loader.WithDiscardEnvFiles)\n\treturn nil\n}\n\n// WithLoadOptions provides a hook to control how compose files are loaded\nfunc WithLoadOptions(loadOptions ...func(*loader.Options)) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, loadOptions...)\n\t\treturn nil\n\t}\n}\n\n// WithDefaultProfiles uses the provided profiles (if any), and falls back to\n// profiles specified via the COMPOSE_PROFILES environment variable otherwise.\nfunc WithDefaultProfiles(profiles ...string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\tif len(profiles) == 0 {\n\t\t\tfor _, s := range strings.Split(o.Environment[consts.ComposeProfiles], \",\") {\n\t\t\t\tprofiles = append(profiles, strings.TrimSpace(s))\n\t\t\t}\n\t\t}\n\t\to.loadOptions = append(o.loadOptions, loader.WithProfiles(profiles))\n\t\treturn nil\n\t}\n}\n\n// WithProfiles sets profiles to be activated\nfunc WithProfiles(profiles []string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, loader.WithProfiles(profiles))\n\t\treturn nil\n\t}\n}\n\n// WithOsEnv imports environment variables from OS\nfunc WithOsEnv(o *ProjectOptions) error {\n\tfor k, v := range utils.GetAsEqualsMap(os.Environ()) {\n\t\tif _, set := o.Environment[k]; set {\n\t\t\tcontinue\n\t\t}\n\t\to.Environment[k] = v\n\t}\n\treturn nil\n}\n\n// WithEnvFile sets an alternate env file.\n//\n// Deprecated: use WithEnvFiles instead.\nfunc WithEnvFile(file string) ProjectOptionsFn {\n\tvar files []string\n\tif file != \"\" {\n\t\tfiles = []string{file}\n\t}\n\treturn WithEnvFiles(files...)\n}\n\n// WithEnvFiles set env file(s) to be loaded to set project environment.\n// defaults to local .env file if no explicit file is selected, until COMPOSE_DISABLE_ENV_FILE is set\nfunc WithEnvFiles(file ...string) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\tif len(file) > 0 {\n\t\t\to.EnvFiles = file\n\t\t\treturn nil\n\t\t}\n\t\tif v, ok := os.LookupEnv(consts.ComposeDisableDefaultEnvFile); ok {\n\t\t\tb, err := strconv.ParseBool(v)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif b {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\twd, err := o.GetWorkingDir()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefaultDotEnv := filepath.Join(wd, \".env\")\n\n\t\ts, err := os.Stat(defaultDotEnv)\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !s.IsDir() {\n\t\t\to.EnvFiles = []string{defaultDotEnv}\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// WithDotEnv imports environment variables from .env file\nfunc WithDotEnv(o *ProjectOptions) error {\n\tenvMap, err := dotenv.GetEnvFromFile(o.Environment, o.EnvFiles)\n\tif err != nil {\n\t\treturn err\n\t}\n\to.Environment.Merge(envMap)\n\treturn nil\n}\n\n// WithInterpolation set ProjectOptions to enable/skip interpolation\nfunc WithInterpolation(interpolation bool) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\toptions.SkipInterpolation = !interpolation\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// WithNormalization set ProjectOptions to enable/skip normalization\nfunc WithNormalization(normalization bool) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\toptions.SkipNormalization = !normalization\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// WithConsistency set ProjectOptions to enable/skip consistency\nfunc WithConsistency(consistency bool) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\toptions.SkipConsistencyCheck = !consistency\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// WithResolvedPaths set ProjectOptions to enable paths resolution\nfunc WithResolvedPaths(resolve bool) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\toptions.ResolvePaths = resolve\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// WithResourceLoader register support for ResourceLoader to manage remote resources\nfunc WithResourceLoader(r loader.ResourceLoader) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\toptions.ResourceLoaders = append(options.ResourceLoaders, r)\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// WithExtension register a know extension `x-*` with the go struct type to decode into\nfunc WithExtension(name string, typ any) ProjectOptionsFn {\n\treturn func(o *ProjectOptions) error {\n\t\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\t\tif options.KnownExtensions == nil {\n\t\t\t\toptions.KnownExtensions = map[string]any{}\n\t\t\t}\n\t\t\toptions.KnownExtensions[name] = typ\n\t\t})\n\t\treturn nil\n\t}\n}\n\n// Append listener to event\nfunc (o *ProjectOptions) WithListeners(listeners ...loader.Listener) {\n\to.Listeners = append(o.Listeners, listeners...)\n}\n\n// WithoutEnvironmentResolution disable environment resolution\nfunc WithoutEnvironmentResolution(o *ProjectOptions) error {\n\to.loadOptions = append(o.loadOptions, func(options *loader.Options) {\n\t\toptions.SkipResolveEnvironment = true\n\t})\n\treturn nil\n}\n\n// DefaultFileNames defines the Compose file names for auto-discovery (in order of preference)\nvar DefaultFileNames = []string{\"compose.yaml\", \"compose.yml\", \"docker-compose.yml\", \"docker-compose.yaml\"}\n\n// DefaultOverrideFileNames defines the Compose override file names for auto-discovery (in order of preference)\nvar DefaultOverrideFileNames = []string{\"compose.override.yml\", \"compose.override.yaml\", \"docker-compose.override.yml\", \"docker-compose.override.yaml\"}\n\nfunc (o *ProjectOptions) GetWorkingDir() (string, error) {\n\tif o.WorkingDir != \"\" {\n\t\treturn filepath.Abs(o.WorkingDir)\n\t}\n\tfor _, path := range o.ConfigPaths {\n\t\tif path != \"-\" {\n\t\t\tabsPath, err := filepath.Abs(path)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\treturn filepath.Dir(absPath), nil\n\t\t}\n\t}\n\treturn os.Getwd()\n}\n\nfunc (o *ProjectOptions) GetConfigFiles() ([]types.ConfigFile, error) {\n\tconfigPaths, err := o.getConfigPaths()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar configs []types.ConfigFile\n\tfor _, f := range configPaths {\n\t\tvar b []byte\n\t\tif f == \"-\" {\n\t\t\tb, err = io.ReadAll(os.Stdin)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tf, err := filepath.Abs(f)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tb, err = os.ReadFile(f)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tconfigs = append(configs, types.ConfigFile{\n\t\t\tFilename: f,\n\t\t\tContent:  b,\n\t\t})\n\t}\n\treturn configs, err\n}\n\n// LoadProject loads compose file according to options and bind to types.Project go structs\nfunc (o *ProjectOptions) LoadProject(ctx context.Context) (*types.Project, error) {\n\tconfigDetails, err := o.prepare()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproject, err := loader.LoadWithContext(ctx, configDetails, o.loadOptions...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, config := range configDetails.ConfigFiles {\n\t\tproject.ComposeFiles = append(project.ComposeFiles, config.Filename)\n\t}\n\n\treturn project, nil\n}\n\n// LoadModel loads compose file according to options and returns a raw (yaml tree) model\nfunc (o *ProjectOptions) LoadModel(ctx context.Context) (map[string]any, error) {\n\tconfigDetails, err := o.prepare()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn loader.LoadModelWithContext(ctx, configDetails, o.loadOptions...)\n}\n\n// prepare converts ProjectOptions into loader's types.ConfigDetails and configures default load options\nfunc (o *ProjectOptions) prepare() (types.ConfigDetails, error) {\n\tconfigs, err := o.GetConfigFiles()\n\tif err != nil {\n\t\treturn types.ConfigDetails{}, err\n\t}\n\n\tworkingDir, err := o.GetWorkingDir()\n\tif err != nil {\n\t\treturn types.ConfigDetails{}, err\n\t}\n\n\tconfigDetails := types.ConfigDetails{\n\t\tConfigFiles: configs,\n\t\tWorkingDir:  workingDir,\n\t\tEnvironment: o.Environment,\n\t}\n\n\to.loadOptions = append(o.loadOptions,\n\t\twithNamePrecedenceLoad(workingDir, o),\n\t\twithConvertWindowsPaths(o),\n\t\twithListeners(o))\n\treturn configDetails, nil\n}\n\n// ProjectFromOptions load a compose project based on command line options\n// Deprecated: use ProjectOptions.LoadProject or ProjectOptions.LoadModel\nfunc ProjectFromOptions(ctx context.Context, options *ProjectOptions) (*types.Project, error) {\n\treturn options.LoadProject(ctx)\n}\n\nfunc withNamePrecedenceLoad(absWorkingDir string, options *ProjectOptions) func(*loader.Options) {\n\treturn func(opts *loader.Options) {\n\t\tif options.Name != \"\" {\n\t\t\topts.SetProjectName(options.Name, true)\n\t\t} else if nameFromEnv, ok := options.Environment[consts.ComposeProjectName]; ok && nameFromEnv != \"\" {\n\t\t\topts.SetProjectName(nameFromEnv, true)\n\t\t} else {\n\t\t\topts.SetProjectName(\n\t\t\t\tloader.NormalizeProjectName(filepath.Base(absWorkingDir)),\n\t\t\t\tfalse,\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc withConvertWindowsPaths(options *ProjectOptions) func(*loader.Options) {\n\treturn func(o *loader.Options) {\n\t\tif o.ResolvePaths {\n\t\t\to.ConvertWindowsPaths = utils.StringToBool(options.Environment[\"COMPOSE_CONVERT_WINDOWS_PATHS\"])\n\t\t}\n\t}\n}\n\n// save listeners from ProjectOptions (compose) to loader.Options\nfunc withListeners(options *ProjectOptions) func(*loader.Options) {\n\treturn func(opts *loader.Options) {\n\t\topts.Listeners = append(opts.Listeners, options.Listeners...)\n\t}\n}\n\n// getConfigPaths retrieves the config files for project based on project options\nfunc (o *ProjectOptions) getConfigPaths() ([]string, error) {\n\tif len(o.ConfigPaths) != 0 {\n\t\treturn absolutePaths(o.ConfigPaths)\n\t}\n\treturn nil, fmt.Errorf(\"no configuration file provided: %w\", errdefs.ErrNotFound)\n}\n\nfunc findFiles(names []string, pwd string) []string {\n\tcandidates := []string{}\n\tfor _, n := range names {\n\t\tf := filepath.Join(pwd, n)\n\t\tif _, err := os.Stat(f); err == nil {\n\t\t\tcandidates = append(candidates, f)\n\t\t}\n\t}\n\treturn candidates\n}\n\nfunc absolutePaths(p []string) ([]string, error) {\n\tvar paths []string\n\tfor _, f := range p {\n\t\tif f == \"-\" {\n\t\t\tpaths = append(paths, f)\n\t\t\tcontinue\n\t\t}\n\t\tabs, err := filepath.Abs(f)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf = abs\n\t\tif _, err := os.Stat(f); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpaths = append(paths, f)\n\t}\n\treturn paths, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/consts/consts.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage consts\n\nconst (\n\tComposeProjectName           = \"COMPOSE_PROJECT_NAME\"\n\tComposePathSeparator         = \"COMPOSE_PATH_SEPARATOR\"\n\tComposeFilePath              = \"COMPOSE_FILE\"\n\tComposeDisableDefaultEnvFile = \"COMPOSE_DISABLE_ENV_FILE\"\n\tComposeProfiles              = \"COMPOSE_PROFILES\"\n)\n\nconst Extensions = \"#extensions\" // Using # prefix, we prevent risk to conflict with an actual yaml key\n\ntype ComposeFileKey struct{}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/dotenv/LICENSE",
    "content": "Copyright (c) 2013 John Barton\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/dotenv/env.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage dotenv\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc GetEnvFromFile(currentEnv map[string]string, filenames []string) (map[string]string, error) {\n\tenvMap := make(map[string]string)\n\n\tfor _, dotEnvFile := range filenames {\n\t\tabs, err := filepath.Abs(dotEnvFile)\n\t\tif err != nil {\n\t\t\treturn envMap, err\n\t\t}\n\t\tdotEnvFile = abs\n\n\t\ts, err := os.Stat(dotEnvFile)\n\t\tif os.IsNotExist(err) {\n\t\t\treturn envMap, fmt.Errorf(\"Couldn't find env file: %s\", dotEnvFile)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn envMap, err\n\t\t}\n\n\t\tif s.IsDir() {\n\t\t\tif len(filenames) == 0 {\n\t\t\t\treturn envMap, nil\n\t\t\t}\n\t\t\treturn envMap, fmt.Errorf(\"%s is a directory\", dotEnvFile)\n\t\t}\n\n\t\tb, err := os.ReadFile(dotEnvFile)\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, fmt.Errorf(\"Couldn't read env file: %s\", dotEnvFile)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn envMap, err\n\t\t}\n\n\t\tenv, err := ParseWithLookup(bytes.NewReader(b), func(k string) (string, bool) {\n\t\t\tv, ok := currentEnv[k]\n\t\t\tif ok {\n\t\t\t\treturn v, true\n\t\t\t}\n\t\t\tv, ok = envMap[k]\n\t\t\treturn v, ok\n\t\t})\n\t\tif err != nil {\n\t\t\treturn envMap, fmt.Errorf(\"failed to read %s: %w\", dotEnvFile, err)\n\t\t}\n\t\tfor k, v := range env {\n\t\t\tenvMap[k] = v\n\t\t}\n\t}\n\n\treturn envMap, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/dotenv/godotenv.go",
    "content": "// Package dotenv is a go port of the ruby dotenv library (https://github.com/bkeepers/dotenv)\n//\n// Examples/readme can be found on the github page at https://github.com/joho/godotenv\n//\n// The TL;DR is that you make a .env file that looks something like\n//\n//\tSOME_ENV_VAR=somevalue\n//\n// and then in your go code you can call\n//\n//\tgodotenv.Load()\n//\n// and all the env vars declared in .env will be available through os.Getenv(\"SOME_ENV_VAR\")\npackage dotenv\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/template\"\n)\n\nvar utf8BOM = []byte(\"\\uFEFF\")\n\nvar startsWithDigitRegex = regexp.MustCompile(`^\\s*\\d.*`) // Keys starting with numbers are ignored\n\n// LookupFn represents a lookup function to resolve variables from\ntype LookupFn func(string) (string, bool)\n\nvar noLookupFn = func(s string) (string, bool) {\n\treturn \"\", false\n}\n\n// Parse reads an env file from io.Reader, returning a map of keys and values.\nfunc Parse(r io.Reader) (map[string]string, error) {\n\treturn ParseWithLookup(r, nil)\n}\n\n// ParseWithLookup reads an env file from io.Reader, returning a map of keys and values.\nfunc ParseWithLookup(r io.Reader, lookupFn LookupFn) (map[string]string, error) {\n\tdata, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// seek past the UTF-8 BOM if it exists (particularly on Windows, some\n\t// editors tend to add it, and it'll cause parsing to fail)\n\tdata = bytes.TrimPrefix(data, utf8BOM)\n\n\treturn UnmarshalBytesWithLookup(data, lookupFn)\n}\n\n// Load will read your env file(s) and load them into ENV for this process.\n//\n// Call this function as close as possible to the start of your program (ideally in main).\n//\n// If you call Load without any args it will default to loading .env in the current path.\n//\n// You can otherwise tell it which files to load (there can be more than one) like:\n//\n//\tgodotenv.Load(\"fileone\", \"filetwo\")\n//\n// It's important to note that it WILL NOT OVERRIDE an env variable that already exists - consider the .env file to set dev vars or sensible defaults\nfunc Load(filenames ...string) error {\n\treturn load(false, filenames...)\n}\n\nfunc load(overload bool, filenames ...string) error {\n\tfilenames = filenamesOrDefault(filenames)\n\tfor _, filename := range filenames {\n\t\terr := loadFile(filename, overload)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// ReadWithLookup gets all env vars from the files and/or lookup function and return values as\n// a map rather than automatically writing values into env\nfunc ReadWithLookup(lookupFn LookupFn, filenames ...string) (map[string]string, error) {\n\tfilenames = filenamesOrDefault(filenames)\n\tenvMap := make(map[string]string)\n\n\tfor _, filename := range filenames {\n\t\tindividualEnvMap, individualErr := readFile(filename, lookupFn)\n\n\t\tif individualErr != nil {\n\t\t\treturn envMap, individualErr\n\t\t}\n\n\t\tfor key, value := range individualEnvMap {\n\t\t\tif startsWithDigitRegex.MatchString(key) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tenvMap[key] = value\n\t\t}\n\t}\n\n\treturn envMap, nil\n}\n\n// Read all env (with same file loading semantics as Load) but return values as\n// a map rather than automatically writing values into env\nfunc Read(filenames ...string) (map[string]string, error) {\n\treturn ReadWithLookup(nil, filenames...)\n}\n\n// UnmarshalBytesWithLookup parses env file from byte slice of chars, returning a map of keys and values.\nfunc UnmarshalBytesWithLookup(src []byte, lookupFn LookupFn) (map[string]string, error) {\n\treturn UnmarshalWithLookup(string(src), lookupFn)\n}\n\n// UnmarshalWithLookup parses env file from string, returning a map of keys and values.\nfunc UnmarshalWithLookup(src string, lookupFn LookupFn) (map[string]string, error) {\n\tout := make(map[string]string)\n\terr := newParser().parse(src, out, lookupFn)\n\treturn out, err\n}\n\nfunc filenamesOrDefault(filenames []string) []string {\n\tif len(filenames) == 0 {\n\t\treturn []string{\".env\"}\n\t}\n\treturn filenames\n}\n\nfunc loadFile(filename string, overload bool) error {\n\tenvMap, err := readFile(filename, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcurrentEnv := map[string]bool{}\n\trawEnv := os.Environ()\n\tfor _, rawEnvLine := range rawEnv {\n\t\tkey := strings.Split(rawEnvLine, \"=\")[0]\n\t\tcurrentEnv[key] = true\n\t}\n\n\tfor key, value := range envMap {\n\t\tif !currentEnv[key] || overload {\n\t\t\t_ = os.Setenv(key, value)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc readFile(filename string, lookupFn LookupFn) (map[string]string, error) {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\treturn ParseWithLookup(file, lookupFn)\n}\n\nfunc expandVariables(value string, envMap map[string]string, lookupFn LookupFn) (string, error) {\n\tretVal, err := template.Substitute(value, func(k string) (string, bool) {\n\t\tif v, ok := lookupFn(k); ok {\n\t\t\treturn v, true\n\t\t}\n\t\tv, ok := envMap[k]\n\t\treturn v, ok\n\t})\n\tif err != nil {\n\t\treturn value, err\n\t}\n\treturn retVal, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/dotenv/parser.go",
    "content": "package dotenv\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst (\n\tcharComment       = '#'\n\tprefixSingleQuote = '\\''\n\tprefixDoubleQuote = '\"'\n)\n\nvar (\n\tescapeSeqRegex = regexp.MustCompile(`(\\\\(?:[abcfnrtv$\"\\\\]|0\\d{0,3}))`)\n\texportRegex    = regexp.MustCompile(`^export\\s+`)\n)\n\ntype parser struct {\n\tline int\n}\n\nfunc newParser() *parser {\n\treturn &parser{\n\t\tline: 1,\n\t}\n}\n\nfunc (p *parser) parse(src string, out map[string]string, lookupFn LookupFn) error {\n\tcutset := src\n\tif lookupFn == nil {\n\t\tlookupFn = noLookupFn\n\t}\n\tfor {\n\t\tcutset = p.getStatementStart(cutset)\n\t\tif cutset == \"\" {\n\t\t\t// reached end of file\n\t\t\tbreak\n\t\t}\n\n\t\tkey, left, inherited, err := p.locateKeyName(cutset)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif strings.Contains(key, \" \") {\n\t\t\treturn fmt.Errorf(\"line %d: key cannot contain a space\", p.line)\n\t\t}\n\n\t\tif inherited {\n\t\t\tvalue, ok := lookupFn(key)\n\t\t\tif ok {\n\t\t\t\tout[key] = value\n\t\t\t}\n\t\t\tcutset = left\n\t\t\tcontinue\n\t\t}\n\n\t\tvalue, left, err := p.extractVarValue(left, out, lookupFn)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tout[key] = value\n\t\tcutset = left\n\t}\n\n\treturn nil\n}\n\n// getStatementPosition returns position of statement begin.\n//\n// It skips any comment line or non-whitespace character.\nfunc (p *parser) getStatementStart(src string) string {\n\tpos := p.indexOfNonSpaceChar(src)\n\tif pos == -1 {\n\t\treturn \"\"\n\t}\n\n\tsrc = src[pos:]\n\tif src[0] != charComment {\n\t\treturn src\n\t}\n\n\t// skip comment section\n\tpos = strings.IndexFunc(src, isCharFunc('\\n'))\n\tif pos == -1 {\n\t\treturn \"\"\n\t}\n\treturn p.getStatementStart(src[pos:])\n}\n\n// locateKeyName locates and parses key name and returns rest of slice\nfunc (p *parser) locateKeyName(src string) (string, string, bool, error) {\n\tvar key string\n\tvar inherited bool\n\t// trim \"export\" and space at beginning\n\tif exportRegex.MatchString(src) {\n\t\t// we use a `strings.trim` to preserve the pointer to the same underlying memory.\n\t\t// a regexp replace would copy the string.\n\t\tsrc = strings.TrimLeftFunc(strings.TrimPrefix(src, \"export\"), isSpace)\n\t}\n\n\t// locate key name end and validate it in single loop\n\toffset := 0\nloop:\n\tfor i, rune := range src {\n\t\tif isSpace(rune) {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch rune {\n\t\tcase '=', ':', '\\n':\n\t\t\t// library also supports yaml-style value declaration\n\t\t\tkey = string(src[0:i])\n\t\t\toffset = i + 1\n\t\t\tinherited = rune == '\\n'\n\t\t\tbreak loop\n\t\tcase '_', '.', '[', ']':\n\t\tdefault:\n\t\t\t// variable name should match [A-Za-z0-9_.-]\n\t\t\tif unicode.IsLetter(rune) || unicode.IsNumber(rune) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treturn \"\", \"\", inherited, fmt.Errorf(\n\t\t\t\t`line %d: unexpected character %q in variable name %q`,\n\t\t\t\tp.line, string(rune), strings.Split(src, \"\\n\")[0])\n\t\t}\n\t}\n\n\tif src == \"\" {\n\t\treturn \"\", \"\", inherited, errors.New(\"zero length string\")\n\t}\n\n\t// trim whitespace\n\tkey = strings.TrimRightFunc(key, unicode.IsSpace)\n\tcutset := strings.TrimLeftFunc(src[offset:], isSpace)\n\treturn key, cutset, inherited, nil\n}\n\n// extractVarValue extracts variable value and returns rest of slice\nfunc (p *parser) extractVarValue(src string, envMap map[string]string, lookupFn LookupFn) (string, string, error) {\n\tquote, isQuoted := hasQuotePrefix(src)\n\tif !isQuoted {\n\t\t// unquoted value - read until new line\n\t\tvalue, rest, _ := strings.Cut(src, \"\\n\")\n\t\tp.line++\n\n\t\t// Remove inline comments on unquoted lines\n\t\tvalue, _, _ = strings.Cut(value, \" #\")\n\t\tvalue = strings.TrimRightFunc(value, unicode.IsSpace)\n\t\tretVal, err := expandVariables(string(value), envMap, lookupFn)\n\t\treturn retVal, rest, err\n\t}\n\n\tpreviousCharIsEscape := false\n\t// lookup quoted string terminator\n\tvar chars []byte\n\tfor i := 1; i < len(src); i++ {\n\t\tchar := src[i]\n\t\tif char == '\\n' {\n\t\t\tp.line++\n\t\t}\n\t\tif char != quote {\n\t\t\tif !previousCharIsEscape && char == '\\\\' {\n\t\t\t\tpreviousCharIsEscape = true\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif previousCharIsEscape {\n\t\t\t\tpreviousCharIsEscape = false\n\t\t\t\tchars = append(chars, '\\\\')\n\t\t\t}\n\t\t\tchars = append(chars, char)\n\t\t\tcontinue\n\t\t}\n\n\t\t// skip escaped quote symbol (\\\" or \\', depends on quote)\n\t\tif previousCharIsEscape {\n\t\t\tpreviousCharIsEscape = false\n\t\t\tchars = append(chars, char)\n\t\t\tcontinue\n\t\t}\n\n\t\t// trim quotes\n\t\tvalue := string(chars)\n\t\tif quote == prefixDoubleQuote {\n\t\t\t// expand standard shell escape sequences & then interpolate\n\t\t\t// variables on the result\n\t\t\tretVal, err := expandVariables(expandEscapes(value), envMap, lookupFn)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", \"\", err\n\t\t\t}\n\t\t\tvalue = retVal\n\t\t}\n\n\t\treturn value, src[i+1:], nil\n\t}\n\n\t// return formatted error if quoted string is not terminated\n\tvalEndIndex := strings.IndexFunc(src, isCharFunc('\\n'))\n\tif valEndIndex == -1 {\n\t\tvalEndIndex = len(src)\n\t}\n\n\treturn \"\", \"\", fmt.Errorf(\"line %d: unterminated quoted value %s\", p.line, src[:valEndIndex])\n}\n\nfunc expandEscapes(str string) string {\n\tout := escapeSeqRegex.ReplaceAllStringFunc(str, func(match string) string {\n\t\tif match == `\\$` {\n\t\t\t// `\\$` is not a Go escape sequence, the expansion parser uses\n\t\t\t// the special `$$` syntax\n\t\t\t// both `FOO=\\$bar` and `FOO=$$bar` are valid in an env file and\n\t\t\t// will result in FOO w/ literal value of \"$bar\" (no interpolation)\n\t\t\treturn \"$$\"\n\t\t}\n\n\t\tif strings.HasPrefix(match, `\\0`) {\n\t\t\t// octal escape sequences in Go are not prefixed with `\\0`, so\n\t\t\t// rewrite the prefix, e.g. `\\0123` -> `\\123` -> literal value \"S\"\n\t\t\tmatch = strings.Replace(match, `\\0`, `\\`, 1)\n\t\t}\n\n\t\t// use Go to unquote (unescape) the literal\n\t\t// see https://go.dev/ref/spec#Rune_literals\n\t\t//\n\t\t// NOTE: Go supports ADDITIONAL escapes like `\\x` & `\\u` & `\\U`!\n\t\t// These are NOT supported, which is why we use a regex to find\n\t\t// only matches we support and then use `UnquoteChar` instead of a\n\t\t// `Unquote` on the entire value\n\t\tv, _, _, err := strconv.UnquoteChar(match, '\"')\n\t\tif err != nil {\n\t\t\treturn match\n\t\t}\n\t\treturn string(v)\n\t})\n\treturn out\n}\n\nfunc (p *parser) indexOfNonSpaceChar(src string) int {\n\treturn strings.IndexFunc(src, func(r rune) bool {\n\t\tif r == '\\n' {\n\t\t\tp.line++\n\t\t}\n\t\treturn !unicode.IsSpace(r)\n\t})\n}\n\n// hasQuotePrefix reports whether charset starts with single or double quote and returns quote character\nfunc hasQuotePrefix(src string) (byte, bool) {\n\tif src == \"\" {\n\t\treturn 0, false\n\t}\n\n\tswitch quote := src[0]; quote {\n\tcase prefixDoubleQuote, prefixSingleQuote:\n\t\treturn quote, true // isQuoted\n\tdefault:\n\t\treturn 0, false\n\t}\n}\n\nfunc isCharFunc(char rune) func(rune) bool {\n\treturn func(v rune) bool {\n\t\treturn v == char\n\t}\n}\n\n// isSpace reports whether the rune is a space character but not line break character\n//\n// this differs from unicode.IsSpace, which also applies line break as space\nfunc isSpace(r rune) bool {\n\tswitch r {\n\tcase '\\t', '\\v', '\\f', '\\r', ' ', 0x85, 0xA0:\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/errdefs/errors.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage errdefs\n\nimport \"errors\"\n\nvar (\n\t// ErrNotFound is returned when an object is not found\n\tErrNotFound = errors.New(\"not found\")\n\n\t// ErrInvalid is returned when a compose project is invalid\n\tErrInvalid = errors.New(\"invalid compose project\")\n\n\t// ErrUnsupported is returned when a compose project uses an unsupported attribute\n\tErrUnsupported = errors.New(\"unsupported attribute\")\n\n\t// ErrIncompatible is returned when a compose project uses an incompatible attribute\n\tErrIncompatible = errors.New(\"incompatible attribute\")\n\n\t// ErrDisabled is returned when a resource was found in model but is disabled\n\tErrDisabled = errors.New(\"disabled\")\n)\n\n// IsNotFoundError returns true if the unwrapped error is ErrNotFound\nfunc IsNotFoundError(err error) bool {\n\treturn errors.Is(err, ErrNotFound)\n}\n\n// IsInvalidError returns true if the unwrapped error is ErrInvalid\nfunc IsInvalidError(err error) bool {\n\treturn errors.Is(err, ErrInvalid)\n}\n\n// IsUnsupportedError returns true if the unwrapped error is ErrUnsupported\nfunc IsUnsupportedError(err error) bool {\n\treturn errors.Is(err, ErrUnsupported)\n}\n\n// IsUnsupportedError returns true if the unwrapped error is ErrIncompatible\nfunc IsIncompatibleError(err error) bool {\n\treturn errors.Is(err, ErrIncompatible)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/format/volume.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage format\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\nconst endOfSpec = rune(0)\n\n// ParseVolume parses a volume spec without any knowledge of the target platform\nfunc ParseVolume(spec string) (types.ServiceVolumeConfig, error) {\n\tvolume := types.ServiceVolumeConfig{}\n\n\tswitch len(spec) {\n\tcase 0:\n\t\treturn volume, errors.New(\"invalid empty volume spec\")\n\tcase 1, 2:\n\t\tvolume.Target = spec\n\t\tvolume.Type = types.VolumeTypeVolume\n\t\treturn volume, nil\n\t}\n\n\tvar buffer []rune\n\tfor _, char := range spec + string(endOfSpec) {\n\t\tswitch {\n\t\tcase isWindowsDrive(buffer, char):\n\t\t\tbuffer = append(buffer, char)\n\t\tcase char == ':' || char == endOfSpec:\n\t\t\tif err := populateFieldFromBuffer(char, buffer, &volume); err != nil {\n\t\t\t\tpopulateType(&volume)\n\t\t\t\treturn volume, fmt.Errorf(\"invalid spec: %s: %w\", spec, err)\n\t\t\t}\n\t\t\tbuffer = nil\n\t\tdefault:\n\t\t\tbuffer = append(buffer, char)\n\t\t}\n\t}\n\n\tpopulateType(&volume)\n\treturn volume, nil\n}\n\nfunc isWindowsDrive(buffer []rune, char rune) bool {\n\treturn char == ':' && len(buffer) == 1 && unicode.IsLetter(buffer[0])\n}\n\nfunc populateFieldFromBuffer(char rune, buffer []rune, volume *types.ServiceVolumeConfig) error {\n\tstrBuffer := string(buffer)\n\tswitch {\n\tcase len(buffer) == 0:\n\t\treturn errors.New(\"empty section between colons\")\n\t// Anonymous volume\n\tcase volume.Source == \"\" && char == endOfSpec:\n\t\tvolume.Target = strBuffer\n\t\treturn nil\n\tcase volume.Source == \"\":\n\t\tvolume.Source = strBuffer\n\t\treturn nil\n\tcase volume.Target == \"\":\n\t\tvolume.Target = strBuffer\n\t\treturn nil\n\tcase char == ':':\n\t\treturn errors.New(\"too many colons\")\n\t}\n\tfor _, option := range strings.Split(strBuffer, \",\") {\n\t\tswitch option {\n\t\tcase \"ro\":\n\t\t\tvolume.ReadOnly = true\n\t\tcase \"rw\":\n\t\t\tvolume.ReadOnly = false\n\t\tcase \"nocopy\":\n\t\t\tvolume.Volume = &types.ServiceVolumeVolume{NoCopy: true}\n\t\tdefault:\n\t\t\tif isBindOption(option) {\n\t\t\t\tsetBindOption(volume, option)\n\t\t\t}\n\t\t\t// ignore unknown options\n\t\t}\n\t}\n\treturn nil\n}\n\nvar Propagations = []string{\n\ttypes.PropagationRPrivate,\n\ttypes.PropagationPrivate,\n\ttypes.PropagationRShared,\n\ttypes.PropagationShared,\n\ttypes.PropagationRSlave,\n\ttypes.PropagationSlave,\n}\n\ntype setBindOptionFunc func(bind *types.ServiceVolumeBind, option string)\n\nvar bindOptions = map[string]setBindOptionFunc{\n\ttypes.PropagationRPrivate: setBindPropagation,\n\ttypes.PropagationPrivate:  setBindPropagation,\n\ttypes.PropagationRShared:  setBindPropagation,\n\ttypes.PropagationShared:   setBindPropagation,\n\ttypes.PropagationRSlave:   setBindPropagation,\n\ttypes.PropagationSlave:    setBindPropagation,\n\ttypes.SELinuxShared:       setBindSELinux,\n\ttypes.SELinuxPrivate:      setBindSELinux,\n}\n\nfunc setBindPropagation(bind *types.ServiceVolumeBind, option string) {\n\tbind.Propagation = option\n}\n\nfunc setBindSELinux(bind *types.ServiceVolumeBind, option string) {\n\tbind.SELinux = option\n}\n\nfunc isBindOption(option string) bool {\n\t_, ok := bindOptions[option]\n\n\treturn ok\n}\n\nfunc setBindOption(volume *types.ServiceVolumeConfig, option string) {\n\tif volume.Bind == nil {\n\t\tvolume.Bind = &types.ServiceVolumeBind{}\n\t}\n\n\tbindOptions[option](volume.Bind, option)\n}\n\nfunc populateType(volume *types.ServiceVolumeConfig) {\n\tif isFilePath(volume.Source) {\n\t\tvolume.Type = types.VolumeTypeBind\n\t\tif volume.Bind == nil {\n\t\t\tvolume.Bind = &types.ServiceVolumeBind{}\n\t\t}\n\t\t// For backward compatibility with docker-compose legacy, using short notation involves\n\t\t// bind will create missing host path\n\t\tvolume.Bind.CreateHostPath = true\n\t} else {\n\t\tvolume.Type = types.VolumeTypeVolume\n\t\tif volume.Volume == nil {\n\t\t\tvolume.Volume = &types.ServiceVolumeVolume{}\n\t\t}\n\t}\n}\n\nfunc isFilePath(source string) bool {\n\tif source == \"\" {\n\t\treturn false\n\t}\n\tswitch source[0] {\n\tcase '.', '/', '~':\n\t\treturn true\n\t}\n\n\t// windows named pipes\n\tif strings.HasPrefix(source, `\\\\`) {\n\t\treturn true\n\t}\n\n\tfirst, nextIndex := utf8.DecodeRuneInString(source)\n\tif len(source) <= nextIndex {\n\t\treturn false\n\t}\n\treturn isWindowsDrive([]rune{first}, rune(source[nextIndex]))\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/graph/cycle.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage graph\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/compose-spec/compose-go/v2/utils\"\n\t\"golang.org/x/exp/slices\"\n)\n\n// CheckCycle analyze project's depends_on relation and report an error on cycle detection\nfunc CheckCycle(project *types.Project) error {\n\tg, err := newGraph(project)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn g.checkCycle()\n}\n\nfunc (g *graph[T]) checkCycle() error {\n\t// iterate on vertices in a name-order to render a predicable error message\n\t// this is required by tests and enforce command reproducibility by user, which otherwise could be confusing\n\tnames := utils.MapKeys(g.vertices)\n\tfor _, name := range names {\n\t\terr := searchCycle([]string{name}, g.vertices[name])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc searchCycle[T any](path []string, v *vertex[T]) error {\n\tnames := utils.MapKeys(v.children)\n\tfor _, name := range names {\n\t\tif i := slices.Index(path, name); i >= 0 {\n\t\t\treturn fmt.Errorf(\"dependency cycle detected: %s -> %s\", strings.Join(path[i:], \" -> \"), name)\n\t\t}\n\t\tch := v.children[name]\n\t\terr := searchCycle(append(path, name), ch)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/graph/graph.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage graph\n\n// graph represents project as service dependencies\ntype graph[T any] struct {\n\tvertices map[string]*vertex[T]\n}\n\n// vertex represents a service in the dependencies structure\ntype vertex[T any] struct {\n\tkey      string\n\tservice  *T\n\tchildren map[string]*vertex[T]\n\tparents  map[string]*vertex[T]\n}\n\nfunc (g *graph[T]) addVertex(name string, service T) {\n\tg.vertices[name] = &vertex[T]{\n\t\tkey:      name,\n\t\tservice:  &service,\n\t\tparents:  map[string]*vertex[T]{},\n\t\tchildren: map[string]*vertex[T]{},\n\t}\n}\n\nfunc (g *graph[T]) addEdge(src, dest string) {\n\tg.vertices[src].children[dest] = g.vertices[dest]\n\tg.vertices[dest].parents[src] = g.vertices[src]\n}\n\nfunc (g *graph[T]) roots() []*vertex[T] {\n\tvar res []*vertex[T]\n\tfor _, v := range g.vertices {\n\t\tif len(v.parents) == 0 {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\treturn res\n}\n\nfunc (g *graph[T]) leaves() []*vertex[T] {\n\tvar res []*vertex[T]\n\tfor _, v := range g.vertices {\n\t\tif len(v.children) == 0 {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn res\n}\n\n// descendents return all descendents for a vertex, might contain duplicates\nfunc (v *vertex[T]) descendents() []string {\n\tvar vx []string\n\tfor _, n := range v.children {\n\t\tvx = append(vx, n.key)\n\t\tvx = append(vx, n.descendents()...)\n\t}\n\treturn vx\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/graph/services.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage graph\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// InDependencyOrder walk the service graph an invoke VisitorFn in respect to dependency order\nfunc InDependencyOrder(ctx context.Context, project *types.Project, fn VisitorFn[types.ServiceConfig], options ...func(*Options)) error {\n\t_, err := CollectInDependencyOrder[any](ctx, project, func(ctx context.Context, s string, config types.ServiceConfig) (any, error) {\n\t\treturn nil, fn(ctx, s, config)\n\t}, options...)\n\treturn err\n}\n\n// CollectInDependencyOrder walk the service graph an invoke CollectorFn in respect to dependency order, then return result for each call\nfunc CollectInDependencyOrder[T any](ctx context.Context, project *types.Project, fn CollectorFn[types.ServiceConfig, T], options ...func(*Options)) (map[string]T, error) {\n\tgraph, err := newGraph(project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tt := newTraversal(fn)\n\tfor _, option := range options {\n\t\toption(t.Options)\n\t}\n\terr = walk(ctx, graph, t)\n\treturn t.results, err\n}\n\n// newGraph creates a service graph from project\nfunc newGraph(project *types.Project) (*graph[types.ServiceConfig], error) {\n\tg := &graph[types.ServiceConfig]{\n\t\tvertices: map[string]*vertex[types.ServiceConfig]{},\n\t}\n\n\tfor name, s := range project.Services {\n\t\tg.addVertex(name, s)\n\t}\n\n\tfor name, s := range project.Services {\n\t\tsrc := g.vertices[name]\n\t\tfor dep, condition := range s.DependsOn {\n\t\t\tdest, ok := g.vertices[dep]\n\t\t\tif !ok {\n\t\t\t\tif condition.Required {\n\t\t\t\t\tif ds, exists := project.DisabledServices[dep]; exists {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"service %q is required by %q but is disabled. Can be enabled by profiles %s\", dep, name, ds.Profiles)\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, fmt.Errorf(\"service %q depends on unknown service %q\", name, dep)\n\t\t\t\t}\n\t\t\t\tdelete(s.DependsOn, name)\n\t\t\t\tproject.Services[name] = s\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsrc.children[dep] = dest\n\t\t\tdest.parents[name] = src\n\t\t}\n\t}\n\n\terr := g.checkCycle()\n\treturn g, err\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/graph/traversal.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage graph\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"golang.org/x/exp/slices\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\n// CollectorFn executes on each graph vertex based on visit order and return associated value\ntype CollectorFn[S any, T any] func(context.Context, string, S) (T, error)\n\n// VisitorFn executes on each graph nodes based on visit order\ntype VisitorFn[S any] func(context.Context, string, S) error\n\ntype traversal[S any, T any] struct {\n\t*Options\n\tvisitor CollectorFn[S, T]\n\n\tmu      sync.Mutex\n\tstatus  map[string]int\n\tresults map[string]T\n}\n\ntype Options struct {\n\t// inverse reverse the traversal direction\n\tinverse bool\n\t// maxConcurrency limit the concurrent execution of visitorFn while walking the graph\n\tmaxConcurrency int\n\t// after marks a set of node as starting points walking the graph\n\tafter []string\n}\n\nconst (\n\tvertexEntered = iota\n\tvertexVisited\n)\n\nfunc newTraversal[S, T any](fn CollectorFn[S, T]) *traversal[S, T] {\n\treturn &traversal[S, T]{\n\t\tOptions: &Options{},\n\t\tstatus:  map[string]int{},\n\t\tresults: map[string]T{},\n\t\tvisitor: fn,\n\t}\n}\n\n// WithMaxConcurrency configure traversal to limit concurrency walking graph nodes\nfunc WithMaxConcurrency(max int) func(*Options) {\n\treturn func(o *Options) {\n\t\to.maxConcurrency = max\n\t}\n}\n\n// InReverseOrder configure traversal to walk the graph in reverse dependency order\nfunc InReverseOrder(o *Options) {\n\to.inverse = true\n}\n\n// WithRootNodesAndDown creates a graphTraversal to start from selected nodes\nfunc WithRootNodesAndDown(nodes []string) func(*Options) {\n\treturn func(o *Options) {\n\t\to.after = nodes\n\t}\n}\n\nfunc walk[S, T any](ctx context.Context, g *graph[S], t *traversal[S, T]) error {\n\texpect := len(g.vertices)\n\tif expect == 0 {\n\t\treturn nil\n\t}\n\t// nodeCh need to allow n=expect writers while reader goroutine could have returned after ctx.Done\n\tnodeCh := make(chan *vertex[S], expect)\n\tdefer close(nodeCh)\n\n\teg, ctx := errgroup.WithContext(ctx)\n\tif t.maxConcurrency > 0 {\n\t\teg.SetLimit(t.maxConcurrency + 1)\n\t}\n\n\teg.Go(func() error {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil\n\t\t\tcase node := <-nodeCh:\n\t\t\t\texpect--\n\t\t\t\tif expect == 0 {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tfor _, adj := range t.adjacentNodes(node) {\n\t\t\t\t\tt.visit(ctx, eg, adj, nodeCh)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\n\t// select nodes to start walking the graph based on traversal.direction\n\tfor _, node := range t.extremityNodes(g) {\n\t\tt.visit(ctx, eg, node, nodeCh)\n\t}\n\n\treturn eg.Wait()\n}\n\nfunc (t *traversal[S, T]) visit(ctx context.Context, eg *errgroup.Group, node *vertex[S], nodeCh chan *vertex[S]) {\n\tif !t.ready(node) {\n\t\t// don't visit this service yet as dependencies haven't been visited\n\t\treturn\n\t}\n\tif !t.enter(node) {\n\t\t// another worker already acquired this node\n\t\treturn\n\t}\n\teg.Go(func() error {\n\t\tvar (\n\t\t\terr    error\n\t\t\tresult T\n\t\t)\n\t\tif !t.skip(node) {\n\t\t\tresult, err = t.visitor(ctx, node.key, *node.service)\n\t\t}\n\t\tt.done(node, result)\n\t\tnodeCh <- node\n\t\treturn err\n\t})\n}\n\nfunc (t *traversal[S, T]) extremityNodes(g *graph[S]) []*vertex[S] {\n\tif t.inverse {\n\t\treturn g.roots()\n\t}\n\treturn g.leaves()\n}\n\nfunc (t *traversal[S, T]) adjacentNodes(v *vertex[S]) map[string]*vertex[S] {\n\tif t.inverse {\n\t\treturn v.children\n\t}\n\treturn v.parents\n}\n\nfunc (t *traversal[S, T]) ready(v *vertex[S]) bool {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tdepends := v.children\n\tif t.inverse {\n\t\tdepends = v.parents\n\t}\n\tfor name := range depends {\n\t\tif t.status[name] != vertexVisited {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (t *traversal[S, T]) enter(v *vertex[S]) bool {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tif _, ok := t.status[v.key]; ok {\n\t\treturn false\n\t}\n\tt.status[v.key] = vertexEntered\n\treturn true\n}\n\nfunc (t *traversal[S, T]) done(v *vertex[S], result T) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\tt.status[v.key] = vertexVisited\n\tt.results[v.key] = result\n}\n\nfunc (t *traversal[S, T]) skip(node *vertex[S]) bool {\n\tif len(t.after) == 0 {\n\t\treturn false\n\t}\n\tif slices.Contains(t.after, node.key) {\n\t\treturn false\n\t}\n\n\t// is none of our starting node is a descendent, skip visit\n\tancestors := node.descendents()\n\tfor _, name := range t.after {\n\t\tif slices.Contains(ancestors, name) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/interpolation/interpolation.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage interpolation\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/compose-spec/compose-go/v2/template\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\n// Options supported by Interpolate\ntype Options struct {\n\t// LookupValue from a key\n\tLookupValue LookupValue\n\t// TypeCastMapping maps key paths to functions to cast to a type\n\tTypeCastMapping map[tree.Path]Cast\n\t// Substitution function to use\n\tSubstitute func(string, template.Mapping) (string, error)\n}\n\n// LookupValue is a function which maps from variable names to values.\n// Returns the value as a string and a bool indicating whether\n// the value is present, to distinguish between an empty string\n// and the absence of a value.\ntype LookupValue func(key string) (string, bool)\n\n// Cast a value to a new type, or return an error if the value can't be cast\ntype Cast func(value string) (interface{}, error)\n\n// Interpolate replaces variables in a string with the values from a mapping\nfunc Interpolate(config map[string]interface{}, opts Options) (map[string]interface{}, error) {\n\tif opts.LookupValue == nil {\n\t\topts.LookupValue = os.LookupEnv\n\t}\n\tif opts.TypeCastMapping == nil {\n\t\topts.TypeCastMapping = make(map[tree.Path]Cast)\n\t}\n\tif opts.Substitute == nil {\n\t\topts.Substitute = template.Substitute\n\t}\n\n\tout := map[string]interface{}{}\n\n\tfor key, value := range config {\n\t\tinterpolatedValue, err := recursiveInterpolate(value, tree.NewPath(key), opts)\n\t\tif err != nil {\n\t\t\treturn out, err\n\t\t}\n\t\tout[key] = interpolatedValue\n\t}\n\n\treturn out, nil\n}\n\nfunc recursiveInterpolate(value interface{}, path tree.Path, opts Options) (interface{}, error) {\n\tswitch value := value.(type) {\n\tcase string:\n\t\tnewValue, err := opts.Substitute(value, template.Mapping(opts.LookupValue))\n\t\tif err != nil {\n\t\t\treturn value, newPathError(path, err)\n\t\t}\n\t\tcaster, ok := opts.getCasterForPath(path)\n\t\tif !ok {\n\t\t\treturn newValue, nil\n\t\t}\n\t\tcasted, err := caster(newValue)\n\t\tif err != nil {\n\t\t\treturn casted, newPathError(path, fmt.Errorf(\"failed to cast to expected type: %w\", err))\n\t\t}\n\t\treturn casted, nil\n\n\tcase map[string]interface{}:\n\t\tout := map[string]interface{}{}\n\t\tfor key, elem := range value {\n\t\t\tinterpolatedElem, err := recursiveInterpolate(elem, path.Next(key), opts)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tout[key] = interpolatedElem\n\t\t}\n\t\treturn out, nil\n\n\tcase []interface{}:\n\t\tout := make([]interface{}, len(value))\n\t\tfor i, elem := range value {\n\t\t\tinterpolatedElem, err := recursiveInterpolate(elem, path.Next(tree.PathMatchList), opts)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tout[i] = interpolatedElem\n\t\t}\n\t\treturn out, nil\n\n\tdefault:\n\t\treturn value, nil\n\t}\n}\n\nfunc newPathError(path tree.Path, err error) error {\n\tvar ite *template.InvalidTemplateError\n\tswitch {\n\tcase err == nil:\n\t\treturn nil\n\tcase errors.As(err, &ite):\n\t\treturn fmt.Errorf(\n\t\t\t\"invalid interpolation format for %s.\\nYou may need to escape any $ with another $.\\n%s\",\n\t\t\tpath, ite.Template)\n\tdefault:\n\t\treturn fmt.Errorf(\"error while interpolating %s: %w\", path, err)\n\t}\n}\n\nfunc (o Options) getCasterForPath(path tree.Path) (Cast, bool) {\n\tfor pattern, caster := range o.TypeCastMapping {\n\t\tif path.Matches(pattern) {\n\t\t\treturn caster, true\n\t\t}\n\t}\n\treturn nil, false\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/environment.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// ResolveEnvironment update the environment variables for the format {- VAR} (without interpolation)\nfunc ResolveEnvironment(dict map[string]any, environment types.Mapping) {\n\tresolveServicesEnvironment(dict, environment)\n\tresolveSecretsEnvironment(dict, environment)\n\tresolveConfigsEnvironment(dict, environment)\n}\n\nfunc resolveServicesEnvironment(dict map[string]any, environment types.Mapping) {\n\tservices, ok := dict[\"services\"].(map[string]any)\n\tif !ok {\n\t\treturn\n\t}\n\n\tfor service, cfg := range services {\n\t\tserviceConfig, ok := cfg.(map[string]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tserviceEnv, ok := serviceConfig[\"environment\"].([]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tenvs := []any{}\n\t\tfor _, env := range serviceEnv {\n\t\t\tvarEnv, ok := env.(string)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif found, ok := environment[varEnv]; ok {\n\t\t\t\tenvs = append(envs, fmt.Sprintf(\"%s=%s\", varEnv, found))\n\t\t\t} else {\n\t\t\t\t// either does not exist or it was already resolved in interpolation\n\t\t\t\tenvs = append(envs, varEnv)\n\t\t\t}\n\t\t}\n\t\tserviceConfig[\"environment\"] = envs\n\t\tservices[service] = serviceConfig\n\t}\n\tdict[\"services\"] = services\n}\n\nfunc resolveSecretsEnvironment(dict map[string]any, environment types.Mapping) {\n\tsecrets, ok := dict[\"secrets\"].(map[string]any)\n\tif !ok {\n\t\treturn\n\t}\n\n\tfor name, cfg := range secrets {\n\t\tsecret, ok := cfg.(map[string]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tenv, ok := secret[\"environment\"].(string)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif found, ok := environment[env]; ok {\n\t\t\tsecret[types.SecretConfigXValue] = found\n\t\t}\n\t\tsecrets[name] = secret\n\t}\n\tdict[\"secrets\"] = secrets\n}\n\nfunc resolveConfigsEnvironment(dict map[string]any, environment types.Mapping) {\n\tconfigs, ok := dict[\"configs\"].(map[string]any)\n\tif !ok {\n\t\treturn\n\t}\n\n\tfor name, cfg := range configs {\n\t\tconfig, ok := cfg.(map[string]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tenv, ok := config[\"environment\"].(string)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif found, ok := environment[env]; ok {\n\t\t\tconfig[\"content\"] = found\n\t\t}\n\t\tconfigs[name] = config\n\t}\n\tdict[\"configs\"] = configs\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/example1.env",
    "content": "# passed through\nFOO=foo_from_env_file\nENV.WITH.DOT=ok\nENV_WITH_UNDERSCORE=ok\n\n# overridden in example2.env\nBAR=bar_from_env_file\n\n# overridden in full-example.yml\nBAZ=baz_from_env_file\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/example2.env",
    "content": "BAR=bar_from_env_file_2\n\n# overridden in configDetails.Environment\nQUX=quz_from_env_file_2\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/extends.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path/filepath\"\n\n\t\"github.com/compose-spec/compose-go/v2/consts\"\n\t\"github.com/compose-spec/compose-go/v2/override\"\n\t\"github.com/compose-spec/compose-go/v2/paths\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\nfunc ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post ...PostProcessor) error {\n\ta, ok := dict[\"services\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tservices, ok := a.(map[string]any)\n\tif !ok {\n\t\treturn fmt.Errorf(\"services must be a mapping\")\n\t}\n\tfor name := range services {\n\t\tmerged, err := applyServiceExtends(ctx, name, services, opts, tracker, post...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tservices[name] = merged\n\t}\n\tdict[\"services\"] = services\n\treturn nil\n}\n\nfunc applyServiceExtends(ctx context.Context, name string, services map[string]any, opts *Options, tracker *cycleTracker, post ...PostProcessor) (any, error) {\n\ts := services[name]\n\tif s == nil {\n\t\treturn nil, nil\n\t}\n\tservice, ok := s.(map[string]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"services.%s must be a mapping\", name)\n\t}\n\textends, ok := service[\"extends\"]\n\tif !ok {\n\t\treturn s, nil\n\t}\n\tfilename := ctx.Value(consts.ComposeFileKey{}).(string)\n\tvar (\n\t\terr  error\n\t\tref  string\n\t\tfile any\n\t)\n\tswitch v := extends.(type) {\n\tcase map[string]any:\n\t\tref = v[\"service\"].(string)\n\t\tfile = v[\"file\"]\n\t\topts.ProcessEvent(\"extends\", v)\n\tcase string:\n\t\tref = v\n\t\topts.ProcessEvent(\"extends\", map[string]any{\"service\": ref})\n\t}\n\n\tvar (\n\t\tbase      any\n\t\tprocessor PostProcessor\n\t)\n\n\tif file != nil {\n\t\trefFilename := file.(string)\n\t\tservices, processor, err = getExtendsBaseFromFile(ctx, name, ref, filename, refFilename, opts, tracker)\n\t\tpost = append(post, processor)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfilename = refFilename\n\t} else {\n\t\t_, ok := services[ref]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cannot extend service %q in %s: service %q not found\", name, filename, ref)\n\t\t}\n\t}\n\n\ttracker, err = tracker.Add(filename, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// recursively apply `extends`\n\tbase, err = applyServiceExtends(ctx, ref, services, opts, tracker, post...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif base == nil {\n\t\treturn service, nil\n\t}\n\tsource := deepClone(base).(map[string]any)\n\n\tfor _, processor := range post {\n\t\tprocessor.Apply(map[string]any{\n\t\t\t\"services\": map[string]any{\n\t\t\t\tname: source,\n\t\t\t},\n\t\t})\n\t}\n\tmerged, err := override.ExtendService(source, service)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdelete(merged, \"extends\")\n\tservices[name] = merged\n\treturn merged, nil\n}\n\nfunc getExtendsBaseFromFile(\n\tctx context.Context,\n\tname, ref string,\n\tpath, refPath string,\n\topts *Options,\n\tct *cycleTracker,\n) (map[string]any, PostProcessor, error) {\n\tfor _, loader := range opts.ResourceLoaders {\n\t\tif !loader.Accept(refPath) {\n\t\t\tcontinue\n\t\t}\n\t\tlocal, err := loader.Load(ctx, refPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tlocaldir := filepath.Dir(local)\n\t\trelworkingdir := loader.Dir(refPath)\n\n\t\textendsOpts := opts.clone()\n\t\t// replace localResourceLoader with a new flavour, using extended file base path\n\t\textendsOpts.ResourceLoaders = append(opts.RemoteResourceLoaders(), localResourceLoader{\n\t\t\tWorkingDir: localdir,\n\t\t})\n\t\textendsOpts.ResolvePaths = false // we do relative path resolution after file has been loaded\n\t\textendsOpts.SkipNormalization = true\n\t\textendsOpts.SkipConsistencyCheck = true\n\t\textendsOpts.SkipInclude = true\n\t\textendsOpts.SkipExtends = true    // we manage extends recursively based on raw service definition\n\t\textendsOpts.SkipValidation = true // we validate the merge result\n\t\textendsOpts.SkipDefaultValues = true\n\t\tsource, processor, err := loadYamlFile(ctx, types.ConfigFile{Filename: local},\n\t\t\textendsOpts, relworkingdir, nil, ct, map[string]any{}, nil)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tm, ok := source[\"services\"]\n\t\tif !ok {\n\t\t\treturn nil, nil, fmt.Errorf(\"cannot extend service %q in %s: no services section\", name, local)\n\t\t}\n\t\tservices, ok := m.(map[string]any)\n\t\tif !ok {\n\t\t\treturn nil, nil, fmt.Errorf(\"cannot extend service %q in %s: services must be a mapping\", name, local)\n\t\t}\n\t\t_, ok = services[ref]\n\t\tif !ok {\n\t\t\treturn nil, nil, fmt.Errorf(\n\t\t\t\t\"cannot extend service %q in %s: service %q not found in %s\",\n\t\t\t\tname,\n\t\t\t\tpath,\n\t\t\t\tref,\n\t\t\t\trefPath,\n\t\t\t)\n\t\t}\n\n\t\tvar remotes []paths.RemoteResource\n\t\tfor _, loader := range opts.RemoteResourceLoaders() {\n\t\t\tremotes = append(remotes, loader.Accept)\n\t\t}\n\t\terr = paths.ResolveRelativePaths(source, relworkingdir, remotes)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\treturn services, processor, nil\n\t}\n\treturn nil, nil, fmt.Errorf(\"cannot read %s\", refPath)\n}\n\nfunc deepClone(value any) any {\n\tswitch v := value.(type) {\n\tcase []any:\n\t\tcp := make([]any, len(v))\n\t\tfor i, e := range v {\n\t\t\tcp[i] = deepClone(e)\n\t\t}\n\t\treturn cp\n\tcase map[string]any:\n\t\tcp := make(map[string]any, len(v))\n\t\tfor k, e := range v {\n\t\t\tcp[k] = deepClone(e)\n\t\t}\n\t\treturn cp\n\tdefault:\n\t\treturn value\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/fix.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\n// fixEmptyNotNull is a workaround for https://github.com/xeipuuv/gojsonschema/issues/141\n// as go-yaml `[]` will load as a `[]any(nil)`, which is not the same as an empty array\nfunc fixEmptyNotNull(value any) interface{} {\n\tswitch v := value.(type) {\n\tcase []any:\n\t\tif v == nil {\n\t\t\treturn []any{}\n\t\t}\n\t\tfor i, e := range v {\n\t\t\tv[i] = fixEmptyNotNull(e)\n\t\t}\n\tcase map[string]any:\n\t\tfor k, e := range v {\n\t\t\tv[k] = fixEmptyNotNull(e)\n\t\t}\n\t}\n\treturn value\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/full-example.yml",
    "content": "name: full_example_project_name\nservices:\n\n  bar:\n    build:\n      dockerfile_inline: |\n        FROM alpine\n        RUN echo \"hello\" > /world.txt\n\n  foo:\n    annotations:\n      - com.example.foo=bar\n    build:\n      context: ./dir\n      dockerfile: Dockerfile\n      args:\n        foo: bar\n      ssh:\n        - default\n      target: foo\n      network: foo\n      cache_from:\n        - foo\n        - bar\n      labels: [FOO=BAR]\n      additional_contexts:\n        foo: ./bar\n      secrets:\n        - source: secret1\n          target: /run/secrets/secret1\n        - source: secret2\n          target: my_secret\n          uid: '103'\n          gid: '103'\n          mode: 0440\n      tags:\n        - foo:v1.0.0\n        - docker.io/username/foo:my-other-tag\n        - ${COMPOSE_PROJECT_NAME}:1.0.0\n      platforms:\n        - linux/amd64\n        - linux/arm64\n\n\n    cap_add:\n      - ALL\n\n    cap_drop:\n      - NET_ADMIN\n      - SYS_ADMIN\n\n    cgroup_parent: m-executor-abcd\n\n    # String or list\n    command: bundle exec thin -p 3000\n    # command: [\"bundle\", \"exec\", \"thin\", \"-p\", \"3000\"]\n\n    configs:\n      - config1\n      - source: config2\n        target: /my_config\n        uid: '103'\n        gid: '103'\n        mode: 0440\n\n    container_name: my-web-container\n\n    depends_on:\n      - db\n      - redis\n\n    deploy:\n      mode: replicated\n      replicas: 6\n      labels: [FOO=BAR]\n      rollback_config:\n        parallelism: 3\n        delay: 10s\n        failure_action: continue\n        monitor: 60s\n        max_failure_ratio: 0.3\n        order: start-first\n      update_config:\n        parallelism: 3\n        delay: 10s\n        failure_action: continue\n        monitor: 60s\n        max_failure_ratio: 0.3\n        order: start-first\n      resources:\n        limits:\n          cpus: '0.001'\n          memory: 50M\n        reservations:\n          cpus: '0.0001'\n          memory: 20M\n          generic_resources:\n            - discrete_resource_spec:\n                kind: 'gpu'\n                value: 2\n            - discrete_resource_spec:\n                kind: 'ssd'\n                value: 1\n      restart_policy:\n        condition: on-failure\n        delay: 5s\n        max_attempts: 3\n        window: 120s\n      placement:\n        constraints: [node=foo]\n        max_replicas_per_node: 5\n        preferences:\n          - spread: node.labels.az\n      endpoint_mode: dnsrr\n\n    device_cgroup_rules:\n      - \"c 1:3 mr\"\n      - \"a 7:* rmw\"\n\n    devices:\n      - source: /dev/ttyUSB0\n        target: /dev/ttyUSB0\n        permissions: rwm\n\n    # String or list\n    # dns: 8.8.8.8\n    dns:\n      - 8.8.8.8\n      - 9.9.9.9\n\n    # String or list\n    # dns_search: example.com\n    dns_search:\n      - dc1.example.com\n      - dc2.example.com\n\n    domainname: foo.com\n\n    # String or list\n    # entrypoint: /code/entrypoint.sh -p 3000\n    entrypoint: [\"/code/entrypoint.sh\", \"-p\", \"3000\"]\n\n    # String or list\n    # env_file: .env\n    env_file:\n      - ./example1.env\n      - path: ./example2.env\n        required: false\n\n    # Mapping or list\n    # Mapping values can be strings, numbers or null\n    # Booleans are not allowed - must be quoted\n    environment:\n      BAZ: baz_from_service_def\n      QUX:\n    # environment:\n    #   - RACK_ENV=development\n    #   - SHOW=true\n    #   - SESSION_SECRET\n\n    # Items can be strings or numbers\n    expose:\n     - \"3000\"\n     - 8000\n\n    external_links:\n      - redis_1\n      - project_db_1:mysql\n      - project_db_1:postgresql\n\n    # Mapping or list\n    # Mapping values must be strings\n    # extra_hosts:\n    #   somehost: \"162.242.195.82\"\n    #   otherhost: \"50.31.209.229\"\n    extra_hosts:\n      - \"otherhost:50.31.209.229\"\n      - \"somehost:162.242.195.82\"\n\n    hostname: foo\n\n    healthcheck:\n      test: echo \"hello world\"\n      interval: 10s\n      timeout: 1s\n      retries: 5\n      start_period: 15s\n      start_interval: 5s\n\n    # Any valid image reference - repo, tag, id, sha\n    image: redis\n    # image: ubuntu:14.04\n    # image: tutum/influxdb\n    # image: example-registry.com:4000/postgresql\n    # image: a4bc65fd\n    # image: busybox@sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b52004ee8502d\n\n    ipc: host\n\n    uts: host\n\n    # Mapping or list\n    # Mapping values can be strings, numbers or null\n    labels:\n      com.example.description: \"Accounting webapp\"\n      com.example.number: 42\n      com.example.empty-label:\n    # labels:\n    #   - \"com.example.description=Accounting webapp\"\n    #   - \"com.example.number=42\"\n    #   - \"com.example.empty-label\"\n\n    links:\n     - db\n     - db:database\n     - redis\n\n    logging:\n      driver: syslog\n      options:\n        syslog-address: \"tcp://192.168.0.42:123\"\n\n    mac_address: 02:42:ac:11:65:43\n\n    # network_mode: \"bridge\"\n    # network_mode: \"host\"\n    # network_mode: \"none\"\n    # Use the network mode of an arbitrary container from another service\n    # network_mode: \"service:db\"\n    # Use the network mode of another container, specified by name or id\n    # network_mode: \"container:some-container\"\n    network_mode: \"container:0cfeab0f748b9a743dc3da582046357c6ef497631c1a016d28d2bf9b4f899f7b\"\n\n    networks:\n      some-network:\n        aliases:\n         - alias1\n         - alias3\n      other-network:\n        ipv4_address: 172.16.238.10\n        ipv6_address: 2001:3984:3989::10\n        mac_address: 02:42:72:98:65:08\n      other-other-network:\n\n    pid: \"host\"\n\n    ports:\n      - 3000\n      - \"3001-3005\"\n      - \"8000:8000\"\n      - \"9090-9091:8080-8081\"\n      - \"49100:22\"\n      - \"127.0.0.1:8001:8001\"\n      - \"127.0.0.1:5000-5010:5000-5010\"\n\n    privileged: true\n\n    read_only: true\n\n    restart: always\n\n    secrets:\n      - source: secret1\n        target: /run/secrets/secret1\n      - source: secret2\n        target: my_secret\n        uid: '103'\n        gid: '103'\n        mode: 0440\n\n    security_opt:\n      - label=level:s0:c100,c200\n      - label=type:svirt_apache_t\n\n    stdin_open: true\n\n    stop_grace_period: 20s\n\n    stop_signal: SIGUSR1\n    storage_opt:\n      size: \"20G\"\n    sysctls:\n      net.core.somaxconn: 1024\n      net.ipv4.tcp_syncookies: 0\n\n    # String or list\n    # tmpfs: /run\n    tmpfs:\n      - /run\n      - /tmp\n\n    tty: true\n\n    ulimits:\n      # Single number or mapping with soft + hard limits\n      nproc: 65535\n      nofile:\n        soft: 20000\n        hard: 40000\n\n    user: someone\n\n    volumes:\n      # Just specify a path and let the Engine create a volume\n      - /var/lib/anonymous\n      # Specify an absolute path mapping\n      - /opt/data:/var/lib/data\n      # Path on the host, relative to the Compose file\n      - .:/code\n      - ./static:/var/www/html\n      # User-relative path\n      - ~/configs:/etc/configs:ro\n      # Named volume\n      - datavolume:/var/lib/volume\n      - type: bind\n        source: ./opt\n        target: /opt/cached\n        consistency: cached\n      - type: tmpfs\n        target: /opt/tmpfs\n        tmpfs:\n          size: 10000\n\n    working_dir: /code\n    x-bar: baz\n    x-foo: bar\n\nnetworks:\n  # Entries can be null, which specifies simply that a network\n  # called \"{project name}_some-network\" should be created and\n  # use the default driver\n  some-network:\n\n  other-network:\n    driver: overlay\n\n    driver_opts:\n      # Values can be strings or numbers\n      foo: \"bar\"\n      baz: 1\n\n    ipam:\n      driver: overlay\n      # driver_opts:\n      #   # Values can be strings or numbers\n      #   com.docker.network.enable_ipv6: \"true\"\n      #   com.docker.network.numeric_value: 1\n      config:\n      - subnet: 172.28.0.0/16\n        ip_range: 172.28.5.0/24\n        gateway: 172.28.5.254\n        aux_addresses:\n          host1: 172.28.1.5\n          host2: 172.28.1.6\n          host3: 172.28.1.7\n      - subnet: 2001:3984:3989::/64\n        gateway: 2001:3984:3989::1\n\n    labels:\n      foo: bar\n\n  external-network:\n    # Specifies that a pre-existing network called \"external-network\"\n    # can be referred to within this file as \"external-network\"\n    external: true\n\n  other-external-network:\n    # Specifies that a pre-existing network called \"my-cool-network\"\n    # can be referred to within this file as \"other-external-network\"\n    external:\n      name: my-cool-network\n    x-bar: baz\n    x-foo: bar\n\nvolumes:\n  # Entries can be null, which specifies simply that a volume\n  # called \"{project name}_some-volume\" should be created and\n  # use the default driver\n  some-volume:\n\n  other-volume:\n    driver: flocker\n\n    driver_opts:\n      # Values can be strings or numbers\n      foo: \"bar\"\n      baz: 1\n    labels:\n      foo: bar\n\n  another-volume:\n    name: \"user_specified_name\"\n    driver: vsphere\n\n    driver_opts:\n      # Values can be strings or numbers\n      foo: \"bar\"\n      baz: 1\n\n  external-volume:\n    # Specifies that a pre-existing volume called \"external-volume\"\n    # can be referred to within this file as \"external-volume\"\n    external: true\n\n  other-external-volume:\n    # Specifies that a pre-existing volume called \"my-cool-volume\"\n    # can be referred to within this file as \"other-external-volume\"\n    # This example uses the deprecated \"volume.external.name\" (replaced by \"volume.name\")\n    external:\n      name: my-cool-volume\n\n  external-volume3:\n    # Specifies that a pre-existing volume called \"this-is-volume3\"\n    # can be referred to within this file as \"external-volume3\"\n    name: this-is-volume3\n    external: true\n    x-bar: baz\n    x-foo: bar\n\nconfigs:\n  config1:\n    file: ./config_data\n    labels:\n      foo: bar\n  config2:\n    external:\n      name: my_config\n  config3:\n    external: true\n  config4:\n    name: foo\n    file: ~/config_data\n    x-bar: baz\n    x-foo: bar\n\nsecrets:\n  secret1:\n    file: ./secret_data\n    labels:\n      foo: bar\n  secret2:\n    external:\n      name: my_secret\n  secret3:\n    external: true\n  secret4:\n    name: bar\n    environment: BAR\n    x-bar: baz\n    x-foo: bar\n  secret5:\n    file: /abs/secret_data\nx-bar: baz\nx-foo: bar\nx-nested:\n  bar: baz\n  foo: bar\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/include.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/dotenv\"\n\tinterp \"github.com/compose-spec/compose-go/v2/interpolation\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// loadIncludeConfig parse the required config from raw yaml\nfunc loadIncludeConfig(source any) ([]types.IncludeConfig, error) {\n\tif source == nil {\n\t\treturn nil, nil\n\t}\n\tconfigs, ok := source.([]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"`include` must be a list, got %s\", source)\n\t}\n\tfor i, config := range configs {\n\t\tif v, ok := config.(string); ok {\n\t\t\tconfigs[i] = map[string]any{\n\t\t\t\t\"path\": v,\n\t\t\t}\n\t\t}\n\t}\n\tvar requires []types.IncludeConfig\n\terr := Transform(source, &requires)\n\treturn requires, err\n}\n\nfunc ApplyInclude(ctx context.Context, workingDir string, environment types.Mapping, model map[string]any, options *Options, included []string) error {\n\tincludeConfig, err := loadIncludeConfig(model[\"include\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, r := range includeConfig {\n\t\tfor _, listener := range options.Listeners {\n\t\t\tlistener(\"include\", map[string]any{\n\t\t\t\t\"path\":       r.Path,\n\t\t\t\t\"workingdir\": workingDir,\n\t\t\t})\n\t\t}\n\n\t\tvar relworkingdir string\n\t\tfor i, p := range r.Path {\n\t\t\tfor _, loader := range options.ResourceLoaders {\n\t\t\t\tif !loader.Accept(p) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpath, err := loader.Load(ctx, p)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tp = path\n\n\t\t\t\tif i == 0 { // This is the \"main\" file, used to define project-directory. Others are overrides\n\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase r.ProjectDirectory == \"\":\n\t\t\t\t\t\trelworkingdir = loader.Dir(path)\n\t\t\t\t\t\tr.ProjectDirectory = filepath.Dir(path)\n\t\t\t\t\tcase !filepath.IsAbs(r.ProjectDirectory):\n\t\t\t\t\t\trelworkingdir = loader.Dir(r.ProjectDirectory)\n\t\t\t\t\t\tr.ProjectDirectory = filepath.Join(workingDir, r.ProjectDirectory)\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\trelworkingdir = r.ProjectDirectory\n\n\t\t\t\t\t}\n\t\t\t\t\tfor _, f := range included {\n\t\t\t\t\t\tif f == path {\n\t\t\t\t\t\t\tincluded = append(included, path)\n\t\t\t\t\t\t\treturn fmt.Errorf(\"include cycle detected:\\n%s\\n include %s\", included[0], strings.Join(included[1:], \"\\n include \"))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tr.Path[i] = p\n\t\t}\n\n\t\tloadOptions := options.clone()\n\t\tloadOptions.ResolvePaths = true\n\t\tloadOptions.SkipNormalization = true\n\t\tloadOptions.SkipConsistencyCheck = true\n\t\tloadOptions.ResourceLoaders = append(loadOptions.RemoteResourceLoaders(), localResourceLoader{\n\t\t\tWorkingDir: r.ProjectDirectory,\n\t\t})\n\n\t\tif len(r.EnvFile) == 0 {\n\t\t\tf := filepath.Join(r.ProjectDirectory, \".env\")\n\t\t\tif s, err := os.Stat(f); err == nil && !s.IsDir() {\n\t\t\t\tr.EnvFile = types.StringList{f}\n\t\t\t}\n\t\t} else {\n\t\t\tenvFile := []string{}\n\t\t\tfor _, f := range r.EnvFile {\n\t\t\t\tif !filepath.IsAbs(f) {\n\t\t\t\t\tf = filepath.Join(workingDir, f)\n\t\t\t\t\ts, err := os.Stat(f)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif s.IsDir() {\n\t\t\t\t\t\treturn fmt.Errorf(\"%s is not a file\", f)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tenvFile = append(envFile, f)\n\t\t\t}\n\t\t\tr.EnvFile = envFile\n\t\t}\n\n\t\tenvFromFile, err := dotenv.GetEnvFromFile(environment, r.EnvFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tconfig := types.ConfigDetails{\n\t\t\tWorkingDir:  relworkingdir,\n\t\t\tConfigFiles: types.ToConfigFiles(r.Path),\n\t\t\tEnvironment: environment.Clone().Merge(envFromFile),\n\t\t}\n\t\tloadOptions.Interpolate = &interp.Options{\n\t\t\tSubstitute:      options.Interpolate.Substitute,\n\t\t\tLookupValue:     config.LookupEnv,\n\t\t\tTypeCastMapping: options.Interpolate.TypeCastMapping,\n\t\t}\n\t\timported, err := loadYamlModel(ctx, config, loadOptions, &cycleTracker{}, included)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = importResources(imported, model)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tdelete(model, \"include\")\n\treturn nil\n}\n\n// importResources import into model all resources defined by imported, and report error on conflict\nfunc importResources(source map[string]any, target map[string]any) error {\n\tif err := importResource(source, target, \"services\"); err != nil {\n\t\treturn err\n\t}\n\tif err := importResource(source, target, \"volumes\"); err != nil {\n\t\treturn err\n\t}\n\tif err := importResource(source, target, \"networks\"); err != nil {\n\t\treturn err\n\t}\n\tif err := importResource(source, target, \"secrets\"); err != nil {\n\t\treturn err\n\t}\n\tif err := importResource(source, target, \"configs\"); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc importResource(source map[string]any, target map[string]any, key string) error {\n\tfrom := source[key]\n\tif from != nil {\n\t\tvar to map[string]any\n\t\tif v, ok := target[key]; ok {\n\t\t\tto = v.(map[string]any)\n\t\t} else {\n\t\t\tto = map[string]any{}\n\t\t}\n\t\tfor name, a := range from.(map[string]any) {\n\t\t\tif conflict, ok := to[name]; ok {\n\t\t\t\tif reflect.DeepEqual(a, conflict) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"%s.%s conflicts with imported resource\", key, name)\n\t\t\t}\n\t\t\tto[name] = a\n\t\t}\n\t\ttarget[key] = to\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/interpolate.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\tinterp \"github.com/compose-spec/compose-go/v2/interpolation\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar interpolateTypeCastMapping = map[tree.Path]interp.Cast{\n\tservicePath(\"configs\", tree.PathMatchList, \"mode\"):             toInt,\n\tservicePath(\"cpu_count\"):                                       toInt64,\n\tservicePath(\"cpu_percent\"):                                     toFloat,\n\tservicePath(\"cpu_period\"):                                      toInt64,\n\tservicePath(\"cpu_quota\"):                                       toInt64,\n\tservicePath(\"cpu_rt_period\"):                                   toInt64,\n\tservicePath(\"cpu_rt_runtime\"):                                  toInt64,\n\tservicePath(\"cpus\"):                                            toFloat32,\n\tservicePath(\"cpu_shares\"):                                      toInt64,\n\tservicePath(\"init\"):                                            toBoolean,\n\tservicePath(\"deploy\", \"replicas\"):                              toInt,\n\tservicePath(\"deploy\", \"update_config\", \"parallelism\"):          toInt,\n\tservicePath(\"deploy\", \"update_config\", \"max_failure_ratio\"):    toFloat,\n\tservicePath(\"deploy\", \"rollback_config\", \"parallelism\"):        toInt,\n\tservicePath(\"deploy\", \"rollback_config\", \"max_failure_ratio\"):  toFloat,\n\tservicePath(\"deploy\", \"restart_policy\", \"max_attempts\"):        toInt,\n\tservicePath(\"deploy\", \"placement\", \"max_replicas_per_node\"):    toInt,\n\tservicePath(\"healthcheck\", \"retries\"):                          toInt,\n\tservicePath(\"healthcheck\", \"disable\"):                          toBoolean,\n\tservicePath(\"oom_kill_disable\"):                                toBoolean,\n\tservicePath(\"oom_score_adj\"):                                   toInt64,\n\tservicePath(\"pids_limit\"):                                      toInt64,\n\tservicePath(\"ports\", tree.PathMatchList, \"target\"):             toInt,\n\tservicePath(\"privileged\"):                                      toBoolean,\n\tservicePath(\"read_only\"):                                       toBoolean,\n\tservicePath(\"scale\"):                                           toInt,\n\tservicePath(\"secrets\", tree.PathMatchList, \"mode\"):             toInt,\n\tservicePath(\"stdin_open\"):                                      toBoolean,\n\tservicePath(\"tty\"):                                             toBoolean,\n\tservicePath(\"ulimits\", tree.PathMatchAll):                      toInt,\n\tservicePath(\"ulimits\", tree.PathMatchAll, \"hard\"):              toInt,\n\tservicePath(\"ulimits\", tree.PathMatchAll, \"soft\"):              toInt,\n\tservicePath(\"volumes\", tree.PathMatchList, \"read_only\"):        toBoolean,\n\tservicePath(\"volumes\", tree.PathMatchList, \"volume\", \"nocopy\"): toBoolean,\n\tiPath(\"networks\", tree.PathMatchAll, \"external\"):               toBoolean,\n\tiPath(\"networks\", tree.PathMatchAll, \"internal\"):               toBoolean,\n\tiPath(\"networks\", tree.PathMatchAll, \"attachable\"):             toBoolean,\n\tiPath(\"networks\", tree.PathMatchAll, \"enable_ipv6\"):            toBoolean,\n\tiPath(\"volumes\", tree.PathMatchAll, \"external\"):                toBoolean,\n\tiPath(\"secrets\", tree.PathMatchAll, \"external\"):                toBoolean,\n\tiPath(\"configs\", tree.PathMatchAll, \"external\"):                toBoolean,\n}\n\nfunc iPath(parts ...string) tree.Path {\n\treturn tree.NewPath(parts...)\n}\n\nfunc servicePath(parts ...string) tree.Path {\n\treturn iPath(append([]string{\"services\", tree.PathMatchAll}, parts...)...)\n}\n\nfunc toInt(value string) (interface{}, error) {\n\treturn strconv.Atoi(value)\n}\n\nfunc toInt64(value string) (interface{}, error) {\n\treturn strconv.ParseInt(value, 10, 64)\n}\n\nfunc toFloat(value string) (interface{}, error) {\n\treturn strconv.ParseFloat(value, 64)\n}\n\nfunc toFloat32(value string) (interface{}, error) {\n\tf, err := strconv.ParseFloat(value, 32)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn float32(f), nil\n}\n\n// should match http://yaml.org/type/bool.html\nfunc toBoolean(value string) (interface{}, error) {\n\tswitch strings.ToLower(value) {\n\tcase \"true\":\n\t\treturn true, nil\n\tcase \"false\":\n\t\treturn false, nil\n\tcase \"y\", \"yes\", \"on\":\n\t\tlogrus.Warnf(\"%q for boolean is not supported by YAML 1.2, please use `true`\", value)\n\t\treturn true, nil\n\tcase \"n\", \"no\", \"off\":\n\t\tlogrus.Warnf(\"%q for boolean is not supported by YAML 1.2, please use `false`\", value)\n\t\treturn false, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid boolean: %s\", value)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/loader.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/consts\"\n\tinterp \"github.com/compose-spec/compose-go/v2/interpolation\"\n\t\"github.com/compose-spec/compose-go/v2/override\"\n\t\"github.com/compose-spec/compose-go/v2/paths\"\n\t\"github.com/compose-spec/compose-go/v2/schema\"\n\t\"github.com/compose-spec/compose-go/v2/template\"\n\t\"github.com/compose-spec/compose-go/v2/transform\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/compose-spec/compose-go/v2/validation\"\n\t\"github.com/go-viper/mapstructure/v2\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/exp/slices\"\n\t\"gopkg.in/yaml.v3\"\n)\n\n// Options supported by Load\ntype Options struct {\n\t// Skip schema validation\n\tSkipValidation bool\n\t// Skip interpolation\n\tSkipInterpolation bool\n\t// Skip normalization\n\tSkipNormalization bool\n\t// Resolve path\n\tResolvePaths bool\n\t// Convert Windows path\n\tConvertWindowsPaths bool\n\t// Skip consistency check\n\tSkipConsistencyCheck bool\n\t// Skip extends\n\tSkipExtends bool\n\t// SkipInclude will ignore `include` and only load model from file(s) set by ConfigDetails\n\tSkipInclude bool\n\t// SkipResolveEnvironment will ignore computing `environment` for services\n\tSkipResolveEnvironment bool\n\t// SkipDefaultValues will ignore missing required attributes\n\tSkipDefaultValues bool\n\t// Interpolation options\n\tInterpolate *interp.Options\n\t// Discard 'env_file' entries after resolving to 'environment' section\n\tdiscardEnvFiles bool\n\t// Set project projectName\n\tprojectName string\n\t// Indicates when the projectName was imperatively set or guessed from path\n\tprojectNameImperativelySet bool\n\t// Profiles set profiles to enable\n\tProfiles []string\n\t// ResourceLoaders manages support for remote resources\n\tResourceLoaders []ResourceLoader\n\t// KnownExtensions manages x-* attribute we know and the corresponding go structs\n\tKnownExtensions map[string]any\n\t// Metada for telemetry\n\tListeners []Listener\n}\n\nvar versionWarning []string\n\nfunc (o *Options) warnObsoleteVersion(file string) {\n\tif !slices.Contains(versionWarning, file) {\n\t\tlogrus.Warning(fmt.Sprintf(\"%s: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion\", file))\n\t}\n\tversionWarning = append(versionWarning, file)\n}\n\ntype Listener = func(event string, metadata map[string]any)\n\n// Invoke all listeners for an event\nfunc (o *Options) ProcessEvent(event string, metadata map[string]any) {\n\tfor _, l := range o.Listeners {\n\t\tl(event, metadata)\n\t}\n}\n\n// ResourceLoader is a plugable remote resource resolver\ntype ResourceLoader interface {\n\t// Accept returns `true` is the resource reference matches ResourceLoader supported protocol(s)\n\tAccept(path string) bool\n\t// Load returns the path to a local copy of remote resource identified by `path`.\n\tLoad(ctx context.Context, path string) (string, error)\n\t// Dir computes path to resource\"s parent folder, made relative if possible\n\tDir(path string) string\n}\n\n// RemoteResourceLoaders excludes localResourceLoader from ResourceLoaders\nfunc (o Options) RemoteResourceLoaders() []ResourceLoader {\n\tvar loaders []ResourceLoader\n\tfor i, loader := range o.ResourceLoaders {\n\t\tif _, ok := loader.(localResourceLoader); ok {\n\t\t\tif i != len(o.ResourceLoaders)-1 {\n\t\t\t\tlogrus.Warning(\"misconfiguration of ResourceLoaders: localResourceLoader should be last\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tloaders = append(loaders, loader)\n\t}\n\treturn loaders\n}\n\ntype localResourceLoader struct {\n\tWorkingDir string\n}\n\nfunc (l localResourceLoader) abs(p string) string {\n\tif filepath.IsAbs(p) {\n\t\treturn p\n\t}\n\treturn filepath.Join(l.WorkingDir, p)\n}\n\nfunc (l localResourceLoader) Accept(p string) bool {\n\t_, err := os.Stat(l.abs(p))\n\treturn err == nil\n}\n\nfunc (l localResourceLoader) Load(_ context.Context, p string) (string, error) {\n\treturn l.abs(p), nil\n}\n\nfunc (l localResourceLoader) Dir(originalPath string) string {\n\tpath := l.abs(originalPath)\n\tif !l.isDir(path) {\n\t\tpath = l.abs(filepath.Dir(originalPath))\n\t}\n\trel, err := filepath.Rel(l.WorkingDir, path)\n\tif err != nil {\n\t\treturn path\n\t}\n\treturn rel\n}\n\nfunc (l localResourceLoader) isDir(path string) bool {\n\tfileInfo, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fileInfo.IsDir()\n}\n\nfunc (o *Options) clone() *Options {\n\treturn &Options{\n\t\tSkipValidation:             o.SkipValidation,\n\t\tSkipInterpolation:          o.SkipInterpolation,\n\t\tSkipNormalization:          o.SkipNormalization,\n\t\tResolvePaths:               o.ResolvePaths,\n\t\tConvertWindowsPaths:        o.ConvertWindowsPaths,\n\t\tSkipConsistencyCheck:       o.SkipConsistencyCheck,\n\t\tSkipExtends:                o.SkipExtends,\n\t\tSkipInclude:                o.SkipInclude,\n\t\tInterpolate:                o.Interpolate,\n\t\tdiscardEnvFiles:            o.discardEnvFiles,\n\t\tprojectName:                o.projectName,\n\t\tprojectNameImperativelySet: o.projectNameImperativelySet,\n\t\tProfiles:                   o.Profiles,\n\t\tResourceLoaders:            o.ResourceLoaders,\n\t\tKnownExtensions:            o.KnownExtensions,\n\t\tListeners:                  o.Listeners,\n\t}\n}\n\nfunc (o *Options) SetProjectName(name string, imperativelySet bool) {\n\to.projectName = name\n\to.projectNameImperativelySet = imperativelySet\n}\n\nfunc (o Options) GetProjectName() (string, bool) {\n\treturn o.projectName, o.projectNameImperativelySet\n}\n\n// serviceRef identifies a reference to a service. It's used to detect cyclic\n// references in \"extends\".\ntype serviceRef struct {\n\tfilename string\n\tservice  string\n}\n\ntype cycleTracker struct {\n\tloaded []serviceRef\n}\n\nfunc (ct *cycleTracker) Add(filename, service string) (*cycleTracker, error) {\n\ttoAdd := serviceRef{filename: filename, service: service}\n\tfor _, loaded := range ct.loaded {\n\t\tif toAdd == loaded {\n\t\t\t// Create an error message of the form:\n\t\t\t// Circular reference:\n\t\t\t//   service-a in docker-compose.yml\n\t\t\t//   extends service-b in docker-compose.yml\n\t\t\t//   extends service-a in docker-compose.yml\n\t\t\terrLines := []string{\n\t\t\t\t\"Circular reference:\",\n\t\t\t\tfmt.Sprintf(\"  %s in %s\", ct.loaded[0].service, ct.loaded[0].filename),\n\t\t\t}\n\t\t\tfor _, service := range append(ct.loaded[1:], toAdd) {\n\t\t\t\terrLines = append(errLines, fmt.Sprintf(\"  extends %s in %s\", service.service, service.filename))\n\t\t\t}\n\n\t\t\treturn nil, errors.New(strings.Join(errLines, \"\\n\"))\n\t\t}\n\t}\n\n\tvar branch []serviceRef\n\tbranch = append(branch, ct.loaded...)\n\tbranch = append(branch, toAdd)\n\treturn &cycleTracker{\n\t\tloaded: branch,\n\t}, nil\n}\n\n// WithDiscardEnvFiles sets the Options to discard the `env_file` section after resolving to\n// the `environment` section\nfunc WithDiscardEnvFiles(opts *Options) {\n\topts.discardEnvFiles = true\n}\n\n// WithSkipValidation sets the Options to skip validation when loading sections\nfunc WithSkipValidation(opts *Options) {\n\topts.SkipValidation = true\n}\n\n// WithProfiles sets profiles to be activated\nfunc WithProfiles(profiles []string) func(*Options) {\n\treturn func(opts *Options) {\n\t\topts.Profiles = profiles\n\t}\n}\n\n// ParseYAML reads the bytes from a file, parses the bytes into a mapping\n// structure, and returns it.\nfunc ParseYAML(source []byte) (map[string]interface{}, error) {\n\tr := bytes.NewReader(source)\n\tdecoder := yaml.NewDecoder(r)\n\tm, _, err := parseYAML(decoder)\n\treturn m, err\n}\n\n// PostProcessor is used to tweak compose model based on metadata extracted during yaml Unmarshal phase\n// that hardly can be implemented using go-yaml and mapstructure\ntype PostProcessor interface {\n\tyaml.Unmarshaler\n\n\t// Apply changes to compose model based on recorder metadata\n\tApply(interface{}) error\n}\n\nfunc parseYAML(decoder *yaml.Decoder) (map[string]interface{}, PostProcessor, error) {\n\tvar cfg interface{}\n\tprocessor := ResetProcessor{target: &cfg}\n\n\tif err := decoder.Decode(&processor); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tstringMap, ok := cfg.(map[string]interface{})\n\tif ok {\n\t\tconverted, err := convertToStringKeysRecursive(stringMap, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn converted.(map[string]interface{}), &processor, nil\n\t}\n\tcfgMap, ok := cfg.(map[interface{}]interface{})\n\tif !ok {\n\t\treturn nil, nil, errors.New(\"Top-level object must be a mapping\")\n\t}\n\tconverted, err := convertToStringKeysRecursive(cfgMap, \"\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn converted.(map[string]interface{}), &processor, nil\n}\n\n// Load reads a ConfigDetails and returns a fully loaded configuration.\n// Deprecated: use LoadWithContext.\nfunc Load(configDetails types.ConfigDetails, options ...func(*Options)) (*types.Project, error) {\n\treturn LoadWithContext(context.Background(), configDetails, options...)\n}\n\n// LoadWithContext reads a ConfigDetails and returns a fully loaded configuration as a compose-go Project\nfunc LoadWithContext(ctx context.Context, configDetails types.ConfigDetails, options ...func(*Options)) (*types.Project, error) {\n\topts := toOptions(&configDetails, options)\n\tdict, err := loadModelWithContext(ctx, &configDetails, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn modelToProject(dict, opts, configDetails)\n}\n\n// LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary\nfunc LoadModelWithContext(ctx context.Context, configDetails types.ConfigDetails, options ...func(*Options)) (map[string]any, error) {\n\topts := toOptions(&configDetails, options)\n\treturn loadModelWithContext(ctx, &configDetails, opts)\n}\n\n// LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary\nfunc loadModelWithContext(ctx context.Context, configDetails *types.ConfigDetails, opts *Options) (map[string]any, error) {\n\tif len(configDetails.ConfigFiles) < 1 {\n\t\treturn nil, errors.New(\"No files specified\")\n\t}\n\n\terr := projectName(configDetails, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn load(ctx, *configDetails, opts, nil)\n}\n\nfunc toOptions(configDetails *types.ConfigDetails, options []func(*Options)) *Options {\n\topts := &Options{\n\t\tInterpolate: &interp.Options{\n\t\t\tSubstitute:      template.Substitute,\n\t\t\tLookupValue:     configDetails.LookupEnv,\n\t\t\tTypeCastMapping: interpolateTypeCastMapping,\n\t\t},\n\t\tResolvePaths: true,\n\t}\n\n\tfor _, op := range options {\n\t\top(opts)\n\t}\n\topts.ResourceLoaders = append(opts.ResourceLoaders, localResourceLoader{configDetails.WorkingDir})\n\treturn opts\n}\n\nfunc loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Options, ct *cycleTracker, included []string) (map[string]interface{}, error) {\n\tvar (\n\t\tdict = map[string]interface{}{}\n\t\terr  error\n\t)\n\tworkingDir, environment := config.WorkingDir, config.Environment\n\n\tfor _, file := range config.ConfigFiles {\n\t\tdict, _, err = loadYamlFile(ctx, file, opts, workingDir, environment, ct, dict, included)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif !opts.SkipDefaultValues {\n\t\tdict, err = transform.SetDefaultValues(dict)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif !opts.SkipValidation {\n\t\tif err := validation.Validate(dict); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif opts.ResolvePaths {\n\t\tvar remotes []paths.RemoteResource\n\t\tfor _, loader := range opts.RemoteResourceLoaders() {\n\t\t\tremotes = append(remotes, loader.Accept)\n\t\t}\n\t\terr = paths.ResolveRelativePaths(dict, config.WorkingDir, remotes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tResolveEnvironment(dict, config.Environment)\n\n\treturn dict, nil\n}\n\nfunc loadYamlFile(ctx context.Context, file types.ConfigFile, opts *Options, workingDir string, environment types.Mapping, ct *cycleTracker, dict map[string]interface{}, included []string) (map[string]interface{}, PostProcessor, error) {\n\tctx = context.WithValue(ctx, consts.ComposeFileKey{}, file.Filename)\n\tif file.Content == nil && file.Config == nil {\n\t\tcontent, err := os.ReadFile(file.Filename)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfile.Content = content\n\t}\n\n\tprocessRawYaml := func(raw interface{}, processors ...PostProcessor) error {\n\t\tconverted, err := convertToStringKeysRecursive(raw, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcfg, ok := converted.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn errors.New(\"Top-level object must be a mapping\")\n\t\t}\n\n\t\tif opts.Interpolate != nil && !opts.SkipInterpolation {\n\t\t\tcfg, err = interp.Interpolate(cfg, *opts.Interpolate)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tfixEmptyNotNull(cfg)\n\n\t\tif !opts.SkipExtends {\n\t\t\terr = ApplyExtends(ctx, cfg, opts, ct, processors...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tfor _, processor := range processors {\n\t\t\tif err := processor.Apply(dict); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif !opts.SkipInclude {\n\t\t\tincluded = append(included, file.Filename)\n\t\t\terr = ApplyInclude(ctx, workingDir, environment, cfg, opts, included)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tdict, err = override.Merge(dict, cfg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdict, err = override.EnforceUnicity(dict)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !opts.SkipValidation {\n\t\t\tif err := schema.Validate(dict); err != nil {\n\t\t\t\treturn fmt.Errorf(\"validating %s: %w\", file.Filename, err)\n\t\t\t}\n\t\t\tif _, ok := dict[\"version\"]; ok {\n\t\t\t\topts.warnObsoleteVersion(file.Filename)\n\t\t\t\tdelete(dict, \"version\")\n\t\t\t}\n\t\t}\n\n\t\tdict, err = transform.Canonical(dict, opts.SkipInterpolation)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Canonical transformation can reveal duplicates, typically as ports can be a range and conflict with an override\n\t\tdict, err = override.EnforceUnicity(dict)\n\t\treturn err\n\t}\n\n\tvar processor PostProcessor\n\tif file.Config == nil {\n\t\tr := bytes.NewReader(file.Content)\n\t\tdecoder := yaml.NewDecoder(r)\n\t\tfor {\n\t\t\tvar raw interface{}\n\t\t\treset := &ResetProcessor{target: &raw}\n\t\t\terr := decoder.Decode(reset)\n\t\t\tif err != nil && errors.Is(err, io.EOF) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tprocessor = reset\n\t\t\tif err := processRawYaml(raw, processor); err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif err := processRawYaml(file.Config); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\treturn dict, processor, nil\n}\n\nfunc load(ctx context.Context, configDetails types.ConfigDetails, opts *Options, loaded []string) (map[string]interface{}, error) {\n\tmainFile := configDetails.ConfigFiles[0].Filename\n\tfor _, f := range loaded {\n\t\tif f == mainFile {\n\t\t\tloaded = append(loaded, mainFile)\n\t\t\treturn nil, fmt.Errorf(\"include cycle detected:\\n%s\\n include %s\", loaded[0], strings.Join(loaded[1:], \"\\n include \"))\n\t\t}\n\t}\n\tloaded = append(loaded, mainFile)\n\n\tdict, err := loadYamlModel(ctx, configDetails, opts, &cycleTracker{}, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(dict) == 0 {\n\t\treturn nil, errors.New(\"empty compose file\")\n\t}\n\n\tif opts.projectName == \"\" {\n\t\treturn nil, errors.New(\"project name must not be empty\")\n\t}\n\n\tif !opts.SkipNormalization {\n\t\tdict[\"name\"] = opts.projectName\n\t\tdict, err = Normalize(dict, configDetails.Environment)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn dict, nil\n}\n\n// modelToProject binds a canonical yaml dict into compose-go structs\nfunc modelToProject(dict map[string]interface{}, opts *Options, configDetails types.ConfigDetails) (*types.Project, error) {\n\tproject := &types.Project{\n\t\tName:        opts.projectName,\n\t\tWorkingDir:  configDetails.WorkingDir,\n\t\tEnvironment: configDetails.Environment,\n\t}\n\tdelete(dict, \"name\") // project name set by yaml must be identified by caller as opts.projectName\n\n\tvar err error\n\tdict, err = processExtensions(dict, tree.NewPath(), opts.KnownExtensions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = Transform(dict, project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif opts.ConvertWindowsPaths {\n\t\tfor i, service := range project.Services {\n\t\t\tfor j, volume := range service.Volumes {\n\t\t\t\tservice.Volumes[j] = convertVolumePath(volume)\n\t\t\t}\n\t\t\tproject.Services[i] = service\n\t\t}\n\t}\n\n\tif project, err = project.WithProfiles(opts.Profiles); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !opts.SkipConsistencyCheck {\n\t\terr := checkConsistency(project)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif !opts.SkipResolveEnvironment {\n\t\tproject, err = project.WithServicesEnvironmentResolved(opts.discardEnvFiles)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn project, nil\n}\n\nfunc InvalidProjectNameErr(v string) error {\n\treturn fmt.Errorf(\n\t\t\"invalid project name %q: must consist only of lowercase alphanumeric characters, hyphens, and underscores as well as start with a letter or number\",\n\t\tv,\n\t)\n}\n\n// projectName determines the canonical name to use for the project considering\n// the loader Options as well as `name` fields in Compose YAML fields (which\n// also support interpolation).\nfunc projectName(details *types.ConfigDetails, opts *Options) error {\n\tdefer func() {\n\t\tif details.Environment == nil {\n\t\t\tdetails.Environment = map[string]string{}\n\t\t}\n\t\tdetails.Environment[consts.ComposeProjectName] = opts.projectName\n\t}()\n\n\tif opts.projectNameImperativelySet {\n\t\tif NormalizeProjectName(opts.projectName) != opts.projectName {\n\t\t\treturn InvalidProjectNameErr(opts.projectName)\n\t\t}\n\t\treturn nil\n\t}\n\n\ttype named struct {\n\t\tName string `yaml:\"name\"`\n\t}\n\n\t// if user did NOT provide a name explicitly, then see if one is defined\n\t// in any of the config files\n\tvar pjNameFromConfigFile string\n\tfor _, configFile := range details.ConfigFiles {\n\t\tcontent := configFile.Content\n\t\tif content == nil {\n\t\t\t// This can be hit when Filename is set but Content is not. One\n\t\t\t// example is when using ToConfigFiles().\n\t\t\td, err := os.ReadFile(configFile.Filename)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to read file %q: %w\", configFile.Filename, err)\n\t\t\t}\n\t\t\tcontent = d\n\t\t\tconfigFile.Content = d\n\t\t}\n\t\tvar n named\n\t\tr := bytes.NewReader(content)\n\t\tdecoder := yaml.NewDecoder(r)\n\t\tfor {\n\t\t\terr := decoder.Decode(&n)\n\t\t\tif err != nil && errors.Is(err, io.EOF) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\t// HACK: the way that loading is currently structured, this is\n\t\t\t\t// a duplicative parse just for the `name`. if it fails, we\n\t\t\t\t// give up but don't return the error, knowing that it'll get\n\t\t\t\t// caught downstream for us\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif n.Name != \"\" {\n\t\t\t\tpjNameFromConfigFile = n.Name\n\t\t\t}\n\t\t}\n\t}\n\tif !opts.SkipInterpolation {\n\t\tinterpolated, err := interp.Interpolate(\n\t\t\tmap[string]interface{}{\"name\": pjNameFromConfigFile},\n\t\t\t*opts.Interpolate,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpjNameFromConfigFile = interpolated[\"name\"].(string)\n\t}\n\tpjNameFromConfigFile = NormalizeProjectName(pjNameFromConfigFile)\n\tif pjNameFromConfigFile != \"\" {\n\t\topts.projectName = pjNameFromConfigFile\n\t}\n\treturn nil\n}\n\nfunc NormalizeProjectName(s string) string {\n\tr := regexp.MustCompile(\"[a-z0-9_-]\")\n\ts = strings.ToLower(s)\n\ts = strings.Join(r.FindAllString(s, -1), \"\")\n\treturn strings.TrimLeft(s, \"_-\")\n}\n\nvar userDefinedKeys = []tree.Path{\n\t\"services\",\n\t\"volumes\",\n\t\"networks\",\n\t\"secrets\",\n\t\"configs\",\n}\n\nfunc processExtensions(dict map[string]any, p tree.Path, extensions map[string]any) (map[string]interface{}, error) {\n\textras := map[string]any{}\n\tvar err error\n\tfor key, value := range dict {\n\t\tskip := false\n\t\tfor _, uk := range userDefinedKeys {\n\t\t\tif uk.Matches(p) {\n\t\t\t\tskip = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !skip && strings.HasPrefix(key, \"x-\") {\n\t\t\textras[key] = value\n\t\t\tdelete(dict, key)\n\t\t\tcontinue\n\t\t}\n\t\tswitch v := value.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tdict[key], err = processExtensions(v, p.Next(key), extensions)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tcase []interface{}:\n\t\t\tfor i, e := range v {\n\t\t\t\tif m, ok := e.(map[string]interface{}); ok {\n\t\t\t\t\tv[i], err = processExtensions(m, p.Next(strconv.Itoa(i)), extensions)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor name, val := range extras {\n\t\tif typ, ok := extensions[name]; ok {\n\t\t\ttarget := reflect.New(reflect.TypeOf(typ)).Elem().Interface()\n\t\t\terr = Transform(val, &target)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\textras[name] = target\n\t\t}\n\t}\n\tif len(extras) > 0 {\n\t\tdict[consts.Extensions] = extras\n\t}\n\treturn dict, nil\n}\n\n// Transform converts the source into the target struct with compose types transformer\n// and the specified transformers if any.\nfunc Transform(source interface{}, target interface{}) error {\n\tdata := mapstructure.Metadata{}\n\tconfig := &mapstructure.DecoderConfig{\n\t\tDecodeHook: mapstructure.ComposeDecodeHookFunc(\n\t\t\tnameServices,\n\t\t\tdecoderHook,\n\t\t\tcast,\n\t\t\tsecretConfigDecoderHook,\n\t\t),\n\t\tResult:   target,\n\t\tTagName:  \"yaml\",\n\t\tMetadata: &data,\n\t}\n\tdecoder, err := mapstructure.NewDecoder(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn decoder.Decode(source)\n}\n\n// nameServices create implicit `name` key for convenience accessing service\nfunc nameServices(from reflect.Value, to reflect.Value) (interface{}, error) {\n\tif to.Type() == reflect.TypeOf(types.Services{}) {\n\t\tnameK := reflect.ValueOf(\"name\")\n\t\titer := from.MapRange()\n\t\tfor iter.Next() {\n\t\t\tname := iter.Key()\n\t\t\telem := iter.Value()\n\t\t\telem.Elem().SetMapIndex(nameK, name)\n\t\t}\n\t}\n\treturn from.Interface(), nil\n}\n\nfunc secretConfigDecoderHook(from, to reflect.Type, data interface{}) (interface{}, error) {\n\t// Check if the input is a map and we're decoding into a SecretConfig\n\tif from.Kind() == reflect.Map && to == reflect.TypeOf(types.SecretConfig{}) {\n\t\tif v, ok := data.(map[string]interface{}); ok {\n\t\t\tif ext, ok := v[\"#extensions\"].(map[string]interface{}); ok {\n\t\t\t\tif val, ok := ext[types.SecretConfigXValue].(string); ok {\n\t\t\t\t\t// Return a map with the Content field populated\n\t\t\t\t\tv[\"Content\"] = val\n\t\t\t\t\tdelete(ext, types.SecretConfigXValue)\n\n\t\t\t\t\tif len(ext) == 0 {\n\t\t\t\t\t\tdelete(v, \"#extensions\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the original data so the rest is handled by default mapstructure logic\n\treturn data, nil\n}\n\n// keys need to be converted to strings for jsonschema\nfunc convertToStringKeysRecursive(value interface{}, keyPrefix string) (interface{}, error) {\n\tif mapping, ok := value.(map[string]interface{}); ok {\n\t\tfor key, entry := range mapping {\n\t\t\tvar newKeyPrefix string\n\t\t\tif keyPrefix == \"\" {\n\t\t\t\tnewKeyPrefix = key\n\t\t\t} else {\n\t\t\t\tnewKeyPrefix = fmt.Sprintf(\"%s.%s\", keyPrefix, key)\n\t\t\t}\n\t\t\tconvertedEntry, err := convertToStringKeysRecursive(entry, newKeyPrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmapping[key] = convertedEntry\n\t\t}\n\t\treturn mapping, nil\n\t}\n\tif mapping, ok := value.(map[interface{}]interface{}); ok {\n\t\tdict := make(map[string]interface{})\n\t\tfor key, entry := range mapping {\n\t\t\tstr, ok := key.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, formatInvalidKeyError(keyPrefix, key)\n\t\t\t}\n\t\t\tvar newKeyPrefix string\n\t\t\tif keyPrefix == \"\" {\n\t\t\t\tnewKeyPrefix = str\n\t\t\t} else {\n\t\t\t\tnewKeyPrefix = fmt.Sprintf(\"%s.%s\", keyPrefix, str)\n\t\t\t}\n\t\t\tconvertedEntry, err := convertToStringKeysRecursive(entry, newKeyPrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdict[str] = convertedEntry\n\t\t}\n\t\treturn dict, nil\n\t}\n\tif list, ok := value.([]interface{}); ok {\n\t\tvar convertedList []interface{}\n\t\tfor index, entry := range list {\n\t\t\tnewKeyPrefix := fmt.Sprintf(\"%s[%d]\", keyPrefix, index)\n\t\t\tconvertedEntry, err := convertToStringKeysRecursive(entry, newKeyPrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tconvertedList = append(convertedList, convertedEntry)\n\t\t}\n\t\treturn convertedList, nil\n\t}\n\treturn value, nil\n}\n\nfunc formatInvalidKeyError(keyPrefix string, key interface{}) error {\n\tvar location string\n\tif keyPrefix == \"\" {\n\t\tlocation = \"at top level\"\n\t} else {\n\t\tlocation = fmt.Sprintf(\"in %s\", keyPrefix)\n\t}\n\treturn fmt.Errorf(\"Non-string key %s: %#v\", location, key)\n}\n\n// Windows path, c:\\\\my\\\\path\\\\shiny, need to be changed to be compatible with\n// the Engine. Volume path are expected to be linux style /c/my/path/shiny/\nfunc convertVolumePath(volume types.ServiceVolumeConfig) types.ServiceVolumeConfig {\n\tvolumeName := strings.ToLower(filepath.VolumeName(volume.Source))\n\tif len(volumeName) != 2 {\n\t\treturn volume\n\t}\n\n\tconvertedSource := fmt.Sprintf(\"/%c%s\", volumeName[0], volume.Source[len(volumeName):])\n\tconvertedSource = strings.ReplaceAll(convertedSource, \"\\\\\", \"/\")\n\n\tvolume.Source = convertedSource\n\treturn volume\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/mapstructure.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"reflect\"\n\t\"strconv\"\n)\n\n// comparable to yaml.Unmarshaler, decoder allow a type to define it's own custom logic to convert value\n// see https://github.com/mitchellh/mapstructure/pull/294\ntype decoder interface {\n\tDecodeMapstructure(interface{}) error\n}\n\n// see https://github.com/mitchellh/mapstructure/issues/115#issuecomment-735287466\n// adapted to support types derived from built-in types, as DecodeMapstructure would not be able to mutate internal\n// value, so need to invoke DecodeMapstructure defined by pointer to type\nfunc decoderHook(from reflect.Value, to reflect.Value) (interface{}, error) {\n\t// If the destination implements the decoder interface\n\tu, ok := to.Interface().(decoder)\n\tif !ok {\n\t\t// for non-struct types we need to invoke func (*type) DecodeMapstructure()\n\t\tif to.CanAddr() {\n\t\t\tpto := to.Addr()\n\t\t\tu, ok = pto.Interface().(decoder)\n\t\t}\n\t\tif !ok {\n\t\t\treturn from.Interface(), nil\n\t\t}\n\t}\n\t// If it is nil and a pointer, create and assign the target value first\n\tif to.Type().Kind() == reflect.Ptr && to.IsNil() {\n\t\tto.Set(reflect.New(to.Type().Elem()))\n\t\tu = to.Interface().(decoder)\n\t}\n\t// Call the custom DecodeMapstructure method\n\tif err := u.DecodeMapstructure(from.Interface()); err != nil {\n\t\treturn to.Interface(), err\n\t}\n\treturn to.Interface(), nil\n}\n\nfunc cast(from reflect.Value, to reflect.Value) (interface{}, error) {\n\tswitch from.Type().Kind() {\n\tcase reflect.String:\n\t\tswitch to.Kind() {\n\t\tcase reflect.Bool:\n\t\t\treturn toBoolean(from.String())\n\t\tcase reflect.Int:\n\t\t\treturn toInt(from.String())\n\t\tcase reflect.Int64:\n\t\t\treturn toInt64(from.String())\n\t\tcase reflect.Float32:\n\t\t\treturn toFloat32(from.String())\n\t\tcase reflect.Float64:\n\t\t\treturn toFloat(from.String())\n\t\t}\n\tcase reflect.Int:\n\t\tif to.Kind() == reflect.String {\n\t\t\treturn strconv.FormatInt(from.Int(), 10), nil\n\t\t}\n\t}\n\treturn from.Interface(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/normalize.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// Normalize compose project by moving deprecated attributes to their canonical position and injecting implicit defaults\nfunc Normalize(dict map[string]any, env types.Mapping) (map[string]any, error) {\n\tnormalizeNetworks(dict)\n\n\tif d, ok := dict[\"services\"]; ok {\n\t\tservices := d.(map[string]any)\n\t\tfor name, s := range services {\n\t\t\tservice := s.(map[string]any)\n\n\t\t\tif service[\"pull_policy\"] == types.PullPolicyIfNotPresent {\n\t\t\t\tservice[\"pull_policy\"] = types.PullPolicyMissing\n\t\t\t}\n\n\t\t\tfn := func(s string) (string, bool) {\n\t\t\t\tv, ok := env[s]\n\t\t\t\treturn v, ok\n\t\t\t}\n\n\t\t\tif b, ok := service[\"build\"]; ok {\n\t\t\t\tbuild := b.(map[string]any)\n\t\t\t\tif build[\"context\"] == nil {\n\t\t\t\t\tbuild[\"context\"] = \".\"\n\t\t\t\t}\n\t\t\t\tif build[\"dockerfile\"] == nil && build[\"dockerfile_inline\"] == nil {\n\t\t\t\t\tbuild[\"dockerfile\"] = \"Dockerfile\"\n\t\t\t\t}\n\n\t\t\t\tif a, ok := build[\"args\"]; ok {\n\t\t\t\t\tbuild[\"args\"], _ = resolve(a, fn, false)\n\t\t\t\t}\n\n\t\t\t\tservice[\"build\"] = build\n\t\t\t}\n\n\t\t\tif e, ok := service[\"environment\"]; ok {\n\t\t\t\tservice[\"environment\"], _ = resolve(e, fn, true)\n\t\t\t}\n\n\t\t\tvar dependsOn map[string]any\n\t\t\tif d, ok := service[\"depends_on\"]; ok {\n\t\t\t\tdependsOn = d.(map[string]any)\n\t\t\t} else {\n\t\t\t\tdependsOn = map[string]any{}\n\t\t\t}\n\t\t\tif l, ok := service[\"links\"]; ok {\n\t\t\t\tlinks := l.([]any)\n\t\t\t\tfor _, e := range links {\n\t\t\t\t\tlink := e.(string)\n\t\t\t\t\tparts := strings.Split(link, \":\")\n\t\t\t\t\tif len(parts) == 2 {\n\t\t\t\t\t\tlink = parts[0]\n\t\t\t\t\t}\n\t\t\t\t\tif _, ok := dependsOn[link]; !ok {\n\t\t\t\t\t\tdependsOn[link] = map[string]any{\n\t\t\t\t\t\t\t\"condition\": types.ServiceConditionStarted,\n\t\t\t\t\t\t\t\"restart\":   true,\n\t\t\t\t\t\t\t\"required\":  true,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor _, namespace := range []string{\"network_mode\", \"ipc\", \"pid\", \"uts\", \"cgroup\"} {\n\t\t\t\tif n, ok := service[namespace]; ok {\n\t\t\t\t\tref := n.(string)\n\t\t\t\t\tif strings.HasPrefix(ref, types.ServicePrefix) {\n\t\t\t\t\t\tshared := ref[len(types.ServicePrefix):]\n\t\t\t\t\t\tif _, ok := dependsOn[shared]; !ok {\n\t\t\t\t\t\t\tdependsOn[shared] = map[string]any{\n\t\t\t\t\t\t\t\t\"condition\": types.ServiceConditionStarted,\n\t\t\t\t\t\t\t\t\"restart\":   true,\n\t\t\t\t\t\t\t\t\"required\":  true,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif n, ok := service[\"volumes_from\"]; ok {\n\t\t\t\tvolumesFrom := n.([]any)\n\t\t\t\tfor _, v := range volumesFrom {\n\t\t\t\t\tvol := v.(string)\n\t\t\t\t\tif !strings.HasPrefix(vol, types.ContainerPrefix) {\n\t\t\t\t\t\tspec := strings.Split(vol, \":\")\n\t\t\t\t\t\tif _, ok := dependsOn[spec[0]]; !ok {\n\t\t\t\t\t\t\tdependsOn[spec[0]] = map[string]any{\n\t\t\t\t\t\t\t\t\"condition\": types.ServiceConditionStarted,\n\t\t\t\t\t\t\t\t\"restart\":   false,\n\t\t\t\t\t\t\t\t\"required\":  true,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(dependsOn) > 0 {\n\t\t\t\tservice[\"depends_on\"] = dependsOn\n\t\t\t}\n\t\t\tservices[name] = service\n\t\t}\n\t\tdict[\"services\"] = services\n\t}\n\n\tsetNameFromKey(dict)\n\n\treturn dict, nil\n}\n\nfunc normalizeNetworks(dict map[string]any) {\n\tvar networks map[string]any\n\tif n, ok := dict[\"networks\"]; ok {\n\t\tnetworks = n.(map[string]any)\n\t} else {\n\t\tnetworks = map[string]any{}\n\t}\n\n\t// implicit `default` network must be introduced only if actually used by some service\n\tusesDefaultNetwork := false\n\n\tif s, ok := dict[\"services\"]; ok {\n\t\tservices := s.(map[string]any)\n\t\tfor name, se := range services {\n\t\t\tservice := se.(map[string]any)\n\t\t\tif _, ok := service[\"network_mode\"]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif n, ok := service[\"networks\"]; !ok {\n\t\t\t\t// If none explicitly declared, service is connected to default network\n\t\t\t\tservice[\"networks\"] = map[string]any{\"default\": nil}\n\t\t\t\tusesDefaultNetwork = true\n\t\t\t} else {\n\t\t\t\tnet := n.(map[string]any)\n\t\t\t\tif len(net) == 0 {\n\t\t\t\t\t// networks section declared but empty (corner case)\n\t\t\t\t\tservice[\"networks\"] = map[string]any{\"default\": nil}\n\t\t\t\t\tusesDefaultNetwork = true\n\t\t\t\t} else if _, ok := net[\"default\"]; ok {\n\t\t\t\t\tusesDefaultNetwork = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tservices[name] = service\n\t\t}\n\t\tdict[\"services\"] = services\n\t}\n\n\tif _, ok := networks[\"default\"]; !ok && usesDefaultNetwork {\n\t\t// If not declared explicitly, Compose model involves an implicit \"default\" network\n\t\tnetworks[\"default\"] = nil\n\t}\n\n\tif len(networks) > 0 {\n\t\tdict[\"networks\"] = networks\n\t}\n}\n\nfunc resolve(a any, fn func(s string) (string, bool), keepEmpty bool) (any, bool) {\n\tswitch v := a.(type) {\n\tcase []any:\n\t\tvar resolved []any\n\t\tfor _, val := range v {\n\t\t\tif r, ok := resolve(val, fn, keepEmpty); ok {\n\t\t\t\tresolved = append(resolved, r)\n\t\t\t}\n\t\t}\n\t\treturn resolved, true\n\tcase map[string]any:\n\t\tresolved := map[string]any{}\n\t\tfor key, val := range v {\n\t\t\tif val != nil {\n\t\t\t\tresolved[key] = val\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s, ok := fn(key); ok {\n\t\t\t\tresolved[key] = s\n\t\t\t} else if keepEmpty {\n\t\t\t\tresolved[key] = nil\n\t\t\t}\n\t\t}\n\t\treturn resolved, true\n\tcase string:\n\t\tif !strings.Contains(v, \"=\") {\n\t\t\tif val, ok := fn(v); ok {\n\t\t\t\treturn fmt.Sprintf(\"%s=%s\", v, val), true\n\t\t\t}\n\t\t\tif keepEmpty {\n\t\t\t\treturn v, true\n\t\t\t}\n\t\t\treturn \"\", false\n\t\t}\n\t\treturn v, true\n\tdefault:\n\t\treturn v, false\n\t}\n}\n\n// Resources with no explicit name are actually named by their key in map\nfunc setNameFromKey(dict map[string]any) {\n\tfor _, r := range []string{\"networks\", \"volumes\", \"configs\", \"secrets\"} {\n\t\ta, ok := dict[r]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\ttoplevel := a.(map[string]any)\n\t\tfor key, r := range toplevel {\n\t\t\tvar resource map[string]any\n\t\t\tif r != nil {\n\t\t\t\tresource = r.(map[string]any)\n\t\t\t} else {\n\t\t\t\tresource = map[string]any{}\n\t\t\t}\n\t\t\tif resource[\"name\"] == nil {\n\t\t\t\tif x, ok := resource[\"external\"]; ok && isTrue(x) {\n\t\t\t\t\tresource[\"name\"] = key\n\t\t\t\t} else {\n\t\t\t\t\tresource[\"name\"] = fmt.Sprintf(\"%s_%s\", dict[\"name\"], key)\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoplevel[key] = resource\n\t\t}\n\t}\n}\n\nfunc isTrue(x any) bool {\n\tparseBool, _ := strconv.ParseBool(fmt.Sprint(x))\n\treturn parseBool\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/paths.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// ResolveRelativePaths resolves relative paths based on project WorkingDirectory\nfunc ResolveRelativePaths(project *types.Project) error {\n\tabsWorkingDir, err := filepath.Abs(project.WorkingDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tproject.WorkingDir = absWorkingDir\n\n\tabsComposeFiles, err := absComposeFiles(project.ComposeFiles)\n\tif err != nil {\n\t\treturn err\n\t}\n\tproject.ComposeFiles = absComposeFiles\n\treturn nil\n}\n\nfunc absPath(workingDir string, filePath string) string {\n\tif strings.HasPrefix(filePath, \"~\") {\n\t\thome, _ := os.UserHomeDir()\n\t\treturn filepath.Join(home, filePath[1:])\n\t}\n\tif filepath.IsAbs(filePath) {\n\t\treturn filePath\n\t}\n\treturn filepath.Join(workingDir, filePath)\n}\n\nfunc absComposeFiles(composeFiles []string) ([]string, error) {\n\tfor i, composeFile := range composeFiles {\n\t\tabsComposefile, err := filepath.Abs(composeFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcomposeFiles[i] = absComposefile\n\t}\n\treturn composeFiles, nil\n}\n\nfunc resolvePaths(basePath string, in types.StringList) types.StringList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tret := make(types.StringList, len(in))\n\tfor i := range in {\n\t\tret[i] = absPath(basePath, in[i])\n\t}\n\treturn ret\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/reset.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"gopkg.in/yaml.v3\"\n)\n\ntype ResetProcessor struct {\n\ttarget interface{}\n\tpaths  []tree.Path\n}\n\n// UnmarshalYAML implement yaml.Unmarshaler\nfunc (p *ResetProcessor) UnmarshalYAML(value *yaml.Node) error {\n\tresolved, err := p.resolveReset(value, tree.NewPath())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn resolved.Decode(p.target)\n}\n\n// resolveReset detects `!reset` tag being set on yaml nodes and record position in the yaml tree\nfunc (p *ResetProcessor) resolveReset(node *yaml.Node, path tree.Path) (*yaml.Node, error) {\n\t// If the path contains \"<<\", removing the \"<<\" element and merging the path\n\tif strings.Contains(path.String(), \".<<\") {\n\t\tpath = tree.NewPath(strings.Replace(path.String(), \".<<\", \"\", 1))\n\t}\n\t// If the node is an alias, We need to process the alias field in order to consider the !override and !reset tags\n\tif node.Kind == yaml.AliasNode {\n\t\treturn p.resolveReset(node.Alias, path)\n\t}\n\n\tif node.Tag == \"!reset\" {\n\t\tp.paths = append(p.paths, path)\n\t\treturn nil, nil\n\t}\n\tif node.Tag == \"!override\" {\n\t\tp.paths = append(p.paths, path)\n\t\treturn node, nil\n\t}\n\tswitch node.Kind {\n\tcase yaml.SequenceNode:\n\t\tvar nodes []*yaml.Node\n\t\tfor idx, v := range node.Content {\n\t\t\tnext := path.Next(strconv.Itoa(idx))\n\t\t\tresolved, err := p.resolveReset(v, next)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif resolved != nil {\n\t\t\t\tnodes = append(nodes, resolved)\n\t\t\t}\n\t\t}\n\t\tnode.Content = nodes\n\tcase yaml.MappingNode:\n\t\tvar key string\n\t\tvar nodes []*yaml.Node\n\t\tfor idx, v := range node.Content {\n\t\t\tif idx%2 == 0 {\n\t\t\t\tkey = v.Value\n\t\t\t} else {\n\t\t\t\tresolved, err := p.resolveReset(v, path.Next(key))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif resolved != nil {\n\t\t\t\t\tnodes = append(nodes, node.Content[idx-1], resolved)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnode.Content = nodes\n\t}\n\treturn node, nil\n}\n\n// Apply finds the go attributes matching recorded paths and reset them to zero value\nfunc (p *ResetProcessor) Apply(target any) error {\n\treturn p.applyNullOverrides(target, tree.NewPath())\n}\n\n// applyNullOverrides set val to Zero if it matches any of the recorded paths\nfunc (p *ResetProcessor) applyNullOverrides(target any, path tree.Path) error {\n\tswitch v := target.(type) {\n\tcase map[string]any:\n\tKEYS:\n\t\tfor k, e := range v {\n\t\t\tnext := path.Next(k)\n\t\t\tfor _, pattern := range p.paths {\n\t\t\t\tif next.Matches(pattern) {\n\t\t\t\t\tdelete(v, k)\n\t\t\t\t\tcontinue KEYS\n\t\t\t\t}\n\t\t\t}\n\t\t\terr := p.applyNullOverrides(e, next)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase []any:\n\tITER:\n\t\tfor i, e := range v {\n\t\t\tnext := path.Next(fmt.Sprintf(\"[%d]\", i))\n\t\t\tfor _, pattern := range p.paths {\n\t\t\t\tif next.Matches(pattern) {\n\t\t\t\t\tcontinue ITER\n\t\t\t\t\t// TODO(ndeloof) support removal from sequence\n\t\t\t\t}\n\t\t\t}\n\t\t\terr := p.applyNullOverrides(e, next)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/loader/validate.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage loader\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/errdefs\"\n\t\"github.com/compose-spec/compose-go/v2/graph\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\n// checkConsistency validate a compose model is consistent\nfunc checkConsistency(project *types.Project) error {\n\tfor _, s := range project.Services {\n\t\tif s.Build == nil && s.Image == \"\" {\n\t\t\treturn fmt.Errorf(\"service %q has neither an image nor a build context specified: %w\", s.Name, errdefs.ErrInvalid)\n\t\t}\n\n\t\tif s.Build != nil {\n\t\t\tif s.Build.DockerfileInline != \"\" && s.Build.Dockerfile != \"\" {\n\t\t\t\treturn fmt.Errorf(\"service %q declares mutualy exclusive dockerfile and dockerfile_inline: %w\", s.Name, errdefs.ErrInvalid)\n\t\t\t}\n\n\t\t\tif len(s.Build.Platforms) > 0 && s.Platform != \"\" {\n\t\t\t\tvar found bool\n\t\t\t\tfor _, platform := range s.Build.Platforms {\n\t\t\t\t\tif platform == s.Platform {\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\treturn fmt.Errorf(\"service.build.platforms MUST include service.platform %q: %w\", s.Platform, errdefs.ErrInvalid)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif s.NetworkMode != \"\" && len(s.Networks) > 0 {\n\t\t\treturn fmt.Errorf(\"service %s declares mutually exclusive `network_mode` and `networks`: %w\", s.Name, errdefs.ErrInvalid)\n\t\t}\n\t\tfor network := range s.Networks {\n\t\t\tif _, ok := project.Networks[network]; !ok {\n\t\t\t\treturn fmt.Errorf(\"service %q refers to undefined network %s: %w\", s.Name, network, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\n\t\tif s.HealthCheck != nil && len(s.HealthCheck.Test) > 0 {\n\t\t\tswitch s.HealthCheck.Test[0] {\n\t\t\tcase \"CMD\", \"CMD-SHELL\", \"NONE\":\n\t\t\tdefault:\n\t\t\t\treturn errors.New(`healthcheck.test must start either by \"CMD\", \"CMD-SHELL\" or \"NONE\"`)\n\t\t\t}\n\t\t}\n\n\t\tfor dependedService, cfg := range s.DependsOn {\n\t\t\tif _, err := project.GetService(dependedService); err != nil {\n\t\t\t\tif errors.Is(err, errdefs.ErrDisabled) && !cfg.Required {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"service %q depends on undefined service %q: %w\", s.Name, dependedService, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(s.NetworkMode, types.ServicePrefix) {\n\t\t\tserviceName := s.NetworkMode[len(types.ServicePrefix):]\n\t\t\tif _, err := project.GetServices(serviceName); err != nil {\n\t\t\t\treturn fmt.Errorf(\"service %q not found for network_mode 'service:%s'\", serviceName, serviceName)\n\t\t\t}\n\t\t}\n\n\t\tfor _, volume := range s.Volumes {\n\t\t\tif volume.Type == types.VolumeTypeVolume && volume.Source != \"\" { // non anonymous volumes\n\t\t\t\tif _, ok := project.Volumes[volume.Source]; !ok {\n\t\t\t\t\treturn fmt.Errorf(\"service %q refers to undefined volume %s: %w\", s.Name, volume.Source, errdefs.ErrInvalid)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif s.Build != nil {\n\t\t\tfor _, secret := range s.Build.Secrets {\n\t\t\t\tif _, ok := project.Secrets[secret.Source]; !ok {\n\t\t\t\t\treturn fmt.Errorf(\"service %q refers to undefined build secret %s: %w\", s.Name, secret.Source, errdefs.ErrInvalid)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, config := range s.Configs {\n\t\t\tif _, ok := project.Configs[config.Source]; !ok {\n\t\t\t\treturn fmt.Errorf(\"service %q refers to undefined config %s: %w\", s.Name, config.Source, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\n\t\tfor _, secret := range s.Secrets {\n\t\t\tif _, ok := project.Secrets[secret.Source]; !ok {\n\t\t\t\treturn fmt.Errorf(\"service %q refers to undefined secret %s: %w\", s.Name, secret.Source, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\n\t\tif s.Scale != nil && s.Deploy != nil {\n\t\t\tif s.Deploy.Replicas != nil && *s.Scale != *s.Deploy.Replicas {\n\t\t\t\treturn fmt.Errorf(\"services.%s: can't set distinct values on 'scale' and 'deploy.replicas': %w\",\n\t\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t\t}\n\t\t\ts.Deploy.Replicas = s.Scale\n\t\t}\n\n\t\tif s.CPUS != 0 && s.Deploy != nil {\n\t\t\tif s.Deploy.Resources.Limits != nil && s.Deploy.Resources.Limits.NanoCPUs.Value() != s.CPUS {\n\t\t\t\treturn fmt.Errorf(\"services.%s: can't set distinct values on 'cpus' and 'deploy.resources.limits.cpus': %w\",\n\t\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\t\tif s.MemLimit != 0 && s.Deploy != nil {\n\t\t\tif s.Deploy.Resources.Limits != nil && s.Deploy.Resources.Limits.MemoryBytes != s.MemLimit {\n\t\t\t\treturn fmt.Errorf(\"services.%s: can't set distinct values on 'mem_limit' and 'deploy.resources.limits.memory': %w\",\n\t\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\t\tif s.MemReservation != 0 && s.Deploy != nil {\n\t\t\tif s.Deploy.Resources.Reservations != nil && s.Deploy.Resources.Reservations.MemoryBytes != s.MemReservation {\n\t\t\t\treturn fmt.Errorf(\"services.%s: can't set distinct values on 'mem_reservation' and 'deploy.resources.reservations.memory': %w\",\n\t\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\t\tif s.PidsLimit != 0 && s.Deploy != nil {\n\t\t\tif s.Deploy.Resources.Limits != nil && s.Deploy.Resources.Limits.Pids != s.PidsLimit {\n\t\t\t\treturn fmt.Errorf(\"services.%s: can't set distinct values on 'pids_limit' and 'deploy.resources.limits.pids': %w\",\n\t\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t\t}\n\t\t}\n\n\t\tif s.GetScale() > 1 && s.ContainerName != \"\" {\n\t\t\tattr := \"scale\"\n\t\t\tif s.Scale == nil {\n\t\t\t\tattr = \"deploy.replicas\"\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"services.%s: can't set container_name and %s as container name must be unique: %w\", attr,\n\t\t\t\ts.Name, errdefs.ErrInvalid)\n\t\t}\n\n\t\tif s.Develop != nil && s.Develop.Watch != nil {\n\t\t\tfor _, watch := range s.Develop.Watch {\n\t\t\t\tif watch.Action != types.WatchActionRebuild && watch.Target == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"services.%s.develop.watch: target is required for non-rebuild actions: %w\", s.Name, errdefs.ErrInvalid)\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfor name, secret := range project.Secrets {\n\t\tif secret.External {\n\t\t\tcontinue\n\t\t}\n\t\tif secret.File == \"\" && secret.Environment == \"\" {\n\t\t\treturn fmt.Errorf(\"secret %q must declare either `file` or `environment`: %w\", name, errdefs.ErrInvalid)\n\t\t}\n\t}\n\n\treturn graph.CheckCycle(project)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/override/extends.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage override\n\nimport \"github.com/compose-spec/compose-go/v2/tree\"\n\nfunc ExtendService(base, override map[string]any) (map[string]any, error) {\n\tyaml, err := mergeYaml(base, override, tree.NewPath(\"services.x\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn yaml.(map[string]any), nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/override/merge.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage override\n\nimport (\n\t\"cmp\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"golang.org/x/exp/slices\"\n)\n\n// Merge applies overrides to a config model\nfunc Merge(right, left map[string]any) (map[string]any, error) {\n\tmerged, err := mergeYaml(right, left, tree.NewPath())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn merged.(map[string]any), nil\n}\n\ntype merger func(any, any, tree.Path) (any, error)\n\n// mergeSpecials defines the custom rules applied by compose when merging yaml trees\nvar mergeSpecials = map[tree.Path]merger{}\n\nfunc init() {\n\tmergeSpecials[\"networks.*.ipam.config\"] = mergeIPAMConfig\n\tmergeSpecials[\"networks.*.labels\"] = mergeToSequence\n\tmergeSpecials[\"volumes.*.labels\"] = mergeToSequence\n\tmergeSpecials[\"services.*.annotations\"] = mergeToSequence\n\tmergeSpecials[\"services.*.build\"] = mergeBuild\n\tmergeSpecials[\"services.*.build.args\"] = mergeToSequence\n\tmergeSpecials[\"services.*.build.additional_contexts\"] = mergeToSequence\n\tmergeSpecials[\"services.*.build.extra_hosts\"] = mergeToSequence\n\tmergeSpecials[\"services.*.build.labels\"] = mergeToSequence\n\tmergeSpecials[\"services.*.command\"] = override\n\tmergeSpecials[\"services.*.depends_on\"] = mergeDependsOn\n\tmergeSpecials[\"services.*.deploy.labels\"] = mergeToSequence\n\tmergeSpecials[\"services.*.dns\"] = mergeToSequence\n\tmergeSpecials[\"services.*.dns_opt\"] = mergeToSequence\n\tmergeSpecials[\"services.*.dns_search\"] = mergeToSequence\n\tmergeSpecials[\"services.*.entrypoint\"] = override\n\tmergeSpecials[\"services.*.env_file\"] = mergeToSequence\n\tmergeSpecials[\"services.*.environment\"] = mergeToSequence\n\tmergeSpecials[\"services.*.extra_hosts\"] = mergeToSequence\n\tmergeSpecials[\"services.*.healthcheck.test\"] = override\n\tmergeSpecials[\"services.*.labels\"] = mergeToSequence\n\tmergeSpecials[\"services.*.logging\"] = mergeLogging\n\tmergeSpecials[\"services.*.networks\"] = mergeNetworks\n\tmergeSpecials[\"services.*.sysctls\"] = mergeToSequence\n\tmergeSpecials[\"services.*.tmpfs\"] = mergeToSequence\n\tmergeSpecials[\"services.*.ulimits.*\"] = mergeUlimit\n}\n\n// mergeYaml merges map[string]any yaml trees handling special rules\nfunc mergeYaml(e any, o any, p tree.Path) (any, error) {\n\tfor pattern, merger := range mergeSpecials {\n\t\tif p.Matches(pattern) {\n\t\t\tmerged, err := merger(e, o, p)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn merged, nil\n\t\t}\n\t}\n\tif o == nil {\n\t\treturn e, nil\n\t}\n\tswitch value := e.(type) {\n\tcase map[string]any:\n\t\tother, ok := o.(map[string]any)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cannot override %s\", p)\n\t\t}\n\t\treturn mergeMappings(value, other, p)\n\tcase []any:\n\t\tother, ok := o.([]any)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cannot override %s\", p)\n\t\t}\n\t\treturn append(value, other...), nil\n\tdefault:\n\t\treturn o, nil\n\t}\n}\n\nfunc mergeMappings(mapping map[string]any, other map[string]any, p tree.Path) (map[string]any, error) {\n\tfor k, v := range other {\n\t\te, ok := mapping[k]\n\t\tif !ok || strings.HasPrefix(k, \"x-\") {\n\t\t\tmapping[k] = v\n\t\t\tcontinue\n\t\t}\n\t\tnext := p.Next(k)\n\t\tmerged, err := mergeYaml(e, v, next)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmapping[k] = merged\n\t}\n\treturn mapping, nil\n}\n\n// logging driver options are merged only when both compose file define the same driver\nfunc mergeLogging(c any, o any, p tree.Path) (any, error) {\n\tconfig := c.(map[string]any)\n\tother := o.(map[string]any)\n\t// we override logging config if source and override have the same driver set, or none\n\td, ok1 := other[\"driver\"]\n\to, ok2 := config[\"driver\"]\n\tif d == o || !ok1 || !ok2 {\n\t\treturn mergeMappings(config, other, p)\n\t}\n\treturn other, nil\n}\n\nfunc mergeBuild(c any, o any, path tree.Path) (any, error) {\n\ttoBuild := func(c any) map[string]any {\n\t\tswitch v := c.(type) {\n\t\tcase string:\n\t\t\treturn map[string]any{\n\t\t\t\t\"context\": v,\n\t\t\t}\n\t\tcase map[string]any:\n\t\t\treturn v\n\t\t}\n\t\treturn nil\n\t}\n\treturn mergeMappings(toBuild(c), toBuild(o), path)\n}\n\nfunc mergeDependsOn(c any, o any, path tree.Path) (any, error) {\n\tright := convertIntoMapping(c, map[string]any{\n\t\t\"condition\": \"service_started\",\n\t\t\"required\":  true,\n\t})\n\tleft := convertIntoMapping(o, map[string]any{\n\t\t\"condition\": \"service_started\",\n\t\t\"required\":  true,\n\t})\n\treturn mergeMappings(right, left, path)\n}\n\nfunc mergeNetworks(c any, o any, path tree.Path) (any, error) {\n\tright := convertIntoMapping(c, nil)\n\tleft := convertIntoMapping(o, nil)\n\treturn mergeMappings(right, left, path)\n}\n\nfunc mergeToSequence(c any, o any, _ tree.Path) (any, error) {\n\tright := convertIntoSequence(c)\n\tleft := convertIntoSequence(o)\n\treturn append(right, left...), nil\n}\n\nfunc convertIntoSequence(value any) []any {\n\tswitch v := value.(type) {\n\tcase map[string]any:\n\t\tseq := make([]any, len(v))\n\t\ti := 0\n\t\tfor k, v := range v {\n\t\t\tif v == nil {\n\t\t\t\tseq[i] = k\n\t\t\t} else {\n\t\t\t\tseq[i] = fmt.Sprintf(\"%s=%v\", k, v)\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t\tslices.SortFunc(seq, func(a, b any) int {\n\t\t\treturn cmp.Compare(a.(string), b.(string))\n\t\t})\n\t\treturn seq\n\tcase []any:\n\t\treturn v\n\tcase string:\n\t\treturn []any{v}\n\t}\n\treturn nil\n}\n\nfunc mergeUlimit(_ any, o any, p tree.Path) (any, error) {\n\tover, ismapping := o.(map[string]any)\n\tif base, ok := o.(map[string]any); ok && ismapping {\n\t\treturn mergeMappings(base, over, p)\n\t}\n\treturn o, nil\n}\n\nfunc mergeIPAMConfig(c any, o any, path tree.Path) (any, error) {\n\tvar ipamConfigs []any\n\tfor _, original := range c.([]any) {\n\t\tright := convertIntoMapping(original, nil)\n\t\tfor _, override := range o.([]any) {\n\t\t\tleft := convertIntoMapping(override, nil)\n\t\t\tif left[\"subnet\"] != right[\"subnet\"] {\n\t\t\t\t// check if left is already in ipamConfigs, add it if not and continue with the next config\n\t\t\t\tif !slices.ContainsFunc(ipamConfigs, func(a any) bool {\n\t\t\t\t\treturn a.(map[string]any)[\"subnet\"] == left[\"subnet\"]\n\t\t\t\t}) {\n\t\t\t\t\tipamConfigs = append(ipamConfigs, left)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tmerged, err := mergeMappings(right, left, path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// find index of potential previous config with the same subnet in ipamConfigs\n\t\t\tindexIfExist := slices.IndexFunc(ipamConfigs, func(a any) bool {\n\t\t\t\treturn a.(map[string]any)[\"subnet\"] == merged[\"subnet\"]\n\t\t\t})\n\t\t\t// if a previous config is already in ipamConfigs, replace it\n\t\t\tif indexIfExist >= 0 {\n\t\t\t\tipamConfigs[indexIfExist] = merged\n\t\t\t} else {\n\t\t\t\t// or add the new config to ipamConfigs\n\t\t\t\tipamConfigs = append(ipamConfigs, merged)\n\t\t\t}\n\t\t}\n\t}\n\treturn ipamConfigs, nil\n}\n\nfunc convertIntoMapping(a any, defaultValue map[string]any) map[string]any {\n\tswitch v := a.(type) {\n\tcase map[string]any:\n\t\treturn v\n\tcase []any:\n\t\tconverted := map[string]any{}\n\t\tfor _, s := range v {\n\t\t\tif defaultValue == nil {\n\t\t\t\tconverted[s.(string)] = nil\n\t\t\t} else {\n\t\t\t\t// Create a new map for each key\n\t\t\t\tconverted[s.(string)] = copyMap(defaultValue)\n\t\t\t}\n\t\t}\n\t\treturn converted\n\t}\n\treturn nil\n}\n\nfunc copyMap(m map[string]any) map[string]any {\n\tc := make(map[string]any)\n\tfor k, v := range m {\n\t\tc[k] = v\n\t}\n\treturn c\n}\n\nfunc override(_ any, other any, _ tree.Path) (any, error) {\n\treturn other, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/override/uncity.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage override\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/format\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\ntype indexer func(any, tree.Path) (string, error)\n\n// mergeSpecials defines the custom rules applied by compose when merging yaml trees\nvar unique = map[tree.Path]indexer{}\n\nfunc init() {\n\tunique[\"networks.*.labels\"] = keyValueIndexer\n\tunique[\"networks.*.ipam.options\"] = keyValueIndexer\n\tunique[\"services.*.annotations\"] = keyValueIndexer\n\tunique[\"services.*.build.args\"] = keyValueIndexer\n\tunique[\"services.*.build.additional_contexts\"] = keyValueIndexer\n\tunique[\"services.*.build.platform\"] = keyValueIndexer\n\tunique[\"services.*.build.tags\"] = keyValueIndexer\n\tunique[\"services.*.build.labels\"] = keyValueIndexer\n\tunique[\"services.*.cap_add\"] = keyValueIndexer\n\tunique[\"services.*.cap_drop\"] = keyValueIndexer\n\tunique[\"services.*.devices\"] = volumeIndexer\n\tunique[\"services.*.configs\"] = mountIndexer(\"\")\n\tunique[\"services.*.deploy.labels\"] = keyValueIndexer\n\tunique[\"services.*.dns\"] = keyValueIndexer\n\tunique[\"services.*.dns_opt\"] = keyValueIndexer\n\tunique[\"services.*.dns_search\"] = keyValueIndexer\n\tunique[\"services.*.environment\"] = keyValueIndexer\n\tunique[\"services.*.env_file\"] = envFileIndexer\n\tunique[\"services.*.expose\"] = exposeIndexer\n\tunique[\"services.*.labels\"] = keyValueIndexer\n\tunique[\"services.*.links\"] = keyValueIndexer\n\tunique[\"services.*.networks.*.aliases\"] = keyValueIndexer\n\tunique[\"services.*.networks.*.link_local_ips\"] = keyValueIndexer\n\tunique[\"services.*.ports\"] = portIndexer\n\tunique[\"services.*.profiles\"] = keyValueIndexer\n\tunique[\"services.*.secrets\"] = mountIndexer(\"/run/secrets\")\n\tunique[\"services.*.sysctls\"] = keyValueIndexer\n\tunique[\"services.*.tmpfs\"] = keyValueIndexer\n\tunique[\"services.*.volumes\"] = volumeIndexer\n\tunique[\"services.*.devices\"] = deviceMappingIndexer\n}\n\n// EnforceUnicity removes redefinition of elements declared in a sequence\nfunc EnforceUnicity(value map[string]any) (map[string]any, error) {\n\tuniq, err := enforceUnicity(value, tree.NewPath())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn uniq.(map[string]any), nil\n}\n\nfunc enforceUnicity(value any, p tree.Path) (any, error) {\n\tswitch v := value.(type) {\n\tcase map[string]any:\n\t\tfor k, e := range v {\n\t\t\tu, err := enforceUnicity(e, p.Next(k))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tv[k] = u\n\t\t}\n\t\treturn v, nil\n\tcase []any:\n\t\tfor pattern, indexer := range unique {\n\t\t\tif p.Matches(pattern) {\n\t\t\t\tseq := []any{}\n\t\t\t\tkeys := map[string]int{}\n\t\t\t\tfor i, entry := range v {\n\t\t\t\t\tkey, err := indexer(entry, p.Next(fmt.Sprintf(\"[%d]\", i)))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tif j, ok := keys[key]; ok {\n\t\t\t\t\t\tseq[j] = entry\n\t\t\t\t\t} else {\n\t\t\t\t\t\tseq = append(seq, entry)\n\t\t\t\t\t\tkeys[key] = len(seq) - 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn seq, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn value, nil\n}\n\nfunc keyValueIndexer(v any, p tree.Path) (string, error) {\n\tswitch value := v.(type) {\n\tcase string:\n\t\tkey, _, found := strings.Cut(value, \"=\")\n\t\tif found {\n\t\t\treturn key, nil\n\t\t}\n\t\treturn value, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"%s: unexpected type %T\", p, v)\n\t}\n}\n\nfunc volumeIndexer(y any, p tree.Path) (string, error) {\n\tswitch value := y.(type) {\n\tcase map[string]any:\n\t\ttarget, ok := value[\"target\"].(string)\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"service volume %s is missing a mount target\", p)\n\t\t}\n\t\treturn target, nil\n\tcase string:\n\t\tvolume, err := format.ParseVolume(value)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn volume.Target, nil\n\t}\n\treturn \"\", nil\n}\n\nfunc deviceMappingIndexer(y any, p tree.Path) (string, error) {\n\tswitch value := y.(type) {\n\tcase map[string]any:\n\t\ttarget, ok := value[\"target\"].(string)\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"service device %s is missing a mount target\", p)\n\t\t}\n\t\treturn target, nil\n\tcase string:\n\t\tarr := strings.Split(value, \":\")\n\t\tif len(arr) == 1 {\n\t\t\treturn arr[0], nil\n\t\t}\n\t\treturn arr[1], nil\n\t}\n\treturn \"\", nil\n}\n\nfunc exposeIndexer(a any, path tree.Path) (string, error) {\n\tswitch v := a.(type) {\n\tcase string:\n\t\treturn v, nil\n\tcase int:\n\t\treturn strconv.Itoa(v), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"%s: unsupported expose value %s\", path, a)\n\t}\n}\n\nfunc mountIndexer(defaultPath string) indexer {\n\treturn func(a any, path tree.Path) (string, error) {\n\t\tswitch v := a.(type) {\n\t\tcase string:\n\t\t\treturn fmt.Sprintf(\"%s/%s\", defaultPath, v), nil\n\t\tcase map[string]any:\n\t\t\tt, ok := v[\"target\"]\n\t\t\tif ok {\n\t\t\t\treturn t.(string), nil\n\t\t\t}\n\t\t\treturn fmt.Sprintf(\"%s/%s\", defaultPath, v[\"source\"]), nil\n\t\tdefault:\n\t\t\treturn \"\", fmt.Errorf(\"%s: unsupported expose value %s\", path, a)\n\t\t}\n\t}\n}\n\nfunc portIndexer(y any, p tree.Path) (string, error) {\n\tswitch value := y.(type) {\n\tcase int:\n\t\treturn strconv.Itoa(value), nil\n\tcase map[string]any:\n\t\ttarget, ok := value[\"target\"]\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"service ports %s is missing a target port\", p)\n\t\t}\n\t\tpublished, ok := value[\"published\"]\n\t\tif !ok {\n\t\t\t// try to parse it as an int\n\t\t\tif pub, ok := value[\"published\"]; ok {\n\t\t\t\tpublished = fmt.Sprintf(\"%d\", pub)\n\t\t\t}\n\t\t}\n\t\thost, ok := value[\"host_ip\"]\n\t\tif !ok {\n\t\t\thost = \"0.0.0.0\"\n\t\t}\n\t\tprotocol, ok := value[\"protocol\"]\n\t\tif !ok {\n\t\t\tprotocol = \"tcp\"\n\t\t}\n\t\treturn fmt.Sprintf(\"%s:%s:%d/%s\", host, published, target, protocol), nil\n\tcase string:\n\t\treturn value, nil\n\t}\n\treturn \"\", nil\n}\n\nfunc envFileIndexer(y any, p tree.Path) (string, error) {\n\tswitch value := y.(type) {\n\tcase string:\n\t\treturn value, nil\n\tcase map[string]any:\n\t\tif pathValue, ok := value[\"path\"]; ok {\n\t\t\treturn pathValue.(string), nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"environment path attribute %s is missing\", p)\n\t}\n\treturn \"\", nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/context.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\nimport \"strings\"\n\nfunc (r *relativePathsResolver) absContextPath(value any) (any, error) {\n\tv := value.(string)\n\tif strings.Contains(v, \"://\") { // `docker-image://` or any builder specific context type\n\t\treturn v, nil\n\t}\n\tif isRemoteContext(v) {\n\t\treturn v, nil\n\t}\n\treturn r.absPath(v)\n}\n\n// isRemoteContext returns true if the value is a Git reference or HTTP(S) URL.\n//\n// Any other value is assumed to be a local filesystem path and returns false.\n//\n// See: https://github.com/moby/buildkit/blob/18fc875d9bfd6e065cd8211abc639434ba65aa56/frontend/dockerui/context.go#L76-L79\nfunc isRemoteContext(maybeURL string) bool {\n\tfor _, prefix := range []string{\"https://\", \"http://\", \"git://\", \"ssh://\", \"github.com/\", \"git@\"} {\n\t\tif strings.HasPrefix(maybeURL, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/extends.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\nfunc (r *relativePathsResolver) absExtendsPath(value any) (any, error) {\n\tv := value.(string)\n\tif r.isRemoteResource(v) {\n\t\treturn v, nil\n\t}\n\treturn r.absPath(v)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/home.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc ExpandUser(p string) string {\n\tif strings.HasPrefix(p, \"~\") {\n\t\thome, err := os.UserHomeDir()\n\t\tif err != nil {\n\t\t\tlogrus.Warn(\"cannot expand '~', because the environment lacks HOME\")\n\t\t\treturn p\n\t\t}\n\t\treturn filepath.Join(home, p[1:])\n\t}\n\treturn p\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/resolve.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"path/filepath\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n)\n\ntype resolver func(any) (any, error)\n\n// ResolveRelativePaths make relative paths absolute\nfunc ResolveRelativePaths(project map[string]any, base string, remotes []RemoteResource) error {\n\tr := relativePathsResolver{\n\t\tworkingDir: base,\n\t\tremotes:    remotes,\n\t}\n\tr.resolvers = map[tree.Path]resolver{\n\t\t\"services.*.build.context\":               r.absContextPath,\n\t\t\"services.*.build.additional_contexts.*\": r.absContextPath,\n\t\t\"services.*.env_file.*.path\":             r.absPath,\n\t\t\"services.*.extends.file\":                r.absExtendsPath,\n\t\t\"services.*.develop.watch.*.path\":        r.absSymbolicLink,\n\t\t\"services.*.volumes.*\":                   r.absVolumeMount,\n\t\t\"configs.*.file\":                         r.maybeUnixPath,\n\t\t\"secrets.*.file\":                         r.maybeUnixPath,\n\t\t\"include.path\":                           r.absPath,\n\t\t\"include.project_directory\":              r.absPath,\n\t\t\"include.env_file\":                       r.absPath,\n\t\t\"volumes.*\":                              r.volumeDriverOpts,\n\t}\n\t_, err := r.resolveRelativePaths(project, tree.NewPath())\n\treturn err\n}\n\ntype RemoteResource func(path string) bool\n\ntype relativePathsResolver struct {\n\tworkingDir string\n\tremotes    []RemoteResource\n\tresolvers  map[tree.Path]resolver\n}\n\nfunc (r *relativePathsResolver) isRemoteResource(path string) bool {\n\tfor _, remote := range r.remotes {\n\t\tif remote(path) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (r *relativePathsResolver) resolveRelativePaths(value any, p tree.Path) (any, error) {\n\tfor pattern, resolver := range r.resolvers {\n\t\tif p.Matches(pattern) {\n\t\t\treturn resolver(value)\n\t\t}\n\t}\n\tswitch v := value.(type) {\n\tcase map[string]any:\n\t\tfor k, e := range v {\n\t\t\tresolved, err := r.resolveRelativePaths(e, p.Next(k))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tv[k] = resolved\n\t\t}\n\tcase []any:\n\t\tfor i, e := range v {\n\t\t\tresolved, err := r.resolveRelativePaths(e, p.Next(\"[]\"))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tv[i] = resolved\n\t\t}\n\t}\n\treturn value, nil\n}\n\nfunc (r *relativePathsResolver) absPath(value any) (any, error) {\n\tswitch v := value.(type) {\n\tcase []any:\n\t\tfor i, s := range v {\n\t\t\tabs, err := r.absPath(s)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tv[i] = abs\n\t\t}\n\t\treturn v, nil\n\tcase string:\n\t\tv = ExpandUser(v)\n\t\tif filepath.IsAbs(v) {\n\t\t\treturn v, nil\n\t\t}\n\t\tif v != \"\" {\n\t\t\treturn filepath.Join(r.workingDir, v), nil\n\t\t}\n\t\treturn v, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unexpected type %T\", value)\n}\n\nfunc (r *relativePathsResolver) absVolumeMount(a any) (any, error) {\n\tswitch vol := a.(type) {\n\tcase map[string]any:\n\t\tif vol[\"type\"] != types.VolumeTypeBind {\n\t\t\treturn vol, nil\n\t\t}\n\t\tsrc, ok := vol[\"source\"]\n\t\tif !ok {\n\t\t\treturn nil, errors.New(`invalid mount config for type \"bind\": field Source must not be empty`)\n\t\t}\n\t\tabs, err := r.maybeUnixPath(src.(string))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvol[\"source\"] = abs\n\t\treturn vol, nil\n\tdefault:\n\t\t// not using canonical format, skip\n\t\treturn a, nil\n\t}\n}\n\nfunc (r *relativePathsResolver) volumeDriverOpts(a any) (any, error) {\n\tif a == nil {\n\t\treturn nil, nil\n\t}\n\tvol := a.(map[string]any)\n\tif vol[\"driver\"] != \"local\" {\n\t\treturn vol, nil\n\t}\n\tdo, ok := vol[\"driver_opts\"]\n\tif !ok {\n\t\treturn vol, nil\n\t}\n\topts := do.(map[string]any)\n\tif dev, ok := opts[\"device\"]; opts[\"o\"] == \"bind\" && ok {\n\t\t// This is actually a bind mount\n\t\tpath, err := r.maybeUnixPath(dev)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\topts[\"device\"] = path\n\t}\n\treturn vol, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/unix.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\nimport (\n\t\"path\"\n\t\"path/filepath\"\n\n\t\"github.com/compose-spec/compose-go/v2/utils\"\n)\n\nfunc (r *relativePathsResolver) maybeUnixPath(a any) (any, error) {\n\tp := a.(string)\n\tp = ExpandUser(p)\n\t// Check if source is an absolute path (either Unix or Windows), to\n\t// handle a Windows client with a Unix daemon or vice-versa.\n\t//\n\t// Note that this is not required for Docker for Windows when specifying\n\t// a local Windows path, because Docker for Windows translates the Windows\n\t// path into a valid path within the VM.\n\tif !path.IsAbs(p) && !isWindowsAbs(p) {\n\t\tif filepath.IsAbs(p) {\n\t\t\treturn p, nil\n\t\t}\n\t\treturn filepath.Join(r.workingDir, p), nil\n\t}\n\treturn p, nil\n}\n\nfunc (r *relativePathsResolver) absSymbolicLink(value any) (any, error) {\n\tabs, err := r.absPath(value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstr, ok := abs.(string)\n\tif !ok {\n\t\treturn abs, nil\n\t}\n\treturn utils.ResolveSymbolicLink(str)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/paths/windows_path.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage paths\n\n// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// https://github.com/golang/go/blob/master/LICENSE\n\n// This file contains utilities to check for Windows absolute paths on Linux.\n// The code in this file was largely copied from the Golang filepath package\n// https://github.com/golang/go/blob/1d0e94b1e13d5e8a323a63cd1cc1ef95290c9c36/src/path/filepath/path_windows.go#L12-L65\n\nfunc isSlash(c uint8) bool {\n\treturn c == '\\\\' || c == '/'\n}\n\n// isAbs reports whether the path is a Windows absolute path.\nfunc isWindowsAbs(path string) (b bool) {\n\tl := volumeNameLen(path)\n\tif l == 0 {\n\t\treturn false\n\t}\n\tpath = path[l:]\n\tif path == \"\" {\n\t\treturn false\n\t}\n\treturn isSlash(path[0])\n}\n\n// volumeNameLen returns length of the leading volume name on Windows.\n// It returns 0 elsewhere.\n// nolint: gocyclo\nfunc volumeNameLen(path string) int {\n\tif len(path) < 2 {\n\t\treturn 0\n\t}\n\t// with drive letter\n\tc := path[0]\n\tif path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {\n\t\treturn 2\n\t}\n\t// is it UNC? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx\n\tif l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) &&\n\t\t!isSlash(path[2]) && path[2] != '.' {\n\t\t// first, leading `\\\\` and next shouldn't be `\\`. its server name.\n\t\tfor n := 3; n < l-1; n++ {\n\t\t\t// second, next '\\' shouldn't be repeated.\n\t\t\tif isSlash(path[n]) {\n\t\t\t\tn++\n\t\t\t\t// third, following something characters. its share name.\n\t\t\t\tif !isSlash(path[n]) {\n\t\t\t\t\tif path[n] == '.' {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tfor ; n < l; n++ {\n\t\t\t\t\t\tif isSlash(path[n]) {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn n\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json",
    "content": "{\n  \"$schema\": \"https://json-schema.org/draft/2019-09/schema#\",\n  \"id\": \"compose_spec.json\",\n  \"type\": \"object\",\n  \"title\": \"Compose Specification\",\n  \"description\": \"The Compose file is a YAML file defining a multi-containers based application.\",\n\n  \"properties\": {\n    \"version\": {\n      \"type\": \"string\",\n      \"description\": \"declared for backward compatibility, ignored.\"\n    },\n\n    \"name\": {\n      \"type\": \"string\",\n      \"description\": \"define the Compose project name, until user defines one explicitly.\"\n    },\n\n    \"include\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/include\"\n      },\n      \"description\": \"compose sub-projects to be included.\"\n    },\n\n    \"services\": {\n      \"id\": \"#/properties/services\",\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-zA-Z0-9._-]+$\": {\n          \"$ref\": \"#/definitions/service\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n\n    \"networks\": {\n      \"id\": \"#/properties/networks\",\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-zA-Z0-9._-]+$\": {\n          \"$ref\": \"#/definitions/network\"\n        }\n      }\n    },\n\n    \"volumes\": {\n      \"id\": \"#/properties/volumes\",\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-zA-Z0-9._-]+$\": {\n          \"$ref\": \"#/definitions/volume\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n\n    \"secrets\": {\n      \"id\": \"#/properties/secrets\",\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-zA-Z0-9._-]+$\": {\n          \"$ref\": \"#/definitions/secret\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n\n    \"configs\": {\n      \"id\": \"#/properties/configs\",\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-zA-Z0-9._-]+$\": {\n          \"$ref\": \"#/definitions/config\"\n        }\n      },\n      \"additionalProperties\": false\n    }\n  },\n\n  \"patternProperties\": {\"^x-\": {}},\n  \"additionalProperties\": false,\n\n  \"definitions\": {\n\n    \"service\": {\n      \"id\": \"#/definitions/service\",\n      \"type\": \"object\",\n\n      \"properties\": {\n        \"develop\": {\"$ref\": \"#/definitions/development\"},\n        \"deploy\": {\"$ref\": \"#/definitions/deployment\"},\n        \"annotations\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"attach\": {\"type\": [\"boolean\", \"string\"]},\n        \"build\": {\n          \"oneOf\": [\n            {\"type\": \"string\"},\n            {\n              \"type\": \"object\",\n              \"properties\": {\n                \"context\": {\"type\": \"string\"},\n                \"dockerfile\": {\"type\": \"string\"},\n                \"dockerfile_inline\": {\"type\": \"string\"},\n                \"entitlements\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n                \"args\": {\"$ref\": \"#/definitions/list_or_dict\"},\n                \"ssh\": {\"$ref\": \"#/definitions/list_or_dict\"},\n                \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"},\n                \"cache_from\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n                \"cache_to\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n                \"no_cache\": {\"type\": [\"boolean\", \"string\"]},\n                \"additional_contexts\": {\"$ref\": \"#/definitions/list_or_dict\"},\n                \"network\": {\"type\": \"string\"},\n                \"pull\": {\"type\": [\"boolean\", \"string\"]},\n                \"target\": {\"type\": \"string\"},\n                \"shm_size\": {\"type\": [\"integer\", \"string\"]},\n                \"extra_hosts\": {\"$ref\": \"#/definitions/extra_hosts\"},\n                \"isolation\": {\"type\": \"string\"},\n                \"privileged\": {\"type\": [\"boolean\", \"string\"]},\n                \"secrets\": {\"$ref\": \"#/definitions/service_config_or_secret\"},\n                \"tags\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n                \"ulimits\": {\"$ref\": \"#/definitions/ulimits\"},\n                \"platforms\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}}\n              },\n              \"additionalProperties\": false,\n              \"patternProperties\": {\"^x-\": {}}\n            }\n          ]\n        },\n        \"blkio_config\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"device_read_bps\": {\n              \"type\": \"array\",\n              \"items\": {\"$ref\": \"#/definitions/blkio_limit\"}\n            },\n            \"device_read_iops\": {\n              \"type\": \"array\",\n              \"items\": {\"$ref\": \"#/definitions/blkio_limit\"}\n            },\n            \"device_write_bps\": {\n              \"type\": \"array\",\n              \"items\": {\"$ref\": \"#/definitions/blkio_limit\"}\n            },\n            \"device_write_iops\": {\n              \"type\": \"array\",\n              \"items\": {\"$ref\": \"#/definitions/blkio_limit\"}\n            },\n            \"weight\": {\"type\": [\"integer\", \"string\"]},\n            \"weight_device\": {\n              \"type\": \"array\",\n              \"items\": {\"$ref\": \"#/definitions/blkio_weight\"}\n            }\n          },\n          \"additionalProperties\": false\n        },\n        \"cap_add\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"cap_drop\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"cgroup\": {\"type\": \"string\", \"enum\": [\"host\", \"private\"]},\n        \"cgroup_parent\": {\"type\": \"string\"},\n        \"command\": {\"$ref\": \"#/definitions/command\"},\n        \"configs\": {\"$ref\": \"#/definitions/service_config_or_secret\"},\n        \"container_name\": {\"type\": \"string\"},\n        \"cpu_count\": {\"oneOf\": [\n          {\"type\": \"string\"},\n          {\"type\": \"integer\", \"minimum\": 0}\n        ]},\n        \"cpu_percent\": {\"oneOf\": [\n          {\"type\": \"string\"},\n          {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 100}\n        ]},\n        \"cpu_shares\": {\"type\": [\"number\", \"string\"]},\n        \"cpu_quota\": {\"type\": [\"number\", \"string\"]},\n        \"cpu_period\": {\"type\": [\"number\", \"string\"]},\n        \"cpu_rt_period\": {\"type\": [\"number\", \"string\"]},\n        \"cpu_rt_runtime\": {\"type\": [\"number\", \"string\"]},\n        \"cpus\": {\"type\": [\"number\", \"string\"]},\n        \"cpuset\": {\"type\": \"string\"},\n        \"credential_spec\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"config\": {\"type\": \"string\"},\n            \"file\": {\"type\": \"string\"},\n            \"registry\": {\"type\": \"string\"}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"depends_on\": {\n          \"oneOf\": [\n            {\"$ref\": \"#/definitions/list_of_strings\"},\n            {\n              \"type\": \"object\",\n              \"additionalProperties\": false,\n              \"patternProperties\": {\n                \"^[a-zA-Z0-9._-]+$\": {\n                  \"type\": \"object\",\n                  \"additionalProperties\": false,\n                  \"patternProperties\": {\"^x-\": {}},\n                  \"properties\": {\n                    \"restart\": {\"type\": [\"boolean\", \"string\"]},\n                    \"required\": {\n                      \"type\":  \"boolean\",\n                      \"default\": true\n                    },\n                    \"condition\": {\n                      \"type\": \"string\",\n                      \"enum\": [\"service_started\", \"service_healthy\", \"service_completed_successfully\"]\n                    }\n                  },\n                  \"required\": [\"condition\"]\n                }\n              }\n            }\n          ]\n        },\n        \"device_cgroup_rules\": {\"$ref\": \"#/definitions/list_of_strings\"},\n        \"devices\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"oneOf\": [\n              {\"type\": \"string\"},\n              {\n                \"type\": \"object\",\n                \"required\": [\"source\"],\n                \"properties\": {\n                  \"source\": {\"type\": \"string\"},\n                  \"target\": {\"type\": \"string\"},\n                  \"permissions\": {\"type\": \"string\"}\n                },\n                \"additionalProperties\": false,\n                \"patternProperties\": {\"^x-\": {}}\n              }\n            ]\n          }\n        },\n        \"dns\": {\"$ref\": \"#/definitions/string_or_list\"},\n        \"dns_opt\": {\"type\": \"array\",\"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"dns_search\": {\"$ref\": \"#/definitions/string_or_list\"},\n        \"domainname\": {\"type\": \"string\"},\n        \"entrypoint\": {\"$ref\": \"#/definitions/command\"},\n        \"env_file\": {\"$ref\": \"#/definitions/env_file\"},\n        \"environment\": {\"$ref\": \"#/definitions/list_or_dict\"},\n\n        \"expose\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": [\"string\", \"number\"],\n            \"format\": \"expose\"\n          },\n          \"uniqueItems\": true\n        },\n        \"extends\": {\n          \"oneOf\": [\n            {\"type\": \"string\"},\n            {\n              \"type\": \"object\",\n\n              \"properties\": {\n                \"service\": {\"type\": \"string\"},\n                \"file\": {\"type\": \"string\"}\n              },\n              \"required\": [\"service\"],\n              \"additionalProperties\": false\n            }\n          ]\n        },\n        \"external_links\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"extra_hosts\": {\"$ref\": \"#/definitions/extra_hosts\"},\n        \"group_add\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": [\"string\", \"number\"]\n          },\n          \"uniqueItems\": true\n        },\n        \"healthcheck\": {\"$ref\": \"#/definitions/healthcheck\"},\n        \"hostname\": {\"type\": \"string\"},\n        \"image\": {\"type\": \"string\"},\n        \"init\": {\"type\": [\"boolean\", \"string\"]},\n        \"ipc\": {\"type\": \"string\"},\n        \"isolation\": {\"type\": \"string\"},\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"links\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"logging\": {\n          \"type\": \"object\",\n\n          \"properties\": {\n            \"driver\": {\"type\": \"string\"},\n            \"options\": {\n              \"type\": \"object\",\n              \"patternProperties\": {\n                \"^.+$\": {\"type\": [\"string\", \"number\", \"null\"]}\n              }\n            }\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"mac_address\": {\"type\": \"string\"},\n        \"mem_limit\": {\"type\": [\"number\", \"string\"]},\n        \"mem_reservation\": {\"type\": [\"string\", \"integer\"]},\n        \"mem_swappiness\": {\"type\": [\"integer\", \"string\"]},\n        \"memswap_limit\": {\"type\": [\"number\", \"string\"]},\n        \"network_mode\": {\"type\": \"string\"},\n        \"networks\": {\n          \"oneOf\": [\n            {\"$ref\": \"#/definitions/list_of_strings\"},\n            {\n              \"type\": \"object\",\n              \"patternProperties\": {\n                \"^[a-zA-Z0-9._-]+$\": {\n                  \"oneOf\": [\n                    {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"aliases\": {\"$ref\": \"#/definitions/list_of_strings\"},\n                        \"ipv4_address\": {\"type\": \"string\"},\n                        \"ipv6_address\": {\"type\": \"string\"},\n                        \"link_local_ips\": {\"$ref\": \"#/definitions/list_of_strings\"},\n                        \"mac_address\": {\"type\": \"string\"},\n                        \"driver_opts\": {\n                          \"type\": \"object\",\n                          \"patternProperties\": {\n                            \"^.+$\": {\"type\": [\"string\", \"number\"]}\n                          }\n                        },\n                        \"priority\": {\"type\": \"number\"}\n                      },\n                      \"additionalProperties\": false,\n                      \"patternProperties\": {\"^x-\": {}}\n                    },\n                    {\"type\": \"null\"}\n                  ]\n                }\n              },\n              \"additionalProperties\": false\n            }\n          ]\n        },\n        \"oom_kill_disable\": {\"type\": [\"boolean\", \"string\"]},\n        \"oom_score_adj\": {\"oneOf\": [\n          {\"type\": \"string\"},\n          {\"type\": \"integer\", \"minimum\": -1000, \"maximum\": 1000}\n        ]},\n        \"pid\": {\"type\": [\"string\", \"null\"]},\n        \"pids_limit\": {\"type\": [\"number\", \"string\"]},\n        \"platform\": {\"type\": \"string\"},\n        \"ports\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"oneOf\": [\n              {\"type\": \"number\"},\n              {\"type\": \"string\"},\n              {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\"type\": \"string\"},\n                  \"mode\": {\"type\": \"string\"},\n                  \"host_ip\": {\"type\": \"string\"},\n                  \"target\": {\"type\": [\"integer\", \"string\"]},\n                  \"published\": {\"type\": [\"string\", \"integer\"]},\n                  \"protocol\": {\"type\": \"string\"},\n                  \"app_protocol\": {\"type\": \"string\"}\n                },\n                \"additionalProperties\": false,\n                \"patternProperties\": {\"^x-\": {}}\n              }\n            ]\n          },\n          \"uniqueItems\": true\n        },\n        \"privileged\": {\"type\": [\"boolean\", \"string\"]},\n        \"profiles\": {\"$ref\": \"#/definitions/list_of_strings\"},\n        \"pull_policy\": {\"type\": \"string\", \"enum\": [\n          \"always\", \"never\", \"if_not_present\", \"build\", \"missing\"\n        ]},\n        \"read_only\": {\"type\": [\"boolean\", \"string\"]},\n        \"restart\": {\"type\": \"string\"},\n        \"runtime\": {\n          \"type\": \"string\"\n        },\n        \"scale\": {\n          \"type\": [\"integer\", \"string\"]\n        },\n        \"security_opt\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true},\n        \"shm_size\": {\"type\": [\"number\", \"string\"]},\n        \"secrets\": {\"$ref\": \"#/definitions/service_config_or_secret\"},\n        \"sysctls\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"stdin_open\": {\"type\": [\"boolean\", \"string\"]},\n        \"stop_grace_period\": {\"type\": \"string\"},\n        \"stop_signal\": {\"type\": \"string\"},\n        \"storage_opt\": {\"type\": \"object\"},\n        \"tmpfs\": {\"$ref\": \"#/definitions/string_or_list\"},\n        \"tty\": {\"type\": [\"boolean\", \"string\"]},\n        \"ulimits\": {\"$ref\": \"#/definitions/ulimits\"},\n        \"user\": {\"type\": \"string\"},\n        \"uts\": {\"type\": \"string\"},\n        \"userns_mode\": {\"type\": \"string\"},\n        \"volumes\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"oneOf\": [\n              {\"type\": \"string\"},\n              {\n                \"type\": \"object\",\n                \"required\": [\"type\"],\n                \"properties\": {\n                  \"type\": {\"type\": \"string\"},\n                  \"source\": {\"type\": \"string\"},\n                  \"target\": {\"type\": \"string\"},\n                  \"read_only\": {\"type\": [\"boolean\", \"string\"]},\n                  \"consistency\": {\"type\": \"string\"},\n                  \"bind\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"propagation\": {\"type\": \"string\"},\n                      \"create_host_path\": {\"type\": [\"boolean\", \"string\"]},\n                      \"selinux\": {\"type\": \"string\", \"enum\": [\"z\", \"Z\"]}\n                    },\n                    \"additionalProperties\": false,\n                    \"patternProperties\": {\"^x-\": {}}\n                  },\n                  \"volume\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"nocopy\": {\"type\": [\"boolean\", \"string\"]},\n                      \"subpath\": {\"type\": \"string\"}\n                    },\n                    \"additionalProperties\": false,\n                    \"patternProperties\": {\"^x-\": {}}\n                  },\n                  \"tmpfs\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"size\": {\n                        \"oneOf\": [\n                          {\"type\": \"integer\", \"minimum\": 0},\n                          {\"type\": \"string\"}\n                        ]\n                      },\n                      \"mode\": {\"type\": [\"number\", \"string\"]}\n                    },\n                    \"additionalProperties\": false,\n                    \"patternProperties\": {\"^x-\": {}}\n                  }\n                },\n                \"additionalProperties\": false,\n                \"patternProperties\": {\"^x-\": {}}\n              }\n            ]\n          },\n          \"uniqueItems\": true\n        },\n        \"volumes_from\": {\n          \"type\": \"array\",\n          \"items\": {\"type\": \"string\"},\n          \"uniqueItems\": true\n        },\n        \"working_dir\": {\"type\": \"string\"}\n      },\n      \"patternProperties\": {\"^x-\": {}},\n      \"additionalProperties\": false\n    },\n\n    \"healthcheck\": {\n      \"id\": \"#/definitions/healthcheck\",\n      \"type\": \"object\",\n      \"properties\": {\n        \"disable\": {\"type\": [\"boolean\", \"string\"]},\n        \"interval\": {\"type\": \"string\"},\n        \"retries\": {\"type\": [\"number\", \"string\"]},\n        \"test\": {\n          \"oneOf\": [\n            {\"type\": \"string\"},\n            {\"type\": \"array\", \"items\": {\"type\": \"string\"}}\n          ]\n        },\n        \"timeout\": {\"type\": \"string\"},\n        \"start_period\": {\"type\": \"string\"},\n        \"start_interval\": {\"type\": \"string\"}\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n    \"development\": {\n      \"id\": \"#/definitions/development\",\n      \"type\": [\"object\", \"null\"],\n      \"properties\": {\n        \"watch\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\"path\", \"action\"],\n            \"properties\": {\n              \"ignore\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n              \"path\": {\"type\": \"string\"},\n              \"action\": {\"type\": \"string\", \"enum\": [\"rebuild\", \"sync\", \"sync+restart\"]},\n              \"target\": {\"type\": \"string\"}\n            },\n            \"additionalProperties\": false,\n            \"patternProperties\": {\"^x-\": {}}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        }\n      }\n    },\n    \"deployment\": {\n      \"id\": \"#/definitions/deployment\",\n      \"type\": [\"object\", \"null\"],\n      \"properties\": {\n        \"mode\": {\"type\": \"string\"},\n        \"endpoint_mode\": {\"type\": \"string\"},\n        \"replicas\": {\"type\": [\"integer\", \"string\"]},\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"rollback_config\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"parallelism\": {\"type\": [\"integer\", \"string\"]},\n            \"delay\": {\"type\": \"string\"},\n            \"failure_action\": {\"type\": \"string\"},\n            \"monitor\": {\"type\": \"string\"},\n            \"max_failure_ratio\": {\"type\": [\"number\", \"string\"]},\n            \"order\": {\"type\": \"string\", \"enum\": [\n              \"start-first\", \"stop-first\"\n            ]}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"update_config\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"parallelism\": {\"type\": [\"integer\", \"string\"]},\n            \"delay\": {\"type\": \"string\"},\n            \"failure_action\": {\"type\": \"string\"},\n            \"monitor\": {\"type\": \"string\"},\n            \"max_failure_ratio\": {\"type\": [\"number\", \"string\"]},\n            \"order\": {\"type\": \"string\", \"enum\": [\n              \"start-first\", \"stop-first\"\n            ]}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"resources\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"limits\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"cpus\": {\"type\": [\"number\", \"string\"]},\n                \"memory\": {\"type\": \"string\"},\n                \"pids\": {\"type\": [\"integer\", \"string\"]}\n              },\n              \"additionalProperties\": false,\n              \"patternProperties\": {\"^x-\": {}}\n            },\n            \"reservations\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"cpus\": {\"type\": [\"number\", \"string\"]},\n                \"memory\": {\"type\": \"string\"},\n                \"generic_resources\": {\"$ref\": \"#/definitions/generic_resources\"},\n                \"devices\": {\"$ref\": \"#/definitions/devices\"}\n              },\n              \"additionalProperties\": false,\n              \"patternProperties\": {\"^x-\": {}}\n            }\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"restart_policy\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"condition\": {\"type\": \"string\"},\n            \"delay\": {\"type\": \"string\"},\n            \"max_attempts\": {\"type\": [\"integer\", \"string\"]},\n            \"window\": {\"type\": \"string\"}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"placement\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"constraints\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n            \"preferences\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"spread\": {\"type\": \"string\"}\n                },\n                \"additionalProperties\": false,\n                \"patternProperties\": {\"^x-\": {}}\n              }\n            },\n            \"max_replicas_per_node\": {\"type\": [\"integer\", \"string\"]}\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        }\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n\n    \"generic_resources\": {\n      \"id\": \"#/definitions/generic_resources\",\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"discrete_resource_spec\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"kind\": {\"type\": \"string\"},\n              \"value\": {\"type\": [\"number\", \"string\"]}\n            },\n            \"additionalProperties\": false,\n            \"patternProperties\": {\"^x-\": {}}\n          }\n        },\n        \"additionalProperties\": false,\n        \"patternProperties\": {\"^x-\": {}}\n      }\n    },\n\n    \"devices\": {\n      \"id\": \"#/definitions/devices\",\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"capabilities\": {\"$ref\": \"#/definitions/list_of_strings\"},\n          \"count\": {\"type\": [\"string\", \"integer\"]},\n          \"device_ids\": {\"$ref\": \"#/definitions/list_of_strings\"},\n          \"driver\":{\"type\": \"string\"},\n          \"options\":{\"$ref\": \"#/definitions/list_or_dict\"}\n        },\n        \"additionalProperties\": false,\n        \"patternProperties\": {\"^x-\": {}}\n      }\n    },\n\n    \"include\": {\n      \"id\": \"#/definitions/include\",\n      \"oneOf\": [\n        {\"type\": \"string\"},\n        {\n          \"type\": \"object\",\n          \"properties\": {\n            \"path\": {\"$ref\": \"#/definitions/string_or_list\"},\n            \"env_file\": {\"$ref\": \"#/definitions/string_or_list\"},\n            \"project_directory\": {\"type\": \"string\"}\n          },\n          \"additionalProperties\": false\n        }\n      ]\n    },\n\n    \"network\": {\n      \"id\": \"#/definitions/network\",\n      \"type\": [\"object\", \"null\"],\n      \"properties\": {\n        \"name\": {\"type\": \"string\"},\n        \"driver\": {\"type\": \"string\"},\n        \"driver_opts\": {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \"^.+$\": {\"type\": [\"string\", \"number\"]}\n          }\n        },\n        \"ipam\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"driver\": {\"type\": \"string\"},\n            \"config\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"subnet\": {\"type\": \"string\"},\n                  \"ip_range\": {\"type\": \"string\"},\n                  \"gateway\": {\"type\": \"string\"},\n                  \"aux_addresses\": {\n                    \"type\": \"object\",\n                    \"additionalProperties\": false,\n                    \"patternProperties\": {\"^.+$\": {\"type\": \"string\"}}\n                  }\n                },\n                \"additionalProperties\": false,\n                \"patternProperties\": {\"^x-\": {}}\n              }\n            },\n            \"options\": {\n              \"type\": \"object\",\n              \"additionalProperties\": false,\n              \"patternProperties\": {\"^.+$\": {\"type\": \"string\"}}\n            }\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"external\": {\n          \"type\": [\"boolean\", \"string\", \"object\"],\n          \"properties\": {\n            \"name\": {\n              \"deprecated\": true,\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"internal\": {\"type\": [\"boolean\", \"string\"]},\n        \"enable_ipv6\": {\"type\": [\"boolean\", \"string\"]},\n        \"attachable\": {\"type\": [\"boolean\", \"string\"]},\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"}\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n\n    \"volume\": {\n      \"id\": \"#/definitions/volume\",\n      \"type\": [\"object\", \"null\"],\n      \"properties\": {\n        \"name\": {\"type\": \"string\"},\n        \"driver\": {\"type\": \"string\"},\n        \"driver_opts\": {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \"^.+$\": {\"type\": [\"string\", \"number\"]}\n          }\n        },\n        \"external\": {\n          \"type\": [\"boolean\", \"string\", \"object\"],\n          \"properties\": {\n            \"name\": {\n              \"deprecated\": true,\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": false,\n          \"patternProperties\": {\"^x-\": {}}\n        },\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"}\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n\n    \"secret\": {\n      \"id\": \"#/definitions/secret\",\n      \"type\": \"object\",\n      \"properties\": {\n        \"name\": {\"type\": \"string\"},\n        \"environment\": {\"type\": \"string\"},\n        \"file\": {\"type\": \"string\"},\n        \"external\": {\n          \"type\": [\"boolean\", \"string\", \"object\"],\n          \"properties\": {\n            \"name\": {\"type\": \"string\"}\n          }\n        },\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"driver\": {\"type\": \"string\"},\n        \"driver_opts\": {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \"^.+$\": {\"type\": [\"string\", \"number\"]}\n          }\n        },\n        \"template_driver\": {\"type\": \"string\"}\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n\n    \"config\": {\n      \"id\": \"#/definitions/config\",\n      \"type\": \"object\",\n      \"properties\": {\n        \"name\": {\"type\": \"string\"},\n        \"content\": {\"type\": \"string\"},\n        \"environment\": {\"type\": \"string\"},\n        \"file\": {\"type\": \"string\"},\n        \"external\": {\n          \"type\": [\"boolean\", \"string\", \"object\"],\n          \"properties\": {\n            \"name\": {\n              \"deprecated\": true,\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"labels\": {\"$ref\": \"#/definitions/list_or_dict\"},\n        \"template_driver\": {\"type\": \"string\"}\n      },\n      \"additionalProperties\": false,\n      \"patternProperties\": {\"^x-\": {}}\n    },\n\n    \"command\": {\n      \"oneOf\": [\n        {\"type\": \"null\"},\n        {\"type\": \"string\"},\n        {\"type\": \"array\",\"items\": {\"type\": \"string\"}}\n      ]\n    },\n\n    \"env_file\": {\n      \"oneOf\": [\n        {\"type\": \"string\"},\n        {\n          \"type\": \"array\",\n          \"items\": {\n            \"oneOf\": [\n              {\"type\": \"string\"},\n              {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                  \"path\": {\n                    \"type\": \"string\"\n                  },\n                  \"required\": {\n                    \"type\": [\"boolean\", \"string\"],\n                    \"default\": true\n                  }\n                },\n                \"required\": [\n                  \"path\"\n                ]\n              }\n            ]\n          }\n        }\n      ]\n    },\n\n    \"string_or_list\": {\n      \"oneOf\": [\n        {\"type\": \"string\"},\n        {\"$ref\": \"#/definitions/list_of_strings\"}\n      ]\n    },\n\n    \"list_of_strings\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"},\n      \"uniqueItems\": true\n    },\n\n    \"list_or_dict\": {\n      \"oneOf\": [\n        {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \".+\": {\n              \"type\": [\"string\", \"number\", \"boolean\", \"null\"]\n            }\n          },\n          \"additionalProperties\": false\n        },\n        {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true}\n      ]\n    },\n\n    \"extra_hosts\": {\n      \"oneOf\": [\n        {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \".+\": {\n              \"type\": [\"string\", \"array\"]\n            }\n          },\n          \"additionalProperties\": false\n        },\n        {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"uniqueItems\": true}\n      ]\n    },\n\n    \"blkio_limit\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"path\": {\"type\": \"string\"},\n        \"rate\": {\"type\": [\"integer\", \"string\"]}\n      },\n      \"additionalProperties\": false\n    },\n    \"blkio_weight\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"path\": {\"type\": \"string\"},\n        \"weight\": {\"type\": [\"integer\", \"string\"]}\n      },\n      \"additionalProperties\": false\n    },\n    \"service_config_or_secret\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"oneOf\": [\n          {\"type\": \"string\"},\n          {\n            \"type\": \"object\",\n            \"properties\": {\n              \"source\": {\"type\": \"string\"},\n              \"target\": {\"type\": \"string\"},\n              \"uid\": {\"type\": \"string\"},\n              \"gid\": {\"type\": \"string\"},\n              \"mode\": {\"type\": [\"number\", \"string\"]}\n            },\n            \"additionalProperties\": false,\n            \"patternProperties\": {\"^x-\": {}}\n          }\n        ]\n      }\n    },\n    \"ulimits\": {\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-z]+$\": {\n          \"oneOf\": [\n            {\"type\": [\"integer\", \"string\"]},\n            {\n              \"type\": \"object\",\n              \"properties\": {\n                \"hard\": {\"type\": [\"integer\", \"string\"]},\n                \"soft\": {\"type\": [\"integer\", \"string\"]}\n              },\n              \"required\": [\"soft\", \"hard\"],\n              \"additionalProperties\": false,\n              \"patternProperties\": {\"^x-\": {}}\n            }\n          ]\n        }\n      }\n    },\n    \"constraints\": {\n      \"service\": {\n        \"id\": \"#/definitions/constraints/service\",\n        \"anyOf\": [\n          {\"required\": [\"build\"]},\n          {\"required\": [\"image\"]}\n        ],\n        \"properties\": {\n          \"build\": {\n            \"required\": [\"context\"]\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/schema/schema.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage schema\n\nimport (\n\t// Enable support for embedded static resources\n\t_ \"embed\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/xeipuuv/gojsonschema\"\n)\n\ntype portsFormatChecker struct{}\n\nfunc (checker portsFormatChecker) IsFormat(_ interface{}) bool {\n\t// TODO: implement this\n\treturn true\n}\n\ntype durationFormatChecker struct{}\n\nfunc (checker durationFormatChecker) IsFormat(input interface{}) bool {\n\tvalue, ok := input.(string)\n\tif !ok {\n\t\treturn false\n\t}\n\t_, err := time.ParseDuration(value)\n\treturn err == nil\n}\n\nfunc init() {\n\tgojsonschema.FormatCheckers.Add(\"expose\", portsFormatChecker{})\n\tgojsonschema.FormatCheckers.Add(\"ports\", portsFormatChecker{})\n\tgojsonschema.FormatCheckers.Add(\"duration\", durationFormatChecker{})\n}\n\n// Schema is the compose-spec JSON schema\n//\n//go:embed compose-spec.json\nvar Schema string\n\n// Validate uses the jsonschema to validate the configuration\nfunc Validate(config map[string]interface{}) error {\n\tschemaLoader := gojsonschema.NewStringLoader(Schema)\n\tdataLoader := gojsonschema.NewGoLoader(config)\n\n\tresult, err := gojsonschema.Validate(schemaLoader, dataLoader)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !result.Valid() {\n\t\treturn toError(result)\n\t}\n\n\treturn nil\n}\n\nfunc toError(result *gojsonschema.Result) error {\n\terr := getMostSpecificError(result.Errors())\n\treturn err\n}\n\nconst (\n\tjsonschemaOneOf = \"number_one_of\"\n\tjsonschemaAnyOf = \"number_any_of\"\n)\n\nfunc getDescription(err validationError) string {\n\tswitch err.parent.Type() {\n\tcase \"invalid_type\":\n\t\tif expectedType, ok := err.parent.Details()[\"expected\"].(string); ok {\n\t\t\treturn fmt.Sprintf(\"must be a %s\", humanReadableType(expectedType))\n\t\t}\n\tcase jsonschemaOneOf, jsonschemaAnyOf:\n\t\tif err.child == nil {\n\t\t\treturn err.parent.Description()\n\t\t}\n\t\treturn err.child.Description()\n\t}\n\treturn err.parent.Description()\n}\n\nfunc humanReadableType(definition string) string {\n\tif definition[0:1] == \"[\" {\n\t\tallTypes := strings.Split(definition[1:len(definition)-1], \",\")\n\t\tfor i, t := range allTypes {\n\t\t\tallTypes[i] = humanReadableType(t)\n\t\t}\n\t\treturn fmt.Sprintf(\n\t\t\t\"%s or %s\",\n\t\t\tstrings.Join(allTypes[0:len(allTypes)-1], \", \"),\n\t\t\tallTypes[len(allTypes)-1],\n\t\t)\n\t}\n\tif definition == \"object\" {\n\t\treturn \"mapping\"\n\t}\n\tif definition == \"array\" {\n\t\treturn \"list\"\n\t}\n\treturn definition\n}\n\ntype validationError struct {\n\tparent gojsonschema.ResultError\n\tchild  gojsonschema.ResultError\n}\n\nfunc (err validationError) Error() string {\n\tdescription := getDescription(err)\n\treturn fmt.Sprintf(\"%s %s\", err.parent.Field(), description)\n}\n\nfunc getMostSpecificError(errors []gojsonschema.ResultError) validationError {\n\tmostSpecificError := 0\n\tfor i, err := range errors {\n\t\tif specificity(err) > specificity(errors[mostSpecificError]) {\n\t\t\tmostSpecificError = i\n\t\t\tcontinue\n\t\t}\n\n\t\tif specificity(err) == specificity(errors[mostSpecificError]) {\n\t\t\t// Invalid type errors win in a tie-breaker for most specific field name\n\t\t\tif err.Type() == \"invalid_type\" && errors[mostSpecificError].Type() != \"invalid_type\" {\n\t\t\t\tmostSpecificError = i\n\t\t\t}\n\t\t}\n\t}\n\n\tif mostSpecificError+1 == len(errors) {\n\t\treturn validationError{parent: errors[mostSpecificError]}\n\t}\n\n\tswitch errors[mostSpecificError].Type() {\n\tcase \"number_one_of\", \"number_any_of\":\n\t\treturn validationError{\n\t\t\tparent: errors[mostSpecificError],\n\t\t\tchild:  errors[mostSpecificError+1],\n\t\t}\n\tdefault:\n\t\treturn validationError{parent: errors[mostSpecificError]}\n\t}\n}\n\nfunc specificity(err gojsonschema.ResultError) int {\n\treturn len(strings.Split(err.Field(), \".\"))\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/schema/using-variables.yaml",
    "content": "name: ${VARIABLE}\nservices:\n  foo:\n    deploy:\n      mode: ${VARIABLE}\n      replicas: ${VARIABLE}\n      rollback_config:\n        parallelism: ${VARIABLE}\n        delay: ${VARIABLE}\n        failure_action: ${VARIABLE}\n        monitor: ${VARIABLE}\n        max_failure_ratio: ${VARIABLE}\n      update_config:\n        parallelism: ${VARIABLE}\n        delay: ${VARIABLE}\n        failure_action: ${VARIABLE}\n        monitor: ${VARIABLE}\n        max_failure_ratio: ${VARIABLE}\n      resources:\n        limits:\n          memory: ${VARIABLE}\n        reservations:\n          memory: ${VARIABLE}\n          generic_resources:\n            - discrete_resource_spec:\n                kind: ${VARIABLE}\n                value: ${VARIABLE}\n            - discrete_resource_spec:\n                kind: ${VARIABLE}\n                value: ${VARIABLE}\n      restart_policy:\n        condition: ${VARIABLE}\n        delay: ${VARIABLE}\n        max_attempts: ${VARIABLE}\n        window: ${VARIABLE}\n      placement:\n        max_replicas_per_node: ${VARIABLE}\n        preferences:\n          - spread: ${VARIABLE}\n      endpoint_mode: ${VARIABLE}\n    expose:\n      - ${VARIABLE}\n    external_links:\n      - ${VARIABLE}\n    extra_hosts:\n      - ${VARIABLE}\n    hostname: ${VARIABLE}\n\n    healthcheck:\n      test: ${VARIABLE}\n      interval: ${VARIABLE}\n      timeout: ${VARIABLE}\n      retries: ${VARIABLE}\n      start_period: ${VARIABLE}\n      start_interval: ${VARIABLE}\n    image: ${VARIABLE}\n    mac_address: ${VARIABLE}\n    networks:\n      some-network:\n        aliases:\n          - ${VARIABLE}\n      other-network:\n        ipv4_address: ${VARIABLE}\n        ipv6_address: ${VARIABLE}\n        mac_address: ${VARIABLE}\n    ports:\n      - ${VARIABLE}\n    privileged: ${VARIABLE}\n    read_only: ${VARIABLE}\n    restart: ${VARIABLE}\n    secrets:\n      - source: ${VARIABLE}\n        target: ${VARIABLE}\n        uid: ${VARIABLE}\n        gid: ${VARIABLE}\n        mode: ${VARIABLE}\n    stdin_open: ${VARIABLE}\n    stop_grace_period: ${VARIABLE}\n    stop_signal: ${VARIABLE}\n    storage_opt:\n      size: ${VARIABLE}\n    sysctls:\n      net.core.somaxconn: ${VARIABLE}\n    tmpfs:\n      - ${VARIABLE}\n    tty: ${VARIABLE}\n    ulimits:\n      nproc: ${VARIABLE}\n      nofile:\n        soft: ${VARIABLE}\n        hard: ${VARIABLE}\n    user: ${VARIABLE}\n    volumes:\n      - ${VARIABLE}:${VARIABLE}\n      - type: tmpfs\n        target: ${VARIABLE}\n        tmpfs:\n          size: ${VARIABLE}\n\nnetworks:\n  network:\n    ipam:\n      driver: ${VARIABLE}\n      config:\n        - subnet: ${VARIABLE}\n          ip_range: ${VARIABLE}\n          gateway: ${VARIABLE}\n          aux_addresses:\n            host1: ${VARIABLE}\n  external-network:\n    external: ${VARIABLE}\n\nvolumes:\n  external-volume:\n    external: ${VARIABLE}\n\nconfigs:\n  config1:\n    external: ${VARIABLE}\n\nsecrets:\n  secret1:\n    external: ${VARIABLE}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/template/template.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage template\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar delimiter = \"\\\\$\"\nvar substitutionNamed = \"[_a-z][_a-z0-9]*\"\nvar substitutionBraced = \"[_a-z][_a-z0-9]*(?::?[-+?](.*))?\"\n\nvar groupEscaped = \"escaped\"\nvar groupNamed = \"named\"\nvar groupBraced = \"braced\"\nvar groupInvalid = \"invalid\"\n\nvar patternString = fmt.Sprintf(\n\t\"%s(?i:(?P<%s>%s)|(?P<%s>%s)|{(?:(?P<%s>%s)}|(?P<%s>)))\",\n\tdelimiter,\n\tgroupEscaped, delimiter,\n\tgroupNamed, substitutionNamed,\n\tgroupBraced, substitutionBraced,\n\tgroupInvalid,\n)\n\nvar DefaultPattern = regexp.MustCompile(patternString)\n\n// InvalidTemplateError is returned when a variable template is not in a valid\n// format\ntype InvalidTemplateError struct {\n\tTemplate string\n}\n\nfunc (e InvalidTemplateError) Error() string {\n\treturn fmt.Sprintf(\"Invalid template: %#v\", e.Template)\n}\n\n// MissingRequiredError is returned when a variable template is missing\ntype MissingRequiredError struct {\n\tVariable string\n\tReason   string\n}\n\nfunc (e MissingRequiredError) Error() string {\n\tif e.Reason != \"\" {\n\t\treturn fmt.Sprintf(\"required variable %s is missing a value: %s\", e.Variable, e.Reason)\n\t}\n\treturn fmt.Sprintf(\"required variable %s is missing a value\", e.Variable)\n}\n\n// Mapping is a user-supplied function which maps from variable names to values.\n// Returns the value as a string and a bool indicating whether\n// the value is present, to distinguish between an empty string\n// and the absence of a value.\ntype Mapping func(string) (string, bool)\n\n// SubstituteFunc is a user-supplied function that apply substitution.\n// Returns the value as a string, a bool indicating if the function could apply\n// the substitution and an error.\ntype SubstituteFunc func(string, Mapping) (string, bool, error)\n\n// ReplacementFunc is a user-supplied function that is apply to the matching\n// substring. Returns the value as a string and an error.\ntype ReplacementFunc func(string, Mapping, *Config) (string, error)\n\ntype Config struct {\n\tpattern         *regexp.Regexp\n\tsubstituteFunc  SubstituteFunc\n\treplacementFunc ReplacementFunc\n\tlogging         bool\n}\n\ntype Option func(*Config)\n\nfunc WithPattern(pattern *regexp.Regexp) Option {\n\treturn func(cfg *Config) {\n\t\tcfg.pattern = pattern\n\t}\n}\n\nfunc WithSubstitutionFunction(subsFunc SubstituteFunc) Option {\n\treturn func(cfg *Config) {\n\t\tcfg.substituteFunc = subsFunc\n\t}\n}\n\nfunc WithReplacementFunction(replacementFunc ReplacementFunc) Option {\n\treturn func(cfg *Config) {\n\t\tcfg.replacementFunc = replacementFunc\n\t}\n}\n\nfunc WithoutLogging(cfg *Config) {\n\tcfg.logging = false\n}\n\n// SubstituteWithOptions substitute variables in the string with their values.\n// It accepts additional options such as a custom function or pattern.\nfunc SubstituteWithOptions(template string, mapping Mapping, options ...Option) (string, error) {\n\tvar returnErr error\n\n\tcfg := &Config{\n\t\tpattern:         DefaultPattern,\n\t\treplacementFunc: DefaultReplacementFunc,\n\t\tlogging:         true,\n\t}\n\tfor _, o := range options {\n\t\to(cfg)\n\t}\n\n\tresult := cfg.pattern.ReplaceAllStringFunc(template, func(substring string) string {\n\t\treplacement, err := cfg.replacementFunc(substring, mapping, cfg)\n\t\tif err != nil {\n\t\t\t// Add the template for template errors\n\t\t\tvar tmplErr *InvalidTemplateError\n\t\t\tif errors.As(err, &tmplErr) {\n\t\t\t\tif tmplErr.Template == \"\" {\n\t\t\t\t\ttmplErr.Template = template\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Save the first error to be returned\n\t\t\tif returnErr == nil {\n\t\t\t\treturnErr = err\n\t\t\t}\n\n\t\t}\n\t\treturn replacement\n\t})\n\n\treturn result, returnErr\n}\n\nfunc DefaultReplacementFunc(substring string, mapping Mapping, cfg *Config) (string, error) {\n\tvalue, _, err := DefaultReplacementAppliedFunc(substring, mapping, cfg)\n\treturn value, err\n}\n\nfunc DefaultReplacementAppliedFunc(substring string, mapping Mapping, cfg *Config) (string, bool, error) {\n\tpattern := cfg.pattern\n\tsubsFunc := cfg.substituteFunc\n\tif subsFunc == nil {\n\t\t_, subsFunc = getSubstitutionFunctionForTemplate(substring)\n\t}\n\n\tclosingBraceIndex := getFirstBraceClosingIndex(substring)\n\trest := \"\"\n\tif closingBraceIndex > -1 {\n\t\trest = substring[closingBraceIndex+1:]\n\t\tsubstring = substring[0 : closingBraceIndex+1]\n\t}\n\n\tmatches := pattern.FindStringSubmatch(substring)\n\tgroups := matchGroups(matches, pattern)\n\tif escaped := groups[groupEscaped]; escaped != \"\" {\n\t\treturn escaped, true, nil\n\t}\n\n\tbraced := false\n\tsubstitution := groups[groupNamed]\n\tif substitution == \"\" {\n\t\tsubstitution = groups[groupBraced]\n\t\tbraced = true\n\t}\n\n\tif substitution == \"\" {\n\t\treturn \"\", false, &InvalidTemplateError{}\n\t}\n\n\tif braced {\n\t\tvalue, applied, err := subsFunc(substitution, mapping)\n\t\tif err != nil {\n\t\t\treturn \"\", false, err\n\t\t}\n\t\tif applied {\n\t\t\tinterpolatedNested, err := SubstituteWith(rest, mapping, pattern)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", false, err\n\t\t\t}\n\t\t\treturn value + interpolatedNested, true, nil\n\t\t}\n\t}\n\n\tvalue, ok := mapping(substitution)\n\tif !ok && cfg.logging {\n\t\tlogrus.Warnf(\"The %q variable is not set. Defaulting to a blank string.\", substitution)\n\t}\n\n\treturn value, ok, nil\n}\n\n// SubstituteWith substitute variables in the string with their values.\n// It accepts additional substitute function.\nfunc SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, subsFuncs ...SubstituteFunc) (string, error) {\n\toptions := []Option{\n\t\tWithPattern(pattern),\n\t}\n\tif len(subsFuncs) > 0 {\n\t\toptions = append(options, WithSubstitutionFunction(subsFuncs[0]))\n\t}\n\n\treturn SubstituteWithOptions(template, mapping, options...)\n}\n\nfunc getSubstitutionFunctionForTemplate(template string) (string, SubstituteFunc) {\n\tinterpolationMapping := []struct {\n\t\tstring\n\t\tSubstituteFunc\n\t}{\n\t\t{\":?\", requiredErrorWhenEmptyOrUnset},\n\t\t{\"?\", requiredErrorWhenUnset},\n\t\t{\":-\", defaultWhenEmptyOrUnset},\n\t\t{\"-\", defaultWhenUnset},\n\t\t{\":+\", defaultWhenNotEmpty},\n\t\t{\"+\", defaultWhenSet},\n\t}\n\tsort.Slice(interpolationMapping, func(i, j int) bool {\n\t\tidxI := strings.Index(template, interpolationMapping[i].string)\n\t\tidxJ := strings.Index(template, interpolationMapping[j].string)\n\t\tif idxI < 0 {\n\t\t\treturn false\n\t\t}\n\t\tif idxJ < 0 {\n\t\t\treturn true\n\t\t}\n\t\treturn idxI < idxJ\n\t})\n\n\treturn interpolationMapping[0].string, interpolationMapping[0].SubstituteFunc\n}\n\nfunc getFirstBraceClosingIndex(s string) int {\n\topenVariableBraces := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '}' {\n\t\t\topenVariableBraces--\n\t\t\tif openVariableBraces == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t\tif s[i] == '{' {\n\t\t\topenVariableBraces++\n\t\t\ti++\n\t\t}\n\t}\n\treturn -1\n}\n\n// Substitute variables in the string with their values\nfunc Substitute(template string, mapping Mapping) (string, error) {\n\treturn SubstituteWith(template, mapping, DefaultPattern)\n}\n\n// Soft default (fall back if unset or empty)\nfunc defaultWhenEmptyOrUnset(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withDefaultWhenAbsence(substitution, mapping, true)\n}\n\n// Hard default (fall back if-and-only-if empty)\nfunc defaultWhenUnset(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withDefaultWhenAbsence(substitution, mapping, false)\n}\n\nfunc defaultWhenNotEmpty(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withDefaultWhenPresence(substitution, mapping, true)\n}\n\nfunc defaultWhenSet(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withDefaultWhenPresence(substitution, mapping, false)\n}\n\nfunc requiredErrorWhenEmptyOrUnset(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withRequired(substitution, mapping, \":?\", func(v string) bool { return v != \"\" })\n}\n\nfunc requiredErrorWhenUnset(substitution string, mapping Mapping) (string, bool, error) {\n\treturn withRequired(substitution, mapping, \"?\", func(_ string) bool { return true })\n}\n\nfunc withDefaultWhenPresence(substitution string, mapping Mapping, notEmpty bool) (string, bool, error) {\n\tsep := \"+\"\n\tif notEmpty {\n\t\tsep = \":+\"\n\t}\n\tif !strings.Contains(substitution, sep) {\n\t\treturn \"\", false, nil\n\t}\n\tname, defaultValue := partition(substitution, sep)\n\tdefaultValue, err := Substitute(defaultValue, mapping)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tvalue, ok := mapping(name)\n\tif ok && (!notEmpty || (notEmpty && value != \"\")) {\n\t\treturn defaultValue, true, nil\n\t}\n\treturn value, true, nil\n}\n\nfunc withDefaultWhenAbsence(substitution string, mapping Mapping, emptyOrUnset bool) (string, bool, error) {\n\tsep := \"-\"\n\tif emptyOrUnset {\n\t\tsep = \":-\"\n\t}\n\tif !strings.Contains(substitution, sep) {\n\t\treturn \"\", false, nil\n\t}\n\tname, defaultValue := partition(substitution, sep)\n\tdefaultValue, err := Substitute(defaultValue, mapping)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tvalue, ok := mapping(name)\n\tif !ok || (emptyOrUnset && value == \"\") {\n\t\treturn defaultValue, true, nil\n\t}\n\treturn value, true, nil\n}\n\nfunc withRequired(substitution string, mapping Mapping, sep string, valid func(string) bool) (string, bool, error) {\n\tif !strings.Contains(substitution, sep) {\n\t\treturn \"\", false, nil\n\t}\n\tname, errorMessage := partition(substitution, sep)\n\terrorMessage, err := Substitute(errorMessage, mapping)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tvalue, ok := mapping(name)\n\tif !ok || !valid(value) {\n\t\treturn \"\", true, &MissingRequiredError{\n\t\t\tReason:   errorMessage,\n\t\t\tVariable: name,\n\t\t}\n\t}\n\treturn value, true, nil\n}\n\nfunc matchGroups(matches []string, pattern *regexp.Regexp) map[string]string {\n\tgroups := make(map[string]string)\n\tfor i, name := range pattern.SubexpNames()[1:] {\n\t\tgroups[name] = matches[i+1]\n\t}\n\treturn groups\n}\n\n// Split the string at the first occurrence of sep, and return the part before the separator,\n// and the part after the separator.\n//\n// If the separator is not found, return the string itself, followed by an empty string.\nfunc partition(s, sep string) (string, string) {\n\tif strings.Contains(s, sep) {\n\t\tparts := strings.SplitN(s, sep, 2)\n\t\treturn parts[0], parts[1]\n\t}\n\treturn s, \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/template/variables.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage template\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n)\n\ntype Variable struct {\n\tName          string\n\tDefaultValue  string\n\tPresenceValue string\n\tRequired      bool\n}\n\n// ExtractVariables returns a map of all the variables defined in the specified\n// compose file (dict representation) and their default value if any.\nfunc ExtractVariables(configDict map[string]interface{}, pattern *regexp.Regexp) map[string]Variable {\n\tif pattern == nil {\n\t\tpattern = DefaultPattern\n\t}\n\treturn recurseExtract(configDict, pattern)\n}\n\nfunc recurseExtract(value interface{}, pattern *regexp.Regexp) map[string]Variable {\n\tm := map[string]Variable{}\n\n\tswitch value := value.(type) {\n\tcase string:\n\t\tif values, is := extractVariable(value, pattern); is {\n\t\t\tfor _, v := range values {\n\t\t\t\tm[v.Name] = v\n\t\t\t}\n\t\t}\n\tcase map[string]interface{}:\n\t\tfor _, elem := range value {\n\t\t\tsubmap := recurseExtract(elem, pattern)\n\t\t\tfor key, value := range submap {\n\t\t\t\tm[key] = value\n\t\t\t}\n\t\t}\n\n\tcase []interface{}:\n\t\tfor _, elem := range value {\n\t\t\tif values, is := extractVariable(elem, pattern); is {\n\t\t\t\tfor _, v := range values {\n\t\t\t\t\tm[v.Name] = v\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn m\n}\n\nfunc extractVariable(value interface{}, pattern *regexp.Regexp) ([]Variable, bool) {\n\tsValue, ok := value.(string)\n\tif !ok {\n\t\treturn []Variable{}, false\n\t}\n\tmatches := pattern.FindAllStringSubmatch(sValue, -1)\n\tif len(matches) == 0 {\n\t\treturn []Variable{}, false\n\t}\n\tvalues := []Variable{}\n\tfor _, match := range matches {\n\t\tgroups := matchGroups(match, pattern)\n\t\tif escaped := groups[groupEscaped]; escaped != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tval := groups[groupNamed]\n\t\tif val == \"\" {\n\t\t\tval = groups[groupBraced]\n\t\t\ts := match[0]\n\t\t\ti := getFirstBraceClosingIndex(s)\n\t\t\tif i > 0 {\n\t\t\t\tval = s[2:i]\n\t\t\t\tif len(s) > i {\n\t\t\t\t\tif v, b := extractVariable(s[i+1:], pattern); b {\n\t\t\t\t\t\tvalues = append(values, v...)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tname := val\n\t\tvar defaultValue string\n\t\tvar presenceValue string\n\t\tvar required bool\n\t\ti := strings.IndexFunc(val, func(r rune) bool {\n\t\t\tif r >= 'a' && r <= 'z' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif r >= 'A' && r <= 'Z' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif r == '_' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\n\t\tif i > 0 {\n\t\t\tname = val[:i]\n\t\t\trest := val[i:]\n\t\t\tswitch {\n\t\t\tcase strings.HasPrefix(rest, \":?\"):\n\t\t\t\trequired = true\n\t\t\tcase strings.HasPrefix(rest, \"?\"):\n\t\t\t\trequired = true\n\t\t\tcase strings.HasPrefix(rest, \":-\"):\n\t\t\t\tdefaultValue = rest[2:]\n\t\t\tcase strings.HasPrefix(rest, \"-\"):\n\t\t\t\tdefaultValue = rest[1:]\n\t\t\tcase strings.HasPrefix(rest, \":+\"):\n\t\t\t\tpresenceValue = rest[2:]\n\t\t\tcase strings.HasPrefix(rest, \"+\"):\n\t\t\t\tpresenceValue = rest[1:]\n\t\t\t}\n\t\t}\n\n\t\tvalues = append(values, Variable{\n\t\t\tName:          name,\n\t\t\tDefaultValue:  defaultValue,\n\t\t\tPresenceValue: presenceValue,\n\t\t\tRequired:      required,\n\t\t})\n\n\t\tif defaultValue != \"\" {\n\t\t\tif v, b := extractVariable(defaultValue, pattern); b {\n\t\t\t\tvalues = append(values, v...)\n\t\t\t}\n\t\t}\n\t\tif presenceValue != \"\" {\n\t\t\tif v, b := extractVariable(presenceValue, pattern); b {\n\t\t\t\tvalues = append(values, v...)\n\t\t\t}\n\t\t}\n\t}\n\treturn values, len(values) > 0\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/build.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformBuild(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn transformMapping(v, p, ignoreParseError)\n\tcase string:\n\t\treturn map[string]any{\n\t\t\t\"context\": v,\n\t\t}, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for build\", p, v)\n\t}\n}\n\nfunc defaultBuildContext(data any, _ tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\tif _, ok := v[\"context\"]; !ok {\n\t\t\tv[\"context\"] = \".\"\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn data, nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/canonical.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\ntype transformFunc func(data any, p tree.Path, ignoreParseError bool) (any, error)\n\nvar transformers = map[tree.Path]transformFunc{}\n\nfunc init() {\n\ttransformers[\"services.*\"] = transformService\n\ttransformers[\"services.*.build.secrets.*\"] = transformFileMount\n\ttransformers[\"services.*.build.additional_contexts\"] = transformKeyValue\n\ttransformers[\"services.*.depends_on\"] = transformDependsOn\n\ttransformers[\"services.*.env_file\"] = transformEnvFile\n\ttransformers[\"services.*.extends\"] = transformExtends\n\ttransformers[\"services.*.networks\"] = transformServiceNetworks\n\ttransformers[\"services.*.volumes.*\"] = transformVolumeMount\n\ttransformers[\"services.*.devices.*\"] = transformDeviceMapping\n\ttransformers[\"services.*.secrets.*\"] = transformFileMount\n\ttransformers[\"services.*.configs.*\"] = transformFileMount\n\ttransformers[\"services.*.ports\"] = transformPorts\n\ttransformers[\"services.*.build\"] = transformBuild\n\ttransformers[\"services.*.build.ssh\"] = transformSSH\n\ttransformers[\"services.*.ulimits.*\"] = transformUlimits\n\ttransformers[\"services.*.build.ulimits.*\"] = transformUlimits\n\ttransformers[\"volumes.*\"] = transformMaybeExternal\n\ttransformers[\"networks.*\"] = transformMaybeExternal\n\ttransformers[\"secrets.*\"] = transformMaybeExternal\n\ttransformers[\"configs.*\"] = transformMaybeExternal\n\ttransformers[\"include.*\"] = transformInclude\n}\n\n// Canonical transforms a compose model into canonical syntax\nfunc Canonical(yaml map[string]any, ignoreParseError bool) (map[string]any, error) {\n\tcanonical, err := transform(yaml, tree.NewPath(), ignoreParseError)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn canonical.(map[string]any), nil\n}\n\nfunc transform(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tfor pattern, transformer := range transformers {\n\t\tif p.Matches(pattern) {\n\t\t\tt, err := transformer(data, p, ignoreParseError)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn t, nil\n\t\t}\n\t}\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\ta, err := transformMapping(v, p, ignoreParseError)\n\t\tif err != nil {\n\t\t\treturn a, err\n\t\t}\n\t\treturn v, nil\n\tcase []any:\n\t\ta, err := transformSequence(v, p, ignoreParseError)\n\t\tif err != nil {\n\t\t\treturn a, err\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn data, nil\n\t}\n}\n\nfunc transformSequence(v []any, p tree.Path, ignoreParseError bool) ([]any, error) {\n\tfor i, e := range v {\n\t\tt, err := transform(e, p.Next(\"[]\"), ignoreParseError)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv[i] = t\n\t}\n\treturn v, nil\n}\n\nfunc transformMapping(v map[string]any, p tree.Path, ignoreParseError bool) (map[string]any, error) {\n\tfor k, e := range v {\n\t\tt, err := transform(e, p.Next(k), ignoreParseError)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv[k] = t\n\t}\n\treturn v, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/defaults.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nvar defaultValues = map[tree.Path]transformFunc{}\n\nfunc init() {\n\tdefaultValues[\"services.*.build\"] = defaultBuildContext\n\tdefaultValues[\"services.*.secrets.*\"] = defaultSecretMount\n\tdefaultValues[\"services.*.ports.*\"] = portDefaults\n}\n\n// SetDefaultValues transforms a compose model to set default values to missing attributes\nfunc SetDefaultValues(yaml map[string]any) (map[string]any, error) {\n\tresult, err := setDefaults(yaml, tree.NewPath())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(map[string]any), nil\n}\n\nfunc setDefaults(data any, p tree.Path) (any, error) {\n\tfor pattern, transformer := range defaultValues {\n\t\tif p.Matches(pattern) {\n\t\t\tt, err := transformer(data, p, false)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn t, nil\n\t\t}\n\t}\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\ta, err := setDefaultsMapping(v, p)\n\t\tif err != nil {\n\t\t\treturn a, err\n\t\t}\n\t\treturn v, nil\n\tcase []any:\n\t\ta, err := setDefaultsSequence(v, p)\n\t\tif err != nil {\n\t\t\treturn a, err\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn data, nil\n\t}\n}\n\nfunc setDefaultsSequence(v []any, p tree.Path) ([]any, error) {\n\tfor i, e := range v {\n\t\tt, err := setDefaults(e, p.Next(\"[]\"))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv[i] = t\n\t}\n\treturn v, nil\n}\n\nfunc setDefaultsMapping(v map[string]any, p tree.Path) (map[string]any, error) {\n\tfor k, e := range v {\n\t\tt, err := setDefaults(e, p.Next(k))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv[k] = t\n\t}\n\treturn v, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/dependson.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformDependsOn(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\tfor i, e := range v {\n\t\t\td, ok := e.(map[string]any)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"%s.%s: unsupported value %s\", p, i, v)\n\t\t\t}\n\t\t\tif _, ok := d[\"condition\"]; !ok {\n\t\t\t\td[\"condition\"] = \"service_started\"\n\t\t\t}\n\t\t\tif _, ok := d[\"required\"]; !ok {\n\t\t\t\td[\"required\"] = true\n\t\t\t}\n\t\t}\n\t\treturn v, nil\n\tcase []any:\n\t\td := map[string]any{}\n\t\tfor _, k := range v {\n\t\t\td[k.(string)] = map[string]any{\n\t\t\t\t\"condition\": \"service_started\",\n\t\t\t\t\"required\":  true,\n\t\t\t}\n\t\t}\n\t\treturn d, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for depend_on\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/device.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformDeviceMapping(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase string:\n\t\tsrc := \"\"\n\t\tdst := \"\"\n\t\tpermissions := \"rwm\"\n\t\tarr := strings.Split(v, \":\")\n\t\tswitch len(arr) {\n\t\tcase 3:\n\t\t\tpermissions = arr[2]\n\t\t\tfallthrough\n\t\tcase 2:\n\t\t\tdst = arr[1]\n\t\t\tfallthrough\n\t\tcase 1:\n\t\t\tsrc = arr[0]\n\t\tdefault:\n\t\t\tif !ignoreParseError {\n\t\t\t\treturn nil, fmt.Errorf(\"confusing device mapping, please use long syntax: %s\", v)\n\t\t\t}\n\t\t}\n\t\tif dst == \"\" {\n\t\t\tdst = src\n\t\t}\n\t\treturn map[string]any{\n\t\t\t\"source\":      src,\n\t\t\t\"target\":      dst,\n\t\t\t\"permissions\": permissions,\n\t\t}, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for service volume mount\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/envfile.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformEnvFile(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase string:\n\t\treturn []any{\n\t\t\ttransformEnvFileValue(v),\n\t\t}, nil\n\tcase []any:\n\t\tfor i, e := range v {\n\t\t\tv[i] = transformEnvFileValue(e)\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: invalid type %T for env_file\", p, v)\n\t}\n}\n\nfunc transformEnvFileValue(data any) any {\n\tswitch v := data.(type) {\n\tcase string:\n\t\treturn map[string]any{\n\t\t\t\"path\":     v,\n\t\t\t\"required\": true,\n\t\t}\n\tcase map[string]any:\n\t\tif _, ok := v[\"required\"]; !ok {\n\t\t\tv[\"required\"] = true\n\t\t}\n\t\treturn v\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/extends.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformExtends(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn transformMapping(v, p, ignoreParseError)\n\tcase string:\n\t\treturn map[string]any{\n\t\t\t\"service\": v,\n\t\t}, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for extends\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/external.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc transformMaybeExternal(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tif data == nil {\n\t\treturn nil, nil\n\t}\n\tresource, err := transformMapping(data.(map[string]any), p, ignoreParseError)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif ext, ok := resource[\"external\"]; ok {\n\t\tname, named := resource[\"name\"]\n\t\tif external, ok := ext.(map[string]any); ok {\n\t\t\tresource[\"external\"] = true\n\t\t\tif extname, extNamed := external[\"name\"]; extNamed {\n\t\t\t\tlogrus.Warnf(\"%s: external.name is deprecated. Please set name and external: true\", p)\n\t\t\t\tif named && extname != name {\n\t\t\t\t\treturn nil, fmt.Errorf(\"%s: name and external.name conflict; only use name\", p)\n\t\t\t\t}\n\t\t\t\tif !named {\n\t\t\t\t\t// adopt (deprecated) external.name if set\n\t\t\t\t\tresource[\"name\"] = extname\n\t\t\t\t\treturn resource, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn resource, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/include.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformInclude(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase string:\n\t\treturn map[string]any{\n\t\t\t\"path\": v,\n\t\t}, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for external\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/mapping.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformKeyValue(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase []any:\n\t\tmapping := map[string]any{}\n\t\tfor _, e := range v {\n\t\t\tbefore, after, found := strings.Cut(e.(string), \"=\")\n\t\t\tif !found {\n\t\t\t\tif ignoreParseError {\n\t\t\t\t\treturn data, nil\n\t\t\t\t}\n\t\t\t\treturn nil, fmt.Errorf(\"%s: invalid value %s, expected key=value\", p, e)\n\t\t\t}\n\t\t\tmapping[before] = after\n\t\t}\n\t\treturn mapping, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: invalid type %T\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/ports.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n\t\"github.com/compose-spec/compose-go/v2/types\"\n\t\"github.com/go-viper/mapstructure/v2\"\n)\n\nfunc transformPorts(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch entries := data.(type) {\n\tcase []any:\n\t\t// We process the list instead of individual items here.\n\t\t// The reason is that one entry might be mapped to multiple ServicePortConfig.\n\t\t// Therefore we take an input of a list and return an output of a list.\n\t\tvar ports []any\n\t\tfor _, entry := range entries {\n\t\t\tswitch value := entry.(type) {\n\t\t\tcase int:\n\t\t\t\tparsed, err := types.ParsePortConfig(fmt.Sprint(value))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn data, err\n\t\t\t\t}\n\t\t\t\tfor _, v := range parsed {\n\t\t\t\t\tm, err := encode(v)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tports = append(ports, m)\n\t\t\t\t}\n\t\t\tcase string:\n\t\t\t\tparsed, err := types.ParsePortConfig(value)\n\t\t\t\tif err != nil {\n\t\t\t\t\tif ignoreParseError {\n\t\t\t\t\t\treturn data, nil\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tfor _, v := range parsed {\n\t\t\t\t\tm, err := encode(v)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tports = append(ports, m)\n\t\t\t\t}\n\t\t\tcase map[string]any:\n\t\t\t\tports = append(ports, value)\n\t\t\tdefault:\n\t\t\t\treturn data, fmt.Errorf(\"%s: invalid type %T for port\", p, value)\n\t\t\t}\n\t\t}\n\t\treturn ports, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for port\", p, entries)\n\t}\n}\n\nfunc encode(v any) (map[string]any, error) {\n\tm := map[string]any{}\n\tdecoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{\n\t\tResult:  &m,\n\t\tTagName: \"yaml\",\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = decoder.Decode(v)\n\treturn m, err\n}\n\nfunc portDefaults(data any, _ tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\tif _, ok := v[\"protocol\"]; !ok {\n\t\t\tv[\"protocol\"] = \"tcp\"\n\t\t}\n\t\tif _, ok := v[\"mode\"]; !ok {\n\t\t\tv[\"mode\"] = \"ingress\"\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn data, nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/secrets.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformFileMount(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn data, nil\n\tcase string:\n\t\treturn map[string]any{\n\t\t\t\"source\": v,\n\t\t}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: unsupported type %T\", p, data)\n\t}\n}\n\nfunc defaultSecretMount(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\tsource := v[\"source\"]\n\t\tif _, ok := v[\"target\"]; !ok {\n\t\t\tv[\"target\"] = fmt.Sprintf(\"/run/secrets/%s\", source)\n\t\t}\n\t\treturn v, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: unsupported type %T\", p, data)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/services.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformService(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch value := data.(type) {\n\tcase map[string]any:\n\t\treturn transformMapping(value, p, ignoreParseError)\n\tdefault:\n\t\treturn value, nil\n\t}\n}\n\nfunc transformServiceNetworks(data any, _ tree.Path, _ bool) (any, error) {\n\tif slice, ok := data.([]any); ok {\n\t\tnetworks := make(map[string]any, len(slice))\n\t\tfor _, net := range slice {\n\t\t\tnetworks[net.(string)] = nil\n\t\t}\n\t\treturn networks, nil\n\t}\n\treturn data, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/ssh.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformSSH(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase []any:\n\t\tresult := make(map[string]any, len(v))\n\t\tfor _, e := range v {\n\t\t\ts, ok := e.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid ssh key type %T\", e)\n\t\t\t}\n\t\t\tid, path, ok := strings.Cut(s, \"=\")\n\t\t\tif !ok {\n\t\t\t\tif id != \"default\" {\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid ssh key %q\", s)\n\t\t\t\t}\n\t\t\t\tresult[id] = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult[id] = path\n\t\t}\n\t\treturn result, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for ssh\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/ulimits.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformUlimits(data any, p tree.Path, _ bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase int:\n\t\treturn v, nil\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for external\", p, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/transform/volume.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage transform\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\n\t\"github.com/compose-spec/compose-go/v2/format\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc transformVolumeMount(data any, p tree.Path, ignoreParseError bool) (any, error) {\n\tswitch v := data.(type) {\n\tcase map[string]any:\n\t\treturn v, nil\n\tcase string:\n\t\tvolume, err := format.ParseVolume(v) // TODO(ndeloof) ParseVolume should not rely on types and return map[string]\n\t\tif err != nil {\n\t\t\tif ignoreParseError {\n\t\t\t\treturn v, nil\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tvolume.Target = cleanTarget(volume.Target)\n\n\t\treturn encode(volume)\n\tdefault:\n\t\treturn data, fmt.Errorf(\"%s: invalid type %T for service volume mount\", p, v)\n\t}\n}\n\nfunc cleanTarget(target string) string {\n\tif target == \"\" {\n\t\treturn \"\"\n\t}\n\treturn path.Clean(target)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/tree/path.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage tree\n\nimport (\n\t\"strings\"\n)\n\nconst pathSeparator = \".\"\n\n// PathMatchAll is a token used as part of a Path to match any key at that level\n// in the nested structure\nconst PathMatchAll = \"*\"\n\n// PathMatchList is a token used as part of a Path to match items in a list\nconst PathMatchList = \"[]\"\n\n// Path is a dotted path of keys to a value in a nested mapping structure. A *\n// section in a path will match any key in the mapping structure.\ntype Path string\n\n// NewPath returns a new Path\nfunc NewPath(items ...string) Path {\n\treturn Path(strings.Join(items, pathSeparator))\n}\n\n// Next returns a new path by append part to the current path\nfunc (p Path) Next(part string) Path {\n\tif p == \"\" {\n\t\treturn Path(part)\n\t}\n\tpart = strings.ReplaceAll(part, pathSeparator, \"👻\")\n\treturn Path(string(p) + pathSeparator + part)\n}\n\nfunc (p Path) Parts() []string {\n\treturn strings.Split(string(p), pathSeparator)\n}\n\nfunc (p Path) Matches(pattern Path) bool {\n\tpatternParts := pattern.Parts()\n\tparts := p.Parts()\n\n\tif len(patternParts) != len(parts) {\n\t\treturn false\n\t}\n\tfor index, part := range parts {\n\t\tswitch patternParts[index] {\n\t\tcase PathMatchAll, part:\n\t\t\tcontinue\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (p Path) Last() string {\n\tparts := p.Parts()\n\treturn parts[len(parts)-1]\n}\n\nfunc (p Path) Parent() Path {\n\tindex := strings.LastIndex(string(p), pathSeparator)\n\tif index > 0 {\n\t\treturn p[0:index]\n\t}\n\treturn \"\"\n}\n\nfunc (p Path) String() string {\n\treturn strings.ReplaceAll(string(p), \"👻\", pathSeparator)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/bytes.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/go-units\"\n)\n\n// UnitBytes is the bytes type\ntype UnitBytes int64\n\n// MarshalYAML makes UnitBytes implement yaml.Marshaller\nfunc (u UnitBytes) MarshalYAML() (interface{}, error) {\n\treturn fmt.Sprintf(\"%d\", u), nil\n}\n\n// MarshalJSON makes UnitBytes implement json.Marshaler\nfunc (u UnitBytes) MarshalJSON() ([]byte, error) {\n\treturn []byte(fmt.Sprintf(`\"%d\"`, u)), nil\n}\n\nfunc (u *UnitBytes) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase int:\n\t\t*u = UnitBytes(v)\n\tcase string:\n\t\tb, err := units.RAMInBytes(fmt.Sprint(value))\n\t\t*u = UnitBytes(b)\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/command.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport \"github.com/mattn/go-shellwords\"\n\n// ShellCommand is a string or list of string args.\n//\n// When marshaled to YAML, nil command fields will be omitted if `omitempty`\n// is specified as a struct tag. Explicitly empty commands (i.e. `[]` or\n// empty string will serialize to an empty array (`[]`).\n//\n// When marshaled to JSON, the `omitempty` struct must NOT be specified.\n// If the command field is nil, it will be serialized as `null`.\n// Explicitly empty commands (i.e. `[]` or empty string) will serialize to\n// an empty array (`[]`).\n//\n// The distinction between nil and explicitly empty is important to distinguish\n// between an unset value and a provided, but empty, value, which should be\n// preserved so that it can override any base value (e.g. container entrypoint).\n//\n// The different semantics between YAML and JSON are due to limitations with\n// JSON marshaling + `omitempty` in the Go stdlib, while gopkg.in/yaml.v3 gives\n// us more flexibility via the yaml.IsZeroer interface.\n//\n// In the future, it might make sense to make fields of this type be\n// `*ShellCommand` to avoid this situation, but that would constitute a\n// breaking change.\ntype ShellCommand []string\n\n// IsZero returns true if the slice is nil.\n//\n// Empty (but non-nil) slices are NOT considered zero values.\nfunc (s ShellCommand) IsZero() bool {\n\t// we do NOT want len(s) == 0, ONLY explicitly nil\n\treturn s == nil\n}\n\n// MarshalYAML returns nil (which will be serialized as `null`) for nil slices\n// and delegates to the standard marshaller behavior otherwise.\n//\n// NOTE: Typically the nil case here is not hit because IsZero has already\n// short-circuited marshalling, but this ensures that the type serializes\n// accurately if the `omitempty` struct tag is omitted/forgotten.\n//\n// A similar MarshalJSON() implementation is not needed because the Go stdlib\n// already serializes nil slices to `null`, whereas gopkg.in/yaml.v3 by default\n// serializes nil slices to `[]`.\nfunc (s ShellCommand) MarshalYAML() (interface{}, error) {\n\tif s == nil {\n\t\treturn nil, nil\n\t}\n\treturn []string(s), nil\n}\n\nfunc (s *ShellCommand) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase string:\n\t\tcmd, err := shellwords.Parse(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*s = cmd\n\tcase []interface{}:\n\t\tcmd := make([]string, len(v))\n\t\tfor i, s := range v {\n\t\t\tcmd[i] = s.(string)\n\t\t}\n\t\t*s = cmd\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/config.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/go-viper/mapstructure/v2\"\n)\n\nvar (\n\t// isCaseInsensitiveEnvVars is true on platforms where environment variable names are treated case-insensitively.\n\tisCaseInsensitiveEnvVars = (runtime.GOOS == \"windows\")\n)\n\n// ConfigDetails are the details about a group of ConfigFiles\ntype ConfigDetails struct {\n\tVersion     string\n\tWorkingDir  string\n\tConfigFiles []ConfigFile\n\tEnvironment Mapping\n}\n\n// LookupEnv provides a lookup function for environment variables\nfunc (cd *ConfigDetails) LookupEnv(key string) (string, bool) {\n\tv, ok := cd.Environment[key]\n\tif !isCaseInsensitiveEnvVars || ok {\n\t\treturn v, ok\n\t}\n\t// variable names must be treated case-insensitively on some platforms (that is, Windows).\n\t// Resolves in this way:\n\t// * Return the value if its name matches with the passed name case-sensitively.\n\t// * Otherwise, return the value if its lower-cased name matches lower-cased passed name.\n\t//     * The value is indefinite if multiple variables match.\n\tlowerKey := strings.ToLower(key)\n\tfor k, v := range cd.Environment {\n\t\tif strings.ToLower(k) == lowerKey {\n\t\t\treturn v, true\n\t\t}\n\t}\n\treturn \"\", false\n}\n\n// ConfigFile is a filename and the contents of the file as a Dict\ntype ConfigFile struct {\n\t// Filename is the name of the yaml configuration file\n\tFilename string\n\t// Content is the raw yaml content. Will be loaded from Filename if not set\n\tContent []byte\n\t// Config if the yaml tree for this config file. Will be parsed from Content if not set\n\tConfig map[string]interface{}\n}\n\nfunc ToConfigFiles(path []string) (f []ConfigFile) {\n\tfor _, p := range path {\n\t\tf = append(f, ConfigFile{Filename: p})\n\t}\n\treturn\n}\n\n// Config is a full compose file configuration and model\ntype Config struct {\n\tFilename   string          `yaml:\"-\" json:\"-\"`\n\tName       string          `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tServices   Services        `yaml:\"services\" json:\"services\"`\n\tNetworks   Networks        `yaml:\"networks,omitempty\" json:\"networks,omitempty\"`\n\tVolumes    Volumes         `yaml:\"volumes,omitempty\" json:\"volumes,omitempty\"`\n\tSecrets    Secrets         `yaml:\"secrets,omitempty\" json:\"secrets,omitempty\"`\n\tConfigs    Configs         `yaml:\"configs,omitempty\" json:\"configs,omitempty\"`\n\tExtensions Extensions      `yaml:\",inline\" json:\"-\"`\n\tInclude    []IncludeConfig `yaml:\"include,omitempty\" json:\"include,omitempty\"`\n}\n\n// Volumes is a map of VolumeConfig\ntype Volumes map[string]VolumeConfig\n\n// Networks is a map of NetworkConfig\ntype Networks map[string]NetworkConfig\n\n// Secrets is a map of SecretConfig\ntype Secrets map[string]SecretConfig\n\n// Configs is a map of ConfigObjConfig\ntype Configs map[string]ConfigObjConfig\n\n// Extensions is a map of custom extension\ntype Extensions map[string]any\n\nfunc (e Extensions) DeepCopy(t Extensions) {\n\tfor k, v := range e {\n\t\tt[k] = v\n\t}\n}\n\n// MarshalJSON makes Config implement json.Marshaler\nfunc (c Config) MarshalJSON() ([]byte, error) {\n\tm := map[string]interface{}{\n\t\t\"services\": c.Services,\n\t}\n\n\tif len(c.Networks) > 0 {\n\t\tm[\"networks\"] = c.Networks\n\t}\n\tif len(c.Volumes) > 0 {\n\t\tm[\"volumes\"] = c.Volumes\n\t}\n\tif len(c.Secrets) > 0 {\n\t\tm[\"secrets\"] = c.Secrets\n\t}\n\tif len(c.Configs) > 0 {\n\t\tm[\"configs\"] = c.Configs\n\t}\n\tfor k, v := range c.Extensions {\n\t\tm[k] = v\n\t}\n\treturn json.Marshal(m)\n}\n\nfunc (e Extensions) Get(name string, target interface{}) (bool, error) {\n\tif v, ok := e[name]; ok {\n\t\terr := mapstructure.Decode(v, target)\n\t\treturn true, err\n\t}\n\treturn false, nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go",
    "content": "// Code generated by goderive DO NOT EDIT.\n\npackage types\n\n// deriveDeepCopyProject recursively copies the contents of src into dst.\nfunc deriveDeepCopyProject(dst, src *Project) {\n\tdst.Name = src.Name\n\tdst.WorkingDir = src.WorkingDir\n\tif src.Services != nil {\n\t\tdst.Services = make(map[string]ServiceConfig, len(src.Services))\n\t\tderiveDeepCopy(dst.Services, src.Services)\n\t} else {\n\t\tdst.Services = nil\n\t}\n\tif src.Networks != nil {\n\t\tdst.Networks = make(map[string]NetworkConfig, len(src.Networks))\n\t\tderiveDeepCopy_(dst.Networks, src.Networks)\n\t} else {\n\t\tdst.Networks = nil\n\t}\n\tif src.Volumes != nil {\n\t\tdst.Volumes = make(map[string]VolumeConfig, len(src.Volumes))\n\t\tderiveDeepCopy_1(dst.Volumes, src.Volumes)\n\t} else {\n\t\tdst.Volumes = nil\n\t}\n\tif src.Secrets != nil {\n\t\tdst.Secrets = make(map[string]SecretConfig, len(src.Secrets))\n\t\tderiveDeepCopy_2(dst.Secrets, src.Secrets)\n\t} else {\n\t\tdst.Secrets = nil\n\t}\n\tif src.Configs != nil {\n\t\tdst.Configs = make(map[string]ConfigObjConfig, len(src.Configs))\n\t\tderiveDeepCopy_3(dst.Configs, src.Configs)\n\t} else {\n\t\tdst.Configs = nil\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n\tif src.ComposeFiles == nil {\n\t\tdst.ComposeFiles = nil\n\t} else {\n\t\tif dst.ComposeFiles != nil {\n\t\t\tif len(src.ComposeFiles) > len(dst.ComposeFiles) {\n\t\t\t\tif cap(dst.ComposeFiles) >= len(src.ComposeFiles) {\n\t\t\t\t\tdst.ComposeFiles = (dst.ComposeFiles)[:len(src.ComposeFiles)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.ComposeFiles = make([]string, len(src.ComposeFiles))\n\t\t\t\t}\n\t\t\t} else if len(src.ComposeFiles) < len(dst.ComposeFiles) {\n\t\t\t\tdst.ComposeFiles = (dst.ComposeFiles)[:len(src.ComposeFiles)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.ComposeFiles = make([]string, len(src.ComposeFiles))\n\t\t}\n\t\tcopy(dst.ComposeFiles, src.ComposeFiles)\n\t}\n\tif src.Environment != nil {\n\t\tdst.Environment = make(map[string]string, len(src.Environment))\n\t\tderiveDeepCopy_4(dst.Environment, src.Environment)\n\t} else {\n\t\tdst.Environment = nil\n\t}\n\tif src.DisabledServices != nil {\n\t\tdst.DisabledServices = make(map[string]ServiceConfig, len(src.DisabledServices))\n\t\tderiveDeepCopy(dst.DisabledServices, src.DisabledServices)\n\t} else {\n\t\tdst.DisabledServices = nil\n\t}\n\tif src.Profiles == nil {\n\t\tdst.Profiles = nil\n\t} else {\n\t\tif dst.Profiles != nil {\n\t\t\tif len(src.Profiles) > len(dst.Profiles) {\n\t\t\t\tif cap(dst.Profiles) >= len(src.Profiles) {\n\t\t\t\t\tdst.Profiles = (dst.Profiles)[:len(src.Profiles)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Profiles = make([]string, len(src.Profiles))\n\t\t\t\t}\n\t\t\t} else if len(src.Profiles) < len(dst.Profiles) {\n\t\t\t\tdst.Profiles = (dst.Profiles)[:len(src.Profiles)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Profiles = make([]string, len(src.Profiles))\n\t\t}\n\t\tcopy(dst.Profiles, src.Profiles)\n\t}\n}\n\n// deriveDeepCopyService recursively copies the contents of src into dst.\nfunc deriveDeepCopyService(dst, src *ServiceConfig) {\n\tdst.Name = src.Name\n\tif src.Profiles == nil {\n\t\tdst.Profiles = nil\n\t} else {\n\t\tif dst.Profiles != nil {\n\t\t\tif len(src.Profiles) > len(dst.Profiles) {\n\t\t\t\tif cap(dst.Profiles) >= len(src.Profiles) {\n\t\t\t\t\tdst.Profiles = (dst.Profiles)[:len(src.Profiles)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Profiles = make([]string, len(src.Profiles))\n\t\t\t\t}\n\t\t\t} else if len(src.Profiles) < len(dst.Profiles) {\n\t\t\t\tdst.Profiles = (dst.Profiles)[:len(src.Profiles)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Profiles = make([]string, len(src.Profiles))\n\t\t}\n\t\tcopy(dst.Profiles, src.Profiles)\n\t}\n\tif src.Annotations != nil {\n\t\tdst.Annotations = make(map[string]string, len(src.Annotations))\n\t\tderiveDeepCopy_4(dst.Annotations, src.Annotations)\n\t} else {\n\t\tdst.Annotations = nil\n\t}\n\tif src.Attach == nil {\n\t\tdst.Attach = nil\n\t} else {\n\t\tdst.Attach = new(bool)\n\t\t*dst.Attach = *src.Attach\n\t}\n\tif src.Build == nil {\n\t\tdst.Build = nil\n\t} else {\n\t\tdst.Build = new(BuildConfig)\n\t\tderiveDeepCopy_5(dst.Build, src.Build)\n\t}\n\tif src.Develop == nil {\n\t\tdst.Develop = nil\n\t} else {\n\t\tdst.Develop = new(DevelopConfig)\n\t\tderiveDeepCopy_6(dst.Develop, src.Develop)\n\t}\n\tif src.BlkioConfig == nil {\n\t\tdst.BlkioConfig = nil\n\t} else {\n\t\tdst.BlkioConfig = new(BlkioConfig)\n\t\tderiveDeepCopy_7(dst.BlkioConfig, src.BlkioConfig)\n\t}\n\tif src.CapAdd == nil {\n\t\tdst.CapAdd = nil\n\t} else {\n\t\tif dst.CapAdd != nil {\n\t\t\tif len(src.CapAdd) > len(dst.CapAdd) {\n\t\t\t\tif cap(dst.CapAdd) >= len(src.CapAdd) {\n\t\t\t\t\tdst.CapAdd = (dst.CapAdd)[:len(src.CapAdd)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.CapAdd = make([]string, len(src.CapAdd))\n\t\t\t\t}\n\t\t\t} else if len(src.CapAdd) < len(dst.CapAdd) {\n\t\t\t\tdst.CapAdd = (dst.CapAdd)[:len(src.CapAdd)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.CapAdd = make([]string, len(src.CapAdd))\n\t\t}\n\t\tcopy(dst.CapAdd, src.CapAdd)\n\t}\n\tif src.CapDrop == nil {\n\t\tdst.CapDrop = nil\n\t} else {\n\t\tif dst.CapDrop != nil {\n\t\t\tif len(src.CapDrop) > len(dst.CapDrop) {\n\t\t\t\tif cap(dst.CapDrop) >= len(src.CapDrop) {\n\t\t\t\t\tdst.CapDrop = (dst.CapDrop)[:len(src.CapDrop)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.CapDrop = make([]string, len(src.CapDrop))\n\t\t\t\t}\n\t\t\t} else if len(src.CapDrop) < len(dst.CapDrop) {\n\t\t\t\tdst.CapDrop = (dst.CapDrop)[:len(src.CapDrop)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.CapDrop = make([]string, len(src.CapDrop))\n\t\t}\n\t\tcopy(dst.CapDrop, src.CapDrop)\n\t}\n\tdst.CgroupParent = src.CgroupParent\n\tdst.Cgroup = src.Cgroup\n\tdst.CPUCount = src.CPUCount\n\tdst.CPUPercent = src.CPUPercent\n\tdst.CPUPeriod = src.CPUPeriod\n\tdst.CPUQuota = src.CPUQuota\n\tdst.CPURTPeriod = src.CPURTPeriod\n\tdst.CPURTRuntime = src.CPURTRuntime\n\tdst.CPUS = src.CPUS\n\tdst.CPUSet = src.CPUSet\n\tdst.CPUShares = src.CPUShares\n\tif src.Command == nil {\n\t\tdst.Command = nil\n\t} else {\n\t\tif dst.Command != nil {\n\t\t\tif len(src.Command) > len(dst.Command) {\n\t\t\t\tif cap(dst.Command) >= len(src.Command) {\n\t\t\t\t\tdst.Command = (dst.Command)[:len(src.Command)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Command = make([]string, len(src.Command))\n\t\t\t\t}\n\t\t\t} else if len(src.Command) < len(dst.Command) {\n\t\t\t\tdst.Command = (dst.Command)[:len(src.Command)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Command = make([]string, len(src.Command))\n\t\t}\n\t\tcopy(dst.Command, src.Command)\n\t}\n\tif src.Configs == nil {\n\t\tdst.Configs = nil\n\t} else {\n\t\tif dst.Configs != nil {\n\t\t\tif len(src.Configs) > len(dst.Configs) {\n\t\t\t\tif cap(dst.Configs) >= len(src.Configs) {\n\t\t\t\t\tdst.Configs = (dst.Configs)[:len(src.Configs)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Configs = make([]ServiceConfigObjConfig, len(src.Configs))\n\t\t\t\t}\n\t\t\t} else if len(src.Configs) < len(dst.Configs) {\n\t\t\t\tdst.Configs = (dst.Configs)[:len(src.Configs)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Configs = make([]ServiceConfigObjConfig, len(src.Configs))\n\t\t}\n\t\tderiveDeepCopy_8(dst.Configs, src.Configs)\n\t}\n\tdst.ContainerName = src.ContainerName\n\tif src.CredentialSpec == nil {\n\t\tdst.CredentialSpec = nil\n\t} else {\n\t\tdst.CredentialSpec = new(CredentialSpecConfig)\n\t\tderiveDeepCopy_9(dst.CredentialSpec, src.CredentialSpec)\n\t}\n\tif src.DependsOn != nil {\n\t\tdst.DependsOn = make(map[string]ServiceDependency, len(src.DependsOn))\n\t\tderiveDeepCopy_10(dst.DependsOn, src.DependsOn)\n\t} else {\n\t\tdst.DependsOn = nil\n\t}\n\tif src.Deploy == nil {\n\t\tdst.Deploy = nil\n\t} else {\n\t\tdst.Deploy = new(DeployConfig)\n\t\tderiveDeepCopy_11(dst.Deploy, src.Deploy)\n\t}\n\tif src.DeviceCgroupRules == nil {\n\t\tdst.DeviceCgroupRules = nil\n\t} else {\n\t\tif dst.DeviceCgroupRules != nil {\n\t\t\tif len(src.DeviceCgroupRules) > len(dst.DeviceCgroupRules) {\n\t\t\t\tif cap(dst.DeviceCgroupRules) >= len(src.DeviceCgroupRules) {\n\t\t\t\t\tdst.DeviceCgroupRules = (dst.DeviceCgroupRules)[:len(src.DeviceCgroupRules)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DeviceCgroupRules = make([]string, len(src.DeviceCgroupRules))\n\t\t\t\t}\n\t\t\t} else if len(src.DeviceCgroupRules) < len(dst.DeviceCgroupRules) {\n\t\t\t\tdst.DeviceCgroupRules = (dst.DeviceCgroupRules)[:len(src.DeviceCgroupRules)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DeviceCgroupRules = make([]string, len(src.DeviceCgroupRules))\n\t\t}\n\t\tcopy(dst.DeviceCgroupRules, src.DeviceCgroupRules)\n\t}\n\tif src.Devices == nil {\n\t\tdst.Devices = nil\n\t} else {\n\t\tif dst.Devices != nil {\n\t\t\tif len(src.Devices) > len(dst.Devices) {\n\t\t\t\tif cap(dst.Devices) >= len(src.Devices) {\n\t\t\t\t\tdst.Devices = (dst.Devices)[:len(src.Devices)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Devices = make([]DeviceMapping, len(src.Devices))\n\t\t\t\t}\n\t\t\t} else if len(src.Devices) < len(dst.Devices) {\n\t\t\t\tdst.Devices = (dst.Devices)[:len(src.Devices)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Devices = make([]DeviceMapping, len(src.Devices))\n\t\t}\n\t\tcopy(dst.Devices, src.Devices)\n\t}\n\tif src.DNS == nil {\n\t\tdst.DNS = nil\n\t} else {\n\t\tif dst.DNS != nil {\n\t\t\tif len(src.DNS) > len(dst.DNS) {\n\t\t\t\tif cap(dst.DNS) >= len(src.DNS) {\n\t\t\t\t\tdst.DNS = (dst.DNS)[:len(src.DNS)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DNS = make([]string, len(src.DNS))\n\t\t\t\t}\n\t\t\t} else if len(src.DNS) < len(dst.DNS) {\n\t\t\t\tdst.DNS = (dst.DNS)[:len(src.DNS)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DNS = make([]string, len(src.DNS))\n\t\t}\n\t\tcopy(dst.DNS, src.DNS)\n\t}\n\tif src.DNSOpts == nil {\n\t\tdst.DNSOpts = nil\n\t} else {\n\t\tif dst.DNSOpts != nil {\n\t\t\tif len(src.DNSOpts) > len(dst.DNSOpts) {\n\t\t\t\tif cap(dst.DNSOpts) >= len(src.DNSOpts) {\n\t\t\t\t\tdst.DNSOpts = (dst.DNSOpts)[:len(src.DNSOpts)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DNSOpts = make([]string, len(src.DNSOpts))\n\t\t\t\t}\n\t\t\t} else if len(src.DNSOpts) < len(dst.DNSOpts) {\n\t\t\t\tdst.DNSOpts = (dst.DNSOpts)[:len(src.DNSOpts)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DNSOpts = make([]string, len(src.DNSOpts))\n\t\t}\n\t\tcopy(dst.DNSOpts, src.DNSOpts)\n\t}\n\tif src.DNSSearch == nil {\n\t\tdst.DNSSearch = nil\n\t} else {\n\t\tif dst.DNSSearch != nil {\n\t\t\tif len(src.DNSSearch) > len(dst.DNSSearch) {\n\t\t\t\tif cap(dst.DNSSearch) >= len(src.DNSSearch) {\n\t\t\t\t\tdst.DNSSearch = (dst.DNSSearch)[:len(src.DNSSearch)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DNSSearch = make([]string, len(src.DNSSearch))\n\t\t\t\t}\n\t\t\t} else if len(src.DNSSearch) < len(dst.DNSSearch) {\n\t\t\t\tdst.DNSSearch = (dst.DNSSearch)[:len(src.DNSSearch)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DNSSearch = make([]string, len(src.DNSSearch))\n\t\t}\n\t\tcopy(dst.DNSSearch, src.DNSSearch)\n\t}\n\tdst.Dockerfile = src.Dockerfile\n\tdst.DomainName = src.DomainName\n\tif src.Entrypoint == nil {\n\t\tdst.Entrypoint = nil\n\t} else {\n\t\tif dst.Entrypoint != nil {\n\t\t\tif len(src.Entrypoint) > len(dst.Entrypoint) {\n\t\t\t\tif cap(dst.Entrypoint) >= len(src.Entrypoint) {\n\t\t\t\t\tdst.Entrypoint = (dst.Entrypoint)[:len(src.Entrypoint)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Entrypoint = make([]string, len(src.Entrypoint))\n\t\t\t\t}\n\t\t\t} else if len(src.Entrypoint) < len(dst.Entrypoint) {\n\t\t\t\tdst.Entrypoint = (dst.Entrypoint)[:len(src.Entrypoint)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Entrypoint = make([]string, len(src.Entrypoint))\n\t\t}\n\t\tcopy(dst.Entrypoint, src.Entrypoint)\n\t}\n\tif src.Environment != nil {\n\t\tdst.Environment = make(map[string]*string, len(src.Environment))\n\t\tderiveDeepCopy_12(dst.Environment, src.Environment)\n\t} else {\n\t\tdst.Environment = nil\n\t}\n\tif src.EnvFiles == nil {\n\t\tdst.EnvFiles = nil\n\t} else {\n\t\tif dst.EnvFiles != nil {\n\t\t\tif len(src.EnvFiles) > len(dst.EnvFiles) {\n\t\t\t\tif cap(dst.EnvFiles) >= len(src.EnvFiles) {\n\t\t\t\t\tdst.EnvFiles = (dst.EnvFiles)[:len(src.EnvFiles)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.EnvFiles = make([]EnvFile, len(src.EnvFiles))\n\t\t\t\t}\n\t\t\t} else if len(src.EnvFiles) < len(dst.EnvFiles) {\n\t\t\t\tdst.EnvFiles = (dst.EnvFiles)[:len(src.EnvFiles)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.EnvFiles = make([]EnvFile, len(src.EnvFiles))\n\t\t}\n\t\tcopy(dst.EnvFiles, src.EnvFiles)\n\t}\n\tif src.Expose == nil {\n\t\tdst.Expose = nil\n\t} else {\n\t\tif dst.Expose != nil {\n\t\t\tif len(src.Expose) > len(dst.Expose) {\n\t\t\t\tif cap(dst.Expose) >= len(src.Expose) {\n\t\t\t\t\tdst.Expose = (dst.Expose)[:len(src.Expose)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Expose = make([]string, len(src.Expose))\n\t\t\t\t}\n\t\t\t} else if len(src.Expose) < len(dst.Expose) {\n\t\t\t\tdst.Expose = (dst.Expose)[:len(src.Expose)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Expose = make([]string, len(src.Expose))\n\t\t}\n\t\tcopy(dst.Expose, src.Expose)\n\t}\n\tif src.Extends == nil {\n\t\tdst.Extends = nil\n\t} else {\n\t\tdst.Extends = new(ExtendsConfig)\n\t\t*dst.Extends = *src.Extends\n\t}\n\tif src.ExternalLinks == nil {\n\t\tdst.ExternalLinks = nil\n\t} else {\n\t\tif dst.ExternalLinks != nil {\n\t\t\tif len(src.ExternalLinks) > len(dst.ExternalLinks) {\n\t\t\t\tif cap(dst.ExternalLinks) >= len(src.ExternalLinks) {\n\t\t\t\t\tdst.ExternalLinks = (dst.ExternalLinks)[:len(src.ExternalLinks)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.ExternalLinks = make([]string, len(src.ExternalLinks))\n\t\t\t\t}\n\t\t\t} else if len(src.ExternalLinks) < len(dst.ExternalLinks) {\n\t\t\t\tdst.ExternalLinks = (dst.ExternalLinks)[:len(src.ExternalLinks)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.ExternalLinks = make([]string, len(src.ExternalLinks))\n\t\t}\n\t\tcopy(dst.ExternalLinks, src.ExternalLinks)\n\t}\n\tif src.ExtraHosts != nil {\n\t\tdst.ExtraHosts = make(map[string][]string, len(src.ExtraHosts))\n\t\tderiveDeepCopy_13(dst.ExtraHosts, src.ExtraHosts)\n\t} else {\n\t\tdst.ExtraHosts = nil\n\t}\n\tif src.GroupAdd == nil {\n\t\tdst.GroupAdd = nil\n\t} else {\n\t\tif dst.GroupAdd != nil {\n\t\t\tif len(src.GroupAdd) > len(dst.GroupAdd) {\n\t\t\t\tif cap(dst.GroupAdd) >= len(src.GroupAdd) {\n\t\t\t\t\tdst.GroupAdd = (dst.GroupAdd)[:len(src.GroupAdd)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.GroupAdd = make([]string, len(src.GroupAdd))\n\t\t\t\t}\n\t\t\t} else if len(src.GroupAdd) < len(dst.GroupAdd) {\n\t\t\t\tdst.GroupAdd = (dst.GroupAdd)[:len(src.GroupAdd)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.GroupAdd = make([]string, len(src.GroupAdd))\n\t\t}\n\t\tcopy(dst.GroupAdd, src.GroupAdd)\n\t}\n\tdst.Hostname = src.Hostname\n\tif src.HealthCheck == nil {\n\t\tdst.HealthCheck = nil\n\t} else {\n\t\tdst.HealthCheck = new(HealthCheckConfig)\n\t\tderiveDeepCopy_14(dst.HealthCheck, src.HealthCheck)\n\t}\n\tdst.Image = src.Image\n\tif src.Init == nil {\n\t\tdst.Init = nil\n\t} else {\n\t\tdst.Init = new(bool)\n\t\t*dst.Init = *src.Init\n\t}\n\tdst.Ipc = src.Ipc\n\tdst.Isolation = src.Isolation\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tif src.CustomLabels != nil {\n\t\tdst.CustomLabels = make(map[string]string, len(src.CustomLabels))\n\t\tderiveDeepCopy_4(dst.CustomLabels, src.CustomLabels)\n\t} else {\n\t\tdst.CustomLabels = nil\n\t}\n\tif src.Links == nil {\n\t\tdst.Links = nil\n\t} else {\n\t\tif dst.Links != nil {\n\t\t\tif len(src.Links) > len(dst.Links) {\n\t\t\t\tif cap(dst.Links) >= len(src.Links) {\n\t\t\t\t\tdst.Links = (dst.Links)[:len(src.Links)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Links = make([]string, len(src.Links))\n\t\t\t\t}\n\t\t\t} else if len(src.Links) < len(dst.Links) {\n\t\t\t\tdst.Links = (dst.Links)[:len(src.Links)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Links = make([]string, len(src.Links))\n\t\t}\n\t\tcopy(dst.Links, src.Links)\n\t}\n\tif src.Logging == nil {\n\t\tdst.Logging = nil\n\t} else {\n\t\tdst.Logging = new(LoggingConfig)\n\t\tderiveDeepCopy_15(dst.Logging, src.Logging)\n\t}\n\tdst.LogDriver = src.LogDriver\n\tif src.LogOpt != nil {\n\t\tdst.LogOpt = make(map[string]string, len(src.LogOpt))\n\t\tderiveDeepCopy_4(dst.LogOpt, src.LogOpt)\n\t} else {\n\t\tdst.LogOpt = nil\n\t}\n\tdst.MemLimit = src.MemLimit\n\tdst.MemReservation = src.MemReservation\n\tdst.MemSwapLimit = src.MemSwapLimit\n\tdst.MemSwappiness = src.MemSwappiness\n\tdst.MacAddress = src.MacAddress\n\tdst.Net = src.Net\n\tdst.NetworkMode = src.NetworkMode\n\tif src.Networks != nil {\n\t\tdst.Networks = make(map[string]*ServiceNetworkConfig, len(src.Networks))\n\t\tderiveDeepCopy_16(dst.Networks, src.Networks)\n\t} else {\n\t\tdst.Networks = nil\n\t}\n\tdst.OomKillDisable = src.OomKillDisable\n\tdst.OomScoreAdj = src.OomScoreAdj\n\tdst.Pid = src.Pid\n\tdst.PidsLimit = src.PidsLimit\n\tdst.Platform = src.Platform\n\tif src.Ports == nil {\n\t\tdst.Ports = nil\n\t} else {\n\t\tif dst.Ports != nil {\n\t\t\tif len(src.Ports) > len(dst.Ports) {\n\t\t\t\tif cap(dst.Ports) >= len(src.Ports) {\n\t\t\t\t\tdst.Ports = (dst.Ports)[:len(src.Ports)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Ports = make([]ServicePortConfig, len(src.Ports))\n\t\t\t\t}\n\t\t\t} else if len(src.Ports) < len(dst.Ports) {\n\t\t\t\tdst.Ports = (dst.Ports)[:len(src.Ports)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Ports = make([]ServicePortConfig, len(src.Ports))\n\t\t}\n\t\tderiveDeepCopy_17(dst.Ports, src.Ports)\n\t}\n\tdst.Privileged = src.Privileged\n\tdst.PullPolicy = src.PullPolicy\n\tdst.ReadOnly = src.ReadOnly\n\tdst.Restart = src.Restart\n\tdst.Runtime = src.Runtime\n\tif src.Scale == nil {\n\t\tdst.Scale = nil\n\t} else {\n\t\tdst.Scale = new(int)\n\t\t*dst.Scale = *src.Scale\n\t}\n\tif src.Secrets == nil {\n\t\tdst.Secrets = nil\n\t} else {\n\t\tif dst.Secrets != nil {\n\t\t\tif len(src.Secrets) > len(dst.Secrets) {\n\t\t\t\tif cap(dst.Secrets) >= len(src.Secrets) {\n\t\t\t\t\tdst.Secrets = (dst.Secrets)[:len(src.Secrets)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Secrets = make([]ServiceSecretConfig, len(src.Secrets))\n\t\t\t\t}\n\t\t\t} else if len(src.Secrets) < len(dst.Secrets) {\n\t\t\t\tdst.Secrets = (dst.Secrets)[:len(src.Secrets)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Secrets = make([]ServiceSecretConfig, len(src.Secrets))\n\t\t}\n\t\tderiveDeepCopy_18(dst.Secrets, src.Secrets)\n\t}\n\tif src.SecurityOpt == nil {\n\t\tdst.SecurityOpt = nil\n\t} else {\n\t\tif dst.SecurityOpt != nil {\n\t\t\tif len(src.SecurityOpt) > len(dst.SecurityOpt) {\n\t\t\t\tif cap(dst.SecurityOpt) >= len(src.SecurityOpt) {\n\t\t\t\t\tdst.SecurityOpt = (dst.SecurityOpt)[:len(src.SecurityOpt)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.SecurityOpt = make([]string, len(src.SecurityOpt))\n\t\t\t\t}\n\t\t\t} else if len(src.SecurityOpt) < len(dst.SecurityOpt) {\n\t\t\t\tdst.SecurityOpt = (dst.SecurityOpt)[:len(src.SecurityOpt)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.SecurityOpt = make([]string, len(src.SecurityOpt))\n\t\t}\n\t\tcopy(dst.SecurityOpt, src.SecurityOpt)\n\t}\n\tdst.ShmSize = src.ShmSize\n\tdst.StdinOpen = src.StdinOpen\n\tif src.StopGracePeriod == nil {\n\t\tdst.StopGracePeriod = nil\n\t} else {\n\t\tdst.StopGracePeriod = new(Duration)\n\t\t*dst.StopGracePeriod = *src.StopGracePeriod\n\t}\n\tdst.StopSignal = src.StopSignal\n\tif src.StorageOpt != nil {\n\t\tdst.StorageOpt = make(map[string]string, len(src.StorageOpt))\n\t\tderiveDeepCopy_4(dst.StorageOpt, src.StorageOpt)\n\t} else {\n\t\tdst.StorageOpt = nil\n\t}\n\tif src.Sysctls != nil {\n\t\tdst.Sysctls = make(map[string]string, len(src.Sysctls))\n\t\tderiveDeepCopy_4(dst.Sysctls, src.Sysctls)\n\t} else {\n\t\tdst.Sysctls = nil\n\t}\n\tif src.Tmpfs == nil {\n\t\tdst.Tmpfs = nil\n\t} else {\n\t\tif dst.Tmpfs != nil {\n\t\t\tif len(src.Tmpfs) > len(dst.Tmpfs) {\n\t\t\t\tif cap(dst.Tmpfs) >= len(src.Tmpfs) {\n\t\t\t\t\tdst.Tmpfs = (dst.Tmpfs)[:len(src.Tmpfs)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Tmpfs = make([]string, len(src.Tmpfs))\n\t\t\t\t}\n\t\t\t} else if len(src.Tmpfs) < len(dst.Tmpfs) {\n\t\t\t\tdst.Tmpfs = (dst.Tmpfs)[:len(src.Tmpfs)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Tmpfs = make([]string, len(src.Tmpfs))\n\t\t}\n\t\tcopy(dst.Tmpfs, src.Tmpfs)\n\t}\n\tdst.Tty = src.Tty\n\tif src.Ulimits != nil {\n\t\tdst.Ulimits = make(map[string]*UlimitsConfig, len(src.Ulimits))\n\t\tderiveDeepCopy_19(dst.Ulimits, src.Ulimits)\n\t} else {\n\t\tdst.Ulimits = nil\n\t}\n\tdst.User = src.User\n\tdst.UserNSMode = src.UserNSMode\n\tdst.Uts = src.Uts\n\tdst.VolumeDriver = src.VolumeDriver\n\tif src.Volumes == nil {\n\t\tdst.Volumes = nil\n\t} else {\n\t\tif dst.Volumes != nil {\n\t\t\tif len(src.Volumes) > len(dst.Volumes) {\n\t\t\t\tif cap(dst.Volumes) >= len(src.Volumes) {\n\t\t\t\t\tdst.Volumes = (dst.Volumes)[:len(src.Volumes)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Volumes = make([]ServiceVolumeConfig, len(src.Volumes))\n\t\t\t\t}\n\t\t\t} else if len(src.Volumes) < len(dst.Volumes) {\n\t\t\t\tdst.Volumes = (dst.Volumes)[:len(src.Volumes)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Volumes = make([]ServiceVolumeConfig, len(src.Volumes))\n\t\t}\n\t\tderiveDeepCopy_20(dst.Volumes, src.Volumes)\n\t}\n\tif src.VolumesFrom == nil {\n\t\tdst.VolumesFrom = nil\n\t} else {\n\t\tif dst.VolumesFrom != nil {\n\t\t\tif len(src.VolumesFrom) > len(dst.VolumesFrom) {\n\t\t\t\tif cap(dst.VolumesFrom) >= len(src.VolumesFrom) {\n\t\t\t\t\tdst.VolumesFrom = (dst.VolumesFrom)[:len(src.VolumesFrom)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.VolumesFrom = make([]string, len(src.VolumesFrom))\n\t\t\t\t}\n\t\t\t} else if len(src.VolumesFrom) < len(dst.VolumesFrom) {\n\t\t\t\tdst.VolumesFrom = (dst.VolumesFrom)[:len(src.VolumesFrom)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.VolumesFrom = make([]string, len(src.VolumesFrom))\n\t\t}\n\t\tcopy(dst.VolumesFrom, src.VolumesFrom)\n\t}\n\tdst.WorkingDir = src.WorkingDir\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy recursively copies the contents of src into dst.\nfunc deriveDeepCopy(dst, src map[string]ServiceConfig) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServiceConfig)\n\t\t\tderiveDeepCopyService(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_ recursively copies the contents of src into dst.\nfunc deriveDeepCopy_(dst, src map[string]NetworkConfig) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(NetworkConfig)\n\t\t\tderiveDeepCopy_21(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_1 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_1(dst, src map[string]VolumeConfig) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(VolumeConfig)\n\t\t\tderiveDeepCopy_22(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_2 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_2(dst, src map[string]SecretConfig) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(SecretConfig)\n\t\t\tderiveDeepCopy_23(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_3 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_3(dst, src map[string]ConfigObjConfig) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ConfigObjConfig)\n\t\t\tderiveDeepCopy_24(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_4 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_4(dst, src map[string]string) {\n\tfor src_key, src_value := range src {\n\t\tdst[src_key] = src_value\n\t}\n}\n\n// deriveDeepCopy_5 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_5(dst, src *BuildConfig) {\n\tdst.Context = src.Context\n\tdst.Dockerfile = src.Dockerfile\n\tdst.DockerfileInline = src.DockerfileInline\n\tif src.Entitlements == nil {\n\t\tdst.Entitlements = nil\n\t} else {\n\t\tif dst.Entitlements != nil {\n\t\t\tif len(src.Entitlements) > len(dst.Entitlements) {\n\t\t\t\tif cap(dst.Entitlements) >= len(src.Entitlements) {\n\t\t\t\t\tdst.Entitlements = (dst.Entitlements)[:len(src.Entitlements)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Entitlements = make([]string, len(src.Entitlements))\n\t\t\t\t}\n\t\t\t} else if len(src.Entitlements) < len(dst.Entitlements) {\n\t\t\t\tdst.Entitlements = (dst.Entitlements)[:len(src.Entitlements)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Entitlements = make([]string, len(src.Entitlements))\n\t\t}\n\t\tcopy(dst.Entitlements, src.Entitlements)\n\t}\n\tif src.Args != nil {\n\t\tdst.Args = make(map[string]*string, len(src.Args))\n\t\tderiveDeepCopy_12(dst.Args, src.Args)\n\t} else {\n\t\tdst.Args = nil\n\t}\n\tif src.SSH == nil {\n\t\tdst.SSH = nil\n\t} else {\n\t\tif dst.SSH != nil {\n\t\t\tif len(src.SSH) > len(dst.SSH) {\n\t\t\t\tif cap(dst.SSH) >= len(src.SSH) {\n\t\t\t\t\tdst.SSH = (dst.SSH)[:len(src.SSH)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.SSH = make([]SSHKey, len(src.SSH))\n\t\t\t\t}\n\t\t\t} else if len(src.SSH) < len(dst.SSH) {\n\t\t\t\tdst.SSH = (dst.SSH)[:len(src.SSH)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.SSH = make([]SSHKey, len(src.SSH))\n\t\t}\n\t\tcopy(dst.SSH, src.SSH)\n\t}\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tif src.CacheFrom == nil {\n\t\tdst.CacheFrom = nil\n\t} else {\n\t\tif dst.CacheFrom != nil {\n\t\t\tif len(src.CacheFrom) > len(dst.CacheFrom) {\n\t\t\t\tif cap(dst.CacheFrom) >= len(src.CacheFrom) {\n\t\t\t\t\tdst.CacheFrom = (dst.CacheFrom)[:len(src.CacheFrom)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.CacheFrom = make([]string, len(src.CacheFrom))\n\t\t\t\t}\n\t\t\t} else if len(src.CacheFrom) < len(dst.CacheFrom) {\n\t\t\t\tdst.CacheFrom = (dst.CacheFrom)[:len(src.CacheFrom)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.CacheFrom = make([]string, len(src.CacheFrom))\n\t\t}\n\t\tcopy(dst.CacheFrom, src.CacheFrom)\n\t}\n\tif src.CacheTo == nil {\n\t\tdst.CacheTo = nil\n\t} else {\n\t\tif dst.CacheTo != nil {\n\t\t\tif len(src.CacheTo) > len(dst.CacheTo) {\n\t\t\t\tif cap(dst.CacheTo) >= len(src.CacheTo) {\n\t\t\t\t\tdst.CacheTo = (dst.CacheTo)[:len(src.CacheTo)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.CacheTo = make([]string, len(src.CacheTo))\n\t\t\t\t}\n\t\t\t} else if len(src.CacheTo) < len(dst.CacheTo) {\n\t\t\t\tdst.CacheTo = (dst.CacheTo)[:len(src.CacheTo)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.CacheTo = make([]string, len(src.CacheTo))\n\t\t}\n\t\tcopy(dst.CacheTo, src.CacheTo)\n\t}\n\tdst.NoCache = src.NoCache\n\tif src.AdditionalContexts != nil {\n\t\tdst.AdditionalContexts = make(map[string]string, len(src.AdditionalContexts))\n\t\tderiveDeepCopy_4(dst.AdditionalContexts, src.AdditionalContexts)\n\t} else {\n\t\tdst.AdditionalContexts = nil\n\t}\n\tdst.Pull = src.Pull\n\tif src.ExtraHosts != nil {\n\t\tdst.ExtraHosts = make(map[string][]string, len(src.ExtraHosts))\n\t\tderiveDeepCopy_13(dst.ExtraHosts, src.ExtraHosts)\n\t} else {\n\t\tdst.ExtraHosts = nil\n\t}\n\tdst.Isolation = src.Isolation\n\tdst.Network = src.Network\n\tdst.Target = src.Target\n\tif src.Secrets == nil {\n\t\tdst.Secrets = nil\n\t} else {\n\t\tif dst.Secrets != nil {\n\t\t\tif len(src.Secrets) > len(dst.Secrets) {\n\t\t\t\tif cap(dst.Secrets) >= len(src.Secrets) {\n\t\t\t\t\tdst.Secrets = (dst.Secrets)[:len(src.Secrets)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Secrets = make([]ServiceSecretConfig, len(src.Secrets))\n\t\t\t\t}\n\t\t\t} else if len(src.Secrets) < len(dst.Secrets) {\n\t\t\t\tdst.Secrets = (dst.Secrets)[:len(src.Secrets)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Secrets = make([]ServiceSecretConfig, len(src.Secrets))\n\t\t}\n\t\tderiveDeepCopy_18(dst.Secrets, src.Secrets)\n\t}\n\tdst.ShmSize = src.ShmSize\n\tif src.Tags == nil {\n\t\tdst.Tags = nil\n\t} else {\n\t\tif dst.Tags != nil {\n\t\t\tif len(src.Tags) > len(dst.Tags) {\n\t\t\t\tif cap(dst.Tags) >= len(src.Tags) {\n\t\t\t\t\tdst.Tags = (dst.Tags)[:len(src.Tags)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Tags = make([]string, len(src.Tags))\n\t\t\t\t}\n\t\t\t} else if len(src.Tags) < len(dst.Tags) {\n\t\t\t\tdst.Tags = (dst.Tags)[:len(src.Tags)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Tags = make([]string, len(src.Tags))\n\t\t}\n\t\tcopy(dst.Tags, src.Tags)\n\t}\n\tif src.Ulimits != nil {\n\t\tdst.Ulimits = make(map[string]*UlimitsConfig, len(src.Ulimits))\n\t\tderiveDeepCopy_19(dst.Ulimits, src.Ulimits)\n\t} else {\n\t\tdst.Ulimits = nil\n\t}\n\tif src.Platforms == nil {\n\t\tdst.Platforms = nil\n\t} else {\n\t\tif dst.Platforms != nil {\n\t\t\tif len(src.Platforms) > len(dst.Platforms) {\n\t\t\t\tif cap(dst.Platforms) >= len(src.Platforms) {\n\t\t\t\t\tdst.Platforms = (dst.Platforms)[:len(src.Platforms)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Platforms = make([]string, len(src.Platforms))\n\t\t\t\t}\n\t\t\t} else if len(src.Platforms) < len(dst.Platforms) {\n\t\t\t\tdst.Platforms = (dst.Platforms)[:len(src.Platforms)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Platforms = make([]string, len(src.Platforms))\n\t\t}\n\t\tcopy(dst.Platforms, src.Platforms)\n\t}\n\tdst.Privileged = src.Privileged\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_6 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_6(dst, src *DevelopConfig) {\n\tif src.Watch == nil {\n\t\tdst.Watch = nil\n\t} else {\n\t\tif dst.Watch != nil {\n\t\t\tif len(src.Watch) > len(dst.Watch) {\n\t\t\t\tif cap(dst.Watch) >= len(src.Watch) {\n\t\t\t\t\tdst.Watch = (dst.Watch)[:len(src.Watch)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Watch = make([]Trigger, len(src.Watch))\n\t\t\t\t}\n\t\t\t} else if len(src.Watch) < len(dst.Watch) {\n\t\t\t\tdst.Watch = (dst.Watch)[:len(src.Watch)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Watch = make([]Trigger, len(src.Watch))\n\t\t}\n\t\tderiveDeepCopy_25(dst.Watch, src.Watch)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_7 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_7(dst, src *BlkioConfig) {\n\tdst.Weight = src.Weight\n\tif src.WeightDevice == nil {\n\t\tdst.WeightDevice = nil\n\t} else {\n\t\tif dst.WeightDevice != nil {\n\t\t\tif len(src.WeightDevice) > len(dst.WeightDevice) {\n\t\t\t\tif cap(dst.WeightDevice) >= len(src.WeightDevice) {\n\t\t\t\t\tdst.WeightDevice = (dst.WeightDevice)[:len(src.WeightDevice)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.WeightDevice = make([]WeightDevice, len(src.WeightDevice))\n\t\t\t\t}\n\t\t\t} else if len(src.WeightDevice) < len(dst.WeightDevice) {\n\t\t\t\tdst.WeightDevice = (dst.WeightDevice)[:len(src.WeightDevice)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.WeightDevice = make([]WeightDevice, len(src.WeightDevice))\n\t\t}\n\t\tderiveDeepCopy_26(dst.WeightDevice, src.WeightDevice)\n\t}\n\tif src.DeviceReadBps == nil {\n\t\tdst.DeviceReadBps = nil\n\t} else {\n\t\tif dst.DeviceReadBps != nil {\n\t\t\tif len(src.DeviceReadBps) > len(dst.DeviceReadBps) {\n\t\t\t\tif cap(dst.DeviceReadBps) >= len(src.DeviceReadBps) {\n\t\t\t\t\tdst.DeviceReadBps = (dst.DeviceReadBps)[:len(src.DeviceReadBps)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DeviceReadBps = make([]ThrottleDevice, len(src.DeviceReadBps))\n\t\t\t\t}\n\t\t\t} else if len(src.DeviceReadBps) < len(dst.DeviceReadBps) {\n\t\t\t\tdst.DeviceReadBps = (dst.DeviceReadBps)[:len(src.DeviceReadBps)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DeviceReadBps = make([]ThrottleDevice, len(src.DeviceReadBps))\n\t\t}\n\t\tderiveDeepCopy_27(dst.DeviceReadBps, src.DeviceReadBps)\n\t}\n\tif src.DeviceReadIOps == nil {\n\t\tdst.DeviceReadIOps = nil\n\t} else {\n\t\tif dst.DeviceReadIOps != nil {\n\t\t\tif len(src.DeviceReadIOps) > len(dst.DeviceReadIOps) {\n\t\t\t\tif cap(dst.DeviceReadIOps) >= len(src.DeviceReadIOps) {\n\t\t\t\t\tdst.DeviceReadIOps = (dst.DeviceReadIOps)[:len(src.DeviceReadIOps)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DeviceReadIOps = make([]ThrottleDevice, len(src.DeviceReadIOps))\n\t\t\t\t}\n\t\t\t} else if len(src.DeviceReadIOps) < len(dst.DeviceReadIOps) {\n\t\t\t\tdst.DeviceReadIOps = (dst.DeviceReadIOps)[:len(src.DeviceReadIOps)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DeviceReadIOps = make([]ThrottleDevice, len(src.DeviceReadIOps))\n\t\t}\n\t\tderiveDeepCopy_27(dst.DeviceReadIOps, src.DeviceReadIOps)\n\t}\n\tif src.DeviceWriteBps == nil {\n\t\tdst.DeviceWriteBps = nil\n\t} else {\n\t\tif dst.DeviceWriteBps != nil {\n\t\t\tif len(src.DeviceWriteBps) > len(dst.DeviceWriteBps) {\n\t\t\t\tif cap(dst.DeviceWriteBps) >= len(src.DeviceWriteBps) {\n\t\t\t\t\tdst.DeviceWriteBps = (dst.DeviceWriteBps)[:len(src.DeviceWriteBps)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DeviceWriteBps = make([]ThrottleDevice, len(src.DeviceWriteBps))\n\t\t\t\t}\n\t\t\t} else if len(src.DeviceWriteBps) < len(dst.DeviceWriteBps) {\n\t\t\t\tdst.DeviceWriteBps = (dst.DeviceWriteBps)[:len(src.DeviceWriteBps)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DeviceWriteBps = make([]ThrottleDevice, len(src.DeviceWriteBps))\n\t\t}\n\t\tderiveDeepCopy_27(dst.DeviceWriteBps, src.DeviceWriteBps)\n\t}\n\tif src.DeviceWriteIOps == nil {\n\t\tdst.DeviceWriteIOps = nil\n\t} else {\n\t\tif dst.DeviceWriteIOps != nil {\n\t\t\tif len(src.DeviceWriteIOps) > len(dst.DeviceWriteIOps) {\n\t\t\t\tif cap(dst.DeviceWriteIOps) >= len(src.DeviceWriteIOps) {\n\t\t\t\t\tdst.DeviceWriteIOps = (dst.DeviceWriteIOps)[:len(src.DeviceWriteIOps)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.DeviceWriteIOps = make([]ThrottleDevice, len(src.DeviceWriteIOps))\n\t\t\t\t}\n\t\t\t} else if len(src.DeviceWriteIOps) < len(dst.DeviceWriteIOps) {\n\t\t\t\tdst.DeviceWriteIOps = (dst.DeviceWriteIOps)[:len(src.DeviceWriteIOps)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.DeviceWriteIOps = make([]ThrottleDevice, len(src.DeviceWriteIOps))\n\t\t}\n\t\tderiveDeepCopy_27(dst.DeviceWriteIOps, src.DeviceWriteIOps)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_8 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_8(dst, src []ServiceConfigObjConfig) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServiceConfigObjConfig)\n\t\t\tderiveDeepCopy_28(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_9 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_9(dst, src *CredentialSpecConfig) {\n\tdst.Config = src.Config\n\tdst.File = src.File\n\tdst.Registry = src.Registry\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_10 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_10(dst, src map[string]ServiceDependency) {\n\tfor src_key, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServiceDependency)\n\t\t\tderiveDeepCopy_29(field, &src_value)\n\t\t\tdst[src_key] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_11 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_11(dst, src *DeployConfig) {\n\tdst.Mode = src.Mode\n\tif src.Replicas == nil {\n\t\tdst.Replicas = nil\n\t} else {\n\t\tdst.Replicas = new(int)\n\t\t*dst.Replicas = *src.Replicas\n\t}\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tif src.UpdateConfig == nil {\n\t\tdst.UpdateConfig = nil\n\t} else {\n\t\tdst.UpdateConfig = new(UpdateConfig)\n\t\tderiveDeepCopy_30(dst.UpdateConfig, src.UpdateConfig)\n\t}\n\tif src.RollbackConfig == nil {\n\t\tdst.RollbackConfig = nil\n\t} else {\n\t\tdst.RollbackConfig = new(UpdateConfig)\n\t\tderiveDeepCopy_30(dst.RollbackConfig, src.RollbackConfig)\n\t}\n\tfunc() {\n\t\tfield := new(Resources)\n\t\tderiveDeepCopy_31(field, &src.Resources)\n\t\tdst.Resources = *field\n\t}()\n\tif src.RestartPolicy == nil {\n\t\tdst.RestartPolicy = nil\n\t} else {\n\t\tdst.RestartPolicy = new(RestartPolicy)\n\t\tderiveDeepCopy_32(dst.RestartPolicy, src.RestartPolicy)\n\t}\n\tfunc() {\n\t\tfield := new(Placement)\n\t\tderiveDeepCopy_33(field, &src.Placement)\n\t\tdst.Placement = *field\n\t}()\n\tdst.EndpointMode = src.EndpointMode\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_12 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_12(dst, src map[string]*string) {\n\tfor src_key, src_value := range src {\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t}\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t} else {\n\t\t\tdst[src_key] = new(string)\n\t\t\t*dst[src_key] = *src_value\n\t\t}\n\t}\n}\n\n// deriveDeepCopy_13 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_13(dst, src map[string][]string) {\n\tfor src_key, src_value := range src {\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t}\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t} else {\n\t\t\tif dst[src_key] != nil {\n\t\t\t\tif len(src_value) > len(dst[src_key]) {\n\t\t\t\t\tif cap(dst[src_key]) >= len(src_value) {\n\t\t\t\t\t\tdst[src_key] = (dst[src_key])[:len(src_value)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdst[src_key] = make([]string, len(src_value))\n\t\t\t\t\t}\n\t\t\t\t} else if len(src_value) < len(dst[src_key]) {\n\t\t\t\t\tdst[src_key] = (dst[src_key])[:len(src_value)]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdst[src_key] = make([]string, len(src_value))\n\t\t\t}\n\t\t\tcopy(dst[src_key], src_value)\n\t\t}\n\t}\n}\n\n// deriveDeepCopy_14 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_14(dst, src *HealthCheckConfig) {\n\tif src.Test == nil {\n\t\tdst.Test = nil\n\t} else {\n\t\tif dst.Test != nil {\n\t\t\tif len(src.Test) > len(dst.Test) {\n\t\t\t\tif cap(dst.Test) >= len(src.Test) {\n\t\t\t\t\tdst.Test = (dst.Test)[:len(src.Test)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Test = make([]string, len(src.Test))\n\t\t\t\t}\n\t\t\t} else if len(src.Test) < len(dst.Test) {\n\t\t\t\tdst.Test = (dst.Test)[:len(src.Test)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Test = make([]string, len(src.Test))\n\t\t}\n\t\tcopy(dst.Test, src.Test)\n\t}\n\tif src.Timeout == nil {\n\t\tdst.Timeout = nil\n\t} else {\n\t\tdst.Timeout = new(Duration)\n\t\t*dst.Timeout = *src.Timeout\n\t}\n\tif src.Interval == nil {\n\t\tdst.Interval = nil\n\t} else {\n\t\tdst.Interval = new(Duration)\n\t\t*dst.Interval = *src.Interval\n\t}\n\tif src.Retries == nil {\n\t\tdst.Retries = nil\n\t} else {\n\t\tdst.Retries = new(uint64)\n\t\t*dst.Retries = *src.Retries\n\t}\n\tif src.StartPeriod == nil {\n\t\tdst.StartPeriod = nil\n\t} else {\n\t\tdst.StartPeriod = new(Duration)\n\t\t*dst.StartPeriod = *src.StartPeriod\n\t}\n\tif src.StartInterval == nil {\n\t\tdst.StartInterval = nil\n\t} else {\n\t\tdst.StartInterval = new(Duration)\n\t\t*dst.StartInterval = *src.StartInterval\n\t}\n\tdst.Disable = src.Disable\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_15 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_15(dst, src *LoggingConfig) {\n\tdst.Driver = src.Driver\n\tif src.Options != nil {\n\t\tdst.Options = make(map[string]string, len(src.Options))\n\t\tderiveDeepCopy_4(dst.Options, src.Options)\n\t} else {\n\t\tdst.Options = nil\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_16 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_16(dst, src map[string]*ServiceNetworkConfig) {\n\tfor src_key, src_value := range src {\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t}\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t} else {\n\t\t\tdst[src_key] = new(ServiceNetworkConfig)\n\t\t\tderiveDeepCopy_34(dst[src_key], src_value)\n\t\t}\n\t}\n}\n\n// deriveDeepCopy_17 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_17(dst, src []ServicePortConfig) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServicePortConfig)\n\t\t\tderiveDeepCopy_35(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_18 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_18(dst, src []ServiceSecretConfig) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServiceSecretConfig)\n\t\t\tderiveDeepCopy_36(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_19 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_19(dst, src map[string]*UlimitsConfig) {\n\tfor src_key, src_value := range src {\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t}\n\t\tif src_value == nil {\n\t\t\tdst[src_key] = nil\n\t\t} else {\n\t\t\tdst[src_key] = new(UlimitsConfig)\n\t\t\tderiveDeepCopy_37(dst[src_key], src_value)\n\t\t}\n\t}\n}\n\n// deriveDeepCopy_20 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_20(dst, src []ServiceVolumeConfig) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ServiceVolumeConfig)\n\t\t\tderiveDeepCopy_38(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_21 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_21(dst, src *NetworkConfig) {\n\tdst.Name = src.Name\n\tdst.Driver = src.Driver\n\tif src.DriverOpts != nil {\n\t\tdst.DriverOpts = make(map[string]string, len(src.DriverOpts))\n\t\tderiveDeepCopy_4(dst.DriverOpts, src.DriverOpts)\n\t} else {\n\t\tdst.DriverOpts = nil\n\t}\n\tfunc() {\n\t\tfield := new(IPAMConfig)\n\t\tderiveDeepCopy_39(field, &src.Ipam)\n\t\tdst.Ipam = *field\n\t}()\n\tdst.External = src.External\n\tdst.Internal = src.Internal\n\tdst.Attachable = src.Attachable\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tif src.EnableIPv6 == nil {\n\t\tdst.EnableIPv6 = nil\n\t} else {\n\t\tdst.EnableIPv6 = new(bool)\n\t\t*dst.EnableIPv6 = *src.EnableIPv6\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_22 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_22(dst, src *VolumeConfig) {\n\tdst.Name = src.Name\n\tdst.Driver = src.Driver\n\tif src.DriverOpts != nil {\n\t\tdst.DriverOpts = make(map[string]string, len(src.DriverOpts))\n\t\tderiveDeepCopy_4(dst.DriverOpts, src.DriverOpts)\n\t} else {\n\t\tdst.DriverOpts = nil\n\t}\n\tdst.External = src.External\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_23 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_23(dst, src *SecretConfig) {\n\tdst.Name = src.Name\n\tdst.File = src.File\n\tdst.Environment = src.Environment\n\tdst.Content = src.Content\n\tdst.External = src.External\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tdst.Driver = src.Driver\n\tif src.DriverOpts != nil {\n\t\tdst.DriverOpts = make(map[string]string, len(src.DriverOpts))\n\t\tderiveDeepCopy_4(dst.DriverOpts, src.DriverOpts)\n\t} else {\n\t\tdst.DriverOpts = nil\n\t}\n\tdst.TemplateDriver = src.TemplateDriver\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_24 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_24(dst, src *ConfigObjConfig) {\n\tdst.Name = src.Name\n\tdst.File = src.File\n\tdst.Environment = src.Environment\n\tdst.Content = src.Content\n\tdst.External = src.External\n\tif src.Labels != nil {\n\t\tdst.Labels = make(map[string]string, len(src.Labels))\n\t\tderiveDeepCopy_4(dst.Labels, src.Labels)\n\t} else {\n\t\tdst.Labels = nil\n\t}\n\tdst.Driver = src.Driver\n\tif src.DriverOpts != nil {\n\t\tdst.DriverOpts = make(map[string]string, len(src.DriverOpts))\n\t\tderiveDeepCopy_4(dst.DriverOpts, src.DriverOpts)\n\t} else {\n\t\tdst.DriverOpts = nil\n\t}\n\tdst.TemplateDriver = src.TemplateDriver\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_25 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_25(dst, src []Trigger) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(Trigger)\n\t\t\tderiveDeepCopy_40(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_26 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_26(dst, src []WeightDevice) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(WeightDevice)\n\t\t\tderiveDeepCopy_41(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_27 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_27(dst, src []ThrottleDevice) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(ThrottleDevice)\n\t\t\tderiveDeepCopy_42(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_28 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_28(dst, src *ServiceConfigObjConfig) {\n\tdst.Source = src.Source\n\tdst.Target = src.Target\n\tdst.UID = src.UID\n\tdst.GID = src.GID\n\tif src.Mode == nil {\n\t\tdst.Mode = nil\n\t} else {\n\t\tdst.Mode = new(uint32)\n\t\t*dst.Mode = *src.Mode\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_29 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_29(dst, src *ServiceDependency) {\n\tdst.Condition = src.Condition\n\tdst.Restart = src.Restart\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n\tdst.Required = src.Required\n}\n\n// deriveDeepCopy_30 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_30(dst, src *UpdateConfig) {\n\tif src.Parallelism == nil {\n\t\tdst.Parallelism = nil\n\t} else {\n\t\tdst.Parallelism = new(uint64)\n\t\t*dst.Parallelism = *src.Parallelism\n\t}\n\tdst.Delay = src.Delay\n\tdst.FailureAction = src.FailureAction\n\tdst.Monitor = src.Monitor\n\tdst.MaxFailureRatio = src.MaxFailureRatio\n\tdst.Order = src.Order\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_31 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_31(dst, src *Resources) {\n\tif src.Limits == nil {\n\t\tdst.Limits = nil\n\t} else {\n\t\tdst.Limits = new(Resource)\n\t\tderiveDeepCopy_43(dst.Limits, src.Limits)\n\t}\n\tif src.Reservations == nil {\n\t\tdst.Reservations = nil\n\t} else {\n\t\tdst.Reservations = new(Resource)\n\t\tderiveDeepCopy_43(dst.Reservations, src.Reservations)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_32 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_32(dst, src *RestartPolicy) {\n\tdst.Condition = src.Condition\n\tif src.Delay == nil {\n\t\tdst.Delay = nil\n\t} else {\n\t\tdst.Delay = new(Duration)\n\t\t*dst.Delay = *src.Delay\n\t}\n\tif src.MaxAttempts == nil {\n\t\tdst.MaxAttempts = nil\n\t} else {\n\t\tdst.MaxAttempts = new(uint64)\n\t\t*dst.MaxAttempts = *src.MaxAttempts\n\t}\n\tif src.Window == nil {\n\t\tdst.Window = nil\n\t} else {\n\t\tdst.Window = new(Duration)\n\t\t*dst.Window = *src.Window\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_33 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_33(dst, src *Placement) {\n\tif src.Constraints == nil {\n\t\tdst.Constraints = nil\n\t} else {\n\t\tif dst.Constraints != nil {\n\t\t\tif len(src.Constraints) > len(dst.Constraints) {\n\t\t\t\tif cap(dst.Constraints) >= len(src.Constraints) {\n\t\t\t\t\tdst.Constraints = (dst.Constraints)[:len(src.Constraints)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Constraints = make([]string, len(src.Constraints))\n\t\t\t\t}\n\t\t\t} else if len(src.Constraints) < len(dst.Constraints) {\n\t\t\t\tdst.Constraints = (dst.Constraints)[:len(src.Constraints)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Constraints = make([]string, len(src.Constraints))\n\t\t}\n\t\tcopy(dst.Constraints, src.Constraints)\n\t}\n\tif src.Preferences == nil {\n\t\tdst.Preferences = nil\n\t} else {\n\t\tif dst.Preferences != nil {\n\t\t\tif len(src.Preferences) > len(dst.Preferences) {\n\t\t\t\tif cap(dst.Preferences) >= len(src.Preferences) {\n\t\t\t\t\tdst.Preferences = (dst.Preferences)[:len(src.Preferences)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Preferences = make([]PlacementPreferences, len(src.Preferences))\n\t\t\t\t}\n\t\t\t} else if len(src.Preferences) < len(dst.Preferences) {\n\t\t\t\tdst.Preferences = (dst.Preferences)[:len(src.Preferences)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Preferences = make([]PlacementPreferences, len(src.Preferences))\n\t\t}\n\t\tderiveDeepCopy_44(dst.Preferences, src.Preferences)\n\t}\n\tdst.MaxReplicas = src.MaxReplicas\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_34 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_34(dst, src *ServiceNetworkConfig) {\n\tdst.Priority = src.Priority\n\tif src.Aliases == nil {\n\t\tdst.Aliases = nil\n\t} else {\n\t\tif dst.Aliases != nil {\n\t\t\tif len(src.Aliases) > len(dst.Aliases) {\n\t\t\t\tif cap(dst.Aliases) >= len(src.Aliases) {\n\t\t\t\t\tdst.Aliases = (dst.Aliases)[:len(src.Aliases)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Aliases = make([]string, len(src.Aliases))\n\t\t\t\t}\n\t\t\t} else if len(src.Aliases) < len(dst.Aliases) {\n\t\t\t\tdst.Aliases = (dst.Aliases)[:len(src.Aliases)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Aliases = make([]string, len(src.Aliases))\n\t\t}\n\t\tcopy(dst.Aliases, src.Aliases)\n\t}\n\tdst.Ipv4Address = src.Ipv4Address\n\tdst.Ipv6Address = src.Ipv6Address\n\tif src.LinkLocalIPs == nil {\n\t\tdst.LinkLocalIPs = nil\n\t} else {\n\t\tif dst.LinkLocalIPs != nil {\n\t\t\tif len(src.LinkLocalIPs) > len(dst.LinkLocalIPs) {\n\t\t\t\tif cap(dst.LinkLocalIPs) >= len(src.LinkLocalIPs) {\n\t\t\t\t\tdst.LinkLocalIPs = (dst.LinkLocalIPs)[:len(src.LinkLocalIPs)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.LinkLocalIPs = make([]string, len(src.LinkLocalIPs))\n\t\t\t\t}\n\t\t\t} else if len(src.LinkLocalIPs) < len(dst.LinkLocalIPs) {\n\t\t\t\tdst.LinkLocalIPs = (dst.LinkLocalIPs)[:len(src.LinkLocalIPs)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.LinkLocalIPs = make([]string, len(src.LinkLocalIPs))\n\t\t}\n\t\tcopy(dst.LinkLocalIPs, src.LinkLocalIPs)\n\t}\n\tdst.MacAddress = src.MacAddress\n\tif src.DriverOpts != nil {\n\t\tdst.DriverOpts = make(map[string]string, len(src.DriverOpts))\n\t\tderiveDeepCopy_4(dst.DriverOpts, src.DriverOpts)\n\t} else {\n\t\tdst.DriverOpts = nil\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_35 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_35(dst, src *ServicePortConfig) {\n\tdst.Name = src.Name\n\tdst.Mode = src.Mode\n\tdst.HostIP = src.HostIP\n\tdst.Target = src.Target\n\tdst.Published = src.Published\n\tdst.Protocol = src.Protocol\n\tdst.AppProtocol = src.AppProtocol\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_36 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_36(dst, src *ServiceSecretConfig) {\n\tdst.Source = src.Source\n\tdst.Target = src.Target\n\tdst.UID = src.UID\n\tdst.GID = src.GID\n\tif src.Mode == nil {\n\t\tdst.Mode = nil\n\t} else {\n\t\tdst.Mode = new(uint32)\n\t\t*dst.Mode = *src.Mode\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_37 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_37(dst, src *UlimitsConfig) {\n\tdst.Single = src.Single\n\tdst.Soft = src.Soft\n\tdst.Hard = src.Hard\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_38 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_38(dst, src *ServiceVolumeConfig) {\n\tdst.Type = src.Type\n\tdst.Source = src.Source\n\tdst.Target = src.Target\n\tdst.ReadOnly = src.ReadOnly\n\tdst.Consistency = src.Consistency\n\tif src.Bind == nil {\n\t\tdst.Bind = nil\n\t} else {\n\t\tdst.Bind = new(ServiceVolumeBind)\n\t\tderiveDeepCopy_45(dst.Bind, src.Bind)\n\t}\n\tif src.Volume == nil {\n\t\tdst.Volume = nil\n\t} else {\n\t\tdst.Volume = new(ServiceVolumeVolume)\n\t\tderiveDeepCopy_46(dst.Volume, src.Volume)\n\t}\n\tif src.Tmpfs == nil {\n\t\tdst.Tmpfs = nil\n\t} else {\n\t\tdst.Tmpfs = new(ServiceVolumeTmpfs)\n\t\tderiveDeepCopy_47(dst.Tmpfs, src.Tmpfs)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_39 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_39(dst, src *IPAMConfig) {\n\tdst.Driver = src.Driver\n\tif src.Config == nil {\n\t\tdst.Config = nil\n\t} else {\n\t\tif dst.Config != nil {\n\t\t\tif len(src.Config) > len(dst.Config) {\n\t\t\t\tif cap(dst.Config) >= len(src.Config) {\n\t\t\t\t\tdst.Config = (dst.Config)[:len(src.Config)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Config = make([]*IPAMPool, len(src.Config))\n\t\t\t\t}\n\t\t\t} else if len(src.Config) < len(dst.Config) {\n\t\t\t\tdst.Config = (dst.Config)[:len(src.Config)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Config = make([]*IPAMPool, len(src.Config))\n\t\t}\n\t\tderiveDeepCopy_48(dst.Config, src.Config)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_40 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_40(dst, src *Trigger) {\n\tdst.Path = src.Path\n\tdst.Action = src.Action\n\tdst.Target = src.Target\n\tif src.Ignore == nil {\n\t\tdst.Ignore = nil\n\t} else {\n\t\tif dst.Ignore != nil {\n\t\t\tif len(src.Ignore) > len(dst.Ignore) {\n\t\t\t\tif cap(dst.Ignore) >= len(src.Ignore) {\n\t\t\t\t\tdst.Ignore = (dst.Ignore)[:len(src.Ignore)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Ignore = make([]string, len(src.Ignore))\n\t\t\t\t}\n\t\t\t} else if len(src.Ignore) < len(dst.Ignore) {\n\t\t\t\tdst.Ignore = (dst.Ignore)[:len(src.Ignore)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Ignore = make([]string, len(src.Ignore))\n\t\t}\n\t\tcopy(dst.Ignore, src.Ignore)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_41 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_41(dst, src *WeightDevice) {\n\tdst.Path = src.Path\n\tdst.Weight = src.Weight\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_42 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_42(dst, src *ThrottleDevice) {\n\tdst.Path = src.Path\n\tdst.Rate = src.Rate\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_43 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_43(dst, src *Resource) {\n\tdst.NanoCPUs = src.NanoCPUs\n\tdst.MemoryBytes = src.MemoryBytes\n\tdst.Pids = src.Pids\n\tif src.Devices == nil {\n\t\tdst.Devices = nil\n\t} else {\n\t\tif dst.Devices != nil {\n\t\t\tif len(src.Devices) > len(dst.Devices) {\n\t\t\t\tif cap(dst.Devices) >= len(src.Devices) {\n\t\t\t\t\tdst.Devices = (dst.Devices)[:len(src.Devices)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Devices = make([]DeviceRequest, len(src.Devices))\n\t\t\t\t}\n\t\t\t} else if len(src.Devices) < len(dst.Devices) {\n\t\t\t\tdst.Devices = (dst.Devices)[:len(src.Devices)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Devices = make([]DeviceRequest, len(src.Devices))\n\t\t}\n\t\tderiveDeepCopy_49(dst.Devices, src.Devices)\n\t}\n\tif src.GenericResources == nil {\n\t\tdst.GenericResources = nil\n\t} else {\n\t\tif dst.GenericResources != nil {\n\t\t\tif len(src.GenericResources) > len(dst.GenericResources) {\n\t\t\t\tif cap(dst.GenericResources) >= len(src.GenericResources) {\n\t\t\t\t\tdst.GenericResources = (dst.GenericResources)[:len(src.GenericResources)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.GenericResources = make([]GenericResource, len(src.GenericResources))\n\t\t\t\t}\n\t\t\t} else if len(src.GenericResources) < len(dst.GenericResources) {\n\t\t\t\tdst.GenericResources = (dst.GenericResources)[:len(src.GenericResources)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.GenericResources = make([]GenericResource, len(src.GenericResources))\n\t\t}\n\t\tderiveDeepCopy_50(dst.GenericResources, src.GenericResources)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_44 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_44(dst, src []PlacementPreferences) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(PlacementPreferences)\n\t\t\tderiveDeepCopy_51(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_45 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_45(dst, src *ServiceVolumeBind) {\n\tdst.SELinux = src.SELinux\n\tdst.Propagation = src.Propagation\n\tdst.CreateHostPath = src.CreateHostPath\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_46 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_46(dst, src *ServiceVolumeVolume) {\n\tdst.NoCopy = src.NoCopy\n\tdst.Subpath = src.Subpath\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_47 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_47(dst, src *ServiceVolumeTmpfs) {\n\tdst.Size = src.Size\n\tdst.Mode = src.Mode\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_48 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_48(dst, src []*IPAMPool) {\n\tfor src_i, src_value := range src {\n\t\tif src_value == nil {\n\t\t\tdst[src_i] = nil\n\t\t} else {\n\t\t\tdst[src_i] = new(IPAMPool)\n\t\t\tderiveDeepCopy_52(dst[src_i], src_value)\n\t\t}\n\t}\n}\n\n// deriveDeepCopy_49 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_49(dst, src []DeviceRequest) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(DeviceRequest)\n\t\t\tderiveDeepCopy_53(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_50 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_50(dst, src []GenericResource) {\n\tfor src_i, src_value := range src {\n\t\tfunc() {\n\t\t\tfield := new(GenericResource)\n\t\t\tderiveDeepCopy_54(field, &src_value)\n\t\t\tdst[src_i] = *field\n\t\t}()\n\t}\n}\n\n// deriveDeepCopy_51 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_51(dst, src *PlacementPreferences) {\n\tdst.Spread = src.Spread\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_52 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_52(dst, src *IPAMPool) {\n\tdst.Subnet = src.Subnet\n\tdst.Gateway = src.Gateway\n\tdst.IPRange = src.IPRange\n\tif src.AuxiliaryAddresses != nil {\n\t\tdst.AuxiliaryAddresses = make(map[string]string, len(src.AuxiliaryAddresses))\n\t\tderiveDeepCopy_4(dst.AuxiliaryAddresses, src.AuxiliaryAddresses)\n\t} else {\n\t\tdst.AuxiliaryAddresses = nil\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_53 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_53(dst, src *DeviceRequest) {\n\tif src.Capabilities == nil {\n\t\tdst.Capabilities = nil\n\t} else {\n\t\tif dst.Capabilities != nil {\n\t\t\tif len(src.Capabilities) > len(dst.Capabilities) {\n\t\t\t\tif cap(dst.Capabilities) >= len(src.Capabilities) {\n\t\t\t\t\tdst.Capabilities = (dst.Capabilities)[:len(src.Capabilities)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.Capabilities = make([]string, len(src.Capabilities))\n\t\t\t\t}\n\t\t\t} else if len(src.Capabilities) < len(dst.Capabilities) {\n\t\t\t\tdst.Capabilities = (dst.Capabilities)[:len(src.Capabilities)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.Capabilities = make([]string, len(src.Capabilities))\n\t\t}\n\t\tcopy(dst.Capabilities, src.Capabilities)\n\t}\n\tdst.Driver = src.Driver\n\tdst.Count = src.Count\n\tif src.IDs == nil {\n\t\tdst.IDs = nil\n\t} else {\n\t\tif dst.IDs != nil {\n\t\t\tif len(src.IDs) > len(dst.IDs) {\n\t\t\t\tif cap(dst.IDs) >= len(src.IDs) {\n\t\t\t\t\tdst.IDs = (dst.IDs)[:len(src.IDs)]\n\t\t\t\t} else {\n\t\t\t\t\tdst.IDs = make([]string, len(src.IDs))\n\t\t\t\t}\n\t\t\t} else if len(src.IDs) < len(dst.IDs) {\n\t\t\t\tdst.IDs = (dst.IDs)[:len(src.IDs)]\n\t\t\t}\n\t\t} else {\n\t\t\tdst.IDs = make([]string, len(src.IDs))\n\t\t}\n\t\tcopy(dst.IDs, src.IDs)\n\t}\n}\n\n// deriveDeepCopy_54 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_54(dst, src *GenericResource) {\n\tif src.DiscreteResourceSpec == nil {\n\t\tdst.DiscreteResourceSpec = nil\n\t} else {\n\t\tdst.DiscreteResourceSpec = new(DiscreteGenericResource)\n\t\tderiveDeepCopy_55(dst.DiscreteResourceSpec, src.DiscreteResourceSpec)\n\t}\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n\n// deriveDeepCopy_55 recursively copies the contents of src into dst.\nfunc deriveDeepCopy_55(dst, src *DiscreteGenericResource) {\n\tdst.Kind = src.Kind\n\tdst.Value = src.Value\n\tif src.Extensions != nil {\n\t\tdst.Extensions = make(map[string]any, len(src.Extensions))\n\t\tsrc.Extensions.DeepCopy(dst.Extensions)\n\t} else {\n\t\tdst.Extensions = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/develop.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\ntype DevelopConfig struct {\n\tWatch []Trigger `yaml:\"watch,omitempty\" json:\"watch,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\ntype WatchAction string\n\nconst (\n\tWatchActionSync        WatchAction = \"sync\"\n\tWatchActionRebuild     WatchAction = \"rebuild\"\n\tWatchActionSyncRestart WatchAction = \"sync+restart\"\n)\n\ntype Trigger struct {\n\tPath       string      `yaml:\"path\" json:\"path\"`\n\tAction     WatchAction `yaml:\"action\" json:\"action\"`\n\tTarget     string      `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tIgnore     []string    `yaml:\"ignore,omitempty\" json:\"ignore,omitempty\"`\n\tExtensions Extensions  `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/device.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype DeviceRequest struct {\n\tCapabilities []string    `yaml:\"capabilities,omitempty\" json:\"capabilities,omitempty\"`\n\tDriver       string      `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tCount        DeviceCount `yaml:\"count,omitempty\" json:\"count,omitempty\"`\n\tIDs          []string    `yaml:\"device_ids,omitempty\" json:\"device_ids,omitempty\"`\n}\n\ntype DeviceCount int64\n\nfunc (c *DeviceCount) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase int:\n\t\t*c = DeviceCount(v)\n\tcase string:\n\t\tif strings.ToLower(v) == \"all\" {\n\t\t\t*c = -1\n\t\t\treturn nil\n\t\t}\n\t\ti, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid value %q, the only value allowed is 'all' or a number\", v)\n\t\t}\n\t\t*c = DeviceCount(i)\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid type %T for device count\", v)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/duration.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Duration is a thin wrapper around time.Duration with improved JSON marshalling\ntype Duration time.Duration\n\nfunc (d Duration) String() string {\n\treturn time.Duration(d).String()\n}\n\nfunc (d *Duration) DecodeMapstructure(value interface{}) error {\n\tv, err := time.ParseDuration(fmt.Sprint(value))\n\tif err != nil {\n\t\treturn err\n\t}\n\t*d = Duration(v)\n\treturn nil\n}\n\n// MarshalJSON makes Duration implement json.Marshaler\nfunc (d Duration) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(d.String())\n}\n\n// MarshalYAML makes Duration implement yaml.Marshaler\nfunc (d Duration) MarshalYAML() (interface{}, error) {\n\treturn d.String(), nil\n}\n\nfunc (d *Duration) UnmarshalJSON(b []byte) error {\n\ts := strings.Trim(string(b), \"\\\"\")\n\ttimeDuration, err := time.ParseDuration(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*d = Duration(timeDuration)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/envfile.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n)\n\ntype EnvFile struct {\n\tPath     string `yaml:\"path,omitempty\" json:\"path,omitempty\"`\n\tRequired bool   `yaml:\"required\" json:\"required\"`\n}\n\n// MarshalYAML makes EnvFile implement yaml.Marshaler\nfunc (e EnvFile) MarshalYAML() (interface{}, error) {\n\tif e.Required {\n\t\treturn e.Path, nil\n\t}\n\treturn map[string]any{\n\t\t\"path\":     e.Path,\n\t\t\"required\": e.Required,\n\t}, nil\n}\n\n// MarshalJSON makes EnvFile implement json.Marshaler\nfunc (e *EnvFile) MarshalJSON() ([]byte, error) {\n\tif e.Required {\n\t\treturn json.Marshal(e.Path)\n\t}\n\t// Pass as a value to avoid re-entering this method and use the default implementation\n\treturn json.Marshal(*e)\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/healthcheck.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n)\n\n// HealthCheckConfig the healthcheck configuration for a service\ntype HealthCheckConfig struct {\n\tTest          HealthCheckTest `yaml:\"test,omitempty\" json:\"test,omitempty\"`\n\tTimeout       *Duration       `yaml:\"timeout,omitempty\" json:\"timeout,omitempty\"`\n\tInterval      *Duration       `yaml:\"interval,omitempty\" json:\"interval,omitempty\"`\n\tRetries       *uint64         `yaml:\"retries,omitempty\" json:\"retries,omitempty\"`\n\tStartPeriod   *Duration       `yaml:\"start_period,omitempty\" json:\"start_period,omitempty\"`\n\tStartInterval *Duration       `yaml:\"start_interval,omitempty\" json:\"start_interval,omitempty\"`\n\tDisable       bool            `yaml:\"disable,omitempty\" json:\"disable,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// HealthCheckTest is the command run to test the health of a service\ntype HealthCheckTest []string\n\nfunc (l *HealthCheckTest) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase string:\n\t\t*l = []string{\"CMD-SHELL\", v}\n\tcase []interface{}:\n\t\tseq := make([]string, len(v))\n\t\tfor i, e := range v {\n\t\t\tseq[i] = e.(string)\n\t\t}\n\t\t*l = seq\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for healthcheck.test\", value)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/hostList.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// HostsList is a list of colon-separated host-ip mappings\ntype HostsList map[string][]string\n\n// NewHostsList creates a HostsList from a list of `host=ip` strings\nfunc NewHostsList(hosts []string) (HostsList, error) {\n\tlist := HostsList{}\n\tfor _, s := range hosts {\n\t\tvar found bool\n\t\tfor _, sep := range hostListSerapators {\n\t\t\thost, ip, ok := strings.Cut(s, sep)\n\t\t\tif ok {\n\t\t\t\t// Mapping found with this separator, stop here.\n\t\t\t\tif ips, ok := list[host]; ok {\n\t\t\t\t\tlist[host] = append(ips, strings.Split(ip, \",\")...)\n\t\t\t\t} else {\n\t\t\t\t\tlist[host] = strings.Split(ip, \",\")\n\t\t\t\t}\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"invalid additional host, missing IP: %s\", s)\n\t\t}\n\t}\n\terr := list.cleanup()\n\treturn list, err\n}\n\n// AsList returns host-ip mappings as a list of strings, using the given\n// separator. The Docker Engine API expects ':' separators, the original format\n// for '--add-hosts'. But an '=' separator is used in YAML/JSON renderings to\n// make IPv6 addresses more readable (for example \"my-host=::1\" instead of\n// \"my-host:::1\").\nfunc (h HostsList) AsList(sep string) []string {\n\tl := make([]string, 0, len(h))\n\tfor k, v := range h {\n\t\tfor _, ip := range v {\n\t\t\tl = append(l, fmt.Sprintf(\"%s%s%s\", k, sep, ip))\n\t\t}\n\t}\n\treturn l\n}\n\nfunc (h HostsList) MarshalYAML() (interface{}, error) {\n\tlist := h.AsList(\"=\")\n\tsort.Strings(list)\n\treturn list, nil\n}\n\nfunc (h HostsList) MarshalJSON() ([]byte, error) {\n\tlist := h.AsList(\"=\")\n\tsort.Strings(list)\n\treturn json.Marshal(list)\n}\n\nvar hostListSerapators = []string{\"=\", \":\"}\n\nfunc (h *HostsList) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase map[string]interface{}:\n\t\tlist := make(HostsList, len(v))\n\t\tfor i, e := range v {\n\t\t\tif e == nil {\n\t\t\t\te = \"\"\n\t\t\t}\n\t\t\tswitch t := e.(type) {\n\t\t\tcase string:\n\t\t\t\tlist[i] = []string{t}\n\t\t\tcase []any:\n\t\t\t\thosts := make([]string, len(t))\n\t\t\t\tfor j, h := range t {\n\t\t\t\t\thosts[j] = fmt.Sprint(h)\n\t\t\t\t}\n\t\t\t\tlist[i] = hosts\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unexpected value type %T for extra_hosts entry\", value)\n\t\t\t}\n\t\t}\n\t\terr := list.cleanup()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*h = list\n\t\treturn nil\n\tcase []interface{}:\n\t\ts := make([]string, len(v))\n\t\tfor i, e := range v {\n\t\t\ts[i] = fmt.Sprint(e)\n\t\t}\n\t\tlist, err := NewHostsList(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*h = list\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for extra_hosts\", value)\n\t}\n}\n\nfunc (h HostsList) cleanup() error {\n\tfor host, ips := range h {\n\t\t// Check that there is a hostname and that it doesn't contain either\n\t\t// of the allowed separators, to generate a clearer error than the\n\t\t// engine would do if it splits the string differently.\n\t\tif host == \"\" || strings.ContainsAny(host, \":=\") {\n\t\t\treturn fmt.Errorf(\"bad host name '%s'\", host)\n\t\t}\n\t\tfor i, ip := range ips {\n\t\t\t// Remove brackets from IP addresses (for example \"[::1]\" -> \"::1\").\n\t\t\tif len(ip) > 2 && ip[0] == '[' && ip[len(ip)-1] == ']' {\n\t\t\t\tips[i] = ip[1 : len(ip)-1]\n\t\t\t}\n\t\t}\n\t\th[host] = ips\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/labels.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Labels is a mapping type for labels\ntype Labels map[string]string\n\nfunc (l Labels) Add(key, value string) Labels {\n\tif l == nil {\n\t\tl = Labels{}\n\t}\n\tl[key] = value\n\treturn l\n}\n\nfunc (l Labels) AsList() []string {\n\ts := make([]string, len(l))\n\ti := 0\n\tfor k, v := range l {\n\t\ts[i] = fmt.Sprintf(\"%s=%s\", k, v)\n\t\ti++\n\t}\n\treturn s\n}\n\n// label value can be a string | number | boolean | null (empty)\nfunc labelValue(e interface{}) string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\tswitch v := e.(type) {\n\tcase string:\n\t\treturn v\n\tdefault:\n\t\treturn fmt.Sprint(v)\n\t}\n}\n\nfunc (l *Labels) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase map[string]interface{}:\n\t\tlabels := make(map[string]string, len(v))\n\t\tfor k, e := range v {\n\t\t\tlabels[k] = labelValue(e)\n\t\t}\n\t\t*l = labels\n\tcase []interface{}:\n\t\tlabels := make(map[string]string, len(v))\n\t\tfor _, s := range v {\n\t\t\tk, e, _ := strings.Cut(fmt.Sprint(s), \"=\")\n\t\t\tlabels[k] = labelValue(e)\n\t\t}\n\t\t*l = labels\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for labels\", value)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/mapping.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// MappingWithEquals is a mapping type that can be converted from a list of\n// key[=value] strings.\n// For the key with an empty value (`key=`), the mapped value is set to a pointer to `\"\"`.\n// For the key without value (`key`), the mapped value is set to nil.\ntype MappingWithEquals map[string]*string\n\n// NewMappingWithEquals build a new Mapping from a set of KEY=VALUE strings\nfunc NewMappingWithEquals(values []string) MappingWithEquals {\n\tmapping := MappingWithEquals{}\n\tfor _, env := range values {\n\t\ttokens := strings.SplitN(env, \"=\", 2)\n\t\tif len(tokens) > 1 {\n\t\t\tmapping[tokens[0]] = &tokens[1]\n\t\t} else {\n\t\t\tmapping[env] = nil\n\t\t}\n\t}\n\treturn mapping\n}\n\n// OverrideBy update MappingWithEquals with values from another MappingWithEquals\nfunc (m MappingWithEquals) OverrideBy(other MappingWithEquals) MappingWithEquals {\n\tfor k, v := range other {\n\t\tm[k] = v\n\t}\n\treturn m\n}\n\n// Resolve update a MappingWithEquals for keys without value (`key`, but not `key=`)\nfunc (m MappingWithEquals) Resolve(lookupFn func(string) (string, bool)) MappingWithEquals {\n\tfor k, v := range m {\n\t\tif v == nil {\n\t\t\tif value, ok := lookupFn(k); ok {\n\t\t\t\tm[k] = &value\n\t\t\t}\n\t\t}\n\t}\n\treturn m\n}\n\n// RemoveEmpty excludes keys that are not associated with a value\nfunc (m MappingWithEquals) RemoveEmpty() MappingWithEquals {\n\tfor k, v := range m {\n\t\tif v == nil {\n\t\t\tdelete(m, k)\n\t\t}\n\t}\n\treturn m\n}\n\nfunc (m *MappingWithEquals) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase map[string]interface{}:\n\t\tmapping := make(MappingWithEquals, len(v))\n\t\tfor k, e := range v {\n\t\t\tmapping[k] = mappingValue(e)\n\t\t}\n\t\t*m = mapping\n\tcase []interface{}:\n\t\tmapping := make(MappingWithEquals, len(v))\n\t\tfor _, s := range v {\n\t\t\tk, e, ok := strings.Cut(fmt.Sprint(s), \"=\")\n\t\t\tif !ok {\n\t\t\t\tmapping[k] = nil\n\t\t\t} else {\n\t\t\t\tmapping[k] = mappingValue(e)\n\t\t\t}\n\t\t}\n\t\t*m = mapping\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for mapping\", value)\n\t}\n\treturn nil\n}\n\n// label value can be a string | number | boolean | null\nfunc mappingValue(e interface{}) *string {\n\tif e == nil {\n\t\treturn nil\n\t}\n\tswitch v := e.(type) {\n\tcase string:\n\t\treturn &v\n\tdefault:\n\t\ts := fmt.Sprint(v)\n\t\treturn &s\n\t}\n}\n\n// Mapping is a mapping type that can be converted from a list of\n// key[=value] strings.\n// For the key with an empty value (`key=`), or key without value (`key`), the\n// mapped value is set to an empty string `\"\"`.\ntype Mapping map[string]string\n\n// NewMapping build a new Mapping from a set of KEY=VALUE strings\nfunc NewMapping(values []string) Mapping {\n\tmapping := Mapping{}\n\tfor _, value := range values {\n\t\tparts := strings.SplitN(value, \"=\", 2)\n\t\tkey := parts[0]\n\t\tswitch {\n\t\tcase len(parts) == 1:\n\t\t\tmapping[key] = \"\"\n\t\tdefault:\n\t\t\tmapping[key] = parts[1]\n\t\t}\n\t}\n\treturn mapping\n}\n\n// convert values into a set of KEY=VALUE strings\nfunc (m Mapping) Values() []string {\n\tvalues := make([]string, 0, len(m))\n\tfor k, v := range m {\n\t\tvalues = append(values, fmt.Sprintf(\"%s=%s\", k, v))\n\t}\n\tsort.Strings(values)\n\treturn values\n}\n\n// ToMappingWithEquals converts Mapping into a MappingWithEquals with pointer references\nfunc (m Mapping) ToMappingWithEquals() MappingWithEquals {\n\tmapping := MappingWithEquals{}\n\tfor k, v := range m {\n\t\tv := v\n\t\tmapping[k] = &v\n\t}\n\treturn mapping\n}\n\nfunc (m Mapping) Resolve(s string) (string, bool) {\n\tv, ok := m[s]\n\treturn v, ok\n}\n\nfunc (m Mapping) Clone() Mapping {\n\tclone := Mapping{}\n\tfor k, v := range m {\n\t\tclone[k] = v\n\t}\n\treturn clone\n}\n\n// Merge adds all values from second mapping which are not already defined\nfunc (m Mapping) Merge(o Mapping) Mapping {\n\tfor k, v := range o {\n\t\tif _, set := m[k]; !set {\n\t\t\tm[k] = v\n\t\t}\n\t}\n\treturn m\n}\n\nfunc (m *Mapping) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase map[string]interface{}:\n\t\tmapping := make(Mapping, len(v))\n\t\tfor k, e := range v {\n\t\t\tif e == nil {\n\t\t\t\te = \"\"\n\t\t\t}\n\t\t\tmapping[k] = fmt.Sprint(e)\n\t\t}\n\t\t*m = mapping\n\tcase []interface{}:\n\t\t*m = decodeMapping(v, \"=\")\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for mapping\", value)\n\t}\n\treturn nil\n}\n\n// Generate a mapping by splitting strings at any of seps, which will be tried\n// in-order for each input string. (For example, to allow the preferred 'host=ip'\n// in 'extra_hosts', as well as 'host:ip' for backwards compatibility.)\nfunc decodeMapping(v []interface{}, seps ...string) map[string]string {\n\tmapping := make(Mapping, len(v))\n\tfor _, s := range v {\n\t\tfor i, sep := range seps {\n\t\t\tk, e, ok := strings.Cut(fmt.Sprint(s), sep)\n\t\t\tif ok {\n\t\t\t\t// Mapping found with this separator, stop here.\n\t\t\t\tmapping[k] = e\n\t\t\t\tbreak\n\t\t\t} else if i == len(seps)-1 {\n\t\t\t\t// No more separators to try, map to empty string.\n\t\t\t\tmapping[k] = \"\"\n\t\t\t}\n\t\t}\n\t}\n\treturn mapping\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/options.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport \"fmt\"\n\n// Options is a mapping type for options we pass as-is to container runtime\ntype Options map[string]string\n\nfunc (d *Options) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase map[string]interface{}:\n\t\tm := make(map[string]string)\n\t\tfor key, e := range v {\n\t\t\tif e == nil {\n\t\t\t\tm[key] = \"\"\n\t\t\t} else {\n\t\t\t\tm[key] = fmt.Sprint(e)\n\t\t\t}\n\t\t}\n\t\t*d = m\n\tcase map[string]string:\n\t\t*d = v\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid type %T for options\", value)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/project.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\n\t\"github.com/compose-spec/compose-go/v2/dotenv\"\n\t\"github.com/compose-spec/compose-go/v2/errdefs\"\n\t\"github.com/compose-spec/compose-go/v2/utils\"\n\t\"github.com/distribution/reference\"\n\tgodigest \"github.com/opencontainers/go-digest\"\n\t\"golang.org/x/exp/maps\"\n\t\"golang.org/x/sync/errgroup\"\n\t\"gopkg.in/yaml.v3\"\n)\n\n// Project is the result of loading a set of compose files\n// Since v2, Project are managed as immutable objects.\n// Each public functions which mutate Project state now return a copy of the original Project with the expected changes.\ntype Project struct {\n\tName       string     `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tWorkingDir string     `yaml:\"-\" json:\"-\"`\n\tServices   Services   `yaml:\"services\" json:\"services\"`\n\tNetworks   Networks   `yaml:\"networks,omitempty\" json:\"networks,omitempty\"`\n\tVolumes    Volumes    `yaml:\"volumes,omitempty\" json:\"volumes,omitempty\"`\n\tSecrets    Secrets    `yaml:\"secrets,omitempty\" json:\"secrets,omitempty\"`\n\tConfigs    Configs    `yaml:\"configs,omitempty\" json:\"configs,omitempty\"`\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"` // https://github.com/golang/go/issues/6213\n\n\tComposeFiles []string `yaml:\"-\" json:\"-\"`\n\tEnvironment  Mapping  `yaml:\"-\" json:\"-\"`\n\n\t// DisabledServices track services which have been disable as profile is not active\n\tDisabledServices Services `yaml:\"-\" json:\"-\"`\n\tProfiles         []string `yaml:\"-\" json:\"-\"`\n}\n\n// ServiceNames return names for all services in this Compose config\nfunc (p *Project) ServiceNames() []string {\n\tvar names []string\n\tfor k := range p.Services {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\n// DisabledServiceNames return names for all disabled services in this Compose config\nfunc (p *Project) DisabledServiceNames() []string {\n\tvar names []string\n\tfor k := range p.DisabledServices {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\n// VolumeNames return names for all volumes in this Compose config\nfunc (p *Project) VolumeNames() []string {\n\tvar names []string\n\tfor k := range p.Volumes {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\n// NetworkNames return names for all volumes in this Compose config\nfunc (p *Project) NetworkNames() []string {\n\tvar names []string\n\tfor k := range p.Networks {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\n// SecretNames return names for all secrets in this Compose config\nfunc (p *Project) SecretNames() []string {\n\tvar names []string\n\tfor k := range p.Secrets {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\n// ConfigNames return names for all configs in this Compose config\nfunc (p *Project) ConfigNames() []string {\n\tvar names []string\n\tfor k := range p.Configs {\n\t\tnames = append(names, k)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\nfunc (p *Project) ServicesWithBuild() []string {\n\tservicesBuild := p.Services.Filter(func(s ServiceConfig) bool {\n\t\treturn s.Build != nil && s.Build.Context != \"\"\n\t})\n\treturn maps.Keys(servicesBuild)\n}\n\nfunc (p *Project) ServicesWithExtends() []string {\n\tservicesExtends := p.Services.Filter(func(s ServiceConfig) bool {\n\t\treturn s.Extends != nil && *s.Extends != (ExtendsConfig{})\n\t})\n\treturn maps.Keys(servicesExtends)\n}\n\nfunc (p *Project) ServicesWithDependsOn() []string {\n\tservicesDependsOn := p.Services.Filter(func(s ServiceConfig) bool {\n\t\treturn len(s.DependsOn) > 0\n\t})\n\treturn maps.Keys(servicesDependsOn)\n}\n\nfunc (p *Project) ServicesWithCapabilities() ([]string, []string, []string) {\n\tcapabilities := []string{}\n\tgpu := []string{}\n\ttpu := []string{}\n\tfor _, service := range p.Services {\n\t\tdeploy := service.Deploy\n\t\tif deploy == nil {\n\t\t\tcontinue\n\t\t}\n\t\treservation := deploy.Resources.Reservations\n\t\tif reservation == nil {\n\t\t\tcontinue\n\t\t}\n\t\tdevices := reservation.Devices\n\t\tfor _, d := range devices {\n\t\t\tif len(d.Capabilities) > 0 {\n\t\t\t\tcapabilities = append(capabilities, service.Name)\n\t\t\t}\n\t\t\tfor _, c := range d.Capabilities {\n\t\t\t\tif c == \"gpu\" {\n\t\t\t\t\tgpu = append(gpu, service.Name)\n\t\t\t\t} else if c == \"tpu\" {\n\t\t\t\t\ttpu = append(tpu, service.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn utils.RemoveDuplicates(capabilities), utils.RemoveDuplicates(gpu), utils.RemoveDuplicates(tpu)\n}\n\n// GetServices retrieve services by names, or return all services if no name specified\nfunc (p *Project) GetServices(names ...string) (Services, error) {\n\tif len(names) == 0 {\n\t\treturn p.Services, nil\n\t}\n\tservices := Services{}\n\tfor _, name := range names {\n\t\tservice, err := p.GetService(name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tservices[name] = service\n\t}\n\treturn services, nil\n}\n\nfunc (p *Project) getServicesByNames(names ...string) (Services, []string) {\n\tif len(names) == 0 {\n\t\treturn p.Services, nil\n\t}\n\tservices := Services{}\n\tvar servicesNotFound []string\n\tfor _, name := range names {\n\t\tservice, ok := p.Services[name]\n\t\tif !ok {\n\t\t\tservicesNotFound = append(servicesNotFound, name)\n\t\t\tcontinue\n\t\t}\n\t\tservices[name] = service\n\t}\n\treturn services, servicesNotFound\n}\n\n// GetDisabledService retrieve disabled service by name\nfunc (p Project) GetDisabledService(name string) (ServiceConfig, error) {\n\tservice, ok := p.DisabledServices[name]\n\tif !ok {\n\t\treturn ServiceConfig{}, fmt.Errorf(\"no such service: %s\", name)\n\t}\n\treturn service, nil\n}\n\n// GetService retrieve a specific service by name\nfunc (p *Project) GetService(name string) (ServiceConfig, error) {\n\tservice, ok := p.Services[name]\n\tif !ok {\n\t\t_, ok := p.DisabledServices[name]\n\t\tif ok {\n\t\t\treturn ServiceConfig{}, fmt.Errorf(\"no such service: %s: %w\", name, errdefs.ErrDisabled)\n\t\t}\n\t\treturn ServiceConfig{}, fmt.Errorf(\"no such service: %s: %w\", name, errdefs.ErrNotFound)\n\t}\n\treturn service, nil\n}\n\nfunc (p *Project) AllServices() Services {\n\tall := Services{}\n\tfor name, service := range p.Services {\n\t\tall[name] = service\n\t}\n\tfor name, service := range p.DisabledServices {\n\t\tall[name] = service\n\t}\n\treturn all\n}\n\ntype ServiceFunc func(name string, service *ServiceConfig) error\n\n// ForEachService runs ServiceFunc on each service and dependencies according to DependencyPolicy\nfunc (p *Project) ForEachService(names []string, fn ServiceFunc, options ...DependencyOption) error {\n\tif len(options) == 0 {\n\t\t// backward compatibility\n\t\toptions = []DependencyOption{IncludeDependencies}\n\t}\n\treturn p.withServices(names, fn, map[string]bool{}, options, map[string]ServiceDependency{})\n}\n\ntype withServicesOptions struct {\n\tdependencyPolicy int\n}\n\nconst (\n\tincludeDependencies = iota\n\tincludeDependents\n\tignoreDependencies\n)\n\nfunc (p *Project) withServices(names []string, fn ServiceFunc, seen map[string]bool, options []DependencyOption, dependencies map[string]ServiceDependency) error {\n\tservices, servicesNotFound := p.getServicesByNames(names...)\n\tif len(servicesNotFound) > 0 {\n\t\tfor _, serviceNotFound := range servicesNotFound {\n\t\t\tif dependency, ok := dependencies[serviceNotFound]; !ok || dependency.Required {\n\t\t\t\treturn fmt.Errorf(\"no such service: %s\", serviceNotFound)\n\t\t\t}\n\t\t}\n\t}\n\topts := withServicesOptions{\n\t\tdependencyPolicy: includeDependencies,\n\t}\n\tfor _, option := range options {\n\t\toption(&opts)\n\t}\n\n\tfor name, service := range services {\n\t\tif seen[name] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[name] = true\n\t\tvar dependencies map[string]ServiceDependency\n\t\tswitch opts.dependencyPolicy {\n\t\tcase includeDependents:\n\t\t\tdependencies = utils.MapsAppend(dependencies, p.dependentsForService(service))\n\t\tcase includeDependencies:\n\t\t\tdependencies = utils.MapsAppend(dependencies, service.DependsOn)\n\t\tcase ignoreDependencies:\n\t\t\t// Noop\n\t\t}\n\t\tif len(dependencies) > 0 {\n\t\t\terr := p.withServices(utils.MapKeys(dependencies), fn, seen, options, dependencies)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := fn(name, service.deepCopy()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (p *Project) GetDependentsForService(s ServiceConfig) []string {\n\treturn utils.MapKeys(p.dependentsForService(s))\n}\n\nfunc (p *Project) dependentsForService(s ServiceConfig) map[string]ServiceDependency {\n\tdependent := make(map[string]ServiceDependency)\n\tfor _, service := range p.Services {\n\t\tfor name, dependency := range service.DependsOn {\n\t\t\tif name == s.Name {\n\t\t\t\tdependent[service.Name] = dependency\n\t\t\t}\n\t\t}\n\t}\n\treturn dependent\n}\n\n// RelativePath resolve a relative path based project's working directory\nfunc (p *Project) RelativePath(path string) string {\n\tif path[0] == '~' {\n\t\thome, _ := os.UserHomeDir()\n\t\tpath = filepath.Join(home, path[1:])\n\t}\n\tif filepath.IsAbs(path) {\n\t\treturn path\n\t}\n\treturn filepath.Join(p.WorkingDir, path)\n}\n\n// HasProfile return true if service has no profile declared or has at least one profile matching\nfunc (s ServiceConfig) HasProfile(profiles []string) bool {\n\tif len(s.Profiles) == 0 {\n\t\treturn true\n\t}\n\tfor _, p := range profiles {\n\t\tif p == \"*\" {\n\t\t\treturn true\n\t\t}\n\t\tfor _, sp := range s.Profiles {\n\t\t\tif sp == p {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\n// WithProfiles disables services which don't match selected profiles\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithProfiles(profiles []string) (*Project, error) {\n\tnewProject := p.deepCopy()\n\tenabled := Services{}\n\tdisabled := Services{}\n\tfor name, service := range newProject.AllServices() {\n\t\tif service.HasProfile(profiles) {\n\t\t\tenabled[name] = service\n\t\t} else {\n\t\t\tdisabled[name] = service\n\t\t}\n\t}\n\tnewProject.Services = enabled\n\tnewProject.DisabledServices = disabled\n\tnewProject.Profiles = profiles\n\treturn newProject, nil\n}\n\n// WithServicesEnabled ensures services are enabled and activate profiles accordingly\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithServicesEnabled(names ...string) (*Project, error) {\n\tnewProject := p.deepCopy()\n\tif len(names) == 0 {\n\t\treturn newProject, nil\n\t}\n\n\tprofiles := append([]string{}, p.Profiles...)\n\tfor _, name := range names {\n\t\tif _, ok := newProject.Services[name]; ok {\n\t\t\t// already enabled\n\t\t\tcontinue\n\t\t}\n\t\tservice := p.DisabledServices[name]\n\t\tprofiles = append(profiles, service.Profiles...)\n\t}\n\tnewProject, err := newProject.WithProfiles(profiles)\n\tif err != nil {\n\t\treturn newProject, err\n\t}\n\n\treturn newProject.WithServicesEnvironmentResolved(true)\n}\n\n// WithoutUnnecessaryResources drops networks/volumes/secrets/configs that are not referenced by active services\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithoutUnnecessaryResources() *Project {\n\tnewProject := p.deepCopy()\n\trequiredNetworks := map[string]struct{}{}\n\trequiredVolumes := map[string]struct{}{}\n\trequiredSecrets := map[string]struct{}{}\n\trequiredConfigs := map[string]struct{}{}\n\tfor _, s := range newProject.Services {\n\t\tfor k := range s.Networks {\n\t\t\trequiredNetworks[k] = struct{}{}\n\t\t}\n\t\tfor _, v := range s.Volumes {\n\t\t\tif v.Type != VolumeTypeVolume || v.Source == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trequiredVolumes[v.Source] = struct{}{}\n\t\t}\n\t\tfor _, v := range s.Secrets {\n\t\t\trequiredSecrets[v.Source] = struct{}{}\n\t\t}\n\t\tif s.Build != nil {\n\t\t\tfor _, v := range s.Build.Secrets {\n\t\t\t\trequiredSecrets[v.Source] = struct{}{}\n\t\t\t}\n\t\t}\n\t\tfor _, v := range s.Configs {\n\t\t\trequiredConfigs[v.Source] = struct{}{}\n\t\t}\n\t}\n\n\tnetworks := Networks{}\n\tfor k := range requiredNetworks {\n\t\tif value, ok := p.Networks[k]; ok {\n\t\t\tnetworks[k] = value\n\t\t}\n\t}\n\tnewProject.Networks = networks\n\n\tvolumes := Volumes{}\n\tfor k := range requiredVolumes {\n\t\tif value, ok := p.Volumes[k]; ok {\n\t\t\tvolumes[k] = value\n\t\t}\n\t}\n\tnewProject.Volumes = volumes\n\n\tsecrets := Secrets{}\n\tfor k := range requiredSecrets {\n\t\tif value, ok := p.Secrets[k]; ok {\n\t\t\tsecrets[k] = value\n\t\t}\n\t}\n\tnewProject.Secrets = secrets\n\n\tconfigs := Configs{}\n\tfor k := range requiredConfigs {\n\t\tif value, ok := p.Configs[k]; ok {\n\t\t\tconfigs[k] = value\n\t\t}\n\t}\n\tnewProject.Configs = configs\n\treturn newProject\n}\n\ntype DependencyOption func(options *withServicesOptions)\n\nfunc IncludeDependencies(options *withServicesOptions) {\n\toptions.dependencyPolicy = includeDependencies\n}\n\nfunc IncludeDependents(options *withServicesOptions) {\n\toptions.dependencyPolicy = includeDependents\n}\n\nfunc IgnoreDependencies(options *withServicesOptions) {\n\toptions.dependencyPolicy = ignoreDependencies\n}\n\n// WithSelectedServices restricts the project model to selected services and dependencies\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithSelectedServices(names []string, options ...DependencyOption) (*Project, error) {\n\tnewProject := p.deepCopy()\n\tif len(names) == 0 {\n\t\t// All services\n\t\treturn newProject, nil\n\t}\n\n\tset := utils.NewSet[string]()\n\terr := p.ForEachService(names, func(name string, service *ServiceConfig) error {\n\t\tset.Add(name)\n\t\treturn nil\n\t}, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Disable all services which are not explicit target or dependencies\n\tenabled := Services{}\n\tfor name, s := range newProject.Services {\n\t\tif _, ok := set[name]; ok {\n\t\t\t// remove all dependencies but those implied by explicitly selected services\n\t\t\tdependencies := s.DependsOn\n\t\t\tfor d := range dependencies {\n\t\t\t\tif _, ok := set[d]; !ok {\n\t\t\t\t\tdelete(dependencies, d)\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.DependsOn = dependencies\n\t\t\tenabled[name] = s\n\t\t} else {\n\t\t\tnewProject = newProject.WithServicesDisabled(name)\n\t\t}\n\t}\n\tnewProject.Services = enabled\n\treturn newProject, nil\n}\n\n// WithServicesDisabled removes from the project model the given services and their references in all dependencies\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithServicesDisabled(names ...string) *Project {\n\tnewProject := p.deepCopy()\n\tif len(names) == 0 {\n\t\treturn newProject\n\t}\n\tif newProject.DisabledServices == nil {\n\t\tnewProject.DisabledServices = Services{}\n\t}\n\tfor _, name := range names {\n\t\t// We should remove all dependencies which reference the disabled service\n\t\tfor i, s := range newProject.Services {\n\t\t\tif _, ok := s.DependsOn[name]; ok {\n\t\t\t\tdelete(s.DependsOn, name)\n\t\t\t\tnewProject.Services[i] = s\n\t\t\t}\n\t\t}\n\t\tif service, ok := newProject.Services[name]; ok {\n\t\t\tnewProject.DisabledServices[name] = service\n\t\t\tdelete(newProject.Services, name)\n\t\t}\n\t}\n\treturn newProject\n}\n\n// WithImagesResolved updates services images to include digest computed by a resolver function\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p *Project) WithImagesResolved(resolver func(named reference.Named) (godigest.Digest, error)) (*Project, error) {\n\treturn p.WithServicesTransform(func(name string, service ServiceConfig) (ServiceConfig, error) {\n\t\tif service.Image == \"\" {\n\t\t\treturn service, nil\n\t\t}\n\t\tnamed, err := reference.ParseDockerRef(service.Image)\n\t\tif err != nil {\n\t\t\treturn service, err\n\t\t}\n\n\t\tif _, ok := named.(reference.Canonical); !ok {\n\t\t\t// image is named but not digested reference\n\t\t\tdigest, err := resolver(named)\n\t\t\tif err != nil {\n\t\t\t\treturn service, err\n\t\t\t}\n\t\t\tnamed, err = reference.WithDigest(named, digest)\n\t\t\tif err != nil {\n\t\t\t\treturn service, err\n\t\t\t}\n\t\t}\n\t\tservice.Image = named.String()\n\t\treturn service, nil\n\t})\n}\n\n// MarshalYAML marshal Project into a yaml tree\nfunc (p *Project) MarshalYAML() ([]byte, error) {\n\tbuf := bytes.NewBuffer([]byte{})\n\tencoder := yaml.NewEncoder(buf)\n\tencoder.SetIndent(2)\n\t// encoder.CompactSeqIndent() FIXME https://github.com/go-yaml/yaml/pull/753\n\terr := encoder.Encode(p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}\n\n// MarshalJSON makes Config implement json.Marshaler\nfunc (p *Project) MarshalJSON() ([]byte, error) {\n\tm := map[string]interface{}{\n\t\t\"name\":     p.Name,\n\t\t\"services\": p.Services,\n\t}\n\n\tif len(p.Networks) > 0 {\n\t\tm[\"networks\"] = p.Networks\n\t}\n\tif len(p.Volumes) > 0 {\n\t\tm[\"volumes\"] = p.Volumes\n\t}\n\tif len(p.Secrets) > 0 {\n\t\tm[\"secrets\"] = p.Secrets\n\t}\n\tif len(p.Configs) > 0 {\n\t\tm[\"configs\"] = p.Configs\n\t}\n\tfor k, v := range p.Extensions {\n\t\tm[k] = v\n\t}\n\treturn json.MarshalIndent(m, \"\", \"  \")\n}\n\n// WithServicesEnvironmentResolved parses env_files set for services to resolve the actual environment map for services\n// It returns a new Project instance with the changes and keep the original Project unchanged\nfunc (p Project) WithServicesEnvironmentResolved(discardEnvFiles bool) (*Project, error) {\n\tnewProject := p.deepCopy()\n\tfor i, service := range newProject.Services {\n\t\tservice.Environment = service.Environment.Resolve(newProject.Environment.Resolve)\n\n\t\tenvironment := MappingWithEquals{}\n\t\t// resolve variables based on other files we already parsed, + project's environment\n\t\tvar resolve dotenv.LookupFn = func(s string) (string, bool) {\n\t\t\tv, ok := environment[s]\n\t\t\tif ok && v != nil {\n\t\t\t\treturn *v, ok\n\t\t\t}\n\t\t\treturn newProject.Environment.Resolve(s)\n\t\t}\n\n\t\tfor _, envFile := range service.EnvFiles {\n\t\t\tif _, err := os.Stat(envFile.Path); os.IsNotExist(err) {\n\t\t\t\tif envFile.Required {\n\t\t\t\t\treturn nil, fmt.Errorf(\"env file %s not found: %w\", envFile.Path, err)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tb, err := os.ReadFile(envFile.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to load %s: %w\", envFile.Path, err)\n\t\t\t}\n\n\t\t\tfileVars, err := dotenv.ParseWithLookup(bytes.NewBuffer(b), resolve)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to read %s: %w\", envFile.Path, err)\n\t\t\t}\n\t\t\tenvironment.OverrideBy(Mapping(fileVars).ToMappingWithEquals())\n\t\t}\n\n\t\tservice.Environment = environment.OverrideBy(service.Environment)\n\n\t\tif discardEnvFiles {\n\t\t\tservice.EnvFiles = nil\n\t\t}\n\t\tnewProject.Services[i] = service\n\t}\n\treturn newProject, nil\n}\n\nfunc (p *Project) deepCopy() *Project {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tn := &Project{}\n\tderiveDeepCopyProject(n, p)\n\treturn n\n\n}\n\n// WithServicesTransform applies a transformation to project services and return a new project with transformation results\nfunc (p *Project) WithServicesTransform(fn func(name string, s ServiceConfig) (ServiceConfig, error)) (*Project, error) {\n\ttype result struct {\n\t\tname    string\n\t\tservice ServiceConfig\n\t}\n\texpect := len(p.Services)\n\tresultCh := make(chan result, expect)\n\tnewProject := p.deepCopy()\n\n\teg, ctx := errgroup.WithContext(context.Background())\n\teg.Go(func() error {\n\t\ts := Services{}\n\t\tfor expect > 0 {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\t// interrupted as some goroutine returned an error\n\t\t\t\treturn nil\n\t\t\tcase r := <-resultCh:\n\t\t\t\ts[r.name] = r.service\n\t\t\t\texpect--\n\t\t\t}\n\t\t}\n\t\tnewProject.Services = s\n\t\treturn nil\n\t})\n\tfor n, s := range newProject.Services {\n\t\tname := n\n\t\tservice := s\n\t\teg.Go(func() error {\n\t\t\tupdated, err := fn(name, service)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresultCh <- result{\n\t\t\t\tname:    name,\n\t\t\t\tservice: updated,\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\treturn newProject, eg.Wait()\n}\n\n// CheckContainerNameUnicity validate project doesn't have services declaring the same container_name\nfunc (p *Project) CheckContainerNameUnicity() error {\n\tnames := utils.Set[string]{}\n\tfor name, s := range p.Services {\n\t\tif s.ContainerName != \"\" {\n\t\t\tif existing, ok := names[s.ContainerName]; ok {\n\t\t\t\treturn fmt.Errorf(`services.%s: container name %q is already in use by service %s\"`, name, s.ContainerName, existing)\n\t\t\t}\n\t\t\tnames.Add(s.ContainerName)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/services.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\n// Services is a map of ServiceConfig\ntype Services map[string]ServiceConfig\n\n// GetProfiles retrieve the profiles implicitly enabled by explicitly targeting selected services\nfunc (s Services) GetProfiles() []string {\n\tset := map[string]struct{}{}\n\tfor _, service := range s {\n\t\tfor _, p := range service.Profiles {\n\t\t\tset[p] = struct{}{}\n\t\t}\n\t}\n\tvar profiles []string\n\tfor k := range set {\n\t\tprofiles = append(profiles, k)\n\t}\n\treturn profiles\n}\n\nfunc (s Services) Filter(predicate func(ServiceConfig) bool) Services {\n\tservices := Services{}\n\tfor name, service := range s {\n\t\tif predicate(service) {\n\t\t\tservices[name] = service\n\t\t}\n\t}\n\treturn services\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/ssh.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"fmt\"\n)\n\ntype SSHKey struct {\n\tID   string `yaml:\"id,omitempty\" json:\"id,omitempty\"`\n\tPath string `path:\"path,omitempty\" json:\"path,omitempty\"`\n}\n\n// SSHConfig is a mapping type for SSH build config\ntype SSHConfig []SSHKey\n\nfunc (s SSHConfig) Get(id string) (string, error) {\n\tfor _, sshKey := range s {\n\t\tif sshKey.ID == id {\n\t\t\treturn sshKey.Path, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"ID %s not found in SSH keys\", id)\n}\n\n// MarshalYAML makes SSHKey implement yaml.Marshaller\nfunc (s SSHKey) MarshalYAML() (interface{}, error) {\n\tif s.Path == \"\" {\n\t\treturn s.ID, nil\n\t}\n\treturn fmt.Sprintf(\"%s: %s\", s.ID, s.Path), nil\n}\n\n// MarshalJSON makes SSHKey implement json.Marshaller\nfunc (s SSHKey) MarshalJSON() ([]byte, error) {\n\tif s.Path == \"\" {\n\t\treturn []byte(fmt.Sprintf(`%q`, s.ID)), nil\n\t}\n\treturn []byte(fmt.Sprintf(`%q: %s`, s.ID, s.Path)), nil\n}\n\nfunc (s *SSHConfig) DecodeMapstructure(value interface{}) error {\n\tv, ok := value.(map[string]any)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid ssh config type %T\", value)\n\t}\n\tresult := make(SSHConfig, len(v))\n\ti := 0\n\tfor id, path := range v {\n\t\tkey := SSHKey{ID: id}\n\t\tif path != nil {\n\t\t\tkey.Path = fmt.Sprint(path)\n\t\t}\n\t\tresult[i] = key\n\t\ti++\n\t}\n\t*s = result\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/stringOrList.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport \"fmt\"\n\n// StringList is a type for fields that can be a string or list of strings\ntype StringList []string\n\nfunc (l *StringList) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase string:\n\t\t*l = []string{v}\n\tcase []interface{}:\n\t\tlist := make([]string, len(v))\n\t\tfor i, e := range v {\n\t\t\tval, ok := e.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"invalid type %T for string list\", value)\n\t\t\t}\n\t\t\tlist[i] = val\n\t\t}\n\t\t*l = list\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid type %T for string list\", value)\n\t}\n\treturn nil\n}\n\n// StringOrNumberList is a type for fields that can be a list of strings or numbers\ntype StringOrNumberList []string\n\nfunc (l *StringOrNumberList) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase string:\n\t\t*l = []string{v}\n\tcase []interface{}:\n\t\tlist := make([]string, len(v))\n\t\tfor i, e := range v {\n\t\t\tlist[i] = fmt.Sprint(e)\n\t\t}\n\t\t*l = list\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid type %T for string list\", value)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/types/types.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/go-connections/nat\"\n)\n\n// ServiceConfig is the configuration of one service\ntype ServiceConfig struct {\n\tName     string   `yaml:\"name,omitempty\" json:\"-\"`\n\tProfiles []string `yaml:\"profiles,omitempty\" json:\"profiles,omitempty\"`\n\n\tAnnotations  Mapping        `yaml:\"annotations,omitempty\" json:\"annotations,omitempty\"`\n\tAttach       *bool          `yaml:\"attach,omitempty\" json:\"attach,omitempty\"`\n\tBuild        *BuildConfig   `yaml:\"build,omitempty\" json:\"build,omitempty\"`\n\tDevelop      *DevelopConfig `yaml:\"develop,omitempty\" json:\"develop,omitempty\"`\n\tBlkioConfig  *BlkioConfig   `yaml:\"blkio_config,omitempty\" json:\"blkio_config,omitempty\"`\n\tCapAdd       []string       `yaml:\"cap_add,omitempty\" json:\"cap_add,omitempty\"`\n\tCapDrop      []string       `yaml:\"cap_drop,omitempty\" json:\"cap_drop,omitempty\"`\n\tCgroupParent string         `yaml:\"cgroup_parent,omitempty\" json:\"cgroup_parent,omitempty\"`\n\tCgroup       string         `yaml:\"cgroup,omitempty\" json:\"cgroup,omitempty\"`\n\tCPUCount     int64          `yaml:\"cpu_count,omitempty\" json:\"cpu_count,omitempty\"`\n\tCPUPercent   float32        `yaml:\"cpu_percent,omitempty\" json:\"cpu_percent,omitempty\"`\n\tCPUPeriod    int64          `yaml:\"cpu_period,omitempty\" json:\"cpu_period,omitempty\"`\n\tCPUQuota     int64          `yaml:\"cpu_quota,omitempty\" json:\"cpu_quota,omitempty\"`\n\tCPURTPeriod  int64          `yaml:\"cpu_rt_period,omitempty\" json:\"cpu_rt_period,omitempty\"`\n\tCPURTRuntime int64          `yaml:\"cpu_rt_runtime,omitempty\" json:\"cpu_rt_runtime,omitempty\"`\n\tCPUS         float32        `yaml:\"cpus,omitempty\" json:\"cpus,omitempty\"`\n\tCPUSet       string         `yaml:\"cpuset,omitempty\" json:\"cpuset,omitempty\"`\n\tCPUShares    int64          `yaml:\"cpu_shares,omitempty\" json:\"cpu_shares,omitempty\"`\n\n\t// Command for the service containers.\n\t// If set, overrides COMMAND from the image.\n\t//\n\t// Set to `[]` or an empty string to clear the command from the image.\n\tCommand ShellCommand `yaml:\"command,omitempty\" json:\"command\"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details.\n\n\tConfigs           []ServiceConfigObjConfig `yaml:\"configs,omitempty\" json:\"configs,omitempty\"`\n\tContainerName     string                   `yaml:\"container_name,omitempty\" json:\"container_name,omitempty\"`\n\tCredentialSpec    *CredentialSpecConfig    `yaml:\"credential_spec,omitempty\" json:\"credential_spec,omitempty\"`\n\tDependsOn         DependsOnConfig          `yaml:\"depends_on,omitempty\" json:\"depends_on,omitempty\"`\n\tDeploy            *DeployConfig            `yaml:\"deploy,omitempty\" json:\"deploy,omitempty\"`\n\tDeviceCgroupRules []string                 `yaml:\"device_cgroup_rules,omitempty\" json:\"device_cgroup_rules,omitempty\"`\n\tDevices           []DeviceMapping          `yaml:\"devices,omitempty\" json:\"devices,omitempty\"`\n\tDNS               StringList               `yaml:\"dns,omitempty\" json:\"dns,omitempty\"`\n\tDNSOpts           []string                 `yaml:\"dns_opt,omitempty\" json:\"dns_opt,omitempty\"`\n\tDNSSearch         StringList               `yaml:\"dns_search,omitempty\" json:\"dns_search,omitempty\"`\n\tDockerfile        string                   `yaml:\"dockerfile,omitempty\" json:\"dockerfile,omitempty\"`\n\tDomainName        string                   `yaml:\"domainname,omitempty\" json:\"domainname,omitempty\"`\n\n\t// Entrypoint for the service containers.\n\t// If set, overrides ENTRYPOINT from the image.\n\t//\n\t// Set to `[]` or an empty string to clear the entrypoint from the image.\n\tEntrypoint ShellCommand `yaml:\"entrypoint,omitempty\" json:\"entrypoint\"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details.\n\n\tEnvironment     MappingWithEquals                `yaml:\"environment,omitempty\" json:\"environment,omitempty\"`\n\tEnvFiles        []EnvFile                        `yaml:\"env_file,omitempty\" json:\"env_file,omitempty\"`\n\tExpose          StringOrNumberList               `yaml:\"expose,omitempty\" json:\"expose,omitempty\"`\n\tExtends         *ExtendsConfig                   `yaml:\"extends,omitempty\" json:\"extends,omitempty\"`\n\tExternalLinks   []string                         `yaml:\"external_links,omitempty\" json:\"external_links,omitempty\"`\n\tExtraHosts      HostsList                        `yaml:\"extra_hosts,omitempty\" json:\"extra_hosts,omitempty\"`\n\tGroupAdd        []string                         `yaml:\"group_add,omitempty\" json:\"group_add,omitempty\"`\n\tHostname        string                           `yaml:\"hostname,omitempty\" json:\"hostname,omitempty\"`\n\tHealthCheck     *HealthCheckConfig               `yaml:\"healthcheck,omitempty\" json:\"healthcheck,omitempty\"`\n\tImage           string                           `yaml:\"image,omitempty\" json:\"image,omitempty\"`\n\tInit            *bool                            `yaml:\"init,omitempty\" json:\"init,omitempty\"`\n\tIpc             string                           `yaml:\"ipc,omitempty\" json:\"ipc,omitempty\"`\n\tIsolation       string                           `yaml:\"isolation,omitempty\" json:\"isolation,omitempty\"`\n\tLabels          Labels                           `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tCustomLabels    Labels                           `yaml:\"-\" json:\"-\"`\n\tLinks           []string                         `yaml:\"links,omitempty\" json:\"links,omitempty\"`\n\tLogging         *LoggingConfig                   `yaml:\"logging,omitempty\" json:\"logging,omitempty\"`\n\tLogDriver       string                           `yaml:\"log_driver,omitempty\" json:\"log_driver,omitempty\"`\n\tLogOpt          map[string]string                `yaml:\"log_opt,omitempty\" json:\"log_opt,omitempty\"`\n\tMemLimit        UnitBytes                        `yaml:\"mem_limit,omitempty\" json:\"mem_limit,omitempty\"`\n\tMemReservation  UnitBytes                        `yaml:\"mem_reservation,omitempty\" json:\"mem_reservation,omitempty\"`\n\tMemSwapLimit    UnitBytes                        `yaml:\"memswap_limit,omitempty\" json:\"memswap_limit,omitempty\"`\n\tMemSwappiness   UnitBytes                        `yaml:\"mem_swappiness,omitempty\" json:\"mem_swappiness,omitempty\"`\n\tMacAddress      string                           `yaml:\"mac_address,omitempty\" json:\"mac_address,omitempty\"`\n\tNet             string                           `yaml:\"net,omitempty\" json:\"net,omitempty\"`\n\tNetworkMode     string                           `yaml:\"network_mode,omitempty\" json:\"network_mode,omitempty\"`\n\tNetworks        map[string]*ServiceNetworkConfig `yaml:\"networks,omitempty\" json:\"networks,omitempty\"`\n\tOomKillDisable  bool                             `yaml:\"oom_kill_disable,omitempty\" json:\"oom_kill_disable,omitempty\"`\n\tOomScoreAdj     int64                            `yaml:\"oom_score_adj,omitempty\" json:\"oom_score_adj,omitempty\"`\n\tPid             string                           `yaml:\"pid,omitempty\" json:\"pid,omitempty\"`\n\tPidsLimit       int64                            `yaml:\"pids_limit,omitempty\" json:\"pids_limit,omitempty\"`\n\tPlatform        string                           `yaml:\"platform,omitempty\" json:\"platform,omitempty\"`\n\tPorts           []ServicePortConfig              `yaml:\"ports,omitempty\" json:\"ports,omitempty\"`\n\tPrivileged      bool                             `yaml:\"privileged,omitempty\" json:\"privileged,omitempty\"`\n\tPullPolicy      string                           `yaml:\"pull_policy,omitempty\" json:\"pull_policy,omitempty\"`\n\tReadOnly        bool                             `yaml:\"read_only,omitempty\" json:\"read_only,omitempty\"`\n\tRestart         string                           `yaml:\"restart,omitempty\" json:\"restart,omitempty\"`\n\tRuntime         string                           `yaml:\"runtime,omitempty\" json:\"runtime,omitempty\"`\n\tScale           *int                             `yaml:\"scale,omitempty\" json:\"scale,omitempty\"`\n\tSecrets         []ServiceSecretConfig            `yaml:\"secrets,omitempty\" json:\"secrets,omitempty\"`\n\tSecurityOpt     []string                         `yaml:\"security_opt,omitempty\" json:\"security_opt,omitempty\"`\n\tShmSize         UnitBytes                        `yaml:\"shm_size,omitempty\" json:\"shm_size,omitempty\"`\n\tStdinOpen       bool                             `yaml:\"stdin_open,omitempty\" json:\"stdin_open,omitempty\"`\n\tStopGracePeriod *Duration                        `yaml:\"stop_grace_period,omitempty\" json:\"stop_grace_period,omitempty\"`\n\tStopSignal      string                           `yaml:\"stop_signal,omitempty\" json:\"stop_signal,omitempty\"`\n\tStorageOpt      map[string]string                `yaml:\"storage_opt,omitempty\" json:\"storage_opt,omitempty\"`\n\tSysctls         Mapping                          `yaml:\"sysctls,omitempty\" json:\"sysctls,omitempty\"`\n\tTmpfs           StringList                       `yaml:\"tmpfs,omitempty\" json:\"tmpfs,omitempty\"`\n\tTty             bool                             `yaml:\"tty,omitempty\" json:\"tty,omitempty\"`\n\tUlimits         map[string]*UlimitsConfig        `yaml:\"ulimits,omitempty\" json:\"ulimits,omitempty\"`\n\tUser            string                           `yaml:\"user,omitempty\" json:\"user,omitempty\"`\n\tUserNSMode      string                           `yaml:\"userns_mode,omitempty\" json:\"userns_mode,omitempty\"`\n\tUts             string                           `yaml:\"uts,omitempty\" json:\"uts,omitempty\"`\n\tVolumeDriver    string                           `yaml:\"volume_driver,omitempty\" json:\"volume_driver,omitempty\"`\n\tVolumes         []ServiceVolumeConfig            `yaml:\"volumes,omitempty\" json:\"volumes,omitempty\"`\n\tVolumesFrom     []string                         `yaml:\"volumes_from,omitempty\" json:\"volumes_from,omitempty\"`\n\tWorkingDir      string                           `yaml:\"working_dir,omitempty\" json:\"working_dir,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// MarshalYAML makes ServiceConfig implement yaml.Marshaller\nfunc (s ServiceConfig) MarshalYAML() (interface{}, error) {\n\ttype t ServiceConfig\n\tvalue := t(s)\n\tvalue.Name = \"\" // set during map to slice conversion, not part of the yaml representation\n\treturn value, nil\n}\n\n// NetworksByPriority return the service networks IDs sorted according to Priority\nfunc (s *ServiceConfig) NetworksByPriority() []string {\n\ttype key struct {\n\t\tname     string\n\t\tpriority int\n\t}\n\tvar keys []key\n\tfor k, v := range s.Networks {\n\t\tpriority := 0\n\t\tif v != nil {\n\t\t\tpriority = v.Priority\n\t\t}\n\t\tkeys = append(keys, key{\n\t\t\tname:     k,\n\t\t\tpriority: priority,\n\t\t})\n\t}\n\tsort.Slice(keys, func(i, j int) bool {\n\t\tif keys[i].priority == keys[j].priority {\n\t\t\treturn keys[i].name < keys[j].name\n\t\t}\n\t\treturn keys[i].priority > keys[j].priority\n\t})\n\tvar sorted []string\n\tfor _, k := range keys {\n\t\tsorted = append(sorted, k.name)\n\t}\n\treturn sorted\n}\n\nfunc (s *ServiceConfig) GetScale() int {\n\tif s.Scale != nil {\n\t\treturn *s.Scale\n\t}\n\tif s.Deploy != nil && s.Deploy.Replicas != nil {\n\t\t// this should not be required as compose-go enforce consistency between scale anr replicas\n\t\treturn *s.Deploy.Replicas\n\t}\n\treturn 1\n}\n\nfunc (s *ServiceConfig) SetScale(scale int) {\n\ts.Scale = &scale\n\tif s.Deploy != nil {\n\t\ts.Deploy.Replicas = &scale\n\t}\n}\n\nfunc (s *ServiceConfig) deepCopy() *ServiceConfig {\n\tif s == nil {\n\t\treturn nil\n\t}\n\tn := &ServiceConfig{}\n\tderiveDeepCopyService(n, s)\n\treturn n\n}\n\nconst (\n\t// PullPolicyAlways always pull images\n\tPullPolicyAlways = \"always\"\n\t// PullPolicyNever never pull images\n\tPullPolicyNever = \"never\"\n\t// PullPolicyIfNotPresent pull missing images\n\tPullPolicyIfNotPresent = \"if_not_present\"\n\t// PullPolicyMissing pull missing images\n\tPullPolicyMissing = \"missing\"\n\t// PullPolicyBuild force building images\n\tPullPolicyBuild = \"build\"\n)\n\nconst (\n\t// RestartPolicyAlways always restart the container if it stops\n\tRestartPolicyAlways = \"always\"\n\t// RestartPolicyOnFailure restart the container if it exits due to an error\n\tRestartPolicyOnFailure = \"on-failure\"\n\t// RestartPolicyNo do not automatically restart the container\n\tRestartPolicyNo = \"no\"\n\t// RestartPolicyUnlessStopped always restart the container unless the container is stopped (manually or otherwise)\n\tRestartPolicyUnlessStopped = \"unless-stopped\"\n)\n\nconst (\n\t// ServicePrefix is the prefix for references pointing to a service\n\tServicePrefix = \"service:\"\n\t// ContainerPrefix is the prefix for references pointing to a container\n\tContainerPrefix = \"container:\"\n\n\t// NetworkModeServicePrefix is the prefix for network_mode pointing to a service\n\t// Deprecated prefer ServicePrefix\n\tNetworkModeServicePrefix = ServicePrefix\n\t// NetworkModeContainerPrefix is the prefix for network_mode pointing to a container\n\t// Deprecated prefer ContainerPrefix\n\tNetworkModeContainerPrefix = ContainerPrefix\n)\n\nconst (\n\tSecretConfigXValue = \"x-#value\"\n)\n\n// GetDependencies retrieves all services this service depends on\nfunc (s ServiceConfig) GetDependencies() []string {\n\tvar dependencies []string\n\tfor service := range s.DependsOn {\n\t\tdependencies = append(dependencies, service)\n\t}\n\treturn dependencies\n}\n\n// GetDependents retrieves all services which depend on this service\nfunc (s ServiceConfig) GetDependents(p *Project) []string {\n\tvar dependent []string\n\tfor _, service := range p.Services {\n\t\tfor name := range service.DependsOn {\n\t\t\tif name == s.Name {\n\t\t\t\tdependent = append(dependent, service.Name)\n\t\t\t}\n\t\t}\n\t}\n\treturn dependent\n}\n\n// BuildConfig is a type for build\ntype BuildConfig struct {\n\tContext            string                    `yaml:\"context,omitempty\" json:\"context,omitempty\"`\n\tDockerfile         string                    `yaml:\"dockerfile,omitempty\" json:\"dockerfile,omitempty\"`\n\tDockerfileInline   string                    `yaml:\"dockerfile_inline,omitempty\" json:\"dockerfile_inline,omitempty\"`\n\tEntitlements       []string                  `yaml:\"entitlements,omitempty\" json:\"entitlements,omitempty\"`\n\tArgs               MappingWithEquals         `yaml:\"args,omitempty\" json:\"args,omitempty\"`\n\tSSH                SSHConfig                 `yaml:\"ssh,omitempty\" json:\"ssh,omitempty\"`\n\tLabels             Labels                    `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tCacheFrom          StringList                `yaml:\"cache_from,omitempty\" json:\"cache_from,omitempty\"`\n\tCacheTo            StringList                `yaml:\"cache_to,omitempty\" json:\"cache_to,omitempty\"`\n\tNoCache            bool                      `yaml:\"no_cache,omitempty\" json:\"no_cache,omitempty\"`\n\tAdditionalContexts Mapping                   `yaml:\"additional_contexts,omitempty\" json:\"additional_contexts,omitempty\"`\n\tPull               bool                      `yaml:\"pull,omitempty\" json:\"pull,omitempty\"`\n\tExtraHosts         HostsList                 `yaml:\"extra_hosts,omitempty\" json:\"extra_hosts,omitempty\"`\n\tIsolation          string                    `yaml:\"isolation,omitempty\" json:\"isolation,omitempty\"`\n\tNetwork            string                    `yaml:\"network,omitempty\" json:\"network,omitempty\"`\n\tTarget             string                    `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tSecrets            []ServiceSecretConfig     `yaml:\"secrets,omitempty\" json:\"secrets,omitempty\"`\n\tShmSize            UnitBytes                 `yaml:\"shm_size,omitempty\" json:\"shm_size,omitempty\"`\n\tTags               StringList                `yaml:\"tags,omitempty\" json:\"tags,omitempty\"`\n\tUlimits            map[string]*UlimitsConfig `yaml:\"ulimits,omitempty\" json:\"ulimits,omitempty\"`\n\tPlatforms          StringList                `yaml:\"platforms,omitempty\" json:\"platforms,omitempty\"`\n\tPrivileged         bool                      `yaml:\"privileged,omitempty\" json:\"privileged,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// BlkioConfig define blkio config\ntype BlkioConfig struct {\n\tWeight          uint16           `yaml:\"weight,omitempty\" json:\"weight,omitempty\"`\n\tWeightDevice    []WeightDevice   `yaml:\"weight_device,omitempty\" json:\"weight_device,omitempty\"`\n\tDeviceReadBps   []ThrottleDevice `yaml:\"device_read_bps,omitempty\" json:\"device_read_bps,omitempty\"`\n\tDeviceReadIOps  []ThrottleDevice `yaml:\"device_read_iops,omitempty\" json:\"device_read_iops,omitempty\"`\n\tDeviceWriteBps  []ThrottleDevice `yaml:\"device_write_bps,omitempty\" json:\"device_write_bps,omitempty\"`\n\tDeviceWriteIOps []ThrottleDevice `yaml:\"device_write_iops,omitempty\" json:\"device_write_iops,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\ntype DeviceMapping struct {\n\tSource      string `yaml:\"source,omitempty\" json:\"source,omitempty\"`\n\tTarget      string `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tPermissions string `yaml:\"permissions,omitempty\" json:\"permissions,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// WeightDevice is a structure that holds device:weight pair\ntype WeightDevice struct {\n\tPath   string\n\tWeight uint16\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ThrottleDevice is a structure that holds device:rate_per_second pair\ntype ThrottleDevice struct {\n\tPath string\n\tRate UnitBytes\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// MappingWithColon is a mapping type that can be converted from a list of\n// 'key: value' strings\ntype MappingWithColon map[string]string\n\n// LoggingConfig the logging configuration for a service\ntype LoggingConfig struct {\n\tDriver  string  `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tOptions Options `yaml:\"options,omitempty\" json:\"options,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// DeployConfig the deployment configuration for a service\ntype DeployConfig struct {\n\tMode           string         `yaml:\"mode,omitempty\" json:\"mode,omitempty\"`\n\tReplicas       *int           `yaml:\"replicas,omitempty\" json:\"replicas,omitempty\"`\n\tLabels         Labels         `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tUpdateConfig   *UpdateConfig  `yaml:\"update_config,omitempty\" json:\"update_config,omitempty\"`\n\tRollbackConfig *UpdateConfig  `yaml:\"rollback_config,omitempty\" json:\"rollback_config,omitempty\"`\n\tResources      Resources      `yaml:\"resources,omitempty\" json:\"resources,omitempty\"`\n\tRestartPolicy  *RestartPolicy `yaml:\"restart_policy,omitempty\" json:\"restart_policy,omitempty\"`\n\tPlacement      Placement      `yaml:\"placement,omitempty\" json:\"placement,omitempty\"`\n\tEndpointMode   string         `yaml:\"endpoint_mode,omitempty\" json:\"endpoint_mode,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// UpdateConfig the service update configuration\ntype UpdateConfig struct {\n\tParallelism     *uint64  `yaml:\"parallelism,omitempty\" json:\"parallelism,omitempty\"`\n\tDelay           Duration `yaml:\"delay,omitempty\" json:\"delay,omitempty\"`\n\tFailureAction   string   `yaml:\"failure_action,omitempty\" json:\"failure_action,omitempty\"`\n\tMonitor         Duration `yaml:\"monitor,omitempty\" json:\"monitor,omitempty\"`\n\tMaxFailureRatio float32  `yaml:\"max_failure_ratio,omitempty\" json:\"max_failure_ratio,omitempty\"`\n\tOrder           string   `yaml:\"order,omitempty\" json:\"order,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// Resources the resource limits and reservations\ntype Resources struct {\n\tLimits       *Resource `yaml:\"limits,omitempty\" json:\"limits,omitempty\"`\n\tReservations *Resource `yaml:\"reservations,omitempty\" json:\"reservations,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// Resource is a resource to be limited or reserved\ntype Resource struct {\n\t// TODO: types to convert from units and ratios\n\tNanoCPUs         NanoCPUs          `yaml:\"cpus,omitempty\" json:\"cpus,omitempty\"`\n\tMemoryBytes      UnitBytes         `yaml:\"memory,omitempty\" json:\"memory,omitempty\"`\n\tPids             int64             `yaml:\"pids,omitempty\" json:\"pids,omitempty\"`\n\tDevices          []DeviceRequest   `yaml:\"devices,omitempty\" json:\"devices,omitempty\"`\n\tGenericResources []GenericResource `yaml:\"generic_resources,omitempty\" json:\"generic_resources,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\ntype NanoCPUs float32\n\nfunc (n *NanoCPUs) DecodeMapstructure(a any) error {\n\tswitch v := a.(type) {\n\tcase string:\n\t\tf, err := strconv.ParseFloat(v, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*n = NanoCPUs(f)\n\tcase float32:\n\t\t*n = NanoCPUs(v)\n\tcase float64:\n\t\t*n = NanoCPUs(v)\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for cpus\", v)\n\t}\n\treturn nil\n}\n\nfunc (n *NanoCPUs) Value() float32 {\n\treturn float32(*n)\n}\n\n// GenericResource represents a \"user defined\" resource which can\n// only be an integer (e.g: SSD=3) for a service\ntype GenericResource struct {\n\tDiscreteResourceSpec *DiscreteGenericResource `yaml:\"discrete_resource_spec,omitempty\" json:\"discrete_resource_spec,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// DiscreteGenericResource represents a \"user defined\" resource which is defined\n// as an integer\n// \"Kind\" is used to describe the Kind of a resource (e.g: \"GPU\", \"FPGA\", \"SSD\", ...)\n// Value is used to count the resource (SSD=5, HDD=3, ...)\ntype DiscreteGenericResource struct {\n\tKind  string `json:\"kind\"`\n\tValue int64  `json:\"value\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// RestartPolicy the service restart policy\ntype RestartPolicy struct {\n\tCondition   string    `yaml:\"condition,omitempty\" json:\"condition,omitempty\"`\n\tDelay       *Duration `yaml:\"delay,omitempty\" json:\"delay,omitempty\"`\n\tMaxAttempts *uint64   `yaml:\"max_attempts,omitempty\" json:\"max_attempts,omitempty\"`\n\tWindow      *Duration `yaml:\"window,omitempty\" json:\"window,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// Placement constraints for the service\ntype Placement struct {\n\tConstraints []string               `yaml:\"constraints,omitempty\" json:\"constraints,omitempty\"`\n\tPreferences []PlacementPreferences `yaml:\"preferences,omitempty\" json:\"preferences,omitempty\"`\n\tMaxReplicas uint64                 `yaml:\"max_replicas_per_node,omitempty\" json:\"max_replicas_per_node,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// PlacementPreferences is the preferences for a service placement\ntype PlacementPreferences struct {\n\tSpread string `yaml:\"spread,omitempty\" json:\"spread,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ServiceNetworkConfig is the network configuration for a service\ntype ServiceNetworkConfig struct {\n\tPriority     int      `yaml:\"priority,omitempty\" json:\"priority,omitempty\"`\n\tAliases      []string `yaml:\"aliases,omitempty\" json:\"aliases,omitempty\"`\n\tIpv4Address  string   `yaml:\"ipv4_address,omitempty\" json:\"ipv4_address,omitempty\"`\n\tIpv6Address  string   `yaml:\"ipv6_address,omitempty\" json:\"ipv6_address,omitempty\"`\n\tLinkLocalIPs []string `yaml:\"link_local_ips,omitempty\" json:\"link_local_ips,omitempty\"`\n\tMacAddress   string   `yaml:\"mac_address,omitempty\" json:\"mac_address,omitempty\"`\n\tDriverOpts   Options  `yaml:\"driver_opts,omitempty\" json:\"driver_opts,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ServicePortConfig is the port configuration for a service\ntype ServicePortConfig struct {\n\tName        string `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tMode        string `yaml:\"mode,omitempty\" json:\"mode,omitempty\"`\n\tHostIP      string `yaml:\"host_ip,omitempty\" json:\"host_ip,omitempty\"`\n\tTarget      uint32 `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tPublished   string `yaml:\"published,omitempty\" json:\"published,omitempty\"`\n\tProtocol    string `yaml:\"protocol,omitempty\" json:\"protocol,omitempty\"`\n\tAppProtocol string `yaml:\"app_protocol,omitempty\" json:\"app_protocol,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ParsePortConfig parse short syntax for service port configuration\nfunc ParsePortConfig(value string) ([]ServicePortConfig, error) {\n\tvar portConfigs []ServicePortConfig\n\tports, portBindings, err := nat.ParsePortSpecs([]string{value})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// We need to sort the key of the ports to make sure it is consistent\n\tkeys := []string{}\n\tfor port := range ports {\n\t\tkeys = append(keys, string(port))\n\t}\n\tsort.Strings(keys)\n\n\tfor _, key := range keys {\n\t\tport := nat.Port(key)\n\t\tconverted, err := convertPortToPortConfig(port, portBindings)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tportConfigs = append(portConfigs, converted...)\n\t}\n\treturn portConfigs, nil\n}\n\nfunc convertPortToPortConfig(port nat.Port, portBindings map[nat.Port][]nat.PortBinding) ([]ServicePortConfig, error) {\n\tvar portConfigs []ServicePortConfig\n\tfor _, binding := range portBindings[port] {\n\t\tportConfigs = append(portConfigs, ServicePortConfig{\n\t\t\tHostIP:    binding.HostIP,\n\t\t\tProtocol:  strings.ToLower(port.Proto()),\n\t\t\tTarget:    uint32(port.Int()),\n\t\t\tPublished: binding.HostPort,\n\t\t\tMode:      \"ingress\",\n\t\t})\n\t}\n\treturn portConfigs, nil\n}\n\n// ServiceVolumeConfig are references to a volume used by a service\ntype ServiceVolumeConfig struct {\n\tType        string               `yaml:\"type,omitempty\" json:\"type,omitempty\"`\n\tSource      string               `yaml:\"source,omitempty\" json:\"source,omitempty\"`\n\tTarget      string               `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tReadOnly    bool                 `yaml:\"read_only,omitempty\" json:\"read_only,omitempty\"`\n\tConsistency string               `yaml:\"consistency,omitempty\" json:\"consistency,omitempty\"`\n\tBind        *ServiceVolumeBind   `yaml:\"bind,omitempty\" json:\"bind,omitempty\"`\n\tVolume      *ServiceVolumeVolume `yaml:\"volume,omitempty\" json:\"volume,omitempty\"`\n\tTmpfs       *ServiceVolumeTmpfs  `yaml:\"tmpfs,omitempty\" json:\"tmpfs,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// String render ServiceVolumeConfig as a volume string, one can parse back using loader.ParseVolume\nfunc (s ServiceVolumeConfig) String() string {\n\taccess := \"rw\"\n\tif s.ReadOnly {\n\t\taccess = \"ro\"\n\t}\n\toptions := []string{access}\n\tif s.Bind != nil && s.Bind.SELinux != \"\" {\n\t\toptions = append(options, s.Bind.SELinux)\n\t}\n\tif s.Bind != nil && s.Bind.Propagation != \"\" {\n\t\toptions = append(options, s.Bind.Propagation)\n\t}\n\tif s.Volume != nil && s.Volume.NoCopy {\n\t\toptions = append(options, \"nocopy\")\n\t}\n\tif s.Volume != nil && s.Volume.Subpath != \"\" {\n\t\toptions = append(options, s.Volume.Subpath)\n\t}\n\treturn fmt.Sprintf(\"%s:%s:%s\", s.Source, s.Target, strings.Join(options, \",\"))\n}\n\nconst (\n\t// VolumeTypeBind is the type for mounting host dir\n\tVolumeTypeBind = \"bind\"\n\t// VolumeTypeVolume is the type for remote storage volumes\n\tVolumeTypeVolume = \"volume\"\n\t// VolumeTypeTmpfs is the type for mounting tmpfs\n\tVolumeTypeTmpfs = \"tmpfs\"\n\t// VolumeTypeNamedPipe is the type for mounting Windows named pipes\n\tVolumeTypeNamedPipe = \"npipe\"\n\t// VolumeTypeCluster is the type for mounting container storage interface (CSI) volumes\n\tVolumeTypeCluster = \"cluster\"\n\n\t// SElinuxShared share the volume content\n\tSElinuxShared = \"z\"\n\t// SElinuxUnshared label content as private unshared\n\tSElinuxUnshared = \"Z\"\n)\n\n// ServiceVolumeBind are options for a service volume of type bind\ntype ServiceVolumeBind struct {\n\tSELinux        string `yaml:\"selinux,omitempty\" json:\"selinux,omitempty\"`\n\tPropagation    string `yaml:\"propagation,omitempty\" json:\"propagation,omitempty\"`\n\tCreateHostPath bool   `yaml:\"create_host_path,omitempty\" json:\"create_host_path,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// SELinux represents the SELinux re-labeling options.\nconst (\n\t// SELinuxShared option indicates that the bind mount content is shared among multiple containers\n\tSELinuxShared string = \"z\"\n\t// SELinuxPrivate option indicates that the bind mount content is private and unshared\n\tSELinuxPrivate string = \"Z\"\n)\n\n// Propagation represents the propagation of a mount.\nconst (\n\t// PropagationRPrivate RPRIVATE\n\tPropagationRPrivate string = \"rprivate\"\n\t// PropagationPrivate PRIVATE\n\tPropagationPrivate string = \"private\"\n\t// PropagationRShared RSHARED\n\tPropagationRShared string = \"rshared\"\n\t// PropagationShared SHARED\n\tPropagationShared string = \"shared\"\n\t// PropagationRSlave RSLAVE\n\tPropagationRSlave string = \"rslave\"\n\t// PropagationSlave SLAVE\n\tPropagationSlave string = \"slave\"\n)\n\n// ServiceVolumeVolume are options for a service volume of type volume\ntype ServiceVolumeVolume struct {\n\tNoCopy  bool   `yaml:\"nocopy,omitempty\" json:\"nocopy,omitempty\"`\n\tSubpath string `yaml:\"subpath,omitempty\" json:\"subpath,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ServiceVolumeTmpfs are options for a service volume of type tmpfs\ntype ServiceVolumeTmpfs struct {\n\tSize UnitBytes `yaml:\"size,omitempty\" json:\"size,omitempty\"`\n\n\tMode uint32 `yaml:\"mode,omitempty\" json:\"mode,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// FileReferenceConfig for a reference to a swarm file object\ntype FileReferenceConfig struct {\n\tSource string  `yaml:\"source,omitempty\" json:\"source,omitempty\"`\n\tTarget string  `yaml:\"target,omitempty\" json:\"target,omitempty\"`\n\tUID    string  `yaml:\"uid,omitempty\" json:\"uid,omitempty\"`\n\tGID    string  `yaml:\"gid,omitempty\" json:\"gid,omitempty\"`\n\tMode   *uint32 `yaml:\"mode,omitempty\" json:\"mode,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// ServiceConfigObjConfig is the config obj configuration for a service\ntype ServiceConfigObjConfig FileReferenceConfig\n\n// ServiceSecretConfig is the secret configuration for a service\ntype ServiceSecretConfig FileReferenceConfig\n\n// UlimitsConfig the ulimit configuration\ntype UlimitsConfig struct {\n\tSingle int `yaml:\"single,omitempty\" json:\"single,omitempty\"`\n\tSoft   int `yaml:\"soft,omitempty\" json:\"soft,omitempty\"`\n\tHard   int `yaml:\"hard,omitempty\" json:\"hard,omitempty\"`\n\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\nfunc (u *UlimitsConfig) DecodeMapstructure(value interface{}) error {\n\tswitch v := value.(type) {\n\tcase *UlimitsConfig:\n\t\t// this call to DecodeMapstructure is triggered after initial value conversion as we use a map[string]*UlimitsConfig\n\t\treturn nil\n\tcase int:\n\t\tu.Single = v\n\t\tu.Soft = 0\n\t\tu.Hard = 0\n\tcase map[string]any:\n\t\tu.Single = 0\n\t\tsoft, ok := v[\"soft\"]\n\t\tif ok {\n\t\t\tu.Soft = soft.(int)\n\t\t}\n\t\thard, ok := v[\"hard\"]\n\t\tif ok {\n\t\t\tu.Hard = hard.(int)\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type %T for ulimit\", value)\n\t}\n\treturn nil\n}\n\n// MarshalYAML makes UlimitsConfig implement yaml.Marshaller\nfunc (u *UlimitsConfig) MarshalYAML() (interface{}, error) {\n\tif u.Single != 0 {\n\t\treturn u.Single, nil\n\t}\n\treturn struct {\n\t\tSoft int\n\t\tHard int\n\t}{\n\t\tSoft: u.Soft,\n\t\tHard: u.Hard,\n\t}, nil\n}\n\n// MarshalJSON makes UlimitsConfig implement json.Marshaller\nfunc (u *UlimitsConfig) MarshalJSON() ([]byte, error) {\n\tif u.Single != 0 {\n\t\treturn json.Marshal(u.Single)\n\t}\n\t// Pass as a value to avoid re-entering this method and use the default implementation\n\treturn json.Marshal(*u)\n}\n\n// NetworkConfig for a network\ntype NetworkConfig struct {\n\tName       string     `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tDriver     string     `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tDriverOpts Options    `yaml:\"driver_opts,omitempty\" json:\"driver_opts,omitempty\"`\n\tIpam       IPAMConfig `yaml:\"ipam,omitempty\" json:\"ipam,omitempty\"`\n\tExternal   External   `yaml:\"external,omitempty\" json:\"external,omitempty\"`\n\tInternal   bool       `yaml:\"internal,omitempty\" json:\"internal,omitempty\"`\n\tAttachable bool       `yaml:\"attachable,omitempty\" json:\"attachable,omitempty\"`\n\tLabels     Labels     `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tEnableIPv6 *bool      `yaml:\"enable_ipv6,omitempty\" json:\"enable_ipv6,omitempty\"`\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// IPAMConfig for a network\ntype IPAMConfig struct {\n\tDriver     string      `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tConfig     []*IPAMPool `yaml:\"config,omitempty\" json:\"config,omitempty\"`\n\tExtensions Extensions  `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// IPAMPool for a network\ntype IPAMPool struct {\n\tSubnet             string     `yaml:\"subnet,omitempty\" json:\"subnet,omitempty\"`\n\tGateway            string     `yaml:\"gateway,omitempty\" json:\"gateway,omitempty\"`\n\tIPRange            string     `yaml:\"ip_range,omitempty\" json:\"ip_range,omitempty\"`\n\tAuxiliaryAddresses Mapping    `yaml:\"aux_addresses,omitempty\" json:\"aux_addresses,omitempty\"`\n\tExtensions         Extensions `yaml:\",inline\" json:\"-\"`\n}\n\n// VolumeConfig for a volume\ntype VolumeConfig struct {\n\tName       string     `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tDriver     string     `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tDriverOpts Options    `yaml:\"driver_opts,omitempty\" json:\"driver_opts,omitempty\"`\n\tExternal   External   `yaml:\"external,omitempty\" json:\"external,omitempty\"`\n\tLabels     Labels     `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// External identifies a Volume or Network as a reference to a resource that is\n// not managed, and should already exist.\ntype External bool\n\n// CredentialSpecConfig for credential spec on Windows\ntype CredentialSpecConfig struct {\n\tConfig     string     `yaml:\"config,omitempty\" json:\"config,omitempty\"` // Config was added in API v1.40\n\tFile       string     `yaml:\"file,omitempty\" json:\"file,omitempty\"`\n\tRegistry   string     `yaml:\"registry,omitempty\" json:\"registry,omitempty\"`\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\n// FileObjectConfig is a config type for a file used by a service\ntype FileObjectConfig struct {\n\tName           string            `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tFile           string            `yaml:\"file,omitempty\" json:\"file,omitempty\"`\n\tEnvironment    string            `yaml:\"environment,omitempty\" json:\"environment,omitempty\"`\n\tContent        string            `yaml:\"content,omitempty\" json:\"content,omitempty\"`\n\tExternal       External          `yaml:\"external,omitempty\" json:\"external,omitempty\"`\n\tLabels         Labels            `yaml:\"labels,omitempty\" json:\"labels,omitempty\"`\n\tDriver         string            `yaml:\"driver,omitempty\" json:\"driver,omitempty\"`\n\tDriverOpts     map[string]string `yaml:\"driver_opts,omitempty\" json:\"driver_opts,omitempty\"`\n\tTemplateDriver string            `yaml:\"template_driver,omitempty\" json:\"template_driver,omitempty\"`\n\tExtensions     Extensions        `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n}\n\nconst (\n\t// ServiceConditionCompletedSuccessfully is the type for waiting until a service has completed successfully (exit code 0).\n\tServiceConditionCompletedSuccessfully = \"service_completed_successfully\"\n\n\t// ServiceConditionHealthy is the type for waiting until a service is healthy.\n\tServiceConditionHealthy = \"service_healthy\"\n\n\t// ServiceConditionStarted is the type for waiting until a service has started (default).\n\tServiceConditionStarted = \"service_started\"\n)\n\ntype DependsOnConfig map[string]ServiceDependency\n\ntype ServiceDependency struct {\n\tCondition  string     `yaml:\"condition,omitempty\" json:\"condition,omitempty\"`\n\tRestart    bool       `yaml:\"restart,omitempty\" json:\"restart,omitempty\"`\n\tExtensions Extensions `yaml:\"#extensions,inline,omitempty\" json:\"-\"`\n\tRequired   bool       `yaml:\"required\" json:\"required\"`\n}\n\ntype ExtendsConfig struct {\n\tFile    string `yaml:\"file,omitempty\" json:\"file,omitempty\"`\n\tService string `yaml:\"service,omitempty\" json:\"service,omitempty\"`\n}\n\n// SecretConfig for a secret\ntype SecretConfig FileObjectConfig\n\n// MarshalYAML makes SecretConfig implement yaml.Marshaller\nfunc (s SecretConfig) MarshalYAML() (interface{}, error) {\n\t// secret content is set while loading model. Never marshall it\n\ts.Content = \"\"\n\treturn FileObjectConfig(s), nil\n}\n\n// MarshalJSON makes SecretConfig implement json.Marshaller\nfunc (s SecretConfig) MarshalJSON() ([]byte, error) {\n\t// secret content is set while loading model. Never marshall it\n\ts.Content = \"\"\n\treturn json.Marshal(FileObjectConfig(s))\n}\n\n// ConfigObjConfig is the config for the swarm \"Config\" object\ntype ConfigObjConfig FileObjectConfig\n\n// MarshalYAML makes ConfigObjConfig implement yaml.Marshaller\nfunc (s ConfigObjConfig) MarshalYAML() (interface{}, error) {\n\t// config content may have been set from environment while loading model. Marshall actual source\n\tif s.Environment != \"\" {\n\t\ts.Content = \"\"\n\t}\n\treturn FileObjectConfig(s), nil\n}\n\n// MarshalJSON makes ConfigObjConfig implement json.Marshaller\nfunc (s ConfigObjConfig) MarshalJSON() ([]byte, error) {\n\t// config content may have been set from environment while loading model. Marshall actual source\n\tif s.Environment != \"\" {\n\t\ts.Content = \"\"\n\t}\n\treturn json.Marshal(FileObjectConfig(s))\n}\n\ntype IncludeConfig struct {\n\tPath             StringList `yaml:\"path,omitempty\" json:\"path,omitempty\"`\n\tProjectDirectory string     `yaml:\"project_directory,omitempty\" json:\"project_directory,omitempty\"`\n\tEnvFile          StringList `yaml:\"env_file,omitempty\" json:\"env_file,omitempty\"`\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage utils\n\nimport (\n\t\"golang.org/x/exp/constraints\"\n\t\"golang.org/x/exp/maps\"\n\t\"golang.org/x/exp/slices\"\n)\n\nfunc MapKeys[T constraints.Ordered, U any](theMap map[T]U) []T {\n\tresult := maps.Keys(theMap)\n\tslices.Sort(result)\n\treturn result\n}\n\nfunc MapsAppend[T comparable, U any](target map[T]U, source map[T]U) map[T]U {\n\tif target == nil {\n\t\treturn source\n\t}\n\tif source == nil {\n\t\treturn target\n\t}\n\tfor key, value := range source {\n\t\tif _, ok := target[key]; !ok {\n\t\t\ttarget[key] = value\n\t\t}\n\t}\n\treturn target\n}\n\nfunc ArrayContains[T comparable](source []T, toCheck []T) bool {\n\tfor _, value := range toCheck {\n\t\tif !slices.Contains(source, value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc RemoveDuplicates[T comparable](slice []T) []T {\n\t// Create a map to store unique elements\n\tseen := make(map[T]bool)\n\tresult := []T{}\n\n\t// Loop through the slice, adding elements to the map if they haven't been seen before\n\tfor _, val := range slice {\n\t\tif _, ok := seen[val]; !ok {\n\t\t\tseen[val] = true\n\t\t\tresult = append(result, val)\n\t\t}\n\t}\n\treturn result\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/utils/pathutils.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage utils\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// ResolveSymbolicLink converts the section of an absolute path if it is a\n// symbolic link\n//\n// Parameters:\n//   - path: an absolute path\n//\n// Returns:\n//   - converted path if it has a symbolic link or the same path if there is\n//     no symbolic link\nfunc ResolveSymbolicLink(path string) (string, error) {\n\tsym, part, err := getSymbolinkLink(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif sym == \"\" && part == \"\" {\n\t\t// no symbolic link detected\n\t\treturn path, nil\n\t}\n\treturn strings.Replace(path, part, sym, 1), nil\n\n}\n\n// getSymbolinkLink parses all parts of the path and returns the\n// the symbolic link part as well as the correspondent original part\n// Parameters:\n//   - path: an absolute path\n//\n// Returns:\n//   - string section of the path that is a symbolic link\n//   - string correspondent path section of the symbolic link\n//   - An error\nfunc getSymbolinkLink(path string) (string, string, error) {\n\tparts := strings.Split(path, string(os.PathSeparator))\n\n\t// Reconstruct the path step by step, checking each component\n\tvar currentPath string\n\tif filepath.IsAbs(path) {\n\t\tcurrentPath = string(os.PathSeparator)\n\t}\n\n\tfor _, part := range parts {\n\t\tif part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tcurrentPath = filepath.Join(currentPath, part)\n\n\t\tif isSymLink := isSymbolicLink(currentPath); isSymLink {\n\t\t\t// return symbolic link, and correspondent part\n\t\t\ttarget, err := filepath.EvalSymlinks(currentPath)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", \"\", err\n\t\t\t}\n\t\t\treturn target, currentPath, nil\n\t\t}\n\t}\n\treturn \"\", \"\", nil // no symbolic link\n}\n\n// isSymbolicLink validates if the path is a symbolic link\nfunc isSymbolicLink(path string) bool {\n\tinfo, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t// Check if the file mode indicates a symbolic link\n\treturn info.Mode()&os.ModeSymlink != 0\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/utils/set.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage utils\n\ntype Set[T comparable] map[T]struct{}\n\nfunc NewSet[T comparable](v ...T) Set[T] {\n\tif len(v) == 0 {\n\t\treturn make(Set[T])\n\t}\n\n\tout := make(Set[T], len(v))\n\tfor i := range v {\n\t\tout.Add(v[i])\n\t}\n\treturn out\n}\n\nfunc (s Set[T]) Has(v T) bool {\n\t_, ok := s[v]\n\treturn ok\n}\n\nfunc (s Set[T]) Add(v T) {\n\ts[v] = struct{}{}\n}\n\nfunc (s Set[T]) AddAll(v ...T) {\n\tfor _, e := range v {\n\t\ts[e] = struct{}{}\n\t}\n}\n\nfunc (s Set[T]) Remove(v T) bool {\n\t_, ok := s[v]\n\tif ok {\n\t\tdelete(s, v)\n\t}\n\treturn ok\n}\n\nfunc (s Set[T]) Clear() {\n\tfor v := range s {\n\t\tdelete(s, v)\n\t}\n}\n\nfunc (s Set[T]) Elements() []T {\n\telements := make([]T, 0, len(s))\n\tfor v := range s {\n\t\telements = append(elements, v)\n\t}\n\treturn elements\n}\n\nfunc (s Set[T]) RemoveAll(elements ...T) {\n\tfor _, e := range elements {\n\t\ts.Remove(e)\n\t}\n}\n\nfunc (s Set[T]) Diff(other Set[T]) Set[T] {\n\tout := make(Set[T])\n\tfor k := range s {\n\t\tif _, ok := other[k]; !ok {\n\t\t\tout[k] = struct{}{}\n\t\t}\n\t}\n\treturn out\n}\n\nfunc (s Set[T]) Union(other Set[T]) Set[T] {\n\tout := make(Set[T])\n\tfor k := range s {\n\t\tout[k] = struct{}{}\n\t}\n\tfor k := range other {\n\t\tout[k] = struct{}{}\n\t}\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/utils/stringutils.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage utils\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// StringToBool converts a string to a boolean ignoring errors\nfunc StringToBool(s string) bool {\n\tb, _ := strconv.ParseBool(strings.ToLower(strings.TrimSpace(s)))\n\treturn b\n}\n\n// GetAsEqualsMap split key=value formatted strings into a key : value map\nfunc GetAsEqualsMap(em []string) map[string]string {\n\tm := make(map[string]string)\n\tfor _, v := range em {\n\t\tkey, val, found := strings.Cut(v, \"=\")\n\t\tif found {\n\t\t\tm[key] = val\n\t\t}\n\t}\n\treturn m\n}\n\n// GetAsEqualsMap format a key : value map into key=value strings\nfunc GetAsStringList(em map[string]string) []string {\n\tm := make([]string, 0, len(em))\n\tfor k, v := range em {\n\t\tm = append(m, fmt.Sprintf(\"%s=%s\", k, v))\n\t}\n\treturn m\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/validation/external.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage validation\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/consts\"\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc checkExternal(v map[string]any, p tree.Path) error {\n\tb, ok := v[\"external\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif !b.(bool) {\n\t\treturn nil\n\t}\n\n\tfor k := range v {\n\t\tswitch k {\n\t\tcase \"name\", \"external\", consts.Extensions:\n\t\t\tcontinue\n\t\tdefault:\n\t\t\tif strings.HasPrefix(k, \"x-\") {\n\t\t\t\t// custom extension, ignored\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"%s: conflicting parameters \\\"external\\\" and %q specified\", p, k)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/validation/validation.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage validation\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\ntype checkerFunc func(value any, p tree.Path) error\n\nvar checks = map[tree.Path]checkerFunc{\n\t\"volumes.*\":                       checkVolume,\n\t\"configs.*\":                       checkFileObject(\"file\", \"environment\", \"content\"),\n\t\"secrets.*\":                       checkFileObject(\"file\", \"environment\"),\n\t\"services.*.develop.watch.*.path\": checkPath,\n}\n\nfunc Validate(dict map[string]any) error {\n\treturn check(dict, tree.NewPath())\n}\n\nfunc check(value any, p tree.Path) error {\n\tfor pattern, fn := range checks {\n\t\tif p.Matches(pattern) {\n\t\t\treturn fn(value, p)\n\t\t}\n\t}\n\tswitch v := value.(type) {\n\tcase map[string]any:\n\t\tfor k, v := range v {\n\t\t\terr := check(v, p.Next(k))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase []any:\n\t\tfor _, e := range v {\n\t\t\terr := check(e, p.Next(\"[]\"))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkFileObject(keys ...string) checkerFunc {\n\treturn func(value any, p tree.Path) error {\n\n\t\tv := value.(map[string]any)\n\t\tcount := 0\n\t\tfor _, s := range keys {\n\t\t\tif _, ok := v[s]; ok {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count > 1 {\n\t\t\treturn fmt.Errorf(\"%s: %s attributes are mutually exclusive\", p, strings.Join(keys, \"|\"))\n\t\t}\n\t\tif count == 0 {\n\t\t\tif _, ok := v[\"driver\"]; ok {\n\t\t\t\t// User specified a custom driver, which might have it's own way to set content\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif _, ok := v[\"external\"]; !ok {\n\t\t\t\treturn fmt.Errorf(\"%s: one of %s must be set\", p, strings.Join(keys, \"|\"))\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}\n\nfunc checkPath(value any, p tree.Path) error {\n\tv := value.(string)\n\tif v == \"\" {\n\t\treturn fmt.Errorf(\"%s: value can't be blank\", p)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/compose-spec/compose-go/v2/validation/volume.go",
    "content": "/*\n   Copyright 2020 The Compose Specification Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage validation\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/compose-spec/compose-go/v2/tree\"\n)\n\nfunc checkVolume(value any, p tree.Path) error {\n\tif value == nil {\n\t\treturn nil\n\t}\n\tv, ok := value.(map[string]any)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expected volume, got %s\", value)\n\t}\n\n\terr := checkExternal(v, p)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/.golangci.yml",
    "content": "linters:\n  enable:\n    - gofmt\n    - goimports\n    - ineffassign\n    - misspell\n    - revive\n    - staticcheck\n    - structcheck\n    - unconvert\n    - unused\n    - varcheck\n    - vet\n  disable:\n    - errcheck\n\nrun:\n  timeout: 3m\n  skip-dirs:\n    - vendor\n"
  },
  {
    "path": "vendor/github.com/containerd/console/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/console/README.md",
    "content": "# console\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/console)](https://pkg.go.dev/github.com/containerd/console)\n[![Build Status](https://github.com/containerd/console/workflows/CI/badge.svg)](https://github.com/containerd/console/actions?query=workflow%3ACI)\n[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/console)](https://goreportcard.com/report/github.com/containerd/console)\n\nGolang package for dealing with consoles.  Light on deps and a simple API.\n\n## Modifying the current process\n\n```go\ncurrent := console.Current()\ndefer current.Reset()\n\nif err := current.SetRaw(); err != nil {\n}\nws, err := current.Size()\ncurrent.Resize(ws)\n```\n\n## Project details\n\nconsole is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository.\n"
  },
  {
    "path": "vendor/github.com/containerd/console/console.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\tErrNotAConsole    = errors.New(\"provided file is not a console\")\n\tErrNotImplemented = errors.New(\"not implemented\")\n)\n\ntype File interface {\n\tio.ReadWriteCloser\n\n\t// Fd returns its file descriptor\n\tFd() uintptr\n\t// Name returns its file name\n\tName() string\n}\n\ntype Console interface {\n\tFile\n\n\t// Resize resizes the console to the provided window size\n\tResize(WinSize) error\n\t// ResizeFrom resizes the calling console to the size of the\n\t// provided console\n\tResizeFrom(Console) error\n\t// SetRaw sets the console in raw mode\n\tSetRaw() error\n\t// DisableEcho disables echo on the console\n\tDisableEcho() error\n\t// Reset restores the console to its original state\n\tReset() error\n\t// Size returns the window size of the console\n\tSize() (WinSize, error)\n}\n\n// WinSize specifies the window size of the console\ntype WinSize struct {\n\t// Height of the console\n\tHeight uint16\n\t// Width of the console\n\tWidth uint16\n\tx     uint16\n\ty     uint16\n}\n\n// Current returns the current process' console\nfunc Current() (c Console) {\n\tvar err error\n\t// Usually all three streams (stdin, stdout, and stderr)\n\t// are open to the same console, but some might be redirected,\n\t// so try all three.\n\tfor _, s := range []*os.File{os.Stderr, os.Stdout, os.Stdin} {\n\t\tif c, err = ConsoleFromFile(s); err == nil {\n\t\t\treturn c\n\t\t}\n\t}\n\t// One of the std streams should always be a console\n\t// for the design of this function.\n\tpanic(err)\n}\n\n// ConsoleFromFile returns a console using the provided file\n// nolint:revive\nfunc ConsoleFromFile(f File) (Console, error) {\n\tif err := checkConsole(f); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newMaster(f)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/console_linux.go",
    "content": "//go:build linux\n// +build linux\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tmaxEvents = 128\n)\n\n// Epoller manages multiple epoll consoles using edge-triggered epoll api so we\n// dont have to deal with repeated wake-up of EPOLLER or EPOLLHUP.\n// For more details, see:\n// - https://github.com/systemd/systemd/pull/4262\n// - https://github.com/moby/moby/issues/27202\n//\n// Example usage of Epoller and EpollConsole can be as follow:\n//\n//\tepoller, _ := NewEpoller()\n//\tepollConsole, _ := epoller.Add(console)\n//\tgo epoller.Wait()\n//\tvar (\n//\t\tb  bytes.Buffer\n//\t\twg sync.WaitGroup\n//\t)\n//\twg.Add(1)\n//\tgo func() {\n//\t\tio.Copy(&b, epollConsole)\n//\t\twg.Done()\n//\t}()\n//\t// perform I/O on the console\n//\tepollConsole.Shutdown(epoller.CloseConsole)\n//\twg.Wait()\n//\tepollConsole.Close()\ntype Epoller struct {\n\tefd       int\n\tmu        sync.Mutex\n\tfdMapping map[int]*EpollConsole\n\tcloseOnce sync.Once\n}\n\n// NewEpoller returns an instance of epoller with a valid epoll fd.\nfunc NewEpoller() (*Epoller, error) {\n\tefd, err := unix.EpollCreate1(unix.EPOLL_CLOEXEC)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Epoller{\n\t\tefd:       efd,\n\t\tfdMapping: make(map[int]*EpollConsole),\n\t}, nil\n}\n\n// Add creates an epoll console based on the provided console. The console will\n// be registered with EPOLLET (i.e. using edge-triggered notification) and its\n// file descriptor will be set to non-blocking mode. After this, user should use\n// the return console to perform I/O.\nfunc (e *Epoller) Add(console Console) (*EpollConsole, error) {\n\tsysfd := int(console.Fd())\n\t// Set sysfd to non-blocking mode\n\tif err := unix.SetNonblock(sysfd, true); err != nil {\n\t\treturn nil, err\n\t}\n\n\tev := unix.EpollEvent{\n\t\tEvents: unix.EPOLLIN | unix.EPOLLOUT | unix.EPOLLRDHUP | unix.EPOLLET,\n\t\tFd:     int32(sysfd),\n\t}\n\tif err := unix.EpollCtl(e.efd, unix.EPOLL_CTL_ADD, sysfd, &ev); err != nil {\n\t\treturn nil, err\n\t}\n\tef := &EpollConsole{\n\t\tConsole: console,\n\t\tsysfd:   sysfd,\n\t\treadc:   sync.NewCond(&sync.Mutex{}),\n\t\twritec:  sync.NewCond(&sync.Mutex{}),\n\t}\n\te.mu.Lock()\n\te.fdMapping[sysfd] = ef\n\te.mu.Unlock()\n\treturn ef, nil\n}\n\n// Wait starts the loop to wait for its consoles' notifications and signal\n// appropriate console that it can perform I/O.\nfunc (e *Epoller) Wait() error {\n\tevents := make([]unix.EpollEvent, maxEvents)\n\tfor {\n\t\tn, err := unix.EpollWait(e.efd, events, -1)\n\t\tif err != nil {\n\t\t\t// EINTR: The call was interrupted by a signal handler before either\n\t\t\t// any of the requested events occurred or the timeout expired\n\t\t\tif err == unix.EINTR {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tfor i := 0; i < n; i++ {\n\t\t\tev := &events[i]\n\t\t\t// the console is ready to be read from\n\t\t\tif ev.Events&(unix.EPOLLIN|unix.EPOLLHUP|unix.EPOLLERR) != 0 {\n\t\t\t\tif epfile := e.getConsole(int(ev.Fd)); epfile != nil {\n\t\t\t\t\tepfile.signalRead()\n\t\t\t\t}\n\t\t\t}\n\t\t\t// the console is ready to be written to\n\t\t\tif ev.Events&(unix.EPOLLOUT|unix.EPOLLHUP|unix.EPOLLERR) != 0 {\n\t\t\t\tif epfile := e.getConsole(int(ev.Fd)); epfile != nil {\n\t\t\t\t\tepfile.signalWrite()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// CloseConsole unregisters the console's file descriptor from epoll interface\nfunc (e *Epoller) CloseConsole(fd int) error {\n\te.mu.Lock()\n\tdefer e.mu.Unlock()\n\tdelete(e.fdMapping, fd)\n\treturn unix.EpollCtl(e.efd, unix.EPOLL_CTL_DEL, fd, &unix.EpollEvent{})\n}\n\nfunc (e *Epoller) getConsole(sysfd int) *EpollConsole {\n\te.mu.Lock()\n\tf := e.fdMapping[sysfd]\n\te.mu.Unlock()\n\treturn f\n}\n\n// Close closes the epoll fd\nfunc (e *Epoller) Close() error {\n\tcloseErr := os.ErrClosed // default to \"file already closed\"\n\te.closeOnce.Do(func() {\n\t\tcloseErr = unix.Close(e.efd)\n\t})\n\treturn closeErr\n}\n\n// EpollConsole acts like a console but registers its file descriptor with an\n// epoll fd and uses epoll API to perform I/O.\ntype EpollConsole struct {\n\tConsole\n\treadc  *sync.Cond\n\twritec *sync.Cond\n\tsysfd  int\n\tclosed bool\n}\n\n// Read reads up to len(p) bytes into p. It returns the number of bytes read\n// (0 <= n <= len(p)) and any error encountered.\n//\n// If the console's read returns EAGAIN or EIO, we assume that it's a\n// temporary error because the other side went away and wait for the signal\n// generated by epoll event to continue.\nfunc (ec *EpollConsole) Read(p []byte) (n int, err error) {\n\tvar read int\n\tec.readc.L.Lock()\n\tdefer ec.readc.L.Unlock()\n\tfor {\n\t\tread, err = ec.Console.Read(p[n:])\n\t\tn += read\n\t\tif err != nil {\n\t\t\tvar hangup bool\n\t\t\tif perr, ok := err.(*os.PathError); ok {\n\t\t\t\thangup = (perr.Err == unix.EAGAIN || perr.Err == unix.EIO)\n\t\t\t} else {\n\t\t\t\thangup = (err == unix.EAGAIN || err == unix.EIO)\n\t\t\t}\n\t\t\t// if the other end disappear, assume this is temporary and wait for the\n\t\t\t// signal to continue again. Unless we didnt read anything and the\n\t\t\t// console is already marked as closed then we should exit\n\t\t\tif hangup && !(n == 0 && len(p) > 0 && ec.closed) {\n\t\t\t\tec.readc.Wait()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\t// if we didnt read anything then return io.EOF to end gracefully\n\tif n == 0 && len(p) > 0 && err == nil {\n\t\terr = io.EOF\n\t}\n\t// signal for others that we finished the read\n\tec.readc.Signal()\n\treturn n, err\n}\n\n// Writes len(p) bytes from p to the console. It returns the number of bytes\n// written from p (0 <= n <= len(p)) and any error encountered that caused\n// the write to stop early.\n//\n// If writes to the console returns EAGAIN or EIO, we assume that it's a\n// temporary error because the other side went away and wait for the signal\n// generated by epoll event to continue.\nfunc (ec *EpollConsole) Write(p []byte) (n int, err error) {\n\tvar written int\n\tec.writec.L.Lock()\n\tdefer ec.writec.L.Unlock()\n\tfor {\n\t\twritten, err = ec.Console.Write(p[n:])\n\t\tn += written\n\t\tif err != nil {\n\t\t\tvar hangup bool\n\t\t\tif perr, ok := err.(*os.PathError); ok {\n\t\t\t\thangup = (perr.Err == unix.EAGAIN || perr.Err == unix.EIO)\n\t\t\t} else {\n\t\t\t\thangup = (err == unix.EAGAIN || err == unix.EIO)\n\t\t\t}\n\t\t\t// if the other end disappears, assume this is temporary and wait for the\n\t\t\t// signal to continue again.\n\t\t\tif hangup {\n\t\t\t\tec.writec.Wait()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// unrecoverable error, break the loop and return the error\n\t\tbreak\n\t}\n\tif n < len(p) && err == nil {\n\t\terr = io.ErrShortWrite\n\t}\n\t// signal for others that we finished the write\n\tec.writec.Signal()\n\treturn n, err\n}\n\n// Shutdown closes the file descriptor and signals call waiters for this fd.\n// It accepts a callback which will be called with the console's fd. The\n// callback typically will be used to do further cleanup such as unregister the\n// console's fd from the epoll interface.\n// User should call Shutdown and wait for all I/O operation to be finished\n// before closing the console.\nfunc (ec *EpollConsole) Shutdown(close func(int) error) error {\n\tec.readc.L.Lock()\n\tdefer ec.readc.L.Unlock()\n\tec.writec.L.Lock()\n\tdefer ec.writec.L.Unlock()\n\n\tec.readc.Broadcast()\n\tec.writec.Broadcast()\n\tec.closed = true\n\treturn close(ec.sysfd)\n}\n\n// signalRead signals that the console is readable.\nfunc (ec *EpollConsole) signalRead() {\n\tec.readc.L.Lock()\n\tec.readc.Signal()\n\tec.readc.L.Unlock()\n}\n\n// signalWrite signals that the console is writable.\nfunc (ec *EpollConsole) signalWrite() {\n\tec.writec.L.Lock()\n\tec.writec.Signal()\n\tec.writec.L.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/console_other.go",
    "content": "//go:build !darwin && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos\n// +build !darwin,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\n// NewPty creates a new pty pair\n// The master is returned as the first console and a string\n// with the path to the pty slave is returned as the second\nfunc NewPty() (Console, string, error) {\n\treturn nil, \"\", ErrNotImplemented\n}\n\n// checkConsole checks if the provided file is a console\nfunc checkConsole(f File) error {\n\treturn ErrNotAConsole\n}\n\nfunc newMaster(f File) (Console, error) {\n\treturn nil, ErrNotImplemented\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/console_unix.go",
    "content": "//go:build darwin || freebsd || linux || netbsd || openbsd || zos\n// +build darwin freebsd linux netbsd openbsd zos\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\n// NewPty creates a new pty pair\n// The master is returned as the first console and a string\n// with the path to the pty slave is returned as the second\nfunc NewPty() (Console, string, error) {\n\tf, err := openpt()\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tslave, err := ptsname(f)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tif err := unlockpt(f); err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tm, err := newMaster(f)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treturn m, slave, nil\n}\n\ntype master struct {\n\tf        File\n\toriginal *unix.Termios\n}\n\nfunc (m *master) Read(b []byte) (int, error) {\n\treturn m.f.Read(b)\n}\n\nfunc (m *master) Write(b []byte) (int, error) {\n\treturn m.f.Write(b)\n}\n\nfunc (m *master) Close() error {\n\treturn m.f.Close()\n}\n\nfunc (m *master) Resize(ws WinSize) error {\n\treturn tcswinsz(m.f.Fd(), ws)\n}\n\nfunc (m *master) ResizeFrom(c Console) error {\n\tws, err := c.Size()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn m.Resize(ws)\n}\n\nfunc (m *master) Reset() error {\n\tif m.original == nil {\n\t\treturn nil\n\t}\n\treturn tcset(m.f.Fd(), m.original)\n}\n\nfunc (m *master) getCurrent() (unix.Termios, error) {\n\tvar termios unix.Termios\n\tif err := tcget(m.f.Fd(), &termios); err != nil {\n\t\treturn unix.Termios{}, err\n\t}\n\treturn termios, nil\n}\n\nfunc (m *master) SetRaw() error {\n\trawState, err := m.getCurrent()\n\tif err != nil {\n\t\treturn err\n\t}\n\trawState = cfmakeraw(rawState)\n\trawState.Oflag = rawState.Oflag | unix.OPOST\n\treturn tcset(m.f.Fd(), &rawState)\n}\n\nfunc (m *master) DisableEcho() error {\n\trawState, err := m.getCurrent()\n\tif err != nil {\n\t\treturn err\n\t}\n\trawState.Lflag = rawState.Lflag &^ unix.ECHO\n\treturn tcset(m.f.Fd(), &rawState)\n}\n\nfunc (m *master) Size() (WinSize, error) {\n\treturn tcgwinsz(m.f.Fd())\n}\n\nfunc (m *master) Fd() uintptr {\n\treturn m.f.Fd()\n}\n\nfunc (m *master) Name() string {\n\treturn m.f.Name()\n}\n\n// checkConsole checks if the provided file is a console\nfunc checkConsole(f File) error {\n\tvar termios unix.Termios\n\tif tcget(f.Fd(), &termios) != nil {\n\t\treturn ErrNotAConsole\n\t}\n\treturn nil\n}\n\nfunc newMaster(f File) (Console, error) {\n\tm := &master{\n\t\tf: f,\n\t}\n\tt, err := m.getCurrent()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm.original = &t\n\treturn m, nil\n}\n\n// ClearONLCR sets the necessary tty_ioctl(4)s to ensure that a pty pair\n// created by us acts normally. In particular, a not-very-well-known default of\n// Linux unix98 ptys is that they have +onlcr by default. While this isn't a\n// problem for terminal emulators, because we relay data from the terminal we\n// also relay that funky line discipline.\nfunc ClearONLCR(fd uintptr) error {\n\treturn setONLCR(fd, false)\n}\n\n// SetONLCR sets the necessary tty_ioctl(4)s to ensure that a pty pair\n// created by us acts as intended for a terminal emulator.\nfunc SetONLCR(fd uintptr) error {\n\treturn setONLCR(fd, true)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/console_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nvar vtInputSupported bool\n\nfunc (m *master) initStdios() {\n\t// Note: We discard console mode warnings, because in/out can be redirected.\n\t//\n\t// TODO: Investigate opening CONOUT$/CONIN$ to handle this correctly\n\n\tm.in = windows.Handle(os.Stdin.Fd())\n\tif err := windows.GetConsoleMode(m.in, &m.inMode); err == nil {\n\t\t// Validate that windows.ENABLE_VIRTUAL_TERMINAL_INPUT is supported, but do not set it.\n\t\tif err = windows.SetConsoleMode(m.in, m.inMode|windows.ENABLE_VIRTUAL_TERMINAL_INPUT); err == nil {\n\t\t\tvtInputSupported = true\n\t\t}\n\t\t// Unconditionally set the console mode back even on failure because SetConsoleMode\n\t\t// remembers invalid bits on input handles.\n\t\twindows.SetConsoleMode(m.in, m.inMode)\n\t}\n\n\tm.out = windows.Handle(os.Stdout.Fd())\n\tif err := windows.GetConsoleMode(m.out, &m.outMode); err == nil {\n\t\tif err := windows.SetConsoleMode(m.out, m.outMode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err == nil {\n\t\t\tm.outMode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING\n\t\t} else {\n\t\t\twindows.SetConsoleMode(m.out, m.outMode)\n\t\t}\n\t}\n\n\tm.err = windows.Handle(os.Stderr.Fd())\n\tif err := windows.GetConsoleMode(m.err, &m.errMode); err == nil {\n\t\tif err := windows.SetConsoleMode(m.err, m.errMode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err == nil {\n\t\t\tm.errMode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING\n\t\t} else {\n\t\t\twindows.SetConsoleMode(m.err, m.errMode)\n\t\t}\n\t}\n}\n\ntype master struct {\n\tin     windows.Handle\n\tinMode uint32\n\n\tout     windows.Handle\n\toutMode uint32\n\n\terr     windows.Handle\n\terrMode uint32\n}\n\nfunc (m *master) SetRaw() error {\n\tif err := makeInputRaw(m.in, m.inMode); err != nil {\n\t\treturn err\n\t}\n\n\t// Set StdOut and StdErr to raw mode, we ignore failures since\n\t// windows.DISABLE_NEWLINE_AUTO_RETURN might not be supported on this version of\n\t// Windows.\n\n\twindows.SetConsoleMode(m.out, m.outMode|windows.DISABLE_NEWLINE_AUTO_RETURN)\n\n\twindows.SetConsoleMode(m.err, m.errMode|windows.DISABLE_NEWLINE_AUTO_RETURN)\n\n\treturn nil\n}\n\nfunc (m *master) Reset() error {\n\tvar errs []error\n\n\tfor _, s := range []struct {\n\t\tfd   windows.Handle\n\t\tmode uint32\n\t}{\n\t\t{m.in, m.inMode},\n\t\t{m.out, m.outMode},\n\t\t{m.err, m.errMode},\n\t} {\n\t\tif err := windows.SetConsoleMode(s.fd, s.mode); err != nil {\n\t\t\t// we can't just abort on the first error, otherwise we might leave\n\t\t\t// the console in an unexpected state.\n\t\t\terrs = append(errs, fmt.Errorf(\"unable to restore console mode: %w\", err))\n\t\t}\n\t}\n\n\tif len(errs) > 0 {\n\t\treturn errs[0]\n\t}\n\n\treturn nil\n}\n\nfunc (m *master) Size() (WinSize, error) {\n\tvar info windows.ConsoleScreenBufferInfo\n\terr := windows.GetConsoleScreenBufferInfo(m.out, &info)\n\tif err != nil {\n\t\treturn WinSize{}, fmt.Errorf(\"unable to get console info: %w\", err)\n\t}\n\n\twinsize := WinSize{\n\t\tWidth:  uint16(info.Window.Right - info.Window.Left + 1),\n\t\tHeight: uint16(info.Window.Bottom - info.Window.Top + 1),\n\t}\n\n\treturn winsize, nil\n}\n\nfunc (m *master) Resize(ws WinSize) error {\n\treturn ErrNotImplemented\n}\n\nfunc (m *master) ResizeFrom(c Console) error {\n\treturn ErrNotImplemented\n}\n\nfunc (m *master) DisableEcho() error {\n\tmode := m.inMode &^ windows.ENABLE_ECHO_INPUT\n\tmode |= windows.ENABLE_PROCESSED_INPUT\n\tmode |= windows.ENABLE_LINE_INPUT\n\n\tif err := windows.SetConsoleMode(m.in, mode); err != nil {\n\t\treturn fmt.Errorf(\"unable to set console to disable echo: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (m *master) Close() error {\n\treturn nil\n}\n\nfunc (m *master) Read(b []byte) (int, error) {\n\treturn os.Stdin.Read(b)\n}\n\nfunc (m *master) Write(b []byte) (int, error) {\n\treturn os.Stdout.Write(b)\n}\n\nfunc (m *master) Fd() uintptr {\n\treturn uintptr(m.in)\n}\n\n// on windows, console can only be made from os.Std{in,out,err}, hence there\n// isnt a single name here we can use. Return a dummy \"console\" value in this\n// case should be sufficient.\nfunc (m *master) Name() string {\n\treturn \"console\"\n}\n\n// makeInputRaw puts the terminal (Windows Console) connected to the given\n// file descriptor into raw mode\nfunc makeInputRaw(fd windows.Handle, mode uint32) error {\n\t// See\n\t// -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx\n\t// -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx\n\n\t// Disable these modes\n\tmode &^= windows.ENABLE_ECHO_INPUT\n\tmode &^= windows.ENABLE_LINE_INPUT\n\tmode &^= windows.ENABLE_MOUSE_INPUT\n\tmode &^= windows.ENABLE_WINDOW_INPUT\n\tmode &^= windows.ENABLE_PROCESSED_INPUT\n\n\t// Enable these modes\n\tmode |= windows.ENABLE_EXTENDED_FLAGS\n\tmode |= windows.ENABLE_INSERT_MODE\n\tmode |= windows.ENABLE_QUICK_EDIT_MODE\n\n\tif vtInputSupported {\n\t\tmode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT\n\t}\n\n\tif err := windows.SetConsoleMode(fd, mode); err != nil {\n\t\treturn fmt.Errorf(\"unable to set console to raw mode: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc checkConsole(f File) error {\n\tvar mode uint32\n\tif err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newMaster(f File) (Console, error) {\n\tif f != os.Stdin && f != os.Stdout && f != os.Stderr {\n\t\treturn nil, errors.New(\"creating a console from a file is not supported on windows\")\n\t}\n\tm := &master{}\n\tm.initStdios()\n\treturn m, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/pty_freebsd_cgo.go",
    "content": "//go:build freebsd && cgo\n// +build freebsd,cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n/*\n#include <fcntl.h>\n#include <stdlib.h>\n#include <unistd.h>\n*/\nimport \"C\"\n\n// openpt allocates a new pseudo-terminal and establishes a connection with its\n// control device.\nfunc openpt() (*os.File, error) {\n\tfd, err := C.posix_openpt(C.O_RDWR)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"posix_openpt: %w\", err)\n\t}\n\tif _, err := C.grantpt(fd); err != nil {\n\t\tC.close(fd)\n\t\treturn nil, fmt.Errorf(\"grantpt: %w\", err)\n\t}\n\treturn os.NewFile(uintptr(fd), \"\"), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/pty_freebsd_nocgo.go",
    "content": "//go:build freebsd && !cgo\n// +build freebsd,!cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"os\"\n)\n\n//\n// Implementing the functions below requires cgo support.  Non-cgo stubs\n// versions are defined below to enable cross-compilation of source code\n// that depends on these functions, but the resultant cross-compiled\n// binaries cannot actually be used.  If the stub function(s) below are\n// actually invoked they will display an error message and cause the\n// calling process to exit.\n//\n\nfunc openpt() (*os.File, error) {\n\tpanic(\"openpt() support requires cgo.\")\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/pty_unix.go",
    "content": "//go:build darwin || linux || netbsd || openbsd\n// +build darwin linux netbsd openbsd\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// openpt allocates a new pseudo-terminal by opening the /dev/ptmx device\nfunc openpt() (*os.File, error) {\n\treturn os.OpenFile(\"/dev/ptmx\", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/pty_zos.go",
    "content": "//go:build zos\n// +build zos\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n// openpt allocates a new pseudo-terminal by opening the first available /dev/ptypXX device\nfunc openpt() (*os.File, error) {\n\tvar f *os.File\n\tvar err error\n\tfor i := 0; ; i++ {\n\t\tptyp := fmt.Sprintf(\"/dev/ptyp%04d\", i)\n\t\tf, err = os.OpenFile(ptyp, os.O_RDWR, 0600)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\t\t// else probably Resource Busy\n\t}\n\treturn f, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_darwin.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\treturn unix.IoctlSetPointerInt(int(f.Fd()), unix.TIOCPTYUNLK, 0)\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tn, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCPTYGNAME)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"/dev/pts/%d\", n), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_freebsd_cgo.go",
    "content": "//go:build freebsd && cgo\n// +build freebsd,cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n/*\n#include <stdlib.h>\n#include <unistd.h>\n*/\nimport \"C\"\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\tfd := C.int(f.Fd())\n\tif _, err := C.unlockpt(fd); err != nil {\n\t\tC.close(fd)\n\t\treturn fmt.Errorf(\"unlockpt: %w\", err)\n\t}\n\treturn nil\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tn, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"/dev/pts/%d\", n), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_freebsd_nocgo.go",
    "content": "//go:build freebsd && !cgo\n// +build freebsd,!cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\n//\n// Implementing the functions below requires cgo support.  Non-cgo stubs\n// versions are defined below to enable cross-compilation of source code\n// that depends on these functions, but the resultant cross-compiled\n// binaries cannot actually be used.  If the stub function(s) below are\n// actually invoked they will display an error message and cause the\n// calling process to exit.\n//\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\tpanic(\"unlockpt() support requires cgo.\")\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tn, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"/dev/pts/%d\", n), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TCGETS\n\tcmdTcSet = unix.TCSETS\n)\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\tvar u int32\n\t// XXX do not use unix.IoctlSetPointerInt here, see commit dbd69c59b81.\n\tif _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tvar u uint32\n\t// XXX do not use unix.IoctlGetInt here, see commit dbd69c59b81.\n\tif _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&u))); err != 0 {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"/dev/pts/%d\", u), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_netbsd.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\n// This does not exist on NetBSD, it does not allocate controlling terminals on open\nfunc unlockpt(f *os.File) error {\n\treturn nil\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tptm, err := unix.IoctlGetPtmget(int(f.Fd()), unix.TIOCPTSNAME)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(ptm.Sn[:bytes.IndexByte(ptm.Sn[:], 0)]), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_openbsd_cgo.go",
    "content": "//go:build openbsd && cgo\n// +build openbsd,cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n//#include <stdlib.h>\nimport \"C\"\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tptspath, err := C.ptsname(C.int(f.Fd()))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn C.GoString(ptspath), nil\n}\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\tif _, err := C.grantpt(C.int(f.Fd())); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_openbsd_nocgo.go",
    "content": "//go:build openbsd && !cgo\n// +build openbsd,!cgo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n//\n// Implementing the functions below requires cgo support.  Non-cgo stubs\n// versions are defined below to enable cross-compilation of source code\n// that depends on these functions, but the resultant cross-compiled\n// binaries cannot actually be used.  If the stub function(s) below are\n// actually invoked they will display an error message and cause the\n// calling process to exit.\n//\n\npackage console\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TIOCGETA\n\tcmdTcSet = unix.TIOCSETA\n)\n\nfunc ptsname(f *os.File) (string, error) {\n\tpanic(\"ptsname() support requires cgo.\")\n}\n\nfunc unlockpt(f *os.File) error {\n\tpanic(\"unlockpt() support requires cgo.\")\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_unix.go",
    "content": "//go:build darwin || freebsd || linux || netbsd || openbsd || zos\n// +build darwin freebsd linux netbsd openbsd zos\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc tcget(fd uintptr, p *unix.Termios) error {\n\ttermios, err := unix.IoctlGetTermios(int(fd), cmdTcGet)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*p = *termios\n\treturn nil\n}\n\nfunc tcset(fd uintptr, p *unix.Termios) error {\n\treturn unix.IoctlSetTermios(int(fd), cmdTcSet, p)\n}\n\nfunc tcgwinsz(fd uintptr) (WinSize, error) {\n\tvar ws WinSize\n\n\tuws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)\n\tif err != nil {\n\t\treturn ws, err\n\t}\n\n\t// Translate from unix.Winsize to console.WinSize\n\tws.Height = uws.Row\n\tws.Width = uws.Col\n\tws.x = uws.Xpixel\n\tws.y = uws.Ypixel\n\treturn ws, nil\n}\n\nfunc tcswinsz(fd uintptr, ws WinSize) error {\n\t// Translate from console.WinSize to unix.Winsize\n\n\tvar uws unix.Winsize\n\tuws.Row = ws.Height\n\tuws.Col = ws.Width\n\tuws.Xpixel = ws.x\n\tuws.Ypixel = ws.y\n\n\treturn unix.IoctlSetWinsize(int(fd), unix.TIOCSWINSZ, &uws)\n}\n\nfunc setONLCR(fd uintptr, enable bool) error {\n\tvar termios unix.Termios\n\tif err := tcget(fd, &termios); err != nil {\n\t\treturn err\n\t}\n\tif enable {\n\t\t// Set +onlcr so we can act like a real terminal\n\t\ttermios.Oflag |= unix.ONLCR\n\t} else {\n\t\t// Set -onlcr so we don't have to deal with \\r.\n\t\ttermios.Oflag &^= unix.ONLCR\n\t}\n\treturn tcset(fd, &termios)\n}\n\nfunc cfmakeraw(t unix.Termios) unix.Termios {\n\tt.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON)\n\tt.Oflag &^= unix.OPOST\n\tt.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)\n\tt.Cflag &^= (unix.CSIZE | unix.PARENB)\n\tt.Cflag |= unix.CS8\n\tt.Cc[unix.VMIN] = 1\n\tt.Cc[unix.VTIME] = 0\n\n\treturn t\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/console/tc_zos.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage console\n\nimport (\n\t\"os\"\n\t\"strings\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\tcmdTcGet = unix.TCGETS\n\tcmdTcSet = unix.TCSETS\n)\n\n// unlockpt is a no-op on zos.\nfunc unlockpt(_ *os.File) error {\n\treturn nil\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\treturn \"/dev/ttyp\" + strings.TrimPrefix(f.Name(), \"/dev/ptyp\"), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go",
    "content": "//\n//Copyright The containerd Authors.\n//\n//Licensed under the Apache License, Version 2.0 (the \"License\");\n//you may not use this file except in compliance with the License.\n//You may obtain a copy of the License at\n//\n//http://www.apache.org/licenses/LICENSE-2.0\n//\n//Unless required by applicable law or agreed to in writing, software\n//distributed under the License is distributed on an \"AS IS\" BASIS,\n//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//See the License for the specific language governing permissions and\n//limitations under the License.\n\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.20.1\n// source: github.com/containerd/containerd/api/services/content/v1/content.proto\n\npackage content\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\temptypb \"google.golang.org/protobuf/types/known/emptypb\"\n\tfieldmaskpb \"google.golang.org/protobuf/types/known/fieldmaskpb\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// WriteAction defines the behavior of a WriteRequest.\ntype WriteAction int32\n\nconst (\n\t// WriteActionStat instructs the writer to return the current status while\n\t// holding the lock on the write.\n\tWriteAction_STAT WriteAction = 0\n\t// WriteActionWrite sets the action for the write request to write data.\n\t//\n\t// Any data included will be written at the provided offset. The\n\t// transaction will be left open for further writes.\n\t//\n\t// This is the default.\n\tWriteAction_WRITE WriteAction = 1\n\t// WriteActionCommit will write any outstanding data in the message and\n\t// commit the write, storing it under the digest.\n\t//\n\t// This can be used in a single message to send the data, verify it and\n\t// commit it.\n\t//\n\t// This action will always terminate the write.\n\tWriteAction_COMMIT WriteAction = 2\n)\n\n// Enum value maps for WriteAction.\nvar (\n\tWriteAction_name = map[int32]string{\n\t\t0: \"STAT\",\n\t\t1: \"WRITE\",\n\t\t2: \"COMMIT\",\n\t}\n\tWriteAction_value = map[string]int32{\n\t\t\"STAT\":   0,\n\t\t\"WRITE\":  1,\n\t\t\"COMMIT\": 2,\n\t}\n)\n\nfunc (x WriteAction) Enum() *WriteAction {\n\tp := new(WriteAction)\n\t*p = x\n\treturn p\n}\n\nfunc (x WriteAction) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (WriteAction) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes[0].Descriptor()\n}\n\nfunc (WriteAction) Type() protoreflect.EnumType {\n\treturn &file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes[0]\n}\n\nfunc (x WriteAction) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use WriteAction.Descriptor instead.\nfunc (WriteAction) EnumDescriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{0}\n}\n\ntype Info struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Digest is the hash identity of the blob.\n\tDigest string `protobuf:\"bytes,1,opt,name=digest,proto3\" json:\"digest,omitempty\"`\n\t// Size is the total number of bytes in the blob.\n\tSize int64 `protobuf:\"varint,2,opt,name=size,proto3\" json:\"size,omitempty\"`\n\t// CreatedAt provides the time at which the blob was committed.\n\tCreatedAt *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=created_at,json=createdAt,proto3\" json:\"created_at,omitempty\"`\n\t// UpdatedAt provides the time the info was last updated.\n\tUpdatedAt *timestamppb.Timestamp `protobuf:\"bytes,4,opt,name=updated_at,json=updatedAt,proto3\" json:\"updated_at,omitempty\"`\n\t// Labels are arbitrary data on snapshots.\n\t//\n\t// The combined size of a key/value pair cannot exceed 4096 bytes.\n\tLabels map[string]string `protobuf:\"bytes,5,rep,name=labels,proto3\" json:\"labels,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n}\n\nfunc (x *Info) Reset() {\n\t*x = Info{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Info) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Info) ProtoMessage() {}\n\nfunc (x *Info) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Info.ProtoReflect.Descriptor instead.\nfunc (*Info) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Info) GetDigest() string {\n\tif x != nil {\n\t\treturn x.Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *Info) GetSize() int64 {\n\tif x != nil {\n\t\treturn x.Size\n\t}\n\treturn 0\n}\n\nfunc (x *Info) GetCreatedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.CreatedAt\n\t}\n\treturn nil\n}\n\nfunc (x *Info) GetUpdatedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.UpdatedAt\n\t}\n\treturn nil\n}\n\nfunc (x *Info) GetLabels() map[string]string {\n\tif x != nil {\n\t\treturn x.Labels\n\t}\n\treturn nil\n}\n\ntype InfoRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tDigest string `protobuf:\"bytes,1,opt,name=digest,proto3\" json:\"digest,omitempty\"`\n}\n\nfunc (x *InfoRequest) Reset() {\n\t*x = InfoRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *InfoRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*InfoRequest) ProtoMessage() {}\n\nfunc (x *InfoRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.\nfunc (*InfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *InfoRequest) GetDigest() string {\n\tif x != nil {\n\t\treturn x.Digest\n\t}\n\treturn \"\"\n}\n\ntype InfoResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tInfo *Info `protobuf:\"bytes,1,opt,name=info,proto3\" json:\"info,omitempty\"`\n}\n\nfunc (x *InfoResponse) Reset() {\n\t*x = InfoResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *InfoResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*InfoResponse) ProtoMessage() {}\n\nfunc (x *InfoResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.\nfunc (*InfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *InfoResponse) GetInfo() *Info {\n\tif x != nil {\n\t\treturn x.Info\n\t}\n\treturn nil\n}\n\ntype UpdateRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tInfo *Info `protobuf:\"bytes,1,opt,name=info,proto3\" json:\"info,omitempty\"`\n\t// UpdateMask specifies which fields to perform the update on. If empty,\n\t// the operation applies to all fields.\n\t//\n\t// In info, Digest, Size, and CreatedAt are immutable,\n\t// other field may be updated using this mask.\n\t// If no mask is provided, all mutable field are updated.\n\tUpdateMask *fieldmaskpb.FieldMask `protobuf:\"bytes,2,opt,name=update_mask,json=updateMask,proto3\" json:\"update_mask,omitempty\"`\n}\n\nfunc (x *UpdateRequest) Reset() {\n\t*x = UpdateRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *UpdateRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRequest) ProtoMessage() {}\n\nfunc (x *UpdateRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.\nfunc (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *UpdateRequest) GetInfo() *Info {\n\tif x != nil {\n\t\treturn x.Info\n\t}\n\treturn nil\n}\n\nfunc (x *UpdateRequest) GetUpdateMask() *fieldmaskpb.FieldMask {\n\tif x != nil {\n\t\treturn x.UpdateMask\n\t}\n\treturn nil\n}\n\ntype UpdateResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tInfo *Info `protobuf:\"bytes,1,opt,name=info,proto3\" json:\"info,omitempty\"`\n}\n\nfunc (x *UpdateResponse) Reset() {\n\t*x = UpdateResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *UpdateResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateResponse) ProtoMessage() {}\n\nfunc (x *UpdateResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.\nfunc (*UpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{4}\n}\n\nfunc (x *UpdateResponse) GetInfo() *Info {\n\tif x != nil {\n\t\treturn x.Info\n\t}\n\treturn nil\n}\n\ntype ListContentRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Filters contains one or more filters using the syntax defined in the\n\t// containerd filter package.\n\t//\n\t// The returned result will be those that match any of the provided\n\t// filters. Expanded, containers that match the following will be\n\t// returned:\n\t//\n\t//\tfilters[0] or filters[1] or ... or filters[n-1] or filters[n]\n\t//\n\t// If filters is zero-length or nil, all items will be returned.\n\tFilters []string `protobuf:\"bytes,1,rep,name=filters,proto3\" json:\"filters,omitempty\"`\n}\n\nfunc (x *ListContentRequest) Reset() {\n\t*x = ListContentRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ListContentRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListContentRequest) ProtoMessage() {}\n\nfunc (x *ListContentRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ListContentRequest.ProtoReflect.Descriptor instead.\nfunc (*ListContentRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{5}\n}\n\nfunc (x *ListContentRequest) GetFilters() []string {\n\tif x != nil {\n\t\treturn x.Filters\n\t}\n\treturn nil\n}\n\ntype ListContentResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tInfo []*Info `protobuf:\"bytes,1,rep,name=info,proto3\" json:\"info,omitempty\"`\n}\n\nfunc (x *ListContentResponse) Reset() {\n\t*x = ListContentResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ListContentResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListContentResponse) ProtoMessage() {}\n\nfunc (x *ListContentResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ListContentResponse.ProtoReflect.Descriptor instead.\nfunc (*ListContentResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{6}\n}\n\nfunc (x *ListContentResponse) GetInfo() []*Info {\n\tif x != nil {\n\t\treturn x.Info\n\t}\n\treturn nil\n}\n\ntype DeleteContentRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Digest specifies which content to delete.\n\tDigest string `protobuf:\"bytes,1,opt,name=digest,proto3\" json:\"digest,omitempty\"`\n}\n\nfunc (x *DeleteContentRequest) Reset() {\n\t*x = DeleteContentRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DeleteContentRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteContentRequest) ProtoMessage() {}\n\nfunc (x *DeleteContentRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DeleteContentRequest.ProtoReflect.Descriptor instead.\nfunc (*DeleteContentRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{7}\n}\n\nfunc (x *DeleteContentRequest) GetDigest() string {\n\tif x != nil {\n\t\treturn x.Digest\n\t}\n\treturn \"\"\n}\n\n// ReadContentRequest defines the fields that make up a request to read a portion of\n// data from a stored object.\ntype ReadContentRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Digest is the hash identity to read.\n\tDigest string `protobuf:\"bytes,1,opt,name=digest,proto3\" json:\"digest,omitempty\"`\n\t// Offset specifies the number of bytes from the start at which to begin\n\t// the read. If zero or less, the read will be from the start. This uses\n\t// standard zero-indexed semantics.\n\tOffset int64 `protobuf:\"varint,2,opt,name=offset,proto3\" json:\"offset,omitempty\"`\n\t// size is the total size of the read. If zero, the entire blob will be\n\t// returned by the service.\n\tSize int64 `protobuf:\"varint,3,opt,name=size,proto3\" json:\"size,omitempty\"`\n}\n\nfunc (x *ReadContentRequest) Reset() {\n\t*x = ReadContentRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ReadContentRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ReadContentRequest) ProtoMessage() {}\n\nfunc (x *ReadContentRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ReadContentRequest.ProtoReflect.Descriptor instead.\nfunc (*ReadContentRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{8}\n}\n\nfunc (x *ReadContentRequest) GetDigest() string {\n\tif x != nil {\n\t\treturn x.Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *ReadContentRequest) GetOffset() int64 {\n\tif x != nil {\n\t\treturn x.Offset\n\t}\n\treturn 0\n}\n\nfunc (x *ReadContentRequest) GetSize() int64 {\n\tif x != nil {\n\t\treturn x.Size\n\t}\n\treturn 0\n}\n\n// ReadContentResponse carries byte data for a read request.\ntype ReadContentResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tOffset int64  `protobuf:\"varint,1,opt,name=offset,proto3\" json:\"offset,omitempty\"` // offset of the returned data\n\tData   []byte `protobuf:\"bytes,2,opt,name=data,proto3\" json:\"data,omitempty\"`      // actual data\n}\n\nfunc (x *ReadContentResponse) Reset() {\n\t*x = ReadContentResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ReadContentResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ReadContentResponse) ProtoMessage() {}\n\nfunc (x *ReadContentResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ReadContentResponse.ProtoReflect.Descriptor instead.\nfunc (*ReadContentResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{9}\n}\n\nfunc (x *ReadContentResponse) GetOffset() int64 {\n\tif x != nil {\n\t\treturn x.Offset\n\t}\n\treturn 0\n}\n\nfunc (x *ReadContentResponse) GetData() []byte {\n\tif x != nil {\n\t\treturn x.Data\n\t}\n\treturn nil\n}\n\ntype Status struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tStartedAt *timestamppb.Timestamp `protobuf:\"bytes,1,opt,name=started_at,json=startedAt,proto3\" json:\"started_at,omitempty\"`\n\tUpdatedAt *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=updated_at,json=updatedAt,proto3\" json:\"updated_at,omitempty\"`\n\tRef       string                 `protobuf:\"bytes,3,opt,name=ref,proto3\" json:\"ref,omitempty\"`\n\tOffset    int64                  `protobuf:\"varint,4,opt,name=offset,proto3\" json:\"offset,omitempty\"`\n\tTotal     int64                  `protobuf:\"varint,5,opt,name=total,proto3\" json:\"total,omitempty\"`\n\tExpected  string                 `protobuf:\"bytes,6,opt,name=expected,proto3\" json:\"expected,omitempty\"`\n}\n\nfunc (x *Status) Reset() {\n\t*x = Status{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Status) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Status) ProtoMessage() {}\n\nfunc (x *Status) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Status.ProtoReflect.Descriptor instead.\nfunc (*Status) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{10}\n}\n\nfunc (x *Status) GetStartedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.StartedAt\n\t}\n\treturn nil\n}\n\nfunc (x *Status) GetUpdatedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.UpdatedAt\n\t}\n\treturn nil\n}\n\nfunc (x *Status) GetRef() string {\n\tif x != nil {\n\t\treturn x.Ref\n\t}\n\treturn \"\"\n}\n\nfunc (x *Status) GetOffset() int64 {\n\tif x != nil {\n\t\treturn x.Offset\n\t}\n\treturn 0\n}\n\nfunc (x *Status) GetTotal() int64 {\n\tif x != nil {\n\t\treturn x.Total\n\t}\n\treturn 0\n}\n\nfunc (x *Status) GetExpected() string {\n\tif x != nil {\n\t\treturn x.Expected\n\t}\n\treturn \"\"\n}\n\ntype StatusRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRef string `protobuf:\"bytes,1,opt,name=ref,proto3\" json:\"ref,omitempty\"`\n}\n\nfunc (x *StatusRequest) Reset() {\n\t*x = StatusRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *StatusRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StatusRequest) ProtoMessage() {}\n\nfunc (x *StatusRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.\nfunc (*StatusRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{11}\n}\n\nfunc (x *StatusRequest) GetRef() string {\n\tif x != nil {\n\t\treturn x.Ref\n\t}\n\treturn \"\"\n}\n\ntype StatusResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tStatus *Status `protobuf:\"bytes,1,opt,name=status,proto3\" json:\"status,omitempty\"`\n}\n\nfunc (x *StatusResponse) Reset() {\n\t*x = StatusResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *StatusResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StatusResponse) ProtoMessage() {}\n\nfunc (x *StatusResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.\nfunc (*StatusResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{12}\n}\n\nfunc (x *StatusResponse) GetStatus() *Status {\n\tif x != nil {\n\t\treturn x.Status\n\t}\n\treturn nil\n}\n\ntype ListStatusesRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tFilters []string `protobuf:\"bytes,1,rep,name=filters,proto3\" json:\"filters,omitempty\"`\n}\n\nfunc (x *ListStatusesRequest) Reset() {\n\t*x = ListStatusesRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ListStatusesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStatusesRequest) ProtoMessage() {}\n\nfunc (x *ListStatusesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ListStatusesRequest.ProtoReflect.Descriptor instead.\nfunc (*ListStatusesRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{13}\n}\n\nfunc (x *ListStatusesRequest) GetFilters() []string {\n\tif x != nil {\n\t\treturn x.Filters\n\t}\n\treturn nil\n}\n\ntype ListStatusesResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tStatuses []*Status `protobuf:\"bytes,1,rep,name=statuses,proto3\" json:\"statuses,omitempty\"`\n}\n\nfunc (x *ListStatusesResponse) Reset() {\n\t*x = ListStatusesResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ListStatusesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStatusesResponse) ProtoMessage() {}\n\nfunc (x *ListStatusesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ListStatusesResponse.ProtoReflect.Descriptor instead.\nfunc (*ListStatusesResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{14}\n}\n\nfunc (x *ListStatusesResponse) GetStatuses() []*Status {\n\tif x != nil {\n\t\treturn x.Statuses\n\t}\n\treturn nil\n}\n\n// WriteContentRequest writes data to the request ref at offset.\ntype WriteContentRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Action sets the behavior of the write.\n\t//\n\t// When this is a write and the ref is not yet allocated, the ref will be\n\t// allocated and the data will be written at offset.\n\t//\n\t// If the action is write and the ref is allocated, it will accept data to\n\t// an offset that has not yet been written.\n\t//\n\t// If the action is write and there is no data, the current write status\n\t// will be returned. This works differently from status because the stream\n\t// holds a lock.\n\tAction WriteAction `protobuf:\"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction\" json:\"action,omitempty\"`\n\t// Ref identifies the pre-commit object to write to.\n\tRef string `protobuf:\"bytes,2,opt,name=ref,proto3\" json:\"ref,omitempty\"`\n\t// Total can be set to have the service validate the total size of the\n\t// committed content.\n\t//\n\t// The latest value before or with the commit action message will be use to\n\t// validate the content. If the offset overflows total, the service may\n\t// report an error. It is only required on one message for the write.\n\t//\n\t// If the value is zero or less, no validation of the final content will be\n\t// performed.\n\tTotal int64 `protobuf:\"varint,3,opt,name=total,proto3\" json:\"total,omitempty\"`\n\t// Expected can be set to have the service validate the final content against\n\t// the provided digest.\n\t//\n\t// If the digest is already present in the object store, an AlreadyExists\n\t// error will be returned.\n\t//\n\t// Only the latest version will be used to check the content against the\n\t// digest. It is only required to include it on a single message, before or\n\t// with the commit action message.\n\tExpected string `protobuf:\"bytes,4,opt,name=expected,proto3\" json:\"expected,omitempty\"`\n\t// Offset specifies the number of bytes from the start at which to begin\n\t// the write. For most implementations, this means from the start of the\n\t// file. This uses standard, zero-indexed semantics.\n\t//\n\t// If the action is write, the remote may remove all previously written\n\t// data after the offset. Implementations may support arbitrary offsets but\n\t// MUST support reseting this value to zero with a write. If an\n\t// implementation does not support a write at a particular offset, an\n\t// OutOfRange error must be returned.\n\tOffset int64 `protobuf:\"varint,5,opt,name=offset,proto3\" json:\"offset,omitempty\"`\n\t// Data is the actual bytes to be written.\n\t//\n\t// If this is empty and the message is not a commit, a response will be\n\t// returned with the current write state.\n\tData []byte `protobuf:\"bytes,6,opt,name=data,proto3\" json:\"data,omitempty\"`\n\t// Labels are arbitrary data on snapshots.\n\t//\n\t// The combined size of a key/value pair cannot exceed 4096 bytes.\n\tLabels map[string]string `protobuf:\"bytes,7,rep,name=labels,proto3\" json:\"labels,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n}\n\nfunc (x *WriteContentRequest) Reset() {\n\t*x = WriteContentRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *WriteContentRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*WriteContentRequest) ProtoMessage() {}\n\nfunc (x *WriteContentRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use WriteContentRequest.ProtoReflect.Descriptor instead.\nfunc (*WriteContentRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{15}\n}\n\nfunc (x *WriteContentRequest) GetAction() WriteAction {\n\tif x != nil {\n\t\treturn x.Action\n\t}\n\treturn WriteAction_STAT\n}\n\nfunc (x *WriteContentRequest) GetRef() string {\n\tif x != nil {\n\t\treturn x.Ref\n\t}\n\treturn \"\"\n}\n\nfunc (x *WriteContentRequest) GetTotal() int64 {\n\tif x != nil {\n\t\treturn x.Total\n\t}\n\treturn 0\n}\n\nfunc (x *WriteContentRequest) GetExpected() string {\n\tif x != nil {\n\t\treturn x.Expected\n\t}\n\treturn \"\"\n}\n\nfunc (x *WriteContentRequest) GetOffset() int64 {\n\tif x != nil {\n\t\treturn x.Offset\n\t}\n\treturn 0\n}\n\nfunc (x *WriteContentRequest) GetData() []byte {\n\tif x != nil {\n\t\treturn x.Data\n\t}\n\treturn nil\n}\n\nfunc (x *WriteContentRequest) GetLabels() map[string]string {\n\tif x != nil {\n\t\treturn x.Labels\n\t}\n\treturn nil\n}\n\n// WriteContentResponse is returned on the culmination of a write call.\ntype WriteContentResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// Action contains the action for the final message of the stream. A writer\n\t// should confirm that they match the intended result.\n\tAction WriteAction `protobuf:\"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction\" json:\"action,omitempty\"`\n\t// StartedAt provides the time at which the write began.\n\t//\n\t// This must be set for stat and commit write actions. All other write\n\t// actions may omit this.\n\tStartedAt *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=started_at,json=startedAt,proto3\" json:\"started_at,omitempty\"`\n\t// UpdatedAt provides the last time of a successful write.\n\t//\n\t// This must be set for stat and commit write actions. All other write\n\t// actions may omit this.\n\tUpdatedAt *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=updated_at,json=updatedAt,proto3\" json:\"updated_at,omitempty\"`\n\t// Offset is the current committed size for the write.\n\tOffset int64 `protobuf:\"varint,4,opt,name=offset,proto3\" json:\"offset,omitempty\"`\n\t// Total provides the current, expected total size of the write.\n\t//\n\t// We include this to provide consistency with the Status structure on the\n\t// client writer.\n\t//\n\t// This is only valid on the Stat and Commit response.\n\tTotal int64 `protobuf:\"varint,5,opt,name=total,proto3\" json:\"total,omitempty\"`\n\t// Digest, if present, includes the digest up to the currently committed\n\t// bytes. If action is commit, this field will be set. It is implementation\n\t// defined if this is set for other actions.\n\tDigest string `protobuf:\"bytes,6,opt,name=digest,proto3\" json:\"digest,omitempty\"`\n}\n\nfunc (x *WriteContentResponse) Reset() {\n\t*x = WriteContentResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *WriteContentResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*WriteContentResponse) ProtoMessage() {}\n\nfunc (x *WriteContentResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use WriteContentResponse.ProtoReflect.Descriptor instead.\nfunc (*WriteContentResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{16}\n}\n\nfunc (x *WriteContentResponse) GetAction() WriteAction {\n\tif x != nil {\n\t\treturn x.Action\n\t}\n\treturn WriteAction_STAT\n}\n\nfunc (x *WriteContentResponse) GetStartedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.StartedAt\n\t}\n\treturn nil\n}\n\nfunc (x *WriteContentResponse) GetUpdatedAt() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.UpdatedAt\n\t}\n\treturn nil\n}\n\nfunc (x *WriteContentResponse) GetOffset() int64 {\n\tif x != nil {\n\t\treturn x.Offset\n\t}\n\treturn 0\n}\n\nfunc (x *WriteContentResponse) GetTotal() int64 {\n\tif x != nil {\n\t\treturn x.Total\n\t}\n\treturn 0\n}\n\nfunc (x *WriteContentResponse) GetDigest() string {\n\tif x != nil {\n\t\treturn x.Digest\n\t}\n\treturn \"\"\n}\n\ntype AbortRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRef string `protobuf:\"bytes,1,opt,name=ref,proto3\" json:\"ref,omitempty\"`\n}\n\nfunc (x *AbortRequest) Reset() {\n\t*x = AbortRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *AbortRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AbortRequest) ProtoMessage() {}\n\nfunc (x *AbortRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use AbortRequest.ProtoReflect.Descriptor instead.\nfunc (*AbortRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{17}\n}\n\nfunc (x *AbortRequest) GetRef() string {\n\tif x != nil {\n\t\treturn x.Ref\n\t}\n\treturn \"\"\n}\n\nvar File_github_com_containerd_containerd_api_services_content_v1_content_proto protoreflect.FileDescriptor\n\nvar file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc = []byte{\n\t0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,\n\t0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,\n\t0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f,\n\t0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65,\n\t0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,\n\t0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,\n\t0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65,\n\t0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70,\n\t0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x02, 0x0a, 0x04, 0x49, 0x6e, 0x66,\n\t0x6f, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,\n\t0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x39, 0x0a,\n\t0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,\n\t0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63,\n\t0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61,\n\t0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,\n\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,\n\t0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,\n\t0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,\n\t0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,\n\t0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a,\n\t0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,\n\t0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,\n\t0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f,\n\t0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73,\n\t0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22,\n\t0x48, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,\n\t0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,\n\t0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,\n\t0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49,\n\t0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x0d, 0x55, 0x70,\n\t0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x69,\n\t0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74,\n\t0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,\n\t0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52,\n\t0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,\n\t0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65,\n\t0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61,\n\t0x73, 0x6b, 0x22, 0x4a, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,\n\t0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e,\n\t0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,\n\t0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x2e,\n\t0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,\n\t0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18,\n\t0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4f,\n\t0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,\n\t0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,\n\t0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22,\n\t0x2e, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,\n\t0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73,\n\t0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22,\n\t0x58, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,\n\t0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f,\n\t0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20,\n\t0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x41, 0x0a, 0x13, 0x52, 0x65, 0x61,\n\t0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,\n\t0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,\n\t0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,\n\t0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xda, 0x01, 0x0a,\n\t0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74,\n\t0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,\n\t0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64,\n\t0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74,\n\t0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,\n\t0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a,\n\t0x03, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12,\n\t0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,\n\t0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c,\n\t0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1a, 0x0a,\n\t0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,\n\t0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0x21, 0x0a, 0x0d, 0x53, 0x74, 0x61,\n\t0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65,\n\t0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x50, 0x0a, 0x0e,\n\t0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e,\n\t0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26,\n\t0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76,\n\t0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e,\n\t0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x2f,\n\t0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,\n\t0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22,\n\t0x5a, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52,\n\t0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75,\n\t0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74,\n\t0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,\n\t0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,\n\t0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x22, 0xde, 0x02, 0x0a, 0x13,\n\t0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,\n\t0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20,\n\t0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,\n\t0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,\n\t0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18,\n\t0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,\n\t0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c,\n\t0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01,\n\t0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06,\n\t0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66,\n\t0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01,\n\t0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x57, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65,\n\t0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,\n\t0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43,\n\t0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61,\n\t0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c,\n\t0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,\n\t0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,\n\t0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x97, 0x02, 0x0a,\n\t0x14, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,\n\t0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,\n\t0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74,\n\t0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69,\n\t0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74,\n\t0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,\n\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72,\n\t0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64,\n\t0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,\n\t0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,\n\t0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,\n\t0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,\n\t0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61,\n\t0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x16,\n\t0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,\n\t0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x20, 0x0a, 0x0c, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52,\n\t0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20,\n\t0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x2a, 0x2e, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74,\n\t0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x41, 0x54, 0x10,\n\t0x00, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06,\n\t0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x32, 0xbe, 0x07, 0x0a, 0x07, 0x43, 0x6f, 0x6e,\n\t0x74, 0x65, 0x6e, 0x74, 0x12, 0x61, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,\n\t0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e,\n\t0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74,\n\t0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,\n\t0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52,\n\t0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74,\n\t0x65, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73,\n\t0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e,\n\t0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65,\n\t0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76,\n\t0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,\n\t0x12, 0x71, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,\n\t0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,\n\t0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,\n\t0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,\n\t0x65, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x34, 0x2e,\n\t0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,\n\t0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44,\n\t0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,\n\t0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x71, 0x0a, 0x04, 0x52,\n\t0x65, 0x61, 0x64, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,\n\t0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,\n\t0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e,\n\t0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x67,\n\t0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,\n\t0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,\n\t0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,\n\t0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53,\n\t0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f,\n\t0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61,\n\t0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63,\n\t0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,\n\t0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,\n\t0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,\n\t0x73, 0x65, 0x12, 0x76, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x33, 0x2e, 0x63, 0x6f,\n\t0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,\n\t0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69,\n\t0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65,\n\t0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76,\n\t0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65,\n\t0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x05, 0x41, 0x62,\n\t0x6f, 0x72, 0x74, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,\n\t0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,\n\t0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74,\n\t0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,\n\t0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70,\n\t0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65,\n\t0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescOnce sync.Once\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData = file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc\n)\n\nfunc file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP() []byte {\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescOnce.Do(func() {\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData)\n\t})\n\treturn file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData\n}\n\nvar file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes = make([]protoimpl.MessageInfo, 20)\nvar file_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes = []interface{}{\n\t(WriteAction)(0),              // 0: containerd.services.content.v1.WriteAction\n\t(*Info)(nil),                  // 1: containerd.services.content.v1.Info\n\t(*InfoRequest)(nil),           // 2: containerd.services.content.v1.InfoRequest\n\t(*InfoResponse)(nil),          // 3: containerd.services.content.v1.InfoResponse\n\t(*UpdateRequest)(nil),         // 4: containerd.services.content.v1.UpdateRequest\n\t(*UpdateResponse)(nil),        // 5: containerd.services.content.v1.UpdateResponse\n\t(*ListContentRequest)(nil),    // 6: containerd.services.content.v1.ListContentRequest\n\t(*ListContentResponse)(nil),   // 7: containerd.services.content.v1.ListContentResponse\n\t(*DeleteContentRequest)(nil),  // 8: containerd.services.content.v1.DeleteContentRequest\n\t(*ReadContentRequest)(nil),    // 9: containerd.services.content.v1.ReadContentRequest\n\t(*ReadContentResponse)(nil),   // 10: containerd.services.content.v1.ReadContentResponse\n\t(*Status)(nil),                // 11: containerd.services.content.v1.Status\n\t(*StatusRequest)(nil),         // 12: containerd.services.content.v1.StatusRequest\n\t(*StatusResponse)(nil),        // 13: containerd.services.content.v1.StatusResponse\n\t(*ListStatusesRequest)(nil),   // 14: containerd.services.content.v1.ListStatusesRequest\n\t(*ListStatusesResponse)(nil),  // 15: containerd.services.content.v1.ListStatusesResponse\n\t(*WriteContentRequest)(nil),   // 16: containerd.services.content.v1.WriteContentRequest\n\t(*WriteContentResponse)(nil),  // 17: containerd.services.content.v1.WriteContentResponse\n\t(*AbortRequest)(nil),          // 18: containerd.services.content.v1.AbortRequest\n\tnil,                           // 19: containerd.services.content.v1.Info.LabelsEntry\n\tnil,                           // 20: containerd.services.content.v1.WriteContentRequest.LabelsEntry\n\t(*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp\n\t(*fieldmaskpb.FieldMask)(nil), // 22: google.protobuf.FieldMask\n\t(*emptypb.Empty)(nil),         // 23: google.protobuf.Empty\n}\nvar file_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs = []int32{\n\t21, // 0: containerd.services.content.v1.Info.created_at:type_name -> google.protobuf.Timestamp\n\t21, // 1: containerd.services.content.v1.Info.updated_at:type_name -> google.protobuf.Timestamp\n\t19, // 2: containerd.services.content.v1.Info.labels:type_name -> containerd.services.content.v1.Info.LabelsEntry\n\t1,  // 3: containerd.services.content.v1.InfoResponse.info:type_name -> containerd.services.content.v1.Info\n\t1,  // 4: containerd.services.content.v1.UpdateRequest.info:type_name -> containerd.services.content.v1.Info\n\t22, // 5: containerd.services.content.v1.UpdateRequest.update_mask:type_name -> google.protobuf.FieldMask\n\t1,  // 6: containerd.services.content.v1.UpdateResponse.info:type_name -> containerd.services.content.v1.Info\n\t1,  // 7: containerd.services.content.v1.ListContentResponse.info:type_name -> containerd.services.content.v1.Info\n\t21, // 8: containerd.services.content.v1.Status.started_at:type_name -> google.protobuf.Timestamp\n\t21, // 9: containerd.services.content.v1.Status.updated_at:type_name -> google.protobuf.Timestamp\n\t11, // 10: containerd.services.content.v1.StatusResponse.status:type_name -> containerd.services.content.v1.Status\n\t11, // 11: containerd.services.content.v1.ListStatusesResponse.statuses:type_name -> containerd.services.content.v1.Status\n\t0,  // 12: containerd.services.content.v1.WriteContentRequest.action:type_name -> containerd.services.content.v1.WriteAction\n\t20, // 13: containerd.services.content.v1.WriteContentRequest.labels:type_name -> containerd.services.content.v1.WriteContentRequest.LabelsEntry\n\t0,  // 14: containerd.services.content.v1.WriteContentResponse.action:type_name -> containerd.services.content.v1.WriteAction\n\t21, // 15: containerd.services.content.v1.WriteContentResponse.started_at:type_name -> google.protobuf.Timestamp\n\t21, // 16: containerd.services.content.v1.WriteContentResponse.updated_at:type_name -> google.protobuf.Timestamp\n\t2,  // 17: containerd.services.content.v1.Content.Info:input_type -> containerd.services.content.v1.InfoRequest\n\t4,  // 18: containerd.services.content.v1.Content.Update:input_type -> containerd.services.content.v1.UpdateRequest\n\t6,  // 19: containerd.services.content.v1.Content.List:input_type -> containerd.services.content.v1.ListContentRequest\n\t8,  // 20: containerd.services.content.v1.Content.Delete:input_type -> containerd.services.content.v1.DeleteContentRequest\n\t9,  // 21: containerd.services.content.v1.Content.Read:input_type -> containerd.services.content.v1.ReadContentRequest\n\t12, // 22: containerd.services.content.v1.Content.Status:input_type -> containerd.services.content.v1.StatusRequest\n\t14, // 23: containerd.services.content.v1.Content.ListStatuses:input_type -> containerd.services.content.v1.ListStatusesRequest\n\t16, // 24: containerd.services.content.v1.Content.Write:input_type -> containerd.services.content.v1.WriteContentRequest\n\t18, // 25: containerd.services.content.v1.Content.Abort:input_type -> containerd.services.content.v1.AbortRequest\n\t3,  // 26: containerd.services.content.v1.Content.Info:output_type -> containerd.services.content.v1.InfoResponse\n\t5,  // 27: containerd.services.content.v1.Content.Update:output_type -> containerd.services.content.v1.UpdateResponse\n\t7,  // 28: containerd.services.content.v1.Content.List:output_type -> containerd.services.content.v1.ListContentResponse\n\t23, // 29: containerd.services.content.v1.Content.Delete:output_type -> google.protobuf.Empty\n\t10, // 30: containerd.services.content.v1.Content.Read:output_type -> containerd.services.content.v1.ReadContentResponse\n\t13, // 31: containerd.services.content.v1.Content.Status:output_type -> containerd.services.content.v1.StatusResponse\n\t15, // 32: containerd.services.content.v1.Content.ListStatuses:output_type -> containerd.services.content.v1.ListStatusesResponse\n\t17, // 33: containerd.services.content.v1.Content.Write:output_type -> containerd.services.content.v1.WriteContentResponse\n\t23, // 34: containerd.services.content.v1.Content.Abort:output_type -> google.protobuf.Empty\n\t26, // [26:35] is the sub-list for method output_type\n\t17, // [17:26] is the sub-list for method input_type\n\t17, // [17:17] is the sub-list for extension type_name\n\t17, // [17:17] is the sub-list for extension extendee\n\t0,  // [0:17] is the sub-list for field type_name\n}\n\nfunc init() { file_github_com_containerd_containerd_api_services_content_v1_content_proto_init() }\nfunc file_github_com_containerd_containerd_api_services_content_v1_content_proto_init() {\n\tif File_github_com_containerd_containerd_api_services_content_v1_content_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Info); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*InfoRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*InfoResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*UpdateRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*UpdateResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ListContentRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ListContentResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DeleteContentRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ReadContentRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ReadContentResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Status); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*StatusRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*StatusResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ListStatusesRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ListStatusesResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*WriteContentRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*WriteContentResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*AbortRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   20,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes,\n\t\tDependencyIndexes: file_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs,\n\t\tEnumInfos:         file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes,\n\t\tMessageInfos:      file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes,\n\t}.Build()\n\tFile_github_com_containerd_containerd_api_services_content_v1_content_proto = out.File\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc = nil\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes = nil\n\tfile_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/services/content/v1/content.proto",
    "content": "/*\n\tCopyright The containerd Authors.\n\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\n\t\thttp://www.apache.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nsyntax = \"proto3\";\n\npackage containerd.services.content.v1;\n\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/empty.proto\";\n\noption go_package = \"github.com/containerd/containerd/api/services/content/v1;content\";\n\n// Content provides access to a content addressable storage system.\nservice Content {\n\t// Info returns information about a committed object.\n\t//\n\t// This call can be used for getting the size of content and checking for\n\t// existence.\n\trpc Info(InfoRequest) returns (InfoResponse);\n\n\t// Update updates content metadata.\n\t//\n\t// This call can be used to manage the mutable content labels. The\n\t// immutable metadata such as digest, size, and committed at cannot\n\t// be updated.\n\trpc Update(UpdateRequest) returns (UpdateResponse);\n\n\t// List streams the entire set of content as Info objects and closes the\n\t// stream.\n\t//\n\t// Typically, this will yield a large response, chunked into messages.\n\t// Clients should make provisions to ensure they can handle the entire data\n\t// set.\n\trpc List(ListContentRequest) returns (stream ListContentResponse);\n\n\t// Delete will delete the referenced object.\n\trpc Delete(DeleteContentRequest) returns (google.protobuf.Empty);\n\n\t// Read allows one to read an object based on the offset into the content.\n\t//\n\t// The requested data may be returned in one or more messages.\n\trpc Read(ReadContentRequest) returns (stream ReadContentResponse);\n\n\t// Status returns the status for a single reference.\n\trpc Status(StatusRequest) returns (StatusResponse);\n\n\t// ListStatuses returns the status of ongoing object ingestions, started via\n\t// Write.\n\t//\n\t// Only those matching the regular expression will be provided in the\n\t// response. If the provided regular expression is empty, all ingestions\n\t// will be provided.\n\trpc ListStatuses(ListStatusesRequest) returns (ListStatusesResponse);\n\n\t// Write begins or resumes writes to a resource identified by a unique ref.\n\t// Only one active stream may exist at a time for each ref.\n\t//\n\t// Once a write stream has started, it may only write to a single ref, thus\n\t// once a stream is started, the ref may be omitted on subsequent writes.\n\t//\n\t// For any write transaction represented by a ref, only a single write may\n\t// be made to a given offset. If overlapping writes occur, it is an error.\n\t// Writes should be sequential and implementations may throw an error if\n\t// this is required.\n\t//\n\t// If expected_digest is set and already part of the content store, the\n\t// write will fail.\n\t//\n\t// When completed, the commit flag should be set to true. If expected size\n\t// or digest is set, the content will be validated against those values.\n\trpc Write(stream WriteContentRequest) returns (stream WriteContentResponse);\n\n\t// Abort cancels the ongoing write named in the request. Any resources\n\t// associated with the write will be collected.\n\trpc Abort(AbortRequest) returns (google.protobuf.Empty);\n}\n\nmessage Info {\n\t// Digest is the hash identity of the blob.\n\tstring digest = 1;\n\n\t// Size is the total number of bytes in the blob.\n\tint64 size = 2;\n\n\t// CreatedAt provides the time at which the blob was committed.\n\tgoogle.protobuf.Timestamp created_at = 3;\n\n\t// UpdatedAt provides the time the info was last updated.\n\tgoogle.protobuf.Timestamp updated_at = 4;\n\n\t// Labels are arbitrary data on snapshots.\n\t//\n\t// The combined size of a key/value pair cannot exceed 4096 bytes.\n\tmap<string, string> labels  = 5;\n}\n\nmessage InfoRequest {\n\tstring digest = 1;\n}\n\nmessage InfoResponse {\n\tInfo info = 1;\n}\n\nmessage UpdateRequest {\n\tInfo info = 1;\n\n\t// UpdateMask specifies which fields to perform the update on. If empty,\n\t// the operation applies to all fields.\n\t//\n\t// In info, Digest, Size, and CreatedAt are immutable,\n\t// other field may be updated using this mask.\n\t// If no mask is provided, all mutable field are updated.\n\tgoogle.protobuf.FieldMask update_mask = 2;\n}\n\nmessage UpdateResponse {\n\tInfo info = 1;\n}\n\nmessage ListContentRequest {\n\t// Filters contains one or more filters using the syntax defined in the\n\t// containerd filter package.\n\t//\n\t// The returned result will be those that match any of the provided\n\t// filters. Expanded, containers that match the following will be\n\t// returned:\n\t//\n\t//\tfilters[0] or filters[1] or ... or filters[n-1] or filters[n]\n\t//\n\t// If filters is zero-length or nil, all items will be returned.\n\trepeated string filters = 1;\n}\n\nmessage ListContentResponse {\n\trepeated Info info = 1;\n}\n\nmessage DeleteContentRequest {\n\t// Digest specifies which content to delete.\n\tstring digest = 1;\n}\n\n// ReadContentRequest defines the fields that make up a request to read a portion of\n// data from a stored object.\nmessage ReadContentRequest {\n\t// Digest is the hash identity to read.\n\tstring digest = 1;\n\n\t// Offset specifies the number of bytes from the start at which to begin\n\t// the read. If zero or less, the read will be from the start. This uses\n\t// standard zero-indexed semantics.\n\tint64 offset = 2;\n\n\t// size is the total size of the read. If zero, the entire blob will be\n\t// returned by the service.\n\tint64 size = 3;\n}\n\n// ReadContentResponse carries byte data for a read request.\nmessage ReadContentResponse {\n\tint64 offset = 1; // offset of the returned data\n\tbytes data = 2; // actual data\n}\n\nmessage Status {\n\tgoogle.protobuf.Timestamp started_at = 1;\n\tgoogle.protobuf.Timestamp updated_at = 2;\n\tstring ref = 3;\n\tint64 offset = 4;\n\tint64 total = 5;\n\tstring expected = 6;\n}\n\n\nmessage StatusRequest {\n\tstring ref = 1;\n}\n\nmessage StatusResponse {\n\tStatus status = 1;\n}\n\nmessage ListStatusesRequest {\n\trepeated string filters = 1;\n}\n\nmessage ListStatusesResponse {\n\trepeated Status statuses = 1;\n}\n\n// WriteAction defines the behavior of a WriteRequest.\nenum WriteAction {\n\t// WriteActionStat instructs the writer to return the current status while\n\t// holding the lock on the write.\n\tSTAT = 0;\n\n\t// WriteActionWrite sets the action for the write request to write data.\n\t//\n\t// Any data included will be written at the provided offset. The\n\t// transaction will be left open for further writes.\n\t//\n\t// This is the default.\n\tWRITE = 1;\n\n\t// WriteActionCommit will write any outstanding data in the message and\n\t// commit the write, storing it under the digest.\n\t//\n\t// This can be used in a single message to send the data, verify it and\n\t// commit it.\n\t//\n\t// This action will always terminate the write.\n\tCOMMIT = 2;\n}\n\n// WriteContentRequest writes data to the request ref at offset.\nmessage WriteContentRequest {\n\t// Action sets the behavior of the write.\n\t//\n\t// When this is a write and the ref is not yet allocated, the ref will be\n\t// allocated and the data will be written at offset.\n\t//\n\t// If the action is write and the ref is allocated, it will accept data to\n\t// an offset that has not yet been written.\n\t//\n\t// If the action is write and there is no data, the current write status\n\t// will be returned. This works differently from status because the stream\n\t// holds a lock.\n\tWriteAction action = 1;\n\n\t// Ref identifies the pre-commit object to write to.\n\tstring ref = 2;\n\n\t// Total can be set to have the service validate the total size of the\n\t// committed content.\n\t//\n\t// The latest value before or with the commit action message will be use to\n\t// validate the content. If the offset overflows total, the service may\n\t// report an error. It is only required on one message for the write.\n\t//\n\t// If the value is zero or less, no validation of the final content will be\n\t// performed.\n\tint64 total = 3;\n\n\t// Expected can be set to have the service validate the final content against\n\t// the provided digest.\n\t//\n\t// If the digest is already present in the object store, an AlreadyExists\n\t// error will be returned.\n\t//\n\t// Only the latest version will be used to check the content against the\n\t// digest. It is only required to include it on a single message, before or\n\t// with the commit action message.\n\tstring expected = 4;\n\n\t// Offset specifies the number of bytes from the start at which to begin\n\t// the write. For most implementations, this means from the start of the\n\t// file. This uses standard, zero-indexed semantics.\n\t//\n\t// If the action is write, the remote may remove all previously written\n\t// data after the offset. Implementations may support arbitrary offsets but\n\t// MUST support reseting this value to zero with a write. If an\n\t// implementation does not support a write at a particular offset, an\n\t// OutOfRange error must be returned.\n\tint64 offset = 5;\n\n\t// Data is the actual bytes to be written.\n\t//\n\t// If this is empty and the message is not a commit, a response will be\n\t// returned with the current write state.\n\tbytes data = 6;\n\n\t// Labels are arbitrary data on snapshots.\n\t//\n\t// The combined size of a key/value pair cannot exceed 4096 bytes.\n\tmap<string, string> labels  = 7;\n}\n\n// WriteContentResponse is returned on the culmination of a write call.\nmessage WriteContentResponse {\n\t// Action contains the action for the final message of the stream. A writer\n\t// should confirm that they match the intended result.\n\tWriteAction action = 1;\n\n\t// StartedAt provides the time at which the write began.\n\t//\n\t// This must be set for stat and commit write actions. All other write\n\t// actions may omit this.\n\tgoogle.protobuf.Timestamp started_at = 2;\n\n\t// UpdatedAt provides the last time of a successful write.\n\t//\n\t// This must be set for stat and commit write actions. All other write\n\t// actions may omit this.\n\tgoogle.protobuf.Timestamp updated_at = 3;\n\n\t// Offset is the current committed size for the write.\n\tint64 offset = 4;\n\n\t// Total provides the current, expected total size of the write.\n\t//\n\t// We include this to provide consistency with the Status structure on the\n\t// client writer.\n\t//\n\t// This is only valid on the Stat and Commit response.\n\tint64 total = 5;\n\n\t// Digest, if present, includes the digest up to the currently committed\n\t// bytes. If action is commit, this field will be set. It is implementation\n\t// defined if this is set for other actions.\n\tstring digest = 6;\n}\n\nmessage AbortRequest {\n\tstring ref = 1;\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go",
    "content": "//go:build !no_grpc\n\n// Code generated by protoc-gen-go-grpc. DO NOT EDIT.\n// versions:\n// - protoc-gen-go-grpc v1.2.0\n// - protoc             v3.20.1\n// source: github.com/containerd/containerd/api/services/content/v1/content.proto\n\npackage content\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatus \"google.golang.org/grpc/status\"\n\temptypb \"google.golang.org/protobuf/types/known/emptypb\"\n)\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the grpc package it is being compiled against.\n// Requires gRPC-Go v1.32.0 or later.\nconst _ = grpc.SupportPackageIsVersion7\n\n// ContentClient is the client API for Content service.\n//\n// 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.\ntype ContentClient interface {\n\t// Info returns information about a committed object.\n\t//\n\t// This call can be used for getting the size of content and checking for\n\t// existence.\n\tInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)\n\t// Update updates content metadata.\n\t//\n\t// This call can be used to manage the mutable content labels. The\n\t// immutable metadata such as digest, size, and committed at cannot\n\t// be updated.\n\tUpdate(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)\n\t// List streams the entire set of content as Info objects and closes the\n\t// stream.\n\t//\n\t// Typically, this will yield a large response, chunked into messages.\n\t// Clients should make provisions to ensure they can handle the entire data\n\t// set.\n\tList(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error)\n\t// Delete will delete the referenced object.\n\tDelete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)\n\t// Read allows one to read an object based on the offset into the content.\n\t//\n\t// The requested data may be returned in one or more messages.\n\tRead(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error)\n\t// Status returns the status for a single reference.\n\tStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)\n\t// ListStatuses returns the status of ongoing object ingestions, started via\n\t// Write.\n\t//\n\t// Only those matching the regular expression will be provided in the\n\t// response. If the provided regular expression is empty, all ingestions\n\t// will be provided.\n\tListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error)\n\t// Write begins or resumes writes to a resource identified by a unique ref.\n\t// Only one active stream may exist at a time for each ref.\n\t//\n\t// Once a write stream has started, it may only write to a single ref, thus\n\t// once a stream is started, the ref may be omitted on subsequent writes.\n\t//\n\t// For any write transaction represented by a ref, only a single write may\n\t// be made to a given offset. If overlapping writes occur, it is an error.\n\t// Writes should be sequential and implementations may throw an error if\n\t// this is required.\n\t//\n\t// If expected_digest is set and already part of the content store, the\n\t// write will fail.\n\t//\n\t// When completed, the commit flag should be set to true. If expected size\n\t// or digest is set, the content will be validated against those values.\n\tWrite(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error)\n\t// Abort cancels the ongoing write named in the request. Any resources\n\t// associated with the write will be collected.\n\tAbort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)\n}\n\ntype contentClient struct {\n\tcc grpc.ClientConnInterface\n}\n\nfunc NewContentClient(cc grpc.ClientConnInterface) ContentClient {\n\treturn &contentClient{cc}\n}\n\nfunc (c *contentClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {\n\tout := new(InfoResponse)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/Info\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *contentClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {\n\tout := new(UpdateResponse)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/Update\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *contentClient) List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) {\n\tstream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[0], \"/containerd.services.content.v1.Content/List\", opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &contentListClient{stream}\n\tif err := x.ClientStream.SendMsg(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := x.ClientStream.CloseSend(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn x, nil\n}\n\ntype Content_ListClient interface {\n\tRecv() (*ListContentResponse, error)\n\tgrpc.ClientStream\n}\n\ntype contentListClient struct {\n\tgrpc.ClientStream\n}\n\nfunc (x *contentListClient) Recv() (*ListContentResponse, error) {\n\tm := new(ListContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *contentClient) Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {\n\tout := new(emptypb.Empty)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/Delete\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *contentClient) Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) {\n\tstream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[1], \"/containerd.services.content.v1.Content/Read\", opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &contentReadClient{stream}\n\tif err := x.ClientStream.SendMsg(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := x.ClientStream.CloseSend(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn x, nil\n}\n\ntype Content_ReadClient interface {\n\tRecv() (*ReadContentResponse, error)\n\tgrpc.ClientStream\n}\n\ntype contentReadClient struct {\n\tgrpc.ClientStream\n}\n\nfunc (x *contentReadClient) Recv() (*ReadContentResponse, error) {\n\tm := new(ReadContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *contentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {\n\tout := new(StatusResponse)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/Status\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *contentClient) ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) {\n\tout := new(ListStatusesResponse)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/ListStatuses\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *contentClient) Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) {\n\tstream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[2], \"/containerd.services.content.v1.Content/Write\", opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &contentWriteClient{stream}\n\treturn x, nil\n}\n\ntype Content_WriteClient interface {\n\tSend(*WriteContentRequest) error\n\tRecv() (*WriteContentResponse, error)\n\tgrpc.ClientStream\n}\n\ntype contentWriteClient struct {\n\tgrpc.ClientStream\n}\n\nfunc (x *contentWriteClient) Send(m *WriteContentRequest) error {\n\treturn x.ClientStream.SendMsg(m)\n}\n\nfunc (x *contentWriteClient) Recv() (*WriteContentResponse, error) {\n\tm := new(WriteContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *contentClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {\n\tout := new(emptypb.Empty)\n\terr := c.cc.Invoke(ctx, \"/containerd.services.content.v1.Content/Abort\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\n// ContentServer is the server API for Content service.\n// All implementations must embed UnimplementedContentServer\n// for forward compatibility\ntype ContentServer interface {\n\t// Info returns information about a committed object.\n\t//\n\t// This call can be used for getting the size of content and checking for\n\t// existence.\n\tInfo(context.Context, *InfoRequest) (*InfoResponse, error)\n\t// Update updates content metadata.\n\t//\n\t// This call can be used to manage the mutable content labels. The\n\t// immutable metadata such as digest, size, and committed at cannot\n\t// be updated.\n\tUpdate(context.Context, *UpdateRequest) (*UpdateResponse, error)\n\t// List streams the entire set of content as Info objects and closes the\n\t// stream.\n\t//\n\t// Typically, this will yield a large response, chunked into messages.\n\t// Clients should make provisions to ensure they can handle the entire data\n\t// set.\n\tList(*ListContentRequest, Content_ListServer) error\n\t// Delete will delete the referenced object.\n\tDelete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error)\n\t// Read allows one to read an object based on the offset into the content.\n\t//\n\t// The requested data may be returned in one or more messages.\n\tRead(*ReadContentRequest, Content_ReadServer) error\n\t// Status returns the status for a single reference.\n\tStatus(context.Context, *StatusRequest) (*StatusResponse, error)\n\t// ListStatuses returns the status of ongoing object ingestions, started via\n\t// Write.\n\t//\n\t// Only those matching the regular expression will be provided in the\n\t// response. If the provided regular expression is empty, all ingestions\n\t// will be provided.\n\tListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)\n\t// Write begins or resumes writes to a resource identified by a unique ref.\n\t// Only one active stream may exist at a time for each ref.\n\t//\n\t// Once a write stream has started, it may only write to a single ref, thus\n\t// once a stream is started, the ref may be omitted on subsequent writes.\n\t//\n\t// For any write transaction represented by a ref, only a single write may\n\t// be made to a given offset. If overlapping writes occur, it is an error.\n\t// Writes should be sequential and implementations may throw an error if\n\t// this is required.\n\t//\n\t// If expected_digest is set and already part of the content store, the\n\t// write will fail.\n\t//\n\t// When completed, the commit flag should be set to true. If expected size\n\t// or digest is set, the content will be validated against those values.\n\tWrite(Content_WriteServer) error\n\t// Abort cancels the ongoing write named in the request. Any resources\n\t// associated with the write will be collected.\n\tAbort(context.Context, *AbortRequest) (*emptypb.Empty, error)\n\tmustEmbedUnimplementedContentServer()\n}\n\n// UnimplementedContentServer must be embedded to have forward compatible implementations.\ntype UnimplementedContentServer struct {\n}\n\nfunc (UnimplementedContentServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Info not implemented\")\n}\nfunc (UnimplementedContentServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Update not implemented\")\n}\nfunc (UnimplementedContentServer) List(*ListContentRequest, Content_ListServer) error {\n\treturn status.Errorf(codes.Unimplemented, \"method List not implemented\")\n}\nfunc (UnimplementedContentServer) Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Delete not implemented\")\n}\nfunc (UnimplementedContentServer) Read(*ReadContentRequest, Content_ReadServer) error {\n\treturn status.Errorf(codes.Unimplemented, \"method Read not implemented\")\n}\nfunc (UnimplementedContentServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Status not implemented\")\n}\nfunc (UnimplementedContentServer) ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method ListStatuses not implemented\")\n}\nfunc (UnimplementedContentServer) Write(Content_WriteServer) error {\n\treturn status.Errorf(codes.Unimplemented, \"method Write not implemented\")\n}\nfunc (UnimplementedContentServer) Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Abort not implemented\")\n}\nfunc (UnimplementedContentServer) mustEmbedUnimplementedContentServer() {}\n\n// UnsafeContentServer may be embedded to opt out of forward compatibility for this service.\n// Use of this interface is not recommended, as added methods to ContentServer will\n// result in compilation errors.\ntype UnsafeContentServer interface {\n\tmustEmbedUnimplementedContentServer()\n}\n\nfunc RegisterContentServer(s grpc.ServiceRegistrar, srv ContentServer) {\n\ts.RegisterService(&Content_ServiceDesc, srv)\n}\n\nfunc _Content_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(InfoRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).Info(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/Info\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).Info(ctx, req.(*InfoRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Content_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(UpdateRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).Update(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/Update\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).Update(ctx, req.(*UpdateRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Content_List_Handler(srv interface{}, stream grpc.ServerStream) error {\n\tm := new(ListContentRequest)\n\tif err := stream.RecvMsg(m); err != nil {\n\t\treturn err\n\t}\n\treturn srv.(ContentServer).List(m, &contentListServer{stream})\n}\n\ntype Content_ListServer interface {\n\tSend(*ListContentResponse) error\n\tgrpc.ServerStream\n}\n\ntype contentListServer struct {\n\tgrpc.ServerStream\n}\n\nfunc (x *contentListServer) Send(m *ListContentResponse) error {\n\treturn x.ServerStream.SendMsg(m)\n}\n\nfunc _Content_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(DeleteContentRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).Delete(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/Delete\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).Delete(ctx, req.(*DeleteContentRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Content_Read_Handler(srv interface{}, stream grpc.ServerStream) error {\n\tm := new(ReadContentRequest)\n\tif err := stream.RecvMsg(m); err != nil {\n\t\treturn err\n\t}\n\treturn srv.(ContentServer).Read(m, &contentReadServer{stream})\n}\n\ntype Content_ReadServer interface {\n\tSend(*ReadContentResponse) error\n\tgrpc.ServerStream\n}\n\ntype contentReadServer struct {\n\tgrpc.ServerStream\n}\n\nfunc (x *contentReadServer) Send(m *ReadContentResponse) error {\n\treturn x.ServerStream.SendMsg(m)\n}\n\nfunc _Content_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(StatusRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).Status(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/Status\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).Status(ctx, req.(*StatusRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Content_ListStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(ListStatusesRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).ListStatuses(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/ListStatuses\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).ListStatuses(ctx, req.(*ListStatusesRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _Content_Write_Handler(srv interface{}, stream grpc.ServerStream) error {\n\treturn srv.(ContentServer).Write(&contentWriteServer{stream})\n}\n\ntype Content_WriteServer interface {\n\tSend(*WriteContentResponse) error\n\tRecv() (*WriteContentRequest, error)\n\tgrpc.ServerStream\n}\n\ntype contentWriteServer struct {\n\tgrpc.ServerStream\n}\n\nfunc (x *contentWriteServer) Send(m *WriteContentResponse) error {\n\treturn x.ServerStream.SendMsg(m)\n}\n\nfunc (x *contentWriteServer) Recv() (*WriteContentRequest, error) {\n\tm := new(WriteContentRequest)\n\tif err := x.ServerStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc _Content_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(AbortRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(ContentServer).Abort(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/containerd.services.content.v1.Content/Abort\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(ContentServer).Abort(ctx, req.(*AbortRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\n// Content_ServiceDesc is the grpc.ServiceDesc for Content service.\n// It's only intended for direct use with grpc.RegisterService,\n// and not to be introspected or modified (even as a copy)\nvar Content_ServiceDesc = grpc.ServiceDesc{\n\tServiceName: \"containerd.services.content.v1.Content\",\n\tHandlerType: (*ContentServer)(nil),\n\tMethods: []grpc.MethodDesc{\n\t\t{\n\t\t\tMethodName: \"Info\",\n\t\t\tHandler:    _Content_Info_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Update\",\n\t\t\tHandler:    _Content_Update_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Delete\",\n\t\t\tHandler:    _Content_Delete_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Status\",\n\t\t\tHandler:    _Content_Status_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"ListStatuses\",\n\t\t\tHandler:    _Content_ListStatuses_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Abort\",\n\t\t\tHandler:    _Content_Abort_Handler,\n\t\t},\n\t},\n\tStreams: []grpc.StreamDesc{\n\t\t{\n\t\t\tStreamName:    \"List\",\n\t\t\tHandler:       _Content_List_Handler,\n\t\t\tServerStreams: true,\n\t\t},\n\t\t{\n\t\t\tStreamName:    \"Read\",\n\t\t\tHandler:       _Content_Read_Handler,\n\t\t\tServerStreams: true,\n\t\t},\n\t\t{\n\t\t\tStreamName:    \"Write\",\n\t\t\tHandler:       _Content_Write_Handler,\n\t\t\tServerStreams: true,\n\t\t\tClientStreams: true,\n\t\t},\n\t},\n\tMetadata: \"github.com/containerd/containerd/api/services/content/v1/content.proto\",\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go",
    "content": "// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.\n// source: github.com/containerd/containerd/api/services/content/v1/content.proto\npackage content\n\nimport (\n\tcontext \"context\"\n\tttrpc \"github.com/containerd/ttrpc\"\n\temptypb \"google.golang.org/protobuf/types/known/emptypb\"\n)\n\ntype TTRPCContentService interface {\n\tInfo(context.Context, *InfoRequest) (*InfoResponse, error)\n\tUpdate(context.Context, *UpdateRequest) (*UpdateResponse, error)\n\tList(context.Context, *ListContentRequest, TTRPCContent_ListServer) error\n\tDelete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error)\n\tRead(context.Context, *ReadContentRequest, TTRPCContent_ReadServer) error\n\tStatus(context.Context, *StatusRequest) (*StatusResponse, error)\n\tListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)\n\tWrite(context.Context, TTRPCContent_WriteServer) error\n\tAbort(context.Context, *AbortRequest) (*emptypb.Empty, error)\n}\n\ntype TTRPCContent_ListServer interface {\n\tSend(*ListContentResponse) error\n\tttrpc.StreamServer\n}\n\ntype ttrpccontentListServer struct {\n\tttrpc.StreamServer\n}\n\nfunc (x *ttrpccontentListServer) Send(m *ListContentResponse) error {\n\treturn x.StreamServer.SendMsg(m)\n}\n\ntype TTRPCContent_ReadServer interface {\n\tSend(*ReadContentResponse) error\n\tttrpc.StreamServer\n}\n\ntype ttrpccontentReadServer struct {\n\tttrpc.StreamServer\n}\n\nfunc (x *ttrpccontentReadServer) Send(m *ReadContentResponse) error {\n\treturn x.StreamServer.SendMsg(m)\n}\n\ntype TTRPCContent_WriteServer interface {\n\tSend(*WriteContentResponse) error\n\tRecv() (*WriteContentRequest, error)\n\tttrpc.StreamServer\n}\n\ntype ttrpccontentWriteServer struct {\n\tttrpc.StreamServer\n}\n\nfunc (x *ttrpccontentWriteServer) Send(m *WriteContentResponse) error {\n\treturn x.StreamServer.SendMsg(m)\n}\n\nfunc (x *ttrpccontentWriteServer) Recv() (*WriteContentRequest, error) {\n\tm := new(WriteContentRequest)\n\tif err := x.StreamServer.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc RegisterTTRPCContentService(srv *ttrpc.Server, svc TTRPCContentService) {\n\tsrv.RegisterService(\"containerd.services.content.v1.Content\", &ttrpc.ServiceDesc{\n\t\tMethods: map[string]ttrpc.Method{\n\t\t\t\"Info\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req InfoRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.Info(ctx, &req)\n\t\t\t},\n\t\t\t\"Update\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req UpdateRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.Update(ctx, &req)\n\t\t\t},\n\t\t\t\"Delete\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req DeleteContentRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.Delete(ctx, &req)\n\t\t\t},\n\t\t\t\"Status\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req StatusRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.Status(ctx, &req)\n\t\t\t},\n\t\t\t\"ListStatuses\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req ListStatusesRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.ListStatuses(ctx, &req)\n\t\t\t},\n\t\t\t\"Abort\": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\t\t\tvar req AbortRequest\n\t\t\t\tif err := unmarshal(&req); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn svc.Abort(ctx, &req)\n\t\t\t},\n\t\t},\n\t\tStreams: map[string]ttrpc.Stream{\n\t\t\t\"List\": {\n\t\t\t\tHandler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) {\n\t\t\t\t\tm := new(ListContentRequest)\n\t\t\t\t\tif err := stream.RecvMsg(m); err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, svc.List(ctx, m, &ttrpccontentListServer{stream})\n\t\t\t\t},\n\t\t\t\tStreamingClient: false,\n\t\t\t\tStreamingServer: true,\n\t\t\t},\n\t\t\t\"Read\": {\n\t\t\t\tHandler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) {\n\t\t\t\t\tm := new(ReadContentRequest)\n\t\t\t\t\tif err := stream.RecvMsg(m); err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, svc.Read(ctx, m, &ttrpccontentReadServer{stream})\n\t\t\t\t},\n\t\t\t\tStreamingClient: false,\n\t\t\t\tStreamingServer: true,\n\t\t\t},\n\t\t\t\"Write\": {\n\t\t\t\tHandler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) {\n\t\t\t\t\treturn nil, svc.Write(ctx, &ttrpccontentWriteServer{stream})\n\t\t\t\t},\n\t\t\t\tStreamingClient: true,\n\t\t\t\tStreamingServer: true,\n\t\t\t},\n\t\t},\n\t})\n}\n\ntype TTRPCContentClient interface {\n\tInfo(context.Context, *InfoRequest) (*InfoResponse, error)\n\tUpdate(context.Context, *UpdateRequest) (*UpdateResponse, error)\n\tList(context.Context, *ListContentRequest) (TTRPCContent_ListClient, error)\n\tDelete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error)\n\tRead(context.Context, *ReadContentRequest) (TTRPCContent_ReadClient, error)\n\tStatus(context.Context, *StatusRequest) (*StatusResponse, error)\n\tListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)\n\tWrite(context.Context) (TTRPCContent_WriteClient, error)\n\tAbort(context.Context, *AbortRequest) (*emptypb.Empty, error)\n}\n\ntype ttrpccontentClient struct {\n\tclient *ttrpc.Client\n}\n\nfunc NewTTRPCContentClient(client *ttrpc.Client) TTRPCContentClient {\n\treturn &ttrpccontentClient{\n\t\tclient: client,\n\t}\n}\n\nfunc (c *ttrpccontentClient) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) {\n\tvar resp InfoResponse\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"Info\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n\nfunc (c *ttrpccontentClient) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error) {\n\tvar resp UpdateResponse\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"Update\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n\nfunc (c *ttrpccontentClient) List(ctx context.Context, req *ListContentRequest) (TTRPCContent_ListClient, error) {\n\tstream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{\n\t\tStreamingClient: false,\n\t\tStreamingServer: true,\n\t}, \"containerd.services.content.v1.Content\", \"List\", req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &ttrpccontentListClient{stream}\n\treturn x, nil\n}\n\ntype TTRPCContent_ListClient interface {\n\tRecv() (*ListContentResponse, error)\n\tttrpc.ClientStream\n}\n\ntype ttrpccontentListClient struct {\n\tttrpc.ClientStream\n}\n\nfunc (x *ttrpccontentListClient) Recv() (*ListContentResponse, error) {\n\tm := new(ListContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *ttrpccontentClient) Delete(ctx context.Context, req *DeleteContentRequest) (*emptypb.Empty, error) {\n\tvar resp emptypb.Empty\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"Delete\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n\nfunc (c *ttrpccontentClient) Read(ctx context.Context, req *ReadContentRequest) (TTRPCContent_ReadClient, error) {\n\tstream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{\n\t\tStreamingClient: false,\n\t\tStreamingServer: true,\n\t}, \"containerd.services.content.v1.Content\", \"Read\", req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &ttrpccontentReadClient{stream}\n\treturn x, nil\n}\n\ntype TTRPCContent_ReadClient interface {\n\tRecv() (*ReadContentResponse, error)\n\tttrpc.ClientStream\n}\n\ntype ttrpccontentReadClient struct {\n\tttrpc.ClientStream\n}\n\nfunc (x *ttrpccontentReadClient) Recv() (*ReadContentResponse, error) {\n\tm := new(ReadContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *ttrpccontentClient) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) {\n\tvar resp StatusResponse\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"Status\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n\nfunc (c *ttrpccontentClient) ListStatuses(ctx context.Context, req *ListStatusesRequest) (*ListStatusesResponse, error) {\n\tvar resp ListStatusesResponse\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"ListStatuses\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n\nfunc (c *ttrpccontentClient) Write(ctx context.Context) (TTRPCContent_WriteClient, error) {\n\tstream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{\n\t\tStreamingClient: true,\n\t\tStreamingServer: true,\n\t}, \"containerd.services.content.v1.Content\", \"Write\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tx := &ttrpccontentWriteClient{stream}\n\treturn x, nil\n}\n\ntype TTRPCContent_WriteClient interface {\n\tSend(*WriteContentRequest) error\n\tRecv() (*WriteContentResponse, error)\n\tttrpc.ClientStream\n}\n\ntype ttrpccontentWriteClient struct {\n\tttrpc.ClientStream\n}\n\nfunc (x *ttrpccontentWriteClient) Send(m *WriteContentRequest) error {\n\treturn x.ClientStream.SendMsg(m)\n}\n\nfunc (x *ttrpccontentWriteClient) Recv() (*WriteContentResponse, error) {\n\tm := new(WriteContentResponse)\n\tif err := x.ClientStream.RecvMsg(m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n\nfunc (c *ttrpccontentClient) Abort(ctx context.Context, req *AbortRequest) (*emptypb.Empty, error) {\n\tvar resp emptypb.Empty\n\tif err := c.client.Call(ctx, \"containerd.services.content.v1.Content\", \"Abort\", req, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/api/services/content/v1/doc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage content\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/NOTICE",
    "content": "Docker\nCopyright 2012-2015 Docker, Inc.\n\nThis product includes software developed at Docker, Inc. (https://www.docker.com).\n\nThe following is courtesy of our legal counsel:\n\n\nUse and transfer of Docker may be subject to certain restrictions by the\nUnited States and other governments.\nIt is your responsibility to ensure that your use and/or transfer does not\nviolate applicable laws.\n\nFor more information, please see https://www.bis.doc.gov\n\nSee also https://www.apache.org/dev/crypto.html and/or seek legal counsel.\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/adaptor.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage content\n\nimport (\n\t\"strings\"\n\n\t\"github.com/containerd/containerd/v2/pkg/filters\"\n)\n\n// AdaptInfo returns `filters.Adaptor` that handles `content.Info`.\nfunc AdaptInfo(info Info) filters.Adaptor {\n\treturn filters.AdapterFunc(func(fieldpath []string) (string, bool) {\n\t\tif len(fieldpath) == 0 {\n\t\t\treturn \"\", false\n\t\t}\n\n\t\tswitch fieldpath[0] {\n\t\tcase \"digest\":\n\t\t\treturn info.Digest.String(), true\n\t\tcase \"size\":\n\t\t\t// TODO: support size based filtering\n\t\tcase \"labels\":\n\t\t\treturn checkMap(fieldpath[1:], info.Labels)\n\t\t}\n\n\t\treturn \"\", false\n\t})\n}\n\nfunc checkMap(fieldpath []string, m map[string]string) (string, bool) {\n\tif len(m) == 0 {\n\t\treturn \"\", false\n\t}\n\n\tvalue, ok := m[strings.Join(fieldpath, \".\")]\n\treturn value, ok\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/content.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage content\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// Store combines the methods of content-oriented interfaces into a set that\n// are commonly provided by complete implementations.\n//\n// Overall content lifecycle:\n//   - Ingester is used to initiate a write operation (aka ingestion)\n//   - IngestManager is used to manage (e.g. list, abort) active ingestions\n//   - Once an ingestion is complete (see Writer.Commit), Provider is used to\n//     query a single piece of content by its digest\n//   - Manager is used to manage (e.g. list, delete) previously committed content\n//\n// Note that until ingestion is complete, its content is not visible through\n// Provider or Manager. Once ingestion is complete, it is no longer exposed\n// through IngestManager.\ntype Store interface {\n\tManager\n\tProvider\n\tIngestManager\n\tIngester\n}\n\n// ReaderAt extends the standard io.ReaderAt interface with reporting of Size and io.Closer\ntype ReaderAt interface {\n\tio.ReaderAt\n\tio.Closer\n\tSize() int64\n}\n\n// Provider provides a reader interface for specific content\ntype Provider interface {\n\t// ReaderAt only requires desc.Digest to be set.\n\t// Other fields in the descriptor may be used internally for resolving\n\t// the location of the actual data.\n\tReaderAt(ctx context.Context, desc ocispec.Descriptor) (ReaderAt, error)\n}\n\n// Ingester writes content\ntype Ingester interface {\n\t// Writer initiates a writing operation (aka ingestion). A single ingestion\n\t// is uniquely identified by its ref, provided using a WithRef option.\n\t// Writer can be called multiple times with the same ref to access the same\n\t// ingestion.\n\t// Once all the data is written, use Writer.Commit to complete the ingestion.\n\tWriter(ctx context.Context, opts ...WriterOpt) (Writer, error)\n}\n\n// IngestManager provides methods for managing ingestions. An ingestion is a\n// not-yet-complete writing operation initiated using Ingester and identified\n// by a ref string.\ntype IngestManager interface {\n\t// Status returns the status of the provided ref.\n\tStatus(ctx context.Context, ref string) (Status, error)\n\n\t// ListStatuses returns the status of any active ingestions whose ref match\n\t// the provided regular expression. If empty, all active ingestions will be\n\t// returned.\n\tListStatuses(ctx context.Context, filters ...string) ([]Status, error)\n\n\t// Abort completely cancels the ingest operation targeted by ref.\n\tAbort(ctx context.Context, ref string) error\n}\n\n// Info holds content specific information\ntype Info struct {\n\tDigest    digest.Digest\n\tSize      int64\n\tCreatedAt time.Time\n\tUpdatedAt time.Time\n\tLabels    map[string]string\n}\n\n// Status of a content operation (i.e. an ingestion)\ntype Status struct {\n\tRef       string\n\tOffset    int64\n\tTotal     int64\n\tExpected  digest.Digest\n\tStartedAt time.Time\n\tUpdatedAt time.Time\n}\n\n// WalkFunc defines the callback for a blob walk.\ntype WalkFunc func(Info) error\n\n// InfoReaderProvider provides both info and reader for the specific content.\ntype InfoReaderProvider interface {\n\tInfoProvider\n\tProvider\n}\n\n// InfoProvider provides info for content inspection.\ntype InfoProvider interface {\n\t// Info will return metadata about content available in the content store.\n\t//\n\t// If the content is not present, ErrNotFound will be returned.\n\tInfo(ctx context.Context, dgst digest.Digest) (Info, error)\n}\n\n// Manager provides methods for inspecting, listing and removing content.\ntype Manager interface {\n\tInfoProvider\n\n\t// Update updates mutable information related to content.\n\t// If one or more fieldpaths are provided, only those\n\t// fields will be updated.\n\t// Mutable fields:\n\t//  labels.*\n\tUpdate(ctx context.Context, info Info, fieldpaths ...string) (Info, error)\n\n\t// Walk will call fn for each item in the content store which\n\t// match the provided filters. If no filters are given all\n\t// items will be walked.\n\tWalk(ctx context.Context, fn WalkFunc, filters ...string) error\n\n\t// Delete removes the content from the store.\n\tDelete(ctx context.Context, dgst digest.Digest) error\n}\n\n// Writer handles writing of content into a content store\ntype Writer interface {\n\t// Close closes the writer, if the writer has not been\n\t// committed this allows resuming or aborting.\n\t// Calling Close on a closed writer will not error.\n\tio.WriteCloser\n\n\t// Digest may return empty digest or panics until committed.\n\tDigest() digest.Digest\n\n\t// Commit commits the blob (but no roll-back is guaranteed on an error).\n\t// size and expected can be zero-value when unknown.\n\t// Commit always closes the writer, even on error.\n\t// ErrAlreadyExists aborts the writer.\n\tCommit(ctx context.Context, size int64, expected digest.Digest, opts ...Opt) error\n\n\t// Status returns the current state of write\n\tStatus() (Status, error)\n\n\t// Truncate updates the size of the target blob\n\tTruncate(size int64) error\n}\n\ntype Syncer interface {\n\t// Sync flushes the in-flight writes to the disk (when applicable)\n\tSync() error\n}\n\n// Opt is used to alter the mutable properties of content\ntype Opt func(*Info) error\n\n// WithLabels allows labels to be set on content\nfunc WithLabels(labels map[string]string) Opt {\n\treturn func(info *Info) error {\n\t\tinfo.Labels = labels\n\t\treturn nil\n\t}\n}\n\n// WriterOpts is internally used by WriterOpt.\ntype WriterOpts struct {\n\tRef  string\n\tDesc ocispec.Descriptor\n}\n\n// WriterOpt is used for passing options to Ingester.Writer.\ntype WriterOpt func(*WriterOpts) error\n\n// WithDescriptor specifies an OCI descriptor.\n// Writer may optionally use the descriptor internally for resolving\n// the location of the actual data.\n// Write does not require any field of desc to be set.\n// If the data size is unknown, desc.Size should be set to 0.\n// Some implementations may also accept negative values as \"unknown\".\nfunc WithDescriptor(desc ocispec.Descriptor) WriterOpt {\n\treturn func(opts *WriterOpts) error {\n\t\topts.Desc = desc\n\t\treturn nil\n\t}\n}\n\n// WithRef specifies a ref string.\nfunc WithRef(ref string) WriterOpt {\n\treturn func(opts *WriterOpts) error {\n\t\topts.Ref = ref\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/helpers.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage content\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/containerd/v2/internal/randutil\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\nvar ErrReset = errors.New(\"writer has been reset\")\n\nvar bufPool = sync.Pool{\n\tNew: func() interface{} {\n\t\tbuffer := make([]byte, 1<<20)\n\t\treturn &buffer\n\t},\n}\n\ntype reader interface {\n\tReader() io.Reader\n}\n\n// NewReader returns a io.Reader from a ReaderAt\nfunc NewReader(ra ReaderAt) io.Reader {\n\tif rd, ok := ra.(reader); ok {\n\t\treturn rd.Reader()\n\t}\n\treturn io.NewSectionReader(ra, 0, ra.Size())\n}\n\ntype nopCloserBytesReader struct {\n\t*bytes.Reader\n}\n\nfunc (*nopCloserBytesReader) Close() error { return nil }\n\ntype nopCloserSectionReader struct {\n\t*io.SectionReader\n}\n\nfunc (*nopCloserSectionReader) Close() error { return nil }\n\n// BlobReadSeeker returns a read seeker for the blob from the provider.\nfunc BlobReadSeeker(ctx context.Context, provider Provider, desc ocispec.Descriptor) (io.ReadSeekCloser, error) {\n\tif int64(len(desc.Data)) == desc.Size && digest.FromBytes(desc.Data) == desc.Digest {\n\t\treturn &nopCloserBytesReader{bytes.NewReader(desc.Data)}, nil\n\t}\n\n\tra, err := provider.ReaderAt(ctx, desc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &nopCloserSectionReader{io.NewSectionReader(ra, 0, ra.Size())}, nil\n}\n\n// ReadBlob retrieves the entire contents of the blob from the provider.\n//\n// Avoid using this for large blobs, such as layers.\nfunc ReadBlob(ctx context.Context, provider Provider, desc ocispec.Descriptor) ([]byte, error) {\n\tif int64(len(desc.Data)) == desc.Size && digest.FromBytes(desc.Data) == desc.Digest {\n\t\treturn desc.Data, nil\n\t}\n\n\tra, err := provider.ReaderAt(ctx, desc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer ra.Close()\n\n\tp := make([]byte, ra.Size())\n\n\tn, err := ra.ReadAt(p, 0)\n\tif err == io.EOF {\n\t\tif int64(n) != ra.Size() {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t} else {\n\t\t\terr = nil\n\t\t}\n\t}\n\treturn p, err\n}\n\n// WriteBlob writes data with the expected digest into the content store. If\n// expected already exists, the method returns immediately and the reader will\n// not be consumed.\n//\n// This is useful when the digest and size are known beforehand.\n//\n// Copy is buffered, so no need to wrap reader in buffered io.\nfunc WriteBlob(ctx context.Context, cs Ingester, ref string, r io.Reader, desc ocispec.Descriptor, opts ...Opt) error {\n\tcw, err := OpenWriter(ctx, cs, WithRef(ref), WithDescriptor(desc))\n\tif err != nil {\n\t\tif !errdefs.IsAlreadyExists(err) {\n\t\t\treturn fmt.Errorf(\"failed to open writer: %w\", err)\n\t\t}\n\n\t\treturn nil // already present\n\t}\n\tdefer cw.Close()\n\n\treturn Copy(ctx, cw, r, desc.Size, desc.Digest, opts...)\n}\n\n// OpenWriter opens a new writer for the given reference, retrying if the writer\n// is locked until the reference is available or returns an error.\nfunc OpenWriter(ctx context.Context, cs Ingester, opts ...WriterOpt) (Writer, error) {\n\tvar (\n\t\tcw    Writer\n\t\terr   error\n\t\tretry = 16\n\t)\n\tfor {\n\t\tcw, err = cs.Writer(ctx, opts...)\n\t\tif err != nil {\n\t\t\tif !errdefs.IsUnavailable(err) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// TODO: Check status to determine if the writer is active,\n\t\t\t// continue waiting while active, otherwise return lock\n\t\t\t// error or abort. Requires asserting for an ingest manager\n\n\t\t\tselect {\n\t\t\tcase <-time.After(time.Millisecond * time.Duration(randutil.Intn(retry))):\n\t\t\t\tif retry < 2048 {\n\t\t\t\t\tretry = retry << 1\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\tcase <-ctx.Done():\n\t\t\t\t// Propagate lock error\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t}\n\t\tbreak\n\t}\n\n\treturn cw, err\n}\n\n// Copy copies data with the expected digest from the reader into the\n// provided content store writer. This copy commits the writer.\n//\n// This is useful when the digest and size are known beforehand. When\n// the size or digest is unknown, these values may be empty.\n//\n// Copy is buffered, so no need to wrap reader in buffered io.\nfunc Copy(ctx context.Context, cw Writer, or io.Reader, size int64, expected digest.Digest, opts ...Opt) error {\n\tr := or\n\tfor i := 0; ; i++ {\n\t\tif i >= 1 {\n\t\t\tlog.G(ctx).WithField(\"digest\", expected).Debugf(\"retrying copy due to reset\")\n\t\t}\n\n\t\tws, err := cw.Status()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get status: %w\", err)\n\t\t}\n\t\t// Reset the original reader if\n\t\t// 1. there is an offset, or\n\t\t// 2. this is a retry due to Reset error\n\t\tif ws.Offset > 0 || i > 0 {\n\t\t\tr, err = seekReader(or, ws.Offset, size)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to resume write to %v: %w\", ws.Ref, err)\n\t\t\t}\n\t\t}\n\n\t\tcopied, err := copyWithBuffer(cw, r)\n\t\tif errors.Is(err, ErrReset) {\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to copy: %w\", err)\n\t\t}\n\t\tif size != 0 && copied < size-ws.Offset {\n\t\t\t// Short writes would return its own error, this indicates a read failure\n\t\t\treturn fmt.Errorf(\"failed to read expected number of bytes: %w\", io.ErrUnexpectedEOF)\n\t\t}\n\t\tif err := cw.Commit(ctx, size, expected, opts...); err != nil {\n\t\t\tif errors.Is(err, ErrReset) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !errdefs.IsAlreadyExists(err) {\n\t\t\t\treturn fmt.Errorf(\"failed commit on ref %q: %w\", ws.Ref, err)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// CopyReaderAt copies to a writer from a given reader at for the given\n// number of bytes. This copy does not commit the writer.\nfunc CopyReaderAt(cw Writer, ra ReaderAt, n int64) error {\n\tws, err := cw.Status()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcopied, err := copyWithBuffer(cw, io.NewSectionReader(ra, ws.Offset, n))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to copy: %w\", err)\n\t}\n\tif copied < n {\n\t\t// Short writes would return its own error, this indicates a read failure\n\t\treturn fmt.Errorf(\"failed to read expected number of bytes: %w\", io.ErrUnexpectedEOF)\n\t}\n\treturn nil\n}\n\n// CopyReader copies to a writer from a given reader, returning\n// the number of bytes copied.\n// Note: if the writer has a non-zero offset, the total number\n// of bytes read may be greater than those copied if the reader\n// is not an io.Seeker.\n// This copy does not commit the writer.\nfunc CopyReader(cw Writer, r io.Reader) (int64, error) {\n\tws, err := cw.Status()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to get status: %w\", err)\n\t}\n\n\tif ws.Offset > 0 {\n\t\tr, err = seekReader(r, ws.Offset, 0)\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"unable to resume write to %v: %w\", ws.Ref, err)\n\t\t}\n\t}\n\n\treturn copyWithBuffer(cw, r)\n}\n\n// seekReader attempts to seek the reader to the given offset, either by\n// resolving `io.Seeker`, by detecting `io.ReaderAt`, or discarding\n// up to the given offset.\nfunc seekReader(r io.Reader, offset, size int64) (io.Reader, error) {\n\t// attempt to resolve r as a seeker and setup the offset.\n\tseeker, ok := r.(io.Seeker)\n\tif ok {\n\t\tnn, err := seeker.Seek(offset, io.SeekStart)\n\t\tif nn != offset {\n\t\t\tif err == nil {\n\t\t\t\terr = fmt.Errorf(\"unexpected seek location without seek error\")\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to seek to offset %v: %w\", offset, err)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn r, nil\n\t}\n\n\t// ok, let's try io.ReaderAt!\n\treaderAt, ok := r.(io.ReaderAt)\n\tif ok && size > offset {\n\t\tsr := io.NewSectionReader(readerAt, offset, size)\n\t\treturn sr, nil\n\t}\n\n\t// well then, let's just discard up to the offset\n\tn, err := copyWithBuffer(io.Discard, io.LimitReader(r, offset))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to discard to offset: %w\", err)\n\t}\n\tif n != offset {\n\t\treturn nil, errors.New(\"unable to discard to offset\")\n\t}\n\n\treturn r, nil\n}\n\n// copyWithBuffer is very similar to  io.CopyBuffer https://golang.org/pkg/io/#CopyBuffer\n// but instead of using Read to read from the src, we use ReadAtLeast to make sure we have\n// a full buffer before we do a write operation to dst to reduce overheads associated\n// with the write operations of small buffers.\nfunc copyWithBuffer(dst io.Writer, src io.Reader) (written int64, err error) {\n\t// If the reader has a WriteTo method, use it to do the copy.\n\t// Avoids an allocation and a copy.\n\tif wt, ok := src.(io.WriterTo); ok {\n\t\treturn wt.WriteTo(dst)\n\t}\n\t// Similarly, if the writer has a ReadFrom method, use it to do the copy.\n\tif rt, ok := dst.(io.ReaderFrom); ok {\n\t\treturn rt.ReadFrom(src)\n\t}\n\tbufRef := bufPool.Get().(*[]byte)\n\tdefer bufPool.Put(bufRef)\n\tbuf := *bufRef\n\tfor {\n\t\tnr, er := io.ReadAtLeast(src, buf, len(buf))\n\t\tif nr > 0 {\n\t\t\tnw, ew := dst.Write(buf[0:nr])\n\t\t\tif nw > 0 {\n\t\t\t\twritten += int64(nw)\n\t\t\t}\n\t\t\tif ew != nil {\n\t\t\t\terr = ew\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif nr != nw {\n\t\t\t\terr = io.ErrShortWrite\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif er != nil {\n\t\t\t// If an EOF happens after reading fewer than the requested bytes,\n\t\t\t// ReadAtLeast returns ErrUnexpectedEOF.\n\t\t\tif er != io.EOF && er != io.ErrUnexpectedEOF {\n\t\t\t\terr = er\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}\n\n// Exists returns whether an attempt to access the content would not error out\n// with an ErrNotFound error. It will return an encountered error if it was\n// different than ErrNotFound.\nfunc Exists(ctx context.Context, provider InfoProvider, desc ocispec.Descriptor) (bool, error) {\n\t_, err := provider.Info(ctx, desc.Digest)\n\tif errdefs.IsNotFound(err) {\n\t\treturn false, nil\n\t}\n\treturn err == nil, err\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/proxy/content_reader.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage proxy\n\nimport (\n\t\"context\"\n\n\tcontentapi \"github.com/containerd/containerd/api/services/content/v1\"\n\tdigest \"github.com/opencontainers/go-digest\"\n)\n\ntype remoteReaderAt struct {\n\tctx    context.Context\n\tdigest digest.Digest\n\tsize   int64\n\tclient contentapi.TTRPCContentClient\n}\n\nfunc (ra *remoteReaderAt) Size() int64 {\n\treturn ra.size\n}\n\nfunc (ra *remoteReaderAt) ReadAt(p []byte, off int64) (n int, err error) {\n\trr := &contentapi.ReadContentRequest{\n\t\tDigest: ra.digest.String(),\n\t\tOffset: off,\n\t\tSize:   int64(len(p)),\n\t}\n\t// we need a child context with cancel, or the eventually called\n\t// grpc.NewStream will leak the goroutine until the whole thing is cleared.\n\t// See comment at https://godoc.org/google.golang.org/grpc#ClientConn.NewStream\n\tchildCtx, cancel := context.WithCancel(ra.ctx)\n\t// we MUST cancel the child context; see comment above\n\tdefer cancel()\n\trc, err := ra.client.Read(childCtx, rr)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tfor len(p) > 0 {\n\t\tvar resp *contentapi.ReadContentResponse\n\t\t// fill our buffer up until we can fill p.\n\t\tresp, err = rc.Recv()\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\t\tcopied := copy(p, resp.Data)\n\t\tn += copied\n\t\tp = p[copied:]\n\t}\n\treturn n, nil\n}\n\nfunc (ra *remoteReaderAt) Close() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/proxy/content_store.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\tcontentapi \"github.com/containerd/containerd/api/services/content/v1\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/errdefs/pkg/errgrpc\"\n\t\"github.com/containerd/ttrpc\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/protobuf/types/known/emptypb\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/pkg/protobuf\"\n\tprotobuftypes \"github.com/containerd/containerd/v2/pkg/protobuf/types\"\n)\n\ntype proxyContentStore struct {\n\t// client is the rpc content client\n\t// NOTE: ttrpc is used because it is the smaller interface shared with grpc\n\tclient contentapi.TTRPCContentClient\n}\n\n// NewContentStore returns a new content store which communicates over a GRPC\n// connection using the containerd content GRPC API.\nfunc NewContentStore(client any) content.Store {\n\tswitch c := client.(type) {\n\tcase contentapi.ContentClient:\n\t\treturn &proxyContentStore{\n\t\t\tclient: convertClient{c},\n\t\t}\n\tcase grpc.ClientConnInterface:\n\t\treturn &proxyContentStore{\n\t\t\tclient: convertClient{contentapi.NewContentClient(c)},\n\t\t}\n\tcase contentapi.TTRPCContentClient:\n\t\treturn &proxyContentStore{\n\t\t\tclient: c,\n\t\t}\n\tcase *ttrpc.Client:\n\t\treturn &proxyContentStore{\n\t\t\tclient: contentapi.NewTTRPCContentClient(c),\n\t\t}\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unsupported content client %T: %w\", client, errdefs.ErrNotImplemented))\n\t}\n}\n\nfunc (pcs *proxyContentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {\n\tresp, err := pcs.client.Info(ctx, &contentapi.InfoRequest{\n\t\tDigest: dgst.String(),\n\t})\n\tif err != nil {\n\t\treturn content.Info{}, errgrpc.ToNative(err)\n\t}\n\n\treturn infoFromGRPC(resp.Info), nil\n}\n\nfunc (pcs *proxyContentStore) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error {\n\tsession, err := pcs.client.List(ctx, &contentapi.ListContentRequest{\n\t\tFilters: filters,\n\t})\n\tif err != nil {\n\t\treturn errgrpc.ToNative(err)\n\t}\n\n\tfor {\n\t\tmsg, err := session.Recv()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\treturn errgrpc.ToNative(err)\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tfor _, info := range msg.Info {\n\t\t\tif err := fn(infoFromGRPC(info)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (pcs *proxyContentStore) Delete(ctx context.Context, dgst digest.Digest) error {\n\tif _, err := pcs.client.Delete(ctx, &contentapi.DeleteContentRequest{\n\t\tDigest: dgst.String(),\n\t}); err != nil {\n\t\treturn errgrpc.ToNative(err)\n\t}\n\n\treturn nil\n}\n\n// ReaderAt ignores MediaType.\nfunc (pcs *proxyContentStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) {\n\ti, err := pcs.Info(ctx, desc.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &remoteReaderAt{\n\t\tctx:    ctx,\n\t\tdigest: desc.Digest,\n\t\tsize:   i.Size,\n\t\tclient: pcs.client,\n\t}, nil\n}\n\nfunc (pcs *proxyContentStore) Status(ctx context.Context, ref string) (content.Status, error) {\n\tresp, err := pcs.client.Status(ctx, &contentapi.StatusRequest{\n\t\tRef: ref,\n\t})\n\tif err != nil {\n\t\treturn content.Status{}, errgrpc.ToNative(err)\n\t}\n\n\tstatus := resp.Status\n\treturn content.Status{\n\t\tRef:       status.Ref,\n\t\tStartedAt: protobuf.FromTimestamp(status.StartedAt),\n\t\tUpdatedAt: protobuf.FromTimestamp(status.UpdatedAt),\n\t\tOffset:    status.Offset,\n\t\tTotal:     status.Total,\n\t\tExpected:  digest.Digest(status.Expected),\n\t}, nil\n}\n\nfunc (pcs *proxyContentStore) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) {\n\tresp, err := pcs.client.Update(ctx, &contentapi.UpdateRequest{\n\t\tInfo: infoToGRPC(&info),\n\t\tUpdateMask: &protobuftypes.FieldMask{\n\t\t\tPaths: fieldpaths,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn content.Info{}, errgrpc.ToNative(err)\n\t}\n\treturn infoFromGRPC(resp.Info), nil\n}\n\nfunc (pcs *proxyContentStore) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error) {\n\tresp, err := pcs.client.ListStatuses(ctx, &contentapi.ListStatusesRequest{\n\t\tFilters: filters,\n\t})\n\tif err != nil {\n\t\treturn nil, errgrpc.ToNative(err)\n\t}\n\n\tvar statuses []content.Status\n\tfor _, status := range resp.Statuses {\n\t\tstatuses = append(statuses, content.Status{\n\t\t\tRef:       status.Ref,\n\t\t\tStartedAt: protobuf.FromTimestamp(status.StartedAt),\n\t\t\tUpdatedAt: protobuf.FromTimestamp(status.UpdatedAt),\n\t\t\tOffset:    status.Offset,\n\t\t\tTotal:     status.Total,\n\t\t\tExpected:  digest.Digest(status.Expected),\n\t\t})\n\t}\n\n\treturn statuses, nil\n}\n\n// Writer ignores MediaType.\nfunc (pcs *proxyContentStore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) {\n\tvar wOpts content.WriterOpts\n\tfor _, opt := range opts {\n\t\tif err := opt(&wOpts); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\twrclient, offset, err := pcs.negotiate(ctx, wOpts.Ref, wOpts.Desc.Size, wOpts.Desc.Digest)\n\tif err != nil {\n\t\treturn nil, errgrpc.ToNative(err)\n\t}\n\n\treturn &remoteWriter{\n\t\tref:    wOpts.Ref,\n\t\tclient: wrclient,\n\t\toffset: offset,\n\t}, nil\n}\n\n// Abort implements asynchronous abort. It starts a new write session on the ref l\nfunc (pcs *proxyContentStore) Abort(ctx context.Context, ref string) error {\n\tif _, err := pcs.client.Abort(ctx, &contentapi.AbortRequest{\n\t\tRef: ref,\n\t}); err != nil {\n\t\treturn errgrpc.ToNative(err)\n\t}\n\n\treturn nil\n}\n\nfunc (pcs *proxyContentStore) negotiate(ctx context.Context, ref string, size int64, expected digest.Digest) (contentapi.TTRPCContent_WriteClient, int64, error) {\n\twrclient, err := pcs.client.Write(ctx)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tif err := wrclient.Send(&contentapi.WriteContentRequest{\n\t\tAction:   contentapi.WriteAction_STAT,\n\t\tRef:      ref,\n\t\tTotal:    size,\n\t\tExpected: expected.String(),\n\t}); err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tresp, err := wrclient.Recv()\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\treturn wrclient, resp.Offset, nil\n}\n\ntype convertClient struct {\n\tcontentapi.ContentClient\n}\n\nfunc (c convertClient) Info(ctx context.Context, req *contentapi.InfoRequest) (*contentapi.InfoResponse, error) {\n\treturn c.ContentClient.Info(ctx, req)\n}\n\nfunc (c convertClient) Update(ctx context.Context, req *contentapi.UpdateRequest) (*contentapi.UpdateResponse, error) {\n\treturn c.ContentClient.Update(ctx, req)\n}\n\ntype convertListClient struct {\n\tcontentapi.Content_ListClient\n}\n\nfunc (c convertClient) List(ctx context.Context, req *contentapi.ListContentRequest) (contentapi.TTRPCContent_ListClient, error) {\n\tlc, err := c.ContentClient.List(ctx, req)\n\tif lc == nil {\n\t\treturn nil, err\n\t}\n\treturn convertListClient{lc}, err\n}\n\nfunc (c convertClient) Delete(ctx context.Context, req *contentapi.DeleteContentRequest) (*emptypb.Empty, error) {\n\treturn c.ContentClient.Delete(ctx, req)\n}\n\ntype convertReadClient struct {\n\tcontentapi.Content_ReadClient\n}\n\nfunc (c convertClient) Read(ctx context.Context, req *contentapi.ReadContentRequest) (contentapi.TTRPCContent_ReadClient, error) {\n\trc, err := c.ContentClient.Read(ctx, req)\n\tif rc == nil {\n\t\treturn nil, err\n\t}\n\treturn convertReadClient{rc}, err\n}\n\nfunc (c convertClient) Status(ctx context.Context, req *contentapi.StatusRequest) (*contentapi.StatusResponse, error) {\n\treturn c.ContentClient.Status(ctx, req)\n}\n\nfunc (c convertClient) ListStatuses(ctx context.Context, req *contentapi.ListStatusesRequest) (*contentapi.ListStatusesResponse, error) {\n\treturn c.ContentClient.ListStatuses(ctx, req)\n}\n\ntype convertWriteClient struct {\n\tcontentapi.Content_WriteClient\n}\n\nfunc (c convertClient) Write(ctx context.Context) (contentapi.TTRPCContent_WriteClient, error) {\n\twc, err := c.ContentClient.Write(ctx)\n\tif wc == nil {\n\t\treturn nil, err\n\t}\n\treturn convertWriteClient{wc}, err\n}\n\nfunc (c convertClient) Abort(ctx context.Context, req *contentapi.AbortRequest) (*emptypb.Empty, error) {\n\treturn c.ContentClient.Abort(ctx, req)\n}\n\nfunc infoToGRPC(info *content.Info) *contentapi.Info {\n\treturn &contentapi.Info{\n\t\tDigest:    info.Digest.String(),\n\t\tSize:      info.Size,\n\t\tCreatedAt: protobuf.ToTimestamp(info.CreatedAt),\n\t\tUpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),\n\t\tLabels:    info.Labels,\n\t}\n}\n\nfunc infoFromGRPC(info *contentapi.Info) content.Info {\n\treturn content.Info{\n\t\tDigest:    digest.Digest(info.Digest),\n\t\tSize:      info.Size,\n\t\tCreatedAt: protobuf.FromTimestamp(info.CreatedAt),\n\t\tUpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),\n\t\tLabels:    info.Labels,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\tcontentapi \"github.com/containerd/containerd/api/services/content/v1\"\n\t\"github.com/containerd/errdefs/pkg/errgrpc\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/defaults\"\n\t\"github.com/containerd/containerd/v2/pkg/protobuf\"\n)\n\ntype remoteWriter struct {\n\tref    string\n\tclient contentapi.TTRPCContent_WriteClient\n\toffset int64\n\tdigest digest.Digest\n}\n\n// send performs a synchronous req-resp cycle on the client.\nfunc (rw *remoteWriter) send(req *contentapi.WriteContentRequest) (*contentapi.WriteContentResponse, error) {\n\tif err := rw.client.Send(req); err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := rw.client.Recv()\n\n\tif err == nil {\n\t\t// try to keep these in sync\n\t\tif resp.Digest != \"\" {\n\t\t\trw.digest = digest.Digest(resp.Digest)\n\t\t}\n\t}\n\n\treturn resp, err\n}\n\nfunc (rw *remoteWriter) Status() (content.Status, error) {\n\tresp, err := rw.send(&contentapi.WriteContentRequest{\n\t\tAction: contentapi.WriteAction_STAT,\n\t})\n\tif err != nil {\n\t\treturn content.Status{}, fmt.Errorf(\"error getting writer status: %w\", errgrpc.ToNative(err))\n\t}\n\n\treturn content.Status{\n\t\tRef:       rw.ref,\n\t\tOffset:    resp.Offset,\n\t\tTotal:     resp.Total,\n\t\tStartedAt: protobuf.FromTimestamp(resp.StartedAt),\n\t\tUpdatedAt: protobuf.FromTimestamp(resp.UpdatedAt),\n\t}, nil\n}\n\nfunc (rw *remoteWriter) Digest() digest.Digest {\n\treturn rw.digest\n}\n\nfunc (rw *remoteWriter) Write(p []byte) (n int, err error) {\n\tconst maxBufferSize = defaults.DefaultMaxSendMsgSize >> 1\n\tfor i := 0; i < len(p); i += maxBufferSize {\n\t\toffset := rw.offset\n\n\t\tend := i + maxBufferSize\n\t\tif end > len(p) {\n\t\t\tend = len(p)\n\t\t}\n\t\tdata := p[i:end]\n\n\t\tresp, err := rw.send(&contentapi.WriteContentRequest{\n\t\t\tAction: contentapi.WriteAction_WRITE,\n\t\t\tOffset: offset,\n\t\t\tData:   data,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"failed to send write: %w\", errgrpc.ToNative(err))\n\t\t}\n\n\t\twritten := int(resp.Offset - offset)\n\t\trw.offset += int64(written)\n\t\tif resp.Digest != \"\" {\n\t\t\trw.digest = digest.Digest(resp.Digest)\n\t\t}\n\t\tn += written\n\n\t\tif written < len(data) {\n\t\t\treturn n, io.ErrShortWrite\n\t\t}\n\t}\n\treturn n, nil\n}\n\nfunc (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) (err error) {\n\tdefer func() {\n\t\terr1 := rw.Close()\n\t\tif err == nil {\n\t\t\terr = err1\n\t\t}\n\t}()\n\n\tvar base content.Info\n\tfor _, opt := range opts {\n\t\tif err := opt(&base); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tresp, err := rw.send(&contentapi.WriteContentRequest{\n\t\tAction:   contentapi.WriteAction_COMMIT,\n\t\tTotal:    size,\n\t\tOffset:   rw.offset,\n\t\tExpected: expected.String(),\n\t\tLabels:   base.Labels,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"commit failed: %w\", errgrpc.ToNative(err))\n\t}\n\n\tif size != 0 && resp.Offset != size {\n\t\treturn fmt.Errorf(\"unexpected size: %v != %v\", resp.Offset, size)\n\t}\n\n\tactual := digest.Digest(resp.Digest)\n\tif expected != \"\" && actual != expected {\n\t\treturn fmt.Errorf(\"unexpected digest: %v != %v\", resp.Digest, expected)\n\t}\n\n\trw.digest = actual\n\trw.offset = resp.Offset\n\treturn nil\n}\n\nfunc (rw *remoteWriter) Truncate(size int64) error {\n\t// This truncation won't actually be validated until a write is issued.\n\trw.offset = size\n\treturn nil\n}\n\nfunc (rw *remoteWriter) Close() error {\n\treturn rw.client.CloseSend()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/annotations.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nconst (\n\t// AnnotationImageName is an annotation on a Descriptor in an index.json\n\t// containing the `Name` value as used by an `Image` struct\n\tAnnotationImageName = \"io.containerd.image.name\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/diffid.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/pkg/archive/compression\"\n\t\"github.com/containerd/containerd/v2/pkg/labels\"\n\t\"github.com/containerd/log\"\n)\n\n// GetDiffID gets the diff ID of the layer blob descriptor.\nfunc GetDiffID(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (digest.Digest, error) {\n\tswitch desc.MediaType {\n\tcase\n\t\t// If the layer is already uncompressed, we can just return its digest\n\t\tMediaTypeDockerSchema2Layer,\n\t\tocispec.MediaTypeImageLayer,\n\t\tMediaTypeDockerSchema2LayerForeign,\n\t\tocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // deprecated\n\t\treturn desc.Digest, nil\n\t}\n\tinfo, err := cs.Info(ctx, desc.Digest)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tv, ok := info.Labels[labels.LabelUncompressed]\n\tif ok {\n\t\t// Fast path: if the image is already unpacked, we can use the label value\n\t\treturn digest.Parse(v)\n\t}\n\t// if the image is not unpacked, we may not have the label\n\tra, err := cs.ReaderAt(ctx, desc)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer ra.Close()\n\tr := content.NewReader(ra)\n\tuR, err := compression.DecompressStream(r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer uR.Close()\n\tdigester := digest.Canonical.Digester()\n\thashW := digester.Hash()\n\tif _, err := io.Copy(hashW, uR); err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := ra.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\tdigest := digester.Digest()\n\t// memorize the computed value\n\tif info.Labels == nil {\n\t\tinfo.Labels = make(map[string]string)\n\t}\n\tinfo.Labels[labels.LabelUncompressed] = digest.String()\n\tif _, err := cs.Update(ctx, info, \"labels\"); err != nil {\n\t\tlog.G(ctx).WithError(err).Warnf(\"failed to set %s label for %s\", labels.LabelUncompressed, desc.Digest)\n\t}\n\treturn digest, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/handlers.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/platforms\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"golang.org/x/sync/errgroup\"\n\t\"golang.org/x/sync/semaphore\"\n)\n\nvar (\n\t// ErrSkipDesc is used to skip processing of a descriptor and\n\t// its descendants.\n\tErrSkipDesc = errors.New(\"skip descriptor\")\n\n\t// ErrStopHandler is used to signify that the descriptor\n\t// has been handled and should not be handled further.\n\t// This applies only to a single descriptor in a handler\n\t// chain and does not apply to descendant descriptors.\n\tErrStopHandler = errors.New(\"stop handler\")\n\n\t// ErrEmptyWalk is used when the WalkNotEmpty handlers return no\n\t// children (e.g.: they were filtered out).\n\tErrEmptyWalk = errors.New(\"image might be filtered out\")\n)\n\n// Handler handles image manifests\ntype Handler interface {\n\tHandle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error)\n}\n\n// HandlerFunc function implementing the Handler interface\ntype HandlerFunc func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error)\n\n// Handle image manifests\nfunc (fn HandlerFunc) Handle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) {\n\treturn fn(ctx, desc)\n}\n\n// Handlers returns a handler that will run the handlers in sequence.\n//\n// A handler may return `ErrStopHandler` to stop calling additional handlers\nfunc Handlers(handlers ...Handler) HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) {\n\t\tvar children []ocispec.Descriptor\n\t\tfor _, handler := range handlers {\n\t\t\tch, err := handler.Handle(ctx, desc)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, ErrStopHandler) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tchildren = append(children, ch...)\n\t\t}\n\n\t\treturn children, nil\n\t}\n}\n\n// Walk the resources of an image and call the handler for each. If the handler\n// decodes the sub-resources for each image,\n//\n// This differs from dispatch in that each sibling resource is considered\n// synchronously.\nfunc Walk(ctx context.Context, handler Handler, descs ...ocispec.Descriptor) error {\n\tfor _, desc := range descs {\n\n\t\tchildren, err := handler.Handle(ctx, desc)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, ErrSkipDesc) {\n\t\t\t\tcontinue // don't traverse the children.\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tif len(children) > 0 {\n\t\t\tif err := Walk(ctx, handler, children...); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// WalkNotEmpty works the same way Walk does, with the exception that it ensures that\n// some children are still found by Walking the descriptors (for example, not all of\n// them have been filtered out by one of the handlers). If there are no children,\n// then an ErrEmptyWalk error is returned.\nfunc WalkNotEmpty(ctx context.Context, handler Handler, descs ...ocispec.Descriptor) error {\n\tisEmpty := true\n\tvar notEmptyHandler HandlerFunc = func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := handler.Handle(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn children, err\n\t\t}\n\n\t\tif len(children) > 0 {\n\t\t\tisEmpty = false\n\t\t}\n\n\t\treturn children, nil\n\t}\n\n\terr := Walk(ctx, notEmptyHandler, descs...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif isEmpty {\n\t\treturn ErrEmptyWalk\n\t}\n\n\treturn nil\n}\n\n// Dispatch runs the provided handler for content specified by the descriptors.\n// If the handler decode subresources, they will be visited, as well.\n//\n// Handlers for siblings are run in parallel on the provided descriptors. A\n// handler may return `ErrSkipDesc` to signal to the dispatcher to not traverse\n// any children.\n//\n// A concurrency limiter can be passed in to limit the number of concurrent\n// handlers running. When limiter is nil, there is no limit.\n//\n// Typically, this function will be used with `FetchHandler`, often composed\n// with other handlers.\n//\n// If any handler returns an error, the dispatch session will be canceled.\nfunc Dispatch(ctx context.Context, handler Handler, limiter *semaphore.Weighted, descs ...ocispec.Descriptor) error {\n\teg, ctx2 := errgroup.WithContext(ctx)\n\tfor _, desc := range descs {\n\t\tdesc := desc\n\n\t\tif limiter != nil {\n\t\t\tif err := limiter.Acquire(ctx, 1); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\teg.Go(func() error {\n\t\t\tdesc := desc\n\n\t\t\tchildren, err := handler.Handle(ctx2, desc)\n\t\t\tif limiter != nil {\n\t\t\t\tlimiter.Release(1)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, ErrSkipDesc) {\n\t\t\t\t\treturn nil // don't traverse the children.\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif len(children) > 0 {\n\t\t\t\treturn Dispatch(ctx2, handler, limiter, children...)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t})\n\t}\n\n\treturn eg.Wait()\n}\n\n// ChildrenHandler decodes well-known manifest types and returns their children.\n//\n// This is useful for supporting recursive fetch and other use cases where you\n// want to do a full walk of resources.\n//\n// One can also replace this with another implementation to allow descending of\n// arbitrary types.\nfunc ChildrenHandler(provider content.Provider) HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\treturn Children(ctx, provider, desc)\n\t}\n}\n\n// SetChildrenLabels is a handler wrapper which sets labels for the content on\n// the children returned by the handler and passes through the children.\n// Must follow a handler that returns the children to be labeled.\nfunc SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc {\n\treturn SetChildrenMappedLabels(manager, f, nil)\n}\n\n// SetChildrenMappedLabels is a handler wrapper which sets labels for the content on\n// the children returned by the handler and passes through the children.\n// Must follow a handler that returns the children to be labeled.\n// The label map allows the caller to control the labels per child descriptor.\n// For returned labels, the index of the child will be appended to the end\n// except for the first index when the returned label does not end with '.'.\nfunc SetChildrenMappedLabels(manager content.Manager, f HandlerFunc, labelMap func(ocispec.Descriptor) []string) HandlerFunc {\n\tif labelMap == nil {\n\t\tlabelMap = ChildGCLabels\n\t}\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn children, err\n\t\t}\n\n\t\tif len(children) > 0 {\n\t\t\tvar (\n\t\t\t\tinfo = content.Info{\n\t\t\t\t\tDigest: desc.Digest,\n\t\t\t\t\tLabels: map[string]string{},\n\t\t\t\t}\n\t\t\t\tfields = []string{}\n\t\t\t\tkeys   = map[string]uint{}\n\t\t\t)\n\t\t\tfor _, ch := range children {\n\t\t\t\tlabelKeys := labelMap(ch)\n\t\t\t\tfor _, key := range labelKeys {\n\t\t\t\t\tidx := keys[key]\n\t\t\t\t\tkeys[key] = idx + 1\n\t\t\t\t\tif idx > 0 || key[len(key)-1] == '.' {\n\t\t\t\t\t\tkey = fmt.Sprintf(\"%s%d\", key, idx)\n\t\t\t\t\t}\n\n\t\t\t\t\tinfo.Labels[key] = ch.Digest.String()\n\t\t\t\t\tfields = append(fields, \"labels.\"+key)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_, err := manager.Update(ctx, info, fields...)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\treturn children, err\n\t}\n}\n\n// FilterPlatforms is a handler wrapper which limits the descriptors returned\n// based on matching the specified platform matcher.\nfunc FilterPlatforms(f HandlerFunc, m platforms.Matcher) HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn children, err\n\t\t}\n\n\t\tvar descs []ocispec.Descriptor\n\n\t\tif m == nil {\n\t\t\tdescs = children\n\t\t} else {\n\t\t\tfor _, d := range children {\n\t\t\t\tif d.Platform == nil || m.Match(*d.Platform) {\n\t\t\t\t\tdescs = append(descs, d)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn descs, nil\n\t}\n}\n\n// LimitManifests is a handler wrapper which filters the manifest descriptors\n// returned using the provided platform.\n// The results will be ordered according to the comparison operator and\n// use the ordering in the manifests for equal matches.\n// A limit of 0 or less is considered no limit.\n// A not found error is returned if no manifest is matched.\nfunc LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn children, err\n\t\t}\n\n\t\t// only limit manifests from an index\n\t\tif IsIndexType(desc.MediaType) {\n\t\t\tsort.SliceStable(children, func(i, j int) bool {\n\t\t\t\tif children[i].Platform == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif children[j].Platform == nil {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn m.Less(*children[i].Platform, *children[j].Platform)\n\t\t\t})\n\n\t\t\tif n > 0 {\n\t\t\t\tif len(children) == 0 {\n\t\t\t\t\treturn children, fmt.Errorf(\"no match for platform in manifest: %w\", errdefs.ErrNotFound)\n\t\t\t\t}\n\t\t\t\tif len(children) > n {\n\t\t\t\t\tchildren = children[:n]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn children, nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/image.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/containerd/platforms\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// Image provides the model for how containerd views container images.\ntype Image struct {\n\t// Name of the image.\n\t//\n\t// To be pulled, it must be a reference compatible with resolvers.\n\t//\n\t// This field is required.\n\tName string\n\n\t// Labels provide runtime decoration for the image record.\n\t//\n\t// There is no default behavior for how these labels are propagated. They\n\t// only decorate the static metadata object.\n\t//\n\t// This field is optional.\n\tLabels map[string]string\n\n\t// Target describes the root content for this image. Typically, this is\n\t// a manifest, index or manifest list.\n\tTarget ocispec.Descriptor\n\n\tCreatedAt, UpdatedAt time.Time\n}\n\n// DeleteOptions provide options on image delete\ntype DeleteOptions struct {\n\tSynchronous bool\n\tTarget      *ocispec.Descriptor\n}\n\n// DeleteOpt allows configuring a delete operation\ntype DeleteOpt func(context.Context, *DeleteOptions) error\n\n// SynchronousDelete is used to indicate that an image deletion and removal of\n// the image resources should occur synchronously before returning a result.\nfunc SynchronousDelete() DeleteOpt {\n\treturn func(ctx context.Context, o *DeleteOptions) error {\n\t\to.Synchronous = true\n\t\treturn nil\n\t}\n}\n\n// DeleteTarget is used to specify the target value an image is expected\n// to have when deleting. If the image has a different target, then\n// NotFound is returned.\nfunc DeleteTarget(target *ocispec.Descriptor) DeleteOpt {\n\treturn func(ctx context.Context, o *DeleteOptions) error {\n\t\to.Target = target\n\t\treturn nil\n\t}\n}\n\n// Store and interact with images\ntype Store interface {\n\tGet(ctx context.Context, name string) (Image, error)\n\tList(ctx context.Context, filters ...string) ([]Image, error)\n\tCreate(ctx context.Context, image Image) (Image, error)\n\n\t// Update will replace the data in the store with the provided image. If\n\t// one or more fieldpaths are provided, only those fields will be updated.\n\tUpdate(ctx context.Context, image Image, fieldpaths ...string) (Image, error)\n\n\tDelete(ctx context.Context, name string, opts ...DeleteOpt) error\n}\n\n// TODO(stevvooe): Many of these functions make strong platform assumptions,\n// which are untrue in a lot of cases. More refactoring must be done here to\n// make this work in all cases.\n\n// Config resolves the image configuration descriptor.\n//\n// The caller can then use the descriptor to resolve and process the\n// configuration of the image.\nfunc (image *Image) Config(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (ocispec.Descriptor, error) {\n\treturn Config(ctx, provider, image.Target, platform)\n}\n\n// RootFS returns the unpacked diffids that make up and images rootfs.\n//\n// These are used to verify that a set of layers unpacked to the expected\n// values.\nfunc (image *Image) RootFS(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) ([]digest.Digest, error) {\n\tdesc, err := image.Config(ctx, provider, platform)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn RootFS(ctx, provider, desc)\n}\n\n// Size returns the total size of an image's packed resources.\nfunc (image *Image) Size(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (int64, error) {\n\tvar size int64\n\treturn size, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tif desc.Size < 0 {\n\t\t\treturn nil, fmt.Errorf(\"invalid size %v in %v (%v)\", desc.Size, desc.Digest, desc.MediaType)\n\t\t}\n\t\tsize += desc.Size\n\t\treturn nil, nil\n\t}), LimitManifests(FilterPlatforms(ChildrenHandler(provider), platform), platform, 1)), image.Target)\n}\n\ntype platformManifest struct {\n\tp *ocispec.Platform\n\tm *ocispec.Manifest\n}\n\n// Manifest resolves a manifest from the image for the given platform.\n//\n// When a manifest descriptor inside of a manifest index does not have\n// a platform defined, the platform from the image config is considered.\n//\n// If the descriptor points to a non-index manifest, then the manifest is\n// unmarshalled and returned without considering the platform inside of the\n// config.\n//\n// TODO(stevvooe): This violates the current platform agnostic approach to this\n// package by returning a specific manifest type. We'll need to refactor this\n// to return a manifest descriptor or decide that we want to bring the API in\n// this direction because this abstraction is not needed.\nfunc Manifest(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Manifest, error) {\n\tvar (\n\t\tlimit    = 1\n\t\tm        []platformManifest\n\t\twasIndex bool\n\t)\n\n\tif err := Walk(ctx, HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tif IsManifestType(desc.MediaType) {\n\t\t\tp, err := content.ReadBlob(ctx, provider, desc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif err := validateMediaType(p, desc.MediaType); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"manifest: invalid desc %s: %w\", desc.Digest, err)\n\t\t\t}\n\n\t\t\tvar manifest ocispec.Manifest\n\t\t\tif err := json.Unmarshal(p, &manifest); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif desc.Digest != image.Digest && platform != nil {\n\t\t\t\tif desc.Platform != nil && !platform.Match(*desc.Platform) {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\n\t\t\t\tif desc.Platform == nil {\n\t\t\t\t\timagePlatform, err := ConfigPlatform(ctx, provider, manifest.Config)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tif !platform.Match(imagePlatform) {\n\t\t\t\t\t\treturn nil, nil\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tm = append(m, platformManifest{\n\t\t\t\tp: desc.Platform,\n\t\t\t\tm: &manifest,\n\t\t\t})\n\n\t\t\treturn nil, nil\n\t\t} else if IsIndexType(desc.MediaType) {\n\t\t\tp, err := content.ReadBlob(ctx, provider, desc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif err := validateMediaType(p, desc.MediaType); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"manifest: invalid desc %s: %w\", desc.Digest, err)\n\t\t\t}\n\n\t\t\tvar idx ocispec.Index\n\t\t\tif err := json.Unmarshal(p, &idx); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif platform == nil {\n\t\t\t\treturn idx.Manifests, nil\n\t\t\t}\n\n\t\t\tvar descs []ocispec.Descriptor\n\t\t\tfor _, d := range idx.Manifests {\n\t\t\t\tif d.Platform == nil || platform.Match(*d.Platform) {\n\t\t\t\t\tdescs = append(descs, d)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsort.SliceStable(descs, func(i, j int) bool {\n\t\t\t\tif descs[i].Platform == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif descs[j].Platform == nil {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn platform.Less(*descs[i].Platform, *descs[j].Platform)\n\t\t\t})\n\n\t\t\twasIndex = true\n\n\t\t\tif len(descs) > limit {\n\t\t\t\treturn descs[:limit], nil\n\t\t\t}\n\t\t\treturn descs, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"unexpected media type %v for %v: %w\", desc.MediaType, desc.Digest, errdefs.ErrNotFound)\n\t}), image); err != nil {\n\t\treturn ocispec.Manifest{}, err\n\t}\n\n\tif len(m) == 0 {\n\t\terr := fmt.Errorf(\"manifest %v: %w\", image.Digest, errdefs.ErrNotFound)\n\t\tif wasIndex {\n\t\t\terr = fmt.Errorf(\"no match for platform in manifest %v: %w\", image.Digest, errdefs.ErrNotFound)\n\t\t}\n\t\treturn ocispec.Manifest{}, err\n\t}\n\treturn *m[0].m, nil\n}\n\n// Config resolves the image configuration descriptor using a content provided\n// to resolve child resources on the image.\n//\n// The caller can then use the descriptor to resolve and process the\n// configuration of the image.\nfunc Config(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Descriptor, error) {\n\tmanifest, err := Manifest(ctx, provider, image, platform)\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, err\n\t}\n\treturn manifest.Config, nil\n}\n\n// Platforms returns one or more platforms supported by the image.\nfunc Platforms(ctx context.Context, provider content.Provider, image ocispec.Descriptor) ([]ocispec.Platform, error) {\n\tvar platformSpecs []ocispec.Platform\n\treturn platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tif desc.Platform != nil {\n\t\t\tif desc.Platform.OS == \"unknown\" || desc.Platform.Architecture == \"unknown\" {\n\t\t\t\treturn nil, ErrSkipDesc\n\t\t\t}\n\t\t\tplatformSpecs = append(platformSpecs, *desc.Platform)\n\t\t\treturn nil, ErrSkipDesc\n\t\t}\n\n\t\tif IsConfigType(desc.MediaType) {\n\t\t\timagePlatform, err := ConfigPlatform(ctx, provider, desc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tplatformSpecs = append(platformSpecs, imagePlatform)\n\t\t}\n\t\treturn nil, nil\n\t}), ChildrenHandler(provider)), image)\n}\n\n// Check returns nil if the all components of an image are available in the\n// provider for the specified platform.\n//\n// If available is true, the caller can assume that required represents the\n// complete set of content required for the image.\n//\n// missing will have the components that are part of required but not available\n// in the provider.\n//\n// If there is a problem resolving content, an error will be returned.\nfunc Check(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (available bool, required, present, missing []ocispec.Descriptor, err error) {\n\tmfst, err := Manifest(ctx, provider, image, platform)\n\tif err != nil {\n\t\tif errdefs.IsNotFound(err) {\n\t\t\treturn false, []ocispec.Descriptor{image}, nil, []ocispec.Descriptor{image}, nil\n\t\t}\n\n\t\treturn false, nil, nil, nil, fmt.Errorf(\"failed to check image %v: %w\", image.Digest, err)\n\t}\n\n\t// TODO(stevvooe): It is possible that referenced components could have\n\t// children, but this is rare. For now, we ignore this and only verify\n\t// that manifest components are present.\n\trequired = append([]ocispec.Descriptor{mfst.Config}, mfst.Layers...)\n\n\tfor _, desc := range required {\n\t\tra, err := provider.ReaderAt(ctx, desc)\n\t\tif err != nil {\n\t\t\tif errdefs.IsNotFound(err) {\n\t\t\t\tmissing = append(missing, desc)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn false, nil, nil, nil, fmt.Errorf(\"failed to check image %v: %w\", desc.Digest, err)\n\t\t\t}\n\t\t}\n\t\tra.Close()\n\t\tpresent = append(present, desc)\n\n\t}\n\n\treturn true, required, present, missing, nil\n}\n\n// Children returns the immediate children of content described by the descriptor.\nfunc Children(ctx context.Context, provider content.Provider, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\tif IsManifestType(desc.MediaType) {\n\t\tp, err := content.ReadBlob(ctx, provider, desc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := validateMediaType(p, desc.MediaType); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"children: invalid desc %s: %w\", desc.Digest, err)\n\t\t}\n\n\t\t// TODO(stevvooe): We just assume oci manifest, for now. There may be\n\t\t// subtle differences from the docker version.\n\t\tvar manifest ocispec.Manifest\n\t\tif err := json.Unmarshal(p, &manifest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn append([]ocispec.Descriptor{manifest.Config}, manifest.Layers...), nil\n\t} else if IsIndexType(desc.MediaType) {\n\t\tp, err := content.ReadBlob(ctx, provider, desc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := validateMediaType(p, desc.MediaType); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"children: invalid desc %s: %w\", desc.Digest, err)\n\t\t}\n\n\t\tvar index ocispec.Index\n\t\tif err := json.Unmarshal(p, &index); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn append([]ocispec.Descriptor{}, index.Manifests...), nil\n\t} else if !IsLayerType(desc.MediaType) && !IsKnownConfig(desc.MediaType) {\n\t\t// Layers and configs are childless data types and should not be logged.\n\t\tlog.G(ctx).Debugf(\"encountered unknown type %v; children may not be fetched\", desc.MediaType)\n\t}\n\treturn nil, nil\n}\n\n// unknownDocument represents a manifest, manifest list, or index that has not\n// yet been validated.\ntype unknownDocument struct {\n\tMediaType string          `json:\"mediaType,omitempty\"`\n\tConfig    json.RawMessage `json:\"config,omitempty\"`\n\tLayers    json.RawMessage `json:\"layers,omitempty\"`\n\tManifests json.RawMessage `json:\"manifests,omitempty\"`\n\tFSLayers  json.RawMessage `json:\"fsLayers,omitempty\"` // schema 1\n}\n\n// validateMediaType returns an error if the byte slice is invalid JSON,\n// if the format of the blob is not supported, or if the media type\n// identifies the blob as one format, but it identifies itself as, or\n// contains elements of another format.\nfunc validateMediaType(b []byte, mt string) error {\n\tvar doc unknownDocument\n\tif err := json.Unmarshal(b, &doc); err != nil {\n\t\treturn err\n\t}\n\tif len(doc.FSLayers) != 0 {\n\t\treturn fmt.Errorf(\"media-type: schema 1 not supported\")\n\t}\n\tif IsManifestType(mt) && (len(doc.Manifests) != 0 || IsIndexType(doc.MediaType)) {\n\t\treturn fmt.Errorf(\"media-type: expected manifest but found index (%s)\", mt)\n\t} else if IsIndexType(mt) && (len(doc.Config) != 0 || len(doc.Layers) != 0 || IsManifestType(doc.MediaType)) {\n\t\treturn fmt.Errorf(\"media-type: expected index but found manifest (%s)\", mt)\n\t}\n\treturn nil\n}\n\n// RootFS returns the unpacked diffids that make up and images rootfs.\n//\n// These are used to verify that a set of layers unpacked to the expected\n// values.\nfunc RootFS(ctx context.Context, provider content.Provider, configDesc ocispec.Descriptor) ([]digest.Digest, error) {\n\tp, err := content.ReadBlob(ctx, provider, configDesc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar config ocispec.Image\n\tif err := json.Unmarshal(p, &config); err != nil {\n\t\treturn nil, err\n\t}\n\treturn config.RootFS.DiffIDs, nil\n}\n\n// ConfigPlatform returns a normalized platform from an image manifest config.\nfunc ConfigPlatform(ctx context.Context, provider content.Provider, configDesc ocispec.Descriptor) (ocispec.Platform, error) {\n\tp, err := content.ReadBlob(ctx, provider, configDesc)\n\tif err != nil {\n\t\treturn ocispec.Platform{}, err\n\t}\n\n\t// Technically, this should be ocispec.Image, but we only need the\n\t// ocispec.Platform that is embedded in the image struct.\n\tvar imagePlatform ocispec.Platform\n\tif err := json.Unmarshal(p, &imagePlatform); err != nil {\n\t\treturn ocispec.Platform{}, err\n\t}\n\treturn platforms.Normalize(imagePlatform), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/importexport.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// Importer is the interface for image importer.\ntype Importer interface {\n\t// Import imports an image from a tar stream.\n\tImport(ctx context.Context, store content.Store, reader io.Reader) (ocispec.Descriptor, error)\n}\n\n// Exporter is the interface for image exporter.\ntype Exporter interface {\n\t// Export exports an image to a tar stream.\n\tExport(ctx context.Context, store content.Provider, desc ocispec.Descriptor, writer io.Writer) error\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/labels.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nconst (\n\tConvertedDockerSchema1LabelKey = \"io.containerd.image/converted-docker-schema1\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/images/mediatypes.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage images\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/containerd/errdefs\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// mediatype definitions for image components handled in containerd.\n//\n// oci components are generally referenced directly, although we may centralize\n// here for clarity.\nconst (\n\tMediaTypeDockerSchema2Layer            = \"application/vnd.docker.image.rootfs.diff.tar\"\n\tMediaTypeDockerSchema2LayerForeign     = \"application/vnd.docker.image.rootfs.foreign.diff.tar\"\n\tMediaTypeDockerSchema2LayerGzip        = \"application/vnd.docker.image.rootfs.diff.tar.gzip\"\n\tMediaTypeDockerSchema2LayerZstd        = \"application/vnd.docker.image.rootfs.diff.tar.zstd\"\n\tMediaTypeDockerSchema2LayerForeignGzip = \"application/vnd.docker.image.rootfs.foreign.diff.tar.gzip\"\n\tMediaTypeDockerSchema2Config           = \"application/vnd.docker.container.image.v1+json\"\n\tMediaTypeDockerSchema2Manifest         = \"application/vnd.docker.distribution.manifest.v2+json\"\n\tMediaTypeDockerSchema2ManifestList     = \"application/vnd.docker.distribution.manifest.list.v2+json\"\n\n\t// Checkpoint/Restore Media Types\n\n\tMediaTypeContainerd1Checkpoint               = \"application/vnd.containerd.container.criu.checkpoint.criu.tar\"\n\tMediaTypeContainerd1CheckpointPreDump        = \"application/vnd.containerd.container.criu.checkpoint.predump.tar\"\n\tMediaTypeContainerd1Resource                 = \"application/vnd.containerd.container.resource.tar\"\n\tMediaTypeContainerd1RW                       = \"application/vnd.containerd.container.rw.tar\"\n\tMediaTypeContainerd1CheckpointConfig         = \"application/vnd.containerd.container.checkpoint.config.v1+proto\"\n\tMediaTypeContainerd1CheckpointOptions        = \"application/vnd.containerd.container.checkpoint.options.v1+proto\"\n\tMediaTypeContainerd1CheckpointRuntimeName    = \"application/vnd.containerd.container.checkpoint.runtime.name\"\n\tMediaTypeContainerd1CheckpointRuntimeOptions = \"application/vnd.containerd.container.checkpoint.runtime.options+proto\"\n\n\t// MediaTypeDockerSchema1Manifest is the legacy Docker schema1 manifest\n\tMediaTypeDockerSchema1Manifest = \"application/vnd.docker.distribution.manifest.v1+prettyjws\"\n\n\t// Encrypted media types\n\n\tMediaTypeImageLayerEncrypted     = ocispec.MediaTypeImageLayer + \"+encrypted\"\n\tMediaTypeImageLayerGzipEncrypted = ocispec.MediaTypeImageLayerGzip + \"+encrypted\"\n)\n\n// DiffCompression returns the compression as defined by the layer diff media\n// type. For Docker media types without compression, \"unknown\" is returned to\n// indicate that the media type may be compressed. If the media type is not\n// recognized as a layer diff, then it returns errdefs.ErrNotImplemented\nfunc DiffCompression(ctx context.Context, mediaType string) (string, error) {\n\tbase, ext := parseMediaTypes(mediaType)\n\tswitch base {\n\tcase MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerForeign:\n\t\tif len(ext) > 0 {\n\t\t\t// Type is wrapped\n\t\t\treturn \"\", nil\n\t\t}\n\t\t// These media types may have been compressed but failed to\n\t\t// use the correct media type. The decompression function\n\t\t// should detect and handle this case.\n\t\treturn \"unknown\", nil\n\tcase MediaTypeDockerSchema2LayerGzip, MediaTypeDockerSchema2LayerForeignGzip:\n\t\tif len(ext) > 0 {\n\t\t\t// Type is wrapped\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn \"gzip\", nil\n\tcase MediaTypeDockerSchema2LayerZstd:\n\t\tif len(ext) > 0 {\n\t\t\t// Type is wrapped\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn \"zstd\", nil\n\tcase ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // Non-distributable layers are deprecated\n\t\tif len(ext) > 0 {\n\t\t\tswitch ext[len(ext)-1] {\n\t\t\tcase \"gzip\":\n\t\t\t\treturn \"gzip\", nil\n\t\t\tcase \"zstd\":\n\t\t\t\treturn \"zstd\", nil\n\t\t\t}\n\t\t}\n\t\treturn \"\", nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unrecognised mediatype %s: %w\", mediaType, errdefs.ErrNotImplemented)\n\t}\n}\n\n// parseMediaTypes splits the media type into the base type and\n// an array of sorted extensions\nfunc parseMediaTypes(mt string) (mediaType string, suffixes []string) {\n\tif mt == \"\" {\n\t\treturn \"\", []string{}\n\t}\n\tmediaType, ext, ok := strings.Cut(mt, \"+\")\n\tif !ok {\n\t\treturn mediaType, []string{}\n\t}\n\n\t// Splitting the extensions following the mediatype \"(+)gzip+encrypted\".\n\t// We expect this to be a limited list, so add an arbitrary limit (50).\n\t//\n\t// Note that DiffCompression is only using the last element, so perhaps we\n\t// should split on the last \"+\" only.\n\tsuffixes = strings.SplitN(ext, \"+\", 50)\n\tsort.Strings(suffixes)\n\treturn mediaType, suffixes\n}\n\n// IsNonDistributable returns true if the media type is non-distributable.\nfunc IsNonDistributable(mt string) bool {\n\treturn strings.HasPrefix(mt, \"application/vnd.oci.image.layer.nondistributable.\") ||\n\t\tstrings.HasPrefix(mt, \"application/vnd.docker.image.rootfs.foreign.\")\n}\n\n// IsLayerType returns true if the media type is a layer\nfunc IsLayerType(mt string) bool {\n\tif strings.HasPrefix(mt, \"application/vnd.oci.image.layer.\") {\n\t\treturn true\n\t}\n\n\t// Parse Docker media types, strip off any + suffixes first\n\tswitch base, _ := parseMediaTypes(mt); base {\n\tcase MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerGzip,\n\t\tMediaTypeDockerSchema2LayerForeign, MediaTypeDockerSchema2LayerForeignGzip, MediaTypeDockerSchema2LayerZstd:\n\t\treturn true\n\t}\n\treturn false\n}\n\n// IsDockerType returns true if the media type has \"application/vnd.docker.\" prefix\nfunc IsDockerType(mt string) bool {\n\treturn strings.HasPrefix(mt, \"application/vnd.docker.\")\n}\n\n// IsManifestType returns true if the media type is an OCI-compatible manifest.\n// No support for schema1 manifest.\nfunc IsManifestType(mt string) bool {\n\tswitch mt {\n\tcase MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// IsIndexType returns true if the media type is an OCI-compatible index.\nfunc IsIndexType(mt string) bool {\n\tswitch mt {\n\tcase ocispec.MediaTypeImageIndex, MediaTypeDockerSchema2ManifestList:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// IsConfigType returns true if the media type is an OCI-compatible image config.\n// No support for containerd checkpoint configs.\nfunc IsConfigType(mt string) bool {\n\tswitch mt {\n\tcase MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// IsKnownConfig returns true if the media type is a known config type,\n// including containerd checkpoint configs\nfunc IsKnownConfig(mt string) bool {\n\tswitch mt {\n\tcase MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig,\n\t\tMediaTypeContainerd1Checkpoint, MediaTypeContainerd1CheckpointConfig:\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChildGCLabels returns the label for a given descriptor to reference it\nfunc ChildGCLabels(desc ocispec.Descriptor) []string {\n\tmt := desc.MediaType\n\tif IsKnownConfig(mt) {\n\t\treturn []string{\"containerd.io/gc.ref.content.config\"}\n\t}\n\n\tswitch mt {\n\tcase MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:\n\t\treturn []string{\"containerd.io/gc.ref.content.m.\"}\n\t}\n\n\tif IsLayerType(mt) {\n\t\treturn []string{\"containerd.io/gc.ref.content.l.\"}\n\t}\n\n\treturn []string{\"containerd.io/gc.ref.content.\"}\n}\n\n// ChildGCLabelsFilterLayers returns the labels for a given descriptor to\n// reference it, skipping layer media types\nfunc ChildGCLabelsFilterLayers(desc ocispec.Descriptor) []string {\n\tif IsLayerType(desc.MediaType) {\n\t\treturn nil\n\t}\n\treturn ChildGCLabels(desc)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/leases/context.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage leases\n\nimport \"context\"\n\ntype leaseKey struct{}\n\n// WithLease sets a given lease on the context\nfunc WithLease(ctx context.Context, lid string) context.Context {\n\tctx = context.WithValue(ctx, leaseKey{}, lid)\n\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withGRPCLeaseHeader(ctx, lid)\n}\n\n// FromContext returns the lease from the context.\nfunc FromContext(ctx context.Context) (string, bool) {\n\tlid, ok := ctx.Value(leaseKey{}).(string)\n\tif !ok {\n\t\treturn fromGRPCHeader(ctx)\n\t}\n\n\treturn lid, ok\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/leases/grpc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage leases\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/grpc/metadata\"\n)\n\nconst (\n\t// GRPCHeader defines the header name for specifying a containerd lease.\n\tGRPCHeader = \"containerd-lease\"\n)\n\nfunc withGRPCLeaseHeader(ctx context.Context, lid string) context.Context {\n\t// also store on the grpc headers so it gets picked up by any clients\n\t// that are using this.\n\ttxheader := metadata.Pairs(GRPCHeader, lid)\n\tmd, ok := metadata.FromOutgoingContext(ctx) // merge with outgoing context.\n\tif !ok {\n\t\tmd = txheader\n\t} else {\n\t\t// order ensures the latest is first in this list.\n\t\tmd = metadata.Join(txheader, md)\n\t}\n\n\treturn metadata.NewOutgoingContext(ctx, md)\n}\n\nfunc fromGRPCHeader(ctx context.Context) (string, bool) {\n\t// try to extract for use in grpc servers.\n\tmd, ok := metadata.FromIncomingContext(ctx)\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\n\tvalues := md[GRPCHeader]\n\tif len(values) == 0 {\n\t\treturn \"\", false\n\t}\n\n\treturn values[0], true\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/leases/id.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage leases\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// WithRandomID sets the lease ID to a random unique value\nfunc WithRandomID() Opt {\n\treturn func(l *Lease) error {\n\t\tt := time.Now()\n\t\tvar b [3]byte\n\t\trand.Read(b[:])\n\t\tl.ID = fmt.Sprintf(\"%d-%s\", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:]))\n\t\treturn nil\n\t}\n}\n\n// WithID sets the ID for the lease\nfunc WithID(id string) Opt {\n\treturn func(l *Lease) error {\n\t\tl.ID = id\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/leases/lease.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage leases\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\n// Opt is used to set options on a lease\ntype Opt func(*Lease) error\n\n// DeleteOpt allows configuring a delete operation\ntype DeleteOpt func(context.Context, *DeleteOptions) error\n\n// Manager is used to create, list, and remove leases\ntype Manager interface {\n\tCreate(context.Context, ...Opt) (Lease, error)\n\tDelete(context.Context, Lease, ...DeleteOpt) error\n\tList(context.Context, ...string) ([]Lease, error)\n\tAddResource(context.Context, Lease, Resource) error\n\tDeleteResource(context.Context, Lease, Resource) error\n\tListResources(context.Context, Lease) ([]Resource, error)\n}\n\n// Lease retains resources to prevent cleanup before\n// the resources can be fully referenced.\ntype Lease struct {\n\tID        string\n\tCreatedAt time.Time\n\tLabels    map[string]string\n}\n\n// Resource represents low level resource of image, like content, ingest and\n// snapshotter.\ntype Resource struct {\n\tID   string\n\tType string\n}\n\n// DeleteOptions provide options on image delete\ntype DeleteOptions struct {\n\tSynchronous bool\n}\n\n// SynchronousDelete is used to indicate that a lease deletion and removal of\n// any unreferenced resources should occur synchronously before returning the\n// result.\nfunc SynchronousDelete(ctx context.Context, o *DeleteOptions) error {\n\to.Synchronous = true\n\treturn nil\n}\n\n// WithLabel sets a label on a lease, and merges it with existing labels.\n// It overwrites the existing value of the given label (if present).\nfunc WithLabel(label, value string) Opt {\n\treturn func(l *Lease) error {\n\t\tif l.Labels == nil {\n\t\t\tl.Labels = map[string]string{label: value}\n\t\t\treturn nil\n\t\t}\n\t\tl.Labels[label] = value\n\t\treturn nil\n\t}\n}\n\n// WithLabels merges labels on a lease\nfunc WithLabels(labels map[string]string) Opt {\n\treturn func(l *Lease) error {\n\t\tif l.Labels == nil {\n\t\t\tl.Labels = map[string]string{}\n\t\t}\n\t\tfor k, v := range labels {\n\t\t\tl.Labels[k] = v\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// WithExpiration sets an expiration on the lease\nfunc WithExpiration(d time.Duration) Opt {\n\treturn func(l *Lease) error {\n\t\tif l.Labels == nil {\n\t\t\tl.Labels = map[string]string{}\n\t\t}\n\t\tl.Labels[\"containerd.io/gc.expire\"] = time.Now().Add(d).Format(time.RFC3339)\n\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage auth\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n\n\tremoteserrors \"github.com/containerd/containerd/v2/core/remotes/errors\"\n\t\"github.com/containerd/containerd/v2/pkg/tracing\"\n\t\"github.com/containerd/containerd/v2/version\"\n\t\"github.com/containerd/log\"\n)\n\nvar (\n\t// ErrNoToken is returned if a request is successful but the body does not\n\t// contain an authorization token.\n\tErrNoToken = errors.New(\"authorization server did not include a token in the response\")\n)\n\n// GenerateTokenOptions generates options for fetching a token based on a challenge\nfunc GenerateTokenOptions(ctx context.Context, host, username, secret string, c Challenge) (TokenOptions, error) {\n\trealm, ok := c.Parameters[\"realm\"]\n\tif !ok {\n\t\treturn TokenOptions{}, errors.New(\"no realm specified for token auth challenge\")\n\t}\n\n\trealmURL, err := url.Parse(realm)\n\tif err != nil {\n\t\treturn TokenOptions{}, fmt.Errorf(\"invalid token auth challenge realm: %w\", err)\n\t}\n\n\tto := TokenOptions{\n\t\tRealm:    realmURL.String(),\n\t\tService:  c.Parameters[\"service\"],\n\t\tUsername: username,\n\t\tSecret:   secret,\n\t}\n\n\tscope, ok := c.Parameters[\"scope\"]\n\tif ok {\n\t\tto.Scopes = append(to.Scopes, strings.Split(scope, \" \")...)\n\t} else {\n\t\tlog.G(ctx).WithField(\"host\", host).Debug(\"no scope specified for token auth challenge\")\n\t}\n\n\treturn to, nil\n}\n\n// TokenOptions are options for requesting a token\ntype TokenOptions struct {\n\tRealm    string\n\tService  string\n\tScopes   []string\n\tUsername string\n\tSecret   string\n\n\t// FetchRefreshToken enables fetching a refresh token (aka \"identity token\", \"offline token\") along with the bearer token.\n\t//\n\t// For HTTP GET mode (FetchToken), FetchRefreshToken sets `offline_token=true` in the request.\n\t// https://docs.docker.com/registry/spec/auth/token/#requesting-a-token\n\t//\n\t// For HTTP POST mode (FetchTokenWithOAuth), FetchRefreshToken sets `access_type=offline` in the request.\n\t// https://docs.docker.com/registry/spec/auth/oauth/#getting-a-token\n\tFetchRefreshToken bool\n}\n\n// OAuthTokenResponse is response from fetching token with a OAuth POST request\ntype OAuthTokenResponse struct {\n\tAccessToken      string    `json:\"access_token\"`\n\tRefreshToken     string    `json:\"refresh_token\"`\n\tExpiresInSeconds int       `json:\"expires_in\"`\n\tIssuedAt         time.Time `json:\"issued_at\"`\n\tScope            string    `json:\"scope\"`\n}\n\n// FetchTokenWithOAuth fetches a token using a POST request\nfunc FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http.Header, clientID string, to TokenOptions) (*OAuthTokenResponse, error) {\n\tc := *client\n\tclient = &c\n\ttracing.UpdateHTTPClient(client, tracing.Name(\"remotes.docker.resolver\", \"FetchTokenWithOAuth\"))\n\n\tform := url.Values{}\n\tif len(to.Scopes) > 0 {\n\t\tform.Set(\"scope\", strings.Join(to.Scopes, \" \"))\n\t}\n\tform.Set(\"service\", to.Service)\n\tform.Set(\"client_id\", clientID)\n\n\tif to.Username == \"\" {\n\t\tform.Set(\"grant_type\", \"refresh_token\")\n\t\tform.Set(\"refresh_token\", to.Secret)\n\t} else {\n\t\tform.Set(\"grant_type\", \"password\")\n\t\tform.Set(\"username\", to.Username)\n\t\tform.Set(\"password\", to.Secret)\n\t}\n\tif to.FetchRefreshToken {\n\t\tform.Set(\"access_type\", \"offline\")\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, to.Realm, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; charset=utf-8\")\n\tfor k, v := range headers {\n\t\treq.Header[k] = append(req.Header[k], v...)\n\t}\n\tif len(req.Header.Get(\"User-Agent\")) == 0 {\n\t\treq.Header.Set(\"User-Agent\", \"containerd/\"+version.Version)\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 400 {\n\t\treturn nil, remoteserrors.NewUnexpectedStatusErr(resp)\n\t}\n\n\tdecoder := json.NewDecoder(resp.Body)\n\n\tvar tr OAuthTokenResponse\n\tif err = decoder.Decode(&tr); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to decode token response: %w\", err)\n\t}\n\n\tif tr.AccessToken == \"\" {\n\t\treturn nil, ErrNoToken\n\t}\n\n\treturn &tr, nil\n}\n\n// FetchTokenResponse is response from fetching token with GET request\ntype FetchTokenResponse struct {\n\tToken            string    `json:\"token\"`\n\tAccessToken      string    `json:\"access_token\"`\n\tExpiresInSeconds int       `json:\"expires_in\"`\n\tIssuedAt         time.Time `json:\"issued_at\"`\n\tRefreshToken     string    `json:\"refresh_token\"`\n}\n\n// FetchToken fetches a token using a GET request\nfunc FetchToken(ctx context.Context, client *http.Client, headers http.Header, to TokenOptions) (*FetchTokenResponse, error) {\n\tc := *client\n\tclient = &c\n\ttracing.UpdateHTTPClient(client, tracing.Name(\"remotes.docker.resolver\", \"FetchToken\"))\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, to.Realm, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor k, v := range headers {\n\t\treq.Header[k] = append(req.Header[k], v...)\n\t}\n\tif len(req.Header.Get(\"User-Agent\")) == 0 {\n\t\treq.Header.Set(\"User-Agent\", \"containerd/\"+version.Version)\n\t}\n\n\treqParams := req.URL.Query()\n\n\tif to.Service != \"\" {\n\t\treqParams.Add(\"service\", to.Service)\n\t}\n\n\tfor _, scope := range to.Scopes {\n\t\treqParams.Add(\"scope\", scope)\n\t}\n\n\tif to.Secret != \"\" {\n\t\treq.SetBasicAuth(to.Username, to.Secret)\n\t}\n\n\tif to.FetchRefreshToken {\n\t\treqParams.Add(\"offline_token\", \"true\")\n\t}\n\n\treq.URL.RawQuery = reqParams.Encode()\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 400 {\n\t\treturn nil, remoteserrors.NewUnexpectedStatusErr(resp)\n\t}\n\n\tdecoder := json.NewDecoder(resp.Body)\n\n\tvar tr FetchTokenResponse\n\tif err = decoder.Decode(&tr); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to decode token response: %w\", err)\n\t}\n\n\t// `access_token` is equivalent to `token` and if both are specified\n\t// the choice is undefined.  Canonicalize `access_token` by sticking\n\t// things in `token`.\n\tif tr.AccessToken != \"\" {\n\t\ttr.Token = tr.AccessToken\n\t}\n\n\tif tr.Token == \"\" {\n\t\treturn nil, ErrNoToken\n\t}\n\n\treturn &tr, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/parse.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage auth\n\nimport (\n\t\"net/http\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// AuthenticationScheme defines scheme of the authentication method\ntype AuthenticationScheme byte\n\nconst (\n\t// BasicAuth is scheme for Basic HTTP Authentication RFC 7617\n\tBasicAuth AuthenticationScheme = 1 << iota\n\t// DigestAuth is scheme for HTTP Digest Access Authentication RFC 7616\n\tDigestAuth\n\t// BearerAuth is scheme for OAuth 2.0 Bearer Tokens RFC 6750\n\tBearerAuth\n)\n\n// Challenge carries information from a WWW-Authenticate response header.\n// See RFC 2617.\ntype Challenge struct {\n\t// scheme is the auth-scheme according to RFC 2617\n\tScheme AuthenticationScheme\n\n\t// parameters are the auth-params according to RFC 2617\n\tParameters map[string]string\n}\n\ntype byScheme []Challenge\n\nfunc (bs byScheme) Len() int      { return len(bs) }\nfunc (bs byScheme) Swap(i, j int) { bs[i], bs[j] = bs[j], bs[i] }\n\n// Less sorts in priority order: token > digest > basic\nfunc (bs byScheme) Less(i, j int) bool { return bs[i].Scheme > bs[j].Scheme }\n\n// Octet types from RFC 2616.\ntype octetType byte\n\nvar octetTypes [256]octetType\n\nconst (\n\tisToken octetType = 1 << iota\n\tisSpace\n)\n\nfunc init() {\n\t// OCTET      = <any 8-bit sequence of data>\n\t// CHAR       = <any US-ASCII character (octets 0 - 127)>\n\t// CTL        = <any US-ASCII control character (octets 0 - 31) and DEL (127)>\n\t// CR         = <US-ASCII CR, carriage return (13)>\n\t// LF         = <US-ASCII LF, linefeed (10)>\n\t// SP         = <US-ASCII SP, space (32)>\n\t// HT         = <US-ASCII HT, horizontal-tab (9)>\n\t// <\">        = <US-ASCII double-quote mark (34)>\n\t// CRLF       = CR LF\n\t// LWS        = [CRLF] 1*( SP | HT )\n\t// TEXT       = <any OCTET except CTLs, but including LWS>\n\t// separators = \"(\" | \")\" | \"<\" | \">\" | \"@\" | \",\" | \";\" | \":\" | \"\\\" | <\">\n\t//              | \"/\" | \"[\" | \"]\" | \"?\" | \"=\" | \"{\" | \"}\" | SP | HT\n\t// token      = 1*<any CHAR except CTLs or separators>\n\t// qdtext     = <any TEXT except <\">>\n\n\tfor c := 0; c < 256; c++ {\n\t\tvar t octetType\n\t\tisCtl := c <= 31 || c == 127\n\t\tisChar := 0 <= c && c <= 127\n\t\tisSeparator := strings.ContainsRune(\" \\t\\\"(),/:;<=>?@[]\\\\{}\", rune(c))\n\t\tif strings.ContainsRune(\" \\t\\r\\n\", rune(c)) {\n\t\t\tt |= isSpace\n\t\t}\n\t\tif isChar && !isCtl && !isSeparator {\n\t\t\tt |= isToken\n\t\t}\n\t\toctetTypes[c] = t\n\t}\n}\n\n// ParseAuthHeader parses challenges from WWW-Authenticate header\nfunc ParseAuthHeader(header http.Header) []Challenge {\n\tchallenges := []Challenge{}\n\tfor _, h := range header[http.CanonicalHeaderKey(\"WWW-Authenticate\")] {\n\t\tv, p := parseValueAndParams(h)\n\t\tvar s AuthenticationScheme\n\t\tswitch v {\n\t\tcase \"basic\":\n\t\t\ts = BasicAuth\n\t\tcase \"digest\":\n\t\t\ts = DigestAuth\n\t\tcase \"bearer\":\n\t\t\ts = BearerAuth\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t\tchallenges = append(challenges, Challenge{Scheme: s, Parameters: p})\n\t}\n\tsort.Stable(byScheme(challenges))\n\treturn challenges\n}\n\nfunc parseValueAndParams(header string) (value string, params map[string]string) {\n\tparams = make(map[string]string)\n\tvalue, s := expectToken(header)\n\tif value == \"\" {\n\t\treturn\n\t}\n\tvalue = strings.ToLower(value)\n\tfor {\n\t\tvar pkey string\n\t\tpkey, s = expectToken(skipSpace(s))\n\t\tif pkey == \"\" {\n\t\t\treturn\n\t\t}\n\t\tif !strings.HasPrefix(s, \"=\") {\n\t\t\treturn\n\t\t}\n\t\tvar pvalue string\n\t\tpvalue, s = expectTokenOrQuoted(s[1:])\n\t\tpkey = strings.ToLower(pkey)\n\t\tparams[pkey] = pvalue\n\t\ts = skipSpace(s)\n\t\tif !strings.HasPrefix(s, \",\") {\n\t\t\treturn\n\t\t}\n\t\ts = s[1:]\n\t}\n}\n\nfunc skipSpace(s string) (rest string) {\n\ti := 0\n\tfor ; i < len(s); i++ {\n\t\tif octetTypes[s[i]]&isSpace == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn s[i:]\n}\n\nfunc expectToken(s string) (token, rest string) {\n\ti := 0\n\tfor ; i < len(s); i++ {\n\t\tif octetTypes[s[i]]&isToken == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn s[:i], s[i:]\n}\n\nfunc expectTokenOrQuoted(s string) (value string, rest string) {\n\tif !strings.HasPrefix(s, \"\\\"\") {\n\t\treturn expectToken(s)\n\t}\n\ts = s[1:]\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '\"':\n\t\t\treturn s[:i], s[i+1:]\n\t\tcase '\\\\':\n\t\t\tp := make([]byte, len(s)-1)\n\t\t\tj := copy(p, s[:i])\n\t\t\tescape := true\n\t\t\tfor i = i + 1; i < len(s); i++ {\n\t\t\t\tb := s[i]\n\t\t\t\tswitch {\n\t\t\t\tcase escape:\n\t\t\t\t\tescape = false\n\t\t\t\t\tp[j] = b\n\t\t\t\t\tj++\n\t\t\t\tcase b == '\\\\':\n\t\t\t\t\tescape = true\n\t\t\t\tcase b == '\"':\n\t\t\t\t\treturn string(p[:j]), s[i+1:]\n\t\t\t\tdefault:\n\t\t\t\t\tp[j] = b\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\", \"\"\n\t\t}\n\t}\n\treturn \"\", \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/containerd/v2/core/remotes/docker/auth\"\n\tremoteerrors \"github.com/containerd/containerd/v2/core/remotes/errors\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n)\n\ntype dockerAuthorizer struct {\n\tcredentials func(string) (string, string, error)\n\n\tclient *http.Client\n\theader http.Header\n\tmu     sync.RWMutex\n\n\t// indexed by host name\n\thandlers map[string]*authHandler\n\n\tonFetchRefreshToken OnFetchRefreshToken\n}\n\ntype authorizerConfig struct {\n\tcredentials         func(string) (string, string, error)\n\tclient              *http.Client\n\theader              http.Header\n\tonFetchRefreshToken OnFetchRefreshToken\n}\n\n// AuthorizerOpt configures an authorizer\ntype AuthorizerOpt func(*authorizerConfig)\n\n// WithAuthClient provides the HTTP client for the authorizer\nfunc WithAuthClient(client *http.Client) AuthorizerOpt {\n\treturn func(opt *authorizerConfig) {\n\t\topt.client = client\n\t}\n}\n\n// WithAuthCreds provides a credential function to the authorizer\nfunc WithAuthCreds(creds func(string) (string, string, error)) AuthorizerOpt {\n\treturn func(opt *authorizerConfig) {\n\t\topt.credentials = creds\n\t}\n}\n\n// WithAuthHeader provides HTTP headers for authorization\nfunc WithAuthHeader(hdr http.Header) AuthorizerOpt {\n\treturn func(opt *authorizerConfig) {\n\t\topt.header = hdr\n\t}\n}\n\n// OnFetchRefreshToken is called on fetching request token.\ntype OnFetchRefreshToken func(ctx context.Context, refreshToken string, req *http.Request)\n\n// WithFetchRefreshToken enables fetching \"refresh token\" (aka \"identity token\", \"offline token\").\nfunc WithFetchRefreshToken(f OnFetchRefreshToken) AuthorizerOpt {\n\treturn func(opt *authorizerConfig) {\n\t\topt.onFetchRefreshToken = f\n\t}\n}\n\n// NewDockerAuthorizer creates an authorizer using Docker's registry\n// authentication spec.\n// See https://docs.docker.com/registry/spec/auth/\nfunc NewDockerAuthorizer(opts ...AuthorizerOpt) Authorizer {\n\tvar ao authorizerConfig\n\tfor _, opt := range opts {\n\t\topt(&ao)\n\t}\n\n\tif ao.client == nil {\n\t\tao.client = http.DefaultClient\n\t}\n\n\treturn &dockerAuthorizer{\n\t\tcredentials:         ao.credentials,\n\t\tclient:              ao.client,\n\t\theader:              ao.header,\n\t\thandlers:            make(map[string]*authHandler),\n\t\tonFetchRefreshToken: ao.onFetchRefreshToken,\n\t}\n}\n\n// Authorize handles auth request.\nfunc (a *dockerAuthorizer) Authorize(ctx context.Context, req *http.Request) error {\n\t// skip if there is no auth handler\n\tah := a.getAuthHandler(req.URL.Host)\n\tif ah == nil {\n\t\treturn nil\n\t}\n\n\tauth, refreshToken, err := ah.authorize(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"Authorization\", auth)\n\n\tif refreshToken != \"\" {\n\t\ta.mu.RLock()\n\t\tonFetchRefreshToken := a.onFetchRefreshToken\n\t\ta.mu.RUnlock()\n\t\tif onFetchRefreshToken != nil {\n\t\t\tonFetchRefreshToken(ctx, refreshToken, req)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (a *dockerAuthorizer) getAuthHandler(host string) *authHandler {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\n\treturn a.handlers[host]\n}\n\nfunc (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.Response) error {\n\tlast := responses[len(responses)-1]\n\thost := last.Request.URL.Host\n\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tfor _, c := range auth.ParseAuthHeader(last.Header) {\n\t\tif c.Scheme == auth.BearerAuth {\n\t\t\tif retry, err := invalidAuthorization(ctx, c, responses); err != nil {\n\t\t\t\tdelete(a.handlers, host)\n\t\t\t\treturn err\n\t\t\t} else if retry {\n\t\t\t\tdelete(a.handlers, host)\n\t\t\t}\n\n\t\t\t// reuse existing handler\n\t\t\t//\n\t\t\t// assume that one registry will return the common\n\t\t\t// challenge information, including realm and service.\n\t\t\t// and the resource scope is only different part\n\t\t\t// which can be provided by each request.\n\t\t\tif _, ok := a.handlers[host]; ok {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar username, secret string\n\t\t\tif a.credentials != nil {\n\t\t\t\tvar err error\n\t\t\t\tusername, secret, err = a.credentials(host)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcommon, err := auth.GenerateTokenOptions(ctx, host, username, secret, c)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcommon.FetchRefreshToken = a.onFetchRefreshToken != nil\n\n\t\t\ta.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, common)\n\t\t\treturn nil\n\t\t} else if c.Scheme == auth.BasicAuth && a.credentials != nil {\n\t\t\tusername, secret, err := a.credentials(host)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif username == \"\" || secret == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%w: no basic auth credentials\", ErrInvalidAuthorization)\n\t\t\t}\n\n\t\t\ta.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, auth.TokenOptions{\n\t\t\t\tUsername: username,\n\t\t\t\tSecret:   secret,\n\t\t\t})\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"failed to find supported auth scheme: %w\", errdefs.ErrNotImplemented)\n}\n\n// authResult is used to control limit rate.\ntype authResult struct {\n\tsync.WaitGroup\n\ttoken          string\n\trefreshToken   string\n\texpirationTime *time.Time\n\terr            error\n}\n\n// authHandler is used to handle auth request per registry server.\ntype authHandler struct {\n\tsync.Mutex\n\n\theader http.Header\n\n\tclient *http.Client\n\n\t// only support basic and bearer schemes\n\tscheme auth.AuthenticationScheme\n\n\t// common contains common challenge answer\n\tcommon auth.TokenOptions\n\n\t// scopedTokens caches token indexed by scopes, which used in\n\t// bearer auth case\n\tscopedTokens map[string]*authResult\n}\n\nfunc newAuthHandler(client *http.Client, hdr http.Header, scheme auth.AuthenticationScheme, opts auth.TokenOptions) *authHandler {\n\treturn &authHandler{\n\t\theader:       hdr,\n\t\tclient:       client,\n\t\tscheme:       scheme,\n\t\tcommon:       opts,\n\t\tscopedTokens: map[string]*authResult{},\n\t}\n}\n\nfunc (ah *authHandler) authorize(ctx context.Context) (string, string, error) {\n\tswitch ah.scheme {\n\tcase auth.BasicAuth:\n\t\treturn ah.doBasicAuth(ctx)\n\tcase auth.BearerAuth:\n\t\treturn ah.doBearerAuth(ctx)\n\tdefault:\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to find supported auth scheme: %s: %w\", string(ah.scheme), errdefs.ErrNotImplemented)\n\t}\n}\n\nfunc (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) {\n\tusername, secret := ah.common.Username, ah.common.Secret\n\n\tif username == \"\" || secret == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to handle basic auth because missing username or secret\")\n\t}\n\n\tauth := base64.StdEncoding.EncodeToString([]byte(username + \":\" + secret))\n\treturn fmt.Sprintf(\"Basic %s\", auth), \"\", nil\n}\n\nfunc (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken string, err error) {\n\t// copy common tokenOptions\n\tto := ah.common\n\n\tto.Scopes = GetTokenScopes(ctx, to.Scopes)\n\n\t// Docs: https://docs.docker.com/registry/spec/auth/scope\n\tscoped := strings.Join(to.Scopes, \" \")\n\n\t// Keep track of the expiration time of cached bearer tokens so they can be\n\t// refreshed when they expire without a server roundtrip.\n\tvar expirationTime *time.Time\n\n\tah.Lock()\n\tif r, exist := ah.scopedTokens[scoped]; exist && (r.expirationTime == nil || r.expirationTime.After(time.Now())) {\n\t\tah.Unlock()\n\t\tr.Wait()\n\t\treturn r.token, r.refreshToken, r.err\n\t}\n\n\t// only one fetch token job\n\tr := new(authResult)\n\tr.Add(1)\n\tah.scopedTokens[scoped] = r\n\tah.Unlock()\n\n\tdefer func() {\n\t\ttoken = fmt.Sprintf(\"Bearer %s\", token)\n\t\tr.token, r.refreshToken, r.err, r.expirationTime = token, refreshToken, err, expirationTime\n\t\tr.Done()\n\t}()\n\n\t// fetch token for the resource scope\n\tif to.Secret != \"\" {\n\t\tdefer func() {\n\t\t\tif err != nil {\n\t\t\t\terr = fmt.Errorf(\"failed to fetch oauth token: %w\", err)\n\t\t\t}\n\t\t}()\n\t\t// credential information is provided, use oauth POST endpoint\n\t\t// TODO: Allow setting client_id\n\t\tresp, err := auth.FetchTokenWithOAuth(ctx, ah.client, ah.header, \"containerd-client\", to)\n\t\tif err != nil {\n\t\t\tvar errStatus remoteerrors.ErrUnexpectedStatus\n\t\t\tif errors.As(err, &errStatus) {\n\t\t\t\t// Registries without support for POST may return 404 for POST /v2/token.\n\t\t\t\t// As of September 2017, GCR is known to return 404.\n\t\t\t\t// As of February 2018, JFrog Artifactory is known to return 401.\n\t\t\t\t// As of January 2022, ACR is known to return 400.\n\t\t\t\tif (errStatus.StatusCode == 405 && to.Username != \"\") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 || errStatus.StatusCode == 400 {\n\t\t\t\t\tresp, err := auth.FetchToken(ctx, ah.client, ah.header, to)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn \"\", \"\", err\n\t\t\t\t\t}\n\t\t\t\t\texpirationTime = getExpirationTime(resp.ExpiresInSeconds)\n\t\t\t\t\treturn resp.Token, resp.RefreshToken, nil\n\t\t\t\t}\n\t\t\t\tlog.G(ctx).WithFields(log.Fields{\n\t\t\t\t\t\"status\": errStatus.Status,\n\t\t\t\t\t\"body\":   string(errStatus.Body),\n\t\t\t\t}).Debugf(\"token request failed\")\n\t\t\t}\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\texpirationTime = getExpirationTime(resp.ExpiresInSeconds)\n\t\treturn resp.AccessToken, resp.RefreshToken, nil\n\t}\n\t// do request anonymously\n\tresp, err := auth.FetchToken(ctx, ah.client, ah.header, to)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to fetch anonymous token: %w\", err)\n\t}\n\texpirationTime = getExpirationTime(resp.ExpiresInSeconds)\n\treturn resp.Token, resp.RefreshToken, nil\n}\n\nfunc getExpirationTime(expiresInSeconds int) *time.Time {\n\tif expiresInSeconds <= 0 {\n\t\treturn nil\n\t}\n\texpirationTime := time.Now().Add(time.Duration(expiresInSeconds) * time.Second)\n\treturn &expirationTime\n}\n\nfunc invalidAuthorization(ctx context.Context, c auth.Challenge, responses []*http.Response) (retry bool, _ error) {\n\terrStr := c.Parameters[\"error\"]\n\tif errStr == \"\" {\n\t\treturn retry, nil\n\t}\n\n\tn := len(responses)\n\tif n == 1 || (n > 1 && !sameRequest(responses[n-2].Request, responses[n-1].Request)) {\n\t\tlimitedErr := errStr\n\t\terrLenghLimit := 64\n\t\tif len(limitedErr) > errLenghLimit {\n\t\t\tlimitedErr = limitedErr[:errLenghLimit] + \"...\"\n\t\t}\n\t\tlog.G(ctx).WithField(\"error\", limitedErr).Debug(\"authorization error using bearer token, retrying\")\n\t\treturn true, nil\n\t}\n\n\treturn retry, fmt.Errorf(\"server message: %s: %w\", errStr, ErrInvalidAuthorization)\n}\n\nfunc sameRequest(r1, r2 *http.Request) bool {\n\tif r1.Method != r2.Method {\n\t\treturn false\n\t}\n\tif *r1.URL != *r2.URL {\n\t\treturn false\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/core/remotes\"\n\t\"github.com/containerd/log\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// LegacyConfigMediaType should be replaced by OCI image spec.\n//\n// More detail: docker/distribution#1622\nconst LegacyConfigMediaType = \"application/octet-stream\"\n\n// ConvertManifest changes application/octet-stream to schema2 config media type if need.\n//\n// NOTE:\n// 1. original manifest will be deleted by next gc round.\n// 2. don't cover manifest list.\nfunc ConvertManifest(ctx context.Context, store content.Store, desc ocispec.Descriptor) (ocispec.Descriptor, error) {\n\tif !images.IsManifestType(desc.MediaType) {\n\t\tlog.G(ctx).Warnf(\"do nothing for media type: %s\", desc.MediaType)\n\t\treturn desc, nil\n\t}\n\n\t// read manifest data\n\tmb, err := content.ReadBlob(ctx, store, desc)\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to read index data: %w\", err)\n\t}\n\n\tvar manifest ocispec.Manifest\n\tif err := json.Unmarshal(mb, &manifest); err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to unmarshal data into manifest: %w\", err)\n\t}\n\n\t// check config media type\n\tif manifest.Config.MediaType != LegacyConfigMediaType {\n\t\treturn desc, nil\n\t}\n\n\tmanifest.Config.MediaType = images.MediaTypeDockerSchema2Config\n\tdata, err := json.MarshalIndent(manifest, \"\", \"   \")\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to marshal manifest: %w\", err)\n\t}\n\n\t// update manifest with gc labels\n\tdesc.Digest = digest.Canonical.FromBytes(data)\n\tdesc.Size = int64(len(data))\n\n\tlabels := map[string]string{}\n\tfor i, c := range append([]ocispec.Descriptor{manifest.Config}, manifest.Layers...) {\n\t\tlabels[fmt.Sprintf(\"containerd.io/gc.ref.content.%d\", i)] = c.Digest.String()\n\t}\n\n\tref := remotes.MakeRefKey(ctx, desc)\n\tif err := content.WriteBlob(ctx, store, ref, bytes.NewReader(data), desc, content.WithLabels(labels)); err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to update content: %w\", err)\n\t}\n\treturn desc, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter_fuzz.go",
    "content": "//go:build gofuzz\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"github.com/containerd/containerd/v2/plugins/content/local\"\n\t\"github.com/containerd/log\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\nfunc FuzzConvertManifest(data []byte) int {\n\tctx := context.Background()\n\n\t// Do not log the message below\n\t// level=warning msg=\"do nothing for media type: ...\"\n\tlog.G(ctx).Logger.SetLevel(log.PanicLevel)\n\n\tf := fuzz.NewConsumer(data)\n\tdesc := ocispec.Descriptor{}\n\terr := f.GenerateStruct(&desc)\n\tif err != nil {\n\t\treturn 0\n\t}\n\ttmpdir, err := os.MkdirTemp(\"\", \"fuzzing-\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\tcs, err := local.NewStore(tmpdir)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _ = ConvertManifest(ctx, cs, desc)\n\treturn 1\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/errcode.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// ErrorCoder is the base interface for ErrorCode and Error allowing\n// users of each to just call ErrorCode to get the real ID of each\ntype ErrorCoder interface {\n\tErrorCode() ErrorCode\n}\n\n// ErrorCode represents the error type. The errors are serialized via strings\n// and the integer format may change and should *never* be exported.\ntype ErrorCode int\n\nvar _ error = ErrorCode(0)\n\n// ErrorCode just returns itself\nfunc (ec ErrorCode) ErrorCode() ErrorCode {\n\treturn ec\n}\n\n// Error returns the ID/Value\nfunc (ec ErrorCode) Error() string {\n\t// NOTE(stevvooe): Cannot use message here since it may have unpopulated args.\n\treturn strings.ToLower(strings.Replace(ec.String(), \"_\", \" \", -1))\n}\n\n// Descriptor returns the descriptor for the error code.\nfunc (ec ErrorCode) Descriptor() ErrorDescriptor {\n\td, ok := errorCodeToDescriptors[ec]\n\n\tif !ok {\n\t\treturn ErrorCodeUnknown.Descriptor()\n\t}\n\n\treturn d\n}\n\n// String returns the canonical identifier for this error code.\nfunc (ec ErrorCode) String() string {\n\treturn ec.Descriptor().Value\n}\n\n// Message returned the human-readable error message for this error code.\nfunc (ec ErrorCode) Message() string {\n\treturn ec.Descriptor().Message\n}\n\n// MarshalText encodes the receiver into UTF-8-encoded text and returns the\n// result.\nfunc (ec ErrorCode) MarshalText() (text []byte, err error) {\n\treturn []byte(ec.String()), nil\n}\n\n// UnmarshalText decodes the form generated by MarshalText.\nfunc (ec *ErrorCode) UnmarshalText(text []byte) error {\n\tdesc, ok := idToDescriptors[string(text)]\n\n\tif !ok {\n\t\tdesc = ErrorCodeUnknown.Descriptor()\n\t}\n\n\t*ec = desc.Code\n\n\treturn nil\n}\n\n// WithMessage creates a new Error struct based on the passed-in info and\n// overrides the Message property.\nfunc (ec ErrorCode) WithMessage(message string) Error {\n\treturn Error{\n\t\tCode:    ec,\n\t\tMessage: message,\n\t}\n}\n\n// WithDetail creates a new Error struct based on the passed-in info and\n// set the Detail property appropriately\nfunc (ec ErrorCode) WithDetail(detail interface{}) Error {\n\treturn Error{\n\t\tCode:    ec,\n\t\tMessage: ec.Message(),\n\t}.WithDetail(detail)\n}\n\n// WithArgs creates a new Error struct and sets the Args slice\nfunc (ec ErrorCode) WithArgs(args ...interface{}) Error {\n\treturn Error{\n\t\tCode:    ec,\n\t\tMessage: ec.Message(),\n\t}.WithArgs(args...)\n}\n\n// Error provides a wrapper around ErrorCode with extra Details provided.\ntype Error struct {\n\tCode    ErrorCode   `json:\"code\"`\n\tMessage string      `json:\"message\"`\n\tDetail  interface{} `json:\"detail,omitempty\"`\n\n\t// TODO(duglin): See if we need an \"args\" property so we can do the\n\t// variable substitution right before showing the message to the user\n}\n\nvar _ error = Error{}\n\n// ErrorCode returns the ID/Value of this Error\nfunc (e Error) ErrorCode() ErrorCode {\n\treturn e.Code\n}\n\n// Error returns a human readable representation of the error.\nfunc (e Error) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.Code.Error(), e.Message)\n}\n\n// WithDetail will return a new Error, based on the current one, but with\n// some Detail info added\nfunc (e Error) WithDetail(detail interface{}) Error {\n\treturn Error{\n\t\tCode:    e.Code,\n\t\tMessage: e.Message,\n\t\tDetail:  detail,\n\t}\n}\n\n// WithArgs uses the passed-in list of interface{} as the substitution\n// variables in the Error's Message string, but returns a new Error\nfunc (e Error) WithArgs(args ...interface{}) Error {\n\treturn Error{\n\t\tCode:    e.Code,\n\t\tMessage: fmt.Sprintf(e.Code.Message(), args...),\n\t\tDetail:  e.Detail,\n\t}\n}\n\n// ErrorDescriptor provides relevant information about a given error code.\ntype ErrorDescriptor struct {\n\t// Code is the error code that this descriptor describes.\n\tCode ErrorCode\n\n\t// Value provides a unique, string key, often captilized with\n\t// underscores, to identify the error code. This value is used as the\n\t// keyed value when serializing api errors.\n\tValue string\n\n\t// Message is a short, human readable description of the error condition\n\t// included in API responses.\n\tMessage string\n\n\t// Description provides a complete account of the errors purpose, suitable\n\t// for use in documentation.\n\tDescription string\n\n\t// HTTPStatusCode provides the http status code that is associated with\n\t// this error condition.\n\tHTTPStatusCode int\n}\n\n// ParseErrorCode returns the value by the string error code.\n// `ErrorCodeUnknown` will be returned if the error is not known.\nfunc ParseErrorCode(value string) ErrorCode {\n\ted, ok := idToDescriptors[value]\n\tif ok {\n\t\treturn ed.Code\n\t}\n\n\treturn ErrorCodeUnknown\n}\n\n// Errors provides the envelope for multiple errors and a few sugar methods\n// for use within the application.\ntype Errors []error\n\nvar _ error = Errors{}\n\nfunc (errs Errors) Error() string {\n\tswitch len(errs) {\n\tcase 0:\n\t\treturn \"<nil>\"\n\tcase 1:\n\t\treturn errs[0].Error()\n\tdefault:\n\t\tmsg := \"errors:\\n\"\n\t\tfor _, err := range errs {\n\t\t\tmsg += err.Error() + \"\\n\"\n\t\t}\n\t\treturn msg\n\t}\n}\n\n// Len returns the current number of errors.\nfunc (errs Errors) Len() int {\n\treturn len(errs)\n}\n\n// MarshalJSON converts slice of error, ErrorCode or Error into a\n// slice of Error - then serializes\nfunc (errs Errors) MarshalJSON() ([]byte, error) {\n\tvar tmpErrs struct {\n\t\tErrors []Error `json:\"errors,omitempty\"`\n\t}\n\n\tfor _, daErr := range errs {\n\t\tvar err Error\n\n\t\tswitch daErr := daErr.(type) {\n\t\tcase ErrorCode:\n\t\t\terr = daErr.WithDetail(nil)\n\t\tcase Error:\n\t\t\terr = daErr\n\t\tdefault:\n\t\t\terr = ErrorCodeUnknown.WithDetail(daErr)\n\n\t\t}\n\n\t\t// If the Error struct was setup and they forgot to set the\n\t\t// Message field (meaning its \"\") then grab it from the ErrCode\n\t\tmsg := err.Message\n\t\tif msg == \"\" {\n\t\t\tmsg = err.Code.Message()\n\t\t}\n\n\t\ttmpErrs.Errors = append(tmpErrs.Errors, Error{\n\t\t\tCode:    err.Code,\n\t\t\tMessage: msg,\n\t\t\tDetail:  err.Detail,\n\t\t})\n\t}\n\n\treturn json.Marshal(tmpErrs)\n}\n\n// UnmarshalJSON deserializes []Error and then converts it into slice of\n// Error or ErrorCode\nfunc (errs *Errors) UnmarshalJSON(data []byte) error {\n\tvar tmpErrs struct {\n\t\tErrors []Error\n\t}\n\n\tif err := json.Unmarshal(data, &tmpErrs); err != nil {\n\t\treturn err\n\t}\n\n\tvar newErrs Errors\n\tfor _, daErr := range tmpErrs.Errors {\n\t\t// If Message is empty or exactly matches the Code's message string\n\t\t// then just use the Code, no need for a full Error struct\n\t\tif daErr.Detail == nil && (daErr.Message == \"\" || daErr.Message == daErr.Code.Message()) {\n\t\t\t// Error's w/o details get converted to ErrorCode\n\t\t\tnewErrs = append(newErrs, daErr.Code)\n\t\t} else {\n\t\t\t// Error's w/ details are untouched\n\t\t\tnewErrs = append(newErrs, Error{\n\t\t\t\tCode:    daErr.Code,\n\t\t\t\tMessage: daErr.Message,\n\t\t\t\tDetail:  daErr.Detail,\n\t\t\t})\n\t\t}\n\t}\n\n\t*errs = newErrs\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/errdesc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"sort\"\n\t\"sync\"\n)\n\nvar (\n\terrorCodeToDescriptors = map[ErrorCode]ErrorDescriptor{}\n\tidToDescriptors        = map[string]ErrorDescriptor{}\n\tgroupToDescriptors     = map[string][]ErrorDescriptor{}\n)\n\nvar (\n\t// ErrorCodeUnknown is a generic error that can be used as a last\n\t// resort if there is no situation-specific error message that can be used\n\tErrorCodeUnknown = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:   \"UNKNOWN\",\n\t\tMessage: \"unknown error\",\n\t\tDescription: `Generic error returned when the error does not have an\n\t\t\t                                            API classification.`,\n\t\tHTTPStatusCode: http.StatusInternalServerError,\n\t})\n\n\t// ErrorCodeUnsupported is returned when an operation is not supported.\n\tErrorCodeUnsupported = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:   \"UNSUPPORTED\",\n\t\tMessage: \"The operation is unsupported.\",\n\t\tDescription: `The operation was unsupported due to a missing\n\t\timplementation or invalid set of parameters.`,\n\t\tHTTPStatusCode: http.StatusMethodNotAllowed,\n\t})\n\n\t// ErrorCodeUnauthorized is returned if a request requires\n\t// authentication.\n\tErrorCodeUnauthorized = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:   \"UNAUTHORIZED\",\n\t\tMessage: \"authentication required\",\n\t\tDescription: `The access controller was unable to authenticate\n\t\tthe client. Often this will be accompanied by a\n\t\tWww-Authenticate HTTP response header indicating how to\n\t\tauthenticate.`,\n\t\tHTTPStatusCode: http.StatusUnauthorized,\n\t})\n\n\t// ErrorCodeDenied is returned if a client does not have sufficient\n\t// permission to perform an action.\n\tErrorCodeDenied = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:   \"DENIED\",\n\t\tMessage: \"requested access to the resource is denied\",\n\t\tDescription: `The access controller denied access for the\n\t\toperation on a resource.`,\n\t\tHTTPStatusCode: http.StatusForbidden,\n\t})\n\n\t// ErrorCodeUnavailable provides a common error to report unavailability\n\t// of a service or endpoint.\n\tErrorCodeUnavailable = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:          \"UNAVAILABLE\",\n\t\tMessage:        \"service unavailable\",\n\t\tDescription:    \"Returned when a service is not available\",\n\t\tHTTPStatusCode: http.StatusServiceUnavailable,\n\t})\n\n\t// ErrorCodeTooManyRequests is returned if a client attempts too many\n\t// times to contact a service endpoint.\n\tErrorCodeTooManyRequests = Register(\"errcode\", ErrorDescriptor{\n\t\tValue:   \"TOOMANYREQUESTS\",\n\t\tMessage: \"too many requests\",\n\t\tDescription: `Returned when a client attempts to contact a\n\t\tservice too many times`,\n\t\tHTTPStatusCode: http.StatusTooManyRequests,\n\t})\n)\n\nvar nextCode = 1000\nvar registerLock sync.Mutex\n\n// Register will make the passed-in error known to the environment and\n// return a new ErrorCode\nfunc Register(group string, descriptor ErrorDescriptor) ErrorCode {\n\tregisterLock.Lock()\n\tdefer registerLock.Unlock()\n\n\tdescriptor.Code = ErrorCode(nextCode)\n\n\tif _, ok := idToDescriptors[descriptor.Value]; ok {\n\t\tpanic(fmt.Sprintf(\"ErrorValue %q is already registered\", descriptor.Value))\n\t}\n\tif _, ok := errorCodeToDescriptors[descriptor.Code]; ok {\n\t\tpanic(fmt.Sprintf(\"ErrorCode %v is already registered\", descriptor.Code))\n\t}\n\n\tgroupToDescriptors[group] = append(groupToDescriptors[group], descriptor)\n\terrorCodeToDescriptors[descriptor.Code] = descriptor\n\tidToDescriptors[descriptor.Value] = descriptor\n\n\tnextCode++\n\treturn descriptor.Code\n}\n\ntype byValue []ErrorDescriptor\n\nfunc (a byValue) Len() int           { return len(a) }\nfunc (a byValue) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\nfunc (a byValue) Less(i, j int) bool { return a[i].Value < a[j].Value }\n\n// GetGroupNames returns the list of Error group names that are registered\nfunc GetGroupNames() []string {\n\tkeys := []string{}\n\n\tfor k := range groupToDescriptors {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}\n\n// GetErrorCodeGroup returns the named group of error descriptors\nfunc GetErrorCodeGroup(name string) []ErrorDescriptor {\n\tdesc := groupToDescriptors[name]\n\tsort.Sort(byValue(desc))\n\treturn desc\n}\n\n// GetErrorAllDescriptors returns a slice of all ErrorDescriptors that are\n// registered, irrespective of what group they're in\nfunc GetErrorAllDescriptors() []ErrorDescriptor {\n\tresult := []ErrorDescriptor{}\n\n\tfor _, group := range GetGroupNames() {\n\t\tresult = append(result, GetErrorCodeGroup(group)...)\n\t}\n\tsort.Sort(byValue(result))\n\treturn result\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"compress/flate\"\n\t\"compress/gzip\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/core/remotes\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/klauspost/compress/zstd\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\ntype dockerFetcher struct {\n\t*dockerBase\n}\n\nfunc (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) {\n\tctx = log.WithLogger(ctx, log.G(ctx).WithField(\"digest\", desc.Digest))\n\n\thosts := r.filterHosts(HostCapabilityPull)\n\tif len(hosts) == 0 {\n\t\treturn nil, fmt.Errorf(\"no pull hosts: %w\", errdefs.ErrNotFound)\n\t}\n\n\tctx, err := ContextWithRepositoryScope(ctx, r.refspec, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newHTTPReadSeeker(desc.Size, func(offset int64) (io.ReadCloser, error) {\n\t\t// firstly try fetch via external urls\n\t\tfor _, us := range desc.URLs {\n\t\t\tu, err := url.Parse(us)\n\t\t\tif err != nil {\n\t\t\t\tlog.G(ctx).WithError(err).Debugf(\"failed to parse %q\", us)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif u.Scheme != \"http\" && u.Scheme != \"https\" {\n\t\t\t\tlog.G(ctx).Debug(\"non-http(s) alternative url is unsupported\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tctx = log.WithLogger(ctx, log.G(ctx).WithField(\"url\", u))\n\t\t\tlog.G(ctx).Info(\"request\")\n\n\t\t\t// Try this first, parse it\n\t\t\thost := RegistryHost{\n\t\t\t\tClient:       http.DefaultClient,\n\t\t\t\tHost:         u.Host,\n\t\t\t\tScheme:       u.Scheme,\n\t\t\t\tPath:         u.Path,\n\t\t\t\tCapabilities: HostCapabilityPull,\n\t\t\t}\n\t\t\treq := r.request(host, http.MethodGet)\n\t\t\t// Strip namespace from base\n\t\t\treq.path = u.Path\n\t\t\tif u.RawQuery != \"\" {\n\t\t\t\treq.path = req.path + \"?\" + u.RawQuery\n\t\t\t}\n\n\t\t\trc, err := r.open(ctx, req, desc.MediaType, offset)\n\t\t\tif err != nil {\n\t\t\t\tif errdefs.IsNotFound(err) {\n\t\t\t\t\tcontinue // try one of the other urls.\n\t\t\t\t}\n\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn rc, nil\n\t\t}\n\n\t\t// Try manifests endpoints for manifests types\n\t\tif images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) ||\n\t\t\tdesc.MediaType == images.MediaTypeDockerSchema1Manifest {\n\n\t\t\tvar firstErr error\n\t\t\tfor _, host := range r.hosts {\n\t\t\t\treq := r.request(host, http.MethodGet, \"manifests\", desc.Digest.String())\n\t\t\t\tif err := req.addNamespace(r.refspec.Hostname()); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\trc, err := r.open(ctx, req, desc.MediaType, offset)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// Store the error for referencing later\n\t\t\t\t\tif firstErr == nil {\n\t\t\t\t\t\tfirstErr = err\n\t\t\t\t\t}\n\t\t\t\t\tcontinue // try another host\n\t\t\t\t}\n\n\t\t\t\treturn rc, nil\n\t\t\t}\n\n\t\t\treturn nil, firstErr\n\t\t}\n\n\t\t// Finally use blobs endpoints\n\t\tvar firstErr error\n\t\tfor _, host := range r.hosts {\n\t\t\treq := r.request(host, http.MethodGet, \"blobs\", desc.Digest.String())\n\t\t\tif err := req.addNamespace(r.refspec.Hostname()); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\trc, err := r.open(ctx, req, desc.MediaType, offset)\n\t\t\tif err != nil {\n\t\t\t\t// Store the error for referencing later\n\t\t\t\tif firstErr == nil {\n\t\t\t\t\tfirstErr = err\n\t\t\t\t}\n\t\t\t\tcontinue // try another host\n\t\t\t}\n\n\t\t\treturn rc, nil\n\t\t}\n\n\t\tif errdefs.IsNotFound(firstErr) {\n\t\t\tfirstErr = fmt.Errorf(\"could not fetch content descriptor %v (%v) from remote: %w\",\n\t\t\t\tdesc.Digest, desc.MediaType, errdefs.ErrNotFound,\n\t\t\t)\n\t\t}\n\n\t\treturn nil, firstErr\n\n\t})\n}\n\nfunc (r dockerFetcher) createGetReq(ctx context.Context, host RegistryHost, mediatype string, ps ...string) (*request, int64, error) {\n\theadReq := r.request(host, http.MethodHead, ps...)\n\tif err := headReq.addNamespace(r.refspec.Hostname()); err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tif mediatype == \"\" {\n\t\theadReq.header.Set(\"Accept\", \"*/*\")\n\t} else {\n\t\theadReq.header.Set(\"Accept\", strings.Join([]string{mediatype, `*/*`}, \", \"))\n\t}\n\n\theadResp, err := headReq.doWithRetries(ctx, nil)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tif headResp.Body != nil {\n\t\theadResp.Body.Close()\n\t}\n\tif headResp.StatusCode > 299 {\n\t\treturn nil, 0, fmt.Errorf(\"unexpected HEAD status code %v: %s\", headReq.String(), headResp.Status)\n\t}\n\n\tgetReq := r.request(host, http.MethodGet, ps...)\n\tif err := getReq.addNamespace(r.refspec.Hostname()); err != nil {\n\t\treturn nil, 0, err\n\t}\n\treturn getReq, headResp.ContentLength, nil\n}\n\nfunc (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, opts ...remotes.FetchByDigestOpts) (io.ReadCloser, ocispec.Descriptor, error) {\n\tvar desc ocispec.Descriptor\n\tctx = log.WithLogger(ctx, log.G(ctx).WithField(\"digest\", dgst))\n\tvar config remotes.FetchByDigestConfig\n\tfor _, o := range opts {\n\t\tif err := o(ctx, &config); err != nil {\n\t\t\treturn nil, desc, err\n\t\t}\n\t}\n\n\thosts := r.filterHosts(HostCapabilityPull)\n\tif len(hosts) == 0 {\n\t\treturn nil, desc, fmt.Errorf(\"no pull hosts: %w\", errdefs.ErrNotFound)\n\t}\n\n\tctx, err := ContextWithRepositoryScope(ctx, r.refspec, false)\n\tif err != nil {\n\t\treturn nil, desc, err\n\t}\n\n\tvar (\n\t\tgetReq   *request\n\t\tsz       int64\n\t\tfirstErr error\n\t)\n\n\tfor _, host := range r.hosts {\n\t\tgetReq, sz, err = r.createGetReq(ctx, host, config.Mediatype, \"blobs\", dgst.String())\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\t// Store the error for referencing later\n\t\tif firstErr == nil {\n\t\t\tfirstErr = err\n\t\t}\n\t}\n\n\tif getReq == nil {\n\t\t// Fall back to the \"manifests\" endpoint\n\t\tfor _, host := range r.hosts {\n\t\t\tgetReq, sz, err = r.createGetReq(ctx, host, config.Mediatype, \"manifests\", dgst.String())\n\t\t\tif err == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Store the error for referencing later\n\t\t\tif firstErr == nil {\n\t\t\t\tfirstErr = err\n\t\t\t}\n\t\t}\n\t}\n\n\tif getReq == nil {\n\t\tif errdefs.IsNotFound(firstErr) {\n\t\t\tfirstErr = fmt.Errorf(\"could not fetch content %v from remote: %w\", dgst, errdefs.ErrNotFound)\n\t\t}\n\t\tif firstErr == nil {\n\t\t\tfirstErr = fmt.Errorf(\"could not fetch content %v from remote: (unknown)\", dgst)\n\t\t}\n\t\treturn nil, desc, firstErr\n\t}\n\n\tseeker, err := newHTTPReadSeeker(sz, func(offset int64) (io.ReadCloser, error) {\n\t\treturn r.open(ctx, getReq, config.Mediatype, offset)\n\t})\n\tif err != nil {\n\t\treturn nil, desc, err\n\t}\n\n\tdesc = ocispec.Descriptor{\n\t\tMediaType: \"application/octet-stream\",\n\t\tDigest:    dgst,\n\t\tSize:      sz,\n\t}\n\tif config.Mediatype != \"\" {\n\t\tdesc.MediaType = config.Mediatype\n\t}\n\treturn seeker, desc, nil\n}\n\nfunc (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, offset int64) (_ io.ReadCloser, retErr error) {\n\tif mediatype == \"\" {\n\t\treq.header.Set(\"Accept\", \"*/*\")\n\t} else {\n\t\treq.header.Set(\"Accept\", strings.Join([]string{mediatype, `*/*`}, \", \"))\n\t}\n\treq.header.Set(\"Accept-Encoding\", \"zstd;q=1.0, gzip;q=0.8, deflate;q=0.5\")\n\n\tif offset > 0 {\n\t\t// Note: \"Accept-Ranges: bytes\" cannot be trusted as some endpoints\n\t\t// will return the header without supporting the range. The content\n\t\t// range must always be checked.\n\t\treq.header.Set(\"Range\", fmt.Sprintf(\"bytes=%d-\", offset))\n\t}\n\n\tresp, err := req.doWithRetries(ctx, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tresp.Body.Close()\n\t\t}\n\t}()\n\n\tif resp.StatusCode > 299 {\n\t\t// TODO(stevvooe): When doing a offset specific request, we should\n\t\t// really distinguish between a 206 and a 200. In the case of 200, we\n\t\t// can discard the bytes, hiding the seek behavior from the\n\t\t// implementation.\n\n\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\treturn nil, fmt.Errorf(\"content at %v not found: %w\", req.String(), errdefs.ErrNotFound)\n\t\t}\n\t\tvar registryErr Errors\n\t\tif err := json.NewDecoder(resp.Body).Decode(&registryErr); err != nil || registryErr.Len() < 1 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected status code %v: %v\", req.String(), resp.Status)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"unexpected status code %v: %s - Server message: %s\", req.String(), resp.Status, registryErr.Error())\n\t}\n\tif offset > 0 {\n\t\tcr := resp.Header.Get(\"content-range\")\n\t\tif cr != \"\" {\n\t\t\tif !strings.HasPrefix(cr, fmt.Sprintf(\"bytes %d-\", offset)) {\n\t\t\t\treturn nil, fmt.Errorf(\"unhandled content range in response: %v\", cr)\n\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: Should any cases where use of content range\n\t\t\t// without the proper header be considered?\n\t\t\t// 206 responses?\n\n\t\t\t// Discard up to offset\n\t\t\t// Could use buffer pool here but this case should be rare\n\t\t\tn, err := io.Copy(io.Discard, io.LimitReader(resp.Body, offset))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to discard to offset: %w\", err)\n\t\t\t}\n\t\t\tif n != offset {\n\t\t\t\treturn nil, errors.New(\"unable to discard to offset\")\n\t\t\t}\n\n\t\t}\n\t}\n\n\tbody := resp.Body\n\tencoding := strings.FieldsFunc(resp.Header.Get(\"Content-Encoding\"), func(r rune) bool {\n\t\treturn r == ' ' || r == '\\t' || r == ','\n\t})\n\tfor i := len(encoding) - 1; i >= 0; i-- {\n\t\talgorithm := strings.ToLower(encoding[i])\n\t\tswitch algorithm {\n\t\tcase \"zstd\":\n\t\t\tr, err := zstd.NewReader(body)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbody = r.IOReadCloser()\n\t\tcase \"gzip\":\n\t\t\tbody, err = gzip.NewReader(body)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tcase \"deflate\":\n\t\t\tbody = flate.NewReader(body)\n\t\tcase \"identity\", \"\":\n\t\t\t// no content-encoding applied, use raw body\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"unsupported Content-Encoding algorithm: \" + algorithm)\n\t\t}\n\t}\n\n\treturn body, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher_fuzz.go",
    "content": "//go:build gofuzz\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strconv\"\n)\n\nfunc FuzzFetcher(data []byte) int {\n\tdataLen := len(data)\n\tif dataLen == 0 {\n\t\treturn -1\n\t}\n\n\ts := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {\n\t\trw.Header().Set(\"content-range\", fmt.Sprintf(\"bytes %d-%d/%d\", 0, dataLen-1, dataLen))\n\t\trw.Header().Set(\"content-length\", strconv.Itoa(dataLen))\n\t\trw.Write(data)\n\t}))\n\tdefer s.Close()\n\n\tu, err := url.Parse(s.URL)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tf := dockerFetcher{&dockerBase{\n\t\trepository: \"nonempty\",\n\t}}\n\thost := RegistryHost{\n\t\tClient: s.Client(),\n\t\tHost:   u.Host,\n\t\tScheme: u.Scheme,\n\t\tPath:   u.Path,\n\t}\n\n\tctx := context.Background()\n\treq := f.request(host, http.MethodGet)\n\trc, err := f.open(ctx, req, \"\", 0)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tb, err := io.ReadAll(rc)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\texpected := data\n\tif len(b) != len(expected) {\n\t\tpanic(\"len of request is not equal to len of expected but should be\")\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/handler.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/pkg/labels\"\n\t\"github.com/containerd/containerd/v2/pkg/reference\"\n\t\"github.com/containerd/log\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// AppendDistributionSourceLabel updates the label of blob with distribution source.\nfunc AppendDistributionSourceLabel(manager content.Manager, ref string) (images.HandlerFunc, error) {\n\trefspec, err := reference.Parse(ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tu, err := url.Parse(\"dummy://\" + refspec.Locator)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsource, repo := u.Hostname(), strings.TrimPrefix(u.Path, \"/\")\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tinfo, err := manager.Info(ctx, desc.Digest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tkey := distributionSourceLabelKey(source)\n\n\t\toriginLabel := \"\"\n\t\tif info.Labels != nil {\n\t\t\toriginLabel = info.Labels[key]\n\t\t}\n\t\tvalue := appendDistributionSourceLabel(originLabel, repo)\n\n\t\t// The repo name has been limited under 256 and the distribution\n\t\t// label might hit the limitation of label size, when blob data\n\t\t// is used as the very, very common layer.\n\t\tif err := labels.Validate(key, value); err != nil {\n\t\t\tlog.G(ctx).Warnf(\"skip to append distribution label: %s\", err)\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tinfo = content.Info{\n\t\t\tDigest: desc.Digest,\n\t\t\tLabels: map[string]string{\n\t\t\t\tkey: value,\n\t\t\t},\n\t\t}\n\t\t_, err = manager.Update(ctx, info, fmt.Sprintf(\"labels.%s\", key))\n\t\treturn nil, err\n\t}, nil\n}\n\nfunc appendDistributionSourceLabel(originLabel, repo string) string {\n\trepos := []string{}\n\tif originLabel != \"\" {\n\t\trepos = strings.Split(originLabel, \",\")\n\t}\n\trepos = append(repos, repo)\n\n\t// use empty string to present duplicate items\n\tfor i := 1; i < len(repos); i++ {\n\t\ttmp, j := repos[i], i-1\n\t\tfor ; j >= 0 && repos[j] >= tmp; j-- {\n\t\t\tif repos[j] == tmp {\n\t\t\t\ttmp = \"\"\n\t\t\t}\n\t\t\trepos[j+1] = repos[j]\n\t\t}\n\t\trepos[j+1] = tmp\n\t}\n\n\ti := 0\n\tfor ; i < len(repos) && repos[i] == \"\"; i++ {\n\t}\n\n\treturn strings.Join(repos[i:], \",\")\n}\n\nfunc distributionSourceLabelKey(source string) string {\n\treturn labels.LabelDistributionSource + \".\" + source\n}\n\n// selectRepositoryMountCandidate will select the repo which has longest\n// common prefix components as the candidate.\nfunc selectRepositoryMountCandidate(refspec reference.Spec, sources map[string]string) string {\n\tu, err := url.Parse(\"dummy://\" + refspec.Locator)\n\tif err != nil {\n\t\t// NOTE: basically, it won't be error here\n\t\treturn \"\"\n\t}\n\n\tsource, target := u.Hostname(), strings.TrimPrefix(u.Path, \"/\")\n\trepoLabel, ok := sources[distributionSourceLabelKey(source)]\n\tif !ok || repoLabel == \"\" {\n\t\treturn \"\"\n\t}\n\n\tn, match := 0, \"\"\n\tcomponents := strings.Split(target, \"/\")\n\tfor _, repo := range strings.Split(repoLabel, \",\") {\n\t\t// the target repo is not a candidate\n\t\tif repo == target {\n\t\t\tcontinue\n\t\t}\n\n\t\tif l := commonPrefixComponents(components, repo); l >= n {\n\t\t\tn, match = l, repo\n\t\t}\n\t}\n\treturn match\n}\n\nfunc commonPrefixComponents(components []string, target string) int {\n\ttargetComponents := strings.Split(target, \"/\")\n\n\ti := 0\n\tfor ; i < len(components) && i < len(targetComponents); i++ {\n\t\tif components[i] != targetComponents[i] {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn i\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/httpreadseeker.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n)\n\nconst maxRetry = 3\n\ntype httpReadSeeker struct {\n\tsize   int64\n\toffset int64\n\trc     io.ReadCloser\n\topen   func(offset int64) (io.ReadCloser, error)\n\tclosed bool\n\n\terrsWithNoProgress int\n}\n\nfunc newHTTPReadSeeker(size int64, open func(offset int64) (io.ReadCloser, error)) (io.ReadCloser, error) {\n\treturn &httpReadSeeker{\n\t\tsize: size,\n\t\topen: open,\n\t}, nil\n}\n\nfunc (hrs *httpReadSeeker) Read(p []byte) (n int, err error) {\n\tif hrs.closed {\n\t\treturn 0, io.EOF\n\t}\n\n\trd, err := hrs.reader()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn, err = rd.Read(p)\n\thrs.offset += int64(n)\n\tif n > 0 || err == nil {\n\t\thrs.errsWithNoProgress = 0\n\t}\n\tif err == io.ErrUnexpectedEOF {\n\t\t// connection closed unexpectedly. try reconnecting.\n\t\tif n == 0 {\n\t\t\thrs.errsWithNoProgress++\n\t\t\tif hrs.errsWithNoProgress > maxRetry {\n\t\t\t\treturn // too many retries for this offset with no progress\n\t\t\t}\n\t\t}\n\t\tif hrs.rc != nil {\n\t\t\tif clsErr := hrs.rc.Close(); clsErr != nil {\n\t\t\t\tlog.L.WithError(clsErr).Error(\"httpReadSeeker: failed to close ReadCloser\")\n\t\t\t}\n\t\t\thrs.rc = nil\n\t\t}\n\t\tif _, err2 := hrs.reader(); err2 == nil {\n\t\t\treturn n, nil\n\t\t}\n\t} else if err == io.EOF {\n\t\t// The CRI's imagePullProgressTimeout relies on responseBody.Close to\n\t\t// update the process monitor's status. If the err is io.EOF, close\n\t\t// the connection since there is no more available data.\n\t\tif hrs.rc != nil {\n\t\t\tif clsErr := hrs.rc.Close(); clsErr != nil {\n\t\t\t\tlog.L.WithError(clsErr).Error(\"httpReadSeeker: failed to close ReadCloser after io.EOF\")\n\t\t\t}\n\t\t\thrs.rc = nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (hrs *httpReadSeeker) Close() error {\n\tif hrs.closed {\n\t\treturn nil\n\t}\n\thrs.closed = true\n\tif hrs.rc != nil {\n\t\treturn hrs.rc.Close()\n\t}\n\n\treturn nil\n}\n\nfunc (hrs *httpReadSeeker) Seek(offset int64, whence int) (int64, error) {\n\tif hrs.closed {\n\t\treturn 0, fmt.Errorf(\"Fetcher.Seek: closed: %w\", errdefs.ErrUnavailable)\n\t}\n\n\tabs := hrs.offset\n\tswitch whence {\n\tcase io.SeekStart:\n\t\tabs = offset\n\tcase io.SeekCurrent:\n\t\tabs += offset\n\tcase io.SeekEnd:\n\t\tif hrs.size == -1 {\n\t\t\treturn 0, fmt.Errorf(\"Fetcher.Seek: unknown size, cannot seek from end: %w\", errdefs.ErrUnavailable)\n\t\t}\n\t\tabs = hrs.size + offset\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"Fetcher.Seek: invalid whence: %w\", errdefs.ErrInvalidArgument)\n\t}\n\n\tif abs < 0 {\n\t\treturn 0, fmt.Errorf(\"Fetcher.Seek: negative offset: %w\", errdefs.ErrInvalidArgument)\n\t}\n\n\tif abs != hrs.offset {\n\t\tif hrs.rc != nil {\n\t\t\tif err := hrs.rc.Close(); err != nil {\n\t\t\t\tlog.L.WithError(err).Error(\"Fetcher.Seek: failed to close ReadCloser\")\n\t\t\t}\n\n\t\t\thrs.rc = nil\n\t\t}\n\n\t\thrs.offset = abs\n\t}\n\n\treturn hrs.offset, nil\n}\n\nfunc (hrs *httpReadSeeker) reader() (io.Reader, error) {\n\tif hrs.rc != nil {\n\t\treturn hrs.rc, nil\n\t}\n\n\tif hrs.size == -1 || hrs.offset < hrs.size {\n\t\t// only try to reopen the body request if we are seeking to a value\n\t\t// less than the actual size.\n\t\tif hrs.open == nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot open: %w\", errdefs.ErrNotImplemented)\n\t\t}\n\n\t\trc, err := hrs.open(hrs.offset)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"httpReadSeeker: failed open: %w\", err)\n\t\t}\n\n\t\tif hrs.rc != nil {\n\t\t\tif err := hrs.rc.Close(); err != nil {\n\t\t\t\tlog.L.WithError(err).Error(\"httpReadSeeker: failed to close ReadCloser\")\n\t\t\t}\n\t\t}\n\t\thrs.rc = rc\n\t} else {\n\t\t// There is an edge case here where offset == size of the content. If\n\t\t// we seek, we will probably get an error for content that cannot be\n\t\t// sought (?). In that case, we should err on committing the content,\n\t\t// as the length is already satisfied but we just return the empty\n\t\t// reader instead.\n\n\t\thrs.rc = io.NopCloser(bytes.NewReader([]byte{}))\n\t}\n\n\treturn hrs.rc, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/core/remotes\"\n\tremoteserrors \"github.com/containerd/containerd/v2/core/remotes/errors\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\ntype dockerPusher struct {\n\t*dockerBase\n\tobject string\n\n\t// TODO: namespace tracker\n\ttracker StatusTracker\n}\n\n// Writer implements Ingester API of content store. This allows the client\n// to receive ErrUnavailable when there is already an on-going upload.\n// Note that the tracker MUST implement StatusTrackLocker interface to avoid\n// race condition on StatusTracker.\nfunc (p dockerPusher) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) {\n\tvar wOpts content.WriterOpts\n\tfor _, opt := range opts {\n\t\tif err := opt(&wOpts); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif wOpts.Ref == \"\" {\n\t\treturn nil, fmt.Errorf(\"ref must not be empty: %w\", errdefs.ErrInvalidArgument)\n\t}\n\treturn p.push(ctx, wOpts.Desc, wOpts.Ref, true)\n}\n\nfunc (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) {\n\treturn p.push(ctx, desc, remotes.MakeRefKey(ctx, desc), false)\n}\n\nfunc (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref string, unavailableOnFail bool) (content.Writer, error) {\n\tif l, ok := p.tracker.(StatusTrackLocker); ok {\n\t\tl.Lock(ref)\n\t\tdefer l.Unlock(ref)\n\t}\n\tctx, err := ContextWithRepositoryScope(ctx, p.refspec, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstatus, err := p.tracker.GetStatus(ref)\n\tif err == nil {\n\t\tif status.Committed && status.Offset == status.Total {\n\t\t\treturn nil, fmt.Errorf(\"ref %v: %w\", ref, errdefs.ErrAlreadyExists)\n\t\t}\n\t\tif unavailableOnFail && status.ErrClosed == nil {\n\t\t\t// Another push of this ref is happening elsewhere. The rest of function\n\t\t\t// will continue only when `errdefs.IsNotFound(err) == true` (i.e. there\n\t\t\t// is no actively-tracked ref already).\n\t\t\treturn nil, fmt.Errorf(\"push is on-going: %w\", errdefs.ErrUnavailable)\n\t\t}\n\t\t// TODO: Handle incomplete status\n\t} else if !errdefs.IsNotFound(err) {\n\t\treturn nil, fmt.Errorf(\"failed to get status: %w\", err)\n\t}\n\n\thosts := p.filterHosts(HostCapabilityPush)\n\tif len(hosts) == 0 {\n\t\treturn nil, fmt.Errorf(\"no push hosts: %w\", errdefs.ErrNotFound)\n\t}\n\n\tvar (\n\t\tisManifest bool\n\t\texistCheck []string\n\t\thost       = hosts[0]\n\t)\n\n\tif images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) {\n\t\tisManifest = true\n\t\texistCheck = getManifestPath(p.object, desc.Digest)\n\t} else {\n\t\texistCheck = []string{\"blobs\", desc.Digest.String()}\n\t}\n\n\treq := p.request(host, http.MethodHead, existCheck...)\n\treq.header.Set(\"Accept\", strings.Join([]string{desc.MediaType, `*/*`}, \", \"))\n\n\tlog.G(ctx).WithField(\"url\", req.String()).Debugf(\"checking and pushing to\")\n\n\tresp, err := req.doWithRetries(ctx, nil)\n\tif err != nil {\n\t\tif !errors.Is(err, ErrInvalidAuthorization) {\n\t\t\treturn nil, err\n\t\t}\n\t\tlog.G(ctx).WithError(err).Debugf(\"Unable to check existence, continuing with push\")\n\t} else {\n\t\tif resp.StatusCode == http.StatusOK {\n\t\t\tvar exists bool\n\t\t\tif isManifest && existCheck[1] != desc.Digest.String() {\n\t\t\t\tdgstHeader := digest.Digest(resp.Header.Get(\"Docker-Content-Digest\"))\n\t\t\t\tif dgstHeader == desc.Digest {\n\t\t\t\t\texists = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texists = true\n\t\t\t}\n\n\t\t\tif exists {\n\t\t\t\tp.tracker.SetStatus(ref, Status{\n\t\t\t\t\tCommitted: true,\n\t\t\t\t\tPushStatus: PushStatus{\n\t\t\t\t\t\tExists: true,\n\t\t\t\t\t},\n\t\t\t\t\tStatus: content.Status{\n\t\t\t\t\t\tRef: ref,\n\t\t\t\t\t\t// TODO: Set updated time?\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\tresp.Body.Close()\n\t\t\t\treturn nil, fmt.Errorf(\"content %v on remote: %w\", desc.Digest, errdefs.ErrAlreadyExists)\n\t\t\t}\n\t\t} else if resp.StatusCode != http.StatusNotFound {\n\t\t\terr := remoteserrors.NewUnexpectedStatusErr(resp)\n\t\t\tlog.G(ctx).WithField(\"resp\", resp).WithField(\"body\", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug(\"unexpected response\")\n\t\t\tresp.Body.Close()\n\t\t\treturn nil, err\n\t\t}\n\t\tresp.Body.Close()\n\t}\n\n\tif isManifest {\n\t\tputPath := getManifestPath(p.object, desc.Digest)\n\t\treq = p.request(host, http.MethodPut, putPath...)\n\t\treq.header.Add(\"Content-Type\", desc.MediaType)\n\t} else {\n\t\t// Start upload request\n\t\treq = p.request(host, http.MethodPost, \"blobs\", \"uploads/\")\n\n\t\tmountedFrom := \"\"\n\t\tvar resp *http.Response\n\t\tif fromRepo := selectRepositoryMountCandidate(p.refspec, desc.Annotations); fromRepo != \"\" {\n\t\t\tpreq := requestWithMountFrom(req, desc.Digest.String(), fromRepo)\n\t\t\tpctx := ContextWithAppendPullRepositoryScope(ctx, fromRepo)\n\n\t\t\t// NOTE: the fromRepo might be private repo and\n\t\t\t// auth service still can grant token without error.\n\t\t\t// but the post request will fail because of 401.\n\t\t\t//\n\t\t\t// for the private repo, we should remove mount-from\n\t\t\t// query and send the request again.\n\t\t\tresp, err = preq.doWithRetries(pctx, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tswitch resp.StatusCode {\n\t\t\tcase http.StatusUnauthorized:\n\t\t\t\tlog.G(ctx).Debugf(\"failed to mount from repository %s\", fromRepo)\n\n\t\t\t\tresp.Body.Close()\n\t\t\t\tresp = nil\n\t\t\tcase http.StatusCreated:\n\t\t\t\tmountedFrom = path.Join(p.refspec.Hostname(), fromRepo)\n\t\t\t}\n\t\t}\n\n\t\tif resp == nil {\n\t\t\tresp, err = req.doWithRetries(ctx, nil)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, ErrInvalidAuthorization) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"push access denied, repository does not exist or may require authorization: %w\", err)\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tswitch resp.StatusCode {\n\t\tcase http.StatusOK, http.StatusAccepted, http.StatusNoContent:\n\t\tcase http.StatusCreated:\n\t\t\tp.tracker.SetStatus(ref, Status{\n\t\t\t\tCommitted: true,\n\t\t\t\tPushStatus: PushStatus{\n\t\t\t\t\tMountedFrom: mountedFrom,\n\t\t\t\t},\n\t\t\t\tStatus: content.Status{\n\t\t\t\t\tRef:    ref,\n\t\t\t\t\tTotal:  desc.Size,\n\t\t\t\t\tOffset: desc.Size,\n\t\t\t\t},\n\t\t\t})\n\t\t\treturn nil, fmt.Errorf(\"content %v on remote: %w\", desc.Digest, errdefs.ErrAlreadyExists)\n\t\tdefault:\n\t\t\terr := remoteserrors.NewUnexpectedStatusErr(resp)\n\t\t\tlog.G(ctx).WithField(\"resp\", resp).WithField(\"body\", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug(\"unexpected response\")\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar (\n\t\t\tlocation = resp.Header.Get(\"Location\")\n\t\t\tlurl     *url.URL\n\t\t\tlhost    = host\n\t\t)\n\t\t// Support paths without host in location\n\t\tif strings.HasPrefix(location, \"/\") {\n\t\t\tlurl, err = url.Parse(lhost.Scheme + \"://\" + lhost.Host + location)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to parse location %v: %w\", location, err)\n\t\t\t}\n\t\t} else {\n\t\t\tif !strings.Contains(location, \"://\") {\n\t\t\t\tlocation = lhost.Scheme + \"://\" + location\n\t\t\t}\n\t\t\tlurl, err = url.Parse(location)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to parse location %v: %w\", location, err)\n\t\t\t}\n\n\t\t\tif lurl.Host != lhost.Host || lhost.Scheme != lurl.Scheme {\n\t\t\t\tlhost.Scheme = lurl.Scheme\n\t\t\t\tlhost.Host = lurl.Host\n\n\t\t\t\t// Check if different than what was requested, accounting for fallback in the transport layer\n\t\t\t\trequested := resp.Request.URL\n\t\t\t\tif requested.Host != lhost.Host || requested.Scheme != lhost.Scheme {\n\t\t\t\t\t// Strip authorizer if change to host or scheme\n\t\t\t\t\tlhost.Authorizer = nil\n\t\t\t\t\tlog.G(ctx).WithField(\"host\", lhost.Host).WithField(\"scheme\", lhost.Scheme).Debug(\"upload changed destination, authorizer removed\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tq := lurl.Query()\n\t\tq.Add(\"digest\", desc.Digest.String())\n\n\t\treq = p.request(lhost, http.MethodPut)\n\t\treq.header.Set(\"Content-Type\", \"application/octet-stream\")\n\t\treq.path = lurl.Path + \"?\" + q.Encode()\n\t}\n\tp.tracker.SetStatus(ref, Status{\n\t\tStatus: content.Status{\n\t\t\tRef:       ref,\n\t\t\tTotal:     desc.Size,\n\t\t\tExpected:  desc.Digest,\n\t\t\tStartedAt: time.Now(),\n\t\t},\n\t})\n\n\t// TODO: Support chunked upload\n\n\tpushw := newPushWriter(p.dockerBase, ref, desc.Digest, p.tracker, isManifest)\n\n\treq.body = func() (io.ReadCloser, error) {\n\t\tpr, pw := io.Pipe()\n\t\tpushw.setPipe(pw)\n\t\treturn pr, nil\n\t}\n\treq.size = desc.Size\n\n\tgo func() {\n\t\tresp, err := req.doWithRetries(ctx, nil)\n\t\tif err != nil {\n\t\t\tpushw.setError(err)\n\t\t\treturn\n\t\t}\n\n\t\tswitch resp.StatusCode {\n\t\tcase http.StatusOK, http.StatusCreated, http.StatusNoContent:\n\t\tdefault:\n\t\t\terr := remoteserrors.NewUnexpectedStatusErr(resp)\n\t\t\tlog.G(ctx).WithField(\"resp\", resp).WithField(\"body\", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug(\"unexpected response\")\n\t\t\tpushw.setError(err)\n\t\t\treturn\n\t\t}\n\t\tpushw.setResponse(resp)\n\t}()\n\n\treturn pushw, nil\n}\n\nfunc getManifestPath(object string, dgst digest.Digest) []string {\n\tif i := strings.IndexByte(object, '@'); i >= 0 {\n\t\tif object[i+1:] != dgst.String() {\n\t\t\t// use digest, not tag\n\t\t\tobject = \"\"\n\t\t} else {\n\t\t\t// strip @<digest> for registry path to make tag\n\t\t\tobject = object[:i]\n\t\t}\n\n\t}\n\n\tif object == \"\" {\n\t\treturn []string{\"manifests\", dgst.String()}\n\t}\n\n\treturn []string{\"manifests\", object}\n}\n\ntype pushWriter struct {\n\tbase *dockerBase\n\tref  string\n\n\tpipe *io.PipeWriter\n\n\tdone      chan struct{}\n\tcloseOnce sync.Once\n\n\tpipeC chan *io.PipeWriter\n\trespC chan *http.Response\n\terrC  chan error\n\n\tisManifest bool\n\n\texpected digest.Digest\n\ttracker  StatusTracker\n}\n\nfunc newPushWriter(db *dockerBase, ref string, expected digest.Digest, tracker StatusTracker, isManifest bool) *pushWriter {\n\t// Initialize and create response\n\treturn &pushWriter{\n\t\tbase:       db,\n\t\tref:        ref,\n\t\texpected:   expected,\n\t\ttracker:    tracker,\n\t\tpipeC:      make(chan *io.PipeWriter, 1),\n\t\trespC:      make(chan *http.Response, 1),\n\t\terrC:       make(chan error, 1),\n\t\tdone:       make(chan struct{}),\n\t\tisManifest: isManifest,\n\t}\n}\n\nfunc (pw *pushWriter) setPipe(p *io.PipeWriter) {\n\tselect {\n\tcase <-pw.done:\n\tcase pw.pipeC <- p:\n\t}\n}\n\nfunc (pw *pushWriter) setError(err error) {\n\tselect {\n\tcase <-pw.done:\n\tcase pw.errC <- err:\n\t}\n}\n\nfunc (pw *pushWriter) setResponse(resp *http.Response) {\n\tselect {\n\tcase <-pw.done:\n\tcase pw.respC <- resp:\n\t}\n}\n\nfunc (pw *pushWriter) replacePipe(p *io.PipeWriter) error {\n\tif pw.pipe == nil {\n\t\tpw.pipe = p\n\t\treturn nil\n\t}\n\n\tpw.pipe.CloseWithError(content.ErrReset)\n\tpw.pipe = p\n\n\t// If content has already been written, the bytes\n\t// cannot be written again and the caller must reset\n\tstatus, err := pw.tracker.GetStatus(pw.ref)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatus.Offset = 0\n\tstatus.UpdatedAt = time.Now()\n\tpw.tracker.SetStatus(pw.ref, status)\n\treturn content.ErrReset\n}\n\nfunc (pw *pushWriter) Write(p []byte) (n int, err error) {\n\tstatus, err := pw.tracker.GetStatus(pw.ref)\n\tif err != nil {\n\t\treturn n, err\n\t}\n\n\tif pw.pipe == nil {\n\t\tselect {\n\t\tcase <-pw.done:\n\t\t\treturn 0, io.ErrClosedPipe\n\t\tcase p := <-pw.pipeC:\n\t\t\tpw.replacePipe(p)\n\t\t}\n\t} else {\n\t\tselect {\n\t\tcase <-pw.done:\n\t\t\treturn 0, io.ErrClosedPipe\n\t\tcase p := <-pw.pipeC:\n\t\t\treturn 0, pw.replacePipe(p)\n\t\tdefault:\n\t\t}\n\t}\n\n\tn, err = pw.pipe.Write(p)\n\tif errors.Is(err, io.ErrClosedPipe) {\n\t\t// if the pipe is closed, we might have the original error on the error\n\t\t// channel - so we should try and get it\n\t\tselect {\n\t\tcase <-pw.done:\n\t\tcase err = <-pw.errC:\n\t\t\tpw.Close()\n\t\tcase p := <-pw.pipeC:\n\t\t\treturn 0, pw.replacePipe(p)\n\t\tcase resp := <-pw.respC:\n\t\t\tpw.setResponse(resp)\n\t\t}\n\t}\n\tstatus.Offset += int64(n)\n\tstatus.UpdatedAt = time.Now()\n\tpw.tracker.SetStatus(pw.ref, status)\n\treturn\n}\n\nfunc (pw *pushWriter) Close() error {\n\t// Ensure pipeC is closed but handle `Close()` being\n\t// called multiple times without panicking\n\tpw.closeOnce.Do(func() {\n\t\tclose(pw.done)\n\t})\n\tif pw.pipe != nil {\n\t\tstatus, err := pw.tracker.GetStatus(pw.ref)\n\t\tif err == nil && !status.Committed {\n\t\t\t// Closing an incomplete writer. Record this as an error so that following write can retry it.\n\t\t\tstatus.ErrClosed = errors.New(\"closed incomplete writer\")\n\t\t\tpw.tracker.SetStatus(pw.ref, status)\n\t\t}\n\t\treturn pw.pipe.Close()\n\t}\n\treturn nil\n}\n\nfunc (pw *pushWriter) Status() (content.Status, error) {\n\tstatus, err := pw.tracker.GetStatus(pw.ref)\n\tif err != nil {\n\t\treturn content.Status{}, err\n\t}\n\treturn status.Status, nil\n\n}\n\nfunc (pw *pushWriter) Digest() digest.Digest {\n\t// TODO: Get rid of this function?\n\treturn pw.expected\n}\n\nfunc (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error {\n\t// Check whether read has already thrown an error\n\tif _, err := pw.pipe.Write([]byte{}); err != nil && !errors.Is(err, io.ErrClosedPipe) {\n\t\treturn fmt.Errorf(\"pipe error before commit: %w\", err)\n\t}\n\n\tif err := pw.pipe.Close(); err != nil {\n\t\treturn err\n\t}\n\t// TODO: timeout waiting for response\n\tvar resp *http.Response\n\tselect {\n\tcase <-pw.done:\n\t\treturn io.ErrClosedPipe\n\tcase err := <-pw.errC:\n\t\tpw.Close()\n\t\treturn err\n\tcase resp = <-pw.respC:\n\t\tdefer resp.Body.Close()\n\tcase p := <-pw.pipeC:\n\t\t// check whether the pipe has changed in the commit, because sometimes Write\n\t\t// can complete successfully, but the pipe may have changed. In that case, the\n\t\t// content needs to be reset.\n\t\treturn pw.replacePipe(p)\n\t}\n\n\t// 201 is specified return status, some registries return\n\t// 200, 202 or 204.\n\tswitch resp.StatusCode {\n\tcase http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted:\n\tdefault:\n\t\treturn remoteserrors.NewUnexpectedStatusErr(resp)\n\t}\n\n\tstatus, err := pw.tracker.GetStatus(pw.ref)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get status: %w\", err)\n\t}\n\n\tif size > 0 && size != status.Offset {\n\t\treturn fmt.Errorf(\"unexpected size %d, expected %d\", status.Offset, size)\n\t}\n\n\tif expected == \"\" {\n\t\texpected = status.Expected\n\t}\n\n\tactual, err := digest.Parse(resp.Header.Get(\"Docker-Content-Digest\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid content digest in response: %w\", err)\n\t}\n\n\tif actual != expected {\n\t\treturn fmt.Errorf(\"got digest %s, expected %s\", actual, expected)\n\t}\n\n\tstatus.Committed = true\n\tstatus.UpdatedAt = time.Now()\n\tpw.tracker.SetStatus(pw.ref, status)\n\n\treturn nil\n}\n\nfunc (pw *pushWriter) Truncate(size int64) error {\n\t// TODO: if blob close request and start new request at offset\n\t// TODO: always error on manifest\n\treturn errors.New(\"cannot truncate remote upload\")\n}\n\nfunc requestWithMountFrom(req *request, mount, from string) *request {\n\tcreq := *req\n\n\tsep := \"?\"\n\tif strings.Contains(creq.path, sep) {\n\t\tsep = \"&\"\n\t}\n\n\tcreq.path = creq.path + sep + \"mount=\" + mount + \"&from=\" + from\n\n\treturn &creq\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"net/http\"\n)\n\n// HostCapabilities represent the capabilities of the registry\n// host. This also represents the set of operations for which\n// the registry host may be trusted to perform.\n//\n// For example pushing is a capability which should only be\n// performed on an upstream source, not a mirror.\n// Resolving (the process of converting a name into a digest)\n// must be considered a trusted operation and only done by\n// a host which is trusted (or more preferably by secure process\n// which can prove the provenance of the mapping). A public\n// mirror should never be trusted to do a resolve action.\n//\n// | Registry Type    | Pull | Resolve | Push |\n// |------------------|------|---------|------|\n// | Public Registry  | yes  | yes     | yes  |\n// | Private Registry | yes  | yes     | yes  |\n// | Public Mirror    | yes  | no      | no   |\n// | Private Mirror   | yes  | yes     | no   |\ntype HostCapabilities uint8\n\nconst (\n\t// HostCapabilityPull represents the capability to fetch manifests\n\t// and blobs by digest\n\tHostCapabilityPull HostCapabilities = 1 << iota\n\n\t// HostCapabilityResolve represents the capability to fetch manifests\n\t// by name\n\tHostCapabilityResolve\n\n\t// HostCapabilityPush represents the capability to push blobs and\n\t// manifests\n\tHostCapabilityPush\n\n\t// Reserved for future capabilities (i.e. search, catalog, remove)\n)\n\n// Has checks whether the capabilities list has the provide capability\nfunc (c HostCapabilities) Has(t HostCapabilities) bool {\n\treturn c&t == t\n}\n\n// RegistryHost represents a complete configuration for a registry\n// host, representing the capabilities, authorizations, connection\n// configuration, and location.\ntype RegistryHost struct {\n\tClient       *http.Client\n\tAuthorizer   Authorizer\n\tHost         string\n\tScheme       string\n\tPath         string\n\tCapabilities HostCapabilities\n\tHeader       http.Header\n}\n\nfunc (h RegistryHost) isProxy(refhost string) bool {\n\tif refhost != h.Host {\n\t\tif refhost != \"docker.io\" || h.Host != \"registry-1.docker.io\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// RegistryHosts fetches the registry hosts for a given namespace,\n// provided by the host component of an distribution image reference.\ntype RegistryHosts func(string) ([]RegistryHost, error)\n\n// Registries joins multiple registry configuration functions, using the same\n// order as provided within the arguments. When an empty registry configuration\n// is returned with a nil error, the next function will be called.\n// NOTE: This function will not join configurations, as soon as a non-empty\n// configuration is returned from a configuration function, it will be returned\n// to the caller.\nfunc Registries(registries ...RegistryHosts) RegistryHosts {\n\treturn func(host string) ([]RegistryHost, error) {\n\t\tfor _, registry := range registries {\n\t\t\tconfig, err := registry(host)\n\t\t\tif err != nil {\n\t\t\t\treturn config, err\n\t\t\t}\n\t\t\tif len(config) > 0 {\n\t\t\t\treturn config, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, nil\n\t}\n}\n\ntype registryOpts struct {\n\tauthorizer Authorizer\n\tplainHTTP  func(string) (bool, error)\n\thost       func(string) (string, error)\n\tclient     *http.Client\n}\n\n// RegistryOpt defines a registry default option\ntype RegistryOpt func(*registryOpts)\n\n// WithPlainHTTP configures registries to use plaintext http scheme\n// for the provided host match function.\nfunc WithPlainHTTP(f func(string) (bool, error)) RegistryOpt {\n\treturn func(opts *registryOpts) {\n\t\topts.plainHTTP = f\n\t}\n}\n\n// WithAuthorizer configures the default authorizer for a registry\nfunc WithAuthorizer(a Authorizer) RegistryOpt {\n\treturn func(opts *registryOpts) {\n\t\topts.authorizer = a\n\t}\n}\n\n// WithHostTranslator defines the default translator to use for registry hosts\nfunc WithHostTranslator(h func(string) (string, error)) RegistryOpt {\n\treturn func(opts *registryOpts) {\n\t\topts.host = h\n\t}\n}\n\n// WithClient configures the default http client for a registry\nfunc WithClient(c *http.Client) RegistryOpt {\n\treturn func(opts *registryOpts) {\n\t\topts.client = c\n\t}\n}\n\n// ConfigureDefaultRegistries is used to create a default configuration for\n// registries. For more advanced configurations or per-domain setups,\n// the RegistryHosts interface should be used directly.\n// NOTE: This function will always return a non-empty value or error\nfunc ConfigureDefaultRegistries(ropts ...RegistryOpt) RegistryHosts {\n\tvar opts registryOpts\n\tfor _, opt := range ropts {\n\t\topt(&opts)\n\t}\n\n\treturn func(host string) ([]RegistryHost, error) {\n\t\tconfig := RegistryHost{\n\t\t\tClient:       opts.client,\n\t\t\tAuthorizer:   opts.authorizer,\n\t\t\tHost:         host,\n\t\t\tScheme:       \"https\",\n\t\t\tPath:         \"/v2\",\n\t\t\tCapabilities: HostCapabilityPull | HostCapabilityResolve | HostCapabilityPush,\n\t\t}\n\n\t\tif config.Client == nil {\n\t\t\tconfig.Client = http.DefaultClient\n\t\t}\n\n\t\tif opts.plainHTTP != nil {\n\t\t\tmatch, err := opts.plainHTTP(host)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif match {\n\t\t\t\tconfig.Scheme = \"http\"\n\t\t\t}\n\t\t}\n\n\t\tif opts.host != nil {\n\t\t\tvar err error\n\t\t\tconfig.Host, err = opts.host(config.Host)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else if host == \"docker.io\" {\n\t\t\tconfig.Host = \"registry-1.docker.io\"\n\t\t}\n\n\t\treturn []RegistryHost{config}, nil\n\t}\n}\n\n// MatchAllHosts is a host match function which is always true.\nfunc MatchAllHosts(string) (bool, error) {\n\treturn true, nil\n}\n\n// MatchLocalhost is a host match function which returns true for\n// localhost.\n//\n// Note: this does not handle matching of ip addresses in octal,\n// decimal or hex form.\nfunc MatchLocalhost(host string) (bool, error) {\n\tswitch {\n\tcase host == \"::1\":\n\t\treturn true, nil\n\tcase host == \"[::1]\":\n\t\treturn true, nil\n\t}\n\th, p, err := net.SplitHostPort(host)\n\n\t// addrError helps distinguish between errors of form\n\t// \"no colon in address\" and \"too many colons in address\".\n\t// The former is fine as the host string need not have a\n\t// port. Latter needs to be handled.\n\taddrError := &net.AddrError{\n\t\tErr:  \"missing port in address\",\n\t\tAddr: host,\n\t}\n\tif err != nil {\n\t\tif err.Error() != addrError.Error() {\n\t\t\treturn false, err\n\t\t}\n\t\t// host string without any port specified\n\t\th = host\n\t} else if len(p) == 0 {\n\t\treturn false, errors.New(\"invalid host name format\")\n\t}\n\n\t// use ipv4 dotted decimal for further checking\n\tif h == \"localhost\" {\n\t\th = \"127.0.0.1\"\n\t}\n\tip := net.ParseIP(h)\n\n\treturn ip.IsLoopback(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/core/remotes\"\n\t\"github.com/containerd/containerd/v2/core/remotes/docker/schema1\" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.\n\tremoteerrors \"github.com/containerd/containerd/v2/core/remotes/errors\"\n\t\"github.com/containerd/containerd/v2/pkg/reference\"\n\t\"github.com/containerd/containerd/v2/pkg/tracing\"\n\t\"github.com/containerd/containerd/v2/version\"\n)\n\nvar (\n\t// ErrInvalidAuthorization is used when credentials are passed to a server but\n\t// those credentials are rejected.\n\tErrInvalidAuthorization = errors.New(\"authorization failed\")\n\n\t// MaxManifestSize represents the largest size accepted from a registry\n\t// during resolution. Larger manifests may be accepted using a\n\t// resolution method other than the registry.\n\t//\n\t// NOTE: The max supported layers by some runtimes is 128 and individual\n\t// layers will not contribute more than 256 bytes, making a\n\t// reasonable limit for a large image manifests of 32K bytes.\n\t// 4M bytes represents a much larger upper bound for images which may\n\t// contain large annotations or be non-images. A proper manifest\n\t// design puts large metadata in subobjects, as is consistent the\n\t// intent of the manifest design.\n\tMaxManifestSize int64 = 4 * 1048 * 1048\n)\n\n// Authorizer is used to authorize HTTP requests based on 401 HTTP responses.\n// An Authorizer is responsible for caching tokens or credentials used by\n// requests.\ntype Authorizer interface {\n\t// Authorize sets the appropriate `Authorization` header on the given\n\t// request.\n\t//\n\t// If no authorization is found for the request, the request remains\n\t// unmodified. It may also add an `Authorization` header as\n\t//  \"bearer <some bearer token>\"\n\t//  \"basic <base64 encoded credentials>\"\n\t//\n\t// It may return remotes/errors.ErrUnexpectedStatus, which for example,\n\t// can be used by the caller to find out the status code returned by the registry.\n\tAuthorize(context.Context, *http.Request) error\n\n\t// AddResponses adds a 401 response for the authorizer to consider when\n\t// authorizing requests. The last response should be unauthorized and\n\t// the previous requests are used to consider redirects and retries\n\t// that may have led to the 401.\n\t//\n\t// If response is not handled, returns `ErrNotImplemented`\n\tAddResponses(context.Context, []*http.Response) error\n}\n\n// ResolverOptions are used to configured a new Docker register resolver\ntype ResolverOptions struct {\n\t// Hosts returns registry host configurations for a namespace.\n\tHosts RegistryHosts\n\n\t// Headers are the HTTP request header fields sent by the resolver\n\tHeaders http.Header\n\n\t// Tracker is used to track uploads to the registry. This is used\n\t// since the registry does not have upload tracking and the existing\n\t// mechanism for getting blob upload status is expensive.\n\tTracker StatusTracker\n\n\t// Authorizer is used to authorize registry requests\n\t//\n\t// Deprecated: use Hosts.\n\tAuthorizer Authorizer\n\n\t// Credentials provides username and secret given a host.\n\t// If username is empty but a secret is given, that secret\n\t// is interpreted as a long lived token.\n\t//\n\t// Deprecated: use Hosts.\n\tCredentials func(string) (string, string, error)\n\n\t// Host provides the hostname given a namespace.\n\t//\n\t// Deprecated: use Hosts.\n\tHost func(string) (string, error)\n\n\t// PlainHTTP specifies to use plain http and not https\n\t//\n\t// Deprecated: use Hosts.\n\tPlainHTTP bool\n\n\t// Client is the http client to used when making registry requests\n\t//\n\t// Deprecated: use Hosts.\n\tClient *http.Client\n}\n\n// DefaultHost is the default host function.\nfunc DefaultHost(ns string) (string, error) {\n\tif ns == \"docker.io\" {\n\t\treturn \"registry-1.docker.io\", nil\n\t}\n\treturn ns, nil\n}\n\ntype dockerResolver struct {\n\thosts         RegistryHosts\n\theader        http.Header\n\tresolveHeader http.Header\n\ttracker       StatusTracker\n}\n\n// NewResolver returns a new resolver to a Docker registry\nfunc NewResolver(options ResolverOptions) remotes.Resolver {\n\tif options.Tracker == nil {\n\t\toptions.Tracker = NewInMemoryTracker()\n\t}\n\n\tif options.Headers == nil {\n\t\toptions.Headers = make(http.Header)\n\t} else {\n\t\t// make a copy of the headers to avoid race due to concurrent map write\n\t\toptions.Headers = options.Headers.Clone()\n\t}\n\tif _, ok := options.Headers[\"User-Agent\"]; !ok {\n\t\toptions.Headers.Set(\"User-Agent\", \"containerd/\"+version.Version)\n\t}\n\n\tresolveHeader := http.Header{}\n\tif _, ok := options.Headers[\"Accept\"]; !ok {\n\t\t// set headers for all the types we support for resolution.\n\t\tresolveHeader.Set(\"Accept\", strings.Join([]string{\n\t\t\timages.MediaTypeDockerSchema2Manifest,\n\t\t\timages.MediaTypeDockerSchema2ManifestList,\n\t\t\tocispec.MediaTypeImageManifest,\n\t\t\tocispec.MediaTypeImageIndex, \"*/*\",\n\t\t}, \", \"))\n\t} else {\n\t\tresolveHeader[\"Accept\"] = options.Headers[\"Accept\"]\n\t\tdelete(options.Headers, \"Accept\")\n\t}\n\n\tif options.Hosts == nil {\n\t\topts := []RegistryOpt{}\n\t\tif options.Host != nil {\n\t\t\topts = append(opts, WithHostTranslator(options.Host))\n\t\t}\n\n\t\tif options.Authorizer == nil {\n\t\t\toptions.Authorizer = NewDockerAuthorizer(\n\t\t\t\tWithAuthClient(options.Client),\n\t\t\t\tWithAuthHeader(options.Headers),\n\t\t\t\tWithAuthCreds(options.Credentials))\n\t\t}\n\t\topts = append(opts, WithAuthorizer(options.Authorizer))\n\n\t\tif options.Client != nil {\n\t\t\topts = append(opts, WithClient(options.Client))\n\t\t}\n\t\tif options.PlainHTTP {\n\t\t\topts = append(opts, WithPlainHTTP(MatchAllHosts))\n\t\t} else {\n\t\t\topts = append(opts, WithPlainHTTP(MatchLocalhost))\n\t\t}\n\t\toptions.Hosts = ConfigureDefaultRegistries(opts...)\n\t}\n\treturn &dockerResolver{\n\t\thosts:         options.Hosts,\n\t\theader:        options.Headers,\n\t\tresolveHeader: resolveHeader,\n\t\ttracker:       options.Tracker,\n\t}\n}\n\nfunc getManifestMediaType(resp *http.Response) string {\n\t// Strip encoding data (manifests should always be ascii JSON)\n\tcontentType := resp.Header.Get(\"Content-Type\")\n\tif sp := strings.IndexByte(contentType, ';'); sp != -1 {\n\t\tcontentType = contentType[0:sp]\n\t}\n\n\t// As of Apr 30 2019 the registry.access.redhat.com registry does not specify\n\t// the content type of any data but uses schema1 manifests.\n\tif contentType == \"text/plain\" {\n\t\tcontentType = images.MediaTypeDockerSchema1Manifest\n\t}\n\treturn contentType\n}\n\ntype countingReader struct {\n\treader    io.Reader\n\tbytesRead int64\n}\n\nfunc (r *countingReader) Read(p []byte) (int, error) {\n\tn, err := r.reader.Read(p)\n\tr.bytesRead += int64(n)\n\treturn n, err\n}\n\nvar _ remotes.Resolver = &dockerResolver{}\n\nfunc (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocispec.Descriptor, error) {\n\tbase, err := r.resolveDockerBase(ref)\n\tif err != nil {\n\t\treturn \"\", ocispec.Descriptor{}, err\n\t}\n\trefspec := base.refspec\n\tif refspec.Object == \"\" {\n\t\treturn \"\", ocispec.Descriptor{}, reference.ErrObjectRequired\n\t}\n\n\tvar (\n\t\tpaths [][]string\n\t\tdgst  = refspec.Digest()\n\t\tcaps  = HostCapabilityPull\n\t)\n\n\tif dgst != \"\" {\n\t\tif err := dgst.Validate(); err != nil {\n\t\t\t// need to fail here, since we can't actually resolve the invalid\n\t\t\t// digest.\n\t\t\treturn \"\", ocispec.Descriptor{}, err\n\t\t}\n\n\t\t// turns out, we have a valid digest, make a url.\n\t\tpaths = append(paths, []string{\"manifests\", dgst.String()})\n\n\t\t// fallback to blobs on not found.\n\t\tpaths = append(paths, []string{\"blobs\", dgst.String()})\n\t} else {\n\t\t// Add\n\t\tpaths = append(paths, []string{\"manifests\", refspec.Object})\n\t\tcaps |= HostCapabilityResolve\n\t}\n\n\thosts := base.filterHosts(caps)\n\tif len(hosts) == 0 {\n\t\treturn \"\", ocispec.Descriptor{}, fmt.Errorf(\"no resolve hosts: %w\", errdefs.ErrNotFound)\n\t}\n\n\tctx, err = ContextWithRepositoryScope(ctx, refspec, false)\n\tif err != nil {\n\t\treturn \"\", ocispec.Descriptor{}, err\n\t}\n\n\tvar (\n\t\t// firstErr is the most relevant error encountered during resolution.\n\t\t// We use this to determine the error to return, making sure that the\n\t\t// error created furthest through the resolution process is returned.\n\t\tfirstErr         error\n\t\tfirstErrPriority int\n\t)\n\n\tnextHostOrFail := func(i int) string {\n\t\tif i < len(hosts)-1 {\n\t\t\treturn \"trying next host\"\n\t\t}\n\t\treturn \"fetch failed\"\n\t}\n\n\tfor _, u := range paths {\n\t\tfor i, host := range hosts {\n\t\t\tctx := log.WithLogger(ctx, log.G(ctx).WithField(\"host\", host.Host))\n\n\t\t\treq := base.request(host, http.MethodHead, u...)\n\t\t\tif err := req.addNamespace(base.refspec.Hostname()); err != nil {\n\t\t\t\treturn \"\", ocispec.Descriptor{}, err\n\t\t\t}\n\n\t\t\tfor key, value := range r.resolveHeader {\n\t\t\t\treq.header[key] = append(req.header[key], value...)\n\t\t\t}\n\n\t\t\tlog.G(ctx).Debug(\"resolving\")\n\t\t\tresp, err := req.doWithRetries(ctx, nil)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, ErrInvalidAuthorization) {\n\t\t\t\t\terr = fmt.Errorf(\"pull access denied, repository does not exist or may require authorization: %w\", err)\n\t\t\t\t}\n\t\t\t\tif firstErrPriority < 1 {\n\t\t\t\t\tfirstErr = err\n\t\t\t\t\tfirstErrPriority = 1\n\t\t\t\t}\n\t\t\t\tlog.G(ctx).WithError(err).Info(nextHostOrFail(i))\n\t\t\t\tcontinue // try another host\n\t\t\t}\n\t\t\tresp.Body.Close() // don't care about body contents.\n\n\t\t\tif resp.StatusCode > 299 {\n\t\t\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\t\t\tif firstErrPriority < 2 {\n\t\t\t\t\t\tfirstErr = fmt.Errorf(\"%s: %w\", ref, errdefs.ErrNotFound)\n\t\t\t\t\t\tfirstErrPriority = 2\n\t\t\t\t\t}\n\t\t\t\t\tlog.G(ctx).Infof(\"%s after status: %s\", nextHostOrFail(i), resp.Status)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif resp.StatusCode > 399 {\n\t\t\t\t\tif firstErrPriority < 3 {\n\t\t\t\t\t\tfirstErr = remoteerrors.NewUnexpectedStatusErr(resp)\n\t\t\t\t\t\tfirstErrPriority = 3\n\t\t\t\t\t}\n\t\t\t\t\tlog.G(ctx).Infof(\"%s after status: %s\", nextHostOrFail(i), resp.Status)\n\t\t\t\t\tcontinue // try another host\n\t\t\t\t}\n\t\t\t\treturn \"\", ocispec.Descriptor{}, remoteerrors.NewUnexpectedStatusErr(resp)\n\t\t\t}\n\t\t\tsize := resp.ContentLength\n\t\t\tcontentType := getManifestMediaType(resp)\n\n\t\t\t// if no digest was provided, then only a resolve\n\t\t\t// trusted registry was contacted, in this case use\n\t\t\t// the digest header (or content from GET)\n\t\t\tif dgst == \"\" {\n\t\t\t\t// this is the only point at which we trust the registry. we use the\n\t\t\t\t// content headers to assemble a descriptor for the name. when this becomes\n\t\t\t\t// more robust, we mostly get this information from a secure trust store.\n\t\t\t\tdgstHeader := digest.Digest(resp.Header.Get(\"Docker-Content-Digest\"))\n\n\t\t\t\tif dgstHeader != \"\" && size != -1 {\n\t\t\t\t\tif err := dgstHeader.Validate(); err != nil {\n\t\t\t\t\t\treturn \"\", ocispec.Descriptor{}, fmt.Errorf(\"%q in header not a valid digest: %w\", dgstHeader, err)\n\t\t\t\t\t}\n\t\t\t\t\tdgst = dgstHeader\n\t\t\t\t}\n\t\t\t}\n\t\t\tif dgst == \"\" || size == -1 {\n\t\t\t\tlog.G(ctx).Debug(\"no Docker-Content-Digest header, fetching manifest instead\")\n\n\t\t\t\treq = base.request(host, http.MethodGet, u...)\n\t\t\t\tif err := req.addNamespace(base.refspec.Hostname()); err != nil {\n\t\t\t\t\treturn \"\", ocispec.Descriptor{}, err\n\t\t\t\t}\n\n\t\t\t\tfor key, value := range r.resolveHeader {\n\t\t\t\t\treq.header[key] = append(req.header[key], value...)\n\t\t\t\t}\n\n\t\t\t\tresp, err := req.doWithRetries(ctx, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", ocispec.Descriptor{}, err\n\t\t\t\t}\n\n\t\t\t\tbodyReader := countingReader{reader: resp.Body}\n\n\t\t\t\tcontentType = getManifestMediaType(resp)\n\t\t\t\terr = func() error {\n\t\t\t\t\tdefer resp.Body.Close()\n\t\t\t\t\tif dgst != \"\" {\n\t\t\t\t\t\t_, err = io.Copy(io.Discard, &bodyReader)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\n\t\t\t\t\tif contentType == images.MediaTypeDockerSchema1Manifest {\n\t\t\t\t\t\tb, err := schema1.ReadStripSignature(&bodyReader)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdgst = digest.FromBytes(b)\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\n\t\t\t\t\tdgst, err = digest.FromReader(&bodyReader)\n\t\t\t\t\treturn err\n\t\t\t\t}()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", ocispec.Descriptor{}, err\n\t\t\t\t}\n\t\t\t\tsize = bodyReader.bytesRead\n\t\t\t}\n\t\t\t// Prevent resolving to excessively large manifests\n\t\t\tif size > MaxManifestSize {\n\t\t\t\tif firstErrPriority < 4 {\n\t\t\t\t\tfirstErr = fmt.Errorf(\"rejecting %d byte manifest for %s: %w\", size, ref, errdefs.ErrNotFound)\n\t\t\t\t\tfirstErrPriority = 4\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tdesc := ocispec.Descriptor{\n\t\t\t\tDigest:    dgst,\n\t\t\t\tMediaType: contentType,\n\t\t\t\tSize:      size,\n\t\t\t}\n\n\t\t\tlog.G(ctx).WithField(\"desc.digest\", desc.Digest).Debug(\"resolved\")\n\t\t\treturn ref, desc, nil\n\t\t}\n\t}\n\n\t// If above loop terminates without return or error, then no registries\n\t// were provided.\n\tif firstErr == nil {\n\t\tfirstErr = fmt.Errorf(\"%s: %w\", ref, errdefs.ErrNotFound)\n\t}\n\n\treturn \"\", ocispec.Descriptor{}, firstErr\n}\n\nfunc (r *dockerResolver) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) {\n\tbase, err := r.resolveDockerBase(ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn dockerFetcher{\n\t\tdockerBase: base,\n\t}, nil\n}\n\nfunc (r *dockerResolver) Pusher(ctx context.Context, ref string) (remotes.Pusher, error) {\n\tbase, err := r.resolveDockerBase(ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn dockerPusher{\n\t\tdockerBase: base,\n\t\tobject:     base.refspec.Object,\n\t\ttracker:    r.tracker,\n\t}, nil\n}\n\nfunc (r *dockerResolver) resolveDockerBase(ref string) (*dockerBase, error) {\n\trefspec, err := reference.Parse(ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn r.base(refspec)\n}\n\ntype dockerBase struct {\n\trefspec    reference.Spec\n\trepository string\n\thosts      []RegistryHost\n\theader     http.Header\n}\n\nfunc (r *dockerResolver) base(refspec reference.Spec) (*dockerBase, error) {\n\thost := refspec.Hostname()\n\thosts, err := r.hosts(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &dockerBase{\n\t\trefspec:    refspec,\n\t\trepository: strings.TrimPrefix(refspec.Locator, host+\"/\"),\n\t\thosts:      hosts,\n\t\theader:     r.header,\n\t}, nil\n}\n\nfunc (r *dockerBase) filterHosts(caps HostCapabilities) (hosts []RegistryHost) {\n\tfor _, host := range r.hosts {\n\t\tif host.Capabilities.Has(caps) {\n\t\t\thosts = append(hosts, host)\n\t\t}\n\t}\n\treturn\n}\n\nfunc (r *dockerBase) request(host RegistryHost, method string, ps ...string) *request {\n\theader := r.header.Clone()\n\tif header == nil {\n\t\theader = http.Header{}\n\t}\n\n\tfor key, value := range host.Header {\n\t\theader[key] = append(header[key], value...)\n\t}\n\tparts := append([]string{\"/\", host.Path, r.repository}, ps...)\n\tp := path.Join(parts...)\n\t// Join strips trailing slash, re-add ending \"/\" if included\n\tif len(parts) > 0 && strings.HasSuffix(parts[len(parts)-1], \"/\") {\n\t\tp = p + \"/\"\n\t}\n\treturn &request{\n\t\tmethod: method,\n\t\tpath:   p,\n\t\theader: header,\n\t\thost:   host,\n\t}\n}\n\nfunc (r *request) authorize(ctx context.Context, req *http.Request) error {\n\t// Check if has header for host\n\tif r.host.Authorizer != nil {\n\t\tif err := r.host.Authorizer.Authorize(ctx, req); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (r *request) addNamespace(ns string) (err error) {\n\tif !r.host.isProxy(ns) {\n\t\treturn nil\n\t}\n\tvar q url.Values\n\t// Parse query\n\tif i := strings.IndexByte(r.path, '?'); i > 0 {\n\t\tr.path = r.path[:i+1]\n\t\tq, err = url.ParseQuery(r.path[i+1:])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tr.path = r.path + \"?\"\n\t\tq = url.Values{}\n\t}\n\tq.Add(\"ns\", ns)\n\n\tr.path = r.path + q.Encode()\n\n\treturn\n}\n\ntype request struct {\n\tmethod string\n\tpath   string\n\theader http.Header\n\thost   RegistryHost\n\tbody   func() (io.ReadCloser, error)\n\tsize   int64\n}\n\nfunc (r *request) do(ctx context.Context) (*http.Response, error) {\n\tu := r.host.Scheme + \"://\" + r.host.Host + r.path\n\treq, err := http.NewRequestWithContext(ctx, r.method, u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif r.header == nil {\n\t\treq.Header = http.Header{}\n\t} else {\n\t\treq.Header = r.header.Clone() // headers need to be copied to avoid concurrent map access\n\t}\n\tif r.body != nil {\n\t\tbody, err := r.body()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treq.Body = body\n\t\treq.GetBody = r.body\n\t\tif r.size > 0 {\n\t\t\treq.ContentLength = r.size\n\t\t}\n\t}\n\n\tctx = log.WithLogger(ctx, log.G(ctx).WithField(\"url\", u))\n\tlog.G(ctx).WithFields(requestFields(req)).Debug(\"do request\")\n\tif err := r.authorize(ctx, req); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to authorize: %w\", err)\n\t}\n\n\tclient := &http.Client{}\n\tif r.host.Client != nil {\n\t\t*client = *r.host.Client\n\t}\n\tif client.CheckRedirect == nil {\n\t\tclient.CheckRedirect = func(req *http.Request, via []*http.Request) error {\n\t\t\tif len(via) >= 10 {\n\t\t\t\treturn errors.New(\"stopped after 10 redirects\")\n\t\t\t}\n\t\t\tif err := r.authorize(ctx, req); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to authorize redirect: %w\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\n\ttracing.UpdateHTTPClient(client, tracing.Name(\"remotes.docker.resolver\", \"HTTPRequest\"))\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to do request: %w\", err)\n\t}\n\tlog.G(ctx).WithFields(responseFields(resp)).Debug(\"fetch response received\")\n\treturn resp, nil\n}\n\nfunc (r *request) doWithRetries(ctx context.Context, responses []*http.Response) (*http.Response, error) {\n\tresp, err := r.do(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponses = append(responses, resp)\n\tretry, err := r.retryRequest(ctx, responses)\n\tif err != nil {\n\t\tresp.Body.Close()\n\t\treturn nil, err\n\t}\n\tif retry {\n\t\tresp.Body.Close()\n\t\treturn r.doWithRetries(ctx, responses)\n\t}\n\treturn resp, err\n}\n\nfunc (r *request) retryRequest(ctx context.Context, responses []*http.Response) (bool, error) {\n\tif len(responses) > 5 {\n\t\treturn false, nil\n\t}\n\tlast := responses[len(responses)-1]\n\tswitch last.StatusCode {\n\tcase http.StatusUnauthorized:\n\t\tlog.G(ctx).WithField(\"header\", last.Header.Get(\"WWW-Authenticate\")).Debug(\"Unauthorized\")\n\t\tif r.host.Authorizer != nil {\n\t\t\tif err := r.host.Authorizer.AddResponses(ctx, responses); err == nil {\n\t\t\t\treturn true, nil\n\t\t\t} else if !errdefs.IsNotImplemented(err) {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\n\t\treturn false, nil\n\tcase http.StatusMethodNotAllowed:\n\t\t// Support registries which have not properly implemented the HEAD method for\n\t\t// manifests endpoint\n\t\tif r.method == http.MethodHead && strings.Contains(r.path, \"/manifests/\") {\n\t\t\tr.method = http.MethodGet\n\t\t\treturn true, nil\n\t\t}\n\tcase http.StatusRequestTimeout, http.StatusTooManyRequests:\n\t\treturn true, nil\n\t}\n\n\t// TODO: Handle 50x errors accounting for attempt history\n\treturn false, nil\n}\n\nfunc (r *request) String() string {\n\treturn r.host.Scheme + \"://\" + r.host.Host + r.path\n}\n\nfunc requestFields(req *http.Request) log.Fields {\n\tfields := map[string]interface{}{\n\t\t\"request.method\": req.Method,\n\t}\n\tfor k, vals := range req.Header {\n\t\tk = strings.ToLower(k)\n\t\tif k == \"authorization\" {\n\t\t\tcontinue\n\t\t}\n\t\tfor i, v := range vals {\n\t\t\tfield := \"request.header.\" + k\n\t\t\tif i > 0 {\n\t\t\t\tfield = fmt.Sprintf(\"%s.%d\", field, i)\n\t\t\t}\n\t\t\tfields[field] = v\n\t\t}\n\t}\n\n\treturn fields\n}\n\nfunc responseFields(resp *http.Response) log.Fields {\n\tfields := map[string]interface{}{\n\t\t\"response.status\": resp.Status,\n\t}\n\tfor k, vals := range resp.Header {\n\t\tk = strings.ToLower(k)\n\t\tfor i, v := range vals {\n\t\t\tfield := \"response.header.\" + k\n\t\t\tif i > 0 {\n\t\t\t\tfield = fmt.Sprintf(\"%s.%d\", field, i)\n\t\t\t}\n\t\t\tfields[field] = v\n\t\t}\n\t}\n\n\treturn fields\n}\n\n// IsLocalhost checks if the registry host is local.\nfunc IsLocalhost(host string) bool {\n\tif h, _, err := net.SplitHostPort(host); err == nil {\n\t\thost = h\n\t}\n\n\tif host == \"localhost\" {\n\t\treturn true\n\t}\n\n\tip := net.ParseIP(host)\n\treturn ip.IsLoopback()\n}\n\n// NewHTTPFallback returns http.RoundTripper which allows fallback from https to\n// http for registry endpoints with configurations for both http and TLS,\n// such as defaulted localhost endpoints.\nfunc NewHTTPFallback(transport http.RoundTripper) http.RoundTripper {\n\treturn &httpFallback{\n\t\tsuper: transport,\n\t}\n}\n\ntype httpFallback struct {\n\tsuper http.RoundTripper\n\thost  string\n\tmu    sync.Mutex\n}\n\nfunc (f *httpFallback) RoundTrip(r *http.Request) (*http.Response, error) {\n\tf.mu.Lock()\n\tfallback := f.host == r.URL.Host\n\tf.mu.Unlock()\n\n\t// only fall back if the same host had previously fell back\n\tif !fallback {\n\t\tresp, err := f.super.RoundTrip(r)\n\t\tif !isTLSError(err) && !isPortError(err, r.URL.Host) {\n\t\t\treturn resp, err\n\t\t}\n\t}\n\n\tplainHTTPUrl := *r.URL\n\tplainHTTPUrl.Scheme = \"http\"\n\n\tplainHTTPRequest := *r\n\tplainHTTPRequest.URL = &plainHTTPUrl\n\n\tif !fallback {\n\t\tf.mu.Lock()\n\t\tif f.host != r.URL.Host {\n\t\t\tf.host = r.URL.Host\n\t\t}\n\t\tf.mu.Unlock()\n\n\t\t// update body on the second attempt\n\t\tif r.Body != nil && r.GetBody != nil {\n\t\t\tbody, err := r.GetBody()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tplainHTTPRequest.Body = body\n\t\t}\n\t}\n\n\treturn f.super.RoundTrip(&plainHTTPRequest)\n}\n\nfunc isTLSError(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tvar tlsErr tls.RecordHeaderError\n\tif errors.As(err, &tlsErr) && string(tlsErr.RecordHeader[:]) == \"HTTP/\" {\n\t\treturn true\n\t}\n\tif strings.Contains(err.Error(), \"TLS handshake timeout\") {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc isPortError(err error, host string) bool {\n\tif isConnError(err) || os.IsTimeout(err) {\n\t\tif _, port, _ := net.SplitHostPort(host); port != \"\" {\n\t\t\t// Port is specified, will not retry on different port with scheme change\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_unix.go",
    "content": "//go:build !windows\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n)\n\nfunc isConnError(err error) bool {\n\treturn errors.Is(err, syscall.ECONNREFUSED)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_windows.go",
    "content": "//go:build windows\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc isConnError(err error) bool {\n\treturn errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, windows.WSAECONNREFUSED)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/schema1/converter.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package schema1 provides a converter to fetch an image formatted in Docker Image Manifest v2, Schema 1.\n//\n// Deprecated: use images formatted in Docker Image Manifest v2, Schema 2, or OCI Image Spec v1.\npackage schema1\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/core/remotes\"\n\t\"github.com/containerd/containerd/v2/pkg/archive/compression\"\n\t\"github.com/containerd/containerd/v2/pkg/deprecation\"\n\t\"github.com/containerd/containerd/v2/pkg/labels\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tspecs \"github.com/opencontainers/image-spec/specs-go\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\nconst (\n\tmanifestSizeLimit            = 8e6 // 8MB\n\tlabelDockerSchema1EmptyLayer = \"containerd.io/docker.schema1.empty-layer\"\n)\n\ntype blobState struct {\n\tdiffID digest.Digest\n\tempty  bool\n}\n\n// Converter converts schema1 manifests to schema2 on fetch\ntype Converter struct {\n\tcontentStore content.Store\n\tfetcher      remotes.Fetcher\n\n\tpulledManifest *manifest\n\n\tmu         sync.Mutex\n\tblobMap    map[digest.Digest]blobState\n\tlayerBlobs map[digest.Digest]ocispec.Descriptor\n}\n\nvar ErrDisabled = fmt.Errorf(\"Pulling Schema 1 images have been deprecated and disabled by default since containerd v2.0. \"+\n\t\"As a workaround you may set an environment variable `%s=1`, but this will be completely removed in containerd v2.1.\",\n\tdeprecation.EnvPullSchema1Image)\n\n// NewConverter returns a new converter\nfunc NewConverter(contentStore content.Store, fetcher remotes.Fetcher) (*Converter, error) {\n\ts := os.Getenv(deprecation.EnvPullSchema1Image)\n\tif s == \"\" {\n\t\treturn nil, ErrDisabled\n\t}\n\tenable, err := strconv.ParseBool(s)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse `%s=%s`: %w\", deprecation.EnvPullSchema1Image, s, err)\n\t}\n\tif !enable {\n\t\treturn nil, ErrDisabled\n\t}\n\tlog.L.Warn(ErrDisabled)\n\treturn &Converter{\n\t\tcontentStore: contentStore,\n\t\tfetcher:      fetcher,\n\t\tblobMap:      map[digest.Digest]blobState{},\n\t\tlayerBlobs:   map[digest.Digest]ocispec.Descriptor{},\n\t}, nil\n}\n\n// Handle fetching descriptors for a docker media type\nfunc (c *Converter) Handle(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\tswitch desc.MediaType {\n\tcase images.MediaTypeDockerSchema1Manifest:\n\t\tif err := c.fetchManifest(ctx, desc); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tm := c.pulledManifest\n\t\tif len(m.FSLayers) != len(m.History) {\n\t\t\treturn nil, errors.New(\"invalid schema 1 manifest, history and layer mismatch\")\n\t\t}\n\t\tdescs := make([]ocispec.Descriptor, 0, len(c.pulledManifest.FSLayers))\n\n\t\tfor i := range m.FSLayers {\n\t\t\tif _, ok := c.blobMap[c.pulledManifest.FSLayers[i].BlobSum]; !ok {\n\t\t\t\tempty, err := isEmptyLayer([]byte(m.History[i].V1Compatibility))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\t// Do no attempt to download a known empty blob\n\t\t\t\tif !empty {\n\t\t\t\t\tdescs = append([]ocispec.Descriptor{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMediaType: images.MediaTypeDockerSchema2LayerGzip,\n\t\t\t\t\t\t\tDigest:    c.pulledManifest.FSLayers[i].BlobSum,\n\t\t\t\t\t\t\tSize:      -1,\n\t\t\t\t\t\t},\n\t\t\t\t\t}, descs...)\n\t\t\t\t}\n\t\t\t\tc.blobMap[c.pulledManifest.FSLayers[i].BlobSum] = blobState{\n\t\t\t\t\tempty: empty,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn descs, nil\n\tcase images.MediaTypeDockerSchema2LayerGzip:\n\t\tif c.pulledManifest == nil {\n\t\t\treturn nil, errors.New(\"manifest required for schema 1 blob pull\")\n\t\t}\n\t\treturn nil, c.fetchBlob(ctx, desc)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%v not support for schema 1 manifests\", desc.MediaType)\n\t}\n}\n\n// ConvertOptions provides options on converting a docker schema1 manifest.\ntype ConvertOptions struct {\n\t// ManifestMediaType specifies the media type of the manifest OCI descriptor.\n\tManifestMediaType string\n\n\t// ConfigMediaType specifies the media type of the manifest config OCI\n\t// descriptor.\n\tConfigMediaType string\n}\n\n// ConvertOpt allows configuring a convert operation.\ntype ConvertOpt func(context.Context, *ConvertOptions) error\n\n// UseDockerSchema2 is used to indicate that a schema1 manifest should be\n// converted into the media types for a docker schema2 manifest.\nfunc UseDockerSchema2() ConvertOpt {\n\treturn func(ctx context.Context, o *ConvertOptions) error {\n\t\to.ManifestMediaType = images.MediaTypeDockerSchema2Manifest\n\t\to.ConfigMediaType = images.MediaTypeDockerSchema2Config\n\t\treturn nil\n\t}\n}\n\n// Convert a docker manifest to an OCI descriptor\nfunc (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.Descriptor, error) {\n\tco := ConvertOptions{\n\t\tManifestMediaType: ocispec.MediaTypeImageManifest,\n\t\tConfigMediaType:   ocispec.MediaTypeImageConfig,\n\t}\n\tfor _, opt := range opts {\n\t\tif err := opt(ctx, &co); err != nil {\n\t\t\treturn ocispec.Descriptor{}, err\n\t\t}\n\t}\n\n\thistory, diffIDs, err := c.schema1ManifestHistory()\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"schema 1 conversion failed: %w\", err)\n\t}\n\n\tvar img ocispec.Image\n\tif err := json.Unmarshal([]byte(c.pulledManifest.History[0].V1Compatibility), &img); err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to unmarshal image from schema 1 history: %w\", err)\n\t}\n\n\timg.History = history\n\timg.RootFS = ocispec.RootFS{\n\t\tType:    \"layers\",\n\t\tDiffIDs: diffIDs,\n\t}\n\n\tb, err := json.MarshalIndent(img, \"\", \"   \")\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to marshal image: %w\", err)\n\t}\n\n\tconfig := ocispec.Descriptor{\n\t\tMediaType: co.ConfigMediaType,\n\t\tDigest:    digest.Canonical.FromBytes(b),\n\t\tSize:      int64(len(b)),\n\t}\n\n\tlayers := make([]ocispec.Descriptor, len(diffIDs))\n\tfor i, diffID := range diffIDs {\n\t\tlayers[i] = c.layerBlobs[diffID]\n\t}\n\n\tmanifest := ocispec.Manifest{\n\t\tVersioned: specs.Versioned{\n\t\t\tSchemaVersion: 2,\n\t\t},\n\t\tConfig: config,\n\t\tLayers: layers,\n\t}\n\n\tmb, err := json.MarshalIndent(manifest, \"\", \"   \")\n\tif err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to marshal image: %w\", err)\n\t}\n\n\tdesc := ocispec.Descriptor{\n\t\tMediaType: co.ManifestMediaType,\n\t\tDigest:    digest.Canonical.FromBytes(mb),\n\t\tSize:      int64(len(mb)),\n\t}\n\n\tlabels := map[string]string{}\n\tlabels[\"containerd.io/gc.ref.content.0\"] = manifest.Config.Digest.String()\n\tfor i, ch := range manifest.Layers {\n\t\tlabels[fmt.Sprintf(\"containerd.io/gc.ref.content.%d\", i+1)] = ch.Digest.String()\n\t}\n\n\tref := remotes.MakeRefKey(ctx, desc)\n\tif err := content.WriteBlob(ctx, c.contentStore, ref, bytes.NewReader(mb), desc, content.WithLabels(labels)); err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to write image manifest: %w\", err)\n\t}\n\n\tref = remotes.MakeRefKey(ctx, config)\n\tif err := content.WriteBlob(ctx, c.contentStore, ref, bytes.NewReader(b), config); err != nil {\n\t\treturn ocispec.Descriptor{}, fmt.Errorf(\"failed to write image config: %w\", err)\n\t}\n\n\treturn desc, nil\n}\n\n// ReadStripSignature reads in a schema1 manifest and returns a byte array\n// with the \"signatures\" field stripped\nfunc ReadStripSignature(schema1Blob io.Reader) ([]byte, error) {\n\tb, err := io.ReadAll(io.LimitReader(schema1Blob, manifestSizeLimit)) // limit to 8MB\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn stripSignature(b)\n}\n\nfunc (c *Converter) fetchManifest(ctx context.Context, desc ocispec.Descriptor) error {\n\tlog.G(ctx).Debug(\"fetch schema 1\")\n\n\trc, err := c.fetcher.Fetch(ctx, desc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb, err := ReadStripSignature(rc)\n\trc.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar m manifest\n\tif err := json.Unmarshal(b, &m); err != nil {\n\t\treturn err\n\t}\n\tif len(m.Manifests) != 0 || len(m.Layers) != 0 {\n\t\treturn errors.New(\"converter: expected schema1 document but found extra keys\")\n\t}\n\tc.pulledManifest = &m\n\n\treturn nil\n}\n\nfunc (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) error {\n\tlog.G(ctx).Debug(\"fetch blob\")\n\n\tvar (\n\t\tref            = remotes.MakeRefKey(ctx, desc)\n\t\tcalc           = newBlobStateCalculator()\n\t\tcompressMethod = compression.Gzip\n\t)\n\n\t// size may be unknown, set to zero for content ingest\n\tingestDesc := desc\n\tif ingestDesc.Size == -1 {\n\t\tingestDesc.Size = 0\n\t}\n\n\tcw, err := content.OpenWriter(ctx, c.contentStore, content.WithRef(ref), content.WithDescriptor(ingestDesc))\n\tif err != nil {\n\t\tif !errdefs.IsAlreadyExists(err) {\n\t\t\treturn err\n\t\t}\n\n\t\treuse, err := c.reuseLabelBlobState(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif reuse {\n\t\t\treturn nil\n\t\t}\n\n\t\tra, err := c.contentStore.ReaderAt(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer ra.Close()\n\n\t\tr, err := compression.DecompressStream(content.NewReader(ra))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcompressMethod = r.GetCompression()\n\t\t_, err = io.Copy(calc, r)\n\t\tr.Close()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tdefer cw.Close()\n\n\t\trc, err := c.fetcher.Fetch(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer rc.Close()\n\n\t\teg, _ := errgroup.WithContext(ctx)\n\t\tpr, pw := io.Pipe()\n\n\t\teg.Go(func() error {\n\t\t\tr, err := compression.DecompressStream(pr)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tcompressMethod = r.GetCompression()\n\t\t\t_, err = io.Copy(calc, r)\n\t\t\tr.Close()\n\t\t\tpr.CloseWithError(err)\n\t\t\treturn err\n\t\t})\n\n\t\teg.Go(func() error {\n\t\t\tdefer pw.Close()\n\n\t\t\treturn content.Copy(ctx, cw, io.TeeReader(rc, pw), ingestDesc.Size, ingestDesc.Digest)\n\t\t})\n\n\t\tif err := eg.Wait(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif desc.Size == -1 {\n\t\tinfo, err := c.contentStore.Info(ctx, desc.Digest)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get blob info: %w\", err)\n\t\t}\n\t\tdesc.Size = info.Size\n\t}\n\n\tif compressMethod == compression.Uncompressed {\n\t\tlog.G(ctx).WithField(\"id\", desc.Digest).Debugf(\"changed media type for uncompressed schema1 layer blob\")\n\t\tdesc.MediaType = images.MediaTypeDockerSchema2Layer\n\t}\n\n\tstate := calc.State()\n\n\tcinfo := content.Info{\n\t\tDigest: desc.Digest,\n\t\tLabels: map[string]string{\n\t\t\tlabels.LabelUncompressed:     state.diffID.String(),\n\t\t\tlabelDockerSchema1EmptyLayer: strconv.FormatBool(state.empty),\n\t\t},\n\t}\n\n\tif _, err := c.contentStore.Update(ctx, cinfo, \"labels.\"+labels.LabelUncompressed, fmt.Sprintf(\"labels.%s\", labelDockerSchema1EmptyLayer)); err != nil {\n\t\treturn fmt.Errorf(\"failed to update uncompressed label: %w\", err)\n\t}\n\n\tc.mu.Lock()\n\tc.blobMap[desc.Digest] = state\n\tc.layerBlobs[state.diffID] = desc\n\tc.mu.Unlock()\n\n\treturn nil\n}\n\nfunc (c *Converter) reuseLabelBlobState(ctx context.Context, desc ocispec.Descriptor) (bool, error) {\n\tcinfo, err := c.contentStore.Info(ctx, desc.Digest)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get blob info: %w\", err)\n\t}\n\tdesc.Size = cinfo.Size\n\n\tdiffID, ok := cinfo.Labels[labels.LabelUncompressed]\n\tif !ok {\n\t\treturn false, nil\n\t}\n\n\temptyVal, ok := cinfo.Labels[labelDockerSchema1EmptyLayer]\n\tif !ok {\n\t\treturn false, nil\n\t}\n\n\tisEmpty, err := strconv.ParseBool(emptyVal)\n\tif err != nil {\n\t\tlog.G(ctx).WithField(\"id\", desc.Digest).Warnf(\"failed to parse bool from label %s: %v\", labelDockerSchema1EmptyLayer, isEmpty)\n\t\treturn false, nil\n\t}\n\n\tbState := blobState{empty: isEmpty}\n\n\tif bState.diffID, err = digest.Parse(diffID); err != nil {\n\t\tlog.G(ctx).WithField(\"id\", desc.Digest).Warnf(\"failed to parse digest from label %s: %v\", labels.LabelUncompressed, diffID)\n\t\treturn false, nil\n\t}\n\n\t// NOTE: there is no need to read header to get compression method\n\t// because there are only two kinds of methods.\n\tif bState.diffID == desc.Digest {\n\t\tdesc.MediaType = images.MediaTypeDockerSchema2Layer\n\t} else {\n\t\tdesc.MediaType = images.MediaTypeDockerSchema2LayerGzip\n\t}\n\n\tc.mu.Lock()\n\tc.blobMap[desc.Digest] = bState\n\tc.layerBlobs[bState.diffID] = desc\n\tc.mu.Unlock()\n\treturn true, nil\n}\n\nfunc (c *Converter) schema1ManifestHistory() ([]ocispec.History, []digest.Digest, error) {\n\tif c.pulledManifest == nil {\n\t\treturn nil, nil, errors.New(\"missing schema 1 manifest for conversion\")\n\t}\n\tm := *c.pulledManifest\n\n\tif len(m.History) == 0 {\n\t\treturn nil, nil, errors.New(\"no history\")\n\t}\n\n\thistory := make([]ocispec.History, len(m.History))\n\tdiffIDs := []digest.Digest{}\n\tfor i := range m.History {\n\t\tvar h v1History\n\t\tif err := json.Unmarshal([]byte(m.History[i].V1Compatibility), &h); err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"failed to unmarshal history: %w\", err)\n\t\t}\n\n\t\tblobSum := m.FSLayers[i].BlobSum\n\n\t\tstate := c.blobMap[blobSum]\n\n\t\thistory[len(history)-i-1] = ocispec.History{\n\t\t\tAuthor:     h.Author,\n\t\t\tComment:    h.Comment,\n\t\t\tCreated:    &h.Created,\n\t\t\tCreatedBy:  strings.Join(h.ContainerConfig.Cmd, \" \"),\n\t\t\tEmptyLayer: state.empty,\n\t\t}\n\n\t\tif !state.empty {\n\t\t\tdiffIDs = append([]digest.Digest{state.diffID}, diffIDs...)\n\n\t\t}\n\t}\n\n\treturn history, diffIDs, nil\n}\n\ntype fsLayer struct {\n\tBlobSum digest.Digest `json:\"blobSum\"`\n}\n\ntype history struct {\n\tV1Compatibility string `json:\"v1Compatibility\"`\n}\n\ntype manifest struct {\n\tFSLayers  []fsLayer       `json:\"fsLayers\"`\n\tHistory   []history       `json:\"history\"`\n\tLayers    json.RawMessage `json:\"layers,omitempty\"`    // OCI manifest\n\tManifests json.RawMessage `json:\"manifests,omitempty\"` // OCI index\n}\n\ntype v1History struct {\n\tAuthor          string    `json:\"author,omitempty\"`\n\tCreated         time.Time `json:\"created\"`\n\tComment         string    `json:\"comment,omitempty\"`\n\tThrowAway       *bool     `json:\"throwaway,omitempty\"`\n\tSize            *int      `json:\"Size,omitempty\"` // used before ThrowAway field\n\tContainerConfig struct {\n\t\tCmd []string `json:\"Cmd,omitempty\"`\n\t} `json:\"container_config,omitempty\"`\n}\n\n// isEmptyLayer returns whether the v1 compatibility history describes an\n// empty layer. A return value of true indicates the layer is empty,\n// however false does not indicate non-empty.\nfunc isEmptyLayer(compatHistory []byte) (bool, error) {\n\tvar h v1History\n\tif err := json.Unmarshal(compatHistory, &h); err != nil {\n\t\treturn false, err\n\t}\n\n\tif h.ThrowAway != nil {\n\t\treturn *h.ThrowAway, nil\n\t}\n\tif h.Size != nil {\n\t\treturn *h.Size == 0, nil\n\t}\n\n\t// If no `Size` or `throwaway` field is given, then\n\t// it cannot be determined whether the layer is empty\n\t// from the history, return false\n\treturn false, nil\n}\n\ntype signature struct {\n\tSignatures []jsParsedSignature `json:\"signatures\"`\n}\n\ntype jsParsedSignature struct {\n\tProtected string `json:\"protected\"`\n}\n\ntype protectedBlock struct {\n\tLength int    `json:\"formatLength\"`\n\tTail   string `json:\"formatTail\"`\n}\n\n// joseBase64UrlDecode decodes the given string using the standard base64 url\n// decoder but first adds the appropriate number of trailing '=' characters in\n// accordance with the jose specification.\n// http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2\nfunc joseBase64UrlDecode(s string) ([]byte, error) {\n\tswitch len(s) % 4 {\n\tcase 0:\n\tcase 2:\n\t\ts += \"==\"\n\tcase 3:\n\t\ts += \"=\"\n\tdefault:\n\t\treturn nil, errors.New(\"illegal base64url string\")\n\t}\n\treturn base64.URLEncoding.DecodeString(s)\n}\n\nfunc stripSignature(b []byte) ([]byte, error) {\n\tvar sig signature\n\tif err := json.Unmarshal(b, &sig); err != nil {\n\t\treturn nil, err\n\t}\n\tif len(sig.Signatures) == 0 {\n\t\treturn nil, errors.New(\"no signatures\")\n\t}\n\tpb, err := joseBase64UrlDecode(sig.Signatures[0].Protected)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not decode %s: %w\", sig.Signatures[0].Protected, err)\n\t}\n\n\tvar protected protectedBlock\n\tif err := json.Unmarshal(pb, &protected); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif protected.Length > len(b) {\n\t\treturn nil, errors.New(\"invalid protected length block\")\n\t}\n\n\ttail, err := joseBase64UrlDecode(protected.Tail)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid tail base 64 value: %w\", err)\n\t}\n\n\treturn append(b[:protected.Length], tail...), nil\n}\n\ntype blobStateCalculator struct {\n\tempty    bool\n\tdigester digest.Digester\n}\n\nfunc newBlobStateCalculator() *blobStateCalculator {\n\treturn &blobStateCalculator{\n\t\tempty:    true,\n\t\tdigester: digest.Canonical.Digester(),\n\t}\n}\n\nfunc (c *blobStateCalculator) Write(p []byte) (int, error) {\n\tif c.empty {\n\t\tfor _, b := range p {\n\t\t\tif b != 0x00 {\n\t\t\t\tc.empty = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn c.digester.Hash().Write(p)\n}\n\nfunc (c *blobStateCalculator) State() blobState {\n\treturn blobState{\n\t\tempty:  c.empty,\n\t\tdiffID: c.digester.Digest(),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/containerd/containerd/v2/pkg/reference\"\n)\n\n// RepositoryScope returns a repository scope string such as \"repository:foo/bar:pull\"\n// for \"host/foo/bar:baz\".\n// When push is true, both pull and push are added to the scope.\nfunc RepositoryScope(refspec reference.Spec, push bool) (string, error) {\n\tu, err := url.Parse(\"dummy://\" + refspec.Locator)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ts := \"repository:\" + strings.TrimPrefix(u.Path, \"/\") + \":pull\"\n\tif push {\n\t\ts += \",push\"\n\t}\n\treturn s, nil\n}\n\n// tokenScopesKey is used for the key for context.WithValue().\n// value: []string (e.g. {\"registry:foo/bar:pull\"})\ntype tokenScopesKey struct{}\n\n// ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value.\nfunc ContextWithRepositoryScope(ctx context.Context, refspec reference.Spec, push bool) (context.Context, error) {\n\ts, err := RepositoryScope(refspec, push)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn WithScope(ctx, s), nil\n}\n\n// WithScope appends a custom registry auth scope to the context.\nfunc WithScope(ctx context.Context, scope string) context.Context {\n\tvar scopes []string\n\tif v := ctx.Value(tokenScopesKey{}); v != nil {\n\t\tscopes = v.([]string)\n\t\tscopes = append(scopes, scope)\n\t} else {\n\t\tscopes = []string{scope}\n\t}\n\treturn context.WithValue(ctx, tokenScopesKey{}, scopes)\n}\n\n// ContextWithAppendPullRepositoryScope is used to append repository pull\n// scope into existing scopes indexed by the tokenScopesKey{}.\nfunc ContextWithAppendPullRepositoryScope(ctx context.Context, repo string) context.Context {\n\treturn WithScope(ctx, fmt.Sprintf(\"repository:%s:pull\", repo))\n}\n\n// GetTokenScopes returns deduplicated and sorted scopes from ctx.Value(tokenScopesKey{}) and common scopes.\nfunc GetTokenScopes(ctx context.Context, common []string) []string {\n\tscopes := []string{}\n\tif x := ctx.Value(tokenScopesKey{}); x != nil {\n\t\tscopes = append(scopes, x.([]string)...)\n\t}\n\n\tscopes = append(scopes, common...)\n\tsort.Strings(scopes)\n\n\tif len(scopes) == 0 {\n\t\treturn scopes\n\t}\n\n\tl := 0\n\tfor idx := 1; idx < len(scopes); idx++ {\n\t\t// Note: this comparison is unaware of the scope grammar (https://docs.docker.com/registry/spec/auth/scope/)\n\t\t// So, \"repository:foo/bar:pull,push\" != \"repository:foo/bar:push,pull\", although semantically they are equal.\n\t\tif scopes[l] == scopes[idx] {\n\t\t\tcontinue\n\t\t}\n\n\t\tl++\n\t\tscopes[l] = scopes[idx]\n\t}\n\treturn scopes[:l+1]\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/docker/status.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage docker\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/moby/locker\"\n)\n\n// Status of a content operation\ntype Status struct {\n\tcontent.Status\n\n\tCommitted bool\n\n\t// ErrClosed contains error encountered on close.\n\tErrClosed error\n\n\t// UploadUUID is used by the Docker registry to reference blob uploads\n\tUploadUUID string\n\n\t// PushStatus contains status related to push.\n\tPushStatus\n}\n\ntype PushStatus struct {\n\t// MountedFrom is the source content was cross-repo mounted from (empty if no cross-repo mount was performed).\n\tMountedFrom string\n\n\t// Exists indicates whether content already exists in the repository and wasn't uploaded.\n\tExists bool\n}\n\n// StatusTracker to track status of operations\ntype StatusTracker interface {\n\tGetStatus(string) (Status, error)\n\tSetStatus(string, Status)\n}\n\n// StatusTrackLocker to track status of operations with lock\ntype StatusTrackLocker interface {\n\tStatusTracker\n\tLock(string)\n\tUnlock(string)\n}\n\ntype memoryStatusTracker struct {\n\tstatuses map[string]Status\n\tm        sync.Mutex\n\tlocker   *locker.Locker\n}\n\n// NewInMemoryTracker returns a StatusTracker that tracks content status in-memory\nfunc NewInMemoryTracker() StatusTrackLocker {\n\treturn &memoryStatusTracker{\n\t\tstatuses: map[string]Status{},\n\t\tlocker:   locker.New(),\n\t}\n}\n\nfunc (t *memoryStatusTracker) GetStatus(ref string) (Status, error) {\n\tt.m.Lock()\n\tdefer t.m.Unlock()\n\tstatus, ok := t.statuses[ref]\n\tif !ok {\n\t\treturn Status{}, fmt.Errorf(\"status for ref %v: %w\", ref, errdefs.ErrNotFound)\n\t}\n\treturn status, nil\n}\n\nfunc (t *memoryStatusTracker) SetStatus(ref string, status Status) {\n\tt.m.Lock()\n\tt.statuses[ref] = status\n\tt.m.Unlock()\n}\n\nfunc (t *memoryStatusTracker) Lock(ref string) {\n\tt.locker.Lock(ref)\n}\n\nfunc (t *memoryStatusTracker) Unlock(ref string) {\n\tt.locker.Unlock(ref)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/errors/errors.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage errors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nvar _ error = ErrUnexpectedStatus{}\n\n// ErrUnexpectedStatus is returned if a registry API request returned with unexpected HTTP status\ntype ErrUnexpectedStatus struct {\n\tStatus                    string\n\tStatusCode                int\n\tBody                      []byte\n\tRequestURL, RequestMethod string\n}\n\nfunc (e ErrUnexpectedStatus) Error() string {\n\treturn fmt.Sprintf(\"unexpected status from %s request to %s: %s\", e.RequestMethod, e.RequestURL, e.Status)\n}\n\n// NewUnexpectedStatusErr creates an ErrUnexpectedStatus from HTTP response\nfunc NewUnexpectedStatusErr(resp *http.Response) error {\n\tvar b []byte\n\tif resp.Body != nil {\n\t\tb, _ = io.ReadAll(io.LimitReader(resp.Body, 64000)) // 64KB\n\t}\n\terr := ErrUnexpectedStatus{\n\t\tBody:          b,\n\t\tStatus:        resp.Status,\n\t\tStatusCode:    resp.StatusCode,\n\t\tRequestMethod: resp.Request.Method,\n\t}\n\tif resp.Request.URL != nil {\n\t\terr.RequestURL = resp.Request.URL.String()\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/handlers.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage remotes\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/core/images\"\n\t\"github.com/containerd/containerd/v2/pkg/labels\"\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/containerd/platforms\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"golang.org/x/sync/semaphore\"\n)\n\ntype refKeyPrefix struct{}\n\n// WithMediaTypeKeyPrefix adds a custom key prefix for a media type which is used when storing\n// data in the content store from the FetchHandler.\n//\n// Used in `MakeRefKey` to determine what the key prefix should be.\nfunc WithMediaTypeKeyPrefix(ctx context.Context, mediaType, prefix string) context.Context {\n\tvar values map[string]string\n\tif v := ctx.Value(refKeyPrefix{}); v != nil {\n\t\tvalues = v.(map[string]string)\n\t} else {\n\t\tvalues = make(map[string]string)\n\t}\n\n\tvalues[mediaType] = prefix\n\treturn context.WithValue(ctx, refKeyPrefix{}, values)\n}\n\n// MakeRefKey returns a unique reference for the descriptor. This reference can be\n// used to lookup ongoing processes related to the descriptor. This function\n// may look to the context to namespace the reference appropriately.\nfunc MakeRefKey(ctx context.Context, desc ocispec.Descriptor) string {\n\tkey := desc.Digest.String()\n\tif desc.Annotations != nil {\n\t\tif name, ok := desc.Annotations[ocispec.AnnotationRefName]; ok {\n\t\t\tkey = fmt.Sprintf(\"%s@%s\", name, desc.Digest.String())\n\t\t}\n\t}\n\n\tif v := ctx.Value(refKeyPrefix{}); v != nil {\n\t\tvalues := v.(map[string]string)\n\t\tif prefix := values[desc.MediaType]; prefix != \"\" {\n\t\t\treturn prefix + \"-\" + key\n\t\t}\n\t}\n\n\tswitch {\n\tcase images.IsManifestType(desc.MediaType):\n\t\treturn \"manifest-\" + key\n\tcase images.IsIndexType(desc.MediaType):\n\t\treturn \"index-\" + key\n\tcase images.IsLayerType(desc.MediaType):\n\t\treturn \"layer-\" + key\n\tcase images.IsKnownConfig(desc.MediaType):\n\t\treturn \"config-\" + key\n\tdefault:\n\t\tlog.G(ctx).Warnf(\"reference for unknown type: %s\", desc.MediaType)\n\t\treturn \"unknown-\" + key\n\t}\n}\n\n// FetchHandler returns a handler that will fetch all content into the ingester\n// discovered in a call to Dispatch. Use with ChildrenHandler to do a full\n// recursive fetch.\nfunc FetchHandler(ingester content.Ingester, fetcher Fetcher) images.HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tctx = log.WithLogger(ctx, log.G(ctx).WithFields(log.Fields{\n\t\t\t\"digest\":    desc.Digest,\n\t\t\t\"mediatype\": desc.MediaType,\n\t\t\t\"size\":      desc.Size,\n\t\t}))\n\n\t\tif desc.MediaType == images.MediaTypeDockerSchema1Manifest {\n\t\t\treturn nil, fmt.Errorf(\"%v not supported\", desc.MediaType)\n\t\t}\n\t\terr := Fetch(ctx, ingester, fetcher, desc)\n\t\tif errdefs.IsAlreadyExists(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n}\n\n// Fetch fetches the given digest into the provided ingester\nfunc Fetch(ctx context.Context, ingester content.Ingester, fetcher Fetcher, desc ocispec.Descriptor) error {\n\tlog.G(ctx).Debug(\"fetch\")\n\n\tcw, err := content.OpenWriter(ctx, ingester, content.WithRef(MakeRefKey(ctx, desc)), content.WithDescriptor(desc))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer cw.Close()\n\n\tws, err := cw.Status()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif desc.Size == 0 {\n\t\t// most likely a poorly configured registry/web front end which responded with no\n\t\t// Content-Length header; unable (not to mention useless) to commit a 0-length entry\n\t\t// into the content store. Error out here otherwise the error sent back is confusing\n\t\treturn fmt.Errorf(\"unable to fetch descriptor (%s) which reports content size of zero: %w\", desc.Digest, errdefs.ErrInvalidArgument)\n\t}\n\tif ws.Offset == desc.Size {\n\t\t// If writer is already complete, commit and return\n\t\terr := cw.Commit(ctx, desc.Size, desc.Digest)\n\t\tif err != nil && !errdefs.IsAlreadyExists(err) {\n\t\t\treturn fmt.Errorf(\"failed commit on ref %q: %w\", ws.Ref, err)\n\t\t}\n\t\treturn err\n\t}\n\n\tif desc.Size == int64(len(desc.Data)) {\n\t\treturn content.Copy(ctx, cw, bytes.NewReader(desc.Data), desc.Size, desc.Digest)\n\t}\n\n\trc, err := fetcher.Fetch(ctx, desc)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer rc.Close()\n\n\treturn content.Copy(ctx, cw, rc, desc.Size, desc.Digest)\n}\n\n// PushHandler returns a handler that will push all content from the provider\n// using a writer from the pusher.\nfunc PushHandler(pusher Pusher, provider content.Provider) images.HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tctx = log.WithLogger(ctx, log.G(ctx).WithFields(log.Fields{\n\t\t\t\"digest\":    desc.Digest,\n\t\t\t\"mediatype\": desc.MediaType,\n\t\t\t\"size\":      desc.Size,\n\t\t}))\n\n\t\terr := push(ctx, provider, pusher, desc)\n\t\treturn nil, err\n\t}\n}\n\nfunc push(ctx context.Context, provider content.Provider, pusher Pusher, desc ocispec.Descriptor) error {\n\tlog.G(ctx).Debug(\"push\")\n\n\tvar (\n\t\tcw  content.Writer\n\t\terr error\n\t)\n\tif cs, ok := pusher.(content.Ingester); ok {\n\t\tcw, err = content.OpenWriter(ctx, cs, content.WithRef(MakeRefKey(ctx, desc)), content.WithDescriptor(desc))\n\t} else {\n\t\tcw, err = pusher.Push(ctx, desc)\n\t}\n\tif err != nil {\n\t\tif !errdefs.IsAlreadyExists(err) {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}\n\tdefer cw.Close()\n\n\tra, err := provider.ReaderAt(ctx, desc)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer ra.Close()\n\n\trd := io.NewSectionReader(ra, 0, desc.Size)\n\treturn content.Copy(ctx, cw, rd, desc.Size, desc.Digest)\n}\n\n// PushContent pushes content specified by the descriptor from the provider.\n//\n// Base handlers can be provided which will be called before any push specific\n// handlers.\n//\n// If the passed in content.Provider is also a content.InfoProvider (such as\n// content.Manager) then this will also annotate the distribution sources using\n// labels prefixed with \"containerd.io/distribution.source\".\nfunc PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, store content.Provider, limiter *semaphore.Weighted, platform platforms.MatchComparer, wrapper func(h images.Handler) images.Handler) error {\n\n\tvar m sync.Mutex\n\tmanifests := []ocispec.Descriptor{}\n\tindexStack := []ocispec.Descriptor{}\n\n\tfilterHandler := images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tif images.IsManifestType(desc.MediaType) {\n\t\t\tm.Lock()\n\t\t\tmanifests = append(manifests, desc)\n\t\t\tm.Unlock()\n\t\t\treturn nil, images.ErrStopHandler\n\t\t} else if images.IsIndexType(desc.MediaType) {\n\t\t\tm.Lock()\n\t\t\tindexStack = append(indexStack, desc)\n\t\t\tm.Unlock()\n\t\t\treturn nil, images.ErrStopHandler\n\t\t}\n\t\treturn nil, nil\n\t})\n\n\tpushHandler := PushHandler(pusher, store)\n\n\tplatformFilterhandler := images.FilterPlatforms(images.ChildrenHandler(store), platform)\n\n\tvar handler images.Handler\n\tif m, ok := store.(content.InfoProvider); ok {\n\t\tannotateHandler := annotateDistributionSourceHandler(platformFilterhandler, m)\n\t\thandler = images.Handlers(annotateHandler, filterHandler, pushHandler)\n\t} else {\n\t\thandler = images.Handlers(platformFilterhandler, filterHandler, pushHandler)\n\t}\n\n\tif wrapper != nil {\n\t\thandler = wrapper(handler)\n\t}\n\n\tif err := images.Dispatch(ctx, handler, limiter, desc); err != nil {\n\t\treturn err\n\t}\n\n\tif err := images.Dispatch(ctx, pushHandler, limiter, manifests...); err != nil {\n\t\treturn err\n\t}\n\n\t// Iterate in reverse order as seen, parent always uploaded after child\n\tfor i := len(indexStack) - 1; i >= 0; i-- {\n\t\terr := images.Dispatch(ctx, pushHandler, limiter, indexStack[i])\n\t\tif err != nil {\n\t\t\t// TODO(estesp): until we have a more complete method for index push, we need to report\n\t\t\t// missing dependencies in an index/manifest list by sensing the \"400 Bad Request\"\n\t\t\t// as a marker for this problem\n\t\t\tif errors.Unwrap(err) != nil && strings.Contains(errors.Unwrap(err).Error(), \"400 Bad Request\") {\n\t\t\t\treturn fmt.Errorf(\"manifest list/index references to blobs and/or manifests are missing in your target registry: %w\", err)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// SkipNonDistributableBlobs returns a handler that skips blobs that have a media type that is \"non-distributeable\".\n// An example of this kind of content would be a Windows base layer, which is not supposed to be redistributed.\n//\n// This is based on the media type of the content:\n//   - application/vnd.oci.image.layer.nondistributable\n//   - application/vnd.docker.image.rootfs.foreign\nfunc SkipNonDistributableBlobs(f images.HandlerFunc) images.HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tif images.IsNonDistributable(desc.MediaType) {\n\t\t\tlog.G(ctx).WithField(\"digest\", desc.Digest).WithField(\"mediatype\", desc.MediaType).Debug(\"Skipping non-distributable blob\")\n\t\t\treturn nil, images.ErrSkipDesc\n\t\t}\n\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(children) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tout := make([]ocispec.Descriptor, 0, len(children))\n\t\tfor _, child := range children {\n\t\t\tif !images.IsNonDistributable(child.MediaType) {\n\t\t\t\tout = append(out, child)\n\t\t\t} else {\n\t\t\t\tlog.G(ctx).WithField(\"digest\", child.Digest).WithField(\"mediatype\", child.MediaType).Debug(\"Skipping non-distributable blob\")\n\t\t\t}\n\t\t}\n\t\treturn out, nil\n\t}\n}\n\n// FilterManifestByPlatformHandler allows Handler to handle non-target\n// platform's manifest and configuration data.\nfunc FilterManifestByPlatformHandler(f images.HandlerFunc, m platforms.Matcher) images.HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// no platform information\n\t\tif desc.Platform == nil || m == nil {\n\t\t\treturn children, nil\n\t\t}\n\n\t\tif images.IsManifestType(desc.MediaType) && !m.Match(*desc.Platform) {\n\t\t\tvar descs []ocispec.Descriptor\n\t\t\tfor _, child := range children {\n\t\t\t\tif images.IsConfigType(child.MediaType) {\n\t\t\t\t\tdescs = append(descs, child)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn descs, nil\n\t\t}\n\t\treturn children, nil\n\t}\n}\n\n// annotateDistributionSourceHandler add distribution source label into\n// annotation of config or blob descriptor.\nfunc annotateDistributionSourceHandler(f images.HandlerFunc, provider content.InfoProvider) images.HandlerFunc {\n\treturn func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {\n\t\tchildren, err := f(ctx, desc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Distribution source is only used for config or blob but may be inherited from\n\t\t// a manifest or manifest list\n\t\tif !images.IsManifestType(desc.MediaType) && !images.IsIndexType(desc.MediaType) {\n\t\t\treturn children, nil\n\t\t}\n\n\t\tparentSourceAnnotations := desc.Annotations\n\t\tvar parentLabels map[string]string\n\t\tif pi, err := provider.Info(ctx, desc.Digest); err != nil {\n\t\t\tif !errdefs.IsNotFound(err) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tparentLabels = pi.Labels\n\t\t}\n\n\t\tfor i := range children {\n\t\t\tchild := children[i]\n\n\t\t\tinfo, err := provider.Info(ctx, child.Digest)\n\t\t\tif err != nil {\n\t\t\t\tif !errdefs.IsNotFound(err) {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopyDistributionSourceLabels(info.Labels, &child)\n\n\t\t\t// Annotate with parent labels for cross repo mount or fetch.\n\t\t\t// Parent sources may apply to all children since most registries\n\t\t\t// enforce that children exist before the manifests.\n\t\t\tcopyDistributionSourceLabels(parentSourceAnnotations, &child)\n\t\t\tcopyDistributionSourceLabels(parentLabels, &child)\n\n\t\t\tchildren[i] = child\n\t\t}\n\t\treturn children, nil\n\t}\n}\n\nfunc copyDistributionSourceLabels(from map[string]string, to *ocispec.Descriptor) {\n\tfor k, v := range from {\n\t\tif !strings.HasPrefix(k, labels.LabelDistributionSource+\".\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tif to.Annotations == nil {\n\t\t\tto.Annotations = make(map[string]string)\n\t\t} else {\n\t\t\t// Only propagate the parent label if the child doesn't already have it.\n\t\t\tif _, has := to.Annotations[k]; has {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tto.Annotations[k] = v\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage remotes\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// Resolver provides remotes based on a locator.\ntype Resolver interface {\n\t// Resolve attempts to resolve the reference into a name and descriptor.\n\t//\n\t// The argument `ref` should be a scheme-less URI representing the remote.\n\t// Structurally, it has a host and path. The \"host\" can be used to directly\n\t// reference a specific host or be matched against a specific handler.\n\t//\n\t// The returned name should be used to identify the referenced entity.\n\t// Depending on the remote namespace, this may be immutable or mutable.\n\t// While the name may differ from ref, it should itself be a valid ref.\n\t//\n\t// If the resolution fails, an error will be returned.\n\tResolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error)\n\n\t// Fetcher returns a new fetcher for the provided reference.\n\t// All content fetched from the returned fetcher will be\n\t// from the namespace referred to by ref.\n\tFetcher(ctx context.Context, ref string) (Fetcher, error)\n\n\t// Pusher returns a new pusher for the provided reference\n\t// The returned Pusher should satisfy content.Ingester and concurrent attempts\n\t// to push the same blob using the Ingester API should result in ErrUnavailable.\n\tPusher(ctx context.Context, ref string) (Pusher, error)\n}\n\n// Fetcher fetches content.\n// A fetcher implementation may implement the FetcherByDigest interface too.\ntype Fetcher interface {\n\t// Fetch the resource identified by the descriptor.\n\tFetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)\n}\n\n// FetcherByDigest fetches content by the digest.\ntype FetcherByDigest interface {\n\t// FetchByDigest fetches the resource identified by the digest.\n\t//\n\t// FetcherByDigest usually returns an incomplete descriptor.\n\t// Typically, the media type is always set to \"application/octet-stream\",\n\t// and the annotations are unset.\n\tFetchByDigest(ctx context.Context, dgst digest.Digest, opts ...FetchByDigestOpts) (io.ReadCloser, ocispec.Descriptor, error)\n}\n\n// Pusher pushes content\ntype Pusher interface {\n\t// Push returns a content writer for the given resource identified\n\t// by the descriptor.\n\tPush(ctx context.Context, d ocispec.Descriptor) (content.Writer, error)\n}\n\n// FetcherFunc allows package users to implement a Fetcher with just a\n// function.\ntype FetcherFunc func(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)\n\n// Fetch content\nfunc (fn FetcherFunc) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) {\n\treturn fn(ctx, desc)\n}\n\n// PusherFunc allows package users to implement a Pusher with just a\n// function.\ntype PusherFunc func(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error)\n\n// Push content\nfunc (fn PusherFunc) Push(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) {\n\treturn fn(ctx, desc)\n}\n\n// FetchByDigestConfig provides configuration for fetching content by digest\ntype FetchByDigestConfig struct {\n\t//Mediatype specifies mediatype header to append for fetch request\n\tMediatype string\n}\n\n// FetchByDigestOpts allows callers to set options for fetch object\ntype FetchByDigestOpts func(context.Context, *FetchByDigestConfig) error\n\n// WithMediaType sets the media type header for fetch request\nfunc WithMediaType(mediatype string) FetchByDigestOpts {\n\treturn func(ctx context.Context, cfg *FetchByDigestConfig) error {\n\t\tcfg.Mediatype = mediatype\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultMaxRecvMsgSize defines the default maximum message size for\n\t// receiving protobufs passed over the GRPC API.\n\tDefaultMaxRecvMsgSize = 16 << 20\n\t// DefaultMaxSendMsgSize defines the default maximum message size for\n\t// sending protobufs passed over the GRPC API.\n\tDefaultMaxSendMsgSize = 16 << 20\n\t// DefaultRuntimeNSLabel defines the namespace label to check for the\n\t// default runtime\n\tDefaultRuntimeNSLabel = \"containerd.io/defaults/runtime\"\n\t// DefaultSnapshotterNSLabel defines the namespace label to check for the\n\t// default snapshotter\n\tDefaultSnapshotterNSLabel = \"containerd.io/defaults/snapshotter\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultRootDir is the default location used by containerd to store\n\t// persistent data\n\tDefaultRootDir = \"/var/lib/containerd\"\n\t// DefaultStateDir is the default location used by containerd to store\n\t// transient data\n\tDefaultStateDir = \"/var/run/containerd\"\n\t// DefaultAddress is the default unix socket address\n\tDefaultAddress = \"/var/run/containerd/containerd.sock\"\n\t// DefaultDebugAddress is the default unix socket address for pprof data\n\tDefaultDebugAddress = \"/var/run/containerd/debug.sock\"\n\t// DefaultFIFODir is the default location used by client-side cio library\n\t// to store FIFOs.\n\tDefaultFIFODir = \"/var/run/containerd/fifo\"\n\t// DefaultRuntime would be a multiple of choices, thus empty\n\tDefaultRuntime = \"\"\n\t// DefaultConfigDir is the default location for config files.\n\tDefaultConfigDir = \"/etc/containerd\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_differ_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultDiffer will set the default differ for the platform.\n\t// This differ should be compatible with the windows snapshotter.\n\tDefaultDiffer = \"windows\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_freebsd.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultRuntime is the default freebsd runtime\n\tDefaultRuntime = \"wtf.sbk.runj.v1\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultRuntime is the default linux runtime\n\tDefaultRuntime = \"io.containerd.runc.v2\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultSnapshotter will set the default snapshotter for the platform.\n\t// This will be based on the client compilation target, so take that into\n\t// account when choosing this value.\n\tDefaultSnapshotter = \"overlayfs\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_unix.go",
    "content": "//go:build darwin || freebsd || solaris\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultSnapshotter will set the default snapshotter for the platform.\n\t// This will be based on the client compilation target, so take that into\n\t// account when choosing this value.\n\tDefaultSnapshotter = \"native\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultSnapshotter will set the default snapshotter for the platform.\n\t// This will be based on the client compilation target, so take that into\n\t// account when choosing this value.\n\tDefaultSnapshotter = \"windows\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go",
    "content": "//go:build !windows && !darwin\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nconst (\n\t// DefaultRootDir is the default location used by containerd to store\n\t// persistent data\n\tDefaultRootDir = \"/var/lib/containerd\"\n\t// DefaultStateDir is the default location used by containerd to store\n\t// transient data\n\tDefaultStateDir = \"/run/containerd\"\n\t// DefaultAddress is the default unix socket address\n\tDefaultAddress = \"/run/containerd/containerd.sock\"\n\t// DefaultDebugAddress is the default unix socket address for pprof data\n\tDefaultDebugAddress = \"/run/containerd/debug.sock\"\n\t// DefaultFIFODir is the default location used by client-side cio library\n\t// to store FIFOs.\n\tDefaultFIFODir = \"/run/containerd/fifo\"\n\t// DefaultConfigDir is the default location for config files.\n\tDefaultConfigDir = \"/etc/containerd\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage defaults\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nvar (\n\t// DefaultRootDir is the default location used by containerd to store\n\t// persistent data\n\tDefaultRootDir = filepath.Join(os.Getenv(\"ProgramData\"), \"containerd\", \"root\")\n\t// DefaultStateDir is the default location used by containerd to store\n\t// transient data\n\tDefaultStateDir = filepath.Join(os.Getenv(\"ProgramData\"), \"containerd\", \"state\")\n\n\t// DefaultConfigDir is the default location for config files.\n\tDefaultConfigDir = filepath.Join(os.Getenv(\"programfiles\"), \"containerd\")\n)\n\nconst (\n\t// DefaultAddress is the default winpipe address\n\tDefaultAddress = `\\\\.\\pipe\\containerd-containerd`\n\t// DefaultDebugAddress is the default winpipe address for pprof data\n\tDefaultDebugAddress = `\\\\.\\pipe\\containerd-debug`\n\t// DefaultFIFODir is the default location used by client-side cio library\n\t// to store FIFOs. Unused on Windows.\n\tDefaultFIFODir = \"\"\n\t// DefaultRuntime is the default windows runtime\n\tDefaultRuntime = \"io.containerd.runhcs.v1\"\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/defaults/doc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package defaults provides several common defaults for interacting with\n// containerd. These can be used on the client-side or server-side.\npackage defaults\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/internal/fsverity/fsverity_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage fsverity\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/containerd/containerd/v2/pkg/kernelversion\"\n\t\"golang.org/x/sys/unix\"\n)\n\ntype fsverityEnableArg struct {\n\tversion       uint32\n\thashAlgorithm uint32\n\tblockSize     uint32\n\tsaltSize      uint32\n\tsaltPtr       uint64\n\tsigSize       uint32\n\treserved1     uint32\n\tsigPtr        uint64\n\treserved2     [11]uint64\n}\n\nconst (\n\tdefaultBlockSize int    = 4096\n\tmaxDigestSize    uint16 = 64\n)\n\nfunc IsSupported(rootPath string) (bool, error) {\n\tminKernelVersion := kernelversion.KernelVersion{Kernel: 5, Major: 4}\n\ts, err := kernelversion.GreaterEqualThan(minKernelVersion)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tintegrityDir, err := os.MkdirTemp(rootPath, \".fsverity-check-*\")\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer os.RemoveAll(integrityDir)\n\n\tdigestPath := filepath.Join(integrityDir, \"supported\")\n\tdigestFile, err := os.Create(digestPath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdigestFile.Close()\n\n\teerr := Enable(digestPath)\n\tif eerr != nil {\n\t\treturn false, eerr\n\t}\n\n\treturn true, nil\n}\n\nfunc IsEnabled(path string) (bool, error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer f.Close()\n\n\tvar attr int32\n\n\t_, _, flagErr := unix.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(unix.FS_IOC_GETFLAGS), uintptr(unsafe.Pointer(&attr)))\n\tif flagErr != 0 {\n\t\treturn false, fmt.Errorf(\"error getting inode flags: %w\", flagErr)\n\t}\n\n\tif attr&unix.FS_VERITY_FL == unix.FS_VERITY_FL {\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}\n\nfunc Enable(path string) error {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar args = &fsverityEnableArg{}\n\targs.version = 1\n\targs.hashAlgorithm = 1\n\n\t// fsverity block size should be the minimum between the page size\n\t// and the file system block size\n\t// If neither value is retrieved successfully, set fsverity block size to the default value\n\tblockSize := unix.Getpagesize()\n\n\ts := unix.Stat_t{}\n\tserr := unix.Stat(path, &s)\n\tif serr == nil && int(s.Blksize) < blockSize {\n\t\tblockSize = int(s.Blksize)\n\t}\n\n\tif blockSize <= 0 {\n\t\tblockSize = defaultBlockSize\n\t}\n\n\targs.blockSize = uint32(blockSize)\n\n\t_, _, errno := unix.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(unix.FS_IOC_ENABLE_VERITY), uintptr(unsafe.Pointer(args)))\n\tif errno != 0 {\n\t\treturn fmt.Errorf(\"enable fsverity failed: %w\", errno)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/internal/fsverity/fsverity_other.go",
    "content": "//go:build !linux\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage fsverity\n\nimport \"fmt\"\n\nfunc IsSupported(rootPath string) (bool, error) {\n\treturn false, fmt.Errorf(\"fsverity is only supported on Linux systems\")\n}\n\nfunc IsEnabled(path string) (bool, error) {\n\treturn false, fmt.Errorf(\"fsverity is only supported on Linux systems\")\n}\n\nfunc Enable(_ string) error {\n\treturn fmt.Errorf(\"fsverity is only supported on Linux systems\")\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/internal/randutil/randutil.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package randutil provides utilities for [cyrpto/rand].\npackage randutil\n\nimport (\n\t\"crypto/rand\"\n\t\"math\"\n\t\"math/big\"\n)\n\n// Int63n is similar to [math/rand.Int63n] but uses [crypto/rand.Reader] under the hood.\nfunc Int63n(n int64) int64 {\n\tb, err := rand.Int(rand.Reader, big.NewInt(n))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b.Int64()\n}\n\n// Int63 is similar to [math/rand.Int63] but uses [crypto/rand.Reader] under the hood.\nfunc Int63() int64 {\n\treturn Int63n(math.MaxInt64)\n}\n\n// Intn is similar to [math/rand.Intn] but uses [crypto/rand.Reader] under the hood.\nfunc Intn(n int) int {\n\treturn int(Int63n(int64(n)))\n}\n\n// Int is similar to [math/rand.Int] but uses [crypto/rand.Reader] under the hood.\nfunc Int() int {\n\treturn int(Int63())\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage compression\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"context\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"github.com/containerd/log\"\n\t\"github.com/klauspost/compress/zstd\"\n)\n\ntype (\n\t// Compression is the state represents if compressed or not.\n\tCompression int\n)\n\nconst (\n\t// Uncompressed represents the uncompressed.\n\tUncompressed Compression = iota\n\t// Gzip is gzip compression algorithm.\n\tGzip\n\t// Zstd is zstd compression algorithm.\n\tZstd\n\t// Unknown is used when a plugin handles the algorithm.\n\tUnknown\n)\n\nconst (\n\tdisablePigzEnv  = \"CONTAINERD_DISABLE_PIGZ\"\n\tdisableIgzipEnv = \"CONTAINERD_DISABLE_IGZIP\"\n)\n\nvar (\n\tinitGzip sync.Once\n\tgzipPath string\n)\n\nvar (\n\tbufioReader32KPool = &sync.Pool{\n\t\tNew: func() interface{} { return bufio.NewReaderSize(nil, 32*1024) },\n\t}\n)\n\n// DecompressReadCloser include the stream after decompress and the compress method detected.\ntype DecompressReadCloser interface {\n\tio.ReadCloser\n\t// GetCompression returns the compress method which is used before decompressing\n\tGetCompression() Compression\n}\n\ntype readCloserWrapper struct {\n\tio.Reader\n\tcompression Compression\n\tcloser      func() error\n}\n\nfunc (r *readCloserWrapper) Close() error {\n\tif r.closer != nil {\n\t\treturn r.closer()\n\t}\n\treturn nil\n}\n\nfunc (r *readCloserWrapper) GetCompression() Compression {\n\treturn r.compression\n}\n\ntype writeCloserWrapper struct {\n\tio.Writer\n\tcloser func() error\n}\n\nfunc (w *writeCloserWrapper) Close() error {\n\tif w.closer != nil {\n\t\tw.closer()\n\t}\n\treturn nil\n}\n\ntype bufferedReader struct {\n\tbuf *bufio.Reader\n}\n\nfunc newBufferedReader(r io.Reader) *bufferedReader {\n\tbuf := bufioReader32KPool.Get().(*bufio.Reader)\n\tbuf.Reset(r)\n\treturn &bufferedReader{buf}\n}\n\nfunc (r *bufferedReader) Read(p []byte) (n int, err error) {\n\tif r.buf == nil {\n\t\treturn 0, io.EOF\n\t}\n\tn, err = r.buf.Read(p)\n\tif err == io.EOF {\n\t\tr.buf.Reset(nil)\n\t\tbufioReader32KPool.Put(r.buf)\n\t\tr.buf = nil\n\t}\n\treturn\n}\n\nfunc (r *bufferedReader) Peek(n int) ([]byte, error) {\n\tif r.buf == nil {\n\t\treturn nil, io.EOF\n\t}\n\treturn r.buf.Peek(n)\n}\n\nconst (\n\tzstdMagicSkippableStart = 0x184D2A50\n\tzstdMagicSkippableMask  = 0xFFFFFFF0\n)\n\nvar (\n\tgzipMagic = []byte{0x1F, 0x8B, 0x08}\n\tzstdMagic = []byte{0x28, 0xb5, 0x2f, 0xfd}\n)\n\ntype matcher = func([]byte) bool\n\nfunc magicNumberMatcher(m []byte) matcher {\n\treturn func(source []byte) bool {\n\t\treturn bytes.HasPrefix(source, m)\n\t}\n}\n\n// zstdMatcher detects zstd compression algorithm.\n// There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames.\n// See https://datatracker.ietf.org/doc/html/rfc8878#section-3 for more details.\nfunc zstdMatcher() matcher {\n\treturn func(source []byte) bool {\n\t\tif bytes.HasPrefix(source, zstdMagic) {\n\t\t\t// Zstandard frame\n\t\t\treturn true\n\t\t}\n\t\t// skippable frame\n\t\tif len(source) < 8 {\n\t\t\treturn false\n\t\t}\n\t\t// magic number from 0x184D2A50 to 0x184D2A5F.\n\t\tif binary.LittleEndian.Uint32(source[:4])&zstdMagicSkippableMask == zstdMagicSkippableStart {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n}\n\n// DetectCompression detects the compression algorithm of the source.\nfunc DetectCompression(source []byte) Compression {\n\tfor compression, fn := range map[Compression]matcher{\n\t\tGzip: magicNumberMatcher(gzipMagic),\n\t\tZstd: zstdMatcher(),\n\t} {\n\t\tif fn(source) {\n\t\t\treturn compression\n\t\t}\n\t}\n\treturn Uncompressed\n}\n\n// DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive.\nfunc DecompressStream(archive io.Reader) (DecompressReadCloser, error) {\n\tbuf := newBufferedReader(archive)\n\tbs, err := buf.Peek(10)\n\tif err != nil && err != io.EOF {\n\t\t// Note: we'll ignore any io.EOF error because there are some odd\n\t\t// cases where the layer.tar file will be empty (zero bytes) and\n\t\t// that results in an io.EOF from the Peek() call. So, in those\n\t\t// cases we'll just treat it as a non-compressed stream and\n\t\t// that means just create an empty layer.\n\t\t// See Issue docker/docker#18170\n\t\treturn nil, err\n\t}\n\n\tswitch compression := DetectCompression(bs); compression {\n\tcase Uncompressed:\n\t\treturn &readCloserWrapper{\n\t\t\tReader:      buf,\n\t\t\tcompression: compression,\n\t\t}, nil\n\tcase Gzip:\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tgzReader, err := gzipDecompress(ctx, buf)\n\t\tif err != nil {\n\t\t\tcancel()\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &readCloserWrapper{\n\t\t\tReader:      gzReader,\n\t\t\tcompression: compression,\n\t\t\tcloser: func() error {\n\t\t\t\tcancel()\n\t\t\t\treturn gzReader.Close()\n\t\t\t},\n\t\t}, nil\n\tcase Zstd:\n\t\tzstdReader, err := zstd.NewReader(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &readCloserWrapper{\n\t\t\tReader:      zstdReader,\n\t\t\tcompression: compression,\n\t\t\tcloser: func() error {\n\t\t\t\tzstdReader.Close()\n\t\t\t\treturn nil\n\t\t\t},\n\t\t}, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\n// CompressStream compresses the dest with specified compression algorithm.\nfunc CompressStream(dest io.Writer, compression Compression) (io.WriteCloser, error) {\n\tswitch compression {\n\tcase Uncompressed:\n\t\treturn &writeCloserWrapper{dest, nil}, nil\n\tcase Gzip:\n\t\treturn gzip.NewWriter(dest), nil\n\tcase Zstd:\n\t\treturn zstd.NewWriter(dest)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\n// Extension returns the extension of a file that uses the specified compression algorithm.\nfunc (compression *Compression) Extension() string {\n\tswitch *compression {\n\tcase Gzip:\n\t\treturn \"gz\"\n\tcase Zstd:\n\t\treturn \"zst\"\n\tcase Unknown:\n\t\treturn \"unknown\"\n\t}\n\treturn \"\"\n}\n\nfunc gzipDecompress(ctx context.Context, buf io.Reader) (io.ReadCloser, error) {\n\tinitGzip.Do(func() {\n\t\tif gzipPath = detectCommand(\"igzip\", disableIgzipEnv); gzipPath != \"\" {\n\t\t\tlog.L.Debug(\"using igzip for decompression\")\n\t\t\treturn\n\t\t}\n\t\tif gzipPath = detectCommand(\"unpigz\", disablePigzEnv); gzipPath != \"\" {\n\t\t\tlog.L.Debug(\"using unpigz for decompression\")\n\t\t}\n\t})\n\n\tif gzipPath == \"\" {\n\t\treturn gzip.NewReader(buf)\n\t}\n\treturn cmdStream(exec.CommandContext(ctx, gzipPath, \"-d\", \"-c\"), buf)\n}\n\nfunc cmdStream(cmd *exec.Cmd, in io.Reader) (io.ReadCloser, error) {\n\treader, writer := io.Pipe()\n\n\tcmd.Stdin = in\n\tcmd.Stdout = writer\n\n\tvar errBuf bytes.Buffer\n\tcmd.Stderr = &errBuf\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo func() {\n\t\tif err := cmd.Wait(); err != nil {\n\t\t\twriter.CloseWithError(fmt.Errorf(\"%s: %s\", err, errBuf.String()))\n\t\t} else {\n\t\t\twriter.Close()\n\t\t}\n\t}()\n\n\treturn reader, nil\n}\n\nfunc detectCommand(path, disableEnvName string) string {\n\t// Check if this command is disabled via the env variable\n\tvalue := os.Getenv(disableEnvName)\n\tif value != \"\" {\n\t\tdisable, err := strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\tlog.L.WithError(err).Warnf(\"could not parse %s: %s\", disableEnvName, value)\n\t\t}\n\n\t\tif disable {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\tpath, err := exec.LookPath(path)\n\tif err != nil {\n\t\tlog.L.WithError(err).Debugf(\"%s not found\", path)\n\t\treturn \"\"\n\t}\n\n\treturn path\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression_fuzzer.go",
    "content": "//go:build gofuzz\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage compression\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzDecompressStream(data []byte) int {\n\t_, _ = DecompressStream(bytes.NewReader(data))\n\treturn 1\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/deprecation/deprecation.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage deprecation\n\ntype Warning string\n\nconst (\n\t// Prefix is a standard prefix for all Warnings, used for filtering plugin Exports\n\tPrefix = \"io.containerd.deprecation/\"\n\t// PullSchema1Image is a warning for the use of schema 1 images\n\tPullSchema1Image Warning = Prefix + \"pull-schema-1-image\"\n\t// GoPluginLibrary is a warning for the use of dynamic library Go plugins\n\tGoPluginLibrary Warning = Prefix + \"go-plugin-library\"\n\t// CRIRegistryMirrors is a warning for the use of the `mirrors` property\n\tCRIRegistryMirrors Warning = Prefix + \"cri-registry-mirrors\"\n\t// CRIRegistryAuths is a warning for the use of the `auths` property\n\tCRIRegistryAuths Warning = Prefix + \"cri-registry-auths\"\n\t// CRIRegistryConfigs is a warning for the use of the `configs` property\n\tCRIRegistryConfigs Warning = Prefix + \"cri-registry-configs\"\n\t// OTLPTracingConfig is a warning for the use of the `otlp` property\n\tTracingOTLPConfig Warning = Prefix + \"tracing-processor-config\"\n\t// TracingServiceConfig is a warning for the use of the `tracing` property\n\tTracingServiceConfig Warning = Prefix + \"tracing-service-config\"\n)\n\nconst (\n\tEnvPrefix           = \"CONTAINERD_ENABLE_DEPRECATED_\"\n\tEnvPullSchema1Image = EnvPrefix + \"PULL_SCHEMA_1_IMAGE\"\n)\n\nvar messages = map[Warning]string{\n\tPullSchema1Image: \"Schema 1 images are deprecated since containerd v1.7, disabled in containerd v2.0, and will be removed in containerd v2.1. \" +\n\t\t`Since containerd v1.7.8, schema 1 images are identified by the \"io.containerd.image/converted-docker-schema1\" label.`,\n\tGoPluginLibrary: \"Dynamically-linked Go plugins as containerd runtimes are deprecated since containerd v2.0 and removed in containerd v2.1.\",\n\tCRIRegistryMirrors: \"The `mirrors` property of `[plugins.\\\"io.containerd.grpc.v1.cri\\\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1.\" +\n\t\t\"Use `config_path` instead.\",\n\tCRIRegistryAuths: \"The `auths` property of `[plugins.\\\"io.containerd.grpc.v1.cri\\\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.1.\" +\n\t\t\"Use `ImagePullSecrets` instead.\",\n\tCRIRegistryConfigs: \"The `configs` property of `[plugins.\\\"io.containerd.grpc.v1.cri\\\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1.\" +\n\t\t\"Use `config_path` instead.\",\n\n\tTracingOTLPConfig: \"The `otlp` property of `[plugins.\\\"io.containerd.tracing.processor.v1\\\".otlp]` is deprecated since containerd v1.6 and will be removed in containerd v2.0.\" +\n\t\t\"Use OTLP environment variables instead: https://opentelemetry.io/docs/specs/otel/protocol/exporter/\",\n\tTracingServiceConfig: \"The `tracing` property of `[plugins.\\\"io.containerd.internal.v1\\\".tracing]` is deprecated since containerd v1.6 and will be removed in containerd v2.0.\" +\n\t\t\"Use OTEL environment variables instead: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/\",\n}\n\n// Valid checks whether a given Warning is valid\nfunc Valid(id Warning) bool {\n\t_, ok := messages[id]\n\treturn ok\n}\n\n// Message returns the human-readable message for a given Warning\nfunc Message(id Warning) (string, bool) {\n\tmsg, ok := messages[id]\n\treturn msg, ok\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/filters/adaptor.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage filters\n\n// Adaptor specifies the mapping of fieldpaths to a type. For the given field\n// path, the value and whether it is present should be returned. The mapping of\n// the fieldpath to a field is deferred to the adaptor implementation, but\n// should generally follow protobuf field path/mask semantics.\ntype Adaptor interface {\n\tField(fieldpath []string) (value string, present bool)\n}\n\n// AdapterFunc allows implementation specific matching of fieldpaths\ntype AdapterFunc func(fieldpath []string) (string, bool)\n\n// Field returns the field name and true if it exists\nfunc (fn AdapterFunc) Field(fieldpath []string) (string, bool) {\n\treturn fn(fieldpath)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/filters/filter.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package filters defines a syntax and parser that can be used for the\n// filtration of items across the containerd API. The core is built on the\n// concept of protobuf field paths, with quoting.  Several operators allow the\n// user to flexibly select items based on field presence, equality, inequality\n// and regular expressions. Flexible adaptors support working with any type.\n//\n// The syntax is fairly familiar, if you've used container ecosystem\n// projects.  At the core, we base it on the concept of protobuf field\n// paths, augmenting with the ability to quote portions of the field path\n// to match arbitrary labels. These \"selectors\" come in the following\n// syntax:\n//\n// ```\n// <fieldpath>[<operator><value>]\n// ```\n//\n// A basic example is as follows:\n//\n// ```\n// name==foo\n// ```\n//\n// This would match all objects that have a field `name` with the value\n// `foo`. If we only want to test if the field is present, we can omit the\n// operator. This is most useful for matching labels in containerd. The\n// following will match objects that have the field \"labels\" and have the\n// label \"foo\" defined:\n//\n// ```\n// labels.foo\n// ```\n//\n// We also allow for quoting of parts of the field path to allow matching\n// of arbitrary items:\n//\n// ```\n// labels.\"very complex label\"==something\n// ```\n//\n// We also define `!=` and `~=` as operators. The `!=` will match all\n// objects that don't match the value for a field and `~=` will compile the\n// target value as a regular expression and match the field value against that.\n//\n// Selectors can be combined using a comma, such that the resulting\n// selector will require all selectors are matched for the object to match.\n// The following example will match objects that are named `foo` and have\n// the label `bar`:\n//\n// ```\n// name==foo,labels.bar\n// ```\npackage filters\n\nimport (\n\t\"regexp\"\n\n\t\"github.com/containerd/log\"\n)\n\n// Filter matches specific resources based the provided filter\ntype Filter interface {\n\tMatch(adaptor Adaptor) bool\n}\n\n// FilterFunc is a function that handles matching with an adaptor\ntype FilterFunc func(Adaptor) bool\n\n// Match matches the FilterFunc returning true if the object matches the filter\nfunc (fn FilterFunc) Match(adaptor Adaptor) bool {\n\treturn fn(adaptor)\n}\n\n// Always is a filter that always returns true for any type of object\nvar Always FilterFunc = func(adaptor Adaptor) bool {\n\treturn true\n}\n\n// Any allows multiple filters to be matched against the object\ntype Any []Filter\n\n// Match returns true if any of the provided filters are true\nfunc (m Any) Match(adaptor Adaptor) bool {\n\tfor _, m := range m {\n\t\tif m.Match(adaptor) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// All allows multiple filters to be matched against the object\ntype All []Filter\n\n// Match only returns true if all filters match the object\nfunc (m All) Match(adaptor Adaptor) bool {\n\tfor _, m := range m {\n\t\tif !m.Match(adaptor) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\ntype operator int\n\nconst (\n\toperatorPresent = iota\n\toperatorEqual\n\toperatorNotEqual\n\toperatorMatches\n)\n\nfunc (op operator) String() string {\n\tswitch op {\n\tcase operatorPresent:\n\t\treturn \"?\"\n\tcase operatorEqual:\n\t\treturn \"==\"\n\tcase operatorNotEqual:\n\t\treturn \"!=\"\n\tcase operatorMatches:\n\t\treturn \"~=\"\n\t}\n\n\treturn \"unknown\"\n}\n\ntype selector struct {\n\tfieldpath []string\n\toperator  operator\n\tvalue     string\n\tre        *regexp.Regexp\n}\n\nfunc (m selector) Match(adaptor Adaptor) bool {\n\tvalue, present := adaptor.Field(m.fieldpath)\n\n\tswitch m.operator {\n\tcase operatorPresent:\n\t\treturn present\n\tcase operatorEqual:\n\t\treturn present && value == m.value\n\tcase operatorNotEqual:\n\t\treturn value != m.value\n\tcase operatorMatches:\n\t\tif m.re == nil {\n\t\t\tr, err := regexp.Compile(m.value)\n\t\t\tif err != nil {\n\t\t\t\tlog.L.Errorf(\"error compiling regexp %q\", m.value)\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tm.re = r\n\t\t}\n\n\t\treturn m.re.MatchString(value)\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/filters/parser.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage filters\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/containerd/errdefs\"\n)\n\n/*\nParse the strings into a filter that may be used with an adaptor.\n\nThe filter is made up of zero or more selectors.\n\nThe format is a comma separated list of expressions, in the form of\n`<fieldpath><op><value>`, known as selectors. All selectors must match the\ntarget object for the filter to be true.\n\nWe define the operators \"==\" for equality, \"!=\" for not equal and \"~=\" for a\nregular expression. If the operator and value are not present, the matcher will\ntest for the presence of a value, as defined by the target object.\n\nThe formal grammar is as follows:\n\nselectors := selector (\",\" selector)*\nselector  := fieldpath (operator value)\nfieldpath := field ('.' field)*\nfield     := quoted | [A-Za-z] [A-Za-z0-9_]+\noperator  := \"==\" | \"!=\" | \"~=\"\nvalue     := quoted | [^\\s,]+\nquoted    := <go string syntax>\n*/\nfunc Parse(s string) (Filter, error) {\n\t// special case empty to match all\n\tif s == \"\" {\n\t\treturn Always, nil\n\t}\n\n\tp := parser{input: s}\n\treturn p.parse()\n}\n\n// ParseAll parses each filter in ss and returns a filter that will return true\n// if any filter matches the expression.\n//\n// If no filters are provided, the filter will match anything.\nfunc ParseAll(ss ...string) (Filter, error) {\n\tif len(ss) == 0 {\n\t\treturn Always, nil\n\t}\n\n\tvar fs []Filter\n\tfor _, s := range ss {\n\t\tf, err := Parse(s)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s: %w\", err.Error(), errdefs.ErrInvalidArgument)\n\t\t}\n\n\t\tfs = append(fs, f)\n\t}\n\n\treturn Any(fs), nil\n}\n\ntype parser struct {\n\tinput   string\n\tscanner scanner\n}\n\nfunc (p *parser) parse() (Filter, error) {\n\tp.scanner.init(p.input)\n\n\tss, err := p.selectors()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"filters: %w\", err)\n\t}\n\n\treturn ss, nil\n}\n\nfunc (p *parser) selectors() (Filter, error) {\n\ts, err := p.selector()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tss := All{s}\n\nloop:\n\tfor {\n\t\ttok := p.scanner.peek()\n\t\tswitch tok {\n\t\tcase ',':\n\t\t\tpos, tok, _ := p.scanner.scan()\n\t\t\tif tok != tokenSeparator {\n\t\t\t\treturn nil, p.mkerr(pos, \"expected a separator\")\n\t\t\t}\n\n\t\t\ts, err := p.selector()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tss = append(ss, s)\n\t\tcase tokenEOF:\n\t\t\tbreak loop\n\t\tdefault:\n\t\t\treturn nil, p.mkerr(p.scanner.ppos, \"unexpected input: %v\", string(tok))\n\t\t}\n\t}\n\n\treturn ss, nil\n}\n\nfunc (p *parser) selector() (selector, error) {\n\tfieldpath, err := p.fieldpath()\n\tif err != nil {\n\t\treturn selector{}, err\n\t}\n\n\tswitch p.scanner.peek() {\n\tcase ',', tokenSeparator, tokenEOF:\n\t\treturn selector{\n\t\t\tfieldpath: fieldpath,\n\t\t\toperator:  operatorPresent,\n\t\t}, nil\n\t}\n\n\top, err := p.operator()\n\tif err != nil {\n\t\treturn selector{}, err\n\t}\n\n\tvar allowAltQuotes bool\n\tif op == operatorMatches {\n\t\tallowAltQuotes = true\n\t}\n\n\tvalue, err := p.value(allowAltQuotes)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\treturn selector{}, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn selector{}, err\n\t}\n\n\treturn selector{\n\t\tfieldpath: fieldpath,\n\t\tvalue:     value,\n\t\toperator:  op,\n\t}, nil\n}\n\nfunc (p *parser) fieldpath() ([]string, error) {\n\tf, err := p.field()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfs := []string{f}\nloop:\n\tfor {\n\t\ttok := p.scanner.peek() // lookahead to consume field separator\n\n\t\tswitch tok {\n\t\tcase '.':\n\t\t\tpos, tok, _ := p.scanner.scan() // consume separator\n\t\t\tif tok != tokenSeparator {\n\t\t\t\treturn nil, p.mkerr(pos, \"expected a field separator (`.`)\")\n\t\t\t}\n\n\t\t\tf, err := p.field()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tfs = append(fs, f)\n\t\tdefault:\n\t\t\t// let the layer above handle the other bad cases.\n\t\t\tbreak loop\n\t\t}\n\t}\n\n\treturn fs, nil\n}\n\nfunc (p *parser) field() (string, error) {\n\tpos, tok, s := p.scanner.scan()\n\tswitch tok {\n\tcase tokenField:\n\t\treturn s, nil\n\tcase tokenQuoted:\n\t\treturn p.unquote(pos, s, false)\n\tcase tokenIllegal:\n\t\treturn \"\", p.mkerr(pos, \"%s\", p.scanner.err)\n\t}\n\n\treturn \"\", p.mkerr(pos, \"expected field or quoted\")\n}\n\nfunc (p *parser) operator() (operator, error) {\n\tpos, tok, s := p.scanner.scan()\n\tswitch tok {\n\tcase tokenOperator:\n\t\tswitch s {\n\t\tcase \"==\":\n\t\t\treturn operatorEqual, nil\n\t\tcase \"!=\":\n\t\t\treturn operatorNotEqual, nil\n\t\tcase \"~=\":\n\t\t\treturn operatorMatches, nil\n\t\tdefault:\n\t\t\treturn 0, p.mkerr(pos, \"unsupported operator %q\", s)\n\t\t}\n\tcase tokenIllegal:\n\t\treturn 0, p.mkerr(pos, \"%s\", p.scanner.err)\n\t}\n\n\treturn 0, p.mkerr(pos, `expected an operator (\"==\"|\"!=\"|\"~=\")`)\n}\n\nfunc (p *parser) value(allowAltQuotes bool) (string, error) {\n\tpos, tok, s := p.scanner.scan()\n\n\tswitch tok {\n\tcase tokenValue, tokenField:\n\t\treturn s, nil\n\tcase tokenQuoted:\n\t\treturn p.unquote(pos, s, allowAltQuotes)\n\tcase tokenIllegal:\n\t\treturn \"\", p.mkerr(pos, \"%s\", p.scanner.err)\n\t}\n\n\treturn \"\", p.mkerr(pos, \"expected value or quoted\")\n}\n\nfunc (p *parser) unquote(pos int, s string, allowAlts bool) (string, error) {\n\tif !allowAlts && s[0] != '\\'' && s[0] != '\"' {\n\t\treturn \"\", p.mkerr(pos, \"invalid quote encountered\")\n\t}\n\n\tuq, err := unquote(s)\n\tif err != nil {\n\t\treturn \"\", p.mkerr(pos, \"unquoting failed: %v\", err)\n\t}\n\n\treturn uq, nil\n}\n\ntype parseError struct {\n\tinput string\n\tpos   int\n\tmsg   string\n}\n\nfunc (pe parseError) Error() string {\n\tif pe.pos < len(pe.input) {\n\t\tbefore := pe.input[:pe.pos]\n\t\tlocation := pe.input[pe.pos : pe.pos+1] // need to handle end\n\t\tafter := pe.input[pe.pos+1:]\n\n\t\treturn fmt.Sprintf(\"[%s >|%s|< %s]: %v\", before, location, after, pe.msg)\n\t}\n\n\treturn fmt.Sprintf(\"[%s]: %v\", pe.input, pe.msg)\n}\n\nfunc (p *parser) mkerr(pos int, format string, args ...interface{}) error {\n\treturn fmt.Errorf(\"parse error: %w\", parseError{\n\t\tinput: p.input,\n\t\tpos:   pos,\n\t\tmsg:   fmt.Sprintf(format, args...),\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/filters/quote.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage filters\n\nimport (\n\t\"errors\"\n\t\"unicode/utf8\"\n)\n\n// NOTE(stevvooe): Most of this code in this file is copied from the stdlib\n// strconv package and modified to be able to handle quoting with `/` and `|`\n// as delimiters.  The copyright is held by the Go authors.\n\nvar errQuoteSyntax = errors.New(\"quote syntax error\")\n\n// UnquoteChar decodes the first character or byte in the escaped string\n// or character literal represented by the string s.\n// It returns four values:\n//\n//  1. value, the decoded Unicode code point or byte value;\n//  2. multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation;\n//  3. tail, the remainder of the string after the character; and\n//  4. an error that will be nil if the character is syntactically valid.\n//\n// The second argument, quote, specifies the type of literal being parsed\n// and therefore which escaped quote character is permitted.\n// If set to a single quote, it permits the sequence \\' and disallows unescaped '.\n// If set to a double quote, it permits \\\" and disallows unescaped \".\n// If set to zero, it does not permit either escape and allows both quote characters to appear unescaped.\n//\n// This is from Go strconv package, modified to support `|` and `/` as double\n// quotes for use with regular expressions.\nfunc unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) {\n\t// easy cases\n\tswitch c := s[0]; {\n\tcase c == quote && (quote == '\\'' || quote == '\"' || quote == '/' || quote == '|'):\n\t\terr = errQuoteSyntax\n\t\treturn\n\tcase c >= utf8.RuneSelf:\n\t\tr, size := utf8.DecodeRuneInString(s)\n\t\treturn r, true, s[size:], nil\n\tcase c != '\\\\':\n\t\treturn rune(s[0]), false, s[1:], nil\n\t}\n\n\t// hard case: c is backslash\n\tif len(s) <= 1 {\n\t\terr = errQuoteSyntax\n\t\treturn\n\t}\n\tc := s[1]\n\ts = s[2:]\n\n\tswitch c {\n\tcase 'a':\n\t\tvalue = '\\a'\n\tcase 'b':\n\t\tvalue = '\\b'\n\tcase 'f':\n\t\tvalue = '\\f'\n\tcase 'n':\n\t\tvalue = '\\n'\n\tcase 'r':\n\t\tvalue = '\\r'\n\tcase 't':\n\t\tvalue = '\\t'\n\tcase 'v':\n\t\tvalue = '\\v'\n\tcase 'x', 'u', 'U':\n\t\tn := 0\n\t\tswitch c {\n\t\tcase 'x':\n\t\t\tn = 2\n\t\tcase 'u':\n\t\t\tn = 4\n\t\tcase 'U':\n\t\t\tn = 8\n\t\t}\n\t\tvar v rune\n\t\tif len(s) < n {\n\t\t\terr = errQuoteSyntax\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < n; j++ {\n\t\t\tx, ok := unhex(s[j])\n\t\t\tif !ok {\n\t\t\t\terr = errQuoteSyntax\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv = v<<4 | x\n\t\t}\n\t\ts = s[n:]\n\t\tif c == 'x' {\n\t\t\t// single-byte string, possibly not UTF-8\n\t\t\tvalue = v\n\t\t\tbreak\n\t\t}\n\t\tif v > utf8.MaxRune {\n\t\t\terr = errQuoteSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = v\n\t\tmultibyte = true\n\tcase '0', '1', '2', '3', '4', '5', '6', '7':\n\t\tv := rune(c) - '0'\n\t\tif len(s) < 2 {\n\t\t\terr = errQuoteSyntax\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < 2; j++ { // one digit already; two more\n\t\t\tx := rune(s[j]) - '0'\n\t\t\tif x < 0 || x > 7 {\n\t\t\t\terr = errQuoteSyntax\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv = (v << 3) | x\n\t\t}\n\t\ts = s[2:]\n\t\tif v > 255 {\n\t\t\terr = errQuoteSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = v\n\tcase '\\\\':\n\t\tvalue = '\\\\'\n\tcase '\\'', '\"', '|', '/':\n\t\tif c != quote {\n\t\t\terr = errQuoteSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = rune(c)\n\tdefault:\n\t\terr = errQuoteSyntax\n\t\treturn\n\t}\n\ttail = s\n\treturn\n}\n\n// unquote interprets s as a single-quoted, double-quoted,\n// or backquoted Go string literal, returning the string value\n// that s quotes.  (If s is single-quoted, it would be a Go\n// character literal; Unquote returns the corresponding\n// one-character string.)\n//\n// This is modified from the standard library to support `|` and `/` as quote\n// characters for use with regular expressions.\nfunc unquote(s string) (string, error) {\n\tn := len(s)\n\tif n < 2 {\n\t\treturn \"\", errQuoteSyntax\n\t}\n\tquote := s[0]\n\tif quote != s[n-1] {\n\t\treturn \"\", errQuoteSyntax\n\t}\n\ts = s[1 : n-1]\n\n\tif quote == '`' {\n\t\tif contains(s, '`') {\n\t\t\treturn \"\", errQuoteSyntax\n\t\t}\n\t\tif contains(s, '\\r') {\n\t\t\t// -1 because we know there is at least one \\r to remove.\n\t\t\tbuf := make([]byte, 0, len(s)-1)\n\t\t\tfor i := 0; i < len(s); i++ {\n\t\t\t\tif s[i] != '\\r' {\n\t\t\t\t\tbuf = append(buf, s[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn string(buf), nil\n\t\t}\n\t\treturn s, nil\n\t}\n\tif quote != '\"' && quote != '\\'' && quote != '|' && quote != '/' {\n\t\treturn \"\", errQuoteSyntax\n\t}\n\tif contains(s, '\\n') {\n\t\treturn \"\", errQuoteSyntax\n\t}\n\n\t// Is it trivial?  Avoid allocation.\n\tif !contains(s, '\\\\') && !contains(s, quote) {\n\t\tswitch quote {\n\t\tcase '\"', '/', '|': // pipe and slash are treated like double quote\n\t\t\treturn s, nil\n\t\tcase '\\'':\n\t\t\tr, size := utf8.DecodeRuneInString(s)\n\t\t\tif size == len(s) && (r != utf8.RuneError || size != 1) {\n\t\t\t\treturn s, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tvar runeTmp [utf8.UTFMax]byte\n\tbuf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations.\n\tfor len(s) > 0 {\n\t\tc, multibyte, ss, err := unquoteChar(s, quote)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\ts = ss\n\t\tif c < utf8.RuneSelf || !multibyte {\n\t\t\tbuf = append(buf, byte(c))\n\t\t} else {\n\t\t\tn := utf8.EncodeRune(runeTmp[:], c)\n\t\t\tbuf = append(buf, runeTmp[:n]...)\n\t\t}\n\t\tif quote == '\\'' && len(s) != 0 {\n\t\t\t// single-quoted must be single character\n\t\t\treturn \"\", errQuoteSyntax\n\t\t}\n\t}\n\treturn string(buf), nil\n}\n\n// contains reports whether the string contains the byte c.\nfunc contains(s string, c byte) bool {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == c {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc unhex(b byte) (v rune, ok bool) {\n\tc := rune(b)\n\tswitch {\n\tcase '0' <= c && c <= '9':\n\t\treturn c - '0', true\n\tcase 'a' <= c && c <= 'f':\n\t\treturn c - 'a' + 10, true\n\tcase 'A' <= c && c <= 'F':\n\t\treturn c - 'A' + 10, true\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/filters/scanner.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage filters\n\nimport (\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\ttokenEOF = -(iota + 1)\n\ttokenQuoted\n\ttokenValue\n\ttokenField\n\ttokenSeparator\n\ttokenOperator\n\ttokenIllegal\n)\n\ntype token rune\n\nfunc (t token) String() string {\n\tswitch t {\n\tcase tokenEOF:\n\t\treturn \"EOF\"\n\tcase tokenQuoted:\n\t\treturn \"Quoted\"\n\tcase tokenValue:\n\t\treturn \"Value\"\n\tcase tokenField:\n\t\treturn \"Field\"\n\tcase tokenSeparator:\n\t\treturn \"Separator\"\n\tcase tokenOperator:\n\t\treturn \"Operator\"\n\tcase tokenIllegal:\n\t\treturn \"Illegal\"\n\t}\n\n\treturn string(t)\n}\n\nfunc (t token) GoString() string {\n\treturn \"token\" + t.String()\n}\n\ntype scanner struct {\n\tinput string\n\tpos   int\n\tppos  int // bounds the current rune in the string\n\tvalue bool\n\terr   string\n}\n\nfunc (s *scanner) init(input string) {\n\ts.input = input\n\ts.pos = 0\n\ts.ppos = 0\n}\n\nfunc (s *scanner) next() rune {\n\tif s.pos >= len(s.input) {\n\t\treturn tokenEOF\n\t}\n\ts.pos = s.ppos\n\n\tr, w := utf8.DecodeRuneInString(s.input[s.ppos:])\n\ts.ppos += w\n\tif r == utf8.RuneError {\n\t\tif w > 0 {\n\t\t\ts.error(\"rune error\")\n\t\t\treturn tokenIllegal\n\t\t}\n\t\treturn tokenEOF\n\t}\n\n\tif r == 0 {\n\t\ts.error(\"unexpected null\")\n\t\treturn tokenIllegal\n\t}\n\n\treturn r\n}\n\nfunc (s *scanner) peek() rune {\n\tpos := s.pos\n\tppos := s.ppos\n\tch := s.next()\n\ts.pos = pos\n\ts.ppos = ppos\n\treturn ch\n}\n\nfunc (s *scanner) scan() (nextp int, tk token, text string) {\n\tvar (\n\t\tch  = s.next()\n\t\tpos = s.pos\n\t)\n\nchomp:\n\tswitch {\n\tcase ch == tokenEOF:\n\tcase ch == tokenIllegal:\n\tcase isQuoteRune(ch):\n\t\tif !s.scanQuoted(ch) {\n\t\t\treturn pos, tokenIllegal, s.input[pos:s.ppos]\n\t\t}\n\t\treturn pos, tokenQuoted, s.input[pos:s.ppos]\n\tcase isSeparatorRune(ch):\n\t\ts.value = false\n\t\treturn pos, tokenSeparator, s.input[pos:s.ppos]\n\tcase isOperatorRune(ch):\n\t\ts.scanOperator()\n\t\ts.value = true\n\t\treturn pos, tokenOperator, s.input[pos:s.ppos]\n\tcase unicode.IsSpace(ch):\n\t\t// chomp\n\t\tch = s.next()\n\t\tpos = s.pos\n\t\tgoto chomp\n\tcase s.value:\n\t\ts.scanValue()\n\t\ts.value = false\n\t\treturn pos, tokenValue, s.input[pos:s.ppos]\n\tcase isFieldRune(ch):\n\t\ts.scanField()\n\t\treturn pos, tokenField, s.input[pos:s.ppos]\n\t}\n\n\treturn s.pos, token(ch), \"\"\n}\n\nfunc (s *scanner) scanField() {\n\tfor {\n\t\tch := s.peek()\n\t\tif !isFieldRune(ch) {\n\t\t\tbreak\n\t\t}\n\t\ts.next()\n\t}\n}\n\nfunc (s *scanner) scanOperator() {\n\tfor {\n\t\tch := s.peek()\n\t\tswitch ch {\n\t\tcase '=', '!', '~':\n\t\t\ts.next()\n\t\tdefault:\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (s *scanner) scanValue() {\n\tfor {\n\t\tch := s.peek()\n\t\tif !isValueRune(ch) {\n\t\t\tbreak\n\t\t}\n\t\ts.next()\n\t}\n}\n\nfunc (s *scanner) scanQuoted(quote rune) bool {\n\tvar illegal bool\n\tch := s.next() // read character after quote\n\tfor ch != quote {\n\t\tif ch == '\\n' || ch < 0 {\n\t\t\ts.error(\"quoted literal not terminated\")\n\t\t\treturn false\n\t\t}\n\t\tif ch == '\\\\' {\n\t\t\tvar legal bool\n\t\t\tch, legal = s.scanEscape(quote)\n\t\t\tif !legal {\n\t\t\t\tillegal = true\n\t\t\t}\n\t\t} else {\n\t\t\tch = s.next()\n\t\t}\n\t}\n\treturn !illegal\n}\n\nfunc (s *scanner) scanEscape(quote rune) (ch rune, legal bool) {\n\tch = s.next() // read character after '/'\n\tswitch ch {\n\tcase 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\\\', quote:\n\t\t// nothing to do\n\t\tch = s.next()\n\t\tlegal = true\n\tcase '0', '1', '2', '3', '4', '5', '6', '7':\n\t\tch, legal = s.scanDigits(ch, 8, 3)\n\tcase 'x':\n\t\tch, legal = s.scanDigits(s.next(), 16, 2)\n\tcase 'u':\n\t\tch, legal = s.scanDigits(s.next(), 16, 4)\n\tcase 'U':\n\t\tch, legal = s.scanDigits(s.next(), 16, 8)\n\tdefault:\n\t\ts.error(\"illegal escape sequence\")\n\t}\n\treturn\n}\n\nfunc (s *scanner) scanDigits(ch rune, base, n int) (rune, bool) {\n\tfor n > 0 && digitVal(ch) < base {\n\t\tch = s.next()\n\t\tn--\n\t}\n\tif n > 0 {\n\t\ts.error(\"illegal numeric escape sequence\")\n\t\treturn ch, false\n\t}\n\treturn ch, true\n}\n\nfunc (s *scanner) error(msg string) {\n\tif s.err == \"\" {\n\t\ts.err = msg\n\t}\n}\n\nfunc digitVal(ch rune) int {\n\tswitch {\n\tcase '0' <= ch && ch <= '9':\n\t\treturn int(ch - '0')\n\tcase 'a' <= ch && ch <= 'f':\n\t\treturn int(ch - 'a' + 10)\n\tcase 'A' <= ch && ch <= 'F':\n\t\treturn int(ch - 'A' + 10)\n\t}\n\treturn 16 // larger than any legal digit val\n}\n\nfunc isFieldRune(r rune) bool {\n\treturn (r == '_' || isAlphaRune(r) || isDigitRune(r))\n}\n\nfunc isAlphaRune(r rune) bool {\n\treturn r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z'\n}\n\nfunc isDigitRune(r rune) bool {\n\treturn r >= '0' && r <= '9'\n}\n\nfunc isOperatorRune(r rune) bool {\n\tswitch r {\n\tcase '=', '!', '~':\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc isQuoteRune(r rune) bool {\n\tswitch r {\n\tcase '/', '|', '\"': // maybe add single quoting?\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc isSeparatorRune(r rune) bool {\n\tswitch r {\n\tcase ',', '.':\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc isValueRune(r rune) bool {\n\treturn r != ',' && !unicode.IsSpace(r) &&\n\t\t(unicode.IsLetter(r) ||\n\t\t\tunicode.IsDigit(r) ||\n\t\t\tunicode.IsNumber(r) ||\n\t\t\tunicode.IsGraphic(r) ||\n\t\t\tunicode.IsPunct(r))\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/identifiers/validate.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package identifiers provides common validation for identifiers and keys\n// across containerd.\n//\n// Identifiers in containerd must be a alphanumeric, allowing limited\n// underscores, dashes and dots.\n//\n// While the character set may be expanded in the future, identifiers\n// are guaranteed to be safely used as filesystem path components.\npackage identifiers\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\n\t\"github.com/containerd/errdefs\"\n)\n\nconst (\n\tmaxLength  = 76\n\talphanum   = `[A-Za-z0-9]+`\n\tseparators = `[._-]`\n)\n\nvar (\n\t// identifierRe defines the pattern for valid identifiers.\n\tidentifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + \"*\"))\n)\n\n// Validate returns nil if the string s is a valid identifier.\n//\n// identifiers are similar to the domain name rules according to RFC 1035, section 2.3.1. However\n// rules in this package are relaxed to allow numerals to follow period (\".\") and mixed case is\n// allowed.\n//\n// In general identifiers that pass this validation should be safe for use as filesystem path components.\nfunc Validate(s string) error {\n\tif len(s) == 0 {\n\t\treturn fmt.Errorf(\"identifier must not be empty: %w\", errdefs.ErrInvalidArgument)\n\t}\n\n\tif len(s) > maxLength {\n\t\treturn fmt.Errorf(\"identifier %q greater than maximum length (%d characters): %w\", s, maxLength, errdefs.ErrInvalidArgument)\n\t}\n\n\tif !identifierRe.MatchString(s) {\n\t\treturn fmt.Errorf(\"identifier %q must match %v: %w\", s, identifierRe, errdefs.ErrInvalidArgument)\n\t}\n\treturn nil\n}\n\nfunc reGroup(s string) string {\n\treturn `(?:` + s + `)`\n}\n\nfunc reAnchor(s string) string {\n\treturn `^` + s + `$`\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/kernelversion/kernel_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   File copied and customized based on\n   https://github.com/moby/moby/tree/v20.10.14/profiles/seccomp/kernel_linux.go\n*/\n\npackage kernelversion\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// KernelVersion holds information about the kernel.\ntype KernelVersion struct {\n\tKernel uint64 // Version of the Kernel (i.e., the \"4\" in \"4.1.2-generic\")\n\tMajor  uint64 // Major revision of the Kernel (i.e., the \"1\" in \"4.1.2-generic\")\n}\n\n// String implements fmt.Stringer for KernelVersion\nfunc (k *KernelVersion) String() string {\n\tif k.Kernel > 0 || k.Major > 0 {\n\t\treturn fmt.Sprintf(\"%d.%d\", k.Kernel, k.Major)\n\t}\n\treturn \"\"\n}\n\nvar (\n\tcurrentKernelVersion *KernelVersion\n\tkernelVersionError   error\n\tonce                 sync.Once\n)\n\n// getKernelVersion gets the current kernel version.\nfunc getKernelVersion() (*KernelVersion, error) {\n\tonce.Do(func() {\n\t\tvar uts unix.Utsname\n\t\tif err := unix.Uname(&uts); err != nil {\n\t\t\treturn\n\t\t}\n\t\t// Remove the \\x00 from the release for Atoi to parse correctly\n\t\tcurrentKernelVersion, kernelVersionError = parseRelease(string(uts.Release[:bytes.IndexByte(uts.Release[:], 0)]))\n\t})\n\treturn currentKernelVersion, kernelVersionError\n}\n\n// parseRelease parses a string and creates a KernelVersion based on it.\nfunc parseRelease(release string) (*KernelVersion, error) {\n\tvar version = KernelVersion{}\n\n\t// We're only make sure we get the \"kernel\" and \"major revision\". Sometimes we have\n\t// 3.12.25-gentoo, but sometimes we just have 3.12-1-amd64.\n\t_, err := fmt.Sscanf(release, \"%d.%d\", &version.Kernel, &version.Major)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse kernel version %q: %w\", release, err)\n\t}\n\treturn &version, nil\n}\n\n// GreaterEqualThan checks if the host's kernel version is greater than, or\n// equal to the given kernel version v. Only \"kernel version\" and \"major revision\"\n// can be specified (e.g., \"3.12\") and will be taken into account, which means\n// that 3.12.25-gentoo and 3.12-1-amd64 are considered equal (kernel: 3, major: 12).\nfunc GreaterEqualThan(minVersion KernelVersion) (bool, error) {\n\tkv, err := getKernelVersion()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif kv.Kernel > minVersion.Kernel {\n\t\treturn true, nil\n\t}\n\tif kv.Kernel == minVersion.Kernel && kv.Major >= minVersion.Major {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/labels/labels.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage labels\n\n// LabelUncompressed is added to compressed layer contents.\n// The value is digest of the uncompressed content.\nconst LabelUncompressed = \"containerd.io/uncompressed\"\n\n// LabelSharedNamespace is added to a namespace to allow that namespaces\n// contents to be shared.\nconst LabelSharedNamespace = \"containerd.io/namespace.shareable\"\n\n// LabelDistributionSource is added to content to indicate its origin.\n// e.g., \"containerd.io/distribution.source.docker.io=library/redis\"\nconst LabelDistributionSource = \"containerd.io/distribution.source\"\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/labels/validate.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage labels\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/containerd/errdefs\"\n)\n\nconst (\n\tmaxSize = 4096\n\t// maximum length of key portion of error message if len of key + len of value > maxSize\n\tkeyMaxLen = 64\n)\n\n// Validate a label's key and value are under 4096 bytes\nfunc Validate(k, v string) error {\n\ttotal := len(k) + len(v)\n\tif total > maxSize {\n\t\tif len(k) > keyMaxLen {\n\t\t\tk = k[:keyMaxLen]\n\t\t}\n\t\treturn fmt.Errorf(\"label key and value length (%d bytes) greater than maximum size (%d bytes), key: %s: %w\", total, maxSize, k, errdefs.ErrInvalidArgument)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/namespaces/context.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage namespaces\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/containerd/containerd/v2/pkg/identifiers\"\n\t\"github.com/containerd/errdefs\"\n)\n\nconst (\n\t// NamespaceEnvVar is the environment variable key name\n\tNamespaceEnvVar = \"CONTAINERD_NAMESPACE\"\n\t// Default is the name of the default namespace\n\tDefault = \"default\"\n)\n\ntype namespaceKey struct{}\n\n// WithNamespace sets a given namespace on the context\nfunc WithNamespace(ctx context.Context, namespace string) context.Context {\n\tctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace\n\t// also store on the grpc and ttrpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withTTRPCNamespaceHeader(withGRPCNamespaceHeader(ctx, namespace), namespace)\n}\n\n// NamespaceFromEnv uses the namespace defined in CONTAINERD_NAMESPACE or\n// default\nfunc NamespaceFromEnv(ctx context.Context) context.Context {\n\tnamespace := os.Getenv(NamespaceEnvVar)\n\tif namespace == \"\" {\n\t\tnamespace = Default\n\t}\n\treturn WithNamespace(ctx, namespace)\n}\n\n// Namespace returns the namespace from the context.\n//\n// The namespace is not guaranteed to be valid.\nfunc Namespace(ctx context.Context) (string, bool) {\n\tnamespace, ok := ctx.Value(namespaceKey{}).(string)\n\tif !ok {\n\t\tif namespace, ok = fromGRPCHeader(ctx); !ok {\n\t\t\treturn fromTTRPCHeader(ctx)\n\t\t}\n\t}\n\treturn namespace, ok\n}\n\n// NamespaceRequired returns the valid namespace from the context or an error.\nfunc NamespaceRequired(ctx context.Context) (string, error) {\n\tnamespace, ok := Namespace(ctx)\n\tif !ok || namespace == \"\" {\n\t\treturn \"\", fmt.Errorf(\"namespace is required: %w\", errdefs.ErrFailedPrecondition)\n\t}\n\tif err := identifiers.Validate(namespace); err != nil {\n\t\treturn \"\", fmt.Errorf(\"namespace validation: %w\", err)\n\t}\n\treturn namespace, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/namespaces/grpc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage namespaces\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/grpc/metadata\"\n)\n\nconst (\n\t// GRPCHeader defines the header name for specifying a containerd namespace.\n\tGRPCHeader = \"containerd-namespace\"\n)\n\n// NOTE(stevvooe): We can stub this file out if we don't want a grpc dependency here.\n\nfunc withGRPCNamespaceHeader(ctx context.Context, namespace string) context.Context {\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\tnsheader := metadata.Pairs(GRPCHeader, namespace)\n\tmd, ok := metadata.FromOutgoingContext(ctx) // merge with outgoing context.\n\tif !ok {\n\t\tmd = nsheader\n\t} else {\n\t\t// order ensures the latest is first in this list.\n\t\tmd = metadata.Join(nsheader, md)\n\t}\n\n\treturn metadata.NewOutgoingContext(ctx, md)\n}\n\nfunc fromGRPCHeader(ctx context.Context) (string, bool) {\n\t// try to extract for use in grpc servers.\n\tmd, ok := metadata.FromIncomingContext(ctx)\n\tif !ok {\n\t\t// TODO(stevvooe): Check outgoing context?\n\t\treturn \"\", false\n\t}\n\n\tvalues := md[GRPCHeader]\n\tif len(values) == 0 {\n\t\treturn \"\", false\n\t}\n\n\treturn values[0], true\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/namespaces/store.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage namespaces\n\nimport \"context\"\n\n// Store provides introspection about namespaces.\n//\n// Note that these are slightly different than other objects, which are record\n// oriented. A namespace is really just a name and a set of labels. Objects\n// that belong to a namespace are returned when the namespace is assigned to a\n// given context.\ntype Store interface {\n\tCreate(ctx context.Context, namespace string, labels map[string]string) error\n\tLabels(ctx context.Context, namespace string) (map[string]string, error)\n\tSetLabel(ctx context.Context, namespace, key, value string) error\n\tList(ctx context.Context) ([]string, error)\n\n\t// Delete removes the namespace. The namespace must be empty to be deleted.\n\tDelete(ctx context.Context, namespace string, opts ...DeleteOpts) error\n}\n\n// DeleteInfo specifies information for the deletion of a namespace\ntype DeleteInfo struct {\n\t// Name of the namespace\n\tName string\n}\n\n// DeleteOpts allows the caller to set options for namespace deletion\ntype DeleteOpts func(context.Context, *DeleteInfo) error\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/namespaces/ttrpc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage namespaces\n\nimport (\n\t\"context\"\n\n\t\"github.com/containerd/ttrpc\"\n)\n\nconst (\n\t// TTRPCHeader defines the header name for specifying a containerd namespace\n\tTTRPCHeader = \"containerd-namespace-ttrpc\"\n)\n\nfunc copyMetadata(src ttrpc.MD) ttrpc.MD {\n\tmd := ttrpc.MD{}\n\tfor k, v := range src {\n\t\tmd[k] = append(md[k], v...)\n\t}\n\treturn md\n}\n\nfunc withTTRPCNamespaceHeader(ctx context.Context, namespace string) context.Context {\n\tmd, ok := ttrpc.GetMetadata(ctx)\n\tif !ok {\n\t\tmd = ttrpc.MD{}\n\t} else {\n\t\tmd = copyMetadata(md)\n\t}\n\tmd.Set(TTRPCHeader, namespace)\n\treturn ttrpc.WithMetadata(ctx, md)\n}\n\nfunc fromTTRPCHeader(ctx context.Context) (string, bool) {\n\treturn ttrpc.GetMetadataValue(ctx, TTRPCHeader)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/protobuf/compare.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage protobuf\n\nimport (\n\t\"github.com/google/go-cmp/cmp\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nvar Compare = cmp.FilterValues(\n\tfunc(x, y interface{}) bool {\n\t\t_, xok := x.(proto.Message)\n\t\t_, yok := y.(proto.Message)\n\t\treturn xok && yok\n\t},\n\tcmp.Comparer(func(x, y interface{}) bool {\n\t\tvx, ok := x.(proto.Message)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tvy, ok := y.(proto.Message)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn proto.Equal(vx, vy)\n\t}),\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/protobuf/timestamp.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage protobuf\n\nimport (\n\t\"time\"\n\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\n// Once we migrate off from gogo/protobuf, we can use the function below, which don't return any errors.\n// https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/types/known/timestamppb/timestamp.pb.go#L200-L208\n\n// ToTimestamp creates protobuf's Timestamp from time.Time.\nfunc ToTimestamp(from time.Time) *timestamppb.Timestamp {\n\treturn timestamppb.New(from)\n}\n\n// FromTimestamp creates time.Time from protobuf's Timestamp.\nfunc FromTimestamp(from *timestamppb.Timestamp) time.Time {\n\treturn from.AsTime()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/protobuf/types/types.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package types provides convenient aliases that make google.golang.org/protobuf migration easier.\npackage types\n\nimport (\n\t\"google.golang.org/protobuf/types/known/anypb\"\n\t\"google.golang.org/protobuf/types/known/emptypb\"\n\tfield_mask \"google.golang.org/protobuf/types/known/fieldmaskpb\"\n)\n\ntype Empty = emptypb.Empty\ntype Any = anypb.Any\ntype FieldMask = field_mask.FieldMask\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage reference\n\nimport (\n\t\"errors\"\n\t\"net/url\"\n\t\"path\"\n\t\"regexp\"\n\t\"strings\"\n\n\tdigest \"github.com/opencontainers/go-digest\"\n)\n\nvar (\n\t// ErrInvalid is returned when there is an invalid reference\n\tErrInvalid = errors.New(\"invalid reference\")\n\t// ErrObjectRequired is returned when the object is required\n\tErrObjectRequired = errors.New(\"object required\")\n\t// ErrHostnameRequired is returned when the hostname is required\n\tErrHostnameRequired = errors.New(\"hostname required\")\n)\n\n// Spec defines the main components of a reference specification.\n//\n// A reference specification is a schema-less URI parsed into common\n// components. The two main components, locator and object, are required to be\n// supported by remotes. It represents a superset of the naming define in\n// docker's reference schema. It aims to be compatible but not prescriptive.\n//\n// While the interpretation of the components, locator and object, are up to\n// the remote, we define a few common parts, accessible via helper methods.\n//\n// The first is the hostname, which is part of the locator. This doesn't need\n// to map to a physical resource, but it must parse as a hostname. We refer to\n// this as the namespace.\n//\n// The other component made accessible by helper method is the digest. This is\n// part of the object identifier, always prefixed with an '@'. If present, the\n// remote may use the digest portion directly or resolve it against a prefix.\n// If the object does not include the `@` symbol, the return value for `Digest`\n// will be empty.\ntype Spec struct {\n\t// Locator is the host and path portion of the specification. The host\n\t// portion may refer to an actual host or just a namespace of related\n\t// images.\n\t//\n\t// Typically, the locator may used to resolve the remote to fetch specific\n\t// resources.\n\tLocator string\n\n\t// Object contains the identifier for the remote resource. Classically,\n\t// this is a tag but can refer to anything in a remote. By convention, any\n\t// portion that may be a partial or whole digest will be preceded by an\n\t// `@`. Anything preceding the `@` will be referred to as the \"tag\".\n\t//\n\t// In practice, we will see this broken down into the following formats:\n\t//\n\t// 1. <tag>\n\t// 2. <tag>@<digest spec>\n\t// 3. @<digest spec>\n\t//\n\t// We define the tag to be anything except '@' and ':'. <digest spec> may\n\t// be a full valid digest or shortened version, possibly with elided\n\t// algorithm.\n\tObject string\n}\n\nvar splitRe = regexp.MustCompile(`[:@]`)\n\n// Parse parses the string into a structured ref.\nfunc Parse(s string) (Spec, error) {\n\tif strings.Contains(s, \"://\") {\n\t\treturn Spec{}, ErrInvalid\n\t}\n\n\tu, err := url.Parse(\"dummy://\" + s)\n\tif err != nil {\n\t\treturn Spec{}, err\n\t}\n\n\tif u.Scheme != \"dummy\" {\n\t\treturn Spec{}, ErrInvalid\n\t}\n\n\tif u.Host == \"\" {\n\t\treturn Spec{}, ErrHostnameRequired\n\t}\n\n\tvar object string\n\n\tif idx := splitRe.FindStringIndex(u.Path); idx != nil {\n\t\t// This allows us to retain the @ to signify digests or shortened digests in\n\t\t// the object.\n\t\tobject = u.Path[idx[0]:]\n\t\tif object[:1] == \":\" {\n\t\t\tobject = object[1:]\n\t\t}\n\t\tu.Path = u.Path[:idx[0]]\n\t}\n\n\treturn Spec{\n\t\tLocator: path.Join(u.Host, u.Path),\n\t\tObject:  object,\n\t}, nil\n}\n\n// Hostname returns the hostname portion of the locator.\n//\n// Remotes are not required to directly access the resources at this host. This\n// method is provided for convenience.\nfunc (r Spec) Hostname() string {\n\ti := strings.Index(r.Locator, \"/\")\n\n\tif i < 0 {\n\t\treturn r.Locator\n\t}\n\treturn r.Locator[:i]\n}\n\n// Digest returns the digest portion of the reference spec. This may be a\n// partial or invalid digest, which may be used to lookup a complete digest.\nfunc (r Spec) Digest() digest.Digest {\n\ti := strings.Index(r.Object, \"@\")\n\n\tif i < 0 {\n\t\treturn \"\"\n\t}\n\treturn digest.Digest(r.Object[i+1:])\n}\n\n// String returns the normalized string for the ref.\nfunc (r Spec) String() string {\n\tif r.Object == \"\" {\n\t\treturn r.Locator\n\t}\n\tif r.Object[:1] == \"@\" {\n\t\treturn r.Locator + r.Object\n\t}\n\n\treturn r.Locator + \":\" + r.Object\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/tracing/helpers.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage tracing\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"go.opentelemetry.io/otel/attribute\"\n)\n\nfunc keyValue(k string, v any) attribute.KeyValue {\n\tif v == nil {\n\t\treturn attribute.String(k, \"<nil>\")\n\t}\n\n\tswitch typed := v.(type) {\n\tcase bool:\n\t\treturn attribute.Bool(k, typed)\n\tcase []bool:\n\t\treturn attribute.BoolSlice(k, typed)\n\tcase int:\n\t\treturn attribute.Int(k, typed)\n\tcase []int:\n\t\treturn attribute.IntSlice(k, typed)\n\tcase int8:\n\t\treturn attribute.Int(k, int(typed))\n\tcase []int8:\n\t\tls := make([]int, 0, len(typed))\n\t\tfor _, i := range typed {\n\t\t\tls = append(ls, int(i))\n\t\t}\n\t\treturn attribute.IntSlice(k, ls)\n\tcase int16:\n\t\treturn attribute.Int(k, int(typed))\n\tcase []int16:\n\t\tls := make([]int, 0, len(typed))\n\t\tfor _, i := range typed {\n\t\t\tls = append(ls, int(i))\n\t\t}\n\t\treturn attribute.IntSlice(k, ls)\n\tcase int32:\n\t\treturn attribute.Int64(k, int64(typed))\n\tcase []int32:\n\t\tls := make([]int64, 0, len(typed))\n\t\tfor _, i := range typed {\n\t\t\tls = append(ls, int64(i))\n\t\t}\n\t\treturn attribute.Int64Slice(k, ls)\n\tcase int64:\n\t\treturn attribute.Int64(k, typed)\n\tcase []int64:\n\t\treturn attribute.Int64Slice(k, typed)\n\tcase float64:\n\t\treturn attribute.Float64(k, typed)\n\tcase []float64:\n\t\treturn attribute.Float64Slice(k, typed)\n\tcase string:\n\t\treturn attribute.String(k, typed)\n\tcase []string:\n\t\treturn attribute.StringSlice(k, typed)\n\t}\n\n\tif stringer, ok := v.(fmt.Stringer); ok {\n\t\treturn attribute.String(k, stringer.String())\n\t}\n\tif b, err := json.Marshal(v); b != nil && err == nil {\n\t\treturn attribute.String(k, string(b))\n\t}\n\treturn attribute.String(k, fmt.Sprintf(\"%v\", v))\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/tracing/log.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage tracing\n\nimport (\n\t\"github.com/containerd/log\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\n// allLevels is the equivalent to [logrus.AllLevels].\n//\n// [logrus.AllLevels]: https://github.com/sirupsen/logrus/blob/v1.9.3/logrus.go#L80-L89\nvar allLevels = []log.Level{\n\tlog.PanicLevel,\n\tlog.FatalLevel,\n\tlog.ErrorLevel,\n\tlog.WarnLevel,\n\tlog.InfoLevel,\n\tlog.DebugLevel,\n\tlog.TraceLevel,\n}\n\n// NewLogrusHook creates a new logrus hook\nfunc NewLogrusHook() *LogrusHook {\n\treturn &LogrusHook{}\n}\n\n// LogrusHook is a [logrus.Hook] which adds logrus events to active spans.\n// If the span is not recording or the span context is invalid, the hook\n// is a no-op.\n//\n// [logrus.Hook]: https://github.com/sirupsen/logrus/blob/v1.9.3/hooks.go#L3-L11\ntype LogrusHook struct{}\n\n// Levels returns the logrus levels that this hook is interested in.\nfunc (h *LogrusHook) Levels() []log.Level {\n\treturn allLevels\n}\n\n// Fire is called when a log event occurs.\nfunc (h *LogrusHook) Fire(entry *log.Entry) error {\n\tspan := trace.SpanFromContext(entry.Context)\n\tif span == nil {\n\t\treturn nil\n\t}\n\n\tif !span.IsRecording() || !span.SpanContext().IsValid() {\n\t\treturn nil\n\t}\n\n\tspan.AddEvent(\n\t\tentry.Message,\n\t\ttrace.WithAttributes(logrusDataToAttrs(entry.Data)...),\n\t\ttrace.WithAttributes(attribute.String(\"level\", entry.Level.String())),\n\t\ttrace.WithTimestamp(entry.Time),\n\t)\n\n\treturn nil\n}\n\nfunc logrusDataToAttrs(data map[string]any) []attribute.KeyValue {\n\tattrs := make([]attribute.KeyValue, 0, len(data))\n\tfor k, v := range data {\n\t\tattrs = append(attrs, keyValue(k, v))\n\t}\n\treturn attrs\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/pkg/tracing/tracing.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage tracing\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/codes\"\n\tsemconv \"go.opentelemetry.io/otel/semconv/v1.21.0\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\n// StartConfig defines configuration for a new span object.\ntype StartConfig struct {\n\tspanOpts []trace.SpanStartOption\n}\n\ntype SpanOpt func(config *StartConfig)\n\n// WithAttribute appends attributes to a new created span.\nfunc WithAttribute(k string, v interface{}) SpanOpt {\n\treturn func(config *StartConfig) {\n\t\tconfig.spanOpts = append(config.spanOpts,\n\t\t\ttrace.WithAttributes(Attribute(k, v)))\n\t}\n}\n\n// UpdateHTTPClient updates the http client with the necessary otel transport\nfunc UpdateHTTPClient(client *http.Client, name string) {\n\tclient.Transport = otelhttp.NewTransport(\n\t\tclient.Transport,\n\t\totelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string {\n\t\t\treturn name\n\t\t}),\n\t)\n}\n\n// StartSpan starts child span in a context.\nfunc StartSpan(ctx context.Context, opName string, opts ...SpanOpt) (context.Context, *Span) {\n\tconfig := StartConfig{}\n\tfor _, fn := range opts {\n\t\tfn(&config)\n\t}\n\ttracer := otel.Tracer(\"\")\n\tif parent := trace.SpanFromContext(ctx); parent != nil && parent.SpanContext().IsValid() {\n\t\ttracer = parent.TracerProvider().Tracer(\"\")\n\t}\n\tctx, span := tracer.Start(ctx, opName, config.spanOpts...)\n\treturn ctx, &Span{otelSpan: span}\n}\n\n// SpanFromContext returns the current Span from the context.\nfunc SpanFromContext(ctx context.Context) *Span {\n\treturn &Span{\n\t\totelSpan: trace.SpanFromContext(ctx),\n\t}\n}\n\n// Span is wrapper around otel trace.Span.\n// Span is the individual component of a trace. It represents a\n// single named and timed operation of a workflow that is traced.\ntype Span struct {\n\totelSpan trace.Span\n}\n\n// End completes the span.\nfunc (s *Span) End() {\n\ts.otelSpan.End()\n}\n\n// AddEvent adds an event with provided name and options.\nfunc (s *Span) AddEvent(name string, attributes ...attribute.KeyValue) {\n\ts.otelSpan.AddEvent(name, trace.WithAttributes(attributes...))\n}\n\n// RecordError will record err as an exception span event for this span\nfunc (s *Span) RecordError(err error, options ...trace.EventOption) {\n\ts.otelSpan.RecordError(err, options...)\n}\n\n// SetStatus sets the status of the current span.\n// If an error is encountered, it records the error and sets span status to Error.\nfunc (s *Span) SetStatus(err error) {\n\tif err != nil {\n\t\ts.otelSpan.RecordError(err)\n\t\ts.otelSpan.SetStatus(codes.Error, err.Error())\n\t} else {\n\t\ts.otelSpan.SetStatus(codes.Ok, \"\")\n\t}\n}\n\n// SetAttributes sets kv as attributes of the span.\nfunc (s *Span) SetAttributes(kv ...attribute.KeyValue) {\n\ts.otelSpan.SetAttributes(kv...)\n}\n\nconst spanDelimiter = \".\"\n\n// Name sets the span name by joining a list of strings in dot separated format.\nfunc Name(names ...string) string {\n\treturn strings.Join(names, spanDelimiter)\n}\n\n// Attribute takes a key value pair and returns attribute.KeyValue type.\nfunc Attribute(k string, v any) attribute.KeyValue {\n\treturn keyValue(k, v)\n}\n\n// HTTPStatusCodeAttributes generates attributes of the HTTP namespace as specified by the OpenTelemetry\n// specification for a span.\nfunc HTTPStatusCodeAttributes(code int) []attribute.KeyValue {\n\treturn []attribute.KeyValue{semconv.HTTPStatusCodeKey.Int(code)}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/content_local_fuzzer.go",
    "content": "//go:build gofuzz\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t_ \"crypto/sha256\"\n\t\"io\"\n\t\"testing\"\n\n\t\"github.com/opencontainers/go-digest\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n)\n\nfunc FuzzContentStoreWriter(data []byte) int {\n\tt := &testing.T{}\n\tctx := context.Background()\n\tctx, _, cs, cleanup := contentStoreEnv(t)\n\tdefer cleanup()\n\n\tcw, err := cs.Writer(ctx, content.WithRef(\"myref\"))\n\tif err != nil {\n\t\treturn 0\n\t}\n\tif err := cw.Close(); err != nil {\n\t\treturn 0\n\t}\n\n\t// reopen, so we can test things\n\tcw, err = cs.Writer(ctx, content.WithRef(\"myref\"))\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\terr = checkCopyFuzz(int64(len(data)), cw, bufio.NewReader(io.NopCloser(bytes.NewReader(data))))\n\tif err != nil {\n\t\treturn 0\n\t}\n\texpected := digest.FromBytes(data)\n\n\tif err = cw.Commit(ctx, int64(len(data)), expected); err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n\nfunc checkCopyFuzz(size int64, dst io.Writer, src io.Reader) error {\n\tnn, err := io.Copy(dst, src)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif nn != size {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/locks.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/containerd/errdefs\"\n)\n\n// Handles locking references\n\ntype lock struct {\n\tsince time.Time\n}\n\nfunc (s *store) tryLock(ref string) error {\n\ts.locksMu.Lock()\n\tdefer s.locksMu.Unlock()\n\n\tif v, ok := s.locks[ref]; ok {\n\t\t// Returning the duration may help developers distinguish dead locks (long duration) from\n\t\t// lock contentions (short duration).\n\t\tnow := time.Now()\n\t\treturn fmt.Errorf(\n\t\t\t\"ref %s locked for %s (since %s): %w\", ref, now.Sub(v.since), v.since,\n\t\t\terrdefs.ErrUnavailable,\n\t\t)\n\t}\n\n\ts.locks[ref] = &lock{time.Now()}\n\treturn nil\n}\n\nfunc (s *store) unlock(ref string) {\n\ts.locksMu.Lock()\n\tdefer s.locksMu.Unlock()\n\n\tdelete(s.locks, ref)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/readerat.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/errdefs\"\n)\n\n// readerat implements io.ReaderAt in a completely stateless manner by opening\n// the referenced file for each call to ReadAt.\ntype sizeReaderAt struct {\n\tsize int64\n\tfp   *os.File\n}\n\n// OpenReader creates ReaderAt from a file\nfunc OpenReader(p string) (content.ReaderAt, error) {\n\tfi, err := os.Stat(p)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"blob not found: %w\", errdefs.ErrNotFound)\n\t}\n\n\tfp, err := os.Open(p)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"blob not found: %w\", errdefs.ErrNotFound)\n\t}\n\n\treturn sizeReaderAt{size: fi.Size(), fp: fp}, nil\n}\n\nfunc (ra sizeReaderAt) ReadAt(p []byte, offset int64) (int, error) {\n\treturn ra.fp.ReadAt(p, offset)\n}\n\nfunc (ra sizeReaderAt) Size() int64 {\n\treturn ra.size\n}\n\nfunc (ra sizeReaderAt) Close() error {\n\treturn ra.fp.Close()\n}\n\nfunc (ra sizeReaderAt) Reader() io.Reader {\n\treturn io.LimitReader(ra.fp, ra.size)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/store.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/internal/fsverity\"\n\t\"github.com/containerd/containerd/v2/pkg/filters\"\n\n\t\"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\nvar bufPool = sync.Pool{\n\tNew: func() interface{} {\n\t\tbuffer := make([]byte, 1<<20)\n\t\treturn &buffer\n\t},\n}\n\n// LabelStore is used to store mutable labels for digests\ntype LabelStore interface {\n\t// Get returns all the labels for the given digest\n\tGet(digest.Digest) (map[string]string, error)\n\n\t// Set sets all the labels for a given digest\n\tSet(digest.Digest, map[string]string) error\n\n\t// Update replaces the given labels for a digest,\n\t// a key with an empty value removes a label.\n\tUpdate(digest.Digest, map[string]string) (map[string]string, error)\n}\n\n// Store is digest-keyed store for content. All data written into the store is\n// stored under a verifiable digest.\n//\n// Store can generally support multi-reader, single-writer ingest of data,\n// including resumable ingest.\ntype store struct {\n\troot               string\n\tls                 LabelStore\n\tintegritySupported bool\n\n\tlocksMu              sync.Mutex\n\tlocks                map[string]*lock\n\tensureIngestRootOnce func() error\n}\n\n// NewStore returns a local content store\nfunc NewStore(root string) (content.Store, error) {\n\treturn NewLabeledStore(root, nil)\n}\n\n// NewLabeledStore returns a new content store using the provided label store\n//\n// Note: content stores which are used underneath a metadata store may not\n// require labels and should use `NewStore`. `NewLabeledStore` is primarily\n// useful for tests or standalone implementations.\nfunc NewLabeledStore(root string, ls LabelStore) (content.Store, error) {\n\tsupported, _ := fsverity.IsSupported(root)\n\n\ts := &store{\n\t\troot:               root,\n\t\tls:                 ls,\n\t\tintegritySupported: supported,\n\t\tlocks:              map[string]*lock{},\n\t}\n\ts.ensureIngestRootOnce = sync.OnceValue(s.ensureIngestRoot)\n\treturn s, nil\n}\n\nfunc (s *store) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {\n\tp, err := s.blobPath(dgst)\n\tif err != nil {\n\t\treturn content.Info{}, fmt.Errorf(\"calculating blob info path: %w\", err)\n\t}\n\n\tfi, err := os.Stat(p)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"content %v: %w\", dgst, errdefs.ErrNotFound)\n\t\t}\n\n\t\treturn content.Info{}, err\n\t}\n\tvar labels map[string]string\n\tif s.ls != nil {\n\t\tlabels, err = s.ls.Get(dgst)\n\t\tif err != nil {\n\t\t\treturn content.Info{}, err\n\t\t}\n\t}\n\treturn s.info(dgst, fi, labels), nil\n}\n\nfunc (s *store) info(dgst digest.Digest, fi os.FileInfo, labels map[string]string) content.Info {\n\treturn content.Info{\n\t\tDigest:    dgst,\n\t\tSize:      fi.Size(),\n\t\tCreatedAt: fi.ModTime(),\n\t\tUpdatedAt: getATime(fi),\n\t\tLabels:    labels,\n\t}\n}\n\n// ReaderAt returns an io.ReaderAt for the blob.\nfunc (s *store) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) {\n\tp, err := s.blobPath(desc.Digest)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"calculating blob path for ReaderAt: %w\", err)\n\t}\n\n\treader, err := OpenReader(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"blob %s expected at %s: %w\", desc.Digest, p, err)\n\t}\n\n\treturn reader, nil\n}\n\n// Delete removes a blob by its digest.\n//\n// While this is safe to do concurrently, safe exist-removal logic must hold\n// some global lock on the store.\nfunc (s *store) Delete(ctx context.Context, dgst digest.Digest) error {\n\tbp, err := s.blobPath(dgst)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"calculating blob path for delete: %w\", err)\n\t}\n\n\tif err := os.RemoveAll(bp); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\n\t\treturn fmt.Errorf(\"content %v: %w\", dgst, errdefs.ErrNotFound)\n\t}\n\n\treturn nil\n}\n\nfunc (s *store) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) {\n\tif s.ls == nil {\n\t\treturn content.Info{}, fmt.Errorf(\"update not supported on immutable content store: %w\", errdefs.ErrFailedPrecondition)\n\t}\n\n\tp, err := s.blobPath(info.Digest)\n\tif err != nil {\n\t\treturn content.Info{}, fmt.Errorf(\"calculating blob path for update: %w\", err)\n\t}\n\n\tfi, err := os.Stat(p)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"content %v: %w\", info.Digest, errdefs.ErrNotFound)\n\t\t}\n\n\t\treturn content.Info{}, err\n\t}\n\n\tvar (\n\t\tall    bool\n\t\tlabels map[string]string\n\t)\n\tif len(fieldpaths) > 0 {\n\t\tfor _, path := range fieldpaths {\n\t\t\tif strings.HasPrefix(path, \"labels.\") {\n\t\t\t\tif labels == nil {\n\t\t\t\t\tlabels = map[string]string{}\n\t\t\t\t}\n\n\t\t\t\tkey := strings.TrimPrefix(path, \"labels.\")\n\t\t\t\tlabels[key] = info.Labels[key]\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tswitch path {\n\t\t\tcase \"labels\":\n\t\t\t\tall = true\n\t\t\t\tlabels = info.Labels\n\t\t\tdefault:\n\t\t\t\treturn content.Info{}, fmt.Errorf(\"cannot update %q field on content info %q: %w\", path, info.Digest, errdefs.ErrInvalidArgument)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tall = true\n\t\tlabels = info.Labels\n\t}\n\n\tif all {\n\t\terr = s.ls.Set(info.Digest, labels)\n\t} else {\n\t\tlabels, err = s.ls.Update(info.Digest, labels)\n\t}\n\tif err != nil {\n\t\treturn content.Info{}, err\n\t}\n\n\tinfo = s.info(info.Digest, fi, labels)\n\tinfo.UpdatedAt = time.Now()\n\n\tif err := os.Chtimes(p, info.UpdatedAt, info.CreatedAt); err != nil {\n\t\tlog.G(ctx).WithError(err).Warnf(\"could not change access time for %s\", info.Digest)\n\t}\n\n\treturn info, nil\n}\n\nfunc (s *store) Walk(ctx context.Context, fn content.WalkFunc, fs ...string) error {\n\troot := filepath.Join(s.root, \"blobs\")\n\n\tfilter, err := filters.ParseAll(fs...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar alg digest.Algorithm\n\treturn filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !fi.IsDir() && !alg.Available() {\n\t\t\treturn nil\n\t\t}\n\n\t\t// TODO(stevvooe): There are few more cases with subdirs that should be\n\t\t// handled in case the layout gets corrupted. This isn't strict enough\n\t\t// and may spew bad data.\n\n\t\tif path == root {\n\t\t\treturn nil\n\t\t}\n\t\tif filepath.Dir(path) == root {\n\t\t\talg = digest.Algorithm(filepath.Base(path))\n\n\t\t\tif !alg.Available() {\n\t\t\t\talg = \"\"\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\n\t\t\t// descending into a hash directory\n\t\t\treturn nil\n\t\t}\n\n\t\tdgst := digest.NewDigestFromEncoded(alg, filepath.Base(path))\n\t\tif err := dgst.Validate(); err != nil {\n\t\t\t// log error but don't report\n\t\t\tlog.L.WithError(err).WithField(\"path\", path).Error(\"invalid digest for blob path\")\n\t\t\t// if we see this, it could mean some sort of corruption of the\n\t\t\t// store or extra paths not expected previously.\n\t\t}\n\n\t\tvar labels map[string]string\n\t\tif s.ls != nil {\n\t\t\tlabels, err = s.ls.Get(dgst)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tinfo := s.info(dgst, fi, labels)\n\t\tif !filter.Match(content.AdaptInfo(info)) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fn(info)\n\t})\n}\n\nfunc (s *store) Status(ctx context.Context, ref string) (content.Status, error) {\n\treturn s.status(s.ingestRoot(ref))\n}\n\nfunc (s *store) ListStatuses(ctx context.Context, fs ...string) ([]content.Status, error) {\n\tfp, err := os.Open(filepath.Join(s.root, \"ingest\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer fp.Close()\n\n\tfis, err := fp.Readdirnames(-1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilter, err := filters.ParseAll(fs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar active []content.Status\n\tfor _, fi := range fis {\n\t\tp := filepath.Join(s.root, \"ingest\", fi)\n\t\tstat, err := s.status(p)\n\t\tif err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// TODO(stevvooe): This is a common error if uploads are being\n\t\t\t// completed while making this listing. Need to consider taking a\n\t\t\t// lock on the whole store to coordinate this aspect.\n\t\t\t//\n\t\t\t// Another option is to cleanup downloads asynchronously and\n\t\t\t// coordinate this method with the cleanup process.\n\t\t\t//\n\t\t\t// For now, we just skip them, as they really don't exist.\n\t\t\tcontinue\n\t\t}\n\n\t\tif filter.Match(adaptStatus(stat)) {\n\t\t\tactive = append(active, stat)\n\t\t}\n\t}\n\n\treturn active, nil\n}\n\n// WalkStatusRefs is used to walk all status references\n// Failed status reads will be logged and ignored, if\n// this function is called while references are being altered,\n// these error messages may be produced.\nfunc (s *store) WalkStatusRefs(ctx context.Context, fn func(string) error) error {\n\tfp, err := os.Open(filepath.Join(s.root, \"ingest\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tdefer fp.Close()\n\n\tfis, err := fp.Readdirnames(-1)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, fi := range fis {\n\t\trf := filepath.Join(s.root, \"ingest\", fi, \"ref\")\n\n\t\tref, err := readFileString(rf)\n\t\tif err != nil {\n\t\t\tlog.G(ctx).WithError(err).WithField(\"path\", rf).Error(\"failed to read ingest ref\")\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := fn(ref); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// status works like stat above except uses the path to the ingest.\nfunc (s *store) status(ingestPath string) (content.Status, error) {\n\tdp := filepath.Join(ingestPath, \"data\")\n\tfi, err := os.Stat(dp)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"%s: %w\", err.Error(), errdefs.ErrNotFound)\n\t\t}\n\t\treturn content.Status{}, err\n\t}\n\n\tref, err := readFileString(filepath.Join(ingestPath, \"ref\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"%s: %w\", err.Error(), errdefs.ErrNotFound)\n\t\t}\n\t\treturn content.Status{}, err\n\t}\n\n\tstartedAt, err := readFileTimestamp(filepath.Join(ingestPath, \"startedat\"))\n\tif err != nil {\n\t\treturn content.Status{}, fmt.Errorf(\"could not read startedat: %w\", err)\n\t}\n\n\tupdatedAt, err := readFileTimestamp(filepath.Join(ingestPath, \"updatedat\"))\n\tif err != nil {\n\t\treturn content.Status{}, fmt.Errorf(\"could not read updatedat: %w\", err)\n\t}\n\n\t// because we don't write updatedat on every write, the mod time may\n\t// actually be more up to date.\n\tif fi.ModTime().After(updatedAt) {\n\t\tupdatedAt = fi.ModTime()\n\t}\n\n\treturn content.Status{\n\t\tRef:       ref,\n\t\tOffset:    fi.Size(),\n\t\tTotal:     s.total(ingestPath),\n\t\tUpdatedAt: updatedAt,\n\t\tStartedAt: startedAt,\n\t}, nil\n}\n\nfunc adaptStatus(status content.Status) filters.Adaptor {\n\treturn filters.AdapterFunc(func(fieldpath []string) (string, bool) {\n\t\tif len(fieldpath) == 0 {\n\t\t\treturn \"\", false\n\t\t}\n\t\tswitch fieldpath[0] {\n\t\tcase \"ref\":\n\t\t\treturn status.Ref, true\n\t\t}\n\n\t\treturn \"\", false\n\t})\n}\n\n// total attempts to resolve the total expected size for the write.\nfunc (s *store) total(ingestPath string) int64 {\n\ttotalS, err := readFileString(filepath.Join(ingestPath, \"total\"))\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\ttotal, err := strconv.ParseInt(totalS, 10, 64)\n\tif err != nil {\n\t\t// represents a corrupted file, should probably remove.\n\t\treturn 0\n\t}\n\n\treturn total\n}\n\n// Writer begins or resumes the active writer identified by ref. If the writer\n// is already in use, an error is returned. Only one writer may be in use per\n// ref at a time.\n//\n// The argument `ref` is used to uniquely identify a long-lived writer transaction.\nfunc (s *store) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) {\n\tvar wOpts content.WriterOpts\n\tfor _, opt := range opts {\n\t\tif err := opt(&wOpts); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// TODO(AkihiroSuda): we could create a random string or one calculated based on the context\n\t// https://github.com/containerd/containerd/issues/2129#issuecomment-380255019\n\tif wOpts.Ref == \"\" {\n\t\treturn nil, fmt.Errorf(\"ref must not be empty: %w\", errdefs.ErrInvalidArgument)\n\t}\n\n\tif err := s.tryLock(wOpts.Ref); err != nil {\n\t\treturn nil, err\n\t}\n\n\tw, err := s.writer(ctx, wOpts.Ref, wOpts.Desc.Size, wOpts.Desc.Digest)\n\tif err != nil {\n\t\ts.unlock(wOpts.Ref)\n\t\treturn nil, err\n\t}\n\n\treturn w, nil // lock is now held by w.\n}\n\nfunc (s *store) resumeStatus(ref string, total int64, digester digest.Digester) (content.Status, error) {\n\tpath, _, data := s.ingestPaths(ref)\n\tstatus, err := s.status(path)\n\tif err != nil {\n\t\treturn status, fmt.Errorf(\"failed reading status of resume write: %w\", err)\n\t}\n\tif ref != status.Ref {\n\t\t// NOTE(stevvooe): This is fairly catastrophic. Either we have some\n\t\t// layout corruption or a hash collision for the ref key.\n\t\treturn status, fmt.Errorf(\"ref key does not match: %v != %v\", ref, status.Ref)\n\t}\n\n\tif total > 0 && status.Total > 0 && total != status.Total {\n\t\treturn status, fmt.Errorf(\"provided total differs from status: %v != %v\", total, status.Total)\n\t}\n\n\t//nolint:dupword\n\t// TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes\n\tfp, err := os.Open(data)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tp := bufPool.Get().(*[]byte)\n\tstatus.Offset, err = io.CopyBuffer(digester.Hash(), fp, *p)\n\tbufPool.Put(p)\n\tfp.Close()\n\treturn status, err\n}\n\n// writer provides the main implementation of the Writer method. The caller\n// must hold the lock correctly and release on error if there is a problem.\nfunc (s *store) writer(ctx context.Context, ref string, total int64, expected digest.Digest) (content.Writer, error) {\n\t// TODO(stevvooe): Need to actually store expected here. We have\n\t// code in the service that shouldn't be dealing with this.\n\tif expected != \"\" {\n\t\tp, err := s.blobPath(expected)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"calculating expected blob path for writer: %w\", err)\n\t\t}\n\t\tif _, err := os.Stat(p); err == nil {\n\t\t\treturn nil, fmt.Errorf(\"content %v: %w\", expected, errdefs.ErrAlreadyExists)\n\t\t}\n\t}\n\n\tpath, refp, data := s.ingestPaths(ref)\n\n\tvar (\n\t\tdigester  = digest.Canonical.Digester()\n\t\toffset    int64\n\t\tstartedAt time.Time\n\t\tupdatedAt time.Time\n\t)\n\n\tfoundValidIngest := false\n\n\tif err := s.ensureIngestRootOnce(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// ensure that the ingest path has been created.\n\tif err := os.Mkdir(path, 0755); err != nil {\n\t\tif !os.IsExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\t\tstatus, err := s.resumeStatus(ref, total, digester)\n\t\tif err == nil {\n\t\t\tfoundValidIngest = true\n\t\t\tupdatedAt = status.UpdatedAt\n\t\t\tstartedAt = status.StartedAt\n\t\t\ttotal = status.Total\n\t\t\toffset = status.Offset\n\t\t} else {\n\t\t\tlog.G(ctx).Infof(\"failed to resume the status from path %s: %s. will recreate them\", path, err.Error())\n\t\t}\n\t}\n\n\tif !foundValidIngest {\n\t\tstartedAt = time.Now()\n\t\tupdatedAt = startedAt\n\n\t\t// the ingest is new, we need to setup the target location.\n\t\t// write the ref to a file for later use\n\t\tif err := os.WriteFile(refp, []byte(ref), 0666); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := writeTimestampFile(filepath.Join(path, \"startedat\"), startedAt); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := writeTimestampFile(filepath.Join(path, \"updatedat\"), startedAt); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif total > 0 {\n\t\t\tif err := os.WriteFile(filepath.Join(path, \"total\"), []byte(fmt.Sprint(total)), 0666); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\tfp, err := os.OpenFile(data, os.O_WRONLY|os.O_CREATE, 0666)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open data file: %w\", err)\n\t}\n\n\tif _, err := fp.Seek(offset, io.SeekStart); err != nil {\n\t\tfp.Close()\n\t\treturn nil, fmt.Errorf(\"could not seek to current write offset: %w\", err)\n\t}\n\n\treturn &writer{\n\t\ts:         s,\n\t\tfp:        fp,\n\t\tref:       ref,\n\t\tpath:      path,\n\t\toffset:    offset,\n\t\ttotal:     total,\n\t\tdigester:  digester,\n\t\tstartedAt: startedAt,\n\t\tupdatedAt: updatedAt,\n\t}, nil\n}\n\n// Abort an active transaction keyed by ref. If the ingest is active, it will\n// be cancelled. Any resources associated with the ingest will be cleaned.\nfunc (s *store) Abort(ctx context.Context, ref string) error {\n\troot := s.ingestRoot(ref)\n\tif err := os.RemoveAll(root); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"ingest ref %q: %w\", ref, errdefs.ErrNotFound)\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *store) blobPath(dgst digest.Digest) (string, error) {\n\tif err := dgst.Validate(); err != nil {\n\t\treturn \"\", fmt.Errorf(\"cannot calculate blob path from invalid digest: %v: %w\", err, errdefs.ErrInvalidArgument)\n\t}\n\n\treturn filepath.Join(s.root, \"blobs\", dgst.Algorithm().String(), dgst.Encoded()), nil\n}\n\nfunc (s *store) ingestRoot(ref string) string {\n\t// we take a digest of the ref to keep the ingest paths constant length.\n\t// Note that this is not the current or potential digest of incoming content.\n\tdgst := digest.FromString(ref)\n\treturn filepath.Join(s.root, \"ingest\", dgst.Encoded())\n}\n\n// ingestPaths are returned. The paths are the following:\n//\n// - root: entire ingest directory\n// - ref: name of the starting ref, must be unique\n// - data: file where data is written\nfunc (s *store) ingestPaths(ref string) (string, string, string) {\n\tvar (\n\t\tfp = s.ingestRoot(ref)\n\t\trp = filepath.Join(fp, \"ref\")\n\t\tdp = filepath.Join(fp, \"data\")\n\t)\n\n\treturn fp, rp, dp\n}\n\nfunc (s *store) ensureIngestRoot() error {\n\treturn os.MkdirAll(filepath.Join(s.root, \"ingest\"), 0777)\n}\n\nfunc readFileString(path string) (string, error) {\n\tp, err := os.ReadFile(path)\n\treturn string(p), err\n}\n\n// readFileTimestamp reads a file with just a timestamp present.\nfunc readFileTimestamp(p string) (time.Time, error) {\n\tb, err := os.ReadFile(p)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"%s: %w\", err.Error(), errdefs.ErrNotFound)\n\t\t}\n\t\treturn time.Time{}, err\n\t}\n\n\tvar t time.Time\n\tif err := t.UnmarshalText(b); err != nil {\n\t\treturn time.Time{}, fmt.Errorf(\"could not parse timestamp file %v: %w\", p, err)\n\t}\n\n\treturn t, nil\n}\n\nfunc writeTimestampFile(p string, t time.Time) error {\n\tb, err := t.MarshalText()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeToCompletion(p, b, 0666)\n}\n\nfunc writeToCompletion(path string, data []byte, mode os.FileMode) error {\n\ttmp := fmt.Sprintf(\"%s.tmp\", path)\n\tf, err := os.OpenFile(tmp, os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_SYNC, mode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create tmp file: %w\", err)\n\t}\n\t_, err = f.Write(data)\n\tf.Close()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"write tmp file: %w\", err)\n\t}\n\terr = os.Rename(tmp, path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"rename tmp file: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/store_bsd.go",
    "content": "//go:build darwin || freebsd || netbsd\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc getATime(fi os.FileInfo) time.Time {\n\tif st, ok := fi.Sys().(*syscall.Stat_t); ok {\n\t\treturn time.Unix(st.Atimespec.Unix())\n\t}\n\n\treturn fi.ModTime()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/store_openbsd.go",
    "content": "//go:build openbsd\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc getATime(fi os.FileInfo) time.Time {\n\tif st, ok := fi.Sys().(*syscall.Stat_t); ok {\n\t\treturn time.Unix(st.Atim.Unix())\n\t}\n\n\treturn fi.ModTime()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/store_unix.go",
    "content": "//go:build linux || solaris\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc getATime(fi os.FileInfo) time.Time {\n\tif st, ok := fi.Sys().(*syscall.Stat_t); ok {\n\t\treturn time.Unix(st.Atim.Unix())\n\t}\n\n\treturn fi.ModTime()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/store_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"os\"\n\t\"time\"\n)\n\nfunc getATime(fi os.FileInfo) time.Time {\n\treturn fi.ModTime()\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/test_helper.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n)\n\nfunc contentStoreEnv(t testing.TB) (context.Context, string, content.Store, func()) {\n\ttmpdir := t.TempDir()\n\n\tcs, err := NewStore(tmpdir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\treturn ctx, tmpdir, cs, func() {\n\t\tcancel()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/content/local/writer.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage local\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/log\"\n\t\"github.com/opencontainers/go-digest\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/internal/fsverity\"\n)\n\n// writer represents a write transaction against the blob store.\ntype writer struct {\n\ts         *store\n\tfp        *os.File // opened data file\n\tpath      string   // path to writer dir\n\tref       string   // ref key\n\toffset    int64\n\ttotal     int64\n\tdigester  digest.Digester\n\tstartedAt time.Time\n\tupdatedAt time.Time\n}\n\nfunc (w *writer) Status() (content.Status, error) {\n\treturn content.Status{\n\t\tRef:       w.ref,\n\t\tOffset:    w.offset,\n\t\tTotal:     w.total,\n\t\tStartedAt: w.startedAt,\n\t\tUpdatedAt: w.updatedAt,\n\t}, nil\n}\n\n// Digest returns the current digest of the content, up to the current write.\n//\n// Cannot be called concurrently with `Write`.\nfunc (w *writer) Digest() digest.Digest {\n\treturn w.digester.Digest()\n}\n\n// Write p to the transaction.\n//\n// Note that writes are unbuffered to the backing file. When writing, it is\n// recommended to wrap in a bufio.Writer or, preferably, use io.CopyBuffer.\nfunc (w *writer) Write(p []byte) (n int, err error) {\n\tn, err = w.fp.Write(p)\n\tw.digester.Hash().Write(p[:n])\n\tw.offset += int64(len(p))\n\tw.updatedAt = time.Now()\n\treturn n, err\n}\n\nfunc (w *writer) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error {\n\t// Ensure even on error the writer is fully closed\n\tdefer w.s.unlock(w.ref)\n\n\tvar base content.Info\n\tfor _, opt := range opts {\n\t\tif err := opt(&base); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfp := w.fp\n\tw.fp = nil\n\n\tif fp == nil {\n\t\treturn fmt.Errorf(\"cannot commit on closed writer: %w\", errdefs.ErrFailedPrecondition)\n\t}\n\n\tif err := fp.Sync(); err != nil {\n\t\tfp.Close()\n\t\treturn fmt.Errorf(\"sync failed: %w\", err)\n\t}\n\n\tfi, err := fp.Stat()\n\tcloseErr := fp.Close()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"stat on ingest file failed: %w\", err)\n\t}\n\tif closeErr != nil {\n\t\treturn fmt.Errorf(\"failed to close ingest file: %w\", closeErr)\n\t}\n\n\tif size > 0 && size != fi.Size() {\n\t\treturn fmt.Errorf(\"unexpected commit size %d, expected %d: %w\", fi.Size(), size, errdefs.ErrFailedPrecondition)\n\t}\n\n\tdgst := w.digester.Digest()\n\tif expected != \"\" && expected != dgst {\n\t\treturn fmt.Errorf(\"unexpected commit digest %s, expected %s: %w\", dgst, expected, errdefs.ErrFailedPrecondition)\n\t}\n\n\tvar (\n\t\tingest    = filepath.Join(w.path, \"data\")\n\t\ttarget, _ = w.s.blobPath(dgst) // ignore error because we calculated this dgst\n\t)\n\n\t// make sure parent directories of blob exist\n\tif err := os.MkdirAll(filepath.Dir(target), 0755); err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := os.Stat(target); err == nil {\n\t\t// collision with the target file!\n\t\tif err := os.RemoveAll(w.path); err != nil {\n\t\t\tlog.G(ctx).WithField(\"ref\", w.ref).WithField(\"path\", w.path).Error(\"failed to remove ingest directory\")\n\t\t}\n\t\treturn fmt.Errorf(\"content %v: %w\", dgst, errdefs.ErrAlreadyExists)\n\t}\n\n\tif err := os.Rename(ingest, target); err != nil {\n\t\treturn err\n\t}\n\n\t// Enable content blob integrity verification if supported\n\n\tif w.s.integritySupported {\n\t\tif err := fsverity.Enable(target); err != nil {\n\t\t\tlog.G(ctx).Warnf(\"failed to enable integrity for blob %v: %s\", target, err.Error())\n\t\t}\n\t}\n\n\t// Ingest has now been made available in the content store, attempt to complete\n\t// setting metadata but errors should only be logged and not returned since\n\t// the content store cannot be cleanly rolled back.\n\n\tcommitTime := time.Now()\n\tif err := os.Chtimes(target, commitTime, commitTime); err != nil {\n\t\tlog.G(ctx).WithField(\"digest\", dgst).Error(\"failed to change file time to commit time\")\n\t}\n\n\t// clean up!!\n\tif err := os.RemoveAll(w.path); err != nil {\n\t\tlog.G(ctx).WithField(\"ref\", w.ref).WithField(\"path\", w.path).Error(\"failed to remove ingest directory\")\n\t}\n\n\tif w.s.ls != nil && base.Labels != nil {\n\t\tif err := w.s.ls.Set(dgst, base.Labels); err != nil {\n\t\t\tlog.G(ctx).WithField(\"digest\", dgst).Error(\"failed to set labels\")\n\t\t}\n\t}\n\n\t// change to readonly, more important for read, but provides _some_\n\t// protection from this point on. We use the existing perms with a mask\n\t// only allowing reads honoring the umask on creation.\n\t//\n\t// This removes write and exec, only allowing read per the creation umask.\n\t//\n\t// NOTE: Windows does not support this operation\n\tif runtime.GOOS != \"windows\" {\n\t\tif err := os.Chmod(target, (fi.Mode()&os.ModePerm)&^0333); err != nil {\n\t\t\tlog.G(ctx).WithField(\"ref\", w.ref).Error(\"failed to make readonly\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Close the writer, flushing any unwritten data and leaving the progress in\n// tact.\n//\n// If one needs to resume the transaction, a new writer can be obtained from\n// `Ingester.Writer` using the same key. The write can then be continued\n// from it was left off.\n//\n// To abandon a transaction completely, first call close then `IngestManager.Abort` to\n// clean up the associated resources.\nfunc (w *writer) Close() (err error) {\n\tif w.fp != nil {\n\t\tw.fp.Sync()\n\t\terr = w.fp.Close()\n\t\twriteTimestampFile(filepath.Join(w.path, \"updatedat\"), w.updatedAt)\n\t\tw.fp = nil\n\t\tw.s.unlock(w.ref)\n\t\treturn\n\t}\n\n\treturn nil\n}\n\nfunc (w *writer) Truncate(size int64) error {\n\tif size != 0 {\n\t\treturn errors.New(\"Truncate: unsupported size\")\n\t}\n\tw.offset = 0\n\tw.digester.Hash().Reset()\n\tif _, err := w.fp.Seek(0, io.SeekStart); err != nil {\n\t\treturn err\n\t}\n\treturn w.fp.Truncate(0)\n}\n\nfunc (w *writer) Sync() error {\n\tif w.fp != nil {\n\t\treturn w.fp.Sync()\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/plugins/services/content/contentserver/contentserver.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage contentserver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n\n\tapi \"github.com/containerd/containerd/api/services/content/v1\"\n\t\"github.com/containerd/errdefs/pkg/errgrpc\"\n\t\"github.com/containerd/log\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tocispec \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n\n\t\"github.com/containerd/containerd/v2/core/content\"\n\t\"github.com/containerd/containerd/v2/pkg/protobuf\"\n\tptypes \"github.com/containerd/containerd/v2/pkg/protobuf/types\"\n)\n\ntype service struct {\n\tstore content.Store\n\tapi.UnimplementedContentServer\n}\n\nvar (\n\tempty   = &ptypes.Empty{}\n\tbufPool = sync.Pool{\n\t\tNew: func() interface{} {\n\t\t\tbuffer := make([]byte, 1<<20)\n\t\t\treturn &buffer\n\t\t},\n\t}\n)\n\n// New returns the content GRPC server\nfunc New(cs content.Store) api.ContentServer {\n\treturn &service{store: cs}\n}\n\nfunc (s *service) Register(server *grpc.Server) error {\n\tapi.RegisterContentServer(server, s)\n\treturn nil\n}\n\nfunc (s *service) Info(ctx context.Context, req *api.InfoRequest) (*api.InfoResponse, error) {\n\tdg, err := digest.Parse(req.Digest)\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"%q failed validation\", req.Digest)\n\t}\n\n\tbi, err := s.store.Info(ctx, dg)\n\tif err != nil {\n\t\treturn nil, errgrpc.ToGRPC(err)\n\t}\n\n\treturn &api.InfoResponse{\n\t\tInfo: infoToGRPC(bi),\n\t}, nil\n}\n\nfunc (s *service) Update(ctx context.Context, req *api.UpdateRequest) (*api.UpdateResponse, error) {\n\t_, err := digest.Parse(req.Info.Digest)\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"%q failed validation\", req.Info.Digest)\n\t}\n\n\tinfo, err := s.store.Update(ctx, infoFromGRPC(req.Info), req.UpdateMask.GetPaths()...)\n\tif err != nil {\n\t\treturn nil, errgrpc.ToGRPC(err)\n\t}\n\n\treturn &api.UpdateResponse{\n\t\tInfo: infoToGRPC(info),\n\t}, nil\n}\n\nfunc (s *service) List(req *api.ListContentRequest, session api.Content_ListServer) error {\n\tvar (\n\t\tbuffer    []*api.Info\n\t\tsendBlock = func(block []*api.Info) error {\n\t\t\t// send last block\n\t\t\treturn session.Send(&api.ListContentResponse{\n\t\t\t\tInfo: block,\n\t\t\t})\n\t\t}\n\t)\n\n\tif err := s.store.Walk(session.Context(), func(info content.Info) error {\n\t\tbuffer = append(buffer, infoToGRPC(info))\n\n\t\tif len(buffer) >= 100 {\n\t\t\tif err := sendBlock(buffer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tbuffer = buffer[:0]\n\t\t}\n\n\t\treturn nil\n\t}, req.Filters...); err != nil {\n\t\treturn errgrpc.ToGRPC(err)\n\t}\n\n\tif len(buffer) > 0 {\n\t\t// send last block\n\t\tif err := sendBlock(buffer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *service) Delete(ctx context.Context, req *api.DeleteContentRequest) (*ptypes.Empty, error) {\n\tlog.G(ctx).WithField(\"digest\", req.Digest).Debugf(\"delete content\")\n\tdg, err := digest.Parse(req.Digest)\n\tif err != nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\n\tif err := s.store.Delete(ctx, dg); err != nil {\n\t\treturn nil, errgrpc.ToGRPC(err)\n\t}\n\n\treturn empty, nil\n}\n\nfunc (s *service) Read(req *api.ReadContentRequest, session api.Content_ReadServer) error {\n\tdg, err := digest.Parse(req.Digest)\n\tif err != nil {\n\t\treturn status.Errorf(codes.InvalidArgument, \"%v: %v\", req.Digest, err)\n\t}\n\n\toi, err := s.store.Info(session.Context(), dg)\n\tif err != nil {\n\t\treturn errgrpc.ToGRPC(err)\n\t}\n\n\tra, err := s.store.ReaderAt(session.Context(), ocispec.Descriptor{Digest: dg})\n\tif err != nil {\n\t\treturn errgrpc.ToGRPC(err)\n\t}\n\tdefer ra.Close()\n\n\tvar (\n\t\toffset = req.Offset\n\t\t// size is read size, not the expected size of the blob (oi.Size), which the caller might not be aware of.\n\t\t// offset+size can be larger than oi.Size.\n\t\tsize = req.Size\n\n\t\t// TODO(stevvooe): Using the global buffer pool. At 32KB, it is probably\n\t\t// little inefficient for work over a fast network. We can tune this later.\n\t\tp = bufPool.Get().(*[]byte)\n\t)\n\tdefer bufPool.Put(p)\n\n\tif offset < 0 {\n\t\toffset = 0\n\t}\n\n\tif offset > oi.Size {\n\t\treturn status.Errorf(codes.OutOfRange, \"read past object length %v bytes\", oi.Size)\n\t}\n\n\tif size <= 0 || offset+size > oi.Size {\n\t\tsize = oi.Size - offset\n\t}\n\n\t_, err = io.CopyBuffer(\n\t\t&readResponseWriter{session: session},\n\t\tio.NewSectionReader(ra, offset, size), *p)\n\treturn errgrpc.ToGRPC(err)\n}\n\n// readResponseWriter is a writer that places the output into ReadContentRequest messages.\n//\n// This allows io.CopyBuffer to do the heavy lifting of chunking the responses\n// into the buffer size.\ntype readResponseWriter struct {\n\toffset  int64\n\tsession api.Content_ReadServer\n}\n\nfunc (rw *readResponseWriter) Write(p []byte) (n int, err error) {\n\tif err := rw.session.Send(&api.ReadContentResponse{\n\t\tOffset: rw.offset,\n\t\tData:   p,\n\t}); err != nil {\n\t\treturn 0, err\n\t}\n\n\trw.offset += int64(len(p))\n\treturn len(p), nil\n}\n\nfunc (s *service) Status(ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error) {\n\tstatus, err := s.store.Status(ctx, req.Ref)\n\tif err != nil {\n\t\treturn nil, errgrpc.ToGRPCf(err, \"could not get status for ref %q\", req.Ref)\n\t}\n\n\tvar resp api.StatusResponse\n\tresp.Status = &api.Status{\n\t\tStartedAt: protobuf.ToTimestamp(status.StartedAt),\n\t\tUpdatedAt: protobuf.ToTimestamp(status.UpdatedAt),\n\t\tRef:       status.Ref,\n\t\tOffset:    status.Offset,\n\t\tTotal:     status.Total,\n\t\tExpected:  status.Expected.String(),\n\t}\n\n\treturn &resp, nil\n}\n\nfunc (s *service) ListStatuses(ctx context.Context, req *api.ListStatusesRequest) (*api.ListStatusesResponse, error) {\n\tstatuses, err := s.store.ListStatuses(ctx, req.Filters...)\n\tif err != nil {\n\t\treturn nil, errgrpc.ToGRPC(err)\n\t}\n\n\tvar resp api.ListStatusesResponse\n\tfor _, status := range statuses {\n\t\tresp.Statuses = append(resp.Statuses, &api.Status{\n\t\t\tStartedAt: protobuf.ToTimestamp(status.StartedAt),\n\t\t\tUpdatedAt: protobuf.ToTimestamp(status.UpdatedAt),\n\t\t\tRef:       status.Ref,\n\t\t\tOffset:    status.Offset,\n\t\t\tTotal:     status.Total,\n\t\t\tExpected:  status.Expected.String(),\n\t\t})\n\t}\n\n\treturn &resp, nil\n}\n\nfunc (s *service) Write(session api.Content_WriteServer) (err error) {\n\tvar (\n\t\tctx      = session.Context()\n\t\tmsg      api.WriteContentResponse\n\t\treq      *api.WriteContentRequest\n\t\tref      string\n\t\ttotal    int64\n\t\texpected digest.Digest\n\t)\n\n\tdefer func(msg *api.WriteContentResponse) {\n\t\t// pump through the last message if no error was encountered\n\t\tif err != nil {\n\t\t\tif s, ok := status.FromError(err); ok && s.Code() != codes.AlreadyExists {\n\t\t\t\t// TODO(stevvooe): Really need a log line here to track which\n\t\t\t\t// errors are actually causing failure on the server side. May want\n\t\t\t\t// to configure the service with an interceptor to make this work\n\t\t\t\t// identically across all GRPC methods.\n\t\t\t\t//\n\t\t\t\t// This is pretty noisy, so we can remove it but leave it for now.\n\t\t\t\tlog.G(ctx).WithError(err).Error(\"(*service).Write failed\")\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\terr = session.Send(msg)\n\t}(&msg)\n\n\t// handle the very first request!\n\treq, err = session.Recv()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tref = req.Ref\n\n\tif ref == \"\" {\n\t\treturn status.Errorf(codes.InvalidArgument, \"first message must have a reference\")\n\t}\n\n\tfields := log.Fields{\n\t\t\"ref\": ref,\n\t}\n\ttotal = req.Total\n\texpected = digest.Digest(req.Expected)\n\tif total > 0 {\n\t\tfields[\"total\"] = total\n\t}\n\n\tif expected != \"\" {\n\t\tfields[\"expected\"] = expected\n\t}\n\n\tctx = log.WithLogger(ctx, log.G(ctx).WithFields(fields))\n\n\tlog.G(ctx).Debug(\"(*service).Write started\")\n\t// this action locks the writer for the session.\n\twr, err := s.store.Writer(ctx,\n\t\tcontent.WithRef(ref),\n\t\tcontent.WithDescriptor(ocispec.Descriptor{Size: total, Digest: expected}))\n\tif err != nil {\n\t\treturn errgrpc.ToGRPC(err)\n\t}\n\tdefer wr.Close()\n\n\tfor {\n\t\tmsg.Action = req.Action\n\t\tws, err := wr.Status()\n\t\tif err != nil {\n\t\t\treturn errgrpc.ToGRPC(err)\n\t\t}\n\n\t\tmsg.Offset = ws.Offset // always set the offset.\n\n\t\t// NOTE(stevvooe): In general, there are two cases underwhich a remote\n\t\t// writer is used.\n\t\t//\n\t\t// For pull, we almost always have this before fetching large content,\n\t\t// through descriptors. We allow predeclaration of the expected size\n\t\t// and digest.\n\t\t//\n\t\t// For push, it is more complex. If we want to cut through content into\n\t\t// storage, we may have no expectation until we are done processing the\n\t\t// content. The case here is the following:\n\t\t//\n\t\t// \t1. Start writing content.\n\t\t// \t2. Compress inline.\n\t\t// \t3. Validate digest and size (maybe).\n\t\t//\n\t\t// Supporting these two paths is quite awkward but it lets both API\n\t\t// users use the same writer style for each with a minimum of overhead.\n\t\tif req.Expected != \"\" {\n\t\t\tdg := digest.Digest(req.Expected)\n\t\t\tif expected != \"\" && expected != dg {\n\t\t\t\tlog.G(ctx).Debugf(\"commit digest differs from writer digest: %v != %v\", dg, expected)\n\t\t\t}\n\t\t\texpected = dg\n\n\t\t\tif _, err := s.store.Info(session.Context(), dg); err == nil {\n\t\t\t\tif err := wr.Close(); err != nil {\n\t\t\t\t\tlog.G(ctx).WithError(err).Error(\"failed to close writer\")\n\t\t\t\t}\n\t\t\t\tif err := s.store.Abort(session.Context(), ref); err != nil {\n\t\t\t\t\tlog.G(ctx).WithError(err).Error(\"failed to abort write\")\n\t\t\t\t}\n\n\t\t\t\treturn status.Errorf(codes.AlreadyExists, \"blob with expected digest %v exists\", req.Expected)\n\t\t\t}\n\t\t}\n\n\t\tif req.Total > 0 {\n\t\t\t// Update the expected total. Typically, this could be seen at\n\t\t\t// negotiation time or on a commit message.\n\t\t\tif total > 0 && req.Total != total {\n\t\t\t\tlog.G(ctx).Debugf(\"commit size differs from writer size: %v != %v\", req.Total, total)\n\t\t\t}\n\t\t\ttotal = req.Total\n\t\t}\n\n\t\tswitch req.Action {\n\t\tcase api.WriteAction_STAT:\n\t\t\tmsg.Digest = wr.Digest().String()\n\t\t\tmsg.StartedAt = protobuf.ToTimestamp(ws.StartedAt)\n\t\t\tmsg.UpdatedAt = protobuf.ToTimestamp(ws.UpdatedAt)\n\t\t\tmsg.Total = total\n\t\tcase api.WriteAction_WRITE, api.WriteAction_COMMIT:\n\t\t\tif req.Offset > 0 {\n\t\t\t\t// validate the offset if provided\n\t\t\t\tif req.Offset != ws.Offset {\n\t\t\t\t\treturn status.Errorf(codes.OutOfRange, \"write @%v must occur at current offset %v\", req.Offset, ws.Offset)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif req.Offset == 0 && ws.Offset > 0 {\n\t\t\t\tif err := wr.Truncate(req.Offset); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"truncate failed: %w\", err)\n\t\t\t\t}\n\t\t\t\tmsg.Offset = req.Offset\n\t\t\t}\n\n\t\t\t// issue the write if we actually have data.\n\t\t\tif len(req.Data) > 0 {\n\t\t\t\t// While this looks like we could use io.WriterAt here, because we\n\t\t\t\t// maintain the offset as append only, we just issue the write.\n\t\t\t\tn, err := wr.Write(req.Data)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errgrpc.ToGRPC(err)\n\t\t\t\t}\n\n\t\t\t\tif n != len(req.Data) {\n\t\t\t\t\t// TODO(stevvooe): Perhaps, we can recover this by including it\n\t\t\t\t\t// in the offset on the write return.\n\t\t\t\t\treturn status.Errorf(codes.DataLoss, \"wrote %v of %v bytes\", n, len(req.Data))\n\t\t\t\t}\n\n\t\t\t\tmsg.Offset += int64(n)\n\t\t\t}\n\n\t\t\tif req.Action == api.WriteAction_COMMIT {\n\t\t\t\tvar opts []content.Opt\n\t\t\t\tif req.Labels != nil {\n\t\t\t\t\topts = append(opts, content.WithLabels(req.Labels))\n\t\t\t\t}\n\t\t\t\tif err := wr.Commit(ctx, total, expected, opts...); err != nil {\n\t\t\t\t\treturn errgrpc.ToGRPC(err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmsg.Digest = wr.Digest().String()\n\t\t}\n\n\t\tif err := session.Send(&msg); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif req.Action == api.WriteAction_COMMIT {\n\t\t\treturn nil\n\t\t}\n\n\t\treq, err = session.Recv()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\t}\n}\n\nfunc (s *service) Abort(ctx context.Context, req *api.AbortRequest) (*ptypes.Empty, error) {\n\tif err := s.store.Abort(ctx, req.Ref); err != nil {\n\t\treturn nil, errgrpc.ToGRPC(err)\n\t}\n\n\treturn empty, nil\n}\n\nfunc infoToGRPC(info content.Info) *api.Info {\n\treturn &api.Info{\n\t\tDigest:    info.Digest.String(),\n\t\tSize:      info.Size,\n\t\tCreatedAt: protobuf.ToTimestamp(info.CreatedAt),\n\t\tUpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),\n\t\tLabels:    info.Labels,\n\t}\n}\n\nfunc infoFromGRPC(info *api.Info) content.Info {\n\treturn content.Info{\n\t\tDigest:    digest.Digest(info.Digest),\n\t\tSize:      info.Size,\n\t\tCreatedAt: protobuf.FromTimestamp(info.CreatedAt),\n\t\tUpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),\n\t\tLabels:    info.Labels,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/containerd/v2/version/version.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage version\n\nimport \"runtime\"\n\nvar (\n\t// Package is filled at linking time\n\tPackage = \"github.com/containerd/containerd/v2\"\n\n\t// Version holds the complete version number. Filled in at linking time.\n\tVersion = \"2.0.3+unknown\"\n\n\t// Revision is filled with the VCS (e.g. git) revision being used to build\n\t// the program at linking time.\n\tRevision = \"\"\n\n\t// GoVersion is Go tree's version.\n\tGoVersion = runtime.Version()\n)\n\n// ConfigVersion is the current highest supported configuration version.\n// This version is used by the main configuration as well as all plugins.\n// Any configuration less than this version which has structural changes\n// should migrate the configuration structures used by this version.\nconst ConfigVersion = 3\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/AUTHORS",
    "content": "Aaron Lehmann <alehmann@netflix.com>\nAkash Gupta <akagup@microsoft.com>\nAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>\nAndrew Pennebaker <apennebaker@datapipe.com>\nBrandon Philips <brandon.philips@coreos.com>\nBrian Goff <cpuguy83@gmail.com>\nChristopher Jones <tophj@linux.vnet.ibm.com>\nDaniel, Dao Quang Minh <dqminh89@gmail.com>\nDarren Stahl <darst@microsoft.com>\nDerek McGowan <derek@mcg.dev>\nEdward Pilatowicz <edward.pilatowicz@oracle.com>\nFu Wei <fuweid89@gmail.com>\nGabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>\nHajime Tazaki <thehajime@gmail.com>\nIan Campbell <ijc@docker.com>\nIvan Markin <sw@nogoegst.net>\nJacob Blain Christen <jacob@rancher.com>\nJustin Cormack <justin.cormack@docker.com>\nJustin Cummins <sul3n3t@gmail.com>\nKasper Fabæch Brandt <poizan@poizan.dk>\nKazuyoshi Kato <katokazu@amazon.com>\nKir Kolyshkin <kolyshkin@gmail.com>\nMichael Crosby <crosbymichael@gmail.com>\nMichael Wan <zirenwan@gmail.com>\nMike Brown <brownwm@us.ibm.com>\nNiels de Vos <ndevos@redhat.com>\nPhil Estes <estesp@gmail.com>\nSam Whited <sam@samwhited.com>\nSamuel Karp <me@samuelkarp.com>\nSebastiaan van Stijn <github@gone.nl>\nShengjing Zhu <zhsj@debian.org>\nStephen J Day <stevvooe@gmail.com>\nTibor Vass <tibor@docker.com>\nTobias Klauser <tklauser@distanz.ch>\nTom Faulhaber <tffaulha@amazon.com>\nTonis Tiigi <tonistiigi@gmail.com>\nTrevor Porter <trkporter@ucdavis.edu>\nWei Fu <fuweid89@gmail.com>\nWilbert van de Ridder <wilbert.ridder@gmail.com>\nXiaodong Ye <xiaodongy@vmware.com>\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/README.md",
    "content": "This package is for internal use only. It is intended to only have\ntemporary changes before they are upstreamed to golang.org/x/sys/\n(a.k.a. https://github.com/golang/sys).\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/nodata_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage sysx\n\nimport (\n\t\"syscall\"\n)\n\nconst ENODATA = syscall.ENODATA\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/nodata_solaris.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage sysx\n\nimport (\n\t\"syscall\"\n)\n\n// This should actually be a set that contains ENOENT and EPERM\nconst ENODATA = syscall.ENOENT\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/nodata_unix.go",
    "content": "//go:build !(linux || solaris || windows)\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage sysx\n\nimport (\n\t\"syscall\"\n)\n\nconst ENODATA = syscall.ENOATTR\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/xattr.go",
    "content": "//go:build linux || darwin\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage sysx\n\nimport (\n\t\"bytes\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// Listxattr calls syscall listxattr and reads all content\n// and returns a string array\nfunc Listxattr(path string) ([]string, error) {\n\treturn listxattrAll(path, unix.Listxattr)\n}\n\n// Removexattr calls syscall removexattr\nfunc Removexattr(path string, attr string) (err error) {\n\treturn unix.Removexattr(path, attr)\n}\n\n// Setxattr calls syscall setxattr\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\treturn unix.Setxattr(path, attr, data, flags)\n}\n\n// Getxattr calls syscall getxattr\nfunc Getxattr(path, attr string) ([]byte, error) {\n\treturn getxattrAll(path, attr, unix.Getxattr)\n}\n\n// LListxattr lists xattrs, not following symlinks\nfunc LListxattr(path string) ([]string, error) {\n\treturn listxattrAll(path, unix.Llistxattr)\n}\n\n// LRemovexattr removes an xattr, not following symlinks\nfunc LRemovexattr(path string, attr string) (err error) {\n\treturn unix.Lremovexattr(path, attr)\n}\n\n// LSetxattr sets an xattr, not following symlinks\nfunc LSetxattr(path string, attr string, data []byte, flags int) (err error) {\n\treturn unix.Lsetxattr(path, attr, data, flags)\n}\n\n// LGetxattr gets an xattr, not following symlinks\nfunc LGetxattr(path, attr string) ([]byte, error) {\n\treturn getxattrAll(path, attr, unix.Lgetxattr)\n}\n\nconst defaultXattrBufferSize = 128\n\ntype listxattrFunc func(path string, dest []byte) (int, error)\n\nfunc listxattrAll(path string, listFunc listxattrFunc) ([]string, error) {\n\tbuf := make([]byte, defaultXattrBufferSize)\n\tn, err := listFunc(path, buf)\n\tfor err == unix.ERANGE {\n\t\t// Buffer too small, use zero-sized buffer to get the actual size\n\t\tn, err = listFunc(path, []byte{})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbuf = make([]byte, n)\n\t\tn, err = listFunc(path, buf)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tps := bytes.Split(bytes.TrimSuffix(buf[:n], []byte{0}), []byte{0})\n\tvar entries []string\n\tfor _, p := range ps {\n\t\tif len(p) > 0 {\n\t\t\tentries = append(entries, string(p))\n\t\t}\n\t}\n\n\treturn entries, nil\n}\n\ntype getxattrFunc func(string, string, []byte) (int, error)\n\nfunc getxattrAll(path, attr string, getFunc getxattrFunc) ([]byte, error) {\n\tbuf := make([]byte, defaultXattrBufferSize)\n\tn, err := getFunc(path, attr, buf)\n\tfor err == unix.ERANGE {\n\t\t// Buffer too small, use zero-sized buffer to get the actual size\n\t\tn, err = getFunc(path, attr, []byte{})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbuf = make([]byte, n)\n\t\tn, err = getFunc(path, attr, buf)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[:n], nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go",
    "content": "//go:build !linux && !darwin\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage sysx\n\nimport (\n\t\"errors\"\n\t\"runtime\"\n)\n\nvar errUnsupported = errors.New(\"extended attributes unsupported on \" + runtime.GOOS)\n\n// Listxattr calls syscall listxattr and reads all content\n// and returns a string array\nfunc Listxattr(path string) ([]string, error) {\n\treturn []string{}, nil\n}\n\n// Removexattr calls syscall removexattr\nfunc Removexattr(path string, attr string) (err error) {\n\treturn errUnsupported\n}\n\n// Setxattr calls syscall setxattr\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\treturn errUnsupported\n}\n\n// Getxattr calls syscall getxattr\nfunc Getxattr(path, attr string) ([]byte, error) {\n\treturn []byte{}, errUnsupported\n}\n\n// LListxattr lists xattrs, not following symlinks\nfunc LListxattr(path string) ([]string, error) {\n\treturn []string{}, nil\n}\n\n// LRemovexattr removes an xattr, not following symlinks\nfunc LRemovexattr(path string, attr string) (err error) {\n\treturn errUnsupported\n}\n\n// LSetxattr sets an xattr, not following symlinks\nfunc LSetxattr(path string, attr string, data []byte, flags int) (err error) {\n\treturn errUnsupported\n}\n\n// LGetxattr gets an xattr, not following symlinks\nfunc LGetxattr(path, attr string) ([]byte, error) {\n\treturn []byte{}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/README.md",
    "content": "# errdefs\n\nA Go package for defining and checking common containerd errors.\n\n## Project details\n\n**errdefs** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository.\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/errors.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package errdefs defines the common errors used throughout containerd\n// packages.\n//\n// Use with fmt.Errorf to add context to an error.\n//\n// To detect an error class, use the IsXXX functions to tell whether an error\n// is of a certain type.\npackage errdefs\n\nimport (\n\t\"context\"\n\t\"errors\"\n)\n\n// Definitions of common error types used throughout containerd. All containerd\n// errors returned by most packages will map into one of these errors classes.\n// Packages should return errors of these types when they want to instruct a\n// client to take a particular action.\n//\n// These errors map closely to grpc errors.\nvar (\n\tErrUnknown            = errUnknown{}\n\tErrInvalidArgument    = errInvalidArgument{}\n\tErrNotFound           = errNotFound{}\n\tErrAlreadyExists      = errAlreadyExists{}\n\tErrPermissionDenied   = errPermissionDenied{}\n\tErrResourceExhausted  = errResourceExhausted{}\n\tErrFailedPrecondition = errFailedPrecondition{}\n\tErrConflict           = errConflict{}\n\tErrNotModified        = errNotModified{}\n\tErrAborted            = errAborted{}\n\tErrOutOfRange         = errOutOfRange{}\n\tErrNotImplemented     = errNotImplemented{}\n\tErrInternal           = errInternal{}\n\tErrUnavailable        = errUnavailable{}\n\tErrDataLoss           = errDataLoss{}\n\tErrUnauthenticated    = errUnauthorized{}\n)\n\n// cancelled maps to Moby's \"ErrCancelled\"\ntype cancelled interface {\n\tCancelled()\n}\n\n// IsCanceled returns true if the error is due to `context.Canceled`.\nfunc IsCanceled(err error) bool {\n\treturn errors.Is(err, context.Canceled) || isInterface[cancelled](err)\n}\n\ntype errUnknown struct{}\n\nfunc (errUnknown) Error() string { return \"unknown\" }\n\nfunc (errUnknown) Unknown() {}\n\nfunc (e errUnknown) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// unknown maps to Moby's \"ErrUnknown\"\ntype unknown interface {\n\tUnknown()\n}\n\n// IsUnknown returns true if the error is due to an unknown error,\n// unhandled condition or unexpected response.\nfunc IsUnknown(err error) bool {\n\treturn errors.Is(err, errUnknown{}) || isInterface[unknown](err)\n}\n\ntype errInvalidArgument struct{}\n\nfunc (errInvalidArgument) Error() string { return \"invalid argument\" }\n\nfunc (errInvalidArgument) InvalidParameter() {}\n\nfunc (e errInvalidArgument) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// invalidParameter maps to Moby's \"ErrInvalidParameter\"\ntype invalidParameter interface {\n\tInvalidParameter()\n}\n\n// IsInvalidArgument returns true if the error is due to an invalid argument\nfunc IsInvalidArgument(err error) bool {\n\treturn errors.Is(err, ErrInvalidArgument) || isInterface[invalidParameter](err)\n}\n\n// deadlineExceed maps to Moby's \"ErrDeadline\"\ntype deadlineExceeded interface {\n\tDeadlineExceeded()\n}\n\n// IsDeadlineExceeded returns true if the error is due to\n// `context.DeadlineExceeded`.\nfunc IsDeadlineExceeded(err error) bool {\n\treturn errors.Is(err, context.DeadlineExceeded) || isInterface[deadlineExceeded](err)\n}\n\ntype errNotFound struct{}\n\nfunc (errNotFound) Error() string { return \"not found\" }\n\nfunc (errNotFound) NotFound() {}\n\nfunc (e errNotFound) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// notFound maps to Moby's \"ErrNotFound\"\ntype notFound interface {\n\tNotFound()\n}\n\n// IsNotFound returns true if the error is due to a missing object\nfunc IsNotFound(err error) bool {\n\treturn errors.Is(err, ErrNotFound) || isInterface[notFound](err)\n}\n\ntype errAlreadyExists struct{}\n\nfunc (errAlreadyExists) Error() string { return \"already exists\" }\n\nfunc (errAlreadyExists) AlreadyExists() {}\n\nfunc (e errAlreadyExists) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\ntype alreadyExists interface {\n\tAlreadyExists()\n}\n\n// IsAlreadyExists returns true if the error is due to an already existing\n// metadata item\nfunc IsAlreadyExists(err error) bool {\n\treturn errors.Is(err, ErrAlreadyExists) || isInterface[alreadyExists](err)\n}\n\ntype errPermissionDenied struct{}\n\nfunc (errPermissionDenied) Error() string { return \"permission denied\" }\n\nfunc (errPermissionDenied) Forbidden() {}\n\nfunc (e errPermissionDenied) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// forbidden maps to Moby's \"ErrForbidden\"\ntype forbidden interface {\n\tForbidden()\n}\n\n// IsPermissionDenied returns true if the error is due to permission denied\n// or forbidden (403) response\nfunc IsPermissionDenied(err error) bool {\n\treturn errors.Is(err, ErrPermissionDenied) || isInterface[forbidden](err)\n}\n\ntype errResourceExhausted struct{}\n\nfunc (errResourceExhausted) Error() string { return \"resource exhausted\" }\n\nfunc (errResourceExhausted) ResourceExhausted() {}\n\nfunc (e errResourceExhausted) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\ntype resourceExhausted interface {\n\tResourceExhausted()\n}\n\n// IsResourceExhausted returns true if the error is due to\n// a lack of resources or too many attempts.\nfunc IsResourceExhausted(err error) bool {\n\treturn errors.Is(err, errResourceExhausted{}) || isInterface[resourceExhausted](err)\n}\n\ntype errFailedPrecondition struct{}\n\nfunc (e errFailedPrecondition) Error() string { return \"failed precondition\" }\n\nfunc (errFailedPrecondition) FailedPrecondition() {}\n\nfunc (e errFailedPrecondition) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\ntype failedPrecondition interface {\n\tFailedPrecondition()\n}\n\n// IsFailedPrecondition returns true if an operation could not proceed due to\n// the lack of a particular condition\nfunc IsFailedPrecondition(err error) bool {\n\treturn errors.Is(err, errFailedPrecondition{}) || isInterface[failedPrecondition](err)\n}\n\ntype errConflict struct{}\n\nfunc (errConflict) Error() string { return \"conflict\" }\n\nfunc (errConflict) Conflict() {}\n\nfunc (e errConflict) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// conflict maps to Moby's \"ErrConflict\"\ntype conflict interface {\n\tConflict()\n}\n\n// IsConflict returns true if an operation could not proceed due to\n// a conflict.\nfunc IsConflict(err error) bool {\n\treturn errors.Is(err, errConflict{}) || isInterface[conflict](err)\n}\n\ntype errNotModified struct{}\n\nfunc (errNotModified) Error() string { return \"not modified\" }\n\nfunc (errNotModified) NotModified() {}\n\nfunc (e errNotModified) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// notModified maps to Moby's \"ErrNotModified\"\ntype notModified interface {\n\tNotModified()\n}\n\n// IsNotModified returns true if an operation could not proceed due\n// to an object not modified from a previous state.\nfunc IsNotModified(err error) bool {\n\treturn errors.Is(err, errNotModified{}) || isInterface[notModified](err)\n}\n\ntype errAborted struct{}\n\nfunc (errAborted) Error() string { return \"aborted\" }\n\nfunc (errAborted) Aborted() {}\n\nfunc (e errAborted) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\ntype aborted interface {\n\tAborted()\n}\n\n// IsAborted returns true if an operation was aborted.\nfunc IsAborted(err error) bool {\n\treturn errors.Is(err, errAborted{}) || isInterface[aborted](err)\n}\n\ntype errOutOfRange struct{}\n\nfunc (errOutOfRange) Error() string { return \"out of range\" }\n\nfunc (errOutOfRange) OutOfRange() {}\n\nfunc (e errOutOfRange) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\ntype outOfRange interface {\n\tOutOfRange()\n}\n\n// IsOutOfRange returns true if an operation could not proceed due\n// to data being out of the expected range.\nfunc IsOutOfRange(err error) bool {\n\treturn errors.Is(err, errOutOfRange{}) || isInterface[outOfRange](err)\n}\n\ntype errNotImplemented struct{}\n\nfunc (errNotImplemented) Error() string { return \"not implemented\" }\n\nfunc (errNotImplemented) NotImplemented() {}\n\nfunc (e errNotImplemented) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// notImplemented maps to Moby's \"ErrNotImplemented\"\ntype notImplemented interface {\n\tNotImplemented()\n}\n\n// IsNotImplemented returns true if the error is due to not being implemented\nfunc IsNotImplemented(err error) bool {\n\treturn errors.Is(err, errNotImplemented{}) || isInterface[notImplemented](err)\n}\n\ntype errInternal struct{}\n\nfunc (errInternal) Error() string { return \"internal\" }\n\nfunc (errInternal) System() {}\n\nfunc (e errInternal) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// system maps to Moby's \"ErrSystem\"\ntype system interface {\n\tSystem()\n}\n\n// IsInternal returns true if the error returns to an internal or system error\nfunc IsInternal(err error) bool {\n\treturn errors.Is(err, errInternal{}) || isInterface[system](err)\n}\n\ntype errUnavailable struct{}\n\nfunc (errUnavailable) Error() string { return \"unavailable\" }\n\nfunc (errUnavailable) Unavailable() {}\n\nfunc (e errUnavailable) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// unavailable maps to Moby's \"ErrUnavailable\"\ntype unavailable interface {\n\tUnavailable()\n}\n\n// IsUnavailable returns true if the error is due to a resource being unavailable\nfunc IsUnavailable(err error) bool {\n\treturn errors.Is(err, errUnavailable{}) || isInterface[unavailable](err)\n}\n\ntype errDataLoss struct{}\n\nfunc (errDataLoss) Error() string { return \"data loss\" }\n\nfunc (errDataLoss) DataLoss() {}\n\nfunc (e errDataLoss) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// dataLoss maps to Moby's \"ErrDataLoss\"\ntype dataLoss interface {\n\tDataLoss()\n}\n\n// IsDataLoss returns true if data during an operation was lost or corrupted\nfunc IsDataLoss(err error) bool {\n\treturn errors.Is(err, errDataLoss{}) || isInterface[dataLoss](err)\n}\n\ntype errUnauthorized struct{}\n\nfunc (errUnauthorized) Error() string { return \"unauthorized\" }\n\nfunc (errUnauthorized) Unauthorized() {}\n\nfunc (e errUnauthorized) WithMessage(msg string) error {\n\treturn customMessage{e, msg}\n}\n\n// unauthorized maps to Moby's \"ErrUnauthorized\"\ntype unauthorized interface {\n\tUnauthorized()\n}\n\n// IsUnauthorized returns true if the error indicates that the user was\n// unauthenticated or unauthorized.\nfunc IsUnauthorized(err error) bool {\n\treturn errors.Is(err, errUnauthorized{}) || isInterface[unauthorized](err)\n}\n\nfunc isInterface[T any](err error) bool {\n\tfor {\n\t\tswitch x := err.(type) {\n\t\tcase T:\n\t\t\treturn true\n\t\tcase customMessage:\n\t\t\terr = x.err\n\t\tcase interface{ Unwrap() error }:\n\t\t\terr = x.Unwrap()\n\t\t\tif err == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\tcase interface{ Unwrap() []error }:\n\t\t\tfor _, err := range x.Unwrap() {\n\t\t\t\tif isInterface[T](err) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n}\n\n// customMessage is used to provide a defined error with a custom message.\n// The message is not wrapped but can be compared by the `Is(error) bool` interface.\ntype customMessage struct {\n\terr error\n\tmsg string\n}\n\nfunc (c customMessage) Is(err error) bool {\n\treturn c.err == err\n}\n\nfunc (c customMessage) As(target any) bool {\n\treturn errors.As(c.err, target)\n}\n\nfunc (c customMessage) Error() string {\n\treturn c.msg\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/pkg/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/pkg/errgrpc/grpc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package errgrpc provides utility functions for translating errors to\n// and from a gRPC context.\n//\n// The functions ToGRPC and ToNative can be used to map server-side and\n// client-side errors to the correct types.\npackage errgrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\n\tspb \"google.golang.org/genproto/googleapis/rpc/status\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/protoadapt\"\n\t\"google.golang.org/protobuf/types/known/anypb\"\n\n\t\"github.com/containerd/typeurl/v2\"\n\n\t\"github.com/containerd/errdefs\"\n\t\"github.com/containerd/errdefs/pkg/internal/cause\"\n\t\"github.com/containerd/errdefs/pkg/internal/types\"\n)\n\n// ToGRPC will attempt to map the error into a grpc error, from the error types\n// defined in the the errdefs package and attempign to preserve the original\n// description. Any type which does not resolve to a defined error type will\n// be assigned the unknown error code.\n//\n// Further information may be extracted from certain errors depending on their\n// type. The grpc error details will be used to attempt to preserve as much of\n// the error structures and types as possible.\n//\n// Errors which can be marshaled using protobuf or typeurl will be considered\n// for including as GRPC error details.\n// Additionally, use the following interfaces in errors to preserve custom types:\n//\n//\tWrapError(error) error     - Used to wrap the previous error\n//\tJoinErrors(...error) error - Used to join all previous errors\n//\tCollapseError()            - Used for errors which carry information but\n//\t                             should not have their error message shown.\nfunc ToGRPC(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tif _, ok := status.FromError(err); ok {\n\t\t// error has already been mapped to grpc\n\t\treturn err\n\t}\n\tst := statusFromError(err)\n\tif st != nil {\n\t\tif details := errorDetails(err, false); len(details) > 0 {\n\t\t\tif ds, _ := st.WithDetails(details...); ds != nil {\n\t\t\t\tst = ds\n\t\t\t}\n\t\t}\n\t\terr = st.Err()\n\t}\n\treturn err\n}\n\nfunc statusFromError(err error) *status.Status {\n\tswitch errdefs.Resolve(err) {\n\tcase errdefs.ErrInvalidArgument:\n\t\treturn status.New(codes.InvalidArgument, err.Error())\n\tcase errdefs.ErrNotFound:\n\t\treturn status.New(codes.NotFound, err.Error())\n\tcase errdefs.ErrAlreadyExists:\n\t\treturn status.New(codes.AlreadyExists, err.Error())\n\tcase errdefs.ErrPermissionDenied:\n\t\treturn status.New(codes.PermissionDenied, err.Error())\n\tcase errdefs.ErrResourceExhausted:\n\t\treturn status.New(codes.ResourceExhausted, err.Error())\n\tcase errdefs.ErrFailedPrecondition, errdefs.ErrConflict, errdefs.ErrNotModified:\n\t\treturn status.New(codes.FailedPrecondition, err.Error())\n\tcase errdefs.ErrAborted:\n\t\treturn status.New(codes.Aborted, err.Error())\n\tcase errdefs.ErrOutOfRange:\n\t\treturn status.New(codes.OutOfRange, err.Error())\n\tcase errdefs.ErrNotImplemented:\n\t\treturn status.New(codes.Unimplemented, err.Error())\n\tcase errdefs.ErrInternal:\n\t\treturn status.New(codes.Internal, err.Error())\n\tcase errdefs.ErrUnavailable:\n\t\treturn status.New(codes.Unavailable, err.Error())\n\tcase errdefs.ErrDataLoss:\n\t\treturn status.New(codes.DataLoss, err.Error())\n\tcase errdefs.ErrUnauthenticated:\n\t\treturn status.New(codes.Unauthenticated, err.Error())\n\tcase context.DeadlineExceeded:\n\t\treturn status.New(codes.DeadlineExceeded, err.Error())\n\tcase context.Canceled:\n\t\treturn status.New(codes.Canceled, err.Error())\n\tcase errdefs.ErrUnknown:\n\t\treturn status.New(codes.Unknown, err.Error())\n\t}\n\treturn nil\n}\n\n// errorDetails returns an array of errors which make up the provided error.\n// If firstIncluded is true, then all encodable errors will be used, otherwise\n// the first error in an error list will be not be used, to account for the\n// the base status error which details are added to via wrap or join.\n//\n// The errors are ordered in way that they can be applied in order by either\n// wrapping or joining the errors to recreate an error with the same structure\n// when `WrapError` and `JoinErrors` interfaces are used.\n//\n// The intent is that when re-applying the errors to create a single error, the\n// results of calls to `Error()`, `errors.Is`, `errors.As`, and \"%+v\" formatting\n// is the same as the original error.\nfunc errorDetails(err error, firstIncluded bool) []protoadapt.MessageV1 {\n\tswitch uerr := err.(type) {\n\tcase interface{ Unwrap() error }:\n\t\tdetails := errorDetails(uerr.Unwrap(), firstIncluded)\n\n\t\t// If the type is able to wrap, then include if proto\n\t\tif _, ok := err.(interface{ WrapError(error) error }); ok {\n\t\t\t// Get proto message\n\t\t\tif protoErr := toProtoMessage(err); protoErr != nil {\n\t\t\t\tdetails = append(details, protoErr)\n\t\t\t}\n\t\t}\n\n\t\treturn details\n\tcase interface{ Unwrap() []error }:\n\t\tvar details []protoadapt.MessageV1\n\t\tfor i, e := range uerr.Unwrap() {\n\t\t\tdetails = append(details, errorDetails(e, firstIncluded || i > 0)...)\n\t\t}\n\n\t\tif _, ok := err.(interface{ JoinErrors(...error) error }); ok {\n\t\t\t// Get proto message\n\t\t\tif protoErr := toProtoMessage(err); protoErr != nil {\n\t\t\t\tdetails = append(details, protoErr)\n\t\t\t}\n\t\t}\n\t\treturn details\n\t}\n\n\tif firstIncluded {\n\t\tif protoErr := toProtoMessage(err); protoErr != nil {\n\t\t\treturn []protoadapt.MessageV1{protoErr}\n\t\t}\n\t\tif gs, ok := status.FromError(ToGRPC(err)); ok {\n\t\t\treturn []protoadapt.MessageV1{gs.Proto()}\n\t\t}\n\t\t// TODO: Else include unknown extra error type?\n\t}\n\n\treturn nil\n}\n\nfunc toProtoMessage(err error) protoadapt.MessageV1 {\n\t// Do not double encode proto messages, otherwise use Any\n\tif pm, ok := err.(protoadapt.MessageV1); ok {\n\t\treturn pm\n\t}\n\tif pm, ok := err.(proto.Message); ok {\n\t\treturn protoadapt.MessageV1Of(pm)\n\t}\n\n\tif reflect.TypeOf(err).Kind() == reflect.Ptr {\n\t\ta, aerr := typeurl.MarshalAny(err)\n\t\tif aerr == nil {\n\t\t\treturn &anypb.Any{\n\t\t\t\tTypeUrl: a.GetTypeUrl(),\n\t\t\t\tValue:   a.GetValue(),\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// ToGRPCf maps the error to grpc error codes, assembling the formatting string\n// and combining it with the target error string.\n//\n// This is equivalent to grpc.ToGRPC(fmt.Errorf(\"%s: %w\", fmt.Sprintf(format, args...), err))\nfunc ToGRPCf(err error, format string, args ...interface{}) error {\n\treturn ToGRPC(fmt.Errorf(\"%s: %w\", fmt.Sprintf(format, args...), err))\n}\n\n// ToNative returns the underlying error from a grpc service based on the grpc\n// error code. The grpc details are used to add wrap the error in more context\n// or support multiple errors.\nfunc ToNative(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\ts, isGRPC := status.FromError(err)\n\n\tvar (\n\t\tdesc string\n\t\tcode codes.Code\n\t)\n\n\tif isGRPC {\n\t\tdesc = s.Message()\n\t\tcode = s.Code()\n\t} else {\n\t\tdesc = err.Error()\n\t\tcode = codes.Unknown\n\t}\n\n\tvar cls error // divide these into error classes, becomes the cause\n\n\tswitch code {\n\tcase codes.InvalidArgument:\n\t\tcls = errdefs.ErrInvalidArgument\n\tcase codes.AlreadyExists:\n\t\tcls = errdefs.ErrAlreadyExists\n\tcase codes.NotFound:\n\t\tcls = errdefs.ErrNotFound\n\tcase codes.Unavailable:\n\t\tcls = errdefs.ErrUnavailable\n\tcase codes.FailedPrecondition:\n\t\t// TODO: Has suffix is not sufficient for conflict and not modified\n\t\t// Message should start with \": \" or be at beginning of a line\n\t\t// Message should end with \": \" or be at the end of a line\n\t\t// Compile a regex\n\t\tif desc == errdefs.ErrConflict.Error() || strings.HasSuffix(desc, \": \"+errdefs.ErrConflict.Error()) {\n\t\t\tcls = errdefs.ErrConflict\n\t\t} else if desc == errdefs.ErrNotModified.Error() || strings.HasSuffix(desc, \": \"+errdefs.ErrNotModified.Error()) {\n\t\t\tcls = errdefs.ErrNotModified\n\t\t} else {\n\t\t\tcls = errdefs.ErrFailedPrecondition\n\t\t}\n\tcase codes.Unimplemented:\n\t\tcls = errdefs.ErrNotImplemented\n\tcase codes.Canceled:\n\t\tcls = context.Canceled\n\tcase codes.DeadlineExceeded:\n\t\tcls = context.DeadlineExceeded\n\tcase codes.Aborted:\n\t\tcls = errdefs.ErrAborted\n\tcase codes.Unauthenticated:\n\t\tcls = errdefs.ErrUnauthenticated\n\tcase codes.PermissionDenied:\n\t\tcls = errdefs.ErrPermissionDenied\n\tcase codes.Internal:\n\t\tcls = errdefs.ErrInternal\n\tcase codes.DataLoss:\n\t\tcls = errdefs.ErrDataLoss\n\tcase codes.OutOfRange:\n\t\tcls = errdefs.ErrOutOfRange\n\tcase codes.ResourceExhausted:\n\t\tcls = errdefs.ErrResourceExhausted\n\tdefault:\n\t\tif idx := strings.LastIndex(desc, cause.UnexpectedStatusPrefix); idx > 0 {\n\t\t\tif status, uerr := strconv.Atoi(desc[idx+len(cause.UnexpectedStatusPrefix):]); uerr == nil && status >= 200 && status < 600 {\n\t\t\t\tcls = cause.ErrUnexpectedStatus{Status: status}\n\t\t\t}\n\t\t}\n\t\tif cls == nil {\n\t\t\tcls = errdefs.ErrUnknown\n\t\t}\n\t}\n\n\tmsg := rebaseMessage(cls, desc)\n\tif msg == \"\" {\n\t\terr = cls\n\t} else if msg != desc {\n\t\terr = fmt.Errorf(\"%s: %w\", msg, cls)\n\t} else if wm, ok := cls.(interface{ WithMessage(string) error }); ok {\n\t\terr = wm.WithMessage(msg)\n\t} else {\n\t\terr = fmt.Errorf(\"%s: %w\", msg, cls)\n\t}\n\n\tif isGRPC {\n\t\terrs := []error{err}\n\t\tfor _, a := range s.Details() {\n\t\t\tvar derr error\n\n\t\t\t// First decode error if needed\n\t\t\tif s, ok := a.(*spb.Status); ok {\n\t\t\t\tderr = ToNative(status.ErrorProto(s))\n\t\t\t} else if e, ok := a.(error); ok {\n\t\t\t\tderr = e\n\t\t\t} else if dany, ok := a.(typeurl.Any); ok {\n\t\t\t\ti, uerr := typeurl.UnmarshalAny(dany)\n\t\t\t\tif uerr == nil {\n\t\t\t\t\tif e, ok = i.(error); ok {\n\t\t\t\t\t\tderr = e\n\t\t\t\t\t} else {\n\t\t\t\t\t\tderr = fmt.Errorf(\"non-error unmarshalled detail: %v\", i)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tderr = fmt.Errorf(\"error of type %q with failure to unmarshal: %v\", dany.GetTypeUrl(), uerr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tderr = fmt.Errorf(\"non-error detail: %v\", a)\n\t\t\t}\n\n\t\t\tswitch werr := derr.(type) {\n\t\t\tcase interface{ WrapError(error) error }:\n\t\t\t\terrs[len(errs)-1] = werr.WrapError(errs[len(errs)-1])\n\t\t\tcase interface{ JoinErrors(...error) error }:\n\t\t\t\t// TODO: Consider whether this should support joining a subset\n\t\t\t\terrs[0] = werr.JoinErrors(errs...)\n\t\t\tcase interface{ CollapseError() }:\n\t\t\t\terrs[len(errs)-1] = types.CollapsedError(errs[len(errs)-1], derr)\n\t\t\tdefault:\n\t\t\t\terrs = append(errs, derr)\n\t\t\t}\n\n\t\t}\n\t\tif len(errs) > 1 {\n\t\t\terr = errors.Join(errs...)\n\t\t} else {\n\t\t\terr = errs[0]\n\t\t}\n\t}\n\n\treturn err\n}\n\n// rebaseMessage removes the repeats for an error at the end of an error\n// string. This will happen when taking an error over grpc then remapping it.\n//\n// Effectively, we just remove the string of cls from the end of err if it\n// appears there.\nfunc rebaseMessage(cls error, desc string) string {\n\tclss := cls.Error()\n\tif desc == clss {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimSuffix(desc, \": \"+clss)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package cause is used to define root causes for errors\n// common to errors packages like grpc and http.\npackage cause\n\nimport \"fmt\"\n\ntype ErrUnexpectedStatus struct {\n\tStatus int\n}\n\nconst UnexpectedStatusPrefix = \"unexpected status \"\n\nfunc (e ErrUnexpectedStatus) Error() string {\n\treturn fmt.Sprintf(\"%s%d\", UnexpectedStatusPrefix, e.Status)\n}\n\nfunc (ErrUnexpectedStatus) Unknown() {}\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/pkg/internal/types/collapsible.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage types\n\nimport \"fmt\"\n\n// CollapsibleError indicates the error should be collapsed\ntype CollapsibleError interface {\n\tCollapseError()\n}\n\n// CollapsedError returns a new error with the collapsed\n// error returned on unwrapped or when formatted with \"%+v\"\nfunc CollapsedError(err error, collapsed ...error) error {\n\treturn collapsedError{err, collapsed}\n}\n\ntype collapsedError struct {\n\terror\n\tcollapsed []error\n}\n\nfunc (c collapsedError) Unwrap() []error {\n\treturn append([]error{c.error}, c.collapsed...)\n}\n\nfunc (c collapsedError) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tfmt.Fprintf(s, \"%+v\", c.error)\n\t\t\tfor _, err := range c.collapsed {\n\t\t\t\tfmt.Fprintf(s, \"\\n%+v\", err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's':\n\t\tfmt.Fprint(s, c.Error())\n\tcase 'q':\n\t\tfmt.Fprintf(s, \"%q\", c.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/errdefs/resolve.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage errdefs\n\nimport \"context\"\n\n// Resolve returns the first error found in the error chain which matches an\n// error defined in this package or context error. A raw, unwrapped error is\n// returned or ErrUnknown if no matching error is found.\n//\n// This is useful for determining a response code based on the outermost wrapped\n// error rather than the original cause. For example, a not found error deep\n// in the code may be wrapped as an invalid argument. When determining status\n// code from Is* functions, the depth or ordering of the error is not\n// considered.\n//\n// The search order is depth first, a wrapped error returned from any part of\n// the chain from `Unwrap() error` will be returned before any joined errors\n// as returned by `Unwrap() []error`.\nfunc Resolve(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\terr = firstError(err)\n\tif err == nil {\n\t\terr = ErrUnknown\n\t}\n\treturn err\n}\n\nfunc firstError(err error) error {\n\tfor {\n\t\tswitch err {\n\t\tcase ErrUnknown,\n\t\t\tErrInvalidArgument,\n\t\t\tErrNotFound,\n\t\t\tErrAlreadyExists,\n\t\t\tErrPermissionDenied,\n\t\t\tErrResourceExhausted,\n\t\t\tErrFailedPrecondition,\n\t\t\tErrConflict,\n\t\t\tErrNotModified,\n\t\t\tErrAborted,\n\t\t\tErrOutOfRange,\n\t\t\tErrNotImplemented,\n\t\t\tErrInternal,\n\t\t\tErrUnavailable,\n\t\t\tErrDataLoss,\n\t\t\tErrUnauthenticated,\n\t\t\tcontext.DeadlineExceeded,\n\t\t\tcontext.Canceled:\n\t\t\treturn err\n\t\t}\n\t\tswitch e := err.(type) {\n\t\tcase customMessage:\n\t\t\terr = e.err\n\t\tcase unknown:\n\t\t\treturn ErrUnknown\n\t\tcase invalidParameter:\n\t\t\treturn ErrInvalidArgument\n\t\tcase notFound:\n\t\t\treturn ErrNotFound\n\t\tcase alreadyExists:\n\t\t\treturn ErrAlreadyExists\n\t\tcase forbidden:\n\t\t\treturn ErrPermissionDenied\n\t\tcase resourceExhausted:\n\t\t\treturn ErrResourceExhausted\n\t\tcase failedPrecondition:\n\t\t\treturn ErrFailedPrecondition\n\t\tcase conflict:\n\t\t\treturn ErrConflict\n\t\tcase notModified:\n\t\t\treturn ErrNotModified\n\t\tcase aborted:\n\t\t\treturn ErrAborted\n\t\tcase errOutOfRange:\n\t\t\treturn ErrOutOfRange\n\t\tcase notImplemented:\n\t\t\treturn ErrNotImplemented\n\t\tcase system:\n\t\t\treturn ErrInternal\n\t\tcase unavailable:\n\t\t\treturn ErrUnavailable\n\t\tcase dataLoss:\n\t\t\treturn ErrDataLoss\n\t\tcase unauthorized:\n\t\t\treturn ErrUnauthenticated\n\t\tcase deadlineExceeded:\n\t\t\treturn context.DeadlineExceeded\n\t\tcase cancelled:\n\t\t\treturn context.Canceled\n\t\tcase interface{ Unwrap() error }:\n\t\t\terr = e.Unwrap()\n\t\t\tif err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase interface{ Unwrap() []error }:\n\t\t\tfor _, ue := range e.Unwrap() {\n\t\t\t\tif fe := firstError(ue); fe != nil {\n\t\t\t\t\treturn fe\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\tcase interface{ Is(error) bool }:\n\t\t\tfor _, target := range []error{ErrUnknown,\n\t\t\t\tErrInvalidArgument,\n\t\t\t\tErrNotFound,\n\t\t\t\tErrAlreadyExists,\n\t\t\t\tErrPermissionDenied,\n\t\t\t\tErrResourceExhausted,\n\t\t\t\tErrFailedPrecondition,\n\t\t\t\tErrConflict,\n\t\t\t\tErrNotModified,\n\t\t\t\tErrAborted,\n\t\t\t\tErrOutOfRange,\n\t\t\t\tErrNotImplemented,\n\t\t\t\tErrInternal,\n\t\t\t\tErrUnavailable,\n\t\t\t\tErrDataLoss,\n\t\t\t\tErrUnauthenticated,\n\t\t\t\tcontext.DeadlineExceeded,\n\t\t\t\tcontext.Canceled} {\n\t\t\t\tif e.Is(target) {\n\t\t\t\t\treturn target\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/log/.golangci.yml",
    "content": "linters:\n  enable:\n    - exportloopref # Checks for pointers to enclosing loop variables\n    - gofmt\n    - goimports\n    - gosec\n    - ineffassign\n    - misspell\n    - nolintlint\n    - revive\n    - staticcheck\n    - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17\n    - unconvert\n    - unused\n    - vet\n    - dupword # Checks for duplicate words in the source code\n  disable:\n    - errcheck\n\nrun:\n  timeout: 5m\n  skip-dirs:\n    - api\n    - cluster\n    - design\n    - docs\n    - docs/man\n    - releases\n    - reports\n    - test # e2e scripts\n"
  },
  {
    "path": "vendor/github.com/containerd/log/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/log/README.md",
    "content": "# log\n\nA Go package providing a common logging interface across containerd repositories and a way for clients to use and configure logging in containerd packages.\n\nThis package is not intended to be used as a standalone logging package outside of the containerd ecosystem and is intended as an interface wrapper around a logging implementation.\nIn the future this package may be replaced with a common go logging interface.\n\n## Project details\n\n**log** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository.\n\n"
  },
  {
    "path": "vendor/github.com/containerd/log/context.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package log provides types and functions related to logging, passing\n// loggers through a context, and attaching context to the logger.\n//\n// # Transitional types\n//\n// This package contains various types that are aliases for types in [logrus].\n// These aliases are intended for transitioning away from hard-coding logrus\n// as logging implementation. Consumers of this package are encouraged to use\n// the type-aliases from this package instead of directly using their logrus\n// equivalent.\n//\n// The intent is to replace these aliases with locally defined types and\n// interfaces once all consumers are no longer directly importing logrus\n// types.\n//\n// IMPORTANT: due to the transitional purpose of this package, it is not\n// guaranteed for the full logrus API to be provided in the future. As\n// outlined, these aliases are provided as a step to transition away from\n// a specific implementation which, as a result, exposes the full logrus API.\n// While no decisions have been made on the ultimate design and interface\n// provided by this package, we do not expect carrying \"less common\" features.\npackage log\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\n// G is a shorthand for [GetLogger].\n//\n// We may want to define this locally to a package to get package tagged log\n// messages.\nvar G = GetLogger\n\n// L is an alias for the standard logger.\nvar L = &Entry{\n\tLogger: logrus.StandardLogger(),\n\t// Default is three fields plus a little extra room.\n\tData: make(Fields, 6),\n}\n\ntype loggerKey struct{}\n\n// Fields type to pass to \"WithFields\".\ntype Fields = map[string]any\n\n// Entry is a logging entry. It contains all the fields passed with\n// [Entry.WithFields]. It's finally logged when Trace, Debug, Info, Warn,\n// Error, Fatal or Panic is called on it. These objects can be reused and\n// passed around as much as you wish to avoid field duplication.\n//\n// Entry is a transitional type, and currently an alias for [logrus.Entry].\ntype Entry = logrus.Entry\n\n// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using\n// zeros to ensure the formatted time is always the same number of\n// characters.\nconst RFC3339NanoFixed = \"2006-01-02T15:04:05.000000000Z07:00\"\n\n// Level is a logging level.\ntype Level = logrus.Level\n\n// Supported log levels.\nconst (\n\t// TraceLevel level. Designates finer-grained informational events\n\t// than [DebugLevel].\n\tTraceLevel Level = logrus.TraceLevel\n\n\t// DebugLevel level. Usually only enabled when debugging. Very verbose\n\t// logging.\n\tDebugLevel Level = logrus.DebugLevel\n\n\t// InfoLevel level. General operational entries about what's going on\n\t// inside the application.\n\tInfoLevel Level = logrus.InfoLevel\n\n\t// WarnLevel level. Non-critical entries that deserve eyes.\n\tWarnLevel Level = logrus.WarnLevel\n\n\t// ErrorLevel level. Logs errors that should definitely be noted.\n\t// Commonly used for hooks to send errors to an error tracking service.\n\tErrorLevel Level = logrus.ErrorLevel\n\n\t// FatalLevel level. Logs and then calls \"logger.Exit(1)\". It exits\n\t// even if the logging level is set to Panic.\n\tFatalLevel Level = logrus.FatalLevel\n\n\t// PanicLevel level. This is the highest level of severity. Logs and\n\t// then calls panic with the message passed to Debug, Info, ...\n\tPanicLevel Level = logrus.PanicLevel\n)\n\n// SetLevel sets log level globally. It returns an error if the given\n// level is not supported.\n//\n// level can be one of:\n//\n//   - \"trace\" ([TraceLevel])\n//   - \"debug\" ([DebugLevel])\n//   - \"info\" ([InfoLevel])\n//   - \"warn\" ([WarnLevel])\n//   - \"error\" ([ErrorLevel])\n//   - \"fatal\" ([FatalLevel])\n//   - \"panic\" ([PanicLevel])\nfunc SetLevel(level string) error {\n\tlvl, err := logrus.ParseLevel(level)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tL.Logger.SetLevel(lvl)\n\treturn nil\n}\n\n// GetLevel returns the current log level.\nfunc GetLevel() Level {\n\treturn L.Logger.GetLevel()\n}\n\n// OutputFormat specifies a log output format.\ntype OutputFormat string\n\n// Supported log output formats.\nconst (\n\t// TextFormat represents the text logging format.\n\tTextFormat OutputFormat = \"text\"\n\n\t// JSONFormat represents the JSON logging format.\n\tJSONFormat OutputFormat = \"json\"\n)\n\n// SetFormat sets the log output format ([TextFormat] or [JSONFormat]).\nfunc SetFormat(format OutputFormat) error {\n\tswitch format {\n\tcase TextFormat:\n\t\tL.Logger.SetFormatter(&logrus.TextFormatter{\n\t\t\tTimestampFormat: RFC3339NanoFixed,\n\t\t\tFullTimestamp:   true,\n\t\t})\n\t\treturn nil\n\tcase JSONFormat:\n\t\tL.Logger.SetFormatter(&logrus.JSONFormatter{\n\t\t\tTimestampFormat: RFC3339NanoFixed,\n\t\t})\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown log format: %s\", format)\n\t}\n}\n\n// WithLogger returns a new context with the provided logger. Use in\n// combination with logger.WithField(s) for great effect.\nfunc WithLogger(ctx context.Context, logger *Entry) context.Context {\n\treturn context.WithValue(ctx, loggerKey{}, logger.WithContext(ctx))\n}\n\n// GetLogger retrieves the current logger from the context. If no logger is\n// available, the default logger is returned.\nfunc GetLogger(ctx context.Context) *Entry {\n\tif logger := ctx.Value(loggerKey{}); logger != nil {\n\t\treturn logger.(*Entry)\n\t}\n\treturn L.WithContext(ctx)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/.gitattributes",
    "content": "*.go text eol=lf"
  },
  {
    "path": "vendor/github.com/containerd/platforms/.golangci.yml",
    "content": "linters:\n  enable:\n    - copyloopvar\n    - gofmt\n    - goimports\n    - gosec\n    - ineffassign\n    - misspell\n    - nolintlint\n    - revive\n    - staticcheck\n    - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17\n    - unconvert\n    - unused\n    - govet\n    - dupword # Checks for duplicate words in the source code\n  disable:\n    - errcheck\n\nrun:\n  timeout: 5m\n\nissues:\n  exclude-dirs:\n    - api\n    - cluster\n    - design\n    - docs\n    - docs/man\n    - releases\n    - reports\n    - test # e2e scripts\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/README.md",
    "content": "# platforms\n\nA Go package for formatting, normalizing and matching container platforms.\n\nThis package is based on the Open Containers Image Spec definition of a [platform](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go#L52).\n\n## Platform Specifier\n\nWhile the OCI platform specifications provide a tool for components to\nspecify structured information, user input typically doesn't need the full\ncontext and much can be inferred. To solve this problem, this package introduces\n\"specifiers\". A specifier has the format\n`<os>|<arch>|<os>/<arch>[/<variant>]`.  The user can provide either the\noperating system or the architecture or both.\n\nAn example of a common specifier is `linux/amd64`. If the host has a default\nruntime that matches this, the user can simply provide the component that\nmatters. For example, if an image provides `amd64` and `arm64` support, the\noperating system, `linux` can be inferred, so they only have to provide\n`arm64` or `amd64`. Similar behavior is implemented for operating systems,\nwhere the architecture may be known but a runtime may support images from\ndifferent operating systems.\n\n## Project details\n\n**platforms** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository."
  },
  {
    "path": "vendor/github.com/containerd/platforms/compare.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// MatchComparer is able to match and compare platforms to\n// filter and sort platforms.\ntype MatchComparer interface {\n\tMatcher\n\n\tLess(specs.Platform, specs.Platform) bool\n}\n\ntype platformVersions struct {\n\tmajor []int\n\tminor []int\n}\n\nvar arm64variantToVersion = map[string]platformVersions{\n\t\"v8\":   {[]int{8}, []int{0}},\n\t\"v8.0\": {[]int{8}, []int{0}},\n\t\"v8.1\": {[]int{8}, []int{1}},\n\t\"v8.2\": {[]int{8}, []int{2}},\n\t\"v8.3\": {[]int{8}, []int{3}},\n\t\"v8.4\": {[]int{8}, []int{4}},\n\t\"v8.5\": {[]int{8}, []int{5}},\n\t\"v8.6\": {[]int{8}, []int{6}},\n\t\"v8.7\": {[]int{8}, []int{7}},\n\t\"v8.8\": {[]int{8}, []int{8}},\n\t\"v8.9\": {[]int{8}, []int{9}},\n\t\"v9\":   {[]int{9, 8}, []int{0, 5}},\n\t\"v9.0\": {[]int{9, 8}, []int{0, 5}},\n\t\"v9.1\": {[]int{9, 8}, []int{1, 6}},\n\t\"v9.2\": {[]int{9, 8}, []int{2, 7}},\n\t\"v9.3\": {[]int{9, 8}, []int{3, 8}},\n\t\"v9.4\": {[]int{9, 8}, []int{4, 9}},\n\t\"v9.5\": {[]int{9, 8}, []int{5, 9}},\n\t\"v9.6\": {[]int{9, 8}, []int{6, 9}},\n\t\"v9.7\": {[]int{9, 8}, []int{7, 9}},\n}\n\n// platformVector returns an (ordered) vector of appropriate specs.Platform\n// objects to try matching for the given platform object (see platforms.Only).\nfunc platformVector(platform specs.Platform) []specs.Platform {\n\tvector := []specs.Platform{platform}\n\n\tswitch platform.Architecture {\n\tcase \"amd64\":\n\t\tif amd64Version, err := strconv.Atoi(strings.TrimPrefix(platform.Variant, \"v\")); err == nil && amd64Version > 1 {\n\t\t\tfor amd64Version--; amd64Version >= 1; amd64Version-- {\n\t\t\t\tvector = append(vector, specs.Platform{\n\t\t\t\t\tArchitecture: platform.Architecture,\n\t\t\t\t\tOS:           platform.OS,\n\t\t\t\t\tOSVersion:    platform.OSVersion,\n\t\t\t\t\tOSFeatures:   platform.OSFeatures,\n\t\t\t\t\tVariant:      \"v\" + strconv.Itoa(amd64Version),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tvector = append(vector, specs.Platform{\n\t\t\tArchitecture: \"386\",\n\t\t\tOS:           platform.OS,\n\t\t\tOSVersion:    platform.OSVersion,\n\t\t\tOSFeatures:   platform.OSFeatures,\n\t\t})\n\tcase \"arm\":\n\t\tif armVersion, err := strconv.Atoi(strings.TrimPrefix(platform.Variant, \"v\")); err == nil && armVersion > 5 {\n\t\t\tfor armVersion--; armVersion >= 5; armVersion-- {\n\t\t\t\tvector = append(vector, specs.Platform{\n\t\t\t\t\tArchitecture: platform.Architecture,\n\t\t\t\t\tOS:           platform.OS,\n\t\t\t\t\tOSVersion:    platform.OSVersion,\n\t\t\t\t\tOSFeatures:   platform.OSFeatures,\n\t\t\t\t\tVariant:      \"v\" + strconv.Itoa(armVersion),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\tcase \"arm64\":\n\t\tvariant := platform.Variant\n\t\tif variant == \"\" {\n\t\t\tvariant = \"v8\"\n\t\t}\n\n\t\tvector = []specs.Platform{} // Reset vector, the first variant will be added in loop.\n\t\tarm64Versions, ok := arm64variantToVersion[variant]\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tfor i, major := range arm64Versions.major {\n\t\t\tfor minor := arm64Versions.minor[i]; minor >= 0; minor-- {\n\t\t\t\tarm64Variant := \"v\" + strconv.Itoa(major) + \".\" + strconv.Itoa(minor)\n\t\t\t\tif minor == 0 {\n\t\t\t\t\tarm64Variant = \"v\" + strconv.Itoa(major)\n\t\t\t\t}\n\t\t\t\tvector = append(vector, specs.Platform{\n\t\t\t\t\tArchitecture: \"arm64\",\n\t\t\t\t\tOS:           platform.OS,\n\t\t\t\t\tOSVersion:    platform.OSVersion,\n\t\t\t\t\tOSFeatures:   platform.OSFeatures,\n\t\t\t\t\tVariant:      arm64Variant,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// All arm64/v8.x and arm64/v9.x are compatible with arm/v8 (32-bits) and below.\n\t\t// There's no arm64 v9 variant, so it's normalized to v8.\n\t\tif strings.HasPrefix(variant, \"v8\") || strings.HasPrefix(variant, \"v9\") {\n\t\t\tvariant = \"v8\"\n\t\t}\n\t\tvector = append(vector, platformVector(specs.Platform{\n\t\t\tArchitecture: \"arm\",\n\t\t\tOS:           platform.OS,\n\t\t\tOSVersion:    platform.OSVersion,\n\t\t\tOSFeatures:   platform.OSFeatures,\n\t\t\tVariant:      variant,\n\t\t})...)\n\t}\n\n\treturn vector\n}\n\n// Only returns a match comparer for a single platform\n// using default resolution logic for the platform.\n//\n// For arm64/v9.x, will also match arm64/v9.{0..x-1} and arm64/v8.{0..x+5}\n// For arm64/v8.x, will also match arm64/v8.{0..x-1}\n// For arm/v8, will also match arm/v7, arm/v6 and arm/v5\n// For arm/v7, will also match arm/v6 and arm/v5\n// For arm/v6, will also match arm/v5\n// For amd64, will also match 386\nfunc Only(platform specs.Platform) MatchComparer {\n\treturn Ordered(platformVector(Normalize(platform))...)\n}\n\n// OnlyStrict returns a match comparer for a single platform.\n//\n// Unlike Only, OnlyStrict does not match sub platforms.\n// So, \"arm/vN\" will not match \"arm/vM\" where M < N,\n// and \"amd64\" will not also match \"386\".\n//\n// OnlyStrict matches non-canonical forms.\n// So, \"arm64\" matches \"arm/64/v8\".\nfunc OnlyStrict(platform specs.Platform) MatchComparer {\n\treturn Ordered(Normalize(platform))\n}\n\n// Ordered returns a platform MatchComparer which matches any of the platforms\n// but orders them in order they are provided.\nfunc Ordered(platforms ...specs.Platform) MatchComparer {\n\tmatchers := make([]Matcher, len(platforms))\n\tfor i := range platforms {\n\t\tmatchers[i] = NewMatcher(platforms[i])\n\t}\n\treturn orderedPlatformComparer{\n\t\tmatchers: matchers,\n\t}\n}\n\n// Any returns a platform MatchComparer which matches any of the platforms\n// with no preference for ordering.\nfunc Any(platforms ...specs.Platform) MatchComparer {\n\tmatchers := make([]Matcher, len(platforms))\n\tfor i := range platforms {\n\t\tmatchers[i] = NewMatcher(platforms[i])\n\t}\n\treturn anyPlatformComparer{\n\t\tmatchers: matchers,\n\t}\n}\n\n// All is a platform MatchComparer which matches all platforms\n// with preference for ordering.\nvar All MatchComparer = allPlatformComparer{}\n\ntype orderedPlatformComparer struct {\n\tmatchers []Matcher\n}\n\nfunc (c orderedPlatformComparer) Match(platform specs.Platform) bool {\n\tfor _, m := range c.matchers {\n\t\tif m.Match(platform) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c orderedPlatformComparer) Less(p1 specs.Platform, p2 specs.Platform) bool {\n\tfor _, m := range c.matchers {\n\t\tp1m := m.Match(p1)\n\t\tp2m := m.Match(p2)\n\t\tif p1m && !p2m {\n\t\t\treturn true\n\t\t}\n\t\tif p1m || p2m {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\ntype anyPlatformComparer struct {\n\tmatchers []Matcher\n}\n\nfunc (c anyPlatformComparer) Match(platform specs.Platform) bool {\n\tfor _, m := range c.matchers {\n\t\tif m.Match(platform) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c anyPlatformComparer) Less(p1, p2 specs.Platform) bool {\n\tvar p1m, p2m bool\n\tfor _, m := range c.matchers {\n\t\tif !p1m && m.Match(p1) {\n\t\t\tp1m = true\n\t\t}\n\t\tif !p2m && m.Match(p2) {\n\t\t\tp2m = true\n\t\t}\n\t\tif p1m && p2m {\n\t\t\treturn false\n\t\t}\n\t}\n\t// If one matches, and the other does, sort match first\n\treturn p1m && !p2m\n}\n\ntype allPlatformComparer struct{}\n\nfunc (allPlatformComparer) Match(specs.Platform) bool {\n\treturn true\n}\n\nfunc (allPlatformComparer) Less(specs.Platform, specs.Platform) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/cpuinfo.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n\n\t\"github.com/containerd/log\"\n)\n\n// Present the ARM instruction set architecture, eg: v7, v8\n// Don't use this value directly; call cpuVariant() instead.\nvar cpuVariantValue string\n\nvar cpuVariantOnce sync.Once\n\nfunc cpuVariant() string {\n\tcpuVariantOnce.Do(func() {\n\t\tif isArmArch(runtime.GOARCH) {\n\t\t\tvar err error\n\t\t\tcpuVariantValue, err = getCPUVariant()\n\t\t\tif err != nil {\n\t\t\t\tlog.L.Errorf(\"Error getCPUVariant for OS %s: %v\", runtime.GOOS, err)\n\t\t\t}\n\t\t}\n\t})\n\treturn cpuVariantValue\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/cpuinfo_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// getMachineArch retrieves the machine architecture through system call\nfunc getMachineArch() (string, error) {\n\tvar uname unix.Utsname\n\terr := unix.Uname(&uname)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tarch := string(uname.Machine[:bytes.IndexByte(uname.Machine[:], 0)])\n\n\treturn arch, nil\n}\n\n// For Linux, the kernel has already detected the ABI, ISA and Features.\n// So we don't need to access the ARM registers to detect platform information\n// by ourselves. We can just parse these information from /proc/cpuinfo\nfunc getCPUInfo(pattern string) (info string, err error) {\n\n\tcpuinfo, err := os.Open(\"/proc/cpuinfo\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer cpuinfo.Close()\n\n\t// Start to Parse the Cpuinfo line by line. For SMP SoC, we parse\n\t// the first core is enough.\n\tscanner := bufio.NewScanner(cpuinfo)\n\tfor scanner.Scan() {\n\t\tnewline := scanner.Text()\n\t\tlist := strings.Split(newline, \":\")\n\n\t\tif len(list) > 1 && strings.EqualFold(strings.TrimSpace(list[0]), pattern) {\n\t\t\treturn strings.TrimSpace(list[1]), nil\n\t\t}\n\t}\n\n\t// Check whether the scanner encountered errors\n\terr = scanner.Err()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn \"\", fmt.Errorf(\"getCPUInfo for pattern %s: %w\", pattern, errNotFound)\n}\n\n// getCPUVariantFromArch get CPU variant from arch through a system call\nfunc getCPUVariantFromArch(arch string) (string, error) {\n\n\tvar variant string\n\n\tarch = strings.ToLower(arch)\n\n\tif arch == \"aarch64\" {\n\t\tvariant = \"8\"\n\t} else if arch[0:4] == \"armv\" && len(arch) >= 5 {\n\t\t// Valid arch format is in form of armvXx\n\t\tswitch arch[3:5] {\n\t\tcase \"v8\":\n\t\t\tvariant = \"8\"\n\t\tcase \"v7\":\n\t\t\tvariant = \"7\"\n\t\tcase \"v6\":\n\t\t\tvariant = \"6\"\n\t\tcase \"v5\":\n\t\t\tvariant = \"5\"\n\t\tcase \"v4\":\n\t\t\tvariant = \"4\"\n\t\tcase \"v3\":\n\t\t\tvariant = \"3\"\n\t\tdefault:\n\t\t\tvariant = \"unknown\"\n\t\t}\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"getCPUVariantFromArch invalid arch: %s, %w\", arch, errInvalidArgument)\n\t}\n\treturn variant, nil\n}\n\n// getCPUVariant returns cpu variant for ARM\n// We first try reading \"Cpu architecture\" field from /proc/cpuinfo\n// If we can't find it, then fall back using a system call\n// This is to cover running ARM in emulated environment on x86 host as this field in /proc/cpuinfo\n// was not present.\nfunc getCPUVariant() (string, error) {\n\tvariant, err := getCPUInfo(\"Cpu architecture\")\n\tif err != nil {\n\t\tif errors.Is(err, errNotFound) {\n\t\t\t// Let's try getting CPU variant from machine architecture\n\t\t\tarch, err := getMachineArch()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"failure getting machine architecture: %v\", err)\n\t\t\t}\n\n\t\t\tvariant, err = getCPUVariantFromArch(arch)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"failure getting CPU variant from machine architecture: %v\", err)\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\", fmt.Errorf(\"failure getting CPU variant: %v\", err)\n\t\t}\n\t}\n\n\t// handle edge case for Raspberry Pi ARMv6 devices (which due to a kernel quirk, report \"CPU architecture: 7\")\n\t// https://www.raspberrypi.org/forums/viewtopic.php?t=12614\n\tif runtime.GOARCH == \"arm\" && variant == \"7\" {\n\t\tmodel, err := getCPUInfo(\"model name\")\n\t\tif err == nil && strings.HasPrefix(strings.ToLower(model), \"armv6-compatible\") {\n\t\t\tvariant = \"6\"\n\t\t}\n\t}\n\n\tswitch strings.ToLower(variant) {\n\tcase \"8\", \"aarch64\":\n\t\tvariant = \"v8\"\n\tcase \"7\", \"7m\", \"?(12)\", \"?(13)\", \"?(14)\", \"?(15)\", \"?(16)\", \"?(17)\":\n\t\tvariant = \"v7\"\n\tcase \"6\", \"6tej\":\n\t\tvariant = \"v6\"\n\tcase \"5\", \"5t\", \"5te\", \"5tej\":\n\t\tvariant = \"v5\"\n\tcase \"4\", \"4t\":\n\t\tvariant = \"v4\"\n\tcase \"3\":\n\t\tvariant = \"v3\"\n\tdefault:\n\t\tvariant = \"unknown\"\n\t}\n\n\treturn variant, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/cpuinfo_other.go",
    "content": "//go:build !linux\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\nfunc getCPUVariant() (string, error) {\n\n\tvar variant string\n\n\tif runtime.GOOS == \"windows\" || runtime.GOOS == \"darwin\" {\n\t\t// Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use\n\t\t// runtime.GOARCH to determine the variants\n\t\tswitch runtime.GOARCH {\n\t\tcase \"arm64\":\n\t\t\tvariant = \"v8\"\n\t\tcase \"arm\":\n\t\t\tvariant = \"v7\"\n\t\tdefault:\n\t\t\tvariant = \"unknown\"\n\t\t}\n\t} else if runtime.GOOS == \"freebsd\" {\n\t\t// FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated)\n\t\t// detecting those variants is currently unimplemented\n\t\tswitch runtime.GOARCH {\n\t\tcase \"arm64\":\n\t\t\tvariant = \"v8\"\n\t\tdefault:\n\t\t\tvariant = \"unknown\"\n\t\t}\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"getCPUVariant for OS %s: %v\", runtime.GOOS, errNotImplemented)\n\t}\n\n\treturn variant, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/database.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"runtime\"\n\t\"strings\"\n)\n\n// These function are generated from https://golang.org/src/go/build/syslist.go.\n//\n// We use switch statements because they are slightly faster than map lookups\n// and use a little less memory.\n\n// isKnownOS returns true if we know about the operating system.\n//\n// The OS value should be normalized before calling this function.\nfunc isKnownOS(os string) bool {\n\tswitch os {\n\tcase \"aix\", \"android\", \"darwin\", \"dragonfly\", \"freebsd\", \"hurd\", \"illumos\", \"ios\", \"js\", \"linux\", \"nacl\", \"netbsd\", \"openbsd\", \"plan9\", \"solaris\", \"windows\", \"zos\":\n\t\treturn true\n\t}\n\treturn false\n}\n\n// isArmArch returns true if the architecture is ARM.\n//\n// The arch value should be normalized before being passed to this function.\nfunc isArmArch(arch string) bool {\n\tswitch arch {\n\tcase \"arm\", \"arm64\":\n\t\treturn true\n\t}\n\treturn false\n}\n\n// isKnownArch returns true if we know about the architecture.\n//\n// The arch value should be normalized before being passed to this function.\nfunc isKnownArch(arch string) bool {\n\tswitch arch {\n\tcase \"386\", \"amd64\", \"amd64p32\", \"arm\", \"armbe\", \"arm64\", \"arm64be\", \"ppc64\", \"ppc64le\", \"loong64\", \"mips\", \"mipsle\", \"mips64\", \"mips64le\", \"mips64p32\", \"mips64p32le\", \"ppc\", \"riscv\", \"riscv64\", \"s390\", \"s390x\", \"sparc\", \"sparc64\", \"wasm\":\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc normalizeOS(os string) string {\n\tif os == \"\" {\n\t\treturn runtime.GOOS\n\t}\n\tos = strings.ToLower(os)\n\n\tswitch os {\n\tcase \"macos\":\n\t\tos = \"darwin\"\n\t}\n\treturn os\n}\n\n// normalizeArch normalizes the architecture.\nfunc normalizeArch(arch, variant string) (string, string) {\n\tarch, variant = strings.ToLower(arch), strings.ToLower(variant)\n\tswitch arch {\n\tcase \"i386\":\n\t\tarch = \"386\"\n\t\tvariant = \"\"\n\tcase \"x86_64\", \"x86-64\", \"amd64\":\n\t\tarch = \"amd64\"\n\t\tif variant == \"v1\" {\n\t\t\tvariant = \"\"\n\t\t}\n\tcase \"aarch64\", \"arm64\":\n\t\tarch = \"arm64\"\n\t\tswitch variant {\n\t\tcase \"8\", \"v8\", \"v8.0\":\n\t\t\tvariant = \"\"\n\t\tcase \"9\", \"9.0\", \"v9.0\":\n\t\t\tvariant = \"v9\"\n\t\t}\n\tcase \"armhf\":\n\t\tarch = \"arm\"\n\t\tvariant = \"v7\"\n\tcase \"armel\":\n\t\tarch = \"arm\"\n\t\tvariant = \"v6\"\n\tcase \"arm\":\n\t\tswitch variant {\n\t\tcase \"\", \"7\":\n\t\t\tvariant = \"v7\"\n\t\tcase \"5\", \"6\", \"8\":\n\t\t\tvariant = \"v\" + variant\n\t\t}\n\t}\n\n\treturn arch, variant\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/defaults.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\n// DefaultString returns the default string specifier for the platform,\n// with [PR#6](https://github.com/containerd/platforms/pull/6) the result\n// may now also include the OSVersion from the provided platform specification.\nfunc DefaultString() string {\n\treturn FormatAll(DefaultSpec())\n}\n\n// DefaultStrict returns strict form of Default.\nfunc DefaultStrict() MatchComparer {\n\treturn OnlyStrict(DefaultSpec())\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/defaults_darwin.go",
    "content": "//go:build darwin\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"runtime\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// DefaultSpec returns the current platform's default platform specification.\nfunc DefaultSpec() specs.Platform {\n\treturn specs.Platform{\n\t\tOS:           runtime.GOOS,\n\t\tArchitecture: runtime.GOARCH,\n\t\t// The Variant field will be empty if arch != ARM.\n\t\tVariant: cpuVariant(),\n\t}\n}\n\n// Default returns the default matcher for the platform.\nfunc Default() MatchComparer {\n\treturn Ordered(DefaultSpec(), specs.Platform{\n\t\t// darwin runtime also supports Linux binary via runu/LKL\n\t\tOS:           \"linux\",\n\t\tArchitecture: runtime.GOARCH,\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/defaults_freebsd.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"runtime\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// DefaultSpec returns the current platform's default platform specification.\nfunc DefaultSpec() specs.Platform {\n\treturn specs.Platform{\n\t\tOS:           runtime.GOOS,\n\t\tArchitecture: runtime.GOARCH,\n\t\t// The Variant field will be empty if arch != ARM.\n\t\tVariant: cpuVariant(),\n\t}\n}\n\n// Default returns the default matcher for the platform.\nfunc Default() MatchComparer {\n\treturn Ordered(DefaultSpec(), specs.Platform{\n\t\tOS:           \"linux\",\n\t\tArchitecture: runtime.GOARCH,\n\t\t// The Variant field will be empty if arch != ARM.\n\t\tVariant: cpuVariant(),\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/defaults_unix.go",
    "content": "//go:build !windows && !darwin && !freebsd\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"runtime\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// DefaultSpec returns the current platform's default platform specification.\nfunc DefaultSpec() specs.Platform {\n\treturn specs.Platform{\n\t\tOS:           runtime.GOOS,\n\t\tArchitecture: runtime.GOARCH,\n\t\t// The Variant field will be empty if arch != ARM.\n\t\tVariant: cpuVariant(),\n\t}\n}\n\n// Default returns the default matcher for the platform.\nfunc Default() MatchComparer {\n\treturn Only(DefaultSpec())\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/defaults_windows.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n\t\"golang.org/x/sys/windows\"\n)\n\n// DefaultSpec returns the current platform's default platform specification.\nfunc DefaultSpec() specs.Platform {\n\tmajor, minor, build := windows.RtlGetNtVersionNumbers()\n\treturn specs.Platform{\n\t\tOS:           runtime.GOOS,\n\t\tArchitecture: runtime.GOARCH,\n\t\tOSVersion:    fmt.Sprintf(\"%d.%d.%d\", major, minor, build),\n\t\t// The Variant field will be empty if arch != ARM.\n\t\tVariant: cpuVariant(),\n\t}\n}\n\n// Default returns the current platform's default platform specification.\nfunc Default() MatchComparer {\n\treturn Only(DefaultSpec())\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/errors.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport \"errors\"\n\n// These errors mirror the errors defined in [github.com/containerd/containerd/errdefs],\n// however, they are not exported as they are not expected to be used as sentinel\n// errors by consumers of this package.\n//\n//nolint:unused // not all errors are used on all platforms.\nvar (\n\terrNotFound        = errors.New(\"not found\")\n\terrInvalidArgument = errors.New(\"invalid argument\")\n\terrNotImplemented  = errors.New(\"not implemented\")\n)\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/platform_windows_compat.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage platforms\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// windowsOSVersion is a wrapper for Windows version information\n// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx\ntype windowsOSVersion struct {\n\tVersion      uint32\n\tMajorVersion uint8\n\tMinorVersion uint8\n\tBuild        uint16\n}\n\n// Windows Client and Server build numbers.\n//\n// See:\n// https://learn.microsoft.com/en-us/windows/release-health/release-information\n// https://learn.microsoft.com/en-us/windows/release-health/windows-server-release-info\n// https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information\nconst (\n\t// rs5 (version 1809, codename \"Redstone 5\") corresponds to Windows Server\n\t// 2019 (ltsc2019), and Windows 10 (October 2018 Update).\n\trs5 = 17763\n\n\t// v21H2Server corresponds to Windows Server 2022 (ltsc2022).\n\tv21H2Server = 20348\n\n\t// v22H2Win11 corresponds to Windows 11 (2022 Update).\n\tv22H2Win11 = 22621\n)\n\n// List of stable ABI compliant ltsc releases\n// Note: List must be sorted in ascending order\nvar compatLTSCReleases = []uint16{\n\tv21H2Server,\n}\n\n// CheckHostAndContainerCompat checks if given host and container\n// OS versions are compatible.\n// It includes support for stable ABI compliant versions as well.\n// Every release after WS 2022 will support the previous ltsc\n// container image. Stable ABI is in preview mode for windows 11 client.\n// Refer: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-10#windows-server-host-os-compatibility\nfunc checkWindowsHostAndContainerCompat(host, ctr windowsOSVersion) bool {\n\t// check major minor versions of host and guest\n\tif host.MajorVersion != ctr.MajorVersion ||\n\t\thost.MinorVersion != ctr.MinorVersion {\n\t\treturn false\n\t}\n\n\t// If host is < WS 2022, exact version match is required\n\tif host.Build < v21H2Server {\n\t\treturn host.Build == ctr.Build\n\t}\n\n\tvar supportedLtscRelease uint16\n\tfor i := len(compatLTSCReleases) - 1; i >= 0; i-- {\n\t\tif host.Build >= compatLTSCReleases[i] {\n\t\t\tsupportedLtscRelease = compatLTSCReleases[i]\n\t\t\tbreak\n\t\t}\n\t}\n\treturn ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build\n}\n\nfunc getWindowsOSVersion(osVersionPrefix string) windowsOSVersion {\n\tif strings.Count(osVersionPrefix, \".\") < 2 {\n\t\treturn windowsOSVersion{}\n\t}\n\n\tmajor, extra, _ := strings.Cut(osVersionPrefix, \".\")\n\tminor, extra, _ := strings.Cut(extra, \".\")\n\tbuild, _, _ := strings.Cut(extra, \".\")\n\n\tmajorVersion, err := strconv.ParseUint(major, 10, 8)\n\tif err != nil {\n\t\treturn windowsOSVersion{}\n\t}\n\n\tminorVersion, err := strconv.ParseUint(minor, 10, 8)\n\tif err != nil {\n\t\treturn windowsOSVersion{}\n\t}\n\tbuildNumber, err := strconv.ParseUint(build, 10, 16)\n\tif err != nil {\n\t\treturn windowsOSVersion{}\n\t}\n\n\treturn windowsOSVersion{\n\t\tMajorVersion: uint8(majorVersion),\n\t\tMinorVersion: uint8(minorVersion),\n\t\tBuild:        uint16(buildNumber),\n\t}\n}\n\nfunc winRevision(v string) int {\n\tparts := strings.Split(v, \".\")\n\tif len(parts) < 4 {\n\t\treturn 0\n\t}\n\tr, err := strconv.Atoi(parts[3])\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn r\n}\n\ntype windowsVersionMatcher struct {\n\twindowsOSVersion\n}\n\nfunc (m windowsVersionMatcher) Match(v string) bool {\n\tif m.isEmpty() || v == \"\" {\n\t\treturn true\n\t}\n\tosv := getWindowsOSVersion(v)\n\treturn checkWindowsHostAndContainerCompat(m.windowsOSVersion, osv)\n}\n\nfunc (m windowsVersionMatcher) isEmpty() bool {\n\treturn m.MajorVersion == 0 && m.MinorVersion == 0 && m.Build == 0\n}\n\ntype windowsMatchComparer struct {\n\tMatcher\n}\n\nfunc (c *windowsMatchComparer) Less(p1, p2 specs.Platform) bool {\n\tm1, m2 := c.Match(p1), c.Match(p2)\n\tif m1 && m2 {\n\t\tr1, r2 := winRevision(p1.OSVersion), winRevision(p2.OSVersion)\n\t\treturn r1 > r2\n\t}\n\treturn m1 && !m2\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/platforms/platforms.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n// Package platforms provides a toolkit for normalizing, matching and\n// specifying container platforms.\n//\n// Centered around OCI platform specifications, we define a string-based\n// specifier syntax that can be used for user input. With a specifier, users\n// only need to specify the parts of the platform that are relevant to their\n// context, providing an operating system or architecture or both.\n//\n// How do I use this package?\n//\n// The vast majority of use cases should simply use the match function with\n// user input. The first step is to parse a specifier into a matcher:\n//\n//\tm, err := Parse(\"linux\")\n//\tif err != nil { ... }\n//\n// Once you have a matcher, use it to match against the platform declared by a\n// component, typically from an image or runtime. Since extracting an images\n// platform is a little more involved, we'll use an example against the\n// platform default:\n//\n//\tif ok := m.Match(Default()); !ok { /* doesn't match */ }\n//\n// This can be composed in loops for resolving runtimes or used as a filter for\n// fetch and select images.\n//\n// More details of the specifier syntax and platform spec follow.\n//\n// # Declaring Platform Support\n//\n// Components that have strict platform requirements should use the OCI\n// platform specification to declare their support. Typically, this will be\n// images and runtimes that should make these declaring which platform they\n// support specifically. This looks roughly as follows:\n//\n//\t  type Platform struct {\n//\t\t   Architecture string\n//\t\t   OS           string\n//\t\t   Variant      string\n//\t  }\n//\n// Most images and runtimes should at least set Architecture and OS, according\n// to their GOARCH and GOOS values, respectively (follow the OCI image\n// specification when in doubt). ARM should set variant under certain\n// discussions, which are outlined below.\n//\n// # Platform Specifiers\n//\n// While the OCI platform specifications provide a tool for components to\n// specify structured information, user input typically doesn't need the full\n// context and much can be inferred. To solve this problem, we introduced\n// \"specifiers\". A specifier has the format\n// `<os>|<arch>|<os>/<arch>[/<variant>]`.  The user can provide either the\n// operating system or the architecture or both.\n//\n// An example of a common specifier is `linux/amd64`. If the host has a default\n// of runtime that matches this, the user can simply provide the component that\n// matters. For example, if a image provides amd64 and arm64 support, the\n// operating system, `linux` can be inferred, so they only have to provide\n// `arm64` or `amd64`. Similar behavior is implemented for operating systems,\n// where the architecture may be known but a runtime may support images from\n// different operating systems.\n//\n// # Normalization\n//\n// Because not all users are familiar with the way the Go runtime represents\n// platforms, several normalizations have been provided to make this package\n// easier to user.\n//\n// The following are performed for architectures:\n//\n//\tValue    Normalized\n//\taarch64  arm64\n//\tarmhf    arm\n//\tarmel    arm/v6\n//\ti386     386\n//\tx86_64   amd64\n//\tx86-64   amd64\n//\n// We also normalize the operating system `macos` to `darwin`.\n//\n// # ARM Support\n//\n// To qualify ARM architecture, the Variant field is used to qualify the arm\n// version. The most common arm version, v7, is represented without the variant\n// unless it is explicitly provided. This is treated as equivalent to armhf. A\n// previous architecture, armel, will be normalized to arm/v6.\n//\n// Similarly, the most common arm64 version v8, and most common amd64 version v1\n// are represented without the variant.\n//\n// While these normalizations are provided, their support on arm platforms has\n// not yet been fully implemented and tested.\npackage platforms\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\nvar (\n\tspecifierRe    = regexp.MustCompile(`^[A-Za-z0-9_.-]+$`)\n\tosAndVersionRe = regexp.MustCompile(`^([A-Za-z0-9_-]+)(?:\\(([A-Za-z0-9_.-]*)\\))?$`)\n)\n\nconst osAndVersionFormat = \"%s(%s)\"\n\n// Platform is a type alias for convenience, so there is no need to import image-spec package everywhere.\ntype Platform = specs.Platform\n\n// Matcher matches platforms specifications, provided by an image or runtime.\ntype Matcher interface {\n\tMatch(platform specs.Platform) bool\n}\n\n// NewMatcher returns a simple matcher based on the provided platform\n// specification. The returned matcher only looks for equality based on os,\n// architecture and variant.\n//\n// One may implement their own matcher if this doesn't provide the required\n// functionality.\n//\n// Applications should opt to use `Match` over directly parsing specifiers.\nfunc NewMatcher(platform specs.Platform) Matcher {\n\tm := &matcher{\n\t\tPlatform: Normalize(platform),\n\t}\n\n\tif platform.OS == \"windows\" {\n\t\tm.osvM = &windowsVersionMatcher{\n\t\t\twindowsOSVersion: getWindowsOSVersion(platform.OSVersion),\n\t\t}\n\t\t// In prior versions, on windows, the returned matcher implements a\n\t\t// MatchComprarer interface.\n\t\t// This preserves that behavior for backwards compatibility.\n\t\t//\n\t\t// TODO: This isn't actually used in this package, except for a test case,\n\t\t// which may have been an unintended side of some refactor.\n\t\t// It was likely intended to be used in `Ordered` but it is not since\n\t\t// `Less` that is implemented here ends up getting masked due to wrapping.\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\treturn &windowsMatchComparer{m}\n\t\t}\n\t}\n\treturn m\n}\n\ntype osVerMatcher interface {\n\tMatch(string) bool\n}\n\ntype matcher struct {\n\tspecs.Platform\n\tosvM osVerMatcher\n}\n\nfunc (m *matcher) Match(platform specs.Platform) bool {\n\tnormalized := Normalize(platform)\n\treturn m.OS == normalized.OS &&\n\t\tm.Architecture == normalized.Architecture &&\n\t\tm.Variant == normalized.Variant &&\n\t\tm.matchOSVersion(platform)\n}\n\nfunc (m *matcher) matchOSVersion(platform specs.Platform) bool {\n\tif m.osvM != nil {\n\t\treturn m.osvM.Match(platform.OSVersion)\n\t}\n\treturn true\n}\n\nfunc (m *matcher) String() string {\n\treturn FormatAll(m.Platform)\n}\n\n// ParseAll parses a list of platform specifiers into a list of platform.\nfunc ParseAll(specifiers []string) ([]specs.Platform, error) {\n\tplatforms := make([]specs.Platform, len(specifiers))\n\tfor i, s := range specifiers {\n\t\tp, err := Parse(s)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid platform %s: %w\", s, err)\n\t\t}\n\t\tplatforms[i] = p\n\t}\n\treturn platforms, nil\n}\n\n// Parse parses the platform specifier syntax into a platform declaration.\n//\n// Platform specifiers are in the format `<os>[(<OSVersion>)]|<arch>|<os>[(<OSVersion>)]/<arch>[/<variant>]`.\n// The minimum required information for a platform specifier is the operating\n// system or architecture. The OSVersion can be part of the OS like `windows(10.0.17763)`\n// When an OSVersion is specified, then specs.Platform.OSVersion is populated with that value,\n// and an empty string otherwise.\n// If there is only a single string (no slashes), the\n// value will be matched against the known set of operating systems, then fall\n// back to the known set of architectures. The missing component will be\n// inferred based on the local environment.\nfunc Parse(specifier string) (specs.Platform, error) {\n\tif strings.Contains(specifier, \"*\") {\n\t\t// TODO(stevvooe): need to work out exact wildcard handling\n\t\treturn specs.Platform{}, fmt.Errorf(\"%q: wildcards not yet supported: %w\", specifier, errInvalidArgument)\n\t}\n\n\t// Limit to 4 elements to prevent unbounded split\n\tparts := strings.SplitN(specifier, \"/\", 4)\n\n\tvar p specs.Platform\n\tfor i, part := range parts {\n\t\tif i == 0 {\n\t\t\t// First element is <os>[(<OSVersion>)]\n\t\t\tosVer := osAndVersionRe.FindStringSubmatch(part)\n\t\t\tif osVer == nil {\n\t\t\t\treturn specs.Platform{}, fmt.Errorf(\"%q is an invalid OS component of %q: OSAndVersion specifier component must match %q: %w\", part, specifier, osAndVersionRe.String(), errInvalidArgument)\n\t\t\t}\n\n\t\t\tp.OS = normalizeOS(osVer[1])\n\t\t\tp.OSVersion = osVer[2]\n\t\t} else {\n\t\t\tif !specifierRe.MatchString(part) {\n\t\t\t\treturn specs.Platform{}, fmt.Errorf(\"%q is an invalid component of %q: platform specifier component must match %q: %w\", part, specifier, specifierRe.String(), errInvalidArgument)\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch len(parts) {\n\tcase 1:\n\t\t// in this case, we will test that the value might be an OS (with or\n\t\t// without the optional OSVersion specified) and look it up.\n\t\t// If it is not known, we'll treat it as an architecture. Since\n\t\t// we have very little information about the platform here, we are\n\t\t// going to be a little more strict if we don't know about the argument\n\t\t// value.\n\t\tif isKnownOS(p.OS) {\n\t\t\t// picks a default architecture\n\t\t\tp.Architecture = runtime.GOARCH\n\t\t\tif p.Architecture == \"arm\" && cpuVariant() != \"v7\" {\n\t\t\t\tp.Variant = cpuVariant()\n\t\t\t}\n\n\t\t\treturn p, nil\n\t\t}\n\n\t\tp.Architecture, p.Variant = normalizeArch(parts[0], \"\")\n\t\tif p.Architecture == \"arm\" && p.Variant == \"v7\" {\n\t\t\tp.Variant = \"\"\n\t\t}\n\t\tif isKnownArch(p.Architecture) {\n\t\t\tp.OS = runtime.GOOS\n\t\t\treturn p, nil\n\t\t}\n\n\t\treturn specs.Platform{}, fmt.Errorf(\"%q: unknown operating system or architecture: %w\", specifier, errInvalidArgument)\n\tcase 2:\n\t\t// In this case, we treat as a regular OS[(OSVersion)]/arch pair. We don't care\n\t\t// about whether or not we know of the platform.\n\t\tp.Architecture, p.Variant = normalizeArch(parts[1], \"\")\n\t\tif p.Architecture == \"arm\" && p.Variant == \"v7\" {\n\t\t\tp.Variant = \"\"\n\t\t}\n\n\t\treturn p, nil\n\tcase 3:\n\t\t// we have a fully specified variant, this is rare\n\t\tp.Architecture, p.Variant = normalizeArch(parts[1], parts[2])\n\t\tif p.Architecture == \"arm64\" && p.Variant == \"\" {\n\t\t\tp.Variant = \"v8\"\n\t\t}\n\n\t\treturn p, nil\n\t}\n\n\treturn specs.Platform{}, fmt.Errorf(\"%q: cannot parse platform specifier: %w\", specifier, errInvalidArgument)\n}\n\n// MustParse is like Parses but panics if the specifier cannot be parsed.\n// Simplifies initialization of global variables.\nfunc MustParse(specifier string) specs.Platform {\n\tp, err := Parse(specifier)\n\tif err != nil {\n\t\tpanic(\"platform: Parse(\" + strconv.Quote(specifier) + \"): \" + err.Error())\n\t}\n\treturn p\n}\n\n// Format returns a string specifier from the provided platform specification.\nfunc Format(platform specs.Platform) string {\n\tif platform.OS == \"\" {\n\t\treturn \"unknown\"\n\t}\n\n\treturn path.Join(platform.OS, platform.Architecture, platform.Variant)\n}\n\n// FormatAll returns a string specifier that also includes the OSVersion from the\n// provided platform specification.\nfunc FormatAll(platform specs.Platform) string {\n\tif platform.OS == \"\" {\n\t\treturn \"unknown\"\n\t}\n\n\tif platform.OSVersion != \"\" {\n\t\tOSAndVersion := fmt.Sprintf(osAndVersionFormat, platform.OS, platform.OSVersion)\n\t\treturn path.Join(OSAndVersion, platform.Architecture, platform.Variant)\n\t}\n\treturn path.Join(platform.OS, platform.Architecture, platform.Variant)\n}\n\n// Normalize validates and translate the platform to the canonical value.\n//\n// For example, if \"Aarch64\" is encountered, we change it to \"arm64\" or if\n// \"x86_64\" is encountered, it becomes \"amd64\".\nfunc Normalize(platform specs.Platform) specs.Platform {\n\tplatform.OS = normalizeOS(platform.OS)\n\tplatform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant)\n\n\treturn platform\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/build.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   Copyright 2019 The Go Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.\n*/\n\npackage estargz\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/containerd/stargz-snapshotter/estargz/errorutil\"\n\t\"github.com/klauspost/compress/zstd\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\ntype options struct {\n\tchunkSize              int\n\tcompressionLevel       int\n\tprioritizedFiles       []string\n\tmissedPrioritizedFiles *[]string\n\tcompression            Compression\n\tctx                    context.Context\n\tminChunkSize           int\n}\n\ntype Option func(o *options) error\n\n// WithChunkSize option specifies the chunk size of eStargz blob to build.\nfunc WithChunkSize(chunkSize int) Option {\n\treturn func(o *options) error {\n\t\to.chunkSize = chunkSize\n\t\treturn nil\n\t}\n}\n\n// WithCompressionLevel option specifies the gzip compression level.\n// The default is gzip.BestCompression.\n// This option will be ignored if WithCompression option is used.\n// See also: https://godoc.org/compress/gzip#pkg-constants\nfunc WithCompressionLevel(level int) Option {\n\treturn func(o *options) error {\n\t\to.compressionLevel = level\n\t\treturn nil\n\t}\n}\n\n// WithPrioritizedFiles option specifies the list of prioritized files.\n// These files must be complete paths that are absolute or relative to \"/\"\n// For example, all of \"foo/bar\", \"/foo/bar\", \"./foo/bar\" and \"../foo/bar\"\n// are treated as \"/foo/bar\".\nfunc WithPrioritizedFiles(files []string) Option {\n\treturn func(o *options) error {\n\t\to.prioritizedFiles = files\n\t\treturn nil\n\t}\n}\n\n// WithAllowPrioritizeNotFound makes Build continue the execution even if some\n// of prioritized files specified by WithPrioritizedFiles option aren't found\n// in the input tar. Instead, this records all missed file names to the passed\n// slice.\nfunc WithAllowPrioritizeNotFound(missedFiles *[]string) Option {\n\treturn func(o *options) error {\n\t\tif missedFiles == nil {\n\t\t\treturn fmt.Errorf(\"WithAllowPrioritizeNotFound: slice must be passed\")\n\t\t}\n\t\to.missedPrioritizedFiles = missedFiles\n\t\treturn nil\n\t}\n}\n\n// WithCompression specifies compression algorithm to be used.\n// Default is gzip.\nfunc WithCompression(compression Compression) Option {\n\treturn func(o *options) error {\n\t\to.compression = compression\n\t\treturn nil\n\t}\n}\n\n// WithContext specifies a context that can be used for clean canceleration.\nfunc WithContext(ctx context.Context) Option {\n\treturn func(o *options) error {\n\t\to.ctx = ctx\n\t\treturn nil\n\t}\n}\n\n// WithMinChunkSize option specifies the minimal number of bytes of data\n// must be written in one gzip stream.\n// By increasing this number, one gzip stream can contain multiple files\n// and it hopefully leads to smaller result blob.\n// NOTE: This adds a TOC property that old reader doesn't understand.\nfunc WithMinChunkSize(minChunkSize int) Option {\n\treturn func(o *options) error {\n\t\to.minChunkSize = minChunkSize\n\t\treturn nil\n\t}\n}\n\n// Blob is an eStargz blob.\ntype Blob struct {\n\tio.ReadCloser\n\tdiffID    digest.Digester\n\ttocDigest digest.Digest\n}\n\n// DiffID returns the digest of uncompressed blob.\n// It is only valid to call DiffID after Close.\nfunc (b *Blob) DiffID() digest.Digest {\n\treturn b.diffID.Digest()\n}\n\n// TOCDigest returns the digest of uncompressed TOC JSON.\nfunc (b *Blob) TOCDigest() digest.Digest {\n\treturn b.tocDigest\n}\n\n// Build builds an eStargz blob which is an extended version of stargz, from a blob (gzip, zstd\n// or plain tar) passed through the argument. If there are some prioritized files are listed in\n// the option, these files are grouped as \"prioritized\" and can be used for runtime optimization\n// (e.g. prefetch). This function builds a blob in parallel, with dividing that blob into several\n// (at least the number of runtime.GOMAXPROCS(0)) sub-blobs.\nfunc Build(tarBlob *io.SectionReader, opt ...Option) (_ *Blob, rErr error) {\n\tvar opts options\n\topts.compressionLevel = gzip.BestCompression // BestCompression by default\n\tfor _, o := range opt {\n\t\tif err := o(&opts); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif opts.compression == nil {\n\t\topts.compression = newGzipCompressionWithLevel(opts.compressionLevel)\n\t}\n\tlayerFiles := newTempFiles()\n\tctx := opts.ctx\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\tdone := make(chan struct{})\n\tdefer close(done)\n\tgo func() {\n\t\tselect {\n\t\tcase <-done:\n\t\t\t// nop\n\t\tcase <-ctx.Done():\n\t\t\tlayerFiles.CleanupAll()\n\t\t}\n\t}()\n\tdefer func() {\n\t\tif rErr != nil {\n\t\t\tif err := layerFiles.CleanupAll(); err != nil {\n\t\t\t\trErr = fmt.Errorf(\"failed to cleanup tmp files: %v: %w\", err, rErr)\n\t\t\t}\n\t\t}\n\t\tif cErr := ctx.Err(); cErr != nil {\n\t\t\trErr = fmt.Errorf(\"error from context %q: %w\", cErr, rErr)\n\t\t}\n\t}()\n\ttarBlob, err := decompressBlob(tarBlob, layerFiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tentries, err := sortEntries(tarBlob, opts.prioritizedFiles, opts.missedPrioritizedFiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar tarParts [][]*entry\n\tif opts.minChunkSize > 0 {\n\t\t// Each entry needs to know the size of the current gzip stream so they\n\t\t// cannot be processed in parallel.\n\t\ttarParts = [][]*entry{entries}\n\t} else {\n\t\ttarParts = divideEntries(entries, runtime.GOMAXPROCS(0))\n\t}\n\twriters := make([]*Writer, len(tarParts))\n\tpayloads := make([]*os.File, len(tarParts))\n\tvar mu sync.Mutex\n\tvar eg errgroup.Group\n\tfor i, parts := range tarParts {\n\t\ti, parts := i, parts\n\t\t// builds verifiable stargz sub-blobs\n\t\teg.Go(func() error {\n\t\t\tesgzFile, err := layerFiles.TempFile(\"\", \"esgzdata\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tsw := NewWriterWithCompressor(esgzFile, opts.compression)\n\t\t\tsw.ChunkSize = opts.chunkSize\n\t\t\tsw.MinChunkSize = opts.minChunkSize\n\t\t\tif sw.needsOpenGzEntries == nil {\n\t\t\t\tsw.needsOpenGzEntries = make(map[string]struct{})\n\t\t\t}\n\t\t\tfor _, f := range []string{PrefetchLandmark, NoPrefetchLandmark} {\n\t\t\t\tsw.needsOpenGzEntries[f] = struct{}{}\n\t\t\t}\n\t\t\tif err := sw.AppendTar(readerFromEntries(parts...)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmu.Lock()\n\t\t\twriters[i] = sw\n\t\t\tpayloads[i] = esgzFile\n\t\t\tmu.Unlock()\n\t\t\treturn nil\n\t\t})\n\t}\n\tif err := eg.Wait(); err != nil {\n\t\trErr = err\n\t\treturn nil, err\n\t}\n\ttocAndFooter, tocDgst, err := closeWithCombine(writers...)\n\tif err != nil {\n\t\trErr = err\n\t\treturn nil, err\n\t}\n\tvar rs []io.Reader\n\tfor _, p := range payloads {\n\t\tfs, err := fileSectionReader(p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trs = append(rs, fs)\n\t}\n\tdiffID := digest.Canonical.Digester()\n\tpr, pw := io.Pipe()\n\tgo func() {\n\t\tr, err := opts.compression.Reader(io.TeeReader(io.MultiReader(append(rs, tocAndFooter)...), pw))\n\t\tif err != nil {\n\t\t\tpw.CloseWithError(err)\n\t\t\treturn\n\t\t}\n\t\tdefer r.Close()\n\t\tif _, err := io.Copy(diffID.Hash(), r); err != nil {\n\t\t\tpw.CloseWithError(err)\n\t\t\treturn\n\t\t}\n\t\tpw.Close()\n\t}()\n\treturn &Blob{\n\t\tReadCloser: readCloser{\n\t\t\tReader:    pr,\n\t\t\tcloseFunc: layerFiles.CleanupAll,\n\t\t},\n\t\ttocDigest: tocDgst,\n\t\tdiffID:    diffID,\n\t}, nil\n}\n\n// closeWithCombine takes unclosed Writers and close them. This also returns the\n// toc that combined all Writers into.\n// Writers doesn't write TOC and footer to the underlying writers so they can be\n// combined into a single eStargz and tocAndFooter returned by this function can\n// be appended at the tail of that combined blob.\nfunc closeWithCombine(ws ...*Writer) (tocAndFooterR io.Reader, tocDgst digest.Digest, err error) {\n\tif len(ws) == 0 {\n\t\treturn nil, \"\", fmt.Errorf(\"at least one writer must be passed\")\n\t}\n\tfor _, w := range ws {\n\t\tif w.closed {\n\t\t\treturn nil, \"\", fmt.Errorf(\"writer must be unclosed\")\n\t\t}\n\t\tdefer func(w *Writer) { w.closed = true }(w)\n\t\tif err := w.closeGz(); err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\tif err := w.bw.Flush(); err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t}\n\tvar (\n\t\tmtoc          = new(JTOC)\n\t\tcurrentOffset int64\n\t)\n\tmtoc.Version = ws[0].toc.Version\n\tfor _, w := range ws {\n\t\tfor _, e := range w.toc.Entries {\n\t\t\t// Recalculate Offset of non-empty files/chunks\n\t\t\tif (e.Type == \"reg\" && e.Size > 0) || e.Type == \"chunk\" {\n\t\t\t\te.Offset += currentOffset\n\t\t\t}\n\t\t\tmtoc.Entries = append(mtoc.Entries, e)\n\t\t}\n\t\tif w.toc.Version > mtoc.Version {\n\t\t\tmtoc.Version = w.toc.Version\n\t\t}\n\t\tcurrentOffset += w.cw.n\n\t}\n\n\treturn tocAndFooter(ws[0].compressor, mtoc, currentOffset)\n}\n\nfunc tocAndFooter(compressor Compressor, toc *JTOC, offset int64) (io.Reader, digest.Digest, error) {\n\tbuf := new(bytes.Buffer)\n\ttocDigest, err := compressor.WriteTOCAndFooter(buf, offset, toc, nil)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treturn buf, tocDigest, nil\n}\n\n// divideEntries divides passed entries to the parts at least the number specified by the\n// argument.\nfunc divideEntries(entries []*entry, minPartsNum int) (set [][]*entry) {\n\tvar estimatedSize int64\n\tfor _, e := range entries {\n\t\testimatedSize += e.header.Size\n\t}\n\tunitSize := estimatedSize / int64(minPartsNum)\n\tvar (\n\t\tnextEnd = unitSize\n\t\toffset  int64\n\t)\n\tset = append(set, []*entry{})\n\tfor _, e := range entries {\n\t\tset[len(set)-1] = append(set[len(set)-1], e)\n\t\toffset += e.header.Size\n\t\tif offset > nextEnd {\n\t\t\tset = append(set, []*entry{})\n\t\t\tnextEnd += unitSize\n\t\t}\n\t}\n\treturn\n}\n\nvar errNotFound = errors.New(\"not found\")\n\n// sortEntries reads the specified tar blob and returns a list of tar entries.\n// If some of prioritized files are specified, the list starts from these\n// files with keeping the order specified by the argument.\nfunc sortEntries(in io.ReaderAt, prioritized []string, missedPrioritized *[]string) ([]*entry, error) {\n\n\t// Import tar file.\n\tintar, err := importTar(in)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to sort: %w\", err)\n\t}\n\n\t// Sort the tar file respecting to the prioritized files list.\n\tsorted := &tarFile{}\n\tfor _, l := range prioritized {\n\t\tif err := moveRec(l, intar, sorted); err != nil {\n\t\t\tif errors.Is(err, errNotFound) && missedPrioritized != nil {\n\t\t\t\t*missedPrioritized = append(*missedPrioritized, l)\n\t\t\t\tcontinue // allow not found\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to sort tar entries: %w\", err)\n\t\t}\n\t}\n\tif len(prioritized) == 0 {\n\t\tsorted.add(&entry{\n\t\t\theader: &tar.Header{\n\t\t\t\tName:     NoPrefetchLandmark,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tSize:     int64(len([]byte{landmarkContents})),\n\t\t\t},\n\t\t\tpayload: bytes.NewReader([]byte{landmarkContents}),\n\t\t})\n\t} else {\n\t\tsorted.add(&entry{\n\t\t\theader: &tar.Header{\n\t\t\t\tName:     PrefetchLandmark,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tSize:     int64(len([]byte{landmarkContents})),\n\t\t\t},\n\t\t\tpayload: bytes.NewReader([]byte{landmarkContents}),\n\t\t})\n\t}\n\n\t// Dump all entry and concatinate them.\n\treturn append(sorted.dump(), intar.dump()...), nil\n}\n\n// readerFromEntries returns a reader of tar archive that contains entries passed\n// through the arguments.\nfunc readerFromEntries(entries ...*entry) io.Reader {\n\tpr, pw := io.Pipe()\n\tgo func() {\n\t\ttw := tar.NewWriter(pw)\n\t\tdefer tw.Close()\n\t\tfor _, entry := range entries {\n\t\t\tif err := tw.WriteHeader(entry.header); err != nil {\n\t\t\t\tpw.CloseWithError(fmt.Errorf(\"Failed to write tar header: %v\", err))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif _, err := io.Copy(tw, entry.payload); err != nil {\n\t\t\t\tpw.CloseWithError(fmt.Errorf(\"Failed to write tar payload: %v\", err))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tpw.Close()\n\t}()\n\treturn pr\n}\n\nfunc importTar(in io.ReaderAt) (*tarFile, error) {\n\ttf := &tarFile{}\n\tpw, err := newCountReadSeeker(in)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to make position watcher: %w\", err)\n\t}\n\ttr := tar.NewReader(pw)\n\n\t// Walk through all nodes.\n\tfor {\n\t\t// Fetch and parse next header.\n\t\th, err := tr.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to parse tar file, %w\", err)\n\t\t}\n\t\tswitch cleanEntryName(h.Name) {\n\t\tcase PrefetchLandmark, NoPrefetchLandmark:\n\t\t\t// Ignore existing landmark\n\t\t\tcontinue\n\t\t}\n\n\t\t// Add entry. If it already exists, replace it.\n\t\tif _, ok := tf.get(h.Name); ok {\n\t\t\ttf.remove(h.Name)\n\t\t}\n\t\ttf.add(&entry{\n\t\t\theader:  h,\n\t\t\tpayload: io.NewSectionReader(in, pw.currentPos(), h.Size),\n\t\t})\n\t}\n\n\treturn tf, nil\n}\n\nfunc moveRec(name string, in *tarFile, out *tarFile) error {\n\tname = cleanEntryName(name)\n\tif name == \"\" { // root directory. stop recursion.\n\t\tif e, ok := in.get(name); ok {\n\t\t\t// entry of the root directory exists. we should move it as well.\n\t\t\t// this case will occur if tar entries are prefixed with \"./\", \"/\", etc.\n\t\t\tout.add(e)\n\t\t\tin.remove(name)\n\t\t}\n\t\treturn nil\n\t}\n\n\t_, okIn := in.get(name)\n\t_, okOut := out.get(name)\n\tif !okIn && !okOut {\n\t\treturn fmt.Errorf(\"file: %q: %w\", name, errNotFound)\n\t}\n\n\tparent, _ := path.Split(strings.TrimSuffix(name, \"/\"))\n\tif err := moveRec(parent, in, out); err != nil {\n\t\treturn err\n\t}\n\tif e, ok := in.get(name); ok && e.header.Typeflag == tar.TypeLink {\n\t\tif err := moveRec(e.header.Linkname, in, out); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif e, ok := in.get(name); ok {\n\t\tout.add(e)\n\t\tin.remove(name)\n\t}\n\treturn nil\n}\n\ntype entry struct {\n\theader  *tar.Header\n\tpayload io.ReadSeeker\n}\n\ntype tarFile struct {\n\tindex  map[string]*entry\n\tstream []*entry\n}\n\nfunc (f *tarFile) add(e *entry) {\n\tif f.index == nil {\n\t\tf.index = make(map[string]*entry)\n\t}\n\tf.index[cleanEntryName(e.header.Name)] = e\n\tf.stream = append(f.stream, e)\n}\n\nfunc (f *tarFile) remove(name string) {\n\tname = cleanEntryName(name)\n\tif f.index != nil {\n\t\tdelete(f.index, name)\n\t}\n\tvar filtered []*entry\n\tfor _, e := range f.stream {\n\t\tif cleanEntryName(e.header.Name) == name {\n\t\t\tcontinue\n\t\t}\n\t\tfiltered = append(filtered, e)\n\t}\n\tf.stream = filtered\n}\n\nfunc (f *tarFile) get(name string) (e *entry, ok bool) {\n\tif f.index == nil {\n\t\treturn nil, false\n\t}\n\te, ok = f.index[cleanEntryName(name)]\n\treturn\n}\n\nfunc (f *tarFile) dump() []*entry {\n\treturn f.stream\n}\n\ntype readCloser struct {\n\tio.Reader\n\tcloseFunc func() error\n}\n\nfunc (rc readCloser) Close() error {\n\treturn rc.closeFunc()\n}\n\nfunc fileSectionReader(file *os.File) (*io.SectionReader, error) {\n\tinfo, err := file.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn io.NewSectionReader(file, 0, info.Size()), nil\n}\n\nfunc newTempFiles() *tempFiles {\n\treturn &tempFiles{}\n}\n\ntype tempFiles struct {\n\tfiles       []*os.File\n\tfilesMu     sync.Mutex\n\tcleanupOnce sync.Once\n}\n\nfunc (tf *tempFiles) TempFile(dir, pattern string) (*os.File, error) {\n\tf, err := os.CreateTemp(dir, pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttf.filesMu.Lock()\n\ttf.files = append(tf.files, f)\n\ttf.filesMu.Unlock()\n\treturn f, nil\n}\n\nfunc (tf *tempFiles) CleanupAll() (err error) {\n\ttf.cleanupOnce.Do(func() {\n\t\terr = tf.cleanupAll()\n\t})\n\treturn\n}\n\nfunc (tf *tempFiles) cleanupAll() error {\n\ttf.filesMu.Lock()\n\tdefer tf.filesMu.Unlock()\n\tvar allErr []error\n\tfor _, f := range tf.files {\n\t\tif err := f.Close(); err != nil {\n\t\t\tallErr = append(allErr, err)\n\t\t}\n\t\tif err := os.Remove(f.Name()); err != nil {\n\t\t\tallErr = append(allErr, err)\n\t\t}\n\t}\n\ttf.files = nil\n\treturn errorutil.Aggregate(allErr)\n}\n\nfunc newCountReadSeeker(r io.ReaderAt) (*countReadSeeker, error) {\n\tpos := int64(0)\n\treturn &countReadSeeker{r: r, cPos: &pos}, nil\n}\n\ntype countReadSeeker struct {\n\tr    io.ReaderAt\n\tcPos *int64\n\n\tmu sync.Mutex\n}\n\nfunc (cr *countReadSeeker) Read(p []byte) (int, error) {\n\tcr.mu.Lock()\n\tdefer cr.mu.Unlock()\n\n\tn, err := cr.r.ReadAt(p, *cr.cPos)\n\tif err == nil {\n\t\t*cr.cPos += int64(n)\n\t}\n\treturn n, err\n}\n\nfunc (cr *countReadSeeker) Seek(offset int64, whence int) (int64, error) {\n\tcr.mu.Lock()\n\tdefer cr.mu.Unlock()\n\n\tswitch whence {\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"Unknown whence: %v\", whence)\n\tcase io.SeekStart:\n\tcase io.SeekCurrent:\n\t\toffset += *cr.cPos\n\tcase io.SeekEnd:\n\t\treturn 0, fmt.Errorf(\"Unsupported whence: %v\", whence)\n\t}\n\n\tif offset < 0 {\n\t\treturn 0, fmt.Errorf(\"invalid offset\")\n\t}\n\t*cr.cPos = offset\n\treturn offset, nil\n}\n\nfunc (cr *countReadSeeker) currentPos() int64 {\n\tcr.mu.Lock()\n\tdefer cr.mu.Unlock()\n\n\treturn *cr.cPos\n}\n\nfunc decompressBlob(org *io.SectionReader, tmp *tempFiles) (*io.SectionReader, error) {\n\tif org.Size() < 4 {\n\t\treturn org, nil\n\t}\n\tsrc := make([]byte, 4)\n\tif _, err := org.Read(src); err != nil && err != io.EOF {\n\t\treturn nil, err\n\t}\n\tvar dR io.Reader\n\tif bytes.Equal([]byte{0x1F, 0x8B, 0x08}, src[:3]) {\n\t\t// gzip\n\t\tdgR, err := gzip.NewReader(io.NewSectionReader(org, 0, org.Size()))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer dgR.Close()\n\t\tdR = io.Reader(dgR)\n\t} else if bytes.Equal([]byte{0x28, 0xb5, 0x2f, 0xfd}, src[:4]) {\n\t\t// zstd\n\t\tdzR, err := zstd.NewReader(io.NewSectionReader(org, 0, org.Size()))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer dzR.Close()\n\t\tdR = io.Reader(dzR)\n\t} else {\n\t\t// uncompressed\n\t\treturn io.NewSectionReader(org, 0, org.Size()), nil\n\t}\n\tb, err := tmp.TempFile(\"\", \"uncompresseddata\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := io.Copy(b, dR); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fileSectionReader(b)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage errorutil\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Aggregate combines a list of errors into a single new error.\nfunc Aggregate(errs []error) error {\n\tswitch len(errs) {\n\tcase 0:\n\t\treturn nil\n\tcase 1:\n\t\treturn errs[0]\n\tdefault:\n\t\tpoints := make([]string, len(errs)+1)\n\t\tpoints[0] = fmt.Sprintf(\"%d error(s) occurred:\", len(errs))\n\t\tfor i, err := range errs {\n\t\t\tpoints[i+1] = fmt.Sprintf(\"* %s\", err)\n\t\t}\n\t\treturn errors.New(strings.Join(points, \"\\n\\t\"))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   Copyright 2019 The Go Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.\n*/\n\npackage estargz\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"crypto/sha256\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/containerd/stargz-snapshotter/estargz/errorutil\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\t\"github.com/vbatts/tar-split/archive/tar\"\n)\n\n// A Reader permits random access reads from a stargz file.\ntype Reader struct {\n\tsr        *io.SectionReader\n\ttoc       *JTOC\n\ttocDigest digest.Digest\n\n\t// m stores all non-chunk entries, keyed by name.\n\tm map[string]*TOCEntry\n\n\t// chunks stores all TOCEntry values for regular files that\n\t// are split up. For a file with a single chunk, it's only\n\t// stored in m.\n\tchunks map[string][]*TOCEntry\n\n\tdecompressor Decompressor\n}\n\ntype openOpts struct {\n\ttocOffset     int64\n\tdecompressors []Decompressor\n\ttelemetry     *Telemetry\n}\n\n// OpenOption is an option used during opening the layer\ntype OpenOption func(o *openOpts) error\n\n// WithTOCOffset option specifies the offset of TOC\nfunc WithTOCOffset(tocOffset int64) OpenOption {\n\treturn func(o *openOpts) error {\n\t\to.tocOffset = tocOffset\n\t\treturn nil\n\t}\n}\n\n// WithDecompressors option specifies decompressors to use.\n// Default is gzip-based decompressor.\nfunc WithDecompressors(decompressors ...Decompressor) OpenOption {\n\treturn func(o *openOpts) error {\n\t\to.decompressors = decompressors\n\t\treturn nil\n\t}\n}\n\n// WithTelemetry option specifies the telemetry hooks\nfunc WithTelemetry(telemetry *Telemetry) OpenOption {\n\treturn func(o *openOpts) error {\n\t\to.telemetry = telemetry\n\t\treturn nil\n\t}\n}\n\n// MeasureLatencyHook is a func which takes start time and records the diff\ntype MeasureLatencyHook func(time.Time)\n\n// Telemetry is a struct which defines telemetry hooks. By implementing these hooks you should be able to record\n// the latency metrics of the respective steps of estargz open operation. To be used with estargz.OpenWithTelemetry(...)\ntype Telemetry struct {\n\tGetFooterLatency      MeasureLatencyHook // measure time to get stargz footer (in milliseconds)\n\tGetTocLatency         MeasureLatencyHook // measure time to GET TOC JSON (in milliseconds)\n\tDeserializeTocLatency MeasureLatencyHook // measure time to deserialize TOC JSON (in milliseconds)\n}\n\n// Open opens a stargz file for reading.\n// The behavior is configurable using options.\n//\n// Note that each entry name is normalized as the path that is relative to root.\nfunc Open(sr *io.SectionReader, opt ...OpenOption) (*Reader, error) {\n\tvar opts openOpts\n\tfor _, o := range opt {\n\t\tif err := o(&opts); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tgzipCompressors := []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)}\n\tdecompressors := append(gzipCompressors, opts.decompressors...)\n\n\t// Determine the size to fetch. Try to fetch as many bytes as possible.\n\tfetchSize := maxFooterSize(sr.Size(), decompressors...)\n\tif maybeTocOffset := opts.tocOffset; maybeTocOffset > fetchSize {\n\t\tif maybeTocOffset > sr.Size() {\n\t\t\treturn nil, fmt.Errorf(\"blob size %d is smaller than the toc offset\", sr.Size())\n\t\t}\n\t\tfetchSize = sr.Size() - maybeTocOffset\n\t}\n\n\tstart := time.Now() // before getting layer footer\n\tfooter := make([]byte, fetchSize)\n\tif _, err := sr.ReadAt(footer, sr.Size()-fetchSize); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading footer: %v\", err)\n\t}\n\tif opts.telemetry != nil && opts.telemetry.GetFooterLatency != nil {\n\t\topts.telemetry.GetFooterLatency(start)\n\t}\n\n\tvar allErr []error\n\tvar found bool\n\tvar r *Reader\n\tfor _, d := range decompressors {\n\t\tfSize := d.FooterSize()\n\t\tfOffset := positive(int64(len(footer)) - fSize)\n\t\tmaybeTocBytes := footer[:fOffset]\n\t\t_, tocOffset, tocSize, err := d.ParseFooter(footer[fOffset:])\n\t\tif err != nil {\n\t\t\tallErr = append(allErr, err)\n\t\t\tcontinue\n\t\t}\n\t\tif tocOffset >= 0 && tocSize <= 0 {\n\t\t\ttocSize = sr.Size() - tocOffset - fSize\n\t\t}\n\t\tif tocOffset >= 0 && tocSize < int64(len(maybeTocBytes)) {\n\t\t\tmaybeTocBytes = maybeTocBytes[:tocSize]\n\t\t}\n\t\tr, err = parseTOC(d, sr, tocOffset, tocSize, maybeTocBytes, opts)\n\t\tif err == nil {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t\tallErr = append(allErr, err)\n\t}\n\tif !found {\n\t\treturn nil, errorutil.Aggregate(allErr)\n\t}\n\tif err := r.initFields(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to initialize fields of entries: %v\", err)\n\t}\n\treturn r, nil\n}\n\n// OpenFooter extracts and parses footer from the given blob.\n// only supports gzip-based eStargz.\nfunc OpenFooter(sr *io.SectionReader) (tocOffset int64, footerSize int64, rErr error) {\n\tif sr.Size() < FooterSize && sr.Size() < legacyFooterSize {\n\t\treturn 0, 0, fmt.Errorf(\"blob size %d is smaller than the footer size\", sr.Size())\n\t}\n\tvar footer [FooterSize]byte\n\tif _, err := sr.ReadAt(footer[:], sr.Size()-FooterSize); err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"error reading footer: %v\", err)\n\t}\n\tvar allErr []error\n\tfor _, d := range []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)} {\n\t\tfSize := d.FooterSize()\n\t\tfOffset := positive(int64(len(footer)) - fSize)\n\t\t_, tocOffset, _, err := d.ParseFooter(footer[fOffset:])\n\t\tif err == nil {\n\t\t\treturn tocOffset, fSize, err\n\t\t}\n\t\tallErr = append(allErr, err)\n\t}\n\treturn 0, 0, errorutil.Aggregate(allErr)\n}\n\n// initFields populates the Reader from r.toc after decoding it from\n// JSON.\n//\n// Unexported fields are populated and TOCEntry fields that were\n// implicit in the JSON are populated.\nfunc (r *Reader) initFields() error {\n\tr.m = make(map[string]*TOCEntry, len(r.toc.Entries))\n\tr.chunks = make(map[string][]*TOCEntry)\n\tvar lastPath string\n\tuname := map[int]string{}\n\tgname := map[int]string{}\n\tvar lastRegEnt *TOCEntry\n\tvar chunkTopIndex int\n\tfor i, ent := range r.toc.Entries {\n\t\tent.Name = cleanEntryName(ent.Name)\n\t\tswitch ent.Type {\n\t\tcase \"reg\", \"chunk\":\n\t\t\tif ent.Offset != r.toc.Entries[chunkTopIndex].Offset {\n\t\t\t\tchunkTopIndex = i\n\t\t\t}\n\t\t\tent.chunkTopIndex = chunkTopIndex\n\t\t}\n\t\tif ent.Type == \"reg\" {\n\t\t\tlastRegEnt = ent\n\t\t}\n\t\tif ent.Type == \"chunk\" {\n\t\t\tent.Name = lastPath\n\t\t\tr.chunks[ent.Name] = append(r.chunks[ent.Name], ent)\n\t\t\tif ent.ChunkSize == 0 && lastRegEnt != nil {\n\t\t\t\tent.ChunkSize = lastRegEnt.Size - ent.ChunkOffset\n\t\t\t}\n\t\t} else {\n\t\t\tlastPath = ent.Name\n\n\t\t\tif ent.Uname != \"\" {\n\t\t\t\tuname[ent.UID] = ent.Uname\n\t\t\t} else {\n\t\t\t\tent.Uname = uname[ent.UID]\n\t\t\t}\n\t\t\tif ent.Gname != \"\" {\n\t\t\t\tgname[ent.GID] = ent.Gname\n\t\t\t} else {\n\t\t\t\tent.Gname = uname[ent.GID]\n\t\t\t}\n\n\t\t\tent.modTime, _ = time.Parse(time.RFC3339, ent.ModTime3339)\n\n\t\t\tif ent.Type == \"dir\" {\n\t\t\t\tent.NumLink++ // Parent dir links to this directory\n\t\t\t}\n\t\t\tr.m[ent.Name] = ent\n\t\t}\n\t\tif ent.Type == \"reg\" && ent.ChunkSize > 0 && ent.ChunkSize < ent.Size {\n\t\t\tr.chunks[ent.Name] = make([]*TOCEntry, 0, ent.Size/ent.ChunkSize+1)\n\t\t\tr.chunks[ent.Name] = append(r.chunks[ent.Name], ent)\n\t\t}\n\t\tif ent.ChunkSize == 0 && ent.Size != 0 {\n\t\t\tent.ChunkSize = ent.Size\n\t\t}\n\t}\n\n\t// Populate children, add implicit directories:\n\tfor _, ent := range r.toc.Entries {\n\t\tif ent.Type == \"chunk\" {\n\t\t\tcontinue\n\t\t}\n\t\t// add \"foo/\":\n\t\t//    add \"foo\" child to \"\" (creating \"\" if necessary)\n\t\t//\n\t\t// add \"foo/bar/\":\n\t\t//    add \"bar\" child to \"foo\" (creating \"foo\" if necessary)\n\t\t//\n\t\t// add \"foo/bar.txt\":\n\t\t//    add \"bar.txt\" child to \"foo\" (creating \"foo\" if necessary)\n\t\t//\n\t\t// add \"a/b/c/d/e/f.txt\":\n\t\t//    create \"a/b/c/d/e\" node\n\t\t//    add \"f.txt\" child to \"e\"\n\n\t\tname := ent.Name\n\t\tpdirName := parentDir(name)\n\t\tif name == pdirName {\n\t\t\t// This entry and its parent are the same.\n\t\t\t// Ignore this for avoiding infinite loop of the reference.\n\t\t\t// The example case where this can occur is when tar contains the root\n\t\t\t// directory itself (e.g. \"./\", \"/\").\n\t\t\tcontinue\n\t\t}\n\t\tpdir := r.getOrCreateDir(pdirName)\n\t\tent.NumLink++ // at least one name(ent.Name) references this entry.\n\t\tif ent.Type == \"hardlink\" {\n\t\t\torg, err := r.getSource(ent)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\torg.NumLink++ // original entry is referenced by this ent.Name.\n\t\t\tent = org\n\t\t}\n\t\tpdir.addChild(path.Base(name), ent)\n\t}\n\n\tlastOffset := r.sr.Size()\n\tfor i := len(r.toc.Entries) - 1; i >= 0; i-- {\n\t\te := r.toc.Entries[i]\n\t\tif e.isDataType() {\n\t\t\te.nextOffset = lastOffset\n\t\t}\n\t\tif e.Offset != 0 && e.InnerOffset == 0 {\n\t\t\tlastOffset = e.Offset\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (r *Reader) getSource(ent *TOCEntry) (_ *TOCEntry, err error) {\n\tif ent.Type == \"hardlink\" {\n\t\torg, ok := r.m[cleanEntryName(ent.LinkName)]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"%q is a hardlink but the linkname %q isn't found\", ent.Name, ent.LinkName)\n\t\t}\n\t\tent, err = r.getSource(org)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn ent, nil\n}\n\nfunc parentDir(p string) string {\n\tdir, _ := path.Split(p)\n\treturn strings.TrimSuffix(dir, \"/\")\n}\n\nfunc (r *Reader) getOrCreateDir(d string) *TOCEntry {\n\te, ok := r.m[d]\n\tif !ok {\n\t\te = &TOCEntry{\n\t\t\tName:    d,\n\t\t\tType:    \"dir\",\n\t\t\tMode:    0755,\n\t\t\tNumLink: 2, // The directory itself(.) and the parent link to this directory.\n\t\t}\n\t\tr.m[d] = e\n\t\tif d != \"\" {\n\t\t\tpdir := r.getOrCreateDir(parentDir(d))\n\t\t\tpdir.addChild(path.Base(d), e)\n\t\t}\n\t}\n\treturn e\n}\n\nfunc (r *Reader) TOCDigest() digest.Digest {\n\treturn r.tocDigest\n}\n\n// VerifyTOC checks that the TOC JSON in the passed blob matches the\n// passed digests and that the TOC JSON contains digests for all chunks\n// contained in the blob. If the verification succceeds, this function\n// returns TOCEntryVerifier which holds all chunk digests in the stargz blob.\nfunc (r *Reader) VerifyTOC(tocDigest digest.Digest) (TOCEntryVerifier, error) {\n\t// Verify the digest of TOC JSON\n\tif r.tocDigest != tocDigest {\n\t\treturn nil, fmt.Errorf(\"invalid TOC JSON %q; want %q\", r.tocDigest, tocDigest)\n\t}\n\treturn r.Verifiers()\n}\n\n// Verifiers returns TOCEntryVerifier of this chunk. Use VerifyTOC instead in most cases\n// because this doesn't verify TOC.\nfunc (r *Reader) Verifiers() (TOCEntryVerifier, error) {\n\tchunkDigestMap := make(map[int64]digest.Digest) // map from chunk offset to the chunk digest\n\tregDigestMap := make(map[int64]digest.Digest)   // map from chunk offset to the reg file digest\n\tvar chunkDigestMapIncomplete bool\n\tvar regDigestMapIncomplete bool\n\tvar containsChunk bool\n\tfor _, e := range r.toc.Entries {\n\t\tif e.Type != \"reg\" && e.Type != \"chunk\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// offset must be unique in stargz blob\n\t\t_, dOK := chunkDigestMap[e.Offset]\n\t\t_, rOK := regDigestMap[e.Offset]\n\t\tif dOK || rOK {\n\t\t\treturn nil, fmt.Errorf(\"offset %d found twice\", e.Offset)\n\t\t}\n\n\t\tif e.Type == \"reg\" {\n\t\t\tif e.Size == 0 {\n\t\t\t\tcontinue // ignores empty file\n\t\t\t}\n\n\t\t\t// record the digest of regular file payload\n\t\t\tif e.Digest != \"\" {\n\t\t\t\td, err := digest.Parse(e.Digest)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to parse regular file digest %q: %w\", e.Digest, err)\n\t\t\t\t}\n\t\t\t\tregDigestMap[e.Offset] = d\n\t\t\t} else {\n\t\t\t\tregDigestMapIncomplete = true\n\t\t\t}\n\t\t} else {\n\t\t\tcontainsChunk = true // this layer contains \"chunk\" entries.\n\t\t}\n\n\t\t// \"reg\" also can contain ChunkDigest (e.g. when \"reg\" is the first entry of\n\t\t// chunked file)\n\t\tif e.ChunkDigest != \"\" {\n\t\t\td, err := digest.Parse(e.ChunkDigest)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to parse chunk digest %q: %w\", e.ChunkDigest, err)\n\t\t\t}\n\t\t\tchunkDigestMap[e.Offset] = d\n\t\t} else {\n\t\t\tchunkDigestMapIncomplete = true\n\t\t}\n\t}\n\n\tif chunkDigestMapIncomplete {\n\t\t// Though some chunk digests are not found, if this layer doesn't contain\n\t\t// \"chunk\"s and all digest of \"reg\" files are recorded, we can use them instead.\n\t\tif !containsChunk && !regDigestMapIncomplete {\n\t\t\treturn &verifier{digestMap: regDigestMap}, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"some ChunkDigest not found in TOC JSON\")\n\t}\n\n\treturn &verifier{digestMap: chunkDigestMap}, nil\n}\n\n// verifier is an implementation of TOCEntryVerifier which holds verifiers keyed by\n// offset of the chunk.\ntype verifier struct {\n\tdigestMap   map[int64]digest.Digest\n\tdigestMapMu sync.Mutex\n}\n\n// Verifier returns a content verifier specified by TOCEntry.\nfunc (v *verifier) Verifier(ce *TOCEntry) (digest.Verifier, error) {\n\tv.digestMapMu.Lock()\n\tdefer v.digestMapMu.Unlock()\n\td, ok := v.digestMap[ce.Offset]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"verifier for offset=%d,size=%d hasn't been registered\",\n\t\t\tce.Offset, ce.ChunkSize)\n\t}\n\treturn d.Verifier(), nil\n}\n\n// ChunkEntryForOffset returns the TOCEntry containing the byte of the\n// named file at the given offset within the file.\n// Name must be absolute path or one that is relative to root.\nfunc (r *Reader) ChunkEntryForOffset(name string, offset int64) (e *TOCEntry, ok bool) {\n\tname = cleanEntryName(name)\n\te, ok = r.Lookup(name)\n\tif !ok || !e.isDataType() {\n\t\treturn nil, false\n\t}\n\tents := r.chunks[name]\n\tif len(ents) < 2 {\n\t\tif offset >= e.ChunkSize {\n\t\t\treturn nil, false\n\t\t}\n\t\treturn e, true\n\t}\n\ti := sort.Search(len(ents), func(i int) bool {\n\t\te := ents[i]\n\t\treturn e.ChunkOffset >= offset || (offset > e.ChunkOffset && offset < e.ChunkOffset+e.ChunkSize)\n\t})\n\tif i == len(ents) {\n\t\treturn nil, false\n\t}\n\treturn ents[i], true\n}\n\n// Lookup returns the Table of Contents entry for the given path.\n//\n// To get the root directory, use the empty string.\n// Path must be absolute path or one that is relative to root.\nfunc (r *Reader) Lookup(path string) (e *TOCEntry, ok bool) {\n\tpath = cleanEntryName(path)\n\tif r == nil {\n\t\treturn\n\t}\n\te, ok = r.m[path]\n\tif ok && e.Type == \"hardlink\" {\n\t\tvar err error\n\t\te, err = r.getSource(e)\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t}\n\treturn\n}\n\n// OpenFile returns the reader of the specified file payload.\n//\n// Name must be absolute path or one that is relative to root.\nfunc (r *Reader) OpenFile(name string) (*io.SectionReader, error) {\n\tfr, err := r.newFileReader(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn io.NewSectionReader(fr, 0, fr.size), nil\n}\n\nfunc (r *Reader) newFileReader(name string) (*fileReader, error) {\n\tname = cleanEntryName(name)\n\tent, ok := r.Lookup(name)\n\tif !ok {\n\t\t// TODO: come up with some error plan. This is lazy:\n\t\treturn nil, &os.PathError{\n\t\t\tPath: name,\n\t\t\tOp:   \"OpenFile\",\n\t\t\tErr:  os.ErrNotExist,\n\t\t}\n\t}\n\tif ent.Type != \"reg\" {\n\t\treturn nil, &os.PathError{\n\t\t\tPath: name,\n\t\t\tOp:   \"OpenFile\",\n\t\t\tErr:  errors.New(\"not a regular file\"),\n\t\t}\n\t}\n\treturn &fileReader{\n\t\tr:    r,\n\t\tsize: ent.Size,\n\t\tents: r.getChunks(ent),\n\t}, nil\n}\n\nfunc (r *Reader) OpenFileWithPreReader(name string, preRead func(*TOCEntry, io.Reader) error) (*io.SectionReader, error) {\n\tfr, err := r.newFileReader(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfr.preRead = preRead\n\treturn io.NewSectionReader(fr, 0, fr.size), nil\n}\n\nfunc (r *Reader) getChunks(ent *TOCEntry) []*TOCEntry {\n\tif ents, ok := r.chunks[ent.Name]; ok {\n\t\treturn ents\n\t}\n\treturn []*TOCEntry{ent}\n}\n\ntype fileReader struct {\n\tr       *Reader\n\tsize    int64\n\tents    []*TOCEntry // 1 or more reg/chunk entries\n\tpreRead func(*TOCEntry, io.Reader) error\n}\n\nfunc (fr *fileReader) ReadAt(p []byte, off int64) (n int, err error) {\n\tif off >= fr.size {\n\t\treturn 0, io.EOF\n\t}\n\tif off < 0 {\n\t\treturn 0, errors.New(\"invalid offset\")\n\t}\n\tvar i int\n\tif len(fr.ents) > 1 {\n\t\ti = sort.Search(len(fr.ents), func(i int) bool {\n\t\t\treturn fr.ents[i].ChunkOffset >= off\n\t\t})\n\t\tif i == len(fr.ents) {\n\t\t\ti = len(fr.ents) - 1\n\t\t}\n\t}\n\tent := fr.ents[i]\n\tif ent.ChunkOffset > off {\n\t\tif i == 0 {\n\t\t\treturn 0, errors.New(\"internal error; first chunk offset is non-zero\")\n\t\t}\n\t\tent = fr.ents[i-1]\n\t}\n\n\t//  If ent is a chunk of a large file, adjust the ReadAt\n\t//  offset by the chunk's offset.\n\toff -= ent.ChunkOffset\n\n\tfinalEnt := fr.ents[len(fr.ents)-1]\n\tcompressedOff := ent.Offset\n\t// compressedBytesRemain is the number of compressed bytes in this\n\t// file remaining, over 1+ chunks.\n\tcompressedBytesRemain := finalEnt.NextOffset() - compressedOff\n\n\tsr := io.NewSectionReader(fr.r.sr, compressedOff, compressedBytesRemain)\n\n\tconst maxRead = 2 << 20\n\tvar bufSize = maxRead\n\tif compressedBytesRemain < maxRead {\n\t\tbufSize = int(compressedBytesRemain)\n\t}\n\n\tbr := bufio.NewReaderSize(sr, bufSize)\n\tif _, err := br.Peek(bufSize); err != nil {\n\t\treturn 0, fmt.Errorf(\"fileReader.ReadAt.peek: %v\", err)\n\t}\n\n\tdr, err := fr.r.decompressor.Reader(br)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"fileReader.ReadAt.decompressor.Reader: %v\", err)\n\t}\n\tdefer dr.Close()\n\n\tif fr.preRead == nil {\n\t\tif n, err := io.CopyN(io.Discard, dr, ent.InnerOffset+off); n != ent.InnerOffset+off || err != nil {\n\t\t\treturn 0, fmt.Errorf(\"discard of %d bytes != %v, %v\", ent.InnerOffset+off, n, err)\n\t\t}\n\t\treturn io.ReadFull(dr, p)\n\t}\n\n\tvar retN int\n\tvar retErr error\n\tvar found bool\n\tvar nr int64\n\tfor _, e := range fr.r.toc.Entries[ent.chunkTopIndex:] {\n\t\tif !e.isDataType() {\n\t\t\tcontinue\n\t\t}\n\t\tif e.Offset != fr.r.toc.Entries[ent.chunkTopIndex].Offset {\n\t\t\tbreak\n\t\t}\n\t\tif in, err := io.CopyN(io.Discard, dr, e.InnerOffset-nr); err != nil || in != e.InnerOffset-nr {\n\t\t\treturn 0, fmt.Errorf(\"discard of remaining %d bytes != %v, %v\", e.InnerOffset-nr, in, err)\n\t\t}\n\t\tnr = e.InnerOffset\n\t\tif e == ent {\n\t\t\tfound = true\n\t\t\tif n, err := io.CopyN(io.Discard, dr, off); n != off || err != nil {\n\t\t\t\treturn 0, fmt.Errorf(\"discard of offset %d bytes != %v, %v\", off, n, err)\n\t\t\t}\n\t\t\tretN, retErr = io.ReadFull(dr, p)\n\t\t\tnr += off + int64(retN)\n\t\t\tcontinue\n\t\t}\n\t\tcr := &countReader{r: io.LimitReader(dr, e.ChunkSize)}\n\t\tif err := fr.preRead(e, cr); err != nil {\n\t\t\treturn 0, fmt.Errorf(\"failed to pre read: %w\", err)\n\t\t}\n\t\tnr += cr.n\n\t}\n\tif !found {\n\t\treturn 0, fmt.Errorf(\"fileReader.ReadAt: target entry not found\")\n\t}\n\treturn retN, retErr\n}\n\n// A Writer writes stargz files.\n//\n// Use NewWriter to create a new Writer.\ntype Writer struct {\n\tbw       *bufio.Writer\n\tcw       *countWriter\n\ttoc      *JTOC\n\tdiffHash hash.Hash // SHA-256 of uncompressed tar\n\n\tclosed        bool\n\tgz            io.WriteCloser\n\tlastUsername  map[int]string\n\tlastGroupname map[int]string\n\tcompressor    Compressor\n\n\tuncompressedCounter *countWriteFlusher\n\n\t// ChunkSize optionally controls the maximum number of bytes\n\t// of data of a regular file that can be written in one gzip\n\t// stream before a new gzip stream is started.\n\t// Zero means to use a default, currently 4 MiB.\n\tChunkSize int\n\n\t// MinChunkSize optionally controls the minimum number of bytes\n\t// of data must be written in one gzip stream before a new gzip\n\t// NOTE: This adds a TOC property that stargz snapshotter < v0.13.0 doesn't understand.\n\tMinChunkSize int\n\n\tneedsOpenGzEntries map[string]struct{}\n}\n\n// currentCompressionWriter writes to the current w.gz field, which can\n// change throughout writing a tar entry.\n//\n// Additionally, it updates w's SHA-256 of the uncompressed bytes\n// of the tar file.\ntype currentCompressionWriter struct{ w *Writer }\n\nfunc (ccw currentCompressionWriter) Write(p []byte) (int, error) {\n\tccw.w.diffHash.Write(p)\n\tif ccw.w.gz == nil {\n\t\tif err := ccw.w.condOpenGz(); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn ccw.w.gz.Write(p)\n}\n\nfunc (w *Writer) chunkSize() int {\n\tif w.ChunkSize <= 0 {\n\t\treturn 4 << 20\n\t}\n\treturn w.ChunkSize\n}\n\n// Unpack decompresses the given estargz blob and returns a ReadCloser of the tar blob.\n// TOC JSON and footer are removed.\nfunc Unpack(sr *io.SectionReader, c Decompressor) (io.ReadCloser, error) {\n\tfooterSize := c.FooterSize()\n\tif sr.Size() < footerSize {\n\t\treturn nil, fmt.Errorf(\"blob is too small; %d < %d\", sr.Size(), footerSize)\n\t}\n\tfooterOffset := sr.Size() - footerSize\n\tfooter := make([]byte, footerSize)\n\tif _, err := sr.ReadAt(footer, footerOffset); err != nil {\n\t\treturn nil, err\n\t}\n\tblobPayloadSize, _, _, err := c.ParseFooter(footer)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse footer: %w\", err)\n\t}\n\tif blobPayloadSize < 0 {\n\t\tblobPayloadSize = sr.Size()\n\t}\n\treturn c.Reader(io.LimitReader(sr, blobPayloadSize))\n}\n\n// NewWriter returns a new stargz writer (gzip-based) writing to w.\n//\n// The writer must be closed to write its trailing table of contents.\nfunc NewWriter(w io.Writer) *Writer {\n\treturn NewWriterLevel(w, gzip.BestCompression)\n}\n\n// NewWriterLevel returns a new stargz writer (gzip-based) writing to w.\n// The compression level is configurable.\n//\n// The writer must be closed to write its trailing table of contents.\nfunc NewWriterLevel(w io.Writer, compressionLevel int) *Writer {\n\treturn NewWriterWithCompressor(w, NewGzipCompressorWithLevel(compressionLevel))\n}\n\n// NewWriterWithCompressor returns a new stargz writer writing to w.\n// The compression method is configurable.\n//\n// The writer must be closed to write its trailing table of contents.\nfunc NewWriterWithCompressor(w io.Writer, c Compressor) *Writer {\n\tbw := bufio.NewWriter(w)\n\tcw := &countWriter{w: bw}\n\treturn &Writer{\n\t\tbw:                  bw,\n\t\tcw:                  cw,\n\t\ttoc:                 &JTOC{Version: 1},\n\t\tdiffHash:            sha256.New(),\n\t\tcompressor:          c,\n\t\tuncompressedCounter: &countWriteFlusher{},\n\t}\n}\n\n// Close writes the stargz's table of contents and flushes all the\n// buffers, returning any error.\nfunc (w *Writer) Close() (digest.Digest, error) {\n\tif w.closed {\n\t\treturn \"\", nil\n\t}\n\tdefer func() { w.closed = true }()\n\n\tif err := w.closeGz(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Write the TOC index and footer.\n\ttocDigest, err := w.compressor.WriteTOCAndFooter(w.cw, w.cw.n, w.toc, w.diffHash)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := w.bw.Flush(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn tocDigest, nil\n}\n\nfunc (w *Writer) closeGz() error {\n\tif w.closed {\n\t\treturn errors.New(\"write on closed Writer\")\n\t}\n\tif w.gz != nil {\n\t\tif err := w.gz.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tw.gz = nil\n\t}\n\treturn nil\n}\n\nfunc (w *Writer) flushGz() error {\n\tif w.closed {\n\t\treturn errors.New(\"flush on closed Writer\")\n\t}\n\tif w.gz != nil {\n\t\tif f, ok := w.gz.(interface {\n\t\t\tFlush() error\n\t\t}); ok {\n\t\t\treturn f.Flush()\n\t\t}\n\t}\n\treturn nil\n}\n\n// nameIfChanged returns name, unless it was the already the value of (*mp)[id],\n// in which case it returns the empty string.\nfunc (w *Writer) nameIfChanged(mp *map[int]string, id int, name string) string {\n\tif name == \"\" {\n\t\treturn \"\"\n\t}\n\tif *mp == nil {\n\t\t*mp = make(map[int]string)\n\t}\n\tif (*mp)[id] == name {\n\t\treturn \"\"\n\t}\n\t(*mp)[id] = name\n\treturn name\n}\n\nfunc (w *Writer) condOpenGz() (err error) {\n\tif w.gz == nil {\n\t\tw.gz, err = w.compressor.Writer(w.cw)\n\t\tif w.gz != nil {\n\t\t\tw.gz = w.uncompressedCounter.register(w.gz)\n\t\t}\n\t}\n\treturn\n}\n\n// AppendTar reads the tar or tar.gz file from r and appends\n// each of its contents to w.\n//\n// The input r can optionally be gzip compressed but the output will\n// always be compressed by the specified compressor.\nfunc (w *Writer) AppendTar(r io.Reader) error {\n\treturn w.appendTar(r, false)\n}\n\n// AppendTarLossLess reads the tar or tar.gz file from r and appends\n// each of its contents to w.\n//\n// The input r can optionally be gzip compressed but the output will\n// always be compressed by the specified compressor.\n//\n// The difference of this func with AppendTar is that this writes\n// the input tar stream into w without any modification (e.g. to header bytes).\n//\n// Note that if the input tar stream already contains TOC JSON, this returns\n// error because w cannot overwrite the TOC JSON to the one generated by w without\n// lossy modification. To avoid this error, if the input stream is known to be stargz/estargz,\n// you shoud decompress it and remove TOC JSON in advance.\nfunc (w *Writer) AppendTarLossLess(r io.Reader) error {\n\treturn w.appendTar(r, true)\n}\n\nfunc (w *Writer) appendTar(r io.Reader, lossless bool) error {\n\tvar src io.Reader\n\tbr := bufio.NewReader(r)\n\tif isGzip(br) {\n\t\tzr, _ := gzip.NewReader(br)\n\t\tsrc = zr\n\t} else {\n\t\tsrc = io.Reader(br)\n\t}\n\tdst := currentCompressionWriter{w}\n\tvar tw *tar.Writer\n\tif !lossless {\n\t\ttw = tar.NewWriter(dst) // use tar writer only when this isn't lossless mode.\n\t}\n\ttr := tar.NewReader(src)\n\tif lossless {\n\t\ttr.RawAccounting = true\n\t}\n\tprevOffset := w.cw.n\n\tvar prevOffsetUncompressed int64\n\tfor {\n\t\th, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tif lossless {\n\t\t\t\tif remain := tr.RawBytes(); len(remain) > 0 {\n\t\t\t\t\t// Collect the remaining null bytes.\n\t\t\t\t\t// https://github.com/vbatts/tar-split/blob/80a436fd6164c557b131f7c59ed69bd81af69761/concept/main.go#L49-L53\n\t\t\t\t\tif _, err := dst.Write(remain); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading from source tar: tar.Reader.Next: %v\", err)\n\t\t}\n\t\tif cleanEntryName(h.Name) == TOCTarName {\n\t\t\t// It is possible for a layer to be \"stargzified\" twice during the\n\t\t\t// distribution lifecycle. So we reserve \"TOCTarName\" here to avoid\n\t\t\t// duplicated entries in the resulting layer.\n\t\t\tif lossless {\n\t\t\t\t// We cannot handle this in lossless way.\n\t\t\t\treturn fmt.Errorf(\"existing TOC JSON is not allowed; decompress layer before append\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\txattrs := make(map[string][]byte)\n\t\tconst xattrPAXRecordsPrefix = \"SCHILY.xattr.\"\n\t\tif h.PAXRecords != nil {\n\t\t\tfor k, v := range h.PAXRecords {\n\t\t\t\tif strings.HasPrefix(k, xattrPAXRecordsPrefix) {\n\t\t\t\t\txattrs[k[len(xattrPAXRecordsPrefix):]] = []byte(v)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tent := &TOCEntry{\n\t\t\tName:        h.Name,\n\t\t\tMode:        h.Mode,\n\t\t\tUID:         h.Uid,\n\t\t\tGID:         h.Gid,\n\t\t\tUname:       w.nameIfChanged(&w.lastUsername, h.Uid, h.Uname),\n\t\t\tGname:       w.nameIfChanged(&w.lastGroupname, h.Gid, h.Gname),\n\t\t\tModTime3339: formatModtime(h.ModTime),\n\t\t\tXattrs:      xattrs,\n\t\t}\n\t\tif err := w.condOpenGz(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif tw != nil {\n\t\t\tif err := tw.WriteHeader(h); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif _, err := dst.Write(tr.RawBytes()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tswitch h.Typeflag {\n\t\tcase tar.TypeLink:\n\t\t\tent.Type = \"hardlink\"\n\t\t\tent.LinkName = h.Linkname\n\t\tcase tar.TypeSymlink:\n\t\t\tent.Type = \"symlink\"\n\t\t\tent.LinkName = h.Linkname\n\t\tcase tar.TypeDir:\n\t\t\tent.Type = \"dir\"\n\t\tcase tar.TypeReg:\n\t\t\tent.Type = \"reg\"\n\t\t\tent.Size = h.Size\n\t\tcase tar.TypeChar:\n\t\t\tent.Type = \"char\"\n\t\t\tent.DevMajor = int(h.Devmajor)\n\t\t\tent.DevMinor = int(h.Devminor)\n\t\tcase tar.TypeBlock:\n\t\t\tent.Type = \"block\"\n\t\t\tent.DevMajor = int(h.Devmajor)\n\t\t\tent.DevMinor = int(h.Devminor)\n\t\tcase tar.TypeFifo:\n\t\t\tent.Type = \"fifo\"\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported input tar entry %q\", h.Typeflag)\n\t\t}\n\n\t\t// We need to keep a reference to the TOC entry for regular files, so that we\n\t\t// can fill the digest later.\n\t\tvar regFileEntry *TOCEntry\n\t\tvar payloadDigest digest.Digester\n\t\tif h.Typeflag == tar.TypeReg {\n\t\t\tregFileEntry = ent\n\t\t\tpayloadDigest = digest.Canonical.Digester()\n\t\t}\n\n\t\tif h.Typeflag == tar.TypeReg && ent.Size > 0 {\n\t\t\tvar written int64\n\t\t\ttotalSize := ent.Size // save it before we destroy ent\n\t\t\ttee := io.TeeReader(tr, payloadDigest.Hash())\n\t\t\tfor written < totalSize {\n\t\t\t\tchunkSize := int64(w.chunkSize())\n\t\t\t\tremain := totalSize - written\n\t\t\t\tif remain < chunkSize {\n\t\t\t\t\tchunkSize = remain\n\t\t\t\t} else {\n\t\t\t\t\tent.ChunkSize = chunkSize\n\t\t\t\t}\n\n\t\t\t\t// We flush the underlying compression writer here to correctly calculate \"w.cw.n\".\n\t\t\t\tif err := w.flushGz(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif w.needsOpenGz(ent) || w.cw.n-prevOffset >= int64(w.MinChunkSize) {\n\t\t\t\t\tif err := w.closeGz(); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tent.Offset = w.cw.n\n\t\t\t\t\tprevOffset = ent.Offset\n\t\t\t\t\tprevOffsetUncompressed = w.uncompressedCounter.n\n\t\t\t\t} else {\n\t\t\t\t\tent.Offset = prevOffset\n\t\t\t\t\tent.InnerOffset = w.uncompressedCounter.n - prevOffsetUncompressed\n\t\t\t\t}\n\n\t\t\t\tent.ChunkOffset = written\n\t\t\t\tchunkDigest := digest.Canonical.Digester()\n\n\t\t\t\tif err := w.condOpenGz(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tteeChunk := io.TeeReader(tee, chunkDigest.Hash())\n\t\t\t\tvar out io.Writer\n\t\t\t\tif tw != nil {\n\t\t\t\t\tout = tw\n\t\t\t\t} else {\n\t\t\t\t\tout = dst\n\t\t\t\t}\n\t\t\t\tif _, err := io.CopyN(out, teeChunk, chunkSize); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error copying %q: %v\", h.Name, err)\n\t\t\t\t}\n\t\t\t\tent.ChunkDigest = chunkDigest.Digest().String()\n\t\t\t\tw.toc.Entries = append(w.toc.Entries, ent)\n\t\t\t\twritten += chunkSize\n\t\t\t\tent = &TOCEntry{\n\t\t\t\t\tName: h.Name,\n\t\t\t\t\tType: \"chunk\",\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tw.toc.Entries = append(w.toc.Entries, ent)\n\t\t}\n\t\tif payloadDigest != nil {\n\t\t\tregFileEntry.Digest = payloadDigest.Digest().String()\n\t\t}\n\t\tif tw != nil {\n\t\t\tif err := tw.Flush(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tremainDest := io.Discard\n\tif lossless {\n\t\tremainDest = dst // Preserve the remaining bytes in lossless mode\n\t}\n\t_, err := io.Copy(remainDest, src)\n\treturn err\n}\n\nfunc (w *Writer) needsOpenGz(ent *TOCEntry) bool {\n\tif ent.Type != \"reg\" {\n\t\treturn false\n\t}\n\tif w.needsOpenGzEntries == nil {\n\t\treturn false\n\t}\n\t_, ok := w.needsOpenGzEntries[ent.Name]\n\treturn ok\n}\n\n// DiffID returns the SHA-256 of the uncompressed tar bytes.\n// It is only valid to call DiffID after Close.\nfunc (w *Writer) DiffID() string {\n\treturn fmt.Sprintf(\"sha256:%x\", w.diffHash.Sum(nil))\n}\n\nfunc maxFooterSize(blobSize int64, decompressors ...Decompressor) (res int64) {\n\tfor _, d := range decompressors {\n\t\tif s := d.FooterSize(); res < s && s <= blobSize {\n\t\t\tres = s\n\t\t}\n\t}\n\treturn\n}\n\nfunc parseTOC(d Decompressor, sr *io.SectionReader, tocOff, tocSize int64, tocBytes []byte, opts openOpts) (*Reader, error) {\n\tif tocOff < 0 {\n\t\t// This means that TOC isn't contained in the blob.\n\t\t// We pass nil reader to ParseTOC and expect that ParseTOC acquire TOC from\n\t\t// the external location.\n\t\tstart := time.Now()\n\t\ttoc, tocDgst, err := d.ParseTOC(nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif opts.telemetry != nil && opts.telemetry.GetTocLatency != nil {\n\t\t\topts.telemetry.GetTocLatency(start)\n\t\t}\n\t\tif opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil {\n\t\t\topts.telemetry.DeserializeTocLatency(start)\n\t\t}\n\t\treturn &Reader{\n\t\t\tsr:           sr,\n\t\t\ttoc:          toc,\n\t\t\ttocDigest:    tocDgst,\n\t\t\tdecompressor: d,\n\t\t}, nil\n\t}\n\tif len(tocBytes) > 0 {\n\t\tstart := time.Now()\n\t\ttoc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes))\n\t\tif err == nil {\n\t\t\tif opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil {\n\t\t\t\topts.telemetry.DeserializeTocLatency(start)\n\t\t\t}\n\t\t\treturn &Reader{\n\t\t\t\tsr:           sr,\n\t\t\t\ttoc:          toc,\n\t\t\t\ttocDigest:    tocDgst,\n\t\t\t\tdecompressor: d,\n\t\t\t}, nil\n\t\t}\n\t}\n\n\tstart := time.Now()\n\ttocBytes = make([]byte, tocSize)\n\tif _, err := sr.ReadAt(tocBytes, tocOff); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading %d byte TOC targz: %v\", len(tocBytes), err)\n\t}\n\tif opts.telemetry != nil && opts.telemetry.GetTocLatency != nil {\n\t\topts.telemetry.GetTocLatency(start)\n\t}\n\tstart = time.Now()\n\ttoc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil {\n\t\topts.telemetry.DeserializeTocLatency(start)\n\t}\n\treturn &Reader{\n\t\tsr:           sr,\n\t\ttoc:          toc,\n\t\ttocDigest:    tocDgst,\n\t\tdecompressor: d,\n\t}, nil\n}\n\nfunc formatModtime(t time.Time) string {\n\tif t.IsZero() || t.Unix() == 0 {\n\t\treturn \"\"\n\t}\n\treturn t.UTC().Round(time.Second).Format(time.RFC3339)\n}\n\nfunc cleanEntryName(name string) string {\n\t// Use path.Clean to consistently deal with path separators across platforms.\n\treturn strings.TrimPrefix(path.Clean(\"/\"+name), \"/\")\n}\n\n// countWriter counts how many bytes have been written to its wrapped\n// io.Writer.\ntype countWriter struct {\n\tw io.Writer\n\tn int64\n}\n\nfunc (cw *countWriter) Write(p []byte) (n int, err error) {\n\tn, err = cw.w.Write(p)\n\tcw.n += int64(n)\n\treturn\n}\n\ntype countWriteFlusher struct {\n\tio.WriteCloser\n\tn int64\n}\n\nfunc (wc *countWriteFlusher) register(w io.WriteCloser) io.WriteCloser {\n\twc.WriteCloser = w\n\treturn wc\n}\n\nfunc (wc *countWriteFlusher) Write(p []byte) (n int, err error) {\n\tn, err = wc.WriteCloser.Write(p)\n\twc.n += int64(n)\n\treturn\n}\n\nfunc (wc *countWriteFlusher) Flush() error {\n\tif f, ok := wc.WriteCloser.(interface {\n\t\tFlush() error\n\t}); ok {\n\t\treturn f.Flush()\n\t}\n\treturn nil\n}\n\nfunc (wc *countWriteFlusher) Close() error {\n\terr := wc.WriteCloser.Close()\n\twc.WriteCloser = nil\n\treturn err\n}\n\n// isGzip reports whether br is positioned right before an upcoming gzip stream.\n// It does not consume any bytes from br.\nfunc isGzip(br *bufio.Reader) bool {\n\tconst (\n\t\tgzipID1     = 0x1f\n\t\tgzipID2     = 0x8b\n\t\tgzipDeflate = 8\n\t)\n\tpeek, _ := br.Peek(3)\n\treturn len(peek) >= 3 && peek[0] == gzipID1 && peek[1] == gzipID2 && peek[2] == gzipDeflate\n}\n\nfunc positive(n int64) int64 {\n\tif n < 0 {\n\t\treturn 0\n\t}\n\treturn n\n}\n\ntype countReader struct {\n\tr io.Reader\n\tn int64\n}\n\nfunc (cr *countReader) Read(p []byte) (n int, err error) {\n\tn, err = cr.r.Read(p)\n\tcr.n += int64(n)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   Copyright 2019 The Go Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.\n*/\n\npackage estargz\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"encoding/binary\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n\n\tdigest \"github.com/opencontainers/go-digest\"\n)\n\ntype gzipCompression struct {\n\t*GzipCompressor\n\t*GzipDecompressor\n}\n\nfunc newGzipCompressionWithLevel(level int) Compression {\n\treturn &gzipCompression{\n\t\t&GzipCompressor{level},\n\t\t&GzipDecompressor{},\n\t}\n}\n\nfunc NewGzipCompressor() *GzipCompressor {\n\treturn &GzipCompressor{gzip.BestCompression}\n}\n\nfunc NewGzipCompressorWithLevel(level int) *GzipCompressor {\n\treturn &GzipCompressor{level}\n}\n\ntype GzipCompressor struct {\n\tcompressionLevel int\n}\n\nfunc (gc *GzipCompressor) Writer(w io.Writer) (WriteFlushCloser, error) {\n\treturn gzip.NewWriterLevel(w, gc.compressionLevel)\n}\n\nfunc (gc *GzipCompressor) WriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (digest.Digest, error) {\n\ttocJSON, err := json.MarshalIndent(toc, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tgz, _ := gzip.NewWriterLevel(w, gc.compressionLevel)\n\tgw := io.Writer(gz)\n\tif diffHash != nil {\n\t\tgw = io.MultiWriter(gz, diffHash)\n\t}\n\ttw := tar.NewWriter(gw)\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tTypeflag: tar.TypeReg,\n\t\tName:     TOCTarName,\n\t\tSize:     int64(len(tocJSON)),\n\t}); err != nil {\n\t\treturn \"\", err\n\t}\n\tif _, err := tw.Write(tocJSON); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := tw.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := gz.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\tif _, err := w.Write(gzipFooterBytes(off)); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn digest.FromBytes(tocJSON), nil\n}\n\n// gzipFooterBytes returns the 51 bytes footer.\nfunc gzipFooterBytes(tocOff int64) []byte {\n\tbuf := bytes.NewBuffer(make([]byte, 0, FooterSize))\n\tgz, _ := gzip.NewWriterLevel(buf, gzip.NoCompression) // MUST be NoCompression to keep 51 bytes\n\n\t// Extra header indicating the offset of TOCJSON\n\t// https://tools.ietf.org/html/rfc1952#section-2.3.1.1\n\theader := make([]byte, 4)\n\theader[0], header[1] = 'S', 'G'\n\tsubfield := fmt.Sprintf(\"%016xSTARGZ\", tocOff)\n\tbinary.LittleEndian.PutUint16(header[2:4], uint16(len(subfield))) // little-endian per RFC1952\n\tgz.Header.Extra = append(header, []byte(subfield)...)\n\tgz.Close()\n\tif buf.Len() != FooterSize {\n\t\tpanic(fmt.Sprintf(\"footer buffer = %d, not %d\", buf.Len(), FooterSize))\n\t}\n\treturn buf.Bytes()\n}\n\ntype GzipDecompressor struct{}\n\nfunc (gz *GzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) {\n\treturn gzip.NewReader(r)\n}\n\nfunc (gz *GzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) {\n\treturn parseTOCEStargz(r)\n}\n\nfunc (gz *GzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) {\n\tif len(p) != FooterSize {\n\t\treturn 0, 0, 0, fmt.Errorf(\"invalid length %d cannot be parsed\", len(p))\n\t}\n\tzr, err := gzip.NewReader(bytes.NewReader(p))\n\tif err != nil {\n\t\treturn 0, 0, 0, err\n\t}\n\tdefer zr.Close()\n\textra := zr.Header.Extra\n\tsi1, si2, subfieldlen, subfield := extra[0], extra[1], extra[2:4], extra[4:]\n\tif si1 != 'S' || si2 != 'G' {\n\t\treturn 0, 0, 0, fmt.Errorf(\"invalid subfield IDs: %q, %q; want E, S\", si1, si2)\n\t}\n\tif slen := binary.LittleEndian.Uint16(subfieldlen); slen != uint16(16+len(\"STARGZ\")) {\n\t\treturn 0, 0, 0, fmt.Errorf(\"invalid length of subfield %d; want %d\", slen, 16+len(\"STARGZ\"))\n\t}\n\tif string(subfield[16:]) != \"STARGZ\" {\n\t\treturn 0, 0, 0, fmt.Errorf(\"STARGZ magic string must be included in the footer subfield\")\n\t}\n\ttocOffset, err = strconv.ParseInt(string(subfield[:16]), 16, 64)\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: failed to parse toc offset: %w\", err)\n\t}\n\treturn tocOffset, tocOffset, 0, nil\n}\n\nfunc (gz *GzipDecompressor) FooterSize() int64 {\n\treturn FooterSize\n}\n\nfunc (gz *GzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) {\n\treturn decompressTOCEStargz(r)\n}\n\ntype LegacyGzipDecompressor struct{}\n\nfunc (gz *LegacyGzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) {\n\treturn gzip.NewReader(r)\n}\n\nfunc (gz *LegacyGzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) {\n\treturn parseTOCEStargz(r)\n}\n\nfunc (gz *LegacyGzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) {\n\tif len(p) != legacyFooterSize {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: invalid length %d cannot be parsed\", len(p))\n\t}\n\tzr, err := gzip.NewReader(bytes.NewReader(p))\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: failed to get footer gzip reader: %w\", err)\n\t}\n\tdefer zr.Close()\n\textra := zr.Header.Extra\n\tif len(extra) != 16+len(\"STARGZ\") {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: invalid stargz's extra field size\")\n\t}\n\tif string(extra[16:]) != \"STARGZ\" {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: magic string STARGZ not found\")\n\t}\n\ttocOffset, err = strconv.ParseInt(string(extra[:16]), 16, 64)\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"legacy: failed to parse toc offset: %w\", err)\n\t}\n\treturn tocOffset, tocOffset, 0, nil\n}\n\nfunc (gz *LegacyGzipDecompressor) FooterSize() int64 {\n\treturn legacyFooterSize\n}\n\nfunc (gz *LegacyGzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) {\n\treturn decompressTOCEStargz(r)\n}\n\nfunc parseTOCEStargz(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) {\n\ttr, err := decompressTOCEStargz(r)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tdgstr := digest.Canonical.Digester()\n\ttoc = new(JTOC)\n\tif err := json.NewDecoder(io.TeeReader(tr, dgstr.Hash())).Decode(&toc); err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"error decoding TOC JSON: %v\", err)\n\t}\n\tif err := tr.Close(); err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treturn toc, dgstr.Digest(), nil\n}\n\nfunc decompressTOCEStargz(r io.Reader) (tocJSON io.ReadCloser, err error) {\n\tzr, err := gzip.NewReader(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"malformed TOC gzip header: %v\", err)\n\t}\n\tzr.Multistream(false)\n\ttr := tar.NewReader(zr)\n\th, err := tr.Next()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find tar header in TOC gzip stream: %v\", err)\n\t}\n\tif h.Name != TOCTarName {\n\t\treturn nil, fmt.Errorf(\"TOC tar entry had name %q; expected %q\", h.Name, TOCTarName)\n\t}\n\treturn readCloser{tr, zr.Close}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   Copyright 2019 The Go Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.\n*/\n\npackage estargz\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"crypto/rand\"\n\t\"crypto/sha256\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/containerd/stargz-snapshotter/estargz/errorutil\"\n\t\"github.com/klauspost/compress/zstd\"\n\tdigest \"github.com/opencontainers/go-digest\"\n)\n\n// TestingController is Compression with some helper methods necessary for testing.\ntype TestingController interface {\n\tCompression\n\tTestStreams(t *testing.T, b []byte, streams []int64)\n\tDiffIDOf(*testing.T, []byte) string\n\tString() string\n}\n\n// CompressionTestSuite tests this pkg with controllers can build valid eStargz blobs and parse them.\nfunc CompressionTestSuite(t *testing.T, controllers ...TestingControllerFactory) {\n\tt.Run(\"testBuild\", func(t *testing.T) { t.Parallel(); testBuild(t, controllers...) })\n\tt.Run(\"testDigestAndVerify\", func(t *testing.T) { t.Parallel(); testDigestAndVerify(t, controllers...) })\n\tt.Run(\"testWriteAndOpen\", func(t *testing.T) { t.Parallel(); testWriteAndOpen(t, controllers...) })\n}\n\ntype TestingControllerFactory func() TestingController\n\nconst (\n\tuncompressedType int = iota\n\tgzipType\n\tzstdType\n)\n\nvar srcCompressions = []int{\n\tuncompressedType,\n\tgzipType,\n\tzstdType,\n}\n\nvar allowedPrefix = [4]string{\"\", \"./\", \"/\", \"../\"}\n\n// testBuild tests the resulting stargz blob built by this pkg has the same\n// contents as the normal stargz blob.\nfunc testBuild(t *testing.T, controllers ...TestingControllerFactory) {\n\ttests := []struct {\n\t\tname         string\n\t\tchunkSize    int\n\t\tminChunkSize []int\n\t\tin           []tarEntry\n\t}{\n\t\t{\n\t\t\tname:      \"regfiles and directories\",\n\t\t\tchunkSize: 4,\n\t\t\tin: tarOf(\n\t\t\t\tfile(\"foo\", \"test1\"),\n\t\t\t\tdir(\"foo2/\"),\n\t\t\t\tfile(\"foo2/bar\", \"test2\", xAttr(map[string]string{\"test\": \"sample\"})),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:      \"empty files\",\n\t\t\tchunkSize: 4,\n\t\t\tin: tarOf(\n\t\t\t\tfile(\"foo\", \"tttttt\"),\n\t\t\t\tfile(\"foo_empty\", \"\"),\n\t\t\t\tfile(\"foo2\", \"tttttt\"),\n\t\t\t\tfile(\"foo_empty2\", \"\"),\n\t\t\t\tfile(\"foo3\", \"tttttt\"),\n\t\t\t\tfile(\"foo_empty3\", \"\"),\n\t\t\t\tfile(\"foo4\", \"tttttt\"),\n\t\t\t\tfile(\"foo_empty4\", \"\"),\n\t\t\t\tfile(\"foo5\", \"tttttt\"),\n\t\t\t\tfile(\"foo_empty5\", \"\"),\n\t\t\t\tfile(\"foo6\", \"tttttt\"),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:         \"various files\",\n\t\t\tchunkSize:    4,\n\t\t\tminChunkSize: []int{0, 64000},\n\t\t\tin: tarOf(\n\t\t\t\tfile(\"baz.txt\", \"bazbazbazbazbazbazbaz\"),\n\t\t\t\tfile(\"foo1.txt\", \"a\"),\n\t\t\t\tfile(\"bar/foo2.txt\", \"b\"),\n\t\t\t\tfile(\"foo3.txt\", \"c\"),\n\t\t\t\tsymlink(\"barlink\", \"test/bar.txt\"),\n\t\t\t\tdir(\"test/\"),\n\t\t\t\tdir(\"dev/\"),\n\t\t\t\tblockdev(\"dev/testblock\", 3, 4),\n\t\t\t\tfifo(\"dev/testfifo\"),\n\t\t\t\tchardev(\"dev/testchar1\", 5, 6),\n\t\t\t\tfile(\"test/bar.txt\", \"testbartestbar\", xAttr(map[string]string{\"test2\": \"sample2\"})),\n\t\t\t\tdir(\"test2/\"),\n\t\t\t\tlink(\"test2/bazlink\", \"baz.txt\"),\n\t\t\t\tchardev(\"dev/testchar2\", 1, 2),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:      \"no contents\",\n\t\t\tchunkSize: 4,\n\t\t\tin: tarOf(\n\t\t\t\tfile(\"baz.txt\", \"\"),\n\t\t\t\tsymlink(\"barlink\", \"test/bar.txt\"),\n\t\t\t\tdir(\"test/\"),\n\t\t\t\tdir(\"dev/\"),\n\t\t\t\tblockdev(\"dev/testblock\", 3, 4),\n\t\t\t\tfifo(\"dev/testfifo\"),\n\t\t\t\tchardev(\"dev/testchar1\", 5, 6),\n\t\t\t\tfile(\"test/bar.txt\", \"\", xAttr(map[string]string{\"test2\": \"sample2\"})),\n\t\t\t\tdir(\"test2/\"),\n\t\t\t\tlink(\"test2/bazlink\", \"baz.txt\"),\n\t\t\t\tchardev(\"dev/testchar2\", 1, 2),\n\t\t\t),\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tif len(tt.minChunkSize) == 0 {\n\t\t\ttt.minChunkSize = []int{0}\n\t\t}\n\t\tfor _, srcCompression := range srcCompressions {\n\t\t\tsrcCompression := srcCompression\n\t\t\tfor _, newCL := range controllers {\n\t\t\t\tnewCL := newCL\n\t\t\t\tfor _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} {\n\t\t\t\t\tsrcTarFormat := srcTarFormat\n\t\t\t\t\tfor _, prefix := range allowedPrefix {\n\t\t\t\t\t\tprefix := prefix\n\t\t\t\t\t\tfor _, minChunkSize := range tt.minChunkSize {\n\t\t\t\t\t\t\tminChunkSize := minChunkSize\n\t\t\t\t\t\t\tt.Run(tt.name+\"-\"+fmt.Sprintf(\"compression=%v,prefix=%q,src=%d,format=%s,minChunkSize=%d\", newCL(), prefix, srcCompression, srcTarFormat, minChunkSize), func(t *testing.T) {\n\t\t\t\t\t\t\t\ttarBlob := buildTar(t, tt.in, prefix, srcTarFormat)\n\t\t\t\t\t\t\t\t// Test divideEntries()\n\t\t\t\t\t\t\t\tentries, err := sortEntries(tarBlob, nil, nil) // identical order\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to parse tar: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar merged []*entry\n\t\t\t\t\t\t\t\tfor _, part := range divideEntries(entries, 4) {\n\t\t\t\t\t\t\t\t\tmerged = append(merged, part...)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif !reflect.DeepEqual(entries, merged) {\n\t\t\t\t\t\t\t\t\tfor _, e := range entries {\n\t\t\t\t\t\t\t\t\t\tt.Logf(\"Original: %v\", e.header)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor _, e := range merged {\n\t\t\t\t\t\t\t\t\t\tt.Logf(\"Merged: %v\", e.header)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tt.Errorf(\"divided entries couldn't be merged\")\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Prepare sample data\n\t\t\t\t\t\t\t\tcl1 := newCL()\n\t\t\t\t\t\t\t\twantBuf := new(bytes.Buffer)\n\t\t\t\t\t\t\t\tsw := NewWriterWithCompressor(wantBuf, cl1)\n\t\t\t\t\t\t\t\tsw.MinChunkSize = minChunkSize\n\t\t\t\t\t\t\t\tsw.ChunkSize = tt.chunkSize\n\t\t\t\t\t\t\t\tif err := sw.AppendTar(tarBlob); err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to append tar to want stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif _, err := sw.Close(); err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to prepare want stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twantData := wantBuf.Bytes()\n\t\t\t\t\t\t\t\twant, err := Open(io.NewSectionReader(\n\t\t\t\t\t\t\t\t\tbytes.NewReader(wantData), 0, int64(len(wantData))),\n\t\t\t\t\t\t\t\t\tWithDecompressors(cl1),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to parse the want stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Prepare testing data\n\t\t\t\t\t\t\t\tvar opts []Option\n\t\t\t\t\t\t\t\tif minChunkSize > 0 {\n\t\t\t\t\t\t\t\t\topts = append(opts, WithMinChunkSize(minChunkSize))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcl2 := newCL()\n\t\t\t\t\t\t\t\trc, err := Build(compressBlob(t, tarBlob, srcCompression),\n\t\t\t\t\t\t\t\t\tappend(opts, WithChunkSize(tt.chunkSize), WithCompression(cl2))...)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to build stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdefer rc.Close()\n\t\t\t\t\t\t\t\tgotBuf := new(bytes.Buffer)\n\t\t\t\t\t\t\t\tif _, err := io.Copy(gotBuf, rc); err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to copy built stargz blob: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgotData := gotBuf.Bytes()\n\t\t\t\t\t\t\t\tgot, err := Open(io.NewSectionReader(\n\t\t\t\t\t\t\t\t\tbytes.NewReader(gotBuf.Bytes()), 0, int64(len(gotData))),\n\t\t\t\t\t\t\t\t\tWithDecompressors(cl2),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to parse the got stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Check DiffID is properly calculated\n\t\t\t\t\t\t\t\trc.Close()\n\t\t\t\t\t\t\t\tdiffID := rc.DiffID()\n\t\t\t\t\t\t\t\twantDiffID := cl2.DiffIDOf(t, gotData)\n\t\t\t\t\t\t\t\tif diffID.String() != wantDiffID {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"DiffID = %q; want %q\", diffID, wantDiffID)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Compare as stargz\n\t\t\t\t\t\t\t\tif !isSameVersion(t, cl1, wantData, cl2, gotData) {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"built stargz hasn't same json\")\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif !isSameEntries(t, want, got) {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"built stargz isn't same as the original\")\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Compare as tar.gz\n\t\t\t\t\t\t\t\tif !isSameTarGz(t, cl1, wantData, cl2, gotData) {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"built stargz isn't same tar.gz\")\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc isSameTarGz(t *testing.T, cla TestingController, a []byte, clb TestingController, b []byte) bool {\n\taGz, err := cla.Reader(bytes.NewReader(a))\n\tif err != nil {\n\t\tt.Fatalf(\"failed to read A\")\n\t}\n\tdefer aGz.Close()\n\tbGz, err := clb.Reader(bytes.NewReader(b))\n\tif err != nil {\n\t\tt.Fatalf(\"failed to read B\")\n\t}\n\tdefer bGz.Close()\n\n\t// Same as tar's Next() method but ignores landmarks and TOCJSON file\n\tnext := func(r *tar.Reader) (h *tar.Header, err error) {\n\t\tfor {\n\t\t\tif h, err = r.Next(); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif h.Name != PrefetchLandmark &&\n\t\t\t\th.Name != NoPrefetchLandmark &&\n\t\t\t\th.Name != TOCTarName {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\taTar := tar.NewReader(aGz)\n\tbTar := tar.NewReader(bGz)\n\tfor {\n\t\t// Fetch and parse next header.\n\t\taH, aErr := next(aTar)\n\t\tbH, bErr := next(bTar)\n\t\tif aErr != nil || bErr != nil {\n\t\t\tif aErr == io.EOF && bErr == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt.Fatalf(\"Failed to parse tar file: A: %v, B: %v\", aErr, bErr)\n\t\t}\n\t\tif !reflect.DeepEqual(aH, bH) {\n\t\t\tt.Logf(\"different header (A = %v; B = %v)\", aH, bH)\n\t\t\treturn false\n\n\t\t}\n\t\taFile, err := io.ReadAll(aTar)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"failed to read tar payload of A\")\n\t\t}\n\t\tbFile, err := io.ReadAll(bTar)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"failed to read tar payload of B\")\n\t\t}\n\t\tif !bytes.Equal(aFile, bFile) {\n\t\t\tt.Logf(\"different tar payload (A = %q; B = %q)\", string(a), string(b))\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc isSameVersion(t *testing.T, cla TestingController, a []byte, clb TestingController, b []byte) bool {\n\taJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(a), 0, int64(len(a))), cla)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to parse A: %v\", err)\n\t}\n\tbJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), clb)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to parse B: %v\", err)\n\t}\n\tt.Logf(\"A: TOCJSON: %v\", dumpTOCJSON(t, aJTOC))\n\tt.Logf(\"B: TOCJSON: %v\", dumpTOCJSON(t, bJTOC))\n\treturn aJTOC.Version == bJTOC.Version\n}\n\nfunc isSameEntries(t *testing.T, a, b *Reader) bool {\n\taroot, ok := a.Lookup(\"\")\n\tif !ok {\n\t\tt.Fatalf(\"failed to get root of A\")\n\t}\n\tbroot, ok := b.Lookup(\"\")\n\tif !ok {\n\t\tt.Fatalf(\"failed to get root of B\")\n\t}\n\taEntry := stargzEntry{aroot, a}\n\tbEntry := stargzEntry{broot, b}\n\treturn contains(t, aEntry, bEntry) && contains(t, bEntry, aEntry)\n}\n\nfunc compressBlob(t *testing.T, src *io.SectionReader, srcCompression int) *io.SectionReader {\n\tbuf := new(bytes.Buffer)\n\tvar w io.WriteCloser\n\tvar err error\n\tif srcCompression == gzipType {\n\t\tw = gzip.NewWriter(buf)\n\t} else if srcCompression == zstdType {\n\t\tw, err = zstd.NewWriter(buf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to init zstd writer: %v\", err)\n\t\t}\n\t} else {\n\t\treturn src\n\t}\n\tsrc.Seek(0, io.SeekStart)\n\tif _, err := io.Copy(w, src); err != nil {\n\t\tt.Fatalf(\"failed to compress source\")\n\t}\n\tif err := w.Close(); err != nil {\n\t\tt.Fatalf(\"failed to finalize compress source\")\n\t}\n\tdata := buf.Bytes()\n\treturn io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data)))\n\n}\n\ntype stargzEntry struct {\n\te *TOCEntry\n\tr *Reader\n}\n\n// contains checks if all child entries in \"b\" are also contained in \"a\".\n// This function also checks if the files/chunks contain the same contents among \"a\" and \"b\".\nfunc contains(t *testing.T, a, b stargzEntry) bool {\n\tae, ar := a.e, a.r\n\tbe, br := b.e, b.r\n\tt.Logf(\"Comparing: %q vs %q\", ae.Name, be.Name)\n\tif !equalEntry(ae, be) {\n\t\tt.Logf(\"%q != %q: entry: a: %v, b: %v\", ae.Name, be.Name, ae, be)\n\t\treturn false\n\t}\n\tif ae.Type == \"dir\" {\n\t\tt.Logf(\"Directory: %q vs %q: %v vs %v\", ae.Name, be.Name,\n\t\t\tallChildrenName(ae), allChildrenName(be))\n\t\tiscontain := true\n\t\tae.ForeachChild(func(aBaseName string, aChild *TOCEntry) bool {\n\t\t\t// Walk through all files on this stargz file.\n\n\t\t\tif aChild.Name == PrefetchLandmark ||\n\t\t\t\taChild.Name == NoPrefetchLandmark {\n\t\t\t\treturn true // Ignore landmarks\n\t\t\t}\n\n\t\t\t// Ignore a TOCEntry of \"./\" (formated as \"\" by stargz lib) on root directory\n\t\t\t// because this points to the root directory itself.\n\t\t\tif aChild.Name == \"\" && ae.Name == \"\" {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tbChild, ok := be.LookupChild(aBaseName)\n\t\t\tif !ok {\n\t\t\t\tt.Logf(\"%q (base: %q): not found in b: %v\",\n\t\t\t\t\tae.Name, aBaseName, allChildrenName(be))\n\t\t\t\tiscontain = false\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tchildcontain := contains(t, stargzEntry{aChild, a.r}, stargzEntry{bChild, b.r})\n\t\t\tif !childcontain {\n\t\t\t\tt.Logf(\"%q != %q: non-equal dir\", ae.Name, be.Name)\n\t\t\t\tiscontain = false\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t\treturn iscontain\n\t} else if ae.Type == \"reg\" {\n\t\taf, err := ar.OpenFile(ae.Name)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to open file %q on A: %v\", ae.Name, err)\n\t\t}\n\t\tbf, err := br.OpenFile(be.Name)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to open file %q on B: %v\", be.Name, err)\n\t\t}\n\n\t\tvar nr int64\n\t\tfor nr < ae.Size {\n\t\t\tabytes, anext, aok := readOffset(t, af, nr, a)\n\t\t\tbbytes, bnext, bok := readOffset(t, bf, nr, b)\n\t\t\tif !aok && !bok {\n\t\t\t\tbreak\n\t\t\t} else if !(aok && bok) || anext != bnext {\n\t\t\t\tt.Logf(\"%q != %q (offset=%d): chunk existence a=%v vs b=%v, anext=%v vs bnext=%v\",\n\t\t\t\t\tae.Name, be.Name, nr, aok, bok, anext, bnext)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tnr = anext\n\t\t\tif !bytes.Equal(abytes, bbytes) {\n\t\t\t\tt.Logf(\"%q != %q: different contents %v vs %v\",\n\t\t\t\t\tae.Name, be.Name, string(abytes), string(bbytes))\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\treturn true\n}\n\nfunc allChildrenName(e *TOCEntry) (children []string) {\n\te.ForeachChild(func(baseName string, _ *TOCEntry) bool {\n\t\tchildren = append(children, baseName)\n\t\treturn true\n\t})\n\treturn\n}\n\nfunc equalEntry(a, b *TOCEntry) bool {\n\t// Here, we selectively compare fileds that we are interested in.\n\treturn a.Name == b.Name &&\n\t\ta.Type == b.Type &&\n\t\ta.Size == b.Size &&\n\t\ta.ModTime3339 == b.ModTime3339 &&\n\t\ta.Stat().ModTime().Equal(b.Stat().ModTime()) && // modTime     time.Time\n\t\ta.LinkName == b.LinkName &&\n\t\ta.Mode == b.Mode &&\n\t\ta.UID == b.UID &&\n\t\ta.GID == b.GID &&\n\t\ta.Uname == b.Uname &&\n\t\ta.Gname == b.Gname &&\n\t\t(a.Offset >= 0) == (b.Offset >= 0) &&\n\t\t(a.NextOffset() > 0) == (b.NextOffset() > 0) &&\n\t\ta.DevMajor == b.DevMajor &&\n\t\ta.DevMinor == b.DevMinor &&\n\t\ta.NumLink == b.NumLink &&\n\t\treflect.DeepEqual(a.Xattrs, b.Xattrs) &&\n\t\t// chunk-related infomations aren't compared in this function.\n\t\t// ChunkOffset int64 `json:\"chunkOffset,omitempty\"`\n\t\t// ChunkSize   int64 `json:\"chunkSize,omitempty\"`\n\t\t// children map[string]*TOCEntry\n\t\ta.Digest == b.Digest\n}\n\nfunc readOffset(t *testing.T, r *io.SectionReader, offset int64, e stargzEntry) ([]byte, int64, bool) {\n\tce, ok := e.r.ChunkEntryForOffset(e.e.Name, offset)\n\tif !ok {\n\t\treturn nil, 0, false\n\t}\n\tdata := make([]byte, ce.ChunkSize)\n\tt.Logf(\"Offset: %v, NextOffset: %v\", ce.Offset, ce.NextOffset())\n\tn, err := r.ReadAt(data, ce.ChunkOffset)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to read file payload of %q (offset:%d,size:%d): %v\",\n\t\t\te.e.Name, ce.ChunkOffset, ce.ChunkSize, err)\n\t}\n\tif int64(n) != ce.ChunkSize {\n\t\tt.Fatalf(\"unexpected copied data size %d; want %d\",\n\t\t\tn, ce.ChunkSize)\n\t}\n\treturn data[:n], offset + ce.ChunkSize, true\n}\n\nfunc dumpTOCJSON(t *testing.T, tocJSON *JTOC) string {\n\tjtocData, err := json.Marshal(*tocJSON)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to marshal TOC JSON: %v\", err)\n\t}\n\tbuf := new(bytes.Buffer)\n\tif _, err := io.Copy(buf, bytes.NewReader(jtocData)); err != nil {\n\t\tt.Fatalf(\"failed to read toc json blob: %v\", err)\n\t}\n\treturn buf.String()\n}\n\nconst chunkSize = 3\n\n// type check func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, compressionLevel int)\ntype check func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory)\n\n// testDigestAndVerify runs specified checks against sample stargz blobs.\nfunc testDigestAndVerify(t *testing.T, controllers ...TestingControllerFactory) {\n\ttests := []struct {\n\t\tname         string\n\t\ttarInit      func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry)\n\t\tchecks       []check\n\t\tminChunkSize []int\n\t}{\n\t\t{\n\t\t\tname: \"no-regfile\",\n\t\t\ttarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) {\n\t\t\t\treturn tarOf(\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t)\n\t\t\t},\n\t\t\tchecks: []check{\n\t\t\t\tcheckStargzTOC,\n\t\t\t\tcheckVerifyTOC,\n\t\t\t\tcheckVerifyInvalidStargzFail(buildTar(t, tarOf(\n\t\t\t\t\tdir(\"test2/\"), // modified\n\t\t\t\t), allowedPrefix[0])),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"small-files\",\n\t\t\ttarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) {\n\t\t\t\treturn tarOf(\n\t\t\t\t\tregDigest(t, \"baz.txt\", \"\", dgstMap),\n\t\t\t\t\tregDigest(t, \"foo.txt\", \"a\", dgstMap),\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tregDigest(t, \"test/bar.txt\", \"bbb\", dgstMap),\n\t\t\t\t)\n\t\t\t},\n\t\t\tminChunkSize: []int{0, 64000},\n\t\t\tchecks: []check{\n\t\t\t\tcheckStargzTOC,\n\t\t\t\tcheckVerifyTOC,\n\t\t\t\tcheckVerifyInvalidStargzFail(buildTar(t, tarOf(\n\t\t\t\t\tfile(\"baz.txt\", \"\"),\n\t\t\t\t\tfile(\"foo.txt\", \"M\"), // modified\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tfile(\"test/bar.txt\", \"bbb\"),\n\t\t\t\t), allowedPrefix[0])),\n\t\t\t\t// checkVerifyInvalidTOCEntryFail(\"foo.txt\"), // TODO\n\t\t\t\tcheckVerifyBrokenContentFail(\"foo.txt\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"big-files\",\n\t\t\ttarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) {\n\t\t\t\treturn tarOf(\n\t\t\t\t\tregDigest(t, \"baz.txt\", \"bazbazbazbazbazbazbaz\", dgstMap),\n\t\t\t\t\tregDigest(t, \"foo.txt\", \"a\", dgstMap),\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tregDigest(t, \"test/bar.txt\", \"testbartestbar\", dgstMap),\n\t\t\t\t)\n\t\t\t},\n\t\t\tchecks: []check{\n\t\t\t\tcheckStargzTOC,\n\t\t\t\tcheckVerifyTOC,\n\t\t\t\tcheckVerifyInvalidStargzFail(buildTar(t, tarOf(\n\t\t\t\t\tfile(\"baz.txt\", \"bazbazbazMMMbazbazbaz\"), // modified\n\t\t\t\t\tfile(\"foo.txt\", \"a\"),\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tfile(\"test/bar.txt\", \"testbartestbar\"),\n\t\t\t\t), allowedPrefix[0])),\n\t\t\t\tcheckVerifyInvalidTOCEntryFail(\"test/bar.txt\"),\n\t\t\t\tcheckVerifyBrokenContentFail(\"test/bar.txt\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:         \"with-non-regfiles\",\n\t\t\tminChunkSize: []int{0, 64000},\n\t\t\ttarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) {\n\t\t\t\treturn tarOf(\n\t\t\t\t\tregDigest(t, \"baz.txt\", \"bazbazbazbazbazbazbaz\", dgstMap),\n\t\t\t\t\tregDigest(t, \"foo.txt\", \"a\", dgstMap),\n\t\t\t\t\tregDigest(t, \"bar/foo2.txt\", \"b\", dgstMap),\n\t\t\t\t\tregDigest(t, \"foo3.txt\", \"c\", dgstMap),\n\t\t\t\t\tsymlink(\"barlink\", \"test/bar.txt\"),\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tregDigest(t, \"test/bar.txt\", \"testbartestbar\", dgstMap),\n\t\t\t\t\tdir(\"test2/\"),\n\t\t\t\t\tlink(\"test2/bazlink\", \"baz.txt\"),\n\t\t\t\t)\n\t\t\t},\n\t\t\tchecks: []check{\n\t\t\t\tcheckStargzTOC,\n\t\t\t\tcheckVerifyTOC,\n\t\t\t\tcheckVerifyInvalidStargzFail(buildTar(t, tarOf(\n\t\t\t\t\tfile(\"baz.txt\", \"bazbazbazbazbazbazbaz\"),\n\t\t\t\t\tfile(\"foo.txt\", \"a\"),\n\t\t\t\t\tfile(\"bar/foo2.txt\", \"b\"),\n\t\t\t\t\tfile(\"foo3.txt\", \"c\"),\n\t\t\t\t\tsymlink(\"barlink\", \"test/bar.txt\"),\n\t\t\t\t\tdir(\"test/\"),\n\t\t\t\t\tfile(\"test/bar.txt\", \"testbartestbar\"),\n\t\t\t\t\tdir(\"test2/\"),\n\t\t\t\t\tlink(\"test2/bazlink\", \"foo.txt\"), // modified\n\t\t\t\t), allowedPrefix[0])),\n\t\t\t\tcheckVerifyInvalidTOCEntryFail(\"test/bar.txt\"),\n\t\t\t\tcheckVerifyBrokenContentFail(\"test/bar.txt\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tif len(tt.minChunkSize) == 0 {\n\t\t\ttt.minChunkSize = []int{0}\n\t\t}\n\t\tfor _, srcCompression := range srcCompressions {\n\t\t\tsrcCompression := srcCompression\n\t\t\tfor _, newCL := range controllers {\n\t\t\t\tnewCL := newCL\n\t\t\t\tfor _, prefix := range allowedPrefix {\n\t\t\t\t\tprefix := prefix\n\t\t\t\t\tfor _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} {\n\t\t\t\t\t\tsrcTarFormat := srcTarFormat\n\t\t\t\t\t\tfor _, minChunkSize := range tt.minChunkSize {\n\t\t\t\t\t\t\tminChunkSize := minChunkSize\n\t\t\t\t\t\t\tt.Run(tt.name+\"-\"+fmt.Sprintf(\"compression=%v,prefix=%q,format=%s,minChunkSize=%d\", newCL(), prefix, srcTarFormat, minChunkSize), func(t *testing.T) {\n\t\t\t\t\t\t\t\t// Get original tar file and chunk digests\n\t\t\t\t\t\t\t\tdgstMap := make(map[string]digest.Digest)\n\t\t\t\t\t\t\t\ttarBlob := buildTar(t, tt.tarInit(t, dgstMap), prefix, srcTarFormat)\n\n\t\t\t\t\t\t\t\tcl := newCL()\n\t\t\t\t\t\t\t\trc, err := Build(compressBlob(t, tarBlob, srcCompression),\n\t\t\t\t\t\t\t\t\tWithChunkSize(chunkSize), WithCompression(cl))\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to convert stargz: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttocDigest := rc.TOCDigest()\n\t\t\t\t\t\t\t\tdefer rc.Close()\n\t\t\t\t\t\t\t\tbuf := new(bytes.Buffer)\n\t\t\t\t\t\t\t\tif _, err := io.Copy(buf, rc); err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"failed to copy built stargz blob: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnewStargz := buf.Bytes()\n\t\t\t\t\t\t\t\t// NoPrefetchLandmark is added during `Bulid`, which is expected behaviour.\n\t\t\t\t\t\t\t\tdgstMap[chunkID(NoPrefetchLandmark, 0, int64(len([]byte{landmarkContents})))] = digest.FromBytes([]byte{landmarkContents})\n\n\t\t\t\t\t\t\t\tfor _, check := range tt.checks {\n\t\t\t\t\t\t\t\t\tcheck(t, newStargz, tocDigest, dgstMap, cl, newCL)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// checkStargzTOC checks the TOC JSON of the passed stargz has the expected\n// digest and contains valid chunks. It walks all entries in the stargz and\n// checks all chunk digests stored to the TOC JSON match the actual contents.\nfunc checkStargzTOC(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) {\n\tsgz, err := Open(\n\t\tio.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))),\n\t\tWithDecompressors(controller),\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"failed to parse converted stargz: %v\", err)\n\t\treturn\n\t}\n\tdigestMapTOC, err := listDigests(io.NewSectionReader(\n\t\tbytes.NewReader(sgzData), 0, int64(len(sgzData))),\n\t\tcontroller,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to list digest: %v\", err)\n\t}\n\tfound := make(map[string]bool)\n\tfor id := range dgstMap {\n\t\tfound[id] = false\n\t}\n\tzr, err := controller.Reader(bytes.NewReader(sgzData))\n\tif err != nil {\n\t\tt.Fatalf(\"failed to decompress converted stargz: %v\", err)\n\t}\n\tdefer zr.Close()\n\ttr := tar.NewReader(zr)\n\tfor {\n\t\th, err := tr.Next()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tt.Errorf(\"failed to read tar entry: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif h.Name == TOCTarName {\n\t\t\t// Check the digest of TOC JSON based on the actual contents\n\t\t\t// It's sure that TOC JSON exists in this archive because\n\t\t\t// Open succeeded.\n\t\t\tdgstr := digest.Canonical.Digester()\n\t\t\tif _, err := io.Copy(dgstr.Hash(), tr); err != nil {\n\t\t\t\tt.Fatalf(\"failed to calculate digest of TOC JSON: %v\",\n\t\t\t\t\terr)\n\t\t\t}\n\t\t\tif dgstr.Digest() != tocDigest {\n\t\t\t\tt.Errorf(\"invalid TOC JSON %q; want %q\", tocDigest, dgstr.Digest())\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := sgz.Lookup(h.Name); !ok {\n\t\t\tt.Errorf(\"lost stargz entry %q in the converted TOC\", h.Name)\n\t\t\treturn\n\t\t}\n\t\tvar n int64\n\t\tfor n < h.Size {\n\t\t\tce, ok := sgz.ChunkEntryForOffset(h.Name, n)\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"lost chunk %q(offset=%d) in the converted TOC\",\n\t\t\t\t\th.Name, n)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Get the original digest to make sure the file contents are kept unchanged\n\t\t\t// from the original tar, during the whole conversion steps.\n\t\t\tid := chunkID(h.Name, n, ce.ChunkSize)\n\t\t\twant, ok := dgstMap[id]\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"Unexpected chunk %q(offset=%d,size=%d): %v\",\n\t\t\t\t\th.Name, n, ce.ChunkSize, dgstMap)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfound[id] = true\n\n\t\t\t// Check the file contents\n\t\t\tdgstr := digest.Canonical.Digester()\n\t\t\tif _, err := io.CopyN(dgstr.Hash(), tr, ce.ChunkSize); err != nil {\n\t\t\t\tt.Fatalf(\"failed to calculate digest of %q (offset=%d,size=%d)\",\n\t\t\t\t\th.Name, n, ce.ChunkSize)\n\t\t\t}\n\t\t\tif want != dgstr.Digest() {\n\t\t\t\tt.Errorf(\"Invalid contents in converted stargz %q: %q; want %q\",\n\t\t\t\t\th.Name, dgstr.Digest(), want)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Check the digest stored in TOC JSON\n\t\t\tdgstTOC, ok := digestMapTOC[ce.Offset]\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"digest of %q(offset=%d,size=%d,chunkOffset=%d) isn't registered\",\n\t\t\t\t\th.Name, ce.Offset, ce.ChunkSize, ce.ChunkOffset)\n\t\t\t}\n\t\t\tif want != dgstTOC {\n\t\t\t\tt.Errorf(\"Invalid digest in TOCEntry %q: %q; want %q\",\n\t\t\t\t\th.Name, dgstTOC, want)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tn += ce.ChunkSize\n\t\t}\n\t}\n\n\tfor id, ok := range found {\n\t\tif !ok {\n\t\t\tt.Errorf(\"required chunk %q not found in the converted stargz: %v\", id, found)\n\t\t}\n\t}\n}\n\n// checkVerifyTOC checks the verification works for the TOC JSON of the passed\n// stargz. It walks all entries in the stargz and checks the verifications for\n// all chunks work.\nfunc checkVerifyTOC(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) {\n\tsgz, err := Open(\n\t\tio.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))),\n\t\tWithDecompressors(controller),\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"failed to parse converted stargz: %v\", err)\n\t\treturn\n\t}\n\tev, err := sgz.VerifyTOC(tocDigest)\n\tif err != nil {\n\t\tt.Errorf(\"failed to verify stargz: %v\", err)\n\t\treturn\n\t}\n\n\tfound := make(map[string]bool)\n\tfor id := range dgstMap {\n\t\tfound[id] = false\n\t}\n\tzr, err := controller.Reader(bytes.NewReader(sgzData))\n\tif err != nil {\n\t\tt.Fatalf(\"failed to decompress converted stargz: %v\", err)\n\t}\n\tdefer zr.Close()\n\ttr := tar.NewReader(zr)\n\tfor {\n\t\th, err := tr.Next()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tt.Errorf(\"failed to read tar entry: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif h.Name == TOCTarName {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := sgz.Lookup(h.Name); !ok {\n\t\t\tt.Errorf(\"lost stargz entry %q in the converted TOC\", h.Name)\n\t\t\treturn\n\t\t}\n\t\tvar n int64\n\t\tfor n < h.Size {\n\t\t\tce, ok := sgz.ChunkEntryForOffset(h.Name, n)\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"lost chunk %q(offset=%d) in the converted TOC\",\n\t\t\t\t\th.Name, n)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tv, err := ev.Verifier(ce)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to get verifier for %q(offset=%d)\", h.Name, n)\n\t\t\t}\n\n\t\t\tfound[chunkID(h.Name, n, ce.ChunkSize)] = true\n\n\t\t\t// Check the file contents\n\t\t\tif _, err := io.CopyN(v, tr, ce.ChunkSize); err != nil {\n\t\t\t\tt.Fatalf(\"failed to get chunk of %q (offset=%d,size=%d)\",\n\t\t\t\t\th.Name, n, ce.ChunkSize)\n\t\t\t}\n\t\t\tif !v.Verified() {\n\t\t\t\tt.Errorf(\"Invalid contents in converted stargz %q (should be succeeded)\",\n\t\t\t\t\th.Name)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tn += ce.ChunkSize\n\t\t}\n\t}\n\n\tfor id, ok := range found {\n\t\tif !ok {\n\t\t\tt.Errorf(\"required chunk %q not found in the converted stargz: %v\", id, found)\n\t\t}\n\t}\n}\n\n// checkVerifyInvalidTOCEntryFail checks if misconfigured TOC JSON can be\n// detected during the verification and the verification returns an error.\nfunc checkVerifyInvalidTOCEntryFail(filename string) check {\n\treturn func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) {\n\t\tfuncs := map[string]rewriteFunc{\n\t\t\t\"lost digest in a entry\": func(t *testing.T, toc *JTOC, sgz *io.SectionReader) {\n\t\t\t\tvar found bool\n\t\t\t\tfor _, e := range toc.Entries {\n\t\t\t\t\tif cleanEntryName(e.Name) == filename {\n\t\t\t\t\t\tif e.Type != \"reg\" && e.Type != \"chunk\" {\n\t\t\t\t\t\t\tt.Fatalf(\"entry %q to break must be regfile or chunk\", filename)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif e.ChunkDigest == \"\" {\n\t\t\t\t\t\t\tt.Fatalf(\"entry %q is already invalid\", filename)\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.ChunkDigest = \"\"\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\tt.Fatalf(\"rewrite target not found\")\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"duplicated entry offset\": func(t *testing.T, toc *JTOC, sgz *io.SectionReader) {\n\t\t\t\tvar (\n\t\t\t\t\tsampleEntry *TOCEntry\n\t\t\t\t\ttargetEntry *TOCEntry\n\t\t\t\t)\n\t\t\t\tfor _, e := range toc.Entries {\n\t\t\t\t\tif e.Type == \"reg\" || e.Type == \"chunk\" {\n\t\t\t\t\t\tif cleanEntryName(e.Name) == filename {\n\t\t\t\t\t\t\ttargetEntry = e\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsampleEntry = e\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif sampleEntry == nil {\n\t\t\t\t\tt.Fatalf(\"TOC must contain at least one regfile or chunk entry other than the rewrite target\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif targetEntry == nil {\n\t\t\t\t\tt.Fatalf(\"rewrite target not found\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttargetEntry.Offset = sampleEntry.Offset\n\t\t\t},\n\t\t}\n\n\t\tfor name, rFunc := range funcs {\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\tnewSgz, newTocDigest := rewriteTOCJSON(t, io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), rFunc, controller)\n\t\t\t\tbuf := new(bytes.Buffer)\n\t\t\t\tif _, err := io.Copy(buf, newSgz); err != nil {\n\t\t\t\t\tt.Fatalf(\"failed to get converted stargz\")\n\t\t\t\t}\n\t\t\t\tisgz := buf.Bytes()\n\n\t\t\t\tsgz, err := Open(\n\t\t\t\t\tio.NewSectionReader(bytes.NewReader(isgz), 0, int64(len(isgz))),\n\t\t\t\t\tWithDecompressors(controller),\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"failed to parse converted stargz: %v\", err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t_, err = sgz.VerifyTOC(newTocDigest)\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Errorf(\"must fail for invalid TOC\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n\n// checkVerifyInvalidStargzFail checks if the verification detects that the\n// given stargz file doesn't match to the expected digest and returns error.\nfunc checkVerifyInvalidStargzFail(invalid *io.SectionReader) check {\n\treturn func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) {\n\t\tcl := newController()\n\t\trc, err := Build(invalid, WithChunkSize(chunkSize), WithCompression(cl))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to convert stargz: %v\", err)\n\t\t}\n\t\tdefer rc.Close()\n\t\tbuf := new(bytes.Buffer)\n\t\tif _, err := io.Copy(buf, rc); err != nil {\n\t\t\tt.Fatalf(\"failed to copy built stargz blob: %v\", err)\n\t\t}\n\t\tmStargz := buf.Bytes()\n\n\t\tsgz, err := Open(\n\t\t\tio.NewSectionReader(bytes.NewReader(mStargz), 0, int64(len(mStargz))),\n\t\t\tWithDecompressors(cl),\n\t\t)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to parse converted stargz: %v\", err)\n\t\t\treturn\n\t\t}\n\t\t_, err = sgz.VerifyTOC(tocDigest)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"must fail for invalid TOC\")\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// checkVerifyBrokenContentFail checks if the verifier detects broken contents\n// that doesn't match to the expected digest and returns error.\nfunc checkVerifyBrokenContentFail(filename string) check {\n\treturn func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) {\n\t\t// Parse stargz file\n\t\tsgz, err := Open(\n\t\t\tio.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))),\n\t\t\tWithDecompressors(controller),\n\t\t)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to parse converted stargz: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tev, err := sgz.VerifyTOC(tocDigest)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to verify stargz: %v\", err)\n\t\t\treturn\n\t\t}\n\n\t\t// Open the target file\n\t\tsr, err := sgz.OpenFile(filename)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to open file %q\", filename)\n\t\t}\n\t\tce, ok := sgz.ChunkEntryForOffset(filename, 0)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"lost chunk %q(offset=%d) in the converted TOC\", filename, 0)\n\t\t\treturn\n\t\t}\n\t\tif ce.ChunkSize == 0 {\n\t\t\tt.Fatalf(\"file mustn't be empty\")\n\t\t\treturn\n\t\t}\n\t\tdata := make([]byte, ce.ChunkSize)\n\t\tif _, err := sr.ReadAt(data, ce.ChunkOffset); err != nil {\n\t\t\tt.Errorf(\"failed to get data of a chunk of %q(offset=%q)\",\n\t\t\t\tfilename, ce.ChunkOffset)\n\t\t}\n\n\t\t// Check the broken chunk (must fail)\n\t\tv, err := ev.Verifier(ce)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to get verifier for %q\", filename)\n\t\t}\n\t\tbroken := append([]byte{^data[0]}, data[1:]...)\n\t\tif _, err := io.CopyN(v, bytes.NewReader(broken), ce.ChunkSize); err != nil {\n\t\t\tt.Fatalf(\"failed to get chunk of %q (offset=%d,size=%d)\",\n\t\t\t\tfilename, ce.ChunkOffset, ce.ChunkSize)\n\t\t}\n\t\tif v.Verified() {\n\t\t\tt.Errorf(\"verification must fail for broken file chunk %q(org:%q,broken:%q)\",\n\t\t\t\tfilename, data, broken)\n\t\t}\n\t}\n}\n\nfunc chunkID(name string, offset, size int64) string {\n\treturn fmt.Sprintf(\"%s-%d-%d\", cleanEntryName(name), offset, size)\n}\n\ntype rewriteFunc func(t *testing.T, toc *JTOC, sgz *io.SectionReader)\n\nfunc rewriteTOCJSON(t *testing.T, sgz *io.SectionReader, rewrite rewriteFunc, controller TestingController) (newSgz io.Reader, tocDigest digest.Digest) {\n\tdecodedJTOC, jtocOffset, err := parseStargz(sgz, controller)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to extract TOC JSON: %v\", err)\n\t}\n\n\trewrite(t, decodedJTOC, sgz)\n\n\ttocFooter, tocDigest, err := tocAndFooter(controller, decodedJTOC, jtocOffset)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create toc and footer: %v\", err)\n\t}\n\n\t// Reconstruct stargz file with the modified TOC JSON\n\tif _, err := sgz.Seek(0, io.SeekStart); err != nil {\n\t\tt.Fatalf(\"failed to reset the seek position of stargz: %v\", err)\n\t}\n\treturn io.MultiReader(\n\t\tio.LimitReader(sgz, jtocOffset), // Original stargz (before TOC JSON)\n\t\ttocFooter,                       // Rewritten TOC and footer\n\t), tocDigest\n}\n\nfunc listDigests(sgz *io.SectionReader, controller TestingController) (map[int64]digest.Digest, error) {\n\tdecodedJTOC, _, err := parseStargz(sgz, controller)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdigestMap := make(map[int64]digest.Digest)\n\tfor _, e := range decodedJTOC.Entries {\n\t\tif e.Type == \"reg\" || e.Type == \"chunk\" {\n\t\t\tif e.Type == \"reg\" && e.Size == 0 {\n\t\t\t\tcontinue // ignores empty file\n\t\t\t}\n\t\t\tif e.ChunkDigest == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"ChunkDigest of %q(off=%d) not found in TOC JSON\",\n\t\t\t\t\te.Name, e.Offset)\n\t\t\t}\n\t\t\td, err := digest.Parse(e.ChunkDigest)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdigestMap[e.Offset] = d\n\t\t}\n\t}\n\treturn digestMap, nil\n}\n\nfunc parseStargz(sgz *io.SectionReader, controller TestingController) (decodedJTOC *JTOC, jtocOffset int64, err error) {\n\tfSize := controller.FooterSize()\n\tfooter := make([]byte, fSize)\n\tif _, err := sgz.ReadAt(footer, sgz.Size()-fSize); err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"error reading footer: %w\", err)\n\t}\n\t_, tocOffset, _, err := controller.ParseFooter(footer[positive(int64(len(footer))-fSize):])\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"failed to parse footer: %w\", err)\n\t}\n\n\t// Decode the TOC JSON\n\tvar tocReader io.Reader\n\tif tocOffset >= 0 {\n\t\ttocReader = io.NewSectionReader(sgz, tocOffset, sgz.Size()-tocOffset-fSize)\n\t}\n\tdecodedJTOC, _, err = controller.ParseTOC(tocReader)\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"failed to parse TOC: %w\", err)\n\t}\n\treturn decodedJTOC, tocOffset, nil\n}\n\nfunc testWriteAndOpen(t *testing.T, controllers ...TestingControllerFactory) {\n\tconst content = \"Some contents\"\n\tinvalidUtf8 := \"\\xff\\xfe\\xfd\"\n\n\txAttrFile := xAttr{\"foo\": \"bar\", \"invalid-utf8\": invalidUtf8}\n\tsampleOwner := owner{uid: 50, gid: 100}\n\n\tdata64KB := randomContents(64000)\n\n\ttests := []struct {\n\t\tname         string\n\t\tchunkSize    int\n\t\tminChunkSize int\n\t\tin           []tarEntry\n\t\twant         []stargzCheck\n\t\twantNumGz    int // expected number of streams\n\n\t\twantNumGzLossLess  int // expected number of streams (> 0) in lossless mode if it's different from wantNumGz\n\t\twantFailOnLossLess bool\n\t\twantTOCVersion     int // default = 1\n\t}{\n\t\t{\n\t\t\tname:      \"empty\",\n\t\t\tin:        tarOf(),\n\t\t\twantNumGz: 2, // (empty tar) + TOC + footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(0),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"1dir_1empty_file\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/bar.txt\", \"\"),\n\t\t\t),\n\t\t\twantNumGz: 3, // dir, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(2),\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasFileLen(\"foo/bar.txt\", 0),\n\t\t\t\tentryHasChildren(\"foo\", \"bar.txt\"),\n\t\t\t\thasFileDigest(\"foo/bar.txt\", digestFor(\"\")),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"1dir_1file\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/bar.txt\", content, xAttrFile),\n\t\t\t),\n\t\t\twantNumGz: 4, // var dir, foo.txt alone, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(2),\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasFileLen(\"foo/bar.txt\", len(content)),\n\t\t\t\thasFileDigest(\"foo/bar.txt\", digestFor(content)),\n\t\t\t\thasFileContentsRange(\"foo/bar.txt\", 0, content),\n\t\t\t\thasFileContentsRange(\"foo/bar.txt\", 1, content[1:]),\n\t\t\t\tentryHasChildren(\"\", \"foo\"),\n\t\t\t\tentryHasChildren(\"foo\", \"bar.txt\"),\n\t\t\t\thasFileXattrs(\"foo/bar.txt\", \"foo\", \"bar\"),\n\t\t\t\thasFileXattrs(\"foo/bar.txt\", \"invalid-utf8\", invalidUtf8),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"2meta_2file\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"bar/\", sampleOwner),\n\t\t\t\tdir(\"foo/\", sampleOwner),\n\t\t\t\tfile(\"foo/bar.txt\", content, sampleOwner),\n\t\t\t),\n\t\t\twantNumGz: 4, // both dirs, foo.txt alone, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(3),\n\t\t\t\thasDir(\"bar/\"),\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasFileLen(\"foo/bar.txt\", len(content)),\n\t\t\t\tentryHasChildren(\"\", \"bar\", \"foo\"),\n\t\t\t\tentryHasChildren(\"foo\", \"bar.txt\"),\n\t\t\t\thasChunkEntries(\"foo/bar.txt\", 1),\n\t\t\t\thasEntryOwner(\"bar/\", sampleOwner),\n\t\t\t\thasEntryOwner(\"foo/\", sampleOwner),\n\t\t\t\thasEntryOwner(\"foo/bar.txt\", sampleOwner),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"3dir\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"bar/\"),\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tdir(\"foo/bar/\"),\n\t\t\t),\n\t\t\twantNumGz: 3, // 3 dirs, TOC, footer\n\t\t\twant: checks(\n\t\t\t\thasDirLinkCount(\"bar/\", 2),\n\t\t\t\thasDirLinkCount(\"foo/\", 3),\n\t\t\t\thasDirLinkCount(\"foo/bar/\", 2),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"symlink\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tsymlink(\"foo/bar\", \"../../x\"),\n\t\t\t),\n\t\t\twantNumGz: 3, // metas + TOC + footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(2),\n\t\t\t\thasSymlink(\"foo/bar\", \"../../x\"),\n\t\t\t\tentryHasChildren(\"\", \"foo\"),\n\t\t\t\tentryHasChildren(\"foo\", \"bar\"),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:      \"chunked_file\",\n\t\t\tchunkSize: 4,\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/big.txt\", \"This \"+\"is s\"+\"uch \"+\"a bi\"+\"g fi\"+\"le\"),\n\t\t\t),\n\t\t\twantNumGz: 9, // dir + big.txt(6 chunks) + TOC + footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(7), // 1 for foo dir, 6 for the foo/big.txt file\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasFileLen(\"foo/big.txt\", len(\"This is such a big file\")),\n\t\t\t\thasFileDigest(\"foo/big.txt\", digestFor(\"This is such a big file\")),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 0, \"This is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 1, \"his is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 2, \"is is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 3, \"s is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 4, \" is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 5, \"is such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 6, \"s such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 7, \" such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 8, \"such a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 9, \"uch a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 10, \"ch a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 11, \"h a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", 12, \" a big file\"),\n\t\t\t\thasFileContentsRange(\"foo/big.txt\", len(\"This is such a big file\")-1, \"\"),\n\t\t\t\thasChunkEntries(\"foo/big.txt\", 6),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"recursive\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"/\", sampleOwner),\n\t\t\t\tdir(\"bar/\", sampleOwner),\n\t\t\t\tdir(\"foo/\", sampleOwner),\n\t\t\t\tfile(\"foo/bar.txt\", content, sampleOwner),\n\t\t\t),\n\t\t\twantNumGz: 4, // dirs, bar.txt alone, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tmaxDepth(2), // 0: root directory, 1: \"foo/\", 2: \"bar.txt\"\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"block_char_fifo\",\n\t\t\tin: tarOf(\n\t\t\t\ttarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\t\t\t\treturn w.WriteHeader(&tar.Header{\n\t\t\t\t\t\tName:     prefix + \"b\",\n\t\t\t\t\t\tTypeflag: tar.TypeBlock,\n\t\t\t\t\t\tDevmajor: 123,\n\t\t\t\t\t\tDevminor: 456,\n\t\t\t\t\t\tFormat:   format,\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t\ttarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\t\t\t\treturn w.WriteHeader(&tar.Header{\n\t\t\t\t\t\tName:     prefix + \"c\",\n\t\t\t\t\t\tTypeflag: tar.TypeChar,\n\t\t\t\t\t\tDevmajor: 111,\n\t\t\t\t\t\tDevminor: 222,\n\t\t\t\t\t\tFormat:   format,\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t\ttarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\t\t\t\treturn w.WriteHeader(&tar.Header{\n\t\t\t\t\t\tName:     prefix + \"f\",\n\t\t\t\t\t\tTypeflag: tar.TypeFifo,\n\t\t\t\t\t\tFormat:   format,\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t),\n\t\t\twantNumGz: 3,\n\t\t\twant: checks(\n\t\t\t\tlookupMatch(\"b\", &TOCEntry{Name: \"b\", Type: \"block\", DevMajor: 123, DevMinor: 456, NumLink: 1}),\n\t\t\t\tlookupMatch(\"c\", &TOCEntry{Name: \"c\", Type: \"char\", DevMajor: 111, DevMinor: 222, NumLink: 1}),\n\t\t\t\tlookupMatch(\"f\", &TOCEntry{Name: \"f\", Type: \"fifo\", NumLink: 1}),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"modes\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo1/\", 0755|os.ModeDir|os.ModeSetgid),\n\t\t\t\tfile(\"foo1/bar1\", content, 0700|os.ModeSetuid),\n\t\t\t\tfile(\"foo1/bar2\", content, 0755|os.ModeSetgid),\n\t\t\t\tdir(\"foo2/\", 0755|os.ModeDir|os.ModeSticky),\n\t\t\t\tfile(\"foo2/bar3\", content, 0755|os.ModeSticky),\n\t\t\t\tdir(\"foo3/\", 0755|os.ModeDir),\n\t\t\t\tfile(\"foo3/bar4\", content, os.FileMode(0700)),\n\t\t\t\tfile(\"foo3/bar5\", content, os.FileMode(0755)),\n\t\t\t),\n\t\t\twantNumGz: 8, // dir, bar1 alone, bar2 alone + dir, bar3 alone + dir, bar4 alone, bar5 alone, TOC, footer\n\t\t\twant: checks(\n\t\t\t\thasMode(\"foo1/\", 0755|os.ModeDir|os.ModeSetgid),\n\t\t\t\thasMode(\"foo1/bar1\", 0700|os.ModeSetuid),\n\t\t\t\thasMode(\"foo1/bar2\", 0755|os.ModeSetgid),\n\t\t\t\thasMode(\"foo2/\", 0755|os.ModeDir|os.ModeSticky),\n\t\t\t\thasMode(\"foo2/bar3\", 0755|os.ModeSticky),\n\t\t\t\thasMode(\"foo3/\", 0755|os.ModeDir),\n\t\t\t\thasMode(\"foo3/bar4\", os.FileMode(0700)),\n\t\t\t\thasMode(\"foo3/bar5\", os.FileMode(0755)),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"lossy\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"bar/\", sampleOwner),\n\t\t\t\tdir(\"foo/\", sampleOwner),\n\t\t\t\tfile(\"foo/bar.txt\", content, sampleOwner),\n\t\t\t\tfile(TOCTarName, \"dummy\"), // ignored by the writer. (lossless write returns error)\n\t\t\t),\n\t\t\twantNumGz: 4, // both dirs, foo.txt alone, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(3),\n\t\t\t\thasDir(\"bar/\"),\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasFileLen(\"foo/bar.txt\", len(content)),\n\t\t\t\tentryHasChildren(\"\", \"bar\", \"foo\"),\n\t\t\t\tentryHasChildren(\"foo\", \"bar.txt\"),\n\t\t\t\thasChunkEntries(\"foo/bar.txt\", 1),\n\t\t\t\thasEntryOwner(\"bar/\", sampleOwner),\n\t\t\t\thasEntryOwner(\"foo/\", sampleOwner),\n\t\t\t\thasEntryOwner(\"foo/bar.txt\", sampleOwner),\n\t\t\t),\n\t\t\twantFailOnLossLess: true,\n\t\t},\n\t\t{\n\t\t\tname: \"hardlink should be replaced to the destination entry\",\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/foo1\", \"test\"),\n\t\t\t\tlink(\"foolink\", \"foo/foo1\"),\n\t\t\t),\n\t\t\twantNumGz: 4, // dir, foo1 + link, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tmustSameEntry(\"foo/foo1\", \"foolink\"),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:         \"several_files_in_chunk\",\n\t\t\tminChunkSize: 8000,\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/foo1\", data64KB),\n\t\t\t\tfile(\"foo2\", \"bb\"),\n\t\t\t\tfile(\"foo22\", \"ccc\"),\n\t\t\t\tdir(\"bar/\"),\n\t\t\t\tfile(\"bar/bar.txt\", \"aaa\"),\n\t\t\t\tfile(\"foo3\", data64KB),\n\t\t\t),\n\t\t\t// NOTE: we assume that the compressed \"data64KB\" is still larger than 8KB\n\t\t\twantNumGz: 4, // dir+foo1, foo2+foo22+dir+bar.txt+foo3, TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(7), // dir, foo1, foo2, foo22, dir, bar.txt, foo3\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasDir(\"bar/\"),\n\t\t\t\thasFileLen(\"foo/foo1\", len(data64KB)),\n\t\t\t\thasFileLen(\"foo2\", len(\"bb\")),\n\t\t\t\thasFileLen(\"foo22\", len(\"ccc\")),\n\t\t\t\thasFileLen(\"bar/bar.txt\", len(\"aaa\")),\n\t\t\t\thasFileLen(\"foo3\", len(data64KB)),\n\t\t\t\thasFileDigest(\"foo/foo1\", digestFor(data64KB)),\n\t\t\t\thasFileDigest(\"foo2\", digestFor(\"bb\")),\n\t\t\t\thasFileDigest(\"foo22\", digestFor(\"ccc\")),\n\t\t\t\thasFileDigest(\"bar/bar.txt\", digestFor(\"aaa\")),\n\t\t\t\thasFileDigest(\"foo3\", digestFor(data64KB)),\n\t\t\t\thasFileContentsWithPreRead(\"foo22\", 0, \"ccc\", chunkInfo{\"foo2\", \"bb\"}, chunkInfo{\"bar/bar.txt\", \"aaa\"}, chunkInfo{\"foo3\", data64KB}),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", 0, data64KB),\n\t\t\t\thasFileContentsRange(\"foo2\", 0, \"bb\"),\n\t\t\t\thasFileContentsRange(\"foo2\", 1, \"b\"),\n\t\t\t\thasFileContentsRange(\"foo22\", 0, \"ccc\"),\n\t\t\t\thasFileContentsRange(\"foo22\", 1, \"cc\"),\n\t\t\t\thasFileContentsRange(\"foo22\", 2, \"c\"),\n\t\t\t\thasFileContentsRange(\"bar/bar.txt\", 0, \"aaa\"),\n\t\t\t\thasFileContentsRange(\"bar/bar.txt\", 1, \"aa\"),\n\t\t\t\thasFileContentsRange(\"bar/bar.txt\", 2, \"a\"),\n\t\t\t\thasFileContentsRange(\"foo3\", 0, data64KB),\n\t\t\t\thasFileContentsRange(\"foo3\", 1, data64KB[1:]),\n\t\t\t\thasFileContentsRange(\"foo3\", 2, data64KB[2:]),\n\t\t\t\thasFileContentsRange(\"foo3\", len(data64KB)/2, data64KB[len(data64KB)/2:]),\n\t\t\t\thasFileContentsRange(\"foo3\", len(data64KB)-1, data64KB[len(data64KB)-1:]),\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname:         \"several_files_in_chunk_chunked\",\n\t\t\tminChunkSize: 8000,\n\t\t\tchunkSize:    32000,\n\t\t\tin: tarOf(\n\t\t\t\tdir(\"foo/\"),\n\t\t\t\tfile(\"foo/foo1\", data64KB),\n\t\t\t\tfile(\"foo2\", \"bb\"),\n\t\t\t\tdir(\"bar/\"),\n\t\t\t\tfile(\"foo3\", data64KB),\n\t\t\t),\n\t\t\t// NOTE: we assume that the compressed chunk of \"data64KB\" is still larger than 8KB\n\t\t\twantNumGz: 6, // dir+foo1(1), foo1(2), foo2+dir+foo3(1), foo3(2), TOC, footer\n\t\t\twant: checks(\n\t\t\t\tnumTOCEntries(7), // dir, foo1(2 chunks), foo2, dir, foo3(2 chunks)\n\t\t\t\thasDir(\"foo/\"),\n\t\t\t\thasDir(\"bar/\"),\n\t\t\t\thasFileLen(\"foo/foo1\", len(data64KB)),\n\t\t\t\thasFileLen(\"foo2\", len(\"bb\")),\n\t\t\t\thasFileLen(\"foo3\", len(data64KB)),\n\t\t\t\thasFileDigest(\"foo/foo1\", digestFor(data64KB)),\n\t\t\t\thasFileDigest(\"foo2\", digestFor(\"bb\")),\n\t\t\t\thasFileDigest(\"foo3\", digestFor(data64KB)),\n\t\t\t\thasFileContentsWithPreRead(\"foo2\", 0, \"bb\", chunkInfo{\"foo3\", data64KB[:32000]}),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", 0, data64KB),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", 1, data64KB[1:]),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", 2, data64KB[2:]),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", len(data64KB)/2, data64KB[len(data64KB)/2:]),\n\t\t\t\thasFileContentsRange(\"foo/foo1\", len(data64KB)-1, data64KB[len(data64KB)-1:]),\n\t\t\t\thasFileContentsRange(\"foo2\", 0, \"bb\"),\n\t\t\t\thasFileContentsRange(\"foo2\", 1, \"b\"),\n\t\t\t\thasFileContentsRange(\"foo3\", 0, data64KB),\n\t\t\t\thasFileContentsRange(\"foo3\", 1, data64KB[1:]),\n\t\t\t\thasFileContentsRange(\"foo3\", 2, data64KB[2:]),\n\t\t\t\thasFileContentsRange(\"foo3\", len(data64KB)/2, data64KB[len(data64KB)/2:]),\n\t\t\t\thasFileContentsRange(\"foo3\", len(data64KB)-1, data64KB[len(data64KB)-1:]),\n\t\t\t),\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tfor _, newCL := range controllers {\n\t\t\tnewCL := newCL\n\t\t\tfor _, prefix := range allowedPrefix {\n\t\t\t\tprefix := prefix\n\t\t\t\tfor _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} {\n\t\t\t\t\tsrcTarFormat := srcTarFormat\n\t\t\t\t\tfor _, lossless := range []bool{true, false} {\n\t\t\t\t\t\tt.Run(tt.name+\"-\"+fmt.Sprintf(\"compression=%v,prefix=%q,lossless=%v,format=%s\", newCL(), prefix, lossless, srcTarFormat), func(t *testing.T) {\n\t\t\t\t\t\t\tvar tr io.Reader = buildTar(t, tt.in, prefix, srcTarFormat)\n\t\t\t\t\t\t\torigTarDgstr := digest.Canonical.Digester()\n\t\t\t\t\t\t\ttr = io.TeeReader(tr, origTarDgstr.Hash())\n\t\t\t\t\t\t\tvar stargzBuf bytes.Buffer\n\t\t\t\t\t\t\tcl1 := newCL()\n\t\t\t\t\t\t\tw := NewWriterWithCompressor(&stargzBuf, cl1)\n\t\t\t\t\t\t\tw.ChunkSize = tt.chunkSize\n\t\t\t\t\t\t\tw.MinChunkSize = tt.minChunkSize\n\t\t\t\t\t\t\tif lossless {\n\t\t\t\t\t\t\t\terr := w.AppendTarLossLess(tr)\n\t\t\t\t\t\t\t\tif tt.wantFailOnLossLess {\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\treturn // expected to fail\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"Append wanted to fail on lossless\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"Append(lossless): %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif err := w.AppendTar(tr); err != nil {\n\t\t\t\t\t\t\t\t\tt.Fatalf(\"Append: %v\", err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif _, err := w.Close(); err != nil {\n\t\t\t\t\t\t\t\tt.Fatalf(\"Writer.Close: %v\", err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tb := stargzBuf.Bytes()\n\n\t\t\t\t\t\t\tif lossless {\n\t\t\t\t\t\t\t\t// Check if the result blob reserves original tar metadata\n\t\t\t\t\t\t\t\trc, err := Unpack(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), cl1)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"failed to decompress blob: %v\", err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdefer rc.Close()\n\t\t\t\t\t\t\t\tresultDgstr := digest.Canonical.Digester()\n\t\t\t\t\t\t\t\tif _, err := io.Copy(resultDgstr.Hash(), rc); err != nil {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"failed to read result decompressed blob: %v\", err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif resultDgstr.Digest() != origTarDgstr.Digest() {\n\t\t\t\t\t\t\t\t\tt.Errorf(\"lossy compression occurred: digest=%v; want %v\",\n\t\t\t\t\t\t\t\t\t\tresultDgstr.Digest(), origTarDgstr.Digest())\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdiffID := w.DiffID()\n\t\t\t\t\t\t\twantDiffID := cl1.DiffIDOf(t, b)\n\t\t\t\t\t\t\tif diffID != wantDiffID {\n\t\t\t\t\t\t\t\tt.Errorf(\"DiffID = %q; want %q\", diffID, wantDiffID)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttelemetry, checkCalled := newCalledTelemetry()\n\t\t\t\t\t\t\tsr := io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b)))\n\t\t\t\t\t\t\tr, err := Open(\n\t\t\t\t\t\t\t\tsr,\n\t\t\t\t\t\t\t\tWithDecompressors(cl1),\n\t\t\t\t\t\t\t\tWithTelemetry(telemetry),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tt.Fatalf(\"stargz.Open: %v\", err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twantTOCVersion := 1\n\t\t\t\t\t\t\tif tt.wantTOCVersion > 0 {\n\t\t\t\t\t\t\t\twantTOCVersion = tt.wantTOCVersion\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif r.toc.Version != wantTOCVersion {\n\t\t\t\t\t\t\t\tt.Fatalf(\"invalid TOC Version %d; wanted %d\", r.toc.Version, wantTOCVersion)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfooterSize := cl1.FooterSize()\n\t\t\t\t\t\t\tfooterOffset := sr.Size() - footerSize\n\t\t\t\t\t\t\tfooter := make([]byte, footerSize)\n\t\t\t\t\t\t\tif _, err := sr.ReadAt(footer, footerOffset); err != nil {\n\t\t\t\t\t\t\t\tt.Errorf(\"failed to read footer: %v\", err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_, tocOffset, _, err := cl1.ParseFooter(footer)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tt.Errorf(\"failed to parse footer: %v\", err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif err := checkCalled(tocOffset >= 0); err != nil {\n\t\t\t\t\t\t\t\tt.Errorf(\"telemetry failure: %v\", err)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twantNumGz := tt.wantNumGz\n\t\t\t\t\t\t\tif lossless && tt.wantNumGzLossLess > 0 {\n\t\t\t\t\t\t\t\twantNumGz = tt.wantNumGzLossLess\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstreamOffsets := []int64{0}\n\t\t\t\t\t\t\tprevOffset := int64(-1)\n\t\t\t\t\t\t\tstreams := 0\n\t\t\t\t\t\t\tfor _, e := range r.toc.Entries {\n\t\t\t\t\t\t\t\tif e.Offset > prevOffset {\n\t\t\t\t\t\t\t\t\tstreamOffsets = append(streamOffsets, e.Offset)\n\t\t\t\t\t\t\t\t\tprevOffset = e.Offset\n\t\t\t\t\t\t\t\t\tstreams++\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstreams++ // TOC\n\t\t\t\t\t\t\tif tocOffset >= 0 {\n\t\t\t\t\t\t\t\t// toc is in the blob\n\t\t\t\t\t\t\t\tstreamOffsets = append(streamOffsets, tocOffset)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstreams++ // footer\n\t\t\t\t\t\t\tstreamOffsets = append(streamOffsets, footerOffset)\n\t\t\t\t\t\t\tif streams != wantNumGz {\n\t\t\t\t\t\t\t\tt.Errorf(\"number of streams in TOC = %d; want %d\", streams, wantNumGz)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tt.Logf(\"testing streams: %+v\", streamOffsets)\n\t\t\t\t\t\t\tcl1.TestStreams(t, b, streamOffsets)\n\n\t\t\t\t\t\t\tfor _, want := range tt.want {\n\t\t\t\t\t\t\t\twant.check(t, r)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype chunkInfo struct {\n\tname string\n\tdata string\n}\n\nfunc newCalledTelemetry() (telemetry *Telemetry, check func(needsGetTOC bool) error) {\n\tvar getFooterLatencyCalled bool\n\tvar getTocLatencyCalled bool\n\tvar deserializeTocLatencyCalled bool\n\treturn &Telemetry{\n\t\t\tfunc(time.Time) { getFooterLatencyCalled = true },\n\t\t\tfunc(time.Time) { getTocLatencyCalled = true },\n\t\t\tfunc(time.Time) { deserializeTocLatencyCalled = true },\n\t\t}, func(needsGetTOC bool) error {\n\t\t\tvar allErr []error\n\t\t\tif !getFooterLatencyCalled {\n\t\t\t\tallErr = append(allErr, fmt.Errorf(\"metrics GetFooterLatency isn't called\"))\n\t\t\t}\n\t\t\tif needsGetTOC {\n\t\t\t\tif !getTocLatencyCalled {\n\t\t\t\t\tallErr = append(allErr, fmt.Errorf(\"metrics GetTocLatency isn't called\"))\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !deserializeTocLatencyCalled {\n\t\t\t\tallErr = append(allErr, fmt.Errorf(\"metrics DeserializeTocLatency isn't called\"))\n\t\t\t}\n\t\t\treturn errorutil.Aggregate(allErr)\n\t\t}\n}\n\nfunc digestFor(content string) string {\n\tsum := sha256.Sum256([]byte(content))\n\treturn fmt.Sprintf(\"sha256:%x\", sum)\n}\n\ntype numTOCEntries int\n\nfunc (n numTOCEntries) check(t *testing.T, r *Reader) {\n\tif r.toc == nil {\n\t\tt.Fatal(\"nil TOC\")\n\t}\n\tif got, want := len(r.toc.Entries), int(n); got != want {\n\t\tt.Errorf(\"got %d TOC entries; want %d\", got, want)\n\t}\n\tt.Logf(\"got TOC entries:\")\n\tfor i, ent := range r.toc.Entries {\n\t\tentj, _ := json.Marshal(ent)\n\t\tt.Logf(\"  [%d]: %s\\n\", i, entj)\n\t}\n\tif t.Failed() {\n\t\tt.FailNow()\n\t}\n}\n\nfunc checks(s ...stargzCheck) []stargzCheck { return s }\n\ntype stargzCheck interface {\n\tcheck(t *testing.T, r *Reader)\n}\n\ntype stargzCheckFn func(*testing.T, *Reader)\n\nfunc (f stargzCheckFn) check(t *testing.T, r *Reader) { f(t, r) }\n\nfunc maxDepth(max int) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\te, ok := r.Lookup(\"\")\n\t\tif !ok {\n\t\t\tt.Fatal(\"root directory not found\")\n\t\t}\n\t\td, err := getMaxDepth(t, e, 0, 10*max)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to get max depth (wanted %d): %v\", max, err)\n\t\t\treturn\n\t\t}\n\t\tif d != max {\n\t\t\tt.Errorf(\"invalid depth %d; want %d\", d, max)\n\t\t\treturn\n\t\t}\n\t})\n}\n\nfunc getMaxDepth(t *testing.T, e *TOCEntry, current, limit int) (max int, rErr error) {\n\tif current > limit {\n\t\treturn -1, fmt.Errorf(\"walkMaxDepth: exceeds limit: current:%d > limit:%d\",\n\t\t\tcurrent, limit)\n\t}\n\tmax = current\n\te.ForeachChild(func(baseName string, ent *TOCEntry) bool {\n\t\tt.Logf(\"%q(basename:%q) is child of %q\\n\", ent.Name, baseName, e.Name)\n\t\td, err := getMaxDepth(t, ent, current+1, limit)\n\t\tif err != nil {\n\t\t\trErr = err\n\t\t\treturn false\n\t\t}\n\t\tif d > max {\n\t\t\tmax = d\n\t\t}\n\t\treturn true\n\t})\n\treturn\n}\n\nfunc hasFileLen(file string, wantLen int) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == file {\n\t\t\t\tif ent.Type != \"reg\" {\n\t\t\t\t\tt.Errorf(\"file type of %q is %q; want \\\"reg\\\"\", file, ent.Type)\n\t\t\t\t} else if ent.Size != int64(wantLen) {\n\t\t\t\t\tt.Errorf(\"file size of %q = %d; want %d\", file, ent.Size, wantLen)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"file %q not found\", file)\n\t})\n}\n\nfunc hasFileXattrs(file, name, value string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == file {\n\t\t\t\tif ent.Type != \"reg\" {\n\t\t\t\t\tt.Errorf(\"file type of %q is %q; want \\\"reg\\\"\", file, ent.Type)\n\t\t\t\t}\n\t\t\t\tif ent.Xattrs == nil {\n\t\t\t\t\tt.Errorf(\"file %q has no xattrs\", file)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvalueFound, found := ent.Xattrs[name]\n\t\t\t\tif !found {\n\t\t\t\t\tt.Errorf(\"file %q has no xattr %q\", file, name)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif string(valueFound) != value {\n\t\t\t\t\tt.Errorf(\"file %q has xattr %q with value %q instead of %q\", file, name, valueFound, value)\n\t\t\t\t}\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"file %q not found\", file)\n\t})\n}\n\nfunc hasFileDigest(file string, digest string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tent, ok := r.Lookup(file)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"didn't find TOCEntry for file %q\", file)\n\t\t}\n\t\tif ent.Digest != digest {\n\t\t\tt.Fatalf(\"Digest(%q) = %q, want %q\", file, ent.Digest, digest)\n\t\t}\n\t})\n}\n\nfunc hasFileContentsWithPreRead(file string, offset int, want string, extra ...chunkInfo) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\textraMap := make(map[string]chunkInfo)\n\t\tfor _, e := range extra {\n\t\t\textraMap[e.name] = e\n\t\t}\n\t\tvar extraNames []string\n\t\tfor n := range extraMap {\n\t\t\textraNames = append(extraNames, n)\n\t\t}\n\t\tf, err := r.OpenFileWithPreReader(file, func(e *TOCEntry, cr io.Reader) error {\n\t\t\tt.Logf(\"On %q: got preread of %q\", file, e.Name)\n\t\t\tex, ok := extraMap[e.Name]\n\t\t\tif !ok {\n\t\t\t\tt.Fatalf(\"fail on %q: unexpected entry %q: %+v, %+v\", file, e.Name, e, extraNames)\n\t\t\t}\n\t\t\tgot, err := io.ReadAll(cr)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"fail on %q: failed to read %q: %v\", file, e.Name, err)\n\t\t\t}\n\t\t\tif ex.data != string(got) {\n\t\t\t\tt.Fatalf(\"fail on %q: unexpected contents of %q: len=%d; want=%d\", file, e.Name, len(got), len(ex.data))\n\t\t\t}\n\t\t\tdelete(extraMap, e.Name)\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tgot := make([]byte, len(want))\n\t\tn, err := f.ReadAt(got, int64(offset))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ReadAt(len %d, offset %d, size %d) = %v, %v\", len(got), offset, f.Size(), n, err)\n\t\t}\n\t\tif string(got) != want {\n\t\t\tt.Fatalf(\"ReadAt(len %d, offset %d) = %q, want %q\", len(got), offset, viewContent(got), viewContent([]byte(want)))\n\t\t}\n\t\tif len(extraMap) != 0 {\n\t\t\tvar exNames []string\n\t\t\tfor _, ex := range extraMap {\n\t\t\t\texNames = append(exNames, ex.name)\n\t\t\t}\n\t\t\tt.Fatalf(\"fail on %q: some entries aren't read: %+v\", file, exNames)\n\t\t}\n\t})\n}\n\nfunc hasFileContentsRange(file string, offset int, want string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tf, err := r.OpenFile(file)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tgot := make([]byte, len(want))\n\t\tn, err := f.ReadAt(got, int64(offset))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ReadAt(len %d, offset %d) = %v, %v\", len(got), offset, n, err)\n\t\t}\n\t\tif string(got) != want {\n\t\t\tt.Fatalf(\"ReadAt(len %d, offset %d) = %q, want %q\", len(got), offset, viewContent(got), viewContent([]byte(want)))\n\t\t}\n\t})\n}\n\nfunc hasChunkEntries(file string, wantChunks int) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tent, ok := r.Lookup(file)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"no file for %q\", file)\n\t\t}\n\t\tif ent.Type != \"reg\" {\n\t\t\tt.Fatalf(\"file %q has unexpected type %q; want reg\", file, ent.Type)\n\t\t}\n\t\tchunks := r.getChunks(ent)\n\t\tif len(chunks) != wantChunks {\n\t\t\tt.Errorf(\"len(r.getChunks(%q)) = %d; want %d\", file, len(chunks), wantChunks)\n\t\t\treturn\n\t\t}\n\t\tf := chunks[0]\n\n\t\tvar gotChunks []*TOCEntry\n\t\tvar last *TOCEntry\n\t\tfor off := int64(0); off < f.Size; off++ {\n\t\t\te, ok := r.ChunkEntryForOffset(file, off)\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"no ChunkEntryForOffset at %d\", off)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif last != e {\n\t\t\t\tgotChunks = append(gotChunks, e)\n\t\t\t\tlast = e\n\t\t\t}\n\t\t}\n\t\tif !reflect.DeepEqual(chunks, gotChunks) {\n\t\t\tt.Errorf(\"gotChunks=%d, want=%d; contents mismatch\", len(gotChunks), wantChunks)\n\t\t}\n\n\t\t// And verify the NextOffset\n\t\tfor i := 0; i < len(gotChunks)-1; i++ {\n\t\t\tci := gotChunks[i]\n\t\t\tcnext := gotChunks[i+1]\n\t\t\tif ci.NextOffset() != cnext.Offset {\n\t\t\t\tt.Errorf(\"chunk %d NextOffset %d != next chunk's Offset of %d\", i, ci.NextOffset(), cnext.Offset)\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc entryHasChildren(dir string, want ...string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\twant := append([]string(nil), want...)\n\t\tvar got []string\n\t\tent, ok := r.Lookup(dir)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"didn't find TOCEntry for dir node %q\", dir)\n\t\t}\n\t\tfor baseName := range ent.children {\n\t\t\tgot = append(got, baseName)\n\t\t}\n\t\tsort.Strings(got)\n\t\tsort.Strings(want)\n\t\tif !reflect.DeepEqual(got, want) {\n\t\t\tt.Errorf(\"children of %q = %q; want %q\", dir, got, want)\n\t\t}\n\t})\n}\n\nfunc hasDir(file string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == cleanEntryName(file) {\n\t\t\t\tif ent.Type != \"dir\" {\n\t\t\t\t\tt.Errorf(\"file type of %q is %q; want \\\"dir\\\"\", file, ent.Type)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"directory %q not found\", file)\n\t})\n}\n\nfunc hasDirLinkCount(file string, count int) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == cleanEntryName(file) {\n\t\t\t\tif ent.Type != \"dir\" {\n\t\t\t\t\tt.Errorf(\"file type of %q is %q; want \\\"dir\\\"\", file, ent.Type)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif ent.NumLink != count {\n\t\t\t\t\tt.Errorf(\"link count of %q = %d; want %d\", file, ent.NumLink, count)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"directory %q not found\", file)\n\t})\n}\n\nfunc hasMode(file string, mode os.FileMode) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == cleanEntryName(file) {\n\t\t\t\tif ent.Stat().Mode() != mode {\n\t\t\t\t\tt.Errorf(\"invalid mode: got %v; want %v\", ent.Stat().Mode(), mode)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"file %q not found\", file)\n\t})\n}\n\nfunc hasSymlink(file, target string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tfor _, ent := range r.toc.Entries {\n\t\t\tif ent.Name == file {\n\t\t\t\tif ent.Type != \"symlink\" {\n\t\t\t\t\tt.Errorf(\"file type of %q is %q; want \\\"symlink\\\"\", file, ent.Type)\n\t\t\t\t} else if ent.LinkName != target {\n\t\t\t\t\tt.Errorf(\"link target of symlink %q is %q; want %q\", file, ent.LinkName, target)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tt.Errorf(\"symlink %q not found\", file)\n\t})\n}\n\nfunc lookupMatch(name string, want *TOCEntry) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\te, ok := r.Lookup(name)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"failed to Lookup entry %q\", name)\n\t\t}\n\t\tif !reflect.DeepEqual(e, want) {\n\t\t\tt.Errorf(\"entry %q mismatch.\\n got: %+v\\nwant: %+v\\n\", name, e, want)\n\t\t}\n\n\t})\n}\n\nfunc hasEntryOwner(entry string, owner owner) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tent, ok := r.Lookup(strings.TrimSuffix(entry, \"/\"))\n\t\tif !ok {\n\t\t\tt.Errorf(\"entry %q not found\", entry)\n\t\t\treturn\n\t\t}\n\t\tif ent.UID != owner.uid || ent.GID != owner.gid {\n\t\t\tt.Errorf(\"entry %q has invalid owner (uid:%d, gid:%d) instead of (uid:%d, gid:%d)\", entry, ent.UID, ent.GID, owner.uid, owner.gid)\n\t\t\treturn\n\t\t}\n\t})\n}\n\nfunc mustSameEntry(files ...string) stargzCheck {\n\treturn stargzCheckFn(func(t *testing.T, r *Reader) {\n\t\tvar first *TOCEntry\n\t\tfor _, f := range files {\n\t\t\tif first == nil {\n\t\t\t\tvar ok bool\n\t\t\t\tfirst, ok = r.Lookup(f)\n\t\t\t\tif !ok {\n\t\t\t\t\tt.Errorf(\"unknown first file on Lookup: %q\", f)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Test Lookup\n\t\t\te, ok := r.Lookup(f)\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"unknown file on Lookup: %q\", f)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif e != first {\n\t\t\t\tt.Errorf(\"Lookup: %+v(%p) != %+v(%p)\", e, e, first, first)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Test LookupChild\n\t\t\tpe, ok := r.Lookup(filepath.Dir(filepath.Clean(f)))\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"failed to get parent of %q\", f)\n\t\t\t\treturn\n\t\t\t}\n\t\t\te, ok = pe.LookupChild(filepath.Base(filepath.Clean(f)))\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\"failed to get %q as the child of %+v\", f, pe)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif e != first {\n\t\t\t\tt.Errorf(\"LookupChild: %+v(%p) != %+v(%p)\", e, e, first, first)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Test ForeachChild\n\t\t\tpe.ForeachChild(func(baseName string, e *TOCEntry) bool {\n\t\t\t\tif baseName == filepath.Base(filepath.Clean(f)) {\n\t\t\t\t\tif e != first {\n\t\t\t\t\t\tt.Errorf(\"ForeachChild: %+v(%p) != %+v(%p)\", e, e, first, first)\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\t\t}\n\t})\n}\n\nfunc viewContent(c []byte) string {\n\tif len(c) < 100 {\n\t\treturn string(c)\n\t}\n\treturn string(c[:50]) + \"...(omit)...\" + string(c[50:100])\n}\n\nfunc tarOf(s ...tarEntry) []tarEntry { return s }\n\ntype tarEntry interface {\n\tappendTar(tw *tar.Writer, prefix string, format tar.Format) error\n}\n\ntype tarEntryFunc func(*tar.Writer, string, tar.Format) error\n\nfunc (f tarEntryFunc) appendTar(tw *tar.Writer, prefix string, format tar.Format) error {\n\treturn f(tw, prefix, format)\n}\n\nfunc buildTar(t *testing.T, ents []tarEntry, prefix string, opts ...interface{}) *io.SectionReader {\n\tformat := tar.FormatUnknown\n\tfor _, opt := range opts {\n\t\tswitch v := opt.(type) {\n\t\tcase tar.Format:\n\t\t\tformat = v\n\t\tdefault:\n\t\t\tpanic(fmt.Errorf(\"unsupported opt for buildTar: %v\", opt))\n\t\t}\n\t}\n\tbuf := new(bytes.Buffer)\n\ttw := tar.NewWriter(buf)\n\tfor _, ent := range ents {\n\t\tif err := ent.appendTar(tw, prefix, format); err != nil {\n\t\t\tt.Fatalf(\"building input tar: %v\", err)\n\t\t}\n\t}\n\tif err := tw.Close(); err != nil {\n\t\tt.Errorf(\"closing write of input tar: %v\", err)\n\t}\n\tdata := append(buf.Bytes(), make([]byte, 100)...) // append empty bytes at the tail to see lossless works\n\treturn io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data)))\n}\n\nfunc dir(name string, opts ...interface{}) tarEntry {\n\treturn tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error {\n\t\tvar o owner\n\t\tmode := os.FileMode(0755)\n\t\tfor _, opt := range opts {\n\t\t\tswitch v := opt.(type) {\n\t\t\tcase owner:\n\t\t\t\to = v\n\t\t\tcase os.FileMode:\n\t\t\t\tmode = v\n\t\t\tdefault:\n\t\t\t\treturn errors.New(\"unsupported opt\")\n\t\t\t}\n\t\t}\n\t\tif !strings.HasSuffix(name, \"/\") {\n\t\t\tpanic(fmt.Sprintf(\"missing trailing slash in dir %q \", name))\n\t\t}\n\t\ttm, err := fileModeToTarMode(mode)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn tw.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeDir,\n\t\t\tName:     prefix + name,\n\t\t\tMode:     tm,\n\t\t\tUid:      o.uid,\n\t\t\tGid:      o.gid,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\n\n// xAttr are extended attributes to set on test files created with the file func.\ntype xAttr map[string]string\n\n// owner is owner ot set on test files and directories with the file and dir functions.\ntype owner struct {\n\tuid int\n\tgid int\n}\n\nfunc file(name, contents string, opts ...interface{}) tarEntry {\n\treturn tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error {\n\t\tvar xattrs xAttr\n\t\tvar o owner\n\t\tmode := os.FileMode(0644)\n\t\tfor _, opt := range opts {\n\t\t\tswitch v := opt.(type) {\n\t\t\tcase xAttr:\n\t\t\t\txattrs = v\n\t\t\tcase owner:\n\t\t\t\to = v\n\t\t\tcase os.FileMode:\n\t\t\t\tmode = v\n\t\t\tdefault:\n\t\t\t\treturn errors.New(\"unsupported opt\")\n\t\t\t}\n\t\t}\n\t\tif strings.HasSuffix(name, \"/\") {\n\t\t\treturn fmt.Errorf(\"bogus trailing slash in file %q\", name)\n\t\t}\n\t\ttm, err := fileModeToTarMode(mode)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(xattrs) > 0 {\n\t\t\tformat = tar.FormatPAX // only PAX supports xattrs\n\t\t}\n\t\tif err := tw.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeReg,\n\t\t\tName:     prefix + name,\n\t\t\tMode:     tm,\n\t\t\tXattrs:   xattrs,\n\t\t\tSize:     int64(len(contents)),\n\t\t\tUid:      o.uid,\n\t\t\tGid:      o.gid,\n\t\t\tFormat:   format,\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = io.WriteString(tw, contents)\n\t\treturn err\n\t})\n}\n\nfunc symlink(name, target string) tarEntry {\n\treturn tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error {\n\t\treturn tw.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\tName:     prefix + name,\n\t\t\tLinkname: target,\n\t\t\tMode:     0644,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\n\nfunc link(name string, linkname string) tarEntry {\n\tnow := time.Now()\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\treturn w.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeLink,\n\t\t\tName:     prefix + name,\n\t\t\tLinkname: linkname,\n\t\t\tModTime:  now,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\n\nfunc chardev(name string, major, minor int64) tarEntry {\n\tnow := time.Now()\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\treturn w.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeChar,\n\t\t\tName:     prefix + name,\n\t\t\tDevmajor: major,\n\t\t\tDevminor: minor,\n\t\t\tModTime:  now,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\n\nfunc blockdev(name string, major, minor int64) tarEntry {\n\tnow := time.Now()\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\treturn w.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeBlock,\n\t\t\tName:     prefix + name,\n\t\t\tDevmajor: major,\n\t\t\tDevminor: minor,\n\t\t\tModTime:  now,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\nfunc fifo(name string) tarEntry {\n\tnow := time.Now()\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\treturn w.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeFifo,\n\t\t\tName:     prefix + name,\n\t\t\tModTime:  now,\n\t\t\tFormat:   format,\n\t\t})\n\t})\n}\n\nfunc prefetchLandmark() tarEntry {\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\tif err := w.WriteHeader(&tar.Header{\n\t\t\tName:     PrefetchLandmark,\n\t\t\tTypeflag: tar.TypeReg,\n\t\t\tSize:     int64(len([]byte{landmarkContents})),\n\t\t\tFormat:   format,\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontents := []byte{landmarkContents}\n\t\tif _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc noPrefetchLandmark() tarEntry {\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\tif err := w.WriteHeader(&tar.Header{\n\t\t\tName:     NoPrefetchLandmark,\n\t\t\tTypeflag: tar.TypeReg,\n\t\t\tSize:     int64(len([]byte{landmarkContents})),\n\t\t\tFormat:   format,\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontents := []byte{landmarkContents}\n\t\tif _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc regDigest(t *testing.T, name string, contentStr string, digestMap map[string]digest.Digest) tarEntry {\n\tif digestMap == nil {\n\t\tt.Fatalf(\"digest map mustn't be nil\")\n\t}\n\tcontent := []byte(contentStr)\n\n\tvar n int64\n\tfor n < int64(len(content)) {\n\t\tsize := int64(chunkSize)\n\t\tremain := int64(len(content)) - n\n\t\tif remain < size {\n\t\t\tsize = remain\n\t\t}\n\t\tdgstr := digest.Canonical.Digester()\n\t\tif _, err := io.CopyN(dgstr.Hash(), bytes.NewReader(content[n:n+size]), size); err != nil {\n\t\t\tt.Fatalf(\"failed to calculate digest of %q (name=%q,offset=%d,size=%d)\",\n\t\t\t\tstring(content[n:n+size]), name, n, size)\n\t\t}\n\t\tdigestMap[chunkID(name, n, size)] = dgstr.Digest()\n\t\tn += size\n\t}\n\n\treturn tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error {\n\t\tif err := w.WriteHeader(&tar.Header{\n\t\t\tTypeflag: tar.TypeReg,\n\t\t\tName:     prefix + name,\n\t\t\tSize:     int64(len(content)),\n\t\t\tFormat:   format,\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.CopyN(w, bytes.NewReader(content), int64(len(content))); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n\nvar runes = []rune(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\nfunc randomContents(n int) string {\n\tb := make([]rune, n)\n\tfor i := range b {\n\t\tbi, err := rand.Int(rand.Reader, big.NewInt(int64(len(runes))))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb[i] = runes[int(bi.Int64())]\n\t}\n\treturn string(b)\n}\n\nfunc fileModeToTarMode(mode os.FileMode) (int64, error) {\n\th, err := tar.FileInfoHeader(fileInfoOnlyMode(mode), \"\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn h.Mode, nil\n}\n\n// fileInfoOnlyMode is os.FileMode that populates only file mode.\ntype fileInfoOnlyMode os.FileMode\n\nfunc (f fileInfoOnlyMode) Name() string       { return \"\" }\nfunc (f fileInfoOnlyMode) Size() int64        { return 0 }\nfunc (f fileInfoOnlyMode) Mode() os.FileMode  { return os.FileMode(f) }\nfunc (f fileInfoOnlyMode) ModTime() time.Time { return time.Now() }\nfunc (f fileInfoOnlyMode) IsDir() bool        { return os.FileMode(f).IsDir() }\nfunc (f fileInfoOnlyMode) Sys() interface{}   { return nil }\n\nfunc CheckGzipHasStreams(t *testing.T, b []byte, streams []int64) {\n\tif len(streams) == 0 {\n\t\treturn // nop\n\t}\n\n\twants := map[int64]struct{}{}\n\tfor _, s := range streams {\n\t\twants[s] = struct{}{}\n\t}\n\n\tlen0 := len(b)\n\tbr := bytes.NewReader(b)\n\tzr := new(gzip.Reader)\n\tt.Logf(\"got gzip streams:\")\n\tnumStreams := 0\n\tfor {\n\t\tzoff := len0 - br.Len()\n\t\tif err := zr.Reset(br); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt.Fatalf(\"countStreams(gzip), Reset: %v\", err)\n\t\t}\n\t\tzr.Multistream(false)\n\t\tn, err := io.Copy(io.Discard, zr)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"countStreams(gzip), Copy: %v\", err)\n\t\t}\n\t\tvar extra string\n\t\tif len(zr.Header.Extra) > 0 {\n\t\t\textra = fmt.Sprintf(\"; extra=%q\", zr.Header.Extra)\n\t\t}\n\t\tt.Logf(\"  [%d] at %d in stargz, uncompressed length %d%s\", numStreams, zoff, n, extra)\n\t\tdelete(wants, int64(zoff))\n\t\tnumStreams++\n\t}\n}\n\nfunc GzipDiffIDOf(t *testing.T, b []byte) string {\n\th := sha256.New()\n\tzr, err := gzip.NewReader(bytes.NewReader(b))\n\tif err != nil {\n\t\tt.Fatalf(\"diffIDOf(gzip): %v\", err)\n\t}\n\tdefer zr.Close()\n\tif _, err := io.Copy(h, zr); err != nil {\n\t\tt.Fatalf(\"diffIDOf(gzip).Copy: %v\", err)\n\t}\n\treturn fmt.Sprintf(\"sha256:%x\", h.Sum(nil))\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/stargz-snapshotter/estargz/types.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\n   Copyright 2019 The Go Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.\n*/\n\npackage estargz\n\nimport (\n\t\"archive/tar\"\n\t\"hash\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"time\"\n\n\tdigest \"github.com/opencontainers/go-digest\"\n)\n\nconst (\n\t// TOCTarName is the name of the JSON file in the tar archive in the\n\t// table of contents gzip stream.\n\tTOCTarName = \"stargz.index.json\"\n\n\t// FooterSize is the number of bytes in the footer\n\t//\n\t// The footer is an empty gzip stream with no compression and an Extra\n\t// header of the form \"%016xSTARGZ\", where the 64 bit hex-encoded\n\t// number is the offset to the gzip stream of JSON TOC.\n\t//\n\t// 51 comes from:\n\t//\n\t// 10 bytes  gzip header\n\t// 2  bytes  XLEN (length of Extra field) = 26 (4 bytes header + 16 hex digits + len(\"STARGZ\"))\n\t// 2  bytes  Extra: SI1 = 'S', SI2 = 'G'\n\t// 2  bytes  Extra: LEN = 22 (16 hex digits + len(\"STARGZ\"))\n\t// 22 bytes  Extra: subfield = fmt.Sprintf(\"%016xSTARGZ\", offsetOfTOC)\n\t// 5  bytes  flate header\n\t// 8  bytes  gzip footer\n\t// (End of the eStargz blob)\n\t//\n\t// NOTE: For Extra fields, subfield IDs SI1='S' SI2='G' is used for eStargz.\n\tFooterSize = 51\n\n\t// legacyFooterSize is the number of bytes in the legacy stargz footer.\n\t//\n\t// 47 comes from:\n\t//\n\t//   10 byte gzip header +\n\t//   2 byte (LE16) length of extra, encoding 22 (16 hex digits + len(\"STARGZ\")) == \"\\x16\\x00\" +\n\t//   22 bytes of extra (fmt.Sprintf(\"%016xSTARGZ\", tocGzipOffset))\n\t//   5 byte flate header\n\t//   8 byte gzip footer (two little endian uint32s: digest, size)\n\tlegacyFooterSize = 47\n\n\t// TOCJSONDigestAnnotation is an annotation for an image layer. This stores the\n\t// digest of the TOC JSON.\n\t// This annotation is valid only when it is specified in `.[]layers.annotations`\n\t// of an image manifest.\n\tTOCJSONDigestAnnotation = \"containerd.io/snapshot/stargz/toc.digest\"\n\n\t// StoreUncompressedSizeAnnotation is an additional annotation key for eStargz to enable lazy\n\t// pulling on containers/storage. Stargz Store is required to expose the layer's uncompressed size\n\t// to the runtime but current OCI image doesn't ship this information by default. So we store this\n\t// to the special annotation.\n\tStoreUncompressedSizeAnnotation = \"io.containers.estargz.uncompressed-size\"\n\n\t// PrefetchLandmark is a file entry which indicates the end position of\n\t// prefetch in the stargz file.\n\tPrefetchLandmark = \".prefetch.landmark\"\n\n\t// NoPrefetchLandmark is a file entry which indicates that no prefetch should\n\t// occur in the stargz file.\n\tNoPrefetchLandmark = \".no.prefetch.landmark\"\n\n\tlandmarkContents = 0xf\n)\n\n// JTOC is the JSON-serialized table of contents index of the files in the stargz file.\ntype JTOC struct {\n\tVersion int         `json:\"version\"`\n\tEntries []*TOCEntry `json:\"entries\"`\n}\n\n// TOCEntry is an entry in the stargz file's TOC (Table of Contents).\ntype TOCEntry struct {\n\t// Name is the tar entry's name. It is the complete path\n\t// stored in the tar file, not just the base name.\n\tName string `json:\"name\"`\n\n\t// Type is one of \"dir\", \"reg\", \"symlink\", \"hardlink\", \"char\",\n\t// \"block\", \"fifo\", or \"chunk\".\n\t// The \"chunk\" type is used for regular file data chunks past the first\n\t// TOCEntry; the 2nd chunk and on have only Type (\"chunk\"), Offset,\n\t// ChunkOffset, and ChunkSize populated.\n\tType string `json:\"type\"`\n\n\t// Size, for regular files, is the logical size of the file.\n\tSize int64 `json:\"size,omitempty\"`\n\n\t// ModTime3339 is the modification time of the tar entry. Empty\n\t// means zero or unknown. Otherwise it's in UTC RFC3339\n\t// format. Use the ModTime method to access the time.Time value.\n\tModTime3339 string `json:\"modtime,omitempty\"`\n\tmodTime     time.Time\n\n\t// LinkName, for symlinks and hardlinks, is the link target.\n\tLinkName string `json:\"linkName,omitempty\"`\n\n\t// Mode is the permission and mode bits.\n\tMode int64 `json:\"mode,omitempty\"`\n\n\t// UID is the user ID of the owner.\n\tUID int `json:\"uid,omitempty\"`\n\n\t// GID is the group ID of the owner.\n\tGID int `json:\"gid,omitempty\"`\n\n\t// Uname is the username of the owner.\n\t//\n\t// In the serialized JSON, this field may only be present for\n\t// the first entry with the same UID.\n\tUname string `json:\"userName,omitempty\"`\n\n\t// Gname is the group name of the owner.\n\t//\n\t// In the serialized JSON, this field may only be present for\n\t// the first entry with the same GID.\n\tGname string `json:\"groupName,omitempty\"`\n\n\t// Offset, for regular files, provides the offset in the\n\t// stargz file to the file's data bytes. See ChunkOffset and\n\t// ChunkSize.\n\tOffset int64 `json:\"offset,omitempty\"`\n\n\t// InnerOffset is an optional field indicates uncompressed offset\n\t// of this \"reg\" or \"chunk\" payload in a stream starts from Offset.\n\t// This field enables to put multiple \"reg\" or \"chunk\" payloads\n\t// in one chunk with having the same Offset but different InnerOffset.\n\tInnerOffset int64 `json:\"innerOffset,omitempty\"`\n\n\tnextOffset int64 // the Offset of the next entry with a non-zero Offset\n\n\t// DevMajor is the major device number for \"char\" and \"block\" types.\n\tDevMajor int `json:\"devMajor,omitempty\"`\n\n\t// DevMinor is the major device number for \"char\" and \"block\" types.\n\tDevMinor int `json:\"devMinor,omitempty\"`\n\n\t// NumLink is the number of entry names pointing to this entry.\n\t// Zero means one name references this entry.\n\t// This field is calculated during runtime and not recorded in TOC JSON.\n\tNumLink int `json:\"-\"`\n\n\t// Xattrs are the extended attribute for the entry.\n\tXattrs map[string][]byte `json:\"xattrs,omitempty\"`\n\n\t// Digest stores the OCI checksum for regular files payload.\n\t// It has the form \"sha256:abcdef01234....\".\n\tDigest string `json:\"digest,omitempty\"`\n\n\t// ChunkOffset is non-zero if this is a chunk of a large,\n\t// regular file. If so, the Offset is where the gzip header of\n\t// ChunkSize bytes at ChunkOffset in Name begin.\n\t//\n\t// In serialized form, a \"chunkSize\" JSON field of zero means\n\t// that the chunk goes to the end of the file. After reading\n\t// from the stargz TOC, though, the ChunkSize is initialized\n\t// to a non-zero file for when Type is either \"reg\" or\n\t// \"chunk\".\n\tChunkOffset int64 `json:\"chunkOffset,omitempty\"`\n\tChunkSize   int64 `json:\"chunkSize,omitempty\"`\n\n\t// ChunkDigest stores an OCI digest of the chunk. This must be formed\n\t// as \"sha256:0123abcd...\".\n\tChunkDigest string `json:\"chunkDigest,omitempty\"`\n\n\tchildren map[string]*TOCEntry\n\n\t// chunkTopIndex is index of the entry where Offset starts in the blob.\n\tchunkTopIndex int\n}\n\n// ModTime returns the entry's modification time.\nfunc (e *TOCEntry) ModTime() time.Time { return e.modTime }\n\n// NextOffset returns the position (relative to the start of the\n// stargz file) of the next gzip boundary after e.Offset.\nfunc (e *TOCEntry) NextOffset() int64 { return e.nextOffset }\n\nfunc (e *TOCEntry) addChild(baseName string, child *TOCEntry) {\n\tif e.children == nil {\n\t\te.children = make(map[string]*TOCEntry)\n\t}\n\tif child.Type == \"dir\" {\n\t\te.NumLink++ // Entry \"..\" in the subdirectory links to this directory\n\t}\n\te.children[baseName] = child\n}\n\n// isDataType reports whether TOCEntry is a regular file or chunk (something that\n// contains regular file data).\nfunc (e *TOCEntry) isDataType() bool { return e.Type == \"reg\" || e.Type == \"chunk\" }\n\n// Stat returns a FileInfo value representing e.\nfunc (e *TOCEntry) Stat() os.FileInfo { return fileInfo{e} }\n\n// ForeachChild calls f for each child item. If f returns false, iteration ends.\n// If e is not a directory, f is not called.\nfunc (e *TOCEntry) ForeachChild(f func(baseName string, ent *TOCEntry) bool) {\n\tfor name, ent := range e.children {\n\t\tif !f(name, ent) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// LookupChild returns the directory e's child by its base name.\nfunc (e *TOCEntry) LookupChild(baseName string) (child *TOCEntry, ok bool) {\n\tchild, ok = e.children[baseName]\n\treturn\n}\n\n// fileInfo implements os.FileInfo using the wrapped *TOCEntry.\ntype fileInfo struct{ e *TOCEntry }\n\nvar _ os.FileInfo = fileInfo{}\n\nfunc (fi fileInfo) Name() string       { return path.Base(fi.e.Name) }\nfunc (fi fileInfo) IsDir() bool        { return fi.e.Type == \"dir\" }\nfunc (fi fileInfo) Size() int64        { return fi.e.Size }\nfunc (fi fileInfo) ModTime() time.Time { return fi.e.ModTime() }\nfunc (fi fileInfo) Sys() interface{}   { return fi.e }\nfunc (fi fileInfo) Mode() (m os.FileMode) {\n\t// TOCEntry.Mode is tar.Header.Mode so we can understand the these bits using `tar` pkg.\n\tm = (&tar.Header{Mode: fi.e.Mode}).FileInfo().Mode() &\n\t\t(os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky)\n\tswitch fi.e.Type {\n\tcase \"dir\":\n\t\tm |= os.ModeDir\n\tcase \"symlink\":\n\t\tm |= os.ModeSymlink\n\tcase \"char\":\n\t\tm |= os.ModeDevice | os.ModeCharDevice\n\tcase \"block\":\n\t\tm |= os.ModeDevice\n\tcase \"fifo\":\n\t\tm |= os.ModeNamedPipe\n\t}\n\treturn m\n}\n\n// TOCEntryVerifier holds verifiers that are usable for verifying chunks contained\n// in a eStargz blob.\ntype TOCEntryVerifier interface {\n\n\t// Verifier provides a content verifier that can be used for verifying the\n\t// contents of the specified TOCEntry.\n\tVerifier(ce *TOCEntry) (digest.Verifier, error)\n}\n\n// Compression provides the compression helper to be used creating and parsing eStargz.\n// This package provides gzip-based Compression by default, but any compression\n// algorithm (e.g. zstd) can be used as long as it implements Compression.\ntype Compression interface {\n\tCompressor\n\tDecompressor\n}\n\n// Compressor represents the helper mothods to be used for creating eStargz.\ntype Compressor interface {\n\t// Writer returns WriteCloser to be used for writing a chunk to eStargz.\n\t// Everytime a chunk is written, the WriteCloser is closed and Writer is\n\t// called again for writing the next chunk.\n\t//\n\t// The returned writer should implement \"Flush() error\" function that flushes\n\t// any pending compressed data to the underlying writer.\n\tWriter(w io.Writer) (WriteFlushCloser, error)\n\n\t// WriteTOCAndFooter is called to write JTOC to the passed Writer.\n\t// diffHash calculates the DiffID (uncompressed sha256 hash) of the blob\n\t// WriteTOCAndFooter can optionally write anything that affects DiffID calculation\n\t// (e.g. uncompressed TOC JSON).\n\t//\n\t// This function returns tocDgst that represents the digest of TOC that will be used\n\t// to verify this blob when it's parsed.\n\tWriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (tocDgst digest.Digest, err error)\n}\n\n// Decompressor represents the helper mothods to be used for parsing eStargz.\ntype Decompressor interface {\n\t// Reader returns ReadCloser to be used for decompressing file payload.\n\tReader(r io.Reader) (io.ReadCloser, error)\n\n\t// FooterSize returns the size of the footer of this blob.\n\tFooterSize() int64\n\n\t// ParseFooter parses the footer and returns the offset and (compressed) size of TOC.\n\t// payloadBlobSize is the (compressed) size of the blob payload (i.e. the size between\n\t// the top until the TOC JSON).\n\t//\n\t// If tocOffset < 0, we assume that TOC isn't contained in the blob and pass nil reader\n\t// to ParseTOC. We expect that ParseTOC acquire TOC from the external location and return it.\n\t//\n\t// tocSize is optional. If tocSize <= 0, it's by default the size of the range from tocOffset until the beginning of the\n\t// footer (blob size - tocOff - FooterSize).\n\t// If blobPayloadSize < 0, blobPayloadSize become the blob size.\n\tParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error)\n\n\t// ParseTOC parses TOC from the passed reader. The reader provides the partial contents\n\t// of the underlying blob that has the range specified by ParseFooter method.\n\t//\n\t// This function returns tocDgst that represents the digest of TOC that will be used\n\t// to verify this blob. This must match to the value returned from\n\t// Compressor.WriteTOCAndFooter that is used when creating this blob.\n\t//\n\t// If tocOffset returned by ParseFooter is < 0, we assume that TOC isn't contained in the blob.\n\t// Pass nil reader to ParseTOC then we expect that ParseTOC acquire TOC from the external location\n\t// and return it.\n\tParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error)\n}\n\ntype WriteFlushCloser interface {\n\tio.WriteCloser\n\tFlush() error\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/.gitattributes",
    "content": "*.go text eol=lf\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/.gitignore",
    "content": "# Binaries for programs and plugins\n/bin/\n*.exe\n*.dll\n*.so\n*.dylib\n\n# Test binary, build with `go test -c`\n*.test\n\n# Output of the go coverage tool, specifically when used with LiteIDE\n*.out\ncoverage.txt\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/.golangci.yml",
    "content": "linters:\n  enable:\n    - staticcheck\n    - unconvert\n    - gofmt\n    - goimports\n    - revive\n    - ineffassign\n    - vet\n    - unused\n    - misspell\n  disable:\n    - errcheck\n\nlinters-settings:\n  revive:\n    ignore-generated-headers: true\n    rules:\n      - name: blank-imports\n      - name: context-as-argument\n      - name: context-keys-type\n      - name: dot-imports\n      - name: error-return\n      - name: error-strings\n      - name: error-naming\n      - name: exported\n      - name: if-return\n      - name: increment-decrement\n      - name: var-naming\n        arguments: [[\"UID\", \"GID\"], []]\n      - name: var-declaration\n      - name: package-comments\n      - name: range\n      - name: receiver-naming\n      - name: time-naming\n      - name: unexported-return\n      - name: indent-error-flow\n      - name: errorf\n      - name: empty-block\n      - name: superfluous-else\n      - name: unused-parameter\n      - name: unreachable-code\n      - name: redefines-builtin-id\n\nissues:\n  include:\n    - EXC0002\n\nrun:\n  timeout: 8m\n  skip-dirs:\n    - example\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/Makefile",
    "content": "#   Copyright The containerd Authors.\n\n#   Licensed under the Apache License, Version 2.0 (the \"License\");\n#   you may not use this file except in compliance with the License.\n#   You may obtain a copy of the License at\n\n#       http://www.apache.org/licenses/LICENSE-2.0\n\n#   Unless required by applicable law or agreed to in writing, software\n#   distributed under the License is distributed on an \"AS IS\" BASIS,\n#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#   See the License for the specific language governing permissions and\n#   limitations under the License.\n\n\n# Go command to use for build\nGO ?= go\nINSTALL ?= install\n\n# Root directory of the project (absolute path).\nROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))\n\nWHALE = \"🇩\"\nONI = \"👹\"\n\n# Project binaries.\nCOMMANDS=protoc-gen-go-ttrpc protoc-gen-gogottrpc\n\nifdef BUILDTAGS\n    GO_BUILDTAGS = ${BUILDTAGS}\nendif\nGO_BUILDTAGS ?=\nGO_TAGS=$(if $(GO_BUILDTAGS),-tags \"$(strip $(GO_BUILDTAGS))\",)\n\n# Project packages.\nPACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /example)\nTESTPACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /cmd | grep -v /integration | grep -v /example)\nBINPACKAGES=$(addprefix ./cmd/,$(COMMANDS))\n\n#Replaces \":\" (*nix), \";\" (windows) with newline for easy parsing\nGOPATHS=$(shell echo ${GOPATH} | tr \":\" \"\\n\" | tr \";\" \"\\n\")\n\nTESTFLAGS_RACE=\nGO_BUILD_FLAGS=\n# See Golang issue re: '-trimpath': https://github.com/golang/go/issues/13809\nGO_GCFLAGS=$(shell\t\t\t\t\\\n\tset -- ${GOPATHS};\t\t\t\\\n\techo \"-gcflags=-trimpath=$${1}/src\";\t\\\n\t)\n\nBINARIES=$(addprefix bin/,$(COMMANDS))\n\n# Flags passed to `go test`\nTESTFLAGS ?= $(TESTFLAGS_RACE) $(EXTRA_TESTFLAGS)\nTESTFLAGS_PARALLEL ?= 8\n\n# Use this to replace `go test` with, for instance, `gotestsum`\nGOTEST ?= $(GO) test\n\n.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install vendor install-protobuf install-protobuild\n.DEFAULT: default\n\n# Forcibly set the default goal to all, in case an include above brought in a rule definition.\n.DEFAULT_GOAL := all\n\nall: binaries\n\ncheck: proto-fmt ## run all linters\n\t@echo \"$(WHALE) $@\"\n\tGOGC=75 golangci-lint run\n\nci: check binaries check-protos coverage # coverage-integration ## to be used by the CI\n\nAUTHORS: .mailmap .git/HEAD\n\tgit log --format='%aN <%aE>' | sort -fu > $@\n\ngenerate: protos\n\t@echo \"$(WHALE) $@\"\n\t@PATH=\"${ROOTDIR}/bin:${PATH}\" $(GO) generate -x ${PACKAGES}\n\nprotos: bin/protoc-gen-gogottrpc bin/protoc-gen-go-ttrpc ## generate protobuf\n\t@echo \"$(WHALE) $@\"\n\t@(PATH=\"${ROOTDIR}/bin:${PATH}\" protobuild --quiet ${PACKAGES})\n\ncheck-protos: protos ## check if protobufs needs to be generated again\n\t@echo \"$(WHALE) $@\"\n\t@test -z \"$$(git status --short | grep \".pb.go\" | tee /dev/stderr)\" || \\\n\t\t((git diff | cat) && \\\n\t\t(echo \"$(ONI) please run 'make protos' when making changes to proto files\" && false))\n\ncheck-api-descriptors: protos ## check that protobuf changes aren't present.\n\t@echo \"$(WHALE) $@\"\n\t@test -z \"$$(git status --short | grep \".pb.txt\" | tee /dev/stderr)\" || \\\n\t\t((git diff $$(find . -name '*.pb.txt') | cat) && \\\n\t\t(echo \"$(ONI) please run 'make protos' when making changes to proto files and check-in the generated descriptor file changes\" && false))\n\nproto-fmt: ## check format of proto files\n\t@echo \"$(WHALE) $@\"\n\t@test -z \"$$(find . -name '*.proto' -type f -exec grep -Hn -e \"^ \" {} \\; | tee /dev/stderr)\" || \\\n\t\t(echo \"$(ONI) please indent proto files with tabs only\" && false)\n\t@test -z \"$$(find . -name '*.proto' -type f -exec grep -Hn \"Meta meta = \" {} \\; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)\" || \\\n\t\t(echo \"$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false\" && false)\n\nbuild: ## build the go packages\n\t@echo \"$(WHALE) $@\"\n\t@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${PACKAGES}\n\ntest: ## run tests, except integration tests and tests that require root\n\t@echo \"$(WHALE) $@\"\n\t@$(GOTEST) ${TESTFLAGS} ${TESTPACKAGES}\n\nintegration: ## run integration tests\n\t@echo \"$(WHALE) $@\"\n\t@cd \"${ROOTDIR}/integration\" && $(GOTEST) -v ${TESTFLAGS}  -parallel ${TESTFLAGS_PARALLEL} .\n\nbenchmark: ## run benchmarks tests\n\t@echo \"$(WHALE) $@\"\n\t@$(GO) test ${TESTFLAGS} -bench . -run Benchmark\n\nFORCE:\n\ndefine BUILD_BINARY\n@echo \"$(WHALE) $@\"\n@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_TAGS}  ./$<\nendef\n\n# Build a binary from a cmd.\nbin/%: cmd/% FORCE\n\t$(call BUILD_BINARY)\n\nbinaries: $(BINARIES) ## build binaries\n\t@echo \"$(WHALE) $@\"\n\nclean: ## clean up binaries\n\t@echo \"$(WHALE) $@\"\n\t@rm -f $(BINARIES)\n\ninstall: ## install binaries\n\t@echo \"$(WHALE) $@ $(BINPACKAGES)\"\n\t@$(GO) install $(BINPACKAGES)\n\ninstall-protobuf:\n\t@echo \"$(WHALE) $@\"\n\t@script/install-protobuf\n\ninstall-protobuild:\n\t@echo \"$(WHALE) $@\"\n\t@$(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1\n\t@$(GO) install github.com/containerd/protobuild@14832ccc41429f5c4f81028e5af08aa233a219cf\n\ncoverage: ## generate coverprofiles from the unit tests, except tests that require root\n\t@echo \"$(WHALE) $@\"\n\t@rm -f coverage.txt\n\t@$(GO) test ${TESTFLAGS} ${TESTPACKAGES} 2> /dev/null\n\t@( for pkg in ${PACKAGES}; do \\\n\t\t$(GO) test ${TESTFLAGS} \\\n\t\t\t-cover \\\n\t\t\t-coverprofile=profile.out \\\n\t\t\t-covermode=atomic $$pkg || exit; \\\n\t\tif [ -f profile.out ]; then \\\n\t\t\tcat profile.out >> coverage.txt; \\\n\t\t\trm profile.out; \\\n\t\tfi; \\\n\tdone )\n\nvendor: ## ensure all the go.mod/go.sum files are up-to-date\n\t@echo \"$(WHALE) $@\"\n\t@$(GO) mod tidy\n\t@$(GO) mod verify\n\nverify-vendor: ## verify if all the go.mod/go.sum files are up-to-date\n\t@echo \"$(WHALE) $@\"\n\t@$(GO) mod tidy\n\t@$(GO) mod verify\n\t@test -z \"$$(git status --short | grep \"go.sum\" | tee /dev/stderr)\" || \\\n\t\t((git diff | cat) && \\\n\t\t(echo \"$(ONI) make sure to checkin changes after go mod tidy\" && false))\n\nhelp: ## this help\n\t@awk 'BEGIN {FS = \":.*?## \"} /^[a-zA-Z_-]+:.*?## / {printf \"\\033[36m%-30s\\033[0m %s\\n\", $$1, $$2}' $(MAKEFILE_LIST) | sort\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/PROTOCOL.md",
    "content": "# Protocol Specification\n\nThe ttrpc protocol is client/server protocol to support multiple request streams\nover a single connection with lightweight framing. The client represents the\nprocess which initiated the underlying connection and the server is the process\nwhich accepted the connection. The protocol is currently defined as\nasymmetrical, with clients sending requests and servers sending responses. Both\nclients and servers are able to send stream data. The roles are also used in\ndetermining the stream identifiers, with client initiated streams using odd\nnumber identifiers and server initiated using even number. The protocol may be\nextended in the future to support server initiated streams, that is not\nsupported in the latest version.\n\n## Purpose\n\nThe ttrpc protocol is designed to be lightweight and optimized for low latency\nand reliable connections between processes on the same host. The protocol does\nnot include features for handling unreliable connections such as handshakes,\nresets, pings, or flow control. The protocol is designed to make low-overhead\nimplementations as simple as possible. It is not intended as a suitable\nreplacement for HTTP2/3 over the network.\n\n## Message Frame\n\nEach Message Frame consists of a 10-byte message header followed\nby message data. The data length and stream ID are both big-endian\n4-byte unsigned integers. The message type is an unsigned 1-byte\ninteger. The flags are also an unsigned 1-byte integer and\nuse is defined by the message type.\n\n    +---------------------------------------------------------------+\n    |                       Data Length (32)                        |\n    +---------------------------------------------------------------+\n    |                        Stream ID (32)                         |\n    +---------------+-----------------------------------------------+\n    | Msg Type (8)  |\n    +---------------+\n    |   Flags (8)   |\n    +---------------+-----------------------------------------------+\n    |                           Data (*)                            |\n    +---------------------------------------------------------------+\n\nThe Data Length field represents the number of bytes in the Data field. The\ntotal frame size will always be Data Length + 10 bytes. The maximum data length\nis 4MB and any larger size should be rejected. Due to the maximum data size\nbeing less than 16MB, the first frame byte should always be zero. This first\nbyte should be considered reserved for future use.\n\nThe Stream ID must be odd for client initiated streams and even for server\ninitiated streams. Server initiated streams are not currently supported.\n\n## Mesage Types\n\n| Message Type | Name     | Description                      |\n|--------------|----------|----------------------------------|\n| 0x01         | Request  | Initiates stream                 |\n| 0x02         | Response | Final stream data and terminates |\n| 0x03         | Data     | Stream data                      |\n\n### Request\n\nThe request message is used to initiate stream and send along request data for\nproperly routing and handling the stream. The stream may indicate unary without\nany inbound or outbound stream data with only a response is expected on the\nstream. The request may also indicate the stream is still open for more data and\nno response is expected until data is finished. If the remote indicates the\nstream is closed, the request may be considered non-unary but without anymore\nstream data sent. In the case of `remote closed`, the remote still expects to\nreceive a response or stream data. For compatibility with non streaming clients,\na request with empty flags indicates a unary request.\n\n#### Request Flags\n\n| Flag | Name            | Description                                      |\n|------|-----------------|--------------------------------------------------|\n| 0x01 | `remote closed` | Non-unary, but no more data expected from remote |\n| 0x02 | `remote open`   | Non-unary, remote is still sending data          |\n\n### Response\n\nThe response message is used to end a stream with data, an empty response, or\nan error. A response message is the only expected message after a unary request.\nA non-unary request does not require a response message if the server is sending\nback stream data. A non-unary stream may return a single response message but no\nother stream data may follow.\n\n#### Response Flags\n\nNo response flags are defined at this time, flags should be empty.\n\n### Data\n\nThe data message is used to send data on an already initialized stream. Either\nclient or server may send data. A data message is not allowed on a unary stream.\nA data message should not be sent after indicating `remote closed` to the peer.\nThe last data message on a stream must set the `remote closed` flag.\n\nThe `no data` flag is used to indicate that the data message does not include\nany data. This is normally used with the `remote closed` flag to indicate the\nstream is now closed without transmitting any data. Since ttrpc normally\ntransmits a single object per message, a zero length data message may be\ninterpreted as an empty object. For example, transmitting the number zero as a\nprotobuf message ends up with a data length of zero, but the message is still\nconsidered data and should be processed.\n\n#### Data Flags\n\n| Flag | Name            | Description                       |\n|------|-----------------|-----------------------------------|\n| 0x01 | `remote closed` | No more data expected from remote |\n| 0x04 | `no data`       | This message does not have data   |\n\n## Streaming\n\nAll ttrpc requests use streams to transfer data. Unary streams will only have\ntwo messages sent per stream, a request from a client and a response from the\nserver. Non-unary streams, however, may send any numbers of messages from the\nclient and the server. This makes stream management more complicated than unary\nstreams since both client and server need to track additional state. To keep\nthis management as simple as possible, ttrpc minimizes the number of states and\nuses two flags instead of control frames. Each stream has two states while a\nstream is still alive: `local closed` and `remote closed`. Each peer considers\nlocal and remote from their own perspective and sets flags from the other peer's\nperspective. For example, if a client sends a data frame with the\n`remote closed` flag, that is indicating that the client is now `local closed`\nand the server will be `remote closed`. A unary operation does not need to send\nthese flags since each received message always indicates `remote closed`. Once a\npeer is both `local closed` and `remote closed`, the stream is considered\nfinished and may be cleaned up.\n\nDue to the asymmetric nature of the current protocol, a client should\nalways be in the `local closed` state before `remote closed` and a server should\nalways be in the `remote closed` state before `local closed`. This happens\nbecause the client is always initiating requests and a client always expects a\nfinal response back from a server to indicate the initiated request has been\nfulfilled. This may mean server sends a final empty response to finish a stream\neven after it has already completed sending data before the client.\n\n### Unary State Diagram\n\n         +--------+                                    +--------+\n         | Client |                                    | Server |\n         +---+----+                                    +----+---+\n             |               +---------+                    |\n      local  >---------------+ Request +--------------------> remote\n      closed |               +---------+                    | closed\n             |                                              |\n             |              +----------+                    |\n    finished <--------------+ Response +--------------------< finished\n             |              +----------+                    |\n             |                                              |\n\n### Non-Unary State Diagrams\n\nRC: `remote closed` flag\nRO: `remote open` flag\n\n         +--------+                                    +--------+\n         | Client |                                    | Server |\n         +---+----+                                    +----+---+\n             |             +--------------+                 |\n             >-------------+ Request [RO] +----------------->\n             |             +--------------+                 |\n             |                                              |\n             |                 +------+                     |\n             >-----------------+ Data +--------------------->\n             |                 +------+                     |\n             |                                              |\n             |               +-----------+                  |\n      local  >---------------+ Data [RC] +------------------> remote\n      closed |               +-----------+                  | closed\n             |                                              |\n             |              +----------+                    |\n    finished <--------------+ Response +--------------------< finished\n             |              +----------+                    |\n             |                                              |\n\n         +--------+                                    +--------+\n         | Client |                                    | Server |\n         +---+----+                                    +----+---+\n             |             +--------------+                 |\n      local  >-------------+ Request [RC] +-----------------> remote\n      closed |             +--------------+                 | closed\n             |                                              |\n             |                 +------+                     |\n             <-----------------+ Data +---------------------<\n             |                 +------+                     |\n             |                                              |\n             |               +-----------+                  |\n    finished <---------------+ Data [RC] +------------------< finished\n             |               +-----------+                  |\n             |                                              |\n\n         +--------+                                    +--------+\n         | Client |                                    | Server |\n         +---+----+                                    +----+---+\n             |             +--------------+                 |\n             >-------------+ Request [RO] +----------------->\n             |             +--------------+                 |\n             |                                              |\n             |                 +------+                     |\n             >-----------------+ Data +--------------------->\n             |                 +------+                     |\n             |                                              |\n             |                 +------+                     |\n             <-----------------+ Data +---------------------<\n             |                 +------+                     |\n             |                                              |\n             |                 +------+                     |\n             >-----------------+ Data +--------------------->\n             |                 +------+                     |\n             |                                              |\n             |               +-----------+                  |\n      local  >---------------+ Data [RC] +------------------> remote\n      closed |               +-----------+                  | closed\n             |                                              |\n             |                 +------+                     |\n             <-----------------+ Data +---------------------<\n             |                 +------+                     |\n             |                                              |\n             |               +-----------+                  |\n    finished <---------------+ Data [RC] +------------------< finished\n             |               +-----------+                  |\n             |                                              |\n\n## RPC\n\nWhile this protocol is defined primarily to support Remote Procedure Calls, the\nprotocol does not define the request and response types beyond the messages\ndefined in the protocol. The implementation provides a default protobuf\ndefinition of request and response which may be used for cross language rpc.\nAll implementations should at least define a request type which support\nrouting by procedure name and a response type which supports call status.\n\n## Version History\n\n| Version | Features            |\n|---------|---------------------|\n| 1.0     | Unary requests only |\n| 1.2     | Streaming support   |\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/Protobuild.toml",
    "content": "version = \"2\"\ngenerators = [\"go\"]\n\n# Control protoc include paths. Below are usually some good defaults, but feel\n# free to try it without them if it works for your project.\n[includes]\n  # Include paths that will be added before all others. Typically, you want to\n  # treat the root of the project as an include, but this may not be necessary.\n  before = [\".\"]\n\n  # Paths that will be added untouched to the end of the includes. We use\n  # `/usr/local/include` to pickup the common install location of protobuf.\n  # This is the default.\n  after = [\"/usr/local/include\"]\n\n# This section maps protobuf imports to Go packages. These will become\n# `-M` directives in the call to the go protobuf generator.\n[packages]\n  \"google/protobuf/any.proto\" = \"github.com/gogo/protobuf/types\"\n  \"proto/status.proto\" = \"google.golang.org/genproto/googleapis/rpc/status\"\n\n[[overrides]]\n# enable ttrpc and disable fieldpath and grpc for the shim\nprefixes = [\"github.com/containerd/ttrpc/integration/streaming\"]\ngenerators = [\"go\", \"go-ttrpc\"]\n\n[overrides.parameters.go-ttrpc]\nprefix = \"TTRPC\"\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/README.md",
    "content": "# ttrpc\n\n[![Build Status](https://github.com/containerd/ttrpc/actions/workflows/ci.yml/badge.svg)](https://github.com/containerd/ttrpc/actions/workflows/ci.yml)\n\nGRPC for low-memory environments.\n\nThe existing grpc-go project requires a lot of memory overhead for importing\npackages and at runtime. While this is great for many services with low density\nrequirements, this can be a problem when running a large number of services on\na single machine or on a machine with a small amount of memory.\n\nUsing the same GRPC definitions, this project reduces the binary size and\nprotocol overhead required. We do this by eliding the `net/http`, `net/http2`\nand `grpc` package used by grpc replacing it with a lightweight framing\nprotocol. The result are smaller binaries that use less resident memory with\nthe same ease of use as GRPC.\n\nPlease note that while this project supports generating either end of the\nprotocol, the generated service definitions will be incompatible with regular\nGRPC services, as they do not speak the same protocol.\n\n# Protocol\n\nSee the [protocol specification](./PROTOCOL.md).\n\n# Usage\n\nCreate a gogo vanity binary (see\n[`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an\nexample with the ttrpc plugin enabled.\n\nIt's recommended to use [`protobuild`](https://github.com/containerd/protobuild)\nto build the protobufs for this project, but this will work with protoc\ndirectly, if required.\n\n# Differences from GRPC\n\n- The protocol stack has been replaced with a lighter protocol that doesn't\n  require http, http2 and tls.\n- The client and server interface are identical whereas in GRPC there is a\n  client and server interface that are different.\n- The Go stdlib context package is used instead.\n\n# Status\n\nTODO:\n\n- [ ] Add testing under concurrent load to ensure\n- [ ] Verify connection error handling\n\n# Project details\n\nttrpc is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository.\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/channel.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"bufio\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"sync\"\n\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\nconst (\n\tmessageHeaderLength = 10\n\tmessageLengthMax    = 4 << 20\n)\n\ntype messageType uint8\n\nconst (\n\tmessageTypeRequest  messageType = 0x1\n\tmessageTypeResponse messageType = 0x2\n\tmessageTypeData     messageType = 0x3\n)\n\nfunc (mt messageType) String() string {\n\tswitch mt {\n\tcase messageTypeRequest:\n\t\treturn \"request\"\n\tcase messageTypeResponse:\n\t\treturn \"response\"\n\tcase messageTypeData:\n\t\treturn \"data\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\nconst (\n\tflagRemoteClosed uint8 = 0x1\n\tflagRemoteOpen   uint8 = 0x2\n\tflagNoData       uint8 = 0x4\n)\n\n// messageHeader represents the fixed-length message header of 10 bytes sent\n// with every request.\ntype messageHeader struct {\n\tLength   uint32      // length excluding this header. b[:4]\n\tStreamID uint32      // identifies which request stream message is a part of. b[4:8]\n\tType     messageType // message type b[8]\n\tFlags    uint8       // type specific flags b[9]\n}\n\nfunc readMessageHeader(p []byte, r io.Reader) (messageHeader, error) {\n\t_, err := io.ReadFull(r, p[:messageHeaderLength])\n\tif err != nil {\n\t\treturn messageHeader{}, err\n\t}\n\n\treturn messageHeader{\n\t\tLength:   binary.BigEndian.Uint32(p[:4]),\n\t\tStreamID: binary.BigEndian.Uint32(p[4:8]),\n\t\tType:     messageType(p[8]),\n\t\tFlags:    p[9],\n\t}, nil\n}\n\nfunc writeMessageHeader(w io.Writer, p []byte, mh messageHeader) error {\n\tbinary.BigEndian.PutUint32(p[:4], mh.Length)\n\tbinary.BigEndian.PutUint32(p[4:8], mh.StreamID)\n\tp[8] = byte(mh.Type)\n\tp[9] = mh.Flags\n\n\t_, err := w.Write(p[:])\n\treturn err\n}\n\nvar buffers sync.Pool\n\ntype channel struct {\n\tconn  net.Conn\n\tbw    *bufio.Writer\n\tbr    *bufio.Reader\n\thrbuf [messageHeaderLength]byte // avoid alloc when reading header\n\thwbuf [messageHeaderLength]byte\n}\n\nfunc newChannel(conn net.Conn) *channel {\n\treturn &channel{\n\t\tconn: conn,\n\t\tbw:   bufio.NewWriter(conn),\n\t\tbr:   bufio.NewReader(conn),\n\t}\n}\n\n// recv a message from the channel. The returned buffer contains the message.\n//\n// If a valid grpc status is returned, the message header\n// returned will be valid and caller should send that along to\n// the correct consumer. The bytes on the underlying channel\n// will be discarded.\nfunc (ch *channel) recv() (messageHeader, []byte, error) {\n\tmh, err := readMessageHeader(ch.hrbuf[:], ch.br)\n\tif err != nil {\n\t\treturn messageHeader{}, nil, err\n\t}\n\n\tif mh.Length > uint32(messageLengthMax) {\n\t\tif _, err := ch.br.Discard(int(mh.Length)); err != nil {\n\t\t\treturn mh, nil, fmt.Errorf(\"failed to discard after receiving oversized message: %w\", err)\n\t\t}\n\n\t\treturn mh, nil, status.Errorf(codes.ResourceExhausted, \"message length %v exceed maximum message size of %v\", mh.Length, messageLengthMax)\n\t}\n\n\tvar p []byte\n\tif mh.Length > 0 {\n\t\tp = ch.getmbuf(int(mh.Length))\n\t\tif _, err := io.ReadFull(ch.br, p); err != nil {\n\t\t\treturn messageHeader{}, nil, fmt.Errorf(\"failed reading message: %w\", err)\n\t\t}\n\t}\n\n\treturn mh, p, nil\n}\n\nfunc (ch *channel) send(streamID uint32, t messageType, flags uint8, p []byte) error {\n\tif len(p) > messageLengthMax {\n\t\treturn OversizedMessageError(len(p))\n\t}\n\n\tif err := writeMessageHeader(ch.bw, ch.hwbuf[:], messageHeader{Length: uint32(len(p)), StreamID: streamID, Type: t, Flags: flags}); err != nil {\n\t\treturn err\n\t}\n\n\tif len(p) > 0 {\n\t\t_, err := ch.bw.Write(p)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn ch.bw.Flush()\n}\n\nfunc (ch *channel) getmbuf(size int) []byte {\n\t// we can't use the standard New method on pool because we want to allocate\n\t// based on size.\n\tb, ok := buffers.Get().(*[]byte)\n\tif !ok || cap(*b) < size {\n\t\t// TODO(stevvooe): It may be better to allocate these in fixed length\n\t\t// buckets to reduce fragmentation but its not clear that would help\n\t\t// with performance. An ilogb approach or similar would work well.\n\t\tbb := make([]byte, size)\n\t\tb = &bb\n\t} else {\n\t\t*b = (*b)[:size]\n\t}\n\treturn *b\n}\n\nfunc (ch *channel) putmbuf(p []byte) {\n\tbuffers.Put(&p)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/client.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/containerd/log\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// Client for a ttrpc server\ntype Client struct {\n\tcodec   codec\n\tconn    net.Conn\n\tchannel *channel\n\n\tstreamLock   sync.RWMutex\n\tstreams      map[streamID]*stream\n\tnextStreamID streamID\n\tsendLock     sync.Mutex\n\n\tctx    context.Context\n\tclosed func()\n\n\tcloseOnce       sync.Once\n\tuserCloseFunc   func()\n\tuserCloseWaitCh chan struct{}\n\n\tinterceptor UnaryClientInterceptor\n}\n\n// ClientOpts configures a client\ntype ClientOpts func(c *Client)\n\n// WithOnClose sets the close func whenever the client's Close() method is called\nfunc WithOnClose(onClose func()) ClientOpts {\n\treturn func(c *Client) {\n\t\tc.userCloseFunc = onClose\n\t}\n}\n\n// WithUnaryClientInterceptor sets the provided client interceptor\nfunc WithUnaryClientInterceptor(i UnaryClientInterceptor) ClientOpts {\n\treturn func(c *Client) {\n\t\tc.interceptor = i\n\t}\n}\n\n// WithChainUnaryClientInterceptor sets the provided chain of client interceptors\nfunc WithChainUnaryClientInterceptor(interceptors ...UnaryClientInterceptor) ClientOpts {\n\treturn func(c *Client) {\n\t\tif len(interceptors) == 0 {\n\t\t\treturn\n\t\t}\n\t\tif c.interceptor != nil {\n\t\t\tinterceptors = append([]UnaryClientInterceptor{c.interceptor}, interceptors...)\n\t\t}\n\t\tc.interceptor = func(\n\t\t\tctx context.Context,\n\t\t\treq *Request,\n\t\t\treply *Response,\n\t\t\tinfo *UnaryClientInfo,\n\t\t\tfinal Invoker,\n\t\t) error {\n\t\t\treturn interceptors[0](ctx, req, reply, info,\n\t\t\t\tchainUnaryInterceptors(interceptors[1:], final, info))\n\t\t}\n\t}\n}\n\nfunc chainUnaryInterceptors(interceptors []UnaryClientInterceptor, final Invoker, info *UnaryClientInfo) Invoker {\n\tif len(interceptors) == 0 {\n\t\treturn final\n\t}\n\treturn func(\n\t\tctx context.Context,\n\t\treq *Request,\n\t\treply *Response,\n\t) error {\n\t\treturn interceptors[0](ctx, req, reply, info,\n\t\t\tchainUnaryInterceptors(interceptors[1:], final, info))\n\t}\n}\n\n// NewClient creates a new ttrpc client using the given connection\nfunc NewClient(conn net.Conn, opts ...ClientOpts) *Client {\n\tctx, cancel := context.WithCancel(context.Background())\n\tchannel := newChannel(conn)\n\tc := &Client{\n\t\tcodec:           codec{},\n\t\tconn:            conn,\n\t\tchannel:         channel,\n\t\tstreams:         make(map[streamID]*stream),\n\t\tnextStreamID:    1,\n\t\tclosed:          cancel,\n\t\tctx:             ctx,\n\t\tuserCloseFunc:   func() {},\n\t\tuserCloseWaitCh: make(chan struct{}),\n\t}\n\n\tfor _, o := range opts {\n\t\to(c)\n\t}\n\n\tif c.interceptor == nil {\n\t\tc.interceptor = defaultClientInterceptor\n\t}\n\n\tgo c.run()\n\treturn c\n}\n\nfunc (c *Client) send(sid uint32, mt messageType, flags uint8, b []byte) error {\n\tc.sendLock.Lock()\n\tdefer c.sendLock.Unlock()\n\treturn c.channel.send(sid, mt, flags, b)\n}\n\n// Call makes a unary request and returns with response\nfunc (c *Client) Call(ctx context.Context, service, method string, req, resp interface{}) error {\n\tpayload, err := c.codec.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar (\n\t\tcreq = &Request{\n\t\t\tService: service,\n\t\t\tMethod:  method,\n\t\t\tPayload: payload,\n\t\t\t// TODO: metadata from context\n\t\t}\n\n\t\tcresp = &Response{}\n\t)\n\n\tif metadata, ok := GetMetadata(ctx); ok {\n\t\tmetadata.setRequest(creq)\n\t}\n\n\tif dl, ok := ctx.Deadline(); ok {\n\t\tcreq.TimeoutNano = time.Until(dl).Nanoseconds()\n\t}\n\n\tinfo := &UnaryClientInfo{\n\t\tFullMethod: fullPath(service, method),\n\t}\n\tif err := c.interceptor(ctx, creq, cresp, info, c.dispatch); err != nil {\n\t\treturn err\n\t}\n\n\tif err := c.codec.Unmarshal(cresp.Payload, resp); err != nil {\n\t\treturn err\n\t}\n\n\tif cresp.Status != nil && cresp.Status.Code != int32(codes.OK) {\n\t\treturn status.ErrorProto(cresp.Status)\n\t}\n\treturn nil\n}\n\n// StreamDesc describes the stream properties, whether the stream has\n// a streaming client, a streaming server, or both\ntype StreamDesc struct {\n\tStreamingClient bool\n\tStreamingServer bool\n}\n\n// ClientStream is used to send or recv messages on the underlying stream\ntype ClientStream interface {\n\tCloseSend() error\n\tSendMsg(m interface{}) error\n\tRecvMsg(m interface{}) error\n}\n\ntype clientStream struct {\n\tctx          context.Context\n\ts            *stream\n\tc            *Client\n\tdesc         *StreamDesc\n\tlocalClosed  bool\n\tremoteClosed bool\n}\n\nfunc (cs *clientStream) CloseSend() error {\n\tif !cs.desc.StreamingClient {\n\t\treturn fmt.Errorf(\"%w: cannot close non-streaming client\", ErrProtocol)\n\t}\n\tif cs.localClosed {\n\t\treturn ErrStreamClosed\n\t}\n\terr := cs.s.send(messageTypeData, flagRemoteClosed|flagNoData, nil)\n\tif err != nil {\n\t\treturn filterCloseErr(err)\n\t}\n\tcs.localClosed = true\n\treturn nil\n}\n\nfunc (cs *clientStream) SendMsg(m interface{}) error {\n\tif !cs.desc.StreamingClient {\n\t\treturn fmt.Errorf(\"%w: cannot send data from non-streaming client\", ErrProtocol)\n\t}\n\tif cs.localClosed {\n\t\treturn ErrStreamClosed\n\t}\n\n\tvar (\n\t\tpayload []byte\n\t\terr     error\n\t)\n\tif m != nil {\n\t\tpayload, err = cs.c.codec.Marshal(m)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\terr = cs.s.send(messageTypeData, 0, payload)\n\tif err != nil {\n\t\treturn filterCloseErr(err)\n\t}\n\n\treturn nil\n}\n\nfunc (cs *clientStream) RecvMsg(m interface{}) error {\n\tif cs.remoteClosed {\n\t\treturn io.EOF\n\t}\n\n\tvar msg *streamMessage\n\tselect {\n\tcase <-cs.ctx.Done():\n\t\treturn cs.ctx.Err()\n\tcase <-cs.s.recvClose:\n\t\t// If recv has a pending message, process that first\n\t\tselect {\n\t\tcase msg = <-cs.s.recv:\n\t\tdefault:\n\t\t\treturn cs.s.recvErr\n\t\t}\n\tcase msg = <-cs.s.recv:\n\t}\n\n\tif msg.header.Type == messageTypeResponse {\n\t\tresp := &Response{}\n\t\terr := proto.Unmarshal(msg.payload[:msg.header.Length], resp)\n\t\t// return the payload buffer for reuse\n\t\tcs.c.channel.putmbuf(msg.payload)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := cs.c.codec.Unmarshal(resp.Payload, m); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif resp.Status != nil && resp.Status.Code != int32(codes.OK) {\n\t\t\treturn status.ErrorProto(resp.Status)\n\t\t}\n\n\t\tcs.c.deleteStream(cs.s)\n\t\tcs.remoteClosed = true\n\n\t\treturn nil\n\t} else if msg.header.Type == messageTypeData {\n\t\tif !cs.desc.StreamingServer {\n\t\t\tcs.c.deleteStream(cs.s)\n\t\t\tcs.remoteClosed = true\n\t\t\treturn fmt.Errorf(\"received data from non-streaming server: %w\", ErrProtocol)\n\t\t}\n\t\tif msg.header.Flags&flagRemoteClosed == flagRemoteClosed {\n\t\t\tcs.c.deleteStream(cs.s)\n\t\t\tcs.remoteClosed = true\n\n\t\t\tif msg.header.Flags&flagNoData == flagNoData {\n\t\t\t\treturn io.EOF\n\t\t\t}\n\t\t}\n\n\t\terr := cs.c.codec.Unmarshal(msg.payload[:msg.header.Length], m)\n\t\tcs.c.channel.putmbuf(msg.payload)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"unexpected %q message received: %w\", msg.header.Type, ErrProtocol)\n}\n\n// Close closes the ttrpc connection and underlying connection\nfunc (c *Client) Close() error {\n\tc.closeOnce.Do(func() {\n\t\tc.closed()\n\n\t\tc.conn.Close()\n\t})\n\treturn nil\n}\n\n// UserOnCloseWait is used to block until the user's on-close callback\n// finishes.\nfunc (c *Client) UserOnCloseWait(ctx context.Context) error {\n\tselect {\n\tcase <-c.userCloseWaitCh:\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}\n\nfunc (c *Client) run() {\n\terr := c.receiveLoop()\n\tc.Close()\n\tc.cleanupStreams(err)\n\n\tc.userCloseFunc()\n\tclose(c.userCloseWaitCh)\n}\n\nfunc (c *Client) receiveLoop() error {\n\tfor {\n\t\tselect {\n\t\tcase <-c.ctx.Done():\n\t\t\treturn ErrClosed\n\t\tdefault:\n\t\t\tvar (\n\t\t\t\tmsg = &streamMessage{}\n\t\t\t\terr error\n\t\t\t)\n\n\t\t\tmsg.header, msg.payload, err = c.channel.recv()\n\t\t\tif err != nil {\n\t\t\t\t_, ok := status.FromError(err)\n\t\t\t\tif !ok {\n\t\t\t\t\t// treat all errors that are not an rpc status as terminal.\n\t\t\t\t\t// all others poison the connection.\n\t\t\t\t\treturn filterCloseErr(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsid := streamID(msg.header.StreamID)\n\t\t\ts := c.getStream(sid)\n\t\t\tif s == nil {\n\t\t\t\tlog.G(c.ctx).WithField(\"stream\", sid).Error(\"ttrpc: received message on inactive stream\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\ts.closeWithError(err)\n\t\t\t} else {\n\t\t\t\tif err := s.receive(c.ctx, msg); err != nil {\n\t\t\t\t\tlog.G(c.ctx).WithFields(log.Fields{\"error\": err, \"stream\": sid}).Error(\"ttrpc: failed to handle message\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// createStream creates a new stream and registers it with the client\n// Introduce stream types for multiple or single response\nfunc (c *Client) createStream(flags uint8, b []byte) (*stream, error) {\n\t// sendLock must be held across both allocation of the stream ID and sending it across the wire.\n\t// This ensures that new stream IDs sent on the wire are always increasing, which is a\n\t// requirement of the TTRPC protocol.\n\t// This use of sendLock could be split into another mutex that covers stream creation + first send,\n\t// and just use sendLock to guard writing to the wire, but for now it seems simpler to have fewer mutexes.\n\tc.sendLock.Lock()\n\tdefer c.sendLock.Unlock()\n\n\t// Check if closed since lock acquired to prevent adding\n\t// anything after cleanup completes\n\tselect {\n\tcase <-c.ctx.Done():\n\t\treturn nil, ErrClosed\n\tdefault:\n\t}\n\n\tvar s *stream\n\tif err := func() error {\n\t\t// In the future this could be replaced with a sync.Map instead of streamLock+map.\n\t\tc.streamLock.Lock()\n\t\tdefer c.streamLock.Unlock()\n\n\t\t// Check if closed since lock acquired to prevent adding\n\t\t// anything after cleanup completes\n\t\tselect {\n\t\tcase <-c.ctx.Done():\n\t\t\treturn ErrClosed\n\t\tdefault:\n\t\t}\n\n\t\ts = newStream(c.nextStreamID, c)\n\t\tc.streams[s.id] = s\n\t\tc.nextStreamID = c.nextStreamID + 2\n\n\t\treturn nil\n\t}(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := c.channel.send(uint32(s.id), messageTypeRequest, flags, b); err != nil {\n\t\treturn s, filterCloseErr(err)\n\t}\n\n\treturn s, nil\n}\n\nfunc (c *Client) deleteStream(s *stream) {\n\tc.streamLock.Lock()\n\tdelete(c.streams, s.id)\n\tc.streamLock.Unlock()\n\ts.closeWithError(nil)\n}\n\nfunc (c *Client) getStream(sid streamID) *stream {\n\tc.streamLock.RLock()\n\ts := c.streams[sid]\n\tc.streamLock.RUnlock()\n\treturn s\n}\n\nfunc (c *Client) cleanupStreams(err error) {\n\tc.streamLock.Lock()\n\tdefer c.streamLock.Unlock()\n\n\tfor sid, s := range c.streams {\n\t\ts.closeWithError(err)\n\t\tdelete(c.streams, sid)\n\t}\n}\n\n// filterCloseErr rewrites EOF and EPIPE errors to ErrClosed. Use when\n// returning from call or handling errors from main read loop.\n//\n// This purposely ignores errors with a wrapped cause.\nfunc filterCloseErr(err error) error {\n\tswitch {\n\tcase err == nil:\n\t\treturn nil\n\tcase err == io.EOF:\n\t\treturn ErrClosed\n\tcase errors.Is(err, io.ErrClosedPipe):\n\t\treturn ErrClosed\n\tcase errors.Is(err, io.EOF):\n\t\treturn ErrClosed\n\tcase strings.Contains(err.Error(), \"use of closed network connection\"):\n\t\treturn ErrClosed\n\tdefault:\n\t\t// if we have an epipe on a write or econnreset on a read , we cast to errclosed\n\t\tvar oerr *net.OpError\n\t\tif errors.As(err, &oerr) {\n\t\t\tif (oerr.Op == \"write\" && errors.Is(err, syscall.EPIPE)) ||\n\t\t\t\t(oerr.Op == \"read\" && errors.Is(err, syscall.ECONNRESET)) {\n\t\t\t\treturn ErrClosed\n\t\t\t}\n\t\t}\n\t}\n\n\treturn err\n}\n\n// NewStream creates a new stream with the given stream descriptor to the\n// specified service and method. If not a streaming client, the request object\n// may be provided.\nfunc (c *Client) NewStream(ctx context.Context, desc *StreamDesc, service, method string, req interface{}) (ClientStream, error) {\n\tvar payload []byte\n\tif req != nil {\n\t\tvar err error\n\t\tpayload, err = c.codec.Marshal(req)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\trequest := &Request{\n\t\tService: service,\n\t\tMethod:  method,\n\t\tPayload: payload,\n\t\t// TODO: metadata from context\n\t}\n\tp, err := c.codec.Marshal(request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar flags uint8\n\tif desc.StreamingClient {\n\t\tflags = flagRemoteOpen\n\t} else {\n\t\tflags = flagRemoteClosed\n\t}\n\ts, err := c.createStream(flags, p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &clientStream{\n\t\tctx:  ctx,\n\t\ts:    s,\n\t\tc:    c,\n\t\tdesc: desc,\n\t}, nil\n}\n\nfunc (c *Client) dispatch(ctx context.Context, req *Request, resp *Response) error {\n\tp, err := c.codec.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts, err := c.createStream(0, p)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer c.deleteStream(s)\n\n\tvar msg *streamMessage\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase <-c.ctx.Done():\n\t\treturn ErrClosed\n\tcase <-s.recvClose:\n\t\t// If recv has a pending message, process that first\n\t\tselect {\n\t\tcase msg = <-s.recv:\n\t\tdefault:\n\t\t\treturn s.recvErr\n\t\t}\n\tcase msg = <-s.recv:\n\t}\n\n\tif msg.header.Type == messageTypeResponse {\n\t\terr = proto.Unmarshal(msg.payload[:msg.header.Length], resp)\n\t} else {\n\t\terr = fmt.Errorf(\"unexpected %q message received: %w\", msg.header.Type, ErrProtocol)\n\t}\n\n\t// return the payload buffer for reuse\n\tc.channel.putmbuf(msg.payload)\n\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/codec.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype codec struct{}\n\nfunc (c codec) Marshal(msg interface{}) ([]byte, error) {\n\tswitch v := msg.(type) {\n\tcase proto.Message:\n\t\treturn proto.Marshal(v)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ttrpc: cannot marshal unknown type: %T\", msg)\n\t}\n}\n\nfunc (c codec) Unmarshal(p []byte, msg interface{}) error {\n\tswitch v := msg.(type) {\n\tcase proto.Message:\n\t\treturn proto.Unmarshal(p, v)\n\tdefault:\n\t\treturn fmt.Errorf(\"ttrpc: cannot unmarshal into unknown type: %T\", msg)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/config.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n)\n\ntype serverConfig struct {\n\thandshaker  Handshaker\n\tinterceptor UnaryServerInterceptor\n}\n\n// ServerOpt for configuring a ttrpc server\ntype ServerOpt func(*serverConfig) error\n\n// WithServerHandshaker can be passed to NewServer to ensure that the\n// handshaker is called before every connection attempt.\n//\n// Only one handshaker is allowed per server.\nfunc WithServerHandshaker(handshaker Handshaker) ServerOpt {\n\treturn func(c *serverConfig) error {\n\t\tif c.handshaker != nil {\n\t\t\treturn errors.New(\"only one handshaker allowed per server\")\n\t\t}\n\t\tc.handshaker = handshaker\n\t\treturn nil\n\t}\n}\n\n// WithUnaryServerInterceptor sets the provided interceptor on the server\nfunc WithUnaryServerInterceptor(i UnaryServerInterceptor) ServerOpt {\n\treturn func(c *serverConfig) error {\n\t\tif c.interceptor != nil {\n\t\t\treturn errors.New(\"only one unchained interceptor allowed per server\")\n\t\t}\n\t\tc.interceptor = i\n\t\treturn nil\n\t}\n}\n\n// WithChainUnaryServerInterceptor sets the provided chain of server interceptors\nfunc WithChainUnaryServerInterceptor(interceptors ...UnaryServerInterceptor) ServerOpt {\n\treturn func(c *serverConfig) error {\n\t\tif len(interceptors) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tif c.interceptor != nil {\n\t\t\tinterceptors = append([]UnaryServerInterceptor{c.interceptor}, interceptors...)\n\t\t}\n\t\tc.interceptor = func(\n\t\t\tctx context.Context,\n\t\t\tunmarshal Unmarshaler,\n\t\t\tinfo *UnaryServerInfo,\n\t\t\tmethod Method) (interface{}, error) {\n\t\t\treturn interceptors[0](ctx, unmarshal, info,\n\t\t\t\tchainUnaryServerInterceptors(info, method, interceptors[1:]))\n\t\t}\n\t\treturn nil\n\t}\n}\n\nfunc chainUnaryServerInterceptors(info *UnaryServerInfo, method Method, interceptors []UnaryServerInterceptor) Method {\n\tif len(interceptors) == 0 {\n\t\treturn method\n\t}\n\treturn func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {\n\t\treturn interceptors[0](ctx, unmarshal, info,\n\t\t\tchainUnaryServerInterceptors(info, method, interceptors[1:]))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/doc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\n/*\npackage ttrpc defines and implements a low level simple transfer protocol\noptimized for low latency and reliable connections between processes on the same\nhost. The protocol uses simple framing for sending requests, responses, and data\nusing multiple streams.\n*/\npackage ttrpc\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/errors.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"errors\"\n\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\nvar (\n\t// ErrProtocol is a general error in the handling the protocol.\n\tErrProtocol = errors.New(\"protocol error\")\n\n\t// ErrClosed is returned by client methods when the underlying connection is\n\t// closed.\n\tErrClosed = errors.New(\"ttrpc: closed\")\n\n\t// ErrServerClosed is returned when the Server has closed its connection.\n\tErrServerClosed = errors.New(\"ttrpc: server closed\")\n\n\t// ErrStreamClosed is when the streaming connection is closed.\n\tErrStreamClosed = errors.New(\"ttrpc: stream closed\")\n)\n\n// OversizedMessageErr is used to indicate refusal to send an oversized message.\n// It wraps a ResourceExhausted grpc Status together with the offending message\n// length.\ntype OversizedMessageErr struct {\n\tmessageLength int\n\terr           error\n}\n\n// OversizedMessageError returns an OversizedMessageErr error for the given message\n// length if it exceeds the allowed maximum. Otherwise a nil error is returned.\nfunc OversizedMessageError(messageLength int) error {\n\tif messageLength <= messageLengthMax {\n\t\treturn nil\n\t}\n\n\treturn &OversizedMessageErr{\n\t\tmessageLength: messageLength,\n\t\terr:           status.Errorf(codes.ResourceExhausted, \"message length %v exceed maximum message size of %v\", messageLength, messageLengthMax),\n\t}\n}\n\n// Error returns the error message for the corresponding grpc Status for the error.\nfunc (e *OversizedMessageErr) Error() string {\n\treturn e.err.Error()\n}\n\n// Unwrap returns the corresponding error with our grpc status code.\nfunc (e *OversizedMessageErr) Unwrap() error {\n\treturn e.err\n}\n\n// RejectedLength retrieves the rejected message length which triggered the error.\nfunc (e *OversizedMessageErr) RejectedLength() int {\n\treturn e.messageLength\n}\n\n// MaximumLength retrieves the maximum allowed message length that triggered the error.\nfunc (*OversizedMessageErr) MaximumLength() int {\n\treturn messageLengthMax\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/handshake.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"net\"\n)\n\n// Handshaker defines the interface for connection handshakes performed on the\n// server or client when first connecting.\ntype Handshaker interface {\n\t// Handshake should confirm or decorate a connection that may be incoming\n\t// to a server or outgoing from a client.\n\t//\n\t// If this returns without an error, the caller should use the connection\n\t// in place of the original connection.\n\t//\n\t// The second return value can contain credential specific data, such as\n\t// unix socket credentials or TLS information.\n\t//\n\t// While we currently only have implementations on the server-side, this\n\t// interface should be sufficient to implement similar handshakes on the\n\t// client-side.\n\tHandshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error)\n}\n\ntype handshakerFunc func(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error)\n\nfunc (fn handshakerFunc) Handshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) {\n\treturn fn(ctx, conn)\n}\n\nfunc noopHandshake(_ context.Context, conn net.Conn) (net.Conn, interface{}, error) {\n\treturn conn, nil, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/interceptor.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport \"context\"\n\n// UnaryServerInfo provides information about the server request\ntype UnaryServerInfo struct {\n\tFullMethod string\n}\n\n// UnaryClientInfo provides information about the client request\ntype UnaryClientInfo struct {\n\tFullMethod string\n}\n\n// StreamServerInfo provides information about the server request\ntype StreamServerInfo struct {\n\tFullMethod      string\n\tStreamingClient bool\n\tStreamingServer bool\n}\n\n// Unmarshaler contains the server request data and allows it to be unmarshaled\n// into a concrete type\ntype Unmarshaler func(interface{}) error\n\n// Invoker invokes the client's request and response from the ttrpc server\ntype Invoker func(context.Context, *Request, *Response) error\n\n// UnaryServerInterceptor specifies the interceptor function for server request/response\ntype UnaryServerInterceptor func(context.Context, Unmarshaler, *UnaryServerInfo, Method) (interface{}, error)\n\n// UnaryClientInterceptor specifies the interceptor function for client request/response\ntype UnaryClientInterceptor func(context.Context, *Request, *Response, *UnaryClientInfo, Invoker) error\n\nfunc defaultServerInterceptor(ctx context.Context, unmarshal Unmarshaler, _ *UnaryServerInfo, method Method) (interface{}, error) {\n\treturn method(ctx, unmarshal)\n}\n\nfunc defaultClientInterceptor(ctx context.Context, req *Request, resp *Response, _ *UnaryClientInfo, invoker Invoker) error {\n\treturn invoker(ctx, req, resp)\n}\n\ntype StreamServerInterceptor func(context.Context, StreamServer, *StreamServerInfo, StreamHandler) (interface{}, error)\n\nfunc defaultStreamServerInterceptor(ctx context.Context, ss StreamServer, _ *StreamServerInfo, stream StreamHandler) (interface{}, error) {\n\treturn stream(ctx, ss)\n}\n\ntype StreamClientInterceptor func(context.Context)\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/metadata.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"strings\"\n)\n\n// MD is the user type for ttrpc metadata\ntype MD map[string][]string\n\n// Get returns the metadata for a given key when they exist.\n// If there is no metadata, a nil slice and false are returned.\nfunc (m MD) Get(key string) ([]string, bool) {\n\tkey = strings.ToLower(key)\n\tlist, ok := m[key]\n\tif !ok || len(list) == 0 {\n\t\treturn nil, false\n\t}\n\n\treturn list, true\n}\n\n// Set sets the provided values for a given key.\n// The values will overwrite any existing values.\n// If no values provided, a key will be deleted.\nfunc (m MD) Set(key string, values ...string) {\n\tkey = strings.ToLower(key)\n\tif len(values) == 0 {\n\t\tdelete(m, key)\n\t\treturn\n\t}\n\tm[key] = values\n}\n\n// Append appends additional values to the given key.\nfunc (m MD) Append(key string, values ...string) {\n\tkey = strings.ToLower(key)\n\tif len(values) == 0 {\n\t\treturn\n\t}\n\tcurrent, ok := m[key]\n\tif ok {\n\t\tm.Set(key, append(current, values...)...)\n\t} else {\n\t\tm.Set(key, values...)\n\t}\n}\n\n// Clone returns a copy of MD or nil if it's nil.\n// It's copied from golang's `http.Header.Clone` implementation:\n// https://cs.opensource.google/go/go/+/refs/tags/go1.23.4:src/net/http/header.go;l=94\nfunc (m MD) Clone() MD {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// Find total number of values.\n\tnv := 0\n\tfor _, vv := range m {\n\t\tnv += len(vv)\n\t}\n\tsv := make([]string, nv) // shared backing array for headers' values\n\tm2 := make(MD, len(m))\n\tfor k, vv := range m {\n\t\tif vv == nil {\n\t\t\t// Preserve nil values.\n\t\t\tm2[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tn := copy(sv, vv)\n\t\tm2[k] = sv[:n:n]\n\t\tsv = sv[n:]\n\t}\n\treturn m2\n}\n\nfunc (m MD) setRequest(r *Request) {\n\tfor k, values := range m {\n\t\tfor _, v := range values {\n\t\t\tr.Metadata = append(r.Metadata, &KeyValue{\n\t\t\t\tKey:   k,\n\t\t\t\tValue: v,\n\t\t\t})\n\t\t}\n\t}\n}\n\nfunc (m MD) fromRequest(r *Request) {\n\tfor _, kv := range r.Metadata {\n\t\tm[kv.Key] = append(m[kv.Key], kv.Value)\n\t}\n}\n\ntype metadataKey struct{}\n\n// GetMetadata retrieves metadata from context.Context (previously attached with WithMetadata)\nfunc GetMetadata(ctx context.Context) (MD, bool) {\n\tmetadata, ok := ctx.Value(metadataKey{}).(MD)\n\treturn metadata, ok\n}\n\n// GetMetadataValue gets a specific metadata value by name from context.Context\nfunc GetMetadataValue(ctx context.Context, name string) (string, bool) {\n\tmetadata, ok := GetMetadata(ctx)\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\n\tif list, ok := metadata.Get(name); ok {\n\t\treturn list[0], true\n\t}\n\n\treturn \"\", false\n}\n\n// WithMetadata attaches metadata map to a context.Context\nfunc WithMetadata(ctx context.Context, md MD) context.Context {\n\treturn context.WithValue(ctx, metadataKey{}, md)\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/request.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.20.1\n// source: github.com/containerd/ttrpc/request.proto\n\npackage ttrpc\n\nimport (\n\tstatus \"google.golang.org/genproto/googleapis/rpc/status\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Request struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tService     string      `protobuf:\"bytes,1,opt,name=service,proto3\" json:\"service,omitempty\"`\n\tMethod      string      `protobuf:\"bytes,2,opt,name=method,proto3\" json:\"method,omitempty\"`\n\tPayload     []byte      `protobuf:\"bytes,3,opt,name=payload,proto3\" json:\"payload,omitempty\"`\n\tTimeoutNano int64       `protobuf:\"varint,4,opt,name=timeout_nano,json=timeoutNano,proto3\" json:\"timeout_nano,omitempty\"`\n\tMetadata    []*KeyValue `protobuf:\"bytes,5,rep,name=metadata,proto3\" json:\"metadata,omitempty\"`\n}\n\nfunc (x *Request) Reset() {\n\t*x = Request{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Request) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Request) ProtoMessage() {}\n\nfunc (x *Request) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Request.ProtoReflect.Descriptor instead.\nfunc (*Request) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Request) GetService() string {\n\tif x != nil {\n\t\treturn x.Service\n\t}\n\treturn \"\"\n}\n\nfunc (x *Request) GetMethod() string {\n\tif x != nil {\n\t\treturn x.Method\n\t}\n\treturn \"\"\n}\n\nfunc (x *Request) GetPayload() []byte {\n\tif x != nil {\n\t\treturn x.Payload\n\t}\n\treturn nil\n}\n\nfunc (x *Request) GetTimeoutNano() int64 {\n\tif x != nil {\n\t\treturn x.TimeoutNano\n\t}\n\treturn 0\n}\n\nfunc (x *Request) GetMetadata() []*KeyValue {\n\tif x != nil {\n\t\treturn x.Metadata\n\t}\n\treturn nil\n}\n\ntype Response struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tStatus  *status.Status `protobuf:\"bytes,1,opt,name=status,proto3\" json:\"status,omitempty\"`\n\tPayload []byte         `protobuf:\"bytes,2,opt,name=payload,proto3\" json:\"payload,omitempty\"`\n}\n\nfunc (x *Response) Reset() {\n\t*x = Response{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Response) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Response) ProtoMessage() {}\n\nfunc (x *Response) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Response.ProtoReflect.Descriptor instead.\nfunc (*Response) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *Response) GetStatus() *status.Status {\n\tif x != nil {\n\t\treturn x.Status\n\t}\n\treturn nil\n}\n\nfunc (x *Response) GetPayload() []byte {\n\tif x != nil {\n\t\treturn x.Payload\n\t}\n\treturn nil\n}\n\ntype StringList struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tList []string `protobuf:\"bytes,1,rep,name=list,proto3\" json:\"list,omitempty\"`\n}\n\nfunc (x *StringList) Reset() {\n\t*x = StringList{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *StringList) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StringList) ProtoMessage() {}\n\nfunc (x *StringList) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use StringList.ProtoReflect.Descriptor instead.\nfunc (*StringList) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *StringList) GetList() []string {\n\tif x != nil {\n\t\treturn x.List\n\t}\n\treturn nil\n}\n\ntype KeyValue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tKey   string `protobuf:\"bytes,1,opt,name=key,proto3\" json:\"key,omitempty\"`\n\tValue string `protobuf:\"bytes,2,opt,name=value,proto3\" json:\"value,omitempty\"`\n}\n\nfunc (x *KeyValue) Reset() {\n\t*x = KeyValue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *KeyValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*KeyValue) ProtoMessage() {}\n\nfunc (x *KeyValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.\nfunc (*KeyValue) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *KeyValue) GetKey() string {\n\tif x != nil {\n\t\treturn x.Key\n\t}\n\treturn \"\"\n}\n\nfunc (x *KeyValue) GetValue() string {\n\tif x != nil {\n\t\treturn x.Value\n\t}\n\treturn \"\"\n}\n\nvar File_github_com_containerd_ttrpc_request_proto protoreflect.FileDescriptor\n\nvar file_github_com_containerd_ttrpc_request_proto_rawDesc = []byte{\n\t0x0a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,\n\t0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x74, 0x72,\n\t0x70, 0x63, 0x1a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65,\n\t0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20,\n\t0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06,\n\t0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65,\n\t0x74, 0x68, 0x6f, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18,\n\t0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21,\n\t0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x04,\n\t0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4e, 0x61, 0x6e,\n\t0x6f, 0x12, 0x2b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4b, 0x65, 0x79, 0x56,\n\t0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45,\n\t0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74,\n\t0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x53, 0x74, 0x61,\n\t0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70,\n\t0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61,\n\t0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c,\n\t0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,\n\t0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61,\n\t0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1d, 0x5a, 0x1b, 0x67,\n\t0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x33,\n}\n\nvar (\n\tfile_github_com_containerd_ttrpc_request_proto_rawDescOnce sync.Once\n\tfile_github_com_containerd_ttrpc_request_proto_rawDescData = file_github_com_containerd_ttrpc_request_proto_rawDesc\n)\n\nfunc file_github_com_containerd_ttrpc_request_proto_rawDescGZIP() []byte {\n\tfile_github_com_containerd_ttrpc_request_proto_rawDescOnce.Do(func() {\n\t\tfile_github_com_containerd_ttrpc_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_request_proto_rawDescData)\n\t})\n\treturn file_github_com_containerd_ttrpc_request_proto_rawDescData\n}\n\nvar file_github_com_containerd_ttrpc_request_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_github_com_containerd_ttrpc_request_proto_goTypes = []interface{}{\n\t(*Request)(nil),       // 0: ttrpc.Request\n\t(*Response)(nil),      // 1: ttrpc.Response\n\t(*StringList)(nil),    // 2: ttrpc.StringList\n\t(*KeyValue)(nil),      // 3: ttrpc.KeyValue\n\t(*status.Status)(nil), // 4: Status\n}\nvar file_github_com_containerd_ttrpc_request_proto_depIdxs = []int32{\n\t3, // 0: ttrpc.Request.metadata:type_name -> ttrpc.KeyValue\n\t4, // 1: ttrpc.Response.status:type_name -> Status\n\t2, // [2:2] is the sub-list for method output_type\n\t2, // [2:2] is the sub-list for method input_type\n\t2, // [2:2] is the sub-list for extension type_name\n\t2, // [2:2] is the sub-list for extension extendee\n\t0, // [0:2] is the sub-list for field type_name\n}\n\nfunc init() { file_github_com_containerd_ttrpc_request_proto_init() }\nfunc file_github_com_containerd_ttrpc_request_proto_init() {\n\tif File_github_com_containerd_ttrpc_request_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_github_com_containerd_ttrpc_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Request); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_ttrpc_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Response); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_ttrpc_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*StringList); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_github_com_containerd_ttrpc_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*KeyValue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_github_com_containerd_ttrpc_request_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_github_com_containerd_ttrpc_request_proto_goTypes,\n\t\tDependencyIndexes: file_github_com_containerd_ttrpc_request_proto_depIdxs,\n\t\tMessageInfos:      file_github_com_containerd_ttrpc_request_proto_msgTypes,\n\t}.Build()\n\tFile_github_com_containerd_ttrpc_request_proto = out.File\n\tfile_github_com_containerd_ttrpc_request_proto_rawDesc = nil\n\tfile_github_com_containerd_ttrpc_request_proto_goTypes = nil\n\tfile_github_com_containerd_ttrpc_request_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/request.proto",
    "content": "syntax = \"proto3\";\n\npackage ttrpc;\n\nimport \"proto/status.proto\";\n\noption go_package = \"github.com/containerd/ttrpc\";\n\nmessage Request {\n\tstring service = 1;\n\tstring method = 2;\n\tbytes payload = 3;\n\tint64 timeout_nano = 4;\n\trepeated KeyValue metadata = 5;\n}\n\nmessage Response {\n\tStatus status = 1;\n\tbytes payload = 2;\n}\n\nmessage StringList {\n\trepeated string list = 1;\n}\n\nmessage KeyValue {\n\tstring key = 1;\n\tstring value = 2;\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/server.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"math/rand\"\n\t\"net\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/containerd/log\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\ntype Server struct {\n\tconfig   *serverConfig\n\tservices *serviceSet\n\tcodec    codec\n\n\tmu          sync.Mutex\n\tlisteners   map[net.Listener]struct{}\n\tconnections map[*serverConn]struct{} // all connections to current state\n\tdone        chan struct{}            // marks point at which we stop serving requests\n}\n\nfunc NewServer(opts ...ServerOpt) (*Server, error) {\n\tconfig := &serverConfig{}\n\tfor _, opt := range opts {\n\t\tif err := opt(config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif config.interceptor == nil {\n\t\tconfig.interceptor = defaultServerInterceptor\n\t}\n\n\treturn &Server{\n\t\tconfig:      config,\n\t\tservices:    newServiceSet(config.interceptor),\n\t\tdone:        make(chan struct{}),\n\t\tlisteners:   make(map[net.Listener]struct{}),\n\t\tconnections: make(map[*serverConn]struct{}),\n\t}, nil\n}\n\n// Register registers a map of methods to method handlers\n// TODO: Remove in 2.0, does not support streams\nfunc (s *Server) Register(name string, methods map[string]Method) {\n\ts.services.register(name, &ServiceDesc{Methods: methods})\n}\n\nfunc (s *Server) RegisterService(name string, desc *ServiceDesc) {\n\ts.services.register(name, desc)\n}\n\nfunc (s *Server) Serve(ctx context.Context, l net.Listener) error {\n\ts.mu.Lock()\n\ts.addListenerLocked(l)\n\tdefer s.closeListener(l)\n\n\tselect {\n\tcase <-s.done:\n\t\ts.mu.Unlock()\n\t\treturn ErrServerClosed\n\tdefault:\n\t}\n\ts.mu.Unlock()\n\n\tvar (\n\t\tbackoff    time.Duration\n\t\thandshaker = s.config.handshaker\n\t)\n\n\tif handshaker == nil {\n\t\thandshaker = handshakerFunc(noopHandshake)\n\t}\n\n\tfor {\n\t\tconn, err := l.Accept()\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-s.done:\n\t\t\t\treturn ErrServerClosed\n\t\t\tdefault:\n\t\t\t}\n\n\t\t\tif terr, ok := err.(interface {\n\t\t\t\tTemporary() bool\n\t\t\t}); ok && terr.Temporary() {\n\t\t\t\tif backoff == 0 {\n\t\t\t\t\tbackoff = time.Millisecond\n\t\t\t\t} else {\n\t\t\t\t\tbackoff *= 2\n\t\t\t\t}\n\n\t\t\t\tif max := time.Second; backoff > max {\n\t\t\t\t\tbackoff = max\n\t\t\t\t}\n\n\t\t\t\tsleep := time.Duration(rand.Int63n(int64(backoff)))\n\t\t\t\tlog.G(ctx).WithError(err).Errorf(\"ttrpc: failed accept; backoff %v\", sleep)\n\t\t\t\ttime.Sleep(sleep)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\t\tbackoff = 0\n\n\t\tapproved, handshake, err := handshaker.Handshake(ctx, conn)\n\t\tif err != nil {\n\t\t\tlog.G(ctx).WithError(err).Error(\"ttrpc: refusing connection after handshake\")\n\t\t\tconn.Close()\n\t\t\tcontinue\n\t\t}\n\n\t\tsc, err := s.newConn(approved, handshake)\n\t\tif err != nil {\n\t\t\tlog.G(ctx).WithError(err).Error(\"ttrpc: create connection failed\")\n\t\t\tconn.Close()\n\t\t\tcontinue\n\t\t}\n\n\t\tgo sc.run(ctx)\n\t}\n}\n\nfunc (s *Server) Shutdown(ctx context.Context) error {\n\ts.mu.Lock()\n\tselect {\n\tcase <-s.done:\n\tdefault:\n\t\t// protected by mutex\n\t\tclose(s.done)\n\t}\n\tlnerr := s.closeListeners()\n\ts.mu.Unlock()\n\n\tticker := time.NewTicker(200 * time.Millisecond)\n\tdefer ticker.Stop()\n\tfor {\n\t\ts.closeIdleConns()\n\n\t\tif s.countConnection() == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tcase <-ticker.C:\n\t\t}\n\t}\n\n\treturn lnerr\n}\n\n// Close the server without waiting for active connections.\nfunc (s *Server) Close() error {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tselect {\n\tcase <-s.done:\n\tdefault:\n\t\t// protected by mutex\n\t\tclose(s.done)\n\t}\n\n\terr := s.closeListeners()\n\tfor c := range s.connections {\n\t\tc.close()\n\t\tdelete(s.connections, c)\n\t}\n\n\treturn err\n}\n\nfunc (s *Server) addListenerLocked(l net.Listener) {\n\ts.listeners[l] = struct{}{}\n}\n\nfunc (s *Server) closeListener(l net.Listener) error {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\treturn s.closeListenerLocked(l)\n}\n\nfunc (s *Server) closeListenerLocked(l net.Listener) error {\n\tdefer delete(s.listeners, l)\n\treturn l.Close()\n}\n\nfunc (s *Server) closeListeners() error {\n\tvar err error\n\tfor l := range s.listeners {\n\t\tif cerr := s.closeListenerLocked(l); cerr != nil && err == nil {\n\t\t\terr = cerr\n\t\t}\n\t}\n\treturn err\n}\n\nfunc (s *Server) addConnection(c *serverConn) error {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tselect {\n\tcase <-s.done:\n\t\treturn ErrServerClosed\n\tdefault:\n\t}\n\n\ts.connections[c] = struct{}{}\n\treturn nil\n}\n\nfunc (s *Server) delConnection(c *serverConn) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tdelete(s.connections, c)\n}\n\nfunc (s *Server) countConnection() int {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\treturn len(s.connections)\n}\n\nfunc (s *Server) closeIdleConns() {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tfor c := range s.connections {\n\t\tif st, ok := c.getState(); !ok || st == connStateActive {\n\t\t\tcontinue\n\t\t}\n\t\tc.close()\n\t\tdelete(s.connections, c)\n\t}\n}\n\ntype connState int\n\nconst (\n\tconnStateActive = iota + 1 // outstanding requests\n\tconnStateIdle              // no requests\n\tconnStateClosed            // closed connection\n)\n\nfunc (cs connState) String() string {\n\tswitch cs {\n\tcase connStateActive:\n\t\treturn \"active\"\n\tcase connStateIdle:\n\t\treturn \"idle\"\n\tcase connStateClosed:\n\t\treturn \"closed\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\nfunc (s *Server) newConn(conn net.Conn, handshake interface{}) (*serverConn, error) {\n\tc := &serverConn{\n\t\tserver:    s,\n\t\tconn:      conn,\n\t\thandshake: handshake,\n\t\tshutdown:  make(chan struct{}),\n\t}\n\tc.setState(connStateIdle)\n\tif err := s.addConnection(c); err != nil {\n\t\tc.close()\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}\n\ntype serverConn struct {\n\tserver    *Server\n\tconn      net.Conn\n\thandshake interface{} // data from handshake, not used for now\n\tstate     atomic.Value\n\n\tshutdownOnce sync.Once\n\tshutdown     chan struct{} // forced shutdown, used by close\n}\n\nfunc (c *serverConn) getState() (connState, bool) {\n\tcs, ok := c.state.Load().(connState)\n\treturn cs, ok\n}\n\nfunc (c *serverConn) setState(newstate connState) {\n\tc.state.Store(newstate)\n}\n\nfunc (c *serverConn) close() error {\n\tc.shutdownOnce.Do(func() {\n\t\tclose(c.shutdown)\n\t})\n\n\treturn nil\n}\n\nfunc (c *serverConn) run(sctx context.Context) {\n\ttype (\n\t\tresponse struct {\n\t\t\tid          uint32\n\t\t\tstatus      *status.Status\n\t\t\tdata        []byte\n\t\t\tcloseStream bool\n\t\t\tstreaming   bool\n\t\t}\n\t)\n\n\tvar (\n\t\tch                     = newChannel(c.conn)\n\t\tctx, cancel            = context.WithCancel(sctx)\n\t\tstate        connState = connStateIdle\n\t\tresponses              = make(chan response)\n\t\trecvErr                = make(chan error, 1)\n\t\tdone                   = make(chan struct{})\n\t\tstreams                = sync.Map{}\n\t\tactive       int32\n\t\tlastStreamID uint32\n\t)\n\n\tdefer c.conn.Close()\n\tdefer cancel()\n\tdefer close(done)\n\tdefer c.server.delConnection(c)\n\n\tsendStatus := func(id uint32, st *status.Status) bool {\n\t\tselect {\n\t\tcase responses <- response{\n\t\t\t// even though we've had an invalid stream id, we send it\n\t\t\t// back on the same stream id so the client knows which\n\t\t\t// stream id was bad.\n\t\t\tid:          id,\n\t\t\tstatus:      st,\n\t\t\tcloseStream: true,\n\t\t}:\n\t\t\treturn true\n\t\tcase <-c.shutdown:\n\t\t\treturn false\n\t\tcase <-done:\n\t\t\treturn false\n\t\t}\n\t}\n\n\tgo func(recvErr chan error) {\n\t\tdefer close(recvErr)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-c.shutdown:\n\t\t\t\treturn\n\t\t\tcase <-done:\n\t\t\t\treturn\n\t\t\tdefault: // proceed\n\t\t\t}\n\n\t\t\tmh, p, err := ch.recv()\n\t\t\tif err != nil {\n\t\t\t\tstatus, ok := status.FromError(err)\n\t\t\t\tif !ok {\n\t\t\t\t\trecvErr <- err\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// in this case, we send an error for that particular message\n\t\t\t\t// when the status is defined.\n\t\t\t\tif !sendStatus(mh.StreamID, status) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif mh.StreamID%2 != 1 {\n\t\t\t\t// enforce odd client initiated identifiers.\n\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"StreamID must be odd for client initiated streams\")) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif mh.Type == messageTypeData {\n\t\t\t\ti, ok := streams.Load(mh.StreamID)\n\t\t\t\tif !ok {\n\t\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"StreamID is no longer active\")) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsh := i.(*streamHandler)\n\t\t\t\tif mh.Flags&flagNoData != flagNoData {\n\t\t\t\t\tunmarshal := func(obj interface{}) error {\n\t\t\t\t\t\terr := protoUnmarshal(p, obj)\n\t\t\t\t\t\tch.putmbuf(p)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\n\t\t\t\t\tif err := sh.data(unmarshal); err != nil {\n\t\t\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"data handling error: %v\", err)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif mh.Flags&flagRemoteClosed == flagRemoteClosed {\n\t\t\t\t\tsh.closeSend()\n\t\t\t\t\tif len(p) > 0 {\n\t\t\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"data close message cannot include data\")) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if mh.Type == messageTypeRequest {\n\t\t\t\tif mh.StreamID <= lastStreamID {\n\t\t\t\t\t// enforce odd client initiated identifiers.\n\t\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"StreamID cannot be re-used and must increment\")) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\n\t\t\t\t}\n\t\t\t\tlastStreamID = mh.StreamID\n\n\t\t\t\t// TODO: Make request type configurable\n\t\t\t\t// Unmarshaller which takes in a byte array and returns an interface?\n\t\t\t\tvar req Request\n\t\t\t\tif err := c.server.codec.Unmarshal(p, &req); err != nil {\n\t\t\t\t\tch.putmbuf(p)\n\t\t\t\t\tif !sendStatus(mh.StreamID, status.Newf(codes.InvalidArgument, \"unmarshal request error: %v\", err)) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tch.putmbuf(p)\n\n\t\t\t\tid := mh.StreamID\n\t\t\t\trespond := func(status *status.Status, data []byte, streaming, closeStream bool) error {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase responses <- response{\n\t\t\t\t\t\tid:          id,\n\t\t\t\t\t\tstatus:      status,\n\t\t\t\t\t\tdata:        data,\n\t\t\t\t\t\tcloseStream: closeStream,\n\t\t\t\t\t\tstreaming:   streaming,\n\t\t\t\t\t}:\n\t\t\t\t\tcase <-done:\n\t\t\t\t\t\treturn ErrClosed\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tsh, err := c.server.services.handle(ctx, &req, respond)\n\t\t\t\tif err != nil {\n\t\t\t\t\tstatus, _ := status.FromError(err)\n\t\t\t\t\tif !sendStatus(mh.StreamID, status) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tstreams.Store(id, sh)\n\t\t\t\tatomic.AddInt32(&active, 1)\n\t\t\t}\n\t\t\t// TODO: else we must ignore this for future compat. log this?\n\t\t}\n\t}(recvErr)\n\n\tfor {\n\t\tvar (\n\t\t\tnewstate connState\n\t\t\tshutdown chan struct{}\n\t\t)\n\n\t\tactiveN := atomic.LoadInt32(&active)\n\t\tif activeN > 0 {\n\t\t\tnewstate = connStateActive\n\t\t\tshutdown = nil\n\t\t} else {\n\t\t\tnewstate = connStateIdle\n\t\t\tshutdown = c.shutdown // only enable this branch in idle mode\n\t\t}\n\t\tif newstate != state {\n\t\t\tc.setState(newstate)\n\t\t\tstate = newstate\n\t\t}\n\n\t\tselect {\n\t\tcase response := <-responses:\n\t\t\tif !response.streaming || response.status.Code() != codes.OK {\n\t\t\t\tp, err := c.server.codec.Marshal(&Response{\n\t\t\t\t\tStatus:  response.status.Proto(),\n\t\t\t\t\tPayload: response.data,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.G(ctx).WithError(err).Error(\"failed marshaling response\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif err := ch.send(response.id, messageTypeResponse, 0, p); err != nil {\n\t\t\t\t\tlog.G(ctx).WithError(err).Error(\"failed sending message on channel\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar flags uint8\n\t\t\t\tif response.closeStream {\n\t\t\t\t\tflags = flagRemoteClosed\n\t\t\t\t}\n\t\t\t\tif response.data == nil {\n\t\t\t\t\tflags = flags | flagNoData\n\t\t\t\t}\n\t\t\t\tif err := ch.send(response.id, messageTypeData, flags, response.data); err != nil {\n\t\t\t\t\tlog.G(ctx).WithError(err).Error(\"failed sending message on channel\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif response.closeStream {\n\t\t\t\t// The ttrpc protocol currently does not support the case where\n\t\t\t\t// the server is localClosed but not remoteClosed. Once the server\n\t\t\t\t// is closing, the whole stream may be considered finished\n\t\t\t\tstreams.Delete(response.id)\n\t\t\t\tatomic.AddInt32(&active, -1)\n\t\t\t}\n\t\tcase err := <-recvErr:\n\t\t\t// TODO(stevvooe): Not wildly clear what we should do in this\n\t\t\t// branch. Basically, it means that we are no longer receiving\n\t\t\t// requests due to a terminal error.\n\t\t\trecvErr = nil // connection is now \"closing\"\n\t\t\tif errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.ECONNRESET) {\n\t\t\t\t// The client went away and we should stop processing\n\t\t\t\t// requests, so that the client connection is closed\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.G(ctx).WithError(err).Error(\"error receiving message\")\n\t\t\t// else, initiate shutdown\n\t\tcase <-shutdown:\n\t\t\treturn\n\t\t}\n\t}\n}\n\nvar noopFunc = func() {}\n\nfunc getRequestContext(ctx context.Context, req *Request) (retCtx context.Context, cancel func()) {\n\tif len(req.Metadata) > 0 {\n\t\tmd := MD{}\n\t\tmd.fromRequest(req)\n\t\tctx = WithMetadata(ctx, md)\n\t}\n\n\tcancel = noopFunc\n\tif req.TimeoutNano == 0 {\n\t\treturn ctx, cancel\n\t}\n\n\tctx, cancel = context.WithTimeout(ctx, time.Duration(req.TimeoutNano))\n\treturn ctx, cancel\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/services.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"unsafe\"\n\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype Method func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error)\n\ntype StreamHandler func(context.Context, StreamServer) (interface{}, error)\n\ntype Stream struct {\n\tHandler         StreamHandler\n\tStreamingClient bool\n\tStreamingServer bool\n}\n\ntype ServiceDesc struct {\n\tMethods map[string]Method\n\tStreams map[string]Stream\n}\n\ntype serviceSet struct {\n\tservices          map[string]*ServiceDesc\n\tunaryInterceptor  UnaryServerInterceptor\n\tstreamInterceptor StreamServerInterceptor\n}\n\nfunc newServiceSet(interceptor UnaryServerInterceptor) *serviceSet {\n\treturn &serviceSet{\n\t\tservices:          make(map[string]*ServiceDesc),\n\t\tunaryInterceptor:  interceptor,\n\t\tstreamInterceptor: defaultStreamServerInterceptor,\n\t}\n}\n\nfunc (s *serviceSet) register(name string, desc *ServiceDesc) {\n\tif _, ok := s.services[name]; ok {\n\t\tpanic(fmt.Errorf(\"duplicate service %v registered\", name))\n\t}\n\n\ts.services[name] = desc\n}\n\nfunc (s *serviceSet) unaryCall(ctx context.Context, method Method, info *UnaryServerInfo, data []byte) (p []byte, st *status.Status) {\n\tunmarshal := func(obj interface{}) error {\n\t\treturn protoUnmarshal(data, obj)\n\t}\n\n\tresp, err := s.unaryInterceptor(ctx, unmarshal, info, method)\n\tif err == nil {\n\t\tif isNil(resp) {\n\t\t\terr = errors.New(\"ttrpc: marshal called with nil\")\n\t\t} else {\n\t\t\tp, err = protoMarshal(resp)\n\t\t}\n\t}\n\n\tst, ok := status.FromError(err)\n\tif !ok {\n\t\tst = status.New(convertCode(err), err.Error())\n\t}\n\n\treturn p, st\n}\n\nfunc (s *serviceSet) streamCall(ctx context.Context, stream StreamHandler, info *StreamServerInfo, ss StreamServer) (p []byte, st *status.Status) {\n\tresp, err := s.streamInterceptor(ctx, ss, info, stream)\n\tif err == nil {\n\t\tp, err = protoMarshal(resp)\n\t}\n\tst, ok := status.FromError(err)\n\tif !ok {\n\t\tst = status.New(convertCode(err), err.Error())\n\t}\n\treturn\n}\n\nfunc (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*status.Status, []byte, bool, bool) error) (*streamHandler, error) {\n\tsrv, ok := s.services[req.Service]\n\tif !ok {\n\t\treturn nil, status.Errorf(codes.Unimplemented, \"service %v\", req.Service)\n\t}\n\n\tif method, ok := srv.Methods[req.Method]; ok {\n\t\tgo func() {\n\t\t\tctx, cancel := getRequestContext(ctx, req)\n\t\t\tdefer cancel()\n\n\t\t\tinfo := &UnaryServerInfo{\n\t\t\t\tFullMethod: fullPath(req.Service, req.Method),\n\t\t\t}\n\t\t\tp, st := s.unaryCall(ctx, method, info, req.Payload)\n\n\t\t\trespond(st, p, false, true)\n\t\t}()\n\t\treturn nil, nil\n\t}\n\tif stream, ok := srv.Streams[req.Method]; ok {\n\t\tctx, cancel := getRequestContext(ctx, req)\n\t\tinfo := &StreamServerInfo{\n\t\t\tFullMethod:      fullPath(req.Service, req.Method),\n\t\t\tStreamingClient: stream.StreamingClient,\n\t\t\tStreamingServer: stream.StreamingServer,\n\t\t}\n\t\tsh := &streamHandler{\n\t\t\tctx:     ctx,\n\t\t\trespond: respond,\n\t\t\trecv:    make(chan Unmarshaler, 5),\n\t\t\tinfo:    info,\n\t\t}\n\t\tgo func() {\n\t\t\tdefer cancel()\n\t\t\tp, st := s.streamCall(ctx, stream.Handler, info, sh)\n\t\t\trespond(st, p, stream.StreamingServer, true)\n\t\t}()\n\n\t\t// Empty proto messages serialized to 0 payloads,\n\t\t// so signatures like: rpc Stream(google.protobuf.Empty) returns (stream Data);\n\t\t// don't get invoked here, which causes hang on client side.\n\t\t// See https://github.com/containerd/ttrpc/issues/126\n\t\tif req.Payload != nil || !info.StreamingClient {\n\t\t\tunmarshal := func(obj interface{}) error {\n\t\t\t\treturn protoUnmarshal(req.Payload, obj)\n\t\t\t}\n\t\t\tif err := sh.data(unmarshal); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\treturn sh, nil\n\t}\n\treturn nil, status.Errorf(codes.Unimplemented, \"method %v\", req.Method)\n}\n\ntype streamHandler struct {\n\tctx     context.Context\n\trespond func(*status.Status, []byte, bool, bool) error\n\trecv    chan Unmarshaler\n\tinfo    *StreamServerInfo\n\n\tremoteClosed bool\n\tlocalClosed  bool\n}\n\nfunc (s *streamHandler) closeSend() {\n\tif !s.remoteClosed {\n\t\ts.remoteClosed = true\n\t\tclose(s.recv)\n\t}\n}\n\nfunc (s *streamHandler) data(unmarshal Unmarshaler) error {\n\tif s.remoteClosed {\n\t\treturn ErrStreamClosed\n\t}\n\tselect {\n\tcase s.recv <- unmarshal:\n\t\treturn nil\n\tcase <-s.ctx.Done():\n\t\treturn s.ctx.Err()\n\t}\n}\n\nfunc (s *streamHandler) SendMsg(m interface{}) error {\n\tif s.localClosed {\n\t\treturn ErrStreamClosed\n\t}\n\tp, err := protoMarshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.respond(nil, p, true, false)\n}\n\nfunc (s *streamHandler) RecvMsg(m interface{}) error {\n\tselect {\n\tcase unmarshal, ok := <-s.recv:\n\t\tif !ok {\n\t\t\treturn io.EOF\n\t\t}\n\t\treturn unmarshal(m)\n\tcase <-s.ctx.Done():\n\t\treturn s.ctx.Err()\n\n\t}\n}\n\nfunc protoUnmarshal(p []byte, obj interface{}) error {\n\tswitch v := obj.(type) {\n\tcase proto.Message:\n\t\tif err := proto.Unmarshal(p, v); err != nil {\n\t\t\treturn status.Errorf(codes.Internal, \"ttrpc: error unmarshalling payload: %v\", err.Error())\n\t\t}\n\tdefault:\n\t\treturn status.Errorf(codes.Internal, \"ttrpc: error unsupported request type: %T\", v)\n\t}\n\treturn nil\n}\n\nfunc protoMarshal(obj interface{}) ([]byte, error) {\n\tif obj == nil {\n\t\treturn nil, nil\n\t}\n\n\tswitch v := obj.(type) {\n\tcase proto.Message:\n\t\tr, err := proto.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn nil, status.Errorf(codes.Internal, \"ttrpc: error marshaling payload: %v\", err.Error())\n\t\t}\n\n\t\treturn r, nil\n\tdefault:\n\t\treturn nil, status.Errorf(codes.Internal, \"ttrpc: error unsupported response type: %T\", v)\n\t}\n}\n\n// convertCode maps stdlib go errors into grpc space.\n//\n// This is ripped from the grpc-go code base.\nfunc convertCode(err error) codes.Code {\n\tswitch err {\n\tcase nil:\n\t\treturn codes.OK\n\tcase io.EOF:\n\t\treturn codes.OutOfRange\n\tcase io.ErrClosedPipe, io.ErrNoProgress, io.ErrShortBuffer, io.ErrShortWrite, io.ErrUnexpectedEOF:\n\t\treturn codes.FailedPrecondition\n\tcase os.ErrInvalid:\n\t\treturn codes.InvalidArgument\n\tcase context.Canceled:\n\t\treturn codes.Canceled\n\tcase context.DeadlineExceeded:\n\t\treturn codes.DeadlineExceeded\n\t}\n\tswitch {\n\tcase os.IsExist(err):\n\t\treturn codes.AlreadyExists\n\tcase os.IsNotExist(err):\n\t\treturn codes.NotFound\n\tcase os.IsPermission(err):\n\t\treturn codes.PermissionDenied\n\t}\n\treturn codes.Unknown\n}\n\nfunc fullPath(service, method string) string {\n\treturn \"/\" + path.Join(service, method)\n}\n\nfunc isNil(resp interface{}) bool {\n\treturn (*[2]uintptr)(unsafe.Pointer(&resp))[1] == 0\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/stream.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"sync\"\n)\n\ntype streamID uint32\n\ntype streamMessage struct {\n\theader  messageHeader\n\tpayload []byte\n}\n\ntype stream struct {\n\tid     streamID\n\tsender sender\n\trecv   chan *streamMessage\n\n\tcloseOnce sync.Once\n\trecvErr   error\n\trecvClose chan struct{}\n}\n\nfunc newStream(id streamID, send sender) *stream {\n\treturn &stream{\n\t\tid:        id,\n\t\tsender:    send,\n\t\trecv:      make(chan *streamMessage, 1),\n\t\trecvClose: make(chan struct{}),\n\t}\n}\n\nfunc (s *stream) closeWithError(err error) error {\n\ts.closeOnce.Do(func() {\n\t\tif err != nil {\n\t\t\ts.recvErr = err\n\t\t} else {\n\t\t\ts.recvErr = ErrClosed\n\t\t}\n\t\tclose(s.recvClose)\n\t})\n\treturn nil\n}\n\nfunc (s *stream) send(mt messageType, flags uint8, b []byte) error {\n\treturn s.sender.send(uint32(s.id), mt, flags, b)\n}\n\nfunc (s *stream) receive(ctx context.Context, msg *streamMessage) error {\n\tselect {\n\tcase <-s.recvClose:\n\t\treturn s.recvErr\n\tdefault:\n\t}\n\tselect {\n\tcase <-s.recvClose:\n\t\treturn s.recvErr\n\tcase s.recv <- msg:\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}\n\ntype sender interface {\n\tsend(uint32, messageType, uint8, []byte) error\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/stream_server.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\ntype StreamServer interface {\n\tSendMsg(m interface{}) error\n\tRecvMsg(m interface{}) error\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/test.proto",
    "content": "syntax = \"proto3\";\n\npackage ttrpc;\n\noption go_package = \"github.com/containerd/ttrpc/internal\";\n\nmessage TestPayload {\n\tstring foo = 1;\n\tint64 deadline = 2;\n\tstring metadata = 3;\n}\n\nmessage EchoPayload {\n\tint64 seq = 1;\n\tstring msg = 2;\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/ttrpc/unixcreds_linux.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage ttrpc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\ntype UnixCredentialsFunc func(*unix.Ucred) error\n\nfunc (fn UnixCredentialsFunc) Handshake(_ context.Context, conn net.Conn) (net.Conn, interface{}, error) {\n\tuc, err := requireUnixSocket(conn)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"ttrpc.UnixCredentialsFunc: require unix socket: %w\", err)\n\t}\n\n\trs, err := uc.SyscallConn()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"ttrpc.UnixCredentialsFunc: (net.UnixConn).SyscallConn failed: %w\", err)\n\t}\n\tvar (\n\t\tucred    *unix.Ucred\n\t\tucredErr error\n\t)\n\tif err := rs.Control(func(fd uintptr) {\n\t\tucred, ucredErr = unix.GetsockoptUcred(int(fd), unix.SOL_SOCKET, unix.SO_PEERCRED)\n\t}); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"ttrpc.UnixCredentialsFunc: (*syscall.RawConn).Control failed: %w\", err)\n\t}\n\n\tif ucredErr != nil {\n\t\treturn nil, nil, fmt.Errorf(\"ttrpc.UnixCredentialsFunc: failed to retrieve socket peer credentials: %w\", ucredErr)\n\t}\n\n\tif err := fn(ucred); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"ttrpc.UnixCredentialsFunc: credential check failed: %w\", err)\n\t}\n\n\treturn uc, ucred, nil\n}\n\n// UnixSocketRequireUidGid requires specific *effective* UID/GID, rather than the real UID/GID.\n//\n// For example, if a daemon binary is owned by the root (UID 0) with SUID bit but running as an\n// unprivileged user (UID 1001), the effective UID becomes 0, and the real UID becomes 1001.\n// So calling this function with uid=0 allows a connection from effective UID 0 but rejects\n// a connection from effective UID 1001.\n//\n// See socket(7), SO_PEERCRED: \"The returned credentials are those that were in effect at the time of the call to connect(2) or socketpair(2).\"\nfunc UnixSocketRequireUidGid(uid, gid int) UnixCredentialsFunc {\n\treturn func(ucred *unix.Ucred) error {\n\t\treturn requireUidGid(ucred, uid, gid)\n\t}\n}\n\nfunc UnixSocketRequireRoot() UnixCredentialsFunc {\n\treturn UnixSocketRequireUidGid(0, 0)\n}\n\n// UnixSocketRequireSameUser resolves the current effective unix user and returns a\n// UnixCredentialsFunc that will validate incoming unix connections against the\n// current credentials.\n//\n// This is useful when using abstract sockets that are accessible by all users.\nfunc UnixSocketRequireSameUser() UnixCredentialsFunc {\n\teuid, egid := os.Geteuid(), os.Getegid()\n\treturn UnixSocketRequireUidGid(euid, egid)\n}\n\nfunc requireUidGid(ucred *unix.Ucred, uid, gid int) error {\n\tif (uid != -1 && uint32(uid) != ucred.Uid) || (gid != -1 && uint32(gid) != ucred.Gid) {\n\t\treturn fmt.Errorf(\"ttrpc: invalid credentials: %v\", syscall.EPERM)\n\t}\n\treturn nil\n}\n\nfunc requireUnixSocket(conn net.Conn) (*net.UnixConn, error) {\n\tuc, ok := conn.(*net.UnixConn)\n\tif !ok {\n\t\treturn nil, errors.New(\"a unix socket connection is required\")\n\t}\n\n\treturn uc, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/.gitignore",
    "content": "*.test\ncoverage.txt\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright The containerd Authors\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/README.md",
    "content": "# typeurl\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/typeurl)](https://pkg.go.dev/github.com/containerd/typeurl)\n[![Build Status](https://github.com/containerd/typeurl/workflows/CI/badge.svg)](https://github.com/containerd/typeurl/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/containerd/typeurl/branch/main/graph/badge.svg)](https://codecov.io/gh/containerd/typeurl)\n[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/typeurl)](https://goreportcard.com/report/github.com/containerd/typeurl)\n\nA Go package for managing the registration, marshaling, and unmarshaling of encoded types.\n\nThis package helps when types are sent over a ttrpc/GRPC API and marshaled as a protobuf [Any](https://pkg.go.dev/google.golang.org/protobuf@v1.27.1/types/known/anypb#Any)\n\n## Project details\n\n**typeurl** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).\nAs a containerd sub-project, you will find the:\n * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),\n * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),\n * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)\n\ninformation in our [`containerd/project`](https://github.com/containerd/project) repository.\n\n## Optional\n\nBy default, support for gogoproto is available along side the standard Google\nprotobuf types.\nYou can choose to leave gogo support out by using the `!no_gogo` build tag.\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/doc.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage typeurl\n\n// Package typeurl assists with managing the registration, marshaling, and\n// unmarshaling of types encoded as protobuf.Any.\n//\n// A protobuf.Any is a proto message that can contain any arbitrary data. It\n// consists of two components, a TypeUrl and a Value, and its proto definition\n// looks like this:\n//\n//   message Any {\n//     string type_url = 1;\n//     bytes value = 2;\n//   }\n//\n// The TypeUrl is used to distinguish the contents from other proto.Any\n// messages. This typeurl library manages these URLs to enable automagic\n// marshaling and unmarshaling of the contents.\n//\n// For example, consider this go struct:\n//\n//   type Foo struct {\n//     Field1 string\n//     Field2 string\n//   }\n//\n// To use typeurl, types must first be registered. This is typically done in\n// the init function\n//\n//   func init() {\n//      typeurl.Register(&Foo{}, \"Foo\")\n//   }\n//\n// This will register the type Foo with the url path \"Foo\". The arguments to\n// Register are variadic, and are used to construct a url path. Consider this\n// example, from the github.com/containerd/containerd/client package:\n//\n//   func init() {\n//     const prefix = \"types.containerd.io\"\n//     // register TypeUrls for commonly marshaled external types\n//     major := strconv.Itoa(specs.VersionMajor)\n//     typeurl.Register(&specs.Spec{}, prefix, \"opencontainers/runtime-spec\", major, \"Spec\")\n//     // this function has more Register calls, which are elided.\n//   }\n//\n// This registers several types under a more complex url, which ends up mapping\n// to `types.containerd.io/opencontainers/runtime-spec/1/Spec` (or some other\n// value for major).\n//\n// Once a type is registered, it can be marshaled to a proto.Any message simply\n// by calling `MarshalAny`, like this:\n//\n//   foo := &Foo{Field1: \"value1\", Field2: \"value2\"}\n//   anyFoo, err := typeurl.MarshalAny(foo)\n//\n// MarshalAny will resolve the correct URL for the type. If the type in\n// question implements the proto.Message interface, then it will be marshaled\n// as a proto message. Otherwise, it will be marshaled as json. This means that\n// typeurl will work on any arbitrary data, whether or not it has a proto\n// definition, as long as it can be serialized to json.\n//\n// To unmarshal, the process is simply inverse:\n//\n//   iface, err := typeurl.UnmarshalAny(anyFoo)\n//   foo := iface.(*Foo)\n//\n// The correct type is automatically chosen from the type registry, and the\n// returned interface can be cast straight to that type.\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/types.go",
    "content": "/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage typeurl\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"path\"\n\t\"reflect\"\n\t\"sync\"\n\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n\t\"google.golang.org/protobuf/types/known/anypb\"\n)\n\nvar (\n\tmu       sync.RWMutex\n\tregistry = make(map[reflect.Type]string)\n\thandlers []handler\n)\n\ntype handler interface {\n\tMarshaller(interface{}) func() ([]byte, error)\n\tUnmarshaller(interface{}) func([]byte) error\n\tTypeURL(interface{}) string\n\tGetType(url string) (reflect.Type, bool)\n}\n\n// Definitions of common error types used throughout typeurl.\n//\n// These error types are used with errors.Wrap and errors.Wrapf to add context\n// to an error.\n//\n// To detect an error class, use errors.Is() functions to tell whether an\n// error is of this type.\n\nvar (\n\tErrNotFound = errors.New(\"not found\")\n)\n\n// Any contains an arbitrary protcol buffer message along with its type.\n//\n// While there is google.golang.org/protobuf/types/known/anypb.Any,\n// we'd like to have our own to hide the underlying protocol buffer\n// implementations from containerd clients.\n//\n// https://developers.google.com/protocol-buffers/docs/proto3#any\ntype Any interface {\n\t// GetTypeUrl returns a URL/resource name that uniquely identifies\n\t// the type of the serialized protocol buffer message.\n\tGetTypeUrl() string\n\n\t// GetValue returns a valid serialized protocol buffer of the type that\n\t// GetTypeUrl() indicates.\n\tGetValue() []byte\n}\n\ntype anyType struct {\n\ttypeURL string\n\tvalue   []byte\n}\n\nfunc (a *anyType) GetTypeUrl() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.typeURL\n}\n\nfunc (a *anyType) GetValue() []byte {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.value\n}\n\n// Register a type with a base URL for JSON marshaling. When the MarshalAny and\n// UnmarshalAny functions are called they will treat the Any type value as JSON.\n// To use protocol buffers for handling the Any value the proto.Register\n// function should be used instead of this function.\nfunc Register(v interface{}, args ...string) {\n\tvar (\n\t\tt = tryDereference(v)\n\t\tp = path.Join(args...)\n\t)\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tif et, ok := registry[t]; ok {\n\t\tif et != p {\n\t\t\tpanic(fmt.Errorf(\"type registered with alternate path %q != %q\", et, p))\n\t\t}\n\t\treturn\n\t}\n\tregistry[t] = p\n}\n\n// TypeURL returns the type url for a registered type.\nfunc TypeURL(v interface{}) (string, error) {\n\tmu.RLock()\n\tu, ok := registry[tryDereference(v)]\n\tmu.RUnlock()\n\tif !ok {\n\t\tswitch t := v.(type) {\n\t\tcase proto.Message:\n\t\t\treturn string(t.ProtoReflect().Descriptor().FullName()), nil\n\t\tdefault:\n\t\t\tfor _, h := range handlers {\n\t\t\t\tif u := h.TypeURL(v); u != \"\" {\n\t\t\t\t\treturn u, nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"type %s: %w\", reflect.TypeOf(v), ErrNotFound)\n\t\t}\n\t}\n\treturn u, nil\n}\n\n// Is returns true if the type of the Any is the same as v.\nfunc Is(any Any, v interface{}) bool {\n\tif any == nil {\n\t\treturn false\n\t}\n\t// call to check that v is a pointer\n\ttryDereference(v)\n\turl, err := TypeURL(v)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn any.GetTypeUrl() == url\n}\n\n// MarshalAny marshals the value v into an any with the correct TypeUrl.\n// If the provided object is already a proto.Any message, then it will be\n// returned verbatim. If it is of type proto.Message, it will be marshaled as a\n// protocol buffer. Otherwise, the object will be marshaled to json.\nfunc MarshalAny(v interface{}) (Any, error) {\n\tvar marshal func(v interface{}) ([]byte, error)\n\tswitch t := v.(type) {\n\tcase Any:\n\t\t// avoid reserializing the type if we have an any.\n\t\treturn t, nil\n\tcase proto.Message:\n\t\tmarshal = func(v interface{}) ([]byte, error) {\n\t\t\treturn proto.Marshal(t)\n\t\t}\n\tdefault:\n\t\tfor _, h := range handlers {\n\t\t\tif m := h.Marshaller(v); m != nil {\n\t\t\t\tmarshal = func(v interface{}) ([]byte, error) {\n\t\t\t\t\treturn m()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif marshal == nil {\n\t\t\tmarshal = json.Marshal\n\t\t}\n\t}\n\n\turl, err := TypeURL(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata, err := marshal(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &anyType{\n\t\ttypeURL: url,\n\t\tvalue:   data,\n\t}, nil\n}\n\n// UnmarshalAny unmarshals the any type into a concrete type.\nfunc UnmarshalAny(any Any) (interface{}, error) {\n\treturn UnmarshalByTypeURL(any.GetTypeUrl(), any.GetValue())\n}\n\n// UnmarshalByTypeURL unmarshals the given type and value to into a concrete type.\nfunc UnmarshalByTypeURL(typeURL string, value []byte) (interface{}, error) {\n\treturn unmarshal(typeURL, value, nil)\n}\n\n// UnmarshalTo unmarshals the any type into a concrete type passed in the out\n// argument. It is identical to UnmarshalAny, but lets clients provide a\n// destination type through the out argument.\nfunc UnmarshalTo(any Any, out interface{}) error {\n\treturn UnmarshalToByTypeURL(any.GetTypeUrl(), any.GetValue(), out)\n}\n\n// UnmarshalToByTypeURL unmarshals the given type and value into a concrete type passed\n// in the out argument. It is identical to UnmarshalByTypeURL, but lets clients\n// provide a destination type through the out argument.\nfunc UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error {\n\t_, err := unmarshal(typeURL, value, out)\n\treturn err\n}\n\n// MarshalProto converts typeurl.Any to google.golang.org/protobuf/types/known/anypb.Any.\nfunc MarshalProto(from Any) *anypb.Any {\n\tif from == nil {\n\t\treturn nil\n\t}\n\n\tif pbany, ok := from.(*anypb.Any); ok {\n\t\treturn pbany\n\t}\n\n\treturn &anypb.Any{\n\t\tTypeUrl: from.GetTypeUrl(),\n\t\tValue:   from.GetValue(),\n\t}\n}\n\n// MarshalAnyToProto converts an arbitrary interface to google.golang.org/protobuf/types/known/anypb.Any.\nfunc MarshalAnyToProto(from interface{}) (*anypb.Any, error) {\n\tanyType, err := MarshalAny(from)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn MarshalProto(anyType), nil\n}\n\nfunc unmarshal(typeURL string, value []byte, v interface{}) (interface{}, error) {\n\tt, isProto, err := getTypeByUrl(typeURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif v == nil {\n\t\tv = reflect.New(t).Interface()\n\t} else {\n\t\t// Validate interface type provided by client\n\t\tvURL, err := TypeURL(v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif typeURL != vURL {\n\t\t\treturn nil, fmt.Errorf(\"can't unmarshal type %q to output %q\", typeURL, vURL)\n\t\t}\n\t}\n\n\tif isProto {\n\t\tpm, ok := v.(proto.Message)\n\t\tif ok {\n\t\t\treturn v, proto.Unmarshal(value, pm)\n\t\t}\n\n\t\tfor _, h := range handlers {\n\t\t\tif unmarshal := h.Unmarshaller(v); unmarshal != nil {\n\t\t\t\treturn v, unmarshal(value)\n\t\t\t}\n\t\t}\n\t}\n\n\t// fallback to json unmarshaller\n\treturn v, json.Unmarshal(value, v)\n}\n\nfunc getTypeByUrl(url string) (_ reflect.Type, isProto bool, _ error) {\n\tmu.RLock()\n\tfor t, u := range registry {\n\t\tif u == url {\n\t\t\tmu.RUnlock()\n\t\t\treturn t, false, nil\n\t\t}\n\t}\n\tmu.RUnlock()\n\tmt, err := protoregistry.GlobalTypes.FindMessageByURL(url)\n\tif err != nil {\n\t\tif errors.Is(err, protoregistry.NotFound) {\n\t\t\tfor _, h := range handlers {\n\t\t\t\tif t, isProto := h.GetType(url); t != nil {\n\t\t\t\t\treturn t, isProto, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil, false, fmt.Errorf(\"type with url %s: %w\", url, ErrNotFound)\n\t}\n\tempty := mt.New().Interface()\n\treturn reflect.TypeOf(empty).Elem(), true, nil\n}\n\nfunc tryDereference(v interface{}) reflect.Type {\n\tt := reflect.TypeOf(v)\n\tif t.Kind() == reflect.Ptr {\n\t\t// require check of pointer but dereference to register\n\t\treturn t.Elem()\n\t}\n\tpanic(\"v is not a pointer to a type\")\n}\n"
  },
  {
    "path": "vendor/github.com/containerd/typeurl/v2/types_gogo.go",
    "content": "//go:build !no_gogo\n\n/*\n   Copyright The containerd Authors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage typeurl\n\nimport (\n\t\"reflect\"\n\n\tgogoproto \"github.com/gogo/protobuf/proto\"\n)\n\nfunc init() {\n\thandlers = append(handlers, gogoHandler{})\n}\n\ntype gogoHandler struct{}\n\nfunc (gogoHandler) Marshaller(v interface{}) func() ([]byte, error) {\n\tpm, ok := v.(gogoproto.Message)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn func() ([]byte, error) {\n\t\treturn gogoproto.Marshal(pm)\n\t}\n}\n\nfunc (gogoHandler) Unmarshaller(v interface{}) func([]byte) error {\n\tpm, ok := v.(gogoproto.Message)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn func(dt []byte) error {\n\t\treturn gogoproto.Unmarshal(dt, pm)\n\t}\n}\n\nfunc (gogoHandler) TypeURL(v interface{}) string {\n\tpm, ok := v.(gogoproto.Message)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn gogoproto.MessageName(pm)\n}\n\nfunc (gogoHandler) GetType(url string) (reflect.Type, bool) {\n\tt := gogoproto.MessageType(url)\n\tif t == nil {\n\t\treturn nil, false\n\t}\n\treturn t.Elem(), true\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/README.md",
    "content": "This is a copy of github.com/docker/distribution/reference as of commit 3226863cbcba6dbc2f6c83a37b28126c934af3f8,\nexcept that ParseAnyReferenceWithSet has been removed to drop the dependency on github.com/docker/distribution/digestset."
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/helpers.go",
    "content": "package reference\n\nimport \"path\"\n\n// IsNameOnly returns true if reference only contains a repo name.\nfunc IsNameOnly(ref Named) bool {\n\tif _, ok := ref.(NamedTagged); ok {\n\t\treturn false\n\t}\n\tif _, ok := ref.(Canonical); ok {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// FamiliarName returns the familiar name string\n// for the given named, familiarizing if needed.\nfunc FamiliarName(ref Named) string {\n\tif nn, ok := ref.(normalizedNamed); ok {\n\t\treturn nn.Familiar().Name()\n\t}\n\treturn ref.Name()\n}\n\n// FamiliarString returns the familiar string representation\n// for the given reference, familiarizing if needed.\nfunc FamiliarString(ref Reference) string {\n\tif nn, ok := ref.(normalizedNamed); ok {\n\t\treturn nn.Familiar().String()\n\t}\n\treturn ref.String()\n}\n\n// FamiliarMatch reports whether ref matches the specified pattern.\n// See https://godoc.org/path#Match for supported patterns.\nfunc FamiliarMatch(pattern string, ref Reference) (bool, error) {\n\tmatched, err := path.Match(pattern, FamiliarString(ref))\n\tif namedRef, isNamed := ref.(Named); isNamed && !matched {\n\t\tmatched, _ = path.Match(pattern, FamiliarName(namedRef))\n\t}\n\treturn matched, err\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/normalize.go",
    "content": "package reference\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/opencontainers/go-digest\"\n)\n\nvar (\n\tlegacyDefaultDomain = \"index.docker.io\"\n\tdefaultDomain       = \"docker.io\"\n\tofficialRepoName    = \"library\"\n\tdefaultTag          = \"latest\"\n)\n\n// normalizedNamed represents a name which has been\n// normalized and has a familiar form. A familiar name\n// is what is used in Docker UI. An example normalized\n// name is \"docker.io/library/ubuntu\" and corresponding\n// familiar name of \"ubuntu\".\ntype normalizedNamed interface {\n\tNamed\n\tFamiliar() Named\n}\n\n// ParseNormalizedNamed parses a string into a named reference\n// transforming a familiar name from Docker UI to a fully\n// qualified reference. If the value may be an identifier\n// use ParseAnyReference.\nfunc ParseNormalizedNamed(s string) (Named, error) {\n\tif ok := anchoredIdentifierRegexp.MatchString(s); ok {\n\t\treturn nil, fmt.Errorf(\"invalid repository name (%s), cannot specify 64-byte hexadecimal strings\", s)\n\t}\n\tdomain, remainder := splitDockerDomain(s)\n\tvar remoteName string\n\tif tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 {\n\t\tremoteName = remainder[:tagSep]\n\t} else {\n\t\tremoteName = remainder\n\t}\n\tif strings.ToLower(remoteName) != remoteName {\n\t\treturn nil, errors.New(\"invalid reference format: repository name must be lowercase\")\n\t}\n\n\tref, err := Parse(domain + \"/\" + remainder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnamed, isNamed := ref.(Named)\n\tif !isNamed {\n\t\treturn nil, fmt.Errorf(\"reference %s has no name\", ref.String())\n\t}\n\treturn named, nil\n}\n\n// ParseDockerRef normalizes the image reference following the docker convention. This is added\n// mainly for backward compatibility.\n// The reference returned can only be either tagged or digested. For reference contains both tag\n// and digest, the function returns digested reference, e.g. docker.io/library/busybox:latest@\n// sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa will be returned as\n// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa.\nfunc ParseDockerRef(ref string) (Named, error) {\n\tnamed, err := ParseNormalizedNamed(ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, ok := named.(NamedTagged); ok {\n\t\tif canonical, ok := named.(Canonical); ok {\n\t\t\t// The reference is both tagged and digested, only\n\t\t\t// return digested.\n\t\t\tnewNamed, err := WithName(canonical.Name())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tnewCanonical, err := WithDigest(newNamed, canonical.Digest())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn newCanonical, nil\n\t\t}\n\t}\n\treturn TagNameOnly(named), nil\n}\n\n// splitDockerDomain splits a repository name to domain and remotename string.\n// If no valid domain is found, the default domain is used. Repository name\n// needs to be already validated before.\nfunc splitDockerDomain(name string) (domain, remainder string) {\n\ti := strings.IndexRune(name, '/')\n\tif i == -1 || (!strings.ContainsAny(name[:i], \".:\") && name[:i] != \"localhost\") {\n\t\tdomain, remainder = defaultDomain, name\n\t} else {\n\t\tdomain, remainder = name[:i], name[i+1:]\n\t}\n\tif domain == legacyDefaultDomain {\n\t\tdomain = defaultDomain\n\t}\n\tif domain == defaultDomain && !strings.ContainsRune(remainder, '/') {\n\t\tremainder = officialRepoName + \"/\" + remainder\n\t}\n\treturn\n}\n\n// familiarizeName returns a shortened version of the name familiar\n// to the Docker UI. Familiar names have the default domain\n// \"docker.io\" and \"library/\" repository prefix removed.\n// For example, \"docker.io/library/redis\" will have the familiar\n// name \"redis\" and \"docker.io/dmcgowan/myapp\" will be \"dmcgowan/myapp\".\n// Returns a familiarized named only reference.\nfunc familiarizeName(named namedRepository) repository {\n\trepo := repository{\n\t\tdomain: named.Domain(),\n\t\tpath:   named.Path(),\n\t}\n\n\tif repo.domain == defaultDomain {\n\t\trepo.domain = \"\"\n\t\t// Handle official repositories which have the pattern \"library/<official repo name>\"\n\t\tif split := strings.Split(repo.path, \"/\"); len(split) == 2 && split[0] == officialRepoName {\n\t\t\trepo.path = split[1]\n\t\t}\n\t}\n\treturn repo\n}\n\nfunc (r reference) Familiar() Named {\n\treturn reference{\n\t\tnamedRepository: familiarizeName(r.namedRepository),\n\t\ttag:             r.tag,\n\t\tdigest:          r.digest,\n\t}\n}\n\nfunc (r repository) Familiar() Named {\n\treturn familiarizeName(r)\n}\n\nfunc (t taggedReference) Familiar() Named {\n\treturn taggedReference{\n\t\tnamedRepository: familiarizeName(t.namedRepository),\n\t\ttag:             t.tag,\n\t}\n}\n\nfunc (c canonicalReference) Familiar() Named {\n\treturn canonicalReference{\n\t\tnamedRepository: familiarizeName(c.namedRepository),\n\t\tdigest:          c.digest,\n\t}\n}\n\n// TagNameOnly adds the default tag \"latest\" to a reference if it only has\n// a repo name.\nfunc TagNameOnly(ref Named) Named {\n\tif IsNameOnly(ref) {\n\t\tnamedTagged, err := WithTag(ref, defaultTag)\n\t\tif err != nil {\n\t\t\t// Default tag must be valid, to create a NamedTagged\n\t\t\t// type with non-validated input the WithTag function\n\t\t\t// should be used instead\n\t\t\tpanic(err)\n\t\t}\n\t\treturn namedTagged\n\t}\n\treturn ref\n}\n\n// ParseAnyReference parses a reference string as a possible identifier,\n// full digest, or familiar name.\nfunc ParseAnyReference(ref string) (Reference, error) {\n\tif ok := anchoredIdentifierRegexp.MatchString(ref); ok {\n\t\treturn digestReference(\"sha256:\" + ref), nil\n\t}\n\tif dgst, err := digest.Parse(ref); err == nil {\n\t\treturn digestReference(dgst), nil\n\t}\n\n\treturn ParseNormalizedNamed(ref)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/reference.go",
    "content": "// Package reference provides a general type to represent any way of referencing images within the registry.\n// Its main purpose is to abstract tags and digests (content-addressable hash).\n//\n// Grammar\n//\n//\treference                       := name [ \":\" tag ] [ \"@\" digest ]\n//\tname                            := [domain '/'] path-component ['/' path-component]*\n//\tdomain                          := domain-component ['.' domain-component]* [':' port-number]\n//\tdomain-component                := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/\n//\tport-number                     := /[0-9]+/\n//\tpath-component                  := alphanumeric [separator alphanumeric]*\n//\talphanumeric                   := /[a-z0-9]+/\n//\tseparator                       := /[_.]|__|[-]*/\n//\n//\ttag                             := /[\\w][\\w.-]{0,127}/\n//\n//\tdigest                          := digest-algorithm \":\" digest-hex\n//\tdigest-algorithm                := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]*\n//\tdigest-algorithm-separator      := /[+.-_]/\n//\tdigest-algorithm-component      := /[A-Za-z][A-Za-z0-9]*/\n//\tdigest-hex                      := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value\n//\n//\tidentifier                      := /[a-f0-9]{64}/\n//\tshort-identifier                := /[a-f0-9]{6,64}/\npackage reference\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/opencontainers/go-digest\"\n)\n\nconst (\n\t// NameTotalLengthMax is the maximum total number of characters in a repository name.\n\tNameTotalLengthMax = 255\n)\n\nvar (\n\t// ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference.\n\tErrReferenceInvalidFormat = errors.New(\"invalid reference format\")\n\n\t// ErrTagInvalidFormat represents an error while trying to parse a string as a tag.\n\tErrTagInvalidFormat = errors.New(\"invalid tag format\")\n\n\t// ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.\n\tErrDigestInvalidFormat = errors.New(\"invalid digest format\")\n\n\t// ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.\n\tErrNameContainsUppercase = errors.New(\"repository name must be lowercase\")\n\n\t// ErrNameEmpty is returned for empty, invalid repository names.\n\tErrNameEmpty = errors.New(\"repository name must have at least one component\")\n\n\t// ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax.\n\tErrNameTooLong = fmt.Errorf(\"repository name must not be more than %v characters\", NameTotalLengthMax)\n\n\t// ErrNameNotCanonical is returned when a name is not canonical.\n\tErrNameNotCanonical = errors.New(\"repository name must be canonical\")\n)\n\n// Reference is an opaque object reference identifier that may include\n// modifiers such as a hostname, name, tag, and digest.\ntype Reference interface {\n\t// String returns the full reference\n\tString() string\n}\n\n// Field provides a wrapper type for resolving correct reference types when\n// working with encoding.\ntype Field struct {\n\treference Reference\n}\n\n// AsField wraps a reference in a Field for encoding.\nfunc AsField(reference Reference) Field {\n\treturn Field{reference}\n}\n\n// Reference unwraps the reference type from the field to\n// return the Reference object. This object should be\n// of the appropriate type to further check for different\n// reference types.\nfunc (f Field) Reference() Reference {\n\treturn f.reference\n}\n\n// MarshalText serializes the field to byte text which\n// is the string of the reference.\nfunc (f Field) MarshalText() (p []byte, err error) {\n\treturn []byte(f.reference.String()), nil\n}\n\n// UnmarshalText parses text bytes by invoking the\n// reference parser to ensure the appropriately\n// typed reference object is wrapped by field.\nfunc (f *Field) UnmarshalText(p []byte) error {\n\tr, err := Parse(string(p))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tf.reference = r\n\treturn nil\n}\n\n// Named is an object with a full name\ntype Named interface {\n\tReference\n\tName() string\n}\n\n// Tagged is an object which has a tag\ntype Tagged interface {\n\tReference\n\tTag() string\n}\n\n// NamedTagged is an object including a name and tag.\ntype NamedTagged interface {\n\tNamed\n\tTag() string\n}\n\n// Digested is an object which has a digest\n// in which it can be referenced by\ntype Digested interface {\n\tReference\n\tDigest() digest.Digest\n}\n\n// Canonical reference is an object with a fully unique\n// name including a name with domain and digest\ntype Canonical interface {\n\tNamed\n\tDigest() digest.Digest\n}\n\n// namedRepository is a reference to a repository with a name.\n// A namedRepository has both domain and path components.\ntype namedRepository interface {\n\tNamed\n\tDomain() string\n\tPath() string\n}\n\n// Domain returns the domain part of the Named reference\nfunc Domain(named Named) string {\n\tif r, ok := named.(namedRepository); ok {\n\t\treturn r.Domain()\n\t}\n\tdomain, _ := splitDomain(named.Name())\n\treturn domain\n}\n\n// Path returns the name without the domain part of the Named reference\nfunc Path(named Named) (name string) {\n\tif r, ok := named.(namedRepository); ok {\n\t\treturn r.Path()\n\t}\n\t_, path := splitDomain(named.Name())\n\treturn path\n}\n\nfunc splitDomain(name string) (string, string) {\n\tmatch := anchoredNameRegexp.FindStringSubmatch(name)\n\tif len(match) != 3 {\n\t\treturn \"\", name\n\t}\n\treturn match[1], match[2]\n}\n\n// SplitHostname splits a named reference into a\n// hostname and name string. If no valid hostname is\n// found, the hostname is empty and the full value\n// is returned as name\n// Deprecated: Use Domain or Path\nfunc SplitHostname(named Named) (string, string) {\n\tif r, ok := named.(namedRepository); ok {\n\t\treturn r.Domain(), r.Path()\n\t}\n\treturn splitDomain(named.Name())\n}\n\n// Parse parses s and returns a syntactically valid Reference.\n// If an error was encountered it is returned, along with a nil Reference.\n// NOTE: Parse will not handle short digests.\nfunc Parse(s string) (Reference, error) {\n\tmatches := ReferenceRegexp.FindStringSubmatch(s)\n\tif matches == nil {\n\t\tif s == \"\" {\n\t\t\treturn nil, ErrNameEmpty\n\t\t}\n\t\tif ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil {\n\t\t\treturn nil, ErrNameContainsUppercase\n\t\t}\n\t\treturn nil, ErrReferenceInvalidFormat\n\t}\n\n\tif len(matches[1]) > NameTotalLengthMax {\n\t\treturn nil, ErrNameTooLong\n\t}\n\n\tvar repo repository\n\n\tnameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1])\n\tif len(nameMatch) == 3 {\n\t\trepo.domain = nameMatch[1]\n\t\trepo.path = nameMatch[2]\n\t} else {\n\t\trepo.domain = \"\"\n\t\trepo.path = matches[1]\n\t}\n\n\tref := reference{\n\t\tnamedRepository: repo,\n\t\ttag:             matches[2],\n\t}\n\tif matches[3] != \"\" {\n\t\tvar err error\n\t\tref.digest, err = digest.Parse(matches[3])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tr := getBestReferenceType(ref)\n\tif r == nil {\n\t\treturn nil, ErrNameEmpty\n\t}\n\n\treturn r, nil\n}\n\n// ParseNamed parses s and returns a syntactically valid reference implementing\n// the Named interface. The reference must have a name and be in the canonical\n// form, otherwise an error is returned.\n// If an error was encountered it is returned, along with a nil Reference.\n// NOTE: ParseNamed will not handle short digests.\nfunc ParseNamed(s string) (Named, error) {\n\tnamed, err := ParseNormalizedNamed(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif named.String() != s {\n\t\treturn nil, ErrNameNotCanonical\n\t}\n\treturn named, nil\n}\n\n// WithName returns a named object representing the given string. If the input\n// is invalid ErrReferenceInvalidFormat will be returned.\nfunc WithName(name string) (Named, error) {\n\tif len(name) > NameTotalLengthMax {\n\t\treturn nil, ErrNameTooLong\n\t}\n\n\tmatch := anchoredNameRegexp.FindStringSubmatch(name)\n\tif match == nil || len(match) != 3 {\n\t\treturn nil, ErrReferenceInvalidFormat\n\t}\n\treturn repository{\n\t\tdomain: match[1],\n\t\tpath:   match[2],\n\t}, nil\n}\n\n// WithTag combines the name from \"name\" and the tag from \"tag\" to form a\n// reference incorporating both the name and the tag.\nfunc WithTag(name Named, tag string) (NamedTagged, error) {\n\tif !anchoredTagRegexp.MatchString(tag) {\n\t\treturn nil, ErrTagInvalidFormat\n\t}\n\tvar repo repository\n\tif r, ok := name.(namedRepository); ok {\n\t\trepo.domain = r.Domain()\n\t\trepo.path = r.Path()\n\t} else {\n\t\trepo.path = name.Name()\n\t}\n\tif canonical, ok := name.(Canonical); ok {\n\t\treturn reference{\n\t\t\tnamedRepository: repo,\n\t\t\ttag:             tag,\n\t\t\tdigest:          canonical.Digest(),\n\t\t}, nil\n\t}\n\treturn taggedReference{\n\t\tnamedRepository: repo,\n\t\ttag:             tag,\n\t}, nil\n}\n\n// WithDigest combines the name from \"name\" and the digest from \"digest\" to form\n// a reference incorporating both the name and the digest.\nfunc WithDigest(name Named, digest digest.Digest) (Canonical, error) {\n\tif !anchoredDigestRegexp.MatchString(digest.String()) {\n\t\treturn nil, ErrDigestInvalidFormat\n\t}\n\tvar repo repository\n\tif r, ok := name.(namedRepository); ok {\n\t\trepo.domain = r.Domain()\n\t\trepo.path = r.Path()\n\t} else {\n\t\trepo.path = name.Name()\n\t}\n\tif tagged, ok := name.(Tagged); ok {\n\t\treturn reference{\n\t\t\tnamedRepository: repo,\n\t\t\ttag:             tagged.Tag(),\n\t\t\tdigest:          digest,\n\t\t}, nil\n\t}\n\treturn canonicalReference{\n\t\tnamedRepository: repo,\n\t\tdigest:          digest,\n\t}, nil\n}\n\n// TrimNamed removes any tag or digest from the named reference.\nfunc TrimNamed(ref Named) Named {\n\tdomain, path := SplitHostname(ref)\n\treturn repository{\n\t\tdomain: domain,\n\t\tpath:   path,\n\t}\n}\n\nfunc getBestReferenceType(ref reference) Reference {\n\tif ref.Name() == \"\" {\n\t\t// Allow digest only references\n\t\tif ref.digest != \"\" {\n\t\t\treturn digestReference(ref.digest)\n\t\t}\n\t\treturn nil\n\t}\n\tif ref.tag == \"\" {\n\t\tif ref.digest != \"\" {\n\t\t\treturn canonicalReference{\n\t\t\t\tnamedRepository: ref.namedRepository,\n\t\t\t\tdigest:          ref.digest,\n\t\t\t}\n\t\t}\n\t\treturn ref.namedRepository\n\t}\n\tif ref.digest == \"\" {\n\t\treturn taggedReference{\n\t\t\tnamedRepository: ref.namedRepository,\n\t\t\ttag:             ref.tag,\n\t\t}\n\t}\n\n\treturn ref\n}\n\ntype reference struct {\n\tnamedRepository\n\ttag    string\n\tdigest digest.Digest\n}\n\nfunc (r reference) String() string {\n\treturn r.Name() + \":\" + r.tag + \"@\" + r.digest.String()\n}\n\nfunc (r reference) Tag() string {\n\treturn r.tag\n}\n\nfunc (r reference) Digest() digest.Digest {\n\treturn r.digest\n}\n\ntype repository struct {\n\tdomain string\n\tpath   string\n}\n\nfunc (r repository) String() string {\n\treturn r.Name()\n}\n\nfunc (r repository) Name() string {\n\tif r.domain == \"\" {\n\t\treturn r.path\n\t}\n\treturn r.domain + \"/\" + r.path\n}\n\nfunc (r repository) Domain() string {\n\treturn r.domain\n}\n\nfunc (r repository) Path() string {\n\treturn r.path\n}\n\ntype digestReference digest.Digest\n\nfunc (d digestReference) String() string {\n\treturn digest.Digest(d).String()\n}\n\nfunc (d digestReference) Digest() digest.Digest {\n\treturn digest.Digest(d)\n}\n\ntype taggedReference struct {\n\tnamedRepository\n\ttag string\n}\n\nfunc (t taggedReference) String() string {\n\treturn t.Name() + \":\" + t.tag\n}\n\nfunc (t taggedReference) Tag() string {\n\treturn t.tag\n}\n\ntype canonicalReference struct {\n\tnamedRepository\n\tdigest digest.Digest\n}\n\nfunc (c canonicalReference) String() string {\n\treturn c.Name() + \"@\" + c.digest.String()\n}\n\nfunc (c canonicalReference) Digest() digest.Digest {\n\treturn c.digest\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/regexp-additions.go",
    "content": "package reference\n\n// Return true if the specified string fully matches `IdentifierRegexp`.\nfunc IsFullIdentifier(s string) bool {\n\treturn anchoredIdentifierRegexp.MatchString(s)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/docker/reference/regexp.go",
    "content": "package reference\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\n\tstorageRegexp \"github.com/containers/storage/pkg/regexp\"\n)\n\nconst (\n\t// alphaNumeric defines the alpha numeric atom, typically a\n\t// component of names. This only allows lower case characters and digits.\n\talphaNumeric = `[a-z0-9]+`\n\n\t// separator defines the separators allowed to be embedded in name\n\t// components. This allow one period, one or two underscore and multiple\n\t// dashes. Repeated dashes and underscores are intentionally treated\n\t// differently. In order to support valid hostnames as name components,\n\t// supporting repeated dash was added. Additionally double underscore is\n\t// now allowed as a separator to loosen the restriction for previously\n\t// supported names.\n\tseparator = `(?:[._]|__|[-]*)`\n\n\t// repository name to start with a component as defined by DomainRegexp\n\t// and followed by an optional port.\n\tdomainComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])`\n\n\t// The string counterpart for TagRegexp.\n\ttag = `[\\w][\\w.-]{0,127}`\n\n\t// The string counterpart for DigestRegexp.\n\tdigestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}`\n\n\t// The string counterpart for IdentifierRegexp.\n\tidentifier = `([a-f0-9]{64})`\n\n\t// The string counterpart for ShortIdentifierRegexp.\n\tshortIdentifier = `([a-f0-9]{6,64})`\n)\n\nvar (\n\t// nameComponent restricts registry path component names to start\n\t// with at least one letter or number, with following parts able to be\n\t// separated by one period, one or two underscore and multiple dashes.\n\tnameComponent = expression(\n\t\talphaNumeric,\n\t\toptional(repeated(separator, alphaNumeric)))\n\n\tdomain = expression(\n\t\tdomainComponent,\n\t\toptional(repeated(literal(`.`), domainComponent)),\n\t\toptional(literal(`:`), `[0-9]+`))\n\t// DomainRegexp defines the structure of potential domain components\n\t// that may be part of image names. This is purposely a subset of what is\n\t// allowed by DNS to ensure backwards compatibility with Docker image\n\t// names.\n\tDomainRegexp = re(domain)\n\n\t// TagRegexp matches valid tag names. From docker/docker:graph/tags.go.\n\tTagRegexp = re(tag)\n\n\tanchoredTag = anchored(tag)\n\t// anchoredTagRegexp matches valid tag names, anchored at the start and\n\t// end of the matched string.\n\tanchoredTagRegexp = storageRegexp.Delayed(anchoredTag)\n\n\t// DigestRegexp matches valid digests.\n\tDigestRegexp = re(digestPat)\n\n\tanchoredDigest = anchored(digestPat)\n\t// anchoredDigestRegexp matches valid digests, anchored at the start and\n\t// end of the matched string.\n\tanchoredDigestRegexp = storageRegexp.Delayed(anchoredDigest)\n\n\tnamePat = expression(\n\t\toptional(domain, literal(`/`)),\n\t\tnameComponent,\n\t\toptional(repeated(literal(`/`), nameComponent)))\n\t// NameRegexp is the format for the name component of references. The\n\t// regexp has capturing groups for the domain and name part omitting\n\t// the separating forward slash from either.\n\tNameRegexp = re(namePat)\n\n\tanchoredName = anchored(\n\t\toptional(capture(domain), literal(`/`)),\n\t\tcapture(nameComponent,\n\t\t\toptional(repeated(literal(`/`), nameComponent))))\n\t// anchoredNameRegexp is used to parse a name value, capturing the\n\t// domain and trailing components.\n\tanchoredNameRegexp = storageRegexp.Delayed(anchoredName)\n\n\treferencePat = anchored(capture(namePat),\n\t\toptional(literal(\":\"), capture(tag)),\n\t\toptional(literal(\"@\"), capture(digestPat)))\n\t// ReferenceRegexp is the full supported format of a reference. The regexp\n\t// is anchored and has capturing groups for name, tag, and digest\n\t// components.\n\tReferenceRegexp = re(referencePat)\n\n\t// IdentifierRegexp is the format for string identifier used as a\n\t// content addressable identifier using sha256. These identifiers\n\t// are like digests without the algorithm, since sha256 is used.\n\tIdentifierRegexp = re(identifier)\n\n\t// ShortIdentifierRegexp is the format used to represent a prefix\n\t// of an identifier. A prefix may be used to match a sha256 identifier\n\t// within a list of trusted identifiers.\n\tShortIdentifierRegexp = re(shortIdentifier)\n\n\tanchoredIdentifier = anchored(identifier)\n\t// anchoredIdentifierRegexp is used to check or match an\n\t// identifier value, anchored at start and end of string.\n\tanchoredIdentifierRegexp = storageRegexp.Delayed(anchoredIdentifier)\n)\n\n// re compiles the string to a regular expression.\nvar re = regexp.MustCompile\n\n// literal compiles s into a literal regular expression, escaping any regexp\n// reserved characters.\nfunc literal(s string) string {\n\treturn regexp.QuoteMeta(s)\n}\n\n// expression defines a full expression, where each regular expression must\n// follow the previous.\nfunc expression(res ...string) string {\n\treturn strings.Join(res, \"\")\n}\n\n// optional wraps the expression in a non-capturing group and makes the\n// production optional.\nfunc optional(res ...string) string {\n\treturn group(expression(res...)) + `?`\n}\n\n// repeated wraps the regexp in a non-capturing group to get one or more\n// matches.\nfunc repeated(res ...string) string {\n\treturn group(expression(res...)) + `+`\n}\n\n// group wraps the regexp in a non-capturing group.\nfunc group(res ...string) string {\n\treturn `(?:` + expression(res...) + `)`\n}\n\n// capture wraps the expression in a capturing group.\nfunc capture(res ...string) string {\n\treturn `(` + expression(res...) + `)`\n}\n\n// anchored anchors the regular expression by adding start and end delimiters.\nfunc anchored(res ...string) string {\n\treturn `^` + expression(res...) + `$`\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/internal/multierr/multierr.go",
    "content": "package multierr\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Format creates an error value from the input array (which should not be empty)\n// If the input contains a single error value, it is returned as is.\n// If there are multiple, they are formatted as a multi-error (with Unwrap() []error) with the provided initial, separator, and ending strings.\n//\n// Typical usage:\n//\n//\tvar errs []error\n//\t// …\n//\terrs = append(errs, …)\n//\t// …\n//\tif errs != nil { return multierr.Format(\"Failures doing $FOO\", \"\\n* \", \"\", errs)}\nfunc Format(first, middle, last string, errs []error) error {\n\tswitch len(errs) {\n\tcase 0:\n\t\treturn fmt.Errorf(\"internal error: multierr.Format called with 0 errors\")\n\tcase 1:\n\t\treturn errs[0]\n\tdefault:\n\t\t// We have to do this — and this function only really exists — because fmt.Errorf(format, errs...) is invalid:\n\t\t// []error is not a valid parameter to a function expecting []any\n\t\tanyErrs := make([]any, 0, len(errs))\n\t\tfor _, e := range errs {\n\t\t\tanyErrs = append(anyErrs, e)\n\t\t}\n\t\treturn fmt.Errorf(first+\"%w\"+strings.Repeat(middle+\"%w\", len(errs)-1)+last, anyErrs...)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/internal/rootless/rootless.go",
    "content": "package rootless\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\n// GetRootlessEUID returns the UID of the current user (in the parent userNS, if any)\n//\n// Podman and similar software, in “rootless” configuration, when run as a non-root\n// user, very early switches to a user namespace, where Geteuid() == 0 (but does not\n// switch to a limited mount namespace); so, code relying on Geteuid() would use\n// system-wide paths in e.g. /var, when the user is actually not privileged to write to\n// them, and expects state to be stored in the home directory.\n//\n// If Podman is setting up such a user namespace, it records the original UID in an\n// environment variable, allowing us to make choices based on the actual user’s identity.\nfunc GetRootlessEUID() int {\n\teuidEnv := os.Getenv(\"_CONTAINERS_ROOTLESS_UID\")\n\tif euidEnv != \"\" {\n\t\teuid, _ := strconv.Atoi(euidEnv)\n\t\treturn euid\n\t}\n\treturn os.Geteuid()\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/internal/set/set.go",
    "content": "package set\n\nimport \"golang.org/x/exp/maps\"\n\n// FIXME:\n// - Docstrings\n// - This should be in a public library somewhere\n\ntype Set[E comparable] struct {\n\tm map[E]struct{}\n}\n\nfunc New[E comparable]() *Set[E] {\n\treturn &Set[E]{\n\t\tm: map[E]struct{}{},\n\t}\n}\n\nfunc NewWithValues[E comparable](values ...E) *Set[E] {\n\ts := New[E]()\n\tfor _, v := range values {\n\t\ts.Add(v)\n\t}\n\treturn s\n}\n\nfunc (s *Set[E]) Add(v E) {\n\ts.m[v] = struct{}{} // Possibly writing the same struct{}{} presence marker again.\n}\n\nfunc (s *Set[E]) AddSlice(slice []E) {\n\tfor _, v := range slice {\n\t\ts.Add(v)\n\t}\n}\n\nfunc (s *Set[E]) Delete(v E) {\n\tdelete(s.m, v)\n}\n\nfunc (s *Set[E]) Contains(v E) bool {\n\t_, ok := s.m[v]\n\treturn ok\n}\n\nfunc (s *Set[E]) Empty() bool {\n\treturn len(s.m) == 0\n}\n\nfunc (s *Set[E]) Values() []E {\n\treturn maps.Keys(s.m)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/compression/internal/types.go",
    "content": "package internal\n\nimport \"io\"\n\n// CompressorFunc writes the compressed stream to the given writer using the specified compression level.\n//\n// Compressing a stream may create integrity data that allows consuming the compressed byte stream\n// while only using subsets of the compressed data (if the compressed data is seekable and most\n// of the uncompressed data is already present via other means), while still protecting integrity\n// of the compressed stream against unwanted modification. (In OCI container images, this metadata\n// is usually carried in manifest annotations.)\n//\n// If the compression generates such metadata, it is written to the provided metadata map.\n//\n// The caller must call Close() on the stream (even if the input stream does not need closing!).\ntype CompressorFunc func(io.Writer, map[string]string, *int) (io.WriteCloser, error)\n\n// DecompressorFunc returns the decompressed stream, given a compressed stream.\n// The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!).\ntype DecompressorFunc func(io.Reader) (io.ReadCloser, error)\n\n// Algorithm is a compression algorithm that can be used for CompressStream.\ntype Algorithm struct {\n\tname            string\n\tbaseVariantName string\n\tprefix          []byte // Initial bytes of a stream compressed using this algorithm, or empty to disable detection.\n\tdecompressor    DecompressorFunc\n\tcompressor      CompressorFunc\n}\n\n// NewAlgorithm creates an Algorithm instance.\n// nontrivialBaseVariantName is typically \"\".\n// This function exists so that Algorithm instances can only be created by code that\n// is allowed to import this internal subpackage.\nfunc NewAlgorithm(name, nontrivialBaseVariantName string, prefix []byte, decompressor DecompressorFunc, compressor CompressorFunc) Algorithm {\n\tbaseVariantName := name\n\tif nontrivialBaseVariantName != \"\" {\n\t\tbaseVariantName = nontrivialBaseVariantName\n\t}\n\treturn Algorithm{\n\t\tname:            name,\n\t\tbaseVariantName: baseVariantName,\n\t\tprefix:          prefix,\n\t\tdecompressor:    decompressor,\n\t\tcompressor:      compressor,\n\t}\n}\n\n// Name returns the name for the compression algorithm.\nfunc (c Algorithm) Name() string {\n\treturn c.name\n}\n\n// BaseVariantName returns the name of the “base variant” of the compression algorithm.\n// It is either equal to Name() of the same algorithm, or equal to Name() of some other Algorithm (the “base variant”).\n// This supports a single level of “is-a” relationship between compression algorithms, e.g. where \"zstd:chunked\" data is valid \"zstd\" data.\nfunc (c Algorithm) BaseVariantName() string {\n\treturn c.baseVariantName\n}\n\n// AlgorithmCompressor returns the compressor field of algo.\n// This is a function instead of a public method so that it is only callable by code\n// that is allowed to import this internal subpackage.\nfunc AlgorithmCompressor(algo Algorithm) CompressorFunc {\n\treturn algo.compressor\n}\n\n// AlgorithmDecompressor returns the decompressor field of algo.\n// This is a function instead of a public method so that it is only callable by code\n// that is allowed to import this internal subpackage.\nfunc AlgorithmDecompressor(algo Algorithm) DecompressorFunc {\n\treturn algo.decompressor\n}\n\n// AlgorithmPrefix returns the prefix field of algo.\n// This is a function instead of a public method so that it is only callable by code\n// that is allowed to import this internal subpackage.\nfunc AlgorithmPrefix(algo Algorithm) []byte {\n\treturn algo.prefix\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/compression/types/types.go",
    "content": "package types\n\nimport (\n\t\"github.com/containers/image/v5/pkg/compression/internal\"\n)\n\n// DecompressorFunc returns the decompressed stream, given a compressed stream.\n// The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!).\ntype DecompressorFunc = internal.DecompressorFunc\n\n// Algorithm is a compression algorithm provided and supported by pkg/compression.\n// It can’t be supplied from the outside.\ntype Algorithm = internal.Algorithm\n\nconst (\n\t// GzipAlgorithmName is the name used by pkg/compression.Gzip.\n\t// NOTE: Importing only this /types package does not inherently guarantee a Gzip algorithm\n\t// will actually be available. (In fact it is intended for this types package not to depend\n\t// on any of the implementations.)\n\tGzipAlgorithmName = \"gzip\"\n\t// Bzip2AlgorithmName is the name used by pkg/compression.Bzip2.\n\t// NOTE: Importing only this /types package does not inherently guarantee a Bzip2 algorithm\n\t// will actually be available. (In fact it is intended for this types package not to depend\n\t// on any of the implementations.)\n\tBzip2AlgorithmName = \"bzip2\"\n\t// XzAlgorithmName is the name used by pkg/compression.Xz.\n\t// NOTE: Importing only this /types package does not inherently guarantee a Xz algorithm\n\t// will actually be available. (In fact it is intended for this types package not to depend\n\t// on any of the implementations.)\n\tXzAlgorithmName = \"Xz\"\n\t// ZstdAlgorithmName is the name used by pkg/compression.Zstd.\n\t// NOTE: Importing only this /types package does not inherently guarantee a Zstd algorithm\n\t// will actually be available. (In fact it is intended for this types package not to depend\n\t// on any of the implementations.)\n\tZstdAlgorithmName = \"zstd\"\n\t// ZstdChunkedAlgorithmName is the name used by pkg/compression.ZstdChunked.\n\t// NOTE: Importing only this /types package does not inherently guarantee a ZstdChunked algorithm\n\t// will actually be available. (In fact it is intended for this types package not to depend\n\t// on any of the implementations.)\n\tZstdChunkedAlgorithmName = \"zstd:chunked\"\n)\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/docker/config/config.go",
    "content": "package config\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/containers/image/v5/docker/reference\"\n\t\"github.com/containers/image/v5/internal/multierr\"\n\t\"github.com/containers/image/v5/internal/set\"\n\t\"github.com/containers/image/v5/pkg/sysregistriesv2\"\n\t\"github.com/containers/image/v5/types\"\n\t\"github.com/containers/storage/pkg/fileutils\"\n\t\"github.com/containers/storage/pkg/homedir\"\n\t\"github.com/containers/storage/pkg/ioutils\"\n\thelperclient \"github.com/docker/docker-credential-helpers/client\"\n\t\"github.com/docker/docker-credential-helpers/credentials\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype dockerAuthConfig struct {\n\tAuth          string `json:\"auth,omitempty\"`\n\tIdentityToken string `json:\"identitytoken,omitempty\"`\n}\n\ntype dockerConfigFile struct {\n\tAuthConfigs map[string]dockerAuthConfig `json:\"auths\"`\n\tCredHelpers map[string]string           `json:\"credHelpers,omitempty\"`\n}\n\nvar (\n\tdefaultPerUIDPathFormat = filepath.FromSlash(\"/run/containers/%d/auth.json\")\n\txdgConfigHomePath       = filepath.FromSlash(\"containers/auth.json\")\n\txdgRuntimeDirPath       = filepath.FromSlash(\"containers/auth.json\")\n\tdockerHomePath          = filepath.FromSlash(\".docker/config.json\")\n\tdockerLegacyHomePath    = \".dockercfg\"\n\tnonLinuxAuthFilePath    = filepath.FromSlash(\".config/containers/auth.json\")\n\n\t// ErrNotLoggedIn is returned for users not logged into a registry\n\t// that they are trying to logout of\n\tErrNotLoggedIn = errors.New(\"not logged in\")\n\t// ErrNotSupported is returned for unsupported methods\n\tErrNotSupported = errors.New(\"not supported\")\n)\n\n// authPath combines a path to a file with container registry credentials,\n// along with expected properties of that path (currently just whether it's\n// legacy format or not).\ntype authPath struct {\n\tpath         string\n\tlegacyFormat bool\n}\n\n// newAuthPathDefault constructs an authPath in non-legacy format.\nfunc newAuthPathDefault(path string) authPath {\n\treturn authPath{path: path, legacyFormat: false}\n}\n\n// GetAllCredentials returns the registry credentials for all registries stored\n// in any of the configured credential helpers.\nfunc GetAllCredentials(sys *types.SystemContext) (map[string]types.DockerAuthConfig, error) {\n\t// To keep things simple, let's first extract all registries from all\n\t// possible sources, and then call `GetCredentials` on them.  That\n\t// prevents us from having to reverse engineer the logic in\n\t// `GetCredentials`.\n\tallKeys := set.New[string]()\n\n\t// To use GetCredentials, we must at least convert the URL forms into host names.\n\t// While we're at it, we’ll also canonicalize docker.io to the standard format.\n\tnormalizedDockerIORegistry := normalizeRegistry(\"docker.io\")\n\n\thelpers, err := sysregistriesv2.CredentialHelpers(sys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, helper := range helpers {\n\t\tswitch helper {\n\t\t// Special-case the built-in helper for auth files.\n\t\tcase sysregistriesv2.AuthenticationFileHelper:\n\t\t\tfor _, path := range getAuthFilePaths(sys, homedir.Get()) {\n\t\t\t\t// parse returns an empty map in case the path doesn't exist.\n\t\t\t\tfileContents, err := path.parse()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"reading JSON file %q: %w\", path.path, err)\n\t\t\t\t}\n\t\t\t\t// Credential helpers in the auth file have a\n\t\t\t\t// direct mapping to a registry, so we can just\n\t\t\t\t// walk the map.\n\t\t\t\tfor registry := range fileContents.CredHelpers {\n\t\t\t\t\tallKeys.Add(registry)\n\t\t\t\t}\n\t\t\t\tfor key := range fileContents.AuthConfigs {\n\t\t\t\t\tkey := normalizeAuthFileKey(key, path.legacyFormat)\n\t\t\t\t\tif key == normalizedDockerIORegistry {\n\t\t\t\t\t\tkey = \"docker.io\"\n\t\t\t\t\t}\n\t\t\t\t\tallKeys.Add(key)\n\t\t\t\t}\n\t\t\t}\n\t\t// External helpers.\n\t\tdefault:\n\t\t\tcreds, err := listCredsInCredHelper(helper)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Error listing credentials stored in credential helper %s: %v\", helper, err)\n\t\t\t\tif errors.Is(err, exec.ErrNotFound) {\n\t\t\t\t\tcreds = nil // It's okay if the helper doesn't exist.\n\t\t\t\t} else {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor registry := range creds {\n\t\t\t\tallKeys.Add(registry)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Now use `GetCredentials` to the specific auth configs for each\n\t// previously listed registry.\n\tallCreds := make(map[string]types.DockerAuthConfig)\n\tfor _, key := range allKeys.Values() {\n\t\tcreds, err := GetCredentials(sys, key)\n\t\tif err != nil {\n\t\t\t// Note: we rely on the logging in `GetCredentials`.\n\t\t\treturn nil, err\n\t\t}\n\t\tif creds != (types.DockerAuthConfig{}) {\n\t\t\tallCreds[key] = creds\n\t\t}\n\t}\n\n\treturn allCreds, nil\n}\n\n// getAuthFilePaths returns a slice of authPaths based on the system context\n// in the order they should be searched. Note that some paths may not exist.\n// The homeDir parameter should always be homedir.Get(), and is only intended to be overridden\n// by tests.\nfunc getAuthFilePaths(sys *types.SystemContext, homeDir string) []authPath {\n\tpaths := []authPath{}\n\tpathToAuth, userSpecifiedPath, err := getPathToAuth(sys)\n\tif err == nil {\n\t\tpaths = append(paths, pathToAuth)\n\t} else {\n\t\t// Error means that the path set for XDG_RUNTIME_DIR does not exist\n\t\t// but we don't want to completely fail in the case that the user is pulling a public image\n\t\t// Logging the error as a warning instead and moving on to pulling the image\n\t\tlogrus.Warnf(\"%v: Trying to pull image in the event that it is a public image.\", err)\n\t}\n\tif !userSpecifiedPath {\n\t\txdgCfgHome := os.Getenv(\"XDG_CONFIG_HOME\")\n\t\tif xdgCfgHome == \"\" {\n\t\t\txdgCfgHome = filepath.Join(homeDir, \".config\")\n\t\t}\n\t\tpaths = append(paths, newAuthPathDefault(filepath.Join(xdgCfgHome, xdgConfigHomePath)))\n\t\tif dockerConfig := os.Getenv(\"DOCKER_CONFIG\"); dockerConfig != \"\" {\n\t\t\tpaths = append(paths, newAuthPathDefault(filepath.Join(dockerConfig, \"config.json\")))\n\t\t} else {\n\t\t\tpaths = append(paths,\n\t\t\t\tnewAuthPathDefault(filepath.Join(homeDir, dockerHomePath)),\n\t\t\t)\n\t\t}\n\t\tpaths = append(paths,\n\t\t\tauthPath{path: filepath.Join(homeDir, dockerLegacyHomePath), legacyFormat: true},\n\t\t)\n\t}\n\treturn paths\n}\n\n// GetCredentials returns the registry credentials matching key, appropriate for\n// sys and the users’ configuration.\n// If an entry is not found, an empty struct is returned.\n// A valid key is a repository, a namespace within a registry, or a registry hostname.\n//\n// GetCredentialsForRef should almost always be used in favor of this API.\nfunc GetCredentials(sys *types.SystemContext, key string) (types.DockerAuthConfig, error) {\n\treturn getCredentialsWithHomeDir(sys, key, homedir.Get())\n}\n\n// GetCredentialsForRef returns the registry credentials necessary for\n// accessing ref on the registry ref points to,\n// appropriate for sys and the users’ configuration.\n// If an entry is not found, an empty struct is returned.\nfunc GetCredentialsForRef(sys *types.SystemContext, ref reference.Named) (types.DockerAuthConfig, error) {\n\treturn getCredentialsWithHomeDir(sys, ref.Name(), homedir.Get())\n}\n\n// getCredentialsWithHomeDir is an internal implementation detail of\n// GetCredentialsForRef and GetCredentials. It exists only to allow testing it\n// with an artificial home directory.\nfunc getCredentialsWithHomeDir(sys *types.SystemContext, key, homeDir string) (types.DockerAuthConfig, error) {\n\t_, err := validateKey(key)\n\tif err != nil {\n\t\treturn types.DockerAuthConfig{}, err\n\t}\n\n\tif sys != nil && sys.DockerAuthConfig != nil {\n\t\tlogrus.Debugf(\"Returning credentials for %s from DockerAuthConfig\", key)\n\t\treturn *sys.DockerAuthConfig, nil\n\t}\n\n\tvar registry string // We compute this once because it is used in several places.\n\tif firstSlash := strings.IndexRune(key, '/'); firstSlash != -1 {\n\t\tregistry = key[:firstSlash]\n\t} else {\n\t\tregistry = key\n\t}\n\n\t// Anonymous function to query credentials from auth files.\n\tgetCredentialsFromAuthFiles := func() (types.DockerAuthConfig, string, error) {\n\t\tfor _, path := range getAuthFilePaths(sys, homeDir) {\n\t\t\tcreds, err := findCredentialsInFile(key, registry, path)\n\t\t\tif err != nil {\n\t\t\t\treturn types.DockerAuthConfig{}, \"\", err\n\t\t\t}\n\n\t\t\tif creds != (types.DockerAuthConfig{}) {\n\t\t\t\treturn creds, path.path, nil\n\t\t\t}\n\t\t}\n\t\treturn types.DockerAuthConfig{}, \"\", nil\n\t}\n\n\thelpers, err := sysregistriesv2.CredentialHelpers(sys)\n\tif err != nil {\n\t\treturn types.DockerAuthConfig{}, err\n\t}\n\n\tvar multiErr []error\n\tfor _, helper := range helpers {\n\t\tvar (\n\t\t\tcreds          types.DockerAuthConfig\n\t\t\thelperKey      string\n\t\t\tcredHelperPath string\n\t\t\terr            error\n\t\t)\n\t\tswitch helper {\n\t\t// Special-case the built-in helper for auth files.\n\t\tcase sysregistriesv2.AuthenticationFileHelper:\n\t\t\thelperKey = key\n\t\t\tcreds, credHelperPath, err = getCredentialsFromAuthFiles()\n\t\t// External helpers.\n\t\tdefault:\n\t\t\t// This intentionally uses \"registry\", not \"key\"; we don't support namespaced\n\t\t\t// credentials in helpers, but a \"registry\" is a valid parent of \"key\".\n\t\t\thelperKey = registry\n\t\t\tcreds, err = getCredsFromCredHelper(helper, registry)\n\t\t}\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error looking up credentials for %s in credential helper %s: %v\", helperKey, helper, err)\n\t\t\tmultiErr = append(multiErr, err)\n\t\t\tcontinue\n\t\t}\n\t\tif creds != (types.DockerAuthConfig{}) {\n\t\t\tmsg := fmt.Sprintf(\"Found credentials for %s in credential helper %s\", helperKey, helper)\n\t\t\tif credHelperPath != \"\" {\n\t\t\t\tmsg = fmt.Sprintf(\"%s in file %s\", msg, credHelperPath)\n\t\t\t}\n\t\t\tlogrus.Debug(msg)\n\t\t\treturn creds, nil\n\t\t}\n\t}\n\tif multiErr != nil {\n\t\treturn types.DockerAuthConfig{}, multierr.Format(\"errors looking up credentials:\\n\\t* \", \"\\nt* \", \"\\n\", multiErr)\n\t}\n\n\tlogrus.Debugf(\"No credentials for %s found\", key)\n\treturn types.DockerAuthConfig{}, nil\n}\n\n// GetAuthentication returns the registry credentials matching key, appropriate for\n// sys and the users’ configuration.\n// If an entry is not found, an empty struct is returned.\n// A valid key is a repository, a namespace within a registry, or a registry hostname.\n//\n// Deprecated: This API only has support for username and password. To get the\n// support for oauth2 in container registry authentication, we added the new\n// GetCredentialsForRef and GetCredentials API. The new API should be used and this API is kept to\n// maintain backward compatibility.\nfunc GetAuthentication(sys *types.SystemContext, key string) (string, string, error) {\n\treturn getAuthenticationWithHomeDir(sys, key, homedir.Get())\n}\n\n// getAuthenticationWithHomeDir is an internal implementation detail of GetAuthentication,\n// it exists only to allow testing it with an artificial home directory.\nfunc getAuthenticationWithHomeDir(sys *types.SystemContext, key, homeDir string) (string, string, error) {\n\tcreds, err := getCredentialsWithHomeDir(sys, key, homeDir)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif creds.IdentityToken != \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"non-empty identity token found and this API doesn't support it: %w\", ErrNotSupported)\n\t}\n\treturn creds.Username, creds.Password, nil\n}\n\n// SetCredentials stores the username and password in a location\n// appropriate for sys and the users’ configuration.\n// A valid key is a repository, a namespace within a registry, or a registry hostname;\n// using forms other than just a registry may fail depending on configuration.\n// Returns a human-readable description of the location that was updated.\n// NOTE: The return value is only intended to be read by humans; its form is not an API,\n// it may change (or new forms can be added) any time.\nfunc SetCredentials(sys *types.SystemContext, key, username, password string) (string, error) {\n\thelpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Make sure to collect all errors.\n\tvar multiErr []error\n\tfor _, helper := range helpers {\n\t\tvar desc string\n\t\tvar err error\n\t\tswitch helper {\n\t\t// Special-case the built-in helpers for auth files.\n\t\tcase sysregistriesv2.AuthenticationFileHelper:\n\t\t\tdesc, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) {\n\t\t\t\tif ch, exists := fileContents.CredHelpers[key]; exists {\n\t\t\t\t\tif isNamespaced {\n\t\t\t\t\t\treturn false, \"\", unsupportedNamespaceErr(ch)\n\t\t\t\t\t}\n\t\t\t\t\tdesc, err := setCredsInCredHelper(ch, key, username, password)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn false, \"\", err\n\t\t\t\t\t}\n\t\t\t\t\treturn false, desc, nil\n\t\t\t\t}\n\t\t\t\tcreds := base64.StdEncoding.EncodeToString([]byte(username + \":\" + password))\n\t\t\t\tnewCreds := dockerAuthConfig{Auth: creds}\n\t\t\t\tfileContents.AuthConfigs[key] = newCreds\n\t\t\t\treturn true, \"\", nil\n\t\t\t})\n\t\t// External helpers.\n\t\tdefault:\n\t\t\tif isNamespaced {\n\t\t\t\terr = unsupportedNamespaceErr(helper)\n\t\t\t} else {\n\t\t\t\tdesc, err = setCredsInCredHelper(helper, key, username, password)\n\t\t\t}\n\t\t}\n\t\tif err != nil {\n\t\t\tmultiErr = append(multiErr, err)\n\t\t\tlogrus.Debugf(\"Error storing credentials for %s in credential helper %s: %v\", key, helper, err)\n\t\t\tcontinue\n\t\t}\n\t\tlogrus.Debugf(\"Stored credentials for %s in credential helper %s\", key, helper)\n\t\treturn desc, nil\n\t}\n\treturn \"\", multierr.Format(\"Errors storing credentials\\n\\t* \", \"\\n\\t* \", \"\\n\", multiErr)\n}\n\nfunc unsupportedNamespaceErr(helper string) error {\n\treturn fmt.Errorf(\"namespaced key is not supported for credential helper %s\", helper)\n}\n\n// SetAuthentication stores the username and password in the credential helper or file\n// See the documentation of SetCredentials for format of \"key\"\nfunc SetAuthentication(sys *types.SystemContext, key, username, password string) error {\n\t_, err := SetCredentials(sys, key, username, password)\n\treturn err\n}\n\n// RemoveAuthentication removes credentials for `key` from all possible\n// sources such as credential helpers and auth files.\n// A valid key is a repository, a namespace within a registry, or a registry hostname;\n// using forms other than just a registry may fail depending on configuration.\nfunc RemoveAuthentication(sys *types.SystemContext, key string) error {\n\thelpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tisLoggedIn := false\n\n\tremoveFromCredHelper := func(helper string) error {\n\t\tif isNamespaced {\n\t\t\tlogrus.Debugf(\"Not removing credentials because namespaced keys are not supported for the credential helper: %s\", helper)\n\t\t\treturn nil\n\t\t}\n\t\terr := deleteCredsFromCredHelper(helper, key)\n\t\tif err == nil {\n\t\t\tlogrus.Debugf(\"Credentials for %q were deleted from credential helper %s\", key, helper)\n\t\t\tisLoggedIn = true\n\t\t\treturn nil\n\t\t}\n\t\tif credentials.IsErrCredentialsNotFoundMessage(err.Error()) {\n\t\t\tlogrus.Debugf(\"Not logged in to %s with credential helper %s\", key, helper)\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"removing credentials for %s from credential helper %s: %w\", key, helper, err)\n\t}\n\n\tvar multiErr []error\n\tfor _, helper := range helpers {\n\t\tvar err error\n\t\tswitch helper {\n\t\t// Special-case the built-in helper for auth files.\n\t\tcase sysregistriesv2.AuthenticationFileHelper:\n\t\t\t_, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) {\n\t\t\t\tvar helperErr error\n\t\t\t\tif innerHelper, exists := fileContents.CredHelpers[key]; exists {\n\t\t\t\t\thelperErr = removeFromCredHelper(innerHelper)\n\t\t\t\t}\n\t\t\t\tif _, ok := fileContents.AuthConfigs[key]; ok {\n\t\t\t\t\tisLoggedIn = true\n\t\t\t\t\tdelete(fileContents.AuthConfigs, key)\n\t\t\t\t}\n\t\t\t\treturn true, \"\", helperErr\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tmultiErr = append(multiErr, err)\n\t\t\t}\n\t\t// External helpers.\n\t\tdefault:\n\t\t\tif err := removeFromCredHelper(helper); err != nil {\n\t\t\t\tmultiErr = append(multiErr, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tif multiErr != nil {\n\t\treturn multierr.Format(\"errors removing credentials\\n\\t* \", \"\\n\\t*\", \"\\n\", multiErr)\n\t}\n\tif !isLoggedIn {\n\t\treturn ErrNotLoggedIn\n\t}\n\n\treturn nil\n}\n\n// RemoveAllAuthentication deletes all the credentials stored in credential\n// helpers and auth files.\nfunc RemoveAllAuthentication(sys *types.SystemContext) error {\n\thelpers, jsonEditor, _, _, err := prepareForEdit(sys, \"\", false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar multiErr []error\n\tfor _, helper := range helpers {\n\t\tvar err error\n\t\tswitch helper {\n\t\t// Special-case the built-in helper for auth files.\n\t\tcase sysregistriesv2.AuthenticationFileHelper:\n\t\t\t_, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) {\n\t\t\t\tfor registry, helper := range fileContents.CredHelpers {\n\t\t\t\t\t// Helpers in auth files are expected\n\t\t\t\t\t// to exist, so no special treatment\n\t\t\t\t\t// for them.\n\t\t\t\t\tif err := deleteCredsFromCredHelper(helper, registry); err != nil {\n\t\t\t\t\t\treturn false, \"\", err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfileContents.CredHelpers = make(map[string]string)\n\t\t\t\tfileContents.AuthConfigs = make(map[string]dockerAuthConfig)\n\t\t\t\treturn true, \"\", nil\n\t\t\t})\n\t\t// External helpers.\n\t\tdefault:\n\t\t\tvar creds map[string]string\n\t\t\tcreds, err = listCredsInCredHelper(helper)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, exec.ErrNotFound) {\n\t\t\t\t\t// It's okay if the helper doesn't exist.\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor registry := range creds {\n\t\t\t\terr = deleteCredsFromCredHelper(helper, registry)\n\t\t\t\tif err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error removing credentials from credential helper %s: %v\", helper, err)\n\t\t\tmultiErr = append(multiErr, err)\n\t\t\tcontinue\n\t\t}\n\t\tlogrus.Debugf(\"All credentials removed from credential helper %s\", helper)\n\t}\n\n\tif multiErr != nil {\n\t\treturn multierr.Format(\"errors removing all credentials:\\n\\t* \", \"\\n\\t* \", \"\\n\", multiErr)\n\t}\n\treturn nil\n}\n\n// prepareForEdit processes sys and key (if keyRelevant) to return:\n// - a list of credential helpers\n// - a function which can be used to edit the JSON file\n// - the key value to actually use in credential helpers / JSON\n// - a boolean which is true if key is namespaced (and should not be used with credential helpers).\nfunc prepareForEdit(sys *types.SystemContext, key string, keyRelevant bool) ([]string, func(*types.SystemContext, func(*dockerConfigFile) (bool, string, error)) (string, error), string, bool, error) {\n\tvar isNamespaced bool\n\tif keyRelevant {\n\t\tns, err := validateKey(key)\n\t\tif err != nil {\n\t\t\treturn nil, nil, \"\", false, err\n\t\t}\n\t\tisNamespaced = ns\n\t}\n\n\tif sys != nil && sys.DockerCompatAuthFilePath != \"\" {\n\t\tif sys.AuthFilePath != \"\" {\n\t\t\treturn nil, nil, \"\", false, errors.New(\"AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously\")\n\t\t}\n\t\tif keyRelevant {\n\t\t\tif isNamespaced {\n\t\t\t\treturn nil, nil, \"\", false, fmt.Errorf(\"Credentials cannot be recorded in Docker-compatible format with namespaced key %q\", key)\n\t\t\t}\n\t\t\tif key == \"docker.io\" {\n\t\t\t\tkey = \"https://index.docker.io/v1/\"\n\t\t\t}\n\t\t}\n\n\t\t// Do not use helpers defined in sysregistriesv2 because Docker isn’t aware of them.\n\t\treturn []string{sysregistriesv2.AuthenticationFileHelper}, modifyDockerConfigJSON, key, false, nil\n\t}\n\n\thelpers, err := sysregistriesv2.CredentialHelpers(sys)\n\tif err != nil {\n\t\treturn nil, nil, \"\", false, err\n\t}\n\n\treturn helpers, modifyJSON, key, isNamespaced, nil\n}\n\nfunc listCredsInCredHelper(credHelper string) (map[string]string, error) {\n\thelperName := fmt.Sprintf(\"docker-credential-%s\", credHelper)\n\tp := helperclient.NewShellProgramFunc(helperName)\n\treturn helperclient.List(p)\n}\n\n// getPathToAuth gets the path of the auth.json file used for reading and writing credentials,\n// and a boolean indicating whether the return value came from an explicit user choice (i.e. not defaults)\nfunc getPathToAuth(sys *types.SystemContext) (authPath, bool, error) {\n\treturn getPathToAuthWithOS(sys, runtime.GOOS)\n}\n\n// getPathToAuthWithOS is an internal implementation detail of getPathToAuth,\n// it exists only to allow testing it with an artificial runtime.GOOS.\nfunc getPathToAuthWithOS(sys *types.SystemContext, goOS string) (authPath, bool, error) {\n\tif sys != nil {\n\t\tif sys.AuthFilePath != \"\" && sys.DockerCompatAuthFilePath != \"\" {\n\t\t\treturn authPath{}, false, errors.New(\"AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously\")\n\t\t}\n\t\tif sys.AuthFilePath != \"\" {\n\t\t\treturn newAuthPathDefault(sys.AuthFilePath), true, nil\n\t\t}\n\t\t// When reading, we can process auth.json and Docker’s config.json with the same code.\n\t\t// When writing, prepareForEdit chooses an appropriate jsonEditor implementation.\n\t\tif sys.DockerCompatAuthFilePath != \"\" {\n\t\t\treturn newAuthPathDefault(sys.DockerCompatAuthFilePath), true, nil\n\t\t}\n\t\tif sys.LegacyFormatAuthFilePath != \"\" {\n\t\t\treturn authPath{path: sys.LegacyFormatAuthFilePath, legacyFormat: true}, true, nil\n\t\t}\n\t\t// Note: RootForImplicitAbsolutePaths should not affect paths starting with $HOME\n\t\tif sys.RootForImplicitAbsolutePaths != \"\" && goOS == \"linux\" {\n\t\t\treturn newAuthPathDefault(filepath.Join(sys.RootForImplicitAbsolutePaths, fmt.Sprintf(defaultPerUIDPathFormat, os.Getuid()))), false, nil\n\t\t}\n\t}\n\tif goOS != \"linux\" {\n\t\treturn newAuthPathDefault(filepath.Join(homedir.Get(), nonLinuxAuthFilePath)), false, nil\n\t}\n\n\truntimeDir := os.Getenv(\"XDG_RUNTIME_DIR\")\n\tif runtimeDir != \"\" {\n\t\t// This function does not in general need to separately check that the returned path exists; that’s racy, and callers will fail accessing the file anyway.\n\t\t// We are checking for fs.ErrNotExist here only to give the user better guidance what to do in this special case.\n\t\terr := fileutils.Exists(runtimeDir)\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t// This means the user set the XDG_RUNTIME_DIR variable and either forgot to create the directory\n\t\t\t// or made a typo while setting the environment variable,\n\t\t\t// so return an error referring to $XDG_RUNTIME_DIR instead of xdgRuntimeDirPath inside.\n\t\t\treturn authPath{}, false, fmt.Errorf(\"%q directory set by $XDG_RUNTIME_DIR does not exist. Either create the directory or unset $XDG_RUNTIME_DIR.: %w\", runtimeDir, err)\n\t\t} // else ignore err and let the caller fail accessing xdgRuntimeDirPath.\n\t\treturn newAuthPathDefault(filepath.Join(runtimeDir, xdgRuntimeDirPath)), false, nil\n\t}\n\treturn newAuthPathDefault(fmt.Sprintf(defaultPerUIDPathFormat, os.Getuid())), false, nil\n}\n\n// parse unmarshals the credentials stored in the auth.json file and returns it\n// or returns an empty dockerConfigFile data structure if auth.json does not exist\n// if the file exists and is empty, this function returns an error.\nfunc (path authPath) parse() (dockerConfigFile, error) {\n\tvar fileContents dockerConfigFile\n\n\traw, err := os.ReadFile(path.path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tfileContents.AuthConfigs = map[string]dockerAuthConfig{}\n\t\t\treturn fileContents, nil\n\t\t}\n\t\treturn dockerConfigFile{}, err\n\t}\n\n\tif path.legacyFormat {\n\t\tif err = json.Unmarshal(raw, &fileContents.AuthConfigs); err != nil {\n\t\t\treturn dockerConfigFile{}, fmt.Errorf(\"unmarshaling JSON at %q: %w\", path.path, err)\n\t\t}\n\t\treturn fileContents, nil\n\t}\n\n\tif err = json.Unmarshal(raw, &fileContents); err != nil {\n\t\treturn dockerConfigFile{}, fmt.Errorf(\"unmarshaling JSON at %q: %w\", path.path, err)\n\t}\n\n\tif fileContents.AuthConfigs == nil {\n\t\tfileContents.AuthConfigs = map[string]dockerAuthConfig{}\n\t}\n\tif fileContents.CredHelpers == nil {\n\t\tfileContents.CredHelpers = make(map[string]string)\n\t}\n\n\treturn fileContents, nil\n}\n\n// modifyJSON finds an auth.json file, calls editor on the contents, and\n// writes it back if editor returns true.\n// Returns a human-readable description of the file, to be returned by SetCredentials.\n//\n// The editor may also return a human-readable description of the updated location; if it is \"\",\n// the file itself is used.\nfunc modifyJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) {\n\tpath, _, err := getPathToAuth(sys)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif path.legacyFormat {\n\t\treturn \"\", fmt.Errorf(\"writes to %s using legacy format are not supported\", path.path)\n\t}\n\n\tdir := filepath.Dir(path.path)\n\tif err = os.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfileContents, err := path.parse()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"reading JSON file %q: %w\", path.path, err)\n\t}\n\n\tupdated, description, err := editor(&fileContents)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"updating %q: %w\", path.path, err)\n\t}\n\tif updated {\n\t\tnewData, err := json.MarshalIndent(fileContents, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"marshaling JSON %q: %w\", path.path, err)\n\t\t}\n\n\t\tif err = ioutils.AtomicWriteFile(path.path, newData, 0600); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"writing to file %q: %w\", path.path, err)\n\t\t}\n\t}\n\n\tif description == \"\" {\n\t\tdescription = path.path\n\t}\n\treturn description, nil\n}\n\n// modifyDockerConfigJSON finds a docker config.json file, calls editor on the contents, and\n// writes it back if editor returns true.\n// Returns a human-readable description of the file, to be returned by SetCredentials.\n//\n// The editor may also return a human-readable description of the updated location; if it is \"\",\n// the file itself is used.\nfunc modifyDockerConfigJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) {\n\tif sys == nil || sys.DockerCompatAuthFilePath == \"\" {\n\t\treturn \"\", errors.New(\"internal error: modifyDockerConfigJSON called with DockerCompatAuthFilePath not set\")\n\t}\n\tpath := sys.DockerCompatAuthFilePath\n\n\tdir := filepath.Dir(path)\n\tif err := os.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Try hard not to clobber fields we don’t understand, even fields which may be added in future Docker versions.\n\tvar rawContents map[string]json.RawMessage\n\toriginalBytes, err := os.ReadFile(path)\n\tswitch {\n\tcase err == nil:\n\t\tif err := json.Unmarshal(originalBytes, &rawContents); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"unmarshaling JSON at %q: %w\", path, err)\n\t\t}\n\tcase errors.Is(err, fs.ErrNotExist):\n\t\trawContents = map[string]json.RawMessage{}\n\tdefault: // err != nil\n\t\treturn \"\", err\n\t}\n\n\tsyntheticContents := dockerConfigFile{\n\t\tAuthConfigs: map[string]dockerAuthConfig{},\n\t\tCredHelpers: map[string]string{},\n\t}\n\t// json.Unmarshal also falls back to case-insensitive field matching; this code does not do that. Presumably\n\t// config.json is mostly maintained by machines doing `docker login`, so the files should, hopefully, not contain field names with\n\t// unexpected case.\n\tif rawAuths, ok := rawContents[\"auths\"]; ok {\n\t\t// This conversion will lose fields we don’t know about; when updating an entry, we can’t tell whether an unknown field\n\t\t// should be preserved or discarded (because it is made obsolete/unwanted with the new credentials).\n\t\t// It might make sense to track which entries of \"auths\" we actually modified, and to not touch any others.\n\t\tif err := json.Unmarshal(rawAuths, &syntheticContents.AuthConfigs); err != nil {\n\t\t\treturn \"\", fmt.Errorf(`unmarshaling \"auths\" in JSON at %q: %w`, path, err)\n\t\t}\n\t}\n\tif rawCH, ok := rawContents[\"credHelpers\"]; ok {\n\t\tif err := json.Unmarshal(rawCH, &syntheticContents.CredHelpers); err != nil {\n\t\t\treturn \"\", fmt.Errorf(`unmarshaling \"credHelpers\" in JSON at %q: %w`, path, err)\n\n\t\t}\n\t}\n\n\tupdated, description, err := editor(&syntheticContents)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"updating %q: %w\", path, err)\n\t}\n\tif updated {\n\t\trawAuths, err := json.MarshalIndent(syntheticContents.AuthConfigs, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"marshaling JSON %q: %w\", path, err)\n\t\t}\n\t\trawContents[\"auths\"] = rawAuths\n\t\t// We never modify syntheticContents.CredHelpers, so we don’t need to update it.\n\t\tnewData, err := json.MarshalIndent(rawContents, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"marshaling JSON %q: %w\", path, err)\n\t\t}\n\n\t\tif err = ioutils.AtomicWriteFile(path, newData, 0600); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"writing to file %q: %w\", path, err)\n\t\t}\n\t}\n\n\tif description == \"\" {\n\t\tdescription = path\n\t}\n\treturn description, nil\n}\n\nfunc getCredsFromCredHelper(credHelper, registry string) (types.DockerAuthConfig, error) {\n\thelperName := fmt.Sprintf(\"docker-credential-%s\", credHelper)\n\tp := helperclient.NewShellProgramFunc(helperName)\n\tcreds, err := helperclient.Get(p, registry)\n\tif err != nil {\n\t\tif credentials.IsErrCredentialsNotFoundMessage(err.Error()) {\n\t\t\tlogrus.Debugf(\"Not logged in to %s with credential helper %s\", registry, credHelper)\n\t\t\terr = nil\n\t\t}\n\t\treturn types.DockerAuthConfig{}, err\n\t}\n\n\tswitch creds.Username {\n\tcase \"<token>\":\n\t\treturn types.DockerAuthConfig{\n\t\t\tIdentityToken: creds.Secret,\n\t\t}, nil\n\tdefault:\n\t\treturn types.DockerAuthConfig{\n\t\t\tUsername: creds.Username,\n\t\t\tPassword: creds.Secret,\n\t\t}, nil\n\t}\n}\n\n// setCredsInCredHelper stores (username, password) for registry in credHelper.\n// Returns a human-readable description of the destination, to be returned by SetCredentials.\nfunc setCredsInCredHelper(credHelper, registry, username, password string) (string, error) {\n\thelperName := fmt.Sprintf(\"docker-credential-%s\", credHelper)\n\tp := helperclient.NewShellProgramFunc(helperName)\n\tcreds := &credentials.Credentials{\n\t\tServerURL: registry,\n\t\tUsername:  username,\n\t\tSecret:    password,\n\t}\n\tif err := helperclient.Store(p, creds); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"credential helper: %s\", credHelper), nil\n}\n\nfunc deleteCredsFromCredHelper(credHelper, registry string) error {\n\thelperName := fmt.Sprintf(\"docker-credential-%s\", credHelper)\n\tp := helperclient.NewShellProgramFunc(helperName)\n\treturn helperclient.Erase(p, registry)\n}\n\n// findCredentialsInFile looks for credentials matching \"key\"\n// (which is \"registry\" or a namespace in \"registry\") in \"path\".\nfunc findCredentialsInFile(key, registry string, path authPath) (types.DockerAuthConfig, error) {\n\tfileContents, err := path.parse()\n\tif err != nil {\n\t\treturn types.DockerAuthConfig{}, fmt.Errorf(\"reading JSON file %q: %w\", path.path, err)\n\t}\n\n\t// First try cred helpers. They should always be normalized.\n\t// This intentionally uses \"registry\", not \"key\"; we don't support namespaced\n\t// credentials in helpers.\n\tif ch, exists := fileContents.CredHelpers[registry]; exists {\n\t\tlogrus.Debugf(\"Looking up in credential helper %s based on credHelpers entry in %s\", ch, path.path)\n\t\treturn getCredsFromCredHelper(ch, registry)\n\t}\n\n\t// Support sub-registry namespaces in auth.\n\t// (This is not a feature of ~/.docker/config.json; we support it even for\n\t// those files as an extension.)\n\tvar keys []string\n\tif !path.legacyFormat {\n\t\tkeys = authKeysForKey(key)\n\t} else {\n\t\tkeys = []string{registry}\n\t}\n\n\t// Repo or namespace keys are only supported as exact matches. For registry\n\t// keys we prefer exact matches as well.\n\tfor _, key := range keys {\n\t\tif val, exists := fileContents.AuthConfigs[key]; exists {\n\t\t\treturn decodeDockerAuth(path.path, key, val)\n\t\t}\n\t}\n\n\t// bad luck; let's normalize the entries first\n\t// This primarily happens for legacyFormat, which for a time used API URLs\n\t// (http[s:]//…/v1/) as keys.\n\t// Secondarily, (docker login) accepted URLs with no normalization for\n\t// several years, and matched registry hostnames against that, so support\n\t// those entries even in non-legacyFormat ~/.docker/config.json.\n\t// The docker.io registry still uses the /v1/ key with a special host name,\n\t// so account for that as well.\n\tregistry = normalizeRegistry(registry)\n\tfor k, v := range fileContents.AuthConfigs {\n\t\tif normalizeAuthFileKey(k, path.legacyFormat) == registry {\n\t\t\treturn decodeDockerAuth(path.path, k, v)\n\t\t}\n\t}\n\n\t// Only log this if we found nothing; getCredentialsWithHomeDir logs the\n\t// source of found data.\n\tlogrus.Debugf(\"No credentials matching %s found in %s\", key, path.path)\n\treturn types.DockerAuthConfig{}, nil\n}\n\n// authKeysForKey returns the keys matching a provided auth file key, in order\n// from the best match to worst. For example,\n// when given a repository key \"quay.io/repo/ns/image\", it returns\n// - quay.io/repo/ns/image\n// - quay.io/repo/ns\n// - quay.io/repo\n// - quay.io\nfunc authKeysForKey(key string) (res []string) {\n\tfor {\n\t\tres = append(res, key)\n\n\t\tlastSlash := strings.LastIndex(key, \"/\")\n\t\tif lastSlash == -1 {\n\t\t\tbreak\n\t\t}\n\t\tkey = key[:lastSlash]\n\t}\n\n\treturn res\n}\n\n// decodeDockerAuth decodes the username and password from conf,\n// which is entry key in path.\nfunc decodeDockerAuth(path, key string, conf dockerAuthConfig) (types.DockerAuthConfig, error) {\n\tdecoded, err := base64.StdEncoding.DecodeString(conf.Auth)\n\tif err != nil {\n\t\treturn types.DockerAuthConfig{}, err\n\t}\n\n\tuser, passwordPart, valid := strings.Cut(string(decoded), \":\")\n\tif !valid {\n\t\t// if it's invalid just skip, as docker does\n\t\tif len(decoded) > 0 { // Docker writes \"auths\": { \"$host\": {} } entries if a credential helper is used, don’t warn about those\n\t\t\tlogrus.Warnf(`Error parsing the \"auth\" field of a credential entry %q in %q, missing semicolon`, key, path) // Don’t include the text of decoded, because that might put secrets into a log.\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Found an empty credential entry %q in %q (an unhandled credential helper marker?), moving on\", key, path)\n\t\t}\n\t\treturn types.DockerAuthConfig{}, nil\n\t}\n\n\tpassword := strings.Trim(passwordPart, \"\\x00\")\n\treturn types.DockerAuthConfig{\n\t\tUsername:      user,\n\t\tPassword:      password,\n\t\tIdentityToken: conf.IdentityToken,\n\t}, nil\n}\n\n// normalizeAuthFileKey takes a key, converts it to a host name and normalizes\n// the resulting registry.\nfunc normalizeAuthFileKey(key string, legacyFormat bool) string {\n\tstripped := strings.TrimPrefix(key, \"http://\")\n\tstripped = strings.TrimPrefix(stripped, \"https://\")\n\n\tif legacyFormat || stripped != key {\n\t\tstripped, _, _ = strings.Cut(stripped, \"/\")\n\t}\n\n\treturn normalizeRegistry(stripped)\n}\n\n// normalizeRegistry converts the provided registry if a known docker.io host\n// is provided.\nfunc normalizeRegistry(registry string) string {\n\tswitch registry {\n\tcase \"registry-1.docker.io\", \"docker.io\":\n\t\treturn \"index.docker.io\"\n\t}\n\treturn registry\n}\n\n// validateKey verifies that the input key does not have a prefix that is not\n// allowed and returns an indicator if the key is namespaced.\nfunc validateKey(key string) (bool, error) {\n\tif strings.HasPrefix(key, \"http://\") || strings.HasPrefix(key, \"https://\") {\n\t\treturn false, fmt.Errorf(\"key %s contains http[s]:// prefix\", key)\n\t}\n\n\t// Ideally this should only accept explicitly valid keys, compare\n\t// validateIdentityRemappingPrefix. For now, just reject values that look\n\t// like tagged or digested values.\n\tif strings.ContainsRune(key, '@') {\n\t\treturn false, fmt.Errorf(`key %s contains a '@' character`, key)\n\t}\n\n\tfirstSlash := strings.IndexRune(key, '/')\n\tisNamespaced := firstSlash != -1\n\t// Reject host/repo:tag, but allow localhost:5000 and localhost:5000/foo.\n\tif isNamespaced && strings.ContainsRune(key[firstSlash+1:], ':') {\n\t\treturn false, fmt.Errorf(`key %s contains a ':' character after host[:port]`, key)\n\t}\n\t// check if the provided key contains one or more subpaths.\n\treturn isNamespaced, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/sysregistriesv2/paths_common.go",
    "content": "//go:build !freebsd\n// +build !freebsd\n\npackage sysregistriesv2\n\n// builtinRegistriesConfPath is the path to the registry configuration file.\n// DO NOT change this, instead see systemRegistriesConfPath above.\nconst builtinRegistriesConfPath = \"/etc/containers/registries.conf\"\n\n// builtinRegistriesConfDirPath is the path to the registry configuration directory.\n// DO NOT change this, instead see systemRegistriesConfDirectoryPath above.\nconst builtinRegistriesConfDirPath = \"/etc/containers/registries.conf.d\"\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/sysregistriesv2/paths_freebsd.go",
    "content": "//go:build freebsd\n// +build freebsd\n\npackage sysregistriesv2\n\n// builtinRegistriesConfPath is the path to the registry configuration file.\n// DO NOT change this, instead see systemRegistriesConfPath above.\nconst builtinRegistriesConfPath = \"/usr/local/etc/containers/registries.conf\"\n\n// builtinRegistriesConfDirPath is the path to the registry configuration directory.\n// DO NOT change this, instead see systemRegistriesConfDirectoryPath above.\nconst builtinRegistriesConfDirPath = \"/usr/local/etc/containers/registries.conf.d\"\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go",
    "content": "package sysregistriesv2\n\nimport (\n\t\"fmt\"\n\t\"maps\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/BurntSushi/toml\"\n\t\"github.com/containers/image/v5/docker/reference\"\n\t\"github.com/containers/image/v5/internal/multierr\"\n\t\"github.com/containers/image/v5/internal/rootless\"\n\t\"github.com/containers/image/v5/types\"\n\t\"github.com/containers/storage/pkg/homedir\"\n\t\"github.com/containers/storage/pkg/lockfile\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// defaultShortNameMode is the default mode of registries.conf files if the\n// corresponding field is left empty.\nconst defaultShortNameMode = types.ShortNameModePermissive\n\n// userShortNamesFile is the user-specific config file to store aliases.\nvar userShortNamesFile = filepath.FromSlash(\"containers/short-name-aliases.conf\")\n\n// shortNameAliasesConfPath returns the path to the machine-generated\n// short-name-aliases.conf file.\nfunc shortNameAliasesConfPath(ctx *types.SystemContext) (string, error) {\n\tif ctx != nil && len(ctx.UserShortNameAliasConfPath) > 0 {\n\t\treturn ctx.UserShortNameAliasConfPath, nil\n\t}\n\n\tif rootless.GetRootlessEUID() == 0 {\n\t\t// Root user or in a non-conforming user NS\n\t\treturn filepath.Join(\"/var/cache\", userShortNamesFile), nil\n\t}\n\n\t// Rootless user\n\tcacheRoot, err := homedir.GetCacheHome()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(cacheRoot, userShortNamesFile), nil\n}\n\n// shortNameAliasConf is a subset of the `V2RegistriesConf` format.  It's used in the\n// software-maintained `userShortNamesFile`.\ntype shortNameAliasConf struct {\n\t// A map for aliasing short names to their fully-qualified image\n\t// reference counter parts.\n\t// Note that Aliases is niled after being loaded from a file.\n\tAliases map[string]string `toml:\"aliases\"`\n\n\t// If you add any field, make sure to update nonempty() below.\n}\n\n// nonempty returns true if config contains at least one configuration entry.\nfunc (c *shortNameAliasConf) nonempty() bool {\n\tcopy := *c // A shallow copy\n\tif copy.Aliases != nil && len(copy.Aliases) == 0 {\n\t\tcopy.Aliases = nil\n\t}\n\treturn !reflect.DeepEqual(copy, shortNameAliasConf{})\n}\n\n// alias combines the parsed value of an alias with the config file it has been\n// specified in.  The config file is crucial for an improved user experience\n// such that users are able to resolve potential pull errors.\ntype alias struct {\n\t// The parsed value of an alias.  May be nil if set to \"\" in a config.\n\tvalue reference.Named\n\t// The config file the alias originates from.\n\tconfigOrigin string\n}\n\n// shortNameAliasCache is the result of parsing shortNameAliasConf,\n// pre-processed for faster usage.\ntype shortNameAliasCache struct {\n\t// Note that an alias value may be nil iff it's set as an empty string\n\t// in the config.\n\tnamedAliases map[string]alias\n}\n\n// ResolveShortNameAlias performs an alias resolution of the specified name.\n// The user-specific short-name-aliases.conf has precedence over aliases in the\n// assembled registries.conf.  It returns the possibly resolved alias or nil, a\n// human-readable description of the config where the alias is specified, and\n// an error. The origin of the config file is crucial for an improved user\n// experience such that users are able to resolve potential pull errors.\n// Almost all callers should use pkg/shortnames instead.\n//\n// Note that it’s the caller’s responsibility to pass only a repository\n// (reference.IsNameOnly) as the short name.\nfunc ResolveShortNameAlias(ctx *types.SystemContext, name string) (reference.Named, string, error) {\n\tif err := validateShortName(name); err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tconfPath, lock, err := shortNameAliasesConfPathAndLock(ctx)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\t// Acquire the lock as a reader to allow for multiple routines in the\n\t// same process space to read simultaneously.\n\tlock.RLock()\n\tdefer lock.Unlock()\n\n\t_, aliasCache, err := loadShortNameAliasConf(confPath)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\t// First look up the short-name-aliases.conf.  Note that a value may be\n\t// nil iff it's set as an empty string in the config.\n\talias, resolved := aliasCache.namedAliases[name]\n\tif resolved {\n\t\treturn alias.value, alias.configOrigin, nil\n\t}\n\n\tconfig, err := getConfig(ctx)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\talias, resolved = config.aliasCache.namedAliases[name]\n\tif resolved {\n\t\treturn alias.value, alias.configOrigin, nil\n\t}\n\treturn nil, \"\", nil\n}\n\n// editShortNameAlias loads the aliases.conf file and changes it. If value is\n// set, it adds the name-value pair as a new alias. Otherwise, it will remove\n// name from the config.\nfunc editShortNameAlias(ctx *types.SystemContext, name string, value *string) error {\n\tif err := validateShortName(name); err != nil {\n\t\treturn err\n\t}\n\tif value != nil {\n\t\tif _, err := parseShortNameValue(*value); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tconfPath, lock, err := shortNameAliasesConfPathAndLock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Acquire the lock as a writer to prevent data corruption.\n\tlock.Lock()\n\tdefer lock.Unlock()\n\n\t// Load the short-name-alias.conf, add the specified name-value pair,\n\t// and write it back to the file.\n\tconf, _, err := loadShortNameAliasConf(confPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif conf.Aliases == nil { // Ensure we have a map to update.\n\t\tconf.Aliases = make(map[string]string)\n\t}\n\tif value != nil {\n\t\tconf.Aliases[name] = *value\n\t} else {\n\t\t// If the name does not exist, throw an error.\n\t\tif _, exists := conf.Aliases[name]; !exists {\n\t\t\treturn fmt.Errorf(\"short-name alias %q not found in %q: please check registries.conf files\", name, confPath)\n\t\t}\n\n\t\tdelete(conf.Aliases, name)\n\t}\n\n\tf, err := os.OpenFile(confPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tencoder := toml.NewEncoder(f)\n\treturn encoder.Encode(conf)\n}\n\n// AddShortNameAlias adds the specified name-value pair as a new alias to the\n// user-specific aliases.conf.  It may override an existing alias for `name`.\n//\n// Note that it’s the caller’s responsibility to pass only a repository\n// (reference.IsNameOnly) as the short name.\nfunc AddShortNameAlias(ctx *types.SystemContext, name string, value string) error {\n\treturn editShortNameAlias(ctx, name, &value)\n}\n\n// RemoveShortNameAlias clears the alias for the specified name.  It throws an\n// error in case name does not exist in the machine-generated\n// short-name-alias.conf.  In such case, the alias must be specified in one of\n// the registries.conf files, which is the users' responsibility.\n//\n// Note that it’s the caller’s responsibility to pass only a repository\n// (reference.IsNameOnly) as the short name.\nfunc RemoveShortNameAlias(ctx *types.SystemContext, name string) error {\n\treturn editShortNameAlias(ctx, name, nil)\n}\n\n// parseShortNameValue parses the specified alias into a reference.Named.  The alias is\n// expected to not be tagged or carry a digest and *must* include a\n// domain/registry.\n//\n// Note that the returned reference is always normalized.\nfunc parseShortNameValue(alias string) (reference.Named, error) {\n\tref, err := reference.Parse(alias)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing alias %q: %w\", alias, err)\n\t}\n\n\tif _, ok := ref.(reference.Digested); ok {\n\t\treturn nil, fmt.Errorf(\"invalid alias %q: must not contain digest\", alias)\n\t}\n\n\tif _, ok := ref.(reference.Tagged); ok {\n\t\treturn nil, fmt.Errorf(\"invalid alias %q: must not contain tag\", alias)\n\t}\n\n\tnamed, ok := ref.(reference.Named)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid alias %q: must contain registry and repository\", alias)\n\t}\n\n\tregistry := reference.Domain(named)\n\tif !(strings.ContainsAny(registry, \".:\") || registry == \"localhost\") {\n\t\treturn nil, fmt.Errorf(\"invalid alias %q: must contain registry and repository\", alias)\n\t}\n\n\t// A final parse to make sure that docker.io references are correctly\n\t// normalized (e.g., docker.io/alpine to docker.io/library/alpine.\n\tnamed, err = reference.ParseNormalizedNamed(alias)\n\treturn named, err\n}\n\n// validateShortName parses the specified `name` of an alias (i.e., the left-hand\n// side) and checks if it's a short name and does not include a tag or digest.\nfunc validateShortName(name string) error {\n\trepo, err := reference.Parse(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot parse short name: %q: %w\", name, err)\n\t}\n\n\tif _, ok := repo.(reference.Digested); ok {\n\t\treturn fmt.Errorf(\"invalid short name %q: must not contain digest\", name)\n\t}\n\n\tif _, ok := repo.(reference.Tagged); ok {\n\t\treturn fmt.Errorf(\"invalid short name %q: must not contain tag\", name)\n\t}\n\n\tnamed, ok := repo.(reference.Named)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid short name %q: no name\", name)\n\t}\n\n\tregistry := reference.Domain(named)\n\tif strings.ContainsAny(registry, \".:\") || registry == \"localhost\" {\n\t\treturn fmt.Errorf(\"invalid short name %q: must not contain registry\", name)\n\t}\n\treturn nil\n}\n\n// newShortNameAliasCache parses shortNameAliasConf and returns the corresponding internal\n// representation.\nfunc newShortNameAliasCache(path string, conf *shortNameAliasConf) (*shortNameAliasCache, error) {\n\tres := shortNameAliasCache{\n\t\tnamedAliases: make(map[string]alias),\n\t}\n\terrs := []error{}\n\tfor name, value := range conf.Aliases {\n\t\tif err := validateShortName(name); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\n\t\t// Empty right-hand side values in config files allow to reset\n\t\t// an alias in a previously loaded config. This way, drop-in\n\t\t// config files from registries.conf.d can reset potentially\n\t\t// malconfigured aliases.\n\t\tif value == \"\" {\n\t\t\tres.namedAliases[name] = alias{nil, path}\n\t\t\tcontinue\n\t\t}\n\n\t\tnamed, err := parseShortNameValue(value)\n\t\tif err != nil {\n\t\t\t// We want to report *all* malformed entries to avoid a\n\t\t\t// whack-a-mole for the user.\n\t\t\terrs = append(errs, err)\n\t\t} else {\n\t\t\tres.namedAliases[name] = alias{named, path}\n\t\t}\n\t}\n\tif len(errs) > 0 {\n\t\treturn nil, multierr.Format(\"\", \"\\n\", \"\", errs)\n\t}\n\treturn &res, nil\n}\n\n// updateWithConfigurationFrom updates c with configuration from updates.\n// In case of conflict, updates is preferred.\nfunc (c *shortNameAliasCache) updateWithConfigurationFrom(updates *shortNameAliasCache) {\n\tmaps.Copy(c.namedAliases, updates.namedAliases)\n}\n\nfunc loadShortNameAliasConf(confPath string) (*shortNameAliasConf, *shortNameAliasCache, error) {\n\tconf := shortNameAliasConf{}\n\n\tmeta, err := toml.DecodeFile(confPath, &conf)\n\tif err != nil && !os.IsNotExist(err) {\n\t\t// It's okay if the config doesn't exist.  Other errors are not.\n\t\treturn nil, nil, fmt.Errorf(\"loading short-name aliases config file %q: %w\", confPath, err)\n\t}\n\tif keys := meta.Undecoded(); len(keys) > 0 {\n\t\tlogrus.Debugf(\"Failed to decode keys %q from %q\", keys, confPath)\n\t}\n\n\t// Even if we don’t always need the cache, doing so validates the machine-generated config.  The\n\t// file could still be corrupted by another process or user.\n\tcache, err := newShortNameAliasCache(confPath, &conf)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"loading short-name aliases config file %q: %w\", confPath, err)\n\t}\n\n\treturn &conf, cache, nil\n}\n\nfunc shortNameAliasesConfPathAndLock(ctx *types.SystemContext) (string, *lockfile.LockFile, error) {\n\tshortNameAliasesConfPath, err := shortNameAliasesConfPath(ctx)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\t// Make sure the path to file exists.\n\tif err := os.MkdirAll(filepath.Dir(shortNameAliasesConfPath), 0700); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tlockPath := shortNameAliasesConfPath + \".lock\"\n\tlocker, err := lockfile.GetLockFile(lockPath)\n\treturn shortNameAliasesConfPath, locker, err\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/pkg/sysregistriesv2/system_registries_v2.go",
    "content": "package sysregistriesv2\n\nimport (\n\t\"fmt\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/BurntSushi/toml\"\n\t\"github.com/containers/image/v5/docker/reference\"\n\t\"github.com/containers/image/v5/types\"\n\t\"github.com/containers/storage/pkg/fileutils\"\n\t\"github.com/containers/storage/pkg/homedir\"\n\t\"github.com/containers/storage/pkg/regexp\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/exp/maps\"\n)\n\n// systemRegistriesConfPath is the path to the system-wide registry\n// configuration file and is used to add/subtract potential registries for\n// obtaining images.  You can override this at build time with\n// -ldflags '-X github.com/containers/image/v5/sysregistries.systemRegistriesConfPath=$your_path'\nvar systemRegistriesConfPath = builtinRegistriesConfPath\n\n// systemRegistriesConfDirPath is the path to the system-wide registry\n// configuration directory and is used to add/subtract potential registries for\n// obtaining images.  You can override this at build time with\n// -ldflags '-X github.com/containers/image/v5/sysregistries.systemRegistriesConfDirectoryPath=$your_path'\nvar systemRegistriesConfDirPath = builtinRegistriesConfDirPath\n\n// AuthenticationFileHelper is a special key for credential helpers indicating\n// the usage of consulting containers-auth.json files instead of a credential\n// helper.\nconst AuthenticationFileHelper = \"containers-auth.json\"\n\nconst (\n\t// configuration values for \"pull-from-mirror\"\n\t// mirrors will be used for both digest pulls and tag pulls\n\tMirrorAll = \"all\"\n\t// mirrors will only be used for digest pulls\n\tMirrorByDigestOnly = \"digest-only\"\n\t// mirrors will only be used for tag pulls\n\tMirrorByTagOnly = \"tag-only\"\n)\n\n// Endpoint describes a remote location of a registry.\ntype Endpoint struct {\n\t// The endpoint's remote location. Can be empty iff Prefix contains\n\t// wildcard in the format: \"*.example.com\" for subdomain matching.\n\t// Please refer to FindRegistry / PullSourcesFromReference instead\n\t// of accessing/interpreting `Location` directly.\n\tLocation string `toml:\"location,omitempty\"`\n\t// If true, certs verification will be skipped and HTTP (non-TLS)\n\t// connections will be allowed.\n\tInsecure bool `toml:\"insecure,omitempty\"`\n\t// PullFromMirror is used for adding restrictions to image pull through the mirror.\n\t// Set to \"all\", \"digest-only\", or \"tag-only\".\n\t// If \"digest-only\"， mirrors will only be used for digest pulls. Pulling images by\n\t// tag can potentially yield different images, depending on which endpoint\n\t// we pull from.  Restricting mirrors to pulls by digest avoids that issue.\n\t// If \"tag-only\", mirrors will only be used for tag pulls.  For a more up-to-date and expensive mirror\n\t// that it is less likely to be out of sync if tags move, it should not be unnecessarily\n\t// used for digest references.\n\t// Default is \"all\" (or left empty), mirrors will be used for both digest pulls and tag pulls unless the mirror-by-digest-only is set for the primary registry.\n\t// This can only be set in a registry's Mirror field, not in the registry's primary Endpoint.\n\t// This per-mirror setting is allowed only when mirror-by-digest-only is not configured for the primary registry.\n\tPullFromMirror string `toml:\"pull-from-mirror,omitempty\"`\n}\n\n// userRegistriesFile is the path to the per user registry configuration file.\nvar userRegistriesFile = filepath.FromSlash(\".config/containers/registries.conf\")\n\n// userRegistriesDir is the path to the per user registry configuration file.\nvar userRegistriesDir = filepath.FromSlash(\".config/containers/registries.conf.d\")\n\n// rewriteReference will substitute the provided reference `prefix` to the\n// endpoints `location` from the `ref` and creates a new named reference from it.\n// The function errors if the newly created reference is not parsable.\nfunc (e *Endpoint) rewriteReference(ref reference.Named, prefix string) (reference.Named, error) {\n\trefString := ref.String()\n\tvar newNamedRef string\n\t// refMatchingPrefix returns the length of the match. Everything that\n\t// follows the match gets appended to registries location.\n\tprefixLen := refMatchingPrefix(refString, prefix)\n\tif prefixLen == -1 {\n\t\treturn nil, fmt.Errorf(\"invalid prefix '%v' for reference '%v'\", prefix, refString)\n\t}\n\t// In the case of an empty `location` field, simply return the original\n\t// input ref as-is.\n\t//\n\t// FIXME: already validated in postProcessRegistries, so check can probably\n\t// be dropped.\n\t// https://github.com/containers/image/pull/1191#discussion_r610621608\n\tif e.Location == \"\" {\n\t\tif !strings.HasPrefix(prefix, \"*.\") {\n\t\t\treturn nil, fmt.Errorf(\"invalid prefix '%v' for empty location, should be in the format: *.example.com\", prefix)\n\t\t}\n\t\treturn ref, nil\n\t}\n\tnewNamedRef = e.Location + refString[prefixLen:]\n\tnewParsedRef, err := reference.ParseNamed(newNamedRef)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"rewriting reference: %w\", err)\n\t}\n\n\treturn newParsedRef, nil\n}\n\n// Registry represents a registry.\ntype Registry struct {\n\t// Prefix is used for matching images, and to translate one namespace to\n\t// another.  If `Prefix=\"example.com/bar\"`, `location=\"example.com/foo/bar\"`\n\t// and we pull from \"example.com/bar/myimage:latest\", the image will\n\t// effectively be pulled from \"example.com/foo/bar/myimage:latest\".\n\t// If no Prefix is specified, it defaults to the specified location.\n\t// Prefix can also be in the format: \"*.example.com\" for matching\n\t// subdomains. The wildcard should only be in the beginning and should also\n\t// not contain any namespaces or special characters: \"/\", \"@\" or \":\".\n\t// Please refer to FindRegistry / PullSourcesFromReference instead\n\t// of accessing/interpreting `Prefix` directly.\n\tPrefix string `toml:\"prefix\"`\n\t// A registry is an Endpoint too\n\tEndpoint\n\t// The registry's mirrors.\n\tMirrors []Endpoint `toml:\"mirror,omitempty\"`\n\t// If true, pulling from the registry will be blocked.\n\tBlocked bool `toml:\"blocked,omitempty\"`\n\t// If true, mirrors will only be used for digest pulls. Pulling images by\n\t// tag can potentially yield different images, depending on which endpoint\n\t// we pull from.  Restricting mirrors to pulls by digest avoids that issue.\n\tMirrorByDigestOnly bool `toml:\"mirror-by-digest-only,omitempty\"`\n}\n\n// PullSource consists of an Endpoint and a Reference. Note that the reference is\n// rewritten according to the registries prefix and the Endpoint's location.\ntype PullSource struct {\n\tEndpoint  Endpoint\n\tReference reference.Named\n}\n\n// PullSourcesFromReference returns a slice of PullSource's based on the passed\n// reference.\nfunc (r *Registry) PullSourcesFromReference(ref reference.Named) ([]PullSource, error) {\n\tvar endpoints []Endpoint\n\t_, isDigested := ref.(reference.Canonical)\n\tif r.MirrorByDigestOnly {\n\t\t// Only use mirrors when the reference is a digested one.\n\t\tif isDigested {\n\t\t\tendpoints = append(endpoints, r.Mirrors...)\n\t\t}\n\t} else {\n\t\tfor _, mirror := range r.Mirrors {\n\t\t\t// skip the mirror if per mirror setting exists but reference does not match the restriction\n\t\t\tswitch mirror.PullFromMirror {\n\t\t\tcase MirrorByDigestOnly:\n\t\t\t\tif !isDigested {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase MirrorByTagOnly:\n\t\t\t\tif isDigested {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tendpoints = append(endpoints, mirror)\n\t\t}\n\t}\n\tendpoints = append(endpoints, r.Endpoint)\n\n\tsources := []PullSource{}\n\tfor _, ep := range endpoints {\n\t\trewritten, err := ep.rewriteReference(ref, r.Prefix)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsources = append(sources, PullSource{Endpoint: ep, Reference: rewritten})\n\t}\n\n\treturn sources, nil\n}\n\n// V1TOMLregistries is for backwards compatibility to sysregistries v1\ntype V1TOMLregistries struct {\n\tRegistries []string `toml:\"registries\"`\n}\n\n// V1TOMLConfig is for backwards compatibility to sysregistries v1\ntype V1TOMLConfig struct {\n\tSearch   V1TOMLregistries `toml:\"search\"`\n\tInsecure V1TOMLregistries `toml:\"insecure\"`\n\tBlock    V1TOMLregistries `toml:\"block\"`\n}\n\n// V1RegistriesConf is the sysregistries v1 configuration format.\ntype V1RegistriesConf struct {\n\tV1TOMLConfig `toml:\"registries\"`\n}\n\n// Nonempty returns true if config contains at least one configuration entry.\n// Empty arrays are treated as missing entries.\nfunc (config *V1RegistriesConf) Nonempty() bool {\n\tcopy := *config // A shallow copy\n\tif copy.V1TOMLConfig.Search.Registries != nil && len(copy.V1TOMLConfig.Search.Registries) == 0 {\n\t\tcopy.V1TOMLConfig.Search.Registries = nil\n\t}\n\tif copy.V1TOMLConfig.Insecure.Registries != nil && len(copy.V1TOMLConfig.Insecure.Registries) == 0 {\n\t\tcopy.V1TOMLConfig.Insecure.Registries = nil\n\t}\n\tif copy.V1TOMLConfig.Block.Registries != nil && len(copy.V1TOMLConfig.Block.Registries) == 0 {\n\t\tcopy.V1TOMLConfig.Block.Registries = nil\n\t}\n\treturn copy.hasSetField()\n}\n\n// hasSetField returns true if config contains at least one configuration entry.\n// This is useful because of a subtlety of the behavior of the TOML decoder, where a missing array field\n// is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled\n// as a non-nil []string{}.\nfunc (config *V1RegistriesConf) hasSetField() bool {\n\treturn !reflect.DeepEqual(*config, V1RegistriesConf{})\n}\n\n// V2RegistriesConf is the sysregistries v2 configuration format.\ntype V2RegistriesConf struct {\n\tRegistries []Registry `toml:\"registry\"`\n\t// An array of host[:port] (not prefix!) entries to use for resolving unqualified image references\n\tUnqualifiedSearchRegistries []string `toml:\"unqualified-search-registries\"`\n\t// An array of global credential helpers to use for authentication\n\t// (e.g., [\"pass\", \"secretservice\"]).  The helpers are consulted in the\n\t// specified order.  Note that \"containers-auth.json\" is a reserved\n\t// value for consulting auth files as specified in\n\t// containers-auth.json(5).\n\t//\n\t// If empty, CredentialHelpers defaults to  [\"containers-auth.json\"].\n\tCredentialHelpers []string `toml:\"credential-helpers\"`\n\n\t// ShortNameMode defines how short-name resolution should be handled by\n\t// _consumers_ of this package.  Depending on the mode, the user should\n\t// be prompted with a choice of using one of the unqualified-search\n\t// registries when referring to a short name.\n\t//\n\t// Valid modes are: * \"prompt\": prompt if stdout is a TTY, otherwise\n\t// use all unqualified-search registries * \"enforcing\": always prompt\n\t// and error if stdout is not a TTY * \"disabled\": do not prompt and\n\t// potentially use all unqualified-search registries\n\tShortNameMode string `toml:\"short-name-mode\"`\n\n\t// AdditionalLayerStoreAuthHelper is a helper binary that receives\n\t// registry credentials pass them to Additional Layer Store for\n\t// registry authentication. These credentials are only collected when pulling (not pushing).\n\tAdditionalLayerStoreAuthHelper string `toml:\"additional-layer-store-auth-helper\"`\n\n\tshortNameAliasConf\n\n\t// If you add any field, make sure to update Nonempty() below.\n}\n\n// Nonempty returns true if config contains at least one configuration entry.\nfunc (config *V2RegistriesConf) Nonempty() bool {\n\tcopy := *config // A shallow copy\n\tif copy.Registries != nil && len(copy.Registries) == 0 {\n\t\tcopy.Registries = nil\n\t}\n\tif copy.UnqualifiedSearchRegistries != nil && len(copy.UnqualifiedSearchRegistries) == 0 {\n\t\tcopy.UnqualifiedSearchRegistries = nil\n\t}\n\tif copy.CredentialHelpers != nil && len(copy.CredentialHelpers) == 0 {\n\t\tcopy.CredentialHelpers = nil\n\t}\n\tif !copy.shortNameAliasConf.nonempty() {\n\t\tcopy.shortNameAliasConf = shortNameAliasConf{}\n\t}\n\treturn copy.hasSetField()\n}\n\n// hasSetField returns true if config contains at least one configuration entry.\n// This is useful because of a subtlety of the behavior of the TOML decoder, where a missing array field\n// is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled\n// as a non-nil []string{}.\nfunc (config *V2RegistriesConf) hasSetField() bool {\n\treturn !reflect.DeepEqual(*config, V2RegistriesConf{})\n}\n\n// parsedConfig is the result of parsing, and possibly merging, configuration files;\n// it is the boundary between the process of reading+ingesting the files, and\n// later interpreting the configuration based on caller’s requests.\ntype parsedConfig struct {\n\t// NOTE: Update also parsedConfig.updateWithConfigurationFrom!\n\n\t// partialV2 must continue to exist to maintain the return value of TryUpdatingCache\n\t// for compatibility with existing callers.\n\t// We store the authoritative Registries and UnqualifiedSearchRegistries values there as well.\n\tpartialV2 V2RegistriesConf\n\t// Absolute path to the configuration file that set the UnqualifiedSearchRegistries.\n\tunqualifiedSearchRegistriesOrigin string\n\t// Result of parsing of partialV2.ShortNameMode.\n\t// NOTE: May be ShortNameModeInvalid to represent ShortNameMode == \"\" in intermediate values;\n\t// the full configuration in configCache / getConfig() always contains a valid value.\n\tshortNameMode types.ShortNameMode\n\taliasCache    *shortNameAliasCache\n}\n\n// InvalidRegistries represents an invalid registry configurations.  An example\n// is when \"registry.com\" is defined multiple times in the configuration but\n// with conflicting security settings.\ntype InvalidRegistries struct {\n\ts string\n}\n\n// Error returns the error string.\nfunc (e *InvalidRegistries) Error() string {\n\treturn e.s\n}\n\n// parseLocation parses the input string, performs some sanity checks and returns\n// the sanitized input string.  An error is returned if the input string is\n// empty or if contains an \"http{s,}://\" prefix.\nfunc parseLocation(input string) (string, error) {\n\ttrimmed := strings.TrimRight(input, \"/\")\n\n\t// FIXME: This check needs to exist but fails for empty Location field with\n\t// wildcarded prefix. Removal of this check \"only\" allows invalid input in,\n\t// and does not prevent correct operation.\n\t// https://github.com/containers/image/pull/1191#discussion_r610122617\n\t//\n\t//\tif trimmed == \"\" {\n\t//\t\treturn \"\", &InvalidRegistries{s: \"invalid location: cannot be empty\"}\n\t//\t}\n\t//\n\n\tif strings.HasPrefix(trimmed, \"http://\") || strings.HasPrefix(trimmed, \"https://\") {\n\t\tmsg := fmt.Sprintf(\"invalid location '%s': URI schemes are not supported\", input)\n\t\treturn \"\", &InvalidRegistries{s: msg}\n\t}\n\n\treturn trimmed, nil\n}\n\n// ConvertToV2 returns a v2 config corresponding to a v1 one.\nfunc (config *V1RegistriesConf) ConvertToV2() (*V2RegistriesConf, error) {\n\tregMap := make(map[string]*Registry)\n\t// The order of the registries is not really important, but make it deterministic (the same for the same config file)\n\t// to minimize behavior inconsistency and not contribute to difficult-to-reproduce situations.\n\tregistryOrder := []string{}\n\n\tgetRegistry := func(location string) (*Registry, error) { // Note: _pointer_ to a long-lived object\n\t\tvar err error\n\t\tlocation, err = parseLocation(location)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treg, exists := regMap[location]\n\t\tif !exists {\n\t\t\treg = &Registry{\n\t\t\t\tEndpoint: Endpoint{Location: location},\n\t\t\t\tMirrors:  []Endpoint{},\n\t\t\t\tPrefix:   location,\n\t\t\t}\n\t\t\tregMap[location] = reg\n\t\t\tregistryOrder = append(registryOrder, location)\n\t\t}\n\t\treturn reg, nil\n\t}\n\n\tfor _, blocked := range config.V1TOMLConfig.Block.Registries {\n\t\treg, err := getRegistry(blocked)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treg.Blocked = true\n\t}\n\tfor _, insecure := range config.V1TOMLConfig.Insecure.Registries {\n\t\treg, err := getRegistry(insecure)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treg.Insecure = true\n\t}\n\n\tres := &V2RegistriesConf{\n\t\tUnqualifiedSearchRegistries: config.V1TOMLConfig.Search.Registries,\n\t}\n\tfor _, location := range registryOrder {\n\t\treg := regMap[location]\n\t\tres.Registries = append(res.Registries, *reg)\n\t}\n\treturn res, nil\n}\n\n// anchoredDomainRegexp is an internal implementation detail of postProcess, defining the valid values of elements of UnqualifiedSearchRegistries.\nvar anchoredDomainRegexp = regexp.Delayed(\"^\" + reference.DomainRegexp.String() + \"$\")\n\n// postProcess checks the consistency of all the configuration, looks for conflicts,\n// and normalizes the configuration (e.g., sets the Prefix to Location if not set).\nfunc (config *V2RegistriesConf) postProcessRegistries() error {\n\tregMap := make(map[string][]*Registry)\n\n\tfor i := range config.Registries {\n\t\treg := &config.Registries[i]\n\t\t// make sure Location and Prefix are valid\n\t\tvar err error\n\t\treg.Location, err = parseLocation(reg.Location)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif reg.Prefix == \"\" {\n\t\t\tif reg.Location == \"\" {\n\t\t\t\treturn &InvalidRegistries{s: \"invalid condition: both location and prefix are unset\"}\n\t\t\t}\n\t\t\treg.Prefix = reg.Location\n\t\t} else {\n\t\t\treg.Prefix, err = parseLocation(reg.Prefix)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// FIXME: allow config authors to always use Prefix.\n\t\t\t// https://github.com/containers/image/pull/1191#discussion_r610622495\n\t\t\tif !strings.HasPrefix(reg.Prefix, \"*.\") && reg.Location == \"\" {\n\t\t\t\treturn &InvalidRegistries{s: \"invalid condition: location is unset and prefix is not in the format: *.example.com\"}\n\t\t\t}\n\t\t}\n\n\t\t// validate the mirror usage settings does not apply to primary registry\n\t\tif reg.PullFromMirror != \"\" {\n\t\t\treturn fmt.Errorf(\"pull-from-mirror must not be set for a non-mirror registry %q\", reg.Prefix)\n\t\t}\n\t\t// make sure mirrors are valid\n\t\tfor _, mir := range reg.Mirrors {\n\t\t\tmir.Location, err = parseLocation(mir.Location)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t//FIXME: unqualifiedSearchRegistries now also accepts empty values\n\t\t\t//and shouldn't\n\t\t\t// https://github.com/containers/image/pull/1191#discussion_r610623216\n\t\t\tif mir.Location == \"\" {\n\t\t\t\treturn &InvalidRegistries{s: \"invalid condition: mirror location is unset\"}\n\t\t\t}\n\n\t\t\tif reg.MirrorByDigestOnly && mir.PullFromMirror != \"\" {\n\t\t\t\treturn &InvalidRegistries{s: fmt.Sprintf(\"cannot set mirror usage mirror-by-digest-only for the registry (%q) and pull-from-mirror for per-mirror (%q) at the same time\", reg.Prefix, mir.Location)}\n\t\t\t}\n\t\t\tif mir.PullFromMirror != \"\" && mir.PullFromMirror != MirrorAll &&\n\t\t\t\tmir.PullFromMirror != MirrorByDigestOnly && mir.PullFromMirror != MirrorByTagOnly {\n\t\t\t\treturn &InvalidRegistries{s: fmt.Sprintf(\"unsupported pull-from-mirror value %q for mirror %q\", mir.PullFromMirror, mir.Location)}\n\t\t\t}\n\t\t}\n\t\tif reg.Location == \"\" {\n\t\t\tregMap[reg.Prefix] = append(regMap[reg.Prefix], reg)\n\t\t} else {\n\t\t\tregMap[reg.Location] = append(regMap[reg.Location], reg)\n\t\t}\n\t}\n\n\t// Given a registry can be mentioned multiple times (e.g., to have\n\t// multiple prefixes backed by different mirrors), we need to make sure\n\t// there are no conflicts among them.\n\t//\n\t// Note: we need to iterate over the registries array to ensure a\n\t// deterministic behavior which is not guaranteed by maps.\n\tfor _, reg := range config.Registries {\n\t\tvar others []*Registry\n\t\tvar ok bool\n\t\tif reg.Location == \"\" {\n\t\t\tothers, ok = regMap[reg.Prefix]\n\t\t} else {\n\t\t\tothers, ok = regMap[reg.Location]\n\t\t}\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Internal error in V2RegistriesConf.PostProcess: entry in regMap is missing\")\n\t\t}\n\t\tfor _, other := range others {\n\t\t\tif reg.Insecure != other.Insecure {\n\t\t\t\tmsg := fmt.Sprintf(\"registry '%s' is defined multiple times with conflicting 'insecure' setting\", reg.Location)\n\t\t\t\treturn &InvalidRegistries{s: msg}\n\t\t\t}\n\n\t\t\tif reg.Blocked != other.Blocked {\n\t\t\t\tmsg := fmt.Sprintf(\"registry '%s' is defined multiple times with conflicting 'blocked' setting\", reg.Location)\n\t\t\t\treturn &InvalidRegistries{s: msg}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range config.UnqualifiedSearchRegistries {\n\t\tregistry, err := parseLocation(config.UnqualifiedSearchRegistries[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !anchoredDomainRegexp.MatchString(registry) {\n\t\t\treturn &InvalidRegistries{fmt.Sprintf(\"Invalid unqualified-search-registries entry %#v\", registry)}\n\t\t}\n\t\tconfig.UnqualifiedSearchRegistries[i] = registry\n\t}\n\n\t// Registries are ordered and the first longest prefix always wins,\n\t// rendering later items with the same prefix non-existent. We cannot error\n\t// out anymore as this might break existing users, so let's just ignore them\n\t// to guarantee that the same prefix exists only once.\n\t//\n\t// As a side effect of parsedConfig.updateWithConfigurationFrom, the Registries slice\n\t// is always sorted. To be consistent in situations where it is not called (no drop-ins),\n\t// sort it here as well.\n\tprefixes := []string{}\n\tuniqueRegistries := make(map[string]Registry)\n\tfor i := range config.Registries {\n\t\t// TODO: should we warn if we see the same prefix being used multiple times?\n\t\tprefix := config.Registries[i].Prefix\n\t\tif _, exists := uniqueRegistries[prefix]; !exists {\n\t\t\tuniqueRegistries[prefix] = config.Registries[i]\n\t\t\tprefixes = append(prefixes, prefix)\n\t\t}\n\t}\n\tsort.Strings(prefixes)\n\tconfig.Registries = []Registry{}\n\tfor _, prefix := range prefixes {\n\t\tconfig.Registries = append(config.Registries, uniqueRegistries[prefix])\n\t}\n\n\treturn nil\n}\n\n// ConfigPath returns the path to the system-wide registry configuration file.\n// Deprecated: This API implies configuration is read from files, and that there is only one.\n// Please use ConfigurationSourceDescription to obtain a string usable for error messages.\nfunc ConfigPath(ctx *types.SystemContext) string {\n\treturn newConfigWrapper(ctx).configPath\n}\n\n// ConfigDirPath returns the path to the directory for drop-in\n// registry configuration files.\n// Deprecated: This API implies configuration is read from directories, and that there is only one.\n// Please use ConfigurationSourceDescription to obtain a string usable for error messages.\nfunc ConfigDirPath(ctx *types.SystemContext) string {\n\tconfigWrapper := newConfigWrapper(ctx)\n\tif configWrapper.userConfigDirPath != \"\" {\n\t\treturn configWrapper.userConfigDirPath\n\t}\n\treturn configWrapper.configDirPath\n}\n\n// configWrapper is used to store the paths from ConfigPath and ConfigDirPath\n// and acts as a key to the internal cache.\ntype configWrapper struct {\n\t// path to the registries.conf file\n\tconfigPath string\n\t// path to system-wide registries.conf.d directory, or \"\" if not used\n\tconfigDirPath string\n\t// path to user specified registries.conf.d directory, or \"\" if not used\n\tuserConfigDirPath string\n}\n\n// newConfigWrapper returns a configWrapper for the specified SystemContext.\nfunc newConfigWrapper(ctx *types.SystemContext) configWrapper {\n\treturn newConfigWrapperWithHomeDir(ctx, homedir.Get())\n}\n\n// newConfigWrapperWithHomeDir is an internal implementation detail of newConfigWrapper,\n// it exists only to allow testing it with an artificial home directory.\nfunc newConfigWrapperWithHomeDir(ctx *types.SystemContext, homeDir string) configWrapper {\n\tvar wrapper configWrapper\n\tuserRegistriesFilePath := filepath.Join(homeDir, userRegistriesFile)\n\tuserRegistriesDirPath := filepath.Join(homeDir, userRegistriesDir)\n\n\t// decide configPath using per-user path or system file\n\tif ctx != nil && ctx.SystemRegistriesConfPath != \"\" {\n\t\twrapper.configPath = ctx.SystemRegistriesConfPath\n\t} else if err := fileutils.Exists(userRegistriesFilePath); err == nil {\n\t\t// per-user registries.conf exists, not reading system dir\n\t\t// return config dirs from ctx or per-user one\n\t\twrapper.configPath = userRegistriesFilePath\n\t\tif ctx != nil && ctx.SystemRegistriesConfDirPath != \"\" {\n\t\t\twrapper.configDirPath = ctx.SystemRegistriesConfDirPath\n\t\t} else {\n\t\t\twrapper.userConfigDirPath = userRegistriesDirPath\n\t\t}\n\n\t\treturn wrapper\n\t} else if ctx != nil && ctx.RootForImplicitAbsolutePaths != \"\" {\n\t\twrapper.configPath = filepath.Join(ctx.RootForImplicitAbsolutePaths, systemRegistriesConfPath)\n\t} else {\n\t\twrapper.configPath = systemRegistriesConfPath\n\t}\n\n\t// potentially use both system and per-user dirs if not using per-user config file\n\tif ctx != nil && ctx.SystemRegistriesConfDirPath != \"\" {\n\t\t// dir explicitly chosen: use only that one\n\t\twrapper.configDirPath = ctx.SystemRegistriesConfDirPath\n\t} else if ctx != nil && ctx.RootForImplicitAbsolutePaths != \"\" {\n\t\twrapper.configDirPath = filepath.Join(ctx.RootForImplicitAbsolutePaths, systemRegistriesConfDirPath)\n\t\twrapper.userConfigDirPath = userRegistriesDirPath\n\t} else {\n\t\twrapper.configDirPath = systemRegistriesConfDirPath\n\t\twrapper.userConfigDirPath = userRegistriesDirPath\n\t}\n\n\treturn wrapper\n}\n\n// ConfigurationSourceDescription returns a string containers paths of registries.conf and registries.conf.d\nfunc ConfigurationSourceDescription(ctx *types.SystemContext) string {\n\twrapper := newConfigWrapper(ctx)\n\tconfigSources := []string{wrapper.configPath}\n\tif wrapper.configDirPath != \"\" {\n\t\tconfigSources = append(configSources, wrapper.configDirPath)\n\t}\n\tif wrapper.userConfigDirPath != \"\" {\n\t\tconfigSources = append(configSources, wrapper.userConfigDirPath)\n\t}\n\treturn strings.Join(configSources, \", \")\n}\n\n// configMutex is used to synchronize concurrent accesses to configCache.\nvar configMutex = sync.Mutex{}\n\n// configCache caches already loaded configs with config paths as keys and is\n// used to avoid redundantly parsing configs. Concurrent accesses to the cache\n// are synchronized via configMutex.\nvar configCache = make(map[configWrapper]*parsedConfig)\n\n// InvalidateCache invalidates the registry cache.  This function is meant to be\n// used for long-running processes that need to reload potential changes made to\n// the cached registry config files.\nfunc InvalidateCache() {\n\tconfigMutex.Lock()\n\tdefer configMutex.Unlock()\n\tconfigCache = make(map[configWrapper]*parsedConfig)\n}\n\n// getConfig returns the config object corresponding to ctx, loading it if it is not yet cached.\nfunc getConfig(ctx *types.SystemContext) (*parsedConfig, error) {\n\twrapper := newConfigWrapper(ctx)\n\tconfigMutex.Lock()\n\tif config, inCache := configCache[wrapper]; inCache {\n\t\tconfigMutex.Unlock()\n\t\treturn config, nil\n\t}\n\tconfigMutex.Unlock()\n\n\treturn tryUpdatingCache(ctx, wrapper)\n}\n\n// dropInConfigs returns a slice of drop-in-configs from the registries.conf.d\n// directory.\nfunc dropInConfigs(wrapper configWrapper) ([]string, error) {\n\tvar (\n\t\tconfigs  []string\n\t\tdirPaths []string\n\t)\n\tif wrapper.configDirPath != \"\" {\n\t\tdirPaths = append(dirPaths, wrapper.configDirPath)\n\t}\n\tif wrapper.userConfigDirPath != \"\" {\n\t\tdirPaths = append(dirPaths, wrapper.userConfigDirPath)\n\t}\n\tfor _, dirPath := range dirPaths {\n\t\terr := filepath.WalkDir(dirPath,\n\t\t\t// WalkFunc to read additional configs\n\t\t\tfunc(path string, d fs.DirEntry, err error) error {\n\t\t\t\tswitch {\n\t\t\t\tcase err != nil:\n\t\t\t\t\t// return error (could be a permission problem)\n\t\t\t\t\treturn err\n\t\t\t\tcase d == nil:\n\t\t\t\t\t// this should only happen when err != nil but let's be sure\n\t\t\t\t\treturn nil\n\t\t\t\tcase d.IsDir():\n\t\t\t\t\tif path != dirPath {\n\t\t\t\t\t\t// make sure to not recurse into sub-directories\n\t\t\t\t\t\treturn filepath.SkipDir\n\t\t\t\t\t}\n\t\t\t\t\t// ignore directories\n\t\t\t\t\treturn nil\n\t\t\t\tdefault:\n\t\t\t\t\t// only add *.conf files\n\t\t\t\t\tif strings.HasSuffix(path, \".conf\") {\n\t\t\t\t\t\tconfigs = append(configs, path)\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t// Ignore IsNotExist errors: most systems won't have a registries.conf.d\n\t\t\t// directory.\n\t\t\treturn nil, fmt.Errorf(\"reading registries.conf.d: %w\", err)\n\t\t}\n\t}\n\n\treturn configs, nil\n}\n\n// TryUpdatingCache loads the configuration from the provided `SystemContext`\n// without using the internal cache. On success, the loaded configuration will\n// be added into the internal registry cache.\n// It returns the resulting configuration; this is DEPRECATED and may not correctly\n// reflect any future data handled by this package.\nfunc TryUpdatingCache(ctx *types.SystemContext) (*V2RegistriesConf, error) {\n\tconfig, err := tryUpdatingCache(ctx, newConfigWrapper(ctx))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &config.partialV2, err\n}\n\n// tryUpdatingCache implements TryUpdatingCache with an additional configWrapper\n// argument to avoid redundantly calculating the config paths.\nfunc tryUpdatingCache(ctx *types.SystemContext, wrapper configWrapper) (*parsedConfig, error) {\n\tconfigMutex.Lock()\n\tdefer configMutex.Unlock()\n\n\t// load the config\n\tconfig, err := loadConfigFile(wrapper.configPath, false)\n\tif err != nil {\n\t\t// Continue with an empty []Registry if we use the default config, which\n\t\t// implies that the config path of the SystemContext isn't set.\n\t\t//\n\t\t// Note: if ctx.SystemRegistriesConfPath points to the default config,\n\t\t// we will still return an error.\n\t\tif os.IsNotExist(err) && (ctx == nil || ctx.SystemRegistriesConfPath == \"\") {\n\t\t\tconfig = &parsedConfig{}\n\t\t\tconfig.partialV2 = V2RegistriesConf{Registries: []Registry{}}\n\t\t\tconfig.aliasCache, err = newShortNameAliasCache(\"\", &shortNameAliasConf{})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err // Should never happen\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"loading registries configuration %q: %w\", wrapper.configPath, err)\n\t\t}\n\t}\n\n\t// Load the configs from the conf directory path.\n\tdinConfigs, err := dropInConfigs(wrapper)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, path := range dinConfigs {\n\t\t// Enforce v2 format for drop-in-configs.\n\t\tdropIn, err := loadConfigFile(path, true)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"loading drop-in registries configuration %q: %w\", path, err)\n\t\t}\n\t\tconfig.updateWithConfigurationFrom(dropIn)\n\t}\n\n\tif config.shortNameMode == types.ShortNameModeInvalid {\n\t\tconfig.shortNameMode = defaultShortNameMode\n\t}\n\n\tif len(config.partialV2.CredentialHelpers) == 0 {\n\t\tconfig.partialV2.CredentialHelpers = []string{AuthenticationFileHelper}\n\t}\n\n\t// populate the cache\n\tconfigCache[wrapper] = config\n\treturn config, nil\n}\n\n// GetRegistries has been deprecated. Use FindRegistry instead.\n//\n// GetRegistries loads and returns the registries specified in the config.\n// Note the parsed content of registry config files is cached.  For reloading,\n// use `InvalidateCache` and re-call `GetRegistries`.\nfunc GetRegistries(ctx *types.SystemContext) ([]Registry, error) {\n\tconfig, err := getConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn config.partialV2.Registries, nil\n}\n\n// UnqualifiedSearchRegistries returns a list of host[:port] entries to try\n// for unqualified image search, in the returned order)\nfunc UnqualifiedSearchRegistries(ctx *types.SystemContext) ([]string, error) {\n\tregistries, _, err := UnqualifiedSearchRegistriesWithOrigin(ctx)\n\treturn registries, err\n}\n\n// UnqualifiedSearchRegistriesWithOrigin returns a list of host[:port] entries\n// to try for unqualified image search, in the returned order.  It also returns\n// a human-readable description of where these entries are specified (e.g., a\n// registries.conf file).\nfunc UnqualifiedSearchRegistriesWithOrigin(ctx *types.SystemContext) ([]string, string, error) {\n\tconfig, err := getConfig(ctx)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treturn config.partialV2.UnqualifiedSearchRegistries, config.unqualifiedSearchRegistriesOrigin, nil\n}\n\n// parseShortNameMode translates the string into well-typed\n// types.ShortNameMode.\nfunc parseShortNameMode(mode string) (types.ShortNameMode, error) {\n\tswitch mode {\n\tcase \"disabled\":\n\t\treturn types.ShortNameModeDisabled, nil\n\tcase \"enforcing\":\n\t\treturn types.ShortNameModeEnforcing, nil\n\tcase \"permissive\":\n\t\treturn types.ShortNameModePermissive, nil\n\tdefault:\n\t\treturn types.ShortNameModeInvalid, fmt.Errorf(\"invalid short-name mode: %q\", mode)\n\t}\n}\n\n// GetShortNameMode returns the configured types.ShortNameMode.\nfunc GetShortNameMode(ctx *types.SystemContext) (types.ShortNameMode, error) {\n\tif ctx != nil && ctx.ShortNameMode != nil {\n\t\treturn *ctx.ShortNameMode, nil\n\t}\n\tconfig, err := getConfig(ctx)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn config.shortNameMode, err\n}\n\n// CredentialHelpers returns the global top-level credential helpers.\nfunc CredentialHelpers(sys *types.SystemContext) ([]string, error) {\n\tconfig, err := getConfig(sys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn config.partialV2.CredentialHelpers, nil\n}\n\n// AdditionalLayerStoreAuthHelper returns the helper for passing registry\n// credentials to Additional Layer Store.\nfunc AdditionalLayerStoreAuthHelper(sys *types.SystemContext) (string, error) {\n\tconfig, err := getConfig(sys)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn config.partialV2.AdditionalLayerStoreAuthHelper, nil\n}\n\n// refMatchingSubdomainPrefix returns the length of ref\n// iff ref, which is a registry, repository namespace, repository or image reference (as formatted by\n// reference.Domain(), reference.Named.Name() or reference.Reference.String()\n// — note that this requires the name to start with an explicit hostname!),\n// matches a Registry.Prefix value containing wildcarded subdomains in the\n// format: *.example.com. Wildcards are only accepted at the beginning, so\n// other formats like example.*.com will not work. Wildcarded prefixes also\n// cannot contain port numbers or namespaces in them.\nfunc refMatchingSubdomainPrefix(ref, prefix string) int {\n\tindex := strings.Index(ref, prefix[1:])\n\tif index == -1 {\n\t\treturn -1\n\t}\n\tif strings.Contains(ref[:index], \"/\") {\n\t\treturn -1\n\t}\n\tindex += len(prefix[1:])\n\tif index == len(ref) {\n\t\treturn index\n\t}\n\tswitch ref[index] {\n\tcase ':', '/', '@':\n\t\treturn index\n\tdefault:\n\t\treturn -1\n\t}\n}\n\n// refMatchingPrefix returns the length of the prefix iff ref,\n// which is a registry, repository namespace, repository or image reference (as formatted by\n// reference.Domain(), reference.Named.Name() or reference.Reference.String()\n// — note that this requires the name to start with an explicit hostname!),\n// matches a Registry.Prefix value.\n// (This is split from the caller primarily to make testing easier.)\nfunc refMatchingPrefix(ref, prefix string) int {\n\tswitch {\n\tcase strings.HasPrefix(prefix, \"*.\"):\n\t\treturn refMatchingSubdomainPrefix(ref, prefix)\n\tcase len(ref) < len(prefix):\n\t\treturn -1\n\tcase len(ref) == len(prefix):\n\t\tif ref == prefix {\n\t\t\treturn len(prefix)\n\t\t}\n\t\treturn -1\n\tcase len(ref) > len(prefix):\n\t\tif !strings.HasPrefix(ref, prefix) {\n\t\t\treturn -1\n\t\t}\n\t\tc := ref[len(prefix)]\n\t\t// This allows \"example.com:5000\" to match \"example.com\",\n\t\t// which is unintended; that will get fixed eventually, DON'T RELY\n\t\t// ON THE CURRENT BEHAVIOR.\n\t\tif c == ':' || c == '/' || c == '@' {\n\t\t\treturn len(prefix)\n\t\t}\n\t\treturn -1\n\tdefault:\n\t\tpanic(\"Internal error: impossible comparison outcome\")\n\t}\n}\n\n// FindRegistry returns the Registry with the longest prefix for ref,\n// which is a registry, repository namespace repository or image reference (as formatted by\n// reference.Domain(), reference.Named.Name() or reference.Reference.String()\n// — note that this requires the name to start with an explicit hostname!).\n// If no Registry prefixes the image, nil is returned.\nfunc FindRegistry(ctx *types.SystemContext, ref string) (*Registry, error) {\n\tconfig, err := getConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn findRegistryWithParsedConfig(config, ref)\n}\n\n// findRegistryWithParsedConfig implements `FindRegistry` with a pre-loaded\n// parseConfig.\nfunc findRegistryWithParsedConfig(config *parsedConfig, ref string) (*Registry, error) {\n\treg := Registry{}\n\tprefixLen := 0\n\tfor _, r := range config.partialV2.Registries {\n\t\tif refMatchingPrefix(ref, r.Prefix) != -1 {\n\t\t\tlength := len(r.Prefix)\n\t\t\tif length > prefixLen {\n\t\t\t\treg = r\n\t\t\t\tprefixLen = length\n\t\t\t}\n\t\t}\n\t}\n\tif prefixLen != 0 {\n\t\treturn &reg, nil\n\t}\n\treturn nil, nil\n}\n\n// loadConfigFile loads and unmarshals a single config file.\n// Use forceV2 if the config must in the v2 format.\nfunc loadConfigFile(path string, forceV2 bool) (*parsedConfig, error) {\n\tlogrus.Debugf(\"Loading registries configuration %q\", path)\n\n\t// tomlConfig allows us to unmarshal either V1 or V2 simultaneously.\n\ttype tomlConfig struct {\n\t\tV2RegistriesConf\n\t\tV1RegistriesConf // for backwards compatibility with sysregistries v1\n\t}\n\n\t// Load the tomlConfig. Note that `DecodeFile` will overwrite set fields.\n\tvar combinedTOML tomlConfig\n\tmeta, err := toml.DecodeFile(path, &combinedTOML)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif keys := meta.Undecoded(); len(keys) > 0 {\n\t\tlogrus.Debugf(\"Failed to decode keys %q from %q\", keys, path)\n\t}\n\n\tif combinedTOML.V1RegistriesConf.hasSetField() {\n\t\t// Enforce the v2 format if requested.\n\t\tif forceV2 {\n\t\t\treturn nil, &InvalidRegistries{s: \"registry must be in v2 format but is in v1\"}\n\t\t}\n\n\t\t// Convert a v1 config into a v2 config.\n\t\tif combinedTOML.V2RegistriesConf.hasSetField() {\n\t\t\treturn nil, &InvalidRegistries{s: fmt.Sprintf(\"mixing sysregistry v1/v2 is not supported: %#v\", combinedTOML)}\n\t\t}\n\t\tconverted, err := combinedTOML.V1RegistriesConf.ConvertToV2()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcombinedTOML.V1RegistriesConf = V1RegistriesConf{}\n\t\tcombinedTOML.V2RegistriesConf = *converted\n\t}\n\n\tres := parsedConfig{partialV2: combinedTOML.V2RegistriesConf}\n\n\t// Post process registries, set the correct prefixes, sanity checks, etc.\n\tif err := res.partialV2.postProcessRegistries(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tres.unqualifiedSearchRegistriesOrigin = path\n\n\tif len(res.partialV2.ShortNameMode) > 0 {\n\t\tmode, err := parseShortNameMode(res.partialV2.ShortNameMode)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tres.shortNameMode = mode\n\t} else {\n\t\tres.shortNameMode = types.ShortNameModeInvalid\n\t}\n\n\t// Valid wildcarded prefixes must be in the format: *.example.com\n\t// FIXME: Move to postProcessRegistries\n\t// https://github.com/containers/image/pull/1191#discussion_r610623829\n\tfor i := range res.partialV2.Registries {\n\t\tprefix := res.partialV2.Registries[i].Prefix\n\t\tif strings.HasPrefix(prefix, \"*.\") && strings.ContainsAny(prefix, \"/@:\") {\n\t\t\tmsg := fmt.Sprintf(\"Wildcarded prefix should be in the format: *.example.com. Current prefix %q is incorrectly formatted\", prefix)\n\t\t\treturn nil, &InvalidRegistries{s: msg}\n\t\t}\n\t}\n\n\t// Parse and validate short-name aliases.\n\tcache, err := newShortNameAliasCache(path, &res.partialV2.shortNameAliasConf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"validating short-name aliases: %w\", err)\n\t}\n\tres.aliasCache = cache\n\t// Clear conf.partialV2.shortNameAliasConf to make it available for garbage collection and\n\t// reduce memory consumption.  We're consulting aliasCache for lookups.\n\tres.partialV2.shortNameAliasConf = shortNameAliasConf{}\n\n\treturn &res, nil\n}\n\n// updateWithConfigurationFrom updates c with configuration from updates.\n//\n// Fields present in updates will typically replace already set fields in c.\n// The [[registry]] and alias tables are merged.\nfunc (c *parsedConfig) updateWithConfigurationFrom(updates *parsedConfig) {\n\t// == Merge Registries:\n\tregistryMap := make(map[string]Registry)\n\tfor i := range c.partialV2.Registries {\n\t\tregistryMap[c.partialV2.Registries[i].Prefix] = c.partialV2.Registries[i]\n\t}\n\t// Merge the freshly loaded registries.\n\tfor i := range updates.partialV2.Registries {\n\t\tregistryMap[updates.partialV2.Registries[i].Prefix] = updates.partialV2.Registries[i]\n\t}\n\n\t// Go maps have a non-deterministic order when iterating the keys, so\n\t// we dump them in a slice and sort it to enforce some order in\n\t// Registries slice.  Some consumers of c/image (e.g., CRI-O) log the\n\t// configuration where a non-deterministic order could easily cause\n\t// confusion.\n\tprefixes := maps.Keys(registryMap)\n\tsort.Strings(prefixes)\n\n\tc.partialV2.Registries = []Registry{}\n\tfor _, prefix := range prefixes {\n\t\tc.partialV2.Registries = append(c.partialV2.Registries, registryMap[prefix])\n\t}\n\n\t// == Merge UnqualifiedSearchRegistries:\n\t// This depends on an subtlety of the behavior of the TOML decoder, where a missing array field\n\t// is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled\n\t// as a non-nil []string{}.\n\tif updates.partialV2.UnqualifiedSearchRegistries != nil {\n\t\tc.partialV2.UnqualifiedSearchRegistries = updates.partialV2.UnqualifiedSearchRegistries\n\t\tc.unqualifiedSearchRegistriesOrigin = updates.unqualifiedSearchRegistriesOrigin\n\t}\n\n\t// == Merge credential helpers:\n\tif updates.partialV2.CredentialHelpers != nil {\n\t\tc.partialV2.CredentialHelpers = updates.partialV2.CredentialHelpers\n\t}\n\n\t// == Merge shortNameMode:\n\t// We don’t maintain c.partialV2.ShortNameMode.\n\tif updates.shortNameMode != types.ShortNameModeInvalid {\n\t\tc.shortNameMode = updates.shortNameMode\n\t}\n\n\t// == Merge AdditionalLayerStoreAuthHelper:\n\tif updates.partialV2.AdditionalLayerStoreAuthHelper != \"\" {\n\t\tc.partialV2.AdditionalLayerStoreAuthHelper = updates.partialV2.AdditionalLayerStoreAuthHelper\n\t}\n\n\t// == Merge aliasCache:\n\t// We don’t maintain (in fact we actively clear) c.partialV2.shortNameAliasConf.\n\tc.aliasCache.updateWithConfigurationFrom(updates.aliasCache)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/image/v5/types/types.go",
    "content": "package types\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/containers/image/v5/docker/reference\"\n\tcompression \"github.com/containers/image/v5/pkg/compression/types\"\n\tdigest \"github.com/opencontainers/go-digest\"\n\tv1 \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\n// ImageTransport is a top-level namespace for ways to store/load an image.\n// It should generally correspond to ImageSource/ImageDestination implementations.\n//\n// Note that ImageTransport is based on \"ways the users refer to image storage\", not necessarily on the underlying physical transport.\n// For example, all Docker References would be used within a single \"docker\" transport, regardless of whether the images are pulled over HTTP or HTTPS\n// (or, even, IPv4 or IPv6).\n//\n// OTOH all images using the same transport should (apart from versions of the image format), be interoperable.\n// For example, several different ImageTransport implementations may be based on local filesystem paths,\n// but using completely different formats for the contents of that path (a single tar file, a directory containing tarballs, a fully expanded container filesystem, ...)\n//\n// See also transports.KnownTransports.\ntype ImageTransport interface {\n\t// Name returns the name of the transport, which must be unique among other transports.\n\tName() string\n\t// ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference.\n\tParseReference(reference string) (ImageReference, error)\n\t// ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys\n\t// (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value).\n\t// It is acceptable to allow an invalid value which will never be matched, it can \"only\" cause user confusion.\n\t// scope passed to this function will not be \"\", that value is always allowed.\n\tValidatePolicyConfigurationScope(scope string) error\n}\n\n// ImageReference is an abstracted way to refer to an image location, namespaced within an ImageTransport.\n//\n// The object should preferably be immutable after creation, with any parsing/state-dependent resolving happening\n// within an ImageTransport.ParseReference() or equivalent API creating the reference object.\n// That's also why the various identification/formatting methods of this type do not support returning errors.\n//\n// WARNING: While this design freezes the content of the reference within this process, it can not freeze the outside\n// world: paths may be replaced by symlinks elsewhere, HTTP APIs may start returning different results, and so on.\ntype ImageReference interface {\n\tTransport() ImageTransport\n\t// StringWithinTransport returns a string representation of the reference, which MUST be such that\n\t// reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference.\n\t// NOTE: The returned string is not promised to be equal to the original input to ParseReference;\n\t// e.g. default attribute values omitted by the user may be filled in the return value, or vice versa.\n\t// WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix;\n\t// instead, see transports.ImageName().\n\tStringWithinTransport() string\n\n\t// DockerReference returns a Docker reference associated with this reference\n\t// (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent,\n\t// not e.g. after redirect or alias processing), or nil if unknown/not applicable.\n\tDockerReference() reference.Named\n\n\t// PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup.\n\t// This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases;\n\t// The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical\n\t// (i.e. various references with exactly the same semantics should return the same configuration identity)\n\t// It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but\n\t// not required/guaranteed that it will be a valid input to Transport().ParseReference().\n\t// Returns \"\" if configuration identities for these references are not supported.\n\tPolicyConfigurationIdentity() string\n\n\t// PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search\n\t// for if explicit configuration for PolicyConfigurationIdentity() is not set.  The list will be processed\n\t// in order, terminating on first match, and an implicit \"\" is always checked at the end.\n\t// It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(),\n\t// and each following element to be a prefix of the element preceding it.\n\tPolicyConfigurationNamespaces() []string\n\n\t// NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport.\n\t// The caller must call .Close() on the returned ImageCloser.\n\t// NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource,\n\t// verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage.\n\t// WARNING: This may not do the right thing for a manifest list, see image.FromSource for details.\n\tNewImage(ctx context.Context, sys *SystemContext) (ImageCloser, error)\n\t// NewImageSource returns a types.ImageSource for this reference.\n\t// The caller must call .Close() on the returned ImageSource.\n\tNewImageSource(ctx context.Context, sys *SystemContext) (ImageSource, error)\n\t// NewImageDestination returns a types.ImageDestination for this reference.\n\t// The caller must call .Close() on the returned ImageDestination.\n\tNewImageDestination(ctx context.Context, sys *SystemContext) (ImageDestination, error)\n\n\t// DeleteImage deletes the named image from the registry, if supported.\n\tDeleteImage(ctx context.Context, sys *SystemContext) error\n}\n\n// LayerCompression indicates if layers must be compressed, decompressed or preserved\ntype LayerCompression int\n\nconst (\n\t// PreserveOriginal indicates the layer must be preserved, ie\n\t// no compression or decompression.\n\tPreserveOriginal LayerCompression = iota\n\t// Decompress indicates the layer must be decompressed\n\tDecompress\n\t// Compress indicates the layer must be compressed\n\tCompress\n)\n\n// LayerCrypto indicates if layers have been encrypted or decrypted or none\ntype LayerCrypto int\n\nconst (\n\t// PreserveOriginalCrypto indicates the layer must be preserved, ie\n\t// no encryption/decryption\n\tPreserveOriginalCrypto LayerCrypto = iota\n\t// Encrypt indicates the layer is encrypted\n\tEncrypt\n\t// Decrypt indicates the layer is decrypted\n\tDecrypt\n)\n\n// BlobInfo collects known information about a blob (layer/config).\n// In some situations, some fields may be unknown, in others they may be mandatory; documenting an “unknown” value here does not override that.\ntype BlobInfo struct {\n\tDigest      digest.Digest // \"\" if unknown.\n\tSize        int64         // -1 if unknown\n\tURLs        []string\n\tAnnotations map[string]string\n\tMediaType   string\n\n\t// NOTE: The following fields contain desired _edits_ to blob infos.\n\t// Conceptually then don't belong in the BlobInfo object at all;\n\t// the edits should be provided specifically as parameters to the edit implementation.\n\t// We can’t remove the fields without breaking compatibility, but don’t\n\t// add any more.\n\n\t// CompressionOperation is used in Image.UpdateLayerInfos to instruct\n\t// whether the original layer's \"compressed or not\" should be preserved,\n\t// possibly while changing the compression algorithm from one to another,\n\t// or if it should be changed to compressed or decompressed.\n\t// The field defaults to preserve the original layer's compressedness.\n\t// TODO: To remove together with CryptoOperation in re-design to remove\n\t// field out of BlobInfo.\n\tCompressionOperation LayerCompression\n\t// CompressionAlgorithm is used in Image.UpdateLayerInfos to set the correct\n\t// MIME type for compressed layers (e.g., gzip or zstd). This field MUST be\n\t// set when `CompressionOperation == Compress` and MAY be set when\n\t// `CompressionOperation == PreserveOriginal` and the compression type is\n\t// being changed for an already-compressed layer.\n\tCompressionAlgorithm *compression.Algorithm\n\t// CryptoOperation is used in Image.UpdateLayerInfos to instruct\n\t// whether the original layer was encrypted/decrypted\n\t// TODO: To remove together with CompressionOperation in re-design to\n\t// remove field out of BlobInfo.\n\tCryptoOperation LayerCrypto\n\t// Before adding any fields to this struct, read the NOTE above.\n}\n\n// BICTransportScope encapsulates transport-dependent representation of a “scope” where blobs are or are not present.\n// BlobInfocache.RecordKnownLocations / BlobInfocache.CandidateLocations record data about blobs keyed by (scope, digest).\n// The scope will typically be similar to an ImageReference, or a superset of it within which blobs are reusable.\n//\n// NOTE: The contents of this structure may be recorded in a persistent file, possibly shared across different\n// tools which use different versions of the transport.  Allow for reasonable backward/forward compatibility,\n// at least by not failing hard when encountering unknown data.\ntype BICTransportScope struct {\n\tOpaque string\n}\n\n// BICLocationReference encapsulates transport-dependent representation of a blob location within a BICTransportScope.\n// Each transport can store arbitrary data using BlobInfoCache.RecordKnownLocation, and ImageDestination.TryReusingBlob\n// can look it up using BlobInfoCache.CandidateLocations.\n//\n// NOTE: The contents of this structure may be recorded in a persistent file, possibly shared across different\n// tools which use different versions of the transport.  Allow for reasonable backward/forward compatibility,\n// at least by not failing hard when encountering unknown data.\ntype BICLocationReference struct {\n\tOpaque string\n}\n\n// BICReplacementCandidate is an item returned by BlobInfoCache.CandidateLocations.\ntype BICReplacementCandidate struct {\n\tDigest   digest.Digest\n\tLocation BICLocationReference\n}\n\n// BlobInfoCache records data useful for reusing blobs, or substituting equivalent ones, to avoid unnecessary blob copies.\n//\n// It records two kinds of data:\n//\n//   - Sets of corresponding digest vs. uncompressed digest (\"DiffID\") pairs:\n//     One of the two digests is known to be uncompressed, and a single uncompressed digest may correspond to more than one compressed digest.\n//     This allows matching compressed layer blobs to existing local uncompressed layers (to avoid unnecessary download and decompression),\n//     or uncompressed layer blobs to existing remote compressed layers (to avoid unnecessary compression and upload)/\n//\n//     It is allowed to record an (uncompressed digest, the same uncompressed digest) correspondence, to express that the digest is known\n//     to be uncompressed (i.e. that a conversion from schema1 does not have to decompress the blob to compute a DiffID value).\n//\n//     This mapping is primarily maintained in generic copy.Image code, but transports may want to contribute more data points if they independently\n//     compress/decompress blobs for their own purposes.\n//\n//   - Known blob locations, managed by individual transports:\n//     The transports call RecordKnownLocation when encountering a blob that could possibly be reused (typically in GetBlob/PutBlob/TryReusingBlob),\n//     recording transport-specific information that allows the transport to reuse the blob in the future;\n//     then, TryReusingBlob implementations can call CandidateLocations to look up previously recorded blob locations that could be reused.\n//\n//     Each transport defines its own “scopes” within which blob reuse is possible (e.g. in, the docker/distribution case, blobs\n//     can be directly reused within a registry, or mounted across registries within a registry server.)\n//\n// None of the methods return an error indication: errors when neither reading from, nor writing to, the cache, should be fatal;\n// users of the cache should just fall back to copying the blobs the usual way.\n//\n// The BlobInfoCache interface is deprecated.  Consumers of this library should use one of the implementations provided by\n// subpackages of the library's \"pkg/blobinfocache\" package in preference to implementing the interface on their own.\ntype BlobInfoCache interface {\n\t// UncompressedDigest returns an uncompressed digest corresponding to anyDigest.\n\t// May return anyDigest if it is known to be uncompressed.\n\t// Returns \"\" if nothing is known about the digest (it may be compressed or uncompressed).\n\tUncompressedDigest(anyDigest digest.Digest) digest.Digest\n\t// RecordDigestUncompressedPair records that the uncompressed version of anyDigest is uncompressed.\n\t// It’s allowed for anyDigest == uncompressed.\n\t// WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g.\n\t// because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs.\n\t// (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.)\n\tRecordDigestUncompressedPair(anyDigest digest.Digest, uncompressed digest.Digest)\n\n\t// RecordKnownLocation records that a blob with the specified digest exists within the specified (transport, scope) scope,\n\t// and can be reused given the opaque location data.\n\tRecordKnownLocation(transport ImageTransport, scope BICTransportScope, digest digest.Digest, location BICLocationReference)\n\t// CandidateLocations returns a prioritized, limited, number of blobs and their locations that could possibly be reused\n\t// within the specified (transport scope) (if they still exist, which is not guaranteed).\n\t//\n\t// If !canSubstitute, the returned candidates will match the submitted digest exactly; if canSubstitute,\n\t// data from previous RecordDigestUncompressedPair calls is used to also look up variants of the blob which have the same\n\t// uncompressed digest.\n\tCandidateLocations(transport ImageTransport, scope BICTransportScope, digest digest.Digest, canSubstitute bool) []BICReplacementCandidate\n}\n\n// ImageSource is a service, possibly remote (= slow), to download components of a single image or a named image set (manifest list).\n// This is primarily useful for copying images around; for examining their properties, Image (below)\n// is usually more useful.\n// Each ImageSource should eventually be closed by calling Close().\n//\n// WARNING: Various methods which return an object identified by digest generally do not\n// validate that the returned data actually matches that digest; this is the caller’s responsibility.\ntype ImageSource interface {\n\t// Reference returns the reference used to set up this source, _as specified by the user_\n\t// (not as the image itself, or its underlying storage, claims).  This can be used e.g. to determine which public keys are trusted for this image.\n\tReference() ImageReference\n\t// Close removes resources associated with an initialized ImageSource, if any.\n\tClose() error\n\t// GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available).\n\t// It may use a remote (= slow) service.\n\t// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list);\n\t// this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists).\n\tGetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error)\n\t// GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown).\n\t// The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided.\n\t// May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location.\n\tGetBlob(context.Context, BlobInfo, BlobInfoCache) (io.ReadCloser, int64, error)\n\t// HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently.\n\tHasThreadSafeGetBlob() bool\n\t// GetSignatures returns the image's signatures.  It may use a remote (= slow) service.\n\t// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for\n\t// (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list\n\t// (e.g. if the source never returns manifest lists).\n\tGetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error)\n\t// LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer\n\t// blobsums that are listed in the image's manifest.  If values are returned, they should be used when using GetBlob()\n\t// to read the image's layers.\n\t// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve BlobInfos for\n\t// (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list\n\t// (e.g. if the source never returns manifest lists).\n\t// The Digest field is guaranteed to be provided; Size may be -1.\n\t// WARNING: The list may contain duplicates, and they are semantically relevant.\n\tLayerInfosForCopy(ctx context.Context, instanceDigest *digest.Digest) ([]BlobInfo, error)\n}\n\n// ImageDestination is a service, possibly remote (= slow), to store components of a single image.\n//\n// There is a specific required order for some of the calls:\n// TryReusingBlob/PutBlob on the various blobs, if any, MUST be called before PutManifest (manifest references blobs, which may be created or compressed only at push time)\n// PutSignatures, if called, MUST be called after PutManifest (signatures reference manifest contents)\n// Finally, Commit MUST be called if the caller wants the image, as formed by the components saved above, to persist.\n//\n// Each ImageDestination should eventually be closed by calling Close().\ntype ImageDestination interface {\n\t// Reference returns the reference used to set up this destination.  Note that this should directly correspond to user's intent,\n\t// e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects.\n\tReference() ImageReference\n\t// Close removes resources associated with an initialized ImageDestination, if any.\n\tClose() error\n\n\t// SupportedManifestMIMETypes tells which manifest mime types the destination supports\n\t// If an empty slice or nil it's returned, then any mime type can be tried to upload\n\tSupportedManifestMIMETypes() []string\n\t// SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures.\n\t// Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil.\n\tSupportsSignatures(ctx context.Context) error\n\t// DesiredLayerCompression indicates the kind of compression to apply on layers\n\tDesiredLayerCompression() LayerCompression\n\t// AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually\n\t// uploaded to the image destination, true otherwise.\n\tAcceptsForeignLayerURLs() bool\n\t// MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise.\n\tMustMatchRuntimeOS() bool\n\t// IgnoresEmbeddedDockerReference() returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(),\n\t// and would prefer to receive an unmodified manifest instead of one modified for the destination.\n\t// Does not make a difference if Reference().DockerReference() is nil.\n\tIgnoresEmbeddedDockerReference() bool\n\n\t// PutBlob writes contents of stream and returns data representing the result.\n\t// inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents.\n\t// inputInfo.Size is the expected length of stream, if known.\n\t// inputInfo.MediaType describes the blob format, if known.\n\t// May update cache.\n\t// WARNING: The contents of stream are being verified on the fly.  Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available\n\t// to any other readers for download using the supplied digest.\n\t// If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far.\n\tPutBlob(ctx context.Context, stream io.Reader, inputInfo BlobInfo, cache BlobInfoCache, isConfig bool) (BlobInfo, error)\n\t// HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently.\n\tHasThreadSafePutBlob() bool\n\t// TryReusingBlob checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination\n\t// (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree).\n\t// info.Digest must not be empty.\n\t// If canSubstitute, TryReusingBlob can use an equivalent equivalent of the desired blob; in that case the returned info may not match the input.\n\t// If the blob has been successfully reused, returns (true, info, nil); info must contain at least a digest and size, and may\n\t// include CompressionOperation and CompressionAlgorithm fields to indicate that a change to the compression type should be\n\t// reflected in the manifest that will be written.\n\t// If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure.\n\t// May use and/or update cache.\n\tTryReusingBlob(ctx context.Context, info BlobInfo, cache BlobInfoCache, canSubstitute bool) (bool, BlobInfo, error)\n\t// PutManifest writes manifest to the destination.\n\t// If instanceDigest is not nil, it contains a digest of the specific manifest instance to write the manifest for\n\t// (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list.\n\t// It is expected but not enforced that the instanceDigest, when specified, matches the digest of `manifest` as generated\n\t// by `manifest.Digest()`.\n\t// FIXME? This should also receive a MIME type if known, to differentiate between schema versions.\n\t// If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema),\n\t// but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError.\n\tPutManifest(ctx context.Context, manifest []byte, instanceDigest *digest.Digest) error\n\t// PutSignatures writes a set of signatures to the destination.\n\t// If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for\n\t// (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list.\n\t// MUST be called after PutManifest (signatures may reference manifest contents).\n\tPutSignatures(ctx context.Context, signatures [][]byte, instanceDigest *digest.Digest) error\n\t// Commit marks the process of storing the image as successful and asks for the image to be persisted.\n\t// unparsedToplevel contains data about the top-level manifest of the source (which may be a single-arch image or a manifest list\n\t// if PutManifest was only called for the single-arch image with instanceDigest == nil), primarily to allow lookups by the\n\t// original manifest list digest, if desired.\n\t// WARNING: This does not have any transactional semantics:\n\t// - Uploaded data MAY be visible to others before Commit() is called\n\t// - Uploaded data MAY be removed or MAY remain around if Close() is called without Commit() (i.e. rollback is allowed but not guaranteed)\n\tCommit(ctx context.Context, unparsedToplevel UnparsedImage) error\n}\n\n// ManifestTypeRejectedError is returned by ImageDestination.PutManifest if the destination is in principle available,\n// refuses specifically this manifest type, but may accept a different manifest type.\ntype ManifestTypeRejectedError struct { // We only use a struct to allow a type assertion, without limiting the contents of the error otherwise.\n\tErr error\n}\n\nfunc (e ManifestTypeRejectedError) Error() string {\n\treturn e.Err.Error()\n}\n\n// UnparsedImage is an Image-to-be; until it is verified and accepted, it only caries its identity and caches manifest and signature blobs.\n// Thus, an UnparsedImage can be created from an ImageSource simply by fetching blobs without interpreting them,\n// allowing cryptographic signature verification to happen first, before even fetching the manifest, or parsing anything else.\n// This also makes the UnparsedImage→Image conversion an explicitly visible step.\n//\n// An UnparsedImage is a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance.\n//\n// The UnparsedImage must not be used after the underlying ImageSource is Close()d.\ntype UnparsedImage interface {\n\t// Reference returns the reference used to set up this source, _as specified by the user_\n\t// (not as the image itself, or its underlying storage, claims).  This can be used e.g. to determine which public keys are trusted for this image.\n\tReference() ImageReference\n\t// Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need.\n\tManifest(ctx context.Context) ([]byte, string, error)\n\t// Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need.\n\tSignatures(ctx context.Context) ([][]byte, error)\n}\n\n// Image is the primary API for inspecting properties of images.\n// An Image is based on a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance.\n//\n// The Image must not be used after the underlying ImageSource is Close()d.\ntype Image interface {\n\t// Note that Reference may return nil in the return value of UpdatedImage!\n\tUnparsedImage\n\t// ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:\"\"} if there isn't a separate object.\n\t// Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below.\n\tConfigInfo() BlobInfo\n\t// ConfigBlob returns the blob described by ConfigInfo, if ConfigInfo().Digest != \"\"; nil otherwise.\n\t// The result is cached; it is OK to call this however often you need.\n\tConfigBlob(context.Context) ([]byte, error)\n\t// OCIConfig returns the image configuration as per OCI v1 image-spec. Information about\n\t// layers in the resulting configuration isn't guaranteed to be returned to due how\n\t// old image manifests work (docker v2s1 especially).\n\tOCIConfig(context.Context) (*v1.Image, error)\n\t// LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers).\n\t// The Digest field is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided.\n\t// WARNING: The list may contain duplicates, and they are semantically relevant.\n\tLayerInfos() []BlobInfo\n\t// LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer blobsums that are listed in the image's manifest.\n\t// The Digest field is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided.\n\t// WARNING: The list may contain duplicates, and they are semantically relevant.\n\tLayerInfosForCopy(context.Context) ([]BlobInfo, error)\n\t// EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref.\n\t// It returns false if the manifest does not embed a Docker reference.\n\t// (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.)\n\tEmbeddedDockerReferenceConflicts(ref reference.Named) bool\n\t// Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration.\n\tInspect(context.Context) (*ImageInspectInfo, error)\n\t// UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs.\n\t// This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute\n\t// (most importantly it forces us to download the full layers even if they are already present at the destination).\n\tUpdatedImageNeedsLayerDiffIDs(options ManifestUpdateOptions) bool\n\t// UpdatedImage returns a types.Image modified according to options.\n\t// Everything in options.InformationOnly should be provided, other fields should be set only if a modification is desired.\n\t// This does not change the state of the original Image object.\n\t// The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError if\n\t// manifests of type options.ManifestMIMEType can not include layers that are compressed\n\t// in accordance with the CompressionOperation and CompressionAlgorithm specified in one\n\t// or more options.LayerInfos items, though retrying with a different\n\t// options.ManifestMIMEType or with different CompressionOperation+CompressionAlgorithm\n\t// values might succeed.\n\tUpdatedImage(ctx context.Context, options ManifestUpdateOptions) (Image, error)\n\t// SupportsEncryption returns an indicator that the image supports encryption\n\t//\n\t// Deprecated: Initially used to determine if a manifest can be copied from a source manifest type since\n\t// the process of updating a manifest between different manifest types was to update then convert.\n\t// This resulted in some fields in the update being lost. This has been fixed by: https://github.com/containers/image/pull/836\n\tSupportsEncryption(ctx context.Context) bool\n\t// Size returns an approximation of the amount of disk space which is consumed by the image in its current\n\t// location.  If the size is not known, -1 will be returned.\n\tSize() (int64, error)\n}\n\n// ImageCloser is an Image with a Close() method which must be called by the user.\n// This is returned by ImageReference.NewImage, which transparently instantiates a types.ImageSource,\n// to ensure that the ImageSource is closed.\ntype ImageCloser interface {\n\tImage\n\t// Close removes resources associated with an initialized ImageCloser.\n\tClose() error\n}\n\n// ManifestUpdateOptions is a way to pass named optional arguments to Image.UpdatedImage\ntype ManifestUpdateOptions struct {\n\tLayerInfos              []BlobInfo // Complete BlobInfos (size+digest+urls+annotations) which should replace the originals, in order (the root layer first, and then successive layered layers). BlobInfos' MediaType fields are ignored.\n\tEmbeddedDockerReference reference.Named\n\tManifestMIMEType        string\n\t// The values below are NOT requests to modify the image; they provide optional context which may or may not be used.\n\tInformationOnly ManifestUpdateInformation\n}\n\n// ManifestUpdateInformation is a component of ManifestUpdateOptions, named here\n// only to make writing struct literals possible.\ntype ManifestUpdateInformation struct {\n\tDestination  ImageDestination // and yes, UpdatedImage may write to Destination (see the schema2 → schema1 conversion logic in image/docker_schema2.go)\n\tLayerInfos   []BlobInfo       // Complete BlobInfos (size+digest) which have been uploaded, in order (the root layer first, and then successive layered layers)\n\tLayerDiffIDs []digest.Digest  // Digest values for the _uncompressed_ contents of the blobs which have been uploaded, in the same order.\n}\n\n// ImageInspectInfo is a set of metadata describing Docker images, primarily their manifest and configuration.\n// The Tag field is a legacy field which is here just for the Docker v2s1 manifest. It won't be supported\n// for other manifest types.\ntype ImageInspectInfo struct {\n\tTag           string\n\tCreated       *time.Time\n\tDockerVersion string\n\tLabels        map[string]string\n\tArchitecture  string\n\tVariant       string\n\tOs            string\n\tLayers        []string\n\tLayersData    []ImageInspectLayer\n\tEnv           []string\n\tAuthor        string\n}\n\n// ImageInspectLayer is a set of metadata describing an image layers' detail\ntype ImageInspectLayer struct {\n\tMIMEType    string // \"\" if unknown.\n\tDigest      digest.Digest\n\tSize        int64 // -1 if unknown.\n\tAnnotations map[string]string\n}\n\n// DockerAuthConfig contains authorization information for connecting to a registry.\n// the value of Username and Password can be empty for accessing the registry anonymously\ntype DockerAuthConfig struct {\n\tUsername string\n\tPassword string\n\t// IdentityToken can be used as an refresh_token in place of username and\n\t// password to obtain the bearer/access token in oauth2 flow. If identity\n\t// token is set, password should not be set.\n\t// Ref: https://docs.docker.com/registry/spec/auth/oauth/\n\tIdentityToken string\n}\n\n// OptionalBool is a boolean with an additional undefined value, which is meant\n// to be used in the context of user input to distinguish between a\n// user-specified value and a default value.\ntype OptionalBool byte\n\nconst (\n\t// OptionalBoolUndefined indicates that the OptionalBoolean hasn't been written.\n\tOptionalBoolUndefined OptionalBool = iota\n\t// OptionalBoolTrue represents the boolean true.\n\tOptionalBoolTrue\n\t// OptionalBoolFalse represents the boolean false.\n\tOptionalBoolFalse\n)\n\n// NewOptionalBool converts the input bool into either OptionalBoolTrue or\n// OptionalBoolFalse.  The function is meant to avoid boilerplate code of users.\nfunc NewOptionalBool(b bool) OptionalBool {\n\to := OptionalBoolFalse\n\tif b {\n\t\to = OptionalBoolTrue\n\t}\n\treturn o\n}\n\n// ShortNameMode defines the mode of short-name resolution.\n//\n// The use of unqualified-search registries entails an ambiguity as it's\n// unclear from which registry a given image, referenced by a short name, may\n// be pulled from.\n//\n// The ShortNameMode type defines how short names should resolve.\ntype ShortNameMode int\n\nconst (\n\tShortNameModeInvalid ShortNameMode = iota\n\t// Use all configured unqualified-search registries without prompting\n\t// the user.\n\tShortNameModeDisabled\n\t// If stdout and stdin are a TTY, prompt the user to select a configured\n\t// unqualified-search registry. Otherwise, use all configured\n\t// unqualified-search registries.\n\t//\n\t// Note that if only one unqualified-search registry is set, it will be\n\t// used without prompting.\n\tShortNameModePermissive\n\t// Always prompt the user to select a configured unqualified-search\n\t// registry.  Throw an error if stdout or stdin is not a TTY as\n\t// prompting isn't possible.\n\t//\n\t// Note that if only one unqualified-search registry is set, it will be\n\t// used without prompting.\n\tShortNameModeEnforcing\n)\n\n// SystemContext allows parameterizing access to implicitly-accessed resources,\n// like configuration files in /etc and users' login state in their home directory.\n// Various components can share the same field only if their semantics is exactly\n// the same; if in doubt, add a new field.\n// It is always OK to pass nil instead of a SystemContext.\ntype SystemContext struct {\n\t// If not \"\", prefixed to any absolute paths used by default by the library (e.g. in /etc/).\n\t// Not used for any of the more specific path overrides available in this struct.\n\t// Not used for any paths specified by users in config files (even if the location of the config file _was_ affected by it).\n\t// NOTE: If this is set, environment-variable overrides of paths are ignored (to keep the semantics simple: to create an /etc replacement, just set RootForImplicitAbsolutePaths .\n\t// and there is no need to worry about the environment.)\n\t// NOTE: This does NOT affect paths starting by $HOME.\n\tRootForImplicitAbsolutePaths string\n\n\t// === Global configuration overrides ===\n\t// If not \"\", overrides the system's default path for signature.Policy configuration.\n\tSignaturePolicyPath string\n\t// If not \"\", overrides the system's default path for registries.d (Docker signature storage configuration)\n\tRegistriesDirPath string\n\t// Path to the system-wide registries configuration file\n\tSystemRegistriesConfPath string\n\t// Path to the system-wide registries configuration directory\n\tSystemRegistriesConfDirPath string\n\t// Path to the user-specific short-names configuration file\n\tUserShortNameAliasConfPath string\n\t// If set, short-name resolution in pkg/shortnames must follow the specified mode\n\tShortNameMode *ShortNameMode\n\t// If set, short names will resolve in pkg/shortnames to docker.io only, and unqualified-search registries and\n\t// short-name aliases in registries.conf are ignored.  Note that this field is only intended to help enforce\n\t// resolving to Docker Hub in the Docker-compatible REST API of Podman; it should never be used outside this\n\t// specific context.\n\tPodmanOnlyShortNamesIgnoreRegistriesConfAndForceDockerHub bool\n\t// If not \"\", overrides the default path for the registry authentication file, but only new format files\n\tAuthFilePath string\n\t// if not \"\", overrides the default path for the registry authentication file, but with the legacy format;\n\t// the code currently will by default look for legacy format files like .dockercfg in the $HOME dir;\n\t// but in addition to the home dir, openshift may mount .dockercfg files (via secret mount)\n\t// in locations other than the home dir; openshift components should then set this field in those cases;\n\t// this field is ignored if `AuthFilePath` is set (we favor the newer format);\n\t// only reading of this data is supported;\n\tLegacyFormatAuthFilePath string\n\t// If set, a path to a Docker-compatible \"config.json\" file containing credentials; and no other files are processed.\n\t// This must not be set if AuthFilePath is set.\n\t// Only credentials and credential helpers in this file apre processed, not any other configuration in this file.\n\tDockerCompatAuthFilePath string\n\t// If not \"\", overrides the use of platform.GOARCH when choosing an image or verifying architecture match.\n\tArchitectureChoice string\n\t// If not \"\", overrides the use of platform.GOOS when choosing an image or verifying OS match.\n\tOSChoice string\n\t// If not \"\", overrides the use of detected ARM platform variant when choosing an image or verifying variant match.\n\tVariantChoice string\n\t// If not \"\", overrides the system's default directory containing a blob info cache.\n\tBlobInfoCacheDir string\n\t// Additional tags when creating or copying a docker-archive.\n\tDockerArchiveAdditionalTags []reference.NamedTagged\n\t// If not \"\", overrides the temporary directory to use for storing big files\n\tBigFilesTemporaryDir string\n\n\t// === OCI.Transport overrides ===\n\t// If not \"\", a directory containing a CA certificate (ending with \".crt\"),\n\t// a client certificate (ending with \".cert\") and a client certificate key\n\t// (ending with \".key\") used when downloading OCI image layers.\n\tOCICertPath string\n\t// Allow downloading OCI image layers over HTTP, or HTTPS with failed TLS verification. Note that this does not affect other TLS connections.\n\tOCIInsecureSkipTLSVerify bool\n\t// If not \"\", use a shared directory for storing blobs rather than within OCI layouts\n\tOCISharedBlobDirPath string\n\t// Allow UnCompress image layer for OCI image layer\n\tOCIAcceptUncompressedLayers bool\n\n\t// === docker.Transport overrides ===\n\t// If not \"\", a directory containing a CA certificate (ending with \".crt\"),\n\t// a client certificate (ending with \".cert\") and a client certificate key\n\t// (ending with \".key\") used when talking to a container registry.\n\tDockerCertPath string\n\t// If not \"\", overrides the system’s default path for a directory containing host[:port] subdirectories with the same structure as DockerCertPath above.\n\t// Ignored if DockerCertPath is non-empty.\n\tDockerPerHostCertDirPath string\n\t// Allow contacting container registries over HTTP, or HTTPS with failed TLS verification. Note that this does not affect other TLS connections.\n\tDockerInsecureSkipTLSVerify OptionalBool\n\t// if nil, the library tries to parse ~/.docker/config.json to retrieve credentials\n\t// Ignored if DockerBearerRegistryToken is non-empty.\n\tDockerAuthConfig *DockerAuthConfig\n\t// if not \"\", the library uses this registry token to authenticate to the registry\n\tDockerBearerRegistryToken string\n\t// if not \"\", an User-Agent header is added to each request when contacting a registry.\n\tDockerRegistryUserAgent string\n\t// if true, a V1 ping attempt isn't done to give users a better error. Default is false.\n\t// Note that this field is used mainly to integrate containers/image into projectatomic/docker\n\t// in order to not break any existing docker's integration tests.\n\t// Deprecated: The V1 container registry detection is no longer performed, so setting this flag has no effect.\n\tDockerDisableV1Ping bool\n\t// If true, dockerImageDestination.SupportedManifestMIMETypes will omit the Schema1 media types from the supported list\n\tDockerDisableDestSchema1MIMETypes bool\n\t// If true, the physical pull source of docker transport images logged as info level\n\tDockerLogMirrorChoice bool\n\t// Directory to use for OSTree temporary files\n\tOSTreeTmpDirPath string\n\t// If true, all blobs will have precomputed digests to ensure layers are not uploaded that already exist on the registry.\n\t// Note that this requires writing blobs to temporary files, and takes more time than the default behavior,\n\t// when the digest for a blob is unknown.\n\tDockerRegistryPushPrecomputeDigests bool\n\n\t// === docker/daemon.Transport overrides ===\n\t// A directory containing a CA certificate (ending with \".crt\"),\n\t// a client certificate (ending with \".cert\") and a client certificate key\n\t// (ending with \".key\") used when talking to a Docker daemon.\n\tDockerDaemonCertPath string\n\t// The hostname or IP to the Docker daemon. If not set (aka \"\"), client.DefaultDockerHost is assumed.\n\tDockerDaemonHost string\n\t// Used to skip TLS verification, off by default. To take effect DockerDaemonCertPath needs to be specified as well.\n\tDockerDaemonInsecureSkipTLSVerify bool\n\n\t// === dir.Transport overrides ===\n\t// DirForceCompress compresses the image layers if set to true\n\tDirForceCompress bool\n\t// DirForceDecompress decompresses the image layers if set to true\n\tDirForceDecompress bool\n\n\t// CompressionFormat is the format to use for the compression of the blobs\n\tCompressionFormat *compression.Algorithm\n\t// CompressionLevel specifies what compression level is used\n\tCompressionLevel *int\n}\n\n// ProgressEvent is the type of events a progress reader can produce\n// Warning: new event types may be added any time.\ntype ProgressEvent uint\n\nconst (\n\t// ProgressEventNewArtifact will be fired on progress reader setup\n\tProgressEventNewArtifact ProgressEvent = iota\n\n\t// ProgressEventRead indicates that the artifact download is currently in\n\t// progress\n\tProgressEventRead\n\n\t// ProgressEventDone is fired when the data transfer has been finished for\n\t// the specific artifact\n\tProgressEventDone\n\n\t// ProgressEventSkipped is fired when the artifact has been skipped because\n\t// its already available at the destination\n\tProgressEventSkipped\n)\n\n// ProgressProperties is used to pass information from the copy code to a monitor which\n// can use the real-time information to produce output or react to changes.\ntype ProgressProperties struct {\n\t// The event indicating what\n\tEvent ProgressEvent\n\n\t// The artifact which has been updated in this interval\n\tArtifact BlobInfo\n\n\t// The currently downloaded size in bytes\n\t// Increases from 0 to the final Artifact size\n\tOffset uint64\n\n\t// The additional offset which has been downloaded inside the last update\n\t// interval. Will be reset after each ProgressEventRead event.\n\tOffsetUpdate uint64\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/AUTHORS",
    "content": "# This file lists all individuals having contributed content to the repository.\n# For how it is generated, see `hack/generate-authors.sh`.\n\nAanand Prasad <aanand.prasad@gmail.com>\nAaron Davidson <aaron@databricks.com>\nAaron Feng <aaron.feng@gmail.com>\nAaron Huslage <huslage@gmail.com>\nAaron Lehmann <aaron.lehmann@docker.com>\nAaron Welch <welch@packet.net>\nAbel Muiño <amuino@gmail.com>\nAbhijeet Kasurde <akasurde@redhat.com>\nAbhinav Ajgaonkar <abhinav316@gmail.com>\nAbhishek Chanda <abhishek.becs@gmail.com>\nAbin Shahab <ashahab@altiscale.com>\nAdam Miller <admiller@redhat.com>\nAdam Singer <financeCoding@gmail.com>\nAditi Rajagopal <arajagopal@us.ibm.com>\nAditya <aditya@netroy.in>\nAdria Casas <adriacasas88@gmail.com>\nAdrian Mouat <adrian.mouat@gmail.com>\nAdrian Oprea <adrian@codesi.nz>\nAdrien Folie <folie.adrien@gmail.com>\nAdrien Gallouët <adrien@gallouet.fr>\nAhmed Kamal <email.ahmedkamal@googlemail.com>\nAhmet Alp Balkan <ahmetb@microsoft.com>\nAidan Feldman <aidan.feldman@gmail.com>\nAidan Hobson Sayers <aidanhs@cantab.net>\nAJ Bowen <aj@gandi.net>\nAjey Charantimath <ajey.charantimath@gmail.com>\najneu <ajneu@users.noreply.github.com>\nAkihiro Suda <suda.akihiro@lab.ntt.co.jp>\nAl Tobey <al@ooyala.com>\nalambike <alambike@gmail.com>\nAlan Scherger <flyinprogrammer@gmail.com>\nAlan Thompson <cloojure@gmail.com>\nAlbert Callarisa <shark234@gmail.com>\nAlbert Zhang <zhgwenming@gmail.com>\nAleksa Sarai <asarai@suse.de>\nAleksandrs Fadins <aleks@s-ko.net>\nAlena Prokharchyk <alena@rancher.com>\nAlessandro Boch <aboch@docker.com>\nAlessio Biancalana <dottorblaster@gmail.com>\nAlex Chan <alex@alexwlchan.net>\nAlex Crawford <alex.crawford@coreos.com>\nAlex Ellis <alexellis2@gmail.com>\nAlex Gaynor <alex.gaynor@gmail.com>\nAlex Samorukov <samm@os2.kiev.ua>\nAlex Warhawk <ax.warhawk@gmail.com>\nAlexander Artemenko <svetlyak.40wt@gmail.com>\nAlexander Boyd <alex@opengroove.org>\nAlexander Larsson <alexl@redhat.com>\nAlexander Morozov <lk4d4@docker.com>\nAlexander Shopov <ash@kambanaria.org>\nAlexandre Beslic <abronan@docker.com>\nAlexandre González <agonzalezro@gmail.com>\nAlexandru Sfirlogea <alexandru.sfirlogea@gmail.com>\nAlexey Guskov <lexag@mail.ru>\nAlexey Kotlyarov <alexey@infoxchange.net.au>\nAlexey Shamrin <shamrin@gmail.com>\nAlexis THOMAS <fr.alexisthomas@gmail.com>\nAli Dehghani <ali.dehghani.g@gmail.com>\nAllen Madsen <blatyo@gmail.com>\nAllen Sun <allen.sun@daocloud.io>\nalmoehi <almoehi@users.noreply.github.com>\nAlvin Richards <alvin.richards@docker.com>\namangoel <amangoel@gmail.com>\nAmen Belayneh <amenbelayneh@gmail.com>\nAmit Bakshi <ambakshi@gmail.com>\nAmit Krishnan <amit.krishnan@oracle.com>\nAmy Lindburg <amy.lindburg@docker.com>\nAnand Patil <anand.prabhakar.patil@gmail.com>\nAnandkumarPatel <anandkumarpatel@gmail.com>\nAnatoly Borodin <anatoly.borodin@gmail.com>\nAnchal Agrawal <aagrawa4@illinois.edu>\nAnders Janmyr <anders@janmyr.com>\nAndre Dublin <81dublin@gmail.com>\nAndre Granovsky <robotciti@live.com>\nAndrea Luzzardi <aluzzardi@gmail.com>\nAndrea Turli <andrea.turli@gmail.com>\nAndreas Köhler <andi5.py@gmx.net>\nAndreas Savvides <andreas@editd.com>\nAndreas Tiefenthaler <at@an-ti.eu>\nAndrew C. Bodine <acbodine@us.ibm.com>\nAndrew Clay Shafer <andrewcshafer@gmail.com>\nAndrew Duckworth <grillopress@gmail.com>\nAndrew France <andrew@avito.co.uk>\nAndrew Gerrand <adg@golang.org>\nAndrew Guenther <guenther.andrew.j@gmail.com>\nAndrew Kuklewicz <kookster@gmail.com>\nAndrew Macgregor <andrew.macgregor@agworld.com.au>\nAndrew Macpherson <hopscotch23@gmail.com>\nAndrew Martin <sublimino@gmail.com>\nAndrew Munsell <andrew@wizardapps.net>\nAndrew Weiss <andrew.weiss@outlook.com>\nAndrew Williams <williams.andrew@gmail.com>\nAndrews Medina <andrewsmedina@gmail.com>\nAndrey Petrov <andrey.petrov@shazow.net>\nAndrey Stolbovsky <andrey.stolbovsky@gmail.com>\nAndré Martins <aanm90@gmail.com>\nandy <ztao@tibco-support.com>\nAndy Chambers <anchambers@paypal.com>\nandy diller <dillera@gmail.com>\nAndy Goldstein <agoldste@redhat.com>\nAndy Kipp <andy@rstudio.com>\nAndy Rothfusz <github@developersupport.net>\nAndy Smith <github@anarkystic.com>\nAndy Wilson <wilson.andrew.j+github@gmail.com>\nAnes Hasicic <anes.hasicic@gmail.com>\nAnil Belur <askb23@gmail.com>\nAnkush Agarwal <ankushagarwal11@gmail.com>\nAnonmily <michelle@michelleliu.io>\nAnthon van der Neut <anthon@mnt.org>\nAnthony Baire <Anthony.Baire@irisa.fr>\nAnthony Bishopric <git@anthonybishopric.com>\nAnthony Dahanne <anthony.dahanne@gmail.com>\nAnton Löfgren <anton.lofgren@gmail.com>\nAnton Nikitin <anton.k.nikitin@gmail.com>\nAnton Polonskiy <anton.polonskiy@gmail.com>\nAnton Tiurin <noxiouz@yandex.ru>\nAntonio Murdaca <antonio.murdaca@gmail.com>\nAntony Messerli <amesserl@rackspace.com>\nAnuj Bahuguna <anujbahuguna.dev@gmail.com>\nAnusha Ragunathan <anusha.ragunathan@docker.com>\napocas <petermdias@gmail.com>\nArikaChen <eaglesora@gmail.com>\nArnaud Porterie <arnaud.porterie@docker.com>\nArthur Barr <arthur.barr@uk.ibm.com>\nArthur Gautier <baloo@gandi.net>\nArtur Meyster <arthurfbi@yahoo.com>\nArun Gupta <arun.gupta@gmail.com>\nAsbjørn Enge <asbjorn@hanafjedle.net>\naveragehuman <averagehuman@users.noreply.github.com>\nAvi Das <andas222@gmail.com>\nAvi Miller <avi.miller@oracle.com>\nayoshitake <airandfingers@gmail.com>\nAzat Khuyiyakhmetov <shadow_uz@mail.ru>\nBardia Keyoumarsi <bkeyouma@ucsc.edu>\nBarnaby Gray <barnaby@pickle.me.uk>\nBarry Allard <barry.allard@gmail.com>\nBartłomiej Piotrowski <b@bpiotrowski.pl>\nBastiaan Bakker <bbakker@xebia.com>\nbdevloed <boris.de.vloed@gmail.com>\nBen Firshman <ben@firshman.co.uk>\nBen Golub <ben.golub@dotcloud.com>\nBen Hall <ben@benhall.me.uk>\nBen Sargent <ben@brokendigits.com>\nBen Severson <BenSeverson@users.noreply.github.com>\nBen Toews <mastahyeti@gmail.com>\nBen Wiklund <ben@daisyowl.com>\nBenjamin Atkin <ben@benatkin.com>\nBenoit Chesneau <bchesneau@gmail.com>\nBernerd Schaefer <bj.schaefer@gmail.com>\nBert Goethals <bert@bertg.be>\nBharath Thiruveedula <bharath_ves@hotmail.com>\nBhiraj Butala <abhiraj.butala@gmail.com>\nBill W <SydOps@users.noreply.github.com>\nbin liu <liubin0329@users.noreply.github.com>\nBlake Geno <blakegeno@gmail.com>\nBoaz Shuster <ripcurld.github@gmail.com>\nbobby abbott <ttobbaybbob@gmail.com>\nboucher <rboucher@gmail.com>\nBouke Haarsma <bouke@webatoom.nl>\nBoyd Hemphill <boyd@feedmagnet.com>\nboynux <boynux@gmail.com>\nBradley Cicenas <bradley.cicenas@gmail.com>\nBradley Wright <brad@intranation.com>\nBrandon Liu <bdon@bdon.org>\nBrandon Philips <brandon@ifup.org>\nBrandon Rhodes <brandon@rhodesmill.org>\nBrendan Dixon <brendand@microsoft.com>\nBrent Salisbury <brent.salisbury@docker.com>\nBrett Higgins <brhiggins@arbor.net>\nBrett Kochendorfer <brett.kochendorfer@gmail.com>\nBrian (bex) Exelbierd <bexelbie@redhat.com>\nBrian Bland <brian.bland@docker.com>\nBrian DeHamer <brian@dehamer.com>\nBrian Dorsey <brian@dorseys.org>\nBrian Flad <bflad417@gmail.com>\nBrian Goff <cpuguy83@gmail.com>\nBrian McCallister <brianm@skife.org>\nBrian Olsen <brian@maven-group.org>\nBrian Shumate <brian@couchbase.com>\nBrian Torres-Gil <brian@dralth.com>\nBrian Trump <btrump@yelp.com>\nBrice Jaglin <bjaglin@teads.tv>\nBriehan Lombaard <briehan.lombaard@gmail.com>\nBruno Bigras <bigras.bruno@gmail.com>\nBruno Binet <bruno.binet@gmail.com>\nBruno Gazzera <bgazzera@paginar.com>\nBruno Renié <brutasse@gmail.com>\nBryan Bess <squarejaw@bsbess.com>\nBryan Boreham <bjboreham@gmail.com>\nBryan Matsuo <bryan.matsuo@gmail.com>\nBryan Murphy <bmurphy1976@gmail.com>\nbuddhamagnet <buddhamagnet@gmail.com>\nBurke Libbey <burke@libbey.me>\nByung Kang <byung.kang.ctr@amrdec.army.mil>\nCaleb Spare <cespare@gmail.com>\nCalen Pennington <cale@edx.org>\nCameron Boehmer <cameron.boehmer@gmail.com>\nCameron Spear <cameronspear@gmail.com>\nCampbell Allen <campbell.allen@gmail.com>\nCandid Dauth <cdauth@cdauth.eu>\nCarl Henrik Lunde <chlunde@ping.uio.no>\nCarl X. Su <bcbcarl@gmail.com>\nCarlos Alexandro Becker <caarlos0@gmail.com>\nCarlos Sanchez <carlos@apache.org>\nCarol Fager-Higgins <carol.fager-higgins@docker.com>\nCary <caryhartline@users.noreply.github.com>\nCasey Bisson <casey.bisson@joyent.com>\nCedric Davies <cedricda@microsoft.com>\nCezar Sa Espinola <cezarsa@gmail.com>\nChad Swenson <chadswen@gmail.com>\nChance Zibolski <chance.zibolski@gmail.com>\nChander G <chandergovind@gmail.com>\nCharles Chan <charleswhchan@users.noreply.github.com>\nCharles Hooper <charles.hooper@dotcloud.com>\nCharles Law <claw@conduce.com>\nCharles Lindsay <chaz@chazomatic.us>\nCharles Merriam <charles.merriam@gmail.com>\nCharles Sarrazin <charles@sarraz.in>\nCharlie Lewis <charliel@lab41.org>\nChase Bolt <chase.bolt@gmail.com>\nChaYoung You <yousbe@gmail.com>\nChen Chao <cc272309126@gmail.com>\nChen Hanxiao <chenhanxiao@cn.fujitsu.com>\ncheney90 <cheney-90@hotmail.com>\nChewey <prosto-chewey@users.noreply.github.com>\nChia-liang Kao <clkao@clkao.org>\nchli <chli@freewheel.tv>\nCholerae Hu <choleraehyq@gmail.com>\nChris Alfonso <calfonso@redhat.com>\nChris Armstrong <chris@opdemand.com>\nChris Dituri <csdituri@gmail.com>\nChris Fordham <chris@fordham-nagy.id.au>\nChris Khoo <chris.khoo@gmail.com>\nChris McKinnel <chrismckinnel@gmail.com>\nChris Seto <chriskseto@gmail.com>\nChris Snow <chsnow123@gmail.com>\nChris St. Pierre <chris.a.st.pierre@gmail.com>\nChris Stivers <chris@stivers.us>\nChris Swan <chris.swan@iee.org>\nChris Wahl <github@wahlnetwork.com>\nChris Weyl <cweyl@alumni.drew.edu>\nchrismckinnel <chris.mckinnel@tangentlabs.co.uk>\nChristian Berendt <berendt@b1-systems.de>\nChristian Böhme <developement@boehme3d.de>\nChristian Persson <saser@live.se>\nChristian Rotzoll <ch.rotzoll@gmail.com>\nChristian Simon <simon@swine.de>\nChristian Stefanescu <st.chris@gmail.com>\nChristoperBiscardi <biscarch@sketcht.com>\nChristophe Mehay <cmehay@online.net>\nChristophe Troestler <christophe.Troestler@umons.ac.be>\nChristopher Currie <codemonkey+github@gmail.com>\nChristopher Jones <tophj@linux.vnet.ibm.com>\nChristopher Latham <sudosurootdev@gmail.com>\nChristopher Rigor <crigor@gmail.com>\nChristy Perez <christy@linux.vnet.ibm.com>\nChun Chen <ramichen@tencent.com>\nCiro S. Costa <ciro.costa@usp.br>\nClayton Coleman <ccoleman@redhat.com>\nClinton Kitson <clintonskitson@gmail.com>\nCoenraad Loubser <coenraad@wish.org.za>\nColin Dunklau <colin.dunklau@gmail.com>\nColin Rice <colin@daedrum.net>\nColin Walters <walters@verbum.org>\nCollin Guarino <collin.guarino@gmail.com>\nColm Hally <colmhally@gmail.com>\ncompanycy <companycy@gmail.com>\nCory Forsyth <cory.forsyth@gmail.com>\ncressie176 <github@stephen-cresswell.net>\nCristian Staretu <cristian.staretu@gmail.com>\ncristiano balducci <cristiano.balducci@gmail.com>\nCruceru Calin-Cristian <crucerucalincristian@gmail.com>\nCyril F <cyrilf7x@gmail.com>\nDaan van Berkel <daan.v.berkel.1980@gmail.com>\nDaehyeok Mun <daehyeok@gmail.com>\nDafydd Crosby <dtcrsby@gmail.com>\ndalanlan <dalanlan925@gmail.com>\nDamien Nadé <github@livna.org>\nDamien Nozay <damien.nozay@gmail.com>\nDamjan Georgievski <gdamjan@gmail.com>\nDan Anolik <dan@anolik.net>\nDan Buch <d.buch@modcloth.com>\nDan Cotora <dan@bluevision.ro>\nDan Griffin <dgriffin@peer1.com>\nDan Hirsch <thequux@upstandinghackers.com>\nDan Keder <dan.keder@gmail.com>\nDan Levy <dan@danlevy.net>\nDan McPherson <dmcphers@redhat.com>\nDan Stine <sw@stinemail.com>\nDan Walsh <dwalsh@redhat.com>\nDan Williams <me@deedubs.com>\nDaniel Antlinger <d.antlinger@gmx.at>\nDaniel Exner <dex@dragonslave.de>\nDaniel Farrell <dfarrell@redhat.com>\nDaniel Garcia <daniel@danielgarcia.info>\nDaniel Gasienica <daniel@gasienica.ch>\nDaniel Hiltgen <daniel.hiltgen@docker.com>\nDaniel Menet <membership@sontags.ch>\nDaniel Mizyrycki <daniel.mizyrycki@dotcloud.com>\nDaniel Nephin <dnephin@docker.com>\nDaniel Norberg <dano@spotify.com>\nDaniel Nordberg <dnordberg@gmail.com>\nDaniel Robinson <gottagetmac@gmail.com>\nDaniel S <dan.streby@gmail.com>\nDaniel Von Fange <daniel@leancoder.com>\nDaniel YC Lin <dlin.tw@gmail.com>\nDaniel Zhang <jmzwcn@gmail.com>\nDaniel, Dao Quang Minh <dqminh@cloudflare.com>\nDanny Berger <dpb587@gmail.com>\nDanny Yates <danny@codeaholics.org>\nDarren Coxall <darren@darrencoxall.com>\nDarren Shepherd <darren.s.shepherd@gmail.com>\nDarren Stahl <darst@microsoft.com>\nDave Barboza <dbarboza@datto.com>\nDave Henderson <Dave.Henderson@ca.ibm.com>\nDave MacDonald <mindlapse@gmail.com>\nDave Tucker <dt@docker.com>\nDavid Anderson <dave@natulte.net>\nDavid Calavera <david.calavera@gmail.com>\nDavid Corking <dmc-source@dcorking.com>\nDavid Cramer <davcrame@cisco.com>\nDavid Currie <david_currie@uk.ibm.com>\nDavid Davis <daviddavis@redhat.com>\nDavid Gageot <david@gageot.net>\nDavid Gebler <davidgebler@gmail.com>\nDavid Lawrence <david.lawrence@docker.com>\nDavid Mackey <tdmackey@booleanhaiku.com>\nDavid Mat <david@davidmat.com>\nDavid Mcanulty <github@hellspark.com>\nDavid Pelaez <pelaez89@gmail.com>\nDavid R. Jenni <david.r.jenni@gmail.com>\nDavid Röthlisberger <david@rothlis.net>\nDavid Sheets <sheets@alum.mit.edu>\nDavid Sissitka <me@dsissitka.com>\nDavid Xia <dxia@spotify.com>\nDavid Young <yangboh@cn.ibm.com>\nDavide Ceretti <davide.ceretti@hogarthww.com>\nDawn Chen <dawnchen@google.com>\ndcylabs <dcylabs@gmail.com>\ndecadent <decadent@users.noreply.github.com>\ndeed02392 <georgehafiz@gmail.com>\nDeng Guangxing <dengguangxing@huawei.com>\nDeni Bertovic <deni@kset.org>\nDenis Gladkikh <denis@gladkikh.email>\nDenis Ollier <larchunix@users.noreply.github.com>\nDennis Docter <dennis@d23.nl>\nDerek <crq@kernel.org>\nDerek <crquan@gmail.com>\nDerek Ch <denc716@gmail.com>\nDerek McGowan <derek@mcgstyle.net>\nDeric Crago <deric.crago@gmail.com>\nDeshi Xiao <dxiao@redhat.com>\ndevmeyster <arthurfbi@yahoo.com>\nDevvyn Murphy <devvyn@devvyn.com>\nDharmit Shah <shahdharmit@gmail.com>\nDieter Reuter <dieter.reuter@me.com>\nDima Stopel <dima@twistlock.com>\nDimitri John Ledkov <dimitri.j.ledkov@intel.com>\nDimitry Andric <d.andric@activevideo.com>\nDinesh Subhraveti <dineshs@altiscale.com>\nDiogo Monica <diogo@docker.com>\nDiuDiugirl <sophia.wang@pku.edu.cn>\nDjibril Koné <kone.djibril@gmail.com>\ndkumor <daniel@dkumor.com>\nDmitri Logvinenko <dmitri.logvinenko@gmail.com>\nDmitry Demeshchuk <demeshchuk@gmail.com>\nDmitry Gusev <dmitry.gusev@gmail.com>\nDmitry V. Krivenok <krivenok.dmitry@gmail.com>\nDmitry Vorobev <dimahabr@gmail.com>\nDolph Mathews <dolph.mathews@gmail.com>\nDominik Finkbeiner <finkes93@gmail.com>\nDominik Honnef <dominik@honnef.co>\nDon Kirkby <donkirkby@users.noreply.github.com>\nDon Kjer <don.kjer@gmail.com>\nDon Spaulding <donspauldingii@gmail.com>\nDonald Huang <don.hcd@gmail.com>\nDong Chen <dongluo.chen@docker.com>\nDonovan Jones <git@gamma.net.nz>\nDoug Davis <dug@us.ibm.com>\nDoug MacEachern <dougm@vmware.com>\nDoug Tangren <d.tangren@gmail.com>\nDr Nic Williams <drnicwilliams@gmail.com>\ndragon788 <dragon788@users.noreply.github.com>\nDražen Lučanin <kermit666@gmail.com>\nDustin Sallings <dustin@spy.net>\nEd Costello <epc@epcostello.com>\nEdmund Wagner <edmund-wagner@web.de>\nEiichi Tsukata <devel@etsukata.com>\nEike Herzbach <eike@herzbach.net>\nEivind Uggedal <eivind@uggedal.com>\nElan Ruusamäe <glen@delfi.ee>\nElias Probst <mail@eliasprobst.eu>\nElijah Zupancic <elijah@zupancic.name>\neluck <mail@eluck.me>\nElvir Kuric <elvirkuric@gmail.com>\nEmil Hernvall <emil@quench.at>\nEmily Maier <emily@emilymaier.net>\nEmily Rose <emily@contactvibe.com>\nEmir Ozer <emirozer@yandex.com>\nEnguerran <engcolson@gmail.com>\nEohyung Lee <liquidnuker@gmail.com>\nEric Hanchrow <ehanchrow@ine.com>\nEric Lee <thenorthsecedes@gmail.com>\nEric Myhre <hash@exultant.us>\nEric Paris <eparis@redhat.com>\nEric Rafaloff <erafaloff@gmail.com>\nEric Rosenberg <ehaydenr@users.noreply.github.com>\nEric Sage <eric.david.sage@gmail.com>\nEric Windisch <eric@windisch.us>\nEric Yang <windfarer@gmail.com>\nEric-Olivier Lamey <eo@lamey.me>\nErik Bray <erik.m.bray@gmail.com>\nErik Dubbelboer <erik@dubbelboer.com>\nErik Hollensbe <github@hollensbe.org>\nErik Inge Bolsø <knan@redpill-linpro.com>\nErik Kristensen <erik@erikkristensen.com>\nErik Weathers <erikdw@gmail.com>\nErno Hopearuoho <erno.hopearuoho@gmail.com>\nErwin van der Koogh <info@erronis.nl>\nEuan <euank@amazon.com>\nEugene Yakubovich <eugene.yakubovich@coreos.com>\neugenkrizo <eugen.krizo@gmail.com>\nevalle <shmarnev@gmail.com>\nEvan Allrich <evan@unguku.com>\nEvan Carmi <carmi@users.noreply.github.com>\nEvan Hazlett <ejhazlett@gmail.com>\nEvan Krall <krall@yelp.com>\nEvan Phoenix <evan@fallingsnow.net>\nEvan Wies <evan@neomantra.net>\nEvgeny Vereshchagin <evvers@ya.ru>\nEwa Czechowska <ewa@ai-traders.com>\nEystein Måløy Stenberg <eystein.maloy.stenberg@cfengine.com>\nezbercih <cem.ezberci@gmail.com>\nFabiano Rosas <farosas@br.ibm.com>\nFabio Falci <fabiofalci@gmail.com>\nFabio Rehm <fgrehm@gmail.com>\nFabrizio Regini <freegenie@gmail.com>\nFabrizio Soppelsa <fsoppelsa@mirantis.com>\nFaiz Khan <faizkhan00@gmail.com>\nfalmp <chico.lopes@gmail.com>\nFangyuan Gao <21551127@zju.edu.cn>\nFareed Dudhia <fareeddudhia@googlemail.com>\nFathi Boudra <fathi.boudra@linaro.org>\nFederico Gimenez <fgimenez@coit.es>\nFelix Geisendörfer <felix@debuggable.com>\nFelix Hupfeld <quofelix@users.noreply.github.com>\nFelix Rabe <felix@rabe.io>\nFelix Schindler <fschindler@weluse.de>\nFerenc Szabo <pragmaticfrank@gmail.com>\nFernando <fermayo@gmail.com>\nFero Volar <alian@alian.info>\nFilipe Brandenburger <filbranden@google.com>\nFilipe Oliveira <contato@fmoliveira.com.br>\nfl0yd <fl0yd@me.com>\nFlavio Castelli <fcastelli@suse.com>\nFLGMwt <ryan.stelly@live.com>\nFlorian <FWirtz@users.noreply.github.com>\nFlorian Klein <florian.klein@free.fr>\nFlorian Maier <marsmensch@users.noreply.github.com>\nFlorian Weingarten <flo@hackvalue.de>\nFlorin Asavoaie <florin.asavoaie@gmail.com>\nFrancesc Campoy <campoy@google.com>\nFrancisco Carriedo <fcarriedo@gmail.com>\nFrancisco Souza <f@souza.cc>\nFrank Groeneveld <frank@ivaldi.nl>\nFrank Herrmann <fgh@4gh.tv>\nFrank Macreery <frank@macreery.com>\nFrank Rosquin <frank.rosquin+github@gmail.com>\nFred Lifton <fred.lifton@docker.com>\nFrederick F. Kautz IV <fkautz@redhat.com>\nFrederik Loeffert <frederik@zitrusmedia.de>\nFrederik Nordahl Jul Sabroe <frederikns@gmail.com>\nFreek Kalter <freek@kalteronline.org>\nfy2462 <fy2462@gmail.com>\nFélix Baylac-Jacqué <baylac.felix@gmail.com>\nFélix Cantournet <felix.cantournet@cloudwatt.com>\nGabe Rosenhouse <gabe@missionst.com>\nGabor Nagy <mail@aigeruth.hu>\nGabriel Monroy <gabriel@opdemand.com>\nGabrielNicolasAvellaneda <avellaneda.gabriel@gmail.com>\nGalen Sampson <galen.sampson@gmail.com>\nGareth Rushgrove <gareth@morethanseven.net>\nGarrett Barboza <garrett@garrettbarboza.com>\nGaurav <gaurav.gosec@gmail.com>\ngautam, prasanna <prasannagautam@gmail.com>\nGennadySpb <lipenkov@gmail.com>\nGeoffrey Bachelet <grosfrais@gmail.com>\nGeorge MacRorie <gmacr31@gmail.com>\nGeorge Xie <georgexsh@gmail.com>\nGeorgi Hristozov <georgi@forkbomb.nl>\nGereon Frey <gereon.frey@dynport.de>\nGerman DZ <germ@ndz.com.ar>\nGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>\nGianluca Borello <g.borello@gmail.com>\nGildas Cuisinier <gildas.cuisinier@gcuisinier.net>\ngissehel <public-devgit-dantus@gissehel.org>\nGiuseppe Mazzotta <gdm85@users.noreply.github.com>\nGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>\nGleb M Borisov <borisov.gleb@gmail.com>\nGlyn Normington <gnormington@gopivotal.com>\nGoBella <caili_welcome@163.com>\nGoffert van Gool <goffert@phusion.nl>\nGosuke Miyashita <gosukenator@gmail.com>\nGou Rao <gourao@users.noreply.github.com>\nGovinda Fichtner <govinda.fichtner@googlemail.com>\nGrant Reaber <grant.reaber@gmail.com>\nGraydon Hoare <graydon@pobox.com>\nGreg Fausak <greg@tacodata.com>\nGreg Thornton <xdissent@me.com>\ngrossws <grossws@gmail.com>\ngrunny <mwgrunny@gmail.com>\ngs11 <gustav.sinder@gmail.com>\nGuilhem Lettron <guilhem+github@lettron.fr>\nGuilherme Salgado <gsalgado@gmail.com>\nGuillaume Dufour <gdufour.prestataire@voyages-sncf.com>\nGuillaume J. Charmes <guillaume.charmes@docker.com>\nguoxiuyan <guoxiuyan@huawei.com>\nGurjeet Singh <gurjeet@singh.im>\nGuruprasad <lgp171188@gmail.com>\ngwx296173 <gaojing3@huawei.com>\nGünter Zöchbauer <guenter@gzoechbauer.com>\nHans Kristian Flaatten <hans@starefossen.com>\nHans Rødtang <hansrodtang@gmail.com>\nHao Shu Wei <haosw@cn.ibm.com>\nHao Zhang <21521210@zju.edu.cn>\nHarald Albers <github@albersweb.de>\nHarley Laue <losinggeneration@gmail.com>\nHarold Cooper <hrldcpr@gmail.com>\nHarry Zhang <harryzhang@zju.edu.cn>\nHe Simei <hesimei@zju.edu.cn>\nheartlock <21521209@zju.edu.cn>\nHector Castro <hectcastro@gmail.com>\nHenning Sprang <henning.sprang@gmail.com>\nHobofan <goisser94@gmail.com>\nHollie Teal <hollie@docker.com>\nHong Xu <hong@topbug.net>\nhsinko <21551195@zju.edu.cn>\nHu Keping <hukeping@huawei.com>\nHu Tao <hutao@cn.fujitsu.com>\nHuanzhong Zhang <zhanghuanzhong90@gmail.com>\nHuayi Zhang <irachex@gmail.com>\nHugo Duncan <hugo@hugoduncan.org>\nHugo Marisco <0x6875676f@gmail.com>\nHunter Blanks <hunter@twilio.com>\nhuqun <huqun@zju.edu.cn>\nHuu Nguyen <huu@prismskylabs.com>\nhyeongkyu.lee <hyeongkyu.lee@navercorp.com>\nhyp3rdino <markus.kortlang@lhsystems.com>\nHyzhou <1187766782@qq.com>\nIan Babrou <ibobrik@gmail.com>\nIan Bishop <ianbishop@pace7.com>\nIan Bull <irbull@gmail.com>\nIan Calvert <ianjcalvert@gmail.com>\nIan Lee <IanLee1521@gmail.com>\nIan Main <imain@redhat.com>\nIan Truslove <ian.truslove@gmail.com>\nIavael <iavaelooeyt@gmail.com>\nIcaro Seara <icaro.seara@gmail.com>\nIgor Dolzhikov <bluesriverz@gmail.com>\nIlkka Laukkanen <ilkka@ilkka.io>\nIlya Dmitrichenko <errordeveloper@gmail.com>\nIlya Gusev <mail@igusev.ru>\nILYA Khlopotov <ilya.khlopotov@gmail.com>\nimre Fitos <imre.fitos+github@gmail.com>\ninglesp <peter.inglesby@gmail.com>\nIngo Gottwald <in.gottwald@gmail.com>\nIsaac Dupree <antispam@idupree.com>\nIsabel Jimenez <contact.isabeljimenez@gmail.com>\nIsao Jonas <isao.jonas@gmail.com>\nIvan Babrou <ibobrik@gmail.com>\nIvan Fraixedes <ifcdev@gmail.com>\nIvan Grcic <igrcic@gmail.com>\nJ Bruni <joaohbruni@yahoo.com.br>\nJ. Nunn <jbnunn@gmail.com>\nJack Danger Canty <jackdanger@squareup.com>\nJacob Atzen <jacob@jacobatzen.dk>\nJacob Edelman <edelman.jd@gmail.com>\nJake Champlin <jake.champlin.27@gmail.com>\nJake Moshenko <jake@devtable.com>\njakedt <jake@devtable.com>\nJames Allen <jamesallen0108@gmail.com>\nJames Carey <jecarey@us.ibm.com>\nJames Carr <james.r.carr@gmail.com>\nJames DeFelice <james.defelice@ishisystems.com>\nJames Harrison Fisher <jameshfisher@gmail.com>\nJames Kyburz <james.kyburz@gmail.com>\nJames Kyle <james@jameskyle.org>\nJames Lal <james@lightsofapollo.com>\nJames Mills <prologic@shortcircuit.net.au>\nJames Nugent <james@jen20.com>\nJames Turnbull <james@lovedthanlost.net>\nJamie Hannaford <jamie.hannaford@rackspace.com>\nJamshid Afshar <jafshar@yahoo.com>\nJan Keromnes <janx@linux.com>\nJan Koprowski <jan.koprowski@gmail.com>\nJan Pazdziora <jpazdziora@redhat.com>\nJan Toebes <jan@toebes.info>\nJan-Gerd Tenberge <janten@gmail.com>\nJan-Jaap Driessen <janjaapdriessen@gmail.com>\nJana Radhakrishnan <mrjana@docker.com>\nJanuar Wayong <januar@gmail.com>\nJared Biel <jared.biel@bolderthinking.com>\nJared Hocutt <jaredh@netapp.com>\nJaroslaw Zabiello <hipertracker@gmail.com>\njaseg <jaseg@jaseg.net>\nJasmine Hegman <jasmine@jhegman.com>\nJason Divock <jdivock@gmail.com>\nJason Giedymin <jasong@apache.org>\nJason Green <Jason.Green@AverInformatics.Com>\nJason Hall <imjasonh@gmail.com>\nJason Heiss <jheiss@aput.net>\nJason Livesay <ithkuil@gmail.com>\nJason McVetta <jason.mcvetta@gmail.com>\nJason Plum <jplum@devonit.com>\nJason Shepherd <jason@jasonshepherd.net>\nJason Smith <jasonrichardsmith@gmail.com>\nJason Sommer <jsdirv@gmail.com>\nJason Stangroome <jason@codeassassin.com>\njaxgeller <jacksongeller@gmail.com>\nJay <imjching@hotmail.com>\nJay <teguhwpurwanto@gmail.com>\nJay Kamat <github@jgkamat.33mail.com>\nJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>\nJean-Baptiste Dalido <jeanbaptiste@appgratis.com>\nJean-Paul Calderone <exarkun@twistedmatrix.com>\nJean-Tiare Le Bigot <jt@yadutaf.fr>\nJeff Anderson <jeff@docker.com>\nJeff Johnston <jeff.johnston.mn@gmail.com>\nJeff Lindsay <progrium@gmail.com>\nJeff Mickey <j@codemac.net>\nJeff Minard <jeff@creditkarma.com>\nJeff Nickoloff <jeff.nickoloff@gmail.com>\nJeff Welch <whatthejeff@gmail.com>\nJeffrey Bolle <jeffreybolle@gmail.com>\nJeffrey Morgan <jmorganca@gmail.com>\nJeffrey van Gogh <jvg@google.com>\nJenny Gebske <jennifer@gebske.de>\nJeremy Grosser <jeremy@synack.me>\nJeremy Price <jprice.rhit@gmail.com>\nJeremy Qian <vanpire110@163.com>\nJeremy Unruh <jeremybunruh@gmail.com>\nJeroen Jacobs <github@jeroenj.be>\nJesse Dearing <jesse.dearing@gmail.com>\nJesse Dubay <jesse@thefortytwo.net>\nJessica Frazelle <jess@mesosphere.com>\nJezeniel Zapanta <jpzapanta22@gmail.com>\njgeiger <jgeiger@gmail.com>\nJhon Honce <jhonce@redhat.com>\nJian Zhang <zhangjian.fnst@cn.fujitsu.com>\njianbosun <wonderflow.sun@gmail.com>\nJilles Oldenbeuving <ojilles@gmail.com>\nJim Alateras <jima@comware.com.au>\nJim Perrin <jperrin@centos.org>\nJimmy Cuadra <jimmy@jimmycuadra.com>\nJimmy Puckett <jimmy.puckett@spinen.com>\njimmyxian <jimmyxian2004@yahoo.com.cn>\nJinsoo Park <cellpjs@gmail.com>\nJiri Popelka <jpopelka@redhat.com>\nJiří Župka <jzupka@redhat.com>\njjy <jiangjinyang@outlook.com>\njmzwcn <jmzwcn@gmail.com>\nJoe Beda <joe.github@bedafamily.com>\nJoe Doliner <jdoliner@pachyderm.io>\nJoe Ferguson <joe@infosiftr.com>\nJoe Gordon <joe.gordon0@gmail.com>\nJoe Shaw <joe@joeshaw.org>\nJoe Van Dyk <joe@tanga.com>\nJoel Friedly <joelfriedly@gmail.com>\nJoel Handwell <joelhandwell@gmail.com>\nJoel Hansson <joel.hansson@ecraft.com>\nJoel Wurtz <jwurtz@jolicode.com>\nJoey Geiger <jgeiger@users.noreply.github.com>\nJoey Gibson <joey@joeygibson.com>\nJoffrey F <joffrey@docker.com>\nJohan Euphrosine <proppy@google.com>\nJohan Rydberg <johan.rydberg@gmail.com>\nJohannes 'fish' Ziemke <github@freigeist.org>\nJohn Costa <john.costa@gmail.com>\nJohn Feminella <jxf@jxf.me>\nJohn Gardiner Myers <jgmyers@proofpoint.com>\nJohn Gossman <johngos@microsoft.com>\nJohn Howard (VM) <John.Howard@microsoft.com>\nJohn OBrien III <jobrieniii@yahoo.com>\nJohn Starks <jostarks@microsoft.com>\nJohn Tims <john.k.tims@gmail.com>\nJohn Warwick <jwarwick@gmail.com>\nJohn Willis <john.willis@docker.com>\nJon Wedaman <jweede@gmail.com>\nJonas Pfenniger <jonas@pfenniger.name>\nJonathan A. Sternberg <jonathansternberg@gmail.com>\nJonathan Boulle <jonathanboulle@gmail.com>\nJonathan Camp <jonathan@irondojo.com>\nJonathan Dowland <jon+github@alcopop.org>\nJonathan Lebon <jlebon@redhat.com>\nJonathan McCrohan <jmccrohan@gmail.com>\nJonathan Mueller <j.mueller@apoveda.ch>\nJonathan Pares <jonathanpa@users.noreply.github.com>\nJonathan Rudenberg <jonathan@titanous.com>\nJoost Cassee <joost@cassee.net>\nJordan <jjn2009@users.noreply.github.com>\nJordan Arentsen <blissdev@gmail.com>\nJordan Sissel <jls@semicomplete.com>\nJordan Williams <jordan@jwillikers.com>\nJose Diaz-Gonzalez <josegonzalez@users.noreply.github.com>\nJoseph Anthony Pasquale Holsten <joseph@josephholsten.com>\nJoseph Hager <ajhager@gmail.com>\nJoseph Kern <jkern@semafour.net>\nJosh <jokajak@gmail.com>\nJosh Hawn <josh.hawn@docker.com>\nJosh Poimboeuf <jpoimboe@redhat.com>\nJosiah Kiehl <jkiehl@riotgames.com>\nJosé Tomás Albornoz <jojo@eljojo.net>\nJP <jpellerin@leapfrogonline.com>\njrabbit <jackjrabbit@gmail.com>\nJulian Taylor <jtaylor.debian@googlemail.com>\nJulien Barbier <write0@gmail.com>\nJulien Bisconti <veggiemonk@users.noreply.github.com>\nJulien Bordellier <julienbordellier@gmail.com>\nJulien Dubois <julien.dubois@gmail.com>\nJulien Pervillé <julien.perville@perfect-memory.com>\nJulio Montes <imc.coder@gmail.com>\nJun-Ru Chang <jrjang@gmail.com>\nJussi Nummelin <jussi.nummelin@gmail.com>\nJustas Brazauskas <brazauskasjustas@gmail.com>\nJustin Cormack <justin.cormack@docker.com>\nJustin Force <justin.force@gmail.com>\nJustin Plock <jplock@users.noreply.github.com>\nJustin Simonelis <justin.p.simonelis@gmail.com>\nJustin Terry <juterry@microsoft.com>\nJyrki Puttonen <jyrkiput@gmail.com>\nJérôme Petazzoni <jerome.petazzoni@dotcloud.com>\nJörg Thalheim <joerg@higgsboson.tk>\nKai Blin <kai@samba.org>\nKai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>\nKamil Domański <kamil@domanski.co>\nkamjar gerami <kami.gerami@gmail.com>\nKanstantsin Shautsou <kanstantsin.sha@gmail.com>\nKaran Lyons <karan@karanlyons.com>\nKareem Khazem <karkhaz@karkhaz.com>\nkargakis <kargakis@users.noreply.github.com>\nKarl Grzeszczak <karlgrz@gmail.com>\nKarol Duleba <mr.fuxi@gmail.com>\nKatie McLaughlin <katie@glasnt.com>\nKato Kazuyoshi <kato.kazuyoshi@gmail.com>\nKatrina Owen <katrina.owen@gmail.com>\nKawsar Saiyeed <kawsar.saiyeed@projiris.com>\nkayrus <kay.diam@gmail.com>\nKe Xu <leonhartx.k@gmail.com>\nKeli Hu <dev@keli.hu>\nKen Cochrane <kencochrane@gmail.com>\nKen ICHIKAWA <ichikawa.ken@jp.fujitsu.com>\nKenfe-Mickael Laventure <mickael.laventure@gmail.com>\nKenjiro Nakayama <nakayamakenjiro@gmail.com>\nKent Johnson <kentoj@gmail.com>\nKevin \"qwazerty\" Houdebert <kevin.houdebert@gmail.com>\nKevin Clark <kevin.clark@gmail.com>\nKevin J. Lynagh <kevin@keminglabs.com>\nKevin Menard <kevin@nirvdrum.com>\nKevin P. Kucharczyk <kevinkucharczyk@gmail.com>\nKevin Shi <kshi@andrew.cmu.edu>\nKevin Wallace <kevin@pentabarf.net>\nKevin Yap <me@kevinyap.ca>\nkevinmeredith <kevin.m.meredith@gmail.com>\nKeyvan Fatehi <keyvanfatehi@gmail.com>\nkies <lleelm@gmail.com>\nKim BKC Carlbacker <kim.carlbacker@gmail.com>\nKim Eik <kim@heldig.org>\nKimbro Staken <kstaken@kstaken.com>\nKir Kolyshkin <kir@openvz.org>\nKiran Gangadharan <kiran.daredevil@gmail.com>\nKirill SIbirev <l0kix2@gmail.com>\nknappe <tyler.knappe@gmail.com>\nKohei Tsuruta <coheyxyz@gmail.com>\nKoichi Shiraishi <k@zchee.io>\nKonrad Kleine <konrad.wilhelm.kleine@gmail.com>\nKonstantin Pelykh <kpelykh@zettaset.com>\nKrasimir Georgiev <support@vip-consult.co.uk>\nKristian Haugene <kristian.haugene@capgemini.com>\nKristina Zabunova <triara.xiii@gmail.com>\nkrrg <krrgithub@gmail.com>\nKun Zhang <zkazure@gmail.com>\nKunal Kushwaha <kunal.kushwaha@gmail.com>\nKyle Conroy <kyle.j.conroy@gmail.com>\nkyu <leehk1227@gmail.com>\nLachlan Coote <lcoote@vmware.com>\nLai Jiangshan <jiangshanlai@gmail.com>\nLajos Papp <lajos.papp@sequenceiq.com>\nLakshan Perera <lakshan@laktek.com>\nLalatendu Mohanty <lmohanty@redhat.com>\nlalyos <lalyos@yahoo.com>\nLance Chen <cyen0312@gmail.com>\nLance Kinley <lkinley@loyaltymethods.com>\nLars Butler <Lars.Butler@gmail.com>\nLars Kellogg-Stedman <lars@redhat.com>\nLars R. Damerow <lars@pixar.com>\nLaszlo Meszaros <lacienator@gmail.com>\nLaurent Erignoux <lerignoux@gmail.com>\nLaurie Voss <github@seldo.com>\nLeandro Siqueira <leandro.siqueira@gmail.com>\nLee, Meng-Han <sunrisedm4@gmail.com>\nleeplay <hyeongkyu.lee@navercorp.com>\nLei Jitang <leijitang@huawei.com>\nLen Weincier <len@cloudafrica.net>\nLennie <github@consolejunkie.net>\nLeszek Kowalski <github@leszekkowalski.pl>\nLevi Blackstone <levi.blackstone@rackspace.com>\nLevi Gross <levi@levigross.com>\nLewis Marshall <lewis@lmars.net>\nLewis Peckover <lew+github@lew.io>\nLiana Lo <liana.lixia@gmail.com>\nLiang Mingqiang <mqliang.zju@gmail.com>\nLiang-Chi Hsieh <viirya@gmail.com>\nliaoqingwei <liaoqingwei@huawei.com>\nlimsy <seongyeol37@gmail.com>\nLin Lu <doraalin@163.com>\nLingFaKe <lingfake@huawei.com>\nLinus Heckemann <lheckemann@twig-world.com>\nLiran Tal <liran.tal@gmail.com>\nLiron Levin <liron@twistlock.com>\nLiu Bo <bo.li.liu@oracle.com>\nLiu Hua <sdu.liu@huawei.com>\nLIZAO LI <lzlarryli@gmail.com>\nLloyd Dewolf <foolswisdom@gmail.com>\nLokesh Mandvekar <lsm5@fedoraproject.org>\nlongliqiang88 <394564827@qq.com>\nLorenz Leutgeb <lorenz.leutgeb@gmail.com>\nLorenzo Fontana <fontanalorenzo@me.com>\nLouis Opter <kalessin@kalessin.fr>\nLuca Marturana <lucamarturana@gmail.com>\nLuca Orlandi <luca.orlandi@gmail.com>\nLuca-Bogdan Grigorescu <Luca-Bogdan Grigorescu>\nLucas Chan <lucas-github@lucaschan.com>\nLuis Martínez de Bartolomé Izquierdo <lmartinez@biicode.com>\nLukas Waslowski <cr7pt0gr4ph7@gmail.com>\nlukaspustina <lukas.pustina@centerdevice.com>\nLukasz Zajaczkowski <Lukasz.Zajaczkowski@ts.fujitsu.com>\nlukemarsden <luke@digital-crocus.com>\nLynda O'Leary <lyndaoleary29@gmail.com>\nLénaïc Huard <lhuard@amadeus.com>\nMa Shimiao <mashimiao.fnst@cn.fujitsu.com>\nMabin <bin.ma@huawei.com>\nMadhav Puri <madhav.puri@gmail.com>\nMadhu Venugopal <madhu@socketplane.io>\nMageee <21521230.zju.edu.cn>\nMahesh Tiyyagura <tmahesh@gmail.com>\nmalnick <malnick@gmail..com>\nMalte Janduda <mail@janduda.net>\nmanchoz <giampaolo@trampolineup.com>\nManfred Touron <m@42.am>\nManfred Zabarauskas <manfredas@zabarauskas.com>\nmansinahar <mansinahar@users.noreply.github.com>\nManuel Meurer <manuel@krautcomputing.com>\nManuel Woelker <github@manuel.woelker.org>\nmapk0y <mapk0y@gmail.com>\nMarc Abramowitz <marc@marc-abramowitz.com>\nMarc Kuo <kuomarc2@gmail.com>\nMarc Tamsky <mtamsky@gmail.com>\nMarcelo Salazar <chelosalazar@gmail.com>\nMarco Hennings <marco.hennings@freiheit.com>\nMarcus Farkas <toothlessgear@finitebox.com>\nMarcus Linke <marcus.linke@gmx.de>\nMarcus Ramberg <marcus@nordaaker.com>\nMarek Goldmann <marek.goldmann@gmail.com>\nMarian Marinov <mm@yuhu.biz>\nMarianna Tessel <mtesselh@gmail.com>\nMario Loriedo <mario.loriedo@gmail.com>\nMarius Gundersen <me@mariusgundersen.net>\nMarius Sturm <marius@graylog.com>\nMarius Voila <marius.voila@gmail.com>\nMark Allen <mrallen1@yahoo.com>\nMark McGranaghan <mmcgrana@gmail.com>\nMark McKinstry <mmckinst@umich.edu>\nMark West <markewest@gmail.com>\nMarko Mikulicic <mmikulicic@gmail.com>\nMarko Tibold <marko@tibold.nl>\nMarkus Fix <lispmeister@gmail.com>\nMartijn Dwars <ikben@martijndwars.nl>\nMartijn van Oosterhout <kleptog@svana.org>\nMartin Honermeyer <maze@strahlungsfrei.de>\nMartin Kelly <martin@surround.io>\nMartin Mosegaard Amdisen <martin.amdisen@praqma.com>\nMartin Redmond <redmond.martin@gmail.com>\nMary Anthony <mary.anthony@docker.com>\nMasahito Zembutsu <zembutsu@users.noreply.github.com>\nMason Malone <mason.malone@gmail.com>\nMateusz Sulima <sulima.mateusz@gmail.com>\nMathias Monnerville <mathias@monnerville.com>\nMathieu Le Marec - Pasquet <kiorky@cryptelium.net>\nMatt Apperson <me@mattapperson.com>\nMatt Bachmann <bachmann.matt@gmail.com>\nMatt Bentley <matt.bentley@docker.com>\nMatt Haggard <haggardii@gmail.com>\nMatt McCormick <matt.mccormick@kitware.com>\nMatt Moore <mattmoor@google.com>\nMatt Robenolt <matt@ydekproductions.com>\nMatthew Heon <mheon@redhat.com>\nMatthew Mayer <matthewkmayer@gmail.com>\nMatthew Mueller <mattmuelle@gmail.com>\nMatthew Riley <mattdr@google.com>\nMatthias Klumpp <matthias@tenstral.net>\nMatthias Kühnle <git.nivoc@neverbox.com>\nMatthias Rampke <mr@soundcloud.com>\nMatthieu Hauglustaine <matt.hauglustaine@gmail.com>\nmattymo <raytrac3r@gmail.com>\nmattyw <mattyw@me.com>\nMauricio Garavaglia <mauriciogaravaglia@gmail.com>\nmauriyouth <mauriyouth@gmail.com>\nMax Shytikov <mshytikov@gmail.com>\nMaxim Ivanov <ivanov.maxim@gmail.com>\nMaxim Kulkin <mkulkin@mirantis.com>\nMaxim Treskin <zerthurd@gmail.com>\nMaxime Petazzoni <max@signalfuse.com>\nMeaglith Ma <genedna@gmail.com>\nmeejah <meejah@meejah.ca>\nMegan Kostick <mkostick@us.ibm.com>\nMehul Kar <mehul.kar@gmail.com>\nMengdi Gao <usrgdd@gmail.com>\nMert Yazıcıoğlu <merty@users.noreply.github.com>\nMicah Zoltu <micah@newrelic.com>\nMichael A. Smith <michael@smith-li.com>\nMichael Bridgen <mikeb@squaremobius.net>\nMichael Brown <michael@netdirect.ca>\nMichael Chiang <mchiang@docker.com>\nMichael Crosby <michael@docker.com>\nMichael Currie <mcurrie@bruceforceresearch.com>\nMichael Friis <friism@gmail.com>\nMichael Gorsuch <gorsuch@github.com>\nMichael Grauer <michael.grauer@kitware.com>\nMichael Holzheu <holzheu@linux.vnet.ibm.com>\nMichael Hudson-Doyle <michael.hudson@linaro.org>\nMichael Huettermann <michael@huettermann.net>\nMichael Käufl <docker@c.michael-kaeufl.de>\nMichael Neale <michael.neale@gmail.com>\nMichael Prokop <github@michael-prokop.at>\nMichael Scharf <github@scharf.gr>\nMichael Stapelberg <michael+gh@stapelberg.de>\nMichael Steinert <mike.steinert@gmail.com>\nMichael Thies <michaelthies78@gmail.com>\nMichael West <mwest@mdsol.com>\nMichal Fojtik <mfojtik@redhat.com>\nMichal Gebauer <mishak@mishak.net>\nMichal Jemala <michal.jemala@gmail.com>\nMichal Minar <miminar@redhat.com>\nMichaël Pailloncy <mpapo.dev@gmail.com>\nMichał Czeraszkiewicz <czerasz@gmail.com>\nMichiel@unhosted <michiel@unhosted.org>\nMiguel Angel Fernández <elmendalerenda@gmail.com>\nMiguel Morales <mimoralea@gmail.com>\nMihai Borobocea <MihaiBorob@gmail.com>\nMihuleacc Sergiu <mihuleac.sergiu@gmail.com>\nMike Brown <brownwm@us.ibm.com>\nMike Chelen <michael.chelen@gmail.com>\nMike Danese <mikedanese@google.com>\nMike Dillon <mike@embody.org>\nMike Dougherty <mike.dougherty@docker.com>\nMike Gaffney <mike@uberu.com>\nMike Goelzer <mgoelzer@docker.com>\nMike Leone <mleone896@gmail.com>\nMike MacCana <mike.maccana@gmail.com>\nMike Naberezny <mike@naberezny.com>\nMike Snitzer <snitzer@redhat.com>\nmikelinjie <294893458@qq.com>\nMikhail Sobolev <mss@mawhrin.net>\nMiloslav Trmač <mitr@redhat.com>\nmingqing <limingqing@cyou-inc.com>\nMingzhen Feng <fmzhen@zju.edu.cn>\nMitch Capper <mitch.capper@gmail.com>\nmlarcher <github@ringabell.org>\nMohammad Banikazemi <mb@us.ibm.com>\nMohammed Aaqib Ansari <maaquib@gmail.com>\nMohit Soni <mosoni@ebay.com>\nMorgan Bauer <mbauer@us.ibm.com>\nMorgante Pell <morgante.pell@morgante.net>\nMorgy93 <thomas@ulfertsprygoda.de>\nMorten Siebuhr <sbhr@sbhr.dk>\nMorton Fox <github@qslw.com>\nMoysés Borges <moysesb@gmail.com>\nmqliang <mqliang.zju@gmail.com>\nMrunal Patel <mrunalp@gmail.com>\nmsabansal <sabansal@microsoft.com>\nmschurenko <matt.schurenko@gmail.com>\nmuge <stevezhang2014@gmail.com>\nMustafa Akın <mustafa91@gmail.com>\nMuthukumar R <muthur@gmail.com>\nMáximo Cuadros <mcuadros@gmail.com>\nMédi-Rémi Hashim <medimatrix@users.noreply.github.com>\nNahum Shalman <nshalman@omniti.com>\nNakul Pathak <nakulpathak3@hotmail.com>\nNalin Dahyabhai <nalin@redhat.com>\nNan Monnand Deng <monnand@gmail.com>\nNaoki Orii <norii@cs.cmu.edu>\nNatalie Parker <nparker@omnifone.com>\nNatanael Copa <natanael.copa@docker.com>\nNate Brennand <nate.brennand@clever.com>\nNate Eagleson <nate@nateeag.com>\nNate Jones <nate@endot.org>\nNathan Hsieh <hsieh.nathan@gmail.com>\nNathan Kleyn <nathan@nathankleyn.com>\nNathan LeClaire <nathan.leclaire@docker.com>\nNathan McCauley <nathan.mccauley@docker.com>\nNathan Williams <nathan@teamtreehouse.com>\nNeal McBurnett <neal@mcburnett.org>\nNelson Chen <crazysim@gmail.com>\nNghia Tran <nghia@google.com>\nNiall O'Higgins <niallo@unworkable.org>\nNicholas E. Rabenau <nerab@gmx.at>\nNick Irvine <nfirvine@nfirvine.com>\nNick Parker <nikaios@gmail.com>\nNick Payne <nick@kurai.co.uk>\nNick Stenning <nick.stenning@digital.cabinet-office.gov.uk>\nNick Stinemates <nick@stinemates.org>\nNicolas Borboën <ponsfrilus@users.noreply.github.com>\nNicolas De loof <nicolas.deloof@gmail.com>\nNicolas Dudebout <nicolas.dudebout@gatech.edu>\nNicolas Goy <kuon@goyman.com>\nNicolas Kaiser <nikai@nikai.net>\nNicolás Hock Isaza <nhocki@gmail.com>\nNigel Poulton <nigelpoulton@hotmail.com>\nNikolaMandic <mn080202@gmail.com>\nnikolas <nnyby@columbia.edu>\nNirmal Mehta <nirmalkmehta@gmail.com>\nNishant Totla <nishanttotla@gmail.com>\nNIWA Hideyuki <niwa.niwa@nifty.ne.jp>\nnoducks <onemannoducks@gmail.com>\nNolan Darilek <nolan@thewordnerd.info>\nnponeccop <andy.melnikov@gmail.com>\nNuutti Kotivuori <naked@iki.fi>\nnzwsch <hi@nzwsch.com>\nO.S. Tezer <ostezer@gmail.com>\nobjectified <objectified@gmail.com>\nOddBloke <daniel@daniel-watkins.co.uk>\nodk- <github@odkurzacz.org>\nOguz Bilgic <fisyonet@gmail.com>\nOh Jinkyun <tintypemolly@gmail.com>\nOhad Schneider <ohadschn@users.noreply.github.com>\nOle Reifschneider <mail@ole-reifschneider.de>\nOliver Neal <ItsVeryWindy@users.noreply.github.com>\nOlivier Gambier <dmp42@users.noreply.github.com>\nOlle Jonsson <olle.jonsson@gmail.com>\nOriol Francès <oriolfa@gmail.com>\nOtto Kekäläinen <otto@seravo.fi>\noyld <oyld0210@163.com>\nozlerhakan <hakan.ozler@kodcu.com>\npaetling <paetling@gmail.com>\npandrew <letters@paulnotcom.se>\npanticz <mail@konczalski.de>\nPaolo G. Giarrusso <p.giarrusso@gmail.com>\nPascal Borreli <pascal@borreli.com>\nPascal Hartig <phartig@rdrei.net>\nPatrick Devine <patrick.devine@docker.com>\nPatrick Hemmer <patrick.hemmer@gmail.com>\nPatrick Stapleton <github@gdi2290.com>\npattichen <craftsbear@gmail.com>\nPaul <paul9869@gmail.com>\npaul <paul@inkling.com>\nPaul Annesley <paul@annesley.cc>\nPaul Bellamy <paul.a.bellamy@gmail.com>\nPaul Bowsher <pbowsher@globalpersonals.co.uk>\nPaul Hammond <paul@paulhammond.org>\nPaul Jimenez <pj@place.org>\nPaul Lietar <paul@lietar.net>\nPaul Liljenberg <liljenberg.paul@gmail.com>\nPaul Morie <pmorie@gmail.com>\nPaul Nasrat <pnasrat@gmail.com>\nPaul Weaver <pauweave@cisco.com>\nPavel Lobashov <ShockwaveNN@gmail.com>\nPavel Pospisil <pospispa@gmail.com>\nPavel Sutyrin <pavel.sutyrin@gmail.com>\nPavel Tikhomirov <ptikhomirov@parallels.com>\nPavlos Ratis <dastergon@gentoo.org>\nPeeyush Gupta <gpeeyush@linux.vnet.ibm.com>\nPeggy Li <peggyli.224@gmail.com>\nPei Su <sillyousu@gmail.com>\nPenghan Wang <ph.wang@daocloud.io>\nperhapszzy@sina.com <perhapszzy@sina.com>\nPeter Bourgon <peter@bourgon.org>\nPeter Braden <peterbraden@peterbraden.co.uk>\nPeter Choi <reikani@Peters-MacBook-Pro.local>\nPeter Dave Hello <PeterDaveHello@users.noreply.github.com>\nPeter Edge <peter.edge@gmail.com>\nPeter Ericson <pdericson@gmail.com>\nPeter Esbensen <pkesbensen@gmail.com>\nPeter Malmgren <ptmalmgren@gmail.com>\nPeter Salvatore <peter@psftw.com>\nPeter Volpe <petervo@redhat.com>\nPeter Waller <p@pwaller.net>\nPhil <underscorephil@gmail.com>\nPhil Estes <estesp@linux.vnet.ibm.com>\nPhil Spitler <pspitler@gmail.com>\nPhilip Monroe <phil@philmonroe.com>\nPhilipp Wahala <philipp.wahala@gmail.com>\nPhilipp Weissensteiner <mail@philippweissensteiner.com>\nPhillip Alexander <git@phillipalexander.io>\npidster <pid@pidster.com>\nPiergiuliano Bossi <pgbossi@gmail.com>\nPierre <py@poujade.org>\nPierre Carrier <pierre@meteor.com>\nPierre Wacrenier <pierre.wacrenier@gmail.com>\nPierre-Alain RIVIERE <pariviere@ippon.fr>\nPiotr Bogdan <ppbogdan@gmail.com>\npixelistik <pixelistik@users.noreply.github.com>\nPorjo <porjo38@yahoo.com.au>\nPoul Kjeldager Sørensen <pks@s-innovations.net>\nPradeep Chhetri <pradeep@indix.com>\nPrasanna Gautam <prasannagautam@gmail.com>\nPrayag Verma <prayag.verma@gmail.com>\nPrzemek Hejman <przemyslaw.hejman@gmail.com>\npysqz <randomq@126.com>\nqg <1373319223@qq.com>\nqhuang <h.huangqiang@huawei.com>\nQiang Huang <h.huangqiang@huawei.com>\nqq690388648 <690388648@qq.com>\nQuentin Brossard <qbrossard@gmail.com>\nQuentin Perez <qperez@ocs.online.net>\nQuentin Tayssier <qtayssier@gmail.com>\nr0n22 <cameron.regan@gmail.com>\nRafal Jeczalik <rjeczalik@gmail.com>\nRafe Colton <rafael.colton@gmail.com>\nRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>\nRaghuram Devarakonda <draghuram@gmail.com>\nRajat Pandit <rp@rajatpandit.com>\nRajdeep Dua <dua_rajdeep@yahoo.com>\nRalle <spam@rasmusa.net>\nRalph Bean <rbean@redhat.com>\nRamkumar Ramachandra <artagnon@gmail.com>\nRamon van Alteren <ramon@vanalteren.nl>\nRay Tsang <saturnism@users.noreply.github.com>\nReadmeCritic <frankensteinbot@gmail.com>\nRecursive Madman <recursive.madman@gmx.de>\nRegan McCooey <rmccooey27@aol.com>\nRemi Rampin <remirampin@gmail.com>\nRenato Riccieri Santos Zannon <renato.riccieri@gmail.com>\nresouer <resouer@163.com>\nrgstephens <greg@udon.org>\nRhys Hiltner <rhys@twitch.tv>\nRich Seymour <rseymour@gmail.com>\nRichard <richard.scothern@gmail.com>\nRichard Burnison <rburnison@ebay.com>\nRichard Harvey <richard@squarecows.com>\nRichard Metzler <richard@paadee.com>\nRichard Scothern <richard.scothern@gmail.com>\nRicho Healey <richo@psych0tik.net>\nRick Bradley <rick@users.noreply.github.com>\nRick van de Loo <rickvandeloo@gmail.com>\nRick Wieman <git@rickw.nl>\nRik Nijessen <rik@keefo.nl>\nRiku Voipio <riku.voipio@linaro.org>\nRiley Guerin <rileytg.dev@gmail.com>\nRitesh H Shukla <sritesh@vmware.com>\nRiyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>\nRob Vesse <rvesse@dotnetrdf.org>\nRobert Bachmann <rb@robertbachmann.at>\nRobert Bittle <guywithnose@gmail.com>\nRobert Obryk <robryk@gmail.com>\nRobert Stern <lexandro2000@gmail.com>\nRobert Wallis <smilingrob@gmail.com>\nRoberto G. Hashioka <roberto.hashioka@docker.com>\nRobin Naundorf <r.naundorf@fh-muenster.de>\nRobin Schneider <ypid@riseup.net>\nRobin Speekenbrink <robin@kingsquare.nl>\nrobpc <rpcann@gmail.com>\nRodolfo Carvalho <rhcarvalho@gmail.com>\nRodrigo Vaz <rodrigo.vaz@gmail.com>\nRoel Van Nyen <roel.vannyen@gmail.com>\nRoger Peppe <rogpeppe@gmail.com>\nRohit Jnagal <jnagal@google.com>\nRohit Kadam <rohit.d.kadam@gmail.com>\nRoland Huß <roland@jolokia.org>\nRoland Kammerer <roland.kammerer@linbit.com>\nRoland Moriz <rmoriz@users.noreply.github.com>\nRoma Sokolov <sokolov.r.v@gmail.com>\nRoman Strashkin <roman.strashkin@gmail.com>\nRon Smits <ron.smits@gmail.com>\nroot <docker-dummy@example.com>\nroot <root@localhost>\nroot <root@ubuntu-14.04-amd64-vbox>\nroot <root@webm215.cluster016.ha.ovh.net>\nRory Hunter <roryhunter2@gmail.com>\nRory McCune <raesene@gmail.com>\nRoss Boucher <rboucher@gmail.com>\nRovanion Luckey <rovanion.luckey@gmail.com>\nRozhnov Alexandr <nox73@ya.ru>\nrsmoorthy <rsmoorthy@users.noreply.github.com>\nRudolph Gottesheim <r.gottesheim@loot.at>\nRui Lopes <rgl@ruilopes.com>\nRyan Anderson <anderson.ryanc@gmail.com>\nRyan Aslett <github@mixologic.com>\nRyan Belgrave <rmb1993@gmail.com>\nRyan Detzel <ryan.detzel@gmail.com>\nRyan Fowler <rwfowler@gmail.com>\nRyan McLaughlin <rmclaughlin@insidesales.com>\nRyan O'Donnell <odonnellryanc@gmail.com>\nRyan Seto <ryanseto@yak.net>\nRyan Thomas <rthomas@atlassian.com>\nRyan Trauntvein <rtrauntvein@novacoast.com>\nRyan Wallner <ryan.wallner@clusterhq.com>\nRyanDeng <sheldon.d1018@gmail.com>\nRémy Greinhofer <remy.greinhofer@livelovely.com>\ns. rannou <mxs@sbrk.org>\ns00318865 <sunyuan3@huawei.com>\nSabin Basyal <sabin.basyal@gmail.com>\nSachin Joshi <sachin_jayant_joshi@hotmail.com>\nSagar Hani <sagarhani33@gmail.com>\nSainath Grandhi <sainath.grandhi@intel.com>\nSally O'Malley <somalley@redhat.com>\nSam Abed <sam.abed@gmail.com>\nSam Alba <sam.alba@gmail.com>\nSam Bailey <cyprix@cyprix.com.au>\nSam J Sharpe <sam.sharpe@digital.cabinet-office.gov.uk>\nSam Neirinck <sam@samneirinck.com>\nSam Reis <sreis@atlassian.com>\nSam Rijs <srijs@airpost.net>\nSambuddha Basu <sambuddhabasu1@gmail.com>\nSami Wagiaalla <swagiaal@redhat.com>\nSamuel Andaya <samuel@andaya.net>\nSamuel Dion-Girardeau <samuel.diongirardeau@gmail.com>\nSamuel Karp <skarp@amazon.com>\nSamuel PHAN <samuel-phan@users.noreply.github.com>\nSankar சங்கர் <sankar.curiosity@gmail.com>\nSanket Saurav <sanketsaurav@gmail.com>\nSanthosh Manohar <santhosh@docker.com>\nsapphiredev <se.imas.kr@gmail.com>\nSatnam Singh <satnam@raintown.org>\nsatoru <satorulogic@gmail.com>\nSatoshi Amemiya <satoshi_amemiya@voyagegroup.com>\nscaleoutsean <scaleoutsean@users.noreply.github.com>\nScott Bessler <scottbessler@gmail.com>\nScott Collier <emailscottcollier@gmail.com>\nScott Johnston <scott@docker.com>\nScott Stamp <scottstamp851@gmail.com>\nScott Walls <sawalls@umich.edu>\nsdreyesg <sdreyesg@gmail.com>\nSean Christopherson <sean.j.christopherson@intel.com>\nSean Cronin <seancron@gmail.com>\nSean OMeara <sean@chef.io>\nSean P. Kane <skane@newrelic.com>\nSebastiaan van Steenis <mail@superseb.nl>\nSebastiaan van Stijn <github@gone.nl>\nSenthil Kumar Selvaraj <senthil.thecoder@gmail.com>\nSenthil Kumaran <senthil@uthcode.com>\nSeongJae Park <sj38.park@gmail.com>\nSeongyeol Lim <seongyeol37@gmail.com>\nSerge Hallyn <serge.hallyn@ubuntu.com>\nSergey Alekseev <sergey.alekseev.minsk@gmail.com>\nSergey Evstifeev <sergey.evstifeev@gmail.com>\nSevki Hasirci <s@sevki.org>\nShane Canon <scanon@lbl.gov>\nShane da Silva <shane@dasilva.io>\nshaunol <shaunol@gmail.com>\nShawn Landden <shawn@churchofgit.com>\nShawn Siefkas <shawn.siefkas@meredith.com>\nShekhar Gulati <shekhargulati84@gmail.com>\nSheng Yang <sheng@yasker.org>\nShengbo Song <thomassong@tencent.com>\nShih-Yuan Lee <fourdollars@gmail.com>\nShijiang Wei <mountkin@gmail.com>\nShishir Mahajan <shishir.mahajan@redhat.com>\nshuai-z <zs.broccoli@gmail.com>\nShuwei Hao <haosw@cn.ibm.com>\nSian Lerk Lau <kiawin@gmail.com>\nsidharthamani <sid@rancher.com>\nSilas Sewell <silas@sewell.org>\nSimei He <hesimei@zju.edu.cn>\nSimon Eskildsen <sirup@sirupsen.com>\nSimon Leinen <simon.leinen@gmail.com>\nSimon Taranto <simon.taranto@gmail.com>\nSindhu S <sindhus@live.in>\nSjoerd Langkemper <sjoerd-github@linuxonly.nl>\nSolganik Alexander <solganik@gmail.com>\nSolomon Hykes <solomon@docker.com>\nSong Gao <song@gao.io>\nSoshi Katsuta <soshi.katsuta@gmail.com>\nSoulou <leo@unbekandt.eu>\nSpencer Brown <spencer@spencerbrown.org>\nSpencer Smith <robertspencersmith@gmail.com>\nSridatta Thatipamala <sthatipamala@gmail.com>\nSridhar Ratnakumar <sridharr@activestate.com>\nSrini Brahmaroutu <srbrahma@us.ibm.com>\nsrinsriv <srinsriv@users.noreply.github.com>\nSteeve Morin <steeve.morin@gmail.com>\nStefan Berger <stefanb@linux.vnet.ibm.com>\nStefan J. Wernli <swernli@microsoft.com>\nStefan Praszalowicz <stefan@greplin.com>\nStefan Scherer <scherer_stefan@icloud.com>\nStefan Staudenmeyer <doerte@instana.com>\nStefan Weil <sw@weilnetz.de>\nStephen Crosby <stevecrozz@gmail.com>\nStephen Day <stephen.day@docker.com>\nStephen Rust <srust@blockbridge.com>\nSteve Durrheimer <s.durrheimer@gmail.com>\nSteve Francia <steve.francia@gmail.com>\nSteve Koch <stevekochscience@gmail.com>\nSteven Burgess <steven.a.burgess@hotmail.com>\nSteven Iveson <sjiveson@outlook.com>\nSteven Merrill <steven.merrill@gmail.com>\nSteven Richards <steven@axiomzen.co>\nSteven Taylor <steven.taylor@me.com>\nSubhajit Ghosh <isubuz.g@gmail.com>\nSujith Haridasan <sujith.h@gmail.com>\nSuryakumar Sudar <surya.trunks@gmail.com>\nSven Dowideit <SvenDowideit@home.org.au>\nSwapnil Daingade <swapnil.daingade@gmail.com>\nSylvain Baubeau <sbaubeau@redhat.com>\nSylvain Bellemare <sylvain@ascribe.io>\nSébastien <sebastien@yoozio.com>\nSébastien Luttringer <seblu@seblu.net>\nSébastien Stormacq <sebsto@users.noreply.github.com>\nTAGOMORI Satoshi <tagomoris@gmail.com>\ntang0th <tang0th@gmx.com>\nTangi COLIN <tangicolin@gmail.com>\nTatsuki Sugiura <sugi@nemui.org>\nTatsushi Inagaki <e29253@jp.ibm.com>\nTaylor Jones <monitorjbl@gmail.com>\ntbonza <tylers.pile@gmail.com>\nTed M. Young <tedyoung@gmail.com>\nTehmasp Chaudhri <tehmasp@gmail.com>\nTejesh Mehta <tejesh.mehta@gmail.com>\nterryding77 <550147740@qq.com>\ntgic <farmer1992@gmail.com>\nThatcher Peskens <thatcher@docker.com>\ntheadactyl <thea.lamkin@gmail.com>\nThell 'Bo' Fowler <thell@tbfowler.name>\nThermionix <bond711@gmail.com>\nThijs Terlouw <thijsterlouw@gmail.com>\nThomas Bikeev <thomas.bikeev@mac.com>\nThomas Frössman <thomasf@jossystem.se>\nThomas Gazagnaire <thomas@gazagnaire.org>\nThomas Grainger <tagrain@gmail.com>\nThomas Hansen <thomas.hansen@gmail.com>\nThomas Leonard <thomas.leonard@docker.com>\nThomas LEVEIL <thomasleveil@gmail.com>\nThomas Orozco <thomas@orozco.fr>\nThomas Riccardi <riccardi@systran.fr>\nThomas Schroeter <thomas@cliqz.com>\nThomas Sjögren <konstruktoid@users.noreply.github.com>\nThomas Swift <tgs242@gmail.com>\nThomas Tanaka <thomas.tanaka@oracle.com>\nThomas Texier <sharkone@en-mousse.org>\nTianon Gravi <admwiggin@gmail.com>\nTibor Vass <teabee89@gmail.com>\nTiffany Low <tiffany@box.com>\nTim Bosse <taim@bosboot.org>\nTim Dettrick <t.dettrick@uq.edu.au>\nTim Düsterhus <tim@bastelstu.be>\nTim Hockin <thockin@google.com>\nTim Ruffles <oi@truffles.me.uk>\nTim Smith <timbot@google.com>\nTim Terhorst <mynamewastaken+git@gmail.com>\nTim Wang <timwangdev@gmail.com>\nTim Waugh <twaugh@redhat.com>\nTim Wraight <tim.wraight@tangentlabs.co.uk>\nTimothy Hobbs <timothyhobbs@seznam.cz>\ntjwebb123 <tjwebb123@users.noreply.github.com>\ntobe <tobegit3hub@gmail.com>\nTobias Bieniek <Tobias.Bieniek@gmx.de>\nTobias Bradtke <webwurst@gmail.com>\nTobias Gesellchen <tobias@gesellix.de>\nTobias Klauser <tklauser@distanz.ch>\nTobias Schmidt <ts@soundcloud.com>\nTobias Schwab <tobias.schwab@dynport.de>\nTodd Crane <todd@toddcrane.com>\nTodd Lunter <tlunter@gmail.com>\nTodd Whiteman <todd.whiteman@joyent.com>\nToli Kuznets <toli@docker.com>\nTom Barlow <tomwbarlow@gmail.com>\nTom Denham <tom@tomdee.co.uk>\nTom Fotherby <tom+github@peopleperhour.com>\nTom Howe <tom.howe@enstratius.com>\nTom Hulihan <hulihan.tom159@gmail.com>\nTom Maaswinkel <tom.maaswinkel@12wiki.eu>\nTom X. Tobin <tomxtobin@tomxtobin.com>\nTomas Tomecek <ttomecek@redhat.com>\nTomasz Kopczynski <tomek@kopczynski.net.pl>\nTomasz Lipinski <tlipinski@users.noreply.github.com>\nTomasz Nurkiewicz <nurkiewicz@gmail.com>\nTommaso Visconti <tommaso.visconti@gmail.com>\nTomáš Hrčka <thrcka@redhat.com>\nTonis Tiigi <tonistiigi@gmail.com>\nTonny Xu <tonny.xu@gmail.com>\nTony Daws <tony@daws.ca>\nTony Miller <mcfiredrill@gmail.com>\ntoogley <toogley@mailbox.org>\nTorstein Husebø <torstein@huseboe.net>\ntpng <benny.tpng@gmail.com>\ntracylihui <793912329@qq.com>\nTravis Cline <travis.cline@gmail.com>\nTravis Thieman <travis.thieman@gmail.com>\nTrent Ogren <tedwardo2@gmail.com>\nTrevor <trevinwoodstock@gmail.com>\nTrevor Pounds <trevor.pounds@gmail.com>\ntrishnaguha <trishnaguha17@gmail.com>\nTristan Carel <tristan@cogniteev.com>\nTroy Denton <trdenton@gmail.com>\nTyler Brock <tyler.brock@gmail.com>\nTzu-Jung Lee <roylee17@gmail.com>\nTõnis Tiigi <tonistiigi@gmail.com>\nUlysse Carion <ulyssecarion@gmail.com>\nunknown <sebastiaan@ws-key-sebas3.dpi1.dpi>\nvagrant <vagrant@ubuntu-14.04-amd64-vbox>\nVaidas Jablonskis <jablonskis@gmail.com>\nVeres Lajos <vlajos@gmail.com>\nvgeta <gopikannan.venugopalsamy@gmail.com>\nVictor Coisne <victor.coisne@dotcloud.com>\nVictor Costan <costan@gmail.com>\nVictor I. Wood <viw@t2am.com>\nVictor Lyuboslavsky <victor@victoreda.com>\nVictor Marmol <vmarmol@google.com>\nVictor Palma <palma.victor@gmail.com>\nVictor Vieux <victor.vieux@docker.com>\nVictoria Bialas <victoria.bialas@docker.com>\nVijaya Kumar K <vijayak@caviumnetworks.com>\nViktor Stanchev <me@viktorstanchev.com>\nViktor Vojnovski <viktor.vojnovski@amadeus.com>\nVinayRaghavanKS <raghavan.vinay@gmail.com>\nVincent Batts <vbatts@redhat.com>\nVincent Bernat <bernat@luffy.cx>\nVincent Bernat <Vincent.Bernat@exoscale.ch>\nVincent Demeester <vincent@sbr.pm>\nVincent Giersch <vincent.giersch@ovh.net>\nVincent Mayers <vincent.mayers@inbloom.org>\nVincent Woo <me@vincentwoo.com>\nVinod Kulkarni <vinod.kulkarni@gmail.com>\nVishal Doshi <vishal.doshi@gmail.com>\nVishnu Kannan <vishnuk@google.com>\nVitor Monteiro <vmrmonteiro@gmail.com>\nVivek Agarwal <me@vivek.im>\nVivek Dasgupta <vdasgupt@redhat.com>\nVivek Goyal <vgoyal@redhat.com>\nVladimir Bulyga <xx@ccxx.cc>\nVladimir Kirillov <proger@wilab.org.ua>\nVladimir Rutsky <altsysrq@gmail.com>\nVladimir Varankin <nek.narqo+git@gmail.com>\nVladimirAus <v_roudakov@yahoo.com>\nVojtech Vitek (V-Teq) <vvitek@redhat.com>\nwaitingkuo <waitingkuo0527@gmail.com>\nWalter Leibbrandt <github@wrl.co.za>\nWalter Stanish <walter@pratyeka.org>\nWANG Chao <wcwxyz@gmail.com>\nWang Xing <hzwangxing@corp.netease.com>\nWard Vandewege <ward@jhvc.com>\nWarheadsSE <max@warheads.net>\nWayne Chang <wayne@neverfear.org>\nWei-Ting Kuo <waitingkuo0527@gmail.com>\nweiyan <weiyan3@huawei.com>\nWeiyang Zhu <cnresonant@gmail.com>\nWen Cheng Ma <wenchma@cn.ibm.com>\nWendel Fleming <wfleming@usc.edu>\nWenxuan Zhao <viz@linux.com>\nWenyu You <21551128@zju.edu.cn>\nWes Morgan <cap10morgan@gmail.com>\nWill Dietz <w@wdtz.org>\nWill Rouesnel <w.rouesnel@gmail.com>\nWill Weaver <monkey@buildingbananas.com>\nwillhf <willhf@gmail.com>\nWilliam Delanoue <william.delanoue@gmail.com>\nWilliam Henry <whenry@redhat.com>\nWilliam Hubbs <w.d.hubbs@gmail.com>\nWilliam Riancho <wr.wllm@gmail.com>\nWilliam Thurston <thurstw@amazon.com>\nWiseTrem <shepelyov.g@gmail.com>\nwlan0 <sidharthamn@gmail.com>\nWolfgang Powisch <powo@powo.priv.at>\nwonderflow <wonderflow.sun@gmail.com>\nxamyzhao <x.amy.zhao@gmail.com>\nXiaoBing Jiang <s7v7nislands@gmail.com>\nXiaoxu Chen <chenxiaoxu14@otcaix.iscas.ac.cn>\nxiekeyang <xiekeyang@huawei.com>\nXinzi Zhou <imdreamrunner@gmail.com>\nXiuming Chen <cc@cxm.cc>\nxlgao-zju <xlgao@zju.edu.cn>\nxuzhaokui <cynicholas@gmail.com>\nYahya <ya7yaz@gmail.com>\nYAMADA Tsuyoshi <tyamada@minimum2scp.org>\nYan Feng <yanfeng2@huawei.com>\nYang Bai <hamo.by@gmail.com>\nyangshukui <yangshukui@huawei.com>\nYasunori Mahata <nori@mahata.net>\nYestin Sun <sunyi0804@gmail.com>\nYi EungJun <eungjun.yi@navercorp.com>\nYibai Zhang <xm1994@gmail.com>\nYihang Ho <hoyihang5@gmail.com>\nYing Li <cyli@twistedmatrix.com>\nYohei Ueda <yohei@jp.ibm.com>\nYong Tang <yong.tang.github@outlook.com>\nYongzhi Pan <panyongzhi@gmail.com>\nyorkie <yorkiefixer@gmail.com>\nYoucef YEKHLEF <yyekhlef@gmail.com>\nYuan Sun <sunyuan3@huawei.com>\nyuchangchun <yuchangchun1@huawei.com>\nyuchengxia <yuchengxia@huawei.com>\nYurii Rashkovskii <yrashk@gmail.com>\nyuzou <zouyu7@huawei.com>\nZac Dover <zdover@redhat.com>\nZach Borboa <zachborboa@gmail.com>\nZachary Jaffee <zij@case.edu>\nZain Memon <zain@inzain.net>\nZaiste! <oh@zaiste.net>\nZane DeGraffenried <zane.deg@gmail.com>\nZefan Li <lizefan@huawei.com>\nZen Lin(Zhinan Lin) <linzhinan@huawei.com>\nZhang Kun <zkazure@gmail.com>\nZhang Wei <zhangwei555@huawei.com>\nZhang Wentao <zhangwentao234@huawei.com>\nZhenan Ye <21551168@zju.edu.cn>\nZhu Guihua <zhugh.fnst@cn.fujitsu.com>\nZhuoyun Wei <wzyboy@wzyboy.org>\nZilin Du <zilin.du@gmail.com>\nzimbatm <zimbatm@zimbatm.com>\nZiming Dong <bnudzm@foxmail.com>\nZJUshuaizhou <21551191@zju.edu.cn>\nzmarouf <zeid.marouf@gmail.com>\nZoltan Tombol <zoltan.tombol@gmail.com>\nzqh <zqhxuyuan@gmail.com>\nZuhayr Elahi <elahi.zuhayr@gmail.com>\nZunayed Ali <zunayed@gmail.com>\nÁlex González <agonzalezro@gmail.com>\nÁlvaro Lázaro <alvaro.lazaro.g@gmail.com>\nÁtila Camurça Alves <camurca.home@gmail.com>\n尹吉峰 <jifeng.yin@gmail.com>\n搏通 <yufeng.pyf@alibaba-inc.com>\n"
  },
  {
    "path": "vendor/github.com/containers/storage/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2013-2016 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/containers/storage/NOTICE",
    "content": "Docker\nCopyright 2012-2016 Docker, Inc.\n\nThis product includes software developed at Docker, Inc. (https://www.docker.com).\n\nThis product contains software (https://github.com/kr/pty) developed\nby Keith Rarick, licensed under the MIT License.\n\nThe following is courtesy of our legal counsel:\n\n\nUse and transfer of Docker may be subject to certain restrictions by the\nUnited States and other governments.\nIt is your responsibility to ensure that your use and/or transfer does not\nviolate applicable laws.\n\nFor more information, please see https://www.bis.doc.gov\n\nSee also https://www.apache.org/dev/crypto.html and/or seek legal counsel.\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/exists_freebsd.go",
    "content": "package fileutils\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// Exists checks whether a file or directory exists at the given path.\n// If the path is a symlink, the symlink is followed.\nfunc Exists(path string) error {\n\t// It uses unix.Faccessat which is a faster operation compared to os.Stat for\n\t// simply checking the existence of a file.\n\terr := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, 0)\n\tif err != nil {\n\t\treturn &os.PathError{Op: \"faccessat\", Path: path, Err: err}\n\t}\n\treturn nil\n}\n\n// Lexists checks whether a file or directory exists at the given path.\n// If the path is a symlink, the symlink itself is checked.\nfunc Lexists(path string) error {\n\t// FreeBSD before 15.0 does not support the AT_SYMLINK_NOFOLLOW flag for\n\t// faccessat. In this case, the call to faccessat will return EINVAL and\n\t// we fall back to using Lstat.\n\terr := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW)\n\tif err != nil {\n\t\tif errors.Is(err, syscall.EINVAL) {\n\t\t\t_, err = os.Lstat(path)\n\t\t\treturn err\n\t\t}\n\t\treturn &os.PathError{Op: \"faccessat\", Path: path, Err: err}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/exists_unix.go",
    "content": "//go:build !windows && !freebsd\n\npackage fileutils\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// Exists checks whether a file or directory exists at the given path.\n// If the path is a symlink, the symlink is followed.\nfunc Exists(path string) error {\n\t// It uses unix.Faccessat which is a faster operation compared to os.Stat for\n\t// simply checking the existence of a file.\n\terr := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, 0)\n\tif err != nil {\n\t\treturn &os.PathError{Op: \"faccessat\", Path: path, Err: err}\n\t}\n\treturn nil\n}\n\n// Lexists checks whether a file or directory exists at the given path.\n// If the path is a symlink, the symlink itself is checked.\nfunc Lexists(path string) error {\n\t// It uses unix.Faccessat which is a faster operation compared to os.Stat for\n\t// simply checking the existence of a file.\n\terr := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW)\n\tif err != nil {\n\t\treturn &os.PathError{Op: \"faccessat\", Path: path, Err: err}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/exists_windows.go",
    "content": "package fileutils\n\nimport (\n\t\"os\"\n)\n\n// Exists checks whether a file or directory exists at the given path.\nfunc Exists(path string) error {\n\t_, err := os.Stat(path)\n\treturn err\n}\n\n// Lexists checks whether a file or directory exists at the given path, without\n// resolving symlinks\nfunc Lexists(path string) error {\n\t_, err := os.Lstat(path)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/fileutils.go",
    "content": "package fileutils\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"text/scanner\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\n// PatternMatcher allows checking paths against a list of patterns\ntype PatternMatcher struct {\n\tpatterns   []*Pattern\n\texclusions bool\n}\n\n// NewPatternMatcher creates a new matcher object for specific patterns that can\n// be used later to match against patterns against paths\nfunc NewPatternMatcher(patterns []string) (*PatternMatcher, error) {\n\tpm := &PatternMatcher{\n\t\tpatterns: make([]*Pattern, 0, len(patterns)),\n\t}\n\tfor _, p := range patterns {\n\t\t// Eliminate leading and trailing whitespace.\n\t\tp = strings.TrimSpace(p)\n\t\tif p == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tp = filepath.Clean(p)\n\t\tnewp := &Pattern{}\n\t\tif p[0] == '!' {\n\t\t\tif len(p) == 1 {\n\t\t\t\treturn nil, errors.New(\"illegal exclusion pattern: \\\"!\\\"\")\n\t\t\t}\n\t\t\tnewp.exclusion = true\n\t\t\tp = strings.TrimPrefix(filepath.Clean(p[1:]), \"/\")\n\t\t\tpm.exclusions = true\n\t\t}\n\t\t// Do some syntax checking on the pattern.\n\t\t// filepath's Match() has some really weird rules that are inconsistent\n\t\t// so instead of trying to dup their logic, just call Match() for its\n\t\t// error state and if there is an error in the pattern return it.\n\t\t// If this becomes an issue we can remove this since its really only\n\t\t// needed in the error (syntax) case - which isn't really critical.\n\t\tif _, err := filepath.Match(p, \".\"); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewp.cleanedPattern = p\n\t\tnewp.dirs = strings.Split(p, string(os.PathSeparator))\n\t\tpm.patterns = append(pm.patterns, newp)\n\t}\n\treturn pm, nil\n}\n\n// Deprecated: Please use the `MatchesResult` method instead.\n// Matches matches path against all the patterns. Matches is not safe to be\n// called concurrently\nfunc (pm *PatternMatcher) Matches(file string) (bool, error) {\n\tmatched := false\n\tfile = filepath.FromSlash(file)\n\n\tfor _, pattern := range pm.patterns {\n\t\tnegative := false\n\n\t\tif pattern.exclusion {\n\t\t\tnegative = true\n\t\t}\n\n\t\tmatch, err := pattern.match(file)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif match {\n\t\t\tmatched = !negative\n\t\t}\n\t}\n\n\tif matched {\n\t\tlogrus.Debugf(\"Skipping excluded path: %s\", file)\n\t}\n\n\treturn matched, nil\n}\n\ntype MatchResult struct {\n\tisMatched         bool\n\tmatches, excludes uint\n}\n\n// Excludes returns true if the overall result is matched\nfunc (m *MatchResult) IsMatched() bool {\n\treturn m.isMatched\n}\n\n// Excludes returns the amount of matches of an MatchResult\nfunc (m *MatchResult) Matches() uint {\n\treturn m.matches\n}\n\n// Excludes returns the amount of excludes of an MatchResult\nfunc (m *MatchResult) Excludes() uint {\n\treturn m.excludes\n}\n\n// MatchesResult verifies the provided filepath against all patterns.\n// It returns the `*MatchResult` result for the patterns on success, otherwise\n// an error. This method is not safe to be called concurrently.\nfunc (pm *PatternMatcher) MatchesResult(file string) (res *MatchResult, err error) {\n\tfile = filepath.FromSlash(file)\n\tres = &MatchResult{false, 0, 0}\n\n\tfor _, pattern := range pm.patterns {\n\t\tnegative := false\n\n\t\tif pattern.exclusion {\n\t\t\tnegative = true\n\t\t}\n\n\t\tmatch, err := pattern.match(file)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif match {\n\t\t\tres.isMatched = !negative\n\t\t\tif negative {\n\t\t\t\tres.excludes++\n\t\t\t} else {\n\t\t\t\tres.matches++\n\t\t\t}\n\t\t}\n\t}\n\n\tif res.matches > 0 {\n\t\tlogrus.Debugf(\"Skipping excluded path: %s\", file)\n\t}\n\n\treturn res, nil\n}\n\n// IsMatch verifies the provided filepath against all patterns and returns true\n// if it matches. A match is valid if the last match is a positive one.\n// It returns an error on failure and is not safe to be called concurrently.\nfunc (pm *PatternMatcher) IsMatch(file string) (matched bool, err error) {\n\tres, err := pm.MatchesResult(file)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn res.isMatched, nil\n}\n\n// Exclusions returns true if any of the patterns define exclusions\nfunc (pm *PatternMatcher) Exclusions() bool {\n\treturn pm.exclusions\n}\n\n// Patterns returns array of active patterns\nfunc (pm *PatternMatcher) Patterns() []*Pattern {\n\treturn pm.patterns\n}\n\n// Pattern defines a single regexp used to filter file paths.\ntype Pattern struct {\n\tcleanedPattern string\n\tdirs           []string\n\tregexp         *regexp.Regexp\n\texclusion      bool\n}\n\nfunc (p *Pattern) String() string {\n\treturn p.cleanedPattern\n}\n\n// Exclusion returns true if this pattern defines exclusion\nfunc (p *Pattern) Exclusion() bool {\n\treturn p.exclusion\n}\n\nfunc (p *Pattern) match(path string) (bool, error) {\n\tif p.regexp == nil {\n\t\tif err := p.compile(); err != nil {\n\t\t\treturn false, filepath.ErrBadPattern\n\t\t}\n\t}\n\n\tb := p.regexp.MatchString(path)\n\n\treturn b, nil\n}\n\nfunc (p *Pattern) compile() error {\n\tregStr := \"^\"\n\tpattern := p.cleanedPattern\n\t// Go through the pattern and convert it to a regexp.\n\t// We use a scanner so we can support utf-8 chars.\n\tvar scan scanner.Scanner\n\tscan.Init(strings.NewReader(pattern))\n\n\tsl := string(os.PathSeparator)\n\tescSL := sl\n\tconst bs = `\\`\n\tif sl == bs {\n\t\tescSL += bs\n\t}\n\n\tfor scan.Peek() != scanner.EOF {\n\t\tch := scan.Next()\n\n\t\tif ch == '*' {\n\t\t\tif scan.Peek() == '*' {\n\t\t\t\t// is some flavor of \"**\"\n\t\t\t\tscan.Next()\n\n\t\t\t\t// Treat **/ as ** so eat the \"/\"\n\t\t\t\tif string(scan.Peek()) == sl {\n\t\t\t\t\tscan.Next()\n\t\t\t\t}\n\n\t\t\t\tif scan.Peek() == scanner.EOF {\n\t\t\t\t\t// is \"**EOF\" - to align with .gitignore just accept all\n\t\t\t\t\tregStr += \".*\"\n\t\t\t\t} else {\n\t\t\t\t\t// is \"**\"\n\t\t\t\t\t// Note that this allows for any # of /'s (even 0) because\n\t\t\t\t\t// the .* will eat everything, even /'s\n\t\t\t\t\tregStr += \"(.*\" + escSL + \")?\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// is \"*\" so map it to anything but \"/\"\n\t\t\t\tregStr += \"[^\" + escSL + \"]*\"\n\t\t\t}\n\t\t} else if ch == '?' {\n\t\t\t// \"?\" is any char except \"/\"\n\t\t\tregStr += \"[^\" + escSL + \"]\"\n\t\t} else if ch == '.' || ch == '$' {\n\t\t\t// Escape some regexp special chars that have no meaning\n\t\t\t// in golang's filepath.Match\n\t\t\tregStr += bs + string(ch)\n\t\t} else if ch == '\\\\' {\n\t\t\t// escape next char.\n\t\t\tif sl == bs {\n\t\t\t\t// On windows map \"\\\" to \"\\\\\", meaning an escaped backslash,\n\t\t\t\t// and then just continue because filepath.Match on\n\t\t\t\t// Windows doesn't allow escaping at all\n\t\t\t\tregStr += escSL\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif scan.Peek() != scanner.EOF {\n\t\t\t\tregStr += bs + string(scan.Next())\n\t\t\t} else {\n\t\t\t\treturn filepath.ErrBadPattern\n\t\t\t}\n\t\t} else {\n\t\t\tregStr += string(ch)\n\t\t}\n\t}\n\n\tregStr += \"(\" + escSL + \".*)?$\"\n\n\tre, err := regexp.Compile(regStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp.regexp = re\n\treturn nil\n}\n\n// Matches returns true if file matches any of the patterns\n// and isn't excluded by any of the subsequent patterns.\nfunc Matches(file string, patterns []string) (bool, error) {\n\tpm, err := NewPatternMatcher(patterns)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfile = filepath.Clean(file)\n\n\tif file == \".\" {\n\t\t// Don't let them exclude everything, kind of silly.\n\t\treturn false, nil\n\t}\n\n\treturn pm.IsMatch(file)\n}\n\n// CopyFile copies from src to dst until either EOF is reached\n// on src or an error occurs. It verifies src exists and removes\n// the dst if it exists.\nfunc CopyFile(src, dst string) (int64, error) {\n\tcleanSrc := filepath.Clean(src)\n\tcleanDst := filepath.Clean(dst)\n\tif cleanSrc == cleanDst {\n\t\treturn 0, nil\n\t}\n\tsf, err := os.Open(cleanSrc)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer sf.Close()\n\tif err := os.Remove(cleanDst); err != nil && !os.IsNotExist(err) {\n\t\treturn 0, err\n\t}\n\tdf, err := os.Create(cleanDst)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer df.Close()\n\treturn io.Copy(df, sf)\n}\n\n// ReadSymlinkedDirectory returns the target directory of a symlink.\n// The target of the symbolic link may not be a file.\nfunc ReadSymlinkedDirectory(path string) (string, error) {\n\tvar realPath string\n\tvar err error\n\tif realPath, err = filepath.Abs(path); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to get absolute path for %s: %w\", path, err)\n\t}\n\tif realPath, err = filepath.EvalSymlinks(realPath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to canonicalise path for %s: %w\", path, err)\n\t}\n\trealPathInfo, err := os.Stat(realPath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to stat target '%s' of '%s': %w\", realPath, path, err)\n\t}\n\tif !realPathInfo.Mode().IsDir() {\n\t\treturn \"\", fmt.Errorf(\"canonical path points to a file '%s'\", realPath)\n\t}\n\treturn realPath, nil\n}\n\n// ReadSymlinkedPath returns the target directory of a symlink.\n// The target of the symbolic link can be a file and a directory.\nfunc ReadSymlinkedPath(path string) (realPath string, err error) {\n\tif realPath, err = filepath.Abs(path); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to get absolute path for %q: %w\", path, err)\n\t}\n\tif realPath, err = filepath.EvalSymlinks(realPath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to canonicalise path for %q: %w\", path, err)\n\t}\n\tif err := Exists(realPath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to stat target %q of %q: %w\", realPath, path, err)\n\t}\n\treturn realPath, nil\n}\n\n// CreateIfNotExists creates a file or a directory only if it does not already exist.\nfunc CreateIfNotExists(path string, isDir bool) error {\n\tif err := Exists(path); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif isDir {\n\t\t\t\treturn os.MkdirAll(path, 0o755)\n\t\t\t}\n\t\t\tif err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf, err := os.OpenFile(path, os.O_CREATE, 0o755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf.Close()\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/fileutils_darwin.go",
    "content": "package fileutils\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// GetTotalUsedFds returns the number of used File Descriptors by\n// executing `lsof -p PID`\nfunc GetTotalUsedFds() int {\n\tpid := os.Getpid()\n\n\tcmd := exec.Command(\"lsof\", \"-p\", strconv.Itoa(pid))\n\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn -1\n\t}\n\n\toutputStr := strings.TrimSpace(string(output))\n\n\tfds := strings.Split(outputStr, \"\\n\")\n\n\treturn len(fds) - 1\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/fileutils_solaris.go",
    "content": "package fileutils\n\n// GetTotalUsedFds Returns the number of used File Descriptors.\n// On Solaris these limits are per process and not systemwide\nfunc GetTotalUsedFds() int {\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/fileutils_unix.go",
    "content": "//go:build linux || freebsd\n\npackage fileutils\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\n// GetTotalUsedFds Returns the number of used File Descriptors by\n// reading it via /proc filesystem.\nfunc GetTotalUsedFds() int {\n\tif fds, err := os.ReadDir(fmt.Sprintf(\"/proc/%d/fd\", os.Getpid())); err != nil {\n\t\tlogrus.Errorf(\"%v\", err)\n\t} else {\n\t\treturn len(fds)\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/fileutils/fileutils_windows.go",
    "content": "package fileutils\n\n// GetTotalUsedFds Returns the number of used File Descriptors. Not supported\n// on Windows.\nfunc GetTotalUsedFds() int {\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/homedir/homedir.go",
    "content": "package homedir\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// GetDataHome returns XDG_DATA_HOME.\n// GetDataHome returns $HOME/.local/share and nil error if XDG_DATA_HOME is not set.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc GetDataHome() (string, error) {\n\tif xdgDataHome := os.Getenv(\"XDG_DATA_HOME\"); xdgDataHome != \"\" {\n\t\treturn xdgDataHome, nil\n\t}\n\thome := Get()\n\tif home == \"\" {\n\t\treturn \"\", errors.New(\"could not get either XDG_DATA_HOME or HOME\")\n\t}\n\treturn filepath.Join(home, \".local\", \"share\"), nil\n}\n\n// GetCacheHome returns XDG_CACHE_HOME.\n// GetCacheHome returns $HOME/.cache and nil error if XDG_CACHE_HOME is not set.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc GetCacheHome() (string, error) {\n\tif xdgCacheHome := os.Getenv(\"XDG_CACHE_HOME\"); xdgCacheHome != \"\" {\n\t\treturn xdgCacheHome, nil\n\t}\n\thome := Get()\n\tif home == \"\" {\n\t\treturn \"\", errors.New(\"could not get either XDG_CACHE_HOME or HOME\")\n\t}\n\treturn filepath.Join(home, \".cache\"), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/homedir/homedir_unix.go",
    "content": "//go:build !windows\n\npackage homedir\n\n// Copyright 2013-2018 Docker, Inc.\n// NOTE: this package has originally been copied from github.com/docker/docker.\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/containers/storage/pkg/unshare\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// Key returns the env var name for the user's home dir based on\n// the platform being run on\nfunc Key() string {\n\treturn \"HOME\"\n}\n\n// Get returns the home directory of the current user with the help of\n// environment variables depending on the target operating system.\n// Returned path should be used with \"path/filepath\" to form new paths.\n//\n// If linking statically with cgo enabled against glibc, ensure the\n// osusergo build tag is used.\n//\n// If needing to do nss lookups, do not disable cgo or set osusergo.\nfunc Get() string {\n\thomedir, _ := unshare.HomeDir()\n\treturn homedir\n}\n\n// GetShortcutString returns the string that is shortcut to user's home directory\n// in the native shell of the platform running on.\nfunc GetShortcutString() string {\n\treturn \"~\"\n}\n\n// StickRuntimeDirContents sets the sticky bit on files that are under\n// XDG_RUNTIME_DIR, so that the files won't be periodically removed by the system.\n//\n// StickyRuntimeDir returns slice of sticked files.\n// StickyRuntimeDir returns nil error if XDG_RUNTIME_DIR is not set.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc StickRuntimeDirContents(files []string) ([]string, error) {\n\truntimeDir, err := GetRuntimeDir()\n\tif err != nil {\n\t\t// ignore error if runtimeDir is empty\n\t\treturn nil, nil //nolint: nilerr\n\t}\n\truntimeDir, err = filepath.Abs(runtimeDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar sticked []string\n\tfor _, f := range files {\n\t\tf, err = filepath.Abs(f)\n\t\tif err != nil {\n\t\t\treturn sticked, err\n\t\t}\n\t\tif strings.HasPrefix(f, runtimeDir+\"/\") {\n\t\t\tif err = stick(f); err != nil {\n\t\t\t\treturn sticked, err\n\t\t\t}\n\t\t\tsticked = append(sticked, f)\n\t\t}\n\t}\n\treturn sticked, nil\n}\n\nfunc stick(f string) error {\n\tst, err := os.Stat(f)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm := st.Mode()\n\tm |= os.ModeSticky\n\treturn os.Chmod(f, m)\n}\n\nvar (\n\trootlessConfigHomeDirError error\n\trootlessConfigHomeDirOnce  sync.Once\n\trootlessConfigHomeDir      string\n\trootlessRuntimeDirOnce     sync.Once\n\trootlessRuntimeDir         string\n)\n\n// isWriteableOnlyByOwner checks that the specified permission mask allows write\n// access only to the owner.\nfunc isWriteableOnlyByOwner(perm os.FileMode) bool {\n\treturn (perm & 0o722) == 0o700\n}\n\n// GetConfigHome returns XDG_CONFIG_HOME.\n// GetConfigHome returns $HOME/.config and nil error if XDG_CONFIG_HOME is not set.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc GetConfigHome() (string, error) {\n\trootlessConfigHomeDirOnce.Do(func() {\n\t\tcfgHomeDir := os.Getenv(\"XDG_CONFIG_HOME\")\n\t\tif cfgHomeDir == \"\" {\n\t\t\thome := Get()\n\t\t\tresolvedHome, err := filepath.EvalSymlinks(home)\n\t\t\tif err != nil {\n\t\t\t\trootlessConfigHomeDirError = fmt.Errorf(\"cannot resolve %s: %w\", home, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttmpDir := filepath.Join(resolvedHome, \".config\")\n\t\t\t_ = os.MkdirAll(tmpDir, 0o700)\n\t\t\tst, err := os.Stat(tmpDir)\n\t\t\tif err != nil {\n\t\t\t\trootlessConfigHomeDirError = err\n\t\t\t\treturn\n\t\t\t} else if int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() {\n\t\t\t\tcfgHomeDir = tmpDir\n\t\t\t} else {\n\t\t\t\trootlessConfigHomeDirError = fmt.Errorf(\"path %q exists and it is not owned by the current user\", tmpDir)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trootlessConfigHomeDir = cfgHomeDir\n\t})\n\n\treturn rootlessConfigHomeDir, rootlessConfigHomeDirError\n}\n\n// GetRuntimeDir returns a directory suitable to store runtime files.\n// The function will try to use the XDG_RUNTIME_DIR env variable if it is set.\n// XDG_RUNTIME_DIR is typically configured via pam_systemd.\n// If XDG_RUNTIME_DIR is not set, GetRuntimeDir will try to find a suitable\n// directory for the current user.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc GetRuntimeDir() (string, error) {\n\tvar rootlessRuntimeDirError error\n\n\trootlessRuntimeDirOnce.Do(func() {\n\t\truntimeDir := os.Getenv(\"XDG_RUNTIME_DIR\")\n\n\t\tif runtimeDir != \"\" {\n\t\t\trootlessRuntimeDir, rootlessRuntimeDirError = filepath.EvalSymlinks(runtimeDir)\n\t\t\treturn\n\t\t}\n\n\t\tuid := strconv.Itoa(unshare.GetRootlessUID())\n\t\tif runtimeDir == \"\" {\n\t\t\ttmpDir := filepath.Join(\"/run\", \"user\", uid)\n\t\t\tif err := os.MkdirAll(tmpDir, 0o700); err != nil {\n\t\t\t\tlogrus.Debug(err)\n\t\t\t}\n\t\t\tst, err := os.Lstat(tmpDir)\n\t\t\tif err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) {\n\t\t\t\truntimeDir = tmpDir\n\t\t\t}\n\t\t}\n\t\tif runtimeDir == \"\" {\n\t\t\ttmpDir := filepath.Join(os.TempDir(), fmt.Sprintf(\"storage-run-%s\", uid))\n\t\t\tif err := os.MkdirAll(tmpDir, 0o700); err != nil {\n\t\t\t\tlogrus.Debug(err)\n\t\t\t}\n\t\t\tst, err := os.Lstat(tmpDir)\n\t\t\tif err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) {\n\t\t\t\truntimeDir = tmpDir\n\t\t\t} else {\n\t\t\t\trootlessRuntimeDirError = fmt.Errorf(\"path %q exists and it is not writeable only by the current user\", tmpDir)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trootlessRuntimeDir = runtimeDir\n\t})\n\n\treturn rootlessRuntimeDir, rootlessRuntimeDirError\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/homedir/homedir_windows.go",
    "content": "package homedir\n\n// Copyright 2013-2018 Docker, Inc.\n// NOTE: this package has originally been copied from github.com/docker/docker.\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// Key returns the env var name for the user's home dir based on\n// the platform being run on\nfunc Key() string {\n\treturn \"USERPROFILE\"\n}\n\n// Get returns the home directory of the current user with the help of\n// environment variables depending on the target operating system.\n// Returned path should be used with \"path/filepath\" to form new paths.\nfunc Get() string {\n\thome := os.Getenv(Key())\n\tif home != \"\" {\n\t\treturn home\n\t}\n\thome, _ = os.UserHomeDir()\n\treturn home\n}\n\n// GetConfigHome returns the home directory of the current user with the help of\n// environment variables depending on the target operating system.\n// Returned path should be used with \"path/filepath\" to form new paths.\nfunc GetConfigHome() (string, error) {\n\treturn filepath.Join(Get(), \".config\"), nil\n}\n\n// GetShortcutString returns the string that is shortcut to user's home directory\n// in the native shell of the platform running on.\nfunc GetShortcutString() string {\n\treturn \"%USERPROFILE%\" // be careful while using in format functions\n}\n\n// StickRuntimeDirContents is a no-op on Windows\nfunc StickRuntimeDirContents(files []string) ([]string, error) {\n\treturn nil, nil\n}\n\n// GetRuntimeDir returns a directory suitable to store runtime files.\n// The function will try to use the XDG_RUNTIME_DIR env variable if it is set.\n// XDG_RUNTIME_DIR is typically configured via pam_systemd.\n// If XDG_RUNTIME_DIR is not set, GetRuntimeDir will try to find a suitable\n// directory for the current user.\n//\n// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html\nfunc GetRuntimeDir() (string, error) {\n\tdata, err := GetDataHome()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\truntimeDir := filepath.Join(data, \"containers\", \"storage\")\n\treturn runtimeDir, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/idtools.go",
    "content": "package idtools\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/containers/storage/pkg/system\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// IDMap contains a single entry for user namespace range remapping. An array\n// of IDMap entries represents the structure that will be provided to the Linux\n// kernel for creating a user namespace.\ntype IDMap struct {\n\tContainerID int `json:\"container_id\"`\n\tHostID      int `json:\"host_id\"`\n\tSize        int `json:\"size\"`\n}\n\ntype subIDRange struct {\n\tStart  int\n\tLength int\n}\n\ntype ranges []subIDRange\n\nfunc (e ranges) Len() int           { return len(e) }\nfunc (e ranges) Swap(i, j int)      { e[i], e[j] = e[j], e[i] }\nfunc (e ranges) Less(i, j int) bool { return e[i].Start < e[j].Start }\n\nconst (\n\tsubuidFileName          string = \"/etc/subuid\"\n\tsubgidFileName          string = \"/etc/subgid\"\n\tContainersOverrideXattr        = \"user.containers.override_stat\"\n)\n\n// MkdirAllAs creates a directory (include any along the path) and then modifies\n// ownership to the requested uid/gid.  If the directory already exists, this\n// function will still change ownership to the requested uid/gid pair.\n// Deprecated: Use MkdirAllAndChown\nfunc MkdirAllAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\treturn mkdirAs(path, mode, ownerUID, ownerGID, true, true)\n}\n\n// MkdirAs creates a directory and then modifies ownership to the requested uid/gid.\n// If the directory already exists, this function still changes ownership\n// Deprecated: Use MkdirAndChown with a IDPair\nfunc MkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\treturn mkdirAs(path, mode, ownerUID, ownerGID, false, true)\n}\n\n// MkdirAllAndChown creates a directory (include any along the path) and then modifies\n// ownership to the requested uid/gid.  If the directory already exists, this\n// function will still change ownership to the requested uid/gid pair.\nfunc MkdirAllAndChown(path string, mode os.FileMode, ids IDPair) error {\n\treturn mkdirAs(path, mode, ids.UID, ids.GID, true, true)\n}\n\n// MkdirAndChown creates a directory and then modifies ownership to the requested uid/gid.\n// If the directory already exists, this function still changes ownership\nfunc MkdirAndChown(path string, mode os.FileMode, ids IDPair) error {\n\treturn mkdirAs(path, mode, ids.UID, ids.GID, false, true)\n}\n\n// MkdirAllAndChownNew creates a directory (include any along the path) and then modifies\n// ownership ONLY of newly created directories to the requested uid/gid. If the\n// directories along the path exist, no change of ownership will be performed\nfunc MkdirAllAndChownNew(path string, mode os.FileMode, ids IDPair) error {\n\treturn mkdirAs(path, mode, ids.UID, ids.GID, true, false)\n}\n\n// GetRootUIDGID retrieves the remapped root uid/gid pair from the set of maps.\n// If the maps are empty, then the root uid/gid will default to \"real\" 0/0\nfunc GetRootUIDGID(uidMap, gidMap []IDMap) (int, int, error) {\n\tvar uid, gid int\n\tvar err error\n\tif len(uidMap) == 1 && uidMap[0].Size == 1 {\n\t\tuid = uidMap[0].HostID\n\t} else {\n\t\tuid, err = RawToHost(0, uidMap)\n\t\tif err != nil {\n\t\t\treturn -1, -1, err\n\t\t}\n\t}\n\tif len(gidMap) == 1 && gidMap[0].Size == 1 {\n\t\tgid = gidMap[0].HostID\n\t} else {\n\t\tgid, err = RawToHost(0, gidMap)\n\t\tif err != nil {\n\t\t\treturn -1, -1, err\n\t\t}\n\t}\n\treturn uid, gid, nil\n}\n\n// RawToContainer takes an id mapping, and uses it to translate a host ID to\n// the remapped ID. If no map is provided, then the translation assumes a\n// 1-to-1 mapping and returns the passed in id.\n//\n// If you wish to map a (uid,gid) combination you should use the corresponding\n// IDMappings methods, which ensure that you are mapping the correct ID against\n// the correct mapping.\nfunc RawToContainer(hostID int, idMap []IDMap) (int, error) {\n\tif idMap == nil {\n\t\treturn hostID, nil\n\t}\n\tfor _, m := range idMap {\n\t\tif (hostID >= m.HostID) && (hostID <= (m.HostID + m.Size - 1)) {\n\t\t\tcontID := m.ContainerID + (hostID - m.HostID)\n\t\t\treturn contID, nil\n\t\t}\n\t}\n\treturn -1, fmt.Errorf(\"host ID %d cannot be mapped to a container ID\", hostID)\n}\n\n// RawToHost takes an id mapping and a remapped ID, and translates the ID to\n// the mapped host ID. If no map is provided, then the translation assumes a\n// 1-to-1 mapping and returns the passed in id.\n//\n// If you wish to map a (uid,gid) combination you should use the corresponding\n// IDMappings methods, which ensure that you are mapping the correct ID against\n// the correct mapping.\nfunc RawToHost(contID int, idMap []IDMap) (int, error) {\n\tif idMap == nil {\n\t\treturn contID, nil\n\t}\n\tfor _, m := range idMap {\n\t\tif (contID >= m.ContainerID) && (contID <= (m.ContainerID + m.Size - 1)) {\n\t\t\thostID := m.HostID + (contID - m.ContainerID)\n\t\t\treturn hostID, nil\n\t\t}\n\t}\n\treturn -1, fmt.Errorf(\"container ID %d cannot be mapped to a host ID\", contID)\n}\n\n// IDPair is a UID and GID pair\ntype IDPair struct {\n\tUID int\n\tGID int\n}\n\n// IDMappings contains a mappings of UIDs and GIDs\ntype IDMappings struct {\n\tuids []IDMap\n\tgids []IDMap\n}\n\n// NewIDMappings takes a requested user and group name and\n// using the data from /etc/sub{uid,gid} ranges, creates the\n// proper uid and gid remapping ranges for that user/group pair\nfunc NewIDMappings(username, groupname string) (*IDMappings, error) {\n\tsubuidRanges, err := readSubuid(username)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsubgidRanges, err := readSubgid(groupname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(subuidRanges) == 0 {\n\t\treturn nil, fmt.Errorf(\"no subuid ranges found for user %q in %s\", username, subuidFileName)\n\t}\n\tif len(subgidRanges) == 0 {\n\t\treturn nil, fmt.Errorf(\"no subgid ranges found for group %q in %s\", groupname, subgidFileName)\n\t}\n\n\treturn &IDMappings{\n\t\tuids: createIDMap(subuidRanges),\n\t\tgids: createIDMap(subgidRanges),\n\t}, nil\n}\n\n// NewIDMappingsFromMaps creates a new mapping from two slices\n// Deprecated: this is a temporary shim while transitioning to IDMapping\nfunc NewIDMappingsFromMaps(uids []IDMap, gids []IDMap) *IDMappings {\n\treturn &IDMappings{uids: uids, gids: gids}\n}\n\n// RootPair returns a uid and gid pair for the root user. The error is ignored\n// because a root user always exists, and the defaults are correct when the uid\n// and gid maps are empty.\nfunc (i *IDMappings) RootPair() IDPair {\n\tuid, gid, _ := GetRootUIDGID(i.uids, i.gids)\n\treturn IDPair{UID: uid, GID: gid}\n}\n\n// ToHost returns the host UID and GID for the container uid, gid.\nfunc (i *IDMappings) ToHost(pair IDPair) (IDPair, error) {\n\tvar err error\n\tvar target IDPair\n\n\ttarget.UID, err = RawToHost(pair.UID, i.uids)\n\tif err != nil {\n\t\treturn target, err\n\t}\n\n\ttarget.GID, err = RawToHost(pair.GID, i.gids)\n\treturn target, err\n}\n\nvar (\n\toverflowUIDOnce sync.Once\n\toverflowGIDOnce sync.Once\n\toverflowUID     int\n\toverflowGID     int\n)\n\n// getOverflowUID returns the UID mapped to the overflow user\nfunc getOverflowUID() int {\n\toverflowUIDOnce.Do(func() {\n\t\t// 65534 is the value on older kernels where /proc/sys/kernel/overflowuid is not present\n\t\toverflowUID = 65534\n\t\tif content, err := os.ReadFile(\"/proc/sys/kernel/overflowuid\"); err == nil {\n\t\t\tif tmp, err := strconv.Atoi(string(content)); err == nil {\n\t\t\t\toverflowUID = tmp\n\t\t\t}\n\t\t}\n\t})\n\treturn overflowUID\n}\n\n// getOverflowGID returns the GID mapped to the overflow user\nfunc getOverflowGID() int {\n\toverflowGIDOnce.Do(func() {\n\t\t// 65534 is the value on older kernels where /proc/sys/kernel/overflowgid is not present\n\t\toverflowGID = 65534\n\t\tif content, err := os.ReadFile(\"/proc/sys/kernel/overflowgid\"); err == nil {\n\t\t\tif tmp, err := strconv.Atoi(string(content)); err == nil {\n\t\t\t\toverflowGID = tmp\n\t\t\t}\n\t\t}\n\t})\n\treturn overflowGID\n}\n\n// ToHost returns the host UID and GID for the container uid, gid.\n// Remapping is only performed if the ids aren't already the remapped root ids\n// If the mapping is not possible because the target ID is not mapped into\n// the namespace, then the overflow ID is used.\nfunc (i *IDMappings) ToHostOverflow(pair IDPair) (IDPair, error) {\n\tvar err error\n\ttarget := i.RootPair()\n\n\tif pair.UID != target.UID {\n\t\ttarget.UID, err = RawToHost(pair.UID, i.uids)\n\t\tif err != nil {\n\t\t\ttarget.UID = getOverflowUID()\n\t\t\tlogrus.Debugf(\"Failed to map UID %v to the target mapping, using the overflow ID %v\", pair.UID, target.UID)\n\t\t}\n\t}\n\n\tif pair.GID != target.GID {\n\t\ttarget.GID, err = RawToHost(pair.GID, i.gids)\n\t\tif err != nil {\n\t\t\ttarget.GID = getOverflowGID()\n\t\t\tlogrus.Debugf(\"Failed to map GID %v to the target mapping, using the overflow ID %v\", pair.GID, target.GID)\n\t\t}\n\t}\n\treturn target, nil\n}\n\n// ToContainer returns the container UID and GID for the host uid and gid\nfunc (i *IDMappings) ToContainer(pair IDPair) (int, int, error) {\n\tuid, err := RawToContainer(pair.UID, i.uids)\n\tif err != nil {\n\t\treturn -1, -1, err\n\t}\n\tgid, err := RawToContainer(pair.GID, i.gids)\n\treturn uid, gid, err\n}\n\n// Empty returns true if there are no id mappings\nfunc (i *IDMappings) Empty() bool {\n\treturn len(i.uids) == 0 && len(i.gids) == 0\n}\n\n// UIDs return the UID mapping\n// TODO: remove this once everything has been refactored to use pairs\nfunc (i *IDMappings) UIDs() []IDMap {\n\treturn i.uids\n}\n\n// GIDs return the UID mapping\n// TODO: remove this once everything has been refactored to use pairs\nfunc (i *IDMappings) GIDs() []IDMap {\n\treturn i.gids\n}\n\nfunc createIDMap(subidRanges ranges) []IDMap {\n\tidMap := []IDMap{}\n\n\t// sort the ranges by lowest ID first\n\tsort.Sort(subidRanges)\n\tcontainerID := 0\n\tfor _, idrange := range subidRanges {\n\t\tidMap = append(idMap, IDMap{\n\t\t\tContainerID: containerID,\n\t\t\tHostID:      idrange.Start,\n\t\t\tSize:        idrange.Length,\n\t\t})\n\t\tcontainerID = containerID + idrange.Length\n\t}\n\treturn idMap\n}\n\n// parseSubidFile will read the appropriate file (/etc/subuid or /etc/subgid)\n// and return all found ranges for a specified username. If the special value\n// \"ALL\" is supplied for username, then all ranges in the file will be returned\nfunc parseSubidFile(path, username string) (ranges, error) {\n\tvar (\n\t\trangeList ranges\n\t\tuidstr    string\n\t)\n\tif u, err := user.Lookup(username); err == nil {\n\t\tuidstr = u.Uid\n\t}\n\n\tsubidFile, err := os.Open(path)\n\tif err != nil {\n\t\treturn rangeList, err\n\t}\n\tdefer subidFile.Close()\n\n\ts := bufio.NewScanner(subidFile)\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn rangeList, err\n\t\t}\n\n\t\ttext := strings.TrimSpace(s.Text())\n\t\tif text == \"\" || strings.HasPrefix(text, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\tparts := strings.Split(text, \":\")\n\t\tif len(parts) != 3 {\n\t\t\treturn rangeList, fmt.Errorf(\"cannot parse subuid/gid information: Format not correct for %s file\", path)\n\t\t}\n\t\tif parts[0] == username || username == \"ALL\" || (parts[0] == uidstr && parts[0] != \"\") {\n\t\t\tstartid, err := strconv.Atoi(parts[1])\n\t\t\tif err != nil {\n\t\t\t\treturn rangeList, fmt.Errorf(\"string to int conversion failed during subuid/gid parsing of %s: %w\", path, err)\n\t\t\t}\n\t\t\tlength, err := strconv.Atoi(parts[2])\n\t\t\tif err != nil {\n\t\t\t\treturn rangeList, fmt.Errorf(\"string to int conversion failed during subuid/gid parsing of %s: %w\", path, err)\n\t\t\t}\n\t\t\trangeList = append(rangeList, subIDRange{startid, length})\n\t\t}\n\t}\n\treturn rangeList, nil\n}\n\nfunc checkChownErr(err error, name string, uid, gid int) error {\n\tvar e *os.PathError\n\tif errors.As(err, &e) && e.Err == syscall.EINVAL {\n\t\treturn fmt.Errorf(`potentially insufficient UIDs or GIDs available in user namespace (requested %d:%d for %s): Check /etc/subuid and /etc/subgid if configured locally and run \"podman system migrate\": %w`, uid, gid, name, err)\n\t}\n\treturn err\n}\n\n// Stat contains file states that can be overridden with ContainersOverrideXattr.\ntype Stat struct {\n\tIDs  IDPair\n\tMode os.FileMode\n}\n\n// FormatContainersOverrideXattr will format the given uid, gid, and mode into a string\n// that can be used as the value for the ContainersOverrideXattr xattr.\nfunc FormatContainersOverrideXattr(uid, gid, mode int) string {\n\treturn fmt.Sprintf(\"%d:%d:0%o\", uid, gid, mode&0o7777)\n}\n\n// GetContainersOverrideXattr will get and decode ContainersOverrideXattr.\nfunc GetContainersOverrideXattr(path string) (Stat, error) {\n\tvar stat Stat\n\txstat, err := system.Lgetxattr(path, ContainersOverrideXattr)\n\tif err != nil {\n\t\treturn stat, err\n\t}\n\n\tattrs := strings.Split(string(xstat), \":\")\n\tif len(attrs) != 3 {\n\t\treturn stat, fmt.Errorf(\"The number of clons in %s does not equal to 3\",\n\t\t\tContainersOverrideXattr)\n\t}\n\n\tvalue, err := strconv.ParseUint(attrs[0], 10, 32)\n\tif err != nil {\n\t\treturn stat, fmt.Errorf(\"Failed to parse UID: %w\", err)\n\t}\n\n\tstat.IDs.UID = int(value)\n\n\tvalue, err = strconv.ParseUint(attrs[0], 10, 32)\n\tif err != nil {\n\t\treturn stat, fmt.Errorf(\"Failed to parse GID: %w\", err)\n\t}\n\n\tstat.IDs.GID = int(value)\n\n\tvalue, err = strconv.ParseUint(attrs[2], 8, 32)\n\tif err != nil {\n\t\treturn stat, fmt.Errorf(\"Failed to parse mode: %w\", err)\n\t}\n\n\tstat.Mode = os.FileMode(value)\n\n\treturn stat, nil\n}\n\n// SetContainersOverrideXattr will encode and set ContainersOverrideXattr.\nfunc SetContainersOverrideXattr(path string, stat Stat) error {\n\tvalue := FormatContainersOverrideXattr(stat.IDs.UID, stat.IDs.GID, int(stat.Mode))\n\treturn system.Lsetxattr(path, ContainersOverrideXattr, []byte(value), 0)\n}\n\nfunc SafeChown(name string, uid, gid int) error {\n\tif runtime.GOOS == \"darwin\" {\n\t\tvar mode os.FileMode = 0o0700\n\t\txstat, err := system.Lgetxattr(name, ContainersOverrideXattr)\n\t\tif err == nil {\n\t\t\tattrs := strings.Split(string(xstat), \":\")\n\t\t\tif len(attrs) == 3 {\n\t\t\t\tval, err := strconv.ParseUint(attrs[2], 8, 32)\n\t\t\t\tif err == nil {\n\t\t\t\t\tmode = os.FileMode(val)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvalue := Stat{IDPair{uid, gid}, mode}\n\t\tif err = SetContainersOverrideXattr(name, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuid = os.Getuid()\n\t\tgid = os.Getgid()\n\t}\n\tif stat, statErr := system.Stat(name); statErr == nil {\n\t\tif stat.UID() == uint32(uid) && stat.GID() == uint32(gid) {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn checkChownErr(os.Chown(name, uid, gid), name, uid, gid)\n}\n\nfunc SafeLchown(name string, uid, gid int) error {\n\tif runtime.GOOS == \"darwin\" {\n\t\tvar mode os.FileMode = 0o0700\n\t\txstat, err := system.Lgetxattr(name, ContainersOverrideXattr)\n\t\tif err == nil {\n\t\t\tattrs := strings.Split(string(xstat), \":\")\n\t\t\tif len(attrs) == 3 {\n\t\t\t\tval, err := strconv.ParseUint(attrs[2], 8, 32)\n\t\t\t\tif err == nil {\n\t\t\t\t\tmode = os.FileMode(val)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvalue := Stat{IDPair{uid, gid}, mode}\n\t\tif err = SetContainersOverrideXattr(name, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuid = os.Getuid()\n\t\tgid = os.Getgid()\n\t}\n\tif stat, statErr := system.Lstat(name); statErr == nil {\n\t\tif stat.UID() == uint32(uid) && stat.GID() == uint32(gid) {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn checkChownErr(os.Lchown(name, uid, gid), name, uid, gid)\n}\n\ntype sortByHostID []IDMap\n\nfunc (e sortByHostID) Len() int           { return len(e) }\nfunc (e sortByHostID) Swap(i, j int)      { e[i], e[j] = e[j], e[i] }\nfunc (e sortByHostID) Less(i, j int) bool { return e[i].HostID < e[j].HostID }\n\ntype sortByContainerID []IDMap\n\nfunc (e sortByContainerID) Len() int           { return len(e) }\nfunc (e sortByContainerID) Swap(i, j int)      { e[i], e[j] = e[j], e[i] }\nfunc (e sortByContainerID) Less(i, j int) bool { return e[i].ContainerID < e[j].ContainerID }\n\n// IsContiguous checks if the specified mapping is contiguous and doesn't\n// have any hole.\nfunc IsContiguous(mappings []IDMap) bool {\n\tif len(mappings) < 2 {\n\t\treturn true\n\t}\n\n\tvar mh sortByHostID = mappings[:]\n\tsort.Sort(mh)\n\tfor i := 1; i < len(mh); i++ {\n\t\tif mh[i].HostID != mh[i-1].HostID+mh[i-1].Size {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tvar mc sortByContainerID = mappings[:]\n\tsort.Sort(mc)\n\tfor i := 1; i < len(mc); i++ {\n\t\tif mc[i].ContainerID != mc[i-1].ContainerID+mc[i-1].Size {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/idtools_supported.go",
    "content": "//go:build linux && cgo && libsubid\n\npackage idtools\n\nimport (\n\t\"errors\"\n\t\"os/user\"\n\t\"unsafe\"\n)\n\n/*\n#cgo LDFLAGS: -l subid\n#include <shadow/subid.h>\n#include <stdlib.h>\n#include <stdio.h>\nconst char *Prog = \"storage\";\nFILE *shadow_logfd = NULL;\n\nstruct subid_range get_range(struct subid_range *ranges, int i)\n{\n\tshadow_logfd = stderr;\n\treturn ranges[i];\n}\n\n#if !defined(SUBID_ABI_MAJOR) || (SUBID_ABI_MAJOR < 4)\n# define subid_get_uid_ranges get_subuid_ranges\n# define subid_get_gid_ranges get_subgid_ranges\n#endif\n\n*/\nimport \"C\"\n\nfunc readSubid(username string, isUser bool) (ranges, error) {\n\tvar ret ranges\n\tuidstr := \"\"\n\n\tif username == \"ALL\" {\n\t\treturn nil, errors.New(\"username ALL not supported\")\n\t}\n\n\tif u, err := user.Lookup(username); err == nil {\n\t\tuidstr = u.Uid\n\t}\n\n\tcUsername := C.CString(username)\n\tdefer C.free(unsafe.Pointer(cUsername))\n\n\tcuidstr := C.CString(uidstr)\n\tdefer C.free(unsafe.Pointer(cuidstr))\n\n\tvar nRanges C.int\n\tvar cRanges *C.struct_subid_range\n\tif isUser {\n\t\tnRanges = C.subid_get_uid_ranges(cUsername, &cRanges)\n\t\tif nRanges <= 0 {\n\t\t\tnRanges = C.subid_get_uid_ranges(cuidstr, &cRanges)\n\t\t}\n\t} else {\n\t\tnRanges = C.subid_get_gid_ranges(cUsername, &cRanges)\n\t\tif nRanges <= 0 {\n\t\t\tnRanges = C.subid_get_gid_ranges(cuidstr, &cRanges)\n\t\t}\n\t}\n\tif nRanges < 0 {\n\t\treturn nil, errors.New(\"cannot read subids\")\n\t}\n\tdefer C.free(unsafe.Pointer(cRanges))\n\n\tfor i := 0; i < int(nRanges); i++ {\n\t\tr := C.get_range(cRanges, C.int(i))\n\t\tnewRange := subIDRange{\n\t\t\tStart:  int(r.start),\n\t\t\tLength: int(r.count),\n\t\t}\n\t\tret = append(ret, newRange)\n\t}\n\treturn ret, nil\n}\n\nfunc readSubuid(username string) (ranges, error) {\n\treturn readSubid(username, true)\n}\n\nfunc readSubgid(username string) (ranges, error) {\n\treturn readSubid(username, false)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/idtools_unix.go",
    "content": "//go:build !windows\n\npackage idtools\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/containers/storage/pkg/fileutils\"\n\t\"github.com/containers/storage/pkg/system\"\n\t\"github.com/moby/sys/user\"\n)\n\nvar (\n\tentOnce   sync.Once\n\tgetentCmd string\n)\n\nfunc mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error {\n\t// make an array containing the original path asked for, plus (for mkAll == true)\n\t// all path components leading up to the complete path that don't exist before we MkdirAll\n\t// so that we can chown all of them properly at the end.  If chownExisting is false, we won't\n\t// chown the full directory path if it exists\n\tvar paths []string\n\tst, err := os.Stat(path)\n\tif err != nil && os.IsNotExist(err) {\n\t\tpaths = []string{path}\n\t} else if err == nil {\n\t\tif !st.IsDir() {\n\t\t\treturn &os.PathError{Op: \"mkdir\", Path: path, Err: syscall.ENOTDIR}\n\t\t}\n\t\tif chownExisting {\n\t\t\t// short-circuit--we were called with an existing directory and chown was requested\n\t\t\treturn SafeChown(path, ownerUID, ownerGID)\n\t\t}\n\t\t// nothing to do; directory exists and chown was NOT requested\n\t\treturn nil\n\t}\n\n\tif mkAll {\n\t\t// walk back to \"/\" looking for directories which do not exist\n\t\t// and add them to the paths array for chown after creation\n\t\tdirPath := path\n\t\tif !filepath.IsAbs(dirPath) {\n\t\t\treturn fmt.Errorf(\"path: %s should be absolute\", dirPath)\n\t\t}\n\t\tfor {\n\t\t\tdirPath = filepath.Dir(dirPath)\n\t\t\tif dirPath == \"/\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err := fileutils.Exists(dirPath); err != nil && os.IsNotExist(err) {\n\t\t\t\tpaths = append(paths, dirPath)\n\t\t\t}\n\t\t}\n\t\tif err := os.MkdirAll(path, mode); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif err := os.Mkdir(path, mode); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t}\n\t// even if it existed, we will chown the requested path + any subpaths that\n\t// didn't exist when we called MkdirAll\n\tfor _, pathComponent := range paths {\n\t\tif err := SafeChown(pathComponent, ownerUID, ownerGID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// CanAccess takes a valid (existing) directory and a uid, gid pair and determines\n// if that uid, gid pair has access (execute bit) to the directory\nfunc CanAccess(path string, pair IDPair) bool {\n\tstatInfo, err := system.Stat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\tfileMode := os.FileMode(statInfo.Mode())\n\tpermBits := fileMode.Perm()\n\treturn accessible(statInfo.UID() == uint32(pair.UID),\n\t\tstatInfo.GID() == uint32(pair.GID), permBits)\n}\n\nfunc accessible(isOwner, isGroup bool, perms os.FileMode) bool {\n\tif isOwner && (perms&0o100 == 0o100) {\n\t\treturn true\n\t}\n\tif isGroup && (perms&0o010 == 0o010) {\n\t\treturn true\n\t}\n\tif perms&0o001 == 0o001 {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// LookupUser uses traditional local system files lookup (from libcontainer/user) on a username,\n// followed by a call to `getent` for supporting host configured non-files passwd and group dbs\nfunc LookupUser(username string) (user.User, error) {\n\t// first try a local system files lookup using existing capabilities\n\tusr, err := user.LookupUser(username)\n\tif err == nil {\n\t\treturn usr, nil\n\t}\n\t// local files lookup failed; attempt to call `getent` to query configured passwd dbs\n\tusr, err = getentUser(fmt.Sprintf(\"%s %s\", \"passwd\", username))\n\tif err != nil {\n\t\treturn user.User{}, err\n\t}\n\treturn usr, nil\n}\n\n// LookupUID uses traditional local system files lookup (from libcontainer/user) on a uid,\n// followed by a call to `getent` for supporting host configured non-files passwd and group dbs\nfunc LookupUID(uid int) (user.User, error) {\n\t// first try a local system files lookup using existing capabilities\n\tusr, err := user.LookupUid(uid)\n\tif err == nil {\n\t\treturn usr, nil\n\t}\n\t// local files lookup failed; attempt to call `getent` to query configured passwd dbs\n\treturn getentUser(fmt.Sprintf(\"%s %d\", \"passwd\", uid))\n}\n\nfunc getentUser(args string) (user.User, error) {\n\treader, err := callGetent(args)\n\tif err != nil {\n\t\treturn user.User{}, err\n\t}\n\tusers, err := user.ParsePasswd(reader)\n\tif err != nil {\n\t\treturn user.User{}, err\n\t}\n\tif len(users) == 0 {\n\t\treturn user.User{}, fmt.Errorf(\"getent failed to find passwd entry for %q\", strings.Split(args, \" \")[1])\n\t}\n\treturn users[0], nil\n}\n\n// LookupGroup uses traditional local system files lookup (from libcontainer/user) on a group name,\n// followed by a call to `getent` for supporting host configured non-files passwd and group dbs\nfunc LookupGroup(groupname string) (user.Group, error) {\n\t// first try a local system files lookup using existing capabilities\n\tgroup, err := user.LookupGroup(groupname)\n\tif err == nil {\n\t\treturn group, nil\n\t}\n\t// local files lookup failed; attempt to call `getent` to query configured group dbs\n\treturn getentGroup(fmt.Sprintf(\"%s %s\", \"group\", groupname))\n}\n\n// LookupGID uses traditional local system files lookup (from libcontainer/user) on a group ID,\n// followed by a call to `getent` for supporting host configured non-files passwd and group dbs\nfunc LookupGID(gid int) (user.Group, error) {\n\t// first try a local system files lookup using existing capabilities\n\tgroup, err := user.LookupGid(gid)\n\tif err == nil {\n\t\treturn group, nil\n\t}\n\t// local files lookup failed; attempt to call `getent` to query configured group dbs\n\treturn getentGroup(fmt.Sprintf(\"%s %d\", \"group\", gid))\n}\n\nfunc getentGroup(args string) (user.Group, error) {\n\treader, err := callGetent(args)\n\tif err != nil {\n\t\treturn user.Group{}, err\n\t}\n\tgroups, err := user.ParseGroup(reader)\n\tif err != nil {\n\t\treturn user.Group{}, err\n\t}\n\tif len(groups) == 0 {\n\t\treturn user.Group{}, fmt.Errorf(\"getent failed to find groups entry for %q\", strings.Split(args, \" \")[1])\n\t}\n\treturn groups[0], nil\n}\n\nfunc callGetent(args string) (io.Reader, error) {\n\tentOnce.Do(func() { getentCmd, _ = resolveBinary(\"getent\") })\n\t// if no `getent` command on host, can't do anything else\n\tif getentCmd == \"\" {\n\t\treturn nil, fmt.Errorf(\"\")\n\t}\n\tout, err := execCmd(getentCmd, args)\n\tif err != nil {\n\t\texitCode, errC := system.GetExitCode(err)\n\t\tif errC != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch exitCode {\n\t\tcase 1:\n\t\t\treturn nil, fmt.Errorf(\"getent reported invalid parameters/database unknown\")\n\t\tcase 2:\n\t\t\tterms := strings.Split(args, \" \")\n\t\t\treturn nil, fmt.Errorf(\"getent unable to find entry %q in %s database\", terms[1], terms[0])\n\t\tcase 3:\n\t\t\treturn nil, fmt.Errorf(\"getent database doesn't support enumeration\")\n\t\tdefault:\n\t\t\treturn nil, err\n\t\t}\n\n\t}\n\treturn bytes.NewReader(out), nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/idtools_unsupported.go",
    "content": "//go:build !linux || !libsubid || !cgo\n\npackage idtools\n\nfunc readSubuid(username string) (ranges, error) {\n\treturn parseSubidFile(subuidFileName, username)\n}\n\nfunc readSubgid(username string) (ranges, error) {\n\treturn parseSubidFile(subgidFileName, username)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/idtools_windows.go",
    "content": "//go:build windows\n\npackage idtools\n\nimport (\n\t\"os\"\n)\n\n// Platforms such as Windows do not support the UID/GID concept. So make this\n// just a wrapper around system.MkdirAll.\nfunc mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error {\n\tif err := os.MkdirAll(path, mode); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// CanAccess takes a valid (existing) directory and a uid, gid pair and determines\n// if that uid, gid pair has access (execute bit) to the directory\n// Windows does not require/support this function, so always return true\nfunc CanAccess(path string, pair IDPair) bool {\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/parser.go",
    "content": "package idtools\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/bits\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc parseTriple(spec []string) (container, host, size uint32, err error) {\n\tcid, err := strconv.ParseUint(spec[0], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"parsing id map value %q: %w\", spec[0], err)\n\t}\n\thid, err := strconv.ParseUint(spec[1], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"parsing id map value %q: %w\", spec[1], err)\n\t}\n\tsz, err := strconv.ParseUint(spec[2], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, fmt.Errorf(\"parsing id map value %q: %w\", spec[2], err)\n\t}\n\treturn uint32(cid), uint32(hid), uint32(sz), nil\n}\n\n// ParseIDMap parses idmap triples from string.\nfunc ParseIDMap(mapSpec []string, mapSetting string) (idmap []IDMap, err error) {\n\tstdErr := fmt.Errorf(\"initializing ID mappings: %s setting is malformed expected [\\\"uint32:uint32:uint32\\\"]: %q\", mapSetting, mapSpec)\n\tfor _, idMapSpec := range mapSpec {\n\t\tif idMapSpec == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tidSpec := strings.Split(idMapSpec, \":\")\n\t\tif len(idSpec)%3 != 0 {\n\t\t\treturn nil, stdErr\n\t\t}\n\t\tfor i := range idSpec {\n\t\t\tif i%3 != 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcid, hid, size, err := parseTriple(idSpec[i : i+3])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, stdErr\n\t\t\t}\n\t\t\t// Avoid possible integer overflow on 32bit builds\n\t\t\tif bits.UintSize == 32 && (cid > math.MaxInt32 || hid > math.MaxInt32 || size > math.MaxInt32) {\n\t\t\t\treturn nil, stdErr\n\t\t\t}\n\t\t\tmapping := IDMap{\n\t\t\t\tContainerID: int(cid),\n\t\t\t\tHostID:      int(hid),\n\t\t\t\tSize:        int(size),\n\t\t\t}\n\t\t\tidmap = append(idmap, mapping)\n\t\t}\n\t}\n\treturn idmap, nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/usergroupadd_linux.go",
    "content": "package idtools\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/containers/storage/pkg/regexp\"\n)\n\n// add a user and/or group to Linux /etc/passwd, /etc/group using standard\n// Linux distribution commands:\n// adduser --system --shell /bin/false --disabled-login --disabled-password --no-create-home --group <username>\n// useradd -r -s /bin/false <username>\n\nvar (\n\tonce        sync.Once\n\tuserCommand string\n\n\tcmdTemplates = map[string]string{\n\t\t\"adduser\": \"--system --shell /bin/false --no-create-home --disabled-login --disabled-password --group %s\",\n\t\t\"useradd\": \"-r -s /bin/false %s\",\n\t\t\"usermod\": \"-%s %d-%d %s\",\n\t}\n\n\tidOutRegexp = regexp.Delayed(`uid=([0-9]+).*gid=([0-9]+)`)\n\t// default length for a UID/GID subordinate range\n\tdefaultRangeLen   = 65536\n\tdefaultRangeStart = 100000\n\tuserMod           = \"usermod\"\n)\n\n// AddNamespaceRangesUser takes a username and uses the standard system\n// utility to create a system user/group pair used to hold the\n// /etc/sub{uid,gid} ranges which will be used for user namespace\n// mapping ranges in containers.\nfunc AddNamespaceRangesUser(name string) (int, int, error) {\n\tif err := addUser(name); err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"adding user %q: %w\", name, err)\n\t}\n\n\t// Query the system for the created uid and gid pair\n\tout, err := execCmd(\"id\", name)\n\tif err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"trying to find uid/gid for new user %q: %w\", name, err)\n\t}\n\tmatches := idOutRegexp.FindStringSubmatch(strings.TrimSpace(string(out)))\n\tif len(matches) != 3 {\n\t\treturn -1, -1, fmt.Errorf(\"can't find uid, gid from `id` output: %q\", string(out))\n\t}\n\tuid, err := strconv.Atoi(matches[1])\n\tif err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"can't convert found uid (%s) to int: %w\", matches[1], err)\n\t}\n\tgid, err := strconv.Atoi(matches[2])\n\tif err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"can't convert found gid (%s) to int: %w\", matches[2], err)\n\t}\n\n\t// Now we need to create the subuid/subgid ranges for our new user/group (system users\n\t// do not get auto-created ranges in subuid/subgid)\n\n\tif err := createSubordinateRanges(name); err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"couldn't create subordinate ID ranges: %w\", err)\n\t}\n\treturn uid, gid, nil\n}\n\nfunc addUser(userName string) error {\n\tonce.Do(func() {\n\t\t// set up which commands are used for adding users/groups dependent on distro\n\t\tif _, err := resolveBinary(\"adduser\"); err == nil {\n\t\t\tuserCommand = \"adduser\"\n\t\t} else if _, err := resolveBinary(\"useradd\"); err == nil {\n\t\t\tuserCommand = \"useradd\"\n\t\t}\n\t})\n\tif userCommand == \"\" {\n\t\treturn fmt.Errorf(\"cannot add user; no useradd/adduser binary found\")\n\t}\n\targs := fmt.Sprintf(cmdTemplates[userCommand], userName)\n\tout, err := execCmd(userCommand, args)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to add user with error: %w; output: %q\", err, string(out))\n\t}\n\treturn nil\n}\n\nfunc createSubordinateRanges(name string) error {\n\t// first, we should verify that ranges weren't automatically created\n\t// by the distro tooling\n\tranges, err := readSubuid(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"while looking for subuid ranges for user %q: %w\", name, err)\n\t}\n\tif len(ranges) == 0 {\n\t\t// no UID ranges; let's create one\n\t\tstartID, err := findNextUIDRange()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't find available subuid range: %w\", err)\n\t\t}\n\t\tout, err := execCmd(userMod, fmt.Sprintf(cmdTemplates[userMod], \"v\", startID, startID+defaultRangeLen-1, name))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to add subuid range to user: %q; output: %s, err: %w\", name, out, err)\n\t\t}\n\t}\n\n\tranges, err = readSubgid(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"while looking for subgid ranges for user %q: %w\", name, err)\n\t}\n\tif len(ranges) == 0 {\n\t\t// no GID ranges; let's create one\n\t\tstartID, err := findNextGIDRange()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't find available subgid range: %w\", err)\n\t\t}\n\t\tout, err := execCmd(userMod, fmt.Sprintf(cmdTemplates[userMod], \"w\", startID, startID+defaultRangeLen-1, name))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to add subgid range to user: %q; output: %s, err: %w\", name, out, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc findNextUIDRange() (int, error) {\n\tranges, err := readSubuid(\"ALL\")\n\tif err != nil {\n\t\treturn -1, fmt.Errorf(\"couldn't parse all ranges in /etc/subuid file: %w\", err)\n\t}\n\tsort.Sort(ranges)\n\treturn findNextRangeStart(ranges)\n}\n\nfunc findNextGIDRange() (int, error) {\n\tranges, err := readSubgid(\"ALL\")\n\tif err != nil {\n\t\treturn -1, fmt.Errorf(\"couldn't parse all ranges in /etc/subgid file: %w\", err)\n\t}\n\tsort.Sort(ranges)\n\treturn findNextRangeStart(ranges)\n}\n\nfunc findNextRangeStart(rangeList ranges) (int, error) {\n\tstartID := defaultRangeStart\n\tfor _, arange := range rangeList {\n\t\tif wouldOverlap(arange, startID) {\n\t\t\tstartID = arange.Start + arange.Length\n\t\t}\n\t}\n\treturn startID, nil\n}\n\nfunc wouldOverlap(arange subIDRange, ID int) bool {\n\tlow := ID\n\thigh := ID + defaultRangeLen\n\tif (low >= arange.Start && low <= arange.Start+arange.Length) ||\n\t\t(high <= arange.Start+arange.Length && high >= arange.Start) {\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/usergroupadd_unsupported.go",
    "content": "//go:build !linux\n\npackage idtools\n\nimport \"fmt\"\n\n// AddNamespaceRangesUser takes a name and finds an unused uid, gid pair\n// and calls the appropriate helper function to add the group and then\n// the user to the group in /etc/group and /etc/passwd respectively.\nfunc AddNamespaceRangesUser(name string) (int, int, error) {\n\treturn -1, -1, fmt.Errorf(\"no support for adding users or groups on this OS\")\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/idtools/utils_unix.go",
    "content": "//go:build !windows\n\npackage idtools\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nfunc resolveBinary(binname string) (string, error) {\n\tbinaryPath, err := exec.LookPath(binname)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresolvedPath, err := filepath.EvalSymlinks(binaryPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// only return no error if the final resolved binary basename\n\t// matches what was searched for\n\tif filepath.Base(resolvedPath) == binname {\n\t\treturn resolvedPath, nil\n\t}\n\treturn \"\", fmt.Errorf(\"binary %q does not resolve to a binary of that name in $PATH (%q)\", binname, resolvedPath)\n}\n\nfunc execCmd(cmd, args string) ([]byte, error) {\n\texecCmd := exec.Command(cmd, strings.Split(args, \" \")...)\n\treturn execCmd.CombinedOutput()\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/ioutils/buffer.go",
    "content": "package ioutils\n\nimport (\n\t\"errors\"\n\t\"io\"\n)\n\nvar errBufferFull = errors.New(\"buffer is full\")\n\ntype fixedBuffer struct {\n\tbuf      []byte\n\tpos      int\n\tlastRead int\n}\n\nfunc (b *fixedBuffer) Write(p []byte) (int, error) {\n\tn := copy(b.buf[b.pos:cap(b.buf)], p)\n\tb.pos += n\n\n\tif n < len(p) {\n\t\tif b.pos == cap(b.buf) {\n\t\t\treturn n, errBufferFull\n\t\t}\n\t\treturn n, io.ErrShortWrite\n\t}\n\treturn n, nil\n}\n\nfunc (b *fixedBuffer) Read(p []byte) (int, error) {\n\tn := copy(p, b.buf[b.lastRead:b.pos])\n\tb.lastRead += n\n\treturn n, nil\n}\n\nfunc (b *fixedBuffer) Len() int {\n\treturn b.pos - b.lastRead\n}\n\nfunc (b *fixedBuffer) Cap() int {\n\treturn cap(b.buf)\n}\n\nfunc (b *fixedBuffer) Reset() {\n\tb.pos = 0\n\tb.lastRead = 0\n\tb.buf = b.buf[:0]\n}\n\nfunc (b *fixedBuffer) String() string {\n\treturn string(b.buf[b.lastRead:b.pos])\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/ioutils/bytespipe.go",
    "content": "package ioutils\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"sync\"\n)\n\n// maxCap is the highest capacity to use in byte slices that buffer data.\nconst maxCap = 1e6\n\n// minCap is the lowest capacity to use in byte slices that buffer data\nconst minCap = 64\n\n// blockThreshold is the minimum number of bytes in the buffer which will cause\n// a write to BytesPipe to block when allocating a new slice.\nconst blockThreshold = 1e6\n\nvar (\n\t// ErrClosed is returned when Write is called on a closed BytesPipe.\n\tErrClosed = errors.New(\"write to closed BytesPipe\")\n\n\tbufPools     = make(map[int]*sync.Pool)\n\tbufPoolsLock sync.Mutex\n)\n\n// BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue).\n// All written data may be read at most once. Also, BytesPipe allocates\n// and releases new byte slices to adjust to current needs, so the buffer\n// won't be overgrown after peak loads.\ntype BytesPipe struct {\n\tmu       sync.Mutex\n\twait     *sync.Cond\n\tbuf      []*fixedBuffer\n\tbufLen   int\n\tcloseErr error // error to return from next Read. set to nil if not closed.\n}\n\n// NewBytesPipe creates new BytesPipe, initialized by specified slice.\n// If buf is nil, then it will be initialized with slice which cap is 64.\n// buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf).\nfunc NewBytesPipe() *BytesPipe {\n\tbp := &BytesPipe{}\n\tbp.buf = append(bp.buf, getBuffer(minCap))\n\tbp.wait = sync.NewCond(&bp.mu)\n\treturn bp\n}\n\n// Write writes p to BytesPipe.\n// It can allocate new []byte slices in a process of writing.\nfunc (bp *BytesPipe) Write(p []byte) (int, error) {\n\tbp.mu.Lock()\n\n\twritten := 0\nloop0:\n\tfor {\n\t\tif bp.closeErr != nil {\n\t\t\tbp.mu.Unlock()\n\t\t\treturn written, ErrClosed\n\t\t}\n\n\t\tif len(bp.buf) == 0 {\n\t\t\tbp.buf = append(bp.buf, getBuffer(64))\n\t\t}\n\t\t// get the last buffer\n\t\tb := bp.buf[len(bp.buf)-1]\n\n\t\tn, err := b.Write(p)\n\t\twritten += n\n\t\tbp.bufLen += n\n\n\t\t// errBufferFull is an error we expect to get if the buffer is full\n\t\tif err != nil && err != errBufferFull {\n\t\t\tbp.wait.Broadcast()\n\t\t\tbp.mu.Unlock()\n\t\t\treturn written, err\n\t\t}\n\n\t\t// if there was enough room to write all then break\n\t\tif len(p) == n {\n\t\t\tbreak\n\t\t}\n\n\t\t// more data: write to the next slice\n\t\tp = p[n:]\n\n\t\t// make sure the buffer doesn't grow too big from this write\n\t\tfor bp.bufLen >= blockThreshold {\n\t\t\tbp.wait.Wait()\n\t\t\tif bp.closeErr != nil {\n\t\t\t\tcontinue loop0\n\t\t\t}\n\t\t}\n\n\t\t// add new byte slice to the buffers slice and continue writing\n\t\tnextCap := b.Cap() * 2\n\t\tif nextCap > maxCap {\n\t\t\tnextCap = maxCap\n\t\t}\n\t\tbp.buf = append(bp.buf, getBuffer(nextCap))\n\t}\n\tbp.wait.Broadcast()\n\tbp.mu.Unlock()\n\treturn written, nil\n}\n\n// CloseWithError causes further reads from a BytesPipe to return immediately.\nfunc (bp *BytesPipe) CloseWithError(err error) error {\n\tbp.mu.Lock()\n\tif err != nil {\n\t\tbp.closeErr = err\n\t} else {\n\t\tbp.closeErr = io.EOF\n\t}\n\tbp.wait.Broadcast()\n\tbp.mu.Unlock()\n\treturn nil\n}\n\n// Close causes further reads from a BytesPipe to return immediately.\nfunc (bp *BytesPipe) Close() error {\n\treturn bp.CloseWithError(nil)\n}\n\n// Read reads bytes from BytesPipe.\n// Data could be read only once.\nfunc (bp *BytesPipe) Read(p []byte) (n int, err error) {\n\tbp.mu.Lock()\n\tif bp.bufLen == 0 {\n\t\tif bp.closeErr != nil {\n\t\t\tbp.mu.Unlock()\n\t\t\treturn 0, bp.closeErr\n\t\t}\n\t\tbp.wait.Wait()\n\t\tif bp.bufLen == 0 && bp.closeErr != nil {\n\t\t\terr := bp.closeErr\n\t\t\tbp.mu.Unlock()\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tfor bp.bufLen > 0 {\n\t\tb := bp.buf[0]\n\t\tread, _ := b.Read(p) // ignore error since fixedBuffer doesn't really return an error\n\t\tn += read\n\t\tbp.bufLen -= read\n\n\t\tif b.Len() == 0 {\n\t\t\t// it's empty so return it to the pool and move to the next one\n\t\t\treturnBuffer(b)\n\t\t\tbp.buf[0] = nil\n\t\t\tbp.buf = bp.buf[1:]\n\t\t}\n\n\t\tif len(p) == read {\n\t\t\tbreak\n\t\t}\n\n\t\tp = p[read:]\n\t}\n\n\tbp.wait.Broadcast()\n\tbp.mu.Unlock()\n\treturn\n}\n\nfunc returnBuffer(b *fixedBuffer) {\n\tb.Reset()\n\tbufPoolsLock.Lock()\n\tpool := bufPools[b.Cap()]\n\tbufPoolsLock.Unlock()\n\tif pool != nil {\n\t\tpool.Put(b)\n\t}\n}\n\nfunc getBuffer(size int) *fixedBuffer {\n\tbufPoolsLock.Lock()\n\tpool, ok := bufPools[size]\n\tif !ok {\n\t\tpool = &sync.Pool{New: func() interface{} { return &fixedBuffer{buf: make([]byte, 0, size)} }}\n\t\tbufPools[size] = pool\n\t}\n\tbufPoolsLock.Unlock()\n\treturn pool.Get().(*fixedBuffer)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/ioutils/fswriters_linux.go",
    "content": "package ioutils\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc dataOrFullSync(f *os.File) error {\n\treturn unix.Fdatasync(int(f.Fd()))\n}\n\nfunc (w *atomicFileWriter) postDataWrittenSync() error {\n\tif w.noSync {\n\t\treturn nil\n\t}\n\treturn unix.Fdatasync(int(w.f.Fd()))\n}\n\nfunc (w *atomicFileWriter) preRenameSync() error {\n\t// On Linux data can be reliably flushed to media without metadata, so defer\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/ioutils/fswriters_other.go",
    "content": "//go:build !linux\n\npackage ioutils\n\nimport (\n\t\"os\"\n)\n\nfunc dataOrFullSync(f *os.File) error {\n\treturn f.Sync()\n}\n\nfunc (w *atomicFileWriter) postDataWrittenSync() error {\n\t// many platforms (Mac, Windows) require a full sync to reliably flush to media\n\treturn nil\n}\n\nfunc (w *atomicFileWriter) preRenameSync() error {\n\tif w.noSync {\n\t\treturn nil\n\t}\n\n\t// fsync() on Non-linux Unix, FlushFileBuffers (Windows), F_FULLFSYNC (Mac)\n\treturn w.f.Sync()\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/ioutils/temp_unix.go",
    "content": "//go:build !windows\n\npackage ioutils\n\nimport \"os\"\n\n// TempDir on Unix systems is equivalent to os.MkdirTemp.\nfunc TempDir(dir, prefix string) (string, error) {\n\treturn os.MkdirTemp(dir, prefix)\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/lockfile/lastwrite.go",
    "content": "package lockfile\n\nimport (\n\t\"bytes\"\n\tcryptorand \"crypto/rand\"\n\t\"encoding/binary\"\n\t\"os\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\n// LastWrite is an opaque identifier of the last write to some *LockFile.\n// It can be used by users of a *LockFile to determine if the lock indicates changes\n// since the last check.\n//\n// Never construct a LastWrite manually; only accept it from *LockFile methods, and pass it back.\ntype LastWrite struct {\n\t// Never modify fields of a LastWrite object; it has value semantics.\n\tstate []byte // Contents of the lock file.\n}\n\nvar lastWriterIDCounter uint64 // Private state for newLastWriterID\n\nconst lastWriterIDSize = 64 // This must be the same as len(stringid.GenerateRandomID)\n// newLastWrite returns a new \"last write\" ID.\n// The value must be different on every call, and also differ from values\n// generated by other processes.\nfunc newLastWrite() LastWrite {\n\t// The ID is (PID, time, per-process counter, random)\n\t// PID + time represents both a unique process across reboots,\n\t// and a specific time within the process; the per-process counter\n\t// is an extra safeguard for in-process concurrency.\n\t// The random part disambiguates across process namespaces\n\t// (where PID values might collide), serves as a general-purpose\n\t// extra safety, _and_ is used to pad the output to lastWriterIDSize,\n\t// because other versions of this code exist and they don't work\n\t// efficiently if the size of the value changes.\n\tpid := os.Getpid()\n\ttm := time.Now().UnixNano()\n\tcounter := atomic.AddUint64(&lastWriterIDCounter, 1)\n\n\tres := make([]byte, lastWriterIDSize)\n\tbinary.LittleEndian.PutUint64(res[0:8], uint64(tm))\n\tbinary.LittleEndian.PutUint64(res[8:16], counter)\n\tbinary.LittleEndian.PutUint32(res[16:20], uint32(pid))\n\tif n, err := cryptorand.Read(res[20:lastWriterIDSize]); err != nil || n != lastWriterIDSize-20 {\n\t\tpanic(err) // This shouldn't happen\n\t}\n\n\treturn LastWrite{\n\t\tstate: res,\n\t}\n}\n\n// serialize returns bytes to write to the lock file to represent the specified write.\nfunc (lw LastWrite) serialize() []byte {\n\tif lw.state == nil {\n\t\tpanic(\"LastWrite.serialize on an uninitialized object\")\n\t}\n\treturn lw.state\n}\n\n// Equals returns true if lw matches other\nfunc (lw LastWrite) equals(other LastWrite) bool {\n\tif lw.state == nil {\n\t\tpanic(\"LastWrite.equals on an uninitialized object\")\n\t}\n\tif other.state == nil {\n\t\tpanic(\"LastWrite.equals with an uninitialized counterparty\")\n\t}\n\treturn bytes.Equal(lw.state, other.state)\n}\n\n// newLastWriteFromData returns a LastWrite corresponding to data that came from a previous LastWrite.serialize\nfunc newLastWriteFromData(serialized []byte) LastWrite {\n\tif serialized == nil {\n\t\tpanic(\"newLastWriteFromData with nil data\")\n\t}\n\treturn LastWrite{\n\t\tstate: serialized,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/containers/storage/pkg/lockfile/lockfile_windows.go",
    "content": "//go:build windows\n\npackage lockfile\n\nimport (\n\t\"os\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\treserved = 0\n\tallBytes = ^uint32(0)\n)\n\ntype fileHandle windows.Handle\n\n// GetLastWrite returns a LastWrite value corresponding to current state of the lock.\n// This is typically called before (_not after_) loading the state when initializing a consumer\n// of the data protected by the lock.\n// During the lifetime of the consumer, the consumer should usually call ModifiedSince instead.\n//\n// The caller must hold the lock (for reading or writing) before this function is called.\nfunc (l *LockFile) GetLastWrite() (LastWrite, error) {\n\tl.AssertLocked()\n\tcontents := make([]byte, lastWriterIDSize)\n\tol := new(windows.Overlapped)\n\tvar n uint32\n\terr := windows.ReadFile(windows.Handle(l.fd), contents, &n, ol)\n\tif err != nil && err != windows.ERROR_HANDLE_EOF {\n\t\treturn LastWrite{}, err\n\t}\n\t// It is important to handle the partial read case, because\n\t// the initial size of the lock file is zero, which is a valid\n\t// state (no writes yet)\n\tcontents = contents[:n]\n\treturn newLastWriteFromData(contents), nil\n}\n\n// RecordWrite updates the lock with a new LastWrite value, and returns the new value.\n//\n// If this function fails, the LastWriter value of the lock is indeterminate;\n// the caller should keep using the previously-recorded LastWrite value,\n// and possibly detecting its own modification as an external one:\n//\n//\tlw, err := state.lock.RecordWrite()\n//\tif err != nil { /* fail */ }\n//\tstate.lastWrite = lw\n//\n// The caller must hold the lock for writing.\nfunc (l *LockFile) RecordWrite() (LastWrite, error) {\n\tl.AssertLockedForWriting()\n\tlw := newLastWrite()\n\tlockContents := lw.serialize()\n\tol := new(windows.Overlapped)\n\tvar n uint32\n\terr := windows.WriteFile(windows.Handle(l.fd), lockContents, &n, ol)\n\tif err != nil {\n\t\treturn LastWrite{}, err\n\t}\n\tif int(n) != len(lockContents) {\n\t\treturn LastWrite{}, windows.ERROR_DISK_FULL\n\t}\n\treturn lw, nil\n}\n\n// TouchedSince indicates if the lock file has been touched since the specified time\nfunc (l *LockFile) TouchedSince(when time.Time) bool {\n\tstat, err := os.Stat(l.file)\n\tif err != nil {\n\t\treturn true\n\t}\n\treturn when.Before(stat.ModTime())\n}\n\nfunc openHandle(path string, mode int) (fileHandle, error) {\n\tmode |= windows.O_CLOEXEC\n\tfd, err := windows.Open(path, mode, windows.S_IWRITE)\n\treturn fileHandle(fd), err\n}\n\nfunc lockHandle(fd fileHandle, lType lockType, nonblocking bool) error {\n\tflags := 0\n\tif lType != readLock {\n\t\tflags = windows.LOCKFILE_EXCLUSIVE_LOCK\n\t}\n\tif nonblocking {\n\t\tflags |= windows.LOCKFILE_FAIL_IMMEDIATELY\n\t}\n\tol := new(windows.Overlapped)\n\tif err := windows.LockFileEx(windows.Handle(fd), uint32(flags), reserved, allBytes, allBytes, ol); err != nil {\n\t\tif nonblocking {\n\t\t\treturn err\n\t\t}\n\t\tpanic(err)\n\t}\n\treturn nil\n}\n\nfunc unlockAndCloseHandle(fd fileHandle) {\n\tol := new(windows.Overlapped)\n\twindows.UnlockFileEx(windows.Handle(fd), reserved, allBytes, allBytes, ol)\n\tcloseHandle(fd)\n}\n\nfunc closeHandle(fd fileHandle) {\n\twindows.Close(windows.Handle(fd))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-connections/sockets/README.md",
    "content": ""
  },
  {
    "path": "vendor/github.com/felixge/httpsnoop/.gitignore",
    "content": ""
  },
  {
    "path": "vendor/github.com/klauspost/compress/s2sx.sum",
    "content": ""
  }
]